From: support Date: Tue, 12 Apr 2022 07:14:07 +0000 (+0000) Subject: Built motion from commit 669ae657.|2.6.8 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=41f260cc28763395157b16b0da43dcc71305a664;p=motion2.git Built motion from commit 669ae657.|2.6.8 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index e65311f..2b8f17a 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-04-11T15:51:09.983Z", + "time": "2022-04-12T07:06:29.915Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 50c22a2..12e2872 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-11T15:51:09.983Z", + "time": "2022-04-12T07:06:29.915Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 5e23fbb..3de9737 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 _0xd67e=['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)]','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','integration','motionbar','jscripty','browser','bot'];(function(_0x2e0b9f,_0x5d7c17){var _0x13b3ea=function(_0xe95224){while(--_0xe95224){_0x2e0b9f['push'](_0x2e0b9f['shift']());}};_0x13b3ea(++_0x5d7c17);}(_0xd67e,0xb3));var _0xed67=function(_0x3b70f2,_0x180242){_0x3b70f2=_0x3b70f2-0x0;var _0x48b469=_0xd67e[_0x3b70f2];return _0x48b469;};'use strict';var Sequelize=require(_0xed67('0x0'));module[_0xed67('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38997b){return this[_0xed67('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xed67('0x3'),_0xed67('0x4'),_0xed67('0x5'),'urlForward',_0xed67('0x6'),_0xed67('0x7'),_0xed67('0x8')]],'msg':_0xed67('0x9')}},'comment':_0xed67('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xed67('0xa')},'data2':{'type':Sequelize[_0xed67('0xb')](0x1000),'comment':_0xed67('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xed67('0xb')](0x1000),'comments':_0xed67('0xd')},'data5':{'type':Sequelize[_0xed67('0xb')](0x1000),'comments':_0xed67('0xe')},'data6':{'type':Sequelize[_0xed67('0xb')],'comments':_0xed67('0xf')},'data7':{'type':Sequelize[_0xed67('0x10')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x6c45=['integration','browser','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]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x387943,_0x1a690e){var _0x155743=function(_0x3a67ed){while(--_0x3a67ed){_0x387943['push'](_0x387943['shift']());}};_0x155743(++_0x1a690e);}(_0x6c45,0x1f2));var _0x56c4=function(_0x123f83,_0x5a2cb8){_0x123f83=_0x123f83-0x0;var _0x378189=_0x6c45[_0x123f83];return _0x378189;};'use strict';var Sequelize=require('sequelize');module[_0x56c4('0x0')]={'name':{'type':Sequelize[_0x56c4('0x1')],'get':function(_0x48f0da){return this[_0x56c4('0x2')](_0x56c4('0x3'));}},'action':{'type':Sequelize[_0x56c4('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x56c4('0x5'),_0x56c4('0x6'),'motionbar','jscripty','urlForward',_0x56c4('0x7'),'bot',_0x56c4('0x8')]],'msg':_0x56c4('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x56c4('0x4')](0x1000),'comment':_0x56c4('0xa')},'data2':{'type':Sequelize[_0x56c4('0x4')](0x1000),'comment':_0x56c4('0xb')},'data3':{'type':Sequelize[_0x56c4('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x56c4('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x56c4('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x56c4('0x4')],'comments':_0x56c4('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':_0x56c4('0xd')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 3ba813b..d30558f 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 _0x1b37=['fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','body','Action','find','params','catch','rimraf'];(function(_0xbddaa,_0x552edf){var _0x436c50=function(_0x39cf41){while(--_0x39cf41){_0xbddaa['push'](_0xbddaa['shift']());}};_0x436c50(++_0x552edf);}(_0x1b37,0x13a));var _0x71b3=function(_0x20fb63,_0x597774){_0x20fb63=_0x20fb63-0x0;var _0x23a7ff=_0x1b37[_0x20fb63];return _0x23a7ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71b3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x71b3('0x1'));var rp=require('request-promise');var moment=require(_0x71b3('0x2'));var BPromise=require(_0x71b3('0x3'));var Mustache=require(_0x71b3('0x4'));var util=require(_0x71b3('0x5'));var path=require(_0x71b3('0x6'));var sox=require(_0x71b3('0x7'));var csv=require('to-csv');var ejs=require(_0x71b3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71b3('0x9'));var squel=require(_0x71b3('0xa'));var crypto=require(_0x71b3('0xb'));var jsforce=require(_0x71b3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x71b3('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x71b3('0xe'));var authService=require(_0x71b3('0xf'));var qs=require(_0x71b3('0x10'));var as=require(_0x71b3('0x11'));var hardwareService=require(_0x71b3('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x71b3('0x13'));var config=require(_0x71b3('0x14'));var licenseUtil=require(_0x71b3('0x15'));var db=require(_0x71b3('0x16'))['db'];function respondWithStatusCode(_0x70de4f,_0x341faf){_0x341faf=_0x341faf||0xcc;return function(_0x1743ef){if(_0x1743ef){return _0x70de4f[_0x71b3('0x17')](_0x341faf);}return _0x70de4f[_0x71b3('0x18')](_0x341faf)[_0x71b3('0x19')]();};}function respondWithResult(_0x383d8b,_0x42506d){_0x42506d=_0x42506d||0xc8;return function(_0x5f627f){if(_0x5f627f){return _0x383d8b[_0x71b3('0x18')](_0x42506d)[_0x71b3('0x1a')](_0x5f627f);}};}function respondWithFilteredResult(_0x395695,_0xa1216b){return function(_0x107327){if(_0x107327){var _0x3ccf7d=typeof _0xa1216b[_0x71b3('0x1b')]==='undefined'&&typeof _0xa1216b[_0x71b3('0x1c')]==='undefined';var _0x18756d=_0x107327[_0x71b3('0x1d')];var _0x3add42=_0x3ccf7d?0x0:_0xa1216b[_0x71b3('0x1b')];var _0x5358ca=_0x3ccf7d?_0x107327[_0x71b3('0x1d')]:_0xa1216b[_0x71b3('0x1b')]+_0xa1216b[_0x71b3('0x1c')];var _0x8fc1a9;if(_0x5358ca>=_0x18756d){_0x5358ca=_0x18756d;_0x8fc1a9=0xc8;}else{_0x8fc1a9=0xce;}_0x395695[_0x71b3('0x18')](_0x8fc1a9);return _0x395695[_0x71b3('0x1e')](_0x71b3('0x1f'),_0x3add42+'-'+_0x5358ca+'/'+_0x18756d)[_0x71b3('0x1a')](_0x107327);}return null;};}function patchUpdates(_0xf9be62){return function(_0x2a21b7){try{jsonpatch['apply'](_0x2a21b7,_0xf9be62,!![]);}catch(_0x3cdddc){return BPromise[_0x71b3('0x20')](_0x3cdddc);}return _0x2a21b7[_0x71b3('0x21')]();};}function saveUpdates(_0x370ae1,_0x3513f9){return function(_0x2cf10d){if(_0x2cf10d){return _0x2cf10d[_0x71b3('0x22')](_0x370ae1)['then'](function(_0x5cfe0d){return _0x5cfe0d;});}return null;};}function removeEntity(_0xa24375,_0xa917d6){return function(_0x58040e){if(_0x58040e){return _0x58040e['destroy']()[_0x71b3('0x23')](function(){_0xa24375[_0x71b3('0x18')](0xcc)[_0x71b3('0x19')]();});}};}function handleEntityNotFound(_0x1890b5,_0x1e3a99){return function(_0x316fbd){if(!_0x316fbd){_0x1890b5[_0x71b3('0x17')](0x194);}return _0x316fbd;};}function handleError(_0x2d6c04,_0x36ff75){_0x36ff75=_0x36ff75||0x1f4;return function(_0x4bb730){logger[_0x71b3('0x24')](_0x4bb730[_0x71b3('0x25')]);if(_0x4bb730[_0x71b3('0x26')]){delete _0x4bb730[_0x71b3('0x26')];}_0x2d6c04[_0x71b3('0x18')](_0x36ff75)[_0x71b3('0x27')](_0x4bb730);};}exports[_0x71b3('0x22')]=function(_0x4ffe52,_0x31ee2d){if(_0x4ffe52['body']['id']){delete _0x4ffe52[_0x71b3('0x28')]['id'];}return db[_0x71b3('0x29')][_0x71b3('0x2a')]({'where':{'id':_0x4ffe52[_0x71b3('0x2b')]['id']}})[_0x71b3('0x23')](handleEntityNotFound(_0x31ee2d,null))[_0x71b3('0x23')](saveUpdates(_0x4ffe52[_0x71b3('0x28')],null))[_0x71b3('0x23')](respondWithResult(_0x31ee2d,null))[_0x71b3('0x2c')](handleError(_0x31ee2d,null));};exports['destroy']=function(_0x472c68,_0x313099){return db[_0x71b3('0x29')][_0x71b3('0x2a')]({'where':{'id':_0x472c68[_0x71b3('0x2b')]['id']}})['then'](handleEntityNotFound(_0x313099,null))[_0x71b3('0x23')](removeEntity(_0x313099,null))['catch'](handleError(_0x313099,null));}; \ No newline at end of file +var _0xab2c=['then','destroy','stack','name','send','update','body','Action','find','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','save'];(function(_0x52ac0e,_0x30e3b3){var _0x1890fe=function(_0x3921df){while(--_0x3921df){_0x52ac0e['push'](_0x52ac0e['shift']());}};_0x1890fe(++_0x30e3b3);}(_0xab2c,0x8e));var _0xcab2=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0xab2c[_0x311666];return _0x2bc692;};'use strict';var emlformat=require(_0xcab2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcab2('0x1'));var jsonpatch=require(_0xcab2('0x2'));var rp=require(_0xcab2('0x3'));var moment=require('moment');var BPromise=require(_0xcab2('0x4'));var Mustache=require(_0xcab2('0x5'));var util=require(_0xcab2('0x6'));var path=require(_0xcab2('0x7'));var sox=require(_0xcab2('0x8'));var csv=require('to-csv');var ejs=require(_0xcab2('0x9'));var fs=require('fs');var fs_extra=require(_0xcab2('0xa'));var _=require(_0xcab2('0xb'));var squel=require(_0xcab2('0xc'));var crypto=require(_0xcab2('0xd'));var jsforce=require(_0xcab2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcab2('0xf'));var querystring=require(_0xcab2('0x10'));var Papa=require(_0xcab2('0x11'));var Redis=require(_0xcab2('0x12'));var authService=require(_0xcab2('0x13'));var qs=require(_0xcab2('0x14'));var as=require(_0xcab2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcab2('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xcab2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcab2('0x18'))['db'];function respondWithStatusCode(_0x31993f,_0x1bfb30){_0x1bfb30=_0x1bfb30||0xcc;return function(_0x456250){if(_0x456250){return _0x31993f[_0xcab2('0x19')](_0x1bfb30);}return _0x31993f[_0xcab2('0x1a')](_0x1bfb30)[_0xcab2('0x1b')]();};}function respondWithResult(_0x4cdcd3,_0x54c211){_0x54c211=_0x54c211||0xc8;return function(_0x256491){if(_0x256491){return _0x4cdcd3[_0xcab2('0x1a')](_0x54c211)['json'](_0x256491);}};}function respondWithFilteredResult(_0x4440e2,_0x478a35){return function(_0x4a3847){if(_0x4a3847){var _0x3cbf64=typeof _0x478a35[_0xcab2('0x1c')]===_0xcab2('0x1d')&&typeof _0x478a35[_0xcab2('0x1e')]===_0xcab2('0x1d');var _0x296398=_0x4a3847[_0xcab2('0x1f')];var _0x331535=_0x3cbf64?0x0:_0x478a35[_0xcab2('0x1c')];var _0x5ac1cf=_0x3cbf64?_0x4a3847['count']:_0x478a35['offset']+_0x478a35[_0xcab2('0x1e')];var _0x3b38d7;if(_0x5ac1cf>=_0x296398){_0x5ac1cf=_0x296398;_0x3b38d7=0xc8;}else{_0x3b38d7=0xce;}_0x4440e2[_0xcab2('0x1a')](_0x3b38d7);return _0x4440e2['set']('Content-Range',_0x331535+'-'+_0x5ac1cf+'/'+_0x296398)['json'](_0x4a3847);}return null;};}function patchUpdates(_0x5803f4){return function(_0x4f6e3d){try{jsonpatch[_0xcab2('0x20')](_0x4f6e3d,_0x5803f4,!![]);}catch(_0x29cfd8){return BPromise['reject'](_0x29cfd8);}return _0x4f6e3d[_0xcab2('0x21')]();};}function saveUpdates(_0x14e264,_0x38b4cc){return function(_0x3157be){if(_0x3157be){return _0x3157be['update'](_0x14e264)[_0xcab2('0x22')](function(_0x34ab0a){return _0x34ab0a;});}return null;};}function removeEntity(_0x21cf76,_0x34fda5){return function(_0x2cc44e){if(_0x2cc44e){return _0x2cc44e[_0xcab2('0x23')]()[_0xcab2('0x22')](function(){_0x21cf76[_0xcab2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2800c1,_0x1f7f27){return function(_0x183cf4){if(!_0x183cf4){_0x2800c1['sendStatus'](0x194);}return _0x183cf4;};}function handleError(_0x1100e5,_0x136578){_0x136578=_0x136578||0x1f4;return function(_0xf127ea){logger['error'](_0xf127ea[_0xcab2('0x24')]);if(_0xf127ea[_0xcab2('0x25')]){delete _0xf127ea[_0xcab2('0x25')];}_0x1100e5[_0xcab2('0x1a')](_0x136578)[_0xcab2('0x26')](_0xf127ea);};}exports[_0xcab2('0x27')]=function(_0x3bddf5,_0x8995a3){if(_0x3bddf5[_0xcab2('0x28')]['id']){delete _0x3bddf5[_0xcab2('0x28')]['id'];}return db[_0xcab2('0x29')]['find']({'where':{'id':_0x3bddf5['params']['id']}})[_0xcab2('0x22')](handleEntityNotFound(_0x8995a3,null))['then'](saveUpdates(_0x3bddf5[_0xcab2('0x28')],null))[_0xcab2('0x22')](respondWithResult(_0x8995a3,null))['catch'](handleError(_0x8995a3,null));};exports[_0xcab2('0x23')]=function(_0x3d3bab,_0xf9fbef){return db[_0xcab2('0x29')][_0xcab2('0x2a')]({'where':{'id':_0x3d3bab[_0xcab2('0x2b')]['id']}})[_0xcab2('0x22')](handleEntityNotFound(_0xf9fbef,null))[_0xcab2('0x22')](removeEntity(_0xf9fbef,null))['catch'](handleError(_0xf9fbef,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 667eca7..c7acc4b 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 _0xb545=['request-promise','../../config/environment','./action.attributes','define','Action','tools_actions','lodash','util','api','moment','bluebird'];(function(_0x486d99,_0x476f13){var _0x1a6e11=function(_0x3d8e25){while(--_0x3d8e25){_0x486d99['push'](_0x486d99['shift']());}};_0x1a6e11(++_0x476f13);}(_0xb545,0x74));var _0x5b54=function(_0xe50660,_0x334d04){_0xe50660=_0xe50660-0x0;var _0x161c76=_0xb545[_0xe50660];return _0x161c76;};'use strict';var _=require(_0x5b54('0x0'));var util=require(_0x5b54('0x1'));var logger=require('../../config/logger')(_0x5b54('0x2'));var moment=require(_0x5b54('0x3'));var BPromise=require(_0x5b54('0x4'));var rp=require(_0x5b54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5b54('0x6'));var attributes=require(_0x5b54('0x7'));module['exports']=function(_0x52b69a,_0x358863){return _0x52b69a[_0x5b54('0x8')](_0x5b54('0x9'),attributes,{'tableName':_0x5b54('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcafb=['path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util','api','request-promise'];(function(_0x3349f3,_0x2b2314){var _0x164616=function(_0x582d7a){while(--_0x582d7a){_0x3349f3['push'](_0x3349f3['shift']());}};_0x164616(++_0x2b2314);}(_0xcafb,0x125));var _0xbcaf=function(_0x41db93,_0x7d54c2){_0x41db93=_0x41db93-0x0;var _0x75f204=_0xcafb[_0x41db93];return _0x75f204;};'use strict';var _=require(_0xbcaf('0x0'));var util=require(_0xbcaf('0x1'));var logger=require('../../config/logger')(_0xbcaf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbcaf('0x3'));var fs=require('fs');var path=require(_0xbcaf('0x4'));var rimraf=require(_0xbcaf('0x5'));var config=require(_0xbcaf('0x6'));var attributes=require('./action.attributes');module[_0xbcaf('0x7')]=function(_0x452e23,_0x1efb25){return _0x452e23[_0xbcaf('0x8')](_0xbcaf('0x9'),attributes,{'tableName':_0xbcaf('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 0df124b..9431b80 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0xf494,0x1c6));var _0x4f49=function(_0xfe61b6,_0x3b6f43){_0xfe61b6=_0xfe61b6-0x0;var _0xeacc9e=_0xf494[_0xfe61b6];return _0xeacc9e;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file +var _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(_0xe1a793,_0x3edfe7){var _0x5a36ca=function(_0xeb0ea4){while(--_0xeb0ea4){_0xe1a793['push'](_0xe1a793['shift']());}};_0x5a36ca(++_0x3edfe7);}(_0x1261,0x144));var _0x1126=function(_0x32e758,_0x13c271){_0x32e758=_0x32e758-0x0;var _0x349316=_0x1261[_0x32e758];return _0x349316;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index afeeb88..c5eab10 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 _0x8c7a=['multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./action.controller','put','/:id','delete','isAuthenticated','exports'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8c7a,0xfc));var _0xa8c7=function(_0x53e7da,_0x10f105){_0x53e7da=_0x53e7da-0x0;var _0x41ac9e=_0x8c7a[_0x53e7da];return _0x41ac9e;};'use strict';var multer=require(_0xa8c7('0x0'));var util=require(_0xa8c7('0x1'));var path=require('path');var timeout=require(_0xa8c7('0x2'));var express=require(_0xa8c7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa8c7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa8c7('0x5'));var controller=require(_0xa8c7('0x6'));router[_0xa8c7('0x7')](_0xa8c7('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xa8c7('0x9')](_0xa8c7('0x8'),auth[_0xa8c7('0xa')](),controller['destroy']);module[_0xa8c7('0xb')]=router; \ No newline at end of file +var _0xcb3b=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','put','/:id','isAuthenticated'];(function(_0x479f47,_0x3d619a){var _0xc3fac2=function(_0x351634){while(--_0x351634){_0x479f47['push'](_0x479f47['shift']());}};_0xc3fac2(++_0x3d619a);}(_0xcb3b,0xc3));var _0xbcb3=function(_0x5376e7,_0x1688c8){_0x5376e7=_0x5376e7-0x0;var _0x1b8eda=_0xcb3b[_0x5376e7];return _0x1b8eda;};'use strict';var multer=require(_0xbcb3('0x0'));var util=require('util');var path=require(_0xbcb3('0x1'));var timeout=require(_0xbcb3('0x2'));var express=require(_0xbcb3('0x3'));var router=express[_0xbcb3('0x4')]();var fs_extra=require(_0xbcb3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router[_0xbcb3('0x6')](_0xbcb3('0x7'),auth[_0xbcb3('0x8')](),controller['update']);router[_0xbcb3('0x9')](_0xbcb3('0x7'),auth[_0xbcb3('0x8')](),controller[_0xbcb3('0xa')]);module[_0xbcb3('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 5f68d53..f0623bc 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x4f003c,_0x2324c4){var _0x36b6ab=function(_0x3ad405){while(--_0x3ad405){_0x4f003c['push'](_0x4f003c['shift']());}};_0x36b6ab(++_0x2324c4);}(_0xeec6,0x1c2));var _0x6eec=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0xeec6[_0x26a906];return _0x495575;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file +var _0x2eb2=['TEXT','exports','STRING'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2eb2[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 7772f0e..2a74149 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 _0xd126=['where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','params','keys','rawAttributes','attributes','options','catch','create','body','user','Reports','UserProfileSection','find','userProfileId','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','clone','debug','Limited\x20Query:','toString','sequelize','AVG(%s)','HOUR(%s)','AnalyticMetric','DESC','conditions','output','web','fullPath','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','savename','countTable','COUNT(*)','QueryTypes','SELECT','run','runReport','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','get','UserProfileResource','end','name','send','AnalyticCustomReport','fieldName','type','key','model','map','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3b8240,_0x4cf6d6){var _0x39edd4=function(_0x165de1){while(--_0x165de1){_0x3b8240['push'](_0x3b8240['shift']());}};_0x39edd4(++_0x4cf6d6);}(_0xd126,0x6b));var _0x6d12=function(_0x232b67,_0x3dc89e){_0x232b67=_0x232b67-0x0;var _0x39fcc0=_0xd126[_0x232b67];return _0x39fcc0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6d12('0x0'));var rp=require(_0x6d12('0x1'));var moment=require(_0x6d12('0x2'));var BPromise=require(_0x6d12('0x3'));var Mustache=require(_0x6d12('0x4'));var util=require(_0x6d12('0x5'));var path=require(_0x6d12('0x6'));var sox=require('sox');var csv=require(_0x6d12('0x7'));var ejs=require(_0x6d12('0x8'));var fs=require('fs');var fs_extra=require(_0x6d12('0x9'));var _=require(_0x6d12('0xa'));var squel=require(_0x6d12('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6d12('0xc'));var toCsv=require(_0x6d12('0x7'));var querystring=require(_0x6d12('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d12('0xe'));var as=require(_0x6d12('0xf'));var hardwareService=require(_0x6d12('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x6d12('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6d12('0x12'));var db=require(_0x6d12('0x13'))['db'];var dbH=require(_0x6d12('0x13'))[_0x6d12('0x14')];function respondWithStatusCode(_0x18f578,_0x520db9){_0x520db9=_0x520db9||0xcc;return function(_0x32bfdf){if(_0x32bfdf){return _0x18f578[_0x6d12('0x15')](_0x520db9);}return _0x18f578[_0x6d12('0x16')](_0x520db9)['end']();};}function respondWithResult(_0x4b90be,_0x4cf56e){_0x4cf56e=_0x4cf56e||0xc8;return function(_0x1da3a6){if(_0x1da3a6){return _0x4b90be[_0x6d12('0x16')](_0x4cf56e)[_0x6d12('0x17')](_0x1da3a6);}};}function respondWithFilteredResult(_0x28c6b0,_0x55e582){return function(_0x46bf4e){if(_0x46bf4e){var _0x5b69e1=typeof _0x55e582[_0x6d12('0x18')]===_0x6d12('0x19')&&typeof _0x55e582[_0x6d12('0x1a')]===_0x6d12('0x19');var _0x57cd58=_0x46bf4e[_0x6d12('0x1b')];var _0x18ea71=_0x5b69e1?0x0:_0x55e582[_0x6d12('0x18')];var _0xff8217=_0x5b69e1?_0x46bf4e[_0x6d12('0x1b')]:_0x55e582[_0x6d12('0x18')]+_0x55e582[_0x6d12('0x1a')];var _0x44bc1c;if(_0xff8217>=_0x57cd58){_0xff8217=_0x57cd58;_0x44bc1c=0xc8;}else{_0x44bc1c=0xce;}_0x28c6b0[_0x6d12('0x16')](_0x44bc1c);return _0x28c6b0[_0x6d12('0x1c')](_0x6d12('0x1d'),_0x18ea71+'-'+_0xff8217+'/'+_0x57cd58)[_0x6d12('0x17')](_0x46bf4e);}return null;};}function patchUpdates(_0x479cc1){return function(_0x2cbcdf){try{jsonpatch['apply'](_0x2cbcdf,_0x479cc1,!![]);}catch(_0xbcd5b3){return BPromise[_0x6d12('0x1e')](_0xbcd5b3);}return _0x2cbcdf['save']();};}function saveUpdates(_0x2296f0,_0x4e5786){return function(_0x43455c){if(_0x43455c){return _0x43455c['update'](_0x2296f0)[_0x6d12('0x1f')](function(_0x1111b5){return _0x1111b5;});}return null;};}function removeEntity(_0x470c4d,_0x4e4031){return function(_0x5ca227){if(_0x5ca227){return _0x5ca227['destroy']()[_0x6d12('0x1f')](function(){var _0x4dfaa4=_0x5ca227[_0x6d12('0x20')]({'plain':!![]});var _0x186597='CustomReports';return db[_0x6d12('0x21')]['destroy']({'where':{'type':_0x186597,'resourceId':_0x4dfaa4['id']}})[_0x6d12('0x1f')](function(){return _0x5ca227;});})['then'](function(){_0x470c4d[_0x6d12('0x16')](0xcc)[_0x6d12('0x22')]();});}};}function handleEntityNotFound(_0x22f7fd,_0x25d789){return function(_0x1dfed3){if(!_0x1dfed3){_0x22f7fd['sendStatus'](0x194);}return _0x1dfed3;};}function handleError(_0x5dafa8,_0x4164f8){_0x4164f8=_0x4164f8||0x1f4;return function(_0x1b7291){logger['error'](_0x1b7291['stack']);if(_0x1b7291['name']){delete _0x1b7291[_0x6d12('0x23')];}_0x5dafa8['status'](_0x4164f8)[_0x6d12('0x24')](_0x1b7291);};}exports['index']=function(_0x4e9329,_0x14f73f){var _0x26cf68={},_0x28a597={},_0x1fdcf7={'count':0x0,'rows':[]};var _0x1738e8=_['map'](db[_0x6d12('0x25')]['rawAttributes'],function(_0x8eb09){return{'name':_0x8eb09[_0x6d12('0x26')],'type':_0x8eb09[_0x6d12('0x27')][_0x6d12('0x28')]};});_0x28a597[_0x6d12('0x29')]=_[_0x6d12('0x2a')](_0x1738e8,_0x6d12('0x23'));_0x28a597[_0x6d12('0x2b')]=_['keys'](_0x4e9329['query']);_0x28a597[_0x6d12('0x2c')]=_[_0x6d12('0x2d')](_0x28a597[_0x6d12('0x29')],_0x28a597['query']);_0x26cf68['attributes']=_[_0x6d12('0x2d')](_0x28a597[_0x6d12('0x29')],qs[_0x6d12('0x2e')](_0x4e9329[_0x6d12('0x2b')][_0x6d12('0x2e')]));_0x26cf68['attributes']=_0x26cf68['attributes'][_0x6d12('0x2f')]?_0x26cf68['attributes']:_0x28a597[_0x6d12('0x29')];if(!_0x4e9329['query'][_0x6d12('0x30')](_0x6d12('0x31'))){_0x26cf68[_0x6d12('0x1a')]=qs['limit'](_0x4e9329[_0x6d12('0x2b')]['limit']);_0x26cf68[_0x6d12('0x18')]=qs[_0x6d12('0x18')](_0x4e9329['query'][_0x6d12('0x18')]);}_0x26cf68[_0x6d12('0x32')]=qs[_0x6d12('0x33')](_0x4e9329[_0x6d12('0x2b')][_0x6d12('0x33')]);_0x26cf68[_0x6d12('0x34')]=qs[_0x6d12('0x2c')](_[_0x6d12('0x35')](_0x4e9329['query'],_0x28a597['filters']),_0x1738e8);if(_0x4e9329['query'][_0x6d12('0x36')]){_0x26cf68[_0x6d12('0x34')]=_['merge'](_0x26cf68[_0x6d12('0x34')],{'$or':_[_0x6d12('0x2a')](_0x1738e8,function(_0xe59836){if(_0xe59836[_0x6d12('0x27')]!==_0x6d12('0x37')){var _0x5cfbb4={};_0x5cfbb4[_0xe59836['name']]={'$like':'%'+_0x4e9329[_0x6d12('0x2b')][_0x6d12('0x36')]+'%'};return _0x5cfbb4;}})});}_0x26cf68=_[_0x6d12('0x38')]({},_0x26cf68,_0x4e9329['options']);var _0x565d34={'where':_0x26cf68[_0x6d12('0x34')]};return db['AnalyticCustomReport']['count'](_0x565d34)[_0x6d12('0x1f')](function(_0x3469ac){_0x1fdcf7['count']=_0x3469ac;if(_0x4e9329[_0x6d12('0x2b')][_0x6d12('0x39')]){_0x26cf68[_0x6d12('0x3a')]=[{'all':!![]}];}return db[_0x6d12('0x25')][_0x6d12('0x3b')](_0x26cf68);})[_0x6d12('0x1f')](function(_0x3a3aaf){_0x1fdcf7[_0x6d12('0x3c')]=_0x3a3aaf;return _0x1fdcf7;})[_0x6d12('0x1f')](respondWithFilteredResult(_0x14f73f,_0x26cf68))['catch'](handleError(_0x14f73f,null));};exports['show']=function(_0x1f2bcf,_0x3bf693){var _0x55fd34={'raw':![],'where':{'id':_0x1f2bcf[_0x6d12('0x3d')]['id']}},_0x5179cb={};_0x5179cb[_0x6d12('0x29')]=_[_0x6d12('0x3e')](db['AnalyticCustomReport'][_0x6d12('0x3f')]);_0x5179cb[_0x6d12('0x2b')]=_[_0x6d12('0x3e')](_0x1f2bcf[_0x6d12('0x2b')]);_0x5179cb[_0x6d12('0x2c')]=_[_0x6d12('0x2d')](_0x5179cb['model'],_0x5179cb[_0x6d12('0x2b')]);_0x55fd34['attributes']=_[_0x6d12('0x2d')](_0x5179cb[_0x6d12('0x29')],qs[_0x6d12('0x2e')](_0x1f2bcf['query'][_0x6d12('0x2e')]));_0x55fd34['attributes']=_0x55fd34[_0x6d12('0x40')][_0x6d12('0x2f')]?_0x55fd34[_0x6d12('0x40')]:_0x5179cb[_0x6d12('0x29')];if(_0x1f2bcf[_0x6d12('0x2b')][_0x6d12('0x39')]){_0x55fd34[_0x6d12('0x3a')]=[{'all':!![]}];}_0x55fd34=_['merge']({},_0x55fd34,_0x1f2bcf[_0x6d12('0x41')]);return db[_0x6d12('0x25')]['find'](_0x55fd34)[_0x6d12('0x1f')](handleEntityNotFound(_0x3bf693,null))[_0x6d12('0x1f')](respondWithResult(_0x3bf693,null))[_0x6d12('0x42')](handleError(_0x3bf693,null));};exports['create']=function(_0x5c98a9,_0x18c929){return db[_0x6d12('0x25')][_0x6d12('0x43')](_0x5c98a9[_0x6d12('0x44')],{})[_0x6d12('0x1f')](function(_0xd944bc){var _0xbf48a2=_0x5c98a9[_0x6d12('0x45')]['get']({'plain':!![]});if(!_0xbf48a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbf48a2['role']===_0x6d12('0x45')){var _0x44fbb9=_0xd944bc[_0x6d12('0x20')]({'plain':!![]});var _0x2daeba=_0x6d12('0x46');return db[_0x6d12('0x47')][_0x6d12('0x48')]({'where':{'name':_0x2daeba,'userProfileId':_0xbf48a2[_0x6d12('0x49')]},'raw':!![]})[_0x6d12('0x1f')](function(_0x1ce30e){if(_0x1ce30e&&_0x1ce30e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x44fbb9[_0x6d12('0x23')],'resourceId':_0x44fbb9['id'],'type':_0x6d12('0x4a'),'sectionId':_0x1ce30e['id']},{})[_0x6d12('0x1f')](function(){return _0xd944bc;});}else{return _0xd944bc;}})[_0x6d12('0x42')](function(_0x5ad11d){logger[_0x6d12('0x4b')](_0x6d12('0x4c'),_0x5ad11d);throw _0x5ad11d;});}return _0xd944bc;})[_0x6d12('0x1f')](respondWithResult(_0x18c929,0xc9))[_0x6d12('0x42')](handleError(_0x18c929,null));};exports[_0x6d12('0x4d')]=function(_0x170197,_0x1cb481){if(_0x170197['body']['id']){delete _0x170197[_0x6d12('0x44')]['id'];}return db[_0x6d12('0x25')]['find']({'where':{'id':_0x170197[_0x6d12('0x3d')]['id']}})[_0x6d12('0x1f')](handleEntityNotFound(_0x1cb481,null))['then'](saveUpdates(_0x170197[_0x6d12('0x44')],null))[_0x6d12('0x1f')](respondWithResult(_0x1cb481,null))['catch'](handleError(_0x1cb481,null));};exports[_0x6d12('0x4e')]=function(_0x4599d4,_0x2895e1){return db[_0x6d12('0x25')]['find']({'where':{'id':_0x4599d4[_0x6d12('0x3d')]['id']}})[_0x6d12('0x1f')](handleEntityNotFound(_0x2895e1,null))[_0x6d12('0x1f')](removeEntity(_0x2895e1,null))[_0x6d12('0x42')](handleError(_0x2895e1,null));};exports[_0x6d12('0x4f')]=function(_0x225118,_0x28095f){var _0x4ddd5f=0xa;var _0xc5c749=[_0x6d12('0x50'),_0x6d12('0x51'),_0x6d12('0x52'),_0x6d12('0x53')];var _0x208011={'SUM':_0x6d12('0x54'),'COUNT':_0x6d12('0x55'),'COUNT DISTINCT':_0x6d12('0x56'),'MAX':_0x6d12('0x57'),'MIN':_0x6d12('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6d12('0x59'),'GROUP_CONCAT ASC':_0x6d12('0x5a'),'GROUP_CONCAT DESC':_0x6d12('0x5b')};var _0x2d5eb5={'SEC_TO_TIME':_0x6d12('0x5c'),'DATE':_0x6d12('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0x6d12('0x5e'),'UNIX_TIMESTAMP':_0x6d12('0x5f')};var _0x280cab=function(_0x2be7ce){return!_[_0x6d12('0x60')]([_0x6d12('0x61'),_0x6d12('0x62'),_0x6d12('0x63'),_0x6d12('0x64')],_0x2be7ce);};var _0x190d48=function(_0x543b3a){if(!_0x543b3a||!_0x543b3a[_0x6d12('0x65')][_0x6d12('0x2f')]){return'';}for(var _0x7a0315='(',_0x141f05=0x0;_0x141f05<_0x543b3a[_0x6d12('0x65')][_0x6d12('0x2f')];_0x141f05+=0x1){_0x141f05>0x0&&(_0x7a0315+='\x20'+_0x543b3a[_0x6d12('0x66')]+'\x20');_0x7a0315+=_0x543b3a[_0x6d12('0x65')][_0x141f05]['group']?_0x190d48(_0x543b3a[_0x6d12('0x65')][_0x141f05][_0x6d12('0x67')]):_0x543b3a[_0x6d12('0x65')][_0x141f05][_0x6d12('0x68')]+'\x20'+_0x543b3a[_0x6d12('0x65')][_0x141f05]['condition']+(_0x280cab(_0x543b3a['rules'][_0x141f05][_0x6d12('0x69')])?'\x20'+_0x543b3a[_0x6d12('0x65')][_0x141f05][_0x6d12('0x6a')]:'');}return _0x7a0315+')';};var _0x243239={'where':{'id':_0x225118[_0x6d12('0x3d')]['id']}},_0x498cf4,_0x14ccaf,_0x4b9f37,_0x1f7c5c,_0x377059;_0x243239=_['merge']({},_0x243239,_0x225118[_0x6d12('0x41')]);return db['AnalyticCustomReport'][_0x6d12('0x48')](_0x243239)[_0x6d12('0x1f')](function(_0x373d63){if(_0x373d63){_0x498cf4=_0x373d63;return _0x373d63[_0x6d12('0x6b')]();}return null;})[_0x6d12('0x1f')](function(_0x1bd4fe){if(_0x1bd4fe){if(!_0x1bd4fe[_0x6d12('0x2f')]){throw new db[(_0x6d12('0x6c'))][(_0x6d12('0x6d'))](_0x6d12('0x6e'),0x193);}_0x14ccaf=_0x1bd4fe;return db['AnalyticMetric'][_0x6d12('0x3b')]({'raw':!![]});}return null;})[_0x6d12('0x1f')](function(_0xa4118e){if(_0xa4118e){_0x4b9f37=_[_0x6d12('0x6f')](_0xa4118e,'id');var _0x9d716c;var _0x5cbe55=squel[_0x6d12('0x70')]();_0x5cbe55[_0x6d12('0x71')](_0x498cf4[_0x6d12('0x72')]);for(var _0x5262c8=0x0;_0x5262c8<_0x14ccaf[_0x6d12('0x2f')];_0x5262c8+=0x1){_0x9d716c=_0x14ccaf[_0x5262c8]['MetricId']?_0x4b9f37[_0x14ccaf[_0x5262c8][_0x6d12('0x73')]][_0x6d12('0x74')]:_0x14ccaf[_0x5262c8][_0x6d12('0x68')];_0x9d716c=_0x14ccaf[_0x5262c8][_0x6d12('0x75')]?_[_0x6d12('0x76')](_0x208011[_0x14ccaf[_0x5262c8][_0x6d12('0x75')]],'%s',_0x9d716c):_0x9d716c;_0x9d716c=_0x14ccaf[_0x5262c8][_0x6d12('0x77')]?_[_0x6d12('0x76')](_0x2d5eb5[_0x14ccaf[_0x5262c8][_0x6d12('0x77')]],'%s',_0x9d716c):_0x9d716c;if(_0x14ccaf[_0x5262c8][_0x6d12('0x78')]){_0x5cbe55[_0x6d12('0x67')](_0x9d716c);}_0x14ccaf[_0x5262c8]['orderBy']&&_0x5cbe55[_0x6d12('0x32')](_0x9d716c,_0x14ccaf[_0x5262c8][_0x6d12('0x79')]==='DESC'?![]:!![]);_0x5cbe55[_0x6d12('0x68')](_0x9d716c,_0x14ccaf[_0x5262c8][_0x6d12('0x7a')]||_0x9d716c);}if(_0x498cf4[_0x6d12('0x7b')]){_0x498cf4[_0x6d12('0x7b')]=JSON[_0x6d12('0x7c')](_0x498cf4['joins']);for(var _0x9c5cbc=0x0;_0x9c5cbc<_0x498cf4[_0x6d12('0x7b')][_0x6d12('0x2f')];_0x9c5cbc+=0x1){if(_0x498cf4[_0x6d12('0x7b')][_0x9c5cbc][_0x6d12('0x27')]&&_[_0x6d12('0x60')](_0xc5c749,_0x498cf4[_0x6d12('0x7b')][_0x9c5cbc][_0x6d12('0x27')])&&_0x498cf4['joins'][_0x9c5cbc][_0x6d12('0x7d')]&&_0x498cf4[_0x6d12('0x7b')][_0x9c5cbc][_0x6d12('0x7e')]&&_0x498cf4['joins'][_0x9c5cbc][_0x6d12('0x7f')]){_0x5cbe55[_0x498cf4[_0x6d12('0x7b')][_0x9c5cbc]['type']](_0x498cf4['joins'][_0x9c5cbc][_0x6d12('0x7e')],null,util[_0x6d12('0x77')](_0x6d12('0x80'),_0x498cf4[_0x6d12('0x72')],_0x498cf4['joins'][_0x9c5cbc][_0x6d12('0x7d')],_0x498cf4[_0x6d12('0x7b')][_0x9c5cbc][_0x6d12('0x7e')],_0x498cf4[_0x6d12('0x7b')][_0x9c5cbc]['foreignKey']));}}}if(_0x498cf4['conditions']){_0x498cf4['conditions']=JSON[_0x6d12('0x7c')](_0x498cf4['conditions']);_0x5cbe55[_0x6d12('0x34')](_0x190d48(_0x498cf4['conditions'][_0x6d12('0x67')]));}_0x377059=_0x5cbe55[_0x6d12('0x81')]();_0x5cbe55['limit'](_0x4ddd5f);_0x5cbe55[_0x6d12('0x18')](0x0);logger[_0x6d12('0x82')](_0x6d12('0x83'),_0x5cbe55[_0x6d12('0x84')]());return dbH[_0x6d12('0x85')]['query'](_0x5cbe55[_0x6d12('0x84')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x6d12('0x1f')](respondWithResult(_0x28095f,null))[_0x6d12('0x42')](handleError(_0x28095f,null));};function runReport(_0x3745bf,_0x211b9b,_0xf42e98){var _0x300efe=_0x211b9b[_0x6d12('0x23')];var _0x5bbd19=0xa;var _0x201509=[_0x6d12('0x50'),'left_join','right_join','cross_join'];var _0x489b24={'SUM':_0x6d12('0x54'),'COUNT':_0x6d12('0x55'),'COUNT DISTINCT':_0x6d12('0x56'),'MAX':_0x6d12('0x57'),'MIN':_0x6d12('0x58'),'AVG':_0x6d12('0x86'),'GROUP_CONCAT':_0x6d12('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6d12('0x5b')};var _0x3d9a37={'SEC_TO_TIME':_0x6d12('0x5c'),'DATE':_0x6d12('0x5d'),'HOUR':_0x6d12('0x87'),'ROUND':_0x6d12('0x5e'),'UNIX_TIMESTAMP':_0x6d12('0x5f')};var _0x14523a=function(_0x4b7e0d){return!_['includes'](['IS\x20NULL',_0x6d12('0x62'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4b7e0d);};var _0x11bbdf=function(_0x2370cf){if(!_0x2370cf||!_0x2370cf['rules'][_0x6d12('0x2f')]){return'';}for(var _0x95b7f3='(',_0x27fc82=0x0;_0x27fc82<_0x2370cf['rules']['length'];_0x27fc82+=0x1){_0x27fc82>0x0&&(_0x95b7f3+='\x20'+_0x2370cf[_0x6d12('0x66')]+'\x20');_0x95b7f3+=_0x2370cf[_0x6d12('0x65')][_0x27fc82][_0x6d12('0x67')]?_0x11bbdf(_0x2370cf[_0x6d12('0x65')][_0x27fc82][_0x6d12('0x67')]):_0x2370cf['rules'][_0x27fc82][_0x6d12('0x68')]+'\x20'+_0x2370cf[_0x6d12('0x65')][_0x27fc82]['condition']+(_0x14523a(_0x2370cf[_0x6d12('0x65')][_0x27fc82][_0x6d12('0x69')])?'\x20'+_0x2370cf[_0x6d12('0x65')][_0x27fc82][_0x6d12('0x6a')]:'');}return _0x95b7f3+')';};var _0x1db688={'where':{'id':_0x3745bf['id']}},_0x208abb,_0x48c4b4,_0x313d5b,_0x581bd9,_0x4db182;_0x1db688=_['merge']({},_0x1db688,_0xf42e98);return db[_0x6d12('0x25')]['find'](_0x1db688)[_0x6d12('0x1f')](function(_0x1ca1f3){if(_0x1ca1f3){_0x208abb=_0x1ca1f3;return _0x1ca1f3['getFields']();}return null;})[_0x6d12('0x1f')](function(_0x2d6e15){if(_0x2d6e15){if(!_0x2d6e15['length']){throw new db[(_0x6d12('0x6c'))][(_0x6d12('0x6d'))](_0x6d12('0x6e'),0x193);}_0x48c4b4=_0x2d6e15;return db[_0x6d12('0x88')][_0x6d12('0x3b')]({'raw':!![]});}return null;})[_0x6d12('0x1f')](function(_0x2551d2){if(_0x2551d2){_0x313d5b=_[_0x6d12('0x6f')](_0x2551d2,'id');var _0x17a832;var _0x2efab2=squel[_0x6d12('0x70')]();_0x2efab2['from'](_0x208abb[_0x6d12('0x72')]);for(var _0x59461c=0x0;_0x59461c<_0x48c4b4[_0x6d12('0x2f')];_0x59461c+=0x1){_0x17a832=_0x48c4b4[_0x59461c][_0x6d12('0x73')]?_0x313d5b[_0x48c4b4[_0x59461c][_0x6d12('0x73')]][_0x6d12('0x74')]:_0x48c4b4[_0x59461c][_0x6d12('0x68')];_0x17a832=_0x48c4b4[_0x59461c][_0x6d12('0x75')]?_[_0x6d12('0x76')](_0x489b24[_0x48c4b4[_0x59461c][_0x6d12('0x75')]],'%s',_0x17a832):_0x17a832;_0x17a832=_0x48c4b4[_0x59461c][_0x6d12('0x77')]?_[_0x6d12('0x76')](_0x3d9a37[_0x48c4b4[_0x59461c][_0x6d12('0x77')]],'%s',_0x17a832):_0x17a832;if(_0x48c4b4[_0x59461c][_0x6d12('0x78')]){_0x2efab2['group'](_0x17a832);}_0x48c4b4[_0x59461c][_0x6d12('0x79')]&&_0x2efab2['order'](_0x17a832,_0x48c4b4[_0x59461c][_0x6d12('0x79')]===_0x6d12('0x89')?![]:!![]);_0x2efab2[_0x6d12('0x68')](_0x17a832,_0x48c4b4[_0x59461c]['alias']||_0x17a832);}if(_0x208abb[_0x6d12('0x7b')]){_0x208abb[_0x6d12('0x7b')]=JSON[_0x6d12('0x7c')](_0x208abb[_0x6d12('0x7b')]);for(var _0x312c4e=0x0;_0x312c4e<_0x208abb[_0x6d12('0x7b')][_0x6d12('0x2f')];_0x312c4e+=0x1){if(_0x208abb[_0x6d12('0x7b')][_0x312c4e][_0x6d12('0x27')]&&_[_0x6d12('0x60')](_0x201509,_0x208abb[_0x6d12('0x7b')][_0x312c4e]['type'])&&_0x208abb[_0x6d12('0x7b')][_0x312c4e]['parentKey']&&_0x208abb[_0x6d12('0x7b')][_0x312c4e][_0x6d12('0x7e')]&&_0x208abb['joins'][_0x312c4e]['foreignKey']){_0x2efab2[_0x208abb[_0x6d12('0x7b')][_0x312c4e][_0x6d12('0x27')]](_0x208abb['joins'][_0x312c4e][_0x6d12('0x7e')],null,util[_0x6d12('0x77')](_0x6d12('0x80'),_0x208abb['table'],_0x208abb[_0x6d12('0x7b')][_0x312c4e]['parentKey'],_0x208abb['joins'][_0x312c4e][_0x6d12('0x7e')],_0x208abb['joins'][_0x312c4e][_0x6d12('0x7f')]));}}}if(_0x208abb[_0x6d12('0x8a')]){_0x208abb[_0x6d12('0x8a')]=JSON[_0x6d12('0x7c')](_0x208abb[_0x6d12('0x8a')]);_0x2efab2[_0x6d12('0x34')](_0x11bbdf(_0x208abb[_0x6d12('0x8a')][_0x6d12('0x67')]));}_0x4db182=_0x2efab2[_0x6d12('0x81')]();_0x2efab2[_0x6d12('0x1a')](_0x5bbd19);_0x2efab2[_0x6d12('0x18')](0x0);return;}})[_0x6d12('0x1f')](function(){if(_0x211b9b[_0x6d12('0x8b')]===_0x6d12('0x8c')){return null;}var _0x189d17=_['merge'](_0x211b9b,{'name':_0x211b9b[_0x6d12('0x8d')]||_0x211b9b[_0x6d12('0x23')]||_0x208abb[_0x6d12('0x23')],'basename':_0x300efe,'savename':util[_0x6d12('0x77')]('%s-%s.%s',_0x211b9b[_0x6d12('0x23')]||_0x208abb[_0x6d12('0x23')],require(_0x6d12('0x8e'))['generate'](0x4),_0x211b9b['output']||_0x6d12('0x8f')),'reportId':_0x208abb['id'],'reportType':'custom'});return db[_0x6d12('0x90')][_0x6d12('0x43')](_0x189d17,{'raw':!![]});})[_0x6d12('0x1f')](function(_0x235085){if(_0x208abb[_0x6d12('0x72')]==='cdr'){_0x4db182[_0x6d12('0x34')](_0x208abb[_0x6d12('0x72')]+_0x6d12('0x91'),_0x211b9b[_0x6d12('0x92')],_0x211b9b[_0x6d12('0x93')]);}else{_0x4db182[_0x6d12('0x34')](_0x208abb[_0x6d12('0x72')]+_0x6d12('0x94'),_0x211b9b[_0x6d12('0x92')],_0x211b9b[_0x6d12('0x93')]);}if(_0x235085){logger['info'](_0x6d12('0x95'),_0x4db182[_0x6d12('0x84')]());require('child_process')[_0x6d12('0x96')](path[_0x6d12('0x50')](__dirname,_0x6d12('0x97'),_0x235085['output']),[_0x235085['id'],_0x4db182[_0x6d12('0x84')](),path[_0x6d12('0x50')](__dirname,'../../files/reports',_0x235085[_0x6d12('0x98')]),_0x300efe]);return _0x235085;}else{var _0x18159c=squel['select']();_0x18159c[_0x6d12('0x71')]('('+_0x4db182[_0x6d12('0x84')]()+')',_0x6d12('0x99'));_0x18159c[_0x6d12('0x68')](_0x6d12('0x9a'),_0x6d12('0x1b'));_0x4db182[_0x6d12('0x1a')](_0x211b9b[_0x6d12('0x1a')]||_0x5bbd19);_0x4db182['offset'](_0x211b9b['offset']||0x0);return dbH[_0x6d12('0x85')][_0x6d12('0x2b')](_0x18159c[_0x6d12('0x84')](),{'type':dbH[_0x6d12('0x85')][_0x6d12('0x9b')][_0x6d12('0x9c')]})[_0x6d12('0x1f')](function(_0x1e7978){if(!_0x1e7978['length']){_0x581bd9=0x0;}else{_0x581bd9=_0x1e7978[0x0]['count']||0x0;}return dbH[_0x6d12('0x85')][_0x6d12('0x2b')](_0x4db182[_0x6d12('0x84')](),{'type':dbH[_0x6d12('0x85')][_0x6d12('0x9b')][_0x6d12('0x9c')]});})[_0x6d12('0x1f')](function(_0x5803c0){return{'rows':_0x5803c0||[],'count':_0x581bd9};});}});}exports[_0x6d12('0x9d')]=function(_0xcafdf8,_0x16ae3b){return runReport(_0xcafdf8[_0x6d12('0x3d')],_0xcafdf8[_0x6d12('0x2b')],_0xcafdf8[_0x6d12('0x41')])[_0x6d12('0x1f')](respondWithResult(_0x16ae3b,null))[_0x6d12('0x42')](handleError(_0x16ae3b,null));};exports[_0x6d12('0x9e')]=runReport;exports[_0x6d12('0x2b')]=function(_0x5dc57e,_0x18a402){var _0x10ca11=0xa;var _0x4843d3=[_0x6d12('0x50'),'left_join','right_join','cross_join'];var _0x4aa87f={'SUM':_0x6d12('0x54'),'COUNT':_0x6d12('0x55'),'COUNT DISTINCT':_0x6d12('0x56'),'MAX':_0x6d12('0x57'),'MIN':_0x6d12('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x6d12('0x59'),'GROUP_CONCAT ASC':_0x6d12('0x5a'),'GROUP_CONCAT DESC':_0x6d12('0x5b')};var _0x1246b0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6d12('0x5f')};var _0x28bc78=function(_0x19cc25){return!_[_0x6d12('0x60')]([_0x6d12('0x61'),'IS\x20NOT\x20NULL',_0x6d12('0x63'),_0x6d12('0x64')],_0x19cc25);};var _0x21da9f=function(_0x36187b){if(!_0x36187b||!_0x36187b['rules']['length']){return'';}for(var _0x233619='(',_0x603aeb=0x0;_0x603aeb<_0x36187b[_0x6d12('0x65')]['length'];_0x603aeb+=0x1){_0x603aeb>0x0&&(_0x233619+='\x20'+_0x36187b[_0x6d12('0x66')]+'\x20');_0x233619+=_0x36187b[_0x6d12('0x65')][_0x603aeb][_0x6d12('0x67')]?_0x21da9f(_0x36187b[_0x6d12('0x65')][_0x603aeb][_0x6d12('0x67')]):_0x36187b[_0x6d12('0x65')][_0x603aeb][_0x6d12('0x68')]+'\x20'+_0x36187b['rules'][_0x603aeb][_0x6d12('0x69')]+(_0x28bc78(_0x36187b[_0x6d12('0x65')][_0x603aeb][_0x6d12('0x69')])?'\x20'+_0x36187b['rules'][_0x603aeb][_0x6d12('0x6a')]:'');}return _0x233619+')';};var _0x32412e={'where':{'id':_0x5dc57e[_0x6d12('0x3d')]['id']}},_0x2d28e7,_0x4152a6,_0x2c043c,_0x153d5b,_0x4e384f;_0x32412e=_['merge']({},_0x32412e,_0x5dc57e[_0x6d12('0x41')]);return db[_0x6d12('0x25')]['find'](_0x32412e)[_0x6d12('0x1f')](function(_0x40651e){if(_0x40651e){_0x2d28e7=_0x40651e;return _0x40651e[_0x6d12('0x6b')]();}return null;})['then'](function(_0x2cc707){if(_0x2cc707){if(!_0x2cc707[_0x6d12('0x2f')]){throw new db[(_0x6d12('0x6c'))][(_0x6d12('0x6d'))](_0x6d12('0x6e'),0x193);}_0x4152a6=_0x2cc707;return db[_0x6d12('0x88')]['findAll']({'raw':!![]});}return null;})[_0x6d12('0x1f')](function(_0x517cbb){if(_0x517cbb){_0x2c043c=_[_0x6d12('0x6f')](_0x517cbb,'id');var _0x5b8dd1;var _0x344f2e=squel['select']();_0x344f2e[_0x6d12('0x71')](_0x2d28e7['table']);for(var _0xc9030=0x0;_0xc9030<_0x4152a6[_0x6d12('0x2f')];_0xc9030+=0x1){_0x5b8dd1=_0x4152a6[_0xc9030][_0x6d12('0x73')]?_0x2c043c[_0x4152a6[_0xc9030][_0x6d12('0x73')]][_0x6d12('0x74')]:_0x4152a6[_0xc9030]['field'];_0x5b8dd1=_0x4152a6[_0xc9030][_0x6d12('0x75')]?_[_0x6d12('0x76')](_0x4aa87f[_0x4152a6[_0xc9030][_0x6d12('0x75')]],'%s',_0x5b8dd1):_0x5b8dd1;_0x5b8dd1=_0x4152a6[_0xc9030][_0x6d12('0x77')]?_[_0x6d12('0x76')](_0x1246b0[_0x4152a6[_0xc9030]['format']],'%s',_0x5b8dd1):_0x5b8dd1;if(_0x4152a6[_0xc9030][_0x6d12('0x78')]){_0x344f2e[_0x6d12('0x67')](_0x5b8dd1);}_0x4152a6[_0xc9030]['orderBy']&&_0x344f2e['order'](_0x5b8dd1,_0x4152a6[_0xc9030][_0x6d12('0x79')]===_0x6d12('0x89')?![]:!![]);_0x344f2e['field'](_0x5b8dd1,_0x4152a6[_0xc9030][_0x6d12('0x7a')]||_0x5b8dd1);}if(_0x2d28e7[_0x6d12('0x7b')]){_0x2d28e7[_0x6d12('0x7b')]=JSON['parse'](_0x2d28e7['joins']);for(var _0x163d07=0x0;_0x163d07<_0x2d28e7[_0x6d12('0x7b')][_0x6d12('0x2f')];_0x163d07+=0x1){if(_0x2d28e7['joins'][_0x163d07][_0x6d12('0x27')]&&_['includes'](_0x4843d3,_0x2d28e7['joins'][_0x163d07][_0x6d12('0x27')])&&_0x2d28e7['joins'][_0x163d07][_0x6d12('0x7d')]&&_0x2d28e7['joins'][_0x163d07][_0x6d12('0x7e')]&&_0x2d28e7['joins'][_0x163d07][_0x6d12('0x7f')]){_0x344f2e[_0x2d28e7[_0x6d12('0x7b')][_0x163d07][_0x6d12('0x27')]](_0x2d28e7['joins'][_0x163d07][_0x6d12('0x7e')],null,util[_0x6d12('0x77')](_0x6d12('0x80'),_0x2d28e7[_0x6d12('0x72')],_0x2d28e7[_0x6d12('0x7b')][_0x163d07][_0x6d12('0x7d')],_0x2d28e7['joins'][_0x163d07][_0x6d12('0x7e')],_0x2d28e7[_0x6d12('0x7b')][_0x163d07][_0x6d12('0x7f')]));}}}if(_0x2d28e7[_0x6d12('0x8a')]){_0x2d28e7[_0x6d12('0x8a')]=JSON[_0x6d12('0x7c')](_0x2d28e7[_0x6d12('0x8a')]);_0x344f2e[_0x6d12('0x34')](_0x21da9f(_0x2d28e7[_0x6d12('0x8a')][_0x6d12('0x67')]));}_0x4e384f=_0x344f2e[_0x6d12('0x81')]();_0x344f2e[_0x6d12('0x1a')](_0x10ca11);_0x344f2e[_0x6d12('0x18')](0x0);logger[_0x6d12('0x82')](_0x6d12('0x83'),_0x344f2e['toString']());return dbH[_0x6d12('0x85')][_0x6d12('0x2b')](_0x344f2e[_0x6d12('0x84')](),{'type':dbH[_0x6d12('0x85')][_0x6d12('0x9b')][_0x6d12('0x9c')]});}})[_0x6d12('0x1f')](function(){return{'sql':_0x4e384f[_0x6d12('0x84')]()};})[_0x6d12('0x1f')](respondWithResult(_0x18a402,null))['catch'](handleError(_0x18a402,null));}; \ No newline at end of file +var _0xce0d=['operator','group','field','condition','value','options','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','type','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','cross_join','DATE(%s)','HOUR(%s)','ROUND(%s)','Sequelize','from','metric','DESC','foreignTable','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','countTable','SELECT','run','runReport','COUNT(%s)','MIN(%s)','SEC_TO_TIME(%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','params','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xce0d,0x19a));var _0xdce0=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0xce0d[_0x1034ee];return _0x2922af;};'use strict';var emlformat=require(_0xdce0('0x0'));var rimraf=require(_0xdce0('0x1'));var zipdir=require(_0xdce0('0x2'));var jsonpatch=require(_0xdce0('0x3'));var rp=require(_0xdce0('0x4'));var moment=require(_0xdce0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdce0('0x6'));var util=require(_0xdce0('0x7'));var path=require(_0xdce0('0x8'));var sox=require(_0xdce0('0x9'));var csv=require('to-csv');var ejs=require(_0xdce0('0xa'));var fs=require('fs');var fs_extra=require(_0xdce0('0xb'));var _=require(_0xdce0('0xc'));var squel=require(_0xdce0('0xd'));var crypto=require(_0xdce0('0xe'));var jsforce=require(_0xdce0('0xf'));var deskjs=require(_0xdce0('0x10'));var toCsv=require(_0xdce0('0x11'));var querystring=require(_0xdce0('0x12'));var Papa=require(_0xdce0('0x13'));var Redis=require(_0xdce0('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdce0('0x15'));var as=require(_0xdce0('0x16'));var hardwareService=require(_0xdce0('0x17'));var logger=require(_0xdce0('0x18'))('api');var utils=require(_0xdce0('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xdce0('0x1a'));var db=require(_0xdce0('0x1b'))['db'];var dbH=require(_0xdce0('0x1b'))[_0xdce0('0x1c')];function respondWithStatusCode(_0x54d539,_0x3a37b2){_0x3a37b2=_0x3a37b2||0xcc;return function(_0x48caaa){if(_0x48caaa){return _0x54d539[_0xdce0('0x1d')](_0x3a37b2);}return _0x54d539[_0xdce0('0x1e')](_0x3a37b2)[_0xdce0('0x1f')]();};}function respondWithResult(_0x403c3a,_0x4814d5){_0x4814d5=_0x4814d5||0xc8;return function(_0x11eac9){if(_0x11eac9){return _0x403c3a[_0xdce0('0x1e')](_0x4814d5)[_0xdce0('0x20')](_0x11eac9);}};}function respondWithFilteredResult(_0x228071,_0x120b57){return function(_0x558477){if(_0x558477){var _0x284a5d=typeof _0x120b57[_0xdce0('0x21')]===_0xdce0('0x22')&&typeof _0x120b57['limit']===_0xdce0('0x22');var _0x101276=_0x558477[_0xdce0('0x23')];var _0x2e8c34=_0x284a5d?0x0:_0x120b57[_0xdce0('0x21')];var _0x4d5239=_0x284a5d?_0x558477[_0xdce0('0x23')]:_0x120b57[_0xdce0('0x21')]+_0x120b57[_0xdce0('0x24')];var _0x44269e;if(_0x4d5239>=_0x101276){_0x4d5239=_0x101276;_0x44269e=0xc8;}else{_0x44269e=0xce;}_0x228071['status'](_0x44269e);return _0x228071['set'](_0xdce0('0x25'),_0x2e8c34+'-'+_0x4d5239+'/'+_0x101276)['json'](_0x558477);}return null;};}function patchUpdates(_0x460e32){return function(_0x23d37f){try{jsonpatch[_0xdce0('0x26')](_0x23d37f,_0x460e32,!![]);}catch(_0x8d79f){return BPromise['reject'](_0x8d79f);}return _0x23d37f[_0xdce0('0x27')]();};}function saveUpdates(_0x5bcaef,_0x23e3a8){return function(_0x186068){if(_0x186068){return _0x186068[_0xdce0('0x28')](_0x5bcaef)[_0xdce0('0x29')](function(_0x186e86){return _0x186e86;});}return null;};}function removeEntity(_0x19651b,_0x50e0cd){return function(_0xe1e4c){if(_0xe1e4c){return _0xe1e4c[_0xdce0('0x2a')]()[_0xdce0('0x29')](function(){var _0x100808=_0xe1e4c[_0xdce0('0x2b')]({'plain':!![]});var _0x1b07da='CustomReports';return db[_0xdce0('0x2c')][_0xdce0('0x2a')]({'where':{'type':_0x1b07da,'resourceId':_0x100808['id']}})['then'](function(){return _0xe1e4c;});})[_0xdce0('0x29')](function(){_0x19651b[_0xdce0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24ed7a,_0x413da3){return function(_0x3cd634){if(!_0x3cd634){_0x24ed7a[_0xdce0('0x1d')](0x194);}return _0x3cd634;};}function handleError(_0x586f86,_0x5896a3){_0x5896a3=_0x5896a3||0x1f4;return function(_0x3d96e8){logger['error'](_0x3d96e8[_0xdce0('0x2d')]);if(_0x3d96e8['name']){delete _0x3d96e8['name'];}_0x586f86[_0xdce0('0x1e')](_0x5896a3)[_0xdce0('0x2e')](_0x3d96e8);};}exports[_0xdce0('0x2f')]=function(_0x2a19e2,_0x450d79){var _0x2d874e={},_0x4ba319={},_0x387f20={'count':0x0,'rows':[]};var _0x12a478=_[_0xdce0('0x30')](db['AnalyticCustomReport'][_0xdce0('0x31')],function(_0xc8c990){return{'name':_0xc8c990[_0xdce0('0x32')],'type':_0xc8c990['type'][_0xdce0('0x33')]};});_0x4ba319[_0xdce0('0x34')]=_['map'](_0x12a478,_0xdce0('0x35'));_0x4ba319[_0xdce0('0x36')]=_[_0xdce0('0x37')](_0x2a19e2[_0xdce0('0x36')]);_0x4ba319[_0xdce0('0x38')]=_['intersection'](_0x4ba319[_0xdce0('0x34')],_0x4ba319[_0xdce0('0x36')]);_0x2d874e[_0xdce0('0x39')]=_[_0xdce0('0x3a')](_0x4ba319[_0xdce0('0x34')],qs[_0xdce0('0x3b')](_0x2a19e2[_0xdce0('0x36')][_0xdce0('0x3b')]));_0x2d874e[_0xdce0('0x39')]=_0x2d874e[_0xdce0('0x39')][_0xdce0('0x3c')]?_0x2d874e[_0xdce0('0x39')]:_0x4ba319[_0xdce0('0x34')];if(!_0x2a19e2['query']['hasOwnProperty'](_0xdce0('0x3d'))){_0x2d874e[_0xdce0('0x24')]=qs[_0xdce0('0x24')](_0x2a19e2['query'][_0xdce0('0x24')]);_0x2d874e[_0xdce0('0x21')]=qs[_0xdce0('0x21')](_0x2a19e2['query']['offset']);}_0x2d874e[_0xdce0('0x3e')]=qs['sort'](_0x2a19e2['query'][_0xdce0('0x3f')]);_0x2d874e[_0xdce0('0x40')]=qs[_0xdce0('0x38')](_['pick'](_0x2a19e2[_0xdce0('0x36')],_0x4ba319[_0xdce0('0x38')]),_0x12a478);if(_0x2a19e2['query']['filter']){_0x2d874e[_0xdce0('0x40')]=_['merge'](_0x2d874e[_0xdce0('0x40')],{'$or':_[_0xdce0('0x30')](_0x12a478,function(_0x799396){if(_0x799396['type']!==_0xdce0('0x41')){var _0x58a0d4={};_0x58a0d4[_0x799396[_0xdce0('0x35')]]={'$like':'%'+_0x2a19e2[_0xdce0('0x36')][_0xdce0('0x42')]+'%'};return _0x58a0d4;}})});}_0x2d874e=_['merge']({},_0x2d874e,_0x2a19e2['options']);var _0x14188d={'where':_0x2d874e[_0xdce0('0x40')]};return db['AnalyticCustomReport'][_0xdce0('0x23')](_0x14188d)[_0xdce0('0x29')](function(_0x3f27a0){_0x387f20[_0xdce0('0x23')]=_0x3f27a0;if(_0x2a19e2[_0xdce0('0x36')][_0xdce0('0x43')]){_0x2d874e[_0xdce0('0x44')]=[{'all':!![]}];}return db[_0xdce0('0x45')][_0xdce0('0x46')](_0x2d874e);})[_0xdce0('0x29')](function(_0x407157){_0x387f20[_0xdce0('0x47')]=_0x407157;return _0x387f20;})['then'](respondWithFilteredResult(_0x450d79,_0x2d874e))[_0xdce0('0x48')](handleError(_0x450d79,null));};exports[_0xdce0('0x49')]=function(_0x15d464,_0x53de40){var _0x23522b={'raw':![],'where':{'id':_0x15d464[_0xdce0('0x4a')]['id']}},_0x209bd6={};_0x209bd6['model']=_[_0xdce0('0x37')](db[_0xdce0('0x45')][_0xdce0('0x31')]);_0x209bd6['query']=_['keys'](_0x15d464[_0xdce0('0x36')]);_0x209bd6[_0xdce0('0x38')]=_[_0xdce0('0x3a')](_0x209bd6[_0xdce0('0x34')],_0x209bd6[_0xdce0('0x36')]);_0x23522b['attributes']=_['intersection'](_0x209bd6['model'],qs[_0xdce0('0x3b')](_0x15d464[_0xdce0('0x36')]['fields']));_0x23522b[_0xdce0('0x39')]=_0x23522b['attributes'][_0xdce0('0x3c')]?_0x23522b[_0xdce0('0x39')]:_0x209bd6[_0xdce0('0x34')];if(_0x15d464[_0xdce0('0x36')][_0xdce0('0x43')]){_0x23522b['include']=[{'all':!![]}];}_0x23522b=_[_0xdce0('0x4b')]({},_0x23522b,_0x15d464['options']);return db['AnalyticCustomReport'][_0xdce0('0x4c')](_0x23522b)[_0xdce0('0x29')](handleEntityNotFound(_0x53de40,null))['then'](respondWithResult(_0x53de40,null))[_0xdce0('0x48')](handleError(_0x53de40,null));};exports[_0xdce0('0x4d')]=function(_0x3efc40,_0x33082e){return db['AnalyticCustomReport'][_0xdce0('0x4d')](_0x3efc40['body'],{})['then'](function(_0x1f4c8e){var _0x1d4395=_0x3efc40[_0xdce0('0x4e')][_0xdce0('0x2b')]({'plain':!![]});if(!_0x1d4395)throw new Error(_0xdce0('0x4f'));if(_0x1d4395['role']==='user'){var _0x5f220d=_0x1f4c8e[_0xdce0('0x2b')]({'plain':!![]});var _0x1db8b6='Reports';return db['UserProfileSection'][_0xdce0('0x4c')]({'where':{'name':_0x1db8b6,'userProfileId':_0x1d4395[_0xdce0('0x50')]},'raw':!![]})[_0xdce0('0x29')](function(_0x26bc6c){if(_0x26bc6c&&_0x26bc6c[_0xdce0('0x51')]===0x0){return db[_0xdce0('0x2c')]['create']({'name':_0x5f220d[_0xdce0('0x35')],'resourceId':_0x5f220d['id'],'type':_0xdce0('0x52'),'sectionId':_0x26bc6c['id']},{})[_0xdce0('0x29')](function(){return _0x1f4c8e;});}else{return _0x1f4c8e;}})['catch'](function(_0x4ce6ec){logger[_0xdce0('0x53')](_0xdce0('0x54'),_0x4ce6ec);throw _0x4ce6ec;});}return _0x1f4c8e;})[_0xdce0('0x29')](respondWithResult(_0x33082e,0xc9))[_0xdce0('0x48')](handleError(_0x33082e,null));};exports[_0xdce0('0x28')]=function(_0x5535db,_0x41e566){if(_0x5535db[_0xdce0('0x55')]['id']){delete _0x5535db[_0xdce0('0x55')]['id'];}return db[_0xdce0('0x45')]['find']({'where':{'id':_0x5535db[_0xdce0('0x4a')]['id']}})[_0xdce0('0x29')](handleEntityNotFound(_0x41e566,null))['then'](saveUpdates(_0x5535db[_0xdce0('0x55')],null))[_0xdce0('0x29')](respondWithResult(_0x41e566,null))[_0xdce0('0x48')](handleError(_0x41e566,null));};exports[_0xdce0('0x2a')]=function(_0x45c933,_0x3e9057){return db['AnalyticCustomReport'][_0xdce0('0x4c')]({'where':{'id':_0x45c933[_0xdce0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e9057,null))[_0xdce0('0x29')](removeEntity(_0x3e9057,null))[_0xdce0('0x48')](handleError(_0x3e9057,null));};exports[_0xdce0('0x56')]=function(_0x3b58a1,_0x1b6acb){var _0x21f275=0xa;var _0x19cb44=[_0xdce0('0x57'),_0xdce0('0x58'),'right_join','cross_join'];var _0x5459bf={'SUM':_0xdce0('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xdce0('0x5a'),'MAX':_0xdce0('0x5b'),'MIN':'MIN(%s)','AVG':_0xdce0('0x5c'),'GROUP_CONCAT':_0xdce0('0x5d'),'GROUP_CONCAT ASC':_0xdce0('0x5e'),'GROUP_CONCAT DESC':_0xdce0('0x5f')};var _0x27541e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdce0('0x60')};var _0x26079e=function(_0x360867){return!_[_0xdce0('0x61')]([_0xdce0('0x62'),_0xdce0('0x63'),_0xdce0('0x64'),_0xdce0('0x65')],_0x360867);};var _0x2ab559=function(_0x554a04){if(!_0x554a04||!_0x554a04['rules']['length']){return'';}for(var _0xa146ae='(',_0x2ceab1=0x0;_0x2ceab1<_0x554a04[_0xdce0('0x66')]['length'];_0x2ceab1+=0x1){_0x2ceab1>0x0&&(_0xa146ae+='\x20'+_0x554a04[_0xdce0('0x67')]+'\x20');_0xa146ae+=_0x554a04[_0xdce0('0x66')][_0x2ceab1][_0xdce0('0x68')]?_0x2ab559(_0x554a04[_0xdce0('0x66')][_0x2ceab1][_0xdce0('0x68')]):_0x554a04[_0xdce0('0x66')][_0x2ceab1][_0xdce0('0x69')]+'\x20'+_0x554a04[_0xdce0('0x66')][_0x2ceab1][_0xdce0('0x6a')]+(_0x26079e(_0x554a04['rules'][_0x2ceab1]['condition'])?'\x20'+_0x554a04['rules'][_0x2ceab1][_0xdce0('0x6b')]:'');}return _0xa146ae+')';};var _0x4377b6={'where':{'id':_0x3b58a1[_0xdce0('0x4a')]['id']}},_0x26473c,_0x23be7a,_0x445fdc,_0x194a9e,_0x520240;_0x4377b6=_['merge']({},_0x4377b6,_0x3b58a1[_0xdce0('0x6c')]);return db[_0xdce0('0x45')][_0xdce0('0x4c')](_0x4377b6)[_0xdce0('0x29')](function(_0x57ffd3){if(_0x57ffd3){_0x26473c=_0x57ffd3;return _0x57ffd3[_0xdce0('0x6d')]();}return null;})['then'](function(_0x36363e){if(_0x36363e){if(!_0x36363e[_0xdce0('0x3c')]){throw new db['Sequelize'][(_0xdce0('0x6e'))](_0xdce0('0x6f'),0x193);}_0x23be7a=_0x36363e;return db[_0xdce0('0x70')][_0xdce0('0x46')]({'raw':!![]});}return null;})['then'](function(_0x4305f7){if(_0x4305f7){_0x445fdc=_[_0xdce0('0x71')](_0x4305f7,'id');var _0xe15325;var _0x2ee568=squel[_0xdce0('0x72')]();_0x2ee568['from'](_0x26473c['table']);for(var _0x1ce015=0x0;_0x1ce015<_0x23be7a['length'];_0x1ce015+=0x1){_0xe15325=_0x23be7a[_0x1ce015][_0xdce0('0x73')]?_0x445fdc[_0x23be7a[_0x1ce015]['MetricId']]['metric']:_0x23be7a[_0x1ce015][_0xdce0('0x69')];_0xe15325=_0x23be7a[_0x1ce015][_0xdce0('0x74')]?_[_0xdce0('0x75')](_0x5459bf[_0x23be7a[_0x1ce015][_0xdce0('0x74')]],'%s',_0xe15325):_0xe15325;_0xe15325=_0x23be7a[_0x1ce015][_0xdce0('0x76')]?_[_0xdce0('0x75')](_0x27541e[_0x23be7a[_0x1ce015][_0xdce0('0x76')]],'%s',_0xe15325):_0xe15325;if(_0x23be7a[_0x1ce015][_0xdce0('0x77')]){_0x2ee568['group'](_0xe15325);}_0x23be7a[_0x1ce015][_0xdce0('0x78')]&&_0x2ee568[_0xdce0('0x3e')](_0xe15325,_0x23be7a[_0x1ce015][_0xdce0('0x78')]==='DESC'?![]:!![]);_0x2ee568[_0xdce0('0x69')](_0xe15325,_0x23be7a[_0x1ce015][_0xdce0('0x79')]||_0xe15325);}if(_0x26473c[_0xdce0('0x7a')]){_0x26473c['joins']=JSON[_0xdce0('0x7b')](_0x26473c[_0xdce0('0x7a')]);for(var _0xdf357c=0x0;_0xdf357c<_0x26473c[_0xdce0('0x7a')][_0xdce0('0x3c')];_0xdf357c+=0x1){if(_0x26473c[_0xdce0('0x7a')][_0xdf357c][_0xdce0('0x7c')]&&_['includes'](_0x19cb44,_0x26473c[_0xdce0('0x7a')][_0xdf357c][_0xdce0('0x7c')])&&_0x26473c['joins'][_0xdf357c][_0xdce0('0x7d')]&&_0x26473c[_0xdce0('0x7a')][_0xdf357c]['foreignTable']&&_0x26473c[_0xdce0('0x7a')][_0xdf357c][_0xdce0('0x7e')]){_0x2ee568[_0x26473c[_0xdce0('0x7a')][_0xdf357c][_0xdce0('0x7c')]](_0x26473c[_0xdce0('0x7a')][_0xdf357c]['foreignTable'],null,util[_0xdce0('0x76')](_0xdce0('0x7f'),_0x26473c[_0xdce0('0x80')],_0x26473c[_0xdce0('0x7a')][_0xdf357c]['parentKey'],_0x26473c[_0xdce0('0x7a')][_0xdf357c]['foreignTable'],_0x26473c[_0xdce0('0x7a')][_0xdf357c][_0xdce0('0x7e')]));}}}if(_0x26473c['conditions']){_0x26473c[_0xdce0('0x81')]=JSON[_0xdce0('0x7b')](_0x26473c[_0xdce0('0x81')]);_0x2ee568['where'](_0x2ab559(_0x26473c[_0xdce0('0x81')][_0xdce0('0x68')]));}_0x520240=_0x2ee568[_0xdce0('0x82')]();_0x2ee568[_0xdce0('0x24')](_0x21f275);_0x2ee568[_0xdce0('0x21')](0x0);logger[_0xdce0('0x83')](_0xdce0('0x84'),_0x2ee568[_0xdce0('0x85')]());return dbH[_0xdce0('0x86')]['query'](_0x2ee568[_0xdce0('0x85')](),{'type':dbH[_0xdce0('0x86')][_0xdce0('0x87')]['SELECT']});}})[_0xdce0('0x29')](respondWithResult(_0x1b6acb,null))[_0xdce0('0x48')](handleError(_0x1b6acb,null));};function runReport(_0x51a5dc,_0x2d2e58,_0x2f3956){var _0x400674=_0x2d2e58[_0xdce0('0x35')];var _0xba4966=0xa;var _0x229221=[_0xdce0('0x57'),_0xdce0('0x58'),_0xdce0('0x88'),_0xdce0('0x89')];var _0x4d1e7c={'SUM':_0xdce0('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xdce0('0x5a'),'MAX':_0xdce0('0x5b'),'MIN':'MIN(%s)','AVG':_0xdce0('0x5c'),'GROUP_CONCAT':_0xdce0('0x5d'),'GROUP_CONCAT ASC':_0xdce0('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x33f6e3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xdce0('0x8a'),'HOUR':_0xdce0('0x8b'),'ROUND':_0xdce0('0x8c'),'UNIX_TIMESTAMP':_0xdce0('0x60')};var _0x2cfeb9=function(_0x56ade5){return!_[_0xdce0('0x61')]([_0xdce0('0x62'),_0xdce0('0x63'),_0xdce0('0x64'),_0xdce0('0x65')],_0x56ade5);};var _0x2e74e1=function(_0x28c505){if(!_0x28c505||!_0x28c505['rules'][_0xdce0('0x3c')]){return'';}for(var _0x756f8c='(',_0xab0ebe=0x0;_0xab0ebe<_0x28c505['rules'][_0xdce0('0x3c')];_0xab0ebe+=0x1){_0xab0ebe>0x0&&(_0x756f8c+='\x20'+_0x28c505[_0xdce0('0x67')]+'\x20');_0x756f8c+=_0x28c505[_0xdce0('0x66')][_0xab0ebe][_0xdce0('0x68')]?_0x2e74e1(_0x28c505[_0xdce0('0x66')][_0xab0ebe][_0xdce0('0x68')]):_0x28c505['rules'][_0xab0ebe]['field']+'\x20'+_0x28c505[_0xdce0('0x66')][_0xab0ebe][_0xdce0('0x6a')]+(_0x2cfeb9(_0x28c505['rules'][_0xab0ebe][_0xdce0('0x6a')])?'\x20'+_0x28c505[_0xdce0('0x66')][_0xab0ebe][_0xdce0('0x6b')]:'');}return _0x756f8c+')';};var _0x53109c={'where':{'id':_0x51a5dc['id']}},_0x3ad334,_0x1f6617,_0x27c942,_0x133adf,_0x592b77;_0x53109c=_['merge']({},_0x53109c,_0x2f3956);return db[_0xdce0('0x45')][_0xdce0('0x4c')](_0x53109c)[_0xdce0('0x29')](function(_0x141f02){if(_0x141f02){_0x3ad334=_0x141f02;return _0x141f02[_0xdce0('0x6d')]();}return null;})['then'](function(_0x5295e1){if(_0x5295e1){if(!_0x5295e1[_0xdce0('0x3c')]){throw new db[(_0xdce0('0x8d'))][(_0xdce0('0x6e'))](_0xdce0('0x6f'),0x193);}_0x1f6617=_0x5295e1;return db[_0xdce0('0x70')][_0xdce0('0x46')]({'raw':!![]});}return null;})['then'](function(_0x50eb5b){if(_0x50eb5b){_0x27c942=_[_0xdce0('0x71')](_0x50eb5b,'id');var _0x5e91ce;var _0x447886=squel[_0xdce0('0x72')]();_0x447886[_0xdce0('0x8e')](_0x3ad334['table']);for(var _0x1be18a=0x0;_0x1be18a<_0x1f6617[_0xdce0('0x3c')];_0x1be18a+=0x1){_0x5e91ce=_0x1f6617[_0x1be18a]['MetricId']?_0x27c942[_0x1f6617[_0x1be18a][_0xdce0('0x73')]][_0xdce0('0x8f')]:_0x1f6617[_0x1be18a][_0xdce0('0x69')];_0x5e91ce=_0x1f6617[_0x1be18a][_0xdce0('0x74')]?_[_0xdce0('0x75')](_0x4d1e7c[_0x1f6617[_0x1be18a][_0xdce0('0x74')]],'%s',_0x5e91ce):_0x5e91ce;_0x5e91ce=_0x1f6617[_0x1be18a][_0xdce0('0x76')]?_['replace'](_0x33f6e3[_0x1f6617[_0x1be18a][_0xdce0('0x76')]],'%s',_0x5e91ce):_0x5e91ce;if(_0x1f6617[_0x1be18a]['groupBy']){_0x447886[_0xdce0('0x68')](_0x5e91ce);}_0x1f6617[_0x1be18a][_0xdce0('0x78')]&&_0x447886[_0xdce0('0x3e')](_0x5e91ce,_0x1f6617[_0x1be18a][_0xdce0('0x78')]===_0xdce0('0x90')?![]:!![]);_0x447886[_0xdce0('0x69')](_0x5e91ce,_0x1f6617[_0x1be18a][_0xdce0('0x79')]||_0x5e91ce);}if(_0x3ad334[_0xdce0('0x7a')]){_0x3ad334[_0xdce0('0x7a')]=JSON['parse'](_0x3ad334[_0xdce0('0x7a')]);for(var _0x1fab52=0x0;_0x1fab52<_0x3ad334['joins'][_0xdce0('0x3c')];_0x1fab52+=0x1){if(_0x3ad334['joins'][_0x1fab52][_0xdce0('0x7c')]&&_['includes'](_0x229221,_0x3ad334[_0xdce0('0x7a')][_0x1fab52]['type'])&&_0x3ad334[_0xdce0('0x7a')][_0x1fab52]['parentKey']&&_0x3ad334[_0xdce0('0x7a')][_0x1fab52][_0xdce0('0x91')]&&_0x3ad334[_0xdce0('0x7a')][_0x1fab52]['foreignKey']){_0x447886[_0x3ad334[_0xdce0('0x7a')][_0x1fab52]['type']](_0x3ad334[_0xdce0('0x7a')][_0x1fab52][_0xdce0('0x91')],null,util[_0xdce0('0x76')]('%s.%s\x20=\x20%s.%s',_0x3ad334[_0xdce0('0x80')],_0x3ad334[_0xdce0('0x7a')][_0x1fab52]['parentKey'],_0x3ad334[_0xdce0('0x7a')][_0x1fab52][_0xdce0('0x91')],_0x3ad334[_0xdce0('0x7a')][_0x1fab52]['foreignKey']));}}}if(_0x3ad334[_0xdce0('0x81')]){_0x3ad334['conditions']=JSON[_0xdce0('0x7b')](_0x3ad334['conditions']);_0x447886[_0xdce0('0x40')](_0x2e74e1(_0x3ad334[_0xdce0('0x81')][_0xdce0('0x68')]));}_0x592b77=_0x447886[_0xdce0('0x82')]();_0x447886[_0xdce0('0x24')](_0xba4966);_0x447886[_0xdce0('0x21')](0x0);return;}})[_0xdce0('0x29')](function(){if(_0x2d2e58[_0xdce0('0x92')]===_0xdce0('0x93')){return null;}var _0x3badae=_['merge'](_0x2d2e58,{'name':_0x2d2e58[_0xdce0('0x94')]||_0x2d2e58['name']||_0x3ad334[_0xdce0('0x35')],'basename':_0x400674,'savename':util['format'](_0xdce0('0x95'),_0x2d2e58[_0xdce0('0x35')]||_0x3ad334[_0xdce0('0x35')],require(_0xdce0('0x96'))[_0xdce0('0x97')](0x4),_0x2d2e58[_0xdce0('0x92')]||_0xdce0('0x98')),'reportId':_0x3ad334['id'],'reportType':_0xdce0('0x99')});return db[_0xdce0('0x9a')][_0xdce0('0x4d')](_0x3badae,{'raw':!![]});})[_0xdce0('0x29')](function(_0x2baaa1){if(_0x3ad334[_0xdce0('0x80')]===_0xdce0('0x9b')){_0x592b77[_0xdce0('0x40')](_0x3ad334[_0xdce0('0x80')]+_0xdce0('0x9c'),_0x2d2e58['startDate'],_0x2d2e58[_0xdce0('0x9d')]);}else{_0x592b77[_0xdce0('0x40')](_0x3ad334[_0xdce0('0x80')]+_0xdce0('0x9e'),_0x2d2e58['startDate'],_0x2d2e58[_0xdce0('0x9d')]);}if(_0x2baaa1){logger[_0xdce0('0x9f')](_0xdce0('0xa0'),_0x592b77[_0xdce0('0x85')]());require(_0xdce0('0xa1'))[_0xdce0('0xa2')](path[_0xdce0('0x57')](__dirname,_0xdce0('0xa3'),_0x2baaa1['output']),[_0x2baaa1['id'],_0x592b77[_0xdce0('0x85')](),path[_0xdce0('0x57')](__dirname,'../../files/reports',_0x2baaa1['savename']),_0x400674]);return _0x2baaa1;}else{var _0x43be8f=squel[_0xdce0('0x72')]();_0x43be8f[_0xdce0('0x8e')]('('+_0x592b77['toString']()+')',_0xdce0('0xa4'));_0x43be8f[_0xdce0('0x69')]('COUNT(*)',_0xdce0('0x23'));_0x592b77[_0xdce0('0x24')](_0x2d2e58['limit']||_0xba4966);_0x592b77['offset'](_0x2d2e58[_0xdce0('0x21')]||0x0);return dbH['sequelize'][_0xdce0('0x36')](_0x43be8f['toString'](),{'type':dbH[_0xdce0('0x86')][_0xdce0('0x87')][_0xdce0('0xa5')]})[_0xdce0('0x29')](function(_0x2117ab){if(!_0x2117ab[_0xdce0('0x3c')]){_0x133adf=0x0;}else{_0x133adf=_0x2117ab[0x0][_0xdce0('0x23')]||0x0;}return dbH['sequelize']['query'](_0x592b77[_0xdce0('0x85')](),{'type':dbH[_0xdce0('0x86')][_0xdce0('0x87')][_0xdce0('0xa5')]});})[_0xdce0('0x29')](function(_0x9dc5c7){return{'rows':_0x9dc5c7||[],'count':_0x133adf};});}});}exports[_0xdce0('0xa6')]=function(_0x275510,_0x1dbc10){return runReport(_0x275510[_0xdce0('0x4a')],_0x275510[_0xdce0('0x36')],_0x275510[_0xdce0('0x6c')])[_0xdce0('0x29')](respondWithResult(_0x1dbc10,null))[_0xdce0('0x48')](handleError(_0x1dbc10,null));};exports[_0xdce0('0xa7')]=runReport;exports['query']=function(_0x3137df,_0x41c456){var _0x498b30=0xa;var _0x49b993=[_0xdce0('0x57'),_0xdce0('0x58'),_0xdce0('0x88'),_0xdce0('0x89')];var _0x19181f={'SUM':'SUM(%s)','COUNT':_0xdce0('0xa8'),'COUNT DISTINCT':_0xdce0('0x5a'),'MAX':'MAX(%s)','MIN':_0xdce0('0xa9'),'AVG':_0xdce0('0x5c'),'GROUP_CONCAT':_0xdce0('0x5d'),'GROUP_CONCAT ASC':_0xdce0('0x5e'),'GROUP_CONCAT DESC':_0xdce0('0x5f')};var _0x329c80={'SEC_TO_TIME':_0xdce0('0xaa'),'DATE':_0xdce0('0x8a'),'HOUR':_0xdce0('0x8b'),'ROUND':_0xdce0('0x8c'),'UNIX_TIMESTAMP':_0xdce0('0x60')};var _0x4b2d55=function(_0xcbb4a8){return!_[_0xdce0('0x61')](['IS\x20NULL',_0xdce0('0x63'),_0xdce0('0x64'),_0xdce0('0x65')],_0xcbb4a8);};var _0xf70c87=function(_0xf13dfa){if(!_0xf13dfa||!_0xf13dfa[_0xdce0('0x66')][_0xdce0('0x3c')]){return'';}for(var _0xb334b5='(',_0x5cc32f=0x0;_0x5cc32f<_0xf13dfa[_0xdce0('0x66')]['length'];_0x5cc32f+=0x1){_0x5cc32f>0x0&&(_0xb334b5+='\x20'+_0xf13dfa[_0xdce0('0x67')]+'\x20');_0xb334b5+=_0xf13dfa[_0xdce0('0x66')][_0x5cc32f][_0xdce0('0x68')]?_0xf70c87(_0xf13dfa[_0xdce0('0x66')][_0x5cc32f][_0xdce0('0x68')]):_0xf13dfa[_0xdce0('0x66')][_0x5cc32f][_0xdce0('0x69')]+'\x20'+_0xf13dfa[_0xdce0('0x66')][_0x5cc32f][_0xdce0('0x6a')]+(_0x4b2d55(_0xf13dfa['rules'][_0x5cc32f][_0xdce0('0x6a')])?'\x20'+_0xf13dfa[_0xdce0('0x66')][_0x5cc32f][_0xdce0('0x6b')]:'');}return _0xb334b5+')';};var _0x1d6774={'where':{'id':_0x3137df[_0xdce0('0x4a')]['id']}},_0x4c1222,_0x3381db,_0x14fc57,_0x1a19b9,_0x3cf417;_0x1d6774=_['merge']({},_0x1d6774,_0x3137df[_0xdce0('0x6c')]);return db[_0xdce0('0x45')][_0xdce0('0x4c')](_0x1d6774)[_0xdce0('0x29')](function(_0x546e9f){if(_0x546e9f){_0x4c1222=_0x546e9f;return _0x546e9f[_0xdce0('0x6d')]();}return null;})[_0xdce0('0x29')](function(_0x2fbd7c){if(_0x2fbd7c){if(!_0x2fbd7c['length']){throw new db['Sequelize'][(_0xdce0('0x6e'))](_0xdce0('0x6f'),0x193);}_0x3381db=_0x2fbd7c;return db[_0xdce0('0x70')]['findAll']({'raw':!![]});}return null;})[_0xdce0('0x29')](function(_0x1770aa){if(_0x1770aa){_0x14fc57=_[_0xdce0('0x71')](_0x1770aa,'id');var _0x3a9a33;var _0x1c2a81=squel[_0xdce0('0x72')]();_0x1c2a81['from'](_0x4c1222[_0xdce0('0x80')]);for(var _0x5985c0=0x0;_0x5985c0<_0x3381db['length'];_0x5985c0+=0x1){_0x3a9a33=_0x3381db[_0x5985c0][_0xdce0('0x73')]?_0x14fc57[_0x3381db[_0x5985c0]['MetricId']][_0xdce0('0x8f')]:_0x3381db[_0x5985c0][_0xdce0('0x69')];_0x3a9a33=_0x3381db[_0x5985c0][_0xdce0('0x74')]?_[_0xdce0('0x75')](_0x19181f[_0x3381db[_0x5985c0][_0xdce0('0x74')]],'%s',_0x3a9a33):_0x3a9a33;_0x3a9a33=_0x3381db[_0x5985c0]['format']?_[_0xdce0('0x75')](_0x329c80[_0x3381db[_0x5985c0][_0xdce0('0x76')]],'%s',_0x3a9a33):_0x3a9a33;if(_0x3381db[_0x5985c0][_0xdce0('0x77')]){_0x1c2a81['group'](_0x3a9a33);}_0x3381db[_0x5985c0][_0xdce0('0x78')]&&_0x1c2a81[_0xdce0('0x3e')](_0x3a9a33,_0x3381db[_0x5985c0][_0xdce0('0x78')]===_0xdce0('0x90')?![]:!![]);_0x1c2a81[_0xdce0('0x69')](_0x3a9a33,_0x3381db[_0x5985c0]['alias']||_0x3a9a33);}if(_0x4c1222[_0xdce0('0x7a')]){_0x4c1222['joins']=JSON[_0xdce0('0x7b')](_0x4c1222[_0xdce0('0x7a')]);for(var _0x1f1f32=0x0;_0x1f1f32<_0x4c1222['joins'][_0xdce0('0x3c')];_0x1f1f32+=0x1){if(_0x4c1222[_0xdce0('0x7a')][_0x1f1f32][_0xdce0('0x7c')]&&_[_0xdce0('0x61')](_0x49b993,_0x4c1222['joins'][_0x1f1f32]['type'])&&_0x4c1222[_0xdce0('0x7a')][_0x1f1f32][_0xdce0('0x7d')]&&_0x4c1222[_0xdce0('0x7a')][_0x1f1f32][_0xdce0('0x91')]&&_0x4c1222[_0xdce0('0x7a')][_0x1f1f32][_0xdce0('0x7e')]){_0x1c2a81[_0x4c1222[_0xdce0('0x7a')][_0x1f1f32][_0xdce0('0x7c')]](_0x4c1222[_0xdce0('0x7a')][_0x1f1f32][_0xdce0('0x91')],null,util['format'](_0xdce0('0x7f'),_0x4c1222[_0xdce0('0x80')],_0x4c1222[_0xdce0('0x7a')][_0x1f1f32]['parentKey'],_0x4c1222['joins'][_0x1f1f32]['foreignTable'],_0x4c1222[_0xdce0('0x7a')][_0x1f1f32][_0xdce0('0x7e')]));}}}if(_0x4c1222[_0xdce0('0x81')]){_0x4c1222['conditions']=JSON[_0xdce0('0x7b')](_0x4c1222[_0xdce0('0x81')]);_0x1c2a81['where'](_0xf70c87(_0x4c1222[_0xdce0('0x81')][_0xdce0('0x68')]));}_0x3cf417=_0x1c2a81[_0xdce0('0x82')]();_0x1c2a81[_0xdce0('0x24')](_0x498b30);_0x1c2a81[_0xdce0('0x21')](0x0);logger[_0xdce0('0x83')](_0xdce0('0x84'),_0x1c2a81[_0xdce0('0x85')]());return dbH[_0xdce0('0x86')][_0xdce0('0x36')](_0x1c2a81[_0xdce0('0x85')](),{'type':dbH[_0xdce0('0x86')][_0xdce0('0x87')][_0xdce0('0xa5')]});}})[_0xdce0('0x29')](function(){return{'sql':_0x3cf417[_0xdce0('0x85')]()};})[_0xdce0('0x29')](respondWithResult(_0x41c456,null))['catch'](handleError(_0x41c456,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5bdbf39..2d97507 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 _0x84ff=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport'];(function(_0x226a33,_0x7b219d){var _0x1d2b34=function(_0x345f0f){while(--_0x345f0f){_0x226a33['push'](_0x226a33['shift']());}};_0x1d2b34(++_0x7b219d);}(_0x84ff,0x179));var _0xf84f=function(_0x13ad34,_0x123cdd){_0x13ad34=_0x13ad34-0x0;var _0x3eca02=_0x84ff[_0x13ad34];return _0x3eca02;};'use strict';var _=require(_0xf84f('0x0'));var util=require(_0xf84f('0x1'));var logger=require(_0xf84f('0x2'))(_0xf84f('0x3'));var moment=require(_0xf84f('0x4'));var BPromise=require(_0xf84f('0x5'));var rp=require(_0xf84f('0x6'));var fs=require('fs');var path=require(_0xf84f('0x7'));var rimraf=require(_0xf84f('0x8'));var config=require(_0xf84f('0x9'));var attributes=require(_0xf84f('0xa'));module['exports']=function(_0x1a6c9a,_0x267ae3){return _0x1a6c9a[_0xf84f('0xb')](_0xf84f('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27d7=['define','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x544f9f,_0x485cb1){var _0x6e79ab=function(_0x161b94){while(--_0x161b94){_0x544f9f['push'](_0x544f9f['shift']());}};_0x6e79ab(++_0x485cb1);}(_0x27d7,0xce));var _0x727d=function(_0xe23713,_0x419a1b){_0xe23713=_0xe23713-0x0;var _0x1ac7ce=_0x27d7[_0xe23713];return _0x1ac7ce;};'use strict';var _=require('lodash');var util=require(_0x727d('0x0'));var logger=require(_0x727d('0x1'))(_0x727d('0x2'));var moment=require(_0x727d('0x3'));var BPromise=require(_0x727d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x727d('0x5'));var rimraf=require(_0x727d('0x6'));var config=require(_0x727d('0x7'));var attributes=require(_0x727d('0x8'));module[_0x727d('0x9')]=function(_0x2b4939,_0x289f60){return _0x2b4939[_0x727d('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x727d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 18b6065..973628b 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 _0x2422=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','code','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x2ebec8,_0x799e93){var _0x1bfa7e=function(_0x496141){while(--_0x496141){_0x2ebec8['push'](_0x2ebec8['shift']());}};_0x1bfa7e(++_0x799e93);}(_0x2422,0x18d));var _0x2242=function(_0x3b7658,_0x9e4cfb){_0x3b7658=_0x3b7658-0x0;var _0x2f64d4=_0x2422[_0x3b7658];return _0x2f64d4;};'use strict';var _=require(_0x2242('0x0'));var util=require(_0x2242('0x1'));var moment=require(_0x2242('0x2'));var BPromise=require(_0x2242('0x3'));var rs=require(_0x2242('0x4'));var fs=require('fs');var Redis=require(_0x2242('0x5'));var db=require(_0x2242('0x6'))['db'];var utils=require(_0x2242('0x7'));var logger=require(_0x2242('0x8'))(_0x2242('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2242('0xa')][_0x2242('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x452000,_0x4abc53,_0xef89e6){return new BPromise(function(_0x4954d6,_0xe7ce80){return client['request'](_0x452000,_0xef89e6)[_0x2242('0xc')](function(_0x133549){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4abc53,_0x2242('0xd'));logger['debug'](_0x2242('0xe'),_0x4abc53,_0x2242('0xd'),JSON['stringify'](_0x133549));if(_0x133549['error']){if(_0x133549['error'][_0x2242('0xf')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4abc53,_0x133549[_0x2242('0x10')]['message']);return _0xe7ce80(_0x133549[_0x2242('0x10')][_0x2242('0x11')]);}logger[_0x2242('0x10')](_0x2242('0x12'),_0x4abc53,_0x133549[_0x2242('0x10')]['message']);return _0x4954d6(_0x133549[_0x2242('0x10')]['message']);}else{logger['info'](_0x2242('0x12'),_0x4abc53,_0x2242('0xd'));_0x4954d6(_0x133549[_0x2242('0x13')]['message']);}})[_0x2242('0x14')](function(_0x4d3e3f){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4abc53,_0x4d3e3f);_0xe7ce80(_0x4d3e3f);});});} \ No newline at end of file +var _0x974e=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x5ea4f8,_0x11e665){var _0x50361d=function(_0x353c21){while(--_0x353c21){_0x5ea4f8['push'](_0x5ea4f8['shift']());}};_0x50361d(++_0x11e665);}(_0x974e,0x1b1));var _0xe974=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x974e[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xe974('0x0'));var util=require(_0xe974('0x1'));var moment=require('moment');var BPromise=require(_0xe974('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe974('0x3'));var db=require(_0xe974('0x4'))['db'];var utils=require(_0xe974('0x5'));var logger=require(_0xe974('0x6'))('rpc');var config=require(_0xe974('0x7'));var jayson=require(_0xe974('0x8'));var client=jayson[_0xe974('0x9')][_0xe974('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x302b4d,_0x2b73b8,_0x565f27){return new BPromise(function(_0x3504ac,_0x3f8584){return client[_0xe974('0xb')](_0x302b4d,_0x565f27)[_0xe974('0xc')](function(_0x410ea3){logger[_0xe974('0xd')](_0xe974('0xe'),_0x2b73b8,_0xe974('0xf'));logger[_0xe974('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2b73b8,_0xe974('0xf'),JSON[_0xe974('0x11')](_0x410ea3));if(_0x410ea3[_0xe974('0x12')]){if(_0x410ea3[_0xe974('0x12')][_0xe974('0x13')]===0x1f4){logger['error'](_0xe974('0xe'),_0x2b73b8,_0x410ea3[_0xe974('0x12')][_0xe974('0x14')]);return _0x3f8584(_0x410ea3[_0xe974('0x12')][_0xe974('0x14')]);}logger[_0xe974('0x12')](_0xe974('0xe'),_0x2b73b8,_0x410ea3['error'][_0xe974('0x14')]);return _0x3504ac(_0x410ea3[_0xe974('0x12')]['message']);}else{logger[_0xe974('0xd')](_0xe974('0xe'),_0x2b73b8,_0xe974('0xf'));_0x3504ac(_0x410ea3[_0xe974('0x15')][_0xe974('0x14')]);}})[_0xe974('0x16')](function(_0x3652de){logger['error'](_0xe974('0xe'),_0x2b73b8,_0x3652de);_0x3f8584(_0x3652de);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e75b5d0..394fece 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 _0x91cb=['isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0x91cb,0x1c8));var _0xb91c=function(_0x4a6934,_0x1237f4){_0x4a6934=_0x4a6934-0x0;var _0x532acf=_0x91cb[_0x4a6934];return _0x532acf;};'use strict';var multer=require(_0xb91c('0x0'));var util=require('util');var path=require(_0xb91c('0x1'));var timeout=require(_0xb91c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb91c('0x3'));var config=require(_0xb91c('0x4'));var controller=require(_0xb91c('0x5'));router['get']('/',auth[_0xb91c('0x6')](),controller[_0xb91c('0x7')]);router[_0xb91c('0x8')](_0xb91c('0x9'),auth[_0xb91c('0x6')](),controller['show']);router[_0xb91c('0x8')](_0xb91c('0xa'),auth[_0xb91c('0x6')](),controller[_0xb91c('0xb')]);router[_0xb91c('0x8')](_0xb91c('0xc'),auth['isAuthenticated'](),controller[_0xb91c('0xd')]);router[_0xb91c('0x8')](_0xb91c('0xe'),auth[_0xb91c('0x6')](),controller[_0xb91c('0xf')]);router[_0xb91c('0x10')]('/',auth[_0xb91c('0x6')](),controller['create']);router[_0xb91c('0x11')](_0xb91c('0x9'),auth['isAuthenticated'](),controller[_0xb91c('0x12')]);router[_0xb91c('0x13')]('/:id',auth[_0xb91c('0x6')](),controller[_0xb91c('0x14')]);module[_0xb91c('0x15')]=router; \ No newline at end of file +var _0x8ebf=['/:id/preview','preview','run','/:id/query','post','create','put','/:id','update','delete','multer','util','connect-timeout','fs-extra','../../config/environment','isAuthenticated','index','get'];(function(_0x3842cb,_0x426d6e){var _0xa94e3c=function(_0x5a7857){while(--_0x5a7857){_0x3842cb['push'](_0x3842cb['shift']());}};_0xa94e3c(++_0x426d6e);}(_0x8ebf,0x172));var _0xf8eb=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x8ebf[_0x62c958];return _0x57ec61;};'use strict';var multer=require(_0xf8eb('0x0'));var util=require(_0xf8eb('0x1'));var path=require('path');var timeout=require(_0xf8eb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf8eb('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf8eb('0x4'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xf8eb('0x5')](),controller[_0xf8eb('0x6')]);router[_0xf8eb('0x7')]('/:id',auth[_0xf8eb('0x5')](),controller['show']);router['get'](_0xf8eb('0x8'),auth[_0xf8eb('0x5')](),controller[_0xf8eb('0x9')]);router['get']('/:id/run',auth[_0xf8eb('0x5')](),controller[_0xf8eb('0xa')]);router['get'](_0xf8eb('0xb'),auth['isAuthenticated'](),controller['query']);router[_0xf8eb('0xc')]('/',auth[_0xf8eb('0x5')](),controller[_0xf8eb('0xd')]);router[_0xf8eb('0xe')](_0xf8eb('0xf'),auth[_0xf8eb('0x5')](),controller[_0xf8eb('0x10')]);router[_0xf8eb('0x11')](_0xf8eb('0xf'),auth[_0xf8eb('0x5')](),controller['destroy']);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 03eea7f..6d902ac 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x8d6c19,_0x513845){var _0x10ad87=function(_0x2a8a68){while(--_0x2a8a68){_0x8d6c19['push'](_0x8d6c19['shift']());}};_0x10ad87(++_0x513845);}(_0xac9d,0x14d));var _0xdac9=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xac9d[_0xd22d95];return _0x15d7a3;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x2b7c03,_0x166134){var _0x2bc83f=function(_0x408580){while(--_0x408580){_0x2b7c03['push'](_0x2b7c03['shift']());}};_0x2bc83f(++_0x166134);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index aebc441..d56ff6d 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 _0x187d=['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/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','limit','undefined','count','offset','set','json','save','update','then','get','destroy','error','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','order','sort','filter','where','merge','options','includeAll','rows','catch','include','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','left_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\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','field','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','IS\x20EMPTY','operator','AnalyticMetric','function','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','select','countTable','QueryTypes','runReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x5f19de,_0x58a3c3){var _0x31f8fd=function(_0x5d47f4){while(--_0x5d47f4){_0x5f19de['push'](_0x5f19de['shift']());}};_0x31f8fd(++_0x58a3c3);}(_0x187d,0x93));var _0xd187=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x187d[_0x102e37];return _0x35a07c;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];var dbH=require(_0xd187('0x1a'))[_0xd187('0x1b')];function respondWithStatusCode(_0x59ee4a,_0x33e3d5){_0x33e3d5=_0x33e3d5||0xcc;return function(_0x18ce42){if(_0x18ce42){return _0x59ee4a[_0xd187('0x1c')](_0x33e3d5);}return _0x59ee4a[_0xd187('0x1d')](_0x33e3d5)['end']();};}function respondWithResult(_0x39a927,_0x2050d5){_0x2050d5=_0x2050d5||0xc8;return function(_0x45ab10){if(_0x45ab10){return _0x39a927[_0xd187('0x1d')](_0x2050d5)['json'](_0x45ab10);}};}function respondWithFilteredResult(_0x245d3e,_0x52a208){return function(_0x5cf218){if(_0x5cf218){var _0x40ed84=typeof _0x52a208['offset']==='undefined'&&typeof _0x52a208[_0xd187('0x1e')]===_0xd187('0x1f');var _0x374fe0=_0x5cf218[_0xd187('0x20')];var _0x21df74=_0x40ed84?0x0:_0x52a208[_0xd187('0x21')];var _0x12b388=_0x40ed84?_0x5cf218[_0xd187('0x20')]:_0x52a208[_0xd187('0x21')]+_0x52a208[_0xd187('0x1e')];var _0x170d5c;if(_0x12b388>=_0x374fe0){_0x12b388=_0x374fe0;_0x170d5c=0xc8;}else{_0x170d5c=0xce;}_0x245d3e[_0xd187('0x1d')](_0x170d5c);return _0x245d3e[_0xd187('0x22')]('Content-Range',_0x21df74+'-'+_0x12b388+'/'+_0x374fe0)[_0xd187('0x23')](_0x5cf218);}return null;};}function patchUpdates(_0x81b988){return function(_0xc5bba5){try{jsonpatch['apply'](_0xc5bba5,_0x81b988,!![]);}catch(_0x5a0360){return BPromise['reject'](_0x5a0360);}return _0xc5bba5[_0xd187('0x24')]();};}function saveUpdates(_0x33741d,_0x249a82){return function(_0x4f62c8){if(_0x4f62c8){return _0x4f62c8[_0xd187('0x25')](_0x33741d)['then'](function(_0x145771){return _0x145771;});}return null;};}function removeEntity(_0x5a7a23,_0x1047f4){return function(_0x54f340){if(_0x54f340){return _0x54f340['destroy']()[_0xd187('0x26')](function(){var _0x4d992b=_0x54f340[_0xd187('0x27')]({'plain':!![]});var _0x598aa4='DefaultReports';return db['UserProfileResource'][_0xd187('0x28')]({'where':{'type':_0x598aa4,'resourceId':_0x4d992b['id']}})[_0xd187('0x26')](function(){return _0x54f340;});})[_0xd187('0x26')](function(){_0x5a7a23[_0xd187('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a20ed,_0x2875c8){return function(_0x5c8e52){if(!_0x5c8e52){_0x2a20ed[_0xd187('0x1c')](0x194);}return _0x5c8e52;};}function handleError(_0x1c87ee,_0x34febe){_0x34febe=_0x34febe||0x1f4;return function(_0x4c50a5){logger[_0xd187('0x29')](_0x4c50a5['stack']);if(_0x4c50a5[_0xd187('0x2a')]){delete _0x4c50a5[_0xd187('0x2a')];}_0x1c87ee[_0xd187('0x1d')](_0x34febe)[_0xd187('0x2b')](_0x4c50a5);};}exports['index']=function(_0x140e54,_0xb38778){var _0x5bba10={},_0x4cc587={},_0x1a1922={'count':0x0,'rows':[]};var _0x1836cf=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x2d8843){return{'name':_0x2d8843[_0xd187('0x2f')],'type':_0x2d8843[_0xd187('0x30')]['key']};});_0x4cc587[_0xd187('0x31')]=_[_0xd187('0x2c')](_0x1836cf,_0xd187('0x2a'));_0x4cc587['query']=_[_0xd187('0x32')](_0x140e54['query']);_0x4cc587[_0xd187('0x33')]=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],_0x4cc587['query']);_0x5bba10['attributes']=_[_0xd187('0x34')](_0x4cc587[_0xd187('0x31')],qs['fields'](_0x140e54[_0xd187('0x35')][_0xd187('0x36')]));_0x5bba10[_0xd187('0x37')]=_0x5bba10['attributes']['length']?_0x5bba10[_0xd187('0x37')]:_0x4cc587[_0xd187('0x31')];if(!_0x140e54['query']['hasOwnProperty']('nolimit')){_0x5bba10[_0xd187('0x1e')]=qs['limit'](_0x140e54[_0xd187('0x35')][_0xd187('0x1e')]);_0x5bba10['offset']=qs[_0xd187('0x21')](_0x140e54['query'][_0xd187('0x21')]);}_0x5bba10[_0xd187('0x38')]=qs['sort'](_0x140e54[_0xd187('0x35')][_0xd187('0x39')]);_0x5bba10['where']=qs[_0xd187('0x33')](_['pick'](_0x140e54['query'],_0x4cc587[_0xd187('0x33')]),_0x1836cf);if(_0x140e54[_0xd187('0x35')][_0xd187('0x3a')]){_0x5bba10[_0xd187('0x3b')]=_[_0xd187('0x3c')](_0x5bba10['where'],{'$or':_[_0xd187('0x2c')](_0x1836cf,function(_0xe090ad){if(_0xe090ad[_0xd187('0x30')]!=='VIRTUAL'){var _0x4b121c={};_0x4b121c[_0xe090ad['name']]={'$like':'%'+_0x140e54['query'][_0xd187('0x3a')]+'%'};return _0x4b121c;}})});}_0x5bba10=_[_0xd187('0x3c')]({},_0x5bba10,_0x140e54[_0xd187('0x3d')]);var _0x367303={'where':_0x5bba10[_0xd187('0x3b')]};return db[_0xd187('0x2d')][_0xd187('0x20')](_0x367303)[_0xd187('0x26')](function(_0x526060){_0x1a1922[_0xd187('0x20')]=_0x526060;if(_0x140e54[_0xd187('0x35')][_0xd187('0x3e')]){_0x5bba10['include']=[{'all':!![]}];}return db[_0xd187('0x2d')]['findAll'](_0x5bba10);})[_0xd187('0x26')](function(_0x406d29){_0x1a1922[_0xd187('0x3f')]=_0x406d29;return _0x1a1922;})[_0xd187('0x26')](respondWithFilteredResult(_0xb38778,_0x5bba10))[_0xd187('0x40')](handleError(_0xb38778,null));};exports['show']=function(_0x3f0484,_0x3d9e60){var _0x3215b1={'raw':!![],'where':{'id':_0x3f0484['params']['id']}},_0x3fa19c={};_0x3fa19c[_0xd187('0x31')]=_[_0xd187('0x32')](db['AnalyticDefaultReport'][_0xd187('0x2e')]);_0x3fa19c[_0xd187('0x35')]=_['keys'](_0x3f0484['query']);_0x3fa19c[_0xd187('0x33')]=_[_0xd187('0x34')](_0x3fa19c['model'],_0x3fa19c['query']);_0x3215b1['attributes']=_[_0xd187('0x34')](_0x3fa19c[_0xd187('0x31')],qs[_0xd187('0x36')](_0x3f0484[_0xd187('0x35')][_0xd187('0x36')]));_0x3215b1[_0xd187('0x37')]=_0x3215b1[_0xd187('0x37')]['length']?_0x3215b1[_0xd187('0x37')]:_0x3fa19c[_0xd187('0x31')];if(_0x3f0484[_0xd187('0x35')][_0xd187('0x3e')]){_0x3215b1[_0xd187('0x41')]=[{'all':!![]}];}_0x3215b1=_[_0xd187('0x3c')]({},_0x3215b1,_0x3f0484[_0xd187('0x3d')]);return db[_0xd187('0x2d')]['find'](_0x3215b1)[_0xd187('0x26')](handleEntityNotFound(_0x3d9e60,null))[_0xd187('0x26')](respondWithResult(_0x3d9e60,null))[_0xd187('0x40')](handleError(_0x3d9e60,null));};exports[_0xd187('0x42')]=function(_0x36b99d,_0x5ad646){return db[_0xd187('0x2d')][_0xd187('0x42')](_0x36b99d['body'],{})[_0xd187('0x26')](function(_0xd9635d){var _0x55fac6=_0x36b99d['user']['get']({'plain':!![]});if(!_0x55fac6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55fac6[_0xd187('0x43')]===_0xd187('0x44')){var _0x12d448=_0xd9635d[_0xd187('0x27')]({'plain':!![]});var _0x460202=_0xd187('0x45');return db[_0xd187('0x46')]['find']({'where':{'name':_0x460202,'userProfileId':_0x55fac6[_0xd187('0x47')]},'raw':!![]})[_0xd187('0x26')](function(_0x1b12c4){if(_0x1b12c4&&_0x1b12c4[_0xd187('0x48')]===0x0){return db['UserProfileResource'][_0xd187('0x42')]({'name':_0x12d448['name'],'resourceId':_0x12d448['id'],'type':'DefaultReports','sectionId':_0x1b12c4['id']},{})[_0xd187('0x26')](function(){return _0xd9635d;});}else{return _0xd9635d;}})['catch'](function(_0x1a1252){logger[_0xd187('0x29')](_0xd187('0x49'),_0x1a1252);throw _0x1a1252;});}return _0xd9635d;})[_0xd187('0x26')](respondWithResult(_0x5ad646,0xc9))[_0xd187('0x40')](handleError(_0x5ad646,null));};exports[_0xd187('0x25')]=function(_0x3c7ba6,_0x2b4f9d){if(_0x3c7ba6[_0xd187('0x4a')]['id']){delete _0x3c7ba6['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x4b')]({'where':{'id':_0x3c7ba6['params']['id']}})[_0xd187('0x26')](handleEntityNotFound(_0x2b4f9d,null))[_0xd187('0x26')](saveUpdates(_0x3c7ba6[_0xd187('0x4a')],null))['then'](respondWithResult(_0x2b4f9d,null))[_0xd187('0x40')](handleError(_0x2b4f9d,null));};exports[_0xd187('0x28')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x2d')]['find']({'where':{'id':_0x50073d[_0xd187('0x4c')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x26')](removeEntity(_0x457da1,null))[_0xd187('0x40')](handleError(_0x457da1,null));};exports[_0xd187('0x4d')]=function(_0x508866,_0x100d64){var _0x2265fb=0xa;var _0x1675d9=['join',_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x56b36b={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':_0xd187('0x58'),'GROUP_CONCAT DESC':_0xd187('0x59')};var _0x2c7dd9={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':_0xd187('0x5b'),'HOUR':_0xd187('0x5c'),'ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0xaff1e6=function(_0x42fb32){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x42fb32);};var _0x48c82d=function(_0x13d118){if(!_0x13d118||!_0x13d118[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x4225e6='(',_0x51fbdb=0x0;_0x51fbdb<_0x13d118[_0xd187('0x63')][_0xd187('0x64')];_0x51fbdb+=0x1){_0x51fbdb>0x0&&(_0x4225e6+='\x20'+_0x13d118['operator']+'\x20');_0x4225e6+=_0x13d118['rules'][_0x51fbdb][_0xd187('0x65')]?_0x48c82d(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x65')]):_0x13d118[_0xd187('0x63')][_0x51fbdb]['field']+'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb]['condition']+(_0xaff1e6(_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x66')])?'\x20'+_0x13d118[_0xd187('0x63')][_0x51fbdb][_0xd187('0x67')]:'');}return _0x4225e6+')';};var _0x57cad7={'where':{'id':_0x508866['params']['id']}},_0x2409a8,_0xaea7e0,_0xd12560,_0x9e82c,_0x151f3c;_0x57cad7=_['merge']({},_0x57cad7,_0x508866[_0xd187('0x3d')]);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x57cad7)[_0xd187('0x26')](function(_0x13e05a){if(_0x13e05a){_0x2409a8=_0x13e05a;return _0x13e05a[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1291cc){if(_0x1291cc){if(!_0x1291cc[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0xaea7e0=_0x1291cc;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x54e908){if(_0x54e908){_0xd12560=_[_0xd187('0x6d')](_0x54e908,'id');var _0x1a9979;var _0x4bec3e=squel['select']();_0x4bec3e[_0xd187('0x6e')](_0x2409a8[_0xd187('0x6f')]);for(var _0x2ac56f=0x0;_0x2ac56f<_0xaea7e0[_0xd187('0x64')];_0x2ac56f+=0x1){_0x1a9979=_0xaea7e0[_0x2ac56f]['MetricId']?_0xd12560[_0xaea7e0[_0x2ac56f][_0xd187('0x70')]][_0xd187('0x71')]:_0xaea7e0[_0x2ac56f]['field'];_0x1a9979=_0xaea7e0[_0x2ac56f]['function']?_[_0xd187('0x72')](_0x56b36b[_0xaea7e0[_0x2ac56f]['function']],'%s',_0x1a9979):_0x1a9979;_0x1a9979=_0xaea7e0[_0x2ac56f][_0xd187('0x73')]?_[_0xd187('0x72')](_0x2c7dd9[_0xaea7e0[_0x2ac56f]['format']],'%s',_0x1a9979):_0x1a9979;if(_0xaea7e0[_0x2ac56f][_0xd187('0x74')]){_0x4bec3e['group'](_0x1a9979);}_0xaea7e0[_0x2ac56f][_0xd187('0x75')]&&_0x4bec3e['order'](_0x1a9979,_0xaea7e0[_0x2ac56f]['orderBy']==='DESC'?![]:!![]);_0x4bec3e[_0xd187('0x76')](_0x1a9979,_0xaea7e0[_0x2ac56f][_0xd187('0x77')]||_0x1a9979);}if(_0x2409a8[_0xd187('0x78')]){_0x2409a8[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x78')]);for(var _0x11858e=0x0;_0x11858e<_0x2409a8[_0xd187('0x78')]['length'];_0x11858e+=0x1){if(_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x1675d9,_0x2409a8['joins'][_0x11858e][_0xd187('0x30')])&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7a')]&&_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable']&&_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7b')]){_0x4bec3e[_0x2409a8['joins'][_0x11858e][_0xd187('0x30')]](_0x2409a8[_0xd187('0x78')][_0x11858e][_0xd187('0x7c')],null,util[_0xd187('0x73')]('%s.%s\x20=\x20%s.%s',_0x2409a8[_0xd187('0x6f')],_0x2409a8[_0xd187('0x78')][_0x11858e]['parentKey'],_0x2409a8[_0xd187('0x78')][_0x11858e]['foreignTable'],_0x2409a8['joins'][_0x11858e]['foreignKey']));}}}if(_0x2409a8[_0xd187('0x7d')]){_0x2409a8[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x2409a8[_0xd187('0x7d')]);_0x4bec3e[_0xd187('0x3b')](_0x48c82d(_0x2409a8[_0xd187('0x7d')]['group']));}_0x151f3c=_0x4bec3e[_0xd187('0x7e')]();_0x4bec3e[_0xd187('0x1e')](_0x2265fb);_0x4bec3e['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x4bec3e[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x4bec3e[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes'][_0xd187('0x82')]});}})[_0xd187('0x26')](respondWithResult(_0x100d64,null))[_0xd187('0x40')](handleError(_0x100d64,null));};function runReport(_0xbc650f,_0x1da684,_0x2879ff){var _0x1982cd=_0x1da684[_0xd187('0x2a')];var _0x3d9b2f=0xa;var _0xf31fac=[_0xd187('0x83'),_0xd187('0x4e'),'right_join','cross_join'];var _0x3d7e97={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':_0xd187('0x53'),'MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd187('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x520f86={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd187('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x1ccb17=function(_0x432995){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x84'),_0xd187('0x62')],_0x432995);};var _0x395e45=function(_0x1e8839){if(!_0x1e8839||!_0x1e8839[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x2101a3='(',_0x25fc08=0x0;_0x25fc08<_0x1e8839['rules'][_0xd187('0x64')];_0x25fc08+=0x1){_0x25fc08>0x0&&(_0x2101a3+='\x20'+_0x1e8839[_0xd187('0x85')]+'\x20');_0x2101a3+=_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x65')]?_0x395e45(_0x1e8839['rules'][_0x25fc08][_0xd187('0x65')]):_0x1e8839[_0xd187('0x63')][_0x25fc08]['field']+'\x20'+_0x1e8839['rules'][_0x25fc08][_0xd187('0x66')]+(_0x1ccb17(_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x66')])?'\x20'+_0x1e8839[_0xd187('0x63')][_0x25fc08][_0xd187('0x67')]:'');}return _0x2101a3+')';};var _0x475ea9={'where':{'id':_0xbc650f['id']}},_0x4dd0c7,_0x22900,_0x22424d,_0x5b7870,_0x3244dd;_0x475ea9=_[_0xd187('0x3c')]({},_0x475ea9,_0x2879ff);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x475ea9)['then'](function(_0x5be1c9){if(_0x5be1c9){_0x4dd0c7=_0x5be1c9;return _0x5be1c9[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x1cd0d2){if(_0x1cd0d2){if(!_0x1cd0d2['length']){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x22900=_0x1cd0d2;return db[_0xd187('0x86')]['findAll']({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x4efb9f){if(_0x4efb9f){_0x22424d=_['keyBy'](_0x4efb9f,'id');var _0x4a9310;var _0x54bf98=squel['select']();_0x54bf98['from'](_0x4dd0c7['table']);for(var _0x323311=0x0;_0x323311<_0x22900[_0xd187('0x64')];_0x323311+=0x1){_0x4a9310=_0x22900[_0x323311]['MetricId']?_0x22424d[_0x22900[_0x323311][_0xd187('0x70')]][_0xd187('0x71')]:_0x22900[_0x323311][_0xd187('0x76')];_0x4a9310=_0x22900[_0x323311][_0xd187('0x87')]?_[_0xd187('0x72')](_0x3d7e97[_0x22900[_0x323311]['function']],'%s',_0x4a9310):_0x4a9310;_0x4a9310=_0x22900[_0x323311][_0xd187('0x73')]?_['replace'](_0x520f86[_0x22900[_0x323311][_0xd187('0x73')]],'%s',_0x4a9310):_0x4a9310;if(_0x22900[_0x323311][_0xd187('0x74')]){_0x54bf98[_0xd187('0x65')](_0x4a9310);}_0x22900[_0x323311][_0xd187('0x75')]&&_0x54bf98[_0xd187('0x38')](_0x4a9310,_0x22900[_0x323311][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x54bf98['field'](_0x4a9310,_0x22900[_0x323311][_0xd187('0x77')]||_0x4a9310);}if(_0x4dd0c7[_0xd187('0x78')]){_0x4dd0c7['joins']=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x78')]);for(var _0x5df926=0x0;_0x5df926<_0x4dd0c7[_0xd187('0x78')][_0xd187('0x64')];_0x5df926+=0x1){if(_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0xf31fac,_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')])&&_0x4dd0c7[_0xd187('0x78')][_0x5df926]['parentKey']&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')]&&_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]){_0x54bf98[_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x30')]](_0x4dd0c7['joins'][_0x5df926]['foreignTable'],null,util[_0xd187('0x73')](_0xd187('0x89'),_0x4dd0c7['table'],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7a')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7c')],_0x4dd0c7[_0xd187('0x78')][_0x5df926][_0xd187('0x7b')]));}}}if(_0x4dd0c7['conditions']){_0x4dd0c7[_0xd187('0x7d')]=JSON[_0xd187('0x79')](_0x4dd0c7[_0xd187('0x7d')]);_0x54bf98[_0xd187('0x3b')](_0x395e45(_0x4dd0c7[_0xd187('0x7d')][_0xd187('0x65')]));}_0x3244dd=_0x54bf98[_0xd187('0x7e')]();_0x54bf98[_0xd187('0x1e')](_0x3d9b2f);_0x54bf98[_0xd187('0x21')](0x0);return;}})['then'](function(){if(_0x1da684[_0xd187('0x8a')]===_0xd187('0x8b')){return null;}var _0x25a053=_['merge'](_0x1da684,{'name':_0x1da684[_0xd187('0x8c')]||_0x1da684[_0xd187('0x2a')]||_0x4dd0c7[_0xd187('0x2a')],'basename':_0x1982cd,'savename':util[_0xd187('0x73')](_0xd187('0x8d'),_0x1da684[_0xd187('0x2a')]||_0x4dd0c7['name'],require(_0xd187('0x8e'))[_0xd187('0x8f')](0x4),_0x1da684[_0xd187('0x8a')]||'csv'),'reportId':_0x4dd0c7['id'],'reportType':_0xd187('0x90')});return db[_0xd187('0x91')][_0xd187('0x42')](_0x25a053,{'raw':!![]});})[_0xd187('0x26')](function(_0x12599e){if(_0x4dd0c7[_0xd187('0x6f')]==='cdr'){_0x3244dd[_0xd187('0x3b')](_0x4dd0c7[_0xd187('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1da684[_0xd187('0x92')],_0x1da684[_0xd187('0x93')]);}else{_0x3244dd['where'](_0x4dd0c7[_0xd187('0x6f')]+_0xd187('0x94'),_0x1da684['startDate'],_0x1da684[_0xd187('0x93')]);}if(_0x12599e){logger[_0xd187('0x95')]('Run\x20Query:',_0x3244dd[_0xd187('0x80')]());require('child_process')[_0xd187('0x96')](path[_0xd187('0x83')](__dirname,_0xd187('0x97'),_0x12599e[_0xd187('0x8a')]),[_0x12599e['id'],_0x3244dd[_0xd187('0x80')](),path['join'](__dirname,'../../files/reports',_0x12599e[_0xd187('0x98')]),_0x1982cd]);return _0x12599e;}else{var _0x2a2c7f=squel[_0xd187('0x99')]();_0x2a2c7f[_0xd187('0x6e')]('('+_0x3244dd[_0xd187('0x80')]()+')',_0xd187('0x9a'));_0x2a2c7f[_0xd187('0x76')]('COUNT(*)',_0xd187('0x20'));_0x3244dd[_0xd187('0x1e')](_0x1da684[_0xd187('0x1e')]||_0x3d9b2f);_0x3244dd[_0xd187('0x21')](_0x1da684[_0xd187('0x21')]||0x0);return dbH[_0xd187('0x81')]['query'](_0x2a2c7f[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')][_0xd187('0x82')]})[_0xd187('0x26')](function(_0x38a7cd){if(!_0x38a7cd[_0xd187('0x64')]){_0x5b7870=0x0;}else{_0x5b7870=_0x38a7cd[0x0][_0xd187('0x20')]||0x0;}return dbH['sequelize'][_0xd187('0x35')](_0x3244dd['toString'](),{'type':dbH[_0xd187('0x81')][_0xd187('0x9b')]['SELECT']});})[_0xd187('0x26')](function(_0x254e0a){return{'rows':_0x254e0a||[],'count':_0x5b7870};});}});}exports['run']=function(_0x1776c1,_0x497a94){return runReport(_0x1776c1[_0xd187('0x4c')],_0x1776c1['query'],_0x1776c1['options'])[_0xd187('0x26')](respondWithResult(_0x497a94,null))[_0xd187('0x40')](handleError(_0x497a94,null));};exports[_0xd187('0x9c')]=runReport;exports[_0xd187('0x35')]=function(_0x568f72,_0x357526){var _0x13ee40=0xa;var _0x20c269=[_0xd187('0x83'),_0xd187('0x4e'),_0xd187('0x4f'),_0xd187('0x50')];var _0x25ff89={'SUM':_0xd187('0x51'),'COUNT':_0xd187('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd187('0x54'),'MIN':_0xd187('0x55'),'AVG':_0xd187('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd187('0x59')};var _0x28798f={'SEC_TO_TIME':_0xd187('0x5a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd187('0x5d'),'UNIX_TIMESTAMP':_0xd187('0x5e')};var _0x56fcde=function(_0x37b1b0){return!_[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),'IS\x20EMPTY',_0xd187('0x62')],_0x37b1b0);};var _0x428e6c=function(_0x4524c3){if(!_0x4524c3||!_0x4524c3[_0xd187('0x63')][_0xd187('0x64')]){return'';}for(var _0x3a2937='(',_0xf03f9a=0x0;_0xf03f9a<_0x4524c3['rules'][_0xd187('0x64')];_0xf03f9a+=0x1){_0xf03f9a>0x0&&(_0x3a2937+='\x20'+_0x4524c3['operator']+'\x20');_0x3a2937+=_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']?_0x428e6c(_0x4524c3[_0xd187('0x63')][_0xf03f9a]['group']):_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x76')]+'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a]['condition']+(_0x56fcde(_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x66')])?'\x20'+_0x4524c3[_0xd187('0x63')][_0xf03f9a][_0xd187('0x67')]:'');}return _0x3a2937+')';};var _0x37405d={'where':{'id':_0x568f72[_0xd187('0x4c')]['id']}},_0xe84f78,_0x12b4a4,_0x3d09a6,_0x5acea7,_0x2a756f;_0x37405d=_[_0xd187('0x3c')]({},_0x37405d,_0x568f72['options']);return db[_0xd187('0x2d')][_0xd187('0x4b')](_0x37405d)[_0xd187('0x26')](function(_0x110af6){if(_0x110af6){_0xe84f78=_0x110af6;return _0x110af6[_0xd187('0x68')]();}return null;})[_0xd187('0x26')](function(_0x2e4db4){if(_0x2e4db4){if(!_0x2e4db4[_0xd187('0x64')]){throw new db[(_0xd187('0x69'))][(_0xd187('0x6a'))](_0xd187('0x6b'),0x193);}_0x12b4a4=_0x2e4db4;return db['AnalyticMetric'][_0xd187('0x6c')]({'raw':!![]});}return null;})[_0xd187('0x26')](function(_0x50d5b8){if(_0x50d5b8){_0x3d09a6=_[_0xd187('0x6d')](_0x50d5b8,'id');var _0x48ef98;var _0x2008e9=squel['select']();_0x2008e9[_0xd187('0x6e')](_0xe84f78[_0xd187('0x6f')]);for(var _0x9b8840=0x0;_0x9b8840<_0x12b4a4[_0xd187('0x64')];_0x9b8840+=0x1){_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x70')]?_0x3d09a6[_0x12b4a4[_0x9b8840]['MetricId']][_0xd187('0x71')]:_0x12b4a4[_0x9b8840][_0xd187('0x76')];_0x48ef98=_0x12b4a4[_0x9b8840][_0xd187('0x87')]?_[_0xd187('0x72')](_0x25ff89[_0x12b4a4[_0x9b8840][_0xd187('0x87')]],'%s',_0x48ef98):_0x48ef98;_0x48ef98=_0x12b4a4[_0x9b8840]['format']?_[_0xd187('0x72')](_0x28798f[_0x12b4a4[_0x9b8840][_0xd187('0x73')]],'%s',_0x48ef98):_0x48ef98;if(_0x12b4a4[_0x9b8840][_0xd187('0x74')]){_0x2008e9['group'](_0x48ef98);}_0x12b4a4[_0x9b8840]['orderBy']&&_0x2008e9[_0xd187('0x38')](_0x48ef98,_0x12b4a4[_0x9b8840][_0xd187('0x75')]===_0xd187('0x88')?![]:!![]);_0x2008e9[_0xd187('0x76')](_0x48ef98,_0x12b4a4[_0x9b8840]['alias']||_0x48ef98);}if(_0xe84f78[_0xd187('0x78')]){_0xe84f78[_0xd187('0x78')]=JSON[_0xd187('0x79')](_0xe84f78[_0xd187('0x78')]);for(var _0x4bff96=0x0;_0x4bff96<_0xe84f78[_0xd187('0x78')]['length'];_0x4bff96+=0x1){if(_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]&&_[_0xd187('0x5f')](_0x20c269,_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')])&&_0xe84f78['joins'][_0x4bff96][_0xd187('0x7a')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')]&&_0xe84f78[_0xd187('0x78')][_0x4bff96]['foreignKey']){_0x2008e9[_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x30')]](_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],null,util[_0xd187('0x73')](_0xd187('0x89'),_0xe84f78[_0xd187('0x6f')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7a')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7c')],_0xe84f78[_0xd187('0x78')][_0x4bff96][_0xd187('0x7b')]));}}}if(_0xe84f78['conditions']){_0xe84f78[_0xd187('0x7d')]=JSON['parse'](_0xe84f78[_0xd187('0x7d')]);_0x2008e9['where'](_0x428e6c(_0xe84f78[_0xd187('0x7d')][_0xd187('0x65')]));}_0x2a756f=_0x2008e9[_0xd187('0x7e')]();_0x2008e9[_0xd187('0x1e')](_0x13ee40);_0x2008e9['offset'](0x0);logger['debug'](_0xd187('0x7f'),_0x2008e9[_0xd187('0x80')]());return dbH[_0xd187('0x81')][_0xd187('0x35')](_0x2008e9[_0xd187('0x80')](),{'type':dbH[_0xd187('0x81')]['QueryTypes']['SELECT']});}})[_0xd187('0x26')](function(){return{'sql':_0x2a756f[_0xd187('0x80')]()};})[_0xd187('0x26')](respondWithResult(_0x357526,null))['catch'](handleError(_0x357526,null));}; \ No newline at end of file +var _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x326f,0xd1));var _0xf326=function(_0x143267,_0x9c8f4c){_0x143267=_0x143267-0x0;var _0x742a75=_0x326f[_0x143267];return _0x742a75;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 63a771b..9aba315 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 _0x9831=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x54a0aa,_0x519779){var _0x24f90d=function(_0x499c25){while(--_0x499c25){_0x54a0aa['push'](_0x54a0aa['shift']());}};_0x24f90d(++_0x519779);}(_0x9831,0x1e1));var _0x1983=function(_0x538fc9,_0x5e980b){_0x538fc9=_0x538fc9-0x0;var _0x520bce=_0x9831[_0x538fc9];return _0x520bce;};'use strict';var _=require(_0x1983('0x0'));var util=require(_0x1983('0x1'));var logger=require(_0x1983('0x2'))(_0x1983('0x3'));var moment=require(_0x1983('0x4'));var BPromise=require(_0x1983('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1983('0x6'));var rimraf=require(_0x1983('0x7'));var config=require(_0x1983('0x8'));var attributes=require(_0x1983('0x9'));module[_0x1983('0xa')]=function(_0x5d8cbc,_0x88a728){return _0x5d8cbc[_0x1983('0xb')](_0x1983('0xc'),attributes,{'tableName':_0x1983('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc677=['bluebird','request-promise','path','AnalyticDefaultReport','util','../../config/logger','api','moment'];(function(_0x46d4c7,_0x10db9c){var _0x2d2fc3=function(_0x1d4995){while(--_0x1d4995){_0x46d4c7['push'](_0x46d4c7['shift']());}};_0x2d2fc3(++_0x10db9c);}(_0xc677,0x16c));var _0x7c67=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc677[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x7c67('0x0'));var logger=require(_0x7c67('0x1'))(_0x7c67('0x2'));var moment=require(_0x7c67('0x3'));var BPromise=require(_0x7c67('0x4'));var rp=require(_0x7c67('0x5'));var fs=require('fs');var path=require(_0x7c67('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x139fd5,_0x2e311e){return _0x139fd5['define'](_0x7c67('0x7'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index f885261..544a28e 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 _0x8f58=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x1b4120,_0x3efa73){var _0x329480=function(_0x3a07df){while(--_0x3a07df){_0x1b4120['push'](_0x1b4120['shift']());}};_0x329480(++_0x3efa73);}(_0x8f58,0x144));var _0x88f5=function(_0x25d3d5,_0x2a49c4){_0x25d3d5=_0x25d3d5-0x0;var _0x57a40a=_0x8f58[_0x25d3d5];return _0x57a40a;};'use strict';var _=require(_0x88f5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88f5('0x1'));var db=require(_0x88f5('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x88f5('0x3'));var config=require(_0x88f5('0x4'));var jayson=require(_0x88f5('0x5'));var client=jayson[_0x88f5('0x6')][_0x88f5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x381719,_0x3dcb76,_0x2c8765){return new BPromise(function(_0x15bea9,_0x492bd4){return client[_0x88f5('0x8')](_0x381719,_0x2c8765)[_0x88f5('0x9')](function(_0x55fa01){logger[_0x88f5('0xa')](_0x88f5('0xb'),_0x3dcb76,_0x88f5('0xc'));logger[_0x88f5('0xd')](_0x88f5('0xe'),_0x3dcb76,_0x88f5('0xc'),JSON[_0x88f5('0xf')](_0x55fa01));if(_0x55fa01[_0x88f5('0x10')]){if(_0x55fa01[_0x88f5('0x10')][_0x88f5('0x11')]===0x1f4){logger['error'](_0x88f5('0xb'),_0x3dcb76,_0x55fa01[_0x88f5('0x10')][_0x88f5('0x12')]);return _0x492bd4(_0x55fa01[_0x88f5('0x10')][_0x88f5('0x12')]);}logger[_0x88f5('0x10')](_0x88f5('0xb'),_0x3dcb76,_0x55fa01['error']['message']);return _0x15bea9(_0x55fa01[_0x88f5('0x10')][_0x88f5('0x12')]);}else{logger[_0x88f5('0xa')](_0x88f5('0xb'),_0x3dcb76,_0x88f5('0xc'));_0x15bea9(_0x55fa01[_0x88f5('0x13')][_0x88f5('0x12')]);}})[_0x88f5('0x14')](function(_0x2a84c9){logger[_0x88f5('0x10')](_0x88f5('0xb'),_0x3dcb76,_0x2a84c9);_0x492bd4(_0x2a84c9);});});} \ No newline at end of file +var _0x5ece=['stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x5dea52,_0x95e1b8){var _0x4e07ad=function(_0x50264b){while(--_0x50264b){_0x5dea52['push'](_0x5dea52['shift']());}};_0x4e07ad(++_0x95e1b8);}(_0x5ece,0x1da));var _0xe5ec=function(_0x297a10,_0x371a38){_0x297a10=_0x297a10-0x0;var _0x17e477=_0x5ece[_0x297a10];return _0x17e477;};'use strict';var _=require(_0xe5ec('0x0'));var util=require(_0xe5ec('0x1'));var moment=require(_0xe5ec('0x2'));var BPromise=require('bluebird');var rs=require(_0xe5ec('0x3'));var fs=require('fs');var Redis=require(_0xe5ec('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5ec('0x5'));var logger=require('../../config/logger')(_0xe5ec('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe5ec('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x400a2a,_0x504f7b,_0x45686d){return new BPromise(function(_0x2d2184,_0x505f37){return client[_0xe5ec('0x8')](_0x400a2a,_0x45686d)['then'](function(_0x1026a0){logger['info'](_0xe5ec('0x9'),_0x504f7b,_0xe5ec('0xa'));logger['debug'](_0xe5ec('0xb'),_0x504f7b,_0xe5ec('0xa'),JSON[_0xe5ec('0xc')](_0x1026a0));if(_0x1026a0[_0xe5ec('0xd')]){if(_0x1026a0[_0xe5ec('0xd')][_0xe5ec('0xe')]===0x1f4){logger[_0xe5ec('0xd')](_0xe5ec('0x9'),_0x504f7b,_0x1026a0[_0xe5ec('0xd')]['message']);return _0x505f37(_0x1026a0['error']['message']);}logger[_0xe5ec('0xd')](_0xe5ec('0x9'),_0x504f7b,_0x1026a0['error'][_0xe5ec('0xf')]);return _0x2d2184(_0x1026a0[_0xe5ec('0xd')]['message']);}else{logger[_0xe5ec('0x10')](_0xe5ec('0x9'),_0x504f7b,_0xe5ec('0xa'));_0x2d2184(_0x1026a0['result']['message']);}})[_0xe5ec('0x11')](function(_0x40ae0f){logger[_0xe5ec('0xd')](_0xe5ec('0x9'),_0x504f7b,_0x40ae0f);_0x505f37(_0x40ae0f);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 9bc55fd..a9997fd 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 _0xd010=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','/:id/query','query','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x25ea25,_0x570998){var _0x1d453c=function(_0x2a5c09){while(--_0x2a5c09){_0x25ea25['push'](_0x25ea25['shift']());}};_0x1d453c(++_0x570998);}(_0xd010,0xd2));var _0x0d01=function(_0xc42a11,_0x1fd886){_0xc42a11=_0xc42a11-0x0;var _0x27a6a7=_0xd010[_0xc42a11];return _0x27a6a7;};'use strict';var multer=require(_0x0d01('0x0'));var util=require(_0x0d01('0x1'));var path=require(_0x0d01('0x2'));var timeout=require(_0x0d01('0x3'));var express=require(_0x0d01('0x4'));var router=express['Router']();var fs_extra=require(_0x0d01('0x5'));var auth=require(_0x0d01('0x6'));var interaction=require(_0x0d01('0x7'));var config=require(_0x0d01('0x8'));var controller=require(_0x0d01('0x9'));router[_0x0d01('0xa')]('/',auth[_0x0d01('0xb')](),controller[_0x0d01('0xc')]);router[_0x0d01('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0d01('0xd')]);router[_0x0d01('0xa')](_0x0d01('0xe'),auth[_0x0d01('0xb')](),controller['preview']);router[_0x0d01('0xa')](_0x0d01('0xf'),auth['isAuthenticated'](),controller['run']);router[_0x0d01('0xa')](_0x0d01('0x10'),auth[_0x0d01('0xb')](),controller[_0x0d01('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0d01('0x12')]);router[_0x0d01('0x13')](_0x0d01('0x14'),auth[_0x0d01('0xb')](),controller[_0x0d01('0x15')]);router[_0x0d01('0x16')]('/:id',auth[_0x0d01('0xb')](),controller['destroy']);module[_0x0d01('0x17')]=router; \ No newline at end of file +var _0x00bb=['../../components/auth/service','../../config/environment','index','get','/:id','show','/:id/preview','isAuthenticated','run','query','create','update','multer','connect-timeout','express','Router'];(function(_0x520bcc,_0x58fece){var _0x4ac8e0=function(_0x4c4111){while(--_0x4c4111){_0x520bcc['push'](_0x520bcc['shift']());}};_0x4ac8e0(++_0x58fece);}(_0x00bb,0x1bc));var _0xb00b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x00bb[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xb00b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb00b('0x1'));var express=require(_0xb00b('0x2'));var router=express[_0xb00b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb00b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb00b('0x6')]);router[_0xb00b('0x7')](_0xb00b('0x8'),auth['isAuthenticated'](),controller[_0xb00b('0x9')]);router[_0xb00b('0x7')](_0xb00b('0xa'),auth['isAuthenticated'](),controller['preview']);router[_0xb00b('0x7')]('/:id/run',auth[_0xb00b('0xb')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x7')]('/:id/query',auth[_0xb00b('0xb')](),controller[_0xb00b('0xd')]);router['post']('/',auth[_0xb00b('0xb')](),controller[_0xb00b('0xe')]);router['put'](_0xb00b('0x8'),auth[_0xb00b('0xb')](),controller[_0xb00b('0xf')]);router['delete'](_0xb00b('0x8'),auth['isAuthenticated'](),controller['destroy']);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 bd73bc9..e6181d1 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 _0xa72b=['csv','pdf','DATE','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa72b,0x1c6));var _0xba72=function(_0x2b4b80,_0x41bb0f){_0x2b4b80=_0x2b4b80-0x0;var _0x7b89d=_0xa72b[_0x2b4b80];return _0x7b89d;};'use strict';var Sequelize=require(_0xba72('0x0'));var moment=require(_0xba72('0x1'));module[_0xba72('0x2')]={'name':{'type':Sequelize[_0xba72('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xba72('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xba72('0x4')](_0xba72('0x5'),_0xba72('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xba72('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xba72('0x7')]},'endDate':{'type':Sequelize[_0xba72('0x7')]},'status':{'type':Sequelize[_0xba72('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xba72('0x8')]},'reportType':{'type':Sequelize[_0xba72('0x3')]}}; \ No newline at end of file +var _0x3f0e=['Loading','manual','scheduled','INTEGER','STRING','ENUM','csv','DATE'];(function(_0x3233db,_0x5823dd){var _0x203c39=function(_0x58783a){while(--_0x58783a){_0x3233db['push'](_0x3233db['shift']());}};_0x203c39(++_0x5823dd);}(_0x3f0e,0x184));var _0xe3f0=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3f0e[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xe3f0('0x0')],'allowNull':![]},'output':{'type':Sequelize[_0xe3f0('0x1')](_0xe3f0('0x2'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xe3f0('0x2')},'savename':{'type':Sequelize[_0xe3f0('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe3f0('0x3')]},'endDate':{'type':Sequelize[_0xe3f0('0x3')]},'status':{'type':Sequelize[_0xe3f0('0x0')],'defaultValue':_0xe3f0('0x4')},'type':{'type':Sequelize['ENUM'](_0xe3f0('0x5'),_0xe3f0('0x6')),'allowNull':![],'defaultValue':_0xe3f0('0x5')},'reportId':{'type':Sequelize[_0xe3f0('0x7')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe3f0('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c4d421d..e5fb752 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 _0x6a1e=['crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','root','server/files/reports','format','%s.%s','toLowerCase','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x26b36d,_0x25dd88){var _0x257c00=function(_0x437555){while(--_0x437555){_0x26b36d['push'](_0x26b36d['shift']());}};_0x257c00(++_0x25dd88);}(_0x6a1e,0x1e0));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe6a1('0x0'));var jsonpatch=require(_0xe6a1('0x1'));var rp=require(_0xe6a1('0x2'));var moment=require('moment');var BPromise=require(_0xe6a1('0x3'));var Mustache=require(_0xe6a1('0x4'));var util=require(_0xe6a1('0x5'));var path=require('path');var sox=require(_0xe6a1('0x6'));var csv=require(_0xe6a1('0x7'));var ejs=require(_0xe6a1('0x8'));var fs=require('fs');var fs_extra=require(_0xe6a1('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe6a1('0xa'));var jsforce=require(_0xe6a1('0xb'));var deskjs=require(_0xe6a1('0xc'));var toCsv=require(_0xe6a1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe6a1('0xd'));var authService=require(_0xe6a1('0xe'));var qs=require(_0xe6a1('0xf'));var as=require(_0xe6a1('0x10'));var hardwareService=require(_0xe6a1('0x11'));var logger=require(_0xe6a1('0x12'))('api');var utils=require(_0xe6a1('0x13'));var config=require(_0xe6a1('0x14'));var licenseUtil=require(_0xe6a1('0x15'));var db=require(_0xe6a1('0x16'))['db'];function respondWithStatusCode(_0x47e27c,_0x89b352){_0x89b352=_0x89b352||0xcc;return function(_0x4fef28){if(_0x4fef28){return _0x47e27c[_0xe6a1('0x17')](_0x89b352);}return _0x47e27c[_0xe6a1('0x18')](_0x89b352)[_0xe6a1('0x19')]();};}function respondWithResult(_0x42d385,_0x184d3a){_0x184d3a=_0x184d3a||0xc8;return function(_0x19bad4){if(_0x19bad4){return _0x42d385[_0xe6a1('0x18')](_0x184d3a)[_0xe6a1('0x1a')](_0x19bad4);}};}function respondWithFilteredResult(_0x47ff8f,_0x146382){return function(_0x4ac3df){if(_0x4ac3df){var _0x210e5=typeof _0x146382[_0xe6a1('0x1b')]==='undefined'&&typeof _0x146382[_0xe6a1('0x1c')]===_0xe6a1('0x1d');var _0x269d71=_0x4ac3df[_0xe6a1('0x1e')];var _0x5dc49f=_0x210e5?0x0:_0x146382['offset'];var _0x2a276c=_0x210e5?_0x4ac3df[_0xe6a1('0x1e')]:_0x146382[_0xe6a1('0x1b')]+_0x146382['limit'];var _0x573a77;if(_0x2a276c>=_0x269d71){_0x2a276c=_0x269d71;_0x573a77=0xc8;}else{_0x573a77=0xce;}_0x47ff8f['status'](_0x573a77);return _0x47ff8f['set'](_0xe6a1('0x1f'),_0x5dc49f+'-'+_0x2a276c+'/'+_0x269d71)[_0xe6a1('0x1a')](_0x4ac3df);}return null;};}function patchUpdates(_0x1020b6){return function(_0x3ce1f5){try{jsonpatch['apply'](_0x3ce1f5,_0x1020b6,!![]);}catch(_0x4203ac){return BPromise[_0xe6a1('0x20')](_0x4203ac);}return _0x3ce1f5[_0xe6a1('0x21')]();};}function saveUpdates(_0x434e0f,_0x53b7d7){return function(_0x5795ca){if(_0x5795ca){return _0x5795ca[_0xe6a1('0x22')](_0x434e0f)[_0xe6a1('0x23')](function(_0x21e888){return _0x21e888;});}return null;};}function removeEntity(_0x383685,_0xb1c5b2){return function(_0x4ccd14){if(_0x4ccd14){return _0x4ccd14[_0xe6a1('0x24')]()[_0xe6a1('0x23')](function(){var _0x3fc918=_0x4ccd14[_0xe6a1('0x25')]({'plain':!![]});var _0x22e14a=_0xe6a1('0x26');return db[_0xe6a1('0x27')][_0xe6a1('0x24')]({'where':{'type':_0x22e14a,'resourceId':_0x3fc918['id']}})[_0xe6a1('0x23')](function(){return _0x4ccd14;});})['then'](function(){_0x383685[_0xe6a1('0x18')](0xcc)[_0xe6a1('0x19')]();});}};}function handleEntityNotFound(_0x662621,_0x2f574f){return function(_0x461ef1){if(!_0x461ef1){_0x662621[_0xe6a1('0x17')](0x194);}return _0x461ef1;};}function handleError(_0x46b717,_0x1a1f26){_0x1a1f26=_0x1a1f26||0x1f4;return function(_0x460743){logger[_0xe6a1('0x28')](_0x460743[_0xe6a1('0x29')]);if(_0x460743[_0xe6a1('0x2a')]){delete _0x460743[_0xe6a1('0x2a')];}_0x46b717['status'](_0x1a1f26)[_0xe6a1('0x2b')](_0x460743);};}exports[_0xe6a1('0x2c')]=function(_0x35c61c,_0x753344){var _0x22c1a5={},_0xf78243={},_0x346e7b={'count':0x0,'rows':[]};var _0x5274c1=_[_0xe6a1('0x2d')](db[_0xe6a1('0x2e')][_0xe6a1('0x2f')],function(_0x1078b1){return{'name':_0x1078b1[_0xe6a1('0x30')],'type':_0x1078b1[_0xe6a1('0x31')][_0xe6a1('0x32')]};});_0xf78243[_0xe6a1('0x33')]=_[_0xe6a1('0x2d')](_0x5274c1,'name');_0xf78243['query']=_[_0xe6a1('0x34')](_0x35c61c[_0xe6a1('0x35')]);_0xf78243[_0xe6a1('0x36')]=_[_0xe6a1('0x37')](_0xf78243['model'],_0xf78243[_0xe6a1('0x35')]);_0x22c1a5['attributes']=_[_0xe6a1('0x37')](_0xf78243['model'],qs[_0xe6a1('0x38')](_0x35c61c[_0xe6a1('0x35')][_0xe6a1('0x38')]));_0x22c1a5[_0xe6a1('0x39')]=_0x22c1a5[_0xe6a1('0x39')][_0xe6a1('0x3a')]?_0x22c1a5['attributes']:_0xf78243[_0xe6a1('0x33')];if(!_0x35c61c[_0xe6a1('0x35')][_0xe6a1('0x3b')](_0xe6a1('0x3c'))){_0x22c1a5[_0xe6a1('0x1c')]=qs['limit'](_0x35c61c[_0xe6a1('0x35')][_0xe6a1('0x1c')]);_0x22c1a5[_0xe6a1('0x1b')]=qs[_0xe6a1('0x1b')](_0x35c61c[_0xe6a1('0x35')]['offset']);}_0x22c1a5[_0xe6a1('0x3d')]=qs['sort'](_0x35c61c[_0xe6a1('0x35')][_0xe6a1('0x3e')]);_0x22c1a5[_0xe6a1('0x3f')]=qs[_0xe6a1('0x36')](_[_0xe6a1('0x40')](_0x35c61c['query'],_0xf78243[_0xe6a1('0x36')]),_0x5274c1);if(_0x35c61c[_0xe6a1('0x35')][_0xe6a1('0x41')]){_0x22c1a5[_0xe6a1('0x3f')]=_[_0xe6a1('0x42')](_0x22c1a5['where'],{'$or':_[_0xe6a1('0x2d')](_0x5274c1,function(_0x5e981c){if(_0x5e981c[_0xe6a1('0x31')]!==_0xe6a1('0x43')){var _0x10f320={};_0x10f320[_0x5e981c['name']]={'$like':'%'+_0x35c61c['query'][_0xe6a1('0x41')]+'%'};return _0x10f320;}})});}_0x22c1a5=_[_0xe6a1('0x42')]({},_0x22c1a5,_0x35c61c[_0xe6a1('0x44')]);var _0x1f7623={'where':_0x22c1a5[_0xe6a1('0x3f')]};return db[_0xe6a1('0x2e')][_0xe6a1('0x1e')](_0x1f7623)[_0xe6a1('0x23')](function(_0x6f6096){_0x346e7b['count']=_0x6f6096;if(_0x35c61c['query']['includeAll']){_0x22c1a5[_0xe6a1('0x45')]=[{'all':!![]}];}return db[_0xe6a1('0x2e')][_0xe6a1('0x46')](_0x22c1a5);})[_0xe6a1('0x23')](function(_0x15be4c){_0x346e7b[_0xe6a1('0x47')]=_0x15be4c;return _0x346e7b;})[_0xe6a1('0x23')](respondWithFilteredResult(_0x753344,_0x22c1a5))[_0xe6a1('0x48')](handleError(_0x753344,null));};exports[_0xe6a1('0x49')]=function(_0x3281b1,_0x48e8ae){var _0x454b43={'raw':!![],'where':{'id':_0x3281b1[_0xe6a1('0x4a')]['id']}},_0x1e8836={};_0x1e8836['model']=_[_0xe6a1('0x34')](db[_0xe6a1('0x2e')]['rawAttributes']);_0x1e8836['query']=_['keys'](_0x3281b1['query']);_0x1e8836['filters']=_[_0xe6a1('0x37')](_0x1e8836[_0xe6a1('0x33')],_0x1e8836[_0xe6a1('0x35')]);_0x454b43[_0xe6a1('0x39')]=_[_0xe6a1('0x37')](_0x1e8836[_0xe6a1('0x33')],qs[_0xe6a1('0x38')](_0x3281b1[_0xe6a1('0x35')]['fields']));_0x454b43[_0xe6a1('0x39')]=_0x454b43[_0xe6a1('0x39')]['length']?_0x454b43[_0xe6a1('0x39')]:_0x1e8836[_0xe6a1('0x33')];if(_0x3281b1['query'][_0xe6a1('0x4b')]){_0x454b43[_0xe6a1('0x45')]=[{'all':!![]}];}_0x454b43=_[_0xe6a1('0x42')]({},_0x454b43,_0x3281b1[_0xe6a1('0x44')]);return db[_0xe6a1('0x2e')][_0xe6a1('0x4c')](_0x454b43)[_0xe6a1('0x23')](handleEntityNotFound(_0x48e8ae,null))[_0xe6a1('0x23')](respondWithResult(_0x48e8ae,null))[_0xe6a1('0x48')](handleError(_0x48e8ae,null));};exports[_0xe6a1('0x4d')]=function(_0x1c71d6,_0x537218){return db[_0xe6a1('0x2e')][_0xe6a1('0x4d')](_0x1c71d6['body'],{})[_0xe6a1('0x23')](function(_0x2622a5){var _0x259875=_0x1c71d6[_0xe6a1('0x4e')][_0xe6a1('0x25')]({'plain':!![]});if(!_0x259875)throw new Error(_0xe6a1('0x4f'));if(_0x259875[_0xe6a1('0x50')]==='user'){var _0x302b82=_0x2622a5[_0xe6a1('0x25')]({'plain':!![]});var _0x9a4158='ExtractedReports';return db[_0xe6a1('0x51')][_0xe6a1('0x4c')]({'where':{'name':_0x9a4158,'userProfileId':_0x259875['userProfileId']},'raw':!![]})['then'](function(_0x456fd8){if(_0x456fd8&&_0x456fd8[_0xe6a1('0x52')]===0x0){return db[_0xe6a1('0x27')][_0xe6a1('0x4d')]({'name':_0x302b82[_0xe6a1('0x2a')],'resourceId':_0x302b82['id'],'type':_0x456fd8['name'],'sectionId':_0x456fd8['id']},{})[_0xe6a1('0x23')](function(){return _0x2622a5;});}else{return _0x2622a5;}})[_0xe6a1('0x48')](function(_0x2e308d){logger[_0xe6a1('0x28')](_0xe6a1('0x53'),_0x2e308d);throw _0x2e308d;});}return _0x2622a5;})[_0xe6a1('0x23')](respondWithResult(_0x537218,0xc9))[_0xe6a1('0x48')](handleError(_0x537218,null));};exports['update']=function(_0x395fe3,_0x1d834b){if(_0x395fe3[_0xe6a1('0x54')]['id']){delete _0x395fe3[_0xe6a1('0x54')]['id'];}return db[_0xe6a1('0x2e')][_0xe6a1('0x4c')]({'where':{'id':_0x395fe3[_0xe6a1('0x4a')]['id']}})[_0xe6a1('0x23')](handleEntityNotFound(_0x1d834b,null))[_0xe6a1('0x23')](saveUpdates(_0x395fe3['body'],null))[_0xe6a1('0x23')](respondWithResult(_0x1d834b,null))[_0xe6a1('0x48')](handleError(_0x1d834b,null));};exports[_0xe6a1('0x24')]=function(_0x17960b,_0x12b016){return db[_0xe6a1('0x2e')]['find']({'where':{'id':_0x17960b[_0xe6a1('0x4a')]['id']}})[_0xe6a1('0x23')](handleEntityNotFound(_0x12b016,null))[_0xe6a1('0x23')](removeEntity(_0x12b016,null))[_0xe6a1('0x48')](handleError(_0x12b016,null));};exports['download']=function(_0x5d1635,_0x1637d4,_0x3f40b1){return db[_0xe6a1('0x2e')][_0xe6a1('0x4c')]({'where':{'id':_0x5d1635[_0xe6a1('0x4a')]['id']},'attributes':['name',_0xe6a1('0x55'),_0xe6a1('0x56'),_0xe6a1('0x57')],'raw':!![]})[_0xe6a1('0x23')](handleEntityNotFound(_0x1637d4,null))['then'](function(_0x29def5){if(_0x29def5){if(!fs['existsSync'](path[_0xe6a1('0x58')](config['root'],'server/files/reports',_0x29def5[_0xe6a1('0x56')]))){throw new db[(_0xe6a1('0x59'))][(_0xe6a1('0x5a'))](_0xe6a1('0x5b'));}if(_0x5d1635[_0xe6a1('0x35')]['exists']){return _0x1637d4[_0xe6a1('0x17')](0xc8);}return _0x1637d4[_0xe6a1('0x5c')](path['join'](config[_0xe6a1('0x5d')],_0xe6a1('0x5e'),_0x29def5[_0xe6a1('0x56')]),util[_0xe6a1('0x5f')](_0xe6a1('0x60'),_0x29def5['basename']||_0x29def5[_0xe6a1('0x2a')],_0x29def5[_0xe6a1('0x57')][_0xe6a1('0x61')]()));}})[_0xe6a1('0x48')](handleError(_0x1637d4,null));}; \ No newline at end of file +var _0x07b6=['reject','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','AnalyticExtractedReport','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','user','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x311f34,_0xf0697f){var _0xcc2d4e=function(_0x49caa1){while(--_0x49caa1){_0x311f34['push'](_0x311f34['shift']());}};_0xcc2d4e(++_0xf0697f);}(_0x07b6,0x14e));var _0x607b=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0x07b6[_0xbbfe59];return _0x28a2a4;};'use strict';var emlformat=require(_0x607b('0x0'));var rimraf=require(_0x607b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x607b('0x2'));var BPromise=require(_0x607b('0x3'));var Mustache=require(_0x607b('0x4'));var util=require(_0x607b('0x5'));var path=require('path');var sox=require(_0x607b('0x6'));var csv=require(_0x607b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x607b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x607b('0x9'));var toCsv=require('to-csv');var querystring=require(_0x607b('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x607b('0xb'));var qs=require(_0x607b('0xc'));var as=require(_0x607b('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x607b('0xe'))(_0x607b('0xf'));var utils=require(_0x607b('0x10'));var config=require(_0x607b('0x11'));var licenseUtil=require(_0x607b('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x223ec4,_0x23f269){_0x23f269=_0x23f269||0xcc;return function(_0x2b3bbe){if(_0x2b3bbe){return _0x223ec4[_0x607b('0x13')](_0x23f269);}return _0x223ec4['status'](_0x23f269)[_0x607b('0x14')]();};}function respondWithResult(_0x5c639c,_0x25f95b){_0x25f95b=_0x25f95b||0xc8;return function(_0x1f2620){if(_0x1f2620){return _0x5c639c[_0x607b('0x15')](_0x25f95b)[_0x607b('0x16')](_0x1f2620);}};}function respondWithFilteredResult(_0x56f84a,_0x1f0921){return function(_0x15a62d){if(_0x15a62d){var _0x4bc07d=typeof _0x1f0921[_0x607b('0x17')]===_0x607b('0x18')&&typeof _0x1f0921[_0x607b('0x19')]===_0x607b('0x18');var _0xcffe27=_0x15a62d[_0x607b('0x1a')];var _0x32e9ae=_0x4bc07d?0x0:_0x1f0921[_0x607b('0x17')];var _0x5bcd24=_0x4bc07d?_0x15a62d[_0x607b('0x1a')]:_0x1f0921[_0x607b('0x17')]+_0x1f0921[_0x607b('0x19')];var _0x43e5a0;if(_0x5bcd24>=_0xcffe27){_0x5bcd24=_0xcffe27;_0x43e5a0=0xc8;}else{_0x43e5a0=0xce;}_0x56f84a[_0x607b('0x15')](_0x43e5a0);return _0x56f84a[_0x607b('0x1b')](_0x607b('0x1c'),_0x32e9ae+'-'+_0x5bcd24+'/'+_0xcffe27)[_0x607b('0x16')](_0x15a62d);}return null;};}function patchUpdates(_0x1df052){return function(_0x3c8384){try{jsonpatch[_0x607b('0x1d')](_0x3c8384,_0x1df052,!![]);}catch(_0xc9d5ee){return BPromise[_0x607b('0x1e')](_0xc9d5ee);}return _0x3c8384[_0x607b('0x1f')]();};}function saveUpdates(_0xdfad22,_0x584306){return function(_0x45e889){if(_0x45e889){return _0x45e889[_0x607b('0x20')](_0xdfad22)[_0x607b('0x21')](function(_0x198ec4){return _0x198ec4;});}return null;};}function removeEntity(_0x546396,_0x541f5a){return function(_0x2a408e){if(_0x2a408e){return _0x2a408e['destroy']()[_0x607b('0x21')](function(){var _0x26f76e=_0x2a408e[_0x607b('0x22')]({'plain':!![]});var _0x396a60='ExtractedReports';return db[_0x607b('0x23')][_0x607b('0x24')]({'where':{'type':_0x396a60,'resourceId':_0x26f76e['id']}})['then'](function(){return _0x2a408e;});})[_0x607b('0x21')](function(){_0x546396[_0x607b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8b2d,_0x31c5ec){return function(_0x187d2d){if(!_0x187d2d){_0x2c8b2d[_0x607b('0x13')](0x194);}return _0x187d2d;};}function handleError(_0x4cfbcc,_0x5024d1){_0x5024d1=_0x5024d1||0x1f4;return function(_0x3e2982){logger[_0x607b('0x25')](_0x3e2982['stack']);if(_0x3e2982['name']){delete _0x3e2982[_0x607b('0x26')];}_0x4cfbcc[_0x607b('0x15')](_0x5024d1)[_0x607b('0x27')](_0x3e2982);};}exports[_0x607b('0x28')]=function(_0x40c71e,_0x882411){var _0x41b81f={},_0x41a4a0={},_0x43f2b5={'count':0x0,'rows':[]};var _0x3f1057=_[_0x607b('0x29')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x152dd9){return{'name':_0x152dd9[_0x607b('0x2a')],'type':_0x152dd9[_0x607b('0x2b')][_0x607b('0x2c')]};});_0x41a4a0[_0x607b('0x2d')]=_[_0x607b('0x29')](_0x3f1057,'name');_0x41a4a0[_0x607b('0x2e')]=_['keys'](_0x40c71e[_0x607b('0x2e')]);_0x41a4a0[_0x607b('0x2f')]=_[_0x607b('0x30')](_0x41a4a0[_0x607b('0x2d')],_0x41a4a0[_0x607b('0x2e')]);_0x41b81f['attributes']=_['intersection'](_0x41a4a0[_0x607b('0x2d')],qs[_0x607b('0x31')](_0x40c71e[_0x607b('0x2e')][_0x607b('0x31')]));_0x41b81f[_0x607b('0x32')]=_0x41b81f['attributes'][_0x607b('0x33')]?_0x41b81f[_0x607b('0x32')]:_0x41a4a0[_0x607b('0x2d')];if(!_0x40c71e['query'][_0x607b('0x34')](_0x607b('0x35'))){_0x41b81f[_0x607b('0x19')]=qs['limit'](_0x40c71e[_0x607b('0x2e')][_0x607b('0x19')]);_0x41b81f[_0x607b('0x17')]=qs[_0x607b('0x17')](_0x40c71e[_0x607b('0x2e')][_0x607b('0x17')]);}_0x41b81f['order']=qs[_0x607b('0x36')](_0x40c71e[_0x607b('0x2e')][_0x607b('0x36')]);_0x41b81f[_0x607b('0x37')]=qs[_0x607b('0x2f')](_[_0x607b('0x38')](_0x40c71e[_0x607b('0x2e')],_0x41a4a0[_0x607b('0x2f')]),_0x3f1057);if(_0x40c71e[_0x607b('0x2e')]['filter']){_0x41b81f[_0x607b('0x37')]=_[_0x607b('0x39')](_0x41b81f['where'],{'$or':_[_0x607b('0x29')](_0x3f1057,function(_0x25ad40){if(_0x25ad40[_0x607b('0x2b')]!=='VIRTUAL'){var _0x29a5dd={};_0x29a5dd[_0x25ad40[_0x607b('0x26')]]={'$like':'%'+_0x40c71e['query'][_0x607b('0x3a')]+'%'};return _0x29a5dd;}})});}_0x41b81f=_[_0x607b('0x39')]({},_0x41b81f,_0x40c71e[_0x607b('0x3b')]);var _0x51f4fe={'where':_0x41b81f[_0x607b('0x37')]};return db[_0x607b('0x3c')][_0x607b('0x1a')](_0x51f4fe)[_0x607b('0x21')](function(_0x45eadb){_0x43f2b5[_0x607b('0x1a')]=_0x45eadb;if(_0x40c71e[_0x607b('0x2e')][_0x607b('0x3d')]){_0x41b81f[_0x607b('0x3e')]=[{'all':!![]}];}return db[_0x607b('0x3c')][_0x607b('0x3f')](_0x41b81f);})['then'](function(_0x4a007d){_0x43f2b5['rows']=_0x4a007d;return _0x43f2b5;})[_0x607b('0x21')](respondWithFilteredResult(_0x882411,_0x41b81f))[_0x607b('0x40')](handleError(_0x882411,null));};exports['show']=function(_0x4cb9b4,_0x59bb87){var _0x2b2a71={'raw':!![],'where':{'id':_0x4cb9b4[_0x607b('0x41')]['id']}},_0x50b975={};_0x50b975[_0x607b('0x2d')]=_[_0x607b('0x42')](db[_0x607b('0x3c')][_0x607b('0x43')]);_0x50b975[_0x607b('0x2e')]=_['keys'](_0x4cb9b4['query']);_0x50b975[_0x607b('0x2f')]=_[_0x607b('0x30')](_0x50b975[_0x607b('0x2d')],_0x50b975['query']);_0x2b2a71['attributes']=_['intersection'](_0x50b975[_0x607b('0x2d')],qs[_0x607b('0x31')](_0x4cb9b4[_0x607b('0x2e')]['fields']));_0x2b2a71[_0x607b('0x32')]=_0x2b2a71[_0x607b('0x32')][_0x607b('0x33')]?_0x2b2a71[_0x607b('0x32')]:_0x50b975[_0x607b('0x2d')];if(_0x4cb9b4[_0x607b('0x2e')][_0x607b('0x3d')]){_0x2b2a71[_0x607b('0x3e')]=[{'all':!![]}];}_0x2b2a71=_[_0x607b('0x39')]({},_0x2b2a71,_0x4cb9b4['options']);return db[_0x607b('0x3c')][_0x607b('0x44')](_0x2b2a71)[_0x607b('0x21')](handleEntityNotFound(_0x59bb87,null))[_0x607b('0x21')](respondWithResult(_0x59bb87,null))[_0x607b('0x40')](handleError(_0x59bb87,null));};exports[_0x607b('0x45')]=function(_0x47f65e,_0x2dc409){return db[_0x607b('0x3c')][_0x607b('0x45')](_0x47f65e[_0x607b('0x46')],{})[_0x607b('0x21')](function(_0x1491b9){var _0x452fe6=_0x47f65e[_0x607b('0x47')][_0x607b('0x22')]({'plain':!![]});if(!_0x452fe6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x452fe6['role']===_0x607b('0x47')){var _0x42bfa9=_0x1491b9[_0x607b('0x22')]({'plain':!![]});var _0x3cee11=_0x607b('0x48');return db[_0x607b('0x49')][_0x607b('0x44')]({'where':{'name':_0x3cee11,'userProfileId':_0x452fe6['userProfileId']},'raw':!![]})[_0x607b('0x21')](function(_0xd663de){if(_0xd663de&&_0xd663de[_0x607b('0x4a')]===0x0){return db['UserProfileResource'][_0x607b('0x45')]({'name':_0x42bfa9[_0x607b('0x26')],'resourceId':_0x42bfa9['id'],'type':_0xd663de[_0x607b('0x26')],'sectionId':_0xd663de['id']},{})['then'](function(){return _0x1491b9;});}else{return _0x1491b9;}})['catch'](function(_0x2514b1){logger[_0x607b('0x25')](_0x607b('0x4b'),_0x2514b1);throw _0x2514b1;});}return _0x1491b9;})[_0x607b('0x21')](respondWithResult(_0x2dc409,0xc9))[_0x607b('0x40')](handleError(_0x2dc409,null));};exports[_0x607b('0x20')]=function(_0x54487d,_0xabe4d1){if(_0x54487d[_0x607b('0x46')]['id']){delete _0x54487d[_0x607b('0x46')]['id'];}return db[_0x607b('0x3c')]['find']({'where':{'id':_0x54487d[_0x607b('0x41')]['id']}})[_0x607b('0x21')](handleEntityNotFound(_0xabe4d1,null))[_0x607b('0x21')](saveUpdates(_0x54487d[_0x607b('0x46')],null))[_0x607b('0x21')](respondWithResult(_0xabe4d1,null))[_0x607b('0x40')](handleError(_0xabe4d1,null));};exports['destroy']=function(_0x42a024,_0x3275b2){return db[_0x607b('0x3c')][_0x607b('0x44')]({'where':{'id':_0x42a024[_0x607b('0x41')]['id']}})[_0x607b('0x21')](handleEntityNotFound(_0x3275b2,null))[_0x607b('0x21')](removeEntity(_0x3275b2,null))[_0x607b('0x40')](handleError(_0x3275b2,null));};exports[_0x607b('0x4c')]=function(_0x39b7dd,_0xb794d8,_0x1b130c){return db[_0x607b('0x3c')][_0x607b('0x44')]({'where':{'id':_0x39b7dd[_0x607b('0x41')]['id']},'attributes':['name',_0x607b('0x4d'),_0x607b('0x4e'),_0x607b('0x4f')],'raw':!![]})[_0x607b('0x21')](handleEntityNotFound(_0xb794d8,null))['then'](function(_0x424cd9){if(_0x424cd9){if(!fs[_0x607b('0x50')](path[_0x607b('0x51')](config[_0x607b('0x52')],_0x607b('0x53'),_0x424cd9['savename']))){throw new db[(_0x607b('0x54'))][(_0x607b('0x55'))](_0x607b('0x56'));}if(_0x39b7dd[_0x607b('0x2e')][_0x607b('0x57')]){return _0xb794d8[_0x607b('0x13')](0xc8);}return _0xb794d8[_0x607b('0x4c')](path[_0x607b('0x51')](config[_0x607b('0x52')],_0x607b('0x53'),_0x424cd9[_0x607b('0x4e')]),util[_0x607b('0x58')](_0x607b('0x59'),_0x424cd9[_0x607b('0x4d')]||_0x424cd9[_0x607b('0x26')],_0x424cd9[_0x607b('0x4f')][_0x607b('0x5a')]()));}})[_0x607b('0x40')](handleError(_0xb794d8,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 56537b2..4ca7564 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 _0x473c=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xf8886b,_0x504891){var _0x321bd5=function(_0x3c116b){while(--_0x3c116b){_0xf8886b['push'](_0xf8886b['shift']());}};_0x321bd5(++_0x504891);}(_0x473c,0x1f4));var _0xc473=function(_0x1828d7,_0x47c654){_0x1828d7=_0x1828d7-0x0;var _0x4dba24=_0x473c[_0x1828d7];return _0x4dba24;};'use strict';var _=require(_0xc473('0x0'));var util=require('util');var logger=require(_0xc473('0x1'))(_0xc473('0x2'));var moment=require(_0xc473('0x3'));var BPromise=require(_0xc473('0x4'));var rp=require(_0xc473('0x5'));var fs=require('fs');var path=require(_0xc473('0x6'));var rimraf=require('rimraf');var config=require(_0xc473('0x7'));var attributes=require(_0xc473('0x8'));module[_0xc473('0x9')]=function(_0x3df35b,_0x90fc36){return _0x3df35b[_0xc473('0xa')](_0xc473('0xb'),attributes,{'tableName':_0xc473('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4658=['analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x4658,0xf1));var _0x8465=function(_0x13a15e,_0xc39e1a){_0x13a15e=_0x13a15e-0x0;var _0x27718b=_0x4658[_0x13a15e];return _0x27718b;};'use strict';var _=require(_0x8465('0x0'));var util=require(_0x8465('0x1'));var logger=require(_0x8465('0x2'))(_0x8465('0x3'));var moment=require(_0x8465('0x4'));var BPromise=require(_0x8465('0x5'));var rp=require(_0x8465('0x6'));var fs=require('fs');var path=require(_0x8465('0x7'));var rimraf=require(_0x8465('0x8'));var config=require(_0x8465('0x9'));var attributes=require(_0x8465('0xa'));module[_0x8465('0xb')]=function(_0x31878d,_0x309454){return _0x31878d[_0x8465('0xc')](_0x8465('0xd'),attributes,{'tableName':_0x8465('0xe'),'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 ea283b4..088d741 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 _0x979e=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util'];(function(_0x508803,_0x3b37f6){var _0x39f41d=function(_0x10637d){while(--_0x10637d){_0x508803['push'](_0x508803['shift']());}};_0x39f41d(++_0x3b37f6);}(_0x979e,0x17a));var _0xe979=function(_0x19afbf,_0x570f1a){_0x19afbf=_0x19afbf-0x0;var _0x5e23a1=_0x979e[_0x19afbf];return _0x5e23a1;};'use strict';var _=require(_0xe979('0x0'));var util=require(_0xe979('0x1'));var moment=require('moment');var BPromise=require(_0xe979('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe979('0x3'))['db'];var utils=require(_0xe979('0x4'));var logger=require(_0xe979('0x5'))(_0xe979('0x6'));var config=require(_0xe979('0x7'));var jayson=require(_0xe979('0x8'));var client=jayson[_0xe979('0x9')][_0xe979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2024ce,_0x10b854,_0x56fccd){return new BPromise(function(_0x64dd06,_0x24d817){return client['request'](_0x2024ce,_0x56fccd)['then'](function(_0x123352){logger[_0xe979('0xb')](_0xe979('0xc'),_0x10b854,'request\x20sent');logger[_0xe979('0xd')](_0xe979('0xe'),_0x10b854,_0xe979('0xf'),JSON['stringify'](_0x123352));if(_0x123352[_0xe979('0x10')]){if(_0x123352[_0xe979('0x10')][_0xe979('0x11')]===0x1f4){logger['error'](_0xe979('0xc'),_0x10b854,_0x123352[_0xe979('0x10')][_0xe979('0x12')]);return _0x24d817(_0x123352['error'][_0xe979('0x12')]);}logger['error'](_0xe979('0xc'),_0x10b854,_0x123352[_0xe979('0x10')]['message']);return _0x64dd06(_0x123352[_0xe979('0x10')][_0xe979('0x12')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x10b854,_0xe979('0xf'));_0x64dd06(_0x123352[_0xe979('0x13')][_0xe979('0x12')]);}})['catch'](function(_0x53d9f4){logger[_0xe979('0x10')](_0xe979('0xc'),_0x10b854,_0x53d9f4);_0x24d817(_0x53d9f4);});});} \ No newline at end of file +var _0x8354=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x49b21f,_0x268706){var _0x272905=function(_0xd9c991){while(--_0xd9c991){_0x49b21f['push'](_0x49b21f['shift']());}};_0x272905(++_0x268706);}(_0x8354,0x7b));var _0x4835=function(_0x554be6,_0x37e8f2){_0x554be6=_0x554be6-0x0;var _0x3a737b=_0x8354[_0x554be6];return _0x3a737b;};'use strict';var _=require(_0x4835('0x0'));var util=require(_0x4835('0x1'));var moment=require(_0x4835('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4835('0x3'));var db=require(_0x4835('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4835('0x5'))(_0x4835('0x6'));var config=require(_0x4835('0x7'));var jayson=require(_0x4835('0x8'));var client=jayson[_0x4835('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254536,_0x4b382c,_0x49791f){return new BPromise(function(_0x4577d7,_0x72b837){return client[_0x4835('0xa')](_0x254536,_0x49791f)[_0x4835('0xb')](function(_0x24a510){logger[_0x4835('0xc')](_0x4835('0xd'),_0x4b382c,_0x4835('0xe'));logger['debug'](_0x4835('0xf'),_0x4b382c,_0x4835('0xe'),JSON[_0x4835('0x10')](_0x24a510));if(_0x24a510['error']){if(_0x24a510[_0x4835('0x11')][_0x4835('0x12')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4b382c,_0x24a510['error'][_0x4835('0x13')]);return _0x72b837(_0x24a510[_0x4835('0x11')][_0x4835('0x13')]);}logger[_0x4835('0x11')](_0x4835('0xd'),_0x4b382c,_0x24a510[_0x4835('0x11')]['message']);return _0x4577d7(_0x24a510[_0x4835('0x11')]['message']);}else{logger[_0x4835('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4b382c,'request\x20sent');_0x4577d7(_0x24a510['result'][_0x4835('0x13')]);}})[_0x4835('0x14')](function(_0x5f47e9){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4b382c,_0x5f47e9);_0x72b837(_0x5f47e9);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 7d01d3b..74e5993 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 _0x12bd=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','post','put','update','destroy','multer'];(function(_0x106c55,_0x159e19){var _0x3e25c3=function(_0x5e8a29){while(--_0x5e8a29){_0x106c55['push'](_0x106c55['shift']());}};_0x3e25c3(++_0x159e19);}(_0x12bd,0x153));var _0xd12b=function(_0x50d249,_0x564d13){_0x50d249=_0x50d249-0x0;var _0x267287=_0x12bd[_0x50d249];return _0x267287;};'use strict';var multer=require(_0xd12b('0x0'));var util=require(_0xd12b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd12b('0x2'));var router=express['Router']();var fs_extra=require(_0xd12b('0x3'));var auth=require(_0xd12b('0x4'));var interaction=require(_0xd12b('0x5'));var config=require(_0xd12b('0x6'));var controller=require(_0xd12b('0x7'));router[_0xd12b('0x8')]('/',auth['isAuthenticated'](),controller[_0xd12b('0x9')]);router[_0xd12b('0x8')](_0xd12b('0xa'),auth[_0xd12b('0xb')](),controller['show']);router[_0xd12b('0x8')](_0xd12b('0xc'),auth[_0xd12b('0xb')](),controller['download']);router[_0xd12b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd12b('0xe')](_0xd12b('0xa'),auth[_0xd12b('0xb')](),controller[_0xd12b('0xf')]);router['delete'](_0xd12b('0xa'),auth['isAuthenticated'](),controller[_0xd12b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xfe4c=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post','create','put','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x2f504e,_0x49d735){var _0x3d7a95=function(_0x4c8ca3){while(--_0x4c8ca3){_0x2f504e['push'](_0x2f504e['shift']());}};_0x3d7a95(++_0x49d735);}(_0xfe4c,0x151));var _0xcfe4=function(_0x25d126,_0x59d7bb){_0x25d126=_0x25d126-0x0;var _0x1ef8eb=_0xfe4c[_0x25d126];return _0x1ef8eb;};'use strict';var multer=require(_0xcfe4('0x0'));var util=require(_0xcfe4('0x1'));var path=require(_0xcfe4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xcfe4('0x3'));var auth=require(_0xcfe4('0x4'));var interaction=require(_0xcfe4('0x5'));var config=require(_0xcfe4('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0xcfe4('0x7')]('/',auth[_0xcfe4('0x8')](),controller[_0xcfe4('0x9')]);router[_0xcfe4('0x7')](_0xcfe4('0xa'),auth[_0xcfe4('0x8')](),controller[_0xcfe4('0xb')]);router[_0xcfe4('0x7')]('/:id/download',auth[_0xcfe4('0x8')](),controller[_0xcfe4('0xc')]);router[_0xcfe4('0xd')]('/',auth[_0xcfe4('0x8')](),controller[_0xcfe4('0xe')]);router[_0xcfe4('0xf')](_0xcfe4('0xa'),auth[_0xcfe4('0x8')](),controller[_0xcfe4('0x10')]);router['delete'](_0xcfe4('0xa'),auth['isAuthenticated'](),controller[_0xcfe4('0x11')]);module[_0xcfe4('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 6dab0e5..7ff8204 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 _0x31f3=['TEXT','STRING','exports'];(function(_0x28140f,_0x567007){var _0x4162fc=function(_0x36e4b6){while(--_0x36e4b6){_0x28140f['push'](_0x28140f['shift']());}};_0x4162fc(++_0x567007);}(_0x31f3,0x161));var _0x331f=function(_0x41eb8b,_0x8e630f){_0x41eb8b=_0x41eb8b-0x0;var _0x57f6be=_0x31f3[_0x41eb8b];return _0x57f6be;};'use strict';var Sequelize=require('sequelize');module[_0x331f('0x0')]={'field':{'type':Sequelize[_0x331f('0x1')]},'alias':{'type':Sequelize[_0x331f('0x2')]},'function':{'type':Sequelize[_0x331f('0x2')]},'format':{'type':Sequelize[_0x331f('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe40d=['TEXT','STRING','BOOLEAN','exports'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe40d,0x93));var _0xde40=function(_0x23737b,_0x5367d4){_0x23737b=_0x23737b-0x0;var _0x19af74=_0xe40d[_0x23737b];return _0x19af74;};'use strict';var Sequelize=require('sequelize');module[_0xde40('0x0')]={'field':{'type':Sequelize[_0xde40('0x1')]},'alias':{'type':Sequelize[_0xde40('0x2')]},'function':{'type':Sequelize[_0xde40('0x2')]},'format':{'type':Sequelize[_0xde40('0x2')]},'groupBy':{'type':Sequelize[_0xde40('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xde40('0x2')]},'custom':{'type':Sequelize[_0xde40('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 2c964b1..9cae59d 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 _0x2b3a=['CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','params','keys','includeAll','find','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction'];(function(_0x16faa5,_0x45bc2c){var _0x260680=function(_0xa48fa2){while(--_0xa48fa2){_0x16faa5['push'](_0x16faa5['shift']());}};_0x260680(++_0x45bc2c);}(_0x2b3a,0xab));var _0xa2b3=function(_0x2423cd,_0x461266){_0x2423cd=_0x2423cd-0x0;var _0x551cbf=_0x2b3a[_0x2423cd];return _0x551cbf;};'use strict';var emlformat=require(_0xa2b3('0x0'));var rimraf=require(_0xa2b3('0x1'));var zipdir=require(_0xa2b3('0x2'));var jsonpatch=require(_0xa2b3('0x3'));var rp=require(_0xa2b3('0x4'));var moment=require(_0xa2b3('0x5'));var BPromise=require(_0xa2b3('0x6'));var Mustache=require(_0xa2b3('0x7'));var util=require(_0xa2b3('0x8'));var path=require(_0xa2b3('0x9'));var sox=require(_0xa2b3('0xa'));var csv=require(_0xa2b3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2b3('0xc'));var _=require('lodash');var squel=require(_0xa2b3('0xd'));var crypto=require('crypto');var jsforce=require(_0xa2b3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa2b3('0xb'));var querystring=require(_0xa2b3('0xf'));var Papa=require(_0xa2b3('0x10'));var Redis=require(_0xa2b3('0x11'));var authService=require(_0xa2b3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa2b3('0x13'));var hardwareService=require(_0xa2b3('0x14'));var logger=require('../../config/logger')(_0xa2b3('0x15'));var utils=require(_0xa2b3('0x16'));var config=require(_0xa2b3('0x17'));var licenseUtil=require(_0xa2b3('0x18'));var db=require(_0xa2b3('0x19'))['db'];function respondWithStatusCode(_0x2f8ee4,_0x64ccff){_0x64ccff=_0x64ccff||0xcc;return function(_0x313d77){if(_0x313d77){return _0x2f8ee4[_0xa2b3('0x1a')](_0x64ccff);}return _0x2f8ee4['status'](_0x64ccff)[_0xa2b3('0x1b')]();};}function respondWithResult(_0x231c11,_0x184563){_0x184563=_0x184563||0xc8;return function(_0x2c1cac){if(_0x2c1cac){return _0x231c11[_0xa2b3('0x1c')](_0x184563)[_0xa2b3('0x1d')](_0x2c1cac);}};}function respondWithFilteredResult(_0x5b6256,_0xda1e44){return function(_0x14af4b){if(_0x14af4b){var _0x156e50=typeof _0xda1e44['offset']===_0xa2b3('0x1e')&&typeof _0xda1e44[_0xa2b3('0x1f')]===_0xa2b3('0x1e');var _0x35516e=_0x14af4b[_0xa2b3('0x20')];var _0x13fa91=_0x156e50?0x0:_0xda1e44[_0xa2b3('0x21')];var _0x55c991=_0x156e50?_0x14af4b[_0xa2b3('0x20')]:_0xda1e44['offset']+_0xda1e44[_0xa2b3('0x1f')];var _0x276a68;if(_0x55c991>=_0x35516e){_0x55c991=_0x35516e;_0x276a68=0xc8;}else{_0x276a68=0xce;}_0x5b6256[_0xa2b3('0x1c')](_0x276a68);return _0x5b6256['set'](_0xa2b3('0x22'),_0x13fa91+'-'+_0x55c991+'/'+_0x35516e)[_0xa2b3('0x1d')](_0x14af4b);}return null;};}function patchUpdates(_0x29c5c8){return function(_0x58f1e2){try{jsonpatch[_0xa2b3('0x23')](_0x58f1e2,_0x29c5c8,!![]);}catch(_0x328f8e){return BPromise['reject'](_0x328f8e);}return _0x58f1e2[_0xa2b3('0x24')]();};}function saveUpdates(_0x5981ef,_0x3083f1){return function(_0x1fb2db){if(_0x1fb2db){return _0x1fb2db['update'](_0x5981ef)[_0xa2b3('0x25')](function(_0xdc10ac){return _0xdc10ac;});}return null;};}function removeEntity(_0x541a22,_0x31a869){return function(_0xa1e805){if(_0xa1e805){return _0xa1e805[_0xa2b3('0x26')]()[_0xa2b3('0x25')](function(){_0x541a22['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x573196,_0x2bf25d){return function(_0x342494){if(!_0x342494){_0x573196[_0xa2b3('0x1a')](0x194);}return _0x342494;};}function handleError(_0x533be7,_0x3afd7c){_0x3afd7c=_0x3afd7c||0x1f4;return function(_0x1809c2){logger[_0xa2b3('0x27')](_0x1809c2[_0xa2b3('0x28')]);if(_0x1809c2[_0xa2b3('0x29')]){delete _0x1809c2[_0xa2b3('0x29')];}_0x533be7[_0xa2b3('0x1c')](_0x3afd7c)[_0xa2b3('0x2a')](_0x1809c2);};}exports[_0xa2b3('0x2b')]=function(_0xc0499c,_0x3ecbe1){var _0x3d1728={},_0x40ccb7={},_0x162ab8={'count':0x0,'rows':[]};var _0x3d1934=_[_0xa2b3('0x2c')](db[_0xa2b3('0x2d')][_0xa2b3('0x2e')],function(_0x24692f){return{'name':_0x24692f[_0xa2b3('0x2f')],'type':_0x24692f['type'][_0xa2b3('0x30')]};});_0x40ccb7['model']=_[_0xa2b3('0x2c')](_0x3d1934,'name');_0x40ccb7[_0xa2b3('0x31')]=_['keys'](_0xc0499c[_0xa2b3('0x31')]);_0x40ccb7[_0xa2b3('0x32')]=_[_0xa2b3('0x33')](_0x40ccb7[_0xa2b3('0x34')],_0x40ccb7[_0xa2b3('0x31')]);_0x3d1728['attributes']=_[_0xa2b3('0x33')](_0x40ccb7[_0xa2b3('0x34')],qs[_0xa2b3('0x35')](_0xc0499c[_0xa2b3('0x31')][_0xa2b3('0x35')]));_0x3d1728[_0xa2b3('0x36')]=_0x3d1728[_0xa2b3('0x36')][_0xa2b3('0x37')]?_0x3d1728['attributes']:_0x40ccb7[_0xa2b3('0x34')];if(!_0xc0499c[_0xa2b3('0x31')]['hasOwnProperty'](_0xa2b3('0x38'))){_0x3d1728['limit']=qs['limit'](_0xc0499c['query']['limit']);_0x3d1728[_0xa2b3('0x21')]=qs['offset'](_0xc0499c['query'][_0xa2b3('0x21')]);}_0x3d1728[_0xa2b3('0x39')]=qs['sort'](_0xc0499c[_0xa2b3('0x31')][_0xa2b3('0x3a')]);_0x3d1728[_0xa2b3('0x3b')]=qs['filters'](_[_0xa2b3('0x3c')](_0xc0499c[_0xa2b3('0x31')],_0x40ccb7[_0xa2b3('0x32')]),_0x3d1934);if(_0xc0499c[_0xa2b3('0x31')]['filter']){_0x3d1728[_0xa2b3('0x3b')]=_[_0xa2b3('0x3d')](_0x3d1728[_0xa2b3('0x3b')],{'$or':_[_0xa2b3('0x2c')](_0x3d1934,function(_0x5870a0){if(_0x5870a0[_0xa2b3('0x3e')]!==_0xa2b3('0x3f')){var _0x4ce1f0={};_0x4ce1f0[_0x5870a0[_0xa2b3('0x29')]]={'$like':'%'+_0xc0499c[_0xa2b3('0x31')][_0xa2b3('0x40')]+'%'};return _0x4ce1f0;}})});}_0x3d1728=_['merge']({},_0x3d1728,_0xc0499c[_0xa2b3('0x41')]);var _0x3035c9={'where':_0x3d1728['where']};return db[_0xa2b3('0x2d')][_0xa2b3('0x20')](_0x3035c9)[_0xa2b3('0x25')](function(_0x496e35){_0x162ab8[_0xa2b3('0x20')]=_0x496e35;if(_0xc0499c[_0xa2b3('0x31')]['includeAll']){_0x3d1728[_0xa2b3('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa2b3('0x43')](_0x3d1728);})[_0xa2b3('0x25')](function(_0x308f59){_0x162ab8['rows']=_0x308f59;return _0x162ab8;})[_0xa2b3('0x25')](respondWithFilteredResult(_0x3ecbe1,_0x3d1728))[_0xa2b3('0x44')](handleError(_0x3ecbe1,null));};exports['show']=function(_0xc7ae70,_0x497e32){var _0x2e3cc7={'raw':![],'where':{'id':_0xc7ae70[_0xa2b3('0x45')]['id']}},_0xa5655a={};_0xa5655a[_0xa2b3('0x34')]=_['keys'](db[_0xa2b3('0x2d')][_0xa2b3('0x2e')]);_0xa5655a['query']=_[_0xa2b3('0x46')](_0xc7ae70[_0xa2b3('0x31')]);_0xa5655a[_0xa2b3('0x32')]=_['intersection'](_0xa5655a[_0xa2b3('0x34')],_0xa5655a[_0xa2b3('0x31')]);_0x2e3cc7['attributes']=_['intersection'](_0xa5655a[_0xa2b3('0x34')],qs[_0xa2b3('0x35')](_0xc7ae70['query'][_0xa2b3('0x35')]));_0x2e3cc7['attributes']=_0x2e3cc7['attributes'][_0xa2b3('0x37')]?_0x2e3cc7['attributes']:_0xa5655a['model'];if(_0xc7ae70[_0xa2b3('0x31')][_0xa2b3('0x47')]){_0x2e3cc7[_0xa2b3('0x42')]=[{'all':!![]}];}_0x2e3cc7=_['merge']({},_0x2e3cc7,_0xc7ae70['options']);return db[_0xa2b3('0x2d')][_0xa2b3('0x48')](_0x2e3cc7)[_0xa2b3('0x25')](handleEntityNotFound(_0x497e32,null))[_0xa2b3('0x25')](respondWithResult(_0x497e32,null))[_0xa2b3('0x44')](handleError(_0x497e32,null));};exports[_0xa2b3('0x49')]=function(_0x521c1f,_0xf44aad){return db['AnalyticFieldReport']['create'](_0x521c1f[_0xa2b3('0x4a')],{})[_0xa2b3('0x25')](respondWithResult(_0xf44aad,0xc9))['catch'](handleError(_0xf44aad,null));};exports[_0xa2b3('0x4b')]=function(_0x68aa57,_0x3033d4){return db[_0xa2b3('0x2d')][_0xa2b3('0x4b')](_0x68aa57[_0xa2b3('0x4a')],{'raw':![],'individualHooks':!![]})[_0xa2b3('0x25')](respondWithResult(_0x3033d4,0xc9))[_0xa2b3('0x44')](handleError(_0x3033d4,null));};exports[_0xa2b3('0x4c')]=function(_0x12c85e,_0x5db5b8){if(_0x12c85e['body']['id']){delete _0x12c85e['body']['id'];}return db['AnalyticFieldReport'][_0xa2b3('0x48')]({'where':{'id':_0x12c85e[_0xa2b3('0x45')]['id']}})[_0xa2b3('0x25')](handleEntityNotFound(_0x5db5b8,null))['then'](saveUpdates(_0x12c85e[_0xa2b3('0x4a')],null))[_0xa2b3('0x25')](respondWithResult(_0x5db5b8,null))[_0xa2b3('0x44')](handleError(_0x5db5b8,null));};exports[_0xa2b3('0x26')]=function(_0x1b76a6,_0x503326){return db[_0xa2b3('0x2d')][_0xa2b3('0x48')]({'where':{'id':_0x1b76a6['params']['id']}})[_0xa2b3('0x25')](handleEntityNotFound(_0x503326,null))[_0xa2b3('0x25')](removeEntity(_0x503326,null))['catch'](handleError(_0x503326,null));};exports[_0xa2b3('0x4d')]=function(_0x1bde28,_0x36cd26){return db[_0xa2b3('0x2d')][_0xa2b3('0x26')]({'where':{'id':_0x1bde28[_0xa2b3('0x31')][_0xa2b3('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xa2b3('0x25')](respondWithResult(_0x36cd26,0xcc))['catch'](handleError(_0x36cd26,null));};exports[_0xa2b3('0x4f')]=function(_0x276796,_0x11450e,_0x24f03f){return db[_0xa2b3('0x50')][_0xa2b3('0x51')]({'where':{'id':_0x276796['params']['id']}})[_0xa2b3('0x25')](handleEntityNotFound(_0x11450e,null))[_0xa2b3('0x25')](function(_0x2c7f91){if(_0x2c7f91){return db[_0xa2b3('0x52')][_0xa2b3('0x53')](function(_0x8b31c1){return db[_0xa2b3('0x2d')][_0xa2b3('0x26')]({'where':{'CustomReportId':_0x276796[_0xa2b3('0x45')]['id']},'transaction':_0x8b31c1})[_0xa2b3('0x25')](function(_0x50121b){var _0x2ed654=_[_0xa2b3('0x2c')](_0x276796[_0xa2b3('0x4a')],function(_0xd4d72){delete _0xd4d72['id'];_0xd4d72[_0xa2b3('0x54')]=_0x276796[_0xa2b3('0x45')]['id'];return _0xd4d72;});return db[_0xa2b3('0x2d')]['bulkCreate'](_0x2ed654,{'transaction':_0x8b31c1});});})[_0xa2b3('0x25')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x276796[_0xa2b3('0x45')]['id']}});});}})[_0xa2b3('0x25')](respondWithResult(_0x11450e,null))[_0xa2b3('0x44')](handleError(_0x11450e,null));}; \ No newline at end of file +var _0x481c=['params','create','body','bulkCreate','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','end','name','send','AnalyticFieldReport','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x5c3054,_0x46a0fb){var _0x16e83b=function(_0x2299e0){while(--_0x2299e0){_0x5c3054['push'](_0x5c3054['shift']());}};_0x16e83b(++_0x46a0fb);}(_0x481c,0x1ac));var _0xc481=function(_0x31b71a,_0xf64826){_0x31b71a=_0x31b71a-0x0;var _0xeeed1b=_0x481c[_0x31b71a];return _0xeeed1b;};'use strict';var emlformat=require(_0xc481('0x0'));var rimraf=require(_0xc481('0x1'));var zipdir=require(_0xc481('0x2'));var jsonpatch=require(_0xc481('0x3'));var rp=require(_0xc481('0x4'));var moment=require(_0xc481('0x5'));var BPromise=require(_0xc481('0x6'));var Mustache=require(_0xc481('0x7'));var util=require(_0xc481('0x8'));var path=require(_0xc481('0x9'));var sox=require(_0xc481('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc481('0xb'));var _=require(_0xc481('0xc'));var squel=require(_0xc481('0xd'));var crypto=require(_0xc481('0xe'));var jsforce=require(_0xc481('0xf'));var deskjs=require(_0xc481('0x10'));var toCsv=require(_0xc481('0x11'));var querystring=require(_0xc481('0x12'));var Papa=require('papaparse');var Redis=require(_0xc481('0x13'));var authService=require(_0xc481('0x14'));var qs=require(_0xc481('0x15'));var as=require(_0xc481('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc481('0x17'))('api');var utils=require(_0xc481('0x18'));var config=require(_0xc481('0x19'));var licenseUtil=require(_0xc481('0x1a'));var db=require(_0xc481('0x1b'))['db'];function respondWithStatusCode(_0x90c2dc,_0x137c44){_0x137c44=_0x137c44||0xcc;return function(_0x1977f0){if(_0x1977f0){return _0x90c2dc[_0xc481('0x1c')](_0x137c44);}return _0x90c2dc[_0xc481('0x1d')](_0x137c44)['end']();};}function respondWithResult(_0x2de6d0,_0x28c6b8){_0x28c6b8=_0x28c6b8||0xc8;return function(_0x534597){if(_0x534597){return _0x2de6d0[_0xc481('0x1d')](_0x28c6b8)[_0xc481('0x1e')](_0x534597);}};}function respondWithFilteredResult(_0x5de87c,_0x292f7a){return function(_0x152ade){if(_0x152ade){var _0x51ac71=typeof _0x292f7a[_0xc481('0x1f')]==='undefined'&&typeof _0x292f7a[_0xc481('0x20')]===_0xc481('0x21');var _0x392ec8=_0x152ade[_0xc481('0x22')];var _0x24e5a7=_0x51ac71?0x0:_0x292f7a[_0xc481('0x1f')];var _0x24ebb1=_0x51ac71?_0x152ade['count']:_0x292f7a[_0xc481('0x1f')]+_0x292f7a[_0xc481('0x20')];var _0x3b5308;if(_0x24ebb1>=_0x392ec8){_0x24ebb1=_0x392ec8;_0x3b5308=0xc8;}else{_0x3b5308=0xce;}_0x5de87c[_0xc481('0x1d')](_0x3b5308);return _0x5de87c[_0xc481('0x23')]('Content-Range',_0x24e5a7+'-'+_0x24ebb1+'/'+_0x392ec8)[_0xc481('0x1e')](_0x152ade);}return null;};}function patchUpdates(_0x5bc733){return function(_0x4270f6){try{jsonpatch['apply'](_0x4270f6,_0x5bc733,!![]);}catch(_0x3b1439){return BPromise[_0xc481('0x24')](_0x3b1439);}return _0x4270f6[_0xc481('0x25')]();};}function saveUpdates(_0x20c39,_0x7d572f){return function(_0x422c04){if(_0x422c04){return _0x422c04[_0xc481('0x26')](_0x20c39)[_0xc481('0x27')](function(_0x2e5ae8){return _0x2e5ae8;});}return null;};}function removeEntity(_0x2f7567,_0x21c6e1){return function(_0x535066){if(_0x535066){return _0x535066['destroy']()['then'](function(){_0x2f7567['status'](0xcc)[_0xc481('0x28')]();});}};}function handleEntityNotFound(_0x15c64e,_0x58389b){return function(_0x235240){if(!_0x235240){_0x15c64e[_0xc481('0x1c')](0x194);}return _0x235240;};}function handleError(_0x4c09c4,_0x5d307d){_0x5d307d=_0x5d307d||0x1f4;return function(_0x3e172a){logger['error'](_0x3e172a['stack']);if(_0x3e172a[_0xc481('0x29')]){delete _0x3e172a[_0xc481('0x29')];}_0x4c09c4['status'](_0x5d307d)[_0xc481('0x2a')](_0x3e172a);};}exports['index']=function(_0x5bf2bf,_0x29be26){var _0xdeeddc={},_0x5e95e7={},_0x590c47={'count':0x0,'rows':[]};var _0x4ff636=_['map'](db[_0xc481('0x2b')][_0xc481('0x2c')],function(_0x42cd2e){return{'name':_0x42cd2e['fieldName'],'type':_0x42cd2e['type'][_0xc481('0x2d')]};});_0x5e95e7[_0xc481('0x2e')]=_[_0xc481('0x2f')](_0x4ff636,_0xc481('0x29'));_0x5e95e7[_0xc481('0x30')]=_[_0xc481('0x31')](_0x5bf2bf[_0xc481('0x30')]);_0x5e95e7[_0xc481('0x32')]=_[_0xc481('0x33')](_0x5e95e7['model'],_0x5e95e7['query']);_0xdeeddc[_0xc481('0x34')]=_[_0xc481('0x33')](_0x5e95e7[_0xc481('0x2e')],qs[_0xc481('0x35')](_0x5bf2bf[_0xc481('0x30')][_0xc481('0x35')]));_0xdeeddc[_0xc481('0x34')]=_0xdeeddc['attributes'][_0xc481('0x36')]?_0xdeeddc[_0xc481('0x34')]:_0x5e95e7['model'];if(!_0x5bf2bf[_0xc481('0x30')][_0xc481('0x37')]('nolimit')){_0xdeeddc[_0xc481('0x20')]=qs[_0xc481('0x20')](_0x5bf2bf[_0xc481('0x30')]['limit']);_0xdeeddc[_0xc481('0x1f')]=qs['offset'](_0x5bf2bf[_0xc481('0x30')][_0xc481('0x1f')]);}_0xdeeddc[_0xc481('0x38')]=qs['sort'](_0x5bf2bf[_0xc481('0x30')]['sort']);_0xdeeddc[_0xc481('0x39')]=qs[_0xc481('0x32')](_[_0xc481('0x3a')](_0x5bf2bf[_0xc481('0x30')],_0x5e95e7[_0xc481('0x32')]),_0x4ff636);if(_0x5bf2bf[_0xc481('0x30')][_0xc481('0x3b')]){_0xdeeddc[_0xc481('0x39')]=_[_0xc481('0x3c')](_0xdeeddc['where'],{'$or':_['map'](_0x4ff636,function(_0x1a278c){if(_0x1a278c[_0xc481('0x3d')]!==_0xc481('0x3e')){var _0x5a77ed={};_0x5a77ed[_0x1a278c[_0xc481('0x29')]]={'$like':'%'+_0x5bf2bf[_0xc481('0x30')]['filter']+'%'};return _0x5a77ed;}})});}_0xdeeddc=_[_0xc481('0x3c')]({},_0xdeeddc,_0x5bf2bf[_0xc481('0x3f')]);var _0x38cc39={'where':_0xdeeddc['where']};return db['AnalyticFieldReport']['count'](_0x38cc39)[_0xc481('0x27')](function(_0x3e1c41){_0x590c47['count']=_0x3e1c41;if(_0x5bf2bf['query'][_0xc481('0x40')]){_0xdeeddc[_0xc481('0x41')]=[{'all':!![]}];}return db[_0xc481('0x2b')][_0xc481('0x42')](_0xdeeddc);})['then'](function(_0x5329e2){_0x590c47[_0xc481('0x43')]=_0x5329e2;return _0x590c47;})[_0xc481('0x27')](respondWithFilteredResult(_0x29be26,_0xdeeddc))[_0xc481('0x44')](handleError(_0x29be26,null));};exports[_0xc481('0x45')]=function(_0x852107,_0x1eb275){var _0x28144a={'raw':![],'where':{'id':_0x852107[_0xc481('0x46')]['id']}},_0x4930e5={};_0x4930e5['model']=_['keys'](db[_0xc481('0x2b')][_0xc481('0x2c')]);_0x4930e5[_0xc481('0x30')]=_[_0xc481('0x31')](_0x852107['query']);_0x4930e5[_0xc481('0x32')]=_[_0xc481('0x33')](_0x4930e5['model'],_0x4930e5[_0xc481('0x30')]);_0x28144a[_0xc481('0x34')]=_[_0xc481('0x33')](_0x4930e5[_0xc481('0x2e')],qs[_0xc481('0x35')](_0x852107[_0xc481('0x30')][_0xc481('0x35')]));_0x28144a[_0xc481('0x34')]=_0x28144a['attributes'][_0xc481('0x36')]?_0x28144a['attributes']:_0x4930e5[_0xc481('0x2e')];if(_0x852107[_0xc481('0x30')]['includeAll']){_0x28144a[_0xc481('0x41')]=[{'all':!![]}];}_0x28144a=_[_0xc481('0x3c')]({},_0x28144a,_0x852107[_0xc481('0x3f')]);return db[_0xc481('0x2b')]['find'](_0x28144a)[_0xc481('0x27')](handleEntityNotFound(_0x1eb275,null))[_0xc481('0x27')](respondWithResult(_0x1eb275,null))[_0xc481('0x44')](handleError(_0x1eb275,null));};exports[_0xc481('0x47')]=function(_0x7e77c5,_0x397d36){return db[_0xc481('0x2b')]['create'](_0x7e77c5[_0xc481('0x48')],{})[_0xc481('0x27')](respondWithResult(_0x397d36,0xc9))['catch'](handleError(_0x397d36,null));};exports[_0xc481('0x49')]=function(_0x32dd0a,_0x1e5402){return db['AnalyticFieldReport'][_0xc481('0x49')](_0x32dd0a[_0xc481('0x48')],{'raw':![],'individualHooks':!![]})[_0xc481('0x27')](respondWithResult(_0x1e5402,0xc9))[_0xc481('0x44')](handleError(_0x1e5402,null));};exports[_0xc481('0x26')]=function(_0x4e7b82,_0x49f805){if(_0x4e7b82[_0xc481('0x48')]['id']){delete _0x4e7b82[_0xc481('0x48')]['id'];}return db[_0xc481('0x2b')][_0xc481('0x4a')]({'where':{'id':_0x4e7b82[_0xc481('0x46')]['id']}})[_0xc481('0x27')](handleEntityNotFound(_0x49f805,null))[_0xc481('0x27')](saveUpdates(_0x4e7b82[_0xc481('0x48')],null))[_0xc481('0x27')](respondWithResult(_0x49f805,null))[_0xc481('0x44')](handleError(_0x49f805,null));};exports['destroy']=function(_0x500568,_0x45f11c){return db['AnalyticFieldReport']['find']({'where':{'id':_0x500568[_0xc481('0x46')]['id']}})[_0xc481('0x27')](handleEntityNotFound(_0x45f11c,null))[_0xc481('0x27')](removeEntity(_0x45f11c,null))['catch'](handleError(_0x45f11c,null));};exports[_0xc481('0x4b')]=function(_0x3b8206,_0x412d15){return db['AnalyticFieldReport'][_0xc481('0x4c')]({'where':{'id':_0x3b8206[_0xc481('0x30')][_0xc481('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0xc481('0x27')](respondWithResult(_0x412d15,0xcc))[_0xc481('0x44')](handleError(_0x412d15,null));};exports[_0xc481('0x4e')]=function(_0x43aef2,_0x16d0b7,_0x23ad1c){return db[_0xc481('0x4f')][_0xc481('0x50')]({'where':{'id':_0x43aef2[_0xc481('0x46')]['id']}})[_0xc481('0x27')](handleEntityNotFound(_0x16d0b7,null))[_0xc481('0x27')](function(_0x30c5aa){if(_0x30c5aa){return db['sequelize'][_0xc481('0x51')](function(_0x19d7ad){return db[_0xc481('0x2b')]['destroy']({'where':{'CustomReportId':_0x43aef2[_0xc481('0x46')]['id']},'transaction':_0x19d7ad})[_0xc481('0x27')](function(_0x4c6365){var _0x4a54b0=_[_0xc481('0x2f')](_0x43aef2[_0xc481('0x48')],function(_0x48bda8){delete _0x48bda8['id'];_0x48bda8[_0xc481('0x52')]=_0x43aef2['params']['id'];return _0x48bda8;});return db[_0xc481('0x2b')][_0xc481('0x49')](_0x4a54b0,{'transaction':_0x19d7ad});});})[_0xc481('0x27')](function(){return db[_0xc481('0x2b')][_0xc481('0x42')]({'where':{'CustomReportId':_0x43aef2['params']['id']}});});}})['then'](respondWithResult(_0x16d0b7,null))[_0xc481('0x44')](handleError(_0x16d0b7,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index fe6324f..4627847 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 _0x2521=['analytics_report_fields','lodash','api','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2521,0x161));var _0x1252=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0x2521[_0x545b71];return _0x26e587;};'use strict';var _=require(_0x1252('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1252('0x1'));var moment=require('moment');var BPromise=require(_0x1252('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1252('0x3'));var rimraf=require(_0x1252('0x4'));var config=require(_0x1252('0x5'));var attributes=require(_0x1252('0x6'));module[_0x1252('0x7')]=function(_0x1a349e,_0x3994df){return _0x1a349e[_0x1252('0x8')](_0x1252('0x9'),attributes,{'tableName':_0x1252('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddb7=['../../config/environment','./analyticFieldReport.attributes','define','analytics_report_fields','lodash','api','bluebird','request-promise','rimraf'];(function(_0x4780b9,_0x237582){var _0x184efc=function(_0x4b4c97){while(--_0x4b4c97){_0x4780b9['push'](_0x4780b9['shift']());}};_0x184efc(++_0x237582);}(_0xddb7,0x199));var _0x7ddb=function(_0x491d7c,_0x16a1d7){_0x491d7c=_0x491d7c-0x0;var _0x401fc7=_0xddb7[_0x491d7c];return _0x401fc7;};'use strict';var _=require(_0x7ddb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7ddb('0x1'));var moment=require('moment');var BPromise=require(_0x7ddb('0x2'));var rp=require(_0x7ddb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ddb('0x4'));var config=require(_0x7ddb('0x5'));var attributes=require(_0x7ddb('0x6'));module['exports']=function(_0x513c36,_0x3f0711){return _0x513c36[_0x7ddb('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0x7ddb('0x8'),'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 f7309a0..f59a76d 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 _0xec0d=['rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xec0d,0x124));var _0xdec0=function(_0x2a6ab4,_0x361cb5){_0x2a6ab4=_0x2a6ab4-0x0;var _0x41ebd9=_0xec0d[_0x2a6ab4];return _0x41ebd9;};'use strict';var _=require(_0xdec0('0x0'));var util=require(_0xdec0('0x1'));var moment=require(_0xdec0('0x2'));var BPromise=require(_0xdec0('0x3'));var rs=require(_0xdec0('0x4'));var fs=require('fs');var Redis=require(_0xdec0('0x5'));var db=require(_0xdec0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdec0('0x7'))(_0xdec0('0x8'));var config=require(_0xdec0('0x9'));var jayson=require(_0xdec0('0xa'));var client=jayson['client'][_0xdec0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a9d82,_0x5485cc,_0xec871a){return new BPromise(function(_0x24519c,_0x366f5e){return client[_0xdec0('0xc')](_0x1a9d82,_0xec871a)[_0xdec0('0xd')](function(_0xb10482){logger[_0xdec0('0xe')](_0xdec0('0xf'),_0x5485cc,_0xdec0('0x10'));logger[_0xdec0('0x11')](_0xdec0('0x12'),_0x5485cc,'request\x20sent',JSON[_0xdec0('0x13')](_0xb10482));if(_0xb10482[_0xdec0('0x14')]){if(_0xb10482[_0xdec0('0x14')][_0xdec0('0x15')]===0x1f4){logger[_0xdec0('0x14')](_0xdec0('0xf'),_0x5485cc,_0xb10482['error'][_0xdec0('0x16')]);return _0x366f5e(_0xb10482[_0xdec0('0x14')]['message']);}logger[_0xdec0('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5485cc,_0xb10482['error']['message']);return _0x24519c(_0xb10482[_0xdec0('0x14')]['message']);}else{logger[_0xdec0('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5485cc,'request\x20sent');_0x24519c(_0xb10482[_0xdec0('0x17')]['message']);}})[_0xdec0('0x18')](function(_0x3e6238){logger[_0xdec0('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5485cc,_0x3e6238);_0x366f5e(_0x3e6238);});});} \ No newline at end of file +var _0x726f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x281372,_0x2a5398){var _0x4957b6=function(_0x3918ed){while(--_0x3918ed){_0x281372['push'](_0x281372['shift']());}};_0x4957b6(++_0x2a5398);}(_0x726f,0x1ca));var _0xf726=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x726f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf726('0x0'));var util=require(_0xf726('0x1'));var moment=require(_0xf726('0x2'));var BPromise=require(_0xf726('0x3'));var rs=require(_0xf726('0x4'));var fs=require('fs');var Redis=require(_0xf726('0x5'));var db=require(_0xf726('0x6'))['db'];var utils=require(_0xf726('0x7'));var logger=require(_0xf726('0x8'))(_0xf726('0x9'));var config=require(_0xf726('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf726('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58cf39,_0x3a6bb6,_0x52de25){return new BPromise(function(_0x524fd0,_0x19bfec){return client[_0xf726('0xc')](_0x58cf39,_0x52de25)[_0xf726('0xd')](function(_0x5ae23a){logger[_0xf726('0xe')](_0xf726('0xf'),_0x3a6bb6,_0xf726('0x10'));logger['debug'](_0xf726('0x11'),_0x3a6bb6,_0xf726('0x10'),JSON['stringify'](_0x5ae23a));if(_0x5ae23a[_0xf726('0x12')]){if(_0x5ae23a[_0xf726('0x12')][_0xf726('0x13')]===0x1f4){logger['error'](_0xf726('0xf'),_0x3a6bb6,_0x5ae23a[_0xf726('0x12')][_0xf726('0x14')]);return _0x19bfec(_0x5ae23a['error'][_0xf726('0x14')]);}logger[_0xf726('0x12')](_0xf726('0xf'),_0x3a6bb6,_0x5ae23a['error'][_0xf726('0x14')]);return _0x524fd0(_0x5ae23a[_0xf726('0x12')][_0xf726('0x14')]);}else{logger[_0xf726('0xe')](_0xf726('0xf'),_0x3a6bb6,'request\x20sent');_0x524fd0(_0x5ae23a[_0xf726('0x15')][_0xf726('0x14')]);}})[_0xf726('0x16')](function(_0xf719cd){logger[_0xf726('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3a6bb6,_0xf719cd);_0x19bfec(_0xf719cd);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index a97e582..2b266ee 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(_0x1dfc98,_0x3264e9){var _0x57430f=function(_0x47404d){while(--_0x47404d){_0x1dfc98['push'](_0x1dfc98['shift']());}};_0x57430f(++_0x3264e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +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(_0x68f1c,_0x19fa33){var _0x1536f0=function(_0x1b44d2){while(--_0x1b44d2){_0x68f1c['push'](_0x68f1c['shift']());}};_0x1536f0(++_0x19fa33);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 24c39ff..56a8296 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 _0x1ebd=['sequelize','exports','STRING','TEXT'];(function(_0x4f0a56,_0x27797e){var _0x517957=function(_0x2029f7){while(--_0x2029f7){_0x4f0a56['push'](_0x4f0a56['shift']());}};_0x517957(++_0x27797e);}(_0x1ebd,0x64));var _0xd1eb=function(_0x3fb341,_0x53984a){_0x3fb341=_0x3fb341-0x0;var _0x389dd1=_0x1ebd[_0x3fb341];return _0x389dd1;};'use strict';var Sequelize=require(_0xd1eb('0x0'));module[_0xd1eb('0x1')]={'name':{'type':Sequelize[_0xd1eb('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xd1eb('0x2')]},'metric':{'type':Sequelize[_0xd1eb('0x3')]},'description':{'type':Sequelize[_0xd1eb('0x2')]}}; \ No newline at end of file +var _0xd547=['name','TEXT','STRING'];(function(_0x56e200,_0x487cd7){var _0xd0faf8=function(_0x183c97){while(--_0x183c97){_0x56e200['push'](_0x56e200['shift']());}};_0xd0faf8(++_0x487cd7);}(_0xd547,0x1c1));var _0x7d54=function(_0x2fc1f6,_0x51543e){_0x2fc1f6=_0x2fc1f6-0x0;var _0x7a3346=_0xd547[_0x2fc1f6];return _0x7a3346;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7d54('0x0')],'allowNull':![],'unique':_0x7d54('0x1')},'table':{'type':Sequelize[_0x7d54('0x0')]},'metric':{'type':Sequelize[_0x7d54('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 0511655..33fbb53 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x84ab,0x12f));var _0xb84a=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x84ab[_0x28394f];return _0x2618d2;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));}; \ No newline at end of file +var _0x34e8=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','catch','params','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','Metrics','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x42d2af,_0x3961b5){var _0x1d6d63=function(_0x10833e){while(--_0x10833e){_0x42d2af['push'](_0x42d2af['shift']());}};_0x1d6d63(++_0x3961b5);}(_0x34e8,0x12c));var _0x834e=function(_0x3a3ea9,_0x592bf5){_0x3a3ea9=_0x3a3ea9-0x0;var _0x31c95b=_0x34e8[_0x3a3ea9];return _0x31c95b;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){var _0x338636=_0x58f4fd['get']({'plain':!![]});var _0x24fcf7=_0x834e('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x24fcf7,'resourceId':_0x338636['id']}})[_0x834e('0x2a')](function(){return _0x58f4fd;});})['then'](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3db026,_0x2cc2eb){return function(_0x3cd928){if(!_0x3cd928){_0x3db026[_0x834e('0x1c')](0x194);}return _0x3cd928;};}function handleError(_0x491919,_0x510780){_0x510780=_0x510780||0x1f4;return function(_0x4dc64a){logger['error'](_0x4dc64a[_0x834e('0x2d')]);if(_0x4dc64a[_0x834e('0x2e')]){delete _0x4dc64a[_0x834e('0x2e')];}_0x491919['status'](_0x510780)[_0x834e('0x2f')](_0x4dc64a);};}exports[_0x834e('0x30')]=function(_0x1f3671,_0x1e026a){var _0x4551f5={},_0x390119={},_0x3d149d={'count':0x0,'rows':[]};var _0xfaf716=_[_0x834e('0x31')](db['AnalyticMetric'][_0x834e('0x32')],function(_0x5cad11){return{'name':_0x5cad11[_0x834e('0x33')],'type':_0x5cad11[_0x834e('0x34')][_0x834e('0x35')]};});_0x390119[_0x834e('0x36')]=_[_0x834e('0x31')](_0xfaf716,_0x834e('0x2e'));_0x390119[_0x834e('0x37')]=_[_0x834e('0x38')](_0x1f3671[_0x834e('0x37')]);_0x390119[_0x834e('0x39')]=_['intersection'](_0x390119[_0x834e('0x36')],_0x390119[_0x834e('0x37')]);_0x4551f5[_0x834e('0x3a')]=_[_0x834e('0x3b')](_0x390119['model'],qs[_0x834e('0x3c')](_0x1f3671[_0x834e('0x37')]['fields']));_0x4551f5['attributes']=_0x4551f5['attributes'][_0x834e('0x3d')]?_0x4551f5[_0x834e('0x3a')]:_0x390119[_0x834e('0x36')];if(!_0x1f3671[_0x834e('0x37')][_0x834e('0x3e')](_0x834e('0x3f'))){_0x4551f5['limit']=qs[_0x834e('0x20')](_0x1f3671['query'][_0x834e('0x20')]);_0x4551f5[_0x834e('0x22')]=qs['offset'](_0x1f3671[_0x834e('0x37')][_0x834e('0x22')]);}_0x4551f5['order']=qs['sort'](_0x1f3671[_0x834e('0x37')][_0x834e('0x40')]);_0x4551f5[_0x834e('0x41')]=qs[_0x834e('0x39')](_[_0x834e('0x42')](_0x1f3671['query'],_0x390119[_0x834e('0x39')]),_0xfaf716);if(_0x1f3671['query']['filter']){_0x4551f5[_0x834e('0x41')]=_['merge'](_0x4551f5[_0x834e('0x41')],{'$or':_[_0x834e('0x31')](_0xfaf716,function(_0x16aea6){if(_0x16aea6[_0x834e('0x34')]!==_0x834e('0x43')){var _0x574ea8={};_0x574ea8[_0x16aea6[_0x834e('0x2e')]]={'$like':'%'+_0x1f3671[_0x834e('0x37')][_0x834e('0x44')]+'%'};return _0x574ea8;}})});}_0x4551f5=_['merge']({},_0x4551f5,_0x1f3671[_0x834e('0x45')]);var _0x16ac45={'where':_0x4551f5['where']};return db[_0x834e('0x46')]['count'](_0x16ac45)[_0x834e('0x2a')](function(_0x585335){_0x3d149d['count']=_0x585335;if(_0x1f3671['query'][_0x834e('0x47')]){_0x4551f5[_0x834e('0x48')]=[{'all':!![]}];}return db[_0x834e('0x46')][_0x834e('0x49')](_0x4551f5);})[_0x834e('0x2a')](function(_0x23feea){_0x3d149d[_0x834e('0x4a')]=_0x23feea;return _0x3d149d;})['then'](respondWithFilteredResult(_0x1e026a,_0x4551f5))[_0x834e('0x4b')](handleError(_0x1e026a,null));};exports['show']=function(_0x321efa,_0x540685){var _0x1df5b0={'raw':!![],'where':{'id':_0x321efa[_0x834e('0x4c')]['id']}},_0x5a5807={};_0x5a5807[_0x834e('0x36')]=_['keys'](db[_0x834e('0x46')][_0x834e('0x32')]);_0x5a5807[_0x834e('0x37')]=_[_0x834e('0x38')](_0x321efa[_0x834e('0x37')]);_0x5a5807[_0x834e('0x39')]=_[_0x834e('0x3b')](_0x5a5807[_0x834e('0x36')],_0x5a5807[_0x834e('0x37')]);_0x1df5b0[_0x834e('0x3a')]=_['intersection'](_0x5a5807[_0x834e('0x36')],qs[_0x834e('0x3c')](_0x321efa['query'][_0x834e('0x3c')]));_0x1df5b0[_0x834e('0x3a')]=_0x1df5b0[_0x834e('0x3a')][_0x834e('0x3d')]?_0x1df5b0[_0x834e('0x3a')]:_0x5a5807[_0x834e('0x36')];if(_0x321efa['query']['includeAll']){_0x1df5b0[_0x834e('0x48')]=[{'all':!![]}];}_0x1df5b0=_[_0x834e('0x4d')]({},_0x1df5b0,_0x321efa[_0x834e('0x45')]);return db[_0x834e('0x46')][_0x834e('0x4e')](_0x1df5b0)[_0x834e('0x2a')](handleEntityNotFound(_0x540685,null))[_0x834e('0x2a')](respondWithResult(_0x540685,null))[_0x834e('0x4b')](handleError(_0x540685,null));};exports[_0x834e('0x4f')]=function(_0x390c45,_0xf02f0d){return db[_0x834e('0x46')][_0x834e('0x4f')](_0x390c45[_0x834e('0x50')],{})[_0x834e('0x2a')](function(_0x1a3855){var _0x3df078=_0x390c45[_0x834e('0x51')][_0x834e('0x52')]({'plain':!![]});if(!_0x3df078)throw new Error(_0x834e('0x53'));if(_0x3df078['role']===_0x834e('0x51')){var _0x1f08b9=_0x1a3855['get']({'plain':!![]});var _0x3c00a3=_0x834e('0x2c');return db['UserProfileSection'][_0x834e('0x4e')]({'where':{'name':_0x3c00a3,'userProfileId':_0x3df078[_0x834e('0x54')]},'raw':!![]})[_0x834e('0x2a')](function(_0x35636e){if(_0x35636e&&_0x35636e[_0x834e('0x55')]===0x0){return db[_0x834e('0x56')][_0x834e('0x4f')]({'name':_0x1f08b9['name'],'resourceId':_0x1f08b9['id'],'type':_0x35636e[_0x834e('0x2e')],'sectionId':_0x35636e['id']},{})[_0x834e('0x2a')](function(){return _0x1a3855;});}else{return _0x1a3855;}})[_0x834e('0x4b')](function(_0x363675){logger[_0x834e('0x57')](_0x834e('0x58'),_0x363675);throw _0x363675;});}return _0x1a3855;})[_0x834e('0x2a')](respondWithResult(_0xf02f0d,0xc9))[_0x834e('0x4b')](handleError(_0xf02f0d,null));};exports['update']=function(_0x11778e,_0x4dc104){if(_0x11778e[_0x834e('0x50')]['id']){delete _0x11778e['body']['id'];}return db[_0x834e('0x46')]['find']({'where':{'id':_0x11778e['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4dc104,null))[_0x834e('0x2a')](saveUpdates(_0x11778e['body'],null))['then'](respondWithResult(_0x4dc104,null))[_0x834e('0x4b')](handleError(_0x4dc104,null));};exports[_0x834e('0x2b')]=function(_0x138ed2,_0x387365){return db[_0x834e('0x46')][_0x834e('0x4e')]({'where':{'id':_0x138ed2[_0x834e('0x4c')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x387365,null))['then'](removeEntity(_0x387365,null))[_0x834e('0x4b')](handleError(_0x387365,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 215d53b..d00ef76 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 _0x29af=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics'];(function(_0x102d5a,_0x2ced0e){var _0x9fca2=function(_0x53c886){while(--_0x53c886){_0x102d5a['push'](_0x102d5a['shift']());}};_0x9fca2(++_0x2ced0e);}(_0x29af,0x134));var _0xf29a=function(_0x5f34a3,_0x4ba871){_0x5f34a3=_0x5f34a3-0x0;var _0xeabd05=_0x29af[_0x5f34a3];return _0xeabd05;};'use strict';var _=require(_0xf29a('0x0'));var util=require(_0xf29a('0x1'));var logger=require(_0xf29a('0x2'))('api');var moment=require(_0xf29a('0x3'));var BPromise=require(_0xf29a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf29a('0x5'));var rimraf=require('rimraf');var config=require(_0xf29a('0x6'));var attributes=require(_0xf29a('0x7'));module['exports']=function(_0x553398,_0x2e25dc){return _0x553398[_0xf29a('0x8')](_0xf29a('0x9'),attributes,{'tableName':_0xf29a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc359=['analytics_metrics','util','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x543349,_0x8f9924){var _0x2f87da=function(_0x25be61){while(--_0x25be61){_0x543349['push'](_0x543349['shift']());}};_0x2f87da(++_0x8f9924);}(_0xc359,0x1d9));var _0x9c35=function(_0x3d7fb5,_0x16eb5c){_0x3d7fb5=_0x3d7fb5-0x0;var _0x3a9642=_0xc359[_0x3d7fb5];return _0x3a9642;};'use strict';var _=require('lodash');var util=require(_0x9c35('0x0'));var logger=require('../../config/logger')(_0x9c35('0x1'));var moment=require(_0x9c35('0x2'));var BPromise=require(_0x9c35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c35('0x4'));var rimraf=require('rimraf');var config=require(_0x9c35('0x5'));var attributes=require('./analyticMetric.attributes');module[_0x9c35('0x6')]=function(_0x5b3ada,_0x490409){return _0x5b3ada['define']('AnalyticMetric',attributes,{'tableName':_0x9c35('0x7'),'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 c65943c..e349541 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 _0x5c54=['request','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x4f2db6,_0x3e7c16){var _0x1cb01c=function(_0x1e9bc7){while(--_0x1e9bc7){_0x4f2db6['push'](_0x4f2db6['shift']());}};_0x1cb01c(++_0x3e7c16);}(_0x5c54,0x174));var _0x45c5=function(_0x41d249,_0x5b96ee){_0x41d249=_0x41d249-0x0;var _0x4e9459=_0x5c54[_0x41d249];return _0x4e9459;};'use strict';var _=require(_0x45c5('0x0'));var util=require(_0x45c5('0x1'));var moment=require('moment');var BPromise=require(_0x45c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45c5('0x3'))['db'];var utils=require(_0x45c5('0x4'));var logger=require(_0x45c5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x45c5('0x6'));var client=jayson[_0x45c5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fb939,_0x4272c4,_0x217fbf){return new BPromise(function(_0x27c6f4,_0xf8ffb3){return client[_0x45c5('0x8')](_0x3fb939,_0x217fbf)[_0x45c5('0x9')](function(_0x125a46){logger[_0x45c5('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x4272c4,_0x45c5('0xb'));logger[_0x45c5('0xc')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4272c4,_0x45c5('0xb'),JSON[_0x45c5('0xd')](_0x125a46));if(_0x125a46[_0x45c5('0xe')]){if(_0x125a46[_0x45c5('0xe')][_0x45c5('0xf')]===0x1f4){logger[_0x45c5('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x4272c4,_0x125a46[_0x45c5('0xe')][_0x45c5('0x10')]);return _0xf8ffb3(_0x125a46[_0x45c5('0xe')][_0x45c5('0x10')]);}logger[_0x45c5('0xe')](_0x45c5('0x11'),_0x4272c4,_0x125a46[_0x45c5('0xe')][_0x45c5('0x10')]);return _0x27c6f4(_0x125a46[_0x45c5('0xe')][_0x45c5('0x10')]);}else{logger['info'](_0x45c5('0x11'),_0x4272c4,_0x45c5('0xb'));_0x27c6f4(_0x125a46[_0x45c5('0x12')][_0x45c5('0x10')]);}})[_0x45c5('0x13')](function(_0x508a34){logger[_0x45c5('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x4272c4,_0x508a34);_0xf8ffb3(_0x508a34);});});} \ No newline at end of file +var _0xb0be=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5be0a1,_0x49ee54){var _0x1e3f13=function(_0x56558d){while(--_0x56558d){_0x5be0a1['push'](_0x5be0a1['shift']());}};_0x1e3f13(++_0x49ee54);}(_0xb0be,0x19c));var _0xeb0b=function(_0x48efc4,_0x4035c0){_0x48efc4=_0x48efc4-0x0;var _0x151c20=_0xb0be[_0x48efc4];return _0x151c20;};'use strict';var _=require(_0xeb0b('0x0'));var util=require(_0xeb0b('0x1'));var moment=require(_0xeb0b('0x2'));var BPromise=require(_0xeb0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb0b('0x4'));var db=require(_0xeb0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb0b('0x6'))(_0xeb0b('0x7'));var config=require(_0xeb0b('0x8'));var jayson=require(_0xeb0b('0x9'));var client=jayson[_0xeb0b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2de0fb,_0x1eb765,_0xb031b7){return new BPromise(function(_0x1dccd5,_0x166819){return client[_0xeb0b('0xb')](_0x2de0fb,_0xb031b7)['then'](function(_0x29c0ea){logger[_0xeb0b('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1eb765,_0xeb0b('0xd'));logger[_0xeb0b('0xe')](_0xeb0b('0xf'),_0x1eb765,_0xeb0b('0xd'),JSON[_0xeb0b('0x10')](_0x29c0ea));if(_0x29c0ea[_0xeb0b('0x11')]){if(_0x29c0ea[_0xeb0b('0x11')][_0xeb0b('0x12')]===0x1f4){logger[_0xeb0b('0x11')](_0xeb0b('0x13'),_0x1eb765,_0x29c0ea[_0xeb0b('0x11')][_0xeb0b('0x14')]);return _0x166819(_0x29c0ea['error']['message']);}logger[_0xeb0b('0x11')](_0xeb0b('0x13'),_0x1eb765,_0x29c0ea[_0xeb0b('0x11')][_0xeb0b('0x14')]);return _0x1dccd5(_0x29c0ea[_0xeb0b('0x11')][_0xeb0b('0x14')]);}else{logger[_0xeb0b('0xc')](_0xeb0b('0x13'),_0x1eb765,_0xeb0b('0xd'));_0x1dccd5(_0x29c0ea['result'][_0xeb0b('0x14')]);}})[_0xeb0b('0x15')](function(_0x4469aa){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x1eb765,_0x4469aa);_0x166819(_0x4469aa);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 848f9bb..31f2a0f 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 _0xdedd=['show','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x1e0525,_0x281296){var _0x40eb50=function(_0x431055){while(--_0x431055){_0x1e0525['push'](_0x1e0525['shift']());}};_0x40eb50(++_0x281296);}(_0xdedd,0x197));var _0xdded=function(_0x23346,_0xa83c7f){_0x23346=_0x23346-0x0;var _0x4cb474=_0xdedd[_0x23346];return _0x4cb474;};'use strict';var multer=require(_0xdded('0x0'));var util=require(_0xdded('0x1'));var path=require(_0xdded('0x2'));var timeout=require(_0xdded('0x3'));var express=require(_0xdded('0x4'));var router=express['Router']();var fs_extra=require(_0xdded('0x5'));var auth=require(_0xdded('0x6'));var interaction=require(_0xdded('0x7'));var config=require(_0xdded('0x8'));var controller=require(_0xdded('0x9'));router[_0xdded('0xa')]('/',auth[_0xdded('0xb')](),controller[_0xdded('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdded('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdded('0xe')]);router[_0xdded('0xf')](_0xdded('0x10'),auth[_0xdded('0xb')](),controller['update']);router[_0xdded('0x11')]('/:id',auth[_0xdded('0xb')](),controller[_0xdded('0x12')]);module[_0xdded('0x13')]=router; \ No newline at end of file +var _0x8832=['fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','create','put','/:id','update','multer','util','express','Router'];(function(_0x598daf,_0x5e6f4f){var _0x483e42=function(_0x382f20){while(--_0x382f20){_0x598daf['push'](_0x598daf['shift']());}};_0x483e42(++_0x5e6f4f);}(_0x8832,0x1f4));var _0x2883=function(_0x4a7676,_0x1da633){_0x4a7676=_0x4a7676-0x0;var _0x5d4158=_0x8832[_0x4a7676];return _0x5d4158;};'use strict';var multer=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2883('0x2'));var router=express[_0x2883('0x3')]();var fs_extra=require(_0x2883('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2883('0x5'));var config=require('../../config/environment');var controller=require(_0x2883('0x6'));router[_0x2883('0x7')]('/',auth[_0x2883('0x8')](),controller['index']);router[_0x2883('0x7')]('/:id',auth[_0x2883('0x8')](),controller[_0x2883('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2883('0xa')]);router[_0x2883('0xb')](_0x2883('0xc'),auth[_0x2883('0x8')](),controller[_0x2883('0xd')]);router['delete']('/:id',auth[_0x2883('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 80e2b79..57766ee 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 _0xa7d0=['TEXT','sequelize','exports'];(function(_0x1ea4d9,_0x3cf6d2){var _0x34f374=function(_0x2332f4){while(--_0x2332f4){_0x1ea4d9['push'](_0x1ea4d9['shift']());}};_0x34f374(++_0x3cf6d2);}(_0xa7d0,0x148));var _0x0a7d=function(_0x18d8ef,_0x5d0c43){_0x18d8ef=_0x18d8ef-0x0;var _0xfabccb=_0xa7d0[_0x18d8ef];return _0xfabccb;};'use strict';var Sequelize=require(_0x0a7d('0x0'));module[_0x0a7d('0x1')]={'tree':{'type':Sequelize[_0x0a7d('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xef4c=['TEXT','exports'];(function(_0x1616cb,_0x27f903){var _0x6cb794=function(_0x12194d){while(--_0x12194d){_0x1616cb['push'](_0x1616cb['shift']());}};_0x6cb794(++_0x27f903);}(_0xef4c,0xd5));var _0xcef4=function(_0x3d74ed,_0x1e958f){_0x3d74ed=_0x3d74ed-0x0;var _0x1fdb8b=_0xef4c[_0x3d74ed];return _0x1fdb8b;};'use strict';var Sequelize=require('sequelize');module[_0xcef4('0x0')]={'tree':{'type':Sequelize[_0xcef4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index c494ada..9a03e4d 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 _0xd8a4=['findAll','rows','show','params','keys','options','find','catch','create','eml-format','rimraf','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','includeAll','include'];(function(_0x5d6c93,_0x10f1c4){var _0x35daaa=function(_0xfec32d){while(--_0xfec32d){_0x5d6c93['push'](_0x5d6c93['shift']());}};_0x35daaa(++_0x10f1c4);}(_0xd8a4,0x95));var _0x4d8a=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xd8a4[_0x3a6efd];return _0x487b9a;};'use strict';var emlformat=require(_0x4d8a('0x0'));var rimraf=require(_0x4d8a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4d8a('0x2'));var BPromise=require(_0x4d8a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4d8a('0x4'));var sox=require(_0x4d8a('0x5'));var csv=require(_0x4d8a('0x6'));var ejs=require(_0x4d8a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d8a('0x8'));var squel=require('squel');var crypto=require(_0x4d8a('0x9'));var jsforce=require(_0x4d8a('0xa'));var deskjs=require(_0x4d8a('0xb'));var toCsv=require(_0x4d8a('0x6'));var querystring=require(_0x4d8a('0xc'));var Papa=require(_0x4d8a('0xd'));var Redis=require(_0x4d8a('0xe'));var authService=require(_0x4d8a('0xf'));var qs=require(_0x4d8a('0x10'));var as=require(_0x4d8a('0x11'));var hardwareService=require(_0x4d8a('0x12'));var logger=require(_0x4d8a('0x13'))('api');var utils=require(_0x4d8a('0x14'));var config=require(_0x4d8a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f44df,_0x5233d0){_0x5233d0=_0x5233d0||0xcc;return function(_0x4a55a6){if(_0x4a55a6){return _0x3f44df[_0x4d8a('0x16')](_0x5233d0);}return _0x3f44df['status'](_0x5233d0)[_0x4d8a('0x17')]();};}function respondWithResult(_0x1921a4,_0x2a50b3){_0x2a50b3=_0x2a50b3||0xc8;return function(_0x529ebb){if(_0x529ebb){return _0x1921a4[_0x4d8a('0x18')](_0x2a50b3)[_0x4d8a('0x19')](_0x529ebb);}};}function respondWithFilteredResult(_0x3f1c1b,_0x2bcbcf){return function(_0x3e3063){if(_0x3e3063){var _0x1d2e51=typeof _0x2bcbcf[_0x4d8a('0x1a')]===_0x4d8a('0x1b')&&typeof _0x2bcbcf[_0x4d8a('0x1c')]===_0x4d8a('0x1b');var _0x5ea758=_0x3e3063['count'];var _0xbd1150=_0x1d2e51?0x0:_0x2bcbcf[_0x4d8a('0x1a')];var _0x472802=_0x1d2e51?_0x3e3063[_0x4d8a('0x1d')]:_0x2bcbcf[_0x4d8a('0x1a')]+_0x2bcbcf['limit'];var _0x6c16c6;if(_0x472802>=_0x5ea758){_0x472802=_0x5ea758;_0x6c16c6=0xc8;}else{_0x6c16c6=0xce;}_0x3f1c1b[_0x4d8a('0x18')](_0x6c16c6);return _0x3f1c1b['set']('Content-Range',_0xbd1150+'-'+_0x472802+'/'+_0x5ea758)['json'](_0x3e3063);}return null;};}function patchUpdates(_0x24759e){return function(_0xab1dae){try{jsonpatch[_0x4d8a('0x1e')](_0xab1dae,_0x24759e,!![]);}catch(_0xca1788){return BPromise[_0x4d8a('0x1f')](_0xca1788);}return _0xab1dae[_0x4d8a('0x20')]();};}function saveUpdates(_0x39bda7,_0x205354){return function(_0x3d55b9){if(_0x3d55b9){return _0x3d55b9[_0x4d8a('0x21')](_0x39bda7)[_0x4d8a('0x22')](function(_0x21aa10){return _0x21aa10;});}return null;};}function removeEntity(_0x4308ae,_0x46c897){return function(_0x1cf719){if(_0x1cf719){return _0x1cf719[_0x4d8a('0x23')]()[_0x4d8a('0x22')](function(){_0x4308ae[_0x4d8a('0x18')](0xcc)[_0x4d8a('0x17')]();});}};}function handleEntityNotFound(_0x275399,_0x328b0d){return function(_0x352c90){if(!_0x352c90){_0x275399['sendStatus'](0x194);}return _0x352c90;};}function handleError(_0x30dccb,_0x7cf88d){_0x7cf88d=_0x7cf88d||0x1f4;return function(_0x3c2017){logger[_0x4d8a('0x24')](_0x3c2017[_0x4d8a('0x25')]);if(_0x3c2017[_0x4d8a('0x26')]){delete _0x3c2017['name'];}_0x30dccb['status'](_0x7cf88d)[_0x4d8a('0x27')](_0x3c2017);};}exports['index']=function(_0x25a795,_0x3d8331){var _0x5b2531={},_0x538dd2={},_0x5321c1={'count':0x0,'rows':[]};var _0x5d1227=_[_0x4d8a('0x28')](db[_0x4d8a('0x29')][_0x4d8a('0x2a')],function(_0x31cdb1){return{'name':_0x31cdb1[_0x4d8a('0x2b')],'type':_0x31cdb1['type'][_0x4d8a('0x2c')]};});_0x538dd2[_0x4d8a('0x2d')]=_[_0x4d8a('0x28')](_0x5d1227,_0x4d8a('0x26'));_0x538dd2['query']=_['keys'](_0x25a795[_0x4d8a('0x2e')]);_0x538dd2['filters']=_[_0x4d8a('0x2f')](_0x538dd2[_0x4d8a('0x2d')],_0x538dd2[_0x4d8a('0x2e')]);_0x5b2531[_0x4d8a('0x30')]=_['intersection'](_0x538dd2[_0x4d8a('0x2d')],qs[_0x4d8a('0x31')](_0x25a795['query'][_0x4d8a('0x31')]));_0x5b2531[_0x4d8a('0x30')]=_0x5b2531[_0x4d8a('0x30')][_0x4d8a('0x32')]?_0x5b2531['attributes']:_0x538dd2[_0x4d8a('0x2d')];if(!_0x25a795[_0x4d8a('0x2e')][_0x4d8a('0x33')](_0x4d8a('0x34'))){_0x5b2531[_0x4d8a('0x1c')]=qs[_0x4d8a('0x1c')](_0x25a795['query'][_0x4d8a('0x1c')]);_0x5b2531[_0x4d8a('0x1a')]=qs[_0x4d8a('0x1a')](_0x25a795[_0x4d8a('0x2e')][_0x4d8a('0x1a')]);}_0x5b2531['order']=qs[_0x4d8a('0x35')](_0x25a795[_0x4d8a('0x2e')][_0x4d8a('0x35')]);_0x5b2531['where']=qs[_0x4d8a('0x36')](_[_0x4d8a('0x37')](_0x25a795['query'],_0x538dd2[_0x4d8a('0x36')]),_0x5d1227);if(_0x25a795[_0x4d8a('0x2e')][_0x4d8a('0x38')]){_0x5b2531[_0x4d8a('0x39')]=_[_0x4d8a('0x3a')](_0x5b2531[_0x4d8a('0x39')],{'$or':_[_0x4d8a('0x28')](_0x5d1227,function(_0x5781d0){if(_0x5781d0['type']!=='VIRTUAL'){var _0x4d6c53={};_0x4d6c53[_0x5781d0[_0x4d8a('0x26')]]={'$like':'%'+_0x25a795[_0x4d8a('0x2e')][_0x4d8a('0x38')]+'%'};return _0x4d6c53;}})});}_0x5b2531=_[_0x4d8a('0x3a')]({},_0x5b2531,_0x25a795['options']);var _0x1cded3={'where':_0x5b2531['where']};return db[_0x4d8a('0x29')]['count'](_0x1cded3)['then'](function(_0x1750d2){_0x5321c1['count']=_0x1750d2;if(_0x25a795['query'][_0x4d8a('0x3b')]){_0x5b2531[_0x4d8a('0x3c')]=[{'all':!![]}];}return db[_0x4d8a('0x29')][_0x4d8a('0x3d')](_0x5b2531);})[_0x4d8a('0x22')](function(_0x43252b){_0x5321c1[_0x4d8a('0x3e')]=_0x43252b;return _0x5321c1;})[_0x4d8a('0x22')](respondWithFilteredResult(_0x3d8331,_0x5b2531))['catch'](handleError(_0x3d8331,null));};exports[_0x4d8a('0x3f')]=function(_0x218fe2,_0x514fd4){var _0x412d32={'raw':!![],'where':{'id':_0x218fe2[_0x4d8a('0x40')]['id']}},_0x183a09={};_0x183a09[_0x4d8a('0x2d')]=_['keys'](db[_0x4d8a('0x29')][_0x4d8a('0x2a')]);_0x183a09['query']=_[_0x4d8a('0x41')](_0x218fe2[_0x4d8a('0x2e')]);_0x183a09[_0x4d8a('0x36')]=_[_0x4d8a('0x2f')](_0x183a09[_0x4d8a('0x2d')],_0x183a09[_0x4d8a('0x2e')]);_0x412d32[_0x4d8a('0x30')]=_['intersection'](_0x183a09[_0x4d8a('0x2d')],qs[_0x4d8a('0x31')](_0x218fe2['query'][_0x4d8a('0x31')]));_0x412d32[_0x4d8a('0x30')]=_0x412d32['attributes']['length']?_0x412d32['attributes']:_0x183a09[_0x4d8a('0x2d')];if(_0x218fe2['query']['includeAll']){_0x412d32[_0x4d8a('0x3c')]=[{'all':!![]}];}_0x412d32=_[_0x4d8a('0x3a')]({},_0x412d32,_0x218fe2[_0x4d8a('0x42')]);return db[_0x4d8a('0x29')][_0x4d8a('0x43')](_0x412d32)['then'](handleEntityNotFound(_0x514fd4,null))[_0x4d8a('0x22')](respondWithResult(_0x514fd4,null))[_0x4d8a('0x44')](handleError(_0x514fd4,null));};exports['create']=function(_0x504dd5,_0x565df6){return db[_0x4d8a('0x29')][_0x4d8a('0x45')](_0x504dd5['body'],{})[_0x4d8a('0x22')](respondWithResult(_0x565df6,0xc9))[_0x4d8a('0x44')](handleError(_0x565df6,null));};exports[_0x4d8a('0x21')]=function(_0x30006c,_0xc1639e){if(_0x30006c['body']['id']){delete _0x30006c['body']['id'];}return db[_0x4d8a('0x29')][_0x4d8a('0x43')]({'where':{'id':_0x30006c[_0x4d8a('0x40')]['id']}})[_0x4d8a('0x22')](handleEntityNotFound(_0xc1639e,null))['then'](saveUpdates(_0x30006c['body'],null))[_0x4d8a('0x22')](respondWithResult(_0xc1639e,null))[_0x4d8a('0x44')](handleError(_0xc1639e,null));};exports[_0x4d8a('0x23')]=function(_0x4a64b6,_0xe26b99){return db[_0x4d8a('0x29')][_0x4d8a('0x43')]({'where':{'id':_0x4a64b6[_0x4d8a('0x40')]['id']}})['then'](handleEntityNotFound(_0xe26b99,null))[_0x4d8a('0x22')](removeEntity(_0xe26b99,null))[_0x4d8a('0x44')](handleError(_0xe26b99,null));}; \ No newline at end of file +var _0x1689=['merge','options','findAll','rows','show','params','includeAll','catch','create','body','find','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x1ee950,_0x3cf36e){var _0x3b046b=function(_0x2951d0){while(--_0x2951d0){_0x1ee950['push'](_0x1ee950['shift']());}};_0x3b046b(++_0x3cf36e);}(_0x1689,0xed));var _0x9168=function(_0x270c7b,_0x36789a){_0x270c7b=_0x270c7b-0x0;var _0x101515=_0x1689[_0x270c7b];return _0x101515;};'use strict';var emlformat=require(_0x9168('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9168('0x1'));var rp=require('request-promise');var moment=require(_0x9168('0x2'));var BPromise=require(_0x9168('0x3'));var Mustache=require(_0x9168('0x4'));var util=require(_0x9168('0x5'));var path=require(_0x9168('0x6'));var sox=require(_0x9168('0x7'));var csv=require(_0x9168('0x8'));var ejs=require(_0x9168('0x9'));var fs=require('fs');var fs_extra=require(_0x9168('0xa'));var _=require(_0x9168('0xb'));var squel=require('squel');var crypto=require(_0x9168('0xc'));var jsforce=require(_0x9168('0xd'));var deskjs=require(_0x9168('0xe'));var toCsv=require(_0x9168('0x8'));var querystring=require(_0x9168('0xf'));var Papa=require(_0x9168('0x10'));var Redis=require('ioredis');var authService=require(_0x9168('0x11'));var qs=require(_0x9168('0x12'));var as=require(_0x9168('0x13'));var hardwareService=require(_0x9168('0x14'));var logger=require('../../config/logger')(_0x9168('0x15'));var utils=require(_0x9168('0x16'));var config=require(_0x9168('0x17'));var licenseUtil=require(_0x9168('0x18'));var db=require(_0x9168('0x19'))['db'];function respondWithStatusCode(_0x51f251,_0x44f95e){_0x44f95e=_0x44f95e||0xcc;return function(_0x850176){if(_0x850176){return _0x51f251[_0x9168('0x1a')](_0x44f95e);}return _0x51f251[_0x9168('0x1b')](_0x44f95e)[_0x9168('0x1c')]();};}function respondWithResult(_0x4cff03,_0xeca6af){_0xeca6af=_0xeca6af||0xc8;return function(_0x39bb6b){if(_0x39bb6b){return _0x4cff03['status'](_0xeca6af)['json'](_0x39bb6b);}};}function respondWithFilteredResult(_0x5b1c35,_0x3a087f){return function(_0x1ea3e1){if(_0x1ea3e1){var _0x3b9f5f=typeof _0x3a087f[_0x9168('0x1d')]==='undefined'&&typeof _0x3a087f[_0x9168('0x1e')]===_0x9168('0x1f');var _0x572cd0=_0x1ea3e1[_0x9168('0x20')];var _0x1c84e7=_0x3b9f5f?0x0:_0x3a087f[_0x9168('0x1d')];var _0x10646b=_0x3b9f5f?_0x1ea3e1[_0x9168('0x20')]:_0x3a087f[_0x9168('0x1d')]+_0x3a087f[_0x9168('0x1e')];var _0x5473ce;if(_0x10646b>=_0x572cd0){_0x10646b=_0x572cd0;_0x5473ce=0xc8;}else{_0x5473ce=0xce;}_0x5b1c35[_0x9168('0x1b')](_0x5473ce);return _0x5b1c35[_0x9168('0x21')](_0x9168('0x22'),_0x1c84e7+'-'+_0x10646b+'/'+_0x572cd0)[_0x9168('0x23')](_0x1ea3e1);}return null;};}function patchUpdates(_0x1c95b3){return function(_0x41a7f7){try{jsonpatch[_0x9168('0x24')](_0x41a7f7,_0x1c95b3,!![]);}catch(_0x16db2e){return BPromise['reject'](_0x16db2e);}return _0x41a7f7[_0x9168('0x25')]();};}function saveUpdates(_0x5eec1d,_0x523c75){return function(_0x1faffe){if(_0x1faffe){return _0x1faffe[_0x9168('0x26')](_0x5eec1d)['then'](function(_0x587018){return _0x587018;});}return null;};}function removeEntity(_0x18abc7,_0x230b81){return function(_0x34052e){if(_0x34052e){return _0x34052e['destroy']()[_0x9168('0x27')](function(){_0x18abc7[_0x9168('0x1b')](0xcc)[_0x9168('0x1c')]();});}};}function handleEntityNotFound(_0x3f9b72,_0x11779d){return function(_0x1c18ba){if(!_0x1c18ba){_0x3f9b72[_0x9168('0x1a')](0x194);}return _0x1c18ba;};}function handleError(_0x1c298d,_0x26813a){_0x26813a=_0x26813a||0x1f4;return function(_0x3431b6){logger[_0x9168('0x28')](_0x3431b6[_0x9168('0x29')]);if(_0x3431b6['name']){delete _0x3431b6[_0x9168('0x2a')];}_0x1c298d[_0x9168('0x1b')](_0x26813a)[_0x9168('0x2b')](_0x3431b6);};}exports[_0x9168('0x2c')]=function(_0x27538f,_0x4b42e6){var _0x4953e3={},_0x2526ae={},_0x5d436c={'count':0x0,'rows':[]};var _0xa77631=_[_0x9168('0x2d')](db[_0x9168('0x2e')][_0x9168('0x2f')],function(_0x3eb945){return{'name':_0x3eb945[_0x9168('0x30')],'type':_0x3eb945[_0x9168('0x31')][_0x9168('0x32')]};});_0x2526ae['model']=_[_0x9168('0x2d')](_0xa77631,_0x9168('0x2a'));_0x2526ae['query']=_['keys'](_0x27538f[_0x9168('0x33')]);_0x2526ae[_0x9168('0x34')]=_['intersection'](_0x2526ae[_0x9168('0x35')],_0x2526ae[_0x9168('0x33')]);_0x4953e3[_0x9168('0x36')]=_[_0x9168('0x37')](_0x2526ae[_0x9168('0x35')],qs[_0x9168('0x38')](_0x27538f['query'][_0x9168('0x38')]));_0x4953e3[_0x9168('0x36')]=_0x4953e3[_0x9168('0x36')][_0x9168('0x39')]?_0x4953e3[_0x9168('0x36')]:_0x2526ae[_0x9168('0x35')];if(!_0x27538f[_0x9168('0x33')][_0x9168('0x3a')]('nolimit')){_0x4953e3['limit']=qs[_0x9168('0x1e')](_0x27538f[_0x9168('0x33')][_0x9168('0x1e')]);_0x4953e3[_0x9168('0x1d')]=qs[_0x9168('0x1d')](_0x27538f[_0x9168('0x33')][_0x9168('0x1d')]);}_0x4953e3[_0x9168('0x3b')]=qs[_0x9168('0x3c')](_0x27538f['query']['sort']);_0x4953e3[_0x9168('0x3d')]=qs[_0x9168('0x34')](_[_0x9168('0x3e')](_0x27538f[_0x9168('0x33')],_0x2526ae['filters']),_0xa77631);if(_0x27538f[_0x9168('0x33')]['filter']){_0x4953e3[_0x9168('0x3d')]=_[_0x9168('0x3f')](_0x4953e3[_0x9168('0x3d')],{'$or':_[_0x9168('0x2d')](_0xa77631,function(_0x3778b0){if(_0x3778b0[_0x9168('0x31')]!=='VIRTUAL'){var _0x56fed0={};_0x56fed0[_0x3778b0[_0x9168('0x2a')]]={'$like':'%'+_0x27538f[_0x9168('0x33')]['filter']+'%'};return _0x56fed0;}})});}_0x4953e3=_[_0x9168('0x3f')]({},_0x4953e3,_0x27538f[_0x9168('0x40')]);var _0x36afff={'where':_0x4953e3[_0x9168('0x3d')]};return db['AnalyticTreeReport'][_0x9168('0x20')](_0x36afff)[_0x9168('0x27')](function(_0xc89e60){_0x5d436c['count']=_0xc89e60;if(_0x27538f[_0x9168('0x33')]['includeAll']){_0x4953e3['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x9168('0x41')](_0x4953e3);})[_0x9168('0x27')](function(_0x243e75){_0x5d436c[_0x9168('0x42')]=_0x243e75;return _0x5d436c;})[_0x9168('0x27')](respondWithFilteredResult(_0x4b42e6,_0x4953e3))['catch'](handleError(_0x4b42e6,null));};exports[_0x9168('0x43')]=function(_0x136d1b,_0x2c98b3){var _0x18711f={'raw':!![],'where':{'id':_0x136d1b[_0x9168('0x44')]['id']}},_0x5de7f0={};_0x5de7f0['model']=_['keys'](db[_0x9168('0x2e')]['rawAttributes']);_0x5de7f0[_0x9168('0x33')]=_['keys'](_0x136d1b[_0x9168('0x33')]);_0x5de7f0[_0x9168('0x34')]=_[_0x9168('0x37')](_0x5de7f0[_0x9168('0x35')],_0x5de7f0['query']);_0x18711f['attributes']=_['intersection'](_0x5de7f0[_0x9168('0x35')],qs['fields'](_0x136d1b['query'][_0x9168('0x38')]));_0x18711f[_0x9168('0x36')]=_0x18711f[_0x9168('0x36')]['length']?_0x18711f[_0x9168('0x36')]:_0x5de7f0[_0x9168('0x35')];if(_0x136d1b[_0x9168('0x33')][_0x9168('0x45')]){_0x18711f['include']=[{'all':!![]}];}_0x18711f=_['merge']({},_0x18711f,_0x136d1b[_0x9168('0x40')]);return db['AnalyticTreeReport']['find'](_0x18711f)[_0x9168('0x27')](handleEntityNotFound(_0x2c98b3,null))[_0x9168('0x27')](respondWithResult(_0x2c98b3,null))[_0x9168('0x46')](handleError(_0x2c98b3,null));};exports[_0x9168('0x47')]=function(_0x8c2c4,_0x5dcfa2){return db[_0x9168('0x2e')][_0x9168('0x47')](_0x8c2c4[_0x9168('0x48')],{})[_0x9168('0x27')](respondWithResult(_0x5dcfa2,0xc9))[_0x9168('0x46')](handleError(_0x5dcfa2,null));};exports[_0x9168('0x26')]=function(_0x5542e0,_0x31b9f2){if(_0x5542e0[_0x9168('0x48')]['id']){delete _0x5542e0[_0x9168('0x48')]['id'];}return db[_0x9168('0x2e')][_0x9168('0x49')]({'where':{'id':_0x5542e0['params']['id']}})[_0x9168('0x27')](handleEntityNotFound(_0x31b9f2,null))[_0x9168('0x27')](saveUpdates(_0x5542e0['body'],null))['then'](respondWithResult(_0x31b9f2,null))['catch'](handleError(_0x31b9f2,null));};exports[_0x9168('0x4a')]=function(_0x2dad01,_0x54aa4){return db['AnalyticTreeReport'][_0x9168('0x49')]({'where':{'id':_0x2dad01['params']['id']}})[_0x9168('0x27')](handleEntityNotFound(_0x54aa4,null))[_0x9168('0x27')](removeEntity(_0x54aa4,null))[_0x9168('0x46')](handleError(_0x54aa4,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 7ba807a..465a89d 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 _0x5237=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','request-promise'];(function(_0x318bd0,_0x5349af){var _0x30bb38=function(_0x471d1b){while(--_0x471d1b){_0x318bd0['push'](_0x318bd0['shift']());}};_0x30bb38(++_0x5349af);}(_0x5237,0x1d0));var _0x7523=function(_0x31daf1,_0x2815c2){_0x31daf1=_0x31daf1-0x0;var _0x33e2c9=_0x5237[_0x31daf1];return _0x33e2c9;};'use strict';var _=require('lodash');var util=require(_0x7523('0x0'));var logger=require(_0x7523('0x1'))(_0x7523('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7523('0x3'));var fs=require('fs');var path=require(_0x7523('0x4'));var rimraf=require(_0x7523('0x5'));var config=require(_0x7523('0x6'));var attributes=require(_0x7523('0x7'));module[_0x7523('0x8')]=function(_0x2e371e,_0x47789a){return _0x2e371e[_0x7523('0x9')](_0x7523('0xa'),attributes,{'tableName':_0x7523('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa1d=['request-promise','exports','define','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird'];(function(_0x19895c,_0x4fa5eb){var _0x483499=function(_0x585515){while(--_0x585515){_0x19895c['push'](_0x19895c['shift']());}};_0x483499(++_0x4fa5eb);}(_0xaa1d,0x199));var _0xdaa1=function(_0xf6937b,_0x4ea035){_0xf6937b=_0xf6937b-0x0;var _0xacf02c=_0xaa1d[_0xf6937b];return _0xacf02c;};'use strict';var _=require(_0xdaa1('0x0'));var util=require('util');var logger=require(_0xdaa1('0x1'))(_0xdaa1('0x2'));var moment=require(_0xdaa1('0x3'));var BPromise=require(_0xdaa1('0x4'));var rp=require(_0xdaa1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xdaa1('0x6')]=function(_0x499909,_0x3e0fd4){return _0x499909[_0xdaa1('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0xdaa1('0x8'),'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 7e781e2..0a7b50e 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x48a17b,_0x15fe4b){var _0x3170db=function(_0x46bee6){while(--_0x46bee6){_0x48a17b['push'](_0x48a17b['shift']());}};_0x3170db(++_0x15fe4b);}(_0xadb5,0xad));var _0x5adb=function(_0x13db55,_0x2cb7c2){_0x13db55=_0x13db55-0x0;var _0x16991c=_0xadb5[_0x13db55];return _0x16991c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x5bb9d4,_0x1a079d){_0x5bb9d4=_0x5bb9d4-0x0;var _0x4e6141=_0x7a54[_0x5bb9d4];return _0x4e6141;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 28cd4da..588589a 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 _0x3e11=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','create','put','delete','/:id','destroy','multer','util'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x3e11,0x14e));var _0x13e1=function(_0x48e980,_0x5dd543){_0x48e980=_0x48e980-0x0;var _0x4eb8d6=_0x3e11[_0x48e980];return _0x4eb8d6;};'use strict';var multer=require(_0x13e1('0x0'));var util=require(_0x13e1('0x1'));var path=require('path');var timeout=require(_0x13e1('0x2'));var express=require(_0x13e1('0x3'));var router=express[_0x13e1('0x4')]();var fs_extra=require(_0x13e1('0x5'));var auth=require(_0x13e1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x13e1('0x7'));var controller=require(_0x13e1('0x8'));router[_0x13e1('0x9')]('/',auth[_0x13e1('0xa')](),controller['index']);router[_0x13e1('0x9')]('/:id',auth[_0x13e1('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x13e1('0xb')]);router[_0x13e1('0xc')]('/:id',auth[_0x13e1('0xa')](),controller['update']);router[_0x13e1('0xd')](_0x13e1('0xe'),auth['isAuthenticated'](),controller[_0x13e1('0xf')]);module['exports']=router; \ No newline at end of file +var _0xddab=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','show','create','put','/:id','update','exports','multer','util','path','express'];(function(_0x382b7a,_0x373cdf){var _0x4db5f0=function(_0xb377de){while(--_0xb377de){_0x382b7a['push'](_0x382b7a['shift']());}};_0x4db5f0(++_0x373cdf);}(_0xddab,0x14c));var _0xbdda=function(_0x3b24d0,_0x207bbe){_0x3b24d0=_0x3b24d0-0x0;var _0x33ad77=_0xddab[_0x3b24d0];return _0x33ad77;};'use strict';var multer=require(_0xbdda('0x0'));var util=require(_0xbdda('0x1'));var path=require(_0xbdda('0x2'));var timeout=require('connect-timeout');var express=require(_0xbdda('0x3'));var router=express[_0xbdda('0x4')]();var fs_extra=require(_0xbdda('0x5'));var auth=require(_0xbdda('0x6'));var interaction=require(_0xbdda('0x7'));var config=require(_0xbdda('0x8'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xbdda('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbdda('0xa')]);router['post']('/',auth[_0xbdda('0x9')](),controller[_0xbdda('0xb')]);router[_0xbdda('0xc')](_0xbdda('0xd'),auth[_0xbdda('0x9')](),controller[_0xbdda('0xe')]);router['delete'](_0xbdda('0xd'),auth[_0xbdda('0x9')](),controller['destroy']);module[_0xbdda('0xf')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 3b3f758..942ee70 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 _0xcdd0=['STRING','sequelize','exports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcdd0[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x0cdd('0x0'));module[_0x0cdd('0x1')]={'name':{'type':Sequelize[_0x0cdd('0x2')]},'basename':{'type':Sequelize[_0x0cdd('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xea89=['exports','STRING','sequelize'];(function(_0x370165,_0x5aa0b9){var _0x97c99b=function(_0x672c33){while(--_0x672c33){_0x370165['push'](_0x370165['shift']());}};_0x97c99b(++_0x5aa0b9);}(_0xea89,0x1e2));var _0x9ea8=function(_0x47c53e,_0x4e03ba){_0x47c53e=_0x47c53e-0x0;var _0x30cc26=_0xea89[_0x47c53e];return _0x30cc26;};'use strict';var Sequelize=require(_0x9ea8('0x0'));module[_0x9ea8('0x1')]={'name':{'type':Sequelize[_0x9ea8('0x2')]},'basename':{'type':Sequelize[_0x9ea8('0x2')]},'type':{'type':Sequelize[_0x9ea8('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index f8304c0..75f931c 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 _0x3517=['body','create','originalname','basename','file','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','include','Attachment','findAll','catch','show','params','rawAttributes','clone','includeAll','options','find','get','omit','createdAt','updatedAt'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0x3517,0x10e));var _0x7351=function(_0x27c488,_0x4daf3f){_0x27c488=_0x27c488-0x0;var _0x311551=_0x3517[_0x27c488];return _0x311551;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7351('0x0'));var zipdir=require(_0x7351('0x1'));var jsonpatch=require(_0x7351('0x2'));var rp=require(_0x7351('0x3'));var moment=require('moment');var BPromise=require(_0x7351('0x4'));var Mustache=require(_0x7351('0x5'));var util=require(_0x7351('0x6'));var path=require(_0x7351('0x7'));var sox=require(_0x7351('0x8'));var csv=require('to-csv');var ejs=require(_0x7351('0x9'));var fs=require('fs');var fs_extra=require(_0x7351('0xa'));var _=require(_0x7351('0xb'));var squel=require(_0x7351('0xc'));var crypto=require(_0x7351('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7351('0xe'));var Papa=require(_0x7351('0xf'));var Redis=require(_0x7351('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7351('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7351('0x12'))(_0x7351('0x13'));var utils=require(_0x7351('0x14'));var config=require(_0x7351('0x15'));var licenseUtil=require(_0x7351('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26104d,_0x439d5e){_0x439d5e=_0x439d5e||0xcc;return function(_0x62e355){if(_0x62e355){return _0x26104d[_0x7351('0x17')](_0x439d5e);}return _0x26104d[_0x7351('0x18')](_0x439d5e)[_0x7351('0x19')]();};}function respondWithResult(_0x4a3ea8,_0x8da03a){_0x8da03a=_0x8da03a||0xc8;return function(_0x3fcde3){if(_0x3fcde3){return _0x4a3ea8[_0x7351('0x18')](_0x8da03a)['json'](_0x3fcde3);}};}function respondWithFilteredResult(_0x3b79ae,_0x49a4a6){return function(_0xd5cce6){if(_0xd5cce6){var _0x7750fc=typeof _0x49a4a6[_0x7351('0x1a')]===_0x7351('0x1b')&&typeof _0x49a4a6[_0x7351('0x1c')]===_0x7351('0x1b');var _0x350768=_0xd5cce6[_0x7351('0x1d')];var _0x47e812=_0x7750fc?0x0:_0x49a4a6[_0x7351('0x1a')];var _0x154a71=_0x7750fc?_0xd5cce6['count']:_0x49a4a6[_0x7351('0x1a')]+_0x49a4a6[_0x7351('0x1c')];var _0x5eb7ae;if(_0x154a71>=_0x350768){_0x154a71=_0x350768;_0x5eb7ae=0xc8;}else{_0x5eb7ae=0xce;}_0x3b79ae[_0x7351('0x18')](_0x5eb7ae);return _0x3b79ae[_0x7351('0x1e')]('Content-Range',_0x47e812+'-'+_0x154a71+'/'+_0x350768)['json'](_0xd5cce6);}return null;};}function patchUpdates(_0x55513e){return function(_0xc732e4){try{jsonpatch[_0x7351('0x1f')](_0xc732e4,_0x55513e,!![]);}catch(_0xfe5b3b){return BPromise['reject'](_0xfe5b3b);}return _0xc732e4[_0x7351('0x20')]();};}function saveUpdates(_0x344865,_0x3f9735){return function(_0x3c4e6a){if(_0x3c4e6a){return _0x3c4e6a['update'](_0x344865)[_0x7351('0x21')](function(_0x5efc5a){return _0x5efc5a;});}return null;};}function removeEntity(_0x158775,_0x495252){return function(_0x45f7d0){if(_0x45f7d0){return _0x45f7d0[_0x7351('0x22')]()[_0x7351('0x21')](function(){_0x158775[_0x7351('0x18')](0xcc)[_0x7351('0x19')]();});}};}function handleEntityNotFound(_0x7655d1,_0x6ee3b7){return function(_0x3e15d4){if(!_0x3e15d4){_0x7655d1[_0x7351('0x17')](0x194);}return _0x3e15d4;};}function handleError(_0x14d75d,_0x1eb279){_0x1eb279=_0x1eb279||0x1f4;return function(_0x29d43c){logger[_0x7351('0x23')](_0x29d43c[_0x7351('0x24')]);if(_0x29d43c['name']){delete _0x29d43c[_0x7351('0x25')];}_0x14d75d[_0x7351('0x18')](_0x1eb279)[_0x7351('0x26')](_0x29d43c);};}exports[_0x7351('0x27')]=function(_0x41dc33,_0x1a0e68){var _0x449ce3={},_0xba22fd={},_0x2ea8e3={'count':0x0,'rows':[]};var _0x23ce10=_[_0x7351('0x28')](db['Attachment']['rawAttributes'],function(_0x3aa844){return{'name':_0x3aa844[_0x7351('0x29')],'type':_0x3aa844[_0x7351('0x2a')][_0x7351('0x2b')]};});_0xba22fd['model']=_[_0x7351('0x28')](_0x23ce10,_0x7351('0x25'));_0xba22fd[_0x7351('0x2c')]=_[_0x7351('0x2d')](_0x41dc33[_0x7351('0x2c')]);_0xba22fd['filters']=_[_0x7351('0x2e')](_0xba22fd['model'],_0xba22fd[_0x7351('0x2c')]);_0x449ce3['attributes']=_[_0x7351('0x2e')](_0xba22fd[_0x7351('0x2f')],qs[_0x7351('0x30')](_0x41dc33[_0x7351('0x2c')]['fields']));_0x449ce3[_0x7351('0x31')]=_0x449ce3[_0x7351('0x31')][_0x7351('0x32')]?_0x449ce3[_0x7351('0x31')]:_0xba22fd[_0x7351('0x2f')];if(!_0x41dc33[_0x7351('0x2c')][_0x7351('0x33')](_0x7351('0x34'))){_0x449ce3['limit']=qs['limit'](_0x41dc33['query'][_0x7351('0x1c')]);_0x449ce3[_0x7351('0x1a')]=qs[_0x7351('0x1a')](_0x41dc33[_0x7351('0x2c')][_0x7351('0x1a')]);}_0x449ce3[_0x7351('0x35')]=qs['sort'](_0x41dc33['query']['sort']);_0x449ce3[_0x7351('0x36')]=qs[_0x7351('0x37')](_[_0x7351('0x38')](_0x41dc33[_0x7351('0x2c')],_0xba22fd['filters']),_0x23ce10);if(_0x41dc33[_0x7351('0x2c')][_0x7351('0x39')]){_0x449ce3['where']=_[_0x7351('0x3a')](_0x449ce3[_0x7351('0x36')],{'$or':_[_0x7351('0x28')](_0x23ce10,function(_0x5f1285){if(_0x5f1285[_0x7351('0x2a')]!=='VIRTUAL'){var _0x198bee={};_0x198bee[_0x5f1285[_0x7351('0x25')]]={'$like':'%'+_0x41dc33[_0x7351('0x2c')][_0x7351('0x39')]+'%'};return _0x198bee;}})});}_0x449ce3=_[_0x7351('0x3a')]({},_0x449ce3,_0x41dc33['options']);var _0x52974c={'where':_0x449ce3[_0x7351('0x36')]};return db['Attachment']['count'](_0x52974c)[_0x7351('0x21')](function(_0x3a639c){_0x2ea8e3[_0x7351('0x1d')]=_0x3a639c;if(_0x41dc33[_0x7351('0x2c')]['includeAll']){_0x449ce3[_0x7351('0x3b')]=[{'all':!![]}];}return db[_0x7351('0x3c')][_0x7351('0x3d')](_0x449ce3);})[_0x7351('0x21')](function(_0x1b257f){_0x2ea8e3['rows']=_0x1b257f;return _0x2ea8e3;})[_0x7351('0x21')](respondWithFilteredResult(_0x1a0e68,_0x449ce3))[_0x7351('0x3e')](handleError(_0x1a0e68,null));};exports[_0x7351('0x3f')]=function(_0x1a2dc9,_0x509009){var _0x46e5e2={'raw':!![],'where':{'id':_0x1a2dc9[_0x7351('0x40')]['id']}},_0x2c3e00={};_0x2c3e00['model']=_[_0x7351('0x2d')](db[_0x7351('0x3c')][_0x7351('0x41')]);_0x2c3e00[_0x7351('0x2c')]=_['keys'](_0x1a2dc9[_0x7351('0x2c')]);_0x2c3e00['filters']=_['intersection'](_0x2c3e00[_0x7351('0x2f')],_0x2c3e00[_0x7351('0x2c')]);_0x46e5e2['attributes']=_['intersection'](_0x2c3e00[_0x7351('0x2f')],qs[_0x7351('0x30')](_0x1a2dc9[_0x7351('0x2c')][_0x7351('0x30')]));_0x46e5e2[_0x7351('0x31')]=_0x46e5e2[_0x7351('0x31')]['length']?_0x46e5e2[_0x7351('0x31')]:_0x2c3e00['model'];if(_0x1a2dc9['query']['includeAll']){_0x46e5e2['include']=[{'all':!![]}];}_0x46e5e2=_[_0x7351('0x3a')]({},_0x46e5e2,_0x1a2dc9['options']);return db[_0x7351('0x3c')]['find'](_0x46e5e2)[_0x7351('0x21')](handleEntityNotFound(_0x509009,null))[_0x7351('0x21')](respondWithResult(_0x509009,null))[_0x7351('0x3e')](handleError(_0x509009,null));};exports[_0x7351('0x42')]=function(_0x41ef71,_0x305d0f){var _0x44af4f={'where':{'id':_0x41ef71[_0x7351('0x40')]['id']}},_0x4f3d80={};_0x4f3d80[_0x7351('0x2f')]=_['keys'](db[_0x7351('0x3c')][_0x7351('0x41')]);_0x44af4f[_0x7351('0x31')]=_[_0x7351('0x2e')](_0x4f3d80[_0x7351('0x2f')],qs[_0x7351('0x30')](_0x41ef71[_0x7351('0x2c')][_0x7351('0x30')]));_0x44af4f[_0x7351('0x31')]=_0x44af4f[_0x7351('0x31')][_0x7351('0x32')]?_0x44af4f['attributes']:_0x4f3d80[_0x7351('0x2f')];if(_0x41ef71[_0x7351('0x2c')][_0x7351('0x43')]){_0x44af4f[_0x7351('0x3b')]=[{'all':!![]}];}_0x44af4f=_['merge']({},_0x44af4f,_0x41ef71[_0x7351('0x44')]);return db[_0x7351('0x3c')][_0x7351('0x45')](_0x44af4f)[_0x7351('0x21')](handleEntityNotFound(_0x305d0f,null))['then'](function(_0x3a49b4){if(_0x3a49b4){var _0x2ee1d3=_0x3a49b4[_0x7351('0x46')]({'plain':!![]});_0x2ee1d3=qs[_0x7351('0x47')](_0x2ee1d3,['id',_0x7351('0x48'),_0x7351('0x49')]);_0x41ef71[_0x7351('0x4a')]=_[_0x7351('0x47')](_0x41ef71[_0x7351('0x4a')],['id',_0x7351('0x48'),'updatedAt']);return db[_0x7351('0x3c')]['create'](_[_0x7351('0x3a')](_0x2ee1d3,_0x41ef71[_0x7351('0x4a')]),{'include':_0x41ef71['query'][_0x7351('0x43')]?[{'all':!![]}]:undefined});}})[_0x7351('0x21')](respondWithResult(_0x305d0f,0xc9))['catch'](handleError(_0x305d0f,null));};exports['update']=function(_0x32e593,_0xde95bb){if(_0x32e593[_0x7351('0x4a')]['id']){delete _0x32e593[_0x7351('0x4a')]['id'];}return db[_0x7351('0x3c')][_0x7351('0x45')]({'where':{'id':_0x32e593[_0x7351('0x40')]['id']}})[_0x7351('0x21')](handleEntityNotFound(_0xde95bb,null))['then'](saveUpdates(_0x32e593[_0x7351('0x4a')],null))[_0x7351('0x21')](respondWithResult(_0xde95bb,null))['catch'](handleError(_0xde95bb,null));};exports[_0x7351('0x22')]=function(_0x249323,_0x8fccf9){return db[_0x7351('0x3c')][_0x7351('0x45')]({'where':{'id':_0x249323['params']['id']}})[_0x7351('0x21')](handleEntityNotFound(_0x8fccf9,null))[_0x7351('0x21')](removeEntity(_0x8fccf9,null))[_0x7351('0x3e')](handleError(_0x8fccf9,null));};exports[_0x7351('0x4b')]=function(_0x3f5a55,_0x24d02c,_0x346439){_0x3f5a55[_0x7351('0x4a')][_0x7351('0x25')]=_0x3f5a55['file'][_0x7351('0x4c')];_0x3f5a55['body'][_0x7351('0x4d')]=_0x3f5a55['file']['filename'];_0x3f5a55[_0x7351('0x4a')]['type']=_0x3f5a55[_0x7351('0x4e')][_0x7351('0x4f')];return db[_0x7351('0x3c')][_0x7351('0x4b')](_0x3f5a55['body'])['then'](respondWithResult(_0x24d02c,0xc9))[_0x7351('0x3e')](handleError(_0x24d02c,null));};exports[_0x7351('0x50')]=function(_0x4ae860,_0x29171a,_0xae54ed){return db[_0x7351('0x3c')]['findOne']({'where':{'id':_0x4ae860[_0x7351('0x40')]['id']},'raw':!![]})[_0x7351('0x21')](handleEntityNotFound(_0x29171a,null))[_0x7351('0x21')](function(_0x4cbef1){if(_0x4cbef1){var _0x2cd021=_0x4cbef1[_0x7351('0x51')]!==null;var _0x1ce7fc=path[_0x7351('0x52')](config[_0x7351('0x53')],_0x7351('0x54'));if(_0x2cd021){_0x1ce7fc=path[_0x7351('0x52')](_0x1ce7fc,_0x7351('0x55'));}var _0x189d85=path['join'](_0x1ce7fc,_0x4cbef1[_0x7351('0x4d')]);return _0x29171a['download'](_0x189d85);}})[_0x7351('0x3e')](handleError(_0x29171a,null));}; \ No newline at end of file +var _0x61f3=['bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','destroy','then','stack','name','send','index','Attachment','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','includeAll','findAll','rows','catch','show','params','rawAttributes','merge','options','find','clone','get','omit','createdAt','updatedAt','body','file','originalname','basename','filename','mimetype','create','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3de82a,_0x43db07){var _0xee4f52=function(_0x2b655a){while(--_0x2b655a){_0x3de82a['push'](_0x3de82a['shift']());}};_0xee4f52(++_0x43db07);}(_0x61f3,0x105));var _0x361f=function(_0x318b0b,_0xe51a61){_0x318b0b=_0x318b0b-0x0;var _0x5e74b6=_0x61f3[_0x318b0b];return _0x5e74b6;};'use strict';var emlformat=require(_0x361f('0x0'));var rimraf=require(_0x361f('0x1'));var zipdir=require(_0x361f('0x2'));var jsonpatch=require(_0x361f('0x3'));var rp=require(_0x361f('0x4'));var moment=require(_0x361f('0x5'));var BPromise=require(_0x361f('0x6'));var Mustache=require('mustache');var util=require(_0x361f('0x7'));var path=require(_0x361f('0x8'));var sox=require(_0x361f('0x9'));var csv=require(_0x361f('0xa'));var ejs=require(_0x361f('0xb'));var fs=require('fs');var fs_extra=require(_0x361f('0xc'));var _=require(_0x361f('0xd'));var squel=require(_0x361f('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x361f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x361f('0x10'));var Papa=require('papaparse');var Redis=require(_0x361f('0x11'));var authService=require(_0x361f('0x12'));var qs=require(_0x361f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x361f('0x14'));var logger=require(_0x361f('0x15'))(_0x361f('0x16'));var utils=require('../../config/utils');var config=require(_0x361f('0x17'));var licenseUtil=require(_0x361f('0x18'));var db=require(_0x361f('0x19'))['db'];function respondWithStatusCode(_0x24a7f9,_0x4b3974){_0x4b3974=_0x4b3974||0xcc;return function(_0x48ff8d){if(_0x48ff8d){return _0x24a7f9[_0x361f('0x1a')](_0x4b3974);}return _0x24a7f9[_0x361f('0x1b')](_0x4b3974)[_0x361f('0x1c')]();};}function respondWithResult(_0x5d9c32,_0x24676b){_0x24676b=_0x24676b||0xc8;return function(_0x232e3c){if(_0x232e3c){return _0x5d9c32['status'](_0x24676b)[_0x361f('0x1d')](_0x232e3c);}};}function respondWithFilteredResult(_0x434d01,_0x28e93b){return function(_0x1f7dc4){if(_0x1f7dc4){var _0x3e0a97=typeof _0x28e93b['offset']===_0x361f('0x1e')&&typeof _0x28e93b[_0x361f('0x1f')]==='undefined';var _0x4c8ef9=_0x1f7dc4['count'];var _0x3cf294=_0x3e0a97?0x0:_0x28e93b['offset'];var _0x29c9b9=_0x3e0a97?_0x1f7dc4[_0x361f('0x20')]:_0x28e93b[_0x361f('0x21')]+_0x28e93b[_0x361f('0x1f')];var _0x17659d;if(_0x29c9b9>=_0x4c8ef9){_0x29c9b9=_0x4c8ef9;_0x17659d=0xc8;}else{_0x17659d=0xce;}_0x434d01['status'](_0x17659d);return _0x434d01['set'](_0x361f('0x22'),_0x3cf294+'-'+_0x29c9b9+'/'+_0x4c8ef9)[_0x361f('0x1d')](_0x1f7dc4);}return null;};}function patchUpdates(_0x21b178){return function(_0x5e76f3){try{jsonpatch['apply'](_0x5e76f3,_0x21b178,!![]);}catch(_0x2f3ce0){return BPromise[_0x361f('0x23')](_0x2f3ce0);}return _0x5e76f3[_0x361f('0x24')]();};}function saveUpdates(_0x2a80e1,_0x4157c3){return function(_0x58235e){if(_0x58235e){return _0x58235e['update'](_0x2a80e1)['then'](function(_0x34b853){return _0x34b853;});}return null;};}function removeEntity(_0x493615,_0x5985a8){return function(_0xa5aedb){if(_0xa5aedb){return _0xa5aedb[_0x361f('0x25')]()[_0x361f('0x26')](function(){_0x493615[_0x361f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e75d4,_0x2ef66c){return function(_0x17126c){if(!_0x17126c){_0x4e75d4[_0x361f('0x1a')](0x194);}return _0x17126c;};}function handleError(_0x2cf6ea,_0x6588e2){_0x6588e2=_0x6588e2||0x1f4;return function(_0x5bda96){logger['error'](_0x5bda96[_0x361f('0x27')]);if(_0x5bda96[_0x361f('0x28')]){delete _0x5bda96['name'];}_0x2cf6ea[_0x361f('0x1b')](_0x6588e2)[_0x361f('0x29')](_0x5bda96);};}exports[_0x361f('0x2a')]=function(_0x4a9cf4,_0x5d8ae6){var _0x1f1bae={},_0xfa8cfa={},_0x29e891={'count':0x0,'rows':[]};var _0x21ab79=_['map'](db[_0x361f('0x2b')]['rawAttributes'],function(_0x227a88){return{'name':_0x227a88['fieldName'],'type':_0x227a88[_0x361f('0x2c')][_0x361f('0x2d')]};});_0xfa8cfa[_0x361f('0x2e')]=_['map'](_0x21ab79,_0x361f('0x28'));_0xfa8cfa[_0x361f('0x2f')]=_[_0x361f('0x30')](_0x4a9cf4[_0x361f('0x2f')]);_0xfa8cfa[_0x361f('0x31')]=_['intersection'](_0xfa8cfa[_0x361f('0x2e')],_0xfa8cfa[_0x361f('0x2f')]);_0x1f1bae['attributes']=_[_0x361f('0x32')](_0xfa8cfa['model'],qs[_0x361f('0x33')](_0x4a9cf4[_0x361f('0x2f')][_0x361f('0x33')]));_0x1f1bae[_0x361f('0x34')]=_0x1f1bae['attributes'][_0x361f('0x35')]?_0x1f1bae[_0x361f('0x34')]:_0xfa8cfa['model'];if(!_0x4a9cf4['query'][_0x361f('0x36')](_0x361f('0x37'))){_0x1f1bae[_0x361f('0x1f')]=qs[_0x361f('0x1f')](_0x4a9cf4['query']['limit']);_0x1f1bae['offset']=qs['offset'](_0x4a9cf4[_0x361f('0x2f')]['offset']);}_0x1f1bae[_0x361f('0x38')]=qs[_0x361f('0x39')](_0x4a9cf4['query'][_0x361f('0x39')]);_0x1f1bae['where']=qs[_0x361f('0x31')](_[_0x361f('0x3a')](_0x4a9cf4['query'],_0xfa8cfa[_0x361f('0x31')]),_0x21ab79);if(_0x4a9cf4[_0x361f('0x2f')][_0x361f('0x3b')]){_0x1f1bae[_0x361f('0x3c')]=_['merge'](_0x1f1bae[_0x361f('0x3c')],{'$or':_['map'](_0x21ab79,function(_0x3dce73){if(_0x3dce73['type']!=='VIRTUAL'){var _0x4e6ce4={};_0x4e6ce4[_0x3dce73[_0x361f('0x28')]]={'$like':'%'+_0x4a9cf4[_0x361f('0x2f')][_0x361f('0x3b')]+'%'};return _0x4e6ce4;}})});}_0x1f1bae=_['merge']({},_0x1f1bae,_0x4a9cf4['options']);var _0x48ca69={'where':_0x1f1bae[_0x361f('0x3c')]};return db[_0x361f('0x2b')]['count'](_0x48ca69)[_0x361f('0x26')](function(_0x559a1c){_0x29e891[_0x361f('0x20')]=_0x559a1c;if(_0x4a9cf4[_0x361f('0x2f')][_0x361f('0x3d')]){_0x1f1bae['include']=[{'all':!![]}];}return db['Attachment'][_0x361f('0x3e')](_0x1f1bae);})['then'](function(_0x3dc287){_0x29e891[_0x361f('0x3f')]=_0x3dc287;return _0x29e891;})[_0x361f('0x26')](respondWithFilteredResult(_0x5d8ae6,_0x1f1bae))[_0x361f('0x40')](handleError(_0x5d8ae6,null));};exports[_0x361f('0x41')]=function(_0x562c23,_0x303942){var _0xf03b24={'raw':!![],'where':{'id':_0x562c23[_0x361f('0x42')]['id']}},_0x17ac2b={};_0x17ac2b[_0x361f('0x2e')]=_['keys'](db['Attachment'][_0x361f('0x43')]);_0x17ac2b[_0x361f('0x2f')]=_[_0x361f('0x30')](_0x562c23[_0x361f('0x2f')]);_0x17ac2b[_0x361f('0x31')]=_[_0x361f('0x32')](_0x17ac2b[_0x361f('0x2e')],_0x17ac2b['query']);_0xf03b24['attributes']=_[_0x361f('0x32')](_0x17ac2b[_0x361f('0x2e')],qs[_0x361f('0x33')](_0x562c23[_0x361f('0x2f')][_0x361f('0x33')]));_0xf03b24[_0x361f('0x34')]=_0xf03b24['attributes']['length']?_0xf03b24[_0x361f('0x34')]:_0x17ac2b[_0x361f('0x2e')];if(_0x562c23[_0x361f('0x2f')][_0x361f('0x3d')]){_0xf03b24['include']=[{'all':!![]}];}_0xf03b24=_[_0x361f('0x44')]({},_0xf03b24,_0x562c23[_0x361f('0x45')]);return db[_0x361f('0x2b')][_0x361f('0x46')](_0xf03b24)['then'](handleEntityNotFound(_0x303942,null))['then'](respondWithResult(_0x303942,null))[_0x361f('0x40')](handleError(_0x303942,null));};exports[_0x361f('0x47')]=function(_0x5d20f1,_0x40fa04){var _0x5d4453={'where':{'id':_0x5d20f1[_0x361f('0x42')]['id']}},_0xb7d231={};_0xb7d231[_0x361f('0x2e')]=_[_0x361f('0x30')](db[_0x361f('0x2b')][_0x361f('0x43')]);_0x5d4453[_0x361f('0x34')]=_[_0x361f('0x32')](_0xb7d231[_0x361f('0x2e')],qs[_0x361f('0x33')](_0x5d20f1['query']['fields']));_0x5d4453[_0x361f('0x34')]=_0x5d4453[_0x361f('0x34')]['length']?_0x5d4453[_0x361f('0x34')]:_0xb7d231[_0x361f('0x2e')];if(_0x5d20f1['query'][_0x361f('0x3d')]){_0x5d4453['include']=[{'all':!![]}];}_0x5d4453=_[_0x361f('0x44')]({},_0x5d4453,_0x5d20f1[_0x361f('0x45')]);return db[_0x361f('0x2b')][_0x361f('0x46')](_0x5d4453)[_0x361f('0x26')](handleEntityNotFound(_0x40fa04,null))[_0x361f('0x26')](function(_0x106c74){if(_0x106c74){var _0x4737dc=_0x106c74[_0x361f('0x48')]({'plain':!![]});_0x4737dc=qs[_0x361f('0x49')](_0x4737dc,['id',_0x361f('0x4a'),_0x361f('0x4b')]);_0x5d20f1[_0x361f('0x4c')]=_['omit'](_0x5d20f1[_0x361f('0x4c')],['id',_0x361f('0x4a'),'updatedAt']);return db[_0x361f('0x2b')]['create'](_['merge'](_0x4737dc,_0x5d20f1[_0x361f('0x4c')]),{'include':_0x5d20f1[_0x361f('0x2f')][_0x361f('0x3d')]?[{'all':!![]}]:undefined});}})[_0x361f('0x26')](respondWithResult(_0x40fa04,0xc9))[_0x361f('0x40')](handleError(_0x40fa04,null));};exports['update']=function(_0x26fb25,_0xaad3e4){if(_0x26fb25[_0x361f('0x4c')]['id']){delete _0x26fb25['body']['id'];}return db[_0x361f('0x2b')][_0x361f('0x46')]({'where':{'id':_0x26fb25[_0x361f('0x42')]['id']}})[_0x361f('0x26')](handleEntityNotFound(_0xaad3e4,null))[_0x361f('0x26')](saveUpdates(_0x26fb25[_0x361f('0x4c')],null))[_0x361f('0x26')](respondWithResult(_0xaad3e4,null))[_0x361f('0x40')](handleError(_0xaad3e4,null));};exports['destroy']=function(_0x55005e,_0x236198){return db[_0x361f('0x2b')]['find']({'where':{'id':_0x55005e[_0x361f('0x42')]['id']}})[_0x361f('0x26')](handleEntityNotFound(_0x236198,null))[_0x361f('0x26')](removeEntity(_0x236198,null))[_0x361f('0x40')](handleError(_0x236198,null));};exports['create']=function(_0x5cf33f,_0x2db0a5,_0x1d7ea2){_0x5cf33f[_0x361f('0x4c')][_0x361f('0x28')]=_0x5cf33f[_0x361f('0x4d')][_0x361f('0x4e')];_0x5cf33f[_0x361f('0x4c')][_0x361f('0x4f')]=_0x5cf33f['file'][_0x361f('0x50')];_0x5cf33f[_0x361f('0x4c')][_0x361f('0x2c')]=_0x5cf33f[_0x361f('0x4d')][_0x361f('0x51')];return db[_0x361f('0x2b')][_0x361f('0x52')](_0x5cf33f[_0x361f('0x4c')])[_0x361f('0x26')](respondWithResult(_0x2db0a5,0xc9))[_0x361f('0x40')](handleError(_0x2db0a5,null));};exports['download']=function(_0x43c721,_0x1925ec,_0x2b18e3){return db[_0x361f('0x2b')]['findOne']({'where':{'id':_0x43c721['params']['id']},'raw':!![]})[_0x361f('0x26')](handleEntityNotFound(_0x1925ec,null))[_0x361f('0x26')](function(_0x963ac4){if(_0x963ac4){var _0x3729e6=_0x963ac4[_0x361f('0x53')]!==null;var _0x57721c=path[_0x361f('0x54')](config[_0x361f('0x55')],_0x361f('0x56'));if(_0x3729e6){_0x57721c=path[_0x361f('0x54')](_0x57721c,_0x361f('0x57'));}var _0x36d767=path['join'](_0x57721c,_0x963ac4['basename']);return _0x1925ec[_0x361f('0x58')](_0x36d767);}})[_0x361f('0x40')](handleError(_0x1925ec,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 0bbf12e..c2d34ab 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 _0x0c5b=['rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0c5b,0xbd));var _0xb0c5=function(_0x5cce0c,_0x2b0396){_0x5cce0c=_0x5cce0c-0x0;var _0x5b19fa=_0x0c5b[_0x5cce0c];return _0x5b19fa;};'use strict';var _=require(_0xb0c5('0x0'));var util=require(_0xb0c5('0x1'));var logger=require(_0xb0c5('0x2'))(_0xb0c5('0x3'));var moment=require(_0xb0c5('0x4'));var BPromise=require(_0xb0c5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0c5('0x6'));var rimraf=require(_0xb0c5('0x7'));var config=require(_0xb0c5('0x8'));var attributes=require(_0xb0c5('0x9'));module[_0xb0c5('0xa')]=function(_0x1adf0e,_0x5d4cf2){return _0x1adf0e[_0xb0c5('0xb')](_0xb0c5('0xc'),attributes,{'tableName':_0xb0c5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41e5=['../../config/environment','./attachment.attributes','define','Attachment','attachments','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x17e09f,_0x1e12be){var _0x4ac806=function(_0x2684f5){while(--_0x2684f5){_0x17e09f['push'](_0x17e09f['shift']());}};_0x4ac806(++_0x1e12be);}(_0x41e5,0x1cd));var _0x541e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41e5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x541e('0x0'));var logger=require(_0x541e('0x1'))('api');var moment=require(_0x541e('0x2'));var BPromise=require(_0x541e('0x3'));var rp=require(_0x541e('0x4'));var fs=require('fs');var path=require(_0x541e('0x5'));var rimraf=require(_0x541e('0x6'));var config=require(_0x541e('0x7'));var attributes=require(_0x541e('0x8'));module['exports']=function(_0x467b9b,_0x262246){return _0x467b9b[_0x541e('0x9')](_0x541e('0xa'),attributes,{'tableName':_0x541e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index c477914..d02e93c 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 _0x80df=['catch','CreateAttachment','Attachment','create','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var moment=require(_0xf80d('0x2'));var BPromise=require(_0xf80d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf80d('0x4'));var db=require(_0xf80d('0x5'))['db'];var utils=require(_0xf80d('0x6'));var logger=require(_0xf80d('0x7'))(_0xf80d('0x8'));var config=require(_0xf80d('0x9'));var jayson=require(_0xf80d('0xa'));var client=jayson[_0xf80d('0xb')][_0xf80d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x62e50f,_0x5068d4,_0x30e2b3){return new BPromise(function(_0x16b219,_0x2f56b3){return client[_0xf80d('0xd')](_0x62e50f,_0x30e2b3)[_0xf80d('0xe')](function(_0x186339){logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));logger[_0xf80d('0x12')](_0xf80d('0x13'),_0x5068d4,_0xf80d('0x11'),JSON[_0xf80d('0x14')](_0x186339));if(_0x186339[_0xf80d('0x15')]){if(_0x186339['error']['code']===0x1f4){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x2f56b3(_0x186339['error'][_0xf80d('0x16')]);}logger['error'](_0xf80d('0x10'),_0x5068d4,_0x186339['error'][_0xf80d('0x16')]);return _0x16b219(_0x186339[_0xf80d('0x15')][_0xf80d('0x16')]);}else{logger[_0xf80d('0xf')](_0xf80d('0x10'),_0x5068d4,_0xf80d('0x11'));_0x16b219(_0x186339[_0xf80d('0x17')][_0xf80d('0x16')]);}})[_0xf80d('0x18')](function(_0x3b8a82){logger[_0xf80d('0x15')](_0xf80d('0x10'),_0x5068d4,_0x3b8a82);_0x2f56b3(_0x3b8a82);});});}exports[_0xf80d('0x19')]=function(_0x1d104a){var _0x34b49d=this;return new Promise(function(_0x2ea2c1,_0x7ba89c){return db[_0xf80d('0x1a')][_0xf80d('0x1b')](_0x1d104a['body'],{'raw':_0x1d104a[_0xf80d('0x1c')]?_0x1d104a[_0xf80d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf80d('0xe')](function(_0x539c80){logger[_0xf80d('0xf')](_0xf80d('0x19'),_0x1d104a);logger[_0xf80d('0x12')](_0xf80d('0x19'),_0x1d104a,JSON[_0xf80d('0x14')](_0x539c80));_0x2ea2c1(_0x539c80);})[_0xf80d('0x18')](function(_0x446153){logger[_0xf80d('0x15')](_0xf80d('0x19'),_0x446153[_0xf80d('0x16')],_0x1d104a);_0x7ba89c(_0x34b49d[_0xf80d('0x15')](0x1f4,_0x446153[_0xf80d('0x16')]));});});}; \ No newline at end of file +var _0x8128=['message','Attachment','create','options','raw','then','CreateAttachment','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0x8128,0x1b1));var _0x8812=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8128[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8812('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8812('0x1'));var rs=require(_0x8812('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8812('0x3'));var logger=require(_0x8812('0x4'))(_0x8812('0x5'));var config=require('../../config/environment');var jayson=require(_0x8812('0x6'));var client=jayson[_0x8812('0x7')][_0x8812('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16bafa,_0x480d1f,_0xfdd696){return new BPromise(function(_0x3d030b,_0x4e5012){return client['request'](_0x16bafa,_0xfdd696)['then'](function(_0x2bc882){logger[_0x8812('0x9')](_0x8812('0xa'),_0x480d1f,_0x8812('0xb'));logger[_0x8812('0xc')](_0x8812('0xd'),_0x480d1f,_0x8812('0xb'),JSON[_0x8812('0xe')](_0x2bc882));if(_0x2bc882[_0x8812('0xf')]){if(_0x2bc882['error'][_0x8812('0x10')]===0x1f4){logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')][_0x8812('0x11')]);return _0x4e5012(_0x2bc882[_0x8812('0xf')]['message']);}logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')]['message']);return _0x3d030b(_0x2bc882['error'][_0x8812('0x11')]);}else{logger[_0x8812('0x9')]('Attachment,\x20%s,\x20%s',_0x480d1f,'request\x20sent');_0x3d030b(_0x2bc882['result']['message']);}})['catch'](function(_0xa2a8cc){logger['error'](_0x8812('0xa'),_0x480d1f,_0xa2a8cc);_0x4e5012(_0xa2a8cc);});});}exports['CreateAttachment']=function(_0x447f9b){var _0x38a8ad=this;return new Promise(function(_0x4ae563,_0x23c224){return db[_0x8812('0x12')][_0x8812('0x13')](_0x447f9b['body'],{'raw':_0x447f9b['options']?_0x447f9b[_0x8812('0x14')][_0x8812('0x15')]===undefined?!![]:![]:!![]})[_0x8812('0x16')](function(_0x38a2df){logger[_0x8812('0x9')](_0x8812('0x17'),_0x447f9b);logger['debug'](_0x8812('0x17'),_0x447f9b,JSON[_0x8812('0xe')](_0x38a2df));_0x4ae563(_0x38a2df);})[_0x8812('0x18')](function(_0x5e2280){logger[_0x8812('0xf')](_0x8812('0x17'),_0x5e2280['message'],_0x447f9b);_0x23c224(_0x38a8ad[_0x8812('0xf')](0x1f4,_0x5e2280['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 370d1cf..89fadb3 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 _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(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x0b0e,0x187));var _0xe0b0=function(_0x527a53,_0x3265d6){_0x527a53=_0x527a53-0x0;var _0x2332f5=_0x0b0e[_0x527a53];return _0x2332f5;};'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 +var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x2050ac,_0x1a3025){var _0x491746=function(_0x34ab0e){while(--_0x34ab0e){_0x2050ac['push'](_0x2050ac['shift']());}};_0x491746(++_0x1a3025);}(_0x757a,0xde));var _0xa757=function(_0x229a5b,_0x2c1129){_0x229a5b=_0x229a5b-0x0;var _0x143f78=_0x757a[_0x229a5b];return _0x143f78;};'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('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index d478886..e9c1ed8 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 _0x4524=['bluebird','util','../../components/auth/service','../../config/utils','api','activedirectory','undefined','url','domain','authenticate','error','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','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','online','admin','user','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','User','passport','passport-local','Strategy'];(function(_0x3493b2,_0x49d4fa){var _0x2edca5=function(_0x5c7734){while(--_0x5c7734){_0x3493b2['push'](_0x3493b2['shift']());}};_0x2edca5(++_0x49d4fa);}(_0x4524,0x1d6));var _0x4452=function(_0x4f0811,_0x508249){_0x4f0811=_0x4f0811-0x0;var _0x2148b1=_0x4524[_0x4f0811];return _0x2148b1;};'use strict';var passport=require(_0x4452('0x0'));var LocalStrategy=require(_0x4452('0x1'))[_0x4452('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x4452('0x3'));var util=require(_0x4452('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x4452('0x5'));var utils=require(_0x4452('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x4452('0x7'));function isActiveDirectoryConfigured(_0x43fcc1){var _0x4c69c4=![];if(typeof _0x43fcc1[_0x4452('0x8')]!==_0x4452('0x9')){_0x4c69c4=_0x43fcc1['activedirectory']['baseDN']&&_0x43fcc1['activedirectory'][_0x4452('0xa')]&&_0x43fcc1[_0x4452('0x8')][_0x4452('0xb')];}return _0x4c69c4;}function adAuthenticate(_0x56afbe,_0x3084e1,_0x1e82dc){return new BPromise(function(_0x4ac2a8,_0x5b2bdf){try{var _0x2b2a08=new ActiveDirectory(_0x56afbe);_0x2b2a08[_0x4452('0xc')](_0x3084e1,_0x1e82dc,function(_0x348ae2,_0x31d79c){if(_0x348ae2){logger[_0x4452('0xd')]('Error\x20authenticate\x20%s:\x20%s',_0x3084e1,util['inspect'](_0x348ae2,{'showHidden':![],'depth':null}));_0x5b2bdf(_0x4452('0xe'));}else if(!_0x31d79c){logger[_0x4452('0xd')](_0x4452('0xf'),_0x3084e1);_0x5b2bdf('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4ac2a8(_0x31d79c);}});}catch(_0x293df3){_0x5b2bdf(_0x293df3);}});}function ActiveDirectoryAuthenticate(_0x8b2cdd,_0x4f2a90,_0x5bfa1f,_0x3439a9){var _0x53d276,_0x198294;if(!isActiveDirectoryConfigured(config)){logger[_0x4452('0xd')](_0x4452('0x10'),_0x4f2a90);return _0x3439a9(null,![],{'message':_0x4452('0xe')});}return db['Setting'][_0x4452('0x11')]({'where':{'id':0x1},'attributes':[_0x4452('0x12'),_0x4452('0x13')],'raw':!![]})[_0x4452('0x14')](function(_0x4fd665){_0x53d276=_0x4fd665;if(!_0x53d276[_0x4452('0x12')]){logger[_0x4452('0xd')](_0x4452('0x15'),_0x4f2a90);throw new Error(_0x4452('0xe'));}return _0x8b2cdd[_0x4452('0x11')]({'attributes':['id',_0x4452('0x16'),_0x4452('0x17'),'salt',_0x4452('0x18'),_0x4452('0x19'),_0x4452('0x1a'),'blockedAt',_0x4452('0x1b')],'where':{'name':_0x4f2a90,'role':{'$or':[_0x4452('0x1c'),_0x4452('0x1d'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x15dc24){if(!_0x15dc24||_0x15dc24&&_0x15dc24[_0x4452('0x16')]!==_0x4f2a90){throw new Error(_0x4452('0xe'));}_0x198294=_0x15dc24;var _0x36ee1e=_0x198294[_0x4452('0x16')]+'@'+config['activedirectory'][_0x4452('0xb')];return adAuthenticate(config['activedirectory'],_0x36ee1e,_0x5bfa1f);})['then'](function(_0x55aa67){if(_0x198294[_0x4452('0x19')]){throw new Error(_0x4452('0xe'));}if(_0x53d276[_0x4452('0x13')]>0x0){if(_0x198294[_0x4452('0x1a')]){if(moment(_0x198294[_0x4452('0x1e')])[_0x4452('0x1f')](_0x53d276[_0x4452('0x13')],_0x4452('0x20'))>moment()){throw new Error(_0x4452('0xe'));}return utils[_0x4452('0x21')](_0x198294,0x0,![],null)[_0x4452('0x14')](function(){return utils[_0x4452('0x22')](_0x198294);})[_0x4452('0x14')](function(){return _0x3439a9(null,_0x198294);});}else{return utils[_0x4452('0x22')](_0x198294)[_0x4452('0x14')](function(){return _0x3439a9(null,_0x198294);});}}else{return utils[_0x4452('0x22')](_0x198294)['then'](function(){return _0x3439a9(null,_0x198294);});}})[_0x4452('0x23')](function(_0x1d8f8a){return _0x3439a9(null,![],_0x1d8f8a);});}function handleError(_0x2bf8a1,_0x1d1f86,_0x33cb49){return _0x2bf8a1[_0x4452('0x24')](_0x1d1f86||0x1f4)['send']({'message':_0x33cb49?_0x33cb49[_0x4452('0x25')]||_0x33cb49:''});}exports[_0x4452('0x26')]=function(_0x5b2380,_0x48b247,_0x1db433){passport[_0x4452('0xc')](_0x4452('0x27'),function(_0x17fcc5,_0x183532,_0x440811){var _0x48b726=_0x17fcc5||_0x440811;if(_0x48b726){return handleError(_0x48b247,0x191,_0x48b726);}if(!_0x183532){return handleError(_0x48b247,0x194,{'message':_0x4452('0x28')});}else{var _0xb02a98={'payload':{'id':_0x183532['id'],'role':_0x183532[_0x4452('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0x4452('0x29')](_0xb02a98)[_0x4452('0x14')](function(_0x2ed9e2){_0x48b247['json']({'id':_0x183532['id'],'token':_0x2ed9e2,'statusCall':'','isAlreadyLogged':_0x183532[_0x4452('0x1b')]});});}})(_0x5b2380,_0x48b247,_0x1db433);};passport['use'](_0x4452('0x27'),new LocalStrategy({'usernameField':_0x4452('0x16'),'passwordField':_0x4452('0x17')},function(_0x300ac0,_0x9e0c0e,_0x4cb475){return ActiveDirectoryAuthenticate(db[_0x4452('0x2a')],_0x300ac0,_0x9e0c0e,_0x4cb475);})); \ No newline at end of file +var _0x4b35=['send','login','ad-login','role','json','use','passport','Strategy','moment','activedirectory2','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','blockedAt','online','admin','agent','then','disabled','add','minutes','clearBlockUser','getLicense','catch','status'];(function(_0x41a8c5,_0x5e5f94){var _0x21f775=function(_0x18a801){while(--_0x18a801){_0x41a8c5['push'](_0x41a8c5['shift']());}};_0x21f775(++_0x5e5f94);}(_0x4b35,0x8a));var _0x54b3=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x4b35[_0x11005e];return _0x29338f;};'use strict';var passport=require(_0x54b3('0x0'));var LocalStrategy=require('passport-local')[_0x54b3('0x1')];var moment=require(_0x54b3('0x2'));var ActiveDirectory=require(_0x54b3('0x3'));var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0x54b3('0x4'));var utils=require(_0x54b3('0x5'));var config=require(_0x54b3('0x6'));var logger=require(_0x54b3('0x7'))('api');function isActiveDirectoryConfigured(_0x5c9f4c){var _0x4947b7=![];if(typeof _0x5c9f4c[_0x54b3('0x8')]!==_0x54b3('0x9')){_0x4947b7=_0x5c9f4c[_0x54b3('0x8')][_0x54b3('0xa')]&&_0x5c9f4c[_0x54b3('0x8')][_0x54b3('0xb')]&&_0x5c9f4c[_0x54b3('0x8')][_0x54b3('0xc')];}return _0x4947b7;}function adAuthenticate(_0x3a3f44,_0x220b90,_0x4b3be9){return new BPromise(function(_0x241d2f,_0x27ccd3){try{var _0x22bc56=new ActiveDirectory(_0x3a3f44);_0x22bc56[_0x54b3('0xd')](_0x220b90,_0x4b3be9,function(_0x46d1c0,_0x23c805){if(_0x46d1c0){logger[_0x54b3('0xe')]('Error\x20authenticate\x20%s:\x20%s',_0x220b90,util[_0x54b3('0xf')](_0x46d1c0,{'showHidden':![],'depth':null}));_0x27ccd3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x23c805){logger['error'](_0x54b3('0x10'),_0x220b90);_0x27ccd3(_0x54b3('0x11'));}else{_0x241d2f(_0x23c805);}});}catch(_0x71f532){_0x27ccd3(_0x71f532);}});}function ActiveDirectoryAuthenticate(_0x17fa73,_0x42b51c,_0x3ca746,_0x4e674f){var _0x47fe6a,_0x5533f5;if(!isActiveDirectoryConfigured(config)){logger[_0x54b3('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x42b51c);return _0x4e674f(null,![],{'message':_0x54b3('0x11')});}return db[_0x54b3('0x12')][_0x54b3('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x54b3('0x14')],'raw':!![]})['then'](function(_0x7f7d49){_0x47fe6a=_0x7f7d49;if(!_0x47fe6a[_0x54b3('0x15')]){logger[_0x54b3('0xe')](_0x54b3('0x16'),_0x42b51c);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x17fa73[_0x54b3('0x13')]({'attributes':['id',_0x54b3('0x17'),_0x54b3('0x18'),_0x54b3('0x19'),'role','disabled','blocked',_0x54b3('0x1a'),_0x54b3('0x1b')],'where':{'name':_0x42b51c,'role':{'$or':[_0x54b3('0x1c'),'user',_0x54b3('0x1d')]},'adSsoEnabled':!![]}});})[_0x54b3('0x1e')](function(_0x10c839){if(!_0x10c839||_0x10c839&&_0x10c839[_0x54b3('0x17')]!==_0x42b51c){throw new Error(_0x54b3('0x11'));}_0x5533f5=_0x10c839;var _0xd8093=_0x5533f5[_0x54b3('0x17')]+'@'+config[_0x54b3('0x8')]['domain'];return adAuthenticate(config[_0x54b3('0x8')],_0xd8093,_0x3ca746);})[_0x54b3('0x1e')](function(_0x58f6b4){if(_0x5533f5[_0x54b3('0x1f')]){throw new Error(_0x54b3('0x11'));}if(_0x47fe6a[_0x54b3('0x14')]>0x0){if(_0x5533f5['blocked']){if(moment(_0x5533f5[_0x54b3('0x1a')])[_0x54b3('0x20')](_0x47fe6a['blockDuration'],_0x54b3('0x21'))>moment()){throw new Error(_0x54b3('0x11'));}return utils[_0x54b3('0x22')](_0x5533f5,0x0,![],null)[_0x54b3('0x1e')](function(){return utils[_0x54b3('0x23')](_0x5533f5);})[_0x54b3('0x1e')](function(){return _0x4e674f(null,_0x5533f5);});}else{return utils[_0x54b3('0x23')](_0x5533f5)[_0x54b3('0x1e')](function(){return _0x4e674f(null,_0x5533f5);});}}else{return utils[_0x54b3('0x23')](_0x5533f5)['then'](function(){return _0x4e674f(null,_0x5533f5);});}})[_0x54b3('0x24')](function(_0x553d3f){return _0x4e674f(null,![],_0x553d3f);});}function handleError(_0x2d6a2e,_0x3671c1,_0x1a98d1){return _0x2d6a2e[_0x54b3('0x25')](_0x3671c1||0x1f4)[_0x54b3('0x26')]({'message':_0x1a98d1?_0x1a98d1['message']||_0x1a98d1:''});}exports[_0x54b3('0x27')]=function(_0x405735,_0x196e5,_0x3b564a){passport['authenticate'](_0x54b3('0x28'),function(_0x12dfa4,_0x5c9cab,_0x547356){var _0x17efc0=_0x12dfa4||_0x547356;if(_0x17efc0){return handleError(_0x196e5,0x191,_0x17efc0);}if(!_0x5c9cab){return handleError(_0x196e5,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2a5891={'payload':{'id':_0x5c9cab['id'],'role':_0x5c9cab[_0x54b3('0x29')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2a5891)[_0x54b3('0x1e')](function(_0x4a4528){_0x196e5[_0x54b3('0x2a')]({'id':_0x5c9cab['id'],'token':_0x4a4528,'statusCall':'','isAlreadyLogged':_0x5c9cab['online']});});}})(_0x405735,_0x196e5,_0x3b564a);};passport[_0x54b3('0x2b')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x4a9705,_0x4da7d2,_0x5c9627){return ActiveDirectoryAuthenticate(db['User'],_0x4a9705,_0x4da7d2,_0x5c9627);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 85bc1f9..833e3d8 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 _0x31e9=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x36f3c3,_0x552f2d){var _0x386c93=function(_0x4e95f5){while(--_0x4e95f5){_0x36f3c3['push'](_0x36f3c3['shift']());}};_0x386c93(++_0x552f2d);}(_0x31e9,0xbf));var _0x931e=function(_0x48ea74,_0x1a7886){_0x48ea74=_0x48ea74-0x0;var _0x462ddd=_0x31e9[_0x48ea74];return _0x462ddd;};'use strict';var express=require(_0x931e('0x0'));var router=express['Router']();var controller=require(_0x931e('0x1'));router[_0x931e('0x2')]('/',controller[_0x931e('0x3')]);module[_0x931e('0x4')]=router; \ No newline at end of file +var _0x5d4f=['./authActiveDirectory.controller','login','exports','express','Router'];(function(_0x4cc3b0,_0x5452ad){var _0xb94339=function(_0x14df89){while(--_0x14df89){_0x4cc3b0['push'](_0x4cc3b0['shift']());}};_0xb94339(++_0x5452ad);}(_0x5d4f,0x6c));var _0xf5d4=function(_0x202113,_0x41b256){_0x202113=_0x202113-0x0;var _0x9d727d=_0x5d4f[_0x202113];return _0x9d727d;};'use strict';var express=require(_0xf5d4('0x0'));var router=express[_0xf5d4('0x1')]();var controller=require(_0xf5d4('0x2'));router['post']('/',controller[_0xf5d4('0x3')]);module[_0xf5d4('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0c7d3fb..f00e10d 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(_0x52a7f1,_0x3a16bd){var _0x337926=function(_0x2d0114){while(--_0x2d0114){_0x52a7f1['push'](_0x52a7f1['shift']());}};_0x337926(++_0x3a16bd);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +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(_0x397157,_0x495686){var _0x5a038e=function(_0x255028){while(--_0x255028){_0x397157['push'](_0x397157['shift']());}};_0x5a038e(++_0x495686);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 3a0e293..1c23941 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 _0xf1c5=['exports','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','login'];(function(_0x414ff1,_0xf0462b){var _0x29c53f=function(_0x1dab72){while(--_0x1dab72){_0x414ff1['push'](_0x414ff1['shift']());}};_0x29c53f(++_0xf0462b);}(_0xf1c5,0x151));var _0x5f1c=function(_0x6eca6b,_0x3e837f){_0x6eca6b=_0x6eca6b-0x0;var _0x480557=_0xf1c5[_0x6eca6b];return _0x480557;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0x5f1c('0x0'));var userController=require(_0x5f1c('0x1'));var authService=require(_0x5f1c('0x2'));router[_0x5f1c('0x3')]('/',controller['login']);router[_0x5f1c('0x3')](_0x5f1c('0x4'),controller['callback'],authService['isMiddleware'],userController[_0x5f1c('0x5')],authService['setTokenCookie']);module[_0x5f1c('0x6')]=router; \ No newline at end of file +var _0x43f7=['isMiddleware','setTokenCookie','express','passport','Router','get','login'];(function(_0x58bc0c,_0x39db28){var _0xea6fff=function(_0x275a31){while(--_0x275a31){_0x58bc0c['push'](_0x58bc0c['shift']());}};_0xea6fff(++_0x39db28);}(_0x43f7,0x8e));var _0x743f=function(_0x4624bb,_0x17b692){_0x4624bb=_0x4624bb-0x0;var _0x6a6bc6=_0x43f7[_0x4624bb];return _0x6a6bc6;};'use strict';var express=require(_0x743f('0x0'));var passport=require(_0x743f('0x1'));var router=express[_0x743f('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x743f('0x3')]('/',controller[_0x743f('0x4')]);router[_0x743f('0x3')]('/callback',controller['callback'],authService[_0x743f('0x5')],userController[_0x743f('0x4')],authService[_0x743f('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 585d4b5..806a0c8 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 _0x7acc=['../../components/auth/service','../../config/utils','http','Setting','findOne','blockDuration','name','salt','role','disabled','blocked','blockedAt','loginAttempts','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','minutes','clearBlockUser','add','getLicense','catch','MailAccount','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','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/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','Password\x20reset!','passport','passport-local','Strategy','jayson/promise','lodash','randomstring'];(function(_0x4ec515,_0x171854){var _0xd562b6=function(_0xeda938){while(--_0xeda938){_0x4ec515['push'](_0x4ec515['shift']());}};_0xd562b6(++_0x171854);}(_0x7acc,0x199));var _0xc7ac=function(_0x271048,_0x37f4f4){_0x271048=_0x271048-0x0;var _0x35cc03=_0x7acc[_0x271048];return _0x35cc03;};'use strict';var util=require('util');var passport=require(_0xc7ac('0x0'));var LocalStrategy=require(_0xc7ac('0x1'))[_0xc7ac('0x2')];var jayson=require(_0xc7ac('0x3'));var _=require(_0xc7ac('0x4'));var rs=require(_0xc7ac('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xc7ac('0x6'));var utils=require(_0xc7ac('0x7'));var client=jayson['client'][_0xc7ac('0x8')]({'port':0x232b});function localAuthenticate(_0x525f8e,_0x24f9fe,_0x329b0f,_0x4c5b0f){var _0x1f8a75,_0x36ea71;return db[_0xc7ac('0x9')][_0xc7ac('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc7ac('0xb')],'raw':!![]})['then'](function(_0x384907){_0x1f8a75=_0x384907;return _0x525f8e[_0xc7ac('0xa')]({'attributes':['id',_0xc7ac('0xc'),'password',_0xc7ac('0xd'),_0xc7ac('0xe'),_0xc7ac('0xf'),_0xc7ac('0x10'),_0xc7ac('0x11'),_0xc7ac('0x12')],'where':{'name':_0x24f9fe,'role':{'$or':['admin','user',_0xc7ac('0x13')]}}});})[_0xc7ac('0x14')](function(_0x24cb4d){if(!_0x24cb4d||_0x24cb4d&&_0x24cb4d[_0xc7ac('0xc')]!==_0x24f9fe){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x36ea71=_0x24cb4d;return _0x36ea71;}})[_0xc7ac('0x14')](function(){_0x36ea71[_0xc7ac('0x15')](_0x329b0f,function(_0x30f21e,_0x251f6e){var _0x3fa1a2=_0x36ea71[_0xc7ac('0x12')]+0x1;if(_0x30f21e){return _0x4c5b0f(_0x30f21e);}else if(!_0x251f6e){if(_0x36ea71[_0xc7ac('0xf')]){return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});}else if(_0x1f8a75[_0xc7ac('0x17')]>0x0){if(_0x36ea71[_0xc7ac('0x10')]){if(_0x1f8a75[_0xc7ac('0xb')]>0x0){if(moment(_0x36ea71['blockedAt'])['add'](_0x1f8a75[_0xc7ac('0xb')],_0xc7ac('0x18'))>moment()){return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});}else{return utils[_0xc7ac('0x19')](_0x36ea71,_0x3fa1a2,![],null)['then'](function(){return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});});}}else{return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});}}else{if(_0x3fa1a2>=_0x1f8a75['allowedLoginAttempts']){return utils[_0xc7ac('0x19')](_0x36ea71,0x0,!![],moment())[_0xc7ac('0x14')](function(){return _0x4c5b0f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xc7ac('0x19')](_0x36ea71,_0x3fa1a2,![],null)[_0xc7ac('0x14')](function(){return _0x4c5b0f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});}}else{if(_0x36ea71[_0xc7ac('0xf')]){return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});}else if(_0x1f8a75['allowedLoginAttempts']>0x0){if(_0x36ea71[_0xc7ac('0x10')]){if(_0x1f8a75[_0xc7ac('0xb')]>0x0){if(moment(_0x36ea71[_0xc7ac('0x11')])[_0xc7ac('0x1a')](_0x1f8a75[_0xc7ac('0xb')],_0xc7ac('0x18'))>moment()){return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});}else{return utils[_0xc7ac('0x19')](_0x36ea71,0x0,![],null)['then'](function(){return utils[_0xc7ac('0x1b')](_0x36ea71);})[_0xc7ac('0x14')](function(){return _0x4c5b0f(null,_0x36ea71);});}}else{return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});}}else{return utils[_0xc7ac('0x19')](_0x36ea71,0x0,![],null)['then'](function(){return utils['getLicense'](_0x36ea71);})[_0xc7ac('0x14')](function(){return _0x4c5b0f(null,_0x36ea71);})[_0xc7ac('0x1c')](function(_0x5c9aef){return _0x4c5b0f(null,![],_0x5c9aef);});}}else{if(_0x36ea71[_0xc7ac('0x10')]){return _0x4c5b0f(null,![],{'message':_0xc7ac('0x16')});}else{return utils[_0xc7ac('0x1b')](_0x36ea71)[_0xc7ac('0x14')](function(){return _0x4c5b0f(null,_0x36ea71);});}}}});})[_0xc7ac('0x1c')](function(_0x56d379){return _0x4c5b0f(null,![],_0x56d379);});}function sendServiceMail(_0x11c595){return db[_0xc7ac('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xc7ac('0x1e')],'as':_0xc7ac('0x1f'),'include':[{'model':db[_0xc7ac('0x20')],'as':_0xc7ac('0x20')}]}]})[_0xc7ac('0x14')](function(_0xfb50d7){if(!_0xfb50d7){throw new Error(_0xc7ac('0x21'));}var _0x3db1e0=_0xfb50d7[_0xc7ac('0x22')]();var _0xfd682c={'account':_0x3db1e0,'message':_[_0xc7ac('0x23')]({'from':util['format'](_0xc7ac('0x24'),_0xfb50d7[_0xc7ac('0xc')],_0xfb50d7[_0xc7ac('0x25')]||_0xfb50d7[_0xc7ac('0x1f')][_0xc7ac('0x26')])},_0x11c595)};return client[_0xc7ac('0x27')](_0xc7ac('0x28'),_0xfd682c);})[_0xc7ac('0x14')](function(_0x5771d9){if(_0x5771d9[_0xc7ac('0x29')]){throw new Error(util['format'](_0xc7ac('0x2a'),_0x5771d9['error'][_0xc7ac('0x2b')]||JSON[_0xc7ac('0x2c')](_0x5771d9[_0xc7ac('0x29')])));}return!![];});}function handleError(_0x504633,_0x51af0f,_0x2f02e0){return _0x504633[_0xc7ac('0x2d')](_0x51af0f||0x1f4)[_0xc7ac('0x2e')]({'message':_0x2f02e0?_0x2f02e0[_0xc7ac('0x2b')]||_0x2f02e0:''});}exports[_0xc7ac('0x2f')]=function(_0x3e5d69,_0x15db67,_0x44dae1){passport[_0xc7ac('0x15')](_0xc7ac('0x30'),function(_0x24c3f8,_0x1f2f0e,_0x30ce3e){var _0x414e55=_0x24c3f8||_0x30ce3e;if(_0x414e55){return handleError(_0x15db67,0x191,_0x414e55);}if(!_0x1f2f0e){return handleError(_0x15db67,0x194,{'message':_0xc7ac('0x31')});}else{var _0x5d2382={'payload':{'id':_0x1f2f0e['id'],'role':_0x1f2f0e[_0xc7ac('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xc7ac('0x32')](_0x5d2382)[_0xc7ac('0x14')](function(_0x18dea9){_0x15db67['json']({'id':_0x1f2f0e['id'],'token':_0x18dea9,'statusCall':'','isAlreadyLogged':_0x1f2f0e[_0xc7ac('0x33')]});});}})(_0x3e5d69,_0x15db67,_0x44dae1);};exports['forgot']=function(_0x38be5b,_0x1a72eb){if(!_0x38be5b[_0xc7ac('0x34')][_0xc7ac('0x25')]){return handleError(_0x1a72eb,0x1f4,{'message':_0xc7ac('0x35')});}var _0x1bb38a=rs['generate']();_0x38be5b[_0xc7ac('0x34')][_0xc7ac('0x25')]=_0x38be5b[_0xc7ac('0x34')][_0xc7ac('0x25')][_0xc7ac('0x36')]()[_0xc7ac('0x37')]();var _0x4891ec;return db[_0xc7ac('0x9')][_0xc7ac('0xa')]({'where':{'id':0x1},'attributes':[_0xc7ac('0x17'),_0xc7ac('0xb')],'raw':!![]})[_0xc7ac('0x14')](function(_0x2205c8){_0x4891ec=_0x2205c8;return db[_0xc7ac('0x38')][_0xc7ac('0x39')]({'where':{'email':_0x38be5b[_0xc7ac('0x34')][_0xc7ac('0x25')]}});})['then'](function(_0x27894f){if(!_0x27894f){throw new Error(_0xc7ac('0x3a'));}if(_0x27894f[_0xc7ac('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x27894f['blocked']){if(moment(_0x27894f[_0xc7ac('0x11')])['add'](_0x4891ec[_0xc7ac('0xb')],_0xc7ac('0x18'))>moment()){throw new Error(_0xc7ac('0x3b'));}else{_0x27894f[_0xc7ac('0x10')]=![];_0x27894f[_0xc7ac('0x11')]=null;}}_0x27894f[_0xc7ac('0x3c')]=_0x1bb38a;_0x27894f[_0xc7ac('0x3d')]=Date[_0xc7ac('0x3e')]()+0x36ee80;return _0x27894f[_0xc7ac('0x3f')]();})[_0xc7ac('0x14')](function(){return sendServiceMail({'to':_0x38be5b[_0xc7ac('0x34')][_0xc7ac('0x25')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xc7ac('0x40')+_0xc7ac('0x41')+_0xc7ac('0x42')+_0x38be5b[_0xc7ac('0x43')][_0xc7ac('0x44')]+_0xc7ac('0x45')+_0x1bb38a+'\x0a\x0a'+_0xc7ac('0x46')});})[_0xc7ac('0x14')](function(){_0x1a72eb[_0xc7ac('0x2d')](0xc8)[_0xc7ac('0x2e')]({'message':_0xc7ac('0x47')});})[_0xc7ac('0x1c')](function(_0x2be678){return handleError(_0x1a72eb,0x1f4,_0x2be678);});};exports[_0xc7ac('0x48')]=function(_0x5249be,_0x23987e){return db['User']['find']({'where':{'resetPasswordToken':_0x5249be[_0xc7ac('0x49')][_0xc7ac('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xc7ac('0x3e')]()}}})[_0xc7ac('0x14')](function(_0x53e938){if(!_0x53e938){throw new Error(_0xc7ac('0x4b'));}return db[_0xc7ac('0x9')][_0xc7ac('0xa')]({'attributes':['id',_0xc7ac('0x4c'),'enforcePasswordHistory',_0xc7ac('0x4d')]})[_0xc7ac('0x14')](function(_0x1ef6a0){if(_0x1ef6a0[_0xc7ac('0x4c')])authService[_0xc7ac('0x4e')](_0x5249be[_0xc7ac('0x34')][_0xc7ac('0x4f')]);if(!_0x1ef6a0['enforcePasswordHistory']||!_0x53e938['previousPasswords'])return _0x53e938;authService[_0xc7ac('0x50')](_0x5249be['body'][_0xc7ac('0x4f')],_0x53e938[_0xc7ac('0x51')],_0x1ef6a0[_0xc7ac('0x4d')]);return _0x53e938;})[_0xc7ac('0x14')](function(){_0x53e938[_0xc7ac('0x4f')]=_0x5249be[_0xc7ac('0x34')][_0xc7ac('0x4f')];_0x53e938[_0xc7ac('0x3c')]=null;_0x53e938[_0xc7ac('0x3d')]=null;return _0x53e938[_0xc7ac('0x3f')]();});})['then'](function(){_0x23987e[_0xc7ac('0x2d')](0xc8)[_0xc7ac('0x2e')]({'message':_0xc7ac('0x52')});})[_0xc7ac('0x1c')](function(_0x188f5f){return handleError(_0x23987e,0x1f4,_0x188f5f);});};passport['use'](_0xc7ac('0x30'),new LocalStrategy({'usernameField':_0xc7ac('0xc'),'passwordField':_0xc7ac('0x4f')},function(_0x1a6f1b,_0x20d02d,_0x20d387){return localAuthenticate(db[_0xc7ac('0x38')],_0x1a6f1b,_0x20d02d,_0x20d387);})); \ No newline at end of file +var _0xd7e0=['trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','blockDuration','name','password','salt','role','blockedAt','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','allowedLoginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','generate'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0xd7e0,0x6b));var _0x0d7e=function(_0x2f5236,_0x18b1e8){_0x2f5236=_0x2f5236-0x0;var _0x1f9494=_0xd7e0[_0x2f5236];return _0x1f9494;};'use strict';var util=require('util');var passport=require(_0x0d7e('0x0'));var LocalStrategy=require(_0x0d7e('0x1'))['Strategy'];var jayson=require(_0x0d7e('0x2'));var _=require(_0x0d7e('0x3'));var rs=require(_0x0d7e('0x4'));var moment=require(_0x0d7e('0x5'));var db=require(_0x0d7e('0x6'))['db'];var authService=require(_0x0d7e('0x7'));var utils=require('../../config/utils');var client=jayson[_0x0d7e('0x8')][_0x0d7e('0x9')]({'port':0x232b});function localAuthenticate(_0x5d7fe8,_0x556fc2,_0x40bd9f,_0x23e9de){var _0x3946ef,_0x28269a;return db[_0x0d7e('0xa')][_0x0d7e('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0d7e('0xc')],'raw':!![]})['then'](function(_0x1a2dc7){_0x3946ef=_0x1a2dc7;return _0x5d7fe8[_0x0d7e('0xb')]({'attributes':['id',_0x0d7e('0xd'),_0x0d7e('0xe'),_0x0d7e('0xf'),_0x0d7e('0x10'),'disabled','blocked',_0x0d7e('0x11'),_0x0d7e('0x12')],'where':{'name':_0x556fc2,'role':{'$or':['admin',_0x0d7e('0x13'),_0x0d7e('0x14')]}}});})[_0x0d7e('0x15')](function(_0x3d4c14){if(!_0x3d4c14||_0x3d4c14&&_0x3d4c14['name']!==_0x556fc2){throw new Error(_0x0d7e('0x16'));}else{_0x28269a=_0x3d4c14;return _0x28269a;}})[_0x0d7e('0x15')](function(){_0x28269a[_0x0d7e('0x17')](_0x40bd9f,function(_0xc867ea,_0x1daa32){var _0x4290cc=_0x28269a[_0x0d7e('0x12')]+0x1;if(_0xc867ea){return _0x23e9de(_0xc867ea);}else if(!_0x1daa32){if(_0x28269a[_0x0d7e('0x18')]){return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});}else if(_0x3946ef[_0x0d7e('0x19')]>0x0){if(_0x28269a[_0x0d7e('0x1a')]){if(_0x3946ef[_0x0d7e('0xc')]>0x0){if(moment(_0x28269a['blockedAt'])[_0x0d7e('0x1b')](_0x3946ef[_0x0d7e('0xc')],_0x0d7e('0x1c'))>moment()){return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});}else{return utils['clearBlockUser'](_0x28269a,_0x4290cc,![],null)[_0x0d7e('0x15')](function(){return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});});}}else{return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});}}else{if(_0x4290cc>=_0x3946ef[_0x0d7e('0x19')]){return utils[_0x0d7e('0x1d')](_0x28269a,0x0,!![],moment())[_0x0d7e('0x15')](function(){return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});});}else{return utils[_0x0d7e('0x1d')](_0x28269a,_0x4290cc,![],null)[_0x0d7e('0x15')](function(){return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});});}}}else{return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});}}else{if(_0x28269a[_0x0d7e('0x18')]){return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});}else if(_0x3946ef[_0x0d7e('0x19')]>0x0){if(_0x28269a[_0x0d7e('0x1a')]){if(_0x3946ef[_0x0d7e('0xc')]>0x0){if(moment(_0x28269a['blockedAt'])[_0x0d7e('0x1b')](_0x3946ef['blockDuration'],_0x0d7e('0x1c'))>moment()){return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});}else{return utils[_0x0d7e('0x1d')](_0x28269a,0x0,![],null)['then'](function(){return utils[_0x0d7e('0x1e')](_0x28269a);})[_0x0d7e('0x15')](function(){return _0x23e9de(null,_0x28269a);});}}else{return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});}}else{return utils[_0x0d7e('0x1d')](_0x28269a,0x0,![],null)[_0x0d7e('0x15')](function(){return utils[_0x0d7e('0x1e')](_0x28269a);})[_0x0d7e('0x15')](function(){return _0x23e9de(null,_0x28269a);})['catch'](function(_0x41db6d){return _0x23e9de(null,![],_0x41db6d);});}}else{if(_0x28269a[_0x0d7e('0x1a')]){return _0x23e9de(null,![],{'message':_0x0d7e('0x16')});}else{return utils['getLicense'](_0x28269a)[_0x0d7e('0x15')](function(){return _0x23e9de(null,_0x28269a);});}}}});})[_0x0d7e('0x1f')](function(_0x35b029){return _0x23e9de(null,![],_0x35b029);});}function sendServiceMail(_0x26dbba){return db[_0x0d7e('0x20')][_0x0d7e('0x21')]({'where':{'service':!![]},'attributes':['id',_0x0d7e('0xd'),'email'],'include':[{'model':db[_0x0d7e('0x22')],'as':_0x0d7e('0x23'),'include':[{'model':db[_0x0d7e('0x24')],'as':_0x0d7e('0x24')}]}]})[_0x0d7e('0x15')](function(_0x3a4fcd){if(!_0x3a4fcd){throw new Error(_0x0d7e('0x25'));}var _0x206c3c=_0x3a4fcd[_0x0d7e('0x26')]();var _0x47d297={'account':_0x206c3c,'message':_['merge']({'from':util[_0x0d7e('0x27')](_0x0d7e('0x28'),_0x3a4fcd[_0x0d7e('0xd')],_0x3a4fcd[_0x0d7e('0x29')]||_0x3a4fcd[_0x0d7e('0x23')][_0x0d7e('0x13')])},_0x26dbba)};return client[_0x0d7e('0x2a')](_0x0d7e('0x2b'),_0x47d297);})[_0x0d7e('0x15')](function(_0x32ec78){if(_0x32ec78[_0x0d7e('0x2c')]){throw new Error(util[_0x0d7e('0x27')](_0x0d7e('0x2d'),_0x32ec78[_0x0d7e('0x2c')]['message']||JSON[_0x0d7e('0x2e')](_0x32ec78[_0x0d7e('0x2c')])));}return!![];});}function handleError(_0xffc782,_0x4f85fb,_0x3e6e61){return _0xffc782['status'](_0x4f85fb||0x1f4)[_0x0d7e('0x2f')]({'message':_0x3e6e61?_0x3e6e61[_0x0d7e('0x30')]||_0x3e6e61:''});}exports[_0x0d7e('0x31')]=function(_0x41127e,_0x4e521a,_0x513e75){passport[_0x0d7e('0x17')](_0x0d7e('0x32'),function(_0x45771a,_0x18cffd,_0xce956e){var _0x28f462=_0x45771a||_0xce956e;if(_0x28f462){return handleError(_0x4e521a,0x191,_0x28f462);}if(!_0x18cffd){return handleError(_0x4e521a,0x194,{'message':_0x0d7e('0x33')});}else{var _0x54d171={'payload':{'id':_0x18cffd['id'],'role':_0x18cffd[_0x0d7e('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x0d7e('0x34')](_0x54d171)[_0x0d7e('0x15')](function(_0x527190){_0x4e521a[_0x0d7e('0x35')]({'id':_0x18cffd['id'],'token':_0x527190,'statusCall':'','isAlreadyLogged':_0x18cffd[_0x0d7e('0x36')]});});}})(_0x41127e,_0x4e521a,_0x513e75);};exports['forgot']=function(_0x429462,_0xb80bb5){if(!_0x429462[_0x0d7e('0x37')]['email']){return handleError(_0xb80bb5,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x339330=rs[_0x0d7e('0x38')]();_0x429462[_0x0d7e('0x37')][_0x0d7e('0x29')]=_0x429462['body'][_0x0d7e('0x29')][_0x0d7e('0x39')]()[_0x0d7e('0x3a')]();var _0x11bca3;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x0d7e('0x19'),_0x0d7e('0xc')],'raw':!![]})[_0x0d7e('0x15')](function(_0x4bd5a1){_0x11bca3=_0x4bd5a1;return db[_0x0d7e('0x3b')][_0x0d7e('0x21')]({'where':{'email':_0x429462[_0x0d7e('0x37')][_0x0d7e('0x29')]}});})[_0x0d7e('0x15')](function(_0x14da4f){if(!_0x14da4f){throw new Error(_0x0d7e('0x3c'));}if(_0x14da4f['disabled']){throw new Error(_0x0d7e('0x3d'));}if(_0x14da4f['blocked']){if(moment(_0x14da4f[_0x0d7e('0x11')])[_0x0d7e('0x1b')](_0x11bca3[_0x0d7e('0xc')],_0x0d7e('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x14da4f[_0x0d7e('0x1a')]=![];_0x14da4f[_0x0d7e('0x11')]=null;}}_0x14da4f[_0x0d7e('0x3e')]=_0x339330;_0x14da4f[_0x0d7e('0x3f')]=Date['now']()+0x36ee80;return _0x14da4f[_0x0d7e('0x40')]();})[_0x0d7e('0x15')](function(){return sendServiceMail({'to':_0x429462['body'][_0x0d7e('0x29')],'subject':_0x0d7e('0x41'),'text':_0x0d7e('0x42')+_0x0d7e('0x43')+_0x0d7e('0x44')+_0x429462['headers'][_0x0d7e('0x45')]+_0x0d7e('0x46')+_0x339330+'\x0a\x0a'+_0x0d7e('0x47')});})[_0x0d7e('0x15')](function(){_0xb80bb5['status'](0xc8)[_0x0d7e('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0x0d7e('0x1f')](function(_0x59168a){return handleError(_0xb80bb5,0x1f4,_0x59168a);});};exports[_0x0d7e('0x48')]=function(_0x4fe424,_0x2de091){return db[_0x0d7e('0x3b')][_0x0d7e('0x21')]({'where':{'resetPasswordToken':_0x4fe424[_0x0d7e('0x49')][_0x0d7e('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x0d7e('0x15')](function(_0x3539d4){if(!_0x3539d4){throw new Error(_0x0d7e('0x4b'));}return db['Setting'][_0x0d7e('0xb')]({'attributes':['id',_0x0d7e('0x4c'),_0x0d7e('0x4d'),_0x0d7e('0x4e')]})[_0x0d7e('0x15')](function(_0x358e68){if(_0x358e68[_0x0d7e('0x4c')])authService['validatePasswordPattern'](_0x4fe424[_0x0d7e('0x37')][_0x0d7e('0xe')]);if(!_0x358e68[_0x0d7e('0x4d')]||!_0x3539d4[_0x0d7e('0x4f')])return _0x3539d4;authService[_0x0d7e('0x50')](_0x4fe424['body'][_0x0d7e('0xe')],_0x3539d4[_0x0d7e('0x4f')],_0x358e68[_0x0d7e('0x4e')]);return _0x3539d4;})[_0x0d7e('0x15')](function(){_0x3539d4[_0x0d7e('0xe')]=_0x4fe424[_0x0d7e('0x37')][_0x0d7e('0xe')];_0x3539d4['resetPasswordToken']=null;_0x3539d4[_0x0d7e('0x3f')]=null;return _0x3539d4[_0x0d7e('0x40')]();});})['then'](function(){_0x2de091['status'](0xc8)[_0x0d7e('0x2f')]({'message':_0x0d7e('0x51')});})[_0x0d7e('0x1f')](function(_0x1ed386){return handleError(_0x2de091,0x1f4,_0x1ed386);});};passport['use'](_0x0d7e('0x32'),new LocalStrategy({'usernameField':_0x0d7e('0xd'),'passwordField':_0x0d7e('0xe')},function(_0x4afeaa,_0x2b9ae8,_0x2f6e5f){return localAuthenticate(db[_0x0d7e('0x3b')],_0x4afeaa,_0x2b9ae8,_0x2f6e5f);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index fdc1681..857b22f 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 _0x6d21=['/reset/:token','reset','exports','Router','./authLocal.controller','login','post'];(function(_0x272233,_0x4d1a8d){var _0x2ea904=function(_0x106858){while(--_0x106858){_0x272233['push'](_0x272233['shift']());}};_0x2ea904(++_0x4d1a8d);}(_0x6d21,0x1e6));var _0x16d2=function(_0x5dee67,_0x5c4f71){_0x5dee67=_0x5dee67-0x0;var _0x3125f8=_0x6d21[_0x5dee67];return _0x3125f8;};'use strict';var express=require('express');var router=express[_0x16d2('0x0')]();var controller=require(_0x16d2('0x1'));router['post']('/',controller[_0x16d2('0x2')]);router[_0x16d2('0x3')]('/forgot',controller['forgot']);router[_0x16d2('0x3')](_0x16d2('0x4'),controller[_0x16d2('0x5')]);module[_0x16d2('0x6')]=router; \ No newline at end of file +var _0xc799=['reset','exports','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xc799,0x1b2));var _0x9c79=function(_0xf568e6,_0x255b87){_0xf568e6=_0xf568e6-0x0;var _0x50b9ca=_0xc799[_0xf568e6];return _0x50b9ca;};'use strict';var express=require('express');var router=express[_0x9c79('0x0')]();var controller=require(_0x9c79('0x1'));router[_0x9c79('0x2')]('/',controller[_0x9c79('0x3')]);router[_0x9c79('0x2')](_0x9c79('0x4'),controller[_0x9c79('0x5')]);router[_0x9c79('0x2')]('/reset/:token',controller[_0x9c79('0x6')]);module[_0x9c79('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 3308e20..84a40d7 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 _0x3313=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3451fa,_0x41ae9f){var _0x15f8d1=function(_0x28cd93){while(--_0x28cd93){_0x3451fa['push'](_0x3451fa['shift']());}};_0x15f8d1(++_0x41ae9f);}(_0x3313,0x16b));var _0x3331=function(_0xf83534,_0x783a48){_0xf83534=_0xf83534-0x0;var _0x4a3914=_0x3313[_0xf83534];return _0x4a3914;};'use strict';var Sequelize=require(_0x3331('0x0'));module[_0x3331('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3331('0x2')]},'description':{'type':Sequelize[_0x3331('0x2')]},'status':{'type':Sequelize[_0x3331('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xb6ea=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x2fbc9e,_0x47ea04){var _0x3d4225=function(_0x146f94){while(--_0x146f94){_0x2fbc9e['push'](_0x2fbc9e['shift']());}};_0x3d4225(++_0x47ea04);}(_0xb6ea,0x18d));var _0xab6e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb6ea[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xab6e('0x0'));module['exports']={'name':{'type':Sequelize[_0xab6e('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xab6e('0x1')]},'description':{'type':Sequelize[_0xab6e('0x1')]},'status':{'type':Sequelize[_0xab6e('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xab6e('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 3ef0d0e..261834b 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 _0xe669=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','rows','catch','show','params','includeAll','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','Action','addActions','getActions','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','Automation','rawAttributes','fieldName','type'];(function(_0x27ec83,_0x5a10db){var _0x1758d3=function(_0x4bab5f){while(--_0x4bab5f){_0x27ec83['push'](_0x27ec83['shift']());}};_0x1758d3(++_0x5a10db);}(_0xe669,0x1be));var _0x9e66=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xe669[_0x1c8c28];return _0x1f59b4;};'use strict';var emlformat=require(_0x9e66('0x0'));var rimraf=require(_0x9e66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e66('0x2'));var rp=require('request-promise');var moment=require(_0x9e66('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9e66('0x4'));var util=require(_0x9e66('0x5'));var path=require(_0x9e66('0x6'));var sox=require(_0x9e66('0x7'));var csv=require(_0x9e66('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e66('0x9'));var _=require(_0x9e66('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9e66('0xb'));var deskjs=require(_0x9e66('0xc'));var toCsv=require(_0x9e66('0x8'));var querystring=require(_0x9e66('0xd'));var Papa=require(_0x9e66('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9e66('0xf'));var as=require(_0x9e66('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e66('0x11'))(_0x9e66('0x12'));var utils=require('../../config/utils');var config=require(_0x9e66('0x13'));var licenseUtil=require(_0x9e66('0x14'));var db=require(_0x9e66('0x15'))['db'];function respondWithStatusCode(_0x119bcd,_0xbb7e3d){_0xbb7e3d=_0xbb7e3d||0xcc;return function(_0x321ddf){if(_0x321ddf){return _0x119bcd[_0x9e66('0x16')](_0xbb7e3d);}return _0x119bcd[_0x9e66('0x17')](_0xbb7e3d)['end']();};}function respondWithResult(_0x1bdf4b,_0x15ce16){_0x15ce16=_0x15ce16||0xc8;return function(_0x28c250){if(_0x28c250){return _0x1bdf4b[_0x9e66('0x17')](_0x15ce16)[_0x9e66('0x18')](_0x28c250);}};}function respondWithFilteredResult(_0x1f101c,_0x55176f){return function(_0x52919f){if(_0x52919f){var _0x53c59f=typeof _0x55176f['offset']==='undefined'&&typeof _0x55176f[_0x9e66('0x19')]===_0x9e66('0x1a');var _0x2f9921=_0x52919f['count'];var _0x3853b=_0x53c59f?0x0:_0x55176f['offset'];var _0x32c63a=_0x53c59f?_0x52919f[_0x9e66('0x1b')]:_0x55176f[_0x9e66('0x1c')]+_0x55176f[_0x9e66('0x19')];var _0x1a4ddd;if(_0x32c63a>=_0x2f9921){_0x32c63a=_0x2f9921;_0x1a4ddd=0xc8;}else{_0x1a4ddd=0xce;}_0x1f101c['status'](_0x1a4ddd);return _0x1f101c[_0x9e66('0x1d')](_0x9e66('0x1e'),_0x3853b+'-'+_0x32c63a+'/'+_0x2f9921)[_0x9e66('0x18')](_0x52919f);}return null;};}function patchUpdates(_0x5476c7){return function(_0xc18755){try{jsonpatch[_0x9e66('0x1f')](_0xc18755,_0x5476c7,!![]);}catch(_0x1dabf8){return BPromise[_0x9e66('0x20')](_0x1dabf8);}return _0xc18755[_0x9e66('0x21')]();};}function saveUpdates(_0x1e9e80,_0x5d319a){return function(_0x12b1e6){if(_0x12b1e6){return _0x12b1e6[_0x9e66('0x22')](_0x1e9e80)[_0x9e66('0x23')](function(_0x4f2d5a){return _0x4f2d5a;});}return null;};}function removeEntity(_0x1d4d91,_0x597506){return function(_0xe4b9b8){if(_0xe4b9b8){return _0xe4b9b8[_0x9e66('0x24')]()[_0x9e66('0x23')](function(){_0x1d4d91[_0x9e66('0x17')](0xcc)[_0x9e66('0x25')]();});}};}function handleEntityNotFound(_0x3c807b,_0x36226e){return function(_0x387d98){if(!_0x387d98){_0x3c807b[_0x9e66('0x16')](0x194);}return _0x387d98;};}function handleError(_0x52af07,_0x17a032){_0x17a032=_0x17a032||0x1f4;return function(_0x254acc){logger['error'](_0x254acc[_0x9e66('0x26')]);if(_0x254acc['name']){delete _0x254acc[_0x9e66('0x27')];}_0x52af07[_0x9e66('0x17')](_0x17a032)[_0x9e66('0x28')](_0x254acc);};}exports['index']=function(_0x209da2,_0x580d43){var _0x5ba049={},_0x18959f={},_0x247473={'count':0x0,'rows':[]};var _0x25ec67=_[_0x9e66('0x29')](db[_0x9e66('0x2a')][_0x9e66('0x2b')],function(_0x4f93ed){return{'name':_0x4f93ed[_0x9e66('0x2c')],'type':_0x4f93ed[_0x9e66('0x2d')][_0x9e66('0x2e')]};});_0x18959f[_0x9e66('0x2f')]=_[_0x9e66('0x29')](_0x25ec67,_0x9e66('0x27'));_0x18959f['query']=_[_0x9e66('0x30')](_0x209da2[_0x9e66('0x31')]);_0x18959f[_0x9e66('0x32')]=_[_0x9e66('0x33')](_0x18959f['model'],_0x18959f[_0x9e66('0x31')]);_0x5ba049[_0x9e66('0x34')]=_['intersection'](_0x18959f[_0x9e66('0x2f')],qs[_0x9e66('0x35')](_0x209da2[_0x9e66('0x31')][_0x9e66('0x35')]));_0x5ba049['attributes']=_0x5ba049[_0x9e66('0x34')][_0x9e66('0x36')]?_0x5ba049[_0x9e66('0x34')]:_0x18959f[_0x9e66('0x2f')];if(!_0x209da2[_0x9e66('0x31')][_0x9e66('0x37')]('nolimit')){_0x5ba049[_0x9e66('0x19')]=qs[_0x9e66('0x19')](_0x209da2['query'][_0x9e66('0x19')]);_0x5ba049['offset']=qs[_0x9e66('0x1c')](_0x209da2[_0x9e66('0x31')][_0x9e66('0x1c')]);}_0x5ba049[_0x9e66('0x38')]=qs['sort'](_0x209da2[_0x9e66('0x31')][_0x9e66('0x39')]);_0x5ba049[_0x9e66('0x3a')]=qs['filters'](_[_0x9e66('0x3b')](_0x209da2[_0x9e66('0x31')],_0x18959f[_0x9e66('0x32')]),_0x25ec67);if(_0x209da2['query']['filter']){_0x5ba049[_0x9e66('0x3a')]=_[_0x9e66('0x3c')](_0x5ba049[_0x9e66('0x3a')],{'$or':_[_0x9e66('0x29')](_0x25ec67,function(_0xf7566f){if(_0xf7566f[_0x9e66('0x2d')]!=='VIRTUAL'){var _0x489679={};_0x489679[_0xf7566f[_0x9e66('0x27')]]={'$like':'%'+_0x209da2[_0x9e66('0x31')][_0x9e66('0x3d')]+'%'};return _0x489679;}})});}_0x5ba049=_[_0x9e66('0x3c')]({},_0x5ba049,_0x209da2[_0x9e66('0x3e')]);var _0x1aad33={'where':_0x5ba049[_0x9e66('0x3a')]};return db[_0x9e66('0x2a')][_0x9e66('0x1b')](_0x1aad33)['then'](function(_0x3ff7cb){_0x247473['count']=_0x3ff7cb;if(_0x209da2[_0x9e66('0x31')]['includeAll']){_0x5ba049[_0x9e66('0x3f')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x5ba049);})[_0x9e66('0x23')](function(_0x330f83){_0x247473[_0x9e66('0x40')]=_0x330f83;return _0x247473;})[_0x9e66('0x23')](respondWithFilteredResult(_0x580d43,_0x5ba049))[_0x9e66('0x41')](handleError(_0x580d43,null));};exports[_0x9e66('0x42')]=function(_0x3a3b8f,_0x2b3982){var _0x2b1ca1={'raw':![],'where':{'id':_0x3a3b8f[_0x9e66('0x43')]['id']}},_0x579eb5={};_0x579eb5[_0x9e66('0x2f')]=_[_0x9e66('0x30')](db[_0x9e66('0x2a')][_0x9e66('0x2b')]);_0x579eb5[_0x9e66('0x31')]=_[_0x9e66('0x30')](_0x3a3b8f[_0x9e66('0x31')]);_0x579eb5[_0x9e66('0x32')]=_['intersection'](_0x579eb5[_0x9e66('0x2f')],_0x579eb5[_0x9e66('0x31')]);_0x2b1ca1[_0x9e66('0x34')]=_['intersection'](_0x579eb5['model'],qs[_0x9e66('0x35')](_0x3a3b8f[_0x9e66('0x31')]['fields']));_0x2b1ca1['attributes']=_0x2b1ca1[_0x9e66('0x34')][_0x9e66('0x36')]?_0x2b1ca1[_0x9e66('0x34')]:_0x579eb5[_0x9e66('0x2f')];if(_0x3a3b8f['query'][_0x9e66('0x44')]){_0x2b1ca1['include']=[{'all':!![]}];}_0x2b1ca1=_[_0x9e66('0x3c')]({},_0x2b1ca1,_0x3a3b8f['options']);return db[_0x9e66('0x2a')]['find'](_0x2b1ca1)[_0x9e66('0x23')](handleEntityNotFound(_0x2b3982,null))['then'](respondWithResult(_0x2b3982,null))[_0x9e66('0x41')](handleError(_0x2b3982,null));};exports[_0x9e66('0x45')]=function(_0xb57966,_0x158fc2){return db[_0x9e66('0x2a')][_0x9e66('0x45')](_0xb57966[_0x9e66('0x46')],{})[_0x9e66('0x23')](respondWithResult(_0x158fc2,0xc9))[_0x9e66('0x41')](handleError(_0x158fc2,null));};exports[_0x9e66('0x22')]=function(_0xff9fe9,_0x19aa46){if(_0xff9fe9['body']['id']){delete _0xff9fe9[_0x9e66('0x46')]['id'];}return db[_0x9e66('0x2a')][_0x9e66('0x47')]({'where':{'id':_0xff9fe9['params']['id']}})[_0x9e66('0x23')](handleEntityNotFound(_0x19aa46,null))['then'](saveUpdates(_0xff9fe9[_0x9e66('0x46')],null))[_0x9e66('0x23')](respondWithResult(_0x19aa46,null))[_0x9e66('0x41')](handleError(_0x19aa46,null));};exports['destroy']=function(_0x3090d9,_0x2dfe12){return db['Automation'][_0x9e66('0x47')]({'where':{'id':_0x3090d9[_0x9e66('0x43')]['id']}})[_0x9e66('0x23')](handleEntityNotFound(_0x2dfe12,null))[_0x9e66('0x23')](removeEntity(_0x2dfe12,null))[_0x9e66('0x41')](handleError(_0x2dfe12,null));};exports[_0x9e66('0x48')]=function(_0xd036a,_0x143dbe,_0x58ead9){return db[_0x9e66('0x49')][_0x9e66('0x47')]({'where':{'id':_0xd036a[_0x9e66('0x43')]['id']}})[_0x9e66('0x23')](handleEntityNotFound(_0x143dbe,null))[_0x9e66('0x23')](function(_0x328861){if(_0x328861){return _0x328861['addConditions'](_0xd036a[_0x9e66('0x46')][_0x9e66('0x4a')],_[_0x9e66('0x4b')](_0xd036a[_0x9e66('0x46')],[_0x9e66('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x143dbe,null))[_0x9e66('0x41')](handleError(_0x143dbe,null));};exports[_0x9e66('0x4c')]=function(_0x518aa2,_0x566dbf,_0x12aebb){var _0x14b178={};var _0x28a31f={};var _0x2347fe;var _0x1e8228;return db[_0x9e66('0x2a')][_0x9e66('0x4d')]({'where':{'id':_0x518aa2['params']['id']}})[_0x9e66('0x23')](handleEntityNotFound(_0x566dbf,null))[_0x9e66('0x23')](function(_0x556dc7){if(_0x556dc7){_0x2347fe=_0x556dc7;_0x28a31f[_0x9e66('0x2f')]=_[_0x9e66('0x30')](db[_0x9e66('0x49')][_0x9e66('0x2b')]);_0x28a31f['query']=_[_0x9e66('0x30')](_0x518aa2[_0x9e66('0x31')]);_0x28a31f[_0x9e66('0x32')]=_[_0x9e66('0x33')](_0x28a31f[_0x9e66('0x2f')],_0x28a31f['query']);_0x14b178[_0x9e66('0x34')]=_[_0x9e66('0x33')](_0x28a31f[_0x9e66('0x2f')],qs['fields'](_0x518aa2[_0x9e66('0x31')][_0x9e66('0x35')]));_0x14b178[_0x9e66('0x34')]=_0x14b178[_0x9e66('0x34')]['length']?_0x14b178[_0x9e66('0x34')]:_0x28a31f['model'];_0x14b178[_0x9e66('0x38')]=qs[_0x9e66('0x39')](_0x518aa2[_0x9e66('0x31')]['sort']);_0x14b178['where']=qs[_0x9e66('0x32')](_[_0x9e66('0x3b')](_0x518aa2[_0x9e66('0x31')],_0x28a31f['filters']));if(_0x518aa2[_0x9e66('0x31')]['filter']){_0x14b178[_0x9e66('0x3a')]=_[_0x9e66('0x3c')](_0x14b178[_0x9e66('0x3a')],{'$or':_[_0x9e66('0x29')](_0x14b178[_0x9e66('0x34')],function(_0x3165b3){var _0xba90b8={};_0xba90b8[_0x3165b3]={'$like':'%'+_0x518aa2[_0x9e66('0x31')][_0x9e66('0x3d')]+'%'};return _0xba90b8;})});}_0x14b178=_[_0x9e66('0x3c')]({},_0x14b178,_0x518aa2['options']);return _0x2347fe['getConditions'](_0x14b178);}})['then'](function(_0x193872){if(_0x193872){_0x1e8228=_0x193872[_0x9e66('0x36')];if(!_0x518aa2['query'][_0x9e66('0x37')](_0x9e66('0x4e'))){_0x14b178[_0x9e66('0x19')]=qs['limit'](_0x518aa2['query'][_0x9e66('0x19')]);_0x14b178[_0x9e66('0x1c')]=qs['offset'](_0x518aa2[_0x9e66('0x31')]['offset']);}return _0x2347fe[_0x9e66('0x4c')](_0x14b178);}})[_0x9e66('0x23')](function(_0x48d7e5){if(_0x48d7e5){return _0x48d7e5?{'count':_0x1e8228,'rows':_0x48d7e5}:null;}})[_0x9e66('0x23')](respondWithResult(_0x566dbf,null))[_0x9e66('0x41')](handleError(_0x566dbf,null));};exports['addActions']=function(_0x3c761f,_0x1102ce,_0x263b6a){return db[_0x9e66('0x4f')][_0x9e66('0x47')]({'where':{'id':_0x3c761f[_0x9e66('0x43')]['id']}})[_0x9e66('0x23')](handleEntityNotFound(_0x1102ce,null))[_0x9e66('0x23')](function(_0x30a60f){if(_0x30a60f){return _0x30a60f[_0x9e66('0x50')](_0x3c761f[_0x9e66('0x46')][_0x9e66('0x4a')],_[_0x9e66('0x4b')](_0x3c761f['body'],[_0x9e66('0x4a'),'id'])||{});}})[_0x9e66('0x23')](respondWithResult(_0x1102ce,null))[_0x9e66('0x41')](handleError(_0x1102ce,null));};exports[_0x9e66('0x51')]=function(_0x1cef68,_0x1a3902,_0x3140a5){var _0x1715fa={};var _0x1b2e40={};var _0x61b70d;var _0x3e606b;return db['Automation']['findOne']({'where':{'id':_0x1cef68[_0x9e66('0x43')]['id']}})[_0x9e66('0x23')](handleEntityNotFound(_0x1a3902,null))['then'](function(_0x315d73){if(_0x315d73){_0x61b70d=_0x315d73;_0x1b2e40[_0x9e66('0x2f')]=_[_0x9e66('0x30')](db[_0x9e66('0x4f')]['rawAttributes']);_0x1b2e40[_0x9e66('0x31')]=_[_0x9e66('0x30')](_0x1cef68['query']);_0x1b2e40[_0x9e66('0x32')]=_[_0x9e66('0x33')](_0x1b2e40[_0x9e66('0x2f')],_0x1b2e40['query']);_0x1715fa['attributes']=_[_0x9e66('0x33')](_0x1b2e40[_0x9e66('0x2f')],qs['fields'](_0x1cef68['query']['fields']));_0x1715fa[_0x9e66('0x34')]=_0x1715fa[_0x9e66('0x34')][_0x9e66('0x36')]?_0x1715fa[_0x9e66('0x34')]:_0x1b2e40[_0x9e66('0x2f')];_0x1715fa['order']=qs[_0x9e66('0x39')](_0x1cef68[_0x9e66('0x31')][_0x9e66('0x39')]);_0x1715fa[_0x9e66('0x3a')]=qs[_0x9e66('0x32')](_[_0x9e66('0x3b')](_0x1cef68[_0x9e66('0x31')],_0x1b2e40[_0x9e66('0x32')]));if(_0x1cef68['query'][_0x9e66('0x3d')]){_0x1715fa[_0x9e66('0x3a')]=_[_0x9e66('0x3c')](_0x1715fa[_0x9e66('0x3a')],{'$or':_[_0x9e66('0x29')](_0x1715fa[_0x9e66('0x34')],function(_0xe8dd7d){var _0x48f178={};_0x48f178[_0xe8dd7d]={'$like':'%'+_0x1cef68[_0x9e66('0x31')][_0x9e66('0x3d')]+'%'};return _0x48f178;})});}_0x1715fa=_[_0x9e66('0x3c')]({},_0x1715fa,_0x1cef68['options']);return _0x61b70d['getActions'](_0x1715fa);}})[_0x9e66('0x23')](function(_0x3e408a){if(_0x3e408a){_0x3e606b=_0x3e408a['length'];if(!_0x1cef68[_0x9e66('0x31')]['hasOwnProperty'](_0x9e66('0x4e'))){_0x1715fa['limit']=qs[_0x9e66('0x19')](_0x1cef68[_0x9e66('0x31')][_0x9e66('0x19')]);_0x1715fa[_0x9e66('0x1c')]=qs['offset'](_0x1cef68['query'][_0x9e66('0x1c')]);}return _0x61b70d[_0x9e66('0x51')](_0x1715fa);}})[_0x9e66('0x23')](function(_0x129e10){if(_0x129e10){return _0x129e10?{'count':_0x3e606b,'rows':_0x129e10}:null;}})[_0x9e66('0x23')](respondWithResult(_0x1a3902,null))['catch'](handleError(_0x1a3902,null));}; \ No newline at end of file +var _0xb698=['length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','Condition','addConditions','ids','omit','findOne','getConditions','hasOwnProperty','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','map','Automation','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0xb698,0x78));var _0x8b69=function(_0x215b45,_0x45e5cb){_0x215b45=_0x215b45-0x0;var _0x559eda=_0xb698[_0x215b45];return _0x559eda;};'use strict';var emlformat=require(_0x8b69('0x0'));var rimraf=require(_0x8b69('0x1'));var zipdir=require(_0x8b69('0x2'));var jsonpatch=require(_0x8b69('0x3'));var rp=require(_0x8b69('0x4'));var moment=require(_0x8b69('0x5'));var BPromise=require(_0x8b69('0x6'));var Mustache=require('mustache');var util=require(_0x8b69('0x7'));var path=require(_0x8b69('0x8'));var sox=require(_0x8b69('0x9'));var csv=require('to-csv');var ejs=require(_0x8b69('0xa'));var fs=require('fs');var fs_extra=require(_0x8b69('0xb'));var _=require(_0x8b69('0xc'));var squel=require(_0x8b69('0xd'));var crypto=require(_0x8b69('0xe'));var jsforce=require(_0x8b69('0xf'));var deskjs=require(_0x8b69('0x10'));var toCsv=require(_0x8b69('0x11'));var querystring=require(_0x8b69('0x12'));var Papa=require(_0x8b69('0x13'));var Redis=require(_0x8b69('0x14'));var authService=require(_0x8b69('0x15'));var qs=require(_0x8b69('0x16'));var as=require(_0x8b69('0x17'));var hardwareService=require(_0x8b69('0x18'));var logger=require(_0x8b69('0x19'))(_0x8b69('0x1a'));var utils=require(_0x8b69('0x1b'));var config=require(_0x8b69('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b69('0x1d'))['db'];function respondWithStatusCode(_0x5d3406,_0x33f65f){_0x33f65f=_0x33f65f||0xcc;return function(_0x584f13){if(_0x584f13){return _0x5d3406[_0x8b69('0x1e')](_0x33f65f);}return _0x5d3406[_0x8b69('0x1f')](_0x33f65f)[_0x8b69('0x20')]();};}function respondWithResult(_0x2802cb,_0x457bed){_0x457bed=_0x457bed||0xc8;return function(_0xdfd9db){if(_0xdfd9db){return _0x2802cb[_0x8b69('0x1f')](_0x457bed)[_0x8b69('0x21')](_0xdfd9db);}};}function respondWithFilteredResult(_0xaa8f35,_0x2246f8){return function(_0xf07b2c){if(_0xf07b2c){var _0x6687b2=typeof _0x2246f8[_0x8b69('0x22')]===_0x8b69('0x23')&&typeof _0x2246f8['limit']===_0x8b69('0x23');var _0x342341=_0xf07b2c['count'];var _0x3ff26f=_0x6687b2?0x0:_0x2246f8[_0x8b69('0x22')];var _0x453735=_0x6687b2?_0xf07b2c[_0x8b69('0x24')]:_0x2246f8[_0x8b69('0x22')]+_0x2246f8[_0x8b69('0x25')];var _0x3188e9;if(_0x453735>=_0x342341){_0x453735=_0x342341;_0x3188e9=0xc8;}else{_0x3188e9=0xce;}_0xaa8f35['status'](_0x3188e9);return _0xaa8f35[_0x8b69('0x26')]('Content-Range',_0x3ff26f+'-'+_0x453735+'/'+_0x342341)[_0x8b69('0x21')](_0xf07b2c);}return null;};}function patchUpdates(_0x2a571c){return function(_0x59ade7){try{jsonpatch[_0x8b69('0x27')](_0x59ade7,_0x2a571c,!![]);}catch(_0x5ce9c8){return BPromise[_0x8b69('0x28')](_0x5ce9c8);}return _0x59ade7[_0x8b69('0x29')]();};}function saveUpdates(_0x597552,_0x2f044c){return function(_0x245c18){if(_0x245c18){return _0x245c18[_0x8b69('0x2a')](_0x597552)[_0x8b69('0x2b')](function(_0x541a95){return _0x541a95;});}return null;};}function removeEntity(_0x40c6fb,_0x1e2069){return function(_0x2c4f06){if(_0x2c4f06){return _0x2c4f06[_0x8b69('0x2c')]()[_0x8b69('0x2b')](function(){_0x40c6fb[_0x8b69('0x1f')](0xcc)[_0x8b69('0x20')]();});}};}function handleEntityNotFound(_0x254a63,_0x7b8849){return function(_0x3f323e){if(!_0x3f323e){_0x254a63[_0x8b69('0x1e')](0x194);}return _0x3f323e;};}function handleError(_0xcdfccc,_0xff8c68){_0xff8c68=_0xff8c68||0x1f4;return function(_0x59f072){logger['error'](_0x59f072[_0x8b69('0x2d')]);if(_0x59f072['name']){delete _0x59f072[_0x8b69('0x2e')];}_0xcdfccc['status'](_0xff8c68)[_0x8b69('0x2f')](_0x59f072);};}exports['index']=function(_0x29ce1a,_0x2897ee){var _0xdf3841={},_0x1521d7={},_0x1f1b88={'count':0x0,'rows':[]};var _0x344001=_[_0x8b69('0x30')](db[_0x8b69('0x31')]['rawAttributes'],function(_0x447a77){return{'name':_0x447a77['fieldName'],'type':_0x447a77[_0x8b69('0x32')][_0x8b69('0x33')]};});_0x1521d7[_0x8b69('0x34')]=_['map'](_0x344001,_0x8b69('0x2e'));_0x1521d7[_0x8b69('0x35')]=_['keys'](_0x29ce1a['query']);_0x1521d7[_0x8b69('0x36')]=_[_0x8b69('0x37')](_0x1521d7[_0x8b69('0x34')],_0x1521d7['query']);_0xdf3841[_0x8b69('0x38')]=_['intersection'](_0x1521d7[_0x8b69('0x34')],qs[_0x8b69('0x39')](_0x29ce1a[_0x8b69('0x35')][_0x8b69('0x39')]));_0xdf3841[_0x8b69('0x38')]=_0xdf3841['attributes'][_0x8b69('0x3a')]?_0xdf3841['attributes']:_0x1521d7[_0x8b69('0x34')];if(!_0x29ce1a[_0x8b69('0x35')]['hasOwnProperty']('nolimit')){_0xdf3841['limit']=qs[_0x8b69('0x25')](_0x29ce1a['query']['limit']);_0xdf3841[_0x8b69('0x22')]=qs[_0x8b69('0x22')](_0x29ce1a[_0x8b69('0x35')]['offset']);}_0xdf3841[_0x8b69('0x3b')]=qs[_0x8b69('0x3c')](_0x29ce1a[_0x8b69('0x35')][_0x8b69('0x3c')]);_0xdf3841[_0x8b69('0x3d')]=qs[_0x8b69('0x36')](_[_0x8b69('0x3e')](_0x29ce1a['query'],_0x1521d7[_0x8b69('0x36')]),_0x344001);if(_0x29ce1a[_0x8b69('0x35')][_0x8b69('0x3f')]){_0xdf3841[_0x8b69('0x3d')]=_[_0x8b69('0x40')](_0xdf3841[_0x8b69('0x3d')],{'$or':_['map'](_0x344001,function(_0x27fc6f){if(_0x27fc6f[_0x8b69('0x32')]!==_0x8b69('0x41')){var _0x23ae15={};_0x23ae15[_0x27fc6f[_0x8b69('0x2e')]]={'$like':'%'+_0x29ce1a[_0x8b69('0x35')]['filter']+'%'};return _0x23ae15;}})});}_0xdf3841=_[_0x8b69('0x40')]({},_0xdf3841,_0x29ce1a[_0x8b69('0x42')]);var _0x4bfa89={'where':_0xdf3841['where']};return db[_0x8b69('0x31')]['count'](_0x4bfa89)[_0x8b69('0x2b')](function(_0x23661a){_0x1f1b88[_0x8b69('0x24')]=_0x23661a;if(_0x29ce1a[_0x8b69('0x35')]['includeAll']){_0xdf3841[_0x8b69('0x43')]=[{'all':!![]}];}return db['Automation'][_0x8b69('0x44')](_0xdf3841);})[_0x8b69('0x2b')](function(_0x44c034){_0x1f1b88[_0x8b69('0x45')]=_0x44c034;return _0x1f1b88;})[_0x8b69('0x2b')](respondWithFilteredResult(_0x2897ee,_0xdf3841))[_0x8b69('0x46')](handleError(_0x2897ee,null));};exports[_0x8b69('0x47')]=function(_0x1035e1,_0xec2981){var _0x43a2db={'raw':![],'where':{'id':_0x1035e1[_0x8b69('0x48')]['id']}},_0x4cdaea={};_0x4cdaea[_0x8b69('0x34')]=_[_0x8b69('0x49')](db[_0x8b69('0x31')][_0x8b69('0x4a')]);_0x4cdaea[_0x8b69('0x35')]=_[_0x8b69('0x49')](_0x1035e1[_0x8b69('0x35')]);_0x4cdaea[_0x8b69('0x36')]=_['intersection'](_0x4cdaea[_0x8b69('0x34')],_0x4cdaea[_0x8b69('0x35')]);_0x43a2db['attributes']=_[_0x8b69('0x37')](_0x4cdaea[_0x8b69('0x34')],qs[_0x8b69('0x39')](_0x1035e1[_0x8b69('0x35')][_0x8b69('0x39')]));_0x43a2db['attributes']=_0x43a2db[_0x8b69('0x38')][_0x8b69('0x3a')]?_0x43a2db[_0x8b69('0x38')]:_0x4cdaea[_0x8b69('0x34')];if(_0x1035e1[_0x8b69('0x35')]['includeAll']){_0x43a2db['include']=[{'all':!![]}];}_0x43a2db=_['merge']({},_0x43a2db,_0x1035e1['options']);return db[_0x8b69('0x31')][_0x8b69('0x4b')](_0x43a2db)[_0x8b69('0x2b')](handleEntityNotFound(_0xec2981,null))['then'](respondWithResult(_0xec2981,null))[_0x8b69('0x46')](handleError(_0xec2981,null));};exports[_0x8b69('0x4c')]=function(_0x2921d1,_0x55eb16){return db[_0x8b69('0x31')][_0x8b69('0x4c')](_0x2921d1['body'],{})[_0x8b69('0x2b')](respondWithResult(_0x55eb16,0xc9))[_0x8b69('0x46')](handleError(_0x55eb16,null));};exports[_0x8b69('0x2a')]=function(_0x2599e0,_0x40aa42){if(_0x2599e0['body']['id']){delete _0x2599e0[_0x8b69('0x4d')]['id'];}return db[_0x8b69('0x31')][_0x8b69('0x4b')]({'where':{'id':_0x2599e0[_0x8b69('0x48')]['id']}})[_0x8b69('0x2b')](handleEntityNotFound(_0x40aa42,null))[_0x8b69('0x2b')](saveUpdates(_0x2599e0[_0x8b69('0x4d')],null))[_0x8b69('0x2b')](respondWithResult(_0x40aa42,null))['catch'](handleError(_0x40aa42,null));};exports['destroy']=function(_0x51902c,_0x4f0b75){return db[_0x8b69('0x31')][_0x8b69('0x4b')]({'where':{'id':_0x51902c[_0x8b69('0x48')]['id']}})[_0x8b69('0x2b')](handleEntityNotFound(_0x4f0b75,null))[_0x8b69('0x2b')](removeEntity(_0x4f0b75,null))['catch'](handleError(_0x4f0b75,null));};exports['addConditions']=function(_0x59b880,_0x3c5d52,_0xfcb2bd){return db[_0x8b69('0x4e')]['find']({'where':{'id':_0x59b880[_0x8b69('0x48')]['id']}})[_0x8b69('0x2b')](handleEntityNotFound(_0x3c5d52,null))[_0x8b69('0x2b')](function(_0x766df4){if(_0x766df4){return _0x766df4[_0x8b69('0x4f')](_0x59b880[_0x8b69('0x4d')][_0x8b69('0x50')],_[_0x8b69('0x51')](_0x59b880[_0x8b69('0x4d')],[_0x8b69('0x50'),'id'])||{});}})[_0x8b69('0x2b')](respondWithResult(_0x3c5d52,null))[_0x8b69('0x46')](handleError(_0x3c5d52,null));};exports['getConditions']=function(_0x546b5f,_0x1bba18,_0x1d627e){var _0x46fe59={};var _0x1aabcd={};var _0x312e24;var _0x4eb899;return db['Automation'][_0x8b69('0x52')]({'where':{'id':_0x546b5f[_0x8b69('0x48')]['id']}})[_0x8b69('0x2b')](handleEntityNotFound(_0x1bba18,null))[_0x8b69('0x2b')](function(_0x8fb72a){if(_0x8fb72a){_0x312e24=_0x8fb72a;_0x1aabcd[_0x8b69('0x34')]=_[_0x8b69('0x49')](db[_0x8b69('0x4e')]['rawAttributes']);_0x1aabcd[_0x8b69('0x35')]=_[_0x8b69('0x49')](_0x546b5f[_0x8b69('0x35')]);_0x1aabcd[_0x8b69('0x36')]=_[_0x8b69('0x37')](_0x1aabcd['model'],_0x1aabcd[_0x8b69('0x35')]);_0x46fe59['attributes']=_[_0x8b69('0x37')](_0x1aabcd['model'],qs[_0x8b69('0x39')](_0x546b5f[_0x8b69('0x35')][_0x8b69('0x39')]));_0x46fe59['attributes']=_0x46fe59[_0x8b69('0x38')][_0x8b69('0x3a')]?_0x46fe59['attributes']:_0x1aabcd['model'];_0x46fe59[_0x8b69('0x3b')]=qs['sort'](_0x546b5f[_0x8b69('0x35')][_0x8b69('0x3c')]);_0x46fe59[_0x8b69('0x3d')]=qs[_0x8b69('0x36')](_[_0x8b69('0x3e')](_0x546b5f[_0x8b69('0x35')],_0x1aabcd['filters']));if(_0x546b5f['query']['filter']){_0x46fe59[_0x8b69('0x3d')]=_[_0x8b69('0x40')](_0x46fe59['where'],{'$or':_[_0x8b69('0x30')](_0x46fe59[_0x8b69('0x38')],function(_0x2e5db9){var _0x521571={};_0x521571[_0x2e5db9]={'$like':'%'+_0x546b5f[_0x8b69('0x35')][_0x8b69('0x3f')]+'%'};return _0x521571;})});}_0x46fe59=_[_0x8b69('0x40')]({},_0x46fe59,_0x546b5f[_0x8b69('0x42')]);return _0x312e24[_0x8b69('0x53')](_0x46fe59);}})['then'](function(_0x4bd3d6){if(_0x4bd3d6){_0x4eb899=_0x4bd3d6['length'];if(!_0x546b5f[_0x8b69('0x35')][_0x8b69('0x54')](_0x8b69('0x55'))){_0x46fe59['limit']=qs[_0x8b69('0x25')](_0x546b5f[_0x8b69('0x35')][_0x8b69('0x25')]);_0x46fe59[_0x8b69('0x22')]=qs['offset'](_0x546b5f['query'][_0x8b69('0x22')]);}return _0x312e24['getConditions'](_0x46fe59);}})[_0x8b69('0x2b')](function(_0x3136b3){if(_0x3136b3){return _0x3136b3?{'count':_0x4eb899,'rows':_0x3136b3}:null;}})[_0x8b69('0x2b')](respondWithResult(_0x1bba18,null))[_0x8b69('0x46')](handleError(_0x1bba18,null));};exports[_0x8b69('0x56')]=function(_0xcbbcc0,_0x478ee1,_0x50b8e5){return db[_0x8b69('0x57')]['find']({'where':{'id':_0xcbbcc0[_0x8b69('0x48')]['id']}})[_0x8b69('0x2b')](handleEntityNotFound(_0x478ee1,null))[_0x8b69('0x2b')](function(_0x317354){if(_0x317354){return _0x317354[_0x8b69('0x56')](_0xcbbcc0['body'][_0x8b69('0x50')],_[_0x8b69('0x51')](_0xcbbcc0[_0x8b69('0x4d')],[_0x8b69('0x50'),'id'])||{});}})[_0x8b69('0x2b')](respondWithResult(_0x478ee1,null))[_0x8b69('0x46')](handleError(_0x478ee1,null));};exports[_0x8b69('0x58')]=function(_0x84c18f,_0x518344,_0x53f114){var _0x5911b4={};var _0x1fb576={};var _0x2b0e28;var _0xe6de07;return db['Automation'][_0x8b69('0x52')]({'where':{'id':_0x84c18f[_0x8b69('0x48')]['id']}})['then'](handleEntityNotFound(_0x518344,null))[_0x8b69('0x2b')](function(_0x45321b){if(_0x45321b){_0x2b0e28=_0x45321b;_0x1fb576[_0x8b69('0x34')]=_[_0x8b69('0x49')](db[_0x8b69('0x57')]['rawAttributes']);_0x1fb576['query']=_['keys'](_0x84c18f[_0x8b69('0x35')]);_0x1fb576['filters']=_[_0x8b69('0x37')](_0x1fb576[_0x8b69('0x34')],_0x1fb576[_0x8b69('0x35')]);_0x5911b4[_0x8b69('0x38')]=_[_0x8b69('0x37')](_0x1fb576[_0x8b69('0x34')],qs[_0x8b69('0x39')](_0x84c18f['query'][_0x8b69('0x39')]));_0x5911b4[_0x8b69('0x38')]=_0x5911b4['attributes'][_0x8b69('0x3a')]?_0x5911b4[_0x8b69('0x38')]:_0x1fb576[_0x8b69('0x34')];_0x5911b4[_0x8b69('0x3b')]=qs[_0x8b69('0x3c')](_0x84c18f['query'][_0x8b69('0x3c')]);_0x5911b4[_0x8b69('0x3d')]=qs[_0x8b69('0x36')](_[_0x8b69('0x3e')](_0x84c18f['query'],_0x1fb576[_0x8b69('0x36')]));if(_0x84c18f[_0x8b69('0x35')][_0x8b69('0x3f')]){_0x5911b4[_0x8b69('0x3d')]=_[_0x8b69('0x40')](_0x5911b4['where'],{'$or':_['map'](_0x5911b4[_0x8b69('0x38')],function(_0x2694eb){var _0x568222={};_0x568222[_0x2694eb]={'$like':'%'+_0x84c18f[_0x8b69('0x35')][_0x8b69('0x3f')]+'%'};return _0x568222;})});}_0x5911b4=_[_0x8b69('0x40')]({},_0x5911b4,_0x84c18f[_0x8b69('0x42')]);return _0x2b0e28[_0x8b69('0x58')](_0x5911b4);}})[_0x8b69('0x2b')](function(_0x3887eb){if(_0x3887eb){_0xe6de07=_0x3887eb['length'];if(!_0x84c18f['query'][_0x8b69('0x54')](_0x8b69('0x55'))){_0x5911b4[_0x8b69('0x25')]=qs[_0x8b69('0x25')](_0x84c18f[_0x8b69('0x35')][_0x8b69('0x25')]);_0x5911b4[_0x8b69('0x22')]=qs[_0x8b69('0x22')](_0x84c18f['query'][_0x8b69('0x22')]);}return _0x2b0e28[_0x8b69('0x58')](_0x5911b4);}})[_0x8b69('0x2b')](function(_0x3a0b40){if(_0x3a0b40){return _0x3a0b40?{'count':_0xe6de07,'rows':_0x3a0b40}:null;}})['then'](respondWithResult(_0x518344,null))[_0x8b69('0x46')](handleError(_0x518344,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 2a3d297..3f9e93d 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 _0xce7f=['request-promise','path','rimraf','./automation.attributes','exports','define','tools_automations','util','../../config/logger','moment','bluebird'];(function(_0x17db61,_0x364236){var _0x7ac96b=function(_0x329bf4){while(--_0x329bf4){_0x17db61['push'](_0x17db61['shift']());}};_0x7ac96b(++_0x364236);}(_0xce7f,0x146));var _0xfce7=function(_0x277b55,_0x8ba28){_0x277b55=_0x277b55-0x0;var _0xff0d15=_0xce7f[_0x277b55];return _0xff0d15;};'use strict';var _=require('lodash');var util=require(_0xfce7('0x0'));var logger=require(_0xfce7('0x1'))('api');var moment=require(_0xfce7('0x2'));var BPromise=require(_0xfce7('0x3'));var rp=require(_0xfce7('0x4'));var fs=require('fs');var path=require(_0xfce7('0x5'));var rimraf=require(_0xfce7('0x6'));var config=require('../../config/environment');var attributes=require(_0xfce7('0x7'));module[_0xfce7('0x8')]=function(_0x415c35,_0x31b09f){return _0x415c35[_0xfce7('0x9')]('Automation',attributes,{'tableName':_0xfce7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ef3=['request-promise','path','rimraf','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9ef3,0x166));var _0x39ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ef3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x39ef('0x0'));var util=require(_0x39ef('0x1'));var logger=require(_0x39ef('0x2'))(_0x39ef('0x3'));var moment=require(_0x39ef('0x4'));var BPromise=require(_0x39ef('0x5'));var rp=require(_0x39ef('0x6'));var fs=require('fs');var path=require(_0x39ef('0x7'));var rimraf=require(_0x39ef('0x8'));var config=require('../../config/environment');var attributes=require(_0x39ef('0x9'));module['exports']=function(_0xb91364,_0x13b8a7){return _0xb91364[_0x39ef('0xa')](_0x39ef('0xb'),attributes,{'tableName':_0x39ef('0xc'),'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 4761e1f..0eea223 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 _0x63a5=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x497058,_0x2c617f){var _0x332b0b=function(_0xc54ab7){while(--_0xc54ab7){_0x497058['push'](_0x497058['shift']());}};_0x332b0b(++_0x2c617f);}(_0x63a5,0x18e));var _0x563a=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x63a5[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2662f7,_0x4f89b4,_0x4d71a0){return new BPromise(function(_0x543920,_0xff1f59){return client[_0x563a('0x9')](_0x2662f7,_0x4d71a0)[_0x563a('0xa')](function(_0x606235){logger[_0x563a('0xb')](_0x563a('0xc'),_0x4f89b4,_0x563a('0xd'));logger[_0x563a('0xe')](_0x563a('0xf'),_0x4f89b4,_0x563a('0xd'),JSON[_0x563a('0x10')](_0x606235));if(_0x606235[_0x563a('0x11')]){if(_0x606235[_0x563a('0x11')][_0x563a('0x12')]===0x1f4){logger['error'](_0x563a('0xc'),_0x4f89b4,_0x606235[_0x563a('0x11')][_0x563a('0x13')]);return _0xff1f59(_0x606235[_0x563a('0x11')][_0x563a('0x13')]);}logger[_0x563a('0x11')]('Automation,\x20%s,\x20%s',_0x4f89b4,_0x606235[_0x563a('0x11')][_0x563a('0x13')]);return _0x543920(_0x606235[_0x563a('0x11')][_0x563a('0x13')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x4f89b4,_0x563a('0xd'));_0x543920(_0x606235[_0x563a('0x14')]['message']);}})[_0x563a('0x15')](function(_0x43fb16){logger[_0x563a('0x11')](_0x563a('0xc'),_0x4f89b4,_0x43fb16);_0xff1f59(_0x43fb16);});});} \ No newline at end of file +var _0xe5af=['jayson/promise','client','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x17ea9b,_0x23f503){var _0xb7a65a=function(_0x12b0c0){while(--_0x12b0c0){_0x17ea9b['push'](_0x17ea9b['shift']());}};_0xb7a65a(++_0x23f503);}(_0xe5af,0x9c));var _0xfe5a=function(_0x1edb0f,_0x468294){_0x1edb0f=_0x1edb0f-0x0;var _0x902b55=_0xe5af[_0x1edb0f];return _0x902b55;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 45b7533..bfdf177 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 _0xff2a=['isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','delete','destroy','util','path','express','Router','../../components/auth/service','../../config/environment','./automation.controller'];(function(_0x1c1d01,_0x2987a8){var _0x198c17=function(_0x5503a8){while(--_0x5503a8){_0x1c1d01['push'](_0x1c1d01['shift']());}};_0x198c17(++_0x2987a8);}(_0xff2a,0x93));var _0xaff2=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0xff2a[_0x2dea58];return _0x2b23c2;};'use strict';var multer=require('multer');var util=require(_0xaff2('0x0'));var path=require(_0xaff2('0x1'));var timeout=require('connect-timeout');var express=require(_0xaff2('0x2'));var router=express[_0xaff2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaff2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaff2('0x5'));var controller=require(_0xaff2('0x6'));router['get']('/',auth[_0xaff2('0x7')](),controller[_0xaff2('0x8')]);router[_0xaff2('0x9')](_0xaff2('0xa'),auth[_0xaff2('0x7')](),controller[_0xaff2('0xb')]);router[_0xaff2('0x9')](_0xaff2('0xc'),auth[_0xaff2('0x7')](),controller[_0xaff2('0xd')]);router['get'](_0xaff2('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0xaff2('0xf')]('/',auth[_0xaff2('0x7')](),controller[_0xaff2('0x10')]);router[_0xaff2('0xf')](_0xaff2('0xc'),auth['isAuthenticated'](),controller[_0xaff2('0x11')]);router[_0xaff2('0xf')](_0xaff2('0xe'),auth['isAuthenticated'](),controller[_0xaff2('0x12')]);router[_0xaff2('0x13')]('/:id',auth[_0xaff2('0x7')](),controller['update']);router[_0xaff2('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xaff2('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1da6=['get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x301755,_0xd69dc3){var _0x2dac9a=function(_0x29e089){while(--_0x29e089){_0x301755['push'](_0x301755['shift']());}};_0x2dac9a(++_0xd69dc3);}(_0x1da6,0x7c));var _0x61da=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0x1da6[_0x50d84b];return _0x6d4270;};'use strict';var multer=require(_0x61da('0x0'));var util=require(_0x61da('0x1'));var path=require(_0x61da('0x2'));var timeout=require(_0x61da('0x3'));var express=require(_0x61da('0x4'));var router=express[_0x61da('0x5')]();var fs_extra=require(_0x61da('0x6'));var auth=require(_0x61da('0x7'));var interaction=require(_0x61da('0x8'));var config=require(_0x61da('0x9'));var controller=require(_0x61da('0xa'));router[_0x61da('0xb')]('/',auth[_0x61da('0xc')](),controller[_0x61da('0xd')]);router[_0x61da('0xb')](_0x61da('0xe'),auth[_0x61da('0xc')](),controller[_0x61da('0xf')]);router[_0x61da('0xb')](_0x61da('0x10'),auth['isAuthenticated'](),controller[_0x61da('0x11')]);router[_0x61da('0xb')](_0x61da('0x12'),auth[_0x61da('0xc')](),controller[_0x61da('0x13')]);router[_0x61da('0x14')]('/',auth[_0x61da('0xc')](),controller[_0x61da('0x15')]);router[_0x61da('0x14')](_0x61da('0x10'),auth[_0x61da('0xc')](),controller[_0x61da('0x16')]);router[_0x61da('0x14')](_0x61da('0x12'),auth[_0x61da('0xc')](),controller['addActions']);router[_0x61da('0x17')](_0x61da('0xe'),auth[_0x61da('0xc')](),controller[_0x61da('0x18')]);router['delete'](_0x61da('0xe'),auth['isAuthenticated'](),controller[_0x61da('0x19')]);module[_0x61da('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index cc7654d..ee702df 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 _0x352e=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#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','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','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)'];(function(_0x3ed511,_0x555d63){var _0x56263f=function(_0x2194af){while(--_0x2194af){_0x3ed511['push'](_0x3ed511['shift']());}};_0x56263f(++_0x555d63);}(_0x352e,0x1a6));var _0xe352=function(_0x17f93a,_0x115d02){_0x17f93a=_0x17f93a-0x0;var _0x3f7601=_0x352e[_0x17f93a];return _0x3f7601;};'use strict';var Sequelize=require(_0xe352('0x0'));module[_0xe352('0x1')]={'name':{'type':Sequelize[_0xe352('0x2')],'unique':_0xe352('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe352('0x4')](_0xe352('0x5')),'allowNull':![],'defaultValue':_0xe352('0x5')},'description':{'type':Sequelize[_0xe352('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe352('0x6')},'limitCalls':{'type':Sequelize[_0xe352('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe352('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe352('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe352('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xe352('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe352('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe352('0x7')](0x3)[_0xe352('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe352('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe352('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe352('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xe352('0x7')](0x3)[_0xe352('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe352('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe352('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe352('0x7')](0x3)[_0xe352('0xa')],'defaultValue':0x3,'comment':_0xe352('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe352('0x7')](0x5)[_0xe352('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe352('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe352('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe352('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe352('0x2')],'defaultValue':_0xe352('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xe352('0x12'),_0xe352('0x13'),_0xe352('0x14')),'defaultValue':_0xe352('0x12')},'dialAMDActive':{'type':Sequelize[_0xe352('0x15')],'defaultValue':0x0,'comment':_0xe352('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0xe352('0x7')](0x9)[_0xe352('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe352('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe352('0x7')](0x9)[_0xe352('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xe352('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe352('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xe352('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe352('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe352('0x7')](0x9)[_0xe352('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xe352('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe352('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe352('0x7')](0x5)[_0xe352('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe352('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe352('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe352('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe352('0x4')](_0xe352('0x1c'),'ASC'),'defaultValue':_0xe352('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe352('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe352('0x1d')},'dialCutDigit':{'type':Sequelize[_0xe352('0x7')](0x3)[_0xe352('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe352('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe352('0x7')](0x3)[_0xe352('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe352('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe352('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe352('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xe352('0x7')](0x5)[_0xe352('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe352('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe352('0x7')](0x3)[_0xe352('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe352('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe352('0x7')](0x5)[_0xe352('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe352('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe352('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe352('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe352('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe352('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe352('0x25')}}; \ No newline at end of file +var _0x30e4=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name'];(function(_0xd93fac,_0x23fb9c){var _0x3efe54=function(_0x2b9de7){while(--_0x2b9de7){_0xd93fac['push'](_0xd93fac['shift']());}};_0x3efe54(++_0x23fb9c);}(_0x30e4,0xa7));var _0x430e=function(_0x2ca032,_0x1d5750){_0x2ca032=_0x2ca032-0x0;var _0x4e6f26=_0x30e4[_0x2ca032];return _0x4e6f26;};'use strict';var Sequelize=require('sequelize');module[_0x430e('0x0')]={'name':{'type':Sequelize[_0x430e('0x1')],'unique':_0x430e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x430e('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x430e('0x1')]},'active':{'type':Sequelize[_0x430e('0x4')],'defaultValue':0x0,'comment':_0x430e('0x5')},'limitCalls':{'type':Sequelize[_0x430e('0x6')](0x4)[_0x430e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x430e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x430e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x430e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x430e('0x6')](0x3)[_0x430e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x430e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x430e('0x6')](0x3)[_0x430e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x430e('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x430e('0x6')](0x5)[_0x430e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x430e('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x430e('0x6')](0x3)[_0x430e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x430e('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x430e('0x6')](0x5)[_0x430e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x430e('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x430e('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x430e('0x6')](0x5)[_0x430e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x430e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x430e('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x430e('0xf')](_0x430e('0x10'),'never',_0x430e('0x11')),'defaultValue':_0x430e('0x10')},'dialAMDActive':{'type':Sequelize[_0x430e('0x4')],'defaultValue':0x0,'comment':_0x430e('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x430e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x430e('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x430e('0x6')](0x9)[_0x430e('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x430e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x430e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x430e('0x6')](0x9)[_0x430e('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x430e('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x430e('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x430e('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x430e('0x6')](0x5)[_0x430e('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x430e('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x430e('0x6')](0x9)[_0x430e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x430e('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x430e('0xf')]('DESC',_0x430e('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x430e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x430e('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x430e('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x430e('0x6')](0x3)[_0x430e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x430e('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x430e('0x6')](0x5)[_0x430e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x430e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x430e('0x6')](0x5)[_0x430e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x430e('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x430e('0x6')](0x3)[_0x430e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x430e('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x430e('0x6')](0x5)[_0x430e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x430e('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x430e('0x6')](0x3)[_0x430e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x430e('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x430e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x430e('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x430e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x430e('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x430e('0x6')](0x5)[_0x430e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 88faa84..eb33f49 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 _0xe211=['CmHopper','hasOwnProperty','findAll','getHopperHistories','findOne','CmHopperHistory','nolimit','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','json','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','merge','options','count','includeAll','include','Campaign','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','autoAssociation','getHoppers'];(function(_0xd69efd,_0x5a2190){var _0x3784f3=function(_0x5c8191){while(--_0x5c8191){_0xd69efd['push'](_0xd69efd['shift']());}};_0x3784f3(++_0x5a2190);}(_0xe211,0x166));var _0x1e21=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe211[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1e21('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e21('0x1'));var moment=require(_0x1e21('0x2'));var BPromise=require(_0x1e21('0x3'));var Mustache=require(_0x1e21('0x4'));var util=require(_0x1e21('0x5'));var path=require('path');var sox=require(_0x1e21('0x6'));var csv=require(_0x1e21('0x7'));var ejs=require(_0x1e21('0x8'));var fs=require('fs');var fs_extra=require(_0x1e21('0x9'));var _=require(_0x1e21('0xa'));var squel=require('squel');var crypto=require(_0x1e21('0xb'));var jsforce=require(_0x1e21('0xc'));var deskjs=require(_0x1e21('0xd'));var toCsv=require(_0x1e21('0x7'));var querystring=require(_0x1e21('0xe'));var Papa=require(_0x1e21('0xf'));var Redis=require(_0x1e21('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1e21('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e21('0x12'));var logger=require(_0x1e21('0x13'))('api');var utils=require(_0x1e21('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1e21('0x15'));var db=require(_0x1e21('0x16'))['db'];function respondWithStatusCode(_0x18e9da,_0x306300){_0x306300=_0x306300||0xcc;return function(_0x3783c2){if(_0x3783c2){return _0x18e9da[_0x1e21('0x17')](_0x306300);}return _0x18e9da[_0x1e21('0x18')](_0x306300)[_0x1e21('0x19')]();};}function respondWithResult(_0x3a76ce,_0x23b7b0){_0x23b7b0=_0x23b7b0||0xc8;return function(_0x5111a8){if(_0x5111a8){return _0x3a76ce[_0x1e21('0x18')](_0x23b7b0)['json'](_0x5111a8);}};}function respondWithFilteredResult(_0x32a2a0,_0x32773f){return function(_0x30c686){if(_0x30c686){var _0x195abd=typeof _0x32773f['offset']===_0x1e21('0x1a')&&typeof _0x32773f[_0x1e21('0x1b')]===_0x1e21('0x1a');var _0x4af62f=_0x30c686['count'];var _0x542851=_0x195abd?0x0:_0x32773f[_0x1e21('0x1c')];var _0x100522=_0x195abd?_0x30c686['count']:_0x32773f['offset']+_0x32773f[_0x1e21('0x1b')];var _0x563445;if(_0x100522>=_0x4af62f){_0x100522=_0x4af62f;_0x563445=0xc8;}else{_0x563445=0xce;}_0x32a2a0['status'](_0x563445);return _0x32a2a0[_0x1e21('0x1d')]('Content-Range',_0x542851+'-'+_0x100522+'/'+_0x4af62f)[_0x1e21('0x1e')](_0x30c686);}return null;};}function patchUpdates(_0xf07ea5){return function(_0x370a17){try{jsonpatch[_0x1e21('0x1f')](_0x370a17,_0xf07ea5,!![]);}catch(_0x2108ae){return BPromise[_0x1e21('0x20')](_0x2108ae);}return _0x370a17[_0x1e21('0x21')]();};}function saveUpdates(_0x4c9547,_0x1c5701){return function(_0x316c40){if(_0x316c40){return _0x316c40['update'](_0x4c9547)[_0x1e21('0x22')](function(_0x73381f){return _0x73381f;});}return null;};}function removeEntity(_0x2a58f0,_0x114b8e){return function(_0x4817e0){if(_0x4817e0){return _0x4817e0['destroy']()[_0x1e21('0x22')](function(){var _0x208f79=_0x4817e0[_0x1e21('0x23')]({'plain':!![]});var _0x4addd2='IvrCampaigns';return db[_0x1e21('0x24')][_0x1e21('0x25')]({'where':{'type':_0x4addd2,'resourceId':_0x208f79['id']}})[_0x1e21('0x22')](function(){return _0x4817e0;});})[_0x1e21('0x22')](function(){_0x2a58f0[_0x1e21('0x18')](0xcc)[_0x1e21('0x19')]();});}};}function handleEntityNotFound(_0x176319,_0x17c83a){return function(_0x1bba21){if(!_0x1bba21){_0x176319[_0x1e21('0x17')](0x194);}return _0x1bba21;};}function handleError(_0x45ee6a,_0x588000){_0x588000=_0x588000||0x1f4;return function(_0x22f178){logger[_0x1e21('0x26')](_0x22f178[_0x1e21('0x27')]);if(_0x22f178[_0x1e21('0x28')]){delete _0x22f178[_0x1e21('0x28')];}_0x45ee6a[_0x1e21('0x18')](_0x588000)[_0x1e21('0x29')](_0x22f178);};}exports[_0x1e21('0x2a')]=function(_0x9327f3,_0x4a5610){var _0x3587d5={},_0x10b90d={},_0x55d3b5={'count':0x0,'rows':[]};var _0x1a6c46=_[_0x1e21('0x2b')](db['Campaign'][_0x1e21('0x2c')],function(_0x528e09){return{'name':_0x528e09[_0x1e21('0x2d')],'type':_0x528e09[_0x1e21('0x2e')][_0x1e21('0x2f')]};});_0x10b90d['model']=_[_0x1e21('0x2b')](_0x1a6c46,_0x1e21('0x28'));_0x10b90d['query']=_[_0x1e21('0x30')](_0x9327f3[_0x1e21('0x31')]);_0x10b90d[_0x1e21('0x32')]=_[_0x1e21('0x33')](_0x10b90d['model'],_0x10b90d[_0x1e21('0x31')]);_0x3587d5[_0x1e21('0x34')]=_[_0x1e21('0x33')](_0x10b90d[_0x1e21('0x35')],qs[_0x1e21('0x36')](_0x9327f3[_0x1e21('0x31')]['fields']));_0x3587d5['attributes']=_0x3587d5[_0x1e21('0x34')][_0x1e21('0x37')]?_0x3587d5[_0x1e21('0x34')]:_0x10b90d['model'];if(!_0x9327f3[_0x1e21('0x31')]['hasOwnProperty']('nolimit')){_0x3587d5[_0x1e21('0x1b')]=qs[_0x1e21('0x1b')](_0x9327f3[_0x1e21('0x31')]['limit']);_0x3587d5['offset']=qs[_0x1e21('0x1c')](_0x9327f3[_0x1e21('0x31')][_0x1e21('0x1c')]);}_0x3587d5[_0x1e21('0x38')]=qs[_0x1e21('0x39')](_0x9327f3[_0x1e21('0x31')]['sort']);_0x3587d5[_0x1e21('0x3a')]=qs[_0x1e21('0x32')](_[_0x1e21('0x3b')](_0x9327f3[_0x1e21('0x31')],_0x10b90d[_0x1e21('0x32')]),_0x1a6c46);if(_0x9327f3['query'][_0x1e21('0x3c')]){_0x3587d5[_0x1e21('0x3a')]=_[_0x1e21('0x3d')](_0x3587d5[_0x1e21('0x3a')],{'$or':_[_0x1e21('0x2b')](_0x1a6c46,function(_0x566ffe){if(_0x566ffe['type']!=='VIRTUAL'){var _0x2f4511={};_0x2f4511[_0x566ffe[_0x1e21('0x28')]]={'$like':'%'+_0x9327f3[_0x1e21('0x31')]['filter']+'%'};return _0x2f4511;}})});}_0x3587d5=_[_0x1e21('0x3d')]({},_0x3587d5,_0x9327f3[_0x1e21('0x3e')]);var _0x4df68f={'where':_0x3587d5['where']};return db['Campaign'][_0x1e21('0x3f')](_0x4df68f)[_0x1e21('0x22')](function(_0x364e07){_0x55d3b5[_0x1e21('0x3f')]=_0x364e07;if(_0x9327f3['query'][_0x1e21('0x40')]){_0x3587d5[_0x1e21('0x41')]=[{'all':!![]}];}return db[_0x1e21('0x42')]['findAll'](_0x3587d5);})['then'](function(_0x5b1c9d){_0x55d3b5[_0x1e21('0x43')]=_0x5b1c9d;return _0x55d3b5;})[_0x1e21('0x22')](respondWithFilteredResult(_0x4a5610,_0x3587d5))['catch'](handleError(_0x4a5610,null));};exports[_0x1e21('0x44')]=function(_0x2e8fde,_0x2444e5){var _0x219352={'raw':![],'where':{'id':_0x2e8fde[_0x1e21('0x45')]['id']}},_0x26e1a7={};_0x26e1a7[_0x1e21('0x35')]=_[_0x1e21('0x30')](db[_0x1e21('0x42')]['rawAttributes']);_0x26e1a7[_0x1e21('0x31')]=_[_0x1e21('0x30')](_0x2e8fde[_0x1e21('0x31')]);_0x26e1a7[_0x1e21('0x32')]=_['intersection'](_0x26e1a7[_0x1e21('0x35')],_0x26e1a7[_0x1e21('0x31')]);_0x219352['attributes']=_[_0x1e21('0x33')](_0x26e1a7[_0x1e21('0x35')],qs['fields'](_0x2e8fde['query'][_0x1e21('0x36')]));_0x219352[_0x1e21('0x34')]=_0x219352[_0x1e21('0x34')]['length']?_0x219352[_0x1e21('0x34')]:_0x26e1a7[_0x1e21('0x35')];if(_0x2e8fde['query'][_0x1e21('0x40')]){_0x219352['include']=[{'all':!![]}];}_0x219352=_['merge']({},_0x219352,_0x2e8fde[_0x1e21('0x3e')]);return db[_0x1e21('0x42')]['find'](_0x219352)[_0x1e21('0x22')](handleEntityNotFound(_0x2444e5,null))[_0x1e21('0x22')](respondWithResult(_0x2444e5,null))['catch'](handleError(_0x2444e5,null));};exports[_0x1e21('0x46')]=function(_0x549222,_0x45b186){return db['Campaign'][_0x1e21('0x46')](_0x549222[_0x1e21('0x47')],{})[_0x1e21('0x22')](function(_0x44071a){var _0x29795b=_0x549222[_0x1e21('0x48')]['get']({'plain':!![]});if(!_0x29795b)throw new Error(_0x1e21('0x49'));if(_0x29795b['role']===_0x1e21('0x48')){var _0x22c678=_0x44071a[_0x1e21('0x23')]({'plain':!![]});var _0x1da050=_0x1e21('0x4a');return db[_0x1e21('0x4b')][_0x1e21('0x4c')]({'where':{'name':_0x1da050,'userProfileId':_0x29795b[_0x1e21('0x4d')]},'raw':!![]})['then'](function(_0x3443ad){if(_0x3443ad&&_0x3443ad['autoAssociation']===0x0){return db[_0x1e21('0x24')]['create']({'name':_0x22c678[_0x1e21('0x28')],'resourceId':_0x22c678['id'],'type':_0x3443ad[_0x1e21('0x28')],'sectionId':_0x3443ad['id']},{})[_0x1e21('0x22')](function(){return _0x44071a;});}else{return _0x44071a;}})[_0x1e21('0x4e')](function(_0x2cf9d0){logger['error'](_0x1e21('0x4f'),_0x2cf9d0);throw _0x2cf9d0;});}return _0x44071a;})[_0x1e21('0x22')](respondWithResult(_0x45b186,0xc9))['catch'](handleError(_0x45b186,null));};exports['clone']=function(_0x424e6b,_0x1f92b0){var _0xa5f009={'where':{'id':_0x424e6b['params']['id']}},_0x51ba36={};_0x51ba36['model']=_[_0x1e21('0x30')](db['Campaign'][_0x1e21('0x2c')]);_0xa5f009[_0x1e21('0x34')]=_[_0x1e21('0x33')](_0x51ba36[_0x1e21('0x35')],qs['fields'](_0x424e6b[_0x1e21('0x31')][_0x1e21('0x36')]));_0xa5f009[_0x1e21('0x34')]=_0xa5f009['attributes']['length']?_0xa5f009[_0x1e21('0x34')]:_0x51ba36[_0x1e21('0x35')];if(_0x424e6b[_0x1e21('0x31')][_0x1e21('0x40')]){_0xa5f009[_0x1e21('0x41')]=[{'all':!![]}];}_0xa5f009=_[_0x1e21('0x3d')]({},_0xa5f009,_0x424e6b['options']);return db[_0x1e21('0x42')][_0x1e21('0x4c')](_0xa5f009)[_0x1e21('0x22')](handleEntityNotFound(_0x1f92b0,null))[_0x1e21('0x22')](function(_0x1ebb58){if(_0x1ebb58){var _0x210ddd=_0x1ebb58[_0x1e21('0x23')]({'plain':!![]});_0x210ddd=qs[_0x1e21('0x50')](_0x210ddd,['id',_0x1e21('0x51'),'updatedAt']);_0x424e6b['body']=_[_0x1e21('0x50')](_0x424e6b[_0x1e21('0x47')],['id',_0x1e21('0x51'),_0x1e21('0x52')]);return db['Campaign'][_0x1e21('0x46')](_['merge'](_0x210ddd,_0x424e6b[_0x1e21('0x47')]),{'include':_0x424e6b[_0x1e21('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0x1e21('0x22')](function(_0x5b9faa){var _0x3da8b8=_0x424e6b[_0x1e21('0x48')][_0x1e21('0x23')]({'plain':!![]});if(!_0x3da8b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3da8b8[_0x1e21('0x53')]===_0x1e21('0x48')){var _0x4e2e5d=_0x5b9faa[_0x1e21('0x23')]({'plain':!![]});var _0x32625d=_0x1e21('0x4a');return db['UserProfileSection'][_0x1e21('0x4c')]({'where':{'name':_0x32625d,'userProfileId':_0x3da8b8[_0x1e21('0x4d')]},'raw':!![]})[_0x1e21('0x22')](function(_0x9d0a14){if(_0x9d0a14&&_0x9d0a14[_0x1e21('0x54')]===0x0){return db['UserProfileResource'][_0x1e21('0x46')]({'name':_0x4e2e5d[_0x1e21('0x28')],'resourceId':_0x4e2e5d['id'],'type':_0x9d0a14[_0x1e21('0x28')],'sectionId':_0x9d0a14['id']},{})[_0x1e21('0x22')](function(){return _0x5b9faa;});}else{return _0x5b9faa;}})[_0x1e21('0x4e')](function(_0x229a4f){logger[_0x1e21('0x26')](_0x1e21('0x4f'),_0x229a4f);throw _0x229a4f;});}return _0x5b9faa;});}})[_0x1e21('0x22')](respondWithResult(_0x1f92b0,0xc9))['catch'](handleError(_0x1f92b0,null));};exports['update']=function(_0xf34355,_0x30ada6){if(_0xf34355[_0x1e21('0x47')]['id']){delete _0xf34355['body']['id'];}return db[_0x1e21('0x42')][_0x1e21('0x4c')]({'where':{'id':_0xf34355['params']['id']}})['then'](handleEntityNotFound(_0x30ada6,null))[_0x1e21('0x22')](saveUpdates(_0xf34355[_0x1e21('0x47')],null))[_0x1e21('0x22')](respondWithResult(_0x30ada6,null))[_0x1e21('0x4e')](handleError(_0x30ada6,null));};exports[_0x1e21('0x25')]=function(_0x6536c5,_0x581055){return db['Campaign'][_0x1e21('0x4c')]({'where':{'id':_0x6536c5[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x581055,null))[_0x1e21('0x22')](removeEntity(_0x581055,null))[_0x1e21('0x4e')](handleError(_0x581055,null));};exports[_0x1e21('0x55')]=function(_0x50e64b,_0x38aeb9,_0x22ef89){var _0x39bb34={'raw':!![],'where':{}};var _0x430e43={};var _0x390c70={'count':0x0,'rows':[]};return db[_0x1e21('0x42')]['findOne']({'where':{'id':_0x50e64b[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x38aeb9,null))['then'](function(_0x34cc1e){if(_0x34cc1e){_0x430e43[_0x1e21('0x35')]=_[_0x1e21('0x30')](db[_0x1e21('0x56')][_0x1e21('0x2c')]);_0x430e43[_0x1e21('0x31')]=_[_0x1e21('0x30')](_0x50e64b['query']);_0x430e43[_0x1e21('0x32')]=_['intersection'](_0x430e43[_0x1e21('0x35')],_0x430e43[_0x1e21('0x31')]);_0x39bb34[_0x1e21('0x34')]=_[_0x1e21('0x33')](_0x430e43[_0x1e21('0x35')],qs[_0x1e21('0x36')](_0x50e64b[_0x1e21('0x31')]['fields']));_0x39bb34['attributes']=_0x39bb34['attributes']['length']?_0x39bb34['attributes']:_0x430e43[_0x1e21('0x35')];if(!_0x50e64b[_0x1e21('0x31')][_0x1e21('0x57')]('nolimit')){_0x39bb34['limit']=qs[_0x1e21('0x1b')](_0x50e64b[_0x1e21('0x31')][_0x1e21('0x1b')]);_0x39bb34[_0x1e21('0x1c')]=qs[_0x1e21('0x1c')](_0x50e64b[_0x1e21('0x31')][_0x1e21('0x1c')]);}_0x39bb34[_0x1e21('0x38')]=qs[_0x1e21('0x39')](_0x50e64b[_0x1e21('0x31')]['sort']);_0x39bb34[_0x1e21('0x3a')]=qs[_0x1e21('0x32')](_['pick'](_0x50e64b[_0x1e21('0x31')],_0x430e43[_0x1e21('0x32')]));_0x39bb34[_0x1e21('0x3a')]['CampaignId']=_0x34cc1e['id'];if(_0x50e64b[_0x1e21('0x31')][_0x1e21('0x3c')]){_0x39bb34['where']=_[_0x1e21('0x3d')](_0x39bb34[_0x1e21('0x3a')],{'$or':_[_0x1e21('0x2b')](_0x39bb34[_0x1e21('0x34')],function(_0x57c810){var _0xb48822={};_0xb48822[_0x57c810]={'$like':'%'+_0x50e64b[_0x1e21('0x31')][_0x1e21('0x3c')]+'%'};return _0xb48822;})});}_0x39bb34=_[_0x1e21('0x3d')]({},_0x39bb34,_0x50e64b[_0x1e21('0x3e')]);return db[_0x1e21('0x56')][_0x1e21('0x3f')]({'where':_0x39bb34[_0x1e21('0x3a')]})[_0x1e21('0x22')](function(_0x50a285){_0x390c70[_0x1e21('0x3f')]=_0x50a285;if(_0x50e64b[_0x1e21('0x31')][_0x1e21('0x40')]){_0x39bb34[_0x1e21('0x41')]=[{'all':!![]}];}return db[_0x1e21('0x56')][_0x1e21('0x58')](_0x39bb34);})[_0x1e21('0x22')](function(_0x2d9c43){_0x390c70['rows']=_0x2d9c43;return _0x390c70;});}})['then'](respondWithFilteredResult(_0x38aeb9,_0x39bb34))[_0x1e21('0x4e')](handleError(_0x38aeb9,null));};exports[_0x1e21('0x59')]=function(_0xe54ffa,_0x202f38,_0xd3f792){var _0x3af785={'raw':!![],'where':{}};var _0x3b6b9a={};var _0x533575={'count':0x0,'rows':[]};return db[_0x1e21('0x42')][_0x1e21('0x5a')]({'where':{'id':_0xe54ffa['params']['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x202f38,null))[_0x1e21('0x22')](function(_0x35c43f){if(_0x35c43f){_0x3b6b9a[_0x1e21('0x35')]=_[_0x1e21('0x30')](db[_0x1e21('0x5b')][_0x1e21('0x2c')]);_0x3b6b9a['query']=_[_0x1e21('0x30')](_0xe54ffa[_0x1e21('0x31')]);_0x3b6b9a[_0x1e21('0x32')]=_['intersection'](_0x3b6b9a['model'],_0x3b6b9a[_0x1e21('0x31')]);_0x3af785['attributes']=_[_0x1e21('0x33')](_0x3b6b9a['model'],qs['fields'](_0xe54ffa['query'][_0x1e21('0x36')]));_0x3af785[_0x1e21('0x34')]=_0x3af785[_0x1e21('0x34')]['length']?_0x3af785[_0x1e21('0x34')]:_0x3b6b9a[_0x1e21('0x35')];if(!_0xe54ffa[_0x1e21('0x31')][_0x1e21('0x57')](_0x1e21('0x5c'))){_0x3af785[_0x1e21('0x1b')]=qs[_0x1e21('0x1b')](_0xe54ffa[_0x1e21('0x31')][_0x1e21('0x1b')]);_0x3af785[_0x1e21('0x1c')]=qs[_0x1e21('0x1c')](_0xe54ffa[_0x1e21('0x31')][_0x1e21('0x1c')]);}_0x3af785[_0x1e21('0x38')]=qs[_0x1e21('0x39')](_0xe54ffa[_0x1e21('0x31')][_0x1e21('0x39')]);_0x3af785[_0x1e21('0x3a')]=qs[_0x1e21('0x32')](_[_0x1e21('0x3b')](_0xe54ffa[_0x1e21('0x31')],_0x3b6b9a[_0x1e21('0x32')]));_0x3af785['where'][_0x1e21('0x5d')]=_0x35c43f['id'];if(_0xe54ffa[_0x1e21('0x31')]['filter']){_0x3af785[_0x1e21('0x3a')]=_[_0x1e21('0x3d')](_0x3af785[_0x1e21('0x3a')],{'$or':_[_0x1e21('0x2b')](_0x3af785['attributes'],function(_0x2e3d82){var _0x5a6695={};_0x5a6695[_0x2e3d82]={'$like':'%'+_0xe54ffa[_0x1e21('0x31')][_0x1e21('0x3c')]+'%'};return _0x5a6695;})});}_0x3af785=_['merge']({},_0x3af785,_0xe54ffa[_0x1e21('0x3e')]);return db[_0x1e21('0x5b')]['count']({'where':_0x3af785['where']})[_0x1e21('0x22')](function(_0x1f437a){_0x533575[_0x1e21('0x3f')]=_0x1f437a;if(_0xe54ffa[_0x1e21('0x31')][_0x1e21('0x40')]){_0x3af785[_0x1e21('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x1e21('0x58')](_0x3af785);})[_0x1e21('0x22')](function(_0x174a96){_0x533575['rows']=_0x174a96;return _0x533575;});}})[_0x1e21('0x22')](respondWithFilteredResult(_0x202f38,_0x3af785))[_0x1e21('0x4e')](handleError(_0x202f38,null));};exports[_0x1e21('0x5e')]=function(_0x4b1695,_0x3ecd48,_0x29af81){var _0x4ba98d={'raw':!![],'where':{}};var _0x3ef066={};var _0x2dfc74={'count':0x0,'rows':[]};return db[_0x1e21('0x42')][_0x1e21('0x5a')]({'where':{'id':_0x4b1695[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x3ecd48,null))[_0x1e21('0x22')](function(_0x4391c2){if(_0x4391c2){_0x3ef066[_0x1e21('0x35')]=_[_0x1e21('0x30')](db['CmHopperFinal'][_0x1e21('0x2c')]);_0x3ef066['query']=_[_0x1e21('0x30')](_0x4b1695[_0x1e21('0x31')]);_0x3ef066[_0x1e21('0x32')]=_['intersection'](_0x3ef066[_0x1e21('0x35')],_0x3ef066['query']);_0x4ba98d[_0x1e21('0x34')]=_['intersection'](_0x3ef066['model'],qs[_0x1e21('0x36')](_0x4b1695[_0x1e21('0x31')][_0x1e21('0x36')]));_0x4ba98d[_0x1e21('0x34')]=_0x4ba98d[_0x1e21('0x34')]['length']?_0x4ba98d[_0x1e21('0x34')]:_0x3ef066[_0x1e21('0x35')];if(!_0x4b1695[_0x1e21('0x31')][_0x1e21('0x57')]('nolimit')){_0x4ba98d[_0x1e21('0x1b')]=qs[_0x1e21('0x1b')](_0x4b1695[_0x1e21('0x31')][_0x1e21('0x1b')]);_0x4ba98d[_0x1e21('0x1c')]=qs[_0x1e21('0x1c')](_0x4b1695[_0x1e21('0x31')]['offset']);}_0x4ba98d[_0x1e21('0x38')]=qs['sort'](_0x4b1695[_0x1e21('0x31')][_0x1e21('0x39')]);_0x4ba98d[_0x1e21('0x3a')]=qs['filters'](_[_0x1e21('0x3b')](_0x4b1695[_0x1e21('0x31')],_0x3ef066[_0x1e21('0x32')]));_0x4ba98d[_0x1e21('0x3a')][_0x1e21('0x5d')]=_0x4391c2['id'];if(_0x4b1695[_0x1e21('0x31')][_0x1e21('0x3c')]){_0x4ba98d['where']=_['merge'](_0x4ba98d[_0x1e21('0x3a')],{'$or':_[_0x1e21('0x2b')](_0x4ba98d['attributes'],function(_0x1bb15d){var _0x4170f0={};_0x4170f0[_0x1bb15d]={'$like':'%'+_0x4b1695[_0x1e21('0x31')][_0x1e21('0x3c')]+'%'};return _0x4170f0;})});}_0x4ba98d=_[_0x1e21('0x3d')]({},_0x4ba98d,_0x4b1695[_0x1e21('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x4ba98d[_0x1e21('0x3a')]})[_0x1e21('0x22')](function(_0x19f9bb){_0x2dfc74[_0x1e21('0x3f')]=_0x19f9bb;if(_0x4b1695[_0x1e21('0x31')][_0x1e21('0x40')]){_0x4ba98d['include']=[{'all':!![]}];}return db[_0x1e21('0x5f')][_0x1e21('0x58')](_0x4ba98d);})['then'](function(_0x29389a){_0x2dfc74[_0x1e21('0x43')]=_0x29389a;return _0x2dfc74;});}})[_0x1e21('0x22')](respondWithFilteredResult(_0x3ecd48,_0x4ba98d))['catch'](handleError(_0x3ecd48,null));};exports[_0x1e21('0x60')]=function(_0x40a787,_0x5723c1,_0x280d3c){var _0x435f39={'raw':!![],'where':{}};var _0x5971c1={};var _0x5af6bc={'count':0x0,'rows':[]};return db[_0x1e21('0x42')][_0x1e21('0x5a')]({'where':{'id':_0x40a787['params']['id']}})['then'](handleEntityNotFound(_0x5723c1,null))[_0x1e21('0x22')](function(_0x101917){if(_0x101917){_0x5971c1[_0x1e21('0x35')]=_[_0x1e21('0x30')](db[_0x1e21('0x61')][_0x1e21('0x2c')]);_0x5971c1[_0x1e21('0x31')]=_[_0x1e21('0x30')](_0x40a787[_0x1e21('0x31')]);_0x5971c1[_0x1e21('0x32')]=_[_0x1e21('0x33')](_0x5971c1[_0x1e21('0x35')],_0x5971c1[_0x1e21('0x31')]);_0x435f39[_0x1e21('0x34')]=_[_0x1e21('0x33')](_0x5971c1[_0x1e21('0x35')],qs[_0x1e21('0x36')](_0x40a787[_0x1e21('0x31')][_0x1e21('0x36')]));_0x435f39[_0x1e21('0x34')]=_0x435f39[_0x1e21('0x34')][_0x1e21('0x37')]?_0x435f39['attributes']:_0x5971c1[_0x1e21('0x35')];if(!_0x40a787['query'][_0x1e21('0x57')](_0x1e21('0x5c'))){_0x435f39[_0x1e21('0x1b')]=qs['limit'](_0x40a787[_0x1e21('0x31')][_0x1e21('0x1b')]);_0x435f39['offset']=qs[_0x1e21('0x1c')](_0x40a787[_0x1e21('0x31')][_0x1e21('0x1c')]);}_0x435f39[_0x1e21('0x38')]=qs['sort'](_0x40a787[_0x1e21('0x31')][_0x1e21('0x39')]);_0x435f39['where']=qs[_0x1e21('0x32')](_[_0x1e21('0x3b')](_0x40a787[_0x1e21('0x31')],_0x5971c1[_0x1e21('0x32')]));_0x435f39['where']['CampaignId']=_0x101917['id'];if(_0x40a787['query'][_0x1e21('0x3c')]){_0x435f39[_0x1e21('0x3a')]=_['merge'](_0x435f39[_0x1e21('0x3a')],{'$or':_['map'](_0x435f39[_0x1e21('0x34')],function(_0x22b6ec){var _0x272471={};_0x272471[_0x22b6ec]={'$like':'%'+_0x40a787[_0x1e21('0x31')]['filter']+'%'};return _0x272471;})});}_0x435f39=_[_0x1e21('0x3d')]({},_0x435f39,_0x40a787[_0x1e21('0x3e')]);return db[_0x1e21('0x61')]['count']({'where':_0x435f39[_0x1e21('0x3a')]})['then'](function(_0x167b93){_0x5af6bc[_0x1e21('0x3f')]=_0x167b93;if(_0x40a787['query'][_0x1e21('0x40')]){_0x435f39[_0x1e21('0x41')]=[{'all':!![]}];}return db[_0x1e21('0x61')][_0x1e21('0x58')](_0x435f39);})['then'](function(_0x31ad1f){_0x5af6bc[_0x1e21('0x43')]=_0x31ad1f;return _0x5af6bc;});}})[_0x1e21('0x22')](respondWithFilteredResult(_0x5723c1,_0x435f39))['catch'](handleError(_0x5723c1,null));};exports[_0x1e21('0x62')]=function(_0x236567,_0x137105,_0x8bfb65){var _0x2fc7d0={};var _0x35f471={};var _0x1a8833;var _0x5c6082;return db['Campaign']['findOne']({'where':{'id':_0x236567[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x137105,null))[_0x1e21('0x22')](function(_0x5e28c4){if(_0x5e28c4){_0x1a8833=_0x5e28c4;_0x35f471[_0x1e21('0x35')]=_['keys'](db[_0x1e21('0x63')][_0x1e21('0x2c')]);_0x35f471[_0x1e21('0x31')]=_[_0x1e21('0x30')](_0x236567[_0x1e21('0x31')]);_0x35f471[_0x1e21('0x32')]=_[_0x1e21('0x33')](_0x35f471[_0x1e21('0x35')],_0x35f471['query']);_0x2fc7d0['attributes']=_[_0x1e21('0x33')](_0x35f471[_0x1e21('0x35')],qs['fields'](_0x236567[_0x1e21('0x31')]['fields']));_0x2fc7d0[_0x1e21('0x34')]=_0x2fc7d0[_0x1e21('0x34')][_0x1e21('0x37')]?_0x2fc7d0[_0x1e21('0x34')]:_0x35f471[_0x1e21('0x35')];_0x2fc7d0['order']=qs[_0x1e21('0x39')](_0x236567[_0x1e21('0x31')][_0x1e21('0x39')]);_0x2fc7d0[_0x1e21('0x3a')]=qs[_0x1e21('0x32')](_[_0x1e21('0x3b')](_0x236567[_0x1e21('0x31')],_0x35f471[_0x1e21('0x32')]));if(_0x236567[_0x1e21('0x31')]['filter']){_0x2fc7d0[_0x1e21('0x3a')]=_['merge'](_0x2fc7d0[_0x1e21('0x3a')],{'$or':_[_0x1e21('0x2b')](_0x2fc7d0['attributes'],function(_0x58062a){var _0xbad6ab={};_0xbad6ab[_0x58062a]={'$like':'%'+_0x236567[_0x1e21('0x31')]['filter']+'%'};return _0xbad6ab;})});}_0x2fc7d0=_[_0x1e21('0x3d')]({},_0x2fc7d0,_0x236567['options']);return _0x1a8833['getLists'](_0x2fc7d0);}})[_0x1e21('0x22')](function(_0x494704){if(_0x494704){_0x5c6082=_0x494704['length'];if(!_0x236567[_0x1e21('0x31')][_0x1e21('0x57')](_0x1e21('0x5c'))){_0x2fc7d0[_0x1e21('0x1b')]=qs[_0x1e21('0x1b')](_0x236567['query'][_0x1e21('0x1b')]);_0x2fc7d0[_0x1e21('0x1c')]=qs[_0x1e21('0x1c')](_0x236567['query'][_0x1e21('0x1c')]);}return _0x1a8833['getLists'](_0x2fc7d0);}})[_0x1e21('0x22')](function(_0x870a8){if(_0x870a8){return _0x870a8?{'count':_0x5c6082,'rows':_0x870a8}:null;}})[_0x1e21('0x22')](respondWithResult(_0x137105,null))[_0x1e21('0x4e')](handleError(_0x137105,null));};exports[_0x1e21('0x64')]=function(_0x280a75,_0xc4e316,_0x53980d){var _0x3c8b26,_0xc0e893;var _0x348df5=[];var _0x3a84bd=moment()[_0x1e21('0x65')](_0x1e21('0x66'));return db[_0x1e21('0x42')][_0x1e21('0x4c')]({'where':{'id':_0x280a75[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0xc4e316,null))['then'](function(_0x4a2b88){if(_0x4a2b88){_0xc0e893=_0x4a2b88;return _0x4a2b88[_0x1e21('0x64')](_0x280a75[_0x1e21('0x47')][_0x1e21('0x67')],_[_0x1e21('0x50')](_0x280a75[_0x1e21('0x47')],['ids','id'])||{});}return null;})[_0x1e21('0x68')](function(_0x7ce33d){var _0x61007c;var _0x47d0f2;_0x3c8b26=_0x7ce33d||[];var _0x5c0bce=[];if(_0x7ce33d){for(var _0x461537=0x0;_0x461537<_0x7ce33d[_0x1e21('0x37')];_0x461537+=0x1){var _0x5691ea=_0x7ce33d[_0x461537][_0x1e21('0x23')]({'plain':!![]});_0xc0e893['dialCheckDuplicateType']=_0x280a75['body'][_0x1e21('0x69')]?_0x280a75[_0x1e21('0x47')][_0x1e21('0x69')]:_0xc0e893['dialCheckDuplicateType'];switch(_0xc0e893[_0x1e21('0x69')]){case _0x1e21('0x6a'):_0x61007c=squel['insert']()[_0x1e21('0x6b')](_0x1e21('0x6c'))['fromQuery']([_0x1e21('0x6d'),_0x1e21('0x6e'),_0x1e21('0x6f'),_0x1e21('0x70'),_0x1e21('0x5d'),_0x1e21('0x51'),_0x1e21('0x52')],squel['select']()[_0x1e21('0x71')](_0x1e21('0x6d'),'phone')[_0x1e21('0x71')](_0x1e21('0x72'),_0x1e21('0x6e'))[_0x1e21('0x71')]('id',_0x1e21('0x6f'))[_0x1e21('0x71')](_0x5691ea[_0x1e21('0x73')][_0x1e21('0x74')](),'ListId')[_0x1e21('0x71')](_0x280a75['params']['id'][_0x1e21('0x74')](),_0x1e21('0x5d'))['field']('\x27'+_0x3a84bd+'\x27',_0x1e21('0x51'))[_0x1e21('0x71')]('\x27'+_0x3a84bd+'\x27',_0x1e21('0x52'))['from'](_0x1e21('0x75'))[_0x1e21('0x3a')](_0x1e21('0x76'))[_0x1e21('0x3a')](_0x1e21('0x77'),_0x5691ea[_0x1e21('0x73')][_0x1e21('0x74')]())['where'](_0x1e21('0x78'))[_0x1e21('0x3a')](_0x1e21('0x79'),squel[_0x1e21('0x7a')]()['field'](_0x1e21('0x7b'))[_0x1e21('0x7c')](_0x1e21('0x7d'))['where'](_0x1e21('0x7e'),_0x280a75[_0x1e21('0x45')]['id'][_0x1e21('0x74')]()))[_0x1e21('0x3a')](_0x1e21('0x79'),squel['select']()[_0x1e21('0x71')](_0x1e21('0x7f'))[_0x1e21('0x7c')](_0x1e21('0x6c'))[_0x1e21('0x3a')](_0x1e21('0x7e'),_0x280a75[_0x1e21('0x45')]['id'][_0x1e21('0x74')]())))[_0x1e21('0x74')]();break;case _0x1e21('0x80'):_0x61007c=squel[_0x1e21('0x81')]()[_0x1e21('0x6b')](_0x1e21('0x6c'))[_0x1e21('0x82')](['phone',_0x1e21('0x6e'),_0x1e21('0x6f'),'ListId',_0x1e21('0x5d'),_0x1e21('0x51'),'updatedAt'],squel[_0x1e21('0x7a')]()[_0x1e21('0x71')]('phone',_0x1e21('0x6d'))[_0x1e21('0x71')](_0x1e21('0x72'),_0x1e21('0x6e'))[_0x1e21('0x71')]('id',_0x1e21('0x6f'))[_0x1e21('0x71')](_0x5691ea[_0x1e21('0x73')][_0x1e21('0x74')](),_0x1e21('0x70'))[_0x1e21('0x71')](_0x280a75[_0x1e21('0x45')]['id'][_0x1e21('0x74')](),_0x1e21('0x5d'))[_0x1e21('0x71')]('\x27'+_0x3a84bd+'\x27',_0x1e21('0x51'))[_0x1e21('0x71')]('\x27'+_0x3a84bd+'\x27',_0x1e21('0x52'))[_0x1e21('0x7c')](_0x1e21('0x75'))[_0x1e21('0x3a')]('deletedAt\x20IS\x20NULL')[_0x1e21('0x3a')](_0x1e21('0x77'),_0x5691ea[_0x1e21('0x73')]['toString']())[_0x1e21('0x3a')](_0x1e21('0x78'))[_0x1e21('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1e21('0x7a')]()[_0x1e21('0x71')]('COALESCE(phone,\x27\x27)')[_0x1e21('0x7c')](_0x1e21('0x6c'))[_0x1e21('0x3a')](_0x1e21('0x7e'),_0x280a75['params']['id']['toString']())))[_0x1e21('0x74')]();break;default:_0x61007c=squel['insert']()[_0x1e21('0x6b')]('cm_hopper')[_0x1e21('0x82')]([_0x1e21('0x6d'),'scheduledAt',_0x1e21('0x6f'),_0x1e21('0x70'),_0x1e21('0x5d'),_0x1e21('0x51'),'updatedAt'],squel[_0x1e21('0x7a')]()[_0x1e21('0x71')](_0x1e21('0x6d'),'phone')[_0x1e21('0x71')](_0x1e21('0x72'),_0x1e21('0x6e'))[_0x1e21('0x71')]('id',_0x1e21('0x6f'))[_0x1e21('0x71')](_0x5691ea[_0x1e21('0x73')][_0x1e21('0x74')](),'ListId')[_0x1e21('0x71')](_0x280a75[_0x1e21('0x45')]['id'][_0x1e21('0x74')](),_0x1e21('0x5d'))['field']('\x27'+_0x3a84bd+'\x27','createdAt')[_0x1e21('0x71')]('\x27'+_0x3a84bd+'\x27',_0x1e21('0x52'))['from'](_0x1e21('0x75'))['where'](_0x1e21('0x76'))[_0x1e21('0x3a')](_0x1e21('0x77'),_0x5691ea[_0x1e21('0x73')][_0x1e21('0x74')]())[_0x1e21('0x3a')](_0x1e21('0x78')))['toString']();}_0x47d0f2=squel[_0x1e21('0x81')]()['into']('cm_hopper_additional_phones')['fromQuery'](['cmHopperId',_0x1e21('0x6e'),_0x1e21('0x6d'),_0x1e21('0x83'),_0x1e21('0x51'),_0x1e21('0x52')],squel[_0x1e21('0x7a')]()[_0x1e21('0x71')](_0x1e21('0x84'),'id')[_0x1e21('0x71')](_0x1e21('0x72'),_0x1e21('0x6e'))[_0x1e21('0x71')](_0x1e21('0x85'),'phone')[_0x1e21('0x71')](_0x1e21('0x86'),_0x1e21('0x83'))[_0x1e21('0x71')]('\x27'+_0x3a84bd+'\x27',_0x1e21('0x51'))[_0x1e21('0x71')]('\x27'+_0x3a84bd+'\x27',_0x1e21('0x52'))[_0x1e21('0x7c')](_0x1e21('0x87'),'ci')[_0x1e21('0x88')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x1e21('0x3a')](_0x1e21('0x89'),_0x5691ea[_0x1e21('0x73')]['toString']())[_0x1e21('0x3a')](_0x1e21('0x8a'),_0x280a75['params']['id']['toString']())[_0x1e21('0x3a')](_0x1e21('0x8b'),_0x3a84bd))['toString']();_0x5c0bce[_0x1e21('0x8c')](db[_0x1e21('0x8d')][_0x1e21('0x31')](_0x61007c));_0x348df5['push'](db['sequelize']['query'](_0x47d0f2));}return BPromise[_0x1e21('0x8e')](_0x5c0bce);}})['then'](function(){return BPromise[_0x1e21('0x8e')](_0x348df5);})['then'](function(){return _0x3c8b26;})[_0x1e21('0x22')](respondWithResult(_0xc4e316,null))[_0x1e21('0x4e')](handleError(_0xc4e316,null));};exports['removeLists']=function(_0x197a20,_0x4ea418,_0x9bbd00){return db['Campaign'][_0x1e21('0x4c')]({'where':{'id':_0x197a20['params']['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x4ea418,null))['then'](function(_0x11657c){if(_0x11657c){return _0x11657c[_0x1e21('0x8f')](_0x197a20[_0x1e21('0x31')][_0x1e21('0x67')]);}})[_0x1e21('0x22')](function(_0x4a32e6){if(_0x4a32e6){return db[_0x1e21('0x56')]['destroy']({'where':{'ListId':_0x197a20[_0x1e21('0x31')][_0x1e21('0x67')],'CampaignId':_0x197a20[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](function(){return _0x4a32e6;});}})[_0x1e21('0x22')](respondWithStatusCode(_0x4ea418,null))['catch'](handleError(_0x4ea418,null));};exports[_0x1e21('0x90')]=function(_0x5c2ada,_0x146e48,_0x31723d){var _0x532418={};var _0x5d76a7={};var _0x2b4f57;var _0x341e3f;return db[_0x1e21('0x42')][_0x1e21('0x5a')]({'where':{'id':_0x5c2ada[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x146e48,null))[_0x1e21('0x22')](function(_0x197e86){if(_0x197e86){_0x2b4f57=_0x197e86;_0x5d76a7[_0x1e21('0x35')]=_[_0x1e21('0x30')](db['CmList']['rawAttributes']);_0x5d76a7['query']=_[_0x1e21('0x30')](_0x5c2ada[_0x1e21('0x31')]);_0x5d76a7['filters']=_[_0x1e21('0x33')](_0x5d76a7[_0x1e21('0x35')],_0x5d76a7[_0x1e21('0x31')]);_0x532418[_0x1e21('0x34')]=_[_0x1e21('0x33')](_0x5d76a7[_0x1e21('0x35')],qs[_0x1e21('0x36')](_0x5c2ada['query'][_0x1e21('0x36')]));_0x532418['attributes']=_0x532418[_0x1e21('0x34')][_0x1e21('0x37')]?_0x532418[_0x1e21('0x34')]:_0x5d76a7['model'];_0x532418['order']=qs['sort'](_0x5c2ada['query'][_0x1e21('0x39')]);_0x532418['where']=qs[_0x1e21('0x32')](_[_0x1e21('0x3b')](_0x5c2ada[_0x1e21('0x31')],_0x5d76a7[_0x1e21('0x32')]));if(_0x5c2ada[_0x1e21('0x31')][_0x1e21('0x3c')]){_0x532418[_0x1e21('0x3a')]=_[_0x1e21('0x3d')](_0x532418[_0x1e21('0x3a')],{'$or':_[_0x1e21('0x2b')](_0x532418[_0x1e21('0x34')],function(_0x223c4f){var _0x23ff5a={};_0x23ff5a[_0x223c4f]={'$like':'%'+_0x5c2ada[_0x1e21('0x31')][_0x1e21('0x3c')]+'%'};return _0x23ff5a;})});}_0x532418=_[_0x1e21('0x3d')]({},_0x532418,_0x5c2ada[_0x1e21('0x3e')]);return _0x2b4f57[_0x1e21('0x90')](_0x532418);}})[_0x1e21('0x22')](function(_0x56fa60){if(_0x56fa60){_0x341e3f=_0x56fa60['length'];if(!_0x5c2ada[_0x1e21('0x31')][_0x1e21('0x57')](_0x1e21('0x5c'))){_0x532418[_0x1e21('0x1b')]=qs[_0x1e21('0x1b')](_0x5c2ada[_0x1e21('0x31')][_0x1e21('0x1b')]);_0x532418[_0x1e21('0x1c')]=qs['offset'](_0x5c2ada[_0x1e21('0x31')]['offset']);}return _0x2b4f57[_0x1e21('0x90')](_0x532418);}})[_0x1e21('0x22')](function(_0x4d9f1a){if(_0x4d9f1a){return _0x4d9f1a?{'count':_0x341e3f,'rows':_0x4d9f1a}:null;}})[_0x1e21('0x22')](respondWithResult(_0x146e48,null))[_0x1e21('0x4e')](handleError(_0x146e48,null));};exports[_0x1e21('0x91')]=function(_0x179ef2,_0x1925f4,_0x455cf6){var _0x1c608d,_0x450a8f;var _0x57bff8=[];var _0x492e1a=moment()[_0x1e21('0x65')](_0x1e21('0x66'));return db['Campaign'][_0x1e21('0x4c')]({'where':{'id':_0x179ef2['params']['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x1925f4,null))[_0x1e21('0x22')](function(_0x1b16fd){if(_0x1b16fd){_0x450a8f=_0x1b16fd;return _0x1b16fd[_0x1e21('0x91')](_0x179ef2[_0x1e21('0x47')]['ids'],_[_0x1e21('0x50')](_0x179ef2[_0x1e21('0x47')],[_0x1e21('0x67'),'id'])||{});}return null;})['spread'](function(_0xc0d341){var _0xc15cf0;var _0x588529;_0x1c608d=_0xc0d341||[];var _0x2a26f7=[];if(_0xc0d341){for(var _0x21bbc3=0x0;_0x21bbc3<_0xc0d341[_0x1e21('0x37')];_0x21bbc3+=0x1){var _0x754de9=_0xc0d341[_0x21bbc3]['get']({'plain':!![]});_0xc15cf0=squel['insert']()[_0x1e21('0x6b')](_0x1e21('0x92'))[_0x1e21('0x82')]([_0x1e21('0x6d'),_0x1e21('0x6f'),_0x1e21('0x70'),_0x1e21('0x5d'),'createdAt',_0x1e21('0x52')],squel[_0x1e21('0x7a')]()[_0x1e21('0x71')](_0x1e21('0x6d'),_0x1e21('0x6d'))[_0x1e21('0x71')]('id',_0x1e21('0x6f'))[_0x1e21('0x71')](_0x754de9[_0x1e21('0x73')][_0x1e21('0x74')](),_0x1e21('0x70'))[_0x1e21('0x71')](_0x179ef2['params']['id']['toString'](),_0x1e21('0x5d'))[_0x1e21('0x71')](_0x1e21('0x72'),_0x1e21('0x51'))['field']('NOW()','updatedAt')['from'](_0x1e21('0x75'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x1e21('0x77'),_0x754de9[_0x1e21('0x73')][_0x1e21('0x74')]())[_0x1e21('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x1e21('0x74')]();_0x2a26f7['push'](db[_0x1e21('0x8d')]['query'](_0xc15cf0));}return BPromise[_0x1e21('0x8e')](_0x2a26f7);}})[_0x1e21('0x22')](function(){return _0x1c608d;})['then'](respondWithResult(_0x1925f4,null))['catch'](handleError(_0x1925f4,null));};exports[_0x1e21('0x93')]=function(_0x192818,_0x518807,_0x5d33e4){return db['Campaign'][_0x1e21('0x4c')]({'where':{'id':_0x192818[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](handleEntityNotFound(_0x518807,null))[_0x1e21('0x22')](function(_0x46224d){if(_0x46224d){return _0x46224d[_0x1e21('0x93')](_0x192818[_0x1e21('0x31')][_0x1e21('0x67')]);}})['then'](function(_0x9a51dd){if(_0x9a51dd){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x192818[_0x1e21('0x31')][_0x1e21('0x67')],'CampaignId':_0x192818[_0x1e21('0x45')]['id']}})[_0x1e21('0x22')](function(){return _0x9a51dd;});}})[_0x1e21('0x22')](respondWithStatusCode(_0x518807,null))[_0x1e21('0x4e')](handleError(_0x518807,null));}; \ No newline at end of file +var _0x2d58=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','userProfileId','clone','omit','createdAt','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','findAll','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','updatedAt','select','field','NOW()','ContactId','CmListId','toString','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','Campaign','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes'];(function(_0x40d8fc,_0x7f3dd7){var _0x55971c=function(_0x1f5dcb){while(--_0x1f5dcb){_0x40d8fc['push'](_0x40d8fc['shift']());}};_0x55971c(++_0x7f3dd7);}(_0x2d58,0x186));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x82d5('0x0'));var rimraf=require(_0x82d5('0x1'));var zipdir=require(_0x82d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82d5('0x3'));var moment=require('moment');var BPromise=require(_0x82d5('0x4'));var Mustache=require(_0x82d5('0x5'));var util=require(_0x82d5('0x6'));var path=require(_0x82d5('0x7'));var sox=require(_0x82d5('0x8'));var csv=require(_0x82d5('0x9'));var ejs=require(_0x82d5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82d5('0xb'));var squel=require(_0x82d5('0xc'));var crypto=require(_0x82d5('0xd'));var jsforce=require(_0x82d5('0xe'));var deskjs=require(_0x82d5('0xf'));var toCsv=require(_0x82d5('0x9'));var querystring=require(_0x82d5('0x10'));var Papa=require(_0x82d5('0x11'));var Redis=require(_0x82d5('0x12'));var authService=require(_0x82d5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x82d5('0x14'));var hardwareService=require(_0x82d5('0x15'));var logger=require(_0x82d5('0x16'))(_0x82d5('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x82d5('0x18'));var db=require(_0x82d5('0x19'))['db'];function respondWithStatusCode(_0x549d85,_0x14ccdc){_0x14ccdc=_0x14ccdc||0xcc;return function(_0x5c2d84){if(_0x5c2d84){return _0x549d85[_0x82d5('0x1a')](_0x14ccdc);}return _0x549d85[_0x82d5('0x1b')](_0x14ccdc)[_0x82d5('0x1c')]();};}function respondWithResult(_0x265753,_0x201e56){_0x201e56=_0x201e56||0xc8;return function(_0x3f26ff){if(_0x3f26ff){return _0x265753[_0x82d5('0x1b')](_0x201e56)[_0x82d5('0x1d')](_0x3f26ff);}};}function respondWithFilteredResult(_0x4a18f0,_0x128c42){return function(_0x26caa1){if(_0x26caa1){var _0x5b0b6e=typeof _0x128c42[_0x82d5('0x1e')]===_0x82d5('0x1f')&&typeof _0x128c42[_0x82d5('0x20')]===_0x82d5('0x1f');var _0x2e6c2c=_0x26caa1['count'];var _0xe1ce36=_0x5b0b6e?0x0:_0x128c42[_0x82d5('0x1e')];var _0x13c6ed=_0x5b0b6e?_0x26caa1[_0x82d5('0x21')]:_0x128c42[_0x82d5('0x1e')]+_0x128c42[_0x82d5('0x20')];var _0x3505b8;if(_0x13c6ed>=_0x2e6c2c){_0x13c6ed=_0x2e6c2c;_0x3505b8=0xc8;}else{_0x3505b8=0xce;}_0x4a18f0['status'](_0x3505b8);return _0x4a18f0['set'](_0x82d5('0x22'),_0xe1ce36+'-'+_0x13c6ed+'/'+_0x2e6c2c)[_0x82d5('0x1d')](_0x26caa1);}return null;};}function patchUpdates(_0x45d203){return function(_0x4712db){try{jsonpatch[_0x82d5('0x23')](_0x4712db,_0x45d203,!![]);}catch(_0x27a2a4){return BPromise[_0x82d5('0x24')](_0x27a2a4);}return _0x4712db[_0x82d5('0x25')]();};}function saveUpdates(_0x579711,_0x423fe1){return function(_0x2d22ab){if(_0x2d22ab){return _0x2d22ab[_0x82d5('0x26')](_0x579711)[_0x82d5('0x27')](function(_0x54964c){return _0x54964c;});}return null;};}function removeEntity(_0x942fc,_0x59605b){return function(_0x47736d){if(_0x47736d){return _0x47736d[_0x82d5('0x28')]()[_0x82d5('0x27')](function(){var _0x1ec65d=_0x47736d[_0x82d5('0x29')]({'plain':!![]});var _0x41fb26='IvrCampaigns';return db[_0x82d5('0x2a')]['destroy']({'where':{'type':_0x41fb26,'resourceId':_0x1ec65d['id']}})['then'](function(){return _0x47736d;});})[_0x82d5('0x27')](function(){_0x942fc['status'](0xcc)[_0x82d5('0x1c')]();});}};}function handleEntityNotFound(_0x22c156,_0x18eb16){return function(_0x5854be){if(!_0x5854be){_0x22c156[_0x82d5('0x1a')](0x194);}return _0x5854be;};}function handleError(_0x8f4ba7,_0x10e54d){_0x10e54d=_0x10e54d||0x1f4;return function(_0x4d6054){logger[_0x82d5('0x2b')](_0x4d6054['stack']);if(_0x4d6054[_0x82d5('0x2c')]){delete _0x4d6054[_0x82d5('0x2c')];}_0x8f4ba7[_0x82d5('0x1b')](_0x10e54d)['send'](_0x4d6054);};}exports[_0x82d5('0x2d')]=function(_0x5cf853,_0x199a63){var _0x375c26={},_0x181fd3={},_0x735e28={'count':0x0,'rows':[]};var _0x6ca339=_['map'](db[_0x82d5('0x2e')][_0x82d5('0x2f')],function(_0x34c5ff){return{'name':_0x34c5ff['fieldName'],'type':_0x34c5ff[_0x82d5('0x30')][_0x82d5('0x31')]};});_0x181fd3['model']=_[_0x82d5('0x32')](_0x6ca339,_0x82d5('0x2c'));_0x181fd3[_0x82d5('0x33')]=_[_0x82d5('0x34')](_0x5cf853['query']);_0x181fd3[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x181fd3[_0x82d5('0x37')],_0x181fd3[_0x82d5('0x33')]);_0x375c26[_0x82d5('0x38')]=_[_0x82d5('0x36')](_0x181fd3[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x5cf853['query']['fields']));_0x375c26[_0x82d5('0x38')]=_0x375c26[_0x82d5('0x38')][_0x82d5('0x3a')]?_0x375c26[_0x82d5('0x38')]:_0x181fd3[_0x82d5('0x37')];if(!_0x5cf853[_0x82d5('0x33')][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0x375c26[_0x82d5('0x20')]=qs[_0x82d5('0x20')](_0x5cf853[_0x82d5('0x33')][_0x82d5('0x20')]);_0x375c26[_0x82d5('0x1e')]=qs[_0x82d5('0x1e')](_0x5cf853['query'][_0x82d5('0x1e')]);}_0x375c26[_0x82d5('0x3d')]=qs[_0x82d5('0x3e')](_0x5cf853[_0x82d5('0x33')][_0x82d5('0x3e')]);_0x375c26['where']=qs[_0x82d5('0x35')](_[_0x82d5('0x3f')](_0x5cf853[_0x82d5('0x33')],_0x181fd3['filters']),_0x6ca339);if(_0x5cf853[_0x82d5('0x33')][_0x82d5('0x40')]){_0x375c26[_0x82d5('0x41')]=_[_0x82d5('0x42')](_0x375c26[_0x82d5('0x41')],{'$or':_[_0x82d5('0x32')](_0x6ca339,function(_0x4c9d63){if(_0x4c9d63['type']!==_0x82d5('0x43')){var _0x52d84c={};_0x52d84c[_0x4c9d63[_0x82d5('0x2c')]]={'$like':'%'+_0x5cf853[_0x82d5('0x33')]['filter']+'%'};return _0x52d84c;}})});}_0x375c26=_[_0x82d5('0x42')]({},_0x375c26,_0x5cf853[_0x82d5('0x44')]);var _0x547e12={'where':_0x375c26[_0x82d5('0x41')]};return db[_0x82d5('0x2e')][_0x82d5('0x21')](_0x547e12)[_0x82d5('0x27')](function(_0x5e12d8){_0x735e28['count']=_0x5e12d8;if(_0x5cf853['query'][_0x82d5('0x45')]){_0x375c26[_0x82d5('0x46')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x375c26);})['then'](function(_0x17113a){_0x735e28[_0x82d5('0x47')]=_0x17113a;return _0x735e28;})[_0x82d5('0x27')](respondWithFilteredResult(_0x199a63,_0x375c26))[_0x82d5('0x48')](handleError(_0x199a63,null));};exports['show']=function(_0x5c2dc4,_0x28d151){var _0x5b7eeb={'raw':![],'where':{'id':_0x5c2dc4[_0x82d5('0x49')]['id']}},_0x3628a6={};_0x3628a6[_0x82d5('0x37')]=_['keys'](db[_0x82d5('0x2e')][_0x82d5('0x2f')]);_0x3628a6[_0x82d5('0x33')]=_[_0x82d5('0x34')](_0x5c2dc4[_0x82d5('0x33')]);_0x3628a6[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x3628a6['model'],_0x3628a6[_0x82d5('0x33')]);_0x5b7eeb['attributes']=_[_0x82d5('0x36')](_0x3628a6[_0x82d5('0x37')],qs['fields'](_0x5c2dc4[_0x82d5('0x33')][_0x82d5('0x39')]));_0x5b7eeb[_0x82d5('0x38')]=_0x5b7eeb[_0x82d5('0x38')][_0x82d5('0x3a')]?_0x5b7eeb[_0x82d5('0x38')]:_0x3628a6[_0x82d5('0x37')];if(_0x5c2dc4['query']['includeAll']){_0x5b7eeb['include']=[{'all':!![]}];}_0x5b7eeb=_[_0x82d5('0x42')]({},_0x5b7eeb,_0x5c2dc4[_0x82d5('0x44')]);return db['Campaign'][_0x82d5('0x4a')](_0x5b7eeb)[_0x82d5('0x27')](handleEntityNotFound(_0x28d151,null))['then'](respondWithResult(_0x28d151,null))['catch'](handleError(_0x28d151,null));};exports[_0x82d5('0x4b')]=function(_0xa890f,_0x4db992){return db[_0x82d5('0x2e')][_0x82d5('0x4b')](_0xa890f[_0x82d5('0x4c')],{})[_0x82d5('0x27')](function(_0x36316b){var _0x53c9a9=_0xa890f[_0x82d5('0x4d')][_0x82d5('0x29')]({'plain':!![]});if(!_0x53c9a9)throw new Error(_0x82d5('0x4e'));if(_0x53c9a9['role']===_0x82d5('0x4d')){var _0x3cea07=_0x36316b['get']({'plain':!![]});var _0x472e65=_0x82d5('0x4f');return db[_0x82d5('0x50')][_0x82d5('0x4a')]({'where':{'name':_0x472e65,'userProfileId':_0x53c9a9[_0x82d5('0x51')]},'raw':!![]})[_0x82d5('0x27')](function(_0x35a50b){if(_0x35a50b&&_0x35a50b['autoAssociation']===0x0){return db[_0x82d5('0x2a')]['create']({'name':_0x3cea07['name'],'resourceId':_0x3cea07['id'],'type':_0x35a50b[_0x82d5('0x2c')],'sectionId':_0x35a50b['id']},{})[_0x82d5('0x27')](function(){return _0x36316b;});}else{return _0x36316b;}})[_0x82d5('0x48')](function(_0x51299f){logger[_0x82d5('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51299f);throw _0x51299f;});}return _0x36316b;})[_0x82d5('0x27')](respondWithResult(_0x4db992,0xc9))[_0x82d5('0x48')](handleError(_0x4db992,null));};exports[_0x82d5('0x52')]=function(_0x3318bd,_0x598013){var _0x98e76f={'where':{'id':_0x3318bd[_0x82d5('0x49')]['id']}},_0x521855={};_0x521855[_0x82d5('0x37')]=_[_0x82d5('0x34')](db['Campaign'][_0x82d5('0x2f')]);_0x98e76f[_0x82d5('0x38')]=_[_0x82d5('0x36')](_0x521855['model'],qs['fields'](_0x3318bd['query'][_0x82d5('0x39')]));_0x98e76f[_0x82d5('0x38')]=_0x98e76f[_0x82d5('0x38')][_0x82d5('0x3a')]?_0x98e76f[_0x82d5('0x38')]:_0x521855[_0x82d5('0x37')];if(_0x3318bd[_0x82d5('0x33')][_0x82d5('0x45')]){_0x98e76f['include']=[{'all':!![]}];}_0x98e76f=_[_0x82d5('0x42')]({},_0x98e76f,_0x3318bd[_0x82d5('0x44')]);return db[_0x82d5('0x2e')][_0x82d5('0x4a')](_0x98e76f)[_0x82d5('0x27')](handleEntityNotFound(_0x598013,null))[_0x82d5('0x27')](function(_0x15af57){if(_0x15af57){var _0x3ed2c1=_0x15af57[_0x82d5('0x29')]({'plain':!![]});_0x3ed2c1=qs[_0x82d5('0x53')](_0x3ed2c1,['id',_0x82d5('0x54'),'updatedAt']);_0x3318bd[_0x82d5('0x4c')]=_[_0x82d5('0x53')](_0x3318bd[_0x82d5('0x4c')],['id',_0x82d5('0x54'),'updatedAt']);return db[_0x82d5('0x2e')]['create'](_['merge'](_0x3ed2c1,_0x3318bd['body']),{'include':_0x3318bd[_0x82d5('0x33')][_0x82d5('0x45')]?[{'all':!![]}]:undefined})[_0x82d5('0x27')](function(_0x5daddf){var _0x2fb594=_0x3318bd['user'][_0x82d5('0x29')]({'plain':!![]});if(!_0x2fb594)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fb594[_0x82d5('0x55')]===_0x82d5('0x4d')){var _0x3f65d1=_0x5daddf['get']({'plain':!![]});var _0x507d23=_0x82d5('0x4f');return db[_0x82d5('0x50')]['find']({'where':{'name':_0x507d23,'userProfileId':_0x2fb594['userProfileId']},'raw':!![]})[_0x82d5('0x27')](function(_0x440629){if(_0x440629&&_0x440629[_0x82d5('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x3f65d1['name'],'resourceId':_0x3f65d1['id'],'type':_0x440629[_0x82d5('0x2c')],'sectionId':_0x440629['id']},{})[_0x82d5('0x27')](function(){return _0x5daddf;});}else{return _0x5daddf;}})[_0x82d5('0x48')](function(_0x5dccb4){logger[_0x82d5('0x2b')](_0x82d5('0x57'),_0x5dccb4);throw _0x5dccb4;});}return _0x5daddf;});}})['then'](respondWithResult(_0x598013,0xc9))[_0x82d5('0x48')](handleError(_0x598013,null));};exports[_0x82d5('0x26')]=function(_0x25c243,_0x443675){if(_0x25c243[_0x82d5('0x4c')]['id']){delete _0x25c243[_0x82d5('0x4c')]['id'];}return db[_0x82d5('0x2e')]['find']({'where':{'id':_0x25c243[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x443675,null))['then'](saveUpdates(_0x25c243[_0x82d5('0x4c')],null))[_0x82d5('0x27')](respondWithResult(_0x443675,null))[_0x82d5('0x48')](handleError(_0x443675,null));};exports['destroy']=function(_0xd88ea0,_0xa61a){return db[_0x82d5('0x2e')]['find']({'where':{'id':_0xd88ea0[_0x82d5('0x49')]['id']}})['then'](handleEntityNotFound(_0xa61a,null))[_0x82d5('0x27')](removeEntity(_0xa61a,null))[_0x82d5('0x48')](handleError(_0xa61a,null));};exports[_0x82d5('0x58')]=function(_0x27fd2b,_0x4f315a,_0x441a73){var _0x59890a={'raw':!![],'where':{}};var _0x1f1bc1={};var _0x28ba24={'count':0x0,'rows':[]};return db[_0x82d5('0x2e')][_0x82d5('0x59')]({'where':{'id':_0x27fd2b[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x4f315a,null))[_0x82d5('0x27')](function(_0x205a60){if(_0x205a60){_0x1f1bc1['model']=_['keys'](db['CmHopper'][_0x82d5('0x2f')]);_0x1f1bc1['query']=_[_0x82d5('0x34')](_0x27fd2b['query']);_0x1f1bc1[_0x82d5('0x35')]=_['intersection'](_0x1f1bc1[_0x82d5('0x37')],_0x1f1bc1[_0x82d5('0x33')]);_0x59890a[_0x82d5('0x38')]=_[_0x82d5('0x36')](_0x1f1bc1[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x27fd2b['query'][_0x82d5('0x39')]));_0x59890a['attributes']=_0x59890a[_0x82d5('0x38')][_0x82d5('0x3a')]?_0x59890a['attributes']:_0x1f1bc1[_0x82d5('0x37')];if(!_0x27fd2b['query'][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0x59890a['limit']=qs[_0x82d5('0x20')](_0x27fd2b['query'][_0x82d5('0x20')]);_0x59890a[_0x82d5('0x1e')]=qs[_0x82d5('0x1e')](_0x27fd2b[_0x82d5('0x33')]['offset']);}_0x59890a[_0x82d5('0x3d')]=qs[_0x82d5('0x3e')](_0x27fd2b[_0x82d5('0x33')][_0x82d5('0x3e')]);_0x59890a['where']=qs[_0x82d5('0x35')](_['pick'](_0x27fd2b[_0x82d5('0x33')],_0x1f1bc1[_0x82d5('0x35')]));_0x59890a[_0x82d5('0x41')]['CampaignId']=_0x205a60['id'];if(_0x27fd2b['query'][_0x82d5('0x40')]){_0x59890a[_0x82d5('0x41')]=_[_0x82d5('0x42')](_0x59890a[_0x82d5('0x41')],{'$or':_['map'](_0x59890a['attributes'],function(_0x560049){var _0x5e8679={};_0x5e8679[_0x560049]={'$like':'%'+_0x27fd2b[_0x82d5('0x33')]['filter']+'%'};return _0x5e8679;})});}_0x59890a=_[_0x82d5('0x42')]({},_0x59890a,_0x27fd2b[_0x82d5('0x44')]);return db[_0x82d5('0x5a')][_0x82d5('0x21')]({'where':_0x59890a[_0x82d5('0x41')]})[_0x82d5('0x27')](function(_0x1c85e0){_0x28ba24['count']=_0x1c85e0;if(_0x27fd2b[_0x82d5('0x33')][_0x82d5('0x45')]){_0x59890a[_0x82d5('0x46')]=[{'all':!![]}];}return db[_0x82d5('0x5a')][_0x82d5('0x5b')](_0x59890a);})[_0x82d5('0x27')](function(_0x445d9f){_0x28ba24[_0x82d5('0x47')]=_0x445d9f;return _0x28ba24;});}})[_0x82d5('0x27')](respondWithFilteredResult(_0x4f315a,_0x59890a))[_0x82d5('0x48')](handleError(_0x4f315a,null));};exports[_0x82d5('0x5c')]=function(_0x37a0e3,_0x4bb5c0,_0x453b28){var _0x4340dd={'raw':!![],'where':{}};var _0x3f3ff6={};var _0x58e4b={'count':0x0,'rows':[]};return db[_0x82d5('0x2e')]['findOne']({'where':{'id':_0x37a0e3['params']['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x4bb5c0,null))[_0x82d5('0x27')](function(_0x1c339d){if(_0x1c339d){_0x3f3ff6[_0x82d5('0x37')]=_[_0x82d5('0x34')](db[_0x82d5('0x5d')][_0x82d5('0x2f')]);_0x3f3ff6[_0x82d5('0x33')]=_[_0x82d5('0x34')](_0x37a0e3[_0x82d5('0x33')]);_0x3f3ff6[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x3f3ff6[_0x82d5('0x37')],_0x3f3ff6[_0x82d5('0x33')]);_0x4340dd['attributes']=_[_0x82d5('0x36')](_0x3f3ff6[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x39')]));_0x4340dd[_0x82d5('0x38')]=_0x4340dd[_0x82d5('0x38')]['length']?_0x4340dd['attributes']:_0x3f3ff6[_0x82d5('0x37')];if(!_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0x4340dd['limit']=qs['limit'](_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x20')]);_0x4340dd['offset']=qs['offset'](_0x37a0e3[_0x82d5('0x33')]['offset']);}_0x4340dd[_0x82d5('0x3d')]=qs['sort'](_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x3e')]);_0x4340dd[_0x82d5('0x41')]=qs[_0x82d5('0x35')](_[_0x82d5('0x3f')](_0x37a0e3[_0x82d5('0x33')],_0x3f3ff6[_0x82d5('0x35')]));_0x4340dd['where'][_0x82d5('0x5e')]=_0x1c339d['id'];if(_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x40')]){_0x4340dd['where']=_['merge'](_0x4340dd[_0x82d5('0x41')],{'$or':_[_0x82d5('0x32')](_0x4340dd[_0x82d5('0x38')],function(_0x3b7e4c){var _0xd4134b={};_0xd4134b[_0x3b7e4c]={'$like':'%'+_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x40')]+'%'};return _0xd4134b;})});}_0x4340dd=_['merge']({},_0x4340dd,_0x37a0e3['options']);return db['CmHopperHistory']['count']({'where':_0x4340dd[_0x82d5('0x41')]})[_0x82d5('0x27')](function(_0x52b490){_0x58e4b[_0x82d5('0x21')]=_0x52b490;if(_0x37a0e3[_0x82d5('0x33')][_0x82d5('0x45')]){_0x4340dd[_0x82d5('0x46')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4340dd);})[_0x82d5('0x27')](function(_0x126cad){_0x58e4b[_0x82d5('0x47')]=_0x126cad;return _0x58e4b;});}})[_0x82d5('0x27')](respondWithFilteredResult(_0x4bb5c0,_0x4340dd))[_0x82d5('0x48')](handleError(_0x4bb5c0,null));};exports[_0x82d5('0x5f')]=function(_0x444c93,_0x42ef32,_0x42f9cb){var _0x301565={'raw':!![],'where':{}};var _0x6eff5b={};var _0x4c3d3e={'count':0x0,'rows':[]};return db[_0x82d5('0x2e')][_0x82d5('0x59')]({'where':{'id':_0x444c93[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x42ef32,null))[_0x82d5('0x27')](function(_0x1e82d3){if(_0x1e82d3){_0x6eff5b[_0x82d5('0x37')]=_[_0x82d5('0x34')](db['CmHopperFinal'][_0x82d5('0x2f')]);_0x6eff5b[_0x82d5('0x33')]=_['keys'](_0x444c93[_0x82d5('0x33')]);_0x6eff5b[_0x82d5('0x35')]=_['intersection'](_0x6eff5b['model'],_0x6eff5b['query']);_0x301565[_0x82d5('0x38')]=_[_0x82d5('0x36')](_0x6eff5b['model'],qs[_0x82d5('0x39')](_0x444c93[_0x82d5('0x33')][_0x82d5('0x39')]));_0x301565[_0x82d5('0x38')]=_0x301565['attributes'][_0x82d5('0x3a')]?_0x301565[_0x82d5('0x38')]:_0x6eff5b[_0x82d5('0x37')];if(!_0x444c93[_0x82d5('0x33')][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0x301565[_0x82d5('0x20')]=qs[_0x82d5('0x20')](_0x444c93[_0x82d5('0x33')]['limit']);_0x301565[_0x82d5('0x1e')]=qs[_0x82d5('0x1e')](_0x444c93[_0x82d5('0x33')][_0x82d5('0x1e')]);}_0x301565['order']=qs[_0x82d5('0x3e')](_0x444c93[_0x82d5('0x33')]['sort']);_0x301565[_0x82d5('0x41')]=qs[_0x82d5('0x35')](_[_0x82d5('0x3f')](_0x444c93[_0x82d5('0x33')],_0x6eff5b[_0x82d5('0x35')]));_0x301565[_0x82d5('0x41')]['CampaignId']=_0x1e82d3['id'];if(_0x444c93[_0x82d5('0x33')][_0x82d5('0x40')]){_0x301565[_0x82d5('0x41')]=_[_0x82d5('0x42')](_0x301565['where'],{'$or':_[_0x82d5('0x32')](_0x301565[_0x82d5('0x38')],function(_0x46ed75){var _0x153561={};_0x153561[_0x46ed75]={'$like':'%'+_0x444c93[_0x82d5('0x33')][_0x82d5('0x40')]+'%'};return _0x153561;})});}_0x301565=_[_0x82d5('0x42')]({},_0x301565,_0x444c93[_0x82d5('0x44')]);return db[_0x82d5('0x60')][_0x82d5('0x21')]({'where':_0x301565['where']})[_0x82d5('0x27')](function(_0x5caad4){_0x4c3d3e['count']=_0x5caad4;if(_0x444c93['query'][_0x82d5('0x45')]){_0x301565[_0x82d5('0x46')]=[{'all':!![]}];}return db[_0x82d5('0x60')]['findAll'](_0x301565);})[_0x82d5('0x27')](function(_0x25a8cb){_0x4c3d3e[_0x82d5('0x47')]=_0x25a8cb;return _0x4c3d3e;});}})[_0x82d5('0x27')](respondWithFilteredResult(_0x42ef32,_0x301565))[_0x82d5('0x48')](handleError(_0x42ef32,null));};exports[_0x82d5('0x61')]=function(_0x463422,_0x3b7ce1,_0x15283e){var _0xc0e97a={'raw':!![],'where':{}};var _0x219178={};var _0x3ab1f2={'count':0x0,'rows':[]};return db[_0x82d5('0x2e')][_0x82d5('0x59')]({'where':{'id':_0x463422[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x3b7ce1,null))[_0x82d5('0x27')](function(_0x1eea80){if(_0x1eea80){_0x219178[_0x82d5('0x37')]=_['keys'](db[_0x82d5('0x62')][_0x82d5('0x2f')]);_0x219178[_0x82d5('0x33')]=_['keys'](_0x463422[_0x82d5('0x33')]);_0x219178[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x219178[_0x82d5('0x37')],_0x219178[_0x82d5('0x33')]);_0xc0e97a[_0x82d5('0x38')]=_[_0x82d5('0x36')](_0x219178[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x463422[_0x82d5('0x33')][_0x82d5('0x39')]));_0xc0e97a['attributes']=_0xc0e97a[_0x82d5('0x38')][_0x82d5('0x3a')]?_0xc0e97a[_0x82d5('0x38')]:_0x219178[_0x82d5('0x37')];if(!_0x463422[_0x82d5('0x33')][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0xc0e97a[_0x82d5('0x20')]=qs[_0x82d5('0x20')](_0x463422[_0x82d5('0x33')]['limit']);_0xc0e97a[_0x82d5('0x1e')]=qs['offset'](_0x463422[_0x82d5('0x33')][_0x82d5('0x1e')]);}_0xc0e97a[_0x82d5('0x3d')]=qs[_0x82d5('0x3e')](_0x463422[_0x82d5('0x33')][_0x82d5('0x3e')]);_0xc0e97a['where']=qs[_0x82d5('0x35')](_[_0x82d5('0x3f')](_0x463422[_0x82d5('0x33')],_0x219178[_0x82d5('0x35')]));_0xc0e97a['where'][_0x82d5('0x5e')]=_0x1eea80['id'];if(_0x463422[_0x82d5('0x33')][_0x82d5('0x40')]){_0xc0e97a[_0x82d5('0x41')]=_[_0x82d5('0x42')](_0xc0e97a['where'],{'$or':_['map'](_0xc0e97a[_0x82d5('0x38')],function(_0x304a95){var _0x1f3165={};_0x1f3165[_0x304a95]={'$like':'%'+_0x463422[_0x82d5('0x33')][_0x82d5('0x40')]+'%'};return _0x1f3165;})});}_0xc0e97a=_[_0x82d5('0x42')]({},_0xc0e97a,_0x463422[_0x82d5('0x44')]);return db['CmHopperBlack'][_0x82d5('0x21')]({'where':_0xc0e97a[_0x82d5('0x41')]})[_0x82d5('0x27')](function(_0x29154d){_0x3ab1f2[_0x82d5('0x21')]=_0x29154d;if(_0x463422[_0x82d5('0x33')][_0x82d5('0x45')]){_0xc0e97a['include']=[{'all':!![]}];}return db[_0x82d5('0x62')][_0x82d5('0x5b')](_0xc0e97a);})['then'](function(_0x44fe17){_0x3ab1f2[_0x82d5('0x47')]=_0x44fe17;return _0x3ab1f2;});}})[_0x82d5('0x27')](respondWithFilteredResult(_0x3b7ce1,_0xc0e97a))['catch'](handleError(_0x3b7ce1,null));};exports[_0x82d5('0x63')]=function(_0x1fc7b0,_0x508249,_0x4c97a0){var _0x1932dd={};var _0x525ade={};var _0x587184;var _0x5a5699;return db[_0x82d5('0x2e')][_0x82d5('0x59')]({'where':{'id':_0x1fc7b0[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x508249,null))[_0x82d5('0x27')](function(_0x10d5d0){if(_0x10d5d0){_0x587184=_0x10d5d0;_0x525ade['model']=_[_0x82d5('0x34')](db[_0x82d5('0x64')]['rawAttributes']);_0x525ade[_0x82d5('0x33')]=_[_0x82d5('0x34')](_0x1fc7b0[_0x82d5('0x33')]);_0x525ade[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x525ade[_0x82d5('0x37')],_0x525ade[_0x82d5('0x33')]);_0x1932dd[_0x82d5('0x38')]=_['intersection'](_0x525ade[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x1fc7b0[_0x82d5('0x33')][_0x82d5('0x39')]));_0x1932dd['attributes']=_0x1932dd[_0x82d5('0x38')]['length']?_0x1932dd[_0x82d5('0x38')]:_0x525ade[_0x82d5('0x37')];_0x1932dd[_0x82d5('0x3d')]=qs['sort'](_0x1fc7b0['query'][_0x82d5('0x3e')]);_0x1932dd[_0x82d5('0x41')]=qs['filters'](_[_0x82d5('0x3f')](_0x1fc7b0[_0x82d5('0x33')],_0x525ade['filters']));if(_0x1fc7b0[_0x82d5('0x33')][_0x82d5('0x40')]){_0x1932dd[_0x82d5('0x41')]=_[_0x82d5('0x42')](_0x1932dd[_0x82d5('0x41')],{'$or':_[_0x82d5('0x32')](_0x1932dd['attributes'],function(_0xec332e){var _0x47348d={};_0x47348d[_0xec332e]={'$like':'%'+_0x1fc7b0[_0x82d5('0x33')][_0x82d5('0x40')]+'%'};return _0x47348d;})});}_0x1932dd=_[_0x82d5('0x42')]({},_0x1932dd,_0x1fc7b0[_0x82d5('0x44')]);return _0x587184[_0x82d5('0x63')](_0x1932dd);}})[_0x82d5('0x27')](function(_0x23bf80){if(_0x23bf80){_0x5a5699=_0x23bf80['length'];if(!_0x1fc7b0[_0x82d5('0x33')]['hasOwnProperty'](_0x82d5('0x3c'))){_0x1932dd[_0x82d5('0x20')]=qs[_0x82d5('0x20')](_0x1fc7b0['query'][_0x82d5('0x20')]);_0x1932dd['offset']=qs[_0x82d5('0x1e')](_0x1fc7b0[_0x82d5('0x33')][_0x82d5('0x1e')]);}return _0x587184[_0x82d5('0x63')](_0x1932dd);}})[_0x82d5('0x27')](function(_0x466167){if(_0x466167){return _0x466167?{'count':_0x5a5699,'rows':_0x466167}:null;}})[_0x82d5('0x27')](respondWithResult(_0x508249,null))[_0x82d5('0x48')](handleError(_0x508249,null));};exports[_0x82d5('0x65')]=function(_0x4861c8,_0x3e0d58,_0x1cc77e){var _0x3e0ec6,_0x144db7;var _0x12afb2=[];var _0x57252a=moment()['format'](_0x82d5('0x66'));return db['Campaign'][_0x82d5('0x4a')]({'where':{'id':_0x4861c8['params']['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x3e0d58,null))[_0x82d5('0x27')](function(_0x2d47db){if(_0x2d47db){_0x144db7=_0x2d47db;return _0x2d47db[_0x82d5('0x65')](_0x4861c8[_0x82d5('0x4c')][_0x82d5('0x67')],_['omit'](_0x4861c8[_0x82d5('0x4c')],[_0x82d5('0x67'),'id'])||{});}return null;})[_0x82d5('0x68')](function(_0x35e092){var _0xbd3b3f;var _0x337fe6;_0x3e0ec6=_0x35e092||[];var _0x363479=[];if(_0x35e092){for(var _0x44241a=0x0;_0x44241a<_0x35e092[_0x82d5('0x3a')];_0x44241a+=0x1){var _0x1d2747=_0x35e092[_0x44241a][_0x82d5('0x29')]({'plain':!![]});_0x144db7[_0x82d5('0x69')]=_0x4861c8[_0x82d5('0x4c')][_0x82d5('0x69')]?_0x4861c8['body'][_0x82d5('0x69')]:_0x144db7[_0x82d5('0x69')];switch(_0x144db7[_0x82d5('0x69')]){case _0x82d5('0x6a'):_0xbd3b3f=squel[_0x82d5('0x6b')]()[_0x82d5('0x6c')](_0x82d5('0x6d'))[_0x82d5('0x6e')]([_0x82d5('0x6f'),_0x82d5('0x70'),'ContactId','ListId',_0x82d5('0x5e'),_0x82d5('0x54'),_0x82d5('0x71')],squel[_0x82d5('0x72')]()[_0x82d5('0x73')](_0x82d5('0x6f'),_0x82d5('0x6f'))[_0x82d5('0x73')](_0x82d5('0x74'),_0x82d5('0x70'))['field']('id',_0x82d5('0x75'))[_0x82d5('0x73')](_0x1d2747[_0x82d5('0x76')][_0x82d5('0x77')](),_0x82d5('0x78'))[_0x82d5('0x73')](_0x4861c8[_0x82d5('0x49')]['id'][_0x82d5('0x77')](),_0x82d5('0x5e'))[_0x82d5('0x73')]('\x27'+_0x57252a+'\x27',_0x82d5('0x54'))[_0x82d5('0x73')]('\x27'+_0x57252a+'\x27',_0x82d5('0x71'))[_0x82d5('0x79')](_0x82d5('0x7a'))[_0x82d5('0x41')]('deletedAt\x20IS\x20NULL')[_0x82d5('0x41')](_0x82d5('0x7b'),_0x1d2747[_0x82d5('0x76')][_0x82d5('0x77')]())[_0x82d5('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0x82d5('0x41')](_0x82d5('0x7c'),squel[_0x82d5('0x72')]()[_0x82d5('0x73')](_0x82d5('0x7d'))[_0x82d5('0x79')](_0x82d5('0x7e'))['where']('CampaignId\x20=\x20?',_0x4861c8[_0x82d5('0x49')]['id'][_0x82d5('0x77')]()))[_0x82d5('0x41')](_0x82d5('0x7c'),squel[_0x82d5('0x72')]()[_0x82d5('0x73')]('COALESCE(phone,\x27\x27)')[_0x82d5('0x79')](_0x82d5('0x6d'))[_0x82d5('0x41')]('CampaignId\x20=\x20?',_0x4861c8[_0x82d5('0x49')]['id'][_0x82d5('0x77')]())))['toString']();break;case _0x82d5('0x7f'):_0xbd3b3f=squel[_0x82d5('0x6b')]()[_0x82d5('0x6c')](_0x82d5('0x6d'))[_0x82d5('0x6e')]([_0x82d5('0x6f'),_0x82d5('0x70'),'ContactId',_0x82d5('0x78'),_0x82d5('0x5e'),_0x82d5('0x54'),_0x82d5('0x71')],squel[_0x82d5('0x72')]()[_0x82d5('0x73')](_0x82d5('0x6f'),_0x82d5('0x6f'))[_0x82d5('0x73')]('NOW()','scheduledAt')[_0x82d5('0x73')]('id',_0x82d5('0x75'))['field'](_0x1d2747[_0x82d5('0x76')][_0x82d5('0x77')](),'ListId')[_0x82d5('0x73')](_0x4861c8[_0x82d5('0x49')]['id'][_0x82d5('0x77')](),'CampaignId')['field']('\x27'+_0x57252a+'\x27','createdAt')[_0x82d5('0x73')]('\x27'+_0x57252a+'\x27',_0x82d5('0x71'))[_0x82d5('0x79')](_0x82d5('0x7a'))[_0x82d5('0x41')](_0x82d5('0x80'))[_0x82d5('0x41')]('ListId\x20=\x20?',_0x1d2747[_0x82d5('0x76')]['toString']())[_0x82d5('0x41')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x82d5('0x7c'),squel[_0x82d5('0x72')]()[_0x82d5('0x73')](_0x82d5('0x81'))[_0x82d5('0x79')](_0x82d5('0x6d'))[_0x82d5('0x41')]('CampaignId\x20=\x20?',_0x4861c8[_0x82d5('0x49')]['id']['toString']())))['toString']();break;default:_0xbd3b3f=squel[_0x82d5('0x6b')]()[_0x82d5('0x6c')](_0x82d5('0x6d'))[_0x82d5('0x6e')]([_0x82d5('0x6f'),_0x82d5('0x70'),_0x82d5('0x75'),_0x82d5('0x78'),_0x82d5('0x5e'),_0x82d5('0x54'),'updatedAt'],squel[_0x82d5('0x72')]()[_0x82d5('0x73')](_0x82d5('0x6f'),_0x82d5('0x6f'))[_0x82d5('0x73')](_0x82d5('0x74'),_0x82d5('0x70'))[_0x82d5('0x73')]('id',_0x82d5('0x75'))[_0x82d5('0x73')](_0x1d2747[_0x82d5('0x76')][_0x82d5('0x77')](),_0x82d5('0x78'))[_0x82d5('0x73')](_0x4861c8['params']['id'][_0x82d5('0x77')](),_0x82d5('0x5e'))[_0x82d5('0x73')]('\x27'+_0x57252a+'\x27',_0x82d5('0x54'))[_0x82d5('0x73')]('\x27'+_0x57252a+'\x27',_0x82d5('0x71'))[_0x82d5('0x79')](_0x82d5('0x7a'))['where'](_0x82d5('0x80'))[_0x82d5('0x41')](_0x82d5('0x7b'),_0x1d2747[_0x82d5('0x76')][_0x82d5('0x77')]())[_0x82d5('0x41')](_0x82d5('0x82')))['toString']();}_0x337fe6=squel[_0x82d5('0x6b')]()[_0x82d5('0x6c')](_0x82d5('0x83'))[_0x82d5('0x6e')](['cmHopperId','scheduledAt',_0x82d5('0x6f'),_0x82d5('0x84'),_0x82d5('0x54'),_0x82d5('0x71')],squel[_0x82d5('0x72')]()[_0x82d5('0x73')](_0x82d5('0x85'),'id')['field']('NOW()',_0x82d5('0x70'))[_0x82d5('0x73')](_0x82d5('0x86'),_0x82d5('0x6f'))[_0x82d5('0x73')](_0x82d5('0x87'),_0x82d5('0x84'))[_0x82d5('0x73')]('\x27'+_0x57252a+'\x27','createdAt')['field']('\x27'+_0x57252a+'\x27',_0x82d5('0x71'))['from'](_0x82d5('0x88'),'ci')[_0x82d5('0x89')](_0x82d5('0x6d'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x82d5('0x41')](_0x82d5('0x8a'),_0x1d2747[_0x82d5('0x76')][_0x82d5('0x77')]())[_0x82d5('0x41')](_0x82d5('0x8b'),_0x4861c8[_0x82d5('0x49')]['id'][_0x82d5('0x77')]())[_0x82d5('0x41')](_0x82d5('0x8c'),_0x57252a))[_0x82d5('0x77')]();_0x363479[_0x82d5('0x8d')](db[_0x82d5('0x8e')][_0x82d5('0x33')](_0xbd3b3f));_0x12afb2[_0x82d5('0x8d')](db[_0x82d5('0x8e')][_0x82d5('0x33')](_0x337fe6));}return BPromise[_0x82d5('0x8f')](_0x363479);}})[_0x82d5('0x27')](function(){return BPromise[_0x82d5('0x8f')](_0x12afb2);})['then'](function(){return _0x3e0ec6;})[_0x82d5('0x27')](respondWithResult(_0x3e0d58,null))['catch'](handleError(_0x3e0d58,null));};exports[_0x82d5('0x90')]=function(_0x1da1af,_0x11ddfe,_0x1bdbfe){return db['Campaign']['find']({'where':{'id':_0x1da1af[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x11ddfe,null))[_0x82d5('0x27')](function(_0x679102){if(_0x679102){return _0x679102[_0x82d5('0x90')](_0x1da1af[_0x82d5('0x33')]['ids']);}})[_0x82d5('0x27')](function(_0x52d1d0){if(_0x52d1d0){return db[_0x82d5('0x5a')]['destroy']({'where':{'ListId':_0x1da1af['query']['ids'],'CampaignId':_0x1da1af[_0x82d5('0x49')]['id']}})['then'](function(){return _0x52d1d0;});}})[_0x82d5('0x27')](respondWithStatusCode(_0x11ddfe,null))['catch'](handleError(_0x11ddfe,null));};exports['getBlackLists']=function(_0x5aeafb,_0xe9be55,_0x12e5c9){var _0x390144={};var _0x18537a={};var _0x24450d;var _0x2e33f7;return db[_0x82d5('0x2e')]['findOne']({'where':{'id':_0x5aeafb[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0xe9be55,null))[_0x82d5('0x27')](function(_0x406a64){if(_0x406a64){_0x24450d=_0x406a64;_0x18537a[_0x82d5('0x37')]=_[_0x82d5('0x34')](db[_0x82d5('0x64')]['rawAttributes']);_0x18537a[_0x82d5('0x33')]=_['keys'](_0x5aeafb['query']);_0x18537a[_0x82d5('0x35')]=_[_0x82d5('0x36')](_0x18537a[_0x82d5('0x37')],_0x18537a['query']);_0x390144[_0x82d5('0x38')]=_['intersection'](_0x18537a[_0x82d5('0x37')],qs[_0x82d5('0x39')](_0x5aeafb[_0x82d5('0x33')][_0x82d5('0x39')]));_0x390144[_0x82d5('0x38')]=_0x390144[_0x82d5('0x38')]['length']?_0x390144['attributes']:_0x18537a[_0x82d5('0x37')];_0x390144[_0x82d5('0x3d')]=qs[_0x82d5('0x3e')](_0x5aeafb[_0x82d5('0x33')][_0x82d5('0x3e')]);_0x390144[_0x82d5('0x41')]=qs[_0x82d5('0x35')](_['pick'](_0x5aeafb['query'],_0x18537a[_0x82d5('0x35')]));if(_0x5aeafb[_0x82d5('0x33')]['filter']){_0x390144[_0x82d5('0x41')]=_[_0x82d5('0x42')](_0x390144[_0x82d5('0x41')],{'$or':_['map'](_0x390144[_0x82d5('0x38')],function(_0x4230f7){var _0x589ad6={};_0x589ad6[_0x4230f7]={'$like':'%'+_0x5aeafb[_0x82d5('0x33')][_0x82d5('0x40')]+'%'};return _0x589ad6;})});}_0x390144=_[_0x82d5('0x42')]({},_0x390144,_0x5aeafb[_0x82d5('0x44')]);return _0x24450d[_0x82d5('0x91')](_0x390144);}})[_0x82d5('0x27')](function(_0x2ad53f){if(_0x2ad53f){_0x2e33f7=_0x2ad53f['length'];if(!_0x5aeafb[_0x82d5('0x33')][_0x82d5('0x3b')](_0x82d5('0x3c'))){_0x390144['limit']=qs[_0x82d5('0x20')](_0x5aeafb[_0x82d5('0x33')]['limit']);_0x390144[_0x82d5('0x1e')]=qs[_0x82d5('0x1e')](_0x5aeafb[_0x82d5('0x33')][_0x82d5('0x1e')]);}return _0x24450d[_0x82d5('0x91')](_0x390144);}})[_0x82d5('0x27')](function(_0x1e659a){if(_0x1e659a){return _0x1e659a?{'count':_0x2e33f7,'rows':_0x1e659a}:null;}})[_0x82d5('0x27')](respondWithResult(_0xe9be55,null))[_0x82d5('0x48')](handleError(_0xe9be55,null));};exports[_0x82d5('0x92')]=function(_0x54c17d,_0x483e73,_0xf614d1){var _0x2f55a4,_0x4421ff;var _0x573faa=[];var _0x926ceb=moment()[_0x82d5('0x93')](_0x82d5('0x66'));return db[_0x82d5('0x2e')]['find']({'where':{'id':_0x54c17d[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x483e73,null))['then'](function(_0x4dfdf4){if(_0x4dfdf4){_0x4421ff=_0x4dfdf4;return _0x4dfdf4['addBlackLists'](_0x54c17d[_0x82d5('0x4c')]['ids'],_[_0x82d5('0x53')](_0x54c17d[_0x82d5('0x4c')],[_0x82d5('0x67'),'id'])||{});}return null;})[_0x82d5('0x68')](function(_0x48d5a0){var _0x202d56;var _0x49c0df;_0x2f55a4=_0x48d5a0||[];var _0x4cde14=[];if(_0x48d5a0){for(var _0x379a72=0x0;_0x379a72<_0x48d5a0[_0x82d5('0x3a')];_0x379a72+=0x1){var _0x14947d=_0x48d5a0[_0x379a72][_0x82d5('0x29')]({'plain':!![]});_0x202d56=squel[_0x82d5('0x6b')]()[_0x82d5('0x6c')]('cm_hopper_black')[_0x82d5('0x6e')](['phone',_0x82d5('0x75'),'ListId',_0x82d5('0x5e'),_0x82d5('0x54'),'updatedAt'],squel['select']()[_0x82d5('0x73')]('phone','phone')[_0x82d5('0x73')]('id','ContactId')[_0x82d5('0x73')](_0x14947d['CmListId'][_0x82d5('0x77')](),'ListId')['field'](_0x54c17d[_0x82d5('0x49')]['id']['toString'](),_0x82d5('0x5e'))[_0x82d5('0x73')]('NOW()',_0x82d5('0x54'))[_0x82d5('0x73')](_0x82d5('0x74'),_0x82d5('0x71'))[_0x82d5('0x79')](_0x82d5('0x7a'))['where'](_0x82d5('0x80'))[_0x82d5('0x41')](_0x82d5('0x7b'),_0x14947d[_0x82d5('0x76')][_0x82d5('0x77')]())[_0x82d5('0x41')](_0x82d5('0x82')))['toString']();_0x4cde14[_0x82d5('0x8d')](db[_0x82d5('0x8e')][_0x82d5('0x33')](_0x202d56));}return BPromise[_0x82d5('0x8f')](_0x4cde14);}})[_0x82d5('0x27')](function(){return _0x2f55a4;})[_0x82d5('0x27')](respondWithResult(_0x483e73,null))['catch'](handleError(_0x483e73,null));};exports[_0x82d5('0x94')]=function(_0x2e45c6,_0x5b89d0,_0x220945){return db[_0x82d5('0x2e')]['find']({'where':{'id':_0x2e45c6[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](handleEntityNotFound(_0x5b89d0,null))[_0x82d5('0x27')](function(_0x4e6132){if(_0x4e6132){return _0x4e6132[_0x82d5('0x94')](_0x2e45c6[_0x82d5('0x33')][_0x82d5('0x67')]);}})['then'](function(_0x581a0f){if(_0x581a0f){return db[_0x82d5('0x62')][_0x82d5('0x28')]({'where':{'ListId':_0x2e45c6['query'][_0x82d5('0x67')],'CampaignId':_0x2e45c6[_0x82d5('0x49')]['id']}})[_0x82d5('0x27')](function(){return _0x581a0f;});}})[_0x82d5('0x27')](respondWithStatusCode(_0x5b89d0,null))[_0x82d5('0x48')](handleError(_0x5b89d0,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index bf9cc9a..acc11ab 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 bce5280..f77c7de 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 _0xde56=['error','code','message','result','catch','options','where','include','map','model','attributes','then','GetCampaign','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d4ede,_0x14bd49){var _0x21fa4e=function(_0x2ca33c){while(--_0x2ca33c){_0x1d4ede['push'](_0x1d4ede['shift']());}};_0x21fa4e(++_0x14bd49);}(_0xde56,0x144));var _0x6de5=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xde56[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x6de5('0x0'));var util=require('util');var moment=require(_0x6de5('0x1'));var BPromise=require(_0x6de5('0x2'));var rs=require(_0x6de5('0x3'));var fs=require('fs');var Redis=require(_0x6de5('0x4'));var db=require(_0x6de5('0x5'))['db'];var utils=require(_0x6de5('0x6'));var logger=require(_0x6de5('0x7'))(_0x6de5('0x8'));var config=require(_0x6de5('0x9'));var jayson=require(_0x6de5('0xa'));var client=jayson['client'][_0x6de5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x141d65,_0x27dcfe,_0x1f8236){return new BPromise(function(_0x1cd11e,_0x3f1400){return client['request'](_0x141d65,_0x1f8236)['then'](function(_0x1769af){logger[_0x6de5('0xc')](_0x6de5('0xd'),_0x27dcfe,_0x6de5('0xe'));logger['debug'](_0x6de5('0xf'),_0x27dcfe,_0x6de5('0xe'),JSON[_0x6de5('0x10')](_0x1769af));if(_0x1769af[_0x6de5('0x11')]){if(_0x1769af['error'][_0x6de5('0x12')]===0x1f4){logger[_0x6de5('0x11')]('Campaign,\x20%s,\x20%s',_0x27dcfe,_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);return _0x3f1400(_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);}logger['error'](_0x6de5('0xd'),_0x27dcfe,_0x1769af[_0x6de5('0x11')][_0x6de5('0x13')]);return _0x1cd11e(_0x1769af[_0x6de5('0x11')]['message']);}else{logger[_0x6de5('0xc')](_0x6de5('0xd'),_0x27dcfe,_0x6de5('0xe'));_0x1cd11e(_0x1769af[_0x6de5('0x14')]['message']);}})[_0x6de5('0x15')](function(_0x2316a6){logger[_0x6de5('0x11')](_0x6de5('0xd'),_0x27dcfe,_0x2316a6);_0x3f1400(_0x2316a6);});});}exports['GetCampaign']=function(_0x1752f5){var _0x7b934e=this;return new Promise(function(_0x385ade,_0x344bbb){return db['Campaign']['findAll']({'raw':_0x1752f5[_0x6de5('0x16')]?_0x1752f5['options']['raw']===undefined?!![]:![]:!![],'where':_0x1752f5[_0x6de5('0x16')]?_0x1752f5['options'][_0x6de5('0x17')]||null:null,'attributes':_0x1752f5[_0x6de5('0x16')]?_0x1752f5[_0x6de5('0x16')]['attributes']||null:null,'limit':_0x1752f5[_0x6de5('0x16')]?_0x1752f5['options']['limit']||null:null,'include':_0x1752f5['options']?_0x1752f5['options'][_0x6de5('0x18')]?_[_0x6de5('0x19')](_0x1752f5[_0x6de5('0x16')][_0x6de5('0x18')],function(_0x2272dc){return{'model':db[_0x2272dc[_0x6de5('0x1a')]],'as':_0x2272dc['as'],'attributes':_0x2272dc[_0x6de5('0x1b')],'include':_0x2272dc['include']?_['map'](_0x2272dc[_0x6de5('0x18')],function(_0x685c78){return{'model':db[_0x685c78['model']],'as':_0x685c78['as'],'attributes':_0x685c78[_0x6de5('0x1b')],'include':_0x685c78[_0x6de5('0x18')]?_[_0x6de5('0x19')](_0x685c78['include'],function(_0x31ec12){return{'model':db[_0x31ec12[_0x6de5('0x1a')]],'as':_0x31ec12['as'],'attributes':_0x31ec12[_0x6de5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6de5('0x1c')](function(_0x17cf0d){logger[_0x6de5('0xc')](_0x6de5('0x1d'),_0x1752f5);logger[_0x6de5('0x1e')](_0x6de5('0x1d'),_0x1752f5,JSON['stringify'](_0x17cf0d));_0x385ade(_0x17cf0d);})[_0x6de5('0x15')](function(_0xf3db96){logger[_0x6de5('0x11')](_0x6de5('0x1d'),_0xf3db96[_0x6de5('0x13')],_0x1752f5);_0x344bbb(_0x7b934e['error'](0x1f4,_0xf3db96['message']));});});}; \ No newline at end of file +var _0x0a34=['model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include'];(function(_0xf6a7f9,_0x1eed4c){var _0x506ee9=function(_0x3ebe84){while(--_0x3ebe84){_0xf6a7f9['push'](_0xf6a7f9['shift']());}};_0x506ee9(++_0x1eed4c);}(_0x0a34,0x12a));var _0x40a3=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x0a34[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var moment=require('moment');var BPromise=require(_0x40a3('0x2'));var rs=require(_0x40a3('0x3'));var fs=require('fs');var Redis=require(_0x40a3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40a3('0x5'));var logger=require(_0x40a3('0x6'))(_0x40a3('0x7'));var config=require('../../config/environment');var jayson=require(_0x40a3('0x8'));var client=jayson[_0x40a3('0x9')][_0x40a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x394f67,_0x655437,_0x3bf1de){return new BPromise(function(_0x504f01,_0x288c84){return client[_0x40a3('0xb')](_0x394f67,_0x3bf1de)[_0x40a3('0xc')](function(_0x1459bc){logger[_0x40a3('0xd')](_0x40a3('0xe'),_0x655437,'request\x20sent');logger[_0x40a3('0xf')](_0x40a3('0x10'),_0x655437,_0x40a3('0x11'),JSON['stringify'](_0x1459bc));if(_0x1459bc[_0x40a3('0x12')]){if(_0x1459bc[_0x40a3('0x12')]['code']===0x1f4){logger[_0x40a3('0x12')](_0x40a3('0xe'),_0x655437,_0x1459bc['error'][_0x40a3('0x13')]);return _0x288c84(_0x1459bc[_0x40a3('0x12')]['message']);}logger[_0x40a3('0x12')](_0x40a3('0xe'),_0x655437,_0x1459bc[_0x40a3('0x12')][_0x40a3('0x13')]);return _0x504f01(_0x1459bc['error']['message']);}else{logger['info'](_0x40a3('0xe'),_0x655437,_0x40a3('0x11'));_0x504f01(_0x1459bc[_0x40a3('0x14')]['message']);}})[_0x40a3('0x15')](function(_0x8c3d45){logger['error'](_0x40a3('0xe'),_0x655437,_0x8c3d45);_0x288c84(_0x8c3d45);});});}exports[_0x40a3('0x16')]=function(_0x31aef5){var _0x22f31e=this;return new Promise(function(_0x1c5102,_0x4d037a){return db[_0x40a3('0x17')][_0x40a3('0x18')]({'raw':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1a')]===undefined?!![]:![]:!![],'where':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1b')]||null:null,'attributes':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1c')]||null:null,'limit':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1d')]||null:null,'include':_0x31aef5[_0x40a3('0x19')]?_0x31aef5[_0x40a3('0x19')]['include']?_[_0x40a3('0x1e')](_0x31aef5[_0x40a3('0x19')][_0x40a3('0x1f')],function(_0x1e11fb){return{'model':db[_0x1e11fb[_0x40a3('0x20')]],'as':_0x1e11fb['as'],'attributes':_0x1e11fb[_0x40a3('0x1c')],'include':_0x1e11fb['include']?_[_0x40a3('0x1e')](_0x1e11fb['include'],function(_0x37321a){return{'model':db[_0x37321a[_0x40a3('0x20')]],'as':_0x37321a['as'],'attributes':_0x37321a['attributes'],'include':_0x37321a[_0x40a3('0x1f')]?_[_0x40a3('0x1e')](_0x37321a[_0x40a3('0x1f')],function(_0x599474){return{'model':db[_0x599474[_0x40a3('0x20')]],'as':_0x599474['as'],'attributes':_0x599474[_0x40a3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x40a3('0xc')](function(_0x4456f1){logger[_0x40a3('0xd')](_0x40a3('0x16'),_0x31aef5);logger[_0x40a3('0xf')](_0x40a3('0x16'),_0x31aef5,JSON['stringify'](_0x4456f1));_0x1c5102(_0x4456f1);})['catch'](function(_0x355a8f){logger['error']('GetCampaign',_0x355a8f[_0x40a3('0x13')],_0x31aef5);_0x4d037a(_0x22f31e[_0x40a3('0x12')](0x1f4,_0x355a8f[_0x40a3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 2a81a6f..7363e5d 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 _0xff32=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','delete','removeBlackLists','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x125f94,_0x23cecb){var _0x3bc3b0=function(_0x18dc0f){while(--_0x18dc0f){_0x125f94['push'](_0x125f94['shift']());}};_0x3bc3b0(++_0x23cecb);}(_0xff32,0x15a));var _0x2ff3=function(_0x1e0de7,_0x28b328){_0x1e0de7=_0x1e0de7-0x0;var _0x212ce6=_0xff32[_0x1e0de7];return _0x212ce6;};'use strict';var multer=require('multer');var util=require(_0x2ff3('0x0'));var path=require(_0x2ff3('0x1'));var timeout=require(_0x2ff3('0x2'));var express=require(_0x2ff3('0x3'));var router=express['Router']();var fs_extra=require(_0x2ff3('0x4'));var auth=require(_0x2ff3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2ff3('0x6'));var controller=require(_0x2ff3('0x7'));router[_0x2ff3('0x8')]('/',auth[_0x2ff3('0x9')](),controller[_0x2ff3('0xa')]);router[_0x2ff3('0x8')](_0x2ff3('0xb'),auth[_0x2ff3('0x9')](),controller[_0x2ff3('0xc')]);router[_0x2ff3('0x8')](_0x2ff3('0xd'),auth[_0x2ff3('0x9')](),controller[_0x2ff3('0xe')]);router[_0x2ff3('0x8')](_0x2ff3('0xf'),auth[_0x2ff3('0x9')](),controller[_0x2ff3('0x10')]);router['get']('/:id/hopper_finals',auth[_0x2ff3('0x9')](),controller[_0x2ff3('0x11')]);router['get'](_0x2ff3('0x12'),auth['isAuthenticated'](),controller[_0x2ff3('0x13')]);router[_0x2ff3('0x8')](_0x2ff3('0x14'),auth[_0x2ff3('0x9')](),controller['getLists']);router[_0x2ff3('0x8')]('/:id/blacklists',auth[_0x2ff3('0x9')](),controller[_0x2ff3('0x15')]);router[_0x2ff3('0x16')]('/',auth[_0x2ff3('0x9')](),controller[_0x2ff3('0x17')]);router[_0x2ff3('0x16')](_0x2ff3('0x18'),auth['isAuthenticated'](),controller[_0x2ff3('0x19')]);router['post'](_0x2ff3('0x14'),auth[_0x2ff3('0x9')](),controller[_0x2ff3('0x1a')]);router[_0x2ff3('0x16')](_0x2ff3('0x1b'),auth[_0x2ff3('0x9')](),controller[_0x2ff3('0x1c')]);router[_0x2ff3('0x1d')](_0x2ff3('0xb'),auth[_0x2ff3('0x9')](),controller['update']);router['delete'](_0x2ff3('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x2ff3('0x1e')](_0x2ff3('0x14'),auth[_0x2ff3('0x9')](),controller['removeLists']);router[_0x2ff3('0x1e')](_0x2ff3('0x1b'),auth[_0x2ff3('0x9')](),controller[_0x2ff3('0x1f')]);module[_0x2ff3('0x20')]=router; \ No newline at end of file +var _0x839e=['removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x839e,0xdb));var _0xe839=function(_0x260859,_0x3cfcff){_0x260859=_0x260859-0x0;var _0x4b77f8=_0x839e[_0x260859];return _0x4b77f8;};'use strict';var multer=require(_0xe839('0x0'));var util=require(_0xe839('0x1'));var path=require(_0xe839('0x2'));var timeout=require(_0xe839('0x3'));var express=require(_0xe839('0x4'));var router=express['Router']();var fs_extra=require(_0xe839('0x5'));var auth=require(_0xe839('0x6'));var interaction=require(_0xe839('0x7'));var config=require(_0xe839('0x8'));var controller=require(_0xe839('0x9'));router['get']('/',auth[_0xe839('0xa')](),controller[_0xe839('0xb')]);router[_0xe839('0xc')](_0xe839('0xd'),auth[_0xe839('0xa')](),controller[_0xe839('0xe')]);router['get'](_0xe839('0xf'),auth[_0xe839('0xa')](),controller[_0xe839('0x10')]);router['get']('/:id/hopper_histories',auth[_0xe839('0xa')](),controller[_0xe839('0x11')]);router[_0xe839('0xc')](_0xe839('0x12'),auth[_0xe839('0xa')](),controller[_0xe839('0x13')]);router[_0xe839('0xc')]('/:id/hopper_black',auth[_0xe839('0xa')](),controller[_0xe839('0x14')]);router[_0xe839('0xc')](_0xe839('0x15'),auth[_0xe839('0xa')](),controller[_0xe839('0x16')]);router['get'](_0xe839('0x17'),auth[_0xe839('0xa')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0xe839('0x18')]);router[_0xe839('0x19')](_0xe839('0x1a'),auth[_0xe839('0xa')](),controller[_0xe839('0x1b')]);router['post']('/:id/lists',auth['isAuthenticated'](),controller[_0xe839('0x1c')]);router[_0xe839('0x19')]('/:id/blacklists',auth[_0xe839('0xa')](),controller[_0xe839('0x1d')]);router[_0xe839('0x1e')](_0xe839('0xd'),auth[_0xe839('0xa')](),controller[_0xe839('0x1f')]);router[_0xe839('0x20')](_0xe839('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xe839('0x20')]('/:id/lists',auth[_0xe839('0xa')](),controller[_0xe839('0x21')]);router['delete'](_0xe839('0x17'),auth['isAuthenticated'](),controller[_0xe839('0x22')]);module[_0xe839('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 664c5e2..f24fbec 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 _0xe5e1=['getDataValue','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe5e1,0x199));var _0x1e5e=function(_0x3835e1,_0x17f9ec){_0x3835e1=_0x3835e1-0x0;var _0x284e1d=_0xe5e1[_0x3835e1];return _0x284e1d;};'use strict';var Sequelize=require(_0x1e5e('0x0'));module['exports']={'key':{'type':Sequelize[_0x1e5e('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1e5e('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1e5e('0x2')]('key');}}}; \ No newline at end of file +var _0x2f50=['STRING','VIRTUAL','getDataValue','key','sequelize','exports','TEXT'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x2f50,0x131));var _0x02f5=function(_0x87e603,_0x548c94){_0x87e603=_0x87e603-0x0;var _0x1e241e=_0x2f50[_0x87e603];return _0x1e241e;};'use strict';var Sequelize=require(_0x02f5('0x0'));module[_0x02f5('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x02f5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x02f5('0x3')]},'name':{'type':Sequelize[_0x02f5('0x4')],'get':function(){return this[_0x02f5('0x5')](_0x02f5('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 47588bf..fa31f14 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 _0x2a98=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','index','map','CannedAnswer','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','params','rawAttributes','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x31e804,_0x38d277){var _0x5c7a51=function(_0x172b42){while(--_0x172b42){_0x31e804['push'](_0x31e804['shift']());}};_0x5c7a51(++_0x38d277);}(_0x2a98,0xee));var _0x82a9=function(_0x4fcb28,_0x477acc){_0x4fcb28=_0x4fcb28-0x0;var _0xb1853d=_0x2a98[_0x4fcb28];return _0xb1853d;};'use strict';var emlformat=require(_0x82a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82a9('0x1'));var jsonpatch=require(_0x82a9('0x2'));var rp=require(_0x82a9('0x3'));var moment=require(_0x82a9('0x4'));var BPromise=require(_0x82a9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x82a9('0x6'));var csv=require(_0x82a9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82a9('0x8'));var _=require('lodash');var squel=require(_0x82a9('0x9'));var crypto=require(_0x82a9('0xa'));var jsforce=require(_0x82a9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x82a9('0x7'));var querystring=require(_0x82a9('0xc'));var Papa=require(_0x82a9('0xd'));var Redis=require(_0x82a9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x82a9('0xf'));var as=require(_0x82a9('0x10'));var hardwareService=require(_0x82a9('0x11'));var logger=require(_0x82a9('0x12'))(_0x82a9('0x13'));var utils=require(_0x82a9('0x14'));var config=require(_0x82a9('0x15'));var licenseUtil=require(_0x82a9('0x16'));var db=require(_0x82a9('0x17'))['db'];function respondWithStatusCode(_0xf93981,_0x17d77f){_0x17d77f=_0x17d77f||0xcc;return function(_0x3b78fb){if(_0x3b78fb){return _0xf93981['sendStatus'](_0x17d77f);}return _0xf93981[_0x82a9('0x18')](_0x17d77f)['end']();};}function respondWithResult(_0x4d0d50,_0x313658){_0x313658=_0x313658||0xc8;return function(_0x10f133){if(_0x10f133){return _0x4d0d50[_0x82a9('0x18')](_0x313658)['json'](_0x10f133);}};}function respondWithFilteredResult(_0x541a59,_0x4be37f){return function(_0x41f31c){if(_0x41f31c){var _0x49f1dd=typeof _0x4be37f[_0x82a9('0x19')]==='undefined'&&typeof _0x4be37f[_0x82a9('0x1a')]===_0x82a9('0x1b');var _0x32b3c9=_0x41f31c[_0x82a9('0x1c')];var _0x1fd3b0=_0x49f1dd?0x0:_0x4be37f[_0x82a9('0x19')];var _0x30e23e=_0x49f1dd?_0x41f31c['count']:_0x4be37f[_0x82a9('0x19')]+_0x4be37f[_0x82a9('0x1a')];var _0x851b0f;if(_0x30e23e>=_0x32b3c9){_0x30e23e=_0x32b3c9;_0x851b0f=0xc8;}else{_0x851b0f=0xce;}_0x541a59['status'](_0x851b0f);return _0x541a59[_0x82a9('0x1d')](_0x82a9('0x1e'),_0x1fd3b0+'-'+_0x30e23e+'/'+_0x32b3c9)[_0x82a9('0x1f')](_0x41f31c);}return null;};}function patchUpdates(_0x3f6b47){return function(_0x5a57fb){try{jsonpatch[_0x82a9('0x20')](_0x5a57fb,_0x3f6b47,!![]);}catch(_0x2a1bba){return BPromise[_0x82a9('0x21')](_0x2a1bba);}return _0x5a57fb['save']();};}function saveUpdates(_0x4a183b,_0x13d304){return function(_0x53b7e2){if(_0x53b7e2){return _0x53b7e2[_0x82a9('0x22')](_0x4a183b)[_0x82a9('0x23')](function(_0x30709e){return _0x30709e;});}return null;};}function removeEntity(_0x5cf4e6,_0x56c4c3){return function(_0x136df6){if(_0x136df6){return _0x136df6[_0x82a9('0x24')]()[_0x82a9('0x23')](function(){var _0x397d1d=_0x136df6[_0x82a9('0x25')]({'plain':!![]});var _0x31ef12=_0x82a9('0x26');return db[_0x82a9('0x27')][_0x82a9('0x24')]({'where':{'type':_0x31ef12,'resourceId':_0x397d1d['id']}})[_0x82a9('0x23')](function(){return _0x136df6;});})[_0x82a9('0x23')](function(){_0x5cf4e6[_0x82a9('0x18')](0xcc)[_0x82a9('0x28')]();});}};}function handleEntityNotFound(_0x16b9fa,_0x96c544){return function(_0x1745ec){if(!_0x1745ec){_0x16b9fa['sendStatus'](0x194);}return _0x1745ec;};}function handleError(_0x5aff67,_0x1e07ba){_0x1e07ba=_0x1e07ba||0x1f4;return function(_0x150b8f){logger[_0x82a9('0x29')](_0x150b8f['stack']);if(_0x150b8f[_0x82a9('0x2a')]){delete _0x150b8f[_0x82a9('0x2a')];}_0x5aff67[_0x82a9('0x18')](_0x1e07ba)['send'](_0x150b8f);};}exports[_0x82a9('0x2b')]=function(_0x3d863e,_0x16e837){var _0x18236a={},_0x16ea60={},_0x51abc4={'count':0x0,'rows':[]};var _0x4423cb=_[_0x82a9('0x2c')](db[_0x82a9('0x2d')]['rawAttributes'],function(_0xe739f5){return{'name':_0xe739f5[_0x82a9('0x2e')],'type':_0xe739f5[_0x82a9('0x2f')]['key']};});_0x16ea60[_0x82a9('0x30')]=_[_0x82a9('0x2c')](_0x4423cb,_0x82a9('0x2a'));_0x16ea60[_0x82a9('0x31')]=_[_0x82a9('0x32')](_0x3d863e[_0x82a9('0x31')]);_0x16ea60[_0x82a9('0x33')]=_[_0x82a9('0x34')](_0x16ea60[_0x82a9('0x30')],_0x16ea60['query']);_0x18236a[_0x82a9('0x35')]=_['intersection'](_0x16ea60['model'],qs[_0x82a9('0x36')](_0x3d863e[_0x82a9('0x31')][_0x82a9('0x36')]));_0x18236a[_0x82a9('0x35')]=_0x18236a[_0x82a9('0x35')][_0x82a9('0x37')]?_0x18236a['attributes']:_0x16ea60['model'];if(!_0x3d863e[_0x82a9('0x31')][_0x82a9('0x38')](_0x82a9('0x39'))){_0x18236a['limit']=qs[_0x82a9('0x1a')](_0x3d863e[_0x82a9('0x31')][_0x82a9('0x1a')]);_0x18236a[_0x82a9('0x19')]=qs[_0x82a9('0x19')](_0x3d863e[_0x82a9('0x31')][_0x82a9('0x19')]);}_0x18236a[_0x82a9('0x3a')]=qs[_0x82a9('0x3b')](_0x3d863e[_0x82a9('0x31')][_0x82a9('0x3b')]);_0x18236a[_0x82a9('0x3c')]=qs[_0x82a9('0x33')](_['pick'](_0x3d863e[_0x82a9('0x31')],_0x16ea60[_0x82a9('0x33')]),_0x4423cb);if(_0x3d863e['query'][_0x82a9('0x3d')]){_0x18236a[_0x82a9('0x3c')]=_['merge'](_0x18236a['where'],{'$or':[{'key':{'$like':'%'+_0x3d863e[_0x82a9('0x31')][_0x82a9('0x3d')]+'%'}},{'value':{'$like':'%'+_0x3d863e['query'][_0x82a9('0x3d')]+'%'}}]});}_0x18236a=_[_0x82a9('0x3e')]({},_0x18236a,_0x3d863e[_0x82a9('0x3f')]);var _0x1d1e3d={'where':_0x18236a[_0x82a9('0x3c')]};return db[_0x82a9('0x2d')][_0x82a9('0x1c')](_0x1d1e3d)['then'](function(_0x53b017){_0x51abc4[_0x82a9('0x1c')]=_0x53b017;if(_0x3d863e['query']['includeAll']){_0x18236a[_0x82a9('0x40')]=[{'all':!![]}];}return db[_0x82a9('0x2d')][_0x82a9('0x41')](_0x18236a);})[_0x82a9('0x23')](function(_0x57d6d6){_0x51abc4[_0x82a9('0x42')]=_0x57d6d6;return _0x51abc4;})[_0x82a9('0x23')](respondWithFilteredResult(_0x16e837,_0x18236a))[_0x82a9('0x43')](handleError(_0x16e837,null));};exports['show']=function(_0x43d6b2,_0x4136d2){var _0x310f35={'raw':!![],'where':{'id':_0x43d6b2[_0x82a9('0x44')]['id']}},_0x15c697={};_0x15c697[_0x82a9('0x30')]=_[_0x82a9('0x32')](db['CannedAnswer'][_0x82a9('0x45')]);_0x15c697[_0x82a9('0x31')]=_[_0x82a9('0x32')](_0x43d6b2[_0x82a9('0x31')]);_0x15c697['filters']=_[_0x82a9('0x34')](_0x15c697[_0x82a9('0x30')],_0x15c697[_0x82a9('0x31')]);_0x310f35[_0x82a9('0x35')]=_[_0x82a9('0x34')](_0x15c697[_0x82a9('0x30')],qs[_0x82a9('0x36')](_0x43d6b2[_0x82a9('0x31')][_0x82a9('0x36')]));_0x310f35[_0x82a9('0x35')]=_0x310f35['attributes'][_0x82a9('0x37')]?_0x310f35[_0x82a9('0x35')]:_0x15c697[_0x82a9('0x30')];if(_0x43d6b2[_0x82a9('0x31')]['includeAll']){_0x310f35[_0x82a9('0x40')]=[{'all':!![]}];}_0x310f35=_[_0x82a9('0x3e')]({},_0x310f35,_0x43d6b2[_0x82a9('0x3f')]);return db[_0x82a9('0x2d')][_0x82a9('0x46')](_0x310f35)['then'](handleEntityNotFound(_0x4136d2,null))[_0x82a9('0x23')](respondWithResult(_0x4136d2,null))[_0x82a9('0x43')](handleError(_0x4136d2,null));};exports[_0x82a9('0x22')]=function(_0x218727,_0x2793d6){if(_0x218727[_0x82a9('0x47')]['id']){delete _0x218727[_0x82a9('0x47')]['id'];}return db[_0x82a9('0x2d')][_0x82a9('0x46')]({'where':{'id':_0x218727[_0x82a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x2793d6,null))[_0x82a9('0x23')](saveUpdates(_0x218727[_0x82a9('0x47')],null))[_0x82a9('0x23')](respondWithResult(_0x2793d6,null))[_0x82a9('0x43')](handleError(_0x2793d6,null));};exports[_0x82a9('0x24')]=function(_0x25e44b,_0x111f6a){return db[_0x82a9('0x2d')]['find']({'where':{'id':_0x25e44b[_0x82a9('0x44')]['id']}})[_0x82a9('0x23')](handleEntityNotFound(_0x111f6a,null))['then'](removeEntity(_0x111f6a,null))[_0x82a9('0x43')](handleError(_0x111f6a,null));};exports[_0x82a9('0x48')]=function(_0x28208f,_0x2bdec8){var _0x407b15={'key':_0x28208f['body'][_0x82a9('0x49')]};if(_0x28208f['body'][_0x82a9('0x4a')]){_0x407b15[_0x82a9('0x4a')]=_0x28208f[_0x82a9('0x47')][_0x82a9('0x4a')];}else if(_0x28208f[_0x82a9('0x47')][_0x82a9('0x4b')]){_0x407b15[_0x82a9('0x4b')]=_0x28208f[_0x82a9('0x47')][_0x82a9('0x4b')];}else if(_0x28208f[_0x82a9('0x47')]['OpenchannelAccountId']){_0x407b15[_0x82a9('0x4c')]=_0x28208f[_0x82a9('0x47')][_0x82a9('0x4c')];}else if(_0x28208f['body'][_0x82a9('0x4d')]){_0x407b15[_0x82a9('0x4d')]=_0x28208f[_0x82a9('0x47')][_0x82a9('0x4d')];}return db[_0x82a9('0x2d')][_0x82a9('0x46')]({'where':_0x407b15})['then'](function(_0x12b569){if(_0x12b569){throw new db[(_0x82a9('0x4e'))][(_0x82a9('0x4f'))](_0x82a9('0x50'));}return db[_0x82a9('0x2d')][_0x82a9('0x48')](_0x28208f['body']);})[_0x82a9('0x23')](function(_0x31cba2){var _0x35410b=_0x28208f[_0x82a9('0x51')][_0x82a9('0x25')]({'plain':!![]});if(!_0x35410b)throw new Error(_0x82a9('0x52'));if(_0x35410b[_0x82a9('0x53')]==='user'){var _0x443718=_0x31cba2[_0x82a9('0x25')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x82a9('0x26'),'userProfileId':_0x35410b[_0x82a9('0x54')]},'raw':!![]})[_0x82a9('0x23')](function(_0x731973){if(_0x731973&&_0x731973['autoAssociation']===0x0){return db[_0x82a9('0x27')][_0x82a9('0x48')]({'name':_0x443718['name'],'resourceId':_0x443718['id'],'type':_0x731973[_0x82a9('0x2a')],'sectionId':_0x731973['id']},{})[_0x82a9('0x23')](function(){return _0x31cba2;});}else{return _0x31cba2;}})[_0x82a9('0x43')](function(_0x54455c){logger[_0x82a9('0x29')](_0x82a9('0x55'),_0x54455c);throw _0x54455c;});}return _0x31cba2;})['then'](respondWithResult(_0x2bdec8,0xc9))[_0x82a9('0x43')](handleError(_0x2bdec8,null));}; \ No newline at end of file +var _0xd3c3=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','sort','pick','filter','where','merge','CannedAnswer','rows','catch','show','params','length','includeAll','include','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xd3c3,0x9d));var _0x3d3c=function(_0xc8c136,_0x34cf16){_0xc8c136=_0xc8c136-0x0;var _0xc3871a=_0xd3c3[_0xc8c136];return _0xc3871a;};'use strict';var emlformat=require(_0x3d3c('0x0'));var rimraf=require(_0x3d3c('0x1'));var zipdir=require(_0x3d3c('0x2'));var jsonpatch=require(_0x3d3c('0x3'));var rp=require('request-promise');var moment=require(_0x3d3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d3c('0x5'));var util=require('util');var path=require(_0x3d3c('0x6'));var sox=require('sox');var csv=require(_0x3d3c('0x7'));var ejs=require(_0x3d3c('0x8'));var fs=require('fs');var fs_extra=require(_0x3d3c('0x9'));var _=require(_0x3d3c('0xa'));var squel=require(_0x3d3c('0xb'));var crypto=require(_0x3d3c('0xc'));var jsforce=require(_0x3d3c('0xd'));var deskjs=require(_0x3d3c('0xe'));var toCsv=require(_0x3d3c('0x7'));var querystring=require(_0x3d3c('0xf'));var Papa=require(_0x3d3c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3d3c('0x11'));var hardwareService=require(_0x3d3c('0x12'));var logger=require(_0x3d3c('0x13'))(_0x3d3c('0x14'));var utils=require(_0x3d3c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3d3c('0x16'));var db=require(_0x3d3c('0x17'))['db'];function respondWithStatusCode(_0x3e64f0,_0x16e522){_0x16e522=_0x16e522||0xcc;return function(_0x314753){if(_0x314753){return _0x3e64f0['sendStatus'](_0x16e522);}return _0x3e64f0['status'](_0x16e522)['end']();};}function respondWithResult(_0x38262f,_0x5dbae9){_0x5dbae9=_0x5dbae9||0xc8;return function(_0x4f4450){if(_0x4f4450){return _0x38262f[_0x3d3c('0x18')](_0x5dbae9)['json'](_0x4f4450);}};}function respondWithFilteredResult(_0x8390a1,_0x1fa48b){return function(_0x296f6e){if(_0x296f6e){var _0x5715fd=typeof _0x1fa48b[_0x3d3c('0x19')]===_0x3d3c('0x1a')&&typeof _0x1fa48b[_0x3d3c('0x1b')]===_0x3d3c('0x1a');var _0x5000f6=_0x296f6e[_0x3d3c('0x1c')];var _0x5f06ae=_0x5715fd?0x0:_0x1fa48b[_0x3d3c('0x19')];var _0x4c4aef=_0x5715fd?_0x296f6e[_0x3d3c('0x1c')]:_0x1fa48b['offset']+_0x1fa48b[_0x3d3c('0x1b')];var _0x540c09;if(_0x4c4aef>=_0x5000f6){_0x4c4aef=_0x5000f6;_0x540c09=0xc8;}else{_0x540c09=0xce;}_0x8390a1[_0x3d3c('0x18')](_0x540c09);return _0x8390a1[_0x3d3c('0x1d')](_0x3d3c('0x1e'),_0x5f06ae+'-'+_0x4c4aef+'/'+_0x5000f6)[_0x3d3c('0x1f')](_0x296f6e);}return null;};}function patchUpdates(_0x38d1e0){return function(_0x110324){try{jsonpatch[_0x3d3c('0x20')](_0x110324,_0x38d1e0,!![]);}catch(_0x87b123){return BPromise[_0x3d3c('0x21')](_0x87b123);}return _0x110324[_0x3d3c('0x22')]();};}function saveUpdates(_0x48a968,_0x232142){return function(_0x137d38){if(_0x137d38){return _0x137d38[_0x3d3c('0x23')](_0x48a968)['then'](function(_0x190384){return _0x190384;});}return null;};}function removeEntity(_0x401ce9,_0x445ea9){return function(_0x8fa680){if(_0x8fa680){return _0x8fa680[_0x3d3c('0x24')]()[_0x3d3c('0x25')](function(){var _0x183fb6=_0x8fa680[_0x3d3c('0x26')]({'plain':!![]});var _0xd9548d=_0x3d3c('0x27');return db[_0x3d3c('0x28')][_0x3d3c('0x24')]({'where':{'type':_0xd9548d,'resourceId':_0x183fb6['id']}})[_0x3d3c('0x25')](function(){return _0x8fa680;});})[_0x3d3c('0x25')](function(){_0x401ce9[_0x3d3c('0x18')](0xcc)[_0x3d3c('0x29')]();});}};}function handleEntityNotFound(_0x523a07,_0x4a793d){return function(_0x53b013){if(!_0x53b013){_0x523a07[_0x3d3c('0x2a')](0x194);}return _0x53b013;};}function handleError(_0x3a9839,_0x1a668b){_0x1a668b=_0x1a668b||0x1f4;return function(_0x1e4918){logger[_0x3d3c('0x2b')](_0x1e4918['stack']);if(_0x1e4918[_0x3d3c('0x2c')]){delete _0x1e4918[_0x3d3c('0x2c')];}_0x3a9839[_0x3d3c('0x18')](_0x1a668b)[_0x3d3c('0x2d')](_0x1e4918);};}exports[_0x3d3c('0x2e')]=function(_0x431637,_0x5d1c81){var _0xfdca82={},_0x4490c2={},_0x4e25f6={'count':0x0,'rows':[]};var _0x3755f1=_[_0x3d3c('0x2f')](db['CannedAnswer'][_0x3d3c('0x30')],function(_0x1e713d){return{'name':_0x1e713d[_0x3d3c('0x31')],'type':_0x1e713d[_0x3d3c('0x32')][_0x3d3c('0x33')]};});_0x4490c2[_0x3d3c('0x34')]=_['map'](_0x3755f1,_0x3d3c('0x2c'));_0x4490c2['query']=_[_0x3d3c('0x35')](_0x431637[_0x3d3c('0x36')]);_0x4490c2[_0x3d3c('0x37')]=_[_0x3d3c('0x38')](_0x4490c2[_0x3d3c('0x34')],_0x4490c2['query']);_0xfdca82[_0x3d3c('0x39')]=_[_0x3d3c('0x38')](_0x4490c2['model'],qs[_0x3d3c('0x3a')](_0x431637['query'][_0x3d3c('0x3a')]));_0xfdca82[_0x3d3c('0x39')]=_0xfdca82[_0x3d3c('0x39')]['length']?_0xfdca82[_0x3d3c('0x39')]:_0x4490c2[_0x3d3c('0x34')];if(!_0x431637[_0x3d3c('0x36')]['hasOwnProperty']('nolimit')){_0xfdca82[_0x3d3c('0x1b')]=qs['limit'](_0x431637[_0x3d3c('0x36')]['limit']);_0xfdca82[_0x3d3c('0x19')]=qs[_0x3d3c('0x19')](_0x431637[_0x3d3c('0x36')]['offset']);}_0xfdca82['order']=qs['sort'](_0x431637['query'][_0x3d3c('0x3b')]);_0xfdca82['where']=qs['filters'](_[_0x3d3c('0x3c')](_0x431637[_0x3d3c('0x36')],_0x4490c2['filters']),_0x3755f1);if(_0x431637['query'][_0x3d3c('0x3d')]){_0xfdca82[_0x3d3c('0x3e')]=_[_0x3d3c('0x3f')](_0xfdca82[_0x3d3c('0x3e')],{'$or':[{'key':{'$like':'%'+_0x431637['query'][_0x3d3c('0x3d')]+'%'}},{'value':{'$like':'%'+_0x431637[_0x3d3c('0x36')][_0x3d3c('0x3d')]+'%'}}]});}_0xfdca82=_[_0x3d3c('0x3f')]({},_0xfdca82,_0x431637['options']);var _0x4c1aa8={'where':_0xfdca82[_0x3d3c('0x3e')]};return db[_0x3d3c('0x40')][_0x3d3c('0x1c')](_0x4c1aa8)[_0x3d3c('0x25')](function(_0x31f8e0){_0x4e25f6[_0x3d3c('0x1c')]=_0x31f8e0;if(_0x431637[_0x3d3c('0x36')]['includeAll']){_0xfdca82['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xfdca82);})[_0x3d3c('0x25')](function(_0x37f400){_0x4e25f6[_0x3d3c('0x41')]=_0x37f400;return _0x4e25f6;})[_0x3d3c('0x25')](respondWithFilteredResult(_0x5d1c81,_0xfdca82))[_0x3d3c('0x42')](handleError(_0x5d1c81,null));};exports[_0x3d3c('0x43')]=function(_0xaa004,_0x391bdf){var _0x1c565b={'raw':!![],'where':{'id':_0xaa004[_0x3d3c('0x44')]['id']}},_0x2043d1={};_0x2043d1[_0x3d3c('0x34')]=_[_0x3d3c('0x35')](db['CannedAnswer'][_0x3d3c('0x30')]);_0x2043d1[_0x3d3c('0x36')]=_[_0x3d3c('0x35')](_0xaa004[_0x3d3c('0x36')]);_0x2043d1[_0x3d3c('0x37')]=_[_0x3d3c('0x38')](_0x2043d1[_0x3d3c('0x34')],_0x2043d1['query']);_0x1c565b[_0x3d3c('0x39')]=_[_0x3d3c('0x38')](_0x2043d1[_0x3d3c('0x34')],qs[_0x3d3c('0x3a')](_0xaa004[_0x3d3c('0x36')][_0x3d3c('0x3a')]));_0x1c565b['attributes']=_0x1c565b[_0x3d3c('0x39')][_0x3d3c('0x45')]?_0x1c565b[_0x3d3c('0x39')]:_0x2043d1[_0x3d3c('0x34')];if(_0xaa004[_0x3d3c('0x36')][_0x3d3c('0x46')]){_0x1c565b[_0x3d3c('0x47')]=[{'all':!![]}];}_0x1c565b=_[_0x3d3c('0x3f')]({},_0x1c565b,_0xaa004[_0x3d3c('0x48')]);return db[_0x3d3c('0x40')][_0x3d3c('0x49')](_0x1c565b)[_0x3d3c('0x25')](handleEntityNotFound(_0x391bdf,null))[_0x3d3c('0x25')](respondWithResult(_0x391bdf,null))[_0x3d3c('0x42')](handleError(_0x391bdf,null));};exports[_0x3d3c('0x23')]=function(_0x1c56cc,_0x118f5b){if(_0x1c56cc[_0x3d3c('0x4a')]['id']){delete _0x1c56cc[_0x3d3c('0x4a')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x1c56cc[_0x3d3c('0x44')]['id']}})[_0x3d3c('0x25')](handleEntityNotFound(_0x118f5b,null))[_0x3d3c('0x25')](saveUpdates(_0x1c56cc[_0x3d3c('0x4a')],null))['then'](respondWithResult(_0x118f5b,null))[_0x3d3c('0x42')](handleError(_0x118f5b,null));};exports['destroy']=function(_0x404d5a,_0x17c572){return db[_0x3d3c('0x40')]['find']({'where':{'id':_0x404d5a[_0x3d3c('0x44')]['id']}})[_0x3d3c('0x25')](handleEntityNotFound(_0x17c572,null))[_0x3d3c('0x25')](removeEntity(_0x17c572,null))[_0x3d3c('0x42')](handleError(_0x17c572,null));};exports[_0x3d3c('0x4b')]=function(_0x25ac8f,_0x4318c9){var _0x553d3d={'key':_0x25ac8f[_0x3d3c('0x4a')]['key']};if(_0x25ac8f[_0x3d3c('0x4a')][_0x3d3c('0x4c')]){_0x553d3d[_0x3d3c('0x4c')]=_0x25ac8f[_0x3d3c('0x4a')][_0x3d3c('0x4c')];}else if(_0x25ac8f['body']['SmsAccountId']){_0x553d3d['SmsAccountId']=_0x25ac8f[_0x3d3c('0x4a')][_0x3d3c('0x4d')];}else if(_0x25ac8f['body'][_0x3d3c('0x4e')]){_0x553d3d[_0x3d3c('0x4e')]=_0x25ac8f[_0x3d3c('0x4a')]['OpenchannelAccountId'];}else if(_0x25ac8f['body'][_0x3d3c('0x4f')]){_0x553d3d[_0x3d3c('0x4f')]=_0x25ac8f['body'][_0x3d3c('0x4f')];}return db[_0x3d3c('0x40')][_0x3d3c('0x49')]({'where':_0x553d3d})[_0x3d3c('0x25')](function(_0x2899c2){if(_0x2899c2){throw new db[(_0x3d3c('0x50'))][(_0x3d3c('0x51'))](_0x3d3c('0x52'));}return db[_0x3d3c('0x40')][_0x3d3c('0x4b')](_0x25ac8f[_0x3d3c('0x4a')]);})['then'](function(_0x1bdd6){var _0x3c9a4e=_0x25ac8f[_0x3d3c('0x53')]['get']({'plain':!![]});if(!_0x3c9a4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c9a4e[_0x3d3c('0x54')]==='user'){var _0x276692=_0x1bdd6[_0x3d3c('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x3d3c('0x49')]({'where':{'name':_0x3d3c('0x27'),'userProfileId':_0x3c9a4e[_0x3d3c('0x55')]},'raw':!![]})[_0x3d3c('0x25')](function(_0x1a8b00){if(_0x1a8b00&&_0x1a8b00[_0x3d3c('0x56')]===0x0){return db[_0x3d3c('0x28')][_0x3d3c('0x4b')]({'name':_0x276692[_0x3d3c('0x2c')],'resourceId':_0x276692['id'],'type':_0x1a8b00[_0x3d3c('0x2c')],'sectionId':_0x1a8b00['id']},{})[_0x3d3c('0x25')](function(){return _0x1bdd6;});}else{return _0x1bdd6;}})[_0x3d3c('0x42')](function(_0x5ed1c5){logger[_0x3d3c('0x2b')](_0x3d3c('0x57'),_0x5ed1c5);throw _0x5ed1c5;});}return _0x1bdd6;})[_0x3d3c('0x25')](respondWithResult(_0x4318c9,0xc9))[_0x3d3c('0x42')](handleError(_0x4318c9,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 00b34a4..81637b6 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 _0xbc19=['request-promise','path','rimraf','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2c3093,_0xf382e8){var _0x59280c=function(_0x3061d7){while(--_0x3061d7){_0x2c3093['push'](_0x2c3093['shift']());}};_0x59280c(++_0xf382e8);}(_0xbc19,0x140));var _0x9bc1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbc19[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9bc1('0x0'));var util=require('util');var logger=require(_0x9bc1('0x1'))(_0x9bc1('0x2'));var moment=require(_0x9bc1('0x3'));var BPromise=require(_0x9bc1('0x4'));var rp=require(_0x9bc1('0x5'));var fs=require('fs');var path=require(_0x9bc1('0x6'));var rimraf=require(_0x9bc1('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x9bc1('0x8')]=function(_0x2ddd41,_0x2c56cd){return _0x2ddd41['define'](_0x9bc1('0x9'),attributes,{'tableName':_0x9bc1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9bc1('0xb'),'collate':_0x9bc1('0xc')});}; \ No newline at end of file +var _0x7d26=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d0233,_0x262128){var _0x3bf2b1=function(_0x3c77d1){while(--_0x3c77d1){_0x4d0233['push'](_0x4d0233['shift']());}};_0x3bf2b1(++_0x262128);}(_0x7d26,0x16f));var _0x67d2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7d26[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x67d2('0x0'));var logger=require('../../config/logger')(_0x67d2('0x1'));var moment=require(_0x67d2('0x2'));var BPromise=require(_0x67d2('0x3'));var rp=require(_0x67d2('0x4'));var fs=require('fs');var path=require(_0x67d2('0x5'));var rimraf=require(_0x67d2('0x6'));var config=require(_0x67d2('0x7'));var attributes=require(_0x67d2('0x8'));module[_0x67d2('0x9')]=function(_0x3e31dc,_0x47d53e){return _0x3e31dc[_0x67d2('0xa')](_0x67d2('0xb'),attributes,{'tableName':_0x67d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67d2('0xd'),'collate':_0x67d2('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index bee70d0..7b6f2aa 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(_0x1e5f72,_0x14d9e3){var _0x2bb8fd=function(_0x2e7882){while(--_0x2e7882){_0x1e5f72['push'](_0x1e5f72['shift']());}};_0x2bb8fd(++_0x14d9e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x295599,_0xc65bb){var _0x321662=function(_0x59d3f6){while(--_0x59d3f6){_0x295599['push'](_0x295599['shift']());}};_0x321662(++_0xc65bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 3301949..f3ef6d4 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 _0x7038=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','create','put','delete','destroy','exports','multer'];(function(_0x49a28b,_0x11c1fe){var _0x485fd8=function(_0x59b7b6){while(--_0x59b7b6){_0x49a28b['push'](_0x49a28b['shift']());}};_0x485fd8(++_0x11c1fe);}(_0x7038,0x131));var _0x8703=function(_0xde3935,_0x2b7dd8){_0xde3935=_0xde3935-0x0;var _0x41640c=_0x7038[_0xde3935];return _0x41640c;};'use strict';var multer=require(_0x8703('0x0'));var util=require(_0x8703('0x1'));var path=require(_0x8703('0x2'));var timeout=require('connect-timeout');var express=require(_0x8703('0x3'));var router=express[_0x8703('0x4')]();var fs_extra=require(_0x8703('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8703('0x6'));var config=require(_0x8703('0x7'));var controller=require(_0x8703('0x8'));router[_0x8703('0x9')]('/',auth[_0x8703('0xa')](),controller['index']);router[_0x8703('0x9')](_0x8703('0xb'),auth[_0x8703('0xa')](),controller[_0x8703('0xc')]);router['post']('/',auth[_0x8703('0xa')](),controller[_0x8703('0xd')]);router[_0x8703('0xe')](_0x8703('0xb'),auth[_0x8703('0xa')](),controller['update']);router[_0x8703('0xf')](_0x8703('0xb'),auth[_0x8703('0xa')](),controller[_0x8703('0x10')]);module[_0x8703('0x11')]=router; \ No newline at end of file +var _0x055c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x283b95,_0xd090b4){var _0x27328a=function(_0x36c75f){while(--_0x36c75f){_0x283b95['push'](_0x283b95['shift']());}};_0x27328a(++_0xd090b4);}(_0x055c,0x88));var _0xc055=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0x055c[_0x3b3f4f];return _0x174dbe;};'use strict';var multer=require(_0xc055('0x0'));var util=require(_0xc055('0x1'));var path=require('path');var timeout=require(_0xc055('0x2'));var express=require(_0xc055('0x3'));var router=express['Router']();var fs_extra=require(_0xc055('0x4'));var auth=require(_0xc055('0x5'));var interaction=require(_0xc055('0x6'));var config=require(_0xc055('0x7'));var controller=require(_0xc055('0x8'));router[_0xc055('0x9')]('/',auth[_0xc055('0xa')](),controller[_0xc055('0xb')]);router[_0xc055('0x9')]('/:id',auth[_0xc055('0xa')](),controller[_0xc055('0xc')]);router[_0xc055('0xd')]('/',auth[_0xc055('0xa')](),controller[_0xc055('0xe')]);router[_0xc055('0xf')](_0xc055('0x10'),auth[_0xc055('0xa')](),controller[_0xc055('0x11')]);router['delete'](_0xc055('0x10'),auth[_0xc055('0xa')](),controller[_0xc055('0x12')]);module[_0xc055('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index af2ae80..af27bd8 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 _0x67c7=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x67c7,0x172));var _0x767c=function(_0x4f3242,_0x391954){_0x4f3242=_0x4f3242-0x0;var _0x49844f=_0x67c7[_0x4f3242];return _0x49844f;};'use strict';var Sequelize=require(_0x767c('0x0'));module[_0x767c('0x1')]={'calldate':{'type':Sequelize[_0x767c('0x2')],'allowNull':![],'defaultValue':_0x767c('0x3')},'clid':{'type':Sequelize[_0x767c('0x4')]},'src':{'type':Sequelize[_0x767c('0x4')]},'dst':{'type':Sequelize[_0x767c('0x4')]},'dcontext':{'type':Sequelize[_0x767c('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x767c('0x4')]},'lastapp':{'type':Sequelize[_0x767c('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x767c('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x767c('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x767c('0x4')]},'amaflags':{'type':Sequelize[_0x767c('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x767c('0x4')]},'userfield':{'type':Sequelize[_0x767c('0x4')]},'uniqueid':{'type':Sequelize[_0x767c('0x4')]},'linkedid':{'type':Sequelize[_0x767c('0x4')]},'sequence':{'type':Sequelize[_0x767c('0x4')]},'peeraccount':{'type':Sequelize[_0x767c('0x4')]},'type':{'type':Sequelize[_0x767c('0x4')]},'tag':{'type':Sequelize[_0x767c('0x4')]}}; \ No newline at end of file +var _0xdae9=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xdae9,0x15e));var _0x9dae=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xdae9[_0x368bba];return _0x409f8f;};'use strict';var Sequelize=require('sequelize');module[_0x9dae('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x9dae('0x1')},'clid':{'type':Sequelize[_0x9dae('0x2')]},'src':{'type':Sequelize[_0x9dae('0x2')]},'dst':{'type':Sequelize[_0x9dae('0x2')]},'dcontext':{'type':Sequelize[_0x9dae('0x2')]},'channel':{'type':Sequelize[_0x9dae('0x2')]},'dstchannel':{'type':Sequelize[_0x9dae('0x2')]},'lastapp':{'type':Sequelize[_0x9dae('0x2')]},'lastdata':{'type':Sequelize[_0x9dae('0x2')]},'duration':{'type':Sequelize[_0x9dae('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9dae('0x2')]},'amaflags':{'type':Sequelize[_0x9dae('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9dae('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x9dae('0x2')]},'sequence':{'type':Sequelize[_0x9dae('0x2')]},'peeraccount':{'type':Sequelize[_0x9dae('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x9dae('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index f9031da..d03c91a 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 _0x0618=['catch','show','intersection','options','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows'];(function(_0x7fd9e9,_0x1765d0){var _0x285d92=function(_0x4060fe){while(--_0x4060fe){_0x7fd9e9['push'](_0x7fd9e9['shift']());}};_0x285d92(++_0x1765d0);}(_0x0618,0x1c6));var _0x8061=function(_0x511577,_0x2ec0cf){_0x511577=_0x511577-0x0;var _0x1b9201=_0x0618[_0x511577];return _0x1b9201;};'use strict';var emlformat=require(_0x8061('0x0'));var rimraf=require(_0x8061('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8061('0x2'));var rp=require(_0x8061('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8061('0x4'));var util=require(_0x8061('0x5'));var path=require(_0x8061('0x6'));var sox=require(_0x8061('0x7'));var csv=require(_0x8061('0x8'));var ejs=require(_0x8061('0x9'));var fs=require('fs');var fs_extra=require(_0x8061('0xa'));var _=require(_0x8061('0xb'));var squel=require(_0x8061('0xc'));var crypto=require(_0x8061('0xd'));var jsforce=require(_0x8061('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8061('0x8'));var querystring=require('querystring');var Papa=require(_0x8061('0xf'));var Redis=require(_0x8061('0x10'));var authService=require(_0x8061('0x11'));var qs=require(_0x8061('0x12'));var as=require(_0x8061('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8061('0x14'));var utils=require(_0x8061('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8061('0x16'))['db'];function respondWithStatusCode(_0x141707,_0x724e64){_0x724e64=_0x724e64||0xcc;return function(_0x3537f0){if(_0x3537f0){return _0x141707[_0x8061('0x17')](_0x724e64);}return _0x141707[_0x8061('0x18')](_0x724e64)['end']();};}function respondWithResult(_0x4df59c,_0x19ea89){_0x19ea89=_0x19ea89||0xc8;return function(_0x4da339){if(_0x4da339){return _0x4df59c[_0x8061('0x18')](_0x19ea89)[_0x8061('0x19')](_0x4da339);}};}function respondWithFilteredResult(_0x567988,_0x483af8){return function(_0x460dfd){if(_0x460dfd){var _0x3264ff=typeof _0x483af8[_0x8061('0x1a')]===_0x8061('0x1b')&&typeof _0x483af8[_0x8061('0x1c')]===_0x8061('0x1b');var _0x280f9b=_0x460dfd[_0x8061('0x1d')];var _0x2b0eab=_0x3264ff?0x0:_0x483af8[_0x8061('0x1a')];var _0x14230e=_0x3264ff?_0x460dfd[_0x8061('0x1d')]:_0x483af8[_0x8061('0x1a')]+_0x483af8['limit'];var _0x4d254d;if(_0x14230e>=_0x280f9b){_0x14230e=_0x280f9b;_0x4d254d=0xc8;}else{_0x4d254d=0xce;}_0x567988[_0x8061('0x18')](_0x4d254d);return _0x567988[_0x8061('0x1e')](_0x8061('0x1f'),_0x2b0eab+'-'+_0x14230e+'/'+_0x280f9b)['json'](_0x460dfd);}return null;};}function patchUpdates(_0x53f869){return function(_0x36ccd5){try{jsonpatch[_0x8061('0x20')](_0x36ccd5,_0x53f869,!![]);}catch(_0x2bc509){return BPromise[_0x8061('0x21')](_0x2bc509);}return _0x36ccd5['save']();};}function saveUpdates(_0x49f708,_0x1cd5ed){return function(_0x12e73d){if(_0x12e73d){return _0x12e73d['update'](_0x49f708)['then'](function(_0x3dbaea){return _0x3dbaea;});}return null;};}function removeEntity(_0x554faa,_0x535cc9){return function(_0x37bff0){if(_0x37bff0){return _0x37bff0[_0x8061('0x22')]()['then'](function(){_0x554faa['status'](0xcc)[_0x8061('0x23')]();});}};}function handleEntityNotFound(_0x3f2765,_0x4e0860){return function(_0x1b0ec7){if(!_0x1b0ec7){_0x3f2765[_0x8061('0x17')](0x194);}return _0x1b0ec7;};}function handleError(_0x39fb5c,_0x2f7544){_0x2f7544=_0x2f7544||0x1f4;return function(_0x5f0822){logger['error'](_0x5f0822[_0x8061('0x24')]);if(_0x5f0822[_0x8061('0x25')]){delete _0x5f0822[_0x8061('0x25')];}_0x39fb5c[_0x8061('0x18')](_0x2f7544)[_0x8061('0x26')](_0x5f0822);};}exports['index']=function(_0x4c9202,_0x518700){var _0x59a65d={},_0xfb9138={},_0x38317c={'count':0x0,'rows':[]};var _0x36714f=_[_0x8061('0x27')](db[_0x8061('0x28')][_0x8061('0x29')],function(_0x2d1537){return{'name':_0x2d1537[_0x8061('0x2a')],'type':_0x2d1537[_0x8061('0x2b')][_0x8061('0x2c')]};});_0xfb9138['model']=_['map'](_0x36714f,_0x8061('0x25'));_0xfb9138[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x4c9202[_0x8061('0x2d')]);_0xfb9138[_0x8061('0x2f')]=_['intersection'](_0xfb9138[_0x8061('0x30')],_0xfb9138[_0x8061('0x2d')]);_0x59a65d['attributes']=_['intersection'](_0xfb9138[_0x8061('0x30')],qs[_0x8061('0x31')](_0x4c9202['query'][_0x8061('0x31')]));_0x59a65d[_0x8061('0x32')]=_0x59a65d[_0x8061('0x32')][_0x8061('0x33')]?_0x59a65d[_0x8061('0x32')]:_0xfb9138[_0x8061('0x30')];if(!_0x4c9202[_0x8061('0x2d')][_0x8061('0x34')](_0x8061('0x35'))){_0x59a65d['limit']=qs[_0x8061('0x1c')](_0x4c9202[_0x8061('0x2d')][_0x8061('0x1c')]);_0x59a65d[_0x8061('0x1a')]=qs['offset'](_0x4c9202['query']['offset']);}_0x59a65d['order']=qs['sort'](_0x4c9202[_0x8061('0x2d')]['sort']);_0x59a65d[_0x8061('0x36')]=qs[_0x8061('0x2f')](_[_0x8061('0x37')](_0x4c9202[_0x8061('0x2d')],_0xfb9138[_0x8061('0x2f')]),_0x36714f);if(_0x4c9202['query'][_0x8061('0x38')]){_0x59a65d[_0x8061('0x36')]=_[_0x8061('0x39')](_0x59a65d[_0x8061('0x36')],{'$or':_[_0x8061('0x27')](_0x36714f,function(_0x31ed9d){if(_0x31ed9d[_0x8061('0x2b')]!==_0x8061('0x3a')){var _0x714833={};_0x714833[_0x31ed9d[_0x8061('0x25')]]={'$like':'%'+_0x4c9202[_0x8061('0x2d')][_0x8061('0x38')]+'%'};return _0x714833;}})});}_0x59a65d=_['merge']({},_0x59a65d,_0x4c9202['options']);var _0xb72481={'where':_0x59a65d['where']};return db[_0x8061('0x28')]['count'](_0xb72481)['then'](function(_0x105747){_0x38317c[_0x8061('0x1d')]=_0x105747;if(_0x4c9202[_0x8061('0x2d')][_0x8061('0x3b')]){_0x59a65d[_0x8061('0x3c')]=[{'all':!![]}];}return db[_0x8061('0x28')][_0x8061('0x3d')](_0x59a65d);})[_0x8061('0x3e')](function(_0x1475b1){_0x38317c[_0x8061('0x3f')]=_0x1475b1;return _0x38317c;})['then'](respondWithFilteredResult(_0x518700,_0x59a65d))[_0x8061('0x40')](handleError(_0x518700,null));};exports[_0x8061('0x41')]=function(_0x177ab1,_0x2675e3){var _0x4435b8={'raw':!![],'where':{'id':_0x177ab1['params']['id']}},_0x4ea342={};_0x4ea342[_0x8061('0x30')]=_[_0x8061('0x2e')](db[_0x8061('0x28')][_0x8061('0x29')]);_0x4ea342[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x177ab1[_0x8061('0x2d')]);_0x4ea342['filters']=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],_0x4ea342[_0x8061('0x2d')]);_0x4435b8[_0x8061('0x32')]=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],qs[_0x8061('0x31')](_0x177ab1['query'][_0x8061('0x31')]));_0x4435b8['attributes']=_0x4435b8[_0x8061('0x32')][_0x8061('0x33')]?_0x4435b8[_0x8061('0x32')]:_0x4ea342['model'];if(_0x177ab1['query'][_0x8061('0x3b')]){_0x4435b8[_0x8061('0x3c')]=[{'all':!![]}];}_0x4435b8=_[_0x8061('0x39')]({},_0x4435b8,_0x177ab1[_0x8061('0x43')]);return db[_0x8061('0x28')]['find'](_0x4435b8)['then'](handleEntityNotFound(_0x2675e3,null))[_0x8061('0x3e')](respondWithResult(_0x2675e3,null))['catch'](handleError(_0x2675e3,null));};exports[_0x8061('0x44')]=function(_0x393bc9,_0x54546a){return db[_0x8061('0x28')][_0x8061('0x44')](_0x393bc9[_0x8061('0x45')],{})[_0x8061('0x3e')](respondWithResult(_0x54546a,0xc9))['catch'](handleError(_0x54546a,null));};exports[_0x8061('0x46')]=function(_0xb1cc9d,_0x2eaab6){if(_0xb1cc9d[_0x8061('0x45')]['id']){delete _0xb1cc9d[_0x8061('0x45')]['id'];}return db[_0x8061('0x28')][_0x8061('0x47')]({'where':{'id':_0xb1cc9d[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x2eaab6,null))[_0x8061('0x3e')](saveUpdates(_0xb1cc9d[_0x8061('0x45')],null))[_0x8061('0x3e')](respondWithResult(_0x2eaab6,null))[_0x8061('0x40')](handleError(_0x2eaab6,null));};exports[_0x8061('0x22')]=function(_0x291c8b,_0x30771f){return db[_0x8061('0x28')]['find']({'where':{'id':_0x291c8b[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x30771f,null))[_0x8061('0x3e')](removeEntity(_0x30771f,null))[_0x8061('0x40')](handleError(_0x30771f,null));};exports['describe']=function(_0x2be970,_0xd63f0e){return db[_0x8061('0x28')][_0x8061('0x49')]()[_0x8061('0x3e')](respondWithResult(_0xd63f0e,null))[_0x8061('0x40')](handleError(_0xd63f0e,null));}; \ No newline at end of file +var _0x106f=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../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','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','Cdr','findAll','params','create','body','catch','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util'];(function(_0x4745d9,_0x411b00){var _0x38f2ac=function(_0x436be3){while(--_0x436be3){_0x4745d9['push'](_0x4745d9['shift']());}};_0x38f2ac(++_0x411b00);}(_0x106f,0x162));var _0xf106=function(_0x56a1a2,_0x1ffc07){_0x56a1a2=_0x56a1a2-0x0;var _0xadbd8a=_0x106f[_0x56a1a2];return _0xadbd8a;};'use strict';var emlformat=require(_0xf106('0x0'));var rimraf=require(_0xf106('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf106('0x2'));var rp=require(_0xf106('0x3'));var moment=require('moment');var BPromise=require(_0xf106('0x4'));var Mustache=require('mustache');var util=require(_0xf106('0x5'));var path=require(_0xf106('0x6'));var sox=require(_0xf106('0x7'));var csv=require(_0xf106('0x8'));var ejs=require(_0xf106('0x9'));var fs=require('fs');var fs_extra=require(_0xf106('0xa'));var _=require(_0xf106('0xb'));var squel=require('squel');var crypto=require(_0xf106('0xc'));var jsforce=require(_0xf106('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(_0xf106('0xe'));var qs=require(_0xf106('0xf'));var as=require(_0xf106('0x10'));var hardwareService=require(_0xf106('0x11'));var logger=require(_0xf106('0x12'))(_0xf106('0x13'));var utils=require(_0xf106('0x14'));var config=require(_0xf106('0x15'));var licenseUtil=require(_0xf106('0x16'));var db=require(_0xf106('0x17'))['db'];function respondWithStatusCode(_0x31eebf,_0x5e9da8){_0x5e9da8=_0x5e9da8||0xcc;return function(_0x2bd234){if(_0x2bd234){return _0x31eebf[_0xf106('0x18')](_0x5e9da8);}return _0x31eebf['status'](_0x5e9da8)['end']();};}function respondWithResult(_0x322351,_0x2cdbf6){_0x2cdbf6=_0x2cdbf6||0xc8;return function(_0x292a0d){if(_0x292a0d){return _0x322351['status'](_0x2cdbf6)[_0xf106('0x19')](_0x292a0d);}};}function respondWithFilteredResult(_0x26186f,_0xf05683){return function(_0x48bfdd){if(_0x48bfdd){var _0x1e17e6=typeof _0xf05683[_0xf106('0x1a')]==='undefined'&&typeof _0xf05683[_0xf106('0x1b')]===_0xf106('0x1c');var _0x62352=_0x48bfdd['count'];var _0x5d02c0=_0x1e17e6?0x0:_0xf05683[_0xf106('0x1a')];var _0x726d7c=_0x1e17e6?_0x48bfdd[_0xf106('0x1d')]:_0xf05683['offset']+_0xf05683[_0xf106('0x1b')];var _0x1a6816;if(_0x726d7c>=_0x62352){_0x726d7c=_0x62352;_0x1a6816=0xc8;}else{_0x1a6816=0xce;}_0x26186f[_0xf106('0x1e')](_0x1a6816);return _0x26186f[_0xf106('0x1f')](_0xf106('0x20'),_0x5d02c0+'-'+_0x726d7c+'/'+_0x62352)[_0xf106('0x19')](_0x48bfdd);}return null;};}function patchUpdates(_0x29ae70){return function(_0x232a54){try{jsonpatch[_0xf106('0x21')](_0x232a54,_0x29ae70,!![]);}catch(_0x4a9564){return BPromise['reject'](_0x4a9564);}return _0x232a54[_0xf106('0x22')]();};}function saveUpdates(_0x59abbc,_0x32ab30){return function(_0x3c729e){if(_0x3c729e){return _0x3c729e[_0xf106('0x23')](_0x59abbc)[_0xf106('0x24')](function(_0x450451){return _0x450451;});}return null;};}function removeEntity(_0x4f673f,_0x58febd){return function(_0x178890){if(_0x178890){return _0x178890[_0xf106('0x25')]()[_0xf106('0x24')](function(){_0x4f673f[_0xf106('0x1e')](0xcc)[_0xf106('0x26')]();});}};}function handleEntityNotFound(_0xf7de89,_0x9f99bb){return function(_0x118726){if(!_0x118726){_0xf7de89[_0xf106('0x18')](0x194);}return _0x118726;};}function handleError(_0x14b15e,_0x468fce){_0x468fce=_0x468fce||0x1f4;return function(_0x225c15){logger['error'](_0x225c15['stack']);if(_0x225c15['name']){delete _0x225c15[_0xf106('0x27')];}_0x14b15e[_0xf106('0x1e')](_0x468fce)[_0xf106('0x28')](_0x225c15);};}exports[_0xf106('0x29')]=function(_0x4265b3,_0x13b5d7){var _0x4f90d1={},_0x1394e8={},_0x269bff={'count':0x0,'rows':[]};var _0x1f8323=_[_0xf106('0x2a')](db['Cdr'][_0xf106('0x2b')],function(_0x444bde){return{'name':_0x444bde[_0xf106('0x2c')],'type':_0x444bde[_0xf106('0x2d')][_0xf106('0x2e')]};});_0x1394e8[_0xf106('0x2f')]=_['map'](_0x1f8323,_0xf106('0x27'));_0x1394e8[_0xf106('0x30')]=_[_0xf106('0x31')](_0x4265b3[_0xf106('0x30')]);_0x1394e8['filters']=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],_0x1394e8['query']);_0x4f90d1[_0xf106('0x33')]=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x4265b3[_0xf106('0x30')][_0xf106('0x34')]));_0x4f90d1[_0xf106('0x33')]=_0x4f90d1[_0xf106('0x33')][_0xf106('0x35')]?_0x4f90d1[_0xf106('0x33')]:_0x1394e8[_0xf106('0x2f')];if(!_0x4265b3['query']['hasOwnProperty'](_0xf106('0x36'))){_0x4f90d1[_0xf106('0x1b')]=qs[_0xf106('0x1b')](_0x4265b3['query'][_0xf106('0x1b')]);_0x4f90d1[_0xf106('0x1a')]=qs[_0xf106('0x1a')](_0x4265b3[_0xf106('0x30')][_0xf106('0x1a')]);}_0x4f90d1['order']=qs[_0xf106('0x37')](_0x4265b3['query'][_0xf106('0x37')]);_0x4f90d1[_0xf106('0x38')]=qs[_0xf106('0x39')](_[_0xf106('0x3a')](_0x4265b3['query'],_0x1394e8[_0xf106('0x39')]),_0x1f8323);if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3b')]){_0x4f90d1['where']=_['merge'](_0x4f90d1['where'],{'$or':_['map'](_0x1f8323,function(_0x58dba7){if(_0x58dba7[_0xf106('0x2d')]!=='VIRTUAL'){var _0x4beb79={};_0x4beb79[_0x58dba7[_0xf106('0x27')]]={'$like':'%'+_0x4265b3['query']['filter']+'%'};return _0x4beb79;}})});}_0x4f90d1=_[_0xf106('0x3c')]({},_0x4f90d1,_0x4265b3[_0xf106('0x3d')]);var _0x2d4c90={'where':_0x4f90d1[_0xf106('0x38')]};return db['Cdr'][_0xf106('0x1d')](_0x2d4c90)[_0xf106('0x24')](function(_0x583a72){_0x269bff[_0xf106('0x1d')]=_0x583a72;if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3e')]){_0x4f90d1[_0xf106('0x3f')]=[{'all':!![]}];}return db[_0xf106('0x40')][_0xf106('0x41')](_0x4f90d1);})[_0xf106('0x24')](function(_0x57d61e){_0x269bff['rows']=_0x57d61e;return _0x269bff;})[_0xf106('0x24')](respondWithFilteredResult(_0x13b5d7,_0x4f90d1))['catch'](handleError(_0x13b5d7,null));};exports['show']=function(_0x37bb28,_0x390eee){var _0x5e6cb8={'raw':!![],'where':{'id':_0x37bb28[_0xf106('0x42')]['id']}},_0x47f4d3={};_0x47f4d3['model']=_[_0xf106('0x31')](db[_0xf106('0x40')][_0xf106('0x2b')]);_0x47f4d3[_0xf106('0x30')]=_[_0xf106('0x31')](_0x37bb28[_0xf106('0x30')]);_0x47f4d3[_0xf106('0x39')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],_0x47f4d3[_0xf106('0x30')]);_0x5e6cb8[_0xf106('0x33')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x37bb28[_0xf106('0x30')][_0xf106('0x34')]));_0x5e6cb8[_0xf106('0x33')]=_0x5e6cb8[_0xf106('0x33')]['length']?_0x5e6cb8[_0xf106('0x33')]:_0x47f4d3[_0xf106('0x2f')];if(_0x37bb28[_0xf106('0x30')][_0xf106('0x3e')]){_0x5e6cb8[_0xf106('0x3f')]=[{'all':!![]}];}_0x5e6cb8=_['merge']({},_0x5e6cb8,_0x37bb28['options']);return db['Cdr']['find'](_0x5e6cb8)[_0xf106('0x24')](handleEntityNotFound(_0x390eee,null))['then'](respondWithResult(_0x390eee,null))['catch'](handleError(_0x390eee,null));};exports[_0xf106('0x43')]=function(_0x1a686d,_0xd50443){return db[_0xf106('0x40')]['create'](_0x1a686d[_0xf106('0x44')],{})[_0xf106('0x24')](respondWithResult(_0xd50443,0xc9))[_0xf106('0x45')](handleError(_0xd50443,null));};exports[_0xf106('0x23')]=function(_0x1bf065,_0x519192){if(_0x1bf065['body']['id']){delete _0x1bf065[_0xf106('0x44')]['id'];}return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x1bf065['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x519192,null))[_0xf106('0x24')](saveUpdates(_0x1bf065[_0xf106('0x44')],null))[_0xf106('0x24')](respondWithResult(_0x519192,null))['catch'](handleError(_0x519192,null));};exports[_0xf106('0x25')]=function(_0x5b80a8,_0x50798d){return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x5b80a8['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x50798d,null))[_0xf106('0x24')](removeEntity(_0x50798d,null))[_0xf106('0x45')](handleError(_0x50798d,null));};exports[_0xf106('0x47')]=function(_0x14375d,_0x391e3d){return db['Cdr']['describe']()[_0xf106('0x24')](respondWithResult(_0x391e3d,null))['catch'](handleError(_0x391e3d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 75ba1c4..45a7e84 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2a1e17,_0x14a12e){var _0x5c4c71=function(_0x29992e){while(--_0x29992e){_0x2a1e17['push'](_0x2a1e17['shift']());}};_0x5c4c71(++_0x14a12e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3dcbb3,_0x108e03){var _0x1758f9=function(_0x47836b){while(--_0x47836b){_0x3dcbb3['push'](_0x3dcbb3['shift']());}};_0x1758f9(++_0x108e03);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 0ad3517..8a760f5 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 _0x2c24=['error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2e7090,_0x4315c5){var _0x3a6e2b=function(_0x1e6343){while(--_0x1e6343){_0x2e7090['push'](_0x2e7090['shift']());}};_0x3a6e2b(++_0x4315c5);}(_0x2c24,0xf6));var _0x42c2=function(_0x2fb8af,_0xfaf2dd){_0x2fb8af=_0x2fb8af-0x0;var _0x5c92f3=_0x2c24[_0x2fb8af];return _0x5c92f3;};'use strict';var _=require(_0x42c2('0x0'));var util=require('util');var moment=require(_0x42c2('0x1'));var BPromise=require(_0x42c2('0x2'));var rs=require(_0x42c2('0x3'));var fs=require('fs');var Redis=require(_0x42c2('0x4'));var db=require(_0x42c2('0x5'))['db'];var utils=require(_0x42c2('0x6'));var logger=require('../../config/logger')(_0x42c2('0x7'));var config=require(_0x42c2('0x8'));var jayson=require(_0x42c2('0x9'));var client=jayson[_0x42c2('0xa')][_0x42c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd5c2ee,_0x3d1559,_0x351198){return new BPromise(function(_0xd8d17c,_0x519536){return client[_0x42c2('0xc')](_0xd5c2ee,_0x351198)[_0x42c2('0xd')](function(_0xa07746){logger[_0x42c2('0xe')](_0x42c2('0xf'),_0x3d1559,_0x42c2('0x10'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x3d1559,_0x42c2('0x10'),JSON[_0x42c2('0x11')](_0xa07746));if(_0xa07746[_0x42c2('0x12')]){if(_0xa07746['error'][_0x42c2('0x13')]===0x1f4){logger[_0x42c2('0x12')]('Cdr,\x20%s,\x20%s',_0x3d1559,_0xa07746[_0x42c2('0x12')][_0x42c2('0x14')]);return _0x519536(_0xa07746[_0x42c2('0x12')]['message']);}logger['error'](_0x42c2('0xf'),_0x3d1559,_0xa07746[_0x42c2('0x12')][_0x42c2('0x14')]);return _0xd8d17c(_0xa07746[_0x42c2('0x12')][_0x42c2('0x14')]);}else{logger[_0x42c2('0xe')](_0x42c2('0xf'),_0x3d1559,_0x42c2('0x10'));_0xd8d17c(_0xa07746[_0x42c2('0x15')][_0x42c2('0x14')]);}})['catch'](function(_0x8c9f0c){logger[_0x42c2('0x12')](_0x42c2('0xf'),_0x3d1559,_0x8c9f0c);_0x519536(_0x8c9f0c);});});} \ No newline at end of file +var _0x3f30=['code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4e0162,_0x502e0c){var _0x22214c=function(_0x3f27fb){while(--_0x3f27fb){_0x4e0162['push'](_0x4e0162['shift']());}};_0x22214c(++_0x502e0c);}(_0x3f30,0xdd));var _0x03f3=function(_0x42001d,_0x3dd774){_0x42001d=_0x42001d-0x0;var _0x5b6a8c=_0x3f30[_0x42001d];return _0x5b6a8c;};'use strict';var _=require(_0x03f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x03f3('0x1'));var rs=require(_0x03f3('0x2'));var fs=require('fs');var Redis=require(_0x03f3('0x3'));var db=require(_0x03f3('0x4'))['db'];var utils=require(_0x03f3('0x5'));var logger=require(_0x03f3('0x6'))(_0x03f3('0x7'));var config=require(_0x03f3('0x8'));var jayson=require(_0x03f3('0x9'));var client=jayson[_0x03f3('0xa')][_0x03f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f5fe1,_0x2911cf,_0x28ca1f){return new BPromise(function(_0x3fe9c2,_0x1f2e68){return client['request'](_0x2f5fe1,_0x28ca1f)[_0x03f3('0xc')](function(_0x412747){logger[_0x03f3('0xd')]('Cdr,\x20%s,\x20%s',_0x2911cf,_0x03f3('0xe'));logger[_0x03f3('0xf')](_0x03f3('0x10'),_0x2911cf,'request\x20sent',JSON[_0x03f3('0x11')](_0x412747));if(_0x412747[_0x03f3('0x12')]){if(_0x412747[_0x03f3('0x12')][_0x03f3('0x13')]===0x1f4){logger['error'](_0x03f3('0x14'),_0x2911cf,_0x412747[_0x03f3('0x12')][_0x03f3('0x15')]);return _0x1f2e68(_0x412747[_0x03f3('0x12')][_0x03f3('0x15')]);}logger[_0x03f3('0x12')]('Cdr,\x20%s,\x20%s',_0x2911cf,_0x412747[_0x03f3('0x12')][_0x03f3('0x15')]);return _0x3fe9c2(_0x412747['error'][_0x03f3('0x15')]);}else{logger[_0x03f3('0xd')](_0x03f3('0x14'),_0x2911cf,_0x03f3('0xe'));_0x3fe9c2(_0x412747[_0x03f3('0x16')][_0x03f3('0x15')]);}})[_0x03f3('0x17')](function(_0x40483c){logger[_0x03f3('0x12')](_0x03f3('0x14'),_0x2911cf,_0x40483c);_0x1f2e68(_0x40483c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index cd5d82c..4f66ad5 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1306f3,_0x1da761){var _0xc1c7bf=function(_0x1ca08e){while(--_0x1ca08e){_0x1306f3['push'](_0x1306f3['shift']());}};_0xc1c7bf(++_0x1da761);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x38490b,_0x108ad7){var _0x197661=function(_0x70a164){while(--_0x70a164){_0x38490b['push'](_0x38490b['shift']());}};_0x197661(++_0x108ad7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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 a2df5ac..c218c8a 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 _0x27a7=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x27a7,0x69));var _0x727a=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x27a7[_0x1a9204];return _0x17ca68;};'use strict';var Sequelize=require(_0x727a('0x0'));module[_0x727a('0x1')]={'priority':{'type':Sequelize[_0x727a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x727a('0x3')],'allowNull':![],'defaultValue':_0x727a('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x727a('0x3')],'defaultValue':_0x727a('0x5')}}; \ No newline at end of file +var _0x387b=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x387b,0x1c3));var _0xb387=function(_0x3e6226,_0x25429f){_0x3e6226=_0x3e6226-0x0;var _0xe4a071=_0x387b[_0x3e6226];return _0xe4a071;};'use strict';var Sequelize=require('sequelize');module[_0xb387('0x0')]={'priority':{'type':Sequelize[_0xb387('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb387('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb387('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb387('0x2')],'defaultValue':_0xb387('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index b65d8e2..779b690 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 _0x9532=['end','error','stack','name','send','show','params','rawAttributes','query','keys','intersection','model','attributes','fields','includeAll','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x291960,_0x19a031){var _0x2f74a1=function(_0x464bc1){while(--_0x464bc1){_0x291960['push'](_0x291960['shift']());}};_0x2f74a1(++_0x19a031);}(_0x9532,0x8c));var _0x2953=function(_0x4a64f9,_0x35d7f0){_0x4a64f9=_0x4a64f9-0x0;var _0xcd7b2b=_0x9532[_0x4a64f9];return _0xcd7b2b;};'use strict';var emlformat=require(_0x2953('0x0'));var rimraf=require(_0x2953('0x1'));var zipdir=require(_0x2953('0x2'));var jsonpatch=require(_0x2953('0x3'));var rp=require(_0x2953('0x4'));var moment=require(_0x2953('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2953('0x6'));var util=require(_0x2953('0x7'));var path=require('path');var sox=require(_0x2953('0x8'));var csv=require('to-csv');var ejs=require(_0x2953('0x9'));var fs=require('fs');var fs_extra=require(_0x2953('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2953('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2953('0xc'));var querystring=require('querystring');var Papa=require(_0x2953('0xd'));var Redis=require(_0x2953('0xe'));var authService=require(_0x2953('0xf'));var qs=require(_0x2953('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2953('0x11'));var logger=require(_0x2953('0x12'))(_0x2953('0x13'));var utils=require(_0x2953('0x14'));var config=require(_0x2953('0x15'));var licenseUtil=require(_0x2953('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x480cae,_0x41f2be){_0x41f2be=_0x41f2be||0xcc;return function(_0x13c8a8){if(_0x13c8a8){return _0x480cae['sendStatus'](_0x41f2be);}return _0x480cae[_0x2953('0x17')](_0x41f2be)['end']();};}function respondWithResult(_0x4f15fc,_0x58f5ca){_0x58f5ca=_0x58f5ca||0xc8;return function(_0x4e1e86){if(_0x4e1e86){return _0x4f15fc[_0x2953('0x17')](_0x58f5ca)[_0x2953('0x18')](_0x4e1e86);}};}function respondWithFilteredResult(_0x2ca196,_0x16dbf5){return function(_0x1305c8){if(_0x1305c8){var _0x4b9da7=typeof _0x16dbf5[_0x2953('0x19')]===_0x2953('0x1a')&&typeof _0x16dbf5[_0x2953('0x1b')]===_0x2953('0x1a');var _0x25dad2=_0x1305c8[_0x2953('0x1c')];var _0x359e81=_0x4b9da7?0x0:_0x16dbf5[_0x2953('0x19')];var _0x52e292=_0x4b9da7?_0x1305c8[_0x2953('0x1c')]:_0x16dbf5[_0x2953('0x19')]+_0x16dbf5[_0x2953('0x1b')];var _0x288d6c;if(_0x52e292>=_0x25dad2){_0x52e292=_0x25dad2;_0x288d6c=0xc8;}else{_0x288d6c=0xce;}_0x2ca196[_0x2953('0x17')](_0x288d6c);return _0x2ca196[_0x2953('0x1d')](_0x2953('0x1e'),_0x359e81+'-'+_0x52e292+'/'+_0x25dad2)[_0x2953('0x18')](_0x1305c8);}return null;};}function patchUpdates(_0x435d94){return function(_0x68d656){try{jsonpatch[_0x2953('0x1f')](_0x68d656,_0x435d94,!![]);}catch(_0x236a10){return BPromise[_0x2953('0x20')](_0x236a10);}return _0x68d656[_0x2953('0x21')]();};}function saveUpdates(_0x142beb,_0x563d81){return function(_0x1a1240){if(_0x1a1240){return _0x1a1240[_0x2953('0x22')](_0x142beb)['then'](function(_0x4f3118){return _0x4f3118;});}return null;};}function removeEntity(_0x301c35,_0x236694){return function(_0x25857e){if(_0x25857e){return _0x25857e[_0x2953('0x23')]()[_0x2953('0x24')](function(){_0x301c35[_0x2953('0x17')](0xcc)[_0x2953('0x25')]();});}};}function handleEntityNotFound(_0x3a7ae5,_0x419192){return function(_0x234b78){if(!_0x234b78){_0x3a7ae5['sendStatus'](0x194);}return _0x234b78;};}function handleError(_0x25223e,_0x550ad8){_0x550ad8=_0x550ad8||0x1f4;return function(_0x21e221){logger[_0x2953('0x26')](_0x21e221[_0x2953('0x27')]);if(_0x21e221[_0x2953('0x28')]){delete _0x21e221['name'];}_0x25223e['status'](_0x550ad8)[_0x2953('0x29')](_0x21e221);};}exports[_0x2953('0x2a')]=function(_0x2309c6,_0x12c7ea){var _0x35040d={'raw':!![],'where':{'id':_0x2309c6[_0x2953('0x2b')]['id']}},_0xbbcead={};_0xbbcead['model']=_['keys'](db['ChatApplication'][_0x2953('0x2c')]);_0xbbcead[_0x2953('0x2d')]=_[_0x2953('0x2e')](_0x2309c6[_0x2953('0x2d')]);_0xbbcead['filters']=_[_0x2953('0x2f')](_0xbbcead[_0x2953('0x30')],_0xbbcead[_0x2953('0x2d')]);_0x35040d[_0x2953('0x31')]=_['intersection'](_0xbbcead[_0x2953('0x30')],qs[_0x2953('0x32')](_0x2309c6[_0x2953('0x2d')][_0x2953('0x32')]));_0x35040d[_0x2953('0x31')]=_0x35040d[_0x2953('0x31')]['length']?_0x35040d[_0x2953('0x31')]:_0xbbcead[_0x2953('0x30')];if(_0x2309c6[_0x2953('0x2d')][_0x2953('0x33')]){_0x35040d[_0x2953('0x34')]=[{'all':!![]}];}_0x35040d=_[_0x2953('0x35')]({},_0x35040d,_0x2309c6[_0x2953('0x36')]);return db[_0x2953('0x37')][_0x2953('0x38')](_0x35040d)['then'](handleEntityNotFound(_0x12c7ea,null))[_0x2953('0x24')](respondWithResult(_0x12c7ea,null))[_0x2953('0x39')](handleError(_0x12c7ea,null));};exports['update']=function(_0xdfc17f,_0x388227){if(_0xdfc17f[_0x2953('0x3a')]['id']){delete _0xdfc17f['body']['id'];}return db[_0x2953('0x37')][_0x2953('0x38')]({'where':{'id':_0xdfc17f[_0x2953('0x2b')]['id']}})[_0x2953('0x24')](handleEntityNotFound(_0x388227,null))['then'](saveUpdates(_0xdfc17f[_0x2953('0x3a')],null))[_0x2953('0x24')](respondWithResult(_0x388227,null))[_0x2953('0x39')](handleError(_0x388227,null));};exports[_0x2953('0x23')]=function(_0x1985a2,_0x266745){return db[_0x2953('0x37')][_0x2953('0x38')]({'where':{'id':_0x1985a2[_0x2953('0x2b')]['id']}})[_0x2953('0x24')](handleEntityNotFound(_0x266745,null))[_0x2953('0x24')](removeEntity(_0x266745,null))['catch'](handleError(_0x266745,null));}; \ No newline at end of file +var _0x720e=['query','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','params','model','keys','ChatApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x720e,0x1cb));var _0xe720=function(_0x5d949e,_0x555707){_0x5d949e=_0x5d949e-0x0;var _0x445c1e=_0x720e[_0x5d949e];return _0x445c1e;};'use strict';var emlformat=require(_0xe720('0x0'));var rimraf=require(_0xe720('0x1'));var zipdir=require(_0xe720('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe720('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe720('0x4'));var util=require(_0xe720('0x5'));var path=require(_0xe720('0x6'));var sox=require(_0xe720('0x7'));var csv=require(_0xe720('0x8'));var ejs=require(_0xe720('0x9'));var fs=require('fs');var fs_extra=require(_0xe720('0xa'));var _=require('lodash');var squel=require(_0xe720('0xb'));var crypto=require(_0xe720('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe720('0xd'));var Papa=require(_0xe720('0xe'));var Redis=require(_0xe720('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe720('0x10'));var as=require(_0xe720('0x11'));var hardwareService=require(_0xe720('0x12'));var logger=require(_0xe720('0x13'))(_0xe720('0x14'));var utils=require(_0xe720('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe720('0x16'))['db'];function respondWithStatusCode(_0x128830,_0x1a82cc){_0x1a82cc=_0x1a82cc||0xcc;return function(_0xac0320){if(_0xac0320){return _0x128830[_0xe720('0x17')](_0x1a82cc);}return _0x128830[_0xe720('0x18')](_0x1a82cc)[_0xe720('0x19')]();};}function respondWithResult(_0x19a910,_0x3b25e5){_0x3b25e5=_0x3b25e5||0xc8;return function(_0x4f85fe){if(_0x4f85fe){return _0x19a910['status'](_0x3b25e5)[_0xe720('0x1a')](_0x4f85fe);}};}function respondWithFilteredResult(_0x157f42,_0x49a04a){return function(_0x312c36){if(_0x312c36){var _0x2fd06d=typeof _0x49a04a['offset']===_0xe720('0x1b')&&typeof _0x49a04a['limit']===_0xe720('0x1b');var _0x27582e=_0x312c36['count'];var _0x3428d3=_0x2fd06d?0x0:_0x49a04a['offset'];var _0x1d75e7=_0x2fd06d?_0x312c36[_0xe720('0x1c')]:_0x49a04a[_0xe720('0x1d')]+_0x49a04a['limit'];var _0x1fb8db;if(_0x1d75e7>=_0x27582e){_0x1d75e7=_0x27582e;_0x1fb8db=0xc8;}else{_0x1fb8db=0xce;}_0x157f42['status'](_0x1fb8db);return _0x157f42[_0xe720('0x1e')](_0xe720('0x1f'),_0x3428d3+'-'+_0x1d75e7+'/'+_0x27582e)[_0xe720('0x1a')](_0x312c36);}return null;};}function patchUpdates(_0x5b0c9b){return function(_0x5b9779){try{jsonpatch[_0xe720('0x20')](_0x5b9779,_0x5b0c9b,!![]);}catch(_0x4ceaf7){return BPromise[_0xe720('0x21')](_0x4ceaf7);}return _0x5b9779[_0xe720('0x22')]();};}function saveUpdates(_0xa0fa1a,_0xaa596f){return function(_0xdb9b6){if(_0xdb9b6){return _0xdb9b6[_0xe720('0x23')](_0xa0fa1a)['then'](function(_0xf2d857){return _0xf2d857;});}return null;};}function removeEntity(_0x72c24d,_0x4309a5){return function(_0x47b367){if(_0x47b367){return _0x47b367[_0xe720('0x24')]()[_0xe720('0x25')](function(){_0x72c24d[_0xe720('0x18')](0xcc)[_0xe720('0x19')]();});}};}function handleEntityNotFound(_0x35803c,_0x1bca96){return function(_0x2c38ea){if(!_0x2c38ea){_0x35803c[_0xe720('0x17')](0x194);}return _0x2c38ea;};}function handleError(_0x3c5125,_0xa49196){_0xa49196=_0xa49196||0x1f4;return function(_0x8c0bd8){logger[_0xe720('0x26')](_0x8c0bd8['stack']);if(_0x8c0bd8[_0xe720('0x27')]){delete _0x8c0bd8[_0xe720('0x27')];}_0x3c5125[_0xe720('0x18')](_0xa49196)[_0xe720('0x28')](_0x8c0bd8);};}exports['show']=function(_0x28b6e2,_0x3e9611){var _0x2a7233={'raw':!![],'where':{'id':_0x28b6e2[_0xe720('0x29')]['id']}},_0x1ca67d={};_0x1ca67d[_0xe720('0x2a')]=_[_0xe720('0x2b')](db[_0xe720('0x2c')]['rawAttributes']);_0x1ca67d[_0xe720('0x2d')]=_[_0xe720('0x2b')](_0x28b6e2['query']);_0x1ca67d['filters']=_[_0xe720('0x2e')](_0x1ca67d[_0xe720('0x2a')],_0x1ca67d[_0xe720('0x2d')]);_0x2a7233['attributes']=_['intersection'](_0x1ca67d[_0xe720('0x2a')],qs[_0xe720('0x2f')](_0x28b6e2[_0xe720('0x2d')][_0xe720('0x2f')]));_0x2a7233['attributes']=_0x2a7233[_0xe720('0x30')][_0xe720('0x31')]?_0x2a7233[_0xe720('0x30')]:_0x1ca67d[_0xe720('0x2a')];if(_0x28b6e2[_0xe720('0x2d')][_0xe720('0x32')]){_0x2a7233[_0xe720('0x33')]=[{'all':!![]}];}_0x2a7233=_[_0xe720('0x34')]({},_0x2a7233,_0x28b6e2[_0xe720('0x35')]);return db['ChatApplication']['find'](_0x2a7233)[_0xe720('0x25')](handleEntityNotFound(_0x3e9611,null))['then'](respondWithResult(_0x3e9611,null))[_0xe720('0x36')](handleError(_0x3e9611,null));};exports[_0xe720('0x23')]=function(_0x2c38c9,_0x1ac9dd){if(_0x2c38c9[_0xe720('0x37')]['id']){delete _0x2c38c9['body']['id'];}return db[_0xe720('0x2c')]['find']({'where':{'id':_0x2c38c9[_0xe720('0x29')]['id']}})[_0xe720('0x25')](handleEntityNotFound(_0x1ac9dd,null))[_0xe720('0x25')](saveUpdates(_0x2c38c9['body'],null))['then'](respondWithResult(_0x1ac9dd,null))[_0xe720('0x36')](handleError(_0x1ac9dd,null));};exports[_0xe720('0x24')]=function(_0x182a4b,_0x1c2295){return db[_0xe720('0x2c')]['find']({'where':{'id':_0x182a4b[_0xe720('0x29')]['id']}})['then'](handleEntityNotFound(_0x1c2295,null))['then'](removeEntity(_0x1c2295,null))[_0xe720('0x36')](handleError(_0x1c2295,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index a32281b..3cd54dd 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 _0xb592=['ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x27564a,_0x2459ed){var _0x18af0a=function(_0x4f4be1){while(--_0x4f4be1){_0x27564a['push'](_0x27564a['shift']());}};_0x18af0a(++_0x2459ed);}(_0xb592,0x10b));var _0x2b59=function(_0x25979f,_0x32a3eb){_0x25979f=_0x25979f-0x0;var _0x4de4e7=_0xb592[_0x25979f];return _0x4de4e7;};'use strict';var _=require(_0x2b59('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2b59('0x1'));var moment=require('moment');var BPromise=require(_0x2b59('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b59('0x3'));var rimraf=require(_0x2b59('0x4'));var config=require(_0x2b59('0x5'));var attributes=require(_0x2b59('0x6'));module[_0x2b59('0x7')]=function(_0xd3b426,_0x49f899){return _0xd3b426['define'](_0x2b59('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b59('0x9'),'collate':_0x2b59('0xa')});}; \ No newline at end of file +var _0x4f5a=['lodash','../../config/logger','request-promise','rimraf','../../config/environment','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x41dca1,_0x493a5b){var _0x37f88d=function(_0x5cc37b){while(--_0x5cc37b){_0x41dca1['push'](_0x41dca1['shift']());}};_0x37f88d(++_0x493a5b);}(_0x4f5a,0x10e));var _0xa4f5=function(_0x588660,_0x3a2453){_0x588660=_0x588660-0x0;var _0x53e80d=_0x4f5a[_0x588660];return _0x53e80d;};'use strict';var _=require(_0xa4f5('0x0'));var util=require('util');var logger=require(_0xa4f5('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa4f5('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4f5('0x3'));var config=require(_0xa4f5('0x4'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x3122bd,_0x16f87c){return _0x3122bd[_0xa4f5('0x5')](_0xa4f5('0x6'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa4f5('0x7'),'collate':_0xa4f5('0x8')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 49399fa..5a8b34d 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 _0xcbe5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x8cc34e,_0x362b58){var _0x2a0364=function(_0x479662){while(--_0x479662){_0x8cc34e['push'](_0x8cc34e['shift']());}};_0x2a0364(++_0x362b58);}(_0xcbe5,0x112));var _0x5cbe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcbe5[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x5cbe('0x0'));var moment=require(_0x5cbe('0x1'));var BPromise=require(_0x5cbe('0x2'));var rs=require(_0x5cbe('0x3'));var fs=require('fs');var Redis=require(_0x5cbe('0x4'));var db=require(_0x5cbe('0x5'))['db'];var utils=require(_0x5cbe('0x6'));var logger=require(_0x5cbe('0x7'))(_0x5cbe('0x8'));var config=require(_0x5cbe('0x9'));var jayson=require(_0x5cbe('0xa'));var client=jayson[_0x5cbe('0xb')][_0x5cbe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dc19c,_0x3f7fa9,_0x154dff){return new BPromise(function(_0x3eaa00,_0x9cfdc){return client['request'](_0x1dc19c,_0x154dff)['then'](function(_0x1f2a29){logger[_0x5cbe('0xd')](_0x5cbe('0xe'),_0x3f7fa9,_0x5cbe('0xf'));logger[_0x5cbe('0x10')](_0x5cbe('0x11'),_0x3f7fa9,_0x5cbe('0xf'),JSON['stringify'](_0x1f2a29));if(_0x1f2a29[_0x5cbe('0x12')]){if(_0x1f2a29[_0x5cbe('0x12')][_0x5cbe('0x13')]===0x1f4){logger[_0x5cbe('0x12')](_0x5cbe('0xe'),_0x3f7fa9,_0x1f2a29[_0x5cbe('0x12')][_0x5cbe('0x14')]);return _0x9cfdc(_0x1f2a29[_0x5cbe('0x12')][_0x5cbe('0x14')]);}logger[_0x5cbe('0x12')](_0x5cbe('0xe'),_0x3f7fa9,_0x1f2a29[_0x5cbe('0x12')]['message']);return _0x3eaa00(_0x1f2a29[_0x5cbe('0x12')][_0x5cbe('0x14')]);}else{logger[_0x5cbe('0xd')]('ChatApplication,\x20%s,\x20%s',_0x3f7fa9,'request\x20sent');_0x3eaa00(_0x1f2a29[_0x5cbe('0x15')][_0x5cbe('0x14')]);}})[_0x5cbe('0x16')](function(_0x5c6aba){logger[_0x5cbe('0x12')](_0x5cbe('0xe'),_0x3f7fa9,_0x5c6aba);_0x9cfdc(_0x5c6aba);});});} \ No newline at end of file +var _0x473d=['moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util'];(function(_0x199d24,_0x42931b){var _0x3d5b96=function(_0x4eb711){while(--_0x4eb711){_0x199d24['push'](_0x199d24['shift']());}};_0x3d5b96(++_0x42931b);}(_0x473d,0xcb));var _0xd473=function(_0x409d3f,_0x40bb46){_0x409d3f=_0x409d3f-0x0;var _0x43afaf=_0x473d[_0x409d3f];return _0x43afaf;};'use strict';var _=require('lodash');var util=require(_0xd473('0x0'));var moment=require(_0xd473('0x1'));var BPromise=require('bluebird');var rs=require(_0xd473('0x2'));var fs=require('fs');var Redis=require(_0xd473('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd473('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd473('0x5'));var client=jayson[_0xd473('0x6')][_0xd473('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2326b4,_0x12be20,_0x3d2d15){return new BPromise(function(_0x517fe4,_0x258abb){return client['request'](_0x2326b4,_0x3d2d15)['then'](function(_0x10eaa4){logger[_0xd473('0x8')](_0xd473('0x9'),_0x12be20,_0xd473('0xa'));logger[_0xd473('0xb')](_0xd473('0xc'),_0x12be20,_0xd473('0xa'),JSON[_0xd473('0xd')](_0x10eaa4));if(_0x10eaa4[_0xd473('0xe')]){if(_0x10eaa4[_0xd473('0xe')]['code']===0x1f4){logger['error'](_0xd473('0x9'),_0x12be20,_0x10eaa4['error'][_0xd473('0xf')]);return _0x258abb(_0x10eaa4[_0xd473('0xe')]['message']);}logger['error'](_0xd473('0x9'),_0x12be20,_0x10eaa4[_0xd473('0xe')][_0xd473('0xf')]);return _0x517fe4(_0x10eaa4['error'][_0xd473('0xf')]);}else{logger[_0xd473('0x8')](_0xd473('0x9'),_0x12be20,'request\x20sent');_0x517fe4(_0x10eaa4['result'][_0xd473('0xf')]);}})[_0xd473('0x10')](function(_0x28dc9d){logger['error'](_0xd473('0x9'),_0x12be20,_0x28dc9d);_0x258abb(_0x28dc9d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index a191c6d..5a05939 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 _0x0ca2=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','show','/:id','update','delete','isAuthenticated','destroy'];(function(_0x1b9248,_0x3bd3d2){var _0x45b528=function(_0x3997ca){while(--_0x3997ca){_0x1b9248['push'](_0x1b9248['shift']());}};_0x45b528(++_0x3bd3d2);}(_0x0ca2,0xa9));var _0x20ca=function(_0x3b0da2,_0x306d66){_0x3b0da2=_0x3b0da2-0x0;var _0x45a240=_0x0ca2[_0x3b0da2];return _0x45a240;};'use strict';var multer=require(_0x20ca('0x0'));var util=require(_0x20ca('0x1'));var path=require(_0x20ca('0x2'));var timeout=require('connect-timeout');var express=require(_0x20ca('0x3'));var router=express[_0x20ca('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x20ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x20ca('0x6'));var controller=require('./chatApplication.controller');router['get']('/:id',auth['isAuthenticated'](),controller[_0x20ca('0x7')]);router['put'](_0x20ca('0x8'),auth['isAuthenticated'](),controller[_0x20ca('0x9')]);router[_0x20ca('0xa')](_0x20ca('0x8'),auth[_0x20ca('0xb')](),controller[_0x20ca('0xc')]);module[_0x20ca('0xd')]=router; \ No newline at end of file +var _0x5140=['util','express','Router','fs-extra','../../components/auth/service','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x2bced3,_0x59c962){var _0x5d9a81=function(_0x3a0741){while(--_0x3a0741){_0x2bced3['push'](_0x2bced3['shift']());}};_0x5d9a81(++_0x59c962);}(_0x5140,0xdf));var _0x0514=function(_0x51a837,_0x3dba20){_0x51a837=_0x51a837-0x0;var _0x28f371=_0x5140[_0x51a837];return _0x28f371;};'use strict';var multer=require(_0x0514('0x0'));var util=require(_0x0514('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0514('0x2'));var router=express[_0x0514('0x3')]();var fs_extra=require(_0x0514('0x4'));var auth=require(_0x0514('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0514('0x6'));router[_0x0514('0x7')](_0x0514('0x8'),auth['isAuthenticated'](),controller[_0x0514('0x9')]);router[_0x0514('0xa')](_0x0514('0x8'),auth[_0x0514('0xb')](),controller[_0x0514('0xc')]);router[_0x0514('0xd')](_0x0514('0x8'),auth[_0x0514('0xb')](),controller[_0x0514('0xe')]);module[_0x0514('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index eb614f7..38e7628 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 _0xcb95=['BOOLEAN','sequelize','exports','STRING'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xcb95,0xb5));var _0x5cb9=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xcb95[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require(_0x5cb9('0x0'));module[_0x5cb9('0x1')]={'name':{'type':Sequelize[_0x5cb9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x5cb9('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf759=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf759,0x154));var _0x9f75=function(_0x2a6149,_0x5c11ff){_0x2a6149=_0x2a6149-0x0;var _0x4c19f1=_0xf759[_0x2a6149];return _0x4c19f1;};'use strict';var Sequelize=require(_0x9f75('0x0'));module[_0x9f75('0x1')]={'name':{'type':Sequelize[_0x9f75('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9f75('0x2')]},'write':{'type':Sequelize[_0x9f75('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 838388f..003812f 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 _0x40b1=['util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ChatGroup','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','User','removeMembers','ChatGroupId','findOne','order','$gte','split','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','mustache'];(function(_0x1d537c,_0x2b834d){var _0x184fb9=function(_0x248647){while(--_0x248647){_0x1d537c['push'](_0x1d537c['shift']());}};_0x184fb9(++_0x2b834d);}(_0x40b1,0x121));var _0x140b=function(_0x19c7bb,_0x44f815){_0x19c7bb=_0x19c7bb-0x0;var _0x4af974=_0x40b1[_0x19c7bb];return _0x4af974;};'use strict';var emlformat=require(_0x140b('0x0'));var rimraf=require(_0x140b('0x1'));var zipdir=require(_0x140b('0x2'));var jsonpatch=require(_0x140b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x140b('0x4'));var util=require(_0x140b('0x5'));var path=require(_0x140b('0x6'));var sox=require('sox');var csv=require(_0x140b('0x7'));var ejs=require(_0x140b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x140b('0x9'));var crypto=require(_0x140b('0xa'));var jsforce=require(_0x140b('0xb'));var deskjs=require(_0x140b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x140b('0xd'));var Papa=require(_0x140b('0xe'));var Redis=require(_0x140b('0xf'));var authService=require(_0x140b('0x10'));var qs=require(_0x140b('0x11'));var as=require(_0x140b('0x12'));var hardwareService=require(_0x140b('0x13'));var logger=require(_0x140b('0x14'))('api');var utils=require(_0x140b('0x15'));var config=require(_0x140b('0x16'));var licenseUtil=require(_0x140b('0x17'));var db=require(_0x140b('0x18'))['db'];config[_0x140b('0x19')]=_[_0x140b('0x1a')](config[_0x140b('0x19')],{'host':_0x140b('0x1b'),'port':0x18eb});var socket=require(_0x140b('0x1c'))(new Redis(config[_0x140b('0x19')]));require(_0x140b('0x1d'))[_0x140b('0x1e')](socket);function respondWithStatusCode(_0x43574a,_0x12647f){_0x12647f=_0x12647f||0xcc;return function(_0x3a9fe6){if(_0x3a9fe6){return _0x43574a[_0x140b('0x1f')](_0x12647f);}return _0x43574a[_0x140b('0x20')](_0x12647f)[_0x140b('0x21')]();};}function respondWithResult(_0x3570d2,_0x2b22f6){_0x2b22f6=_0x2b22f6||0xc8;return function(_0x12e3ba){if(_0x12e3ba){return _0x3570d2[_0x140b('0x20')](_0x2b22f6)[_0x140b('0x22')](_0x12e3ba);}};}function respondWithFilteredResult(_0x5a26ef,_0x41fc87){return function(_0x50dad7){if(_0x50dad7){var _0x4ba0d1=typeof _0x41fc87[_0x140b('0x23')]===_0x140b('0x24')&&typeof _0x41fc87['limit']==='undefined';var _0x168675=_0x50dad7[_0x140b('0x25')];var _0x3c7a69=_0x4ba0d1?0x0:_0x41fc87[_0x140b('0x23')];var _0x16cef6=_0x4ba0d1?_0x50dad7[_0x140b('0x25')]:_0x41fc87['offset']+_0x41fc87[_0x140b('0x26')];var _0x59c3ba;if(_0x16cef6>=_0x168675){_0x16cef6=_0x168675;_0x59c3ba=0xc8;}else{_0x59c3ba=0xce;}_0x5a26ef['status'](_0x59c3ba);return _0x5a26ef[_0x140b('0x27')](_0x140b('0x28'),_0x3c7a69+'-'+_0x16cef6+'/'+_0x168675)['json'](_0x50dad7);}return null;};}function patchUpdates(_0x530e81){return function(_0x215e49){try{jsonpatch[_0x140b('0x29')](_0x215e49,_0x530e81,!![]);}catch(_0x55dddd){return BPromise[_0x140b('0x2a')](_0x55dddd);}return _0x215e49[_0x140b('0x2b')]();};}function saveUpdates(_0x463ce6,_0x4d0b23){return function(_0x429f38){if(_0x429f38){return _0x429f38[_0x140b('0x2c')](_0x463ce6)[_0x140b('0x2d')](function(_0x59f5d4){return _0x59f5d4;});}return null;};}function removeEntity(_0x1194dc,_0x30b8d6){return function(_0x48a91d){if(_0x48a91d){return _0x48a91d['destroy']()[_0x140b('0x2d')](function(){_0x1194dc[_0x140b('0x20')](0xcc)[_0x140b('0x21')]();});}};}function handleEntityNotFound(_0x6ef0f9,_0x289103){return function(_0x3808a0){if(!_0x3808a0){_0x6ef0f9[_0x140b('0x1f')](0x194);}return _0x3808a0;};}function handleError(_0x442583,_0x37d3a3){_0x37d3a3=_0x37d3a3||0x1f4;return function(_0x3086f7){logger['error'](_0x3086f7[_0x140b('0x2e')]);if(_0x3086f7[_0x140b('0x2f')]){delete _0x3086f7['name'];}_0x442583['status'](_0x37d3a3)[_0x140b('0x30')](_0x3086f7);};}exports['index']=function(_0x3f3077,_0x470905){var _0x5c8bd5={},_0x1e7c47={},_0x29bde1={'count':0x0,'rows':[]};var _0x55b927=_[_0x140b('0x31')](db[_0x140b('0x32')]['rawAttributes'],function(_0xdab312){return{'name':_0xdab312[_0x140b('0x33')],'type':_0xdab312[_0x140b('0x34')][_0x140b('0x35')]};});_0x1e7c47[_0x140b('0x36')]=_['map'](_0x55b927,'name');_0x1e7c47['query']=_[_0x140b('0x37')](_0x3f3077[_0x140b('0x38')]);_0x1e7c47[_0x140b('0x39')]=_[_0x140b('0x3a')](_0x1e7c47[_0x140b('0x36')],_0x1e7c47['query']);_0x5c8bd5[_0x140b('0x3b')]=_['intersection'](_0x1e7c47[_0x140b('0x36')],qs[_0x140b('0x3c')](_0x3f3077[_0x140b('0x38')][_0x140b('0x3c')]));_0x5c8bd5[_0x140b('0x3b')]=_0x5c8bd5[_0x140b('0x3b')]['length']?_0x5c8bd5[_0x140b('0x3b')]:_0x1e7c47[_0x140b('0x36')];if(!_0x3f3077[_0x140b('0x38')][_0x140b('0x3d')](_0x140b('0x3e'))){_0x5c8bd5[_0x140b('0x26')]=qs['limit'](_0x3f3077[_0x140b('0x38')][_0x140b('0x26')]);_0x5c8bd5[_0x140b('0x23')]=qs['offset'](_0x3f3077[_0x140b('0x38')][_0x140b('0x23')]);}_0x5c8bd5['order']=qs[_0x140b('0x3f')](_0x3f3077[_0x140b('0x38')]['sort']);_0x5c8bd5[_0x140b('0x40')]=qs[_0x140b('0x39')](_[_0x140b('0x41')](_0x3f3077[_0x140b('0x38')],_0x1e7c47[_0x140b('0x39')]),_0x55b927);if(_0x3f3077['query'][_0x140b('0x42')]){_0x5c8bd5[_0x140b('0x40')]=_[_0x140b('0x43')](_0x5c8bd5[_0x140b('0x40')],{'$or':_[_0x140b('0x31')](_0x55b927,function(_0x5ae40f){if(_0x5ae40f[_0x140b('0x34')]!==_0x140b('0x44')){var _0x586087={};_0x586087[_0x5ae40f[_0x140b('0x2f')]]={'$like':'%'+_0x3f3077[_0x140b('0x38')]['filter']+'%'};return _0x586087;}})});}_0x5c8bd5=_[_0x140b('0x43')]({},_0x5c8bd5,_0x3f3077[_0x140b('0x45')]);var _0x125b6f={'where':_0x5c8bd5[_0x140b('0x40')]};return db[_0x140b('0x32')][_0x140b('0x25')](_0x125b6f)[_0x140b('0x2d')](function(_0x2ffa83){_0x29bde1[_0x140b('0x25')]=_0x2ffa83;if(_0x3f3077['query'][_0x140b('0x46')]){_0x5c8bd5[_0x140b('0x47')]=[{'all':!![]}];}return db[_0x140b('0x32')][_0x140b('0x48')](_0x5c8bd5);})[_0x140b('0x2d')](function(_0x35389e){_0x29bde1[_0x140b('0x49')]=_0x35389e;return _0x29bde1;})[_0x140b('0x2d')](respondWithFilteredResult(_0x470905,_0x5c8bd5))[_0x140b('0x4a')](handleError(_0x470905,null));};exports[_0x140b('0x4b')]=function(_0xb2b1aa,_0x15565d){var _0x2f97d4={'raw':!![],'where':{'id':_0xb2b1aa[_0x140b('0x4c')]['id']}},_0x4f7964={};_0x4f7964[_0x140b('0x36')]=_['keys'](db[_0x140b('0x32')][_0x140b('0x4d')]);_0x4f7964[_0x140b('0x38')]=_[_0x140b('0x37')](_0xb2b1aa[_0x140b('0x38')]);_0x4f7964[_0x140b('0x39')]=_[_0x140b('0x3a')](_0x4f7964[_0x140b('0x36')],_0x4f7964[_0x140b('0x38')]);_0x2f97d4[_0x140b('0x3b')]=_[_0x140b('0x3a')](_0x4f7964[_0x140b('0x36')],qs['fields'](_0xb2b1aa[_0x140b('0x38')][_0x140b('0x3c')]));_0x2f97d4[_0x140b('0x3b')]=_0x2f97d4[_0x140b('0x3b')][_0x140b('0x4e')]?_0x2f97d4[_0x140b('0x3b')]:_0x4f7964[_0x140b('0x36')];if(_0xb2b1aa[_0x140b('0x38')][_0x140b('0x46')]){_0x2f97d4[_0x140b('0x47')]=[{'all':!![]}];}_0x2f97d4=_[_0x140b('0x43')]({},_0x2f97d4,_0xb2b1aa[_0x140b('0x45')]);return db['ChatGroup'][_0x140b('0x4f')](_0x2f97d4)[_0x140b('0x2d')](handleEntityNotFound(_0x15565d,null))[_0x140b('0x2d')](respondWithResult(_0x15565d,null))[_0x140b('0x4a')](handleError(_0x15565d,null));};exports[_0x140b('0x50')]=function(_0x319dc0,_0x56e6b9){return db[_0x140b('0x32')]['create'](_0x319dc0['body'],{})[_0x140b('0x2d')](respondWithResult(_0x56e6b9,0xc9))[_0x140b('0x4a')](handleError(_0x56e6b9,null));};exports[_0x140b('0x2c')]=function(_0x29244e,_0x9d1e1d){if(_0x29244e['body']['id']){delete _0x29244e[_0x140b('0x51')]['id'];}return db[_0x140b('0x32')][_0x140b('0x4f')]({'where':{'id':_0x29244e[_0x140b('0x4c')]['id']}})[_0x140b('0x2d')](handleEntityNotFound(_0x9d1e1d,null))[_0x140b('0x2d')](saveUpdates(_0x29244e[_0x140b('0x51')],null))[_0x140b('0x2d')](respondWithResult(_0x9d1e1d,null))['catch'](handleError(_0x9d1e1d,null));};exports[_0x140b('0x52')]=function(_0x300cbe,_0x4fc8ea){return db[_0x140b('0x32')][_0x140b('0x4f')]({'where':{'id':_0x300cbe[_0x140b('0x4c')]['id']}})[_0x140b('0x2d')](handleEntityNotFound(_0x4fc8ea,null))[_0x140b('0x2d')](removeEntity(_0x4fc8ea,null))[_0x140b('0x4a')](handleError(_0x4fc8ea,null));};exports[_0x140b('0x53')]=function(_0x498640,_0x570bdd){return db['ChatGroup'][_0x140b('0x53')]()['then'](respondWithResult(_0x570bdd,null))[_0x140b('0x4a')](handleError(_0x570bdd,null));};exports['getUnread']=function(_0x42ae39,_0xf9677,_0xc68ef8){return db[_0x140b('0x54')]['count']({'where':{'ChatGroupId':_0x42ae39[_0x140b('0x4c')]['id'],'ToId':_0x42ae39[_0x140b('0x55')]['id'],'read':![]}})['then'](function(_0xce56b3){return{'id':_[_0x140b('0x56')](_0x42ae39[_0x140b('0x4c')]['id']),'count':_0xce56b3};})[_0x140b('0x2d')](respondWithResult(_0xf9677,null))[_0x140b('0x4a')](handleError(_0xf9677,null));};exports[_0x140b('0x57')]=function(_0x31b8ec,_0x26ff09,_0x48e908){return db['ChatGroup']['find']({'where':{'id':_0x31b8ec['params']['id']}})['then'](handleEntityNotFound(_0x26ff09,null))[_0x140b('0x2d')](function(_0x13c46d){if(_0x13c46d){return _0x13c46d[_0x140b('0x57')](_0x31b8ec[_0x140b('0x51')][_0x140b('0x58')],_['omit'](_0x31b8ec[_0x140b('0x51')],[_0x140b('0x58'),'id'])||{});}})['then'](respondWithResult(_0x26ff09,null))[_0x140b('0x4a')](handleError(_0x26ff09,null));};exports[_0x140b('0x59')]=function(_0x5cfd62,_0x9ff6ce,_0x279e2f){var _0x4c94a0={};var _0x38ddce={};var _0x1b914a;var _0x10587b;return db[_0x140b('0x32')]['findOne']({'where':{'id':_0x5cfd62[_0x140b('0x4c')]['id']}})[_0x140b('0x2d')](handleEntityNotFound(_0x9ff6ce,null))[_0x140b('0x2d')](function(_0x24868e){if(_0x24868e){_0x1b914a=_0x24868e;_0x38ddce[_0x140b('0x36')]=_[_0x140b('0x37')](db[_0x140b('0x5a')][_0x140b('0x4d')]);_0x38ddce[_0x140b('0x38')]=_['keys'](_0x5cfd62[_0x140b('0x38')]);_0x38ddce[_0x140b('0x39')]=_[_0x140b('0x3a')](_0x38ddce['model'],_0x38ddce[_0x140b('0x38')]);_0x4c94a0[_0x140b('0x3b')]=_['intersection'](_0x38ddce[_0x140b('0x36')],qs[_0x140b('0x3c')](_0x5cfd62['query'][_0x140b('0x3c')]));_0x4c94a0[_0x140b('0x3b')]=_0x4c94a0[_0x140b('0x3b')][_0x140b('0x4e')]?_0x4c94a0[_0x140b('0x3b')]:_0x38ddce[_0x140b('0x36')];_0x4c94a0['order']=qs[_0x140b('0x3f')](_0x5cfd62[_0x140b('0x38')][_0x140b('0x3f')]);_0x4c94a0[_0x140b('0x40')]=qs[_0x140b('0x39')](_[_0x140b('0x41')](_0x5cfd62[_0x140b('0x38')],_0x38ddce[_0x140b('0x39')]));if(_0x5cfd62[_0x140b('0x38')][_0x140b('0x42')]){_0x4c94a0[_0x140b('0x40')]=_['merge'](_0x4c94a0[_0x140b('0x40')],{'$or':_[_0x140b('0x31')](_0x4c94a0['attributes'],function(_0x141179){var _0x262e70={};_0x262e70[_0x141179]={'$like':'%'+_0x5cfd62[_0x140b('0x38')][_0x140b('0x42')]+'%'};return _0x262e70;})});}_0x4c94a0=_['merge']({},_0x4c94a0,_0x5cfd62[_0x140b('0x45')]);return _0x1b914a[_0x140b('0x59')](_0x4c94a0);}})[_0x140b('0x2d')](function(_0x5b4184){if(_0x5b4184){_0x10587b=_0x5b4184[_0x140b('0x4e')];if(!_0x5cfd62[_0x140b('0x38')]['hasOwnProperty'](_0x140b('0x3e'))){_0x4c94a0[_0x140b('0x26')]=qs[_0x140b('0x26')](_0x5cfd62[_0x140b('0x38')][_0x140b('0x26')]);_0x4c94a0[_0x140b('0x23')]=qs[_0x140b('0x23')](_0x5cfd62[_0x140b('0x38')][_0x140b('0x23')]);}return _0x1b914a[_0x140b('0x59')](_0x4c94a0);}})[_0x140b('0x2d')](function(_0x2fee1f){if(_0x2fee1f){return _0x2fee1f?{'count':_0x10587b,'rows':_0x2fee1f}:null;}})['then'](respondWithResult(_0x9ff6ce,null))[_0x140b('0x4a')](handleError(_0x9ff6ce,null));};exports[_0x140b('0x5b')]=function(_0xf2264e,_0x4d5fc5,_0x45878d){return db[_0x140b('0x32')]['find']({'where':{'id':_0xf2264e[_0x140b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d5fc5,null))[_0x140b('0x2d')](function(_0x4e4543){if(_0x4e4543){return _0x4e4543[_0x140b('0x5b')](_0xf2264e['query']['ids']);}})[_0x140b('0x2d')](respondWithStatusCode(_0x4d5fc5,null))['catch'](handleError(_0x4d5fc5,null));};exports['addMessage']=function(_0x3fac55,_0x5af1a7,_0x3c9902){if(_0x3fac55['body']['id']){delete _0x3fac55[_0x140b('0x51')]['id'];}return db[_0x140b('0x32')][_0x140b('0x4f')]({'where':{'id':_0x3fac55[_0x140b('0x4c')]['id']}})[_0x140b('0x2d')](handleEntityNotFound(_0x5af1a7,null))['then'](function(_0x180719){if(_0x180719){_0x3fac55[_0x140b('0x51')][_0x140b('0x5c')]=_0x180719['id'];return db[_0x140b('0x54')][_0x140b('0x50')](_0x3fac55[_0x140b('0x51')]);}})[_0x140b('0x2d')](respondWithResult(_0x5af1a7,null))[_0x140b('0x4a')](handleError(_0x5af1a7,null));};exports['getMessages']=function(_0x504847,_0x960d91,_0x388c5){var _0x525795={};var _0xb26bb5={};var _0x11974b;var _0x5c7fc0;return db[_0x140b('0x32')][_0x140b('0x5d')]({'where':{'id':_0x504847[_0x140b('0x4c')]['id']}})[_0x140b('0x2d')](handleEntityNotFound(_0x960d91,null))[_0x140b('0x2d')](function(_0x2ca301){if(_0x2ca301){_0x11974b=_0x2ca301;_0xb26bb5[_0x140b('0x36')]=_['keys'](db[_0x140b('0x54')][_0x140b('0x4d')]);_0xb26bb5[_0x140b('0x38')]=_[_0x140b('0x37')](_0x504847['query']);_0xb26bb5[_0x140b('0x39')]=_[_0x140b('0x3a')](_0xb26bb5['model'],_0xb26bb5[_0x140b('0x38')]);_0x525795[_0x140b('0x3b')]=_[_0x140b('0x3a')](_0xb26bb5[_0x140b('0x36')],qs[_0x140b('0x3c')](_0x504847[_0x140b('0x38')][_0x140b('0x3c')]));_0x525795[_0x140b('0x3b')]=_0x525795[_0x140b('0x3b')][_0x140b('0x4e')]?_0x525795[_0x140b('0x3b')]:_0xb26bb5['model'];_0x525795[_0x140b('0x5e')]=qs[_0x140b('0x3f')](_0x504847[_0x140b('0x38')][_0x140b('0x3f')]);_0x525795['where']=qs['filters'](_[_0x140b('0x41')](_0x504847[_0x140b('0x38')],_0xb26bb5['filters']));if(_0x504847[_0x140b('0x38')][_0x140b('0x42')]){_0x525795[_0x140b('0x40')]=_[_0x140b('0x43')](_0x525795['where'],{'$or':_[_0x140b('0x31')](_0x525795['attributes'],function(_0x496b5c){var _0x101e40={};_0x101e40[_0x496b5c]={'$like':'%'+_0x504847['query'][_0x140b('0x42')]+'%'};return _0x101e40;})});}if(_0x504847[_0x140b('0x38')][_0x140b('0x5f')]){var _0x268212=_0x504847[_0x140b('0x38')]['$gte'][_0x140b('0x60')](',');var _0x415d74={};_0x415d74[_0x268212[0x0]]={'$gte':moment(_0x268212[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x525795[_0x140b('0x40')]=_[_0x140b('0x43')](_0x525795[_0x140b('0x40')],_0x415d74);}_0x525795=_['merge']({},_0x525795,_0x504847['options']);return _0x11974b[_0x140b('0x61')](_0x525795);}})[_0x140b('0x2d')](function(_0x37c7ea){if(_0x37c7ea){_0x5c7fc0=_0x37c7ea[_0x140b('0x4e')];if(!_0x504847[_0x140b('0x38')][_0x140b('0x3d')]('nolimit')){_0x525795[_0x140b('0x26')]=qs[_0x140b('0x26')](_0x504847[_0x140b('0x38')][_0x140b('0x26')]);_0x525795[_0x140b('0x23')]=qs[_0x140b('0x23')](_0x504847[_0x140b('0x38')][_0x140b('0x23')]);}return _0x11974b[_0x140b('0x61')](_0x525795);}})[_0x140b('0x2d')](function(_0x4f4abd){if(_0x4f4abd){return _0x4f4abd?{'count':_0x5c7fc0,'rows':_0x4f4abd}:null;}})[_0x140b('0x2d')](respondWithResult(_0x960d91,null))['catch'](handleError(_0x960d91,null));}; \ No newline at end of file +var _0x0d10=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','sort','removeMembers','addMessage','create','getMessages','pick','$gte','split','format','eml-format','zip-dir','request-promise'];(function(_0xbb4316,_0x15321c){var _0x360871=function(_0x1d19bb){while(--_0x1d19bb){_0xbb4316['push'](_0xbb4316['shift']());}};_0x360871(++_0x15321c);}(_0x0d10,0x12c));var _0x00d1=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x0d10[_0x145b3c];return _0x1b6e36;};'use strict';var emlformat=require(_0x00d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x00d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00d1('0x2'));var moment=require(_0x00d1('0x3'));var BPromise=require(_0x00d1('0x4'));var Mustache=require(_0x00d1('0x5'));var util=require(_0x00d1('0x6'));var path=require(_0x00d1('0x7'));var sox=require(_0x00d1('0x8'));var csv=require(_0x00d1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00d1('0xa'));var _=require(_0x00d1('0xb'));var squel=require(_0x00d1('0xc'));var crypto=require(_0x00d1('0xd'));var jsforce=require(_0x00d1('0xe'));var deskjs=require(_0x00d1('0xf'));var toCsv=require(_0x00d1('0x9'));var querystring=require(_0x00d1('0x10'));var Papa=require(_0x00d1('0x11'));var Redis=require(_0x00d1('0x12'));var authService=require(_0x00d1('0x13'));var qs=require(_0x00d1('0x14'));var as=require(_0x00d1('0x15'));var hardwareService=require(_0x00d1('0x16'));var logger=require(_0x00d1('0x17'))(_0x00d1('0x18'));var utils=require('../../config/utils');var config=require(_0x00d1('0x19'));var licenseUtil=require(_0x00d1('0x1a'));var db=require(_0x00d1('0x1b'))['db'];config[_0x00d1('0x1c')]=_['defaults'](config['redis'],{'host':_0x00d1('0x1d'),'port':0x18eb});var socket=require(_0x00d1('0x1e'))(new Redis(config[_0x00d1('0x1c')]));require(_0x00d1('0x1f'))[_0x00d1('0x20')](socket);function respondWithStatusCode(_0x44001a,_0x5e82cf){_0x5e82cf=_0x5e82cf||0xcc;return function(_0x551327){if(_0x551327){return _0x44001a['sendStatus'](_0x5e82cf);}return _0x44001a['status'](_0x5e82cf)[_0x00d1('0x21')]();};}function respondWithResult(_0x55caca,_0x27994b){_0x27994b=_0x27994b||0xc8;return function(_0x287d97){if(_0x287d97){return _0x55caca[_0x00d1('0x22')](_0x27994b)[_0x00d1('0x23')](_0x287d97);}};}function respondWithFilteredResult(_0x138831,_0x1e4605){return function(_0x40fb2e){if(_0x40fb2e){var _0x25e370=typeof _0x1e4605['offset']===_0x00d1('0x24')&&typeof _0x1e4605['limit']==='undefined';var _0x5ba226=_0x40fb2e[_0x00d1('0x25')];var _0x7d053a=_0x25e370?0x0:_0x1e4605[_0x00d1('0x26')];var _0x501705=_0x25e370?_0x40fb2e[_0x00d1('0x25')]:_0x1e4605['offset']+_0x1e4605[_0x00d1('0x27')];var _0x400fcd;if(_0x501705>=_0x5ba226){_0x501705=_0x5ba226;_0x400fcd=0xc8;}else{_0x400fcd=0xce;}_0x138831[_0x00d1('0x22')](_0x400fcd);return _0x138831[_0x00d1('0x28')](_0x00d1('0x29'),_0x7d053a+'-'+_0x501705+'/'+_0x5ba226)[_0x00d1('0x23')](_0x40fb2e);}return null;};}function patchUpdates(_0x1b342a){return function(_0x4bc3a9){try{jsonpatch[_0x00d1('0x2a')](_0x4bc3a9,_0x1b342a,!![]);}catch(_0x2d39af){return BPromise[_0x00d1('0x2b')](_0x2d39af);}return _0x4bc3a9['save']();};}function saveUpdates(_0x2c6730,_0x1b4940){return function(_0x3ae76d){if(_0x3ae76d){return _0x3ae76d['update'](_0x2c6730)[_0x00d1('0x2c')](function(_0x105550){return _0x105550;});}return null;};}function removeEntity(_0x4b0996,_0xcff103){return function(_0x1a94d5){if(_0x1a94d5){return _0x1a94d5[_0x00d1('0x2d')]()[_0x00d1('0x2c')](function(){_0x4b0996[_0x00d1('0x22')](0xcc)[_0x00d1('0x21')]();});}};}function handleEntityNotFound(_0x23e822,_0x433924){return function(_0x2915c2){if(!_0x2915c2){_0x23e822[_0x00d1('0x2e')](0x194);}return _0x2915c2;};}function handleError(_0x264a43,_0x270041){_0x270041=_0x270041||0x1f4;return function(_0x3706cb){logger[_0x00d1('0x2f')](_0x3706cb[_0x00d1('0x30')]);if(_0x3706cb['name']){delete _0x3706cb[_0x00d1('0x31')];}_0x264a43['status'](_0x270041)[_0x00d1('0x32')](_0x3706cb);};}exports['index']=function(_0x2a8285,_0x58e477){var _0x1ea4a9={},_0x3bc62a={},_0x13b24d={'count':0x0,'rows':[]};var _0x2807f2=_['map'](db[_0x00d1('0x33')][_0x00d1('0x34')],function(_0x1bca54){return{'name':_0x1bca54[_0x00d1('0x35')],'type':_0x1bca54[_0x00d1('0x36')][_0x00d1('0x37')]};});_0x3bc62a[_0x00d1('0x38')]=_[_0x00d1('0x39')](_0x2807f2,_0x00d1('0x31'));_0x3bc62a[_0x00d1('0x3a')]=_[_0x00d1('0x3b')](_0x2a8285[_0x00d1('0x3a')]);_0x3bc62a[_0x00d1('0x3c')]=_[_0x00d1('0x3d')](_0x3bc62a['model'],_0x3bc62a[_0x00d1('0x3a')]);_0x1ea4a9[_0x00d1('0x3e')]=_[_0x00d1('0x3d')](_0x3bc62a[_0x00d1('0x38')],qs[_0x00d1('0x3f')](_0x2a8285['query'][_0x00d1('0x3f')]));_0x1ea4a9[_0x00d1('0x3e')]=_0x1ea4a9[_0x00d1('0x3e')][_0x00d1('0x40')]?_0x1ea4a9[_0x00d1('0x3e')]:_0x3bc62a['model'];if(!_0x2a8285[_0x00d1('0x3a')][_0x00d1('0x41')](_0x00d1('0x42'))){_0x1ea4a9[_0x00d1('0x27')]=qs['limit'](_0x2a8285[_0x00d1('0x3a')][_0x00d1('0x27')]);_0x1ea4a9[_0x00d1('0x26')]=qs['offset'](_0x2a8285[_0x00d1('0x3a')][_0x00d1('0x26')]);}_0x1ea4a9[_0x00d1('0x43')]=qs['sort'](_0x2a8285[_0x00d1('0x3a')]['sort']);_0x1ea4a9[_0x00d1('0x44')]=qs[_0x00d1('0x3c')](_['pick'](_0x2a8285[_0x00d1('0x3a')],_0x3bc62a['filters']),_0x2807f2);if(_0x2a8285[_0x00d1('0x3a')][_0x00d1('0x45')]){_0x1ea4a9['where']=_[_0x00d1('0x46')](_0x1ea4a9[_0x00d1('0x44')],{'$or':_[_0x00d1('0x39')](_0x2807f2,function(_0x1e5b28){if(_0x1e5b28[_0x00d1('0x36')]!==_0x00d1('0x47')){var _0x15e756={};_0x15e756[_0x1e5b28[_0x00d1('0x31')]]={'$like':'%'+_0x2a8285[_0x00d1('0x3a')][_0x00d1('0x45')]+'%'};return _0x15e756;}})});}_0x1ea4a9=_[_0x00d1('0x46')]({},_0x1ea4a9,_0x2a8285['options']);var _0x5da6ee={'where':_0x1ea4a9[_0x00d1('0x44')]};return db['ChatGroup'][_0x00d1('0x25')](_0x5da6ee)[_0x00d1('0x2c')](function(_0xa9cce){_0x13b24d['count']=_0xa9cce;if(_0x2a8285['query'][_0x00d1('0x48')]){_0x1ea4a9['include']=[{'all':!![]}];}return db[_0x00d1('0x33')][_0x00d1('0x49')](_0x1ea4a9);})['then'](function(_0x24b54e){_0x13b24d['rows']=_0x24b54e;return _0x13b24d;})[_0x00d1('0x2c')](respondWithFilteredResult(_0x58e477,_0x1ea4a9))[_0x00d1('0x4a')](handleError(_0x58e477,null));};exports[_0x00d1('0x4b')]=function(_0x3fb03e,_0x4bb1a8){var _0x4881f4={'raw':!![],'where':{'id':_0x3fb03e[_0x00d1('0x4c')]['id']}},_0x3bda5e={};_0x3bda5e[_0x00d1('0x38')]=_['keys'](db['ChatGroup'][_0x00d1('0x34')]);_0x3bda5e[_0x00d1('0x3a')]=_['keys'](_0x3fb03e['query']);_0x3bda5e[_0x00d1('0x3c')]=_[_0x00d1('0x3d')](_0x3bda5e[_0x00d1('0x38')],_0x3bda5e[_0x00d1('0x3a')]);_0x4881f4['attributes']=_[_0x00d1('0x3d')](_0x3bda5e['model'],qs['fields'](_0x3fb03e[_0x00d1('0x3a')][_0x00d1('0x3f')]));_0x4881f4[_0x00d1('0x3e')]=_0x4881f4[_0x00d1('0x3e')][_0x00d1('0x40')]?_0x4881f4['attributes']:_0x3bda5e['model'];if(_0x3fb03e[_0x00d1('0x3a')][_0x00d1('0x48')]){_0x4881f4[_0x00d1('0x4d')]=[{'all':!![]}];}_0x4881f4=_[_0x00d1('0x46')]({},_0x4881f4,_0x3fb03e[_0x00d1('0x4e')]);return db['ChatGroup'][_0x00d1('0x4f')](_0x4881f4)[_0x00d1('0x2c')](handleEntityNotFound(_0x4bb1a8,null))[_0x00d1('0x2c')](respondWithResult(_0x4bb1a8,null))[_0x00d1('0x4a')](handleError(_0x4bb1a8,null));};exports['create']=function(_0x5a6ed2,_0x2507f9){return db[_0x00d1('0x33')]['create'](_0x5a6ed2[_0x00d1('0x50')],{})[_0x00d1('0x2c')](respondWithResult(_0x2507f9,0xc9))[_0x00d1('0x4a')](handleError(_0x2507f9,null));};exports['update']=function(_0x761d73,_0x3bd0fb){if(_0x761d73[_0x00d1('0x50')]['id']){delete _0x761d73[_0x00d1('0x50')]['id'];}return db[_0x00d1('0x33')]['find']({'where':{'id':_0x761d73[_0x00d1('0x4c')]['id']}})[_0x00d1('0x2c')](handleEntityNotFound(_0x3bd0fb,null))['then'](saveUpdates(_0x761d73['body'],null))[_0x00d1('0x2c')](respondWithResult(_0x3bd0fb,null))[_0x00d1('0x4a')](handleError(_0x3bd0fb,null));};exports['destroy']=function(_0x45a894,_0x2ef470){return db[_0x00d1('0x33')]['find']({'where':{'id':_0x45a894[_0x00d1('0x4c')]['id']}})[_0x00d1('0x2c')](handleEntityNotFound(_0x2ef470,null))['then'](removeEntity(_0x2ef470,null))[_0x00d1('0x4a')](handleError(_0x2ef470,null));};exports[_0x00d1('0x51')]=function(_0x40745c,_0x1b0d9c){return db[_0x00d1('0x33')][_0x00d1('0x51')]()[_0x00d1('0x2c')](respondWithResult(_0x1b0d9c,null))[_0x00d1('0x4a')](handleError(_0x1b0d9c,null));};exports[_0x00d1('0x52')]=function(_0x54714f,_0x4780ba,_0x4711a8){return db[_0x00d1('0x53')]['count']({'where':{'ChatGroupId':_0x54714f[_0x00d1('0x4c')]['id'],'ToId':_0x54714f[_0x00d1('0x54')]['id'],'read':![]}})[_0x00d1('0x2c')](function(_0x1a927d){return{'id':_[_0x00d1('0x55')](_0x54714f['params']['id']),'count':_0x1a927d};})[_0x00d1('0x2c')](respondWithResult(_0x4780ba,null))[_0x00d1('0x4a')](handleError(_0x4780ba,null));};exports[_0x00d1('0x56')]=function(_0x538487,_0x4d5c7c,_0x58ee3a){return db[_0x00d1('0x33')][_0x00d1('0x4f')]({'where':{'id':_0x538487[_0x00d1('0x4c')]['id']}})[_0x00d1('0x2c')](handleEntityNotFound(_0x4d5c7c,null))['then'](function(_0x50043c){if(_0x50043c){return _0x50043c[_0x00d1('0x56')](_0x538487[_0x00d1('0x50')][_0x00d1('0x57')],_[_0x00d1('0x58')](_0x538487[_0x00d1('0x50')],[_0x00d1('0x57'),'id'])||{});}})[_0x00d1('0x2c')](respondWithResult(_0x4d5c7c,null))[_0x00d1('0x4a')](handleError(_0x4d5c7c,null));};exports[_0x00d1('0x59')]=function(_0x4b4e9f,_0x562ec4,_0x488ee1){var _0xfac775={};var _0x1b3874={};var _0x28da28;var _0x58a503;return db[_0x00d1('0x33')][_0x00d1('0x5a')]({'where':{'id':_0x4b4e9f[_0x00d1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x562ec4,null))[_0x00d1('0x2c')](function(_0x4428b3){if(_0x4428b3){_0x28da28=_0x4428b3;_0x1b3874['model']=_['keys'](db[_0x00d1('0x5b')][_0x00d1('0x34')]);_0x1b3874[_0x00d1('0x3a')]=_[_0x00d1('0x3b')](_0x4b4e9f[_0x00d1('0x3a')]);_0x1b3874[_0x00d1('0x3c')]=_['intersection'](_0x1b3874[_0x00d1('0x38')],_0x1b3874[_0x00d1('0x3a')]);_0xfac775['attributes']=_[_0x00d1('0x3d')](_0x1b3874[_0x00d1('0x38')],qs[_0x00d1('0x3f')](_0x4b4e9f[_0x00d1('0x3a')][_0x00d1('0x3f')]));_0xfac775['attributes']=_0xfac775[_0x00d1('0x3e')][_0x00d1('0x40')]?_0xfac775[_0x00d1('0x3e')]:_0x1b3874[_0x00d1('0x38')];_0xfac775[_0x00d1('0x43')]=qs[_0x00d1('0x5c')](_0x4b4e9f[_0x00d1('0x3a')][_0x00d1('0x5c')]);_0xfac775['where']=qs[_0x00d1('0x3c')](_['pick'](_0x4b4e9f['query'],_0x1b3874['filters']));if(_0x4b4e9f['query'][_0x00d1('0x45')]){_0xfac775[_0x00d1('0x44')]=_['merge'](_0xfac775['where'],{'$or':_[_0x00d1('0x39')](_0xfac775[_0x00d1('0x3e')],function(_0x5cb843){var _0x3d02b9={};_0x3d02b9[_0x5cb843]={'$like':'%'+_0x4b4e9f[_0x00d1('0x3a')]['filter']+'%'};return _0x3d02b9;})});}_0xfac775=_[_0x00d1('0x46')]({},_0xfac775,_0x4b4e9f[_0x00d1('0x4e')]);return _0x28da28['getMembers'](_0xfac775);}})['then'](function(_0x3041dd){if(_0x3041dd){_0x58a503=_0x3041dd[_0x00d1('0x40')];if(!_0x4b4e9f['query'][_0x00d1('0x41')](_0x00d1('0x42'))){_0xfac775[_0x00d1('0x27')]=qs[_0x00d1('0x27')](_0x4b4e9f['query'][_0x00d1('0x27')]);_0xfac775['offset']=qs[_0x00d1('0x26')](_0x4b4e9f[_0x00d1('0x3a')][_0x00d1('0x26')]);}return _0x28da28[_0x00d1('0x59')](_0xfac775);}})['then'](function(_0x116be1){if(_0x116be1){return _0x116be1?{'count':_0x58a503,'rows':_0x116be1}:null;}})[_0x00d1('0x2c')](respondWithResult(_0x562ec4,null))[_0x00d1('0x4a')](handleError(_0x562ec4,null));};exports['removeMembers']=function(_0x5d3f10,_0x503bdd,_0x493e80){return db[_0x00d1('0x33')][_0x00d1('0x4f')]({'where':{'id':_0x5d3f10[_0x00d1('0x4c')]['id']}})[_0x00d1('0x2c')](handleEntityNotFound(_0x503bdd,null))['then'](function(_0x2b5f96){if(_0x2b5f96){return _0x2b5f96[_0x00d1('0x5d')](_0x5d3f10[_0x00d1('0x3a')][_0x00d1('0x57')]);}})['then'](respondWithStatusCode(_0x503bdd,null))[_0x00d1('0x4a')](handleError(_0x503bdd,null));};exports[_0x00d1('0x5e')]=function(_0x70087,_0x59cd1d,_0x4291c0){if(_0x70087[_0x00d1('0x50')]['id']){delete _0x70087[_0x00d1('0x50')]['id'];}return db['ChatGroup'][_0x00d1('0x4f')]({'where':{'id':_0x70087[_0x00d1('0x4c')]['id']}})[_0x00d1('0x2c')](handleEntityNotFound(_0x59cd1d,null))[_0x00d1('0x2c')](function(_0x3a9423){if(_0x3a9423){_0x70087[_0x00d1('0x50')]['ChatGroupId']=_0x3a9423['id'];return db[_0x00d1('0x53')][_0x00d1('0x5f')](_0x70087[_0x00d1('0x50')]);}})['then'](respondWithResult(_0x59cd1d,null))[_0x00d1('0x4a')](handleError(_0x59cd1d,null));};exports[_0x00d1('0x60')]=function(_0x4de32a,_0x3445ec,_0x447ea3){var _0x265319={};var _0x5756fa={};var _0xdb38fa;var _0x5ed073;return db[_0x00d1('0x33')][_0x00d1('0x5a')]({'where':{'id':_0x4de32a[_0x00d1('0x4c')]['id']}})[_0x00d1('0x2c')](handleEntityNotFound(_0x3445ec,null))['then'](function(_0x233bda){if(_0x233bda){_0xdb38fa=_0x233bda;_0x5756fa[_0x00d1('0x38')]=_[_0x00d1('0x3b')](db[_0x00d1('0x53')][_0x00d1('0x34')]);_0x5756fa[_0x00d1('0x3a')]=_[_0x00d1('0x3b')](_0x4de32a[_0x00d1('0x3a')]);_0x5756fa[_0x00d1('0x3c')]=_['intersection'](_0x5756fa['model'],_0x5756fa[_0x00d1('0x3a')]);_0x265319[_0x00d1('0x3e')]=_[_0x00d1('0x3d')](_0x5756fa[_0x00d1('0x38')],qs[_0x00d1('0x3f')](_0x4de32a[_0x00d1('0x3a')][_0x00d1('0x3f')]));_0x265319[_0x00d1('0x3e')]=_0x265319['attributes'][_0x00d1('0x40')]?_0x265319[_0x00d1('0x3e')]:_0x5756fa[_0x00d1('0x38')];_0x265319[_0x00d1('0x43')]=qs[_0x00d1('0x5c')](_0x4de32a['query'][_0x00d1('0x5c')]);_0x265319[_0x00d1('0x44')]=qs['filters'](_[_0x00d1('0x61')](_0x4de32a['query'],_0x5756fa[_0x00d1('0x3c')]));if(_0x4de32a[_0x00d1('0x3a')][_0x00d1('0x45')]){_0x265319['where']=_[_0x00d1('0x46')](_0x265319['where'],{'$or':_[_0x00d1('0x39')](_0x265319[_0x00d1('0x3e')],function(_0x4f1a6c){var _0x220c2f={};_0x220c2f[_0x4f1a6c]={'$like':'%'+_0x4de32a[_0x00d1('0x3a')]['filter']+'%'};return _0x220c2f;})});}if(_0x4de32a['query']['$gte']){var _0x2f4474=_0x4de32a['query'][_0x00d1('0x62')][_0x00d1('0x63')](',');var _0x35c5a3={};_0x35c5a3[_0x2f4474[0x0]]={'$gte':moment(_0x2f4474[0x1])[_0x00d1('0x64')]('YYYY-MM-DD\x20HH:mm:ss')};_0x265319['where']=_[_0x00d1('0x46')](_0x265319[_0x00d1('0x44')],_0x35c5a3);}_0x265319=_[_0x00d1('0x46')]({},_0x265319,_0x4de32a['options']);return _0xdb38fa['getMessages'](_0x265319);}})['then'](function(_0x3d09b3){if(_0x3d09b3){_0x5ed073=_0x3d09b3[_0x00d1('0x40')];if(!_0x4de32a[_0x00d1('0x3a')][_0x00d1('0x41')](_0x00d1('0x42'))){_0x265319[_0x00d1('0x27')]=qs[_0x00d1('0x27')](_0x4de32a[_0x00d1('0x3a')][_0x00d1('0x27')]);_0x265319[_0x00d1('0x26')]=qs['offset'](_0x4de32a['query']['offset']);}return _0xdb38fa[_0x00d1('0x60')](_0x265319);}})[_0x00d1('0x2c')](function(_0x5a41ee){if(_0x5a41ee){return _0x5a41ee?{'count':_0x5ed073,'rows':_0x5a41ee}:null;}})[_0x00d1('0x2c')](respondWithResult(_0x3445ec,null))['catch'](handleError(_0x3445ec,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f660164..4514976 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 _0x8f9d=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x503001,_0xda3ab0){var _0x12698e=function(_0xbca36b){while(--_0xbca36b){_0x503001['push'](_0x503001['shift']());}};_0x12698e(++_0xda3ab0);}(_0x8f9d,0x1d6));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xd8f9('0x0'));var ChatGroup=require(_0xd8f9('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd8f9('0x2')](0x0);var events={'afterCreate':_0xd8f9('0x3'),'afterUpdate':'update','afterDestroy':_0xd8f9('0x4')};function emitEvent(_0x34e979){return function(_0x4326d5,_0x3f25b4,_0x5053cf){ChatGroupEvents[_0xd8f9('0x5')](_0x34e979+':'+_0x4326d5['id'],_0x4326d5);ChatGroupEvents[_0xd8f9('0x5')](_0x34e979,_0x4326d5);_0x5053cf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xd8f9('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0xcb22=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xcb22,0xc8));var _0x2cb2=function(_0x599b44,_0x4618ef){_0x599b44=_0x599b44-0x0;var _0x39a243=_0xcb22[_0x599b44];return _0x39a243;};'use strict';var EventEmitter=require(_0x2cb2('0x0'));var ChatGroup=require(_0x2cb2('0x1'))['db'][_0x2cb2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2cb2('0x3')](0x0);var events={'afterCreate':_0x2cb2('0x4'),'afterUpdate':_0x2cb2('0x5'),'afterDestroy':_0x2cb2('0x6')};function emitEvent(_0xe763ff){return function(_0x386f8b,_0x3b1af5,_0x3dec93){ChatGroupEvents['emit'](_0xe763ff+':'+_0x386f8b['id'],_0x386f8b);ChatGroupEvents[_0x2cb2('0x7')](_0xe763ff,_0x386f8b);_0x3dec93(null);};}for(var e in events){if(events[_0x2cb2('0x8')](e)){var event=events[e];ChatGroup[_0x2cb2('0x9')](e,emitEvent(event));}}module[_0x2cb2('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 31bc636..de5f313 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 _0x4d85=['util','moment','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x15b3dc,_0x465a22){var _0x4feb05=function(_0x2e01e5){while(--_0x2e01e5){_0x15b3dc['push'](_0x15b3dc['shift']());}};_0x4feb05(++_0x465a22);}(_0x4d85,0x144));var _0x54d8=function(_0x5b1c9c,_0x47981a){_0x5b1c9c=_0x5b1c9c-0x0;var _0x977fd3=_0x4d85[_0x5b1c9c];return _0x977fd3;};'use strict';var _=require('lodash');var util=require(_0x54d8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x54d8('0x1'));var BPromise=require('bluebird');var rp=require(_0x54d8('0x2'));var fs=require('fs');var path=require(_0x54d8('0x3'));var rimraf=require(_0x54d8('0x4'));var config=require('../../config/environment');var attributes=require(_0x54d8('0x5'));module[_0x54d8('0x6')]=function(_0x6c6252,_0x38500){return _0x6c6252[_0x54d8('0x7')](_0x54d8('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9599=['moment','request-promise','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api'];(function(_0x3c9159,_0x58f463){var _0x3a6f26=function(_0x57c4f7){while(--_0x57c4f7){_0x3c9159['push'](_0x3c9159['shift']());}};_0x3a6f26(++_0x58f463);}(_0x9599,0x1b4));var _0x9959=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0x9599[_0x8fa4bc];return _0x35b6a7;};'use strict';var _=require(_0x9959('0x0'));var util=require(_0x9959('0x1'));var logger=require(_0x9959('0x2'))(_0x9959('0x3'));var moment=require(_0x9959('0x4'));var BPromise=require('bluebird');var rp=require(_0x9959('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9959('0x6'));var attributes=require(_0x9959('0x7'));module[_0x9959('0x8')]=function(_0x3d2344,_0x3620be){return _0x3d2344['define'](_0x9959('0x9'),attributes,{'tableName':_0x9959('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 6d69777..d89f374 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 _0x45aa=['redis','defaults','socket.io-emitter','./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x52bb1e,_0x47c818){var _0x15d57d=function(_0x551cd3){while(--_0x551cd3){_0x52bb1e['push'](_0x52bb1e['shift']());}};_0x15d57d(++_0x47c818);}(_0x45aa,0xdf));var _0xa45a=function(_0x4ca1b8,_0x9faad5){_0x4ca1b8=_0x4ca1b8-0x0;var _0x49b9e4=_0x45aa[_0x4ca1b8];return _0x49b9e4;};'use strict';var _=require('lodash');var util=require(_0xa45a('0x0'));var moment=require(_0xa45a('0x1'));var BPromise=require(_0xa45a('0x2'));var rs=require(_0xa45a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa45a('0x4'))['db'];var utils=require(_0xa45a('0x5'));var logger=require(_0xa45a('0x6'))(_0xa45a('0x7'));var config=require(_0xa45a('0x8'));var jayson=require(_0xa45a('0x9'));var client=jayson[_0xa45a('0xa')]['http']({'port':0x232a});config[_0xa45a('0xb')]=_[_0xa45a('0xc')](config[_0xa45a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa45a('0xd'))(new Redis(config[_0xa45a('0xb')]));require(_0xa45a('0xe'))['register'](socket);function respondWithRpcPromise(_0xa23a80,_0x192214,_0x3bf4b7){return new BPromise(function(_0x38477f,_0x498497){return client['request'](_0xa23a80,_0x3bf4b7)[_0xa45a('0xf')](function(_0x21d270){logger[_0xa45a('0x10')](_0xa45a('0x11'),_0x192214,_0xa45a('0x12'));logger[_0xa45a('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x192214,_0xa45a('0x12'),JSON[_0xa45a('0x14')](_0x21d270));if(_0x21d270[_0xa45a('0x15')]){if(_0x21d270['error'][_0xa45a('0x16')]===0x1f4){logger['error'](_0xa45a('0x11'),_0x192214,_0x21d270['error'][_0xa45a('0x17')]);return _0x498497(_0x21d270[_0xa45a('0x15')][_0xa45a('0x17')]);}logger['error'](_0xa45a('0x11'),_0x192214,_0x21d270['error'][_0xa45a('0x17')]);return _0x38477f(_0x21d270['error'][_0xa45a('0x17')]);}else{logger[_0xa45a('0x10')](_0xa45a('0x11'),_0x192214,_0xa45a('0x12'));_0x38477f(_0x21d270[_0xa45a('0x18')]['message']);}})[_0xa45a('0x19')](function(_0x4c7726){logger[_0xa45a('0x15')](_0xa45a('0x11'),_0x192214,_0x4c7726);_0x498497(_0x4c7726);});});} \ No newline at end of file +var _0x8a8b=['stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x8a8b,0xae));var _0xb8a8=function(_0x1966a2,_0x3cff3a){_0x1966a2=_0x1966a2-0x0;var _0x362bd4=_0x8a8b[_0x1966a2];return _0x362bd4;};'use strict';var _=require(_0xb8a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb8a8('0x1'));var rs=require(_0xb8a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8a8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8a8('0x4'))('rpc');var config=require(_0xb8a8('0x5'));var jayson=require(_0xb8a8('0x6'));var client=jayson[_0xb8a8('0x7')]['http']({'port':0x232a});config[_0xb8a8('0x8')]=_['defaults'](config[_0xb8a8('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8a8('0x9'))(new Redis(config[_0xb8a8('0x8')]));require(_0xb8a8('0xa'))['register'](socket);function respondWithRpcPromise(_0x3f8726,_0x371785,_0x44e60f){return new BPromise(function(_0x2a0bfd,_0x3ea7ad){return client[_0xb8a8('0xb')](_0x3f8726,_0x44e60f)[_0xb8a8('0xc')](function(_0x1deeac){logger[_0xb8a8('0xd')](_0xb8a8('0xe'),_0x371785,_0xb8a8('0xf'));logger[_0xb8a8('0x10')](_0xb8a8('0x11'),_0x371785,'request\x20sent',JSON[_0xb8a8('0x12')](_0x1deeac));if(_0x1deeac[_0xb8a8('0x13')]){if(_0x1deeac[_0xb8a8('0x13')][_0xb8a8('0x14')]===0x1f4){logger[_0xb8a8('0x13')](_0xb8a8('0xe'),_0x371785,_0x1deeac[_0xb8a8('0x13')][_0xb8a8('0x15')]);return _0x3ea7ad(_0x1deeac[_0xb8a8('0x13')][_0xb8a8('0x15')]);}logger[_0xb8a8('0x13')]('ChatGroup,\x20%s,\x20%s',_0x371785,_0x1deeac[_0xb8a8('0x13')]['message']);return _0x2a0bfd(_0x1deeac[_0xb8a8('0x13')][_0xb8a8('0x15')]);}else{logger[_0xb8a8('0xd')](_0xb8a8('0xe'),_0x371785,_0xb8a8('0xf'));_0x2a0bfd(_0x1deeac[_0xb8a8('0x16')][_0xb8a8('0x15')]);}})[_0xb8a8('0x17')](function(_0x5f0164){logger['error'](_0xb8a8('0xe'),_0x371785,_0x5f0164);_0x3ea7ad(_0x5f0164);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 1f138e7..e837f96 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 _0x4088=['register','length','chatGroup:','./chatGroup.events','save','remove','removeListener'];(function(_0x24d005,_0x154bac){var _0x484073=function(_0x263815){while(--_0x263815){_0x24d005['push'](_0x24d005['shift']());}};_0x484073(++_0x154bac);}(_0x4088,0x1d1));var _0x8408=function(_0x27a8a9,_0x2a2b4d){_0x27a8a9=_0x27a8a9-0x0;var _0x8da759=_0x4088[_0x27a8a9];return _0x8da759;};'use strict';var ChatGroupEvents=require(_0x8408('0x0'));var events=[_0x8408('0x1'),_0x8408('0x2'),'update'];function createListener(_0x53e750,_0x53e366){return function(_0x9cc3b6){_0x53e366['emit'](_0x53e750,_0x9cc3b6);};}function removeListener(_0x43661b,_0x4db0f3){return function(){ChatGroupEvents[_0x8408('0x3')](_0x43661b,_0x4db0f3);};}exports[_0x8408('0x4')]=function(_0x2249f9){for(var _0x85133f=0x0,_0x5136a3=events[_0x8408('0x5')];_0x85133f<_0x5136a3;_0x85133f++){var _0x4eef95=events[_0x85133f];var _0x231ca6=createListener(_0x8408('0x6')+_0x4eef95,_0x2249f9);ChatGroupEvents['on'](_0x4eef95,_0x231ca6);}}; \ No newline at end of file +var _0xe59b=['removeListener','length','./chatGroup.events','save','update','emit'];(function(_0x4d6635,_0x382541){var _0x49e280=function(_0xc2a72a){while(--_0xc2a72a){_0x4d6635['push'](_0x4d6635['shift']());}};_0x49e280(++_0x382541);}(_0xe59b,0xd4));var _0xbe59=function(_0x2030e6,_0xa25821){_0x2030e6=_0x2030e6-0x0;var _0x1350b5=_0xe59b[_0x2030e6];return _0x1350b5;};'use strict';var ChatGroupEvents=require(_0xbe59('0x0'));var events=[_0xbe59('0x1'),'remove',_0xbe59('0x2')];function createListener(_0x36725b,_0x2caa43){return function(_0x1ca2a3){_0x2caa43[_0xbe59('0x3')](_0x36725b,_0x1ca2a3);};}function removeListener(_0x229fca,_0x3306d7){return function(){ChatGroupEvents[_0xbe59('0x4')](_0x229fca,_0x3306d7);};}exports['register']=function(_0x4425d3){for(var _0x3992a9=0x0,_0x3f5792=events[_0xbe59('0x5')];_0x3992a9<_0x3f5792;_0x3992a9++){var _0x3e8508=events[_0x3992a9];var _0x1c1de8=createListener('chatGroup:'+_0x3e8508,_0x4425d3);ChatGroupEvents['on'](_0x3e8508,_0x1c1de8);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 6c5d563..75b9c87 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 _0xa1dc=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util'];(function(_0x2606d9,_0x9cef68){var _0x4ad6c6=function(_0x4468ac){while(--_0x4468ac){_0x2606d9['push'](_0x2606d9['shift']());}};_0x4ad6c6(++_0x9cef68);}(_0xa1dc,0xac));var _0xca1d=function(_0x4be01b,_0xce574e){_0x4be01b=_0x4be01b-0x0;var _0x50450b=_0xa1dc[_0x4be01b];return _0x50450b;};'use strict';var multer=require(_0xca1d('0x0'));var util=require(_0xca1d('0x1'));var path=require(_0xca1d('0x2'));var timeout=require('connect-timeout');var express=require(_0xca1d('0x3'));var router=express[_0xca1d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca1d('0x5'));var interaction=require(_0xca1d('0x6'));var config=require(_0xca1d('0x7'));var controller=require(_0xca1d('0x8'));router[_0xca1d('0x9')]('/',auth[_0xca1d('0xa')](),controller['index']);router[_0xca1d('0x9')]('/describe',auth[_0xca1d('0xa')](),controller[_0xca1d('0xb')]);router[_0xca1d('0x9')](_0xca1d('0xc'),auth['isAuthenticated'](),controller[_0xca1d('0xd')]);router[_0xca1d('0x9')](_0xca1d('0xe'),auth['isAuthenticated'](),controller[_0xca1d('0xf')]);router[_0xca1d('0x9')](_0xca1d('0x10'),auth['isAuthenticated'](),controller[_0xca1d('0x11')]);router[_0xca1d('0x9')](_0xca1d('0x12'),auth['isAuthenticated'](),controller[_0xca1d('0x13')]);router[_0xca1d('0x14')]('/',auth[_0xca1d('0xa')](),controller[_0xca1d('0x15')]);router['post']('/:id/members',auth['isAuthenticated'](),controller[_0xca1d('0x16')]);router[_0xca1d('0x14')](_0xca1d('0x12'),auth[_0xca1d('0xa')](),controller[_0xca1d('0x17')]);router['put'](_0xca1d('0xc'),auth[_0xca1d('0xa')](),controller[_0xca1d('0x18')]);router[_0xca1d('0x19')](_0xca1d('0xc'),auth['isAuthenticated'](),controller[_0xca1d('0x1a')]);router[_0xca1d('0x19')](_0xca1d('0x10'),auth[_0xca1d('0xa')](),controller[_0xca1d('0x1b')]);module[_0xca1d('0x1c')]=router; \ No newline at end of file +var _0xa85a=['addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create'];(function(_0x4bdef7,_0x22cd1b){var _0x574922=function(_0x5d2bae){while(--_0x5d2bae){_0x4bdef7['push'](_0x4bdef7['shift']());}};_0x574922(++_0x22cd1b);}(_0xa85a,0x89));var _0xaa85=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xa85a[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0xaa85('0x0'));var util=require('util');var path=require(_0xaa85('0x1'));var timeout=require('connect-timeout');var express=require(_0xaa85('0x2'));var router=express[_0xaa85('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaa85('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaa85('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xaa85('0x6')](),controller['index']);router['get'](_0xaa85('0x7'),auth['isAuthenticated'](),controller[_0xaa85('0x8')]);router[_0xaa85('0x9')](_0xaa85('0xa'),auth['isAuthenticated'](),controller[_0xaa85('0xb')]);router[_0xaa85('0x9')](_0xaa85('0xc'),auth['isAuthenticated'](),controller[_0xaa85('0xd')]);router[_0xaa85('0x9')](_0xaa85('0xe'),auth[_0xaa85('0x6')](),controller['getMembers']);router[_0xaa85('0x9')](_0xaa85('0xf'),auth['isAuthenticated'](),controller[_0xaa85('0x10')]);router[_0xaa85('0x11')]('/',auth[_0xaa85('0x6')](),controller[_0xaa85('0x12')]);router[_0xaa85('0x11')](_0xaa85('0xe'),auth[_0xaa85('0x6')](),controller[_0xaa85('0x13')]);router[_0xaa85('0x11')]('/:id/messages',auth[_0xaa85('0x6')](),controller[_0xaa85('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaa85('0x15')]);router[_0xaa85('0x16')](_0xaa85('0xa'),auth['isAuthenticated'](),controller[_0xaa85('0x17')]);router[_0xaa85('0x16')](_0xaa85('0xe'),auth[_0xaa85('0x6')](),controller[_0xaa85('0x18')]);module[_0xaa85('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 2ebf1a2..108c545 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 _0xea28=['thumb','TEXT','STRING','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0x2221f3,_0x6b4f0e){var _0x4f2e42=function(_0x5ea34f){while(--_0x5ea34f){_0x2221f3['push'](_0x2221f3['shift']());}};_0x4f2e42(++_0x6b4f0e);}(_0xea28,0x13a));var _0x8ea2=function(_0x39c662,_0x2cf841){_0x39c662=_0x39c662-0x0;var _0x1d1719=_0xea28[_0x39c662];return _0x1d1719;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'closed':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8ea2('0x3')]},'ratingType':{'type':Sequelize[_0x8ea2('0x4')](_0x8ea2('0x5'),_0x8ea2('0x6')),'defaultValue':_0x8ea2('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x8ea2('0x7')]},'mailTranscript':{'type':Sequelize[_0x8ea2('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8ea2('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8ea2('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8ea2('0x8')]},'note':{'type':Sequelize[_0x8ea2('0x8')]},'browserName':{'type':Sequelize[_0x8ea2('0x8')]},'browserVersion':{'type':Sequelize[_0x8ea2('0x8')]},'osName':{'type':Sequelize[_0x8ea2('0x8')]},'osVersion':{'type':Sequelize[_0x8ea2('0x8')]},'deviceModel':{'type':Sequelize[_0x8ea2('0x8')]},'deviceVendor':{'type':Sequelize[_0x8ea2('0x8')]},'deviceType':{'type':Sequelize[_0x8ea2('0x8')]},'referer':{'type':Sequelize[_0x8ea2('0x7')]},'customerIp':{'type':Sequelize[_0x8ea2('0x8')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x8ea2('0x9')]},'lastMsgAt':{'type':Sequelize[_0x8ea2('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x8ea2('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8ea2('0x8')]},'customerPort':{'type':Sequelize[_0x8ea2('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x8ea2('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6e6c=['ENUM','star','TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x2c0ab9,_0xee6293){var _0x5a7415=function(_0x5a3b14){while(--_0x5a3b14){_0x2c0ab9['push'](_0x2c0ab9['shift']());}};_0x5a7415(++_0xee6293);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc6e6('0x2')]},'ratingType':{'type':Sequelize[_0xc6e6('0x3')]('star','thumb'),'defaultValue':_0xc6e6('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xc6e6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc6e6('0x6')]},'disposition':{'type':Sequelize[_0xc6e6('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc6e6('0x7')]},'note':{'type':Sequelize[_0xc6e6('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xc6e6('0x7')]},'osName':{'type':Sequelize[_0xc6e6('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xc6e6('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xc6e6('0x7')]},'referer':{'type':Sequelize[_0xc6e6('0x5')]},'customerIp':{'type':Sequelize[_0xc6e6('0x7')]},'formData':{'type':Sequelize[_0xc6e6('0x5')](_0xc6e6('0x8'))},'read1stAt':{'type':Sequelize[_0xc6e6('0x6')]},'lastMsgAt':{'type':Sequelize[_0xc6e6('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xc6e6('0x3')]('in',_0xc6e6('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xc6e6('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xc6e6('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 8b68304..89d3b75 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 _0xacc5=['join','format','now','pathTranscript','ChatWebsiteId','ContactId','Messages','UserId','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','User','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','pick','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','ChatInteractionId','filter','includeAgent','push','alias','addTags','setTags','Tag','color','emit','removeTags','unix','toString','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','read','Account','Owner','get','N.A.','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','download','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','update','destroy','then','stack','name','send','render','merge','contact','interaction','account','index','map','rawAttributes','key','getOptions','findAll','chat','query','catch','show','params','model','keys','ChatInteraction','filters','intersection','fields','attributes','length','includeAll','include','options','create','body','find','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacc5,0x12d));var _0x5acc=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xacc5[_0x2c91e9];return _0x13f0ff;};'use strict';var rimraf=require(_0x5acc('0x0'));var zipdir=require('zip-dir');var rp=require(_0x5acc('0x1'));var moment=require(_0x5acc('0x2'));var BPromise=require(_0x5acc('0x3'));var Mustache=require(_0x5acc('0x4'));var util=require(_0x5acc('0x5'));var path=require(_0x5acc('0x6'));var ejs=require(_0x5acc('0x7'));var fs=require('fs');var _=require(_0x5acc('0x8'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x5acc('0x9'));var pdf=require(_0x5acc('0xa'));var logger=require(_0x5acc('0xb'))(_0x5acc('0xc'));var config=require(_0x5acc('0xd'));var db=require(_0x5acc('0xe'))['db'];config['redis']=_[_0x5acc('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5acc('0x10'))(new Redis(config[_0x5acc('0x11')]));require(_0x5acc('0x12'))[_0x5acc('0x13')](socket);var jayson=require(_0x5acc('0x14'));var client=jayson[_0x5acc('0x15')][_0x5acc('0x16')]({'port':0x232b});var client9004=jayson[_0x5acc('0x15')][_0x5acc('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x566a9b,_0x243f86,_0x35021f,_0x32e2a2){return new BPromise(function(_0x4d966d,_0x3f5c52){var _0x33418c=_0x32e2a2||client;return _0x33418c['request'](_0x566a9b,_0x35021f)['then'](function(_0x11380b){logger[_0x5acc('0x17')](_0x5acc('0x18'),_0x243f86,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x243f86,_0x5acc('0x19'),JSON['stringify'](_0x11380b));if(_0x11380b[_0x5acc('0x1a')]){if(_0x11380b['error'][_0x5acc('0x1b')]===0x1f4){logger[_0x5acc('0x1a')](_0x5acc('0x18'),_0x243f86,_0x11380b[_0x5acc('0x1a')][_0x5acc('0x1c')]);return _0x3f5c52(_0x11380b[_0x5acc('0x1a')][_0x5acc('0x1c')]);}logger[_0x5acc('0x1a')](_0x5acc('0x18'),_0x243f86,_0x11380b[_0x5acc('0x1a')][_0x5acc('0x1c')]);return _0x4d966d(_0x11380b[_0x5acc('0x1a')][_0x5acc('0x1c')]);}else{logger[_0x5acc('0x17')](_0x5acc('0x18'),_0x243f86,_0x5acc('0x19'));_0x4d966d(_0x11380b[_0x5acc('0x1d')][_0x5acc('0x1c')]);}})['catch'](function(_0x183660){logger[_0x5acc('0x1a')](_0x5acc('0x18'),_0x243f86,_0x183660);_0x3f5c52(_0x183660);});});}function respondWithStatusCode(_0x4ce084,_0xd1d14e){_0xd1d14e=_0xd1d14e||0xcc;return function(_0x29a96c){if(_0x29a96c){return _0x4ce084[_0x5acc('0x1e')](_0xd1d14e);}return _0x4ce084['status'](_0xd1d14e)[_0x5acc('0x1f')]();};}function respondWithResult(_0x23fbc0,_0x34519f){_0x34519f=_0x34519f||0xc8;return function(_0x280e21){if(_0x280e21){return _0x23fbc0[_0x5acc('0x20')](_0x34519f)[_0x5acc('0x21')](_0x280e21);}};}function respondWithFilteredResult(_0x5a182e,_0x42d0f1){return function(_0x436206){if(_0x436206){var _0x2b17ac=typeof _0x42d0f1['offset']===_0x5acc('0x22')&&typeof _0x42d0f1[_0x5acc('0x23')]===_0x5acc('0x22');var _0x2acde4=_0x436206[_0x5acc('0x24')];var _0x2225b4=_0x2b17ac?0x0:_0x42d0f1[_0x5acc('0x25')];var _0x485929=_0x2b17ac?_0x436206[_0x5acc('0x24')]:_0x42d0f1['offset']+_0x42d0f1[_0x5acc('0x23')];var _0x487cf7;if(_0x485929>=_0x2acde4){_0x485929=_0x2acde4;_0x487cf7=0xc8;}else{_0x487cf7=0xce;}_0x5a182e[_0x5acc('0x20')](_0x487cf7);return _0x5a182e[_0x5acc('0x26')]('Content-Range',_0x2225b4+'-'+_0x485929+'/'+_0x2acde4)['json'](_0x436206);}return null;};}function saveUpdates(_0xb3d5ef){return function(_0x46814){if(_0x46814){return _0x46814[_0x5acc('0x27')](_0xb3d5ef)['then'](function(_0x131a56){return _0x131a56;});}return null;};}function removeEntity(_0x323d1c){return function(_0x29d9d5){if(_0x29d9d5){return _0x29d9d5[_0x5acc('0x28')]()[_0x5acc('0x29')](function(){_0x323d1c[_0x5acc('0x20')](0xcc)[_0x5acc('0x1f')]();});}};}function handleEntityNotFound(_0x44febb){return function(_0xb394dd){if(!_0xb394dd){_0x44febb['sendStatus'](0x194);}return _0xb394dd;};}function handleError(_0x33df9e,_0xa927af){_0xa927af=_0xa927af||0x1f4;return function(_0x2ce6af){logger[_0x5acc('0x1a')](_0x2ce6af[_0x5acc('0x2a')]);if(_0x2ce6af['name']){delete _0x2ce6af[_0x5acc('0x2b')];}_0x33df9e[_0x5acc('0x20')](_0xa927af)[_0x5acc('0x2c')](_0x2ce6af);};}function getMustacheRender(_0x222303,_0x1bbaaa){return Mustache[_0x5acc('0x2d')](_0x222303,_[_0x5acc('0x2e')](_0x1bbaaa['body'],{'contact':_0x1bbaaa[_0x5acc('0x2f')],'message':_0x1bbaaa['message'],'agent':_0x1bbaaa['agent'],'interaction':_0x1bbaaa[_0x5acc('0x30')],'account':_0x1bbaaa[_0x5acc('0x31')]}))||'';}exports[_0x5acc('0x32')]=function(_0x3c43fe,_0x477cc4){var _0x350303={};var _0x2aaf9e=_[_0x5acc('0x33')](db['ChatInteraction'][_0x5acc('0x34')],function(_0x13c0dc){return{'name':_0x13c0dc['fieldName'],'type':_0x13c0dc['type'][_0x5acc('0x35')]};});_0x350303=qs[_0x5acc('0x36')](_0x2aaf9e,_0x3c43fe);return interaction[_0x5acc('0x37')](_0x5acc('0x38'),_0x3c43fe[_0x5acc('0x39')],_0x3c43fe['user'],_0x350303,_0x2aaf9e)['then'](respondWithFilteredResult(_0x477cc4,_0x350303))[_0x5acc('0x3a')](handleError(_0x477cc4,null));};exports[_0x5acc('0x3b')]=function(_0x5b4a4e,_0x21debc){var _0x32592d={'raw':![],'where':{'id':_0x5b4a4e[_0x5acc('0x3c')]['id']}},_0xd935e0={};_0xd935e0[_0x5acc('0x3d')]=_[_0x5acc('0x3e')](db[_0x5acc('0x3f')][_0x5acc('0x34')]);_0xd935e0[_0x5acc('0x39')]=_[_0x5acc('0x3e')](_0x5b4a4e[_0x5acc('0x39')]);_0xd935e0[_0x5acc('0x40')]=_[_0x5acc('0x41')](_0xd935e0[_0x5acc('0x3d')],_0xd935e0['query']);_0x32592d['attributes']=_[_0x5acc('0x41')](_0xd935e0['model'],qs[_0x5acc('0x42')](_0x5b4a4e['query'][_0x5acc('0x42')]));_0x32592d[_0x5acc('0x43')]=_0x32592d[_0x5acc('0x43')][_0x5acc('0x44')]?_0x32592d[_0x5acc('0x43')]:_0xd935e0[_0x5acc('0x3d')];if(_0x5b4a4e[_0x5acc('0x39')][_0x5acc('0x45')]){_0x32592d[_0x5acc('0x46')]=[{'all':!![]}];}_0x32592d=_[_0x5acc('0x2e')]({},_0x32592d,_0x5b4a4e[_0x5acc('0x47')]);return db[_0x5acc('0x3f')]['find'](_0x32592d)[_0x5acc('0x29')](handleEntityNotFound(_0x21debc,null))[_0x5acc('0x29')](respondWithResult(_0x21debc,null))[_0x5acc('0x3a')](handleError(_0x21debc,null));};exports[_0x5acc('0x48')]=function(_0x25677b,_0x46c719){return db[_0x5acc('0x3f')][_0x5acc('0x48')](_0x25677b[_0x5acc('0x49')],{})[_0x5acc('0x29')](respondWithResult(_0x46c719,0xc9))[_0x5acc('0x3a')](handleError(_0x46c719,null));};exports[_0x5acc('0x27')]=function(_0xeb72ba,_0x4b827e){if(_0xeb72ba[_0x5acc('0x49')]['id']){delete _0xeb72ba[_0x5acc('0x49')]['id'];}return db[_0x5acc('0x3f')][_0x5acc('0x4a')]({'where':{'id':_0xeb72ba[_0x5acc('0x3c')]['id']}})[_0x5acc('0x29')](handleEntityNotFound(_0x4b827e,null))[_0x5acc('0x29')](saveUpdates(_0xeb72ba[_0x5acc('0x49')],null))[_0x5acc('0x29')](respondWithResult(_0x4b827e,null))[_0x5acc('0x3a')](handleError(_0x4b827e,null));};exports['destroy']=function(_0x2217b7,_0x34dc3f){return db[_0x5acc('0x3f')][_0x5acc('0x4a')]({'where':{'id':_0x2217b7['params']['id']}})[_0x5acc('0x29')](handleEntityNotFound(_0x34dc3f,null))[_0x5acc('0x29')](removeEntity(_0x34dc3f,null))[_0x5acc('0x3a')](handleError(_0x34dc3f,null));};exports[_0x5acc('0x4b')]=function(_0x538f5f,_0x469fd9){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x469fd9,null))['catch'](handleError(_0x469fd9,null));};exports[_0x5acc('0x4c')]=function(_0x315db4,_0x271542){var _0x30bf89=_0x315db4[_0x5acc('0x3c')]['id'];var _0x21083d;var _0x513109;var _0x38a2bc;return db[_0x5acc('0x3f')]['findOne']({'where':{'id':_0x30bf89}})['then'](function(_0x2d667a){_0x21083d=_0x2d667a;return db[_0x5acc('0x4d')][_0x5acc('0x4e')]({'where':{'id':_0x2d667a['ChatWebsiteId']},'attributes':['id',_0x5acc('0x4f'),_0x5acc('0x50'),_0x5acc('0x51'),_0x5acc('0x52'),_0x5acc('0x53')],'raw':!![]});})[_0x5acc('0x29')](function(_0x593bdf){if(_0x593bdf&&_0x593bdf[_0x5acc('0x4f')]&&_0x593bdf[_0x5acc('0x50')]){_0x513109=_0x593bdf;var _0xb1672c={'interaction':{'id':_0x30bf89},'agent':{'id':_0x315db4[_0x5acc('0x54')]['id'],'name':_0x315db4[_0x5acc('0x54')]['name'],'fullname':_0x315db4[_0x5acc('0x54')][_0x5acc('0x55')],'email':_0x315db4[_0x5acc('0x54')][_0x5acc('0x56')]},'contact':_0x315db4['body'][_0x5acc('0x2f')],'account':_0x315db4[_0x5acc('0x49')][_0x5acc('0x31')]};var _0x3c1c59={'rejectUnauthorized':![],'method':'POST','url':_0x5acc('0x57'),'headers':{'X-APIKEY':_0x593bdf[_0x5acc('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x315db4[_0x5acc('0x54')]['email']],'buttons':null,'topic':_0x513109[_0x5acc('0x51')],'note':_[_0x5acc('0x58')](_0x513109[_0x5acc('0x52')])?null:getMustacheRender(_0x513109[_0x5acc('0x52')],_0xb1672c),'metadata':null},'redirect':_0x5acc('0x59'),'json':!![]};try{if(!_[_0x5acc('0x58')](_0x513109[_0x5acc('0x53')])){var _0xa52928=getMustacheRender(_0x513109['vidaooMetadata'],_0xb1672c);var _0x3893c4=JSON[_0x5acc('0x5a')](_0xa52928);_0x3c1c59[_0x5acc('0x49')][_0x5acc('0x5b')]=_0x3893c4;}}catch(_0x2410b2){throw new db[(_0x5acc('0x5c'))][(_0x5acc('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x3c1c59);}else{throw new db[(_0x5acc('0x5c'))][(_0x5acc('0x5d'))](_0x5acc('0x5e'));}})['then'](function(_0x1b9d4c){_0x38a2bc=_0x1b9d4c;if(_0x38a2bc['id']){var _0x6cdb73={'body':_0x38a2bc['join_url'],'ChatWebsiteId':_0x513109['id'],'ChatInteractionId':_0x21083d['id'],'direction':'out','UserId':_0x315db4[_0x5acc('0x54')]['id']};return db[_0x5acc('0x5f')]['create'](_0x6cdb73,{});}else{throw new db[(_0x5acc('0x5c'))]['ValidationError'](_0x5acc('0x60'));}})['then'](function(){return _0x21083d[_0x5acc('0x61')]({'vidaooSessionId':_0x38a2bc['id']});})[_0x5acc('0x29')](respondWithResult(_0x271542,null))[_0x5acc('0x3a')](handleError(_0x271542,null));};exports[_0x5acc('0x62')]=function(_0x3f75d7,_0x3866ec){if(_0x3f75d7['body']['id']){delete _0x3f75d7[_0x5acc('0x49')]['id'];}return db[_0x5acc('0x3f')][_0x5acc('0x4a')]({'where':{'id':_0x3f75d7[_0x5acc('0x3c')]['id']},'include':[{'model':db[_0x5acc('0x63')],'as':_0x5acc('0x64')}]})[_0x5acc('0x29')](handleEntityNotFound(_0x3866ec,null))[_0x5acc('0x29')](saveUpdates(_0x3f75d7[_0x5acc('0x49')],null))[_0x5acc('0x29')](respondWithResult(_0x3866ec,null))[_0x5acc('0x3a')](handleError(_0x3866ec,null));};exports[_0x5acc('0x65')]=function(_0x4cf25a,_0x5ec779){if(_0x4cf25a['body']['id']){delete _0x4cf25a[_0x5acc('0x49')]['id'];}return db[_0x5acc('0x3f')]['find']({'where':{'id':_0x4cf25a['params']['id']}})[_0x5acc('0x29')](function(_0x3fc432){if(!_0x3fc432){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x5acc('0x65'),0x194,'entity\x20not\x20found');_0x5ec779[_0x5acc('0x1e')](0x194);}else{if(_0x3fc432['UserId']){throw new db[(_0x5acc('0x5c'))]['ValidationError'](_0x5acc('0x66'));}}return _0x3fc432;})[_0x5acc('0x29')](function(_0x3e5112){if(_0x3e5112){return _0x3e5112[_0x5acc('0x27')]({'closed':_0x4cf25a[_0x5acc('0x49')][_0x5acc('0x67')],'disposition':_0x4cf25a[_0x5acc('0x49')][_0x5acc('0x68')]})['then'](function(_0x5bd2f3){return _0x5bd2f3;});}})[_0x5acc('0x29')](function(){return respondWithRpcPromise(_0x5acc('0x69'),'abandon',_0x4cf25a[_0x5acc('0x49')],client9004);})[_0x5acc('0x29')](respondWithResult(_0x5ec779,null))[_0x5acc('0x3a')](handleError(_0x5ec779,null));};exports['attachmentUpload']=function(_0x115eac,_0x375995){_0x115eac[_0x5acc('0x49')][_0x5acc('0x2b')]=_0x115eac['file']['originalname'];_0x115eac['body'][_0x5acc('0x6a')]=_0x115eac[_0x5acc('0x6b')][_0x5acc('0x6c')];_0x115eac['body']['type']=_0x115eac['file'][_0x5acc('0x6d')];return db[_0x5acc('0x6e')]['create'](_0x115eac['body'])[_0x5acc('0x29')](respondWithResult(_0x375995,0xc9))['catch'](handleError(_0x375995,null));};exports[_0x5acc('0x6f')]=function(_0x427abb,_0x51ee18){return db[_0x5acc('0x3f')]['findOne']({'where':{'id':_0x427abb['params']['id']},'raw':!![]})[_0x5acc('0x29')](handleEntityNotFound(_0x51ee18,null))[_0x5acc('0x29')](function(_0x436c0d){if(_0x436c0d){if(_0x436c0d[_0x5acc('0x67')]){return _0x51ee18[_0x5acc('0x20')](0x193)[_0x5acc('0x21')]({'status':0x193,'message':_0x5acc('0x70')});}return db[_0x5acc('0x6e')]['findOne']({'where':{'id':_0x427abb[_0x5acc('0x39')][_0x5acc('0x71')]},'raw':!![]})[_0x5acc('0x29')](handleEntityNotFound(_0x51ee18,null));}})[_0x5acc('0x29')](function(_0x8222b6){if(_0x8222b6){var _0x4de855=_0x8222b6[_0x5acc('0x72')]!==null;var _0x53be8b=path['join'](config['root'],'server/files/attachments/');if(_0x4de855){_0x53be8b=path[_0x5acc('0x73')](_0x53be8b,'offline-chat/');}var _0x9cc6e=path[_0x5acc('0x73')](_0x53be8b,_0x8222b6[_0x5acc('0x6a')]);return _0x51ee18['download'](_0x9cc6e);}})[_0x5acc('0x3a')](handleError(_0x51ee18,null));};exports['close']=function(_0x7862e4,_0x149b83){var _0x546862=null;var _0x3cc26c=null;var _0x4c3553=null;if(_0x7862e4[_0x5acc('0x49')]['id']){delete _0x7862e4[_0x5acc('0x49')]['id'];}if(_0x7862e4['body']['mailTranscript']){_0x4c3553=path[_0x5acc('0x73')](config['root'],'server/files/chat/upload/',util[_0x5acc('0x74')]('transcript-%s.txt',Date[_0x5acc('0x75')]()));_0x7862e4[_0x5acc('0x49')][_0x5acc('0x76')]=_0x4c3553;}return db[_0x5acc('0x3f')][_0x5acc('0x4a')]({'where':{'id':_0x7862e4['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x149b83,null))[_0x5acc('0x29')](saveUpdates(_0x7862e4[_0x5acc('0x49')],null))[_0x5acc('0x29')](function(_0x3c6bf2){if(_0x3c6bf2){_0x546862=_0x3c6bf2;return db['ChatWebsite'][_0x5acc('0x4a')]({'where':{'id':_0x546862[_0x5acc('0x77')]}});}})['then'](function(_0x1ffe05){if(_0x1ffe05){_0x3cc26c=_0x1ffe05;return db[_0x5acc('0x63')][_0x5acc('0x4a')]({'where':{'id':_0x546862[_0x5acc('0x78')]}});}})['then'](function(_0x35529e){if(_0x35529e){if(_0x4c3553){var _0x2e6d62=null;for(var _0x2be096=0x1;_0x2be096<_0x546862[_0x5acc('0x79')][_0x5acc('0x44')];++_0x2be096){_0x2e6d62=_0x546862[_0x5acc('0x79')][_0x2be096];var _0x16798c=_0x2e6d62[_0x5acc('0x7a')]?util[_0x5acc('0x74')](_0x5acc('0x7b'),_0x3cc26c[_0x5acc('0x7c')],_0x2e6d62['UserId']):_0x5acc('0x7d');var _0x14f590=_0x7862e4[_0x5acc('0x49')][_0x5acc('0x7e')]||util[_0x5acc('0x74')](_0x5acc('0x7b'),_0x5acc('0x7f'),_0x2e6d62[_0x5acc('0x78')]);switch(_0x3cc26c['agentIdentifier']){case _0x5acc('0x80'):_0x16798c=_0x2e6d62['UserId']?util[_0x5acc('0x74')](_0x5acc('0x7b'),_0x3cc26c['agentAlias'],_0x2e6d62[_0x5acc('0x7a')]):_0x5acc('0x7d');break;case _0x5acc('0x81'):_0x16798c=_0x2e6d62['UserId']?_0x2e6d62[_0x5acc('0x82')]['alias']||_0x2e6d62[_0x5acc('0x82')][_0x5acc('0x55')]:_0x5acc('0x7d');break;case _0x5acc('0x83'):_0x16798c=_0x2e6d62[_0x5acc('0x7a')]?_0x2e6d62[_0x5acc('0x82')][_0x5acc('0x55')]:_0x5acc('0x7d');break;default:_0x16798c=_0x2e6d62[_0x5acc('0x7a')]?util['format'](_0x5acc('0x7b'),_0x3cc26c[_0x5acc('0x7c')],_0x2e6d62['UserId']):_0x5acc('0x7d');}var _0x40696d=util[_0x5acc('0x74')]('[%s]\x20%s:\x20%s\x0a',moment(_0x2e6d62[_0x5acc('0x84')])[_0x5acc('0x74')](_0x5acc('0x85')),_0x2e6d62[_0x5acc('0x86')]==='in'?_0x14f590:_0x16798c,_0x2e6d62[_0x5acc('0x49')]);if(!_0x2e6d62[_0x5acc('0x87')]){fs[_0x5acc('0x88')](_0x4c3553,_0x40696d);}}return db[_0x5acc('0x89')][_0x5acc('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x5acc('0x8a')],'as':_0x5acc('0x8b'),'raw':!![],'include':[{'model':db[_0x5acc('0x8c')],'as':_0x5acc('0x8c'),'raw':!![]}]}]});}}})['then'](function(_0x986879){if(!_0x986879||!_0x986879[_0x5acc('0x8b')]||!_0x7862e4[_0x5acc('0x49')])return _0x546862;var _0x3b462e=_0x986879[_0x5acc('0x8d')]();return respondWithRpcPromise(_0x5acc('0x8e'),_0x5acc('0x8f'),{'account':_0x3b462e,'message':{'from':util[_0x5acc('0x74')](_0x5acc('0x90'),_0x986879[_0x5acc('0x2b')],_0x986879[_0x5acc('0x56')]||_0x986879[_0x5acc('0x8b')][_0x5acc('0x54')]),'to':_0x7862e4['body'][_0x5acc('0x91')],'subject':_0x5acc('0x92'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x7862e4[_0x5acc('0x49')][_0x5acc('0x91')]),'attachments':[{'path':_0x4c3553}]}})[_0x5acc('0x29')](function(){return _0x546862;})[_0x5acc('0x3a')](function(_0x4651e8){logger['error'](_0x4651e8);});})['then'](respondWithStatusCode(_0x149b83,0xc8))['catch'](handleError(_0x149b83,null));};exports[_0x5acc('0x93')]=function(_0x47c330,_0x1890e0){return db[_0x5acc('0x5f')]['find']({'where':{'id':_0x47c330['params']['id']}})[_0x5acc('0x29')](handleEntityNotFound(_0x1890e0,null))[_0x5acc('0x29')](function(_0x1dd4e8){if(_0x1dd4e8){return _0x1dd4e8[_0x5acc('0x93')](_0x47c330[_0x5acc('0x49')]['ids'],_[_0x5acc('0x94')](_0x47c330[_0x5acc('0x49')],[_0x5acc('0x95'),'id'])||{});}})[_0x5acc('0x29')](respondWithResult(_0x1890e0,null))[_0x5acc('0x3a')](handleError(_0x1890e0,null));};exports[_0x5acc('0x96')]=function(_0x4ddc77,_0x5a2f3c){var _0x407938={'raw':![],'where':{}};var _0x5a4559={};var _0xcac823={'count':0x0,'rows':[]};return db[_0x5acc('0x3f')][_0x5acc('0x4e')]({'where':{'id':_0x4ddc77[_0x5acc('0x3c')]['id']}})[_0x5acc('0x29')](handleEntityNotFound(_0x5a2f3c,null))['then'](function(_0x15d8d5){if(_0x15d8d5){_0x5a4559[_0x5acc('0x3d')]=_[_0x5acc('0x3e')](db[_0x5acc('0x5f')][_0x5acc('0x34')]);_0x5a4559[_0x5acc('0x39')]=_['keys'](_0x4ddc77['query']);_0x5a4559[_0x5acc('0x40')]=_[_0x5acc('0x41')](_0x5a4559['model'],_0x5a4559[_0x5acc('0x39')]);_0x407938[_0x5acc('0x43')]=_['intersection'](_0x5a4559[_0x5acc('0x3d')],qs[_0x5acc('0x42')](_0x4ddc77[_0x5acc('0x39')][_0x5acc('0x42')]));_0x407938[_0x5acc('0x43')]=_0x407938['attributes'][_0x5acc('0x44')]?_0x407938['attributes']:_0x5a4559[_0x5acc('0x3d')];if(!_0x4ddc77[_0x5acc('0x39')][_0x5acc('0x97')]('nolimit')){_0x407938[_0x5acc('0x23')]=qs[_0x5acc('0x23')](_0x4ddc77['query'][_0x5acc('0x23')]);_0x407938[_0x5acc('0x25')]=qs[_0x5acc('0x25')](_0x4ddc77['query'][_0x5acc('0x25')]);}_0x407938[_0x5acc('0x98')]=qs[_0x5acc('0x99')](_0x4ddc77[_0x5acc('0x39')][_0x5acc('0x99')]);_0x407938[_0x5acc('0x9a')]=qs['filters'](_[_0x5acc('0x9b')](_0x4ddc77[_0x5acc('0x39')],_0x5a4559[_0x5acc('0x40')]));_0x407938[_0x5acc('0x9a')]['ChatInteractionId']=_0x15d8d5['id'];if(_0x4ddc77[_0x5acc('0x39')]['filter']){_0x407938[_0x5acc('0x9a')]=_[_0x5acc('0x2e')](_0x407938[_0x5acc('0x9a')],{'$or':_[_0x5acc('0x33')](_0x407938[_0x5acc('0x43')],function(_0x480642){var _0x49a6d3={};_0x49a6d3[_0x480642]={'$like':'%'+_0x4ddc77['query']['filter']+'%'};return _0x49a6d3;})});}if(_0x4ddc77['query'][_0x5acc('0x9c')]){var _0x84d76d=_0x4ddc77[_0x5acc('0x39')][_0x5acc('0x9c')][_0x5acc('0x9d')](',');var _0x803464={};_0x803464[_0x84d76d[0x0]]={'$gte':moment(_0x84d76d[0x1])['format'](_0x5acc('0x9e'))};_0x407938[_0x5acc('0x9a')]=_[_0x5acc('0x2e')](_0x407938[_0x5acc('0x9a')],_0x803464);}_0x407938=_['merge']({},_0x407938,_0x4ddc77['options']);return db['ChatMessage'][_0x5acc('0x24')]({'where':_0x407938[_0x5acc('0x9a')]})[_0x5acc('0x29')](function(_0x4bf07b){_0xcac823[_0x5acc('0x24')]=_0x4bf07b;if(_0x4ddc77[_0x5acc('0x39')][_0x5acc('0x45')]){_0x407938[_0x5acc('0x46')]=[{'all':!![]}];}return db[_0x5acc('0x5f')][_0x5acc('0x37')](_0x407938);})['then'](function(_0x203447){_0xcac823[_0x5acc('0x9f')]=_0x203447;return _0xcac823;});}})['then'](respondWithFilteredResult(_0x5a2f3c,_0x407938))[_0x5acc('0x3a')](handleError(_0x5a2f3c,null));};exports[_0x5acc('0xa0')]=function(_0x3d2e9f,_0x4423e6){var _0x1c0e94={'where':{}},_0x122a5d={},_0x30ef22={'count':0x0,'rows':[]};return db[_0x5acc('0x3f')][_0x5acc('0x4e')]({'where':{'id':_0x3d2e9f[_0x5acc('0x3c')]['id']}})[_0x5acc('0x29')](handleEntityNotFound(_0x4423e6,null))[_0x5acc('0x29')](function(_0x50a63f){if(_0x50a63f){_0x122a5d[_0x5acc('0x3d')]=_[_0x5acc('0x3e')](db[_0x5acc('0x5f')][_0x5acc('0x34')]);_0x122a5d['query']=_[_0x5acc('0x3e')](_0x3d2e9f[_0x5acc('0x39')]);_0x122a5d[_0x5acc('0x40')]=_['intersection'](_0x122a5d[_0x5acc('0x3d')],_0x122a5d[_0x5acc('0x39')]);_0x1c0e94[_0x5acc('0x43')]=_[_0x5acc('0x41')](_0x122a5d[_0x5acc('0x3d')],qs[_0x5acc('0x42')](_0x3d2e9f[_0x5acc('0x39')][_0x5acc('0x42')]));_0x1c0e94[_0x5acc('0x43')]=_0x1c0e94[_0x5acc('0x43')]['length']?_0x1c0e94['attributes']:_0x122a5d[_0x5acc('0x3d')];if(!_0x3d2e9f[_0x5acc('0x39')][_0x5acc('0x97')](_0x5acc('0xa1'))){_0x1c0e94['limit']=qs['limit'](_0x3d2e9f[_0x5acc('0x39')][_0x5acc('0x23')]);_0x1c0e94[_0x5acc('0x25')]=qs['offset'](_0x3d2e9f[_0x5acc('0x39')][_0x5acc('0x25')]);}_0x1c0e94[_0x5acc('0x98')]=qs[_0x5acc('0x99')](_0x3d2e9f[_0x5acc('0x39')]['sort']);_0x1c0e94[_0x5acc('0x9a')]=qs[_0x5acc('0x40')](_[_0x5acc('0x9b')](_0x3d2e9f[_0x5acc('0x39')],_0x122a5d[_0x5acc('0x40')]));_0x1c0e94[_0x5acc('0x9a')][_0x5acc('0xa2')]=_0x50a63f['id'];if(_0x3d2e9f[_0x5acc('0x39')][_0x5acc('0xa3')]){_0x1c0e94[_0x5acc('0x9a')]=_[_0x5acc('0x2e')](_0x1c0e94[_0x5acc('0x9a')],{'$or':_[_0x5acc('0x33')](_0x1c0e94[_0x5acc('0x43')],function(_0x3445ad){var _0x3505f9={};_0x3505f9[_0x3445ad]={'$like':'%'+_0x3d2e9f[_0x5acc('0x39')]['filter']+'%'};return _0x3505f9;})});}_0x1c0e94[_0x5acc('0x9a')][_0x5acc('0x87')]=![];if(_0x3d2e9f['query']['id']){_0x1c0e94[_0x5acc('0x9a')]['id']={'$gt':_0x3d2e9f[_0x5acc('0x39')]['id']};}_0x1c0e94=_[_0x5acc('0x2e')]({},_0x1c0e94,_0x3d2e9f[_0x5acc('0x47')]);return db[_0x5acc('0x5f')][_0x5acc('0x24')]({'where':_0x1c0e94[_0x5acc('0x9a')]})[_0x5acc('0x29')](function(_0x2523ba){_0x30ef22[_0x5acc('0x24')]=_0x2523ba;_0x1c0e94[_0x5acc('0x46')]=[];if(_0x3d2e9f[_0x5acc('0x39')][_0x5acc('0xa4')]){_0x1c0e94['include'][_0x5acc('0xa5')]({'model':db[_0x5acc('0x82')],'as':_0x5acc('0x82'),'attributes':['id',_0x5acc('0x55'),_0x5acc('0xa6')]});}if(_0x3d2e9f[_0x5acc('0x39')][_0x5acc('0x45')]){_0x1c0e94[_0x5acc('0x46')]=[{'all':!![]}];}return db[_0x5acc('0x5f')][_0x5acc('0x37')](_0x1c0e94);})[_0x5acc('0x29')](function(_0x47ec39){_0x30ef22[_0x5acc('0x9f')]=_0x47ec39;return _0x30ef22;});}})[_0x5acc('0x29')](respondWithFilteredResult(_0x4423e6,_0x1c0e94))[_0x5acc('0x3a')](handleError(_0x4423e6,null));};exports[_0x5acc('0xa7')]=function(_0x2b4a8a,_0x2494a5){return db[_0x5acc('0x3f')][_0x5acc('0x4a')]({'where':{'id':_0x2b4a8a[_0x5acc('0x3c')]['id']}})[_0x5acc('0x29')](handleEntityNotFound(_0x2494a5,null))[_0x5acc('0x29')](function(_0x5a6c23){if(_0x5a6c23){return _0x5a6c23[_0x5acc('0xa8')](_0x2b4a8a[_0x5acc('0x49')]['ids'],_[_0x5acc('0x94')](_0x2b4a8a['body'],['ids','id'])||{})['spread'](function(){return db[_0x5acc('0xa9')]['findAll']({'attributes':['id',_0x5acc('0x2b'),_0x5acc('0xaa')],'where':{'id':_0x2b4a8a[_0x5acc('0x49')][_0x5acc('0x95')]}});})[_0x5acc('0x29')](function(_0x2b65ec){socket[_0x5acc('0xab')]('chatInteractionTags:save',{'id':Number(_0x2b4a8a[_0x5acc('0x3c')]['id']),'tags':_0x2b65ec||[]});return{'id':Number(_0x2b4a8a[_0x5acc('0x3c')]['id']),'tags':_0x2b65ec||[]};});}})[_0x5acc('0x29')](respondWithResult(_0x2494a5,null))[_0x5acc('0x3a')](handleError(_0x2494a5,null));};exports[_0x5acc('0xac')]=function(_0x458779,_0x1c33e7){return db[_0x5acc('0x3f')][_0x5acc('0x4a')]({'where':{'id':_0x458779[_0x5acc('0x3c')]['id']}})[_0x5acc('0x29')](handleEntityNotFound(_0x1c33e7,null))[_0x5acc('0x29')](function(_0xb608a5){if(_0xb608a5){return _0xb608a5[_0x5acc('0xac')](_0x458779[_0x5acc('0x39')]['ids']);}})[_0x5acc('0x29')](respondWithStatusCode(_0x1c33e7,null))['catch'](handleError(_0x1c33e7,null));};exports['download']=function(_0x489b3b,_0x5c436e){var _0x2d98b9=moment()[_0x5acc('0xad')]()[_0x5acc('0xae')]();var _0x53b279=path['join'](config[_0x5acc('0xaf')],_0x5acc('0xb0'),_0x5acc('0xb1'),_0x5acc('0xb2'));var _0x5e4025=path[_0x5acc('0x73')](config['root'],_0x5acc('0xb0'),_0x5acc('0xb1'),_0x5acc('0xb3'));var _0x110b1b=path['join'](_0x53b279,_0x2d98b9);var _0x436a0b=util[_0x5acc('0x74')](_0x5acc('0xb4'),_0x489b3b[_0x5acc('0x3c')]['id'],_0x2d98b9);var _0x5e6b87=path[_0x5acc('0x73')](_0x53b279,_0x436a0b);var _0x2fcae1=[];_0x2fcae1[_0x5acc('0xa5')]({'model':db[_0x5acc('0x82')],'as':'User','attributes':['id',_0x5acc('0x55')],'raw':!![]});_0x2fcae1[_0x5acc('0xa5')]({'model':db[_0x5acc('0x63')],'as':_0x5acc('0x64'),'attributes':['id',_0x5acc('0xb5'),'lastName'],'raw':!![]});if(_0x489b3b[_0x5acc('0x39')]['attachments']){_0x2fcae1[_0x5acc('0xa5')]({'model':db[_0x5acc('0x6e')],'as':_0x5acc('0x6e'),'raw':!![]});}var _0x3a8efc=[{'model':db[_0x5acc('0x5f')],'as':'Messages','attributes':['id',_0x5acc('0x49'),_0x5acc('0x84'),_0x5acc('0x86'),'secret',_0x5acc('0xb6')],'include':_0x2fcae1}];_0x3a8efc['push']({'model':db['ChatWebsite'],'as':_0x5acc('0xb7'),'attributes':['id','name']});_0x3a8efc[_0x5acc('0xa5')]({'model':db['User'],'as':_0x5acc('0xb8'),'attributes':['id','fullname']});return db[_0x5acc('0x3f')][_0x5acc('0x4a')]({'where':{'id':_0x489b3b[_0x5acc('0x3c')]['id']},'include':_0x3a8efc})[_0x5acc('0x29')](handleEntityNotFound(_0x5c436e,null))[_0x5acc('0x29')](function(_0x4851fe){if(_0x4851fe){var _0x25a9c4=_0x4851fe[_0x5acc('0xb9')]({'plain':!![]});fs['mkdirSync'](_0x110b1b);var _0x918b19={'channel':'Chat','account':_0x25a9c4[_0x5acc('0xb7')][_0x5acc('0x2b')],'agent':_0x25a9c4[_0x5acc('0xb8')]?_0x25a9c4['Owner'][_0x5acc('0x55')]:_0x5acc('0xba'),'createdAt':moment(_0x25a9c4[_0x5acc('0x84')])[_0x5acc('0x74')](_0x5acc('0x9e'))[_0x5acc('0xae')](),'closedAt':_0x25a9c4[_0x5acc('0x67')]?moment(_0x25a9c4['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x5acc('0xae')]():'','disposition':_0x25a9c4[_0x5acc('0x68')],'chatInfo':{'browser':_0x25a9c4['browserName'],'os':_0x25a9c4[_0x5acc('0xbb')],'referer':_0x25a9c4[_0x5acc('0xbc')],'customerIp':_0x25a9c4[_0x5acc('0xbd')],'customerPort':_0x25a9c4[_0x5acc('0xbe')]?_0x25a9c4['customerPort']:_0x5acc('0xba')},'messages':_(_0x25a9c4[_0x5acc('0x79')])[_0x5acc('0xbf')]()['filter']({'secret':![]})[_0x5acc('0x33')](function(_0xb362b1){if(_0xb362b1['Attachment']){var _0x2bb635=path[_0x5acc('0x73')](_0x5e4025,_0xb362b1['Attachment'][_0x5acc('0x6a')]);if(fs[_0x5acc('0xc0')](_0x2bb635)){fs[_0x5acc('0xc1')](_0x2bb635)[_0x5acc('0xc2')](fs['createWriteStream'](path[_0x5acc('0x73')](_0x110b1b,_0xb362b1['Attachment']['basename'])));}}return{'date':moment(_0xb362b1[_0x5acc('0x84')])['format'](_0x5acc('0x9e'))[_0x5acc('0xae')](),'sender':_0xb362b1[_0x5acc('0x86')]===_0x5acc('0xc3')?_0xb362b1[_0x5acc('0x82')]?_0xb362b1[_0x5acc('0x82')][_0x5acc('0x55')]:_0x5acc('0x7d'):_0xb362b1[_0x5acc('0x64')]['firstName']+(_0xb362b1[_0x5acc('0x64')][_0x5acc('0xc4')]?'\x20'+_0xb362b1[_0x5acc('0x64')]['lastName']:''),'body':_0xb362b1[_0x5acc('0x6e')]?_0xb362b1[_0x5acc('0x6e')][_0x5acc('0x6a')]:_0xb362b1['body'],'direction':_0xb362b1[_0x5acc('0x86')]===_0x5acc('0xc3')?'A':'C','secret':_0xb362b1[_0x5acc('0x87')],'read':_0xb362b1['read'],'attachment':_0xb362b1[_0x5acc('0x6e')]};})[_0x5acc('0xc5')]()};return ejs[_0x5acc('0xc6')](path[_0x5acc('0x73')](config[_0x5acc('0xaf')],_0x5acc('0xb0'),_0x5acc('0xc7'),_0x5acc('0xc8')),{'interaction':_0x918b19})['then'](function(_0x1581aa){var _0x1fc0f3=path[_0x5acc('0x73')](_0x110b1b,_0x5acc('0xc9')+_0x25a9c4['id']+'-'+_0x2d98b9+_0x5acc('0xca'));var _0xdded17={'path':_0x1fc0f3,'channel':_0x5acc('0xcb'),'interactionId':_0x25a9c4['id']};return pdf[_0x5acc('0xcc')](_0x1581aa,_0xdded17);})[_0x5acc('0x29')](function(){return new Promise(function(_0x34ac29,_0x5c1d80){zipdir(_0x110b1b,{'saveTo':_0x5e6b87},function(_0x4f3012,_0x2fbdf2){if(_0x4f3012)return _0x5c1d80(_0x4f3012);return _0x34ac29(_0x2fbdf2);});})[_0x5acc('0x29')](function(){return new BPromise(function(_0x15d980,_0x3a326a){rimraf(_0x110b1b,function(_0x36b99c){if(_0x36b99c)_0x3a326a(_0x36b99c);return _0x15d980();});});})[_0x5acc('0x29')](function(){return _0x5c436e[_0x5acc('0xcd')](_0x5e6b87,_0x436a0b,function(_0x30504c){if(_0x30504c){logger[_0x5acc('0x1a')](_0x5acc('0xce'),_0x30504c);}else{fs[_0x5acc('0xcf')](_0x5e6b87);}});});});}else{return _0x5c436e[_0x5acc('0x1e')](0xc8);}})[_0x5acc('0x3a')](handleError(_0x5c436e,null));}; \ No newline at end of file +var _0xbd07=['name','render','merge','body','agent','account','index','map','ChatInteraction','fieldName','type','key','chat','user','model','rawAttributes','query','intersection','attributes','fields','includeAll','include','options','find','create','params','describe','createVidaooSession','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooMetadata','vidaooEscalation','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','attachmentUpload','file','originalname','basename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','findOne','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','length','UserId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','CloudProvider','Smtp','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','getMessages','keys','hasOwnProperty','nolimit','order','sort','where','filters','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','includeAgent','push','addTags','ids','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','toString','server','files','Contact','firstName','lastName','createdAt','read','Account','Owner','get','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','value','views','downloadInteraction.ejs','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','update','destroy','stack'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xbd07,0xa2));var _0x7bd0=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xbd07[_0x5c2e3e];return _0x53f64a;};'use strict';var rimraf=require(_0x7bd0('0x0'));var zipdir=require(_0x7bd0('0x1'));var rp=require(_0x7bd0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7bd0('0x3'));var util=require(_0x7bd0('0x4'));var path=require(_0x7bd0('0x5'));var ejs=require(_0x7bd0('0x6'));var fs=require('fs');var _=require(_0x7bd0('0x7'));var Redis=require(_0x7bd0('0x8'));var interaction=require(_0x7bd0('0x9'));var qs=require(_0x7bd0('0xa'));var pdf=require(_0x7bd0('0xb'));var logger=require(_0x7bd0('0xc'))(_0x7bd0('0xd'));var config=require(_0x7bd0('0xe'));var db=require(_0x7bd0('0xf'))['db'];config['redis']=_['defaults'](config[_0x7bd0('0x10')],{'host':_0x7bd0('0x11'),'port':0x18eb});var socket=require(_0x7bd0('0x12'))(new Redis(config[_0x7bd0('0x10')]));require(_0x7bd0('0x13'))[_0x7bd0('0x14')](socket);var jayson=require(_0x7bd0('0x15'));var client=jayson[_0x7bd0('0x16')][_0x7bd0('0x17')]({'port':0x232b});var client9004=jayson[_0x7bd0('0x16')][_0x7bd0('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x470feb,_0x50009d,_0x2b9452,_0xb827a6){return new BPromise(function(_0x43c5ab,_0x3a08d6){var _0x34ef7b=_0xb827a6||client;return _0x34ef7b[_0x7bd0('0x18')](_0x470feb,_0x2b9452)[_0x7bd0('0x19')](function(_0x2a96a7){logger[_0x7bd0('0x1a')](_0x7bd0('0x1b'),_0x50009d,_0x7bd0('0x1c'));logger[_0x7bd0('0x1d')](_0x7bd0('0x1e'),_0x50009d,'request\x20sent',JSON[_0x7bd0('0x1f')](_0x2a96a7));if(_0x2a96a7[_0x7bd0('0x20')]){if(_0x2a96a7[_0x7bd0('0x20')]['code']===0x1f4){logger[_0x7bd0('0x20')](_0x7bd0('0x1b'),_0x50009d,_0x2a96a7['error'][_0x7bd0('0x21')]);return _0x3a08d6(_0x2a96a7[_0x7bd0('0x20')][_0x7bd0('0x21')]);}logger[_0x7bd0('0x20')](_0x7bd0('0x1b'),_0x50009d,_0x2a96a7['error'][_0x7bd0('0x21')]);return _0x43c5ab(_0x2a96a7[_0x7bd0('0x20')][_0x7bd0('0x21')]);}else{logger[_0x7bd0('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x50009d,_0x7bd0('0x1c'));_0x43c5ab(_0x2a96a7[_0x7bd0('0x22')][_0x7bd0('0x21')]);}})[_0x7bd0('0x23')](function(_0x141a9a){logger[_0x7bd0('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x50009d,_0x141a9a);_0x3a08d6(_0x141a9a);});});}function respondWithStatusCode(_0x130383,_0x1c33c2){_0x1c33c2=_0x1c33c2||0xcc;return function(_0x450f06){if(_0x450f06){return _0x130383[_0x7bd0('0x24')](_0x1c33c2);}return _0x130383[_0x7bd0('0x25')](_0x1c33c2)[_0x7bd0('0x26')]();};}function respondWithResult(_0x161798,_0x1ca541){_0x1ca541=_0x1ca541||0xc8;return function(_0xc74391){if(_0xc74391){return _0x161798[_0x7bd0('0x25')](_0x1ca541)[_0x7bd0('0x27')](_0xc74391);}};}function respondWithFilteredResult(_0xa843c5,_0x585ba2){return function(_0xd59dc4){if(_0xd59dc4){var _0x124346=typeof _0x585ba2['offset']==='undefined'&&typeof _0x585ba2[_0x7bd0('0x28')]===_0x7bd0('0x29');var _0x2393f2=_0xd59dc4[_0x7bd0('0x2a')];var _0x1fd577=_0x124346?0x0:_0x585ba2[_0x7bd0('0x2b')];var _0x6462c3=_0x124346?_0xd59dc4[_0x7bd0('0x2a')]:_0x585ba2['offset']+_0x585ba2[_0x7bd0('0x28')];var _0x5d79a4;if(_0x6462c3>=_0x2393f2){_0x6462c3=_0x2393f2;_0x5d79a4=0xc8;}else{_0x5d79a4=0xce;}_0xa843c5[_0x7bd0('0x25')](_0x5d79a4);return _0xa843c5['set'](_0x7bd0('0x2c'),_0x1fd577+'-'+_0x6462c3+'/'+_0x2393f2)['json'](_0xd59dc4);}return null;};}function saveUpdates(_0x21ace4){return function(_0x523985){if(_0x523985){return _0x523985[_0x7bd0('0x2d')](_0x21ace4)[_0x7bd0('0x19')](function(_0x2b771f){return _0x2b771f;});}return null;};}function removeEntity(_0x51f3be){return function(_0x560d01){if(_0x560d01){return _0x560d01[_0x7bd0('0x2e')]()[_0x7bd0('0x19')](function(){_0x51f3be[_0x7bd0('0x25')](0xcc)[_0x7bd0('0x26')]();});}};}function handleEntityNotFound(_0x14a411){return function(_0x6d479a){if(!_0x6d479a){_0x14a411['sendStatus'](0x194);}return _0x6d479a;};}function handleError(_0x460173,_0x387a97){_0x387a97=_0x387a97||0x1f4;return function(_0x530f5b){logger['error'](_0x530f5b[_0x7bd0('0x2f')]);if(_0x530f5b[_0x7bd0('0x30')]){delete _0x530f5b[_0x7bd0('0x30')];}_0x460173[_0x7bd0('0x25')](_0x387a97)['send'](_0x530f5b);};}function getMustacheRender(_0xd96cc4,_0x171dfb){return Mustache[_0x7bd0('0x31')](_0xd96cc4,_[_0x7bd0('0x32')](_0x171dfb[_0x7bd0('0x33')],{'contact':_0x171dfb['contact'],'message':_0x171dfb[_0x7bd0('0x21')],'agent':_0x171dfb[_0x7bd0('0x34')],'interaction':_0x171dfb['interaction'],'account':_0x171dfb[_0x7bd0('0x35')]}))||'';}exports[_0x7bd0('0x36')]=function(_0x58eb0a,_0x3c58e6){var _0x5576df={};var _0x42adcd=_[_0x7bd0('0x37')](db[_0x7bd0('0x38')]['rawAttributes'],function(_0x279a85){return{'name':_0x279a85[_0x7bd0('0x39')],'type':_0x279a85[_0x7bd0('0x3a')][_0x7bd0('0x3b')]};});_0x5576df=qs['getOptions'](_0x42adcd,_0x58eb0a);return interaction['findAll'](_0x7bd0('0x3c'),_0x58eb0a['query'],_0x58eb0a[_0x7bd0('0x3d')],_0x5576df,_0x42adcd)[_0x7bd0('0x19')](respondWithFilteredResult(_0x3c58e6,_0x5576df))[_0x7bd0('0x23')](handleError(_0x3c58e6,null));};exports['show']=function(_0x2deb84,_0x27d58f){var _0x119094={'raw':![],'where':{'id':_0x2deb84['params']['id']}},_0x3354a7={};_0x3354a7[_0x7bd0('0x3e')]=_['keys'](db['ChatInteraction'][_0x7bd0('0x3f')]);_0x3354a7[_0x7bd0('0x40')]=_['keys'](_0x2deb84[_0x7bd0('0x40')]);_0x3354a7['filters']=_[_0x7bd0('0x41')](_0x3354a7[_0x7bd0('0x3e')],_0x3354a7[_0x7bd0('0x40')]);_0x119094[_0x7bd0('0x42')]=_[_0x7bd0('0x41')](_0x3354a7[_0x7bd0('0x3e')],qs[_0x7bd0('0x43')](_0x2deb84[_0x7bd0('0x40')][_0x7bd0('0x43')]));_0x119094['attributes']=_0x119094['attributes']['length']?_0x119094[_0x7bd0('0x42')]:_0x3354a7[_0x7bd0('0x3e')];if(_0x2deb84[_0x7bd0('0x40')][_0x7bd0('0x44')]){_0x119094[_0x7bd0('0x45')]=[{'all':!![]}];}_0x119094=_['merge']({},_0x119094,_0x2deb84[_0x7bd0('0x46')]);return db[_0x7bd0('0x38')][_0x7bd0('0x47')](_0x119094)[_0x7bd0('0x19')](handleEntityNotFound(_0x27d58f,null))[_0x7bd0('0x19')](respondWithResult(_0x27d58f,null))[_0x7bd0('0x23')](handleError(_0x27d58f,null));};exports[_0x7bd0('0x48')]=function(_0x5d7350,_0x1fecdf){return db[_0x7bd0('0x38')][_0x7bd0('0x48')](_0x5d7350[_0x7bd0('0x33')],{})[_0x7bd0('0x19')](respondWithResult(_0x1fecdf,0xc9))['catch'](handleError(_0x1fecdf,null));};exports[_0x7bd0('0x2d')]=function(_0x4e12c9,_0x30ff20){if(_0x4e12c9['body']['id']){delete _0x4e12c9[_0x7bd0('0x33')]['id'];}return db[_0x7bd0('0x38')]['find']({'where':{'id':_0x4e12c9[_0x7bd0('0x49')]['id']}})[_0x7bd0('0x19')](handleEntityNotFound(_0x30ff20,null))[_0x7bd0('0x19')](saveUpdates(_0x4e12c9[_0x7bd0('0x33')],null))[_0x7bd0('0x19')](respondWithResult(_0x30ff20,null))[_0x7bd0('0x23')](handleError(_0x30ff20,null));};exports['destroy']=function(_0xf167d6,_0x372813){return db[_0x7bd0('0x38')]['find']({'where':{'id':_0xf167d6[_0x7bd0('0x49')]['id']}})['then'](handleEntityNotFound(_0x372813,null))[_0x7bd0('0x19')](removeEntity(_0x372813,null))[_0x7bd0('0x23')](handleError(_0x372813,null));};exports[_0x7bd0('0x4a')]=function(_0x3e1a0a,_0xa512c0){return db[_0x7bd0('0x38')]['describe']()[_0x7bd0('0x19')](respondWithResult(_0xa512c0,null))['catch'](handleError(_0xa512c0,null));};exports[_0x7bd0('0x4b')]=function(_0x148de5,_0x550e3e){var _0x19f341=_0x148de5[_0x7bd0('0x49')]['id'];var _0x4a58ae;var _0x12b905;var _0x3792c1;return db[_0x7bd0('0x38')]['findOne']({'where':{'id':_0x19f341}})[_0x7bd0('0x19')](function(_0x414458){_0x4a58ae=_0x414458;return db[_0x7bd0('0x4c')]['findOne']({'where':{'id':_0x414458[_0x7bd0('0x4d')]},'attributes':['id',_0x7bd0('0x4e'),'vidaooEscalation','vidaooTopic','vidaooNote',_0x7bd0('0x4f')],'raw':!![]});})['then'](function(_0x30cc78){if(_0x30cc78&&_0x30cc78[_0x7bd0('0x4e')]&&_0x30cc78[_0x7bd0('0x50')]){_0x12b905=_0x30cc78;var _0x15e85d={'interaction':{'id':_0x19f341},'agent':{'id':_0x148de5['user']['id'],'name':_0x148de5['user']['name'],'fullname':_0x148de5[_0x7bd0('0x3d')][_0x7bd0('0x51')],'email':_0x148de5[_0x7bd0('0x3d')][_0x7bd0('0x52')]},'contact':_0x148de5[_0x7bd0('0x33')][_0x7bd0('0x53')],'account':_0x148de5[_0x7bd0('0x33')][_0x7bd0('0x35')]};var _0x1c0c77={'rejectUnauthorized':![],'method':_0x7bd0('0x54'),'url':_0x7bd0('0x55'),'headers':{'X-APIKEY':_0x30cc78[_0x7bd0('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x148de5[_0x7bd0('0x3d')][_0x7bd0('0x52')]],'buttons':null,'topic':_0x12b905['vidaooTopic'],'note':_[_0x7bd0('0x56')](_0x12b905[_0x7bd0('0x57')])?null:getMustacheRender(_0x12b905['vidaooNote'],_0x15e85d),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x7bd0('0x56')](_0x12b905[_0x7bd0('0x4f')])){var _0x1a9bb7=getMustacheRender(_0x12b905['vidaooMetadata'],_0x15e85d);var _0x2e87d5=JSON[_0x7bd0('0x58')](_0x1a9bb7);_0x1c0c77[_0x7bd0('0x33')][_0x7bd0('0x59')]=_0x2e87d5;}}catch(_0x2bc96a){throw new db[(_0x7bd0('0x5a'))][(_0x7bd0('0x5b'))](_0x7bd0('0x5c'));}return rp(_0x1c0c77);}else{throw new db[(_0x7bd0('0x5a'))][(_0x7bd0('0x5b'))](_0x7bd0('0x5d'));}})[_0x7bd0('0x19')](function(_0x4ee611){_0x3792c1=_0x4ee611;if(_0x3792c1['id']){var _0x1b0320={'body':_0x3792c1[_0x7bd0('0x5e')],'ChatWebsiteId':_0x12b905['id'],'ChatInteractionId':_0x4a58ae['id'],'direction':_0x7bd0('0x5f'),'UserId':_0x148de5['user']['id']};return db[_0x7bd0('0x60')][_0x7bd0('0x48')](_0x1b0320,{});}else{throw new db['Sequelize'][(_0x7bd0('0x5b'))](_0x7bd0('0x61'));}})[_0x7bd0('0x19')](function(){return _0x4a58ae[_0x7bd0('0x62')]({'vidaooSessionId':_0x3792c1['id']});})[_0x7bd0('0x19')](respondWithResult(_0x550e3e,null))[_0x7bd0('0x23')](handleError(_0x550e3e,null));};exports[_0x7bd0('0x63')]=function(_0x41a450,_0x3f2531){if(_0x41a450[_0x7bd0('0x33')]['id']){delete _0x41a450[_0x7bd0('0x33')]['id'];}return db[_0x7bd0('0x38')][_0x7bd0('0x47')]({'where':{'id':_0x41a450[_0x7bd0('0x49')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x7bd0('0x19')](handleEntityNotFound(_0x3f2531,null))[_0x7bd0('0x19')](saveUpdates(_0x41a450['body'],null))[_0x7bd0('0x19')](respondWithResult(_0x3f2531,null))[_0x7bd0('0x23')](handleError(_0x3f2531,null));};exports[_0x7bd0('0x64')]=function(_0x83d436,_0x3334b2){if(_0x83d436[_0x7bd0('0x33')]['id']){delete _0x83d436[_0x7bd0('0x33')]['id'];}return db[_0x7bd0('0x38')][_0x7bd0('0x47')]({'where':{'id':_0x83d436[_0x7bd0('0x49')]['id']}})[_0x7bd0('0x19')](function(_0x49a721){if(!_0x49a721){logger[_0x7bd0('0x20')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x7bd0('0x64'),0x194,'entity\x20not\x20found');_0x3334b2['sendStatus'](0x194);}else{if(_0x49a721['UserId']){throw new db[(_0x7bd0('0x5a'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x49a721;})['then'](function(_0xb7e2f1){if(_0xb7e2f1){return _0xb7e2f1[_0x7bd0('0x2d')]({'closed':_0x83d436['body']['closed'],'disposition':_0x83d436[_0x7bd0('0x33')]['disposition']})['then'](function(_0x27ffca){return _0x27ffca;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x83d436[_0x7bd0('0x33')],client9004);})[_0x7bd0('0x19')](respondWithResult(_0x3334b2,null))[_0x7bd0('0x23')](handleError(_0x3334b2,null));};exports[_0x7bd0('0x65')]=function(_0x19af3c,_0x1fa344){_0x19af3c[_0x7bd0('0x33')][_0x7bd0('0x30')]=_0x19af3c[_0x7bd0('0x66')][_0x7bd0('0x67')];_0x19af3c[_0x7bd0('0x33')][_0x7bd0('0x68')]=_0x19af3c['file']['filename'];_0x19af3c[_0x7bd0('0x33')][_0x7bd0('0x3a')]=_0x19af3c[_0x7bd0('0x66')][_0x7bd0('0x69')];return db['Attachment'][_0x7bd0('0x48')](_0x19af3c[_0x7bd0('0x33')])[_0x7bd0('0x19')](respondWithResult(_0x1fa344,0xc9))[_0x7bd0('0x23')](handleError(_0x1fa344,null));};exports[_0x7bd0('0x6a')]=function(_0x9efa7d,_0x58b704){return db[_0x7bd0('0x38')]['findOne']({'where':{'id':_0x9efa7d['params']['id']},'raw':!![]})[_0x7bd0('0x19')](handleEntityNotFound(_0x58b704,null))[_0x7bd0('0x19')](function(_0x179c6a){if(_0x179c6a){if(_0x179c6a[_0x7bd0('0x6b')]){return _0x58b704[_0x7bd0('0x25')](0x193)[_0x7bd0('0x27')]({'status':0x193,'message':_0x7bd0('0x6c')});}return db[_0x7bd0('0x6d')][_0x7bd0('0x6e')]({'where':{'id':_0x9efa7d[_0x7bd0('0x40')][_0x7bd0('0x6f')]},'raw':!![]})[_0x7bd0('0x19')](handleEntityNotFound(_0x58b704,null));}})[_0x7bd0('0x19')](function(_0x4f2d72){if(_0x4f2d72){var _0x29e988=_0x4f2d72['ChatOfflineMessageId']!==null;var _0x54e77e=path[_0x7bd0('0x70')](config[_0x7bd0('0x71')],_0x7bd0('0x72'));if(_0x29e988){_0x54e77e=path['join'](_0x54e77e,_0x7bd0('0x73'));}var _0x54e1e0=path['join'](_0x54e77e,_0x4f2d72[_0x7bd0('0x68')]);return _0x58b704[_0x7bd0('0x74')](_0x54e1e0);}})['catch'](handleError(_0x58b704,null));};exports[_0x7bd0('0x75')]=function(_0x3b5d32,_0x2a9dd3){var _0x474b6e=null;var _0x1dfe91=null;var _0x4d4713=null;if(_0x3b5d32['body']['id']){delete _0x3b5d32[_0x7bd0('0x33')]['id'];}if(_0x3b5d32['body'][_0x7bd0('0x76')]){_0x4d4713=path[_0x7bd0('0x70')](config['root'],'server/files/chat/upload/',util[_0x7bd0('0x77')](_0x7bd0('0x78'),Date[_0x7bd0('0x79')]()));_0x3b5d32['body'][_0x7bd0('0x7a')]=_0x4d4713;}return db[_0x7bd0('0x38')]['find']({'where':{'id':_0x3b5d32[_0x7bd0('0x49')]['id']},'include':[{'model':db[_0x7bd0('0x60')],'as':_0x7bd0('0x7b'),'include':[{'model':db[_0x7bd0('0x7c')],'as':_0x7bd0('0x7c')}]}]})[_0x7bd0('0x19')](handleEntityNotFound(_0x2a9dd3,null))[_0x7bd0('0x19')](saveUpdates(_0x3b5d32[_0x7bd0('0x33')],null))[_0x7bd0('0x19')](function(_0x32fc6c){if(_0x32fc6c){_0x474b6e=_0x32fc6c;return db[_0x7bd0('0x4c')][_0x7bd0('0x47')]({'where':{'id':_0x474b6e['ChatWebsiteId']}});}})[_0x7bd0('0x19')](function(_0x291e4a){if(_0x291e4a){_0x1dfe91=_0x291e4a;return db['CmContact']['find']({'where':{'id':_0x474b6e[_0x7bd0('0x7d')]}});}})[_0x7bd0('0x19')](function(_0x2a6b7e){if(_0x2a6b7e){if(_0x4d4713){var _0x4a0d32=null;for(var _0x130f6f=0x1;_0x130f6f<_0x474b6e[_0x7bd0('0x7b')][_0x7bd0('0x7e')];++_0x130f6f){_0x4a0d32=_0x474b6e[_0x7bd0('0x7b')][_0x130f6f];var _0x5bb824=_0x4a0d32[_0x7bd0('0x7f')]?util[_0x7bd0('0x77')](_0x7bd0('0x80'),_0x1dfe91[_0x7bd0('0x81')],_0x4a0d32[_0x7bd0('0x7f')]):'System';var _0xa9a24d=_0x3b5d32[_0x7bd0('0x33')][_0x7bd0('0x82')]||util[_0x7bd0('0x77')](_0x7bd0('0x80'),_0x7bd0('0x83'),_0x4a0d32[_0x7bd0('0x7d')]);switch(_0x1dfe91[_0x7bd0('0x84')]){case _0x7bd0('0x85'):_0x5bb824=_0x4a0d32[_0x7bd0('0x7f')]?util[_0x7bd0('0x77')](_0x7bd0('0x80'),_0x1dfe91[_0x7bd0('0x81')],_0x4a0d32[_0x7bd0('0x7f')]):_0x7bd0('0x86');break;case _0x7bd0('0x87'):_0x5bb824=_0x4a0d32[_0x7bd0('0x7f')]?_0x4a0d32['User'][_0x7bd0('0x88')]||_0x4a0d32[_0x7bd0('0x7c')]['fullname']:'System';break;case'agent_fullname':_0x5bb824=_0x4a0d32[_0x7bd0('0x7f')]?_0x4a0d32[_0x7bd0('0x7c')][_0x7bd0('0x51')]:_0x7bd0('0x86');break;default:_0x5bb824=_0x4a0d32[_0x7bd0('0x7f')]?util[_0x7bd0('0x77')](_0x7bd0('0x80'),_0x1dfe91[_0x7bd0('0x81')],_0x4a0d32['UserId']):_0x7bd0('0x86');}var _0x334105=util[_0x7bd0('0x77')](_0x7bd0('0x89'),moment(_0x4a0d32['createdAt'])[_0x7bd0('0x77')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4a0d32[_0x7bd0('0x8a')]==='in'?_0xa9a24d:_0x5bb824,_0x4a0d32[_0x7bd0('0x33')]);if(!_0x4a0d32[_0x7bd0('0x8b')]){fs[_0x7bd0('0x8c')](_0x4d4713,_0x334105);}}return db[_0x7bd0('0x8d')][_0x7bd0('0x6e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7bd0('0x8e')],'as':_0x7bd0('0x8e'),'raw':!![]}]}]});}}})[_0x7bd0('0x19')](function(_0x12f8bd){if(!_0x12f8bd||!_0x12f8bd[_0x7bd0('0x8f')]||!_0x3b5d32['body'])return _0x474b6e;var _0x37511c=_0x12f8bd[_0x7bd0('0x90')]();return respondWithRpcPromise(_0x7bd0('0x91'),_0x7bd0('0x92'),{'account':_0x37511c,'message':{'from':util[_0x7bd0('0x77')](_0x7bd0('0x93'),_0x12f8bd[_0x7bd0('0x30')],_0x12f8bd['email']||_0x12f8bd[_0x7bd0('0x8f')][_0x7bd0('0x3d')]),'to':_0x3b5d32['body']['mailTranscript'],'subject':_0x7bd0('0x94'),'text':util[_0x7bd0('0x77')](_0x7bd0('0x95'),_0x3b5d32[_0x7bd0('0x33')][_0x7bd0('0x76')]),'attachments':[{'path':_0x4d4713}]}})[_0x7bd0('0x19')](function(){return _0x474b6e;})[_0x7bd0('0x23')](function(_0x581025){logger[_0x7bd0('0x20')](_0x581025);});})[_0x7bd0('0x19')](respondWithStatusCode(_0x2a9dd3,0xc8))['catch'](handleError(_0x2a9dd3,null));};exports[_0x7bd0('0x96')]=function(_0x351690,_0x4743c3){return db[_0x7bd0('0x60')][_0x7bd0('0x47')]({'where':{'id':_0x351690[_0x7bd0('0x49')]['id']}})[_0x7bd0('0x19')](handleEntityNotFound(_0x4743c3,null))[_0x7bd0('0x19')](function(_0x2f7295){if(_0x2f7295){return _0x2f7295[_0x7bd0('0x96')](_0x351690['body']['ids'],_['omit'](_0x351690['body'],['ids','id'])||{});}})[_0x7bd0('0x19')](respondWithResult(_0x4743c3,null))[_0x7bd0('0x23')](handleError(_0x4743c3,null));};exports[_0x7bd0('0x97')]=function(_0x595e2a,_0x2997e8){var _0x4eda5b={'raw':![],'where':{}};var _0xc3aeda={};var _0x53cb04={'count':0x0,'rows':[]};return db[_0x7bd0('0x38')][_0x7bd0('0x6e')]({'where':{'id':_0x595e2a['params']['id']}})[_0x7bd0('0x19')](handleEntityNotFound(_0x2997e8,null))['then'](function(_0x4ae964){if(_0x4ae964){_0xc3aeda[_0x7bd0('0x3e')]=_[_0x7bd0('0x98')](db['ChatMessage'][_0x7bd0('0x3f')]);_0xc3aeda['query']=_['keys'](_0x595e2a[_0x7bd0('0x40')]);_0xc3aeda['filters']=_[_0x7bd0('0x41')](_0xc3aeda['model'],_0xc3aeda['query']);_0x4eda5b['attributes']=_[_0x7bd0('0x41')](_0xc3aeda['model'],qs[_0x7bd0('0x43')](_0x595e2a[_0x7bd0('0x40')][_0x7bd0('0x43')]));_0x4eda5b['attributes']=_0x4eda5b[_0x7bd0('0x42')]['length']?_0x4eda5b[_0x7bd0('0x42')]:_0xc3aeda[_0x7bd0('0x3e')];if(!_0x595e2a['query'][_0x7bd0('0x99')](_0x7bd0('0x9a'))){_0x4eda5b[_0x7bd0('0x28')]=qs[_0x7bd0('0x28')](_0x595e2a['query'][_0x7bd0('0x28')]);_0x4eda5b[_0x7bd0('0x2b')]=qs[_0x7bd0('0x2b')](_0x595e2a[_0x7bd0('0x40')][_0x7bd0('0x2b')]);}_0x4eda5b[_0x7bd0('0x9b')]=qs[_0x7bd0('0x9c')](_0x595e2a[_0x7bd0('0x40')][_0x7bd0('0x9c')]);_0x4eda5b[_0x7bd0('0x9d')]=qs[_0x7bd0('0x9e')](_['pick'](_0x595e2a[_0x7bd0('0x40')],_0xc3aeda[_0x7bd0('0x9e')]));_0x4eda5b[_0x7bd0('0x9d')][_0x7bd0('0x9f')]=_0x4ae964['id'];if(_0x595e2a[_0x7bd0('0x40')][_0x7bd0('0xa0')]){_0x4eda5b[_0x7bd0('0x9d')]=_[_0x7bd0('0x32')](_0x4eda5b[_0x7bd0('0x9d')],{'$or':_[_0x7bd0('0x37')](_0x4eda5b[_0x7bd0('0x42')],function(_0x5d8f8b){var _0x3b2d08={};_0x3b2d08[_0x5d8f8b]={'$like':'%'+_0x595e2a[_0x7bd0('0x40')][_0x7bd0('0xa0')]+'%'};return _0x3b2d08;})});}if(_0x595e2a['query'][_0x7bd0('0xa1')]){var _0x30c025=_0x595e2a[_0x7bd0('0x40')][_0x7bd0('0xa1')][_0x7bd0('0xa2')](',');var _0xaad2b2={};_0xaad2b2[_0x30c025[0x0]]={'$gte':moment(_0x30c025[0x1])[_0x7bd0('0x77')](_0x7bd0('0xa3'))};_0x4eda5b[_0x7bd0('0x9d')]=_[_0x7bd0('0x32')](_0x4eda5b[_0x7bd0('0x9d')],_0xaad2b2);}_0x4eda5b=_[_0x7bd0('0x32')]({},_0x4eda5b,_0x595e2a[_0x7bd0('0x46')]);return db[_0x7bd0('0x60')][_0x7bd0('0x2a')]({'where':_0x4eda5b['where']})[_0x7bd0('0x19')](function(_0x4576c3){_0x53cb04[_0x7bd0('0x2a')]=_0x4576c3;if(_0x595e2a[_0x7bd0('0x40')][_0x7bd0('0x44')]){_0x4eda5b[_0x7bd0('0x45')]=[{'all':!![]}];}return db[_0x7bd0('0x60')][_0x7bd0('0xa4')](_0x4eda5b);})[_0x7bd0('0x19')](function(_0x1c7948){_0x53cb04[_0x7bd0('0xa5')]=_0x1c7948;return _0x53cb04;});}})['then'](respondWithFilteredResult(_0x2997e8,_0x4eda5b))[_0x7bd0('0x23')](handleError(_0x2997e8,null));};exports[_0x7bd0('0xa6')]=function(_0x6212a3,_0x40f600){var _0x421dc6={'where':{}},_0x5f0667={},_0x1d9147={'count':0x0,'rows':[]};return db[_0x7bd0('0x38')]['findOne']({'where':{'id':_0x6212a3[_0x7bd0('0x49')]['id']}})[_0x7bd0('0x19')](handleEntityNotFound(_0x40f600,null))['then'](function(_0x4b9be5){if(_0x4b9be5){_0x5f0667[_0x7bd0('0x3e')]=_[_0x7bd0('0x98')](db['ChatMessage'][_0x7bd0('0x3f')]);_0x5f0667[_0x7bd0('0x40')]=_['keys'](_0x6212a3[_0x7bd0('0x40')]);_0x5f0667[_0x7bd0('0x9e')]=_[_0x7bd0('0x41')](_0x5f0667[_0x7bd0('0x3e')],_0x5f0667[_0x7bd0('0x40')]);_0x421dc6[_0x7bd0('0x42')]=_[_0x7bd0('0x41')](_0x5f0667[_0x7bd0('0x3e')],qs[_0x7bd0('0x43')](_0x6212a3[_0x7bd0('0x40')][_0x7bd0('0x43')]));_0x421dc6[_0x7bd0('0x42')]=_0x421dc6[_0x7bd0('0x42')][_0x7bd0('0x7e')]?_0x421dc6[_0x7bd0('0x42')]:_0x5f0667[_0x7bd0('0x3e')];if(!_0x6212a3[_0x7bd0('0x40')][_0x7bd0('0x99')](_0x7bd0('0x9a'))){_0x421dc6['limit']=qs['limit'](_0x6212a3['query'][_0x7bd0('0x28')]);_0x421dc6[_0x7bd0('0x2b')]=qs['offset'](_0x6212a3[_0x7bd0('0x40')]['offset']);}_0x421dc6['order']=qs[_0x7bd0('0x9c')](_0x6212a3[_0x7bd0('0x40')][_0x7bd0('0x9c')]);_0x421dc6['where']=qs[_0x7bd0('0x9e')](_[_0x7bd0('0xa7')](_0x6212a3['query'],_0x5f0667[_0x7bd0('0x9e')]));_0x421dc6[_0x7bd0('0x9d')][_0x7bd0('0x9f')]=_0x4b9be5['id'];if(_0x6212a3[_0x7bd0('0x40')][_0x7bd0('0xa0')]){_0x421dc6[_0x7bd0('0x9d')]=_[_0x7bd0('0x32')](_0x421dc6[_0x7bd0('0x9d')],{'$or':_['map'](_0x421dc6[_0x7bd0('0x42')],function(_0xdce996){var _0x356efe={};_0x356efe[_0xdce996]={'$like':'%'+_0x6212a3[_0x7bd0('0x40')][_0x7bd0('0xa0')]+'%'};return _0x356efe;})});}_0x421dc6[_0x7bd0('0x9d')][_0x7bd0('0x8b')]=![];if(_0x6212a3[_0x7bd0('0x40')]['id']){_0x421dc6[_0x7bd0('0x9d')]['id']={'$gt':_0x6212a3[_0x7bd0('0x40')]['id']};}_0x421dc6=_[_0x7bd0('0x32')]({},_0x421dc6,_0x6212a3[_0x7bd0('0x46')]);return db[_0x7bd0('0x60')][_0x7bd0('0x2a')]({'where':_0x421dc6[_0x7bd0('0x9d')]})[_0x7bd0('0x19')](function(_0x39b9ba){_0x1d9147[_0x7bd0('0x2a')]=_0x39b9ba;_0x421dc6[_0x7bd0('0x45')]=[];if(_0x6212a3[_0x7bd0('0x40')][_0x7bd0('0xa8')]){_0x421dc6[_0x7bd0('0x45')][_0x7bd0('0xa9')]({'model':db['User'],'as':_0x7bd0('0x7c'),'attributes':['id','fullname',_0x7bd0('0x88')]});}if(_0x6212a3[_0x7bd0('0x40')][_0x7bd0('0x44')]){_0x421dc6[_0x7bd0('0x45')]=[{'all':!![]}];}return db[_0x7bd0('0x60')][_0x7bd0('0xa4')](_0x421dc6);})[_0x7bd0('0x19')](function(_0x5d2992){_0x1d9147[_0x7bd0('0xa5')]=_0x5d2992;return _0x1d9147;});}})['then'](respondWithFilteredResult(_0x40f600,_0x421dc6))[_0x7bd0('0x23')](handleError(_0x40f600,null));};exports[_0x7bd0('0xaa')]=function(_0x199767,_0x4210cc){return db[_0x7bd0('0x38')]['find']({'where':{'id':_0x199767[_0x7bd0('0x49')]['id']}})[_0x7bd0('0x19')](handleEntityNotFound(_0x4210cc,null))[_0x7bd0('0x19')](function(_0x47e5c6){if(_0x47e5c6){return _0x47e5c6['setTags'](_0x199767[_0x7bd0('0x33')][_0x7bd0('0xab')],_[_0x7bd0('0xac')](_0x199767[_0x7bd0('0x33')],[_0x7bd0('0xab'),'id'])||{})[_0x7bd0('0xad')](function(){return db[_0x7bd0('0xae')][_0x7bd0('0xa4')]({'attributes':['id',_0x7bd0('0x30'),_0x7bd0('0xaf')],'where':{'id':_0x199767[_0x7bd0('0x33')][_0x7bd0('0xab')]}});})['then'](function(_0x27340d){socket[_0x7bd0('0xb0')](_0x7bd0('0xb1'),{'id':Number(_0x199767['params']['id']),'tags':_0x27340d||[]});return{'id':Number(_0x199767[_0x7bd0('0x49')]['id']),'tags':_0x27340d||[]};});}})[_0x7bd0('0x19')](respondWithResult(_0x4210cc,null))[_0x7bd0('0x23')](handleError(_0x4210cc,null));};exports['removeTags']=function(_0x23a86d,_0x666bef){return db[_0x7bd0('0x38')][_0x7bd0('0x47')]({'where':{'id':_0x23a86d[_0x7bd0('0x49')]['id']}})['then'](handleEntityNotFound(_0x666bef,null))[_0x7bd0('0x19')](function(_0x3f70b1){if(_0x3f70b1){return _0x3f70b1[_0x7bd0('0xb2')](_0x23a86d[_0x7bd0('0x40')][_0x7bd0('0xab')]);}})['then'](respondWithStatusCode(_0x666bef,null))[_0x7bd0('0x23')](handleError(_0x666bef,null));};exports[_0x7bd0('0x74')]=function(_0x25dbc3,_0x21518f){var _0x3ea634=moment()['unix']()[_0x7bd0('0xb3')]();var _0x1d3d8b=path[_0x7bd0('0x70')](config[_0x7bd0('0x71')],_0x7bd0('0xb4'),_0x7bd0('0xb5'),'tmp');var _0x4315d0=path['join'](config[_0x7bd0('0x71')],'server',_0x7bd0('0xb5'),'attachments');var _0x2fe71f=path[_0x7bd0('0x70')](_0x1d3d8b,_0x3ea634);var _0x34502c=util['format']('transcript-%d-%s.zip',_0x25dbc3['params']['id'],_0x3ea634);var _0x59635d=path[_0x7bd0('0x70')](_0x1d3d8b,_0x34502c);var _0x4d076f=[];_0x4d076f[_0x7bd0('0xa9')]({'model':db[_0x7bd0('0x7c')],'as':_0x7bd0('0x7c'),'attributes':['id','fullname'],'raw':!![]});_0x4d076f[_0x7bd0('0xa9')]({'model':db['CmContact'],'as':_0x7bd0('0xb6'),'attributes':['id',_0x7bd0('0xb7'),_0x7bd0('0xb8')],'raw':!![]});if(_0x25dbc3['query']['attachments']){_0x4d076f['push']({'model':db[_0x7bd0('0x6d')],'as':'Attachment','raw':!![]});}var _0x20d508=[{'model':db[_0x7bd0('0x60')],'as':'Messages','attributes':['id',_0x7bd0('0x33'),_0x7bd0('0xb9'),_0x7bd0('0x8a'),_0x7bd0('0x8b'),_0x7bd0('0xba')],'include':_0x4d076f}];_0x20d508[_0x7bd0('0xa9')]({'model':db[_0x7bd0('0x4c')],'as':_0x7bd0('0xbb'),'attributes':['id','name']});_0x20d508[_0x7bd0('0xa9')]({'model':db[_0x7bd0('0x7c')],'as':_0x7bd0('0xbc'),'attributes':['id','fullname']});return db[_0x7bd0('0x38')][_0x7bd0('0x47')]({'where':{'id':_0x25dbc3['params']['id']},'include':_0x20d508})['then'](handleEntityNotFound(_0x21518f,null))[_0x7bd0('0x19')](function(_0x5af7e6){if(_0x5af7e6){var _0xd69b3e=_0x5af7e6[_0x7bd0('0xbd')]({'plain':!![]});fs['mkdirSync'](_0x2fe71f);var _0x34b817={'channel':'Chat','account':_0xd69b3e[_0x7bd0('0xbb')]['name'],'agent':_0xd69b3e[_0x7bd0('0xbc')]?_0xd69b3e[_0x7bd0('0xbc')][_0x7bd0('0x51')]:'N.A.','createdAt':moment(_0xd69b3e[_0x7bd0('0xb9')])[_0x7bd0('0x77')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7bd0('0xb3')](),'closedAt':_0xd69b3e['closed']?moment(_0xd69b3e[_0x7bd0('0xbe')])[_0x7bd0('0x77')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7bd0('0xb3')]():'','disposition':_0xd69b3e[_0x7bd0('0xbf')],'chatInfo':{'browser':_0xd69b3e[_0x7bd0('0xc0')],'os':_0xd69b3e[_0x7bd0('0xc1')],'referer':_0xd69b3e[_0x7bd0('0xc2')],'customerIp':_0xd69b3e[_0x7bd0('0xc3')],'customerPort':_0xd69b3e[_0x7bd0('0xc4')]?_0xd69b3e['customerPort']:_0x7bd0('0xc5')},'messages':_(_0xd69b3e[_0x7bd0('0x7b')])[_0x7bd0('0xc6')]()['filter']({'secret':![]})[_0x7bd0('0x37')](function(_0x228978){if(_0x228978[_0x7bd0('0x6d')]){var _0x2e5933=path[_0x7bd0('0x70')](_0x4315d0,_0x228978[_0x7bd0('0x6d')][_0x7bd0('0x68')]);if(fs[_0x7bd0('0xc7')](_0x2e5933)){fs[_0x7bd0('0xc8')](_0x2e5933)[_0x7bd0('0xc9')](fs[_0x7bd0('0xca')](path[_0x7bd0('0x70')](_0x2fe71f,_0x228978[_0x7bd0('0x6d')][_0x7bd0('0x68')])));}}return{'date':moment(_0x228978[_0x7bd0('0xb9')])[_0x7bd0('0x77')](_0x7bd0('0xa3'))[_0x7bd0('0xb3')](),'sender':_0x228978[_0x7bd0('0x8a')]===_0x7bd0('0x5f')?_0x228978[_0x7bd0('0x7c')]?_0x228978[_0x7bd0('0x7c')][_0x7bd0('0x51')]:_0x7bd0('0x86'):_0x228978[_0x7bd0('0xb6')][_0x7bd0('0xb7')]+(_0x228978[_0x7bd0('0xb6')][_0x7bd0('0xb8')]?'\x20'+_0x228978[_0x7bd0('0xb6')]['lastName']:''),'body':_0x228978[_0x7bd0('0x6d')]?_0x228978[_0x7bd0('0x6d')][_0x7bd0('0x68')]:_0x228978[_0x7bd0('0x33')],'direction':_0x228978[_0x7bd0('0x8a')]==='out'?'A':'C','secret':_0x228978[_0x7bd0('0x8b')],'read':_0x228978[_0x7bd0('0xba')],'attachment':_0x228978[_0x7bd0('0x6d')]};})[_0x7bd0('0xcb')]()};return ejs['renderFile'](path[_0x7bd0('0x70')](config[_0x7bd0('0x71')],_0x7bd0('0xb4'),_0x7bd0('0xcc'),_0x7bd0('0xcd')),{'interaction':_0x34b817})[_0x7bd0('0x19')](function(_0x16fd74){var _0x2bafa1=path[_0x7bd0('0x70')](_0x2fe71f,'transcript-'+_0xd69b3e['id']+'-'+_0x3ea634+'.pdf');var _0x47b69c={'path':_0x2bafa1,'channel':_0x7bd0('0xce'),'interactionId':_0xd69b3e['id']};return pdf[_0x7bd0('0xcf')](_0x16fd74,_0x47b69c);})[_0x7bd0('0x19')](function(){return new Promise(function(_0x11e48e,_0x2e82f6){zipdir(_0x2fe71f,{'saveTo':_0x59635d},function(_0x367023,_0x5957e2){if(_0x367023)return _0x2e82f6(_0x367023);return _0x11e48e(_0x5957e2);});})[_0x7bd0('0x19')](function(){return new BPromise(function(_0x2199b2,_0x2c9c46){rimraf(_0x2fe71f,function(_0x24ba3c){if(_0x24ba3c)_0x2c9c46(_0x24ba3c);return _0x2199b2();});});})[_0x7bd0('0x19')](function(){return _0x21518f[_0x7bd0('0x74')](_0x59635d,_0x34502c,function(_0x128b14){if(_0x128b14){logger['error'](_0x7bd0('0xd0'),_0x128b14);}else{fs[_0x7bd0('0xd1')](_0x59635d);}});});});}else{return _0x21518f[_0x7bd0('0x24')](0xc8);}})['catch'](handleError(_0x21518f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 14e08f8..930f2d9 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 _0x091b=['catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit'];(function(_0x5050c1,_0x5bf217){var _0x5390b5=function(_0x33dcd1){while(--_0x33dcd1){_0x5050c1['push'](_0x5050c1['shift']());}};_0x5390b5(++_0x5bf217);}(_0x091b,0x125));var _0xb091=function(_0x123591,_0x3d4082){_0x123591=_0x123591-0x0;var _0x2cfb18=_0x091b[_0x123591];return _0x2cfb18;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xb091('0x0'))['db'][_0xb091('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xb091('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb091('0x3')](0x0);var events={'afterCreate':_0xb091('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x439ac4){return function(_0x4578b2,_0x561a98,_0x2324b7){_0x4578b2[_0xb091('0x5')]({'attributes':['id'],'raw':!![]})[_0xb091('0x6')](function(_0xe4b84d){_0x4578b2[_0xb091('0x7')](_0xb091('0x8'),_0xe4b84d[_0xb091('0x9')](function(_0x27131d){return{'id':_0x27131d['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4578b2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb091('0x6')](function(_0x506c53){_0x4578b2['setDataValue'](_0xb091('0xa'),_0x506c53[_0xb091('0xb')]);ChatInteractionEvents['emit'](_0x439ac4+':'+_0x4578b2['id'],_0x4578b2);ChatInteractionEvents[_0xb091('0xc')](_0x439ac4,_0x4578b2);_0x2324b7(null);})[_0xb091('0xd')](_0x2324b7(null));};}for(var e in events){if(events[_0xb091('0xe')](e)){var event=events[e];ChatInteraction[_0xb091('0xf')](e,emitEvent(event));}}module[_0xb091('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x6aa5=['hook','events','../../mysqldb','ChatMessage','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty'];(function(_0x4dd072,_0x32138b){var _0x2fd8c9=function(_0x511407){while(--_0x511407){_0x4dd072['push'](_0x4dd072['shift']());}};_0x2fd8c9(++_0x32138b);}(_0x6aa5,0x14b));var _0x56aa=function(_0x43b01f,_0xc784fd){_0x43b01f=_0x43b01f-0x0;var _0xbbd9f8=_0x6aa5[_0x43b01f];return _0xbbd9f8;};'use strict';var EventEmitter=require(_0x56aa('0x0'));var ChatInteraction=require(_0x56aa('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x56aa('0x1'))['db'][_0x56aa('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x56aa('0x3'),'afterDestroy':_0x56aa('0x4')};function emitEvent(_0x19ff34){return function(_0x5a11ad,_0x32aa7d,_0x2dfaaf){_0x5a11ad[_0x56aa('0x5')]({'attributes':['id'],'raw':!![]})[_0x56aa('0x6')](function(_0x5c3287){_0x5a11ad[_0x56aa('0x7')](_0x56aa('0x8'),_0x5c3287['map'](function(_0x5798e7){return{'id':_0x5798e7['id']};}));return ChatMessage[_0x56aa('0x9')]({'where':{'ChatInteractionId':_0x5a11ad['id'],'direction':'in','read':![]},'raw':!![]});})[_0x56aa('0x6')](function(_0x321dd5){_0x5a11ad[_0x56aa('0x7')](_0x56aa('0xa'),_0x321dd5[_0x56aa('0xb')]);ChatInteractionEvents[_0x56aa('0xc')](_0x19ff34+':'+_0x5a11ad['id'],_0x5a11ad);ChatInteractionEvents[_0x56aa('0xc')](_0x19ff34,_0x5a11ad);_0x2dfaaf(null);})['catch'](_0x2dfaaf(null));};}for(var e in events){if(events[_0x56aa('0xd')](e)){var event=events[e];ChatInteraction[_0x56aa('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 46dae57..bdb3fdc 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 _0x069e=['rimraf','../../config/environment','./chatInteraction.attributes','define','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4331f8,_0xe06640){var _0x44a1a5=function(_0x2c5e92){while(--_0x2c5e92){_0x4331f8['push'](_0x4331f8['shift']());}};_0x44a1a5(++_0xe06640);}(_0x069e,0xc9));var _0xe069=function(_0x93d7e0,_0x3ecdf4){_0x93d7e0=_0x93d7e0-0x0;var _0x1e93e8=_0x069e[_0x93d7e0];return _0x1e93e8;};'use strict';var _=require(_0xe069('0x0'));var util=require(_0xe069('0x1'));var logger=require(_0xe069('0x2'))(_0xe069('0x3'));var moment=require(_0xe069('0x4'));var BPromise=require(_0xe069('0x5'));var rp=require(_0xe069('0x6'));var fs=require('fs');var path=require(_0xe069('0x7'));var rimraf=require(_0xe069('0x8'));var config=require(_0xe069('0x9'));var attributes=require(_0xe069('0xa'));module['exports']=function(_0x1b4899,_0x13d860){return _0x1b4899[_0xe069('0xb')]('ChatInteraction',attributes,{'tableName':_0xe069('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5dfde3,_0x56f9a8,_0x5a5f6b){if(_0x5dfde3[_0xe069('0xd')](_0xe069('0xe'))){_0x5dfde3['closedAt']=moment()[_0xe069('0xf')](_0xe069('0x10'));}_0x5a5f6b(null,_0x5dfde3);}},'charset':_0xe069('0x11'),'collate':_0xe069('0x12')});}; \ No newline at end of file +var _0xd0ba=['chat_interactions','changed','closed','format','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x177452,_0x76dd98){var _0x4e41fa=function(_0x5826bc){while(--_0x5826bc){_0x177452['push'](_0x177452['shift']());}};_0x4e41fa(++_0x76dd98);}(_0xd0ba,0xaf));var _0xad0b=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xd0ba[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xad0b('0x0'));var util=require('util');var logger=require(_0xad0b('0x1'))(_0xad0b('0x2'));var moment=require(_0xad0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xad0b('0x4'));var fs=require('fs');var path=require(_0xad0b('0x5'));var rimraf=require(_0xad0b('0x6'));var config=require(_0xad0b('0x7'));var attributes=require(_0xad0b('0x8'));module[_0xad0b('0x9')]=function(_0x46d157,_0x40cbd3){return _0x46d157[_0xad0b('0xa')](_0xad0b('0xb'),attributes,{'tableName':_0xad0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d3e67,_0x213439,_0xe73649){if(_0x4d3e67[_0xad0b('0xd')](_0xad0b('0xe'))){_0x4d3e67['closedAt']=moment()[_0xad0b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0xe73649(null,_0x4d3e67);}},'charset':'utf8mb4','collate':_0xad0b('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6653254..765a326 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 _0x7efa=['request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','find','addTags','ids','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','register'];(function(_0x396825,_0x3af740){var _0x9e9546=function(_0x4db605){while(--_0x4db605){_0x396825['push'](_0x396825['shift']());}};_0x9e9546(++_0x3af740);}(_0x7efa,0x67));var _0xa7ef=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x7efa[_0x1e2080];return _0x260111;};'use strict';var _=require('lodash');var util=require(_0xa7ef('0x0'));var moment=require('moment');var BPromise=require(_0xa7ef('0x1'));var rs=require(_0xa7ef('0x2'));var fs=require('fs');var Redis=require(_0xa7ef('0x3'));var db=require(_0xa7ef('0x4'))['db'];var utils=require(_0xa7ef('0x5'));var logger=require(_0xa7ef('0x6'))(_0xa7ef('0x7'));var config=require(_0xa7ef('0x8'));var jayson=require(_0xa7ef('0x9'));var client=jayson[_0xa7ef('0xa')]['http']({'port':0x232a});config[_0xa7ef('0xb')]=_['defaults'](config['redis'],{'host':_0xa7ef('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7ef('0xb')]));require('./chatInteraction.socket')[_0xa7ef('0xd')](socket);function respondWithRpcPromise(_0x2bd6ed,_0x48aabf,_0x2c2b50){return new BPromise(function(_0x1215b8,_0x3a4532){return client[_0xa7ef('0xe')](_0x2bd6ed,_0x2c2b50)[_0xa7ef('0xf')](function(_0x3808bb){logger[_0xa7ef('0x10')](_0xa7ef('0x11'),_0x48aabf,_0xa7ef('0x12'));logger[_0xa7ef('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x48aabf,_0xa7ef('0x12'),JSON[_0xa7ef('0x14')](_0x3808bb));if(_0x3808bb['error']){if(_0x3808bb[_0xa7ef('0x15')][_0xa7ef('0x16')]===0x1f4){logger['error'](_0xa7ef('0x11'),_0x48aabf,_0x3808bb[_0xa7ef('0x15')][_0xa7ef('0x17')]);return _0x3a4532(_0x3808bb[_0xa7ef('0x15')][_0xa7ef('0x17')]);}logger[_0xa7ef('0x15')](_0xa7ef('0x11'),_0x48aabf,_0x3808bb[_0xa7ef('0x15')][_0xa7ef('0x17')]);return _0x1215b8(_0x3808bb[_0xa7ef('0x15')][_0xa7ef('0x17')]);}else{logger[_0xa7ef('0x10')](_0xa7ef('0x11'),_0x48aabf,_0xa7ef('0x12'));_0x1215b8(_0x3808bb[_0xa7ef('0x18')][_0xa7ef('0x17')]);}})[_0xa7ef('0x19')](function(_0x2c8cdb){logger[_0xa7ef('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x48aabf,_0x2c8cdb);_0x3a4532(_0x2c8cdb);});});}exports[_0xa7ef('0x1a')]=function(_0x46ff2f){var _0x358294=this;return new Promise(function(_0x1bf8f5,_0xf3c403){return db[_0xa7ef('0x1b')]['update'](_0x46ff2f[_0xa7ef('0x1c')],{'raw':_0x46ff2f[_0xa7ef('0x1d')]?_0x46ff2f['options'][_0xa7ef('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46ff2f['options']?_0x46ff2f[_0xa7ef('0x1d')][_0xa7ef('0x1f')]||null:null,'attributes':_0x46ff2f['options']?_0x46ff2f[_0xa7ef('0x1d')][_0xa7ef('0x20')]||null:null,'limit':_0x46ff2f[_0xa7ef('0x1d')]?_0x46ff2f['options'][_0xa7ef('0x21')]||null:null})['then'](function(_0x20c976){logger['info'](_0xa7ef('0x1a'),_0x46ff2f);logger[_0xa7ef('0x13')](_0xa7ef('0x1a'),_0x46ff2f,JSON['stringify'](_0x20c976));_0x1bf8f5(_0x20c976);})[_0xa7ef('0x19')](function(_0x47eac3){logger['error'](_0xa7ef('0x1a'),_0x47eac3[_0xa7ef('0x17')],_0x46ff2f);_0xf3c403(_0x358294[_0xa7ef('0x15')](0x1f4,_0x47eac3['message']));});});};exports['AddTagsToChatInteraction']=function(_0x3df286){return new Promise(function(_0x3671e7,_0x1a2ec2){return db[_0xa7ef('0x1b')][_0xa7ef('0x22')]({'where':_0x3df286[_0xa7ef('0x1d')]?_0x3df286[_0xa7ef('0x1d')][_0xa7ef('0x1f')]||null:null})[_0xa7ef('0xf')](function(_0x3e8b25){if(_0x3e8b25){return _0x3e8b25[_0xa7ef('0x23')](_0x3df286[_0xa7ef('0x1c')][_0xa7ef('0x24')],_['omit'](_0x3df286['body'],[_0xa7ef('0x24'),'id'])||{});}})[_0xa7ef('0x25')](function(_0x48a164){logger[_0xa7ef('0x10')](_0xa7ef('0x26'),_0x3df286);logger[_0xa7ef('0x13')](_0xa7ef('0x26'),_0x3df286,JSON['stringify'](_0x48a164));_0x3671e7(_0x48a164);})[_0xa7ef('0x19')](function(_0x57b10f){logger[_0xa7ef('0x15')](_0xa7ef('0x26'),_0x57b10f[_0xa7ef('0x17')],_0x3df286);_0x1a2ec2(_this[_0xa7ef('0x15')](0x1f4,_0x57b10f[_0xa7ef('0x17')]));});});}; \ No newline at end of file +var _0x3952=['find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateChatInteraction','options','where','attributes','limit','debug','AddTagsToChatInteraction','ChatInteraction'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x3952,0x85));var _0x2395=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x3952[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0x2395('0x0'));var util=require(_0x2395('0x1'));var moment=require(_0x2395('0x2'));var BPromise=require(_0x2395('0x3'));var rs=require(_0x2395('0x4'));var fs=require('fs');var Redis=require(_0x2395('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2395('0x6'));var logger=require(_0x2395('0x7'))('rpc');var config=require(_0x2395('0x8'));var jayson=require(_0x2395('0x9'));var client=jayson['client'][_0x2395('0xa')]({'port':0x232a});config['redis']=_[_0x2395('0xb')](config['redis'],{'host':_0x2395('0xc'),'port':0x18eb});var socket=require(_0x2395('0xd'))(new Redis(config[_0x2395('0xe')]));require('./chatInteraction.socket')[_0x2395('0xf')](socket);function respondWithRpcPromise(_0x53a7c5,_0x390555,_0x9324a0){return new BPromise(function(_0x5ca2d2,_0x4e30f6){return client[_0x2395('0x10')](_0x53a7c5,_0x9324a0)[_0x2395('0x11')](function(_0x5497ca){logger[_0x2395('0x12')](_0x2395('0x13'),_0x390555,'request\x20sent');logger['debug'](_0x2395('0x14'),_0x390555,_0x2395('0x15'),JSON[_0x2395('0x16')](_0x5497ca));if(_0x5497ca[_0x2395('0x17')]){if(_0x5497ca['error'][_0x2395('0x18')]===0x1f4){logger[_0x2395('0x17')](_0x2395('0x13'),_0x390555,_0x5497ca[_0x2395('0x17')]['message']);return _0x4e30f6(_0x5497ca['error'][_0x2395('0x19')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x390555,_0x5497ca[_0x2395('0x17')][_0x2395('0x19')]);return _0x5ca2d2(_0x5497ca[_0x2395('0x17')][_0x2395('0x19')]);}else{logger['info'](_0x2395('0x13'),_0x390555,_0x2395('0x15'));_0x5ca2d2(_0x5497ca['result'][_0x2395('0x19')]);}})[_0x2395('0x1a')](function(_0x523fcb){logger[_0x2395('0x17')](_0x2395('0x13'),_0x390555,_0x523fcb);_0x4e30f6(_0x523fcb);});});}exports[_0x2395('0x1b')]=function(_0x1db2b3){var _0x2a6f19=this;return new Promise(function(_0x55c0e1,_0x3a7073){return db['ChatInteraction']['update'](_0x1db2b3['body'],{'raw':_0x1db2b3[_0x2395('0x1c')]?_0x1db2b3[_0x2395('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1db2b3[_0x2395('0x1c')]?_0x1db2b3[_0x2395('0x1c')][_0x2395('0x1d')]||null:null,'attributes':_0x1db2b3[_0x2395('0x1c')]?_0x1db2b3[_0x2395('0x1c')][_0x2395('0x1e')]||null:null,'limit':_0x1db2b3['options']?_0x1db2b3[_0x2395('0x1c')][_0x2395('0x1f')]||null:null})[_0x2395('0x11')](function(_0x1fe68){logger[_0x2395('0x12')](_0x2395('0x1b'),_0x1db2b3);logger[_0x2395('0x20')](_0x2395('0x1b'),_0x1db2b3,JSON[_0x2395('0x16')](_0x1fe68));_0x55c0e1(_0x1fe68);})[_0x2395('0x1a')](function(_0x44de44){logger[_0x2395('0x17')](_0x2395('0x1b'),_0x44de44[_0x2395('0x19')],_0x1db2b3);_0x3a7073(_0x2a6f19[_0x2395('0x17')](0x1f4,_0x44de44[_0x2395('0x19')]));});});};exports[_0x2395('0x21')]=function(_0x3f784e){return new Promise(function(_0x5602b0,_0x2dc347){return db[_0x2395('0x22')][_0x2395('0x23')]({'where':_0x3f784e[_0x2395('0x1c')]?_0x3f784e[_0x2395('0x1c')][_0x2395('0x1d')]||null:null})['then'](function(_0x411821){if(_0x411821){return _0x411821[_0x2395('0x24')](_0x3f784e[_0x2395('0x25')][_0x2395('0x26')],_[_0x2395('0x27')](_0x3f784e['body'],['ids','id'])||{});}})[_0x2395('0x28')](function(_0x9be2ae){logger[_0x2395('0x12')]('AddTags',_0x3f784e);logger['debug'](_0x2395('0x29'),_0x3f784e,JSON[_0x2395('0x16')](_0x9be2ae));_0x5602b0(_0x9be2ae);})[_0x2395('0x1a')](function(_0x5b00a2){logger[_0x2395('0x17')](_0x2395('0x29'),_0x5b00a2['message'],_0x3f784e);_0x2dc347(_this[_0x2395('0x17')](0x1f4,_0x5b00a2[_0x2395('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 63b21a1..4652a38 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 _0x453e=['emit','removeListener','register','length','./chatInteraction.events','remove','update'];(function(_0x43662e,_0x889f04){var _0xe04e18=function(_0x1a45fe){while(--_0x1a45fe){_0x43662e['push'](_0x43662e['shift']());}};_0xe04e18(++_0x889f04);}(_0x453e,0xdd));var _0xe453=function(_0x443bdd,_0x517654){_0x443bdd=_0x443bdd-0x0;var _0x3a1e48=_0x453e[_0x443bdd];return _0x3a1e48;};'use strict';var ChatInteractionEvents=require(_0xe453('0x0'));var events=['save',_0xe453('0x1'),_0xe453('0x2')];function createListener(_0x2eee95,_0x55ff5c){return function(_0x1a3e55){_0x55ff5c[_0xe453('0x3')](_0x2eee95,_0x1a3e55);};}function removeListener(_0x2cef8b,_0x1423b4){return function(){ChatInteractionEvents[_0xe453('0x4')](_0x2cef8b,_0x1423b4);};}exports[_0xe453('0x5')]=function(_0x4bce74){for(var _0x23f399=0x0,_0x4981de=events[_0xe453('0x6')];_0x23f399<_0x4981de;_0x23f399++){var _0x25ec44=events[_0x23f399];var _0x1cb276=createListener('chatInteraction:'+_0x25ec44,_0x4bce74);ChatInteractionEvents['on'](_0x25ec44,_0x1cb276);}}; \ No newline at end of file +var _0x8d19=['./chatInteraction.events','save','update','emit','removeListener','length','chatInteraction:'];(function(_0x3ec86d,_0x121629){var _0x5bfe3f=function(_0x54fc28){while(--_0x54fc28){_0x3ec86d['push'](_0x3ec86d['shift']());}};_0x5bfe3f(++_0x121629);}(_0x8d19,0x142));var _0x98d1=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0x8d19[_0x56daff];return _0x132c82;};'use strict';var ChatInteractionEvents=require(_0x98d1('0x0'));var events=[_0x98d1('0x1'),'remove',_0x98d1('0x2')];function createListener(_0x3e5d36,_0x1ff67a){return function(_0x428e7e){_0x1ff67a[_0x98d1('0x3')](_0x3e5d36,_0x428e7e);};}function removeListener(_0xfcfe7b,_0x1f0517){return function(){ChatInteractionEvents[_0x98d1('0x4')](_0xfcfe7b,_0x1f0517);};}exports['register']=function(_0x5be1df){for(var _0x497392=0x0,_0x3acff4=events[_0x98d1('0x5')];_0x497392<_0x3acff4;_0x497392++){var _0x159547=events[_0x497392];var _0x462f5f=createListener(_0x98d1('0x6')+_0x159547,_0x5be1df);ChatInteractionEvents['on'](_0x159547,_0x462f5f);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f2ec879..dad2505 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 _0xf860=['chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','tracked','destroy','delete','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','diskStorage','join','root','format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chat'];(function(_0x171bdf,_0x4c5c9d){var _0x54b6b8=function(_0x5c2a3c){while(--_0x5c2a3c){_0x171bdf['push'](_0x171bdf['shift']());}};_0x54b6b8(++_0x4c5c9d);}(_0xf860,0x74));var _0x0f86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf860[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0f86('0x0'));var util=require(_0x0f86('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0f86('0x2'));var auth=require(_0x0f86('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0f86('0x4'));var controller=require(_0x0f86('0x5'));router['get']('/',auth[_0x0f86('0x6')](),controller[_0x0f86('0x7')]);router[_0x0f86('0x8')](_0x0f86('0x9'),auth[_0x0f86('0x6')](),controller[_0x0f86('0xa')]);router[_0x0f86('0x8')](_0x0f86('0xb'),auth[_0x0f86('0xc')](),controller[_0x0f86('0xd')]);router[_0x0f86('0x8')](_0x0f86('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x0f86('0xf')]);router[_0x0f86('0x8')](_0x0f86('0x10'),auth[_0x0f86('0x6')](),controller[_0x0f86('0x11')]);router[_0x0f86('0x8')](_0x0f86('0x12'),auth[_0x0f86('0xc')](),controller[_0x0f86('0x13')]);router[_0x0f86('0x8')](_0x0f86('0x14'),auth[_0x0f86('0x6')](),controller[_0x0f86('0x15')]);router[_0x0f86('0x16')]('/',auth[_0x0f86('0x6')](),controller['create']);router['post'](_0x0f86('0x17'),auth[_0x0f86('0x6')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x0f86('0x18')]({'destination':function(_0x42bc86,_0x45d5a5,_0x11df64){_0x11df64(null,path[_0x0f86('0x19')](config[_0x0f86('0x1a')],'server/files/attachments/'));},'filename':function(_0x2a29f6,_0x5612af,_0x29a006){_0x29a006(null,util[_0x0f86('0x1b')](_0x0f86('0x1c'),Date['now'](),_0x5612af[_0x0f86('0x1d')][_0x0f86('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0f86('0x16')](_0x0f86('0x1f'),upload[_0x0f86('0x20')]('file'),controller[_0x0f86('0x21')]);router[_0x0f86('0x16')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x0f86('0x22')]);router[_0x0f86('0x16')](_0x0f86('0x23'),auth[_0x0f86('0x6')](),interaction['tracked'](_0x0f86('0x24'),_0x0f86('0x25')),controller[_0x0f86('0x26')]);router[_0x0f86('0x27')](_0x0f86('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x0f86('0x24'),_0x0f86('0x28')),controller[_0x0f86('0x29')]);router[_0x0f86('0x27')]('/:id/custom_update',controller[_0x0f86('0x2a')]);router[_0x0f86('0x27')](_0x0f86('0x2b'),auth[_0x0f86('0xc')](),controller[_0x0f86('0x2c')]);router[_0x0f86('0x27')](_0x0f86('0x2d'),controller[_0x0f86('0x2e')]);router['delete'](_0x0f86('0xb'),auth[_0x0f86('0x6')](),interaction[_0x0f86('0x2f')](_0x0f86('0x24'),'chatinteraction:destroy'),controller[_0x0f86('0x30')]);router[_0x0f86('0x31')](_0x0f86('0x23'),auth[_0x0f86('0x6')](),controller['removeTags']);module[_0x0f86('0x32')]=router; \ No newline at end of file +var _0x1c80=['chatinteraction:destroy','/:id/tags','removeTags','exports','multer','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','originalname','replace','file','attachmentUpload','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close'];(function(_0x1f1283,_0x1bea3b){var _0x205041=function(_0x3f8fe4){while(--_0x3f8fe4){_0x1f1283['push'](_0x1f1283['shift']());}};_0x205041(++_0x1bea3b);}(_0x1c80,0x1da));var _0x01c8=function(_0x52957e,_0x577adb){_0x52957e=_0x52957e-0x0;var _0x3700f0=_0x1c80[_0x52957e];return _0x3700f0;};'use strict';var multer=require(_0x01c8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x01c8('0x1'));var router=express[_0x01c8('0x2')]();var fs_extra=require(_0x01c8('0x3'));var auth=require(_0x01c8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x01c8('0x5')]('/',auth[_0x01c8('0x6')](),controller[_0x01c8('0x7')]);router[_0x01c8('0x5')]('/describe',auth[_0x01c8('0x6')](),controller[_0x01c8('0x8')]);router[_0x01c8('0x5')](_0x01c8('0x9'),auth[_0x01c8('0xa')](),controller['show']);router[_0x01c8('0x5')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x01c8('0xb')]);router[_0x01c8('0x5')](_0x01c8('0xc'),auth[_0x01c8('0x6')](),controller[_0x01c8('0xd')]);router[_0x01c8('0x5')](_0x01c8('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x01c8('0xf')]);router[_0x01c8('0x5')](_0x01c8('0x10'),auth[_0x01c8('0x6')](),controller[_0x01c8('0x11')]);router[_0x01c8('0x12')]('/',auth[_0x01c8('0x6')](),controller[_0x01c8('0x13')]);router[_0x01c8('0x12')](_0x01c8('0x14'),auth[_0x01c8('0x6')](),controller[_0x01c8('0x15')]);var upload=multer({'storage':multer[_0x01c8('0x16')]({'destination':function(_0x5d0e1f,_0x351064,_0x4a0d2d){_0x4a0d2d(null,path[_0x01c8('0x17')](config['root'],_0x01c8('0x18')));},'filename':function(_0xce977c,_0x44011d,_0xe4cf64){_0xe4cf64(null,util[_0x01c8('0x19')]('%s-%s',Date['now'](),_0x44011d[_0x01c8('0x1a')][_0x01c8('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single'](_0x01c8('0x1c')),controller[_0x01c8('0x1d')]);router['post']('/:id/messages',auth[_0x01c8('0xa')](),controller['addMessage']);router[_0x01c8('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x01c8('0x1e'),_0x01c8('0x1f')),controller[_0x01c8('0x20')]);router[_0x01c8('0x21')](_0x01c8('0x9'),auth[_0x01c8('0x6')](),interaction[_0x01c8('0x22')](_0x01c8('0x1e'),_0x01c8('0x23')),controller[_0x01c8('0x24')]);router[_0x01c8('0x21')](_0x01c8('0x25'),controller[_0x01c8('0x26')]);router[_0x01c8('0x21')](_0x01c8('0x27'),auth[_0x01c8('0xa')](),controller[_0x01c8('0x28')]);router['put'](_0x01c8('0x29'),controller[_0x01c8('0x2a')]);router['delete'](_0x01c8('0x9'),auth['isAuthenticated'](),interaction[_0x01c8('0x22')]('chat',_0x01c8('0x2b')),controller['destroy']);router['delete'](_0x01c8('0x2c'),auth[_0x01c8('0x6')](),controller[_0x01c8('0x2d')]);module[_0x01c8('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 82302f1..ac5aaed 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 _0x0f0f=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0f0f,0xdb));var _0xf0f0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f0f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf0f0('0x0'));module['exports']={'body':{'type':Sequelize[_0xf0f0('0x1')](_0xf0f0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf0f0('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf0f0('0x4')]}}; \ No newline at end of file +var _0xe6ad=['TEXT','medium','INTEGER','exports'];(function(_0x104c8e,_0x4f26c8){var _0x39656b=function(_0x460988){while(--_0x460988){_0x104c8e['push'](_0x104c8e['shift']());}};_0x39656b(++_0x4f26c8);}(_0xe6ad,0x173));var _0xde6a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe6ad[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xde6a('0x0')]={'body':{'type':Sequelize[_0xde6a('0x1')](_0xde6a('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xde6a('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 270b43c..16a4fe0 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 _0xdf1d=['destroy','sendStatus','error','stack','name','send','ChatInternalMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','find','create','body','params','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','isEmpty','length','push','ToId','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','bluebird','path','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','count','set','Content-Range','reject','save','update','then'];(function(_0x17af53,_0x11fc33){var _0x57ad55=function(_0x400588){while(--_0x400588){_0x17af53['push'](_0x17af53['shift']());}};_0x57ad55(++_0x11fc33);}(_0xdf1d,0x1bc));var _0xddf1=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdf1d[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0xddf1('0x0'));var rimraf=require(_0xddf1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xddf1('0x2'));var rp=require('request-promise');var moment=require(_0xddf1('0x3'));var BPromise=require(_0xddf1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xddf1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddf1('0x6'));var _=require('lodash');var squel=require(_0xddf1('0x7'));var crypto=require(_0xddf1('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddf1('0x9'));var Redis=require(_0xddf1('0xa'));var authService=require(_0xddf1('0xb'));var qs=require(_0xddf1('0xc'));var as=require(_0xddf1('0xd'));var hardwareService=require(_0xddf1('0xe'));var logger=require(_0xddf1('0xf'))(_0xddf1('0x10'));var utils=require(_0xddf1('0x11'));var config=require(_0xddf1('0x12'));var licenseUtil=require(_0xddf1('0x13'));var db=require('../../mysqldb')['db'];config[_0xddf1('0x14')]=_[_0xddf1('0x15')](config[_0xddf1('0x14')],{'host':_0xddf1('0x16'),'port':0x18eb});var socket=require(_0xddf1('0x17'))(new Redis(config['redis']));require(_0xddf1('0x18'))['register'](socket);function respondWithStatusCode(_0xa0756,_0x4a742d){_0x4a742d=_0x4a742d||0xcc;return function(_0xf6178d){if(_0xf6178d){return _0xa0756['sendStatus'](_0x4a742d);}return _0xa0756[_0xddf1('0x19')](_0x4a742d)[_0xddf1('0x1a')]();};}function respondWithResult(_0x3de032,_0x45b5a9){_0x45b5a9=_0x45b5a9||0xc8;return function(_0x4d73c2){if(_0x4d73c2){return _0x3de032[_0xddf1('0x19')](_0x45b5a9)[_0xddf1('0x1b')](_0x4d73c2);}};}function respondWithFilteredResult(_0xd2bd67,_0x2c6b77){return function(_0x33ae34){if(_0x33ae34){var _0x1837fc=typeof _0x2c6b77[_0xddf1('0x1c')]==='undefined'&&typeof _0x2c6b77['limit']==='undefined';var _0x4efbbb=_0x33ae34[_0xddf1('0x1d')];var _0x4d429c=_0x1837fc?0x0:_0x2c6b77[_0xddf1('0x1c')];var _0x46bf6c=_0x1837fc?_0x33ae34[_0xddf1('0x1d')]:_0x2c6b77[_0xddf1('0x1c')]+_0x2c6b77['limit'];var _0x16e6eb;if(_0x46bf6c>=_0x4efbbb){_0x46bf6c=_0x4efbbb;_0x16e6eb=0xc8;}else{_0x16e6eb=0xce;}_0xd2bd67[_0xddf1('0x19')](_0x16e6eb);return _0xd2bd67[_0xddf1('0x1e')](_0xddf1('0x1f'),_0x4d429c+'-'+_0x46bf6c+'/'+_0x4efbbb)['json'](_0x33ae34);}return null;};}function patchUpdates(_0x37e07e){return function(_0x23d0d8){try{jsonpatch['apply'](_0x23d0d8,_0x37e07e,!![]);}catch(_0x5a3f75){return BPromise[_0xddf1('0x20')](_0x5a3f75);}return _0x23d0d8[_0xddf1('0x21')]();};}function saveUpdates(_0x4ce8da,_0x37a160){return function(_0x26d63d){if(_0x26d63d){return _0x26d63d[_0xddf1('0x22')](_0x4ce8da)[_0xddf1('0x23')](function(_0x3e1dba){return _0x3e1dba;});}return null;};}function removeEntity(_0x55043a,_0x1f3bc7){return function(_0x4fee3a){if(_0x4fee3a){return _0x4fee3a[_0xddf1('0x24')]()[_0xddf1('0x23')](function(){_0x55043a[_0xddf1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae9b7,_0x427bb1){return function(_0x59779e){if(!_0x59779e){_0x1ae9b7[_0xddf1('0x25')](0x194);}return _0x59779e;};}function handleError(_0x1827ca,_0x48125e){_0x48125e=_0x48125e||0x1f4;return function(_0x7e7f94){logger[_0xddf1('0x26')](_0x7e7f94[_0xddf1('0x27')]);if(_0x7e7f94['name']){delete _0x7e7f94[_0xddf1('0x28')];}_0x1827ca['status'](_0x48125e)[_0xddf1('0x29')](_0x7e7f94);};}exports['index']=function(_0x5adf5b,_0xd9c5a3){var _0x29d561={},_0x4e59d0={},_0x1d09ed={'count':0x0,'rows':[]};var _0x4c9624=_['map'](db[_0xddf1('0x2a')][_0xddf1('0x2b')],function(_0x19dc5f){return{'name':_0x19dc5f['fieldName'],'type':_0x19dc5f[_0xddf1('0x2c')][_0xddf1('0x2d')]};});_0x4e59d0[_0xddf1('0x2e')]=_[_0xddf1('0x2f')](_0x4c9624,_0xddf1('0x28'));_0x4e59d0[_0xddf1('0x30')]=_[_0xddf1('0x31')](_0x5adf5b[_0xddf1('0x30')]);_0x4e59d0[_0xddf1('0x32')]=_[_0xddf1('0x33')](_0x4e59d0[_0xddf1('0x2e')],_0x4e59d0[_0xddf1('0x30')]);_0x29d561[_0xddf1('0x34')]=_['intersection'](_0x4e59d0['model'],qs[_0xddf1('0x35')](_0x5adf5b[_0xddf1('0x30')]['fields']));_0x29d561['attributes']=_0x29d561['attributes']['length']?_0x29d561['attributes']:_0x4e59d0[_0xddf1('0x2e')];if(!_0x5adf5b[_0xddf1('0x30')]['hasOwnProperty'](_0xddf1('0x36'))){_0x29d561[_0xddf1('0x37')]=qs[_0xddf1('0x37')](_0x5adf5b['query'][_0xddf1('0x37')]);_0x29d561[_0xddf1('0x1c')]=qs[_0xddf1('0x1c')](_0x5adf5b['query']['offset']);}_0x29d561['order']=qs['sort'](_0x5adf5b[_0xddf1('0x30')][_0xddf1('0x38')]);_0x29d561[_0xddf1('0x39')]=qs[_0xddf1('0x32')](_[_0xddf1('0x3a')](_0x5adf5b[_0xddf1('0x30')],_0x4e59d0[_0xddf1('0x32')]),_0x4c9624);if(_0x5adf5b[_0xddf1('0x30')][_0xddf1('0x3b')]){_0x29d561[_0xddf1('0x39')]=_['merge'](_0x29d561[_0xddf1('0x39')],{'$or':_['map'](_0x4c9624,function(_0x1a4b5a){if(_0x1a4b5a['type']!=='VIRTUAL'){var _0x5ade95={};_0x5ade95[_0x1a4b5a['name']]={'$like':'%'+_0x5adf5b['query']['filter']+'%'};return _0x5ade95;}})});}_0x29d561=_[_0xddf1('0x3c')]({},_0x29d561,_0x5adf5b[_0xddf1('0x3d')]);var _0x276bcc={'where':_0x29d561[_0xddf1('0x39')]};return db[_0xddf1('0x2a')][_0xddf1('0x1d')](_0x276bcc)[_0xddf1('0x23')](function(_0x4cdac1){_0x1d09ed[_0xddf1('0x1d')]=_0x4cdac1;if(_0x5adf5b[_0xddf1('0x30')][_0xddf1('0x3e')]){_0x29d561[_0xddf1('0x3f')]=[{'all':!![]}];}return db[_0xddf1('0x2a')][_0xddf1('0x40')](_0x29d561);})['then'](function(_0x33af5e){_0x1d09ed['rows']=_0x33af5e;return _0x1d09ed;})[_0xddf1('0x23')](respondWithFilteredResult(_0xd9c5a3,_0x29d561))[_0xddf1('0x41')](handleError(_0xd9c5a3,null));};exports['show']=function(_0xd764a0,_0x91fdec){var _0x15fe57={'raw':!![],'where':{'id':_0xd764a0['params']['id']}},_0x3f67c5={};_0x3f67c5[_0xddf1('0x2e')]=_[_0xddf1('0x31')](db['ChatInternalMessage'][_0xddf1('0x2b')]);_0x3f67c5['query']=_[_0xddf1('0x31')](_0xd764a0['query']);_0x3f67c5['filters']=_['intersection'](_0x3f67c5[_0xddf1('0x2e')],_0x3f67c5[_0xddf1('0x30')]);_0x15fe57[_0xddf1('0x34')]=_[_0xddf1('0x33')](_0x3f67c5[_0xddf1('0x2e')],qs['fields'](_0xd764a0['query'][_0xddf1('0x35')]));_0x15fe57[_0xddf1('0x34')]=_0x15fe57[_0xddf1('0x34')]['length']?_0x15fe57['attributes']:_0x3f67c5['model'];if(_0xd764a0[_0xddf1('0x30')]['includeAll']){_0x15fe57[_0xddf1('0x3f')]=[{'all':!![]}];}_0x15fe57=_[_0xddf1('0x3c')]({},_0x15fe57,_0xd764a0[_0xddf1('0x3d')]);return db[_0xddf1('0x2a')][_0xddf1('0x42')](_0x15fe57)[_0xddf1('0x23')](handleEntityNotFound(_0x91fdec,null))['then'](respondWithResult(_0x91fdec,null))[_0xddf1('0x41')](handleError(_0x91fdec,null));};exports[_0xddf1('0x43')]=function(_0xe8d800,_0xd57e34){return db['ChatInternalMessage'][_0xddf1('0x43')](_0xe8d800[_0xddf1('0x44')],{})['then'](respondWithResult(_0xd57e34,0xc9))[_0xddf1('0x41')](handleError(_0xd57e34,null));};exports[_0xddf1('0x22')]=function(_0xe9418a,_0x5a9e42){if(_0xe9418a[_0xddf1('0x44')]['id']){delete _0xe9418a[_0xddf1('0x44')]['id'];}return db['ChatInternalMessage'][_0xddf1('0x42')]({'where':{'id':_0xe9418a[_0xddf1('0x45')]['id']}})[_0xddf1('0x23')](handleEntityNotFound(_0x5a9e42,null))['then'](saveUpdates(_0xe9418a[_0xddf1('0x44')],null))[_0xddf1('0x23')](respondWithResult(_0x5a9e42,null))[_0xddf1('0x41')](handleError(_0x5a9e42,null));};exports['destroy']=function(_0x39c401,_0x237021){return db[_0xddf1('0x2a')][_0xddf1('0x42')]({'where':{'id':_0x39c401[_0xddf1('0x45')]['id']}})[_0xddf1('0x23')](handleEntityNotFound(_0x237021,null))[_0xddf1('0x23')](removeEntity(_0x237021,null))[_0xddf1('0x41')](handleError(_0x237021,null));};exports['describe']=function(_0x5d6e90,_0x13b497){return db[_0xddf1('0x2a')]['describe']()[_0xddf1('0x23')](respondWithResult(_0x13b497,null))['catch'](handleError(_0x13b497,null));};function wrapUser(_0x40f940){return function(_0x26acd6){var _0x4039e9=_0x40f940[_0xddf1('0x46')]({'plain':!![]});_0x4039e9[_0xddf1('0x47')]=[];if(_0x26acd6){_0x4039e9[_0xddf1('0x48')]=_0x26acd6['createdAt'];_0x4039e9[_0xddf1('0x49')]=_0x26acd6;}else{_0x4039e9[_0xddf1('0x48')]=moment(0x0)[_0xddf1('0x4a')](_0xddf1('0x4b'));_0x4039e9['lastMessage']={};}return _0x4039e9;};}exports['getUsers']=function(_0x9952b8,_0x5c324e,_0x111348){var _0x57598e=[];return db['User']['findAll']({'where':{'role':[_0xddf1('0x4c'),_0xddf1('0x4d'),'user']},'attributes':['id',_0xddf1('0x4e'),_0xddf1('0x28'),'role',_0xddf1('0x4f'),'internal',_0xddf1('0x50'),_0xddf1('0x51'),_0xddf1('0x52'),_0xddf1('0x53')],'order':qs['sort'](_0xddf1('0x54')),'include':[{'model':db['VoiceQueue'],'as':_0xddf1('0x55'),'attributes':['id',_0xddf1('0x28'),'type'],'through':{'attributes':[]}}]})[_0xddf1('0x23')](function(_0x220c13){if(_0x220c13){var _0x42e225=_0x9952b8['user']['get']({'plain':!![]});if(!_0x42e225)throw new Error(_0xddf1('0x56'));if(_0x42e225[_0xddf1('0x57')]===_0xddf1('0x58')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x42e225['userProfileId']},'raw':!![]})[_0xddf1('0x23')](function(_0x4cc8f8){if(_0x4cc8f8){if(_0x4cc8f8[_0xddf1('0x59')]===0x0){return db['UserProfileResource'][_0xddf1('0x40')]({'where':{'sectionId':_0x4cc8f8['id']},'raw':!![]})[_0xddf1('0x23')](function(_0x4e5ec4){var _0x3b8bb5=[];if(_[_0xddf1('0x5a')](_0x4e5ec4)){_0x3b8bb5=_[_0xddf1('0x3b')](_0x220c13,function(_0x3295a2){if(_0x3295a2[_0xddf1('0x57')]!==_0xddf1('0x4c')){return _0x3295a2;}});return _0x3b8bb5;}else{for(var _0x54903b=0x0;_0x54903b<_0x220c13[_0xddf1('0x5b')];_0x54903b++){var _0x339a35=_0x220c13[_0x54903b];if(_0x339a35['role']==='agent'){var _0x4547e2=_[_0xddf1('0x42')](_0x4e5ec4,function(_0x19cc9c){return _0x19cc9c['resourceId']===_0x339a35['id'];});if(_0x4547e2)_0x3b8bb5[_0xddf1('0x5c')](_0x339a35);}else{_0x3b8bb5[_0xddf1('0x5c')](_0x339a35);}}return _0x3b8bb5;}});}else{return _0x220c13;}}else{var _0xc2e551=_[_0xddf1('0x3b')](_0x220c13,function(_0x1fc859){if(_0x1fc859[_0xddf1('0x57')]!==_0xddf1('0x4c')){return _0x1fc859;}});return _0xc2e551;}});}else{return _0x220c13;}}})[_0xddf1('0x23')](function(_0x22e7b3){var _0x6c18d2=[];if(_0x22e7b3){_0x57598e=_0x22e7b3;for(var _0x1e3039=0x0;_0x1e3039<_0x22e7b3['length'];_0x1e3039+=0x1){_0x57598e[_0x1e3039][_0xddf1('0x47')]=[];_0x6c18d2[_0xddf1('0x5c')](db[_0xddf1('0x2a')][_0xddf1('0x42')]({'where':{'FromId':[_0x9952b8[_0xddf1('0x58')]['id'],_0x22e7b3[_0x1e3039]['id']],'ToId':[_0x9952b8[_0xddf1('0x58')]['id'],_0x22e7b3[_0x1e3039]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xddf1('0x5d'),'read','body'],'order':qs[_0xddf1('0x38')](_0xddf1('0x5e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xddf1('0x23')](wrapUser(_0x22e7b3[_0x1e3039])));}return BPromise[_0xddf1('0x5f')](_0x6c18d2);}return[];})[_0xddf1('0x23')](function(_0x5247a3){return{'rows':_0x5247a3,'count':_0x5247a3[_0xddf1('0x5b')]};})[_0xddf1('0x23')](respondWithResult(_0x5c324e,null))[_0xddf1('0x41')](handleError(_0x5c324e,null));}; \ No newline at end of file +var _0x522c=['UserProfileResource','isEmpty','agent','resourceId','FromId','ToId','read','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','undefined','count','json','reject','save','then','destroy','error','stack','name','index','map','ChatInternalMessage','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','rawAttributes','find','catch','body','update','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation'];(function(_0xe7df20,_0x163fa4){var _0x22c61a=function(_0x59cc97){while(--_0x59cc97){_0xe7df20['push'](_0xe7df20['shift']());}};_0x22c61a(++_0x163fa4);}(_0x522c,0xde));var _0xc522=function(_0xc9f391,_0x53c942){_0xc9f391=_0xc9f391-0x0;var _0x3e3d55=_0x522c[_0xc9f391];return _0x3e3d55;};'use strict';var emlformat=require(_0xc522('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc522('0x1'));var jsonpatch=require(_0xc522('0x2'));var rp=require(_0xc522('0x3'));var moment=require(_0xc522('0x4'));var BPromise=require(_0xc522('0x5'));var Mustache=require(_0xc522('0x6'));var util=require(_0xc522('0x7'));var path=require(_0xc522('0x8'));var sox=require(_0xc522('0x9'));var csv=require(_0xc522('0xa'));var ejs=require(_0xc522('0xb'));var fs=require('fs');var fs_extra=require(_0xc522('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc522('0xd'));var toCsv=require(_0xc522('0xa'));var querystring=require(_0xc522('0xe'));var Papa=require(_0xc522('0xf'));var Redis=require(_0xc522('0x10'));var authService=require(_0xc522('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc522('0x12'));var hardwareService=require(_0xc522('0x13'));var logger=require(_0xc522('0x14'))('api');var utils=require(_0xc522('0x15'));var config=require(_0xc522('0x16'));var licenseUtil=require(_0xc522('0x17'));var db=require('../../mysqldb')['db'];config[_0xc522('0x18')]=_[_0xc522('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc522('0x1a'))(new Redis(config[_0xc522('0x18')]));require(_0xc522('0x1b'))[_0xc522('0x1c')](socket);function respondWithStatusCode(_0x4565ee,_0xb2d8a5){_0xb2d8a5=_0xb2d8a5||0xcc;return function(_0x2478a8){if(_0x2478a8){return _0x4565ee[_0xc522('0x1d')](_0xb2d8a5);}return _0x4565ee[_0xc522('0x1e')](_0xb2d8a5)[_0xc522('0x1f')]();};}function respondWithResult(_0x463de9,_0x35d708){_0x35d708=_0x35d708||0xc8;return function(_0x4de582){if(_0x4de582){return _0x463de9[_0xc522('0x1e')](_0x35d708)['json'](_0x4de582);}};}function respondWithFilteredResult(_0x50010e,_0x25c9a2){return function(_0x10a0fe){if(_0x10a0fe){var _0x167e5a=typeof _0x25c9a2[_0xc522('0x20')]==='undefined'&&typeof _0x25c9a2[_0xc522('0x21')]===_0xc522('0x22');var _0x5bf9b7=_0x10a0fe[_0xc522('0x23')];var _0x3b03e9=_0x167e5a?0x0:_0x25c9a2[_0xc522('0x20')];var _0x5e2cd0=_0x167e5a?_0x10a0fe['count']:_0x25c9a2[_0xc522('0x20')]+_0x25c9a2[_0xc522('0x21')];var _0x13ec17;if(_0x5e2cd0>=_0x5bf9b7){_0x5e2cd0=_0x5bf9b7;_0x13ec17=0xc8;}else{_0x13ec17=0xce;}_0x50010e['status'](_0x13ec17);return _0x50010e['set']('Content-Range',_0x3b03e9+'-'+_0x5e2cd0+'/'+_0x5bf9b7)[_0xc522('0x24')](_0x10a0fe);}return null;};}function patchUpdates(_0x1c450f){return function(_0x5414de){try{jsonpatch['apply'](_0x5414de,_0x1c450f,!![]);}catch(_0x12983c){return BPromise[_0xc522('0x25')](_0x12983c);}return _0x5414de[_0xc522('0x26')]();};}function saveUpdates(_0x3023d7,_0x5833d8){return function(_0x1f4ada){if(_0x1f4ada){return _0x1f4ada['update'](_0x3023d7)[_0xc522('0x27')](function(_0x2bbea4){return _0x2bbea4;});}return null;};}function removeEntity(_0x3bb8ef,_0x5c322f){return function(_0x243a51){if(_0x243a51){return _0x243a51[_0xc522('0x28')]()[_0xc522('0x27')](function(){_0x3bb8ef['status'](0xcc)[_0xc522('0x1f')]();});}};}function handleEntityNotFound(_0x4a41f9,_0x10c474){return function(_0xc7f76c){if(!_0xc7f76c){_0x4a41f9['sendStatus'](0x194);}return _0xc7f76c;};}function handleError(_0xa9043c,_0x3c50a8){_0x3c50a8=_0x3c50a8||0x1f4;return function(_0x4e9f85){logger[_0xc522('0x29')](_0x4e9f85[_0xc522('0x2a')]);if(_0x4e9f85[_0xc522('0x2b')]){delete _0x4e9f85[_0xc522('0x2b')];}_0xa9043c[_0xc522('0x1e')](_0x3c50a8)['send'](_0x4e9f85);};}exports[_0xc522('0x2c')]=function(_0x5f066d,_0x2050ad){var _0x216451={},_0x17d6b9={},_0x480a0d={'count':0x0,'rows':[]};var _0x4f579e=_[_0xc522('0x2d')](db[_0xc522('0x2e')]['rawAttributes'],function(_0x378f23){return{'name':_0x378f23[_0xc522('0x2f')],'type':_0x378f23[_0xc522('0x30')][_0xc522('0x31')]};});_0x17d6b9[_0xc522('0x32')]=_[_0xc522('0x2d')](_0x4f579e,_0xc522('0x2b'));_0x17d6b9['query']=_[_0xc522('0x33')](_0x5f066d['query']);_0x17d6b9[_0xc522('0x34')]=_[_0xc522('0x35')](_0x17d6b9[_0xc522('0x32')],_0x17d6b9[_0xc522('0x36')]);_0x216451[_0xc522('0x37')]=_['intersection'](_0x17d6b9['model'],qs[_0xc522('0x38')](_0x5f066d[_0xc522('0x36')]['fields']));_0x216451[_0xc522('0x37')]=_0x216451['attributes'][_0xc522('0x39')]?_0x216451['attributes']:_0x17d6b9['model'];if(!_0x5f066d[_0xc522('0x36')][_0xc522('0x3a')](_0xc522('0x3b'))){_0x216451[_0xc522('0x21')]=qs[_0xc522('0x21')](_0x5f066d[_0xc522('0x36')][_0xc522('0x21')]);_0x216451[_0xc522('0x20')]=qs[_0xc522('0x20')](_0x5f066d[_0xc522('0x36')][_0xc522('0x20')]);}_0x216451[_0xc522('0x3c')]=qs[_0xc522('0x3d')](_0x5f066d[_0xc522('0x36')]['sort']);_0x216451[_0xc522('0x3e')]=qs['filters'](_[_0xc522('0x3f')](_0x5f066d[_0xc522('0x36')],_0x17d6b9[_0xc522('0x34')]),_0x4f579e);if(_0x5f066d[_0xc522('0x36')]['filter']){_0x216451['where']=_[_0xc522('0x40')](_0x216451[_0xc522('0x3e')],{'$or':_[_0xc522('0x2d')](_0x4f579e,function(_0x1caa1b){if(_0x1caa1b[_0xc522('0x30')]!=='VIRTUAL'){var _0x5ddf02={};_0x5ddf02[_0x1caa1b[_0xc522('0x2b')]]={'$like':'%'+_0x5f066d[_0xc522('0x36')][_0xc522('0x41')]+'%'};return _0x5ddf02;}})});}_0x216451=_['merge']({},_0x216451,_0x5f066d[_0xc522('0x42')]);var _0x3da566={'where':_0x216451['where']};return db[_0xc522('0x2e')]['count'](_0x3da566)[_0xc522('0x27')](function(_0x4c7c02){_0x480a0d[_0xc522('0x23')]=_0x4c7c02;if(_0x5f066d[_0xc522('0x36')][_0xc522('0x43')]){_0x216451[_0xc522('0x44')]=[{'all':!![]}];}return db[_0xc522('0x2e')][_0xc522('0x45')](_0x216451);})['then'](function(_0x4c3d0f){_0x480a0d[_0xc522('0x46')]=_0x4c3d0f;return _0x480a0d;})[_0xc522('0x27')](respondWithFilteredResult(_0x2050ad,_0x216451))['catch'](handleError(_0x2050ad,null));};exports['show']=function(_0x154a0c,_0x2b5a39){var _0x33b6a5={'raw':!![],'where':{'id':_0x154a0c['params']['id']}},_0x562b66={};_0x562b66[_0xc522('0x32')]=_[_0xc522('0x33')](db[_0xc522('0x2e')][_0xc522('0x47')]);_0x562b66[_0xc522('0x36')]=_[_0xc522('0x33')](_0x154a0c[_0xc522('0x36')]);_0x562b66[_0xc522('0x34')]=_[_0xc522('0x35')](_0x562b66[_0xc522('0x32')],_0x562b66[_0xc522('0x36')]);_0x33b6a5[_0xc522('0x37')]=_['intersection'](_0x562b66[_0xc522('0x32')],qs['fields'](_0x154a0c['query']['fields']));_0x33b6a5['attributes']=_0x33b6a5[_0xc522('0x37')]['length']?_0x33b6a5[_0xc522('0x37')]:_0x562b66[_0xc522('0x32')];if(_0x154a0c['query'][_0xc522('0x43')]){_0x33b6a5[_0xc522('0x44')]=[{'all':!![]}];}_0x33b6a5=_[_0xc522('0x40')]({},_0x33b6a5,_0x154a0c['options']);return db[_0xc522('0x2e')][_0xc522('0x48')](_0x33b6a5)['then'](handleEntityNotFound(_0x2b5a39,null))[_0xc522('0x27')](respondWithResult(_0x2b5a39,null))[_0xc522('0x49')](handleError(_0x2b5a39,null));};exports['create']=function(_0x11e1f3,_0x225270){return db[_0xc522('0x2e')]['create'](_0x11e1f3[_0xc522('0x4a')],{})[_0xc522('0x27')](respondWithResult(_0x225270,0xc9))[_0xc522('0x49')](handleError(_0x225270,null));};exports[_0xc522('0x4b')]=function(_0x1f5edd,_0x5b0f6d){if(_0x1f5edd['body']['id']){delete _0x1f5edd[_0xc522('0x4a')]['id'];}return db[_0xc522('0x2e')]['find']({'where':{'id':_0x1f5edd[_0xc522('0x4c')]['id']}})[_0xc522('0x27')](handleEntityNotFound(_0x5b0f6d,null))[_0xc522('0x27')](saveUpdates(_0x1f5edd[_0xc522('0x4a')],null))[_0xc522('0x27')](respondWithResult(_0x5b0f6d,null))[_0xc522('0x49')](handleError(_0x5b0f6d,null));};exports[_0xc522('0x28')]=function(_0x202759,_0x531a10){return db[_0xc522('0x2e')][_0xc522('0x48')]({'where':{'id':_0x202759[_0xc522('0x4c')]['id']}})[_0xc522('0x27')](handleEntityNotFound(_0x531a10,null))[_0xc522('0x27')](removeEntity(_0x531a10,null))[_0xc522('0x49')](handleError(_0x531a10,null));};exports[_0xc522('0x4d')]=function(_0x45ac78,_0x2ad312){return db[_0xc522('0x2e')][_0xc522('0x4d')]()[_0xc522('0x27')](respondWithResult(_0x2ad312,null))['catch'](handleError(_0x2ad312,null));};function wrapUser(_0x1cfef7){return function(_0x3b5964){var _0x294bc7=_0x1cfef7[_0xc522('0x4e')]({'plain':!![]});_0x294bc7[_0xc522('0x4f')]=[];if(_0x3b5964){_0x294bc7[_0xc522('0x50')]=_0x3b5964[_0xc522('0x51')];_0x294bc7[_0xc522('0x52')]=_0x3b5964;}else{_0x294bc7[_0xc522('0x50')]=moment(0x0)[_0xc522('0x53')](_0xc522('0x54'));_0x294bc7[_0xc522('0x52')]={};}return _0x294bc7;};}exports['getUsers']=function(_0x180fe9,_0x763037,_0x3fb281){var _0x2271f6=[];return db[_0xc522('0x55')]['findAll']({'where':{'role':['agent',_0xc522('0x56'),_0xc522('0x57')]},'attributes':['id','fullname','name',_0xc522('0x58'),_0xc522('0x59'),_0xc522('0x5a'),_0xc522('0x5b'),_0xc522('0x5c'),_0xc522('0x5d'),_0xc522('0x5e')],'order':qs[_0xc522('0x3d')](_0xc522('0x5f')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xc522('0x2b'),_0xc522('0x30')],'through':{'attributes':[]}}]})[_0xc522('0x27')](function(_0x542e41){if(_0x542e41){var _0x20152d=_0x180fe9[_0xc522('0x57')][_0xc522('0x4e')]({'plain':!![]});if(!_0x20152d)throw new Error(_0xc522('0x60'));if(_0x20152d['role']===_0xc522('0x57')){return db[_0xc522('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x20152d['userProfileId']},'raw':!![]})[_0xc522('0x27')](function(_0x61c0c){if(_0x61c0c){if(_0x61c0c[_0xc522('0x62')]===0x0){return db[_0xc522('0x63')][_0xc522('0x45')]({'where':{'sectionId':_0x61c0c['id']},'raw':!![]})[_0xc522('0x27')](function(_0x46bed9){var _0x380727=[];if(_[_0xc522('0x64')](_0x46bed9)){_0x380727=_[_0xc522('0x41')](_0x542e41,function(_0xdfdad3){if(_0xdfdad3[_0xc522('0x58')]!==_0xc522('0x65')){return _0xdfdad3;}});return _0x380727;}else{for(var _0x35eb92=0x0;_0x35eb92<_0x542e41[_0xc522('0x39')];_0x35eb92++){var _0x229a5c=_0x542e41[_0x35eb92];if(_0x229a5c[_0xc522('0x58')]===_0xc522('0x65')){var _0x2b32e4=_['find'](_0x46bed9,function(_0x3da7af){return _0x3da7af[_0xc522('0x66')]===_0x229a5c['id'];});if(_0x2b32e4)_0x380727['push'](_0x229a5c);}else{_0x380727['push'](_0x229a5c);}}return _0x380727;}});}else{return _0x542e41;}}else{var _0x230ffb=_[_0xc522('0x41')](_0x542e41,function(_0x3442e6){if(_0x3442e6[_0xc522('0x58')]!==_0xc522('0x65')){return _0x3442e6;}});return _0x230ffb;}});}else{return _0x542e41;}}})[_0xc522('0x27')](function(_0x1d6135){var _0xe1fabe=[];if(_0x1d6135){_0x2271f6=_0x1d6135;for(var _0x121176=0x0;_0x121176<_0x1d6135[_0xc522('0x39')];_0x121176+=0x1){_0x2271f6[_0x121176][_0xc522('0x4f')]=[];_0xe1fabe['push'](db[_0xc522('0x2e')][_0xc522('0x48')]({'where':{'FromId':[_0x180fe9[_0xc522('0x57')]['id'],_0x1d6135[_0x121176]['id']],'ToId':[_0x180fe9['user']['id'],_0x1d6135[_0x121176]['id']],'ChatGroupId':null},'attributes':['id',_0xc522('0x51'),_0xc522('0x67'),_0xc522('0x68'),_0xc522('0x69'),_0xc522('0x4a')],'order':qs['sort'](_0xc522('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc522('0x27')](wrapUser(_0x1d6135[_0x121176])));}return BPromise['all'](_0xe1fabe);}return[];})[_0xc522('0x27')](function(_0x2e560d){return{'rows':_0x2e560d,'count':_0x2e560d['length']};})[_0xc522('0x27')](respondWithResult(_0x763037,null))[_0xc522('0x49')](handleError(_0x763037,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7f3910d..1ee94ac 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 _0x8cdb=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit'];(function(_0x1bd498,_0x14b925){var _0xb4473e=function(_0x367808){while(--_0x367808){_0x1bd498['push'](_0x1bd498['shift']());}};_0xb4473e(++_0x14b925);}(_0x8cdb,0x193));var _0xb8cd=function(_0x42a1ba,_0x1d908e){_0x42a1ba=_0x42a1ba-0x0;var _0x48af0e=_0x8cdb[_0x42a1ba];return _0x48af0e;};'use strict';var EventEmitter=require(_0xb8cd('0x0'));var ChatInternalMessage=require(_0xb8cd('0x1'))['db'][_0xb8cd('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb8cd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb8cd('0x4'),'afterDestroy':_0xb8cd('0x5')};function emitEvent(_0xc1f52e){return function(_0x45bf4e,_0x453a74,_0x46d8a9){ChatInternalMessageEvents[_0xb8cd('0x6')](_0xc1f52e+':'+_0x45bf4e['id'],_0x45bf4e);ChatInternalMessageEvents['emit'](_0xc1f52e,_0x45bf4e);_0x46d8a9(null);};}for(var e in events){if(events[_0xb8cd('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb8cd('0x8')](e,emitEvent(event));}}module[_0xb8cd('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x0127=['../../mysqldb','setMaxListeners','save','hasOwnProperty','events'];(function(_0x54d487,_0x540a1a){var _0x2d2f94=function(_0x5bb5db){while(--_0x5bb5db){_0x54d487['push'](_0x54d487['shift']());}};_0x2d2f94(++_0x540a1a);}(_0x0127,0x1c1));var _0x7012=function(_0x2e1d1b,_0x221003){_0x2e1d1b=_0x2e1d1b-0x0;var _0x15d10e=_0x0127[_0x2e1d1b];return _0x15d10e;};'use strict';var EventEmitter=require(_0x7012('0x0'));var ChatInternalMessage=require(_0x7012('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7012('0x2')](0x0);var events={'afterCreate':_0x7012('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x6c5c81){return function(_0x539779,_0x6d95d7,_0x472002){ChatInternalMessageEvents['emit'](_0x6c5c81+':'+_0x539779['id'],_0x539779);ChatInternalMessageEvents['emit'](_0x6c5c81,_0x539779);_0x472002(null);};}for(var e in events){if(events[_0x7012('0x4')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 7bd6377..842f559 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 _0x3ba7=['exports','define','ChatInternalMessage','lodash','util','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x3ba7,0x157));var _0x73ba=function(_0x5a0d97,_0x32875b){_0x5a0d97=_0x5a0d97-0x0;var _0x5d8b60=_0x3ba7[_0x5a0d97];return _0x5d8b60;};'use strict';var _=require(_0x73ba('0x0'));var util=require(_0x73ba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x73ba('0x2'));var fs=require('fs');var path=require(_0x73ba('0x3'));var rimraf=require(_0x73ba('0x4'));var config=require(_0x73ba('0x5'));var attributes=require(_0x73ba('0x6'));module[_0x73ba('0x7')]=function(_0x1af351,_0x4f1585){return _0x1af351[_0x73ba('0x8')](_0x73ba('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa391=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages'];(function(_0x562821,_0x18a0e0){var _0x208349=function(_0x5c8ca4){while(--_0x5c8ca4){_0x562821['push'](_0x562821['shift']());}};_0x208349(++_0x18a0e0);}(_0xa391,0x64));var _0x1a39=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xa391[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0x1a39('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1a39('0x1'));var BPromise=require(_0x1a39('0x2'));var rp=require(_0x1a39('0x3'));var fs=require('fs');var path=require(_0x1a39('0x4'));var rimraf=require(_0x1a39('0x5'));var config=require(_0x1a39('0x6'));var attributes=require(_0x1a39('0x7'));module['exports']=function(_0x674989,_0x2660a6){return _0x674989['define'](_0x1a39('0x8'),attributes,{'tableName':_0x1a39('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index f5eb66c..a0d544e 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 _0xb763=['error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13b9bf,_0x13ea5c){var _0x194e58=function(_0x42b1ac){while(--_0x42b1ac){_0x13b9bf['push'](_0x13b9bf['shift']());}};_0x194e58(++_0x13ea5c);}(_0xb763,0x155));var _0x3b76=function(_0x26dc57,_0x303de7){_0x26dc57=_0x26dc57-0x0;var _0x426556=_0xb763[_0x26dc57];return _0x426556;};'use strict';var _=require(_0x3b76('0x0'));var util=require(_0x3b76('0x1'));var moment=require(_0x3b76('0x2'));var BPromise=require(_0x3b76('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b76('0x4'))['db'];var utils=require(_0x3b76('0x5'));var logger=require(_0x3b76('0x6'))(_0x3b76('0x7'));var config=require(_0x3b76('0x8'));var jayson=require(_0x3b76('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3b76('0xa')]=_[_0x3b76('0xb')](config[_0x3b76('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b76('0xc'))(new Redis(config[_0x3b76('0xa')]));require(_0x3b76('0xd'))[_0x3b76('0xe')](socket);function respondWithRpcPromise(_0x240c81,_0x10c6e9,_0x17c3bd){return new BPromise(function(_0x5ec864,_0x4876a4){return client[_0x3b76('0xf')](_0x240c81,_0x17c3bd)[_0x3b76('0x10')](function(_0x374af1){logger[_0x3b76('0x11')](_0x3b76('0x12'),_0x10c6e9,_0x3b76('0x13'));logger[_0x3b76('0x14')](_0x3b76('0x15'),_0x10c6e9,'request\x20sent',JSON[_0x3b76('0x16')](_0x374af1));if(_0x374af1[_0x3b76('0x17')]){if(_0x374af1[_0x3b76('0x17')][_0x3b76('0x18')]===0x1f4){logger['error'](_0x3b76('0x12'),_0x10c6e9,_0x374af1['error'][_0x3b76('0x19')]);return _0x4876a4(_0x374af1[_0x3b76('0x17')][_0x3b76('0x19')]);}logger[_0x3b76('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x10c6e9,_0x374af1[_0x3b76('0x17')]['message']);return _0x5ec864(_0x374af1[_0x3b76('0x17')][_0x3b76('0x19')]);}else{logger[_0x3b76('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x10c6e9,_0x3b76('0x13'));_0x5ec864(_0x374af1[_0x3b76('0x1a')][_0x3b76('0x19')]);}})[_0x3b76('0x1b')](function(_0x146729){logger[_0x3b76('0x17')](_0x3b76('0x12'),_0x10c6e9,_0x146729);_0x4876a4(_0x146729);});});} \ No newline at end of file +var _0xe01d=['http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xe01d,0x1c2));var _0xde01=function(_0x26018c,_0x3c0903){_0x26018c=_0x26018c-0x0;var _0x1efc45=_0xe01d[_0x26018c];return _0x1efc45;};'use strict';var _=require(_0xde01('0x0'));var util=require('util');var moment=require(_0xde01('0x1'));var BPromise=require(_0xde01('0x2'));var rs=require(_0xde01('0x3'));var fs=require('fs');var Redis=require(_0xde01('0x4'));var db=require(_0xde01('0x5'))['db'];var utils=require(_0xde01('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xde01('0x7'));var client=jayson[_0xde01('0x8')][_0xde01('0x9')]({'port':0x232a});config[_0xde01('0xa')]=_[_0xde01('0xb')](config[_0xde01('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xde01('0xc'))(new Redis(config['redis']));require(_0xde01('0xd'))['register'](socket);function respondWithRpcPromise(_0xd20ea2,_0x111988,_0x1522c8){return new BPromise(function(_0xbc0e09,_0x95ef9f){return client[_0xde01('0xe')](_0xd20ea2,_0x1522c8)[_0xde01('0xf')](function(_0xfd33dc){logger[_0xde01('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x111988,_0xde01('0x11'));logger[_0xde01('0x12')](_0xde01('0x13'),_0x111988,_0xde01('0x11'),JSON[_0xde01('0x14')](_0xfd33dc));if(_0xfd33dc[_0xde01('0x15')]){if(_0xfd33dc['error'][_0xde01('0x16')]===0x1f4){logger[_0xde01('0x15')](_0xde01('0x17'),_0x111988,_0xfd33dc[_0xde01('0x15')][_0xde01('0x18')]);return _0x95ef9f(_0xfd33dc[_0xde01('0x15')]['message']);}logger[_0xde01('0x15')](_0xde01('0x17'),_0x111988,_0xfd33dc['error'][_0xde01('0x18')]);return _0xbc0e09(_0xfd33dc[_0xde01('0x15')][_0xde01('0x18')]);}else{logger['info'](_0xde01('0x17'),_0x111988,_0xde01('0x11'));_0xbc0e09(_0xfd33dc[_0xde01('0x19')][_0xde01('0x18')]);}})[_0xde01('0x1a')](function(_0x1b0fbe){logger[_0xde01('0x15')](_0xde01('0x17'),_0x111988,_0x1b0fbe);_0x95ef9f(_0x1b0fbe);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 2a2bca0..1987cb0 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 _0x8c57=['chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','length'];(function(_0x3f6a74,_0x14eebf){var _0x57e21c=function(_0x3caf40){while(--_0x3caf40){_0x3f6a74['push'](_0x3f6a74['shift']());}};_0x57e21c(++_0x14eebf);}(_0x8c57,0x73));var _0x78c5=function(_0x235a78,_0x5605e9){_0x235a78=_0x235a78-0x0;var _0x3ac47f=_0x8c57[_0x235a78];return _0x3ac47f;};'use strict';var ChatInternalMessageEvents=require(_0x78c5('0x0'));var events=[_0x78c5('0x1'),_0x78c5('0x2'),'update'];function createListener(_0x2055c2,_0x1eb957){return function(_0x3552fb){_0x1eb957[_0x78c5('0x3')](_0x2055c2,_0x3552fb);};}function removeListener(_0x3b5b90,_0x31e3d9){return function(){ChatInternalMessageEvents['removeListener'](_0x3b5b90,_0x31e3d9);};}exports['register']=function(_0x3e0faa){for(var _0x1ef624=0x0,_0x5d7b7f=events[_0x78c5('0x4')];_0x1ef624<_0x5d7b7f;_0x1ef624++){var _0x1795e4=events[_0x1ef624];var _0x346cc2=createListener(_0x78c5('0x5')+_0x1795e4,_0x3e0faa);ChatInternalMessageEvents['on'](_0x1795e4,_0x346cc2);}}; \ No newline at end of file +var _0xccb1=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3314a3,_0x712212){var _0xc5d6a4=function(_0x34cac2){while(--_0x34cac2){_0x3314a3['push'](_0x3314a3['shift']());}};_0xc5d6a4(++_0x712212);}(_0xccb1,0x1d5));var _0x1ccb=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xccb1[_0x50007c];return _0x5c1ec7;};'use strict';var ChatInternalMessageEvents=require(_0x1ccb('0x0'));var events=[_0x1ccb('0x1'),_0x1ccb('0x2'),_0x1ccb('0x3')];function createListener(_0x153981,_0x531e3e){return function(_0x13a774){_0x531e3e[_0x1ccb('0x4')](_0x153981,_0x13a774);};}function removeListener(_0x1eced0,_0x309e97){return function(){ChatInternalMessageEvents[_0x1ccb('0x5')](_0x1eced0,_0x309e97);};}exports[_0x1ccb('0x6')]=function(_0x4437b2){for(var _0x1f51e8=0x0,_0x3ee824=events[_0x1ccb('0x7')];_0x1f51e8<_0x3ee824;_0x1f51e8++){var _0x198646=events[_0x1f51e8];var _0x50217c=createListener(_0x1ccb('0x8')+_0x198646,_0x4437b2);ChatInternalMessageEvents['on'](_0x198646,_0x50217c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 43f3027..24ad99e 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 _0xcad5=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x53e787,_0x4298e6){var _0x2781a0=function(_0x21f861){while(--_0x21f861){_0x53e787['push'](_0x53e787['shift']());}};_0x2781a0(++_0x4298e6);}(_0xcad5,0x1c1));var _0x5cad=function(_0x4bb742,_0x9e4331){_0x4bb742=_0x4bb742-0x0;var _0x11a8cb=_0xcad5[_0x4bb742];return _0x11a8cb;};'use strict';var multer=require(_0x5cad('0x0'));var util=require(_0x5cad('0x1'));var path=require(_0x5cad('0x2'));var timeout=require(_0x5cad('0x3'));var express=require(_0x5cad('0x4'));var router=express['Router']();var fs_extra=require(_0x5cad('0x5'));var auth=require(_0x5cad('0x6'));var interaction=require(_0x5cad('0x7'));var config=require(_0x5cad('0x8'));var controller=require(_0x5cad('0x9'));router[_0x5cad('0xa')]('/',auth['isAuthenticated'](),controller[_0x5cad('0xb')]);router[_0x5cad('0xa')](_0x5cad('0xc'),auth[_0x5cad('0xd')](),controller[_0x5cad('0xe')]);router[_0x5cad('0xa')](_0x5cad('0xf'),auth[_0x5cad('0xd')](),controller[_0x5cad('0x10')]);router[_0x5cad('0xa')](_0x5cad('0x11'),auth['isAuthenticated'](),controller[_0x5cad('0x12')]);router[_0x5cad('0x13')]('/',auth['isAuthenticated'](),controller[_0x5cad('0x14')]);router['put'](_0x5cad('0x11'),controller[_0x5cad('0x15')]);router['delete'](_0x5cad('0x11'),auth[_0x5cad('0xd')](),controller[_0x5cad('0x16')]);module[_0x5cad('0x17')]=router; \ No newline at end of file +var _0x07d0=['post','create','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','/:id','show'];(function(_0x2e43a4,_0x15e850){var _0x494d5b=function(_0xe9d604){while(--_0xe9d604){_0x2e43a4['push'](_0x2e43a4['shift']());}};_0x494d5b(++_0x15e850);}(_0x07d0,0x193));var _0x007d=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x07d0[_0x42bdad];return _0x122626;};'use strict';var multer=require(_0x007d('0x0'));var util=require(_0x007d('0x1'));var path=require('path');var timeout=require(_0x007d('0x2'));var express=require(_0x007d('0x3'));var router=express[_0x007d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x007d('0x5'));var interaction=require(_0x007d('0x6'));var config=require('../../config/environment');var controller=require(_0x007d('0x7'));router[_0x007d('0x8')]('/',auth[_0x007d('0x9')](),controller['index']);router[_0x007d('0x8')](_0x007d('0xa'),auth[_0x007d('0x9')](),controller[_0x007d('0xb')]);router[_0x007d('0x8')](_0x007d('0xc'),auth[_0x007d('0x9')](),controller['getUsers']);router['get'](_0x007d('0xd'),auth[_0x007d('0x9')](),controller[_0x007d('0xe')]);router[_0x007d('0xf')]('/',auth[_0x007d('0x9')](),controller[_0x007d('0x10')]);router['put'](_0x007d('0xd'),controller[_0x007d('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x007d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 6aaea3a..623c0a7 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 _0x68b7=['sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x292a28,_0x5137ce){var _0x3112d2=function(_0x22fdd3){while(--_0x22fdd3){_0x292a28['push'](_0x292a28['shift']());}};_0x3112d2(++_0x5137ce);}(_0x68b7,0x8c));var _0x768b=function(_0xe7cac6,_0xd30774){_0xe7cac6=_0xe7cac6-0x0;var _0x4b2250=_0x68b7[_0xe7cac6];return _0x4b2250;};'use strict';var Sequelize=require(_0x768b('0x0'));module['exports']={'body':{'type':Sequelize[_0x768b('0x1')](_0x768b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x768b('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x768b('0x4')]('in',_0x768b('0x5')),'defaultValue':_0x768b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x768b('0x6')]},'providerResponse':{'type':Sequelize[_0x768b('0x1')]}}; \ No newline at end of file +var _0x71f4=['ENUM','out','STRING','TEXT','medium','BOOLEAN'];(function(_0x13700b,_0x30385a){var _0x362daa=function(_0x16832d){while(--_0x16832d){_0x13700b['push'](_0x13700b['shift']());}};_0x362daa(++_0x30385a);}(_0x71f4,0xf9));var _0x471f=function(_0x5d2590,_0x1d3d6b){_0x5d2590=_0x5d2590-0x0;var _0x4ff947=_0x71f4[_0x5d2590];return _0x4ff947;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x471f('0x0')](_0x471f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x471f('0x3')]('in','out'),'defaultValue':_0x471f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x471f('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 16cf33a..87fc7ad 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 _0xc5de=['reject','update','destroy','stack','name','index','ChatMessage','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','filter','merge','includeAll','findAll','rows','show','params','rawAttributes','include','options','find','body','describe','chat-interactions','accept','chat','read','readAt','UserId','user','ChatInteraction','ChatInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','SIP/%s','rejectmessage','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','apply'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xc5de,0x158));var _0xec5d=function(_0x18cfc7,_0x27371b){_0x18cfc7=_0x18cfc7-0x0;var _0x3d0e73=_0xc5de[_0x18cfc7];return _0x3d0e73;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec5d('0x0'));var zipdir=require(_0xec5d('0x1'));var jsonpatch=require(_0xec5d('0x2'));var rp=require('request-promise');var moment=require(_0xec5d('0x3'));var BPromise=require(_0xec5d('0x4'));var Mustache=require(_0xec5d('0x5'));var util=require(_0xec5d('0x6'));var path=require(_0xec5d('0x7'));var sox=require(_0xec5d('0x8'));var csv=require(_0xec5d('0x9'));var ejs=require(_0xec5d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec5d('0xb'));var squel=require(_0xec5d('0xc'));var crypto=require(_0xec5d('0xd'));var jsforce=require(_0xec5d('0xe'));var deskjs=require(_0xec5d('0xf'));var toCsv=require(_0xec5d('0x9'));var querystring=require('querystring');var Papa=require(_0xec5d('0x10'));var Redis=require(_0xec5d('0x11'));var authService=require(_0xec5d('0x12'));var qs=require(_0xec5d('0x13'));var as=require(_0xec5d('0x14'));var hardwareService=require(_0xec5d('0x15'));var logger=require(_0xec5d('0x16'))('api');var utils=require(_0xec5d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xec5d('0x18'));var db=require(_0xec5d('0x19'))['db'];config[_0xec5d('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xec5d('0x1b')](socket);var jayson=require(_0xec5d('0x1c'));var client=jayson[_0xec5d('0x1d')][_0xec5d('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ab8ec,_0x56d2bb,_0x575281,_0x21ce3c){return new BPromise(function(_0x3a6561,_0x38e6d2){var _0x388ac8=_0x21ce3c||client;return _0x388ac8[_0xec5d('0x1f')](_0x5ab8ec,_0x575281)[_0xec5d('0x20')](function(_0x4d5fe8){logger[_0xec5d('0x21')](_0xec5d('0x22'),_0x56d2bb,_0xec5d('0x23'));logger['debug'](_0xec5d('0x24'),_0x56d2bb,'request\x20sent',JSON[_0xec5d('0x25')](_0x4d5fe8));if(_0x4d5fe8[_0xec5d('0x26')]){if(_0x4d5fe8[_0xec5d('0x26')][_0xec5d('0x27')]===0x1f4){logger['error'](_0xec5d('0x22'),_0x56d2bb,_0x4d5fe8[_0xec5d('0x26')][_0xec5d('0x28')]);return _0x38e6d2(_0x4d5fe8[_0xec5d('0x26')][_0xec5d('0x28')]);}logger['error'](_0xec5d('0x22'),_0x56d2bb,_0x4d5fe8[_0xec5d('0x26')]['message']);return _0x3a6561(_0x4d5fe8[_0xec5d('0x26')][_0xec5d('0x28')]);}else{logger[_0xec5d('0x21')](_0xec5d('0x22'),_0x56d2bb,_0xec5d('0x23'));_0x3a6561(_0x4d5fe8[_0xec5d('0x29')][_0xec5d('0x28')]);}})[_0xec5d('0x2a')](function(_0x3dd285){logger[_0xec5d('0x26')](_0xec5d('0x22'),_0x56d2bb,_0x3dd285);_0x38e6d2(_0x3dd285);});});}function respondWithStatusCode(_0x109197,_0x1e910e){_0x1e910e=_0x1e910e||0xcc;return function(_0x477567){if(_0x477567){return _0x109197[_0xec5d('0x2b')](_0x1e910e);}return _0x109197[_0xec5d('0x2c')](_0x1e910e)[_0xec5d('0x2d')]();};}function respondWithResult(_0x38fb6e,_0x471bfd){_0x471bfd=_0x471bfd||0xc8;return function(_0x5c1943){if(_0x5c1943){return _0x38fb6e[_0xec5d('0x2c')](_0x471bfd)['json'](_0x5c1943);}};}function respondWithFilteredResult(_0x4ee166,_0xc27d44){return function(_0x11d531){if(_0x11d531){var _0x28d94c=typeof _0xc27d44[_0xec5d('0x2e')]==='undefined'&&typeof _0xc27d44[_0xec5d('0x2f')]===_0xec5d('0x30');var _0x5589ea=_0x11d531[_0xec5d('0x31')];var _0x5b3655=_0x28d94c?0x0:_0xc27d44[_0xec5d('0x2e')];var _0x10e2bc=_0x28d94c?_0x11d531[_0xec5d('0x31')]:_0xc27d44[_0xec5d('0x2e')]+_0xc27d44['limit'];var _0x170fdb;if(_0x10e2bc>=_0x5589ea){_0x10e2bc=_0x5589ea;_0x170fdb=0xc8;}else{_0x170fdb=0xce;}_0x4ee166[_0xec5d('0x2c')](_0x170fdb);return _0x4ee166[_0xec5d('0x32')]('Content-Range',_0x5b3655+'-'+_0x10e2bc+'/'+_0x5589ea)['json'](_0x11d531);}return null;};}function patchUpdates(_0x121291){return function(_0x4cd6d0){try{jsonpatch[_0xec5d('0x33')](_0x4cd6d0,_0x121291,!![]);}catch(_0x369285){return BPromise[_0xec5d('0x34')](_0x369285);}return _0x4cd6d0['save']();};}function saveUpdates(_0x436d43,_0x21f55a){return function(_0x4974d8){if(_0x4974d8){return _0x4974d8[_0xec5d('0x35')](_0x436d43)[_0xec5d('0x20')](function(_0x2c4c07){return _0x2c4c07;});}return null;};}function removeEntity(_0x277c34,_0x1dc8e6){return function(_0x120caa){if(_0x120caa){return _0x120caa[_0xec5d('0x36')]()[_0xec5d('0x20')](function(){_0x277c34['status'](0xcc)[_0xec5d('0x2d')]();});}};}function handleEntityNotFound(_0x4950c4,_0x333ccd){return function(_0x11bcf8){if(!_0x11bcf8){_0x4950c4[_0xec5d('0x2b')](0x194);}return _0x11bcf8;};}function handleError(_0x590fd9,_0xcd2153){_0xcd2153=_0xcd2153||0x1f4;return function(_0x5af4c9){logger[_0xec5d('0x26')](_0x5af4c9[_0xec5d('0x37')]);if(_0x5af4c9[_0xec5d('0x38')]){delete _0x5af4c9['name'];}_0x590fd9['status'](_0xcd2153)['send'](_0x5af4c9);};}exports[_0xec5d('0x39')]=function(_0x52d61f,_0xa61372){var _0x30aa46={},_0x3ca760={},_0x31855f={'count':0x0,'rows':[]};var _0x303884=_['map'](db[_0xec5d('0x3a')]['rawAttributes'],function(_0x3defbe){return{'name':_0x3defbe[_0xec5d('0x3b')],'type':_0x3defbe['type'][_0xec5d('0x3c')]};});_0x3ca760[_0xec5d('0x3d')]=_['map'](_0x303884,_0xec5d('0x38'));_0x3ca760[_0xec5d('0x3e')]=_[_0xec5d('0x3f')](_0x52d61f[_0xec5d('0x3e')]);_0x3ca760[_0xec5d('0x40')]=_[_0xec5d('0x41')](_0x3ca760[_0xec5d('0x3d')],_0x3ca760[_0xec5d('0x3e')]);_0x30aa46['attributes']=_[_0xec5d('0x41')](_0x3ca760[_0xec5d('0x3d')],qs[_0xec5d('0x42')](_0x52d61f[_0xec5d('0x3e')][_0xec5d('0x42')]));_0x30aa46[_0xec5d('0x43')]=_0x30aa46[_0xec5d('0x43')][_0xec5d('0x44')]?_0x30aa46[_0xec5d('0x43')]:_0x3ca760[_0xec5d('0x3d')];if(!_0x52d61f[_0xec5d('0x3e')][_0xec5d('0x45')](_0xec5d('0x46'))){_0x30aa46['limit']=qs[_0xec5d('0x2f')](_0x52d61f[_0xec5d('0x3e')][_0xec5d('0x2f')]);_0x30aa46[_0xec5d('0x2e')]=qs[_0xec5d('0x2e')](_0x52d61f[_0xec5d('0x3e')][_0xec5d('0x2e')]);}_0x30aa46['order']=qs[_0xec5d('0x47')](_0x52d61f[_0xec5d('0x3e')][_0xec5d('0x47')]);_0x30aa46[_0xec5d('0x48')]=qs[_0xec5d('0x40')](_[_0xec5d('0x49')](_0x52d61f[_0xec5d('0x3e')],_0x3ca760[_0xec5d('0x40')]),_0x303884);if(_0x52d61f[_0xec5d('0x3e')]['filter']){_0x30aa46[_0xec5d('0x48')]=_['merge'](_0x30aa46[_0xec5d('0x48')],{'$or':_[_0xec5d('0x4a')](_0x303884,function(_0x2a5651){if(_0x2a5651['type']!==_0xec5d('0x4b')){var _0x4d46d1={};_0x4d46d1[_0x2a5651[_0xec5d('0x38')]]={'$like':'%'+_0x52d61f[_0xec5d('0x3e')][_0xec5d('0x4c')]+'%'};return _0x4d46d1;}})});}_0x30aa46=_[_0xec5d('0x4d')]({},_0x30aa46,_0x52d61f['options']);var _0x5ad29f={'where':_0x30aa46[_0xec5d('0x48')]};return db[_0xec5d('0x3a')][_0xec5d('0x31')](_0x5ad29f)[_0xec5d('0x20')](function(_0x393139){_0x31855f[_0xec5d('0x31')]=_0x393139;if(_0x52d61f['query'][_0xec5d('0x4e')]){_0x30aa46['include']=[{'all':!![]}];}return db[_0xec5d('0x3a')][_0xec5d('0x4f')](_0x30aa46);})[_0xec5d('0x20')](function(_0x30ca2d){_0x31855f[_0xec5d('0x50')]=_0x30ca2d;return _0x31855f;})[_0xec5d('0x20')](respondWithFilteredResult(_0xa61372,_0x30aa46))[_0xec5d('0x2a')](handleError(_0xa61372,null));};exports[_0xec5d('0x51')]=function(_0x39b717,_0x4f0c13){var _0x199b6d={'raw':!![],'where':{'id':_0x39b717[_0xec5d('0x52')]['id']}},_0x260c14={};_0x260c14[_0xec5d('0x3d')]=_['keys'](db[_0xec5d('0x3a')][_0xec5d('0x53')]);_0x260c14['query']=_[_0xec5d('0x3f')](_0x39b717[_0xec5d('0x3e')]);_0x260c14['filters']=_[_0xec5d('0x41')](_0x260c14[_0xec5d('0x3d')],_0x260c14[_0xec5d('0x3e')]);_0x199b6d['attributes']=_[_0xec5d('0x41')](_0x260c14[_0xec5d('0x3d')],qs['fields'](_0x39b717[_0xec5d('0x3e')][_0xec5d('0x42')]));_0x199b6d[_0xec5d('0x43')]=_0x199b6d['attributes'][_0xec5d('0x44')]?_0x199b6d[_0xec5d('0x43')]:_0x260c14[_0xec5d('0x3d')];if(_0x39b717[_0xec5d('0x3e')][_0xec5d('0x4e')]){_0x199b6d[_0xec5d('0x54')]=[{'all':!![]}];}_0x199b6d=_[_0xec5d('0x4d')]({},_0x199b6d,_0x39b717[_0xec5d('0x55')]);return db[_0xec5d('0x3a')][_0xec5d('0x56')](_0x199b6d)['then'](handleEntityNotFound(_0x4f0c13,null))['then'](respondWithResult(_0x4f0c13,null))[_0xec5d('0x2a')](handleError(_0x4f0c13,null));};exports['create']=function(_0x31eb39,_0x3e4489){return db[_0xec5d('0x3a')]['create'](_0x31eb39[_0xec5d('0x57')],{})[_0xec5d('0x20')](respondWithResult(_0x3e4489,0xc9))[_0xec5d('0x2a')](handleError(_0x3e4489,null));};exports['update']=function(_0x89efc8,_0x2cf421){if(_0x89efc8[_0xec5d('0x57')]['id']){delete _0x89efc8[_0xec5d('0x57')]['id'];}return db[_0xec5d('0x3a')]['find']({'where':{'id':_0x89efc8['params']['id']}})['then'](handleEntityNotFound(_0x2cf421,null))['then'](saveUpdates(_0x89efc8[_0xec5d('0x57')],null))[_0xec5d('0x20')](respondWithResult(_0x2cf421,null))[_0xec5d('0x2a')](handleError(_0x2cf421,null));};exports[_0xec5d('0x36')]=function(_0x359fd6,_0x42b860){return db[_0xec5d('0x3a')][_0xec5d('0x56')]({'where':{'id':_0x359fd6[_0xec5d('0x52')]['id']}})[_0xec5d('0x20')](handleEntityNotFound(_0x42b860,null))[_0xec5d('0x20')](removeEntity(_0x42b860,null))[_0xec5d('0x2a')](handleError(_0x42b860,null));};exports[_0xec5d('0x58')]=function(_0x5e927a,_0x8086fd){return db[_0xec5d('0x3a')][_0xec5d('0x58')]()[_0xec5d('0x20')](respondWithResult(_0x8086fd,null))[_0xec5d('0x2a')](handleError(_0x8086fd,null));};var interaction_log=require(_0xec5d('0x16'))(_0xec5d('0x59'));exports[_0xec5d('0x5a')]=function(_0x33de9c,_0x45df42,_0x75f719){var _0x5c1fe9={'agent':{},'channel':_0xec5d('0x5b')};if(_0x33de9c['body']['id']){delete _0x33de9c['body']['id'];}_0x33de9c[_0xec5d('0x57')][_0xec5d('0x5c')]=!![];_0x33de9c[_0xec5d('0x57')][_0xec5d('0x5d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x33de9c[_0xec5d('0x57')]['UserId']=_0x33de9c['body'][_0xec5d('0x5e')]||_0x33de9c[_0xec5d('0x5f')]['id'];_0x5c1fe9['agent']['id']=_0x33de9c['body']['UserId'];return db[_0xec5d('0x3a')][_0xec5d('0x56')]({'where':{'id':_0x33de9c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x45df42,null))[_0xec5d('0x20')](saveUpdates(_0x33de9c[_0xec5d('0x57')],null))[_0xec5d('0x20')](function(_0x23b589){if(_0x23b589){_0x5c1fe9[_0xec5d('0x28')]=_0x23b589['get']({'plain':!![]});return db[_0xec5d('0x60')][_0xec5d('0x56')]({'where':{'id':_0x23b589[_0xec5d('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x45df42,null))[_0xec5d('0x20')](function(_0x4921cb){if(_0x4921cb){return _0x4921cb[_0xec5d('0x35')]({'UserId':_0x33de9c[_0xec5d('0x57')][_0xec5d('0x5e')],'read1stAt':_['isNil'](_0x4921cb[_0xec5d('0x62')])?moment()[_0xec5d('0x63')](_0xec5d('0x64')):undefined});}return null;})[_0xec5d('0x20')](function(_0x177011){if(_0x177011){_0x5c1fe9[_0xec5d('0x65')]=_0x177011[_0xec5d('0x66')]({'plain':!![]});interaction_log[_0xec5d('0x21')](_0xec5d('0x67'),_0x33de9c['user']['id'],_0x33de9c['user'][_0xec5d('0x38')],_0x33de9c[_0xec5d('0x5f')][_0xec5d('0x68')],_0x5c1fe9[_0xec5d('0x65')]['id'],_0x33de9c[_0xec5d('0x57')]?JSON[_0xec5d('0x25')](_0x33de9c[_0xec5d('0x57')]):_0xec5d('0x69'));return respondWithRpcPromise(_0xec5d('0x6a'),_0xec5d('0x6b'),_0x5c1fe9);}return null;})[_0xec5d('0x20')](function(_0x250975){var _0x648400=_0xec5d('0x6c')+_0x250975[_0xec5d('0x28')][_0xec5d('0x6d')];return db[_0xec5d('0x6e')][_0xec5d('0x3e')](_0x648400,{'type':db[_0xec5d('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0xec5d('0x20')](function(_0x37682b){return _0x37682b;});})[_0xec5d('0x20')](function(_0x56505d){if(_0x56505d){_0x5c1fe9[_0xec5d('0x28')][_0xec5d('0x70')]=_0x56505d[0x0];if(!_0x33de9c[_0xec5d('0x57')][_0xec5d('0x5e')])return;return db[_0xec5d('0x71')][_0xec5d('0x56')]({'where':{'id':_0x33de9c[_0xec5d('0x57')][_0xec5d('0x5e')],'role':_0xec5d('0x72')},'attributes':['id',_0xec5d('0x38'),_0xec5d('0x73'),_0xec5d('0x74'),_0xec5d('0x75')],'raw':!![]});}return null;})[_0xec5d('0x20')](function(_0x222200){if(!_0x222200)return null;_0x5c1fe9[_0xec5d('0x28')]['agent']=_0x222200;return _0x5c1fe9;})['then'](function(_0x164935){if(_0x164935){if(_0x33de9c['body'][_0xec5d('0x76')]){_0x5c1fe9[_0xec5d('0x28')]['interface']=util[_0xec5d('0x63')]('SIP/%s',_0x33de9c[_0xec5d('0x5f')][_0xec5d('0x38')]);_0x5c1fe9[_0xec5d('0x28')]['channel']=_0x5c1fe9[_0xec5d('0x77')];_0x5c1fe9[_0xec5d('0x28')][_0xec5d('0x78')]=_0x5c1fe9[_0xec5d('0x77')];_0x5c1fe9['message'][_0xec5d('0x79')]=_0xec5d('0x5a');return respondWithRpcPromise(_0xec5d('0x7a'),_0xec5d('0x7a'),{'event':_0xec5d('0x7b'),'message':_[_0xec5d('0x4d')](_0x5c1fe9[_0xec5d('0x28')],JSON[_0xec5d('0x7c')](_0x5c1fe9[_0xec5d('0x65')][_0xec5d('0x7d')]))},client9002)['then'](function(){return _0x5c1fe9;});}return _0x5c1fe9;}return null;})[_0xec5d('0x20')](respondWithResult(_0x45df42,null))[_0xec5d('0x2a')](handleError(_0x45df42,null));};var interaction_log=require(_0xec5d('0x16'))(_0xec5d('0x59'));exports[_0xec5d('0x34')]=function(_0x591d39,_0x3b6879,_0xe37e0c){var _0x475b7e={'agent':{},'channel':_0xec5d('0x5b')};if(_0x591d39[_0xec5d('0x57')]['id']){delete _0x591d39[_0xec5d('0x57')]['id'];}_0x591d39[_0xec5d('0x57')][_0xec5d('0x5e')]=_0x591d39[_0xec5d('0x57')][_0xec5d('0x5e')]||_0x591d39['user']['id'];_0x475b7e[_0xec5d('0x72')]['id']=_0x591d39['body'][_0xec5d('0x5e')];return db[_0xec5d('0x3a')][_0xec5d('0x56')]({'where':{'id':_0x591d39['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b6879,null))['then'](function(_0x3e439d){if(_0x3e439d){_0x475b7e['message']=_0x3e439d[_0xec5d('0x66')]({'plain':!![]});return db[_0xec5d('0x60')][_0xec5d('0x56')]({'where':{'id':_0x3e439d[_0xec5d('0x61')]}});}return null;})[_0xec5d('0x20')](handleEntityNotFound(_0x3b6879,null))[_0xec5d('0x20')](function(_0x134f5c){if(_0x134f5c){_0x475b7e[_0xec5d('0x65')]=_0x134f5c[_0xec5d('0x66')]({'plain':!![]});interaction_log[_0xec5d('0x21')](_0xec5d('0x7e'),_0x591d39['user']['id'],_0x591d39[_0xec5d('0x5f')][_0xec5d('0x38')],_0x591d39[_0xec5d('0x5f')][_0xec5d('0x68')],_0x475b7e[_0xec5d('0x65')]['id'],_0x591d39['body']?JSON[_0xec5d('0x25')](_0x591d39[_0xec5d('0x57')]):_0xec5d('0x69'));return respondWithRpcPromise(_0xec5d('0x7f'),_0xec5d('0x80'),_0x475b7e);}return null;})[_0xec5d('0x20')](function(_0x381fdb){var _0x2737fa=_0xec5d('0x6c')+_0x381fdb[_0xec5d('0x28')]['ContactId'];return db[_0xec5d('0x6e')][_0xec5d('0x3e')](_0x2737fa,{'type':db[_0xec5d('0x6f')]['QueryTypes'][_0xec5d('0x81')],'raw':!![]})[_0xec5d('0x20')](function(_0x34e371){return _0x34e371;});})['then'](function(_0xcb72c){if(_0xcb72c){_0x475b7e[_0xec5d('0x28')][_0xec5d('0x70')]=_0xcb72c[0x0];if(!_0x591d39[_0xec5d('0x57')][_0xec5d('0x5e')])return;return db[_0xec5d('0x71')][_0xec5d('0x56')]({'where':{'id':_0x591d39[_0xec5d('0x57')][_0xec5d('0x5e')],'role':'agent'},'attributes':['id','name',_0xec5d('0x73'),'email','internal'],'raw':!![]});}return null;})[_0xec5d('0x20')](function(_0x445940){if(!_0x445940)return null;_0x475b7e['message']['agent']=_0x445940;return _0x475b7e;})[_0xec5d('0x20')](function(_0x2ebcc6){if(_0x2ebcc6){_0x2ebcc6['message']['interface']=util['format'](_0xec5d('0x82'),_0x591d39[_0xec5d('0x5f')][_0xec5d('0x38')]);_0x2ebcc6[_0xec5d('0x28')][_0xec5d('0x77')]=_0x475b7e[_0xec5d('0x77')];_0x2ebcc6[_0xec5d('0x28')]['motionChannel']=_0x475b7e[_0xec5d('0x77')];_0x2ebcc6['message']['event']=_0xec5d('0x34');respondWithRpcPromise('EventManager',_0xec5d('0x7a'),{'event':_0xec5d('0x83'),'message':_[_0xec5d('0x4d')](_0x475b7e[_0xec5d('0x28')],JSON[_0xec5d('0x7c')](_0x475b7e[_0xec5d('0x65')]['formData']))},client9002);return _0x475b7e;}return null;})['then'](respondWithResult(_0x3b6879,null))[_0xec5d('0x2a')](handleError(_0x3b6879,null));}; \ No newline at end of file +var _0x9f6d=['includeAll','include','findAll','rows','catch','keys','rawAttributes','find','create','body','params','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','role','rejectMessage','ContactId','QueryTypes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','name','send','index','map','ChatMessage','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x3889b2,_0x57b7ae){var _0x11d8c1=function(_0x2f0f31){while(--_0x2f0f31){_0x3889b2['push'](_0x3889b2['shift']());}};_0x11d8c1(++_0x57b7ae);}(_0x9f6d,0x140));var _0xd9f6=function(_0x440e2f,_0x5d8764){_0x440e2f=_0x440e2f-0x0;var _0x198735=_0x9f6d[_0x440e2f];return _0x198735;};'use strict';var emlformat=require(_0xd9f6('0x0'));var rimraf=require(_0xd9f6('0x1'));var zipdir=require(_0xd9f6('0x2'));var jsonpatch=require(_0xd9f6('0x3'));var rp=require(_0xd9f6('0x4'));var moment=require(_0xd9f6('0x5'));var BPromise=require(_0xd9f6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd9f6('0x7'));var sox=require(_0xd9f6('0x8'));var csv=require(_0xd9f6('0x9'));var ejs=require(_0xd9f6('0xa'));var fs=require('fs');var fs_extra=require(_0xd9f6('0xb'));var _=require(_0xd9f6('0xc'));var squel=require('squel');var crypto=require(_0xd9f6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd9f6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd9f6('0xe'));var authService=require(_0xd9f6('0xf'));var qs=require(_0xd9f6('0x10'));var as=require(_0xd9f6('0x11'));var hardwareService=require(_0xd9f6('0x12'));var logger=require(_0xd9f6('0x13'))(_0xd9f6('0x14'));var utils=require(_0xd9f6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd9f6('0x16'));var db=require(_0xd9f6('0x17'))['db'];config['redis']=_[_0xd9f6('0x18')](config[_0xd9f6('0x19')],{'host':_0xd9f6('0x1a'),'port':0x18eb});var socket=require(_0xd9f6('0x1b'))(new Redis(config[_0xd9f6('0x19')]));require(_0xd9f6('0x1c'))[_0xd9f6('0x1d')](socket);var jayson=require(_0xd9f6('0x1e'));var client=jayson[_0xd9f6('0x1f')][_0xd9f6('0x20')]({'port':0x232c});var client9002=jayson[_0xd9f6('0x1f')][_0xd9f6('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3f1f87,_0x44bcd9,_0x3879d5,_0x19646c){return new BPromise(function(_0x43afbb,_0x5bf931){var _0x48bf2e=_0x19646c||client;return _0x48bf2e[_0xd9f6('0x21')](_0x3f1f87,_0x3879d5)[_0xd9f6('0x22')](function(_0x1fd27a){logger[_0xd9f6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x44bcd9,_0xd9f6('0x24'));logger[_0xd9f6('0x25')](_0xd9f6('0x26'),_0x44bcd9,'request\x20sent',JSON['stringify'](_0x1fd27a));if(_0x1fd27a[_0xd9f6('0x27')]){if(_0x1fd27a[_0xd9f6('0x27')][_0xd9f6('0x28')]===0x1f4){logger[_0xd9f6('0x27')](_0xd9f6('0x29'),_0x44bcd9,_0x1fd27a['error'][_0xd9f6('0x2a')]);return _0x5bf931(_0x1fd27a[_0xd9f6('0x27')][_0xd9f6('0x2a')]);}logger[_0xd9f6('0x27')]('ChatMessage,\x20%s,\x20%s',_0x44bcd9,_0x1fd27a['error'][_0xd9f6('0x2a')]);return _0x43afbb(_0x1fd27a['error'][_0xd9f6('0x2a')]);}else{logger[_0xd9f6('0x23')](_0xd9f6('0x29'),_0x44bcd9,_0xd9f6('0x24'));_0x43afbb(_0x1fd27a[_0xd9f6('0x2b')][_0xd9f6('0x2a')]);}})['catch'](function(_0x475adc){logger[_0xd9f6('0x27')](_0xd9f6('0x29'),_0x44bcd9,_0x475adc);_0x5bf931(_0x475adc);});});}function respondWithStatusCode(_0x4a62cc,_0x27cd23){_0x27cd23=_0x27cd23||0xcc;return function(_0x421845){if(_0x421845){return _0x4a62cc[_0xd9f6('0x2c')](_0x27cd23);}return _0x4a62cc['status'](_0x27cd23)[_0xd9f6('0x2d')]();};}function respondWithResult(_0x44064a,_0x185467){_0x185467=_0x185467||0xc8;return function(_0x21658d){if(_0x21658d){return _0x44064a[_0xd9f6('0x2e')](_0x185467)[_0xd9f6('0x2f')](_0x21658d);}};}function respondWithFilteredResult(_0x245275,_0x3ff00b){return function(_0x334dda){if(_0x334dda){var _0x4b5f3d=typeof _0x3ff00b['offset']===_0xd9f6('0x30')&&typeof _0x3ff00b['limit']==='undefined';var _0x5c92ca=_0x334dda[_0xd9f6('0x31')];var _0x536351=_0x4b5f3d?0x0:_0x3ff00b['offset'];var _0x16124a=_0x4b5f3d?_0x334dda[_0xd9f6('0x31')]:_0x3ff00b[_0xd9f6('0x32')]+_0x3ff00b[_0xd9f6('0x33')];var _0x15a4d2;if(_0x16124a>=_0x5c92ca){_0x16124a=_0x5c92ca;_0x15a4d2=0xc8;}else{_0x15a4d2=0xce;}_0x245275[_0xd9f6('0x2e')](_0x15a4d2);return _0x245275[_0xd9f6('0x34')](_0xd9f6('0x35'),_0x536351+'-'+_0x16124a+'/'+_0x5c92ca)[_0xd9f6('0x2f')](_0x334dda);}return null;};}function patchUpdates(_0x1ac10e){return function(_0x3c21f5){try{jsonpatch[_0xd9f6('0x36')](_0x3c21f5,_0x1ac10e,!![]);}catch(_0x39ddfd){return BPromise[_0xd9f6('0x37')](_0x39ddfd);}return _0x3c21f5['save']();};}function saveUpdates(_0x42536f,_0x48d0e8){return function(_0x3d7e5f){if(_0x3d7e5f){return _0x3d7e5f[_0xd9f6('0x38')](_0x42536f)[_0xd9f6('0x22')](function(_0x2f26a8){return _0x2f26a8;});}return null;};}function removeEntity(_0x5f1412,_0x1bd426){return function(_0x3e937b){if(_0x3e937b){return _0x3e937b[_0xd9f6('0x39')]()['then'](function(){_0x5f1412[_0xd9f6('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52a255,_0x17f3f8){return function(_0x3ca2a4){if(!_0x3ca2a4){_0x52a255[_0xd9f6('0x2c')](0x194);}return _0x3ca2a4;};}function handleError(_0x4270da,_0x50cf56){_0x50cf56=_0x50cf56||0x1f4;return function(_0x301ad2){logger['error'](_0x301ad2['stack']);if(_0x301ad2['name']){delete _0x301ad2[_0xd9f6('0x3a')];}_0x4270da[_0xd9f6('0x2e')](_0x50cf56)[_0xd9f6('0x3b')](_0x301ad2);};}exports[_0xd9f6('0x3c')]=function(_0x14bd22,_0x2b60e7){var _0x3b67aa={},_0x2e7e67={},_0x4850d5={'count':0x0,'rows':[]};var _0x2b288c=_[_0xd9f6('0x3d')](db[_0xd9f6('0x3e')]['rawAttributes'],function(_0xe5da9a){return{'name':_0xe5da9a[_0xd9f6('0x3f')],'type':_0xe5da9a[_0xd9f6('0x40')]['key']};});_0x2e7e67[_0xd9f6('0x41')]=_[_0xd9f6('0x3d')](_0x2b288c,_0xd9f6('0x3a'));_0x2e7e67[_0xd9f6('0x42')]=_['keys'](_0x14bd22[_0xd9f6('0x42')]);_0x2e7e67[_0xd9f6('0x43')]=_[_0xd9f6('0x44')](_0x2e7e67[_0xd9f6('0x41')],_0x2e7e67[_0xd9f6('0x42')]);_0x3b67aa[_0xd9f6('0x45')]=_[_0xd9f6('0x44')](_0x2e7e67['model'],qs['fields'](_0x14bd22[_0xd9f6('0x42')][_0xd9f6('0x46')]));_0x3b67aa[_0xd9f6('0x45')]=_0x3b67aa['attributes'][_0xd9f6('0x47')]?_0x3b67aa[_0xd9f6('0x45')]:_0x2e7e67[_0xd9f6('0x41')];if(!_0x14bd22[_0xd9f6('0x42')][_0xd9f6('0x48')](_0xd9f6('0x49'))){_0x3b67aa[_0xd9f6('0x33')]=qs[_0xd9f6('0x33')](_0x14bd22['query']['limit']);_0x3b67aa['offset']=qs[_0xd9f6('0x32')](_0x14bd22['query'][_0xd9f6('0x32')]);}_0x3b67aa[_0xd9f6('0x4a')]=qs['sort'](_0x14bd22[_0xd9f6('0x42')][_0xd9f6('0x4b')]);_0x3b67aa[_0xd9f6('0x4c')]=qs[_0xd9f6('0x43')](_[_0xd9f6('0x4d')](_0x14bd22['query'],_0x2e7e67[_0xd9f6('0x43')]),_0x2b288c);if(_0x14bd22['query'][_0xd9f6('0x4e')]){_0x3b67aa['where']=_[_0xd9f6('0x4f')](_0x3b67aa[_0xd9f6('0x4c')],{'$or':_[_0xd9f6('0x3d')](_0x2b288c,function(_0x1d1733){if(_0x1d1733[_0xd9f6('0x40')]!==_0xd9f6('0x50')){var _0x486e16={};_0x486e16[_0x1d1733[_0xd9f6('0x3a')]]={'$like':'%'+_0x14bd22[_0xd9f6('0x42')][_0xd9f6('0x4e')]+'%'};return _0x486e16;}})});}_0x3b67aa=_[_0xd9f6('0x4f')]({},_0x3b67aa,_0x14bd22[_0xd9f6('0x51')]);var _0x1e5f35={'where':_0x3b67aa[_0xd9f6('0x4c')]};return db['ChatMessage'][_0xd9f6('0x31')](_0x1e5f35)['then'](function(_0x19f990){_0x4850d5['count']=_0x19f990;if(_0x14bd22['query'][_0xd9f6('0x52')]){_0x3b67aa[_0xd9f6('0x53')]=[{'all':!![]}];}return db[_0xd9f6('0x3e')][_0xd9f6('0x54')](_0x3b67aa);})['then'](function(_0x41d7b9){_0x4850d5[_0xd9f6('0x55')]=_0x41d7b9;return _0x4850d5;})[_0xd9f6('0x22')](respondWithFilteredResult(_0x2b60e7,_0x3b67aa))[_0xd9f6('0x56')](handleError(_0x2b60e7,null));};exports['show']=function(_0x206855,_0x473a13){var _0x158090={'raw':!![],'where':{'id':_0x206855['params']['id']}},_0x43c0c0={};_0x43c0c0['model']=_[_0xd9f6('0x57')](db[_0xd9f6('0x3e')][_0xd9f6('0x58')]);_0x43c0c0[_0xd9f6('0x42')]=_[_0xd9f6('0x57')](_0x206855[_0xd9f6('0x42')]);_0x43c0c0[_0xd9f6('0x43')]=_[_0xd9f6('0x44')](_0x43c0c0[_0xd9f6('0x41')],_0x43c0c0[_0xd9f6('0x42')]);_0x158090[_0xd9f6('0x45')]=_['intersection'](_0x43c0c0[_0xd9f6('0x41')],qs['fields'](_0x206855[_0xd9f6('0x42')][_0xd9f6('0x46')]));_0x158090[_0xd9f6('0x45')]=_0x158090[_0xd9f6('0x45')][_0xd9f6('0x47')]?_0x158090[_0xd9f6('0x45')]:_0x43c0c0[_0xd9f6('0x41')];if(_0x206855['query'][_0xd9f6('0x52')]){_0x158090['include']=[{'all':!![]}];}_0x158090=_[_0xd9f6('0x4f')]({},_0x158090,_0x206855['options']);return db['ChatMessage'][_0xd9f6('0x59')](_0x158090)['then'](handleEntityNotFound(_0x473a13,null))[_0xd9f6('0x22')](respondWithResult(_0x473a13,null))['catch'](handleError(_0x473a13,null));};exports[_0xd9f6('0x5a')]=function(_0x33bb88,_0x3a0b9f){return db[_0xd9f6('0x3e')][_0xd9f6('0x5a')](_0x33bb88[_0xd9f6('0x5b')],{})[_0xd9f6('0x22')](respondWithResult(_0x3a0b9f,0xc9))[_0xd9f6('0x56')](handleError(_0x3a0b9f,null));};exports[_0xd9f6('0x38')]=function(_0x4dbafb,_0x1235fd){if(_0x4dbafb[_0xd9f6('0x5b')]['id']){delete _0x4dbafb['body']['id'];}return db[_0xd9f6('0x3e')][_0xd9f6('0x59')]({'where':{'id':_0x4dbafb[_0xd9f6('0x5c')]['id']}})[_0xd9f6('0x22')](handleEntityNotFound(_0x1235fd,null))[_0xd9f6('0x22')](saveUpdates(_0x4dbafb[_0xd9f6('0x5b')],null))[_0xd9f6('0x22')](respondWithResult(_0x1235fd,null))[_0xd9f6('0x56')](handleError(_0x1235fd,null));};exports[_0xd9f6('0x39')]=function(_0x4cfc8e,_0x17108d){return db[_0xd9f6('0x3e')][_0xd9f6('0x59')]({'where':{'id':_0x4cfc8e['params']['id']}})[_0xd9f6('0x22')](handleEntityNotFound(_0x17108d,null))[_0xd9f6('0x22')](removeEntity(_0x17108d,null))['catch'](handleError(_0x17108d,null));};exports[_0xd9f6('0x5d')]=function(_0x36a872,_0x1fa764){return db[_0xd9f6('0x3e')][_0xd9f6('0x5d')]()[_0xd9f6('0x22')](respondWithResult(_0x1fa764,null))[_0xd9f6('0x56')](handleError(_0x1fa764,null));};var interaction_log=require(_0xd9f6('0x13'))('chat-interactions');exports[_0xd9f6('0x5e')]=function(_0x18a6dc,_0xec878,_0x272410){var _0x139497={'agent':{},'channel':_0xd9f6('0x5f')};if(_0x18a6dc[_0xd9f6('0x5b')]['id']){delete _0x18a6dc[_0xd9f6('0x5b')]['id'];}_0x18a6dc[_0xd9f6('0x5b')][_0xd9f6('0x60')]=!![];_0x18a6dc[_0xd9f6('0x5b')][_0xd9f6('0x61')]=moment()[_0xd9f6('0x62')](_0xd9f6('0x63'));_0x18a6dc[_0xd9f6('0x5b')][_0xd9f6('0x64')]=_0x18a6dc[_0xd9f6('0x5b')][_0xd9f6('0x64')]||_0x18a6dc[_0xd9f6('0x65')]['id'];_0x139497[_0xd9f6('0x66')]['id']=_0x18a6dc[_0xd9f6('0x5b')]['UserId'];return db[_0xd9f6('0x3e')][_0xd9f6('0x59')]({'where':{'id':_0x18a6dc[_0xd9f6('0x5c')]['id'],'UserId':null}})[_0xd9f6('0x22')](handleEntityNotFound(_0xec878,null))['then'](saveUpdates(_0x18a6dc[_0xd9f6('0x5b')],null))['then'](function(_0xc973cd){if(_0xc973cd){_0x139497['message']=_0xc973cd[_0xd9f6('0x67')]({'plain':!![]});return db[_0xd9f6('0x68')][_0xd9f6('0x59')]({'where':{'id':_0xc973cd[_0xd9f6('0x69')]}});}return null;})['then'](handleEntityNotFound(_0xec878,null))['then'](function(_0x412dc2){if(_0x412dc2){return _0x412dc2[_0xd9f6('0x38')]({'UserId':_0x18a6dc[_0xd9f6('0x5b')][_0xd9f6('0x64')],'read1stAt':_[_0xd9f6('0x6a')](_0x412dc2[_0xd9f6('0x6b')])?moment()[_0xd9f6('0x62')](_0xd9f6('0x63')):undefined});}return null;})['then'](function(_0x2c8288){if(_0x2c8288){_0x139497[_0xd9f6('0x6c')]=_0x2c8288[_0xd9f6('0x67')]({'plain':!![]});interaction_log[_0xd9f6('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x18a6dc[_0xd9f6('0x65')]['id'],_0x18a6dc['user'][_0xd9f6('0x3a')],_0x18a6dc[_0xd9f6('0x65')]['role'],_0x139497[_0xd9f6('0x6c')]['id'],_0x18a6dc[_0xd9f6('0x5b')]?JSON[_0xd9f6('0x6d')](_0x18a6dc[_0xd9f6('0x5b')]):_0xd9f6('0x6e'));return respondWithRpcPromise(_0xd9f6('0x6f'),'acceptMessage',_0x139497);}return null;})[_0xd9f6('0x22')](function(_0xb00cee){var _0x22e237=_0xd9f6('0x70')+_0xb00cee['message']['ContactId'];return db[_0xd9f6('0x71')][_0xd9f6('0x42')](_0x22e237,{'type':db[_0xd9f6('0x72')]['QueryTypes'][_0xd9f6('0x73')],'raw':!![]})[_0xd9f6('0x22')](function(_0x2e376a){return _0x2e376a;});})[_0xd9f6('0x22')](function(_0x42a8c9){if(_0x42a8c9){_0x139497[_0xd9f6('0x2a')][_0xd9f6('0x74')]=_0x42a8c9[0x0];if(!_0x18a6dc[_0xd9f6('0x5b')]['UserId'])return;return db['User'][_0xd9f6('0x59')]({'where':{'id':_0x18a6dc[_0xd9f6('0x5b')][_0xd9f6('0x64')],'role':'agent'},'attributes':['id',_0xd9f6('0x3a'),'fullname',_0xd9f6('0x75'),_0xd9f6('0x76')],'raw':!![]});}return null;})[_0xd9f6('0x22')](function(_0x52d3a4){if(!_0x52d3a4)return null;_0x139497[_0xd9f6('0x2a')]['agent']=_0x52d3a4;return _0x139497;})['then'](function(_0x9bffc3){if(_0x9bffc3){if(_0x18a6dc[_0xd9f6('0x5b')][_0xd9f6('0x77')]){_0x139497[_0xd9f6('0x2a')][_0xd9f6('0x78')]=util[_0xd9f6('0x62')](_0xd9f6('0x79'),_0x18a6dc[_0xd9f6('0x65')][_0xd9f6('0x3a')]);_0x139497['message'][_0xd9f6('0x7a')]=_0x139497[_0xd9f6('0x7a')];_0x139497[_0xd9f6('0x2a')][_0xd9f6('0x7b')]=_0x139497[_0xd9f6('0x7a')];_0x139497['message'][_0xd9f6('0x7c')]=_0xd9f6('0x5e');return respondWithRpcPromise(_0xd9f6('0x7d'),_0xd9f6('0x7d'),{'event':_0xd9f6('0x7e'),'message':_[_0xd9f6('0x4f')](_0x139497[_0xd9f6('0x2a')],JSON[_0xd9f6('0x7f')](_0x139497[_0xd9f6('0x6c')][_0xd9f6('0x80')]))},client9002)['then'](function(){return _0x139497;});}return _0x139497;}return null;})[_0xd9f6('0x22')](respondWithResult(_0xec878,null))['catch'](handleError(_0xec878,null));};var interaction_log=require(_0xd9f6('0x13'))(_0xd9f6('0x81'));exports[_0xd9f6('0x37')]=function(_0x5abe79,_0x5c4a4b,_0x58de1a){var _0x454b6={'agent':{},'channel':_0xd9f6('0x5f')};if(_0x5abe79[_0xd9f6('0x5b')]['id']){delete _0x5abe79[_0xd9f6('0x5b')]['id'];}_0x5abe79[_0xd9f6('0x5b')][_0xd9f6('0x64')]=_0x5abe79['body'][_0xd9f6('0x64')]||_0x5abe79['user']['id'];_0x454b6[_0xd9f6('0x66')]['id']=_0x5abe79[_0xd9f6('0x5b')][_0xd9f6('0x64')];return db[_0xd9f6('0x3e')][_0xd9f6('0x59')]({'where':{'id':_0x5abe79['params']['id'],'UserId':null}})[_0xd9f6('0x22')](handleEntityNotFound(_0x5c4a4b,null))['then'](function(_0x5dc075){if(_0x5dc075){_0x454b6[_0xd9f6('0x2a')]=_0x5dc075[_0xd9f6('0x67')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5dc075[_0xd9f6('0x69')]}});}return null;})[_0xd9f6('0x22')](handleEntityNotFound(_0x5c4a4b,null))['then'](function(_0x1b74dd){if(_0x1b74dd){_0x454b6[_0xd9f6('0x6c')]=_0x1b74dd[_0xd9f6('0x67')]({'plain':!![]});interaction_log[_0xd9f6('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5abe79[_0xd9f6('0x65')]['id'],_0x5abe79['user']['name'],_0x5abe79['user'][_0xd9f6('0x82')],_0x454b6[_0xd9f6('0x6c')]['id'],_0x5abe79[_0xd9f6('0x5b')]?JSON['stringify'](_0x5abe79[_0xd9f6('0x5b')]):_0xd9f6('0x6e'));return respondWithRpcPromise('RejectMessage',_0xd9f6('0x83'),_0x454b6);}return null;})[_0xd9f6('0x22')](function(_0x54a73d){var _0x115ae9=_0xd9f6('0x70')+_0x54a73d['message'][_0xd9f6('0x84')];return db[_0xd9f6('0x71')][_0xd9f6('0x42')](_0x115ae9,{'type':db[_0xd9f6('0x72')][_0xd9f6('0x85')][_0xd9f6('0x73')],'raw':!![]})[_0xd9f6('0x22')](function(_0x12344a){return _0x12344a;});})[_0xd9f6('0x22')](function(_0x3c1275){if(_0x3c1275){_0x454b6[_0xd9f6('0x2a')][_0xd9f6('0x74')]=_0x3c1275[0x0];if(!_0x5abe79['body']['UserId'])return;return db['User'][_0xd9f6('0x59')]({'where':{'id':_0x5abe79[_0xd9f6('0x5b')][_0xd9f6('0x64')],'role':_0xd9f6('0x66')},'attributes':['id',_0xd9f6('0x3a'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xd9f6('0x22')](function(_0x159bc9){if(!_0x159bc9)return null;_0x454b6[_0xd9f6('0x2a')][_0xd9f6('0x66')]=_0x159bc9;return _0x454b6;})['then'](function(_0x1dc7a3){if(_0x1dc7a3){_0x1dc7a3[_0xd9f6('0x2a')][_0xd9f6('0x78')]=util[_0xd9f6('0x62')](_0xd9f6('0x79'),_0x5abe79[_0xd9f6('0x65')][_0xd9f6('0x3a')]);_0x1dc7a3[_0xd9f6('0x2a')][_0xd9f6('0x7a')]=_0x454b6['channel'];_0x1dc7a3['message']['motionChannel']=_0x454b6[_0xd9f6('0x7a')];_0x1dc7a3[_0xd9f6('0x2a')][_0xd9f6('0x7c')]=_0xd9f6('0x37');respondWithRpcPromise(_0xd9f6('0x7d'),_0xd9f6('0x7d'),{'event':'rejectmessage','message':_['merge'](_0x454b6[_0xd9f6('0x2a')],JSON['parse'](_0x454b6[_0xd9f6('0x6c')][_0xd9f6('0x80')]))},client9002);return _0x454b6;}return null;})[_0xd9f6('0x22')](respondWithResult(_0x5c4a4b,null))[_0xd9f6('0x56')](handleError(_0x5c4a4b,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 725287c..1cb5e35 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 _0xf883=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x41fb9c,_0x8d6ffc){var _0x8c53ed=function(_0x4d7c50){while(--_0x4d7c50){_0x41fb9c['push'](_0x41fb9c['shift']());}};_0x8c53ed(++_0x8d6ffc);}(_0xf883,0xd7));var _0x3f88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf883[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3f88('0x0'));var ChatMessage=require(_0x3f88('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3f88('0x2')](0x0);var events={'afterCreate':_0x3f88('0x3'),'afterUpdate':_0x3f88('0x4'),'afterDestroy':_0x3f88('0x5')};function emitEvent(_0x304e9f){return function(_0x362119,_0x5acf33,_0x232e9b){ChatMessageEvents[_0x3f88('0x6')](_0x304e9f+':'+_0x362119['id'],_0x362119);ChatMessageEvents[_0x3f88('0x6')](_0x304e9f,_0x362119);_0x232e9b(null);};}for(var e in events){if(events[_0x3f88('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x4677=['exports','ChatMessage','setMaxListeners','save','update','emit','hook'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4677,0xbe));var _0x7467=function(_0x2d2bd0,_0x13fb24){_0x2d2bd0=_0x2d2bd0-0x0;var _0x74ca2c=_0x4677[_0x2d2bd0];return _0x74ca2c;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x7467('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7467('0x1')](0x0);var events={'afterCreate':_0x7467('0x2'),'afterUpdate':_0x7467('0x3'),'afterDestroy':'remove'};function emitEvent(_0x224af0){return function(_0x3f5c45,_0x13d900,_0xf90efc){ChatMessageEvents[_0x7467('0x4')](_0x224af0+':'+_0x3f5c45['id'],_0x3f5c45);ChatMessageEvents[_0x7467('0x4')](_0x224af0,_0x3f5c45);_0xf90efc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7467('0x5')](e,emitEvent(event));}}module[_0x7467('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 449ab1f..f01f8f0 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 _0x21a1=['secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0x21a1,0x1f1));var _0x121a=function(_0x440e9c,_0x4bc703){_0x440e9c=_0x440e9c-0x0;var _0x215d0d=_0x21a1[_0x440e9c];return _0x215d0d;};'use strict';var _=require(_0x121a('0x0'));var util=require(_0x121a('0x1'));var logger=require('../../config/logger')(_0x121a('0x2'));var moment=require('moment');var BPromise=require(_0x121a('0x3'));var rp=require(_0x121a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x121a('0x5'));var attributes=require('./chatMessage.attributes');module[_0x121a('0x6')]=function(_0x567d1a,_0x33ab8b){return _0x567d1a[_0x121a('0x7')](_0x121a('0x8'),attributes,{'tableName':_0x121a('0x9'),'paranoid':![],'indexes':[{'name':_0x121a('0xa'),'fields':[_0x121a('0xb')],'type':_0x121a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53e4b2,_0x1ef51b,_0x24cf3a){var _0x5df329=_0x567d1a['models'];var _0x3eaa60=_0x53e4b2['get']({'plain':!![]});if(_0x3eaa60[_0x121a('0xd')][_0x121a('0xe')]()==='in'||_0x3eaa60[_0x121a('0xd')][_0x121a('0xe')]()===_0x121a('0xf')&&!_0x3eaa60[_0x121a('0x10')]&&!_[_0x121a('0x11')](_0x3eaa60[_0x121a('0x12')])){_0x5df329[_0x121a('0x13')][_0x121a('0x14')]({'where':{'id':_0x3eaa60[_0x121a('0x15')]}})['then'](function(_0x1f075d){if(_0x1f075d){_0x1f075d[_0x121a('0x16')]({'lastMsgAt':_0x3eaa60[_0x121a('0x17')],'lastMsgDirection':_0x3eaa60[_0x121a('0xd')][_0x121a('0xe')]()});}})[_0x121a('0x18')](function(_0x4fbf06){console['error'](_0x4fbf06);});}_0x24cf3a();}},'charset':_0x121a('0x19'),'collate':_0x121a('0x1a')});}; \ No newline at end of file +var _0x0cb9=['lodash','util','api','moment','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x0cb9,0x10e));var _0x90cb=function(_0x5447a2,_0x7508f9){_0x5447a2=_0x5447a2-0x0;var _0x423aea=_0x0cb9[_0x5447a2];return _0x423aea;};'use strict';var _=require(_0x90cb('0x0'));var util=require(_0x90cb('0x1'));var logger=require('../../config/logger')(_0x90cb('0x2'));var moment=require(_0x90cb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x90cb('0x4'));var rimraf=require('rimraf');var config=require(_0x90cb('0x5'));var attributes=require(_0x90cb('0x6'));module[_0x90cb('0x7')]=function(_0x36be39,_0x525b4e){return _0x36be39[_0x90cb('0x8')](_0x90cb('0x9'),attributes,{'tableName':_0x90cb('0xa'),'paranoid':![],'indexes':[{'name':_0x90cb('0xb'),'fields':[_0x90cb('0xc')],'type':_0x90cb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd0eaea,_0x4fd7a1,_0x3c5af4){var _0x19fed1=_0x36be39[_0x90cb('0xe')];var _0x38eab9=_0xd0eaea[_0x90cb('0xf')]({'plain':!![]});if(_0x38eab9[_0x90cb('0x10')][_0x90cb('0x11')]()==='in'||_0x38eab9[_0x90cb('0x10')][_0x90cb('0x11')]()===_0x90cb('0x12')&&!_0x38eab9[_0x90cb('0x13')]&&!_[_0x90cb('0x14')](_0x38eab9['UserId'])){_0x19fed1[_0x90cb('0x15')][_0x90cb('0x16')]({'where':{'id':_0x38eab9[_0x90cb('0x17')]}})[_0x90cb('0x18')](function(_0x298d8b){if(_0x298d8b){_0x298d8b[_0x90cb('0x19')]({'lastMsgAt':_0x38eab9[_0x90cb('0x1a')],'lastMsgDirection':_0x38eab9[_0x90cb('0x10')][_0x90cb('0x11')]()});}})[_0x90cb('0x1b')](function(_0x39aa5d){console[_0x90cb('0x1c')](_0x39aa5d);});}_0x3c5af4();}},'charset':'utf8mb4','collate':_0x90cb('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 7e39ac1..4cbe4de 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 _0x86fb=['redis','defaults','localhost','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0x86fb,0x119));var _0xb86f=function(_0x19cc9d,_0x30d82d){_0x19cc9d=_0x19cc9d-0x0;var _0x595c1f=_0x86fb[_0x19cc9d];return _0x595c1f;};'use strict';var _=require('lodash');var util=require(_0xb86f('0x0'));var moment=require(_0xb86f('0x1'));var BPromise=require('bluebird');var rs=require(_0xb86f('0x2'));var fs=require('fs');var Redis=require(_0xb86f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb86f('0x4'));var logger=require(_0xb86f('0x5'))(_0xb86f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb86f('0x7')][_0xb86f('0x8')]({'port':0x232a});config[_0xb86f('0x9')]=_[_0xb86f('0xa')](config[_0xb86f('0x9')],{'host':_0xb86f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb86f('0x9')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2ad7b3,_0x13b82f,_0x1ea141){return new BPromise(function(_0x1cdfae,_0xe7ae26){return client['request'](_0x2ad7b3,_0x1ea141)[_0xb86f('0xc')](function(_0x1f8ed0){logger['info'](_0xb86f('0xd'),_0x13b82f,'request\x20sent');logger[_0xb86f('0xe')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x13b82f,_0xb86f('0xf'),JSON['stringify'](_0x1f8ed0));if(_0x1f8ed0[_0xb86f('0x10')]){if(_0x1f8ed0['error'][_0xb86f('0x11')]===0x1f4){logger['error'](_0xb86f('0xd'),_0x13b82f,_0x1f8ed0[_0xb86f('0x10')][_0xb86f('0x12')]);return _0xe7ae26(_0x1f8ed0['error'][_0xb86f('0x12')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x13b82f,_0x1f8ed0[_0xb86f('0x10')][_0xb86f('0x12')]);return _0x1cdfae(_0x1f8ed0[_0xb86f('0x10')][_0xb86f('0x12')]);}else{logger[_0xb86f('0x13')](_0xb86f('0xd'),_0x13b82f,'request\x20sent');_0x1cdfae(_0x1f8ed0[_0xb86f('0x14')][_0xb86f('0x12')]);}})[_0xb86f('0x15')](function(_0x4207ae){logger[_0xb86f('0x10')](_0xb86f('0xd'),_0x13b82f,_0x4207ae);_0xe7ae26(_0x4207ae);});});}exports[_0xb86f('0x16')]=function(_0x444060){var _0x214bf4=this;return new Promise(function(_0x25e596,_0x5372a2){return db[_0xb86f('0x17')][_0xb86f('0x18')](_0x444060[_0xb86f('0x19')],{'raw':_0x444060[_0xb86f('0x1a')]?_0x444060[_0xb86f('0x1a')][_0xb86f('0x1b')]===undefined?!![]:![]:!![]})[_0xb86f('0xc')](function(_0x3a49e8){logger[_0xb86f('0x13')](_0xb86f('0x16'),_0x444060);logger[_0xb86f('0xe')](_0xb86f('0x16'),_0x444060,JSON[_0xb86f('0x1c')](_0x3a49e8));_0x25e596(_0x3a49e8);})[_0xb86f('0x15')](function(_0x23e7aa){logger[_0xb86f('0x10')](_0xb86f('0x16'),_0x23e7aa[_0xb86f('0x12')],_0x444060);_0x5372a2(_0x214bf4['error'](0x1f4,_0x23e7aa[_0xb86f('0x12')]));});});}; \ No newline at end of file +var _0x53fa=['redis','localhost','socket.io-emitter','./chatMessage.socket','request','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','body','options','raw','then','lodash','util','bluebird','randomstring','rpc','../../config/environment','http'];(function(_0x509bcc,_0x266f57){var _0x191288=function(_0x3e6036){while(--_0x3e6036){_0x509bcc['push'](_0x509bcc['shift']());}};_0x191288(++_0x266f57);}(_0x53fa,0x1ac));var _0xa53f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa53f('0x0'));var util=require(_0xa53f('0x1'));var moment=require('moment');var BPromise=require(_0xa53f('0x2'));var rs=require(_0xa53f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa53f('0x4'));var config=require(_0xa53f('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa53f('0x6')]({'port':0x232a});config[_0xa53f('0x7')]=_['defaults'](config[_0xa53f('0x7')],{'host':_0xa53f('0x8'),'port':0x18eb});var socket=require(_0xa53f('0x9'))(new Redis(config[_0xa53f('0x7')]));require(_0xa53f('0xa'))['register'](socket);function respondWithRpcPromise(_0x2cbdcf,_0x325f0c,_0x56d54e){return new BPromise(function(_0x83d645,_0x57fbe2){return client[_0xa53f('0xb')](_0x2cbdcf,_0x56d54e)['then'](function(_0x55e2ef){logger['info']('ChatMessage,\x20%s,\x20%s',_0x325f0c,_0xa53f('0xc'));logger[_0xa53f('0xd')](_0xa53f('0xe'),_0x325f0c,'request\x20sent',JSON[_0xa53f('0xf')](_0x55e2ef));if(_0x55e2ef[_0xa53f('0x10')]){if(_0x55e2ef[_0xa53f('0x10')][_0xa53f('0x11')]===0x1f4){logger['error'](_0xa53f('0x12'),_0x325f0c,_0x55e2ef['error']['message']);return _0x57fbe2(_0x55e2ef[_0xa53f('0x10')]['message']);}logger[_0xa53f('0x10')](_0xa53f('0x12'),_0x325f0c,_0x55e2ef[_0xa53f('0x10')][_0xa53f('0x13')]);return _0x83d645(_0x55e2ef[_0xa53f('0x10')][_0xa53f('0x13')]);}else{logger[_0xa53f('0x14')](_0xa53f('0x12'),_0x325f0c,_0xa53f('0xc'));_0x83d645(_0x55e2ef[_0xa53f('0x15')][_0xa53f('0x13')]);}})[_0xa53f('0x16')](function(_0x4d1a92){logger[_0xa53f('0x10')](_0xa53f('0x12'),_0x325f0c,_0x4d1a92);_0x57fbe2(_0x4d1a92);});});}exports[_0xa53f('0x17')]=function(_0x33c57e){var _0x5d0215=this;return new Promise(function(_0x2274ba,_0x1d6aa7){return db[_0xa53f('0x18')]['create'](_0x33c57e[_0xa53f('0x19')],{'raw':_0x33c57e[_0xa53f('0x1a')]?_0x33c57e[_0xa53f('0x1a')][_0xa53f('0x1b')]===undefined?!![]:![]:!![]})[_0xa53f('0x1c')](function(_0x138c69){logger[_0xa53f('0x14')]('CreateChatMessage',_0x33c57e);logger[_0xa53f('0xd')](_0xa53f('0x17'),_0x33c57e,JSON[_0xa53f('0xf')](_0x138c69));_0x2274ba(_0x138c69);})['catch'](function(_0x3c1546){logger[_0xa53f('0x10')](_0xa53f('0x17'),_0x3c1546[_0xa53f('0x13')],_0x33c57e);_0x1d6aa7(_0x5d0215['error'](0x1f4,_0x3c1546[_0xa53f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 6c2f006..7505832 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 _0x56a4=['removeListener','register','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x3aa731,_0x885933){var _0x5d0d82=function(_0x337c04){while(--_0x337c04){_0x3aa731['push'](_0x3aa731['shift']());}};_0x5d0d82(++_0x885933);}(_0x56a4,0x11b));var _0x456a=function(_0x39d625,_0xcbd247){_0x39d625=_0x39d625-0x0;var _0x45bafa=_0x56a4[_0x39d625];return _0x45bafa;};'use strict';var ChatMessageEvents=require(_0x456a('0x0'));var events=[_0x456a('0x1'),'remove',_0x456a('0x2')];function createListener(_0x93d98f,_0x5f3fe1){return function(_0x478cac){_0x5f3fe1[_0x456a('0x3')](_0x93d98f,_0x478cac);};}function removeListener(_0x3a11ee,_0x143999){return function(){ChatMessageEvents[_0x456a('0x4')](_0x3a11ee,_0x143999);};}exports[_0x456a('0x5')]=function(_0x4b8eec){for(var _0x3b0145=0x0,_0x52b38d=events['length'];_0x3b0145<_0x52b38d;_0x3b0145++){var _0x2b6329=events[_0x3b0145];var _0x20c8e0=createListener(_0x456a('0x6')+_0x2b6329,_0x4b8eec);ChatMessageEvents['on'](_0x2b6329,_0x20c8e0);}}; \ No newline at end of file +var _0x277c=['remove','update','emit','./chatMessage.events'];(function(_0x3d0c72,_0x57c502){var _0x2c24c6=function(_0x22491c){while(--_0x22491c){_0x3d0c72['push'](_0x3d0c72['shift']());}};_0x2c24c6(++_0x57c502);}(_0x277c,0x153));var _0xc277=function(_0x2698ef,_0x13d3ee){_0x2698ef=_0x2698ef-0x0;var _0x53e9fd=_0x277c[_0x2698ef];return _0x53e9fd;};'use strict';var ChatMessageEvents=require(_0xc277('0x0'));var events=['save',_0xc277('0x1'),_0xc277('0x2')];function createListener(_0x3cd265,_0x21d6f2){return function(_0x394371){_0x21d6f2[_0xc277('0x3')](_0x3cd265,_0x394371);};}function removeListener(_0x72f952,_0x29f81d){return function(){ChatMessageEvents['removeListener'](_0x72f952,_0x29f81d);};}exports['register']=function(_0x1a6582){for(var _0x5a4f03=0x0,_0x77e168=events['length'];_0x5a4f03<_0x77e168;_0x5a4f03++){var _0x378158=events[_0x5a4f03];var _0x17a2fe=createListener('chatMessage:'+_0x378158,_0x1a6582);ChatMessageEvents['on'](_0x378158,_0x17a2fe);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 93cd38a..c1ec3fd 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 _0x32f3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','isAuthenticated','describe','show','post','tracked','create','/:id','update','/:id/accept','accept','put','/:id/reject','reject','delete','exports','multer','path','connect-timeout'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x32f3,0xa5));var _0x332f=function(_0x1221c5,_0x2579c0){_0x1221c5=_0x1221c5-0x0;var _0x523823=_0x32f3[_0x1221c5];return _0x523823;};'use strict';var multer=require(_0x332f('0x0'));var util=require('util');var path=require(_0x332f('0x1'));var timeout=require(_0x332f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x332f('0x3'));var interaction=require(_0x332f('0x4'));var config=require(_0x332f('0x5'));var controller=require(_0x332f('0x6'));router[_0x332f('0x7')]('/',auth['isAuthenticated'](),controller[_0x332f('0x8')]);router[_0x332f('0x7')]('/describe',auth[_0x332f('0x9')](),controller[_0x332f('0xa')]);router[_0x332f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x332f('0xb')]);router[_0x332f('0xc')]('/',auth[_0x332f('0x9')](),interaction[_0x332f('0xd')]('chat','chatmessage:create'),controller[_0x332f('0xe')]);router['put'](_0x332f('0xf'),controller[_0x332f('0x10')]);router['put'](_0x332f('0x11'),auth[_0x332f('0x9')](),controller[_0x332f('0x12')]);router[_0x332f('0x13')](_0x332f('0x14'),auth['isAuthenticated'](),controller[_0x332f('0x15')]);router[_0x332f('0x16')](_0x332f('0xf'),auth[_0x332f('0x9')](),controller['destroy']);module[_0x332f('0x17')]=router; \ No newline at end of file +var _0x8dc3=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x26a12e,_0x25d1b5){var _0x4a09d1=function(_0x258760){while(--_0x258760){_0x26a12e['push'](_0x26a12e['shift']());}};_0x4a09d1(++_0x25d1b5);}(_0x8dc3,0x1a1));var _0x38dc=function(_0x98d3a4,_0x34a9c1){_0x98d3a4=_0x98d3a4-0x0;var _0x14be55=_0x8dc3[_0x98d3a4];return _0x14be55;};'use strict';var multer=require(_0x38dc('0x0'));var util=require(_0x38dc('0x1'));var path=require(_0x38dc('0x2'));var timeout=require(_0x38dc('0x3'));var express=require('express');var router=express[_0x38dc('0x4')]();var fs_extra=require(_0x38dc('0x5'));var auth=require(_0x38dc('0x6'));var interaction=require(_0x38dc('0x7'));var config=require('../../config/environment');var controller=require(_0x38dc('0x8'));router[_0x38dc('0x9')]('/',auth[_0x38dc('0xa')](),controller[_0x38dc('0xb')]);router[_0x38dc('0x9')]('/describe',auth[_0x38dc('0xa')](),controller[_0x38dc('0xc')]);router[_0x38dc('0x9')](_0x38dc('0xd'),auth[_0x38dc('0xa')](),controller[_0x38dc('0xe')]);router['post']('/',auth[_0x38dc('0xa')](),interaction[_0x38dc('0xf')](_0x38dc('0x10'),_0x38dc('0x11')),controller[_0x38dc('0x12')]);router[_0x38dc('0x13')](_0x38dc('0xd'),controller[_0x38dc('0x14')]);router[_0x38dc('0x13')](_0x38dc('0x15'),auth['isAuthenticated'](),controller[_0x38dc('0x16')]);router[_0x38dc('0x13')](_0x38dc('0x17'),auth[_0x38dc('0xa')](),controller[_0x38dc('0x18')]);router['delete'](_0x38dc('0xd'),auth[_0x38dc('0xa')](),controller[_0x38dc('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 6842191..5337234 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(_0x431cc8,_0xbf532e){var _0x58fe95=function(_0x2d8b4a){while(--_0x2d8b4a){_0x431cc8['push'](_0x431cc8['shift']());}};_0x58fe95(++_0xbf532e);}(_0xadb5,0xad));var _0x5adb=function(_0x365858,_0x29fa89){_0x365858=_0x365858-0x0;var _0x1adb0d=_0xadb5[_0x365858];return _0x1adb0d;};'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 _0xadb5=['medium','TEXT','exports'];(function(_0x3ab379,_0x28d28f){var _0x363be0=function(_0x361922){while(--_0x361922){_0x3ab379['push'](_0x3ab379['shift']());}};_0x363be0(++_0x28d28f);}(_0xadb5,0xad));var _0x5adb=function(_0xa4f491,_0x3808d6){_0xa4f491=_0xa4f491-0x0;var _0x2fb688=_0xadb5[_0xa4f491];return _0x2fb688;};'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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 196c724..70de9a8 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(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7a54,0x106));var _0x47a5=function(_0x2016f1,_0xc7061f){_0x2016f1=_0x2016f1-0x0;var _0x35c426=_0x7a54[_0x2016f1];return _0x35c426;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2095c4,_0x48eaa0){var _0x1e40ed=function(_0x263faa){while(--_0x263faa){_0x2095c4['push'](_0x2095c4['shift']());}};_0x1e40ed(++_0x48eaa0);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 6783d9b..09ba90b 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 _0xee0a=['emit','hook','exports','events','ChatOfflineMessage','setMaxListeners','update'];(function(_0x26362f,_0x6eed5){var _0x3e06f8=function(_0x17d76d){while(--_0x17d76d){_0x26362f['push'](_0x26362f['shift']());}};_0x3e06f8(++_0x6eed5);}(_0xee0a,0xc0));var _0xaee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee0a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xaee0('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xaee0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xaee0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaee0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x58e2d2){return function(_0x36b8b9,_0x2a0500,_0x12346d){ChatOfflineMessageEvents[_0xaee0('0x4')](_0x58e2d2+':'+_0x36b8b9['id'],_0x36b8b9);ChatOfflineMessageEvents['emit'](_0x58e2d2,_0x36b8b9);_0x12346d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xaee0('0x5')](e,emitEvent(event));}}module[_0xaee0('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x6313=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x6313,0x92));var _0x3631=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x6313[_0x1c1fba];return _0x37e346;};'use strict';var EventEmitter=require(_0x3631('0x0'));var ChatOfflineMessage=require(_0x3631('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3631('0x2')](0x0);var events={'afterCreate':_0x3631('0x3'),'afterUpdate':'update','afterDestroy':_0x3631('0x4')};function emitEvent(_0x38b8ba){return function(_0x3b6c92,_0x2a5894,_0x53d4a4){ChatOfflineMessageEvents[_0x3631('0x5')](_0x38b8ba+':'+_0x3b6c92['id'],_0x3b6c92);ChatOfflineMessageEvents[_0x3631('0x5')](_0x38b8ba,_0x3b6c92);_0x53d4a4(null);};}for(var e in events){if(events[_0x3631('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3631('0x7')](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 f8e6959..1c671f3 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 _0x2622=['utf8mb4','utf8mb4_unicode_ci','define','chat_offline_messages'];(function(_0x4bb8e6,_0x512cc6){var _0x19d134=function(_0x166bf7){while(--_0x166bf7){_0x4bb8e6['push'](_0x4bb8e6['shift']());}};_0x19d134(++_0x512cc6);}(_0x2622,0x1ea));var _0x2262=function(_0x39e093,_0x5b9a25){_0x39e093=_0x39e093-0x0;var _0xfce73=_0x2622[_0x39e093];return _0xfce73;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x1300d0){return _0x1300d0[_0x2262('0x0')]('ChatOfflineMessage',attributes,{'tableName':_0x2262('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2262('0x2'),'collate':_0x2262('0x3')});}; \ No newline at end of file +var _0x3c3e=['exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x3c3e,0x17f));var _0xe3c3=function(_0x1664ae,_0x1ed498){_0x1664ae=_0x1664ae-0x0;var _0x300d08=_0x3c3e[_0x1664ae];return _0x300d08;};'use strict';var attributes=require(_0xe3c3('0x0'));module[_0xe3c3('0x1')]=function(_0x86c6c0){return _0x86c6c0[_0xe3c3('0x2')](_0xe3c3('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe3c3('0x4'),'collate':_0xe3c3('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 548c7b4..d2f892c 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 _0xb8ca=['http','request','then','info','request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x157fbe,_0x343f61){var _0xe7ae0f=function(_0x3d1d99){while(--_0x3d1d99){_0x157fbe['push'](_0x157fbe['shift']());}};_0xe7ae0f(++_0x343f61);}(_0xb8ca,0x89));var _0xab8c=function(_0xc41da6,_0x4beeba){_0xc41da6=_0xc41da6-0x0;var _0x13f2f8=_0xb8ca[_0xc41da6];return _0x13f2f8;};'use strict';var _=require(_0xab8c('0x0'));var util=require(_0xab8c('0x1'));var moment=require(_0xab8c('0x2'));var BPromise=require('bluebird');var rs=require(_0xab8c('0x3'));var fs=require('fs');var Redis=require(_0xab8c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xab8c('0x5'))(_0xab8c('0x6'));var config=require(_0xab8c('0x7'));var jayson=require(_0xab8c('0x8'));var client=jayson[_0xab8c('0x9')][_0xab8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506335,_0x576d6a,_0x32f11f){return new BPromise(function(_0x56f6ac,_0x149a95){return client[_0xab8c('0xb')](_0x506335,_0x32f11f)[_0xab8c('0xc')](function(_0xa2c01c){logger[_0xab8c('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x576d6a,_0xab8c('0xe'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x576d6a,'request\x20sent',JSON[_0xab8c('0xf')](_0xa2c01c));if(_0xa2c01c[_0xab8c('0x10')]){if(_0xa2c01c[_0xab8c('0x10')][_0xab8c('0x11')]===0x1f4){logger[_0xab8c('0x10')](_0xab8c('0x12'),_0x576d6a,_0xa2c01c[_0xab8c('0x10')][_0xab8c('0x13')]);return _0x149a95(_0xa2c01c[_0xab8c('0x10')][_0xab8c('0x13')]);}logger[_0xab8c('0x10')](_0xab8c('0x12'),_0x576d6a,_0xa2c01c[_0xab8c('0x10')][_0xab8c('0x13')]);return _0x56f6ac(_0xa2c01c[_0xab8c('0x10')]['message']);}else{logger['info'](_0xab8c('0x12'),_0x576d6a,_0xab8c('0xe'));_0x56f6ac(_0xa2c01c['result'][_0xab8c('0x13')]);}})[_0xab8c('0x14')](function(_0x277259){logger[_0xab8c('0x10')](_0xab8c('0x12'),_0x576d6a,_0x277259);_0x149a95(_0x277259);});});} \ No newline at end of file +var _0x6208=['code','message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x368eb4,_0x1512b3){var _0x398603=function(_0xbb510a){while(--_0xbb510a){_0x368eb4['push'](_0x368eb4['shift']());}};_0x398603(++_0x1512b3);}(_0x6208,0x17d));var _0x8620=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0x6208[_0x53e3de];return _0x7b905b;};'use strict';var _=require(_0x8620('0x0'));var util=require('util');var moment=require(_0x8620('0x1'));var BPromise=require(_0x8620('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8620('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8620('0x4'));var logger=require(_0x8620('0x5'))(_0x8620('0x6'));var config=require(_0x8620('0x7'));var jayson=require(_0x8620('0x8'));var client=jayson[_0x8620('0x9')][_0x8620('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x525095,_0x270a35,_0x1a6e9e){return new BPromise(function(_0x92a9cb,_0x4694f2){return client[_0x8620('0xb')](_0x525095,_0x1a6e9e)[_0x8620('0xc')](function(_0x10f234){logger[_0x8620('0xd')](_0x8620('0xe'),_0x270a35,'request\x20sent');logger[_0x8620('0xf')](_0x8620('0x10'),_0x270a35,'request\x20sent',JSON['stringify'](_0x10f234));if(_0x10f234[_0x8620('0x11')]){if(_0x10f234[_0x8620('0x11')][_0x8620('0x12')]===0x1f4){logger[_0x8620('0x11')](_0x8620('0xe'),_0x270a35,_0x10f234[_0x8620('0x11')]['message']);return _0x4694f2(_0x10f234[_0x8620('0x11')]['message']);}logger[_0x8620('0x11')](_0x8620('0xe'),_0x270a35,_0x10f234[_0x8620('0x11')][_0x8620('0x13')]);return _0x92a9cb(_0x10f234['error'][_0x8620('0x13')]);}else{logger[_0x8620('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x270a35,'request\x20sent');_0x92a9cb(_0x10f234[_0x8620('0x14')][_0x8620('0x13')]);}})['catch'](function(_0x23c8e4){logger['error'](_0x8620('0xe'),_0x270a35,_0x23c8e4);_0x4694f2(_0x23c8e4);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 6ea1c8c..61f7286 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 _0x3f23=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy'];(function(_0x2a84a2,_0x56a065){var _0x5f2423=function(_0x560caf){while(--_0x560caf){_0x2a84a2['push'](_0x2a84a2['shift']());}};_0x5f2423(++_0x56a065);}(_0x3f23,0x1d5));var _0x33f2=function(_0x1047e0,_0x221167){_0x1047e0=_0x1047e0-0x0;var _0x3ccf5e=_0x3f23[_0x1047e0];return _0x3ccf5e;};'use strict';var multer=require(_0x33f2('0x0'));var util=require('util');var path=require(_0x33f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x33f2('0x2'));var router=express['Router']();var fs_extra=require(_0x33f2('0x3'));var auth=require(_0x33f2('0x4'));var interaction=require(_0x33f2('0x5'));var config=require(_0x33f2('0x6'));var controller=require(_0x33f2('0x7'));router[_0x33f2('0x8')]('/',auth[_0x33f2('0x9')](),controller[_0x33f2('0xa')]);router[_0x33f2('0x8')]('/describe',auth[_0x33f2('0x9')](),controller['describe']);router[_0x33f2('0x8')](_0x33f2('0xb'),auth[_0x33f2('0x9')](),controller[_0x33f2('0xc')]);router[_0x33f2('0xd')]('/',auth[_0x33f2('0x9')](),controller[_0x33f2('0xe')]);router[_0x33f2('0xf')]('/:id',auth[_0x33f2('0x9')](),controller['update']);router['delete'](_0x33f2('0xb'),auth[_0x33f2('0x9')](),controller[_0x33f2('0x10')]);module[_0x33f2('0x11')]=router; \ No newline at end of file +var _0x7fc4=['put','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x24c9d0,_0x4967b6){var _0x58c87f=function(_0x380793){while(--_0x380793){_0x24c9d0['push'](_0x24c9d0['shift']());}};_0x58c87f(++_0x4967b6);}(_0x7fc4,0x76));var _0x47fc=function(_0x3ae3e1,_0x2677dd){_0x3ae3e1=_0x3ae3e1-0x0;var _0x539e21=_0x7fc4[_0x3ae3e1];return _0x539e21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x47fc('0x0'));var timeout=require(_0x47fc('0x1'));var express=require(_0x47fc('0x2'));var router=express[_0x47fc('0x3')]();var fs_extra=require(_0x47fc('0x4'));var auth=require(_0x47fc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x47fc('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x47fc('0x7')]('/',auth[_0x47fc('0x8')](),controller[_0x47fc('0x9')]);router[_0x47fc('0x7')]('/describe',auth[_0x47fc('0x8')](),controller[_0x47fc('0xa')]);router[_0x47fc('0x7')](_0x47fc('0xb'),auth[_0x47fc('0x8')](),controller[_0x47fc('0xc')]);router[_0x47fc('0xd')]('/',auth[_0x47fc('0x8')](),controller[_0x47fc('0xe')]);router[_0x47fc('0xf')](_0x47fc('0xb'),auth[_0x47fc('0x8')](),controller[_0x47fc('0x10')]);router[_0x47fc('0x11')]('/:id',auth[_0x47fc('0x8')](),controller[_0x47fc('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index a01794e..d36c845 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 _0xaa2a=['mouseOver','sequelize','exports','STRING'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xaa2a,0x195));var _0xaaa2=function(_0x1f2c66,_0x4e854f){_0x1f2c66=_0x1f2c66-0x0;var _0x10140e=_0xaa2a[_0x1f2c66];return _0x10140e;};'use strict';var Sequelize=require(_0xaaa2('0x0'));module[_0xaaa2('0x1')]={'name':{'type':Sequelize[_0xaaa2('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xaaa2('0x3'),'timeout'),'defaultValue':_0xaaa2('0x3')},'selector':{'type':Sequelize[_0xaaa2('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf639=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x4a1a1c,_0x5a7e8f){var _0x3c4fc7=function(_0x2e658d){while(--_0x2e658d){_0x4a1a1c['push'](_0x4a1a1c['shift']());}};_0x3c4fc7(++_0x5a7e8f);}(_0xf639,0x8a));var _0x9f63=function(_0x3b2da1,_0x5dc17b){_0x3b2da1=_0x3b2da1-0x0;var _0x4f530a=_0xf639[_0x3b2da1];return _0x4f530a;};'use strict';var Sequelize=require(_0x9f63('0x0'));module[_0x9f63('0x1')]={'name':{'type':Sequelize[_0x9f63('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9f63('0x3'),_0x9f63('0x4')),'defaultValue':_0x9f63('0x3')},'selector':{'type':Sequelize[_0x9f63('0x2')]},'timeout':{'type':Sequelize[_0x9f63('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 569d757..2f2b5dc 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 _0xc03e=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','options','find','catch','create','body','destroy','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xc03e,0x15a));var _0xec03=function(_0x3e99cb,_0x1d2fe0){_0x3e99cb=_0x3e99cb-0x0;var _0x1bc729=_0xc03e[_0x3e99cb];return _0x1bc729;};'use strict';var emlformat=require(_0xec03('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xec03('0x1'));var rp=require('request-promise');var moment=require(_0xec03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xec03('0x3'));var util=require(_0xec03('0x4'));var path=require(_0xec03('0x5'));var sox=require(_0xec03('0x6'));var csv=require(_0xec03('0x7'));var ejs=require(_0xec03('0x8'));var fs=require('fs');var fs_extra=require(_0xec03('0x9'));var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x7'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var as=require(_0xec03('0x12'));var hardwareService=require(_0xec03('0x13'));var logger=require(_0xec03('0x14'))(_0xec03('0x15'));var utils=require(_0xec03('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec03('0x17'));var db=require(_0xec03('0x18'))['db'];function respondWithStatusCode(_0x398720,_0x2f65a1){_0x2f65a1=_0x2f65a1||0xcc;return function(_0x9908ef){if(_0x9908ef){return _0x398720[_0xec03('0x19')](_0x2f65a1);}return _0x398720[_0xec03('0x1a')](_0x2f65a1)[_0xec03('0x1b')]();};}function respondWithResult(_0x4ba43a,_0x555447){_0x555447=_0x555447||0xc8;return function(_0x5ca0e2){if(_0x5ca0e2){return _0x4ba43a[_0xec03('0x1a')](_0x555447)[_0xec03('0x1c')](_0x5ca0e2);}};}function respondWithFilteredResult(_0x3501ab,_0x515680){return function(_0x28bb4f){if(_0x28bb4f){var _0xbe85e6=typeof _0x515680[_0xec03('0x1d')]===_0xec03('0x1e')&&typeof _0x515680['limit']===_0xec03('0x1e');var _0x52f6ae=_0x28bb4f[_0xec03('0x1f')];var _0x5e8ae2=_0xbe85e6?0x0:_0x515680[_0xec03('0x1d')];var _0x5b3e04=_0xbe85e6?_0x28bb4f['count']:_0x515680[_0xec03('0x1d')]+_0x515680[_0xec03('0x20')];var _0xefa268;if(_0x5b3e04>=_0x52f6ae){_0x5b3e04=_0x52f6ae;_0xefa268=0xc8;}else{_0xefa268=0xce;}_0x3501ab[_0xec03('0x1a')](_0xefa268);return _0x3501ab['set'](_0xec03('0x21'),_0x5e8ae2+'-'+_0x5b3e04+'/'+_0x52f6ae)['json'](_0x28bb4f);}return null;};}function patchUpdates(_0x16ade3){return function(_0x253910){try{jsonpatch[_0xec03('0x22')](_0x253910,_0x16ade3,!![]);}catch(_0x33a167){return BPromise[_0xec03('0x23')](_0x33a167);}return _0x253910[_0xec03('0x24')]();};}function saveUpdates(_0x3a44df,_0x3b6ddf){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0xec03('0x25')](_0x3a44df)[_0xec03('0x26')](function(_0xa16d53){return _0xa16d53;});}return null;};}function removeEntity(_0x76b813,_0x33de1e){return function(_0x15ef87){if(_0x15ef87){return _0x15ef87['destroy']()[_0xec03('0x26')](function(){_0x76b813[_0xec03('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfcf6,_0xa5b580){return function(_0x26875e){if(!_0x26875e){_0x2bfcf6[_0xec03('0x19')](0x194);}return _0x26875e;};}function handleError(_0x1c6870,_0x581322){_0x581322=_0x581322||0x1f4;return function(_0x73cc4f){logger[_0xec03('0x27')](_0x73cc4f[_0xec03('0x28')]);if(_0x73cc4f[_0xec03('0x29')]){delete _0x73cc4f[_0xec03('0x29')];}_0x1c6870['status'](_0x581322)[_0xec03('0x2a')](_0x73cc4f);};}exports[_0xec03('0x2b')]=function(_0x49f9ab,_0x530251){var _0x2063ba={'raw':!![],'where':{'id':_0x49f9ab[_0xec03('0x2c')]['id']}},_0x12b5c9={};_0x12b5c9[_0xec03('0x2d')]=_[_0xec03('0x2e')](db[_0xec03('0x2f')][_0xec03('0x30')]);_0x12b5c9[_0xec03('0x31')]=_['keys'](_0x49f9ab[_0xec03('0x31')]);_0x12b5c9[_0xec03('0x32')]=_[_0xec03('0x33')](_0x12b5c9[_0xec03('0x2d')],_0x12b5c9[_0xec03('0x31')]);_0x2063ba[_0xec03('0x34')]=_[_0xec03('0x33')](_0x12b5c9[_0xec03('0x2d')],qs[_0xec03('0x35')](_0x49f9ab['query']['fields']));_0x2063ba['attributes']=_0x2063ba[_0xec03('0x34')][_0xec03('0x36')]?_0x2063ba[_0xec03('0x34')]:_0x12b5c9[_0xec03('0x2d')];if(_0x49f9ab['query']['includeAll']){_0x2063ba['include']=[{'all':!![]}];}_0x2063ba=_['merge']({},_0x2063ba,_0x49f9ab[_0xec03('0x37')]);return db[_0xec03('0x2f')][_0xec03('0x38')](_0x2063ba)[_0xec03('0x26')](handleEntityNotFound(_0x530251,null))[_0xec03('0x26')](respondWithResult(_0x530251,null))[_0xec03('0x39')](handleError(_0x530251,null));};exports[_0xec03('0x3a')]=function(_0x1cee38,_0x44ccf4){return db[_0xec03('0x2f')][_0xec03('0x3a')](_0x1cee38[_0xec03('0x3b')],{})['then'](respondWithResult(_0x44ccf4,0xc9))[_0xec03('0x39')](handleError(_0x44ccf4,null));};exports[_0xec03('0x25')]=function(_0x240f48,_0x5558d4){if(_0x240f48[_0xec03('0x3b')]['id']){delete _0x240f48[_0xec03('0x3b')]['id'];}return db[_0xec03('0x2f')][_0xec03('0x38')]({'where':{'id':_0x240f48[_0xec03('0x2c')]['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x5558d4,null))[_0xec03('0x26')](saveUpdates(_0x240f48[_0xec03('0x3b')],null))[_0xec03('0x26')](respondWithResult(_0x5558d4,null))[_0xec03('0x39')](handleError(_0x5558d4,null));};exports[_0xec03('0x3c')]=function(_0x4c8dc5,_0x25286a){return db[_0xec03('0x2f')][_0xec03('0x38')]({'where':{'id':_0x4c8dc5[_0xec03('0x2c')]['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x25286a,null))[_0xec03('0x26')](removeEntity(_0x25286a,null))[_0xec03('0x39')](handleError(_0x25286a,null));}; \ No newline at end of file +var _0xff16=['catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','stack','name','send','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','create','body','params'];(function(_0x2e6f9f,_0x5d74fa){var _0x4469e0=function(_0xec4f5f){while(--_0xec4f5f){_0x2e6f9f['push'](_0x2e6f9f['shift']());}};_0x4469e0(++_0x5d74fa);}(_0xff16,0x7f));var _0x6ff1=function(_0x11e0c8,_0x124345){_0x11e0c8=_0x11e0c8-0x0;var _0x18d651=_0xff16[_0x11e0c8];return _0x18d651;};'use strict';var emlformat=require(_0x6ff1('0x0'));var rimraf=require(_0x6ff1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ff1('0x2'));var rp=require(_0x6ff1('0x3'));var moment=require(_0x6ff1('0x4'));var BPromise=require(_0x6ff1('0x5'));var Mustache=require(_0x6ff1('0x6'));var util=require(_0x6ff1('0x7'));var path=require(_0x6ff1('0x8'));var sox=require(_0x6ff1('0x9'));var csv=require('to-csv');var ejs=require(_0x6ff1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ff1('0xb'));var squel=require(_0x6ff1('0xc'));var crypto=require(_0x6ff1('0xd'));var jsforce=require(_0x6ff1('0xe'));var deskjs=require(_0x6ff1('0xf'));var toCsv=require(_0x6ff1('0x10'));var querystring=require(_0x6ff1('0x11'));var Papa=require(_0x6ff1('0x12'));var Redis=require('ioredis');var authService=require(_0x6ff1('0x13'));var qs=require(_0x6ff1('0x14'));var as=require(_0x6ff1('0x15'));var hardwareService=require(_0x6ff1('0x16'));var logger=require(_0x6ff1('0x17'))(_0x6ff1('0x18'));var utils=require(_0x6ff1('0x19'));var config=require(_0x6ff1('0x1a'));var licenseUtil=require(_0x6ff1('0x1b'));var db=require(_0x6ff1('0x1c'))['db'];function respondWithStatusCode(_0x4e8484,_0x5cf649){_0x5cf649=_0x5cf649||0xcc;return function(_0x5dacd6){if(_0x5dacd6){return _0x4e8484['sendStatus'](_0x5cf649);}return _0x4e8484[_0x6ff1('0x1d')](_0x5cf649)[_0x6ff1('0x1e')]();};}function respondWithResult(_0x1451af,_0x543e07){_0x543e07=_0x543e07||0xc8;return function(_0x58952d){if(_0x58952d){return _0x1451af['status'](_0x543e07)[_0x6ff1('0x1f')](_0x58952d);}};}function respondWithFilteredResult(_0x1ec8e9,_0x23112d){return function(_0x29e6c7){if(_0x29e6c7){var _0x36fa15=typeof _0x23112d[_0x6ff1('0x20')]==='undefined'&&typeof _0x23112d[_0x6ff1('0x21')]===_0x6ff1('0x22');var _0x4751b9=_0x29e6c7[_0x6ff1('0x23')];var _0xe5d26e=_0x36fa15?0x0:_0x23112d[_0x6ff1('0x20')];var _0x5041d7=_0x36fa15?_0x29e6c7[_0x6ff1('0x23')]:_0x23112d[_0x6ff1('0x20')]+_0x23112d[_0x6ff1('0x21')];var _0x256457;if(_0x5041d7>=_0x4751b9){_0x5041d7=_0x4751b9;_0x256457=0xc8;}else{_0x256457=0xce;}_0x1ec8e9[_0x6ff1('0x1d')](_0x256457);return _0x1ec8e9[_0x6ff1('0x24')]('Content-Range',_0xe5d26e+'-'+_0x5041d7+'/'+_0x4751b9)[_0x6ff1('0x1f')](_0x29e6c7);}return null;};}function patchUpdates(_0x54c961){return function(_0x328325){try{jsonpatch[_0x6ff1('0x25')](_0x328325,_0x54c961,!![]);}catch(_0x2d3131){return BPromise[_0x6ff1('0x26')](_0x2d3131);}return _0x328325[_0x6ff1('0x27')]();};}function saveUpdates(_0x47fd1f,_0x56027f){return function(_0x561bcd){if(_0x561bcd){return _0x561bcd['update'](_0x47fd1f)[_0x6ff1('0x28')](function(_0xbdd73e){return _0xbdd73e;});}return null;};}function removeEntity(_0x4b3d22,_0x41b160){return function(_0x1ec4f1){if(_0x1ec4f1){return _0x1ec4f1[_0x6ff1('0x29')]()[_0x6ff1('0x28')](function(){_0x4b3d22[_0x6ff1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13acb3,_0x324645){return function(_0x13ff47){if(!_0x13ff47){_0x13acb3['sendStatus'](0x194);}return _0x13ff47;};}function handleError(_0x512759,_0x17036d){_0x17036d=_0x17036d||0x1f4;return function(_0x2705d4){logger['error'](_0x2705d4[_0x6ff1('0x2a')]);if(_0x2705d4[_0x6ff1('0x2b')]){delete _0x2705d4['name'];}_0x512759[_0x6ff1('0x1d')](_0x17036d)[_0x6ff1('0x2c')](_0x2705d4);};}exports['show']=function(_0x3cc69e,_0x3597c6){var _0x2f7006={'raw':!![],'where':{'id':_0x3cc69e['params']['id']}},_0x193c09={};_0x193c09[_0x6ff1('0x2d')]=_[_0x6ff1('0x2e')](db[_0x6ff1('0x2f')][_0x6ff1('0x30')]);_0x193c09[_0x6ff1('0x31')]=_['keys'](_0x3cc69e[_0x6ff1('0x31')]);_0x193c09[_0x6ff1('0x32')]=_[_0x6ff1('0x33')](_0x193c09['model'],_0x193c09[_0x6ff1('0x31')]);_0x2f7006['attributes']=_[_0x6ff1('0x33')](_0x193c09[_0x6ff1('0x2d')],qs[_0x6ff1('0x34')](_0x3cc69e[_0x6ff1('0x31')][_0x6ff1('0x34')]));_0x2f7006[_0x6ff1('0x35')]=_0x2f7006[_0x6ff1('0x35')]['length']?_0x2f7006['attributes']:_0x193c09[_0x6ff1('0x2d')];if(_0x3cc69e[_0x6ff1('0x31')][_0x6ff1('0x36')]){_0x2f7006[_0x6ff1('0x37')]=[{'all':!![]}];}_0x2f7006=_[_0x6ff1('0x38')]({},_0x2f7006,_0x3cc69e[_0x6ff1('0x39')]);return db['ChatProactiveAction'][_0x6ff1('0x3a')](_0x2f7006)[_0x6ff1('0x28')](handleEntityNotFound(_0x3597c6,null))[_0x6ff1('0x28')](respondWithResult(_0x3597c6,null))['catch'](handleError(_0x3597c6,null));};exports[_0x6ff1('0x3b')]=function(_0x48e7d9,_0x12affb){return db['ChatProactiveAction'][_0x6ff1('0x3b')](_0x48e7d9[_0x6ff1('0x3c')],{})['then'](respondWithResult(_0x12affb,0xc9))['catch'](handleError(_0x12affb,null));};exports['update']=function(_0x2f6172,_0xcf4451){if(_0x2f6172[_0x6ff1('0x3c')]['id']){delete _0x2f6172[_0x6ff1('0x3c')]['id'];}return db[_0x6ff1('0x2f')]['find']({'where':{'id':_0x2f6172[_0x6ff1('0x3d')]['id']}})['then'](handleEntityNotFound(_0xcf4451,null))[_0x6ff1('0x28')](saveUpdates(_0x2f6172['body'],null))['then'](respondWithResult(_0xcf4451,null))[_0x6ff1('0x3e')](handleError(_0xcf4451,null));};exports[_0x6ff1('0x29')]=function(_0x3f8d42,_0x91ddc7){return db[_0x6ff1('0x2f')][_0x6ff1('0x3a')]({'where':{'id':_0x3f8d42['params']['id']}})[_0x6ff1('0x28')](handleEntityNotFound(_0x91ddc7,null))[_0x6ff1('0x28')](removeEntity(_0x91ddc7,null))['catch'](handleError(_0x91ddc7,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 0cb52a3..6f7106d 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 _0xee1c=['ChatProactiveAction','chat_proactive_actions','../../config/logger','api','request-promise','../../config/environment','./chatProactiveAction.attributes','define'];(function(_0x513f78,_0x5959bd){var _0x355a21=function(_0x20e1c9){while(--_0x20e1c9){_0x513f78['push'](_0x513f78['shift']());}};_0x355a21(++_0x5959bd);}(_0xee1c,0x11a));var _0xcee1=function(_0x1af482,_0x1af5b7){_0x1af482=_0x1af482-0x0;var _0x7e7580=_0xee1c[_0x1af482];return _0x7e7580;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcee1('0x0'))(_0xcee1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcee1('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcee1('0x3'));var attributes=require(_0xcee1('0x4'));module['exports']=function(_0x42c0cc,_0x3f26b2){return _0x42c0cc[_0xcee1('0x5')](_0xcee1('0x6'),attributes,{'tableName':_0xcee1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x277d=['path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3d7d1f,_0x11d1eb){var _0x3dbb37=function(_0x3870ba){while(--_0x3870ba){_0x3d7d1f['push'](_0x3d7d1f['shift']());}};_0x3dbb37(++_0x11d1eb);}(_0x277d,0x11a));var _0xd277=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x277d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd277('0x0'));var util=require(_0xd277('0x1'));var logger=require(_0xd277('0x2'))(_0xd277('0x3'));var moment=require(_0xd277('0x4'));var BPromise=require('bluebird');var rp=require(_0xd277('0x5'));var fs=require('fs');var path=require(_0xd277('0x6'));var rimraf=require(_0xd277('0x7'));var config=require('../../config/environment');var attributes=require(_0xd277('0x8'));module[_0xd277('0x9')]=function(_0x50b860,_0x4f102b){return _0x50b860[_0xd277('0xa')](_0xd277('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index ed0ea1a..a2375d8 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 _0x9f8a=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x445c78,_0x3254ea){var _0x3f43f2=function(_0x13406d){while(--_0x13406d){_0x445c78['push'](_0x445c78['shift']());}};_0x3f43f2(++_0x3254ea);}(_0x9f8a,0x11e));var _0xa9f8=function(_0x31be01,_0x361b72){_0x31be01=_0x31be01-0x0;var _0x1ba0ea=_0x9f8a[_0x31be01];return _0x1ba0ea;};'use strict';var _=require(_0xa9f8('0x0'));var util=require(_0xa9f8('0x1'));var moment=require(_0xa9f8('0x2'));var BPromise=require(_0xa9f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9f8('0x4'));var db=require(_0xa9f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9f8('0x6'))(_0xa9f8('0x7'));var config=require(_0xa9f8('0x8'));var jayson=require(_0xa9f8('0x9'));var client=jayson[_0xa9f8('0xa')][_0xa9f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bc7a8,_0x503e9b,_0x436244){return new BPromise(function(_0x2e1bf8,_0x43d480){return client['request'](_0x4bc7a8,_0x436244)[_0xa9f8('0xc')](function(_0x1a811d){logger[_0xa9f8('0xd')](_0xa9f8('0xe'),_0x503e9b,_0xa9f8('0xf'));logger[_0xa9f8('0x10')](_0xa9f8('0x11'),_0x503e9b,_0xa9f8('0xf'),JSON['stringify'](_0x1a811d));if(_0x1a811d[_0xa9f8('0x12')]){if(_0x1a811d['error']['code']===0x1f4){logger[_0xa9f8('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x503e9b,_0x1a811d[_0xa9f8('0x12')][_0xa9f8('0x13')]);return _0x43d480(_0x1a811d[_0xa9f8('0x12')]['message']);}logger['error'](_0xa9f8('0xe'),_0x503e9b,_0x1a811d[_0xa9f8('0x12')]['message']);return _0x2e1bf8(_0x1a811d[_0xa9f8('0x12')][_0xa9f8('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x503e9b,_0xa9f8('0xf'));_0x2e1bf8(_0x1a811d[_0xa9f8('0x14')][_0xa9f8('0x13')]);}})[_0xa9f8('0x15')](function(_0x344902){logger['error'](_0xa9f8('0xe'),_0x503e9b,_0x344902);_0x43d480(_0x344902);});});} \ No newline at end of file +var _0xa680=['http','request','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4c5aff,_0x323b60){var _0x1985f8=function(_0x10e6ac){while(--_0x10e6ac){_0x4c5aff['push'](_0x4c5aff['shift']());}};_0x1985f8(++_0x323b60);}(_0xa680,0xe3));var _0x0a68=function(_0x4e40e4,_0xf2d3b8){_0x4e40e4=_0x4e40e4-0x0;var _0x396d7c=_0xa680[_0x4e40e4];return _0x396d7c;};'use strict';var _=require(_0x0a68('0x0'));var util=require('util');var moment=require(_0x0a68('0x1'));var BPromise=require(_0x0a68('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0a68('0x3'));var logger=require(_0x0a68('0x4'))(_0x0a68('0x5'));var config=require(_0x0a68('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0a68('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34d434,_0x4548ab,_0xed61eb){return new BPromise(function(_0x1e75a7,_0x1a3f53){return client[_0x0a68('0x8')](_0x34d434,_0xed61eb)[_0x0a68('0x9')](function(_0x411f11){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x4548ab,_0x0a68('0xa'));logger[_0x0a68('0xb')](_0x0a68('0xc'),_0x4548ab,_0x0a68('0xa'),JSON['stringify'](_0x411f11));if(_0x411f11[_0x0a68('0xd')]){if(_0x411f11[_0x0a68('0xd')][_0x0a68('0xe')]===0x1f4){logger['error'](_0x0a68('0xf'),_0x4548ab,_0x411f11[_0x0a68('0xd')][_0x0a68('0x10')]);return _0x1a3f53(_0x411f11[_0x0a68('0xd')]['message']);}logger[_0x0a68('0xd')](_0x0a68('0xf'),_0x4548ab,_0x411f11[_0x0a68('0xd')]['message']);return _0x1e75a7(_0x411f11['error'][_0x0a68('0x10')]);}else{logger['info'](_0x0a68('0xf'),_0x4548ab,_0x0a68('0xa'));_0x1e75a7(_0x411f11[_0x0a68('0x11')][_0x0a68('0x10')]);}})['catch'](function(_0x18f4cd){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4548ab,_0x18f4cd);_0x1a3f53(_0x18f4cd);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index b827b7d..5d1de1f 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 _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0xf328d0,_0x5edc57){var _0xfb4f7a=function(_0xfa12c7){while(--_0xfa12c7){_0xf328d0['push'](_0xf328d0['shift']());}};_0xfb4f7a(++_0x5edc57);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1121a2,_0xc2448e){_0x1121a2=_0x1121a2-0x0;var _0x4155f0=_0xdbf5[_0x1121a2];return _0x4155f0;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router; \ No newline at end of file +var _0xae24=['destroy','exports','multer','path','express','Router','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x464838,_0x28c910){var _0x2ca654=function(_0x380da8){while(--_0x380da8){_0x464838['push'](_0x464838['shift']());}};_0x2ca654(++_0x28c910);}(_0xae24,0x182));var _0x4ae2=function(_0xfeebc7,_0x2b476e){_0xfeebc7=_0xfeebc7-0x0;var _0x36d0ac=_0xae24[_0xfeebc7];return _0x36d0ac;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')](_0x4ae2('0x7'),auth[_0x4ae2('0x8')](),controller[_0x4ae2('0x9')]);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')]('/:id',auth[_0x4ae2('0x8')](),controller[_0x4ae2('0xe')]);module[_0x4ae2('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a8d5a09..28551ac 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 _0x3a9f=['roundrobin','name','INTEGER','rrmemory'];(function(_0x4c32cf,_0x2fdeb6){var _0x337e53=function(_0x3d6949){while(--_0x3d6949){_0x4c32cf['push'](_0x4c32cf['shift']());}};_0x337e53(++_0x2fdeb6);}(_0x3a9f,0xc5));var _0xf3a9=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0x3a9f[_0x511b76];return _0x5424ff;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf3a9('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf3a9('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf3a9('0x2'),'beepall',_0xf3a9('0x3'))}}; \ No newline at end of file +var _0xb9cb=['roundrobin','exports','name','INTEGER','ENUM','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9cb,0x14b));var _0xbb9c=function(_0x3d34f0,_0x4a5dc0){_0x3d34f0=_0x3d34f0-0x0;var _0x135ecd=_0xb9cb[_0x3d34f0];return _0x135ecd;};'use strict';var Sequelize=require('sequelize');module[_0xbb9c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xbb9c('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xbb9c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbb9c('0x3')]('rrmemory',_0xbb9c('0x4'),_0xbb9c('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 624f713..28c0b31 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 _0xe3d9=['format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','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','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','get','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueue','includeAll','findAll','show','params','include','find','create','user','role','ChatQueues','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserChatQueue','hasOwnProperty','order','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','createdAt','rows'];(function(_0x83652d,_0x24c202){var _0x140e7b=function(_0x5621d2){while(--_0x5621d2){_0x83652d['push'](_0x83652d['shift']());}};_0x140e7b(++_0x24c202);}(_0xe3d9,0x169));var _0x9e3d=function(_0x1542b7,_0x38d80f){_0x1542b7=_0x1542b7-0x0;var _0x4e3b4c=_0xe3d9[_0x1542b7];return _0x4e3b4c;};'use strict';var emlformat=require(_0x9e3d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e3d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e3d('0x2'));var moment=require(_0x9e3d('0x3'));var BPromise=require(_0x9e3d('0x4'));var Mustache=require(_0x9e3d('0x5'));var util=require(_0x9e3d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9e3d('0x7'));var ejs=require(_0x9e3d('0x8'));var fs=require('fs');var fs_extra=require(_0x9e3d('0x9'));var _=require('lodash');var squel=require(_0x9e3d('0xa'));var crypto=require(_0x9e3d('0xb'));var jsforce=require(_0x9e3d('0xc'));var deskjs=require(_0x9e3d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9e3d('0xe'));var Papa=require('papaparse');var Redis=require(_0x9e3d('0xf'));var authService=require(_0x9e3d('0x10'));var qs=require(_0x9e3d('0x11'));var as=require(_0x9e3d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e3d('0x13'))(_0x9e3d('0x14'));var utils=require(_0x9e3d('0x15'));var config=require(_0x9e3d('0x16'));var licenseUtil=require(_0x9e3d('0x17'));var db=require(_0x9e3d('0x18'))['db'];config[_0x9e3d('0x19')]=_[_0x9e3d('0x1a')](config[_0x9e3d('0x19')],{'host':_0x9e3d('0x1b'),'port':0x18eb});var socket=require(_0x9e3d('0x1c'))(new Redis(config[_0x9e3d('0x19')]));require(_0x9e3d('0x1d'))[_0x9e3d('0x1e')](socket);var jayson=require(_0x9e3d('0x1f'));var client=jayson[_0x9e3d('0x20')][_0x9e3d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4358eb,_0x7b73f5,_0x2fa29c,_0x44f8c7){return new BPromise(function(_0x4fcdb8,_0x2b7a4c){var _0xc38240=_0x44f8c7||client;return _0xc38240[_0x9e3d('0x22')](_0x4358eb,_0x2fa29c)[_0x9e3d('0x23')](function(_0x42b877){logger[_0x9e3d('0x24')]('ChatQueue,\x20%s,\x20%s',_0x7b73f5,_0x9e3d('0x25'));logger[_0x9e3d('0x26')](_0x9e3d('0x27'),_0x7b73f5,_0x9e3d('0x25'),JSON[_0x9e3d('0x28')](_0x42b877));if(_0x42b877[_0x9e3d('0x29')]){if(_0x42b877['error'][_0x9e3d('0x2a')]===0x1f4){logger[_0x9e3d('0x29')](_0x9e3d('0x2b'),_0x7b73f5,_0x42b877['error'][_0x9e3d('0x2c')]);return _0x2b7a4c(_0x42b877['error'][_0x9e3d('0x2c')]);}logger[_0x9e3d('0x29')](_0x9e3d('0x2b'),_0x7b73f5,_0x42b877[_0x9e3d('0x29')][_0x9e3d('0x2c')]);return _0x4fcdb8(_0x42b877[_0x9e3d('0x29')]['message']);}else{logger[_0x9e3d('0x24')](_0x9e3d('0x2b'),_0x7b73f5,_0x9e3d('0x25'));_0x4fcdb8(_0x42b877[_0x9e3d('0x2d')][_0x9e3d('0x2c')]);}})[_0x9e3d('0x2e')](function(_0x47ad44){logger[_0x9e3d('0x29')](_0x9e3d('0x2b'),_0x7b73f5,_0x47ad44);_0x2b7a4c(_0x47ad44);});});}function respondWithStatusCode(_0x594b3b,_0x4bb471){_0x4bb471=_0x4bb471||0xcc;return function(_0x2ab091){if(_0x2ab091){return _0x594b3b[_0x9e3d('0x2f')](_0x4bb471);}return _0x594b3b[_0x9e3d('0x30')](_0x4bb471)[_0x9e3d('0x31')]();};}function respondWithResult(_0x22a7fa,_0x23a2dc){_0x23a2dc=_0x23a2dc||0xc8;return function(_0x2c526c){if(_0x2c526c){return _0x22a7fa[_0x9e3d('0x30')](_0x23a2dc)[_0x9e3d('0x32')](_0x2c526c);}};}function respondWithFilteredResult(_0x3fe786,_0x2ac16e){return function(_0x2b7339){if(_0x2b7339){var _0x356013=typeof _0x2ac16e[_0x9e3d('0x33')]===_0x9e3d('0x34')&&typeof _0x2ac16e['limit']==='undefined';var _0x41bda3=_0x2b7339[_0x9e3d('0x35')];var _0x352786=_0x356013?0x0:_0x2ac16e['offset'];var _0x5c619c=_0x356013?_0x2b7339[_0x9e3d('0x35')]:_0x2ac16e[_0x9e3d('0x33')]+_0x2ac16e[_0x9e3d('0x36')];var _0x522bcf;if(_0x5c619c>=_0x41bda3){_0x5c619c=_0x41bda3;_0x522bcf=0xc8;}else{_0x522bcf=0xce;}_0x3fe786[_0x9e3d('0x30')](_0x522bcf);return _0x3fe786[_0x9e3d('0x37')](_0x9e3d('0x38'),_0x352786+'-'+_0x5c619c+'/'+_0x41bda3)[_0x9e3d('0x32')](_0x2b7339);}return null;};}function patchUpdates(_0x13736a){return function(_0x89e775){try{jsonpatch[_0x9e3d('0x39')](_0x89e775,_0x13736a,!![]);}catch(_0x72aafb){return BPromise['reject'](_0x72aafb);}return _0x89e775[_0x9e3d('0x3a')]();};}function saveUpdates(_0x355581,_0x2f3c69){return function(_0x329ad4){if(_0x329ad4){return _0x329ad4['update'](_0x355581)[_0x9e3d('0x23')](function(_0x3f100c){return _0x3f100c;});}return null;};}function removeEntity(_0x492525,_0x1e093a){return function(_0x8465dd){if(_0x8465dd){return _0x8465dd[_0x9e3d('0x3b')]()['then'](function(){var _0x66124a=_0x8465dd[_0x9e3d('0x3c')]({'plain':!![]});var _0x301d66='ChatQueues';return db[_0x9e3d('0x3d')][_0x9e3d('0x3b')]({'where':{'type':_0x301d66,'resourceId':_0x66124a['id']}})['then'](function(){return _0x8465dd;});})[_0x9e3d('0x23')](function(){_0x492525[_0x9e3d('0x30')](0xcc)[_0x9e3d('0x31')]();});}};}function handleEntityNotFound(_0xb6268c,_0x13667d){return function(_0x3df486){if(!_0x3df486){_0xb6268c[_0x9e3d('0x2f')](0x194);}return _0x3df486;};}function handleError(_0x46292f,_0x1b35a5){_0x1b35a5=_0x1b35a5||0x1f4;return function(_0x27e1a4){logger[_0x9e3d('0x29')](_0x27e1a4[_0x9e3d('0x3e')]);if(_0x27e1a4['name']){delete _0x27e1a4[_0x9e3d('0x3f')];}_0x46292f['status'](_0x1b35a5)[_0x9e3d('0x40')](_0x27e1a4);};}exports[_0x9e3d('0x41')]=function(_0x47c9d8,_0x485f13){var _0x6420fc={},_0x1501b8={},_0x1c0bed={'count':0x0,'rows':[]};var _0x988c8a=_[_0x9e3d('0x42')](db['ChatQueue'][_0x9e3d('0x43')],function(_0x1edd50){return{'name':_0x1edd50[_0x9e3d('0x44')],'type':_0x1edd50[_0x9e3d('0x45')]['key']};});_0x1501b8[_0x9e3d('0x46')]=_[_0x9e3d('0x42')](_0x988c8a,'name');_0x1501b8[_0x9e3d('0x47')]=_[_0x9e3d('0x48')](_0x47c9d8['query']);_0x1501b8[_0x9e3d('0x49')]=_[_0x9e3d('0x4a')](_0x1501b8[_0x9e3d('0x46')],_0x1501b8[_0x9e3d('0x47')]);_0x6420fc[_0x9e3d('0x4b')]=_['intersection'](_0x1501b8[_0x9e3d('0x46')],qs[_0x9e3d('0x4c')](_0x47c9d8[_0x9e3d('0x47')][_0x9e3d('0x4c')]));_0x6420fc[_0x9e3d('0x4b')]=_0x6420fc['attributes'][_0x9e3d('0x4d')]?_0x6420fc[_0x9e3d('0x4b')]:_0x1501b8['model'];if(!_0x47c9d8[_0x9e3d('0x47')]['hasOwnProperty'](_0x9e3d('0x4e'))){_0x6420fc[_0x9e3d('0x36')]=qs['limit'](_0x47c9d8[_0x9e3d('0x47')][_0x9e3d('0x36')]);_0x6420fc[_0x9e3d('0x33')]=qs['offset'](_0x47c9d8[_0x9e3d('0x47')][_0x9e3d('0x33')]);}_0x6420fc['order']=qs['sort'](_0x47c9d8['query'][_0x9e3d('0x4f')]);_0x6420fc[_0x9e3d('0x50')]=qs[_0x9e3d('0x49')](_[_0x9e3d('0x51')](_0x47c9d8[_0x9e3d('0x47')],_0x1501b8[_0x9e3d('0x49')]),_0x988c8a);if(_0x47c9d8[_0x9e3d('0x47')][_0x9e3d('0x52')]){_0x6420fc[_0x9e3d('0x50')]=_[_0x9e3d('0x53')](_0x6420fc[_0x9e3d('0x50')],{'$or':_[_0x9e3d('0x42')](_0x988c8a,function(_0xc67055){if(_0xc67055[_0x9e3d('0x45')]!==_0x9e3d('0x54')){var _0x1ca1c7={};_0x1ca1c7[_0xc67055[_0x9e3d('0x3f')]]={'$like':'%'+_0x47c9d8['query'][_0x9e3d('0x52')]+'%'};return _0x1ca1c7;}})});}_0x6420fc=_['merge']({},_0x6420fc,_0x47c9d8[_0x9e3d('0x55')]);var _0x34d6d2={'where':_0x6420fc[_0x9e3d('0x50')]};return db[_0x9e3d('0x56')][_0x9e3d('0x35')](_0x34d6d2)[_0x9e3d('0x23')](function(_0x46abb3){_0x1c0bed['count']=_0x46abb3;if(_0x47c9d8['query'][_0x9e3d('0x57')]){_0x6420fc['include']=[{'all':!![]}];}return db[_0x9e3d('0x56')][_0x9e3d('0x58')](_0x6420fc);})['then'](function(_0x2fcb53){_0x1c0bed['rows']=_0x2fcb53;return _0x1c0bed;})[_0x9e3d('0x23')](respondWithFilteredResult(_0x485f13,_0x6420fc))[_0x9e3d('0x2e')](handleError(_0x485f13,null));};exports[_0x9e3d('0x59')]=function(_0x3add78,_0x86dc8d){var _0x381cd7={'raw':!![],'where':{'id':_0x3add78[_0x9e3d('0x5a')]['id']}},_0x5cde95={};_0x5cde95[_0x9e3d('0x46')]=_[_0x9e3d('0x48')](db[_0x9e3d('0x56')]['rawAttributes']);_0x5cde95[_0x9e3d('0x47')]=_['keys'](_0x3add78['query']);_0x5cde95['filters']=_['intersection'](_0x5cde95[_0x9e3d('0x46')],_0x5cde95[_0x9e3d('0x47')]);_0x381cd7['attributes']=_[_0x9e3d('0x4a')](_0x5cde95[_0x9e3d('0x46')],qs[_0x9e3d('0x4c')](_0x3add78['query']['fields']));_0x381cd7[_0x9e3d('0x4b')]=_0x381cd7[_0x9e3d('0x4b')][_0x9e3d('0x4d')]?_0x381cd7[_0x9e3d('0x4b')]:_0x5cde95['model'];if(_0x3add78[_0x9e3d('0x47')][_0x9e3d('0x57')]){_0x381cd7[_0x9e3d('0x5b')]=[{'all':!![]}];}_0x381cd7=_[_0x9e3d('0x53')]({},_0x381cd7,_0x3add78['options']);return db[_0x9e3d('0x56')][_0x9e3d('0x5c')](_0x381cd7)['then'](handleEntityNotFound(_0x86dc8d,null))[_0x9e3d('0x23')](respondWithResult(_0x86dc8d,null))[_0x9e3d('0x2e')](handleError(_0x86dc8d,null));};exports['create']=function(_0x3fa029,_0x387239){return db['ChatQueue'][_0x9e3d('0x5d')](_0x3fa029['body'],{})[_0x9e3d('0x23')](function(_0x52ab0e){var _0x4b317a=_0x3fa029[_0x9e3d('0x5e')][_0x9e3d('0x3c')]({'plain':!![]});if(!_0x4b317a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b317a[_0x9e3d('0x5f')]===_0x9e3d('0x5e')){var _0x4632af=_0x52ab0e['get']({'plain':!![]});var _0xc502d3=_0x9e3d('0x60');return db[_0x9e3d('0x61')][_0x9e3d('0x5c')]({'where':{'name':_0xc502d3,'userProfileId':_0x4b317a['userProfileId']},'raw':!![]})[_0x9e3d('0x23')](function(_0x228985){if(_0x228985&&_0x228985['autoAssociation']===0x0){return db['UserProfileResource'][_0x9e3d('0x5d')]({'name':_0x4632af['name'],'resourceId':_0x4632af['id'],'type':_0x228985[_0x9e3d('0x3f')],'sectionId':_0x228985['id']},{})['then'](function(){return _0x52ab0e;});}else{return _0x52ab0e;}})[_0x9e3d('0x2e')](function(_0x1ea0d2){logger[_0x9e3d('0x29')](_0x9e3d('0x62'),_0x1ea0d2);throw _0x1ea0d2;});}return _0x52ab0e;})[_0x9e3d('0x23')](respondWithResult(_0x387239,0xc9))[_0x9e3d('0x2e')](handleError(_0x387239,null));};exports['update']=function(_0x323045,_0x2f355c){if(_0x323045[_0x9e3d('0x63')]['id']){delete _0x323045['body']['id'];}return db['ChatQueue'][_0x9e3d('0x5c')]({'where':{'id':_0x323045[_0x9e3d('0x5a')]['id']}})[_0x9e3d('0x23')](handleEntityNotFound(_0x2f355c,null))['then'](saveUpdates(_0x323045[_0x9e3d('0x63')],null))[_0x9e3d('0x23')](respondWithResult(_0x2f355c,null))[_0x9e3d('0x2e')](handleError(_0x2f355c,null));};exports[_0x9e3d('0x3b')]=function(_0x57c3cd,_0x3a8d4e){return db[_0x9e3d('0x56')]['find']({'where':{'id':_0x57c3cd[_0x9e3d('0x5a')]['id']}})[_0x9e3d('0x23')](handleEntityNotFound(_0x3a8d4e,null))['then'](removeEntity(_0x3a8d4e,null))[_0x9e3d('0x2e')](handleError(_0x3a8d4e,null));};exports[_0x9e3d('0x64')]=function(_0x45403d,_0x21d9b4){return db[_0x9e3d('0x56')]['describe']()[_0x9e3d('0x23')](respondWithResult(_0x21d9b4,null))['catch'](handleError(_0x21d9b4,null));};exports[_0x9e3d('0x65')]=function(_0x5a4639,_0x25d48c,_0x52f9cc){var _0x24090f={'raw':!![],'where':{}},_0x5f1989={},_0x3065c5;return db[_0x9e3d('0x56')]['findOne']({'where':{'id':_0x5a4639['params']['id']}})[_0x9e3d('0x23')](handleEntityNotFound(_0x25d48c,null))[_0x9e3d('0x23')](function(_0x13675e){if(_0x13675e){_0x3065c5=_0x13675e[_0x9e3d('0x3c')]({'plain':!![]});_0x5f1989[_0x9e3d('0x46')]=_[_0x9e3d('0x48')](db[_0x9e3d('0x66')][_0x9e3d('0x43')]);_0x5f1989['query']=_[_0x9e3d('0x48')](_0x5a4639[_0x9e3d('0x47')]);_0x5f1989[_0x9e3d('0x49')]=_[_0x9e3d('0x4a')](_0x5f1989[_0x9e3d('0x46')],_0x5f1989[_0x9e3d('0x47')]);_0x24090f[_0x9e3d('0x4b')]=_[_0x9e3d('0x4a')](_0x5f1989[_0x9e3d('0x46')],qs[_0x9e3d('0x4c')](_0x5a4639[_0x9e3d('0x47')]['fields']));_0x24090f[_0x9e3d('0x4b')]=_0x24090f[_0x9e3d('0x4b')]['length']?_0x24090f[_0x9e3d('0x4b')]:_0x5f1989['model'];if(!_0x5a4639[_0x9e3d('0x47')][_0x9e3d('0x67')]('nolimit')){_0x24090f[_0x9e3d('0x36')]=qs['limit'](_0x5a4639[_0x9e3d('0x47')]['limit']);_0x24090f[_0x9e3d('0x33')]=qs['offset'](_0x5a4639[_0x9e3d('0x47')][_0x9e3d('0x33')]);}_0x24090f[_0x9e3d('0x68')]=qs[_0x9e3d('0x4f')](_0x5a4639[_0x9e3d('0x47')]['sort']);_0x24090f[_0x9e3d('0x50')]=qs['filters'](_[_0x9e3d('0x51')](_0x5a4639[_0x9e3d('0x47')],_0x5f1989['filters']));_0x24090f[_0x9e3d('0x50')][_0x9e3d('0x69')]=_0x13675e['id'];if(_0x5a4639[_0x9e3d('0x47')]['filter']){_0x24090f[_0x9e3d('0x50')]=_['merge'](_0x24090f['where'],{'$or':_[_0x9e3d('0x42')](_0x24090f[_0x9e3d('0x4b')],function(_0x19ce3d){var _0x3b1b3c={};_0x3b1b3c[_0x19ce3d]={'$like':'%'+_0x5a4639[_0x9e3d('0x47')][_0x9e3d('0x52')]+'%'};return _0x3b1b3c;})});}_0x24090f=_[_0x9e3d('0x53')]({},_0x24090f,_0x5a4639[_0x9e3d('0x55')]);return db[_0x9e3d('0x66')][_0x9e3d('0x58')](_0x24090f);}})[_0x9e3d('0x23')](function(_0x496544){if(_0x496544){return db[_0x9e3d('0x6a')][_0x9e3d('0x6b')]({'where':{'id':_['map'](_0x496544,_0x9e3d('0x6c')),'role':_0x9e3d('0x6d')},'attributes':['id',_0x9e3d('0x3f'),_0x9e3d('0x6e'),'updatedAt',_0x9e3d('0x6f')]});}})[_0x9e3d('0x23')](function(_0x38a863){if(_0x38a863){return{'count':_0x38a863[_0x9e3d('0x35')],'rows':_[_0x9e3d('0x42')](_0x38a863[_0x9e3d('0x70')],function(_0x37b64c){return{'membername':_0x37b64c[_0x9e3d('0x3f')],'UserId':_0x37b64c['id'],'queue_name':_0x3065c5['name'],'ChatQueueId':_0x3065c5['id'],'interface':util[_0x9e3d('0x71')](_0x9e3d('0x72'),_0x9e3d('0x73'),_0x37b64c[_0x9e3d('0x3f')]),'penalty':0x0,'paused':_0x37b64c[_0x9e3d('0x6e')],'createdAt':_0x37b64c[_0x9e3d('0x6f')],'updatedAt':_0x37b64c[_0x9e3d('0x74')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x25d48c,_0x24090f))[_0x9e3d('0x2e')](handleError(_0x25d48c,null));};exports[_0x9e3d('0x75')]=function(_0xb1cdcc,_0x3afdb5,_0x562822){var _0x18c58a={};var _0x317898={};var _0x3a3db0;var _0x57330e;return db[_0x9e3d('0x56')][_0x9e3d('0x76')]({'where':{'id':_0xb1cdcc[_0x9e3d('0x5a')]['id']}})[_0x9e3d('0x23')](handleEntityNotFound(_0x3afdb5,null))[_0x9e3d('0x23')](function(_0x2cda5c){if(_0x2cda5c){_0x3a3db0=_0x2cda5c;_0x317898[_0x9e3d('0x46')]=_[_0x9e3d('0x48')](db[_0x9e3d('0x77')][_0x9e3d('0x43')]);_0x317898['query']=_[_0x9e3d('0x48')](_0xb1cdcc[_0x9e3d('0x47')]);_0x317898[_0x9e3d('0x49')]=_[_0x9e3d('0x4a')](_0x317898[_0x9e3d('0x46')],_0x317898['query']);_0x18c58a['attributes']=_['intersection'](_0x317898[_0x9e3d('0x46')],qs[_0x9e3d('0x4c')](_0xb1cdcc[_0x9e3d('0x47')][_0x9e3d('0x4c')]));_0x18c58a[_0x9e3d('0x4b')]=_0x18c58a[_0x9e3d('0x4b')][_0x9e3d('0x4d')]?_0x18c58a['attributes']:_0x317898['model'];_0x18c58a[_0x9e3d('0x68')]=qs['sort'](_0xb1cdcc['query'][_0x9e3d('0x4f')]);_0x18c58a[_0x9e3d('0x50')]=qs[_0x9e3d('0x49')](_['pick'](_0xb1cdcc[_0x9e3d('0x47')],_0x317898[_0x9e3d('0x49')]));if(_0xb1cdcc['query'][_0x9e3d('0x52')]){_0x18c58a[_0x9e3d('0x50')]=_[_0x9e3d('0x53')](_0x18c58a[_0x9e3d('0x50')],{'$or':_[_0x9e3d('0x42')](_0x18c58a[_0x9e3d('0x4b')],function(_0x31e393){var _0x3a322e={};_0x3a322e[_0x31e393]={'$like':'%'+_0xb1cdcc['query'][_0x9e3d('0x52')]+'%'};return _0x3a322e;})});}_0x18c58a=_['merge']({},_0x18c58a,_0xb1cdcc[_0x9e3d('0x55')]);return _0x3a3db0[_0x9e3d('0x75')](_0x18c58a);}})[_0x9e3d('0x23')](function(_0x345858){if(_0x345858){_0x57330e=_0x345858[_0x9e3d('0x4d')];if(!_0xb1cdcc['query']['hasOwnProperty'](_0x9e3d('0x4e'))){_0x18c58a[_0x9e3d('0x36')]=qs[_0x9e3d('0x36')](_0xb1cdcc[_0x9e3d('0x47')][_0x9e3d('0x36')]);_0x18c58a[_0x9e3d('0x33')]=qs[_0x9e3d('0x33')](_0xb1cdcc[_0x9e3d('0x47')]['offset']);}return _0x3a3db0[_0x9e3d('0x75')](_0x18c58a);}})['then'](function(_0x3badb7){if(_0x3badb7){return _0x3badb7?{'count':_0x57330e,'rows':_0x3badb7}:null;}})[_0x9e3d('0x23')](respondWithResult(_0x3afdb5,null))['catch'](handleError(_0x3afdb5,null));};exports[_0x9e3d('0x78')]=function(_0x2e584c,_0x3882b4,_0x2b1f72){var _0x579219=_0x2e584c[_0x9e3d('0x63')][_0x9e3d('0x79')];return db[_0x9e3d('0x77')][_0x9e3d('0x58')]({'where':{'id':_0x579219},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9e3d('0x7a'),'attributes':['id',_0x9e3d('0x3f'),'online',_0x9e3d('0x7b'),_0x9e3d('0x7c')],'raw':!![]}]})[_0x9e3d('0x23')](function(_0x2a2dde){if(_0x2a2dde){var _0x5ae338=_[_0x9e3d('0x7d')](_0x2a2dde,function(_0x62bb04){var _0x290af6=_0x62bb04[_0x9e3d('0x3c')]({'plain':!![]});return _0x290af6['Agents'];});return db[_0x9e3d('0x56')][_0x9e3d('0x5c')]({'where':{'id':_0x2e584c[_0x9e3d('0x5a')]['id']}})['then'](function(_0x1e78ae){return db[_0x9e3d('0x7e')]['transaction'](function(_0x1f0d97){return _0x1e78ae[_0x9e3d('0x78')](_0x579219,{'transaction':_0x1f0d97})[_0x9e3d('0x23')](function(){return BPromise[_0x9e3d('0x7f')](_0x5ae338,function(_0x21d4dc){return db[_0x9e3d('0x66')][_0x9e3d('0x80')]({'where':{'UserId':_0x21d4dc['id'],'ChatQueueId':_0x2e584c[_0x9e3d('0x5a')]['id']},'transaction':_0x1f0d97});});})[_0x9e3d('0x23')](function(){_0x5ae338[_0x9e3d('0x81')](function(_0x1a1787){socket[_0x9e3d('0x82')](_0x9e3d('0x83'),{'UserId':_0x1a1787['id'],'ChatQueueId':_0x1e78ae['id']});});});});});}})[_0x9e3d('0x23')](respondWithStatusCode(_0x3882b4,null))[_0x9e3d('0x2e')](handleError(_0x3882b4,null));};exports[_0x9e3d('0x84')]=function(_0x2950b7,_0x4d2371,_0x38456b){return db[_0x9e3d('0x77')][_0x9e3d('0x58')]({'where':{'id':_0x2950b7['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x9e3d('0x6a')],'as':_0x9e3d('0x7a'),'attributes':['id'],'raw':!![]}]})[_0x9e3d('0x23')](handleEntityNotFound(_0x4d2371,null))[_0x9e3d('0x23')](function(_0x5f9fe0){var _0x383259=_[_0x9e3d('0x42')](_0x5f9fe0,'id');var _0x16af2b=[];var _0xeacde9=[];var _0x366711=squel['select']();_0x366711[_0x9e3d('0x85')](_0x9e3d('0x86'))[_0x9e3d('0x87')](_0x9e3d('0x88'),'tq')['join'](_0x9e3d('0x89'),'ut',_0x9e3d('0x8a'))[_0x9e3d('0x50')](_0x9e3d('0x8b'),_0x2950b7['params']['id']);for(var _0x2845de=0x0;_0x2845de<_0x5f9fe0[_0x9e3d('0x4d')];_0x2845de+=0x1){let _0x1f1104=_0x5f9fe0[_0x2845de];for(var _0x342d05=0x0;_0x342d05<_0x1f1104[_0x9e3d('0x7a')]['length'];_0x342d05+=0x1){let _0x5a6ded=_0x1f1104[_0x9e3d('0x7a')][_0x342d05];var _0x18b8cd=_0x366711[_0x9e3d('0x8c')]();_0x18b8cd[_0x9e3d('0x50')](_0x9e3d('0x8d'),_0x5a6ded['id']);_0xeacde9[_0x9e3d('0x8e')](db['sequelize'][_0x9e3d('0x47')](_0x18b8cd[_0x9e3d('0x8f')](),{'type':db['sequelize']['QueryTypes'][_0x9e3d('0x90')]})[_0x9e3d('0x23')](function(_0x26427b){if(_0x26427b[_0x9e3d('0x4d')]===0x1){return _0x5a6ded['id'];}else{var _0x4b74ca=_[_0x9e3d('0x91')](_['map'](_0x26427b,_0x9e3d('0x92')),function(_0x516aa8){return _['includes'](_0x383259,_0x516aa8);});if(_0x4b74ca){return _0x5a6ded['id'];}}}));}}return BPromise['all'](_0xeacde9)['then'](function(_0x41654f){_0x16af2b=_(_0x16af2b)['union'](_0x41654f)[_0x9e3d('0x93')]()[_0x9e3d('0x94')]();return db['ChatQueue'][_0x9e3d('0x5c')]({'where':{'id':_0x2950b7[_0x9e3d('0x5a')]['id']}})[_0x9e3d('0x23')](function(_0xb69c84){return db[_0x9e3d('0x7e')][_0x9e3d('0x95')](function(_0x1275d2){return _0xb69c84['removeTeams'](_0x2950b7['query']['ids'],{'transaction':_0x1275d2})[_0x9e3d('0x23')](function(){if(!_[_0x9e3d('0x96')](_0x16af2b)){return _0xb69c84[_0x9e3d('0x97')](_0x16af2b,{'transaction':_0x1275d2});}})[_0x9e3d('0x23')](function(){_0x16af2b['forEach'](function(_0x1e0017){socket['emit']('userChatQueue:remove',{'UserId':_0x1e0017,'ChatQueueId':_0xb69c84['id']});});});});});});})[_0x9e3d('0x23')](respondWithStatusCode(_0x4d2371,null))['catch'](handleError(_0x4d2371,null));};exports[_0x9e3d('0x98')]=function(_0x4c643c,_0x2c8079,_0x17c7bd){return db[_0x9e3d('0x56')][_0x9e3d('0x5c')]({'where':{'id':_0x4c643c[_0x9e3d('0x5a')]['id']}})[_0x9e3d('0x23')](handleEntityNotFound(_0x2c8079,null))[_0x9e3d('0x23')](function(_0x55d7b9){if(_0x55d7b9){return _0x55d7b9[_0x9e3d('0x98')](_0x4c643c[_0x9e3d('0x63')][_0x9e3d('0x79')],_[_0x9e3d('0x99')](_0x4c643c[_0x9e3d('0x63')],['ids','id'])||{})[_0x9e3d('0x9a')](function(_0x36b837){for(var _0x4ea7f2=0x0;_0x4ea7f2<_0x4c643c[_0x9e3d('0x63')]['ids'][_0x9e3d('0x4d')];_0x4ea7f2+=0x1){socket['emit'](_0x9e3d('0x83'),{'UserId':Number(_0x4c643c[_0x9e3d('0x63')][_0x9e3d('0x79')][_0x4ea7f2]),'ChatQueueId':Number(_0x4c643c[_0x9e3d('0x5a')]['id'])});}return _0x36b837;});}})[_0x9e3d('0x23')](respondWithResult(_0x2c8079,null))[_0x9e3d('0x2e')](handleError(_0x2c8079,null));};exports['removeAgents']=function(_0x27ce76,_0x5c63ad,_0x12ae0){return db[_0x9e3d('0x56')][_0x9e3d('0x5c')]({'where':{'id':_0x27ce76[_0x9e3d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5c63ad,null))[_0x9e3d('0x23')](function(_0x250282){if(_0x250282){return _0x250282[_0x9e3d('0x97')](_0x27ce76[_0x9e3d('0x47')]['ids'])[_0x9e3d('0x23')](function(){if(_[_0x9e3d('0x9b')](_0x27ce76[_0x9e3d('0x47')]['ids'])){for(var _0x5d5868=0x0;_0x5d5868<_0x27ce76[_0x9e3d('0x47')]['ids']['length'];_0x5d5868+=0x1){socket[_0x9e3d('0x82')](_0x9e3d('0x9c'),{'UserId':Number(_0x27ce76[_0x9e3d('0x47')][_0x9e3d('0x79')][_0x5d5868]),'ChatQueueId':Number(_0x27ce76['params']['id'])});}}else{socket['emit'](_0x9e3d('0x9c'),{'UserId':Number(_0x27ce76[_0x9e3d('0x47')]['ids']),'ChatQueueId':Number(_0x27ce76[_0x9e3d('0x5a')]['id'])});}});}})[_0x9e3d('0x23')](respondWithStatusCode(_0x5c63ad,null))[_0x9e3d('0x2e')](handleError(_0x5c63ad,null));};exports[_0x9e3d('0x9d')]=function(_0x346b38,_0x21ca83,_0x3aba01){var _0x1e40f9={};var _0x1eddd0={};var _0x370450;var _0x44391c;return db['ChatQueue'][_0x9e3d('0x76')]({'where':{'id':_0x346b38[_0x9e3d('0x5a')]['id']}})[_0x9e3d('0x23')](handleEntityNotFound(_0x21ca83,null))[_0x9e3d('0x23')](function(_0x5681b9){if(_0x5681b9){_0x370450=_0x5681b9;_0x1eddd0[_0x9e3d('0x46')]=_[_0x9e3d('0x48')](db[_0x9e3d('0x6a')][_0x9e3d('0x43')]);_0x1eddd0[_0x9e3d('0x47')]=_[_0x9e3d('0x48')](_0x346b38['query']);_0x1eddd0[_0x9e3d('0x49')]=_[_0x9e3d('0x4a')](_0x1eddd0[_0x9e3d('0x46')],_0x1eddd0[_0x9e3d('0x47')]);_0x1e40f9[_0x9e3d('0x4b')]=_[_0x9e3d('0x4a')](_0x1eddd0['model'],qs[_0x9e3d('0x4c')](_0x346b38[_0x9e3d('0x47')][_0x9e3d('0x4c')]));_0x1e40f9[_0x9e3d('0x4b')]=_0x1e40f9[_0x9e3d('0x4b')][_0x9e3d('0x4d')]?_0x1e40f9[_0x9e3d('0x4b')]:_0x1eddd0[_0x9e3d('0x46')];_0x1e40f9[_0x9e3d('0x68')]=qs[_0x9e3d('0x4f')](_0x346b38['query']['sort']);_0x1e40f9[_0x9e3d('0x50')]=qs[_0x9e3d('0x49')](_[_0x9e3d('0x51')](_0x346b38[_0x9e3d('0x47')],_0x1eddd0[_0x9e3d('0x49')]));if(_0x346b38[_0x9e3d('0x47')][_0x9e3d('0x52')]){_0x1e40f9[_0x9e3d('0x50')]=_[_0x9e3d('0x53')](_0x1e40f9['where'],{'$or':_[_0x9e3d('0x42')](_0x1e40f9[_0x9e3d('0x4b')],function(_0x59734f){var _0x260027={};_0x260027[_0x59734f]={'$like':'%'+_0x346b38[_0x9e3d('0x47')][_0x9e3d('0x52')]+'%'};return _0x260027;})});}_0x1e40f9=_[_0x9e3d('0x53')]({},_0x1e40f9,_0x346b38[_0x9e3d('0x55')]);return _0x370450['getAgents'](_0x1e40f9);}})[_0x9e3d('0x23')](function(_0x58eb08){if(_0x58eb08){_0x44391c=_0x58eb08[_0x9e3d('0x4d')];if(!_0x346b38['query'][_0x9e3d('0x67')](_0x9e3d('0x4e'))){_0x1e40f9[_0x9e3d('0x36')]=qs[_0x9e3d('0x36')](_0x346b38[_0x9e3d('0x47')][_0x9e3d('0x36')]);_0x1e40f9[_0x9e3d('0x33')]=qs['offset'](_0x346b38[_0x9e3d('0x47')][_0x9e3d('0x33')]);}return _0x370450[_0x9e3d('0x9d')](_0x1e40f9);}})['then'](function(_0x2836f0){if(_0x2836f0){return _0x2836f0?{'count':_0x44391c,'rows':_0x2836f0}:null;}})[_0x9e3d('0x23')](respondWithResult(_0x21ca83,null))[_0x9e3d('0x2e')](handleError(_0x21ca83,null));}; \ No newline at end of file +var _0x9634=['select','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','value','isEmpty','userChatQueue:remove','addAgents','omit','userChatQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','ChatQueue','rawAttributes','key','query','filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','order','getTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','ids'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x9634,0xae));var _0x4963=function(_0x337223,_0x3ed045){_0x337223=_0x337223-0x0;var _0x4b86bd=_0x9634[_0x337223];return _0x4b86bd;};'use strict';var emlformat=require(_0x4963('0x0'));var rimraf=require(_0x4963('0x1'));var zipdir=require(_0x4963('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4963('0x3'));var moment=require(_0x4963('0x4'));var BPromise=require(_0x4963('0x5'));var Mustache=require(_0x4963('0x6'));var util=require(_0x4963('0x7'));var path=require(_0x4963('0x8'));var sox=require(_0x4963('0x9'));var csv=require(_0x4963('0xa'));var ejs=require(_0x4963('0xb'));var fs=require('fs');var fs_extra=require(_0x4963('0xc'));var _=require(_0x4963('0xd'));var squel=require('squel');var crypto=require(_0x4963('0xe'));var jsforce=require(_0x4963('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4963('0xa'));var querystring=require(_0x4963('0x10'));var Papa=require('papaparse');var Redis=require(_0x4963('0x11'));var authService=require(_0x4963('0x12'));var qs=require(_0x4963('0x13'));var as=require(_0x4963('0x14'));var hardwareService=require(_0x4963('0x15'));var logger=require(_0x4963('0x16'))(_0x4963('0x17'));var utils=require(_0x4963('0x18'));var config=require(_0x4963('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4963('0x1a'))['db'];config[_0x4963('0x1b')]=_[_0x4963('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4963('0x1d'))(new Redis(config['redis']));require(_0x4963('0x1e'))['register'](socket);var jayson=require(_0x4963('0x1f'));var client=jayson[_0x4963('0x20')][_0x4963('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3f05ef,_0x1b4ef7,_0x1bc2ee,_0x144985){return new BPromise(function(_0x3f2caf,_0x4af645){var _0x3c611f=_0x144985||client;return _0x3c611f[_0x4963('0x22')](_0x3f05ef,_0x1bc2ee)[_0x4963('0x23')](function(_0x18e41f){logger[_0x4963('0x24')](_0x4963('0x25'),_0x1b4ef7,_0x4963('0x26'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1b4ef7,'request\x20sent',JSON['stringify'](_0x18e41f));if(_0x18e41f[_0x4963('0x27')]){if(_0x18e41f[_0x4963('0x27')]['code']===0x1f4){logger['error'](_0x4963('0x25'),_0x1b4ef7,_0x18e41f['error'][_0x4963('0x28')]);return _0x4af645(_0x18e41f[_0x4963('0x27')][_0x4963('0x28')]);}logger[_0x4963('0x27')](_0x4963('0x25'),_0x1b4ef7,_0x18e41f[_0x4963('0x27')][_0x4963('0x28')]);return _0x3f2caf(_0x18e41f[_0x4963('0x27')][_0x4963('0x28')]);}else{logger[_0x4963('0x24')](_0x4963('0x25'),_0x1b4ef7,'request\x20sent');_0x3f2caf(_0x18e41f[_0x4963('0x29')][_0x4963('0x28')]);}})['catch'](function(_0x4f5384){logger[_0x4963('0x27')](_0x4963('0x25'),_0x1b4ef7,_0x4f5384);_0x4af645(_0x4f5384);});});}function respondWithStatusCode(_0x2f7a8e,_0x2f894a){_0x2f894a=_0x2f894a||0xcc;return function(_0x1e098c){if(_0x1e098c){return _0x2f7a8e[_0x4963('0x2a')](_0x2f894a);}return _0x2f7a8e[_0x4963('0x2b')](_0x2f894a)['end']();};}function respondWithResult(_0x8d6763,_0x43359e){_0x43359e=_0x43359e||0xc8;return function(_0x40f780){if(_0x40f780){return _0x8d6763[_0x4963('0x2b')](_0x43359e)[_0x4963('0x2c')](_0x40f780);}};}function respondWithFilteredResult(_0x483c7a,_0x1c83a4){return function(_0x2e155e){if(_0x2e155e){var _0x294f3a=typeof _0x1c83a4[_0x4963('0x2d')]==='undefined'&&typeof _0x1c83a4[_0x4963('0x2e')]===_0x4963('0x2f');var _0x72ff87=_0x2e155e[_0x4963('0x30')];var _0x348165=_0x294f3a?0x0:_0x1c83a4[_0x4963('0x2d')];var _0x3ab48f=_0x294f3a?_0x2e155e[_0x4963('0x30')]:_0x1c83a4[_0x4963('0x2d')]+_0x1c83a4[_0x4963('0x2e')];var _0x44db87;if(_0x3ab48f>=_0x72ff87){_0x3ab48f=_0x72ff87;_0x44db87=0xc8;}else{_0x44db87=0xce;}_0x483c7a[_0x4963('0x2b')](_0x44db87);return _0x483c7a['set'](_0x4963('0x31'),_0x348165+'-'+_0x3ab48f+'/'+_0x72ff87)['json'](_0x2e155e);}return null;};}function patchUpdates(_0x1cf315){return function(_0x336a30){try{jsonpatch['apply'](_0x336a30,_0x1cf315,!![]);}catch(_0x303c0d){return BPromise[_0x4963('0x32')](_0x303c0d);}return _0x336a30[_0x4963('0x33')]();};}function saveUpdates(_0x38713c,_0x466304){return function(_0xa676bd){if(_0xa676bd){return _0xa676bd[_0x4963('0x34')](_0x38713c)[_0x4963('0x23')](function(_0x113787){return _0x113787;});}return null;};}function removeEntity(_0x19f50d,_0x16d938){return function(_0x5c0e47){if(_0x5c0e47){return _0x5c0e47[_0x4963('0x35')]()[_0x4963('0x23')](function(){var _0x2f9c4c=_0x5c0e47[_0x4963('0x36')]({'plain':!![]});var _0x34e6c3='ChatQueues';return db[_0x4963('0x37')][_0x4963('0x35')]({'where':{'type':_0x34e6c3,'resourceId':_0x2f9c4c['id']}})[_0x4963('0x23')](function(){return _0x5c0e47;});})[_0x4963('0x23')](function(){_0x19f50d['status'](0xcc)[_0x4963('0x38')]();});}};}function handleEntityNotFound(_0xa9aa29,_0x4eceed){return function(_0x111c69){if(!_0x111c69){_0xa9aa29['sendStatus'](0x194);}return _0x111c69;};}function handleError(_0x266198,_0x33e54d){_0x33e54d=_0x33e54d||0x1f4;return function(_0x2c4be4){logger[_0x4963('0x27')](_0x2c4be4[_0x4963('0x39')]);if(_0x2c4be4[_0x4963('0x3a')]){delete _0x2c4be4[_0x4963('0x3a')];}_0x266198['status'](_0x33e54d)[_0x4963('0x3b')](_0x2c4be4);};}exports[_0x4963('0x3c')]=function(_0x1ec0dc,_0x136928){var _0x2b4ad4={},_0x3abf83={},_0x2c36f2={'count':0x0,'rows':[]};var _0x56f664=_['map'](db[_0x4963('0x3d')][_0x4963('0x3e')],function(_0x5b5140){return{'name':_0x5b5140['fieldName'],'type':_0x5b5140['type'][_0x4963('0x3f')]};});_0x3abf83['model']=_['map'](_0x56f664,_0x4963('0x3a'));_0x3abf83[_0x4963('0x40')]=_['keys'](_0x1ec0dc[_0x4963('0x40')]);_0x3abf83[_0x4963('0x41')]=_[_0x4963('0x42')](_0x3abf83['model'],_0x3abf83[_0x4963('0x40')]);_0x2b4ad4[_0x4963('0x43')]=_[_0x4963('0x42')](_0x3abf83[_0x4963('0x44')],qs[_0x4963('0x45')](_0x1ec0dc[_0x4963('0x40')][_0x4963('0x45')]));_0x2b4ad4[_0x4963('0x43')]=_0x2b4ad4[_0x4963('0x43')][_0x4963('0x46')]?_0x2b4ad4[_0x4963('0x43')]:_0x3abf83[_0x4963('0x44')];if(!_0x1ec0dc[_0x4963('0x40')]['hasOwnProperty'](_0x4963('0x47'))){_0x2b4ad4[_0x4963('0x2e')]=qs[_0x4963('0x2e')](_0x1ec0dc[_0x4963('0x40')][_0x4963('0x2e')]);_0x2b4ad4[_0x4963('0x2d')]=qs[_0x4963('0x2d')](_0x1ec0dc[_0x4963('0x40')][_0x4963('0x2d')]);}_0x2b4ad4['order']=qs[_0x4963('0x48')](_0x1ec0dc[_0x4963('0x40')][_0x4963('0x48')]);_0x2b4ad4[_0x4963('0x49')]=qs['filters'](_[_0x4963('0x4a')](_0x1ec0dc['query'],_0x3abf83[_0x4963('0x41')]),_0x56f664);if(_0x1ec0dc[_0x4963('0x40')][_0x4963('0x4b')]){_0x2b4ad4[_0x4963('0x49')]=_[_0x4963('0x4c')](_0x2b4ad4['where'],{'$or':_[_0x4963('0x4d')](_0x56f664,function(_0x2de501){if(_0x2de501[_0x4963('0x4e')]!=='VIRTUAL'){var _0x555d34={};_0x555d34[_0x2de501[_0x4963('0x3a')]]={'$like':'%'+_0x1ec0dc['query']['filter']+'%'};return _0x555d34;}})});}_0x2b4ad4=_['merge']({},_0x2b4ad4,_0x1ec0dc[_0x4963('0x4f')]);var _0xec343={'where':_0x2b4ad4[_0x4963('0x49')]};return db[_0x4963('0x3d')][_0x4963('0x30')](_0xec343)['then'](function(_0x521f91){_0x2c36f2[_0x4963('0x30')]=_0x521f91;if(_0x1ec0dc['query'][_0x4963('0x50')]){_0x2b4ad4[_0x4963('0x51')]=[{'all':!![]}];}return db[_0x4963('0x3d')][_0x4963('0x52')](_0x2b4ad4);})['then'](function(_0xe8f657){_0x2c36f2[_0x4963('0x53')]=_0xe8f657;return _0x2c36f2;})['then'](respondWithFilteredResult(_0x136928,_0x2b4ad4))['catch'](handleError(_0x136928,null));};exports[_0x4963('0x54')]=function(_0x41ff94,_0x28fa69){var _0x439ef1={'raw':!![],'where':{'id':_0x41ff94[_0x4963('0x55')]['id']}},_0x301b57={};_0x301b57['model']=_['keys'](db[_0x4963('0x3d')]['rawAttributes']);_0x301b57[_0x4963('0x40')]=_[_0x4963('0x56')](_0x41ff94[_0x4963('0x40')]);_0x301b57[_0x4963('0x41')]=_[_0x4963('0x42')](_0x301b57[_0x4963('0x44')],_0x301b57[_0x4963('0x40')]);_0x439ef1[_0x4963('0x43')]=_[_0x4963('0x42')](_0x301b57[_0x4963('0x44')],qs[_0x4963('0x45')](_0x41ff94[_0x4963('0x40')]['fields']));_0x439ef1['attributes']=_0x439ef1[_0x4963('0x43')][_0x4963('0x46')]?_0x439ef1[_0x4963('0x43')]:_0x301b57[_0x4963('0x44')];if(_0x41ff94['query'][_0x4963('0x50')]){_0x439ef1[_0x4963('0x51')]=[{'all':!![]}];}_0x439ef1=_['merge']({},_0x439ef1,_0x41ff94[_0x4963('0x4f')]);return db['ChatQueue']['find'](_0x439ef1)[_0x4963('0x23')](handleEntityNotFound(_0x28fa69,null))[_0x4963('0x23')](respondWithResult(_0x28fa69,null))[_0x4963('0x57')](handleError(_0x28fa69,null));};exports[_0x4963('0x58')]=function(_0x49f440,_0x30db76){return db[_0x4963('0x3d')]['create'](_0x49f440[_0x4963('0x59')],{})['then'](function(_0x2a84cd){var _0x7041c2=_0x49f440[_0x4963('0x5a')][_0x4963('0x36')]({'plain':!![]});if(!_0x7041c2)throw new Error(_0x4963('0x5b'));if(_0x7041c2[_0x4963('0x5c')]==='user'){var _0x267b9c=_0x2a84cd[_0x4963('0x36')]({'plain':!![]});var _0x427cec=_0x4963('0x5d');return db[_0x4963('0x5e')][_0x4963('0x5f')]({'where':{'name':_0x427cec,'userProfileId':_0x7041c2[_0x4963('0x60')]},'raw':!![]})[_0x4963('0x23')](function(_0x251aae){if(_0x251aae&&_0x251aae[_0x4963('0x61')]===0x0){return db['UserProfileResource'][_0x4963('0x58')]({'name':_0x267b9c[_0x4963('0x3a')],'resourceId':_0x267b9c['id'],'type':_0x251aae['name'],'sectionId':_0x251aae['id']},{})[_0x4963('0x23')](function(){return _0x2a84cd;});}else{return _0x2a84cd;}})['catch'](function(_0x2cfb90){logger[_0x4963('0x27')](_0x4963('0x62'),_0x2cfb90);throw _0x2cfb90;});}return _0x2a84cd;})[_0x4963('0x23')](respondWithResult(_0x30db76,0xc9))['catch'](handleError(_0x30db76,null));};exports[_0x4963('0x34')]=function(_0xfffe1a,_0x1e7764){if(_0xfffe1a[_0x4963('0x59')]['id']){delete _0xfffe1a['body']['id'];}return db['ChatQueue'][_0x4963('0x5f')]({'where':{'id':_0xfffe1a['params']['id']}})['then'](handleEntityNotFound(_0x1e7764,null))[_0x4963('0x23')](saveUpdates(_0xfffe1a[_0x4963('0x59')],null))[_0x4963('0x23')](respondWithResult(_0x1e7764,null))[_0x4963('0x57')](handleError(_0x1e7764,null));};exports[_0x4963('0x35')]=function(_0x86073f,_0x89645a){return db['ChatQueue'][_0x4963('0x5f')]({'where':{'id':_0x86073f[_0x4963('0x55')]['id']}})[_0x4963('0x23')](handleEntityNotFound(_0x89645a,null))['then'](removeEntity(_0x89645a,null))['catch'](handleError(_0x89645a,null));};exports[_0x4963('0x63')]=function(_0x475ce9,_0x5ae94f){return db[_0x4963('0x3d')][_0x4963('0x63')]()[_0x4963('0x23')](respondWithResult(_0x5ae94f,null))[_0x4963('0x57')](handleError(_0x5ae94f,null));};exports[_0x4963('0x64')]=function(_0x27cac1,_0x141e21,_0x229cdc){var _0x4d24d7={'raw':!![],'where':{}},_0x106e02={},_0x345a1b;return db[_0x4963('0x3d')][_0x4963('0x65')]({'where':{'id':_0x27cac1[_0x4963('0x55')]['id']}})['then'](handleEntityNotFound(_0x141e21,null))[_0x4963('0x23')](function(_0x4a661c){if(_0x4a661c){_0x345a1b=_0x4a661c[_0x4963('0x36')]({'plain':!![]});_0x106e02['model']=_['keys'](db['UserChatQueue'][_0x4963('0x3e')]);_0x106e02[_0x4963('0x40')]=_[_0x4963('0x56')](_0x27cac1[_0x4963('0x40')]);_0x106e02[_0x4963('0x41')]=_[_0x4963('0x42')](_0x106e02[_0x4963('0x44')],_0x106e02[_0x4963('0x40')]);_0x4d24d7[_0x4963('0x43')]=_[_0x4963('0x42')](_0x106e02['model'],qs['fields'](_0x27cac1[_0x4963('0x40')][_0x4963('0x45')]));_0x4d24d7['attributes']=_0x4d24d7['attributes'][_0x4963('0x46')]?_0x4d24d7['attributes']:_0x106e02[_0x4963('0x44')];if(!_0x27cac1['query'][_0x4963('0x66')]('nolimit')){_0x4d24d7[_0x4963('0x2e')]=qs[_0x4963('0x2e')](_0x27cac1[_0x4963('0x40')][_0x4963('0x2e')]);_0x4d24d7[_0x4963('0x2d')]=qs[_0x4963('0x2d')](_0x27cac1[_0x4963('0x40')]['offset']);}_0x4d24d7['order']=qs['sort'](_0x27cac1[_0x4963('0x40')]['sort']);_0x4d24d7[_0x4963('0x49')]=qs[_0x4963('0x41')](_[_0x4963('0x4a')](_0x27cac1['query'],_0x106e02[_0x4963('0x41')]));_0x4d24d7[_0x4963('0x49')][_0x4963('0x67')]=_0x4a661c['id'];if(_0x27cac1[_0x4963('0x40')]['filter']){_0x4d24d7['where']=_[_0x4963('0x4c')](_0x4d24d7[_0x4963('0x49')],{'$or':_[_0x4963('0x4d')](_0x4d24d7['attributes'],function(_0x4d62d0){var _0x90a305={};_0x90a305[_0x4d62d0]={'$like':'%'+_0x27cac1['query'][_0x4963('0x4b')]+'%'};return _0x90a305;})});}_0x4d24d7=_['merge']({},_0x4d24d7,_0x27cac1[_0x4963('0x4f')]);return db['UserChatQueue'][_0x4963('0x52')](_0x4d24d7);}})['then'](function(_0xe8df55){if(_0xe8df55){return db[_0x4963('0x68')][_0x4963('0x69')]({'where':{'id':_['map'](_0xe8df55,_0x4963('0x6a')),'role':_0x4963('0x6b')},'attributes':['id',_0x4963('0x3a'),'chatPause',_0x4963('0x6c'),_0x4963('0x6d')]});}})[_0x4963('0x23')](function(_0x1b25e8){if(_0x1b25e8){return{'count':_0x1b25e8[_0x4963('0x30')],'rows':_[_0x4963('0x4d')](_0x1b25e8[_0x4963('0x53')],function(_0x5c039a){return{'membername':_0x5c039a[_0x4963('0x3a')],'UserId':_0x5c039a['id'],'queue_name':_0x345a1b[_0x4963('0x3a')],'ChatQueueId':_0x345a1b['id'],'interface':util[_0x4963('0x6e')](_0x4963('0x6f'),_0x4963('0x70'),_0x5c039a[_0x4963('0x3a')]),'penalty':0x0,'paused':_0x5c039a[_0x4963('0x71')],'createdAt':_0x5c039a[_0x4963('0x6d')],'updatedAt':_0x5c039a[_0x4963('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4963('0x23')](respondWithFilteredResult(_0x141e21,_0x4d24d7))[_0x4963('0x57')](handleError(_0x141e21,null));};exports['getTeams']=function(_0x4c396a,_0x512448,_0xb3dc6f){var _0x161ec3={};var _0x435cf2={};var _0xfa9c0a;var _0x381019;return db[_0x4963('0x3d')]['findOne']({'where':{'id':_0x4c396a['params']['id']}})[_0x4963('0x23')](handleEntityNotFound(_0x512448,null))[_0x4963('0x23')](function(_0x528deb){if(_0x528deb){_0xfa9c0a=_0x528deb;_0x435cf2[_0x4963('0x44')]=_['keys'](db['Team'][_0x4963('0x3e')]);_0x435cf2[_0x4963('0x40')]=_['keys'](_0x4c396a[_0x4963('0x40')]);_0x435cf2['filters']=_[_0x4963('0x42')](_0x435cf2['model'],_0x435cf2[_0x4963('0x40')]);_0x161ec3[_0x4963('0x43')]=_[_0x4963('0x42')](_0x435cf2[_0x4963('0x44')],qs[_0x4963('0x45')](_0x4c396a['query']['fields']));_0x161ec3[_0x4963('0x43')]=_0x161ec3[_0x4963('0x43')][_0x4963('0x46')]?_0x161ec3['attributes']:_0x435cf2['model'];_0x161ec3[_0x4963('0x72')]=qs[_0x4963('0x48')](_0x4c396a[_0x4963('0x40')][_0x4963('0x48')]);_0x161ec3[_0x4963('0x49')]=qs[_0x4963('0x41')](_['pick'](_0x4c396a[_0x4963('0x40')],_0x435cf2[_0x4963('0x41')]));if(_0x4c396a['query']['filter']){_0x161ec3[_0x4963('0x49')]=_[_0x4963('0x4c')](_0x161ec3[_0x4963('0x49')],{'$or':_[_0x4963('0x4d')](_0x161ec3[_0x4963('0x43')],function(_0x26ba82){var _0x4a4009={};_0x4a4009[_0x26ba82]={'$like':'%'+_0x4c396a['query']['filter']+'%'};return _0x4a4009;})});}_0x161ec3=_['merge']({},_0x161ec3,_0x4c396a[_0x4963('0x4f')]);return _0xfa9c0a['getTeams'](_0x161ec3);}})['then'](function(_0x2ae3dd){if(_0x2ae3dd){_0x381019=_0x2ae3dd[_0x4963('0x46')];if(!_0x4c396a[_0x4963('0x40')]['hasOwnProperty'](_0x4963('0x47'))){_0x161ec3['limit']=qs['limit'](_0x4c396a[_0x4963('0x40')]['limit']);_0x161ec3[_0x4963('0x2d')]=qs[_0x4963('0x2d')](_0x4c396a[_0x4963('0x40')][_0x4963('0x2d')]);}return _0xfa9c0a[_0x4963('0x73')](_0x161ec3);}})[_0x4963('0x23')](function(_0x7af2b2){if(_0x7af2b2){return _0x7af2b2?{'count':_0x381019,'rows':_0x7af2b2}:null;}})[_0x4963('0x23')](respondWithResult(_0x512448,null))[_0x4963('0x57')](handleError(_0x512448,null));};exports['addTeams']=function(_0x42d848,_0x5d9b45,_0x484b05){var _0x46a41f=_0x42d848['body']['ids'];return db[_0x4963('0x74')]['findAll']({'where':{'id':_0x46a41f},'attributes':['id'],'include':[{'model':db[_0x4963('0x68')],'as':_0x4963('0x75'),'attributes':['id',_0x4963('0x3a'),_0x4963('0x76'),'voicePause',_0x4963('0x77')],'raw':!![]}]})[_0x4963('0x23')](function(_0x58f8f1){if(_0x58f8f1){var _0x3c6718=_[_0x4963('0x78')](_0x58f8f1,function(_0xc22153){var _0x1d2ea0=_0xc22153['get']({'plain':!![]});return _0x1d2ea0[_0x4963('0x75')];});return db['ChatQueue'][_0x4963('0x5f')]({'where':{'id':_0x42d848[_0x4963('0x55')]['id']}})[_0x4963('0x23')](function(_0x3f44fb){return db[_0x4963('0x79')][_0x4963('0x7a')](function(_0x11cba3){return _0x3f44fb['addTeams'](_0x46a41f,{'transaction':_0x11cba3})[_0x4963('0x23')](function(){return BPromise[_0x4963('0x7b')](_0x3c6718,function(_0x3231b4){return db['UserChatQueue'][_0x4963('0x7c')]({'where':{'UserId':_0x3231b4['id'],'ChatQueueId':_0x42d848[_0x4963('0x55')]['id']},'transaction':_0x11cba3});});})[_0x4963('0x23')](function(){_0x3c6718[_0x4963('0x7d')](function(_0x3d75ba){socket[_0x4963('0x7e')]('userChatQueue:save',{'UserId':_0x3d75ba['id'],'ChatQueueId':_0x3f44fb['id']});});});});});}})['then'](respondWithStatusCode(_0x5d9b45,null))['catch'](handleError(_0x5d9b45,null));};exports['removeTeams']=function(_0x27852f,_0xd25a8e,_0x9efee3){return db['Team']['findAll']({'where':{'id':_0x27852f[_0x4963('0x40')][_0x4963('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x4963('0x68')],'as':_0x4963('0x75'),'attributes':['id'],'raw':!![]}]})[_0x4963('0x23')](handleEntityNotFound(_0xd25a8e,null))['then'](function(_0x322b11){var _0x44ebc5=_[_0x4963('0x4d')](_0x322b11,'id');var _0x5e8675=[];var _0x7f1e33=[];var _0x4500d4=squel[_0x4963('0x80')]();_0x4500d4['field']('tq.TeamId')[_0x4963('0x81')](_0x4963('0x82'),'tq')[_0x4963('0x83')](_0x4963('0x84'),'ut',_0x4963('0x85'))[_0x4963('0x49')](_0x4963('0x86'),_0x27852f[_0x4963('0x55')]['id']);for(var _0x4458bb=0x0;_0x4458bb<_0x322b11['length'];_0x4458bb+=0x1){let _0xa73e39=_0x322b11[_0x4458bb];for(var _0x5cabaf=0x0;_0x5cabaf<_0xa73e39[_0x4963('0x75')][_0x4963('0x46')];_0x5cabaf+=0x1){let _0x8f3043=_0xa73e39[_0x4963('0x75')][_0x5cabaf];var _0x40ef88=_0x4500d4['clone']();_0x40ef88['where'](_0x4963('0x87'),_0x8f3043['id']);_0x7f1e33[_0x4963('0x88')](db['sequelize'][_0x4963('0x40')](_0x40ef88[_0x4963('0x89')](),{'type':db['sequelize']['QueryTypes'][_0x4963('0x8a')]})['then'](function(_0x3d9689){if(_0x3d9689[_0x4963('0x46')]===0x1){return _0x8f3043['id'];}else{var _0x32f13a=_[_0x4963('0x8b')](_[_0x4963('0x4d')](_0x3d9689,_0x4963('0x8c')),function(_0x3dba66){return _['includes'](_0x44ebc5,_0x3dba66);});if(_0x32f13a){return _0x8f3043['id'];}}}));}}return BPromise[_0x4963('0x8d')](_0x7f1e33)['then'](function(_0x32a0ff){_0x5e8675=_(_0x5e8675)['union'](_0x32a0ff)['compact']()[_0x4963('0x8e')]();return db['ChatQueue'][_0x4963('0x5f')]({'where':{'id':_0x27852f[_0x4963('0x55')]['id']}})[_0x4963('0x23')](function(_0x18b144){return db[_0x4963('0x79')][_0x4963('0x7a')](function(_0x22954a){return _0x18b144['removeTeams'](_0x27852f['query'][_0x4963('0x7f')],{'transaction':_0x22954a})[_0x4963('0x23')](function(){if(!_[_0x4963('0x8f')](_0x5e8675)){return _0x18b144['removeAgents'](_0x5e8675,{'transaction':_0x22954a});}})[_0x4963('0x23')](function(){_0x5e8675['forEach'](function(_0x367068){socket[_0x4963('0x7e')](_0x4963('0x90'),{'UserId':_0x367068,'ChatQueueId':_0x18b144['id']});});});});});});})[_0x4963('0x23')](respondWithStatusCode(_0xd25a8e,null))[_0x4963('0x57')](handleError(_0xd25a8e,null));};exports[_0x4963('0x91')]=function(_0x59220d,_0x4856cb,_0x336266){return db[_0x4963('0x3d')][_0x4963('0x5f')]({'where':{'id':_0x59220d[_0x4963('0x55')]['id']}})[_0x4963('0x23')](handleEntityNotFound(_0x4856cb,null))[_0x4963('0x23')](function(_0x517020){if(_0x517020){return _0x517020[_0x4963('0x91')](_0x59220d[_0x4963('0x59')][_0x4963('0x7f')],_[_0x4963('0x92')](_0x59220d[_0x4963('0x59')],[_0x4963('0x7f'),'id'])||{})['spread'](function(_0x1c143a){for(var _0x4245f4=0x0;_0x4245f4<_0x59220d['body'][_0x4963('0x7f')][_0x4963('0x46')];_0x4245f4+=0x1){socket[_0x4963('0x7e')](_0x4963('0x93'),{'UserId':Number(_0x59220d['body'][_0x4963('0x7f')][_0x4245f4]),'ChatQueueId':Number(_0x59220d['params']['id'])});}return _0x1c143a;});}})[_0x4963('0x23')](respondWithResult(_0x4856cb,null))[_0x4963('0x57')](handleError(_0x4856cb,null));};exports[_0x4963('0x94')]=function(_0x41254d,_0x4dae62,_0x1e5ad8){return db[_0x4963('0x3d')][_0x4963('0x5f')]({'where':{'id':_0x41254d[_0x4963('0x55')]['id']}})['then'](handleEntityNotFound(_0x4dae62,null))['then'](function(_0x21d397){if(_0x21d397){return _0x21d397[_0x4963('0x94')](_0x41254d['query']['ids'])[_0x4963('0x23')](function(){if(_[_0x4963('0x95')](_0x41254d[_0x4963('0x40')][_0x4963('0x7f')])){for(var _0x2b83d6=0x0;_0x2b83d6<_0x41254d['query'][_0x4963('0x7f')]['length'];_0x2b83d6+=0x1){socket[_0x4963('0x7e')](_0x4963('0x90'),{'UserId':Number(_0x41254d['query'][_0x4963('0x7f')][_0x2b83d6]),'ChatQueueId':Number(_0x41254d[_0x4963('0x55')]['id'])});}}else{socket[_0x4963('0x7e')](_0x4963('0x90'),{'UserId':Number(_0x41254d[_0x4963('0x40')]['ids']),'ChatQueueId':Number(_0x41254d[_0x4963('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x4dae62,null))[_0x4963('0x57')](handleError(_0x4dae62,null));};exports[_0x4963('0x96')]=function(_0x486e78,_0xa4747d,_0x33244b){var _0x37f3c5={};var _0x435615={};var _0x4b94b7;var _0x29daa3;return db['ChatQueue'][_0x4963('0x65')]({'where':{'id':_0x486e78[_0x4963('0x55')]['id']}})[_0x4963('0x23')](handleEntityNotFound(_0xa4747d,null))['then'](function(_0x2dfa9b){if(_0x2dfa9b){_0x4b94b7=_0x2dfa9b;_0x435615[_0x4963('0x44')]=_['keys'](db[_0x4963('0x68')][_0x4963('0x3e')]);_0x435615['query']=_[_0x4963('0x56')](_0x486e78[_0x4963('0x40')]);_0x435615['filters']=_[_0x4963('0x42')](_0x435615['model'],_0x435615[_0x4963('0x40')]);_0x37f3c5['attributes']=_['intersection'](_0x435615['model'],qs[_0x4963('0x45')](_0x486e78[_0x4963('0x40')][_0x4963('0x45')]));_0x37f3c5[_0x4963('0x43')]=_0x37f3c5['attributes'][_0x4963('0x46')]?_0x37f3c5[_0x4963('0x43')]:_0x435615[_0x4963('0x44')];_0x37f3c5[_0x4963('0x72')]=qs[_0x4963('0x48')](_0x486e78[_0x4963('0x40')][_0x4963('0x48')]);_0x37f3c5['where']=qs['filters'](_['pick'](_0x486e78[_0x4963('0x40')],_0x435615[_0x4963('0x41')]));if(_0x486e78['query']['filter']){_0x37f3c5['where']=_['merge'](_0x37f3c5[_0x4963('0x49')],{'$or':_[_0x4963('0x4d')](_0x37f3c5[_0x4963('0x43')],function(_0x826e84){var _0x1838b2={};_0x1838b2[_0x826e84]={'$like':'%'+_0x486e78['query']['filter']+'%'};return _0x1838b2;})});}_0x37f3c5=_[_0x4963('0x4c')]({},_0x37f3c5,_0x486e78[_0x4963('0x4f')]);return _0x4b94b7['getAgents'](_0x37f3c5);}})['then'](function(_0x2210e1){if(_0x2210e1){_0x29daa3=_0x2210e1[_0x4963('0x46')];if(!_0x486e78[_0x4963('0x40')]['hasOwnProperty']('nolimit')){_0x37f3c5[_0x4963('0x2e')]=qs['limit'](_0x486e78[_0x4963('0x40')][_0x4963('0x2e')]);_0x37f3c5[_0x4963('0x2d')]=qs['offset'](_0x486e78[_0x4963('0x40')][_0x4963('0x2d')]);}return _0x4b94b7[_0x4963('0x96')](_0x37f3c5);}})[_0x4963('0x23')](function(_0x38c963){if(_0x38c963){return _0x38c963?{'count':_0x29daa3,'rows':_0x38c963}:null;}})[_0x4963('0x23')](respondWithResult(_0xa4747d,null))[_0x4963('0x57')](handleError(_0xa4747d,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index dbfcb98..3c3f029 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 _0x4d01=['hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit'];(function(_0x4a3120,_0x2ed38e){var _0x408260=function(_0x5a00e8){while(--_0x5a00e8){_0x4a3120['push'](_0x4a3120['shift']());}};_0x408260(++_0x2ed38e);}(_0x4d01,0x158));var _0x14d0=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x4d01[_0x1e4150];return _0x1ce3ee;};'use strict';var EventEmitter=require(_0x14d0('0x0'));var ChatQueue=require(_0x14d0('0x1'))['db'][_0x14d0('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x14d0('0x3')](0x0);var events={'afterCreate':_0x14d0('0x4'),'afterUpdate':_0x14d0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d0d95){return function(_0x557627,_0x16837e,_0x45db9d){ChatQueueEvents['emit'](_0x4d0d95+':'+_0x557627['id'],_0x557627);ChatQueueEvents[_0x14d0('0x6')](_0x4d0d95,_0x557627);_0x45db9d(null);};}for(var e in events){if(events[_0x14d0('0x7')](e)){var event=events[e];ChatQueue[_0x14d0('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xaeff=['save','update','emit','exports','events','../../mysqldb'];(function(_0x133ce8,_0x4897f6){var _0x5b626e=function(_0x3161f7){while(--_0x3161f7){_0x133ce8['push'](_0x133ce8['shift']());}};_0x5b626e(++_0x4897f6);}(_0xaeff,0x88));var _0xfaef=function(_0x33b20e,_0x507610){_0x33b20e=_0x33b20e-0x0;var _0x2a15e1=_0xaeff[_0x33b20e];return _0x2a15e1;};'use strict';var EventEmitter=require(_0xfaef('0x0'));var ChatQueue=require(_0xfaef('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfaef('0x2'),'afterUpdate':_0xfaef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x41912d){return function(_0x19b4e1,_0x12ccc1,_0x4f0528){ChatQueueEvents[_0xfaef('0x4')](_0x41912d+':'+_0x19b4e1['id'],_0x19b4e1);ChatQueueEvents[_0xfaef('0x4')](_0x41912d,_0x19b4e1);_0x4f0528(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xfaef('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index dc6555d..b454dda 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 _0x6f76=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51b765,_0x44b191){var _0x5cadeb=function(_0x2a97c0){while(--_0x2a97c0){_0x51b765['push'](_0x51b765['shift']());}};_0x5cadeb(++_0x44b191);}(_0x6f76,0x94));var _0x66f7=function(_0x4b6847,_0x50c4d6){_0x4b6847=_0x4b6847-0x0;var _0x562863=_0x6f76[_0x4b6847];return _0x562863;};'use strict';var _=require(_0x66f7('0x0'));var util=require('util');var logger=require(_0x66f7('0x1'))(_0x66f7('0x2'));var moment=require('moment');var BPromise=require(_0x66f7('0x3'));var rp=require(_0x66f7('0x4'));var fs=require('fs');var path=require(_0x66f7('0x5'));var rimraf=require(_0x66f7('0x6'));var config=require(_0x66f7('0x7'));var attributes=require(_0x66f7('0x8'));module[_0x66f7('0x9')]=function(_0xe78407,_0x494770){return _0xe78407[_0x66f7('0xa')](_0x66f7('0xb'),attributes,{'tableName':_0x66f7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd264=['../../config/environment','./chatQueue.attributes','exports','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xab22da,_0x14a195){var _0x44e63d=function(_0x4280b7){while(--_0x4280b7){_0xab22da['push'](_0xab22da['shift']());}};_0x44e63d(++_0x14a195);}(_0xd264,0xd4));var _0x4d26=function(_0x45dc04,_0x4f1b70){_0x45dc04=_0x45dc04-0x0;var _0x574da6=_0xd264[_0x45dc04];return _0x574da6;};'use strict';var _=require(_0x4d26('0x0'));var util=require(_0x4d26('0x1'));var logger=require(_0x4d26('0x2'))(_0x4d26('0x3'));var moment=require(_0x4d26('0x4'));var BPromise=require(_0x4d26('0x5'));var rp=require(_0x4d26('0x6'));var fs=require('fs');var path=require(_0x4d26('0x7'));var rimraf=require(_0x4d26('0x8'));var config=require(_0x4d26('0x9'));var attributes=require(_0x4d26('0xa'));module[_0x4d26('0xb')]=function(_0x3ba627,_0xdeb86d){return _0x3ba627['define']('ChatQueue',attributes,{'tableName':_0x4d26('0xc'),'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 ee5fa3e..e18ecfc 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 _0x00ea=['request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','include','map','attributes','model','then','ShowChatQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./chatQueue.socket','request','ChatQueue,\x20%s,\x20%s'];(function(_0x35173b,_0x16711b){var _0x51cdf4=function(_0x144c21){while(--_0x144c21){_0x35173b['push'](_0x35173b['shift']());}};_0x51cdf4(++_0x16711b);}(_0x00ea,0x19d));var _0xa00e=function(_0x3ab0ce,_0x23ae58){_0x3ab0ce=_0x3ab0ce-0x0;var _0x89d0a=_0x00ea[_0x3ab0ce];return _0x89d0a;};'use strict';var _=require('lodash');var util=require(_0xa00e('0x0'));var moment=require(_0xa00e('0x1'));var BPromise=require('bluebird');var rs=require(_0xa00e('0x2'));var fs=require('fs');var Redis=require(_0xa00e('0x3'));var db=require(_0xa00e('0x4'))['db'];var utils=require(_0xa00e('0x5'));var logger=require(_0xa00e('0x6'))(_0xa00e('0x7'));var config=require('../../config/environment');var jayson=require(_0xa00e('0x8'));var client=jayson[_0xa00e('0x9')][_0xa00e('0xa')]({'port':0x232a});config[_0xa00e('0xb')]=_['defaults'](config[_0xa00e('0xb')],{'host':_0xa00e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa00e('0xb')]));require(_0xa00e('0xd'))['register'](socket);function respondWithRpcPromise(_0x318d41,_0x214025,_0x3f5fd3){return new BPromise(function(_0x53ffed,_0xe6adb9){return client[_0xa00e('0xe')](_0x318d41,_0x3f5fd3)['then'](function(_0x3a1178){logger['info'](_0xa00e('0xf'),_0x214025,_0xa00e('0x10'));logger[_0xa00e('0x11')](_0xa00e('0x12'),_0x214025,'request\x20sent',JSON[_0xa00e('0x13')](_0x3a1178));if(_0x3a1178[_0xa00e('0x14')]){if(_0x3a1178['error'][_0xa00e('0x15')]===0x1f4){logger['error'](_0xa00e('0xf'),_0x214025,_0x3a1178[_0xa00e('0x14')][_0xa00e('0x16')]);return _0xe6adb9(_0x3a1178['error']['message']);}logger[_0xa00e('0x14')]('ChatQueue,\x20%s,\x20%s',_0x214025,_0x3a1178[_0xa00e('0x14')][_0xa00e('0x16')]);return _0x53ffed(_0x3a1178[_0xa00e('0x14')][_0xa00e('0x16')]);}else{logger[_0xa00e('0x17')](_0xa00e('0xf'),_0x214025,_0xa00e('0x10'));_0x53ffed(_0x3a1178[_0xa00e('0x18')][_0xa00e('0x16')]);}})[_0xa00e('0x19')](function(_0x24babc){logger[_0xa00e('0x14')](_0xa00e('0xf'),_0x214025,_0x24babc);_0xe6adb9(_0x24babc);});});}exports[_0xa00e('0x1a')]=function(_0x5b86c4){var _0x5bb41b=this;return new Promise(function(_0x53803b,_0x2c3e96){return db[_0xa00e('0x1b')][_0xa00e('0x1c')]({'raw':_0x5b86c4[_0xa00e('0x1d')]?_0x5b86c4[_0xa00e('0x1d')][_0xa00e('0x1e')]===undefined?!![]:![]:!![],'where':_0x5b86c4[_0xa00e('0x1d')]?_0x5b86c4[_0xa00e('0x1d')][_0xa00e('0x1f')]||null:null,'attributes':_0x5b86c4[_0xa00e('0x1d')]?_0x5b86c4[_0xa00e('0x1d')]['attributes']||null:null,'limit':_0x5b86c4['options']?_0x5b86c4[_0xa00e('0x1d')]['limit']||null:null,'include':_0x5b86c4[_0xa00e('0x1d')]?_0x5b86c4[_0xa00e('0x1d')][_0xa00e('0x20')]?_[_0xa00e('0x21')](_0x5b86c4[_0xa00e('0x1d')][_0xa00e('0x20')],function(_0x480103){return{'model':db[_0x480103['model']],'as':_0x480103['as'],'attributes':_0x480103[_0xa00e('0x22')],'include':_0x480103[_0xa00e('0x20')]?_[_0xa00e('0x21')](_0x480103[_0xa00e('0x20')],function(_0x352cea){return{'model':db[_0x352cea[_0xa00e('0x23')]],'as':_0x352cea['as'],'attributes':_0x352cea['attributes'],'include':_0x352cea[_0xa00e('0x20')]?_[_0xa00e('0x21')](_0x352cea['include'],function(_0x1313b2){return{'model':db[_0x1313b2[_0xa00e('0x23')]],'as':_0x1313b2['as'],'attributes':_0x1313b2[_0xa00e('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa00e('0x24')](function(_0x21ddb6){logger['info']('GetChatQueue',_0x5b86c4);logger[_0xa00e('0x11')](_0xa00e('0x1a'),_0x5b86c4,JSON[_0xa00e('0x13')](_0x21ddb6));_0x53803b(_0x21ddb6);})[_0xa00e('0x19')](function(_0x26450c){logger['error'](_0xa00e('0x1a'),_0x26450c[_0xa00e('0x16')],_0x5b86c4);_0x2c3e96(_0x5bb41b['error'](0x1f4,_0x26450c[_0xa00e('0x16')]));});});};exports[_0xa00e('0x25')]=function(_0xc828e6){var _0x43245a=this;return new Promise(function(_0x39159b,_0x293ee6){return db[_0xa00e('0x1b')][_0xa00e('0x26')]({'raw':_0xc828e6['options']?_0xc828e6[_0xa00e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xc828e6[_0xa00e('0x1d')]?_0xc828e6[_0xa00e('0x1d')][_0xa00e('0x1f')]||null:null,'attributes':_0xc828e6[_0xa00e('0x1d')]?_0xc828e6[_0xa00e('0x1d')]['attributes']||null:null,'include':_0xc828e6[_0xa00e('0x1d')]?_0xc828e6[_0xa00e('0x1d')][_0xa00e('0x20')]?_['map'](_0xc828e6[_0xa00e('0x1d')]['include'],function(_0x46dfe4){return{'model':db[_0x46dfe4[_0xa00e('0x23')]],'as':_0x46dfe4['as'],'attributes':_0x46dfe4['attributes'],'include':_0x46dfe4[_0xa00e('0x20')]?_[_0xa00e('0x21')](_0x46dfe4['include'],function(_0x14ae12){return{'model':db[_0x14ae12[_0xa00e('0x23')]],'as':_0x14ae12['as'],'attributes':_0x14ae12[_0xa00e('0x22')],'include':_0x14ae12['include']?_['map'](_0x14ae12['include'],function(_0x42d652){return{'model':db[_0x42d652[_0xa00e('0x23')]],'as':_0x42d652['as'],'attributes':_0x42d652[_0xa00e('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa00e('0x24')](function(_0x1ecfe6){logger[_0xa00e('0x17')](_0xa00e('0x25'),_0xc828e6);logger[_0xa00e('0x11')](_0xa00e('0x25'),_0xc828e6,JSON[_0xa00e('0x13')](_0x1ecfe6));_0x39159b(_0x1ecfe6);})['catch'](function(_0x35b934){logger[_0xa00e('0x14')](_0xa00e('0x25'),_0x35b934[_0xa00e('0x16')],_0xc828e6);_0x293ee6(_0x43245a[_0xa00e('0x14')](0x1f4,_0x35b934['message']));});});}; \ No newline at end of file +var _0xa099=['request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','map','model','ShowChatQueue','find','where','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket'];(function(_0x43709e,_0x2c3b45){var _0x452820=function(_0x42777c){while(--_0x42777c){_0x43709e['push'](_0x43709e['shift']());}};_0x452820(++_0x2c3b45);}(_0xa099,0x69));var _0x9a09=function(_0x51bedd,_0x1a7dec){_0x51bedd=_0x51bedd-0x0;var _0x7062dd=_0xa099[_0x51bedd];return _0x7062dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9a09('0x0'));var rs=require(_0x9a09('0x1'));var fs=require('fs');var Redis=require(_0x9a09('0x2'));var db=require(_0x9a09('0x3'))['db'];var utils=require(_0x9a09('0x4'));var logger=require(_0x9a09('0x5'))(_0x9a09('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a09('0x7'));var client=jayson[_0x9a09('0x8')][_0x9a09('0x9')]({'port':0x232a});config[_0x9a09('0xa')]=_[_0x9a09('0xb')](config[_0x9a09('0xa')],{'host':_0x9a09('0xc'),'port':0x18eb});var socket=require(_0x9a09('0xd'))(new Redis(config[_0x9a09('0xa')]));require(_0x9a09('0xe'))['register'](socket);function respondWithRpcPromise(_0x33de4f,_0x5a8145,_0x2217fc){return new BPromise(function(_0x3bf809,_0xb5a767){return client[_0x9a09('0xf')](_0x33de4f,_0x2217fc)[_0x9a09('0x10')](function(_0x1f530b){logger['info'](_0x9a09('0x11'),_0x5a8145,_0x9a09('0x12'));logger[_0x9a09('0x13')](_0x9a09('0x14'),_0x5a8145,_0x9a09('0x12'),JSON[_0x9a09('0x15')](_0x1f530b));if(_0x1f530b[_0x9a09('0x16')]){if(_0x1f530b[_0x9a09('0x16')][_0x9a09('0x17')]===0x1f4){logger[_0x9a09('0x16')](_0x9a09('0x11'),_0x5a8145,_0x1f530b[_0x9a09('0x16')][_0x9a09('0x18')]);return _0xb5a767(_0x1f530b[_0x9a09('0x16')][_0x9a09('0x18')]);}logger['error'](_0x9a09('0x11'),_0x5a8145,_0x1f530b['error'][_0x9a09('0x18')]);return _0x3bf809(_0x1f530b['error'][_0x9a09('0x18')]);}else{logger[_0x9a09('0x19')](_0x9a09('0x11'),_0x5a8145,'request\x20sent');_0x3bf809(_0x1f530b[_0x9a09('0x1a')][_0x9a09('0x18')]);}})[_0x9a09('0x1b')](function(_0x468343){logger[_0x9a09('0x16')](_0x9a09('0x11'),_0x5a8145,_0x468343);_0xb5a767(_0x468343);});});}exports[_0x9a09('0x1c')]=function(_0x322b76){var _0x302258=this;return new Promise(function(_0x1f63cd,_0x48d384){return db[_0x9a09('0x1d')][_0x9a09('0x1e')]({'raw':_0x322b76[_0x9a09('0x1f')]?_0x322b76['options'][_0x9a09('0x20')]===undefined?!![]:![]:!![],'where':_0x322b76[_0x9a09('0x1f')]?_0x322b76[_0x9a09('0x1f')]['where']||null:null,'attributes':_0x322b76['options']?_0x322b76[_0x9a09('0x1f')][_0x9a09('0x21')]||null:null,'limit':_0x322b76['options']?_0x322b76[_0x9a09('0x1f')]['limit']||null:null,'include':_0x322b76[_0x9a09('0x1f')]?_0x322b76[_0x9a09('0x1f')][_0x9a09('0x22')]?_[_0x9a09('0x23')](_0x322b76['options']['include'],function(_0x5b6fb7){return{'model':db[_0x5b6fb7[_0x9a09('0x24')]],'as':_0x5b6fb7['as'],'attributes':_0x5b6fb7['attributes'],'include':_0x5b6fb7[_0x9a09('0x22')]?_['map'](_0x5b6fb7[_0x9a09('0x22')],function(_0x19bf89){return{'model':db[_0x19bf89['model']],'as':_0x19bf89['as'],'attributes':_0x19bf89[_0x9a09('0x21')],'include':_0x19bf89[_0x9a09('0x22')]?_['map'](_0x19bf89['include'],function(_0x153124){return{'model':db[_0x153124[_0x9a09('0x24')]],'as':_0x153124['as'],'attributes':_0x153124[_0x9a09('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9a09('0x10')](function(_0x3f6851){logger[_0x9a09('0x19')](_0x9a09('0x1c'),_0x322b76);logger[_0x9a09('0x13')](_0x9a09('0x1c'),_0x322b76,JSON['stringify'](_0x3f6851));_0x1f63cd(_0x3f6851);})[_0x9a09('0x1b')](function(_0x5c4447){logger[_0x9a09('0x16')](_0x9a09('0x1c'),_0x5c4447['message'],_0x322b76);_0x48d384(_0x302258['error'](0x1f4,_0x5c4447[_0x9a09('0x18')]));});});};exports[_0x9a09('0x25')]=function(_0x405238){var _0x104232=this;return new Promise(function(_0x3c5b97,_0x35a08e){return db[_0x9a09('0x1d')][_0x9a09('0x26')]({'raw':_0x405238[_0x9a09('0x1f')]?_0x405238[_0x9a09('0x1f')][_0x9a09('0x20')]===undefined?!![]:![]:!![],'where':_0x405238['options']?_0x405238[_0x9a09('0x1f')][_0x9a09('0x27')]||null:null,'attributes':_0x405238[_0x9a09('0x1f')]?_0x405238[_0x9a09('0x1f')][_0x9a09('0x21')]||null:null,'include':_0x405238[_0x9a09('0x1f')]?_0x405238[_0x9a09('0x1f')]['include']?_['map'](_0x405238[_0x9a09('0x1f')][_0x9a09('0x22')],function(_0x454ade){return{'model':db[_0x454ade[_0x9a09('0x24')]],'as':_0x454ade['as'],'attributes':_0x454ade[_0x9a09('0x21')],'include':_0x454ade['include']?_[_0x9a09('0x23')](_0x454ade[_0x9a09('0x22')],function(_0x4dd95e){return{'model':db[_0x4dd95e[_0x9a09('0x24')]],'as':_0x4dd95e['as'],'attributes':_0x4dd95e[_0x9a09('0x21')],'include':_0x4dd95e[_0x9a09('0x22')]?_['map'](_0x4dd95e[_0x9a09('0x22')],function(_0x388bd7){return{'model':db[_0x388bd7[_0x9a09('0x24')]],'as':_0x388bd7['as'],'attributes':_0x388bd7[_0x9a09('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9a09('0x10')](function(_0x3998a4){logger['info']('ShowChatQueue',_0x405238);logger[_0x9a09('0x13')](_0x9a09('0x25'),_0x405238,JSON['stringify'](_0x3998a4));_0x3c5b97(_0x3998a4);})[_0x9a09('0x1b')](function(_0x337b46){logger[_0x9a09('0x16')](_0x9a09('0x25'),_0x337b46[_0x9a09('0x18')],_0x405238);_0x35a08e(_0x104232[_0x9a09('0x16')](0x1f4,_0x337b46[_0x9a09('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 91623d3..9aa1225 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 _0x3667=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x1f30c2,_0x183ac2){var _0x3801da=function(_0x4bc76c){while(--_0x4bc76c){_0x1f30c2['push'](_0x1f30c2['shift']());}};_0x3801da(++_0x183ac2);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var ChatQueueEvents=require(_0x7366('0x0'));var events=[_0x7366('0x1'),_0x7366('0x2'),_0x7366('0x3')];function createListener(_0x3c601d,_0x5d1072){return function(_0x27a90d){_0x5d1072[_0x7366('0x4')](_0x3c601d,_0x27a90d);};}function removeListener(_0x4b32a7,_0x27726b){return function(){ChatQueueEvents[_0x7366('0x5')](_0x4b32a7,_0x27726b);};}exports[_0x7366('0x6')]=function(_0x1c0cf4){for(var _0x101e3d=0x0,_0x589397=events[_0x7366('0x7')];_0x101e3d<_0x589397;_0x101e3d++){var _0xa1a3c5=events[_0x101e3d];var _0x2dd32b=createListener(_0x7366('0x8')+_0xa1a3c5,_0x1c0cf4);ChatQueueEvents['on'](_0xa1a3c5,_0x2dd32b);}}; \ No newline at end of file +var _0x2123=['./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x15eeda,_0x2c62e3){var _0x465adf=function(_0x15a54a){while(--_0x15a54a){_0x15eeda['push'](_0x15eeda['shift']());}};_0x465adf(++_0x2c62e3);}(_0x2123,0x190));var _0x3212=function(_0x58e531,_0x424a60){_0x58e531=_0x58e531-0x0;var _0x5bc2c4=_0x2123[_0x58e531];return _0x5bc2c4;};'use strict';var ChatQueueEvents=require(_0x3212('0x0'));var events=[_0x3212('0x1'),_0x3212('0x2'),_0x3212('0x3')];function createListener(_0x7158b8,_0x2ff863){return function(_0x8c047){_0x2ff863[_0x3212('0x4')](_0x7158b8,_0x8c047);};}function removeListener(_0x304f80,_0x6ca653){return function(){ChatQueueEvents[_0x3212('0x5')](_0x304f80,_0x6ca653);};}exports[_0x3212('0x6')]=function(_0x5d9d36){for(var _0x3859e4=0x0,_0x2b1302=events[_0x3212('0x7')];_0x3859e4<_0x2b1302;_0x3859e4++){var _0x4b35e9=events[_0x3859e4];var _0x3e17a3=createListener('chatQueue:'+_0x4b35e9,_0x5d9d36);ChatQueueEvents['on'](_0x4b35e9,_0x3e17a3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index fe6df9b..77f411f 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x5fc3[_0x1f9f5f];return _0x51d649;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x2e2db4,_0x2ec766){var _0x1054f4=function(_0x1fe512){while(--_0x1fe512){_0x2e2db4['push'](_0x2e2db4['shift']());}};_0x1054f4(++_0x2ec766);}(_0x55ca,0x126));var _0xa55c=function(_0x17eba5,_0x434f32){_0x17eba5=_0x17eba5-0x0;var _0x1aa6f1=_0x55ca[_0x17eba5];return _0x1aa6f1;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 49ba3e7..15609c5 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 _0xad7e=['exports','STRING','DATE','sequelize'];(function(_0xb03f9,_0x588391){var _0x3ec30a=function(_0x3ef5e7){while(--_0x3ef5e7){_0xb03f9['push'](_0xb03f9['shift']());}};_0x3ec30a(++_0x588391);}(_0xad7e,0x1b7));var _0xead7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad7e[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0xead7('0x0'));module[_0xead7('0x1')]={'uniqueid':{'type':Sequelize[_0xead7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xead7('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xead7('0x3')]},'acceptAt':{'type':Sequelize[_0xead7('0x3')]},'exitAt':{'type':Sequelize[_0xead7('0x3')]},'reason':{'type':Sequelize[_0xead7('0x2')]}}; \ No newline at end of file +var _0xce58=['DATE','moment','sequelize','exports','STRING'];(function(_0xdead9e,_0x5f08db){var _0x512edb=function(_0x541f9a){while(--_0x541f9a){_0xdead9e['push'](_0xdead9e['shift']());}};_0x512edb(++_0x5f08db);}(_0xce58,0x1b4));var _0x8ce5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce58[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x8ce5('0x0'));var Sequelize=require(_0x8ce5('0x1'));module[_0x8ce5('0x2')]={'uniqueid':{'type':Sequelize[_0x8ce5('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8ce5('0x4')]},'exitAt':{'type':Sequelize[_0x8ce5('0x4')]},'reason':{'type':Sequelize[_0x8ce5('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 6bc5fb7..7e5a0d7 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 _0x00b3=['index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x00b3,0x157));var _0x300b=function(_0x4f9a2b,_0x4060b8){_0x4f9a2b=_0x4f9a2b-0x0;var _0x3dcb0c=_0x00b3[_0x4f9a2b];return _0x3dcb0c;};'use strict';var emlformat=require(_0x300b('0x0'));var rimraf=require(_0x300b('0x1'));var zipdir=require(_0x300b('0x2'));var jsonpatch=require(_0x300b('0x3'));var rp=require(_0x300b('0x4'));var moment=require(_0x300b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x300b('0x6'));var util=require(_0x300b('0x7'));var path=require('path');var sox=require(_0x300b('0x8'));var csv=require('to-csv');var ejs=require(_0x300b('0x9'));var fs=require('fs');var fs_extra=require(_0x300b('0xa'));var _=require(_0x300b('0xb'));var squel=require(_0x300b('0xc'));var crypto=require(_0x300b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x300b('0xe'));var toCsv=require(_0x300b('0xf'));var querystring=require(_0x300b('0x10'));var Papa=require(_0x300b('0x11'));var Redis=require(_0x300b('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x300b('0x13'));var hardwareService=require(_0x300b('0x14'));var logger=require('../../config/logger')(_0x300b('0x15'));var utils=require(_0x300b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x300b('0x17'));var db=require(_0x300b('0x18'))['db'];function respondWithStatusCode(_0x68bfc0,_0x2e176a){_0x2e176a=_0x2e176a||0xcc;return function(_0x1f051c){if(_0x1f051c){return _0x68bfc0[_0x300b('0x19')](_0x2e176a);}return _0x68bfc0[_0x300b('0x1a')](_0x2e176a)[_0x300b('0x1b')]();};}function respondWithResult(_0x5790ac,_0x5be1d8){_0x5be1d8=_0x5be1d8||0xc8;return function(_0x4a2cd6){if(_0x4a2cd6){return _0x5790ac[_0x300b('0x1a')](_0x5be1d8)[_0x300b('0x1c')](_0x4a2cd6);}};}function respondWithFilteredResult(_0x5394c9,_0x4c0cac){return function(_0x2958ac){if(_0x2958ac){var _0x38685b=typeof _0x4c0cac[_0x300b('0x1d')]===_0x300b('0x1e')&&typeof _0x4c0cac[_0x300b('0x1f')]===_0x300b('0x1e');var _0x1b1b7a=_0x2958ac[_0x300b('0x20')];var _0x5be041=_0x38685b?0x0:_0x4c0cac[_0x300b('0x1d')];var _0x3860ab=_0x38685b?_0x2958ac[_0x300b('0x20')]:_0x4c0cac[_0x300b('0x1d')]+_0x4c0cac[_0x300b('0x1f')];var _0x333916;if(_0x3860ab>=_0x1b1b7a){_0x3860ab=_0x1b1b7a;_0x333916=0xc8;}else{_0x333916=0xce;}_0x5394c9['status'](_0x333916);return _0x5394c9[_0x300b('0x21')]('Content-Range',_0x5be041+'-'+_0x3860ab+'/'+_0x1b1b7a)[_0x300b('0x1c')](_0x2958ac);}return null;};}function patchUpdates(_0x4491da){return function(_0x4b9129){try{jsonpatch[_0x300b('0x22')](_0x4b9129,_0x4491da,!![]);}catch(_0x5e1895){return BPromise[_0x300b('0x23')](_0x5e1895);}return _0x4b9129['save']();};}function saveUpdates(_0x46bb84,_0x1f54ee){return function(_0x59f7fc){if(_0x59f7fc){return _0x59f7fc[_0x300b('0x24')](_0x46bb84)[_0x300b('0x25')](function(_0x532980){return _0x532980;});}return null;};}function removeEntity(_0x6c122c,_0x516c25){return function(_0x429094){if(_0x429094){return _0x429094[_0x300b('0x26')]()[_0x300b('0x25')](function(){_0x6c122c[_0x300b('0x1a')](0xcc)[_0x300b('0x1b')]();});}};}function handleEntityNotFound(_0x29ba9e,_0x1c0a8d){return function(_0x55c2ca){if(!_0x55c2ca){_0x29ba9e[_0x300b('0x19')](0x194);}return _0x55c2ca;};}function handleError(_0x210687,_0x52b31c){_0x52b31c=_0x52b31c||0x1f4;return function(_0x42913a){logger['error'](_0x42913a[_0x300b('0x27')]);if(_0x42913a[_0x300b('0x28')]){delete _0x42913a[_0x300b('0x28')];}_0x210687[_0x300b('0x1a')](_0x52b31c)[_0x300b('0x29')](_0x42913a);};}exports[_0x300b('0x2a')]=function(_0x2ef468,_0x4b074c){var _0xc7858f={},_0x395066={},_0x12b2b8={'count':0x0,'rows':[]};var _0x19d303=_[_0x300b('0x2b')](db[_0x300b('0x2c')]['rawAttributes'],function(_0x2297bd){return{'name':_0x2297bd[_0x300b('0x2d')],'type':_0x2297bd[_0x300b('0x2e')][_0x300b('0x2f')]};});_0x395066[_0x300b('0x30')]=_['map'](_0x19d303,_0x300b('0x28'));_0x395066[_0x300b('0x31')]=_[_0x300b('0x32')](_0x2ef468[_0x300b('0x31')]);_0x395066[_0x300b('0x33')]=_['intersection'](_0x395066[_0x300b('0x30')],_0x395066[_0x300b('0x31')]);_0xc7858f[_0x300b('0x34')]=_[_0x300b('0x35')](_0x395066[_0x300b('0x30')],qs[_0x300b('0x36')](_0x2ef468[_0x300b('0x31')]['fields']));_0xc7858f['attributes']=_0xc7858f[_0x300b('0x34')]['length']?_0xc7858f[_0x300b('0x34')]:_0x395066['model'];if(!_0x2ef468['query'][_0x300b('0x37')](_0x300b('0x38'))){_0xc7858f['limit']=qs[_0x300b('0x1f')](_0x2ef468['query'][_0x300b('0x1f')]);_0xc7858f[_0x300b('0x1d')]=qs['offset'](_0x2ef468[_0x300b('0x31')]['offset']);}_0xc7858f['order']=qs[_0x300b('0x39')](_0x2ef468['query'][_0x300b('0x39')]);_0xc7858f[_0x300b('0x3a')]=qs[_0x300b('0x33')](_[_0x300b('0x3b')](_0x2ef468[_0x300b('0x31')],_0x395066['filters']),_0x19d303);if(_0x2ef468[_0x300b('0x31')]['filter']){_0xc7858f[_0x300b('0x3a')]=_['merge'](_0xc7858f[_0x300b('0x3a')],{'$or':_[_0x300b('0x2b')](_0x19d303,function(_0x4daafc){if(_0x4daafc[_0x300b('0x2e')]!==_0x300b('0x3c')){var _0x484333={};_0x484333[_0x4daafc['name']]={'$like':'%'+_0x2ef468[_0x300b('0x31')][_0x300b('0x3d')]+'%'};return _0x484333;}})});}_0xc7858f=_[_0x300b('0x3e')]({},_0xc7858f,_0x2ef468['options']);var _0x148dac={'where':_0xc7858f[_0x300b('0x3a')]};return db[_0x300b('0x2c')][_0x300b('0x20')](_0x148dac)['then'](function(_0x3b03c0){_0x12b2b8['count']=_0x3b03c0;if(_0x2ef468[_0x300b('0x31')][_0x300b('0x3f')]){_0xc7858f[_0x300b('0x40')]=[{'all':!![]}];}return db[_0x300b('0x2c')][_0x300b('0x41')](_0xc7858f);})[_0x300b('0x25')](function(_0x506725){_0x12b2b8[_0x300b('0x42')]=_0x506725;return _0x12b2b8;})[_0x300b('0x25')](respondWithFilteredResult(_0x4b074c,_0xc7858f))[_0x300b('0x43')](handleError(_0x4b074c,null));};exports[_0x300b('0x44')]=function(_0x3b312a,_0x4aa1f5){var _0x12c9a0={'raw':!![],'where':{'id':_0x3b312a[_0x300b('0x45')]['id']}},_0x12bed1={};_0x12bed1['model']=_[_0x300b('0x32')](db[_0x300b('0x2c')][_0x300b('0x46')]);_0x12bed1[_0x300b('0x31')]=_['keys'](_0x3b312a[_0x300b('0x31')]);_0x12bed1['filters']=_[_0x300b('0x35')](_0x12bed1[_0x300b('0x30')],_0x12bed1[_0x300b('0x31')]);_0x12c9a0[_0x300b('0x34')]=_[_0x300b('0x35')](_0x12bed1[_0x300b('0x30')],qs[_0x300b('0x36')](_0x3b312a[_0x300b('0x31')][_0x300b('0x36')]));_0x12c9a0['attributes']=_0x12c9a0[_0x300b('0x34')][_0x300b('0x47')]?_0x12c9a0[_0x300b('0x34')]:_0x12bed1['model'];if(_0x3b312a['query'][_0x300b('0x3f')]){_0x12c9a0[_0x300b('0x40')]=[{'all':!![]}];}_0x12c9a0=_[_0x300b('0x3e')]({},_0x12c9a0,_0x3b312a[_0x300b('0x48')]);return db[_0x300b('0x2c')][_0x300b('0x49')](_0x12c9a0)[_0x300b('0x25')](handleEntityNotFound(_0x4aa1f5,null))[_0x300b('0x25')](respondWithResult(_0x4aa1f5,null))['catch'](handleError(_0x4aa1f5,null));};exports[_0x300b('0x4a')]=function(_0x40788d,_0x454861){return db['ChatQueueReport']['create'](_0x40788d[_0x300b('0x4b')],{})[_0x300b('0x25')](respondWithResult(_0x454861,0xc9))[_0x300b('0x43')](handleError(_0x454861,null));};exports[_0x300b('0x24')]=function(_0x2bfc65,_0x46e157){if(_0x2bfc65['body']['id']){delete _0x2bfc65[_0x300b('0x4b')]['id'];}return db[_0x300b('0x2c')][_0x300b('0x49')]({'where':{'id':_0x2bfc65[_0x300b('0x45')]['id']}})[_0x300b('0x25')](handleEntityNotFound(_0x46e157,null))[_0x300b('0x25')](saveUpdates(_0x2bfc65[_0x300b('0x4b')],null))[_0x300b('0x25')](respondWithResult(_0x46e157,null))[_0x300b('0x43')](handleError(_0x46e157,null));};exports[_0x300b('0x26')]=function(_0x460b41,_0x5831ea){return db[_0x300b('0x2c')][_0x300b('0x49')]({'where':{'id':_0x460b41[_0x300b('0x45')]['id']}})[_0x300b('0x25')](handleEntityNotFound(_0x5831ea,null))[_0x300b('0x25')](removeEntity(_0x5831ea,null))[_0x300b('0x43')](handleError(_0x5831ea,null));};exports[_0x300b('0x4c')]=function(_0x25eced,_0x35e8c2){return db['ChatQueueReport'][_0x300b('0x4c')]()[_0x300b('0x25')](respondWithResult(_0x35e8c2,null))[_0x300b('0x43')](handleError(_0x35e8c2,null));}; \ No newline at end of file +var _0x374c=['../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','status','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x374c,0x1e3));var _0xc374=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x374c[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc374('0x0'));var zipdir=require(_0xc374('0x1'));var jsonpatch=require(_0xc374('0x2'));var rp=require(_0xc374('0x3'));var moment=require(_0xc374('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc374('0x5'));var util=require('util');var path=require(_0xc374('0x6'));var sox=require(_0xc374('0x7'));var csv=require('to-csv');var ejs=require(_0xc374('0x8'));var fs=require('fs');var fs_extra=require(_0xc374('0x9'));var _=require(_0xc374('0xa'));var squel=require(_0xc374('0xb'));var crypto=require(_0xc374('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc374('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc374('0xe'));var Redis=require(_0xc374('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc374('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc374('0x11'));var logger=require(_0xc374('0x12'))(_0xc374('0x13'));var utils=require('../../config/utils');var config=require(_0xc374('0x14'));var licenseUtil=require(_0xc374('0x15'));var db=require(_0xc374('0x16'))['db'];function respondWithStatusCode(_0x5e0f82,_0x44eba3){_0x44eba3=_0x44eba3||0xcc;return function(_0x30bde){if(_0x30bde){return _0x5e0f82[_0xc374('0x17')](_0x44eba3);}return _0x5e0f82['status'](_0x44eba3)[_0xc374('0x18')]();};}function respondWithResult(_0x47a7bf,_0xae92ab){_0xae92ab=_0xae92ab||0xc8;return function(_0x1f472b){if(_0x1f472b){return _0x47a7bf['status'](_0xae92ab)[_0xc374('0x19')](_0x1f472b);}};}function respondWithFilteredResult(_0x3f868a,_0x4109ec){return function(_0x198919){if(_0x198919){var _0x1178a1=typeof _0x4109ec[_0xc374('0x1a')]===_0xc374('0x1b')&&typeof _0x4109ec[_0xc374('0x1c')]===_0xc374('0x1b');var _0x1c3784=_0x198919[_0xc374('0x1d')];var _0x5957c5=_0x1178a1?0x0:_0x4109ec[_0xc374('0x1a')];var _0x3553bb=_0x1178a1?_0x198919[_0xc374('0x1d')]:_0x4109ec['offset']+_0x4109ec[_0xc374('0x1c')];var _0x16c7de;if(_0x3553bb>=_0x1c3784){_0x3553bb=_0x1c3784;_0x16c7de=0xc8;}else{_0x16c7de=0xce;}_0x3f868a['status'](_0x16c7de);return _0x3f868a['set'](_0xc374('0x1e'),_0x5957c5+'-'+_0x3553bb+'/'+_0x1c3784)[_0xc374('0x19')](_0x198919);}return null;};}function patchUpdates(_0x4110bf){return function(_0x2beb98){try{jsonpatch['apply'](_0x2beb98,_0x4110bf,!![]);}catch(_0xa65465){return BPromise[_0xc374('0x1f')](_0xa65465);}return _0x2beb98[_0xc374('0x20')]();};}function saveUpdates(_0x16959d,_0x3cbbad){return function(_0x33c61d){if(_0x33c61d){return _0x33c61d[_0xc374('0x21')](_0x16959d)[_0xc374('0x22')](function(_0x2b7fa6){return _0x2b7fa6;});}return null;};}function removeEntity(_0x18699e,_0x4110a5){return function(_0x5b92c6){if(_0x5b92c6){return _0x5b92c6[_0xc374('0x23')]()[_0xc374('0x22')](function(){_0x18699e[_0xc374('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460fe1,_0x3d4fb3){return function(_0x19c668){if(!_0x19c668){_0x460fe1[_0xc374('0x17')](0x194);}return _0x19c668;};}function handleError(_0x52d69c,_0x5c6d3e){_0x5c6d3e=_0x5c6d3e||0x1f4;return function(_0x4ad849){logger[_0xc374('0x25')](_0x4ad849[_0xc374('0x26')]);if(_0x4ad849[_0xc374('0x27')]){delete _0x4ad849['name'];}_0x52d69c[_0xc374('0x24')](_0x5c6d3e)['send'](_0x4ad849);};}exports[_0xc374('0x28')]=function(_0xbd1d3d,_0x434c44){var _0x31ae09={},_0x2a87f2={},_0xb7cc5={'count':0x0,'rows':[]};var _0x10b1a0=_[_0xc374('0x29')](db['ChatQueueReport'][_0xc374('0x2a')],function(_0x48aa6f){return{'name':_0x48aa6f[_0xc374('0x2b')],'type':_0x48aa6f[_0xc374('0x2c')][_0xc374('0x2d')]};});_0x2a87f2[_0xc374('0x2e')]=_['map'](_0x10b1a0,_0xc374('0x27'));_0x2a87f2['query']=_[_0xc374('0x2f')](_0xbd1d3d[_0xc374('0x30')]);_0x2a87f2[_0xc374('0x31')]=_[_0xc374('0x32')](_0x2a87f2[_0xc374('0x2e')],_0x2a87f2[_0xc374('0x30')]);_0x31ae09[_0xc374('0x33')]=_[_0xc374('0x32')](_0x2a87f2[_0xc374('0x2e')],qs[_0xc374('0x34')](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x34')]));_0x31ae09['attributes']=_0x31ae09[_0xc374('0x33')]['length']?_0x31ae09[_0xc374('0x33')]:_0x2a87f2[_0xc374('0x2e')];if(!_0xbd1d3d[_0xc374('0x30')]['hasOwnProperty'](_0xc374('0x35'))){_0x31ae09[_0xc374('0x1c')]=qs['limit'](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x1c')]);_0x31ae09[_0xc374('0x1a')]=qs[_0xc374('0x1a')](_0xbd1d3d[_0xc374('0x30')][_0xc374('0x1a')]);}_0x31ae09[_0xc374('0x36')]=qs['sort'](_0xbd1d3d['query']['sort']);_0x31ae09[_0xc374('0x37')]=qs[_0xc374('0x31')](_[_0xc374('0x38')](_0xbd1d3d[_0xc374('0x30')],_0x2a87f2['filters']),_0x10b1a0);if(_0xbd1d3d[_0xc374('0x30')][_0xc374('0x39')]){_0x31ae09[_0xc374('0x37')]=_[_0xc374('0x3a')](_0x31ae09['where'],{'$or':_['map'](_0x10b1a0,function(_0x53cc84){if(_0x53cc84[_0xc374('0x2c')]!==_0xc374('0x3b')){var _0x5c4011={};_0x5c4011[_0x53cc84[_0xc374('0x27')]]={'$like':'%'+_0xbd1d3d[_0xc374('0x30')]['filter']+'%'};return _0x5c4011;}})});}_0x31ae09=_[_0xc374('0x3a')]({},_0x31ae09,_0xbd1d3d['options']);var _0x5baff8={'where':_0x31ae09[_0xc374('0x37')]};return db[_0xc374('0x3c')][_0xc374('0x1d')](_0x5baff8)[_0xc374('0x22')](function(_0x39b59f){_0xb7cc5['count']=_0x39b59f;if(_0xbd1d3d[_0xc374('0x30')][_0xc374('0x3d')]){_0x31ae09[_0xc374('0x3e')]=[{'all':!![]}];}return db[_0xc374('0x3c')][_0xc374('0x3f')](_0x31ae09);})[_0xc374('0x22')](function(_0x39225c){_0xb7cc5['rows']=_0x39225c;return _0xb7cc5;})[_0xc374('0x22')](respondWithFilteredResult(_0x434c44,_0x31ae09))['catch'](handleError(_0x434c44,null));};exports[_0xc374('0x40')]=function(_0x4f5e44,_0x59e86d){var _0x3abfe5={'raw':!![],'where':{'id':_0x4f5e44[_0xc374('0x41')]['id']}},_0xb4b71b={};_0xb4b71b['model']=_[_0xc374('0x2f')](db[_0xc374('0x3c')]['rawAttributes']);_0xb4b71b[_0xc374('0x30')]=_[_0xc374('0x2f')](_0x4f5e44[_0xc374('0x30')]);_0xb4b71b[_0xc374('0x31')]=_[_0xc374('0x32')](_0xb4b71b[_0xc374('0x2e')],_0xb4b71b[_0xc374('0x30')]);_0x3abfe5[_0xc374('0x33')]=_['intersection'](_0xb4b71b['model'],qs[_0xc374('0x34')](_0x4f5e44[_0xc374('0x30')]['fields']));_0x3abfe5[_0xc374('0x33')]=_0x3abfe5[_0xc374('0x33')]['length']?_0x3abfe5[_0xc374('0x33')]:_0xb4b71b[_0xc374('0x2e')];if(_0x4f5e44[_0xc374('0x30')][_0xc374('0x3d')]){_0x3abfe5[_0xc374('0x3e')]=[{'all':!![]}];}_0x3abfe5=_[_0xc374('0x3a')]({},_0x3abfe5,_0x4f5e44[_0xc374('0x42')]);return db[_0xc374('0x3c')][_0xc374('0x43')](_0x3abfe5)[_0xc374('0x22')](handleEntityNotFound(_0x59e86d,null))['then'](respondWithResult(_0x59e86d,null))[_0xc374('0x44')](handleError(_0x59e86d,null));};exports['create']=function(_0x45a599,_0x423d05){return db['ChatQueueReport'][_0xc374('0x45')](_0x45a599[_0xc374('0x46')],{})[_0xc374('0x22')](respondWithResult(_0x423d05,0xc9))[_0xc374('0x44')](handleError(_0x423d05,null));};exports[_0xc374('0x21')]=function(_0x549b95,_0x42d0cc){if(_0x549b95[_0xc374('0x46')]['id']){delete _0x549b95[_0xc374('0x46')]['id'];}return db['ChatQueueReport'][_0xc374('0x43')]({'where':{'id':_0x549b95['params']['id']}})[_0xc374('0x22')](handleEntityNotFound(_0x42d0cc,null))[_0xc374('0x22')](saveUpdates(_0x549b95[_0xc374('0x46')],null))['then'](respondWithResult(_0x42d0cc,null))[_0xc374('0x44')](handleError(_0x42d0cc,null));};exports['destroy']=function(_0x1cf1cf,_0x3d001b){return db[_0xc374('0x3c')][_0xc374('0x43')]({'where':{'id':_0x1cf1cf[_0xc374('0x41')]['id']}})[_0xc374('0x22')](handleEntityNotFound(_0x3d001b,null))['then'](removeEntity(_0x3d001b,null))[_0xc374('0x44')](handleError(_0x3d001b,null));};exports['describe']=function(_0x3dba84,_0x3b63e5){return db[_0xc374('0x3c')][_0xc374('0x47')]()[_0xc374('0x22')](respondWithResult(_0x3b63e5,null))['catch'](handleError(_0x3b63e5,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 487c8bd..b4d1588 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x1b424b,_0x57bfdc){var _0x19296e=function(_0x531830){while(--_0x531830){_0x1b424b['push'](_0x1b424b['shift']());}};_0x19296e(++_0x57bfdc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xb7e7[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x5da089,_0x250bcf){var _0x5d01dd=function(_0x42646c){while(--_0x42646c){_0x5da089['push'](_0x5da089['shift']());}};_0x5d01dd(++_0x250bcf);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'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/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 05ed260..aa9de48 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 _0x238e=['stringify','error','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','catch','UpdateChatQueueReport','update','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x4de2c5,_0x21aeb7){var _0x4ef52b=function(_0x5e52f4){while(--_0x5e52f4){_0x4de2c5['push'](_0x4de2c5['shift']());}};_0x4ef52b(++_0x21aeb7);}(_0x238e,0x69));var _0xe238=function(_0x53b2b6,_0x2fbfb5){_0x53b2b6=_0x53b2b6-0x0;var _0x31108d=_0x238e[_0x53b2b6];return _0x31108d;};'use strict';var _=require(_0xe238('0x0'));var util=require(_0xe238('0x1'));var moment=require(_0xe238('0x2'));var BPromise=require('bluebird');var rs=require(_0xe238('0x3'));var fs=require('fs');var Redis=require(_0xe238('0x4'));var db=require(_0xe238('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe238('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe238('0x7'));var client=jayson['client'][_0xe238('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26a48b,_0x26dc4c,_0x4fb2ed){return new BPromise(function(_0x3ce2e5,_0x596240){return client[_0xe238('0x9')](_0x26a48b,_0x4fb2ed)['then'](function(_0x4238c2){logger[_0xe238('0xa')](_0xe238('0xb'),_0x26dc4c,_0xe238('0xc'));logger[_0xe238('0xd')](_0xe238('0xe'),_0x26dc4c,_0xe238('0xc'),JSON[_0xe238('0xf')](_0x4238c2));if(_0x4238c2[_0xe238('0x10')]){if(_0x4238c2[_0xe238('0x10')]['code']===0x1f4){logger['error'](_0xe238('0xb'),_0x26dc4c,_0x4238c2['error'][_0xe238('0x11')]);return _0x596240(_0x4238c2[_0xe238('0x10')]['message']);}logger[_0xe238('0x10')](_0xe238('0xb'),_0x26dc4c,_0x4238c2[_0xe238('0x10')]['message']);return _0x3ce2e5(_0x4238c2[_0xe238('0x10')][_0xe238('0x11')]);}else{logger['info'](_0xe238('0xb'),_0x26dc4c,_0xe238('0xc'));_0x3ce2e5(_0x4238c2[_0xe238('0x12')][_0xe238('0x11')]);}})['catch'](function(_0x11b6dc){logger[_0xe238('0x10')](_0xe238('0xb'),_0x26dc4c,_0x11b6dc);_0x596240(_0x11b6dc);});});}exports[_0xe238('0x13')]=function(_0x43a35d){var _0x28e228=this;return new Promise(function(_0x3e0d8e,_0x667bb6){return db[_0xe238('0x14')][_0xe238('0x15')](_0x43a35d[_0xe238('0x16')],{'raw':_0x43a35d[_0xe238('0x17')]?_0x43a35d['options'][_0xe238('0x18')]===undefined?!![]:![]:!![]})[_0xe238('0x19')](function(_0x662739){logger[_0xe238('0xa')](_0xe238('0x13'),_0x43a35d);logger[_0xe238('0xd')](_0xe238('0x13'),_0x43a35d,JSON[_0xe238('0xf')](_0x662739));_0x3e0d8e(_0x662739);})[_0xe238('0x1a')](function(_0x20be50){logger[_0xe238('0x10')]('CreateChatQueueReport',_0x20be50[_0xe238('0x11')],_0x43a35d);_0x667bb6(_0x28e228[_0xe238('0x10')](0x1f4,_0x20be50[_0xe238('0x11')]));});});};exports[_0xe238('0x1b')]=function(_0x3f8047){var _0x19174a=this;return new Promise(function(_0x4959cf,_0x3dfe9a){return db[_0xe238('0x14')][_0xe238('0x1c')](_0x3f8047['body'],{'raw':_0x3f8047[_0xe238('0x17')]?_0x3f8047[_0xe238('0x17')][_0xe238('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8047[_0xe238('0x17')]?_0x3f8047[_0xe238('0x17')]['where']||null:null,'attributes':_0x3f8047[_0xe238('0x17')]?_0x3f8047['options'][_0xe238('0x1d')]||null:null,'limit':_0x3f8047['options']?_0x3f8047[_0xe238('0x17')]['limit']||null:null})[_0xe238('0x19')](function(_0x51755c){logger[_0xe238('0xa')](_0xe238('0x1b'),_0x3f8047);logger[_0xe238('0xd')](_0xe238('0x1b'),_0x3f8047,JSON[_0xe238('0xf')](_0x51755c));_0x4959cf(_0x51755c);})['catch'](function(_0x7f588b){logger[_0xe238('0x10')](_0xe238('0x1b'),_0x7f588b[_0xe238('0x11')],_0x3f8047);_0x3dfe9a(_0x19174a['error'](0x1f4,_0x7f588b['message']));});});}; \ No newline at end of file +var _0x1a4a=['where','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateChatQueueReport','create','options','info','UpdateChatQueueReport','ChatQueueReport','update','body'];(function(_0x1a226b,_0x4a7156){var _0x33e93f=function(_0x216aa0){while(--_0x216aa0){_0x1a226b['push'](_0x1a226b['shift']());}};_0x33e93f(++_0x4a7156);}(_0x1a4a,0x102));var _0xa1a4=function(_0x31e861,_0x19862c){_0x31e861=_0x31e861-0x0;var _0x537407=_0x1a4a[_0x31e861];return _0x537407;};'use strict';var _=require(_0xa1a4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa1a4('0x1'));var rs=require(_0xa1a4('0x2'));var fs=require('fs');var Redis=require(_0xa1a4('0x3'));var db=require(_0xa1a4('0x4'))['db'];var utils=require(_0xa1a4('0x5'));var logger=require('../../config/logger')(_0xa1a4('0x6'));var config=require(_0xa1a4('0x7'));var jayson=require(_0xa1a4('0x8'));var client=jayson[_0xa1a4('0x9')][_0xa1a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x224f1e,_0x31b140,_0x1afecf){return new BPromise(function(_0x5ba90a,_0x799fab){return client[_0xa1a4('0xb')](_0x224f1e,_0x1afecf)[_0xa1a4('0xc')](function(_0x10a07a){logger['info'](_0xa1a4('0xd'),_0x31b140,'request\x20sent');logger[_0xa1a4('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x31b140,_0xa1a4('0xf'),JSON[_0xa1a4('0x10')](_0x10a07a));if(_0x10a07a['error']){if(_0x10a07a['error'][_0xa1a4('0x11')]===0x1f4){logger[_0xa1a4('0x12')](_0xa1a4('0xd'),_0x31b140,_0x10a07a['error']['message']);return _0x799fab(_0x10a07a[_0xa1a4('0x12')][_0xa1a4('0x13')]);}logger[_0xa1a4('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x31b140,_0x10a07a[_0xa1a4('0x12')]['message']);return _0x5ba90a(_0x10a07a[_0xa1a4('0x12')]['message']);}else{logger['info'](_0xa1a4('0xd'),_0x31b140,_0xa1a4('0xf'));_0x5ba90a(_0x10a07a[_0xa1a4('0x14')][_0xa1a4('0x13')]);}})[_0xa1a4('0x15')](function(_0x418023){logger[_0xa1a4('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x31b140,_0x418023);_0x799fab(_0x418023);});});}exports[_0xa1a4('0x16')]=function(_0x406f74){var _0x43f00a=this;return new Promise(function(_0x32699f,_0x28be12){return db['ChatQueueReport'][_0xa1a4('0x17')](_0x406f74['body'],{'raw':_0x406f74['options']?_0x406f74[_0xa1a4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xa1a4('0xc')](function(_0x10d3f2){logger[_0xa1a4('0x19')]('CreateChatQueueReport',_0x406f74);logger[_0xa1a4('0xe')](_0xa1a4('0x16'),_0x406f74,JSON[_0xa1a4('0x10')](_0x10d3f2));_0x32699f(_0x10d3f2);})[_0xa1a4('0x15')](function(_0x49a413){logger[_0xa1a4('0x12')](_0xa1a4('0x16'),_0x49a413[_0xa1a4('0x13')],_0x406f74);_0x28be12(_0x43f00a[_0xa1a4('0x12')](0x1f4,_0x49a413[_0xa1a4('0x13')]));});});};exports[_0xa1a4('0x1a')]=function(_0x43cd9d){var _0x5d24bd=this;return new Promise(function(_0x43e1c1,_0x127e55){return db[_0xa1a4('0x1b')][_0xa1a4('0x1c')](_0x43cd9d[_0xa1a4('0x1d')],{'raw':_0x43cd9d[_0xa1a4('0x18')]?_0x43cd9d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43cd9d[_0xa1a4('0x18')]?_0x43cd9d['options'][_0xa1a4('0x1e')]||null:null,'attributes':_0x43cd9d[_0xa1a4('0x18')]?_0x43cd9d['options'][_0xa1a4('0x1f')]||null:null,'limit':_0x43cd9d['options']?_0x43cd9d[_0xa1a4('0x18')]['limit']||null:null})[_0xa1a4('0xc')](function(_0x2be5d9){logger[_0xa1a4('0x19')](_0xa1a4('0x1a'),_0x43cd9d);logger[_0xa1a4('0xe')](_0xa1a4('0x1a'),_0x43cd9d,JSON['stringify'](_0x2be5d9));_0x43e1c1(_0x2be5d9);})['catch'](function(_0x4142aa){logger['error'](_0xa1a4('0x1a'),_0x4142aa['message'],_0x43cd9d);_0x127e55(_0x5d24bd[_0xa1a4('0x12')](0x1f4,_0x4142aa[_0xa1a4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 77b2df2..c324f1b 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 _0xe0c6=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1ea31f,_0x47f6bf){var _0xbaf61a=function(_0x32aa04){while(--_0x32aa04){_0x1ea31f['push'](_0x1ea31f['shift']());}};_0xbaf61a(++_0x47f6bf);}(_0xe0c6,0xeb));var _0x6e0c=function(_0xf13dc1,_0x410dd3){_0xf13dc1=_0xf13dc1-0x0;var _0x5c7fea=_0xe0c6[_0xf13dc1];return _0x5c7fea;};'use strict';var multer=require(_0x6e0c('0x0'));var util=require(_0x6e0c('0x1'));var path=require(_0x6e0c('0x2'));var timeout=require(_0x6e0c('0x3'));var express=require(_0x6e0c('0x4'));var router=express['Router']();var fs_extra=require(_0x6e0c('0x5'));var auth=require(_0x6e0c('0x6'));var interaction=require(_0x6e0c('0x7'));var config=require(_0x6e0c('0x8'));var controller=require(_0x6e0c('0x9'));router[_0x6e0c('0xa')]('/',auth[_0x6e0c('0xb')](),controller[_0x6e0c('0xc')]);router[_0x6e0c('0xa')](_0x6e0c('0xd'),auth['isAuthenticated'](),controller[_0x6e0c('0xe')]);router[_0x6e0c('0xa')](_0x6e0c('0xf'),auth['isAuthenticated'](),controller[_0x6e0c('0x10')]);router['post']('/',auth[_0x6e0c('0xb')](),controller['create']);router[_0x6e0c('0x11')](_0x6e0c('0xf'),auth[_0x6e0c('0xb')](),controller[_0x6e0c('0x12')]);router[_0x6e0c('0x13')](_0x6e0c('0xf'),auth[_0x6e0c('0xb')](),controller[_0x6e0c('0x14')]);module[_0x6e0c('0x15')]=router; \ No newline at end of file +var _0x0c3e=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2a7e04,_0x29ed17){var _0x3a96ff=function(_0x5fd867){while(--_0x5fd867){_0x2a7e04['push'](_0x2a7e04['shift']());}};_0x3a96ff(++_0x29ed17);}(_0x0c3e,0x1ee));var _0xe0c3=function(_0xa1b8cb,_0x97e21b){_0xa1b8cb=_0xa1b8cb-0x0;var _0x47c2ae=_0x0c3e[_0xa1b8cb];return _0x47c2ae;};'use strict';var multer=require(_0xe0c3('0x0'));var util=require(_0xe0c3('0x1'));var path=require(_0xe0c3('0x2'));var timeout=require(_0xe0c3('0x3'));var express=require(_0xe0c3('0x4'));var router=express[_0xe0c3('0x5')]();var fs_extra=require(_0xe0c3('0x6'));var auth=require(_0xe0c3('0x7'));var interaction=require(_0xe0c3('0x8'));var config=require('../../config/environment');var controller=require(_0xe0c3('0x9'));router[_0xe0c3('0xa')]('/',auth[_0xe0c3('0xb')](),controller['index']);router[_0xe0c3('0xa')](_0xe0c3('0xc'),auth[_0xe0c3('0xb')](),controller[_0xe0c3('0xd')]);router[_0xe0c3('0xa')]('/:id',auth[_0xe0c3('0xb')](),controller[_0xe0c3('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe0c3('0xf')](_0xe0c3('0x10'),auth['isAuthenticated'](),controller[_0xe0c3('0x11')]);router['delete']('/:id',auth[_0xe0c3('0xb')](),controller[_0xe0c3('0x12')]);module[_0xe0c3('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 415f9e6..c10a63f 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(_0x40828d,_0x76898){var _0x10ad84=function(_0x496e77){while(--_0x496e77){_0x40828d['push'](_0x40828d['shift']());}};_0x10ad84(++_0x76898);}(_0xf4eb,0xec));var _0xbf4e=function(_0x302626,_0x495a5f){_0x302626=_0x302626-0x0;var _0x50e330=_0xf4eb[_0x302626];return _0x50e330;};'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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x384b72,_0xbc1ed1){var _0x371713=function(_0x1d6735){while(--_0x1d6735){_0x384b72['push'](_0x384b72['shift']());}};_0x371713(++_0xbc1ed1);}(_0x4b84,0x1cc));var _0x44b8=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x4b84[_0xc77819];return _0x1c9434;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 6ddf51e..ab96b00 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 _0xc8f8=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where'];(function(_0x221baf,_0x1e58d4){var _0x8c8aa6=function(_0x2684a7){while(--_0x2684a7){_0x221baf['push'](_0x221baf['shift']());}};_0x8c8aa6(++_0x1e58d4);}(_0xc8f8,0xf7));var _0x8c8f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xc8f8[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0x8c8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c8f('0x1'));var jsonpatch=require(_0x8c8f('0x2'));var rp=require(_0x8c8f('0x3'));var moment=require(_0x8c8f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8c8f('0x5'));var util=require(_0x8c8f('0x6'));var path=require(_0x8c8f('0x7'));var sox=require(_0x8c8f('0x8'));var csv=require(_0x8c8f('0x9'));var ejs=require(_0x8c8f('0xa'));var fs=require('fs');var fs_extra=require(_0x8c8f('0xb'));var _=require('lodash');var squel=require(_0x8c8f('0xc'));var crypto=require(_0x8c8f('0xd'));var jsforce=require(_0x8c8f('0xe'));var deskjs=require(_0x8c8f('0xf'));var toCsv=require(_0x8c8f('0x9'));var querystring=require(_0x8c8f('0x10'));var Papa=require(_0x8c8f('0x11'));var Redis=require(_0x8c8f('0x12'));var authService=require(_0x8c8f('0x13'));var qs=require(_0x8c8f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c8f('0x15'));var logger=require('../../config/logger')(_0x8c8f('0x16'));var utils=require('../../config/utils');var config=require(_0x8c8f('0x17'));var licenseUtil=require(_0x8c8f('0x18'));var db=require(_0x8c8f('0x19'))['db'];function respondWithStatusCode(_0x30d749,_0x1beefd){_0x1beefd=_0x1beefd||0xcc;return function(_0x38527a){if(_0x38527a){return _0x30d749['sendStatus'](_0x1beefd);}return _0x30d749['status'](_0x1beefd)[_0x8c8f('0x1a')]();};}function respondWithResult(_0x2a07af,_0x1e6f00){_0x1e6f00=_0x1e6f00||0xc8;return function(_0x5eda67){if(_0x5eda67){return _0x2a07af[_0x8c8f('0x1b')](_0x1e6f00)[_0x8c8f('0x1c')](_0x5eda67);}};}function respondWithFilteredResult(_0x19a498,_0x22deac){return function(_0x517951){if(_0x517951){var _0x2c710a=typeof _0x22deac['offset']===_0x8c8f('0x1d')&&typeof _0x22deac[_0x8c8f('0x1e')]===_0x8c8f('0x1d');var _0x2094ed=_0x517951[_0x8c8f('0x1f')];var _0x2120ae=_0x2c710a?0x0:_0x22deac[_0x8c8f('0x20')];var _0x3ecd6c=_0x2c710a?_0x517951['count']:_0x22deac['offset']+_0x22deac[_0x8c8f('0x1e')];var _0x43a87d;if(_0x3ecd6c>=_0x2094ed){_0x3ecd6c=_0x2094ed;_0x43a87d=0xc8;}else{_0x43a87d=0xce;}_0x19a498[_0x8c8f('0x1b')](_0x43a87d);return _0x19a498[_0x8c8f('0x21')](_0x8c8f('0x22'),_0x2120ae+'-'+_0x3ecd6c+'/'+_0x2094ed)[_0x8c8f('0x1c')](_0x517951);}return null;};}function patchUpdates(_0xc8379c){return function(_0x1c961c){try{jsonpatch[_0x8c8f('0x23')](_0x1c961c,_0xc8379c,!![]);}catch(_0x71dc59){return BPromise['reject'](_0x71dc59);}return _0x1c961c[_0x8c8f('0x24')]();};}function saveUpdates(_0x41a27f,_0xa4289b){return function(_0x14d130){if(_0x14d130){return _0x14d130['update'](_0x41a27f)['then'](function(_0x1fc376){return _0x1fc376;});}return null;};}function removeEntity(_0x2351b0,_0x3c9abb){return function(_0x5f4bde){if(_0x5f4bde){return _0x5f4bde[_0x8c8f('0x25')]()[_0x8c8f('0x26')](function(){_0x2351b0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe7e1ee,_0x267385){return function(_0x2c1eac){if(!_0x2c1eac){_0xe7e1ee[_0x8c8f('0x27')](0x194);}return _0x2c1eac;};}function handleError(_0x6f4c42,_0x49af90){_0x49af90=_0x49af90||0x1f4;return function(_0x1fa109){logger[_0x8c8f('0x28')](_0x1fa109[_0x8c8f('0x29')]);if(_0x1fa109['name']){delete _0x1fa109['name'];}_0x6f4c42[_0x8c8f('0x1b')](_0x49af90)[_0x8c8f('0x2a')](_0x1fa109);};}exports['index']=function(_0x503ad9,_0x1d24a6){var _0x11d7ea={},_0x4ae199={},_0x1beaf2={'count':0x0,'rows':[]};var _0x352bec=_[_0x8c8f('0x2b')](db[_0x8c8f('0x2c')][_0x8c8f('0x2d')],function(_0x32b035){return{'name':_0x32b035[_0x8c8f('0x2e')],'type':_0x32b035[_0x8c8f('0x2f')][_0x8c8f('0x30')]};});_0x4ae199[_0x8c8f('0x31')]=_[_0x8c8f('0x2b')](_0x352bec,_0x8c8f('0x32'));_0x4ae199[_0x8c8f('0x33')]=_[_0x8c8f('0x34')](_0x503ad9['query']);_0x4ae199['filters']=_[_0x8c8f('0x35')](_0x4ae199['model'],_0x4ae199[_0x8c8f('0x33')]);_0x11d7ea[_0x8c8f('0x36')]=_['intersection'](_0x4ae199['model'],qs['fields'](_0x503ad9[_0x8c8f('0x33')][_0x8c8f('0x37')]));_0x11d7ea[_0x8c8f('0x36')]=_0x11d7ea[_0x8c8f('0x36')][_0x8c8f('0x38')]?_0x11d7ea['attributes']:_0x4ae199[_0x8c8f('0x31')];if(!_0x503ad9[_0x8c8f('0x33')][_0x8c8f('0x39')]('nolimit')){_0x11d7ea[_0x8c8f('0x1e')]=qs[_0x8c8f('0x1e')](_0x503ad9['query'][_0x8c8f('0x1e')]);_0x11d7ea['offset']=qs[_0x8c8f('0x20')](_0x503ad9['query'][_0x8c8f('0x20')]);}_0x11d7ea[_0x8c8f('0x3a')]=qs['sort'](_0x503ad9[_0x8c8f('0x33')][_0x8c8f('0x3b')]);_0x11d7ea[_0x8c8f('0x3c')]=qs['filters'](_['pick'](_0x503ad9[_0x8c8f('0x33')],_0x4ae199['filters']),_0x352bec);if(_0x503ad9[_0x8c8f('0x33')][_0x8c8f('0x3d')]){_0x11d7ea[_0x8c8f('0x3c')]=_[_0x8c8f('0x3e')](_0x11d7ea[_0x8c8f('0x3c')],{'$or':_[_0x8c8f('0x2b')](_0x352bec,function(_0x4a140e){if(_0x4a140e['type']!==_0x8c8f('0x3f')){var _0x5047f1={};_0x5047f1[_0x4a140e[_0x8c8f('0x32')]]={'$like':'%'+_0x503ad9['query']['filter']+'%'};return _0x5047f1;}})});}_0x11d7ea=_[_0x8c8f('0x3e')]({},_0x11d7ea,_0x503ad9[_0x8c8f('0x40')]);var _0x217842={'where':_0x11d7ea[_0x8c8f('0x3c')]};return db[_0x8c8f('0x2c')][_0x8c8f('0x1f')](_0x217842)['then'](function(_0x4a9bd9){_0x1beaf2[_0x8c8f('0x1f')]=_0x4a9bd9;if(_0x503ad9[_0x8c8f('0x33')][_0x8c8f('0x41')]){_0x11d7ea[_0x8c8f('0x42')]=[{'all':!![]}];}return db[_0x8c8f('0x2c')][_0x8c8f('0x43')](_0x11d7ea);})[_0x8c8f('0x26')](function(_0x402a15){_0x1beaf2[_0x8c8f('0x44')]=_0x402a15;return _0x1beaf2;})[_0x8c8f('0x26')](respondWithFilteredResult(_0x1d24a6,_0x11d7ea))[_0x8c8f('0x45')](handleError(_0x1d24a6,null));};exports[_0x8c8f('0x46')]=function(_0x415cf2,_0x4048e4){var _0x1755b0={'raw':!![],'where':{'id':_0x415cf2[_0x8c8f('0x47')]['id']}},_0x695633={};_0x695633[_0x8c8f('0x31')]=_[_0x8c8f('0x34')](db[_0x8c8f('0x2c')][_0x8c8f('0x2d')]);_0x695633[_0x8c8f('0x33')]=_[_0x8c8f('0x34')](_0x415cf2[_0x8c8f('0x33')]);_0x695633['filters']=_[_0x8c8f('0x35')](_0x695633['model'],_0x695633[_0x8c8f('0x33')]);_0x1755b0[_0x8c8f('0x36')]=_[_0x8c8f('0x35')](_0x695633[_0x8c8f('0x31')],qs[_0x8c8f('0x37')](_0x415cf2[_0x8c8f('0x33')][_0x8c8f('0x37')]));_0x1755b0[_0x8c8f('0x36')]=_0x1755b0[_0x8c8f('0x36')][_0x8c8f('0x38')]?_0x1755b0['attributes']:_0x695633[_0x8c8f('0x31')];if(_0x415cf2['query'][_0x8c8f('0x41')]){_0x1755b0[_0x8c8f('0x42')]=[{'all':!![]}];}_0x1755b0=_[_0x8c8f('0x3e')]({},_0x1755b0,_0x415cf2['options']);return db['ChatTransferReport'][_0x8c8f('0x48')](_0x1755b0)['then'](handleEntityNotFound(_0x4048e4,null))[_0x8c8f('0x26')](respondWithResult(_0x4048e4,null))[_0x8c8f('0x45')](handleError(_0x4048e4,null));};exports[_0x8c8f('0x49')]=function(_0x26112a,_0x5b835c){return db['ChatTransferReport'][_0x8c8f('0x49')](_0x26112a['body'],{})[_0x8c8f('0x26')](respondWithResult(_0x5b835c,0xc9))[_0x8c8f('0x45')](handleError(_0x5b835c,null));};exports[_0x8c8f('0x4a')]=function(_0x108fbc,_0x3b82f0){if(_0x108fbc['body']['id']){delete _0x108fbc[_0x8c8f('0x4b')]['id'];}return db[_0x8c8f('0x2c')][_0x8c8f('0x48')]({'where':{'id':_0x108fbc[_0x8c8f('0x47')]['id']}})[_0x8c8f('0x26')](handleEntityNotFound(_0x3b82f0,null))[_0x8c8f('0x26')](saveUpdates(_0x108fbc[_0x8c8f('0x4b')],null))[_0x8c8f('0x26')](respondWithResult(_0x3b82f0,null))['catch'](handleError(_0x3b82f0,null));};exports[_0x8c8f('0x25')]=function(_0x318d1b,_0x4b84ff){return db[_0x8c8f('0x2c')][_0x8c8f('0x48')]({'where':{'id':_0x318d1b[_0x8c8f('0x47')]['id']}})[_0x8c8f('0x26')](handleEntityNotFound(_0x4b84ff,null))[_0x8c8f('0x26')](removeEntity(_0x4b84ff,null))[_0x8c8f('0x45')](handleError(_0x4b84ff,null));};exports[_0x8c8f('0x4c')]=function(_0x4d74b0,_0x3461eb){return db[_0x8c8f('0x2c')][_0x8c8f('0x4c')]()[_0x8c8f('0x26')](respondWithResult(_0x3461eb,null))[_0x8c8f('0x45')](handleError(_0x3461eb,null));}; \ No newline at end of file +var _0x73a8=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','index','map','ChatTransferReport','fieldName','type','key','query','filters','model','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','rows','catch','params','keys','rawAttributes','fields','length','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto'];(function(_0x34b93d,_0x736389){var _0x2bde01=function(_0x4b732e){while(--_0x4b732e){_0x34b93d['push'](_0x34b93d['shift']());}};_0x2bde01(++_0x736389);}(_0x73a8,0x1de));var _0x873a=function(_0x10ccf5,_0x1d7373){_0x10ccf5=_0x10ccf5-0x0;var _0x5abfbc=_0x73a8[_0x10ccf5];return _0x5abfbc;};'use strict';var emlformat=require(_0x873a('0x0'));var rimraf=require(_0x873a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x873a('0x2'));var rp=require(_0x873a('0x3'));var moment=require(_0x873a('0x4'));var BPromise=require(_0x873a('0x5'));var Mustache=require('mustache');var util=require(_0x873a('0x6'));var path=require('path');var sox=require(_0x873a('0x7'));var csv=require(_0x873a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x873a('0x9'));var squel=require(_0x873a('0xa'));var crypto=require(_0x873a('0xb'));var jsforce=require(_0x873a('0xc'));var deskjs=require(_0x873a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x873a('0xe'));var Papa=require('papaparse');var Redis=require(_0x873a('0xf'));var authService=require(_0x873a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x873a('0x11'));var hardwareService=require(_0x873a('0x12'));var logger=require('../../config/logger')(_0x873a('0x13'));var utils=require('../../config/utils');var config=require(_0x873a('0x14'));var licenseUtil=require(_0x873a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47c32d,_0x1c9131){_0x1c9131=_0x1c9131||0xcc;return function(_0x21eea1){if(_0x21eea1){return _0x47c32d['sendStatus'](_0x1c9131);}return _0x47c32d[_0x873a('0x16')](_0x1c9131)[_0x873a('0x17')]();};}function respondWithResult(_0x2db361,_0x2fa943){_0x2fa943=_0x2fa943||0xc8;return function(_0x4d895c){if(_0x4d895c){return _0x2db361['status'](_0x2fa943)[_0x873a('0x18')](_0x4d895c);}};}function respondWithFilteredResult(_0x175684,_0x584136){return function(_0x4d9dfd){if(_0x4d9dfd){var _0x3e772f=typeof _0x584136[_0x873a('0x19')]===_0x873a('0x1a')&&typeof _0x584136[_0x873a('0x1b')]==='undefined';var _0x471628=_0x4d9dfd[_0x873a('0x1c')];var _0x4bba95=_0x3e772f?0x0:_0x584136[_0x873a('0x19')];var _0x205f08=_0x3e772f?_0x4d9dfd['count']:_0x584136[_0x873a('0x19')]+_0x584136[_0x873a('0x1b')];var _0x5efcbf;if(_0x205f08>=_0x471628){_0x205f08=_0x471628;_0x5efcbf=0xc8;}else{_0x5efcbf=0xce;}_0x175684[_0x873a('0x16')](_0x5efcbf);return _0x175684['set'](_0x873a('0x1d'),_0x4bba95+'-'+_0x205f08+'/'+_0x471628)[_0x873a('0x18')](_0x4d9dfd);}return null;};}function patchUpdates(_0x31f3a7){return function(_0x15271c){try{jsonpatch[_0x873a('0x1e')](_0x15271c,_0x31f3a7,!![]);}catch(_0x3df20d){return BPromise[_0x873a('0x1f')](_0x3df20d);}return _0x15271c['save']();};}function saveUpdates(_0x25b803,_0xd0fae7){return function(_0x28f76b){if(_0x28f76b){return _0x28f76b[_0x873a('0x20')](_0x25b803)[_0x873a('0x21')](function(_0x58cf06){return _0x58cf06;});}return null;};}function removeEntity(_0x550a4d,_0x27d890){return function(_0x15c30c){if(_0x15c30c){return _0x15c30c['destroy']()['then'](function(){_0x550a4d[_0x873a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bcb11,_0x3a151b){return function(_0x7455ab){if(!_0x7455ab){_0x1bcb11[_0x873a('0x22')](0x194);}return _0x7455ab;};}function handleError(_0x3ebb4c,_0x5efa6d){_0x5efa6d=_0x5efa6d||0x1f4;return function(_0x2f82f9){logger[_0x873a('0x23')](_0x2f82f9[_0x873a('0x24')]);if(_0x2f82f9['name']){delete _0x2f82f9[_0x873a('0x25')];}_0x3ebb4c[_0x873a('0x16')](_0x5efa6d)['send'](_0x2f82f9);};}exports[_0x873a('0x26')]=function(_0xae5a3a,_0x393873){var _0x3a84ea={},_0x238a91={},_0x99dde3={'count':0x0,'rows':[]};var _0x3090a4=_[_0x873a('0x27')](db[_0x873a('0x28')]['rawAttributes'],function(_0x23c69a){return{'name':_0x23c69a[_0x873a('0x29')],'type':_0x23c69a[_0x873a('0x2a')][_0x873a('0x2b')]};});_0x238a91['model']=_[_0x873a('0x27')](_0x3090a4,'name');_0x238a91[_0x873a('0x2c')]=_['keys'](_0xae5a3a[_0x873a('0x2c')]);_0x238a91[_0x873a('0x2d')]=_['intersection'](_0x238a91[_0x873a('0x2e')],_0x238a91[_0x873a('0x2c')]);_0x3a84ea[_0x873a('0x2f')]=_[_0x873a('0x30')](_0x238a91[_0x873a('0x2e')],qs['fields'](_0xae5a3a[_0x873a('0x2c')]['fields']));_0x3a84ea[_0x873a('0x2f')]=_0x3a84ea['attributes']['length']?_0x3a84ea[_0x873a('0x2f')]:_0x238a91[_0x873a('0x2e')];if(!_0xae5a3a[_0x873a('0x2c')][_0x873a('0x31')](_0x873a('0x32'))){_0x3a84ea[_0x873a('0x1b')]=qs[_0x873a('0x1b')](_0xae5a3a[_0x873a('0x2c')]['limit']);_0x3a84ea[_0x873a('0x19')]=qs[_0x873a('0x19')](_0xae5a3a[_0x873a('0x2c')][_0x873a('0x19')]);}_0x3a84ea[_0x873a('0x33')]=qs[_0x873a('0x34')](_0xae5a3a['query'][_0x873a('0x34')]);_0x3a84ea[_0x873a('0x35')]=qs[_0x873a('0x2d')](_[_0x873a('0x36')](_0xae5a3a['query'],_0x238a91[_0x873a('0x2d')]),_0x3090a4);if(_0xae5a3a[_0x873a('0x2c')][_0x873a('0x37')]){_0x3a84ea[_0x873a('0x35')]=_['merge'](_0x3a84ea['where'],{'$or':_[_0x873a('0x27')](_0x3090a4,function(_0x4ccda4){if(_0x4ccda4[_0x873a('0x2a')]!=='VIRTUAL'){var _0x1430c7={};_0x1430c7[_0x4ccda4[_0x873a('0x25')]]={'$like':'%'+_0xae5a3a[_0x873a('0x2c')][_0x873a('0x37')]+'%'};return _0x1430c7;}})});}_0x3a84ea=_['merge']({},_0x3a84ea,_0xae5a3a[_0x873a('0x38')]);var _0x6176ac={'where':_0x3a84ea[_0x873a('0x35')]};return db[_0x873a('0x28')][_0x873a('0x1c')](_0x6176ac)[_0x873a('0x21')](function(_0x196a67){_0x99dde3[_0x873a('0x1c')]=_0x196a67;if(_0xae5a3a[_0x873a('0x2c')][_0x873a('0x39')]){_0x3a84ea[_0x873a('0x3a')]=[{'all':!![]}];}return db[_0x873a('0x28')]['findAll'](_0x3a84ea);})[_0x873a('0x21')](function(_0x5b592c){_0x99dde3[_0x873a('0x3b')]=_0x5b592c;return _0x99dde3;})[_0x873a('0x21')](respondWithFilteredResult(_0x393873,_0x3a84ea))[_0x873a('0x3c')](handleError(_0x393873,null));};exports['show']=function(_0x66a349,_0x30bc35){var _0x9021ca={'raw':!![],'where':{'id':_0x66a349[_0x873a('0x3d')]['id']}},_0x4305bd={};_0x4305bd[_0x873a('0x2e')]=_[_0x873a('0x3e')](db[_0x873a('0x28')][_0x873a('0x3f')]);_0x4305bd['query']=_[_0x873a('0x3e')](_0x66a349[_0x873a('0x2c')]);_0x4305bd[_0x873a('0x2d')]=_[_0x873a('0x30')](_0x4305bd[_0x873a('0x2e')],_0x4305bd[_0x873a('0x2c')]);_0x9021ca['attributes']=_['intersection'](_0x4305bd[_0x873a('0x2e')],qs['fields'](_0x66a349['query'][_0x873a('0x40')]));_0x9021ca[_0x873a('0x2f')]=_0x9021ca[_0x873a('0x2f')][_0x873a('0x41')]?_0x9021ca[_0x873a('0x2f')]:_0x4305bd[_0x873a('0x2e')];if(_0x66a349[_0x873a('0x2c')][_0x873a('0x39')]){_0x9021ca['include']=[{'all':!![]}];}_0x9021ca=_['merge']({},_0x9021ca,_0x66a349[_0x873a('0x38')]);return db['ChatTransferReport']['find'](_0x9021ca)['then'](handleEntityNotFound(_0x30bc35,null))[_0x873a('0x21')](respondWithResult(_0x30bc35,null))[_0x873a('0x3c')](handleError(_0x30bc35,null));};exports[_0x873a('0x42')]=function(_0x226556,_0x1f66a7){return db[_0x873a('0x28')][_0x873a('0x42')](_0x226556[_0x873a('0x43')],{})[_0x873a('0x21')](respondWithResult(_0x1f66a7,0xc9))[_0x873a('0x3c')](handleError(_0x1f66a7,null));};exports['update']=function(_0x1b77fa,_0x44ec34){if(_0x1b77fa['body']['id']){delete _0x1b77fa['body']['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x1b77fa[_0x873a('0x3d')]['id']}})[_0x873a('0x21')](handleEntityNotFound(_0x44ec34,null))[_0x873a('0x21')](saveUpdates(_0x1b77fa[_0x873a('0x43')],null))[_0x873a('0x21')](respondWithResult(_0x44ec34,null))[_0x873a('0x3c')](handleError(_0x44ec34,null));};exports['destroy']=function(_0x58a706,_0x16f1b8){return db[_0x873a('0x28')][_0x873a('0x44')]({'where':{'id':_0x58a706[_0x873a('0x3d')]['id']}})[_0x873a('0x21')](handleEntityNotFound(_0x16f1b8,null))['then'](removeEntity(_0x16f1b8,null))[_0x873a('0x3c')](handleError(_0x16f1b8,null));};exports[_0x873a('0x45')]=function(_0x217a7c,_0x421458){return db['ChatTransferReport']['describe']()[_0x873a('0x21')](respondWithResult(_0x421458,null))[_0x873a('0x3c')](handleError(_0x421458,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d45758f..81f92b8 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 _0x4f07=['path','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','request-promise'];(function(_0x26d85f,_0x444b9a){var _0x3ba9d1=function(_0x2416c6){while(--_0x2416c6){_0x26d85f['push'](_0x26d85f['shift']());}};_0x3ba9d1(++_0x444b9a);}(_0x4f07,0x157));var _0x74f0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4f07[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x74f0('0x0'));var util=require('util');var logger=require(_0x74f0('0x1'))(_0x74f0('0x2'));var moment=require(_0x74f0('0x3'));var BPromise=require('bluebird');var rp=require(_0x74f0('0x4'));var fs=require('fs');var path=require(_0x74f0('0x5'));var rimraf=require('rimraf');var config=require(_0x74f0('0x6'));var attributes=require(_0x74f0('0x7'));module[_0x74f0('0x8')]=function(_0x5b0e2b,_0x3e6454){return _0x5b0e2b['define'](_0x74f0('0x9'),attributes,{'tableName':_0x74f0('0xa'),'paranoid':![],'indexes':[{'name':_0x74f0('0xb'),'fields':[_0x74f0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbad5=['report_chat_transfer','uniqueid','lodash','moment','bluebird','path','rimraf','./chatTransferReport.attributes','ChatTransferReport'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xbad5,0x119));var _0x5bad=function(_0x4874b7,_0x79e7a){_0x4874b7=_0x4874b7-0x0;var _0x52c278=_0xbad5[_0x4874b7];return _0x52c278;};'use strict';var _=require(_0x5bad('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5bad('0x1'));var BPromise=require(_0x5bad('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bad('0x3'));var rimraf=require(_0x5bad('0x4'));var config=require('../../config/environment');var attributes=require(_0x5bad('0x5'));module['exports']=function(_0x19d0dd,_0x2ace4e){return _0x19d0dd['define'](_0x5bad('0x6'),attributes,{'tableName':_0x5bad('0x7'),'paranoid':![],'indexes':[{'name':_0x5bad('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 5dcec84..cb64e29 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 _0xf05b=['client','request','then','info','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x27569d,_0x3afe91){var _0x1fabaa=function(_0xac0cd8){while(--_0xac0cd8){_0x27569d['push'](_0x27569d['shift']());}};_0x1fabaa(++_0x3afe91);}(_0xf05b,0xac));var _0xbf05=function(_0x4e16ad,_0x356ef9){_0x4e16ad=_0x4e16ad-0x0;var _0x44a093=_0xf05b[_0x4e16ad];return _0x44a093;};'use strict';var _=require(_0xbf05('0x0'));var util=require('util');var moment=require(_0xbf05('0x1'));var BPromise=require(_0xbf05('0x2'));var rs=require(_0xbf05('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf05('0x4'))['db'];var utils=require(_0xbf05('0x5'));var logger=require(_0xbf05('0x6'))(_0xbf05('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf05('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x263bb6,_0x235212,_0x2aa573){return new BPromise(function(_0x5ab07f,_0x55d6ff){return client[_0xbf05('0x9')](_0x263bb6,_0x2aa573)[_0xbf05('0xa')](function(_0x407f15){logger[_0xbf05('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x235212,'request\x20sent');logger['debug'](_0xbf05('0xc'),_0x235212,_0xbf05('0xd'),JSON[_0xbf05('0xe')](_0x407f15));if(_0x407f15[_0xbf05('0xf')]){if(_0x407f15[_0xbf05('0xf')]['code']===0x1f4){logger[_0xbf05('0xf')](_0xbf05('0x10'),_0x235212,_0x407f15['error'][_0xbf05('0x11')]);return _0x55d6ff(_0x407f15[_0xbf05('0xf')][_0xbf05('0x11')]);}logger[_0xbf05('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x235212,_0x407f15['error'][_0xbf05('0x11')]);return _0x5ab07f(_0x407f15['error'][_0xbf05('0x11')]);}else{logger['info'](_0xbf05('0x10'),_0x235212,_0xbf05('0xd'));_0x5ab07f(_0x407f15[_0xbf05('0x12')][_0xbf05('0x11')]);}})[_0xbf05('0x13')](function(_0x25d625){logger[_0xbf05('0xf')](_0xbf05('0x10'),_0x235212,_0x25d625);_0x55d6ff(_0x25d625);});});} \ No newline at end of file +var _0x0918=['http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x193121,_0x7b7388){var _0x353cb2=function(_0x83fb51){while(--_0x83fb51){_0x193121['push'](_0x193121['shift']());}};_0x353cb2(++_0x7b7388);}(_0x0918,0x1ad));var _0x8091=function(_0x3846e6,_0x1226e3){_0x3846e6=_0x3846e6-0x0;var _0x56f106=_0x0918[_0x3846e6];return _0x56f106;};'use strict';var _=require(_0x8091('0x0'));var util=require(_0x8091('0x1'));var moment=require(_0x8091('0x2'));var BPromise=require(_0x8091('0x3'));var rs=require(_0x8091('0x4'));var fs=require('fs');var Redis=require(_0x8091('0x5'));var db=require(_0x8091('0x6'))['db'];var utils=require(_0x8091('0x7'));var logger=require(_0x8091('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8091('0x9'));var client=jayson[_0x8091('0xa')][_0x8091('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x183c16,_0x28d7c4,_0x8006cb){return new BPromise(function(_0xed23b7,_0x23d9a0){return client[_0x8091('0xc')](_0x183c16,_0x8006cb)['then'](function(_0x1a1178){logger['info'](_0x8091('0xd'),_0x28d7c4,_0x8091('0xe'));logger[_0x8091('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x28d7c4,'request\x20sent',JSON[_0x8091('0x10')](_0x1a1178));if(_0x1a1178[_0x8091('0x11')]){if(_0x1a1178['error'][_0x8091('0x12')]===0x1f4){logger[_0x8091('0x11')](_0x8091('0xd'),_0x28d7c4,_0x1a1178[_0x8091('0x11')][_0x8091('0x13')]);return _0x23d9a0(_0x1a1178['error'][_0x8091('0x13')]);}logger[_0x8091('0x11')](_0x8091('0xd'),_0x28d7c4,_0x1a1178[_0x8091('0x11')][_0x8091('0x13')]);return _0xed23b7(_0x1a1178[_0x8091('0x11')][_0x8091('0x13')]);}else{logger[_0x8091('0x14')](_0x8091('0xd'),_0x28d7c4,_0x8091('0xe'));_0xed23b7(_0x1a1178[_0x8091('0x15')][_0x8091('0x13')]);}})['catch'](function(_0x2e9fab){logger[_0x8091('0x11')](_0x8091('0xd'),_0x28d7c4,_0x2e9fab);_0x23d9a0(_0x2e9fab);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index fa7ee41..762632c 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 _0x345e=['Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x4022d3,_0x1a6504){var _0x544997=function(_0x118f65){while(--_0x118f65){_0x4022d3['push'](_0x4022d3['shift']());}};_0x544997(++_0x1a6504);}(_0x345e,0x106));var _0xe345=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0x345e[_0x425b19];return _0x15ecab;};'use strict';var multer=require(_0xe345('0x0'));var util=require(_0xe345('0x1'));var path=require(_0xe345('0x2'));var timeout=require(_0xe345('0x3'));var express=require('express');var router=express[_0xe345('0x4')]();var fs_extra=require(_0xe345('0x5'));var auth=require(_0xe345('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe345('0x7'));router[_0xe345('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe345('0x8')](_0xe345('0x9'),auth[_0xe345('0xa')](),controller[_0xe345('0xb')]);router[_0xe345('0x8')](_0xe345('0xc'),auth[_0xe345('0xa')](),controller[_0xe345('0xd')]);router[_0xe345('0xe')]('/',auth[_0xe345('0xa')](),controller[_0xe345('0xf')]);router[_0xe345('0x10')](_0xe345('0xc'),auth[_0xe345('0xa')](),controller['update']);router[_0xe345('0x11')](_0xe345('0xc'),auth[_0xe345('0xa')](),controller['destroy']);module[_0xe345('0x12')]=router; \ No newline at end of file +var _0x4e44=['express','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','create','delete','destroy','multer'];(function(_0x4e1a32,_0x592dc5){var _0x2dec85=function(_0x547347){while(--_0x547347){_0x4e1a32['push'](_0x4e1a32['shift']());}};_0x2dec85(++_0x592dc5);}(_0x4e44,0x1c6));var _0x44e4=function(_0x376328,_0x59e2ff){_0x376328=_0x376328-0x0;var _0x3b7877=_0x4e44[_0x376328];return _0x3b7877;};'use strict';var multer=require(_0x44e4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44e4('0x1'));var router=express['Router']();var fs_extra=require(_0x44e4('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x44e4('0x3'));var config=require('../../config/environment');var controller=require(_0x44e4('0x4'));router[_0x44e4('0x5')]('/',auth[_0x44e4('0x6')](),controller[_0x44e4('0x7')]);router[_0x44e4('0x5')](_0x44e4('0x8'),auth[_0x44e4('0x6')](),controller['describe']);router['get'](_0x44e4('0x9'),auth[_0x44e4('0x6')](),controller['show']);router['post']('/',auth[_0x44e4('0x6')](),controller[_0x44e4('0xa')]);router['put']('/:id',auth[_0x44e4('0x6')](),controller['update']);router[_0x44e4('0xb')](_0x44e4('0x9'),auth['isAuthenticated'](),controller[_0x44e4('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e91ac25..0fb347d 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 _0xec56=['#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','name','text','input','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','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:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xec56,0x1bd));var _0x6ec5=function(_0x5e2542,_0x2b7b22){_0x5e2542=_0x5e2542-0x0;var _0x685498=_0xec56[_0x5e2542];return _0x685498;};'use strict';var Sequelize=require(_0x6ec5('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'unique':_0x6ec5('0x2')},'description':{'type':Sequelize[_0x6ec5('0x1')]},'mapKey':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x3')},'mapKeyOffline':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x3')},'key':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x4')},'customerAlias':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':_0x6ec5('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':_0x6ec5('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':_0x6ec5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6ec5('0x1')]},'animation':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6ec5('0x9')](_0x6ec5('0xa'),_0x6ec5('0xb')),'defaultValue':_0x6ec5('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6ec5('0xc')},'start_chat_button':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xd')},'offline_chat_button':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xe')},'header_offline':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xf')},'download_transcript':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6ec5('0x10')]},'closingQuestion':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x12')},'noteTitle':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x13')},'placeholderMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x14')},'closingMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x15')},'closingMessageButton':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xe')},'skipMessageButton':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x16')},'conditionAgreement':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x6ec5('0x9')](_0x6ec5('0x17'),_0x6ec5('0x18')),'defaultValue':_0x6ec5('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6ec5('0x10')],'defaultValue':function(){return JSON[_0x6ec5('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6ec5('0x1a'),'type':_0x6ec5('0x1b'),'required':!![]},'props':{'title':_0x6ec5('0x1a'),'helpText':''}},{'type':_0x6ec5('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6ec5('0x3'),'type':_0x6ec5('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6ec5('0x1d'))?JSON[_0x6ec5('0x1e')](this[_0x6ec5('0x1f')]('onlineForm')):{};},'set':function(_0x1b779a){return this[_0x6ec5('0x20')](_0x6ec5('0x1d'),JSON[_0x6ec5('0x19')](_0x1b779a));}},'offlineForm':{'type':Sequelize[_0x6ec5('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x6ec5('0x1c'),'props':{'title':_0x6ec5('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6ec5('0x3')},'variable':null},{'type':_0x6ec5('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0x6ec5('0x22'),'helpText':_0x6ec5('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6ec5('0x1f')](_0x6ec5('0x24'))?JSON[_0x6ec5('0x1e')](this['getDataValue'](_0x6ec5('0x24'))):{};},'set':function(_0x179f57){return this[_0x6ec5('0x20')](_0x6ec5('0x24'),JSON[_0x6ec5('0x19')](_0x179f57));}},'token':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':function(){return rs[_0x6ec5('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6ec5('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6ec5('0x1')]},'waitingTitle':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6ec5('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x28')},'skipUnmanaged':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x16')},'sendUnmanaged':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6ec5('0x10')],'defaultValue':function(){return _0x6ec5('0x29');}},'notificationSound':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6ec5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x2b')},'verticalAlignment':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x6ec5('0x1')]},'customerAvatar':{'type':Sequelize[_0x6ec5('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6ec5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![],'defaultValue':_0x6ec5('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6ec5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':_0x6ec5('0x2d')},'systemAvatar':{'type':Sequelize[_0x6ec5('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ec5('0x7')],'comment':_0x6ec5('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![],'comment':_0x6ec5('0x2f'),'set':function(_0x53dcd8){if(!_0x53dcd8)this[_0x6ec5('0x20')]('mandatoryDispositionPauseId',null);this[_0x6ec5('0x20')]('mandatoryDisposition',_0x53dcd8);}},'vidaooEscalation':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6ec5('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ec5('0x30')},'vidaooNote':{'type':Sequelize[_0x6ec5('0x1')],'defaultValue':function(){return _0x6ec5('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6ec5('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6ec5('0x10')]}}; \ No newline at end of file +var _0x91a7=['rounded','squared','We\x20are\x20here!','Send','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','ENUM','star','thumb','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN'];(function(_0x1cb890,_0x3b3a68){var _0x143993=function(_0x4d288a){while(--_0x4d288a){_0x1cb890['push'](_0x1cb890['shift']());}};_0x143993(++_0x3b3a68);}(_0x91a7,0xe7));var _0x791a=function(_0x1e3f34,_0x4b2222){_0x1e3f34=_0x1e3f34-0x0;var _0x334f67=_0x91a7[_0x1e3f34];return _0x334f67;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x791a('0x0'));module[_0x791a('0x1')]={'name':{'type':Sequelize[_0x791a('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x791a('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x4')},'key':{'type':Sequelize[_0x791a('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x791a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':_0x791a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x791a('0x2')]},'animation':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x791a('0x9'),_0x791a('0xa')),'defaultValue':_0x791a('0x9')},'header_online':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0xb')},'start_chat_button':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xc')},'header_offline':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x791a('0xf')]},'closingQuestion':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x13')},'ratingType':{'type':Sequelize[_0x791a('0x14')](_0x791a('0x15'),_0x791a('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return JSON[_0x791a('0x17')]({'items':[{'type':_0x791a('0x18'),'variable':null,'config':{'placeholder':_0x791a('0x19'),'type':_0x791a('0x1a'),'required':!![]},'props':{'title':_0x791a('0x19'),'helpText':''}},{'type':_0x791a('0x18'),'props':{'title':_0x791a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x791a('0x4'),'type':_0x791a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x791a('0x1b'))?JSON[_0x791a('0x1c')](this[_0x791a('0x1d')](_0x791a('0x1b'))):{};},'set':function(_0x4d748a){return this[_0x791a('0x1e')](_0x791a('0x1b'),JSON['stringify'](_0x4d748a));}},'offlineForm':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return JSON[_0x791a('0x17')]({'items':[{'type':_0x791a('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x791a('0x4'),'type':_0x791a('0x4')},'variable':null},{'type':_0x791a('0x1f'),'config':{'placeholder':_0x791a('0x20')},'props':{'title':_0x791a('0x20'),'helpText':_0x791a('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x791a('0x1d')](_0x791a('0x22'))?JSON['parse'](this[_0x791a('0x1d')](_0x791a('0x22'))):{};},'set':function(_0x1b10a7){return this['setDataValue'](_0x791a('0x22'),JSON['stringify'](_0x1b10a7));}},'token':{'type':Sequelize[_0x791a('0x2')],'defaultValue':function(){return rs[_0x791a('0x23')]();}},'autoclose':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x791a('0x2')]},'forwardOffline':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x24')},'waitingMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x791a('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x791a('0x28')},'sendUnmanaged':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x791a('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x791a('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x791a('0x2')]},'customerAvatar':{'type':Sequelize[_0x791a('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x791a('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x791a('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x791a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x791a('0x2')],'defaultValue':_0x791a('0x2b')},'systemAvatar':{'type':Sequelize[_0x791a('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x791a('0xd')],'comment':_0x791a('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x15f066){if(!_0x15f066)this[_0x791a('0x1e')](_0x791a('0x2d'),null);this['setDataValue'](_0x791a('0x2e'),_0x15f066);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x791a('0x2f')},'vidaooNote':{'type':Sequelize[_0x791a('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x791a('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x791a('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x791a('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index e5e7a5f..3d401e5 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 _0x2cdf=['orderBy','priority','asc','account','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','device','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','EventManager','offline','files','updatedAt','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','fromString','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','toPairsIn','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','custom','License','increment','chatLicenseExceeded','all','some','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','findAll','rows','params','Pause','includeAll','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','create','getDispositions','findOne','nolimit','ChatWebsiteId','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','include','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','ChatApplication','Applications','applications','list'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2cdf,0x1bb));var _0xf2cd=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x2cdf[_0x45d3f0];return _0x314b79;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0xf2cd('0x0'));var fs=require('fs');var fs_extra=require(_0xf2cd('0x1'));var _=require(_0xf2cd('0x2'));var querystring=require(_0xf2cd('0x3'));var Redis=require(_0xf2cd('0x4'));var qs=require(_0xf2cd('0x5'));var logger=require(_0xf2cd('0x6'))(_0xf2cd('0x7'));var config=require(_0xf2cd('0x8'));var db=require(_0xf2cd('0x9'))['db'];config[_0xf2cd('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf2cd('0xb'))(new Redis(config['redis']));require(_0xf2cd('0xc'))[_0xf2cd('0xd')](socket);var htmlToText=require(_0xf2cd('0xe'));var jayson=require(_0xf2cd('0xf'));var client=jayson[_0xf2cd('0x10')][_0xf2cd('0x11')]({'port':0x232c});var client9002=jayson['client'][_0xf2cd('0x11')]({'port':0x232a});var client9003=jayson[_0xf2cd('0x10')][_0xf2cd('0x11')]({'port':0x232b});var client9001=jayson[_0xf2cd('0x10')][_0xf2cd('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x5a8a84,_0x91dc3a,_0x26848b,_0x3725d2){return new BPromise(function(_0x45fb88,_0x390252){var _0x3f268e=_0x3725d2||client;return _0x3f268e['request'](_0x5a8a84,_0x26848b)[_0xf2cd('0x12')](function(_0x440e1b){logger[_0xf2cd('0x13')](_0xf2cd('0x14'),_0x91dc3a,_0xf2cd('0x15'));logger[_0xf2cd('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x91dc3a,'request\x20sent',JSON['stringify'](_0x440e1b));if(_0x440e1b[_0xf2cd('0x17')]){if(_0x440e1b[_0xf2cd('0x17')]['code']===0x1f4){logger[_0xf2cd('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x91dc3a,_0x440e1b['error'][_0xf2cd('0x18')]);return _0x390252(_0x440e1b[_0xf2cd('0x17')][_0xf2cd('0x18')]);}logger[_0xf2cd('0x17')](_0xf2cd('0x14'),_0x91dc3a,_0x440e1b[_0xf2cd('0x17')][_0xf2cd('0x18')]);return _0x45fb88(_0x440e1b[_0xf2cd('0x17')]['message']);}else{logger[_0xf2cd('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x91dc3a,_0xf2cd('0x15'));_0x45fb88(_0x440e1b[_0xf2cd('0x19')]['message']);}})[_0xf2cd('0x1a')](function(_0x40d57c){logger[_0xf2cd('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x91dc3a,_0x40d57c);_0x390252(_0x40d57c);});});}function respondWithStatusCode(_0x17fdd4,_0x550beb){_0x550beb=_0x550beb||0xcc;return function(_0xe87a79){if(_0xe87a79){return _0x17fdd4['sendStatus'](_0x550beb);}return _0x17fdd4[_0xf2cd('0x1b')](_0x550beb)[_0xf2cd('0x1c')]();};}function respondWithResult(_0x35c0f4,_0x45c1c1){_0x45c1c1=_0x45c1c1||0xc8;return function(_0x5005f7){if(_0x5005f7){return _0x35c0f4[_0xf2cd('0x1b')](_0x45c1c1)[_0xf2cd('0x1d')](_0x5005f7);}};}function respondWithFilteredResult(_0x205c05,_0x4198fc){return function(_0x2d8464){if(_0x2d8464){var _0x59d160=typeof _0x4198fc[_0xf2cd('0x1e')]==='undefined'&&typeof _0x4198fc[_0xf2cd('0x1f')]===_0xf2cd('0x20');var _0x49f8f0=_0x2d8464[_0xf2cd('0x21')];var _0x237d38=_0x59d160?0x0:_0x4198fc['offset'];var _0x3973a1=_0x59d160?_0x2d8464[_0xf2cd('0x21')]:_0x4198fc[_0xf2cd('0x1e')]+_0x4198fc[_0xf2cd('0x1f')];var _0x2d2d37;if(_0x3973a1>=_0x49f8f0){_0x3973a1=_0x49f8f0;_0x2d2d37=0xc8;}else{_0x2d2d37=0xce;}_0x205c05[_0xf2cd('0x1b')](_0x2d2d37);return _0x205c05[_0xf2cd('0x22')](_0xf2cd('0x23'),_0x237d38+'-'+_0x3973a1+'/'+_0x49f8f0)['json'](_0x2d8464);}return null;};}function saveUpdates(_0x538aad){return function(_0xc18bd2){if(_0xc18bd2){return _0xc18bd2[_0xf2cd('0x24')](_0x538aad)[_0xf2cd('0x12')](function(_0x2cca73){return _0x2cca73;});}return null;};}function removeEntity(_0x1f0445){return function(_0x4e326b){if(_0x4e326b){return _0x4e326b[_0xf2cd('0x25')]()['then'](function(){var _0x25f34c=_0x4e326b[_0xf2cd('0x26')]({'plain':!![]});var _0x3a2d2a='ChatWebsites';return db[_0xf2cd('0x27')]['destroy']({'where':{'type':_0x3a2d2a,'resourceId':_0x25f34c['id']}})['then'](function(){return _0x4e326b;});})[_0xf2cd('0x12')](function(){_0x1f0445['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf9939d){return function(_0x1c8a37){if(!_0x1c8a37){_0xf9939d[_0xf2cd('0x28')](0x194);}return _0x1c8a37;};}function handleError(_0x330d9b,_0x4bf7e5){_0x4bf7e5=_0x4bf7e5||0x1f4;return function(_0x5e812){logger[_0xf2cd('0x17')](_0x5e812[_0xf2cd('0x29')]);if(_0x5e812[_0xf2cd('0x2a')]){delete _0x5e812[_0xf2cd('0x2a')];}_0x330d9b[_0xf2cd('0x1b')](_0x4bf7e5)[_0xf2cd('0x2b')](_0x5e812);};}exports[_0xf2cd('0x2c')]=function(_0x6cef27,_0x4d13b8){var _0x520008={'include':[{'model':db['Pause'],'as':_0xf2cd('0x2d')}]},_0x38ef34={},_0x50624d={'count':0x0,'rows':[]};var _0x5e3eff=_['map'](db[_0xf2cd('0x2e')][_0xf2cd('0x2f')],function(_0x2862a2){return{'name':_0x2862a2[_0xf2cd('0x30')],'type':_0x2862a2['type'][_0xf2cd('0x31')]};});_0x38ef34[_0xf2cd('0x32')]=_['map'](_0x5e3eff,'name');_0x38ef34[_0xf2cd('0x33')]=_[_0xf2cd('0x34')](_0x6cef27[_0xf2cd('0x33')]);_0x38ef34['filters']=_[_0xf2cd('0x35')](_0x38ef34[_0xf2cd('0x32')],_0x38ef34[_0xf2cd('0x33')]);_0x520008[_0xf2cd('0x36')]=_[_0xf2cd('0x35')](_0x38ef34[_0xf2cd('0x32')],qs[_0xf2cd('0x37')](_0x6cef27['query']['fields']));_0x520008[_0xf2cd('0x36')]=_0x520008['attributes'][_0xf2cd('0x38')]?_0x520008[_0xf2cd('0x36')]:_0x38ef34['model'];if(!_0x6cef27['query'][_0xf2cd('0x39')]('nolimit')){_0x520008[_0xf2cd('0x1f')]=qs['limit'](_0x6cef27[_0xf2cd('0x33')][_0xf2cd('0x1f')]);_0x520008[_0xf2cd('0x1e')]=qs[_0xf2cd('0x1e')](_0x6cef27[_0xf2cd('0x33')][_0xf2cd('0x1e')]);}_0x520008[_0xf2cd('0x3a')]=qs[_0xf2cd('0x3b')](_0x6cef27['query'][_0xf2cd('0x3b')]);_0x520008['where']=qs[_0xf2cd('0x3c')](_[_0xf2cd('0x3d')](_0x6cef27[_0xf2cd('0x33')],_0x38ef34[_0xf2cd('0x3c')]),_0x5e3eff);if(_0x6cef27['query'][_0xf2cd('0x3e')]){_0x520008[_0xf2cd('0x3f')]=_[_0xf2cd('0x40')](_0x520008[_0xf2cd('0x3f')],{'$or':_['map'](_0x5e3eff,function(_0x401f37){if(_0x401f37[_0xf2cd('0x41')]!==_0xf2cd('0x42')){var _0x556a19={};_0x556a19[_0x401f37['name']]={'$like':'%'+_0x6cef27[_0xf2cd('0x33')][_0xf2cd('0x3e')]+'%'};return _0x556a19;}})});}_0x520008=_['merge']({},_0x520008,_0x6cef27[_0xf2cd('0x43')]);var _0x417a4e={'where':_0x520008[_0xf2cd('0x3f')]};return db[_0xf2cd('0x2e')]['count'](_0x417a4e)['then'](function(_0x4c14e1){_0x50624d[_0xf2cd('0x21')]=_0x4c14e1;if(_0x6cef27[_0xf2cd('0x33')]['includeAll']){_0x520008['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xf2cd('0x44')](_0x520008);})[_0xf2cd('0x12')](function(_0x2cf426){_0x50624d[_0xf2cd('0x45')]=_0x2cf426;return _0x50624d;})[_0xf2cd('0x12')](respondWithFilteredResult(_0x4d13b8,_0x520008))['catch'](handleError(_0x4d13b8,null));};exports['show']=function(_0x319887,_0x105034){var _0x5bbb53={'raw':![],'where':{'id':_0x319887[_0xf2cd('0x46')]['id']},'include':[{'model':db[_0xf2cd('0x47')],'as':'mandatoryDispositionPause'}]},_0x46479e={};_0x46479e['model']=_[_0xf2cd('0x34')](db[_0xf2cd('0x2e')][_0xf2cd('0x2f')]);_0x46479e[_0xf2cd('0x33')]=_[_0xf2cd('0x34')](_0x319887[_0xf2cd('0x33')]);_0x46479e[_0xf2cd('0x3c')]=_[_0xf2cd('0x35')](_0x46479e['model'],_0x46479e[_0xf2cd('0x33')]);_0x5bbb53[_0xf2cd('0x36')]=_['intersection'](_0x46479e[_0xf2cd('0x32')],qs[_0xf2cd('0x37')](_0x319887['query'][_0xf2cd('0x37')]));_0x5bbb53[_0xf2cd('0x36')]=_0x5bbb53['attributes'][_0xf2cd('0x38')]?_0x5bbb53['attributes']:_0x46479e[_0xf2cd('0x32')];if(_0x319887[_0xf2cd('0x33')][_0xf2cd('0x48')]){_0x5bbb53['include']=[{'all':!![]}];}_0x5bbb53=_[_0xf2cd('0x40')]({},_0x5bbb53,_0x319887[_0xf2cd('0x43')]);return db[_0xf2cd('0x2e')][_0xf2cd('0x49')](_0x5bbb53)['then'](handleEntityNotFound(_0x105034,null))[_0xf2cd('0x12')](respondWithResult(_0x105034,null))[_0xf2cd('0x1a')](handleError(_0x105034,null));};exports['create']=function(_0x3f9d49,_0x4215ab){return db[_0xf2cd('0x2e')]['create'](_0x3f9d49['body'],{})[_0xf2cd('0x12')](function(_0x27b1c6){var _0x4338d8=_0x3f9d49[_0xf2cd('0x4a')][_0xf2cd('0x26')]({'plain':!![]});if(!_0x4338d8)throw new Error(_0xf2cd('0x4b'));if(_0x4338d8[_0xf2cd('0x4c')]===_0xf2cd('0x4a')){var _0x5656c9=_0x27b1c6[_0xf2cd('0x26')]({'plain':!![]});var _0x98d2b7='ChatWebsites';return db[_0xf2cd('0x4d')]['find']({'where':{'name':_0x98d2b7,'userProfileId':_0x4338d8['userProfileId']},'raw':!![]})[_0xf2cd('0x12')](function(_0x3056ec){if(_0x3056ec&&_0x3056ec['autoAssociation']===0x0){return db[_0xf2cd('0x27')]['create']({'name':_0x5656c9[_0xf2cd('0x2a')],'resourceId':_0x5656c9['id'],'type':_0x3056ec[_0xf2cd('0x2a')],'sectionId':_0x3056ec['id']},{})[_0xf2cd('0x12')](function(){return _0x27b1c6;});}else{return _0x27b1c6;}})[_0xf2cd('0x1a')](function(_0x1b0432){logger['error'](_0xf2cd('0x4e'),_0x1b0432);throw _0x1b0432;});}return _0x27b1c6;})['then'](respondWithResult(_0x4215ab,0xc9))[_0xf2cd('0x1a')](handleError(_0x4215ab,null));};exports[_0xf2cd('0x24')]=function(_0x40775f,_0x3109a8){if(_0x40775f['body']['id']){delete _0x40775f[_0xf2cd('0x4f')]['id'];}return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'where':{'id':_0x40775f['params']['id']},'include':[{'model':db[_0xf2cd('0x47')],'as':'mandatoryDispositionPause'}]})[_0xf2cd('0x12')](handleEntityNotFound(_0x3109a8,null))[_0xf2cd('0x12')](saveUpdates(_0x40775f[_0xf2cd('0x4f')],null))['then'](respondWithResult(_0x3109a8,null))[_0xf2cd('0x1a')](handleError(_0x3109a8,null));};exports['destroy']=function(_0x2e7f93,_0x47f2d2){return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'where':{'id':_0x2e7f93[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x47f2d2,null))['then'](removeEntity(_0x47f2d2,null))[_0xf2cd('0x1a')](handleError(_0x47f2d2,null));};exports[_0xf2cd('0x50')]=function(_0x381367,_0x14e696){return db[_0xf2cd('0x2e')]['describe']()[_0xf2cd('0x12')](respondWithResult(_0x14e696,null))[_0xf2cd('0x1a')](handleError(_0x14e696,null));};exports[_0xf2cd('0x51')]=function(_0x8c43d0,_0x4e9d13){if(_0x8c43d0[_0xf2cd('0x4f')]['id']){delete _0x8c43d0['body']['id'];}return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'where':{'id':_0x8c43d0['params']['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x4e9d13,null))[_0xf2cd('0x12')](function(_0x39d9e0){if(_0x39d9e0){_0x8c43d0[_0xf2cd('0x4f')]['ChatWebsiteId']=_0x39d9e0['id'];return db[_0xf2cd('0x52')][_0xf2cd('0x53')](_0x8c43d0[_0xf2cd('0x4f')]);}})[_0xf2cd('0x12')](respondWithResult(_0x4e9d13,null))['catch'](handleError(_0x4e9d13,null));};exports[_0xf2cd('0x54')]=function(_0x14f760,_0x4c40f9){var _0x141a82={'raw':![],'where':{}};var _0x553e1a={};var _0x1255c9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf2cd('0x55')]({'where':{'id':_0x14f760[_0xf2cd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c40f9,null))[_0xf2cd('0x12')](function(_0x3b9627){if(_0x3b9627){_0x553e1a[_0xf2cd('0x32')]=_['keys'](db[_0xf2cd('0x52')][_0xf2cd('0x2f')]);_0x553e1a['query']=_[_0xf2cd('0x34')](_0x14f760[_0xf2cd('0x33')]);_0x553e1a[_0xf2cd('0x3c')]=_[_0xf2cd('0x35')](_0x553e1a['model'],_0x553e1a[_0xf2cd('0x33')]);_0x141a82[_0xf2cd('0x36')]=_[_0xf2cd('0x35')](_0x553e1a[_0xf2cd('0x32')],qs[_0xf2cd('0x37')](_0x14f760[_0xf2cd('0x33')][_0xf2cd('0x37')]));_0x141a82['attributes']=_0x141a82[_0xf2cd('0x36')][_0xf2cd('0x38')]?_0x141a82[_0xf2cd('0x36')]:_0x553e1a[_0xf2cd('0x32')];if(!_0x14f760[_0xf2cd('0x33')][_0xf2cd('0x39')](_0xf2cd('0x56'))){_0x141a82['limit']=qs['limit'](_0x14f760[_0xf2cd('0x33')]['limit']);_0x141a82['offset']=qs[_0xf2cd('0x1e')](_0x14f760['query'][_0xf2cd('0x1e')]);}_0x141a82[_0xf2cd('0x3a')]=qs[_0xf2cd('0x3b')](_0x14f760[_0xf2cd('0x33')][_0xf2cd('0x3b')]);_0x141a82[_0xf2cd('0x3f')]=qs[_0xf2cd('0x3c')](_[_0xf2cd('0x3d')](_0x14f760[_0xf2cd('0x33')],_0x553e1a['filters']));_0x141a82[_0xf2cd('0x3f')][_0xf2cd('0x57')]=_0x3b9627['id'];if(_0x14f760[_0xf2cd('0x33')][_0xf2cd('0x3e')]){_0x141a82[_0xf2cd('0x3f')]=_[_0xf2cd('0x40')](_0x141a82[_0xf2cd('0x3f')],{'$or':_[_0xf2cd('0x58')](_0x141a82[_0xf2cd('0x36')],function(_0x1d2b12){var _0x2f10b1={};_0x2f10b1[_0x1d2b12]={'$like':'%'+_0x14f760[_0xf2cd('0x33')][_0xf2cd('0x3e')]+'%'};return _0x2f10b1;})});}_0x141a82=_[_0xf2cd('0x40')]({},_0x141a82,_0x14f760[_0xf2cd('0x43')]);return db[_0xf2cd('0x52')][_0xf2cd('0x21')]({'where':_0x141a82[_0xf2cd('0x3f')]})[_0xf2cd('0x12')](function(_0x38091e){_0x1255c9[_0xf2cd('0x21')]=_0x38091e;if(_0x14f760['query']['includeAll']){_0x141a82['include']=[{'all':!![]}];}return db[_0xf2cd('0x52')][_0xf2cd('0x44')](_0x141a82);})[_0xf2cd('0x12')](function(_0x147a3c){_0x1255c9[_0xf2cd('0x45')]=_0x147a3c;return _0x1255c9;});}})['then'](respondWithFilteredResult(_0x4c40f9,_0x141a82))['catch'](handleError(_0x4c40f9,null));};exports['removeDispositions']=function(_0x54f374,_0x52f2e0){return db['ChatWebsite']['find']({'where':{'id':_0x54f374[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x52f2e0,null))[_0xf2cd('0x12')](function(_0x50184e){if(_0x50184e){return _0x50184e[_0xf2cd('0x59')](_0x54f374['query'][_0xf2cd('0x5a')]);}})[_0xf2cd('0x12')](respondWithStatusCode(_0x52f2e0,null))[_0xf2cd('0x1a')](handleError(_0x52f2e0,null));};exports[_0xf2cd('0x5b')]=function(_0x37a47c,_0x1c5aa5){if(_0x37a47c[_0xf2cd('0x4f')]['id']){delete _0x37a47c[_0xf2cd('0x4f')]['id'];}return db[_0xf2cd('0x2e')]['find']({'where':{'id':_0x37a47c[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x1c5aa5,null))[_0xf2cd('0x12')](function(_0x3f6bec){if(_0x3f6bec){_0x37a47c[_0xf2cd('0x4f')][_0xf2cd('0x57')]=_0x3f6bec['id'];return db[_0xf2cd('0x5c')][_0xf2cd('0x53')](_0x37a47c[_0xf2cd('0x4f')]);}})[_0xf2cd('0x12')](respondWithResult(_0x1c5aa5,null))['catch'](handleError(_0x1c5aa5,null));};exports[_0xf2cd('0x5d')]=function(_0x3c329a,_0x79468f){var _0x468ae9={'raw':![],'where':{}};var _0x224a96={};var _0x5370c3={'count':0x0,'rows':[]};return db[_0xf2cd('0x2e')][_0xf2cd('0x55')]({'where':{'id':_0x3c329a[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x79468f,null))[_0xf2cd('0x12')](function(_0x1a17c){if(_0x1a17c){_0x224a96['model']=_[_0xf2cd('0x34')](db['CannedAnswer'][_0xf2cd('0x2f')]);_0x224a96[_0xf2cd('0x33')]=_['keys'](_0x3c329a[_0xf2cd('0x33')]);_0x224a96[_0xf2cd('0x3c')]=_[_0xf2cd('0x35')](_0x224a96[_0xf2cd('0x32')],_0x224a96[_0xf2cd('0x33')]);_0x468ae9[_0xf2cd('0x36')]=_[_0xf2cd('0x35')](_0x224a96['model'],qs['fields'](_0x3c329a[_0xf2cd('0x33')][_0xf2cd('0x37')]));_0x468ae9[_0xf2cd('0x36')]=_0x468ae9[_0xf2cd('0x36')]['length']?_0x468ae9[_0xf2cd('0x36')]:_0x224a96['model'];if(!_0x3c329a[_0xf2cd('0x33')][_0xf2cd('0x39')](_0xf2cd('0x56'))){_0x468ae9[_0xf2cd('0x1f')]=qs[_0xf2cd('0x1f')](_0x3c329a['query'][_0xf2cd('0x1f')]);_0x468ae9[_0xf2cd('0x1e')]=qs['offset'](_0x3c329a[_0xf2cd('0x33')][_0xf2cd('0x1e')]);}_0x468ae9['order']=qs[_0xf2cd('0x3b')](_0x3c329a[_0xf2cd('0x33')][_0xf2cd('0x3b')]);_0x468ae9[_0xf2cd('0x3f')]=qs[_0xf2cd('0x3c')](_['pick'](_0x3c329a[_0xf2cd('0x33')],_0x224a96[_0xf2cd('0x3c')]));_0x468ae9[_0xf2cd('0x3f')][_0xf2cd('0x57')]=_0x1a17c['id'];if(_0x3c329a[_0xf2cd('0x33')][_0xf2cd('0x3e')]){_0x468ae9[_0xf2cd('0x3f')]=_[_0xf2cd('0x40')](_0x468ae9[_0xf2cd('0x3f')],{'$or':_['map'](_0x468ae9[_0xf2cd('0x36')],function(_0xe896f7){var _0x5597f4={};_0x5597f4[_0xe896f7]={'$like':'%'+_0x3c329a[_0xf2cd('0x33')][_0xf2cd('0x3e')]+'%'};return _0x5597f4;})});}_0x468ae9=_[_0xf2cd('0x40')]({},_0x468ae9,_0x3c329a['options']);return db[_0xf2cd('0x5c')][_0xf2cd('0x21')]({'where':_0x468ae9[_0xf2cd('0x3f')]})[_0xf2cd('0x12')](function(_0x4612d3){_0x5370c3[_0xf2cd('0x21')]=_0x4612d3;if(_0x3c329a['query'][_0xf2cd('0x48')]){_0x468ae9[_0xf2cd('0x5e')]=[{'all':!![]}];}return db[_0xf2cd('0x5c')][_0xf2cd('0x44')](_0x468ae9);})[_0xf2cd('0x12')](function(_0x220122){_0x5370c3['rows']=_0x220122;return _0x5370c3;});}})['then'](respondWithFilteredResult(_0x79468f,_0x468ae9))[_0xf2cd('0x1a')](handleError(_0x79468f,null));};exports[_0xf2cd('0x5f')]=function(_0xb81102,_0x42dfe9){return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'where':{'id':_0xb81102[_0xf2cd('0x46')]['id']}})['then'](handleEntityNotFound(_0x42dfe9,null))[_0xf2cd('0x12')](function(_0xb30594){if(_0xb30594){return _0xb30594[_0xf2cd('0x5f')](_0xb81102['query'][_0xf2cd('0x5a')]);}})[_0xf2cd('0x12')](respondWithStatusCode(_0x42dfe9,null))['catch'](handleError(_0x42dfe9,null));};exports[_0xf2cd('0x60')]=function(_0x2a727a,_0x2419d4){_0x2a727a[_0xf2cd('0x4f')][_0xf2cd('0x61')]=_0x2a727a[_0xf2cd('0x62')][_0xf2cd('0x63')];return db['ChatWebsite'][_0xf2cd('0x49')]({'where':{'id':_0x2a727a[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x2419d4,null))[_0xf2cd('0x12')](saveUpdates(_0x2a727a[_0xf2cd('0x4f')],null))[_0xf2cd('0x12')](respondWithResult(_0x2419d4,null))[_0xf2cd('0x1a')](handleError(_0x2419d4,null));};exports[_0xf2cd('0x64')]=function(_0x190bcf,_0x2b4b70){_0x190bcf['body'][_0xf2cd('0x65')]=_0x190bcf[_0xf2cd('0x62')][_0xf2cd('0x63')];return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'where':{'id':_0x190bcf[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x2b4b70,null))[_0xf2cd('0x12')](saveUpdates(_0x190bcf[_0xf2cd('0x4f')],null))[_0xf2cd('0x12')](respondWithResult(_0x2b4b70,null))['catch'](handleError(_0x2b4b70,null));};exports[_0xf2cd('0x66')]=function(_0x2d3c5c,_0x5b1cef){_0x2d3c5c[_0xf2cd('0x4f')][_0xf2cd('0x67')]=_0x2d3c5c[_0xf2cd('0x62')][_0xf2cd('0x63')];return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'where':{'id':_0x2d3c5c[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x5b1cef,null))[_0xf2cd('0x12')](saveUpdates(_0x2d3c5c['body'],null))[_0xf2cd('0x12')](respondWithResult(_0x5b1cef,null))['catch'](handleError(_0x5b1cef,null));};exports[_0xf2cd('0x68')]=function(_0x2d6523,_0x564bb7){_0x2d6523[_0xf2cd('0x4f')][_0xf2cd('0x69')]=_0x2d6523[_0xf2cd('0x62')][_0xf2cd('0x63')];return db['ChatWebsite'][_0xf2cd('0x49')]({'where':{'id':_0x2d6523[_0xf2cd('0x46')]['id']}})['then'](handleEntityNotFound(_0x564bb7,null))[_0xf2cd('0x12')](saveUpdates(_0x2d6523[_0xf2cd('0x4f')],null))[_0xf2cd('0x12')](respondWithResult(_0x564bb7,null))[_0xf2cd('0x1a')](handleError(_0x564bb7,null));};exports[_0xf2cd('0x6a')]=function(_0x9d4709,_0x294e30){var _0x1df45e=path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0x6d'));var _0x5679d2={'where':{'id':_0x9d4709[_0xf2cd('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x53452c=![];return require(_0xf2cd('0x6e'))[_0xf2cd('0x6f')]()[_0xf2cd('0x12')](function(_0x4b1b21){if(_0x4b1b21){_0x53452c=_0x4b1b21['custom'];}})[_0xf2cd('0x12')](function(){return db['ChatWebsite'][_0xf2cd('0x49')](_0x5679d2);})[_0xf2cd('0x12')](handleEntityNotFound(_0x294e30,null))[_0xf2cd('0x12')](function(_0x193827){if(_0x193827){if(!_[_0xf2cd('0x70')](_0x193827['sitepic'])){if(fs[_0xf2cd('0x71')](path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0x72'),_0x193827[_0xf2cd('0x61')]))&&_0x53452c){_0x1df45e=path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0x72'),_0x193827[_0xf2cd('0x61')]);}}return _0x294e30[_0xf2cd('0x73')](_0x1df45e);}})[_0xf2cd('0x1a')](handleError(_0x294e30,null));};exports[_0xf2cd('0x74')]=function(_0x53dc57,_0x3606a6){var _0x4044aa=path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0x75'));var _0x2672c2={'where':{'id':_0x53dc57[_0xf2cd('0x46')]['id']},'attributes':['id',_0xf2cd('0x65')],'raw':!![]};return db[_0xf2cd('0x2e')][_0xf2cd('0x49')](_0x2672c2)[_0xf2cd('0x12')](handleEntityNotFound(_0x3606a6,null))[_0xf2cd('0x12')](function(_0x3d6587){if(_0x3d6587){if(!_['isNil'](_0x3d6587[_0xf2cd('0x65')])){if(fs[_0xf2cd('0x71')](path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],'server/files/images/avatars/',_0x3d6587['agentAvatar']))){_0x4044aa=path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0x76'),_0x3d6587[_0xf2cd('0x65')]);}}return _0x3606a6[_0xf2cd('0x73')](_0x4044aa);}})[_0xf2cd('0x1a')](handleError(_0x3606a6,null));};exports['getCustomerAvatar']=function(_0x8fb1b6,_0x260874){var _0x4b73de=path['join'](config[_0xf2cd('0x6c')],_0xf2cd('0x77'));var _0x142bae={'where':{'id':_0x8fb1b6[_0xf2cd('0x46')]['id']},'attributes':['id',_0xf2cd('0x67'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xf2cd('0x49')](_0x142bae)['then'](handleEntityNotFound(_0x260874,null))['then'](function(_0x1d0efc){if(_0x1d0efc){if(!_[_0xf2cd('0x70')](_0x1d0efc['customerAvatar'])){if(fs['existsSync'](path[_0xf2cd('0x6b')](config['root'],_0xf2cd('0x76'),_0x1d0efc['customerAvatar']))&&_0x1d0efc[_0xf2cd('0x78')]){_0x4b73de=path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0x76'),_0x1d0efc[_0xf2cd('0x67')]);}}return _0x260874[_0xf2cd('0x73')](_0x4b73de);}})['catch'](handleError(_0x260874,null));};exports[_0xf2cd('0x79')]=function(_0x47136f,_0x303357){var _0x55f0d3=path['join'](config[_0xf2cd('0x6c')],_0xf2cd('0x7a'));var _0x30bdcf={'where':{'id':_0x47136f[_0xf2cd('0x46')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xf2cd('0x2e')][_0xf2cd('0x49')](_0x30bdcf)[_0xf2cd('0x12')](handleEntityNotFound(_0x303357,null))['then'](function(_0x1e1ee1){if(_0x1e1ee1){if(!_[_0xf2cd('0x70')](_0x1e1ee1[_0xf2cd('0x69')])){if(fs[_0xf2cd('0x71')](path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0x76'),_0x1e1ee1[_0xf2cd('0x69')]))){_0x55f0d3=path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0x76'),_0x1e1ee1['systemAvatar']);}}return _0x303357['download'](_0x55f0d3);}})['catch'](handleError(_0x303357,null));};exports[_0xf2cd('0x7b')]=function(_0x4e019e,_0x471e60){var _0xab5708=require('user-agent-parser');var _0x31c732=new _0xab5708();var _0x18ba1e=_0x31c732[_0xf2cd('0x7c')](_0x4e019e[_0xf2cd('0x7d')][_0xf2cd('0x7e')])[_0xf2cd('0x7f')]();var _0xdf6019={'body':_0x4e019e['body'],'channel':'chat'};var _0x4d71f2=[];var _0x4b1a4a=[];var _0x4ccac8={};var _0x1ff5f7=![];return db[_0xf2cd('0x80')][_0xf2cd('0x50')]()['then'](function(_0x1a77a5){if(!_0x1a77a5){throw new db[(_0xf2cd('0x81'))][(_0xf2cd('0x82'))](_0xf2cd('0x83'));}_0x4d71f2=_[_0xf2cd('0x84')](_[_0xf2cd('0x34')](_0x1a77a5),[_0xf2cd('0x85'),'updatedAt']);_0x4b1a4a=_['difference'](_[_0xf2cd('0x34')](_0x1a77a5),[_0xf2cd('0x85'),'updatedAt',_0xf2cd('0x86'),_0xf2cd('0x87')]);if(_0x4e019e[_0xf2cd('0x4f')]['id']){delete _0x4e019e['body']['id'];}if(_[_0xf2cd('0x70')](_0x4e019e[_0xf2cd('0x4f')]['from'])){throw new db[(_0xf2cd('0x81'))][(_0xf2cd('0x82'))](_0xf2cd('0x88'));}if(_['isNil'](_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0x4f')])||_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0x4f')]===''){throw new db[(_0xf2cd('0x81'))][(_0xf2cd('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf2cd('0x70')](_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0x89')])){throw new db[(_0xf2cd('0x81'))][(_0xf2cd('0x82'))](_0xf2cd('0x8a')+_0x4b1a4a);}if(!_[_0xf2cd('0x8b')](_0x4b1a4a,_0x4e019e[_0xf2cd('0x4f')]['mapKey'])){throw new db['Sequelize'][(_0xf2cd('0x82'))](_0xf2cd('0x8c')+_0x4b1a4a);}_0x4ccac8[_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0x89')]]=_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0x8d')];})['then'](function(){return db[_0xf2cd('0x2e')]['find']({'where':{'id':_0x4e019e['params']['id']},'include':[{'model':db[_0xf2cd('0x8e')],'as':_0xf2cd('0x8f'),'include':[{'model':db[_0xf2cd('0x80')],'as':_0xf2cd('0x90'),'where':_0x4ccac8,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xf2cd('0x91')],'as':_0xf2cd('0x92')}]});})[_0xf2cd('0x12')](handleEntityNotFound(_0x471e60,null))['then'](function(_0x1acb56){if(_0x1acb56&&_0x1acb56[_0xf2cd('0x8f')]){_0xdf6019['account']=_0x1acb56;_0xdf6019[_0xf2cd('0x93')]=_0x1acb56[_0xf2cd('0x92')];_0xdf6019[_0xf2cd('0x94')]=_0x1acb56[_0xf2cd('0x8f')];_0xdf6019['applications']=_[_0xf2cd('0x95')](_0xdf6019[_0xf2cd('0x93')],[_0xf2cd('0x96')],[_0xf2cd('0x97')]);if(_0xdf6019[_0xf2cd('0x98')][_0xf2cd('0x92')]){delete _0xdf6019[_0xf2cd('0x98')][_0xf2cd('0x92')];}if(_0xdf6019[_0xf2cd('0x98')]['List']&&_0xdf6019['account'][_0xf2cd('0x8f')][_0xf2cd('0x90')][_0xf2cd('0x38')]){return _0xdf6019[_0xf2cd('0x98')][_0xf2cd('0x8f')][_0xf2cd('0x90')][0x0];}var _0x3527ad=_[_0xf2cd('0x99')](_0x4e019e[_0xf2cd('0x4f')],{'firstName':_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0x8d')],'ListId':_0x1acb56[_0xf2cd('0x87')]});_0x3527ad[_0x4e019e['body'][_0xf2cd('0x89')]]=_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0x8d')];return db[_0xf2cd('0x80')][_0xf2cd('0x53')](_0x3527ad,{'fields':_0x4d71f2,'raw':!![]});}})['then'](handleEntityNotFound(_0x471e60,null))[_0xf2cd('0x12')](function(_0x1aa028){_0xdf6019[_0xf2cd('0x9a')]=_0x1aa028;var _0x20853d=_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0x9b')];if(_0x4e019e[_0xf2cd('0x7d')][_0xf2cd('0x9c')]){_0x20853d=_0x4e019e[_0xf2cd('0x7d')][_0xf2cd('0x9c')];}else if(_0x4e019e[_0xf2cd('0x7d')][_0xf2cd('0x9d')]){_0x20853d=_[_0xf2cd('0x9e')](_0x4e019e[_0xf2cd('0x7d')][_0xf2cd('0x9d')][_0xf2cd('0x9f')](','));}if(_0x1aa028){var _0x2a2fa5={'ContactId':_0x1aa028['id'],'ChatWebsiteId':_0x4e019e[_0xf2cd('0x46')]['id'],'from':(_0x1aa028[_0xf2cd('0xa0')]||'')+'\x20'+(_0x1aa028[_0xf2cd('0xa1')]||''),'customerIp':_0x20853d,'customerPort':_0x4e019e[_0xf2cd('0x7d')]['x-real-port']?_0x4e019e[_0xf2cd('0x7d')][_0xf2cd('0xa2')]:null,'referer':_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xa3')],'browserName':_0x18ba1e[_0xf2cd('0xa4')][_0xf2cd('0x2a')]&&_0x18ba1e[_0xf2cd('0xa4')][_0xf2cd('0xa5')]?util[_0xf2cd('0xa6')](_0xf2cd('0xa7'),_0x18ba1e[_0xf2cd('0xa4')][_0xf2cd('0x2a')],_0x18ba1e[_0xf2cd('0xa4')]['version']):_0xf2cd('0xa8'),'browserVersion':_0x18ba1e[_0xf2cd('0xa4')]['version']||_0xf2cd('0xa8'),'osName':util[_0xf2cd('0xa6')](_0xf2cd('0xa7'),_0x18ba1e['os'][_0xf2cd('0x2a')],_0x18ba1e['os'][_0xf2cd('0xa5')]),'osVersion':_0x18ba1e['os'][_0xf2cd('0xa5')],'deviceModel':_0x18ba1e['device'][_0xf2cd('0x32')]&&_0x18ba1e['device'][_0xf2cd('0xa9')]?util[_0xf2cd('0xa6')]('%s\x20%s\x20%s',_0x18ba1e[_0xf2cd('0xaa')]['model'],_0x18ba1e['device'][_0xf2cd('0xa9')],_0x18ba1e[_0xf2cd('0xaa')]['type']):null,'deviceVendor':_0x18ba1e['device']['vendor'],'deviceType':_0x18ba1e['device'][_0xf2cd('0x41')],'formData':JSON[_0xf2cd('0xab')](_0x4e019e[_0xf2cd('0x4f')])};var _0x1b3025={'ChatWebsiteId':_0x4e019e['params']['id'],'closed':![]};if(_0x4e019e['body'][_0xf2cd('0xac')]){_0x1b3025[_0xf2cd('0xac')]=_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xac')];return db['ChatInteraction']['find']({'where':_0x1b3025})['then'](function(_0x16c682){if(_0x16c682){return[_0x16c682,![]];}_0x2a2fa5['threadId']=_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xac')];_0x2a2fa5['externalUrl']=_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xad')];return db[_0xf2cd('0xae')][_0xf2cd('0x53')](_0x2a2fa5)[_0xf2cd('0x12')](function(_0x8f74b){return[_0x8f74b,!![]];});});}_0x1b3025[_0xf2cd('0xaf')]=_0x1aa028['id'];if(_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xb0')]&&_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xb0')]['id']){_0x1b3025['id']=_0x4e019e['body'][_0xf2cd('0xb0')]['id'];return db['ChatInteraction'][_0xf2cd('0x49')]({'where':_0x1b3025})[_0xf2cd('0x12')](function(_0xcaca2){if(_0xcaca2){return[_0xcaca2,![]];}return db['ChatInteraction'][_0xf2cd('0x53')](_0x2a2fa5)['then'](function(_0x2e2bec){return[_0x2e2bec,!![]];});});}return db['ChatInteraction'][_0xf2cd('0x53')](_0x2a2fa5)[_0xf2cd('0x12')](function(_0x398c56){return[_0x398c56,!![]];});}})[_0xf2cd('0xb1')](function(_0x1fb3c7,_0x1b5e07){if(_0x1fb3c7){_0x1ff5f7=_0x1b5e07;if(!_0x1b5e07){var _0x102521={'from':(_0xdf6019['contact']['firstName']||'')+'\x20'+(_0xdf6019[_0xf2cd('0x9a')]['lastName']||'')};if(_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xac')]&&_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xb2')]&&_0x4e019e['body'][_0xf2cd('0xac')]!=_0x4e019e[_0xf2cd('0x4f')][_0xf2cd('0xb2')]){_0x102521[_0xf2cd('0xac')]=_0x4e019e[_0xf2cd('0x4f')]['messageId'];}return _0x1fb3c7[_0xf2cd('0x24')](_0x102521);}else{return _0x1fb3c7;}}})[_0xf2cd('0x12')](function(_0x1fe06a){_0xdf6019[_0xf2cd('0xb0')]=_0x1fe06a[_0xf2cd('0x26')]({'plain':!![]});_0xdf6019[_0xf2cd('0xb0')][_0xf2cd('0xb3')]=_0x1ff5f7;if(_0xdf6019[_0xf2cd('0xb0')][_0xf2cd('0xb3')]){if(_0xdf6019[_0xf2cd('0x98')][_0xf2cd('0xb4')]){_0xdf6019[_0xf2cd('0x93')][_0xf2cd('0xb5')]({'id':0x0,'priority':_0xdf6019[_0xf2cd('0x93')][_0xf2cd('0x38')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xf2cd('0xb6')});}}return db[_0xf2cd('0xb7')]['create']({'body':_0x4e019e['body'][_0xf2cd('0x4f')],'ChatWebsiteId':_0x4e019e[_0xf2cd('0x46')]['id'],'ChatInteractionId':_0x1fe06a['id'],'direction':'in','ContactId':_0xdf6019[_0xf2cd('0x9a')]['id'],'AttachmentId':_0x4e019e['body'][_0xf2cd('0xb8')]});})[_0xf2cd('0x12')](function(_0x356e51){_0xdf6019['message']=_0x356e51;if(_0xdf6019[_0xf2cd('0xb0')][_0xf2cd('0xb9')]){return db[_0xf2cd('0xba')][_0xf2cd('0x49')]({'attributes':['id',_0xf2cd('0x2a')],'where':{'id':_0xdf6019[_0xf2cd('0xb0')][_0xf2cd('0xb9')]}})[_0xf2cd('0x12')](function(_0x47d985){if(_0x47d985){_0xdf6019[_0xf2cd('0x93')][_0xf2cd('0xbb')]({'id':0x0,'priority':0x0,'app':_0xf2cd('0xbc'),'appdata':_0x47d985['name']+','+(_0xdf6019[_0xf2cd('0x98')][_0xf2cd('0xbd')]||0xa),'interval':_0xf2cd('0xb6')});_0xdf6019['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0xf2cd('0xbe'),_0xdf6019);});}return respondWithRpcPromise('Start',_0xf2cd('0xbe'),_0xdf6019);})['then'](function(_0x5a3f73){respondWithRpcPromise(_0xf2cd('0xbf'),_0xf2cd('0xbf'),{'event':'notify','message':_0x5a3f73},client9002);return _0x5a3f73;})[_0xf2cd('0x12')](respondWithResult(_0x471e60,null))['catch'](handleError(_0x471e60,null));};exports[_0xf2cd('0xc0')]=function(_0x48f880,_0x22f43b){var _0x921dab,_0x589a87,_0x15e808;var _0x181f50=[];var _0x5534c0={};var _0x29631c=_0x48f880[_0xf2cd('0xc1')]||[];var _0xe2c325=[];var _0x5ccb5b;return db[_0xf2cd('0x80')][_0xf2cd('0x50')]()['then'](function(_0x16b678){if(!_0x16b678){throw new db['Sequelize'][(_0xf2cd('0x82'))](_0xf2cd('0x83'));}_0x181f50=_[_0xf2cd('0x84')](_[_0xf2cd('0x34')](_0x16b678),[_0xf2cd('0x85'),_0xf2cd('0xc2'),_0xf2cd('0x86'),'ListId']);if(_0x48f880[_0xf2cd('0x4f')]['id']){delete _0x48f880[_0xf2cd('0x4f')]['id'];}if(_[_0xf2cd('0x70')](_0x48f880['body'][_0xf2cd('0x8d')])){throw _0x22f43b[_0xf2cd('0x1b')](0x1f4)[_0xf2cd('0x2b')](new db[(_0xf2cd('0x81'))][(_0xf2cd('0x82'))](_0xf2cd('0x88')));}if(_['isNil'](_0x48f880['body']['body'])||_0x48f880['body'][_0xf2cd('0x4f')]===''){throw _0x22f43b[_0xf2cd('0x1b')](0x1f4)[_0xf2cd('0x2b')](new db['Sequelize'][(_0xf2cd('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf2cd('0x70')](_0x48f880[_0xf2cd('0x4f')]['mapKeyOffline'])){throw _0x22f43b[_0xf2cd('0x1b')](0x1f4)[_0xf2cd('0x2b')](new db[(_0xf2cd('0x81'))][(_0xf2cd('0x82'))](_0xf2cd('0xc3')+_0x181f50));}if(!_['includes'](_0x181f50,_0x48f880[_0xf2cd('0x4f')]['mapKeyOffline'])){throw _0x22f43b[_0xf2cd('0x1b')](0x1f4)[_0xf2cd('0x2b')](new db[(_0xf2cd('0x81'))][(_0xf2cd('0x82'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x181f50));}_0x5534c0[_0x48f880[_0xf2cd('0x4f')][_0xf2cd('0xc4')]]=_0x48f880[_0xf2cd('0x4f')][_0xf2cd('0x8d')];})[_0xf2cd('0x12')](function(){return db[_0xf2cd('0x2e')]['find']({'where':{'id':_0x48f880[_0xf2cd('0x46')]['id']},'include':[{'model':db[_0xf2cd('0x8e')],'as':_0xf2cd('0x8f')},{'model':db[_0xf2cd('0xc5')],'as':_0xf2cd('0xc5')}]});})['then'](handleEntityNotFound(_0x22f43b,null))[_0xf2cd('0x12')](function(_0x94e4d8){if(_0x94e4d8&&_0x94e4d8['List']){_0x589a87=_0x94e4d8;var _0x310031=_[_0xf2cd('0x99')](_0x48f880[_0xf2cd('0x4f')],{'firstName':_0x48f880[_0xf2cd('0x4f')][_0xf2cd('0x8d')],'phone':_0x48f880['body'][_0xf2cd('0x8d')],'ListId':_0x94e4d8['ListId']});_0x310031[_0x48f880[_0xf2cd('0x4f')][_0xf2cd('0xc4')]]=_0x48f880['body'][_0xf2cd('0x8d')];return db[_0xf2cd('0x80')][_0xf2cd('0xc6')]({'where':_0x5534c0,'defaults':_0x310031});}})[_0xf2cd('0xb1')](function(_0x13ee92){if(_0x13ee92){_0x15e808=_0x13ee92;var _0x37f8b3=fs[_0xf2cd('0xc7')](path[_0xf2cd('0x6b')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xf2cd('0xc8'));var _0x1909f3=ejs[_0xf2cd('0xc9')](_0x37f8b3,{'body':_[_0xf2cd('0xca')](_0x48f880[_0xf2cd('0x4f')][_0xf2cd('0x4f')]),'bodyTitle':_0x589a87[_0xf2cd('0xcb')]});return db['ChatOfflineMessage'][_0xf2cd('0x53')]({'body':_0x1909f3,'plainBody':htmlToText[_0xf2cd('0xcc')](_0x1909f3),'ContactId':_0x13ee92['id'],'ChatWebsiteId':_0x589a87['id']});}})[_0xf2cd('0x12')](function(_0x46cf13){_0x5ccb5b=_0x46cf13;if(_0x29631c[_0xf2cd('0x38')]){var _0x453aa0=_0x29631c[_0xf2cd('0x58')](function(_0x1dcab4){return{'name':_0x1dcab4['originalname'],'basename':_0x1dcab4[_0xf2cd('0x63')],'type':_0x1dcab4[_0xf2cd('0xcd')],'ChatOfflineMessageId':_0x46cf13['id']};});_0xe2c325=_0x453aa0[_0xf2cd('0x58')](_0x5c07d7=>{var _0xb6caed={'filename':_0x5c07d7[_0xf2cd('0x2a')],'path':path[_0xf2cd('0x6b')](config[_0xf2cd('0x6c')],_0xf2cd('0xce'),_0xf2cd('0xc1'),_0xf2cd('0xcf'),_0xf2cd('0xd0'),_0x5c07d7[_0xf2cd('0xd1')])};return _0xb6caed;});if(!_0x589a87[_0xf2cd('0xd2')]){return db[_0xf2cd('0xd3')][_0xf2cd('0xd4')](function(_0x1397cf){return db['Attachment'][_0xf2cd('0xd5')](_0x453aa0,{'transaction':_0x1397cf});});}}})['then'](function(){if(_0x5ccb5b){_0x921dab=_0x5ccb5b;return db['MailAccount'][_0xf2cd('0x55')]({'where':{'service':!![]},'include':[{'model':db[_0xf2cd('0xd6')],'as':_0xf2cd('0xd7'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xf2cd('0xd8'),'raw':!![]}]}]});}})['then'](function(_0x1d6513){if(_0x1d6513&&_0x1d6513[_0xf2cd('0xd7')]&&_0x589a87['forwardOffline']&&_0x589a87['forwardOfflineAddress']){var _0x519efa=_0x1d6513['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x519efa,'message':{'from':util[_0xf2cd('0xa6')](_0xf2cd('0xd9'),_0x1d6513[_0xf2cd('0x2a')],_0x1d6513[_0xf2cd('0xda')]||_0x1d6513[_0xf2cd('0xd7')][_0xf2cd('0x4a')]),'to':_0x589a87[_0xf2cd('0xdb')],'subject':_0x589a87[_0xf2cd('0xdc')],'html':_0x921dab[_0xf2cd('0x4f')],'attachments':_0xe2c325}},client9003)['then'](function(){return _0x921dab;})[_0xf2cd('0x1a')](function(_0x2bf15f){logger[_0xf2cd('0x17')](_0x2bf15f);});}})['then'](function(){if(_0x589a87&&_0x589a87[_0xf2cd('0xd2')]&&_0x589a87[_0xf2cd('0xdd')]){var _0x53ea75=[];if(_0x29631c[_0xf2cd('0x38')]){_0x53ea75=_0x29631c['map'](function(_0x40e1a6){return{'name':_0x40e1a6[_0xf2cd('0xde')],'basename':_0x40e1a6[_0xf2cd('0x63')],'type':_0x40e1a6[_0xf2cd('0xcd')],'ChatOfflineMessageId':_0x5ccb5b['id']};});}var _0x427650;if(!_[_0xf2cd('0x70')](_0x589a87['subjectOffline'])){var _0x531d9f=_['map'](_0x48f880['body'],function(_0x565e23){return _0x565e23;});var _0x227e17=_[_0xf2cd('0xdf')](_0x531d9f)[0x0];var _0xbf6f4=_['mapValues'](_0x227e17,function(_0x5adefb){return _0x5adefb;});_0x427650=_0xbf6f4[0x1][_0x589a87['subjectOffline']];}var _0x2ea0fa={'from':_0x15e808[_0xf2cd('0xda')],'firstName':_0x15e808[_0xf2cd('0xa0')],'lastName':_0x15e808[_0xf2cd('0xa1')],'mapKey':_0xf2cd('0xda'),'message':{'from':_0x15e808[_0xf2cd('0xda')],'to':_0x589a87[_0xf2cd('0xc5')][_0xf2cd('0xda')],'cc':'','subject':_[_0xf2cd('0x70')](_0x427650)?_0x589a87[_0xf2cd('0xdc')]:_0x427650,'messageId':'','sentAt':new Date(),'attach':_0x53ea75[_0xf2cd('0x38')],'attachments':_0x53ea75,'originChannel':_0xf2cd('0xe0'),'ChatWebsiteId':_0x589a87['id'],'ChatOfflineMessageId':_0x921dab['id'],'originTo':_0x589a87[_0xf2cd('0xc5')]['email']},'body':_0x921dab[_0xf2cd('0x4f')]};var _0x3adc99={'account':{'id':_0x589a87['MailAccountId']},'body':_0x2ea0fa,'log':_0xf2cd('0xe1')};return respondWithRpcPromise(_0xf2cd('0xe1'),_0xf2cd('0xe2'),_0x3adc99,client9001)['then'](function(){return _0x921dab;})[_0xf2cd('0x1a')](function(_0x4e9798){logger[_0xf2cd('0x17')](_0x4e9798);});}return;})[_0xf2cd('0x12')](function(){if(_0x921dab){return _0x921dab;}})[_0xf2cd('0x12')](respondWithResult(_0x22f43b,null))[_0xf2cd('0x1a')](function(_0x3242bc){logger[_0xf2cd('0x17')](_0xf2cd('0x1a'),_0x3242bc);for(var _0x5bbb5a of _0x29631c){var _0x5d5d99=path[_0xf2cd('0x6b')](config['root'],_0xf2cd('0xce'),_0xf2cd('0xc1'),_0xf2cd('0xcf'),_0xf2cd('0xd0'),_0x5bbb5a[_0xf2cd('0x63')]);fs_extra[_0xf2cd('0xe3')](_0x5d5d99)[_0xf2cd('0x1a')](function(_0x4d45c9){logger[_0xf2cd('0x17')](_0xf2cd('0xe4'),_0x5d5d99,_0x4d45c9);});}});};exports[_0xf2cd('0xe5')]=function(_0x559d10,_0x3d3452){return db[_0xf2cd('0xae')][_0xf2cd('0x49')]({'where':{'id':_0x559d10[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x3d3452,null))['then'](function(_0x48bffc){if(_0x48bffc){return _0x48bffc[_0xf2cd('0xe5')](_0x559d10['body'][_0xf2cd('0x5a')],_[_0xf2cd('0xe6')](_0x559d10[_0xf2cd('0x4f')],['ids','id'])||{});}})[_0xf2cd('0x12')](respondWithResult(_0x3d3452,null))[_0xf2cd('0x1a')](handleError(_0x3d3452,null));};exports[_0xf2cd('0xe7')]=function(_0x3e4fa5,_0x49e683){var _0x33e26c={'raw':![],'where':{}};var _0x185b2b={};var _0x211e33={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf2cd('0x55')]({'where':{'id':_0x3e4fa5[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x49e683,null))['then'](function(_0x3502ca){if(_0x3502ca){_0x185b2b[_0xf2cd('0x32')]=_[_0xf2cd('0x34')](db['ChatInteraction'][_0xf2cd('0x2f')]);_0x185b2b[_0xf2cd('0x33')]=_[_0xf2cd('0x34')](_0x3e4fa5[_0xf2cd('0x33')]);_0x185b2b[_0xf2cd('0x3c')]=_['intersection'](_0x185b2b['model'],_0x185b2b[_0xf2cd('0x33')]);_0x33e26c[_0xf2cd('0x36')]=_[_0xf2cd('0x35')](_0x185b2b[_0xf2cd('0x32')],qs['fields'](_0x3e4fa5[_0xf2cd('0x33')][_0xf2cd('0x37')]));_0x33e26c[_0xf2cd('0x36')]=_0x33e26c['attributes'][_0xf2cd('0x38')]?_0x33e26c[_0xf2cd('0x36')]:_0x185b2b['model'];if(!_0x3e4fa5['query'][_0xf2cd('0x39')]('nolimit')){_0x33e26c[_0xf2cd('0x1f')]=qs[_0xf2cd('0x1f')](_0x3e4fa5[_0xf2cd('0x33')][_0xf2cd('0x1f')]);_0x33e26c[_0xf2cd('0x1e')]=qs[_0xf2cd('0x1e')](_0x3e4fa5[_0xf2cd('0x33')]['offset']);}_0x33e26c[_0xf2cd('0x3a')]=qs[_0xf2cd('0x3b')](_0x3e4fa5['query'][_0xf2cd('0x3b')]);_0x33e26c[_0xf2cd('0x3f')]=qs[_0xf2cd('0x3c')](_[_0xf2cd('0x3d')](_0x3e4fa5[_0xf2cd('0x33')],_0x185b2b['filters']));_0x33e26c[_0xf2cd('0x3f')][_0xf2cd('0x57')]=_0x3502ca['id'];if(_0x3e4fa5[_0xf2cd('0x33')][_0xf2cd('0x3e')]){_0x33e26c[_0xf2cd('0x3f')]=_[_0xf2cd('0x40')](_0x33e26c[_0xf2cd('0x3f')],{'$or':_['map'](_0x33e26c['attributes'],function(_0xb35212){var _0x4e23cf={};_0x4e23cf[_0xb35212]={'$like':'%'+_0x3e4fa5[_0xf2cd('0x33')]['filter']+'%'};return _0x4e23cf;})});}_0x33e26c=_[_0xf2cd('0x40')]({},_0x33e26c,_0x3e4fa5[_0xf2cd('0x43')]);return db[_0xf2cd('0xae')][_0xf2cd('0x21')]({'where':_0x33e26c[_0xf2cd('0x3f')]})[_0xf2cd('0x12')](function(_0x475eb8){_0x211e33['count']=_0x475eb8;if(_0x3e4fa5[_0xf2cd('0x33')][_0xf2cd('0x48')]){_0x33e26c['include']=[{'model':db[_0xf2cd('0x80')],'as':_0xf2cd('0xe8'),'required':![]},{'model':db['User'],'as':_0xf2cd('0xe9'),'attributes':['name',_0xf2cd('0xea'),_0xf2cd('0xeb')],'required':![]},{'model':db[_0xf2cd('0xec')],'as':_0xf2cd('0xed'),'attributes':['id','name',_0xf2cd('0xee')],'where':_0x3e4fa5[_0xf2cd('0x33')][_0xf2cd('0xef')]?{'id':_0x3e4fa5[_0xf2cd('0x33')]['tag']}:undefined,'required':_0x3e4fa5[_0xf2cd('0x33')][_0xf2cd('0xef')]?!![]:![]}];}return db[_0xf2cd('0xae')][_0xf2cd('0x44')](_0x33e26c);})[_0xf2cd('0x12')](function(_0x5dab7e){_0x211e33['rows']=_0x5dab7e;return _0x211e33;});}})[_0xf2cd('0x12')](respondWithFilteredResult(_0x49e683,_0x33e26c))['catch'](handleError(_0x49e683,null));};function iftimePromise(_0x43669b,_0x4fed0e){return respondWithRpcPromise(_0xf2cd('0xf0'),'getSnippet',{'command':_0x4fed0e[_0xf2cd('0xf1')]?util[_0xf2cd('0xa6')](_0xf2cd('0xf2'),_0x43669b[_0xf2cd('0xf3')],_0x4fed0e[_0xf2cd('0xf1')]):util[_0xf2cd('0xa6')](_0xf2cd('0xf4'),_0x43669b[_0xf2cd('0xf3')])},client9002)['then'](function(_0xf13441){var _0x4f92fd=_0xf13441&&_0xf13441[_0xf2cd('0xf5')](_0xf2cd('0xf6'))>=0x0?!![]:![];logger[_0xf2cd('0x13')](_0xf2cd('0xf7'),_0x4fed0e['id'],_0x43669b['id'],_0x43669b[_0xf2cd('0xf3')],_0x4f92fd?_0xf2cd('0xf8'):_0xf2cd('0xf9'),_0x4fed0e[_0xf2cd('0xf1')]?_0x4fed0e['timezone']:_0xf2cd('0xfa'));return _0x4f92fd;})[_0xf2cd('0x1a')](function(_0x4aee32){logger[_0xf2cd('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4fed0e['id'],_0x43669b['id'],_0x43669b[_0xf2cd('0xf3')],util[_0xf2cd('0xfb')](_0x4aee32,{'showHidden':![],'depth':null}),_0x4fed0e[_0xf2cd('0xf1')]?_0x4fed0e[_0xf2cd('0xf1')]:_0xf2cd('0xfa'));return![];});}exports[_0xf2cd('0xfc')]=function(_0x3a9bb4,_0x1afe50){var _0x25b4af=0x0;var _0x4393a6=0x0;var _0x4f4ea7=![];var _0x247cc2;var _0x1c6b81;return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'where':{'id':_0x3a9bb4['params']['id']},'include':[{'model':db[_0xf2cd('0xfd')],'as':_0xf2cd('0xfd'),'include':[{'model':db[_0xf2cd('0xfd')],'as':_0xf2cd('0xfe'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xf2cd('0x12')](handleEntityNotFound(_0x1afe50,null))[_0xf2cd('0x12')](function(_0x3b6126){if(_0x3b6126){_0x247cc2=_0x3b6126;return _0x3b6126[_0xf2cd('0xff')]({'raw':!![]});}})['then'](function(_0x2842bc){if(_0x247cc2){if(_0x2842bc){_0x1c6b81=_0x2842bc;}}return require(_0xf2cd('0x6e'))[_0xf2cd('0x6f')]();})[_0xf2cd('0x12')](function(_0x8ddfa1){if(_0x8ddfa1){_0x4393a6=_0x8ddfa1['virtual'];_0x4f4ea7=_0x8ddfa1[_0xf2cd('0x100')];}})[_0xf2cd('0x12')](function(){return db[_0xf2cd('0xae')][_0xf2cd('0x21')]({'where':{'closed':![]}});})[_0xf2cd('0x12')](function(_0x214062){_0x25b4af=_0x214062;if(_0x4393a6&&_0x214062>_0x4393a6){return db[_0xf2cd('0x101')][_0xf2cd('0x55')]({'where':{'id':0x1}})[_0xf2cd('0x12')](function(_0x41bc47){if(_0x41bc47){_0x41bc47[_0xf2cd('0x102')](_0xf2cd('0x103'));}});}})['then'](function(){if(_0x247cc2[_0xf2cd('0xfd')]&&_0x247cc2['Interval']['Intervals']){var _0x4828d7=[];for(var _0x4ed8cf=0x0;_0x4ed8cf<_0x247cc2[_0xf2cd('0xfd')]['Intervals'][_0xf2cd('0x38')];_0x4ed8cf++){var _0x4dc283=_0x247cc2[_0xf2cd('0xfd')][_0xf2cd('0xfe')][_0x4ed8cf][_0xf2cd('0x26')]({'plain':!![]});_0x4828d7[_0xf2cd('0xb5')](iftimePromise(_0x4dc283,_0x247cc2));}return BPromise[_0xf2cd('0x104')](_0x4828d7)[_0xf2cd('0x12')](function(_0x3eec5d){return _[_0xf2cd('0x105')](_0x3eec5d);});}else{return!![];}})['then'](function(_0x256c21){var _0x3c43e7=fs[_0xf2cd('0xc7')](path['join'](config[_0xf2cd('0x6c')],'server/files/chat/iframe.ejs'),_0xf2cd('0xc8'));var _0x5c9eaa={'remote':_0x247cc2['remote'],'query':querystring[_0xf2cd('0xab')](_['merge'](_0x247cc2[_0xf2cd('0x26')]({'plain':!![]}),{'customerIp':_0x3a9bb4['headers']['x-forwarded-for']||_0x3a9bb4[_0xf2cd('0x7d')][_0xf2cd('0x106')]||_0x3a9bb4[_0xf2cd('0x107')][_0xf2cd('0x108')]||_0x3a9bb4['ip'],'referer':_0x3a9bb4[_0xf2cd('0x7d')][_0xf2cd('0xa3')],'openedInteractions':_0x25b4af,'maxInteractions':_0x4393a6,'virtual':_0x4f4ea7['virtual'],'online':_0x256c21,'custom':_0x4f4ea7}))[_0xf2cd('0x109')](/'/g,'\x5c\x27')};_0x1afe50[_0xf2cd('0x2b')](ejs[_0xf2cd('0xc9')](Mustache['render'](_0x3c43e7,_0x5c9eaa),{'proactiveActions':_0x1c6b81,'alignment':_0x247cc2[_0xf2cd('0x10a')],'verticalAlignment':_0x247cc2[_0xf2cd('0x10b')],'div_color':_0x247cc2[_0xf2cd('0xee')],'labelText':_0x247cc2[_0xf2cd('0x10c')],'text_color':_0x247cc2[_0xf2cd('0x10d')],'text_button_color':_0x247cc2[_0xf2cd('0x10e')],'button_color':_0x247cc2['color_button'],'background_color':_0x247cc2[_0xf2cd('0x10f')],'hideWhenOffline':_0x247cc2[_0xf2cd('0x110')],'interval':_0x247cc2[_0xf2cd('0x111')]}));})[_0xf2cd('0x1a')](handleError(_0x1afe50,null));};exports[_0xf2cd('0x112')]=function(_0x2c1bab,_0x46b2b4){var _0x47435b=_0x2c1bab[_0xf2cd('0x46')]['id'];var _0x2488ea=_0x2c1bab[_0xf2cd('0x4f')];var _0xc9edac=0xc8;var _0x3f30c8=null;return db[_0xf2cd('0xd3')][_0xf2cd('0xd4')]({'isolationLevel':db[_0xf2cd('0xd3')][_0xf2cd('0x113')][_0xf2cd('0x114')][_0xf2cd('0x115')]},function(_0x330f75){return db['ChatWebsite'][_0xf2cd('0x55')]({'where':{'id':_0x47435b},'transaction':_0x330f75})[_0xf2cd('0x12')](function(_0x4527ff){if(_0x4527ff){return db[_0xf2cd('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x47435b},'transaction':_0x330f75})[_0xf2cd('0x12')](function(){var _0x3770f5=_[_0xf2cd('0x58')](_0x2488ea,function(_0x529671){_0x529671[_0xf2cd('0x57')]=_0x47435b;return _0x529671;});return db[_0xf2cd('0x91')][_0xf2cd('0xd5')](_0x3770f5,{'transaction':_0x330f75});});}else{_0xc9edac=0x194;_0x3f30c8=[];}});})[_0xf2cd('0x12')](function(){if(_0xc9edac!==0x194){return db[_0xf2cd('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x47435b},'order':_0xf2cd('0x96')})[_0xf2cd('0x12')](function(_0x11fe8b){_0x3f30c8=_0x11fe8b;});}})[_0xf2cd('0x1a')](function(_0x20b582){_0xc9edac=0x1f4;logger[_0xf2cd('0x17')](_0x20b582[_0xf2cd('0x29')]);if(_0x20b582[_0xf2cd('0x2a')]){delete _0x20b582[_0xf2cd('0x2a')];}_0x3f30c8=_0x20b582;})['finally'](function(){if(_0x3f30c8===null){_0x46b2b4[_0xf2cd('0x28')](_0xc9edac);}else{if(_0xc9edac===0x1f4){_0x46b2b4[_0xf2cd('0x1b')](_0xc9edac)[_0xf2cd('0x2b')](_0x3f30c8);}else{_0x46b2b4[_0xf2cd('0x1b')](_0xc9edac)[_0xf2cd('0x1d')](_0x3f30c8);}}});};exports[_0xf2cd('0x116')]=function(_0x9ced6,_0x1adea1){var _0x2e96d7={};var _0xa551f6={};var _0x184549;var _0x833e5b;return db[_0xf2cd('0x2e')][_0xf2cd('0x55')]({'where':{'id':_0x9ced6[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x1adea1,null))[_0xf2cd('0x12')](function(_0x35082a){if(_0x35082a){_0x184549=_0x35082a;_0xa551f6[_0xf2cd('0x32')]=_['keys'](db['ChatApplication']['rawAttributes']);_0xa551f6[_0xf2cd('0x33')]=_[_0xf2cd('0x34')](_0x9ced6['query']);_0xa551f6[_0xf2cd('0x3c')]=_['intersection'](_0xa551f6['model'],_0xa551f6[_0xf2cd('0x33')]);_0x2e96d7[_0xf2cd('0x36')]=_['intersection'](_0xa551f6[_0xf2cd('0x32')],qs[_0xf2cd('0x37')](_0x9ced6[_0xf2cd('0x33')]['fields']));_0x2e96d7[_0xf2cd('0x36')]=_0x2e96d7[_0xf2cd('0x36')][_0xf2cd('0x38')]?_0x2e96d7[_0xf2cd('0x36')]:_0xa551f6['model'];_0x2e96d7[_0xf2cd('0x3a')]=qs[_0xf2cd('0x3b')](_0x9ced6[_0xf2cd('0x33')]['sort']);_0x2e96d7[_0xf2cd('0x3f')]=qs[_0xf2cd('0x3c')](_['pick'](_0x9ced6[_0xf2cd('0x33')],_0xa551f6[_0xf2cd('0x3c')]));if(_0x9ced6[_0xf2cd('0x33')]['filter']){_0x2e96d7['where']=_[_0xf2cd('0x40')](_0x2e96d7['where'],{'$or':_[_0xf2cd('0x58')](_0x2e96d7['attributes'],function(_0x2a33bf){var _0x26f14c={};_0x26f14c[_0x2a33bf]={'$like':'%'+_0x9ced6[_0xf2cd('0x33')][_0xf2cd('0x3e')]+'%'};return _0x26f14c;})});}_0x2e96d7=_[_0xf2cd('0x40')]({},_0x2e96d7,_0x9ced6['options']);return _0x184549[_0xf2cd('0x116')](_0x2e96d7);}})['then'](function(_0x338a86){if(_0x338a86){_0x833e5b=_0x338a86[_0xf2cd('0x38')];if(!_0x9ced6[_0xf2cd('0x33')][_0xf2cd('0x39')](_0xf2cd('0x56'))){_0x2e96d7['limit']=qs[_0xf2cd('0x1f')](_0x9ced6[_0xf2cd('0x33')][_0xf2cd('0x1f')]);_0x2e96d7[_0xf2cd('0x1e')]=qs[_0xf2cd('0x1e')](_0x9ced6['query']['offset']);}return _0x184549[_0xf2cd('0x116')](_0x2e96d7);}})[_0xf2cd('0x12')](function(_0x9251dd){if(_0x9251dd){return _0x9251dd?{'count':_0x833e5b,'rows':_0x9251dd}:null;}})['then'](respondWithResult(_0x1adea1,null))['catch'](handleError(_0x1adea1,null));};exports['addProactiveActions']=function(_0x13fefc,_0x1be0ab){return db['chatProactiveAction'][_0xf2cd('0x49')]({'where':{'id':_0x13fefc[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x1be0ab,null))['then'](function(_0x43ed61){if(_0x43ed61){return _0x43ed61[_0xf2cd('0x117')](_0x13fefc[_0xf2cd('0x4f')][_0xf2cd('0x5a')],_[_0xf2cd('0xe6')](_0x13fefc[_0xf2cd('0x4f')],['ids','id'])||{});}})[_0xf2cd('0x12')](respondWithResult(_0x1be0ab,null))[_0xf2cd('0x1a')](handleError(_0x1be0ab,null));};exports[_0xf2cd('0xff')]=function(_0x23b576,_0x5c8eb0){var _0xd73c59={};var _0x37bc3c={};var _0x2c37a0;var _0x53836c;return db['ChatWebsite'][_0xf2cd('0x55')]({'where':{'id':_0x23b576['params']['id']}})['then'](handleEntityNotFound(_0x5c8eb0,null))[_0xf2cd('0x12')](function(_0x4d20de){if(_0x4d20de){_0x2c37a0=_0x4d20de;_0x37bc3c[_0xf2cd('0x32')]=_[_0xf2cd('0x34')](db[_0xf2cd('0x118')][_0xf2cd('0x2f')]);_0x37bc3c[_0xf2cd('0x33')]=_[_0xf2cd('0x34')](_0x23b576['query']);_0x37bc3c[_0xf2cd('0x3c')]=_[_0xf2cd('0x35')](_0x37bc3c[_0xf2cd('0x32')],_0x37bc3c['query']);_0xd73c59['attributes']=_[_0xf2cd('0x35')](_0x37bc3c[_0xf2cd('0x32')],qs['fields'](_0x23b576[_0xf2cd('0x33')][_0xf2cd('0x37')]));_0xd73c59[_0xf2cd('0x36')]=_0xd73c59[_0xf2cd('0x36')][_0xf2cd('0x38')]?_0xd73c59['attributes']:_0x37bc3c['model'];_0xd73c59[_0xf2cd('0x3a')]=qs[_0xf2cd('0x3b')](_0x23b576[_0xf2cd('0x33')][_0xf2cd('0x3b')]);_0xd73c59['where']=qs['filters'](_[_0xf2cd('0x3d')](_0x23b576[_0xf2cd('0x33')],_0x37bc3c['filters']));if(_0x23b576[_0xf2cd('0x33')][_0xf2cd('0x3e')]){_0xd73c59[_0xf2cd('0x3f')]=_[_0xf2cd('0x40')](_0xd73c59[_0xf2cd('0x3f')],{'$or':_[_0xf2cd('0x58')](_0xd73c59[_0xf2cd('0x36')],function(_0x18d1ef){var _0xf7898d={};_0xf7898d[_0x18d1ef]={'$like':'%'+_0x23b576[_0xf2cd('0x33')]['filter']+'%'};return _0xf7898d;})});}_0xd73c59=_[_0xf2cd('0x40')]({},_0xd73c59,_0x23b576[_0xf2cd('0x43')]);return _0x2c37a0['getProactiveActions'](_0xd73c59);}})[_0xf2cd('0x12')](function(_0x265129){if(_0x265129){_0x53836c=_0x265129[_0xf2cd('0x38')];if(!_0x23b576[_0xf2cd('0x33')][_0xf2cd('0x39')]('nolimit')){_0xd73c59['limit']=qs[_0xf2cd('0x1f')](_0x23b576['query'][_0xf2cd('0x1f')]);_0xd73c59[_0xf2cd('0x1e')]=qs['offset'](_0x23b576[_0xf2cd('0x33')][_0xf2cd('0x1e')]);}return _0x2c37a0[_0xf2cd('0xff')](_0xd73c59);}})['then'](function(_0x4bce59){if(_0x4bce59){return _0x4bce59?{'count':_0x53836c,'rows':_0x4bce59}:null;}})[_0xf2cd('0x12')](respondWithResult(_0x5c8eb0,null))[_0xf2cd('0x1a')](handleError(_0x5c8eb0,null));};exports[_0xf2cd('0x119')]=function(_0x43b9d5,_0x482b59){var _0x12f29c=_0x43b9d5[_0xf2cd('0x33')][_0xf2cd('0x11a')]===_0xf2cd('0x11b')?_0xf2cd('0x11c'):'onlineForm';return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'attributes':['id',_0x12f29c],'where':{'id':_0x43b9d5[_0xf2cd('0x46')]['id']}})['then'](handleEntityNotFound(_0x482b59,null))['then'](function(_0x3b4d8d){if(_0x3b4d8d){var _0x367934=_0x3b4d8d[_0x12f29c];var _0x22a997=_0x367934&&_0x367934[_0xf2cd('0x11d')]?_0x367934[_0xf2cd('0x11d')]:[];_0x482b59[_0xf2cd('0x2b')]({'fromKey':_['isNil'](_0x367934[_0xf2cd('0x11e')])?undefined:_0x367934[_0xf2cd('0x11e')],'count':_0x22a997['length'],'rows':_0x22a997});}})[_0xf2cd('0x1a')](handleError(_0x482b59,null));};exports[_0xf2cd('0x11f')]=function(_0xeac3fb,_0x1c4701){var _0x316339={'raw':![],'where':{}};var _0x3e762a={};var _0x24bcee={'count':0x0,'rows':[]};return db[_0xf2cd('0x2e')]['findOne']({'where':{'id':_0xeac3fb[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x1c4701,null))['then'](function(_0x1a2cb0){if(_0x1a2cb0){_0x3e762a[_0xf2cd('0x32')]=_[_0xf2cd('0x34')](db['ChatOfflineMessage'][_0xf2cd('0x2f')]);_0x3e762a[_0xf2cd('0x33')]=_[_0xf2cd('0x34')](_0xeac3fb[_0xf2cd('0x33')]);_0x3e762a['filters']=_[_0xf2cd('0x35')](_0x3e762a['model'],_0x3e762a['query']);_0x316339[_0xf2cd('0x36')]=_[_0xf2cd('0x35')](_0x3e762a[_0xf2cd('0x32')],qs[_0xf2cd('0x37')](_0xeac3fb[_0xf2cd('0x33')][_0xf2cd('0x37')]));_0x316339['attributes']=_0x316339['attributes']['length']?_0x316339['attributes']:_0x3e762a[_0xf2cd('0x32')];if(!_0xeac3fb['query'][_0xf2cd('0x39')](_0xf2cd('0x56'))){_0x316339[_0xf2cd('0x1f')]=qs[_0xf2cd('0x1f')](_0xeac3fb[_0xf2cd('0x33')][_0xf2cd('0x1f')]);_0x316339[_0xf2cd('0x1e')]=qs[_0xf2cd('0x1e')](_0xeac3fb[_0xf2cd('0x33')][_0xf2cd('0x1e')]);}_0x316339['order']=qs[_0xf2cd('0x3b')](_0xeac3fb['query'][_0xf2cd('0x3b')]);_0x316339['where']=qs[_0xf2cd('0x3c')](_[_0xf2cd('0x3d')](_0xeac3fb[_0xf2cd('0x33')],_0x3e762a['filters']));_0x316339[_0xf2cd('0x3f')]['ChatWebsiteId']=_0x1a2cb0['id'];if(_0xeac3fb[_0xf2cd('0x33')][_0xf2cd('0x3e')]){_0x316339[_0xf2cd('0x3f')]=_[_0xf2cd('0x40')](_0x316339[_0xf2cd('0x3f')],{'$or':_['map'](_0x316339[_0xf2cd('0x36')],function(_0x594478){var _0x3c2657={};_0x3c2657[_0x594478]={'$like':'%'+_0xeac3fb['query'][_0xf2cd('0x3e')]+'%'};return _0x3c2657;})});}_0x316339=_[_0xf2cd('0x40')]({},_0x316339,_0xeac3fb[_0xf2cd('0x43')]);return db[_0xf2cd('0x120')]['count']({'where':_0x316339[_0xf2cd('0x3f')]})[_0xf2cd('0x12')](function(_0x344d68){_0x24bcee['count']=_0x344d68;if(_0xeac3fb[_0xf2cd('0x33')][_0xf2cd('0x48')]){_0x316339[_0xf2cd('0x5e')]=[{'all':!![]}];}else{_0x316339[_0xf2cd('0x5e')]=[{'model':db[_0xf2cd('0x80')],'as':_0xf2cd('0xe8'),'required':![]},{'model':db[_0xf2cd('0x121')],'as':_0xf2cd('0x122'),'required':![]}];}return db[_0xf2cd('0x120')][_0xf2cd('0x44')](_0x316339);})[_0xf2cd('0x12')](function(_0x109ce9){_0x24bcee[_0xf2cd('0x45')]=_0x109ce9;return _0x24bcee;});}})[_0xf2cd('0x12')](respondWithFilteredResult(_0x1c4701,_0x316339))[_0xf2cd('0x1a')](handleError(_0x1c4701,null));};exports['addAgents']=function(_0x3c47df,_0x465748){return db[_0xf2cd('0x2e')][_0xf2cd('0x49')]({'where':{'id':_0x3c47df['params']['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x465748,null))[_0xf2cd('0x12')](function(_0x47583e){if(_0x47583e){return _0x47583e['addAgents'](_0x3c47df[_0xf2cd('0x4f')]['ids'],_['omit'](_0x3c47df[_0xf2cd('0x4f')],[_0xf2cd('0x5a'),'id'])||{})[_0xf2cd('0xb1')](function(_0x2e1e96){for(var _0x9d829e=0x0;_0x9d829e<_0x3c47df[_0xf2cd('0x4f')][_0xf2cd('0x5a')]['length'];_0x9d829e+=0x1){socket[_0xf2cd('0x123')]('userChatWebsite:save',{'UserId':Number(_0x3c47df[_0xf2cd('0x4f')]['ids'][_0x9d829e]),'ChatWebsiteId':Number(_0x3c47df[_0xf2cd('0x46')]['id'])});}return _0x2e1e96;});}})['then'](respondWithResult(_0x465748,null))[_0xf2cd('0x1a')](handleError(_0x465748,null));};exports[_0xf2cd('0x124')]=function(_0x54bc5f,_0x33f956){return db[_0xf2cd('0x2e')]['find']({'where':{'id':_0x54bc5f[_0xf2cd('0x46')]['id']}})['then'](handleEntityNotFound(_0x33f956,null))[_0xf2cd('0x12')](function(_0x3c7a11){if(_0x3c7a11){return _0x3c7a11[_0xf2cd('0x124')](_0x54bc5f[_0xf2cd('0x33')][_0xf2cd('0x5a')])['then'](function(){if(_[_0xf2cd('0x125')](_0x54bc5f[_0xf2cd('0x33')][_0xf2cd('0x5a')])){for(var _0x5aacdf=0x0;_0x5aacdf<_0x54bc5f[_0xf2cd('0x33')][_0xf2cd('0x5a')][_0xf2cd('0x38')];_0x5aacdf+=0x1){socket['emit'](_0xf2cd('0x126'),{'UserId':Number(_0x54bc5f[_0xf2cd('0x33')][_0xf2cd('0x5a')][_0x5aacdf]),'ChatWebsiteId':Number(_0x54bc5f[_0xf2cd('0x46')]['id'])});}}else{socket[_0xf2cd('0x123')]('userChatWebsite:remove',{'UserId':Number(_0x54bc5f[_0xf2cd('0x33')]['ids']),'ChatWebsiteId':Number(_0x54bc5f[_0xf2cd('0x46')]['id'])});}});}})[_0xf2cd('0x12')](respondWithStatusCode(_0x33f956,null))[_0xf2cd('0x1a')](handleError(_0x33f956,null));};exports[_0xf2cd('0x127')]=function(_0xd9caf7,_0x294980){var _0x5466af={};var _0x5c7fc6={};var _0x4a3178;var _0x579bc0;return db['ChatWebsite']['findOne']({'where':{'id':_0xd9caf7[_0xf2cd('0x46')]['id']}})[_0xf2cd('0x12')](handleEntityNotFound(_0x294980,null))[_0xf2cd('0x12')](function(_0x2abc83){if(_0x2abc83){_0x4a3178=_0x2abc83;_0x5c7fc6[_0xf2cd('0x32')]=_['keys'](db[_0xf2cd('0xba')][_0xf2cd('0x2f')]);_0x5c7fc6[_0xf2cd('0x33')]=_[_0xf2cd('0x34')](_0xd9caf7[_0xf2cd('0x33')]);_0x5c7fc6[_0xf2cd('0x3c')]=_['intersection'](_0x5c7fc6[_0xf2cd('0x32')],_0x5c7fc6[_0xf2cd('0x33')]);_0x5466af[_0xf2cd('0x36')]=_['intersection'](_0x5c7fc6[_0xf2cd('0x32')],qs[_0xf2cd('0x37')](_0xd9caf7[_0xf2cd('0x33')][_0xf2cd('0x37')]));_0x5466af[_0xf2cd('0x36')]=_0x5466af[_0xf2cd('0x36')]['length']?_0x5466af[_0xf2cd('0x36')]:_0x5c7fc6[_0xf2cd('0x32')];_0x5466af[_0xf2cd('0x3a')]=qs[_0xf2cd('0x3b')](_0xd9caf7[_0xf2cd('0x33')][_0xf2cd('0x3b')]);_0x5466af[_0xf2cd('0x3f')]=qs[_0xf2cd('0x3c')](_[_0xf2cd('0x3d')](_0xd9caf7[_0xf2cd('0x33')],_0x5c7fc6[_0xf2cd('0x3c')]));if(_0xd9caf7[_0xf2cd('0x33')][_0xf2cd('0x3e')]){_0x5466af[_0xf2cd('0x3f')]=_[_0xf2cd('0x40')](_0x5466af[_0xf2cd('0x3f')],{'$or':_[_0xf2cd('0x58')](_0x5466af[_0xf2cd('0x36')],function(_0x2a9672){var _0x1bfac6={};_0x1bfac6[_0x2a9672]={'$like':'%'+_0xd9caf7[_0xf2cd('0x33')][_0xf2cd('0x3e')]+'%'};return _0x1bfac6;})});}_0x5466af=_[_0xf2cd('0x40')]({},_0x5466af,_0xd9caf7[_0xf2cd('0x43')]);return _0x4a3178[_0xf2cd('0x127')](_0x5466af);}})[_0xf2cd('0x12')](function(_0x7ad8cc){if(_0x7ad8cc){_0x579bc0=_0x7ad8cc[_0xf2cd('0x38')];if(!_0xd9caf7[_0xf2cd('0x33')][_0xf2cd('0x39')](_0xf2cd('0x56'))){_0x5466af[_0xf2cd('0x1f')]=qs[_0xf2cd('0x1f')](_0xd9caf7[_0xf2cd('0x33')]['limit']);_0x5466af[_0xf2cd('0x1e')]=qs['offset'](_0xd9caf7[_0xf2cd('0x33')][_0xf2cd('0x1e')]);}return _0x4a3178[_0xf2cd('0x127')](_0x5466af);}})[_0xf2cd('0x12')](function(_0x574da0){if(_0x574da0){return _0x574da0?{'count':_0x579bc0,'rows':_0x574da0}:null;}})[_0xf2cd('0x12')](respondWithResult(_0x294980,null))[_0xf2cd('0x1a')](handleError(_0x294980,null));}; \ No newline at end of file +var _0x8141=['get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','getDispositions','findOne','Disposition','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','addLogo','file','addAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','interaction','contact','lastName','messageId','created','autoclose','push','close','unmanaged','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','forwardOfflineAddress','offlineMessageSubject','mimetype','subjectOffline','mapValues','email','Chat','MailAccountId','NotifyMailAccount','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','remote','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','IntervalId','addApplications','sequelize','Transaction','READ_COMMITTED','findAndCountAll','sendStatus','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','items','fromKey','Contact','addAgents','spread','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','bluebird','mustache','util','path','ejs','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','status','end','offset','undefined','limit','count','set','Content-Range','json','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','Pause','find','catch','create','body','user'];(function(_0x18111b,_0x3bbaae){var _0x3d4a01=function(_0xa3e505){while(--_0xa3e505){_0x18111b['push'](_0x18111b['shift']());}};_0x3d4a01(++_0x3bbaae);}(_0x8141,0xd4));var _0x1814=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8141[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x1814('0x0'));var Mustache=require(_0x1814('0x1'));var util=require(_0x1814('0x2'));var path=require(_0x1814('0x3'));var ejs=require(_0x1814('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require('querystring');var Redis=require(_0x1814('0x5'));var qs=require(_0x1814('0x6'));var logger=require('../../config/logger')(_0x1814('0x7'));var config=require(_0x1814('0x8'));var db=require(_0x1814('0x9'))['db'];config[_0x1814('0xa')]=_[_0x1814('0xb')](config['redis'],{'host':_0x1814('0xc'),'port':0x18eb});var socket=require(_0x1814('0xd'))(new Redis(config[_0x1814('0xa')]));require(_0x1814('0xe'))[_0x1814('0xf')](socket);var htmlToText=require(_0x1814('0x10'));var jayson=require('jayson/promise');var client=jayson[_0x1814('0x11')][_0x1814('0x12')]({'port':0x232c});var client9002=jayson[_0x1814('0x11')]['http']({'port':0x232a});var client9003=jayson['client'][_0x1814('0x12')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0xc253f9,_0x171673,_0x55ec51,_0x2a149f){return new BPromise(function(_0x2a2aaa,_0x9b2a6f){var _0x3977dc=_0x2a149f||client;return _0x3977dc[_0x1814('0x13')](_0xc253f9,_0x55ec51)[_0x1814('0x14')](function(_0x2f20e3){logger[_0x1814('0x15')](_0x1814('0x16'),_0x171673,'request\x20sent');logger[_0x1814('0x17')](_0x1814('0x18'),_0x171673,_0x1814('0x19'),JSON['stringify'](_0x2f20e3));if(_0x2f20e3[_0x1814('0x1a')]){if(_0x2f20e3[_0x1814('0x1a')]['code']===0x1f4){logger[_0x1814('0x1a')](_0x1814('0x16'),_0x171673,_0x2f20e3[_0x1814('0x1a')]['message']);return _0x9b2a6f(_0x2f20e3[_0x1814('0x1a')][_0x1814('0x1b')]);}logger[_0x1814('0x1a')](_0x1814('0x16'),_0x171673,_0x2f20e3['error'][_0x1814('0x1b')]);return _0x2a2aaa(_0x2f20e3['error']['message']);}else{logger[_0x1814('0x15')](_0x1814('0x16'),_0x171673,'request\x20sent');_0x2a2aaa(_0x2f20e3['result'][_0x1814('0x1b')]);}})['catch'](function(_0x50eb90){logger[_0x1814('0x1a')](_0x1814('0x16'),_0x171673,_0x50eb90);_0x9b2a6f(_0x50eb90);});});}function respondWithStatusCode(_0x3a749e,_0x43881c){_0x43881c=_0x43881c||0xcc;return function(_0x131a74){if(_0x131a74){return _0x3a749e['sendStatus'](_0x43881c);}return _0x3a749e[_0x1814('0x1c')](_0x43881c)[_0x1814('0x1d')]();};}function respondWithResult(_0x40d9d5,_0x4b1235){_0x4b1235=_0x4b1235||0xc8;return function(_0x1c928a){if(_0x1c928a){return _0x40d9d5[_0x1814('0x1c')](_0x4b1235)['json'](_0x1c928a);}};}function respondWithFilteredResult(_0x314ea3,_0x5bac70){return function(_0x5284d8){if(_0x5284d8){var _0x56c051=typeof _0x5bac70[_0x1814('0x1e')]===_0x1814('0x1f')&&typeof _0x5bac70[_0x1814('0x20')]===_0x1814('0x1f');var _0x5f00dd=_0x5284d8[_0x1814('0x21')];var _0x4b4b0e=_0x56c051?0x0:_0x5bac70[_0x1814('0x1e')];var _0xeceb6=_0x56c051?_0x5284d8[_0x1814('0x21')]:_0x5bac70[_0x1814('0x1e')]+_0x5bac70[_0x1814('0x20')];var _0x2bdd3d;if(_0xeceb6>=_0x5f00dd){_0xeceb6=_0x5f00dd;_0x2bdd3d=0xc8;}else{_0x2bdd3d=0xce;}_0x314ea3[_0x1814('0x1c')](_0x2bdd3d);return _0x314ea3[_0x1814('0x22')](_0x1814('0x23'),_0x4b4b0e+'-'+_0xeceb6+'/'+_0x5f00dd)[_0x1814('0x24')](_0x5284d8);}return null;};}function saveUpdates(_0x1982fa){return function(_0x4203f9){if(_0x4203f9){return _0x4203f9['update'](_0x1982fa)['then'](function(_0x31c851){return _0x31c851;});}return null;};}function removeEntity(_0x5e6f75){return function(_0x4255a5){if(_0x4255a5){return _0x4255a5['destroy']()['then'](function(){var _0x15daab=_0x4255a5['get']({'plain':!![]});var _0x3e527b=_0x1814('0x25');return db[_0x1814('0x26')][_0x1814('0x27')]({'where':{'type':_0x3e527b,'resourceId':_0x15daab['id']}})[_0x1814('0x14')](function(){return _0x4255a5;});})['then'](function(){_0x5e6f75[_0x1814('0x1c')](0xcc)[_0x1814('0x1d')]();});}};}function handleEntityNotFound(_0x32c368){return function(_0x479413){if(!_0x479413){_0x32c368['sendStatus'](0x194);}return _0x479413;};}function handleError(_0x75c7a0,_0x1fb0a8){_0x1fb0a8=_0x1fb0a8||0x1f4;return function(_0x5abe31){logger[_0x1814('0x1a')](_0x5abe31[_0x1814('0x28')]);if(_0x5abe31['name']){delete _0x5abe31[_0x1814('0x29')];}_0x75c7a0[_0x1814('0x1c')](_0x1fb0a8)[_0x1814('0x2a')](_0x5abe31);};}exports[_0x1814('0x2b')]=function(_0x59408d,_0x53dd2d){var _0xdf4dca={'include':[{'model':db['Pause'],'as':_0x1814('0x2c')}]},_0x5300e8={},_0x301ead={'count':0x0,'rows':[]};var _0xf7c966=_[_0x1814('0x2d')](db[_0x1814('0x2e')][_0x1814('0x2f')],function(_0x5e173a){return{'name':_0x5e173a[_0x1814('0x30')],'type':_0x5e173a[_0x1814('0x31')]['key']};});_0x5300e8[_0x1814('0x32')]=_[_0x1814('0x2d')](_0xf7c966,_0x1814('0x29'));_0x5300e8[_0x1814('0x33')]=_[_0x1814('0x34')](_0x59408d[_0x1814('0x33')]);_0x5300e8[_0x1814('0x35')]=_['intersection'](_0x5300e8[_0x1814('0x32')],_0x5300e8[_0x1814('0x33')]);_0xdf4dca[_0x1814('0x36')]=_[_0x1814('0x37')](_0x5300e8[_0x1814('0x32')],qs[_0x1814('0x38')](_0x59408d[_0x1814('0x33')][_0x1814('0x38')]));_0xdf4dca[_0x1814('0x36')]=_0xdf4dca[_0x1814('0x36')][_0x1814('0x39')]?_0xdf4dca['attributes']:_0x5300e8[_0x1814('0x32')];if(!_0x59408d[_0x1814('0x33')]['hasOwnProperty']('nolimit')){_0xdf4dca[_0x1814('0x20')]=qs['limit'](_0x59408d['query']['limit']);_0xdf4dca[_0x1814('0x1e')]=qs[_0x1814('0x1e')](_0x59408d[_0x1814('0x33')][_0x1814('0x1e')]);}_0xdf4dca[_0x1814('0x3a')]=qs[_0x1814('0x3b')](_0x59408d['query'][_0x1814('0x3b')]);_0xdf4dca['where']=qs[_0x1814('0x35')](_[_0x1814('0x3c')](_0x59408d[_0x1814('0x33')],_0x5300e8['filters']),_0xf7c966);if(_0x59408d[_0x1814('0x33')][_0x1814('0x3d')]){_0xdf4dca[_0x1814('0x3e')]=_[_0x1814('0x3f')](_0xdf4dca[_0x1814('0x3e')],{'$or':_[_0x1814('0x2d')](_0xf7c966,function(_0x28a0d7){if(_0x28a0d7[_0x1814('0x31')]!==_0x1814('0x40')){var _0x2d314b={};_0x2d314b[_0x28a0d7['name']]={'$like':'%'+_0x59408d['query'][_0x1814('0x3d')]+'%'};return _0x2d314b;}})});}_0xdf4dca=_[_0x1814('0x3f')]({},_0xdf4dca,_0x59408d[_0x1814('0x41')]);var _0x9b2f3={'where':_0xdf4dca[_0x1814('0x3e')]};return db[_0x1814('0x2e')][_0x1814('0x21')](_0x9b2f3)[_0x1814('0x14')](function(_0x6d103f){_0x301ead[_0x1814('0x21')]=_0x6d103f;if(_0x59408d[_0x1814('0x33')][_0x1814('0x42')]){_0xdf4dca[_0x1814('0x43')]=[{'all':!![]}];}return db[_0x1814('0x2e')]['findAll'](_0xdf4dca);})[_0x1814('0x14')](function(_0x1076d9){_0x301ead[_0x1814('0x44')]=_0x1076d9;return _0x301ead;})[_0x1814('0x14')](respondWithFilteredResult(_0x53dd2d,_0xdf4dca))['catch'](handleError(_0x53dd2d,null));};exports[_0x1814('0x45')]=function(_0x2d9436,_0x2e2d0b){var _0x573f40={'raw':![],'where':{'id':_0x2d9436[_0x1814('0x46')]['id']},'include':[{'model':db[_0x1814('0x47')],'as':_0x1814('0x2c')}]},_0x404b38={};_0x404b38[_0x1814('0x32')]=_[_0x1814('0x34')](db[_0x1814('0x2e')][_0x1814('0x2f')]);_0x404b38[_0x1814('0x33')]=_['keys'](_0x2d9436[_0x1814('0x33')]);_0x404b38[_0x1814('0x35')]=_[_0x1814('0x37')](_0x404b38[_0x1814('0x32')],_0x404b38[_0x1814('0x33')]);_0x573f40[_0x1814('0x36')]=_[_0x1814('0x37')](_0x404b38[_0x1814('0x32')],qs['fields'](_0x2d9436[_0x1814('0x33')][_0x1814('0x38')]));_0x573f40['attributes']=_0x573f40[_0x1814('0x36')][_0x1814('0x39')]?_0x573f40[_0x1814('0x36')]:_0x404b38[_0x1814('0x32')];if(_0x2d9436[_0x1814('0x33')][_0x1814('0x42')]){_0x573f40[_0x1814('0x43')]=[{'all':!![]}];}_0x573f40=_[_0x1814('0x3f')]({},_0x573f40,_0x2d9436[_0x1814('0x41')]);return db['ChatWebsite'][_0x1814('0x48')](_0x573f40)['then'](handleEntityNotFound(_0x2e2d0b,null))[_0x1814('0x14')](respondWithResult(_0x2e2d0b,null))[_0x1814('0x49')](handleError(_0x2e2d0b,null));};exports[_0x1814('0x4a')]=function(_0x388a23,_0x2e0538){return db[_0x1814('0x2e')][_0x1814('0x4a')](_0x388a23[_0x1814('0x4b')],{})['then'](function(_0x114217){var _0x2fdf13=_0x388a23[_0x1814('0x4c')][_0x1814('0x4d')]({'plain':!![]});if(!_0x2fdf13)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fdf13[_0x1814('0x4e')]===_0x1814('0x4c')){var _0xb92674=_0x114217[_0x1814('0x4d')]({'plain':!![]});var _0x51601a=_0x1814('0x25');return db[_0x1814('0x4f')][_0x1814('0x48')]({'where':{'name':_0x51601a,'userProfileId':_0x2fdf13['userProfileId']},'raw':!![]})[_0x1814('0x14')](function(_0x39abdd){if(_0x39abdd&&_0x39abdd[_0x1814('0x50')]===0x0){return db[_0x1814('0x26')]['create']({'name':_0xb92674[_0x1814('0x29')],'resourceId':_0xb92674['id'],'type':_0x39abdd['name'],'sectionId':_0x39abdd['id']},{})[_0x1814('0x14')](function(){return _0x114217;});}else{return _0x114217;}})['catch'](function(_0x35b127){logger[_0x1814('0x1a')](_0x1814('0x51'),_0x35b127);throw _0x35b127;});}return _0x114217;})[_0x1814('0x14')](respondWithResult(_0x2e0538,0xc9))[_0x1814('0x49')](handleError(_0x2e0538,null));};exports[_0x1814('0x52')]=function(_0x5cb141,_0x145ae8){if(_0x5cb141[_0x1814('0x4b')]['id']){delete _0x5cb141[_0x1814('0x4b')]['id'];}return db['ChatWebsite'][_0x1814('0x48')]({'where':{'id':_0x5cb141[_0x1814('0x46')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x145ae8,null))['then'](saveUpdates(_0x5cb141[_0x1814('0x4b')],null))[_0x1814('0x14')](respondWithResult(_0x145ae8,null))[_0x1814('0x49')](handleError(_0x145ae8,null));};exports[_0x1814('0x27')]=function(_0x3da714,_0x362874){return db[_0x1814('0x2e')]['find']({'where':{'id':_0x3da714[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x362874,null))[_0x1814('0x14')](removeEntity(_0x362874,null))[_0x1814('0x49')](handleError(_0x362874,null));};exports[_0x1814('0x53')]=function(_0x419bd8,_0x3e1b08){return db[_0x1814('0x2e')]['describe']()[_0x1814('0x14')](respondWithResult(_0x3e1b08,null))['catch'](handleError(_0x3e1b08,null));};exports['addDisposition']=function(_0x2d89d1,_0x52f3a7){if(_0x2d89d1[_0x1814('0x4b')]['id']){delete _0x2d89d1['body']['id'];}return db[_0x1814('0x2e')]['find']({'where':{'id':_0x2d89d1[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x52f3a7,null))[_0x1814('0x14')](function(_0x2b6561){if(_0x2b6561){_0x2d89d1['body'][_0x1814('0x54')]=_0x2b6561['id'];return db['Disposition'][_0x1814('0x4a')](_0x2d89d1[_0x1814('0x4b')]);}})[_0x1814('0x14')](respondWithResult(_0x52f3a7,null))['catch'](handleError(_0x52f3a7,null));};exports[_0x1814('0x55')]=function(_0x345a6e,_0x3e76c8){var _0x1bf663={'raw':![],'where':{}};var _0x524d73={};var _0x442d3b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1814('0x56')]({'where':{'id':_0x345a6e[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x3e76c8,null))[_0x1814('0x14')](function(_0x497727){if(_0x497727){_0x524d73['model']=_[_0x1814('0x34')](db[_0x1814('0x57')][_0x1814('0x2f')]);_0x524d73[_0x1814('0x33')]=_[_0x1814('0x34')](_0x345a6e['query']);_0x524d73[_0x1814('0x35')]=_[_0x1814('0x37')](_0x524d73[_0x1814('0x32')],_0x524d73[_0x1814('0x33')]);_0x1bf663[_0x1814('0x36')]=_[_0x1814('0x37')](_0x524d73[_0x1814('0x32')],qs[_0x1814('0x38')](_0x345a6e[_0x1814('0x33')]['fields']));_0x1bf663[_0x1814('0x36')]=_0x1bf663[_0x1814('0x36')][_0x1814('0x39')]?_0x1bf663['attributes']:_0x524d73[_0x1814('0x32')];if(!_0x345a6e[_0x1814('0x33')][_0x1814('0x58')]('nolimit')){_0x1bf663[_0x1814('0x20')]=qs[_0x1814('0x20')](_0x345a6e[_0x1814('0x33')][_0x1814('0x20')]);_0x1bf663[_0x1814('0x1e')]=qs[_0x1814('0x1e')](_0x345a6e['query'][_0x1814('0x1e')]);}_0x1bf663['order']=qs[_0x1814('0x3b')](_0x345a6e[_0x1814('0x33')][_0x1814('0x3b')]);_0x1bf663['where']=qs['filters'](_[_0x1814('0x3c')](_0x345a6e[_0x1814('0x33')],_0x524d73['filters']));_0x1bf663['where'][_0x1814('0x54')]=_0x497727['id'];if(_0x345a6e[_0x1814('0x33')][_0x1814('0x3d')]){_0x1bf663[_0x1814('0x3e')]=_[_0x1814('0x3f')](_0x1bf663[_0x1814('0x3e')],{'$or':_[_0x1814('0x2d')](_0x1bf663[_0x1814('0x36')],function(_0x315b52){var _0x243c77={};_0x243c77[_0x315b52]={'$like':'%'+_0x345a6e['query'][_0x1814('0x3d')]+'%'};return _0x243c77;})});}_0x1bf663=_['merge']({},_0x1bf663,_0x345a6e[_0x1814('0x41')]);return db['Disposition']['count']({'where':_0x1bf663['where']})[_0x1814('0x14')](function(_0x71756c){_0x442d3b[_0x1814('0x21')]=_0x71756c;if(_0x345a6e[_0x1814('0x33')][_0x1814('0x42')]){_0x1bf663['include']=[{'all':!![]}];}return db[_0x1814('0x57')][_0x1814('0x59')](_0x1bf663);})['then'](function(_0x109c5b){_0x442d3b[_0x1814('0x44')]=_0x109c5b;return _0x442d3b;});}})['then'](respondWithFilteredResult(_0x3e76c8,_0x1bf663))[_0x1814('0x49')](handleError(_0x3e76c8,null));};exports[_0x1814('0x5a')]=function(_0x26dc0a,_0x423b24){return db['ChatWebsite'][_0x1814('0x48')]({'where':{'id':_0x26dc0a[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x423b24,null))[_0x1814('0x14')](function(_0x33c5db){if(_0x33c5db){return _0x33c5db[_0x1814('0x5a')](_0x26dc0a[_0x1814('0x33')][_0x1814('0x5b')]);}})[_0x1814('0x14')](respondWithStatusCode(_0x423b24,null))[_0x1814('0x49')](handleError(_0x423b24,null));};exports[_0x1814('0x5c')]=function(_0x664643,_0x5e1436){if(_0x664643['body']['id']){delete _0x664643['body']['id'];}return db[_0x1814('0x2e')]['find']({'where':{'id':_0x664643[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x5e1436,null))[_0x1814('0x14')](function(_0x14ec6c){if(_0x14ec6c){_0x664643['body'][_0x1814('0x54')]=_0x14ec6c['id'];return db[_0x1814('0x5d')][_0x1814('0x4a')](_0x664643[_0x1814('0x4b')]);}})['then'](respondWithResult(_0x5e1436,null))[_0x1814('0x49')](handleError(_0x5e1436,null));};exports['getAnswers']=function(_0x171589,_0x44266e){var _0x17b3d2={'raw':![],'where':{}};var _0x2e4b42={};var _0x5b917b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1814('0x56')]({'where':{'id':_0x171589[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x44266e,null))[_0x1814('0x14')](function(_0x10f9c9){if(_0x10f9c9){_0x2e4b42[_0x1814('0x32')]=_[_0x1814('0x34')](db[_0x1814('0x5d')][_0x1814('0x2f')]);_0x2e4b42[_0x1814('0x33')]=_[_0x1814('0x34')](_0x171589[_0x1814('0x33')]);_0x2e4b42[_0x1814('0x35')]=_[_0x1814('0x37')](_0x2e4b42[_0x1814('0x32')],_0x2e4b42[_0x1814('0x33')]);_0x17b3d2[_0x1814('0x36')]=_['intersection'](_0x2e4b42[_0x1814('0x32')],qs[_0x1814('0x38')](_0x171589[_0x1814('0x33')][_0x1814('0x38')]));_0x17b3d2[_0x1814('0x36')]=_0x17b3d2[_0x1814('0x36')]['length']?_0x17b3d2[_0x1814('0x36')]:_0x2e4b42['model'];if(!_0x171589[_0x1814('0x33')][_0x1814('0x58')](_0x1814('0x5e'))){_0x17b3d2[_0x1814('0x20')]=qs[_0x1814('0x20')](_0x171589[_0x1814('0x33')][_0x1814('0x20')]);_0x17b3d2[_0x1814('0x1e')]=qs[_0x1814('0x1e')](_0x171589[_0x1814('0x33')][_0x1814('0x1e')]);}_0x17b3d2[_0x1814('0x3a')]=qs['sort'](_0x171589[_0x1814('0x33')][_0x1814('0x3b')]);_0x17b3d2[_0x1814('0x3e')]=qs[_0x1814('0x35')](_[_0x1814('0x3c')](_0x171589[_0x1814('0x33')],_0x2e4b42[_0x1814('0x35')]));_0x17b3d2[_0x1814('0x3e')]['ChatWebsiteId']=_0x10f9c9['id'];if(_0x171589['query'][_0x1814('0x3d')]){_0x17b3d2['where']=_[_0x1814('0x3f')](_0x17b3d2[_0x1814('0x3e')],{'$or':_['map'](_0x17b3d2[_0x1814('0x36')],function(_0x5c0652){var _0xa12e7d={};_0xa12e7d[_0x5c0652]={'$like':'%'+_0x171589['query'][_0x1814('0x3d')]+'%'};return _0xa12e7d;})});}_0x17b3d2=_['merge']({},_0x17b3d2,_0x171589[_0x1814('0x41')]);return db[_0x1814('0x5d')][_0x1814('0x21')]({'where':_0x17b3d2[_0x1814('0x3e')]})[_0x1814('0x14')](function(_0x505545){_0x5b917b[_0x1814('0x21')]=_0x505545;if(_0x171589[_0x1814('0x33')]['includeAll']){_0x17b3d2[_0x1814('0x43')]=[{'all':!![]}];}return db[_0x1814('0x5d')][_0x1814('0x59')](_0x17b3d2);})[_0x1814('0x14')](function(_0x3dc8b4){_0x5b917b['rows']=_0x3dc8b4;return _0x5b917b;});}})[_0x1814('0x14')](respondWithFilteredResult(_0x44266e,_0x17b3d2))['catch'](handleError(_0x44266e,null));};exports[_0x1814('0x5f')]=function(_0x3f4821,_0x55882b){return db[_0x1814('0x2e')][_0x1814('0x48')]({'where':{'id':_0x3f4821[_0x1814('0x46')]['id']}})['then'](handleEntityNotFound(_0x55882b,null))['then'](function(_0x564e13){if(_0x564e13){return _0x564e13[_0x1814('0x5f')](_0x3f4821[_0x1814('0x33')][_0x1814('0x5b')]);}})[_0x1814('0x14')](respondWithStatusCode(_0x55882b,null))[_0x1814('0x49')](handleError(_0x55882b,null));};exports[_0x1814('0x60')]=function(_0x144453,_0x38cd4a){_0x144453[_0x1814('0x4b')]['sitepic']=_0x144453[_0x1814('0x61')]['filename'];return db[_0x1814('0x2e')]['find']({'where':{'id':_0x144453[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x38cd4a,null))[_0x1814('0x14')](saveUpdates(_0x144453[_0x1814('0x4b')],null))['then'](respondWithResult(_0x38cd4a,null))[_0x1814('0x49')](handleError(_0x38cd4a,null));};exports[_0x1814('0x62')]=function(_0x596a3e,_0x1612c0){_0x596a3e[_0x1814('0x4b')]['agentAvatar']=_0x596a3e[_0x1814('0x61')][_0x1814('0x63')];return db[_0x1814('0x2e')]['find']({'where':{'id':_0x596a3e[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x1612c0,null))[_0x1814('0x14')](saveUpdates(_0x596a3e[_0x1814('0x4b')],null))[_0x1814('0x14')](respondWithResult(_0x1612c0,null))[_0x1814('0x49')](handleError(_0x1612c0,null));};exports[_0x1814('0x64')]=function(_0x5d7ad2,_0x484561){_0x5d7ad2[_0x1814('0x4b')][_0x1814('0x65')]=_0x5d7ad2[_0x1814('0x61')][_0x1814('0x63')];return db[_0x1814('0x2e')][_0x1814('0x48')]({'where':{'id':_0x5d7ad2[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x484561,null))['then'](saveUpdates(_0x5d7ad2[_0x1814('0x4b')],null))[_0x1814('0x14')](respondWithResult(_0x484561,null))[_0x1814('0x49')](handleError(_0x484561,null));};exports[_0x1814('0x66')]=function(_0x2731c2,_0x92bbd6){_0x2731c2[_0x1814('0x4b')][_0x1814('0x67')]=_0x2731c2[_0x1814('0x61')]['filename'];return db[_0x1814('0x2e')][_0x1814('0x48')]({'where':{'id':_0x2731c2[_0x1814('0x46')]['id']}})['then'](handleEntityNotFound(_0x92bbd6,null))[_0x1814('0x14')](saveUpdates(_0x2731c2[_0x1814('0x4b')],null))['then'](respondWithResult(_0x92bbd6,null))[_0x1814('0x49')](handleError(_0x92bbd6,null));};exports[_0x1814('0x68')]=function(_0x191220,_0x198351){var _0x296d9f=path[_0x1814('0x69')](config[_0x1814('0x6a')],'server/files/images/logos/default_logo.svg');var _0x543fda={'where':{'id':_0x191220[_0x1814('0x46')]['id']},'attributes':['id',_0x1814('0x6b')],'raw':!![]};var _0x43712c=![];return require(_0x1814('0x6c'))[_0x1814('0x6d')]()['then'](function(_0x5124cb){if(_0x5124cb){_0x43712c=_0x5124cb[_0x1814('0x6e')];}})[_0x1814('0x14')](function(){return db['ChatWebsite'][_0x1814('0x48')](_0x543fda);})['then'](handleEntityNotFound(_0x198351,null))[_0x1814('0x14')](function(_0x5c4e6b){if(_0x5c4e6b){if(!_[_0x1814('0x6f')](_0x5c4e6b[_0x1814('0x6b')])){if(fs[_0x1814('0x70')](path[_0x1814('0x69')](config[_0x1814('0x6a')],_0x1814('0x71'),_0x5c4e6b[_0x1814('0x6b')]))&&_0x43712c){_0x296d9f=path[_0x1814('0x69')](config[_0x1814('0x6a')],_0x1814('0x71'),_0x5c4e6b[_0x1814('0x6b')]);}}return _0x198351['download'](_0x296d9f);}})[_0x1814('0x49')](handleError(_0x198351,null));};exports[_0x1814('0x72')]=function(_0x4cd175,_0x528a70){var _0x46f5e4=path['join'](config[_0x1814('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x441360={'where':{'id':_0x4cd175[_0x1814('0x46')]['id']},'attributes':['id',_0x1814('0x73')],'raw':!![]};return db[_0x1814('0x2e')]['find'](_0x441360)[_0x1814('0x14')](handleEntityNotFound(_0x528a70,null))[_0x1814('0x14')](function(_0x3c0dc6){if(_0x3c0dc6){if(!_[_0x1814('0x6f')](_0x3c0dc6[_0x1814('0x73')])){if(fs[_0x1814('0x70')](path[_0x1814('0x69')](config['root'],_0x1814('0x74'),_0x3c0dc6['agentAvatar']))){_0x46f5e4=path['join'](config[_0x1814('0x6a')],_0x1814('0x74'),_0x3c0dc6[_0x1814('0x73')]);}}return _0x528a70['download'](_0x46f5e4);}})['catch'](handleError(_0x528a70,null));};exports['getCustomerAvatar']=function(_0x3a4f1b,_0x56e8ed){var _0x4af814=path[_0x1814('0x69')](config[_0x1814('0x6a')],_0x1814('0x75'));var _0x1e02ed={'where':{'id':_0x3a4f1b[_0x1814('0x46')]['id']},'attributes':['id',_0x1814('0x65'),_0x1814('0x76')],'raw':!![]};return db[_0x1814('0x2e')][_0x1814('0x48')](_0x1e02ed)[_0x1814('0x14')](handleEntityNotFound(_0x56e8ed,null))['then'](function(_0x445ae0){if(_0x445ae0){if(!_['isNil'](_0x445ae0[_0x1814('0x65')])){if(fs['existsSync'](path[_0x1814('0x69')](config['root'],_0x1814('0x74'),_0x445ae0[_0x1814('0x65')]))&&_0x445ae0[_0x1814('0x76')]){_0x4af814=path['join'](config[_0x1814('0x6a')],_0x1814('0x74'),_0x445ae0[_0x1814('0x65')]);}}return _0x56e8ed[_0x1814('0x77')](_0x4af814);}})[_0x1814('0x49')](handleError(_0x56e8ed,null));};exports[_0x1814('0x78')]=function(_0x3ff4e6,_0x4cb864){var _0x15b13b=path['join'](config[_0x1814('0x6a')],_0x1814('0x79'));var _0x342d80={'where':{'id':_0x3ff4e6[_0x1814('0x46')]['id']},'attributes':['id',_0x1814('0x67')],'raw':!![]};return db['ChatWebsite'][_0x1814('0x48')](_0x342d80)['then'](handleEntityNotFound(_0x4cb864,null))[_0x1814('0x14')](function(_0x2ebe27){if(_0x2ebe27){if(!_[_0x1814('0x6f')](_0x2ebe27[_0x1814('0x67')])){if(fs[_0x1814('0x70')](path[_0x1814('0x69')](config[_0x1814('0x6a')],'server/files/images/avatars/',_0x2ebe27[_0x1814('0x67')]))){_0x15b13b=path[_0x1814('0x69')](config[_0x1814('0x6a')],_0x1814('0x74'),_0x2ebe27[_0x1814('0x67')]);}}return _0x4cb864['download'](_0x15b13b);}})[_0x1814('0x49')](handleError(_0x4cb864,null));};exports[_0x1814('0x7a')]=function(_0x5f3aea,_0x231989){var _0x1a1f09=require(_0x1814('0x7b'));var _0x5406c4=new _0x1a1f09();var _0x1f6490=_0x5406c4[_0x1814('0x7c')](_0x5f3aea[_0x1814('0x7d')]['user-agent'])[_0x1814('0x7e')]();var _0x242ebc={'body':_0x5f3aea[_0x1814('0x4b')],'channel':'chat'};var _0x4615c5=[];var _0x56e9a4=[];var _0x119205={};var _0x143bae=![];return db[_0x1814('0x7f')][_0x1814('0x53')]()[_0x1814('0x14')](function(_0x385006){if(!_0x385006){throw new db[(_0x1814('0x80'))][(_0x1814('0x81'))](_0x1814('0x82'));}_0x4615c5=_[_0x1814('0x83')](_[_0x1814('0x34')](_0x385006),[_0x1814('0x84'),_0x1814('0x85')]);_0x56e9a4=_['difference'](_['keys'](_0x385006),['createdAt',_0x1814('0x85'),_0x1814('0x86'),_0x1814('0x87')]);if(_0x5f3aea[_0x1814('0x4b')]['id']){delete _0x5f3aea[_0x1814('0x4b')]['id'];}if(_['isNil'](_0x5f3aea[_0x1814('0x4b')][_0x1814('0x88')])){throw new db['Sequelize'][(_0x1814('0x81'))](_0x1814('0x89'));}if(_['isNil'](_0x5f3aea[_0x1814('0x4b')][_0x1814('0x4b')])||_0x5f3aea['body'][_0x1814('0x4b')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1814('0x6f')](_0x5f3aea[_0x1814('0x4b')][_0x1814('0x8a')])){throw new db[(_0x1814('0x80'))][(_0x1814('0x81'))](_0x1814('0x8b')+_0x56e9a4);}if(!_[_0x1814('0x8c')](_0x56e9a4,_0x5f3aea[_0x1814('0x4b')][_0x1814('0x8a')])){throw new db[(_0x1814('0x80'))][(_0x1814('0x81'))](_0x1814('0x8d')+_0x56e9a4);}_0x119205[_0x5f3aea[_0x1814('0x4b')]['mapKey']]=_0x5f3aea['body'][_0x1814('0x88')];})[_0x1814('0x14')](function(){return db[_0x1814('0x2e')][_0x1814('0x48')]({'where':{'id':_0x5f3aea[_0x1814('0x46')]['id']},'include':[{'model':db[_0x1814('0x8e')],'as':'List','include':[{'model':db['CmContact'],'as':_0x1814('0x8f'),'where':_0x119205,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1814('0x90')],'as':_0x1814('0x91')}]});})[_0x1814('0x14')](handleEntityNotFound(_0x231989,null))[_0x1814('0x14')](function(_0x3ac3ec){if(_0x3ac3ec&&_0x3ac3ec[_0x1814('0x92')]){_0x242ebc[_0x1814('0x93')]=_0x3ac3ec;_0x242ebc[_0x1814('0x94')]=_0x3ac3ec['Applications'];_0x242ebc[_0x1814('0x95')]=_0x3ac3ec[_0x1814('0x92')];_0x242ebc[_0x1814('0x94')]=_[_0x1814('0x96')](_0x242ebc[_0x1814('0x94')],[_0x1814('0x97')],[_0x1814('0x98')]);if(_0x242ebc['account']['Applications']){delete _0x242ebc['account'][_0x1814('0x91')];}if(_0x242ebc[_0x1814('0x93')][_0x1814('0x92')]&&_0x242ebc[_0x1814('0x93')][_0x1814('0x92')][_0x1814('0x8f')][_0x1814('0x39')]){return _0x242ebc[_0x1814('0x93')]['List']['Contacts'][0x0];}var _0x76920d=_[_0x1814('0xb')](_0x5f3aea[_0x1814('0x4b')],{'firstName':_0x5f3aea[_0x1814('0x4b')][_0x1814('0x88')],'ListId':_0x3ac3ec[_0x1814('0x87')]});_0x76920d[_0x5f3aea[_0x1814('0x4b')]['mapKey']]=_0x5f3aea[_0x1814('0x4b')][_0x1814('0x88')];return db[_0x1814('0x7f')][_0x1814('0x4a')](_0x76920d,{'fields':_0x4615c5,'raw':!![]});}})[_0x1814('0x14')](handleEntityNotFound(_0x231989,null))['then'](function(_0x5b81bc){_0x242ebc['contact']=_0x5b81bc;var _0x5c6bbe=_0x5f3aea[_0x1814('0x4b')][_0x1814('0x99')];if(_0x5f3aea[_0x1814('0x7d')][_0x1814('0x9a')]){_0x5c6bbe=_0x5f3aea['headers'][_0x1814('0x9a')];}else if(_0x5f3aea['headers'][_0x1814('0x9b')]){_0x5c6bbe=_[_0x1814('0x9c')](_0x5f3aea[_0x1814('0x7d')][_0x1814('0x9b')]['split'](','));}if(_0x5b81bc){var _0xec42dc={'ContactId':_0x5b81bc['id'],'ChatWebsiteId':_0x5f3aea[_0x1814('0x46')]['id'],'from':(_0x5b81bc[_0x1814('0x9d')]||'')+'\x20'+(_0x5b81bc['lastName']||''),'customerIp':_0x5c6bbe,'customerPort':_0x5f3aea['headers'][_0x1814('0x9e')]?_0x5f3aea[_0x1814('0x7d')][_0x1814('0x9e')]:null,'referer':_0x5f3aea[_0x1814('0x4b')][_0x1814('0x9f')],'browserName':_0x1f6490[_0x1814('0xa0')][_0x1814('0x29')]&&_0x1f6490[_0x1814('0xa0')]['version']?util[_0x1814('0xa1')](_0x1814('0xa2'),_0x1f6490[_0x1814('0xa0')]['name'],_0x1f6490['browser'][_0x1814('0xa3')]):_0x1814('0xa4'),'browserVersion':_0x1f6490[_0x1814('0xa0')]['version']||_0x1814('0xa4'),'osName':util[_0x1814('0xa1')](_0x1814('0xa2'),_0x1f6490['os'][_0x1814('0x29')],_0x1f6490['os'][_0x1814('0xa3')]),'osVersion':_0x1f6490['os'][_0x1814('0xa3')],'deviceModel':_0x1f6490[_0x1814('0xa5')][_0x1814('0x32')]&&_0x1f6490[_0x1814('0xa5')]['vendor']?util[_0x1814('0xa1')](_0x1814('0xa6'),_0x1f6490[_0x1814('0xa5')][_0x1814('0x32')],_0x1f6490[_0x1814('0xa5')]['vendor'],_0x1f6490[_0x1814('0xa5')]['type']):null,'deviceVendor':_0x1f6490[_0x1814('0xa5')]['vendor'],'deviceType':_0x1f6490[_0x1814('0xa5')][_0x1814('0x31')],'formData':JSON[_0x1814('0xa7')](_0x5f3aea[_0x1814('0x4b')])};var _0x31c0de={'ChatWebsiteId':_0x5f3aea['params']['id'],'closed':![]};if(_0x5f3aea[_0x1814('0x4b')][_0x1814('0xa8')]){_0x31c0de['threadId']=_0x5f3aea[_0x1814('0x4b')][_0x1814('0xa8')];return db['ChatInteraction']['find']({'where':_0x31c0de})[_0x1814('0x14')](function(_0x16b48b){if(_0x16b48b){return[_0x16b48b,![]];}_0xec42dc['threadId']=_0x5f3aea[_0x1814('0x4b')][_0x1814('0xa8')];_0xec42dc[_0x1814('0xa9')]=_0x5f3aea['body']['externalUrl'];return db[_0x1814('0xaa')]['create'](_0xec42dc)[_0x1814('0x14')](function(_0xfa2aa4){return[_0xfa2aa4,!![]];});});}_0x31c0de['ContactId']=_0x5b81bc['id'];if(_0x5f3aea[_0x1814('0x4b')][_0x1814('0xab')]&&_0x5f3aea[_0x1814('0x4b')][_0x1814('0xab')]['id']){_0x31c0de['id']=_0x5f3aea[_0x1814('0x4b')][_0x1814('0xab')]['id'];return db[_0x1814('0xaa')][_0x1814('0x48')]({'where':_0x31c0de})[_0x1814('0x14')](function(_0x2ee2e1){if(_0x2ee2e1){return[_0x2ee2e1,![]];}return db[_0x1814('0xaa')]['create'](_0xec42dc)['then'](function(_0x32a1df){return[_0x32a1df,!![]];});});}return db[_0x1814('0xaa')][_0x1814('0x4a')](_0xec42dc)['then'](function(_0x36ce99){return[_0x36ce99,!![]];});}})['spread'](function(_0x10aba8,_0x2f9ab8){if(_0x10aba8){_0x143bae=_0x2f9ab8;if(!_0x2f9ab8){var _0x30a183={'from':(_0x242ebc['contact'][_0x1814('0x9d')]||'')+'\x20'+(_0x242ebc[_0x1814('0xac')][_0x1814('0xad')]||'')};if(_0x5f3aea[_0x1814('0x4b')][_0x1814('0xa8')]&&_0x5f3aea[_0x1814('0x4b')][_0x1814('0xae')]&&_0x5f3aea[_0x1814('0x4b')][_0x1814('0xa8')]!=_0x5f3aea[_0x1814('0x4b')][_0x1814('0xae')]){_0x30a183[_0x1814('0xa8')]=_0x5f3aea[_0x1814('0x4b')]['messageId'];}return _0x10aba8[_0x1814('0x52')](_0x30a183);}else{return _0x10aba8;}}})[_0x1814('0x14')](function(_0x16f9a2){_0x242ebc[_0x1814('0xab')]=_0x16f9a2[_0x1814('0x4d')]({'plain':!![]});_0x242ebc[_0x1814('0xab')]['created']=_0x143bae;if(_0x242ebc['interaction'][_0x1814('0xaf')]){if(_0x242ebc['account'][_0x1814('0xb0')]){_0x242ebc[_0x1814('0x94')][_0x1814('0xb1')]({'id':0x0,'priority':_0x242ebc[_0x1814('0x94')]['length']+0x1,'app':_0x1814('0xb2'),'appdata':_0x1814('0xb3'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x1814('0x4a')]({'body':_0x5f3aea[_0x1814('0x4b')][_0x1814('0x4b')],'ChatWebsiteId':_0x5f3aea[_0x1814('0x46')]['id'],'ChatInteractionId':_0x16f9a2['id'],'direction':'in','ContactId':_0x242ebc[_0x1814('0xac')]['id'],'AttachmentId':_0x5f3aea[_0x1814('0x4b')][_0x1814('0xb4')]});})[_0x1814('0x14')](function(_0xaa45be){_0x242ebc['message']=_0xaa45be;if(_0x242ebc[_0x1814('0xab')][_0x1814('0xb5')]){return db['User'][_0x1814('0x48')]({'attributes':['id','name'],'where':{'id':_0x242ebc['interaction'][_0x1814('0xb5')]}})[_0x1814('0x14')](function(_0x17c0b9){if(_0x17c0b9){_0x242ebc[_0x1814('0x94')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1814('0xb6'),'appdata':_0x17c0b9[_0x1814('0x29')]+','+(_0x242ebc['account'][_0x1814('0xb7')]||0xa),'interval':'*,*,*,*'});_0x242ebc['forcedOwnership']=!![];}return respondWithRpcPromise(_0x1814('0xb8'),_0x1814('0xb9'),_0x242ebc);});}return respondWithRpcPromise('Start',_0x1814('0xb9'),_0x242ebc);})[_0x1814('0x14')](function(_0x7573b0){respondWithRpcPromise(_0x1814('0xba'),_0x1814('0xba'),{'event':'notify','message':_0x7573b0},client9002);return _0x7573b0;})[_0x1814('0x14')](respondWithResult(_0x231989,null))[_0x1814('0x49')](handleError(_0x231989,null));};exports[_0x1814('0xbb')]=function(_0x494ecc,_0xfd7e8e){var _0xe5a1d0,_0x332899,_0x41c923;var _0x508dff=[];var _0x5cf2e9={};var _0x50524f=_0x494ecc[_0x1814('0xbc')]||[];var _0x2f32fd=[];var _0x51c975;return db[_0x1814('0x7f')][_0x1814('0x53')]()[_0x1814('0x14')](function(_0x4723c5){if(!_0x4723c5){throw new db[(_0x1814('0x80'))][(_0x1814('0x81'))](_0x1814('0x82'));}_0x508dff=_[_0x1814('0x83')](_[_0x1814('0x34')](_0x4723c5),[_0x1814('0x84'),_0x1814('0x85'),_0x1814('0x86'),_0x1814('0x87')]);if(_0x494ecc['body']['id']){delete _0x494ecc[_0x1814('0x4b')]['id'];}if(_['isNil'](_0x494ecc[_0x1814('0x4b')][_0x1814('0x88')])){throw _0xfd7e8e[_0x1814('0x1c')](0x1f4)[_0x1814('0x2a')](new db[(_0x1814('0x80'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x1814('0x6f')](_0x494ecc[_0x1814('0x4b')]['body'])||_0x494ecc[_0x1814('0x4b')][_0x1814('0x4b')]===''){throw _0xfd7e8e['status'](0x1f4)[_0x1814('0x2a')](new db[(_0x1814('0x80'))][(_0x1814('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x494ecc[_0x1814('0x4b')][_0x1814('0xbd')])){throw _0xfd7e8e[_0x1814('0x1c')](0x1f4)[_0x1814('0x2a')](new db[(_0x1814('0x80'))][(_0x1814('0x81'))](_0x1814('0xbe')+_0x508dff));}if(!_[_0x1814('0x8c')](_0x508dff,_0x494ecc[_0x1814('0x4b')][_0x1814('0xbd')])){throw _0xfd7e8e[_0x1814('0x1c')](0x1f4)['send'](new db[(_0x1814('0x80'))][(_0x1814('0x81'))](_0x1814('0xbf')+_0x508dff));}_0x5cf2e9[_0x494ecc[_0x1814('0x4b')][_0x1814('0xbd')]]=_0x494ecc[_0x1814('0x4b')][_0x1814('0x88')];})['then'](function(){return db[_0x1814('0x2e')]['find']({'where':{'id':_0x494ecc[_0x1814('0x46')]['id']},'include':[{'model':db[_0x1814('0x8e')],'as':_0x1814('0x92')},{'model':db[_0x1814('0xc0')],'as':_0x1814('0xc0')}]});})[_0x1814('0x14')](handleEntityNotFound(_0xfd7e8e,null))[_0x1814('0x14')](function(_0x2b2589){if(_0x2b2589&&_0x2b2589[_0x1814('0x92')]){_0x332899=_0x2b2589;var _0x4831dc=_[_0x1814('0xb')](_0x494ecc[_0x1814('0x4b')],{'firstName':_0x494ecc[_0x1814('0x4b')][_0x1814('0x88')],'phone':_0x494ecc['body'][_0x1814('0x88')],'ListId':_0x2b2589[_0x1814('0x87')]});_0x4831dc[_0x494ecc['body']['mapKeyOffline']]=_0x494ecc['body'][_0x1814('0x88')];return db['CmContact']['findOrCreate']({'where':_0x5cf2e9,'defaults':_0x4831dc});}})['spread'](function(_0x254e16){if(_0x254e16){_0x41c923=_0x254e16;var _0x2c0d93=fs[_0x1814('0xc1')](path[_0x1814('0x69')](config[_0x1814('0x6a')],_0x1814('0xc2')),'utf8');var _0x268c62=ejs[_0x1814('0xc3')](_0x2c0d93,{'body':_['toPairs'](_0x494ecc['body']['body']),'bodyTitle':_0x332899[_0x1814('0xc4')]});return db[_0x1814('0xc5')][_0x1814('0x4a')]({'body':_0x268c62,'plainBody':htmlToText[_0x1814('0xc6')](_0x268c62),'ContactId':_0x254e16['id'],'ChatWebsiteId':_0x332899['id']});}})['then'](function(_0xb4021){_0x51c975=_0xb4021;if(_0x50524f[_0x1814('0x39')]){var _0x2602cd=_0x50524f[_0x1814('0x2d')](function(_0x3fc1e7){return{'name':_0x3fc1e7[_0x1814('0xc7')],'basename':_0x3fc1e7['filename'],'type':_0x3fc1e7['mimetype'],'ChatOfflineMessageId':_0xb4021['id']};});_0x2f32fd=_0x2602cd['map'](_0x5d55a7=>{var _0x5997cb={'filename':_0x5d55a7[_0x1814('0x29')],'path':path[_0x1814('0x69')](config['root'],_0x1814('0xc8'),_0x1814('0xbc'),'attachments',_0x1814('0xc9'),_0x5d55a7[_0x1814('0xca')])};return _0x5997cb;});if(!_0x332899[_0x1814('0xcb')]){return db['sequelize'][_0x1814('0xcc')](function(_0x35aad3){return db[_0x1814('0xcd')][_0x1814('0xce')](_0x2602cd,{'transaction':_0x35aad3});});}}})['then'](function(){if(_0x51c975){_0xe5a1d0=_0x51c975;return db[_0x1814('0xc0')][_0x1814('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0x1814('0xcf')],'as':_0x1814('0xd0'),'raw':!![],'include':[{'model':db[_0x1814('0xd1')],'as':_0x1814('0xd1'),'raw':!![]}]}]});}})['then'](function(_0x3d4a01){if(_0x3d4a01&&_0x3d4a01['Smtp']&&_0x332899['forwardOffline']&&_0x332899['forwardOfflineAddress']){var _0x53296b=_0x3d4a01['getSmtpOptions']();return respondWithRpcPromise(_0x1814('0xd2'),_0x1814('0xd3'),{'account':_0x53296b,'message':{'from':util[_0x1814('0xa1')]('\x22%s\x22\x20<%s>',_0x3d4a01['name'],_0x3d4a01['email']||_0x3d4a01[_0x1814('0xd0')][_0x1814('0x4c')]),'to':_0x332899[_0x1814('0xd4')],'subject':_0x332899[_0x1814('0xd5')],'html':_0xe5a1d0[_0x1814('0x4b')],'attachments':_0x2f32fd}},client9003)[_0x1814('0x14')](function(){return _0xe5a1d0;})[_0x1814('0x49')](function(_0x1e570f){logger[_0x1814('0x1a')](_0x1e570f);});}})[_0x1814('0x14')](function(){if(_0x332899&&_0x332899[_0x1814('0xcb')]&&_0x332899['MailAccountId']){var _0x5d4a36=[];if(_0x50524f[_0x1814('0x39')]){_0x5d4a36=_0x50524f[_0x1814('0x2d')](function(_0x5a6a9c){return{'name':_0x5a6a9c['originalname'],'basename':_0x5a6a9c['filename'],'type':_0x5a6a9c[_0x1814('0xd6')],'ChatOfflineMessageId':_0x51c975['id']};});}var _0x405dae;if(!_[_0x1814('0x6f')](_0x332899[_0x1814('0xd7')])){var _0xe7dcdd=_['map'](_0x494ecc['body'],function(_0x150be1){return _0x150be1;});var _0x100173=_['toPairsIn'](_0xe7dcdd)[0x0];var _0x412185=_[_0x1814('0xd8')](_0x100173,function(_0x3c3970){return _0x3c3970;});_0x405dae=_0x412185[0x1][_0x332899[_0x1814('0xd7')]];}var _0x3fd74e={'from':_0x41c923[_0x1814('0xd9')],'firstName':_0x41c923[_0x1814('0x9d')],'lastName':_0x41c923[_0x1814('0xad')],'mapKey':_0x1814('0xd9'),'message':{'from':_0x41c923[_0x1814('0xd9')],'to':_0x332899[_0x1814('0xc0')]['email'],'cc':'','subject':_[_0x1814('0x6f')](_0x405dae)?_0x332899[_0x1814('0xd5')]:_0x405dae,'messageId':'','sentAt':new Date(),'attach':_0x5d4a36[_0x1814('0x39')],'attachments':_0x5d4a36,'originChannel':_0x1814('0xda'),'ChatWebsiteId':_0x332899['id'],'ChatOfflineMessageId':_0xe5a1d0['id'],'originTo':_0x332899[_0x1814('0xc0')][_0x1814('0xd9')]},'body':_0xe5a1d0[_0x1814('0x4b')]};var _0x376f55={'account':{'id':_0x332899[_0x1814('0xdb')]},'body':_0x3fd74e,'log':_0x1814('0xdc')};return respondWithRpcPromise(_0x1814('0xdc'),'notifyMail',_0x376f55,client9001)[_0x1814('0x14')](function(){return _0xe5a1d0;})[_0x1814('0x49')](function(_0x5bf9dc){logger[_0x1814('0x1a')](_0x5bf9dc);});}return;})[_0x1814('0x14')](function(){if(_0xe5a1d0){return _0xe5a1d0;}})[_0x1814('0x14')](respondWithResult(_0xfd7e8e,null))[_0x1814('0x49')](function(_0x496158){logger['error'](_0x1814('0x49'),_0x496158);for(var _0x3c52e5 of _0x50524f){var _0x4bee22=path[_0x1814('0x69')](config[_0x1814('0x6a')],_0x1814('0xc8'),'files',_0x1814('0xdd'),_0x1814('0xc9'),_0x3c52e5['filename']);fs_extra['remove'](_0x4bee22)[_0x1814('0x49')](function(_0x46eb5d){logger[_0x1814('0x1a')](_0x1814('0xde'),_0x4bee22,_0x46eb5d);});}});};exports[_0x1814('0xdf')]=function(_0x8e73ff,_0x39e95d){return db[_0x1814('0xaa')][_0x1814('0x48')]({'where':{'id':_0x8e73ff[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x39e95d,null))['then'](function(_0x3f2c60){if(_0x3f2c60){return _0x3f2c60[_0x1814('0xdf')](_0x8e73ff[_0x1814('0x4b')][_0x1814('0x5b')],_[_0x1814('0xe0')](_0x8e73ff[_0x1814('0x4b')],['ids','id'])||{});}})[_0x1814('0x14')](respondWithResult(_0x39e95d,null))[_0x1814('0x49')](handleError(_0x39e95d,null));};exports[_0x1814('0xe1')]=function(_0xa173ed,_0x1ca131){var _0x1069ad={'raw':![],'where':{}};var _0x5aff46={};var _0x10148e={'count':0x0,'rows':[]};return db[_0x1814('0x2e')]['findOne']({'where':{'id':_0xa173ed[_0x1814('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ca131,null))[_0x1814('0x14')](function(_0x5032b2){if(_0x5032b2){_0x5aff46[_0x1814('0x32')]=_[_0x1814('0x34')](db[_0x1814('0xaa')][_0x1814('0x2f')]);_0x5aff46[_0x1814('0x33')]=_[_0x1814('0x34')](_0xa173ed[_0x1814('0x33')]);_0x5aff46[_0x1814('0x35')]=_[_0x1814('0x37')](_0x5aff46[_0x1814('0x32')],_0x5aff46[_0x1814('0x33')]);_0x1069ad[_0x1814('0x36')]=_[_0x1814('0x37')](_0x5aff46[_0x1814('0x32')],qs[_0x1814('0x38')](_0xa173ed[_0x1814('0x33')]['fields']));_0x1069ad[_0x1814('0x36')]=_0x1069ad[_0x1814('0x36')]['length']?_0x1069ad['attributes']:_0x5aff46[_0x1814('0x32')];if(!_0xa173ed[_0x1814('0x33')][_0x1814('0x58')](_0x1814('0x5e'))){_0x1069ad['limit']=qs['limit'](_0xa173ed[_0x1814('0x33')][_0x1814('0x20')]);_0x1069ad[_0x1814('0x1e')]=qs[_0x1814('0x1e')](_0xa173ed['query'][_0x1814('0x1e')]);}_0x1069ad[_0x1814('0x3a')]=qs[_0x1814('0x3b')](_0xa173ed[_0x1814('0x33')][_0x1814('0x3b')]);_0x1069ad[_0x1814('0x3e')]=qs['filters'](_[_0x1814('0x3c')](_0xa173ed[_0x1814('0x33')],_0x5aff46['filters']));_0x1069ad[_0x1814('0x3e')][_0x1814('0x54')]=_0x5032b2['id'];if(_0xa173ed[_0x1814('0x33')][_0x1814('0x3d')]){_0x1069ad[_0x1814('0x3e')]=_['merge'](_0x1069ad[_0x1814('0x3e')],{'$or':_[_0x1814('0x2d')](_0x1069ad[_0x1814('0x36')],function(_0x46a2b4){var _0x9aac5={};_0x9aac5[_0x46a2b4]={'$like':'%'+_0xa173ed[_0x1814('0x33')]['filter']+'%'};return _0x9aac5;})});}_0x1069ad=_[_0x1814('0x3f')]({},_0x1069ad,_0xa173ed[_0x1814('0x41')]);return db[_0x1814('0xaa')][_0x1814('0x21')]({'where':_0x1069ad[_0x1814('0x3e')]})['then'](function(_0x437a6f){_0x10148e['count']=_0x437a6f;if(_0xa173ed['query'][_0x1814('0x42')]){_0x1069ad[_0x1814('0x43')]=[{'model':db[_0x1814('0x7f')],'as':'Contact','required':![]},{'model':db[_0x1814('0xe2')],'as':_0x1814('0xe3'),'attributes':[_0x1814('0x29'),_0x1814('0xe4'),_0x1814('0xe5')],'required':![]},{'model':db['Tag'],'as':_0x1814('0xe6'),'attributes':['id',_0x1814('0x29'),_0x1814('0xe7')],'where':_0xa173ed[_0x1814('0x33')][_0x1814('0xe8')]?{'id':_0xa173ed[_0x1814('0x33')][_0x1814('0xe8')]}:undefined,'required':_0xa173ed[_0x1814('0x33')][_0x1814('0xe8')]?!![]:![]}];}return db[_0x1814('0xaa')][_0x1814('0x59')](_0x1069ad);})['then'](function(_0x1adc39){_0x10148e['rows']=_0x1adc39;return _0x10148e;});}})[_0x1814('0x14')](respondWithFilteredResult(_0x1ca131,_0x1069ad))[_0x1814('0x49')](handleError(_0x1ca131,null));};function iftimePromise(_0x3bffeb,_0x461a9e){return respondWithRpcPromise(_0x1814('0xe9'),_0x1814('0xea'),{'command':_0x461a9e[_0x1814('0xeb')]?util[_0x1814('0xa1')](_0x1814('0xec'),_0x3bffeb[_0x1814('0xed')],_0x461a9e[_0x1814('0xeb')]):util[_0x1814('0xa1')]('iftime\x20%s',_0x3bffeb[_0x1814('0xed')])},client9002)[_0x1814('0x14')](function(_0x53a971){var _0x24caec=_0x53a971&&_0x53a971[_0x1814('0xee')](_0x1814('0xef'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x461a9e['id'],_0x3bffeb['id'],_0x3bffeb[_0x1814('0xed')],_0x24caec?_0x1814('0xf0'):_0x1814('0xf1'),_0x461a9e[_0x1814('0xeb')]?_0x461a9e[_0x1814('0xeb')]:_0x1814('0xf2'));return _0x24caec;})['catch'](function(_0x2471b2){logger[_0x1814('0x1a')](_0x1814('0xf3'),_0x461a9e['id'],_0x3bffeb['id'],_0x3bffeb['interval'],util[_0x1814('0xf4')](_0x2471b2,{'showHidden':![],'depth':null}),_0x461a9e[_0x1814('0xeb')]?_0x461a9e[_0x1814('0xeb')]:_0x1814('0xf2'));return![];});}exports[_0x1814('0xea')]=function(_0x49226b,_0x3b6fde){var _0x54a6dd=0x0;var _0x122718=0x0;var _0xe07c42=![];var _0x14b16f;var _0x4a2bc7;return db['ChatWebsite'][_0x1814('0x48')]({'where':{'id':_0x49226b[_0x1814('0x46')]['id']},'include':[{'model':db[_0x1814('0xf5')],'as':_0x1814('0xf5'),'include':[{'model':db['Interval'],'as':_0x1814('0xf6'),'attributes':['id',_0x1814('0xed')],'raw':!![]}]}]})[_0x1814('0x14')](handleEntityNotFound(_0x3b6fde,null))[_0x1814('0x14')](function(_0x1bf0f3){if(_0x1bf0f3){_0x14b16f=_0x1bf0f3;return _0x1bf0f3[_0x1814('0xf7')]({'raw':!![]});}})[_0x1814('0x14')](function(_0x3a7b78){if(_0x14b16f){if(_0x3a7b78){_0x4a2bc7=_0x3a7b78;}}return require(_0x1814('0x6c'))[_0x1814('0x6d')]();})[_0x1814('0x14')](function(_0x3b2525){if(_0x3b2525){_0x122718=_0x3b2525[_0x1814('0xf8')];_0xe07c42=_0x3b2525[_0x1814('0x6e')];}})['then'](function(){return db['ChatInteraction'][_0x1814('0x21')]({'where':{'closed':![]}});})[_0x1814('0x14')](function(_0x205533){_0x54a6dd=_0x205533;if(_0x122718&&_0x205533>_0x122718){return db[_0x1814('0xf9')][_0x1814('0x56')]({'where':{'id':0x1}})[_0x1814('0x14')](function(_0x428a1b){if(_0x428a1b){_0x428a1b[_0x1814('0xfa')](_0x1814('0xfb'));}});}})[_0x1814('0x14')](function(){if(_0x14b16f[_0x1814('0xf5')]&&_0x14b16f[_0x1814('0xf5')][_0x1814('0xf6')]){var _0x2d3f7b=[];for(var _0x404c04=0x0;_0x404c04<_0x14b16f['Interval'][_0x1814('0xf6')][_0x1814('0x39')];_0x404c04++){var _0x5c761e=_0x14b16f[_0x1814('0xf5')]['Intervals'][_0x404c04]['get']({'plain':!![]});_0x2d3f7b[_0x1814('0xb1')](iftimePromise(_0x5c761e,_0x14b16f));}return BPromise[_0x1814('0xfc')](_0x2d3f7b)[_0x1814('0x14')](function(_0x305a22){return _[_0x1814('0xfd')](_0x305a22);});}else{return!![];}})['then'](function(_0x3b80b5){var _0x59b8ec=fs[_0x1814('0xc1')](path[_0x1814('0x69')](config[_0x1814('0x6a')],_0x1814('0xfe')),_0x1814('0xff'));var _0x1ddbe3={'remote':_0x14b16f[_0x1814('0x100')],'query':querystring['stringify'](_['merge'](_0x14b16f[_0x1814('0x4d')]({'plain':!![]}),{'customerIp':_0x49226b[_0x1814('0x7d')]['x-forwarded-for']||_0x49226b[_0x1814('0x7d')]['x-real-ip']||_0x49226b[_0x1814('0x101')][_0x1814('0x102')]||_0x49226b['ip'],'referer':_0x49226b[_0x1814('0x7d')][_0x1814('0x9f')],'openedInteractions':_0x54a6dd,'maxInteractions':_0x122718,'virtual':_0xe07c42[_0x1814('0xf8')],'online':_0x3b80b5,'custom':_0xe07c42}))[_0x1814('0x103')](/'/g,'\x5c\x27')};_0x3b6fde[_0x1814('0x2a')](ejs[_0x1814('0xc3')](Mustache[_0x1814('0xc3')](_0x59b8ec,_0x1ddbe3),{'proactiveActions':_0x4a2bc7,'alignment':_0x14b16f[_0x1814('0x104')],'verticalAlignment':_0x14b16f[_0x1814('0x105')],'div_color':_0x14b16f[_0x1814('0xe7')],'labelText':_0x14b16f[_0x1814('0x106')],'text_color':_0x14b16f[_0x1814('0x107')],'text_button_color':_0x14b16f['textButtonColor'],'button_color':_0x14b16f['color_button'],'background_color':_0x14b16f['backgroundColor'],'hideWhenOffline':_0x14b16f['hideWhenOffline'],'interval':_0x14b16f[_0x1814('0x108')]}));})['catch'](handleError(_0x3b6fde,null));};exports[_0x1814('0x109')]=function(_0x14d1ac,_0x2ce0e9){var _0x43c6b1=_0x14d1ac['params']['id'];var _0x3775e8=_0x14d1ac[_0x1814('0x4b')];var _0x4e2efc=0xc8;var _0x14f512=null;return db[_0x1814('0x10a')][_0x1814('0xcc')]({'isolationLevel':db[_0x1814('0x10a')][_0x1814('0x10b')]['ISOLATION_LEVELS'][_0x1814('0x10c')]},function(_0x2a5775){return db[_0x1814('0x2e')][_0x1814('0x56')]({'where':{'id':_0x43c6b1},'transaction':_0x2a5775})[_0x1814('0x14')](function(_0x3b4626){if(_0x3b4626){return db['ChatApplication'][_0x1814('0x27')]({'where':{'ChatWebsiteId':_0x43c6b1},'transaction':_0x2a5775})['then'](function(){var _0x3dd619=_[_0x1814('0x2d')](_0x3775e8,function(_0x1cdec3){_0x1cdec3['ChatWebsiteId']=_0x43c6b1;return _0x1cdec3;});return db['ChatApplication'][_0x1814('0xce')](_0x3dd619,{'transaction':_0x2a5775});});}else{_0x4e2efc=0x194;_0x14f512=[];}});})['then'](function(){if(_0x4e2efc!==0x194){return db['ChatApplication'][_0x1814('0x10d')]({'where':{'ChatWebsiteId':_0x43c6b1},'order':'priority'})[_0x1814('0x14')](function(_0x38ebb4){_0x14f512=_0x38ebb4;});}})[_0x1814('0x49')](function(_0x50d953){_0x4e2efc=0x1f4;logger[_0x1814('0x1a')](_0x50d953[_0x1814('0x28')]);if(_0x50d953[_0x1814('0x29')]){delete _0x50d953[_0x1814('0x29')];}_0x14f512=_0x50d953;})['finally'](function(){if(_0x14f512===null){_0x2ce0e9[_0x1814('0x10e')](_0x4e2efc);}else{if(_0x4e2efc===0x1f4){_0x2ce0e9['status'](_0x4e2efc)['send'](_0x14f512);}else{_0x2ce0e9[_0x1814('0x1c')](_0x4e2efc)['json'](_0x14f512);}}});};exports[_0x1814('0x10f')]=function(_0x35b132,_0xa6ed97){var _0x207193={};var _0x5bfe51={};var _0x413f20;var _0x629241;return db[_0x1814('0x2e')][_0x1814('0x56')]({'where':{'id':_0x35b132[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0xa6ed97,null))['then'](function(_0x4aaea1){if(_0x4aaea1){_0x413f20=_0x4aaea1;_0x5bfe51[_0x1814('0x32')]=_[_0x1814('0x34')](db['ChatApplication']['rawAttributes']);_0x5bfe51[_0x1814('0x33')]=_[_0x1814('0x34')](_0x35b132[_0x1814('0x33')]);_0x5bfe51['filters']=_['intersection'](_0x5bfe51['model'],_0x5bfe51[_0x1814('0x33')]);_0x207193[_0x1814('0x36')]=_[_0x1814('0x37')](_0x5bfe51[_0x1814('0x32')],qs[_0x1814('0x38')](_0x35b132[_0x1814('0x33')][_0x1814('0x38')]));_0x207193[_0x1814('0x36')]=_0x207193[_0x1814('0x36')][_0x1814('0x39')]?_0x207193[_0x1814('0x36')]:_0x5bfe51[_0x1814('0x32')];_0x207193[_0x1814('0x3a')]=qs[_0x1814('0x3b')](_0x35b132['query']['sort']);_0x207193['where']=qs['filters'](_[_0x1814('0x3c')](_0x35b132[_0x1814('0x33')],_0x5bfe51['filters']));if(_0x35b132['query'][_0x1814('0x3d')]){_0x207193['where']=_[_0x1814('0x3f')](_0x207193['where'],{'$or':_[_0x1814('0x2d')](_0x207193[_0x1814('0x36')],function(_0x56ebb2){var _0x363a45={};_0x363a45[_0x56ebb2]={'$like':'%'+_0x35b132[_0x1814('0x33')][_0x1814('0x3d')]+'%'};return _0x363a45;})});}_0x207193=_['merge']({},_0x207193,_0x35b132['options']);return _0x413f20[_0x1814('0x10f')](_0x207193);}})['then'](function(_0x12f080){if(_0x12f080){_0x629241=_0x12f080['length'];if(!_0x35b132[_0x1814('0x33')][_0x1814('0x58')](_0x1814('0x5e'))){_0x207193['limit']=qs[_0x1814('0x20')](_0x35b132[_0x1814('0x33')][_0x1814('0x20')]);_0x207193[_0x1814('0x1e')]=qs[_0x1814('0x1e')](_0x35b132['query'][_0x1814('0x1e')]);}return _0x413f20[_0x1814('0x10f')](_0x207193);}})['then'](function(_0x310eb6){if(_0x310eb6){return _0x310eb6?{'count':_0x629241,'rows':_0x310eb6}:null;}})[_0x1814('0x14')](respondWithResult(_0xa6ed97,null))[_0x1814('0x49')](handleError(_0xa6ed97,null));};exports['addProactiveActions']=function(_0x3db574,_0x491d16){return db[_0x1814('0x110')][_0x1814('0x48')]({'where':{'id':_0x3db574[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x491d16,null))['then'](function(_0x350dd0){if(_0x350dd0){return _0x350dd0[_0x1814('0x111')](_0x3db574[_0x1814('0x4b')][_0x1814('0x5b')],_['omit'](_0x3db574['body'],[_0x1814('0x5b'),'id'])||{});}})[_0x1814('0x14')](respondWithResult(_0x491d16,null))[_0x1814('0x49')](handleError(_0x491d16,null));};exports[_0x1814('0xf7')]=function(_0x33c72,_0x6c3c1e){var _0x56cdf4={};var _0x385187={};var _0x25e898;var _0x3fc455;return db['ChatWebsite']['findOne']({'where':{'id':_0x33c72[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x6c3c1e,null))[_0x1814('0x14')](function(_0x3d111e){if(_0x3d111e){_0x25e898=_0x3d111e;_0x385187['model']=_[_0x1814('0x34')](db[_0x1814('0x112')][_0x1814('0x2f')]);_0x385187[_0x1814('0x33')]=_[_0x1814('0x34')](_0x33c72['query']);_0x385187[_0x1814('0x35')]=_[_0x1814('0x37')](_0x385187[_0x1814('0x32')],_0x385187[_0x1814('0x33')]);_0x56cdf4[_0x1814('0x36')]=_['intersection'](_0x385187[_0x1814('0x32')],qs[_0x1814('0x38')](_0x33c72['query'][_0x1814('0x38')]));_0x56cdf4[_0x1814('0x36')]=_0x56cdf4[_0x1814('0x36')][_0x1814('0x39')]?_0x56cdf4['attributes']:_0x385187[_0x1814('0x32')];_0x56cdf4[_0x1814('0x3a')]=qs[_0x1814('0x3b')](_0x33c72[_0x1814('0x33')]['sort']);_0x56cdf4[_0x1814('0x3e')]=qs[_0x1814('0x35')](_[_0x1814('0x3c')](_0x33c72[_0x1814('0x33')],_0x385187[_0x1814('0x35')]));if(_0x33c72[_0x1814('0x33')][_0x1814('0x3d')]){_0x56cdf4[_0x1814('0x3e')]=_['merge'](_0x56cdf4[_0x1814('0x3e')],{'$or':_[_0x1814('0x2d')](_0x56cdf4[_0x1814('0x36')],function(_0x56d1ff){var _0x3b3edb={};_0x3b3edb[_0x56d1ff]={'$like':'%'+_0x33c72[_0x1814('0x33')]['filter']+'%'};return _0x3b3edb;})});}_0x56cdf4=_[_0x1814('0x3f')]({},_0x56cdf4,_0x33c72[_0x1814('0x41')]);return _0x25e898[_0x1814('0xf7')](_0x56cdf4);}})[_0x1814('0x14')](function(_0x1a06dd){if(_0x1a06dd){_0x3fc455=_0x1a06dd[_0x1814('0x39')];if(!_0x33c72[_0x1814('0x33')]['hasOwnProperty'](_0x1814('0x5e'))){_0x56cdf4['limit']=qs[_0x1814('0x20')](_0x33c72['query'][_0x1814('0x20')]);_0x56cdf4['offset']=qs['offset'](_0x33c72[_0x1814('0x33')][_0x1814('0x1e')]);}return _0x25e898[_0x1814('0xf7')](_0x56cdf4);}})[_0x1814('0x14')](function(_0x4d8f8a){if(_0x4d8f8a){return _0x4d8f8a?{'count':_0x3fc455,'rows':_0x4d8f8a}:null;}})['then'](respondWithResult(_0x6c3c1e,null))[_0x1814('0x49')](handleError(_0x6c3c1e,null));};exports[_0x1814('0x113')]=function(_0xbc00d3,_0x20583b){var _0x1fc49f=_0xbc00d3[_0x1814('0x33')][_0x1814('0x114')]===_0x1814('0x115')?'offlineForm':'onlineForm';return db[_0x1814('0x2e')][_0x1814('0x48')]({'attributes':['id',_0x1fc49f],'where':{'id':_0xbc00d3[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x20583b,null))['then'](function(_0x242f95){if(_0x242f95){var _0x274a52=_0x242f95[_0x1fc49f];var _0x42b77e=_0x274a52&&_0x274a52[_0x1814('0x116')]?_0x274a52[_0x1814('0x116')]:[];_0x20583b[_0x1814('0x2a')]({'fromKey':_[_0x1814('0x6f')](_0x274a52[_0x1814('0x117')])?undefined:_0x274a52[_0x1814('0x117')],'count':_0x42b77e[_0x1814('0x39')],'rows':_0x42b77e});}})['catch'](handleError(_0x20583b,null));};exports['getOfflineMessages']=function(_0xd166ed,_0x234443){var _0x16e1ba={'raw':![],'where':{}};var _0x57abc8={};var _0x2b413a={'count':0x0,'rows':[]};return db[_0x1814('0x2e')]['findOne']({'where':{'id':_0xd166ed[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x234443,null))[_0x1814('0x14')](function(_0x1e6ec9){if(_0x1e6ec9){_0x57abc8[_0x1814('0x32')]=_['keys'](db[_0x1814('0xc5')][_0x1814('0x2f')]);_0x57abc8['query']=_['keys'](_0xd166ed[_0x1814('0x33')]);_0x57abc8[_0x1814('0x35')]=_['intersection'](_0x57abc8[_0x1814('0x32')],_0x57abc8[_0x1814('0x33')]);_0x16e1ba['attributes']=_['intersection'](_0x57abc8[_0x1814('0x32')],qs['fields'](_0xd166ed[_0x1814('0x33')]['fields']));_0x16e1ba[_0x1814('0x36')]=_0x16e1ba[_0x1814('0x36')][_0x1814('0x39')]?_0x16e1ba[_0x1814('0x36')]:_0x57abc8[_0x1814('0x32')];if(!_0xd166ed['query']['hasOwnProperty'](_0x1814('0x5e'))){_0x16e1ba[_0x1814('0x20')]=qs['limit'](_0xd166ed[_0x1814('0x33')][_0x1814('0x20')]);_0x16e1ba['offset']=qs['offset'](_0xd166ed['query'][_0x1814('0x1e')]);}_0x16e1ba['order']=qs[_0x1814('0x3b')](_0xd166ed[_0x1814('0x33')][_0x1814('0x3b')]);_0x16e1ba['where']=qs[_0x1814('0x35')](_[_0x1814('0x3c')](_0xd166ed[_0x1814('0x33')],_0x57abc8['filters']));_0x16e1ba[_0x1814('0x3e')][_0x1814('0x54')]=_0x1e6ec9['id'];if(_0xd166ed['query'][_0x1814('0x3d')]){_0x16e1ba[_0x1814('0x3e')]=_[_0x1814('0x3f')](_0x16e1ba[_0x1814('0x3e')],{'$or':_[_0x1814('0x2d')](_0x16e1ba[_0x1814('0x36')],function(_0xf035a2){var _0x2e8aa6={};_0x2e8aa6[_0xf035a2]={'$like':'%'+_0xd166ed[_0x1814('0x33')]['filter']+'%'};return _0x2e8aa6;})});}_0x16e1ba=_[_0x1814('0x3f')]({},_0x16e1ba,_0xd166ed[_0x1814('0x41')]);return db[_0x1814('0xc5')]['count']({'where':_0x16e1ba[_0x1814('0x3e')]})[_0x1814('0x14')](function(_0xdb28b1){_0x2b413a[_0x1814('0x21')]=_0xdb28b1;if(_0xd166ed[_0x1814('0x33')][_0x1814('0x42')]){_0x16e1ba[_0x1814('0x43')]=[{'all':!![]}];}else{_0x16e1ba[_0x1814('0x43')]=[{'model':db[_0x1814('0x7f')],'as':_0x1814('0x118'),'required':![]},{'model':db[_0x1814('0xcd')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x1814('0x59')](_0x16e1ba);})['then'](function(_0x4f4f4c){_0x2b413a[_0x1814('0x44')]=_0x4f4f4c;return _0x2b413a;});}})[_0x1814('0x14')](respondWithFilteredResult(_0x234443,_0x16e1ba))['catch'](handleError(_0x234443,null));};exports[_0x1814('0x119')]=function(_0x33325f,_0x33f414){return db['ChatWebsite'][_0x1814('0x48')]({'where':{'id':_0x33325f[_0x1814('0x46')]['id']}})['then'](handleEntityNotFound(_0x33f414,null))[_0x1814('0x14')](function(_0x47039f){if(_0x47039f){return _0x47039f[_0x1814('0x119')](_0x33325f['body']['ids'],_[_0x1814('0xe0')](_0x33325f['body'],[_0x1814('0x5b'),'id'])||{})[_0x1814('0x11a')](function(_0x52f708){for(var _0x41e6a7=0x0;_0x41e6a7<_0x33325f['body'][_0x1814('0x5b')]['length'];_0x41e6a7+=0x1){socket['emit'](_0x1814('0x11b'),{'UserId':Number(_0x33325f[_0x1814('0x4b')][_0x1814('0x5b')][_0x41e6a7]),'ChatWebsiteId':Number(_0x33325f['params']['id'])});}return _0x52f708;});}})[_0x1814('0x14')](respondWithResult(_0x33f414,null))[_0x1814('0x49')](handleError(_0x33f414,null));};exports[_0x1814('0x11c')]=function(_0x70bca4,_0x35a203){return db[_0x1814('0x2e')][_0x1814('0x48')]({'where':{'id':_0x70bca4[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x35a203,null))[_0x1814('0x14')](function(_0x5002f2){if(_0x5002f2){return _0x5002f2[_0x1814('0x11c')](_0x70bca4[_0x1814('0x33')][_0x1814('0x5b')])[_0x1814('0x14')](function(){if(_[_0x1814('0x11d')](_0x70bca4[_0x1814('0x33')]['ids'])){for(var _0x3a4906=0x0;_0x3a4906<_0x70bca4[_0x1814('0x33')][_0x1814('0x5b')]['length'];_0x3a4906+=0x1){socket['emit'](_0x1814('0x11e'),{'UserId':Number(_0x70bca4[_0x1814('0x33')][_0x1814('0x5b')][_0x3a4906]),'ChatWebsiteId':Number(_0x70bca4[_0x1814('0x46')]['id'])});}}else{socket[_0x1814('0x11f')](_0x1814('0x11e'),{'UserId':Number(_0x70bca4['query'][_0x1814('0x5b')]),'ChatWebsiteId':Number(_0x70bca4['params']['id'])});}});}})[_0x1814('0x14')](respondWithStatusCode(_0x35a203,null))[_0x1814('0x49')](handleError(_0x35a203,null));};exports[_0x1814('0x120')]=function(_0x5dc8c5,_0x456727){var _0x10cc7d={};var _0xe5fccd={};var _0xb0d7e3;var _0x3df241;return db[_0x1814('0x2e')][_0x1814('0x56')]({'where':{'id':_0x5dc8c5[_0x1814('0x46')]['id']}})[_0x1814('0x14')](handleEntityNotFound(_0x456727,null))[_0x1814('0x14')](function(_0x1b1817){if(_0x1b1817){_0xb0d7e3=_0x1b1817;_0xe5fccd['model']=_[_0x1814('0x34')](db[_0x1814('0xe2')][_0x1814('0x2f')]);_0xe5fccd[_0x1814('0x33')]=_['keys'](_0x5dc8c5[_0x1814('0x33')]);_0xe5fccd['filters']=_[_0x1814('0x37')](_0xe5fccd['model'],_0xe5fccd[_0x1814('0x33')]);_0x10cc7d[_0x1814('0x36')]=_['intersection'](_0xe5fccd['model'],qs[_0x1814('0x38')](_0x5dc8c5[_0x1814('0x33')][_0x1814('0x38')]));_0x10cc7d[_0x1814('0x36')]=_0x10cc7d[_0x1814('0x36')]['length']?_0x10cc7d[_0x1814('0x36')]:_0xe5fccd['model'];_0x10cc7d[_0x1814('0x3a')]=qs[_0x1814('0x3b')](_0x5dc8c5[_0x1814('0x33')][_0x1814('0x3b')]);_0x10cc7d[_0x1814('0x3e')]=qs['filters'](_[_0x1814('0x3c')](_0x5dc8c5['query'],_0xe5fccd[_0x1814('0x35')]));if(_0x5dc8c5[_0x1814('0x33')][_0x1814('0x3d')]){_0x10cc7d['where']=_[_0x1814('0x3f')](_0x10cc7d['where'],{'$or':_[_0x1814('0x2d')](_0x10cc7d['attributes'],function(_0x46be95){var _0x4af494={};_0x4af494[_0x46be95]={'$like':'%'+_0x5dc8c5[_0x1814('0x33')][_0x1814('0x3d')]+'%'};return _0x4af494;})});}_0x10cc7d=_[_0x1814('0x3f')]({},_0x10cc7d,_0x5dc8c5['options']);return _0xb0d7e3[_0x1814('0x120')](_0x10cc7d);}})[_0x1814('0x14')](function(_0x4660bb){if(_0x4660bb){_0x3df241=_0x4660bb[_0x1814('0x39')];if(!_0x5dc8c5['query'][_0x1814('0x58')](_0x1814('0x5e'))){_0x10cc7d[_0x1814('0x20')]=qs['limit'](_0x5dc8c5[_0x1814('0x33')]['limit']);_0x10cc7d[_0x1814('0x1e')]=qs[_0x1814('0x1e')](_0x5dc8c5[_0x1814('0x33')][_0x1814('0x1e')]);}return _0xb0d7e3[_0x1814('0x120')](_0x10cc7d);}})[_0x1814('0x14')](function(_0x3def3c){if(_0x3def3c){return _0x3def3c?{'count':_0x3df241,'rows':_0x3def3c}:null;}})[_0x1814('0x14')](respondWithResult(_0x456727,null))[_0x1814('0x49')](handleError(_0x456727,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 237e7d1..ae8b737 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 _0xb138=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0xb138,0x1dd));var _0x8b13=function(_0xa3d550,_0x32cbd1){_0xa3d550=_0xa3d550-0x0;var _0x3e1357=_0xb138[_0xa3d550];return _0x3e1357;};'use strict';var EventEmitter=require(_0x8b13('0x0'));var ChatWebsite=require(_0x8b13('0x1'))['db'][_0x8b13('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8b13('0x3')](0x0);var events={'afterCreate':_0x8b13('0x4'),'afterUpdate':_0x8b13('0x5'),'afterDestroy':_0x8b13('0x6')};function emitEvent(_0x5369d4){return function(_0x4411a0,_0x241acb,_0x3af81a){ChatWebsiteEvents['emit'](_0x5369d4+':'+_0x4411a0['id'],_0x4411a0);ChatWebsiteEvents[_0x8b13('0x7')](_0x5369d4,_0x4411a0);_0x3af81a(null);};}for(var e in events){if(events[_0x8b13('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x8b13('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x23ea=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x23ea,0xc3));var _0xa23e=function(_0x363b89,_0x2f2e75){_0x363b89=_0x363b89-0x0;var _0x2ffc54=_0x23ea[_0x363b89];return _0x2ffc54;};'use strict';var EventEmitter=require(_0xa23e('0x0'));var ChatWebsite=require(_0xa23e('0x1'))['db'][_0xa23e('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa23e('0x3')](0x0);var events={'afterCreate':_0xa23e('0x4'),'afterUpdate':_0xa23e('0x5'),'afterDestroy':_0xa23e('0x6')};function emitEvent(_0x3428d6){return function(_0xf8cea8,_0x441b2e,_0x6f7d68){ChatWebsiteEvents['emit'](_0x3428d6+':'+_0xf8cea8['id'],_0xf8cea8);ChatWebsiteEvents[_0xa23e('0x7')](_0x3428d6,_0xf8cea8);_0x6f7d68(null);};}for(var e in events){if(events[_0xa23e('0x8')](e)){var event=events[e];ChatWebsite[_0xa23e('0x9')](e,emitEvent(event));}}module[_0xa23e('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 88b05d5..8432a20 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 _0x5c06=['define','ChatWebsite','../../config/logger','api','request-promise','../../config/environment','./chatWebsite.attributes'];(function(_0x4dd275,_0x1988f9){var _0x177604=function(_0x4d71c4){while(--_0x4d71c4){_0x4dd275['push'](_0x4dd275['shift']());}};_0x177604(++_0x1988f9);}(_0x5c06,0xc6));var _0x65c0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5c06[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x65c0('0x0'))(_0x65c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x65c0('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x65c0('0x3'));var attributes=require(_0x65c0('0x4'));module['exports']=function(_0x486513,_0x3cce3d){return _0x486513[_0x65c0('0x5')](_0x65c0('0x6'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38bd=['util','../../config/logger','moment','bluebird','path','rimraf','./chatWebsite.attributes','exports','define','lodash'];(function(_0x1481fb,_0x10d373){var _0x5c18f5=function(_0x13c182){while(--_0x13c182){_0x1481fb['push'](_0x1481fb['shift']());}};_0x5c18f5(++_0x10d373);}(_0x38bd,0x1f3));var _0xd38b=function(_0x3193db,_0x23c7e8){_0x3193db=_0x3193db-0x0;var _0x219cad=_0x38bd[_0x3193db];return _0x219cad;};'use strict';var _=require(_0xd38b('0x0'));var util=require(_0xd38b('0x1'));var logger=require(_0xd38b('0x2'))('api');var moment=require(_0xd38b('0x3'));var BPromise=require(_0xd38b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd38b('0x5'));var rimraf=require(_0xd38b('0x6'));var config=require('../../config/environment');var attributes=require(_0xd38b('0x7'));module[_0xd38b('0x8')]=function(_0x1b3346,_0x1d3ced){return _0x1b3346[_0xd38b('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 3349789..861c798 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 _0xec93=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1dfc98,_0x3264e9){var _0x57430f=function(_0x47404d){while(--_0x47404d){_0x1dfc98['push'](_0x1dfc98['shift']());}};_0x57430f(++_0x3264e9);}(_0xec93,0x68));var _0x3ec9=function(_0x1c743c,_0x2f9d58){_0x1c743c=_0x1c743c-0x0;var _0x2c1e1f=_0xec93[_0x1c743c];return _0x2c1e1f;};'use strict';var _=require('lodash');var util=require(_0x3ec9('0x0'));var moment=require(_0x3ec9('0x1'));var BPromise=require(_0x3ec9('0x2'));var rs=require(_0x3ec9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ec9('0x4'))['db'];var utils=require(_0x3ec9('0x5'));var logger=require(_0x3ec9('0x6'))(_0x3ec9('0x7'));var config=require('../../config/environment');var jayson=require(_0x3ec9('0x8'));var client=jayson[_0x3ec9('0x9')][_0x3ec9('0xa')]({'port':0x232a});config[_0x3ec9('0xb')]=_[_0x3ec9('0xc')](config[_0x3ec9('0xb')],{'host':_0x3ec9('0xd'),'port':0x18eb});var socket=require(_0x3ec9('0xe'))(new Redis(config[_0x3ec9('0xb')]));require('./chatWebsite.socket')[_0x3ec9('0xf')](socket);function respondWithRpcPromise(_0x44e9eb,_0x2794c1,_0x5c7ba8){return new BPromise(function(_0x3d29b1,_0xd6de46){return client[_0x3ec9('0x10')](_0x44e9eb,_0x5c7ba8)[_0x3ec9('0x11')](function(_0x1585dc){logger[_0x3ec9('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2794c1,_0x3ec9('0x13'));logger[_0x3ec9('0x14')](_0x3ec9('0x15'),_0x2794c1,'request\x20sent',JSON[_0x3ec9('0x16')](_0x1585dc));if(_0x1585dc['error']){if(_0x1585dc['error'][_0x3ec9('0x17')]===0x1f4){logger[_0x3ec9('0x18')](_0x3ec9('0x19'),_0x2794c1,_0x1585dc[_0x3ec9('0x18')]['message']);return _0xd6de46(_0x1585dc[_0x3ec9('0x18')][_0x3ec9('0x1a')]);}logger['error'](_0x3ec9('0x19'),_0x2794c1,_0x1585dc['error'][_0x3ec9('0x1a')]);return _0x3d29b1(_0x1585dc[_0x3ec9('0x18')][_0x3ec9('0x1a')]);}else{logger[_0x3ec9('0x12')](_0x3ec9('0x19'),_0x2794c1,_0x3ec9('0x13'));_0x3d29b1(_0x1585dc['result'][_0x3ec9('0x1a')]);}})[_0x3ec9('0x1b')](function(_0x26a06e){logger[_0x3ec9('0x18')](_0x3ec9('0x19'),_0x2794c1,_0x26a06e);_0xd6de46(_0x26a06e);});});} \ No newline at end of file +var _0x1dae=['http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x1dae,0x1d3));var _0xe1da=function(_0x281a05,_0x132935){_0x281a05=_0x281a05-0x0;var _0x502467=_0x1dae[_0x281a05];return _0x502467;};'use strict';var _=require('lodash');var util=require(_0xe1da('0x0'));var moment=require(_0xe1da('0x1'));var BPromise=require(_0xe1da('0x2'));var rs=require(_0xe1da('0x3'));var fs=require('fs');var Redis=require(_0xe1da('0x4'));var db=require(_0xe1da('0x5'))['db'];var utils=require(_0xe1da('0x6'));var logger=require(_0xe1da('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe1da('0x8')]({'port':0x232a});config[_0xe1da('0x9')]=_['defaults'](config[_0xe1da('0x9')],{'host':_0xe1da('0xa'),'port':0x18eb});var socket=require(_0xe1da('0xb'))(new Redis(config['redis']));require(_0xe1da('0xc'))[_0xe1da('0xd')](socket);function respondWithRpcPromise(_0x191364,_0x41f456,_0x331345){return new BPromise(function(_0x128849,_0x26b822){return client[_0xe1da('0xe')](_0x191364,_0x331345)[_0xe1da('0xf')](function(_0x4c286d){logger[_0xe1da('0x10')](_0xe1da('0x11'),_0x41f456,_0xe1da('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x41f456,'request\x20sent',JSON[_0xe1da('0x13')](_0x4c286d));if(_0x4c286d[_0xe1da('0x14')]){if(_0x4c286d[_0xe1da('0x14')][_0xe1da('0x15')]===0x1f4){logger[_0xe1da('0x14')](_0xe1da('0x11'),_0x41f456,_0x4c286d['error'][_0xe1da('0x16')]);return _0x26b822(_0x4c286d[_0xe1da('0x14')][_0xe1da('0x16')]);}logger[_0xe1da('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x41f456,_0x4c286d[_0xe1da('0x14')][_0xe1da('0x16')]);return _0x128849(_0x4c286d[_0xe1da('0x14')][_0xe1da('0x16')]);}else{logger[_0xe1da('0x10')](_0xe1da('0x11'),_0x41f456,_0xe1da('0x12'));_0x128849(_0x4c286d[_0xe1da('0x17')][_0xe1da('0x16')]);}})[_0xe1da('0x18')](function(_0x2aa7d3){logger[_0xe1da('0x14')](_0xe1da('0x11'),_0x41f456,_0x2aa7d3);_0x26b822(_0x2aa7d3);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3c43956..7d4832f 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 _0x394e=['remove','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x394e,0xb4));var _0xe394=function(_0x21440c,_0x306995){_0x21440c=_0x21440c-0x0;var _0x3ba1f0=_0x394e[_0x21440c];return _0x3ba1f0;};'use strict';var ChatWebsiteEvents=require(_0xe394('0x0'));var events=[_0xe394('0x1'),_0xe394('0x2'),'update'];function createListener(_0x37ea5b,_0x539bff){return function(_0x2fe48b){_0x539bff['emit'](_0x37ea5b,_0x2fe48b);};}function removeListener(_0x43cc2c,_0x2b74cc){return function(){ChatWebsiteEvents[_0xe394('0x3')](_0x43cc2c,_0x2b74cc);};}exports[_0xe394('0x4')]=function(_0x22e142){for(var _0x66bc34=0x0,_0x57aaaf=events[_0xe394('0x5')];_0x66bc34<_0x57aaaf;_0x66bc34++){var _0x38e6da=events[_0x66bc34];var _0x137070=createListener(_0xe394('0x6')+_0x38e6da,_0x22e142);ChatWebsiteEvents['on'](_0x38e6da,_0x137070);}}; \ No newline at end of file +var _0x632f=['remove','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x1b5f7a,_0x281348){var _0x205dd7=function(_0x331712){while(--_0x331712){_0x1b5f7a['push'](_0x1b5f7a['shift']());}};_0x205dd7(++_0x281348);}(_0x632f,0x143));var _0xf632=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x632f[_0xf50820];return _0x2a9b10;};'use strict';var ChatWebsiteEvents=require(_0xf632('0x0'));var events=['save',_0xf632('0x1'),'update'];function createListener(_0xca6aba,_0x513505){return function(_0x41b2c9){_0x513505['emit'](_0xca6aba,_0x41b2c9);};}function removeListener(_0x53216a,_0x4a877c){return function(){ChatWebsiteEvents[_0xf632('0x2')](_0x53216a,_0x4a877c);};}exports[_0xf632('0x3')]=function(_0x523381){for(var _0x24e175=0x0,_0x1e3f31=events[_0xf632('0x4')];_0x24e175<_0x1e3f31;_0x24e175++){var _0x3bde3f=events[_0x24e175];var _0xde40cd=createListener(_0xf632('0x5')+_0x3bde3f,_0x523381);ChatWebsiteEvents['on'](_0x3bde3f,_0xde40cd);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index dd522c0..c75e679 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 _0xe561=['../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getAgents','post','create','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addAvatar','addCustomerAvatar','/:id/notify','notify','attachments','offline-chat','replace','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','removeDispositions','delete','removeAgents','exports','connect-timeout','express'];(function(_0x4aa068,_0x5ea469){var _0x4fb9dc=function(_0x26e5e8){while(--_0x26e5e8){_0x4aa068['push'](_0x4aa068['shift']());}};_0x4fb9dc(++_0x5ea469);}(_0xe561,0x1b7));var _0x1e56=function(_0x4f67a2,_0x273325){_0x4f67a2=_0x4f67a2-0x0;var _0x42beb3=_0xe561[_0x4f67a2];return _0x42beb3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1e56('0x0'));var express=require(_0x1e56('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1e56('0x2'));var config=require('../../config/environment');var controller=require(_0x1e56('0x3'));router[_0x1e56('0x4')]('/',auth[_0x1e56('0x5')](),controller[_0x1e56('0x6')]);router['get']('/describe',auth[_0x1e56('0x5')](),controller[_0x1e56('0x7')]);router[_0x1e56('0x4')](_0x1e56('0x8'),auth['isAuthenticated'](),controller[_0x1e56('0x9')]);router[_0x1e56('0x4')](_0x1e56('0xa'),auth[_0x1e56('0x5')](),controller[_0x1e56('0xb')]);router['get']('/:id/canned_answers',auth[_0x1e56('0x5')](),controller[_0x1e56('0xc')]);router['get'](_0x1e56('0xd'),controller[_0x1e56('0xe')]);router[_0x1e56('0x4')](_0x1e56('0xf'),controller['getAvatar']);router['get'](_0x1e56('0x10'),controller[_0x1e56('0x11')]);router['get'](_0x1e56('0x12'),controller[_0x1e56('0x13')]);router[_0x1e56('0x4')](_0x1e56('0x14'),auth[_0x1e56('0x5')](),controller['getInteractions']);router[_0x1e56('0x4')]('/:id/snippet',controller[_0x1e56('0x15')]);router[_0x1e56('0x4')](_0x1e56('0x16'),auth[_0x1e56('0x5')](),controller[_0x1e56('0x17')]);router[_0x1e56('0x4')](_0x1e56('0x18'),auth[_0x1e56('0x5')](),controller[_0x1e56('0x19')]);router['get'](_0x1e56('0x1a'),controller['getFields']);router[_0x1e56('0x4')](_0x1e56('0x1b'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x1e56('0x4')]('/:id/users',auth[_0x1e56('0x5')](),controller[_0x1e56('0x1c')]);router[_0x1e56('0x1d')]('/',auth[_0x1e56('0x5')](),controller[_0x1e56('0x1e')]);router[_0x1e56('0x1d')](_0x1e56('0xa'),auth[_0x1e56('0x5')](),controller['addDisposition']);router[_0x1e56('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1e56('0x1f')]);var upload=multer({'storage':multer[_0x1e56('0x20')]({'destination':function(_0x4f4b33,_0x33bb48,_0x303397){_0x303397(null,path[_0x1e56('0x21')](config[_0x1e56('0x22')],'server/files/images/logos/'));},'filename':function(_0x240d5b,_0x18275f,_0x333c82){_0x333c82(null,util[_0x1e56('0x23')](_0x1e56('0x24'),Date[_0x1e56('0x25')](),_0x18275f[_0x1e56('0x26')]));}})});router[_0x1e56('0x1d')](_0x1e56('0xd'),upload[_0x1e56('0x27')]('file'),controller[_0x1e56('0x28')]);var upload=multer({'storage':multer[_0x1e56('0x20')]({'destination':function(_0x55be20,_0x127c94,_0x5bce9c){_0x5bce9c(null,path[_0x1e56('0x21')](config[_0x1e56('0x22')],_0x1e56('0x29')));},'filename':function(_0x11e1c1,_0x992201,_0x2ac00e){_0x2ac00e(null,util['format'](_0x1e56('0x24'),Date['now'](),_0x992201[_0x1e56('0x26')]));}})});router[_0x1e56('0x1d')]('/:id/avatar',upload[_0x1e56('0x27')](_0x1e56('0x2a')),controller[_0x1e56('0x2b')]);var upload=multer({'storage':multer[_0x1e56('0x20')]({'destination':function(_0x2e61b7,_0x3ba29b,_0x3698cc){_0x3698cc(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x44b388,_0x1076e7,_0x3c73ef){_0x3c73ef(null,util[_0x1e56('0x23')]('%s-%s',Date[_0x1e56('0x25')](),_0x1076e7['originalname']));}})});router['post'](_0x1e56('0x10'),upload[_0x1e56('0x27')](_0x1e56('0x2a')),controller[_0x1e56('0x2c')]);var upload=multer({'storage':multer[_0x1e56('0x20')]({'destination':function(_0x2dd352,_0x41537d,_0x4be3eb){_0x4be3eb(null,path[_0x1e56('0x21')](config[_0x1e56('0x22')],_0x1e56('0x29')));},'filename':function(_0x1e5caa,_0x2605e3,_0x38d642){_0x38d642(null,util['format'](_0x1e56('0x24'),Date[_0x1e56('0x25')](),_0x2605e3['originalname']));}})});router[_0x1e56('0x1d')](_0x1e56('0x12'),upload[_0x1e56('0x27')](_0x1e56('0x2a')),controller['addSystemAvatar']);router[_0x1e56('0x1d')](_0x1e56('0x2d'),controller[_0x1e56('0x2e')]);const offlineUploadMulter=multer({'storage':multer[_0x1e56('0x20')]({'destination':function(_0x538ec3,_0x277dd6,_0xf219f0){const _0x3f7909=path[_0x1e56('0x21')](config[_0x1e56('0x22')],'server/files',_0x1e56('0x2f'),_0x1e56('0x30'));fs_extra['ensureDir'](_0x3f7909,function(){_0xf219f0(null,_0x3f7909);});},'filename':function(_0x4caa3c,_0x47cf57,_0x3b2fa4){const _0x44cddc=_0x47cf57[_0x1e56('0x26')][_0x1e56('0x31')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1a314e=path['extname'](_0x44cddc);const _0x2b62bb=Date[_0x1e56('0x25')]()+'-'+_0x44cddc['replace'](_0x1a314e,'')+_0x1a314e;_0x3b2fa4(null,_0x2b62bb);}})});router[_0x1e56('0x1d')](_0x1e56('0x32'),offlineUploadMulter['any'](),controller[_0x1e56('0x33')]);router[_0x1e56('0x1d')](_0x1e56('0x14'),auth[_0x1e56('0x5')](),controller[_0x1e56('0x34')]);router[_0x1e56('0x1d')](_0x1e56('0x16'),auth[_0x1e56('0x5')](),controller[_0x1e56('0x35')]);router[_0x1e56('0x1d')](_0x1e56('0x18'),auth[_0x1e56('0x5')](),controller[_0x1e56('0x36')]);router[_0x1e56('0x1d')]('/:id/users',auth['isAuthenticated'](),controller[_0x1e56('0x37')]);router[_0x1e56('0x38')](_0x1e56('0x8'),auth[_0x1e56('0x5')](),controller[_0x1e56('0x39')]);router['delete'](_0x1e56('0x8'),auth[_0x1e56('0x5')](),controller[_0x1e56('0x3a')]);router['delete'](_0x1e56('0xa'),auth[_0x1e56('0x5')](),controller[_0x1e56('0x3b')]);router[_0x1e56('0x3c')]('/:id/canned_answers',auth[_0x1e56('0x5')](),controller['removeAnswers']);router[_0x1e56('0x3c')]('/:id/users',auth['isAuthenticated'](),controller[_0x1e56('0x3d')]);module[_0x1e56('0x3e')]=router; \ No newline at end of file +var _0x886d=['isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getFields','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','addLogo','server/files/images/avatars/','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','index','/describe'];(function(_0x3d2032,_0x60f81a){var _0x378ebe=function(_0x11c72a){while(--_0x11c72a){_0x3d2032['push'](_0x3d2032['shift']());}};_0x378ebe(++_0x60f81a);}(_0x886d,0x80));var _0xd886=function(_0x33add6,_0x435ffe){_0x33add6=_0x33add6-0x0;var _0x1d96ec=_0x886d[_0x33add6];return _0x1d96ec;};'use strict';var multer=require('multer');var util=require(_0xd886('0x0'));var path=require(_0xd886('0x1'));var timeout=require(_0xd886('0x2'));var express=require('express');var router=express[_0xd886('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd886('0x4'));var interaction=require(_0xd886('0x5'));var config=require('../../config/environment');var controller=require(_0xd886('0x6'));router[_0xd886('0x7')]('/',auth['isAuthenticated'](),controller[_0xd886('0x8')]);router['get'](_0xd886('0x9'),auth[_0xd886('0xa')](),controller[_0xd886('0xb')]);router['get'](_0xd886('0xc'),auth[_0xd886('0xa')](),controller[_0xd886('0xd')]);router[_0xd886('0x7')]('/:id/dispositions',auth[_0xd886('0xa')](),controller[_0xd886('0xe')]);router[_0xd886('0x7')](_0xd886('0xf'),auth['isAuthenticated'](),controller[_0xd886('0x10')]);router[_0xd886('0x7')]('/:id/logo',controller['getLogo']);router['get'](_0xd886('0x11'),controller[_0xd886('0x12')]);router[_0xd886('0x7')](_0xd886('0x13'),controller[_0xd886('0x14')]);router[_0xd886('0x7')](_0xd886('0x15'),controller[_0xd886('0x16')]);router[_0xd886('0x7')](_0xd886('0x17'),auth[_0xd886('0xa')](),controller[_0xd886('0x18')]);router[_0xd886('0x7')](_0xd886('0x19'),controller['getSnippet']);router[_0xd886('0x7')](_0xd886('0x1a'),auth[_0xd886('0xa')](),controller['getApplications']);router[_0xd886('0x7')](_0xd886('0x1b'),auth[_0xd886('0xa')](),controller['getProactiveActions']);router[_0xd886('0x7')]('/:id/fields',controller[_0xd886('0x1c')]);router['get']('/:id/offline_messages',auth[_0xd886('0xa')](),controller['getOfflineMessages']);router[_0xd886('0x7')](_0xd886('0x1d'),auth[_0xd886('0xa')](),controller[_0xd886('0x1e')]);router[_0xd886('0x1f')]('/',auth[_0xd886('0xa')](),controller['create']);router[_0xd886('0x1f')](_0xd886('0x20'),auth[_0xd886('0xa')](),controller[_0xd886('0x21')]);router[_0xd886('0x1f')](_0xd886('0xf'),auth[_0xd886('0xa')](),controller[_0xd886('0x22')]);var upload=multer({'storage':multer[_0xd886('0x23')]({'destination':function(_0x5bb339,_0x1e63a6,_0x392658){_0x392658(null,path[_0xd886('0x24')](config[_0xd886('0x25')],_0xd886('0x26')));},'filename':function(_0xf9c6eb,_0x151d8c,_0x421979){_0x421979(null,util[_0xd886('0x27')](_0xd886('0x28'),Date[_0xd886('0x29')](),_0x151d8c[_0xd886('0x2a')]));}})});router['post'](_0xd886('0x2b'),upload[_0xd886('0x2c')]('file'),controller[_0xd886('0x2d')]);var upload=multer({'storage':multer[_0xd886('0x23')]({'destination':function(_0x50dd66,_0x4d316a,_0x158344){_0x158344(null,path[_0xd886('0x24')](config['root'],_0xd886('0x2e')));},'filename':function(_0x27a8f1,_0x183c11,_0x439a02){_0x439a02(null,util[_0xd886('0x27')](_0xd886('0x28'),Date['now'](),_0x183c11[_0xd886('0x2a')]));}})});router[_0xd886('0x1f')](_0xd886('0x11'),upload[_0xd886('0x2c')](_0xd886('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf6a458,_0xae64d8,_0x3389bb){_0x3389bb(null,path['join'](config['root'],_0xd886('0x2e')));},'filename':function(_0x3e71bf,_0x214c26,_0x5c0406){_0x5c0406(null,util[_0xd886('0x27')](_0xd886('0x28'),Date[_0xd886('0x29')](),_0x214c26['originalname']));}})});router[_0xd886('0x1f')]('/:id/customer_avatar',upload['single'](_0xd886('0x2f')),controller[_0xd886('0x30')]);var upload=multer({'storage':multer[_0xd886('0x23')]({'destination':function(_0x12fffb,_0x412cd9,_0x1fe3f5){_0x1fe3f5(null,path['join'](config[_0xd886('0x25')],_0xd886('0x2e')));},'filename':function(_0x1a45e6,_0x1c20e5,_0x48f324){_0x48f324(null,util[_0xd886('0x27')]('%s-%s',Date[_0xd886('0x29')](),_0x1c20e5[_0xd886('0x2a')]));}})});router[_0xd886('0x1f')](_0xd886('0x15'),upload[_0xd886('0x2c')](_0xd886('0x2f')),controller[_0xd886('0x31')]);router['post'](_0xd886('0x32'),controller[_0xd886('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xd886('0x23')]({'destination':function(_0x2ee5af,_0x2ce68f,_0x13cf07){const _0x4482b1=path[_0xd886('0x24')](config['root'],'server/files',_0xd886('0x34'),_0xd886('0x35'));fs_extra[_0xd886('0x36')](_0x4482b1,function(){_0x13cf07(null,_0x4482b1);});},'filename':function(_0x5e542c,_0x4ff5b3,_0x578a2d){const _0x4146c2=_0x4ff5b3['originalname'][_0xd886('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xe4351d=path[_0xd886('0x38')](_0x4146c2);const _0x2e3601=Date[_0xd886('0x29')]()+'-'+_0x4146c2['replace'](_0xe4351d,'')+_0xe4351d;_0x578a2d(null,_0x2e3601);}})});router[_0xd886('0x1f')](_0xd886('0x39'),offlineUploadMulter['any'](),controller[_0xd886('0x3a')]);router['post'](_0xd886('0x17'),auth[_0xd886('0xa')](),controller[_0xd886('0x3b')]);router[_0xd886('0x1f')]('/:id/applications',auth[_0xd886('0xa')](),controller[_0xd886('0x3c')]);router[_0xd886('0x1f')](_0xd886('0x1b'),auth[_0xd886('0xa')](),controller[_0xd886('0x3d')]);router['post'](_0xd886('0x1d'),auth[_0xd886('0xa')](),controller[_0xd886('0x3e')]);router[_0xd886('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0xd886('0x40')]);router[_0xd886('0x41')]('/:id',auth[_0xd886('0xa')](),controller[_0xd886('0x42')]);router[_0xd886('0x41')](_0xd886('0x20'),auth[_0xd886('0xa')](),controller[_0xd886('0x43')]);router[_0xd886('0x41')](_0xd886('0xf'),auth[_0xd886('0xa')](),controller['removeAnswers']);router[_0xd886('0x41')](_0xd886('0x1d'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xd886('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 9aaa3e5..8dede8e 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 _0x28ef=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','express','../components/auth/service','Router','env','production'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x28ef,0x11b));var _0xf28e=function(_0x1aceaa,_0x2a803b){_0x1aceaa=_0x1aceaa-0x0;var _0x3059c1=_0x28ef[_0x1aceaa];return _0x3059c1;};var beaverLogger=require('beaver-logger/server');var express=require(_0xf28e('0x0'));var auth=require(_0xf28e('0x1'));var config=require('../config/environment');var router=express[_0xf28e('0x2')]();var isProduction=config[_0xf28e('0x3')]===_0xf28e('0x4')||![];function clientSideLogs(_0x24e7d3,_0x45a616,_0xd2e5fe){var _0x48e090=_0x24e7d3[_0xf28e('0x5')][_0xf28e('0x6')](_0xf28e('0x7'));if(!_0x48e090){throw new Error(_0xf28e('0x8'));}return beaverLogger[_0xf28e('0x9')]({'uri':_0xf28e('0xa'),'logger':_0x48e090,'enableCors':!isProduction})(_0x24e7d3,_0x45a616,_0xd2e5fe);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xf28e('0xb')]=router; \ No newline at end of file +var _0x94c2=['isAuthenticated','beaver-logger/server','express','../components/auth/service','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x94c2,0x169));var _0x294c=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x94c2[_0x88cd7b];return _0x56fcc8;};var beaverLogger=require(_0x294c('0x0'));var express=require(_0x294c('0x1'));var auth=require(_0x294c('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x294c('0x3')]===_0x294c('0x4')||![];function clientSideLogs(_0x35d638,_0x3a6c0b,_0x5ab992){var _0x4f6f65=_0x35d638[_0x294c('0x5')][_0x294c('0x6')](_0x294c('0x7'));if(!_0x4f6f65){throw new Error(_0x294c('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x294c('0x9'),'logger':_0x4f6f65,'enableCors':!isProduction})(_0x35d638,_0x3a6c0b,_0x5ab992);}router[_0x294c('0xa')](auth[_0x294c('0xb')](),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 0b531b5..64ec2fe 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 _0xe2a9=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe2a9,0x7f));var _0x9e2a=function(_0x30e3c8,_0x5e11de){_0x30e3c8=_0x30e3c8-0x0;var _0x2a0412=_0xe2a9[_0x30e3c8];return _0x2a0412;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9e2a('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9e2a('0x1')](_0x9e2a('0x2'),_0x9e2a('0x3'),_0x9e2a('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9e2a('0x1')](_0x9e2a('0x5'),_0x9e2a('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x9e2a('0x0')],'comment':_0x9e2a('0x7')},'data3':{'type':Sequelize[_0x9e2a('0x0')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x9e2a('0x0')],'comment':_0x9e2a('0x8')},'data5':{'type':Sequelize[_0x9e2a('0x9')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x9e2a('0x9')],'comment':_0x9e2a('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':_0x9e2a('0xb')}}; \ No newline at end of file +var _0x0d79=['AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING'];(function(_0x343e45,_0x16d628){var _0x42ba70=function(_0x1cf77d){while(--_0x1cf77d){_0x343e45['push'](_0x343e45['shift']());}};_0x42ba70(++_0x16d628);}(_0x0d79,0x19d));var _0x90d7=function(_0x17823f,_0xffd807){_0x17823f=_0x17823f-0x0;var _0x51fc21=_0x0d79[_0x17823f];return _0x51fc21;};'use strict';var Sequelize=require(_0x90d7('0x0'));module[_0x90d7('0x1')]={'name':{'type':Sequelize[_0x90d7('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x90d7('0x3'),_0x90d7('0x4'),_0x90d7('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x90d7('0x6'),_0x90d7('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x90d7('0x8')},'data2':{'type':Sequelize[_0x90d7('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x90d7('0x2')],'comment':_0x90d7('0x9')},'data4':{'type':Sequelize[_0x90d7('0x2')],'comment':_0x90d7('0xa')},'data5':{'type':Sequelize[_0x90d7('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x90d7('0xb')],'comment':_0x90d7('0xc')},'data7':{'type':Sequelize[_0x90d7('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a381bf5..722eeda 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 _0x7f98=['MicrosoftAzure','encryptString','catch','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','json','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','service','data3','show','params','include','find','decryptString','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join'];(function(_0x29617c,_0x15313f){var _0x18c829=function(_0x1d4e3d){while(--_0x1d4e3d){_0x29617c['push'](_0x29617c['shift']());}};_0x18c829(++_0x15313f);}(_0x7f98,0x7f));var _0x87f9=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x7f98[_0x24f31b];return _0x488401;};'use strict';var _=require('lodash');var Redis=require(_0x87f9('0x0'));var qs=require(_0x87f9('0x1'));var encryptor=require(_0x87f9('0x2'));var config=require(_0x87f9('0x3'));var logger=require('../../config/logger')(_0x87f9('0x4'));var db=require(_0x87f9('0x5'))['db'];var oauth=require(_0x87f9('0x6'));config[_0x87f9('0x7')]=_[_0x87f9('0x8')](config[_0x87f9('0x7')],{'host':_0x87f9('0x9'),'port':0x18eb});var socket=require(_0x87f9('0xa'))(new Redis(config[_0x87f9('0x7')]));var redis=new Redis(config[_0x87f9('0x7')]);function respondWithStatusCode(_0x147501,_0x500c4a){_0x500c4a=_0x500c4a||0xcc;return function(_0x48e2){if(_0x48e2){return _0x147501[_0x87f9('0xb')](_0x500c4a);}return _0x147501[_0x87f9('0xc')](_0x500c4a)[_0x87f9('0xd')]();};}function respondWithResult(_0xdad385,_0x369710){_0x369710=_0x369710||0xc8;return function(_0x4395f0){if(_0x4395f0){return _0xdad385['status'](_0x369710)['json'](_0x4395f0);}};}function respondWithFilteredResult(_0x42cffb,_0x46a390){return function(_0x12511){if(_0x12511){var _0x20ee94=typeof _0x46a390[_0x87f9('0xe')]===_0x87f9('0xf')&&typeof _0x46a390[_0x87f9('0x10')]===_0x87f9('0xf');var _0x25c557=_0x12511[_0x87f9('0x11')];var _0x4b331b=_0x20ee94?0x0:_0x46a390['offset'];var _0x1b4cd4=_0x20ee94?_0x12511[_0x87f9('0x11')]:_0x46a390[_0x87f9('0xe')]+_0x46a390[_0x87f9('0x10')];var _0x3d8045;if(_0x1b4cd4>=_0x25c557){_0x1b4cd4=_0x25c557;_0x3d8045=0xc8;}else{_0x3d8045=0xce;}_0x42cffb[_0x87f9('0xc')](_0x3d8045);return _0x42cffb['set']('Content-Range',_0x4b331b+'-'+_0x1b4cd4+'/'+_0x25c557)[_0x87f9('0x12')](_0x12511);}return null;};}function saveUpdates(_0x21026e){return function(_0x449287){if(_0x449287){return _0x449287[_0x87f9('0x13')](_0x21026e)[_0x87f9('0x14')](function(_0x145e0f){return _0x145e0f;});}return null;};}function removeEntity(_0x25b67e){return function(_0x2dadc5){if(_0x2dadc5){return _0x2dadc5[_0x87f9('0x15')]()[_0x87f9('0x14')](function(){_0x25b67e[_0x87f9('0xc')](0xcc)[_0x87f9('0xd')]();});}};}function handleEntityNotFound(_0xaad68f){return function(_0x382934){if(!_0x382934){_0xaad68f[_0x87f9('0xb')](0x194);}return _0x382934;};}function handleError(_0x1b691e,_0x22f0a2){_0x22f0a2=_0x22f0a2||0x1f4;return function(_0x6356c4){logger[_0x87f9('0x16')](_0x6356c4[_0x87f9('0x17')]);if(_0x6356c4[_0x87f9('0x18')]){delete _0x6356c4[_0x87f9('0x18')];}_0x1b691e[_0x87f9('0xc')](_0x22f0a2)[_0x87f9('0x19')](_0x6356c4);};}function maskClientSecret(_0x16c26f){return _[_0x87f9('0x1a')](_0x16c26f[_0x87f9('0x1b')](0x0,0x3),0x14,'*');}exports[_0x87f9('0x1c')]=function(_0x3889bb,_0x13dd5e){var _0x480b8b={},_0x124c21={},_0x3a4669={'count':0x0,'rows':[]};var _0x10a95a=_[_0x87f9('0x1d')](db[_0x87f9('0x1e')][_0x87f9('0x1f')],function(_0x32a9c6){return{'name':_0x32a9c6[_0x87f9('0x20')],'type':_0x32a9c6[_0x87f9('0x21')][_0x87f9('0x22')]};});_0x124c21['model']=_[_0x87f9('0x1d')](_0x10a95a,'name');_0x124c21[_0x87f9('0x23')]=_[_0x87f9('0x24')](_0x3889bb[_0x87f9('0x23')]);_0x124c21[_0x87f9('0x25')]=_['intersection'](_0x124c21[_0x87f9('0x26')],_0x124c21['query']);_0x480b8b[_0x87f9('0x27')]=_[_0x87f9('0x28')](_0x124c21['model'],qs[_0x87f9('0x29')](_0x3889bb[_0x87f9('0x23')][_0x87f9('0x29')]));_0x480b8b[_0x87f9('0x27')]=_0x480b8b['attributes'][_0x87f9('0x2a')]?_0x480b8b[_0x87f9('0x27')]:_0x124c21[_0x87f9('0x26')];if(!_0x3889bb[_0x87f9('0x23')]['hasOwnProperty'](_0x87f9('0x2b'))){_0x480b8b[_0x87f9('0x10')]=qs[_0x87f9('0x10')](_0x3889bb[_0x87f9('0x23')][_0x87f9('0x10')]);_0x480b8b[_0x87f9('0xe')]=qs['offset'](_0x3889bb['query']['offset']);}_0x480b8b['order']=qs[_0x87f9('0x2c')](_0x3889bb[_0x87f9('0x23')][_0x87f9('0x2c')]);_0x480b8b['where']=qs[_0x87f9('0x25')](_[_0x87f9('0x2d')](_0x3889bb[_0x87f9('0x23')],_0x124c21['filters']),_0x10a95a);if(_0x3889bb[_0x87f9('0x23')][_0x87f9('0x2e')]){_0x480b8b[_0x87f9('0x2f')]=_[_0x87f9('0x30')](_0x480b8b[_0x87f9('0x2f')],{'$or':_['map'](_0x10a95a,function(_0x301ee0){if(_0x301ee0[_0x87f9('0x21')]!==_0x87f9('0x31')){var _0x4ab730={};_0x4ab730[_0x301ee0[_0x87f9('0x18')]]={'$like':'%'+_0x3889bb['query'][_0x87f9('0x2e')]+'%'};return _0x4ab730;}})});}_0x480b8b=_[_0x87f9('0x30')]({},_0x480b8b,_0x3889bb[_0x87f9('0x32')]);var _0x52d9f2={'where':_0x480b8b[_0x87f9('0x2f')]};return db[_0x87f9('0x1e')][_0x87f9('0x11')](_0x52d9f2)[_0x87f9('0x14')](function(_0x316da2){_0x3a4669[_0x87f9('0x11')]=_0x316da2;if(_0x3889bb[_0x87f9('0x23')][_0x87f9('0x33')]){_0x480b8b['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x480b8b);})[_0x87f9('0x14')](function(_0x426b8c){_0x3a4669[_0x87f9('0x34')]=_[_0x87f9('0x1d')](_0x426b8c,function(_0x4b9d6f){if(_0x4b9d6f[_0x87f9('0x35')]==='MicrosoftAzure'){var _0x3fca31=encryptor['decryptString'](_0x4b9d6f[_0x87f9('0x36')]);_0x4b9d6f[_0x87f9('0x36')]=maskClientSecret(_0x3fca31);}return _0x4b9d6f;});return _0x3a4669;})[_0x87f9('0x14')](respondWithFilteredResult(_0x13dd5e,_0x480b8b))['catch'](handleError(_0x13dd5e,null));};exports[_0x87f9('0x37')]=function(_0x19b44c,_0x1fa747){var _0x3325b7={'raw':!![],'where':{'id':_0x19b44c[_0x87f9('0x38')]['id']}},_0x9c165={};_0x9c165[_0x87f9('0x26')]=_[_0x87f9('0x24')](db['CloudProvider']['rawAttributes']);_0x9c165[_0x87f9('0x23')]=_[_0x87f9('0x24')](_0x19b44c[_0x87f9('0x23')]);_0x9c165[_0x87f9('0x25')]=_[_0x87f9('0x28')](_0x9c165['model'],_0x9c165[_0x87f9('0x23')]);_0x3325b7['attributes']=_['intersection'](_0x9c165['model'],qs['fields'](_0x19b44c[_0x87f9('0x23')]['fields']));_0x3325b7[_0x87f9('0x27')]=_0x3325b7[_0x87f9('0x27')][_0x87f9('0x2a')]?_0x3325b7[_0x87f9('0x27')]:_0x9c165[_0x87f9('0x26')];if(_0x19b44c[_0x87f9('0x23')][_0x87f9('0x33')]){_0x3325b7[_0x87f9('0x39')]=[{'all':!![]}];}_0x3325b7=_[_0x87f9('0x30')]({},_0x3325b7,_0x19b44c[_0x87f9('0x32')]);return db[_0x87f9('0x1e')][_0x87f9('0x3a')](_0x3325b7)['then'](handleEntityNotFound(_0x1fa747,null))[_0x87f9('0x14')](function(_0x208077){if(_0x208077[_0x87f9('0x35')]==='MicrosoftAzure'){var _0x10cd04=encryptor[_0x87f9('0x3b')](_0x208077[_0x87f9('0x36')]);_0x208077['data3']=maskClientSecret(_0x10cd04);}return _0x208077;})[_0x87f9('0x14')](respondWithResult(_0x1fa747,null))['catch'](handleError(_0x1fa747,null));};exports['create']=function(_0x2d2140,_0x56ca8e){if(!_0x2d2140['body'][_0x87f9('0x18')])throw new Error(_0x87f9('0x3c'));if(!_0x2d2140[_0x87f9('0x3d')][_0x87f9('0x35')])throw new Error(_0x87f9('0x3e'));var _0xd458de=db[_0x87f9('0x1e')]['rawAttributes']['service'][_0x87f9('0x3f')];if(!_0xd458de[_0x87f9('0x40')](_0x2d2140[_0x87f9('0x3d')][_0x87f9('0x35')]))throw new Error(_0x87f9('0x41')+_0xd458de[_0x87f9('0x42')](',\x20'));if(_0x2d2140[_0x87f9('0x3d')]['service']===_0x87f9('0x43')&&_0x2d2140[_0x87f9('0x3d')][_0x87f9('0x36')]){_0x2d2140[_0x87f9('0x3d')][_0x87f9('0x36')]=encryptor[_0x87f9('0x44')](_0x2d2140[_0x87f9('0x3d')][_0x87f9('0x36')]);}return db[_0x87f9('0x1e')]['create'](_0x2d2140[_0x87f9('0x3d')],{})[_0x87f9('0x14')](respondWithResult(_0x56ca8e,0xc9))['catch'](handleError(_0x56ca8e,null));};exports[_0x87f9('0x13')]=function(_0x3ad3c9,_0x3c251e){if(_0x3ad3c9['body']['id']){delete _0x3ad3c9[_0x87f9('0x3d')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x3ad3c9[_0x87f9('0x38')]['id']}})[_0x87f9('0x14')](handleEntityNotFound(_0x3c251e,null))[_0x87f9('0x14')](function(_0x4dec96){if(_0x4dec96[_0x87f9('0x35')]===_0x87f9('0x43')&&_0x3ad3c9[_0x87f9('0x3d')][_0x87f9('0x36')]){_0x3ad3c9[_0x87f9('0x3d')][_0x87f9('0x36')]=encryptor[_0x87f9('0x44')](_0x3ad3c9[_0x87f9('0x3d')]['data3']);}return _0x4dec96;})['then'](saveUpdates(_0x3ad3c9[_0x87f9('0x3d')],null))['then'](respondWithResult(_0x3c251e,null))[_0x87f9('0x45')](handleError(_0x3c251e,null));};exports[_0x87f9('0x15')]=function(_0x355b22,_0x375ebd){return db[_0x87f9('0x1e')][_0x87f9('0x3a')]({'where':{'id':_0x355b22['params']['id']}})[_0x87f9('0x14')](handleEntityNotFound(_0x375ebd,null))[_0x87f9('0x14')](removeEntity(_0x375ebd,null))[_0x87f9('0x45')](handleError(_0x375ebd,null));};exports[_0x87f9('0x46')]=function(_0x354ee8,_0x4bec12){return db[_0x87f9('0x1e')][_0x87f9('0x47')]({'where':{'id':_0x354ee8[_0x87f9('0x38')]['id']},'raw':!![]})[_0x87f9('0x14')](function(_0x2b3bba){if(!_0x2b3bba)return _0x4bec12['sendStatus'](0x194);return{'url':oauth[_0x87f9('0x48')](_0x2b3bba,_0x354ee8[_0x87f9('0x49')]['id'])};})[_0x87f9('0x14')](respondWithResult(_0x4bec12,null))['catch'](handleError(_0x4bec12,null));};exports[_0x87f9('0x4a')]=function(_0x2d5742,_0x16c323){var _0x513215=_0x2d5742[_0x87f9('0x3d')];var _0x51732a;var _0x4f9dda;if(_0x513215[_0x87f9('0x16')])throw _0x513215;redis[_0x87f9('0x4b')](_0x513215[_0x87f9('0x4c')])[_0x87f9('0x14')](function(_0x5c8b3c){if(!_0x5c8b3c)throw new Error(_0x87f9('0x4d'));_0x51732a=JSON[_0x87f9('0x4e')](_0x5c8b3c);var _0x4f6dd7=Buffer[_0x87f9('0x4f')](_0x513215['state'],_0x87f9('0x50'))[_0x87f9('0x51')](_0x87f9('0x52'));_0x4f9dda=JSON[_0x87f9('0x4e')](_0x4f6dd7);if(!oauth[_0x87f9('0x53')](_0x513215['id_token'],_0x51732a[_0x87f9('0x54')]))throw new Error(_0x87f9('0x55'));redis['del'](_0x513215[_0x87f9('0x4c')]);return oauth['getOauth2MicrosoftAccessToken'](_0x513215[_0x87f9('0x56')],_0x51732a);})[_0x87f9('0x14')](function(_0x10c254){_0x51732a[_0x87f9('0x57')]=_0x10c254[_0x87f9('0x58')];_0x51732a[_0x87f9('0x59')]=_0x10c254[_0x87f9('0x5a')];return db[_0x87f9('0x1e')]['update']({'data5':_0x51732a[_0x87f9('0x57')],'data6':_0x51732a[_0x87f9('0x59')]},{'where':{'id':_0x51732a['id']}});})['then'](function(){oauth[_0x87f9('0x5b')](_0x51732a);socket[_0x87f9('0x5c')](_0x87f9('0x5d'),{'id':_0x4f9dda['id']});return;})['then'](respondWithStatusCode(_0x16c323,null))['catch'](function(_0x2c2988){if(_0x4f9dda){socket[_0x87f9('0x5c')]('microsoftAuthorization:error',{'id':_0x4f9dda['id']});}if(!_0x51732a){logger[_0x87f9('0x16')](_0x87f9('0x5e'),_0x2c2988);return _0x16c323[_0x87f9('0xc')](0x1f4)[_0x87f9('0x19')](_0x2c2988['message']);}logger[_0x87f9('0x16')](_0x87f9('0x5f'),_0x51732a['id'],JSON[_0x87f9('0x60')](_0x2c2988));});}; \ No newline at end of file +var _0xd9d3=['data6','refresh_token','microsoftAuthorization:success','message','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../mysqldb','redis','socket.io-emitter','sendStatus','status','offset','limit','undefined','count','then','error','stack','name','send','padEnd','slice','map','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','CloudProvider','include','rows','service','decryptString','params','length','includeAll','find','MicrosoftAzure','data3','catch','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','rawAttributes','join','encryptString','update','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','code','data5'];(function(_0x5cf31d,_0x159233){var _0x3a157a=function(_0x5cd18f){while(--_0x5cd18f){_0x5cf31d['push'](_0x5cf31d['shift']());}};_0x3a157a(++_0x159233);}(_0xd9d3,0xa4));var _0x3d9d=function(_0x4a2447,_0x14c5f1){_0x4a2447=_0x4a2447-0x0;var _0x5f3630=_0xd9d3[_0x4a2447];return _0x5f3630;};'use strict';var _=require(_0x3d9d('0x0'));var Redis=require(_0x3d9d('0x1'));var qs=require(_0x3d9d('0x2'));var encryptor=require(_0x3d9d('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0x3d9d('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x3d9d('0x5')]=_['defaults'](config[_0x3d9d('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d9d('0x6'))(new Redis(config[_0x3d9d('0x5')]));var redis=new Redis(config[_0x3d9d('0x5')]);function respondWithStatusCode(_0x3b9a5d,_0x31ce8c){_0x31ce8c=_0x31ce8c||0xcc;return function(_0x582860){if(_0x582860){return _0x3b9a5d[_0x3d9d('0x7')](_0x31ce8c);}return _0x3b9a5d['status'](_0x31ce8c)['end']();};}function respondWithResult(_0x506cb5,_0x32d115){_0x32d115=_0x32d115||0xc8;return function(_0x2e8919){if(_0x2e8919){return _0x506cb5[_0x3d9d('0x8')](_0x32d115)['json'](_0x2e8919);}};}function respondWithFilteredResult(_0x574211,_0x2c8cb7){return function(_0x3e591d){if(_0x3e591d){var _0x592aae=typeof _0x2c8cb7[_0x3d9d('0x9')]==='undefined'&&typeof _0x2c8cb7[_0x3d9d('0xa')]===_0x3d9d('0xb');var _0x5c6e41=_0x3e591d[_0x3d9d('0xc')];var _0xebc7c0=_0x592aae?0x0:_0x2c8cb7[_0x3d9d('0x9')];var _0x39d32b=_0x592aae?_0x3e591d[_0x3d9d('0xc')]:_0x2c8cb7[_0x3d9d('0x9')]+_0x2c8cb7[_0x3d9d('0xa')];var _0x1e7b93;if(_0x39d32b>=_0x5c6e41){_0x39d32b=_0x5c6e41;_0x1e7b93=0xc8;}else{_0x1e7b93=0xce;}_0x574211[_0x3d9d('0x8')](_0x1e7b93);return _0x574211['set']('Content-Range',_0xebc7c0+'-'+_0x39d32b+'/'+_0x5c6e41)['json'](_0x3e591d);}return null;};}function saveUpdates(_0x5c237a){return function(_0x27b64a){if(_0x27b64a){return _0x27b64a['update'](_0x5c237a)[_0x3d9d('0xd')](function(_0xd27f33){return _0xd27f33;});}return null;};}function removeEntity(_0x5cf20d){return function(_0x451ad2){if(_0x451ad2){return _0x451ad2['destroy']()[_0x3d9d('0xd')](function(){_0x5cf20d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37878f){return function(_0x4f5636){if(!_0x4f5636){_0x37878f[_0x3d9d('0x7')](0x194);}return _0x4f5636;};}function handleError(_0x36029b,_0x21397a){_0x21397a=_0x21397a||0x1f4;return function(_0x2b6a7b){logger[_0x3d9d('0xe')](_0x2b6a7b[_0x3d9d('0xf')]);if(_0x2b6a7b[_0x3d9d('0x10')]){delete _0x2b6a7b['name'];}_0x36029b[_0x3d9d('0x8')](_0x21397a)[_0x3d9d('0x11')](_0x2b6a7b);};}function maskClientSecret(_0x4d134f){return _[_0x3d9d('0x12')](_0x4d134f[_0x3d9d('0x13')](0x0,0x3),0x14,'*');}exports['index']=function(_0x325868,_0x29cf01){var _0x2f3775={},_0x2253e7={},_0x14b5ac={'count':0x0,'rows':[]};var _0x54f75c=_[_0x3d9d('0x14')](db['CloudProvider']['rawAttributes'],function(_0x13039c){return{'name':_0x13039c[_0x3d9d('0x15')],'type':_0x13039c[_0x3d9d('0x16')]['key']};});_0x2253e7[_0x3d9d('0x17')]=_[_0x3d9d('0x14')](_0x54f75c,'name');_0x2253e7[_0x3d9d('0x18')]=_[_0x3d9d('0x19')](_0x325868['query']);_0x2253e7[_0x3d9d('0x1a')]=_['intersection'](_0x2253e7['model'],_0x2253e7[_0x3d9d('0x18')]);_0x2f3775[_0x3d9d('0x1b')]=_[_0x3d9d('0x1c')](_0x2253e7[_0x3d9d('0x17')],qs[_0x3d9d('0x1d')](_0x325868[_0x3d9d('0x18')][_0x3d9d('0x1d')]));_0x2f3775['attributes']=_0x2f3775[_0x3d9d('0x1b')]['length']?_0x2f3775[_0x3d9d('0x1b')]:_0x2253e7['model'];if(!_0x325868[_0x3d9d('0x18')][_0x3d9d('0x1e')]('nolimit')){_0x2f3775[_0x3d9d('0xa')]=qs[_0x3d9d('0xa')](_0x325868[_0x3d9d('0x18')]['limit']);_0x2f3775[_0x3d9d('0x9')]=qs[_0x3d9d('0x9')](_0x325868[_0x3d9d('0x18')]['offset']);}_0x2f3775[_0x3d9d('0x1f')]=qs['sort'](_0x325868[_0x3d9d('0x18')][_0x3d9d('0x20')]);_0x2f3775['where']=qs[_0x3d9d('0x1a')](_[_0x3d9d('0x21')](_0x325868['query'],_0x2253e7[_0x3d9d('0x1a')]),_0x54f75c);if(_0x325868[_0x3d9d('0x18')][_0x3d9d('0x22')]){_0x2f3775[_0x3d9d('0x23')]=_[_0x3d9d('0x24')](_0x2f3775[_0x3d9d('0x23')],{'$or':_[_0x3d9d('0x14')](_0x54f75c,function(_0x1cb7da){if(_0x1cb7da[_0x3d9d('0x16')]!=='VIRTUAL'){var _0x166e55={};_0x166e55[_0x1cb7da[_0x3d9d('0x10')]]={'$like':'%'+_0x325868[_0x3d9d('0x18')]['filter']+'%'};return _0x166e55;}})});}_0x2f3775=_['merge']({},_0x2f3775,_0x325868[_0x3d9d('0x25')]);var _0x41fc53={'where':_0x2f3775[_0x3d9d('0x23')]};return db[_0x3d9d('0x26')][_0x3d9d('0xc')](_0x41fc53)[_0x3d9d('0xd')](function(_0x352b6f){_0x14b5ac[_0x3d9d('0xc')]=_0x352b6f;if(_0x325868[_0x3d9d('0x18')]['includeAll']){_0x2f3775[_0x3d9d('0x27')]=[{'all':!![]}];}return db[_0x3d9d('0x26')]['findAll'](_0x2f3775);})[_0x3d9d('0xd')](function(_0x56398e){_0x14b5ac[_0x3d9d('0x28')]=_[_0x3d9d('0x14')](_0x56398e,function(_0x3fea70){if(_0x3fea70[_0x3d9d('0x29')]==='MicrosoftAzure'){var _0x24c839=encryptor[_0x3d9d('0x2a')](_0x3fea70['data3']);_0x3fea70['data3']=maskClientSecret(_0x24c839);}return _0x3fea70;});return _0x14b5ac;})['then'](respondWithFilteredResult(_0x29cf01,_0x2f3775))['catch'](handleError(_0x29cf01,null));};exports['show']=function(_0x313cb9,_0x1c8049){var _0x357b01={'raw':!![],'where':{'id':_0x313cb9[_0x3d9d('0x2b')]['id']}},_0x302e3f={};_0x302e3f[_0x3d9d('0x17')]=_[_0x3d9d('0x19')](db[_0x3d9d('0x26')]['rawAttributes']);_0x302e3f['query']=_[_0x3d9d('0x19')](_0x313cb9[_0x3d9d('0x18')]);_0x302e3f[_0x3d9d('0x1a')]=_[_0x3d9d('0x1c')](_0x302e3f['model'],_0x302e3f[_0x3d9d('0x18')]);_0x357b01[_0x3d9d('0x1b')]=_[_0x3d9d('0x1c')](_0x302e3f[_0x3d9d('0x17')],qs[_0x3d9d('0x1d')](_0x313cb9[_0x3d9d('0x18')][_0x3d9d('0x1d')]));_0x357b01[_0x3d9d('0x1b')]=_0x357b01[_0x3d9d('0x1b')][_0x3d9d('0x2c')]?_0x357b01[_0x3d9d('0x1b')]:_0x302e3f[_0x3d9d('0x17')];if(_0x313cb9[_0x3d9d('0x18')][_0x3d9d('0x2d')]){_0x357b01['include']=[{'all':!![]}];}_0x357b01=_[_0x3d9d('0x24')]({},_0x357b01,_0x313cb9['options']);return db['CloudProvider'][_0x3d9d('0x2e')](_0x357b01)[_0x3d9d('0xd')](handleEntityNotFound(_0x1c8049,null))['then'](function(_0x442f74){if(_0x442f74[_0x3d9d('0x29')]===_0x3d9d('0x2f')){var _0x4b69ae=encryptor[_0x3d9d('0x2a')](_0x442f74[_0x3d9d('0x30')]);_0x442f74[_0x3d9d('0x30')]=maskClientSecret(_0x4b69ae);}return _0x442f74;})[_0x3d9d('0xd')](respondWithResult(_0x1c8049,null))[_0x3d9d('0x31')](handleError(_0x1c8049,null));};exports[_0x3d9d('0x32')]=function(_0x9dbb2f,_0x30b0ef){if(!_0x9dbb2f['body'][_0x3d9d('0x10')])throw new Error(_0x3d9d('0x33'));if(!_0x9dbb2f[_0x3d9d('0x34')][_0x3d9d('0x29')])throw new Error(_0x3d9d('0x35'));var _0x43db36=db[_0x3d9d('0x26')][_0x3d9d('0x36')][_0x3d9d('0x29')]['values'];if(!_0x43db36['includes'](_0x9dbb2f[_0x3d9d('0x34')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x43db36[_0x3d9d('0x37')](',\x20'));if(_0x9dbb2f[_0x3d9d('0x34')][_0x3d9d('0x29')]===_0x3d9d('0x2f')&&_0x9dbb2f['body']['data3']){_0x9dbb2f[_0x3d9d('0x34')]['data3']=encryptor[_0x3d9d('0x38')](_0x9dbb2f[_0x3d9d('0x34')][_0x3d9d('0x30')]);}return db[_0x3d9d('0x26')][_0x3d9d('0x32')](_0x9dbb2f['body'],{})[_0x3d9d('0xd')](respondWithResult(_0x30b0ef,0xc9))[_0x3d9d('0x31')](handleError(_0x30b0ef,null));};exports[_0x3d9d('0x39')]=function(_0x1b10d9,_0x4ccc03){if(_0x1b10d9['body']['id']){delete _0x1b10d9[_0x3d9d('0x34')]['id'];}return db[_0x3d9d('0x26')][_0x3d9d('0x2e')]({'where':{'id':_0x1b10d9[_0x3d9d('0x2b')]['id']}})[_0x3d9d('0xd')](handleEntityNotFound(_0x4ccc03,null))[_0x3d9d('0xd')](function(_0x155bb3){if(_0x155bb3[_0x3d9d('0x29')]===_0x3d9d('0x2f')&&_0x1b10d9[_0x3d9d('0x34')][_0x3d9d('0x30')]){_0x1b10d9[_0x3d9d('0x34')][_0x3d9d('0x30')]=encryptor['encryptString'](_0x1b10d9['body'][_0x3d9d('0x30')]);}return _0x155bb3;})[_0x3d9d('0xd')](saveUpdates(_0x1b10d9['body'],null))[_0x3d9d('0xd')](respondWithResult(_0x4ccc03,null))[_0x3d9d('0x31')](handleError(_0x4ccc03,null));};exports[_0x3d9d('0x3a')]=function(_0xe4ba18,_0x1dc0cd){return db[_0x3d9d('0x26')][_0x3d9d('0x2e')]({'where':{'id':_0xe4ba18[_0x3d9d('0x2b')]['id']}})[_0x3d9d('0xd')](handleEntityNotFound(_0x1dc0cd,null))[_0x3d9d('0xd')](removeEntity(_0x1dc0cd,null))[_0x3d9d('0x31')](handleError(_0x1dc0cd,null));};exports[_0x3d9d('0x3b')]=function(_0x3a3bf6,_0x395453){return db[_0x3d9d('0x26')][_0x3d9d('0x3c')]({'where':{'id':_0x3a3bf6[_0x3d9d('0x2b')]['id']},'raw':!![]})[_0x3d9d('0xd')](function(_0x342d5a){if(!_0x342d5a)return _0x395453[_0x3d9d('0x7')](0x194);return{'url':oauth[_0x3d9d('0x3d')](_0x342d5a,_0x3a3bf6['user']['id'])};})[_0x3d9d('0xd')](respondWithResult(_0x395453,null))[_0x3d9d('0x31')](handleError(_0x395453,null));};exports[_0x3d9d('0x3e')]=function(_0x12cfef,_0x575732){var _0xa55871=_0x12cfef[_0x3d9d('0x34')];var _0x38c093;var _0x224acd;if(_0xa55871[_0x3d9d('0xe')])throw _0xa55871;redis[_0x3d9d('0x3f')](_0xa55871[_0x3d9d('0x40')])[_0x3d9d('0xd')](function(_0xfea0f5){if(!_0xfea0f5)throw new Error(_0x3d9d('0x41'));_0x38c093=JSON['parse'](_0xfea0f5);var _0x3c9da8=Buffer[_0x3d9d('0x42')](_0xa55871[_0x3d9d('0x40')],_0x3d9d('0x43'))[_0x3d9d('0x44')](_0x3d9d('0x45'));_0x224acd=JSON[_0x3d9d('0x46')](_0x3c9da8);if(!oauth[_0x3d9d('0x47')](_0xa55871[_0x3d9d('0x48')],_0x38c093[_0x3d9d('0x49')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0xa55871[_0x3d9d('0x40')]);return oauth['getOauth2MicrosoftAccessToken'](_0xa55871[_0x3d9d('0x4a')],_0x38c093);})[_0x3d9d('0xd')](function(_0x374950){_0x38c093[_0x3d9d('0x4b')]=_0x374950['access_token'];_0x38c093[_0x3d9d('0x4c')]=_0x374950[_0x3d9d('0x4d')];return db['CloudProvider'][_0x3d9d('0x39')]({'data5':_0x38c093['data5'],'data6':_0x38c093[_0x3d9d('0x4c')]},{'where':{'id':_0x38c093['id']}});})[_0x3d9d('0xd')](function(){oauth['startRefreshInterval'](_0x38c093);socket['emit'](_0x3d9d('0x4e'),{'id':_0x224acd['id']});return;})[_0x3d9d('0xd')](respondWithStatusCode(_0x575732,null))[_0x3d9d('0x31')](function(_0x4dc80e){if(_0x224acd){socket['emit']('microsoftAuthorization:error',{'id':_0x224acd['id']});}if(!_0x38c093){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x4dc80e);return _0x575732['status'](0x1f4)[_0x3d9d('0x11')](_0x4dc80e[_0x3d9d('0x4f')]);}logger[_0x3d9d('0xe')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x38c093['id'],JSON['stringify'](_0x4dc80e));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index e9077a6..f44a94e 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 _0x13e2=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','path','./cloudProvider.attributes','define'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x13e2,0x86));var _0x213e=function(_0x123a00,_0x8a2819){_0x123a00=_0x123a00-0x0;var _0xb533ef=_0x13e2[_0x123a00];return _0xb533ef;};'use strict';var _=require(_0x213e('0x0'));var util=require(_0x213e('0x1'));var logger=require(_0x213e('0x2'))(_0x213e('0x3'));var moment=require(_0x213e('0x4'));var BPromise=require(_0x213e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x213e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x213e('0x7'));module['exports']=function(_0x35845f,_0x56fef6){return _0x35845f[_0x213e('0x8')](_0x213e('0x9'),attributes,{'tableName':_0x213e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b7b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cloud_providers','lodash','util','api'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8b7b,0x135));var _0xb8b7=function(_0x3e6a7d,_0x4d4018){_0x3e6a7d=_0x3e6a7d-0x0;var _0x3fb19a=_0x8b7b[_0x3e6a7d];return _0x3fb19a;};'use strict';var _=require(_0xb8b7('0x0'));var util=require(_0xb8b7('0x1'));var logger=require('../../config/logger')(_0xb8b7('0x2'));var moment=require(_0xb8b7('0x3'));var BPromise=require(_0xb8b7('0x4'));var rp=require(_0xb8b7('0x5'));var fs=require('fs');var path=require(_0xb8b7('0x6'));var rimraf=require(_0xb8b7('0x7'));var config=require(_0xb8b7('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xb8b7('0x9')]=function(_0x3c9878,_0x5aa41a){return _0x3c9878[_0xb8b7('0xa')]('CloudProvider',attributes,{'tableName':_0xb8b7('0xb'),'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 ddb5989..406b999 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 _0x6553=['offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','toString','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','state','prompt','key','value','oauth2/','data1','set','stringify','decode','payload','iss','issuer','aud','audience','nonce','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','data5','data6','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile'];(function(_0x1ae01f,_0x4ecd6f){var _0x411189=function(_0xa7baf){while(--_0xa7baf){_0x1ae01f['push'](_0x1ae01f['shift']());}};_0x411189(++_0x4ecd6f);}(_0x6553,0xdf));var _0x3655=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x6553[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x3655('0x0'));var crypto=require(_0x3655('0x1'));var jwt=require(_0x3655('0x2'));var moment=require(_0x3655('0x3'));var Redis=require(_0x3655('0x4'));var rp=require(_0x3655('0x5'));var util=require(_0x3655('0x6'));var encryptor=require(_0x3655('0x7'));var config=require(_0x3655('0x8'));var logger=require(_0x3655('0x9'))(_0x3655('0xa'));var schedule=require(_0x3655('0xb'));var db=require(_0x3655('0xc'))['db'];config[_0x3655('0xd')]=_['defaults'](config[_0x3655('0xd')],{'host':_0x3655('0xe'),'port':0x18eb});var redis=new Redis(config[_0x3655('0xd')]);var MICROSOFT_AUTH_URL=_0x3655('0xf');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x3655('0x10'),'email',_0x3655('0x11'),_0x3655('0x12'),_0x3655('0x13'),_0x3655('0x14')],'Dynamics365':[_0x3655('0x15'),_0x3655('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x3655('0x16');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x477aa6){var _0x2174a5=_[_0x3655('0x17')](AZURE_AUTH_SCOPES[_0x477aa6[_0x3655('0x18')]]);if(_0x477aa6[_0x3655('0x18')]===_0x3655('0x19'))_0x2174a5['push'](_0x477aa6[_0x3655('0x1a')]+_0x3655('0x1b'));return _0x2174a5[_0x3655('0x1c')]('\x20');}function getAccessTokenScope(_0x2dc408){if(_0x2dc408['type']===_0x3655('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2dc408[_0x3655('0x18')]===_0x3655('0x19'))return _0x2dc408[_0x3655('0x1a')]+_0x3655('0x1b');}function generateMicrosoftAuthorizationUrl(_0x56fce5,_0x54cc96){var _0x1177d4=MICROSOFT_AUTH_URL[_0x3655('0x1e')](_0x3655('0x1f'),_0x56fce5[_0x3655('0x20')]);var _0x384a23=[_0x3655('0x21'),'id_token'];var _0xa41d72=Buffer[_0x3655('0x22')](JSON['stringify']({'id':_0x54cc96}))['toString']('base64');var _0x1b9b18=crypto['randomBytes'](0x10)[_0x3655('0x23')](_0x3655('0x24'));var _0x3beaca=getAuthorizationScopes(_0x56fce5);var _0x1d042b=[{'key':_0x3655('0x25'),'value':_0x56fce5['data1']},{'key':_0x3655('0x26'),'value':encodeURIComponent(_0x384a23[_0x3655('0x1c')]('\x20'))},{'key':_0x3655('0x27'),'value':_0x56fce5[_0x3655('0x28')]},{'key':_0x3655('0x29'),'value':_0x3655('0x2a')},{'key':'scope','value':encodeURIComponent(_0x3beaca)},{'key':_0x3655('0x2b'),'value':_0xa41d72},{'key':'nonce','value':_0x1b9b18},{'key':_0x3655('0x2c'),'value':'login'}];var _0x10d5cd=_0x1177d4+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x3655('0x17')](_0x1d042b,function(_0x469cec){return _0x469cec[_0x3655('0x2d')]+'='+_0x469cec[_0x3655('0x2e')];})[_0x3655('0x1c')]('&');_0x56fce5['oauth2Claims']={'issuer':_0x1177d4[_0x3655('0x1e')](_0x3655('0x2f'),''),'audience':_0x56fce5[_0x3655('0x30')],'state':_0xa41d72,'nonce':_0x1b9b18};redis[_0x3655('0x31')](_0xa41d72,JSON[_0x3655('0x32')](_0x56fce5));return _0x10d5cd;}function isValidIdToken(_0x33e98f,_0x38d66b){try{var _0x534377=jwt[_0x3655('0x33')](_0x33e98f,{'complete':!![]});var _0x2d8c41=_0x534377[_0x3655('0x34')];if(_0x2d8c41[_0x3655('0x35')]!==_0x38d66b[_0x3655('0x36')])return![];if(_0x2d8c41[_0x3655('0x37')]!==_0x38d66b[_0x3655('0x38')])return![];if(_0x2d8c41[_0x3655('0x39')]!==_0x38d66b[_0x3655('0x39')])return![];if(moment()['isAfter'](moment[_0x3655('0x3a')](_0x2d8c41[_0x3655('0x3b')])))return![];return!![];}catch(_0x5d6c3e){throw _0x5d6c3e;}}function refreshOauth2MicrosoftAccessToken(_0x46fc3c){return Promise[_0x3655('0x3c')]()[_0x3655('0x3d')](function(){if(_0x46fc3c[_0x3655('0x3e')])return _0x46fc3c;return db[_0x3655('0x3f')][_0x3655('0x40')]({'where':{'id':_0x46fc3c['id']},'raw':!![]});})['then'](function(_0x4d4667){var _0x4f1e6a={'grant_type':_0x3655('0x41'),'refresh_token':_0x4d4667['data6'],'scope':getAccessTokenScope(_0x4d4667),'redirect_uri':_0x4d4667['data4'],'client_id':_0x4d4667[_0x3655('0x30')],'client_secret':encryptor[_0x3655('0x42')](_0x4d4667[_0x3655('0x3e')])};var _0x1246c3={'method':_0x3655('0x43'),'uri':MICROSOFT_AUTH_URL[_0x3655('0x1e')](_0x3655('0x1f'),_0x4d4667[_0x3655('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f1e6a,'json':!![]};return rp(_0x1246c3);})[_0x3655('0x3d')](function(_0x4771a8){_0x46fc3c[_0x3655('0x44')]=_0x4771a8['access_token'];_0x46fc3c[_0x3655('0x45')]=_0x4771a8[_0x3655('0x41')];return db['CloudProvider'][_0x3655('0x46')]({'data5':_0x46fc3c[_0x3655('0x44')],'data6':_0x46fc3c[_0x3655('0x45')]},{'where':{'id':_0x46fc3c['id']}});})[_0x3655('0x3d')](function(){return _0x46fc3c;})[_0x3655('0x47')](function(_0x6f5f7b){logger['error'](_0x3655('0x48'),_0x46fc3c['id'],_0x6f5f7b);});}function getOauth2MicrosoftAccessToken(_0x3dfb76,_0x2f041f){var _0x170a3f={'grant_type':_0x3655('0x49'),'code':_0x3dfb76,'scope':getAccessTokenScope(_0x2f041f),'redirect_uri':_0x2f041f[_0x3655('0x28')],'client_id':_0x2f041f['data1'],'client_secret':encryptor[_0x3655('0x42')](_0x2f041f[_0x3655('0x3e')])};var _0x2cbb3c={'method':_0x3655('0x43'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3655('0x1f'),_0x2f041f[_0x3655('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x170a3f,'json':!![]};return rp(_0x2cbb3c);}function startRefreshInterval(_0x1d994b){var _0x458f54=schedule[_0x3655('0x4a')];if(_0x458f54[_0x1d994b['id']])clearInterval(_0x458f54[_0x1d994b['id']]);_0x458f54[_0x1d994b['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1d994b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3655('0x4a')]=_0x458f54;}function startAllRefreshIntervals(){return db[_0x3655('0x3f')][_0x3655('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x3655('0x3d')](function(_0x51312f){var _0x1784f3=_0x51312f['map'](function(_0x431144){return refreshOauth2MicrosoftAccessToken(_0x431144)[_0x3655('0x3d')](function(_0x5ba216){startRefreshInterval(_0x5ba216);});});return Promise[_0x3655('0x4c')](_0x1784f3);})[_0x3655('0x47')](function(_0x274c1d){var _0x587c1=_0x274c1d?util[_0x3655('0x4d')](_0x274c1d,{'showHidden':![],'depth':null}):'';logger[_0x3655('0x4e')](_0x3655('0x4f'),_0x587c1);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xe3bf=['openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','id_token','stringify','toString','base64','hex','client_id','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','map','key','oauth2Claims','oauth2/','set','iss','issuer','audience','isAfter','unix','resolve','data3','CloudProvider','then','refresh_token','data6','POST','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','moment','ioredis','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x523e27,_0x551716){var _0x42e090=function(_0x4a2736){while(--_0x4a2736){_0x523e27['push'](_0x523e27['shift']());}};_0x42e090(++_0x551716);}(_0xe3bf,0x85));var _0xfe3b=function(_0x457ad4,_0x4ee03b){_0x457ad4=_0x457ad4-0x0;var _0x2278e8=_0xe3bf[_0x457ad4];return _0x2278e8;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xfe3b('0x0'));var moment=require(_0xfe3b('0x1'));var Redis=require(_0xfe3b('0x2'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0xfe3b('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xfe3b('0x4'));var schedule=require(_0xfe3b('0x5'));var db=require(_0xfe3b('0x6'))['db'];config['redis']=_[_0xfe3b('0x7')](config[_0xfe3b('0x8')],{'host':_0xfe3b('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xfe3b('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xfe3b('0xb'),'profile',_0xfe3b('0xc'),_0xfe3b('0xd'),_0xfe3b('0xe'),_0xfe3b('0xf'),_0xfe3b('0x10')],'Dynamics365':[_0xfe3b('0xb'),_0xfe3b('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xfe3b('0x11');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3d1a4a){var _0x5f2ef8=_['map'](AZURE_AUTH_SCOPES[_0x3d1a4a[_0xfe3b('0x12')]]);if(_0x3d1a4a[_0xfe3b('0x12')]===_0xfe3b('0x13'))_0x5f2ef8[_0xfe3b('0x14')](_0x3d1a4a['data7']+_0xfe3b('0x15'));return _0x5f2ef8[_0xfe3b('0x16')]('\x20');}function getAccessTokenScope(_0x14a7e2){if(_0x14a7e2['type']===_0xfe3b('0x17'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x14a7e2[_0xfe3b('0x12')]===_0xfe3b('0x13'))return _0x14a7e2[_0xfe3b('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x90c471,_0x539797){var _0x30d5c8=MICROSOFT_AUTH_URL[_0xfe3b('0x19')](_0xfe3b('0x1a'),_0x90c471[_0xfe3b('0x1b')]);var _0x3653fa=['code',_0xfe3b('0x1c')];var _0x12f1c7=Buffer['from'](JSON[_0xfe3b('0x1d')]({'id':_0x539797}))[_0xfe3b('0x1e')](_0xfe3b('0x1f'));var _0x1aac32=crypto['randomBytes'](0x10)[_0xfe3b('0x1e')](_0xfe3b('0x20'));var _0x4a90a6=getAuthorizationScopes(_0x90c471);var _0xe30c27=[{'key':_0xfe3b('0x21'),'value':_0x90c471[_0xfe3b('0x22')]},{'key':_0xfe3b('0x23'),'value':encodeURIComponent(_0x3653fa[_0xfe3b('0x16')]('\x20'))},{'key':_0xfe3b('0x24'),'value':_0x90c471[_0xfe3b('0x25')]},{'key':'response_mode','value':_0xfe3b('0x26')},{'key':_0xfe3b('0x27'),'value':encodeURIComponent(_0x4a90a6)},{'key':_0xfe3b('0x28'),'value':_0x12f1c7},{'key':_0xfe3b('0x29'),'value':_0x1aac32},{'key':_0xfe3b('0x2a'),'value':_0xfe3b('0x2b')}];var _0x4f91fe=_0x30d5c8+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xfe3b('0x2c')](_0xe30c27,function(_0x5de18b){return _0x5de18b[_0xfe3b('0x2d')]+'='+_0x5de18b['value'];})['join']('&');_0x90c471[_0xfe3b('0x2e')]={'issuer':_0x30d5c8[_0xfe3b('0x19')](_0xfe3b('0x2f'),''),'audience':_0x90c471['data1'],'state':_0x12f1c7,'nonce':_0x1aac32};redis[_0xfe3b('0x30')](_0x12f1c7,JSON['stringify'](_0x90c471));return _0x4f91fe;}function isValidIdToken(_0x1a8762,_0x44ba1f){try{var _0x397e85=jwt['decode'](_0x1a8762,{'complete':!![]});var _0x18d37f=_0x397e85['payload'];if(_0x18d37f[_0xfe3b('0x31')]!==_0x44ba1f[_0xfe3b('0x32')])return![];if(_0x18d37f['aud']!==_0x44ba1f[_0xfe3b('0x33')])return![];if(_0x18d37f[_0xfe3b('0x29')]!==_0x44ba1f[_0xfe3b('0x29')])return![];if(moment()[_0xfe3b('0x34')](moment[_0xfe3b('0x35')](_0x18d37f['exp'])))return![];return!![];}catch(_0x491a18){throw _0x491a18;}}function refreshOauth2MicrosoftAccessToken(_0x188d16){return Promise[_0xfe3b('0x36')]()['then'](function(){if(_0x188d16[_0xfe3b('0x37')])return _0x188d16;return db[_0xfe3b('0x38')]['findOne']({'where':{'id':_0x188d16['id']},'raw':!![]});})[_0xfe3b('0x39')](function(_0xf3b53c){var _0x3ae73f={'grant_type':_0xfe3b('0x3a'),'refresh_token':_0xf3b53c[_0xfe3b('0x3b')],'scope':getAccessTokenScope(_0xf3b53c),'redirect_uri':_0xf3b53c[_0xfe3b('0x25')],'client_id':_0xf3b53c['data1'],'client_secret':encryptor['decryptString'](_0xf3b53c[_0xfe3b('0x37')])};var _0x599086={'method':_0xfe3b('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xfe3b('0x19')](_0xfe3b('0x1a'),_0xf3b53c[_0xfe3b('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ae73f,'json':!![]};return rp(_0x599086);})['then'](function(_0x3f38d3){_0x188d16[_0xfe3b('0x3d')]=_0x3f38d3['access_token'];_0x188d16['data6']=_0x3f38d3['refresh_token'];return db[_0xfe3b('0x38')]['update']({'data5':_0x188d16[_0xfe3b('0x3d')],'data6':_0x188d16[_0xfe3b('0x3b')]},{'where':{'id':_0x188d16['id']}});})[_0xfe3b('0x39')](function(){return _0x188d16;})[_0xfe3b('0x3e')](function(_0x5b18dd){logger[_0xfe3b('0x3f')](_0xfe3b('0x40'),_0x188d16['id'],_0x5b18dd);});}function getOauth2MicrosoftAccessToken(_0x194837,_0x165151){var _0x5ed26e={'grant_type':_0xfe3b('0x41'),'code':_0x194837,'scope':getAccessTokenScope(_0x165151),'redirect_uri':_0x165151[_0xfe3b('0x25')],'client_id':_0x165151[_0xfe3b('0x22')],'client_secret':encryptor[_0xfe3b('0x42')](_0x165151['data3'])};var _0xec9e8e={'method':_0xfe3b('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xfe3b('0x19')](_0xfe3b('0x1a'),_0x165151[_0xfe3b('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5ed26e,'json':!![]};return rp(_0xec9e8e);}function startRefreshInterval(_0x3fa3fa){var _0x561c56=schedule[_0xfe3b('0x43')];if(_0x561c56[_0x3fa3fa['id']])clearInterval(_0x561c56[_0x3fa3fa['id']]);_0x561c56[_0x3fa3fa['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xfe3b('0x44')](this,{'id':_0x3fa3fa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xfe3b('0x43')]=_0x561c56;}function startAllRefreshIntervals(){return db[_0xfe3b('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xfe3b('0x39')](function(_0x321f0e){var _0x20a0a5=_0x321f0e[_0xfe3b('0x2c')](function(_0x7e5dec){return refreshOauth2MicrosoftAccessToken(_0x7e5dec)[_0xfe3b('0x39')](function(_0x50da80){startRefreshInterval(_0x50da80);});});return Promise['all'](_0x20a0a5);})[_0xfe3b('0x3e')](function(_0x488650){var _0x2a3386=_0x488650?util[_0xfe3b('0x45')](_0x488650,{'showHidden':![],'depth':null}):'';logger[_0xfe3b('0x3f')](_0xfe3b('0x46'),_0x2a3386);});}module[_0xfe3b('0x47')]={'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 61c6851..053617e 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 _0xa1cc=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x87a349,_0x392967){var _0x50fa80=function(_0x4a82e1){while(--_0x4a82e1){_0x87a349['push'](_0x87a349['shift']());}};_0x50fa80(++_0x392967);}(_0xa1cc,0x10f));var _0xca1c=function(_0x17342a,_0x36e237){_0x17342a=_0x17342a-0x0;var _0x117ced=_0xa1cc[_0x17342a];return _0x117ced;};'use strict';var _=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var moment=require(_0xca1c('0x2'));var BPromise=require('bluebird');var rs=require(_0xca1c('0x3'));var fs=require('fs');var Redis=require(_0xca1c('0x4'));var db=require(_0xca1c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca1c('0x6'))('rpc');var config=require(_0xca1c('0x7'));var jayson=require(_0xca1c('0x8'));var client=jayson[_0xca1c('0x9')][_0xca1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d5101,_0x5132e2,_0x4ff3f7){return new BPromise(function(_0x8fc787,_0x21f118){return client['request'](_0x5d5101,_0x4ff3f7)['then'](function(_0x57807b){logger[_0xca1c('0xb')]('CloudProvider,\x20%s,\x20%s',_0x5132e2,_0xca1c('0xc'));logger[_0xca1c('0xd')](_0xca1c('0xe'),_0x5132e2,_0xca1c('0xc'),JSON[_0xca1c('0xf')](_0x57807b));if(_0x57807b['error']){if(_0x57807b[_0xca1c('0x10')][_0xca1c('0x11')]===0x1f4){logger['error'](_0xca1c('0x12'),_0x5132e2,_0x57807b['error'][_0xca1c('0x13')]);return _0x21f118(_0x57807b[_0xca1c('0x10')][_0xca1c('0x13')]);}logger['error'](_0xca1c('0x12'),_0x5132e2,_0x57807b[_0xca1c('0x10')]['message']);return _0x8fc787(_0x57807b['error'][_0xca1c('0x13')]);}else{logger[_0xca1c('0xb')](_0xca1c('0x12'),_0x5132e2,_0xca1c('0xc'));_0x8fc787(_0x57807b[_0xca1c('0x14')][_0xca1c('0x13')]);}})[_0xca1c('0x15')](function(_0x357321){logger[_0xca1c('0x10')](_0xca1c('0x12'),_0x5132e2,_0x357321);_0x21f118(_0x357321);});});} \ No newline at end of file +var _0xdfdd=['request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','CloudProvider,\x20%s,\x20%s'];(function(_0x198247,_0x491c12){var _0x2b18bc=function(_0x4a43e2){while(--_0x4a43e2){_0x198247['push'](_0x198247['shift']());}};_0x2b18bc(++_0x491c12);}(_0xdfdd,0x104));var _0xddfd=function(_0x519196,_0x31b7f4){_0x519196=_0x519196-0x0;var _0x10d6d2=_0xdfdd[_0x519196];return _0x10d6d2;};'use strict';var _=require(_0xddfd('0x0'));var util=require(_0xddfd('0x1'));var moment=require(_0xddfd('0x2'));var BPromise=require(_0xddfd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddfd('0x5'));var logger=require('../../config/logger')(_0xddfd('0x6'));var config=require(_0xddfd('0x7'));var jayson=require(_0xddfd('0x8'));var client=jayson[_0xddfd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fcbc,_0x485ede,_0x2e8f21){return new BPromise(function(_0x45bdd0,_0xf134d7){return client[_0xddfd('0xa')](_0x25fcbc,_0x2e8f21)[_0xddfd('0xb')](function(_0x2a3b1e){logger['info'](_0xddfd('0xc'),_0x485ede,_0xddfd('0xd'));logger['debug'](_0xddfd('0xe'),_0x485ede,_0xddfd('0xd'),JSON[_0xddfd('0xf')](_0x2a3b1e));if(_0x2a3b1e[_0xddfd('0x10')]){if(_0x2a3b1e[_0xddfd('0x10')]['code']===0x1f4){logger[_0xddfd('0x10')]('CloudProvider,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')]['message']);return _0xf134d7(_0x2a3b1e[_0xddfd('0x10')]['message']);}logger[_0xddfd('0x10')]('CloudProvider,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);return _0x45bdd0(_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);}else{logger[_0xddfd('0x12')]('CloudProvider,\x20%s,\x20%s',_0x485ede,_0xddfd('0xd'));_0x45bdd0(_0x2a3b1e[_0xddfd('0x13')][_0xddfd('0x11')]);}})[_0xddfd('0x14')](function(_0xa85d01){logger[_0xddfd('0x10')](_0xddfd('0xc'),_0x485ede,_0xa85d01);_0xf134d7(_0xa85d01);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 158caf8..4b413ed 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x1261,0x144));var _0x1126=function(_0xd0a290,_0x55cb33){_0xd0a290=_0xd0a290-0x0;var _0x377b3d=_0x1261[_0xd0a290];return _0x377b3d;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x1261,0x144));var _0x1126=function(_0x524efa,_0xbe406e){_0x524efa=_0x524efa-0x0;var _0x775cd5=_0x1261[_0x524efa];return _0x775cd5;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index a4e4ef7..520b5de 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 _0xb3eb=['exports','STRING','sequelize'];(function(_0x393322,_0x2054c5){var _0x25fb18=function(_0x56cd13){while(--_0x56cd13){_0x393322['push'](_0x393322['shift']());}};_0x25fb18(++_0x2054c5);}(_0xb3eb,0x80));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbb3e('0x0'));module[_0xbb3e('0x1')]={'name':{'type':Sequelize[_0xbb3e('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbb3e('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xbb3e('0x2')]},'fax':{'type':Sequelize[_0xbb3e('0x2')]},'type':{'type':Sequelize[_0xbb3e('0x2')]},'street':{'type':Sequelize[_0xbb3e('0x2')]},'postalCode':{'type':Sequelize[_0xbb3e('0x2')]},'city':{'type':Sequelize[_0xbb3e('0x2')]},'country':{'type':Sequelize[_0xbb3e('0x2')]},'email':{'type':Sequelize[_0xbb3e('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbb3e('0x2')]},'sStreet':{'type':Sequelize[_0xbb3e('0x2')]},'sPostalCode':{'type':Sequelize[_0xbb3e('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xbb3e('0x2')]},'description':{'type':Sequelize[_0xbb3e('0x2')]}}; \ No newline at end of file +var _0x0cb9=['STRING','sequelize','exports','name'];(function(_0xe854f0,_0x1ab69f){var _0x53a4e4=function(_0x107da6){while(--_0x107da6){_0xe854f0['push'](_0xe854f0['shift']());}};_0x53a4e4(++_0x1ab69f);}(_0x0cb9,0x131));var _0x90cb=function(_0x37fc97,_0xde3686){_0x37fc97=_0x37fc97-0x0;var _0x5bc38b=_0x0cb9[_0x37fc97];return _0x5bc38b;};'use strict';var Sequelize=require(_0x90cb('0x0'));module[_0x90cb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x90cb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x90cb('0x3')]},'website':{'type':Sequelize[_0x90cb('0x3')]},'phone':{'type':Sequelize[_0x90cb('0x3')]},'fax':{'type':Sequelize[_0x90cb('0x3')]},'type':{'type':Sequelize[_0x90cb('0x3')]},'street':{'type':Sequelize[_0x90cb('0x3')]},'postalCode':{'type':Sequelize[_0x90cb('0x3')]},'city':{'type':Sequelize[_0x90cb('0x3')]},'country':{'type':Sequelize[_0x90cb('0x3')]},'email':{'type':Sequelize[_0x90cb('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x90cb('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x90cb('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index d0429ef..2ab1750 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 _0x00d8=['sort','where','pick','filter','merge','map','CmCompany','count','findAll','rows','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','set','json','save','update','then','get','UserProfileResource','destroy','error','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x00d8,0x125));var _0x800d=function(_0x12058d,_0x4e44e1){_0x12058d=_0x12058d-0x0;var _0x1d22d6=_0x00d8[_0x12058d];return _0x1d22d6;};'use strict';var emlformat=require(_0x800d('0x0'));var rimraf=require(_0x800d('0x1'));var zipdir=require(_0x800d('0x2'));var jsonpatch=require(_0x800d('0x3'));var rp=require(_0x800d('0x4'));var moment=require(_0x800d('0x5'));var BPromise=require(_0x800d('0x6'));var Mustache=require('mustache');var util=require(_0x800d('0x7'));var path=require(_0x800d('0x8'));var sox=require('sox');var csv=require(_0x800d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x800d('0xa'));var squel=require(_0x800d('0xb'));var crypto=require(_0x800d('0xc'));var jsforce=require(_0x800d('0xd'));var deskjs=require(_0x800d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x800d('0xf'));var Papa=require(_0x800d('0x10'));var Redis=require(_0x800d('0x11'));var authService=require(_0x800d('0x12'));var qs=require(_0x800d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x800d('0x14'));var logger=require(_0x800d('0x15'))(_0x800d('0x16'));var utils=require(_0x800d('0x17'));var config=require(_0x800d('0x18'));var licenseUtil=require(_0x800d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58bc04,_0x475729){_0x475729=_0x475729||0xcc;return function(_0x526447){if(_0x526447){return _0x58bc04[_0x800d('0x1a')](_0x475729);}return _0x58bc04[_0x800d('0x1b')](_0x475729)[_0x800d('0x1c')]();};}function respondWithResult(_0x3e563b,_0x5bdc10){_0x5bdc10=_0x5bdc10||0xc8;return function(_0x4aee5e){if(_0x4aee5e){return _0x3e563b['status'](_0x5bdc10)['json'](_0x4aee5e);}};}function respondWithFilteredResult(_0xe4fc70,_0x548704){return function(_0x115c10){if(_0x115c10){var _0x5b76e1=typeof _0x548704[_0x800d('0x1d')]==='undefined'&&typeof _0x548704[_0x800d('0x1e')]===_0x800d('0x1f');var _0x4c42d6=_0x115c10['count'];var _0x503a75=_0x5b76e1?0x0:_0x548704[_0x800d('0x1d')];var _0x4e1415=_0x5b76e1?_0x115c10['count']:_0x548704[_0x800d('0x1d')]+_0x548704[_0x800d('0x1e')];var _0x2ce6e5;if(_0x4e1415>=_0x4c42d6){_0x4e1415=_0x4c42d6;_0x2ce6e5=0xc8;}else{_0x2ce6e5=0xce;}_0xe4fc70[_0x800d('0x1b')](_0x2ce6e5);return _0xe4fc70[_0x800d('0x20')]('Content-Range',_0x503a75+'-'+_0x4e1415+'/'+_0x4c42d6)[_0x800d('0x21')](_0x115c10);}return null;};}function patchUpdates(_0x5dcc2c){return function(_0x472213){try{jsonpatch['apply'](_0x472213,_0x5dcc2c,!![]);}catch(_0x230041){return BPromise['reject'](_0x230041);}return _0x472213[_0x800d('0x22')]();};}function saveUpdates(_0xa14a0b,_0x2df607){return function(_0x1c17d2){if(_0x1c17d2){return _0x1c17d2[_0x800d('0x23')](_0xa14a0b)[_0x800d('0x24')](function(_0x20e977){return _0x20e977;});}return null;};}function removeEntity(_0x2d7e1a,_0x3e6409){return function(_0x1cbfe8){if(_0x1cbfe8){return _0x1cbfe8['destroy']()[_0x800d('0x24')](function(){var _0x59cea3=_0x1cbfe8[_0x800d('0x25')]({'plain':!![]});var _0x1fbeac='Companies';return db[_0x800d('0x26')][_0x800d('0x27')]({'where':{'type':_0x1fbeac,'resourceId':_0x59cea3['id']}})[_0x800d('0x24')](function(){return _0x1cbfe8;});})[_0x800d('0x24')](function(){_0x2d7e1a['status'](0xcc)[_0x800d('0x1c')]();});}};}function handleEntityNotFound(_0x52be75,_0x412bbe){return function(_0x225d42){if(!_0x225d42){_0x52be75['sendStatus'](0x194);}return _0x225d42;};}function handleError(_0x16e9ab,_0x41ad9b){_0x41ad9b=_0x41ad9b||0x1f4;return function(_0x548bc4){logger[_0x800d('0x28')](_0x548bc4['stack']);if(_0x548bc4[_0x800d('0x29')]){delete _0x548bc4[_0x800d('0x29')];}_0x16e9ab[_0x800d('0x1b')](_0x41ad9b)[_0x800d('0x2a')](_0x548bc4);};}exports['index']=function(_0x4cda3c,_0x53cd65){var _0x8375ea={},_0x5d7b64={},_0x5a2b79={'count':0x0,'rows':[]};return db['CmCompany'][_0x800d('0x2b')]()[_0x800d('0x24')](function(_0x3fcae9){_0x5d7b64[_0x800d('0x2c')]=_['keys'](_0x3fcae9);_0x5d7b64['query']=_[_0x800d('0x2d')](_0x4cda3c[_0x800d('0x2e')]);_0x5d7b64[_0x800d('0x2f')]=_[_0x800d('0x30')](_0x5d7b64['model'],_0x5d7b64[_0x800d('0x2e')]);_0x8375ea[_0x800d('0x31')]=_['intersection'](_0x5d7b64[_0x800d('0x2c')],qs[_0x800d('0x32')](_0x4cda3c['query'][_0x800d('0x32')]));_0x8375ea[_0x800d('0x31')]=_0x8375ea[_0x800d('0x31')][_0x800d('0x33')]?_0x8375ea[_0x800d('0x31')]:_0x5d7b64['model'];if(!_0x4cda3c[_0x800d('0x2e')][_0x800d('0x34')](_0x800d('0x35'))){_0x8375ea[_0x800d('0x1e')]=qs[_0x800d('0x1e')](_0x4cda3c[_0x800d('0x2e')][_0x800d('0x1e')]);_0x8375ea[_0x800d('0x1d')]=qs[_0x800d('0x1d')](_0x4cda3c[_0x800d('0x2e')][_0x800d('0x1d')]);}_0x8375ea[_0x800d('0x36')]=qs[_0x800d('0x37')](_0x4cda3c[_0x800d('0x2e')][_0x800d('0x37')]);_0x8375ea[_0x800d('0x38')]=qs[_0x800d('0x2f')](_[_0x800d('0x39')](_0x4cda3c[_0x800d('0x2e')],_0x5d7b64[_0x800d('0x2f')]),_0x3fcae9);if(_0x4cda3c['query'][_0x800d('0x3a')]){_0x8375ea[_0x800d('0x38')]=_[_0x800d('0x3b')](_0x8375ea['where'],{'$or':_[_0x800d('0x3c')](_0x8375ea[_0x800d('0x31')],function(_0x44e3){var _0x36cb63={};_0x36cb63[_0x44e3]={'$like':'%'+_0x4cda3c[_0x800d('0x2e')][_0x800d('0x3a')]+'%'};return _0x36cb63;})});}_0x8375ea=_[_0x800d('0x3b')]({},_0x8375ea,_0x4cda3c['options']);var _0x597ee1={'where':_0x8375ea[_0x800d('0x38')]};return db[_0x800d('0x3d')][_0x800d('0x3e')](_0x597ee1)[_0x800d('0x24')](function(_0x2474bf){_0x5a2b79['count']=_0x2474bf;if(_0x4cda3c[_0x800d('0x2e')]['includeAll']){_0x8375ea['include']=[{'all':!![]}];}return db[_0x800d('0x3d')][_0x800d('0x3f')](_0x8375ea);})['then'](function(_0x1d67b2){_0x5a2b79[_0x800d('0x40')]=_0x1d67b2;return _0x5a2b79;})[_0x800d('0x24')](respondWithFilteredResult(_0x53cd65,_0x8375ea))[_0x800d('0x41')](handleError(_0x53cd65,null));})['catch'](handleError(_0x53cd65,null));};exports['show']=function(_0x4ac6f9,_0x2cfe08){var _0x4c19e1={'raw':![],'where':{'id':_0x4ac6f9[_0x800d('0x42')]['id']}},_0x685c00={};_0x685c00[_0x800d('0x2c')]=_[_0x800d('0x2d')](db[_0x800d('0x3d')]['rawAttributes']);_0x685c00[_0x800d('0x2e')]=_[_0x800d('0x2d')](_0x4ac6f9[_0x800d('0x2e')]);_0x685c00[_0x800d('0x2f')]=_[_0x800d('0x30')](_0x685c00['model'],_0x685c00[_0x800d('0x2e')]);_0x4c19e1['attributes']=_[_0x800d('0x30')](_0x685c00[_0x800d('0x2c')],qs[_0x800d('0x32')](_0x4ac6f9[_0x800d('0x2e')][_0x800d('0x32')]));_0x4c19e1[_0x800d('0x31')]=_0x4c19e1[_0x800d('0x31')][_0x800d('0x33')]?_0x4c19e1[_0x800d('0x31')]:_0x685c00[_0x800d('0x2c')];if(_0x4ac6f9[_0x800d('0x2e')][_0x800d('0x43')]){_0x4c19e1['include']=[{'all':!![]}];}_0x4c19e1=_[_0x800d('0x3b')]({},_0x4c19e1,_0x4ac6f9['options']);return db[_0x800d('0x3d')][_0x800d('0x44')](_0x4c19e1)[_0x800d('0x24')](handleEntityNotFound(_0x2cfe08,null))[_0x800d('0x24')](respondWithResult(_0x2cfe08,null))['catch'](handleError(_0x2cfe08,null));};exports[_0x800d('0x45')]=function(_0x5b7a40,_0x398797){return db[_0x800d('0x3d')][_0x800d('0x45')](_0x5b7a40[_0x800d('0x46')],{})[_0x800d('0x24')](function(_0x58fc8d){var _0x486e69=_0x5b7a40[_0x800d('0x47')][_0x800d('0x25')]({'plain':!![]});if(!_0x486e69)throw new Error(_0x800d('0x48'));if(_0x486e69[_0x800d('0x49')]===_0x800d('0x47')){var _0x4a0989=_0x58fc8d[_0x800d('0x25')]({'plain':!![]});var _0x51abfb=_0x800d('0x4a');return db[_0x800d('0x4b')]['find']({'where':{'name':_0x51abfb,'userProfileId':_0x486e69[_0x800d('0x4c')]},'raw':!![]})['then'](function(_0x44e087){if(_0x44e087&&_0x44e087[_0x800d('0x4d')]===0x0){return db[_0x800d('0x26')][_0x800d('0x45')]({'name':_0x4a0989[_0x800d('0x29')],'resourceId':_0x4a0989['id'],'type':_0x44e087['name'],'sectionId':_0x44e087['id']},{})[_0x800d('0x24')](function(){return _0x58fc8d;});}else{return _0x58fc8d;}})[_0x800d('0x41')](function(_0x2922ab){logger[_0x800d('0x28')](_0x800d('0x4e'),_0x2922ab);throw _0x2922ab;});}return _0x58fc8d;})[_0x800d('0x24')](respondWithResult(_0x398797,0xc9))[_0x800d('0x41')](handleError(_0x398797,null));};exports[_0x800d('0x23')]=function(_0x56bbae,_0x1e284f){if(_0x56bbae[_0x800d('0x46')]['id']){delete _0x56bbae[_0x800d('0x46')]['id'];}return db[_0x800d('0x3d')]['find']({'where':{'id':_0x56bbae[_0x800d('0x42')]['id']}})[_0x800d('0x24')](handleEntityNotFound(_0x1e284f,null))[_0x800d('0x24')](saveUpdates(_0x56bbae[_0x800d('0x46')],null))['then'](respondWithResult(_0x1e284f,null))[_0x800d('0x41')](handleError(_0x1e284f,null));};exports[_0x800d('0x27')]=function(_0x328ee8,_0x585906){return db[_0x800d('0x3d')][_0x800d('0x44')]({'where':{'id':_0x328ee8[_0x800d('0x42')]['id']}})[_0x800d('0x24')](handleEntityNotFound(_0x585906,null))['then'](removeEntity(_0x585906,null))[_0x800d('0x41')](handleError(_0x585906,null));};exports['describe']=function(_0xbede76,_0x502f03){return db[_0x800d('0x3d')][_0x800d('0x2b')]()[_0x800d('0x24')](respondWithResult(_0x502f03,null))[_0x800d('0x41')](handleError(_0x502f03,null));};exports[_0x800d('0x4f')]=function(_0x365de6,_0x7be015,_0x31d0ce){return db[_0x800d('0x50')][_0x800d('0x44')]({'where':{'id':_0x365de6[_0x800d('0x42')]['id']}})[_0x800d('0x24')](handleEntityNotFound(_0x7be015,null))[_0x800d('0x24')](function(_0x1af5d4){if(_0x1af5d4){return _0x1af5d4['addContacts'](_0x365de6['body'][_0x800d('0x51')],_[_0x800d('0x52')](_0x365de6[_0x800d('0x46')],[_0x800d('0x51'),'id'])||{});}})[_0x800d('0x24')](respondWithResult(_0x7be015,null))['catch'](handleError(_0x7be015,null));};exports[_0x800d('0x53')]=function(_0x2a8234,_0x1ff104,_0x1cda4c){var _0x16055a={};var _0x37c6d4={};var _0x274582;var _0x146c0f;return db[_0x800d('0x3d')][_0x800d('0x54')]({'where':{'id':_0x2a8234['params']['id']}})['then'](handleEntityNotFound(_0x1ff104,null))[_0x800d('0x24')](function(_0x4256e0){if(_0x4256e0){_0x274582=_0x4256e0;_0x37c6d4[_0x800d('0x2c')]=_[_0x800d('0x2d')](db[_0x800d('0x50')][_0x800d('0x55')]);_0x37c6d4[_0x800d('0x2e')]=_[_0x800d('0x2d')](_0x2a8234[_0x800d('0x2e')]);_0x37c6d4[_0x800d('0x2f')]=_[_0x800d('0x30')](_0x37c6d4['model'],_0x37c6d4[_0x800d('0x2e')]);_0x16055a[_0x800d('0x31')]=_[_0x800d('0x30')](_0x37c6d4['model'],qs[_0x800d('0x32')](_0x2a8234[_0x800d('0x2e')][_0x800d('0x32')]));_0x16055a[_0x800d('0x31')]=_0x16055a['attributes'][_0x800d('0x33')]?_0x16055a[_0x800d('0x31')]:_0x37c6d4[_0x800d('0x2c')];_0x16055a[_0x800d('0x36')]=qs[_0x800d('0x37')](_0x2a8234['query'][_0x800d('0x37')]);_0x16055a[_0x800d('0x38')]=qs[_0x800d('0x2f')](_['pick'](_0x2a8234[_0x800d('0x2e')],_0x37c6d4['filters']));if(_0x2a8234[_0x800d('0x2e')]['filter']){_0x16055a[_0x800d('0x38')]=_['merge'](_0x16055a[_0x800d('0x38')],{'$or':_['map'](_0x16055a[_0x800d('0x31')],function(_0x2c56b5){var _0x4d1233={};_0x4d1233[_0x2c56b5]={'$like':'%'+_0x2a8234['query'][_0x800d('0x3a')]+'%'};return _0x4d1233;})});}_0x16055a=_['merge']({},_0x16055a,_0x2a8234[_0x800d('0x56')]);return _0x274582[_0x800d('0x53')](_0x16055a);}})[_0x800d('0x24')](function(_0x378d29){if(_0x378d29){_0x146c0f=_0x378d29[_0x800d('0x33')];if(!_0x2a8234['query']['hasOwnProperty']('nolimit')){_0x16055a['limit']=qs[_0x800d('0x1e')](_0x2a8234[_0x800d('0x2e')]['limit']);_0x16055a[_0x800d('0x1d')]=qs['offset'](_0x2a8234[_0x800d('0x2e')][_0x800d('0x1d')]);}return _0x274582[_0x800d('0x53')](_0x16055a);}})[_0x800d('0x24')](function(_0x201538){if(_0x201538){return _0x201538?{'count':_0x146c0f,'rows':_0x201538}:null;}})[_0x800d('0x24')](respondWithResult(_0x1ff104,null))[_0x800d('0x41')](handleError(_0x1ff104,null));}; \ No newline at end of file +var _0x5ea6=['Companies','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','map','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','length','include','find','body','user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','CmContact','ids','getContacts','findOne','order','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get'];(function(_0x384f25,_0x8b5503){var _0xce1a43=function(_0x1d21f2){while(--_0x1d21f2){_0x384f25['push'](_0x384f25['shift']());}};_0xce1a43(++_0x8b5503);}(_0x5ea6,0x186));var _0x65ea=function(_0x340756,_0xad31ae){_0x340756=_0x340756-0x0;var _0x2ef745=_0x5ea6[_0x340756];return _0x2ef745;};'use strict';var emlformat=require(_0x65ea('0x0'));var rimraf=require(_0x65ea('0x1'));var zipdir=require(_0x65ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ea('0x3'));var moment=require(_0x65ea('0x4'));var BPromise=require(_0x65ea('0x5'));var Mustache=require('mustache');var util=require(_0x65ea('0x6'));var path=require(_0x65ea('0x7'));var sox=require('sox');var csv=require(_0x65ea('0x8'));var ejs=require(_0x65ea('0x9'));var fs=require('fs');var fs_extra=require(_0x65ea('0xa'));var _=require(_0x65ea('0xb'));var squel=require(_0x65ea('0xc'));var crypto=require(_0x65ea('0xd'));var jsforce=require(_0x65ea('0xe'));var deskjs=require(_0x65ea('0xf'));var toCsv=require(_0x65ea('0x8'));var querystring=require(_0x65ea('0x10'));var Papa=require(_0x65ea('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x65ea('0x12'));var as=require(_0x65ea('0x13'));var hardwareService=require(_0x65ea('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x65ea('0x15'));var config=require(_0x65ea('0x16'));var licenseUtil=require(_0x65ea('0x17'));var db=require(_0x65ea('0x18'))['db'];function respondWithStatusCode(_0x3a763f,_0x4dfd6e){_0x4dfd6e=_0x4dfd6e||0xcc;return function(_0x30cc5b){if(_0x30cc5b){return _0x3a763f[_0x65ea('0x19')](_0x4dfd6e);}return _0x3a763f[_0x65ea('0x1a')](_0x4dfd6e)[_0x65ea('0x1b')]();};}function respondWithResult(_0x4ceaca,_0x459256){_0x459256=_0x459256||0xc8;return function(_0x5e7a77){if(_0x5e7a77){return _0x4ceaca[_0x65ea('0x1a')](_0x459256)[_0x65ea('0x1c')](_0x5e7a77);}};}function respondWithFilteredResult(_0x44f425,_0x2fe6db){return function(_0x56934d){if(_0x56934d){var _0x41dd49=typeof _0x2fe6db[_0x65ea('0x1d')]===_0x65ea('0x1e')&&typeof _0x2fe6db[_0x65ea('0x1f')]===_0x65ea('0x1e');var _0x32ceda=_0x56934d[_0x65ea('0x20')];var _0x1f0b24=_0x41dd49?0x0:_0x2fe6db['offset'];var _0x3c1590=_0x41dd49?_0x56934d[_0x65ea('0x20')]:_0x2fe6db[_0x65ea('0x1d')]+_0x2fe6db['limit'];var _0x4bac9a;if(_0x3c1590>=_0x32ceda){_0x3c1590=_0x32ceda;_0x4bac9a=0xc8;}else{_0x4bac9a=0xce;}_0x44f425[_0x65ea('0x1a')](_0x4bac9a);return _0x44f425[_0x65ea('0x21')](_0x65ea('0x22'),_0x1f0b24+'-'+_0x3c1590+'/'+_0x32ceda)[_0x65ea('0x1c')](_0x56934d);}return null;};}function patchUpdates(_0x3894f9){return function(_0x3370be){try{jsonpatch['apply'](_0x3370be,_0x3894f9,!![]);}catch(_0x34fedb){return BPromise[_0x65ea('0x23')](_0x34fedb);}return _0x3370be[_0x65ea('0x24')]();};}function saveUpdates(_0x382486,_0x37d87c){return function(_0x2b4bea){if(_0x2b4bea){return _0x2b4bea[_0x65ea('0x25')](_0x382486)[_0x65ea('0x26')](function(_0x3b3a50){return _0x3b3a50;});}return null;};}function removeEntity(_0x119885,_0x47ac29){return function(_0x2a699c){if(_0x2a699c){return _0x2a699c['destroy']()[_0x65ea('0x26')](function(){var _0x42fd5b=_0x2a699c[_0x65ea('0x27')]({'plain':!![]});var _0x1ffa9b=_0x65ea('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x1ffa9b,'resourceId':_0x42fd5b['id']}})['then'](function(){return _0x2a699c;});})[_0x65ea('0x26')](function(){_0x119885[_0x65ea('0x1a')](0xcc)[_0x65ea('0x1b')]();});}};}function handleEntityNotFound(_0x37758c,_0x54e75c){return function(_0x3d1457){if(!_0x3d1457){_0x37758c[_0x65ea('0x19')](0x194);}return _0x3d1457;};}function handleError(_0x56d329,_0x490c48){_0x490c48=_0x490c48||0x1f4;return function(_0x5f45f5){logger['error'](_0x5f45f5['stack']);if(_0x5f45f5[_0x65ea('0x29')]){delete _0x5f45f5[_0x65ea('0x29')];}_0x56d329[_0x65ea('0x1a')](_0x490c48)[_0x65ea('0x2a')](_0x5f45f5);};}exports[_0x65ea('0x2b')]=function(_0x222205,_0x35422c){var _0x689f2a={},_0x546dc3={},_0x3c9d9f={'count':0x0,'rows':[]};return db[_0x65ea('0x2c')][_0x65ea('0x2d')]()['then'](function(_0x2e184a){_0x546dc3[_0x65ea('0x2e')]=_[_0x65ea('0x2f')](_0x2e184a);_0x546dc3[_0x65ea('0x30')]=_['keys'](_0x222205[_0x65ea('0x30')]);_0x546dc3[_0x65ea('0x31')]=_['intersection'](_0x546dc3['model'],_0x546dc3['query']);_0x689f2a[_0x65ea('0x32')]=_['intersection'](_0x546dc3[_0x65ea('0x2e')],qs[_0x65ea('0x33')](_0x222205[_0x65ea('0x30')]['fields']));_0x689f2a['attributes']=_0x689f2a['attributes']['length']?_0x689f2a[_0x65ea('0x32')]:_0x546dc3[_0x65ea('0x2e')];if(!_0x222205[_0x65ea('0x30')][_0x65ea('0x34')](_0x65ea('0x35'))){_0x689f2a['limit']=qs[_0x65ea('0x1f')](_0x222205[_0x65ea('0x30')]['limit']);_0x689f2a['offset']=qs[_0x65ea('0x1d')](_0x222205[_0x65ea('0x30')]['offset']);}_0x689f2a['order']=qs[_0x65ea('0x36')](_0x222205['query']['sort']);_0x689f2a['where']=qs[_0x65ea('0x31')](_[_0x65ea('0x37')](_0x222205['query'],_0x546dc3[_0x65ea('0x31')]),_0x2e184a);if(_0x222205[_0x65ea('0x30')][_0x65ea('0x38')]){_0x689f2a[_0x65ea('0x39')]=_['merge'](_0x689f2a[_0x65ea('0x39')],{'$or':_[_0x65ea('0x3a')](_0x689f2a[_0x65ea('0x32')],function(_0x4f84f2){var _0x150a72={};_0x150a72[_0x4f84f2]={'$like':'%'+_0x222205[_0x65ea('0x30')][_0x65ea('0x38')]+'%'};return _0x150a72;})});}_0x689f2a=_[_0x65ea('0x3b')]({},_0x689f2a,_0x222205[_0x65ea('0x3c')]);var _0x2122d4={'where':_0x689f2a[_0x65ea('0x39')]};return db[_0x65ea('0x2c')][_0x65ea('0x20')](_0x2122d4)[_0x65ea('0x26')](function(_0xe11edf){_0x3c9d9f[_0x65ea('0x20')]=_0xe11edf;if(_0x222205[_0x65ea('0x30')][_0x65ea('0x3d')]){_0x689f2a['include']=[{'all':!![]}];}return db['CmCompany'][_0x65ea('0x3e')](_0x689f2a);})[_0x65ea('0x26')](function(_0x2e7c66){_0x3c9d9f[_0x65ea('0x3f')]=_0x2e7c66;return _0x3c9d9f;})['then'](respondWithFilteredResult(_0x35422c,_0x689f2a))['catch'](handleError(_0x35422c,null));})[_0x65ea('0x40')](handleError(_0x35422c,null));};exports['show']=function(_0x434a8c,_0x4a7287){var _0x584d63={'raw':![],'where':{'id':_0x434a8c[_0x65ea('0x41')]['id']}},_0x4c914c={};_0x4c914c[_0x65ea('0x2e')]=_[_0x65ea('0x2f')](db[_0x65ea('0x2c')][_0x65ea('0x42')]);_0x4c914c[_0x65ea('0x30')]=_['keys'](_0x434a8c[_0x65ea('0x30')]);_0x4c914c[_0x65ea('0x31')]=_[_0x65ea('0x43')](_0x4c914c['model'],_0x4c914c[_0x65ea('0x30')]);_0x584d63[_0x65ea('0x32')]=_[_0x65ea('0x43')](_0x4c914c[_0x65ea('0x2e')],qs[_0x65ea('0x33')](_0x434a8c['query']['fields']));_0x584d63[_0x65ea('0x32')]=_0x584d63[_0x65ea('0x32')][_0x65ea('0x44')]?_0x584d63[_0x65ea('0x32')]:_0x4c914c[_0x65ea('0x2e')];if(_0x434a8c[_0x65ea('0x30')][_0x65ea('0x3d')]){_0x584d63[_0x65ea('0x45')]=[{'all':!![]}];}_0x584d63=_[_0x65ea('0x3b')]({},_0x584d63,_0x434a8c[_0x65ea('0x3c')]);return db[_0x65ea('0x2c')][_0x65ea('0x46')](_0x584d63)[_0x65ea('0x26')](handleEntityNotFound(_0x4a7287,null))[_0x65ea('0x26')](respondWithResult(_0x4a7287,null))['catch'](handleError(_0x4a7287,null));};exports['create']=function(_0x25ff89,_0x52e5d3){return db[_0x65ea('0x2c')]['create'](_0x25ff89[_0x65ea('0x47')],{})[_0x65ea('0x26')](function(_0x7646aa){var _0x53d698=_0x25ff89[_0x65ea('0x48')][_0x65ea('0x27')]({'plain':!![]});if(!_0x53d698)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53d698[_0x65ea('0x49')]===_0x65ea('0x48')){var _0x550aef=_0x7646aa[_0x65ea('0x27')]({'plain':!![]});var _0x2b034a=_0x65ea('0x28');return db['UserProfileSection'][_0x65ea('0x46')]({'where':{'name':_0x2b034a,'userProfileId':_0x53d698[_0x65ea('0x4a')]},'raw':!![]})[_0x65ea('0x26')](function(_0x2bc2df){if(_0x2bc2df&&_0x2bc2df[_0x65ea('0x4b')]===0x0){return db[_0x65ea('0x4c')]['create']({'name':_0x550aef['name'],'resourceId':_0x550aef['id'],'type':_0x2bc2df['name'],'sectionId':_0x2bc2df['id']},{})[_0x65ea('0x26')](function(){return _0x7646aa;});}else{return _0x7646aa;}})[_0x65ea('0x40')](function(_0x456749){logger[_0x65ea('0x4d')](_0x65ea('0x4e'),_0x456749);throw _0x456749;});}return _0x7646aa;})[_0x65ea('0x26')](respondWithResult(_0x52e5d3,0xc9))[_0x65ea('0x40')](handleError(_0x52e5d3,null));};exports[_0x65ea('0x25')]=function(_0x181357,_0x11daa0){if(_0x181357[_0x65ea('0x47')]['id']){delete _0x181357[_0x65ea('0x47')]['id'];}return db[_0x65ea('0x2c')][_0x65ea('0x46')]({'where':{'id':_0x181357[_0x65ea('0x41')]['id']}})[_0x65ea('0x26')](handleEntityNotFound(_0x11daa0,null))[_0x65ea('0x26')](saveUpdates(_0x181357[_0x65ea('0x47')],null))['then'](respondWithResult(_0x11daa0,null))[_0x65ea('0x40')](handleError(_0x11daa0,null));};exports[_0x65ea('0x4f')]=function(_0x41c1ac,_0x6a5cb5){return db[_0x65ea('0x2c')][_0x65ea('0x46')]({'where':{'id':_0x41c1ac[_0x65ea('0x41')]['id']}})[_0x65ea('0x26')](handleEntityNotFound(_0x6a5cb5,null))['then'](removeEntity(_0x6a5cb5,null))[_0x65ea('0x40')](handleError(_0x6a5cb5,null));};exports['describe']=function(_0x195523,_0x59fc77){return db['CmCompany'][_0x65ea('0x2d')]()[_0x65ea('0x26')](respondWithResult(_0x59fc77,null))[_0x65ea('0x40')](handleError(_0x59fc77,null));};exports[_0x65ea('0x50')]=function(_0x23eeff,_0x3d5878,_0x362b57){return db[_0x65ea('0x51')][_0x65ea('0x46')]({'where':{'id':_0x23eeff[_0x65ea('0x41')]['id']}})[_0x65ea('0x26')](handleEntityNotFound(_0x3d5878,null))[_0x65ea('0x26')](function(_0x2407d9){if(_0x2407d9){return _0x2407d9[_0x65ea('0x50')](_0x23eeff['body'][_0x65ea('0x52')],_['omit'](_0x23eeff[_0x65ea('0x47')],[_0x65ea('0x52'),'id'])||{});}})[_0x65ea('0x26')](respondWithResult(_0x3d5878,null))[_0x65ea('0x40')](handleError(_0x3d5878,null));};exports[_0x65ea('0x53')]=function(_0x48ca9c,_0x1bda91,_0x19f8b9){var _0x3507ed={};var _0x369e81={};var _0x28632b;var _0x2c12a5;return db[_0x65ea('0x2c')][_0x65ea('0x54')]({'where':{'id':_0x48ca9c['params']['id']}})[_0x65ea('0x26')](handleEntityNotFound(_0x1bda91,null))['then'](function(_0xde4cc5){if(_0xde4cc5){_0x28632b=_0xde4cc5;_0x369e81[_0x65ea('0x2e')]=_[_0x65ea('0x2f')](db[_0x65ea('0x51')][_0x65ea('0x42')]);_0x369e81[_0x65ea('0x30')]=_[_0x65ea('0x2f')](_0x48ca9c[_0x65ea('0x30')]);_0x369e81['filters']=_[_0x65ea('0x43')](_0x369e81['model'],_0x369e81[_0x65ea('0x30')]);_0x3507ed['attributes']=_['intersection'](_0x369e81[_0x65ea('0x2e')],qs['fields'](_0x48ca9c[_0x65ea('0x30')][_0x65ea('0x33')]));_0x3507ed[_0x65ea('0x32')]=_0x3507ed[_0x65ea('0x32')]['length']?_0x3507ed[_0x65ea('0x32')]:_0x369e81[_0x65ea('0x2e')];_0x3507ed[_0x65ea('0x55')]=qs[_0x65ea('0x36')](_0x48ca9c['query'][_0x65ea('0x36')]);_0x3507ed[_0x65ea('0x39')]=qs[_0x65ea('0x31')](_[_0x65ea('0x37')](_0x48ca9c[_0x65ea('0x30')],_0x369e81[_0x65ea('0x31')]));if(_0x48ca9c['query'][_0x65ea('0x38')]){_0x3507ed['where']=_[_0x65ea('0x3b')](_0x3507ed['where'],{'$or':_[_0x65ea('0x3a')](_0x3507ed[_0x65ea('0x32')],function(_0x5644de){var _0x5388d3={};_0x5388d3[_0x5644de]={'$like':'%'+_0x48ca9c[_0x65ea('0x30')]['filter']+'%'};return _0x5388d3;})});}_0x3507ed=_['merge']({},_0x3507ed,_0x48ca9c[_0x65ea('0x3c')]);return _0x28632b[_0x65ea('0x53')](_0x3507ed);}})['then'](function(_0x256fb8){if(_0x256fb8){_0x2c12a5=_0x256fb8[_0x65ea('0x44')];if(!_0x48ca9c['query'][_0x65ea('0x34')](_0x65ea('0x35'))){_0x3507ed[_0x65ea('0x1f')]=qs[_0x65ea('0x1f')](_0x48ca9c[_0x65ea('0x30')]['limit']);_0x3507ed[_0x65ea('0x1d')]=qs[_0x65ea('0x1d')](_0x48ca9c['query']['offset']);}return _0x28632b['getContacts'](_0x3507ed);}})[_0x65ea('0x26')](function(_0x407cb9){if(_0x407cb9){return _0x407cb9?{'count':_0x2c12a5,'rows':_0x407cb9}:null;}})[_0x65ea('0x26')](respondWithResult(_0x1bda91,null))['catch'](handleError(_0x1bda91,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 2ab0042..90290fe 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 _0x201f=['moment','bluebird','request-promise','exports','CmCompany','cm_companies','api'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0x201f,0xd8));var _0xf201=function(_0x418dac,_0x4b4a0d){_0x418dac=_0x418dac-0x0;var _0x36d8ae=_0x201f[_0x418dac];return _0x36d8ae;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf201('0x0'));var moment=require(_0xf201('0x1'));var BPromise=require(_0xf201('0x2'));var rp=require(_0xf201('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0xf201('0x4')]=function(_0x369791,_0x61b502){return _0x369791['define'](_0xf201('0x5'),attributes,{'tableName':_0xf201('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf987=['cm_companies','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x1841af,_0x4f0e45){var _0x447f50=function(_0x1c010d){while(--_0x1c010d){_0x1841af['push'](_0x1841af['shift']());}};_0x447f50(++_0x4f0e45);}(_0xf987,0xcd));var _0x7f98=function(_0x3e2476,_0x5b17f6){_0x3e2476=_0x3e2476-0x0;var _0x239294=_0xf987[_0x3e2476];return _0x239294;};'use strict';var _=require('lodash');var util=require(_0x7f98('0x0'));var logger=require('../../config/logger')(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x36ed90,_0x5bedd8){return _0x36ed90[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 2db10ec..70ed2f6 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 _0x97df=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird'];(function(_0x38030c,_0x361045){var _0x3e64fa=function(_0x4ebc3d){while(--_0x4ebc3d){_0x38030c['push'](_0x38030c['shift']());}};_0x3e64fa(++_0x361045);}(_0x97df,0xb2));var _0xf97d=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x97df[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0xf97d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf97d('0x1'));var rs=require(_0xf97d('0x2'));var fs=require('fs');var Redis=require(_0xf97d('0x3'));var db=require(_0xf97d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf97d('0x5'))('rpc');var config=require(_0xf97d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf97d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x951e32,_0x10fd03,_0x36e8d2){return new BPromise(function(_0x26f0a0,_0x210848){return client['request'](_0x951e32,_0x36e8d2)[_0xf97d('0x8')](function(_0xa30d05){logger[_0xf97d('0x9')](_0xf97d('0xa'),_0x10fd03,_0xf97d('0xb'));logger[_0xf97d('0xc')](_0xf97d('0xd'),_0x10fd03,_0xf97d('0xb'),JSON[_0xf97d('0xe')](_0xa30d05));if(_0xa30d05['error']){if(_0xa30d05[_0xf97d('0xf')][_0xf97d('0x10')]===0x1f4){logger[_0xf97d('0xf')](_0xf97d('0xa'),_0x10fd03,_0xa30d05[_0xf97d('0xf')][_0xf97d('0x11')]);return _0x210848(_0xa30d05[_0xf97d('0xf')][_0xf97d('0x11')]);}logger[_0xf97d('0xf')]('CmCompany,\x20%s,\x20%s',_0x10fd03,_0xa30d05[_0xf97d('0xf')][_0xf97d('0x11')]);return _0x26f0a0(_0xa30d05[_0xf97d('0xf')]['message']);}else{logger[_0xf97d('0x9')]('CmCompany,\x20%s,\x20%s',_0x10fd03,_0xf97d('0xb'));_0x26f0a0(_0xa30d05[_0xf97d('0x12')][_0xf97d('0x11')]);}})[_0xf97d('0x13')](function(_0xf26c82){logger[_0xf97d('0xf')](_0xf97d('0xa'),_0x10fd03,_0xf26c82);_0x210848(_0xf26c82);});});} \ No newline at end of file +var _0x50b6=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x339a74,_0xa34128){var _0x485218=function(_0x1eab6d){while(--_0x1eab6d){_0x339a74['push'](_0x339a74['shift']());}};_0x485218(++_0xa34128);}(_0x50b6,0xbf));var _0x650b=function(_0x53ed46,_0x5f0f0d){_0x53ed46=_0x53ed46-0x0;var _0x38d4c4=_0x50b6[_0x53ed46];return _0x38d4c4;};'use strict';var _=require(_0x650b('0x0'));var util=require(_0x650b('0x1'));var moment=require(_0x650b('0x2'));var BPromise=require(_0x650b('0x3'));var rs=require(_0x650b('0x4'));var fs=require('fs');var Redis=require(_0x650b('0x5'));var db=require(_0x650b('0x6'))['db'];var utils=require(_0x650b('0x7'));var logger=require(_0x650b('0x8'))(_0x650b('0x9'));var config=require(_0x650b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x650b('0xb')][_0x650b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ec4ba,_0x45095c,_0x1f5495){return new BPromise(function(_0x46ea93,_0x209947){return client['request'](_0x4ec4ba,_0x1f5495)['then'](function(_0x28fc4d){logger['info']('CmCompany,\x20%s,\x20%s',_0x45095c,_0x650b('0xd'));logger['debug'](_0x650b('0xe'),_0x45095c,_0x650b('0xd'),JSON[_0x650b('0xf')](_0x28fc4d));if(_0x28fc4d[_0x650b('0x10')]){if(_0x28fc4d[_0x650b('0x10')]['code']===0x1f4){logger[_0x650b('0x10')]('CmCompany,\x20%s,\x20%s',_0x45095c,_0x28fc4d[_0x650b('0x10')][_0x650b('0x11')]);return _0x209947(_0x28fc4d[_0x650b('0x10')]['message']);}logger[_0x650b('0x10')]('CmCompany,\x20%s,\x20%s',_0x45095c,_0x28fc4d[_0x650b('0x10')][_0x650b('0x11')]);return _0x46ea93(_0x28fc4d[_0x650b('0x10')][_0x650b('0x11')]);}else{logger[_0x650b('0x12')](_0x650b('0x13'),_0x45095c,_0x650b('0xd'));_0x46ea93(_0x28fc4d[_0x650b('0x14')][_0x650b('0x11')]);}})[_0x650b('0x15')](function(_0xe9e35e){logger[_0x650b('0x10')](_0x650b('0x13'),_0x45095c,_0xe9e35e);_0x209947(_0xe9e35e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 16ca348..7bedaed 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 _0xacc6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xacc6,0x66));var _0x6acc=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0xacc6[_0x2984d0];return _0x2885f2;};'use strict';var multer=require(_0x6acc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6acc('0x1'));var express=require('express');var router=express[_0x6acc('0x2')]();var fs_extra=require(_0x6acc('0x3'));var auth=require(_0x6acc('0x4'));var interaction=require(_0x6acc('0x5'));var config=require(_0x6acc('0x6'));var controller=require('./cmCompany.controller');router[_0x6acc('0x7')]('/',auth['isAuthenticated'](),controller[_0x6acc('0x8')]);router['get'](_0x6acc('0x9'),auth[_0x6acc('0xa')](),controller[_0x6acc('0xb')]);router[_0x6acc('0x7')](_0x6acc('0xc'),auth['isAuthenticated'](),controller[_0x6acc('0xd')]);router[_0x6acc('0x7')]('/:id/contacts',auth[_0x6acc('0xa')](),controller[_0x6acc('0xe')]);router[_0x6acc('0xf')]('/',auth[_0x6acc('0xa')](),controller['create']);router[_0x6acc('0xf')](_0x6acc('0x10'),auth[_0x6acc('0xa')](),controller[_0x6acc('0x11')]);router['put'](_0x6acc('0xc'),auth[_0x6acc('0xa')](),controller['update']);router[_0x6acc('0x12')]('/:id',auth[_0x6acc('0xa')](),controller[_0x6acc('0x13')]);module[_0x6acc('0x14')]=router; \ No newline at end of file +var _0x4656=['destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/contacts','post','create','addContacts','update','delete'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4656,0x110));var _0x6465=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x4656[_0x671369];return _0x33f2b4;};'use strict';var multer=require('multer');var util=require(_0x6465('0x0'));var path=require('path');var timeout=require(_0x6465('0x1'));var express=require(_0x6465('0x2'));var router=express[_0x6465('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6465('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x6465('0x5')]('/',auth[_0x6465('0x6')](),controller[_0x6465('0x7')]);router['get']('/describe',auth[_0x6465('0x6')](),controller['describe']);router[_0x6465('0x5')](_0x6465('0x8'),auth[_0x6465('0x6')](),controller[_0x6465('0x9')]);router[_0x6465('0x5')](_0x6465('0xa'),auth['isAuthenticated'](),controller['getContacts']);router[_0x6465('0xb')]('/',auth['isAuthenticated'](),controller[_0x6465('0xc')]);router[_0x6465('0xb')]('/:id/contacts',auth[_0x6465('0x6')](),controller[_0x6465('0xd')]);router['put'](_0x6465('0x8'),auth[_0x6465('0x6')](),controller[_0x6465('0xe')]);router[_0x6465('0xf')](_0x6465('0x8'),auth[_0x6465('0x6')](),controller[_0x6465('0x10')]);module[_0x6465('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 2dbf7c2..a4a739b 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 _0xb626=['sequelize','STRING','TEXT','INTEGER','DATE','lodash'];(function(_0x368dd9,_0x527c6b){var _0x203391=function(_0xaa70b8){while(--_0xaa70b8){_0x368dd9['push'](_0x368dd9['shift']());}};_0x203391(++_0x527c6b);}(_0xb626,0xcb));var _0x6b62=function(_0x283de3,_0x24039c){_0x283de3=_0x283de3-0x0;var _0x29d4ec=_0xb626[_0x283de3];return _0x29d4ec;};'use strict';var _=require(_0x6b62('0x0'));var Sequelize=require(_0x6b62('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x6b62('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6b62('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x6b62('0x2')]},'city':{'type':Sequelize[_0x6b62('0x2')]},'country':{'type':Sequelize[_0x6b62('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6b62('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x6b62('0x2')]},'facebook':{'type':Sequelize[_0x6b62('0x2')]},'fb_data':{'type':Sequelize[_0x6b62('0x2')]},'twitter':{'type':Sequelize[_0x6b62('0x2')]},'skype':{'type':Sequelize[_0x6b62('0x2')]},'teams':{'type':Sequelize[_0x6b62('0x2')]},'viber':{'type':Sequelize[_0x6b62('0x2')]},'line':{'type':Sequelize[_0x6b62('0x2')]},'wechat':{'type':Sequelize[_0x6b62('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x6b62('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x6b62('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6b62('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x6b62('0x2')]},'utcOffset':{'type':Sequelize[_0x6b62('0x4')]}}; \ No newline at end of file +var _0x7473=['DATE','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x23faeb,_0x449c37){var _0x172958=function(_0x3a1f95){while(--_0x3a1f95){_0x23faeb['push'](_0x23faeb['shift']());}};_0x172958(++_0x449c37);}(_0x7473,0xef));var _0x3747=function(_0x291028,_0x32e3e7){_0x291028=_0x291028-0x0;var _0x33c650=_0x7473[_0x291028];return _0x33c650;};'use strict';var _=require(_0x3747('0x0'));var Sequelize=require(_0x3747('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x3747('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3747('0x2')]},'street':{'type':Sequelize[_0x3747('0x2')]},'postalCode':{'type':Sequelize[_0x3747('0x2')]},'city':{'type':Sequelize[_0x3747('0x2')]},'country':{'type':Sequelize[_0x3747('0x2')]},'dateOfBirth':{'type':Sequelize[_0x3747('0x2')]},'description':{'type':Sequelize[_0x3747('0x3')]},'phone':{'type':Sequelize[_0x3747('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3747('0x2')]},'email':{'type':Sequelize[_0x3747('0x2')]},'url':{'type':Sequelize[_0x3747('0x2')]},'facebook':{'type':Sequelize[_0x3747('0x2')]},'fb_data':{'type':Sequelize[_0x3747('0x2')]},'twitter':{'type':Sequelize[_0x3747('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x3747('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x3747('0x2')]},'wechat':{'type':Sequelize[_0x3747('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x3747('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x3747('0x2')]},'priority':{'type':Sequelize[_0x3747('0x4')](0x2)[_0x3747('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3747('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x3747('0x2')]},'utcOffset':{'type':Sequelize[_0x3747('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 8b01da8..1ad952a 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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 45973f0..d01ef8e 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 _0x1c32=['save','update','emit','exports','events','CmContact','setMaxListeners'];(function(_0x558546,_0x5d43a7){var _0x5d416d=function(_0xfc3de){while(--_0xfc3de){_0x558546['push'](_0x558546['shift']());}};_0x5d416d(++_0x5d43a7);}(_0x1c32,0xc8));var _0x21c3=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x1c32[_0x40dd56];return _0x4f850f;};'use strict';var EventEmitter=require(_0x21c3('0x0'));var CmContact=require('../../mysqldb')['db'][_0x21c3('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x21c3('0x2')](0x0);var events={'afterCreate':_0x21c3('0x3'),'afterUpdate':_0x21c3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5dc3db){return function(_0x48f077,_0x568983,_0x4c63a9){CmContactEvents[_0x21c3('0x5')](_0x5dc3db+':'+_0x48f077['id'],_0x48f077);CmContactEvents[_0x21c3('0x5')](_0x5dc3db,_0x48f077);_0x4c63a9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x21c3('0x6')]=CmContactEvents; \ No newline at end of file +var _0xb754=['emit','hasOwnProperty','exports','events','CmContact','setMaxListeners','remove'];(function(_0x17d45b,_0x41abad){var _0x2755ca=function(_0x45879d){while(--_0x45879d){_0x17d45b['push'](_0x17d45b['shift']());}};_0x2755ca(++_0x41abad);}(_0xb754,0x130));var _0x4b75=function(_0x606fe8,_0x10b084){_0x606fe8=_0x606fe8-0x0;var _0x28b517=_0xb754[_0x606fe8];return _0x28b517;};'use strict';var EventEmitter=require(_0x4b75('0x0'));var CmContact=require('../../mysqldb')['db'][_0x4b75('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x4b75('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4b75('0x3')};function emitEvent(_0x474606){return function(_0x15ef52,_0x473c66,_0x41f9d6){CmContactEvents[_0x4b75('0x4')](_0x474606+':'+_0x15ef52['id'],_0x15ef52);CmContactEvents[_0x4b75('0x4')](_0x474606,_0x15ef52);_0x41f9d6(null);};}for(var e in events){if(events[_0x4b75('0x5')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x4b75('0x6')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 96a3c66..1890997 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 _0x41d8=['scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','utcOffset','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','CmList','Lists','dialCheckDuplicateType','always','onlyIfOpen','BlackLists','length','get','CmHopperBlack','cmContact,\x20%s,\x20%s','message','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect'];(function(_0x385c76,_0xb97335){var _0x5c8367=function(_0xdfcd3){while(--_0xdfcd3){_0x385c76['push'](_0x385c76['shift']());}};_0x5c8367(++_0xb97335);}(_0x41d8,0x106));var _0x841d=function(_0x7e8ffb,_0x272fcc){_0x7e8ffb=_0x7e8ffb-0x0;var _0x1756f6=_0x41d8[_0x7e8ffb];return _0x1756f6;};'use strict';var _=require(_0x841d('0x0'));var util=require('util');var logger=require(_0x841d('0x1'))(_0x841d('0x2'));var moment=require(_0x841d('0x3'));var BPromise=require(_0x841d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x841d('0x5'));var rimraf=require(_0x841d('0x6'));var config=require(_0x841d('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0x841d('0x8'));module[_0x841d('0x9')]=function(_0x30ef3b,_0xe7f205){return _0x30ef3b[_0x841d('0xa')]('CmContact',attributes,{'tableName':_0x841d('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x841d('0xc')]},{'name':_0x841d('0xd'),'fields':[_0x841d('0xe'),'lastName',_0x841d('0xc'),_0x841d('0xf'),_0x841d('0x10'),_0x841d('0x11')],'type':_0x841d('0x12')}],'timestamps':!![],'charset':_0x841d('0x13'),'collate':_0x841d('0x14'),'hooks':{'afterCreate':function(_0x59211b,_0x3442a0,_0x237b33){var _0x5e8b46=_0x30ef3b[_0x841d('0x15')];var _0x9310f6=_0x59211b['get']({'plain':!![]});function _0x1dbc71(){return function(_0x35d874){logger[_0x841d('0x16')](_0x841d('0x17'),_0x841d('0x18'),util[_0x841d('0x19')](_0x35d874,{'showHidden':![],'depth':null}));};}function _0x22cbb1(_0x2c0ed5,_0x5d91fd){var _0x46c2e6=_0x5d91fd[_0x841d('0x1a')]?_0x5d91fd[_0x841d('0x1a')]:moment()[_0x841d('0x1b')](_0x841d('0x1c'));return new BPromise(function(_0x256cea,_0x4d8b1b){if(_[_0x841d('0x1d')](_0x5d91fd[_0x841d('0x1e')])){_0x256cea({'ret':_0x46c2e6});}else{_0x5e8b46[_0x841d('0x1f')][_0x841d('0x20')]({'where':{'id':_0x2c0ed5['id']}})[_0x841d('0x21')](function(_0x5b593b){if(!_[_0x841d('0x1d')](_0x5b593b)){var _0xe18cb1=_0x5b593b[_0x841d('0x1e')];if(!_[_0x841d('0x1d')](_0xe18cb1)){var _0x154cd4=shared[_0x841d('0x22')];var _0x355ccb=_0x154cd4[_0xe18cb1];var _0x2bc54a=_0x154cd4[_0x5d91fd['dialTimezone']];if(!_[_0x841d('0x1d')](_0x355ccb)&&!_['isNil'](_0x2bc54a)){var _0x57a7b1=_0x355ccb['utcOffset']-_0x2bc54a['utcOffset'];_0x46c2e6=_0x5d91fd[_0x841d('0x1a')]?_0x5d91fd[_0x841d('0x1a')]:moment();var _0x3c8dbb=moment(_0x46c2e6)[_0x841d('0x23')](_0x57a7b1,_0x841d('0x24'));_0x256cea({'ret':_0x3c8dbb[_0x841d('0x1b')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x256cea({'ret':_0x46c2e6});}else _0x256cea({'ret':_0x46c2e6});}else{_0x256cea({'ret':_0x46c2e6});}});}});return 0xa;}var _0x3b5f13=function(_0x541803){return new BPromise(function(_0x100ddb,_0x51faf9){_0x22cbb1(_0x541803,_0x9310f6)[_0x841d('0x21')](function(_0x60a1c0){_0x9310f6[_0x841d('0x1a')]=_0x60a1c0[_0x841d('0x25')];_0x5e8b46[_0x841d('0x26')][_0x841d('0x20')]({'where':{'phone':_0x9310f6[_0x841d('0xc')],'VoiceQueueId':_0x541803['id']}})[_0x841d('0x21')](function(_0x1399ef){if(!_[_0x841d('0x1d')](_0x1399ef)){throw new Error(_0x841d('0x27')+_0x9310f6['phone']+_0x841d('0x28')+_0x541803['id']);}return _0x5e8b46[_0x841d('0x26')][_0x841d('0x29')]({'phone':_0x9310f6[_0x841d('0xc')],'ContactId':_0x9310f6['id'],'ListId':_0x9310f6[_0x841d('0x2a')],'priority':_0x9310f6[_0x841d('0x2b')]?_0x9310f6[_0x841d('0x2b')]:0x2,'scheduledat':_0x9310f6[_0x841d('0x1a')]?_0x9310f6[_0x841d('0x1a')]:moment()[_0x841d('0x1b')](_0x841d('0x1c')),'callback':_0x9310f6[_0x841d('0x2c')]?!![]:![],'callbackuniqueid':_0x9310f6[_0x841d('0x2c')]?_0x9310f6['callbackUniqueid']:undefined,'callbackat':_0x9310f6[_0x841d('0x2c')]?moment()[_0x841d('0x1b')](_0x841d('0x1c')):undefined,'VoiceQueueId':_0x541803['id']});})[_0x841d('0x2d')](function(_0xbfec44){_0x51faf9(_0xbfec44);});});});};var _0x290eaf=function(_0x47c0e0){return new BPromise(function(_0x152ffb,_0x1ea2e7){_0x22cbb1(_0x47c0e0,_0x9310f6)['then'](function(_0x5230f9){_0x9310f6['scheduledat']=_0x5230f9[_0x841d('0x25')];_0x5e8b46[_0x841d('0x26')][_0x841d('0x20')]({'where':{'phone':_0x9310f6[_0x841d('0xc')],'VoiceQueueId':_0x47c0e0['id']}})[_0x841d('0x21')](function(_0x2e3b7a){if(!_[_0x841d('0x1d')](_0x2e3b7a)){throw new Error(_0x841d('0x27')+_0x9310f6['phone']+_0x841d('0x2e')+_0x47c0e0['id']);}return _0x5e8b46[_0x841d('0x2f')][_0x841d('0x20')]({'where':{'calleridnum':_0x9310f6[_0x841d('0xc')],'VoiceQueueId':_0x47c0e0['id']}});})[_0x841d('0x21')](function(_0x15197d){if(!_[_0x841d('0x1d')](_0x15197d)){throw new Error(_0x841d('0x30')+_0x9310f6[_0x841d('0xc')]+_0x841d('0x31')+_0x47c0e0['id']);}return _0x5e8b46[_0x841d('0x26')][_0x841d('0x29')]({'phone':_0x9310f6[_0x841d('0xc')],'ContactId':_0x9310f6['id'],'ListId':_0x9310f6[_0x841d('0x2a')],'priority':_0x9310f6[_0x841d('0x2b')]?_0x9310f6[_0x841d('0x2b')]:0x2,'scheduledat':_0x9310f6[_0x841d('0x1a')]?_0x9310f6['scheduledat']:moment()[_0x841d('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9310f6[_0x841d('0x2c')]?!![]:![],'callbackuniqueid':_0x9310f6[_0x841d('0x2c')]?_0x9310f6[_0x841d('0x2c')]:undefined,'callbackat':_0x9310f6['callbackUniqueid']?moment()[_0x841d('0x1b')](_0x841d('0x1c')):undefined,'VoiceQueueId':_0x47c0e0['id']});})[_0x841d('0x2d')](function(_0x58a1f3){_0x1ea2e7(_0x58a1f3);});});});};function _0x24ee1c(){return function(_0x8465ef){logger[_0x841d('0x16')]('cmContact',_0x841d('0x18'),util[_0x841d('0x19')](_0x8465ef,{'showHidden':![],'depth':null}));};}function _0x55d85e(_0x3df1d4,_0x180757){var _0x3fe045=_0x180757['scheduledat']?_0x180757[_0x841d('0x1a')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x3c03bb,_0x3eb26d){if(_[_0x841d('0x1d')](_0x180757[_0x841d('0x1e')])){_0x3c03bb({'ret':_0x3fe045});}else{_0x5e8b46[_0x841d('0x32')][_0x841d('0x20')]({'where':{'id':_0x3df1d4['id']}})[_0x841d('0x21')](function(_0x193e13){if(!_[_0x841d('0x1d')](_0x193e13)){var _0x3fa77a=_0x193e13[_0x841d('0x1e')];if(!_[_0x841d('0x1d')](_0x3fa77a)){var _0x54454b=shared[_0x841d('0x22')];var _0x20c76d=_0x54454b[_0x3fa77a];var _0x32b6d9=_0x54454b[_0x180757[_0x841d('0x1e')]];if(!_[_0x841d('0x1d')](_0x20c76d)&&!_['isNil'](_0x32b6d9)){var _0x4f0fe3=_0x20c76d[_0x841d('0x33')]-_0x32b6d9[_0x841d('0x33')];_0x3fe045=_0x180757[_0x841d('0x1a')]?_0x180757['scheduledat']:moment();var _0x20ad8e=moment(_0x3fe045)[_0x841d('0x23')](_0x4f0fe3,_0x841d('0x24'));_0x3c03bb({'ret':_0x20ad8e[_0x841d('0x1b')](_0x841d('0x1c'))});}else _0x3c03bb({'ret':_0x3fe045});}else _0x3c03bb({'ret':_0x3fe045});}else{_0x3c03bb({'ret':_0x3fe045});}});}});return 0xa;}var _0x153cd3=function(_0x17ce95){return new BPromise(function(_0x28be0e,_0x442863){_0x55d85e(_0x17ce95,_0x9310f6)[_0x841d('0x21')](function(_0x4322db){_0x9310f6['scheduledat']=_0x4322db[_0x841d('0x25')];_0x5e8b46[_0x841d('0x26')][_0x841d('0x20')]({'where':{'phone':_0x9310f6[_0x841d('0xc')],'CampaignId':_0x17ce95['id']}})['then'](function(_0x3d8a09){if(!_['isNil'](_0x3d8a09)){throw new Error(_0x841d('0x27')+_0x9310f6[_0x841d('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x17ce95['id']);}return _0x5e8b46[_0x841d('0x26')][_0x841d('0x29')]({'phone':_0x9310f6[_0x841d('0xc')],'ContactId':_0x9310f6['id'],'ListId':_0x9310f6[_0x841d('0x2a')],'priority':_0x9310f6[_0x841d('0x2b')]?_0x9310f6['priority']:0x2,'scheduledat':_0x9310f6[_0x841d('0x1a')]?_0x9310f6[_0x841d('0x1a')]:moment()[_0x841d('0x1b')](_0x841d('0x1c')),'callback':_0x9310f6[_0x841d('0x2c')]?!![]:![],'callbackuniqueid':_0x9310f6[_0x841d('0x2c')]?_0x9310f6[_0x841d('0x2c')]:undefined,'callbackat':_0x9310f6['callbackUniqueid']?moment()['format'](_0x841d('0x1c')):undefined,'CampaignId':_0x17ce95['id']});})[_0x841d('0x2d')](function(_0x2a4202){_0x442863(_0x2a4202);});});});};var _0x57b691=function(_0x50281a){return new BPromise(function(_0x185355,_0x457ab5){_0x55d85e(_0x50281a,_0x9310f6)['then'](function(_0x240ad3){_0x9310f6['scheduledat']=_0x240ad3['ret'];_0x5e8b46[_0x841d('0x26')][_0x841d('0x20')]({'where':{'phone':_0x9310f6[_0x841d('0xc')],'CampaignId':_0x50281a['id']}})[_0x841d('0x21')](function(_0x3ff24a){if(!_[_0x841d('0x1d')](_0x3ff24a)){throw new Error(_0x841d('0x27')+_0x9310f6[_0x841d('0xc')]+_0x841d('0x34')+_0x50281a['id']);}return _0x5e8b46[_0x841d('0x2f')][_0x841d('0x20')]({'where':{'calleridnum':_0x9310f6[_0x841d('0xc')],'CampaignId':_0x50281a['id']}});})['then'](function(_0x5a66da){if(!_[_0x841d('0x1d')](_0x5a66da)){throw new Error(_0x841d('0x30')+_0x9310f6[_0x841d('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x50281a['id']);}return _0x5e8b46[_0x841d('0x26')][_0x841d('0x29')]({'phone':_0x9310f6[_0x841d('0xc')],'ContactId':_0x9310f6['id'],'ListId':_0x9310f6['ListId'],'priority':_0x9310f6['priority']?_0x9310f6['priority']:0x2,'scheduledat':_0x9310f6['scheduledat']?_0x9310f6['scheduledat']:moment()[_0x841d('0x1b')](_0x841d('0x1c')),'callback':_0x9310f6[_0x841d('0x2c')]?!![]:![],'callbackuniqueid':_0x9310f6[_0x841d('0x2c')]?_0x9310f6[_0x841d('0x2c')]:undefined,'callbackat':_0x9310f6[_0x841d('0x2c')]?moment()[_0x841d('0x1b')](_0x841d('0x1c')):undefined,'CampaignId':_0x50281a['id']});})[_0x841d('0x2d')](function(_0xa5c279){_0x457ab5(_0xa5c279);});});});};if(_0x9310f6[_0x841d('0x2a')]){_0x5e8b46[_0x841d('0x1f')][_0x841d('0x35')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0x841d('0x1e')],'include':[{'model':_0x5e8b46[_0x841d('0x36')],'as':_0x841d('0x37'),'where':{'id':_0x9310f6[_0x841d('0x2a')]}}]})['then'](function(_0x26beb6){if(_0x26beb6){var _0x580722=[];for(var _0x8b5cf4=0x0,_0x31d50b;_0x8b5cf4<_0x26beb6['length'];_0x8b5cf4+=0x1){_0x31d50b=_0x26beb6[_0x8b5cf4]['get']({'plain':!![]});switch(_0x31d50b[_0x841d('0x38')]){case _0x841d('0x39'):_0x290eaf(_0x31d50b)[_0x841d('0x2d')](_0x1dbc71());break;case _0x841d('0x3a'):_0x3b5f13(_0x31d50b)[_0x841d('0x2d')](_0x1dbc71());break;default:_0x55d85e(_0x31d50b,_0x9310f6)['then'](function(_0x516573){_0x9310f6[_0x841d('0x1a')]=_0x516573['ret'];_0x5e8b46['CmHopper'][_0x841d('0x29')]({'phone':_0x9310f6[_0x841d('0xc')],'ContactId':_0x9310f6['id'],'ListId':_0x9310f6[_0x841d('0x2a')],'scheduledat':_0x9310f6[_0x841d('0x1a')]?_0x9310f6['scheduledat']:moment()[_0x841d('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x9310f6[_0x841d('0x2b')]?_0x9310f6[_0x841d('0x2b')]:0x2,'callback':_0x9310f6[_0x841d('0x2c')]?!![]:![],'callbackuniqueid':_0x9310f6[_0x841d('0x2c')]?_0x9310f6[_0x841d('0x2c')]:undefined,'callbackat':_0x9310f6['callbackUniqueid']?moment()[_0x841d('0x1b')](_0x841d('0x1c')):undefined,'VoiceQueueId':_0x31d50b['id']})[_0x841d('0x2d')](_0x1dbc71());});}}}})['then'](function(){return _0x5e8b46[_0x841d('0x1f')][_0x841d('0x35')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x5e8b46[_0x841d('0x36')],'as':_0x841d('0x3b'),'where':{'id':_0x9310f6[_0x841d('0x2a')]}}]})[_0x841d('0x21')](function(_0x55754c){if(_0x55754c){var _0x62200a=[];for(var _0x22a518=0x0,_0x519620;_0x22a518<_0x55754c[_0x841d('0x3c')];_0x22a518+=0x1){_0x519620=_0x55754c[_0x22a518][_0x841d('0x3d')]({'plain':!![]});_0x5e8b46[_0x841d('0x3e')][_0x841d('0x29')]({'phone':_0x9310f6['phone'],'ContactId':_0x9310f6['id'],'ListId':_0x9310f6['ListId'],'VoiceQueueId':_0x519620['id']})[_0x841d('0x2d')](function(_0x4ae81b){logger[_0x841d('0x16')](_0x841d('0x3f'),_0x841d('0x18'),_0x4ae81b[_0x841d('0x40')]);});}}});})['then'](function(){return _0x5e8b46['Campaign'][_0x841d('0x35')]({'attributes':['id','dialCheckDuplicateType',_0x841d('0x1e')],'include':[{'model':_0x5e8b46['CmList'],'as':_0x841d('0x37'),'where':{'id':_0x9310f6[_0x841d('0x2a')]}}]})[_0x841d('0x21')](function(_0x465428){if(_0x465428){var _0x457cf0=[];for(var _0x354e6a=0x0,_0x4b6a3e;_0x354e6a<_0x465428[_0x841d('0x3c')];_0x354e6a+=0x1){_0x4b6a3e=_0x465428[_0x354e6a]['get']({'plain':!![]});switch(_0x4b6a3e['dialCheckDuplicateType']){case _0x841d('0x39'):_0x57b691(_0x4b6a3e)[_0x841d('0x2d')](_0x24ee1c());break;case _0x841d('0x3a'):_0x153cd3(_0x4b6a3e)[_0x841d('0x2d')](_0x24ee1c());break;default:_0x5e8b46[_0x841d('0x26')][_0x841d('0x29')]({'phone':_0x9310f6[_0x841d('0xc')],'ContactId':_0x9310f6['id'],'ListId':_0x9310f6[_0x841d('0x2a')],'scheduledat':_0x9310f6['scheduledat']?_0x9310f6[_0x841d('0x1a')]:moment()[_0x841d('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x9310f6[_0x841d('0x2b')]?_0x9310f6[_0x841d('0x2b')]:0x2,'callback':_0x9310f6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x9310f6[_0x841d('0x2c')]?_0x9310f6[_0x841d('0x2c')]:undefined,'callbackat':_0x9310f6[_0x841d('0x2c')]?moment()[_0x841d('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4b6a3e['id']})[_0x841d('0x2d')](_0x24ee1c());}}}});})['then'](function(){return _0x5e8b46[_0x841d('0x32')][_0x841d('0x35')]({'attributes':['id'],'include':[{'model':_0x5e8b46['CmList'],'as':_0x841d('0x3b'),'where':{'id':_0x9310f6[_0x841d('0x2a')]}}]})[_0x841d('0x21')](function(_0x144f3f){if(_0x144f3f){var _0x5e6e92=[];for(var _0x1537d4=0x0,_0x2ff8c3;_0x1537d4<_0x144f3f['length'];_0x1537d4+=0x1){_0x2ff8c3=_0x144f3f[_0x1537d4]['get']({'plain':!![]});_0x5e8b46['CmHopperBlack'][_0x841d('0x29')]({'phone':_0x9310f6['phone'],'ContactId':_0x9310f6['id'],'ListId':_0x9310f6['ListId'],'CampaignId':_0x2ff8c3['id']})[_0x841d('0x2d')](function(_0x365fe1){logger[_0x841d('0x16')](_0x841d('0x3f'),_0x841d('0x18'),_0x365fe1[_0x841d('0x40')]);});}}});})[_0x841d('0x21')](function(){_0x237b33();})[_0x841d('0x2d')](function(_0x41e892){logger[_0x841d('0x16')]('cmContact,\x20%s,\x20%s',_0x841d('0x18'),_0x41e892[_0x841d('0x40')]);_0x237b33(_0x41e892);});}else{_0x237b33(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x129cb3,_0x1ec15e,_0x4dda4c){var _0x209754=_0x30ef3b['models'];var _0x20a854=_0x129cb3[_0x841d('0x3d')]({'plain':!![]});return _0x209754[_0x841d('0x26')][_0x841d('0x35')]({'raw':!![],'where':{'ListId':_0x20a854['ListId'],'ContactId':_0x20a854['id']}})[_0x841d('0x21')](function(_0x567fd2){if(!_['isEmpty'](_0x567fd2)){var _0x2b2733=[];for(var _0x1d69d3=0x0;_0x1d69d3<_0x567fd2[_0x841d('0x3c')];_0x1d69d3+=0x1){var _0x4aff3c=_0x209754[_0x841d('0x26')]['destroy']({'where':{'ListId':_0x567fd2[_0x1d69d3]['ListId'],'ContactId':_0x567fd2[_0x1d69d3][_0x841d('0x41')],'VoiceQueueId':_0x567fd2[_0x1d69d3][_0x841d('0x42')],'CampaignId':_0x567fd2[_0x1d69d3][_0x841d('0x43')]}});_0x2b2733[_0x841d('0x44')](_0x4aff3c);}return BPromise[_0x841d('0x45')](_0x2b2733);}})[_0x841d('0x21')](function(_0x372404){logger[_0x841d('0x46')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x372404,{'showHidden':![],'depth':null}));_0x4dda4c();})[_0x841d('0x2d')](function(_0x4c1d9f){logger[_0x841d('0x16')](_0x841d('0x47'),util[_0x841d('0x19')](_0x4c1d9f,{'showHidden':![],'depth':null}));_0x4dda4c(_0x4c1d9f);});}}});}; \ No newline at end of file +var _0x1e05=['CmList','BlackLists','length','cmContact,\x20%s,\x20%s','message','Lists','CmHopperBlack','ContactId','VoiceQueueId','CampaignId','push','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','get','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','utcOffset','add','minutes','format','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','error','Campaign','timezones','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','always','onlyIfOpen','outbound'];(function(_0x43308a,_0x5bb3ce){var _0x3b2bc7=function(_0x1449c0){while(--_0x1449c0){_0x43308a['push'](_0x43308a['shift']());}};_0x3b2bc7(++_0x5bb3ce);}(_0x1e05,0x1c3));var _0x51e0=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x1e05[_0x2e3545];return _0xcf18f;};'use strict';var _=require(_0x51e0('0x0'));var util=require(_0x51e0('0x1'));var logger=require('../../config/logger')(_0x51e0('0x2'));var moment=require(_0x51e0('0x3'));var BPromise=require(_0x51e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x51e0('0x5'));var rimraf=require(_0x51e0('0x6'));var config=require(_0x51e0('0x7'));var shared=require(_0x51e0('0x8'));var attributes=require(_0x51e0('0x9'));module[_0x51e0('0xa')]=function(_0x14d765,_0x77328a){return _0x14d765[_0x51e0('0xb')](_0x51e0('0xc'),attributes,{'tableName':_0x51e0('0xd'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x51e0('0xe')]},{'name':_0x51e0('0xf'),'fields':[_0x51e0('0x10'),_0x51e0('0x11'),_0x51e0('0xe'),_0x51e0('0x12'),_0x51e0('0x13'),_0x51e0('0x14')],'type':_0x51e0('0x15')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x51e0('0x16'),'hooks':{'afterCreate':function(_0x422105,_0x2b4d1c,_0x20a5a3){var _0x1a7028=_0x14d765[_0x51e0('0x17')];var _0x3bee42=_0x422105[_0x51e0('0x18')]({'plain':!![]});function _0x509ad6(){return function(_0xd8833b){logger['error'](_0x51e0('0x19'),_0x51e0('0x1a'),util[_0x51e0('0x1b')](_0xd8833b,{'showHidden':![],'depth':null}));};}function _0x1f8900(_0x52765b,_0x14a3b4){var _0x1c8412=_0x14a3b4[_0x51e0('0x1c')]?_0x14a3b4[_0x51e0('0x1c')]:moment()['format'](_0x51e0('0x1d'));return new BPromise(function(_0x5e33cc,_0x2804dd){if(_[_0x51e0('0x1e')](_0x14a3b4[_0x51e0('0x1f')])){_0x5e33cc({'ret':_0x1c8412});}else{_0x1a7028[_0x51e0('0x20')]['findOne']({'where':{'id':_0x52765b['id']}})[_0x51e0('0x21')](function(_0x13977a){if(!_['isNil'](_0x13977a)){var _0x21942e=_0x13977a[_0x51e0('0x1f')];if(!_[_0x51e0('0x1e')](_0x21942e)){var _0x55abf0=shared['timezones'];var _0x37b006=_0x55abf0[_0x21942e];var _0x4cd2ac=_0x55abf0[_0x14a3b4[_0x51e0('0x1f')]];if(!_[_0x51e0('0x1e')](_0x37b006)&&!_['isNil'](_0x4cd2ac)){var _0x20b138=_0x37b006['utcOffset']-_0x4cd2ac[_0x51e0('0x22')];_0x1c8412=_0x14a3b4[_0x51e0('0x1c')]?_0x14a3b4[_0x51e0('0x1c')]:moment();var _0x4c95cd=moment(_0x1c8412)[_0x51e0('0x23')](_0x20b138,_0x51e0('0x24'));_0x5e33cc({'ret':_0x4c95cd[_0x51e0('0x25')](_0x51e0('0x1d'))});}else _0x5e33cc({'ret':_0x1c8412});}else _0x5e33cc({'ret':_0x1c8412});}else{_0x5e33cc({'ret':_0x1c8412});}});}});return 0xa;}var _0x75ccd4=function(_0x25b159){return new BPromise(function(_0x1d96f4,_0x49727a){_0x1f8900(_0x25b159,_0x3bee42)['then'](function(_0x509ee8){_0x3bee42[_0x51e0('0x1c')]=_0x509ee8[_0x51e0('0x26')];_0x1a7028[_0x51e0('0x27')]['findOne']({'where':{'phone':_0x3bee42[_0x51e0('0xe')],'VoiceQueueId':_0x25b159['id']}})[_0x51e0('0x21')](function(_0x317de3){if(!_[_0x51e0('0x1e')](_0x317de3)){throw new Error(_0x51e0('0x28')+_0x3bee42[_0x51e0('0xe')]+_0x51e0('0x29')+_0x25b159['id']);}return _0x1a7028[_0x51e0('0x27')]['create']({'phone':_0x3bee42['phone'],'ContactId':_0x3bee42['id'],'ListId':_0x3bee42[_0x51e0('0x2a')],'priority':_0x3bee42[_0x51e0('0x2b')]?_0x3bee42['priority']:0x2,'scheduledat':_0x3bee42[_0x51e0('0x1c')]?_0x3bee42[_0x51e0('0x1c')]:moment()['format'](_0x51e0('0x1d')),'callback':_0x3bee42['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3bee42[_0x51e0('0x2c')]?_0x3bee42['callbackUniqueid']:undefined,'callbackat':_0x3bee42[_0x51e0('0x2c')]?moment()[_0x51e0('0x25')](_0x51e0('0x1d')):undefined,'VoiceQueueId':_0x25b159['id']});})[_0x51e0('0x2d')](function(_0x580450){_0x49727a(_0x580450);});});});};var _0x12f889=function(_0xf59995){return new BPromise(function(_0x22070e,_0x5ecd56){_0x1f8900(_0xf59995,_0x3bee42)['then'](function(_0x51854b){_0x3bee42[_0x51e0('0x1c')]=_0x51854b['ret'];_0x1a7028[_0x51e0('0x27')][_0x51e0('0x2e')]({'where':{'phone':_0x3bee42[_0x51e0('0xe')],'VoiceQueueId':_0xf59995['id']}})['then'](function(_0x4aedd0){if(!_[_0x51e0('0x1e')](_0x4aedd0)){throw new Error(_0x51e0('0x28')+_0x3bee42['phone']+_0x51e0('0x2f')+_0xf59995['id']);}return _0x1a7028[_0x51e0('0x30')]['findOne']({'where':{'calleridnum':_0x3bee42['phone'],'VoiceQueueId':_0xf59995['id']}});})[_0x51e0('0x21')](function(_0x2fae6d){if(!_[_0x51e0('0x1e')](_0x2fae6d)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3bee42[_0x51e0('0xe')]+_0x51e0('0x31')+_0xf59995['id']);}return _0x1a7028[_0x51e0('0x27')][_0x51e0('0x32')]({'phone':_0x3bee42[_0x51e0('0xe')],'ContactId':_0x3bee42['id'],'ListId':_0x3bee42[_0x51e0('0x2a')],'priority':_0x3bee42[_0x51e0('0x2b')]?_0x3bee42[_0x51e0('0x2b')]:0x2,'scheduledat':_0x3bee42['scheduledat']?_0x3bee42[_0x51e0('0x1c')]:moment()[_0x51e0('0x25')](_0x51e0('0x1d')),'callback':_0x3bee42[_0x51e0('0x2c')]?!![]:![],'callbackuniqueid':_0x3bee42[_0x51e0('0x2c')]?_0x3bee42[_0x51e0('0x2c')]:undefined,'callbackat':_0x3bee42[_0x51e0('0x2c')]?moment()[_0x51e0('0x25')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0xf59995['id']});})['catch'](function(_0x11c9a4){_0x5ecd56(_0x11c9a4);});});});};function _0x4aa0cc(){return function(_0x560e2b){logger[_0x51e0('0x33')]('cmContact','afterCreate',util['inspect'](_0x560e2b,{'showHidden':![],'depth':null}));};}function _0x397201(_0x431991,_0x3e11bf){var _0xe6d192=_0x3e11bf[_0x51e0('0x1c')]?_0x3e11bf[_0x51e0('0x1c')]:moment()['format'](_0x51e0('0x1d'));return new BPromise(function(_0x330b24,_0x824ee0){if(_[_0x51e0('0x1e')](_0x3e11bf[_0x51e0('0x1f')])){_0x330b24({'ret':_0xe6d192});}else{_0x1a7028[_0x51e0('0x34')][_0x51e0('0x2e')]({'where':{'id':_0x431991['id']}})[_0x51e0('0x21')](function(_0x5c98b9){if(!_[_0x51e0('0x1e')](_0x5c98b9)){var _0x32e151=_0x5c98b9[_0x51e0('0x1f')];if(!_[_0x51e0('0x1e')](_0x32e151)){var _0x14f5bd=shared[_0x51e0('0x35')];var _0x31d7f5=_0x14f5bd[_0x32e151];var _0x4d46c1=_0x14f5bd[_0x3e11bf[_0x51e0('0x1f')]];if(!_['isNil'](_0x31d7f5)&&!_[_0x51e0('0x1e')](_0x4d46c1)){var _0x2b240d=_0x31d7f5[_0x51e0('0x22')]-_0x4d46c1[_0x51e0('0x22')];_0xe6d192=_0x3e11bf[_0x51e0('0x1c')]?_0x3e11bf[_0x51e0('0x1c')]:moment();var _0x2bc2be=moment(_0xe6d192)[_0x51e0('0x23')](_0x2b240d,_0x51e0('0x24'));_0x330b24({'ret':_0x2bc2be[_0x51e0('0x25')](_0x51e0('0x1d'))});}else _0x330b24({'ret':_0xe6d192});}else _0x330b24({'ret':_0xe6d192});}else{_0x330b24({'ret':_0xe6d192});}});}});return 0xa;}var _0x211292=function(_0x4e5e2e){return new BPromise(function(_0x109aee,_0x29a1e8){_0x397201(_0x4e5e2e,_0x3bee42)[_0x51e0('0x21')](function(_0x37798d){_0x3bee42[_0x51e0('0x1c')]=_0x37798d[_0x51e0('0x26')];_0x1a7028[_0x51e0('0x27')]['findOne']({'where':{'phone':_0x3bee42[_0x51e0('0xe')],'CampaignId':_0x4e5e2e['id']}})[_0x51e0('0x21')](function(_0x101ccc){if(!_[_0x51e0('0x1e')](_0x101ccc)){throw new Error(_0x51e0('0x28')+_0x3bee42[_0x51e0('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x4e5e2e['id']);}return _0x1a7028[_0x51e0('0x27')][_0x51e0('0x32')]({'phone':_0x3bee42[_0x51e0('0xe')],'ContactId':_0x3bee42['id'],'ListId':_0x3bee42[_0x51e0('0x2a')],'priority':_0x3bee42[_0x51e0('0x2b')]?_0x3bee42[_0x51e0('0x2b')]:0x2,'scheduledat':_0x3bee42['scheduledat']?_0x3bee42[_0x51e0('0x1c')]:moment()[_0x51e0('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3bee42[_0x51e0('0x2c')]?!![]:![],'callbackuniqueid':_0x3bee42[_0x51e0('0x2c')]?_0x3bee42['callbackUniqueid']:undefined,'callbackat':_0x3bee42[_0x51e0('0x2c')]?moment()[_0x51e0('0x25')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4e5e2e['id']});})[_0x51e0('0x2d')](function(_0x29324e){_0x29a1e8(_0x29324e);});});});};var _0x26bd7a=function(_0x55ce51){return new BPromise(function(_0x43c4df,_0x1c4ea4){_0x397201(_0x55ce51,_0x3bee42)[_0x51e0('0x21')](function(_0x507285){_0x3bee42[_0x51e0('0x1c')]=_0x507285['ret'];_0x1a7028[_0x51e0('0x27')]['findOne']({'where':{'phone':_0x3bee42[_0x51e0('0xe')],'CampaignId':_0x55ce51['id']}})[_0x51e0('0x21')](function(_0x133fd7){if(!_[_0x51e0('0x1e')](_0x133fd7)){throw new Error(_0x51e0('0x28')+_0x3bee42[_0x51e0('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x55ce51['id']);}return _0x1a7028[_0x51e0('0x30')]['findOne']({'where':{'calleridnum':_0x3bee42[_0x51e0('0xe')],'CampaignId':_0x55ce51['id']}});})[_0x51e0('0x21')](function(_0x502528){if(!_['isNil'](_0x502528)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3bee42[_0x51e0('0xe')]+_0x51e0('0x36')+_0x55ce51['id']);}return _0x1a7028[_0x51e0('0x27')][_0x51e0('0x32')]({'phone':_0x3bee42['phone'],'ContactId':_0x3bee42['id'],'ListId':_0x3bee42[_0x51e0('0x2a')],'priority':_0x3bee42['priority']?_0x3bee42['priority']:0x2,'scheduledat':_0x3bee42[_0x51e0('0x1c')]?_0x3bee42[_0x51e0('0x1c')]:moment()['format'](_0x51e0('0x1d')),'callback':_0x3bee42[_0x51e0('0x2c')]?!![]:![],'callbackuniqueid':_0x3bee42[_0x51e0('0x2c')]?_0x3bee42[_0x51e0('0x2c')]:undefined,'callbackat':_0x3bee42['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x55ce51['id']});})['catch'](function(_0x13238a){_0x1c4ea4(_0x13238a);});});});};if(_0x3bee42[_0x51e0('0x2a')]){_0x1a7028['VoiceQueue'][_0x51e0('0x37')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0x51e0('0x1f')],'include':[{'model':_0x1a7028['CmList'],'as':'Lists','where':{'id':_0x3bee42[_0x51e0('0x2a')]}}]})[_0x51e0('0x21')](function(_0x5d135a){if(_0x5d135a){var _0x291519=[];for(var _0x1707a6=0x0,_0x46f41f;_0x1707a6<_0x5d135a['length'];_0x1707a6+=0x1){_0x46f41f=_0x5d135a[_0x1707a6][_0x51e0('0x18')]({'plain':!![]});switch(_0x46f41f[_0x51e0('0x38')]){case _0x51e0('0x39'):_0x12f889(_0x46f41f)[_0x51e0('0x2d')](_0x509ad6());break;case _0x51e0('0x3a'):_0x75ccd4(_0x46f41f)[_0x51e0('0x2d')](_0x509ad6());break;default:_0x397201(_0x46f41f,_0x3bee42)[_0x51e0('0x21')](function(_0x3f616a){_0x3bee42['scheduledat']=_0x3f616a[_0x51e0('0x26')];_0x1a7028[_0x51e0('0x27')][_0x51e0('0x32')]({'phone':_0x3bee42[_0x51e0('0xe')],'ContactId':_0x3bee42['id'],'ListId':_0x3bee42[_0x51e0('0x2a')],'scheduledat':_0x3bee42[_0x51e0('0x1c')]?_0x3bee42[_0x51e0('0x1c')]:moment()[_0x51e0('0x25')](_0x51e0('0x1d')),'priority':_0x3bee42[_0x51e0('0x2b')]?_0x3bee42[_0x51e0('0x2b')]:0x2,'callback':_0x3bee42['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3bee42[_0x51e0('0x2c')]?_0x3bee42[_0x51e0('0x2c')]:undefined,'callbackat':_0x3bee42['callbackUniqueid']?moment()[_0x51e0('0x25')](_0x51e0('0x1d')):undefined,'VoiceQueueId':_0x46f41f['id']})[_0x51e0('0x2d')](_0x509ad6());});}}}})[_0x51e0('0x21')](function(){return _0x1a7028[_0x51e0('0x20')][_0x51e0('0x37')]({'where':{'type':_0x51e0('0x3b')},'attributes':['id'],'include':[{'model':_0x1a7028[_0x51e0('0x3c')],'as':_0x51e0('0x3d'),'where':{'id':_0x3bee42[_0x51e0('0x2a')]}}]})[_0x51e0('0x21')](function(_0x34d49e){if(_0x34d49e){var _0x4b828a=[];for(var _0xe237e5=0x0,_0x5e100c;_0xe237e5<_0x34d49e[_0x51e0('0x3e')];_0xe237e5+=0x1){_0x5e100c=_0x34d49e[_0xe237e5][_0x51e0('0x18')]({'plain':!![]});_0x1a7028['CmHopperBlack'][_0x51e0('0x32')]({'phone':_0x3bee42[_0x51e0('0xe')],'ContactId':_0x3bee42['id'],'ListId':_0x3bee42[_0x51e0('0x2a')],'VoiceQueueId':_0x5e100c['id']})[_0x51e0('0x2d')](function(_0x1304b9){logger[_0x51e0('0x33')](_0x51e0('0x3f'),_0x51e0('0x1a'),_0x1304b9[_0x51e0('0x40')]);});}}});})['then'](function(){return _0x1a7028[_0x51e0('0x34')][_0x51e0('0x37')]({'attributes':['id',_0x51e0('0x38'),_0x51e0('0x1f')],'include':[{'model':_0x1a7028['CmList'],'as':_0x51e0('0x41'),'where':{'id':_0x3bee42[_0x51e0('0x2a')]}}]})[_0x51e0('0x21')](function(_0x2addbf){if(_0x2addbf){var _0x38a64f=[];for(var _0x344372=0x0,_0x59bfda;_0x344372<_0x2addbf[_0x51e0('0x3e')];_0x344372+=0x1){_0x59bfda=_0x2addbf[_0x344372][_0x51e0('0x18')]({'plain':!![]});switch(_0x59bfda['dialCheckDuplicateType']){case _0x51e0('0x39'):_0x26bd7a(_0x59bfda)[_0x51e0('0x2d')](_0x4aa0cc());break;case'onlyIfOpen':_0x211292(_0x59bfda)[_0x51e0('0x2d')](_0x4aa0cc());break;default:_0x1a7028[_0x51e0('0x27')][_0x51e0('0x32')]({'phone':_0x3bee42[_0x51e0('0xe')],'ContactId':_0x3bee42['id'],'ListId':_0x3bee42[_0x51e0('0x2a')],'scheduledat':_0x3bee42[_0x51e0('0x1c')]?_0x3bee42[_0x51e0('0x1c')]:moment()[_0x51e0('0x25')](_0x51e0('0x1d')),'priority':_0x3bee42[_0x51e0('0x2b')]?_0x3bee42[_0x51e0('0x2b')]:0x2,'callback':_0x3bee42['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3bee42[_0x51e0('0x2c')]?_0x3bee42[_0x51e0('0x2c')]:undefined,'callbackat':_0x3bee42[_0x51e0('0x2c')]?moment()[_0x51e0('0x25')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x59bfda['id']})[_0x51e0('0x2d')](_0x4aa0cc());}}}});})[_0x51e0('0x21')](function(){return _0x1a7028[_0x51e0('0x34')]['findAll']({'attributes':['id'],'include':[{'model':_0x1a7028[_0x51e0('0x3c')],'as':_0x51e0('0x3d'),'where':{'id':_0x3bee42[_0x51e0('0x2a')]}}]})[_0x51e0('0x21')](function(_0x4c8eec){if(_0x4c8eec){var _0x270cf1=[];for(var _0x56fd44=0x0,_0x484515;_0x56fd44<_0x4c8eec[_0x51e0('0x3e')];_0x56fd44+=0x1){_0x484515=_0x4c8eec[_0x56fd44]['get']({'plain':!![]});_0x1a7028[_0x51e0('0x42')][_0x51e0('0x32')]({'phone':_0x3bee42[_0x51e0('0xe')],'ContactId':_0x3bee42['id'],'ListId':_0x3bee42[_0x51e0('0x2a')],'CampaignId':_0x484515['id']})[_0x51e0('0x2d')](function(_0x4c045f){logger[_0x51e0('0x33')](_0x51e0('0x3f'),_0x51e0('0x1a'),_0x4c045f['message']);});}}});})['then'](function(){_0x20a5a3();})['catch'](function(_0x338d9e){logger[_0x51e0('0x33')](_0x51e0('0x3f'),_0x51e0('0x1a'),_0x338d9e[_0x51e0('0x40')]);_0x20a5a3(_0x338d9e);});}else{_0x20a5a3(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x5bc3cf,_0x3ca5c1,_0xf1f85c){var _0x5aa6be=_0x14d765[_0x51e0('0x17')];var _0x49c93f=_0x5bc3cf['get']({'plain':!![]});return _0x5aa6be[_0x51e0('0x27')][_0x51e0('0x37')]({'raw':!![],'where':{'ListId':_0x49c93f[_0x51e0('0x2a')],'ContactId':_0x49c93f['id']}})['then'](function(_0x157408){if(!_['isEmpty'](_0x157408)){var _0x3d358a=[];for(var _0x1b39bd=0x0;_0x1b39bd<_0x157408[_0x51e0('0x3e')];_0x1b39bd+=0x1){var _0x3b57af=_0x5aa6be[_0x51e0('0x27')]['destroy']({'where':{'ListId':_0x157408[_0x1b39bd][_0x51e0('0x2a')],'ContactId':_0x157408[_0x1b39bd][_0x51e0('0x43')],'VoiceQueueId':_0x157408[_0x1b39bd][_0x51e0('0x44')],'CampaignId':_0x157408[_0x1b39bd][_0x51e0('0x45')]}});_0x3d358a[_0x51e0('0x46')](_0x3b57af);}return BPromise['all'](_0x3d358a);}})[_0x51e0('0x21')](function(_0x22aa1f){logger['info'](_0x51e0('0x47'),util[_0x51e0('0x1b')](_0x22aa1f,{'showHidden':![],'depth':null}));_0xf1f85c();})[_0x51e0('0x2d')](function(_0x7211e3){logger[_0x51e0('0x33')](_0x51e0('0x48'),util[_0x51e0('0x1b')](_0x7211e3,{'showHidden':![],'depth':null}));_0xf1f85c(_0x7211e3);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index fb6a383..e1d9fca 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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(_0x423220,_0x51d0dc){var _0xfaeed5=function(_0x50447b){while(--_0x50447b){_0x423220['push'](_0x423220['shift']());}};_0xfaeed5(++_0x51d0dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 7bd8dd8..b203d61 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 _0xa101=['PHONE','sequelize','exports','STRING','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa101,0x15f));var _0x1a10=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0xa101[_0x507965];return _0x3608fc;};'use strict';var Sequelize=require(_0x1a10('0x0'));module[_0x1a10('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x1a10('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1a10('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x1a10('0x4')},'OrderBy':{'type':Sequelize[_0x1a10('0x3')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xea70=['INTEGER','PHONE','STRING','sequelize','exports'];(function(_0x5afa8d,_0x382cc4){var _0x44d460=function(_0x2e8d4b){while(--_0x2e8d4b){_0x5afa8d['push'](_0x5afa8d['shift']());}};_0x44d460(++_0x382cc4);}(_0xea70,0x175));var _0x0ea7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xea70[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x0ea7('0x0'));module[_0x0ea7('0x1')]={'CmContactId':{'type':Sequelize[_0x0ea7('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0ea7('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x0ea7('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x0ea7('0x4')],'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 4634b54..3e17556 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 _0xd98c=['querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','get','CmContactHasItems','UserProfileResource','then','error','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','catch','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','squel','jsforce','desk.js'];(function(_0x37e01d,_0x2277dd){var _0x47fc34=function(_0x1b5ca9){while(--_0x1b5ca9){_0x37e01d['push'](_0x37e01d['shift']());}};_0x47fc34(++_0x2277dd);}(_0xd98c,0x12d));var _0xcd98=function(_0x307849,_0x8219dc){_0x307849=_0x307849-0x0;var _0x84ae96=_0xd98c[_0x307849];return _0x84ae96;};'use strict';var emlformat=require(_0xcd98('0x0'));var rimraf=require(_0xcd98('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd98('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcd98('0x3'));var Mustache=require(_0xcd98('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcd98('0x5'));var ejs=require(_0xcd98('0x6'));var fs=require('fs');var fs_extra=require(_0xcd98('0x7'));var _=require('lodash');var squel=require(_0xcd98('0x8'));var crypto=require('crypto');var jsforce=require(_0xcd98('0x9'));var deskjs=require(_0xcd98('0xa'));var toCsv=require(_0xcd98('0x5'));var querystring=require(_0xcd98('0xb'));var Papa=require(_0xcd98('0xc'));var Redis=require('ioredis');var authService=require(_0xcd98('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcd98('0xe'));var hardwareService=require(_0xcd98('0xf'));var logger=require('../../config/logger')(_0xcd98('0x10'));var utils=require(_0xcd98('0x11'));var config=require(_0xcd98('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd98('0x13'))['db'];function respondWithStatusCode(_0x416d9c,_0x5eed29){_0x5eed29=_0x5eed29||0xcc;return function(_0x22bc5c){if(_0x22bc5c){return _0x416d9c['sendStatus'](_0x5eed29);}return _0x416d9c[_0xcd98('0x14')](_0x5eed29)['end']();};}function respondWithResult(_0x49d5ea,_0x39f8d1){_0x39f8d1=_0x39f8d1||0xc8;return function(_0x289bc1){if(_0x289bc1){return _0x49d5ea[_0xcd98('0x14')](_0x39f8d1)[_0xcd98('0x15')](_0x289bc1);}};}function respondWithFilteredResult(_0x595d7f,_0x1ce415){return function(_0x2f948e){if(_0x2f948e){var _0x52d10b=typeof _0x1ce415['offset']===_0xcd98('0x16')&&typeof _0x1ce415[_0xcd98('0x17')]===_0xcd98('0x16');var _0x7726bd=_0x2f948e['count'];var _0x467de5=_0x52d10b?0x0:_0x1ce415[_0xcd98('0x18')];var _0x2263d6=_0x52d10b?_0x2f948e[_0xcd98('0x19')]:_0x1ce415[_0xcd98('0x18')]+_0x1ce415[_0xcd98('0x17')];var _0x9ac7a0;if(_0x2263d6>=_0x7726bd){_0x2263d6=_0x7726bd;_0x9ac7a0=0xc8;}else{_0x9ac7a0=0xce;}_0x595d7f[_0xcd98('0x14')](_0x9ac7a0);return _0x595d7f[_0xcd98('0x1a')](_0xcd98('0x1b'),_0x467de5+'-'+_0x2263d6+'/'+_0x7726bd)[_0xcd98('0x15')](_0x2f948e);}return null;};}function patchUpdates(_0x10c92b){return function(_0x1fdf51){try{jsonpatch[_0xcd98('0x1c')](_0x1fdf51,_0x10c92b,!![]);}catch(_0x4736da){return BPromise[_0xcd98('0x1d')](_0x4736da);}return _0x1fdf51[_0xcd98('0x1e')]();};}function saveUpdates(_0x3f7a52,_0xff604){return function(_0x5027fe){if(_0x5027fe){return _0x5027fe['update'](_0x3f7a52)['then'](function(_0x107b77){return _0x107b77;});}return null;};}function removeEntity(_0x5c59c4,_0x29fb79){return function(_0x55f6b1){if(_0x55f6b1){return _0x55f6b1[_0xcd98('0x1f')]()['then'](function(){var _0x253576=_0x55f6b1[_0xcd98('0x20')]({'plain':!![]});var _0x475aaa=_0xcd98('0x21');return db[_0xcd98('0x22')][_0xcd98('0x1f')]({'where':{'type':_0x475aaa,'resourceId':_0x253576['id']}})['then'](function(){return _0x55f6b1;});})[_0xcd98('0x23')](function(){_0x5c59c4[_0xcd98('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31d474,_0xd6a7e1){return function(_0x30ce8a){if(!_0x30ce8a){_0x31d474['sendStatus'](0x194);}return _0x30ce8a;};}function handleError(_0x216049,_0x1ca336){_0x1ca336=_0x1ca336||0x1f4;return function(_0x5f153a){logger[_0xcd98('0x24')](_0x5f153a[_0xcd98('0x25')]);if(_0x5f153a[_0xcd98('0x26')]){delete _0x5f153a[_0xcd98('0x26')];}_0x216049['status'](_0x1ca336)['send'](_0x5f153a);};}exports[_0xcd98('0x27')]=function(_0x5eff26,_0x54eaa8){var _0x53b277={},_0x590cfe={},_0x3931de={'count':0x0,'rows':[]};var _0x15bfa2=_[_0xcd98('0x28')](db[_0xcd98('0x29')][_0xcd98('0x2a')],function(_0x55aec5){return{'name':_0x55aec5[_0xcd98('0x2b')],'type':_0x55aec5['type']['key']};});_0x590cfe[_0xcd98('0x2c')]=_[_0xcd98('0x28')](_0x15bfa2,'name');_0x590cfe[_0xcd98('0x2d')]=_['keys'](_0x5eff26['query']);_0x590cfe[_0xcd98('0x2e')]=_[_0xcd98('0x2f')](_0x590cfe['model'],_0x590cfe[_0xcd98('0x2d')]);_0x53b277['attributes']=_[_0xcd98('0x2f')](_0x590cfe[_0xcd98('0x2c')],qs[_0xcd98('0x30')](_0x5eff26['query'][_0xcd98('0x30')]));_0x53b277['attributes']=_0x53b277[_0xcd98('0x31')]['length']?_0x53b277[_0xcd98('0x31')]:_0x590cfe[_0xcd98('0x2c')];if(!_0x5eff26[_0xcd98('0x2d')][_0xcd98('0x32')](_0xcd98('0x33'))){_0x53b277[_0xcd98('0x17')]=qs[_0xcd98('0x17')](_0x5eff26['query'][_0xcd98('0x17')]);_0x53b277[_0xcd98('0x18')]=qs[_0xcd98('0x18')](_0x5eff26[_0xcd98('0x2d')][_0xcd98('0x18')]);}_0x53b277[_0xcd98('0x34')]=qs['sort'](_0x5eff26[_0xcd98('0x2d')][_0xcd98('0x35')]);_0x53b277[_0xcd98('0x36')]=qs[_0xcd98('0x2e')](_[_0xcd98('0x37')](_0x5eff26[_0xcd98('0x2d')],_0x590cfe[_0xcd98('0x2e')]),_0x15bfa2);if(_0x5eff26['query'][_0xcd98('0x38')]){_0x53b277[_0xcd98('0x36')]=_[_0xcd98('0x39')](_0x53b277[_0xcd98('0x36')],{'$or':_[_0xcd98('0x28')](_0x15bfa2,function(_0x31d1ea){if(_0x31d1ea['type']!==_0xcd98('0x3a')){var _0x20b84a={};_0x20b84a[_0x31d1ea[_0xcd98('0x26')]]={'$like':'%'+_0x5eff26['query']['filter']+'%'};return _0x20b84a;}})});}_0x53b277=_['merge']({},_0x53b277,_0x5eff26[_0xcd98('0x3b')]);var _0x32ee2b={'where':_0x53b277[_0xcd98('0x36')]};return db[_0xcd98('0x29')][_0xcd98('0x19')](_0x32ee2b)[_0xcd98('0x23')](function(_0x13c185){_0x3931de[_0xcd98('0x19')]=_0x13c185;if(_0x5eff26['query'][_0xcd98('0x3c')]){_0x53b277[_0xcd98('0x3d')]=[{'all':!![]}];}return db[_0xcd98('0x29')][_0xcd98('0x3e')](_0x53b277);})[_0xcd98('0x23')](function(_0x54d4dd){_0x3931de[_0xcd98('0x3f')]=_0x54d4dd;return _0x3931de;})[_0xcd98('0x23')](respondWithFilteredResult(_0x54eaa8,_0x53b277))['catch'](handleError(_0x54eaa8,null));};exports[_0xcd98('0x40')]=function(_0x3be6b3,_0x4a1f36){var _0x260ece={'raw':!![],'where':{'id':_0x3be6b3[_0xcd98('0x41')]['id']}},_0x1c628d={};_0x1c628d[_0xcd98('0x2c')]=_[_0xcd98('0x42')](db[_0xcd98('0x29')][_0xcd98('0x2a')]);_0x1c628d['query']=_[_0xcd98('0x42')](_0x3be6b3[_0xcd98('0x2d')]);_0x1c628d['filters']=_[_0xcd98('0x2f')](_0x1c628d['model'],_0x1c628d[_0xcd98('0x2d')]);_0x260ece[_0xcd98('0x31')]=_['intersection'](_0x1c628d['model'],qs[_0xcd98('0x30')](_0x3be6b3['query'][_0xcd98('0x30')]));_0x260ece[_0xcd98('0x31')]=_0x260ece[_0xcd98('0x31')][_0xcd98('0x43')]?_0x260ece[_0xcd98('0x31')]:_0x1c628d[_0xcd98('0x2c')];if(_0x3be6b3['query'][_0xcd98('0x3c')]){_0x260ece[_0xcd98('0x3d')]=[{'all':!![]}];}_0x260ece=_[_0xcd98('0x39')]({},_0x260ece,_0x3be6b3[_0xcd98('0x3b')]);return db[_0xcd98('0x29')][_0xcd98('0x44')](_0x260ece)[_0xcd98('0x23')](handleEntityNotFound(_0x4a1f36,null))[_0xcd98('0x23')](respondWithResult(_0x4a1f36,null))['catch'](handleError(_0x4a1f36,null));};exports[_0xcd98('0x45')]=function(_0x407e85,_0x30be97){return db[_0xcd98('0x29')][_0xcd98('0x45')](_0x407e85[_0xcd98('0x46')],{})[_0xcd98('0x23')](function(_0x21623a){var _0x163f8b=_0x407e85['user'][_0xcd98('0x20')]({'plain':!![]});if(!_0x163f8b)throw new Error(_0xcd98('0x47'));if(_0x163f8b[_0xcd98('0x48')]==='user'){var _0x23bd82=_0x21623a[_0xcd98('0x20')]({'plain':!![]});var _0x22d346='CmContactHasItems';return db[_0xcd98('0x49')][_0xcd98('0x44')]({'where':{'name':_0x22d346,'userProfileId':_0x163f8b['userProfileId']},'raw':!![]})['then'](function(_0x1c04de){if(_0x1c04de&&_0x1c04de[_0xcd98('0x4a')]===0x0){return db[_0xcd98('0x22')][_0xcd98('0x45')]({'name':_0x23bd82[_0xcd98('0x26')],'resourceId':_0x23bd82['id'],'type':_0x1c04de[_0xcd98('0x26')],'sectionId':_0x1c04de['id']},{})['then'](function(){return _0x21623a;});}else{return _0x21623a;}})['catch'](function(_0x16e6bb){logger[_0xcd98('0x24')](_0xcd98('0x4b'),_0x16e6bb);throw _0x16e6bb;});}return _0x21623a;})[_0xcd98('0x23')](respondWithResult(_0x30be97,0xc9))['catch'](handleError(_0x30be97,null));};exports[_0xcd98('0x4c')]=function(_0x3e16b5,_0x1012fa){if(_0x3e16b5[_0xcd98('0x46')]['id']){delete _0x3e16b5['body']['id'];}return db[_0xcd98('0x29')][_0xcd98('0x44')]({'where':{'id':_0x3e16b5[_0xcd98('0x41')]['id']}})[_0xcd98('0x23')](handleEntityNotFound(_0x1012fa,null))[_0xcd98('0x23')](saveUpdates(_0x3e16b5[_0xcd98('0x46')],null))['then'](respondWithResult(_0x1012fa,null))[_0xcd98('0x4d')](handleError(_0x1012fa,null));};exports['destroy']=function(_0x3b6aa3,_0x3c9c75){return db[_0xcd98('0x29')][_0xcd98('0x44')]({'where':{'id':_0x3b6aa3[_0xcd98('0x41')]['id']}})[_0xcd98('0x23')](handleEntityNotFound(_0x3c9c75,null))['then'](removeEntity(_0x3c9c75,null))[_0xcd98('0x4d')](handleError(_0x3c9c75,null));}; \ No newline at end of file +var _0xcc52=['../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','CmContactHasItems','UserProfileResource','destroy','end','error','stack','send','index','CmContactHasItem','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x531596,_0x5acae3){var _0x4d6839=function(_0x3a27d0){while(--_0x3a27d0){_0x531596['push'](_0x531596['shift']());}};_0x4d6839(++_0x5acae3);}(_0xcc52,0x182));var _0x2cc5=function(_0x26e5b6,_0x32da52){_0x26e5b6=_0x26e5b6-0x0;var _0x512014=_0xcc52[_0x26e5b6];return _0x512014;};'use strict';var emlformat=require(_0x2cc5('0x0'));var rimraf=require(_0x2cc5('0x1'));var zipdir=require(_0x2cc5('0x2'));var jsonpatch=require(_0x2cc5('0x3'));var rp=require(_0x2cc5('0x4'));var moment=require(_0x2cc5('0x5'));var BPromise=require(_0x2cc5('0x6'));var Mustache=require(_0x2cc5('0x7'));var util=require(_0x2cc5('0x8'));var path=require(_0x2cc5('0x9'));var sox=require('sox');var csv=require(_0x2cc5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cc5('0xb'));var _=require(_0x2cc5('0xc'));var squel=require(_0x2cc5('0xd'));var crypto=require('crypto');var jsforce=require(_0x2cc5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2cc5('0xf'));var Papa=require('papaparse');var Redis=require(_0x2cc5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2cc5('0x11'));var as=require(_0x2cc5('0x12'));var hardwareService=require(_0x2cc5('0x13'));var logger=require(_0x2cc5('0x14'))(_0x2cc5('0x15'));var utils=require(_0x2cc5('0x16'));var config=require(_0x2cc5('0x17'));var licenseUtil=require(_0x2cc5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a18ac,_0x73c3f8){_0x73c3f8=_0x73c3f8||0xcc;return function(_0x5dfc9d){if(_0x5dfc9d){return _0x4a18ac[_0x2cc5('0x19')](_0x73c3f8);}return _0x4a18ac[_0x2cc5('0x1a')](_0x73c3f8)['end']();};}function respondWithResult(_0x6f7332,_0x21584d){_0x21584d=_0x21584d||0xc8;return function(_0x68c5d){if(_0x68c5d){return _0x6f7332['status'](_0x21584d)['json'](_0x68c5d);}};}function respondWithFilteredResult(_0x3f4238,_0x8053c9){return function(_0x455cb3){if(_0x455cb3){var _0x5d7624=typeof _0x8053c9[_0x2cc5('0x1b')]==='undefined'&&typeof _0x8053c9[_0x2cc5('0x1c')]==='undefined';var _0xfafb74=_0x455cb3[_0x2cc5('0x1d')];var _0x11a8e8=_0x5d7624?0x0:_0x8053c9['offset'];var _0x17ca32=_0x5d7624?_0x455cb3[_0x2cc5('0x1d')]:_0x8053c9['offset']+_0x8053c9[_0x2cc5('0x1c')];var _0x504643;if(_0x17ca32>=_0xfafb74){_0x17ca32=_0xfafb74;_0x504643=0xc8;}else{_0x504643=0xce;}_0x3f4238[_0x2cc5('0x1a')](_0x504643);return _0x3f4238[_0x2cc5('0x1e')](_0x2cc5('0x1f'),_0x11a8e8+'-'+_0x17ca32+'/'+_0xfafb74)[_0x2cc5('0x20')](_0x455cb3);}return null;};}function patchUpdates(_0x64deed){return function(_0x536296){try{jsonpatch[_0x2cc5('0x21')](_0x536296,_0x64deed,!![]);}catch(_0x19a88f){return BPromise[_0x2cc5('0x22')](_0x19a88f);}return _0x536296[_0x2cc5('0x23')]();};}function saveUpdates(_0x4d7ca6,_0x1b8c78){return function(_0x33a92b){if(_0x33a92b){return _0x33a92b[_0x2cc5('0x24')](_0x4d7ca6)['then'](function(_0x158730){return _0x158730;});}return null;};}function removeEntity(_0x2b33df,_0x123b95){return function(_0x5d6b0c){if(_0x5d6b0c){return _0x5d6b0c['destroy']()[_0x2cc5('0x25')](function(){var _0x32e3ca=_0x5d6b0c[_0x2cc5('0x26')]({'plain':!![]});var _0x2115af=_0x2cc5('0x27');return db[_0x2cc5('0x28')][_0x2cc5('0x29')]({'where':{'type':_0x2115af,'resourceId':_0x32e3ca['id']}})[_0x2cc5('0x25')](function(){return _0x5d6b0c;});})[_0x2cc5('0x25')](function(){_0x2b33df[_0x2cc5('0x1a')](0xcc)[_0x2cc5('0x2a')]();});}};}function handleEntityNotFound(_0x42a3ad,_0x249059){return function(_0x55cf05){if(!_0x55cf05){_0x42a3ad[_0x2cc5('0x19')](0x194);}return _0x55cf05;};}function handleError(_0xebcf3d,_0x306cc6){_0x306cc6=_0x306cc6||0x1f4;return function(_0x1aff38){logger[_0x2cc5('0x2b')](_0x1aff38[_0x2cc5('0x2c')]);if(_0x1aff38['name']){delete _0x1aff38['name'];}_0xebcf3d[_0x2cc5('0x1a')](_0x306cc6)[_0x2cc5('0x2d')](_0x1aff38);};}exports[_0x2cc5('0x2e')]=function(_0xea7cac,_0x3652b6){var _0x2000ba={},_0x4db039={},_0x2950a6={'count':0x0,'rows':[]};var _0x42ad50=_['map'](db[_0x2cc5('0x2f')]['rawAttributes'],function(_0x1ea48c){return{'name':_0x1ea48c[_0x2cc5('0x30')],'type':_0x1ea48c[_0x2cc5('0x31')][_0x2cc5('0x32')]};});_0x4db039[_0x2cc5('0x33')]=_[_0x2cc5('0x34')](_0x42ad50,_0x2cc5('0x35'));_0x4db039['query']=_[_0x2cc5('0x36')](_0xea7cac[_0x2cc5('0x37')]);_0x4db039[_0x2cc5('0x38')]=_[_0x2cc5('0x39')](_0x4db039[_0x2cc5('0x33')],_0x4db039['query']);_0x2000ba[_0x2cc5('0x3a')]=_[_0x2cc5('0x39')](_0x4db039['model'],qs[_0x2cc5('0x3b')](_0xea7cac[_0x2cc5('0x37')][_0x2cc5('0x3b')]));_0x2000ba[_0x2cc5('0x3a')]=_0x2000ba[_0x2cc5('0x3a')][_0x2cc5('0x3c')]?_0x2000ba[_0x2cc5('0x3a')]:_0x4db039[_0x2cc5('0x33')];if(!_0xea7cac[_0x2cc5('0x37')]['hasOwnProperty']('nolimit')){_0x2000ba[_0x2cc5('0x1c')]=qs[_0x2cc5('0x1c')](_0xea7cac[_0x2cc5('0x37')][_0x2cc5('0x1c')]);_0x2000ba[_0x2cc5('0x1b')]=qs[_0x2cc5('0x1b')](_0xea7cac[_0x2cc5('0x37')][_0x2cc5('0x1b')]);}_0x2000ba['order']=qs['sort'](_0xea7cac[_0x2cc5('0x37')]['sort']);_0x2000ba[_0x2cc5('0x3d')]=qs['filters'](_[_0x2cc5('0x3e')](_0xea7cac[_0x2cc5('0x37')],_0x4db039[_0x2cc5('0x38')]),_0x42ad50);if(_0xea7cac[_0x2cc5('0x37')][_0x2cc5('0x3f')]){_0x2000ba[_0x2cc5('0x3d')]=_[_0x2cc5('0x40')](_0x2000ba['where'],{'$or':_[_0x2cc5('0x34')](_0x42ad50,function(_0x19bdd8){if(_0x19bdd8[_0x2cc5('0x31')]!==_0x2cc5('0x41')){var _0x31986d={};_0x31986d[_0x19bdd8[_0x2cc5('0x35')]]={'$like':'%'+_0xea7cac[_0x2cc5('0x37')][_0x2cc5('0x3f')]+'%'};return _0x31986d;}})});}_0x2000ba=_[_0x2cc5('0x40')]({},_0x2000ba,_0xea7cac[_0x2cc5('0x42')]);var _0x3d2a59={'where':_0x2000ba[_0x2cc5('0x3d')]};return db[_0x2cc5('0x2f')]['count'](_0x3d2a59)['then'](function(_0x585aee){_0x2950a6['count']=_0x585aee;if(_0xea7cac['query']['includeAll']){_0x2000ba[_0x2cc5('0x43')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x2cc5('0x44')](_0x2000ba);})[_0x2cc5('0x25')](function(_0x5431f3){_0x2950a6[_0x2cc5('0x45')]=_0x5431f3;return _0x2950a6;})[_0x2cc5('0x25')](respondWithFilteredResult(_0x3652b6,_0x2000ba))[_0x2cc5('0x46')](handleError(_0x3652b6,null));};exports['show']=function(_0x4cc022,_0x586b0c){var _0xc409cb={'raw':!![],'where':{'id':_0x4cc022[_0x2cc5('0x47')]['id']}},_0xc05cc9={};_0xc05cc9[_0x2cc5('0x33')]=_['keys'](db[_0x2cc5('0x2f')][_0x2cc5('0x48')]);_0xc05cc9[_0x2cc5('0x37')]=_[_0x2cc5('0x36')](_0x4cc022[_0x2cc5('0x37')]);_0xc05cc9[_0x2cc5('0x38')]=_[_0x2cc5('0x39')](_0xc05cc9[_0x2cc5('0x33')],_0xc05cc9[_0x2cc5('0x37')]);_0xc409cb[_0x2cc5('0x3a')]=_[_0x2cc5('0x39')](_0xc05cc9['model'],qs[_0x2cc5('0x3b')](_0x4cc022['query']['fields']));_0xc409cb[_0x2cc5('0x3a')]=_0xc409cb['attributes'][_0x2cc5('0x3c')]?_0xc409cb[_0x2cc5('0x3a')]:_0xc05cc9[_0x2cc5('0x33')];if(_0x4cc022[_0x2cc5('0x37')][_0x2cc5('0x49')]){_0xc409cb[_0x2cc5('0x43')]=[{'all':!![]}];}_0xc409cb=_[_0x2cc5('0x40')]({},_0xc409cb,_0x4cc022[_0x2cc5('0x42')]);return db[_0x2cc5('0x2f')][_0x2cc5('0x4a')](_0xc409cb)[_0x2cc5('0x25')](handleEntityNotFound(_0x586b0c,null))[_0x2cc5('0x25')](respondWithResult(_0x586b0c,null))['catch'](handleError(_0x586b0c,null));};exports['create']=function(_0x1e8738,_0x5b7722){return db['CmContactHasItem'][_0x2cc5('0x4b')](_0x1e8738['body'],{})['then'](function(_0x513a3d){var _0x22ef34=_0x1e8738[_0x2cc5('0x4c')]['get']({'plain':!![]});if(!_0x22ef34)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22ef34['role']===_0x2cc5('0x4c')){var _0x30f447=_0x513a3d['get']({'plain':!![]});var _0x559891=_0x2cc5('0x27');return db[_0x2cc5('0x4d')]['find']({'where':{'name':_0x559891,'userProfileId':_0x22ef34[_0x2cc5('0x4e')]},'raw':!![]})[_0x2cc5('0x25')](function(_0x19973){if(_0x19973&&_0x19973[_0x2cc5('0x4f')]===0x0){return db['UserProfileResource'][_0x2cc5('0x4b')]({'name':_0x30f447[_0x2cc5('0x35')],'resourceId':_0x30f447['id'],'type':_0x19973['name'],'sectionId':_0x19973['id']},{})[_0x2cc5('0x25')](function(){return _0x513a3d;});}else{return _0x513a3d;}})[_0x2cc5('0x46')](function(_0x53c3b0){logger[_0x2cc5('0x2b')](_0x2cc5('0x50'),_0x53c3b0);throw _0x53c3b0;});}return _0x513a3d;})[_0x2cc5('0x25')](respondWithResult(_0x5b7722,0xc9))['catch'](handleError(_0x5b7722,null));};exports[_0x2cc5('0x24')]=function(_0x5308b6,_0x1fbc52){if(_0x5308b6[_0x2cc5('0x51')]['id']){delete _0x5308b6['body']['id'];}return db[_0x2cc5('0x2f')][_0x2cc5('0x4a')]({'where':{'id':_0x5308b6[_0x2cc5('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fbc52,null))[_0x2cc5('0x25')](saveUpdates(_0x5308b6['body'],null))[_0x2cc5('0x25')](respondWithResult(_0x1fbc52,null))[_0x2cc5('0x46')](handleError(_0x1fbc52,null));};exports[_0x2cc5('0x29')]=function(_0x1476b8,_0x2d5c22){return db['CmContactHasItem']['find']({'where':{'id':_0x1476b8['params']['id']}})[_0x2cc5('0x25')](handleEntityNotFound(_0x2d5c22,null))['then'](removeEntity(_0x2d5c22,null))[_0x2cc5('0x46')](handleError(_0x2d5c22,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 822a4f1..0b45dbb 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 _0x8b62=['bluebird','request-promise','../../config/environment','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','util','../../config/logger','moment'];(function(_0x17f796,_0x557f6f){var _0x157823=function(_0x34f16b){while(--_0x34f16b){_0x17f796['push'](_0x17f796['shift']());}};_0x157823(++_0x557f6f);}(_0x8b62,0xa7));var _0x28b6=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x8b62[_0x5a7112];return _0x3147f7;};'use strict';var _=require('lodash');var util=require(_0x28b6('0x0'));var logger=require(_0x28b6('0x1'))('api');var moment=require(_0x28b6('0x2'));var BPromise=require(_0x28b6('0x3'));var rp=require(_0x28b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x28b6('0x5'));var attributes=require(_0x28b6('0x6'));module['exports']=function(_0x1af193,_0x38a25e){return _0x1af193[_0x28b6('0x7')](_0x28b6('0x8'),attributes,{'tableName':_0x28b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7136=['../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7136,0xe9));var _0x6713=function(_0x57ab74,_0x24e54b){_0x57ab74=_0x57ab74-0x0;var _0x1b4bff=_0x7136[_0x57ab74];return _0x1b4bff;};'use strict';var _=require('lodash');var util=require(_0x6713('0x0'));var logger=require(_0x6713('0x1'))(_0x6713('0x2'));var moment=require('moment');var BPromise=require(_0x6713('0x3'));var rp=require(_0x6713('0x4'));var fs=require('fs');var path=require(_0x6713('0x5'));var rimraf=require(_0x6713('0x6'));var config=require(_0x6713('0x7'));var attributes=require(_0x6713('0x8'));module[_0x6713('0x9')]=function(_0x2181e4,_0x51c908){return _0x2181e4['define'](_0x6713('0xa'),attributes,{'tableName':_0x6713('0xb'),'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 fd91bd3..93874be 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 _0xc06a=['CmContactHasItem,\x20%s,\x20%s','message','info','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x582c0a,_0x321711){var _0x14b27c=function(_0x1daf3c){while(--_0x1daf3c){_0x582c0a['push'](_0x582c0a['shift']());}};_0x14b27c(++_0x321711);}(_0xc06a,0x1a7));var _0xac06=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc06a[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xac06('0x0'));var moment=require(_0xac06('0x1'));var BPromise=require(_0xac06('0x2'));var rs=require(_0xac06('0x3'));var fs=require('fs');var Redis=require(_0xac06('0x4'));var db=require(_0xac06('0x5'))['db'];var utils=require(_0xac06('0x6'));var logger=require(_0xac06('0x7'))(_0xac06('0x8'));var config=require(_0xac06('0x9'));var jayson=require(_0xac06('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x510ea9,_0x40617a,_0x4052d0){return new BPromise(function(_0x4aa14a,_0x4c179f){return client[_0xac06('0xb')](_0x510ea9,_0x4052d0)['then'](function(_0x27a642){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x40617a,'request\x20sent');logger[_0xac06('0xc')](_0xac06('0xd'),_0x40617a,'request\x20sent',JSON[_0xac06('0xe')](_0x27a642));if(_0x27a642[_0xac06('0xf')]){if(_0x27a642[_0xac06('0xf')][_0xac06('0x10')]===0x1f4){logger[_0xac06('0xf')](_0xac06('0x11'),_0x40617a,_0x27a642[_0xac06('0xf')][_0xac06('0x12')]);return _0x4c179f(_0x27a642['error']['message']);}logger[_0xac06('0xf')](_0xac06('0x11'),_0x40617a,_0x27a642[_0xac06('0xf')][_0xac06('0x12')]);return _0x4aa14a(_0x27a642['error'][_0xac06('0x12')]);}else{logger[_0xac06('0x13')](_0xac06('0x11'),_0x40617a,_0xac06('0x14'));_0x4aa14a(_0x27a642['result']['message']);}})[_0xac06('0x15')](function(_0x17850c){logger[_0xac06('0xf')](_0xac06('0x11'),_0x40617a,_0x17850c);_0x4c179f(_0x17850c);});});} \ No newline at end of file +var _0x8c16=['request\x20sent','debug','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s'];(function(_0x5340c6,_0x4a088e){var _0x320c89=function(_0x2ab1a0){while(--_0x2ab1a0){_0x5340c6['push'](_0x5340c6['shift']());}};_0x320c89(++_0x4a088e);}(_0x8c16,0x1bd));var _0x68c1=function(_0x20e965,_0x4ff8a8){_0x20e965=_0x20e965-0x0;var _0x3dba23=_0x8c16[_0x20e965];return _0x3dba23;};'use strict';var _=require(_0x68c1('0x0'));var util=require(_0x68c1('0x1'));var moment=require(_0x68c1('0x2'));var BPromise=require(_0x68c1('0x3'));var rs=require(_0x68c1('0x4'));var fs=require('fs');var Redis=require(_0x68c1('0x5'));var db=require(_0x68c1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x68c1('0x7'));var config=require(_0x68c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x68c1('0x9')][_0x68c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c8e8a,_0x2a463e,_0x34cc8e){return new BPromise(function(_0x3792d6,_0x1ab57a){return client[_0x68c1('0xb')](_0x3c8e8a,_0x34cc8e)[_0x68c1('0xc')](function(_0x1ab3d4){logger[_0x68c1('0xd')](_0x68c1('0xe'),_0x2a463e,_0x68c1('0xf'));logger[_0x68c1('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x2a463e,_0x68c1('0xf'),JSON['stringify'](_0x1ab3d4));if(_0x1ab3d4[_0x68c1('0x11')]){if(_0x1ab3d4[_0x68c1('0x11')]['code']===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x2a463e,_0x1ab3d4[_0x68c1('0x11')][_0x68c1('0x12')]);return _0x1ab57a(_0x1ab3d4[_0x68c1('0x11')][_0x68c1('0x12')]);}logger[_0x68c1('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x2a463e,_0x1ab3d4[_0x68c1('0x11')]['message']);return _0x3792d6(_0x1ab3d4[_0x68c1('0x11')]['message']);}else{logger[_0x68c1('0xd')](_0x68c1('0xe'),_0x2a463e,_0x68c1('0xf'));_0x3792d6(_0x1ab3d4[_0x68c1('0x13')][_0x68c1('0x12')]);}})['catch'](function(_0x28b3a7){logger[_0x68c1('0x11')](_0x68c1('0xe'),_0x2a463e,_0x28b3a7);_0x1ab57a(_0x28b3a7);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 1c712da..ba2c377 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 _0x737c=['../../config/environment','get','index','/:id','show','put','isAuthenticated','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32e214,_0x2bd07d){var _0x553540=function(_0x15cd24){while(--_0x15cd24){_0x32e214['push'](_0x32e214['shift']());}};_0x553540(++_0x2bd07d);}(_0x737c,0x14d));var _0xc737=function(_0xaa8a12,_0x4b02fa){_0xaa8a12=_0xaa8a12-0x0;var _0xe8546e=_0x737c[_0xaa8a12];return _0xe8546e;};'use strict';var multer=require('multer');var util=require(_0xc737('0x0'));var path=require(_0xc737('0x1'));var timeout=require('connect-timeout');var express=require(_0xc737('0x2'));var router=express[_0xc737('0x3')]();var fs_extra=require(_0xc737('0x4'));var auth=require(_0xc737('0x5'));var interaction=require(_0xc737('0x6'));var config=require(_0xc737('0x7'));var controller=require('./cmContactHasItem.controller');router[_0xc737('0x8')]('/',auth['isAuthenticated'](),controller[_0xc737('0x9')]);router[_0xc737('0x8')](_0xc737('0xa'),auth['isAuthenticated'](),controller[_0xc737('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc737('0xc')](_0xc737('0xa'),auth[_0xc737('0xd')](),controller[_0xc737('0xe')]);router[_0xc737('0xf')](_0xc737('0xa'),auth[_0xc737('0xd')](),controller[_0xc737('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0a02=['../../components/interaction/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x46d29c,_0x1be3e8){var _0x587627=function(_0x12cea4){while(--_0x12cea4){_0x46d29c['push'](_0x46d29c['shift']());}};_0x587627(++_0x1be3e8);}(_0x0a02,0x161));var _0x20a0=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x0a02[_0x24259d];return _0x5a701;};'use strict';var multer=require(_0x20a0('0x0'));var util=require('util');var path=require(_0x20a0('0x1'));var timeout=require(_0x20a0('0x2'));var express=require(_0x20a0('0x3'));var router=express[_0x20a0('0x4')]();var fs_extra=require(_0x20a0('0x5'));var auth=require(_0x20a0('0x6'));var interaction=require(_0x20a0('0x7'));var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0x20a0('0x8')]('/',auth[_0x20a0('0x9')](),controller[_0x20a0('0xa')]);router[_0x20a0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x20a0('0xb')]);router[_0x20a0('0xc')]('/',auth[_0x20a0('0x9')](),controller[_0x20a0('0xd')]);router[_0x20a0('0xe')](_0x20a0('0xf'),auth[_0x20a0('0x9')](),controller[_0x20a0('0x10')]);router[_0x20a0('0x11')]('/:id',auth[_0x20a0('0x9')](),controller[_0x20a0('0x12')]);module[_0x20a0('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index eb3f7d8..16d672a 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 _0xc46c=['setDataValue','stringify','BOOLEAN','ENUM','voice','STRING','alias','name','TEXT','type','select','parse','getDataValue','values','isArray'];(function(_0x49ea93,_0x5850a3){var _0x209b93=function(_0x3e97c8){while(--_0x3e97c8){_0x49ea93['push'](_0x49ea93['shift']());}};_0x209b93(++_0x5850a3);}(_0xc46c,0x15e));var _0xcc46=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xc46c[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x59c837){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xcc46('0x0')],'allowNull':![],'set':function(_0x1b36c0){this['setDataValue'](_0xcc46('0x1'),_0x1b36c0?_0x1b36c0:this['getDataValue'](_0xcc46('0x2')));}},'type':{'type':Sequelize[_0xcc46('0x0')],'allowNull':![]},'values':{'type':Sequelize[_0xcc46('0x3')]('long'),'get':function(){if(this['getDataValue'](_0xcc46('0x4'))===_0xcc46('0x5')){return JSON[_0xcc46('0x6')](this[_0xcc46('0x7')](_0xcc46('0x8')));}else{return this[_0xcc46('0x7')](_0xcc46('0x8'));}},'set':function(_0x3b278e){if(Array[_0xcc46('0x9')](_0x3b278e)){this[_0xcc46('0xa')](_0xcc46('0x8'),JSON[_0xcc46('0xb')](_0x3b278e));}else{this[_0xcc46('0xa')](_0xcc46('0x8'),_0x3b278e);}}},'required':{'type':Sequelize[_0xcc46('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xcc46('0xd')](_0xcc46('0xe'))}}; \ No newline at end of file +var _0x1312=['isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','TEXT','long','select','parse','values'];(function(_0x4923e6,_0x5468a4){var _0x543a4e=function(_0xe8f83a){while(--_0xe8f83a){_0x4923e6['push'](_0x4923e6['shift']());}};_0x543a4e(++_0x5468a4);}(_0x1312,0x15a));var _0x2131=function(_0xd723,_0x164010){_0xd723=_0xd723-0x0;var _0x5179d2=_0x1312[_0xd723];return _0x5179d2;};'use strict';var Sequelize=require(_0x2131('0x0'));var _=require('lodash');module[_0x2131('0x1')]={'name':{'type':Sequelize[_0x2131('0x2')],'get':function(_0x55b4f3){return this[_0x2131('0x3')](_0x2131('0x4'));}},'alias':{'type':Sequelize[_0x2131('0x5')],'allowNull':![],'set':function(_0x42f923){this['setDataValue']('alias',_0x42f923?_0x42f923:this[_0x2131('0x3')]('name'));}},'type':{'type':Sequelize[_0x2131('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x2131('0x6')](_0x2131('0x7')),'get':function(){if(this[_0x2131('0x3')]('type')===_0x2131('0x8')){return JSON[_0x2131('0x9')](this['getDataValue'](_0x2131('0xa')));}else{return this[_0x2131('0x3')](_0x2131('0xa'));}},'set':function(_0x9bd3f9){if(Array[_0x2131('0xb')](_0x9bd3f9)){this[_0x2131('0xc')](_0x2131('0xa'),JSON[_0x2131('0xd')](_0x9bd3f9));}else{this['setDataValue'](_0x2131('0xa'),_0x9bd3f9);}}},'required':{'type':Sequelize[_0x2131('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x2131('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2131('0xf')](_0x2131('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d2ab890..5ec9c27 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 _0xc179=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','catch','body','create','sequelize','transaction','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','CmCustomField','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields'];(function(_0x1da492,_0x10a69b){var _0x91828f=function(_0x869446){while(--_0x869446){_0x1da492['push'](_0x1da492['shift']());}};_0x91828f(++_0x10a69b);}(_0xc179,0xcf));var _0x9c17=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0xc179[_0x11e03f];return _0x5666fe;};'use strict';var emlformat=require(_0x9c17('0x0'));var rimraf=require(_0x9c17('0x1'));var zipdir=require(_0x9c17('0x2'));var jsonpatch=require(_0x9c17('0x3'));var rp=require(_0x9c17('0x4'));var moment=require(_0x9c17('0x5'));var BPromise=require(_0x9c17('0x6'));var Mustache=require(_0x9c17('0x7'));var util=require(_0x9c17('0x8'));var path=require(_0x9c17('0x9'));var sox=require('sox');var csv=require(_0x9c17('0xa'));var ejs=require(_0x9c17('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c17('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9c17('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9c17('0xe'));var Papa=require(_0x9c17('0xf'));var Redis=require(_0x9c17('0x10'));var authService=require(_0x9c17('0x11'));var qs=require(_0x9c17('0x12'));var as=require(_0x9c17('0x13'));var hardwareService=require(_0x9c17('0x14'));var logger=require(_0x9c17('0x15'))(_0x9c17('0x16'));var utils=require(_0x9c17('0x17'));var config=require(_0x9c17('0x18'));var licenseUtil=require(_0x9c17('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3abce1,_0x1d3bd9){_0x1d3bd9=_0x1d3bd9||0xcc;return function(_0x3e2b6b){if(_0x3e2b6b){return _0x3abce1[_0x9c17('0x1a')](_0x1d3bd9);}return _0x3abce1[_0x9c17('0x1b')](_0x1d3bd9)[_0x9c17('0x1c')]();};}function respondWithResult(_0x3e4902,_0x327ab8){_0x327ab8=_0x327ab8||0xc8;return function(_0x18bb7f){if(_0x18bb7f){return _0x3e4902[_0x9c17('0x1b')](_0x327ab8)[_0x9c17('0x1d')](_0x18bb7f);}};}function respondWithFilteredResult(_0x214ee2,_0x3c9cfc){return function(_0x150b8e){if(_0x150b8e){var _0x1072c3=typeof _0x3c9cfc['offset']===_0x9c17('0x1e')&&typeof _0x3c9cfc[_0x9c17('0x1f')]===_0x9c17('0x1e');var _0x537066=_0x150b8e[_0x9c17('0x20')];var _0x2f1561=_0x1072c3?0x0:_0x3c9cfc[_0x9c17('0x21')];var _0x3e4ebb=_0x1072c3?_0x150b8e[_0x9c17('0x20')]:_0x3c9cfc[_0x9c17('0x21')]+_0x3c9cfc[_0x9c17('0x1f')];var _0x1c6581;if(_0x3e4ebb>=_0x537066){_0x3e4ebb=_0x537066;_0x1c6581=0xc8;}else{_0x1c6581=0xce;}_0x214ee2[_0x9c17('0x1b')](_0x1c6581);return _0x214ee2['set'](_0x9c17('0x22'),_0x2f1561+'-'+_0x3e4ebb+'/'+_0x537066)[_0x9c17('0x1d')](_0x150b8e);}return null;};}function patchUpdates(_0x264978){return function(_0xc0845c){try{jsonpatch[_0x9c17('0x23')](_0xc0845c,_0x264978,!![]);}catch(_0x5d2159){return BPromise[_0x9c17('0x24')](_0x5d2159);}return _0xc0845c[_0x9c17('0x25')]();};}function saveUpdates(_0x14daf8,_0x2740bf){return function(_0xa759){if(_0xa759){return _0xa759[_0x9c17('0x26')](_0x14daf8)['then'](function(_0x2047ab){return _0x2047ab;});}return null;};}function removeEntity(_0x591f3e,_0x4a204e){return function(_0x8e572f){if(_0x8e572f){return _0x8e572f['destroy']()[_0x9c17('0x27')](function(){_0x591f3e[_0x9c17('0x1b')](0xcc)[_0x9c17('0x1c')]();});}};}function handleEntityNotFound(_0x4d451a,_0x46f056){return function(_0x274642){if(!_0x274642){_0x4d451a[_0x9c17('0x1a')](0x194);}return _0x274642;};}function handleError(_0x4481c5,_0x127c59){_0x127c59=_0x127c59||0x1f4;return function(_0x3034cb){logger[_0x9c17('0x28')](_0x3034cb[_0x9c17('0x29')]);if(_0x3034cb['name']){delete _0x3034cb[_0x9c17('0x2a')];}_0x4481c5[_0x9c17('0x1b')](_0x127c59)[_0x9c17('0x2b')](_0x3034cb);};}exports['index']=function(_0x563ded,_0x530adc){var _0x3a97a3={},_0x23f53c={},_0x308e18={'count':0x0,'rows':[]};var _0x2e7f10=_['map'](db[_0x9c17('0x2c')][_0x9c17('0x2d')],function(_0x523b06){return{'name':_0x523b06[_0x9c17('0x2e')],'type':_0x523b06[_0x9c17('0x2f')][_0x9c17('0x30')]};});_0x23f53c['model']=_['differenceBy'](_[_0x9c17('0x31')](_0x2e7f10,_0x9c17('0x2a')),[_0x9c17('0x2a')]);_0x23f53c[_0x9c17('0x32')]=_[_0x9c17('0x33')](_0x563ded['query']);_0x23f53c[_0x9c17('0x34')]=_['intersection'](_0x23f53c[_0x9c17('0x35')],_0x23f53c[_0x9c17('0x32')]);_0x3a97a3[_0x9c17('0x36')]=_[_0x9c17('0x37')](_0x23f53c[_0x9c17('0x35')],qs[_0x9c17('0x38')](_0x563ded[_0x9c17('0x32')][_0x9c17('0x38')]));_0x3a97a3[_0x9c17('0x36')]=_0x3a97a3[_0x9c17('0x36')]['length']?_0x3a97a3[_0x9c17('0x36')]:_0x23f53c[_0x9c17('0x35')];if(!_0x563ded['query']['hasOwnProperty']('nolimit')){_0x3a97a3[_0x9c17('0x1f')]=qs[_0x9c17('0x1f')](_0x563ded[_0x9c17('0x32')][_0x9c17('0x1f')]);_0x3a97a3[_0x9c17('0x21')]=qs['offset'](_0x563ded[_0x9c17('0x32')][_0x9c17('0x21')]);}_0x3a97a3[_0x9c17('0x39')]=qs[_0x9c17('0x3a')](_0x563ded[_0x9c17('0x32')][_0x9c17('0x3a')]);_0x3a97a3[_0x9c17('0x3b')]=qs[_0x9c17('0x34')](_[_0x9c17('0x3c')](_0x563ded[_0x9c17('0x32')],_0x23f53c['filters']),_0x2e7f10);if(_0x563ded['query'][_0x9c17('0x3d')]){_0x3a97a3[_0x9c17('0x3b')]=_[_0x9c17('0x3e')](_0x3a97a3[_0x9c17('0x3b')],{'$or':_[_0x9c17('0x31')](_0x2e7f10,function(_0x30fd93){if(_0x30fd93[_0x9c17('0x2f')]!==_0x9c17('0x3f')){var _0x54cb4c={};_0x54cb4c[_0x30fd93[_0x9c17('0x2a')]]={'$like':'%'+_0x563ded['query']['filter']+'%'};return _0x54cb4c;}})});}_0x3a97a3=_['merge']({},_0x3a97a3,_0x563ded[_0x9c17('0x40')]);var _0x142040={'where':_0x3a97a3[_0x9c17('0x3b')]};return db[_0x9c17('0x2c')][_0x9c17('0x20')](_0x142040)[_0x9c17('0x27')](function(_0x4180ab){_0x308e18[_0x9c17('0x20')]=_0x4180ab;if(_0x563ded[_0x9c17('0x32')][_0x9c17('0x41')]){_0x3a97a3['include']=[{'all':!![]}];}return db['CmCustomField'][_0x9c17('0x42')](_0x3a97a3);})[_0x9c17('0x27')](function(_0x43f940){_0x308e18[_0x9c17('0x43')]=_0x43f940;return _0x308e18;})[_0x9c17('0x27')](respondWithFilteredResult(_0x530adc,_0x3a97a3))['catch'](handleError(_0x530adc,null));};exports[_0x9c17('0x44')]=function(_0x57ca4b,_0x297e22){var _0x2315e8={'raw':!![],'where':{'id':_0x57ca4b[_0x9c17('0x45')]['id']}},_0x4310fb={};_0x4310fb['model']=_['keys'](db[_0x9c17('0x2c')][_0x9c17('0x2d')]);_0x4310fb['query']=_[_0x9c17('0x33')](_0x57ca4b[_0x9c17('0x32')]);_0x4310fb[_0x9c17('0x34')]=_[_0x9c17('0x37')](_0x4310fb[_0x9c17('0x35')],_0x4310fb[_0x9c17('0x32')]);_0x2315e8[_0x9c17('0x36')]=_[_0x9c17('0x37')](_0x4310fb[_0x9c17('0x35')],qs[_0x9c17('0x38')](_0x57ca4b['query'][_0x9c17('0x38')]));_0x2315e8[_0x9c17('0x36')]=_0x2315e8[_0x9c17('0x36')][_0x9c17('0x46')]?_0x2315e8[_0x9c17('0x36')]:_0x4310fb['model'];if(_0x57ca4b[_0x9c17('0x32')][_0x9c17('0x41')]){_0x2315e8[_0x9c17('0x47')]=[{'all':!![]}];}_0x2315e8=_['merge']({},_0x2315e8,_0x57ca4b[_0x9c17('0x40')]);return db[_0x9c17('0x2c')][_0x9c17('0x48')](_0x2315e8)['then'](handleEntityNotFound(_0x297e22,null))[_0x9c17('0x27')](respondWithResult(_0x297e22,null))[_0x9c17('0x49')](handleError(_0x297e22,null));};exports['update']=function(_0x3eae63,_0xa3ab30){if(_0x3eae63[_0x9c17('0x4a')]['id']){delete _0x3eae63['body']['id'];}return db[_0x9c17('0x2c')][_0x9c17('0x48')]({'where':{'id':_0x3eae63[_0x9c17('0x45')]['id']}})[_0x9c17('0x27')](handleEntityNotFound(_0xa3ab30,null))[_0x9c17('0x27')](saveUpdates(_0x3eae63['body'],null))[_0x9c17('0x27')](respondWithResult(_0xa3ab30,null))['catch'](handleError(_0xa3ab30,null));};exports['destroy']=function(_0x1ad143,_0x2aaad5){return db[_0x9c17('0x2c')][_0x9c17('0x48')]({'where':{'id':_0x1ad143[_0x9c17('0x45')]['id']}})[_0x9c17('0x27')](handleEntityNotFound(_0x2aaad5,null))[_0x9c17('0x27')](removeEntity(_0x2aaad5,null))['catch'](handleError(_0x2aaad5,null));};exports[_0x9c17('0x4b')]=function(_0x2cf201,_0x193eb7){var _0x30571d;return db[_0x9c17('0x4c')][_0x9c17('0x4d')](function(_0x46ff1d){return db[_0x9c17('0x2c')][_0x9c17('0x4b')](_0x2cf201['body'],{'transaction':_0x46ff1d})[_0x9c17('0x27')](function(_0x1e3295){_0x30571d=_0x1e3295;var _0x2cf157={'type':db['Sequelize'][_0x9c17('0x4e')],'transaction':_0x46ff1d};switch(_0x2cf201['body']['type']){case _0x9c17('0x4f'):_0x2cf157[_0x9c17('0x2f')]=db['Sequelize'][_0x9c17('0x4e')];break;case'number':_0x2cf157[_0x9c17('0x2f')]=db[_0x9c17('0x50')][_0x9c17('0x51')];break;case _0x9c17('0x52'):_0x2cf157[_0x9c17('0x2f')]=db[_0x9c17('0x50')][_0x9c17('0x53')];_0x2cf157[_0x9c17('0x54')]=![];break;default:}return db[_0x9c17('0x4c')]['queryInterface'][_0x9c17('0x55')]('cm_contacts',util[_0x9c17('0x56')](_0x9c17('0x57'),_0x30571d['id']),_0x2cf157);})[_0x9c17('0x27')](function(){return _0x30571d;});})[_0x9c17('0x27')](respondWithResult(_0x193eb7,0xc9))[_0x9c17('0x49')](handleError(_0x193eb7,null));}; \ No newline at end of file +var _0x2e51=['fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','rows','params','find','catch','body','create','transaction','Sequelize','text','TEXT','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','destroy','then','stack','name','index','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','map','query','keys','filters','intersection','attributes'];(function(_0xb092a,_0x49d186){var _0x10e43f=function(_0x210967){while(--_0x210967){_0xb092a['push'](_0xb092a['shift']());}};_0x10e43f(++_0x49d186);}(_0x2e51,0xc0));var _0x12e5=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2e51[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x12e5('0x0'));var rimraf=require(_0x12e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12e5('0x2'));var rp=require(_0x12e5('0x3'));var moment=require('moment');var BPromise=require(_0x12e5('0x4'));var Mustache=require(_0x12e5('0x5'));var util=require(_0x12e5('0x6'));var path=require(_0x12e5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x12e5('0x8'));var fs=require('fs');var fs_extra=require(_0x12e5('0x9'));var _=require(_0x12e5('0xa'));var squel=require(_0x12e5('0xb'));var crypto=require(_0x12e5('0xc'));var jsforce=require(_0x12e5('0xd'));var deskjs=require(_0x12e5('0xe'));var toCsv=require(_0x12e5('0xf'));var querystring=require(_0x12e5('0x10'));var Papa=require(_0x12e5('0x11'));var Redis=require(_0x12e5('0x12'));var authService=require(_0x12e5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x12e5('0x14'));var hardwareService=require(_0x12e5('0x15'));var logger=require('../../config/logger')(_0x12e5('0x16'));var utils=require(_0x12e5('0x17'));var config=require(_0x12e5('0x18'));var licenseUtil=require(_0x12e5('0x19'));var db=require(_0x12e5('0x1a'))['db'];function respondWithStatusCode(_0x29a886,_0xe2f4c4){_0xe2f4c4=_0xe2f4c4||0xcc;return function(_0x5b3ed1){if(_0x5b3ed1){return _0x29a886[_0x12e5('0x1b')](_0xe2f4c4);}return _0x29a886[_0x12e5('0x1c')](_0xe2f4c4)['end']();};}function respondWithResult(_0x175912,_0x2a1304){_0x2a1304=_0x2a1304||0xc8;return function(_0x4226bf){if(_0x4226bf){return _0x175912[_0x12e5('0x1c')](_0x2a1304)[_0x12e5('0x1d')](_0x4226bf);}};}function respondWithFilteredResult(_0x5bb827,_0x34d21b){return function(_0x32b5a5){if(_0x32b5a5){var _0x28119b=typeof _0x34d21b[_0x12e5('0x1e')]===_0x12e5('0x1f')&&typeof _0x34d21b[_0x12e5('0x20')]===_0x12e5('0x1f');var _0x5d9b65=_0x32b5a5[_0x12e5('0x21')];var _0x5c56fe=_0x28119b?0x0:_0x34d21b[_0x12e5('0x1e')];var _0x22ddfa=_0x28119b?_0x32b5a5[_0x12e5('0x21')]:_0x34d21b['offset']+_0x34d21b[_0x12e5('0x20')];var _0x33925f;if(_0x22ddfa>=_0x5d9b65){_0x22ddfa=_0x5d9b65;_0x33925f=0xc8;}else{_0x33925f=0xce;}_0x5bb827[_0x12e5('0x1c')](_0x33925f);return _0x5bb827[_0x12e5('0x22')]('Content-Range',_0x5c56fe+'-'+_0x22ddfa+'/'+_0x5d9b65)[_0x12e5('0x1d')](_0x32b5a5);}return null;};}function patchUpdates(_0x2a59c7){return function(_0x2cfd58){try{jsonpatch[_0x12e5('0x23')](_0x2cfd58,_0x2a59c7,!![]);}catch(_0x1cda21){return BPromise['reject'](_0x1cda21);}return _0x2cfd58['save']();};}function saveUpdates(_0x41b48b,_0x2a5442){return function(_0xb2ecca){if(_0xb2ecca){return _0xb2ecca[_0x12e5('0x24')](_0x41b48b)['then'](function(_0xe0b7ef){return _0xe0b7ef;});}return null;};}function removeEntity(_0x5b8c9d,_0x425abf){return function(_0x4ab773){if(_0x4ab773){return _0x4ab773[_0x12e5('0x25')]()[_0x12e5('0x26')](function(){_0x5b8c9d[_0x12e5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x412e18,_0x145082){return function(_0x2bdeff){if(!_0x2bdeff){_0x412e18[_0x12e5('0x1b')](0x194);}return _0x2bdeff;};}function handleError(_0x3b414d,_0x39fffc){_0x39fffc=_0x39fffc||0x1f4;return function(_0x5993b7){logger['error'](_0x5993b7[_0x12e5('0x27')]);if(_0x5993b7[_0x12e5('0x28')]){delete _0x5993b7['name'];}_0x3b414d['status'](_0x39fffc)['send'](_0x5993b7);};}exports[_0x12e5('0x29')]=function(_0x54369c,_0x521b71){var _0xa30ac1={},_0x5da10e={},_0x32ab3b={'count':0x0,'rows':[]};var _0x5cb102=_['map'](db[_0x12e5('0x2a')][_0x12e5('0x2b')],function(_0x5a4a40){return{'name':_0x5a4a40[_0x12e5('0x2c')],'type':_0x5a4a40['type'][_0x12e5('0x2d')]};});_0x5da10e[_0x12e5('0x2e')]=_[_0x12e5('0x2f')](_[_0x12e5('0x30')](_0x5cb102,_0x12e5('0x28')),[_0x12e5('0x28')]);_0x5da10e[_0x12e5('0x31')]=_[_0x12e5('0x32')](_0x54369c[_0x12e5('0x31')]);_0x5da10e[_0x12e5('0x33')]=_[_0x12e5('0x34')](_0x5da10e[_0x12e5('0x2e')],_0x5da10e['query']);_0xa30ac1[_0x12e5('0x35')]=_[_0x12e5('0x34')](_0x5da10e[_0x12e5('0x2e')],qs['fields'](_0x54369c[_0x12e5('0x31')][_0x12e5('0x36')]));_0xa30ac1[_0x12e5('0x35')]=_0xa30ac1[_0x12e5('0x35')][_0x12e5('0x37')]?_0xa30ac1[_0x12e5('0x35')]:_0x5da10e['model'];if(!_0x54369c[_0x12e5('0x31')]['hasOwnProperty']('nolimit')){_0xa30ac1[_0x12e5('0x20')]=qs[_0x12e5('0x20')](_0x54369c['query'][_0x12e5('0x20')]);_0xa30ac1['offset']=qs['offset'](_0x54369c[_0x12e5('0x31')][_0x12e5('0x1e')]);}_0xa30ac1[_0x12e5('0x38')]=qs[_0x12e5('0x39')](_0x54369c[_0x12e5('0x31')][_0x12e5('0x39')]);_0xa30ac1[_0x12e5('0x3a')]=qs['filters'](_[_0x12e5('0x3b')](_0x54369c['query'],_0x5da10e[_0x12e5('0x33')]),_0x5cb102);if(_0x54369c[_0x12e5('0x31')][_0x12e5('0x3c')]){_0xa30ac1[_0x12e5('0x3a')]=_[_0x12e5('0x3d')](_0xa30ac1[_0x12e5('0x3a')],{'$or':_['map'](_0x5cb102,function(_0x18ff1f){if(_0x18ff1f[_0x12e5('0x3e')]!==_0x12e5('0x3f')){var _0x33f73b={};_0x33f73b[_0x18ff1f[_0x12e5('0x28')]]={'$like':'%'+_0x54369c[_0x12e5('0x31')][_0x12e5('0x3c')]+'%'};return _0x33f73b;}})});}_0xa30ac1=_[_0x12e5('0x3d')]({},_0xa30ac1,_0x54369c[_0x12e5('0x40')]);var _0x59a350={'where':_0xa30ac1[_0x12e5('0x3a')]};return db[_0x12e5('0x2a')][_0x12e5('0x21')](_0x59a350)[_0x12e5('0x26')](function(_0x32d957){_0x32ab3b[_0x12e5('0x21')]=_0x32d957;if(_0x54369c[_0x12e5('0x31')]['includeAll']){_0xa30ac1['include']=[{'all':!![]}];}return db[_0x12e5('0x2a')]['findAll'](_0xa30ac1);})[_0x12e5('0x26')](function(_0x3dc38c){_0x32ab3b[_0x12e5('0x41')]=_0x3dc38c;return _0x32ab3b;})['then'](respondWithFilteredResult(_0x521b71,_0xa30ac1))['catch'](handleError(_0x521b71,null));};exports['show']=function(_0x42ee27,_0x52c1fd){var _0x5f5cfe={'raw':!![],'where':{'id':_0x42ee27[_0x12e5('0x42')]['id']}},_0x5a5d8d={};_0x5a5d8d[_0x12e5('0x2e')]=_[_0x12e5('0x32')](db['CmCustomField'][_0x12e5('0x2b')]);_0x5a5d8d['query']=_['keys'](_0x42ee27[_0x12e5('0x31')]);_0x5a5d8d['filters']=_[_0x12e5('0x34')](_0x5a5d8d['model'],_0x5a5d8d[_0x12e5('0x31')]);_0x5f5cfe['attributes']=_['intersection'](_0x5a5d8d['model'],qs[_0x12e5('0x36')](_0x42ee27[_0x12e5('0x31')][_0x12e5('0x36')]));_0x5f5cfe[_0x12e5('0x35')]=_0x5f5cfe[_0x12e5('0x35')][_0x12e5('0x37')]?_0x5f5cfe[_0x12e5('0x35')]:_0x5a5d8d[_0x12e5('0x2e')];if(_0x42ee27[_0x12e5('0x31')]['includeAll']){_0x5f5cfe['include']=[{'all':!![]}];}_0x5f5cfe=_['merge']({},_0x5f5cfe,_0x42ee27[_0x12e5('0x40')]);return db[_0x12e5('0x2a')][_0x12e5('0x43')](_0x5f5cfe)['then'](handleEntityNotFound(_0x52c1fd,null))[_0x12e5('0x26')](respondWithResult(_0x52c1fd,null))[_0x12e5('0x44')](handleError(_0x52c1fd,null));};exports[_0x12e5('0x24')]=function(_0xdc093b,_0x52cee4){if(_0xdc093b[_0x12e5('0x45')]['id']){delete _0xdc093b[_0x12e5('0x45')]['id'];}return db[_0x12e5('0x2a')][_0x12e5('0x43')]({'where':{'id':_0xdc093b[_0x12e5('0x42')]['id']}})[_0x12e5('0x26')](handleEntityNotFound(_0x52cee4,null))['then'](saveUpdates(_0xdc093b[_0x12e5('0x45')],null))['then'](respondWithResult(_0x52cee4,null))[_0x12e5('0x44')](handleError(_0x52cee4,null));};exports['destroy']=function(_0x531ed9,_0x4d9980){return db[_0x12e5('0x2a')][_0x12e5('0x43')]({'where':{'id':_0x531ed9[_0x12e5('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d9980,null))[_0x12e5('0x26')](removeEntity(_0x4d9980,null))['catch'](handleError(_0x4d9980,null));};exports[_0x12e5('0x46')]=function(_0x1c7857,_0x124ee8){var _0x11fe67;return db['sequelize'][_0x12e5('0x47')](function(_0x14b0e3){return db[_0x12e5('0x2a')][_0x12e5('0x46')](_0x1c7857[_0x12e5('0x45')],{'transaction':_0x14b0e3})[_0x12e5('0x26')](function(_0x463163){_0x11fe67=_0x463163;var _0x5573d4={'type':db[_0x12e5('0x48')]['TEXT'],'transaction':_0x14b0e3};switch(_0x1c7857[_0x12e5('0x45')][_0x12e5('0x3e')]){case _0x12e5('0x49'):_0x5573d4['type']=db[_0x12e5('0x48')][_0x12e5('0x4a')];break;case'number':_0x5573d4[_0x12e5('0x3e')]=db[_0x12e5('0x48')][_0x12e5('0x4b')];break;case _0x12e5('0x4c'):_0x5573d4[_0x12e5('0x3e')]=db['Sequelize']['BOOLEAN'];_0x5573d4[_0x12e5('0x4d')]=![];break;default:}return db['sequelize'][_0x12e5('0x4e')][_0x12e5('0x4f')](_0x12e5('0x50'),util['format'](_0x12e5('0x51'),_0x11fe67['id']),_0x5573d4);})['then'](function(){return _0x11fe67;});})[_0x12e5('0x26')](respondWithResult(_0x124ee8,0xc9))[_0x12e5('0x44')](handleError(_0x124ee8,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index c669564..1cb3f55 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 _0x07a8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util'];(function(_0xde142b,_0x40682c){var _0x4c9561=function(_0x482312){while(--_0x482312){_0xde142b['push'](_0xde142b['shift']());}};_0x4c9561(++_0x40682c);}(_0x07a8,0x73));var _0x807a=function(_0x74eb8c,_0x3ac119){_0x74eb8c=_0x74eb8c-0x0;var _0x28760a=_0x07a8[_0x74eb8c];return _0x28760a;};'use strict';var _=require(_0x807a('0x0'));var util=require(_0x807a('0x1'));var logger=require(_0x807a('0x2'))(_0x807a('0x3'));var moment=require(_0x807a('0x4'));var BPromise=require(_0x807a('0x5'));var rp=require(_0x807a('0x6'));var fs=require('fs');var path=require(_0x807a('0x7'));var rimraf=require(_0x807a('0x8'));var config=require('../../config/environment');var attributes=require(_0x807a('0x9'));module[_0x807a('0xa')]=function(_0x63350b,_0x3852fa){return _0x63350b[_0x807a('0xb')]('CmCustomField',attributes,{'tableName':_0x807a('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x676a=['util','api','moment','bluebird','request-promise','path','exports','define','CmCustomField','cm_custom_fields','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x676a,0x1ee));var _0xa676=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x676a[_0x10dc60];return _0x47dec5;};'use strict';var _=require(_0xa676('0x0'));var util=require(_0xa676('0x1'));var logger=require('../../config/logger')(_0xa676('0x2'));var moment=require(_0xa676('0x3'));var BPromise=require(_0xa676('0x4'));var rp=require(_0xa676('0x5'));var fs=require('fs');var path=require(_0xa676('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0xa676('0x7')]=function(_0x13bbca,_0x4f8ed4){return _0x13bbca[_0xa676('0x8')](_0xa676('0x9'),attributes,{'tableName':_0xa676('0xa'),'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 1af8aa3..5b0f090 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 _0x963c=['http','request','then','info','debug','request\x20sent','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x357c0d,_0x5e8001){var _0x3ef40a=function(_0x37af1a){while(--_0x37af1a){_0x357c0d['push'](_0x357c0d['shift']());}};_0x3ef40a(++_0x5e8001);}(_0x963c,0x90));var _0xc963=function(_0x5bd3f2,_0x49f10b){_0x5bd3f2=_0x5bd3f2-0x0;var _0x444bfb=_0x963c[_0x5bd3f2];return _0x444bfb;};'use strict';var _=require('lodash');var util=require(_0xc963('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc963('0x1'));var fs=require('fs');var Redis=require(_0xc963('0x2'));var db=require(_0xc963('0x3'))['db'];var utils=require(_0xc963('0x4'));var logger=require(_0xc963('0x5'))(_0xc963('0x6'));var config=require(_0xc963('0x7'));var jayson=require(_0xc963('0x8'));var client=jayson[_0xc963('0x9')][_0xc963('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b8680,_0x51239c,_0x2073df){return new BPromise(function(_0x37e5ad,_0x1bec13){return client[_0xc963('0xb')](_0x1b8680,_0x2073df)[_0xc963('0xc')](function(_0x5c22fd){logger[_0xc963('0xd')]('CmCustomField,\x20%s,\x20%s',_0x51239c,'request\x20sent');logger[_0xc963('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x51239c,_0xc963('0xf'),JSON['stringify'](_0x5c22fd));if(_0x5c22fd[_0xc963('0x10')]){if(_0x5c22fd[_0xc963('0x10')][_0xc963('0x11')]===0x1f4){logger[_0xc963('0x10')](_0xc963('0x12'),_0x51239c,_0x5c22fd[_0xc963('0x10')][_0xc963('0x13')]);return _0x1bec13(_0x5c22fd[_0xc963('0x10')][_0xc963('0x13')]);}logger[_0xc963('0x10')]('CmCustomField,\x20%s,\x20%s',_0x51239c,_0x5c22fd[_0xc963('0x10')][_0xc963('0x13')]);return _0x37e5ad(_0x5c22fd['error'][_0xc963('0x13')]);}else{logger[_0xc963('0xd')](_0xc963('0x12'),_0x51239c,_0xc963('0xf'));_0x37e5ad(_0x5c22fd[_0xc963('0x14')][_0xc963('0x13')]);}})[_0xc963('0x15')](function(_0x461a31){logger[_0xc963('0x10')](_0xc963('0x12'),_0x51239c,_0x461a31);_0x1bec13(_0x461a31);});});} \ No newline at end of file +var _0x0d55=['../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x0d55,0x179));var _0x50d5=function(_0x33f841,_0x2f5b6b){_0x33f841=_0x33f841-0x0;var _0x446e55=_0x0d55[_0x33f841];return _0x446e55;};'use strict';var _=require(_0x50d5('0x0'));var util=require('util');var moment=require(_0x50d5('0x1'));var BPromise=require('bluebird');var rs=require(_0x50d5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50d5('0x3'))['db'];var utils=require(_0x50d5('0x4'));var logger=require(_0x50d5('0x5'))(_0x50d5('0x6'));var config=require(_0x50d5('0x7'));var jayson=require(_0x50d5('0x8'));var client=jayson[_0x50d5('0x9')][_0x50d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb0383f,_0x53dda9,_0x32924d){return new BPromise(function(_0x23dadb,_0x1662c0){return client[_0x50d5('0xb')](_0xb0383f,_0x32924d)[_0x50d5('0xc')](function(_0x1eb8bb){logger[_0x50d5('0xd')](_0x50d5('0xe'),_0x53dda9,_0x50d5('0xf'));logger[_0x50d5('0x10')](_0x50d5('0x11'),_0x53dda9,_0x50d5('0xf'),JSON[_0x50d5('0x12')](_0x1eb8bb));if(_0x1eb8bb[_0x50d5('0x13')]){if(_0x1eb8bb[_0x50d5('0x13')][_0x50d5('0x14')]===0x1f4){logger[_0x50d5('0x13')](_0x50d5('0xe'),_0x53dda9,_0x1eb8bb[_0x50d5('0x13')][_0x50d5('0x15')]);return _0x1662c0(_0x1eb8bb[_0x50d5('0x13')][_0x50d5('0x15')]);}logger['error'](_0x50d5('0xe'),_0x53dda9,_0x1eb8bb['error'][_0x50d5('0x15')]);return _0x23dadb(_0x1eb8bb[_0x50d5('0x13')]['message']);}else{logger[_0x50d5('0xd')](_0x50d5('0xe'),_0x53dda9,_0x50d5('0xf'));_0x23dadb(_0x1eb8bb[_0x50d5('0x16')][_0x50d5('0x15')]);}})[_0x50d5('0x17')](function(_0x194ea5){logger['error']('CmCustomField,\x20%s,\x20%s',_0x53dda9,_0x194ea5);_0x1662c0(_0x194ea5);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 7956bfd..79fc01f 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 _0x194c=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3b8328,_0x1a0adc){var _0x28ef1a=function(_0x40b2fa){while(--_0x40b2fa){_0x3b8328['push'](_0x3b8328['shift']());}};_0x28ef1a(++_0x1a0adc);}(_0x194c,0x19b));var _0xc194=function(_0x2f683e,_0x28b5f4){_0x2f683e=_0x2f683e-0x0;var _0x34b9e7=_0x194c[_0x2f683e];return _0x34b9e7;};'use strict';var multer=require(_0xc194('0x0'));var util=require(_0xc194('0x1'));var path=require(_0xc194('0x2'));var timeout=require(_0xc194('0x3'));var express=require(_0xc194('0x4'));var router=express[_0xc194('0x5')]();var fs_extra=require(_0xc194('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc194('0x7'));var config=require(_0xc194('0x8'));var controller=require(_0xc194('0x9'));router[_0xc194('0xa')]('/',auth[_0xc194('0xb')](),controller[_0xc194('0xc')]);router[_0xc194('0xa')](_0xc194('0xd'),auth[_0xc194('0xb')](),controller[_0xc194('0xe')]);router['post']('/',auth[_0xc194('0xb')](),controller['create']);router[_0xc194('0xf')](_0xc194('0xd'),auth[_0xc194('0xb')](),controller['update']);router[_0xc194('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc194('0x11')]);module[_0xc194('0x12')]=router; \ No newline at end of file +var _0xf96b=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a27e1,_0x26da17){var _0x3c82c7=function(_0x599055){while(--_0x599055){_0x5a27e1['push'](_0x5a27e1['shift']());}};_0x3c82c7(++_0x26da17);}(_0xf96b,0x109));var _0xbf96=function(_0x3f4832,_0x425815){_0x3f4832=_0x3f4832-0x0;var _0x46efb0=_0xf96b[_0x3f4832];return _0x46efb0;};'use strict';var multer=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var path=require(_0xbf96('0x2'));var timeout=require(_0xbf96('0x3'));var express=require(_0xbf96('0x4'));var router=express[_0xbf96('0x5')]();var fs_extra=require(_0xbf96('0x6'));var auth=require(_0xbf96('0x7'));var interaction=require(_0xbf96('0x8'));var config=require(_0xbf96('0x9'));var controller=require(_0xbf96('0xa'));router[_0xbf96('0xb')]('/',auth[_0xbf96('0xc')](),controller['index']);router[_0xbf96('0xb')](_0xbf96('0xd'),auth[_0xbf96('0xc')](),controller[_0xbf96('0xe')]);router['post']('/',auth[_0xbf96('0xc')](),controller[_0xbf96('0xf')]);router[_0xbf96('0x10')](_0xbf96('0xd'),auth[_0xbf96('0xc')](),controller[_0xbf96('0x11')]);router[_0xbf96('0x12')](_0xbf96('0xd'),auth['isAuthenticated'](),controller[_0xbf96('0x13')]);module[_0xbf96('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 86a9958..599b1e7 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 _0xae4c=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','DATE','moment','exports','STRING','BOOLEAN','format'];(function(_0x32f1ce,_0x1594ef){var _0x2871a5=function(_0x105858){while(--_0x105858){_0x32f1ce['push'](_0x32f1ce['shift']());}};_0x2871a5(++_0x1594ef);}(_0xae4c,0x181));var _0xcae4=function(_0x3ee952,_0x565e0f){_0x3ee952=_0x3ee952-0x0;var _0xc0c8b1=_0xae4c[_0x3ee952];return _0xc0c8b1;};'use strict';var moment=require(_0xcae4('0x0'));var Sequelize=require('sequelize');module[_0xcae4('0x1')]={'phone':{'type':Sequelize[_0xcae4('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xcae4('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xcae4('0x4')](_0xcae4('0x5'))},'countbusyretry':{'type':Sequelize[_0xcae4('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcae4('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcae4('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xcae4('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcae4('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xcae4('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xcae4('0x6')],'unique':_0xcae4('0x8')},'UserId':{'type':Sequelize[_0xcae4('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xcae4('0x8')},'CampaignId':{'type':Sequelize[_0xcae4('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xcae4('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcae4('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcae4('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcae4('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcae4('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xcae4('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xcae4('0x9')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xa783=['INTEGER','BOOLEAN','contactListQueue','STRING','sequelize','exports','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4e3b0c,_0x431ff2){var _0x54cb60=function(_0x57be46){while(--_0x57be46){_0x4e3b0c['push'](_0x4e3b0c['shift']());}};_0x54cb60(++_0x431ff2);}(_0xa783,0x16c));var _0x3a78=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xa783[_0x88cd7b];return _0x56fcc8;};'use strict';var moment=require('moment');var Sequelize=require(_0x3a78('0x0'));module[_0x3a78('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3a78('0x2')],'defaultValue':moment()[_0x3a78('0x3')](_0x3a78('0x4'))},'countbusyretry':{'type':Sequelize[_0x3a78('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3a78('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3a78('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3a78('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3a78('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3a78('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3a78('0x5')],'unique':_0x3a78('0x7')},'ListId':{'type':Sequelize[_0x3a78('0x5')],'unique':_0x3a78('0x7')},'UserId':{'type':Sequelize[_0x3a78('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x3a78('0x7')},'CampaignId':{'type':Sequelize[_0x3a78('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x3a78('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3a78('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3a78('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3a78('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3a78('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3a78('0x8')]},'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 2888dbd..9d49fc8 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 _0x4300=['Company','List','Queue','dialActive','getPreviewRecall','findOne','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','update','then','error','CmHopper','rawAttributes','fieldName','model','map','name','query','keys','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','find','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','create','CmHopperAdditionalPhone','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','phone','recallme','UPDATE','Contact','CmCompany'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x4300,0x1a6));var _0x0430=function(_0x1b9b78,_0x16eb86){_0x1b9b78=_0x1b9b78-0x0;var _0xcab44b=_0x4300[_0x1b9b78];return _0xcab44b;};'use strict';var moment=require(_0x0430('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var shared=require(_0x0430('0x1'));var db=require(_0x0430('0x2'))['db'];function respondWithResult(_0x1c139f,_0x2a1e62){_0x2a1e62=_0x2a1e62||0xc8;return function(_0x1735aa){if(_0x1735aa){return _0x1c139f['status'](_0x2a1e62)[_0x0430('0x3')](_0x1735aa);}};}function respondWithFilteredResult(_0x5943c0,_0x16efe3){return function(_0x5b03ef){if(_0x5b03ef){var _0x2388b9=typeof _0x16efe3[_0x0430('0x4')]===_0x0430('0x5')&&typeof _0x16efe3[_0x0430('0x6')]===_0x0430('0x5');var _0x108a08=_0x5b03ef[_0x0430('0x7')];var _0x3af75c=_0x2388b9?0x0:_0x16efe3[_0x0430('0x4')];var _0x4972da=_0x2388b9?_0x5b03ef[_0x0430('0x7')]:_0x16efe3[_0x0430('0x4')]+_0x16efe3[_0x0430('0x6')];var _0x22e630;if(_0x4972da>=_0x108a08){_0x4972da=_0x108a08;_0x22e630=0xc8;}else{_0x22e630=0xce;}_0x5943c0[_0x0430('0x8')](_0x22e630);return _0x5943c0[_0x0430('0x9')](_0x0430('0xa'),_0x3af75c+'-'+_0x4972da+'/'+_0x108a08)[_0x0430('0x3')](_0x5b03ef);}return null;};}function saveUpdates(_0x5315a3,_0x4b382a){return function(_0x4292f7){if(_0x4292f7){return _0x4292f7[_0x0430('0xb')](_0x5315a3)[_0x0430('0xc')](function(_0x32caa1){return _0x32caa1;});}return null;};}function handleEntityNotFound(_0x671534,_0x39d4e2){return function(_0x182e2c){if(!_0x182e2c){_0x671534['sendStatus'](0x194);}return _0x182e2c;};}function handleError(_0xb34f43,_0x40e6dc){_0x40e6dc=_0x40e6dc||0x1f4;return function(_0x8fe471){logger[_0x0430('0xd')](_0x8fe471['stack']);if(_0x8fe471['name']){delete _0x8fe471['name'];}_0xb34f43[_0x0430('0x8')](_0x40e6dc)['send'](_0x8fe471);};}exports['index']=function(_0x1a3239,_0x2f23b9){var _0x391791={},_0xd33c3c={},_0x15d020={'count':0x0,'rows':[]};var _0x5ed513=_['map'](db[_0x0430('0xe')][_0x0430('0xf')],function(_0x35ffdb){return{'name':_0x35ffdb[_0x0430('0x10')],'type':_0x35ffdb['type']['key']};});_0xd33c3c[_0x0430('0x11')]=_[_0x0430('0x12')](_0x5ed513,_0x0430('0x13'));_0xd33c3c[_0x0430('0x14')]=_[_0x0430('0x15')](_0x1a3239[_0x0430('0x14')]);_0xd33c3c['filters']=_[_0x0430('0x16')](_0xd33c3c[_0x0430('0x11')],_0xd33c3c[_0x0430('0x14')]);_0xd33c3c[_0x0430('0x17')]=_['concat'](_0xd33c3c[_0x0430('0x17')],[_0x0430('0x18'),_0x0430('0x19'),_0x0430('0x1a'),_0x0430('0x1b'),_0x0430('0x1c'),_0x0430('0x1d'),_0x0430('0x1e'),_0x0430('0x1f'),'$not',_0x0430('0x20'),'$notBetween','$in',_0x0430('0x21'),_0x0430('0x22'),'$notLike',_0x0430('0x23'),_0x0430('0x24'),_0x0430('0x22'),_0x0430('0x25'),_0x0430('0x26'),_0x0430('0x27'),_0x0430('0x28')]);_0x391791[_0x0430('0x29')]=_[_0x0430('0x16')](_0xd33c3c['model'],qs['fields'](_0x1a3239['query'][_0x0430('0x2a')]));_0x391791['attributes']=_0x391791[_0x0430('0x29')]['length']?_0x391791['attributes']:_0xd33c3c[_0x0430('0x11')];if(!_0x1a3239[_0x0430('0x14')][_0x0430('0x2b')](_0x0430('0x2c'))){_0x391791['limit']=qs['limit'](_0x1a3239[_0x0430('0x14')][_0x0430('0x6')]);_0x391791['offset']=qs['offset'](_0x1a3239[_0x0430('0x14')][_0x0430('0x4')]);}_0x391791[_0x0430('0x2d')]=qs[_0x0430('0x2e')](_0x1a3239[_0x0430('0x14')][_0x0430('0x2e')]);_0x391791[_0x0430('0x2f')]=qs[_0x0430('0x17')](_[_0x0430('0x30')](_0x1a3239['query'],_0xd33c3c[_0x0430('0x17')]),_0x5ed513);if(_0x1a3239[_0x0430('0x14')][_0x0430('0x31')]){_0x391791['where']=_[_0x0430('0x32')](_0x391791['where'],{'$or':_[_0x0430('0x12')](_0x5ed513,function(_0x504b68){if(_0x504b68['type']!==_0x0430('0x33')){var _0x38e33b={};_0x38e33b[_0x504b68[_0x0430('0x13')]]={'$like':'%'+_0x1a3239[_0x0430('0x14')][_0x0430('0x31')]+'%'};return _0x38e33b;}})});}_0x391791=_[_0x0430('0x32')]({},_0x391791,_0x1a3239['options']);var _0x659aca={'where':_0x391791[_0x0430('0x2f')]};return db[_0x0430('0xe')][_0x0430('0x7')](_0x659aca)[_0x0430('0xc')](function(_0x41490f){_0x15d020[_0x0430('0x7')]=_0x41490f;if(_0x1a3239[_0x0430('0x14')][_0x0430('0x34')]){_0x391791[_0x0430('0x35')]=[{'all':!![]}];}return db['CmHopper'][_0x0430('0x36')](_0x391791);})[_0x0430('0xc')](function(_0x418255){_0x15d020[_0x0430('0x37')]=_0x418255;return _0x15d020;})[_0x0430('0xc')](respondWithFilteredResult(_0x2f23b9,_0x391791))[_0x0430('0x38')](handleError(_0x2f23b9,null));};exports['show']=function(_0xaf12ad,_0x3adadb){var _0x50cdcd={'raw':!![],'where':{'id':_0xaf12ad[_0x0430('0x39')]['id']}},_0x2eeff1={};_0x2eeff1[_0x0430('0x11')]=_[_0x0430('0x15')](db[_0x0430('0xe')][_0x0430('0xf')]);_0x2eeff1[_0x0430('0x14')]=_[_0x0430('0x15')](_0xaf12ad[_0x0430('0x14')]);_0x2eeff1['filters']=_[_0x0430('0x16')](_0x2eeff1[_0x0430('0x11')],_0x2eeff1[_0x0430('0x14')]);_0x50cdcd[_0x0430('0x29')]=_['intersection'](_0x2eeff1[_0x0430('0x11')],qs[_0x0430('0x2a')](_0xaf12ad[_0x0430('0x14')][_0x0430('0x2a')]));_0x50cdcd[_0x0430('0x29')]=_0x50cdcd[_0x0430('0x29')][_0x0430('0x3a')]?_0x50cdcd[_0x0430('0x29')]:_0x2eeff1[_0x0430('0x11')];if(_0xaf12ad[_0x0430('0x14')][_0x0430('0x34')]){_0x50cdcd['include']=[{'all':!![]}];}_0x50cdcd=_[_0x0430('0x32')]({},_0x50cdcd,_0xaf12ad['options']);return db['CmHopper'][_0x0430('0x3b')](_0x50cdcd)['then'](handleEntityNotFound(_0x3adadb,null))['then'](respondWithResult(_0x3adadb,null))[_0x0430('0x38')](handleError(_0x3adadb,null));};exports['create']=function(_0x5d7b2f,_0x424e40){return db['CmHopper']['create'](_0x5d7b2f[_0x0430('0x3c')],{})['then'](respondWithResult(_0x424e40,0xc9))['catch'](handleError(_0x424e40,null));};exports[_0x0430('0xb')]=function(_0x175c07,_0x129f61){if(_0x175c07['body']['id']){delete _0x175c07[_0x0430('0x3c')]['id'];}return db[_0x0430('0xe')][_0x0430('0x3b')]({'where':{'id':_0x175c07['params']['id']}})['then'](handleEntityNotFound(_0x129f61,null))[_0x0430('0xc')](saveUpdates(_0x175c07[_0x0430('0x3c')],null))[_0x0430('0xc')](respondWithResult(_0x129f61,null))[_0x0430('0x38')](handleError(_0x129f61,null));};exports['describe']=function(_0x5a4500,_0x5b107e){return db[_0x0430('0xe')][_0x0430('0x3d')]()[_0x0430('0xc')](respondWithResult(_0x5b107e,null))[_0x0430('0x38')](handleError(_0x5b107e,null));};exports[_0x0430('0x3e')]=function(_0x421280,_0x5c3184){var _0x53879b;var _0x29ed30=_0x421280[_0x0430('0x39')]['id'];return db[_0x0430('0xe')][_0x0430('0x3b')]({'where':{'id':_0x421280[_0x0430('0x39')]['id']}})[_0x0430('0xc')](handleEntityNotFound(_0x5c3184,null))[_0x0430('0xc')](function(_0x2a3092){if(_0x2a3092){return _0x2a3092[_0x0430('0x3e')]()[_0x0430('0xc')](function(_0x4387db){return _0x4387db;});}})[_0x0430('0xc')](function(_0x4a2097){_0x53879b=_0x4a2097;if(_0x4a2097){if(_0x4a2097['VoiceQueueId']||_0x4a2097[_0x0430('0x3f')]){return db[_0x4a2097[_0x0430('0x40')]?_0x0430('0x41'):_0x0430('0x42')][_0x0430('0x3b')]({'where':{'id':_0x4a2097[_0x0430('0x40')]?_0x4a2097[_0x0430('0x40')]:_0x4a2097[_0x0430('0x3f')]},'attributes':['id',_0x0430('0x13')],'raw':!![]});}}})[_0x0430('0xc')](function(_0x40b02a){var _0x1a7698={};if(_0x40b02a){_[_0x0430('0x32')](_0x1a7698,_[_0x0430('0x43')](_0x53879b[_0x0430('0x44')],[_0x0430('0x45'),_0x0430('0x46'),'id']));_0x1a7698[_0x0430('0x47')]=0x15;_0x1a7698['statedesc']=_0x0430('0x48');_0x1a7698[_0x0430('0x49')]=_0x40b02a[_0x0430('0x13')];_0x1a7698[_0x0430('0x4a')]=_0x421280[_0x0430('0x4b')][_0x0430('0x13')];_0x1a7698[_0x0430('0x4c')]=_0x421280[_0x0430('0x4b')]['id'];_0x1a7698[_0x0430('0x48')]=!![];_0x1a7698['deletedat']=moment()[_0x0430('0x4d')](_0x0430('0x4e'));_0x1a7698[_0x0430('0x4f')]=_0x53879b['phone'];_0x1a7698[_0x0430('0x50')]=_0x53879b['VoiceQueueId']?_0x0430('0x51'):_0x0430('0x52');return db[_0x0430('0x53')][_0x0430('0x3b')]({'where':{'id':_0x1a7698[_0x0430('0x54')]},'attributes':[_0x0430('0x55'),'lastName']})[_0x0430('0xc')](function(_0x2bb9d7){if(!_[_0x0430('0x56')](_0x5c3184)&&!_[_0x0430('0x56')](_0x2bb9d7[_0x0430('0x55')])){_0x1a7698[_0x0430('0x57')]=_0x2bb9d7[_0x0430('0x55')];if(!_[_0x0430('0x56')](_0x2bb9d7[_0x0430('0x58')])){_0x1a7698[_0x0430('0x57')]+='\x20'+_0x2bb9d7[_0x0430('0x58')];}}})[_0x0430('0x59')](function(){return db['CmHopperFinal'][_0x0430('0x5a')](_0x1a7698);});}})[_0x0430('0xc')](function(_0x8d5d6a){return db[_0x0430('0x5b')][_0x0430('0x3e')]({'where':{'CmHopperId':_0x29ed30}});})[_0x0430('0xc')](function(){return _0x5c3184[_0x0430('0x8')](0xcc)[_0x0430('0x5c')]();})[_0x0430('0x38')](handleError(_0x5c3184,null));};exports['getPreview']=function(_0x2dbf77,_0x19381c){var _0x30298f=[];return db[_0x0430('0x53')][_0x0430('0x3d')]()[_0x0430('0xc')](function(_0xc78054){_0x30298f=_[_0x0430('0x15')](_0xc78054);return _0x2dbf77[_0x0430('0x4b')][_0x0430('0x5d')]({'where':{'type':_0x0430('0x5e'),'dialActive':!![],'dialMethod':_0x0430('0x5f')},'attributes':['id',_0x0430('0x60'),_0x0430('0x61')],'raw':!![]});})['then'](function(_0x1d0503){if(_0x1d0503&&_0x1d0503[_0x0430('0x3a')]){return db[_0x0430('0x62')][_0x0430('0x63')](function(_0x294c98){var _0x5982cf={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x0430('0x4e'))},'VoiceQueueId':{'$in':_[_0x0430('0x12')](_0x1d0503,'id')},'$or':[{'UserId':null},{'UserId':_0x2dbf77[_0x0430('0x4b')]['id']}]};var _0x27ca0c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1d0503)[_0x0430('0x31')](['dialPreviewAutoRecallMe',0x0])[_0x0430('0x12')]('id')[_0x0430('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x2dbf77['user']['id']}]};var _0x1335cb={'$or':[_0x5982cf,_0x27ca0c]};var _0x3c6a59=[];if(_0x2dbf77[_0x0430('0x3c')]['direction']&&_0x2dbf77[_0x0430('0x3c')][_0x0430('0x65')]===_0x0430('0x66')){if(!_[_0x0430('0x67')](_0x2dbf77[_0x0430('0x3c')][_0x0430('0x68')])){_0x1335cb['id']={'$in':_0x2dbf77[_0x0430('0x3c')][_0x0430('0x68')]};}_0x3c6a59=[[_0x0430('0x69'),_0x0430('0x6a')],[_0x0430('0x6b'),_0x1d0503[0x0]['dialOrderByScheduledAt']===_0x0430('0x6a')?_0x0430('0x6c'):_0x0430('0x6a')],db['sequelize'][_0x0430('0x6d')](_0x0430('0x6e')),['id',_0x0430('0x6c')]];}else{if(!_[_0x0430('0x67')](_0x2dbf77[_0x0430('0x3c')][_0x0430('0x68')])){_0x1335cb['id']={'$notIn':_0x2dbf77[_0x0430('0x3c')][_0x0430('0x68')]};}_0x3c6a59=[[_0x0430('0x69'),_0x0430('0x6c')],[_0x0430('0x6b'),_0x1d0503[0x0][_0x0430('0x60')]],db[_0x0430('0x62')][_0x0430('0x6d')](_0x0430('0x6f')),['id',_0x0430('0x6a')]];}return db['CmHopper']['findOne']({'attributes':['id',_0x0430('0x70'),_0x0430('0x71'),_0x0430('0x72')],'where':_0x1335cb,'order':_0x3c6a59,'transaction':_0x294c98,'lock':_0x294c98['LOCK'][_0x0430('0x73')],'include':[{'model':db['CmContact'],'as':_0x0430('0x74'),'attributes':_0x30298f,'include':[{'model':db[_0x0430('0x75')],'as':_0x0430('0x76'),'attributes':['id',_0x0430('0x13')]}]},{'model':db['CmList'],'as':_0x0430('0x77'),'attributes':['id','name']},{'model':db[_0x0430('0x41')],'as':_0x0430('0x78'),'attributes':['id',_0x0430('0x13'),_0x0430('0x79')]}]})[_0x0430('0xc')](function(_0x7af0bf){if(_0x7af0bf){return _0x7af0bf[_0x0430('0xb')]({'UserId':_0x2dbf77['user']['id']},{'transaction':_0x294c98});}});});}})['then'](handleEntityNotFound(_0x19381c,null))[_0x0430('0xc')](respondWithResult(_0x19381c,null))[_0x0430('0x38')](handleError(_0x19381c,null));};exports[_0x0430('0x7a')]=function(_0xaa3495,_0x57899b,_0x9f7f5b){var _0x107b74=[];var _0x3ba680=_0xaa3495['params']['id'];var _0x34aa92=_0xaa3495[_0x0430('0x4b')]['id'];return db['CmContact']['describe']()['then'](function(_0x843e42){_0x107b74=_[_0x0430('0x15')](_0x843e42);return db[_0x0430('0x62')][_0x0430('0x63')](function(_0x153163){const _0x3fc4a5={'id':_0x3ba680};return db[_0x0430('0xe')][_0x0430('0x7b')]({'attributes':['id',_0x0430('0x70'),'recallme'],'where':_0x3fc4a5,'transaction':_0x153163,'lock':_0x153163['LOCK'][_0x0430('0x73')],'include':[{'model':db[_0x0430('0x53')],'as':_0x0430('0x74'),'attributes':_0x107b74,'include':[{'model':db[_0x0430('0x75')],'as':'Company','attributes':['id',_0x0430('0x13')]}]},{'model':db[_0x0430('0x7c')],'as':_0x0430('0x77'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x0430('0x78'),'attributes':['id',_0x0430('0x13'),_0x0430('0x79')]}]})[_0x0430('0xc')](function(_0x12e3ea){if(_0x12e3ea){return _0x12e3ea[_0x0430('0xb')]({'UserId':_0x34aa92},{'transaction':_0x153163});}});});})['then'](handleEntityNotFound(_0x57899b,null))[_0x0430('0xc')](respondWithResult(_0x57899b,null))[_0x0430('0x38')](handleError(_0x57899b,null));};exports[_0x0430('0x7d')]=function(_0xb51729,_0x2a3ee5){return _0xb51729['user']['getVoiceQueues']({'where':{'type':_0x0430('0x5e'),'dialActive':!![],'dialMethod':_0x0430('0x5f')},'attributes':['id'],'raw':!![]})['then'](function(_0x201f83){if(_0x201f83&&_0x201f83['length']){return db[_0x0430('0xe')][_0x0430('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0430('0x4d')](_0x0430('0x4e'))},'VoiceQueueId':{'$in':_[_0x0430('0x12')](_0x201f83,'id')},'$or':[{'UserId':null},{'UserId':_0xb51729['user']['id']}]}});}return 0x0;})['then'](function(_0x129b13){if(!_['isNil'](_0x129b13)&&_[_0x0430('0x7e')](_0x129b13)){return _0x2a3ee5[_0x0430('0x8')](0xc8)[_0x0430('0x3')]({'contacts':_0x129b13});}else{logger[_0x0430('0xd')](_0x0430('0x7f'),_0x0430('0x7d'),0x194,_0x0430('0x80'));_0x2a3ee5[_0x0430('0x81')](0x194);}})['catch'](handleError(_0x2a3ee5,null));};exports[_0x0430('0x82')]=function(_0x1bb341,_0x49d492){var _0x3ea758=shared[_0x0430('0x83')];var _0x18b1cd=[];_[_0x0430('0x12')](_0x3ea758,function(_0x1898d0){_0x18b1cd[_0x0430('0x84')]({'id':_0x1898d0[_0x0430('0x13')],'name':_0x1898d0[_0x0430('0x13')],'utcOffset':_0x1898d0[_0x0430('0x85')]});});return _0x49d492['status'](0xc8)[_0x0430('0x3')]({'tz':_0x18b1cd});};exports[_0x0430('0x86')]=function(_0x40c745,_0xcdba62){var _0x177dff=shared[_0x0430('0x83')];var _0x4c7b9e={};if(!_[_0x0430('0x56')](_0x177dff[_0x40c745['body']['id']]))_0x4c7b9e=_0x177dff[_0x40c745[_0x0430('0x3c')]['id']];return _0xcdba62[_0x0430('0x8')](0xc8)['json'](_0x4c7b9e);}; \ No newline at end of file +var _0xa990=['describe','destroy','find','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','dialOrderByScheduledAt','findOne','scheduledat','recallme','LOCK','UPDATE','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','transaction','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','update','then','sendStatus','error','stack','name','index','map','CmHopper','rawAttributes','type','model','keys','query','filters','intersection','concat','$gt','$gte','$lt','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$any','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','rows','catch','show','include','create','body','params'];(function(_0x320f2a,_0x391385){var _0x4ac986=function(_0x4c1963){while(--_0x4c1963){_0x320f2a['push'](_0x320f2a['shift']());}};_0x4ac986(++_0x391385);}(_0xa990,0xc9));var _0x0a99=function(_0x59c347,_0x5b8cde){_0x59c347=_0x59c347-0x0;var _0x2bf2a4=_0xa990[_0x59c347];return _0x2bf2a4;};'use strict';var moment=require(_0x0a99('0x0'));var _=require(_0x0a99('0x1'));var qs=require(_0x0a99('0x2'));var logger=require(_0x0a99('0x3'))(_0x0a99('0x4'));var shared=require(_0x0a99('0x5'));var db=require(_0x0a99('0x6'))['db'];function respondWithResult(_0x394f1c,_0x4d4992){_0x4d4992=_0x4d4992||0xc8;return function(_0x4d1781){if(_0x4d1781){return _0x394f1c[_0x0a99('0x7')](_0x4d4992)[_0x0a99('0x8')](_0x4d1781);}};}function respondWithFilteredResult(_0xfdb594,_0x320560){return function(_0x45b195){if(_0x45b195){var _0x398d95=typeof _0x320560[_0x0a99('0x9')]===_0x0a99('0xa')&&typeof _0x320560[_0x0a99('0xb')]===_0x0a99('0xa');var _0x1eaa2a=_0x45b195['count'];var _0x813e91=_0x398d95?0x0:_0x320560[_0x0a99('0x9')];var _0x5b5ec3=_0x398d95?_0x45b195['count']:_0x320560[_0x0a99('0x9')]+_0x320560[_0x0a99('0xb')];var _0x1eb2bd;if(_0x5b5ec3>=_0x1eaa2a){_0x5b5ec3=_0x1eaa2a;_0x1eb2bd=0xc8;}else{_0x1eb2bd=0xce;}_0xfdb594[_0x0a99('0x7')](_0x1eb2bd);return _0xfdb594[_0x0a99('0xc')]('Content-Range',_0x813e91+'-'+_0x5b5ec3+'/'+_0x1eaa2a)[_0x0a99('0x8')](_0x45b195);}return null;};}function saveUpdates(_0x3aaaad,_0x57ab88){return function(_0xb6a34d){if(_0xb6a34d){return _0xb6a34d[_0x0a99('0xd')](_0x3aaaad)[_0x0a99('0xe')](function(_0x2bbf1a){return _0x2bbf1a;});}return null;};}function handleEntityNotFound(_0x346061,_0x23d018){return function(_0x18c124){if(!_0x18c124){_0x346061[_0x0a99('0xf')](0x194);}return _0x18c124;};}function handleError(_0x4b6946,_0x5a17e1){_0x5a17e1=_0x5a17e1||0x1f4;return function(_0x2c40db){logger[_0x0a99('0x10')](_0x2c40db[_0x0a99('0x11')]);if(_0x2c40db['name']){delete _0x2c40db[_0x0a99('0x12')];}_0x4b6946['status'](_0x5a17e1)['send'](_0x2c40db);};}exports[_0x0a99('0x13')]=function(_0x3bab16,_0x3de006){var _0x544c2={},_0x572ce5={},_0x564ae9={'count':0x0,'rows':[]};var _0x27a14f=_[_0x0a99('0x14')](db[_0x0a99('0x15')][_0x0a99('0x16')],function(_0x5e6c7e){return{'name':_0x5e6c7e['fieldName'],'type':_0x5e6c7e[_0x0a99('0x17')]['key']};});_0x572ce5[_0x0a99('0x18')]=_['map'](_0x27a14f,_0x0a99('0x12'));_0x572ce5['query']=_[_0x0a99('0x19')](_0x3bab16[_0x0a99('0x1a')]);_0x572ce5[_0x0a99('0x1b')]=_[_0x0a99('0x1c')](_0x572ce5[_0x0a99('0x18')],_0x572ce5[_0x0a99('0x1a')]);_0x572ce5[_0x0a99('0x1b')]=_[_0x0a99('0x1d')](_0x572ce5[_0x0a99('0x1b')],['$and','$or',_0x0a99('0x1e'),_0x0a99('0x1f'),_0x0a99('0x20'),'$lte','$ne',_0x0a99('0x21'),_0x0a99('0x22'),_0x0a99('0x23'),_0x0a99('0x24'),_0x0a99('0x25'),_0x0a99('0x26'),_0x0a99('0x27'),_0x0a99('0x28'),_0x0a99('0x29'),'$notILike',_0x0a99('0x27'),'$overlap','$contains','$contained',_0x0a99('0x2a')]);_0x544c2[_0x0a99('0x2b')]=_[_0x0a99('0x1c')](_0x572ce5[_0x0a99('0x18')],qs[_0x0a99('0x2c')](_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x2c')]));_0x544c2['attributes']=_0x544c2[_0x0a99('0x2b')][_0x0a99('0x2d')]?_0x544c2[_0x0a99('0x2b')]:_0x572ce5[_0x0a99('0x18')];if(!_0x3bab16['query']['hasOwnProperty']('nolimit')){_0x544c2[_0x0a99('0xb')]=qs[_0x0a99('0xb')](_0x3bab16[_0x0a99('0x1a')]['limit']);_0x544c2[_0x0a99('0x9')]=qs[_0x0a99('0x9')](_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x9')]);}_0x544c2[_0x0a99('0x2e')]=qs[_0x0a99('0x2f')](_0x3bab16[_0x0a99('0x1a')]['sort']);_0x544c2[_0x0a99('0x30')]=qs[_0x0a99('0x1b')](_[_0x0a99('0x31')](_0x3bab16[_0x0a99('0x1a')],_0x572ce5[_0x0a99('0x1b')]),_0x27a14f);if(_0x3bab16['query'][_0x0a99('0x32')]){_0x544c2['where']=_['merge'](_0x544c2['where'],{'$or':_['map'](_0x27a14f,function(_0x155a14){if(_0x155a14['type']!==_0x0a99('0x33')){var _0x3d5e0f={};_0x3d5e0f[_0x155a14[_0x0a99('0x12')]]={'$like':'%'+_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x32')]+'%'};return _0x3d5e0f;}})});}_0x544c2=_[_0x0a99('0x34')]({},_0x544c2,_0x3bab16[_0x0a99('0x35')]);var _0x3bc3fc={'where':_0x544c2[_0x0a99('0x30')]};return db[_0x0a99('0x15')][_0x0a99('0x36')](_0x3bc3fc)[_0x0a99('0xe')](function(_0x472850){_0x564ae9['count']=_0x472850;if(_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x37')]){_0x544c2['include']=[{'all':!![]}];}return db[_0x0a99('0x15')]['findAll'](_0x544c2);})[_0x0a99('0xe')](function(_0x563fbc){_0x564ae9[_0x0a99('0x38')]=_0x563fbc;return _0x564ae9;})[_0x0a99('0xe')](respondWithFilteredResult(_0x3de006,_0x544c2))[_0x0a99('0x39')](handleError(_0x3de006,null));};exports[_0x0a99('0x3a')]=function(_0x4a5c58,_0x19774f){var _0x11e046={'raw':!![],'where':{'id':_0x4a5c58['params']['id']}},_0x3b7efc={};_0x3b7efc[_0x0a99('0x18')]=_[_0x0a99('0x19')](db[_0x0a99('0x15')][_0x0a99('0x16')]);_0x3b7efc['query']=_[_0x0a99('0x19')](_0x4a5c58['query']);_0x3b7efc['filters']=_[_0x0a99('0x1c')](_0x3b7efc['model'],_0x3b7efc[_0x0a99('0x1a')]);_0x11e046['attributes']=_[_0x0a99('0x1c')](_0x3b7efc[_0x0a99('0x18')],qs[_0x0a99('0x2c')](_0x4a5c58[_0x0a99('0x1a')]['fields']));_0x11e046[_0x0a99('0x2b')]=_0x11e046[_0x0a99('0x2b')][_0x0a99('0x2d')]?_0x11e046[_0x0a99('0x2b')]:_0x3b7efc['model'];if(_0x4a5c58['query']['includeAll']){_0x11e046[_0x0a99('0x3b')]=[{'all':!![]}];}_0x11e046=_['merge']({},_0x11e046,_0x4a5c58[_0x0a99('0x35')]);return db['CmHopper']['find'](_0x11e046)['then'](handleEntityNotFound(_0x19774f,null))['then'](respondWithResult(_0x19774f,null))[_0x0a99('0x39')](handleError(_0x19774f,null));};exports['create']=function(_0x3e6213,_0x78cd0c){return db['CmHopper'][_0x0a99('0x3c')](_0x3e6213[_0x0a99('0x3d')],{})['then'](respondWithResult(_0x78cd0c,0xc9))[_0x0a99('0x39')](handleError(_0x78cd0c,null));};exports['update']=function(_0x3107bc,_0x278454){if(_0x3107bc['body']['id']){delete _0x3107bc[_0x0a99('0x3d')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x3107bc[_0x0a99('0x3e')]['id']}})[_0x0a99('0xe')](handleEntityNotFound(_0x278454,null))[_0x0a99('0xe')](saveUpdates(_0x3107bc[_0x0a99('0x3d')],null))[_0x0a99('0xe')](respondWithResult(_0x278454,null))['catch'](handleError(_0x278454,null));};exports[_0x0a99('0x3f')]=function(_0x174298,_0x4525d1){return db[_0x0a99('0x15')][_0x0a99('0x3f')]()[_0x0a99('0xe')](respondWithResult(_0x4525d1,null))[_0x0a99('0x39')](handleError(_0x4525d1,null));};exports[_0x0a99('0x40')]=function(_0x1cd328,_0x1621d9){var _0x52c754;var _0x50e04f=_0x1cd328[_0x0a99('0x3e')]['id'];return db[_0x0a99('0x15')][_0x0a99('0x41')]({'where':{'id':_0x1cd328[_0x0a99('0x3e')]['id']}})[_0x0a99('0xe')](handleEntityNotFound(_0x1621d9,null))[_0x0a99('0xe')](function(_0x5cda7d){if(_0x5cda7d){return _0x5cda7d[_0x0a99('0x40')]()[_0x0a99('0xe')](function(_0x55fee0){return _0x55fee0;});}})[_0x0a99('0xe')](function(_0x474e8b){_0x52c754=_0x474e8b;if(_0x474e8b){if(_0x474e8b['VoiceQueueId']||_0x474e8b[_0x0a99('0x42')]){return db[_0x474e8b[_0x0a99('0x43')]?_0x0a99('0x44'):_0x0a99('0x45')][_0x0a99('0x41')]({'where':{'id':_0x474e8b[_0x0a99('0x43')]?_0x474e8b[_0x0a99('0x43')]:_0x474e8b['CampaignId']},'attributes':['id',_0x0a99('0x12')],'raw':!![]});}}})[_0x0a99('0xe')](function(_0x1e9e9d){var _0x5a6762={};if(_0x1e9e9d){_[_0x0a99('0x34')](_0x5a6762,_[_0x0a99('0x46')](_0x52c754[_0x0a99('0x47')],['createdAt',_0x0a99('0x48'),'id']));_0x5a6762[_0x0a99('0x49')]=0x15;_0x5a6762[_0x0a99('0x4a')]=_0x0a99('0x4b');_0x5a6762[_0x0a99('0x4c')]=_0x1e9e9d[_0x0a99('0x12')];_0x5a6762['membername']=_0x1cd328[_0x0a99('0x4d')]['name'];_0x5a6762[_0x0a99('0x4e')]=_0x1cd328[_0x0a99('0x4d')]['id'];_0x5a6762[_0x0a99('0x4b')]=!![];_0x5a6762[_0x0a99('0x4f')]=moment()['format'](_0x0a99('0x50'));_0x5a6762['calleridnum']=_0x52c754[_0x0a99('0x51')];_0x5a6762[_0x0a99('0x52')]=_0x52c754[_0x0a99('0x43')]?_0x0a99('0x53'):_0x0a99('0x54');return db[_0x0a99('0x55')][_0x0a99('0x41')]({'where':{'id':_0x5a6762[_0x0a99('0x56')]},'attributes':[_0x0a99('0x57'),_0x0a99('0x58')]})[_0x0a99('0xe')](function(_0x3f2e09){if(!_[_0x0a99('0x59')](_0x1621d9)&&!_['isNil'](_0x3f2e09[_0x0a99('0x57')])){_0x5a6762[_0x0a99('0x5a')]=_0x3f2e09[_0x0a99('0x57')];if(!_['isNil'](_0x3f2e09[_0x0a99('0x58')])){_0x5a6762[_0x0a99('0x5a')]+='\x20'+_0x3f2e09[_0x0a99('0x58')];}}})['finally'](function(){return db[_0x0a99('0x5b')][_0x0a99('0x3c')](_0x5a6762);});}})[_0x0a99('0xe')](function(_0x144032){return db['CmHopperAdditionalPhone'][_0x0a99('0x40')]({'where':{'CmHopperId':_0x50e04f}});})[_0x0a99('0xe')](function(){return _0x1621d9[_0x0a99('0x7')](0xcc)['end']();})['catch'](handleError(_0x1621d9,null));};exports[_0x0a99('0x5c')]=function(_0x528a5d,_0x53b1f4){var _0x5406a7=[];return db[_0x0a99('0x55')]['describe']()[_0x0a99('0xe')](function(_0x436942){_0x5406a7=_[_0x0a99('0x19')](_0x436942);return _0x528a5d[_0x0a99('0x4d')][_0x0a99('0x5d')]({'where':{'type':_0x0a99('0x5e'),'dialActive':!![],'dialMethod':_0x0a99('0x5f')},'attributes':['id','dialOrderByScheduledAt',_0x0a99('0x60')],'raw':!![]});})[_0x0a99('0xe')](function(_0x2d3b63){if(_0x2d3b63&&_0x2d3b63['length']){return db[_0x0a99('0x61')]['transaction'](function(_0x2109db){var _0x51d18a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a99('0x62')](_0x0a99('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x2d3b63,'id')},'$or':[{'UserId':null},{'UserId':_0x528a5d[_0x0a99('0x4d')]['id']}]};var _0x4ce300={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2d3b63)[_0x0a99('0x32')]([_0x0a99('0x60'),0x0])[_0x0a99('0x14')]('id')[_0x0a99('0x63')]()},'$or':[{'UserId':null},{'UserId':_0x528a5d[_0x0a99('0x4d')]['id']}]};var _0x9b52c7={'$or':[_0x51d18a,_0x4ce300]};var _0x44aa5d=[];if(_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x64')]&&_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x64')]===_0x0a99('0x65')){if(!_[_0x0a99('0x66')](_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x67')])){_0x9b52c7['id']={'$in':_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x67')]};}_0x44aa5d=[[_0x0a99('0x68'),'ASC'],['scheduledAt',_0x2d3b63[0x0]['dialOrderByScheduledAt']===_0x0a99('0x69')?_0x0a99('0x6a'):_0x0a99('0x69')],db['sequelize'][_0x0a99('0x6b')](_0x0a99('0x6c')),['id',_0x0a99('0x6a')]];}else{if(!_[_0x0a99('0x66')](_0x528a5d['body'][_0x0a99('0x67')])){_0x9b52c7['id']={'$notIn':_0x528a5d[_0x0a99('0x3d')]['hopperIds']};}_0x44aa5d=[['priority',_0x0a99('0x6a')],[_0x0a99('0x6d'),_0x2d3b63[0x0][_0x0a99('0x6e')]],db[_0x0a99('0x61')][_0x0a99('0x6b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x0a99('0x15')][_0x0a99('0x6f')]({'attributes':['id',_0x0a99('0x70'),_0x0a99('0x51'),_0x0a99('0x71')],'where':_0x9b52c7,'order':_0x44aa5d,'transaction':_0x2109db,'lock':_0x2109db[_0x0a99('0x72')][_0x0a99('0x73')],'include':[{'model':db[_0x0a99('0x55')],'as':'Contact','attributes':_0x5406a7,'include':[{'model':db[_0x0a99('0x74')],'as':_0x0a99('0x75'),'attributes':['id',_0x0a99('0x12')]}]},{'model':db['CmList'],'as':_0x0a99('0x76'),'attributes':['id','name']},{'model':db[_0x0a99('0x44')],'as':_0x0a99('0x77'),'attributes':['id',_0x0a99('0x12'),_0x0a99('0x78')]}]})['then'](function(_0x3435e3){if(_0x3435e3){return _0x3435e3[_0x0a99('0xd')]({'UserId':_0x528a5d[_0x0a99('0x4d')]['id']},{'transaction':_0x2109db});}});});}})[_0x0a99('0xe')](handleEntityNotFound(_0x53b1f4,null))[_0x0a99('0xe')](respondWithResult(_0x53b1f4,null))[_0x0a99('0x39')](handleError(_0x53b1f4,null));};exports[_0x0a99('0x79')]=function(_0x4c6a12,_0x656dd,_0x31950f){var _0x436163=[];var _0x2bae3d=_0x4c6a12['params']['id'];var _0x1a40e9=_0x4c6a12['user']['id'];return db['CmContact'][_0x0a99('0x3f')]()[_0x0a99('0xe')](function(_0x3bed6e){_0x436163=_[_0x0a99('0x19')](_0x3bed6e);return db[_0x0a99('0x61')][_0x0a99('0x7a')](function(_0x24a389){const _0x353660={'id':_0x2bae3d};return db['CmHopper'][_0x0a99('0x6f')]({'attributes':['id','scheduledat','recallme'],'where':_0x353660,'transaction':_0x24a389,'lock':_0x24a389['LOCK'][_0x0a99('0x73')],'include':[{'model':db[_0x0a99('0x55')],'as':'Contact','attributes':_0x436163,'include':[{'model':db['CmCompany'],'as':_0x0a99('0x75'),'attributes':['id',_0x0a99('0x12')]}]},{'model':db[_0x0a99('0x7b')],'as':_0x0a99('0x76'),'attributes':['id',_0x0a99('0x12')]},{'model':db[_0x0a99('0x44')],'as':_0x0a99('0x77'),'attributes':['id',_0x0a99('0x12'),_0x0a99('0x78')]}]})['then'](function(_0x51627a){if(_0x51627a){return _0x51627a[_0x0a99('0xd')]({'UserId':_0x1a40e9},{'transaction':_0x24a389});}});});})[_0x0a99('0xe')](handleEntityNotFound(_0x656dd,null))[_0x0a99('0xe')](respondWithResult(_0x656dd,null))[_0x0a99('0x39')](handleError(_0x656dd,null));};exports[_0x0a99('0x7c')]=function(_0x22b737,_0x3a6773){return _0x22b737['user']['getVoiceQueues']({'where':{'type':_0x0a99('0x5e'),'dialActive':!![],'dialMethod':_0x0a99('0x5f')},'attributes':['id'],'raw':!![]})['then'](function(_0x587442){if(_0x587442&&_0x587442[_0x0a99('0x2d')]){return db['CmHopper'][_0x0a99('0x36')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a99('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x587442,'id')},'$or':[{'UserId':null},{'UserId':_0x22b737[_0x0a99('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x17436d){if(!_['isNil'](_0x17436d)&&_[_0x0a99('0x7d')](_0x17436d)){return _0x3a6773[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')]({'contacts':_0x17436d});}else{logger[_0x0a99('0x10')](_0x0a99('0x7e'),_0x0a99('0x7c'),0x194,_0x0a99('0x7f'));_0x3a6773[_0x0a99('0xf')](0x194);}})[_0x0a99('0x39')](handleError(_0x3a6773,null));};exports[_0x0a99('0x80')]=function(_0x2d3efa,_0xe18018){var _0x51df2a=shared[_0x0a99('0x81')];var _0x2f4d34=[];_[_0x0a99('0x14')](_0x51df2a,function(_0x25c31b){_0x2f4d34[_0x0a99('0x82')]({'id':_0x25c31b[_0x0a99('0x12')],'name':_0x25c31b[_0x0a99('0x12')],'utcOffset':_0x25c31b[_0x0a99('0x83')]});});return _0xe18018[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')]({'tz':_0x2f4d34});};exports['getTimezone']=function(_0x5607f1,_0x505a2c){var _0x59228e=shared[_0x0a99('0x81')];var _0x38932f={};if(!_[_0x0a99('0x59')](_0x59228e[_0x5607f1[_0x0a99('0x3d')]['id']]))_0x38932f=_0x59228e[_0x5607f1[_0x0a99('0x3d')]['id']];return _0x505a2c[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')](_0x38932f);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index db39b64..f4d3402 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 _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0x36a4ae,_0x3c49ed){var _0xba5211=function(_0x80dc04){while(--_0x80dc04){_0x36a4ae['push'](_0x36a4ae['shift']());}};_0xba5211(++_0x3c49ed);}(_0xfcf0,0x138));var _0x0fcf=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xfcf0[_0x47a12a];return _0x30cd40;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1883=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xb43b17,_0x413941){var _0x21e4e4=function(_0x3c73e5){while(--_0x3c73e5){_0xb43b17['push'](_0xb43b17['shift']());}};_0x21e4e4(++_0x413941);}(_0x1883,0xab));var _0x3188=function(_0x2c3abd,_0x448f8b){_0x2c3abd=_0x2c3abd-0x0;var _0x108a6c=_0x1883[_0x2c3abd];return _0x108a6c;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x3188('0xf')]},{'name':_0x3188('0x10'),'fields':['phone']},{'name':_0x3188('0x11'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 547aa1e..b0cd910 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 _0x539d=['\x20MINUTE','NOW()','User','voicePause','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','moment','bluebird','rpc','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','attributes','include','map','model','info','ShowCmHopper','find','where','CreateCmHopper','create','body','stringify','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','Agent','name','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','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','contactsRescheduled','CountReScheduled','GetContactRecallMe','describe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds'];(function(_0x5d6bcc,_0xd28700){var _0x299c7d=function(_0x4a5e2b){while(--_0x4a5e2b){_0x5d6bcc['push'](_0x5d6bcc['shift']());}};_0x299c7d(++_0xd28700);}(_0x539d,0x17b));var _0xd539=function(_0xc5e02a,_0xd9da3c){_0xc5e02a=_0xc5e02a-0x0;var _0xbeca77=_0x539d[_0xc5e02a];return _0xbeca77;};'use strict';var _=require(_0xd539('0x0'));var util=require('util');var moment=require(_0xd539('0x1'));var BPromise=require(_0xd539('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xd539('0x3'));var jayson=require(_0xd539('0x4'));var client=jayson[_0xd539('0x5')][_0xd539('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2f9d1f,_0x4c9697,_0x341dd4){return new BPromise(function(_0x158719,_0x27f14e){return client[_0xd539('0x7')](_0x2f9d1f,_0x341dd4)[_0xd539('0x8')](function(_0x3cb142){logger['info'](_0xd539('0x9'),_0x4c9697,_0xd539('0xa'));logger[_0xd539('0xb')](_0xd539('0xc'),_0x4c9697,'request\x20sent',JSON['stringify'](_0x3cb142));if(_0x3cb142[_0xd539('0xd')]){if(_0x3cb142[_0xd539('0xd')][_0xd539('0xe')]===0x1f4){logger[_0xd539('0xd')](_0xd539('0x9'),_0x4c9697,_0x3cb142[_0xd539('0xd')][_0xd539('0xf')]);return _0x27f14e(_0x3cb142[_0xd539('0xd')]['message']);}logger[_0xd539('0xd')](_0xd539('0x9'),_0x4c9697,_0x3cb142[_0xd539('0xd')][_0xd539('0xf')]);return _0x158719(_0x3cb142[_0xd539('0xd')][_0xd539('0xf')]);}else{logger['info'](_0xd539('0x9'),_0x4c9697,_0xd539('0xa'));_0x158719(_0x3cb142[_0xd539('0x10')][_0xd539('0xf')]);}})[_0xd539('0x11')](function(_0x7b2b41){logger[_0xd539('0xd')](_0xd539('0x9'),_0x4c9697,_0x7b2b41);_0x27f14e(_0x7b2b41);});});}exports[_0xd539('0x12')]=function(_0x17f7bf){var _0x460f3c=this;return new Promise(function(_0x54d8ff,_0x363035){return db[_0xd539('0x13')][_0xd539('0x14')]({'raw':_0x17f7bf[_0xd539('0x15')]?_0x17f7bf[_0xd539('0x15')][_0xd539('0x16')]===undefined?!![]:![]:!![],'where':_0x17f7bf[_0xd539('0x15')]?_0x17f7bf[_0xd539('0x15')]['where']||null:null,'attributes':_0x17f7bf['options']?_0x17f7bf[_0xd539('0x15')][_0xd539('0x17')]||null:null,'limit':_0x17f7bf[_0xd539('0x15')]?_0x17f7bf[_0xd539('0x15')]['limit']||null:null,'include':_0x17f7bf[_0xd539('0x15')]?_0x17f7bf[_0xd539('0x15')][_0xd539('0x18')]?_[_0xd539('0x19')](_0x17f7bf[_0xd539('0x15')][_0xd539('0x18')],function(_0x38985c){return{'model':db[_0x38985c[_0xd539('0x1a')]],'as':_0x38985c['as'],'attributes':_0x38985c[_0xd539('0x17')],'include':_0x38985c['include']?_[_0xd539('0x19')](_0x38985c[_0xd539('0x18')],function(_0x3563f1){return{'model':db[_0x3563f1['model']],'as':_0x3563f1['as'],'attributes':_0x3563f1['attributes'],'include':_0x3563f1[_0xd539('0x18')]?_[_0xd539('0x19')](_0x3563f1[_0xd539('0x18')],function(_0xc1789e){return{'model':db[_0xc1789e['model']],'as':_0xc1789e['as'],'attributes':_0xc1789e[_0xd539('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1343de){logger[_0xd539('0x1b')](_0xd539('0x12'),_0x17f7bf);logger[_0xd539('0xb')]('GetCmHopper',_0x17f7bf,JSON['stringify'](_0x1343de));_0x54d8ff(_0x1343de);})[_0xd539('0x11')](function(_0x40720f){logger['error']('GetCmHopper',_0x40720f['message'],_0x17f7bf);_0x363035(_0x460f3c[_0xd539('0xd')](0x1f4,_0x40720f[_0xd539('0xf')]));});});};exports[_0xd539('0x1c')]=function(_0x7a810c){var _0x4859a9=this;return new Promise(function(_0x430840,_0x2662fe){return db['CmHopper'][_0xd539('0x1d')]({'raw':_0x7a810c[_0xd539('0x15')]?_0x7a810c[_0xd539('0x15')][_0xd539('0x16')]===undefined?!![]:![]:!![],'where':_0x7a810c[_0xd539('0x15')]?_0x7a810c['options'][_0xd539('0x1e')]||null:null,'attributes':_0x7a810c['options']?_0x7a810c[_0xd539('0x15')]['attributes']||null:null,'include':_0x7a810c[_0xd539('0x15')]?_0x7a810c['options'][_0xd539('0x18')]?_[_0xd539('0x19')](_0x7a810c[_0xd539('0x15')][_0xd539('0x18')],function(_0x3f68f7){return{'model':db[_0x3f68f7[_0xd539('0x1a')]],'as':_0x3f68f7['as'],'attributes':_0x3f68f7[_0xd539('0x17')],'include':_0x3f68f7[_0xd539('0x18')]?_[_0xd539('0x19')](_0x3f68f7[_0xd539('0x18')],function(_0x2413ac){return{'model':db[_0x2413ac['model']],'as':_0x2413ac['as'],'attributes':_0x2413ac[_0xd539('0x17')],'include':_0x2413ac['include']?_[_0xd539('0x19')](_0x2413ac[_0xd539('0x18')],function(_0x571d3b){return{'model':db[_0x571d3b[_0xd539('0x1a')]],'as':_0x571d3b['as'],'attributes':_0x571d3b[_0xd539('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x518128){logger[_0xd539('0x1b')](_0xd539('0x1c'),_0x7a810c);logger[_0xd539('0xb')](_0xd539('0x1c'),_0x7a810c,JSON['stringify'](_0x518128));_0x430840(_0x518128);})[_0xd539('0x11')](function(_0x2f4703){logger[_0xd539('0xd')](_0xd539('0x1c'),_0x2f4703['message'],_0x7a810c);_0x2662fe(_0x4859a9[_0xd539('0xd')](0x1f4,_0x2f4703[_0xd539('0xf')]));});});};exports[_0xd539('0x1f')]=function(_0xca1cbc){var _0x289167=this;return new Promise(function(_0x3deb9b,_0x4b5059){return db['CmHopper'][_0xd539('0x20')](_0xca1cbc[_0xd539('0x21')],{'raw':_0xca1cbc[_0xd539('0x15')]?_0xca1cbc[_0xd539('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xd539('0x8')](function(_0x1c5106){logger[_0xd539('0x1b')]('CreateCmHopper',_0xca1cbc);logger[_0xd539('0xb')]('CreateCmHopper',_0xca1cbc,JSON[_0xd539('0x22')](_0x1c5106));_0x3deb9b(_0x1c5106);})['catch'](function(_0x39464f){logger['error']('CreateCmHopper',_0x39464f[_0xd539('0xf')],_0xca1cbc);_0x4b5059(_0x289167[_0xd539('0xd')](0x1f4,_0x39464f[_0xd539('0xf')]));});});};exports[_0xd539('0x23')]=function(_0x1917c4){var _0x412f46=this;return new Promise(function(_0x489a56,_0x392753){return db[_0xd539('0x13')][_0xd539('0x24')](_0x1917c4['body'],{'raw':_0x1917c4[_0xd539('0x15')]?_0x1917c4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1917c4[_0xd539('0x15')]?_0x1917c4[_0xd539('0x15')][_0xd539('0x1e')]||null:null,'attributes':_0x1917c4[_0xd539('0x15')]?_0x1917c4['options'][_0xd539('0x17')]||null:null,'limit':_0x1917c4[_0xd539('0x15')]?_0x1917c4[_0xd539('0x15')][_0xd539('0x25')]||null:null})['then'](function(_0x158e21){logger[_0xd539('0x1b')]('UpdateCmHopper',_0x1917c4);logger[_0xd539('0x1b')](_0xd539('0x26'),JSON[_0xd539('0x22')](_0x1917c4[_0xd539('0x15')]['where']),_0x1917c4[_0xd539('0x21')][_0xd539('0x27')]);logger[_0xd539('0xb')](_0xd539('0x23'),_0x1917c4,JSON[_0xd539('0x22')](_0x158e21));_0x489a56(_0x158e21);})[_0xd539('0x11')](function(_0x9ae846){logger[_0xd539('0xd')](_0xd539('0x23'),_0x9ae846[_0xd539('0xf')],_0x1917c4);_0x392753(_0x412f46['error'](0x1f4,_0x9ae846[_0xd539('0xf')]));});});};exports[_0xd539('0x28')]=function(_0x325a7f){var _0xf4c69c=this;return new Promise(function(_0x4f72f7,_0x3c5e1a){return db[_0xd539('0x13')][_0xd539('0x29')]({'where':_0x325a7f[_0xd539('0x15')]?_0x325a7f[_0xd539('0x15')][_0xd539('0x1e')]||null:null})[_0xd539('0x8')](function(_0x5e1051){logger[_0xd539('0x1b')](_0xd539('0x28'),_0x325a7f);logger[_0xd539('0xb')](_0xd539('0x28'),_0x325a7f,JSON[_0xd539('0x22')](_0x5e1051));_0x4f72f7(_0x5e1051);})[_0xd539('0x11')](function(_0x5adaa0){logger[_0xd539('0xd')](_0xd539('0x28'),_0x5adaa0['message'],_0x325a7f);_0x3c5e1a(_0xf4c69c['error'](0x1f4,_0x5adaa0[_0xd539('0xf')]));});});};exports[_0xd539('0x2a')]=function(_0x5caf42){var _0x929090=this;return new Promise(function(_0x440601,_0x370120){return db[_0xd539('0x2b')]['describe']()[_0xd539('0x8')](function(_0x127cb6){return db[_0xd539('0x2c')][_0xd539('0x2d')](function(_0x58dda6){return db[_0xd539('0x13')][_0xd539('0x14')]({'where':_0x5caf42[_0xd539('0x15')]?_0x5caf42['options'][_0xd539('0x1e')]||null:null,'attributes':_0x5caf42[_0xd539('0x15')]?_0x5caf42[_0xd539('0x15')][_0xd539('0x17')]||null:null,'limit':_0x5caf42[_0xd539('0x15')]?_0x5caf42[_0xd539('0x15')][_0xd539('0x25')]||null:null,'order':_0x5caf42[_0xd539('0x15')]?_0x5caf42[_0xd539('0x15')][_0xd539('0x2e')]||null:null,'transaction':_0x58dda6,'lock':_0x58dda6[_0xd539('0x2f')][_0xd539('0x30')],'include':[{'model':db[_0xd539('0x2b')],'as':_0xd539('0x31'),'attributes':_[_0xd539('0x32')](_0x127cb6)},{'model':db['User'],'as':_0xd539('0x33'),'attributes':['id',_0xd539('0x34'),'voicePause']}]})['then'](function(_0x5eb783){var _0x88fe2=[];var _0x1c9792=[];for(var _0x465b92=0x0;_0x465b92<_0x5eb783[_0xd539('0x35')];_0x465b92+=0x1){var _0x57f547=_0x5eb783[_0x465b92][_0xd539('0x36')];if(_0x57f547===null){_0x88fe2[_0xd539('0x37')](_0x5eb783[_0x465b92]['update'](_0x5caf42[_0xd539('0x21')],{'transaction':_0x58dda6}));}else if(!_0x1c9792[_0xd539('0x38')](_0x57f547)){_0x1c9792[_0xd539('0x37')](_0x57f547);_0x88fe2['push'](_0x5eb783[_0x465b92][_0xd539('0x24')](_0x5caf42[_0xd539('0x21')],{'transaction':_0x58dda6}));}}return BPromise[_0xd539('0x39')](_0x88fe2);});})['then'](function(_0x174a1b){logger[_0xd539('0x1b')](_0xd539('0x2a'),_0x5caf42);if(_0x174a1b['length']>0x0){logger[_0xd539('0x1b')](_0xd539('0x3a'),_0x174a1b[0x0][_0xd539('0x3b')]['id'],_0x174a1b[0x0][_0xd539('0x3b')][_0xd539('0x3c')],_0x174a1b[0x0][_0xd539('0x3b')][_0xd539('0x27')]);}logger[_0xd539('0xb')](_0xd539('0x2a'),_0x5caf42,JSON[_0xd539('0x22')](_0x174a1b));_0x440601(_0x174a1b);})[_0xd539('0x11')](function(_0x3f4e59){logger['error'](_0xd539('0x2a'),_0x3f4e59[_0xd539('0xf')],_0x5caf42);_0x370120(_0x929090[_0xd539('0xd')](0x1f4,_0x3f4e59['message']));});});});};exports[_0xd539('0x3d')]=function(_0x1831e7){var _0x4d006a=this;return new Promise(function(_0xcdcdd1,_0x3e520e){return db[_0xd539('0x2c')][_0xd539('0x2d')](function(_0x4c3e8f){return db[_0xd539('0x3e')][_0xd539('0x20')](_0x1831e7[_0xd539('0x21')],{'raw':_0x1831e7['options']?_0x1831e7['options'][_0xd539('0x16')]===undefined?!![]:![]:!![],'transaction':_0x4c3e8f})[_0xd539('0x8')](function(){logger[_0xd539('0x1b')](_0xd539('0x3f'),JSON[_0xd539('0x22')](_0x1831e7[_0xd539('0x15')][_0xd539('0x1e')]),_0x1831e7['options'][_0xd539('0x1e')][_0xd539('0x27')]);return db[_0xd539('0x13')][_0xd539('0x29')]({'where':_0x1831e7[_0xd539('0x15')]?_0x1831e7['options'][_0xd539('0x1e')]||null:null,'transaction':_0x4c3e8f});});})['then'](function(_0x558c16){logger['info'](_0xd539('0x3d'),_0x1831e7);logger[_0xd539('0xb')](_0xd539('0x3d'),_0x1831e7,JSON[_0xd539('0x22')](_0x558c16));_0xcdcdd1(_0x558c16);})[_0xd539('0x11')](function(_0x40551b){logger['error']('MoveContactManagedDialer',_0x40551b[_0xd539('0xf')],_0x1831e7);_0x3e520e(_0x4d006a['error'](0x1f4,_0x40551b['message']));});});};exports['CountReScheduled']=function(_0x304143){var _0x4dd28a=this;return new Promise(function(_0x5470e3,_0x1dff06){return db[_0xd539('0x13')][_0xd539('0x14')]({'raw':_0x304143['options']?_0x304143[_0xd539('0x15')][_0xd539('0x16')]===undefined?!![]:![]:!![],'where':_0x304143[_0xd539('0x15')]?_0x304143[_0xd539('0x15')][_0xd539('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0xd539('0x40'),db[_0xd539('0x2c')]['fn']('IF',db[_0xd539('0x2c')][_0xd539('0x41')](_0xd539('0x42')+util[_0xd539('0x43')](_0xd539('0x44'),moment()[_0xd539('0x43')](_0xd539('0x45')))+_0xd539('0x46')))),_0xd539('0x47')]]})[_0xd539('0x8')](function(_0x2bd48d){logger[_0xd539('0x1b')]('CountReScheduled',_0x304143);logger[_0xd539('0xb')](_0xd539('0x48'),_0x304143,JSON[_0xd539('0x22')](_0x2bd48d));_0x5470e3(_0x2bd48d);})[_0xd539('0x11')](function(_0x26c6b9){logger['error'](_0xd539('0x48'),_0x26c6b9['message'],_0x304143);_0x1dff06(_0x4dd28a[_0xd539('0xd')](0x1f4,_0x26c6b9[_0xd539('0xf')]));});});};exports[_0xd539('0x49')]=function(_0x27590f){var _0x380632=this;return new Promise(function(_0x3d9412,_0x5ccbf1){return db[_0xd539('0x2b')][_0xd539('0x4a')]()['then'](function(_0x4cfcfb){return db[_0xd539('0x2c')][_0xd539('0x2d')](function(_0x384439){return db[_0xd539('0x13')][_0xd539('0x14')]({'where':_0x27590f['options']?_0x27590f[_0xd539('0x15')]['where']||null:null,'attributes':_0x27590f[_0xd539('0x15')]?_0x27590f[_0xd539('0x15')][_0xd539('0x17')]||null:null,'limit':0x1,'order':_0x27590f[_0xd539('0x15')]?_0x27590f[_0xd539('0x15')]['order']||null:null,'group':db[_0xd539('0x13')][_0xd539('0x36')],'transaction':_0x384439,'lock':_0x384439[_0xd539('0x2f')][_0xd539('0x30')],'include':_0x27590f[_0xd539('0x15')]?_0x27590f[_0xd539('0x15')]['include']?_[_0xd539('0x19')](_0x27590f[_0xd539('0x15')][_0xd539('0x18')],function(_0x435d3c){return{'model':db[_0x435d3c[_0xd539('0x1a')]],'as':_0x435d3c['as'],'attributes':_0x435d3c[_0xd539('0x17')],'include':_0x435d3c['include']?_[_0xd539('0x19')](_0x435d3c[_0xd539('0x18')],function(_0x10939d){return{'model':db[_0x10939d['model']],'as':_0x10939d['as'],'attributes':_0x10939d['attributes'],'include':_0x10939d[_0xd539('0x18')]?_['map'](_0x10939d[_0xd539('0x18')],function(_0x3d1db9){return{'model':db[_0x3d1db9['model']],'as':_0x3d1db9['as'],'attributes':_0x3d1db9[_0xd539('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd539('0x8')](function(_0x29955c){var _0x32b06d=[];for(var _0x42e6bb=0x0;_0x42e6bb<_0x29955c[_0xd539('0x35')];_0x42e6bb+=0x1){_0x32b06d[_0xd539('0x37')](_0x29955c[_0x42e6bb]['update'](_0x27590f['body'],{'transaction':_0x384439}));}return BPromise['all'](_0x32b06d);});})['then'](function(_0x7c25c9){logger[_0xd539('0x1b')]('GetContactRecallMe',_0x27590f);logger['debug'](_0xd539('0x49'),_0x27590f,JSON[_0xd539('0x22')](_0x7c25c9));_0x3d9412(_0x7c25c9);})['catch'](function(_0x632918){logger[_0xd539('0xd')](_0xd539('0x49'),_0x632918['message'],_0x27590f);_0x5ccbf1(_0x380632['error'](0x1f4,_0x632918[_0xd539('0xf')]));});});});};exports[_0xd539('0x4b')]=function(_0x460325){var _0x2eb50c=this;return new Promise(function(_0x309db5,_0x4e6d13){db[_0xd539('0x2b')][_0xd539('0x4a')]()['then'](function(_0x34f6f9){return db[_0xd539('0x13')][_0xd539('0x14')]({'raw':_0x460325[_0xd539('0x15')]?_0x460325[_0xd539('0x15')][_0xd539('0x16')]===undefined?!![]:![]:!![],'where':_0x460325[_0xd539('0x15')]?_0x460325[_0xd539('0x15')]['where']||null:null,'attributes':_0x460325[_0xd539('0x15')]?_0x460325[_0xd539('0x15')][_0xd539('0x17')]||null:null,'limit':_0x460325[_0xd539('0x15')]?_0x460325[_0xd539('0x15')][_0xd539('0x25')]||null:null,'include':_0x460325[_0xd539('0x15')]?_0x460325[_0xd539('0x15')][_0xd539('0x18')]?_['map'](_0x460325['options'][_0xd539('0x18')],function(_0x267418){return{'model':db[_0x267418[_0xd539('0x1a')]],'as':_0x267418['as'],'attributes':_0x267418['as']===_0xd539('0x31')?_[_0xd539('0x32')](_0x34f6f9):_0x267418[_0xd539('0x17')],'include':_0x267418[_0xd539('0x18')]?_[_0xd539('0x19')](_0x267418[_0xd539('0x18')],function(_0x1b248b){return{'model':db[_0x1b248b[_0xd539('0x1a')]],'as':_0x1b248b['as'],'attributes':_0x1b248b[_0xd539('0x17')],'include':_0x1b248b['include']?_['map'](_0x1b248b[_0xd539('0x18')],function(_0x62baac){return{'model':db[_0x62baac[_0xd539('0x1a')]],'as':_0x62baac['as'],'attributes':_0x62baac[_0xd539('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd539('0x8')](function(_0x1c26cf){logger['info'](_0xd539('0x12'),_0x460325);logger[_0xd539('0xb')](_0xd539('0x12'),_0x460325,JSON[_0xd539('0x22')](_0x1c26cf));_0x309db5(_0x1c26cf);})[_0xd539('0x11')](function(_0x34bbc3){logger[_0xd539('0xd')](_0xd539('0x12'),_0x34bbc3[_0xd539('0xf')],_0x460325);_0x4e6d13(_0x2eb50c['error'](0x1f4,_0x34bbc3[_0xd539('0xf')]));});});});};exports[_0xd539('0x4c')]=function(_0x318ae6){var _0x26c8e4=this;return new Promise(function(_0x283881,_0x4a5819){return db[_0xd539('0x2b')][_0xd539('0x4d')]({'raw':!![],'where':{'phone':_0x318ae6[_0xd539('0x15')][_0xd539('0x1e')][_0xd539('0x4e')]},'attributes':['id',_0xd539('0x4f')],'order':[['id',_0xd539('0x50')]]})[_0xd539('0x8')](function(_0x2e0f5b){logger[_0xd539('0x1b')]('getContactByPhone',_0x318ae6);logger['debug'](_0xd539('0x51'),_0x318ae6,JSON['stringify'](_0x2e0f5b));_0x283881(_0x2e0f5b);})[_0xd539('0x11')](function(_0x36c907){logger[_0xd539('0xd')]('getContactByPhone',_0x36c907[_0xd539('0xf')],_0x318ae6);_0x4a5819(_0x26c8e4['error'](0x1f4,_0x36c907[_0xd539('0xf')]));});});};exports['ResetActiveCalls']=function(_0x20f6be){var _0x58cb19=this;return new Promise(function(_0xd1f57c,_0x586bf8){return db[_0xd539('0x2c')][_0xd539('0x2d')](function(_0x114092){return db[_0xd539('0x13')][_0xd539('0x24')](_0x20f6be['body'],{'where':{},'transaction':_0x114092})[_0xd539('0x8')](function(_0x4af5b2){logger[_0xd539('0x1b')]('ResetActiveCalls',_0x20f6be);logger[_0xd539('0xb')](_0xd539('0x52'),_0x20f6be,JSON[_0xd539('0x22')](_0x4af5b2));_0xd1f57c(_0x4af5b2);})['catch'](function(_0x1ec5f9){logger['error'](_0xd539('0x52'),_0x1ec5f9[_0xd539('0xf')],_0x20f6be);_0x586bf8(_0x58cb19['error'](0x1f4,_0x1ec5f9[_0xd539('0xf')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x27c569){var _0x1f820d=this;var _0x34724d=_0x27c569[_0xd539('0x21')][_0xd539('0x1e')][_0xd539('0x53')];var _0x886cc7=_0x27c569['body'][_0xd539('0x1e')][_0xd539('0x54')];var _0x5bfdd2=_0x27c569[_0xd539('0x21')][_0xd539('0x1e')][_0xd539('0x55')];return new Promise(function(_0x4871f2,_0x305308){return db[_0xd539('0x13')][_0xd539('0x14')]({'where':{'voiceQueueId':{'$in':_0x34724d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xd539('0x2c')][_0xd539('0x41')]('NOW()\x20+\x20INTERVAL\x20'+_0x886cc7+_0xd539('0x56')),'$gt':db[_0xd539('0x2c')]['literal'](_0xd539('0x57'))}},'UserId':{'$in':_0x5bfdd2}},'include':[{'model':db['CmContact'],'as':_0xd539('0x31')},{'model':db[_0xd539('0x58')],'as':_0xd539('0x33'),'attributes':['id',_0xd539('0x34'),_0xd539('0x59')]},{'model':db[_0xd539('0x5a')],'as':_0xd539('0x5b')}]})[_0xd539('0x8')](function(_0xca572a){if(_0xca572a[_0xd539('0x35')]>0x0){return db[_0xd539('0x2c')][_0xd539('0x2d')](function(_0x8fd912){return db[_0xd539('0x13')][_0xd539('0x24')]({'recallmeNotifiedDate':db['sequelize'][_0xd539('0x41')]('NOW()')},{'where':{'id':{'$in':_[_0xd539('0x19')](_0xca572a,'id')}},'transaction':_0x8fd912})[_0xd539('0x8')](function(){_0x4871f2(_0xca572a);})[_0xd539('0x11')](function(_0x1e93f3){logger[_0xd539('0xd')](_0xd539('0x5c'),_0x1e93f3['message'],_0x27c569);_0x305308(_0x1f820d[_0xd539('0xd')](0x1f4,_0x1e93f3[_0xd539('0xf')]));});})[_0xd539('0x11')](function(_0xfa316b){logger[_0xd539('0xd')](_0xd539('0x5c'),_0xfa316b[_0xd539('0xf')],_0x27c569);_0x305308(_0x1f820d['error'](0x1f4,_0xfa316b['message']));});}else{_0x4871f2(_0xca572a);}});});}; \ No newline at end of file +var _0xa281=['UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','describe','transaction','order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','sequelize','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CmHopper','findAll','raw','options','where','attributes','limit','include','map','model','GetCmHopper','catch','find','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','body'];(function(_0x2827a5,_0x529d49){var _0x4d8462=function(_0x36f2c1){while(--_0x36f2c1){_0x2827a5['push'](_0x2827a5['shift']());}};_0x4d8462(++_0x529d49);}(_0xa281,0x1e9));var _0x1a28=function(_0x4620ec,_0x186293){_0x4620ec=_0x4620ec-0x0;var _0x466cba=_0xa281[_0x4620ec];return _0x466cba;};'use strict';var _=require(_0x1a28('0x0'));var util=require(_0x1a28('0x1'));var moment=require(_0x1a28('0x2'));var BPromise=require('bluebird');var db=require(_0x1a28('0x3'))['db'];var logger=require(_0x1a28('0x4'))(_0x1a28('0x5'));var jayson=require(_0x1a28('0x6'));var client=jayson[_0x1a28('0x7')][_0x1a28('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2de21a,_0x241ab1,_0x12bdcc){return new BPromise(function(_0x37a25b,_0x50c9aa){return client[_0x1a28('0x9')](_0x2de21a,_0x12bdcc)[_0x1a28('0xa')](function(_0x50dc78){logger[_0x1a28('0xb')](_0x1a28('0xc'),_0x241ab1,_0x1a28('0xd'));logger[_0x1a28('0xe')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x241ab1,_0x1a28('0xd'),JSON[_0x1a28('0xf')](_0x50dc78));if(_0x50dc78[_0x1a28('0x10')]){if(_0x50dc78[_0x1a28('0x10')][_0x1a28('0x11')]===0x1f4){logger['error'](_0x1a28('0xc'),_0x241ab1,_0x50dc78[_0x1a28('0x10')][_0x1a28('0x12')]);return _0x50c9aa(_0x50dc78['error']['message']);}logger[_0x1a28('0x10')](_0x1a28('0xc'),_0x241ab1,_0x50dc78[_0x1a28('0x10')][_0x1a28('0x12')]);return _0x37a25b(_0x50dc78[_0x1a28('0x10')][_0x1a28('0x12')]);}else{logger[_0x1a28('0xb')](_0x1a28('0xc'),_0x241ab1,_0x1a28('0xd'));_0x37a25b(_0x50dc78[_0x1a28('0x13')][_0x1a28('0x12')]);}})['catch'](function(_0x2f4b04){logger[_0x1a28('0x10')](_0x1a28('0xc'),_0x241ab1,_0x2f4b04);_0x50c9aa(_0x2f4b04);});});}exports['GetCmHopper']=function(_0x65d48){var _0x13c22c=this;return new Promise(function(_0x5e8905,_0x386a90){return db[_0x1a28('0x14')][_0x1a28('0x15')]({'raw':_0x65d48['options']?_0x65d48['options'][_0x1a28('0x16')]===undefined?!![]:![]:!![],'where':_0x65d48[_0x1a28('0x17')]?_0x65d48[_0x1a28('0x17')][_0x1a28('0x18')]||null:null,'attributes':_0x65d48[_0x1a28('0x17')]?_0x65d48['options'][_0x1a28('0x19')]||null:null,'limit':_0x65d48[_0x1a28('0x17')]?_0x65d48['options'][_0x1a28('0x1a')]||null:null,'include':_0x65d48[_0x1a28('0x17')]?_0x65d48[_0x1a28('0x17')][_0x1a28('0x1b')]?_[_0x1a28('0x1c')](_0x65d48[_0x1a28('0x17')][_0x1a28('0x1b')],function(_0x450619){return{'model':db[_0x450619['model']],'as':_0x450619['as'],'attributes':_0x450619[_0x1a28('0x19')],'include':_0x450619[_0x1a28('0x1b')]?_[_0x1a28('0x1c')](_0x450619[_0x1a28('0x1b')],function(_0x73b387){return{'model':db[_0x73b387[_0x1a28('0x1d')]],'as':_0x73b387['as'],'attributes':_0x73b387['attributes'],'include':_0x73b387[_0x1a28('0x1b')]?_[_0x1a28('0x1c')](_0x73b387[_0x1a28('0x1b')],function(_0x4be158){return{'model':db[_0x4be158[_0x1a28('0x1d')]],'as':_0x4be158['as'],'attributes':_0x4be158[_0x1a28('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1a28('0xa')](function(_0x3aa75f){logger[_0x1a28('0xb')](_0x1a28('0x1e'),_0x65d48);logger[_0x1a28('0xe')]('GetCmHopper',_0x65d48,JSON[_0x1a28('0xf')](_0x3aa75f));_0x5e8905(_0x3aa75f);})[_0x1a28('0x1f')](function(_0x2f0ebe){logger[_0x1a28('0x10')](_0x1a28('0x1e'),_0x2f0ebe[_0x1a28('0x12')],_0x65d48);_0x386a90(_0x13c22c[_0x1a28('0x10')](0x1f4,_0x2f0ebe['message']));});});};exports['ShowCmHopper']=function(_0x359e71){var _0x2c260e=this;return new Promise(function(_0x259802,_0x28c028){return db['CmHopper'][_0x1a28('0x20')]({'raw':_0x359e71[_0x1a28('0x17')]?_0x359e71[_0x1a28('0x17')][_0x1a28('0x16')]===undefined?!![]:![]:!![],'where':_0x359e71[_0x1a28('0x17')]?_0x359e71[_0x1a28('0x17')][_0x1a28('0x18')]||null:null,'attributes':_0x359e71[_0x1a28('0x17')]?_0x359e71['options'][_0x1a28('0x19')]||null:null,'include':_0x359e71[_0x1a28('0x17')]?_0x359e71[_0x1a28('0x17')][_0x1a28('0x1b')]?_[_0x1a28('0x1c')](_0x359e71[_0x1a28('0x17')][_0x1a28('0x1b')],function(_0x35409f){return{'model':db[_0x35409f[_0x1a28('0x1d')]],'as':_0x35409f['as'],'attributes':_0x35409f[_0x1a28('0x19')],'include':_0x35409f[_0x1a28('0x1b')]?_[_0x1a28('0x1c')](_0x35409f[_0x1a28('0x1b')],function(_0x1fd5d0){return{'model':db[_0x1fd5d0['model']],'as':_0x1fd5d0['as'],'attributes':_0x1fd5d0[_0x1a28('0x19')],'include':_0x1fd5d0[_0x1a28('0x1b')]?_['map'](_0x1fd5d0[_0x1a28('0x1b')],function(_0x5d163a){return{'model':db[_0x5d163a[_0x1a28('0x1d')]],'as':_0x5d163a['as'],'attributes':_0x5d163a[_0x1a28('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1a28('0xa')](function(_0x37312a){logger[_0x1a28('0xb')](_0x1a28('0x21'),_0x359e71);logger[_0x1a28('0xe')](_0x1a28('0x21'),_0x359e71,JSON[_0x1a28('0xf')](_0x37312a));_0x259802(_0x37312a);})[_0x1a28('0x1f')](function(_0x122cc9){logger[_0x1a28('0x10')](_0x1a28('0x21'),_0x122cc9[_0x1a28('0x12')],_0x359e71);_0x28c028(_0x2c260e[_0x1a28('0x10')](0x1f4,_0x122cc9[_0x1a28('0x12')]));});});};exports[_0x1a28('0x22')]=function(_0x1c9b9d){var _0x578da9=this;return new Promise(function(_0x40c4c4,_0x1ee730){return db['CmHopper'][_0x1a28('0x23')](_0x1c9b9d['body'],{'raw':_0x1c9b9d[_0x1a28('0x17')]?_0x1c9b9d[_0x1a28('0x17')][_0x1a28('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x34e1e9){logger[_0x1a28('0xb')](_0x1a28('0x22'),_0x1c9b9d);logger['debug'](_0x1a28('0x22'),_0x1c9b9d,JSON[_0x1a28('0xf')](_0x34e1e9));_0x40c4c4(_0x34e1e9);})[_0x1a28('0x1f')](function(_0x21680e){logger[_0x1a28('0x10')](_0x1a28('0x22'),_0x21680e['message'],_0x1c9b9d);_0x1ee730(_0x578da9['error'](0x1f4,_0x21680e['message']));});});};exports[_0x1a28('0x24')]=function(_0x21f5a4){var _0xeeb840=this;return new Promise(function(_0xf80552,_0x48dc1e){return db['CmHopper'][_0x1a28('0x25')](_0x21f5a4[_0x1a28('0x26')],{'raw':_0x21f5a4[_0x1a28('0x17')]?_0x21f5a4[_0x1a28('0x17')][_0x1a28('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21f5a4['options']?_0x21f5a4[_0x1a28('0x17')][_0x1a28('0x18')]||null:null,'attributes':_0x21f5a4[_0x1a28('0x17')]?_0x21f5a4[_0x1a28('0x17')][_0x1a28('0x19')]||null:null,'limit':_0x21f5a4['options']?_0x21f5a4[_0x1a28('0x17')]['limit']||null:null})[_0x1a28('0xa')](function(_0x3b91c9){logger[_0x1a28('0xb')]('UpdateCmHopper',_0x21f5a4);logger[_0x1a28('0xb')](_0x1a28('0x27'),JSON[_0x1a28('0xf')](_0x21f5a4['options'][_0x1a28('0x18')]),_0x21f5a4['body'][_0x1a28('0x28')]);logger['debug']('UpdateCmHopper',_0x21f5a4,JSON['stringify'](_0x3b91c9));_0xf80552(_0x3b91c9);})['catch'](function(_0x4e1b35){logger['error'](_0x1a28('0x24'),_0x4e1b35[_0x1a28('0x12')],_0x21f5a4);_0x48dc1e(_0xeeb840['error'](0x1f4,_0x4e1b35[_0x1a28('0x12')]));});});};exports[_0x1a28('0x29')]=function(_0x12c49a){var _0xb27f3f=this;return new Promise(function(_0x21886a,_0x3b389b){return db[_0x1a28('0x14')]['destroy']({'where':_0x12c49a[_0x1a28('0x17')]?_0x12c49a[_0x1a28('0x17')][_0x1a28('0x18')]||null:null})[_0x1a28('0xa')](function(_0x2126ab){logger['info'](_0x1a28('0x29'),_0x12c49a);logger['debug'](_0x1a28('0x29'),_0x12c49a,JSON['stringify'](_0x2126ab));_0x21886a(_0x2126ab);})['catch'](function(_0xa77bfc){logger[_0x1a28('0x10')](_0x1a28('0x29'),_0xa77bfc['message'],_0x12c49a);_0x3b389b(_0xb27f3f['error'](0x1f4,_0xa77bfc[_0x1a28('0x12')]));});});};exports[_0x1a28('0x2a')]=function(_0x5a8cf1){var _0x427dae=this;return new Promise(function(_0x5f95f3,_0x133460){return db['CmContact'][_0x1a28('0x2b')]()[_0x1a28('0xa')](function(_0x84b63){return db['sequelize'][_0x1a28('0x2c')](function(_0x4ea4e6){return db[_0x1a28('0x14')]['findAll']({'where':_0x5a8cf1[_0x1a28('0x17')]?_0x5a8cf1[_0x1a28('0x17')]['where']||null:null,'attributes':_0x5a8cf1[_0x1a28('0x17')]?_0x5a8cf1[_0x1a28('0x17')][_0x1a28('0x19')]||null:null,'limit':_0x5a8cf1[_0x1a28('0x17')]?_0x5a8cf1[_0x1a28('0x17')]['limit']||null:null,'order':_0x5a8cf1['options']?_0x5a8cf1[_0x1a28('0x17')][_0x1a28('0x2d')]||null:null,'transaction':_0x4ea4e6,'lock':_0x4ea4e6[_0x1a28('0x2e')][_0x1a28('0x2f')],'include':[{'model':db[_0x1a28('0x30')],'as':_0x1a28('0x31'),'attributes':_[_0x1a28('0x32')](_0x84b63)},{'model':db[_0x1a28('0x33')],'as':_0x1a28('0x34'),'attributes':['id',_0x1a28('0x35'),_0x1a28('0x36')]}]})[_0x1a28('0xa')](function(_0xd9aba6){var _0x2e7b79=[];var _0x491ce6=[];for(var _0x53dbbd=0x0;_0x53dbbd<_0xd9aba6[_0x1a28('0x37')];_0x53dbbd+=0x1){var _0xf691d4=_0xd9aba6[_0x53dbbd][_0x1a28('0x38')];if(_0xf691d4===null){_0x2e7b79[_0x1a28('0x39')](_0xd9aba6[_0x53dbbd][_0x1a28('0x25')](_0x5a8cf1[_0x1a28('0x26')],{'transaction':_0x4ea4e6}));}else if(!_0x491ce6['includes'](_0xf691d4)){_0x491ce6['push'](_0xf691d4);_0x2e7b79[_0x1a28('0x39')](_0xd9aba6[_0x53dbbd][_0x1a28('0x25')](_0x5a8cf1['body'],{'transaction':_0x4ea4e6}));}}return BPromise[_0x1a28('0x3a')](_0x2e7b79);});})[_0x1a28('0xa')](function(_0x445997){logger[_0x1a28('0xb')](_0x1a28('0x2a'),_0x5a8cf1);if(_0x445997[_0x1a28('0x37')]>0x0){logger['info'](_0x1a28('0x3b'),_0x445997[0x0][_0x1a28('0x3c')]['id'],_0x445997[0x0][_0x1a28('0x3c')]['ContactId'],_0x445997[0x0]['dataValues'][_0x1a28('0x28')]);}logger[_0x1a28('0xe')](_0x1a28('0x2a'),_0x5a8cf1,JSON[_0x1a28('0xf')](_0x445997));_0x5f95f3(_0x445997);})[_0x1a28('0x1f')](function(_0x4dfb61){logger[_0x1a28('0x10')](_0x1a28('0x2a'),_0x4dfb61[_0x1a28('0x12')],_0x5a8cf1);_0x133460(_0x427dae[_0x1a28('0x10')](0x1f4,_0x4dfb61['message']));});});});};exports[_0x1a28('0x3d')]=function(_0x1c7f78){var _0x5d78d6=this;return new Promise(function(_0x13c4da,_0x8711ee){return db['sequelize'][_0x1a28('0x2c')](function(_0x1914e9){return db['CmHopperFinal'][_0x1a28('0x23')](_0x1c7f78[_0x1a28('0x26')],{'raw':_0x1c7f78[_0x1a28('0x17')]?_0x1c7f78[_0x1a28('0x17')][_0x1a28('0x16')]===undefined?!![]:![]:!![],'transaction':_0x1914e9})[_0x1a28('0xa')](function(){logger[_0x1a28('0xb')](_0x1a28('0x3e'),JSON[_0x1a28('0xf')](_0x1c7f78[_0x1a28('0x17')][_0x1a28('0x18')]),_0x1c7f78[_0x1a28('0x17')][_0x1a28('0x18')][_0x1a28('0x28')]);return db[_0x1a28('0x14')][_0x1a28('0x3f')]({'where':_0x1c7f78['options']?_0x1c7f78[_0x1a28('0x17')][_0x1a28('0x18')]||null:null,'transaction':_0x1914e9});});})[_0x1a28('0xa')](function(_0x4b698e){logger[_0x1a28('0xb')](_0x1a28('0x3d'),_0x1c7f78);logger[_0x1a28('0xe')](_0x1a28('0x3d'),_0x1c7f78,JSON[_0x1a28('0xf')](_0x4b698e));_0x13c4da(_0x4b698e);})[_0x1a28('0x1f')](function(_0x34f499){logger[_0x1a28('0x10')]('MoveContactManagedDialer',_0x34f499['message'],_0x1c7f78);_0x8711ee(_0x5d78d6[_0x1a28('0x10')](0x1f4,_0x34f499['message']));});});};exports[_0x1a28('0x40')]=function(_0x399132){var _0x1eb282=this;return new Promise(function(_0x40c6d5,_0x56521e){return db[_0x1a28('0x14')][_0x1a28('0x15')]({'raw':_0x399132[_0x1a28('0x17')]?_0x399132['options']['raw']===undefined?!![]:![]:!![],'where':_0x399132[_0x1a28('0x17')]?_0x399132[_0x1a28('0x17')][_0x1a28('0x18')]||null:null,'attributes':[[db[_0x1a28('0x41')]['fn'](_0x1a28('0x42'),db['sequelize']['fn']('IF',db[_0x1a28('0x41')]['literal'](_0x1a28('0x43')+util[_0x1a28('0x44')](_0x1a28('0x45'),moment()[_0x1a28('0x44')](_0x1a28('0x46')))+_0x1a28('0x47')))),'contactsRescheduled']]})[_0x1a28('0xa')](function(_0x53a31c){logger[_0x1a28('0xb')](_0x1a28('0x40'),_0x399132);logger[_0x1a28('0xe')](_0x1a28('0x40'),_0x399132,JSON[_0x1a28('0xf')](_0x53a31c));_0x40c6d5(_0x53a31c);})[_0x1a28('0x1f')](function(_0x4bcba2){logger['error'](_0x1a28('0x40'),_0x4bcba2[_0x1a28('0x12')],_0x399132);_0x56521e(_0x1eb282[_0x1a28('0x10')](0x1f4,_0x4bcba2[_0x1a28('0x12')]));});});};exports[_0x1a28('0x48')]=function(_0x1848cf){var _0x454d30=this;return new Promise(function(_0x348a39,_0x10f6f0){return db[_0x1a28('0x30')][_0x1a28('0x2b')]()[_0x1a28('0xa')](function(_0x42a475){return db[_0x1a28('0x41')][_0x1a28('0x2c')](function(_0x49c34f){return db['CmHopper']['findAll']({'where':_0x1848cf[_0x1a28('0x17')]?_0x1848cf[_0x1a28('0x17')]['where']||null:null,'attributes':_0x1848cf[_0x1a28('0x17')]?_0x1848cf['options'][_0x1a28('0x19')]||null:null,'limit':0x1,'order':_0x1848cf[_0x1a28('0x17')]?_0x1848cf[_0x1a28('0x17')][_0x1a28('0x2d')]||null:null,'group':db[_0x1a28('0x14')][_0x1a28('0x38')],'transaction':_0x49c34f,'lock':_0x49c34f[_0x1a28('0x2e')][_0x1a28('0x2f')],'include':_0x1848cf['options']?_0x1848cf[_0x1a28('0x17')][_0x1a28('0x1b')]?_[_0x1a28('0x1c')](_0x1848cf[_0x1a28('0x17')][_0x1a28('0x1b')],function(_0x1f715a){return{'model':db[_0x1f715a[_0x1a28('0x1d')]],'as':_0x1f715a['as'],'attributes':_0x1f715a[_0x1a28('0x19')],'include':_0x1f715a[_0x1a28('0x1b')]?_['map'](_0x1f715a[_0x1a28('0x1b')],function(_0x2a7b4e){return{'model':db[_0x2a7b4e[_0x1a28('0x1d')]],'as':_0x2a7b4e['as'],'attributes':_0x2a7b4e[_0x1a28('0x19')],'include':_0x2a7b4e['include']?_[_0x1a28('0x1c')](_0x2a7b4e[_0x1a28('0x1b')],function(_0x253386){return{'model':db[_0x253386[_0x1a28('0x1d')]],'as':_0x253386['as'],'attributes':_0x253386['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a28('0xa')](function(_0x294f08){var _0x1fc23c=[];for(var _0x4497c6=0x0;_0x4497c6<_0x294f08[_0x1a28('0x37')];_0x4497c6+=0x1){_0x1fc23c[_0x1a28('0x39')](_0x294f08[_0x4497c6][_0x1a28('0x25')](_0x1848cf['body'],{'transaction':_0x49c34f}));}return BPromise[_0x1a28('0x3a')](_0x1fc23c);});})[_0x1a28('0xa')](function(_0x5d2356){logger[_0x1a28('0xb')](_0x1a28('0x48'),_0x1848cf);logger[_0x1a28('0xe')](_0x1a28('0x48'),_0x1848cf,JSON[_0x1a28('0xf')](_0x5d2356));_0x348a39(_0x5d2356);})[_0x1a28('0x1f')](function(_0x3ae905){logger[_0x1a28('0x10')]('GetContactRecallMe',_0x3ae905['message'],_0x1848cf);_0x10f6f0(_0x454d30[_0x1a28('0x10')](0x1f4,_0x3ae905[_0x1a28('0x12')]));});});});};exports[_0x1a28('0x49')]=function(_0x1ac5ef){var _0x596652=this;return new Promise(function(_0x479cfc,_0x278b38){db['CmContact'][_0x1a28('0x2b')]()[_0x1a28('0xa')](function(_0x1c5846){return db[_0x1a28('0x14')][_0x1a28('0x15')]({'raw':_0x1ac5ef['options']?_0x1ac5ef['options'][_0x1a28('0x16')]===undefined?!![]:![]:!![],'where':_0x1ac5ef[_0x1a28('0x17')]?_0x1ac5ef['options']['where']||null:null,'attributes':_0x1ac5ef[_0x1a28('0x17')]?_0x1ac5ef[_0x1a28('0x17')][_0x1a28('0x19')]||null:null,'limit':_0x1ac5ef[_0x1a28('0x17')]?_0x1ac5ef[_0x1a28('0x17')]['limit']||null:null,'include':_0x1ac5ef[_0x1a28('0x17')]?_0x1ac5ef[_0x1a28('0x17')]['include']?_['map'](_0x1ac5ef[_0x1a28('0x17')]['include'],function(_0x420f09){return{'model':db[_0x420f09[_0x1a28('0x1d')]],'as':_0x420f09['as'],'attributes':_0x420f09['as']===_0x1a28('0x31')?_[_0x1a28('0x32')](_0x1c5846):_0x420f09[_0x1a28('0x19')],'include':_0x420f09[_0x1a28('0x1b')]?_['map'](_0x420f09[_0x1a28('0x1b')],function(_0x4abea4){return{'model':db[_0x4abea4[_0x1a28('0x1d')]],'as':_0x4abea4['as'],'attributes':_0x4abea4[_0x1a28('0x19')],'include':_0x4abea4[_0x1a28('0x1b')]?_[_0x1a28('0x1c')](_0x4abea4['include'],function(_0x4a10f6){return{'model':db[_0x4a10f6['model']],'as':_0x4a10f6['as'],'attributes':_0x4a10f6[_0x1a28('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1a28('0xa')](function(_0x56474a){logger[_0x1a28('0xb')](_0x1a28('0x1e'),_0x1ac5ef);logger[_0x1a28('0xe')](_0x1a28('0x1e'),_0x1ac5ef,JSON[_0x1a28('0xf')](_0x56474a));_0x479cfc(_0x56474a);})[_0x1a28('0x1f')](function(_0x3986cb){logger['error'](_0x1a28('0x1e'),_0x3986cb[_0x1a28('0x12')],_0x1ac5ef);_0x278b38(_0x596652[_0x1a28('0x10')](0x1f4,_0x3986cb[_0x1a28('0x12')]));});});});};exports[_0x1a28('0x4a')]=function(_0x26b487){var _0x3a1d0e=this;return new Promise(function(_0x3820d8,_0x332e7d){return db[_0x1a28('0x30')]['findOne']({'raw':!![],'where':{'phone':_0x26b487[_0x1a28('0x17')][_0x1a28('0x18')][_0x1a28('0x4b')]},'attributes':['id',_0x1a28('0x4c')],'order':[['id','DESC']]})[_0x1a28('0xa')](function(_0x54fad8){logger[_0x1a28('0xb')](_0x1a28('0x4d'),_0x26b487);logger[_0x1a28('0xe')]('getContactByPhone',_0x26b487,JSON[_0x1a28('0xf')](_0x54fad8));_0x3820d8(_0x54fad8);})['catch'](function(_0x4c8708){logger[_0x1a28('0x10')]('getContactByPhone',_0x4c8708[_0x1a28('0x12')],_0x26b487);_0x332e7d(_0x3a1d0e['error'](0x1f4,_0x4c8708['message']));});});};exports[_0x1a28('0x4e')]=function(_0xfce51b){var _0x571265=this;return new Promise(function(_0x319d52,_0x1e34de){return db[_0x1a28('0x41')]['transaction'](function(_0x335fd9){return db['CmHopper'][_0x1a28('0x25')](_0xfce51b[_0x1a28('0x26')],{'where':{},'transaction':_0x335fd9})['then'](function(_0x307682){logger[_0x1a28('0xb')]('ResetActiveCalls',_0xfce51b);logger[_0x1a28('0xe')](_0x1a28('0x4e'),_0xfce51b,JSON[_0x1a28('0xf')](_0x307682));_0x319d52(_0x307682);})[_0x1a28('0x1f')](function(_0x1c34d2){logger[_0x1a28('0x10')](_0x1a28('0x4e'),_0x1c34d2['message'],_0xfce51b);_0x1e34de(_0x571265[_0x1a28('0x10')](0x1f4,_0x1c34d2[_0x1a28('0x12')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x1ea8c7){var _0x19cdc4=this;var _0x2b8c09=_0x1ea8c7[_0x1a28('0x26')]['where'][_0x1a28('0x4f')];var _0x4a98f8=_0x1ea8c7[_0x1a28('0x26')]['where'][_0x1a28('0x50')];var _0x13e530=_0x1ea8c7['body'][_0x1a28('0x18')][_0x1a28('0x51')];return new Promise(function(_0x5a9ef3,_0x4573ab){return db[_0x1a28('0x14')][_0x1a28('0x15')]({'where':{'voiceQueueId':{'$in':_0x2b8c09},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x1a28('0x52')](_0x1a28('0x53')+_0x4a98f8+'\x20MINUTE'),'$gt':db[_0x1a28('0x41')]['literal'](_0x1a28('0x54'))}},'UserId':{'$in':_0x13e530}},'include':[{'model':db[_0x1a28('0x30')],'as':_0x1a28('0x31')},{'model':db[_0x1a28('0x33')],'as':'Agent','attributes':['id',_0x1a28('0x35'),'voicePause']},{'model':db[_0x1a28('0x55')],'as':_0x1a28('0x56')}]})['then'](function(_0xfe804c){if(_0xfe804c[_0x1a28('0x37')]>0x0){return db['sequelize']['transaction'](function(_0x31b831){return db[_0x1a28('0x14')][_0x1a28('0x25')]({'recallmeNotifiedDate':db[_0x1a28('0x41')]['literal'](_0x1a28('0x54'))},{'where':{'id':{'$in':_['map'](_0xfe804c,'id')}},'transaction':_0x31b831})[_0x1a28('0xa')](function(){_0x5a9ef3(_0xfe804c);})['catch'](function(_0x4ed827){logger[_0x1a28('0x10')](_0x1a28('0x57'),_0x4ed827[_0x1a28('0x12')],_0x1ea8c7);_0x4573ab(_0x19cdc4[_0x1a28('0x10')](0x1f4,_0x4ed827[_0x1a28('0x12')]));});})[_0x1a28('0x1f')](function(_0x1c0a77){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x1c0a77[_0x1a28('0x12')],_0x1ea8c7);_0x4573ab(_0x19cdc4[_0x1a28('0x10')](0x1f4,_0x1c0a77[_0x1a28('0x12')]));});}else{_0x5a9ef3(_0xfe804c);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 0b31cba..d60e772 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 _0xf7da=['/timezones','/:id','getPreviewRecall','post','create','getPreview','/timezone','getTimezone','update','delete','destroy','exports','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe'];(function(_0x3f2302,_0x3c3363){var _0x55fed4=function(_0x14d32e){while(--_0x14d32e){_0x3f2302['push'](_0x3f2302['shift']());}};_0x55fed4(++_0x3c3363);}(_0xf7da,0x84));var _0xaf7d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf7da[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require(_0xaf7d('0x0'));var router=express[_0xaf7d('0x1')]();var auth=require(_0xaf7d('0x2'));var controller=require('./cmHopper.controller');router[_0xaf7d('0x3')]('/',auth[_0xaf7d('0x4')](),controller[_0xaf7d('0x5')]);router[_0xaf7d('0x3')](_0xaf7d('0x6'),auth[_0xaf7d('0x4')](),controller[_0xaf7d('0x7')]);router[_0xaf7d('0x3')]('/opencontacts',auth[_0xaf7d('0x4')](),controller['getOpenContacts']);router[_0xaf7d('0x3')](_0xaf7d('0x8'),auth['isAuthenticated'](),controller['getTimezones']);router[_0xaf7d('0x3')](_0xaf7d('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/previewrecall',auth[_0xaf7d('0x4')](),controller[_0xaf7d('0xa')]);router[_0xaf7d('0xb')]('/',auth[_0xaf7d('0x4')](),controller[_0xaf7d('0xc')]);router[_0xaf7d('0xb')]('/preview',auth[_0xaf7d('0x4')](),controller[_0xaf7d('0xd')]);router['post'](_0xaf7d('0xe'),auth['isAuthenticated'](),controller[_0xaf7d('0xf')]);router['put'](_0xaf7d('0x9'),auth['isAuthenticated'](),controller[_0xaf7d('0x10')]);router[_0xaf7d('0x11')](_0xaf7d('0x9'),auth[_0xaf7d('0x4')](),controller[_0xaf7d('0x12')]);module[_0xaf7d('0x13')]=router; \ No newline at end of file +var _0x75cc=['put','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','index','/describe','isAuthenticated','/opencontacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','/timezone','getTimezone'];(function(_0x296976,_0x1e61f6){var _0x436912=function(_0x8d5af1){while(--_0x8d5af1){_0x296976['push'](_0x296976['shift']());}};_0x436912(++_0x1e61f6);}(_0x75cc,0xa6));var _0xc75c=function(_0x3f141d,_0x59720b){_0x3f141d=_0x3f141d-0x0;var _0x30d16d=_0x75cc[_0x3f141d];return _0x30d16d;};'use strict';var express=require(_0xc75c('0x0'));var router=express[_0xc75c('0x1')]();var auth=require(_0xc75c('0x2'));var controller=require(_0xc75c('0x3'));router[_0xc75c('0x4')]('/',auth['isAuthenticated'](),controller[_0xc75c('0x5')]);router['get'](_0xc75c('0x6'),auth[_0xc75c('0x7')](),controller['describe']);router['get'](_0xc75c('0x8'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xc75c('0x4')](_0xc75c('0x9'),auth[_0xc75c('0x7')](),controller[_0xc75c('0xa')]);router['get'](_0xc75c('0xb'),auth['isAuthenticated'](),controller[_0xc75c('0xc')]);router[_0xc75c('0x4')](_0xc75c('0xd'),auth[_0xc75c('0x7')](),controller[_0xc75c('0xe')]);router[_0xc75c('0xf')]('/',auth[_0xc75c('0x7')](),controller['create']);router['post']('/preview',auth['isAuthenticated'](),controller['getPreview']);router[_0xc75c('0xf')](_0xc75c('0x10'),auth['isAuthenticated'](),controller[_0xc75c('0x11')]);router[_0xc75c('0x12')](_0xc75c('0xb'),auth['isAuthenticated'](),controller[_0xc75c('0x13')]);router[_0xc75c('0x14')]('/:id',auth[_0xc75c('0x7')](),controller[_0xc75c('0x15')]);module[_0xc75c('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 5d2ca1d..4cb659b 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 _0xab21=['sequelize','exports','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xab21,0x12c));var _0x1ab2=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xab21[_0x6cf19c];return _0xce14f3;};'use strict';var moment=require(_0x1ab2('0x0'));var Sequelize=require(_0x1ab2('0x1'));module[_0x1ab2('0x2')]={'CmHopperId':{'type':Sequelize[_0x1ab2('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x1ab2('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x1ab2('0x4')],'defaultValue':moment()[_0x1ab2('0x5')](_0x1ab2('0x6'))},'countbusyretry':{'type':Sequelize[_0x1ab2('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1ab2('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x1ab2('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1ab2('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1ab2('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1ab2('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1ab2('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe7cc=['INTEGER','moment','sequelize','exports','STRING'];(function(_0x52a8ec,_0x84de79){var _0x4b7304=function(_0xf87687){while(--_0xf87687){_0x52a8ec['push'](_0x52a8ec['shift']());}};_0x4b7304(++_0x84de79);}(_0xe7cc,0x146));var _0xce7c=function(_0x142df4,_0xf1d9b5){_0x142df4=_0x142df4-0x0;var _0x1aa66b=_0xe7cc[_0x142df4];return _0x1aa66b;};'use strict';var moment=require(_0xce7c('0x0'));var Sequelize=require(_0xce7c('0x1'));module[_0xce7c('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xce7c('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xce7c('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xce7c('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xce7c('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xce7c('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xce7c('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xce7c('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xce7c('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 e77e195..1158285 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 _0xbe1c=['model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','options','CmHopperAdditionalPhone','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key'];(function(_0x8fe6a3,_0x5135d0){var _0x4e7614=function(_0x369587){while(--_0x369587){_0x8fe6a3['push'](_0x8fe6a3['shift']());}};_0x4e7614(++_0x5135d0);}(_0xbe1c,0x15d));var _0xcbe1=function(_0x4ed083,_0x4ecf98){_0x4ed083=_0x4ed083-0x0;var _0x4ae41f=_0xbe1c[_0x4ed083];return _0x4ae41f;};'use strict';var emlformat=require(_0xcbe1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbe1('0x1'));var rp=require(_0xcbe1('0x2'));var moment=require(_0xcbe1('0x3'));var BPromise=require(_0xcbe1('0x4'));var Mustache=require(_0xcbe1('0x5'));var util=require(_0xcbe1('0x6'));var path=require(_0xcbe1('0x7'));var sox=require('sox');var csv=require(_0xcbe1('0x8'));var ejs=require(_0xcbe1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbe1('0xa'));var squel=require(_0xcbe1('0xb'));var crypto=require(_0xcbe1('0xc'));var jsforce=require(_0xcbe1('0xd'));var deskjs=require(_0xcbe1('0xe'));var toCsv=require(_0xcbe1('0x8'));var querystring=require(_0xcbe1('0xf'));var Papa=require(_0xcbe1('0x10'));var Redis=require(_0xcbe1('0x11'));var authService=require(_0xcbe1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcbe1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xcbe1('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcbe1('0x15'))['db'];function respondWithStatusCode(_0x57ec40,_0x428ba6){_0x428ba6=_0x428ba6||0xcc;return function(_0x27e888){if(_0x27e888){return _0x57ec40[_0xcbe1('0x16')](_0x428ba6);}return _0x57ec40[_0xcbe1('0x17')](_0x428ba6)['end']();};}function respondWithResult(_0x2863a4,_0x4cfd35){_0x4cfd35=_0x4cfd35||0xc8;return function(_0x43997c){if(_0x43997c){return _0x2863a4[_0xcbe1('0x17')](_0x4cfd35)[_0xcbe1('0x18')](_0x43997c);}};}function respondWithFilteredResult(_0x322a98,_0x262ee9){return function(_0x4ebaa8){if(_0x4ebaa8){var _0xfd1273=typeof _0x262ee9[_0xcbe1('0x19')]===_0xcbe1('0x1a')&&typeof _0x262ee9[_0xcbe1('0x1b')]===_0xcbe1('0x1a');var _0x3cf100=_0x4ebaa8['count'];var _0xc2fc49=_0xfd1273?0x0:_0x262ee9[_0xcbe1('0x19')];var _0x437e16=_0xfd1273?_0x4ebaa8[_0xcbe1('0x1c')]:_0x262ee9[_0xcbe1('0x19')]+_0x262ee9[_0xcbe1('0x1b')];var _0x51acc8;if(_0x437e16>=_0x3cf100){_0x437e16=_0x3cf100;_0x51acc8=0xc8;}else{_0x51acc8=0xce;}_0x322a98[_0xcbe1('0x17')](_0x51acc8);return _0x322a98['set'](_0xcbe1('0x1d'),_0xc2fc49+'-'+_0x437e16+'/'+_0x3cf100)[_0xcbe1('0x18')](_0x4ebaa8);}return null;};}function patchUpdates(_0x59e4b7){return function(_0x3ba4d2){try{jsonpatch[_0xcbe1('0x1e')](_0x3ba4d2,_0x59e4b7,!![]);}catch(_0x4802c4){return BPromise[_0xcbe1('0x1f')](_0x4802c4);}return _0x3ba4d2['save']();};}function saveUpdates(_0x11ca89,_0x585ad0){return function(_0x436b80){if(_0x436b80){return _0x436b80['update'](_0x11ca89)[_0xcbe1('0x20')](function(_0x370421){return _0x370421;});}return null;};}function removeEntity(_0x190c5f,_0x1d9a5c){return function(_0x2587c5){if(_0x2587c5){return _0x2587c5[_0xcbe1('0x21')]()[_0xcbe1('0x20')](function(){var _0x4d7850=_0x2587c5[_0xcbe1('0x22')]({'plain':!![]});var _0x58a43b=_0xcbe1('0x23');return db[_0xcbe1('0x24')]['destroy']({'where':{'type':_0x58a43b,'resourceId':_0x4d7850['id']}})[_0xcbe1('0x20')](function(){return _0x2587c5;});})[_0xcbe1('0x20')](function(){_0x190c5f[_0xcbe1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a63f5,_0x570745){return function(_0x47b430){if(!_0x47b430){_0x5a63f5['sendStatus'](0x194);}return _0x47b430;};}function handleError(_0x558c7b,_0x2fbb84){_0x2fbb84=_0x2fbb84||0x1f4;return function(_0x1aa7be){logger[_0xcbe1('0x25')](_0x1aa7be[_0xcbe1('0x26')]);if(_0x1aa7be[_0xcbe1('0x27')]){delete _0x1aa7be[_0xcbe1('0x27')];}_0x558c7b[_0xcbe1('0x17')](_0x2fbb84)[_0xcbe1('0x28')](_0x1aa7be);};}exports['index']=function(_0x162216,_0x12df04){var _0x516e47={},_0x1104fb={},_0x249370={'count':0x0,'rows':[]};var _0x511d38=_[_0xcbe1('0x29')](db['CmHopperAdditionalPhone'][_0xcbe1('0x2a')],function(_0x5c62d2){return{'name':_0x5c62d2[_0xcbe1('0x2b')],'type':_0x5c62d2[_0xcbe1('0x2c')][_0xcbe1('0x2d')]};});_0x1104fb[_0xcbe1('0x2e')]=_[_0xcbe1('0x29')](_0x511d38,_0xcbe1('0x27'));_0x1104fb[_0xcbe1('0x2f')]=_[_0xcbe1('0x30')](_0x162216[_0xcbe1('0x2f')]);_0x1104fb['filters']=_[_0xcbe1('0x31')](_0x1104fb['model'],_0x1104fb[_0xcbe1('0x2f')]);_0x516e47['attributes']=_['intersection'](_0x1104fb[_0xcbe1('0x2e')],qs[_0xcbe1('0x32')](_0x162216[_0xcbe1('0x2f')]['fields']));_0x516e47[_0xcbe1('0x33')]=_0x516e47[_0xcbe1('0x33')][_0xcbe1('0x34')]?_0x516e47[_0xcbe1('0x33')]:_0x1104fb[_0xcbe1('0x2e')];if(!_0x162216[_0xcbe1('0x2f')][_0xcbe1('0x35')](_0xcbe1('0x36'))){_0x516e47[_0xcbe1('0x1b')]=qs[_0xcbe1('0x1b')](_0x162216['query'][_0xcbe1('0x1b')]);_0x516e47[_0xcbe1('0x19')]=qs[_0xcbe1('0x19')](_0x162216[_0xcbe1('0x2f')][_0xcbe1('0x19')]);}_0x516e47[_0xcbe1('0x37')]=qs[_0xcbe1('0x38')](_0x162216[_0xcbe1('0x2f')][_0xcbe1('0x38')]);_0x516e47['where']=qs[_0xcbe1('0x39')](_['pick'](_0x162216[_0xcbe1('0x2f')],_0x1104fb[_0xcbe1('0x39')]),_0x511d38);if(_0x162216[_0xcbe1('0x2f')][_0xcbe1('0x3a')]){_0x516e47['where']=_[_0xcbe1('0x3b')](_0x516e47[_0xcbe1('0x3c')],{'$or':_[_0xcbe1('0x29')](_0x511d38,function(_0x2785b8){if(_0x2785b8[_0xcbe1('0x2c')]!=='VIRTUAL'){var _0x1d0d18={};_0x1d0d18[_0x2785b8[_0xcbe1('0x27')]]={'$like':'%'+_0x162216[_0xcbe1('0x2f')][_0xcbe1('0x3a')]+'%'};return _0x1d0d18;}})});}_0x516e47=_[_0xcbe1('0x3b')]({},_0x516e47,_0x162216[_0xcbe1('0x3d')]);var _0x2f63a0={'where':_0x516e47[_0xcbe1('0x3c')]};return db[_0xcbe1('0x3e')][_0xcbe1('0x1c')](_0x2f63a0)[_0xcbe1('0x20')](function(_0x2f0671){_0x249370[_0xcbe1('0x1c')]=_0x2f0671;if(_0x162216[_0xcbe1('0x2f')]['includeAll']){_0x516e47[_0xcbe1('0x3f')]=[{'all':!![]}];}return db[_0xcbe1('0x3e')][_0xcbe1('0x40')](_0x516e47);})[_0xcbe1('0x20')](function(_0x1433db){_0x249370[_0xcbe1('0x41')]=_0x1433db;return _0x249370;})[_0xcbe1('0x20')](respondWithFilteredResult(_0x12df04,_0x516e47))[_0xcbe1('0x42')](handleError(_0x12df04,null));};exports[_0xcbe1('0x43')]=function(_0x2fa1eb,_0x2f021e){var _0x8ab7f8={'raw':!![],'where':{'id':_0x2fa1eb[_0xcbe1('0x44')]['id']}},_0x587377={};_0x587377['model']=_['keys'](db[_0xcbe1('0x3e')][_0xcbe1('0x2a')]);_0x587377['query']=_[_0xcbe1('0x30')](_0x2fa1eb[_0xcbe1('0x2f')]);_0x587377[_0xcbe1('0x39')]=_[_0xcbe1('0x31')](_0x587377['model'],_0x587377[_0xcbe1('0x2f')]);_0x8ab7f8[_0xcbe1('0x33')]=_['intersection'](_0x587377[_0xcbe1('0x2e')],qs['fields'](_0x2fa1eb['query'][_0xcbe1('0x32')]));_0x8ab7f8[_0xcbe1('0x33')]=_0x8ab7f8[_0xcbe1('0x33')]['length']?_0x8ab7f8[_0xcbe1('0x33')]:_0x587377['model'];if(_0x2fa1eb[_0xcbe1('0x2f')]['includeAll']){_0x8ab7f8[_0xcbe1('0x3f')]=[{'all':!![]}];}_0x8ab7f8=_[_0xcbe1('0x3b')]({},_0x8ab7f8,_0x2fa1eb[_0xcbe1('0x3d')]);return db['CmHopperAdditionalPhone'][_0xcbe1('0x45')](_0x8ab7f8)['then'](handleEntityNotFound(_0x2f021e,null))[_0xcbe1('0x20')](respondWithResult(_0x2f021e,null))[_0xcbe1('0x42')](handleError(_0x2f021e,null));};exports[_0xcbe1('0x46')]=function(_0x3bc0c6,_0x1dca5a){return db[_0xcbe1('0x3e')][_0xcbe1('0x46')](_0x3bc0c6[_0xcbe1('0x47')],{})[_0xcbe1('0x20')](function(_0x46fa12){var _0x4eda5d=_0x3bc0c6[_0xcbe1('0x48')][_0xcbe1('0x22')]({'plain':!![]});if(!_0x4eda5d)throw new Error(_0xcbe1('0x49'));if(_0x4eda5d[_0xcbe1('0x4a')]==='user'){var _0x1d9b73=_0x46fa12[_0xcbe1('0x22')]({'plain':!![]});var _0x48b336=_0xcbe1('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x48b336,'userProfileId':_0x4eda5d[_0xcbe1('0x4b')]},'raw':!![]})[_0xcbe1('0x20')](function(_0x52269b){if(_0x52269b&&_0x52269b[_0xcbe1('0x4c')]===0x0){return db[_0xcbe1('0x24')]['create']({'name':_0x1d9b73[_0xcbe1('0x27')],'resourceId':_0x1d9b73['id'],'type':_0x52269b['name'],'sectionId':_0x52269b['id']},{})[_0xcbe1('0x20')](function(){return _0x46fa12;});}else{return _0x46fa12;}})['catch'](function(_0x52c025){logger[_0xcbe1('0x25')](_0xcbe1('0x4d'),_0x52c025);throw _0x52c025;});}return _0x46fa12;})[_0xcbe1('0x20')](respondWithResult(_0x1dca5a,0xc9))[_0xcbe1('0x42')](handleError(_0x1dca5a,null));};exports[_0xcbe1('0x4e')]=function(_0x106f8f,_0x390da6){if(_0x106f8f[_0xcbe1('0x47')]['id']){delete _0x106f8f['body']['id'];}return db[_0xcbe1('0x3e')][_0xcbe1('0x45')]({'where':{'id':_0x106f8f[_0xcbe1('0x44')]['id']}})['then'](handleEntityNotFound(_0x390da6,null))[_0xcbe1('0x20')](saveUpdates(_0x106f8f['body'],null))[_0xcbe1('0x20')](respondWithResult(_0x390da6,null))[_0xcbe1('0x42')](handleError(_0x390da6,null));};exports[_0xcbe1('0x21')]=function(_0x48a4d9,_0x56eaaa){return db['CmHopperAdditionalPhone'][_0xcbe1('0x45')]({'where':{'id':_0x48a4d9['params']['id']}})[_0xcbe1('0x20')](handleEntityNotFound(_0x56eaaa,null))['then'](removeEntity(_0x56eaaa,null))['catch'](handleError(_0x56eaaa,null));}; \ No newline at end of file +var _0xe4ef=['apply','reject','save','update','then','CmHopperAdditionalPhones','destroy','name','send','index','map','CmHopperAdditionalPhone','type','key','query','keys','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range'];(function(_0x14b6c2,_0x4a790a){var _0x6ac993=function(_0x21447a){while(--_0x21447a){_0x14b6c2['push'](_0x14b6c2['shift']());}};_0x6ac993(++_0x4a790a);}(_0xe4ef,0x170));var _0xfe4e=function(_0x355857,_0x4bd3c7){_0x355857=_0x355857-0x0;var _0x5ab036=_0xe4ef[_0x355857];return _0x5ab036;};'use strict';var emlformat=require(_0xfe4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe4e('0x1'));var jsonpatch=require(_0xfe4e('0x2'));var rp=require(_0xfe4e('0x3'));var moment=require(_0xfe4e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe4e('0x5'));var util=require(_0xfe4e('0x6'));var path=require(_0xfe4e('0x7'));var sox=require(_0xfe4e('0x8'));var csv=require('to-csv');var ejs=require(_0xfe4e('0x9'));var fs=require('fs');var fs_extra=require(_0xfe4e('0xa'));var _=require('lodash');var squel=require(_0xfe4e('0xb'));var crypto=require('crypto');var jsforce=require(_0xfe4e('0xc'));var deskjs=require(_0xfe4e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfe4e('0xe'));var Papa=require('papaparse');var Redis=require(_0xfe4e('0xf'));var authService=require(_0xfe4e('0x10'));var qs=require(_0xfe4e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe4e('0x12'));var logger=require('../../config/logger')(_0xfe4e('0x13'));var utils=require(_0xfe4e('0x14'));var config=require(_0xfe4e('0x15'));var licenseUtil=require(_0xfe4e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d1cbd,_0x49b83f){_0x49b83f=_0x49b83f||0xcc;return function(_0x303863){if(_0x303863){return _0x3d1cbd[_0xfe4e('0x17')](_0x49b83f);}return _0x3d1cbd['status'](_0x49b83f)[_0xfe4e('0x18')]();};}function respondWithResult(_0x1a1949,_0x4f3423){_0x4f3423=_0x4f3423||0xc8;return function(_0x4cb278){if(_0x4cb278){return _0x1a1949['status'](_0x4f3423)[_0xfe4e('0x19')](_0x4cb278);}};}function respondWithFilteredResult(_0x4fe01f,_0x32308b){return function(_0xec0a18){if(_0xec0a18){var _0x592614=typeof _0x32308b[_0xfe4e('0x1a')]===_0xfe4e('0x1b')&&typeof _0x32308b[_0xfe4e('0x1c')]===_0xfe4e('0x1b');var _0x5f1a30=_0xec0a18['count'];var _0x2327e2=_0x592614?0x0:_0x32308b[_0xfe4e('0x1a')];var _0x560435=_0x592614?_0xec0a18[_0xfe4e('0x1d')]:_0x32308b[_0xfe4e('0x1a')]+_0x32308b[_0xfe4e('0x1c')];var _0x1b27d2;if(_0x560435>=_0x5f1a30){_0x560435=_0x5f1a30;_0x1b27d2=0xc8;}else{_0x1b27d2=0xce;}_0x4fe01f[_0xfe4e('0x1e')](_0x1b27d2);return _0x4fe01f['set'](_0xfe4e('0x1f'),_0x2327e2+'-'+_0x560435+'/'+_0x5f1a30)['json'](_0xec0a18);}return null;};}function patchUpdates(_0x769888){return function(_0x42e3c5){try{jsonpatch[_0xfe4e('0x20')](_0x42e3c5,_0x769888,!![]);}catch(_0x434a7a){return BPromise[_0xfe4e('0x21')](_0x434a7a);}return _0x42e3c5[_0xfe4e('0x22')]();};}function saveUpdates(_0x5d6b11,_0x204c29){return function(_0x34b7cb){if(_0x34b7cb){return _0x34b7cb[_0xfe4e('0x23')](_0x5d6b11)[_0xfe4e('0x24')](function(_0x5b242d){return _0x5b242d;});}return null;};}function removeEntity(_0x58d86e,_0x31b158){return function(_0x3af315){if(_0x3af315){return _0x3af315['destroy']()[_0xfe4e('0x24')](function(){var _0x5298be=_0x3af315['get']({'plain':!![]});var _0x2048c2=_0xfe4e('0x25');return db['UserProfileResource'][_0xfe4e('0x26')]({'where':{'type':_0x2048c2,'resourceId':_0x5298be['id']}})[_0xfe4e('0x24')](function(){return _0x3af315;});})[_0xfe4e('0x24')](function(){_0x58d86e[_0xfe4e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa2076c,_0x5e238d){return function(_0x2417e9){if(!_0x2417e9){_0xa2076c['sendStatus'](0x194);}return _0x2417e9;};}function handleError(_0x328641,_0x5f2569){_0x5f2569=_0x5f2569||0x1f4;return function(_0x3dea42){logger['error'](_0x3dea42['stack']);if(_0x3dea42[_0xfe4e('0x27')]){delete _0x3dea42[_0xfe4e('0x27')];}_0x328641[_0xfe4e('0x1e')](_0x5f2569)[_0xfe4e('0x28')](_0x3dea42);};}exports[_0xfe4e('0x29')]=function(_0x32ecfc,_0xfd5dcd){var _0x458ef5={},_0x2c0fdb={},_0x585fa0={'count':0x0,'rows':[]};var _0x1e89a2=_[_0xfe4e('0x2a')](db[_0xfe4e('0x2b')]['rawAttributes'],function(_0x561d0c){return{'name':_0x561d0c['fieldName'],'type':_0x561d0c[_0xfe4e('0x2c')][_0xfe4e('0x2d')]};});_0x2c0fdb['model']=_[_0xfe4e('0x2a')](_0x1e89a2,_0xfe4e('0x27'));_0x2c0fdb[_0xfe4e('0x2e')]=_[_0xfe4e('0x2f')](_0x32ecfc[_0xfe4e('0x2e')]);_0x2c0fdb['filters']=_['intersection'](_0x2c0fdb[_0xfe4e('0x30')],_0x2c0fdb[_0xfe4e('0x2e')]);_0x458ef5[_0xfe4e('0x31')]=_[_0xfe4e('0x32')](_0x2c0fdb['model'],qs['fields'](_0x32ecfc[_0xfe4e('0x2e')]['fields']));_0x458ef5[_0xfe4e('0x31')]=_0x458ef5[_0xfe4e('0x31')][_0xfe4e('0x33')]?_0x458ef5[_0xfe4e('0x31')]:_0x2c0fdb[_0xfe4e('0x30')];if(!_0x32ecfc[_0xfe4e('0x2e')][_0xfe4e('0x34')](_0xfe4e('0x35'))){_0x458ef5[_0xfe4e('0x1c')]=qs[_0xfe4e('0x1c')](_0x32ecfc[_0xfe4e('0x2e')][_0xfe4e('0x1c')]);_0x458ef5[_0xfe4e('0x1a')]=qs[_0xfe4e('0x1a')](_0x32ecfc[_0xfe4e('0x2e')]['offset']);}_0x458ef5['order']=qs[_0xfe4e('0x36')](_0x32ecfc[_0xfe4e('0x2e')][_0xfe4e('0x36')]);_0x458ef5[_0xfe4e('0x37')]=qs['filters'](_[_0xfe4e('0x38')](_0x32ecfc['query'],_0x2c0fdb['filters']),_0x1e89a2);if(_0x32ecfc[_0xfe4e('0x2e')][_0xfe4e('0x39')]){_0x458ef5[_0xfe4e('0x37')]=_[_0xfe4e('0x3a')](_0x458ef5[_0xfe4e('0x37')],{'$or':_['map'](_0x1e89a2,function(_0x2e1448){if(_0x2e1448[_0xfe4e('0x2c')]!==_0xfe4e('0x3b')){var _0x3fd637={};_0x3fd637[_0x2e1448['name']]={'$like':'%'+_0x32ecfc[_0xfe4e('0x2e')][_0xfe4e('0x39')]+'%'};return _0x3fd637;}})});}_0x458ef5=_[_0xfe4e('0x3a')]({},_0x458ef5,_0x32ecfc[_0xfe4e('0x3c')]);var _0x116244={'where':_0x458ef5['where']};return db[_0xfe4e('0x2b')][_0xfe4e('0x1d')](_0x116244)[_0xfe4e('0x24')](function(_0xd9c341){_0x585fa0[_0xfe4e('0x1d')]=_0xd9c341;if(_0x32ecfc[_0xfe4e('0x2e')]['includeAll']){_0x458ef5[_0xfe4e('0x3d')]=[{'all':!![]}];}return db[_0xfe4e('0x2b')][_0xfe4e('0x3e')](_0x458ef5);})['then'](function(_0x50574b){_0x585fa0[_0xfe4e('0x3f')]=_0x50574b;return _0x585fa0;})[_0xfe4e('0x24')](respondWithFilteredResult(_0xfd5dcd,_0x458ef5))[_0xfe4e('0x40')](handleError(_0xfd5dcd,null));};exports[_0xfe4e('0x41')]=function(_0x344c93,_0x4d5374){var _0xdcb8aa={'raw':!![],'where':{'id':_0x344c93[_0xfe4e('0x42')]['id']}},_0xa5feb={};_0xa5feb['model']=_[_0xfe4e('0x2f')](db[_0xfe4e('0x2b')]['rawAttributes']);_0xa5feb['query']=_[_0xfe4e('0x2f')](_0x344c93['query']);_0xa5feb['filters']=_[_0xfe4e('0x32')](_0xa5feb[_0xfe4e('0x30')],_0xa5feb[_0xfe4e('0x2e')]);_0xdcb8aa[_0xfe4e('0x31')]=_[_0xfe4e('0x32')](_0xa5feb['model'],qs[_0xfe4e('0x43')](_0x344c93[_0xfe4e('0x2e')][_0xfe4e('0x43')]));_0xdcb8aa['attributes']=_0xdcb8aa[_0xfe4e('0x31')]['length']?_0xdcb8aa[_0xfe4e('0x31')]:_0xa5feb[_0xfe4e('0x30')];if(_0x344c93[_0xfe4e('0x2e')][_0xfe4e('0x44')]){_0xdcb8aa[_0xfe4e('0x3d')]=[{'all':!![]}];}_0xdcb8aa=_[_0xfe4e('0x3a')]({},_0xdcb8aa,_0x344c93[_0xfe4e('0x3c')]);return db[_0xfe4e('0x2b')][_0xfe4e('0x45')](_0xdcb8aa)['then'](handleEntityNotFound(_0x4d5374,null))[_0xfe4e('0x24')](respondWithResult(_0x4d5374,null))[_0xfe4e('0x40')](handleError(_0x4d5374,null));};exports[_0xfe4e('0x46')]=function(_0x56c3a7,_0x14bd77){return db[_0xfe4e('0x2b')]['create'](_0x56c3a7[_0xfe4e('0x47')],{})['then'](function(_0x3b8197){var _0x3ac3d1=_0x56c3a7[_0xfe4e('0x48')][_0xfe4e('0x49')]({'plain':!![]});if(!_0x3ac3d1)throw new Error(_0xfe4e('0x4a'));if(_0x3ac3d1[_0xfe4e('0x4b')]==='user'){var _0x22d090=_0x3b8197[_0xfe4e('0x49')]({'plain':!![]});var _0x586a76=_0xfe4e('0x25');return db[_0xfe4e('0x4c')][_0xfe4e('0x45')]({'where':{'name':_0x586a76,'userProfileId':_0x3ac3d1[_0xfe4e('0x4d')]},'raw':!![]})['then'](function(_0x2aaf65){if(_0x2aaf65&&_0x2aaf65[_0xfe4e('0x4e')]===0x0){return db['UserProfileResource'][_0xfe4e('0x46')]({'name':_0x22d090[_0xfe4e('0x27')],'resourceId':_0x22d090['id'],'type':_0x2aaf65[_0xfe4e('0x27')],'sectionId':_0x2aaf65['id']},{})[_0xfe4e('0x24')](function(){return _0x3b8197;});}else{return _0x3b8197;}})[_0xfe4e('0x40')](function(_0x8c331e){logger['error'](_0xfe4e('0x4f'),_0x8c331e);throw _0x8c331e;});}return _0x3b8197;})['then'](respondWithResult(_0x14bd77,0xc9))[_0xfe4e('0x40')](handleError(_0x14bd77,null));};exports[_0xfe4e('0x23')]=function(_0x461c1d,_0x3d4c7e){if(_0x461c1d['body']['id']){delete _0x461c1d[_0xfe4e('0x47')]['id'];}return db[_0xfe4e('0x2b')]['find']({'where':{'id':_0x461c1d[_0xfe4e('0x42')]['id']}})[_0xfe4e('0x24')](handleEntityNotFound(_0x3d4c7e,null))[_0xfe4e('0x24')](saveUpdates(_0x461c1d['body'],null))['then'](respondWithResult(_0x3d4c7e,null))[_0xfe4e('0x40')](handleError(_0x3d4c7e,null));};exports['destroy']=function(_0x2bedc3,_0x320eab){return db[_0xfe4e('0x2b')]['find']({'where':{'id':_0x2bedc3[_0xfe4e('0x42')]['id']}})[_0xfe4e('0x24')](handleEntityNotFound(_0x320eab,null))[_0xfe4e('0x24')](removeEntity(_0x320eab,null))[_0xfe4e('0x40')](handleError(_0x320eab,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 00d3731..017df4c 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 _0x7bbc=['path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x26dfc5,_0x138166){var _0x566350=function(_0x28b148){while(--_0x28b148){_0x26dfc5['push'](_0x26dfc5['shift']());}};_0x566350(++_0x138166);}(_0x7bbc,0x19e));var _0xc7bb=function(_0x3e06dd,_0x55694f){_0x3e06dd=_0x3e06dd-0x0;var _0x4bbb8b=_0x7bbc[_0x3e06dd];return _0x4bbb8b;};'use strict';var _=require(_0xc7bb('0x0'));var util=require(_0xc7bb('0x1'));var logger=require(_0xc7bb('0x2'))(_0xc7bb('0x3'));var moment=require(_0xc7bb('0x4'));var BPromise=require(_0xc7bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7bb('0x6'));var rimraf=require(_0xc7bb('0x7'));var config=require(_0xc7bb('0x8'));var attributes=require(_0xc7bb('0x9'));module[_0xc7bb('0xa')]=function(_0x3a1910,_0x2305c1){return _0x3a1910[_0xc7bb('0xb')](_0xc7bb('0xc'),attributes,{'tableName':_0xc7bb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fad=['rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util','api','moment','bluebird','request-promise','path'];(function(_0x556d58,_0x31d9bd){var _0x506ff5=function(_0x542751){while(--_0x542751){_0x556d58['push'](_0x556d58['shift']());}};_0x506ff5(++_0x31d9bd);}(_0x7fad,0x1db));var _0xd7fa=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0x7fad[_0x2730da];return _0xfe9991;};'use strict';var _=require('lodash');var util=require(_0xd7fa('0x0'));var logger=require('../../config/logger')(_0xd7fa('0x1'));var moment=require(_0xd7fa('0x2'));var BPromise=require(_0xd7fa('0x3'));var rp=require(_0xd7fa('0x4'));var fs=require('fs');var path=require(_0xd7fa('0x5'));var rimraf=require(_0xd7fa('0x6'));var config=require(_0xd7fa('0x7'));var attributes=require(_0xd7fa('0x8'));module[_0xd7fa('0x9')]=function(_0x16884a,_0x574766){return _0x16884a[_0xd7fa('0xa')](_0xd7fa('0xb'),attributes,{'tableName':_0xd7fa('0xc'),'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 66de881..012d54a 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 _0xedad=['info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VerifyAdditionalPhones','body','ContactId','ListId','VoiceQueueId','CmHopperAdditionalPhone','findOne','OrderBy','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','ASC','countnoanswerretry','SwapAdditionalPhones','CmHopper','CampaignId','waitTime','duration','isNil','scheduledat','add','minutes','phone','countagentrejectretry','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x41ce34,_0x5eb418){var _0x215015=function(_0x599f90){while(--_0x599f90){_0x41ce34['push'](_0x41ce34['shift']());}};_0x215015(++_0x5eb418);}(_0xedad,0x108));var _0xdeda=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0xedad[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require('lodash');var util=require(_0xdeda('0x0'));var moment=require('moment');var BPromise=require(_0xdeda('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdeda('0x2'))['db'];var utils=require(_0xdeda('0x3'));var logger=require(_0xdeda('0x4'))('rpc');var config=require(_0xdeda('0x5'));var jayson=require(_0xdeda('0x6'));var client=jayson[_0xdeda('0x7')][_0xdeda('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xddf5f8,_0x5cf3f5,_0x6dfe07){return new BPromise(function(_0x20ab22,_0x37bf64){return client[_0xdeda('0x9')](_0xddf5f8,_0x6dfe07)[_0xdeda('0xa')](function(_0x6825ae){logger[_0xdeda('0xb')](_0xdeda('0xc'),_0x5cf3f5,_0xdeda('0xd'));logger['debug'](_0xdeda('0xe'),_0x5cf3f5,_0xdeda('0xd'),JSON[_0xdeda('0xf')](_0x6825ae));if(_0x6825ae['error']){if(_0x6825ae[_0xdeda('0x10')]['code']===0x1f4){logger[_0xdeda('0x10')](_0xdeda('0xc'),_0x5cf3f5,_0x6825ae['error'][_0xdeda('0x11')]);return _0x37bf64(_0x6825ae['error'][_0xdeda('0x11')]);}logger[_0xdeda('0x10')](_0xdeda('0xc'),_0x5cf3f5,_0x6825ae[_0xdeda('0x10')][_0xdeda('0x11')]);return _0x20ab22(_0x6825ae[_0xdeda('0x10')][_0xdeda('0x11')]);}else{logger['info'](_0xdeda('0xc'),_0x5cf3f5,_0xdeda('0xd'));_0x20ab22(_0x6825ae['result'][_0xdeda('0x11')]);}})[_0xdeda('0x12')](function(_0x279122){logger[_0xdeda('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5cf3f5,_0x279122);_0x37bf64(_0x279122);});});}exports[_0xdeda('0x13')]=function(_0x1f3ac2){var _0x4910d9=this;return new Promise(function(_0x319906,_0x4c4244){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x1f3ac2[_0xdeda('0x14')][_0xdeda('0x15')],'ListId':_0x1f3ac2[_0xdeda('0x14')][_0xdeda('0x16')],'VoiceQueueId':_0x1f3ac2[_0xdeda('0x14')]['VoiceQueueId']===undefined?null:_0x1f3ac2[_0xdeda('0x14')][_0xdeda('0x17')],'CampaignId':_0x1f3ac2[_0xdeda('0x14')]['CampaignId']===undefined?null:_0x1f3ac2[_0xdeda('0x14')]['CampaignId']}})[_0xdeda('0xa')](function(_0x102599){if(_0x102599!=null){return db[_0xdeda('0x18')][_0xdeda('0x19')]({'raw':!![],'where':{'CmHopperId':_0x102599['id'],'OrderBy':{'$gt':_0x102599['OrderBy']}},'order':[[_0xdeda('0x1a'),'ASC']]})[_0xdeda('0xa')](function(_0x57ea64){var _0xdc7bde=0x0;if(_0x57ea64){if(_0x57ea64[_0xdeda('0x1b')]+_0x57ea64[_0xdeda('0x1c')]+_0x57ea64['countnoanswerretry']+_0x57ea64[_0xdeda('0x1d')]+_0x57ea64[_0xdeda('0x1e')]+_0x57ea64[_0xdeda('0x1f')]+_0x57ea64[_0xdeda('0x20')]+_0x57ea64['countagentrejectretry']<_0x1f3ac2[_0xdeda('0x21')][_0xdeda('0x22')])_0xdc7bde=0x1;_0x319906({'additional':_0xdc7bde});}else{return db[_0xdeda('0x18')][_0xdeda('0x19')]({'raw':!![],'where':{'CmHopperId':_0x102599['id']},'order':[[_0xdeda('0x1a'),_0xdeda('0x23')]]})[_0xdeda('0xa')](function(_0x2120f5){var _0x3296a6=0x0;if(_0x2120f5){if(_0x2120f5[_0xdeda('0x1b')]+_0x2120f5[_0xdeda('0x1c')]+_0x2120f5[_0xdeda('0x24')]+_0x2120f5[_0xdeda('0x1d')]+_0x2120f5['countdropretry']+_0x2120f5[_0xdeda('0x1f')]+_0x2120f5[_0xdeda('0x20')]+_0x2120f5['countagentrejectretry']<_0x1f3ac2[_0xdeda('0x21')][_0xdeda('0x22')])_0x3296a6=0x1;_0x319906({'additional':_0x3296a6});}else{_0x319906({'additional':0x0});}})[_0xdeda('0x12')](function(_0x3dd5e8){logger[_0xdeda('0x10')](_0xdeda('0x13'),_0x3dd5e8[_0xdeda('0x11')]);_0x4c4244(_0x4910d9[_0xdeda('0x10')](0x1f4,_0x3dd5e8['message']));});}})[_0xdeda('0x12')](function(_0x1412fb){logger[_0xdeda('0x10')]('VerifyAdditionalPhones',_0x1412fb[_0xdeda('0x11')]);_0x4c4244(_0x4910d9[_0xdeda('0x10')](0x1f4,_0x1412fb['message']));});}else _0x319906({'additional':0x0});});});};exports[_0xdeda('0x25')]=function(_0x3e13d4){var _0x3d815d=this;return new Promise(function(_0x267b57,_0x33b737){return db[_0xdeda('0x26')]['findOne']({'raw':!![],'where':{'ContactId':_0x3e13d4[_0xdeda('0x14')][_0xdeda('0x15')],'ListId':_0x3e13d4[_0xdeda('0x14')]['ListId'],'VoiceQueueId':_0x3e13d4[_0xdeda('0x14')][_0xdeda('0x17')]===undefined?null:_0x3e13d4[_0xdeda('0x14')][_0xdeda('0x17')],'CampaignId':_0x3e13d4['body'][_0xdeda('0x27')]===undefined?null:_0x3e13d4[_0xdeda('0x14')][_0xdeda('0x27')]}})[_0xdeda('0xa')](function(_0x546797){if(_0x546797!=null){return db['CmHopperAdditionalPhone'][_0xdeda('0x19')]({'raw':!![],'where':{'CmHopperId':_0x546797['id'],'OrderBy':{'$gte':_0x546797[_0xdeda('0x1a')]}},'order':[['OrderBy',_0xdeda('0x23')]]})[_0xdeda('0xa')](function(_0x26b406){if(_0x26b406)return activateAdditionalPhone(_0x546797,_0x3e13d4['body'],_0x26b406,_0x3e13d4['duration'],_0x3e13d4[_0xdeda('0x28')])[_0xdeda('0xa')](function(_0x119c58){_0x267b57(_0x119c58);});else{return db[_0xdeda('0x18')][_0xdeda('0x19')]({'raw':!![],'where':{'CmHopperId':_0x546797['id']},'order':[[_0xdeda('0x1a'),_0xdeda('0x23')]]})[_0xdeda('0xa')](function(_0x18d415){if(_0x18d415)return activateAdditionalPhone(_0x546797,_0x3e13d4[_0xdeda('0x14')],_0x18d415,_0x3e13d4[_0xdeda('0x29')],_0x3e13d4[_0xdeda('0x28')])['then'](function(_0x385bf3){_0x267b57(_0x385bf3);});else{_0x267b57({'id':_0x546797['id'],'phone':''});}})[_0xdeda('0x12')](function(_0x9cf4d1){logger[_0xdeda('0x10')]('VerifyAdditionalPhones',_0x9cf4d1['message']);_0x33b737(_0x3d815d[_0xdeda('0x10')](0x1f4,_0x9cf4d1[_0xdeda('0x11')]));});}})[_0xdeda('0x12')](function(_0x1ceaa3){logger[_0xdeda('0x10')](_0xdeda('0x13'),_0x1ceaa3[_0xdeda('0x11')]);_0x33b737(_0x3d815d[_0xdeda('0x10')](0x1f4,_0x1ceaa3[_0xdeda('0x11')]));});}else _0x267b57(0x1);});});};function activateAdditionalPhone(_0x4dd5d9,_0x1ba954,_0x334276,_0xae94f6,_0x20cca4){return new Promise(function(_0x251c30,_0x4e705e){var _0x35c128;if(_[_0xdeda('0x2a')](_0x334276[_0xdeda('0x2b')])){_0x334276[_0xdeda('0x2b')]=moment();}if(moment()>moment(_0x334276[_0xdeda('0x2b')])){_0x35c128=moment()[_0xdeda('0x2c')](_0x20cca4||0x3,_0xdeda('0x2d'));}else{if(_0x334276[_0xdeda('0x1a')]==0x0){_0x35c128=moment(_0x334276['scheduledat']);}else{_0x35c128=moment()[_0xdeda('0x2c')](_0x20cca4||0x3,_0xdeda('0x2d'));}}if(_['isNil'](_0x35c128)){_0x35c128=moment()[_0xdeda('0x2c')](_0x20cca4||0x3,_0xdeda('0x2d'));}var _0x570003={'phone':_0x4dd5d9[_0xdeda('0x2e')],'active':0x0,'OrderBy':_[_0xdeda('0x2a')](_0x4dd5d9['OrderBy'])?0x0:_0x4dd5d9[_0xdeda('0x1a')],'scheduledat':moment()[_0xdeda('0x2c')](_0xae94f6||0x1,_0xdeda('0x2d')),'countbusyretry':_0x1ba954[_0xdeda('0x1b')],'countcongestionretry':_0x1ba954[_0xdeda('0x1c')],'countnoanswerretry':_0x1ba954[_0xdeda('0x24')],'countnosuchnumberretry':_0x1ba954[_0xdeda('0x1d')],'countdropretry':_0x1ba954['countdropretry'],'countabandonedretry':_0x1ba954[_0xdeda('0x1f')],'countmachineretry':_0x1ba954[_0xdeda('0x20')],'countagentrejectretry':_0x1ba954[_0xdeda('0x2f')],'createdAt':_0x1ba954[_0xdeda('0x30')],'updatedAt':_0x1ba954['updatedAt']};var _0xadb2a4={'CmHopperId':_0x4dd5d9['id'],'phone':_0x334276[_0xdeda('0x2e')],'active':0x0,'OrderBy':_[_0xdeda('0x2a')](_0x334276[_0xdeda('0x1a')])?0x0:_0x334276[_0xdeda('0x1a')],'scheduledat':_0x35c128,'countbusyretry':_0x334276['countbusyretry'],'countcongestionretry':_0x334276[_0xdeda('0x1c')],'countnoanswerretry':_0x334276[_0xdeda('0x24')],'countnosuchnumberretry':_0x334276[_0xdeda('0x1d')],'countdropretry':_0x334276['countdropretry'],'countabandonedretry':_0x334276[_0xdeda('0x1f')],'countmachineretry':_0x334276[_0xdeda('0x20')],'countagentrejectretry':_0x334276[_0xdeda('0x2f')],'createdAt':_0x334276[_0xdeda('0x30')],'updatedAt':_0x334276['updatedAt']};return db[_0xdeda('0x31')][_0xdeda('0x32')](function(_0x8b3715){return db[_0xdeda('0x18')][_0xdeda('0x33')](_0x570003,{'where':{'id':_0x334276['id']}},{'transaction':_0x8b3715})[_0xdeda('0xa')](function(){return db[_0xdeda('0x26')][_0xdeda('0x33')](_0xadb2a4,{'where':{'id':_0x4dd5d9['id']}},{'transaction':_0x8b3715});});})['then'](function(_0x53a7ef){_0x251c30({'id':_0x4dd5d9['id'],'phone':_0x334276['phone']});})[_0xdeda('0x12')](function(_0x2cbe10){logger['error'](_0xdeda('0x34'),_0x2cbe10[_0xdeda('0x11')]);_0x4e705e({'error':_0x2cbe10[_0xdeda('0x11')]});});});}exports[_0xdeda('0x35')]=function(_0x3127f4){var _0xcd6de5=this;return new Promise(function(_0x5d371d,_0xe7242){return db[_0xdeda('0x26')][_0xdeda('0x33')](_0x3127f4[_0xdeda('0x14')][_0xdeda('0x36')],{'where':{'id':_0x3127f4['body']['id']}})[_0xdeda('0xa')](function(_0x55b58f){_0x5d371d(_0x55b58f);})[_0xdeda('0x12')](function(_0x42537e){logger['error'](_0xdeda('0x35'),_0x42537e[_0xdeda('0x11')]);_0xe7242(_0xcd6de5['error'](0x1f4,_0x42537e[_0xdeda('0x11')]));});});}; \ No newline at end of file +var _0x0965=['countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','dialGlobalMaxRetry','countnoanswerretry','countagentrejectretry','entity','SwapAdditionalPhones','ContactId','duration','waitTime','catch','VerifyAdditionalPhones','scheduledat','add','minutes','phone','isNil','createdAt','updatedAt','transaction','activateAdditionalPhone','IncrementPreviewCounters','update','field','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry'];(function(_0x4c8245,_0x1a310d){var _0x3761b3=function(_0x5a9722){while(--_0x5a9722){_0x4c8245['push'](_0x4c8245['shift']());}};_0x3761b3(++_0x1a310d);}(_0x0965,0x138));var _0x5096=function(_0xfc2601,_0x158a2e){_0xfc2601=_0xfc2601-0x0;var _0x92f1fd=_0x0965[_0xfc2601];return _0x92f1fd;};'use strict';var _=require(_0x5096('0x0'));var util=require(_0x5096('0x1'));var moment=require('moment');var BPromise=require(_0x5096('0x2'));var rs=require(_0x5096('0x3'));var fs=require('fs');var Redis=require(_0x5096('0x4'));var db=require(_0x5096('0x5'))['db'];var utils=require(_0x5096('0x6'));var logger=require(_0x5096('0x7'))(_0x5096('0x8'));var config=require(_0x5096('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5096('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e5a56,_0x4bc583,_0x27bbc3){return new BPromise(function(_0x1dedfc,_0x16ba97){return client[_0x5096('0xb')](_0x5e5a56,_0x27bbc3)[_0x5096('0xc')](function(_0x5cad92){logger['info'](_0x5096('0xd'),_0x4bc583,_0x5096('0xe'));logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x4bc583,'request\x20sent',JSON[_0x5096('0xf')](_0x5cad92));if(_0x5cad92[_0x5096('0x10')]){if(_0x5cad92[_0x5096('0x10')]['code']===0x1f4){logger[_0x5096('0x10')](_0x5096('0xd'),_0x4bc583,_0x5cad92['error'][_0x5096('0x11')]);return _0x16ba97(_0x5cad92[_0x5096('0x10')][_0x5096('0x11')]);}logger[_0x5096('0x10')](_0x5096('0xd'),_0x4bc583,_0x5cad92[_0x5096('0x10')][_0x5096('0x11')]);return _0x1dedfc(_0x5cad92['error'][_0x5096('0x11')]);}else{logger[_0x5096('0x12')](_0x5096('0xd'),_0x4bc583,_0x5096('0xe'));_0x1dedfc(_0x5cad92[_0x5096('0x13')][_0x5096('0x11')]);}})['catch'](function(_0x29fddc){logger[_0x5096('0x10')](_0x5096('0xd'),_0x4bc583,_0x29fddc);_0x16ba97(_0x29fddc);});});}exports['VerifyAdditionalPhones']=function(_0x51b2fd){var _0x492eae=this;return new Promise(function(_0x427729,_0x23d9ca){return db[_0x5096('0x14')][_0x5096('0x15')]({'raw':!![],'where':{'ContactId':_0x51b2fd[_0x5096('0x16')]['ContactId'],'ListId':_0x51b2fd['body'][_0x5096('0x17')],'VoiceQueueId':_0x51b2fd['body'][_0x5096('0x18')]===undefined?null:_0x51b2fd[_0x5096('0x16')]['VoiceQueueId'],'CampaignId':_0x51b2fd[_0x5096('0x16')][_0x5096('0x19')]===undefined?null:_0x51b2fd[_0x5096('0x16')][_0x5096('0x19')]}})[_0x5096('0xc')](function(_0x2cdabd){if(_0x2cdabd!=null){return db[_0x5096('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x2cdabd['id'],'OrderBy':{'$gt':_0x2cdabd[_0x5096('0x1b')]}},'order':[[_0x5096('0x1b'),_0x5096('0x1c')]]})[_0x5096('0xc')](function(_0x34c847){var _0x40b4db=0x0;if(_0x34c847){if(_0x34c847[_0x5096('0x1d')]+_0x34c847[_0x5096('0x1e')]+_0x34c847['countnoanswerretry']+_0x34c847[_0x5096('0x1f')]+_0x34c847[_0x5096('0x20')]+_0x34c847[_0x5096('0x21')]+_0x34c847[_0x5096('0x22')]+_0x34c847['countagentrejectretry']<_0x51b2fd['entity'][_0x5096('0x23')])_0x40b4db=0x1;_0x427729({'additional':_0x40b4db});}else{return db[_0x5096('0x1a')][_0x5096('0x15')]({'raw':!![],'where':{'CmHopperId':_0x2cdabd['id']},'order':[['OrderBy',_0x5096('0x1c')]]})[_0x5096('0xc')](function(_0x17a03b){var _0x2f9552=0x0;if(_0x17a03b){if(_0x17a03b[_0x5096('0x1d')]+_0x17a03b[_0x5096('0x1e')]+_0x17a03b[_0x5096('0x24')]+_0x17a03b[_0x5096('0x1f')]+_0x17a03b[_0x5096('0x20')]+_0x17a03b['countabandonedretry']+_0x17a03b[_0x5096('0x22')]+_0x17a03b[_0x5096('0x25')]<_0x51b2fd[_0x5096('0x26')][_0x5096('0x23')])_0x2f9552=0x1;_0x427729({'additional':_0x2f9552});}else{_0x427729({'additional':0x0});}})['catch'](function(_0x47da6e){logger[_0x5096('0x10')]('VerifyAdditionalPhones',_0x47da6e[_0x5096('0x11')]);_0x23d9ca(_0x492eae[_0x5096('0x10')](0x1f4,_0x47da6e[_0x5096('0x11')]));});}})['catch'](function(_0x4f70d0){logger[_0x5096('0x10')]('VerifyAdditionalPhones',_0x4f70d0['message']);_0x23d9ca(_0x492eae['error'](0x1f4,_0x4f70d0[_0x5096('0x11')]));});}else _0x427729({'additional':0x0});});});};exports[_0x5096('0x27')]=function(_0x3696e0){var _0x36f79e=this;return new Promise(function(_0x181dca,_0x2d01b6){return db[_0x5096('0x14')][_0x5096('0x15')]({'raw':!![],'where':{'ContactId':_0x3696e0[_0x5096('0x16')][_0x5096('0x28')],'ListId':_0x3696e0['body'][_0x5096('0x17')],'VoiceQueueId':_0x3696e0[_0x5096('0x16')][_0x5096('0x18')]===undefined?null:_0x3696e0[_0x5096('0x16')][_0x5096('0x18')],'CampaignId':_0x3696e0['body']['CampaignId']===undefined?null:_0x3696e0[_0x5096('0x16')][_0x5096('0x19')]}})[_0x5096('0xc')](function(_0x352eb9){if(_0x352eb9!=null){return db[_0x5096('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x352eb9['id'],'OrderBy':{'$gte':_0x352eb9[_0x5096('0x1b')]}},'order':[['OrderBy','ASC']]})['then'](function(_0x412374){if(_0x412374)return activateAdditionalPhone(_0x352eb9,_0x3696e0[_0x5096('0x16')],_0x412374,_0x3696e0[_0x5096('0x29')],_0x3696e0[_0x5096('0x2a')])[_0x5096('0xc')](function(_0x51a904){_0x181dca(_0x51a904);});else{return db[_0x5096('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x352eb9['id']},'order':[[_0x5096('0x1b'),_0x5096('0x1c')]]})['then'](function(_0x3439b2){if(_0x3439b2)return activateAdditionalPhone(_0x352eb9,_0x3696e0['body'],_0x3439b2,_0x3696e0[_0x5096('0x29')],_0x3696e0[_0x5096('0x2a')])[_0x5096('0xc')](function(_0x417d63){_0x181dca(_0x417d63);});else{_0x181dca({'id':_0x352eb9['id'],'phone':''});}})['catch'](function(_0x529d72){logger[_0x5096('0x10')]('VerifyAdditionalPhones',_0x529d72['message']);_0x2d01b6(_0x36f79e['error'](0x1f4,_0x529d72[_0x5096('0x11')]));});}})[_0x5096('0x2b')](function(_0x1d4727){logger[_0x5096('0x10')](_0x5096('0x2c'),_0x1d4727['message']);_0x2d01b6(_0x36f79e[_0x5096('0x10')](0x1f4,_0x1d4727['message']));});}else _0x181dca(0x1);});});};function activateAdditionalPhone(_0x3ab948,_0x547307,_0x3153c2,_0x31c7b3,_0xfca824){return new Promise(function(_0x4e58ba,_0x737a06){var _0x4d6886;if(_['isNil'](_0x3153c2[_0x5096('0x2d')])){_0x3153c2['scheduledat']=moment();}if(moment()>moment(_0x3153c2[_0x5096('0x2d')])){_0x4d6886=moment()[_0x5096('0x2e')](_0xfca824||0x3,_0x5096('0x2f'));}else{if(_0x3153c2['OrderBy']==0x0){_0x4d6886=moment(_0x3153c2[_0x5096('0x2d')]);}else{_0x4d6886=moment()['add'](_0xfca824||0x3,_0x5096('0x2f'));}}if(_['isNil'](_0x4d6886)){_0x4d6886=moment()[_0x5096('0x2e')](_0xfca824||0x3,'minutes');}var _0x25674c={'phone':_0x3ab948[_0x5096('0x30')],'active':0x0,'OrderBy':_[_0x5096('0x31')](_0x3ab948['OrderBy'])?0x0:_0x3ab948[_0x5096('0x1b')],'scheduledat':moment()[_0x5096('0x2e')](_0x31c7b3||0x1,'minutes'),'countbusyretry':_0x547307[_0x5096('0x1d')],'countcongestionretry':_0x547307[_0x5096('0x1e')],'countnoanswerretry':_0x547307[_0x5096('0x24')],'countnosuchnumberretry':_0x547307[_0x5096('0x1f')],'countdropretry':_0x547307['countdropretry'],'countabandonedretry':_0x547307[_0x5096('0x21')],'countmachineretry':_0x547307[_0x5096('0x22')],'countagentrejectretry':_0x547307['countagentrejectretry'],'createdAt':_0x547307[_0x5096('0x32')],'updatedAt':_0x547307[_0x5096('0x33')]};var _0x284ca2={'CmHopperId':_0x3ab948['id'],'phone':_0x3153c2[_0x5096('0x30')],'active':0x0,'OrderBy':_[_0x5096('0x31')](_0x3153c2[_0x5096('0x1b')])?0x0:_0x3153c2['OrderBy'],'scheduledat':_0x4d6886,'countbusyretry':_0x3153c2[_0x5096('0x1d')],'countcongestionretry':_0x3153c2['countcongestionretry'],'countnoanswerretry':_0x3153c2[_0x5096('0x24')],'countnosuchnumberretry':_0x3153c2[_0x5096('0x1f')],'countdropretry':_0x3153c2[_0x5096('0x20')],'countabandonedretry':_0x3153c2[_0x5096('0x21')],'countmachineretry':_0x3153c2[_0x5096('0x22')],'countagentrejectretry':_0x3153c2[_0x5096('0x25')],'createdAt':_0x3153c2['createdAt'],'updatedAt':_0x3153c2[_0x5096('0x33')]};return db['sequelize'][_0x5096('0x34')](function(_0x27d782){return db['CmHopperAdditionalPhone']['update'](_0x25674c,{'where':{'id':_0x3153c2['id']}},{'transaction':_0x27d782})[_0x5096('0xc')](function(){return db[_0x5096('0x14')]['update'](_0x284ca2,{'where':{'id':_0x3ab948['id']}},{'transaction':_0x27d782});});})[_0x5096('0xc')](function(_0x2c5014){_0x4e58ba({'id':_0x3ab948['id'],'phone':_0x3153c2['phone']});})[_0x5096('0x2b')](function(_0xd08a74){logger[_0x5096('0x10')](_0x5096('0x35'),_0xd08a74[_0x5096('0x11')]);_0x737a06({'error':_0xd08a74[_0x5096('0x11')]});});});}exports[_0x5096('0x36')]=function(_0x45011c){var _0x3a9433=this;return new Promise(function(_0x431d99,_0x2f86fb){return db['CmHopper'][_0x5096('0x37')](_0x45011c['body'][_0x5096('0x38')],{'where':{'id':_0x45011c[_0x5096('0x16')]['id']}})[_0x5096('0xc')](function(_0x4e15e2){_0x431d99(_0x4e15e2);})[_0x5096('0x2b')](function(_0xd5c0b7){logger[_0x5096('0x10')]('IncrementPreviewCounters',_0xd5c0b7['message']);_0x2f86fb(_0x3a9433[_0x5096('0x10')](0x1f4,_0xd5c0b7['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 6a861a7..29b39fb 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 _0x0447=['get','/:id','show','post','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index'];(function(_0x3e99cb,_0x1d2fe0){var _0x1bc729=function(_0x40006f){while(--_0x40006f){_0x3e99cb['push'](_0x3e99cb['shift']());}};_0x1bc729(++_0x1d2fe0);}(_0x0447,0x9e));var _0x7044=function(_0x17c8a9,_0x531ca3){_0x17c8a9=_0x17c8a9-0x0;var _0x379aa6=_0x0447[_0x17c8a9];return _0x379aa6;};'use strict';var multer=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var path=require(_0x7044('0x2'));var timeout=require(_0x7044('0x3'));var express=require(_0x7044('0x4'));var router=express[_0x7044('0x5')]();var fs_extra=require(_0x7044('0x6'));var auth=require(_0x7044('0x7'));var interaction=require(_0x7044('0x8'));var config=require(_0x7044('0x9'));var controller=require(_0x7044('0xa'));router['get']('/',auth[_0x7044('0xb')](),controller[_0x7044('0xc')]);router[_0x7044('0xd')](_0x7044('0xe'),auth[_0x7044('0xb')](),controller[_0x7044('0xf')]);router[_0x7044('0x10')]('/',auth[_0x7044('0xb')](),controller['create']);router['put'](_0x7044('0xe'),auth['isAuthenticated'](),controller[_0x7044('0x11')]);router['delete'](_0x7044('0xe'),auth[_0x7044('0xb')](),controller['destroy']);module[_0x7044('0x12')]=router; \ No newline at end of file +var _0x14d1=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout'];(function(_0x1420af,_0x527146){var _0x3f7fde=function(_0x19eb5e){while(--_0x19eb5e){_0x1420af['push'](_0x1420af['shift']());}};_0x3f7fde(++_0x527146);}(_0x14d1,0xc3));var _0x114d=function(_0x555564,_0x31e56b){_0x555564=_0x555564-0x0;var _0x41f587=_0x14d1[_0x555564];return _0x41f587;};'use strict';var multer=require('multer');var util=require(_0x114d('0x0'));var path=require(_0x114d('0x1'));var timeout=require(_0x114d('0x2'));var express=require(_0x114d('0x3'));var router=express['Router']();var fs_extra=require(_0x114d('0x4'));var auth=require(_0x114d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x114d('0x6'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x114d('0x7')]('/',auth[_0x114d('0x8')](),controller[_0x114d('0x9')]);router[_0x114d('0x7')]('/:id',auth[_0x114d('0x8')](),controller[_0x114d('0xa')]);router[_0x114d('0xb')]('/',auth[_0x114d('0x8')](),controller[_0x114d('0xc')]);router[_0x114d('0xd')](_0x114d('0xe'),auth['isAuthenticated'](),controller[_0x114d('0xf')]);router[_0x114d('0x10')](_0x114d('0xe'),auth['isAuthenticated'](),controller[_0x114d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 5e15bd0..a5eb06c 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 _0x64a1=['exports','contactListQueue','INTEGER','moment','sequelize'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x64a1,0x13e));var _0x164a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x64a1[_0x8c43de];return _0xa6591b;};'use strict';var moment=require(_0x164a('0x0'));var Sequelize=require(_0x164a('0x1'));module[_0x164a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x164a('0x3')},'ListId':{'type':Sequelize[_0x164a('0x4')],'unique':_0x164a('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x164a('0x3')}}; \ No newline at end of file +var _0x9865=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x5a36e9,_0x30d79b){var _0xd7fce8=function(_0x45ea2b){while(--_0x45ea2b){_0x5a36e9['push'](_0x5a36e9['shift']());}};_0xd7fce8(++_0x30d79b);}(_0x9865,0x1ba));var _0x5986=function(_0x5acab5,_0x3bb395){_0x5acab5=_0x5acab5-0x0;var _0x38769b=_0x9865[_0x5acab5];return _0x38769b;};'use strict';var moment=require(_0x5986('0x0'));var Sequelize=require(_0x5986('0x1'));module[_0x5986('0x2')]={'phone':{'type':Sequelize[_0x5986('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x5986('0x4')],'unique':_0x5986('0x5')},'ListId':{'type':Sequelize[_0x5986('0x4')],'unique':_0x5986('0x5')},'VoiceQueueId':{'type':Sequelize[_0x5986('0x4')],'unique':_0x5986('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 50fd228..1eac3c1 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 _0x54ad=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','limit','undefined','count','offset','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperBlack','findAll','rows','show','params','rawAttributes','length','includeAll','include','options','catch','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x13f39c,_0x31a3d7){var _0x23ca82=function(_0x128daa){while(--_0x128daa){_0x13f39c['push'](_0x13f39c['shift']());}};_0x23ca82(++_0x31a3d7);}(_0x54ad,0xf0));var _0xd54a=function(_0x13fa83,_0x3537ef){_0x13fa83=_0x13fa83-0x0;var _0x29e893=_0x54ad[_0x13fa83];return _0x29e893;};'use strict';var emlformat=require(_0xd54a('0x0'));var rimraf=require(_0xd54a('0x1'));var zipdir=require(_0xd54a('0x2'));var jsonpatch=require(_0xd54a('0x3'));var rp=require(_0xd54a('0x4'));var moment=require(_0xd54a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd54a('0x6'));var util=require(_0xd54a('0x7'));var path=require(_0xd54a('0x8'));var sox=require(_0xd54a('0x9'));var csv=require(_0xd54a('0xa'));var ejs=require(_0xd54a('0xb'));var fs=require('fs');var fs_extra=require(_0xd54a('0xc'));var _=require(_0xd54a('0xd'));var squel=require(_0xd54a('0xe'));var crypto=require(_0xd54a('0xf'));var jsforce=require(_0xd54a('0x10'));var deskjs=require(_0xd54a('0x11'));var toCsv=require(_0xd54a('0xa'));var querystring=require('querystring');var Papa=require(_0xd54a('0x12'));var Redis=require(_0xd54a('0x13'));var authService=require(_0xd54a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd54a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd54a('0x16'))(_0xd54a('0x17'));var utils=require(_0xd54a('0x18'));var config=require(_0xd54a('0x19'));var licenseUtil=require(_0xd54a('0x1a'));var db=require(_0xd54a('0x1b'))['db'];function respondWithStatusCode(_0x4f27c2,_0xe88c2a){_0xe88c2a=_0xe88c2a||0xcc;return function(_0x24bf42){if(_0x24bf42){return _0x4f27c2[_0xd54a('0x1c')](_0xe88c2a);}return _0x4f27c2[_0xd54a('0x1d')](_0xe88c2a)[_0xd54a('0x1e')]();};}function respondWithResult(_0xb839e2,_0x517a2b){_0x517a2b=_0x517a2b||0xc8;return function(_0x29e5b4){if(_0x29e5b4){return _0xb839e2[_0xd54a('0x1d')](_0x517a2b)['json'](_0x29e5b4);}};}function respondWithFilteredResult(_0x3dab20,_0x377cb4){return function(_0x550412){if(_0x550412){var _0xd0170=typeof _0x377cb4['offset']==='undefined'&&typeof _0x377cb4[_0xd54a('0x1f')]===_0xd54a('0x20');var _0x3bd466=_0x550412[_0xd54a('0x21')];var _0x4b208a=_0xd0170?0x0:_0x377cb4[_0xd54a('0x22')];var _0x5e4c08=_0xd0170?_0x550412[_0xd54a('0x21')]:_0x377cb4[_0xd54a('0x22')]+_0x377cb4[_0xd54a('0x1f')];var _0x566659;if(_0x5e4c08>=_0x3bd466){_0x5e4c08=_0x3bd466;_0x566659=0xc8;}else{_0x566659=0xce;}_0x3dab20[_0xd54a('0x1d')](_0x566659);return _0x3dab20[_0xd54a('0x23')](_0xd54a('0x24'),_0x4b208a+'-'+_0x5e4c08+'/'+_0x3bd466)[_0xd54a('0x25')](_0x550412);}return null;};}function patchUpdates(_0xac9263){return function(_0x2c6ddb){try{jsonpatch[_0xd54a('0x26')](_0x2c6ddb,_0xac9263,!![]);}catch(_0x1e5cae){return BPromise[_0xd54a('0x27')](_0x1e5cae);}return _0x2c6ddb['save']();};}function saveUpdates(_0x284a97,_0x500e3d){return function(_0x5d78ad){if(_0x5d78ad){return _0x5d78ad['update'](_0x284a97)[_0xd54a('0x28')](function(_0x54f0ac){return _0x54f0ac;});}return null;};}function removeEntity(_0x3b6c55,_0x2372b3){return function(_0x4deec6){if(_0x4deec6){return _0x4deec6[_0xd54a('0x29')]()[_0xd54a('0x28')](function(){_0x3b6c55[_0xd54a('0x1d')](0xcc)[_0xd54a('0x1e')]();});}};}function handleEntityNotFound(_0x3eba72,_0x265c56){return function(_0x28fa81){if(!_0x28fa81){_0x3eba72[_0xd54a('0x1c')](0x194);}return _0x28fa81;};}function handleError(_0x9bd902,_0x36eb74){_0x36eb74=_0x36eb74||0x1f4;return function(_0x2e9115){logger[_0xd54a('0x2a')](_0x2e9115[_0xd54a('0x2b')]);if(_0x2e9115[_0xd54a('0x2c')]){delete _0x2e9115[_0xd54a('0x2c')];}_0x9bd902[_0xd54a('0x1d')](_0x36eb74)[_0xd54a('0x2d')](_0x2e9115);};}exports[_0xd54a('0x2e')]=function(_0x1f3ab4,_0x1d01e2){var _0x115133={},_0x2b6bb1={},_0x588a21={'count':0x0,'rows':[]};var _0x5082dd=_[_0xd54a('0x2f')](db['CmHopperBlack']['rawAttributes'],function(_0x2c47df){return{'name':_0x2c47df[_0xd54a('0x30')],'type':_0x2c47df[_0xd54a('0x31')][_0xd54a('0x32')]};});_0x2b6bb1[_0xd54a('0x33')]=_[_0xd54a('0x2f')](_0x5082dd,_0xd54a('0x2c'));_0x2b6bb1[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x1f3ab4[_0xd54a('0x34')]);_0x2b6bb1[_0xd54a('0x36')]=_[_0xd54a('0x37')](_0x2b6bb1[_0xd54a('0x33')],_0x2b6bb1[_0xd54a('0x34')]);_0x115133[_0xd54a('0x38')]=_[_0xd54a('0x37')](_0x2b6bb1['model'],qs[_0xd54a('0x39')](_0x1f3ab4[_0xd54a('0x34')]['fields']));_0x115133[_0xd54a('0x38')]=_0x115133[_0xd54a('0x38')]['length']?_0x115133[_0xd54a('0x38')]:_0x2b6bb1[_0xd54a('0x33')];if(!_0x1f3ab4[_0xd54a('0x34')][_0xd54a('0x3a')](_0xd54a('0x3b'))){_0x115133[_0xd54a('0x1f')]=qs[_0xd54a('0x1f')](_0x1f3ab4['query'][_0xd54a('0x1f')]);_0x115133[_0xd54a('0x22')]=qs[_0xd54a('0x22')](_0x1f3ab4[_0xd54a('0x34')][_0xd54a('0x22')]);}_0x115133[_0xd54a('0x3c')]=qs[_0xd54a('0x3d')](_0x1f3ab4['query']['sort']);_0x115133['where']=qs['filters'](_[_0xd54a('0x3e')](_0x1f3ab4[_0xd54a('0x34')],_0x2b6bb1[_0xd54a('0x36')]),_0x5082dd);if(_0x1f3ab4[_0xd54a('0x34')][_0xd54a('0x3f')]){_0x115133[_0xd54a('0x40')]=_[_0xd54a('0x41')](_0x115133[_0xd54a('0x40')],{'$or':_['map'](_0x5082dd,function(_0x278ee6){if(_0x278ee6['type']!==_0xd54a('0x42')){var _0x4c371f={};_0x4c371f[_0x278ee6[_0xd54a('0x2c')]]={'$like':'%'+_0x1f3ab4[_0xd54a('0x34')]['filter']+'%'};return _0x4c371f;}})});}_0x115133=_[_0xd54a('0x41')]({},_0x115133,_0x1f3ab4['options']);var _0x3cfad6={'where':_0x115133[_0xd54a('0x40')]};return db['CmHopperBlack']['count'](_0x3cfad6)['then'](function(_0x52ae51){_0x588a21['count']=_0x52ae51;if(_0x1f3ab4[_0xd54a('0x34')]['includeAll']){_0x115133['include']=[{'all':!![]}];}return db[_0xd54a('0x43')][_0xd54a('0x44')](_0x115133);})[_0xd54a('0x28')](function(_0x4a053d){_0x588a21[_0xd54a('0x45')]=_0x4a053d;return _0x588a21;})['then'](respondWithFilteredResult(_0x1d01e2,_0x115133))['catch'](handleError(_0x1d01e2,null));};exports[_0xd54a('0x46')]=function(_0x4489b8,_0x50d529){var _0x3ac77d={'raw':!![],'where':{'id':_0x4489b8[_0xd54a('0x47')]['id']}},_0x20c00f={};_0x20c00f[_0xd54a('0x33')]=_[_0xd54a('0x35')](db[_0xd54a('0x43')][_0xd54a('0x48')]);_0x20c00f[_0xd54a('0x34')]=_[_0xd54a('0x35')](_0x4489b8[_0xd54a('0x34')]);_0x20c00f[_0xd54a('0x36')]=_['intersection'](_0x20c00f[_0xd54a('0x33')],_0x20c00f[_0xd54a('0x34')]);_0x3ac77d[_0xd54a('0x38')]=_[_0xd54a('0x37')](_0x20c00f[_0xd54a('0x33')],qs[_0xd54a('0x39')](_0x4489b8[_0xd54a('0x34')]['fields']));_0x3ac77d[_0xd54a('0x38')]=_0x3ac77d[_0xd54a('0x38')][_0xd54a('0x49')]?_0x3ac77d[_0xd54a('0x38')]:_0x20c00f['model'];if(_0x4489b8['query'][_0xd54a('0x4a')]){_0x3ac77d[_0xd54a('0x4b')]=[{'all':!![]}];}_0x3ac77d=_['merge']({},_0x3ac77d,_0x4489b8[_0xd54a('0x4c')]);return db[_0xd54a('0x43')]['find'](_0x3ac77d)['then'](handleEntityNotFound(_0x50d529,null))[_0xd54a('0x28')](respondWithResult(_0x50d529,null))[_0xd54a('0x4d')](handleError(_0x50d529,null));};exports[_0xd54a('0x4e')]=function(_0x3d0e1d,_0x3346fb){if(_0x3d0e1d[_0xd54a('0x4f')]['id']){delete _0x3d0e1d[_0xd54a('0x4f')]['id'];}return db[_0xd54a('0x43')][_0xd54a('0x50')]({'where':{'id':_0x3d0e1d[_0xd54a('0x47')]['id']}})[_0xd54a('0x28')](handleEntityNotFound(_0x3346fb,null))[_0xd54a('0x28')](saveUpdates(_0x3d0e1d['body'],null))[_0xd54a('0x28')](respondWithResult(_0x3346fb,null))[_0xd54a('0x4d')](handleError(_0x3346fb,null));};exports[_0xd54a('0x29')]=function(_0xc0582c,_0x4772e1){return db['CmHopperBlack'][_0xd54a('0x50')]({'where':{'id':_0xc0582c[_0xd54a('0x47')]['id']}})[_0xd54a('0x28')](handleEntityNotFound(_0x4772e1,null))[_0xd54a('0x28')](removeEntity(_0x4772e1,null))[_0xd54a('0x4d')](handleError(_0x4772e1,null));};exports[_0xd54a('0x51')]=function(_0x184142,_0x2e2228){return db[_0xd54a('0x43')][_0xd54a('0x51')]()['then'](respondWithResult(_0x2e2228,null))['catch'](handleError(_0x2e2228,null));}; \ No newline at end of file +var _0x9d55=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','CmHopperBlack','includeAll','findAll','rows','params','find','body','catch','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x9d55,0x1b9));var _0x59d5=function(_0x5543df,_0x9c5617){_0x5543df=_0x5543df-0x0;var _0x266e2b=_0x9d55[_0x5543df];return _0x266e2b;};'use strict';var emlformat=require(_0x59d5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x59d5('0x1'));var rp=require(_0x59d5('0x2'));var moment=require(_0x59d5('0x3'));var BPromise=require(_0x59d5('0x4'));var Mustache=require(_0x59d5('0x5'));var util=require(_0x59d5('0x6'));var path=require('path');var sox=require(_0x59d5('0x7'));var csv=require(_0x59d5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59d5('0x9'));var _=require(_0x59d5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x59d5('0xb'));var deskjs=require(_0x59d5('0xc'));var toCsv=require(_0x59d5('0x8'));var querystring=require(_0x59d5('0xd'));var Papa=require(_0x59d5('0xe'));var Redis=require('ioredis');var authService=require(_0x59d5('0xf'));var qs=require(_0x59d5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x59d5('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x59d5('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x206ec3,_0x4434c8){_0x4434c8=_0x4434c8||0xcc;return function(_0x1f097b){if(_0x1f097b){return _0x206ec3[_0x59d5('0x13')](_0x4434c8);}return _0x206ec3[_0x59d5('0x14')](_0x4434c8)['end']();};}function respondWithResult(_0x403f93,_0x572f95){_0x572f95=_0x572f95||0xc8;return function(_0x174d51){if(_0x174d51){return _0x403f93[_0x59d5('0x14')](_0x572f95)['json'](_0x174d51);}};}function respondWithFilteredResult(_0x32cf92,_0xcb74fb){return function(_0x515c64){if(_0x515c64){var _0x20e0e1=typeof _0xcb74fb[_0x59d5('0x15')]===_0x59d5('0x16')&&typeof _0xcb74fb['limit']===_0x59d5('0x16');var _0x53cee4=_0x515c64[_0x59d5('0x17')];var _0x4b1740=_0x20e0e1?0x0:_0xcb74fb['offset'];var _0x4c892b=_0x20e0e1?_0x515c64[_0x59d5('0x17')]:_0xcb74fb['offset']+_0xcb74fb[_0x59d5('0x18')];var _0x5864b8;if(_0x4c892b>=_0x53cee4){_0x4c892b=_0x53cee4;_0x5864b8=0xc8;}else{_0x5864b8=0xce;}_0x32cf92[_0x59d5('0x14')](_0x5864b8);return _0x32cf92[_0x59d5('0x19')](_0x59d5('0x1a'),_0x4b1740+'-'+_0x4c892b+'/'+_0x53cee4)[_0x59d5('0x1b')](_0x515c64);}return null;};}function patchUpdates(_0x5d9258){return function(_0x4edafc){try{jsonpatch[_0x59d5('0x1c')](_0x4edafc,_0x5d9258,!![]);}catch(_0x31a4d9){return BPromise[_0x59d5('0x1d')](_0x31a4d9);}return _0x4edafc[_0x59d5('0x1e')]();};}function saveUpdates(_0x47bf5a,_0x316881){return function(_0x3bff38){if(_0x3bff38){return _0x3bff38[_0x59d5('0x1f')](_0x47bf5a)[_0x59d5('0x20')](function(_0x40234a){return _0x40234a;});}return null;};}function removeEntity(_0x20c7c4,_0x3c1d9c){return function(_0x3de4aa){if(_0x3de4aa){return _0x3de4aa[_0x59d5('0x21')]()['then'](function(){_0x20c7c4[_0x59d5('0x14')](0xcc)[_0x59d5('0x22')]();});}};}function handleEntityNotFound(_0x2f400c,_0x136d7b){return function(_0x1007c8){if(!_0x1007c8){_0x2f400c['sendStatus'](0x194);}return _0x1007c8;};}function handleError(_0x44069e,_0x5d58a7){_0x5d58a7=_0x5d58a7||0x1f4;return function(_0x5db201){logger['error'](_0x5db201[_0x59d5('0x23')]);if(_0x5db201[_0x59d5('0x24')]){delete _0x5db201[_0x59d5('0x24')];}_0x44069e[_0x59d5('0x14')](_0x5d58a7)[_0x59d5('0x25')](_0x5db201);};}exports[_0x59d5('0x26')]=function(_0xa63567,_0x9ce214){var _0x3e0aea={},_0x9752fb={},_0x46ced7={'count':0x0,'rows':[]};var _0x2978dd=_[_0x59d5('0x27')](db['CmHopperBlack'][_0x59d5('0x28')],function(_0x43fc46){return{'name':_0x43fc46[_0x59d5('0x29')],'type':_0x43fc46['type']['key']};});_0x9752fb[_0x59d5('0x2a')]=_[_0x59d5('0x27')](_0x2978dd,_0x59d5('0x24'));_0x9752fb[_0x59d5('0x2b')]=_[_0x59d5('0x2c')](_0xa63567['query']);_0x9752fb[_0x59d5('0x2d')]=_[_0x59d5('0x2e')](_0x9752fb[_0x59d5('0x2a')],_0x9752fb[_0x59d5('0x2b')]);_0x3e0aea[_0x59d5('0x2f')]=_[_0x59d5('0x2e')](_0x9752fb['model'],qs[_0x59d5('0x30')](_0xa63567[_0x59d5('0x2b')]['fields']));_0x3e0aea[_0x59d5('0x2f')]=_0x3e0aea['attributes'][_0x59d5('0x31')]?_0x3e0aea[_0x59d5('0x2f')]:_0x9752fb[_0x59d5('0x2a')];if(!_0xa63567[_0x59d5('0x2b')][_0x59d5('0x32')](_0x59d5('0x33'))){_0x3e0aea[_0x59d5('0x18')]=qs[_0x59d5('0x18')](_0xa63567[_0x59d5('0x2b')][_0x59d5('0x18')]);_0x3e0aea[_0x59d5('0x15')]=qs['offset'](_0xa63567[_0x59d5('0x2b')][_0x59d5('0x15')]);}_0x3e0aea[_0x59d5('0x34')]=qs[_0x59d5('0x35')](_0xa63567[_0x59d5('0x2b')][_0x59d5('0x35')]);_0x3e0aea[_0x59d5('0x36')]=qs[_0x59d5('0x2d')](_['pick'](_0xa63567[_0x59d5('0x2b')],_0x9752fb[_0x59d5('0x2d')]),_0x2978dd);if(_0xa63567[_0x59d5('0x2b')][_0x59d5('0x37')]){_0x3e0aea[_0x59d5('0x36')]=_[_0x59d5('0x38')](_0x3e0aea[_0x59d5('0x36')],{'$or':_[_0x59d5('0x27')](_0x2978dd,function(_0x30c759){if(_0x30c759[_0x59d5('0x39')]!==_0x59d5('0x3a')){var _0x3a74d4={};_0x3a74d4[_0x30c759['name']]={'$like':'%'+_0xa63567[_0x59d5('0x2b')][_0x59d5('0x37')]+'%'};return _0x3a74d4;}})});}_0x3e0aea=_[_0x59d5('0x38')]({},_0x3e0aea,_0xa63567[_0x59d5('0x3b')]);var _0x1be90f={'where':_0x3e0aea['where']};return db[_0x59d5('0x3c')][_0x59d5('0x17')](_0x1be90f)[_0x59d5('0x20')](function(_0x4e326f){_0x46ced7['count']=_0x4e326f;if(_0xa63567[_0x59d5('0x2b')][_0x59d5('0x3d')]){_0x3e0aea['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x59d5('0x3e')](_0x3e0aea);})[_0x59d5('0x20')](function(_0xe84e71){_0x46ced7[_0x59d5('0x3f')]=_0xe84e71;return _0x46ced7;})[_0x59d5('0x20')](respondWithFilteredResult(_0x9ce214,_0x3e0aea))['catch'](handleError(_0x9ce214,null));};exports['show']=function(_0x2a8fde,_0x1c9587){var _0x298a14={'raw':!![],'where':{'id':_0x2a8fde[_0x59d5('0x40')]['id']}},_0x57dd10={};_0x57dd10['model']=_['keys'](db[_0x59d5('0x3c')][_0x59d5('0x28')]);_0x57dd10[_0x59d5('0x2b')]=_[_0x59d5('0x2c')](_0x2a8fde[_0x59d5('0x2b')]);_0x57dd10['filters']=_[_0x59d5('0x2e')](_0x57dd10[_0x59d5('0x2a')],_0x57dd10[_0x59d5('0x2b')]);_0x298a14[_0x59d5('0x2f')]=_[_0x59d5('0x2e')](_0x57dd10[_0x59d5('0x2a')],qs[_0x59d5('0x30')](_0x2a8fde[_0x59d5('0x2b')]['fields']));_0x298a14[_0x59d5('0x2f')]=_0x298a14[_0x59d5('0x2f')]['length']?_0x298a14[_0x59d5('0x2f')]:_0x57dd10[_0x59d5('0x2a')];if(_0x2a8fde[_0x59d5('0x2b')][_0x59d5('0x3d')]){_0x298a14['include']=[{'all':!![]}];}_0x298a14=_[_0x59d5('0x38')]({},_0x298a14,_0x2a8fde[_0x59d5('0x3b')]);return db[_0x59d5('0x3c')][_0x59d5('0x41')](_0x298a14)[_0x59d5('0x20')](handleEntityNotFound(_0x1c9587,null))['then'](respondWithResult(_0x1c9587,null))['catch'](handleError(_0x1c9587,null));};exports[_0x59d5('0x1f')]=function(_0x2bf556,_0x1edc9b){if(_0x2bf556[_0x59d5('0x42')]['id']){delete _0x2bf556[_0x59d5('0x42')]['id'];}return db[_0x59d5('0x3c')][_0x59d5('0x41')]({'where':{'id':_0x2bf556[_0x59d5('0x40')]['id']}})[_0x59d5('0x20')](handleEntityNotFound(_0x1edc9b,null))[_0x59d5('0x20')](saveUpdates(_0x2bf556[_0x59d5('0x42')],null))[_0x59d5('0x20')](respondWithResult(_0x1edc9b,null))[_0x59d5('0x43')](handleError(_0x1edc9b,null));};exports['destroy']=function(_0x4853b0,_0x256c6e){return db['CmHopperBlack'][_0x59d5('0x41')]({'where':{'id':_0x4853b0[_0x59d5('0x40')]['id']}})[_0x59d5('0x20')](handleEntityNotFound(_0x256c6e,null))[_0x59d5('0x20')](removeEntity(_0x256c6e,null))['catch'](handleError(_0x256c6e,null));};exports[_0x59d5('0x44')]=function(_0x49c368,_0x304be2){return db['CmHopperBlack'][_0x59d5('0x44')]()[_0x59d5('0x20')](respondWithResult(_0x304be2,null))[_0x59d5('0x43')](handleError(_0x304be2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index f54b0f1..4f64a27 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 _0x8725=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black'];(function(_0x1590b5,_0x1de86d){var _0x4a9557=function(_0x84eef7){while(--_0x84eef7){_0x1590b5['push'](_0x1590b5['shift']());}};_0x4a9557(++_0x1de86d);}(_0x8725,0x11e));var _0x5872=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0x8725[_0x46a3e8];return _0xf1442e;};'use strict';var _=require(_0x5872('0x0'));var util=require('util');var logger=require(_0x5872('0x1'))(_0x5872('0x2'));var moment=require(_0x5872('0x3'));var BPromise=require(_0x5872('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5872('0x5'));var rimraf=require(_0x5872('0x6'));var config=require(_0x5872('0x7'));var attributes=require(_0x5872('0x8'));module[_0x5872('0x9')]=function(_0xaff2c6,_0x26625f){return _0xaff2c6[_0x5872('0xa')](_0x5872('0xb'),attributes,{'tableName':_0x5872('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda1b=['rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','moment'];(function(_0x681a6,_0x207a4e){var _0x1d343c=function(_0xd6bb39){while(--_0xd6bb39){_0x681a6['push'](_0x681a6['shift']());}};_0x1d343c(++_0x207a4e);}(_0xda1b,0xc3));var _0xbda1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xda1b[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xbda1('0x0'));var util=require(_0xbda1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbda1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbda1('0x3'));var config=require(_0xbda1('0x4'));var attributes=require(_0xbda1('0x5'));module['exports']=function(_0x383ce7,_0x1197f6){return _0x383ce7[_0xbda1('0x6')](_0xbda1('0x7'),attributes,{'tableName':_0xbda1('0x8'),'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 20be8a4..f04ac92 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 _0x7f1c=['attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where'];(function(_0x292716,_0x96d32){var _0x34cb57=function(_0x1d0cde){while(--_0x1d0cde){_0x292716['push'](_0x292716['shift']());}};_0x34cb57(++_0x96d32);}(_0x7f1c,0x142));var _0xc7f1=function(_0x52788c,_0x3f4366){_0x52788c=_0x52788c-0x0;var _0x324d3b=_0x7f1c[_0x52788c];return _0x324d3b;};'use strict';var _=require(_0xc7f1('0x0'));var util=require(_0xc7f1('0x1'));var moment=require(_0xc7f1('0x2'));var BPromise=require(_0xc7f1('0x3'));var rs=require(_0xc7f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7f1('0x5'))['db'];var utils=require(_0xc7f1('0x6'));var logger=require(_0xc7f1('0x7'))(_0xc7f1('0x8'));var config=require(_0xc7f1('0x9'));var jayson=require(_0xc7f1('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c3832,_0xc70169,_0x38fa8a){return new BPromise(function(_0x442391,_0x1006f9){return client[_0xc7f1('0xb')](_0x3c3832,_0x38fa8a)[_0xc7f1('0xc')](function(_0x83af59){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0xc70169,'request\x20sent');logger[_0xc7f1('0xd')](_0xc7f1('0xe'),_0xc70169,_0xc7f1('0xf'),JSON[_0xc7f1('0x10')](_0x83af59));if(_0x83af59[_0xc7f1('0x11')]){if(_0x83af59[_0xc7f1('0x11')]['code']===0x1f4){logger['error'](_0xc7f1('0x12'),_0xc70169,_0x83af59[_0xc7f1('0x11')][_0xc7f1('0x13')]);return _0x1006f9(_0x83af59[_0xc7f1('0x11')][_0xc7f1('0x13')]);}logger[_0xc7f1('0x11')](_0xc7f1('0x12'),_0xc70169,_0x83af59[_0xc7f1('0x11')][_0xc7f1('0x13')]);return _0x442391(_0x83af59[_0xc7f1('0x11')][_0xc7f1('0x13')]);}else{logger[_0xc7f1('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0xc70169,_0xc7f1('0xf'));_0x442391(_0x83af59[_0xc7f1('0x15')]['message']);}})[_0xc7f1('0x16')](function(_0x3fa729){logger['error'](_0xc7f1('0x12'),_0xc70169,_0x3fa729);_0x1006f9(_0x3fa729);});});}exports[_0xc7f1('0x17')]=function(_0x477dbc){var _0x55b39b=this;return new Promise(function(_0x393ed0,_0x2619f3){return db[_0xc7f1('0x18')][_0xc7f1('0x19')]({'raw':_0x477dbc[_0xc7f1('0x1a')]?_0x477dbc['options'][_0xc7f1('0x1b')]===undefined?!![]:![]:!![],'where':_0x477dbc[_0xc7f1('0x1a')]?_0x477dbc['options'][_0xc7f1('0x1c')]||null:null,'attributes':_0x477dbc[_0xc7f1('0x1a')]?_0x477dbc[_0xc7f1('0x1a')][_0xc7f1('0x1d')]||null:null,'limit':_0x477dbc[_0xc7f1('0x1a')]?_0x477dbc['options'][_0xc7f1('0x1e')]||null:null,'include':_0x477dbc[_0xc7f1('0x1a')]?_0x477dbc[_0xc7f1('0x1a')][_0xc7f1('0x1f')]?_[_0xc7f1('0x20')](_0x477dbc['options'][_0xc7f1('0x1f')],function(_0x407e17){return{'model':db[_0x407e17['model']],'as':_0x407e17['as'],'attributes':_0x407e17[_0xc7f1('0x1d')],'include':_0x407e17['include']?_[_0xc7f1('0x20')](_0x407e17[_0xc7f1('0x1f')],function(_0xa2ea95){return{'model':db[_0xa2ea95[_0xc7f1('0x21')]],'as':_0xa2ea95['as'],'attributes':_0xa2ea95['attributes'],'include':_0xa2ea95[_0xc7f1('0x1f')]?_[_0xc7f1('0x20')](_0xa2ea95[_0xc7f1('0x1f')],function(_0x156316){return{'model':db[_0x156316[_0xc7f1('0x21')]],'as':_0x156316['as'],'attributes':_0x156316['attributes']};}):[]};}):[]};}):[]:[]})[_0xc7f1('0xc')](function(_0x48369b){logger[_0xc7f1('0x14')](_0xc7f1('0x17'),_0x477dbc);logger[_0xc7f1('0xd')](_0xc7f1('0x17'),_0x477dbc,JSON[_0xc7f1('0x10')](_0x48369b));_0x393ed0(_0x48369b);})[_0xc7f1('0x16')](function(_0x145b44){logger[_0xc7f1('0x11')]('GetCmHopperBlack',_0x145b44[_0xc7f1('0x13')],_0x477dbc);_0x2619f3(_0x55b39b[_0xc7f1('0x11')](0x1f4,_0x145b44[_0xc7f1('0x13')]));});});};exports[_0xc7f1('0x22')]=function(_0x2be56d){var _0x30622c=this;return new Promise(function(_0x2021d0,_0x36c2ab){return db[_0xc7f1('0x18')][_0xc7f1('0x23')](_0x2be56d[_0xc7f1('0x24')],{'raw':_0x2be56d[_0xc7f1('0x1a')]?_0x2be56d[_0xc7f1('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2be56d[_0xc7f1('0x1a')]?_0x2be56d['options'][_0xc7f1('0x1c')]||null:null,'attributes':_0x2be56d[_0xc7f1('0x1a')]?_0x2be56d[_0xc7f1('0x1a')][_0xc7f1('0x1d')]||null:null,'limit':_0x2be56d[_0xc7f1('0x1a')]?_0x2be56d[_0xc7f1('0x1a')][_0xc7f1('0x1e')]||null:null})['then'](function(_0x529815){logger[_0xc7f1('0x14')](_0xc7f1('0x22'),_0x2be56d);logger[_0xc7f1('0xd')](_0xc7f1('0x22'),_0x2be56d,JSON[_0xc7f1('0x10')](_0x529815));_0x2021d0(_0x529815);})[_0xc7f1('0x16')](function(_0x557f6a){logger[_0xc7f1('0x11')](_0xc7f1('0x22'),_0x557f6a['message'],_0x2be56d);_0x36c2ab(_0x30622c[_0xc7f1('0x11')](0x1f4,_0x557f6a[_0xc7f1('0x13')]));});});};exports[_0xc7f1('0x25')]=function(_0x3e8497){var _0x3fafe3=this;return new Promise(function(_0x52fb9b,_0x83d1d4){return db[_0xc7f1('0x18')][_0xc7f1('0x26')]({'where':_0x3e8497[_0xc7f1('0x1a')]?_0x3e8497[_0xc7f1('0x1a')][_0xc7f1('0x1c')]||null:null})[_0xc7f1('0xc')](function(_0x2bf7bc){logger['info'](_0xc7f1('0x25'),_0x3e8497);logger['debug'](_0xc7f1('0x25'),_0x3e8497,JSON[_0xc7f1('0x10')](_0x2bf7bc));_0x52fb9b(_0x2bf7bc);})[_0xc7f1('0x16')](function(_0x3d1483){logger['error']('DestroyCmHopperBlack',_0x3d1483['message'],_0x3e8497);_0x83d1d4(_0x3fafe3[_0xc7f1('0x11')](0x1f4,_0x3d1483['message']));});});}; \ No newline at end of file +var _0xb7dd=['jayson/promise','client','http','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','then','GetCmHopperBlack','stringify','catch','update','body','where','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x223dbe,_0x156c56){var _0x802046=function(_0x4a30f3){while(--_0x4a30f3){_0x223dbe['push'](_0x223dbe['shift']());}};_0x802046(++_0x156c56);}(_0xb7dd,0x93));var _0xdb7d=function(_0x141ac4,_0x4f3d49){_0x141ac4=_0x141ac4-0x0;var _0x4a2e7f=_0xb7dd[_0x141ac4];return _0x4a2e7f;};'use strict';var _=require(_0xdb7d('0x0'));var util=require('util');var moment=require(_0xdb7d('0x1'));var BPromise=require(_0xdb7d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb7d('0x3'));var db=require(_0xdb7d('0x4'))['db'];var utils=require(_0xdb7d('0x5'));var logger=require(_0xdb7d('0x6'))(_0xdb7d('0x7'));var config=require(_0xdb7d('0x8'));var jayson=require(_0xdb7d('0x9'));var client=jayson[_0xdb7d('0xa')][_0xdb7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x498963,_0x4a88bd,_0x56ee04){return new BPromise(function(_0x4eed33,_0x96c7bf){return client['request'](_0x498963,_0x56ee04)['then'](function(_0x3bc0f1){logger[_0xdb7d('0xc')](_0xdb7d('0xd'),_0x4a88bd,'request\x20sent');logger[_0xdb7d('0xe')](_0xdb7d('0xf'),_0x4a88bd,'request\x20sent',JSON['stringify'](_0x3bc0f1));if(_0x3bc0f1[_0xdb7d('0x10')]){if(_0x3bc0f1[_0xdb7d('0x10')]['code']===0x1f4){logger[_0xdb7d('0x10')](_0xdb7d('0xd'),_0x4a88bd,_0x3bc0f1['error'][_0xdb7d('0x11')]);return _0x96c7bf(_0x3bc0f1[_0xdb7d('0x10')]['message']);}logger[_0xdb7d('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4a88bd,_0x3bc0f1['error'][_0xdb7d('0x11')]);return _0x4eed33(_0x3bc0f1[_0xdb7d('0x10')][_0xdb7d('0x11')]);}else{logger[_0xdb7d('0xc')](_0xdb7d('0xd'),_0x4a88bd,_0xdb7d('0x12'));_0x4eed33(_0x3bc0f1[_0xdb7d('0x13')][_0xdb7d('0x11')]);}})['catch'](function(_0x43fff8){logger[_0xdb7d('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4a88bd,_0x43fff8);_0x96c7bf(_0x43fff8);});});}exports['GetCmHopperBlack']=function(_0x412616){var _0x8ef94e=this;return new Promise(function(_0x17859f,_0x26b006){return db[_0xdb7d('0x14')][_0xdb7d('0x15')]({'raw':_0x412616[_0xdb7d('0x16')]?_0x412616[_0xdb7d('0x16')][_0xdb7d('0x17')]===undefined?!![]:![]:!![],'where':_0x412616[_0xdb7d('0x16')]?_0x412616[_0xdb7d('0x16')]['where']||null:null,'attributes':_0x412616[_0xdb7d('0x16')]?_0x412616[_0xdb7d('0x16')][_0xdb7d('0x18')]||null:null,'limit':_0x412616[_0xdb7d('0x16')]?_0x412616['options'][_0xdb7d('0x19')]||null:null,'include':_0x412616[_0xdb7d('0x16')]?_0x412616[_0xdb7d('0x16')][_0xdb7d('0x1a')]?_['map'](_0x412616['options'][_0xdb7d('0x1a')],function(_0x320cb7){return{'model':db[_0x320cb7['model']],'as':_0x320cb7['as'],'attributes':_0x320cb7[_0xdb7d('0x18')],'include':_0x320cb7[_0xdb7d('0x1a')]?_['map'](_0x320cb7[_0xdb7d('0x1a')],function(_0x5b1dd1){return{'model':db[_0x5b1dd1['model']],'as':_0x5b1dd1['as'],'attributes':_0x5b1dd1[_0xdb7d('0x18')],'include':_0x5b1dd1[_0xdb7d('0x1a')]?_[_0xdb7d('0x1b')](_0x5b1dd1[_0xdb7d('0x1a')],function(_0x1909b4){return{'model':db[_0x1909b4[_0xdb7d('0x1c')]],'as':_0x1909b4['as'],'attributes':_0x1909b4[_0xdb7d('0x18')]};}):[]};}):[]};}):[]:[]})[_0xdb7d('0x1d')](function(_0x26a758){logger[_0xdb7d('0xc')](_0xdb7d('0x1e'),_0x412616);logger[_0xdb7d('0xe')]('GetCmHopperBlack',_0x412616,JSON[_0xdb7d('0x1f')](_0x26a758));_0x17859f(_0x26a758);})[_0xdb7d('0x20')](function(_0x6c7985){logger[_0xdb7d('0x10')]('GetCmHopperBlack',_0x6c7985[_0xdb7d('0x11')],_0x412616);_0x26b006(_0x8ef94e[_0xdb7d('0x10')](0x1f4,_0x6c7985[_0xdb7d('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x52c92f){var _0x58a791=this;return new Promise(function(_0x36f5d4,_0x52adec){return db[_0xdb7d('0x14')][_0xdb7d('0x21')](_0x52c92f[_0xdb7d('0x22')],{'raw':_0x52c92f[_0xdb7d('0x16')]?_0x52c92f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52c92f[_0xdb7d('0x16')]?_0x52c92f['options'][_0xdb7d('0x23')]||null:null,'attributes':_0x52c92f['options']?_0x52c92f[_0xdb7d('0x16')][_0xdb7d('0x18')]||null:null,'limit':_0x52c92f[_0xdb7d('0x16')]?_0x52c92f[_0xdb7d('0x16')]['limit']||null:null})[_0xdb7d('0x1d')](function(_0x13c142){logger[_0xdb7d('0xc')](_0xdb7d('0x24'),_0x52c92f);logger['debug']('UpdateCmHopperBlack',_0x52c92f,JSON[_0xdb7d('0x1f')](_0x13c142));_0x36f5d4(_0x13c142);})['catch'](function(_0x3b649a){logger[_0xdb7d('0x10')](_0xdb7d('0x24'),_0x3b649a[_0xdb7d('0x11')],_0x52c92f);_0x52adec(_0x58a791['error'](0x1f4,_0x3b649a[_0xdb7d('0x11')]));});});};exports[_0xdb7d('0x25')]=function(_0xf9df17){var _0x5d09b0=this;return new Promise(function(_0x42d41b,_0x18608d){return db['CmHopperBlack'][_0xdb7d('0x26')]({'where':_0xf9df17[_0xdb7d('0x16')]?_0xf9df17[_0xdb7d('0x16')][_0xdb7d('0x23')]||null:null})[_0xdb7d('0x1d')](function(_0x43405b){logger['info'](_0xdb7d('0x25'),_0xf9df17);logger[_0xdb7d('0xe')](_0xdb7d('0x25'),_0xf9df17,JSON[_0xdb7d('0x1f')](_0x43405b));_0x42d41b(_0x43405b);})[_0xdb7d('0x20')](function(_0x49dae2){logger[_0xdb7d('0x10')](_0xdb7d('0x25'),_0x49dae2[_0xdb7d('0x11')],_0xf9df17);_0x18608d(_0x5d09b0[_0xdb7d('0x10')](0x1f4,_0x49dae2[_0xdb7d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index a4197a3..33ba1d9 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 _0x82c4=['get','/describe','describe','show','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated'];(function(_0x5bd280,_0xb0a036){var _0x1b4d61=function(_0x2f7139){while(--_0x2f7139){_0x5bd280['push'](_0x5bd280['shift']());}};_0x1b4d61(++_0xb0a036);}(_0x82c4,0x1ca));var _0x482c=function(_0x3af770,_0x1a957a){_0x3af770=_0x3af770-0x0;var _0x42c9a9=_0x82c4[_0x3af770];return _0x42c9a9;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var fs_extra=require(_0x482c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x482c('0x7'));var config=require('../../config/environment');var controller=require(_0x482c('0x8'));router['get']('/',auth[_0x482c('0x9')](),controller['index']);router[_0x482c('0xa')](_0x482c('0xb'),auth[_0x482c('0x9')](),controller[_0x482c('0xc')]);router[_0x482c('0xa')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0xd')]);router[_0x482c('0xe')](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x10')]);router['delete'](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0295=['exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','put','update','delete','destroy'];(function(_0x4172a2,_0x5865b9){var _0x2dfcdd=function(_0x40a07e){while(--_0x40a07e){_0x4172a2['push'](_0x4172a2['shift']());}};_0x2dfcdd(++_0x5865b9);}(_0x0295,0x1f0));var _0x5029=function(_0x4a23a9,_0x17a2c0){_0x4a23a9=_0x4a23a9-0x0;var _0x18c27f=_0x0295[_0x4a23a9];return _0x18c27f;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/:id',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0xc')]('/:id',auth[_0x5029('0x8')](),controller[_0x5029('0xd')]);module[_0x5029('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 0fd9c12..98b1c72 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 _0x82af=['exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','seconds','BOOLEAN','sequelize','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x82af,0xae));var _0xf82a=function(_0x1ca29f,_0x318ac5){_0x1ca29f=_0x1ca29f-0x0;var _0x576c3b=_0x82af[_0x1ca29f];return _0x576c3b;};'use strict';var Sequelize=require(_0xf82a('0x0'));var moment=require(_0xf82a('0x1'));module[_0xf82a('0x2')]={'state':{'type':Sequelize[_0xf82a('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xf82a('0x4')]},'scheduledat':{'type':Sequelize[_0xf82a('0x5')]},'countbusyretry':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xf82a('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf82a('0x4')]},'calleridname':{'type':Sequelize[_0xf82a('0x4')]},'starttime':{'type':Sequelize[_0xf82a('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xf82a('0x5')]},'droptime':{'type':Sequelize[_0xf82a('0x5')]},'endtime':{'type':Sequelize[_0xf82a('0x5')]},'ringtime':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf82a('0x4')]},'campaign':{'type':Sequelize[_0xf82a('0x4')]},'campaigntype':{'type':Sequelize[_0xf82a('0x4')]},'membername':{'type':Sequelize[_0xf82a('0x4')]},'reason':{'type':Sequelize[_0xf82a('0x4')]},'disposition':{'type':Sequelize[_0xf82a('0x4')]},'secondDisposition':{'type':Sequelize[_0xf82a('0x4')]},'thirdDisposition':{'type':Sequelize[_0xf82a('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x3406c7){var _0x3ae92d=this[_0xf82a('0x6')]('endtime');if(_0x3ae92d&&_0x3406c7){this[_0xf82a('0x7')](_0xf82a('0x8'),moment(_0x3406c7)['diff'](moment(_0x3ae92d),_0xf82a('0x9')));}}},'amd':{'type':Sequelize[_0xf82a('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf82a('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf82a('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf82a('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf82a('0x5')]},'callback':{'type':Sequelize[_0xf82a('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf82a('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf82a('0x5')]},'deleted':{'type':Sequelize[_0xf82a('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xf82a('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf82a('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf82a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x24f7=['followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x24f7,0x10c));var _0x724f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24f7[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x724f('0x0'));var moment=require(_0x724f('0x1'));module[_0x724f('0x2')]={'state':{'type':Sequelize[_0x724f('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x724f('0x4')]},'scheduledat':{'type':Sequelize[_0x724f('0x5')]},'countbusyretry':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x724f('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x724f('0x4')]},'originatecalleridname':{'type':Sequelize[_0x724f('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x724f('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x724f('0x5')]},'answertime':{'type':Sequelize[_0x724f('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x724f('0x5')]},'ringtime':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x724f('0x4')]},'campaign':{'type':Sequelize[_0x724f('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x724f('0x4')]},'reason':{'type':Sequelize[_0x724f('0x4')]},'disposition':{'type':Sequelize[_0x724f('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x724f('0x4')]},'dispositionat':{'type':Sequelize[_0x724f('0x5')],'set':function(_0x3892ab){var _0x4f9b4e=this[_0x724f('0x6')]('endtime');if(_0x4f9b4e&&_0x3892ab){this[_0x724f('0x7')](_0x724f('0x8'),moment(_0x3892ab)[_0x724f('0x9')](moment(_0x4f9b4e),_0x724f('0xa')));}}},'amd':{'type':Sequelize[_0x724f('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x724f('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x724f('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x724f('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x724f('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x724f('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x724f('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x724f('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index b46be06..9c56949 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 _0xc6ac=['key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','CmHopperFinal','rawAttributes','fieldName','type'];(function(_0x4be1ed,_0x1539b8){var _0x40e30c=function(_0x4bd279){while(--_0x4bd279){_0x4be1ed['push'](_0x4be1ed['shift']());}};_0x40e30c(++_0x1539b8);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4fc51a,_0x22ddd6){_0x4fc51a=_0x4fc51a-0x0;var _0x45cec7=_0xc6ac[_0x4fc51a];return _0x45cec7;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':!![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['describe']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')]()[_0xcc6a('0x27')](respondWithResult(_0x47c999,null))[_0xcc6a('0x4b')](handleError(_0x47c999,null));};exports['update']=function(_0x1c3bb8,_0x5e7bab){if(_0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')]){delete _0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'uniqueid':_0x1c3bb8['params']['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5e7bab,null))[_0xcc6a('0x27')](saveUpdates(_0x1c3bb8[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x5e7bab,null))[_0xcc6a('0x4b')](handleError(_0x5e7bab,null));};exports[_0xcc6a('0x4f')]=function(_0x431684,_0x392805,_0x31987f){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x431684[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db['sequelize']['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal'](_0xcc6a('0x59')))),'abandonedContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x2022,\x201,\x20null'))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})[_0xcc6a('0x27')](handleEntityNotFound(_0x392805,null))[_0xcc6a('0x27')](respondWithResult(_0x392805,null))[_0xcc6a('0x4b')](handleError(_0x392805,null));};exports[_0xcc6a('0x5d')]=function(_0x3e76d7,_0x42bbc7,_0x2ad9a6){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'CampaignId':_0x3e76d7[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x5e')))),_0xcc6a('0x5f')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x59')))),_0xcc6a('0x60')],[db[_0xcc6a('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x61')))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})['then'](handleEntityNotFound(_0x42bbc7,null))[_0xcc6a('0x27')](respondWithResult(_0x42bbc7,null))[_0xcc6a('0x4b')](handleError(_0x42bbc7,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x72e53a,_0x5b61df,_0x3b4ce0){return db['VoiceQueue'][_0xcc6a('0x4a')]({'where':{'id':_0x72e53a[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5b61df,null))['then'](function(_0x3ce1eb){var _0x51390a;if(_0x3ce1eb){_0x51390a=squel[_0xcc6a('0x62')]()['into'](_0xcc6a('0x63'))[_0xcc6a('0x64')]([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'VoiceQueueId',_0xcc6a('0x69'),_0xcc6a('0x6a')],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),'phone')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'scheduledAt')['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(VoiceQueueId)',_0xcc6a('0x71'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x69'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'updatedAt')['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x72e53a['body'][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x65'))[_0xcc6a('0x79')]('cm_hopper')[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())['where'](_0xcc6a('0x7b')))[_0xcc6a('0x7c')](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0x51390a);}return[];})['then'](respondWithResult(_0x5b61df,null))['catch'](handleError(_0x5b61df,null));};exports[_0xcc6a('0x7d')]=function(_0x5be65b,_0xb42e9,_0x35a798){return db[_0xcc6a('0x7e')][_0xcc6a('0x4a')]({'where':{'id':_0x5be65b[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0xb42e9,null))[_0xcc6a('0x27')](function(_0x1746d8){var _0xc0d194;if(_0x1746d8){_0xc0d194=squel[_0xcc6a('0x62')]()[_0xcc6a('0x7f')](_0xcc6a('0x63'))['fromQuery']([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'CampaignId',_0xcc6a('0x69'),'updatedAt'],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),_0xcc6a('0x65'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x66'))['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(CampaignId)',_0xcc6a('0x80'))[_0xcc6a('0x6c')]('NOW()','createdAt')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x6a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))['where'](_0xcc6a('0x81'),_0x5be65b['params']['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x5be65b[_0xcc6a('0x4d')][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))['where'](_0xcc6a('0x78'),squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')]('phone')[_0xcc6a('0x79')](_0xcc6a('0x63'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id']['toString']())['where'](_0xcc6a('0x7b')))['group'](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0xc0d194);}return[];})[_0xcc6a('0x27')](respondWithResult(_0xb42e9,null))[_0xcc6a('0x4b')](handleError(_0xb42e9,null));};exports[_0xcc6a('0x82')]=function(_0x48b6e3,_0x10d731,_0x537e2b){return db['CmHopper'][_0xcc6a('0x83')]({'where':{'VoiceQueueId':_0x48b6e3['body'][_0xcc6a('0x71')],'CampaignId':_0x48b6e3[_0xcc6a('0x4d')]['CampaignId'],'ContactId':_0x48b6e3['body'][_0xcc6a('0x67')]}})['then'](handleEntityNotFound(_0x10d731,null))[_0xcc6a('0x27')](function(_0x3df510){if(_0x3df510){return _0x3df510;}return null;})[_0xcc6a('0x27')](respondWithResult(_0x10d731,null))[_0xcc6a('0x4b')](handleError(_0x10d731,null));}; \ No newline at end of file +var _0xba34=['insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','state\x20=\x20?','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0xba34,0x119));var _0x4ba3=function(_0x3f285e,_0x4b495c){_0x3f285e=_0x3f285e-0x0;var _0x9f6638=_0xba34[_0x3f285e];return _0x9f6638;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['describe']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['describe']()[_0x4ba3('0x26')](respondWithResult(_0x1fe115,null))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports[_0x4ba3('0x25')]=function(_0x58648d,_0x47f588){if(_0x58648d[_0x4ba3('0x49')]['uniqueid']){delete _0x58648d[_0x4ba3('0x49')][_0x4ba3('0x4a')];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'uniqueid':_0x58648d[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x47f588,null))['then'](saveUpdates(_0x58648d[_0x4ba3('0x49')],null))[_0x4ba3('0x26')](respondWithResult(_0x47f588,null))['catch'](handleError(_0x47f588,null));};exports[_0x4ba3('0x4c')]=function(_0x12ae6f,_0x156c2d,_0x19d6a3){return db[_0x4ba3('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x12ae6f[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),_0x4ba3('0x53')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x4ba3('0x54')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5a')))),_0x4ba3('0x5b')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x156c2d,null))[_0x4ba3('0x26')](respondWithResult(_0x156c2d,null))[_0x4ba3('0x46')](handleError(_0x156c2d,null));};exports[_0x4ba3('0x5d')]=function(_0xf0fd32,_0x4b5289,_0x3d9a7e){return db[_0x4ba3('0x2d')][_0x4ba3('0x44')]({'raw':![],'where':{'CampaignId':_0xf0fd32[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),'noAnswerContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x5e')))),'busyContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5f')))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4ba3('0x5b')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x4b5289,null))['then'](respondWithResult(_0x4b5289,null))[_0x4ba3('0x46')](handleError(_0x4b5289,null));};exports[_0x4ba3('0x60')]=function(_0x5dce8f,_0x37fedb,_0x2ed729){return db[_0x4ba3('0x61')][_0x4ba3('0x48')]({'where':{'id':_0x5dce8f[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x37fedb,null))[_0x4ba3('0x26')](function(_0x329874){var _0x360127;if(_0x329874){_0x360127=squel['insert']()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),_0x4ba3('0x66'),_0x4ba3('0x67'),_0x4ba3('0x68'),_0x4ba3('0x69'),_0x4ba3('0x6a'),_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')]('ANY_VALUE(calleridnum)',_0x4ba3('0x65'))[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')]('ANY_VALUE(ContactId)','ContactId')[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x6f'),_0x4ba3('0x69'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')]('state\x20=\x20?',_0x5dce8f[_0x4ba3('0x49')][_0x4ba3('0x75')][_0x4ba3('0x74')]())['where'](_0x4ba3('0x76'))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')]('cm_hopper')['where'](_0x4ba3('0x73'),_0x5dce8f['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field']('calleridnum')[_0x4ba3('0x71')](_0x4ba3('0x72'))['where'](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')](_0x4ba3('0x67')))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x360127);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x37fedb,null))['catch'](handleError(_0x37fedb,null));};exports[_0x4ba3('0x7a')]=function(_0x13dbc4,_0x4e334c,_0x39d1d3){return db[_0x4ba3('0x7b')]['find']({'where':{'id':_0x13dbc4['params']['id']}})['then'](handleEntityNotFound(_0x4e334c,null))['then'](function(_0x206e93){var _0x2d57a7;if(_0x206e93){_0x2d57a7=squel[_0x4ba3('0x7c')]()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),'scheduledAt',_0x4ba3('0x67'),'ListId',_0x4ba3('0x7d'),'createdAt',_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x7e'),_0x4ba3('0x65'))['field']('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')](_0x4ba3('0x7f'),_0x4ba3('0x67'))[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x80'),_0x4ba3('0x7d'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x81'),_0x13dbc4['body']['state'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x76'))['where'](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')](_0x4ba3('0x63'))['where'](_0x4ba3('0x82'),_0x13dbc4['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field'](_0x4ba3('0x83'))[_0x4ba3('0x71')]('cm_hopper_final')[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')]('ContactId'))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x2d57a7);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x4e334c,null))['catch'](handleError(_0x4e334c,null));};exports[_0x4ba3('0x84')]=function(_0x38a7a8,_0x5553eb,_0x402ab1){return db[_0x4ba3('0x85')][_0x4ba3('0x86')]({'where':{'VoiceQueueId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x69')],'CampaignId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x7d')],'ContactId':_0x38a7a8[_0x4ba3('0x49')]['ContactId']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5553eb,null))[_0x4ba3('0x26')](function(_0xfb16a6){if(_0xfb16a6){return _0xfb16a6;}return null;})[_0x4ba3('0x26')](respondWithResult(_0x5553eb,null))[_0x4ba3('0x46')](handleError(_0x5553eb,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ba9f5a3..0b20ac7 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 _0x92e7=['bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment'];(function(_0x2e20c1,_0x2e4772){var _0x3cef7a=function(_0x21b1f6){while(--_0x21b1f6){_0x2e20c1['push'](_0x2e20c1['shift']());}};_0x3cef7a(++_0x2e4772);}(_0x92e7,0x122));var _0x792e=function(_0x4eef8b,_0x2cbf9d){_0x4eef8b=_0x4eef8b-0x0;var _0x3617c9=_0x92e7[_0x4eef8b];return _0x3617c9;};'use strict';var _=require(_0x792e('0x0'));var util=require(_0x792e('0x1'));var logger=require('../../config/logger')(_0x792e('0x2'));var moment=require(_0x792e('0x3'));var BPromise=require(_0x792e('0x4'));var rp=require(_0x792e('0x5'));var fs=require('fs');var path=require(_0x792e('0x6'));var rimraf=require('rimraf');var config=require(_0x792e('0x7'));var attributes=require(_0x792e('0x8'));module[_0x792e('0x9')]=function(_0x22a82f,_0x4ee609){return _0x22a82f[_0x792e('0xa')]('CmHopperFinal',attributes,{'tableName':_0x792e('0xb'),'paranoid':![],'indexes':[{'name':_0x792e('0xc'),'fields':['calleridnum']},{'name':_0x792e('0xd'),'fields':[_0x792e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda18=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','CmHopperFinal'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0xda18,0x17c));var _0x8da1=function(_0x5ef58b,_0x22bc1f){_0x5ef58b=_0x5ef58b-0x0;var _0x1ec887=_0xda18[_0x5ef58b];return _0x1ec887;};'use strict';var _=require(_0x8da1('0x0'));var util=require('util');var logger=require(_0x8da1('0x1'))(_0x8da1('0x2'));var moment=require(_0x8da1('0x3'));var BPromise=require(_0x8da1('0x4'));var rp=require(_0x8da1('0x5'));var fs=require('fs');var path=require(_0x8da1('0x6'));var rimraf=require(_0x8da1('0x7'));var config=require('../../config/environment');var attributes=require(_0x8da1('0x8'));module['exports']=function(_0x2f4a7b,_0x2e207c){return _0x2f4a7b['define'](_0x8da1('0x9'),attributes,{'tableName':_0x8da1('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x8da1('0xb')]},{'name':_0x8da1('0xc'),'fields':[_0x8da1('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 d501535..63e90db 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(_0x23a4cc,_0x4f4189){var _0x465990=function(_0x4697e9){while(--_0x4697e9){_0x23a4cc['push'](_0x23a4cc['shift']());}};_0x465990(++_0x4f4189);}(_0x7a54,0x106));var _0x47a5=function(_0x113a99,_0x21d57d){_0x113a99=_0x113a99-0x0;var _0x140fdf=_0x7a54[_0x113a99];return _0x140fdf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x20af3e,_0x130a58){var _0x45fcfb=function(_0x1f9bf5){while(--_0x1f9bf5){_0x20af3e['push'](_0x20af3e['shift']());}};_0x45fcfb(++_0x130a58);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a87a8,_0x127bc9){_0x1a87a8=_0x1a87a8-0x0;var _0x51b8b7=_0xb10b[_0x1a87a8];return _0x51b8b7;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index e69824c..e7f9c48 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 _0x74cc=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id'];(function(_0x5e4887,_0x54a2ef){var _0x3222a7=function(_0x227d2c){while(--_0x227d2c){_0x5e4887['push'](_0x5e4887['shift']());}};_0x3222a7(++_0x54a2ef);}(_0x74cc,0x184));var _0xc74c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x74cc[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc74c('0x0'));var util=require(_0xc74c('0x1'));var path=require(_0xc74c('0x2'));var timeout=require(_0xc74c('0x3'));var express=require(_0xc74c('0x4'));var router=express['Router']();var fs_extra=require(_0xc74c('0x5'));var auth=require(_0xc74c('0x6'));var interaction=require(_0xc74c('0x7'));var config=require('../../config/environment');var controller=require(_0xc74c('0x8'));router['get']('/',auth[_0xc74c('0x9')](),controller[_0xc74c('0xa')]);router[_0xc74c('0xb')](_0xc74c('0xc'),auth['isAuthenticated'](),controller[_0xc74c('0xd')]);router[_0xc74c('0xb')](_0xc74c('0xe'),auth[_0xc74c('0x9')](),controller[_0xc74c('0xf')]);router[_0xc74c('0xb')](_0xc74c('0x10'),auth[_0xc74c('0x9')](),controller[_0xc74c('0x11')]);router[_0xc74c('0xb')](_0xc74c('0x12'),auth[_0xc74c('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0xc74c('0x13'),auth[_0xc74c('0x9')](),controller[_0xc74c('0x14')]);router['post'](_0xc74c('0x15'),auth[_0xc74c('0x9')](),controller[_0xc74c('0x16')]);router['post'](_0xc74c('0x17'),auth[_0xc74c('0x9')](),controller['checkContactHopper']);router[_0xc74c('0x18')](_0xc74c('0xe'),auth[_0xc74c('0x9')](),controller[_0xc74c('0x19')]);module[_0xc74c('0x1a')]=router; \ No newline at end of file +var _0xb12c=['/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xb12c,0x142));var _0xcb12=function(_0x50a643,_0x28642b){_0x50a643=_0x50a643-0x0;var _0x3146e5=_0xb12c[_0x50a643];return _0x3146e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcb12('0x0'));var timeout=require('connect-timeout');var express=require(_0xcb12('0x1'));var router=express[_0xcb12('0x2')]();var fs_extra=require(_0xcb12('0x3'));var auth=require(_0xcb12('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcb12('0x5'));var controller=require(_0xcb12('0x6'));router[_0xcb12('0x7')]('/',auth['isAuthenticated'](),controller[_0xcb12('0x8')]);router[_0xcb12('0x7')](_0xcb12('0x9'),auth[_0xcb12('0xa')](),controller[_0xcb12('0xb')]);router['get'](_0xcb12('0xc'),auth[_0xcb12('0xa')](),controller[_0xcb12('0xd')]);router['get'](_0xcb12('0xe'),auth[_0xcb12('0xa')](),controller[_0xcb12('0xf')]);router[_0xcb12('0x7')](_0xcb12('0x10'),auth[_0xcb12('0xa')](),controller[_0xcb12('0x11')]);router[_0xcb12('0x12')]('/voice/queue/moveContacts/:id',auth[_0xcb12('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xcb12('0x12')](_0xcb12('0x13'),auth['isAuthenticated'](),controller[_0xcb12('0x14')]);router['post'](_0xcb12('0x15'),auth[_0xcb12('0xa')](),controller[_0xcb12('0x16')]);router[_0xcb12('0x17')](_0xcb12('0xc'),auth[_0xcb12('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 06cc72d..6b20f62 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 _0x0619=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x5cb139,_0x1a5f77){var _0x816e2b=function(_0x1ad50f){while(--_0x1ad50f){_0x5cb139['push'](_0x5cb139['shift']());}};_0x816e2b(++_0x1a5f77);}(_0x0619,0x90));var _0x9061=function(_0x344bbd,_0xa0c6d6){_0x344bbd=_0x344bbd-0x0;var _0x36c323=_0x0619[_0x344bbd];return _0x36c323;};'use strict';var Sequelize=require(_0x9061('0x0'));module[_0x9061('0x1')]={'state':{'type':Sequelize[_0x9061('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9061('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9061('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x9061('0x3')]},'originatecalleridname':{'type':Sequelize[_0x9061('0x3')]},'calleridnum':{'type':Sequelize[_0x9061('0x3')]},'calleridname':{'type':Sequelize[_0x9061('0x3')]},'starttime':{'type':Sequelize[_0x9061('0x4')]},'responsetime':{'type':Sequelize[_0x9061('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x9061('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x9061('0x3')]},'campaigntype':{'type':Sequelize[_0x9061('0x3')]},'membername':{'type':Sequelize[_0x9061('0x3')]},'reason':{'type':Sequelize[_0x9061('0x3')]},'amd':{'type':Sequelize[_0x9061('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9061('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x9061('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9061('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9061('0x4')]},'recallme':{'type':Sequelize[_0x9061('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x9061('0x4')]},'edited':{'type':Sequelize[_0x9061('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9061('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9061('0x3')]}}; \ No newline at end of file +var _0x4d0a=['STRING','BOOLEAN','sequelize','exports','INTEGER','DATE'];(function(_0x38f4ed,_0x135b07){var _0xc2e215=function(_0x48ba93){while(--_0x48ba93){_0x38f4ed['push'](_0x38f4ed['shift']());}};_0xc2e215(++_0x135b07);}(_0x4d0a,0x176));var _0xa4d0=function(_0x21868b,_0x243a16){_0x21868b=_0x21868b-0x0;var _0x2ad9d8=_0x4d0a[_0x21868b];return _0x2ad9d8;};'use strict';var Sequelize=require(_0xa4d0('0x0'));module[_0xa4d0('0x1')]={'state':{'type':Sequelize[_0xa4d0('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa4d0('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa4d0('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xa4d0('0x4')]},'originatecalleridname':{'type':Sequelize[_0xa4d0('0x4')]},'calleridnum':{'type':Sequelize[_0xa4d0('0x4')]},'calleridname':{'type':Sequelize[_0xa4d0('0x4')]},'starttime':{'type':Sequelize[_0xa4d0('0x3')]},'responsetime':{'type':Sequelize[_0xa4d0('0x3')]},'answertime':{'type':Sequelize[_0xa4d0('0x3')]},'droptime':{'type':Sequelize[_0xa4d0('0x3')]},'endtime':{'type':Sequelize[_0xa4d0('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa4d0('0x4')]},'campaign':{'type':Sequelize[_0xa4d0('0x4')]},'campaigntype':{'type':Sequelize[_0xa4d0('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa4d0('0x4')]},'amd':{'type':Sequelize[_0xa4d0('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa4d0('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xa4d0('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa4d0('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa4d0('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa4d0('0x3')]},'edited':{'type':Sequelize[_0xa4d0('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa4d0('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 161f274..a0288c8 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 _0xb6d1=['request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','describe','body','uniqueid','zip-dir','fast-json-patch'];(function(_0x46b191,_0x5a1c01){var _0x16acf0=function(_0x1d54be){while(--_0x1d54be){_0x46b191['push'](_0x46b191['shift']());}};_0x16acf0(++_0x5a1c01);}(_0xb6d1,0xd9));var _0x1b6d=function(_0x245ff8,_0x2e81f8){_0x245ff8=_0x245ff8-0x0;var _0x5a4faa=_0xb6d1[_0x245ff8];return _0x5a4faa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b6d('0x0'));var jsonpatch=require(_0x1b6d('0x1'));var rp=require(_0x1b6d('0x2'));var moment=require(_0x1b6d('0x3'));var BPromise=require(_0x1b6d('0x4'));var Mustache=require(_0x1b6d('0x5'));var util=require(_0x1b6d('0x6'));var path=require(_0x1b6d('0x7'));var sox=require('sox');var csv=require(_0x1b6d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b6d('0x9'));var _=require(_0x1b6d('0xa'));var squel=require(_0x1b6d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1b6d('0xc'));var toCsv=require(_0x1b6d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b6d('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b6d('0xe'));var logger=require(_0x1b6d('0xf'))(_0x1b6d('0x10'));var utils=require('../../config/utils');var config=require(_0x1b6d('0x11'));var licenseUtil=require(_0x1b6d('0x12'));var db=require(_0x1b6d('0x13'))['db'];function respondWithStatusCode(_0x15cf91,_0x1a32db){_0x1a32db=_0x1a32db||0xcc;return function(_0x5f2beb){if(_0x5f2beb){return _0x15cf91[_0x1b6d('0x14')](_0x1a32db);}return _0x15cf91['status'](_0x1a32db)[_0x1b6d('0x15')]();};}function respondWithResult(_0x3c9813,_0x569aec){_0x569aec=_0x569aec||0xc8;return function(_0x1deaf0){if(_0x1deaf0){return _0x3c9813[_0x1b6d('0x16')](_0x569aec)[_0x1b6d('0x17')](_0x1deaf0);}};}function respondWithFilteredResult(_0x338d22,_0x613aae){return function(_0x1db5d7){if(_0x1db5d7){var _0x1e667b=typeof _0x613aae['offset']===_0x1b6d('0x18')&&typeof _0x613aae[_0x1b6d('0x19')]==='undefined';var _0x25731f=_0x1db5d7[_0x1b6d('0x1a')];var _0x387748=_0x1e667b?0x0:_0x613aae[_0x1b6d('0x1b')];var _0x8e24e=_0x1e667b?_0x1db5d7[_0x1b6d('0x1a')]:_0x613aae[_0x1b6d('0x1b')]+_0x613aae[_0x1b6d('0x19')];var _0x32d34d;if(_0x8e24e>=_0x25731f){_0x8e24e=_0x25731f;_0x32d34d=0xc8;}else{_0x32d34d=0xce;}_0x338d22['status'](_0x32d34d);return _0x338d22['set'](_0x1b6d('0x1c'),_0x387748+'-'+_0x8e24e+'/'+_0x25731f)['json'](_0x1db5d7);}return null;};}function patchUpdates(_0x4935a8){return function(_0x523f84){try{jsonpatch[_0x1b6d('0x1d')](_0x523f84,_0x4935a8,!![]);}catch(_0x30458b){return BPromise[_0x1b6d('0x1e')](_0x30458b);}return _0x523f84['save']();};}function saveUpdates(_0x6a8c55,_0x51ea86){return function(_0x396db1){if(_0x396db1){return _0x396db1[_0x1b6d('0x1f')](_0x6a8c55)[_0x1b6d('0x20')](function(_0x3eb8b7){return _0x3eb8b7;});}return null;};}function removeEntity(_0x1ec93c,_0x21b5db){return function(_0x30c919){if(_0x30c919){return _0x30c919[_0x1b6d('0x21')]()[_0x1b6d('0x20')](function(){_0x1ec93c[_0x1b6d('0x16')](0xcc)[_0x1b6d('0x15')]();});}};}function handleEntityNotFound(_0x1de5cb,_0x3cb2c4){return function(_0x2059d7){if(!_0x2059d7){_0x1de5cb[_0x1b6d('0x14')](0x194);}return _0x2059d7;};}function handleError(_0x2cf129,_0x3402cc){_0x3402cc=_0x3402cc||0x1f4;return function(_0x1d613c){logger[_0x1b6d('0x22')](_0x1d613c[_0x1b6d('0x23')]);if(_0x1d613c[_0x1b6d('0x24')]){delete _0x1d613c['name'];}_0x2cf129[_0x1b6d('0x16')](_0x3402cc)[_0x1b6d('0x25')](_0x1d613c);};}exports[_0x1b6d('0x26')]=function(_0x54fb16,_0xb4baab){var _0xe01815={},_0x22550d={},_0x4d2a63={'count':0x0,'rows':[]};var _0x3c8e73=_[_0x1b6d('0x27')](db[_0x1b6d('0x28')][_0x1b6d('0x29')],function(_0x3df014){return{'name':_0x3df014[_0x1b6d('0x2a')],'type':_0x3df014[_0x1b6d('0x2b')][_0x1b6d('0x2c')]};});_0x22550d[_0x1b6d('0x2d')]=_[_0x1b6d('0x27')](_0x3c8e73,_0x1b6d('0x24'));_0x22550d[_0x1b6d('0x2e')]=_[_0x1b6d('0x2f')](_0x54fb16[_0x1b6d('0x2e')]);_0x22550d[_0x1b6d('0x30')]=_[_0x1b6d('0x31')](_0x22550d['model'],_0x22550d['query']);_0xe01815[_0x1b6d('0x32')]=_[_0x1b6d('0x31')](_0x22550d['model'],qs[_0x1b6d('0x33')](_0x54fb16[_0x1b6d('0x2e')][_0x1b6d('0x33')]));_0xe01815['attributes']=_0xe01815[_0x1b6d('0x32')][_0x1b6d('0x34')]?_0xe01815['attributes']:_0x22550d[_0x1b6d('0x2d')];if(!_0x54fb16[_0x1b6d('0x2e')][_0x1b6d('0x35')](_0x1b6d('0x36'))){_0xe01815[_0x1b6d('0x19')]=qs[_0x1b6d('0x19')](_0x54fb16[_0x1b6d('0x2e')][_0x1b6d('0x19')]);_0xe01815['offset']=qs[_0x1b6d('0x1b')](_0x54fb16['query'][_0x1b6d('0x1b')]);}_0xe01815[_0x1b6d('0x37')]=qs['sort'](_0x54fb16['query']['sort']);_0xe01815[_0x1b6d('0x38')]=qs['filters'](_[_0x1b6d('0x39')](_0x54fb16[_0x1b6d('0x2e')],_0x22550d[_0x1b6d('0x30')]),_0x3c8e73);if(_0x54fb16['query'][_0x1b6d('0x3a')]){_0xe01815[_0x1b6d('0x38')]=_[_0x1b6d('0x3b')](_0xe01815[_0x1b6d('0x38')],{'$or':_[_0x1b6d('0x27')](_0x3c8e73,function(_0x28ffff){if(_0x28ffff[_0x1b6d('0x2b')]!==_0x1b6d('0x3c')){var _0x2eb67c={};_0x2eb67c[_0x28ffff[_0x1b6d('0x24')]]={'$like':'%'+_0x54fb16[_0x1b6d('0x2e')][_0x1b6d('0x3a')]+'%'};return _0x2eb67c;}})});}_0xe01815=_[_0x1b6d('0x3b')]({},_0xe01815,_0x54fb16[_0x1b6d('0x3d')]);var _0x18b021={'where':_0xe01815[_0x1b6d('0x38')]};return db[_0x1b6d('0x28')][_0x1b6d('0x1a')](_0x18b021)[_0x1b6d('0x20')](function(_0x31fc59){_0x4d2a63[_0x1b6d('0x1a')]=_0x31fc59;if(_0x54fb16[_0x1b6d('0x2e')][_0x1b6d('0x3e')]){_0xe01815[_0x1b6d('0x3f')]=[{'all':!![]}];}return db[_0x1b6d('0x28')][_0x1b6d('0x40')](_0xe01815);})[_0x1b6d('0x20')](function(_0x45973b){_0x4d2a63[_0x1b6d('0x41')]=_0x45973b;return _0x4d2a63;})[_0x1b6d('0x20')](respondWithFilteredResult(_0xb4baab,_0xe01815))['catch'](handleError(_0xb4baab,null));};exports[_0x1b6d('0x42')]=function(_0x569165,_0x28a5f0){var _0x19f18a={'raw':!![],'where':{'id':_0x569165['params']['id']}},_0x5674cb={};_0x5674cb['model']=_[_0x1b6d('0x2f')](db[_0x1b6d('0x28')][_0x1b6d('0x29')]);_0x5674cb['query']=_['keys'](_0x569165[_0x1b6d('0x2e')]);_0x5674cb[_0x1b6d('0x30')]=_[_0x1b6d('0x31')](_0x5674cb[_0x1b6d('0x2d')],_0x5674cb[_0x1b6d('0x2e')]);_0x19f18a[_0x1b6d('0x32')]=_[_0x1b6d('0x31')](_0x5674cb[_0x1b6d('0x2d')],qs[_0x1b6d('0x33')](_0x569165[_0x1b6d('0x2e')][_0x1b6d('0x33')]));_0x19f18a['attributes']=_0x19f18a[_0x1b6d('0x32')][_0x1b6d('0x34')]?_0x19f18a[_0x1b6d('0x32')]:_0x5674cb[_0x1b6d('0x2d')];if(_0x569165['query']['includeAll']){_0x19f18a[_0x1b6d('0x3f')]=[{'all':!![]}];}_0x19f18a=_[_0x1b6d('0x3b')]({},_0x19f18a,_0x569165[_0x1b6d('0x3d')]);return db['CmHopperHistory'][_0x1b6d('0x43')](_0x19f18a)['then'](handleEntityNotFound(_0x28a5f0,null))[_0x1b6d('0x20')](respondWithResult(_0x28a5f0,null))[_0x1b6d('0x44')](handleError(_0x28a5f0,null));};exports[_0x1b6d('0x45')]=function(_0xc21117,_0x5f47ba){return db[_0x1b6d('0x28')]['create'](_0xc21117['body'],{})[_0x1b6d('0x20')](respondWithResult(_0x5f47ba,0xc9))[_0x1b6d('0x44')](handleError(_0x5f47ba,null));};exports[_0x1b6d('0x46')]=function(_0xfba03,_0x20fd02){return db[_0x1b6d('0x28')][_0x1b6d('0x46')]()[_0x1b6d('0x20')](respondWithResult(_0x20fd02,null))[_0x1b6d('0x44')](handleError(_0x20fd02,null));};exports['update']=function(_0xc83767,_0x4f2f28){if(_0xc83767[_0x1b6d('0x47')]['uniqueid']){delete _0xc83767[_0x1b6d('0x47')][_0x1b6d('0x48')];}return db[_0x1b6d('0x28')][_0x1b6d('0x43')]({'where':{'uniqueid':_0xc83767['params']['id']}})[_0x1b6d('0x20')](handleEntityNotFound(_0x4f2f28,null))[_0x1b6d('0x20')](saveUpdates(_0xc83767['body'],null))['then'](respondWithResult(_0x4f2f28,null))['catch'](handleError(_0x4f2f28,null));}; \ No newline at end of file +var _0x52f0=['ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','map','keys','filters','intersection','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv'];(function(_0x5366ea,_0x11dcea){var _0x5e248a=function(_0x1be5d2){while(--_0x1be5d2){_0x5366ea['push'](_0x5366ea['shift']());}};_0x5e248a(++_0x11dcea);}(_0x52f0,0x17a));var _0x052f=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0x52f0[_0x4ea413];return _0x51cf25;};'use strict';var emlformat=require(_0x052f('0x0'));var rimraf=require(_0x052f('0x1'));var zipdir=require(_0x052f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x052f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x052f('0x4'));var util=require(_0x052f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x052f('0x6'));var ejs=require(_0x052f('0x7'));var fs=require('fs');var fs_extra=require(_0x052f('0x8'));var _=require(_0x052f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x052f('0xa'));var deskjs=require(_0x052f('0xb'));var toCsv=require(_0x052f('0x6'));var querystring=require(_0x052f('0xc'));var Papa=require('papaparse');var Redis=require(_0x052f('0xd'));var authService=require(_0x052f('0xe'));var qs=require(_0x052f('0xf'));var as=require(_0x052f('0x10'));var hardwareService=require(_0x052f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x052f('0x12'));var config=require(_0x052f('0x13'));var licenseUtil=require(_0x052f('0x14'));var db=require(_0x052f('0x15'))['db'];function respondWithStatusCode(_0x304dbb,_0xe08ceb){_0xe08ceb=_0xe08ceb||0xcc;return function(_0x2ddfed){if(_0x2ddfed){return _0x304dbb['sendStatus'](_0xe08ceb);}return _0x304dbb[_0x052f('0x16')](_0xe08ceb)[_0x052f('0x17')]();};}function respondWithResult(_0x15d004,_0x2b07e2){_0x2b07e2=_0x2b07e2||0xc8;return function(_0x703f2){if(_0x703f2){return _0x15d004[_0x052f('0x16')](_0x2b07e2)['json'](_0x703f2);}};}function respondWithFilteredResult(_0x594b87,_0x1e6271){return function(_0x2ad126){if(_0x2ad126){var _0x5c7b5d=typeof _0x1e6271[_0x052f('0x18')]===_0x052f('0x19')&&typeof _0x1e6271[_0x052f('0x1a')]===_0x052f('0x19');var _0x5532d1=_0x2ad126[_0x052f('0x1b')];var _0x2662c0=_0x5c7b5d?0x0:_0x1e6271['offset'];var _0x117d7e=_0x5c7b5d?_0x2ad126[_0x052f('0x1b')]:_0x1e6271['offset']+_0x1e6271[_0x052f('0x1a')];var _0x13482a;if(_0x117d7e>=_0x5532d1){_0x117d7e=_0x5532d1;_0x13482a=0xc8;}else{_0x13482a=0xce;}_0x594b87[_0x052f('0x16')](_0x13482a);return _0x594b87['set'](_0x052f('0x1c'),_0x2662c0+'-'+_0x117d7e+'/'+_0x5532d1)[_0x052f('0x1d')](_0x2ad126);}return null;};}function patchUpdates(_0x3f9b46){return function(_0x487de0){try{jsonpatch[_0x052f('0x1e')](_0x487de0,_0x3f9b46,!![]);}catch(_0x5c1cce){return BPromise[_0x052f('0x1f')](_0x5c1cce);}return _0x487de0[_0x052f('0x20')]();};}function saveUpdates(_0x4dba21,_0x1a861c){return function(_0x1ed2f7){if(_0x1ed2f7){return _0x1ed2f7[_0x052f('0x21')](_0x4dba21)[_0x052f('0x22')](function(_0x120f7e){return _0x120f7e;});}return null;};}function removeEntity(_0x368efd,_0x33ce19){return function(_0x19cddd){if(_0x19cddd){return _0x19cddd[_0x052f('0x23')]()['then'](function(){_0x368efd[_0x052f('0x16')](0xcc)[_0x052f('0x17')]();});}};}function handleEntityNotFound(_0x12bf3f,_0x22de21){return function(_0x2b230b){if(!_0x2b230b){_0x12bf3f[_0x052f('0x24')](0x194);}return _0x2b230b;};}function handleError(_0x3cfc0c,_0x6dc5a4){_0x6dc5a4=_0x6dc5a4||0x1f4;return function(_0x3e5cec){logger[_0x052f('0x25')](_0x3e5cec[_0x052f('0x26')]);if(_0x3e5cec[_0x052f('0x27')]){delete _0x3e5cec[_0x052f('0x27')];}_0x3cfc0c['status'](_0x6dc5a4)[_0x052f('0x28')](_0x3e5cec);};}exports[_0x052f('0x29')]=function(_0x43d5ce,_0x5951a4){var _0x308796={},_0x361bf8={},_0xe65f5a={'count':0x0,'rows':[]};var _0x580462=_['map'](db['CmHopperHistory'][_0x052f('0x2a')],function(_0xbd233c){return{'name':_0xbd233c[_0x052f('0x2b')],'type':_0xbd233c[_0x052f('0x2c')]['key']};});_0x361bf8['model']=_[_0x052f('0x2d')](_0x580462,_0x052f('0x27'));_0x361bf8['query']=_[_0x052f('0x2e')](_0x43d5ce['query']);_0x361bf8[_0x052f('0x2f')]=_[_0x052f('0x30')](_0x361bf8['model'],_0x361bf8[_0x052f('0x31')]);_0x308796['attributes']=_['intersection'](_0x361bf8[_0x052f('0x32')],qs[_0x052f('0x33')](_0x43d5ce[_0x052f('0x31')][_0x052f('0x33')]));_0x308796[_0x052f('0x34')]=_0x308796[_0x052f('0x34')][_0x052f('0x35')]?_0x308796['attributes']:_0x361bf8[_0x052f('0x32')];if(!_0x43d5ce[_0x052f('0x31')][_0x052f('0x36')](_0x052f('0x37'))){_0x308796['limit']=qs['limit'](_0x43d5ce[_0x052f('0x31')][_0x052f('0x1a')]);_0x308796['offset']=qs[_0x052f('0x18')](_0x43d5ce[_0x052f('0x31')][_0x052f('0x18')]);}_0x308796[_0x052f('0x38')]=qs[_0x052f('0x39')](_0x43d5ce[_0x052f('0x31')][_0x052f('0x39')]);_0x308796[_0x052f('0x3a')]=qs[_0x052f('0x2f')](_[_0x052f('0x3b')](_0x43d5ce[_0x052f('0x31')],_0x361bf8['filters']),_0x580462);if(_0x43d5ce[_0x052f('0x31')][_0x052f('0x3c')]){_0x308796['where']=_[_0x052f('0x3d')](_0x308796[_0x052f('0x3a')],{'$or':_[_0x052f('0x2d')](_0x580462,function(_0x41afd6){if(_0x41afd6[_0x052f('0x2c')]!==_0x052f('0x3e')){var _0x672908={};_0x672908[_0x41afd6[_0x052f('0x27')]]={'$like':'%'+_0x43d5ce[_0x052f('0x31')]['filter']+'%'};return _0x672908;}})});}_0x308796=_[_0x052f('0x3d')]({},_0x308796,_0x43d5ce[_0x052f('0x3f')]);var _0x32a56f={'where':_0x308796[_0x052f('0x3a')]};return db[_0x052f('0x40')][_0x052f('0x1b')](_0x32a56f)[_0x052f('0x22')](function(_0x3ba307){_0xe65f5a[_0x052f('0x1b')]=_0x3ba307;if(_0x43d5ce['query'][_0x052f('0x41')]){_0x308796[_0x052f('0x42')]=[{'all':!![]}];}return db[_0x052f('0x40')][_0x052f('0x43')](_0x308796);})[_0x052f('0x22')](function(_0x58215b){_0xe65f5a[_0x052f('0x44')]=_0x58215b;return _0xe65f5a;})[_0x052f('0x22')](respondWithFilteredResult(_0x5951a4,_0x308796))[_0x052f('0x45')](handleError(_0x5951a4,null));};exports[_0x052f('0x46')]=function(_0x55aedc,_0x7bf271){var _0x503259={'raw':!![],'where':{'id':_0x55aedc[_0x052f('0x47')]['id']}},_0xc1425c={};_0xc1425c[_0x052f('0x32')]=_[_0x052f('0x2e')](db[_0x052f('0x40')][_0x052f('0x2a')]);_0xc1425c[_0x052f('0x31')]=_[_0x052f('0x2e')](_0x55aedc[_0x052f('0x31')]);_0xc1425c[_0x052f('0x2f')]=_['intersection'](_0xc1425c['model'],_0xc1425c[_0x052f('0x31')]);_0x503259[_0x052f('0x34')]=_[_0x052f('0x30')](_0xc1425c[_0x052f('0x32')],qs[_0x052f('0x33')](_0x55aedc[_0x052f('0x31')][_0x052f('0x33')]));_0x503259[_0x052f('0x34')]=_0x503259[_0x052f('0x34')][_0x052f('0x35')]?_0x503259['attributes']:_0xc1425c[_0x052f('0x32')];if(_0x55aedc[_0x052f('0x31')][_0x052f('0x41')]){_0x503259[_0x052f('0x42')]=[{'all':!![]}];}_0x503259=_['merge']({},_0x503259,_0x55aedc['options']);return db['CmHopperHistory'][_0x052f('0x48')](_0x503259)[_0x052f('0x22')](handleEntityNotFound(_0x7bf271,null))[_0x052f('0x22')](respondWithResult(_0x7bf271,null))[_0x052f('0x45')](handleError(_0x7bf271,null));};exports['create']=function(_0x2f0b76,_0x538466){return db[_0x052f('0x40')][_0x052f('0x49')](_0x2f0b76[_0x052f('0x4a')],{})[_0x052f('0x22')](respondWithResult(_0x538466,0xc9))[_0x052f('0x45')](handleError(_0x538466,null));};exports[_0x052f('0x4b')]=function(_0x4fec81,_0x357980){return db[_0x052f('0x40')][_0x052f('0x4b')]()[_0x052f('0x22')](respondWithResult(_0x357980,null))[_0x052f('0x45')](handleError(_0x357980,null));};exports[_0x052f('0x21')]=function(_0x54c84f,_0xc7e742){if(_0x54c84f[_0x052f('0x4a')][_0x052f('0x4c')]){delete _0x54c84f[_0x052f('0x4a')][_0x052f('0x4c')];}return db[_0x052f('0x40')][_0x052f('0x48')]({'where':{'uniqueid':_0x54c84f[_0x052f('0x47')]['id']}})[_0x052f('0x22')](handleEntityNotFound(_0xc7e742,null))[_0x052f('0x22')](saveUpdates(_0x54c84f[_0x052f('0x4a')],null))[_0x052f('0x22')](respondWithResult(_0xc7e742,null))[_0x052f('0x45')](handleError(_0xc7e742,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 626407c..673348f 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 _0x80c4=['api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x80c4,0xa3));var _0x480c=function(_0x53ea0f,_0x528e9d){_0x53ea0f=_0x53ea0f-0x0;var _0x517f72=_0x80c4[_0x53ea0f];return _0x517f72;};'use strict';var _=require(_0x480c('0x0'));var util=require('util');var logger=require(_0x480c('0x1'))(_0x480c('0x2'));var moment=require(_0x480c('0x3'));var BPromise=require(_0x480c('0x4'));var rp=require(_0x480c('0x5'));var fs=require('fs');var path=require(_0x480c('0x6'));var rimraf=require('rimraf');var config=require(_0x480c('0x7'));var attributes=require(_0x480c('0x8'));module[_0x480c('0x9')]=function(_0x1813b6,_0x9805b5){return _0x1813b6[_0x480c('0xa')](_0x480c('0xb'),attributes,{'tableName':_0x480c('0xc'),'paranoid':![],'indexes':[{'name':_0x480c('0xd'),'fields':['endtime']},{'name':_0x480c('0xe'),'fields':[_0x480c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c99=['path','../../config/environment','./cmHopperHistory.attributes','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','request-promise'];(function(_0x446120,_0x5d59e6){var _0x320448=function(_0x2cb76e){while(--_0x2cb76e){_0x446120['push'](_0x446120['shift']());}};_0x320448(++_0x5d59e6);}(_0x4c99,0x1ec));var _0x94c9=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x4c99[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var logger=require(_0x94c9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x94c9('0x2'));var fs=require('fs');var path=require(_0x94c9('0x3'));var rimraf=require('rimraf');var config=require(_0x94c9('0x4'));var attributes=require(_0x94c9('0x5'));module['exports']=function(_0x42d25e,_0x4e4ffd){return _0x42d25e['define']('CmHopperHistory',attributes,{'tableName':_0x94c9('0x6'),'paranoid':![],'indexes':[{'name':_0x94c9('0x7'),'fields':[_0x94c9('0x7')]},{'name':_0x94c9('0x8'),'fields':[_0x94c9('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index c9e6ac6..c27f90c 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 _0x0962=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','error','message','result','CmHopperHistory','create','body','options','CreateCmHopperHistory','stringify','catch','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','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','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x122b32,_0x3605b4){var _0x8a093f=function(_0x4cd7d1){while(--_0x4cd7d1){_0x122b32['push'](_0x122b32['shift']());}};_0x8a093f(++_0x3605b4);}(_0x0962,0x116));var _0x2096=function(_0x2bd457,_0x46bbaa){_0x2bd457=_0x2bd457-0x0;var _0x1cb1f1=_0x0962[_0x2bd457];return _0x1cb1f1;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var moment=require(_0x2096('0x2'));var BPromise=require(_0x2096('0x3'));var rs=require(_0x2096('0x4'));var fs=require('fs');var Redis=require(_0x2096('0x5'));var db=require(_0x2096('0x6'))['db'];var utils=require(_0x2096('0x7'));var logger=require('../../config/logger')(_0x2096('0x8'));var config=require(_0x2096('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2096('0xa')][_0x2096('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a4579,_0x52e9e9,_0x52d828){return new BPromise(function(_0x1c37b5,_0x4c21c6){return client[_0x2096('0xc')](_0x2a4579,_0x52d828)[_0x2096('0xd')](function(_0x50d65a){logger[_0x2096('0xe')](_0x2096('0xf'),_0x52e9e9,_0x2096('0x10'));logger[_0x2096('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x52e9e9,_0x2096('0x10'),JSON['stringify'](_0x50d65a));if(_0x50d65a[_0x2096('0x12')]){if(_0x50d65a['error']['code']===0x1f4){logger['error'](_0x2096('0xf'),_0x52e9e9,_0x50d65a['error'][_0x2096('0x13')]);return _0x4c21c6(_0x50d65a[_0x2096('0x12')][_0x2096('0x13')]);}logger[_0x2096('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x52e9e9,_0x50d65a['error'][_0x2096('0x13')]);return _0x1c37b5(_0x50d65a[_0x2096('0x12')][_0x2096('0x13')]);}else{logger[_0x2096('0xe')](_0x2096('0xf'),_0x52e9e9,_0x2096('0x10'));_0x1c37b5(_0x50d65a[_0x2096('0x14')][_0x2096('0x13')]);}})['catch'](function(_0x484544){logger['error'](_0x2096('0xf'),_0x52e9e9,_0x484544);_0x4c21c6(_0x484544);});});}exports['CreateCmHopperHistory']=function(_0x557419){var _0x49648b=this;return new Promise(function(_0x402e56,_0xa76d79){return db[_0x2096('0x15')][_0x2096('0x16')](_0x557419[_0x2096('0x17')],{'raw':_0x557419[_0x2096('0x18')]?_0x557419['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x584f49){logger[_0x2096('0xe')](_0x2096('0x19'),_0x557419);logger[_0x2096('0x11')]('CreateCmHopperHistory',_0x557419,JSON[_0x2096('0x1a')](_0x584f49));_0x402e56(_0x584f49);})[_0x2096('0x1b')](function(_0x2be6f8){logger[_0x2096('0x12')]('CreateCmHopperHistory',_0x2be6f8[_0x2096('0x13')],_0x557419);_0xa76d79(_0x49648b['error'](0x1f4,_0x2be6f8['message']));});});};exports['AvgHandleTime']=function(_0x4bd5a2){var _0x335d37=this;return new Promise(function(_0x5b1b61,_0x398ca1){return db[_0x2096('0x15')]['findAll']({'raw':_0x4bd5a2[_0x2096('0x18')]?_0x4bd5a2[_0x2096('0x18')][_0x2096('0x1c')]===undefined?!![]:![]:!![],'where':_0x4bd5a2['options']?_0x4bd5a2['options'][_0x2096('0x1d')]||null:null,'attributes':[[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db['sequelize'][_0x2096('0x20')]('id')),_0x2096('0x21')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')](_0x2096('0x23')))),_0x2096('0x24')],[db[_0x2096('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x2096('0x22')](_0x2096('0x25')))),_0x2096('0x26')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x27'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x2096('0x28')],[db['sequelize']['fn'](_0x2096('0x27'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')]['literal'](_0x2096('0x29')))),_0x2096('0x2a')]]})[_0x2096('0xd')](function(_0x21708f){logger[_0x2096('0xe')](_0x2096('0x2b'),_0x4bd5a2);logger[_0x2096('0x11')](_0x2096('0x2b'),_0x4bd5a2,JSON[_0x2096('0x1a')](_0x21708f));_0x5b1b61(_0x21708f);})[_0x2096('0x1b')](function(_0x326f85){logger['error'](_0x2096('0x2b'),_0x326f85[_0x2096('0x13')],_0x4bd5a2);_0x398ca1(_0x335d37[_0x2096('0x12')](0x1f4,_0x326f85['message']));});});};exports[_0x2096('0x2c')]=function(_0xfbbcaf){var _0x43240c=this;return new Promise(function(_0x87f7ab,_0x53feef){return db[_0x2096('0x15')]['findAll']({'raw':_0xfbbcaf['options']?_0xfbbcaf[_0x2096('0x18')][_0x2096('0x1c')]===undefined?!![]:![]:!![],'where':_0xfbbcaf[_0x2096('0x18')]?_0xfbbcaf[_0x2096('0x18')]['where']||null:null,'attributes':[[_0x2096('0x2d'),_0x2096('0x2e')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db['sequelize']['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')]('`state`\x20=\x200,\x201,\x20null'))),_0x2096('0x2f')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')](_0x2096('0x30')))),_0x2096('0x31')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db['sequelize']['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')](_0x2096('0x32')))),_0x2096('0x33')],[db[_0x2096('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')](_0x2096('0x34')))),_0x2096('0x35')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db['sequelize']['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')](_0x2096('0x36')))),_0x2096('0x37')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')](_0x2096('0x38')))),_0x2096('0x39')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')]['literal'](_0x2096('0x3a')))),'outboundDropCallsDayCallersExit'],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),_0x2096('0x3b')],[db[_0x2096('0x1e')]['fn']('COUNT',db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x2096('0x3c')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')](_0x2096('0x3d')))),_0x2096('0x3e')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')]['literal'](_0x2096('0x3f')))),'outboundRejectCallsDay'],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db['sequelize'][_0x2096('0x22')](_0x2096('0x40')))),_0x2096('0x41')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')]['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db['sequelize']['fn']('IF',db[_0x2096('0x1e')]['literal'](_0x2096('0x42')))),_0x2096('0x43')]],'group':[_0x2096('0x2d')]})[_0x2096('0xd')](function(_0x691937){logger['info']('GetVoiceQueueHopperHistory',_0xfbbcaf);logger[_0x2096('0x11')](_0x2096('0x2c'),_0xfbbcaf,JSON[_0x2096('0x1a')](_0x691937));_0x87f7ab(_0x691937);})[_0x2096('0x1b')](function(_0x292179){logger[_0x2096('0x12')](_0x2096('0x2c'),_0x292179[_0x2096('0x13')],_0xfbbcaf);_0x53feef(_0x43240c[_0x2096('0x12')](0x1f4,_0x292179[_0x2096('0x13')]));});});};exports[_0x2096('0x44')]=function(_0x2a9ca2){var _0x4258da=this;return new Promise(function(_0x562a28,_0x193889){return db[_0x2096('0x15')]['findAll']({'raw':_0x2a9ca2['options']?_0x2a9ca2[_0x2096('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2a9ca2[_0x2096('0x18')]?_0x2a9ca2[_0x2096('0x18')][_0x2096('0x1d')]||null:null,'attributes':[[_0x2096('0x2d'),_0x2096('0x2e')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db[_0x2096('0x1e')][_0x2096('0x20')]('id')),_0x2096('0x45')],[db[_0x2096('0x1e')]['fn'](_0x2096('0x1f'),db['sequelize']['fn']('IF',db[_0x2096('0x1e')][_0x2096('0x22')](_0x2096('0x32')))),_0x2096('0x46')]],'group':['campaign']})[_0x2096('0xd')](function(_0x17576c){logger['info'](_0x2096('0x44'),_0x2a9ca2);logger[_0x2096('0x11')](_0x2096('0x44'),_0x2a9ca2,JSON[_0x2096('0x1a')](_0x17576c));_0x562a28(_0x17576c);})[_0x2096('0x1b')](function(_0x55fafd){logger[_0x2096('0x12')](_0x2096('0x44'),_0x55fafd['message'],_0x2a9ca2);_0x193889(_0x4258da[_0x2096('0x12')](0x1f4,_0x55fafd['message']));});});}; \ No newline at end of file +var _0x4156=['`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','CreateCmHopperHistory','CmHopperHistory','options','raw','debug','catch','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalAnsweredCalls','literal','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG'];(function(_0x137d65,_0x56381f){var _0x4939b6=function(_0x10ebbe){while(--_0x10ebbe){_0x137d65['push'](_0x137d65['shift']());}};_0x4939b6(++_0x56381f);}(_0x4156,0xf1));var _0x6415=function(_0x36b903,_0x24e2a2){_0x36b903=_0x36b903-0x0;var _0x2782bd=_0x4156[_0x36b903];return _0x2782bd;};'use strict';var _=require(_0x6415('0x0'));var util=require(_0x6415('0x1'));var moment=require(_0x6415('0x2'));var BPromise=require(_0x6415('0x3'));var rs=require(_0x6415('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6415('0x5'))['db'];var utils=require(_0x6415('0x6'));var logger=require(_0x6415('0x7'))(_0x6415('0x8'));var config=require(_0x6415('0x9'));var jayson=require(_0x6415('0xa'));var client=jayson[_0x6415('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24cb0,_0x47ec13,_0x4045ec){return new BPromise(function(_0x266237,_0x5bc51b){return client[_0x6415('0xc')](_0x24cb0,_0x4045ec)[_0x6415('0xd')](function(_0x3383d2){logger[_0x6415('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'),JSON[_0x6415('0x10')](_0x3383d2));if(_0x3383d2[_0x6415('0x11')]){if(_0x3383d2[_0x6415('0x11')][_0x6415('0x12')]===0x1f4){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2['error']['message']);return _0x5bc51b(_0x3383d2[_0x6415('0x11')][_0x6415('0x14')]);}logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2[_0x6415('0x11')]['message']);return _0x266237(_0x3383d2['error'][_0x6415('0x14')]);}else{logger[_0x6415('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));_0x266237(_0x3383d2[_0x6415('0x15')]['message']);}})['catch'](function(_0x352a04){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x352a04);_0x5bc51b(_0x352a04);});});}exports[_0x6415('0x16')]=function(_0x2ef73b){var _0xa3d00a=this;return new Promise(function(_0x2c74c6,_0x468dc2){return db[_0x6415('0x17')]['create'](_0x2ef73b['body'],{'raw':_0x2ef73b['options']?_0x2ef73b[_0x6415('0x18')][_0x6415('0x19')]===undefined?!![]:![]:!![]})[_0x6415('0xd')](function(_0x1e58f2){logger['info'](_0x6415('0x16'),_0x2ef73b);logger[_0x6415('0x1a')](_0x6415('0x16'),_0x2ef73b,JSON['stringify'](_0x1e58f2));_0x2c74c6(_0x1e58f2);})[_0x6415('0x1b')](function(_0x266f97){logger[_0x6415('0x11')](_0x6415('0x16'),_0x266f97[_0x6415('0x14')],_0x2ef73b);_0x468dc2(_0xa3d00a[_0x6415('0x11')](0x1f4,_0x266f97[_0x6415('0x14')]));});});};exports[_0x6415('0x1c')]=function(_0x1496c1){var _0x54259f=this;return new Promise(function(_0x177b6a,_0xa1f297){return db['CmHopperHistory'][_0x6415('0x1d')]({'raw':_0x1496c1[_0x6415('0x18')]?_0x1496c1[_0x6415('0x18')][_0x6415('0x19')]===undefined?!![]:![]:!![],'where':_0x1496c1[_0x6415('0x18')]?_0x1496c1['options'][_0x6415('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x6415('0x1f'),db[_0x6415('0x20')][_0x6415('0x21')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x6415('0x22')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),_0x6415('0x24')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db[_0x6415('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x6415('0x25')],[db['sequelize']['fn'](_0x6415('0x26'),db['sequelize']['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x27')))),_0x6415('0x28')],[db['sequelize']['fn']('AVG',db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x29')))),_0x6415('0x2a')]]})[_0x6415('0xd')](function(_0x551dda){logger[_0x6415('0xe')]('AvgHandleTime',_0x1496c1);logger['debug']('AvgHandleTime',_0x1496c1,JSON['stringify'](_0x551dda));_0x177b6a(_0x551dda);})[_0x6415('0x1b')](function(_0x1444d0){logger[_0x6415('0x11')]('AvgHandleTime',_0x1444d0[_0x6415('0x14')],_0x1496c1);_0xa1f297(_0x54259f[_0x6415('0x11')](0x1f4,_0x1444d0['message']));});});};exports[_0x6415('0x2b')]=function(_0xa3a985){var _0x2e94a2=this;return new Promise(function(_0x122fd8,_0x248a5e){return db['CmHopperHistory'][_0x6415('0x1d')]({'raw':_0xa3a985['options']?_0xa3a985[_0x6415('0x18')][_0x6415('0x19')]===undefined?!![]:![]:!![],'where':_0xa3a985['options']?_0xa3a985[_0x6415('0x18')][_0x6415('0x1e')]||null:null,'attributes':[['campaign','name'],[db[_0x6415('0x20')]['fn']('COUNT',db[_0x6415('0x20')]['fn']('IF',db['sequelize'][_0x6415('0x23')](_0x6415('0x2c')))),'outboundNoSuchCallsDay'],[db[_0x6415('0x20')]['fn']('COUNT',db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x2d')))),_0x6415('0x2e')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x2f')))),_0x6415('0x30')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x31')))),_0x6415('0x32')],[db['sequelize']['fn'](_0x6415('0x1f'),db['sequelize']['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')]('`state`\x20=\x208,\x201,\x20null'))),_0x6415('0x33')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db[_0x6415('0x20')]['fn']('IF',db['sequelize']['literal'](_0x6415('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x6415('0x20')]['fn']('COUNT',db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x35')))),_0x6415('0x36')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db['sequelize']['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0x6415('0x37')],[db['sequelize']['fn'](_0x6415('0x1f'),db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x38')))),'outboundBlacklistCallsDay'],[db[_0x6415('0x20')]['fn']('COUNT',db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0x6415('0x20')]['fn']('COUNT',db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')]['literal'](_0x6415('0x3a')))),_0x6415('0x3b')],[db[_0x6415('0x20')]['fn']('COUNT',db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x3c')))),_0x6415('0x3d')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db[_0x6415('0x20')]['fn']('IF',db['sequelize'][_0x6415('0x23')](_0x6415('0x3e')))),_0x6415('0x3b')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db['sequelize']['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x3f')))),_0x6415('0x40')]],'group':[_0x6415('0x41')]})[_0x6415('0xd')](function(_0xdeda6a){logger[_0x6415('0xe')](_0x6415('0x2b'),_0xa3a985);logger[_0x6415('0x1a')]('GetVoiceQueueHopperHistory',_0xa3a985,JSON[_0x6415('0x10')](_0xdeda6a));_0x122fd8(_0xdeda6a);})[_0x6415('0x1b')](function(_0x17ba20){logger[_0x6415('0x11')](_0x6415('0x2b'),_0x17ba20['message'],_0xa3a985);_0x248a5e(_0x2e94a2[_0x6415('0x11')](0x1f4,_0x17ba20[_0x6415('0x14')]));});});};exports[_0x6415('0x42')]=function(_0x561107){var _0x45ea7e=this;return new Promise(function(_0x2a4796,_0xa96b02){return db[_0x6415('0x17')][_0x6415('0x1d')]({'raw':_0x561107[_0x6415('0x18')]?_0x561107['options'][_0x6415('0x19')]===undefined?!![]:![]:!![],'where':_0x561107['options']?_0x561107[_0x6415('0x18')][_0x6415('0x1e')]||null:null,'attributes':[['campaign',_0x6415('0x43')],[db[_0x6415('0x20')]['fn'](_0x6415('0x1f'),db[_0x6415('0x20')][_0x6415('0x21')]('id')),_0x6415('0x44')],[db['sequelize']['fn'](_0x6415('0x1f'),db[_0x6415('0x20')]['fn']('IF',db[_0x6415('0x20')][_0x6415('0x23')](_0x6415('0x2f')))),_0x6415('0x45')]],'group':[_0x6415('0x41')]})[_0x6415('0xd')](function(_0x33e460){logger['info']('GetCampaignHopperHistory',_0x561107);logger[_0x6415('0x1a')](_0x6415('0x42'),_0x561107,JSON['stringify'](_0x33e460));_0x2a4796(_0x33e460);})[_0x6415('0x1b')](function(_0x18554e){logger[_0x6415('0x11')](_0x6415('0x42'),_0x18554e[_0x6415('0x14')],_0x561107);_0xa96b02(_0x45ea7e['error'](0x1f4,_0x18554e[_0x6415('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 07f5faa..2f29904 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 _0x0b66=['isAuthenticated','index','/describe','describe','get','/:id','show','post','create','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperHistory.controller'];(function(_0xc6d32b,_0x608367){var _0x5d773a=function(_0x2285cc){while(--_0x2285cc){_0xc6d32b['push'](_0xc6d32b['shift']());}};_0x5d773a(++_0x608367);}(_0x0b66,0x106));var _0x60b6=function(_0x5aeb4f,_0x38ded3){_0x5aeb4f=_0x5aeb4f-0x0;var _0x4ccd5a=_0x0b66[_0x5aeb4f];return _0x4ccd5a;};'use strict';var multer=require('multer');var util=require(_0x60b6('0x0'));var path=require(_0x60b6('0x1'));var timeout=require(_0x60b6('0x2'));var express=require(_0x60b6('0x3'));var router=express[_0x60b6('0x4')]();var fs_extra=require(_0x60b6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x60b6('0x6'));var config=require('../../config/environment');var controller=require(_0x60b6('0x7'));router['get']('/',auth[_0x60b6('0x8')](),controller[_0x60b6('0x9')]);router['get'](_0x60b6('0xa'),auth[_0x60b6('0x8')](),controller[_0x60b6('0xb')]);router[_0x60b6('0xc')](_0x60b6('0xd'),auth[_0x60b6('0x8')](),controller[_0x60b6('0xe')]);router[_0x60b6('0xf')]('/',auth[_0x60b6('0x8')](),controller[_0x60b6('0x10')]);router['put'](_0x60b6('0xd'),auth[_0x60b6('0x8')](),controller['update']);module[_0x60b6('0x11')]=router; \ No newline at end of file +var _0xbb69=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','isAuthenticated','index','describe','get','/:id','show','post','create','put','update','exports','util'];(function(_0x5a488c,_0x4cc470){var _0x53a7d6=function(_0x43a0d8){while(--_0x43a0d8){_0x5a488c['push'](_0x5a488c['shift']());}};_0x53a7d6(++_0x4cc470);}(_0xbb69,0xa1));var _0x9bb6=function(_0x3e204b,_0x687052){_0x3e204b=_0x3e204b-0x0;var _0x13d2fa=_0xbb69[_0x3e204b];return _0x13d2fa;};'use strict';var multer=require('multer');var util=require(_0x9bb6('0x0'));var path=require(_0x9bb6('0x1'));var timeout=require(_0x9bb6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9bb6('0x3'));var auth=require(_0x9bb6('0x4'));var interaction=require(_0x9bb6('0x5'));var config=require('../../config/environment');var controller=require(_0x9bb6('0x6'));router['get']('/',auth[_0x9bb6('0x7')](),controller[_0x9bb6('0x8')]);router['get']('/describe',auth[_0x9bb6('0x7')](),controller[_0x9bb6('0x9')]);router[_0x9bb6('0xa')](_0x9bb6('0xb'),auth[_0x9bb6('0x7')](),controller[_0x9bb6('0xc')]);router[_0x9bb6('0xd')]('/',auth[_0x9bb6('0x7')](),controller[_0x9bb6('0xe')]);router[_0x9bb6('0xf')](_0x9bb6('0xb'),auth['isAuthenticated'](),controller[_0x9bb6('0x10')]);module[_0x9bb6('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index c7bb230..c8f0400 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 _0x0a9a=['exports','name','STRING'];(function(_0x152e49,_0x5d1fec){var _0x5e0e0b=function(_0xaa4ab7){while(--_0xaa4ab7){_0x152e49['push'](_0x152e49['shift']());}};_0x5e0e0b(++_0x5d1fec);}(_0x0a9a,0x183));var _0xa0a9=function(_0x51197e,_0x59409f){_0x51197e=_0x51197e-0x0;var _0x433ccf=_0x0a9a[_0x51197e];return _0x433ccf;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa0a9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa0a9('0x2')]},'dialPrefix':{'type':Sequelize[_0xa0a9('0x2')]}}; \ No newline at end of file +var _0x9879=['exports','STRING','sequelize'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x9879,0x98));var _0x9987=function(_0x5eb92e,_0x198ea4){_0x5eb92e=_0x5eb92e-0x0;var _0xdeb599=_0x9879[_0x5eb92e];return _0xdeb599;};'use strict';var Sequelize=require(_0x9987('0x0'));module[_0x9987('0x1')]={'name':{'type':Sequelize[_0x9987('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9987('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d5af38f..0835adf 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 _0x5ff4=['Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','getDispositions','Disposition','rows','removeDispositions','ids','CmContact','isArray','tags','join','ListId','push','each','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','format','cf_%d','nolimit','raw','getContactsCsv','ContactItemType','OrderBy','alias','from','distinct','customField_','select','field','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','CmCustomField','findAndCountAll','getGlobalCustomFields','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x5ff4,0x125));var _0x45ff=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x5ff4[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0x45ff('0x0'));var rimraf=require(_0x45ff('0x1'));var zipdir=require(_0x45ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x45ff('0x3'));var moment=require(_0x45ff('0x4'));var BPromise=require(_0x45ff('0x5'));var Mustache=require(_0x45ff('0x6'));var util=require(_0x45ff('0x7'));var path=require(_0x45ff('0x8'));var sox=require(_0x45ff('0x9'));var csv=require(_0x45ff('0xa'));var ejs=require(_0x45ff('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45ff('0xc'));var squel=require(_0x45ff('0xd'));var crypto=require(_0x45ff('0xe'));var jsforce=require(_0x45ff('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x45ff('0xa'));var querystring=require('querystring');var Papa=require(_0x45ff('0x10'));var Redis=require('ioredis');var authService=require(_0x45ff('0x11'));var qs=require(_0x45ff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45ff('0x13'));var logger=require('../../config/logger')(_0x45ff('0x14'));var utils=require(_0x45ff('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x45ff('0x16'));var db=require(_0x45ff('0x17'))['db'];var csv_results;config[_0x45ff('0x18')]=_[_0x45ff('0x19')](config[_0x45ff('0x18')],{'host':_0x45ff('0x1a'),'port':0x18eb});var socket=require(_0x45ff('0x1b'))(new Redis(config[_0x45ff('0x18')]));require(_0x45ff('0x1c'))[_0x45ff('0x1d')](socket);function respondWithStatusCode(_0x48757c,_0x33a4dc){_0x33a4dc=_0x33a4dc||0xcc;return function(_0xf555ed){if(_0xf555ed){return _0x48757c[_0x45ff('0x1e')](_0x33a4dc);}return _0x48757c[_0x45ff('0x1f')](_0x33a4dc)[_0x45ff('0x20')]();};}function respondWithResult(_0x26f390,_0x2188dd){_0x2188dd=_0x2188dd||0xc8;return function(_0x4e2964){if(_0x4e2964){return _0x26f390[_0x45ff('0x1f')](_0x2188dd)[_0x45ff('0x21')](_0x4e2964);}};}function respondWithFilteredResult(_0x623144,_0x1ecbee){return function(_0x4bfcac){if(_0x4bfcac){var _0x3e43ec=typeof _0x1ecbee[_0x45ff('0x22')]==='undefined'&&typeof _0x1ecbee[_0x45ff('0x23')]===_0x45ff('0x24');var _0x3e3775=_0x4bfcac[_0x45ff('0x25')];var _0x35b4a0=_0x3e43ec?0x0:_0x1ecbee[_0x45ff('0x22')];var _0x19a488=_0x3e43ec?_0x4bfcac[_0x45ff('0x25')]:_0x1ecbee['offset']+_0x1ecbee[_0x45ff('0x23')];var _0x27d8d0;if(_0x19a488>=_0x3e3775){_0x19a488=_0x3e3775;_0x27d8d0=0xc8;}else{_0x27d8d0=0xce;}_0x623144[_0x45ff('0x1f')](_0x27d8d0);return _0x623144[_0x45ff('0x26')](_0x45ff('0x27'),_0x35b4a0+'-'+_0x19a488+'/'+_0x3e3775)[_0x45ff('0x21')](_0x4bfcac);}return null;};}function patchUpdates(_0x1c49d5){return function(_0x4555fc){try{jsonpatch[_0x45ff('0x28')](_0x4555fc,_0x1c49d5,!![]);}catch(_0x1b3dbc){return BPromise[_0x45ff('0x29')](_0x1b3dbc);}return _0x4555fc[_0x45ff('0x2a')]();};}function saveUpdates(_0x2dc274,_0x3ff8e7){return function(_0x101c5f){if(_0x101c5f){return _0x101c5f['update'](_0x2dc274)[_0x45ff('0x2b')](function(_0x190805){return _0x190805;});}return null;};}function removeEntity(_0x16f93e,_0x2b39f4){return function(_0x4c8773){if(_0x4c8773){return _0x4c8773['destroy']()['then'](function(){var _0x3eeb2e=_0x4c8773[_0x45ff('0x2c')]({'plain':!![]});var _0x344e6e='Lists';return db[_0x45ff('0x2d')][_0x45ff('0x2e')]({'where':{'type':_0x344e6e,'resourceId':_0x3eeb2e['id']}})[_0x45ff('0x2b')](function(){return _0x4c8773;});})['then'](function(){_0x16f93e[_0x45ff('0x1f')](0xcc)[_0x45ff('0x20')]();});}};}function handleEntityNotFound(_0x6d4ecf,_0x408c16){return function(_0x2343c6){if(!_0x2343c6){_0x6d4ecf[_0x45ff('0x1e')](0x194);}return _0x2343c6;};}function handleError(_0x52b1aa,_0x47b97a){_0x47b97a=_0x47b97a||0x1f4;return function(_0x55b0d5){logger['error'](_0x55b0d5['stack']);if(_0x55b0d5['name']){delete _0x55b0d5[_0x45ff('0x2f')];}_0x52b1aa[_0x45ff('0x1f')](_0x47b97a)[_0x45ff('0x30')](_0x55b0d5);};}exports[_0x45ff('0x31')]=function(_0x2ea40b,_0x34f425){var _0x1029c2={},_0x41b655={},_0x19292d={'count':0x0,'rows':[]};var _0x4d9ed7=_[_0x45ff('0x32')](db[_0x45ff('0x33')][_0x45ff('0x34')],function(_0x366d0d){return{'name':_0x366d0d[_0x45ff('0x35')],'type':_0x366d0d[_0x45ff('0x36')][_0x45ff('0x37')]};});_0x41b655[_0x45ff('0x38')]=_[_0x45ff('0x32')](_0x4d9ed7,_0x45ff('0x2f'));_0x41b655['query']=_[_0x45ff('0x39')](_0x2ea40b[_0x45ff('0x3a')]);_0x41b655[_0x45ff('0x3b')]=_['intersection'](_0x41b655['model'],_0x41b655[_0x45ff('0x3a')]);_0x1029c2[_0x45ff('0x3c')]=_[_0x45ff('0x3d')](_0x41b655[_0x45ff('0x38')],qs['fields'](_0x2ea40b['query'][_0x45ff('0x3e')]));_0x1029c2['attributes']=_0x1029c2[_0x45ff('0x3c')][_0x45ff('0x3f')]?_0x1029c2[_0x45ff('0x3c')]:_0x41b655[_0x45ff('0x38')];if(!_0x2ea40b[_0x45ff('0x3a')][_0x45ff('0x40')]('nolimit')){_0x1029c2[_0x45ff('0x23')]=qs[_0x45ff('0x23')](_0x2ea40b[_0x45ff('0x3a')][_0x45ff('0x23')]);_0x1029c2[_0x45ff('0x22')]=qs[_0x45ff('0x22')](_0x2ea40b[_0x45ff('0x3a')]['offset']);}_0x1029c2[_0x45ff('0x41')]=qs[_0x45ff('0x42')](_0x2ea40b['query'][_0x45ff('0x42')]);_0x1029c2['where']=qs[_0x45ff('0x3b')](_[_0x45ff('0x43')](_0x2ea40b[_0x45ff('0x3a')],_0x41b655[_0x45ff('0x3b')]),_0x4d9ed7);if(_0x2ea40b[_0x45ff('0x3a')][_0x45ff('0x44')]){_0x1029c2[_0x45ff('0x45')]=_[_0x45ff('0x46')](_0x1029c2[_0x45ff('0x45')],{'$or':_[_0x45ff('0x32')](_0x4d9ed7,function(_0x42f561){if(_0x42f561[_0x45ff('0x36')]!==_0x45ff('0x47')){var _0x2d98b0={};_0x2d98b0[_0x42f561[_0x45ff('0x2f')]]={'$like':'%'+_0x2ea40b['query'][_0x45ff('0x44')]+'%'};return _0x2d98b0;}})});}_0x1029c2=_[_0x45ff('0x46')]({},_0x1029c2,_0x2ea40b[_0x45ff('0x48')]);var _0xa2a6c7={'where':_0x1029c2[_0x45ff('0x45')]};return db['CmList'][_0x45ff('0x25')](_0xa2a6c7)[_0x45ff('0x2b')](function(_0x24dabd){_0x19292d[_0x45ff('0x25')]=_0x24dabd;if(_0x2ea40b[_0x45ff('0x3a')][_0x45ff('0x49')]){_0x1029c2[_0x45ff('0x4a')]=[{'all':!![]}];}return db[_0x45ff('0x33')][_0x45ff('0x4b')](_0x1029c2);})[_0x45ff('0x2b')](function(_0xdb3efd){_0x19292d['rows']=_0xdb3efd;return _0x19292d;})['then'](respondWithFilteredResult(_0x34f425,_0x1029c2))[_0x45ff('0x4c')](handleError(_0x34f425,null));};exports[_0x45ff('0x4d')]=function(_0x168623,_0x5c5ac9){var _0x13b821={'raw':![],'where':{'id':_0x168623[_0x45ff('0x4e')]['id']}},_0x12eb63={};_0x12eb63[_0x45ff('0x38')]=_['keys'](db[_0x45ff('0x33')]['rawAttributes']);_0x12eb63[_0x45ff('0x3a')]=_[_0x45ff('0x39')](_0x168623[_0x45ff('0x3a')]);_0x12eb63[_0x45ff('0x3b')]=_[_0x45ff('0x3d')](_0x12eb63[_0x45ff('0x38')],_0x12eb63[_0x45ff('0x3a')]);_0x13b821[_0x45ff('0x3c')]=_['intersection'](_0x12eb63[_0x45ff('0x38')],qs[_0x45ff('0x3e')](_0x168623[_0x45ff('0x3a')][_0x45ff('0x3e')]));_0x13b821['attributes']=_0x13b821[_0x45ff('0x3c')]['length']?_0x13b821['attributes']:_0x12eb63[_0x45ff('0x38')];if(_0x168623[_0x45ff('0x3a')][_0x45ff('0x49')]){_0x13b821['include']=[{'all':!![]}];}_0x13b821=_['merge']({},_0x13b821,_0x168623[_0x45ff('0x48')]);return db[_0x45ff('0x33')][_0x45ff('0x4f')](_0x13b821)[_0x45ff('0x2b')](handleEntityNotFound(_0x5c5ac9,null))['then'](respondWithResult(_0x5c5ac9,null))[_0x45ff('0x4c')](handleError(_0x5c5ac9,null));};exports[_0x45ff('0x50')]=function(_0x216463,_0x570a1a){return db['CmList'][_0x45ff('0x50')](_0x216463[_0x45ff('0x51')],{})['then'](function(_0x33615a){var _0x242521=_0x216463[_0x45ff('0x52')][_0x45ff('0x2c')]({'plain':!![]});if(!_0x242521)throw new Error(_0x45ff('0x53'));if(_0x242521[_0x45ff('0x54')]==='user'){var _0x349eed=_0x33615a['get']({'plain':!![]});var _0x2c12da=_0x45ff('0x55');return db[_0x45ff('0x56')][_0x45ff('0x4f')]({'where':{'name':_0x2c12da,'userProfileId':_0x242521[_0x45ff('0x57')]},'raw':!![]})[_0x45ff('0x2b')](function(_0x3008ba){if(_0x3008ba&&_0x3008ba[_0x45ff('0x58')]===0x0){return db[_0x45ff('0x2d')][_0x45ff('0x50')]({'name':_0x349eed[_0x45ff('0x2f')],'resourceId':_0x349eed['id'],'type':_0x3008ba['name'],'sectionId':_0x3008ba['id']},{})[_0x45ff('0x2b')](function(){return _0x33615a;});}else{return _0x33615a;}})[_0x45ff('0x4c')](function(_0x58eee4){logger[_0x45ff('0x59')](_0x45ff('0x5a'),_0x58eee4);throw _0x58eee4;});}return _0x33615a;})[_0x45ff('0x2b')](respondWithResult(_0x570a1a,0xc9))[_0x45ff('0x4c')](handleError(_0x570a1a,null));};exports[_0x45ff('0x5b')]=function(_0x2cfdd3,_0x2e086f){if(_0x2cfdd3[_0x45ff('0x51')]['id']){delete _0x2cfdd3[_0x45ff('0x51')]['id'];}return db[_0x45ff('0x33')][_0x45ff('0x4f')]({'where':{'id':_0x2cfdd3[_0x45ff('0x4e')]['id']}})[_0x45ff('0x2b')](handleEntityNotFound(_0x2e086f,null))[_0x45ff('0x2b')](saveUpdates(_0x2cfdd3[_0x45ff('0x51')],null))[_0x45ff('0x2b')](respondWithResult(_0x2e086f,null))[_0x45ff('0x4c')](handleError(_0x2e086f,null));};exports[_0x45ff('0x2e')]=function(_0x3714dd,_0x49cd48){return db[_0x45ff('0x33')][_0x45ff('0x4f')]({'where':{'id':_0x3714dd[_0x45ff('0x4e')]['id']}})[_0x45ff('0x2b')](handleEntityNotFound(_0x49cd48,null))[_0x45ff('0x2b')](removeEntity(_0x49cd48,null))[_0x45ff('0x4c')](handleError(_0x49cd48,null));};exports[_0x45ff('0x5c')]=function(_0x5299e2,_0x15c4e7){return db[_0x45ff('0x33')][_0x45ff('0x5c')]()['then'](respondWithResult(_0x15c4e7,null))[_0x45ff('0x4c')](handleError(_0x15c4e7,null));};exports[_0x45ff('0x5d')]=function(_0x249028,_0x154afc,_0xe02237){if(_0x249028[_0x45ff('0x51')]['id']){delete _0x249028[_0x45ff('0x51')]['id'];}return db[_0x45ff('0x33')][_0x45ff('0x4f')]({'where':{'id':_0x249028[_0x45ff('0x4e')]['id']}})[_0x45ff('0x2b')](handleEntityNotFound(_0x154afc,null))[_0x45ff('0x2b')](function(_0x48c8df){if(_0x48c8df){_0x249028[_0x45ff('0x51')]['ListId']=_0x48c8df['id'];return db['Disposition'][_0x45ff('0x50')](_0x249028[_0x45ff('0x51')]);}})[_0x45ff('0x2b')](respondWithResult(_0x154afc,null))['catch'](handleError(_0x154afc,null));};exports[_0x45ff('0x5e')]=function(_0x46022f,_0x439521,_0x1edf77){var _0x10c030={'raw':![],'where':{}};var _0x30650a={};var _0x3332e7={'count':0x0,'rows':[]};return db[_0x45ff('0x33')]['findOne']({'where':{'id':_0x46022f[_0x45ff('0x4e')]['id']}})[_0x45ff('0x2b')](handleEntityNotFound(_0x439521,null))[_0x45ff('0x2b')](function(_0x220d06){if(_0x220d06){_0x30650a['model']=_[_0x45ff('0x39')](db[_0x45ff('0x5f')]['rawAttributes']);_0x30650a[_0x45ff('0x3a')]=_[_0x45ff('0x39')](_0x46022f[_0x45ff('0x3a')]);_0x30650a[_0x45ff('0x3b')]=_[_0x45ff('0x3d')](_0x30650a[_0x45ff('0x38')],_0x30650a[_0x45ff('0x3a')]);_0x10c030[_0x45ff('0x3c')]=_[_0x45ff('0x3d')](_0x30650a['model'],qs[_0x45ff('0x3e')](_0x46022f['query'][_0x45ff('0x3e')]));_0x10c030['attributes']=_0x10c030[_0x45ff('0x3c')][_0x45ff('0x3f')]?_0x10c030[_0x45ff('0x3c')]:_0x30650a[_0x45ff('0x38')];if(!_0x46022f[_0x45ff('0x3a')][_0x45ff('0x40')]('nolimit')){_0x10c030['limit']=qs[_0x45ff('0x23')](_0x46022f[_0x45ff('0x3a')]['limit']);_0x10c030[_0x45ff('0x22')]=qs['offset'](_0x46022f[_0x45ff('0x3a')][_0x45ff('0x22')]);}_0x10c030[_0x45ff('0x41')]=qs[_0x45ff('0x42')](_0x46022f[_0x45ff('0x3a')][_0x45ff('0x42')]);_0x10c030[_0x45ff('0x45')]=qs[_0x45ff('0x3b')](_[_0x45ff('0x43')](_0x46022f[_0x45ff('0x3a')],_0x30650a[_0x45ff('0x3b')]));_0x10c030[_0x45ff('0x45')]['ListId']=_0x220d06['id'];if(_0x46022f[_0x45ff('0x3a')][_0x45ff('0x44')]){_0x10c030['where']=_[_0x45ff('0x46')](_0x10c030[_0x45ff('0x45')],{'$or':_[_0x45ff('0x32')](_0x10c030['attributes'],function(_0x7b7def){var _0x483899={};_0x483899[_0x7b7def]={'$like':'%'+_0x46022f[_0x45ff('0x3a')]['filter']+'%'};return _0x483899;})});}_0x10c030=_[_0x45ff('0x46')]({},_0x10c030,_0x46022f['options']);return db[_0x45ff('0x5f')]['count']({'where':_0x10c030[_0x45ff('0x45')]})[_0x45ff('0x2b')](function(_0x32df6f){_0x3332e7[_0x45ff('0x25')]=_0x32df6f;if(_0x46022f[_0x45ff('0x3a')][_0x45ff('0x49')]){_0x10c030[_0x45ff('0x4a')]=[{'all':!![]}];}return db[_0x45ff('0x5f')][_0x45ff('0x4b')](_0x10c030);})[_0x45ff('0x2b')](function(_0x42cbcc){_0x3332e7[_0x45ff('0x60')]=_0x42cbcc;return _0x3332e7;});}})[_0x45ff('0x2b')](respondWithFilteredResult(_0x439521,_0x10c030))['catch'](handleError(_0x439521,null));};exports[_0x45ff('0x61')]=function(_0x911caa,_0x4d7947,_0x1eb55f){return db[_0x45ff('0x33')][_0x45ff('0x4f')]({'where':{'id':_0x911caa['params']['id']}})[_0x45ff('0x2b')](handleEntityNotFound(_0x4d7947,null))['then'](function(_0x45f683){if(_0x45f683){return _0x45f683[_0x45ff('0x61')](_0x911caa[_0x45ff('0x3a')][_0x45ff('0x62')]);}})[_0x45ff('0x2b')](respondWithStatusCode(_0x4d7947,null))[_0x45ff('0x4c')](handleError(_0x4d7947,null));};exports['addContacts']=function(_0x14eec3,_0x54129c,_0x303977){return db[_0x45ff('0x33')][_0x45ff('0x4f')]({'where':{'id':_0x14eec3[_0x45ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x54129c,null))['then'](function(_0x4454ec){if(_0x4454ec){var _0x5866bc=[];var _0x5438a9={'success':[],'errors':[]};return db[_0x45ff('0x63')][_0x45ff('0x5c')]()[_0x45ff('0x2b')](function(_0xc357c){if(_0x14eec3[_0x45ff('0x51')]['tags']&&_[_0x45ff('0x64')](_0x14eec3[_0x45ff('0x51')][_0x45ff('0x65')])){if(_0x14eec3['body']['tags'][_0x45ff('0x3f')]){_0x14eec3[_0x45ff('0x51')][_0x45ff('0x65')]=_0x14eec3[_0x45ff('0x51')][_0x45ff('0x65')][_0x45ff('0x66')](';')+';';}else{_0x14eec3[_0x45ff('0x51')][_0x45ff('0x65')]=null;}}else{_0x14eec3[_0x45ff('0x51')][_0x45ff('0x65')]=null;}if(_0x14eec3[_0x45ff('0x51')]&&_['isArray'](_0x14eec3[_0x45ff('0x51')])){for(var _0x4eb27b=0x0;_0x4eb27b<_0x14eec3[_0x45ff('0x51')]['length'];_0x4eb27b+=0x1){_0x14eec3['body'][_0x4eb27b][_0x45ff('0x67')]=_0x14eec3['params']['id'];_0x5866bc[_0x45ff('0x68')](_0x14eec3[_0x45ff('0x51')][_0x4eb27b]);}return BPromise[_0x45ff('0x69')](_0x5866bc,function(_0x431fce){return db[_0x45ff('0x63')][_0x45ff('0x50')](_['omit'](_0x431fce,[_0x45ff('0x62'),'id'])||{},{'fields':_[_0x45ff('0x39')](_0xc357c),'raw':!![]})[_0x45ff('0x2b')](function(_0x3b8313){_0x5438a9[_0x45ff('0x6a')][_0x45ff('0x68')](_0x3b8313[_0x45ff('0x6b')]);})['catch'](function(_0x5d2281){_0x5438a9[_0x45ff('0x6c')]['push']({'data':_0x431fce,'error':_0x5d2281[_0x45ff('0x6d')]});});})[_0x45ff('0x2b')](function(_0x2ff16a){return _0x5438a9;})[_0x45ff('0x4c')](function(_0x233119){return _0x233119;});}else{_0x54129c[_0x45ff('0x1f')](0x190)['json']({'message':_0x45ff('0x6e')});}});}})['then'](respondWithResult(_0x54129c,null))['catch'](handleError(_0x54129c,null));};exports[_0x45ff('0x6f')]=function(_0x48dd4a,_0xaf7bec,_0x1f290a){var _0x47fa22;return db[_0x45ff('0x33')][_0x45ff('0x4f')]({'where':{'id':_0x48dd4a['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x45ff('0x70')}]})[_0x45ff('0x2b')](handleEntityNotFound(_0xaf7bec,null))['then'](function(_0x443f0d){if(_0x443f0d){_0x47fa22=_0x443f0d;return db[_0x45ff('0x63')][_0x45ff('0x34')];}})[_0x45ff('0x2b')](function(_0x28b165){if(_0x28b165){var _0x1c5422={};var _0x43fc55={};_0x43fc55[_0x45ff('0x38')]=_['concat'](_[_0x45ff('0x39')](_0x28b165),_[_0x45ff('0x32')](_0x47fa22['CustomFields'],function(_0x29d705){return util[_0x45ff('0x71')](_0x45ff('0x72'),_0x29d705['id']);}));_0x43fc55[_0x45ff('0x3a')]=_[_0x45ff('0x39')](_0x48dd4a[_0x45ff('0x3a')]);_0x43fc55['filters']=_[_0x45ff('0x3d')](_0x43fc55['model'],_0x43fc55[_0x45ff('0x3a')]);_0x1c5422[_0x45ff('0x3c')]=_[_0x45ff('0x3d')](_0x43fc55[_0x45ff('0x38')],qs[_0x45ff('0x3e')](_0x48dd4a[_0x45ff('0x3a')][_0x45ff('0x3e')]));_0x1c5422['attributes']=_0x1c5422[_0x45ff('0x3c')][_0x45ff('0x3f')]?_0x1c5422[_0x45ff('0x3c')]:_0x43fc55[_0x45ff('0x38')];if(!_0x48dd4a[_0x45ff('0x3a')]['hasOwnProperty'](_0x45ff('0x73'))){_0x1c5422[_0x45ff('0x23')]=qs[_0x45ff('0x23')](_0x48dd4a[_0x45ff('0x3a')][_0x45ff('0x23')]);_0x1c5422[_0x45ff('0x22')]=qs[_0x45ff('0x22')](_0x48dd4a[_0x45ff('0x3a')]['offset']);}_0x1c5422[_0x45ff('0x41')]=qs[_0x45ff('0x42')](_0x48dd4a[_0x45ff('0x3a')][_0x45ff('0x42')]);_0x1c5422[_0x45ff('0x45')]=qs[_0x45ff('0x3b')](_[_0x45ff('0x43')](_0x48dd4a[_0x45ff('0x3a')],_0x43fc55[_0x45ff('0x3b')]));_0x1c5422[_0x45ff('0x74')]=!![];if(_0x48dd4a[_0x45ff('0x3a')][_0x45ff('0x44')]){_0x1c5422[_0x45ff('0x45')]=_['merge'](_0x1c5422['where'],{'$or':_[_0x45ff('0x32')](_0x1c5422[_0x45ff('0x3c')],function(_0x52897e){var _0x3863a4={};_0x3863a4[_0x52897e]={'$like':'%'+_0x48dd4a[_0x45ff('0x3a')][_0x45ff('0x44')]+'%'};return _0x3863a4;})});}_0x1c5422=_[_0x45ff('0x46')]({},_0x1c5422,_0x48dd4a[_0x45ff('0x48')]);return _0x47fa22[_0x45ff('0x6f')](_0x1c5422);}})[_0x45ff('0x2b')](respondWithResult(_0xaf7bec,null))[_0x45ff('0x4c')](handleError(_0xaf7bec,null));};exports[_0x45ff('0x75')]=function(_0x1347c8,_0x28cc4c,_0x21e6bf){var _0x2619d4;var _0x3688c1;var _0x11a5af;var _0x13acde=_0x1347c8[_0x45ff('0x4e')]['id'];csv_results=[];return db[_0x45ff('0x76')]['findAll']({'attributes':['id',_0x45ff('0x2f')],'raw':!![],'order':[_0x45ff('0x77')]})[_0x45ff('0x2b')](function(_0x579b5f){_0x2619d4=_0x579b5f;var _0x17c8e6=_[_0x45ff('0x39')](db['CmContact']['rawAttributes']);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0x45ff('0x78')]})[_0x45ff('0x2b')](function(_0x478b6b){_0x3688c1=_0x478b6b;var _0x175748=squel['select']()[_0x45ff('0x3e')](_0x17c8e6)[_0x45ff('0x79')]('cm_contacts','c')[_0x45ff('0x45')]('c.ListId\x20=\x20?',_0x13acde)[_0x45ff('0x45')]('c.deletedAt\x20is\x20null')[_0x45ff('0x7a')]();for(var _0x445d48=0x0;_0x445d48<_0x3688c1[_0x45ff('0x3f')];_0x445d48++){_0x175748['field']('c.cf_'+_0x3688c1[_0x445d48]['id'],_0x45ff('0x7b')+_0x3688c1[_0x445d48]['alias']);}for(var _0x445d48=0x0;_0x445d48<_0x2619d4['length'];_0x445d48++){_0x175748['field'](squel[_0x45ff('0x7c')]()[_0x45ff('0x7d')]('item')[_0x45ff('0x79')](_0x45ff('0x7e'))[_0x45ff('0x45')](_0x45ff('0x7f'),_0x2619d4[_0x445d48]['id'])[_0x45ff('0x45')](_0x45ff('0x80')),_0x45ff('0x81')+_0x2619d4[_0x445d48]['name']);_0x175748[_0x45ff('0x7d')](squel['select']()[_0x45ff('0x7d')](_0x45ff('0x82'))['from'](_0x45ff('0x7e'))[_0x45ff('0x45')](_0x45ff('0x7f'),_0x2619d4[_0x445d48]['id'])[_0x45ff('0x45')](_0x45ff('0x80')),'description_additionalPhone_'+_0x2619d4[_0x445d48]['name']);}var _0x1b301b=[];_0x1b301b[_0x45ff('0x68')](_0x175748['toString']());BPromise[_0x45ff('0x69')](_0x1b301b,handleQuery)[_0x45ff('0x2b')](function(_0x3fdde9){handleQuery(_0x175748[_0x45ff('0x83')]());var _0x4048b3=csv_results[0x0];if(!_[_0x45ff('0x84')](_0x4048b3)){var _0x29cdab=toCsv(_0x4048b3);var _0x5d169f=Date['now']();fs[_0x45ff('0x85')](util['format'](_0x45ff('0x86'),_0x13acde,_0x5d169f),_0x29cdab);_0x28cc4c[_0x45ff('0x87')]('Content-disposition','attachment;\x20filename='+util['format'](_0x45ff('0x88'),_0x13acde,_0x5d169f));_0x28cc4c[_0x45ff('0x87')](_0x45ff('0x89'),_0x45ff('0x8a'));return _0x28cc4c['download'](util[_0x45ff('0x71')](_0x45ff('0x86'),_0x13acde,_0x5d169f));}else{return _0x28cc4c[_0x45ff('0x1e')](0xcc);}});});});};exports['addCustomField']=function(_0x3b6355,_0x49e04b,_0x2500db){var _0x27a8ff;delete _0x3b6355[_0x45ff('0x51')]['id'];return db[_0x45ff('0x33')][_0x45ff('0x8b')]({'where':{'id':_0x3b6355[_0x45ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x49e04b,null))[_0x45ff('0x2b')](function(_0x2b48e9){if(_0x2b48e9){return db[_0x45ff('0x8c')][_0x45ff('0x8d')](function(_0x49689c){return db['CmCustomField'][_0x45ff('0x50')](_0x3b6355[_0x45ff('0x51')],{'transaction':_0x49689c})[_0x45ff('0x2b')](function(_0x46113d){_0x27a8ff=_0x46113d;return _0x2b48e9[_0x45ff('0x8e')](_0x46113d,{'transaction':_0x49689c});})[_0x45ff('0x2b')](function(){var _0x5771e7={'type':db[_0x45ff('0x8f')][_0x45ff('0x90')],'transaction':_0x49689c};switch(_0x3b6355[_0x45ff('0x51')][_0x45ff('0x36')]){case _0x45ff('0x91'):_0x5771e7[_0x45ff('0x36')]=db[_0x45ff('0x8f')][_0x45ff('0x90')];break;case _0x45ff('0x92'):_0x5771e7[_0x45ff('0x36')]=db[_0x45ff('0x8f')][_0x45ff('0x93')];break;case _0x45ff('0x94'):_0x5771e7[_0x45ff('0x36')]=db[_0x45ff('0x8f')][_0x45ff('0x95')];_0x5771e7[_0x45ff('0x96')]=![];break;default:}return db[_0x45ff('0x8c')][_0x45ff('0x97')][_0x45ff('0x98')](_0x45ff('0x99'),util[_0x45ff('0x71')](_0x45ff('0x9a'),_0x27a8ff['id']),_0x5771e7);})[_0x45ff('0x2b')](function(){return _0x27a8ff;});});}})['then'](respondWithResult(_0x49e04b,null))['catch'](handleError(_0x49e04b,null));};exports['getCustomFields']=function(_0x382602,_0x512559,_0x45aee2){var _0x3e881c={};var _0xbdbde4={};var _0x234d78;var _0x5662be;return db[_0x45ff('0x33')][_0x45ff('0x8b')]({'where':{'id':_0x382602[_0x45ff('0x4e')]['id']}})[_0x45ff('0x2b')](handleEntityNotFound(_0x512559,null))[_0x45ff('0x2b')](function(_0x546674){if(_0x546674){_0x234d78=_0x546674;_0xbdbde4[_0x45ff('0x38')]=_['keys'](db[_0x45ff('0x9b')]['rawAttributes']);_0xbdbde4[_0x45ff('0x3a')]=_[_0x45ff('0x39')](_0x382602['query']);_0xbdbde4[_0x45ff('0x3b')]=_[_0x45ff('0x3d')](_0xbdbde4[_0x45ff('0x38')],_0xbdbde4['query']);_0x3e881c['attributes']=_[_0x45ff('0x3d')](_0xbdbde4[_0x45ff('0x38')],qs[_0x45ff('0x3e')](_0x382602[_0x45ff('0x3a')][_0x45ff('0x3e')]));_0x3e881c[_0x45ff('0x3c')]=_0x3e881c[_0x45ff('0x3c')][_0x45ff('0x3f')]?_0x3e881c[_0x45ff('0x3c')]:_0xbdbde4[_0x45ff('0x38')];_0x3e881c['order']=qs[_0x45ff('0x42')](_0x382602[_0x45ff('0x3a')][_0x45ff('0x42')]);_0x3e881c['where']=qs[_0x45ff('0x3b')](_[_0x45ff('0x43')](_0x382602[_0x45ff('0x3a')],_0xbdbde4['filters']));_0x3e881c[_0x45ff('0x45')]=_[_0x45ff('0x46')](_0x3e881c[_0x45ff('0x45')],{'$or':[{'ListId':_0x546674['id']},{'ListId':null}]});if(_0x382602['query'][_0x45ff('0x44')]){_0x3e881c[_0x45ff('0x45')]=_[_0x45ff('0x46')](_0x3e881c[_0x45ff('0x45')],{'$or':_[_0x45ff('0x32')](_0x3e881c[_0x45ff('0x3c')],function(_0x1d76b0){var _0x573b11={};_0x573b11[_0x1d76b0]={'$like':'%'+_0x382602[_0x45ff('0x3a')][_0x45ff('0x44')]+'%'};return _0x573b11;})});}_0x3e881c=_[_0x45ff('0x46')]({},_0x3e881c,_0x382602[_0x45ff('0x48')]);return db[_0x45ff('0x9b')][_0x45ff('0x9c')](_0x3e881c);}})['then'](respondWithResult(_0x512559,null))[_0x45ff('0x4c')](handleError(_0x512559,null));};exports[_0x45ff('0x9d')]=function(_0x1429cb,_0xf60ee3){return db['CmCustomField']['findAndCountAll']({'where':{'ListId':null}})[_0x45ff('0x2b')](handleEntityNotFound(_0xf60ee3,null))[_0x45ff('0x2b')](function(_0x396e78){return _0x396e78;})[_0x45ff('0x2b')](respondWithResult(_0xf60ee3,null))[_0x45ff('0x4c')](handleError(_0xf60ee3,null));};exports['addAgents']=function(_0x56928e,_0x397082,_0x5556bc){return db[_0x45ff('0x33')][_0x45ff('0x4f')]({'where':{'id':_0x56928e['params']['id']}})[_0x45ff('0x2b')](handleEntityNotFound(_0x397082,null))[_0x45ff('0x2b')](function(_0x52eb0a){if(_0x52eb0a){return _0x52eb0a['addAgents'](_0x56928e[_0x45ff('0x51')][_0x45ff('0x62')],_['omit'](_0x56928e[_0x45ff('0x51')],[_0x45ff('0x62'),'id'])||{})[_0x45ff('0x9e')](function(_0x34c090){for(var _0x20cecf=0x0;_0x20cecf<_0x56928e[_0x45ff('0x51')]['ids'][_0x45ff('0x3f')];_0x20cecf+=0x1){socket[_0x45ff('0x9f')](_0x45ff('0xa0'),{'UserId':Number(_0x56928e[_0x45ff('0x51')][_0x45ff('0x62')][_0x20cecf]),'CmListId':Number(_0x56928e[_0x45ff('0x4e')]['id'])});}return _0x34c090;});}})[_0x45ff('0x2b')](respondWithResult(_0x397082,null))[_0x45ff('0x4c')](handleError(_0x397082,null));};exports[_0x45ff('0xa1')]=function(_0x3a4ddc,_0x4ad3cf,_0x54faa9){return db[_0x45ff('0x33')][_0x45ff('0x4f')]({'where':{'id':_0x3a4ddc[_0x45ff('0x4e')]['id']}})[_0x45ff('0x2b')](handleEntityNotFound(_0x4ad3cf,null))[_0x45ff('0x2b')](function(_0x5eb10c){if(_0x5eb10c){return _0x5eb10c['removeAgents'](_0x3a4ddc['query'][_0x45ff('0x62')])['then'](function(){if(_[_0x45ff('0x64')](_0x3a4ddc[_0x45ff('0x3a')][_0x45ff('0x62')])){for(var _0x5cba89=0x0;_0x5cba89<_0x3a4ddc[_0x45ff('0x3a')]['ids'][_0x45ff('0x3f')];_0x5cba89+=0x1){socket[_0x45ff('0x9f')]('userCmList:remove',{'UserId':Number(_0x3a4ddc['query']['ids'][_0x5cba89]),'CmListId':Number(_0x3a4ddc[_0x45ff('0x4e')]['id'])});}}else{socket['emit'](_0x45ff('0xa2'),{'UserId':Number(_0x3a4ddc[_0x45ff('0x3a')][_0x45ff('0x62')]),'CmListId':Number(_0x3a4ddc[_0x45ff('0x4e')]['id'])});}});}})[_0x45ff('0x2b')](respondWithStatusCode(_0x4ad3cf,null))['catch'](handleError(_0x4ad3cf,null));};exports[_0x45ff('0xa3')]=function(_0x11009e,_0x41a8b8,_0x32b1af){var _0x7ffe13={};var _0x13a9da={};var _0xc2b4d7;var _0x583d8b;return db[_0x45ff('0x33')][_0x45ff('0x8b')]({'where':{'id':_0x11009e[_0x45ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x41a8b8,null))['then'](function(_0x2382f9){if(_0x2382f9){_0xc2b4d7=_0x2382f9;_0x13a9da['model']=_['keys'](db[_0x45ff('0xa4')]['rawAttributes']);_0x13a9da[_0x45ff('0x3a')]=_[_0x45ff('0x39')](_0x11009e[_0x45ff('0x3a')]);_0x13a9da[_0x45ff('0x3b')]=_[_0x45ff('0x3d')](_0x13a9da[_0x45ff('0x38')],_0x13a9da[_0x45ff('0x3a')]);_0x7ffe13[_0x45ff('0x3c')]=_[_0x45ff('0x3d')](_0x13a9da[_0x45ff('0x38')],qs[_0x45ff('0x3e')](_0x11009e['query'][_0x45ff('0x3e')]));_0x7ffe13[_0x45ff('0x3c')]=_0x7ffe13[_0x45ff('0x3c')]['length']?_0x7ffe13[_0x45ff('0x3c')]:_0x13a9da[_0x45ff('0x38')];_0x7ffe13[_0x45ff('0x41')]=qs[_0x45ff('0x42')](_0x11009e[_0x45ff('0x3a')][_0x45ff('0x42')]);_0x7ffe13[_0x45ff('0x45')]=qs['filters'](_[_0x45ff('0x43')](_0x11009e['query'],_0x13a9da['filters']));if(_0x11009e[_0x45ff('0x3a')][_0x45ff('0x44')]){_0x7ffe13['where']=_[_0x45ff('0x46')](_0x7ffe13[_0x45ff('0x45')],{'$or':_[_0x45ff('0x32')](_0x7ffe13[_0x45ff('0x3c')],function(_0x5c4cc8){var _0xa92379={};_0xa92379[_0x5c4cc8]={'$like':'%'+_0x11009e['query'][_0x45ff('0x44')]+'%'};return _0xa92379;})});}_0x7ffe13=_[_0x45ff('0x46')]({},_0x7ffe13,_0x11009e[_0x45ff('0x48')]);return _0xc2b4d7[_0x45ff('0xa3')](_0x7ffe13);}})[_0x45ff('0x2b')](function(_0x38c594){if(_0x38c594){_0x583d8b=_0x38c594[_0x45ff('0x3f')];if(!_0x11009e[_0x45ff('0x3a')][_0x45ff('0x40')]('nolimit')){_0x7ffe13[_0x45ff('0x23')]=qs[_0x45ff('0x23')](_0x11009e['query'][_0x45ff('0x23')]);_0x7ffe13['offset']=qs[_0x45ff('0x22')](_0x11009e[_0x45ff('0x3a')]['offset']);}return _0xc2b4d7['getAgents'](_0x7ffe13);}})[_0x45ff('0x2b')](function(_0x2e5b61){if(_0x2e5b61){return _0x2e5b61?{'count':_0x583d8b,'rows':_0x2e5b61}:null;}})[_0x45ff('0x2b')](respondWithResult(_0x41a8b8,null))['catch'](handleError(_0x41a8b8,null));};function handleQuery(_0x9ebf8){logger[_0x45ff('0xa5')](_0x9ebf8);return db[_0x45ff('0x8c')][_0x45ff('0x3a')](_0x9ebf8)[_0x45ff('0x9e')](function(_0x4a78db){csv_results[_0x45ff('0x68')](_0x4a78db);})[_0x45ff('0x4c')](function(_0x3a0023){logger[_0x45ff('0x59')](_0x3a0023['message']);});} \ No newline at end of file +var _0xc40a=['filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','pick','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','order','raw','getContactsCsv','ContactItemType','OrderBy','alias','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','item','from','CmContactId\x20=\x20c.id','additionalPhone_','select','description','cm_contact_has_items','ItemTypeId\x20=\x20?','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomFields','text','TEXT','number','Sequelize','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','findAndCountAll','getGlobalCustomFields','addAgents','emit','removeAgents','userCmList:remove','getAgents','User','spread','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Lists','UserProfileResource','destroy','end','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL'];(function(_0x1b0b34,_0x10aec6){var _0x2bcbbf=function(_0x273931){while(--_0x273931){_0x1b0b34['push'](_0x1b0b34['shift']());}};_0x2bcbbf(++_0x10aec6);}(_0xc40a,0x1a8));var _0xac40=function(_0x58e5aa,_0x513400){_0x58e5aa=_0x58e5aa-0x0;var _0x3e656e=_0xc40a[_0x58e5aa];return _0x3e656e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac40('0x0'));var zipdir=require(_0xac40('0x1'));var jsonpatch=require(_0xac40('0x2'));var rp=require(_0xac40('0x3'));var moment=require(_0xac40('0x4'));var BPromise=require(_0xac40('0x5'));var Mustache=require(_0xac40('0x6'));var util=require(_0xac40('0x7'));var path=require(_0xac40('0x8'));var sox=require(_0xac40('0x9'));var csv=require(_0xac40('0xa'));var ejs=require(_0xac40('0xb'));var fs=require('fs');var fs_extra=require(_0xac40('0xc'));var _=require(_0xac40('0xd'));var squel=require(_0xac40('0xe'));var crypto=require(_0xac40('0xf'));var jsforce=require(_0xac40('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xac40('0xa'));var querystring=require('querystring');var Papa=require(_0xac40('0x11'));var Redis=require(_0xac40('0x12'));var authService=require(_0xac40('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xac40('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac40('0x15'))(_0xac40('0x16'));var utils=require(_0xac40('0x17'));var config=require(_0xac40('0x18'));var licenseUtil=require(_0xac40('0x19'));var db=require(_0xac40('0x1a'))['db'];var csv_results;config['redis']=_[_0xac40('0x1b')](config[_0xac40('0x1c')],{'host':_0xac40('0x1d'),'port':0x18eb});var socket=require(_0xac40('0x1e'))(new Redis(config['redis']));require('./cmList.socket')[_0xac40('0x1f')](socket);function respondWithStatusCode(_0x9d9a44,_0x40a54c){_0x40a54c=_0x40a54c||0xcc;return function(_0x61cad1){if(_0x61cad1){return _0x9d9a44[_0xac40('0x20')](_0x40a54c);}return _0x9d9a44[_0xac40('0x21')](_0x40a54c)['end']();};}function respondWithResult(_0x2b96b3,_0x2eda31){_0x2eda31=_0x2eda31||0xc8;return function(_0x5692be){if(_0x5692be){return _0x2b96b3[_0xac40('0x21')](_0x2eda31)['json'](_0x5692be);}};}function respondWithFilteredResult(_0x19f044,_0x4fe444){return function(_0x509beb){if(_0x509beb){var _0x4b6146=typeof _0x4fe444[_0xac40('0x22')]===_0xac40('0x23')&&typeof _0x4fe444[_0xac40('0x24')]==='undefined';var _0xc39595=_0x509beb[_0xac40('0x25')];var _0x31e115=_0x4b6146?0x0:_0x4fe444[_0xac40('0x22')];var _0xc8831d=_0x4b6146?_0x509beb[_0xac40('0x25')]:_0x4fe444[_0xac40('0x22')]+_0x4fe444[_0xac40('0x24')];var _0x53f055;if(_0xc8831d>=_0xc39595){_0xc8831d=_0xc39595;_0x53f055=0xc8;}else{_0x53f055=0xce;}_0x19f044[_0xac40('0x21')](_0x53f055);return _0x19f044[_0xac40('0x26')](_0xac40('0x27'),_0x31e115+'-'+_0xc8831d+'/'+_0xc39595)[_0xac40('0x28')](_0x509beb);}return null;};}function patchUpdates(_0x2e0afc){return function(_0x26ca37){try{jsonpatch[_0xac40('0x29')](_0x26ca37,_0x2e0afc,!![]);}catch(_0x446e97){return BPromise[_0xac40('0x2a')](_0x446e97);}return _0x26ca37['save']();};}function saveUpdates(_0x42bfa6,_0x2328ec){return function(_0x4665b0){if(_0x4665b0){return _0x4665b0[_0xac40('0x2b')](_0x42bfa6)['then'](function(_0x3957a1){return _0x3957a1;});}return null;};}function removeEntity(_0x1f7459,_0x11b2f2){return function(_0x4da2b3){if(_0x4da2b3){return _0x4da2b3['destroy']()[_0xac40('0x2c')](function(){var _0x46f77c=_0x4da2b3[_0xac40('0x2d')]({'plain':!![]});var _0x4ccd9b=_0xac40('0x2e');return db[_0xac40('0x2f')][_0xac40('0x30')]({'where':{'type':_0x4ccd9b,'resourceId':_0x46f77c['id']}})[_0xac40('0x2c')](function(){return _0x4da2b3;});})[_0xac40('0x2c')](function(){_0x1f7459[_0xac40('0x21')](0xcc)[_0xac40('0x31')]();});}};}function handleEntityNotFound(_0xcb05aa,_0x596dd4){return function(_0x364ebf){if(!_0x364ebf){_0xcb05aa[_0xac40('0x20')](0x194);}return _0x364ebf;};}function handleError(_0x51c027,_0x2ef715){_0x2ef715=_0x2ef715||0x1f4;return function(_0x348be1){logger[_0xac40('0x32')](_0x348be1['stack']);if(_0x348be1[_0xac40('0x33')]){delete _0x348be1[_0xac40('0x33')];}_0x51c027[_0xac40('0x21')](_0x2ef715)[_0xac40('0x34')](_0x348be1);};}exports[_0xac40('0x35')]=function(_0x3c9799,_0x5a1557){var _0x169b40={},_0x35d82e={},_0xc33724={'count':0x0,'rows':[]};var _0x2d88a2=_[_0xac40('0x36')](db[_0xac40('0x37')][_0xac40('0x38')],function(_0x56df50){return{'name':_0x56df50[_0xac40('0x39')],'type':_0x56df50[_0xac40('0x3a')][_0xac40('0x3b')]};});_0x35d82e[_0xac40('0x3c')]=_['map'](_0x2d88a2,_0xac40('0x33'));_0x35d82e[_0xac40('0x3d')]=_[_0xac40('0x3e')](_0x3c9799['query']);_0x35d82e[_0xac40('0x3f')]=_[_0xac40('0x40')](_0x35d82e[_0xac40('0x3c')],_0x35d82e['query']);_0x169b40['attributes']=_['intersection'](_0x35d82e[_0xac40('0x3c')],qs[_0xac40('0x41')](_0x3c9799[_0xac40('0x3d')][_0xac40('0x41')]));_0x169b40['attributes']=_0x169b40[_0xac40('0x42')][_0xac40('0x43')]?_0x169b40[_0xac40('0x42')]:_0x35d82e['model'];if(!_0x3c9799[_0xac40('0x3d')][_0xac40('0x44')](_0xac40('0x45'))){_0x169b40['limit']=qs[_0xac40('0x24')](_0x3c9799[_0xac40('0x3d')][_0xac40('0x24')]);_0x169b40[_0xac40('0x22')]=qs['offset'](_0x3c9799[_0xac40('0x3d')]['offset']);}_0x169b40['order']=qs['sort'](_0x3c9799[_0xac40('0x3d')][_0xac40('0x46')]);_0x169b40[_0xac40('0x47')]=qs[_0xac40('0x3f')](_['pick'](_0x3c9799['query'],_0x35d82e[_0xac40('0x3f')]),_0x2d88a2);if(_0x3c9799[_0xac40('0x3d')]['filter']){_0x169b40[_0xac40('0x47')]=_[_0xac40('0x48')](_0x169b40[_0xac40('0x47')],{'$or':_[_0xac40('0x36')](_0x2d88a2,function(_0x168fbc){if(_0x168fbc[_0xac40('0x3a')]!==_0xac40('0x49')){var _0x1d1840={};_0x1d1840[_0x168fbc[_0xac40('0x33')]]={'$like':'%'+_0x3c9799[_0xac40('0x3d')][_0xac40('0x4a')]+'%'};return _0x1d1840;}})});}_0x169b40=_[_0xac40('0x48')]({},_0x169b40,_0x3c9799['options']);var _0x32f8ee={'where':_0x169b40[_0xac40('0x47')]};return db[_0xac40('0x37')][_0xac40('0x25')](_0x32f8ee)[_0xac40('0x2c')](function(_0x48fbc0){_0xc33724['count']=_0x48fbc0;if(_0x3c9799[_0xac40('0x3d')][_0xac40('0x4b')]){_0x169b40[_0xac40('0x4c')]=[{'all':!![]}];}return db[_0xac40('0x37')][_0xac40('0x4d')](_0x169b40);})['then'](function(_0x4617f1){_0xc33724[_0xac40('0x4e')]=_0x4617f1;return _0xc33724;})[_0xac40('0x2c')](respondWithFilteredResult(_0x5a1557,_0x169b40))[_0xac40('0x4f')](handleError(_0x5a1557,null));};exports[_0xac40('0x50')]=function(_0xaff9f8,_0x52f9ad){var _0x47136d={'raw':![],'where':{'id':_0xaff9f8[_0xac40('0x51')]['id']}},_0x33eef7={};_0x33eef7[_0xac40('0x3c')]=_[_0xac40('0x3e')](db[_0xac40('0x37')][_0xac40('0x38')]);_0x33eef7['query']=_[_0xac40('0x3e')](_0xaff9f8[_0xac40('0x3d')]);_0x33eef7[_0xac40('0x3f')]=_[_0xac40('0x40')](_0x33eef7['model'],_0x33eef7[_0xac40('0x3d')]);_0x47136d[_0xac40('0x42')]=_[_0xac40('0x40')](_0x33eef7[_0xac40('0x3c')],qs['fields'](_0xaff9f8['query'][_0xac40('0x41')]));_0x47136d['attributes']=_0x47136d[_0xac40('0x42')]['length']?_0x47136d['attributes']:_0x33eef7['model'];if(_0xaff9f8[_0xac40('0x3d')][_0xac40('0x4b')]){_0x47136d['include']=[{'all':!![]}];}_0x47136d=_[_0xac40('0x48')]({},_0x47136d,_0xaff9f8[_0xac40('0x52')]);return db[_0xac40('0x37')][_0xac40('0x53')](_0x47136d)[_0xac40('0x2c')](handleEntityNotFound(_0x52f9ad,null))['then'](respondWithResult(_0x52f9ad,null))[_0xac40('0x4f')](handleError(_0x52f9ad,null));};exports[_0xac40('0x54')]=function(_0x53ce1d,_0x538a4a){return db['CmList'][_0xac40('0x54')](_0x53ce1d['body'],{})[_0xac40('0x2c')](function(_0x16f1f1){var _0x4c0048=_0x53ce1d[_0xac40('0x55')][_0xac40('0x2d')]({'plain':!![]});if(!_0x4c0048)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c0048['role']===_0xac40('0x55')){var _0x7c2a0=_0x16f1f1[_0xac40('0x2d')]({'plain':!![]});var _0x3876d6=_0xac40('0x2e');return db[_0xac40('0x56')][_0xac40('0x53')]({'where':{'name':_0x3876d6,'userProfileId':_0x4c0048[_0xac40('0x57')]},'raw':!![]})[_0xac40('0x2c')](function(_0x132817){if(_0x132817&&_0x132817[_0xac40('0x58')]===0x0){return db[_0xac40('0x2f')][_0xac40('0x54')]({'name':_0x7c2a0[_0xac40('0x33')],'resourceId':_0x7c2a0['id'],'type':_0x132817['name'],'sectionId':_0x132817['id']},{})['then'](function(){return _0x16f1f1;});}else{return _0x16f1f1;}})['catch'](function(_0x4b5cef){logger[_0xac40('0x32')](_0xac40('0x59'),_0x4b5cef);throw _0x4b5cef;});}return _0x16f1f1;})[_0xac40('0x2c')](respondWithResult(_0x538a4a,0xc9))['catch'](handleError(_0x538a4a,null));};exports[_0xac40('0x2b')]=function(_0x2de83b,_0x3ae907){if(_0x2de83b[_0xac40('0x5a')]['id']){delete _0x2de83b[_0xac40('0x5a')]['id'];}return db[_0xac40('0x37')][_0xac40('0x53')]({'where':{'id':_0x2de83b[_0xac40('0x51')]['id']}})['then'](handleEntityNotFound(_0x3ae907,null))[_0xac40('0x2c')](saveUpdates(_0x2de83b[_0xac40('0x5a')],null))[_0xac40('0x2c')](respondWithResult(_0x3ae907,null))[_0xac40('0x4f')](handleError(_0x3ae907,null));};exports[_0xac40('0x30')]=function(_0x453e7b,_0x47edbf){return db[_0xac40('0x37')][_0xac40('0x53')]({'where':{'id':_0x453e7b[_0xac40('0x51')]['id']}})['then'](handleEntityNotFound(_0x47edbf,null))[_0xac40('0x2c')](removeEntity(_0x47edbf,null))[_0xac40('0x4f')](handleError(_0x47edbf,null));};exports[_0xac40('0x5b')]=function(_0x417815,_0x547cb6){return db['CmList'][_0xac40('0x5b')]()[_0xac40('0x2c')](respondWithResult(_0x547cb6,null))[_0xac40('0x4f')](handleError(_0x547cb6,null));};exports[_0xac40('0x5c')]=function(_0x175789,_0x4563e3,_0x2fb453){if(_0x175789[_0xac40('0x5a')]['id']){delete _0x175789['body']['id'];}return db[_0xac40('0x37')][_0xac40('0x53')]({'where':{'id':_0x175789[_0xac40('0x51')]['id']}})[_0xac40('0x2c')](handleEntityNotFound(_0x4563e3,null))[_0xac40('0x2c')](function(_0x205d9f){if(_0x205d9f){_0x175789[_0xac40('0x5a')][_0xac40('0x5d')]=_0x205d9f['id'];return db[_0xac40('0x5e')][_0xac40('0x54')](_0x175789[_0xac40('0x5a')]);}})[_0xac40('0x2c')](respondWithResult(_0x4563e3,null))[_0xac40('0x4f')](handleError(_0x4563e3,null));};exports[_0xac40('0x5f')]=function(_0x2bb78e,_0x1a9895,_0x80857c){var _0x4d121c={'raw':![],'where':{}};var _0x371631={};var _0x3dd6ed={'count':0x0,'rows':[]};return db[_0xac40('0x37')][_0xac40('0x60')]({'where':{'id':_0x2bb78e['params']['id']}})['then'](handleEntityNotFound(_0x1a9895,null))[_0xac40('0x2c')](function(_0x138d8a){if(_0x138d8a){_0x371631['model']=_['keys'](db[_0xac40('0x5e')]['rawAttributes']);_0x371631[_0xac40('0x3d')]=_[_0xac40('0x3e')](_0x2bb78e[_0xac40('0x3d')]);_0x371631[_0xac40('0x3f')]=_[_0xac40('0x40')](_0x371631[_0xac40('0x3c')],_0x371631['query']);_0x4d121c[_0xac40('0x42')]=_['intersection'](_0x371631[_0xac40('0x3c')],qs['fields'](_0x2bb78e[_0xac40('0x3d')]['fields']));_0x4d121c['attributes']=_0x4d121c[_0xac40('0x42')][_0xac40('0x43')]?_0x4d121c[_0xac40('0x42')]:_0x371631[_0xac40('0x3c')];if(!_0x2bb78e[_0xac40('0x3d')][_0xac40('0x44')](_0xac40('0x45'))){_0x4d121c[_0xac40('0x24')]=qs[_0xac40('0x24')](_0x2bb78e[_0xac40('0x3d')]['limit']);_0x4d121c[_0xac40('0x22')]=qs[_0xac40('0x22')](_0x2bb78e[_0xac40('0x3d')][_0xac40('0x22')]);}_0x4d121c['order']=qs[_0xac40('0x46')](_0x2bb78e[_0xac40('0x3d')]['sort']);_0x4d121c[_0xac40('0x47')]=qs[_0xac40('0x3f')](_[_0xac40('0x61')](_0x2bb78e['query'],_0x371631[_0xac40('0x3f')]));_0x4d121c[_0xac40('0x47')][_0xac40('0x5d')]=_0x138d8a['id'];if(_0x2bb78e[_0xac40('0x3d')][_0xac40('0x4a')]){_0x4d121c[_0xac40('0x47')]=_[_0xac40('0x48')](_0x4d121c[_0xac40('0x47')],{'$or':_[_0xac40('0x36')](_0x4d121c[_0xac40('0x42')],function(_0x4c5d2b){var _0x25f73d={};_0x25f73d[_0x4c5d2b]={'$like':'%'+_0x2bb78e[_0xac40('0x3d')][_0xac40('0x4a')]+'%'};return _0x25f73d;})});}_0x4d121c=_[_0xac40('0x48')]({},_0x4d121c,_0x2bb78e['options']);return db[_0xac40('0x5e')][_0xac40('0x25')]({'where':_0x4d121c[_0xac40('0x47')]})[_0xac40('0x2c')](function(_0x1c1c22){_0x3dd6ed[_0xac40('0x25')]=_0x1c1c22;if(_0x2bb78e[_0xac40('0x3d')][_0xac40('0x4b')]){_0x4d121c[_0xac40('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0xac40('0x4d')](_0x4d121c);})[_0xac40('0x2c')](function(_0x4631b3){_0x3dd6ed[_0xac40('0x4e')]=_0x4631b3;return _0x3dd6ed;});}})[_0xac40('0x2c')](respondWithFilteredResult(_0x1a9895,_0x4d121c))['catch'](handleError(_0x1a9895,null));};exports['removeDispositions']=function(_0x2a872a,_0x18e56f,_0x280f27){return db['CmList'][_0xac40('0x53')]({'where':{'id':_0x2a872a[_0xac40('0x51')]['id']}})[_0xac40('0x2c')](handleEntityNotFound(_0x18e56f,null))[_0xac40('0x2c')](function(_0xdfc63d){if(_0xdfc63d){return _0xdfc63d['removeDispositions'](_0x2a872a[_0xac40('0x3d')][_0xac40('0x62')]);}})['then'](respondWithStatusCode(_0x18e56f,null))[_0xac40('0x4f')](handleError(_0x18e56f,null));};exports[_0xac40('0x63')]=function(_0x2dd1c2,_0x5bbbb4,_0x4305a1){return db[_0xac40('0x37')][_0xac40('0x53')]({'where':{'id':_0x2dd1c2['params']['id']}})[_0xac40('0x2c')](handleEntityNotFound(_0x5bbbb4,null))[_0xac40('0x2c')](function(_0x32fe69){if(_0x32fe69){var _0x352588=[];var _0x439694={'success':[],'errors':[]};return db[_0xac40('0x64')][_0xac40('0x5b')]()['then'](function(_0x3944dc){if(_0x2dd1c2[_0xac40('0x5a')][_0xac40('0x65')]&&_[_0xac40('0x66')](_0x2dd1c2['body'][_0xac40('0x65')])){if(_0x2dd1c2[_0xac40('0x5a')][_0xac40('0x65')][_0xac40('0x43')]){_0x2dd1c2[_0xac40('0x5a')][_0xac40('0x65')]=_0x2dd1c2[_0xac40('0x5a')][_0xac40('0x65')][_0xac40('0x67')](';')+';';}else{_0x2dd1c2[_0xac40('0x5a')]['tags']=null;}}else{_0x2dd1c2['body'][_0xac40('0x65')]=null;}if(_0x2dd1c2[_0xac40('0x5a')]&&_['isArray'](_0x2dd1c2[_0xac40('0x5a')])){for(var _0x234eb7=0x0;_0x234eb7<_0x2dd1c2['body'][_0xac40('0x43')];_0x234eb7+=0x1){_0x2dd1c2[_0xac40('0x5a')][_0x234eb7][_0xac40('0x5d')]=_0x2dd1c2['params']['id'];_0x352588[_0xac40('0x68')](_0x2dd1c2['body'][_0x234eb7]);}return BPromise[_0xac40('0x69')](_0x352588,function(_0x344479){return db[_0xac40('0x64')][_0xac40('0x54')](_[_0xac40('0x6a')](_0x344479,[_0xac40('0x62'),'id'])||{},{'fields':_['keys'](_0x3944dc),'raw':!![]})[_0xac40('0x2c')](function(_0x5acacd){_0x439694['success']['push'](_0x5acacd[_0xac40('0x6b')]);})[_0xac40('0x4f')](function(_0x37f2e8){_0x439694[_0xac40('0x6c')]['push']({'data':_0x344479,'error':_0x37f2e8[_0xac40('0x6d')]});});})[_0xac40('0x2c')](function(_0x13ce7d){return _0x439694;})[_0xac40('0x4f')](function(_0x3ef1c6){return _0x3ef1c6;});}else{_0x5bbbb4['status'](0x190)['json']({'message':_0xac40('0x6e')});}});}})['then'](respondWithResult(_0x5bbbb4,null))['catch'](handleError(_0x5bbbb4,null));};exports['getContacts']=function(_0x2a865f,_0x5e7d30,_0x171bee){var _0x58533f;return db[_0xac40('0x37')][_0xac40('0x53')]({'where':{'id':_0x2a865f[_0xac40('0x51')]['id']},'include':[{'model':db[_0xac40('0x6f')],'as':_0xac40('0x70')}]})[_0xac40('0x2c')](handleEntityNotFound(_0x5e7d30,null))[_0xac40('0x2c')](function(_0x4fd57e){if(_0x4fd57e){_0x58533f=_0x4fd57e;return db['CmContact'][_0xac40('0x38')];}})[_0xac40('0x2c')](function(_0x57cc83){if(_0x57cc83){var _0x328293={};var _0x12295f={};_0x12295f['model']=_[_0xac40('0x71')](_[_0xac40('0x3e')](_0x57cc83),_[_0xac40('0x36')](_0x58533f[_0xac40('0x70')],function(_0x6bdaf8){return util[_0xac40('0x72')](_0xac40('0x73'),_0x6bdaf8['id']);}));_0x12295f['query']=_[_0xac40('0x3e')](_0x2a865f[_0xac40('0x3d')]);_0x12295f[_0xac40('0x3f')]=_[_0xac40('0x40')](_0x12295f[_0xac40('0x3c')],_0x12295f['query']);_0x328293['attributes']=_['intersection'](_0x12295f[_0xac40('0x3c')],qs[_0xac40('0x41')](_0x2a865f[_0xac40('0x3d')][_0xac40('0x41')]));_0x328293[_0xac40('0x42')]=_0x328293['attributes'][_0xac40('0x43')]?_0x328293['attributes']:_0x12295f[_0xac40('0x3c')];if(!_0x2a865f[_0xac40('0x3d')][_0xac40('0x44')](_0xac40('0x45'))){_0x328293[_0xac40('0x24')]=qs[_0xac40('0x24')](_0x2a865f[_0xac40('0x3d')]['limit']);_0x328293[_0xac40('0x22')]=qs[_0xac40('0x22')](_0x2a865f['query']['offset']);}_0x328293[_0xac40('0x74')]=qs['sort'](_0x2a865f[_0xac40('0x3d')][_0xac40('0x46')]);_0x328293['where']=qs['filters'](_['pick'](_0x2a865f[_0xac40('0x3d')],_0x12295f['filters']));_0x328293[_0xac40('0x75')]=!![];if(_0x2a865f[_0xac40('0x3d')]['filter']){_0x328293[_0xac40('0x47')]=_[_0xac40('0x48')](_0x328293['where'],{'$or':_[_0xac40('0x36')](_0x328293[_0xac40('0x42')],function(_0x5c6a7f){var _0x117b76={};_0x117b76[_0x5c6a7f]={'$like':'%'+_0x2a865f[_0xac40('0x3d')]['filter']+'%'};return _0x117b76;})});}_0x328293=_['merge']({},_0x328293,_0x2a865f[_0xac40('0x52')]);return _0x58533f['getContacts'](_0x328293);}})['then'](respondWithResult(_0x5e7d30,null))[_0xac40('0x4f')](handleError(_0x5e7d30,null));};exports[_0xac40('0x76')]=function(_0x316aaf,_0x50c4c3,_0x38517e){var _0x9dfb2a;var _0x8b5663;var _0x3b189a;var _0x2f037d=_0x316aaf[_0xac40('0x51')]['id'];csv_results=[];return db[_0xac40('0x77')]['findAll']({'attributes':['id',_0xac40('0x33')],'raw':!![],'order':[_0xac40('0x78')]})[_0xac40('0x2c')](function(_0x1a94b1){_0x9dfb2a=_0x1a94b1;var _0x554da4=_[_0xac40('0x3e')](db[_0xac40('0x64')][_0xac40('0x38')]);return db['CmCustomField'][_0xac40('0x4d')]({'raw':!![],'attributes':['id',_0xac40('0x79')]})[_0xac40('0x2c')](function(_0x156090){_0x8b5663=_0x156090;var _0x498999=squel['select']()[_0xac40('0x41')](_0x554da4)['from'](_0xac40('0x7a'),'c')[_0xac40('0x47')](_0xac40('0x7b'),_0x2f037d)['where'](_0xac40('0x7c'))[_0xac40('0x7d')]();for(var _0x243029=0x0;_0x243029<_0x8b5663['length'];_0x243029++){_0x498999[_0xac40('0x7e')]('c.cf_'+_0x8b5663[_0x243029]['id'],'customField_'+_0x8b5663[_0x243029][_0xac40('0x79')]);}for(var _0x243029=0x0;_0x243029<_0x9dfb2a[_0xac40('0x43')];_0x243029++){_0x498999[_0xac40('0x7e')](squel['select']()[_0xac40('0x7e')](_0xac40('0x7f'))[_0xac40('0x80')]('cm_contact_has_items')[_0xac40('0x47')]('ItemTypeId\x20=\x20?',_0x9dfb2a[_0x243029]['id'])[_0xac40('0x47')](_0xac40('0x81')),_0xac40('0x82')+_0x9dfb2a[_0x243029][_0xac40('0x33')]);_0x498999['field'](squel[_0xac40('0x83')]()['field'](_0xac40('0x84'))['from'](_0xac40('0x85'))[_0xac40('0x47')](_0xac40('0x86'),_0x9dfb2a[_0x243029]['id'])['where'](_0xac40('0x81')),'description_additionalPhone_'+_0x9dfb2a[_0x243029][_0xac40('0x33')]);}var _0x2e4ded=[];_0x2e4ded[_0xac40('0x68')](_0x498999['toString']());BPromise[_0xac40('0x69')](_0x2e4ded,handleQuery)[_0xac40('0x2c')](function(_0x23b642){handleQuery(_0x498999[_0xac40('0x87')]());var _0x5742a1=csv_results[0x0];if(!_[_0xac40('0x88')](_0x5742a1)){var _0x10acbb=toCsv(_0x5742a1);var _0x16e159=Date[_0xac40('0x89')]();fs[_0xac40('0x8a')](util[_0xac40('0x72')](_0xac40('0x8b'),_0x2f037d,_0x16e159),_0x10acbb);_0x50c4c3[_0xac40('0x8c')](_0xac40('0x8d'),_0xac40('0x8e')+util['format'](_0xac40('0x8f'),_0x2f037d,_0x16e159));_0x50c4c3['setHeader'](_0xac40('0x90'),_0xac40('0x91'));return _0x50c4c3['download'](util[_0xac40('0x72')](_0xac40('0x8b'),_0x2f037d,_0x16e159));}else{return _0x50c4c3['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x39c8c6,_0x1dcf3f,_0x16f1da){var _0x16170e;delete _0x39c8c6[_0xac40('0x5a')]['id'];return db[_0xac40('0x37')][_0xac40('0x60')]({'where':{'id':_0x39c8c6[_0xac40('0x51')]['id']}})['then'](handleEntityNotFound(_0x1dcf3f,null))[_0xac40('0x2c')](function(_0xe51b90){if(_0xe51b90){return db['sequelize']['transaction'](function(_0x2bfc92){return db['CmCustomField'][_0xac40('0x54')](_0x39c8c6[_0xac40('0x5a')],{'transaction':_0x2bfc92})[_0xac40('0x2c')](function(_0x3e1270){_0x16170e=_0x3e1270;return _0xe51b90[_0xac40('0x92')](_0x3e1270,{'transaction':_0x2bfc92});})[_0xac40('0x2c')](function(){var _0x3b146e={'type':db['Sequelize']['TEXT'],'transaction':_0x2bfc92};switch(_0x39c8c6[_0xac40('0x5a')][_0xac40('0x3a')]){case _0xac40('0x93'):_0x3b146e[_0xac40('0x3a')]=db['Sequelize'][_0xac40('0x94')];break;case _0xac40('0x95'):_0x3b146e[_0xac40('0x3a')]=db[_0xac40('0x96')][_0xac40('0x97')];break;case'switch':_0x3b146e['type']=db[_0xac40('0x96')][_0xac40('0x98')];_0x3b146e[_0xac40('0x99')]=![];break;default:}return db[_0xac40('0x9a')][_0xac40('0x9b')][_0xac40('0x9c')](_0xac40('0x7a'),util[_0xac40('0x72')]('cf_%s',_0x16170e['id']),_0x3b146e);})[_0xac40('0x2c')](function(){return _0x16170e;});});}})[_0xac40('0x2c')](respondWithResult(_0x1dcf3f,null))[_0xac40('0x4f')](handleError(_0x1dcf3f,null));};exports['getCustomFields']=function(_0xe87ed0,_0x3f62a8,_0x2b90b2){var _0x3246c7={};var _0x4f9aae={};var _0x4aceea;var _0x285183;return db[_0xac40('0x37')][_0xac40('0x60')]({'where':{'id':_0xe87ed0[_0xac40('0x51')]['id']}})[_0xac40('0x2c')](handleEntityNotFound(_0x3f62a8,null))[_0xac40('0x2c')](function(_0x319595){if(_0x319595){_0x4aceea=_0x319595;_0x4f9aae[_0xac40('0x3c')]=_[_0xac40('0x3e')](db[_0xac40('0x6f')][_0xac40('0x38')]);_0x4f9aae[_0xac40('0x3d')]=_[_0xac40('0x3e')](_0xe87ed0['query']);_0x4f9aae['filters']=_['intersection'](_0x4f9aae[_0xac40('0x3c')],_0x4f9aae[_0xac40('0x3d')]);_0x3246c7[_0xac40('0x42')]=_[_0xac40('0x40')](_0x4f9aae[_0xac40('0x3c')],qs['fields'](_0xe87ed0[_0xac40('0x3d')][_0xac40('0x41')]));_0x3246c7[_0xac40('0x42')]=_0x3246c7[_0xac40('0x42')]['length']?_0x3246c7[_0xac40('0x42')]:_0x4f9aae[_0xac40('0x3c')];_0x3246c7[_0xac40('0x74')]=qs['sort'](_0xe87ed0[_0xac40('0x3d')]['sort']);_0x3246c7['where']=qs[_0xac40('0x3f')](_[_0xac40('0x61')](_0xe87ed0['query'],_0x4f9aae[_0xac40('0x3f')]));_0x3246c7['where']=_[_0xac40('0x48')](_0x3246c7['where'],{'$or':[{'ListId':_0x319595['id']},{'ListId':null}]});if(_0xe87ed0[_0xac40('0x3d')]['filter']){_0x3246c7[_0xac40('0x47')]=_[_0xac40('0x48')](_0x3246c7[_0xac40('0x47')],{'$or':_['map'](_0x3246c7['attributes'],function(_0x31a87a){var _0x21931c={};_0x21931c[_0x31a87a]={'$like':'%'+_0xe87ed0[_0xac40('0x3d')][_0xac40('0x4a')]+'%'};return _0x21931c;})});}_0x3246c7=_[_0xac40('0x48')]({},_0x3246c7,_0xe87ed0[_0xac40('0x52')]);return db[_0xac40('0x6f')][_0xac40('0x9d')](_0x3246c7);}})[_0xac40('0x2c')](respondWithResult(_0x3f62a8,null))[_0xac40('0x4f')](handleError(_0x3f62a8,null));};exports[_0xac40('0x9e')]=function(_0x52a6c8,_0x3f9465){return db[_0xac40('0x6f')][_0xac40('0x9d')]({'where':{'ListId':null}})[_0xac40('0x2c')](handleEntityNotFound(_0x3f9465,null))[_0xac40('0x2c')](function(_0x109163){return _0x109163;})[_0xac40('0x2c')](respondWithResult(_0x3f9465,null))[_0xac40('0x4f')](handleError(_0x3f9465,null));};exports[_0xac40('0x9f')]=function(_0x400482,_0x3afe1c,_0x16983b){return db[_0xac40('0x37')][_0xac40('0x53')]({'where':{'id':_0x400482['params']['id']}})[_0xac40('0x2c')](handleEntityNotFound(_0x3afe1c,null))['then'](function(_0x3928c0){if(_0x3928c0){return _0x3928c0[_0xac40('0x9f')](_0x400482[_0xac40('0x5a')]['ids'],_[_0xac40('0x6a')](_0x400482[_0xac40('0x5a')],['ids','id'])||{})['spread'](function(_0x5cd6ae){for(var _0x10183b=0x0;_0x10183b<_0x400482[_0xac40('0x5a')][_0xac40('0x62')]['length'];_0x10183b+=0x1){socket[_0xac40('0xa0')]('userCmList:save',{'UserId':Number(_0x400482[_0xac40('0x5a')][_0xac40('0x62')][_0x10183b]),'CmListId':Number(_0x400482[_0xac40('0x51')]['id'])});}return _0x5cd6ae;});}})[_0xac40('0x2c')](respondWithResult(_0x3afe1c,null))['catch'](handleError(_0x3afe1c,null));};exports['removeAgents']=function(_0x15345b,_0x3f7b07,_0x5d0b90){return db[_0xac40('0x37')]['find']({'where':{'id':_0x15345b[_0xac40('0x51')]['id']}})[_0xac40('0x2c')](handleEntityNotFound(_0x3f7b07,null))['then'](function(_0x7cb6d1){if(_0x7cb6d1){return _0x7cb6d1[_0xac40('0xa1')](_0x15345b[_0xac40('0x3d')][_0xac40('0x62')])[_0xac40('0x2c')](function(){if(_[_0xac40('0x66')](_0x15345b['query'][_0xac40('0x62')])){for(var _0x8588a8=0x0;_0x8588a8<_0x15345b[_0xac40('0x3d')][_0xac40('0x62')][_0xac40('0x43')];_0x8588a8+=0x1){socket[_0xac40('0xa0')](_0xac40('0xa2'),{'UserId':Number(_0x15345b['query'][_0xac40('0x62')][_0x8588a8]),'CmListId':Number(_0x15345b[_0xac40('0x51')]['id'])});}}else{socket[_0xac40('0xa0')]('userCmList:remove',{'UserId':Number(_0x15345b[_0xac40('0x3d')][_0xac40('0x62')]),'CmListId':Number(_0x15345b[_0xac40('0x51')]['id'])});}});}})[_0xac40('0x2c')](respondWithStatusCode(_0x3f7b07,null))[_0xac40('0x4f')](handleError(_0x3f7b07,null));};exports[_0xac40('0xa3')]=function(_0x35aca4,_0x472fde,_0xe41e30){var _0x1637c1={};var _0x1116e3={};var _0xc028c8;var _0xf027ac;return db['CmList']['findOne']({'where':{'id':_0x35aca4[_0xac40('0x51')]['id']}})['then'](handleEntityNotFound(_0x472fde,null))[_0xac40('0x2c')](function(_0x163408){if(_0x163408){_0xc028c8=_0x163408;_0x1116e3[_0xac40('0x3c')]=_[_0xac40('0x3e')](db[_0xac40('0xa4')][_0xac40('0x38')]);_0x1116e3[_0xac40('0x3d')]=_[_0xac40('0x3e')](_0x35aca4[_0xac40('0x3d')]);_0x1116e3[_0xac40('0x3f')]=_['intersection'](_0x1116e3[_0xac40('0x3c')],_0x1116e3[_0xac40('0x3d')]);_0x1637c1[_0xac40('0x42')]=_[_0xac40('0x40')](_0x1116e3[_0xac40('0x3c')],qs[_0xac40('0x41')](_0x35aca4[_0xac40('0x3d')]['fields']));_0x1637c1[_0xac40('0x42')]=_0x1637c1[_0xac40('0x42')][_0xac40('0x43')]?_0x1637c1[_0xac40('0x42')]:_0x1116e3['model'];_0x1637c1[_0xac40('0x74')]=qs[_0xac40('0x46')](_0x35aca4[_0xac40('0x3d')][_0xac40('0x46')]);_0x1637c1['where']=qs[_0xac40('0x3f')](_[_0xac40('0x61')](_0x35aca4['query'],_0x1116e3[_0xac40('0x3f')]));if(_0x35aca4[_0xac40('0x3d')][_0xac40('0x4a')]){_0x1637c1[_0xac40('0x47')]=_[_0xac40('0x48')](_0x1637c1[_0xac40('0x47')],{'$or':_[_0xac40('0x36')](_0x1637c1[_0xac40('0x42')],function(_0x1021e6){var _0x160882={};_0x160882[_0x1021e6]={'$like':'%'+_0x35aca4['query'][_0xac40('0x4a')]+'%'};return _0x160882;})});}_0x1637c1=_['merge']({},_0x1637c1,_0x35aca4[_0xac40('0x52')]);return _0xc028c8[_0xac40('0xa3')](_0x1637c1);}})['then'](function(_0xbf0353){if(_0xbf0353){_0xf027ac=_0xbf0353['length'];if(!_0x35aca4[_0xac40('0x3d')][_0xac40('0x44')](_0xac40('0x45'))){_0x1637c1['limit']=qs[_0xac40('0x24')](_0x35aca4['query']['limit']);_0x1637c1[_0xac40('0x22')]=qs['offset'](_0x35aca4[_0xac40('0x3d')][_0xac40('0x22')]);}return _0xc028c8[_0xac40('0xa3')](_0x1637c1);}})[_0xac40('0x2c')](function(_0x5c6ae3){if(_0x5c6ae3){return _0x5c6ae3?{'count':_0xf027ac,'rows':_0x5c6ae3}:null;}})[_0xac40('0x2c')](respondWithResult(_0x472fde,null))[_0xac40('0x4f')](handleError(_0x472fde,null));};function handleQuery(_0x542e5f){logger['info'](_0x542e5f);return db[_0xac40('0x9a')][_0xac40('0x3d')](_0x542e5f)[_0xac40('0xa5')](function(_0x607dea){csv_results[_0xac40('0x68')](_0x607dea);})[_0xac40('0x4f')](function(_0x305cde){logger[_0xac40('0x32')](_0x305cde[_0xac40('0x6d')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5bf5349..b8c71f1 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x5fc3[_0x128bef];return _0x1ba862;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x3bc8b8,_0x3e8590){var _0x2f9a17=function(_0x301e4f){while(--_0x301e4f){_0x3bc8b8['push'](_0x3bc8b8['shift']());}};_0x2f9a17(++_0x3e8590);}(_0x814b,0x1a2));var _0xb814=function(_0x5a585b,_0x3e0674){_0x5a585b=_0x5a585b-0x0;var _0x4cd398=_0x814b[_0x5a585b];return _0x4cd398;};'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 e8379b6..94c717c 100644 --- a/server/api/cmList/cmList.model.js +++ b/server/api/cmList/cmList.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x42d037,_0x3866b7){var _0x32026c=function(_0x908d49){while(--_0x908d49){_0x42d037['push'](_0x42d037['shift']());}};_0x32026c(++_0x3866b7);}(_0x5ff3,0x17d));var _0x35ff=function(_0x1d0f83,_0x3eb405){_0x1d0f83=_0x1d0f83-0x0;var _0xde3446=_0x5ff3[_0x1d0f83];return _0xde3446;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x4371a1,_0x2a85b6){var _0x3a7f2f=function(_0xb0727b){while(--_0xb0727b){_0x4371a1['push'](_0x4371a1['shift']());}};_0x3a7f2f(++_0x2a85b6);}(_0x22fb,0x192));var _0xb22f=function(_0x3d6bdc,_0x393717){_0x3d6bdc=_0x3d6bdc-0x0;var _0x2a0ab3=_0x22fb[_0x3d6bdc];return _0x2a0ab3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index d76de0e..246396e 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 _0xf37d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','./cmList.socket','request','then','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf37d,0x13e));var _0xdf37=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0xf37d[_0x58fbb0];return _0x1783d2;};'use strict';var _=require(_0xdf37('0x0'));var util=require(_0xdf37('0x1'));var moment=require(_0xdf37('0x2'));var BPromise=require('bluebird');var rs=require(_0xdf37('0x3'));var fs=require('fs');var Redis=require(_0xdf37('0x4'));var db=require(_0xdf37('0x5'))['db'];var utils=require(_0xdf37('0x6'));var logger=require(_0xdf37('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdf37('0x8'));var client=jayson['client'][_0xdf37('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xdf37('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf37('0xa')]));require(_0xdf37('0xb'))['register'](socket);function respondWithRpcPromise(_0x11de48,_0x5ab420,_0x32e95e){return new BPromise(function(_0x559549,_0x160e33){return client[_0xdf37('0xc')](_0x11de48,_0x32e95e)[_0xdf37('0xd')](function(_0x41506c){logger['info'](_0xdf37('0xe'),_0x5ab420,_0xdf37('0xf'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x5ab420,'request\x20sent',JSON[_0xdf37('0x10')](_0x41506c));if(_0x41506c['error']){if(_0x41506c[_0xdf37('0x11')][_0xdf37('0x12')]===0x1f4){logger['error'](_0xdf37('0xe'),_0x5ab420,_0x41506c['error'][_0xdf37('0x13')]);return _0x160e33(_0x41506c['error']['message']);}logger[_0xdf37('0x11')]('CmList,\x20%s,\x20%s',_0x5ab420,_0x41506c[_0xdf37('0x11')][_0xdf37('0x13')]);return _0x559549(_0x41506c[_0xdf37('0x11')][_0xdf37('0x13')]);}else{logger[_0xdf37('0x14')](_0xdf37('0xe'),_0x5ab420,_0xdf37('0xf'));_0x559549(_0x41506c[_0xdf37('0x15')][_0xdf37('0x13')]);}})[_0xdf37('0x16')](function(_0x229a01){logger[_0xdf37('0x11')](_0xdf37('0xe'),_0x5ab420,_0x229a01);_0x160e33(_0x229a01);});});} \ No newline at end of file +var _0xaca3=['error','code','message','result','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d75b1,_0x3d2feb){var _0x59db79=function(_0x184c1b){while(--_0x184c1b){_0x5d75b1['push'](_0x5d75b1['shift']());}};_0x59db79(++_0x3d2feb);}(_0xaca3,0xee));var _0x3aca=function(_0x321276,_0x39a17f){_0x321276=_0x321276-0x0;var _0x115264=_0xaca3[_0x321276];return _0x115264;};'use strict';var _=require(_0x3aca('0x0'));var util=require(_0x3aca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3aca('0x2'));var db=require(_0x3aca('0x3'))['db'];var utils=require(_0x3aca('0x4'));var logger=require('../../config/logger')(_0x3aca('0x5'));var config=require(_0x3aca('0x6'));var jayson=require(_0x3aca('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x3aca('0x8')]=_[_0x3aca('0x9')](config['redis'],{'host':_0x3aca('0xa'),'port':0x18eb});var socket=require(_0x3aca('0xb'))(new Redis(config[_0x3aca('0x8')]));require(_0x3aca('0xc'))[_0x3aca('0xd')](socket);function respondWithRpcPromise(_0x17d016,_0x54b3c3,_0x39af05){return new BPromise(function(_0x402410,_0x2239c0){return client[_0x3aca('0xe')](_0x17d016,_0x39af05)[_0x3aca('0xf')](function(_0x262d25){logger[_0x3aca('0x10')](_0x3aca('0x11'),_0x54b3c3,_0x3aca('0x12'));logger[_0x3aca('0x13')](_0x3aca('0x14'),_0x54b3c3,_0x3aca('0x12'),JSON[_0x3aca('0x15')](_0x262d25));if(_0x262d25['error']){if(_0x262d25[_0x3aca('0x16')][_0x3aca('0x17')]===0x1f4){logger[_0x3aca('0x16')]('CmList,\x20%s,\x20%s',_0x54b3c3,_0x262d25['error']['message']);return _0x2239c0(_0x262d25[_0x3aca('0x16')][_0x3aca('0x18')]);}logger[_0x3aca('0x16')](_0x3aca('0x11'),_0x54b3c3,_0x262d25[_0x3aca('0x16')]['message']);return _0x402410(_0x262d25['error'][_0x3aca('0x18')]);}else{logger[_0x3aca('0x10')](_0x3aca('0x11'),_0x54b3c3,_0x3aca('0x12'));_0x402410(_0x262d25[_0x3aca('0x19')][_0x3aca('0x18')]);}})['catch'](function(_0x78dfa7){logger['error'](_0x3aca('0x11'),_0x54b3c3,_0x78dfa7);_0x2239c0(_0x78dfa7);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index e44a984..ba2c1d6 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 _0x344e=['removeListener','length','save','remove','update','emit'];(function(_0x344130,_0x4773d1){var _0x389ee2=function(_0x10d659){while(--_0x10d659){_0x344130['push'](_0x344130['shift']());}};_0x389ee2(++_0x4773d1);}(_0x344e,0xd4));var _0xe344=function(_0x2bb323,_0x4e70fd){_0x2bb323=_0x2bb323-0x0;var _0x255386=_0x344e[_0x2bb323];return _0x255386;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xe344('0x0'),_0xe344('0x1'),_0xe344('0x2')];function createListener(_0x268357,_0x539ea5){return function(_0x52e945){_0x539ea5[_0xe344('0x3')](_0x268357,_0x52e945);};}function removeListener(_0x4c3fc3,_0xea40ba){return function(){CmListEvents[_0xe344('0x4')](_0x4c3fc3,_0xea40ba);};}exports['register']=function(_0xc7f3fa){for(var _0x5f4134=0x0,_0x5a440e=events[_0xe344('0x5')];_0x5f4134<_0x5a440e;_0x5f4134++){var _0x2fa46f=events[_0x5f4134];var _0x379ad1=createListener('cmList:'+_0x2fa46f,_0xc7f3fa);CmListEvents['on'](_0x2fa46f,_0x379ad1);}}; \ No newline at end of file +var _0x0ddc=['emit','removeListener','length','cmList:','./cmList.events','save','update'];(function(_0x2866e6,_0x2b7e6e){var _0x5916e1=function(_0x2c2eea){while(--_0x2c2eea){_0x2866e6['push'](_0x2866e6['shift']());}};_0x5916e1(++_0x2b7e6e);}(_0x0ddc,0x1bd));var _0xc0dd=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x0ddc[_0x4154a6];return _0x3b2786;};'use strict';var CmListEvents=require(_0xc0dd('0x0'));var events=[_0xc0dd('0x1'),'remove',_0xc0dd('0x2')];function createListener(_0x46c4ed,_0x3f654c){return function(_0x564522){_0x3f654c[_0xc0dd('0x3')](_0x46c4ed,_0x564522);};}function removeListener(_0x4a78e2,_0xadf810){return function(){CmListEvents[_0xc0dd('0x4')](_0x4a78e2,_0xadf810);};}exports['register']=function(_0x41bf03){for(var _0x1e8d37=0x0,_0x55d2ed=events[_0xc0dd('0x5')];_0x1e8d37<_0x55d2ed;_0x1e8d37++){var _0x283966=events[_0x1e8d37];var _0xb0d391=createListener(_0xc0dd('0x6')+_0x283966,_0x41bf03);CmListEvents['on'](_0x283966,_0xb0d391);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 93096ee..b64aecd 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 _0x24ab=['addAgents','delete','destroy','removeDispositions','removeAgents','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','/:id/fields','getCustomFields','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','/:id/users'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ab,0x13c));var _0xb24a=function(_0x1be181,_0x29d354){_0x1be181=_0x1be181-0x0;var _0x2f46d3=_0x24ab[_0x1be181];return _0x2f46d3;};'use strict';var multer=require(_0xb24a('0x0'));var util=require('util');var path=require(_0xb24a('0x1'));var timeout=require('connect-timeout');var express=require(_0xb24a('0x2'));var router=express['Router']();var fs_extra=require(_0xb24a('0x3'));var auth=require(_0xb24a('0x4'));var interaction=require(_0xb24a('0x5'));var config=require(_0xb24a('0x6'));var controller=require(_0xb24a('0x7'));router[_0xb24a('0x8')]('/',auth[_0xb24a('0x9')](),controller['index']);router[_0xb24a('0x8')](_0xb24a('0xa'),auth[_0xb24a('0x9')](),controller[_0xb24a('0xb')]);router[_0xb24a('0x8')](_0xb24a('0xc'),auth[_0xb24a('0x9')](),controller[_0xb24a('0xd')]);router[_0xb24a('0x8')](_0xb24a('0xe'),auth[_0xb24a('0x9')](),controller['show']);router[_0xb24a('0x8')](_0xb24a('0xf'),auth[_0xb24a('0x9')](),controller['getDispositions']);router[_0xb24a('0x8')]('/:id/contacts',auth[_0xb24a('0x9')](),controller['getContacts']);router[_0xb24a('0x8')]('/:id/contacts/csv',auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xb24a('0x8')](_0xb24a('0x10'),auth['isAuthenticated'](),controller[_0xb24a('0x11')]);router[_0xb24a('0x8')]('/:id/users',auth[_0xb24a('0x9')](),controller['getAgents']);router[_0xb24a('0x12')]('/',auth[_0xb24a('0x9')](),controller[_0xb24a('0x13')]);router[_0xb24a('0x12')](_0xb24a('0xf'),auth['isAuthenticated'](),controller[_0xb24a('0x14')]);router[_0xb24a('0x12')](_0xb24a('0x15'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x16')]);router['post']('/:id/fields',auth[_0xb24a('0x9')](),controller[_0xb24a('0x17')]);router[_0xb24a('0x12')](_0xb24a('0x18'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x19')]);router['put'](_0xb24a('0xe'),auth[_0xb24a('0x9')](),controller['update']);router[_0xb24a('0x1a')](_0xb24a('0xe'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x1b')]);router[_0xb24a('0x1a')](_0xb24a('0xf'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x1c')]);router[_0xb24a('0x1a')](_0xb24a('0x18'),auth[_0xb24a('0x9')](),controller[_0xb24a('0x1d')]);module[_0xb24a('0x1e')]=router; \ No newline at end of file +var _0x4b8a=['removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4b8a[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xa4b8('0x0'));var path=require('path');var timeout=require(_0xa4b8('0x1'));var express=require(_0xa4b8('0x2'));var router=express[_0xa4b8('0x3')]();var fs_extra=require(_0xa4b8('0x4'));var auth=require(_0xa4b8('0x5'));var interaction=require(_0xa4b8('0x6'));var config=require(_0xa4b8('0x7'));var controller=require(_0xa4b8('0x8'));router[_0xa4b8('0x9')]('/',auth[_0xa4b8('0xa')](),controller[_0xa4b8('0xb')]);router[_0xa4b8('0x9')](_0xa4b8('0xc'),auth[_0xa4b8('0xa')](),controller['describe']);router[_0xa4b8('0x9')](_0xa4b8('0xd'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0xe')]);router[_0xa4b8('0x9')](_0xa4b8('0xf'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x10')]);router[_0xa4b8('0x9')](_0xa4b8('0x11'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x12')]);router[_0xa4b8('0x9')](_0xa4b8('0x13'),auth['isAuthenticated'](),controller['getContacts']);router[_0xa4b8('0x9')]('/:id/contacts/csv',auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x14')]);router['get'](_0xa4b8('0x15'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x16')]);router[_0xa4b8('0x9')](_0xa4b8('0x17'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x18')]);router[_0xa4b8('0x19')]('/',auth[_0xa4b8('0xa')](),controller['create']);router[_0xa4b8('0x19')](_0xa4b8('0x11'),auth['isAuthenticated'](),controller[_0xa4b8('0x1a')]);router[_0xa4b8('0x19')](_0xa4b8('0x13'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x1b')]);router['post']('/:id/fields',auth['isAuthenticated'](),controller['addCustomField']);router[_0xa4b8('0x19')](_0xa4b8('0x17'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x1c')]);router[_0xa4b8('0x1d')](_0xa4b8('0xf'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x1e')]);router[_0xa4b8('0x1f')](_0xa4b8('0xf'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x20')]);router[_0xa4b8('0x1f')](_0xa4b8('0x11'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x21')]);router[_0xa4b8('0x1f')]('/:id/users',auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x22')]);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 459e8eb..a57df29 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 _0x130b=['exports','VIRTUAL','getDataValue','STRING','sequelize'];(function(_0x4a8fea,_0x4603f4){var _0x5e23a4=function(_0x25dcb0){while(--_0x25dcb0){_0x4a8fea['push'](_0x4a8fea['shift']());}};_0x5e23a4(++_0x4603f4);}(_0x130b,0x18a));var _0xb130=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x130b[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require(_0xb130('0x0'));module[_0xb130('0x1')]={'name':{'type':Sequelize[_0xb130('0x2')],'get':function(_0x5d00c1){return this[_0xb130('0x3')]('field');}},'field':{'type':Sequelize[_0xb130('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xb130('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6cfb=['VIRTUAL','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cfb,0xa6));var _0xb6cf=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x6cfb[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0xb6cf('0x0'));module[_0xb6cf('0x1')]={'name':{'type':Sequelize[_0xb6cf('0x2')],'get':function(_0x533423){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0xb6cf('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xb6cf('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index ae1f50e..44fa36a 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(_0x3cd483,_0x4d67bb){var _0x12c8a2=function(_0x3c686b){while(--_0x3c686b){_0x3cd483['push'](_0x3cd483['shift']());}};_0x12c8a2(++_0x4d67bb);}(_0x7a54,0x106));var _0x47a5=function(_0x5572ed,_0x46585c){_0x5572ed=_0x5572ed-0x0;var _0x4c4c56=_0x7a54[_0x5572ed];return _0x4c4c56;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x27a415,_0x5bc629){var _0x4ba504=function(_0x462b37){while(--_0x462b37){_0x27a415['push'](_0x27a415['shift']());}};_0x4ba504(++_0x5bc629);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index adbdc11..f443cc8 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 _0xe7a2=['moment','bluebird','path','rimraf','../../config/environment','exports','define','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x2c5a6d,_0x22ddfa){var _0x2a465e=function(_0x3e75bf){while(--_0x3e75bf){_0x2c5a6d['push'](_0x2c5a6d['shift']());}};_0x2a465e(++_0x22ddfa);}(_0xe7a2,0xf9));var _0x2e7a=function(_0x4e566c,_0x16e04c){_0x4e566c=_0x4e566c-0x0;var _0x31947e=_0xe7a2[_0x4e566c];return _0x31947e;};'use strict';var _=require(_0x2e7a('0x0'));var util=require(_0x2e7a('0x1'));var logger=require(_0x2e7a('0x2'))('api');var moment=require(_0x2e7a('0x3'));var BPromise=require(_0x2e7a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e7a('0x5'));var rimraf=require(_0x2e7a('0x6'));var config=require(_0x2e7a('0x7'));var attributes=require('./condition.attributes');module[_0x2e7a('0x8')]=function(_0x534450,_0x2e45da){return _0x534450[_0x2e7a('0x9')](_0x2e7a('0xa'),attributes,{'tableName':_0x2e7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa04=['./condition.attributes','exports','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x180237,_0xfd4959){var _0x56fa74=function(_0x520793){while(--_0x520793){_0x180237['push'](_0x180237['shift']());}};_0x56fa74(++_0xfd4959);}(_0xaa04,0x122));var _0x4aa0=function(_0x331beb,_0xf4d148){_0x331beb=_0x331beb-0x0;var _0x5a3beb=_0xaa04[_0x331beb];return _0x5a3beb;};'use strict';var _=require(_0x4aa0('0x0'));var util=require('util');var logger=require(_0x4aa0('0x1'))(_0x4aa0('0x2'));var moment=require(_0x4aa0('0x3'));var BPromise=require(_0x4aa0('0x4'));var rp=require(_0x4aa0('0x5'));var fs=require('fs');var path=require(_0x4aa0('0x6'));var rimraf=require(_0x4aa0('0x7'));var config=require(_0x4aa0('0x8'));var attributes=require(_0x4aa0('0x9'));module[_0x4aa0('0xa')]=function(_0x228381,_0x250e1b){return _0x228381['define'](_0x4aa0('0xb'),attributes,{'tableName':_0x4aa0('0xc'),'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 cf542ba..4373f26 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 _0xb92b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','then','info','Condition,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb92b,0x1d7));var _0xbb92=function(_0x464ee0,_0xa1f126){_0x464ee0=_0x464ee0-0x0;var _0x1a04ca=_0xb92b[_0x464ee0];return _0x1a04ca;};'use strict';var _=require(_0xbb92('0x0'));var util=require(_0xbb92('0x1'));var moment=require(_0xbb92('0x2'));var BPromise=require('bluebird');var rs=require(_0xbb92('0x3'));var fs=require('fs');var Redis=require(_0xbb92('0x4'));var db=require(_0xbb92('0x5'))['db'];var utils=require(_0xbb92('0x6'));var logger=require(_0xbb92('0x7'))(_0xbb92('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe353,_0x527a59,_0x293a92){return new BPromise(function(_0x90fa81,_0x500c96){return client['request'](_0x3fe353,_0x293a92)[_0xbb92('0x9')](function(_0x417488){logger[_0xbb92('0xa')](_0xbb92('0xb'),_0x527a59,'request\x20sent');logger[_0xbb92('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x527a59,_0xbb92('0xd'),JSON[_0xbb92('0xe')](_0x417488));if(_0x417488[_0xbb92('0xf')]){if(_0x417488['error'][_0xbb92('0x10')]===0x1f4){logger[_0xbb92('0xf')](_0xbb92('0xb'),_0x527a59,_0x417488[_0xbb92('0xf')]['message']);return _0x500c96(_0x417488[_0xbb92('0xf')]['message']);}logger[_0xbb92('0xf')](_0xbb92('0xb'),_0x527a59,_0x417488['error']['message']);return _0x90fa81(_0x417488[_0xbb92('0xf')][_0xbb92('0x11')]);}else{logger[_0xbb92('0xa')](_0xbb92('0xb'),_0x527a59,_0xbb92('0xd'));_0x90fa81(_0x417488[_0xbb92('0x12')][_0xbb92('0x11')]);}})['catch'](function(_0x5f12c5){logger[_0xbb92('0xf')](_0xbb92('0xb'),_0x527a59,_0x5f12c5);_0x500c96(_0x5f12c5);});});} \ No newline at end of file +var _0x12c9=['result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xe1ae7a,_0x5af438){var _0x515f18=function(_0x3104d0){while(--_0x3104d0){_0xe1ae7a['push'](_0xe1ae7a['shift']());}};_0x515f18(++_0x5af438);}(_0x12c9,0x1a3));var _0x912c=function(_0xacc9e8,_0x1968d3){_0xacc9e8=_0xacc9e8-0x0;var _0x5318e3=_0x12c9[_0xacc9e8];return _0x5318e3;};'use strict';var _=require('lodash');var util=require(_0x912c('0x0'));var moment=require(_0x912c('0x1'));var BPromise=require(_0x912c('0x2'));var rs=require(_0x912c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x912c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x912c('0x5'))(_0x912c('0x6'));var config=require('../../config/environment');var jayson=require(_0x912c('0x7'));var client=jayson['client'][_0x912c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b9157,_0x351e27,_0x165425){return new BPromise(function(_0x29754c,_0x22ad80){return client[_0x912c('0x9')](_0x4b9157,_0x165425)['then'](function(_0x3f0128){logger[_0x912c('0xa')](_0x912c('0xb'),_0x351e27,_0x912c('0xc'));logger[_0x912c('0xd')](_0x912c('0xe'),_0x351e27,_0x912c('0xc'),JSON['stringify'](_0x3f0128));if(_0x3f0128['error']){if(_0x3f0128[_0x912c('0xf')][_0x912c('0x10')]===0x1f4){logger['error'](_0x912c('0xb'),_0x351e27,_0x3f0128[_0x912c('0xf')][_0x912c('0x11')]);return _0x22ad80(_0x3f0128[_0x912c('0xf')][_0x912c('0x11')]);}logger['error']('Condition,\x20%s,\x20%s',_0x351e27,_0x3f0128[_0x912c('0xf')][_0x912c('0x11')]);return _0x29754c(_0x3f0128[_0x912c('0xf')][_0x912c('0x11')]);}else{logger[_0x912c('0xa')]('Condition,\x20%s,\x20%s',_0x351e27,_0x912c('0xc'));_0x29754c(_0x3f0128[_0x912c('0x12')][_0x912c('0x11')]);}})['catch'](function(_0x4cf096){logger['error'](_0x912c('0xb'),_0x351e27,_0x4cf096);_0x22ad80(_0x4cf096);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index dbd5e77..2eef25f 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 _0x3fbd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x3fbd,0xcd));var _0xd3fb=function(_0x2edadd,_0x25f487){_0x2edadd=_0x2edadd-0x0;var _0x4a8073=_0x3fbd[_0x2edadd];return _0x4a8073;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd3fb('0x0'));var timeout=require(_0xd3fb('0x1'));var express=require(_0xd3fb('0x2'));var router=express[_0xd3fb('0x3')]();var fs_extra=require(_0xd3fb('0x4'));var auth=require(_0xd3fb('0x5'));var interaction=require(_0xd3fb('0x6'));var config=require(_0xd3fb('0x7'));var controller=require(_0xd3fb('0x8'));router[_0xd3fb('0x9')]('/:id',auth[_0xd3fb('0xa')](),controller[_0xd3fb('0xb')]);router[_0xd3fb('0xc')](_0xd3fb('0xd'),auth[_0xd3fb('0xa')](),controller['destroy']);module[_0xd3fb('0xe')]=router; \ No newline at end of file +var _0xb313=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb313,0x7c));var _0x3b31=function(_0x4192ad,_0x488f5c){_0x4192ad=_0x4192ad-0x0;var _0x415dc3=_0xb313[_0x4192ad];return _0x415dc3;};'use strict';var multer=require(_0x3b31('0x0'));var util=require(_0x3b31('0x1'));var path=require(_0x3b31('0x2'));var timeout=require(_0x3b31('0x3'));var express=require(_0x3b31('0x4'));var router=express[_0x3b31('0x5')]();var fs_extra=require(_0x3b31('0x6'));var auth=require(_0x3b31('0x7'));var interaction=require(_0x3b31('0x8'));var config=require(_0x3b31('0x9'));var controller=require(_0x3b31('0xa'));router[_0x3b31('0xb')](_0x3b31('0xc'),auth['isAuthenticated'](),controller[_0x3b31('0xd')]);router[_0x3b31('0xe')]('/:id',auth[_0x3b31('0xf')](),controller[_0x3b31('0x10')]);module[_0x3b31('0x11')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 5f24302..6560edc 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 _0xf326=['INTEGER','sequelize','STRING','name'];(function(_0x518267,_0x244d87){var _0x4f2677=function(_0x3f1503){while(--_0x3f1503){_0x518267['push'](_0x518267['shift']());}};_0x4f2677(++_0x244d87);}(_0xf326,0xfd));var _0x6f32=function(_0x104914,_0x49debf){_0x104914=_0x104914-0x0;var _0x2fb6f1=_0xf326[_0x104914];return _0x2fb6f1;};'use strict';var Sequelize=require(_0x6f32('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f32('0x1')],'allowNull':![],'unique':_0x6f32('0x2')},'OrderBy':{'type':Sequelize[_0x6f32('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x6f32('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xcd48=['STRING','name','INTEGER','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcd48,0x71));var _0x8cd4=function(_0x204120,_0x57eb51){_0x204120=_0x204120-0x0;var _0x3a91da=_0xcd48[_0x204120];return _0x3a91da;};'use strict';var Sequelize=require(_0x8cd4('0x0'));module[_0x8cd4('0x1')]={'name':{'type':Sequelize[_0x8cd4('0x2')],'allowNull':![],'unique':_0x8cd4('0x3')},'OrderBy':{'type':Sequelize[_0x8cd4('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x8cd4('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 11ba4dd..b83d84a 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 _0x7708=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','apply','save','update','then','destroy','ContactItemTypes','UserProfileResource','error','stack','send','index','map','ContactItemType','key','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','show','params','rawAttributes','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','fast-json-patch'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x7708,0x188));var _0x8770=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x7708[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x8770('0x0'));var rimraf=require(_0x8770('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8770('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8770('0x3'));var path=require(_0x8770('0x4'));var sox=require('sox');var csv=require(_0x8770('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8770('0x6'));var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0x5'));var querystring=require('querystring');var Papa=require(_0x8770('0xc'));var Redis=require(_0x8770('0xd'));var authService=require(_0x8770('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8770('0xf'));var hardwareService=require(_0x8770('0x10'));var logger=require(_0x8770('0x11'))(_0x8770('0x12'));var utils=require('../../config/utils');var config=require(_0x8770('0x13'));var licenseUtil=require(_0x8770('0x14'));var db=require(_0x8770('0x15'))['db'];function respondWithStatusCode(_0x51efbc,_0xb52d60){_0xb52d60=_0xb52d60||0xcc;return function(_0x455a65){if(_0x455a65){return _0x51efbc[_0x8770('0x16')](_0xb52d60);}return _0x51efbc[_0x8770('0x17')](_0xb52d60)[_0x8770('0x18')]();};}function respondWithResult(_0x12a06f,_0x1ce41d){_0x1ce41d=_0x1ce41d||0xc8;return function(_0x12439f){if(_0x12439f){return _0x12a06f['status'](_0x1ce41d)[_0x8770('0x19')](_0x12439f);}};}function respondWithFilteredResult(_0x106a20,_0x5dd4e7){return function(_0x2f7918){if(_0x2f7918){var _0x52254f=typeof _0x5dd4e7[_0x8770('0x1a')]==='undefined'&&typeof _0x5dd4e7['limit']==='undefined';var _0x155e83=_0x2f7918[_0x8770('0x1b')];var _0x17b634=_0x52254f?0x0:_0x5dd4e7[_0x8770('0x1a')];var _0x4b0691=_0x52254f?_0x2f7918['count']:_0x5dd4e7[_0x8770('0x1a')]+_0x5dd4e7[_0x8770('0x1c')];var _0x26cbcd;if(_0x4b0691>=_0x155e83){_0x4b0691=_0x155e83;_0x26cbcd=0xc8;}else{_0x26cbcd=0xce;}_0x106a20[_0x8770('0x17')](_0x26cbcd);return _0x106a20[_0x8770('0x1d')]('Content-Range',_0x17b634+'-'+_0x4b0691+'/'+_0x155e83)[_0x8770('0x19')](_0x2f7918);}return null;};}function patchUpdates(_0x1234dd){return function(_0x384b1e){try{jsonpatch[_0x8770('0x1e')](_0x384b1e,_0x1234dd,!![]);}catch(_0x582048){return BPromise['reject'](_0x582048);}return _0x384b1e[_0x8770('0x1f')]();};}function saveUpdates(_0x348e2f,_0x443716){return function(_0x2918a7){if(_0x2918a7){return _0x2918a7[_0x8770('0x20')](_0x348e2f)[_0x8770('0x21')](function(_0x5819dc){return _0x5819dc;});}return null;};}function removeEntity(_0x468fc0,_0x23ad66){return function(_0x4274dd){if(_0x4274dd){return _0x4274dd[_0x8770('0x22')]()['then'](function(){var _0x460474=_0x4274dd['get']({'plain':!![]});var _0x7b4755=_0x8770('0x23');return db[_0x8770('0x24')][_0x8770('0x22')]({'where':{'type':_0x7b4755,'resourceId':_0x460474['id']}})[_0x8770('0x21')](function(){return _0x4274dd;});})[_0x8770('0x21')](function(){_0x468fc0[_0x8770('0x17')](0xcc)[_0x8770('0x18')]();});}};}function handleEntityNotFound(_0xb3f4aa,_0xa480){return function(_0x5f4973){if(!_0x5f4973){_0xb3f4aa[_0x8770('0x16')](0x194);}return _0x5f4973;};}function handleError(_0x199b96,_0x1df627){_0x1df627=_0x1df627||0x1f4;return function(_0x5c7bd){logger[_0x8770('0x25')](_0x5c7bd[_0x8770('0x26')]);if(_0x5c7bd['name']){delete _0x5c7bd['name'];}_0x199b96[_0x8770('0x17')](_0x1df627)[_0x8770('0x27')](_0x5c7bd);};}exports[_0x8770('0x28')]=function(_0x365080,_0x23f4b0){var _0x4bc072={},_0x5282dd={},_0x45fff4={'count':0x0,'rows':[]};var _0x144c24=_[_0x8770('0x29')](db[_0x8770('0x2a')]['rawAttributes'],function(_0x2f4e44){return{'name':_0x2f4e44['fieldName'],'type':_0x2f4e44['type'][_0x8770('0x2b')]};});_0x5282dd['model']=_[_0x8770('0x29')](_0x144c24,_0x8770('0x2c'));_0x5282dd[_0x8770('0x2d')]=_[_0x8770('0x2e')](_0x365080[_0x8770('0x2d')]);_0x5282dd[_0x8770('0x2f')]=_[_0x8770('0x30')](_0x5282dd[_0x8770('0x31')],_0x5282dd[_0x8770('0x2d')]);_0x4bc072['attributes']=_[_0x8770('0x30')](_0x5282dd[_0x8770('0x31')],qs[_0x8770('0x32')](_0x365080['query']['fields']));_0x4bc072[_0x8770('0x33')]=_0x4bc072[_0x8770('0x33')][_0x8770('0x34')]?_0x4bc072['attributes']:_0x5282dd[_0x8770('0x31')];if(!_0x365080['query'][_0x8770('0x35')](_0x8770('0x36'))){_0x4bc072[_0x8770('0x1c')]=qs[_0x8770('0x1c')](_0x365080[_0x8770('0x2d')][_0x8770('0x1c')]);_0x4bc072[_0x8770('0x1a')]=qs[_0x8770('0x1a')](_0x365080[_0x8770('0x2d')][_0x8770('0x1a')]);}_0x4bc072['order']=qs[_0x8770('0x37')](_0x365080[_0x8770('0x2d')][_0x8770('0x37')]);_0x4bc072['where']=qs[_0x8770('0x2f')](_[_0x8770('0x38')](_0x365080[_0x8770('0x2d')],_0x5282dd[_0x8770('0x2f')]),_0x144c24);if(_0x365080[_0x8770('0x2d')][_0x8770('0x39')]){_0x4bc072['where']=_[_0x8770('0x3a')](_0x4bc072['where'],{'$or':_[_0x8770('0x29')](_0x144c24,function(_0x57f52e){if(_0x57f52e[_0x8770('0x3b')]!==_0x8770('0x3c')){var _0x306142={};_0x306142[_0x57f52e['name']]={'$like':'%'+_0x365080[_0x8770('0x2d')][_0x8770('0x39')]+'%'};return _0x306142;}})});}_0x4bc072=_[_0x8770('0x3a')]({},_0x4bc072,_0x365080[_0x8770('0x3d')]);var _0x408e86={'where':_0x4bc072[_0x8770('0x3e')]};return db['ContactItemType'][_0x8770('0x1b')](_0x408e86)['then'](function(_0x4bcfc7){_0x45fff4[_0x8770('0x1b')]=_0x4bcfc7;if(_0x365080[_0x8770('0x2d')][_0x8770('0x3f')]){_0x4bc072[_0x8770('0x40')]=[{'all':!![]}];}return db[_0x8770('0x2a')]['findAll'](_0x4bc072);})[_0x8770('0x21')](function(_0x26ae1b){_0x45fff4['rows']=_0x26ae1b;return _0x45fff4;})[_0x8770('0x21')](respondWithFilteredResult(_0x23f4b0,_0x4bc072))['catch'](handleError(_0x23f4b0,null));};exports[_0x8770('0x41')]=function(_0x6bfa55,_0xc29c65){var _0x39c0d3={'raw':!![],'where':{'id':_0x6bfa55[_0x8770('0x42')]['id']}},_0x29dae5={};_0x29dae5[_0x8770('0x31')]=_[_0x8770('0x2e')](db[_0x8770('0x2a')][_0x8770('0x43')]);_0x29dae5[_0x8770('0x2d')]=_['keys'](_0x6bfa55[_0x8770('0x2d')]);_0x29dae5[_0x8770('0x2f')]=_[_0x8770('0x30')](_0x29dae5[_0x8770('0x31')],_0x29dae5[_0x8770('0x2d')]);_0x39c0d3[_0x8770('0x33')]=_['intersection'](_0x29dae5[_0x8770('0x31')],qs[_0x8770('0x32')](_0x6bfa55[_0x8770('0x2d')][_0x8770('0x32')]));_0x39c0d3[_0x8770('0x33')]=_0x39c0d3[_0x8770('0x33')][_0x8770('0x34')]?_0x39c0d3[_0x8770('0x33')]:_0x29dae5['model'];if(_0x6bfa55[_0x8770('0x2d')][_0x8770('0x3f')]){_0x39c0d3[_0x8770('0x40')]=[{'all':!![]}];}_0x39c0d3=_[_0x8770('0x3a')]({},_0x39c0d3,_0x6bfa55[_0x8770('0x3d')]);return db['ContactItemType']['find'](_0x39c0d3)[_0x8770('0x21')](handleEntityNotFound(_0xc29c65,null))['then'](respondWithResult(_0xc29c65,null))[_0x8770('0x44')](handleError(_0xc29c65,null));};exports['create']=function(_0x4f9e0b,_0x3805d8){return db[_0x8770('0x2a')][_0x8770('0x45')](_0x4f9e0b[_0x8770('0x46')],{})['then'](function(_0x136cc1){var _0x48dea0=_0x4f9e0b['user']['get']({'plain':!![]});if(!_0x48dea0)throw new Error(_0x8770('0x47'));if(_0x48dea0[_0x8770('0x48')]===_0x8770('0x49')){var _0x4f5cb8=_0x136cc1[_0x8770('0x4a')]({'plain':!![]});var _0x5b6638=_0x8770('0x23');return db[_0x8770('0x4b')][_0x8770('0x4c')]({'where':{'name':_0x5b6638,'userProfileId':_0x48dea0['userProfileId']},'raw':!![]})[_0x8770('0x21')](function(_0x5de11e){if(_0x5de11e&&_0x5de11e['autoAssociation']===0x0){return db['UserProfileResource'][_0x8770('0x45')]({'name':_0x4f5cb8[_0x8770('0x2c')],'resourceId':_0x4f5cb8['id'],'type':_0x5de11e[_0x8770('0x2c')],'sectionId':_0x5de11e['id']},{})[_0x8770('0x21')](function(){return _0x136cc1;});}else{return _0x136cc1;}})[_0x8770('0x44')](function(_0x1df5cd){logger['error'](_0x8770('0x4d'),_0x1df5cd);throw _0x1df5cd;});}return _0x136cc1;})['then'](respondWithResult(_0x3805d8,0xc9))[_0x8770('0x44')](handleError(_0x3805d8,null));};exports[_0x8770('0x20')]=function(_0x475e9d,_0x3e4f77){if(_0x475e9d['body']['id']){delete _0x475e9d[_0x8770('0x46')]['id'];}return db[_0x8770('0x2a')]['find']({'where':{'id':_0x475e9d['params']['id']}})['then'](handleEntityNotFound(_0x3e4f77,null))['then'](saveUpdates(_0x475e9d[_0x8770('0x46')],null))[_0x8770('0x21')](respondWithResult(_0x3e4f77,null))['catch'](handleError(_0x3e4f77,null));};exports[_0x8770('0x22')]=function(_0x38b68f,_0x435c23){return db[_0x8770('0x2a')][_0x8770('0x4c')]({'where':{'id':_0x38b68f[_0x8770('0x42')]['id']}})[_0x8770('0x21')](handleEntityNotFound(_0x435c23,null))[_0x8770('0x21')](db[_0x8770('0x4e')][_0x8770('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x38b68f[_0x8770('0x42')]['id']}}))['then'](removeEntity(_0x435c23,null))[_0x8770('0x44')](handleError(_0x435c23,null));}; \ No newline at end of file +var _0xa30a=['offset','undefined','count','limit','apply','save','update','then','get','ContactItemTypes','UserProfileResource','sendStatus','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','query','keys','filters','attributes','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json'];(function(_0x246e49,_0x2aa0ba){var _0x16d330=function(_0x45990a){while(--_0x45990a){_0x246e49['push'](_0x246e49['shift']());}};_0x16d330(++_0x2aa0ba);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){var _0x1be54c=_0x326f84[_0xaa30('0x24')]({'plain':!![]});var _0x12da2f=_0xaa30('0x25');return db[_0xaa30('0x26')]['destroy']({'where':{'type':_0x12da2f,'resourceId':_0x1be54c['id']}})[_0xaa30('0x23')](function(){return _0x326f84;});})[_0xaa30('0x23')](function(){_0x13128a['status'](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x5b3efb,_0x2da4da){return function(_0x33a0c9){if(!_0x33a0c9){_0x5b3efb[_0xaa30('0x27')](0x194);}return _0x33a0c9;};}function handleError(_0xd1eb3a,_0x37b4a6){_0x37b4a6=_0x37b4a6||0x1f4;return function(_0xc10b8f){logger[_0xaa30('0x28')](_0xc10b8f[_0xaa30('0x29')]);if(_0xc10b8f[_0xaa30('0x2a')]){delete _0xc10b8f[_0xaa30('0x2a')];}_0xd1eb3a[_0xaa30('0x19')](_0x37b4a6)[_0xaa30('0x2b')](_0xc10b8f);};}exports[_0xaa30('0x2c')]=function(_0x46abb9,_0x40e4ee){var _0x1a3f64={},_0x230d56={},_0x1fa8d4={'count':0x0,'rows':[]};var _0x484ffb=_[_0xaa30('0x2d')](db[_0xaa30('0x2e')][_0xaa30('0x2f')],function(_0x20916f){return{'name':_0x20916f[_0xaa30('0x30')],'type':_0x20916f[_0xaa30('0x31')]['key']};});_0x230d56['model']=_['map'](_0x484ffb,_0xaa30('0x2a'));_0x230d56[_0xaa30('0x32')]=_[_0xaa30('0x33')](_0x46abb9[_0xaa30('0x32')]);_0x230d56[_0xaa30('0x34')]=_['intersection'](_0x230d56['model'],_0x230d56[_0xaa30('0x32')]);_0x1a3f64[_0xaa30('0x35')]=_['intersection'](_0x230d56[_0xaa30('0x36')],qs['fields'](_0x46abb9[_0xaa30('0x32')]['fields']));_0x1a3f64[_0xaa30('0x35')]=_0x1a3f64[_0xaa30('0x35')]['length']?_0x1a3f64[_0xaa30('0x35')]:_0x230d56[_0xaa30('0x36')];if(!_0x46abb9[_0xaa30('0x32')][_0xaa30('0x37')](_0xaa30('0x38'))){_0x1a3f64[_0xaa30('0x1f')]=qs['limit'](_0x46abb9[_0xaa30('0x32')][_0xaa30('0x1f')]);_0x1a3f64['offset']=qs[_0xaa30('0x1c')](_0x46abb9[_0xaa30('0x32')][_0xaa30('0x1c')]);}_0x1a3f64['order']=qs['sort'](_0x46abb9[_0xaa30('0x32')][_0xaa30('0x39')]);_0x1a3f64[_0xaa30('0x3a')]=qs[_0xaa30('0x34')](_[_0xaa30('0x3b')](_0x46abb9[_0xaa30('0x32')],_0x230d56['filters']),_0x484ffb);if(_0x46abb9['query'][_0xaa30('0x3c')]){_0x1a3f64[_0xaa30('0x3a')]=_[_0xaa30('0x3d')](_0x1a3f64['where'],{'$or':_[_0xaa30('0x2d')](_0x484ffb,function(_0x1c8cd7){if(_0x1c8cd7[_0xaa30('0x31')]!==_0xaa30('0x3e')){var _0x554144={};_0x554144[_0x1c8cd7[_0xaa30('0x2a')]]={'$like':'%'+_0x46abb9[_0xaa30('0x32')][_0xaa30('0x3c')]+'%'};return _0x554144;}})});}_0x1a3f64=_[_0xaa30('0x3d')]({},_0x1a3f64,_0x46abb9[_0xaa30('0x3f')]);var _0x4f72a7={'where':_0x1a3f64[_0xaa30('0x3a')]};return db[_0xaa30('0x2e')][_0xaa30('0x1e')](_0x4f72a7)[_0xaa30('0x23')](function(_0x13f08f){_0x1fa8d4[_0xaa30('0x1e')]=_0x13f08f;if(_0x46abb9[_0xaa30('0x32')][_0xaa30('0x40')]){_0x1a3f64['include']=[{'all':!![]}];}return db['ContactItemType'][_0xaa30('0x41')](_0x1a3f64);})['then'](function(_0x5208f8){_0x1fa8d4['rows']=_0x5208f8;return _0x1fa8d4;})[_0xaa30('0x23')](respondWithFilteredResult(_0x40e4ee,_0x1a3f64))['catch'](handleError(_0x40e4ee,null));};exports[_0xaa30('0x42')]=function(_0x55f0bb,_0x421f79){var _0x3b892b={'raw':!![],'where':{'id':_0x55f0bb[_0xaa30('0x43')]['id']}},_0x3f530e={};_0x3f530e[_0xaa30('0x36')]=_[_0xaa30('0x33')](db[_0xaa30('0x2e')][_0xaa30('0x2f')]);_0x3f530e[_0xaa30('0x32')]=_[_0xaa30('0x33')](_0x55f0bb[_0xaa30('0x32')]);_0x3f530e['filters']=_[_0xaa30('0x44')](_0x3f530e[_0xaa30('0x36')],_0x3f530e[_0xaa30('0x32')]);_0x3b892b[_0xaa30('0x35')]=_[_0xaa30('0x44')](_0x3f530e['model'],qs['fields'](_0x55f0bb[_0xaa30('0x32')]['fields']));_0x3b892b[_0xaa30('0x35')]=_0x3b892b[_0xaa30('0x35')][_0xaa30('0x45')]?_0x3b892b[_0xaa30('0x35')]:_0x3f530e[_0xaa30('0x36')];if(_0x55f0bb[_0xaa30('0x32')][_0xaa30('0x40')]){_0x3b892b['include']=[{'all':!![]}];}_0x3b892b=_[_0xaa30('0x3d')]({},_0x3b892b,_0x55f0bb[_0xaa30('0x3f')]);return db[_0xaa30('0x2e')]['find'](_0x3b892b)[_0xaa30('0x23')](handleEntityNotFound(_0x421f79,null))[_0xaa30('0x23')](respondWithResult(_0x421f79,null))['catch'](handleError(_0x421f79,null));};exports[_0xaa30('0x46')]=function(_0x4a8fcc,_0x25d227){return db['ContactItemType']['create'](_0x4a8fcc[_0xaa30('0x47')],{})['then'](function(_0x56389c){var _0xf6a737=_0x4a8fcc[_0xaa30('0x48')][_0xaa30('0x24')]({'plain':!![]});if(!_0xf6a737)throw new Error(_0xaa30('0x49'));if(_0xf6a737[_0xaa30('0x4a')]===_0xaa30('0x48')){var _0x5616cd=_0x56389c[_0xaa30('0x24')]({'plain':!![]});var _0x17868d=_0xaa30('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x17868d,'userProfileId':_0xf6a737['userProfileId']},'raw':!![]})['then'](function(_0x998162){if(_0x998162&&_0x998162[_0xaa30('0x4b')]===0x0){return db[_0xaa30('0x26')][_0xaa30('0x46')]({'name':_0x5616cd[_0xaa30('0x2a')],'resourceId':_0x5616cd['id'],'type':_0x998162[_0xaa30('0x2a')],'sectionId':_0x998162['id']},{})['then'](function(){return _0x56389c;});}else{return _0x56389c;}})[_0xaa30('0x4c')](function(_0x2db9d5){logger[_0xaa30('0x28')](_0xaa30('0x4d'),_0x2db9d5);throw _0x2db9d5;});}return _0x56389c;})['then'](respondWithResult(_0x25d227,0xc9))[_0xaa30('0x4c')](handleError(_0x25d227,null));};exports[_0xaa30('0x22')]=function(_0x399007,_0x1edd3a){if(_0x399007[_0xaa30('0x47')]['id']){delete _0x399007['body']['id'];}return db['ContactItemType'][_0xaa30('0x4e')]({'where':{'id':_0x399007[_0xaa30('0x43')]['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x1edd3a,null))['then'](saveUpdates(_0x399007[_0xaa30('0x47')],null))['then'](respondWithResult(_0x1edd3a,null))[_0xaa30('0x4c')](handleError(_0x1edd3a,null));};exports[_0xaa30('0x4f')]=function(_0x483a01,_0x1fdca8){return db[_0xaa30('0x2e')]['find']({'where':{'id':_0x483a01[_0xaa30('0x43')]['id']}})['then'](handleEntityNotFound(_0x1fdca8,null))['then'](db[_0xaa30('0x50')][_0xaa30('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x483a01[_0xaa30('0x43')]['id']}}))['then'](removeEntity(_0x1fdca8,null))[_0xaa30('0x4c')](handleError(_0x1fdca8,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index bc03612..e9f2412 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 _0xcabd=['request-promise','path','rimraf','../../config/environment','exports','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xcabd,0x1e8));var _0xdcab=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xcabd[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0xdcab('0x0'));var util=require(_0xdcab('0x1'));var logger=require(_0xdcab('0x2'))(_0xdcab('0x3'));var moment=require(_0xdcab('0x4'));var BPromise=require(_0xdcab('0x5'));var rp=require(_0xdcab('0x6'));var fs=require('fs');var path=require(_0xdcab('0x7'));var rimraf=require(_0xdcab('0x8'));var config=require(_0xdcab('0x9'));var attributes=require('./contactItemType.attributes');module[_0xdcab('0xa')]=function(_0xd91842,_0x428495){return _0xd91842['define'](_0xdcab('0xb'),attributes,{'tableName':_0xdcab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2bc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ContactItemType','tools_contact_item_types','util'];(function(_0x1bd423,_0x50808d){var _0x5f1fc0=function(_0x40e458){while(--_0x40e458){_0x1bd423['push'](_0x1bd423['shift']());}};_0x5f1fc0(++_0x50808d);}(_0xe2bc,0x8b));var _0xce2b=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xe2bc[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0xce2b('0x0'));var logger=require('../../config/logger')(_0xce2b('0x1'));var moment=require(_0xce2b('0x2'));var BPromise=require(_0xce2b('0x3'));var rp=require(_0xce2b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce2b('0x5'));var config=require(_0xce2b('0x6'));var attributes=require('./contactItemType.attributes');module[_0xce2b('0x7')]=function(_0x45b3e1,_0x1c7945){return _0x45b3e1['define'](_0xce2b('0x8'),attributes,{'tableName':_0xce2b('0x9'),'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 e3f0b55..aca5516 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 _0x9ca9=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0xbc3542,_0x4de021){var _0x1c88ff=function(_0x1d1fb4){while(--_0x1d1fb4){_0xbc3542['push'](_0xbc3542['shift']());}};_0x1c88ff(++_0x4de021);}(_0x9ca9,0x189));var _0x99ca=function(_0x16d061,_0x270a45){_0x16d061=_0x16d061-0x0;var _0x54800f=_0x9ca9[_0x16d061];return _0x54800f;};'use strict';var _=require(_0x99ca('0x0'));var util=require(_0x99ca('0x1'));var moment=require(_0x99ca('0x2'));var BPromise=require(_0x99ca('0x3'));var rs=require(_0x99ca('0x4'));var fs=require('fs');var Redis=require(_0x99ca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x99ca('0x6'));var logger=require(_0x99ca('0x7'))(_0x99ca('0x8'));var config=require(_0x99ca('0x9'));var jayson=require(_0x99ca('0xa'));var client=jayson['client'][_0x99ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x169efe,_0x294deb,_0x37adca){return new BPromise(function(_0x587d80,_0x4a18aa){return client[_0x99ca('0xc')](_0x169efe,_0x37adca)['then'](function(_0x2fdbde){logger['info'](_0x99ca('0xd'),_0x294deb,'request\x20sent');logger[_0x99ca('0xe')](_0x99ca('0xf'),_0x294deb,_0x99ca('0x10'),JSON[_0x99ca('0x11')](_0x2fdbde));if(_0x2fdbde[_0x99ca('0x12')]){if(_0x2fdbde[_0x99ca('0x12')]['code']===0x1f4){logger[_0x99ca('0x12')](_0x99ca('0xd'),_0x294deb,_0x2fdbde['error'][_0x99ca('0x13')]);return _0x4a18aa(_0x2fdbde[_0x99ca('0x12')][_0x99ca('0x13')]);}logger['error'](_0x99ca('0xd'),_0x294deb,_0x2fdbde[_0x99ca('0x12')][_0x99ca('0x13')]);return _0x587d80(_0x2fdbde['error'][_0x99ca('0x13')]);}else{logger['info'](_0x99ca('0xd'),_0x294deb,_0x99ca('0x10'));_0x587d80(_0x2fdbde[_0x99ca('0x14')][_0x99ca('0x13')]);}})[_0x99ca('0x15')](function(_0x34de30){logger[_0x99ca('0x12')](_0x99ca('0xd'),_0x294deb,_0x34de30);_0x4a18aa(_0x34de30);});});} \ No newline at end of file +var _0x1abc=['jayson/promise','client','http','request','info','request\x20sent','error','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x29baaf,_0xd7279d){var _0x251a82=function(_0x2ddd0d){while(--_0x2ddd0d){_0x29baaf['push'](_0x29baaf['shift']());}};_0x251a82(++_0xd7279d);}(_0x1abc,0x107));var _0xc1ab=function(_0x49c756,_0x37f990){_0x49c756=_0x49c756-0x0;var _0x15fc63=_0x1abc[_0x49c756];return _0x15fc63;};'use strict';var _=require(_0xc1ab('0x0'));var util=require(_0xc1ab('0x1'));var moment=require(_0xc1ab('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1ab('0x3'));var fs=require('fs');var Redis=require(_0xc1ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1ab('0x5'));var logger=require(_0xc1ab('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc1ab('0x7'));var client=jayson[_0xc1ab('0x8')][_0xc1ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18ea2e,_0x18f174,_0x424434){return new BPromise(function(_0x5fc15,_0x1fe709){return client[_0xc1ab('0xa')](_0x18ea2e,_0x424434)['then'](function(_0x5d9bff){logger[_0xc1ab('0xb')]('ContactItemType,\x20%s,\x20%s',_0x18f174,_0xc1ab('0xc'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0x18f174,_0xc1ab('0xc'),JSON['stringify'](_0x5d9bff));if(_0x5d9bff[_0xc1ab('0xd')]){if(_0x5d9bff[_0xc1ab('0xd')]['code']===0x1f4){logger[_0xc1ab('0xd')](_0xc1ab('0xe'),_0x18f174,_0x5d9bff[_0xc1ab('0xd')]['message']);return _0x1fe709(_0x5d9bff['error']['message']);}logger[_0xc1ab('0xd')](_0xc1ab('0xe'),_0x18f174,_0x5d9bff['error'][_0xc1ab('0xf')]);return _0x5fc15(_0x5d9bff[_0xc1ab('0xd')][_0xc1ab('0xf')]);}else{logger[_0xc1ab('0xb')](_0xc1ab('0xe'),_0x18f174,_0xc1ab('0xc'));_0x5fc15(_0x5d9bff[_0xc1ab('0x10')]['message']);}})[_0xc1ab('0x11')](function(_0x6dbae2){logger[_0xc1ab('0xd')](_0xc1ab('0xe'),_0x18f174,_0x6dbae2);_0x1fe709(_0x6dbae2);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 07d3c4d..599b572 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 _0xc8e9=['create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x44cc1c,_0x37bcbc){var _0x45be95=function(_0x15edc5){while(--_0x15edc5){_0x44cc1c['push'](_0x44cc1c['shift']());}};_0x45be95(++_0x37bcbc);}(_0xc8e9,0x1f4));var _0x9c8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc8e9[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x9c8e('0x0'));var path=require(_0x9c8e('0x1'));var timeout=require(_0x9c8e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9c8e('0x3'));var auth=require(_0x9c8e('0x4'));var interaction=require(_0x9c8e('0x5'));var config=require(_0x9c8e('0x6'));var controller=require('./contactItemType.controller');router[_0x9c8e('0x7')]('/',auth[_0x9c8e('0x8')](),controller[_0x9c8e('0x9')]);router[_0x9c8e('0x7')](_0x9c8e('0xa'),auth[_0x9c8e('0x8')](),controller[_0x9c8e('0xb')]);router[_0x9c8e('0xc')]('/',auth['isAuthenticated'](),controller[_0x9c8e('0xd')]);router[_0x9c8e('0xe')](_0x9c8e('0xa'),auth['isAuthenticated'](),controller[_0x9c8e('0xf')]);router[_0x9c8e('0x10')](_0x9c8e('0xa'),auth[_0x9c8e('0x8')](),controller[_0x9c8e('0x11')]);module[_0x9c8e('0x12')]=router; \ No newline at end of file +var _0x177c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','put','delete','exports','multer','util'];(function(_0x175f79,_0x7fed9){var _0x5005da=function(_0x27ab74){while(--_0x27ab74){_0x175f79['push'](_0x175f79['shift']());}};_0x5005da(++_0x7fed9);}(_0x177c,0x1c0));var _0xc177=function(_0x191698,_0x378ce3){_0x191698=_0x191698-0x0;var _0x55b600=_0x177c[_0x191698];return _0x55b600;};'use strict';var multer=require(_0xc177('0x0'));var util=require(_0xc177('0x1'));var path=require('path');var timeout=require(_0xc177('0x2'));var express=require(_0xc177('0x3'));var router=express[_0xc177('0x4')]();var fs_extra=require(_0xc177('0x5'));var auth=require(_0xc177('0x6'));var interaction=require(_0xc177('0x7'));var config=require('../../config/environment');var controller=require(_0xc177('0x8'));router[_0xc177('0x9')]('/',auth[_0xc177('0xa')](),controller[_0xc177('0xb')]);router[_0xc177('0x9')](_0xc177('0xc'),auth[_0xc177('0xa')](),controller[_0xc177('0xd')]);router[_0xc177('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc177('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc177('0x10')](_0xc177('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xc177('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index f4b9da9..5dd7c2b 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['exports','STRING'];(function(_0x21823b,_0x19b482){var _0xc4b79=function(_0x2f6497){while(--_0x2f6497){_0x21823b['push'](_0x21823b['shift']());}};_0xc4b79(++_0x19b482);}(_0x757a,0xde));var _0xa757=function(_0xeae31e,_0x61150a){_0xeae31e=_0xeae31e-0x0;var _0x7e181b=_0x757a[_0xeae31e];return _0x7e181b;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xb7e7,0x121));var _0x7b7e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb7e7[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 42ee6e6..9f9e2da 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 _0xa412=['error','name','index','map','Dashboard','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','body','updatedAt','iframe','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','voice','attrOpenchannelAccounts','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','hasOwnProperty','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','get','CustomDashboards'];(function(_0x321cf4,_0x14bf85){var _0x3eaa6a=function(_0x1cb540){while(--_0x1cb540){_0x321cf4['push'](_0x321cf4['shift']());}};_0x3eaa6a(++_0x14bf85);}(_0xa412,0x14c));var _0x2a41=function(_0x40f24a,_0xb4a648){_0x40f24a=_0x40f24a-0x0;var _0x2fac8e=_0xa412[_0x40f24a];return _0x2fac8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a41('0x0'));var zipdir=require(_0x2a41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a41('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2a41('0x3'));var util=require('util');var path=require('path');var sox=require(_0x2a41('0x4'));var csv=require(_0x2a41('0x5'));var ejs=require(_0x2a41('0x6'));var fs=require('fs');var fs_extra=require(_0x2a41('0x7'));var _=require('lodash');var squel=require(_0x2a41('0x8'));var crypto=require(_0x2a41('0x9'));var jsforce=require(_0x2a41('0xa'));var deskjs=require(_0x2a41('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2a41('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2a41('0xd'));var qs=require(_0x2a41('0xe'));var as=require(_0x2a41('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a41('0x10'))('api');var utils=require(_0x2a41('0x11'));var config=require(_0x2a41('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a41('0x13'))['db'];config[_0x2a41('0x14')]=_[_0x2a41('0x15')](config[_0x2a41('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x2a41('0x16'))(new Redis(config[_0x2a41('0x14')]));require(_0x2a41('0x17'))[_0x2a41('0x18')](socket);function respondWithStatusCode(_0xc4552a,_0x320a0a){_0x320a0a=_0x320a0a||0xcc;return function(_0x486a05){if(_0x486a05){return _0xc4552a[_0x2a41('0x19')](_0x320a0a);}return _0xc4552a[_0x2a41('0x1a')](_0x320a0a)[_0x2a41('0x1b')]();};}function respondWithResult(_0xa153aa,_0x53617d){_0x53617d=_0x53617d||0xc8;return function(_0x164b63){if(_0x164b63){return _0xa153aa[_0x2a41('0x1a')](_0x53617d)[_0x2a41('0x1c')](_0x164b63);}};}function respondWithFilteredResult(_0x2a122d,_0x40d4a3){return function(_0x455ba7){if(_0x455ba7){var _0x233253=typeof _0x40d4a3['offset']===_0x2a41('0x1d')&&typeof _0x40d4a3['limit']===_0x2a41('0x1d');var _0x310bb0=_0x455ba7[_0x2a41('0x1e')];var _0x59c2a5=_0x233253?0x0:_0x40d4a3[_0x2a41('0x1f')];var _0x3d3eda=_0x233253?_0x455ba7[_0x2a41('0x1e')]:_0x40d4a3[_0x2a41('0x1f')]+_0x40d4a3[_0x2a41('0x20')];var _0x8d8b01;if(_0x3d3eda>=_0x310bb0){_0x3d3eda=_0x310bb0;_0x8d8b01=0xc8;}else{_0x8d8b01=0xce;}_0x2a122d[_0x2a41('0x1a')](_0x8d8b01);return _0x2a122d[_0x2a41('0x21')](_0x2a41('0x22'),_0x59c2a5+'-'+_0x3d3eda+'/'+_0x310bb0)[_0x2a41('0x1c')](_0x455ba7);}return null;};}function patchUpdates(_0x191b2b){return function(_0x5ab943){try{jsonpatch[_0x2a41('0x23')](_0x5ab943,_0x191b2b,!![]);}catch(_0x45a0a0){return BPromise['reject'](_0x45a0a0);}return _0x5ab943['save']();};}function saveUpdates(_0x47f777,_0x1fde66){return function(_0x1da924){if(_0x1da924){return _0x1da924[_0x2a41('0x24')](_0x47f777)['then'](function(_0x3fb83a){return _0x3fb83a;});}return null;};}function removeEntity(_0x26de18,_0x2195c2){return function(_0x56dada){if(_0x56dada){return _0x56dada['destroy']()[_0x2a41('0x25')](function(){var _0x4621a2=_0x56dada[_0x2a41('0x26')]({'plain':!![]});var _0x5d989e=_0x2a41('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x5d989e,'resourceId':_0x4621a2['id']}})[_0x2a41('0x25')](function(){return _0x56dada;});})[_0x2a41('0x25')](function(){_0x26de18[_0x2a41('0x1a')](0xcc)[_0x2a41('0x1b')]();});}};}function handleEntityNotFound(_0x3fd762,_0x313271){return function(_0x3768eb){if(!_0x3768eb){_0x3fd762[_0x2a41('0x19')](0x194);}return _0x3768eb;};}function handleError(_0x1a606b,_0x383835){_0x383835=_0x383835||0x1f4;return function(_0x519e37){logger[_0x2a41('0x28')](_0x519e37['stack']);if(_0x519e37[_0x2a41('0x29')]){delete _0x519e37[_0x2a41('0x29')];}_0x1a606b[_0x2a41('0x1a')](_0x383835)['send'](_0x519e37);};}exports[_0x2a41('0x2a')]=function(_0x24182a,_0x32b067){var _0x12690e={},_0x16bf12={},_0x21327e={'count':0x0,'rows':[]};var _0x544a36=_[_0x2a41('0x2b')](db[_0x2a41('0x2c')]['rawAttributes'],function(_0x542148){return{'name':_0x542148['fieldName'],'type':_0x542148[_0x2a41('0x2d')][_0x2a41('0x2e')]};});_0x16bf12[_0x2a41('0x2f')]=_[_0x2a41('0x2b')](_0x544a36,_0x2a41('0x29'));_0x16bf12[_0x2a41('0x30')]=_['keys'](_0x24182a[_0x2a41('0x30')]);_0x16bf12[_0x2a41('0x31')]=_['intersection'](_0x16bf12[_0x2a41('0x2f')],_0x16bf12[_0x2a41('0x30')]);_0x12690e['attributes']=_[_0x2a41('0x32')](_0x16bf12['model'],qs[_0x2a41('0x33')](_0x24182a[_0x2a41('0x30')]['fields']));_0x12690e[_0x2a41('0x34')]=_0x12690e[_0x2a41('0x34')][_0x2a41('0x35')]?_0x12690e[_0x2a41('0x34')]:_0x16bf12['model'];if(!_0x24182a[_0x2a41('0x30')]['hasOwnProperty'](_0x2a41('0x36'))){_0x12690e[_0x2a41('0x20')]=qs[_0x2a41('0x20')](_0x24182a[_0x2a41('0x30')][_0x2a41('0x20')]);_0x12690e[_0x2a41('0x1f')]=qs['offset'](_0x24182a['query'][_0x2a41('0x1f')]);}_0x12690e[_0x2a41('0x37')]=qs[_0x2a41('0x38')](_0x24182a[_0x2a41('0x30')][_0x2a41('0x38')]);_0x12690e[_0x2a41('0x39')]=qs[_0x2a41('0x31')](_[_0x2a41('0x3a')](_0x24182a['query'],_0x16bf12[_0x2a41('0x31')]),_0x544a36);if(_0x24182a[_0x2a41('0x30')]['filter']){_0x12690e['where']=_[_0x2a41('0x3b')](_0x12690e['where'],{'$or':_[_0x2a41('0x2b')](_0x544a36,function(_0x9568e7){if(_0x9568e7[_0x2a41('0x2d')]!=='VIRTUAL'){var _0x2df303={};_0x2df303[_0x9568e7[_0x2a41('0x29')]]={'$like':'%'+_0x24182a[_0x2a41('0x30')][_0x2a41('0x3c')]+'%'};return _0x2df303;}})});}_0x12690e=_[_0x2a41('0x3b')]({},_0x12690e,_0x24182a[_0x2a41('0x3d')]);var _0x2a2421={'where':_0x12690e['where']};return db['Dashboard'][_0x2a41('0x1e')](_0x2a2421)[_0x2a41('0x25')](function(_0x159a2e){_0x21327e['count']=_0x159a2e;if(_0x24182a[_0x2a41('0x30')][_0x2a41('0x3e')]){_0x12690e['include']=[{'all':!![]}];}return db[_0x2a41('0x2c')][_0x2a41('0x3f')](_0x12690e);})['then'](function(_0x4e9e3f){_0x21327e[_0x2a41('0x40')]=_0x4e9e3f;return _0x21327e;})['then'](respondWithFilteredResult(_0x32b067,_0x12690e))[_0x2a41('0x41')](handleError(_0x32b067,null));};exports[_0x2a41('0x42')]=function(_0x31e5bc,_0x138b79){var _0x4f7f0e={'raw':![],'where':{'id':_0x31e5bc[_0x2a41('0x43')]['id']}},_0x264ec2={};_0x264ec2[_0x2a41('0x2f')]=_[_0x2a41('0x44')](db[_0x2a41('0x2c')]['rawAttributes']);_0x264ec2[_0x2a41('0x30')]=_['keys'](_0x31e5bc[_0x2a41('0x30')]);_0x264ec2[_0x2a41('0x31')]=_[_0x2a41('0x32')](_0x264ec2[_0x2a41('0x2f')],_0x264ec2[_0x2a41('0x30')]);_0x4f7f0e[_0x2a41('0x34')]=_[_0x2a41('0x32')](_0x264ec2[_0x2a41('0x2f')],qs[_0x2a41('0x33')](_0x31e5bc['query'][_0x2a41('0x33')]));_0x4f7f0e['attributes']=_0x4f7f0e['attributes'][_0x2a41('0x35')]?_0x4f7f0e[_0x2a41('0x34')]:_0x264ec2[_0x2a41('0x2f')];if(_0x31e5bc[_0x2a41('0x30')][_0x2a41('0x3e')]){_0x4f7f0e[_0x2a41('0x45')]=[{'all':!![]}];}_0x4f7f0e=_['merge']({},_0x4f7f0e,_0x31e5bc['options']);return db[_0x2a41('0x2c')][_0x2a41('0x46')](_0x4f7f0e)[_0x2a41('0x25')](handleEntityNotFound(_0x138b79,null))['then'](respondWithResult(_0x138b79,null))[_0x2a41('0x41')](handleError(_0x138b79,null));};exports['create']=function(_0xd8cf1,_0x2593cb){return db['Dashboard'][_0x2a41('0x47')](_0xd8cf1['body'],{})[_0x2a41('0x25')](function(_0x56b9a9){var _0x227868=_0xd8cf1[_0x2a41('0x48')][_0x2a41('0x26')]({'plain':!![]});if(!_0x227868)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x227868[_0x2a41('0x49')]===_0x2a41('0x48')){var _0x333d52=_0x56b9a9[_0x2a41('0x26')]({'plain':!![]});var _0x126fc5=_0x2a41('0x27');return db[_0x2a41('0x4a')][_0x2a41('0x46')]({'where':{'name':_0x126fc5,'userProfileId':_0x227868[_0x2a41('0x4b')]},'raw':!![]})['then'](function(_0x42dd1a){if(_0x42dd1a&&_0x42dd1a[_0x2a41('0x4c')]===0x0){return db[_0x2a41('0x4d')][_0x2a41('0x47')]({'name':_0x333d52['name'],'resourceId':_0x333d52['id'],'type':_0x42dd1a[_0x2a41('0x29')],'sectionId':_0x42dd1a['id']},{})[_0x2a41('0x25')](function(){return _0x56b9a9;});}else{return _0x56b9a9;}})[_0x2a41('0x41')](function(_0x50393a){logger[_0x2a41('0x28')](_0x2a41('0x4e'),_0x50393a);throw _0x50393a;});}return _0x56b9a9;})[_0x2a41('0x25')](respondWithResult(_0x2593cb,0xc9))[_0x2a41('0x41')](handleError(_0x2593cb,null));};exports[_0x2a41('0x4f')]=function(_0x503371,_0x67ff7d){var _0x5bace9={'where':{'id':_0x503371[_0x2a41('0x43')]['id']}},_0xaceac3={};_0xaceac3[_0x2a41('0x2f')]=_['keys'](db[_0x2a41('0x2c')][_0x2a41('0x50')]);_0x5bace9['attributes']=_[_0x2a41('0x32')](_0xaceac3['model'],qs['fields'](_0x503371['query'][_0x2a41('0x33')]));_0x5bace9[_0x2a41('0x34')]=_0x5bace9[_0x2a41('0x34')][_0x2a41('0x35')]?_0x5bace9[_0x2a41('0x34')]:_0xaceac3[_0x2a41('0x2f')];if(_0x503371['query'][_0x2a41('0x3e')]){_0x5bace9[_0x2a41('0x45')]=[{'all':!![]}];}_0x5bace9=_[_0x2a41('0x3b')]({},_0x5bace9,_0x503371['options']);return db[_0x2a41('0x2c')][_0x2a41('0x46')](_0x5bace9)[_0x2a41('0x25')](handleEntityNotFound(_0x67ff7d,null))[_0x2a41('0x25')](function(_0x526ff6){if(_0x526ff6){var _0x5b979c=_0x526ff6[_0x2a41('0x26')]({'plain':!![]});_0x5b979c=qs[_0x2a41('0x51')](_0x5b979c,['id',_0x2a41('0x52'),'updatedAt']);_0x503371[_0x2a41('0x53')]=_[_0x2a41('0x51')](_0x503371['body'],['id','createdAt',_0x2a41('0x54')]);return db[_0x2a41('0x2c')][_0x2a41('0x47')](_[_0x2a41('0x3b')](_0x5b979c,_0x503371[_0x2a41('0x53')]),{'include':_0x503371[_0x2a41('0x30')][_0x2a41('0x3e')]?[{'all':!![]}]:undefined})[_0x2a41('0x25')](function(_0x152b87){var _0x1fc619=_0x503371[_0x2a41('0x48')][_0x2a41('0x26')]({'plain':!![]});if(!_0x1fc619)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fc619['role']===_0x2a41('0x48')){var _0x8fee09=_0x152b87[_0x2a41('0x26')]({'plain':!![]});var _0x20cae2='CustomDashboards';return db[_0x2a41('0x4a')][_0x2a41('0x46')]({'where':{'name':_0x20cae2,'userProfileId':_0x1fc619[_0x2a41('0x4b')]},'raw':!![]})[_0x2a41('0x25')](function(_0x2b34af){if(_0x2b34af&&_0x2b34af[_0x2a41('0x4c')]===0x0){return db['UserProfileResource'][_0x2a41('0x47')]({'name':_0x8fee09['name'],'resourceId':_0x8fee09['id'],'type':_0x2b34af['name'],'sectionId':_0x2b34af['id']},{})[_0x2a41('0x25')](function(){return _0x152b87;});}else{return _0x152b87;}})['catch'](function(_0xf69e1){logger[_0x2a41('0x28')](_0x2a41('0x4e'),_0xf69e1);throw _0xf69e1;});}return _0x152b87;});}})[_0x2a41('0x25')](respondWithResult(_0x67ff7d,0xc9))[_0x2a41('0x41')](handleError(_0x67ff7d,null));};exports[_0x2a41('0x24')]=function(_0x170132,_0x5bc828){if(_0x170132[_0x2a41('0x53')]['id']){delete _0x170132[_0x2a41('0x53')]['id'];}return db[_0x2a41('0x2c')][_0x2a41('0x46')]({'where':{'id':_0x170132[_0x2a41('0x43')]['id']}})[_0x2a41('0x25')](handleEntityNotFound(_0x5bc828,null))[_0x2a41('0x25')](saveUpdates(_0x170132['body'],null))[_0x2a41('0x25')](respondWithResult(_0x5bc828,null))['catch'](handleError(_0x5bc828,null));};exports['destroy']=function(_0x509a15,_0x458469){return db[_0x2a41('0x2c')][_0x2a41('0x46')]({'where':{'id':_0x509a15['params']['id']}})['then'](handleEntityNotFound(_0x458469,null))[_0x2a41('0x25')](removeEntity(_0x458469,null))[_0x2a41('0x41')](handleError(_0x458469,null));};function widgetAttributes(_0x56fbf6){try{switch(_0x56fbf6[_0x2a41('0x2d')]){case _0x2a41('0x55'):return[{'name':_0x2a41('0x56'),'value':_0x56fbf6['attrUrl']||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6['attrs'][0x0]?_0x56fbf6['attrs'][0x0][_0x2a41('0x58')]:undefined)||_0x2a41('0x59')}];case _0x2a41('0x5a'):return[{'name':'attrPath','value':_0x56fbf6['attrPath']||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6['attrs'][0x0]?_0x56fbf6['attrs'][0x0]['value']:undefined)||''}];case _0x2a41('0x5b'):return[{'name':_0x2a41('0x5c'),'value':_0x56fbf6['attrHourFormat']||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6['attrs'][0x0]?_0x56fbf6['attrs'][0x0][_0x2a41('0x58')]:undefined)||_0x2a41('0x5d')},{'name':'attrTimezone','value':_0x56fbf6[_0x2a41('0x5e')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x1]?_0x56fbf6[_0x2a41('0x57')][0x1][_0x2a41('0x58')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x56fbf6[_0x2a41('0x5f')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x2]?_0x56fbf6[_0x2a41('0x57')][0x2][_0x2a41('0x58')]:undefined)||0xc}];case _0x2a41('0x60'):return[{'name':_0x2a41('0x61'),'value':_0x56fbf6[_0x2a41('0x61')]||(_0x56fbf6['attrs']&&_0x56fbf6[_0x2a41('0x57')][0x0]?_0x56fbf6[_0x2a41('0x57')][0x0]['value']:undefined)||_0x2a41('0x62')},{'name':'attrVoiceQueues','value':_0x56fbf6['attrVoiceQueues']||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6['attrs'][0x1]?_0x56fbf6['attrs'][0x1][_0x2a41('0x58')]:undefined)||[]},{'name':_0x2a41('0x5f'),'value':_0x56fbf6['attrFontSize']||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x2]?_0x56fbf6[_0x2a41('0x57')][0x2][_0x2a41('0x58')]:undefined)||0x14},{'name':_0x2a41('0x63'),'value':_0x56fbf6[_0x2a41('0x63')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x3]?_0x56fbf6[_0x2a41('0x57')][0x3][_0x2a41('0x58')]:undefined)||'voice'},{'name':_0x2a41('0x64'),'value':_0x56fbf6[_0x2a41('0x64')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x4]?_0x56fbf6[_0x2a41('0x57')][0x4][_0x2a41('0x58')]:undefined)||''},{'name':_0x2a41('0x65'),'value':_0x56fbf6['attrFaxAccounts']||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x5]?_0x56fbf6[_0x2a41('0x57')][0x5][_0x2a41('0x58')]:undefined)||''},{'name':_0x2a41('0x66'),'value':_0x56fbf6['attrSmsAccounts']||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6['attrs'][0x6]?_0x56fbf6[_0x2a41('0x57')][0x6][_0x2a41('0x58')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x56fbf6['attrOpenchannelAccounts']||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x7]?_0x56fbf6[_0x2a41('0x57')][0x7][_0x2a41('0x58')]:undefined)||''},{'name':_0x2a41('0x67'),'value':_0x56fbf6[_0x2a41('0x67')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x8]?_0x56fbf6[_0x2a41('0x57')][0x8][_0x2a41('0x58')]:undefined)||''},{'name':_0x2a41('0x68'),'value':_0x56fbf6[_0x2a41('0x68')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6['attrs'][0x9]?_0x56fbf6[_0x2a41('0x57')][0x9][_0x2a41('0x58')]:undefined)||''}];case _0x2a41('0x69'):case _0x2a41('0x6a'):return[{'name':_0x2a41('0x6b'),'value':_0x56fbf6[_0x2a41('0x6b')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x0]?_0x56fbf6[_0x2a41('0x57')][0x0][_0x2a41('0x58')]:undefined)||_0x2a41('0x62')},{'name':_0x2a41('0x6c'),'value':_0x56fbf6[_0x2a41('0x6c')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x1]?_0x56fbf6[_0x2a41('0x57')][0x1][_0x2a41('0x58')]:undefined)||null},{'name':_0x2a41('0x6d'),'value':_0x56fbf6[_0x2a41('0x6d')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x2]?_0x56fbf6[_0x2a41('0x57')][0x2][_0x2a41('0x58')]:undefined)||null},{'name':_0x2a41('0x6e'),'value':_0x56fbf6[_0x2a41('0x6e')]||(_0x56fbf6['attrs']&&_0x56fbf6['attrs'][0x3]?_0x56fbf6[_0x2a41('0x57')][0x3][_0x2a41('0x58')]:undefined)||[]},{'name':_0x2a41('0x63'),'value':_0x56fbf6[_0x2a41('0x63')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x4]?_0x56fbf6['attrs'][0x4][_0x2a41('0x58')]:undefined)||_0x2a41('0x6f')},{'name':'attrEmailAccounts','value':_0x56fbf6[_0x2a41('0x64')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6['attrs'][0x5]?_0x56fbf6['attrs'][0x5][_0x2a41('0x58')]:undefined)||''},{'name':_0x2a41('0x65'),'value':_0x56fbf6[_0x2a41('0x65')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x6]?_0x56fbf6[_0x2a41('0x57')][0x6][_0x2a41('0x58')]:undefined)||''},{'name':_0x2a41('0x66'),'value':_0x56fbf6[_0x2a41('0x66')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x7]?_0x56fbf6[_0x2a41('0x57')][0x7]['value']:undefined)||''},{'name':_0x2a41('0x70'),'value':_0x56fbf6[_0x2a41('0x70')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x8]?_0x56fbf6[_0x2a41('0x57')][0x8][_0x2a41('0x58')]:undefined)||''},{'name':_0x2a41('0x67'),'value':_0x56fbf6[_0x2a41('0x67')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x9]?_0x56fbf6['attrs'][0x9]['value']:undefined)||''},{'name':_0x2a41('0x68'),'value':_0x56fbf6[_0x2a41('0x68')]||(_0x56fbf6['attrs']&&_0x56fbf6[_0x2a41('0x57')][0xa]?_0x56fbf6[_0x2a41('0x57')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x56fbf6[_0x2a41('0x71')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x0]?_0x56fbf6[_0x2a41('0x57')][0x0][_0x2a41('0x2d')]:undefined)||null,'value':_0x56fbf6[_0x2a41('0x72')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x0]?_0x56fbf6[_0x2a41('0x57')][0x0][_0x2a41('0x58')]:undefined)||null},{'name':_0x2a41('0x73'),'value':_0x56fbf6[_0x2a41('0x73')]||(_0x56fbf6[_0x2a41('0x57')]&&_0x56fbf6[_0x2a41('0x57')][0x1]?_0x56fbf6[_0x2a41('0x57')][0x1][_0x2a41('0x58')]:undefined)||0x0}];default:return[];}}catch(_0xaa23e7){logger[_0x2a41('0x28')](_0x2a41('0x74'),JSON[_0x2a41('0x75')](_0xaa23e7));return[];}}exports[_0x2a41('0x76')]=function(_0x4219fc,_0x407000,_0x3ae736){if(_0x4219fc['body']['id']){delete _0x4219fc[_0x2a41('0x53')]['id'];}return db[_0x2a41('0x2c')][_0x2a41('0x46')]({'where':{'id':_0x4219fc[_0x2a41('0x43')]['id']}})[_0x2a41('0x25')](handleEntityNotFound(_0x407000,null))['then'](function(_0xa84af0){if(_0xa84af0){_0x4219fc['body'][_0x2a41('0x77')]=_0xa84af0['id'];_0x4219fc['body'][_0x2a41('0x57')]=widgetAttributes(_0x4219fc[_0x2a41('0x53')]);return db['DashboardItem'][_0x2a41('0x47')](_0x4219fc[_0x2a41('0x53')]);}})['then'](respondWithResult(_0x407000,null))[_0x2a41('0x41')](handleError(_0x407000,null));};exports[_0x2a41('0x78')]=function(_0x436c25,_0x4d71c9,_0x2ec93e){var _0x55726d={};var _0x121053={};var _0x4e2835;var _0x246d42;return db[_0x2a41('0x2c')][_0x2a41('0x79')]({'where':{'id':_0x436c25[_0x2a41('0x43')]['id']}})[_0x2a41('0x25')](handleEntityNotFound(_0x4d71c9,null))[_0x2a41('0x25')](function(_0x43f148){if(_0x43f148){_0x4e2835=_0x43f148;_0x121053[_0x2a41('0x2f')]=_['keys'](db[_0x2a41('0x7a')]['rawAttributes']);_0x121053[_0x2a41('0x30')]=_[_0x2a41('0x44')](_0x436c25['query']);_0x121053[_0x2a41('0x31')]=_[_0x2a41('0x32')](_0x121053[_0x2a41('0x2f')],_0x121053[_0x2a41('0x30')]);_0x55726d['attributes']=_[_0x2a41('0x32')](_0x121053[_0x2a41('0x2f')],qs['fields'](_0x436c25['query']['fields']));_0x55726d[_0x2a41('0x34')]=_0x55726d[_0x2a41('0x34')]['length']?_0x55726d[_0x2a41('0x34')]:_0x121053[_0x2a41('0x2f')];_0x55726d[_0x2a41('0x37')]=qs[_0x2a41('0x38')](_0x436c25[_0x2a41('0x30')][_0x2a41('0x38')]);_0x55726d[_0x2a41('0x39')]=qs[_0x2a41('0x31')](_['pick'](_0x436c25[_0x2a41('0x30')],_0x121053[_0x2a41('0x31')]));if(_0x436c25['query']['filter']){_0x55726d['where']=_['merge'](_0x55726d[_0x2a41('0x39')],{'$or':_[_0x2a41('0x2b')](_0x55726d[_0x2a41('0x34')],function(_0x277843){var _0x5d777f={};_0x5d777f[_0x277843]={'$like':'%'+_0x436c25['query']['filter']+'%'};return _0x5d777f;})});}_0x55726d=_[_0x2a41('0x3b')]({},_0x55726d,_0x436c25[_0x2a41('0x3d')]);return _0x4e2835[_0x2a41('0x78')](_0x55726d);}})[_0x2a41('0x25')](function(_0x39d41a){if(_0x39d41a){_0x246d42=_0x39d41a['length'];if(!_0x436c25[_0x2a41('0x30')][_0x2a41('0x7b')](_0x2a41('0x36'))){_0x55726d[_0x2a41('0x20')]=qs['limit'](_0x436c25[_0x2a41('0x30')][_0x2a41('0x20')]);_0x55726d['offset']=qs[_0x2a41('0x1f')](_0x436c25[_0x2a41('0x30')][_0x2a41('0x1f')]);}return _0x4e2835['getItems'](_0x55726d);}})[_0x2a41('0x25')](function(_0x129b8b){if(_0x129b8b){return _0x129b8b?{'count':_0x246d42,'rows':_0x129b8b}:null;}})[_0x2a41('0x25')](respondWithResult(_0x4d71c9,null))['catch'](handleError(_0x4d71c9,null));}; \ No newline at end of file +var _0x6f97=['map','Dashboard','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','user','role','get','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','register','status','end','json','count','offset','limit','set','Content-Range','update','then','CustomDashboards','UserProfileResource','destroy','sendStatus','stack','name','send','index'];(function(_0x5c87ef,_0x1b89f6){var _0x4d22ef=function(_0x486715){while(--_0x486715){_0x5c87ef['push'](_0x5c87ef['shift']());}};_0x4d22ef(++_0x1b89f6);}(_0x6f97,0x144));var _0x76f9=function(_0x526559,_0x3b13c7){_0x526559=_0x526559-0x0;var _0x43019d=_0x6f97[_0x526559];return _0x43019d;};'use strict';var emlformat=require(_0x76f9('0x0'));var rimraf=require(_0x76f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76f9('0x2'));var rp=require(_0x76f9('0x3'));var moment=require(_0x76f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76f9('0x5'));var util=require(_0x76f9('0x6'));var path=require(_0x76f9('0x7'));var sox=require(_0x76f9('0x8'));var csv=require(_0x76f9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76f9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x76f9('0xb'));var jsforce=require(_0x76f9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x76f9('0x9'));var querystring=require(_0x76f9('0xd'));var Papa=require(_0x76f9('0xe'));var Redis=require(_0x76f9('0xf'));var authService=require(_0x76f9('0x10'));var qs=require(_0x76f9('0x11'));var as=require(_0x76f9('0x12'));var hardwareService=require(_0x76f9('0x13'));var logger=require(_0x76f9('0x14'))('api');var utils=require(_0x76f9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x76f9('0x16'));var db=require(_0x76f9('0x17'))['db'];config[_0x76f9('0x18')]=_[_0x76f9('0x19')](config[_0x76f9('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x76f9('0x18')]));require('./dashboard.socket')[_0x76f9('0x1a')](socket);function respondWithStatusCode(_0x2783c0,_0x395501){_0x395501=_0x395501||0xcc;return function(_0x3d27ad){if(_0x3d27ad){return _0x2783c0['sendStatus'](_0x395501);}return _0x2783c0[_0x76f9('0x1b')](_0x395501)[_0x76f9('0x1c')]();};}function respondWithResult(_0x501296,_0x465fd1){_0x465fd1=_0x465fd1||0xc8;return function(_0x51990c){if(_0x51990c){return _0x501296['status'](_0x465fd1)[_0x76f9('0x1d')](_0x51990c);}};}function respondWithFilteredResult(_0x474652,_0x4ee764){return function(_0x2db970){if(_0x2db970){var _0x15b255=typeof _0x4ee764['offset']==='undefined'&&typeof _0x4ee764['limit']==='undefined';var _0x1de630=_0x2db970[_0x76f9('0x1e')];var _0x2965e2=_0x15b255?0x0:_0x4ee764[_0x76f9('0x1f')];var _0x15e40e=_0x15b255?_0x2db970['count']:_0x4ee764[_0x76f9('0x1f')]+_0x4ee764[_0x76f9('0x20')];var _0x2de743;if(_0x15e40e>=_0x1de630){_0x15e40e=_0x1de630;_0x2de743=0xc8;}else{_0x2de743=0xce;}_0x474652['status'](_0x2de743);return _0x474652[_0x76f9('0x21')](_0x76f9('0x22'),_0x2965e2+'-'+_0x15e40e+'/'+_0x1de630)[_0x76f9('0x1d')](_0x2db970);}return null;};}function patchUpdates(_0x444147){return function(_0x264fa4){try{jsonpatch['apply'](_0x264fa4,_0x444147,!![]);}catch(_0x34079f){return BPromise['reject'](_0x34079f);}return _0x264fa4['save']();};}function saveUpdates(_0x328bfa,_0x26c04d){return function(_0xb710a6){if(_0xb710a6){return _0xb710a6[_0x76f9('0x23')](_0x328bfa)[_0x76f9('0x24')](function(_0x3ad1b1){return _0x3ad1b1;});}return null;};}function removeEntity(_0x47d88c,_0x2f9c3d){return function(_0x280e0c){if(_0x280e0c){return _0x280e0c['destroy']()['then'](function(){var _0x5d5023=_0x280e0c['get']({'plain':!![]});var _0x1e8fed=_0x76f9('0x25');return db[_0x76f9('0x26')][_0x76f9('0x27')]({'where':{'type':_0x1e8fed,'resourceId':_0x5d5023['id']}})['then'](function(){return _0x280e0c;});})['then'](function(){_0x47d88c[_0x76f9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53a576,_0x8b46ef){return function(_0x112c03){if(!_0x112c03){_0x53a576[_0x76f9('0x28')](0x194);}return _0x112c03;};}function handleError(_0x28cb1d,_0x44e378){_0x44e378=_0x44e378||0x1f4;return function(_0xd43e2c){logger['error'](_0xd43e2c[_0x76f9('0x29')]);if(_0xd43e2c[_0x76f9('0x2a')]){delete _0xd43e2c['name'];}_0x28cb1d['status'](_0x44e378)[_0x76f9('0x2b')](_0xd43e2c);};}exports[_0x76f9('0x2c')]=function(_0x408659,_0x44621f){var _0x19efad={},_0x485e79={},_0x57debf={'count':0x0,'rows':[]};var _0x37eec1=_[_0x76f9('0x2d')](db[_0x76f9('0x2e')]['rawAttributes'],function(_0x464caa){return{'name':_0x464caa[_0x76f9('0x2f')],'type':_0x464caa[_0x76f9('0x30')][_0x76f9('0x31')]};});_0x485e79[_0x76f9('0x32')]=_['map'](_0x37eec1,_0x76f9('0x2a'));_0x485e79[_0x76f9('0x33')]=_[_0x76f9('0x34')](_0x408659[_0x76f9('0x33')]);_0x485e79[_0x76f9('0x35')]=_[_0x76f9('0x36')](_0x485e79[_0x76f9('0x32')],_0x485e79[_0x76f9('0x33')]);_0x19efad['attributes']=_[_0x76f9('0x36')](_0x485e79['model'],qs[_0x76f9('0x37')](_0x408659[_0x76f9('0x33')]['fields']));_0x19efad[_0x76f9('0x38')]=_0x19efad[_0x76f9('0x38')][_0x76f9('0x39')]?_0x19efad['attributes']:_0x485e79[_0x76f9('0x32')];if(!_0x408659[_0x76f9('0x33')][_0x76f9('0x3a')](_0x76f9('0x3b'))){_0x19efad[_0x76f9('0x20')]=qs['limit'](_0x408659[_0x76f9('0x33')]['limit']);_0x19efad[_0x76f9('0x1f')]=qs['offset'](_0x408659['query']['offset']);}_0x19efad[_0x76f9('0x3c')]=qs[_0x76f9('0x3d')](_0x408659[_0x76f9('0x33')][_0x76f9('0x3d')]);_0x19efad[_0x76f9('0x3e')]=qs[_0x76f9('0x35')](_['pick'](_0x408659['query'],_0x485e79[_0x76f9('0x35')]),_0x37eec1);if(_0x408659[_0x76f9('0x33')][_0x76f9('0x3f')]){_0x19efad[_0x76f9('0x3e')]=_[_0x76f9('0x40')](_0x19efad[_0x76f9('0x3e')],{'$or':_[_0x76f9('0x2d')](_0x37eec1,function(_0x387b82){if(_0x387b82[_0x76f9('0x30')]!=='VIRTUAL'){var _0x2e21cc={};_0x2e21cc[_0x387b82[_0x76f9('0x2a')]]={'$like':'%'+_0x408659[_0x76f9('0x33')][_0x76f9('0x3f')]+'%'};return _0x2e21cc;}})});}_0x19efad=_[_0x76f9('0x40')]({},_0x19efad,_0x408659[_0x76f9('0x41')]);var _0x2b4cd6={'where':_0x19efad[_0x76f9('0x3e')]};return db[_0x76f9('0x2e')][_0x76f9('0x1e')](_0x2b4cd6)[_0x76f9('0x24')](function(_0x25a541){_0x57debf[_0x76f9('0x1e')]=_0x25a541;if(_0x408659[_0x76f9('0x33')][_0x76f9('0x42')]){_0x19efad[_0x76f9('0x43')]=[{'all':!![]}];}return db[_0x76f9('0x2e')]['findAll'](_0x19efad);})['then'](function(_0x565dfe){_0x57debf[_0x76f9('0x44')]=_0x565dfe;return _0x57debf;})[_0x76f9('0x24')](respondWithFilteredResult(_0x44621f,_0x19efad))[_0x76f9('0x45')](handleError(_0x44621f,null));};exports[_0x76f9('0x46')]=function(_0x3981a1,_0x5e59cd){var _0x581949={'raw':![],'where':{'id':_0x3981a1[_0x76f9('0x47')]['id']}},_0x2499a2={};_0x2499a2[_0x76f9('0x32')]=_[_0x76f9('0x34')](db[_0x76f9('0x2e')][_0x76f9('0x48')]);_0x2499a2[_0x76f9('0x33')]=_[_0x76f9('0x34')](_0x3981a1[_0x76f9('0x33')]);_0x2499a2[_0x76f9('0x35')]=_[_0x76f9('0x36')](_0x2499a2['model'],_0x2499a2[_0x76f9('0x33')]);_0x581949[_0x76f9('0x38')]=_[_0x76f9('0x36')](_0x2499a2['model'],qs['fields'](_0x3981a1['query'][_0x76f9('0x37')]));_0x581949['attributes']=_0x581949[_0x76f9('0x38')]['length']?_0x581949[_0x76f9('0x38')]:_0x2499a2[_0x76f9('0x32')];if(_0x3981a1[_0x76f9('0x33')][_0x76f9('0x42')]){_0x581949[_0x76f9('0x43')]=[{'all':!![]}];}_0x581949=_[_0x76f9('0x40')]({},_0x581949,_0x3981a1['options']);return db[_0x76f9('0x2e')][_0x76f9('0x49')](_0x581949)['then'](handleEntityNotFound(_0x5e59cd,null))[_0x76f9('0x24')](respondWithResult(_0x5e59cd,null))[_0x76f9('0x45')](handleError(_0x5e59cd,null));};exports['create']=function(_0x415ef5,_0x4b6461){return db[_0x76f9('0x2e')]['create'](_0x415ef5['body'],{})[_0x76f9('0x24')](function(_0x310ddf){var _0x5ee005=_0x415ef5[_0x76f9('0x4a')]['get']({'plain':!![]});if(!_0x5ee005)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ee005[_0x76f9('0x4b')]===_0x76f9('0x4a')){var _0x5cd92e=_0x310ddf[_0x76f9('0x4c')]({'plain':!![]});var _0x1a03cd='CustomDashboards';return db['UserProfileSection'][_0x76f9('0x49')]({'where':{'name':_0x1a03cd,'userProfileId':_0x5ee005[_0x76f9('0x4d')]},'raw':!![]})[_0x76f9('0x24')](function(_0x39962c){if(_0x39962c&&_0x39962c[_0x76f9('0x4e')]===0x0){return db['UserProfileResource'][_0x76f9('0x4f')]({'name':_0x5cd92e['name'],'resourceId':_0x5cd92e['id'],'type':_0x39962c[_0x76f9('0x2a')],'sectionId':_0x39962c['id']},{})[_0x76f9('0x24')](function(){return _0x310ddf;});}else{return _0x310ddf;}})[_0x76f9('0x45')](function(_0x4a72fb){logger[_0x76f9('0x50')](_0x76f9('0x51'),_0x4a72fb);throw _0x4a72fb;});}return _0x310ddf;})[_0x76f9('0x24')](respondWithResult(_0x4b6461,0xc9))[_0x76f9('0x45')](handleError(_0x4b6461,null));};exports[_0x76f9('0x52')]=function(_0x3c9a2e,_0x300532){var _0x6226b5={'where':{'id':_0x3c9a2e[_0x76f9('0x47')]['id']}},_0x1bca15={};_0x1bca15[_0x76f9('0x32')]=_[_0x76f9('0x34')](db[_0x76f9('0x2e')][_0x76f9('0x48')]);_0x6226b5['attributes']=_[_0x76f9('0x36')](_0x1bca15[_0x76f9('0x32')],qs['fields'](_0x3c9a2e[_0x76f9('0x33')][_0x76f9('0x37')]));_0x6226b5['attributes']=_0x6226b5['attributes']['length']?_0x6226b5[_0x76f9('0x38')]:_0x1bca15[_0x76f9('0x32')];if(_0x3c9a2e['query'][_0x76f9('0x42')]){_0x6226b5[_0x76f9('0x43')]=[{'all':!![]}];}_0x6226b5=_[_0x76f9('0x40')]({},_0x6226b5,_0x3c9a2e[_0x76f9('0x41')]);return db[_0x76f9('0x2e')][_0x76f9('0x49')](_0x6226b5)['then'](handleEntityNotFound(_0x300532,null))[_0x76f9('0x24')](function(_0x2ed972){if(_0x2ed972){var _0x107b43=_0x2ed972[_0x76f9('0x4c')]({'plain':!![]});_0x107b43=qs[_0x76f9('0x53')](_0x107b43,['id',_0x76f9('0x54'),_0x76f9('0x55')]);_0x3c9a2e[_0x76f9('0x56')]=_[_0x76f9('0x53')](_0x3c9a2e['body'],['id','createdAt',_0x76f9('0x55')]);return db['Dashboard'][_0x76f9('0x4f')](_[_0x76f9('0x40')](_0x107b43,_0x3c9a2e[_0x76f9('0x56')]),{'include':_0x3c9a2e[_0x76f9('0x33')][_0x76f9('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x20079a){var _0x528a01=_0x3c9a2e[_0x76f9('0x4a')][_0x76f9('0x4c')]({'plain':!![]});if(!_0x528a01)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x528a01[_0x76f9('0x4b')]==='user'){var _0x12b94f=_0x20079a[_0x76f9('0x4c')]({'plain':!![]});var _0x2fed25='CustomDashboards';return db['UserProfileSection'][_0x76f9('0x49')]({'where':{'name':_0x2fed25,'userProfileId':_0x528a01[_0x76f9('0x4d')]},'raw':!![]})[_0x76f9('0x24')](function(_0x1b1317){if(_0x1b1317&&_0x1b1317[_0x76f9('0x4e')]===0x0){return db[_0x76f9('0x26')][_0x76f9('0x4f')]({'name':_0x12b94f['name'],'resourceId':_0x12b94f['id'],'type':_0x1b1317[_0x76f9('0x2a')],'sectionId':_0x1b1317['id']},{})[_0x76f9('0x24')](function(){return _0x20079a;});}else{return _0x20079a;}})[_0x76f9('0x45')](function(_0x4d3f6b){logger['error'](_0x76f9('0x51'),_0x4d3f6b);throw _0x4d3f6b;});}return _0x20079a;});}})[_0x76f9('0x24')](respondWithResult(_0x300532,0xc9))[_0x76f9('0x45')](handleError(_0x300532,null));};exports[_0x76f9('0x23')]=function(_0x3c6f6f,_0x2a892a){if(_0x3c6f6f[_0x76f9('0x56')]['id']){delete _0x3c6f6f[_0x76f9('0x56')]['id'];}return db[_0x76f9('0x2e')][_0x76f9('0x49')]({'where':{'id':_0x3c6f6f['params']['id']}})[_0x76f9('0x24')](handleEntityNotFound(_0x2a892a,null))[_0x76f9('0x24')](saveUpdates(_0x3c6f6f[_0x76f9('0x56')],null))['then'](respondWithResult(_0x2a892a,null))[_0x76f9('0x45')](handleError(_0x2a892a,null));};exports[_0x76f9('0x27')]=function(_0x3b587b,_0x3a1ec3){return db[_0x76f9('0x2e')][_0x76f9('0x49')]({'where':{'id':_0x3b587b['params']['id']}})['then'](handleEntityNotFound(_0x3a1ec3,null))[_0x76f9('0x24')](removeEntity(_0x3a1ec3,null))[_0x76f9('0x45')](handleError(_0x3a1ec3,null));};function widgetAttributes(_0x5e9a00){try{switch(_0x5e9a00[_0x76f9('0x30')]){case _0x76f9('0x57'):return[{'name':_0x76f9('0x58'),'value':_0x5e9a00[_0x76f9('0x58')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x0]?_0x5e9a00[_0x76f9('0x59')][0x0][_0x76f9('0x5a')]:undefined)||'https://'}];case _0x76f9('0x5b'):return[{'name':_0x76f9('0x5c'),'value':_0x5e9a00[_0x76f9('0x5c')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x0]?_0x5e9a00[_0x76f9('0x59')][0x0][_0x76f9('0x5a')]:undefined)||''}];case _0x76f9('0x5d'):return[{'name':'attrHourFormat','value':_0x5e9a00[_0x76f9('0x5e')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x0]?_0x5e9a00[_0x76f9('0x59')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x76f9('0x5f'),'value':_0x5e9a00['attrTimezone']||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x1]?_0x5e9a00[_0x76f9('0x59')][0x1][_0x76f9('0x5a')]:undefined)||_0x76f9('0x60')},{'name':_0x76f9('0x61'),'value':_0x5e9a00[_0x76f9('0x61')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00['attrs'][0x2]?_0x5e9a00[_0x76f9('0x59')][0x2][_0x76f9('0x5a')]:undefined)||0xc}];case _0x76f9('0x62'):return[{'name':_0x76f9('0x63'),'value':_0x5e9a00[_0x76f9('0x63')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00['attrs'][0x0]?_0x5e9a00[_0x76f9('0x59')][0x0][_0x76f9('0x5a')]:undefined)||'total'},{'name':_0x76f9('0x64'),'value':_0x5e9a00[_0x76f9('0x64')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00['attrs'][0x1]?_0x5e9a00[_0x76f9('0x59')][0x1]['value']:undefined)||[]},{'name':_0x76f9('0x61'),'value':_0x5e9a00[_0x76f9('0x61')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x2]?_0x5e9a00[_0x76f9('0x59')][0x2][_0x76f9('0x5a')]:undefined)||0x14},{'name':_0x76f9('0x65'),'value':_0x5e9a00[_0x76f9('0x65')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x3]?_0x5e9a00[_0x76f9('0x59')][0x3][_0x76f9('0x5a')]:undefined)||_0x76f9('0x66')},{'name':_0x76f9('0x67'),'value':_0x5e9a00[_0x76f9('0x67')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x4]?_0x5e9a00[_0x76f9('0x59')][0x4][_0x76f9('0x5a')]:undefined)||''},{'name':_0x76f9('0x68'),'value':_0x5e9a00[_0x76f9('0x68')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00['attrs'][0x5]?_0x5e9a00[_0x76f9('0x59')][0x5]['value']:undefined)||''},{'name':_0x76f9('0x69'),'value':_0x5e9a00[_0x76f9('0x69')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x6]?_0x5e9a00[_0x76f9('0x59')][0x6][_0x76f9('0x5a')]:undefined)||''},{'name':_0x76f9('0x6a'),'value':_0x5e9a00[_0x76f9('0x6a')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x7]?_0x5e9a00[_0x76f9('0x59')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5e9a00[_0x76f9('0x6b')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00['attrs'][0x8]?_0x5e9a00[_0x76f9('0x59')][0x8][_0x76f9('0x5a')]:undefined)||''},{'name':_0x76f9('0x6c'),'value':_0x5e9a00['attrChatWebsites']||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x9]?_0x5e9a00[_0x76f9('0x59')][0x9][_0x76f9('0x5a')]:undefined)||''}];case _0x76f9('0x6d'):case'pie-chart':return[{'name':_0x76f9('0x6e'),'value':_0x5e9a00[_0x76f9('0x6e')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x0]?_0x5e9a00['attrs'][0x0][_0x76f9('0x5a')]:undefined)||_0x76f9('0x6f')},{'name':_0x76f9('0x70'),'value':_0x5e9a00[_0x76f9('0x70')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x1]?_0x5e9a00[_0x76f9('0x59')][0x1][_0x76f9('0x5a')]:undefined)||null},{'name':'attrSerie3','value':_0x5e9a00['attrSerie3']||(_0x5e9a00['attrs']&&_0x5e9a00[_0x76f9('0x59')][0x2]?_0x5e9a00[_0x76f9('0x59')][0x2][_0x76f9('0x5a')]:undefined)||null},{'name':_0x76f9('0x64'),'value':_0x5e9a00[_0x76f9('0x64')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x3]?_0x5e9a00['attrs'][0x3][_0x76f9('0x5a')]:undefined)||[]},{'name':_0x76f9('0x65'),'value':_0x5e9a00[_0x76f9('0x65')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x4]?_0x5e9a00[_0x76f9('0x59')][0x4]['value']:undefined)||_0x76f9('0x66')},{'name':_0x76f9('0x67'),'value':_0x5e9a00['attrEmailAccounts']||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x5]?_0x5e9a00['attrs'][0x5][_0x76f9('0x5a')]:undefined)||''},{'name':_0x76f9('0x68'),'value':_0x5e9a00[_0x76f9('0x68')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x6]?_0x5e9a00[_0x76f9('0x59')][0x6][_0x76f9('0x5a')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x5e9a00['attrSmsAccounts']||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x7]?_0x5e9a00['attrs'][0x7][_0x76f9('0x5a')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5e9a00['attrOpenchannelAccounts']||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x8]?_0x5e9a00['attrs'][0x8][_0x76f9('0x5a')]:undefined)||''},{'name':_0x76f9('0x6b'),'value':_0x5e9a00[_0x76f9('0x6b')]||(_0x5e9a00['attrs']&&_0x5e9a00['attrs'][0x9]?_0x5e9a00[_0x76f9('0x59')][0x9][_0x76f9('0x5a')]:undefined)||''},{'name':_0x76f9('0x6c'),'value':_0x5e9a00[_0x76f9('0x6c')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0xa]?_0x5e9a00[_0x76f9('0x59')][0xa]['value']:undefined)||''}];case _0x76f9('0x71'):return[{'name':_0x76f9('0x72'),'type':_0x5e9a00['reportType']||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x0]?_0x5e9a00[_0x76f9('0x59')][0x0]['type']:undefined)||null,'value':_0x5e9a00[_0x76f9('0x72')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x0]?_0x5e9a00[_0x76f9('0x59')][0x0][_0x76f9('0x5a')]:undefined)||null},{'name':_0x76f9('0x73'),'value':_0x5e9a00[_0x76f9('0x73')]||(_0x5e9a00[_0x76f9('0x59')]&&_0x5e9a00[_0x76f9('0x59')][0x1]?_0x5e9a00[_0x76f9('0x59')][0x1][_0x76f9('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x19f292){logger[_0x76f9('0x50')](_0x76f9('0x74'),JSON['stringify'](_0x19f292));return[];}}exports[_0x76f9('0x75')]=function(_0x312c64,_0x22b334,_0x539de3){if(_0x312c64[_0x76f9('0x56')]['id']){delete _0x312c64[_0x76f9('0x56')]['id'];}return db[_0x76f9('0x2e')][_0x76f9('0x49')]({'where':{'id':_0x312c64['params']['id']}})[_0x76f9('0x24')](handleEntityNotFound(_0x22b334,null))[_0x76f9('0x24')](function(_0xe323a9){if(_0xe323a9){_0x312c64[_0x76f9('0x56')][_0x76f9('0x76')]=_0xe323a9['id'];_0x312c64[_0x76f9('0x56')][_0x76f9('0x59')]=widgetAttributes(_0x312c64[_0x76f9('0x56')]);return db[_0x76f9('0x77')][_0x76f9('0x4f')](_0x312c64[_0x76f9('0x56')]);}})['then'](respondWithResult(_0x22b334,null))[_0x76f9('0x45')](handleError(_0x22b334,null));};exports[_0x76f9('0x78')]=function(_0x12fb74,_0x228181,_0x199c54){var _0x4508c9={};var _0x1de29c={};var _0x14d48a;var _0x1f5cf5;return db[_0x76f9('0x2e')][_0x76f9('0x79')]({'where':{'id':_0x12fb74[_0x76f9('0x47')]['id']}})[_0x76f9('0x24')](handleEntityNotFound(_0x228181,null))[_0x76f9('0x24')](function(_0x41d655){if(_0x41d655){_0x14d48a=_0x41d655;_0x1de29c[_0x76f9('0x32')]=_['keys'](db['DashboardItem'][_0x76f9('0x48')]);_0x1de29c[_0x76f9('0x33')]=_[_0x76f9('0x34')](_0x12fb74[_0x76f9('0x33')]);_0x1de29c[_0x76f9('0x35')]=_[_0x76f9('0x36')](_0x1de29c[_0x76f9('0x32')],_0x1de29c[_0x76f9('0x33')]);_0x4508c9['attributes']=_[_0x76f9('0x36')](_0x1de29c[_0x76f9('0x32')],qs[_0x76f9('0x37')](_0x12fb74[_0x76f9('0x33')]['fields']));_0x4508c9[_0x76f9('0x38')]=_0x4508c9[_0x76f9('0x38')][_0x76f9('0x39')]?_0x4508c9[_0x76f9('0x38')]:_0x1de29c[_0x76f9('0x32')];_0x4508c9[_0x76f9('0x3c')]=qs[_0x76f9('0x3d')](_0x12fb74[_0x76f9('0x33')][_0x76f9('0x3d')]);_0x4508c9[_0x76f9('0x3e')]=qs['filters'](_[_0x76f9('0x7a')](_0x12fb74[_0x76f9('0x33')],_0x1de29c[_0x76f9('0x35')]));if(_0x12fb74['query'][_0x76f9('0x3f')]){_0x4508c9[_0x76f9('0x3e')]=_['merge'](_0x4508c9[_0x76f9('0x3e')],{'$or':_[_0x76f9('0x2d')](_0x4508c9['attributes'],function(_0x42ac96){var _0x5d5695={};_0x5d5695[_0x42ac96]={'$like':'%'+_0x12fb74[_0x76f9('0x33')][_0x76f9('0x3f')]+'%'};return _0x5d5695;})});}_0x4508c9=_[_0x76f9('0x40')]({},_0x4508c9,_0x12fb74['options']);return _0x14d48a[_0x76f9('0x78')](_0x4508c9);}})[_0x76f9('0x24')](function(_0x277007){if(_0x277007){_0x1f5cf5=_0x277007[_0x76f9('0x39')];if(!_0x12fb74[_0x76f9('0x33')][_0x76f9('0x3a')](_0x76f9('0x3b'))){_0x4508c9[_0x76f9('0x20')]=qs[_0x76f9('0x20')](_0x12fb74[_0x76f9('0x33')][_0x76f9('0x20')]);_0x4508c9['offset']=qs[_0x76f9('0x1f')](_0x12fb74['query'][_0x76f9('0x1f')]);}return _0x14d48a[_0x76f9('0x78')](_0x4508c9);}})[_0x76f9('0x24')](function(_0x54d9ec){if(_0x54d9ec){return _0x54d9ec?{'count':_0x1f5cf5,'rows':_0x54d9ec}:null;}})[_0x76f9('0x24')](respondWithResult(_0x228181,null))[_0x76f9('0x45')](handleError(_0x228181,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 68d760b..157cf11 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 _0xd3e7=['hasOwnProperty','hook','exports','events','Dashboard','update','remove','emit'];(function(_0x2db5f8,_0x5212e8){var _0x20d626=function(_0x57ed6a){while(--_0x57ed6a){_0x2db5f8['push'](_0x2db5f8['shift']());}};_0x20d626(++_0x5212e8);}(_0xd3e7,0xe3));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x7d3e('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x7d3e('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d3e('0x2'),'afterDestroy':_0x7d3e('0x3')};function emitEvent(_0xffc140){return function(_0x1a67cd,_0x1e2d44,_0xaec336){DashboardEvents[_0x7d3e('0x4')](_0xffc140+':'+_0x1a67cd['id'],_0x1a67cd);DashboardEvents[_0x7d3e('0x4')](_0xffc140,_0x1a67cd);_0xaec336(null);};}for(var e in events){if(events[_0x7d3e('0x5')](e)){var event=events[e];Dashboard[_0x7d3e('0x6')](e,emitEvent(event));}}module[_0x7d3e('0x7')]=DashboardEvents; \ No newline at end of file +var _0x361b=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4fee31,_0x6905e3){var _0x27d650=function(_0x583e4e){while(--_0x583e4e){_0x4fee31['push'](_0x4fee31['shift']());}};_0x27d650(++_0x6905e3);}(_0x361b,0x97));var _0xb361=function(_0x4a685f,_0x4aad04){_0x4a685f=_0x4a685f-0x0;var _0xe8dcad=_0x361b[_0x4a685f];return _0xe8dcad;};'use strict';var EventEmitter=require(_0xb361('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb361('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb361('0x2'),'afterDestroy':_0xb361('0x3')};function emitEvent(_0x4385ec){return function(_0x27da6a,_0x17f675,_0x20e608){DashboardEvents[_0xb361('0x4')](_0x4385ec+':'+_0x27da6a['id'],_0x27da6a);DashboardEvents[_0xb361('0x4')](_0x4385ec,_0x27da6a);_0x20e608(null);};}for(var e in events){if(events[_0xb361('0x5')](e)){var event=events[e];Dashboard[_0xb361('0x6')](e,emitEvent(event));}}module[_0xb361('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 9a4b6c2..15f00e8 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 _0x86af=['../../config/environment','./dashboard.attributes','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x437517,_0x2c55c3){var _0x32bc8a=function(_0x3a66d5){while(--_0x3a66d5){_0x437517['push'](_0x437517['shift']());}};_0x32bc8a(++_0x2c55c3);}(_0x86af,0xff));var _0xf86a=function(_0x109c40,_0x3463fa){_0x109c40=_0x109c40-0x0;var _0x3d5aed=_0x86af[_0x109c40];return _0x3d5aed;};'use strict';var _=require(_0xf86a('0x0'));var util=require(_0xf86a('0x1'));var logger=require(_0xf86a('0x2'))(_0xf86a('0x3'));var moment=require(_0xf86a('0x4'));var BPromise=require(_0xf86a('0x5'));var rp=require(_0xf86a('0x6'));var fs=require('fs');var path=require(_0xf86a('0x7'));var rimraf=require(_0xf86a('0x8'));var config=require(_0xf86a('0x9'));var attributes=require(_0xf86a('0xa'));module['exports']=function(_0x5ad6f5,_0x34bcd8){return _0x5ad6f5['define'](_0xf86a('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04ab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Dashboard','dashboards'];(function(_0x30ad6b,_0x37b5d0){var _0x1382c0=function(_0x2b44d4){while(--_0x2b44d4){_0x30ad6b['push'](_0x30ad6b['shift']());}};_0x1382c0(++_0x37b5d0);}(_0x04ab,0x1a0));var _0xb04a=function(_0x1326dc,_0x3f62b9){_0x1326dc=_0x1326dc-0x0;var _0x47f7f2=_0x04ab[_0x1326dc];return _0x47f7f2;};'use strict';var _=require(_0xb04a('0x0'));var util=require(_0xb04a('0x1'));var logger=require(_0xb04a('0x2'))(_0xb04a('0x3'));var moment=require(_0xb04a('0x4'));var BPromise=require(_0xb04a('0x5'));var rp=require(_0xb04a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb04a('0x7'));var config=require(_0xb04a('0x8'));var attributes=require('./dashboard.attributes');module[_0xb04a('0x9')]=function(_0x59b3ae,_0x17126d){return _0x59b3ae[_0xb04a('0xa')](_0xb04a('0xb'),attributes,{'tableName':_0xb04a('0xc'),'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 3502de6..f15b3c0 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 _0x692b=['then','Dashboard,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','request'];(function(_0x226f7a,_0x1ec96a){var _0x8e602b=function(_0x32974c){while(--_0x32974c){_0x226f7a['push'](_0x226f7a['shift']());}};_0x8e602b(++_0x1ec96a);}(_0x692b,0x1eb));var _0xb692=function(_0x101611,_0x2a6de5){_0x101611=_0x101611-0x0;var _0x440253=_0x692b[_0x101611];return _0x440253;};'use strict';var _=require(_0xb692('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb692('0x1'));var fs=require('fs');var Redis=require(_0xb692('0x2'));var db=require(_0xb692('0x3'))['db'];var utils=require(_0xb692('0x4'));var logger=require('../../config/logger')(_0xb692('0x5'));var config=require(_0xb692('0x6'));var jayson=require(_0xb692('0x7'));var client=jayson[_0xb692('0x8')][_0xb692('0x9')]({'port':0x232a});config[_0xb692('0xa')]=_[_0xb692('0xb')](config[_0xb692('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb692('0xc'))(new Redis(config['redis']));require(_0xb692('0xd'))['register'](socket);function respondWithRpcPromise(_0x157473,_0xb88360,_0x2ac2b2){return new BPromise(function(_0x24db11,_0x494637){return client[_0xb692('0xe')](_0x157473,_0x2ac2b2)[_0xb692('0xf')](function(_0x2323d4){logger['info'](_0xb692('0x10'),_0xb88360,'request\x20sent');logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0xb88360,_0xb692('0x11'),JSON['stringify'](_0x2323d4));if(_0x2323d4[_0xb692('0x12')]){if(_0x2323d4[_0xb692('0x12')]['code']===0x1f4){logger['error'](_0xb692('0x10'),_0xb88360,_0x2323d4[_0xb692('0x12')][_0xb692('0x13')]);return _0x494637(_0x2323d4[_0xb692('0x12')][_0xb692('0x13')]);}logger['error'](_0xb692('0x10'),_0xb88360,_0x2323d4['error'][_0xb692('0x13')]);return _0x24db11(_0x2323d4[_0xb692('0x12')]['message']);}else{logger[_0xb692('0x14')](_0xb692('0x10'),_0xb88360,_0xb692('0x11'));_0x24db11(_0x2323d4[_0xb692('0x15')]['message']);}})[_0xb692('0x16')](function(_0x5875cd){logger[_0xb692('0x12')]('Dashboard,\x20%s,\x20%s',_0xb88360,_0x5875cd);_0x494637(_0x5875cd);});});} \ No newline at end of file +var _0xd8d6=['code','Dashboard,\x20%s,\x20%s','message','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./dashboard.socket','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24ba7c,_0xbcdfb7){var _0x208344=function(_0x46ef9b){while(--_0x46ef9b){_0x24ba7c['push'](_0x24ba7c['shift']());}};_0x208344(++_0xbcdfb7);}(_0xd8d6,0xb2));var _0x6d8d=function(_0x123d68,_0x3e4197){_0x123d68=_0x123d68-0x0;var _0x527693=_0xd8d6[_0x123d68];return _0x527693;};'use strict';var _=require(_0x6d8d('0x0'));var util=require('util');var moment=require(_0x6d8d('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d8d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d8d('0x3'))['db'];var utils=require(_0x6d8d('0x4'));var logger=require(_0x6d8d('0x5'))(_0x6d8d('0x6'));var config=require(_0x6d8d('0x7'));var jayson=require(_0x6d8d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x6d8d('0x9')]=_[_0x6d8d('0xa')](config['redis'],{'host':_0x6d8d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d8d('0x9')]));require(_0x6d8d('0xc'))[_0x6d8d('0xd')](socket);function respondWithRpcPromise(_0x47027c,_0x9c4944,_0x3768bb){return new BPromise(function(_0x2a8003,_0x4540f6){return client[_0x6d8d('0xe')](_0x47027c,_0x3768bb)[_0x6d8d('0xf')](function(_0x33ad8f){logger[_0x6d8d('0x10')]('Dashboard,\x20%s,\x20%s',_0x9c4944,_0x6d8d('0x11'));logger[_0x6d8d('0x12')](_0x6d8d('0x13'),_0x9c4944,'request\x20sent',JSON[_0x6d8d('0x14')](_0x33ad8f));if(_0x33ad8f[_0x6d8d('0x15')]){if(_0x33ad8f['error'][_0x6d8d('0x16')]===0x1f4){logger[_0x6d8d('0x15')](_0x6d8d('0x17'),_0x9c4944,_0x33ad8f[_0x6d8d('0x15')]['message']);return _0x4540f6(_0x33ad8f[_0x6d8d('0x15')][_0x6d8d('0x18')]);}logger[_0x6d8d('0x15')]('Dashboard,\x20%s,\x20%s',_0x9c4944,_0x33ad8f[_0x6d8d('0x15')][_0x6d8d('0x18')]);return _0x2a8003(_0x33ad8f[_0x6d8d('0x15')][_0x6d8d('0x18')]);}else{logger[_0x6d8d('0x10')]('Dashboard,\x20%s,\x20%s',_0x9c4944,_0x6d8d('0x11'));_0x2a8003(_0x33ad8f['result'][_0x6d8d('0x18')]);}})['catch'](function(_0x1e8e23){logger['error'](_0x6d8d('0x17'),_0x9c4944,_0x1e8e23);_0x4540f6(_0x1e8e23);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 2c3f693..5f595f5 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 _0xcec2=['dashboard:','remove','update','emit','removeListener','register','length'];(function(_0x2e375a,_0x27b2d8){var _0x418b0d=function(_0x16bc0c){while(--_0x16bc0c){_0x2e375a['push'](_0x2e375a['shift']());}};_0x418b0d(++_0x27b2d8);}(_0xcec2,0xda));var _0x2cec=function(_0x28749f,_0x4960c6){_0x28749f=_0x28749f-0x0;var _0xad03fc=_0xcec2[_0x28749f];return _0xad03fc;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x2cec('0x0'),_0x2cec('0x1')];function createListener(_0x4ee646,_0x5e2ed1){return function(_0x3d0be3){_0x5e2ed1[_0x2cec('0x2')](_0x4ee646,_0x3d0be3);};}function removeListener(_0x5675fe,_0x3fa6ba){return function(){DashboardEvents[_0x2cec('0x3')](_0x5675fe,_0x3fa6ba);};}exports[_0x2cec('0x4')]=function(_0xac730a){for(var _0x3591ac=0x0,_0x5a5455=events[_0x2cec('0x5')];_0x3591ac<_0x5a5455;_0x3591ac++){var _0xbc338d=events[_0x3591ac];var _0x336232=createListener(_0x2cec('0x6')+_0xbc338d,_0xac730a);DashboardEvents['on'](_0xbc338d,_0x336232);}}; \ No newline at end of file +var _0xd837=['emit','removeListener','register','length','dashboard:','./dashboard.events','save','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd837,0xed));var _0x7d83=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xd837[_0x5c6994];return _0x1d5c84;};'use strict';var DashboardEvents=require(_0x7d83('0x0'));var events=[_0x7d83('0x1'),'remove',_0x7d83('0x2')];function createListener(_0x9a9a65,_0x41a2f3){return function(_0x559ce2){_0x41a2f3[_0x7d83('0x3')](_0x9a9a65,_0x559ce2);};}function removeListener(_0x21ca50,_0x59428d){return function(){DashboardEvents[_0x7d83('0x4')](_0x21ca50,_0x59428d);};}exports[_0x7d83('0x5')]=function(_0x2d3323){for(var _0x29131a=0x0,_0x220580=events[_0x7d83('0x6')];_0x29131a<_0x220580;_0x29131a++){var _0x312915=events[_0x29131a];var _0x3889d9=createListener(_0x7d83('0x7')+_0x312915,_0x2d3323);DashboardEvents['on'](_0x312915,_0x3889d9);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 4e1c464..362e255 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 _0x9321=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id/items','getItems','post','create','/:id/clone','clone','put','/:id','delete','exports','multer'];(function(_0x2dd9e3,_0x2e5e3e){var _0x55fb49=function(_0x36a770){while(--_0x36a770){_0x2dd9e3['push'](_0x2dd9e3['shift']());}};_0x55fb49(++_0x2e5e3e);}(_0x9321,0xd1));var _0x1932=function(_0x402b9b,_0x2e2d44){_0x402b9b=_0x402b9b-0x0;var _0x357ddd=_0x9321[_0x402b9b];return _0x357ddd;};'use strict';var multer=require(_0x1932('0x0'));var util=require(_0x1932('0x1'));var path=require(_0x1932('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1932('0x3')]();var fs_extra=require(_0x1932('0x4'));var auth=require(_0x1932('0x5'));var interaction=require(_0x1932('0x6'));var config=require(_0x1932('0x7'));var controller=require(_0x1932('0x8'));router[_0x1932('0x9')]('/',auth[_0x1932('0xa')](),controller['index']);router['get']('/:id',auth[_0x1932('0xa')](),controller['show']);router[_0x1932('0x9')](_0x1932('0xb'),auth[_0x1932('0xa')](),controller[_0x1932('0xc')]);router[_0x1932('0xd')]('/',auth[_0x1932('0xa')](),controller[_0x1932('0xe')]);router[_0x1932('0xd')](_0x1932('0xf'),auth[_0x1932('0xa')](),controller[_0x1932('0x10')]);router['post']('/:id/items',auth[_0x1932('0xa')](),controller['addItem']);router[_0x1932('0x11')](_0x1932('0x12'),auth[_0x1932('0xa')](),controller['update']);router[_0x1932('0x13')](_0x1932('0x12'),auth[_0x1932('0xa')](),controller['destroy']);module[_0x1932('0x14')]=router; \ No newline at end of file +var _0xe62a=['update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/items','getItems','post','/:id/clone','clone','addItem','put'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe62a,0x9d));var _0xae62=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe62a[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xae62('0x0'));var path=require(_0xae62('0x1'));var timeout=require(_0xae62('0x2'));var express=require(_0xae62('0x3'));var router=express[_0xae62('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae62('0x5'));var interaction=require(_0xae62('0x6'));var config=require(_0xae62('0x7'));var controller=require('./dashboard.controller');router['get']('/',auth[_0xae62('0x8')](),controller['index']);router[_0xae62('0x9')](_0xae62('0xa'),auth[_0xae62('0x8')](),controller[_0xae62('0xb')]);router[_0xae62('0x9')](_0xae62('0xc'),auth['isAuthenticated'](),controller[_0xae62('0xd')]);router['post']('/',auth[_0xae62('0x8')](),controller['create']);router[_0xae62('0xe')](_0xae62('0xf'),auth[_0xae62('0x8')](),controller[_0xae62('0x10')]);router[_0xae62('0xe')](_0xae62('0xc'),auth[_0xae62('0x8')](),controller[_0xae62('0x11')]);router[_0xae62('0x12')](_0xae62('0xa'),auth['isAuthenticated'](),controller[_0xae62('0x13')]);router['delete'](_0xae62('0xa'),auth[_0xae62('0x8')](),controller[_0xae62('0x14')]);module[_0xae62('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 52c7e32..c449fd7 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 _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x4d72b0,_0x6ba7fa){var _0x159901=function(_0x157a6c){while(--_0x157a6c){_0x4d72b0['push'](_0x4d72b0['shift']());}};_0x159901(++_0x6ba7fa);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3363cc,_0xfa5ee){_0x3363cc=_0x3363cc-0x0;var _0xa5f8a0=_0xc1c6[_0x3363cc];return _0xa5f8a0;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x31f0=['INTEGER','#ffffff','#2196f3','sequelize','lodash','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify'];(function(_0x37a368,_0xb5b264){var _0x311d3f=function(_0x42ba9e){while(--_0x42ba9e){_0x37a368['push'](_0x37a368['shift']());}};_0x311d3f(++_0xb5b264);}(_0x31f0,0xb7));var _0x031f=function(_0x1acdc8,_0x221170){_0x1acdc8=_0x1acdc8-0x0;var _0x3b5ab6=_0x31f0[_0x1acdc8];return _0x3b5ab6;};'use strict';var Sequelize=require(_0x031f('0x0'));var squel=require('squel');var _=require(_0x031f('0x1'));module['exports']={'title':{'type':Sequelize[_0x031f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x031f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x031f('0x3')](_0x031f('0x4')),'get':function(){try{return JSON['parse'](this[_0x031f('0x5')](_0x031f('0x6')));}catch(_0x4f6059){return[];}},'set':function(_0x4c0f94){try{this['setDataValue'](_0x031f('0x6'),JSON['stringify'](_0x4c0f94));}catch(_0x365f59){this[_0x031f('0x7')](_0x031f('0x6'),JSON[_0x031f('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x031f('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x031f('0x9')]},'col':{'type':Sequelize[_0x031f('0x9')]},'background':{'type':Sequelize[_0x031f('0x2')],'allowNull':![],'defaultValue':_0x031f('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x031f('0x2')],'allowNull':![],'defaultValue':_0x031f('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x031f('0x2')]},'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 8213a9a..0e09378 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 _0xb46f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','show','params','keys','rawAttributes','filters','intersection','query','attributes','model','fields','length','includeAll','include','merge','DashboardItem','catch','find','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x27e4ed,_0x3bd74f){var _0x444152=function(_0x50faf6){while(--_0x50faf6){_0x27e4ed['push'](_0x27e4ed['shift']());}};_0x444152(++_0x3bd74f);}(_0xb46f,0xb6));var _0xfb46=function(_0x571794,_0x45dcd6){_0x571794=_0x571794-0x0;var _0x24d01f=_0xb46f[_0x571794];return _0x24d01f;};'use strict';var emlformat=require(_0xfb46('0x0'));var rimraf=require(_0xfb46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb46('0x2'));var rp=require(_0xfb46('0x3'));var moment=require(_0xfb46('0x4'));var BPromise=require(_0xfb46('0x5'));var Mustache=require(_0xfb46('0x6'));var util=require('util');var path=require(_0xfb46('0x7'));var sox=require('sox');var csv=require(_0xfb46('0x8'));var ejs=require(_0xfb46('0x9'));var fs=require('fs');var fs_extra=require(_0xfb46('0xa'));var _=require(_0xfb46('0xb'));var squel=require(_0xfb46('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb46('0xd'));var deskjs=require(_0xfb46('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb46('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfb46('0x10'));var hardwareService=require(_0xfb46('0x11'));var logger=require(_0xfb46('0x12'))(_0xfb46('0x13'));var utils=require(_0xfb46('0x14'));var config=require(_0xfb46('0x15'));var licenseUtil=require(_0xfb46('0x16'));var db=require(_0xfb46('0x17'))['db'];config[_0xfb46('0x18')]=_[_0xfb46('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb46('0x1a'))(new Redis(config['redis']));require(_0xfb46('0x1b'))[_0xfb46('0x1c')](socket);function respondWithStatusCode(_0x572e04,_0x31e54e){_0x31e54e=_0x31e54e||0xcc;return function(_0x319759){if(_0x319759){return _0x572e04[_0xfb46('0x1d')](_0x31e54e);}return _0x572e04[_0xfb46('0x1e')](_0x31e54e)['end']();};}function respondWithResult(_0x230774,_0x2b0ee4){_0x2b0ee4=_0x2b0ee4||0xc8;return function(_0x358b84){if(_0x358b84){return _0x230774['status'](_0x2b0ee4)[_0xfb46('0x1f')](_0x358b84);}};}function respondWithFilteredResult(_0x10fc0c,_0x47959d){return function(_0x523d15){if(_0x523d15){var _0x1cead0=typeof _0x47959d[_0xfb46('0x20')]===_0xfb46('0x21')&&typeof _0x47959d[_0xfb46('0x22')]===_0xfb46('0x21');var _0x23c6ee=_0x523d15[_0xfb46('0x23')];var _0x3b9872=_0x1cead0?0x0:_0x47959d[_0xfb46('0x20')];var _0x452ade=_0x1cead0?_0x523d15[_0xfb46('0x23')]:_0x47959d[_0xfb46('0x20')]+_0x47959d['limit'];var _0x1b838a;if(_0x452ade>=_0x23c6ee){_0x452ade=_0x23c6ee;_0x1b838a=0xc8;}else{_0x1b838a=0xce;}_0x10fc0c[_0xfb46('0x1e')](_0x1b838a);return _0x10fc0c[_0xfb46('0x24')](_0xfb46('0x25'),_0x3b9872+'-'+_0x452ade+'/'+_0x23c6ee)[_0xfb46('0x1f')](_0x523d15);}return null;};}function patchUpdates(_0x2f8f6f){return function(_0x10a133){try{jsonpatch[_0xfb46('0x26')](_0x10a133,_0x2f8f6f,!![]);}catch(_0x1010e0){return BPromise['reject'](_0x1010e0);}return _0x10a133[_0xfb46('0x27')]();};}function saveUpdates(_0x5a8dde,_0x7b5d40){return function(_0x282dae){if(_0x282dae){return _0x282dae[_0xfb46('0x28')](_0x5a8dde)[_0xfb46('0x29')](function(_0xf9bbd1){return _0xf9bbd1;});}return null;};}function removeEntity(_0x3359fb,_0x254f6c){return function(_0x4f2cb6){if(_0x4f2cb6){return _0x4f2cb6[_0xfb46('0x2a')]()[_0xfb46('0x29')](function(){_0x3359fb[_0xfb46('0x1e')](0xcc)[_0xfb46('0x2b')]();});}};}function handleEntityNotFound(_0x22d795,_0x189081){return function(_0x16aea0){if(!_0x16aea0){_0x22d795[_0xfb46('0x1d')](0x194);}return _0x16aea0;};}function handleError(_0x3dd84a,_0x5d34d3){_0x5d34d3=_0x5d34d3||0x1f4;return function(_0x21da44){logger[_0xfb46('0x2c')](_0x21da44[_0xfb46('0x2d')]);if(_0x21da44[_0xfb46('0x2e')]){delete _0x21da44['name'];}_0x3dd84a[_0xfb46('0x1e')](_0x5d34d3)[_0xfb46('0x2f')](_0x21da44);};}exports[_0xfb46('0x30')]=function(_0x468561,_0x846e43){var _0x5aa6b4={'raw':![],'where':{'id':_0x468561[_0xfb46('0x31')]['id']}},_0x38637a={};_0x38637a['model']=_[_0xfb46('0x32')](db['DashboardItem'][_0xfb46('0x33')]);_0x38637a['query']=_[_0xfb46('0x32')](_0x468561['query']);_0x38637a[_0xfb46('0x34')]=_[_0xfb46('0x35')](_0x38637a['model'],_0x38637a[_0xfb46('0x36')]);_0x5aa6b4[_0xfb46('0x37')]=_['intersection'](_0x38637a[_0xfb46('0x38')],qs[_0xfb46('0x39')](_0x468561['query']['fields']));_0x5aa6b4[_0xfb46('0x37')]=_0x5aa6b4[_0xfb46('0x37')][_0xfb46('0x3a')]?_0x5aa6b4[_0xfb46('0x37')]:_0x38637a[_0xfb46('0x38')];if(_0x468561[_0xfb46('0x36')][_0xfb46('0x3b')]){_0x5aa6b4[_0xfb46('0x3c')]=[{'all':!![]}];}_0x5aa6b4=_[_0xfb46('0x3d')]({},_0x5aa6b4,_0x468561['options']);return db[_0xfb46('0x3e')]['find'](_0x5aa6b4)['then'](handleEntityNotFound(_0x846e43,null))[_0xfb46('0x29')](respondWithResult(_0x846e43,null))[_0xfb46('0x3f')](handleError(_0x846e43,null));};exports[_0xfb46('0x2a')]=function(_0x136371,_0x363bfb){return db[_0xfb46('0x3e')][_0xfb46('0x40')]({'where':{'id':_0x136371[_0xfb46('0x31')]['id']}})['then'](handleEntityNotFound(_0x363bfb,null))[_0xfb46('0x29')](removeEntity(_0x363bfb,null))[_0xfb46('0x3f')](handleError(_0x363bfb,null));};function widgetAttributes(_0x3f67bc){try{switch(_0x3f67bc[_0xfb46('0x41')]){case'iframe':return[{'name':_0xfb46('0x42'),'value':_0x3f67bc[_0xfb46('0x42')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x0]?_0x3f67bc[_0xfb46('0x43')][0x0][_0xfb46('0x44')]:undefined)||_0xfb46('0x45')}];case _0xfb46('0x46'):return[{'name':'attrPath','value':_0x3f67bc[_0xfb46('0x47')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x0]?_0x3f67bc['attrs'][0x0][_0xfb46('0x44')]:undefined)||''}];case _0xfb46('0x48'):return[{'name':_0xfb46('0x49'),'value':_0x3f67bc['attrHourFormat']||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc['attrs'][0x0]?_0x3f67bc['attrs'][0x0][_0xfb46('0x44')]:undefined)||_0xfb46('0x4a')},{'name':_0xfb46('0x4b'),'value':_0x3f67bc[_0xfb46('0x4b')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x1]?_0x3f67bc[_0xfb46('0x43')][0x1][_0xfb46('0x44')]:undefined)||_0xfb46('0x4c')},{'name':_0xfb46('0x4d'),'value':_0x3f67bc['attrFontSize']||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x2]?_0x3f67bc[_0xfb46('0x43')][0x2][_0xfb46('0x44')]:undefined)||0xc}];case _0xfb46('0x4e'):return[{'name':_0xfb46('0x4f'),'value':_0x3f67bc['attrMetric']||(_0x3f67bc['attrs']&&_0x3f67bc[_0xfb46('0x43')][0x0]?_0x3f67bc[_0xfb46('0x43')][0x0][_0xfb46('0x44')]:undefined)||_0xfb46('0x50')},{'name':_0xfb46('0x51'),'value':_0x3f67bc['attrVoiceQueues']||(_0x3f67bc['attrs']&&_0x3f67bc['attrs'][0x1]?_0x3f67bc[_0xfb46('0x43')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x3f67bc[_0xfb46('0x4d')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x2]?_0x3f67bc['attrs'][0x2][_0xfb46('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x3f67bc[_0xfb46('0x52')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x3]?_0x3f67bc[_0xfb46('0x43')][0x3][_0xfb46('0x44')]:undefined)||_0xfb46('0x53')},{'name':_0xfb46('0x54'),'value':_0x3f67bc[_0xfb46('0x54')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x4]?_0x3f67bc[_0xfb46('0x43')][0x4][_0xfb46('0x44')]:undefined)||''},{'name':_0xfb46('0x55'),'value':_0x3f67bc[_0xfb46('0x55')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc['attrs'][0x5]?_0x3f67bc[_0xfb46('0x43')][0x5][_0xfb46('0x44')]:undefined)||''},{'name':_0xfb46('0x56'),'value':_0x3f67bc[_0xfb46('0x56')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc['attrs'][0x6]?_0x3f67bc[_0xfb46('0x43')][0x6][_0xfb46('0x44')]:undefined)||''},{'name':_0xfb46('0x57'),'value':_0x3f67bc[_0xfb46('0x57')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x7]?_0x3f67bc[_0xfb46('0x43')][0x7][_0xfb46('0x44')]:undefined)||''},{'name':_0xfb46('0x58'),'value':_0x3f67bc[_0xfb46('0x58')]||(_0x3f67bc['attrs']&&_0x3f67bc['attrs'][0x8]?_0x3f67bc[_0xfb46('0x43')][0x8][_0xfb46('0x44')]:undefined)||''},{'name':_0xfb46('0x59'),'value':_0x3f67bc[_0xfb46('0x59')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc['attrs'][0x9]?_0x3f67bc[_0xfb46('0x43')][0x9][_0xfb46('0x44')]:undefined)||''}];case'multibar-chart':case _0xfb46('0x5a'):return[{'name':'attrSerie1','value':_0x3f67bc[_0xfb46('0x5b')]||(_0x3f67bc['attrs']&&_0x3f67bc['attrs'][0x0]?_0x3f67bc[_0xfb46('0x43')][0x0][_0xfb46('0x44')]:undefined)||_0xfb46('0x50')},{'name':_0xfb46('0x5c'),'value':_0x3f67bc[_0xfb46('0x5c')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x1]?_0x3f67bc[_0xfb46('0x43')][0x1][_0xfb46('0x44')]:undefined)||null},{'name':_0xfb46('0x5d'),'value':_0x3f67bc[_0xfb46('0x5d')]||(_0x3f67bc['attrs']&&_0x3f67bc['attrs'][0x2]?_0x3f67bc['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x3f67bc[_0xfb46('0x51')]||(_0x3f67bc['attrs']&&_0x3f67bc[_0xfb46('0x43')][0x3]?_0x3f67bc['attrs'][0x3][_0xfb46('0x44')]:undefined)||[]},{'name':_0xfb46('0x52'),'value':_0x3f67bc['attrChannel']||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x4]?_0x3f67bc[_0xfb46('0x43')][0x4][_0xfb46('0x44')]:undefined)||_0xfb46('0x53')},{'name':_0xfb46('0x54'),'value':_0x3f67bc[_0xfb46('0x54')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x5]?_0x3f67bc['attrs'][0x5][_0xfb46('0x44')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3f67bc[_0xfb46('0x55')]||(_0x3f67bc['attrs']&&_0x3f67bc[_0xfb46('0x43')][0x6]?_0x3f67bc[_0xfb46('0x43')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x3f67bc[_0xfb46('0x56')]||(_0x3f67bc['attrs']&&_0x3f67bc[_0xfb46('0x43')][0x7]?_0x3f67bc['attrs'][0x7][_0xfb46('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3f67bc[_0xfb46('0x57')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc['attrs'][0x8]?_0x3f67bc[_0xfb46('0x43')][0x8][_0xfb46('0x44')]:undefined)||''},{'name':_0xfb46('0x58'),'value':_0x3f67bc[_0xfb46('0x58')]||(_0x3f67bc['attrs']&&_0x3f67bc[_0xfb46('0x43')][0x9]?_0x3f67bc[_0xfb46('0x43')][0x9]['value']:undefined)||''},{'name':_0xfb46('0x59'),'value':_0x3f67bc[_0xfb46('0x59')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0xa]?_0x3f67bc['attrs'][0xa][_0xfb46('0x44')]:undefined)||''}];case _0xfb46('0x5e'):return[{'name':_0xfb46('0x5f'),'type':_0x3f67bc[_0xfb46('0x60')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x0]?_0x3f67bc[_0xfb46('0x43')][0x0][_0xfb46('0x41')]:undefined)||null,'value':_0x3f67bc[_0xfb46('0x5f')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc[_0xfb46('0x43')][0x0]?_0x3f67bc[_0xfb46('0x43')][0x0][_0xfb46('0x44')]:undefined)||null},{'name':_0xfb46('0x61'),'value':_0x3f67bc[_0xfb46('0x61')]||(_0x3f67bc[_0xfb46('0x43')]&&_0x3f67bc['attrs'][0x1]?_0x3f67bc['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4824d9){logger[_0xfb46('0x2c')](_0xfb46('0x62'),JSON[_0xfb46('0x63')](_0x4824d9));return[];}}exports['create']=function(_0x2bcdbf,_0x1f04ec){if(_0x2bcdbf[_0xfb46('0x64')]){_0x2bcdbf[_0xfb46('0x64')][_0xfb46('0x43')]=widgetAttributes(_0x2bcdbf[_0xfb46('0x64')]);}return db[_0xfb46('0x3e')]['create'](_0x2bcdbf[_0xfb46('0x64')],{})[_0xfb46('0x29')](respondWithResult(_0x1f04ec,0xc9))[_0xfb46('0x3f')](handleError(_0x1f04ec,null));};exports[_0xfb46('0x28')]=function(_0x4905de,_0x3c1194){if(_0x4905de[_0xfb46('0x64')]['id']){delete _0x4905de[_0xfb46('0x64')]['id'];}_0x4905de[_0xfb46('0x64')][_0xfb46('0x43')]=widgetAttributes(_0x4905de[_0xfb46('0x64')]);return db[_0xfb46('0x3e')][_0xfb46('0x40')]({'where':{'id':_0x4905de['params']['id']}})[_0xfb46('0x29')](handleEntityNotFound(_0x3c1194,null))['then'](saveUpdates(_0x4905de['body'],null))['then'](respondWithResult(_0x3c1194,null))[_0xfb46('0x3f')](handleError(_0x3c1194,null));}; \ No newline at end of file +var _0xd959=['set','reject','update','then','destroy','end','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','attributes','fields','length','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./dashboardItem.socket','status','json','offset','undefined','count','limit'];(function(_0x278583,_0x15dbca){var _0x462e6f=function(_0x41814e){while(--_0x41814e){_0x278583['push'](_0x278583['shift']());}};_0x462e6f(++_0x15dbca);}(_0xd959,0x94));var _0x9d95=function(_0xa561eb,_0x5e17da){_0xa561eb=_0xa561eb-0x0;var _0x10e228=_0xd959[_0xa561eb];return _0x10e228;};'use strict';var emlformat=require(_0x9d95('0x0'));var rimraf=require(_0x9d95('0x1'));var zipdir=require(_0x9d95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9d95('0x3'));var moment=require(_0x9d95('0x4'));var BPromise=require(_0x9d95('0x5'));var Mustache=require(_0x9d95('0x6'));var util=require(_0x9d95('0x7'));var path=require('path');var sox=require(_0x9d95('0x8'));var csv=require(_0x9d95('0x9'));var ejs=require(_0x9d95('0xa'));var fs=require('fs');var fs_extra=require(_0x9d95('0xb'));var _=require('lodash');var squel=require(_0x9d95('0xc'));var crypto=require(_0x9d95('0xd'));var jsforce=require(_0x9d95('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9d95('0x9'));var querystring=require('querystring');var Papa=require(_0x9d95('0xf'));var Redis=require(_0x9d95('0x10'));var authService=require(_0x9d95('0x11'));var qs=require(_0x9d95('0x12'));var as=require(_0x9d95('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d95('0x14'))(_0x9d95('0x15'));var utils=require('../../config/utils');var config=require(_0x9d95('0x16'));var licenseUtil=require(_0x9d95('0x17'));var db=require('../../mysqldb')['db'];config[_0x9d95('0x18')]=_[_0x9d95('0x19')](config[_0x9d95('0x18')],{'host':_0x9d95('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d95('0x18')]));require(_0x9d95('0x1b'))['register'](socket);function respondWithStatusCode(_0x36a204,_0x1aee2b){_0x1aee2b=_0x1aee2b||0xcc;return function(_0xcd7ba8){if(_0xcd7ba8){return _0x36a204['sendStatus'](_0x1aee2b);}return _0x36a204[_0x9d95('0x1c')](_0x1aee2b)['end']();};}function respondWithResult(_0x4cabfd,_0x3e3471){_0x3e3471=_0x3e3471||0xc8;return function(_0x46650b){if(_0x46650b){return _0x4cabfd['status'](_0x3e3471)[_0x9d95('0x1d')](_0x46650b);}};}function respondWithFilteredResult(_0x5ad0c8,_0x466fa3){return function(_0x3ab916){if(_0x3ab916){var _0x1d267c=typeof _0x466fa3[_0x9d95('0x1e')]===_0x9d95('0x1f')&&typeof _0x466fa3['limit']===_0x9d95('0x1f');var _0x4ec46d=_0x3ab916[_0x9d95('0x20')];var _0x33a809=_0x1d267c?0x0:_0x466fa3[_0x9d95('0x1e')];var _0x19cfc7=_0x1d267c?_0x3ab916[_0x9d95('0x20')]:_0x466fa3[_0x9d95('0x1e')]+_0x466fa3[_0x9d95('0x21')];var _0x3ac1a3;if(_0x19cfc7>=_0x4ec46d){_0x19cfc7=_0x4ec46d;_0x3ac1a3=0xc8;}else{_0x3ac1a3=0xce;}_0x5ad0c8['status'](_0x3ac1a3);return _0x5ad0c8[_0x9d95('0x22')]('Content-Range',_0x33a809+'-'+_0x19cfc7+'/'+_0x4ec46d)['json'](_0x3ab916);}return null;};}function patchUpdates(_0x8081ae){return function(_0x3c3a06){try{jsonpatch['apply'](_0x3c3a06,_0x8081ae,!![]);}catch(_0x2bfbe0){return BPromise[_0x9d95('0x23')](_0x2bfbe0);}return _0x3c3a06['save']();};}function saveUpdates(_0x4840f5,_0x2b1d01){return function(_0x2f4684){if(_0x2f4684){return _0x2f4684[_0x9d95('0x24')](_0x4840f5)[_0x9d95('0x25')](function(_0x4c9abd){return _0x4c9abd;});}return null;};}function removeEntity(_0x1953cb,_0x4f1562){return function(_0x11a7b2){if(_0x11a7b2){return _0x11a7b2[_0x9d95('0x26')]()[_0x9d95('0x25')](function(){_0x1953cb[_0x9d95('0x1c')](0xcc)[_0x9d95('0x27')]();});}};}function handleEntityNotFound(_0x32067a,_0x154834){return function(_0xb69ff8){if(!_0xb69ff8){_0x32067a['sendStatus'](0x194);}return _0xb69ff8;};}function handleError(_0x3049db,_0x44706e){_0x44706e=_0x44706e||0x1f4;return function(_0x1cdac3){logger[_0x9d95('0x28')](_0x1cdac3[_0x9d95('0x29')]);if(_0x1cdac3[_0x9d95('0x2a')]){delete _0x1cdac3[_0x9d95('0x2a')];}_0x3049db[_0x9d95('0x1c')](_0x44706e)[_0x9d95('0x2b')](_0x1cdac3);};}exports[_0x9d95('0x2c')]=function(_0x5c123d,_0xff5bbc){var _0x121630={'raw':![],'where':{'id':_0x5c123d[_0x9d95('0x2d')]['id']}},_0x2b456e={};_0x2b456e[_0x9d95('0x2e')]=_['keys'](db[_0x9d95('0x2f')][_0x9d95('0x30')]);_0x2b456e[_0x9d95('0x31')]=_[_0x9d95('0x32')](_0x5c123d['query']);_0x2b456e[_0x9d95('0x33')]=_['intersection'](_0x2b456e[_0x9d95('0x2e')],_0x2b456e[_0x9d95('0x31')]);_0x121630[_0x9d95('0x34')]=_['intersection'](_0x2b456e[_0x9d95('0x2e')],qs['fields'](_0x5c123d['query'][_0x9d95('0x35')]));_0x121630['attributes']=_0x121630['attributes'][_0x9d95('0x36')]?_0x121630['attributes']:_0x2b456e['model'];if(_0x5c123d[_0x9d95('0x31')][_0x9d95('0x37')]){_0x121630[_0x9d95('0x38')]=[{'all':!![]}];}_0x121630=_[_0x9d95('0x39')]({},_0x121630,_0x5c123d['options']);return db[_0x9d95('0x2f')][_0x9d95('0x3a')](_0x121630)[_0x9d95('0x25')](handleEntityNotFound(_0xff5bbc,null))[_0x9d95('0x25')](respondWithResult(_0xff5bbc,null))[_0x9d95('0x3b')](handleError(_0xff5bbc,null));};exports[_0x9d95('0x26')]=function(_0x2e65f6,_0x16406d){return db[_0x9d95('0x2f')]['find']({'where':{'id':_0x2e65f6['params']['id']}})[_0x9d95('0x25')](handleEntityNotFound(_0x16406d,null))[_0x9d95('0x25')](removeEntity(_0x16406d,null))[_0x9d95('0x3b')](handleError(_0x16406d,null));};function widgetAttributes(_0x4f026c){try{switch(_0x4f026c[_0x9d95('0x3c')]){case _0x9d95('0x3d'):return[{'name':_0x9d95('0x3e'),'value':_0x4f026c[_0x9d95('0x3e')]||(_0x4f026c['attrs']&&_0x4f026c[_0x9d95('0x3f')][0x0]?_0x4f026c[_0x9d95('0x3f')][0x0][_0x9d95('0x40')]:undefined)||'https://'}];case _0x9d95('0x41'):return[{'name':'attrPath','value':_0x4f026c[_0x9d95('0x42')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c['attrs'][0x0]?_0x4f026c['attrs'][0x0][_0x9d95('0x40')]:undefined)||''}];case'clock':return[{'name':_0x9d95('0x43'),'value':_0x4f026c[_0x9d95('0x43')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x0]?_0x4f026c['attrs'][0x0][_0x9d95('0x40')]:undefined)||'HH:mm:ss'},{'name':_0x9d95('0x44'),'value':_0x4f026c[_0x9d95('0x44')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x1]?_0x4f026c['attrs'][0x1][_0x9d95('0x40')]:undefined)||_0x9d95('0x45')},{'name':_0x9d95('0x46'),'value':_0x4f026c['attrFontSize']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x2]?_0x4f026c[_0x9d95('0x3f')][0x2][_0x9d95('0x40')]:undefined)||0xc}];case _0x9d95('0x47'):return[{'name':_0x9d95('0x48'),'value':_0x4f026c[_0x9d95('0x48')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x0]?_0x4f026c[_0x9d95('0x3f')][0x0][_0x9d95('0x40')]:undefined)||_0x9d95('0x49')},{'name':_0x9d95('0x4a'),'value':_0x4f026c[_0x9d95('0x4a')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x1]?_0x4f026c[_0x9d95('0x3f')][0x1][_0x9d95('0x40')]:undefined)||[]},{'name':_0x9d95('0x46'),'value':_0x4f026c['attrFontSize']||(_0x4f026c['attrs']&&_0x4f026c[_0x9d95('0x3f')][0x2]?_0x4f026c[_0x9d95('0x3f')][0x2][_0x9d95('0x40')]:undefined)||0x14},{'name':_0x9d95('0x4b'),'value':_0x4f026c[_0x9d95('0x4b')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x3]?_0x4f026c[_0x9d95('0x3f')][0x3]['value']:undefined)||'voice'},{'name':_0x9d95('0x4c'),'value':_0x4f026c['attrEmailAccounts']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x4]?_0x4f026c[_0x9d95('0x3f')][0x4][_0x9d95('0x40')]:undefined)||''},{'name':_0x9d95('0x4d'),'value':_0x4f026c['attrFaxAccounts']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x5]?_0x4f026c[_0x9d95('0x3f')][0x5]['value']:undefined)||''},{'name':_0x9d95('0x4e'),'value':_0x4f026c[_0x9d95('0x4e')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x6]?_0x4f026c[_0x9d95('0x3f')][0x6]['value']:undefined)||''},{'name':_0x9d95('0x4f'),'value':_0x4f026c['attrOpenchannelAccounts']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x7]?_0x4f026c[_0x9d95('0x3f')][0x7][_0x9d95('0x40')]:undefined)||''},{'name':_0x9d95('0x50'),'value':_0x4f026c['attrWhatsappAccounts']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c['attrs'][0x8]?_0x4f026c[_0x9d95('0x3f')][0x8]['value']:undefined)||''},{'name':_0x9d95('0x51'),'value':_0x4f026c[_0x9d95('0x51')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x9]?_0x4f026c[_0x9d95('0x3f')][0x9][_0x9d95('0x40')]:undefined)||''}];case _0x9d95('0x52'):case _0x9d95('0x53'):return[{'name':'attrSerie1','value':_0x4f026c['attrSerie1']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x0]?_0x4f026c['attrs'][0x0][_0x9d95('0x40')]:undefined)||_0x9d95('0x49')},{'name':_0x9d95('0x54'),'value':_0x4f026c[_0x9d95('0x54')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x1]?_0x4f026c[_0x9d95('0x3f')][0x1][_0x9d95('0x40')]:undefined)||null},{'name':_0x9d95('0x55'),'value':_0x4f026c['attrSerie3']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x2]?_0x4f026c['attrs'][0x2][_0x9d95('0x40')]:undefined)||null},{'name':_0x9d95('0x4a'),'value':_0x4f026c[_0x9d95('0x4a')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x3]?_0x4f026c[_0x9d95('0x3f')][0x3][_0x9d95('0x40')]:undefined)||[]},{'name':_0x9d95('0x4b'),'value':_0x4f026c[_0x9d95('0x4b')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x4]?_0x4f026c[_0x9d95('0x3f')][0x4][_0x9d95('0x40')]:undefined)||'voice'},{'name':_0x9d95('0x4c'),'value':_0x4f026c[_0x9d95('0x4c')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c['attrs'][0x5]?_0x4f026c[_0x9d95('0x3f')][0x5][_0x9d95('0x40')]:undefined)||''},{'name':_0x9d95('0x4d'),'value':_0x4f026c[_0x9d95('0x4d')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c['attrs'][0x6]?_0x4f026c['attrs'][0x6][_0x9d95('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4f026c[_0x9d95('0x4e')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x7]?_0x4f026c['attrs'][0x7][_0x9d95('0x40')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4f026c['attrOpenchannelAccounts']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x8]?_0x4f026c[_0x9d95('0x3f')][0x8][_0x9d95('0x40')]:undefined)||''},{'name':_0x9d95('0x50'),'value':_0x4f026c[_0x9d95('0x50')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x9]?_0x4f026c[_0x9d95('0x3f')][0x9][_0x9d95('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4f026c[_0x9d95('0x51')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c['attrs'][0xa]?_0x4f026c[_0x9d95('0x3f')][0xa][_0x9d95('0x40')]:undefined)||''}];case'web-report':return[{'name':_0x9d95('0x56'),'type':_0x4f026c['reportType']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x0]?_0x4f026c['attrs'][0x0]['type']:undefined)||null,'value':_0x4f026c['attrReport']||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c['attrs'][0x0]?_0x4f026c[_0x9d95('0x3f')][0x0][_0x9d95('0x40')]:undefined)||null},{'name':_0x9d95('0x57'),'value':_0x4f026c[_0x9d95('0x57')]||(_0x4f026c[_0x9d95('0x3f')]&&_0x4f026c[_0x9d95('0x3f')][0x1]?_0x4f026c[_0x9d95('0x3f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xe14716){logger[_0x9d95('0x28')](_0x9d95('0x58'),JSON['stringify'](_0xe14716));return[];}}exports[_0x9d95('0x59')]=function(_0x3944ba,_0x1651ff){if(_0x3944ba[_0x9d95('0x5a')]){_0x3944ba[_0x9d95('0x5a')]['attrs']=widgetAttributes(_0x3944ba[_0x9d95('0x5a')]);}return db[_0x9d95('0x2f')][_0x9d95('0x59')](_0x3944ba[_0x9d95('0x5a')],{})[_0x9d95('0x25')](respondWithResult(_0x1651ff,0xc9))[_0x9d95('0x3b')](handleError(_0x1651ff,null));};exports['update']=function(_0x398576,_0x17fb53){if(_0x398576[_0x9d95('0x5a')]['id']){delete _0x398576[_0x9d95('0x5a')]['id'];}_0x398576[_0x9d95('0x5a')][_0x9d95('0x3f')]=widgetAttributes(_0x398576['body']);return db['DashboardItem']['find']({'where':{'id':_0x398576[_0x9d95('0x2d')]['id']}})[_0x9d95('0x25')](handleEntityNotFound(_0x17fb53,null))[_0x9d95('0x25')](saveUpdates(_0x398576[_0x9d95('0x5a')],null))[_0x9d95('0x25')](respondWithResult(_0x17fb53,null))['catch'](handleError(_0x17fb53,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index bc004e0..fddd236 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 _0x7b83=['../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b83,0x144));var _0x37b8=function(_0x543180,_0x2db25f){_0x543180=_0x543180-0x0;var _0x285924=_0x7b83[_0x543180];return _0x285924;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x37b8('0x0'))['db'][_0x37b8('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x37b8('0x2')](0x0);var events={'afterCreate':_0x37b8('0x3'),'afterUpdate':_0x37b8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3de137){return function(_0x64504e,_0x26e19e,_0x577030){DashboardItemEvents[_0x37b8('0x5')](_0x3de137+':'+_0x64504e['id'],_0x64504e);DashboardItemEvents[_0x37b8('0x5')](_0x3de137,_0x64504e);_0x577030(null);};}for(var e in events){if(events[_0x37b8('0x6')](e)){var event=events[e];DashboardItem[_0x37b8('0x7')](e,emitEvent(event));}}module[_0x37b8('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x3521=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x2c8878,_0x316b6d){var _0x4c94f6=function(_0x13bcf1){while(--_0x13bcf1){_0x2c8878['push'](_0x2c8878['shift']());}};_0x4c94f6(++_0x316b6d);}(_0x3521,0x19a));var _0x1352=function(_0x59481b,_0x4c7624){_0x59481b=_0x59481b-0x0;var _0x55e559=_0x3521[_0x59481b];return _0x55e559;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x1352('0x0'))['db'][_0x1352('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1352('0x2')](0x0);var events={'afterCreate':_0x1352('0x3'),'afterUpdate':_0x1352('0x4'),'afterDestroy':_0x1352('0x5')};function emitEvent(_0x548a9a){return function(_0x3f03c0,_0x509758,_0x3ccc40){DashboardItemEvents['emit'](_0x548a9a+':'+_0x3f03c0['id'],_0x3f03c0);DashboardItemEvents[_0x1352('0x6')](_0x548a9a,_0x3f03c0);_0x3ccc40(null);};}for(var e in events){if(events[_0x1352('0x7')](e)){var event=events[e];DashboardItem[_0x1352('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index deaf573..106a036 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 _0x23f5=['path','./dashboardItem.attributes','define','DashboardItem','dashboard_items','lodash','../../config/logger','moment','bluebird'];(function(_0x124702,_0x5d3303){var _0x57c495=function(_0x15b49f){while(--_0x15b49f){_0x124702['push'](_0x124702['shift']());}};_0x57c495(++_0x5d3303);}(_0x23f5,0x95));var _0x523f=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x23f5[_0x4314d7];return _0x5c599b;};'use strict';var _=require(_0x523f('0x0'));var util=require('util');var logger=require(_0x523f('0x1'))('api');var moment=require(_0x523f('0x2'));var BPromise=require(_0x523f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x523f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x523f('0x5'));module['exports']=function(_0x5c21a1,_0x5b10e7){return _0x5c21a1[_0x523f('0x6')](_0x523f('0x7'),attributes,{'tableName':_0x523f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c32=['../../config/environment','./dashboardItem.attributes','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xcb6d2b,_0x1a56ac){var _0x2c3687=function(_0x1b6ed0){while(--_0x1b6ed0){_0xcb6d2b['push'](_0xcb6d2b['shift']());}};_0x2c3687(++_0x1a56ac);}(_0x8c32,0x89));var _0x28c3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8c32[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var logger=require(_0x28c3('0x2'))(_0x28c3('0x3'));var moment=require('moment');var BPromise=require(_0x28c3('0x4'));var rp=require(_0x28c3('0x5'));var fs=require('fs');var path=require(_0x28c3('0x6'));var rimraf=require('rimraf');var config=require(_0x28c3('0x7'));var attributes=require(_0x28c3('0x8'));module['exports']=function(_0x893928,_0x32a8aa){return _0x893928[_0x28c3('0x9')](_0x28c3('0xa'),attributes,{'tableName':_0x28c3('0xb'),'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 acd3532..216da46 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 _0x066c=['result','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x066c,0x65));var _0xc066=function(_0x2125ba,_0x2c3614){_0x2125ba=_0x2125ba-0x0;var _0x5bfa51=_0x066c[_0x2125ba];return _0x5bfa51;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc066('0x0'));var BPromise=require(_0xc066('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc066('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc066('0x3'));var logger=require(_0xc066('0x4'))(_0xc066('0x5'));var config=require('../../config/environment');var jayson=require(_0xc066('0x6'));var client=jayson[_0xc066('0x7')][_0xc066('0x8')]({'port':0x232a});config[_0xc066('0x9')]=_[_0xc066('0xa')](config[_0xc066('0x9')],{'host':_0xc066('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc066('0x9')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x1b4655,_0xbb12a5,_0xf3e991){return new BPromise(function(_0x193147,_0x43317d){return client['request'](_0x1b4655,_0xf3e991)[_0xc066('0xc')](function(_0x3b140b){logger[_0xc066('0xd')](_0xc066('0xe'),_0xbb12a5,_0xc066('0xf'));logger[_0xc066('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0xbb12a5,_0xc066('0xf'),JSON['stringify'](_0x3b140b));if(_0x3b140b[_0xc066('0x11')]){if(_0x3b140b[_0xc066('0x11')]['code']===0x1f4){logger[_0xc066('0x11')](_0xc066('0xe'),_0xbb12a5,_0x3b140b[_0xc066('0x11')]['message']);return _0x43317d(_0x3b140b[_0xc066('0x11')][_0xc066('0x12')]);}logger['error'](_0xc066('0xe'),_0xbb12a5,_0x3b140b['error'][_0xc066('0x12')]);return _0x193147(_0x3b140b['error']['message']);}else{logger['info'](_0xc066('0xe'),_0xbb12a5,'request\x20sent');_0x193147(_0x3b140b[_0xc066('0x13')]['message']);}})['catch'](function(_0x596b2e){logger['error'](_0xc066('0xe'),_0xbb12a5,_0x596b2e);_0x43317d(_0x596b2e);});});} \ No newline at end of file +var _0x5bce=['info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x21953d,_0x51c1cc){var _0x15e460=function(_0x119763){while(--_0x119763){_0x21953d['push'](_0x21953d['shift']());}};_0x15e460(++_0x51c1cc);}(_0x5bce,0x1b2));var _0xe5bc=function(_0x8854f2,_0x79542c){_0x8854f2=_0x8854f2-0x0;var _0x38505d=_0x5bce[_0x8854f2];return _0x38505d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe5bc('0x0'));var BPromise=require(_0xe5bc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5bc('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5bc('0x3'));var logger=require(_0xe5bc('0x4'))(_0xe5bc('0x5'));var config=require(_0xe5bc('0x6'));var jayson=require(_0xe5bc('0x7'));var client=jayson['client'][_0xe5bc('0x8')]({'port':0x232a});config[_0xe5bc('0x9')]=_[_0xe5bc('0xa')](config['redis'],{'host':_0xe5bc('0xb'),'port':0x18eb});var socket=require(_0xe5bc('0xc'))(new Redis(config[_0xe5bc('0x9')]));require('./dashboardItem.socket')[_0xe5bc('0xd')](socket);function respondWithRpcPromise(_0x23f742,_0x1b6874,_0x962aa1){return new BPromise(function(_0x1d8804,_0x563d4b){return client[_0xe5bc('0xe')](_0x23f742,_0x962aa1)[_0xe5bc('0xf')](function(_0x2ee23e){logger[_0xe5bc('0x10')](_0xe5bc('0x11'),_0x1b6874,_0xe5bc('0x12'));logger[_0xe5bc('0x13')](_0xe5bc('0x14'),_0x1b6874,'request\x20sent',JSON['stringify'](_0x2ee23e));if(_0x2ee23e[_0xe5bc('0x15')]){if(_0x2ee23e[_0xe5bc('0x15')]['code']===0x1f4){logger['error'](_0xe5bc('0x11'),_0x1b6874,_0x2ee23e[_0xe5bc('0x15')][_0xe5bc('0x16')]);return _0x563d4b(_0x2ee23e['error'][_0xe5bc('0x16')]);}logger[_0xe5bc('0x15')](_0xe5bc('0x11'),_0x1b6874,_0x2ee23e[_0xe5bc('0x15')]['message']);return _0x1d8804(_0x2ee23e[_0xe5bc('0x15')]['message']);}else{logger[_0xe5bc('0x10')](_0xe5bc('0x11'),_0x1b6874,_0xe5bc('0x12'));_0x1d8804(_0x2ee23e[_0xe5bc('0x17')][_0xe5bc('0x16')]);}})[_0xe5bc('0x18')](function(_0x3e0865){logger[_0xe5bc('0x15')](_0xe5bc('0x11'),_0x1b6874,_0x3e0865);_0x563d4b(_0x3e0865);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 442d8a7..bd8bbd8 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 _0xd0eb=['./dashboardItem.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2d36a6,_0x2f8cd0){var _0x59cec0=function(_0x5a56d0){while(--_0x5a56d0){_0x2d36a6['push'](_0x2d36a6['shift']());}};_0x59cec0(++_0x2f8cd0);}(_0xd0eb,0x168));var _0xbd0e=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0xd0eb[_0x3ef2d5];return _0x2fefb2;};'use strict';var DashboardItemEvents=require(_0xbd0e('0x0'));var events=[_0xbd0e('0x1'),_0xbd0e('0x2'),_0xbd0e('0x3')];function createListener(_0x48a240,_0x325eb8){return function(_0x5fbcae){_0x325eb8[_0xbd0e('0x4')](_0x48a240,_0x5fbcae);};}function removeListener(_0x47bbb5,_0x189b4f){return function(){DashboardItemEvents[_0xbd0e('0x5')](_0x47bbb5,_0x189b4f);};}exports[_0xbd0e('0x6')]=function(_0x5d8357){for(var _0xb037=0x0,_0x513537=events[_0xbd0e('0x7')];_0xb037<_0x513537;_0xb037++){var _0x46dab1=events[_0xb037];var _0x377a0a=createListener('dashboardItem:'+_0x46dab1,_0x5d8357);DashboardItemEvents['on'](_0x46dab1,_0x377a0a);}}; \ No newline at end of file +var _0x1a3b=['length','save','remove','update','removeListener','register'];(function(_0x12cdb1,_0x32b0d1){var _0x4e953f=function(_0xe1e004){while(--_0xe1e004){_0x12cdb1['push'](_0x12cdb1['shift']());}};_0x4e953f(++_0x32b0d1);}(_0x1a3b,0x13f));var _0xb1a3=function(_0x25ca2b,_0x3960c7){_0x25ca2b=_0x25ca2b-0x0;var _0x2924ad=_0x1a3b[_0x25ca2b];return _0x2924ad;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xb1a3('0x0'),_0xb1a3('0x1'),_0xb1a3('0x2')];function createListener(_0x1ecd9a,_0x1ca2e4){return function(_0x15bff0){_0x1ca2e4['emit'](_0x1ecd9a,_0x15bff0);};}function removeListener(_0x199ea7,_0xad80cf){return function(){DashboardItemEvents[_0xb1a3('0x3')](_0x199ea7,_0xad80cf);};}exports[_0xb1a3('0x4')]=function(_0x4d2492){for(var _0x2afa10=0x0,_0x3b94c0=events[_0xb1a3('0x5')];_0x2afa10<_0x3b94c0;_0x2afa10++){var _0x51343c=events[_0x2afa10];var _0x5f0e4f=createListener('dashboardItem:'+_0x51343c,_0x4d2492);DashboardItemEvents['on'](_0x51343c,_0x5f0e4f);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 59d3742..f1d3dbf 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 _0x9468=['../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','post','update','delete','exports','path','express','Router','fs-extra'];(function(_0x2d26e7,_0x552a1c){var _0xc56b84=function(_0x4b5384){while(--_0x4b5384){_0x2d26e7['push'](_0x2d26e7['shift']());}};_0xc56b84(++_0x552a1c);}(_0x9468,0xf8));var _0x8946=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x9468[_0x15fc3c];return _0x94c5c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8946('0x0'));var timeout=require('connect-timeout');var express=require(_0x8946('0x1'));var router=express[_0x8946('0x2')]();var fs_extra=require(_0x8946('0x3'));var auth=require(_0x8946('0x4'));var interaction=require(_0x8946('0x5'));var config=require(_0x8946('0x6'));var controller=require('./dashboardItem.controller');router['get'](_0x8946('0x7'),auth[_0x8946('0x8')](),controller[_0x8946('0x9')]);router[_0x8946('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8946('0x7'),auth[_0x8946('0x8')](),controller[_0x8946('0xb')]);router[_0x8946('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8946('0xd')]=router; \ No newline at end of file +var _0x4aae=['exports','multer','util','fs-extra','../../components/interaction/service','./dashboardItem.controller','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4aae,0x6a));var _0xe4aa=function(_0x1aa321,_0x3599a3){_0x1aa321=_0x1aa321-0x0;var _0x43d045=_0x4aae[_0x1aa321];return _0x43d045;};'use strict';var multer=require(_0xe4aa('0x0'));var util=require(_0xe4aa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe4aa('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xe4aa('0x3'));var config=require('../../config/environment');var controller=require(_0xe4aa('0x4'));router['get']('/:id',auth[_0xe4aa('0x5')](),controller[_0xe4aa('0x6')]);router[_0xe4aa('0x7')]('/',auth[_0xe4aa('0x5')](),controller[_0xe4aa('0x8')]);router[_0xe4aa('0x9')](_0xe4aa('0xa'),auth[_0xe4aa('0x5')](),controller[_0xe4aa('0xb')]);router[_0xe4aa('0xc')](_0xe4aa('0xa'),auth[_0xe4aa('0x5')](),controller[_0xe4aa('0xd')]);module[_0xe4aa('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index cec10ba..7229b73 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 _0xc685=['exports','first','second','third','STRING'];(function(_0x26713c,_0x5a5a6c){var _0x5f5768=function(_0x5ed1fa){while(--_0x5ed1fa){_0x26713c['push'](_0x26713c['shift']());}};_0x5f5768(++_0x5a5a6c);}(_0xc685,0x181));var _0x5c68=function(_0x11bb07,_0x121f28){_0x11bb07=_0x11bb07-0x0;var _0x2d0af5=_0xc685[_0x11bb07];return _0x2d0af5;};'use strict';var Sequelize=require('sequelize');module[_0x5c68('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x5c68('0x1'),_0x5c68('0x2'),_0x5c68('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x5c68('0x4')]}}; \ No newline at end of file +var _0xbc27=['sequelize','first','second','STRING'];(function(_0x16fd19,_0x7812f8){var _0xaed93d=function(_0x2d8667){while(--_0x2d8667){_0x16fd19['push'](_0x16fd19['shift']());}};_0xaed93d(++_0x7812f8);}(_0xbc27,0x1f4));var _0x7bc2=function(_0x56a67c,_0x9640dc){_0x56a67c=_0x56a67c-0x0;var _0x4f6c83=_0xbc27[_0x56a67c];return _0x4f6c83;};'use strict';var Sequelize=require(_0x7bc2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x7bc2('0x1'),_0x7bc2('0x2'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x7bc2('0x3')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index c379901..d930f59 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 _0x24e3=['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','json','undefined','limit','set','Content-Range','apply','reject','then','get','destroy','stack','name','send','index','Disposition','fieldName','type','key','map','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','options','count','includeAll','include','findAll','rows','show','params','keys','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','Dispositions','UserProfileSection','find','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4e933d,_0x3bc444){var _0x5cde0b=function(_0x294c31){while(--_0x294c31){_0x4e933d['push'](_0x4e933d['shift']());}};_0x5cde0b(++_0x3bc444);}(_0x24e3,0x1a4));var _0x324e=function(_0x5159fd,_0x4ced8e){_0x5159fd=_0x5159fd-0x0;var _0x3d5f6a=_0x24e3[_0x5159fd];return _0x3d5f6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x324e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x324e('0x1'));var rp=require(_0x324e('0x2'));var moment=require(_0x324e('0x3'));var BPromise=require(_0x324e('0x4'));var Mustache=require(_0x324e('0x5'));var util=require(_0x324e('0x6'));var path=require(_0x324e('0x7'));var sox=require(_0x324e('0x8'));var csv=require(_0x324e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x324e('0xa'));var _=require(_0x324e('0xb'));var squel=require(_0x324e('0xc'));var crypto=require(_0x324e('0xd'));var jsforce=require(_0x324e('0xe'));var deskjs=require(_0x324e('0xf'));var toCsv=require(_0x324e('0x9'));var querystring=require('querystring');var Papa=require(_0x324e('0x10'));var Redis=require(_0x324e('0x11'));var authService=require(_0x324e('0x12'));var qs=require(_0x324e('0x13'));var as=require(_0x324e('0x14'));var hardwareService=require(_0x324e('0x15'));var logger=require(_0x324e('0x16'))(_0x324e('0x17'));var utils=require(_0x324e('0x18'));var config=require(_0x324e('0x19'));var licenseUtil=require(_0x324e('0x1a'));var db=require(_0x324e('0x1b'))['db'];function respondWithStatusCode(_0x2012f7,_0x39961b){_0x39961b=_0x39961b||0xcc;return function(_0xe8db6f){if(_0xe8db6f){return _0x2012f7[_0x324e('0x1c')](_0x39961b);}return _0x2012f7[_0x324e('0x1d')](_0x39961b)[_0x324e('0x1e')]();};}function respondWithResult(_0x545f9c,_0x3b6be3){_0x3b6be3=_0x3b6be3||0xc8;return function(_0x328510){if(_0x328510){return _0x545f9c['status'](_0x3b6be3)[_0x324e('0x1f')](_0x328510);}};}function respondWithFilteredResult(_0x350084,_0x508d0d){return function(_0x3bcbc1){if(_0x3bcbc1){var _0x2a77ec=typeof _0x508d0d['offset']===_0x324e('0x20')&&typeof _0x508d0d[_0x324e('0x21')]===_0x324e('0x20');var _0x28d32e=_0x3bcbc1['count'];var _0x4f1bb1=_0x2a77ec?0x0:_0x508d0d['offset'];var _0x2fea3a=_0x2a77ec?_0x3bcbc1['count']:_0x508d0d['offset']+_0x508d0d['limit'];var _0x5084c6;if(_0x2fea3a>=_0x28d32e){_0x2fea3a=_0x28d32e;_0x5084c6=0xc8;}else{_0x5084c6=0xce;}_0x350084['status'](_0x5084c6);return _0x350084[_0x324e('0x22')](_0x324e('0x23'),_0x4f1bb1+'-'+_0x2fea3a+'/'+_0x28d32e)[_0x324e('0x1f')](_0x3bcbc1);}return null;};}function patchUpdates(_0xf728ec){return function(_0x381480){try{jsonpatch[_0x324e('0x24')](_0x381480,_0xf728ec,!![]);}catch(_0x2c3d26){return BPromise[_0x324e('0x25')](_0x2c3d26);}return _0x381480['save']();};}function saveUpdates(_0x4a4010,_0x136573){return function(_0x500de1){if(_0x500de1){return _0x500de1['update'](_0x4a4010)[_0x324e('0x26')](function(_0x387635){return _0x387635;});}return null;};}function removeEntity(_0x1396be,_0x2419e5){return function(_0x3bd6f0){if(_0x3bd6f0){return _0x3bd6f0['destroy']()[_0x324e('0x26')](function(){var _0x3bb4cd=_0x3bd6f0[_0x324e('0x27')]({'plain':!![]});var _0x43e827='Dispositions';return db['UserProfileResource'][_0x324e('0x28')]({'where':{'type':_0x43e827,'resourceId':_0x3bb4cd['id']}})[_0x324e('0x26')](function(){return _0x3bd6f0;});})['then'](function(){_0x1396be[_0x324e('0x1d')](0xcc)[_0x324e('0x1e')]();});}};}function handleEntityNotFound(_0xfcc569,_0x1c5671){return function(_0x49f942){if(!_0x49f942){_0xfcc569['sendStatus'](0x194);}return _0x49f942;};}function handleError(_0x180a44,_0x22a7c3){_0x22a7c3=_0x22a7c3||0x1f4;return function(_0x5b4757){logger['error'](_0x5b4757[_0x324e('0x29')]);if(_0x5b4757[_0x324e('0x2a')]){delete _0x5b4757['name'];}_0x180a44[_0x324e('0x1d')](_0x22a7c3)[_0x324e('0x2b')](_0x5b4757);};}exports[_0x324e('0x2c')]=function(_0x139033,_0x4d8827){var _0x53f10a={},_0x4663c7={},_0x4c5c97={'count':0x0,'rows':[]};var _0x1c2f9f=_['map'](db[_0x324e('0x2d')]['rawAttributes'],function(_0x5bece1){return{'name':_0x5bece1[_0x324e('0x2e')],'type':_0x5bece1[_0x324e('0x2f')][_0x324e('0x30')]};});_0x4663c7['model']=_[_0x324e('0x31')](_0x1c2f9f,_0x324e('0x2a'));_0x4663c7[_0x324e('0x32')]=_['keys'](_0x139033[_0x324e('0x32')]);_0x4663c7[_0x324e('0x33')]=_[_0x324e('0x34')](_0x4663c7['model'],_0x4663c7[_0x324e('0x32')]);_0x53f10a[_0x324e('0x35')]=_[_0x324e('0x34')](_0x4663c7['model'],qs[_0x324e('0x36')](_0x139033[_0x324e('0x32')]['fields']));_0x53f10a[_0x324e('0x35')]=_0x53f10a['attributes'][_0x324e('0x37')]?_0x53f10a[_0x324e('0x35')]:_0x4663c7[_0x324e('0x38')];if(!_0x139033['query'][_0x324e('0x39')](_0x324e('0x3a'))){_0x53f10a[_0x324e('0x21')]=qs[_0x324e('0x21')](_0x139033[_0x324e('0x32')]['limit']);_0x53f10a[_0x324e('0x3b')]=qs[_0x324e('0x3b')](_0x139033[_0x324e('0x32')][_0x324e('0x3b')]);}_0x53f10a[_0x324e('0x3c')]=qs[_0x324e('0x3d')](_0x139033[_0x324e('0x32')][_0x324e('0x3d')]);_0x53f10a[_0x324e('0x3e')]=qs['filters'](_[_0x324e('0x3f')](_0x139033[_0x324e('0x32')],_0x4663c7['filters']),_0x1c2f9f);if(_0x139033[_0x324e('0x32')]['filter']){_0x53f10a[_0x324e('0x3e')]=_[_0x324e('0x40')](_0x53f10a[_0x324e('0x3e')],{'$or':_['map'](_0x1c2f9f,function(_0x3ddfa5){if(_0x3ddfa5['type']!=='VIRTUAL'){var _0x3291a0={};_0x3291a0[_0x3ddfa5[_0x324e('0x2a')]]={'$like':'%'+_0x139033['query'][_0x324e('0x41')]+'%'};return _0x3291a0;}})});}_0x53f10a=_[_0x324e('0x40')]({},_0x53f10a,_0x139033[_0x324e('0x42')]);var _0x49bdd1={'where':_0x53f10a[_0x324e('0x3e')]};return db[_0x324e('0x2d')][_0x324e('0x43')](_0x49bdd1)[_0x324e('0x26')](function(_0x1e7b8a){_0x4c5c97[_0x324e('0x43')]=_0x1e7b8a;if(_0x139033['query'][_0x324e('0x44')]){_0x53f10a[_0x324e('0x45')]=[{'all':!![]}];}return db[_0x324e('0x2d')][_0x324e('0x46')](_0x53f10a);})[_0x324e('0x26')](function(_0x42789e){_0x4c5c97[_0x324e('0x47')]=_0x42789e;return _0x4c5c97;})[_0x324e('0x26')](respondWithFilteredResult(_0x4d8827,_0x53f10a))['catch'](handleError(_0x4d8827,null));};exports[_0x324e('0x48')]=function(_0x1ee44b,_0xbc37da){var _0x39ad14={'raw':!![],'where':{'id':_0x1ee44b[_0x324e('0x49')]['id']}},_0x5622bc={};_0x5622bc[_0x324e('0x38')]=_[_0x324e('0x4a')](db[_0x324e('0x2d')][_0x324e('0x4b')]);_0x5622bc[_0x324e('0x32')]=_[_0x324e('0x4a')](_0x1ee44b[_0x324e('0x32')]);_0x5622bc['filters']=_['intersection'](_0x5622bc[_0x324e('0x38')],_0x5622bc[_0x324e('0x32')]);_0x39ad14[_0x324e('0x35')]=_[_0x324e('0x34')](_0x5622bc[_0x324e('0x38')],qs['fields'](_0x1ee44b[_0x324e('0x32')][_0x324e('0x36')]));_0x39ad14[_0x324e('0x35')]=_0x39ad14[_0x324e('0x35')][_0x324e('0x37')]?_0x39ad14['attributes']:_0x5622bc[_0x324e('0x38')];if(_0x1ee44b[_0x324e('0x32')][_0x324e('0x44')]){_0x39ad14['include']=[{'all':!![]}];}_0x39ad14=_['merge']({},_0x39ad14,_0x1ee44b[_0x324e('0x42')]);return db[_0x324e('0x2d')]['find'](_0x39ad14)[_0x324e('0x26')](handleEntityNotFound(_0xbc37da,null))['then'](respondWithResult(_0xbc37da,null))['catch'](handleError(_0xbc37da,null));};exports[_0x324e('0x4c')]=function(_0x40d4ce,_0x369278){return db[_0x324e('0x2d')][_0x324e('0x4c')](_0x40d4ce['body'],{})[_0x324e('0x26')](function(_0x56b7db){var _0x40a1aa=_0x40d4ce['user'][_0x324e('0x27')]({'plain':!![]});if(!_0x40a1aa)throw new Error(_0x324e('0x4d'));if(_0x40a1aa['role']==='user'){var _0x21bbd9=_0x56b7db[_0x324e('0x27')]({'plain':!![]});var _0x3c1b6c=_0x324e('0x4e');return db[_0x324e('0x4f')][_0x324e('0x50')]({'where':{'name':_0x3c1b6c,'userProfileId':_0x40a1aa['userProfileId']},'raw':!![]})[_0x324e('0x26')](function(_0x2b8bbf){if(_0x2b8bbf&&_0x2b8bbf[_0x324e('0x51')]===0x0){return db[_0x324e('0x52')][_0x324e('0x4c')]({'name':_0x21bbd9[_0x324e('0x2a')],'resourceId':_0x21bbd9['id'],'type':_0x2b8bbf[_0x324e('0x2a')],'sectionId':_0x2b8bbf['id']},{})[_0x324e('0x26')](function(){return _0x56b7db;});}else{return _0x56b7db;}})[_0x324e('0x53')](function(_0x58f939){logger['error'](_0x324e('0x54'),_0x58f939);throw _0x58f939;});}return _0x56b7db;})[_0x324e('0x26')](respondWithResult(_0x369278,0xc9))[_0x324e('0x53')](handleError(_0x369278,null));};exports[_0x324e('0x55')]=function(_0x4b7857,_0x108f2d){if(_0x4b7857[_0x324e('0x56')]['id']){delete _0x4b7857[_0x324e('0x56')]['id'];}return db[_0x324e('0x2d')][_0x324e('0x50')]({'where':{'id':_0x4b7857[_0x324e('0x49')]['id']}})[_0x324e('0x26')](handleEntityNotFound(_0x108f2d,null))['then'](saveUpdates(_0x4b7857['body'],null))['then'](respondWithResult(_0x108f2d,null))['catch'](handleError(_0x108f2d,null));};exports[_0x324e('0x28')]=function(_0x59e0cf,_0x41018a){return db['Disposition'][_0x324e('0x50')]({'where':{'id':_0x59e0cf[_0x324e('0x49')]['id']}})['then'](handleEntityNotFound(_0x41018a,null))[_0x324e('0x26')](removeEntity(_0x41018a,null))[_0x324e('0x53')](handleError(_0x41018a,null));}; \ No newline at end of file +var _0xa751=['index','map','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','rows','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','Dispositions','sendStatus','error','stack','name'];(function(_0x41a2ae,_0x44d8fc){var _0xd796af=function(_0x3a16c6){while(--_0x3a16c6){_0x41a2ae['push'](_0x41a2ae['shift']());}};_0xd796af(++_0x44d8fc);}(_0xa751,0x175));var _0x1a75=function(_0x58efc3,_0x16df8b){_0x58efc3=_0x58efc3-0x0;var _0x3e1270=_0xa751[_0x58efc3];return _0x3e1270;};'use strict';var emlformat=require(_0x1a75('0x0'));var rimraf=require(_0x1a75('0x1'));var zipdir=require(_0x1a75('0x2'));var jsonpatch=require(_0x1a75('0x3'));var rp=require('request-promise');var moment=require(_0x1a75('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a75('0x5'));var util=require(_0x1a75('0x6'));var path=require(_0x1a75('0x7'));var sox=require('sox');var csv=require(_0x1a75('0x8'));var ejs=require(_0x1a75('0x9'));var fs=require('fs');var fs_extra=require(_0x1a75('0xa'));var _=require(_0x1a75('0xb'));var squel=require(_0x1a75('0xc'));var crypto=require(_0x1a75('0xd'));var jsforce=require(_0x1a75('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a75('0xf'));var Redis=require(_0x1a75('0x10'));var authService=require(_0x1a75('0x11'));var qs=require(_0x1a75('0x12'));var as=require(_0x1a75('0x13'));var hardwareService=require(_0x1a75('0x14'));var logger=require(_0x1a75('0x15'))(_0x1a75('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a75('0x17'))['db'];function respondWithStatusCode(_0x24e8dc,_0xae1af0){_0xae1af0=_0xae1af0||0xcc;return function(_0x1220e4){if(_0x1220e4){return _0x24e8dc['sendStatus'](_0xae1af0);}return _0x24e8dc['status'](_0xae1af0)[_0x1a75('0x18')]();};}function respondWithResult(_0xf4a616,_0x48577b){_0x48577b=_0x48577b||0xc8;return function(_0x1c84d3){if(_0x1c84d3){return _0xf4a616[_0x1a75('0x19')](_0x48577b)['json'](_0x1c84d3);}};}function respondWithFilteredResult(_0x1f3c38,_0xb4a245){return function(_0x15a1ec){if(_0x15a1ec){var _0x5883df=typeof _0xb4a245['offset']==='undefined'&&typeof _0xb4a245[_0x1a75('0x1a')]===_0x1a75('0x1b');var _0x2b6f3d=_0x15a1ec[_0x1a75('0x1c')];var _0x1b1af2=_0x5883df?0x0:_0xb4a245[_0x1a75('0x1d')];var _0x47f384=_0x5883df?_0x15a1ec[_0x1a75('0x1c')]:_0xb4a245['offset']+_0xb4a245['limit'];var _0x42df2c;if(_0x47f384>=_0x2b6f3d){_0x47f384=_0x2b6f3d;_0x42df2c=0xc8;}else{_0x42df2c=0xce;}_0x1f3c38[_0x1a75('0x19')](_0x42df2c);return _0x1f3c38['set'](_0x1a75('0x1e'),_0x1b1af2+'-'+_0x47f384+'/'+_0x2b6f3d)['json'](_0x15a1ec);}return null;};}function patchUpdates(_0x4699c9){return function(_0x3e3549){try{jsonpatch[_0x1a75('0x1f')](_0x3e3549,_0x4699c9,!![]);}catch(_0x340750){return BPromise[_0x1a75('0x20')](_0x340750);}return _0x3e3549[_0x1a75('0x21')]();};}function saveUpdates(_0x5a0ad7,_0x3ed5e9){return function(_0x4dc595){if(_0x4dc595){return _0x4dc595[_0x1a75('0x22')](_0x5a0ad7)[_0x1a75('0x23')](function(_0x320413){return _0x320413;});}return null;};}function removeEntity(_0x59e3da,_0x443ff8){return function(_0x5e6617){if(_0x5e6617){return _0x5e6617[_0x1a75('0x24')]()[_0x1a75('0x23')](function(){var _0x3dd52d=_0x5e6617['get']({'plain':!![]});var _0x9fe9fe=_0x1a75('0x25');return db['UserProfileResource'][_0x1a75('0x24')]({'where':{'type':_0x9fe9fe,'resourceId':_0x3dd52d['id']}})[_0x1a75('0x23')](function(){return _0x5e6617;});})['then'](function(){_0x59e3da[_0x1a75('0x19')](0xcc)[_0x1a75('0x18')]();});}};}function handleEntityNotFound(_0x34c106,_0x184d87){return function(_0x4ba38b){if(!_0x4ba38b){_0x34c106[_0x1a75('0x26')](0x194);}return _0x4ba38b;};}function handleError(_0x2744ab,_0x19dc59){_0x19dc59=_0x19dc59||0x1f4;return function(_0x2f5ac9){logger[_0x1a75('0x27')](_0x2f5ac9[_0x1a75('0x28')]);if(_0x2f5ac9[_0x1a75('0x29')]){delete _0x2f5ac9[_0x1a75('0x29')];}_0x2744ab['status'](_0x19dc59)['send'](_0x2f5ac9);};}exports[_0x1a75('0x2a')]=function(_0x565cb6,_0x1a0359){var _0x11f25b={},_0x6f02dc={},_0x2ab8ba={'count':0x0,'rows':[]};var _0x1db620=_[_0x1a75('0x2b')](db['Disposition']['rawAttributes'],function(_0x4c30d5){return{'name':_0x4c30d5[_0x1a75('0x2c')],'type':_0x4c30d5[_0x1a75('0x2d')][_0x1a75('0x2e')]};});_0x6f02dc[_0x1a75('0x2f')]=_['map'](_0x1db620,'name');_0x6f02dc['query']=_[_0x1a75('0x30')](_0x565cb6[_0x1a75('0x31')]);_0x6f02dc['filters']=_['intersection'](_0x6f02dc[_0x1a75('0x2f')],_0x6f02dc['query']);_0x11f25b[_0x1a75('0x32')]=_[_0x1a75('0x33')](_0x6f02dc[_0x1a75('0x2f')],qs['fields'](_0x565cb6['query'][_0x1a75('0x34')]));_0x11f25b[_0x1a75('0x32')]=_0x11f25b[_0x1a75('0x32')][_0x1a75('0x35')]?_0x11f25b[_0x1a75('0x32')]:_0x6f02dc[_0x1a75('0x2f')];if(!_0x565cb6[_0x1a75('0x31')][_0x1a75('0x36')](_0x1a75('0x37'))){_0x11f25b[_0x1a75('0x1a')]=qs[_0x1a75('0x1a')](_0x565cb6[_0x1a75('0x31')][_0x1a75('0x1a')]);_0x11f25b[_0x1a75('0x1d')]=qs[_0x1a75('0x1d')](_0x565cb6[_0x1a75('0x31')]['offset']);}_0x11f25b[_0x1a75('0x38')]=qs['sort'](_0x565cb6['query'][_0x1a75('0x39')]);_0x11f25b[_0x1a75('0x3a')]=qs[_0x1a75('0x3b')](_[_0x1a75('0x3c')](_0x565cb6[_0x1a75('0x31')],_0x6f02dc['filters']),_0x1db620);if(_0x565cb6[_0x1a75('0x31')][_0x1a75('0x3d')]){_0x11f25b[_0x1a75('0x3a')]=_[_0x1a75('0x3e')](_0x11f25b[_0x1a75('0x3a')],{'$or':_['map'](_0x1db620,function(_0x3cf3f2){if(_0x3cf3f2['type']!==_0x1a75('0x3f')){var _0x39b214={};_0x39b214[_0x3cf3f2[_0x1a75('0x29')]]={'$like':'%'+_0x565cb6[_0x1a75('0x31')][_0x1a75('0x3d')]+'%'};return _0x39b214;}})});}_0x11f25b=_[_0x1a75('0x3e')]({},_0x11f25b,_0x565cb6[_0x1a75('0x40')]);var _0x4dcae1={'where':_0x11f25b['where']};return db[_0x1a75('0x41')]['count'](_0x4dcae1)[_0x1a75('0x23')](function(_0x14abcf){_0x2ab8ba[_0x1a75('0x1c')]=_0x14abcf;if(_0x565cb6['query'][_0x1a75('0x42')]){_0x11f25b[_0x1a75('0x43')]=[{'all':!![]}];}return db[_0x1a75('0x41')]['findAll'](_0x11f25b);})[_0x1a75('0x23')](function(_0x15fe49){_0x2ab8ba[_0x1a75('0x44')]=_0x15fe49;return _0x2ab8ba;})[_0x1a75('0x23')](respondWithFilteredResult(_0x1a0359,_0x11f25b))[_0x1a75('0x45')](handleError(_0x1a0359,null));};exports[_0x1a75('0x46')]=function(_0x3300a4,_0x5cd14d){var _0x9f705c={'raw':!![],'where':{'id':_0x3300a4[_0x1a75('0x47')]['id']}},_0x302bc4={};_0x302bc4[_0x1a75('0x2f')]=_[_0x1a75('0x30')](db['Disposition'][_0x1a75('0x48')]);_0x302bc4[_0x1a75('0x31')]=_['keys'](_0x3300a4[_0x1a75('0x31')]);_0x302bc4['filters']=_[_0x1a75('0x33')](_0x302bc4['model'],_0x302bc4[_0x1a75('0x31')]);_0x9f705c[_0x1a75('0x32')]=_[_0x1a75('0x33')](_0x302bc4[_0x1a75('0x2f')],qs[_0x1a75('0x34')](_0x3300a4[_0x1a75('0x31')][_0x1a75('0x34')]));_0x9f705c['attributes']=_0x9f705c[_0x1a75('0x32')]['length']?_0x9f705c[_0x1a75('0x32')]:_0x302bc4[_0x1a75('0x2f')];if(_0x3300a4[_0x1a75('0x31')][_0x1a75('0x42')]){_0x9f705c[_0x1a75('0x43')]=[{'all':!![]}];}_0x9f705c=_[_0x1a75('0x3e')]({},_0x9f705c,_0x3300a4[_0x1a75('0x40')]);return db[_0x1a75('0x41')]['find'](_0x9f705c)[_0x1a75('0x23')](handleEntityNotFound(_0x5cd14d,null))[_0x1a75('0x23')](respondWithResult(_0x5cd14d,null))[_0x1a75('0x45')](handleError(_0x5cd14d,null));};exports[_0x1a75('0x49')]=function(_0x385382,_0x1b76d){return db[_0x1a75('0x41')][_0x1a75('0x49')](_0x385382[_0x1a75('0x4a')],{})[_0x1a75('0x23')](function(_0x2ca5f9){var _0x2428f3=_0x385382[_0x1a75('0x4b')][_0x1a75('0x4c')]({'plain':!![]});if(!_0x2428f3)throw new Error(_0x1a75('0x4d'));if(_0x2428f3['role']===_0x1a75('0x4b')){var _0xa20c25=_0x2ca5f9[_0x1a75('0x4c')]({'plain':!![]});var _0x11c40b=_0x1a75('0x25');return db[_0x1a75('0x4e')][_0x1a75('0x4f')]({'where':{'name':_0x11c40b,'userProfileId':_0x2428f3[_0x1a75('0x50')]},'raw':!![]})['then'](function(_0x29298f){if(_0x29298f&&_0x29298f['autoAssociation']===0x0){return db[_0x1a75('0x51')][_0x1a75('0x49')]({'name':_0xa20c25[_0x1a75('0x29')],'resourceId':_0xa20c25['id'],'type':_0x29298f['name'],'sectionId':_0x29298f['id']},{})['then'](function(){return _0x2ca5f9;});}else{return _0x2ca5f9;}})['catch'](function(_0x3f33d7){logger[_0x1a75('0x27')](_0x1a75('0x52'),_0x3f33d7);throw _0x3f33d7;});}return _0x2ca5f9;})[_0x1a75('0x23')](respondWithResult(_0x1b76d,0xc9))[_0x1a75('0x45')](handleError(_0x1b76d,null));};exports['update']=function(_0x436b0e,_0x41e5d8){if(_0x436b0e[_0x1a75('0x4a')]['id']){delete _0x436b0e[_0x1a75('0x4a')]['id'];}return db[_0x1a75('0x41')][_0x1a75('0x4f')]({'where':{'id':_0x436b0e['params']['id']}})['then'](handleEntityNotFound(_0x41e5d8,null))['then'](saveUpdates(_0x436b0e[_0x1a75('0x4a')],null))[_0x1a75('0x23')](respondWithResult(_0x41e5d8,null))[_0x1a75('0x45')](handleError(_0x41e5d8,null));};exports['destroy']=function(_0x50982d,_0x3e5926){return db[_0x1a75('0x41')]['find']({'where':{'id':_0x50982d[_0x1a75('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e5926,null))['then'](removeEntity(_0x3e5926,null))[_0x1a75('0x45')](handleError(_0x3e5926,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f8b9f7a..b299c17 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 _0xa962=['path','rimraf','./disposition.attributes','Disposition','ListId','name_chat','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa962,0x7e));var _0x2a96=function(_0x650389,_0x4b4b3b){_0x650389=_0x650389-0x0;var _0x4f13eb=_0xa962[_0x650389];return _0x4f13eb;};'use strict';var _=require(_0x2a96('0x0'));var util=require(_0x2a96('0x1'));var logger=require(_0x2a96('0x2'))(_0x2a96('0x3'));var moment=require(_0x2a96('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a96('0x5'));var fs=require('fs');var path=require(_0x2a96('0x6'));var rimraf=require(_0x2a96('0x7'));var config=require('../../config/environment');var attributes=require(_0x2a96('0x8'));module['exports']=function(_0x2c944a,_0x37f981){return _0x2c944a['define'](_0x2a96('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x2a96('0xa')]},{'unique':!![],'name':_0x2a96('0xb'),'fields':[_0x2a96('0xc'),_0x2a96('0xd')]},{'unique':!![],'name':_0x2a96('0xe'),'fields':[_0x2a96('0xc'),'MailAccountId']},{'unique':!![],'name':_0x2a96('0xf'),'fields':[_0x2a96('0xc'),_0x2a96('0x10')]},{'unique':!![],'name':_0x2a96('0x11'),'fields':['name',_0x2a96('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0x2a96('0xc'),_0x2a96('0x13')]},{'unique':!![],'name':_0x2a96('0x14'),'fields':[_0x2a96('0xc'),_0x2a96('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x26e8=['ChatWebsiteId','name_mail','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','path','exports','define','Disposition','tools_dispositions','name_voice','name','ListId'];(function(_0x3a45ba,_0x2c5ed2){var _0x2fa017=function(_0x1f615b){while(--_0x1f615b){_0x3a45ba['push'](_0x3a45ba['shift']());}};_0x2fa017(++_0x2c5ed2);}(_0x26e8,0x194));var _0x826e=function(_0x13610a,_0x4f866c){_0x13610a=_0x13610a-0x0;var _0x150ecc=_0x26e8[_0x13610a];return _0x150ecc;};'use strict';var _=require(_0x826e('0x0'));var util=require(_0x826e('0x1'));var logger=require('../../config/logger')(_0x826e('0x2'));var moment=require(_0x826e('0x3'));var BPromise=require(_0x826e('0x4'));var rp=require(_0x826e('0x5'));var fs=require('fs');var path=require(_0x826e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x826e('0x7')]=function(_0x70690,_0x42e2ca){return _0x70690[_0x826e('0x8')](_0x826e('0x9'),attributes,{'tableName':_0x826e('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x826e('0xb'),'fields':[_0x826e('0xc'),_0x826e('0xd')]},{'unique':!![],'name':'name_chat','fields':['name',_0x826e('0xe')]},{'unique':!![],'name':_0x826e('0xf'),'fields':[_0x826e('0xc'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x826e('0xc'),_0x826e('0x10')]},{'unique':!![],'name':_0x826e('0x11'),'fields':[_0x826e('0xc'),'FaxAccountId']},{'unique':!![],'name':_0x826e('0x12'),'fields':[_0x826e('0xc'),_0x826e('0x13')]},{'unique':!![],'name':_0x826e('0x14'),'fields':[_0x826e('0xc'),_0x826e('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d0a0788..7aa3e10 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(_0x1c0d8c,_0x5eacdf){var _0x368322=function(_0x4a5891){while(--_0x4a5891){_0x1c0d8c['push'](_0x1c0d8c['shift']());}};_0x368322(++_0x5eacdf);}(_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 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(_0x24c8de,_0x5469c8){var _0x2eb189=function(_0x5790ef){while(--_0x5790ef){_0x24c8de['push'](_0x24c8de['shift']());}};_0x2eb189(++_0x5469c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 745513e..d91bba8 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 _0x4eee=['path','connect-timeout','express','Router','../../components/auth/service','./disposition.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x4eee,0x1b9));var _0xe4ee=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0x4eee[_0x5cc51f];return _0x315a2f;};'use strict';var multer=require(_0xe4ee('0x0'));var util=require('util');var path=require(_0xe4ee('0x1'));var timeout=require(_0xe4ee('0x2'));var express=require(_0xe4ee('0x3'));var router=express[_0xe4ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe4ee('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe4ee('0x6'));router[_0xe4ee('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe4ee('0x7')](_0xe4ee('0x8'),auth[_0xe4ee('0x9')](),controller[_0xe4ee('0xa')]);router[_0xe4ee('0xb')]('/',auth[_0xe4ee('0x9')](),controller[_0xe4ee('0xc')]);router[_0xe4ee('0xd')](_0xe4ee('0x8'),auth['isAuthenticated'](),controller[_0xe4ee('0xe')]);router[_0xe4ee('0xf')](_0xe4ee('0x8'),auth['isAuthenticated'](),controller[_0xe4ee('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3931=['update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','post','create','put','/:id'];(function(_0x3325c8,_0x5701c2){var _0x3526f9=function(_0x442577){while(--_0x442577){_0x3325c8['push'](_0x3325c8['shift']());}};_0x3526f9(++_0x5701c2);}(_0x3931,0x1a3));var _0x1393=function(_0x2ab5d7,_0x1243d9){_0x2ab5d7=_0x2ab5d7-0x0;var _0x516388=_0x3931[_0x2ab5d7];return _0x516388;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1393('0x0'));var timeout=require(_0x1393('0x1'));var express=require('express');var router=express[_0x1393('0x2')]();var fs_extra=require(_0x1393('0x3'));var auth=require(_0x1393('0x4'));var interaction=require(_0x1393('0x5'));var config=require(_0x1393('0x6'));var controller=require('./disposition.controller');router['get']('/',auth[_0x1393('0x7')](),controller[_0x1393('0x8')]);router['get']('/:id',auth[_0x1393('0x7')](),controller['show']);router[_0x1393('0x9')]('/',auth[_0x1393('0x7')](),controller[_0x1393('0xa')]);router[_0x1393('0xb')](_0x1393('0xc'),auth[_0x1393('0x7')](),controller[_0x1393('0xd')]);router['delete']('/:id',auth[_0x1393('0x7')](),controller[_0x1393('0xe')]);module[_0x1393('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 0bbe0c3..5483830 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 _0x66d4=['sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','2400','14400','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66d4,0xdc));var _0x466d=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x66d4[_0x104e21];return _0x605b37;};'use strict';var Sequelize=require(_0x466d('0x0'));module['exports']={'name':{'type':Sequelize[_0x466d('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x466d('0x2')](_0x466d('0x3'),'no'),'defaultValue':_0x466d('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x466d('0x4')},'localstationid':{'type':Sequelize[_0x466d('0x1')],'unique':_0x466d('0x5')},'minrate':{'type':Sequelize[_0x466d('0x2')]('2400',_0x466d('0x6'),_0x466d('0x7'),_0x466d('0x8'),_0x466d('0x9'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x466d('0x2')](_0x466d('0xa'),_0x466d('0x6'),_0x466d('0x7'),_0x466d('0x8'),_0x466d('0x9'),_0x466d('0xb')),'defaultValue':_0x466d('0xb')},'modem':{'type':Sequelize[_0x466d('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x466d('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x466d('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x466d('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x466d('0xd'),'IAX',_0x466d('0xe'),_0x466d('0xf')),'defaultValue':_0x466d('0xd')},'key':{'type':Sequelize[_0x466d('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x466d('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x466d('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x466d('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x466d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x466d('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x466d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x466d('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x466d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x466d('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x466d('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x466d('0x11')],'defaultValue':![],'comment':_0x466d('0x13'),'set':function(_0x2d2924){if(!_0x2d2924)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x466d('0x14')](_0x466d('0x15'),_0x2d2924);}}}; \ No newline at end of file +var _0x1574=['4800','7200','14400','9600','12000','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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','ENUM','yes','STRING','xCALLY\x20Motion\x20Fax','localstationid'];(function(_0x1229d1,_0x178640){var _0x3803f6=function(_0x56be46){while(--_0x56be46){_0x1229d1['push'](_0x1229d1['shift']());}};_0x3803f6(++_0x178640);}(_0x1574,0x1da));var _0x4157=function(_0x478dbb,_0x48b454){_0x478dbb=_0x478dbb-0x0;var _0x3ff700=_0x1574[_0x478dbb];return _0x3ff700;};'use strict';var Sequelize=require(_0x4157('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x4157('0x1')](_0x4157('0x2'),'no'),'defaultValue':_0x4157('0x2')},'headerinfo':{'type':Sequelize[_0x4157('0x3')],'defaultValue':_0x4157('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x4157('0x5')},'minrate':{'type':Sequelize[_0x4157('0x1')]('2400',_0x4157('0x6'),_0x4157('0x7'),'9600','12000',_0x4157('0x8')),'defaultValue':_0x4157('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400','4800',_0x4157('0x7'),_0x4157('0x9'),_0x4157('0xa'),_0x4157('0x8')),'defaultValue':_0x4157('0x8')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x4157('0xb')},'gateway':{'type':Sequelize[_0x4157('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4157('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4157('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4157('0x1')](_0x4157('0xd'),'IAX',_0x4157('0xe'),_0x4157('0xf')),'defaultValue':_0x4157('0xd')},'key':{'type':Sequelize[_0x4157('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4157('0x10')],'defaultValue':function(){return _0x4157('0x11');}},'notificationSound':{'type':Sequelize[_0x4157('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4157('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4157('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4157('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4157('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4157('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4157('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4157('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x4157('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x4157('0x12')],'defaultValue':![],'comment':_0x4157('0x14'),'set':function(_0x3439da){if(!_0x3439da)this['setDataValue'](_0x4157('0x15'),null);this[_0x4157('0x16')](_0x4157('0x17'),_0x3439da);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 30bf83d..88ce537 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 _0x8240=['client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Disposition','getDispositions','nolimit','FaxAccountId','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','from-voip-provider','localstationid','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','updatedAt','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise'];(function(_0x1b7f6b,_0x3e789f){var _0x21926b=function(_0x1ef441){while(--_0x1ef441){_0x1b7f6b['push'](_0x1b7f6b['shift']());}};_0x21926b(++_0x3e789f);}(_0x8240,0xa9));var _0x0824=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0x8240[_0x47242d];return _0x30273a;};'use strict';var emlformat=require(_0x0824('0x0'));var rimraf=require(_0x0824('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0824('0x2'));var rp=require(_0x0824('0x3'));var moment=require(_0x0824('0x4'));var BPromise=require(_0x0824('0x5'));var Mustache=require(_0x0824('0x6'));var util=require(_0x0824('0x7'));var path=require(_0x0824('0x8'));var sox=require(_0x0824('0x9'));var csv=require(_0x0824('0xa'));var ejs=require(_0x0824('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0824('0xc'));var squel=require('squel');var crypto=require(_0x0824('0xd'));var jsforce=require(_0x0824('0xe'));var deskjs=require(_0x0824('0xf'));var toCsv=require(_0x0824('0xa'));var querystring=require(_0x0824('0x10'));var Papa=require('papaparse');var Redis=require(_0x0824('0x11'));var authService=require(_0x0824('0x12'));var qs=require(_0x0824('0x13'));var as=require(_0x0824('0x14'));var hardwareService=require(_0x0824('0x15'));var logger=require(_0x0824('0x16'))(_0x0824('0x17'));var utils=require('../../config/utils');var config=require(_0x0824('0x18'));var licenseUtil=require(_0x0824('0x19'));var db=require(_0x0824('0x1a'))['db'];config[_0x0824('0x1b')]=_[_0x0824('0x1c')](config[_0x0824('0x1b')],{'host':_0x0824('0x1d'),'port':0x18eb});var socket=require(_0x0824('0x1e'))(new Redis(config[_0x0824('0x1b')]));require(_0x0824('0x1f'))[_0x0824('0x20')](socket);var jayson=require(_0x0824('0x21'));var client=jayson[_0x0824('0x22')]['http']({'port':0x232c});var client9002=jayson['client'][_0x0824('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x444a48,_0x3e392c,_0x2ba0,_0x399ff0){return new BPromise(function(_0x3546eb,_0x2bc645){var _0x9f65ba=_0x399ff0||client;return _0x9f65ba[_0x0824('0x24')](_0x444a48,_0x2ba0)[_0x0824('0x25')](function(_0x3c3dc0){logger[_0x0824('0x26')](_0x0824('0x27'),_0x3e392c,_0x0824('0x28'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3e392c,_0x0824('0x28'),JSON[_0x0824('0x29')](_0x3c3dc0));if(_0x3c3dc0['error']){if(_0x3c3dc0[_0x0824('0x2a')][_0x0824('0x2b')]===0x1f4){logger['error'](_0x0824('0x27'),_0x3e392c,_0x3c3dc0[_0x0824('0x2a')]['message']);return _0x2bc645(_0x3c3dc0['error']['message']);}logger[_0x0824('0x2a')](_0x0824('0x27'),_0x3e392c,_0x3c3dc0[_0x0824('0x2a')][_0x0824('0x2c')]);return _0x3546eb(_0x3c3dc0['error']['message']);}else{logger['info'](_0x0824('0x27'),_0x3e392c,_0x0824('0x28'));_0x3546eb(_0x3c3dc0[_0x0824('0x2d')][_0x0824('0x2c')]);}})[_0x0824('0x2e')](function(_0x5802ee){logger[_0x0824('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x3e392c,_0x5802ee);_0x2bc645(_0x5802ee);});});}function respondWithStatusCode(_0x38c604,_0x106cb9){_0x106cb9=_0x106cb9||0xcc;return function(_0x16412d){if(_0x16412d){return _0x38c604[_0x0824('0x2f')](_0x106cb9);}return _0x38c604[_0x0824('0x30')](_0x106cb9)['end']();};}function respondWithResult(_0x5e7620,_0x49e175){_0x49e175=_0x49e175||0xc8;return function(_0x1cce66){if(_0x1cce66){return _0x5e7620['status'](_0x49e175)['json'](_0x1cce66);}};}function respondWithFilteredResult(_0xb27c7d,_0xd4d787){return function(_0x10c5b7){if(_0x10c5b7){var _0xffc63=typeof _0xd4d787[_0x0824('0x31')]===_0x0824('0x32')&&typeof _0xd4d787[_0x0824('0x33')]===_0x0824('0x32');var _0x3182b5=_0x10c5b7['count'];var _0x433a52=_0xffc63?0x0:_0xd4d787[_0x0824('0x31')];var _0x115406=_0xffc63?_0x10c5b7[_0x0824('0x34')]:_0xd4d787[_0x0824('0x31')]+_0xd4d787['limit'];var _0x399661;if(_0x115406>=_0x3182b5){_0x115406=_0x3182b5;_0x399661=0xc8;}else{_0x399661=0xce;}_0xb27c7d[_0x0824('0x30')](_0x399661);return _0xb27c7d[_0x0824('0x35')](_0x0824('0x36'),_0x433a52+'-'+_0x115406+'/'+_0x3182b5)[_0x0824('0x37')](_0x10c5b7);}return null;};}function patchUpdates(_0x5bfc82){return function(_0x399370){try{jsonpatch[_0x0824('0x38')](_0x399370,_0x5bfc82,!![]);}catch(_0x15d175){return BPromise[_0x0824('0x39')](_0x15d175);}return _0x399370[_0x0824('0x3a')]();};}function saveUpdates(_0xb5942e,_0x1ff15d){return function(_0x2b3ace){if(_0x2b3ace){return _0x2b3ace[_0x0824('0x3b')](_0xb5942e)[_0x0824('0x25')](function(_0x3a4785){return _0x3a4785;});}return null;};}function removeEntity(_0x464957,_0x542265){return function(_0x7b0ab4){if(_0x7b0ab4){return _0x7b0ab4[_0x0824('0x3c')]()[_0x0824('0x25')](function(){var _0x31af17=_0x7b0ab4[_0x0824('0x3d')]({'plain':!![]});var _0x468865=_0x0824('0x3e');return db[_0x0824('0x3f')][_0x0824('0x3c')]({'where':{'type':_0x468865,'resourceId':_0x31af17['id']}})['then'](function(){return _0x7b0ab4;});})[_0x0824('0x25')](function(){_0x464957[_0x0824('0x30')](0xcc)[_0x0824('0x40')]();});}};}function handleEntityNotFound(_0x576feb,_0xee2d3c){return function(_0x4d408b){if(!_0x4d408b){_0x576feb[_0x0824('0x2f')](0x194);}return _0x4d408b;};}function handleError(_0x2f8675,_0x447918){_0x447918=_0x447918||0x1f4;return function(_0xb55385){logger[_0x0824('0x2a')](_0xb55385[_0x0824('0x41')]);if(_0xb55385[_0x0824('0x42')]){delete _0xb55385[_0x0824('0x42')];}_0x2f8675[_0x0824('0x30')](_0x447918)[_0x0824('0x43')](_0xb55385);};}exports[_0x0824('0x44')]=function(_0x50fb86,_0x55e037){var _0x3076cc={'include':[{'model':db[_0x0824('0x45')],'as':_0x0824('0x46')}]},_0x3a59da={},_0x295a9e={'count':0x0,'rows':[]};var _0x1e16ca=_[_0x0824('0x47')](db[_0x0824('0x48')][_0x0824('0x49')],function(_0x225e2e){return{'name':_0x225e2e[_0x0824('0x4a')],'type':_0x225e2e[_0x0824('0x4b')][_0x0824('0x4c')]};});_0x3a59da['model']=_['map'](_0x1e16ca,_0x0824('0x42'));_0x3a59da[_0x0824('0x4d')]=_[_0x0824('0x4e')](_0x50fb86['query']);_0x3a59da['filters']=_[_0x0824('0x4f')](_0x3a59da[_0x0824('0x50')],_0x3a59da[_0x0824('0x4d')]);_0x3076cc[_0x0824('0x51')]=_['intersection'](_0x3a59da[_0x0824('0x50')],qs[_0x0824('0x52')](_0x50fb86[_0x0824('0x4d')][_0x0824('0x52')]));_0x3076cc[_0x0824('0x51')]=_0x3076cc[_0x0824('0x51')][_0x0824('0x53')]?_0x3076cc[_0x0824('0x51')]:_0x3a59da['model'];if(!_0x50fb86[_0x0824('0x4d')][_0x0824('0x54')]('nolimit')){_0x3076cc[_0x0824('0x33')]=qs[_0x0824('0x33')](_0x50fb86[_0x0824('0x4d')]['limit']);_0x3076cc[_0x0824('0x31')]=qs[_0x0824('0x31')](_0x50fb86[_0x0824('0x4d')][_0x0824('0x31')]);}_0x3076cc[_0x0824('0x55')]=qs[_0x0824('0x56')](_0x50fb86['query'][_0x0824('0x56')]);_0x3076cc['where']=qs[_0x0824('0x57')](_[_0x0824('0x58')](_0x50fb86[_0x0824('0x4d')],_0x3a59da[_0x0824('0x57')]),_0x1e16ca);if(_0x50fb86['query'][_0x0824('0x59')]){_0x3076cc[_0x0824('0x5a')]=_['merge'](_0x3076cc[_0x0824('0x5a')],{'$or':_[_0x0824('0x47')](_0x1e16ca,function(_0x324cc3){if(_0x324cc3[_0x0824('0x4b')]!=='VIRTUAL'){var _0xe31f7e={};_0xe31f7e[_0x324cc3[_0x0824('0x42')]]={'$like':'%'+_0x50fb86['query']['filter']+'%'};return _0xe31f7e;}})});}_0x3076cc=_[_0x0824('0x5b')]({},_0x3076cc,_0x50fb86[_0x0824('0x5c')]);var _0x5c0ee5={'where':_0x3076cc[_0x0824('0x5a')]};return db[_0x0824('0x48')][_0x0824('0x34')](_0x5c0ee5)[_0x0824('0x25')](function(_0xc32019){_0x295a9e[_0x0824('0x34')]=_0xc32019;if(_0x50fb86['query']['includeAll']){_0x3076cc[_0x0824('0x5d')]=[{'all':!![]}];}return db['FaxAccount'][_0x0824('0x5e')](_0x3076cc);})[_0x0824('0x25')](function(_0x2dad6a){_0x295a9e[_0x0824('0x5f')]=_0x2dad6a;return _0x295a9e;})['then'](respondWithFilteredResult(_0x55e037,_0x3076cc))['catch'](handleError(_0x55e037,null));};exports[_0x0824('0x60')]=function(_0xc6cd0d,_0x1fe8ff){var _0x668708={'raw':![],'where':{'id':_0xc6cd0d[_0x0824('0x61')]['id']},'include':[{'model':db[_0x0824('0x45')],'as':_0x0824('0x46')}]},_0x4eea5c={};_0x4eea5c[_0x0824('0x50')]=_[_0x0824('0x4e')](db['FaxAccount'][_0x0824('0x49')]);_0x4eea5c[_0x0824('0x4d')]=_[_0x0824('0x4e')](_0xc6cd0d['query']);_0x4eea5c[_0x0824('0x57')]=_[_0x0824('0x4f')](_0x4eea5c[_0x0824('0x50')],_0x4eea5c['query']);_0x668708['attributes']=_['intersection'](_0x4eea5c['model'],qs[_0x0824('0x52')](_0xc6cd0d[_0x0824('0x4d')][_0x0824('0x52')]));_0x668708[_0x0824('0x51')]=_0x668708[_0x0824('0x51')][_0x0824('0x53')]?_0x668708[_0x0824('0x51')]:_0x4eea5c[_0x0824('0x50')];if(_0xc6cd0d[_0x0824('0x4d')][_0x0824('0x62')]){_0x668708[_0x0824('0x5d')]=[{'all':!![]}];}_0x668708=_[_0x0824('0x5b')]({},_0x668708,_0xc6cd0d['options']);return db['FaxAccount']['find'](_0x668708)[_0x0824('0x25')](handleEntityNotFound(_0x1fe8ff,null))[_0x0824('0x25')](respondWithResult(_0x1fe8ff,null))[_0x0824('0x2e')](handleError(_0x1fe8ff,null));};exports[_0x0824('0x63')]=function(_0x1a3e87,_0x348d5f){return db[_0x0824('0x48')]['create'](_0x1a3e87['body'],{})['then'](function(_0x536ea3){var _0x5ac29f=_0x1a3e87[_0x0824('0x64')][_0x0824('0x3d')]({'plain':!![]});if(!_0x5ac29f)throw new Error(_0x0824('0x65'));if(_0x5ac29f[_0x0824('0x66')]===_0x0824('0x64')){var _0x45021e=_0x536ea3['get']({'plain':!![]});var _0x5b531d=_0x0824('0x3e');return db['UserProfileSection'][_0x0824('0x67')]({'where':{'name':_0x5b531d,'userProfileId':_0x5ac29f['userProfileId']},'raw':!![]})['then'](function(_0x26dcb3){if(_0x26dcb3&&_0x26dcb3[_0x0824('0x68')]===0x0){return db[_0x0824('0x3f')][_0x0824('0x63')]({'name':_0x45021e[_0x0824('0x42')],'resourceId':_0x45021e['id'],'type':_0x26dcb3['name'],'sectionId':_0x26dcb3['id']},{})[_0x0824('0x25')](function(){return _0x536ea3;});}else{return _0x536ea3;}})['catch'](function(_0x295fe0){logger[_0x0824('0x2a')](_0x0824('0x69'),_0x295fe0);throw _0x295fe0;});}return _0x536ea3;})[_0x0824('0x25')](respondWithResult(_0x348d5f,0xc9))['catch'](handleError(_0x348d5f,null));};exports[_0x0824('0x3b')]=function(_0x585151,_0x491553){if(_0x585151[_0x0824('0x6a')]['id']){delete _0x585151[_0x0824('0x6a')]['id'];}return db[_0x0824('0x48')][_0x0824('0x67')]({'where':{'id':_0x585151[_0x0824('0x61')]['id']},'include':[{'model':db[_0x0824('0x45')],'as':_0x0824('0x46')}]})[_0x0824('0x25')](handleEntityNotFound(_0x491553,null))[_0x0824('0x25')](saveUpdates(_0x585151['body'],null))[_0x0824('0x25')](respondWithResult(_0x491553,null))[_0x0824('0x2e')](handleError(_0x491553,null));};exports[_0x0824('0x3c')]=function(_0x1b9000,_0x48014a){return db['FaxAccount']['find']({'where':{'id':_0x1b9000[_0x0824('0x61')]['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x48014a,null))['then'](removeEntity(_0x48014a,null))[_0x0824('0x2e')](handleError(_0x48014a,null));};exports['describe']=function(_0x214350,_0x464360){return db[_0x0824('0x48')]['describe']()['then'](respondWithResult(_0x464360,null))['catch'](handleError(_0x464360,null));};exports['addDisposition']=function(_0x585a84,_0x406b08,_0x35252b){if(_0x585a84[_0x0824('0x6a')]['id']){delete _0x585a84['body']['id'];}return db['FaxAccount'][_0x0824('0x67')]({'where':{'id':_0x585a84['params']['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x406b08,null))[_0x0824('0x25')](function(_0x17a505){if(_0x17a505){_0x585a84[_0x0824('0x6a')]['FaxAccountId']=_0x17a505['id'];return db[_0x0824('0x6b')][_0x0824('0x63')](_0x585a84['body']);}})[_0x0824('0x25')](respondWithResult(_0x406b08,null))[_0x0824('0x2e')](handleError(_0x406b08,null));};exports[_0x0824('0x6c')]=function(_0x1e52a3,_0x518640,_0x16be49){var _0x38e9ae={'raw':![],'where':{}};var _0xba8d7f={};var _0x1fe66f={'count':0x0,'rows':[]};return db[_0x0824('0x48')]['findOne']({'where':{'id':_0x1e52a3[_0x0824('0x61')]['id']}})['then'](handleEntityNotFound(_0x518640,null))[_0x0824('0x25')](function(_0x487a18){if(_0x487a18){_0xba8d7f[_0x0824('0x50')]=_['keys'](db['Disposition'][_0x0824('0x49')]);_0xba8d7f[_0x0824('0x4d')]=_[_0x0824('0x4e')](_0x1e52a3['query']);_0xba8d7f['filters']=_['intersection'](_0xba8d7f[_0x0824('0x50')],_0xba8d7f[_0x0824('0x4d')]);_0x38e9ae[_0x0824('0x51')]=_[_0x0824('0x4f')](_0xba8d7f[_0x0824('0x50')],qs[_0x0824('0x52')](_0x1e52a3[_0x0824('0x4d')][_0x0824('0x52')]));_0x38e9ae[_0x0824('0x51')]=_0x38e9ae[_0x0824('0x51')][_0x0824('0x53')]?_0x38e9ae[_0x0824('0x51')]:_0xba8d7f[_0x0824('0x50')];if(!_0x1e52a3[_0x0824('0x4d')][_0x0824('0x54')](_0x0824('0x6d'))){_0x38e9ae[_0x0824('0x33')]=qs[_0x0824('0x33')](_0x1e52a3['query'][_0x0824('0x33')]);_0x38e9ae[_0x0824('0x31')]=qs[_0x0824('0x31')](_0x1e52a3[_0x0824('0x4d')]['offset']);}_0x38e9ae['order']=qs[_0x0824('0x56')](_0x1e52a3[_0x0824('0x4d')][_0x0824('0x56')]);_0x38e9ae['where']=qs['filters'](_[_0x0824('0x58')](_0x1e52a3['query'],_0xba8d7f[_0x0824('0x57')]));_0x38e9ae['where'][_0x0824('0x6e')]=_0x487a18['id'];if(_0x1e52a3[_0x0824('0x4d')][_0x0824('0x59')]){_0x38e9ae['where']=_[_0x0824('0x5b')](_0x38e9ae['where'],{'$or':_['map'](_0x38e9ae[_0x0824('0x51')],function(_0x3da269){var _0x40205b={};_0x40205b[_0x3da269]={'$like':'%'+_0x1e52a3[_0x0824('0x4d')][_0x0824('0x59')]+'%'};return _0x40205b;})});}_0x38e9ae=_[_0x0824('0x5b')]({},_0x38e9ae,_0x1e52a3['options']);return db[_0x0824('0x6b')][_0x0824('0x34')]({'where':_0x38e9ae[_0x0824('0x5a')]})[_0x0824('0x25')](function(_0x342ad3){_0x1fe66f[_0x0824('0x34')]=_0x342ad3;if(_0x1e52a3['query'][_0x0824('0x62')]){_0x38e9ae['include']=[{'all':!![]}];}return db[_0x0824('0x6b')][_0x0824('0x5e')](_0x38e9ae);})[_0x0824('0x25')](function(_0x2a1827){_0x1fe66f[_0x0824('0x5f')]=_0x2a1827;return _0x1fe66f;});}})[_0x0824('0x25')](respondWithFilteredResult(_0x518640,_0x38e9ae))[_0x0824('0x2e')](handleError(_0x518640,null));};exports[_0x0824('0x6f')]=function(_0x569ebb,_0x4cd1bf,_0x5254c3){return db[_0x0824('0x48')]['find']({'where':{'id':_0x569ebb[_0x0824('0x61')]['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x4cd1bf,null))[_0x0824('0x25')](function(_0x1faf62){if(_0x1faf62){return _0x1faf62[_0x0824('0x6f')](_0x569ebb[_0x0824('0x4d')][_0x0824('0x70')]);}})[_0x0824('0x25')](respondWithStatusCode(_0x4cd1bf,null))[_0x0824('0x2e')](handleError(_0x4cd1bf,null));};exports['addAnswer']=function(_0x2aac2d,_0x1f80c7,_0x3997b5){if(_0x2aac2d[_0x0824('0x6a')]['id']){delete _0x2aac2d[_0x0824('0x6a')]['id'];}return db[_0x0824('0x48')][_0x0824('0x67')]({'where':{'id':_0x2aac2d[_0x0824('0x61')]['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x1f80c7,null))['then'](function(_0x2e2ca8){if(_0x2e2ca8){_0x2aac2d['body'][_0x0824('0x6e')]=_0x2e2ca8['id'];return db[_0x0824('0x71')]['create'](_0x2aac2d[_0x0824('0x6a')]);}})[_0x0824('0x25')](respondWithResult(_0x1f80c7,null))['catch'](handleError(_0x1f80c7,null));};exports[_0x0824('0x72')]=function(_0x5681e6,_0x1c3ab4,_0x26ad2e){var _0x2cd48c={'raw':![],'where':{}};var _0x136869={};var _0x3ff4aa={'count':0x0,'rows':[]};return db[_0x0824('0x48')][_0x0824('0x73')]({'where':{'id':_0x5681e6[_0x0824('0x61')]['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x1c3ab4,null))[_0x0824('0x25')](function(_0x16df75){if(_0x16df75){_0x136869[_0x0824('0x50')]=_[_0x0824('0x4e')](db[_0x0824('0x71')]['rawAttributes']);_0x136869[_0x0824('0x4d')]=_['keys'](_0x5681e6[_0x0824('0x4d')]);_0x136869[_0x0824('0x57')]=_[_0x0824('0x4f')](_0x136869['model'],_0x136869['query']);_0x2cd48c['attributes']=_[_0x0824('0x4f')](_0x136869['model'],qs['fields'](_0x5681e6['query'][_0x0824('0x52')]));_0x2cd48c['attributes']=_0x2cd48c[_0x0824('0x51')]['length']?_0x2cd48c[_0x0824('0x51')]:_0x136869[_0x0824('0x50')];if(!_0x5681e6[_0x0824('0x4d')][_0x0824('0x54')](_0x0824('0x6d'))){_0x2cd48c[_0x0824('0x33')]=qs[_0x0824('0x33')](_0x5681e6[_0x0824('0x4d')][_0x0824('0x33')]);_0x2cd48c[_0x0824('0x31')]=qs[_0x0824('0x31')](_0x5681e6[_0x0824('0x4d')][_0x0824('0x31')]);}_0x2cd48c[_0x0824('0x55')]=qs[_0x0824('0x56')](_0x5681e6[_0x0824('0x4d')][_0x0824('0x56')]);_0x2cd48c[_0x0824('0x5a')]=qs['filters'](_[_0x0824('0x58')](_0x5681e6[_0x0824('0x4d')],_0x136869[_0x0824('0x57')]));_0x2cd48c['where']['FaxAccountId']=_0x16df75['id'];if(_0x5681e6[_0x0824('0x4d')][_0x0824('0x59')]){_0x2cd48c[_0x0824('0x5a')]=_[_0x0824('0x5b')](_0x2cd48c[_0x0824('0x5a')],{'$or':_[_0x0824('0x47')](_0x2cd48c[_0x0824('0x51')],function(_0x26f4c1){var _0x294a7e={};_0x294a7e[_0x26f4c1]={'$like':'%'+_0x5681e6[_0x0824('0x4d')]['filter']+'%'};return _0x294a7e;})});}_0x2cd48c=_['merge']({},_0x2cd48c,_0x5681e6[_0x0824('0x5c')]);return db[_0x0824('0x71')][_0x0824('0x34')]({'where':_0x2cd48c[_0x0824('0x5a')]})[_0x0824('0x25')](function(_0x5eeb57){_0x3ff4aa['count']=_0x5eeb57;if(_0x5681e6[_0x0824('0x4d')][_0x0824('0x62')]){_0x2cd48c[_0x0824('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0824('0x5e')](_0x2cd48c);})[_0x0824('0x25')](function(_0x1b5b4b){_0x3ff4aa[_0x0824('0x5f')]=_0x1b5b4b;return _0x3ff4aa;});}})[_0x0824('0x25')](respondWithFilteredResult(_0x1c3ab4,_0x2cd48c))[_0x0824('0x2e')](handleError(_0x1c3ab4,null));};exports[_0x0824('0x74')]=function(_0x475aa4,_0x5334b0,_0x596175){return db[_0x0824('0x48')][_0x0824('0x67')]({'where':{'id':_0x475aa4[_0x0824('0x61')]['id']}})['then'](handleEntityNotFound(_0x5334b0,null))['then'](function(_0x292b48){if(_0x292b48){return _0x292b48[_0x0824('0x74')](_0x475aa4[_0x0824('0x4d')][_0x0824('0x70')]);}})['then'](respondWithStatusCode(_0x5334b0,null))[_0x0824('0x2e')](handleError(_0x5334b0,null));};exports[_0x0824('0x75')]=function(_0x2cf4cc,_0x2b8c3c,_0x5c58e7){return db[_0x0824('0x76')][_0x0824('0x67')]({'where':{'id':_0x2cf4cc[_0x0824('0x61')]['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x2b8c3c,null))[_0x0824('0x25')](function(_0x180c45){if(_0x180c45){return _0x180c45[_0x0824('0x75')](_0x2cf4cc[_0x0824('0x6a')][_0x0824('0x70')],_[_0x0824('0x77')](_0x2cf4cc['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2b8c3c,null))['catch'](handleError(_0x2b8c3c,null));};exports[_0x0824('0x78')]=function(_0x329fa9,_0x3f361a,_0x53dbcf){var _0x5c8525={'raw':![],'where':{}};var _0xf15b23={};var _0x193879={'count':0x0,'rows':[]};return db[_0x0824('0x48')]['findOne']({'where':{'id':_0x329fa9[_0x0824('0x61')]['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x3f361a,null))[_0x0824('0x25')](function(_0x47c377){if(_0x47c377){_0xf15b23[_0x0824('0x50')]=_[_0x0824('0x4e')](db[_0x0824('0x76')]['rawAttributes']);_0xf15b23[_0x0824('0x4d')]=_[_0x0824('0x4e')](_0x329fa9['query']);_0xf15b23[_0x0824('0x57')]=_[_0x0824('0x4f')](_0xf15b23[_0x0824('0x50')],_0xf15b23[_0x0824('0x4d')]);_0x5c8525['attributes']=_['intersection'](_0xf15b23[_0x0824('0x50')],qs[_0x0824('0x52')](_0x329fa9['query'][_0x0824('0x52')]));_0x5c8525['attributes']=_0x5c8525[_0x0824('0x51')][_0x0824('0x53')]?_0x5c8525[_0x0824('0x51')]:_0xf15b23[_0x0824('0x50')];if(!_0x329fa9[_0x0824('0x4d')][_0x0824('0x54')](_0x0824('0x6d'))){_0x5c8525[_0x0824('0x33')]=qs[_0x0824('0x33')](_0x329fa9[_0x0824('0x4d')]['limit']);_0x5c8525[_0x0824('0x31')]=qs[_0x0824('0x31')](_0x329fa9[_0x0824('0x4d')][_0x0824('0x31')]);}_0x5c8525[_0x0824('0x55')]=qs['sort'](_0x329fa9[_0x0824('0x4d')][_0x0824('0x56')]);_0x5c8525[_0x0824('0x5a')]=qs[_0x0824('0x57')](_['pick'](_0x329fa9['query'],_0xf15b23[_0x0824('0x57')]));_0x5c8525[_0x0824('0x5a')]['FaxAccountId']=_0x47c377['id'];if(_0x329fa9[_0x0824('0x4d')][_0x0824('0x59')]){_0x5c8525[_0x0824('0x5a')]=_[_0x0824('0x5b')](_0x5c8525[_0x0824('0x5a')],{'$or':_['map'](_0x5c8525[_0x0824('0x51')],function(_0x30a481){var _0x1b340c={};_0x1b340c[_0x30a481]={'$like':'%'+_0x329fa9[_0x0824('0x4d')][_0x0824('0x59')]+'%'};return _0x1b340c;})});}_0x5c8525=_[_0x0824('0x5b')]({},_0x5c8525,_0x329fa9[_0x0824('0x5c')]);return db['FaxInteraction']['count']({'where':_0x5c8525[_0x0824('0x5a')]})[_0x0824('0x25')](function(_0x57cae7){_0x193879[_0x0824('0x34')]=_0x57cae7;if(_0x329fa9['query'][_0x0824('0x62')]){_0x5c8525[_0x0824('0x5d')]=[{'model':db[_0x0824('0x79')],'as':_0x0824('0x7a'),'required':![]},{'model':db[_0x0824('0x7b')],'as':_0x0824('0x7c'),'attributes':['name',_0x0824('0x7d'),_0x0824('0x7e')],'required':![]},{'model':db[_0x0824('0x7f')],'as':_0x0824('0x80'),'attributes':['id',_0x0824('0x42'),_0x0824('0x81')],'where':_0x329fa9[_0x0824('0x4d')][_0x0824('0x82')]?{'id':_0x329fa9[_0x0824('0x4d')][_0x0824('0x82')]}:undefined,'required':_0x329fa9[_0x0824('0x4d')][_0x0824('0x82')]?!![]:![]}];}return db['FaxInteraction'][_0x0824('0x5e')](_0x5c8525);})['then'](function(_0xebfe17){_0x193879['rows']=_0xebfe17;return _0x193879;});}})[_0x0824('0x25')](respondWithFilteredResult(_0x3f361a,_0x5c8525))[_0x0824('0x2e')](handleError(_0x3f361a,null));};exports[_0x0824('0x83')]=function(_0xcb9112,_0x3761a4){var _0x3b804c=_0xcb9112[_0x0824('0x61')]['id'];var _0x2d4b94=_0xcb9112[_0x0824('0x6a')];var _0x4de321=0xc8;var _0x5dc9e5=null;return db[_0x0824('0x84')][_0x0824('0x85')]({'isolationLevel':db[_0x0824('0x84')][_0x0824('0x86')][_0x0824('0x87')]['READ_COMMITTED']},function(_0x3a961c){return db[_0x0824('0x48')]['findOne']({'where':{'id':_0x3b804c},'transaction':_0x3a961c})[_0x0824('0x25')](function(_0x411769){if(_0x411769){return db[_0x0824('0x88')][_0x0824('0x3c')]({'where':{'FaxAccountId':_0x3b804c},'transaction':_0x3a961c})[_0x0824('0x25')](function(){var _0x1f6843=_[_0x0824('0x47')](_0x2d4b94,function(_0x1f8e49){_0x1f8e49[_0x0824('0x6e')]=_0x3b804c;return _0x1f8e49;});return db[_0x0824('0x88')][_0x0824('0x89')](_0x1f6843,{'transaction':_0x3a961c});});}else{_0x4de321=0x194;_0x5dc9e5=[];}});})[_0x0824('0x25')](function(){if(_0x4de321!==0x194){return db[_0x0824('0x88')][_0x0824('0x8a')]({'where':{'FaxAccountId':_0x3b804c},'order':'priority'})['then'](function(_0x3adc52){_0x5dc9e5=_0x3adc52;});}})[_0x0824('0x2e')](function(_0x25cb07){_0x4de321=0x1f4;logger[_0x0824('0x2a')](_0x25cb07[_0x0824('0x41')]);if(_0x25cb07['name']){delete _0x25cb07[_0x0824('0x42')];}_0x5dc9e5=_0x25cb07;})[_0x0824('0x8b')](function(){if(_0x5dc9e5===null){_0x3761a4[_0x0824('0x2f')](_0x4de321);}else{if(_0x4de321===0x1f4){_0x3761a4[_0x0824('0x30')](_0x4de321)[_0x0824('0x43')](_0x5dc9e5);}else{_0x3761a4[_0x0824('0x30')](_0x4de321)[_0x0824('0x37')](_0x5dc9e5);}}});};exports[_0x0824('0x8c')]=function(_0x4225af,_0x271667,_0x3d9e20){var _0x14b207={};var _0x2f3549={};var _0x3a4903;var _0x3f0404;return db[_0x0824('0x48')][_0x0824('0x73')]({'where':{'id':_0x4225af[_0x0824('0x61')]['id']}})['then'](handleEntityNotFound(_0x271667,null))['then'](function(_0x48fb31){if(_0x48fb31){_0x3a4903=_0x48fb31;_0x2f3549['model']=_[_0x0824('0x4e')](db[_0x0824('0x88')][_0x0824('0x49')]);_0x2f3549[_0x0824('0x4d')]=_[_0x0824('0x4e')](_0x4225af[_0x0824('0x4d')]);_0x2f3549[_0x0824('0x57')]=_[_0x0824('0x4f')](_0x2f3549['model'],_0x2f3549[_0x0824('0x4d')]);_0x14b207[_0x0824('0x51')]=_[_0x0824('0x4f')](_0x2f3549[_0x0824('0x50')],qs['fields'](_0x4225af['query'][_0x0824('0x52')]));_0x14b207['attributes']=_0x14b207['attributes'][_0x0824('0x53')]?_0x14b207[_0x0824('0x51')]:_0x2f3549['model'];_0x14b207[_0x0824('0x55')]=qs['sort'](_0x4225af[_0x0824('0x4d')]['sort']);_0x14b207[_0x0824('0x5a')]=qs[_0x0824('0x57')](_[_0x0824('0x58')](_0x4225af['query'],_0x2f3549[_0x0824('0x57')]));if(_0x4225af[_0x0824('0x4d')][_0x0824('0x59')]){_0x14b207[_0x0824('0x5a')]=_[_0x0824('0x5b')](_0x14b207[_0x0824('0x5a')],{'$or':_['map'](_0x14b207['attributes'],function(_0x198b0b){var _0xd0390f={};_0xd0390f[_0x198b0b]={'$like':'%'+_0x4225af['query'][_0x0824('0x59')]+'%'};return _0xd0390f;})});}_0x14b207=_[_0x0824('0x5b')]({},_0x14b207,_0x4225af[_0x0824('0x5c')]);return _0x3a4903[_0x0824('0x8c')](_0x14b207);}})['then'](function(_0x3617da){if(_0x3617da){_0x3f0404=_0x3617da[_0x0824('0x53')];if(!_0x4225af[_0x0824('0x4d')][_0x0824('0x54')](_0x0824('0x6d'))){_0x14b207[_0x0824('0x33')]=qs['limit'](_0x4225af[_0x0824('0x4d')][_0x0824('0x33')]);_0x14b207[_0x0824('0x31')]=qs[_0x0824('0x31')](_0x4225af[_0x0824('0x4d')][_0x0824('0x31')]);}return _0x3a4903['getApplications'](_0x14b207);}})[_0x0824('0x25')](function(_0x2d9721){if(_0x2d9721){return _0x2d9721?{'count':_0x3f0404,'rows':_0x2d9721}:null;}})[_0x0824('0x25')](respondWithResult(_0x271667,null))[_0x0824('0x2e')](handleError(_0x271667,null));};function Extension(_0x219a84,_0x5cc73e,_0x4750e5,_0x136f52){this['context']=_0x0824('0x8d');this['exten']=_0x219a84[_0x0824('0x8e')];this['app']=_0x136f52;this['type']='system';this[_0x0824('0x8f')]=_0x0824('0x90');this[_0x0824('0x6e')]=_0x219a84['id'];this[_0x0824('0x91')]=_0x5cc73e;this[_0x0824('0x92')]=_0x4750e5;}function createExtensionsReciveFax(_0xbc1382){var _0x2198f7=0x1;var _0x2a3e0e=[];_0x2a3e0e[_0x0824('0x93')](new Extension(_0xbc1382,_0x2198f7,'',_0x0824('0x94')));_0x2198f7+=0x1;_0x2a3e0e[_0x0824('0x93')](new Extension(_0xbc1382,_0x2198f7,_0x0824('0x95'),_0x0824('0x96')));_0x2198f7+=0x1;for(var _0x26d56b in _0xbc1382){if(_0xbc1382[_0x0824('0x54')](_0x26d56b)&&(_0x26d56b===_0x0824('0x97')||_0x26d56b===_0x0824('0x8e')||_0x26d56b===_0x0824('0x98')||_0x26d56b==='faxdetect'||_0x26d56b===_0x0824('0x99')||_0x26d56b===_0x0824('0x9a')||_0x26d56b===_0x0824('0x9b')||_0x26d56b==='modem'||_0x26d56b===_0x0824('0x9c'))){_0x2a3e0e[_0x0824('0x93')](new Extension(_0xbc1382,_0x2198f7,_0x0824('0x9d')+_0x26d56b+')='+_0xbc1382[_0x26d56b],'Set'));_0x2198f7+=0x1;}}_0x2a3e0e[_0x0824('0x93')](new Extension(_0xbc1382,_0x2198f7,'6',_0x0824('0x9e')));_0x2198f7+=0x1;_0x2a3e0e[_0x0824('0x93')](new Extension(_0xbc1382,_0x2198f7,_0x0824('0x9f'),_0x0824('0xa0')));_0x2198f7=0x0;return _0x2a3e0e;}exports[_0x0824('0xa1')]=function(_0x2ed16e,_0x5cc89d,_0x2eb23a){var _0x4acb82;return db['sequelize'][_0x0824('0x85')](function(_0x33f0fc){return db[_0x0824('0x48')]['create'](_0x2ed16e['body'],{'transaction':_0x33f0fc})[_0x0824('0x25')](function(_0x48db2e){_0x4acb82=_0x48db2e[_0x0824('0x3d')]({'plain':!![]});return db[_0x0824('0xa2')][_0x0824('0x89')](createExtensionsReciveFax(_0x4acb82),{'transaction':_0x33f0fc});});})[_0x0824('0x25')](function(){return _0x4acb82;})[_0x0824('0x25')](respondWithResult(_0x5cc89d,null))['catch'](handleError(_0x5cc89d,null));};exports[_0x0824('0xa3')]=function(_0x11fc27,_0x214383,_0x168afb){var _0x31fee6;return db[_0x0824('0x84')][_0x0824('0x85')](function(_0x5bb51a){return db[_0x0824('0x48')][_0x0824('0x3b')](_0x11fc27['body'],{'where':{'id':_0x11fc27[_0x0824('0x6a')]['id']},'transaction':_0x5bb51a})[_0x0824('0x25')](function(_0x580603){return db[_0x0824('0xa2')][_0x0824('0x3c')]({'where':{'FaxAccountId':_0x11fc27[_0x0824('0x6a')]['id']},'transaction':_0x5bb51a})[_0x0824('0x25')](function(_0x2e87c4){return db[_0x0824('0xa2')][_0x0824('0x89')](createExtensionsReciveFax(_[_0x0824('0x77')](_0x11fc27[_0x0824('0x6a')],[_0x0824('0xa4'),'key','createdAt',_0x0824('0xa5'),'TrunkId',_0x0824('0xa6')])),{'transaction':_0x5bb51a});});});})[_0x0824('0x25')](function(){return db['FaxAccount'][_0x0824('0xa7')](_0x11fc27[_0x0824('0x6a')]['id']);})[_0x0824('0x25')](respondWithResult(_0x214383,null))[_0x0824('0x2e')](handleError(_0x214383,null));};exports[_0x0824('0xa8')]=function(_0x3d1778,_0x3df5e3,_0x2f337c){var _0x43f00e={'raw':!![],'where':{}};var _0x28c842={};var _0x17b1a7={'count':0x0,'rows':[]};return db[_0x0824('0x48')][_0x0824('0x73')]({'where':{'id':_0x3d1778[_0x0824('0x61')]['id']}})['then'](handleEntityNotFound(_0x3df5e3,null))[_0x0824('0x25')](function(_0x4794c5){if(_0x4794c5){_0x28c842[_0x0824('0x50')]=_[_0x0824('0x4e')](db['FaxMessage'][_0x0824('0x49')]);_0x28c842[_0x0824('0x4d')]=_[_0x0824('0x4e')](_0x3d1778['query']);_0x28c842[_0x0824('0x57')]=_['intersection'](_0x28c842['model'],_0x28c842['query']);_0x43f00e[_0x0824('0x51')]=_[_0x0824('0x4f')](_0x28c842[_0x0824('0x50')],qs[_0x0824('0x52')](_0x3d1778['query'][_0x0824('0x52')]));_0x43f00e['attributes']=_0x43f00e[_0x0824('0x51')]['length']?_0x43f00e[_0x0824('0x51')]:_0x28c842[_0x0824('0x50')];if(!_0x3d1778[_0x0824('0x4d')][_0x0824('0x54')](_0x0824('0x6d'))){_0x43f00e[_0x0824('0x33')]=qs[_0x0824('0x33')](_0x3d1778['query'][_0x0824('0x33')]);_0x43f00e[_0x0824('0x31')]=qs[_0x0824('0x31')](_0x3d1778['query'][_0x0824('0x31')]);}_0x43f00e[_0x0824('0x55')]=qs[_0x0824('0x56')](_0x3d1778[_0x0824('0x4d')][_0x0824('0x56')]);_0x43f00e[_0x0824('0x5a')]=qs[_0x0824('0x57')](_['pick'](_0x3d1778[_0x0824('0x4d')],_0x28c842['filters']));_0x43f00e['where']['FaxAccountId']=_0x4794c5['id'];if(_0x3d1778['query']['filter']){_0x43f00e[_0x0824('0x5a')]=_[_0x0824('0x5b')](_0x43f00e[_0x0824('0x5a')],{'$or':_[_0x0824('0x47')](_0x43f00e[_0x0824('0x51')],function(_0x214270){var _0x4e4261={};_0x4e4261[_0x214270]={'$like':'%'+_0x3d1778[_0x0824('0x4d')]['filter']+'%'};return _0x4e4261;})});}if(_0x3d1778[_0x0824('0x4d')][_0x0824('0xa9')]){var _0x59498c=_0x3d1778[_0x0824('0x4d')][_0x0824('0xa9')][_0x0824('0xaa')](',');var _0x268d65={};_0x268d65[_0x59498c[0x0]]={'$gte':moment(_0x59498c[0x1])[_0x0824('0xab')](_0x0824('0xac'))};_0x43f00e['where']=_[_0x0824('0x5b')](_0x43f00e['where'],_0x268d65);}_0x43f00e=_[_0x0824('0x5b')]({},_0x43f00e,_0x3d1778[_0x0824('0x5c')]);return db['FaxMessage'][_0x0824('0x34')]({'where':_0x43f00e[_0x0824('0x5a')]})['then'](function(_0x26e04c){_0x17b1a7[_0x0824('0x34')]=_0x26e04c;if(_0x3d1778[_0x0824('0x4d')][_0x0824('0x62')]){_0x43f00e[_0x0824('0x5d')]=[{'all':!![]}];}return db[_0x0824('0xad')][_0x0824('0x5e')](_0x43f00e);})[_0x0824('0x25')](function(_0x138b56){_0x17b1a7['rows']=_0x138b56;return _0x17b1a7;});}})[_0x0824('0x25')](respondWithFilteredResult(_0x3df5e3,_0x43f00e))[_0x0824('0x2e')](handleError(_0x3df5e3,null));};exports[_0x0824('0x43')]=function(_0xea1897,_0x1df86f,_0x2997f2){var _0x297076,_0x33131c={},_0x13f5ab;if(_0xea1897[_0x0824('0x6a')]['to']){_0x13f5ab=_0xea1897[_0x0824('0x6a')]['to'][0x0];}return db[_0x0824('0x48')][_0x0824('0x67')]({'where':{'id':_0xea1897['params']['id']},'include':[{'model':db[_0x0824('0xae')],'as':_0x0824('0xaf'),'include':[{'model':db[_0x0824('0x79')],'as':_0x0824('0xb0'),'where':{'fax':_0x13f5ab},'limit':0x1,'order':[[_0x0824('0xa5'),_0x0824('0xb1')]]}]}]})[_0x0824('0x25')](handleEntityNotFound(_0x1df86f,null))[_0x0824('0x25')](function(_0x223f7a){_0x297076=_0x223f7a;if(_0xea1897[_0x0824('0x6a')][_0x0824('0xb2')]&&_0xea1897[_0x0824('0x6a')]['attachments'][_0x0824('0x53')]){for(var _0x90c283=0x0;_0x90c283<_0xea1897['body']['attachments'][_0x0824('0x53')];_0x90c283+=0x1){_0xea1897[_0x0824('0x6a')]['attachments'][_0x90c283]={'filename':_0xea1897['body'][_0x0824('0xb2')][_0x90c283]['name'],'id':_0xea1897[_0x0824('0x6a')][_0x0824('0xb2')][_0x90c283]['id'],'path':path['join'](config[_0x0824('0xb3')],_0x0824('0xb4'),_0xea1897['body'][_0x0824('0xb2')][_0x90c283][_0x0824('0xb5')])};}}return respondWithRpcPromise('CheckAfterSend',_0x0824('0xb6'),{'FaxAccountId':_['isNil'](_0xea1897[_0x0824('0x61')]['id'])?undefined:_0xea1897[_0x0824('0x61')]['id'],'path':_['isNil'](_0xea1897[_0x0824('0x6a')][_0x0824('0xb2')][0x0][_0x0824('0x8')])?undefined:_0xea1897[_0x0824('0x6a')][_0x0824('0xb2')][0x0][_0x0824('0x8')],'fax':_[_0x0824('0xb7')](_0xea1897[_0x0824('0x6a')]['to'][0x0])?undefined:_0xea1897[_0x0824('0x6a')]['to'][0x0]},client9002);})['then'](function(){if(_0x297076){if(_[_0x0824('0xb7')](_0xea1897[_0x0824('0x6a')][_0x0824('0xb8')])){_0xea1897[_0x0824('0x6a')][_0x0824('0xb8')]=util['format'](_0x0824('0xb9'),_0x297076['name'],_0x297076[_0x0824('0xba')]);}if(_0x297076[_0x0824('0xaf')]){if(_0x297076[_0x0824('0xaf')]['Contacts'][_0x0824('0x53')]){return _0x297076[_0x0824('0xaf')][_0x0824('0xb0')][0x0];}else{return db['CmContact'][_0x0824('0x63')](_['defaults'](_0xea1897[_0x0824('0x6a')],{'firstName':_0xea1897[_0x0824('0x6a')]['to'][0x0],'phone':_0xea1897['body']['to'][0x0],'fax':_0xea1897[_0x0824('0x6a')]['to'][0x0],'ListId':_0x297076[_0x0824('0xa6')]}));}}else{throw new Error(_0x0824('0xbb'));}}else{throw new Error(_0x0824('0xbc'));}})['then'](function(_0x3ca084){if(_0x3ca084){return db[_0x0824('0x76')][_0x0824('0x67')]({'where':{'ContactId':_0x3ca084['id'],'closed':![],'FaxAccountId':_0x297076['id']}})[_0x0824('0x25')](function(_0x3dafa2){if(_0x3dafa2){return[_0x3dafa2,![]];}return db['FaxInteraction']['create']({'UserId':_0xea1897['user']['id'],'ContactId':_0x3ca084['id'],'FaxAccountId':_0x297076['id'],'fax':_0xea1897['body']['to'][0x0],'firstMsgDirection':_0x0824('0xbd'),'Messages':[_[_0x0824('0x5b')](_0xea1897[_0x0824('0x6a')],{'read':![],'body':_0xea1897['body']['attachments'][0x0][_0x0824('0xbe')],'FaxAccountId':_0x297076['id'],'UserId':_0xea1897['user']['id'],'ContactId':_0x3ca084['id'],'AttachmentId':_0xea1897['body'][_0x0824('0xb2')][0x0]['id']})]},{'include':[{'model':db[_0x0824('0xad')],'as':_0x0824('0xbf')}]})[_0x0824('0x25')](function(_0x2492ef){return[_0x2492ef,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0824('0xc0')](function(_0x276a86,_0x416785){if(_0x416785){return _0x276a86;}return db[_0x0824('0xad')][_0x0824('0x63')]({'direction':_0x0824('0xbd'),'read':![],'body':_0xea1897[_0x0824('0x6a')][_0x0824('0xb2')][0x0][_0x0824('0xbe')],'FaxAccountId':_0x297076['id'],'FaxInteractionId':_0x276a86['id'],'UserId':_0xea1897['user']['id'],'ContactId':_0x276a86['ContactId'],'AttachmentId':_0xea1897[_0x0824('0x6a')]['attachments'][0x0]['id']})[_0x0824('0x25')](function(_0x501fde){_0x276a86[_0x0824('0xc1')][_0x0824('0xbf')]=[];_0x276a86['dataValues'][_0x0824('0xbf')][_0x0824('0x93')](_0x501fde[_0x0824('0xc1')]);return _0x276a86;});})[_0x0824('0x25')](function(_0x468fb1){respondWithRpcPromise('SendFax',_0x0824('0xc2'),{'FaxAccountId':_[_0x0824('0xb7')](_0xea1897[_0x0824('0x61')]['id'])?undefined:_0xea1897[_0x0824('0x61')]['id'],'path':_['isNil'](_0xea1897[_0x0824('0x6a')][_0x0824('0xb2')][0x0][_0x0824('0x8')])?undefined:_0xea1897[_0x0824('0x6a')][_0x0824('0xb2')][0x0]['path'],'fax':_[_0x0824('0xb7')](_0xea1897[_0x0824('0x6a')]['to'][0x0])?undefined:_0xea1897[_0x0824('0x6a')]['to'][0x0],'AttachmentId':_0xea1897[_0x0824('0x6a')][_0x0824('0xb2')][0x0]['id']},client9002)[_0x0824('0x25')](function(_0x10bc65){logger[_0x0824('0x26')](_0x0824('0xc3'),_0x10bc65);})[_0x0824('0x2e')](function(_0x47d776){logger['info'](_0x0824('0xc3'),_0x47d776);});return _0x468fb1;})[_0x0824('0x25')](respondWithResult(_0x1df86f,null))[_0x0824('0x2e')](handleError(_0x1df86f,null));};exports[_0x0824('0xc4')]=function(_0xb0677e,_0x35f33e,_0x136ca8){return db[_0x0824('0x48')][_0x0824('0x67')]({'where':{'id':_0xb0677e[_0x0824('0x61')]['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x35f33e,null))[_0x0824('0x25')](function(_0x3846c1){if(_0x3846c1){return _0x3846c1['addAgents'](_0xb0677e[_0x0824('0x6a')][_0x0824('0x70')],_[_0x0824('0x77')](_0xb0677e['body'],[_0x0824('0x70'),'id'])||{})['spread'](function(_0x4b2b81){for(var _0x13b2d5=0x0;_0x13b2d5<_0xb0677e[_0x0824('0x6a')]['ids'][_0x0824('0x53')];_0x13b2d5+=0x1){socket[_0x0824('0xc5')](_0x0824('0xc6'),{'UserId':Number(_0xb0677e[_0x0824('0x6a')]['ids'][_0x13b2d5]),'FaxAccountId':Number(_0xb0677e[_0x0824('0x61')]['id'])});}return _0x4b2b81;});}})[_0x0824('0x25')](respondWithResult(_0x35f33e,null))[_0x0824('0x2e')](handleError(_0x35f33e,null));};exports[_0x0824('0xc7')]=function(_0x3fde2a,_0x580780,_0x5a906a){return db[_0x0824('0x48')]['find']({'where':{'id':_0x3fde2a['params']['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x580780,null))[_0x0824('0x25')](function(_0x40c74d){if(_0x40c74d){return _0x40c74d[_0x0824('0xc7')](_0x3fde2a['query'][_0x0824('0x70')])[_0x0824('0x25')](function(){if(_[_0x0824('0xc8')](_0x3fde2a[_0x0824('0x4d')][_0x0824('0x70')])){for(var _0x3dd534=0x0;_0x3dd534<_0x3fde2a[_0x0824('0x4d')][_0x0824('0x70')][_0x0824('0x53')];_0x3dd534+=0x1){socket[_0x0824('0xc5')](_0x0824('0xc9'),{'UserId':Number(_0x3fde2a['query'][_0x0824('0x70')][_0x3dd534]),'FaxAccountId':Number(_0x3fde2a[_0x0824('0x61')]['id'])});}}else{socket[_0x0824('0xc5')](_0x0824('0xc9'),{'UserId':Number(_0x3fde2a[_0x0824('0x4d')][_0x0824('0x70')]),'FaxAccountId':Number(_0x3fde2a[_0x0824('0x61')]['id'])});}});}})[_0x0824('0x25')](respondWithStatusCode(_0x580780,null))[_0x0824('0x2e')](handleError(_0x580780,null));};exports['getAgents']=function(_0x599523,_0x3b7e7f,_0xf989e0){var _0x5e513b={};var _0x39f902={};var _0xd5014c;var _0x1a9378;return db[_0x0824('0x48')][_0x0824('0x73')]({'where':{'id':_0x599523['params']['id']}})[_0x0824('0x25')](handleEntityNotFound(_0x3b7e7f,null))[_0x0824('0x25')](function(_0x2248b7){if(_0x2248b7){_0xd5014c=_0x2248b7;_0x39f902[_0x0824('0x50')]=_['keys'](db[_0x0824('0x7b')][_0x0824('0x49')]);_0x39f902[_0x0824('0x4d')]=_[_0x0824('0x4e')](_0x599523[_0x0824('0x4d')]);_0x39f902[_0x0824('0x57')]=_[_0x0824('0x4f')](_0x39f902[_0x0824('0x50')],_0x39f902[_0x0824('0x4d')]);_0x5e513b[_0x0824('0x51')]=_[_0x0824('0x4f')](_0x39f902[_0x0824('0x50')],qs['fields'](_0x599523['query'][_0x0824('0x52')]));_0x5e513b['attributes']=_0x5e513b[_0x0824('0x51')][_0x0824('0x53')]?_0x5e513b[_0x0824('0x51')]:_0x39f902[_0x0824('0x50')];_0x5e513b[_0x0824('0x55')]=qs[_0x0824('0x56')](_0x599523[_0x0824('0x4d')][_0x0824('0x56')]);_0x5e513b['where']=qs[_0x0824('0x57')](_[_0x0824('0x58')](_0x599523[_0x0824('0x4d')],_0x39f902['filters']));if(_0x599523['query']['filter']){_0x5e513b['where']=_[_0x0824('0x5b')](_0x5e513b['where'],{'$or':_[_0x0824('0x47')](_0x5e513b[_0x0824('0x51')],function(_0x5b4aef){var _0x33f184={};_0x33f184[_0x5b4aef]={'$like':'%'+_0x599523[_0x0824('0x4d')][_0x0824('0x59')]+'%'};return _0x33f184;})});}_0x5e513b=_[_0x0824('0x5b')]({},_0x5e513b,_0x599523[_0x0824('0x5c')]);return _0xd5014c[_0x0824('0xca')](_0x5e513b);}})['then'](function(_0x2764d0){if(_0x2764d0){_0x1a9378=_0x2764d0[_0x0824('0x53')];if(!_0x599523[_0x0824('0x4d')]['hasOwnProperty'](_0x0824('0x6d'))){_0x5e513b[_0x0824('0x33')]=qs[_0x0824('0x33')](_0x599523['query'][_0x0824('0x33')]);_0x5e513b[_0x0824('0x31')]=qs[_0x0824('0x31')](_0x599523['query']['offset']);}return _0xd5014c[_0x0824('0xca')](_0x5e513b);}})[_0x0824('0x25')](function(_0x5ba77b){if(_0x5ba77b){return _0x5ba77b?{'count':_0x1a9378,'rows':_0x5ba77b}:null;}})[_0x0824('0x25')](respondWithResult(_0x3b7e7f,null))['catch'](handleError(_0x3b7e7f,null));}; \ No newline at end of file +var _0x6fa0=['fs-extra','lodash','squel','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','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','FaxAccounts','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','show','Pause','keys','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','FaxAccountId','Disposition','removeDispositions','CannedAnswer','getAnswers','findOne','removeAnswers','ids','FaxInteraction','getInteractions','CmContact','Owner','fullname','internal','Tag','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','getApplications','context','exten','app','appdata','push','CDR(type)=inbound-fax','ecm','localstationid','faxdetect','headerinfo','modem','t38timeout','FAXOPT(','Set','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','omit','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','ListId','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','info','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs'];(function(_0x4fa4c5,_0x6a105a){var _0x12fbf8=function(_0x46028e){while(--_0x46028e){_0x4fa4c5['push'](_0x4fa4c5['shift']());}};_0x12fbf8(++_0x6a105a);}(_0x6fa0,0xbc));var _0x06fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6fa0[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x06fa('0x0'));var rimraf=require(_0x06fa('0x1'));var zipdir=require(_0x06fa('0x2'));var jsonpatch=require(_0x06fa('0x3'));var rp=require(_0x06fa('0x4'));var moment=require('moment');var BPromise=require(_0x06fa('0x5'));var Mustache=require(_0x06fa('0x6'));var util=require('util');var path=require(_0x06fa('0x7'));var sox=require(_0x06fa('0x8'));var csv=require('to-csv');var ejs=require(_0x06fa('0x9'));var fs=require('fs');var fs_extra=require(_0x06fa('0xa'));var _=require(_0x06fa('0xb'));var squel=require(_0x06fa('0xc'));var crypto=require(_0x06fa('0xd'));var jsforce=require(_0x06fa('0xe'));var deskjs=require(_0x06fa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x06fa('0x10'));var Papa=require('papaparse');var Redis=require(_0x06fa('0x11'));var authService=require(_0x06fa('0x12'));var qs=require(_0x06fa('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06fa('0x14'));var logger=require(_0x06fa('0x15'))(_0x06fa('0x16'));var utils=require(_0x06fa('0x17'));var config=require(_0x06fa('0x18'));var licenseUtil=require(_0x06fa('0x19'));var db=require(_0x06fa('0x1a'))['db'];config['redis']=_['defaults'](config[_0x06fa('0x1b')],{'host':_0x06fa('0x1c'),'port':0x18eb});var socket=require(_0x06fa('0x1d'))(new Redis(config[_0x06fa('0x1b')]));require('./faxAccount.socket')[_0x06fa('0x1e')](socket);var jayson=require(_0x06fa('0x1f'));var client=jayson[_0x06fa('0x20')][_0x06fa('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x06fa('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xa4c20,_0x7b9040,_0x3980b1,_0x3540de){return new BPromise(function(_0x2ab2c7,_0x4d26fc){var _0x3a7ecb=_0x3540de||client;return _0x3a7ecb[_0x06fa('0x22')](_0xa4c20,_0x3980b1)[_0x06fa('0x23')](function(_0x2ae157){logger['info'](_0x06fa('0x24'),_0x7b9040,_0x06fa('0x25'));logger[_0x06fa('0x26')](_0x06fa('0x27'),_0x7b9040,'request\x20sent',JSON[_0x06fa('0x28')](_0x2ae157));if(_0x2ae157[_0x06fa('0x29')]){if(_0x2ae157['error'][_0x06fa('0x2a')]===0x1f4){logger[_0x06fa('0x29')](_0x06fa('0x24'),_0x7b9040,_0x2ae157['error'][_0x06fa('0x2b')]);return _0x4d26fc(_0x2ae157[_0x06fa('0x29')]['message']);}logger[_0x06fa('0x29')](_0x06fa('0x24'),_0x7b9040,_0x2ae157['error'][_0x06fa('0x2b')]);return _0x2ab2c7(_0x2ae157[_0x06fa('0x29')]['message']);}else{logger['info'](_0x06fa('0x24'),_0x7b9040,_0x06fa('0x25'));_0x2ab2c7(_0x2ae157[_0x06fa('0x2c')][_0x06fa('0x2b')]);}})[_0x06fa('0x2d')](function(_0x1c9e0c){logger[_0x06fa('0x29')]('FaxAccount,\x20%s,\x20%s',_0x7b9040,_0x1c9e0c);_0x4d26fc(_0x1c9e0c);});});}function respondWithStatusCode(_0x5f47d4,_0x13db42){_0x13db42=_0x13db42||0xcc;return function(_0x5d5657){if(_0x5d5657){return _0x5f47d4[_0x06fa('0x2e')](_0x13db42);}return _0x5f47d4[_0x06fa('0x2f')](_0x13db42)[_0x06fa('0x30')]();};}function respondWithResult(_0x274af9,_0x14902c){_0x14902c=_0x14902c||0xc8;return function(_0x1aedce){if(_0x1aedce){return _0x274af9[_0x06fa('0x2f')](_0x14902c)[_0x06fa('0x31')](_0x1aedce);}};}function respondWithFilteredResult(_0x42e20c,_0x1959e6){return function(_0x5d73e4){if(_0x5d73e4){var _0x10599a=typeof _0x1959e6[_0x06fa('0x32')]===_0x06fa('0x33')&&typeof _0x1959e6[_0x06fa('0x34')]==='undefined';var _0x3e083d=_0x5d73e4[_0x06fa('0x35')];var _0x135d41=_0x10599a?0x0:_0x1959e6[_0x06fa('0x32')];var _0x14e9f7=_0x10599a?_0x5d73e4[_0x06fa('0x35')]:_0x1959e6[_0x06fa('0x32')]+_0x1959e6['limit'];var _0x2cd9aa;if(_0x14e9f7>=_0x3e083d){_0x14e9f7=_0x3e083d;_0x2cd9aa=0xc8;}else{_0x2cd9aa=0xce;}_0x42e20c[_0x06fa('0x2f')](_0x2cd9aa);return _0x42e20c[_0x06fa('0x36')](_0x06fa('0x37'),_0x135d41+'-'+_0x14e9f7+'/'+_0x3e083d)[_0x06fa('0x31')](_0x5d73e4);}return null;};}function patchUpdates(_0x11f7fb){return function(_0x5c626e){try{jsonpatch[_0x06fa('0x38')](_0x5c626e,_0x11f7fb,!![]);}catch(_0x2820d3){return BPromise['reject'](_0x2820d3);}return _0x5c626e[_0x06fa('0x39')]();};}function saveUpdates(_0x3a5eaf,_0x27fe42){return function(_0x4f5be1){if(_0x4f5be1){return _0x4f5be1[_0x06fa('0x3a')](_0x3a5eaf)['then'](function(_0x4897b4){return _0x4897b4;});}return null;};}function removeEntity(_0x31cd49,_0x569908){return function(_0x21a144){if(_0x21a144){return _0x21a144[_0x06fa('0x3b')]()[_0x06fa('0x23')](function(){var _0x438547=_0x21a144[_0x06fa('0x3c')]({'plain':!![]});var _0x51159c=_0x06fa('0x3d');return db['UserProfileResource']['destroy']({'where':{'type':_0x51159c,'resourceId':_0x438547['id']}})['then'](function(){return _0x21a144;});})[_0x06fa('0x23')](function(){_0x31cd49['status'](0xcc)[_0x06fa('0x30')]();});}};}function handleEntityNotFound(_0x522a6d,_0x144270){return function(_0x523df0){if(!_0x523df0){_0x522a6d[_0x06fa('0x2e')](0x194);}return _0x523df0;};}function handleError(_0x6a9d1c,_0x53109f){_0x53109f=_0x53109f||0x1f4;return function(_0x5f8565){logger[_0x06fa('0x29')](_0x5f8565[_0x06fa('0x3e')]);if(_0x5f8565[_0x06fa('0x3f')]){delete _0x5f8565[_0x06fa('0x3f')];}_0x6a9d1c['status'](_0x53109f)[_0x06fa('0x40')](_0x5f8565);};}exports[_0x06fa('0x41')]=function(_0x3cd7ca,_0x3e4004){var _0x2e3e0e={'include':[{'model':db['Pause'],'as':_0x06fa('0x42')}]},_0x273034={},_0x41fc9c={'count':0x0,'rows':[]};var _0x84b579=_[_0x06fa('0x43')](db[_0x06fa('0x44')][_0x06fa('0x45')],function(_0x53e0cd){return{'name':_0x53e0cd['fieldName'],'type':_0x53e0cd[_0x06fa('0x46')][_0x06fa('0x47')]};});_0x273034[_0x06fa('0x48')]=_[_0x06fa('0x43')](_0x84b579,_0x06fa('0x3f'));_0x273034[_0x06fa('0x49')]=_['keys'](_0x3cd7ca[_0x06fa('0x49')]);_0x273034[_0x06fa('0x4a')]=_[_0x06fa('0x4b')](_0x273034['model'],_0x273034[_0x06fa('0x49')]);_0x2e3e0e['attributes']=_[_0x06fa('0x4b')](_0x273034[_0x06fa('0x48')],qs[_0x06fa('0x4c')](_0x3cd7ca[_0x06fa('0x49')][_0x06fa('0x4c')]));_0x2e3e0e['attributes']=_0x2e3e0e[_0x06fa('0x4d')][_0x06fa('0x4e')]?_0x2e3e0e['attributes']:_0x273034['model'];if(!_0x3cd7ca[_0x06fa('0x49')][_0x06fa('0x4f')](_0x06fa('0x50'))){_0x2e3e0e[_0x06fa('0x34')]=qs['limit'](_0x3cd7ca[_0x06fa('0x49')][_0x06fa('0x34')]);_0x2e3e0e['offset']=qs[_0x06fa('0x32')](_0x3cd7ca[_0x06fa('0x49')][_0x06fa('0x32')]);}_0x2e3e0e[_0x06fa('0x51')]=qs[_0x06fa('0x52')](_0x3cd7ca[_0x06fa('0x49')][_0x06fa('0x52')]);_0x2e3e0e[_0x06fa('0x53')]=qs[_0x06fa('0x4a')](_[_0x06fa('0x54')](_0x3cd7ca[_0x06fa('0x49')],_0x273034[_0x06fa('0x4a')]),_0x84b579);if(_0x3cd7ca[_0x06fa('0x49')][_0x06fa('0x55')]){_0x2e3e0e[_0x06fa('0x53')]=_[_0x06fa('0x56')](_0x2e3e0e[_0x06fa('0x53')],{'$or':_['map'](_0x84b579,function(_0x18b869){if(_0x18b869[_0x06fa('0x46')]!=='VIRTUAL'){var _0x12fa31={};_0x12fa31[_0x18b869[_0x06fa('0x3f')]]={'$like':'%'+_0x3cd7ca[_0x06fa('0x49')][_0x06fa('0x55')]+'%'};return _0x12fa31;}})});}_0x2e3e0e=_[_0x06fa('0x56')]({},_0x2e3e0e,_0x3cd7ca[_0x06fa('0x57')]);var _0x10d8c9={'where':_0x2e3e0e[_0x06fa('0x53')]};return db[_0x06fa('0x44')]['count'](_0x10d8c9)[_0x06fa('0x23')](function(_0x5e5daf){_0x41fc9c[_0x06fa('0x35')]=_0x5e5daf;if(_0x3cd7ca[_0x06fa('0x49')]['includeAll']){_0x2e3e0e['include']=[{'all':!![]}];}return db[_0x06fa('0x44')][_0x06fa('0x58')](_0x2e3e0e);})[_0x06fa('0x23')](function(_0x5b582a){_0x41fc9c[_0x06fa('0x59')]=_0x5b582a;return _0x41fc9c;})['then'](respondWithFilteredResult(_0x3e4004,_0x2e3e0e))[_0x06fa('0x2d')](handleError(_0x3e4004,null));};exports[_0x06fa('0x5a')]=function(_0x91fb7a,_0x58ee71){var _0x751da3={'raw':![],'where':{'id':_0x91fb7a['params']['id']},'include':[{'model':db[_0x06fa('0x5b')],'as':_0x06fa('0x42')}]},_0x4f5b15={};_0x4f5b15[_0x06fa('0x48')]=_[_0x06fa('0x5c')](db[_0x06fa('0x44')][_0x06fa('0x45')]);_0x4f5b15[_0x06fa('0x49')]=_[_0x06fa('0x5c')](_0x91fb7a[_0x06fa('0x49')]);_0x4f5b15[_0x06fa('0x4a')]=_[_0x06fa('0x4b')](_0x4f5b15['model'],_0x4f5b15[_0x06fa('0x49')]);_0x751da3[_0x06fa('0x4d')]=_[_0x06fa('0x4b')](_0x4f5b15['model'],qs[_0x06fa('0x4c')](_0x91fb7a['query'][_0x06fa('0x4c')]));_0x751da3[_0x06fa('0x4d')]=_0x751da3[_0x06fa('0x4d')][_0x06fa('0x4e')]?_0x751da3[_0x06fa('0x4d')]:_0x4f5b15[_0x06fa('0x48')];if(_0x91fb7a['query'][_0x06fa('0x5d')]){_0x751da3[_0x06fa('0x5e')]=[{'all':!![]}];}_0x751da3=_[_0x06fa('0x56')]({},_0x751da3,_0x91fb7a[_0x06fa('0x57')]);return db[_0x06fa('0x44')][_0x06fa('0x5f')](_0x751da3)[_0x06fa('0x23')](handleEntityNotFound(_0x58ee71,null))['then'](respondWithResult(_0x58ee71,null))[_0x06fa('0x2d')](handleError(_0x58ee71,null));};exports[_0x06fa('0x60')]=function(_0xd354db,_0x55e985){return db[_0x06fa('0x44')]['create'](_0xd354db[_0x06fa('0x61')],{})[_0x06fa('0x23')](function(_0x898cb){var _0x377d8e=_0xd354db[_0x06fa('0x62')][_0x06fa('0x3c')]({'plain':!![]});if(!_0x377d8e)throw new Error(_0x06fa('0x63'));if(_0x377d8e[_0x06fa('0x64')]===_0x06fa('0x62')){var _0x518692=_0x898cb[_0x06fa('0x3c')]({'plain':!![]});var _0x442640=_0x06fa('0x3d');return db[_0x06fa('0x65')][_0x06fa('0x5f')]({'where':{'name':_0x442640,'userProfileId':_0x377d8e[_0x06fa('0x66')]},'raw':!![]})[_0x06fa('0x23')](function(_0x189545){if(_0x189545&&_0x189545[_0x06fa('0x67')]===0x0){return db['UserProfileResource'][_0x06fa('0x60')]({'name':_0x518692[_0x06fa('0x3f')],'resourceId':_0x518692['id'],'type':_0x189545[_0x06fa('0x3f')],'sectionId':_0x189545['id']},{})[_0x06fa('0x23')](function(){return _0x898cb;});}else{return _0x898cb;}})[_0x06fa('0x2d')](function(_0x9dfdd6){logger['error'](_0x06fa('0x68'),_0x9dfdd6);throw _0x9dfdd6;});}return _0x898cb;})[_0x06fa('0x23')](respondWithResult(_0x55e985,0xc9))[_0x06fa('0x2d')](handleError(_0x55e985,null));};exports[_0x06fa('0x3a')]=function(_0x303ce6,_0xeffbc0){if(_0x303ce6[_0x06fa('0x61')]['id']){delete _0x303ce6[_0x06fa('0x61')]['id'];}return db['FaxAccount'][_0x06fa('0x5f')]({'where':{'id':_0x303ce6[_0x06fa('0x69')]['id']},'include':[{'model':db['Pause'],'as':_0x06fa('0x42')}]})['then'](handleEntityNotFound(_0xeffbc0,null))[_0x06fa('0x23')](saveUpdates(_0x303ce6[_0x06fa('0x61')],null))['then'](respondWithResult(_0xeffbc0,null))[_0x06fa('0x2d')](handleError(_0xeffbc0,null));};exports['destroy']=function(_0x5702ac,_0x206659){return db[_0x06fa('0x44')][_0x06fa('0x5f')]({'where':{'id':_0x5702ac['params']['id']}})['then'](handleEntityNotFound(_0x206659,null))[_0x06fa('0x23')](removeEntity(_0x206659,null))[_0x06fa('0x2d')](handleError(_0x206659,null));};exports[_0x06fa('0x6a')]=function(_0x1a472e,_0x3087a4){return db[_0x06fa('0x44')][_0x06fa('0x6a')]()[_0x06fa('0x23')](respondWithResult(_0x3087a4,null))['catch'](handleError(_0x3087a4,null));};exports['addDisposition']=function(_0x66d8b3,_0x4f9c6d,_0x2db412){if(_0x66d8b3[_0x06fa('0x61')]['id']){delete _0x66d8b3[_0x06fa('0x61')]['id'];}return db[_0x06fa('0x44')][_0x06fa('0x5f')]({'where':{'id':_0x66d8b3[_0x06fa('0x69')]['id']}})['then'](handleEntityNotFound(_0x4f9c6d,null))[_0x06fa('0x23')](function(_0x1ba786){if(_0x1ba786){_0x66d8b3['body'][_0x06fa('0x6b')]=_0x1ba786['id'];return db['Disposition'][_0x06fa('0x60')](_0x66d8b3[_0x06fa('0x61')]);}})[_0x06fa('0x23')](respondWithResult(_0x4f9c6d,null))[_0x06fa('0x2d')](handleError(_0x4f9c6d,null));};exports['getDispositions']=function(_0x27ccda,_0x4edd66,_0x18deeb){var _0x547d65={'raw':![],'where':{}};var _0x232f60={};var _0x270e9e={'count':0x0,'rows':[]};return db[_0x06fa('0x44')]['findOne']({'where':{'id':_0x27ccda[_0x06fa('0x69')]['id']}})['then'](handleEntityNotFound(_0x4edd66,null))[_0x06fa('0x23')](function(_0x4b97e9){if(_0x4b97e9){_0x232f60[_0x06fa('0x48')]=_[_0x06fa('0x5c')](db[_0x06fa('0x6c')]['rawAttributes']);_0x232f60[_0x06fa('0x49')]=_[_0x06fa('0x5c')](_0x27ccda['query']);_0x232f60[_0x06fa('0x4a')]=_['intersection'](_0x232f60[_0x06fa('0x48')],_0x232f60[_0x06fa('0x49')]);_0x547d65[_0x06fa('0x4d')]=_[_0x06fa('0x4b')](_0x232f60[_0x06fa('0x48')],qs[_0x06fa('0x4c')](_0x27ccda[_0x06fa('0x49')][_0x06fa('0x4c')]));_0x547d65[_0x06fa('0x4d')]=_0x547d65[_0x06fa('0x4d')][_0x06fa('0x4e')]?_0x547d65[_0x06fa('0x4d')]:_0x232f60[_0x06fa('0x48')];if(!_0x27ccda[_0x06fa('0x49')][_0x06fa('0x4f')]('nolimit')){_0x547d65['limit']=qs[_0x06fa('0x34')](_0x27ccda[_0x06fa('0x49')][_0x06fa('0x34')]);_0x547d65[_0x06fa('0x32')]=qs[_0x06fa('0x32')](_0x27ccda['query'][_0x06fa('0x32')]);}_0x547d65['order']=qs[_0x06fa('0x52')](_0x27ccda[_0x06fa('0x49')]['sort']);_0x547d65[_0x06fa('0x53')]=qs[_0x06fa('0x4a')](_[_0x06fa('0x54')](_0x27ccda['query'],_0x232f60[_0x06fa('0x4a')]));_0x547d65[_0x06fa('0x53')]['FaxAccountId']=_0x4b97e9['id'];if(_0x27ccda[_0x06fa('0x49')]['filter']){_0x547d65[_0x06fa('0x53')]=_[_0x06fa('0x56')](_0x547d65[_0x06fa('0x53')],{'$or':_[_0x06fa('0x43')](_0x547d65[_0x06fa('0x4d')],function(_0x4cf82e){var _0xf16350={};_0xf16350[_0x4cf82e]={'$like':'%'+_0x27ccda[_0x06fa('0x49')][_0x06fa('0x55')]+'%'};return _0xf16350;})});}_0x547d65=_[_0x06fa('0x56')]({},_0x547d65,_0x27ccda[_0x06fa('0x57')]);return db['Disposition'][_0x06fa('0x35')]({'where':_0x547d65[_0x06fa('0x53')]})[_0x06fa('0x23')](function(_0x4d6b1a){_0x270e9e[_0x06fa('0x35')]=_0x4d6b1a;if(_0x27ccda['query'][_0x06fa('0x5d')]){_0x547d65[_0x06fa('0x5e')]=[{'all':!![]}];}return db[_0x06fa('0x6c')]['findAll'](_0x547d65);})[_0x06fa('0x23')](function(_0x28b0a0){_0x270e9e['rows']=_0x28b0a0;return _0x270e9e;});}})['then'](respondWithFilteredResult(_0x4edd66,_0x547d65))[_0x06fa('0x2d')](handleError(_0x4edd66,null));};exports[_0x06fa('0x6d')]=function(_0x37ad9b,_0xb1b011,_0x884fc4){return db['FaxAccount']['find']({'where':{'id':_0x37ad9b['params']['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0xb1b011,null))[_0x06fa('0x23')](function(_0xdbfac0){if(_0xdbfac0){return _0xdbfac0[_0x06fa('0x6d')](_0x37ad9b[_0x06fa('0x49')]['ids']);}})[_0x06fa('0x23')](respondWithStatusCode(_0xb1b011,null))[_0x06fa('0x2d')](handleError(_0xb1b011,null));};exports['addAnswer']=function(_0x35a3f0,_0x4f512a,_0x19856a){if(_0x35a3f0[_0x06fa('0x61')]['id']){delete _0x35a3f0['body']['id'];}return db['FaxAccount'][_0x06fa('0x5f')]({'where':{'id':_0x35a3f0[_0x06fa('0x69')]['id']}})['then'](handleEntityNotFound(_0x4f512a,null))[_0x06fa('0x23')](function(_0x524a31){if(_0x524a31){_0x35a3f0[_0x06fa('0x61')][_0x06fa('0x6b')]=_0x524a31['id'];return db[_0x06fa('0x6e')]['create'](_0x35a3f0[_0x06fa('0x61')]);}})['then'](respondWithResult(_0x4f512a,null))[_0x06fa('0x2d')](handleError(_0x4f512a,null));};exports[_0x06fa('0x6f')]=function(_0x137d3c,_0x3cd560,_0x59cfd1){var _0x7bcb27={'raw':![],'where':{}};var _0x1b4a2a={};var _0x469923={'count':0x0,'rows':[]};return db[_0x06fa('0x44')][_0x06fa('0x70')]({'where':{'id':_0x137d3c[_0x06fa('0x69')]['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0x3cd560,null))['then'](function(_0x53009f){if(_0x53009f){_0x1b4a2a[_0x06fa('0x48')]=_[_0x06fa('0x5c')](db[_0x06fa('0x6e')][_0x06fa('0x45')]);_0x1b4a2a[_0x06fa('0x49')]=_[_0x06fa('0x5c')](_0x137d3c[_0x06fa('0x49')]);_0x1b4a2a[_0x06fa('0x4a')]=_['intersection'](_0x1b4a2a['model'],_0x1b4a2a[_0x06fa('0x49')]);_0x7bcb27['attributes']=_[_0x06fa('0x4b')](_0x1b4a2a[_0x06fa('0x48')],qs[_0x06fa('0x4c')](_0x137d3c['query']['fields']));_0x7bcb27[_0x06fa('0x4d')]=_0x7bcb27['attributes'][_0x06fa('0x4e')]?_0x7bcb27[_0x06fa('0x4d')]:_0x1b4a2a[_0x06fa('0x48')];if(!_0x137d3c[_0x06fa('0x49')]['hasOwnProperty'](_0x06fa('0x50'))){_0x7bcb27[_0x06fa('0x34')]=qs['limit'](_0x137d3c[_0x06fa('0x49')]['limit']);_0x7bcb27['offset']=qs[_0x06fa('0x32')](_0x137d3c['query'][_0x06fa('0x32')]);}_0x7bcb27[_0x06fa('0x51')]=qs['sort'](_0x137d3c[_0x06fa('0x49')]['sort']);_0x7bcb27[_0x06fa('0x53')]=qs[_0x06fa('0x4a')](_[_0x06fa('0x54')](_0x137d3c['query'],_0x1b4a2a[_0x06fa('0x4a')]));_0x7bcb27[_0x06fa('0x53')][_0x06fa('0x6b')]=_0x53009f['id'];if(_0x137d3c[_0x06fa('0x49')]['filter']){_0x7bcb27['where']=_[_0x06fa('0x56')](_0x7bcb27['where'],{'$or':_['map'](_0x7bcb27[_0x06fa('0x4d')],function(_0x3d9286){var _0x4f6a95={};_0x4f6a95[_0x3d9286]={'$like':'%'+_0x137d3c[_0x06fa('0x49')][_0x06fa('0x55')]+'%'};return _0x4f6a95;})});}_0x7bcb27=_[_0x06fa('0x56')]({},_0x7bcb27,_0x137d3c[_0x06fa('0x57')]);return db[_0x06fa('0x6e')][_0x06fa('0x35')]({'where':_0x7bcb27[_0x06fa('0x53')]})['then'](function(_0x1875b6){_0x469923[_0x06fa('0x35')]=_0x1875b6;if(_0x137d3c['query'][_0x06fa('0x5d')]){_0x7bcb27[_0x06fa('0x5e')]=[{'all':!![]}];}return db[_0x06fa('0x6e')]['findAll'](_0x7bcb27);})['then'](function(_0x44113d){_0x469923['rows']=_0x44113d;return _0x469923;});}})[_0x06fa('0x23')](respondWithFilteredResult(_0x3cd560,_0x7bcb27))[_0x06fa('0x2d')](handleError(_0x3cd560,null));};exports[_0x06fa('0x71')]=function(_0x122f99,_0x5cf8ae,_0x9ab5b2){return db['FaxAccount'][_0x06fa('0x5f')]({'where':{'id':_0x122f99['params']['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0x5cf8ae,null))['then'](function(_0x5257e1){if(_0x5257e1){return _0x5257e1['removeAnswers'](_0x122f99[_0x06fa('0x49')][_0x06fa('0x72')]);}})[_0x06fa('0x23')](respondWithStatusCode(_0x5cf8ae,null))[_0x06fa('0x2d')](handleError(_0x5cf8ae,null));};exports['addInteraction']=function(_0x48e837,_0x61f7a1,_0x248bcc){return db[_0x06fa('0x73')][_0x06fa('0x5f')]({'where':{'id':_0x48e837[_0x06fa('0x69')]['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0x61f7a1,null))[_0x06fa('0x23')](function(_0x30e834){if(_0x30e834){return _0x30e834['addInteraction'](_0x48e837['body'][_0x06fa('0x72')],_['omit'](_0x48e837[_0x06fa('0x61')],[_0x06fa('0x72'),'id'])||{});}})[_0x06fa('0x23')](respondWithResult(_0x61f7a1,null))[_0x06fa('0x2d')](handleError(_0x61f7a1,null));};exports[_0x06fa('0x74')]=function(_0x33d190,_0x32b2c3,_0x4be858){var _0xf87219={'raw':![],'where':{}};var _0x4b1f42={};var _0x2a597a={'count':0x0,'rows':[]};return db[_0x06fa('0x44')][_0x06fa('0x70')]({'where':{'id':_0x33d190[_0x06fa('0x69')]['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0x32b2c3,null))[_0x06fa('0x23')](function(_0x1f9aa9){if(_0x1f9aa9){_0x4b1f42['model']=_[_0x06fa('0x5c')](db['FaxInteraction'][_0x06fa('0x45')]);_0x4b1f42['query']=_[_0x06fa('0x5c')](_0x33d190[_0x06fa('0x49')]);_0x4b1f42[_0x06fa('0x4a')]=_[_0x06fa('0x4b')](_0x4b1f42[_0x06fa('0x48')],_0x4b1f42[_0x06fa('0x49')]);_0xf87219[_0x06fa('0x4d')]=_[_0x06fa('0x4b')](_0x4b1f42[_0x06fa('0x48')],qs[_0x06fa('0x4c')](_0x33d190[_0x06fa('0x49')][_0x06fa('0x4c')]));_0xf87219[_0x06fa('0x4d')]=_0xf87219[_0x06fa('0x4d')]['length']?_0xf87219[_0x06fa('0x4d')]:_0x4b1f42[_0x06fa('0x48')];if(!_0x33d190['query']['hasOwnProperty'](_0x06fa('0x50'))){_0xf87219[_0x06fa('0x34')]=qs[_0x06fa('0x34')](_0x33d190[_0x06fa('0x49')]['limit']);_0xf87219[_0x06fa('0x32')]=qs['offset'](_0x33d190[_0x06fa('0x49')][_0x06fa('0x32')]);}_0xf87219[_0x06fa('0x51')]=qs[_0x06fa('0x52')](_0x33d190[_0x06fa('0x49')][_0x06fa('0x52')]);_0xf87219[_0x06fa('0x53')]=qs[_0x06fa('0x4a')](_['pick'](_0x33d190[_0x06fa('0x49')],_0x4b1f42[_0x06fa('0x4a')]));_0xf87219[_0x06fa('0x53')][_0x06fa('0x6b')]=_0x1f9aa9['id'];if(_0x33d190[_0x06fa('0x49')][_0x06fa('0x55')]){_0xf87219[_0x06fa('0x53')]=_[_0x06fa('0x56')](_0xf87219['where'],{'$or':_[_0x06fa('0x43')](_0xf87219[_0x06fa('0x4d')],function(_0x42d4de){var _0xd39814={};_0xd39814[_0x42d4de]={'$like':'%'+_0x33d190['query'][_0x06fa('0x55')]+'%'};return _0xd39814;})});}_0xf87219=_[_0x06fa('0x56')]({},_0xf87219,_0x33d190['options']);return db[_0x06fa('0x73')]['count']({'where':_0xf87219['where']})[_0x06fa('0x23')](function(_0x22572a){_0x2a597a[_0x06fa('0x35')]=_0x22572a;if(_0x33d190[_0x06fa('0x49')][_0x06fa('0x5d')]){_0xf87219[_0x06fa('0x5e')]=[{'model':db[_0x06fa('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x06fa('0x76'),'attributes':[_0x06fa('0x3f'),_0x06fa('0x77'),_0x06fa('0x78')],'required':![]},{'model':db[_0x06fa('0x79')],'as':'Tags','attributes':['id',_0x06fa('0x3f'),_0x06fa('0x7a')],'where':_0x33d190[_0x06fa('0x49')][_0x06fa('0x7b')]?{'id':_0x33d190[_0x06fa('0x49')][_0x06fa('0x7b')]}:undefined,'required':_0x33d190[_0x06fa('0x49')][_0x06fa('0x7b')]?!![]:![]}];}return db[_0x06fa('0x73')][_0x06fa('0x58')](_0xf87219);})['then'](function(_0x5a73ab){_0x2a597a[_0x06fa('0x59')]=_0x5a73ab;return _0x2a597a;});}})[_0x06fa('0x23')](respondWithFilteredResult(_0x32b2c3,_0xf87219))[_0x06fa('0x2d')](handleError(_0x32b2c3,null));};exports[_0x06fa('0x7c')]=function(_0x453956,_0x325730){var _0x365453=_0x453956['params']['id'];var _0x280860=_0x453956[_0x06fa('0x61')];var _0x3849c3=0xc8;var _0x5f609c=null;return db['sequelize'][_0x06fa('0x7d')]({'isolationLevel':db[_0x06fa('0x7e')][_0x06fa('0x7f')][_0x06fa('0x80')][_0x06fa('0x81')]},function(_0x1477da){return db['FaxAccount'][_0x06fa('0x70')]({'where':{'id':_0x365453},'transaction':_0x1477da})[_0x06fa('0x23')](function(_0xc168b2){if(_0xc168b2){return db['FaxApplication'][_0x06fa('0x3b')]({'where':{'FaxAccountId':_0x365453},'transaction':_0x1477da})['then'](function(){var _0x3f6b04=_['map'](_0x280860,function(_0x150d51){_0x150d51['FaxAccountId']=_0x365453;return _0x150d51;});return db['FaxApplication']['bulkCreate'](_0x3f6b04,{'transaction':_0x1477da});});}else{_0x3849c3=0x194;_0x5f609c=[];}});})[_0x06fa('0x23')](function(){if(_0x3849c3!==0x194){return db[_0x06fa('0x82')][_0x06fa('0x83')]({'where':{'FaxAccountId':_0x365453},'order':_0x06fa('0x84')})['then'](function(_0x4b3574){_0x5f609c=_0x4b3574;});}})[_0x06fa('0x2d')](function(_0x56274b){_0x3849c3=0x1f4;logger['error'](_0x56274b[_0x06fa('0x3e')]);if(_0x56274b[_0x06fa('0x3f')]){delete _0x56274b[_0x06fa('0x3f')];}_0x5f609c=_0x56274b;})[_0x06fa('0x85')](function(){if(_0x5f609c===null){_0x325730[_0x06fa('0x2e')](_0x3849c3);}else{if(_0x3849c3===0x1f4){_0x325730['status'](_0x3849c3)[_0x06fa('0x40')](_0x5f609c);}else{_0x325730[_0x06fa('0x2f')](_0x3849c3)[_0x06fa('0x31')](_0x5f609c);}}});};exports['getApplications']=function(_0x1cdc22,_0xc2cc9c,_0x4875a8){var _0x29b62b={};var _0x180a0c={};var _0x55bb07;var _0x28ff28;return db[_0x06fa('0x44')][_0x06fa('0x70')]({'where':{'id':_0x1cdc22[_0x06fa('0x69')]['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0xc2cc9c,null))[_0x06fa('0x23')](function(_0x5e62e3){if(_0x5e62e3){_0x55bb07=_0x5e62e3;_0x180a0c[_0x06fa('0x48')]=_[_0x06fa('0x5c')](db[_0x06fa('0x82')][_0x06fa('0x45')]);_0x180a0c['query']=_[_0x06fa('0x5c')](_0x1cdc22[_0x06fa('0x49')]);_0x180a0c['filters']=_[_0x06fa('0x4b')](_0x180a0c[_0x06fa('0x48')],_0x180a0c[_0x06fa('0x49')]);_0x29b62b[_0x06fa('0x4d')]=_['intersection'](_0x180a0c[_0x06fa('0x48')],qs[_0x06fa('0x4c')](_0x1cdc22[_0x06fa('0x49')][_0x06fa('0x4c')]));_0x29b62b[_0x06fa('0x4d')]=_0x29b62b[_0x06fa('0x4d')]['length']?_0x29b62b[_0x06fa('0x4d')]:_0x180a0c[_0x06fa('0x48')];_0x29b62b[_0x06fa('0x51')]=qs[_0x06fa('0x52')](_0x1cdc22[_0x06fa('0x49')][_0x06fa('0x52')]);_0x29b62b['where']=qs[_0x06fa('0x4a')](_[_0x06fa('0x54')](_0x1cdc22[_0x06fa('0x49')],_0x180a0c['filters']));if(_0x1cdc22[_0x06fa('0x49')][_0x06fa('0x55')]){_0x29b62b[_0x06fa('0x53')]=_[_0x06fa('0x56')](_0x29b62b[_0x06fa('0x53')],{'$or':_[_0x06fa('0x43')](_0x29b62b[_0x06fa('0x4d')],function(_0x259028){var _0x96dd85={};_0x96dd85[_0x259028]={'$like':'%'+_0x1cdc22[_0x06fa('0x49')][_0x06fa('0x55')]+'%'};return _0x96dd85;})});}_0x29b62b=_[_0x06fa('0x56')]({},_0x29b62b,_0x1cdc22[_0x06fa('0x57')]);return _0x55bb07[_0x06fa('0x86')](_0x29b62b);}})[_0x06fa('0x23')](function(_0x1fadeb){if(_0x1fadeb){_0x28ff28=_0x1fadeb[_0x06fa('0x4e')];if(!_0x1cdc22[_0x06fa('0x49')][_0x06fa('0x4f')](_0x06fa('0x50'))){_0x29b62b[_0x06fa('0x34')]=qs[_0x06fa('0x34')](_0x1cdc22[_0x06fa('0x49')][_0x06fa('0x34')]);_0x29b62b[_0x06fa('0x32')]=qs['offset'](_0x1cdc22[_0x06fa('0x49')][_0x06fa('0x32')]);}return _0x55bb07[_0x06fa('0x86')](_0x29b62b);}})['then'](function(_0x22f245){if(_0x22f245){return _0x22f245?{'count':_0x28ff28,'rows':_0x22f245}:null;}})[_0x06fa('0x23')](respondWithResult(_0xc2cc9c,null))[_0x06fa('0x2d')](handleError(_0xc2cc9c,null));};function Extension(_0x11b3a5,_0xad87a0,_0x1f420a,_0x352259){this[_0x06fa('0x87')]='from-voip-provider';this[_0x06fa('0x88')]=_0x11b3a5['localstationid'];this[_0x06fa('0x89')]=_0x352259;this[_0x06fa('0x46')]='system';this['description']='Fax\x20Extension';this[_0x06fa('0x6b')]=_0x11b3a5['id'];this['priority']=_0xad87a0;this[_0x06fa('0x8a')]=_0x1f420a;}function createExtensionsReciveFax(_0x70c96b){var _0x3dce1f=0x1;var _0x17d545=[];_0x17d545[_0x06fa('0x8b')](new Extension(_0x70c96b,_0x3dce1f,'','Answer'));_0x3dce1f+=0x1;_0x17d545['push'](new Extension(_0x70c96b,_0x3dce1f,_0x06fa('0x8c'),'Set'));_0x3dce1f+=0x1;for(var _0x730e7c in _0x70c96b){if(_0x70c96b[_0x06fa('0x4f')](_0x730e7c)&&(_0x730e7c===_0x06fa('0x8d')||_0x730e7c===_0x06fa('0x8e')||_0x730e7c==='gateway'||_0x730e7c===_0x06fa('0x8f')||_0x730e7c===_0x06fa('0x90')||_0x730e7c==='maxrate'||_0x730e7c==='minrate'||_0x730e7c===_0x06fa('0x91')||_0x730e7c===_0x06fa('0x92'))){_0x17d545[_0x06fa('0x8b')](new Extension(_0x70c96b,_0x3dce1f,_0x06fa('0x93')+_0x730e7c+')='+_0x70c96b[_0x730e7c],_0x06fa('0x94')));_0x3dce1f+=0x1;}}_0x17d545[_0x06fa('0x8b')](new Extension(_0x70c96b,_0x3dce1f,'6','Wait'));_0x3dce1f+=0x1;_0x17d545[_0x06fa('0x8b')](new Extension(_0x70c96b,_0x3dce1f,'/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',_0x06fa('0x95')));_0x3dce1f=0x0;return _0x17d545;}exports[_0x06fa('0x96')]=function(_0x2deb59,_0x5b1a93,_0x5c5911){var _0x29e6d5;return db[_0x06fa('0x7e')]['transaction'](function(_0x3243c7){return db[_0x06fa('0x44')][_0x06fa('0x60')](_0x2deb59[_0x06fa('0x61')],{'transaction':_0x3243c7})['then'](function(_0x1fdd32){_0x29e6d5=_0x1fdd32['get']({'plain':!![]});return db[_0x06fa('0x97')][_0x06fa('0x98')](createExtensionsReciveFax(_0x29e6d5),{'transaction':_0x3243c7});});})[_0x06fa('0x23')](function(){return _0x29e6d5;})[_0x06fa('0x23')](respondWithResult(_0x5b1a93,null))[_0x06fa('0x2d')](handleError(_0x5b1a93,null));};exports[_0x06fa('0x99')]=function(_0x4cf455,_0x2fab2b,_0x522d8a){var _0x2f49c5;return db[_0x06fa('0x7e')][_0x06fa('0x7d')](function(_0x5abf22){return db['FaxAccount'][_0x06fa('0x3a')](_0x4cf455[_0x06fa('0x61')],{'where':{'id':_0x4cf455[_0x06fa('0x61')]['id']},'transaction':_0x5abf22})[_0x06fa('0x23')](function(_0x2bbf46){return db[_0x06fa('0x97')][_0x06fa('0x3b')]({'where':{'FaxAccountId':_0x4cf455['body']['id']},'transaction':_0x5abf22})[_0x06fa('0x23')](function(_0x44f18c){return db['VoiceExtension'][_0x06fa('0x98')](createExtensionsReciveFax(_[_0x06fa('0x9a')](_0x4cf455[_0x06fa('0x61')],[_0x06fa('0x9b'),'key',_0x06fa('0x9c'),_0x06fa('0x9d'),_0x06fa('0x9e'),'ListId'])),{'transaction':_0x5abf22});});});})['then'](function(){return db[_0x06fa('0x44')][_0x06fa('0x9f')](_0x4cf455[_0x06fa('0x61')]['id']);})[_0x06fa('0x23')](respondWithResult(_0x2fab2b,null))[_0x06fa('0x2d')](handleError(_0x2fab2b,null));};exports[_0x06fa('0xa0')]=function(_0xde3b8b,_0x1e24aa,_0x17965f){var _0xa1b796={'raw':!![],'where':{}};var _0x39434c={};var _0x1909c6={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xde3b8b[_0x06fa('0x69')]['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0x1e24aa,null))['then'](function(_0x540049){if(_0x540049){_0x39434c[_0x06fa('0x48')]=_[_0x06fa('0x5c')](db[_0x06fa('0xa1')][_0x06fa('0x45')]);_0x39434c[_0x06fa('0x49')]=_[_0x06fa('0x5c')](_0xde3b8b['query']);_0x39434c[_0x06fa('0x4a')]=_['intersection'](_0x39434c['model'],_0x39434c['query']);_0xa1b796['attributes']=_[_0x06fa('0x4b')](_0x39434c[_0x06fa('0x48')],qs[_0x06fa('0x4c')](_0xde3b8b['query']['fields']));_0xa1b796[_0x06fa('0x4d')]=_0xa1b796[_0x06fa('0x4d')][_0x06fa('0x4e')]?_0xa1b796[_0x06fa('0x4d')]:_0x39434c['model'];if(!_0xde3b8b['query'][_0x06fa('0x4f')]('nolimit')){_0xa1b796[_0x06fa('0x34')]=qs[_0x06fa('0x34')](_0xde3b8b['query'][_0x06fa('0x34')]);_0xa1b796[_0x06fa('0x32')]=qs[_0x06fa('0x32')](_0xde3b8b[_0x06fa('0x49')][_0x06fa('0x32')]);}_0xa1b796[_0x06fa('0x51')]=qs[_0x06fa('0x52')](_0xde3b8b[_0x06fa('0x49')][_0x06fa('0x52')]);_0xa1b796['where']=qs[_0x06fa('0x4a')](_[_0x06fa('0x54')](_0xde3b8b[_0x06fa('0x49')],_0x39434c[_0x06fa('0x4a')]));_0xa1b796[_0x06fa('0x53')][_0x06fa('0x6b')]=_0x540049['id'];if(_0xde3b8b['query'][_0x06fa('0x55')]){_0xa1b796[_0x06fa('0x53')]=_[_0x06fa('0x56')](_0xa1b796[_0x06fa('0x53')],{'$or':_[_0x06fa('0x43')](_0xa1b796[_0x06fa('0x4d')],function(_0x23f390){var _0x24cf2f={};_0x24cf2f[_0x23f390]={'$like':'%'+_0xde3b8b[_0x06fa('0x49')][_0x06fa('0x55')]+'%'};return _0x24cf2f;})});}if(_0xde3b8b['query']['$gte']){var _0xb996a=_0xde3b8b[_0x06fa('0x49')][_0x06fa('0xa2')][_0x06fa('0xa3')](',');var _0x1a8285={};_0x1a8285[_0xb996a[0x0]]={'$gte':moment(_0xb996a[0x1])[_0x06fa('0xa4')](_0x06fa('0xa5'))};_0xa1b796[_0x06fa('0x53')]=_[_0x06fa('0x56')](_0xa1b796[_0x06fa('0x53')],_0x1a8285);}_0xa1b796=_[_0x06fa('0x56')]({},_0xa1b796,_0xde3b8b[_0x06fa('0x57')]);return db[_0x06fa('0xa1')][_0x06fa('0x35')]({'where':_0xa1b796[_0x06fa('0x53')]})[_0x06fa('0x23')](function(_0x60ca01){_0x1909c6[_0x06fa('0x35')]=_0x60ca01;if(_0xde3b8b[_0x06fa('0x49')][_0x06fa('0x5d')]){_0xa1b796[_0x06fa('0x5e')]=[{'all':!![]}];}return db[_0x06fa('0xa1')][_0x06fa('0x58')](_0xa1b796);})[_0x06fa('0x23')](function(_0x3c178e){_0x1909c6[_0x06fa('0x59')]=_0x3c178e;return _0x1909c6;});}})[_0x06fa('0x23')](respondWithFilteredResult(_0x1e24aa,_0xa1b796))[_0x06fa('0x2d')](handleError(_0x1e24aa,null));};exports[_0x06fa('0x40')]=function(_0xfea364,_0x43c9f1,_0x597280){var _0x485163,_0x520238={},_0x49dad3;if(_0xfea364[_0x06fa('0x61')]['to']){_0x49dad3=_0xfea364[_0x06fa('0x61')]['to'][0x0];}return db['FaxAccount'][_0x06fa('0x5f')]({'where':{'id':_0xfea364[_0x06fa('0x69')]['id']},'include':[{'model':db[_0x06fa('0xa6')],'as':_0x06fa('0xa7'),'include':[{'model':db[_0x06fa('0x75')],'as':_0x06fa('0xa8'),'where':{'fax':_0x49dad3},'limit':0x1,'order':[['updatedAt',_0x06fa('0xa9')]]}]}]})[_0x06fa('0x23')](handleEntityNotFound(_0x43c9f1,null))[_0x06fa('0x23')](function(_0x2f874c){_0x485163=_0x2f874c;if(_0xfea364[_0x06fa('0x61')]['attachments']&&_0xfea364[_0x06fa('0x61')][_0x06fa('0xaa')][_0x06fa('0x4e')]){for(var _0xca00ed=0x0;_0xca00ed<_0xfea364[_0x06fa('0x61')][_0x06fa('0xaa')][_0x06fa('0x4e')];_0xca00ed+=0x1){_0xfea364[_0x06fa('0x61')][_0x06fa('0xaa')][_0xca00ed]={'filename':_0xfea364[_0x06fa('0x61')][_0x06fa('0xaa')][_0xca00ed][_0x06fa('0x3f')],'id':_0xfea364[_0x06fa('0x61')][_0x06fa('0xaa')][_0xca00ed]['id'],'path':path['join'](config[_0x06fa('0xab')],_0x06fa('0xac'),_0xfea364['body'][_0x06fa('0xaa')][_0xca00ed][_0x06fa('0xad')])};}}return respondWithRpcPromise(_0x06fa('0xae'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0xfea364[_0x06fa('0x69')]['id'])?undefined:_0xfea364[_0x06fa('0x69')]['id'],'path':_['isNil'](_0xfea364['body'][_0x06fa('0xaa')][0x0][_0x06fa('0x7')])?undefined:_0xfea364['body'][_0x06fa('0xaa')][0x0][_0x06fa('0x7')],'fax':_['isNil'](_0xfea364['body']['to'][0x0])?undefined:_0xfea364['body']['to'][0x0]},client9002);})[_0x06fa('0x23')](function(){if(_0x485163){if(_[_0x06fa('0xaf')](_0xfea364['body'][_0x06fa('0xb0')])){_0xfea364[_0x06fa('0x61')][_0x06fa('0xb0')]=util[_0x06fa('0xa4')](_0x06fa('0xb1'),_0x485163['name'],_0x485163[_0x06fa('0xb2')]);}if(_0x485163['List']){if(_0x485163[_0x06fa('0xa7')]['Contacts'][_0x06fa('0x4e')]){return _0x485163[_0x06fa('0xa7')][_0x06fa('0xa8')][0x0];}else{return db[_0x06fa('0x75')][_0x06fa('0x60')](_[_0x06fa('0xb3')](_0xfea364[_0x06fa('0x61')],{'firstName':_0xfea364['body']['to'][0x0],'phone':_0xfea364[_0x06fa('0x61')]['to'][0x0],'fax':_0xfea364['body']['to'][0x0],'ListId':_0x485163[_0x06fa('0xb4')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x532c2c){if(_0x532c2c){return db[_0x06fa('0x73')]['find']({'where':{'ContactId':_0x532c2c['id'],'closed':![],'FaxAccountId':_0x485163['id']}})[_0x06fa('0x23')](function(_0x1b144a){if(_0x1b144a){return[_0x1b144a,![]];}return db[_0x06fa('0x73')][_0x06fa('0x60')]({'UserId':_0xfea364[_0x06fa('0x62')]['id'],'ContactId':_0x532c2c['id'],'FaxAccountId':_0x485163['id'],'fax':_0xfea364['body']['to'][0x0],'firstMsgDirection':_0x06fa('0xb5'),'Messages':[_[_0x06fa('0x56')](_0xfea364[_0x06fa('0x61')],{'read':![],'body':_0xfea364[_0x06fa('0x61')]['attachments'][0x0][_0x06fa('0xb6')],'FaxAccountId':_0x485163['id'],'UserId':_0xfea364[_0x06fa('0x62')]['id'],'ContactId':_0x532c2c['id'],'AttachmentId':_0xfea364[_0x06fa('0x61')][_0x06fa('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x06fa('0x23')](function(_0x590c5f){return[_0x590c5f,!![]];});});}else{throw new Error(_0x06fa('0xb7'));}})[_0x06fa('0xb8')](function(_0x3e1273,_0x20dc91){if(_0x20dc91){return _0x3e1273;}return db['FaxMessage'][_0x06fa('0x60')]({'direction':_0x06fa('0xb5'),'read':![],'body':_0xfea364[_0x06fa('0x61')][_0x06fa('0xaa')][0x0][_0x06fa('0xb6')],'FaxAccountId':_0x485163['id'],'FaxInteractionId':_0x3e1273['id'],'UserId':_0xfea364[_0x06fa('0x62')]['id'],'ContactId':_0x3e1273[_0x06fa('0xb9')],'AttachmentId':_0xfea364['body'][_0x06fa('0xaa')][0x0]['id']})[_0x06fa('0x23')](function(_0x1dfd77){_0x3e1273[_0x06fa('0xba')]['Messages']=[];_0x3e1273[_0x06fa('0xba')][_0x06fa('0xbb')][_0x06fa('0x8b')](_0x1dfd77[_0x06fa('0xba')]);return _0x3e1273;});})[_0x06fa('0x23')](function(_0x1d7cc2){respondWithRpcPromise(_0x06fa('0xbc'),_0x06fa('0xbc'),{'FaxAccountId':_[_0x06fa('0xaf')](_0xfea364[_0x06fa('0x69')]['id'])?undefined:_0xfea364[_0x06fa('0x69')]['id'],'path':_[_0x06fa('0xaf')](_0xfea364[_0x06fa('0x61')]['attachments'][0x0]['path'])?undefined:_0xfea364[_0x06fa('0x61')][_0x06fa('0xaa')][0x0][_0x06fa('0x7')],'fax':_['isNil'](_0xfea364[_0x06fa('0x61')]['to'][0x0])?undefined:_0xfea364[_0x06fa('0x61')]['to'][0x0],'AttachmentId':_0xfea364['body'][_0x06fa('0xaa')][0x0]['id']},client9002)[_0x06fa('0x23')](function(_0xed52e3){logger['info']('SendFaxRpc,\x20%s',_0xed52e3);})['catch'](function(_0x1fe238){logger[_0x06fa('0xbd')](_0x06fa('0xbe'),_0x1fe238);});return _0x1d7cc2;})[_0x06fa('0x23')](respondWithResult(_0x43c9f1,null))[_0x06fa('0x2d')](handleError(_0x43c9f1,null));};exports['addAgents']=function(_0x996888,_0x359fd3,_0x370eb9){return db[_0x06fa('0x44')][_0x06fa('0x5f')]({'where':{'id':_0x996888[_0x06fa('0x69')]['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0x359fd3,null))[_0x06fa('0x23')](function(_0x4c3af7){if(_0x4c3af7){return _0x4c3af7[_0x06fa('0xbf')](_0x996888['body'][_0x06fa('0x72')],_['omit'](_0x996888[_0x06fa('0x61')],[_0x06fa('0x72'),'id'])||{})[_0x06fa('0xb8')](function(_0x596ef9){for(var _0x50f647=0x0;_0x50f647<_0x996888['body']['ids'][_0x06fa('0x4e')];_0x50f647+=0x1){socket[_0x06fa('0xc0')]('userFaxAccount:save',{'UserId':Number(_0x996888[_0x06fa('0x61')][_0x06fa('0x72')][_0x50f647]),'FaxAccountId':Number(_0x996888[_0x06fa('0x69')]['id'])});}return _0x596ef9;});}})[_0x06fa('0x23')](respondWithResult(_0x359fd3,null))[_0x06fa('0x2d')](handleError(_0x359fd3,null));};exports[_0x06fa('0xc1')]=function(_0xbcfd04,_0x18fee6,_0x481ea7){return db[_0x06fa('0x44')][_0x06fa('0x5f')]({'where':{'id':_0xbcfd04['params']['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0x18fee6,null))['then'](function(_0x55ee64){if(_0x55ee64){return _0x55ee64[_0x06fa('0xc1')](_0xbcfd04['query'][_0x06fa('0x72')])[_0x06fa('0x23')](function(){if(_[_0x06fa('0xc2')](_0xbcfd04[_0x06fa('0x49')][_0x06fa('0x72')])){for(var _0x281bef=0x0;_0x281bef<_0xbcfd04[_0x06fa('0x49')][_0x06fa('0x72')][_0x06fa('0x4e')];_0x281bef+=0x1){socket[_0x06fa('0xc0')](_0x06fa('0xc3'),{'UserId':Number(_0xbcfd04['query'][_0x06fa('0x72')][_0x281bef]),'FaxAccountId':Number(_0xbcfd04[_0x06fa('0x69')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0xbcfd04[_0x06fa('0x49')][_0x06fa('0x72')]),'FaxAccountId':Number(_0xbcfd04[_0x06fa('0x69')]['id'])});}});}})[_0x06fa('0x23')](respondWithStatusCode(_0x18fee6,null))['catch'](handleError(_0x18fee6,null));};exports['getAgents']=function(_0x5f063c,_0x879155,_0x367e1e){var _0x7daaa0={};var _0x4b6f49={};var _0x4613f6;var _0x2d17b8;return db[_0x06fa('0x44')][_0x06fa('0x70')]({'where':{'id':_0x5f063c[_0x06fa('0x69')]['id']}})[_0x06fa('0x23')](handleEntityNotFound(_0x879155,null))['then'](function(_0x6424b5){if(_0x6424b5){_0x4613f6=_0x6424b5;_0x4b6f49[_0x06fa('0x48')]=_[_0x06fa('0x5c')](db[_0x06fa('0xc4')][_0x06fa('0x45')]);_0x4b6f49['query']=_[_0x06fa('0x5c')](_0x5f063c[_0x06fa('0x49')]);_0x4b6f49[_0x06fa('0x4a')]=_[_0x06fa('0x4b')](_0x4b6f49[_0x06fa('0x48')],_0x4b6f49[_0x06fa('0x49')]);_0x7daaa0[_0x06fa('0x4d')]=_[_0x06fa('0x4b')](_0x4b6f49['model'],qs[_0x06fa('0x4c')](_0x5f063c[_0x06fa('0x49')][_0x06fa('0x4c')]));_0x7daaa0[_0x06fa('0x4d')]=_0x7daaa0['attributes'][_0x06fa('0x4e')]?_0x7daaa0['attributes']:_0x4b6f49[_0x06fa('0x48')];_0x7daaa0[_0x06fa('0x51')]=qs[_0x06fa('0x52')](_0x5f063c[_0x06fa('0x49')]['sort']);_0x7daaa0['where']=qs[_0x06fa('0x4a')](_['pick'](_0x5f063c[_0x06fa('0x49')],_0x4b6f49[_0x06fa('0x4a')]));if(_0x5f063c[_0x06fa('0x49')][_0x06fa('0x55')]){_0x7daaa0[_0x06fa('0x53')]=_[_0x06fa('0x56')](_0x7daaa0[_0x06fa('0x53')],{'$or':_['map'](_0x7daaa0[_0x06fa('0x4d')],function(_0x424d81){var _0x54ac51={};_0x54ac51[_0x424d81]={'$like':'%'+_0x5f063c[_0x06fa('0x49')][_0x06fa('0x55')]+'%'};return _0x54ac51;})});}_0x7daaa0=_[_0x06fa('0x56')]({},_0x7daaa0,_0x5f063c[_0x06fa('0x57')]);return _0x4613f6[_0x06fa('0xc5')](_0x7daaa0);}})['then'](function(_0x58dc62){if(_0x58dc62){_0x2d17b8=_0x58dc62[_0x06fa('0x4e')];if(!_0x5f063c[_0x06fa('0x49')][_0x06fa('0x4f')](_0x06fa('0x50'))){_0x7daaa0['limit']=qs['limit'](_0x5f063c[_0x06fa('0x49')]['limit']);_0x7daaa0[_0x06fa('0x32')]=qs[_0x06fa('0x32')](_0x5f063c[_0x06fa('0x49')][_0x06fa('0x32')]);}return _0x4613f6[_0x06fa('0xc5')](_0x7daaa0);}})[_0x06fa('0x23')](function(_0x81a0db){if(_0x81a0db){return _0x81a0db?{'count':_0x2d17b8,'rows':_0x81a0db}:null;}})['then'](respondWithResult(_0x879155,null))[_0x06fa('0x2d')](handleError(_0x879155,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 181c378..c0fa564 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 _0x0924=['hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit'];(function(_0x5efd93,_0x1db199){var _0x38c616=function(_0x44d4cb){while(--_0x44d4cb){_0x5efd93['push'](_0x5efd93['shift']());}};_0x38c616(++_0x1db199);}(_0x0924,0x77));var _0x4092=function(_0xd8a16a,_0x146ac1){_0xd8a16a=_0xd8a16a-0x0;var _0x4e5768=_0x0924[_0xd8a16a];return _0x4e5768;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x4092('0x0'))['db'][_0x4092('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4092('0x2')](0x0);var events={'afterCreate':_0x4092('0x3'),'afterUpdate':_0x4092('0x4'),'afterDestroy':_0x4092('0x5')};function emitEvent(_0x23fd4e){return function(_0x5a79a0,_0x27b99e,_0x33861f){FaxAccountEvents['emit'](_0x23fd4e+':'+_0x5a79a0['id'],_0x5a79a0);FaxAccountEvents[_0x4092('0x6')](_0x23fd4e,_0x5a79a0);_0x33861f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x4092('0x7')](e,emitEvent(event));}}module[_0x4092('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xf9e2=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','FaxAccount'];(function(_0x21c9f2,_0x5613c7){var _0x5703a8=function(_0xc054de){while(--_0xc054de){_0x21c9f2['push'](_0x21c9f2['shift']());}};_0x5703a8(++_0x5613c7);}(_0xf9e2,0x126));var _0x2f9e=function(_0x2bef98,_0x4acae8){_0x2bef98=_0x2bef98-0x0;var _0x4a0a16=_0xf9e2[_0x2bef98];return _0x4a0a16;};'use strict';var EventEmitter=require(_0x2f9e('0x0'));var FaxAccount=require(_0x2f9e('0x1'))['db'][_0x2f9e('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2f9e('0x3')](0x0);var events={'afterCreate':_0x2f9e('0x4'),'afterUpdate':_0x2f9e('0x5'),'afterDestroy':_0x2f9e('0x6')};function emitEvent(_0xe52fc3){return function(_0x5320d8,_0x3c7776,_0x559810){FaxAccountEvents[_0x2f9e('0x7')](_0xe52fc3+':'+_0x5320d8['id'],_0x5320d8);FaxAccountEvents[_0x2f9e('0x7')](_0xe52fc3,_0x5320d8);_0x559810(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x2f9e('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index b3d951c..763fe86 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 _0x247f=['request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','moment','bluebird'];(function(_0x1f6895,_0x3193e7){var _0x27d864=function(_0x53c34a){while(--_0x53c34a){_0x1f6895['push'](_0x1f6895['shift']());}};_0x27d864(++_0x3193e7);}(_0x247f,0x7e));var _0xf247=function(_0xbec1f4,_0x2d840d){_0xbec1f4=_0xbec1f4-0x0;var _0x48303c=_0x247f[_0xbec1f4];return _0x48303c;};'use strict';var _=require(_0xf247('0x0'));var util=require('util');var logger=require(_0xf247('0x1'))('api');var moment=require(_0xf247('0x2'));var BPromise=require(_0xf247('0x3'));var rp=require(_0xf247('0x4'));var fs=require('fs');var path=require(_0xf247('0x5'));var rimraf=require(_0xf247('0x6'));var config=require(_0xf247('0x7'));var attributes=require(_0xf247('0x8'));module[_0xf247('0x9')]=function(_0x329fc5,_0x12cca9){return _0x329fc5[_0xf247('0xa')](_0xf247('0xb'),attributes,{'tableName':_0xf247('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabf8=['path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4745fb,_0x436c58){var _0x5d43c9=function(_0x3e5bd4){while(--_0x3e5bd4){_0x4745fb['push'](_0x4745fb['shift']());}};_0x5d43c9(++_0x436c58);}(_0xabf8,0xca));var _0x8abf=function(_0x268633,_0x553749){_0x268633=_0x268633-0x0;var _0x19336d=_0xabf8[_0x268633];return _0x19336d;};'use strict';var _=require(_0x8abf('0x0'));var util=require('util');var logger=require(_0x8abf('0x1'))(_0x8abf('0x2'));var moment=require(_0x8abf('0x3'));var BPromise=require(_0x8abf('0x4'));var rp=require(_0x8abf('0x5'));var fs=require('fs');var path=require(_0x8abf('0x6'));var rimraf=require(_0x8abf('0x7'));var config=require('../../config/environment');var attributes=require(_0x8abf('0x8'));module[_0x8abf('0x9')]=function(_0x1d7639,_0x6ece2a){return _0x1d7639[_0x8abf('0xa')](_0x8abf('0xb'),attributes,{'tableName':_0x8abf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 473a2bb..579dbed 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 _0x0cdf=['name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','GetFaxAccount','body','fax','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','keys','updatedAt','CompanyId','ListId','from','Sequelize','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','Applications','get','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0cdf,0x16e));var _0xf0cd=function(_0x145241,_0x56bf84){_0x145241=_0x145241-0x0;var _0x43d7d5=_0x0cdf[_0x145241];return _0x43d7d5;};'use strict';var _=require(_0xf0cd('0x0'));var util=require(_0xf0cd('0x1'));var moment=require(_0xf0cd('0x2'));var BPromise=require(_0xf0cd('0x3'));var rs=require(_0xf0cd('0x4'));var fs=require('fs');var Redis=require(_0xf0cd('0x5'));var db=require(_0xf0cd('0x6'))['db'];var utils=require(_0xf0cd('0x7'));var logger=require('../../config/logger')(_0xf0cd('0x8'));var config=require('../../config/environment');var jayson=require(_0xf0cd('0x9'));var client=jayson[_0xf0cd('0xa')][_0xf0cd('0xb')]({'port':0x232c});config[_0xf0cd('0xc')]=_['defaults'](config[_0xf0cd('0xc')],{'host':_0xf0cd('0xd'),'port':0x18eb});var socket=require(_0xf0cd('0xe'))(new Redis(config[_0xf0cd('0xc')]));require(_0xf0cd('0xf'))[_0xf0cd('0x10')](socket);function respondWithRpcPromise(_0x502a71,_0x4e72c8,_0x3a18d8){return new BPromise(function(_0x58ed18,_0x555244){return client[_0xf0cd('0x11')](_0x502a71,_0x3a18d8)[_0xf0cd('0x12')](function(_0xec0f07){logger[_0xf0cd('0x13')](_0xf0cd('0x14'),_0x4e72c8,_0xf0cd('0x15'));logger[_0xf0cd('0x16')](_0xf0cd('0x17'),_0x4e72c8,_0xf0cd('0x15'),JSON[_0xf0cd('0x18')](_0xec0f07));if(_0xec0f07[_0xf0cd('0x19')]){if(_0xec0f07['error'][_0xf0cd('0x1a')]===0x1f4){logger[_0xf0cd('0x19')](_0xf0cd('0x14'),_0x4e72c8,_0xec0f07[_0xf0cd('0x19')][_0xf0cd('0x1b')]);return _0x555244(_0xec0f07['error'][_0xf0cd('0x1b')]);}logger[_0xf0cd('0x19')](_0xf0cd('0x14'),_0x4e72c8,_0xec0f07[_0xf0cd('0x19')][_0xf0cd('0x1b')]);return _0x58ed18(_0xec0f07[_0xf0cd('0x19')]['message']);}else{logger[_0xf0cd('0x13')]('FaxAccount,\x20%s,\x20%s',_0x4e72c8,_0xf0cd('0x15'));_0x58ed18(_0xec0f07[_0xf0cd('0x1c')][_0xf0cd('0x1b')]);}})[_0xf0cd('0x1d')](function(_0x2ab660){logger[_0xf0cd('0x19')](_0xf0cd('0x14'),_0x4e72c8,_0x2ab660);_0x555244(_0x2ab660);});});}exports['GetFaxAccount']=function(_0xbf5f77){var _0x2871dd=this;return new Promise(function(_0x8008a1,_0x1d6eb0){return db[_0xf0cd('0x1e')][_0xf0cd('0x1f')]({'raw':_0xbf5f77[_0xf0cd('0x20')]?_0xbf5f77['options'][_0xf0cd('0x21')]===undefined?!![]:![]:!![],'where':_0xbf5f77[_0xf0cd('0x20')]?_0xbf5f77[_0xf0cd('0x20')]['where']||null:null,'attributes':_0xbf5f77['options']?_0xbf5f77[_0xf0cd('0x20')][_0xf0cd('0x22')]||null:null,'limit':_0xbf5f77[_0xf0cd('0x20')]?_0xbf5f77[_0xf0cd('0x20')][_0xf0cd('0x23')]||null:null,'include':_0xbf5f77[_0xf0cd('0x20')]?_0xbf5f77[_0xf0cd('0x20')][_0xf0cd('0x24')]?_[_0xf0cd('0x25')](_0xbf5f77[_0xf0cd('0x20')][_0xf0cd('0x24')],function(_0x1528a1){return{'model':db[_0x1528a1[_0xf0cd('0x26')]],'as':_0x1528a1['as'],'attributes':_0x1528a1[_0xf0cd('0x22')],'include':_0x1528a1['include']?_['map'](_0x1528a1[_0xf0cd('0x24')],function(_0x5c8abd){return{'model':db[_0x5c8abd[_0xf0cd('0x26')]],'as':_0x5c8abd['as'],'attributes':_0x5c8abd[_0xf0cd('0x22')],'include':_0x5c8abd[_0xf0cd('0x24')]?_['map'](_0x5c8abd[_0xf0cd('0x24')],function(_0x4331ae){return{'model':db[_0x4331ae['model']],'as':_0x4331ae['as'],'attributes':_0x4331ae[_0xf0cd('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf0cd('0x12')](function(_0x264830){logger[_0xf0cd('0x13')]('GetFaxAccount',_0xbf5f77);logger[_0xf0cd('0x16')]('GetFaxAccount',_0xbf5f77,JSON['stringify'](_0x264830));_0x8008a1(_0x264830);})['catch'](function(_0x2ffdcc){logger[_0xf0cd('0x19')](_0xf0cd('0x27'),_0x2ffdcc['message'],_0xbf5f77);_0x1d6eb0(_0x2871dd[_0xf0cd('0x19')](0x1f4,_0x2ffdcc[_0xf0cd('0x1b')]));});});};exports['NotifyFaxAccount']=function(_0x388bd6,_0x3ce6f2,_0x30d8e8){var _0x55bfe5=this;return new Promise(function(_0x7cba47,_0x4514df){var _0x1bfa4e={'body':_0x388bd6[_0xf0cd('0x28')],'channel':_0xf0cd('0x29')};var _0x28143f=[];var _0x635e78=[];var _0x2bd780={};return db[_0xf0cd('0x2a')]['describe']()[_0xf0cd('0x12')](function(_0x3ebb09){if(!_0x3ebb09){throw new db['Sequelize'][(_0xf0cd('0x2b'))](_0xf0cd('0x2c'));}_0x28143f=_[_0xf0cd('0x2d')](_['keys'](_0x3ebb09),[_0xf0cd('0x2e'),'updatedAt']);_0x635e78=_['difference'](_[_0xf0cd('0x2f')](_0x3ebb09),['createdAt',_0xf0cd('0x30'),_0xf0cd('0x31'),_0xf0cd('0x32')]);if(_0x388bd6['body']['id']){delete _0x388bd6['body']['id'];}if(_['isNil'](_0x388bd6[_0xf0cd('0x28')][_0xf0cd('0x33')])){throw new db[(_0xf0cd('0x34'))][(_0xf0cd('0x2b'))]('from\x20is\x20mandatory');}if(_[_0xf0cd('0x35')](_0x388bd6[_0xf0cd('0x28')][_0xf0cd('0x28')])||_0x388bd6['body'][_0xf0cd('0x28')]===''){throw new db['Sequelize'][(_0xf0cd('0x2b'))](_0xf0cd('0x36'));}if(_[_0xf0cd('0x35')](_0x388bd6[_0xf0cd('0x28')][_0xf0cd('0x37')])){throw new db[(_0xf0cd('0x34'))][(_0xf0cd('0x2b'))](_0xf0cd('0x38')+_0x635e78);}if(!_[_0xf0cd('0x39')](_0x635e78,_0x388bd6[_0xf0cd('0x28')]['mapKey'])){throw new db[(_0xf0cd('0x34'))]['ValidationError'](_0xf0cd('0x3a')+_0x635e78);}_0x2bd780[_0x388bd6['body'][_0xf0cd('0x37')]]=_0x388bd6[_0xf0cd('0x28')][_0xf0cd('0x33')];})[_0xf0cd('0x12')](function(){return db[_0xf0cd('0x1e')][_0xf0cd('0x3b')]({'where':{'id':_0x388bd6[_0xf0cd('0x3c')]['id']},'include':[{'model':db['CmList'],'as':_0xf0cd('0x3d'),'include':[{'model':db[_0xf0cd('0x2a')],'as':_0xf0cd('0x3e'),'where':_0x2bd780,'limit':0x1,'order':[['updatedAt',_0xf0cd('0x3f')]]}]},{'model':db['FaxApplication'],'as':_0xf0cd('0x40')}]});})[_0xf0cd('0x12')](function(_0x665383){if(_0x665383&&_0x665383['List']){var _0x41266b=_0x665383[_0xf0cd('0x41')]({'plain':!![]});_0x1bfa4e[_0xf0cd('0x3c')]=_0x41266b;_0x1bfa4e[_0xf0cd('0x42')]=_0x41266b['Applications'];_0x1bfa4e['list']=_0x41266b['List'];_0x1bfa4e[_0xf0cd('0x42')]=_[_0xf0cd('0x43')](_0x1bfa4e[_0xf0cd('0x42')],[_0xf0cd('0x44')],[_0xf0cd('0x45')]);if(_0x1bfa4e[_0xf0cd('0x3c')]['Applications']){delete _0x1bfa4e['account'][_0xf0cd('0x40')];}if(_0x1bfa4e[_0xf0cd('0x3c')][_0xf0cd('0x3d')]&&_0x1bfa4e['account'][_0xf0cd('0x3d')][_0xf0cd('0x3e')][_0xf0cd('0x46')]){return _0x1bfa4e['account']['List'][_0xf0cd('0x3e')][0x0];}var _0x3dd18c=_['defaults'](_0x388bd6['body'],{'firstName':_0x388bd6[_0xf0cd('0x28')]['from'],'ListId':_0x41266b[_0xf0cd('0x32')]});_0x3dd18c[_0x388bd6['body'][_0xf0cd('0x37')]]=_0x388bd6[_0xf0cd('0x28')][_0xf0cd('0x33')];return db[_0xf0cd('0x2a')][_0xf0cd('0x47')](_0x3dd18c,{'fields':_0x28143f,'raw':!![]});}})[_0xf0cd('0x12')](function(_0x43f5c4){_0x1bfa4e[_0xf0cd('0x48')]=_0x43f5c4;if(_0x43f5c4){var _0x4a1a92={'ContactId':_0x43f5c4['id'],'FaxAccountId':_0x388bd6[_0xf0cd('0x3c')]['id'],'fax':_0x43f5c4[_0xf0cd('0x29')]};return db[_0xf0cd('0x49')]['find']({'where':{'ContactId':_0x43f5c4['id'],'closed':![],'FaxAccountId':_0x388bd6[_0xf0cd('0x3c')]['id']}})['then'](function(_0x511f8b){if(_0x511f8b){return[_0x511f8b,![]];}return db[_0xf0cd('0x49')][_0xf0cd('0x47')](_0x4a1a92)[_0xf0cd('0x12')](function(_0x160b71){return[_0x160b71,!![]];});});}else{throw new Error(_0xf0cd('0x4a'));}})['spread'](function(_0x25d95a,_0x3c99){var _0xfb59a5=_0x25d95a[_0xf0cd('0x41')]({'plain':!![]});if(_0x3c99){if(_0x1bfa4e['account'][_0xf0cd('0x4b')]){_0x1bfa4e[_0xf0cd('0x42')]['push']({'id':0x0,'priority':_0x1bfa4e[_0xf0cd('0x42')][_0xf0cd('0x46')]+0x1,'app':'close','appdata':_0xf0cd('0x4c'),'interval':_0xf0cd('0x4d')});}_0xfb59a5[_0xf0cd('0x4e')]=!![];}else{_0xfb59a5[_0xf0cd('0x4e')]=![];}_0x1bfa4e[_0xf0cd('0x4f')]=_0xfb59a5;return db[_0xf0cd('0x50')][_0xf0cd('0x47')]({'body':_0x388bd6[_0xf0cd('0x28')][_0xf0cd('0x28')],'FaxAccountId':_0x388bd6['account']['id'],'FaxInteractionId':_0x25d95a['id'],'direction':'in','ContactId':_0x25d95a[_0xf0cd('0x51')],'AttachmentId':_0x388bd6[_0xf0cd('0x28')][_0xf0cd('0x52')]});})[_0xf0cd('0x12')](function(_0x4d2bb9){_0x1bfa4e['message']=_0x4d2bb9;if(_0x1bfa4e[_0xf0cd('0x4f')][_0xf0cd('0x53')]){return db['User'][_0xf0cd('0x3b')]({'attributes':['id',_0xf0cd('0x54')],'where':{'id':_0x1bfa4e['interaction'][_0xf0cd('0x53')]}})[_0xf0cd('0x12')](function(_0x387e9c){if(_0x387e9c){_0x1bfa4e['applications'][_0xf0cd('0x55')]({'id':0x0,'priority':0x0,'app':_0xf0cd('0x56'),'appdata':_0x387e9c['name']+','+(_0x1bfa4e[_0xf0cd('0x3c')][_0xf0cd('0x57')]||0xa),'interval':_0xf0cd('0x4d')});}return respondWithRpcPromise(_0xf0cd('0x58'),_0xf0cd('0x59'),_0x1bfa4e);});}return respondWithRpcPromise('Start',_0xf0cd('0x59'),_0x1bfa4e);})['then'](function(_0x8f574e){_0x7cba47(_0x8f574e);})[_0xf0cd('0x1d')](function(_0x31acf1){_0x4514df(_0x55bfe5['error'](0x1f4,_0x31acf1['message']));});});}; \ No newline at end of file +var _0x86a3=['UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','NotifyFaxAccount','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId'];(function(_0x3a68f3,_0x20d6f9){var _0x2428ec=function(_0x4ef6d1){while(--_0x4ef6d1){_0x3a68f3['push'](_0x3a68f3['shift']());}};_0x2428ec(++_0x20d6f9);}(_0x86a3,0x68));var _0x386a=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0x86a3[_0xa3c06b];return _0x33aa1d;};'use strict';var _=require(_0x386a('0x0'));var util=require(_0x386a('0x1'));var moment=require(_0x386a('0x2'));var BPromise=require('bluebird');var rs=require(_0x386a('0x3'));var fs=require('fs');var Redis=require(_0x386a('0x4'));var db=require(_0x386a('0x5'))['db'];var utils=require(_0x386a('0x6'));var logger=require('../../config/logger')(_0x386a('0x7'));var config=require(_0x386a('0x8'));var jayson=require(_0x386a('0x9'));var client=jayson[_0x386a('0xa')][_0x386a('0xb')]({'port':0x232c});config[_0x386a('0xc')]=_['defaults'](config[_0x386a('0xc')],{'host':_0x386a('0xd'),'port':0x18eb});var socket=require(_0x386a('0xe'))(new Redis(config[_0x386a('0xc')]));require('./faxAccount.socket')[_0x386a('0xf')](socket);function respondWithRpcPromise(_0x58cd89,_0x449ce4,_0x408849){return new BPromise(function(_0x2adbd6,_0x5c591c){return client['request'](_0x58cd89,_0x408849)[_0x386a('0x10')](function(_0x72b774){logger['info'](_0x386a('0x11'),_0x449ce4,_0x386a('0x12'));logger['debug'](_0x386a('0x13'),_0x449ce4,'request\x20sent',JSON[_0x386a('0x14')](_0x72b774));if(_0x72b774[_0x386a('0x15')]){if(_0x72b774[_0x386a('0x15')][_0x386a('0x16')]===0x1f4){logger[_0x386a('0x15')](_0x386a('0x11'),_0x449ce4,_0x72b774['error'][_0x386a('0x17')]);return _0x5c591c(_0x72b774['error'][_0x386a('0x17')]);}logger[_0x386a('0x15')](_0x386a('0x11'),_0x449ce4,_0x72b774['error']['message']);return _0x2adbd6(_0x72b774[_0x386a('0x15')][_0x386a('0x17')]);}else{logger[_0x386a('0x18')](_0x386a('0x11'),_0x449ce4,_0x386a('0x12'));_0x2adbd6(_0x72b774[_0x386a('0x19')][_0x386a('0x17')]);}})[_0x386a('0x1a')](function(_0x5e7820){logger['error'](_0x386a('0x11'),_0x449ce4,_0x5e7820);_0x5c591c(_0x5e7820);});});}exports[_0x386a('0x1b')]=function(_0x4df53a){var _0x76276d=this;return new Promise(function(_0xa74471,_0x5da814){return db[_0x386a('0x1c')][_0x386a('0x1d')]({'raw':_0x4df53a[_0x386a('0x1e')]?_0x4df53a[_0x386a('0x1e')][_0x386a('0x1f')]===undefined?!![]:![]:!![],'where':_0x4df53a['options']?_0x4df53a[_0x386a('0x1e')][_0x386a('0x20')]||null:null,'attributes':_0x4df53a['options']?_0x4df53a[_0x386a('0x1e')][_0x386a('0x21')]||null:null,'limit':_0x4df53a[_0x386a('0x1e')]?_0x4df53a['options'][_0x386a('0x22')]||null:null,'include':_0x4df53a[_0x386a('0x1e')]?_0x4df53a[_0x386a('0x1e')][_0x386a('0x23')]?_[_0x386a('0x24')](_0x4df53a['options'][_0x386a('0x23')],function(_0x32a5fa){return{'model':db[_0x32a5fa['model']],'as':_0x32a5fa['as'],'attributes':_0x32a5fa[_0x386a('0x21')],'include':_0x32a5fa['include']?_[_0x386a('0x24')](_0x32a5fa[_0x386a('0x23')],function(_0x292937){return{'model':db[_0x292937[_0x386a('0x25')]],'as':_0x292937['as'],'attributes':_0x292937[_0x386a('0x21')],'include':_0x292937[_0x386a('0x23')]?_[_0x386a('0x24')](_0x292937['include'],function(_0x4fa6da){return{'model':db[_0x4fa6da['model']],'as':_0x4fa6da['as'],'attributes':_0x4fa6da['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x13144d){logger[_0x386a('0x18')](_0x386a('0x1b'),_0x4df53a);logger[_0x386a('0x26')](_0x386a('0x1b'),_0x4df53a,JSON[_0x386a('0x14')](_0x13144d));_0xa74471(_0x13144d);})['catch'](function(_0xda9db6){logger[_0x386a('0x15')](_0x386a('0x1b'),_0xda9db6[_0x386a('0x17')],_0x4df53a);_0x5da814(_0x76276d[_0x386a('0x15')](0x1f4,_0xda9db6[_0x386a('0x17')]));});});};exports[_0x386a('0x27')]=function(_0x2b9f68,_0x234333,_0x25e162){var _0x22d506=this;return new Promise(function(_0x2a08e5,_0x1a139f){var _0x2cce02={'body':_0x2b9f68['body'],'channel':_0x386a('0x28')};var _0x2417bc=[];var _0x32d9e4=[];var _0x1ff8b5={};return db['CmContact'][_0x386a('0x29')]()[_0x386a('0x10')](function(_0x105958){if(!_0x105958){throw new db[(_0x386a('0x2a'))][(_0x386a('0x2b'))](_0x386a('0x2c'));}_0x2417bc=_[_0x386a('0x2d')](_[_0x386a('0x2e')](_0x105958),[_0x386a('0x2f'),'updatedAt']);_0x32d9e4=_['difference'](_[_0x386a('0x2e')](_0x105958),[_0x386a('0x2f'),_0x386a('0x30'),_0x386a('0x31'),_0x386a('0x32')]);if(_0x2b9f68[_0x386a('0x33')]['id']){delete _0x2b9f68['body']['id'];}if(_['isNil'](_0x2b9f68['body']['from'])){throw new db['Sequelize'][(_0x386a('0x2b'))](_0x386a('0x34'));}if(_[_0x386a('0x35')](_0x2b9f68[_0x386a('0x33')][_0x386a('0x33')])||_0x2b9f68['body'][_0x386a('0x33')]===''){throw new db[(_0x386a('0x2a'))]['ValidationError'](_0x386a('0x36'));}if(_['isNil'](_0x2b9f68[_0x386a('0x33')][_0x386a('0x37')])){throw new db[(_0x386a('0x2a'))][(_0x386a('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x32d9e4);}if(!_[_0x386a('0x38')](_0x32d9e4,_0x2b9f68[_0x386a('0x33')]['mapKey'])){throw new db[(_0x386a('0x2a'))][(_0x386a('0x2b'))](_0x386a('0x39')+_0x32d9e4);}_0x1ff8b5[_0x2b9f68['body'][_0x386a('0x37')]]=_0x2b9f68[_0x386a('0x33')][_0x386a('0x3a')];})[_0x386a('0x10')](function(){return db[_0x386a('0x1c')][_0x386a('0x3b')]({'where':{'id':_0x2b9f68[_0x386a('0x3c')]['id']},'include':[{'model':db[_0x386a('0x3d')],'as':_0x386a('0x3e'),'include':[{'model':db[_0x386a('0x3f')],'as':_0x386a('0x40'),'where':_0x1ff8b5,'limit':0x1,'order':[[_0x386a('0x30'),_0x386a('0x41')]]}]},{'model':db[_0x386a('0x42')],'as':_0x386a('0x43')}]});})[_0x386a('0x10')](function(_0x8d6073){if(_0x8d6073&&_0x8d6073[_0x386a('0x3e')]){var _0x3b5131=_0x8d6073[_0x386a('0x44')]({'plain':!![]});_0x2cce02[_0x386a('0x3c')]=_0x3b5131;_0x2cce02[_0x386a('0x45')]=_0x3b5131['Applications'];_0x2cce02[_0x386a('0x46')]=_0x3b5131[_0x386a('0x3e')];_0x2cce02['applications']=_[_0x386a('0x47')](_0x2cce02[_0x386a('0x45')],[_0x386a('0x48')],[_0x386a('0x49')]);if(_0x2cce02['account'][_0x386a('0x43')]){delete _0x2cce02[_0x386a('0x3c')][_0x386a('0x43')];}if(_0x2cce02[_0x386a('0x3c')][_0x386a('0x3e')]&&_0x2cce02[_0x386a('0x3c')][_0x386a('0x3e')]['Contacts']['length']){return _0x2cce02['account'][_0x386a('0x3e')]['Contacts'][0x0];}var _0x4a6d18=_[_0x386a('0x4a')](_0x2b9f68[_0x386a('0x33')],{'firstName':_0x2b9f68['body'][_0x386a('0x3a')],'ListId':_0x3b5131[_0x386a('0x32')]});_0x4a6d18[_0x2b9f68[_0x386a('0x33')][_0x386a('0x37')]]=_0x2b9f68[_0x386a('0x33')][_0x386a('0x3a')];return db['CmContact'][_0x386a('0x4b')](_0x4a6d18,{'fields':_0x2417bc,'raw':!![]});}})[_0x386a('0x10')](function(_0x5b89db){_0x2cce02[_0x386a('0x4c')]=_0x5b89db;if(_0x5b89db){var _0x59869d={'ContactId':_0x5b89db['id'],'FaxAccountId':_0x2b9f68[_0x386a('0x3c')]['id'],'fax':_0x5b89db[_0x386a('0x28')]};return db[_0x386a('0x4d')][_0x386a('0x3b')]({'where':{'ContactId':_0x5b89db['id'],'closed':![],'FaxAccountId':_0x2b9f68[_0x386a('0x3c')]['id']}})[_0x386a('0x10')](function(_0x33a9a2){if(_0x33a9a2){return[_0x33a9a2,![]];}return db['FaxInteraction']['create'](_0x59869d)[_0x386a('0x10')](function(_0x327597){return[_0x327597,!![]];});});}else{throw new Error(_0x386a('0x4e'));}})[_0x386a('0x4f')](function(_0x242292,_0x53b462){var _0x5a0b2c=_0x242292[_0x386a('0x44')]({'plain':!![]});if(_0x53b462){if(_0x2cce02[_0x386a('0x3c')][_0x386a('0x50')]){_0x2cce02[_0x386a('0x45')]['push']({'id':0x0,'priority':_0x2cce02[_0x386a('0x45')][_0x386a('0x51')]+0x1,'app':_0x386a('0x52'),'appdata':_0x386a('0x53'),'interval':_0x386a('0x54')});}_0x5a0b2c[_0x386a('0x55')]=!![];}else{_0x5a0b2c['created']=![];}_0x2cce02[_0x386a('0x56')]=_0x5a0b2c;return db[_0x386a('0x57')][_0x386a('0x4b')]({'body':_0x2b9f68[_0x386a('0x33')][_0x386a('0x33')],'FaxAccountId':_0x2b9f68[_0x386a('0x3c')]['id'],'FaxInteractionId':_0x242292['id'],'direction':'in','ContactId':_0x242292[_0x386a('0x58')],'AttachmentId':_0x2b9f68[_0x386a('0x33')][_0x386a('0x59')]});})[_0x386a('0x10')](function(_0x506d1b){_0x2cce02[_0x386a('0x17')]=_0x506d1b;if(_0x2cce02[_0x386a('0x56')][_0x386a('0x5a')]){return db[_0x386a('0x5b')][_0x386a('0x3b')]({'attributes':['id',_0x386a('0x5c')],'where':{'id':_0x2cce02[_0x386a('0x56')][_0x386a('0x5a')]}})[_0x386a('0x10')](function(_0x7ec89e){if(_0x7ec89e){_0x2cce02['applications'][_0x386a('0x5d')]({'id':0x0,'priority':0x0,'app':_0x386a('0x5e'),'appdata':_0x7ec89e[_0x386a('0x5c')]+','+(_0x2cce02[_0x386a('0x3c')][_0x386a('0x5f')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x386a('0x60'),_0x2cce02);});}return respondWithRpcPromise('Start','startRouting',_0x2cce02);})[_0x386a('0x10')](function(_0x5a7e46){_0x2a08e5(_0x5a7e46);})[_0x386a('0x1a')](function(_0x4e3134){_0x1a139f(_0x22d506[_0x386a('0x15')](0x1f4,_0x4e3134[_0x386a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ecb6486..6641c6b 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 _0x8ebf=['./faxAccount.events','save','remove','removeListener','register','length','faxAccount:'];(function(_0xc30731,_0x2a9b0e){var _0xe2c700=function(_0x3d3a08){while(--_0x3d3a08){_0xc30731['push'](_0xc30731['shift']());}};_0xe2c700(++_0x2a9b0e);}(_0x8ebf,0xbd));var _0xf8eb=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x8ebf[_0x2d8d69];return _0x39ae22;};'use strict';var FaxAccountEvents=require(_0xf8eb('0x0'));var events=[_0xf8eb('0x1'),_0xf8eb('0x2'),'update'];function createListener(_0x5790a2,_0x1acb59){return function(_0x2bc47d){_0x1acb59['emit'](_0x5790a2,_0x2bc47d);};}function removeListener(_0x203074,_0x4fbc61){return function(){FaxAccountEvents[_0xf8eb('0x3')](_0x203074,_0x4fbc61);};}exports[_0xf8eb('0x4')]=function(_0x2d362c){for(var _0x3dd7ab=0x0,_0x22cf2b=events[_0xf8eb('0x5')];_0x3dd7ab<_0x22cf2b;_0x3dd7ab++){var _0x3835d2=events[_0x3dd7ab];var _0x5a8278=createListener(_0xf8eb('0x6')+_0x3835d2,_0x2d362c);FaxAccountEvents['on'](_0x3835d2,_0x5a8278);}}; \ No newline at end of file +var _0x78f2=['./faxAccount.events','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0xd43aed,_0x556f54){var _0x4aa694=function(_0x56817d){while(--_0x56817d){_0xd43aed['push'](_0xd43aed['shift']());}};_0x4aa694(++_0x556f54);}(_0x78f2,0x1d0));var _0x278f=function(_0x1e3870,_0x1e9df4){_0x1e3870=_0x1e3870-0x0;var _0x2d1f5a=_0x78f2[_0x1e3870];return _0x2d1f5a;};'use strict';var FaxAccountEvents=require(_0x278f('0x0'));var events=['save',_0x278f('0x1'),_0x278f('0x2')];function createListener(_0x5b0658,_0x22407b){return function(_0x19269e){_0x22407b[_0x278f('0x3')](_0x5b0658,_0x19269e);};}function removeListener(_0x27d6d2,_0x13bce9){return function(){FaxAccountEvents[_0x278f('0x4')](_0x27d6d2,_0x13bce9);};}exports[_0x278f('0x5')]=function(_0x1c6084){for(var _0xc2b408=0x0,_0xeedf2b=events[_0x278f('0x6')];_0xc2b408<_0xeedf2b;_0xc2b408++){var _0x221f15=events[_0xc2b408];var _0x37a8ce=createListener(_0x278f('0x7')+_0x221f15,_0x1c6084);FaxAccountEvents['on'](_0x221f15,_0x37a8ce);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 03bf5f2..33227e8 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(_0x1c97c1,_0x57771f){var _0x51393f=function(_0x602c11){while(--_0x602c11){_0x1c97c1['push'](_0x1c97c1['shift']());}};_0x51393f(++_0x57771f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x545a5e,_0x324f8e){var _0x2d7a7c=function(_0x4ff093){while(--_0x4ff093){_0x545a5e['push'](_0x545a5e['shift']());}};_0x2d7a7c(++_0x324f8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 7b831b4..d5b1f2c 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 _0x2ccf=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x2ccf,0x78));var _0xf2cc=function(_0x4ef83e,_0x844441){_0x4ef83e=_0x4ef83e-0x0;var _0x112e28=_0x2ccf[_0x4ef83e];return _0x112e28;};'use strict';var Sequelize=require(_0xf2cc('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf2cc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf2cc('0x2')],'allowNull':![],'defaultValue':_0xf2cc('0x3')},'appdata':{'type':Sequelize[_0xf2cc('0x4')]()},'description':{'type':Sequelize[_0xf2cc('0x2')]},'interval':{'type':Sequelize[_0xf2cc('0x2')],'defaultValue':_0xf2cc('0x5')}}; \ No newline at end of file +var _0x50ba=['TEXT','sequelize','exports','STRING','noop'];(function(_0x427386,_0x5f5229){var _0x418313=function(_0x201879){while(--_0x201879){_0x427386['push'](_0x427386['shift']());}};_0x418313(++_0x5f5229);}(_0x50ba,0xe2));var _0xa50b=function(_0x135e73,_0x53d25e){_0x135e73=_0x135e73-0x0;var _0x207d86=_0x50ba[_0x135e73];return _0x207d86;};'use strict';var Sequelize=require(_0xa50b('0x0'));module[_0xa50b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa50b('0x2')],'allowNull':![],'defaultValue':_0xa50b('0x3')},'appdata':{'type':Sequelize[_0xa50b('0x4')]()},'description':{'type':Sequelize[_0xa50b('0x2')]},'interval':{'type':Sequelize[_0xa50b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 3ef91aa..ceb2e0e 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 _0x0f2a=['count','Content-Range','apply','save','update','then','error','stack','name','send','index','FaxApplication','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','where','pick','filter','merge','include','findAll','rows','catch','show','params','fields','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x1a4df4,_0x37538b){var _0xad8c8f=function(_0x47a806){while(--_0x47a806){_0x1a4df4['push'](_0x1a4df4['shift']());}};_0xad8c8f(++_0x37538b);}(_0x0f2a,0x138));var _0xa0f2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0f2a[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xa0f2('0x0'));var rimraf=require(_0xa0f2('0x1'));var zipdir=require(_0xa0f2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa0f2('0x3'));var BPromise=require(_0xa0f2('0x4'));var Mustache=require(_0xa0f2('0x5'));var util=require(_0xa0f2('0x6'));var path=require('path');var sox=require(_0xa0f2('0x7'));var csv=require('to-csv');var ejs=require(_0xa0f2('0x8'));var fs=require('fs');var fs_extra=require(_0xa0f2('0x9'));var _=require('lodash');var squel=require(_0xa0f2('0xa'));var crypto=require(_0xa0f2('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa0f2('0xc'));var Papa=require(_0xa0f2('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa0f2('0xe'));var as=require(_0xa0f2('0xf'));var hardwareService=require(_0xa0f2('0x10'));var logger=require(_0xa0f2('0x11'))('api');var utils=require(_0xa0f2('0x12'));var config=require(_0xa0f2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0f2('0x14'))['db'];function respondWithStatusCode(_0x1813f7,_0x49c69d){_0x49c69d=_0x49c69d||0xcc;return function(_0x2f205b){if(_0x2f205b){return _0x1813f7[_0xa0f2('0x15')](_0x49c69d);}return _0x1813f7['status'](_0x49c69d)[_0xa0f2('0x16')]();};}function respondWithResult(_0x25b34,_0x13bca6){_0x13bca6=_0x13bca6||0xc8;return function(_0x4bab52){if(_0x4bab52){return _0x25b34[_0xa0f2('0x17')](_0x13bca6)[_0xa0f2('0x18')](_0x4bab52);}};}function respondWithFilteredResult(_0x42a4c1,_0x52143c){return function(_0x17a521){if(_0x17a521){var _0xed7a40=typeof _0x52143c[_0xa0f2('0x19')]===_0xa0f2('0x1a')&&typeof _0x52143c[_0xa0f2('0x1b')]===_0xa0f2('0x1a');var _0x5939d6=_0x17a521['count'];var _0x518329=_0xed7a40?0x0:_0x52143c['offset'];var _0x5a3f02=_0xed7a40?_0x17a521[_0xa0f2('0x1c')]:_0x52143c[_0xa0f2('0x19')]+_0x52143c[_0xa0f2('0x1b')];var _0x12d550;if(_0x5a3f02>=_0x5939d6){_0x5a3f02=_0x5939d6;_0x12d550=0xc8;}else{_0x12d550=0xce;}_0x42a4c1[_0xa0f2('0x17')](_0x12d550);return _0x42a4c1['set'](_0xa0f2('0x1d'),_0x518329+'-'+_0x5a3f02+'/'+_0x5939d6)['json'](_0x17a521);}return null;};}function patchUpdates(_0x42a42f){return function(_0x3489f2){try{jsonpatch[_0xa0f2('0x1e')](_0x3489f2,_0x42a42f,!![]);}catch(_0x10df8d){return BPromise['reject'](_0x10df8d);}return _0x3489f2[_0xa0f2('0x1f')]();};}function saveUpdates(_0xaa1a46,_0x4a0747){return function(_0x4f31e6){if(_0x4f31e6){return _0x4f31e6[_0xa0f2('0x20')](_0xaa1a46)[_0xa0f2('0x21')](function(_0xdd60a4){return _0xdd60a4;});}return null;};}function removeEntity(_0x51245a,_0x95ebbd){return function(_0x270d69){if(_0x270d69){return _0x270d69['destroy']()[_0xa0f2('0x21')](function(){_0x51245a[_0xa0f2('0x17')](0xcc)[_0xa0f2('0x16')]();});}};}function handleEntityNotFound(_0x160d67,_0x19b95b){return function(_0x54686a){if(!_0x54686a){_0x160d67[_0xa0f2('0x15')](0x194);}return _0x54686a;};}function handleError(_0x59abae,_0x4ea1e3){_0x4ea1e3=_0x4ea1e3||0x1f4;return function(_0x12e27d){logger[_0xa0f2('0x22')](_0x12e27d[_0xa0f2('0x23')]);if(_0x12e27d[_0xa0f2('0x24')]){delete _0x12e27d[_0xa0f2('0x24')];}_0x59abae[_0xa0f2('0x17')](_0x4ea1e3)[_0xa0f2('0x25')](_0x12e27d);};}exports[_0xa0f2('0x26')]=function(_0x543304,_0x4b55a6){var _0x455155={},_0x47f4f3={},_0x429f01={'count':0x0,'rows':[]};var _0x31b386=_['map'](db[_0xa0f2('0x27')][_0xa0f2('0x28')],function(_0x3cc491){return{'name':_0x3cc491['fieldName'],'type':_0x3cc491[_0xa0f2('0x29')][_0xa0f2('0x2a')]};});_0x47f4f3[_0xa0f2('0x2b')]=_[_0xa0f2('0x2c')](_0x31b386,'name');_0x47f4f3[_0xa0f2('0x2d')]=_[_0xa0f2('0x2e')](_0x543304[_0xa0f2('0x2d')]);_0x47f4f3[_0xa0f2('0x2f')]=_['intersection'](_0x47f4f3[_0xa0f2('0x2b')],_0x47f4f3[_0xa0f2('0x2d')]);_0x455155['attributes']=_[_0xa0f2('0x30')](_0x47f4f3[_0xa0f2('0x2b')],qs['fields'](_0x543304[_0xa0f2('0x2d')]['fields']));_0x455155[_0xa0f2('0x31')]=_0x455155[_0xa0f2('0x31')][_0xa0f2('0x32')]?_0x455155[_0xa0f2('0x31')]:_0x47f4f3[_0xa0f2('0x2b')];if(!_0x543304[_0xa0f2('0x2d')]['hasOwnProperty'](_0xa0f2('0x33'))){_0x455155[_0xa0f2('0x1b')]=qs['limit'](_0x543304[_0xa0f2('0x2d')][_0xa0f2('0x1b')]);_0x455155[_0xa0f2('0x19')]=qs[_0xa0f2('0x19')](_0x543304[_0xa0f2('0x2d')][_0xa0f2('0x19')]);}_0x455155['order']=qs['sort'](_0x543304[_0xa0f2('0x2d')]['sort']);_0x455155[_0xa0f2('0x34')]=qs[_0xa0f2('0x2f')](_[_0xa0f2('0x35')](_0x543304['query'],_0x47f4f3['filters']),_0x31b386);if(_0x543304['query'][_0xa0f2('0x36')]){_0x455155['where']=_[_0xa0f2('0x37')](_0x455155[_0xa0f2('0x34')],{'$or':_['map'](_0x31b386,function(_0x40ae35){if(_0x40ae35[_0xa0f2('0x29')]!=='VIRTUAL'){var _0x179cac={};_0x179cac[_0x40ae35[_0xa0f2('0x24')]]={'$like':'%'+_0x543304['query'][_0xa0f2('0x36')]+'%'};return _0x179cac;}})});}_0x455155=_['merge']({},_0x455155,_0x543304['options']);var _0x18aca2={'where':_0x455155['where']};return db[_0xa0f2('0x27')]['count'](_0x18aca2)[_0xa0f2('0x21')](function(_0x2b4073){_0x429f01[_0xa0f2('0x1c')]=_0x2b4073;if(_0x543304[_0xa0f2('0x2d')]['includeAll']){_0x455155[_0xa0f2('0x38')]=[{'all':!![]}];}return db[_0xa0f2('0x27')][_0xa0f2('0x39')](_0x455155);})['then'](function(_0x37e7aa){_0x429f01[_0xa0f2('0x3a')]=_0x37e7aa;return _0x429f01;})[_0xa0f2('0x21')](respondWithFilteredResult(_0x4b55a6,_0x455155))[_0xa0f2('0x3b')](handleError(_0x4b55a6,null));};exports[_0xa0f2('0x3c')]=function(_0x3a2136,_0x2d3263){var _0x104483={'raw':!![],'where':{'id':_0x3a2136[_0xa0f2('0x3d')]['id']}},_0x259240={};_0x259240[_0xa0f2('0x2b')]=_[_0xa0f2('0x2e')](db[_0xa0f2('0x27')][_0xa0f2('0x28')]);_0x259240[_0xa0f2('0x2d')]=_[_0xa0f2('0x2e')](_0x3a2136[_0xa0f2('0x2d')]);_0x259240[_0xa0f2('0x2f')]=_[_0xa0f2('0x30')](_0x259240['model'],_0x259240[_0xa0f2('0x2d')]);_0x104483[_0xa0f2('0x31')]=_[_0xa0f2('0x30')](_0x259240[_0xa0f2('0x2b')],qs[_0xa0f2('0x3e')](_0x3a2136[_0xa0f2('0x2d')]['fields']));_0x104483[_0xa0f2('0x31')]=_0x104483[_0xa0f2('0x31')]['length']?_0x104483[_0xa0f2('0x31')]:_0x259240['model'];if(_0x3a2136['query'][_0xa0f2('0x3f')]){_0x104483[_0xa0f2('0x38')]=[{'all':!![]}];}_0x104483=_['merge']({},_0x104483,_0x3a2136[_0xa0f2('0x40')]);return db[_0xa0f2('0x27')][_0xa0f2('0x41')](_0x104483)[_0xa0f2('0x21')](handleEntityNotFound(_0x2d3263,null))[_0xa0f2('0x21')](respondWithResult(_0x2d3263,null))['catch'](handleError(_0x2d3263,null));};exports[_0xa0f2('0x42')]=function(_0x27fca4,_0x2640d5){return db[_0xa0f2('0x27')][_0xa0f2('0x42')](_0x27fca4[_0xa0f2('0x43')],{})[_0xa0f2('0x21')](respondWithResult(_0x2640d5,0xc9))[_0xa0f2('0x3b')](handleError(_0x2640d5,null));};exports[_0xa0f2('0x20')]=function(_0x4e81b0,_0x42528a){if(_0x4e81b0['body']['id']){delete _0x4e81b0[_0xa0f2('0x43')]['id'];}return db[_0xa0f2('0x27')][_0xa0f2('0x41')]({'where':{'id':_0x4e81b0[_0xa0f2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x42528a,null))['then'](saveUpdates(_0x4e81b0['body'],null))[_0xa0f2('0x21')](respondWithResult(_0x42528a,null))[_0xa0f2('0x3b')](handleError(_0x42528a,null));};exports['destroy']=function(_0x1674c5,_0x1a42e6){return db['FaxApplication'][_0xa0f2('0x41')]({'where':{'id':_0x1674c5[_0xa0f2('0x3d')]['id']}})[_0xa0f2('0x21')](handleEntityNotFound(_0x1a42e6,null))[_0xa0f2('0x21')](removeEntity(_0x1a42e6,null))['catch'](handleError(_0x1a42e6,null));}; \ No newline at end of file +var _0xe03e=['apply','reject','save','update','then','destroy','end','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','length','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set'];(function(_0x49a897,_0x3c9c79){var _0x2f93ce=function(_0x378c82){while(--_0x378c82){_0x49a897['push'](_0x49a897['shift']());}};_0x2f93ce(++_0x3c9c79);}(_0xe03e,0x163));var _0xee03=function(_0x4d5e64,_0x116ba2){_0x4d5e64=_0x4d5e64-0x0;var _0x5811e0=_0xe03e[_0x4d5e64];return _0x5811e0;};'use strict';var emlformat=require(_0xee03('0x0'));var rimraf=require(_0xee03('0x1'));var zipdir=require(_0xee03('0x2'));var jsonpatch=require(_0xee03('0x3'));var rp=require(_0xee03('0x4'));var moment=require(_0xee03('0x5'));var BPromise=require(_0xee03('0x6'));var Mustache=require(_0xee03('0x7'));var util=require(_0xee03('0x8'));var path=require(_0xee03('0x9'));var sox=require(_0xee03('0xa'));var csv=require(_0xee03('0xb'));var ejs=require(_0xee03('0xc'));var fs=require('fs');var fs_extra=require(_0xee03('0xd'));var _=require(_0xee03('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xee03('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xee03('0xb'));var querystring=require(_0xee03('0x10'));var Papa=require(_0xee03('0x11'));var Redis=require(_0xee03('0x12'));var authService=require(_0xee03('0x13'));var qs=require(_0xee03('0x14'));var as=require(_0xee03('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee03('0x16'))('api');var utils=require(_0xee03('0x17'));var config=require(_0xee03('0x18'));var licenseUtil=require(_0xee03('0x19'));var db=require(_0xee03('0x1a'))['db'];function respondWithStatusCode(_0x552242,_0x598aa5){_0x598aa5=_0x598aa5||0xcc;return function(_0x4d77cc){if(_0x4d77cc){return _0x552242[_0xee03('0x1b')](_0x598aa5);}return _0x552242[_0xee03('0x1c')](_0x598aa5)['end']();};}function respondWithResult(_0x45a412,_0x30402a){_0x30402a=_0x30402a||0xc8;return function(_0x23ed8c){if(_0x23ed8c){return _0x45a412[_0xee03('0x1c')](_0x30402a)[_0xee03('0x1d')](_0x23ed8c);}};}function respondWithFilteredResult(_0x42020c,_0x27dac2){return function(_0x4a8821){if(_0x4a8821){var _0x534bc3=typeof _0x27dac2[_0xee03('0x1e')]===_0xee03('0x1f')&&typeof _0x27dac2['limit']===_0xee03('0x1f');var _0xdb276f=_0x4a8821[_0xee03('0x20')];var _0x1a739e=_0x534bc3?0x0:_0x27dac2['offset'];var _0xb76b91=_0x534bc3?_0x4a8821[_0xee03('0x20')]:_0x27dac2[_0xee03('0x1e')]+_0x27dac2[_0xee03('0x21')];var _0x28be65;if(_0xb76b91>=_0xdb276f){_0xb76b91=_0xdb276f;_0x28be65=0xc8;}else{_0x28be65=0xce;}_0x42020c[_0xee03('0x1c')](_0x28be65);return _0x42020c[_0xee03('0x22')]('Content-Range',_0x1a739e+'-'+_0xb76b91+'/'+_0xdb276f)[_0xee03('0x1d')](_0x4a8821);}return null;};}function patchUpdates(_0x1b3dc4){return function(_0x4a8ea0){try{jsonpatch[_0xee03('0x23')](_0x4a8ea0,_0x1b3dc4,!![]);}catch(_0x5d6ab9){return BPromise[_0xee03('0x24')](_0x5d6ab9);}return _0x4a8ea0[_0xee03('0x25')]();};}function saveUpdates(_0x399b94,_0x14b0ae){return function(_0x3439cc){if(_0x3439cc){return _0x3439cc[_0xee03('0x26')](_0x399b94)[_0xee03('0x27')](function(_0x90eb1e){return _0x90eb1e;});}return null;};}function removeEntity(_0x43ff3d,_0x3682ed){return function(_0x409c6b){if(_0x409c6b){return _0x409c6b[_0xee03('0x28')]()['then'](function(){_0x43ff3d[_0xee03('0x1c')](0xcc)[_0xee03('0x29')]();});}};}function handleEntityNotFound(_0x4f6ede,_0x5ec350){return function(_0x2c37af){if(!_0x2c37af){_0x4f6ede[_0xee03('0x1b')](0x194);}return _0x2c37af;};}function handleError(_0x4084ae,_0x3a92e0){_0x3a92e0=_0x3a92e0||0x1f4;return function(_0x30eb32){logger[_0xee03('0x2a')](_0x30eb32['stack']);if(_0x30eb32[_0xee03('0x2b')]){delete _0x30eb32['name'];}_0x4084ae['status'](_0x3a92e0)[_0xee03('0x2c')](_0x30eb32);};}exports[_0xee03('0x2d')]=function(_0x5232dd,_0x5ad58f){var _0x3ba844={},_0x1b432c={},_0x4892a0={'count':0x0,'rows':[]};var _0x584320=_[_0xee03('0x2e')](db[_0xee03('0x2f')][_0xee03('0x30')],function(_0x31c73c){return{'name':_0x31c73c[_0xee03('0x31')],'type':_0x31c73c[_0xee03('0x32')][_0xee03('0x33')]};});_0x1b432c[_0xee03('0x34')]=_[_0xee03('0x2e')](_0x584320,_0xee03('0x2b'));_0x1b432c[_0xee03('0x35')]=_[_0xee03('0x36')](_0x5232dd[_0xee03('0x35')]);_0x1b432c['filters']=_['intersection'](_0x1b432c['model'],_0x1b432c[_0xee03('0x35')]);_0x3ba844['attributes']=_[_0xee03('0x37')](_0x1b432c[_0xee03('0x34')],qs['fields'](_0x5232dd['query'][_0xee03('0x38')]));_0x3ba844[_0xee03('0x39')]=_0x3ba844[_0xee03('0x39')]['length']?_0x3ba844['attributes']:_0x1b432c[_0xee03('0x34')];if(!_0x5232dd[_0xee03('0x35')][_0xee03('0x3a')](_0xee03('0x3b'))){_0x3ba844[_0xee03('0x21')]=qs[_0xee03('0x21')](_0x5232dd[_0xee03('0x35')][_0xee03('0x21')]);_0x3ba844['offset']=qs[_0xee03('0x1e')](_0x5232dd['query'][_0xee03('0x1e')]);}_0x3ba844[_0xee03('0x3c')]=qs[_0xee03('0x3d')](_0x5232dd['query'][_0xee03('0x3d')]);_0x3ba844[_0xee03('0x3e')]=qs[_0xee03('0x3f')](_[_0xee03('0x40')](_0x5232dd[_0xee03('0x35')],_0x1b432c[_0xee03('0x3f')]),_0x584320);if(_0x5232dd['query'][_0xee03('0x41')]){_0x3ba844[_0xee03('0x3e')]=_[_0xee03('0x42')](_0x3ba844[_0xee03('0x3e')],{'$or':_[_0xee03('0x2e')](_0x584320,function(_0x3f4e7f){if(_0x3f4e7f['type']!==_0xee03('0x43')){var _0x29d77c={};_0x29d77c[_0x3f4e7f[_0xee03('0x2b')]]={'$like':'%'+_0x5232dd[_0xee03('0x35')][_0xee03('0x41')]+'%'};return _0x29d77c;}})});}_0x3ba844=_[_0xee03('0x42')]({},_0x3ba844,_0x5232dd[_0xee03('0x44')]);var _0xf4db2c={'where':_0x3ba844[_0xee03('0x3e')]};return db['FaxApplication'][_0xee03('0x20')](_0xf4db2c)[_0xee03('0x27')](function(_0x38ef7a){_0x4892a0['count']=_0x38ef7a;if(_0x5232dd[_0xee03('0x35')][_0xee03('0x45')]){_0x3ba844[_0xee03('0x46')]=[{'all':!![]}];}return db[_0xee03('0x2f')][_0xee03('0x47')](_0x3ba844);})[_0xee03('0x27')](function(_0x14ff30){_0x4892a0['rows']=_0x14ff30;return _0x4892a0;})['then'](respondWithFilteredResult(_0x5ad58f,_0x3ba844))['catch'](handleError(_0x5ad58f,null));};exports['show']=function(_0x19ce88,_0x33e4a8){var _0x19e9a1={'raw':!![],'where':{'id':_0x19ce88[_0xee03('0x48')]['id']}},_0x3bbda6={};_0x3bbda6[_0xee03('0x34')]=_['keys'](db[_0xee03('0x2f')][_0xee03('0x30')]);_0x3bbda6[_0xee03('0x35')]=_[_0xee03('0x36')](_0x19ce88[_0xee03('0x35')]);_0x3bbda6[_0xee03('0x3f')]=_['intersection'](_0x3bbda6['model'],_0x3bbda6['query']);_0x19e9a1[_0xee03('0x39')]=_[_0xee03('0x37')](_0x3bbda6['model'],qs[_0xee03('0x38')](_0x19ce88[_0xee03('0x35')]['fields']));_0x19e9a1[_0xee03('0x39')]=_0x19e9a1['attributes'][_0xee03('0x49')]?_0x19e9a1[_0xee03('0x39')]:_0x3bbda6['model'];if(_0x19ce88[_0xee03('0x35')][_0xee03('0x45')]){_0x19e9a1['include']=[{'all':!![]}];}_0x19e9a1=_[_0xee03('0x42')]({},_0x19e9a1,_0x19ce88[_0xee03('0x44')]);return db[_0xee03('0x2f')][_0xee03('0x4a')](_0x19e9a1)[_0xee03('0x27')](handleEntityNotFound(_0x33e4a8,null))[_0xee03('0x27')](respondWithResult(_0x33e4a8,null))['catch'](handleError(_0x33e4a8,null));};exports['create']=function(_0x5e029b,_0x191e07){return db[_0xee03('0x2f')][_0xee03('0x4b')](_0x5e029b[_0xee03('0x4c')],{})[_0xee03('0x27')](respondWithResult(_0x191e07,0xc9))['catch'](handleError(_0x191e07,null));};exports[_0xee03('0x26')]=function(_0x351df4,_0x235790){if(_0x351df4['body']['id']){delete _0x351df4[_0xee03('0x4c')]['id'];}return db['FaxApplication'][_0xee03('0x4a')]({'where':{'id':_0x351df4[_0xee03('0x48')]['id']}})['then'](handleEntityNotFound(_0x235790,null))[_0xee03('0x27')](saveUpdates(_0x351df4[_0xee03('0x4c')],null))[_0xee03('0x27')](respondWithResult(_0x235790,null))[_0xee03('0x4d')](handleError(_0x235790,null));};exports[_0xee03('0x28')]=function(_0x5d33a9,_0x4945ea){return db[_0xee03('0x2f')][_0xee03('0x4a')]({'where':{'id':_0x5d33a9[_0xee03('0x48')]['id']}})[_0xee03('0x27')](handleEntityNotFound(_0x4945ea,null))['then'](removeEntity(_0x4945ea,null))['catch'](handleError(_0x4945ea,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 60fc6c4..3e25982 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 _0xc411=['fax_applications','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x57aa6a,_0x26a3ff){var _0x378d4a=function(_0x399f6c){while(--_0x399f6c){_0x57aa6a['push'](_0x57aa6a['shift']());}};_0x378d4a(++_0x26a3ff);}(_0xc411,0xa1));var _0x1c41=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc411[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require(_0x1c41('0x0'));var logger=require(_0x1c41('0x1'))(_0x1c41('0x2'));var moment=require(_0x1c41('0x3'));var BPromise=require(_0x1c41('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1c41('0x5'));var config=require(_0x1c41('0x6'));var attributes=require('./faxApplication.attributes');module[_0x1c41('0x7')]=function(_0x212ba9,_0x2bcd86){return _0x212ba9[_0x1c41('0x8')]('FaxApplication',attributes,{'tableName':_0x1c41('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x76fc=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x76fc,0x12c));var _0xc76f=function(_0xd7a3da,_0x4856e2){_0xd7a3da=_0xd7a3da-0x0;var _0x36cb7a=_0x76fc[_0xd7a3da];return _0x36cb7a;};'use strict';var _=require(_0xc76f('0x0'));var util=require(_0xc76f('0x1'));var logger=require('../../config/logger')(_0xc76f('0x2'));var moment=require(_0xc76f('0x3'));var BPromise=require(_0xc76f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc76f('0x5'));var rimraf=require(_0xc76f('0x6'));var config=require(_0xc76f('0x7'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x456cf8,_0x5bfcd6){return _0x456cf8[_0xc76f('0x8')](_0xc76f('0x9'),attributes,{'tableName':_0xc76f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc76f('0xb'),'collate':_0xc76f('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 4e8d742..a55ab3d 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 _0x9f84=['catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x27376a,_0x41fed4){var _0x137710=function(_0x2518c2){while(--_0x2518c2){_0x27376a['push'](_0x27376a['shift']());}};_0x137710(++_0x41fed4);}(_0x9f84,0x10a));var _0x49f8=function(_0x31ed82,_0x519b1b){_0x31ed82=_0x31ed82-0x0;var _0x43a4b1=_0x9f84[_0x31ed82];return _0x43a4b1;};'use strict';var _=require('lodash');var util=require(_0x49f8('0x0'));var moment=require(_0x49f8('0x1'));var BPromise=require(_0x49f8('0x2'));var rs=require(_0x49f8('0x3'));var fs=require('fs');var Redis=require(_0x49f8('0x4'));var db=require(_0x49f8('0x5'))['db'];var utils=require(_0x49f8('0x6'));var logger=require(_0x49f8('0x7'))(_0x49f8('0x8'));var config=require(_0x49f8('0x9'));var jayson=require(_0x49f8('0xa'));var client=jayson[_0x49f8('0xb')][_0x49f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a5be1,_0x3333ef,_0x557589){return new BPromise(function(_0x45a1ba,_0x162e7b){return client['request'](_0x3a5be1,_0x557589)[_0x49f8('0xd')](function(_0x2d75ae){logger[_0x49f8('0xe')](_0x49f8('0xf'),_0x3333ef,'request\x20sent');logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3333ef,_0x49f8('0x10'),JSON[_0x49f8('0x11')](_0x2d75ae));if(_0x2d75ae[_0x49f8('0x12')]){if(_0x2d75ae[_0x49f8('0x12')][_0x49f8('0x13')]===0x1f4){logger[_0x49f8('0x12')](_0x49f8('0xf'),_0x3333ef,_0x2d75ae[_0x49f8('0x12')][_0x49f8('0x14')]);return _0x162e7b(_0x2d75ae[_0x49f8('0x12')][_0x49f8('0x14')]);}logger[_0x49f8('0x12')](_0x49f8('0xf'),_0x3333ef,_0x2d75ae['error']['message']);return _0x45a1ba(_0x2d75ae[_0x49f8('0x12')][_0x49f8('0x14')]);}else{logger[_0x49f8('0xe')]('FaxApplication,\x20%s,\x20%s',_0x3333ef,_0x49f8('0x10'));_0x45a1ba(_0x2d75ae[_0x49f8('0x15')][_0x49f8('0x14')]);}})[_0x49f8('0x16')](function(_0x178636){logger[_0x49f8('0x12')](_0x49f8('0xf'),_0x3333ef,_0x178636);_0x162e7b(_0x178636);});});}exports[_0x49f8('0x17')]=function(_0x3be454){var _0x42eae0=this;return new Promise(function(_0x4b4bf7,_0x3974c9){return db[_0x49f8('0x18')][_0x49f8('0x19')](_0x3be454[_0x49f8('0x1a')],{'raw':_0x3be454['options']?_0x3be454[_0x49f8('0x1b')][_0x49f8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3be454[_0x49f8('0x1b')]?_0x3be454[_0x49f8('0x1b')]['where']||null:null,'attributes':_0x3be454[_0x49f8('0x1b')]?_0x3be454[_0x49f8('0x1b')][_0x49f8('0x1d')]||null:null,'limit':_0x3be454['options']?_0x3be454[_0x49f8('0x1b')][_0x49f8('0x1e')]||null:null})[_0x49f8('0xd')](function(_0x20f085){logger[_0x49f8('0xe')](_0x49f8('0x17'),_0x3be454);logger[_0x49f8('0x1f')](_0x49f8('0x17'),_0x3be454,JSON['stringify'](_0x20f085));_0x4b4bf7(_0x20f085);})[_0x49f8('0x16')](function(_0x3779f0){logger[_0x49f8('0x12')]('UpdateFaxApplication',_0x3779f0[_0x49f8('0x14')],_0x3be454);_0x3974c9(_0x42eae0[_0x49f8('0x12')](0x1f4,_0x3779f0[_0x49f8('0x14')]));});});}; \ No newline at end of file +var _0xd2cd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','stringify','lodash','util','moment','bluebird','ioredis'];(function(_0x3c8946,_0x135165){var _0x2cd2ff=function(_0x2494ff){while(--_0x2494ff){_0x3c8946['push'](_0x3c8946['shift']());}};_0x2cd2ff(++_0x135165);}(_0xd2cd,0x7b));var _0xdd2c=function(_0x3441e9,_0x269c8a){_0x3441e9=_0x3441e9-0x0;var _0x7f9ada=_0xd2cd[_0x3441e9];return _0x7f9ada;};'use strict';var _=require(_0xdd2c('0x0'));var util=require(_0xdd2c('0x1'));var moment=require(_0xdd2c('0x2'));var BPromise=require(_0xdd2c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd2c('0x4'));var db=require(_0xdd2c('0x5'))['db'];var utils=require(_0xdd2c('0x6'));var logger=require(_0xdd2c('0x7'))(_0xdd2c('0x8'));var config=require(_0xdd2c('0x9'));var jayson=require(_0xdd2c('0xa'));var client=jayson[_0xdd2c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x82c305,_0x2cbd24,_0x4759a3){return new BPromise(function(_0x1d9178,_0x1fda6f){return client['request'](_0x82c305,_0x4759a3)['then'](function(_0x5961d5){logger[_0xdd2c('0xc')](_0xdd2c('0xd'),_0x2cbd24,_0xdd2c('0xe'));logger[_0xdd2c('0xf')](_0xdd2c('0x10'),_0x2cbd24,_0xdd2c('0xe'),JSON['stringify'](_0x5961d5));if(_0x5961d5['error']){if(_0x5961d5[_0xdd2c('0x11')][_0xdd2c('0x12')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x2cbd24,_0x5961d5[_0xdd2c('0x11')][_0xdd2c('0x13')]);return _0x1fda6f(_0x5961d5['error'][_0xdd2c('0x13')]);}logger[_0xdd2c('0x11')](_0xdd2c('0xd'),_0x2cbd24,_0x5961d5[_0xdd2c('0x11')][_0xdd2c('0x13')]);return _0x1d9178(_0x5961d5[_0xdd2c('0x11')][_0xdd2c('0x13')]);}else{logger[_0xdd2c('0xc')]('FaxApplication,\x20%s,\x20%s',_0x2cbd24,_0xdd2c('0xe'));_0x1d9178(_0x5961d5[_0xdd2c('0x14')][_0xdd2c('0x13')]);}})[_0xdd2c('0x15')](function(_0x59b12b){logger[_0xdd2c('0x11')](_0xdd2c('0xd'),_0x2cbd24,_0x59b12b);_0x1fda6f(_0x59b12b);});});}exports[_0xdd2c('0x16')]=function(_0x204989){var _0x52ae28=this;return new Promise(function(_0x32114e,_0x518ccc){return db[_0xdd2c('0x17')][_0xdd2c('0x18')](_0x204989[_0xdd2c('0x19')],{'raw':_0x204989[_0xdd2c('0x1a')]?_0x204989[_0xdd2c('0x1a')][_0xdd2c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x204989[_0xdd2c('0x1a')]?_0x204989[_0xdd2c('0x1a')][_0xdd2c('0x1c')]||null:null,'attributes':_0x204989['options']?_0x204989[_0xdd2c('0x1a')][_0xdd2c('0x1d')]||null:null,'limit':_0x204989[_0xdd2c('0x1a')]?_0x204989[_0xdd2c('0x1a')][_0xdd2c('0x1e')]||null:null})['then'](function(_0x576ada){logger['info'](_0xdd2c('0x16'),_0x204989);logger[_0xdd2c('0xf')](_0xdd2c('0x16'),_0x204989,JSON[_0xdd2c('0x1f')](_0x576ada));_0x32114e(_0x576ada);})[_0xdd2c('0x15')](function(_0x27c532){logger[_0xdd2c('0x11')](_0xdd2c('0x16'),_0x27c532['message'],_0x204989);_0x518ccc(_0x52ae28[_0xdd2c('0x11')](0x1f4,_0x27c532[_0xdd2c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index a7938f1..245201e 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(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x955f,0x1eb));var _0xf955=function(_0x10ca40,_0xccb670){_0x10ca40=_0x10ca40-0x0;var _0x272173=_0x955f[_0x10ca40];return _0x272173;};'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 _0x0b0e=['./faxApplication.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5241ba,_0x41a1d4){var _0x26e7c5=function(_0x2b85ec){while(--_0x2b85ec){_0x5241ba['push'](_0x5241ba['shift']());}};_0x26e7c5(++_0x41a1d4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x29fa3d,_0x45d24f){_0x29fa3d=_0x29fa3d-0x0;var _0x5d4bbf=_0x0b0e[_0x29fa3d];return _0x5d4bbf;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 2759750..3625545 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 _0x6cb9=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x1d20e5,_0x3d4f74){var _0x14c8d3=function(_0x368a35){while(--_0x368a35){_0x1d20e5['push'](_0x1d20e5['shift']());}};_0x14c8d3(++_0x3d4f74);}(_0x6cb9,0xa2));var _0x96cb=function(_0x15e25d,_0x1d50c2){_0x15e25d=_0x15e25d-0x0;var _0x4e3c4f=_0x6cb9[_0x15e25d];return _0x4e3c4f;};'use strict';var Sequelize=require(_0x96cb('0x0'));module['exports']={'closed':{'type':Sequelize[_0x96cb('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x96cb('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x96cb('0x3')]},'thirdDisposition':{'type':Sequelize[_0x96cb('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x96cb('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x96cb('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x96cb('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x96cb('0x4')]('in',_0x96cb('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x34a1=['exports','STRING','DATE','ENUM','out','sequelize'];(function(_0x3a2f90,_0x27dd86){var _0x122e21=function(_0x339e95){while(--_0x339e95){_0x3a2f90['push'](_0x3a2f90['shift']());}};_0x122e21(++_0x27dd86);}(_0x34a1,0x191));var _0x134a=function(_0x1e1ad4,_0x598e90){_0x1e1ad4=_0x1e1ad4-0x0;var _0x1e25d9=_0x34a1[_0x1e1ad4];return _0x1e25d9;};'use strict';var Sequelize=require(_0x134a('0x0'));module[_0x134a('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x134a('0x2')]},'thirdDisposition':{'type':Sequelize[_0x134a('0x2')]},'note':{'type':Sequelize[_0x134a('0x2')]},'read1stAt':{'type':Sequelize[_0x134a('0x3')]},'fax':{'type':Sequelize[_0x134a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x134a('0x4')]('in',_0x134a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x134a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x134a('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 4c56e7e..f27a547 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 _0xe423=['nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','server','root','files','join','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','send','index','map','fieldName','type','getOptions','findAll','query','catch','show','model','keys','rawAttributes','attributes','intersection','fields','length','includeAll','merge','options','create','FaxInteraction','body','update','params','find','describe','addMessage','FaxMessage','ids','findOne','filters'];(function(_0x2d5ec1,_0x295e02){var _0x5d9541=function(_0x571686){while(--_0x571686){_0x2d5ec1['push'](_0x2d5ec1['shift']());}};_0x5d9541(++_0x295e02);}(_0xe423,0xf9));var _0x3e42=function(_0x579010,_0x182934){_0x579010=_0x579010-0x0;var _0x309ced=_0xe423[_0x579010];return _0x309ced;};'use strict';var rimraf=require(_0x3e42('0x0'));var zipdir=require(_0x3e42('0x1'));var moment=require(_0x3e42('0x2'));var BPromise=require(_0x3e42('0x3'));var util=require(_0x3e42('0x4'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x3e42('0x5'));var interaction=require(_0x3e42('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x3e42('0x7'))(_0x3e42('0x8'));var config=require('../../config/environment');var db=require(_0x3e42('0x9'))['db'];config['redis']=_[_0x3e42('0xa')](config['redis'],{'host':_0x3e42('0xb'),'port':0x18eb});var socket=require(_0x3e42('0xc'))(new Redis(config[_0x3e42('0xd')]));require(_0x3e42('0xe'))[_0x3e42('0xf')](socket);function respondWithStatusCode(_0x775e66,_0x464f0d){_0x464f0d=_0x464f0d||0xcc;return function(_0x390777){if(_0x390777){return _0x775e66[_0x3e42('0x10')](_0x464f0d);}return _0x775e66['status'](_0x464f0d)[_0x3e42('0x11')]();};}function respondWithResult(_0x14fc49,_0xac9b82){_0xac9b82=_0xac9b82||0xc8;return function(_0x19c2b9){if(_0x19c2b9){return _0x14fc49[_0x3e42('0x12')](_0xac9b82)[_0x3e42('0x13')](_0x19c2b9);}};}function respondWithFilteredResult(_0x282e73,_0x4ba16e){return function(_0x3bb891){if(_0x3bb891){var _0x161fdc=typeof _0x4ba16e[_0x3e42('0x14')]===_0x3e42('0x15')&&typeof _0x4ba16e[_0x3e42('0x16')]===_0x3e42('0x15');var _0x438a7a=_0x3bb891['count'];var _0x5da2e7=_0x161fdc?0x0:_0x4ba16e['offset'];var _0x5471aa=_0x161fdc?_0x3bb891[_0x3e42('0x17')]:_0x4ba16e['offset']+_0x4ba16e['limit'];var _0x4dd7b2;if(_0x5471aa>=_0x438a7a){_0x5471aa=_0x438a7a;_0x4dd7b2=0xc8;}else{_0x4dd7b2=0xce;}_0x282e73[_0x3e42('0x12')](_0x4dd7b2);return _0x282e73[_0x3e42('0x18')](_0x3e42('0x19'),_0x5da2e7+'-'+_0x5471aa+'/'+_0x438a7a)['json'](_0x3bb891);}return null;};}function saveUpdates(_0x38af53){return function(_0x349195){if(_0x349195){return _0x349195['update'](_0x38af53)[_0x3e42('0x1a')](function(_0x300796){return _0x300796;});}return null;};}function removeEntity(_0xbd7e5){return function(_0xeb0f17){if(_0xeb0f17){return _0xeb0f17[_0x3e42('0x1b')]()['then'](function(){_0xbd7e5[_0x3e42('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b69c0){return function(_0x564875){if(!_0x564875){_0x2b69c0[_0x3e42('0x10')](0x194);}return _0x564875;};}function handleError(_0x5a7ea5,_0x9c6055){_0x9c6055=_0x9c6055||0x1f4;return function(_0x519925){logger[_0x3e42('0x1c')](_0x519925[_0x3e42('0x1d')]);if(_0x519925['name']){delete _0x519925[_0x3e42('0x1e')];}_0x5a7ea5[_0x3e42('0x12')](_0x9c6055)[_0x3e42('0x1f')](_0x519925);};}exports[_0x3e42('0x20')]=function(_0x33e195,_0x1eaa6f){var _0x2e53f3={};var _0x14e787=_[_0x3e42('0x21')](db['FaxInteraction']['rawAttributes'],function(_0x20ed27){return{'name':_0x20ed27[_0x3e42('0x22')],'type':_0x20ed27[_0x3e42('0x23')]['key']};});_0x2e53f3=qs[_0x3e42('0x24')](_0x14e787,_0x33e195);return interaction[_0x3e42('0x25')]('fax',_0x33e195[_0x3e42('0x26')],_0x33e195['user'],_0x2e53f3,_0x14e787)['then'](respondWithFilteredResult(_0x1eaa6f,_0x2e53f3))[_0x3e42('0x27')](handleError(_0x1eaa6f,null));};exports[_0x3e42('0x28')]=function(_0x47d878,_0x31fa3f){var _0x506dc3={'raw':![],'where':{'id':_0x47d878['params']['id']}},_0x221fd1={};_0x221fd1[_0x3e42('0x29')]=_[_0x3e42('0x2a')](db['FaxInteraction'][_0x3e42('0x2b')]);_0x221fd1[_0x3e42('0x26')]=_[_0x3e42('0x2a')](_0x47d878[_0x3e42('0x26')]);_0x221fd1['filters']=_['intersection'](_0x221fd1[_0x3e42('0x29')],_0x221fd1[_0x3e42('0x26')]);_0x506dc3[_0x3e42('0x2c')]=_[_0x3e42('0x2d')](_0x221fd1[_0x3e42('0x29')],qs[_0x3e42('0x2e')](_0x47d878['query'][_0x3e42('0x2e')]));_0x506dc3['attributes']=_0x506dc3[_0x3e42('0x2c')][_0x3e42('0x2f')]?_0x506dc3['attributes']:_0x221fd1[_0x3e42('0x29')];if(_0x47d878[_0x3e42('0x26')][_0x3e42('0x30')]){_0x506dc3['include']=[{'all':!![]}];}_0x506dc3=_[_0x3e42('0x31')]({},_0x506dc3,_0x47d878[_0x3e42('0x32')]);return db['FaxInteraction']['find'](_0x506dc3)['then'](handleEntityNotFound(_0x31fa3f,null))[_0x3e42('0x1a')](respondWithResult(_0x31fa3f,null))[_0x3e42('0x27')](handleError(_0x31fa3f,null));};exports[_0x3e42('0x33')]=function(_0x71a16e,_0x40194f){return db[_0x3e42('0x34')][_0x3e42('0x33')](_0x71a16e[_0x3e42('0x35')],{})[_0x3e42('0x1a')](respondWithResult(_0x40194f,0xc9))[_0x3e42('0x27')](handleError(_0x40194f,null));};exports[_0x3e42('0x36')]=function(_0x49c54a,_0x9d9d3a){if(_0x49c54a[_0x3e42('0x35')]['id']){delete _0x49c54a[_0x3e42('0x35')]['id'];}return db[_0x3e42('0x34')]['find']({'where':{'id':_0x49c54a[_0x3e42('0x37')]['id']}})[_0x3e42('0x1a')](handleEntityNotFound(_0x9d9d3a,null))[_0x3e42('0x1a')](saveUpdates(_0x49c54a[_0x3e42('0x35')],null))[_0x3e42('0x1a')](respondWithResult(_0x9d9d3a,null))['catch'](handleError(_0x9d9d3a,null));};exports[_0x3e42('0x1b')]=function(_0xd197dd,_0x39c7fe){return db['FaxInteraction'][_0x3e42('0x38')]({'where':{'id':_0xd197dd['params']['id']}})[_0x3e42('0x1a')](handleEntityNotFound(_0x39c7fe,null))[_0x3e42('0x1a')](removeEntity(_0x39c7fe,null))[_0x3e42('0x27')](handleError(_0x39c7fe,null));};exports[_0x3e42('0x39')]=function(_0x5d3839,_0x2c7579){return db[_0x3e42('0x34')][_0x3e42('0x39')]()[_0x3e42('0x1a')](respondWithResult(_0x2c7579,null))[_0x3e42('0x27')](handleError(_0x2c7579,null));};exports[_0x3e42('0x3a')]=function(_0x20d1c6,_0x4aca4f){return db[_0x3e42('0x3b')][_0x3e42('0x38')]({'where':{'id':_0x20d1c6['params']['id']}})[_0x3e42('0x1a')](handleEntityNotFound(_0x4aca4f,null))[_0x3e42('0x1a')](function(_0x478ded){if(_0x478ded){return _0x478ded[_0x3e42('0x3a')](_0x20d1c6[_0x3e42('0x35')][_0x3e42('0x3c')],_['omit'](_0x20d1c6[_0x3e42('0x35')],[_0x3e42('0x3c'),'id'])||{});}})[_0x3e42('0x1a')](respondWithResult(_0x4aca4f,null))['catch'](handleError(_0x4aca4f,null));};exports['getMessages']=function(_0x5610c3,_0x2f0ed3){var _0x2eca3f={'raw':![],'where':{}};var _0x14ef5e={};var _0x4aa5da={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x3e42('0x3d')]({'where':{'id':_0x5610c3[_0x3e42('0x37')]['id']}})[_0x3e42('0x1a')](handleEntityNotFound(_0x2f0ed3,null))[_0x3e42('0x1a')](function(_0x424c5a){if(_0x424c5a){_0x14ef5e['model']=_[_0x3e42('0x2a')](db['FaxMessage'][_0x3e42('0x2b')]);_0x14ef5e[_0x3e42('0x26')]=_[_0x3e42('0x2a')](_0x5610c3['query']);_0x14ef5e[_0x3e42('0x3e')]=_[_0x3e42('0x2d')](_0x14ef5e[_0x3e42('0x29')],_0x14ef5e[_0x3e42('0x26')]);_0x2eca3f[_0x3e42('0x2c')]=_['intersection'](_0x14ef5e['model'],qs[_0x3e42('0x2e')](_0x5610c3[_0x3e42('0x26')][_0x3e42('0x2e')]));_0x2eca3f[_0x3e42('0x2c')]=_0x2eca3f[_0x3e42('0x2c')]['length']?_0x2eca3f[_0x3e42('0x2c')]:_0x14ef5e['model'];if(!_0x5610c3[_0x3e42('0x26')]['hasOwnProperty'](_0x3e42('0x3f'))){_0x2eca3f[_0x3e42('0x16')]=qs['limit'](_0x5610c3[_0x3e42('0x26')][_0x3e42('0x16')]);_0x2eca3f['offset']=qs[_0x3e42('0x14')](_0x5610c3[_0x3e42('0x26')][_0x3e42('0x14')]);}_0x2eca3f[_0x3e42('0x40')]=qs[_0x3e42('0x41')](_0x5610c3[_0x3e42('0x26')][_0x3e42('0x41')]);_0x2eca3f[_0x3e42('0x42')]=qs[_0x3e42('0x3e')](_[_0x3e42('0x43')](_0x5610c3[_0x3e42('0x26')],_0x14ef5e[_0x3e42('0x3e')]));_0x2eca3f[_0x3e42('0x42')][_0x3e42('0x44')]=_0x424c5a['id'];if(_0x5610c3[_0x3e42('0x26')][_0x3e42('0x45')]){_0x2eca3f[_0x3e42('0x42')]=_[_0x3e42('0x31')](_0x2eca3f['where'],{'$or':_[_0x3e42('0x21')](_0x2eca3f['attributes'],function(_0x465ab6){var _0x45adb8={};_0x45adb8[_0x465ab6]={'$like':'%'+_0x5610c3[_0x3e42('0x26')][_0x3e42('0x45')]+'%'};return _0x45adb8;})});}if(_0x5610c3[_0x3e42('0x26')]['$gte']){var _0x53da25=_0x5610c3[_0x3e42('0x26')][_0x3e42('0x46')][_0x3e42('0x47')](',');var _0x5f3c16={};_0x5f3c16[_0x53da25[0x0]]={'$gte':moment(_0x53da25[0x1])['format'](_0x3e42('0x48'))};_0x2eca3f['where']=_[_0x3e42('0x31')](_0x2eca3f[_0x3e42('0x42')],_0x5f3c16);}_0x2eca3f=_[_0x3e42('0x31')]({},_0x2eca3f,_0x5610c3['options']);return db[_0x3e42('0x3b')][_0x3e42('0x17')]({'where':_0x2eca3f['where']})[_0x3e42('0x1a')](function(_0x4036b8){_0x4aa5da[_0x3e42('0x17')]=_0x4036b8;if(_0x5610c3[_0x3e42('0x26')][_0x3e42('0x30')]){_0x2eca3f[_0x3e42('0x49')]=[{'all':!![]}];}return db['FaxMessage'][_0x3e42('0x25')](_0x2eca3f);})[_0x3e42('0x1a')](function(_0x5a159d){_0x4aa5da[_0x3e42('0x4a')]=_0x5a159d;return _0x4aa5da;});}})[_0x3e42('0x1a')](respondWithFilteredResult(_0x2f0ed3,_0x2eca3f))[_0x3e42('0x27')](handleError(_0x2f0ed3,null));};exports[_0x3e42('0x4b')]=function(_0x2ebbb3,_0x59e663){return db[_0x3e42('0x34')][_0x3e42('0x38')]({'where':{'id':_0x2ebbb3['params']['id']}})[_0x3e42('0x1a')](handleEntityNotFound(_0x59e663,null))[_0x3e42('0x1a')](function(_0x392f06){if(_0x392f06){return _0x392f06['setTags'](_0x2ebbb3[_0x3e42('0x35')]['ids'],_['omit'](_0x2ebbb3[_0x3e42('0x35')],[_0x3e42('0x3c'),'id'])||{})['spread'](function(){return db['Tag'][_0x3e42('0x25')]({'attributes':['id',_0x3e42('0x1e'),_0x3e42('0x4c')],'where':{'id':_0x2ebbb3[_0x3e42('0x35')][_0x3e42('0x3c')]}});})[_0x3e42('0x1a')](function(_0x3d9daa){socket[_0x3e42('0x4d')](_0x3e42('0x4e'),{'id':Number(_0x2ebbb3[_0x3e42('0x37')]['id']),'tags':_0x3d9daa||[]});return{'id':Number(_0x2ebbb3[_0x3e42('0x37')]['id']),'tags':_0x3d9daa||[]};});}})[_0x3e42('0x1a')](respondWithResult(_0x59e663,null))[_0x3e42('0x27')](handleError(_0x59e663,null));};exports[_0x3e42('0x4f')]=function(_0x2f77ce,_0x36b306){return db[_0x3e42('0x34')][_0x3e42('0x38')]({'where':{'id':_0x2f77ce['params']['id']}})[_0x3e42('0x1a')](handleEntityNotFound(_0x36b306,null))[_0x3e42('0x1a')](function(_0x5daed9){if(_0x5daed9){return _0x5daed9['removeTags'](_0x2f77ce[_0x3e42('0x26')][_0x3e42('0x3c')]);}})['then'](respondWithStatusCode(_0x36b306,null))[_0x3e42('0x27')](handleError(_0x36b306,null));};exports[_0x3e42('0x50')]=function(_0x84095d,_0x375711){var _0x149de4=moment()[_0x3e42('0x51')]()[_0x3e42('0x52')]();var _0x172dc6=path['join'](config['root'],_0x3e42('0x53'),'files','tmp');var _0xe48466=path['join'](config[_0x3e42('0x54')],_0x3e42('0x53'),_0x3e42('0x55'),'attachments');var _0x4f76ce=path[_0x3e42('0x56')](_0x172dc6,_0x149de4);var _0xe343ff=util[_0x3e42('0x57')](_0x3e42('0x58'),_0x84095d[_0x3e42('0x37')]['id'],_0x149de4);var _0x4d0a54=path[_0x3e42('0x56')](_0x172dc6,_0xe343ff);var _0x1aff5a=[];_0x1aff5a[_0x3e42('0x59')]({'model':db[_0x3e42('0x5a')],'as':_0x3e42('0x5a'),'raw':!![]});var _0x552d83=[{'model':db['FaxMessage'],'as':_0x3e42('0x5b'),'attributes':['id',_0x3e42('0x35'),_0x3e42('0x5c')],'include':_0x1aff5a}];return db['FaxInteraction']['find']({'where':{'id':_0x84095d['params']['id']},'include':_0x552d83})[_0x3e42('0x1a')](handleEntityNotFound(_0x375711,null))[_0x3e42('0x1a')](function(_0x2dedb7){if(_0x2dedb7&&_0x2dedb7['Messages']){var _0x5d6dcd=_0x2dedb7[_0x3e42('0x5d')]({'plain':!![]});fs[_0x3e42('0x5e')](_0x4f76ce);for(var _0x487b8c=0x0;_0x487b8c<_0x5d6dcd[_0x3e42('0x5b')][_0x3e42('0x2f')];_0x487b8c++){var _0x3a5e12=_0x5d6dcd[_0x3e42('0x5b')][_0x487b8c][_0x3e42('0x5a')];if(_0x3a5e12){var _0x251821=path[_0x3e42('0x56')](_0xe48466,_0x3a5e12[_0x3e42('0x5f')]);if(fs[_0x3e42('0x60')](_0x251821)){fs[_0x3e42('0x61')](_0x251821)[_0x3e42('0x62')](fs[_0x3e42('0x63')](path['join'](_0x4f76ce,_0x3a5e12[_0x3e42('0x5f')])));}}}return BPromise[_0x3e42('0x64')]()[_0x3e42('0x1a')](function(){return new BPromise(function(_0x4e8771,_0xefdfc5){zipdir(_0x4f76ce,{'saveTo':_0x4d0a54},function(_0x297d61,_0x3f4295){if(_0x297d61)return _0xefdfc5(_0x297d61);return _0x4e8771(_0x3f4295);});})[_0x3e42('0x1a')](function(){return new BPromise(function(_0x53c491,_0x150e3b){rimraf(_0x4f76ce,function(_0x1ced01){if(_0x1ced01)_0x150e3b(_0x1ced01);return _0x53c491();});});})['then'](function(){return _0x375711[_0x3e42('0x50')](_0x4d0a54,_0xe343ff,function(_0x54e514){if(_0x54e514){console[_0x3e42('0x65')](_0x3e42('0x66'),_0x54e514);}else{fs[_0x3e42('0x67')](_0x4d0a54);}});});});}else{return _0x375711['sendStatus'](0xc8);}})[_0x3e42('0x27')](handleError(_0x375711,null));}; \ No newline at end of file +var _0xf672=['where','pick','FaxInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','spread','emit','faxInteractionTags:save','removeTags','download','toString','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','sendStatus','rimraf','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','./faxInteraction.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','then','end','error','name','map','FaxInteraction','fieldName','type','key','getOptions','fax','query','user','catch','show','params','keys','rawAttributes','filters','model','attributes','fields','includeAll','include','options','find','create','body','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','intersection','length','hasOwnProperty','nolimit','order','sort'];(function(_0x32f2b5,_0x3e7573){var _0x4acddb=function(_0x2358bb){while(--_0x2358bb){_0x32f2b5['push'](_0x32f2b5['shift']());}};_0x4acddb(++_0x3e7573);}(_0xf672,0xf1));var _0x2f67=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xf672[_0x5f309e];return _0x487b5e;};'use strict';var rimraf=require(_0x2f67('0x0'));var zipdir=require(_0x2f67('0x1'));var moment=require(_0x2f67('0x2'));var BPromise=require('bluebird');var util=require(_0x2f67('0x3'));var path=require(_0x2f67('0x4'));var fs=require('fs');var _=require(_0x2f67('0x5'));var Redis=require('ioredis');var interaction=require(_0x2f67('0x6'));var qs=require(_0x2f67('0x7'));var logger=require(_0x2f67('0x8'))('api');var config=require(_0x2f67('0x9'));var db=require(_0x2f67('0xa'))['db'];config['redis']=_['defaults'](config[_0x2f67('0xb')],{'host':_0x2f67('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2f67('0xd'))[_0x2f67('0xe')](socket);function respondWithStatusCode(_0x3769f2,_0x2631c9){_0x2631c9=_0x2631c9||0xcc;return function(_0x558782){if(_0x558782){return _0x3769f2['sendStatus'](_0x2631c9);}return _0x3769f2[_0x2f67('0xf')](_0x2631c9)['end']();};}function respondWithResult(_0x30bbc8,_0xca4be7){_0xca4be7=_0xca4be7||0xc8;return function(_0x580907){if(_0x580907){return _0x30bbc8['status'](_0xca4be7)[_0x2f67('0x10')](_0x580907);}};}function respondWithFilteredResult(_0x12d090,_0x187590){return function(_0x130dbe){if(_0x130dbe){var _0x12313d=typeof _0x187590[_0x2f67('0x11')]==='undefined'&&typeof _0x187590[_0x2f67('0x12')]===_0x2f67('0x13');var _0x2cdc46=_0x130dbe[_0x2f67('0x14')];var _0x3af816=_0x12313d?0x0:_0x187590[_0x2f67('0x11')];var _0x2c84ec=_0x12313d?_0x130dbe['count']:_0x187590[_0x2f67('0x11')]+_0x187590[_0x2f67('0x12')];var _0xe85a94;if(_0x2c84ec>=_0x2cdc46){_0x2c84ec=_0x2cdc46;_0xe85a94=0xc8;}else{_0xe85a94=0xce;}_0x12d090[_0x2f67('0xf')](_0xe85a94);return _0x12d090[_0x2f67('0x15')](_0x2f67('0x16'),_0x3af816+'-'+_0x2c84ec+'/'+_0x2cdc46)[_0x2f67('0x10')](_0x130dbe);}return null;};}function saveUpdates(_0x549227){return function(_0x307e4d){if(_0x307e4d){return _0x307e4d[_0x2f67('0x17')](_0x549227)[_0x2f67('0x18')](function(_0x22e02e){return _0x22e02e;});}return null;};}function removeEntity(_0x30c0f6){return function(_0x4b6b2b){if(_0x4b6b2b){return _0x4b6b2b['destroy']()['then'](function(){_0x30c0f6[_0x2f67('0xf')](0xcc)[_0x2f67('0x19')]();});}};}function handleEntityNotFound(_0x16955b){return function(_0x523eae){if(!_0x523eae){_0x16955b['sendStatus'](0x194);}return _0x523eae;};}function handleError(_0x371f7d,_0x436d51){_0x436d51=_0x436d51||0x1f4;return function(_0x4fc8b9){logger[_0x2f67('0x1a')](_0x4fc8b9['stack']);if(_0x4fc8b9[_0x2f67('0x1b')]){delete _0x4fc8b9[_0x2f67('0x1b')];}_0x371f7d[_0x2f67('0xf')](_0x436d51)['send'](_0x4fc8b9);};}exports['index']=function(_0x411e14,_0x1ffb2f){var _0x4708a5={};var _0x3d696b=_[_0x2f67('0x1c')](db[_0x2f67('0x1d')]['rawAttributes'],function(_0x5a2a64){return{'name':_0x5a2a64[_0x2f67('0x1e')],'type':_0x5a2a64[_0x2f67('0x1f')][_0x2f67('0x20')]};});_0x4708a5=qs[_0x2f67('0x21')](_0x3d696b,_0x411e14);return interaction['findAll'](_0x2f67('0x22'),_0x411e14[_0x2f67('0x23')],_0x411e14[_0x2f67('0x24')],_0x4708a5,_0x3d696b)[_0x2f67('0x18')](respondWithFilteredResult(_0x1ffb2f,_0x4708a5))[_0x2f67('0x25')](handleError(_0x1ffb2f,null));};exports[_0x2f67('0x26')]=function(_0x105553,_0x3929dc){var _0xd3f1d7={'raw':![],'where':{'id':_0x105553[_0x2f67('0x27')]['id']}},_0x520fca={};_0x520fca['model']=_[_0x2f67('0x28')](db[_0x2f67('0x1d')][_0x2f67('0x29')]);_0x520fca[_0x2f67('0x23')]=_['keys'](_0x105553[_0x2f67('0x23')]);_0x520fca[_0x2f67('0x2a')]=_['intersection'](_0x520fca[_0x2f67('0x2b')],_0x520fca[_0x2f67('0x23')]);_0xd3f1d7[_0x2f67('0x2c')]=_['intersection'](_0x520fca[_0x2f67('0x2b')],qs[_0x2f67('0x2d')](_0x105553[_0x2f67('0x23')][_0x2f67('0x2d')]));_0xd3f1d7[_0x2f67('0x2c')]=_0xd3f1d7[_0x2f67('0x2c')]['length']?_0xd3f1d7[_0x2f67('0x2c')]:_0x520fca[_0x2f67('0x2b')];if(_0x105553['query'][_0x2f67('0x2e')]){_0xd3f1d7[_0x2f67('0x2f')]=[{'all':!![]}];}_0xd3f1d7=_['merge']({},_0xd3f1d7,_0x105553[_0x2f67('0x30')]);return db[_0x2f67('0x1d')][_0x2f67('0x31')](_0xd3f1d7)['then'](handleEntityNotFound(_0x3929dc,null))['then'](respondWithResult(_0x3929dc,null))[_0x2f67('0x25')](handleError(_0x3929dc,null));};exports[_0x2f67('0x32')]=function(_0x56a7cf,_0x379fe0){return db[_0x2f67('0x1d')]['create'](_0x56a7cf[_0x2f67('0x33')],{})[_0x2f67('0x18')](respondWithResult(_0x379fe0,0xc9))['catch'](handleError(_0x379fe0,null));};exports[_0x2f67('0x17')]=function(_0x3dff4e,_0x104c4b){if(_0x3dff4e[_0x2f67('0x33')]['id']){delete _0x3dff4e['body']['id'];}return db['FaxInteraction'][_0x2f67('0x31')]({'where':{'id':_0x3dff4e['params']['id']}})[_0x2f67('0x18')](handleEntityNotFound(_0x104c4b,null))[_0x2f67('0x18')](saveUpdates(_0x3dff4e[_0x2f67('0x33')],null))[_0x2f67('0x18')](respondWithResult(_0x104c4b,null))[_0x2f67('0x25')](handleError(_0x104c4b,null));};exports[_0x2f67('0x34')]=function(_0x37cf9e,_0x1686dc){return db['FaxInteraction'][_0x2f67('0x31')]({'where':{'id':_0x37cf9e['params']['id']}})[_0x2f67('0x18')](handleEntityNotFound(_0x1686dc,null))[_0x2f67('0x18')](removeEntity(_0x1686dc,null))[_0x2f67('0x25')](handleError(_0x1686dc,null));};exports[_0x2f67('0x35')]=function(_0x3c3b60,_0x207907){return db[_0x2f67('0x1d')][_0x2f67('0x35')]()[_0x2f67('0x18')](respondWithResult(_0x207907,null))[_0x2f67('0x25')](handleError(_0x207907,null));};exports[_0x2f67('0x36')]=function(_0x1b9172,_0x56e7ba){return db[_0x2f67('0x37')][_0x2f67('0x31')]({'where':{'id':_0x1b9172[_0x2f67('0x27')]['id']}})[_0x2f67('0x18')](handleEntityNotFound(_0x56e7ba,null))[_0x2f67('0x18')](function(_0x511280){if(_0x511280){return _0x511280[_0x2f67('0x36')](_0x1b9172[_0x2f67('0x33')][_0x2f67('0x38')],_[_0x2f67('0x39')](_0x1b9172[_0x2f67('0x33')],[_0x2f67('0x38'),'id'])||{});}})[_0x2f67('0x18')](respondWithResult(_0x56e7ba,null))['catch'](handleError(_0x56e7ba,null));};exports[_0x2f67('0x3a')]=function(_0x33c5a6,_0x1e620b){var _0x30a712={'raw':![],'where':{}};var _0x14ff8a={};var _0x444ebd={'count':0x0,'rows':[]};return db[_0x2f67('0x1d')]['findOne']({'where':{'id':_0x33c5a6[_0x2f67('0x27')]['id']}})['then'](handleEntityNotFound(_0x1e620b,null))[_0x2f67('0x18')](function(_0x17ba9f){if(_0x17ba9f){_0x14ff8a[_0x2f67('0x2b')]=_[_0x2f67('0x28')](db[_0x2f67('0x37')]['rawAttributes']);_0x14ff8a[_0x2f67('0x23')]=_[_0x2f67('0x28')](_0x33c5a6[_0x2f67('0x23')]);_0x14ff8a['filters']=_[_0x2f67('0x3b')](_0x14ff8a[_0x2f67('0x2b')],_0x14ff8a['query']);_0x30a712[_0x2f67('0x2c')]=_[_0x2f67('0x3b')](_0x14ff8a[_0x2f67('0x2b')],qs[_0x2f67('0x2d')](_0x33c5a6[_0x2f67('0x23')][_0x2f67('0x2d')]));_0x30a712['attributes']=_0x30a712[_0x2f67('0x2c')][_0x2f67('0x3c')]?_0x30a712[_0x2f67('0x2c')]:_0x14ff8a[_0x2f67('0x2b')];if(!_0x33c5a6[_0x2f67('0x23')][_0x2f67('0x3d')](_0x2f67('0x3e'))){_0x30a712[_0x2f67('0x12')]=qs[_0x2f67('0x12')](_0x33c5a6[_0x2f67('0x23')][_0x2f67('0x12')]);_0x30a712[_0x2f67('0x11')]=qs[_0x2f67('0x11')](_0x33c5a6[_0x2f67('0x23')]['offset']);}_0x30a712[_0x2f67('0x3f')]=qs[_0x2f67('0x40')](_0x33c5a6[_0x2f67('0x23')]['sort']);_0x30a712[_0x2f67('0x41')]=qs[_0x2f67('0x2a')](_[_0x2f67('0x42')](_0x33c5a6[_0x2f67('0x23')],_0x14ff8a[_0x2f67('0x2a')]));_0x30a712[_0x2f67('0x41')][_0x2f67('0x43')]=_0x17ba9f['id'];if(_0x33c5a6[_0x2f67('0x23')][_0x2f67('0x44')]){_0x30a712[_0x2f67('0x41')]=_[_0x2f67('0x45')](_0x30a712[_0x2f67('0x41')],{'$or':_[_0x2f67('0x1c')](_0x30a712[_0x2f67('0x2c')],function(_0x4521e3){var _0x1a51ce={};_0x1a51ce[_0x4521e3]={'$like':'%'+_0x33c5a6['query']['filter']+'%'};return _0x1a51ce;})});}if(_0x33c5a6[_0x2f67('0x23')][_0x2f67('0x46')]){var _0x3372f7=_0x33c5a6[_0x2f67('0x23')]['$gte'][_0x2f67('0x47')](',');var _0x321b97={};_0x321b97[_0x3372f7[0x0]]={'$gte':moment(_0x3372f7[0x1])[_0x2f67('0x48')](_0x2f67('0x49'))};_0x30a712[_0x2f67('0x41')]=_[_0x2f67('0x45')](_0x30a712['where'],_0x321b97);}_0x30a712=_[_0x2f67('0x45')]({},_0x30a712,_0x33c5a6[_0x2f67('0x30')]);return db['FaxMessage']['count']({'where':_0x30a712[_0x2f67('0x41')]})['then'](function(_0x151953){_0x444ebd[_0x2f67('0x14')]=_0x151953;if(_0x33c5a6[_0x2f67('0x23')]['includeAll']){_0x30a712[_0x2f67('0x2f')]=[{'all':!![]}];}return db['FaxMessage'][_0x2f67('0x4a')](_0x30a712);})[_0x2f67('0x18')](function(_0x2a1129){_0x444ebd[_0x2f67('0x4b')]=_0x2a1129;return _0x444ebd;});}})['then'](respondWithFilteredResult(_0x1e620b,_0x30a712))[_0x2f67('0x25')](handleError(_0x1e620b,null));};exports['addTags']=function(_0x2f7114,_0x59bbc7){return db[_0x2f67('0x1d')][_0x2f67('0x31')]({'where':{'id':_0x2f7114[_0x2f67('0x27')]['id']}})[_0x2f67('0x18')](handleEntityNotFound(_0x59bbc7,null))[_0x2f67('0x18')](function(_0x3161a8){if(_0x3161a8){return _0x3161a8['setTags'](_0x2f7114[_0x2f67('0x33')]['ids'],_[_0x2f67('0x39')](_0x2f7114[_0x2f67('0x33')],[_0x2f67('0x38'),'id'])||{})[_0x2f67('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id',_0x2f67('0x1b'),'color'],'where':{'id':_0x2f7114[_0x2f67('0x33')]['ids']}});})[_0x2f67('0x18')](function(_0x440bd4){socket[_0x2f67('0x4d')](_0x2f67('0x4e'),{'id':Number(_0x2f7114[_0x2f67('0x27')]['id']),'tags':_0x440bd4||[]});return{'id':Number(_0x2f7114[_0x2f67('0x27')]['id']),'tags':_0x440bd4||[]};});}})[_0x2f67('0x18')](respondWithResult(_0x59bbc7,null))['catch'](handleError(_0x59bbc7,null));};exports[_0x2f67('0x4f')]=function(_0x240802,_0x20214f){return db[_0x2f67('0x1d')]['find']({'where':{'id':_0x240802['params']['id']}})[_0x2f67('0x18')](handleEntityNotFound(_0x20214f,null))[_0x2f67('0x18')](function(_0x21f919){if(_0x21f919){return _0x21f919[_0x2f67('0x4f')](_0x240802[_0x2f67('0x23')]['ids']);}})[_0x2f67('0x18')](respondWithStatusCode(_0x20214f,null))[_0x2f67('0x25')](handleError(_0x20214f,null));};exports[_0x2f67('0x50')]=function(_0x25a7e3,_0x48a581){var _0xe1f4df=moment()['unix']()[_0x2f67('0x51')]();var _0x1bf105=path['join'](config[_0x2f67('0x52')],'server',_0x2f67('0x53'),_0x2f67('0x54'));var _0x3eadc3=path[_0x2f67('0x55')](config['root'],_0x2f67('0x56'),_0x2f67('0x53'),_0x2f67('0x57'));var _0x3fda7b=path['join'](_0x1bf105,_0xe1f4df);var _0x44f259=util[_0x2f67('0x48')](_0x2f67('0x58'),_0x25a7e3[_0x2f67('0x27')]['id'],_0xe1f4df);var _0x211fc8=path['join'](_0x1bf105,_0x44f259);var _0x321fd2=[];_0x321fd2['push']({'model':db[_0x2f67('0x59')],'as':_0x2f67('0x59'),'raw':!![]});var _0x8a0b42=[{'model':db[_0x2f67('0x37')],'as':'Messages','attributes':['id','body','createdAt'],'include':_0x321fd2}];return db[_0x2f67('0x1d')]['find']({'where':{'id':_0x25a7e3[_0x2f67('0x27')]['id']},'include':_0x8a0b42})['then'](handleEntityNotFound(_0x48a581,null))[_0x2f67('0x18')](function(_0x40b22d){if(_0x40b22d&&_0x40b22d[_0x2f67('0x5a')]){var _0x57994a=_0x40b22d[_0x2f67('0x5b')]({'plain':!![]});fs[_0x2f67('0x5c')](_0x3fda7b);for(var _0x2b3851=0x0;_0x2b3851<_0x57994a[_0x2f67('0x5a')][_0x2f67('0x3c')];_0x2b3851++){var _0x4ab969=_0x57994a[_0x2f67('0x5a')][_0x2b3851][_0x2f67('0x59')];if(_0x4ab969){var _0x1846b7=path['join'](_0x3eadc3,_0x4ab969[_0x2f67('0x5d')]);if(fs['existsSync'](_0x1846b7)){fs[_0x2f67('0x5e')](_0x1846b7)[_0x2f67('0x5f')](fs[_0x2f67('0x60')](path[_0x2f67('0x55')](_0x3fda7b,_0x4ab969['basename'])));}}}return BPromise[_0x2f67('0x61')]()[_0x2f67('0x18')](function(){return new BPromise(function(_0x4b37f9,_0x1216c9){zipdir(_0x3fda7b,{'saveTo':_0x211fc8},function(_0x1b4b74,_0x1216e6){if(_0x1b4b74)return _0x1216c9(_0x1b4b74);return _0x4b37f9(_0x1216e6);});})[_0x2f67('0x18')](function(){return new BPromise(function(_0x46cee2,_0x54e836){rimraf(_0x3fda7b,function(_0x733321){if(_0x733321)_0x54e836(_0x733321);return _0x46cee2();});});})['then'](function(){return _0x48a581[_0x2f67('0x50')](_0x211fc8,_0x44f259,function(_0x365e66){if(_0x365e66){console[_0x2f67('0x62')](_0x2f67('0x63'),_0x365e66);}else{fs[_0x2f67('0x64')](_0x211fc8);}});});});}else{return _0x48a581[_0x2f67('0x65')](0xc8);}})[_0x2f67('0x25')](handleError(_0x48a581,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 85842eb..9c2a478 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 _0x988c=['remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','emit','catch','hasOwnProperty','exports','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x988c,0x15b));var _0xc988=function(_0x2eb6ae,_0xe4d718){_0x2eb6ae=_0x2eb6ae-0x0;var _0x126574=_0x988c[_0x2eb6ae];return _0x126574;};'use strict';var EventEmitter=require(_0xc988('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xc988('0x1')];var FaxMessage=require(_0xc988('0x2'))['db'][_0xc988('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc988('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc988('0x5')};function emitEvent(_0x1eaff1){return function(_0x26a556,_0x3191c6,_0x9b9ac9){_0x26a556[_0xc988('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x14dad6){_0x26a556[_0xc988('0x7')](_0xc988('0x8'),_0x14dad6['map'](function(_0x3f6388){return{'id':_0x3f6388['id']};}));return FaxMessage[_0xc988('0x9')]({'where':{'FaxInteractionId':_0x26a556['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc988('0xa')](function(_0x348586){_0x26a556[_0xc988('0x7')](_0xc988('0xb'),_0x348586['length']);FaxInteractionEvents['emit'](_0x1eaff1+':'+_0x26a556['id'],_0x26a556);FaxInteractionEvents[_0xc988('0xc')](_0x1eaff1,_0x26a556);_0x9b9ac9(null);})[_0xc988('0xd')](_0x9b9ac9(null));};}for(var e in events){if(events[_0xc988('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xc988('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x62ee=['unreadMessages','emit','catch','hasOwnProperty','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue'];(function(_0x563cdb,_0x5d9b4){var _0x3abae1=function(_0x5b0c28){while(--_0x5b0c28){_0x563cdb['push'](_0x563cdb['shift']());}};_0x3abae1(++_0x5d9b4);}(_0x62ee,0x174));var _0xe62e=function(_0x5baa35,_0x6c437e){_0x5baa35=_0x5baa35-0x0;var _0x1cdbc6=_0x62ee[_0x5baa35];return _0x1cdbc6;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xe62e('0x0'))['db'][_0xe62e('0x1')];var FaxMessage=require(_0xe62e('0x0'))['db'][_0xe62e('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe62e('0x3')](0x0);var events={'afterCreate':_0xe62e('0x4'),'afterUpdate':_0xe62e('0x5'),'afterDestroy':_0xe62e('0x6')};function emitEvent(_0x3f0031){return function(_0xc8a9f9,_0x1b1204,_0x440af3){_0xc8a9f9[_0xe62e('0x7')]({'attributes':['id'],'raw':!![]})[_0xe62e('0x8')](function(_0x4ecab5){_0xc8a9f9['setDataValue']('Users',_0x4ecab5[_0xe62e('0x9')](function(_0x4d20cd){return{'id':_0x4d20cd['id']};}));return FaxMessage[_0xe62e('0xa')]({'where':{'FaxInteractionId':_0xc8a9f9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe62e('0x8')](function(_0x575460){_0xc8a9f9[_0xe62e('0xb')](_0xe62e('0xc'),_0x575460['length']);FaxInteractionEvents[_0xe62e('0xd')](_0x3f0031+':'+_0xc8a9f9['id'],_0xc8a9f9);FaxInteractionEvents[_0xe62e('0xd')](_0x3f0031,_0xc8a9f9);_0x440af3(null);})[_0xe62e('0xe')](_0x440af3(null));};}for(var e in events){if(events[_0xe62e('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e132adc..67321b3 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 _0x62cf=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format'];(function(_0x5a17cd,_0x227291){var _0x219138=function(_0x43f469){while(--_0x43f469){_0x5a17cd['push'](_0x5a17cd['shift']());}};_0x219138(++_0x227291);}(_0x62cf,0x81));var _0xf62c=function(_0x2c4e39,_0x108ff7){_0x2c4e39=_0x2c4e39-0x0;var _0x769c23=_0x62cf[_0x2c4e39];return _0x769c23;};'use strict';var _=require(_0xf62c('0x0'));var util=require('util');var logger=require(_0xf62c('0x1'))('api');var moment=require(_0xf62c('0x2'));var BPromise=require(_0xf62c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf62c('0x4'));var config=require(_0xf62c('0x5'));var attributes=require(_0xf62c('0x6'));module[_0xf62c('0x7')]=function(_0x3604f0,_0x40487e){return _0x3604f0[_0xf62c('0x8')](_0xf62c('0x9'),attributes,{'tableName':_0xf62c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54389e,_0x181f87,_0x4e0655){if(_0x54389e[_0xf62c('0xb')](_0xf62c('0xc'))){_0x54389e[_0xf62c('0xd')]=moment()[_0xf62c('0xe')](_0xf62c('0xf'));}_0x4e0655(null,_0x54389e);}}});}; \ No newline at end of file +var _0x5ae0=['path','rimraf','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird'];(function(_0xdf02d7,_0x232801){var _0x2e1e4c=function(_0x4bd62e){while(--_0x4bd62e){_0xdf02d7['push'](_0xdf02d7['shift']());}};_0x2e1e4c(++_0x232801);}(_0x5ae0,0xf8));var _0x05ae=function(_0x1a3f83,_0x45d2ef){_0x1a3f83=_0x1a3f83-0x0;var _0x4d6df6=_0x5ae0[_0x1a3f83];return _0x4d6df6;};'use strict';var _=require('lodash');var util=require(_0x05ae('0x0'));var logger=require(_0x05ae('0x1'))('api');var moment=require(_0x05ae('0x2'));var BPromise=require(_0x05ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05ae('0x4'));var rimraf=require(_0x05ae('0x5'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x05ae('0x6')]=function(_0x40b966,_0x2c4e6c){return _0x40b966['define'](_0x05ae('0x7'),attributes,{'tableName':_0x05ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x208d01,_0xd050af,_0x315dd9){if(_0x208d01[_0x05ae('0x9')](_0x05ae('0xa'))){_0x208d01[_0x05ae('0xb')]=moment()[_0x05ae('0xc')](_0x05ae('0xd'));}_0x315dd9(null,_0x208d01);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ccff515..6218444 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 _0x6865=['request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','FaxInteraction','update','body','options','raw','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','where','addTags','omit','ids','spread','AddTags','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./faxInteraction.socket','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6865,0x66));var _0x5686=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6865[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5686('0x0'));var fs=require('fs');var Redis=require(_0x5686('0x1'));var db=require(_0x5686('0x2'))['db'];var utils=require(_0x5686('0x3'));var logger=require(_0x5686('0x4'))('rpc');var config=require(_0x5686('0x5'));var jayson=require(_0x5686('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x5686('0x7')]=_[_0x5686('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5686('0x9'))(new Redis(config[_0x5686('0x7')]));require(_0x5686('0xa'))[_0x5686('0xb')](socket);function respondWithRpcPromise(_0x25c5e9,_0x1bd0b7,_0x1f946f){return new BPromise(function(_0x21c314,_0x37fd9b){return client[_0x5686('0xc')](_0x25c5e9,_0x1f946f)[_0x5686('0xd')](function(_0x5524ce){logger[_0x5686('0xe')](_0x5686('0xf'),_0x1bd0b7,_0x5686('0x10'));logger[_0x5686('0x11')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x1bd0b7,'request\x20sent',JSON[_0x5686('0x12')](_0x5524ce));if(_0x5524ce[_0x5686('0x13')]){if(_0x5524ce[_0x5686('0x13')][_0x5686('0x14')]===0x1f4){logger[_0x5686('0x13')](_0x5686('0xf'),_0x1bd0b7,_0x5524ce[_0x5686('0x13')][_0x5686('0x15')]);return _0x37fd9b(_0x5524ce[_0x5686('0x13')][_0x5686('0x15')]);}logger[_0x5686('0x13')](_0x5686('0xf'),_0x1bd0b7,_0x5524ce[_0x5686('0x13')][_0x5686('0x15')]);return _0x21c314(_0x5524ce[_0x5686('0x13')][_0x5686('0x15')]);}else{logger[_0x5686('0xe')]('FaxInteraction,\x20%s,\x20%s',_0x1bd0b7,_0x5686('0x10'));_0x21c314(_0x5524ce['result'][_0x5686('0x15')]);}})[_0x5686('0x16')](function(_0x39f11f){logger[_0x5686('0x13')](_0x5686('0xf'),_0x1bd0b7,_0x39f11f);_0x37fd9b(_0x39f11f);});});}exports['UpdateFaxInteraction']=function(_0x957e6e){var _0x3fd4da=this;return new Promise(function(_0x5b1708,_0x2e048d){return db[_0x5686('0x17')][_0x5686('0x18')](_0x957e6e[_0x5686('0x19')],{'raw':_0x957e6e[_0x5686('0x1a')]?_0x957e6e[_0x5686('0x1a')][_0x5686('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x957e6e[_0x5686('0x1a')]?_0x957e6e[_0x5686('0x1a')]['where']||null:null,'attributes':_0x957e6e['options']?_0x957e6e[_0x5686('0x1a')][_0x5686('0x1c')]||null:null,'limit':_0x957e6e[_0x5686('0x1a')]?_0x957e6e['options'][_0x5686('0x1d')]||null:null})[_0x5686('0xd')](function(_0x5d719c){logger['info'](_0x5686('0x1e'),_0x957e6e);logger[_0x5686('0x11')](_0x5686('0x1e'),_0x957e6e,JSON[_0x5686('0x12')](_0x5d719c));_0x5b1708(_0x5d719c);})[_0x5686('0x16')](function(_0x37af5b){logger['error'](_0x5686('0x1e'),_0x37af5b[_0x5686('0x15')],_0x957e6e);_0x2e048d(_0x3fd4da[_0x5686('0x13')](0x1f4,_0x37af5b[_0x5686('0x15')]));});});};exports[_0x5686('0x1f')]=function(_0x4e0cce){return new Promise(function(_0x57f535,_0x1aa6e7){return db[_0x5686('0x17')]['find']({'where':_0x4e0cce[_0x5686('0x1a')]?_0x4e0cce['options'][_0x5686('0x20')]||null:null})[_0x5686('0xd')](function(_0x3d88bd){if(_0x3d88bd){return _0x3d88bd[_0x5686('0x21')](_0x4e0cce[_0x5686('0x19')]['ids'],_[_0x5686('0x22')](_0x4e0cce[_0x5686('0x19')],[_0x5686('0x23'),'id'])||{});}})[_0x5686('0x24')](function(_0x4d299c){logger[_0x5686('0xe')](_0x5686('0x25'),_0x4e0cce);logger[_0x5686('0x11')](_0x5686('0x25'),_0x4e0cce,JSON[_0x5686('0x12')](_0x4d299c));_0x57f535(_0x4d299c);})['catch'](function(_0x5b90d4){logger[_0x5686('0x13')](_0x5686('0x25'),_0x5b90d4[_0x5686('0x15')],_0x4e0cce);_0x1aa6e7(_this['error'](0x1f4,_0x5b90d4[_0x5686('0x15')]));});});}; \ No newline at end of file +var _0xd2d1=['message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','AddTagsToFaxInteraction','find','where','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xd2d1,0x183));var _0x1d2d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd2d1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1d2d('0x0'));var util=require('util');var moment=require(_0x1d2d('0x1'));var BPromise=require(_0x1d2d('0x2'));var rs=require(_0x1d2d('0x3'));var fs=require('fs');var Redis=require(_0x1d2d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1d2d('0x5'))(_0x1d2d('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d2d('0x7'));var client=jayson[_0x1d2d('0x8')]['http']({'port':0x232a});config[_0x1d2d('0x9')]=_[_0x1d2d('0xa')](config[_0x1d2d('0x9')],{'host':_0x1d2d('0xb'),'port':0x18eb});var socket=require(_0x1d2d('0xc'))(new Redis(config[_0x1d2d('0x9')]));require(_0x1d2d('0xd'))['register'](socket);function respondWithRpcPromise(_0x383511,_0x5db034,_0x17974c){return new BPromise(function(_0x332676,_0x4af635){return client[_0x1d2d('0xe')](_0x383511,_0x17974c)[_0x1d2d('0xf')](function(_0x178b3e){logger[_0x1d2d('0x10')](_0x1d2d('0x11'),_0x5db034,_0x1d2d('0x12'));logger[_0x1d2d('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x5db034,'request\x20sent',JSON[_0x1d2d('0x14')](_0x178b3e));if(_0x178b3e[_0x1d2d('0x15')]){if(_0x178b3e[_0x1d2d('0x15')][_0x1d2d('0x16')]===0x1f4){logger[_0x1d2d('0x15')](_0x1d2d('0x11'),_0x5db034,_0x178b3e[_0x1d2d('0x15')]['message']);return _0x4af635(_0x178b3e[_0x1d2d('0x15')][_0x1d2d('0x17')]);}logger['error'](_0x1d2d('0x11'),_0x5db034,_0x178b3e[_0x1d2d('0x15')][_0x1d2d('0x17')]);return _0x332676(_0x178b3e['error'][_0x1d2d('0x17')]);}else{logger[_0x1d2d('0x10')](_0x1d2d('0x11'),_0x5db034,_0x1d2d('0x12'));_0x332676(_0x178b3e[_0x1d2d('0x18')]['message']);}})[_0x1d2d('0x19')](function(_0x4de1d0){logger[_0x1d2d('0x15')](_0x1d2d('0x11'),_0x5db034,_0x4de1d0);_0x4af635(_0x4de1d0);});});}exports[_0x1d2d('0x1a')]=function(_0x23033f){var _0xc1809e=this;return new Promise(function(_0x1b51d3,_0x2f85af){return db[_0x1d2d('0x1b')][_0x1d2d('0x1c')](_0x23033f[_0x1d2d('0x1d')],{'raw':_0x23033f[_0x1d2d('0x1e')]?_0x23033f[_0x1d2d('0x1e')][_0x1d2d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23033f['options']?_0x23033f['options']['where']||null:null,'attributes':_0x23033f['options']?_0x23033f[_0x1d2d('0x1e')][_0x1d2d('0x20')]||null:null,'limit':_0x23033f[_0x1d2d('0x1e')]?_0x23033f[_0x1d2d('0x1e')][_0x1d2d('0x21')]||null:null})['then'](function(_0x2522ca){logger[_0x1d2d('0x10')]('UpdateFaxInteraction',_0x23033f);logger['debug'](_0x1d2d('0x1a'),_0x23033f,JSON[_0x1d2d('0x14')](_0x2522ca));_0x1b51d3(_0x2522ca);})[_0x1d2d('0x19')](function(_0x12376d){logger['error'](_0x1d2d('0x1a'),_0x12376d[_0x1d2d('0x17')],_0x23033f);_0x2f85af(_0xc1809e[_0x1d2d('0x15')](0x1f4,_0x12376d[_0x1d2d('0x17')]));});});};exports[_0x1d2d('0x22')]=function(_0x12ffd2){return new Promise(function(_0xe9ceac,_0x4eec38){return db[_0x1d2d('0x1b')][_0x1d2d('0x23')]({'where':_0x12ffd2[_0x1d2d('0x1e')]?_0x12ffd2[_0x1d2d('0x1e')][_0x1d2d('0x24')]||null:null})[_0x1d2d('0xf')](function(_0x4dcdcc){if(_0x4dcdcc){return _0x4dcdcc['addTags'](_0x12ffd2[_0x1d2d('0x1d')][_0x1d2d('0x25')],_[_0x1d2d('0x26')](_0x12ffd2[_0x1d2d('0x1d')],[_0x1d2d('0x25'),'id'])||{});}})[_0x1d2d('0x27')](function(_0x4d7fab){logger[_0x1d2d('0x10')](_0x1d2d('0x28'),_0x12ffd2);logger[_0x1d2d('0x13')](_0x1d2d('0x28'),_0x12ffd2,JSON[_0x1d2d('0x14')](_0x4d7fab));_0xe9ceac(_0x4d7fab);})[_0x1d2d('0x19')](function(_0xcf0921){logger[_0x1d2d('0x15')](_0x1d2d('0x28'),_0xcf0921[_0x1d2d('0x17')],_0x12ffd2);_0x4eec38(_this['error'](0x1f4,_0xcf0921[_0x1d2d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 2b7e914..b620c76 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 _0x08b6=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x2af977,_0x45051){var _0x53d507=function(_0x51aabe){while(--_0x51aabe){_0x2af977['push'](_0x2af977['shift']());}};_0x53d507(++_0x45051);}(_0x08b6,0xbb));var _0x608b=function(_0x1da889,_0x1c3393){_0x1da889=_0x1da889-0x0;var _0x2963b4=_0x08b6[_0x1da889];return _0x2963b4;};'use strict';var FaxInteractionEvents=require(_0x608b('0x0'));var events=[_0x608b('0x1'),_0x608b('0x2'),_0x608b('0x3')];function createListener(_0x47bcdb,_0x21126e){return function(_0x2a10b2){_0x21126e[_0x608b('0x4')](_0x47bcdb,_0x2a10b2);};}function removeListener(_0x1a29e1,_0x4fad9e){return function(){FaxInteractionEvents[_0x608b('0x5')](_0x1a29e1,_0x4fad9e);};}exports[_0x608b('0x6')]=function(_0x1c40a4){for(var _0x9ee067=0x0,_0x2d2d88=events['length'];_0x9ee067<_0x2d2d88;_0x9ee067++){var _0x39d969=events[_0x9ee067];var _0x23d102=createListener(_0x608b('0x7')+_0x39d969,_0x1c40a4);FaxInteractionEvents['on'](_0x39d969,_0x23d102);}}; \ No newline at end of file +var _0x3522=['register','length','removeListener'];(function(_0x1428ff,_0x38cff9){var _0xe42225=function(_0x3eaaef){while(--_0x3eaaef){_0x1428ff['push'](_0x1428ff['shift']());}};_0xe42225(++_0x38cff9);}(_0x3522,0x16d));var _0x2352=function(_0x21381b,_0x70ca4b){_0x21381b=_0x21381b-0x0;var _0x212501=_0x3522[_0x21381b];return _0x212501;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove','update'];function createListener(_0x2e0523,_0x1d0091){return function(_0x321ea7){_0x1d0091['emit'](_0x2e0523,_0x321ea7);};}function removeListener(_0x5a1e39,_0x45aa35){return function(){FaxInteractionEvents[_0x2352('0x0')](_0x5a1e39,_0x45aa35);};}exports[_0x2352('0x1')]=function(_0x34f57c){for(var _0x5062a2=0x0,_0xe29e2c=events[_0x2352('0x2')];_0x5062a2<_0xe29e2c;_0x5062a2++){var _0x455de0=events[_0x5062a2];var _0x142741=createListener('faxInteraction:'+_0x455de0,_0x34f57c);FaxInteractionEvents['on'](_0x455de0,_0x142741);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e6a0203..b847f71 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 _0x7233=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','faxinteraction:destroy','delete','exports'];(function(_0x3d09e2,_0x58e784){var _0x5d03cd=function(_0x40f355){while(--_0x40f355){_0x3d09e2['push'](_0x3d09e2['shift']());}};_0x5d03cd(++_0x58e784);}(_0x7233,0x1b2));var _0x3723=function(_0x34bcfa,_0x5056ea){_0x34bcfa=_0x34bcfa-0x0;var _0xb6f0d2=_0x7233[_0x34bcfa];return _0xb6f0d2;};'use strict';var multer=require(_0x3723('0x0'));var util=require(_0x3723('0x1'));var path=require(_0x3723('0x2'));var timeout=require(_0x3723('0x3'));var express=require(_0x3723('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3723('0x5'));var interaction=require(_0x3723('0x6'));var config=require(_0x3723('0x7'));var controller=require('./faxInteraction.controller');router[_0x3723('0x8')]('/',auth[_0x3723('0x9')](),controller[_0x3723('0xa')]);router[_0x3723('0x8')](_0x3723('0xb'),auth[_0x3723('0x9')](),controller[_0x3723('0xc')]);router[_0x3723('0x8')](_0x3723('0xd'),auth[_0x3723('0x9')](),controller[_0x3723('0xe')]);router['get'](_0x3723('0xf'),auth[_0x3723('0x9')](),controller[_0x3723('0x10')]);router[_0x3723('0x8')](_0x3723('0x11'),auth[_0x3723('0x9')](),controller[_0x3723('0x12')]);router[_0x3723('0x13')]('/',auth['isAuthenticated'](),controller[_0x3723('0x14')]);router[_0x3723('0x13')](_0x3723('0xf'),auth[_0x3723('0x9')](),controller[_0x3723('0x15')]);router[_0x3723('0x13')](_0x3723('0x16'),auth[_0x3723('0x9')](),interaction[_0x3723('0x17')](_0x3723('0x18'),_0x3723('0x19')),controller[_0x3723('0x1a')]);router['put'](_0x3723('0xd'),auth[_0x3723('0x9')](),interaction[_0x3723('0x17')](_0x3723('0x18'),_0x3723('0x1b')),controller['update']);router['delete'](_0x3723('0xd'),auth[_0x3723('0x9')](),interaction[_0x3723('0x17')](_0x3723('0x18'),_0x3723('0x1c')),controller['destroy']);router[_0x3723('0x1d')]('/:id/tags',auth[_0x3723('0x9')](),controller['removeTags']);module[_0x3723('0x1e')]=router; \ No newline at end of file +var _0x0dcf=['/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','faxinteraction:destroy','delete','removeTags','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage'];(function(_0x5b077c,_0x55d78b){var _0x556edd=function(_0x252835){while(--_0x252835){_0x5b077c['push'](_0x5b077c['shift']());}};_0x556edd(++_0x55d78b);}(_0x0dcf,0x64));var _0xf0dc=function(_0x418c02,_0x56855b){_0x418c02=_0x418c02-0x0;var _0x5d3666=_0x0dcf[_0x418c02];return _0x5d3666;};'use strict';var multer=require(_0xf0dc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf0dc('0x1'));var express=require(_0xf0dc('0x2'));var router=express['Router']();var fs_extra=require(_0xf0dc('0x3'));var auth=require(_0xf0dc('0x4'));var interaction=require(_0xf0dc('0x5'));var config=require(_0xf0dc('0x6'));var controller=require('./faxInteraction.controller');router[_0xf0dc('0x7')]('/',auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x9')]);router['get'](_0xf0dc('0xa'),auth['isAuthenticated'](),controller[_0xf0dc('0xb')]);router[_0xf0dc('0x7')](_0xf0dc('0xc'),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0xd')]);router[_0xf0dc('0x7')](_0xf0dc('0xe'),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0xf')]);router[_0xf0dc('0x7')](_0xf0dc('0x10'),auth[_0xf0dc('0x8')](),controller['download']);router[_0xf0dc('0x11')]('/',auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x12')]);router[_0xf0dc('0x11')](_0xf0dc('0xe'),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x13')]);router[_0xf0dc('0x11')](_0xf0dc('0x14'),auth[_0xf0dc('0x8')](),interaction[_0xf0dc('0x15')]('fax',_0xf0dc('0x16')),controller[_0xf0dc('0x17')]);router[_0xf0dc('0x18')](_0xf0dc('0xc'),auth['isAuthenticated'](),interaction[_0xf0dc('0x15')](_0xf0dc('0x19'),_0xf0dc('0x1a')),controller['update']);router['delete'](_0xf0dc('0xc'),auth[_0xf0dc('0x8')](),interaction['tracked'](_0xf0dc('0x19'),_0xf0dc('0x1b')),controller['destroy']);router[_0xf0dc('0x1c')](_0xf0dc('0x14'),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 16e8aa8..22e29b3 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 _0x9099=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x9099,0x1ac));var _0x9909=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x9099[_0x3cea78];return _0x33b66b;};'use strict';var Sequelize=require(_0x9909('0x0'));module['exports']={'body':{'type':Sequelize[_0x9909('0x1')](_0x9909('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9909('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9909('0x4')]('in',_0x9909('0x5')),'defaultValue':_0x9909('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x9909('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x9909('0x6')]}}; \ No newline at end of file +var _0xb0b9=['TEXT','DATE','sequelize','medium','BOOLEAN','ENUM','out'];(function(_0xfcef4a,_0x22d684){var _0x1e330d=function(_0x3cb1dd){while(--_0x3cb1dd){_0xfcef4a['push'](_0xfcef4a['shift']());}};_0x1e330d(++_0x22d684);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x5f34a9,_0x210296){_0x5f34a9=_0x5f34a9-0x0;var _0x5d09e8=_0xb0b9[_0x5f34a9];return _0x5d09e8;};'use strict';var Sequelize=require(_0x9b0b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x9b0b('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9b0b('0x3')]('in',_0x9b0b('0x4')),'defaultValue':_0x9b0b('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x9b0b('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x9b0b('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 25faac5..3aa9114 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 _0x1768=['server','files','attachments','Attachment','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','update','body','params','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteraction','isNil','read1stAt','format','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','interface','rejectmessage','create','findOne','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root'];(function(_0x191e54,_0x25ae10){var _0x31b56d=function(_0x5581c0){while(--_0x5581c0){_0x191e54['push'](_0x191e54['shift']());}};_0x31b56d(++_0x25ae10);}(_0x1768,0x1d2));var _0x8176=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x1768[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require(_0x8176('0x0'));var rimraf=require(_0x8176('0x1'));var zipdir=require(_0x8176('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8176('0x3'));var moment=require(_0x8176('0x4'));var BPromise=require(_0x8176('0x5'));var Mustache=require(_0x8176('0x6'));var util=require(_0x8176('0x7'));var path=require('path');var sox=require(_0x8176('0x8'));var csv=require(_0x8176('0x9'));var ejs=require(_0x8176('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8176('0xb'));var squel=require(_0x8176('0xc'));var crypto=require(_0x8176('0xd'));var jsforce=require(_0x8176('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8176('0x9'));var querystring=require(_0x8176('0xf'));var Papa=require(_0x8176('0x10'));var Redis=require(_0x8176('0x11'));var authService=require(_0x8176('0x12'));var qs=require(_0x8176('0x13'));var as=require(_0x8176('0x14'));var hardwareService=require(_0x8176('0x15'));var logger=require(_0x8176('0x16'))(_0x8176('0x17'));var utils=require(_0x8176('0x18'));var config=require(_0x8176('0x19'));var licenseUtil=require(_0x8176('0x1a'));var db=require(_0x8176('0x1b'))['db'];config[_0x8176('0x1c')]=_[_0x8176('0x1d')](config[_0x8176('0x1c')],{'host':_0x8176('0x1e'),'port':0x18eb});var socket=require(_0x8176('0x1f'))(new Redis(config[_0x8176('0x1c')]));require(_0x8176('0x20'))[_0x8176('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8176('0x22')][_0x8176('0x23')]({'port':0x232c});var client9002=jayson[_0x8176('0x22')][_0x8176('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1bc004,_0x50544b,_0x1c1b33,_0x293421){return new BPromise(function(_0x4dc8c7,_0x2e234f){var _0x52bb8a=_0x293421||client;return _0x52bb8a['request'](_0x1bc004,_0x1c1b33)['then'](function(_0x1ab2fc){logger['info'](_0x8176('0x24'),_0x50544b,_0x8176('0x25'));logger[_0x8176('0x26')](_0x8176('0x27'),_0x50544b,_0x8176('0x25'),JSON[_0x8176('0x28')](_0x1ab2fc));if(_0x1ab2fc[_0x8176('0x29')]){if(_0x1ab2fc[_0x8176('0x29')][_0x8176('0x2a')]===0x1f4){logger[_0x8176('0x29')](_0x8176('0x24'),_0x50544b,_0x1ab2fc[_0x8176('0x29')]['message']);return _0x2e234f(_0x1ab2fc[_0x8176('0x29')]['message']);}logger[_0x8176('0x29')]('FaxMessage,\x20%s,\x20%s',_0x50544b,_0x1ab2fc[_0x8176('0x29')]['message']);return _0x4dc8c7(_0x1ab2fc[_0x8176('0x29')][_0x8176('0x2b')]);}else{logger[_0x8176('0x2c')]('FaxMessage,\x20%s,\x20%s',_0x50544b,_0x8176('0x25'));_0x4dc8c7(_0x1ab2fc[_0x8176('0x2d')][_0x8176('0x2b')]);}})['catch'](function(_0x5c5467){logger[_0x8176('0x29')](_0x8176('0x24'),_0x50544b,_0x5c5467);_0x2e234f(_0x5c5467);});});}function respondWithStatusCode(_0x32af5f,_0x347891){_0x347891=_0x347891||0xcc;return function(_0x2956da){if(_0x2956da){return _0x32af5f['sendStatus'](_0x347891);}return _0x32af5f[_0x8176('0x2e')](_0x347891)[_0x8176('0x2f')]();};}function respondWithResult(_0x2472e9,_0x2b954e){_0x2b954e=_0x2b954e||0xc8;return function(_0x2e7e17){if(_0x2e7e17){return _0x2472e9[_0x8176('0x2e')](_0x2b954e)[_0x8176('0x30')](_0x2e7e17);}};}function respondWithFilteredResult(_0x4e1a84,_0x1ab9c5){return function(_0x45a414){if(_0x45a414){var _0x227f0c=typeof _0x1ab9c5['offset']===_0x8176('0x31')&&typeof _0x1ab9c5[_0x8176('0x32')]===_0x8176('0x31');var _0x4dec15=_0x45a414[_0x8176('0x33')];var _0x448f1c=_0x227f0c?0x0:_0x1ab9c5['offset'];var _0x278e2e=_0x227f0c?_0x45a414[_0x8176('0x33')]:_0x1ab9c5[_0x8176('0x34')]+_0x1ab9c5[_0x8176('0x32')];var _0x2c1a14;if(_0x278e2e>=_0x4dec15){_0x278e2e=_0x4dec15;_0x2c1a14=0xc8;}else{_0x2c1a14=0xce;}_0x4e1a84[_0x8176('0x2e')](_0x2c1a14);return _0x4e1a84[_0x8176('0x35')](_0x8176('0x36'),_0x448f1c+'-'+_0x278e2e+'/'+_0x4dec15)['json'](_0x45a414);}return null;};}function patchUpdates(_0x3caf8c){return function(_0x4e9595){try{jsonpatch[_0x8176('0x37')](_0x4e9595,_0x3caf8c,!![]);}catch(_0x4ab2cd){return BPromise[_0x8176('0x38')](_0x4ab2cd);}return _0x4e9595[_0x8176('0x39')]();};}function saveUpdates(_0x50ba71,_0x3f4ff7){return function(_0x1f4cda){if(_0x1f4cda){return _0x1f4cda['update'](_0x50ba71)['then'](function(_0x402dc0){return _0x402dc0;});}return null;};}function removeEntity(_0x5e6f2d,_0x46b254){return function(_0x1ed81b){if(_0x1ed81b){return _0x1ed81b[_0x8176('0x3a')]()[_0x8176('0x3b')](function(){_0x5e6f2d[_0x8176('0x2e')](0xcc)[_0x8176('0x2f')]();});}};}function handleEntityNotFound(_0x204c1b,_0xcf5de9){return function(_0xa21612){if(!_0xa21612){_0x204c1b[_0x8176('0x3c')](0x194);}return _0xa21612;};}function handleError(_0x5622e6,_0x50b992){_0x50b992=_0x50b992||0x1f4;return function(_0x38a666){logger[_0x8176('0x29')](_0x38a666[_0x8176('0x3d')]);if(_0x38a666[_0x8176('0x3e')]){delete _0x38a666[_0x8176('0x3e')];}_0x5622e6[_0x8176('0x2e')](_0x50b992)[_0x8176('0x3f')](_0x38a666);};}exports[_0x8176('0x40')]=function(_0x3b4799,_0x1e9ba0){var _0x1ed21d={},_0x5264f5={},_0x4bd1e7={'count':0x0,'rows':[]};var _0x117a4e=_[_0x8176('0x41')](db[_0x8176('0x42')][_0x8176('0x43')],function(_0xab08b0){return{'name':_0xab08b0[_0x8176('0x44')],'type':_0xab08b0[_0x8176('0x45')][_0x8176('0x46')]};});_0x5264f5[_0x8176('0x47')]=_[_0x8176('0x41')](_0x117a4e,_0x8176('0x3e'));_0x5264f5[_0x8176('0x48')]=_['keys'](_0x3b4799[_0x8176('0x48')]);_0x5264f5['filters']=_[_0x8176('0x49')](_0x5264f5[_0x8176('0x47')],_0x5264f5['query']);_0x1ed21d[_0x8176('0x4a')]=_[_0x8176('0x49')](_0x5264f5[_0x8176('0x47')],qs[_0x8176('0x4b')](_0x3b4799[_0x8176('0x48')][_0x8176('0x4b')]));_0x1ed21d[_0x8176('0x4a')]=_0x1ed21d['attributes'][_0x8176('0x4c')]?_0x1ed21d[_0x8176('0x4a')]:_0x5264f5[_0x8176('0x47')];if(!_0x3b4799[_0x8176('0x48')][_0x8176('0x4d')](_0x8176('0x4e'))){_0x1ed21d[_0x8176('0x32')]=qs['limit'](_0x3b4799[_0x8176('0x48')][_0x8176('0x32')]);_0x1ed21d[_0x8176('0x34')]=qs['offset'](_0x3b4799[_0x8176('0x48')][_0x8176('0x34')]);}_0x1ed21d['order']=qs[_0x8176('0x4f')](_0x3b4799[_0x8176('0x48')][_0x8176('0x4f')]);_0x1ed21d[_0x8176('0x50')]=qs[_0x8176('0x51')](_[_0x8176('0x52')](_0x3b4799['query'],_0x5264f5[_0x8176('0x51')]),_0x117a4e);if(_0x3b4799[_0x8176('0x48')][_0x8176('0x53')]){_0x1ed21d['where']=_[_0x8176('0x54')](_0x1ed21d[_0x8176('0x50')],{'$or':_[_0x8176('0x41')](_0x117a4e,function(_0x26a16a){if(_0x26a16a[_0x8176('0x45')]!==_0x8176('0x55')){var _0x1f727c={};_0x1f727c[_0x26a16a['name']]={'$like':'%'+_0x3b4799[_0x8176('0x48')][_0x8176('0x53')]+'%'};return _0x1f727c;}})});}_0x1ed21d=_[_0x8176('0x54')]({},_0x1ed21d,_0x3b4799['options']);var _0x200546={'where':_0x1ed21d[_0x8176('0x50')]};return db[_0x8176('0x42')]['count'](_0x200546)[_0x8176('0x3b')](function(_0x2c0870){_0x4bd1e7[_0x8176('0x33')]=_0x2c0870;if(_0x3b4799[_0x8176('0x48')][_0x8176('0x56')]){_0x1ed21d[_0x8176('0x57')]=[{'all':!![]}];}return db[_0x8176('0x42')][_0x8176('0x58')](_0x1ed21d);})[_0x8176('0x3b')](function(_0x4a5c4c){_0x4bd1e7[_0x8176('0x59')]=_0x4a5c4c;return _0x4bd1e7;})['then'](respondWithFilteredResult(_0x1e9ba0,_0x1ed21d))[_0x8176('0x5a')](handleError(_0x1e9ba0,null));};exports[_0x8176('0x5b')]=function(_0x5df545,_0x190781){var _0x57ef2f={'raw':!![],'where':{'id':_0x5df545['params']['id']}},_0x173a09={};_0x173a09[_0x8176('0x47')]=_['keys'](db[_0x8176('0x42')][_0x8176('0x43')]);_0x173a09['query']=_['keys'](_0x5df545[_0x8176('0x48')]);_0x173a09[_0x8176('0x51')]=_[_0x8176('0x49')](_0x173a09[_0x8176('0x47')],_0x173a09[_0x8176('0x48')]);_0x57ef2f['attributes']=_[_0x8176('0x49')](_0x173a09[_0x8176('0x47')],qs[_0x8176('0x4b')](_0x5df545[_0x8176('0x48')][_0x8176('0x4b')]));_0x57ef2f['attributes']=_0x57ef2f[_0x8176('0x4a')]['length']?_0x57ef2f[_0x8176('0x4a')]:_0x173a09[_0x8176('0x47')];if(_0x5df545[_0x8176('0x48')]['includeAll']){_0x57ef2f[_0x8176('0x57')]=[{'all':!![]}];}_0x57ef2f=_[_0x8176('0x54')]({},_0x57ef2f,_0x5df545[_0x8176('0x5c')]);return db[_0x8176('0x42')][_0x8176('0x5d')](_0x57ef2f)[_0x8176('0x3b')](handleEntityNotFound(_0x190781,null))['then'](respondWithResult(_0x190781,null))[_0x8176('0x5a')](handleError(_0x190781,null));};exports[_0x8176('0x5e')]=function(_0x128eac,_0x4e6ca6){if(_0x128eac[_0x8176('0x5f')]['id']){delete _0x128eac[_0x8176('0x5f')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x128eac[_0x8176('0x60')]['id']}})[_0x8176('0x3b')](handleEntityNotFound(_0x4e6ca6,null))[_0x8176('0x3b')](saveUpdates(_0x128eac[_0x8176('0x5f')],null))[_0x8176('0x3b')](respondWithResult(_0x4e6ca6,null))[_0x8176('0x5a')](handleError(_0x4e6ca6,null));};exports[_0x8176('0x3a')]=function(_0x1d048b,_0x4c3560){return db['FaxMessage'][_0x8176('0x5d')]({'where':{'id':_0x1d048b['params']['id']}})[_0x8176('0x3b')](handleEntityNotFound(_0x4c3560,null))[_0x8176('0x3b')](removeEntity(_0x4c3560,null))[_0x8176('0x5a')](handleError(_0x4c3560,null));};exports[_0x8176('0x61')]=function(_0x2452a4,_0x547dab){return db['FaxMessage'][_0x8176('0x61')]()['then'](respondWithResult(_0x547dab,null))[_0x8176('0x5a')](handleError(_0x547dab,null));};var interaction_log=require(_0x8176('0x16'))(_0x8176('0x62'));exports[_0x8176('0x63')]=function(_0x1e6160,_0x5806f3,_0x3ea082){var _0x150ddc={'agent':{},'channel':_0x8176('0x64')};if(_0x1e6160[_0x8176('0x5f')]['id']){delete _0x1e6160[_0x8176('0x5f')]['id'];}_0x1e6160[_0x8176('0x5f')][_0x8176('0x65')]=!![];_0x1e6160[_0x8176('0x5f')][_0x8176('0x66')]=moment()['format'](_0x8176('0x67'));_0x1e6160[_0x8176('0x5f')][_0x8176('0x68')]=_0x1e6160[_0x8176('0x5f')][_0x8176('0x68')]||_0x1e6160['user']['id'];_0x150ddc['agent']['id']=_0x1e6160[_0x8176('0x5f')][_0x8176('0x68')];return db[_0x8176('0x42')][_0x8176('0x5d')]({'where':{'id':_0x1e6160['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5806f3,null))[_0x8176('0x3b')](saveUpdates(_0x1e6160[_0x8176('0x5f')],null))[_0x8176('0x3b')](function(_0x160da0){if(_0x160da0){_0x150ddc['message']=_0x160da0['get']({'plain':!![]});return db[_0x8176('0x69')][_0x8176('0x5d')]({'where':{'id':_0x160da0['FaxInteractionId']}});}return null;})[_0x8176('0x3b')](handleEntityNotFound(_0x5806f3,null))[_0x8176('0x3b')](function(_0x23e683){if(_0x23e683){return _0x23e683['update']({'UserId':_0x1e6160['body'][_0x8176('0x68')],'read1stAt':_[_0x8176('0x6a')](_0x23e683[_0x8176('0x6b')])?moment()[_0x8176('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x8176('0x3b')](function(_0x47a9eb){if(_0x47a9eb){_0x150ddc[_0x8176('0x6d')]=_0x47a9eb[_0x8176('0x6e')]({'plain':!![]});interaction_log[_0x8176('0x2c')](_0x8176('0x6f'),_0x1e6160[_0x8176('0x70')]['id'],_0x1e6160[_0x8176('0x70')][_0x8176('0x3e')],_0x1e6160['user'][_0x8176('0x71')],_0x150ddc[_0x8176('0x6d')]['id'],_0x1e6160[_0x8176('0x5f')]?JSON['stringify'](_0x1e6160[_0x8176('0x5f')]):'null');return respondWithRpcPromise(_0x8176('0x72'),_0x8176('0x73'),_0x150ddc);}return null;})['then'](function(_0xa916ee){var _0x4067bf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa916ee[_0x8176('0x2b')][_0x8176('0x74')];return db[_0x8176('0x75')][_0x8176('0x48')](_0x4067bf,{'type':db[_0x8176('0x76')][_0x8176('0x77')]['SELECT'],'raw':!![]})[_0x8176('0x3b')](function(_0x1a4404){return _0x1a4404;});})[_0x8176('0x3b')](function(_0x35ea73){if(_0x35ea73){_0x150ddc[_0x8176('0x2b')][_0x8176('0x78')]=_0x35ea73[0x0];if(!_0x1e6160[_0x8176('0x5f')][_0x8176('0x68')])return;return db[_0x8176('0x79')][_0x8176('0x5d')]({'where':{'id':_0x1e6160[_0x8176('0x5f')][_0x8176('0x68')],'role':_0x8176('0x7a')},'attributes':['id','name','fullname',_0x8176('0x7b'),_0x8176('0x7c')],'raw':!![]});}return null;})[_0x8176('0x3b')](function(_0x29eb2a){if(!_0x29eb2a)return null;_0x150ddc['message']['agent']=_0x29eb2a;return _0x150ddc;})[_0x8176('0x3b')](function(_0x2a787a){if(_0x2a787a){if(_0x1e6160['body'][_0x8176('0x7d')]){_0x150ddc[_0x8176('0x2b')]['interface']=util['format'](_0x8176('0x7e'),_0x1e6160[_0x8176('0x70')][_0x8176('0x3e')]);_0x150ddc[_0x8176('0x2b')][_0x8176('0x7f')]=_0x150ddc[_0x8176('0x7f')];_0x150ddc['message'][_0x8176('0x80')]=_0x150ddc[_0x8176('0x7f')];_0x150ddc['message'][_0x8176('0x81')]=_0x8176('0x63');return respondWithRpcPromise(_0x8176('0x82'),_0x8176('0x82'),{'event':'acceptmessage','message':_0x150ddc[_0x8176('0x2b')]},client9002)[_0x8176('0x3b')](function(){return _0x150ddc;});}return _0x150ddc;}return null;})['then'](respondWithResult(_0x5806f3,null))['catch'](handleError(_0x5806f3,null));};var interaction_log=require(_0x8176('0x16'))(_0x8176('0x62'));exports['reject']=function(_0x9f1432,_0x2f29c8,_0x102d6e){var _0x58f3e2={'agent':{},'channel':'fax'};if(_0x9f1432['body']['id']){delete _0x9f1432[_0x8176('0x5f')]['id'];}_0x9f1432[_0x8176('0x5f')]['UserId']=_0x9f1432[_0x8176('0x5f')][_0x8176('0x68')]||_0x9f1432[_0x8176('0x70')]['id'];_0x58f3e2[_0x8176('0x7a')]['id']=_0x9f1432[_0x8176('0x5f')][_0x8176('0x68')];return db[_0x8176('0x42')][_0x8176('0x5d')]({'where':{'id':_0x9f1432['params']['id'],'UserId':null}})[_0x8176('0x3b')](handleEntityNotFound(_0x2f29c8,null))[_0x8176('0x3b')](function(_0x191393){if(_0x191393){_0x58f3e2[_0x8176('0x2b')]=_0x191393['get']({'plain':!![]});return db[_0x8176('0x69')][_0x8176('0x5d')]({'where':{'id':_0x191393[_0x8176('0x83')]}});}return null;})[_0x8176('0x3b')](handleEntityNotFound(_0x2f29c8,null))[_0x8176('0x3b')](function(_0x552d88){if(_0x552d88){_0x58f3e2[_0x8176('0x6d')]=_0x552d88[_0x8176('0x6e')]({'plain':!![]});interaction_log['info'](_0x8176('0x84'),_0x9f1432['user']['id'],_0x9f1432[_0x8176('0x70')][_0x8176('0x3e')],_0x9f1432[_0x8176('0x70')]['role'],_0x58f3e2[_0x8176('0x6d')]['id'],_0x9f1432['body']?JSON['stringify'](_0x9f1432[_0x8176('0x5f')]):_0x8176('0x85'));return respondWithRpcPromise(_0x8176('0x86'),_0x8176('0x87'),_0x58f3e2);}return null;})[_0x8176('0x3b')](function(_0x3c74f7){var _0x573424=_0x8176('0x88')+_0x3c74f7[_0x8176('0x2b')][_0x8176('0x74')];return db[_0x8176('0x75')][_0x8176('0x48')](_0x573424,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x8176('0x3b')](function(_0x5e908f){return _0x5e908f;});})[_0x8176('0x3b')](function(_0x5e6765){if(_0x5e6765){_0x58f3e2[_0x8176('0x2b')]['contact']=_0x5e6765[0x0];if(!_0x9f1432[_0x8176('0x5f')][_0x8176('0x68')])return;return db['User'][_0x8176('0x5d')]({'where':{'id':_0x9f1432['body'][_0x8176('0x68')],'role':'agent'},'attributes':['id','name',_0x8176('0x89'),_0x8176('0x7b'),_0x8176('0x7c')],'raw':!![]});}return null;})[_0x8176('0x3b')](function(_0x4563ba){if(!_0x4563ba)return null;_0x58f3e2[_0x8176('0x2b')][_0x8176('0x7a')]=_0x4563ba;return _0x58f3e2;})[_0x8176('0x3b')](function(_0x582daa){if(_0x582daa){_0x582daa[_0x8176('0x2b')][_0x8176('0x8a')]=util[_0x8176('0x6c')]('SIP/%s',_0x9f1432[_0x8176('0x70')][_0x8176('0x3e')]);_0x582daa[_0x8176('0x2b')][_0x8176('0x7f')]=_0x58f3e2[_0x8176('0x7f')];_0x582daa[_0x8176('0x2b')][_0x8176('0x80')]=_0x58f3e2[_0x8176('0x7f')];_0x582daa[_0x8176('0x2b')][_0x8176('0x81')]=_0x8176('0x38');respondWithRpcPromise(_0x8176('0x82'),_0x8176('0x82'),{'event':_0x8176('0x8b'),'message':_0x582daa['message']},client9002);return _0x58f3e2;}return null;})[_0x8176('0x3b')](respondWithResult(_0x2f29c8,null))[_0x8176('0x5a')](handleError(_0x2f29c8,null));};exports['create']=function(_0x37b2ab,_0x50f47b){var _0x5db4bf;return db[_0x8176('0x42')][_0x8176('0x8c')](_0x37b2ab['body'],{})[_0x8176('0x3b')](function(_0x2ae262){_0x5db4bf=_0x2ae262;return db['CmContact']['findOne']({'where':{'id':_0x5db4bf['ContactId']}});})[_0x8176('0x3b')](function(_0x474d2b){if(_['isNil'](_0x474d2b)){return;}else{_0x5db4bf[_0x8176('0x64')]=_0x474d2b['fax'];return db['Attachment'][_0x8176('0x8d')]({'where':{'id':_0x5db4bf['AttachmentId']}});}})[_0x8176('0x3b')](function(_0x446a21){return respondWithRpcPromise(_0x8176('0x8e'),_0x8176('0x8e'),{'FaxAccountId':_['isNil'](_0x37b2ab[_0x8176('0x5f')])?undefined:_0x37b2ab[_0x8176('0x5f')][_0x8176('0x8f')],'path':_[_0x8176('0x6a')](_0x446a21)?undefined:util[_0x8176('0x6c')](_0x8176('0x90'),_0x446a21[_0x8176('0x91')]),'fax':_[_0x8176('0x6a')](_0x5db4bf[_0x8176('0x64')])?undefined:_0x5db4bf[_0x8176('0x64')],'AttachmentId':_0x5db4bf[_0x8176('0x92')]},client9002);})[_0x8176('0x3b')](respondWithResult(_0x50f47b,0xc9))[_0x8176('0x5a')](handleError(_0x50f47b,null));};exports[_0x8176('0x93')]=function(_0xa71f58,_0x557c7b){var _0x9a61fb=path[_0x8176('0x94')](config[_0x8176('0x95')],_0x8176('0x96'),_0x8176('0x97'),_0x8176('0x98'));return db[_0x8176('0x42')]['find']({'where':{'id':_0xa71f58[_0x8176('0x60')]['id']},'include':[{'model':db['Attachment'],'as':_0x8176('0x99')}]})[_0x8176('0x3b')](handleEntityNotFound(_0x557c7b,null))[_0x8176('0x3b')](function(_0x209472){if(_0x209472){return _0x557c7b[_0x8176('0x93')](path[_0x8176('0x94')](_0x9a61fb,_0x209472[_0x8176('0x99')][_0x8176('0x91')]));}})[_0x8176('0x5a')](handleError(_0x557c7b,null));}; \ No newline at end of file +var _0xa12b=['event','accept','EventManager','acceptmessage','../../config/logger','get','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','QueryTypes','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','sendStatus','name','send','map','FaxMessage','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','pick','filter','where','options','includeAll','include','findAll','rows','show','params','keys','merge','body','find','describe','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','FaxInteraction','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel'];(function(_0x3319d3,_0x283cc2){var _0x893fc2=function(_0x24e735){while(--_0x24e735){_0x3319d3['push'](_0x3319d3['shift']());}};_0x893fc2(++_0x283cc2);}(_0xa12b,0x1c0));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xba12('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba12('0x1'));var jsonpatch=require(_0xba12('0x2'));var rp=require(_0xba12('0x3'));var moment=require('moment');var BPromise=require(_0xba12('0x4'));var Mustache=require(_0xba12('0x5'));var util=require(_0xba12('0x6'));var path=require(_0xba12('0x7'));var sox=require(_0xba12('0x8'));var csv=require(_0xba12('0x9'));var ejs=require(_0xba12('0xa'));var fs=require('fs');var fs_extra=require(_0xba12('0xb'));var _=require(_0xba12('0xc'));var squel=require(_0xba12('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba12('0x9'));var querystring=require(_0xba12('0xe'));var Papa=require('papaparse');var Redis=require(_0xba12('0xf'));var authService=require(_0xba12('0x10'));var qs=require(_0xba12('0x11'));var as=require(_0xba12('0x12'));var hardwareService=require(_0xba12('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xba12('0x14'));var config=require(_0xba12('0x15'));var licenseUtil=require(_0xba12('0x16'));var db=require(_0xba12('0x17'))['db'];config[_0xba12('0x18')]=_[_0xba12('0x19')](config[_0xba12('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xba12('0x1a'))(new Redis(config[_0xba12('0x18')]));require('./faxMessage.socket')[_0xba12('0x1b')](socket);var jayson=require(_0xba12('0x1c'));var client=jayson[_0xba12('0x1d')][_0xba12('0x1e')]({'port':0x232c});var client9002=jayson[_0xba12('0x1d')][_0xba12('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x331d11,_0x101bb7,_0x3e0177,_0x51bef3){return new BPromise(function(_0x18fae7,_0x3de302){var _0x4a22e7=_0x51bef3||client;return _0x4a22e7['request'](_0x331d11,_0x3e0177)[_0xba12('0x1f')](function(_0x1d464d){logger[_0xba12('0x20')](_0xba12('0x21'),_0x101bb7,_0xba12('0x22'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x101bb7,_0xba12('0x22'),JSON[_0xba12('0x23')](_0x1d464d));if(_0x1d464d[_0xba12('0x24')]){if(_0x1d464d['error'][_0xba12('0x25')]===0x1f4){logger[_0xba12('0x24')](_0xba12('0x21'),_0x101bb7,_0x1d464d[_0xba12('0x24')][_0xba12('0x26')]);return _0x3de302(_0x1d464d['error'][_0xba12('0x26')]);}logger[_0xba12('0x24')](_0xba12('0x21'),_0x101bb7,_0x1d464d['error']['message']);return _0x18fae7(_0x1d464d['error'][_0xba12('0x26')]);}else{logger[_0xba12('0x20')]('FaxMessage,\x20%s,\x20%s',_0x101bb7,_0xba12('0x22'));_0x18fae7(_0x1d464d[_0xba12('0x27')]['message']);}})[_0xba12('0x28')](function(_0x483f17){logger[_0xba12('0x24')](_0xba12('0x21'),_0x101bb7,_0x483f17);_0x3de302(_0x483f17);});});}function respondWithStatusCode(_0x4d9aab,_0x256254){_0x256254=_0x256254||0xcc;return function(_0x14d39b){if(_0x14d39b){return _0x4d9aab['sendStatus'](_0x256254);}return _0x4d9aab[_0xba12('0x29')](_0x256254)[_0xba12('0x2a')]();};}function respondWithResult(_0x2919c9,_0x331aa5){_0x331aa5=_0x331aa5||0xc8;return function(_0x351125){if(_0x351125){return _0x2919c9[_0xba12('0x29')](_0x331aa5)[_0xba12('0x2b')](_0x351125);}};}function respondWithFilteredResult(_0x18e008,_0x5256f0){return function(_0x356716){if(_0x356716){var _0x4aedaf=typeof _0x5256f0['offset']===_0xba12('0x2c')&&typeof _0x5256f0[_0xba12('0x2d')]===_0xba12('0x2c');var _0x444ba7=_0x356716[_0xba12('0x2e')];var _0x275a3f=_0x4aedaf?0x0:_0x5256f0[_0xba12('0x2f')];var _0x588e5a=_0x4aedaf?_0x356716[_0xba12('0x2e')]:_0x5256f0[_0xba12('0x2f')]+_0x5256f0['limit'];var _0x32f49b;if(_0x588e5a>=_0x444ba7){_0x588e5a=_0x444ba7;_0x32f49b=0xc8;}else{_0x32f49b=0xce;}_0x18e008[_0xba12('0x29')](_0x32f49b);return _0x18e008[_0xba12('0x30')]('Content-Range',_0x275a3f+'-'+_0x588e5a+'/'+_0x444ba7)['json'](_0x356716);}return null;};}function patchUpdates(_0x22cce5){return function(_0x4fc73e){try{jsonpatch[_0xba12('0x31')](_0x4fc73e,_0x22cce5,!![]);}catch(_0x286a81){return BPromise[_0xba12('0x32')](_0x286a81);}return _0x4fc73e[_0xba12('0x33')]();};}function saveUpdates(_0x4c7ddb,_0x3f2204){return function(_0x5f346f){if(_0x5f346f){return _0x5f346f[_0xba12('0x34')](_0x4c7ddb)[_0xba12('0x1f')](function(_0x1e62bf){return _0x1e62bf;});}return null;};}function removeEntity(_0x5885d6,_0x30507a){return function(_0x30d9ff){if(_0x30d9ff){return _0x30d9ff['destroy']()[_0xba12('0x1f')](function(){_0x5885d6[_0xba12('0x29')](0xcc)[_0xba12('0x2a')]();});}};}function handleEntityNotFound(_0x5910d0,_0x121d58){return function(_0x4d1b3c){if(!_0x4d1b3c){_0x5910d0[_0xba12('0x35')](0x194);}return _0x4d1b3c;};}function handleError(_0x4abd4d,_0x3c571c){_0x3c571c=_0x3c571c||0x1f4;return function(_0x4c5639){logger[_0xba12('0x24')](_0x4c5639['stack']);if(_0x4c5639[_0xba12('0x36')]){delete _0x4c5639[_0xba12('0x36')];}_0x4abd4d['status'](_0x3c571c)[_0xba12('0x37')](_0x4c5639);};}exports['index']=function(_0x37dd3e,_0x3dac08){var _0xf78346={},_0x263137={},_0x60ab62={'count':0x0,'rows':[]};var _0x3bac5c=_[_0xba12('0x38')](db[_0xba12('0x39')][_0xba12('0x3a')],function(_0x48ee95){return{'name':_0x48ee95[_0xba12('0x3b')],'type':_0x48ee95[_0xba12('0x3c')]['key']};});_0x263137[_0xba12('0x3d')]=_[_0xba12('0x38')](_0x3bac5c,_0xba12('0x36'));_0x263137[_0xba12('0x3e')]=_['keys'](_0x37dd3e[_0xba12('0x3e')]);_0x263137[_0xba12('0x3f')]=_['intersection'](_0x263137[_0xba12('0x3d')],_0x263137[_0xba12('0x3e')]);_0xf78346['attributes']=_[_0xba12('0x40')](_0x263137[_0xba12('0x3d')],qs[_0xba12('0x41')](_0x37dd3e[_0xba12('0x3e')][_0xba12('0x41')]));_0xf78346['attributes']=_0xf78346[_0xba12('0x42')]['length']?_0xf78346[_0xba12('0x42')]:_0x263137[_0xba12('0x3d')];if(!_0x37dd3e[_0xba12('0x3e')][_0xba12('0x43')]('nolimit')){_0xf78346['limit']=qs['limit'](_0x37dd3e[_0xba12('0x3e')]['limit']);_0xf78346[_0xba12('0x2f')]=qs[_0xba12('0x2f')](_0x37dd3e[_0xba12('0x3e')]['offset']);}_0xf78346[_0xba12('0x44')]=qs['sort'](_0x37dd3e[_0xba12('0x3e')]['sort']);_0xf78346['where']=qs['filters'](_[_0xba12('0x45')](_0x37dd3e[_0xba12('0x3e')],_0x263137[_0xba12('0x3f')]),_0x3bac5c);if(_0x37dd3e['query'][_0xba12('0x46')]){_0xf78346[_0xba12('0x47')]=_['merge'](_0xf78346['where'],{'$or':_['map'](_0x3bac5c,function(_0x558298){if(_0x558298[_0xba12('0x3c')]!=='VIRTUAL'){var _0x155c26={};_0x155c26[_0x558298[_0xba12('0x36')]]={'$like':'%'+_0x37dd3e['query']['filter']+'%'};return _0x155c26;}})});}_0xf78346=_['merge']({},_0xf78346,_0x37dd3e[_0xba12('0x48')]);var _0x4db105={'where':_0xf78346[_0xba12('0x47')]};return db[_0xba12('0x39')][_0xba12('0x2e')](_0x4db105)[_0xba12('0x1f')](function(_0x566924){_0x60ab62[_0xba12('0x2e')]=_0x566924;if(_0x37dd3e[_0xba12('0x3e')][_0xba12('0x49')]){_0xf78346[_0xba12('0x4a')]=[{'all':!![]}];}return db[_0xba12('0x39')][_0xba12('0x4b')](_0xf78346);})[_0xba12('0x1f')](function(_0x62dd71){_0x60ab62[_0xba12('0x4c')]=_0x62dd71;return _0x60ab62;})[_0xba12('0x1f')](respondWithFilteredResult(_0x3dac08,_0xf78346))[_0xba12('0x28')](handleError(_0x3dac08,null));};exports[_0xba12('0x4d')]=function(_0x53db57,_0x35b8ce){var _0x347209={'raw':!![],'where':{'id':_0x53db57[_0xba12('0x4e')]['id']}},_0xc5e07a={};_0xc5e07a[_0xba12('0x3d')]=_[_0xba12('0x4f')](db[_0xba12('0x39')][_0xba12('0x3a')]);_0xc5e07a[_0xba12('0x3e')]=_[_0xba12('0x4f')](_0x53db57[_0xba12('0x3e')]);_0xc5e07a['filters']=_[_0xba12('0x40')](_0xc5e07a[_0xba12('0x3d')],_0xc5e07a[_0xba12('0x3e')]);_0x347209[_0xba12('0x42')]=_[_0xba12('0x40')](_0xc5e07a[_0xba12('0x3d')],qs[_0xba12('0x41')](_0x53db57[_0xba12('0x3e')][_0xba12('0x41')]));_0x347209[_0xba12('0x42')]=_0x347209[_0xba12('0x42')]['length']?_0x347209[_0xba12('0x42')]:_0xc5e07a[_0xba12('0x3d')];if(_0x53db57[_0xba12('0x3e')][_0xba12('0x49')]){_0x347209[_0xba12('0x4a')]=[{'all':!![]}];}_0x347209=_[_0xba12('0x50')]({},_0x347209,_0x53db57[_0xba12('0x48')]);return db[_0xba12('0x39')]['find'](_0x347209)[_0xba12('0x1f')](handleEntityNotFound(_0x35b8ce,null))[_0xba12('0x1f')](respondWithResult(_0x35b8ce,null))['catch'](handleError(_0x35b8ce,null));};exports['update']=function(_0x47e076,_0x28e9b6){if(_0x47e076[_0xba12('0x51')]['id']){delete _0x47e076['body']['id'];}return db['FaxMessage'][_0xba12('0x52')]({'where':{'id':_0x47e076['params']['id']}})[_0xba12('0x1f')](handleEntityNotFound(_0x28e9b6,null))[_0xba12('0x1f')](saveUpdates(_0x47e076['body'],null))[_0xba12('0x1f')](respondWithResult(_0x28e9b6,null))[_0xba12('0x28')](handleError(_0x28e9b6,null));};exports['destroy']=function(_0x3279ac,_0xb8470b){return db['FaxMessage'][_0xba12('0x52')]({'where':{'id':_0x3279ac[_0xba12('0x4e')]['id']}})['then'](handleEntityNotFound(_0xb8470b,null))[_0xba12('0x1f')](removeEntity(_0xb8470b,null))[_0xba12('0x28')](handleError(_0xb8470b,null));};exports[_0xba12('0x53')]=function(_0x362d1b,_0x4fb66a){return db[_0xba12('0x39')][_0xba12('0x53')]()['then'](respondWithResult(_0x4fb66a,null))[_0xba12('0x28')](handleError(_0x4fb66a,null));};var interaction_log=require('../../config/logger')(_0xba12('0x54'));exports['accept']=function(_0x5c5329,_0x305f89,_0x17dbdd){var _0x58288e={'agent':{},'channel':_0xba12('0x55')};if(_0x5c5329['body']['id']){delete _0x5c5329[_0xba12('0x51')]['id'];}_0x5c5329[_0xba12('0x51')][_0xba12('0x56')]=!![];_0x5c5329[_0xba12('0x51')][_0xba12('0x57')]=moment()['format'](_0xba12('0x58'));_0x5c5329[_0xba12('0x51')]['UserId']=_0x5c5329['body'][_0xba12('0x59')]||_0x5c5329['user']['id'];_0x58288e[_0xba12('0x5a')]['id']=_0x5c5329[_0xba12('0x51')][_0xba12('0x59')];return db[_0xba12('0x39')]['find']({'where':{'id':_0x5c5329['params']['id'],'UserId':null}})[_0xba12('0x1f')](handleEntityNotFound(_0x305f89,null))[_0xba12('0x1f')](saveUpdates(_0x5c5329[_0xba12('0x51')],null))[_0xba12('0x1f')](function(_0x1a2ed3){if(_0x1a2ed3){_0x58288e[_0xba12('0x26')]=_0x1a2ed3['get']({'plain':!![]});return db[_0xba12('0x5b')][_0xba12('0x52')]({'where':{'id':_0x1a2ed3['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x305f89,null))[_0xba12('0x1f')](function(_0x546e81){if(_0x546e81){return _0x546e81[_0xba12('0x34')]({'UserId':_0x5c5329['body'][_0xba12('0x59')],'read1stAt':_[_0xba12('0x5c')](_0x546e81[_0xba12('0x5d')])?moment()[_0xba12('0x5e')](_0xba12('0x58')):undefined});}return null;})[_0xba12('0x1f')](function(_0x5794ec){if(_0x5794ec){_0x58288e[_0xba12('0x5f')]=_0x5794ec['get']({'plain':!![]});interaction_log['info'](_0xba12('0x60'),_0x5c5329['user']['id'],_0x5c5329[_0xba12('0x61')]['name'],_0x5c5329['user']['role'],_0x58288e['interaction']['id'],_0x5c5329['body']?JSON['stringify'](_0x5c5329[_0xba12('0x51')]):_0xba12('0x62'));return respondWithRpcPromise(_0xba12('0x63'),_0xba12('0x64'),_0x58288e);}return null;})[_0xba12('0x1f')](function(_0x205c54){var _0x1babde=_0xba12('0x65')+_0x205c54[_0xba12('0x26')]['ContactId'];return db[_0xba12('0x66')][_0xba12('0x3e')](_0x1babde,{'type':db['Sequelize']['QueryTypes'][_0xba12('0x67')],'raw':!![]})['then'](function(_0x4d7f66){return _0x4d7f66;});})[_0xba12('0x1f')](function(_0x50a49b){if(_0x50a49b){_0x58288e[_0xba12('0x26')][_0xba12('0x68')]=_0x50a49b[0x0];if(!_0x5c5329[_0xba12('0x51')][_0xba12('0x59')])return;return db[_0xba12('0x69')]['find']({'where':{'id':_0x5c5329[_0xba12('0x51')][_0xba12('0x59')],'role':_0xba12('0x5a')},'attributes':['id','name',_0xba12('0x6a'),_0xba12('0x6b'),'internal'],'raw':!![]});}return null;})['then'](function(_0x18e391){if(!_0x18e391)return null;_0x58288e['message'][_0xba12('0x5a')]=_0x18e391;return _0x58288e;})[_0xba12('0x1f')](function(_0x1afa12){if(_0x1afa12){if(_0x5c5329[_0xba12('0x51')][_0xba12('0x6c')]){_0x58288e[_0xba12('0x26')][_0xba12('0x6d')]=util[_0xba12('0x5e')](_0xba12('0x6e'),_0x5c5329['user'][_0xba12('0x36')]);_0x58288e[_0xba12('0x26')][_0xba12('0x6f')]=_0x58288e[_0xba12('0x6f')];_0x58288e[_0xba12('0x26')]['motionChannel']=_0x58288e['channel'];_0x58288e[_0xba12('0x26')][_0xba12('0x70')]=_0xba12('0x71');return respondWithRpcPromise('EventManager',_0xba12('0x72'),{'event':_0xba12('0x73'),'message':_0x58288e['message']},client9002)[_0xba12('0x1f')](function(){return _0x58288e;});}return _0x58288e;}return null;})[_0xba12('0x1f')](respondWithResult(_0x305f89,null))['catch'](handleError(_0x305f89,null));};var interaction_log=require(_0xba12('0x74'))(_0xba12('0x54'));exports[_0xba12('0x32')]=function(_0x3826ce,_0x723bca,_0x30c146){var _0x2092f0={'agent':{},'channel':_0xba12('0x55')};if(_0x3826ce[_0xba12('0x51')]['id']){delete _0x3826ce[_0xba12('0x51')]['id'];}_0x3826ce[_0xba12('0x51')][_0xba12('0x59')]=_0x3826ce[_0xba12('0x51')]['UserId']||_0x3826ce['user']['id'];_0x2092f0['agent']['id']=_0x3826ce['body'][_0xba12('0x59')];return db['FaxMessage'][_0xba12('0x52')]({'where':{'id':_0x3826ce[_0xba12('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x723bca,null))[_0xba12('0x1f')](function(_0x33ec2d){if(_0x33ec2d){_0x2092f0[_0xba12('0x26')]=_0x33ec2d[_0xba12('0x75')]({'plain':!![]});return db[_0xba12('0x5b')][_0xba12('0x52')]({'where':{'id':_0x33ec2d[_0xba12('0x76')]}});}return null;})['then'](handleEntityNotFound(_0x723bca,null))[_0xba12('0x1f')](function(_0xf0a1bb){if(_0xf0a1bb){_0x2092f0['interaction']=_0xf0a1bb[_0xba12('0x75')]({'plain':!![]});interaction_log[_0xba12('0x20')](_0xba12('0x77'),_0x3826ce[_0xba12('0x61')]['id'],_0x3826ce[_0xba12('0x61')][_0xba12('0x36')],_0x3826ce[_0xba12('0x61')][_0xba12('0x78')],_0x2092f0[_0xba12('0x5f')]['id'],_0x3826ce[_0xba12('0x51')]?JSON[_0xba12('0x23')](_0x3826ce[_0xba12('0x51')]):_0xba12('0x62'));return respondWithRpcPromise(_0xba12('0x79'),_0xba12('0x7a'),_0x2092f0);}return null;})['then'](function(_0x38b887){var _0x1bd71c=_0xba12('0x65')+_0x38b887[_0xba12('0x26')][_0xba12('0x7b')];return db[_0xba12('0x66')]['query'](_0x1bd71c,{'type':db['Sequelize'][_0xba12('0x7c')][_0xba12('0x67')],'raw':!![]})[_0xba12('0x1f')](function(_0x31aec6){return _0x31aec6;});})[_0xba12('0x1f')](function(_0x3ac50e){if(_0x3ac50e){_0x2092f0[_0xba12('0x26')][_0xba12('0x68')]=_0x3ac50e[0x0];if(!_0x3826ce[_0xba12('0x51')][_0xba12('0x59')])return;return db[_0xba12('0x69')]['find']({'where':{'id':_0x3826ce['body'][_0xba12('0x59')],'role':'agent'},'attributes':['id',_0xba12('0x36'),_0xba12('0x6a'),_0xba12('0x6b'),'internal'],'raw':!![]});}return null;})[_0xba12('0x1f')](function(_0x4a5437){if(!_0x4a5437)return null;_0x2092f0[_0xba12('0x26')][_0xba12('0x5a')]=_0x4a5437;return _0x2092f0;})['then'](function(_0x74ae86){if(_0x74ae86){_0x74ae86[_0xba12('0x26')][_0xba12('0x6d')]=util['format'](_0xba12('0x6e'),_0x3826ce[_0xba12('0x61')]['name']);_0x74ae86[_0xba12('0x26')]['channel']=_0x2092f0[_0xba12('0x6f')];_0x74ae86[_0xba12('0x26')]['motionChannel']=_0x2092f0[_0xba12('0x6f')];_0x74ae86[_0xba12('0x26')][_0xba12('0x70')]=_0xba12('0x32');respondWithRpcPromise(_0xba12('0x72'),_0xba12('0x72'),{'event':_0xba12('0x7d'),'message':_0x74ae86[_0xba12('0x26')]},client9002);return _0x2092f0;}return null;})['then'](respondWithResult(_0x723bca,null))[_0xba12('0x28')](handleError(_0x723bca,null));};exports[_0xba12('0x7e')]=function(_0x34dd26,_0x2c0b94){var _0x4b4e3e;return db['FaxMessage']['create'](_0x34dd26['body'],{})[_0xba12('0x1f')](function(_0x271f2d){_0x4b4e3e=_0x271f2d;return db['CmContact'][_0xba12('0x7f')]({'where':{'id':_0x4b4e3e[_0xba12('0x7b')]}});})[_0xba12('0x1f')](function(_0x57f115){if(_[_0xba12('0x5c')](_0x57f115)){return;}else{_0x4b4e3e[_0xba12('0x55')]=_0x57f115[_0xba12('0x55')];return db[_0xba12('0x80')]['findOne']({'where':{'id':_0x4b4e3e[_0xba12('0x81')]}});}})[_0xba12('0x1f')](function(_0x33486d){return respondWithRpcPromise(_0xba12('0x82'),_0xba12('0x82'),{'FaxAccountId':_['isNil'](_0x34dd26[_0xba12('0x51')])?undefined:_0x34dd26['body'][_0xba12('0x83')],'path':_[_0xba12('0x5c')](_0x33486d)?undefined:util[_0xba12('0x5e')](_0xba12('0x84'),_0x33486d[_0xba12('0x85')]),'fax':_[_0xba12('0x5c')](_0x4b4e3e['fax'])?undefined:_0x4b4e3e[_0xba12('0x55')],'AttachmentId':_0x4b4e3e[_0xba12('0x81')]},client9002);})['then'](respondWithResult(_0x2c0b94,0xc9))[_0xba12('0x28')](handleError(_0x2c0b94,null));};exports[_0xba12('0x86')]=function(_0x5efcfe,_0x296784){var _0x22b8c9=path[_0xba12('0x87')](config[_0xba12('0x88')],_0xba12('0x89'),_0xba12('0x8a'),_0xba12('0x8b'));return db[_0xba12('0x39')][_0xba12('0x52')]({'where':{'id':_0x5efcfe[_0xba12('0x4e')]['id']},'include':[{'model':db[_0xba12('0x80')],'as':_0xba12('0x80')}]})['then'](handleEntityNotFound(_0x296784,null))[_0xba12('0x1f')](function(_0xc1af20){if(_0xc1af20){return _0x296784[_0xba12('0x86')](path[_0xba12('0x87')](_0x22b8c9,_0xc1af20[_0xba12('0x80')]['basename']));}})[_0xba12('0x28')](handleError(_0x296784,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 81f0b53..3369071 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 _0x0b3d=['FaxMessage','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x5a7b40,_0x585230){var _0x463559=function(_0x280fe4){while(--_0x280fe4){_0x5a7b40['push'](_0x5a7b40['shift']());}};_0x463559(++_0x585230);}(_0x0b3d,0x76));var _0xd0b3=function(_0x3dd3bc,_0x32950b){_0x3dd3bc=_0x3dd3bc-0x0;var _0x172373=_0x0b3d[_0x3dd3bc];return _0x172373;};'use strict';var EventEmitter=require(_0xd0b3('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xd0b3('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd0b3('0x2'),'afterUpdate':'update','afterDestroy':_0xd0b3('0x3')};function emitEvent(_0x4edc24){return function(_0x372f08,_0x50faaa,_0x371869){FaxMessageEvents[_0xd0b3('0x4')](_0x4edc24+':'+_0x372f08['id'],_0x372f08);FaxMessageEvents['emit'](_0x4edc24,_0x372f08);_0x371869(null);};}for(var e in events){if(events[_0xd0b3('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xd0b3('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0x9264=['hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','remove'];(function(_0x358eb5,_0x32ee66){var _0x102df6=function(_0x1c0ca7){while(--_0x1c0ca7){_0x358eb5['push'](_0x358eb5['shift']());}};_0x102df6(++_0x32ee66);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4926('0x0'));var FaxMessage=require(_0x4926('0x1'))['db'][_0x4926('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4926('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4926('0x4')};function emitEvent(_0x483fdd){return function(_0x49b167,_0x1a2246,_0x4e0848){FaxMessageEvents['emit'](_0x483fdd+':'+_0x49b167['id'],_0x49b167);FaxMessageEvents['emit'](_0x483fdd,_0x49b167);_0x4e0848(null);};}for(var e in events){if(events[_0x4926('0x5')](e)){var event=events[e];FaxMessage[_0x4926('0x6')](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 ee10e52..e994800 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 _0x8ded=['../../config/environment','./faxMessage.attributes','define','FaxMessage','body','FULLTEXT','models','get','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x8ded,0xb7));var _0xd8de=function(_0x106c50,_0x52c41e){_0x106c50=_0x106c50-0x0;var _0x51ccd8=_0x8ded[_0x106c50];return _0x51ccd8;};'use strict';var _=require(_0xd8de('0x0'));var util=require(_0xd8de('0x1'));var logger=require(_0xd8de('0x2'))('api');var moment=require(_0xd8de('0x3'));var BPromise=require('bluebird');var rp=require(_0xd8de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8de('0x5'));var config=require(_0xd8de('0x6'));var attributes=require(_0xd8de('0x7'));module['exports']=function(_0x58ad56,_0x96f4b8){return _0x58ad56[_0xd8de('0x8')](_0xd8de('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xd8de('0xa')],'type':_0xd8de('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cbfcc,_0x185e95,_0x569363){var _0x15aea1=_0x58ad56[_0xd8de('0xc')];var _0x1dffdb=_0x5cbfcc[_0xd8de('0xd')]({'plain':!![]});if(_0x1dffdb['direction'][_0xd8de('0xe')]()==='in'||_0x1dffdb['direction'][_0xd8de('0xe')]()===_0xd8de('0xf')&&!_0x1dffdb['secret']&&!_[_0xd8de('0x10')](_0x1dffdb[_0xd8de('0x11')])){_0x15aea1[_0xd8de('0x12')][_0xd8de('0x13')]({'where':{'id':_0x1dffdb[_0xd8de('0x14')]}})[_0xd8de('0x15')](function(_0x53f0ef){if(_0x53f0ef){_0x53f0ef[_0xd8de('0x16')]({'lastMsgAt':_0x1dffdb['createdAt'],'lastMsgDirection':_0x1dffdb['direction']['toLowerCase']()});}})[_0xd8de('0x17')](function(_0x4f0ee9){console[_0xd8de('0x18')](_0x4f0ee9);});}_0x569363();}},'charset':_0xd8de('0x19'),'collate':_0xd8de('0x1a')});}; \ No newline at end of file +var _0xffbc=['exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','findOne','FaxInteractionId','then','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes'];(function(_0x38c677,_0x5177c3){var _0x16452a=function(_0x1b5f9e){while(--_0x1b5f9e){_0x38c677['push'](_0x38c677['shift']());}};_0x16452a(++_0x5177c3);}(_0xffbc,0x1e4));var _0xcffb=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xffbc[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0xcffb('0x0'));var util=require(_0xcffb('0x1'));var logger=require(_0xcffb('0x2'))(_0xcffb('0x3'));var moment=require('moment');var BPromise=require(_0xcffb('0x4'));var rp=require(_0xcffb('0x5'));var fs=require('fs');var path=require(_0xcffb('0x6'));var rimraf=require('rimraf');var config=require(_0xcffb('0x7'));var attributes=require(_0xcffb('0x8'));module[_0xcffb('0x9')]=function(_0x7d8b53,_0x2f8463){return _0x7d8b53[_0xcffb('0xa')](_0xcffb('0xb'),attributes,{'tableName':_0xcffb('0xc'),'paranoid':![],'indexes':[{'name':_0xcffb('0xd'),'fields':[_0xcffb('0xe')],'type':_0xcffb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fb33c,_0x5721d6,_0x298846){var _0x9a76f4=_0x7d8b53[_0xcffb('0x10')];var _0x498ab4=_0x1fb33c[_0xcffb('0x11')]({'plain':!![]});if(_0x498ab4['direction'][_0xcffb('0x12')]()==='in'||_0x498ab4[_0xcffb('0x13')][_0xcffb('0x12')]()===_0xcffb('0x14')&&!_0x498ab4['secret']&&!_[_0xcffb('0x15')](_0x498ab4[_0xcffb('0x16')])){_0x9a76f4['FaxInteraction'][_0xcffb('0x17')]({'where':{'id':_0x498ab4[_0xcffb('0x18')]}})[_0xcffb('0x19')](function(_0x57bf2e){if(_0x57bf2e){_0x57bf2e['update']({'lastMsgAt':_0x498ab4[_0xcffb('0x1a')],'lastMsgDirection':_0x498ab4[_0xcffb('0x13')][_0xcffb('0x12')]()});}})['catch'](function(_0x404e17){console['error'](_0x404e17);});}_0x298846();}},'charset':_0xcffb('0x1b'),'collate':_0xcffb('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 061e89b..3a64c21 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 _0xb821=['register','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x24ec84,_0xf05dff){var _0x4f3167=function(_0x4c464b){while(--_0x4c464b){_0x24ec84['push'](_0x24ec84['shift']());}};_0x4f3167(++_0xf05dff);}(_0xb821,0xa7));var _0x1b82=function(_0x4ecf3f,_0x12e6c0){_0x4ecf3f=_0x4ecf3f-0x0;var _0x1ced8c=_0xb821[_0x4ecf3f];return _0x1ced8c;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});config[_0x1b82('0x8')]=_[_0x1b82('0x9')](config[_0x1b82('0x8')],{'host':_0x1b82('0xa'),'port':0x18eb});var socket=require(_0x1b82('0xb'))(new Redis(config[_0x1b82('0x8')]));require(_0x1b82('0xc'))[_0x1b82('0xd')](socket);function respondWithRpcPromise(_0x4955b5,_0x4011f2,_0x30c6ee){return new BPromise(function(_0x44dfd4,_0x14c57a){return client[_0x1b82('0xe')](_0x4955b5,_0x30c6ee)[_0x1b82('0xf')](function(_0x739f99){logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1b82('0x11'));logger[_0x1b82('0x12')](_0x1b82('0x13'),_0x4011f2,_0x1b82('0x11'),JSON['stringify'](_0x739f99));if(_0x739f99[_0x1b82('0x14')]){if(_0x739f99['error']['code']===0x1f4){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);return _0x14c57a(_0x739f99['error'][_0x1b82('0x15')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')]['message']);return _0x44dfd4(_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);}else{logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,'request\x20sent');_0x44dfd4(_0x739f99[_0x1b82('0x16')]['message']);}})[_0x1b82('0x17')](function(_0x1002a1){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1002a1);_0x14c57a(_0x1002a1);});});}exports[_0x1b82('0x18')]=function(_0x2b6ee8){var _0x11af50=this;return new Promise(function(_0x46e5e2,_0x10d45c){return db['FaxMessage'][_0x1b82('0x19')](_0x2b6ee8[_0x1b82('0x1a')],{'raw':_0x2b6ee8[_0x1b82('0x1b')]?_0x2b6ee8[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![]})[_0x1b82('0xf')](function(_0x2d07f4){logger['info'](_0x1b82('0x18'),_0x2b6ee8);logger[_0x1b82('0x12')]('CreateFaxMessage',_0x2b6ee8,JSON[_0x1b82('0x1d')](_0x2d07f4));_0x46e5e2(_0x2d07f4);})[_0x1b82('0x17')](function(_0x1ad9d6){logger['error'](_0x1b82('0x18'),_0x1ad9d6['message'],_0x2b6ee8);_0x10d45c(_0x11af50['error'](0x1f4,_0x1ad9d6['message']));});});};exports[_0x1b82('0x1e')]=function(_0x149d0f){var _0xfd00d1=this;return new Promise(function(_0x257b79,_0x548a3b){return db[_0x1b82('0x1f')][_0x1b82('0x20')](_0x149d0f[_0x1b82('0x1a')],{'raw':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x21')]||null:null,'attributes':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x22')]||null:null,'limit':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f['options'][_0x1b82('0x23')]||null:null})[_0x1b82('0xf')](function(_0x155a34){logger[_0x1b82('0x10')](_0x1b82('0x1e'),_0x149d0f);logger[_0x1b82('0x12')](_0x1b82('0x1e'),_0x149d0f,JSON[_0x1b82('0x1d')](_0x155a34));_0x257b79(_0x155a34);})[_0x1b82('0x17')](function(_0x362657){logger['error'](_0x1b82('0x1e'),_0x362657[_0x1b82('0x15')],_0x149d0f);_0x548a3b(_0xfd00d1[_0x1b82('0x14')](0x1f4,_0x362657[_0x1b82('0x15')]));});});}; \ No newline at end of file +var _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0x56ae6a,_0x5d5160){var _0xc00c57=function(_0x20716b){while(--_0x20716b){_0x56ae6a['push'](_0x56ae6a['shift']());}};_0xc00c57(++_0x5d5160);}(_0x55e0,0xdc));var _0x055e=function(_0x57b5bf,_0x1e45ed){_0x57b5bf=_0x57b5bf-0x0;var _0x1c2194=_0x55e0[_0x57b5bf];return _0x1c2194;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 5823d20..924247c 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 _0x2364=['emit','removeListener','length','./faxMessage.events','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2364,0x122));var _0x4236=function(_0x952775,_0xbe0627){_0x952775=_0x952775-0x0;var _0x1f175d=_0x2364[_0x952775];return _0x1f175d;};'use strict';var FaxMessageEvents=require(_0x4236('0x0'));var events=[_0x4236('0x1'),_0x4236('0x2'),_0x4236('0x3')];function createListener(_0x12db52,_0x23ad7b){return function(_0x19bb66){_0x23ad7b[_0x4236('0x4')](_0x12db52,_0x19bb66);};}function removeListener(_0x245611,_0x536e39){return function(){FaxMessageEvents[_0x4236('0x5')](_0x245611,_0x536e39);};}exports['register']=function(_0x35151a){for(var _0x143bd7=0x0,_0x33d80c=events[_0x4236('0x6')];_0x143bd7<_0x33d80c;_0x143bd7++){var _0x39dc8a=events[_0x143bd7];var _0x2ea846=createListener('faxMessage:'+_0x39dc8a,_0x35151a);FaxMessageEvents['on'](_0x39dc8a,_0x2ea846);}}; \ No newline at end of file +var _0x78c4=['update','removeListener','register','faxMessage:','./faxMessage.events','save'];(function(_0x2404f3,_0x52c447){var _0x28339c=function(_0x5ef100){while(--_0x5ef100){_0x2404f3['push'](_0x2404f3['shift']());}};_0x28339c(++_0x52c447);}(_0x78c4,0xd6));var _0x478c=function(_0x17dc1b,_0x5938f6){_0x17dc1b=_0x17dc1b-0x0;var _0x1d02a2=_0x78c4[_0x17dc1b];return _0x1d02a2;};'use strict';var FaxMessageEvents=require(_0x478c('0x0'));var events=[_0x478c('0x1'),'remove',_0x478c('0x2')];function createListener(_0x4d9093,_0x26dde1){return function(_0xea62d0){_0x26dde1['emit'](_0x4d9093,_0xea62d0);};}function removeListener(_0x11295b,_0x308668){return function(){FaxMessageEvents[_0x478c('0x3')](_0x11295b,_0x308668);};}exports[_0x478c('0x4')]=function(_0x743564){for(var _0x2e7b96=0x0,_0x4db41d=events['length'];_0x2e7b96<_0x4db41d;_0x2e7b96++){var _0x2b9b0a=events[_0x2e7b96];var _0x33a036=createListener(_0x478c('0x5')+_0x2b9b0a,_0x743564);FaxMessageEvents['on'](_0x2b9b0a,_0x33a036);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 5862733..9d420a2 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 _0x41bb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','connect-timeout'];(function(_0x447fb6,_0x532333){var _0x127ab8=function(_0x22d2ef){while(--_0x22d2ef){_0x447fb6['push'](_0x447fb6['shift']());}};_0x127ab8(++_0x532333);}(_0x41bb,0xc5));var _0xb41b=function(_0x5f4997,_0x3b0c57){_0x5f4997=_0x5f4997-0x0;var _0x353569=_0x41bb[_0x5f4997];return _0x353569;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/describe',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0x8')](_0xb41b('0xd'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router['post']('/',auth[_0xb41b('0x9')](),interaction['tracked'](_0xb41b('0xf'),_0xb41b('0x10')),controller[_0xb41b('0x11')]);router[_0xb41b('0x12')](_0xb41b('0xb'),auth['isAuthenticated'](),controller[_0xb41b('0x13')]);router[_0xb41b('0x12')](_0xb41b('0x14'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xb41b('0x16')]);router[_0xb41b('0x17')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x4ded=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','download','fax','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0xd2beb8,_0x3b4b35){var _0x5951d5=function(_0x31d67d){while(--_0x31d67d){_0xd2beb8['push'](_0xd2beb8['shift']());}};_0x5951d5(++_0x3b4b35);}(_0x4ded,0x116));var _0xd4de=function(_0x4ba9a6,_0x3a91c2){_0x4ba9a6=_0x4ba9a6-0x0;var _0x4fa3bb=_0x4ded[_0x4ba9a6];return _0x4fa3bb;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var fs_extra=require(_0xd4de('0x6'));var auth=require(_0xd4de('0x7'));var interaction=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var controller=require(_0xd4de('0xa'));router[_0xd4de('0xb')]('/',auth['isAuthenticated'](),controller[_0xd4de('0xc')]);router[_0xd4de('0xb')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0xf')]);router[_0xd4de('0xb')]('/:id',auth[_0xd4de('0xe')](),controller['show']);router['get']('/:id/download',auth[_0xd4de('0xe')](),controller[_0xd4de('0x10')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xd4de('0x11'),'faxmessage:create'),controller[_0xd4de('0x12')]);router[_0xd4de('0x13')](_0xd4de('0x14'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x15')]);router[_0xd4de('0x13')](_0xd4de('0x16'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x17')]);router[_0xd4de('0x13')](_0xd4de('0x18'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x19')]);router[_0xd4de('0x1a')](_0xd4de('0x14'),auth[_0xd4de('0xe')](),controller[_0xd4de('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 a7e9382..2420379 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 _0x2711=['INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x4706af,_0x24b450){var _0x2f75c4=function(_0x415a9a){while(--_0x415a9a){_0x4706af['push'](_0x4706af['shift']());}};_0x2f75c4(++_0x24b450);}(_0x2711,0x1e1));var _0x1271=function(_0x49ada2,_0x34fe95){_0x49ada2=_0x49ada2-0x0;var _0x754d26=_0x2711[_0x49ada2];return _0x754d26;};'use strict';var Sequelize=require('sequelize');module[_0x1271('0x0')]={'name':{'type':Sequelize[_0x1271('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1271('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1271('0x3')](_0x1271('0x4'),_0x1271('0x5'),_0x1271('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x1271('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcaaf=['ENUM','beepall','sequelize','STRING','INTEGER'];(function(_0x112a09,_0x456aab){var _0x4eb5d0=function(_0x206784){while(--_0x206784){_0x112a09['push'](_0x112a09['shift']());}};_0x4eb5d0(++_0x456aab);}(_0xcaaf,0x66));var _0xfcaa=function(_0x72d324,_0x28b57b){_0x72d324=_0x72d324-0x0;var _0x12b627=_0xcaaf[_0x72d324];return _0x12b627;};'use strict';var Sequelize=require(_0xfcaa('0x0'));module['exports']={'name':{'type':Sequelize[_0xfcaa('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfcaa('0x3')]('rrmemory',_0xfcaa('0x4'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 35fab29..6ee5c27 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 _0xc0f3=['team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','removeAgents','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','index','map','FaxQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','catch','show','params','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','update','describe','getMembers','findOne','UserFaxQueue','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','sequelize','transaction','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId'];(function(_0xa811ca,_0x2d7163){var _0x333b69=function(_0x49895f){while(--_0x49895f){_0xa811ca['push'](_0xa811ca['shift']());}};_0x333b69(++_0x2d7163);}(_0xc0f3,0x1bd));var _0x3c0f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc0f3[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c0f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c0f('0x1'));var rp=require(_0x3c0f('0x2'));var moment=require(_0x3c0f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3c0f('0x4'));var util=require(_0x3c0f('0x5'));var path=require(_0x3c0f('0x6'));var sox=require(_0x3c0f('0x7'));var csv=require(_0x3c0f('0x8'));var ejs=require(_0x3c0f('0x9'));var fs=require('fs');var fs_extra=require(_0x3c0f('0xa'));var _=require(_0x3c0f('0xb'));var squel=require(_0x3c0f('0xc'));var crypto=require(_0x3c0f('0xd'));var jsforce=require(_0x3c0f('0xe'));var deskjs=require(_0x3c0f('0xf'));var toCsv=require(_0x3c0f('0x8'));var querystring=require(_0x3c0f('0x10'));var Papa=require(_0x3c0f('0x11'));var Redis=require(_0x3c0f('0x12'));var authService=require(_0x3c0f('0x13'));var qs=require(_0x3c0f('0x14'));var as=require(_0x3c0f('0x15'));var hardwareService=require(_0x3c0f('0x16'));var logger=require(_0x3c0f('0x17'))(_0x3c0f('0x18'));var utils=require(_0x3c0f('0x19'));var config=require(_0x3c0f('0x1a'));var licenseUtil=require(_0x3c0f('0x1b'));var db=require(_0x3c0f('0x1c'))['db'];config[_0x3c0f('0x1d')]=_['defaults'](config[_0x3c0f('0x1d')],{'host':_0x3c0f('0x1e'),'port':0x18eb});var socket=require(_0x3c0f('0x1f'))(new Redis(config[_0x3c0f('0x1d')]));require(_0x3c0f('0x20'))[_0x3c0f('0x21')](socket);function respondWithStatusCode(_0x270ff9,_0x4aab34){_0x4aab34=_0x4aab34||0xcc;return function(_0x56bc3b){if(_0x56bc3b){return _0x270ff9['sendStatus'](_0x4aab34);}return _0x270ff9[_0x3c0f('0x22')](_0x4aab34)['end']();};}function respondWithResult(_0x18fd06,_0x53fc93){_0x53fc93=_0x53fc93||0xc8;return function(_0x380592){if(_0x380592){return _0x18fd06[_0x3c0f('0x22')](_0x53fc93)[_0x3c0f('0x23')](_0x380592);}};}function respondWithFilteredResult(_0x4ea4f2,_0x453ee4){return function(_0x23b98a){if(_0x23b98a){var _0x4fc566=typeof _0x453ee4[_0x3c0f('0x24')]==='undefined'&&typeof _0x453ee4[_0x3c0f('0x25')]==='undefined';var _0x5a416b=_0x23b98a[_0x3c0f('0x26')];var _0x4e34bd=_0x4fc566?0x0:_0x453ee4[_0x3c0f('0x24')];var _0x416f46=_0x4fc566?_0x23b98a['count']:_0x453ee4[_0x3c0f('0x24')]+_0x453ee4[_0x3c0f('0x25')];var _0x2c849b;if(_0x416f46>=_0x5a416b){_0x416f46=_0x5a416b;_0x2c849b=0xc8;}else{_0x2c849b=0xce;}_0x4ea4f2[_0x3c0f('0x22')](_0x2c849b);return _0x4ea4f2[_0x3c0f('0x27')](_0x3c0f('0x28'),_0x4e34bd+'-'+_0x416f46+'/'+_0x5a416b)[_0x3c0f('0x23')](_0x23b98a);}return null;};}function patchUpdates(_0x47a0a0){return function(_0x5db0e4){try{jsonpatch[_0x3c0f('0x29')](_0x5db0e4,_0x47a0a0,!![]);}catch(_0x175c31){return BPromise[_0x3c0f('0x2a')](_0x175c31);}return _0x5db0e4[_0x3c0f('0x2b')]();};}function saveUpdates(_0x5c6fd0,_0x585095){return function(_0x3f9e4f){if(_0x3f9e4f){return _0x3f9e4f['update'](_0x5c6fd0)[_0x3c0f('0x2c')](function(_0x1f0e2a){return _0x1f0e2a;});}return null;};}function removeEntity(_0x1123cf,_0x54bdc7){return function(_0x5d64e8){if(_0x5d64e8){return _0x5d64e8[_0x3c0f('0x2d')]()[_0x3c0f('0x2c')](function(){var _0x362064=_0x5d64e8[_0x3c0f('0x2e')]({'plain':!![]});var _0x9cf738='FaxQueues';return db[_0x3c0f('0x2f')][_0x3c0f('0x2d')]({'where':{'type':_0x9cf738,'resourceId':_0x362064['id']}})['then'](function(){return _0x5d64e8;});})[_0x3c0f('0x2c')](function(){_0x1123cf[_0x3c0f('0x22')](0xcc)[_0x3c0f('0x30')]();});}};}function handleEntityNotFound(_0x46d7bd,_0x3588df){return function(_0x4b369c){if(!_0x4b369c){_0x46d7bd[_0x3c0f('0x31')](0x194);}return _0x4b369c;};}function handleError(_0x20d7d2,_0x53cf42){_0x53cf42=_0x53cf42||0x1f4;return function(_0x29fbdb){logger[_0x3c0f('0x32')](_0x29fbdb[_0x3c0f('0x33')]);if(_0x29fbdb[_0x3c0f('0x34')]){delete _0x29fbdb[_0x3c0f('0x34')];}_0x20d7d2['status'](_0x53cf42)['send'](_0x29fbdb);};}exports[_0x3c0f('0x35')]=function(_0x9285e2,_0x23a407){var _0x341389={},_0x21e562={},_0x5012af={'count':0x0,'rows':[]};var _0xd588d=_[_0x3c0f('0x36')](db[_0x3c0f('0x37')][_0x3c0f('0x38')],function(_0xf4742f){return{'name':_0xf4742f[_0x3c0f('0x39')],'type':_0xf4742f['type'][_0x3c0f('0x3a')]};});_0x21e562['model']=_['map'](_0xd588d,_0x3c0f('0x34'));_0x21e562[_0x3c0f('0x3b')]=_[_0x3c0f('0x3c')](_0x9285e2[_0x3c0f('0x3b')]);_0x21e562[_0x3c0f('0x3d')]=_[_0x3c0f('0x3e')](_0x21e562[_0x3c0f('0x3f')],_0x21e562[_0x3c0f('0x3b')]);_0x341389[_0x3c0f('0x40')]=_[_0x3c0f('0x3e')](_0x21e562[_0x3c0f('0x3f')],qs[_0x3c0f('0x41')](_0x9285e2['query'][_0x3c0f('0x41')]));_0x341389['attributes']=_0x341389['attributes']['length']?_0x341389[_0x3c0f('0x40')]:_0x21e562[_0x3c0f('0x3f')];if(!_0x9285e2[_0x3c0f('0x3b')][_0x3c0f('0x42')](_0x3c0f('0x43'))){_0x341389[_0x3c0f('0x25')]=qs[_0x3c0f('0x25')](_0x9285e2['query']['limit']);_0x341389[_0x3c0f('0x24')]=qs['offset'](_0x9285e2[_0x3c0f('0x3b')][_0x3c0f('0x24')]);}_0x341389[_0x3c0f('0x44')]=qs[_0x3c0f('0x45')](_0x9285e2[_0x3c0f('0x3b')]['sort']);_0x341389[_0x3c0f('0x46')]=qs[_0x3c0f('0x3d')](_[_0x3c0f('0x47')](_0x9285e2['query'],_0x21e562[_0x3c0f('0x3d')]),_0xd588d);if(_0x9285e2['query']['filter']){_0x341389[_0x3c0f('0x46')]=_[_0x3c0f('0x48')](_0x341389[_0x3c0f('0x46')],{'$or':_['map'](_0xd588d,function(_0x56a6c7){if(_0x56a6c7['type']!==_0x3c0f('0x49')){var _0x160ce4={};_0x160ce4[_0x56a6c7['name']]={'$like':'%'+_0x9285e2[_0x3c0f('0x3b')][_0x3c0f('0x4a')]+'%'};return _0x160ce4;}})});}_0x341389=_['merge']({},_0x341389,_0x9285e2[_0x3c0f('0x4b')]);var _0x88c9d2={'where':_0x341389['where']};return db[_0x3c0f('0x37')]['count'](_0x88c9d2)['then'](function(_0x6aaabe){_0x5012af[_0x3c0f('0x26')]=_0x6aaabe;if(_0x9285e2[_0x3c0f('0x3b')]['includeAll']){_0x341389['include']=[{'all':!![]}];}return db[_0x3c0f('0x37')][_0x3c0f('0x4c')](_0x341389);})[_0x3c0f('0x2c')](function(_0x4b072b){_0x5012af['rows']=_0x4b072b;return _0x5012af;})['then'](respondWithFilteredResult(_0x23a407,_0x341389))[_0x3c0f('0x4d')](handleError(_0x23a407,null));};exports[_0x3c0f('0x4e')]=function(_0x54717f,_0x1e10cb){var _0x2f20a8={'raw':!![],'where':{'id':_0x54717f[_0x3c0f('0x4f')]['id']}},_0x5781e1={};_0x5781e1[_0x3c0f('0x3f')]=_['keys'](db[_0x3c0f('0x37')]['rawAttributes']);_0x5781e1[_0x3c0f('0x3b')]=_[_0x3c0f('0x3c')](_0x54717f[_0x3c0f('0x3b')]);_0x5781e1[_0x3c0f('0x3d')]=_[_0x3c0f('0x3e')](_0x5781e1[_0x3c0f('0x3f')],_0x5781e1[_0x3c0f('0x3b')]);_0x2f20a8['attributes']=_['intersection'](_0x5781e1['model'],qs[_0x3c0f('0x41')](_0x54717f[_0x3c0f('0x3b')][_0x3c0f('0x41')]));_0x2f20a8['attributes']=_0x2f20a8[_0x3c0f('0x40')][_0x3c0f('0x50')]?_0x2f20a8[_0x3c0f('0x40')]:_0x5781e1[_0x3c0f('0x3f')];if(_0x54717f['query'][_0x3c0f('0x51')]){_0x2f20a8['include']=[{'all':!![]}];}_0x2f20a8=_['merge']({},_0x2f20a8,_0x54717f[_0x3c0f('0x4b')]);return db[_0x3c0f('0x37')][_0x3c0f('0x52')](_0x2f20a8)[_0x3c0f('0x2c')](handleEntityNotFound(_0x1e10cb,null))['then'](respondWithResult(_0x1e10cb,null))['catch'](handleError(_0x1e10cb,null));};exports[_0x3c0f('0x53')]=function(_0x3a48c5,_0x26232b){return db[_0x3c0f('0x37')]['create'](_0x3a48c5[_0x3c0f('0x54')],{})[_0x3c0f('0x2c')](function(_0x40cece){var _0xd0dbb3=_0x3a48c5['user'][_0x3c0f('0x2e')]({'plain':!![]});if(!_0xd0dbb3)throw new Error(_0x3c0f('0x55'));if(_0xd0dbb3[_0x3c0f('0x56')]===_0x3c0f('0x57')){var _0x499bb1=_0x40cece[_0x3c0f('0x2e')]({'plain':!![]});var _0x3ac3d6='FaxQueues';return db['UserProfileSection'][_0x3c0f('0x52')]({'where':{'name':_0x3ac3d6,'userProfileId':_0xd0dbb3[_0x3c0f('0x58')]},'raw':!![]})[_0x3c0f('0x2c')](function(_0x38746c){if(_0x38746c&&_0x38746c[_0x3c0f('0x59')]===0x0){return db[_0x3c0f('0x2f')][_0x3c0f('0x53')]({'name':_0x499bb1['name'],'resourceId':_0x499bb1['id'],'type':_0x38746c[_0x3c0f('0x34')],'sectionId':_0x38746c['id']},{})[_0x3c0f('0x2c')](function(){return _0x40cece;});}else{return _0x40cece;}})[_0x3c0f('0x4d')](function(_0xd7119c){logger[_0x3c0f('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd7119c);throw _0xd7119c;});}return _0x40cece;})['then'](respondWithResult(_0x26232b,0xc9))[_0x3c0f('0x4d')](handleError(_0x26232b,null));};exports[_0x3c0f('0x5a')]=function(_0x1b354c,_0x3434f9){if(_0x1b354c[_0x3c0f('0x54')]['id']){delete _0x1b354c['body']['id'];}return db[_0x3c0f('0x37')][_0x3c0f('0x52')]({'where':{'id':_0x1b354c['params']['id']}})[_0x3c0f('0x2c')](handleEntityNotFound(_0x3434f9,null))['then'](saveUpdates(_0x1b354c[_0x3c0f('0x54')],null))[_0x3c0f('0x2c')](respondWithResult(_0x3434f9,null))[_0x3c0f('0x4d')](handleError(_0x3434f9,null));};exports[_0x3c0f('0x2d')]=function(_0x45447f,_0x121957){return db[_0x3c0f('0x37')][_0x3c0f('0x52')]({'where':{'id':_0x45447f[_0x3c0f('0x4f')]['id']}})[_0x3c0f('0x2c')](handleEntityNotFound(_0x121957,null))[_0x3c0f('0x2c')](removeEntity(_0x121957,null))[_0x3c0f('0x4d')](handleError(_0x121957,null));};exports['describe']=function(_0xe45f6d,_0x4db6b4){return db[_0x3c0f('0x37')][_0x3c0f('0x5b')]()[_0x3c0f('0x2c')](respondWithResult(_0x4db6b4,null))[_0x3c0f('0x4d')](handleError(_0x4db6b4,null));};exports[_0x3c0f('0x5c')]=function(_0x3ac379,_0x204631,_0x11bf70){var _0x3144cb={'raw':!![],'where':{}},_0x55ec22={},_0x572ce4;return db[_0x3c0f('0x37')][_0x3c0f('0x5d')]({'where':{'id':_0x3ac379['params']['id']}})[_0x3c0f('0x2c')](handleEntityNotFound(_0x204631,null))[_0x3c0f('0x2c')](function(_0x579500){if(_0x579500){_0x572ce4=_0x579500[_0x3c0f('0x2e')]({'plain':!![]});_0x55ec22[_0x3c0f('0x3f')]=_[_0x3c0f('0x3c')](db[_0x3c0f('0x5e')][_0x3c0f('0x38')]);_0x55ec22[_0x3c0f('0x3b')]=_[_0x3c0f('0x3c')](_0x3ac379[_0x3c0f('0x3b')]);_0x55ec22[_0x3c0f('0x3d')]=_['intersection'](_0x55ec22[_0x3c0f('0x3f')],_0x55ec22[_0x3c0f('0x3b')]);_0x3144cb['attributes']=_[_0x3c0f('0x3e')](_0x55ec22[_0x3c0f('0x3f')],qs[_0x3c0f('0x41')](_0x3ac379[_0x3c0f('0x3b')][_0x3c0f('0x41')]));_0x3144cb[_0x3c0f('0x40')]=_0x3144cb['attributes']['length']?_0x3144cb[_0x3c0f('0x40')]:_0x55ec22['model'];if(!_0x3ac379[_0x3c0f('0x3b')][_0x3c0f('0x42')](_0x3c0f('0x43'))){_0x3144cb[_0x3c0f('0x25')]=qs[_0x3c0f('0x25')](_0x3ac379['query'][_0x3c0f('0x25')]);_0x3144cb[_0x3c0f('0x24')]=qs[_0x3c0f('0x24')](_0x3ac379[_0x3c0f('0x3b')][_0x3c0f('0x24')]);}_0x3144cb[_0x3c0f('0x44')]=qs['sort'](_0x3ac379[_0x3c0f('0x3b')]['sort']);_0x3144cb[_0x3c0f('0x46')]=qs[_0x3c0f('0x3d')](_[_0x3c0f('0x47')](_0x3ac379['query'],_0x55ec22[_0x3c0f('0x3d')]));_0x3144cb[_0x3c0f('0x46')]['FaxQueueId']=_0x579500['id'];if(_0x3ac379[_0x3c0f('0x3b')][_0x3c0f('0x4a')]){_0x3144cb[_0x3c0f('0x46')]=_[_0x3c0f('0x48')](_0x3144cb[_0x3c0f('0x46')],{'$or':_[_0x3c0f('0x36')](_0x3144cb['attributes'],function(_0x547980){var _0x3a9e6a={};_0x3a9e6a[_0x547980]={'$like':'%'+_0x3ac379['query'][_0x3c0f('0x4a')]+'%'};return _0x3a9e6a;})});}_0x3144cb=_['merge']({},_0x3144cb,_0x3ac379[_0x3c0f('0x4b')]);return db['UserFaxQueue'][_0x3c0f('0x4c')](_0x3144cb);}})[_0x3c0f('0x2c')](function(_0xe4d051){if(_0xe4d051){return db[_0x3c0f('0x5f')][_0x3c0f('0x60')]({'where':{'id':_[_0x3c0f('0x36')](_0xe4d051,_0x3c0f('0x61')),'role':'agent'},'attributes':['id',_0x3c0f('0x34'),_0x3c0f('0x62'),_0x3c0f('0x63'),_0x3c0f('0x64')]});}})['then'](function(_0x37941a){if(_0x37941a){return{'count':_0x37941a[_0x3c0f('0x26')],'rows':_[_0x3c0f('0x36')](_0x37941a[_0x3c0f('0x65')],function(_0x174ca6){return{'membername':_0x174ca6[_0x3c0f('0x34')],'UserId':_0x174ca6['id'],'queue_name':_0x572ce4[_0x3c0f('0x34')],'FaxQueueId':_0x572ce4['id'],'interface':util['format'](_0x3c0f('0x66'),_0x3c0f('0x67'),_0x174ca6[_0x3c0f('0x34')]),'penalty':0x0,'paused':_0x174ca6['faxPause'],'createdAt':_0x174ca6[_0x3c0f('0x64')],'updatedAt':_0x174ca6[_0x3c0f('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3c0f('0x2c')](respondWithFilteredResult(_0x204631,_0x3144cb))[_0x3c0f('0x4d')](handleError(_0x204631,null));};exports[_0x3c0f('0x68')]=function(_0x410009,_0x1d084f,_0x1c3699){var _0x585913={};var _0x3a185e={};var _0x13b875;var _0x172d57;return db[_0x3c0f('0x37')][_0x3c0f('0x5d')]({'where':{'id':_0x410009[_0x3c0f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d084f,null))[_0x3c0f('0x2c')](function(_0x130688){if(_0x130688){_0x13b875=_0x130688;_0x3a185e[_0x3c0f('0x3f')]=_['keys'](db[_0x3c0f('0x69')][_0x3c0f('0x38')]);_0x3a185e['query']=_[_0x3c0f('0x3c')](_0x410009[_0x3c0f('0x3b')]);_0x3a185e[_0x3c0f('0x3d')]=_['intersection'](_0x3a185e[_0x3c0f('0x3f')],_0x3a185e['query']);_0x585913[_0x3c0f('0x40')]=_[_0x3c0f('0x3e')](_0x3a185e[_0x3c0f('0x3f')],qs[_0x3c0f('0x41')](_0x410009[_0x3c0f('0x3b')]['fields']));_0x585913[_0x3c0f('0x40')]=_0x585913['attributes']['length']?_0x585913[_0x3c0f('0x40')]:_0x3a185e['model'];_0x585913[_0x3c0f('0x44')]=qs[_0x3c0f('0x45')](_0x410009['query'][_0x3c0f('0x45')]);_0x585913['where']=qs[_0x3c0f('0x3d')](_[_0x3c0f('0x47')](_0x410009[_0x3c0f('0x3b')],_0x3a185e[_0x3c0f('0x3d')]));if(_0x410009[_0x3c0f('0x3b')][_0x3c0f('0x4a')]){_0x585913['where']=_[_0x3c0f('0x48')](_0x585913[_0x3c0f('0x46')],{'$or':_[_0x3c0f('0x36')](_0x585913[_0x3c0f('0x40')],function(_0x5a49ac){var _0x384f84={};_0x384f84[_0x5a49ac]={'$like':'%'+_0x410009[_0x3c0f('0x3b')]['filter']+'%'};return _0x384f84;})});}_0x585913=_[_0x3c0f('0x48')]({},_0x585913,_0x410009[_0x3c0f('0x4b')]);return _0x13b875[_0x3c0f('0x68')](_0x585913);}})[_0x3c0f('0x2c')](function(_0x21f1c5){if(_0x21f1c5){_0x172d57=_0x21f1c5[_0x3c0f('0x50')];if(!_0x410009['query'][_0x3c0f('0x42')](_0x3c0f('0x43'))){_0x585913[_0x3c0f('0x25')]=qs[_0x3c0f('0x25')](_0x410009[_0x3c0f('0x3b')][_0x3c0f('0x25')]);_0x585913[_0x3c0f('0x24')]=qs[_0x3c0f('0x24')](_0x410009[_0x3c0f('0x3b')][_0x3c0f('0x24')]);}return _0x13b875[_0x3c0f('0x68')](_0x585913);}})['then'](function(_0x699b40){if(_0x699b40){return _0x699b40?{'count':_0x172d57,'rows':_0x699b40}:null;}})[_0x3c0f('0x2c')](respondWithResult(_0x1d084f,null))[_0x3c0f('0x4d')](handleError(_0x1d084f,null));};exports[_0x3c0f('0x6a')]=function(_0x47ba7a,_0x202bea,_0x329103){var _0x2e2752=_0x47ba7a[_0x3c0f('0x54')][_0x3c0f('0x6b')];return db[_0x3c0f('0x69')]['findAll']({'where':{'id':_0x2e2752},'attributes':['id'],'include':[{'model':db[_0x3c0f('0x5f')],'as':_0x3c0f('0x6c'),'attributes':['id','name','online',_0x3c0f('0x6d'),'interface'],'raw':!![]}]})[_0x3c0f('0x2c')](function(_0x4d5da9){if(_0x4d5da9){var _0x54bdf3=_['flatMap'](_0x4d5da9,function(_0x4b57fa){var _0xc5b6a4=_0x4b57fa['get']({'plain':!![]});return _0xc5b6a4[_0x3c0f('0x6c')];});return db[_0x3c0f('0x37')][_0x3c0f('0x52')]({'where':{'id':_0x47ba7a[_0x3c0f('0x4f')]['id']}})[_0x3c0f('0x2c')](function(_0x29784a){return db[_0x3c0f('0x6e')][_0x3c0f('0x6f')](function(_0x18c4ef){return _0x29784a[_0x3c0f('0x6a')](_0x2e2752,{'transaction':_0x18c4ef})[_0x3c0f('0x2c')](function(){return BPromise['each'](_0x54bdf3,function(_0x229976){return db[_0x3c0f('0x5e')][_0x3c0f('0x70')]({'where':{'UserId':_0x229976['id'],'FaxQueueId':_0x47ba7a[_0x3c0f('0x4f')]['id']},'transaction':_0x18c4ef});});})[_0x3c0f('0x2c')](function(){_0x54bdf3['forEach'](function(_0x5dc179){socket[_0x3c0f('0x71')](_0x3c0f('0x72'),{'UserId':_0x5dc179['id'],'FaxQueueId':_0x29784a['id']});});});});});}})[_0x3c0f('0x2c')](respondWithStatusCode(_0x202bea,null))['catch'](handleError(_0x202bea,null));};exports[_0x3c0f('0x73')]=function(_0x2c6769,_0x1cf254,_0x158be5){return db[_0x3c0f('0x69')]['findAll']({'where':{'id':_0x2c6769[_0x3c0f('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3c0f('0x5f')],'as':_0x3c0f('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x3c0f('0x2c')](handleEntityNotFound(_0x1cf254,null))[_0x3c0f('0x2c')](function(_0x5e895e){var _0x1bfbbb=_['map'](_0x5e895e,'id');var _0x565702=[];var _0x5943eb=[];var _0x1ce02f=squel[_0x3c0f('0x74')]();_0x1ce02f[_0x3c0f('0x75')](_0x3c0f('0x76'))['from'](_0x3c0f('0x77'),'tq')[_0x3c0f('0x78')](_0x3c0f('0x79'),'ut',_0x3c0f('0x7a'))['where'](_0x3c0f('0x7b'),_0x2c6769[_0x3c0f('0x4f')]['id']);for(var _0x2193fc=0x0;_0x2193fc<_0x5e895e['length'];_0x2193fc+=0x1){let _0x17cf96=_0x5e895e[_0x2193fc];for(var _0x136a73=0x0;_0x136a73<_0x17cf96[_0x3c0f('0x6c')][_0x3c0f('0x50')];_0x136a73+=0x1){let _0x1f7981=_0x17cf96[_0x3c0f('0x6c')][_0x136a73];var _0x196799=_0x1ce02f[_0x3c0f('0x7c')]();_0x196799['where'](_0x3c0f('0x7d'),_0x1f7981['id']);_0x5943eb[_0x3c0f('0x7e')](db[_0x3c0f('0x6e')][_0x3c0f('0x3b')](_0x196799['toString'](),{'type':db[_0x3c0f('0x6e')][_0x3c0f('0x7f')][_0x3c0f('0x80')]})[_0x3c0f('0x2c')](function(_0x56faa9){if(_0x56faa9['length']===0x1){return _0x1f7981['id'];}else{var _0x328bbe=_[_0x3c0f('0x81')](_['map'](_0x56faa9,'TeamId'),function(_0x1bea50){return _[_0x3c0f('0x82')](_0x1bfbbb,_0x1bea50);});if(_0x328bbe){return _0x1f7981['id'];}}}));}}return BPromise['all'](_0x5943eb)[_0x3c0f('0x2c')](function(_0x58ff1f){_0x565702=_(_0x565702)[_0x3c0f('0x83')](_0x58ff1f)[_0x3c0f('0x84')]()[_0x3c0f('0x85')]();return db[_0x3c0f('0x37')][_0x3c0f('0x52')]({'where':{'id':_0x2c6769[_0x3c0f('0x4f')]['id']}})[_0x3c0f('0x2c')](function(_0x2f334d){return db[_0x3c0f('0x6e')][_0x3c0f('0x6f')](function(_0x142635){return _0x2f334d['removeTeams'](_0x2c6769[_0x3c0f('0x3b')][_0x3c0f('0x6b')],{'transaction':_0x142635})['then'](function(){if(!_[_0x3c0f('0x86')](_0x565702)){return _0x2f334d['removeAgents'](_0x565702,{'transaction':_0x142635});}})[_0x3c0f('0x2c')](function(){_0x565702[_0x3c0f('0x87')](function(_0x36431a){socket[_0x3c0f('0x71')](_0x3c0f('0x88'),{'UserId':_0x36431a,'FaxQueueId':_0x2f334d['id']});});});});});});})[_0x3c0f('0x2c')](respondWithStatusCode(_0x1cf254,null))[_0x3c0f('0x4d')](handleError(_0x1cf254,null));};exports['addAgents']=function(_0x22a4ce,_0x563230,_0x236850){return db[_0x3c0f('0x37')][_0x3c0f('0x52')]({'where':{'id':_0x22a4ce['params']['id']}})[_0x3c0f('0x2c')](handleEntityNotFound(_0x563230,null))[_0x3c0f('0x2c')](function(_0x45388e){if(_0x45388e){return _0x45388e[_0x3c0f('0x89')](_0x22a4ce[_0x3c0f('0x54')][_0x3c0f('0x6b')],_[_0x3c0f('0x8a')](_0x22a4ce['body'],[_0x3c0f('0x6b'),'id'])||{})['spread'](function(_0x304dda){for(var _0x1507a0=0x0;_0x1507a0<_0x22a4ce['body'][_0x3c0f('0x6b')][_0x3c0f('0x50')];_0x1507a0+=0x1){socket[_0x3c0f('0x71')](_0x3c0f('0x72'),{'UserId':Number(_0x22a4ce['body']['ids'][_0x1507a0]),'FaxQueueId':Number(_0x22a4ce[_0x3c0f('0x4f')]['id'])});}return _0x304dda;});}})[_0x3c0f('0x2c')](respondWithResult(_0x563230,null))[_0x3c0f('0x4d')](handleError(_0x563230,null));};exports[_0x3c0f('0x8b')]=function(_0x55c837,_0x4bb076,_0x133e6e){return db['FaxQueue']['find']({'where':{'id':_0x55c837[_0x3c0f('0x4f')]['id']}})[_0x3c0f('0x2c')](handleEntityNotFound(_0x4bb076,null))['then'](function(_0x3669fa){if(_0x3669fa){return _0x3669fa[_0x3c0f('0x8b')](_0x55c837['query'][_0x3c0f('0x6b')])[_0x3c0f('0x2c')](function(){if(_['isArray'](_0x55c837[_0x3c0f('0x3b')][_0x3c0f('0x6b')])){for(var _0x324d24=0x0;_0x324d24<_0x55c837['query'][_0x3c0f('0x6b')][_0x3c0f('0x50')];_0x324d24+=0x1){socket['emit'](_0x3c0f('0x88'),{'UserId':Number(_0x55c837['query']['ids'][_0x324d24]),'FaxQueueId':Number(_0x55c837[_0x3c0f('0x4f')]['id'])});}}else{socket['emit'](_0x3c0f('0x88'),{'UserId':Number(_0x55c837[_0x3c0f('0x3b')][_0x3c0f('0x6b')]),'FaxQueueId':Number(_0x55c837[_0x3c0f('0x4f')]['id'])});}});}})[_0x3c0f('0x2c')](respondWithStatusCode(_0x4bb076,null))['catch'](handleError(_0x4bb076,null));};exports[_0x3c0f('0x8c')]=function(_0x223565,_0x1e7c1c,_0x38279d){var _0x53b370={};var _0x598b47={};var _0x370813;var _0x5cdd2e;return db[_0x3c0f('0x37')][_0x3c0f('0x5d')]({'where':{'id':_0x223565[_0x3c0f('0x4f')]['id']}})[_0x3c0f('0x2c')](handleEntityNotFound(_0x1e7c1c,null))[_0x3c0f('0x2c')](function(_0xad487c){if(_0xad487c){_0x370813=_0xad487c;_0x598b47[_0x3c0f('0x3f')]=_['keys'](db[_0x3c0f('0x5f')][_0x3c0f('0x38')]);_0x598b47[_0x3c0f('0x3b')]=_[_0x3c0f('0x3c')](_0x223565[_0x3c0f('0x3b')]);_0x598b47[_0x3c0f('0x3d')]=_[_0x3c0f('0x3e')](_0x598b47[_0x3c0f('0x3f')],_0x598b47[_0x3c0f('0x3b')]);_0x53b370['attributes']=_[_0x3c0f('0x3e')](_0x598b47['model'],qs[_0x3c0f('0x41')](_0x223565[_0x3c0f('0x3b')][_0x3c0f('0x41')]));_0x53b370['attributes']=_0x53b370[_0x3c0f('0x40')]['length']?_0x53b370[_0x3c0f('0x40')]:_0x598b47[_0x3c0f('0x3f')];_0x53b370['order']=qs[_0x3c0f('0x45')](_0x223565[_0x3c0f('0x3b')]['sort']);_0x53b370[_0x3c0f('0x46')]=qs['filters'](_[_0x3c0f('0x47')](_0x223565[_0x3c0f('0x3b')],_0x598b47[_0x3c0f('0x3d')]));if(_0x223565[_0x3c0f('0x3b')][_0x3c0f('0x4a')]){_0x53b370['where']=_[_0x3c0f('0x48')](_0x53b370[_0x3c0f('0x46')],{'$or':_[_0x3c0f('0x36')](_0x53b370[_0x3c0f('0x40')],function(_0x5b8835){var _0x3f32d8={};_0x3f32d8[_0x5b8835]={'$like':'%'+_0x223565[_0x3c0f('0x3b')][_0x3c0f('0x4a')]+'%'};return _0x3f32d8;})});}_0x53b370=_[_0x3c0f('0x48')]({},_0x53b370,_0x223565[_0x3c0f('0x4b')]);return _0x370813[_0x3c0f('0x8c')](_0x53b370);}})[_0x3c0f('0x2c')](function(_0x573f2d){if(_0x573f2d){_0x5cdd2e=_0x573f2d[_0x3c0f('0x50')];if(!_0x223565['query'][_0x3c0f('0x42')](_0x3c0f('0x43'))){_0x53b370[_0x3c0f('0x25')]=qs['limit'](_0x223565['query'][_0x3c0f('0x25')]);_0x53b370[_0x3c0f('0x24')]=qs[_0x3c0f('0x24')](_0x223565[_0x3c0f('0x3b')][_0x3c0f('0x24')]);}return _0x370813[_0x3c0f('0x8c')](_0x53b370);}})[_0x3c0f('0x2c')](function(_0x2a0a7a){if(_0x2a0a7a){return _0x2a0a7a?{'count':_0x5cdd2e,'rows':_0x2a0a7a}:null;}})[_0x3c0f('0x2c')](respondWithResult(_0x1e7c1c,null))[_0x3c0f('0x4d')](handleError(_0x1e7c1c,null));}; \ No newline at end of file +var _0x48c9=['ids','voicePause','interface','Agents','sequelize','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','value','transaction','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','FaxQueue','includeAll','include','findAll','rows','catch','show','params','find','user','FaxQueues','userProfileId','UserProfileResource','body','describe','getMembers','UserFaxQueue','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','addTeams'];(function(_0x14fda2,_0x181e9a){var _0x5965ae=function(_0x3240a9){while(--_0x3240a9){_0x14fda2['push'](_0x14fda2['shift']());}};_0x5965ae(++_0x181e9a);}(_0x48c9,0x1b8));var _0x948c=function(_0xce755b,_0x58fb87){_0xce755b=_0xce755b-0x0;var _0x30d6da=_0x48c9[_0xce755b];return _0x30d6da;};'use strict';var emlformat=require(_0x948c('0x0'));var rimraf=require(_0x948c('0x1'));var zipdir=require(_0x948c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x948c('0x3'));var moment=require(_0x948c('0x4'));var BPromise=require(_0x948c('0x5'));var Mustache=require(_0x948c('0x6'));var util=require(_0x948c('0x7'));var path=require(_0x948c('0x8'));var sox=require(_0x948c('0x9'));var csv=require(_0x948c('0xa'));var ejs=require(_0x948c('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(_0x948c('0xc'));var deskjs=require(_0x948c('0xd'));var toCsv=require(_0x948c('0xa'));var querystring=require(_0x948c('0xe'));var Papa=require(_0x948c('0xf'));var Redis=require(_0x948c('0x10'));var authService=require(_0x948c('0x11'));var qs=require(_0x948c('0x12'));var as=require(_0x948c('0x13'));var hardwareService=require(_0x948c('0x14'));var logger=require(_0x948c('0x15'))(_0x948c('0x16'));var utils=require(_0x948c('0x17'));var config=require(_0x948c('0x18'));var licenseUtil=require(_0x948c('0x19'));var db=require('../../mysqldb')['db'];config[_0x948c('0x1a')]=_['defaults'](config[_0x948c('0x1a')],{'host':_0x948c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x948c('0x1a')]));require('./faxQueue.socket')[_0x948c('0x1c')](socket);function respondWithStatusCode(_0x4ed8d1,_0x524dc5){_0x524dc5=_0x524dc5||0xcc;return function(_0x86499){if(_0x86499){return _0x4ed8d1[_0x948c('0x1d')](_0x524dc5);}return _0x4ed8d1['status'](_0x524dc5)[_0x948c('0x1e')]();};}function respondWithResult(_0x2a8b05,_0x1a5a7e){_0x1a5a7e=_0x1a5a7e||0xc8;return function(_0x915337){if(_0x915337){return _0x2a8b05[_0x948c('0x1f')](_0x1a5a7e)[_0x948c('0x20')](_0x915337);}};}function respondWithFilteredResult(_0x16039e,_0x37a579){return function(_0x3b5bff){if(_0x3b5bff){var _0x111774=typeof _0x37a579['offset']===_0x948c('0x21')&&typeof _0x37a579[_0x948c('0x22')]===_0x948c('0x21');var _0x309e41=_0x3b5bff[_0x948c('0x23')];var _0x2bc7ea=_0x111774?0x0:_0x37a579[_0x948c('0x24')];var _0x3c6424=_0x111774?_0x3b5bff['count']:_0x37a579[_0x948c('0x24')]+_0x37a579['limit'];var _0x906f4c;if(_0x3c6424>=_0x309e41){_0x3c6424=_0x309e41;_0x906f4c=0xc8;}else{_0x906f4c=0xce;}_0x16039e[_0x948c('0x1f')](_0x906f4c);return _0x16039e[_0x948c('0x25')](_0x948c('0x26'),_0x2bc7ea+'-'+_0x3c6424+'/'+_0x309e41)[_0x948c('0x20')](_0x3b5bff);}return null;};}function patchUpdates(_0x4408a7){return function(_0x5b8c6d){try{jsonpatch['apply'](_0x5b8c6d,_0x4408a7,!![]);}catch(_0x290f65){return BPromise[_0x948c('0x27')](_0x290f65);}return _0x5b8c6d[_0x948c('0x28')]();};}function saveUpdates(_0x43055d,_0x5d1d67){return function(_0x35b207){if(_0x35b207){return _0x35b207[_0x948c('0x29')](_0x43055d)[_0x948c('0x2a')](function(_0xb71deb){return _0xb71deb;});}return null;};}function removeEntity(_0x23dd30,_0x5e4e1e){return function(_0x6098d){if(_0x6098d){return _0x6098d[_0x948c('0x2b')]()[_0x948c('0x2a')](function(){var _0x580c7b=_0x6098d[_0x948c('0x2c')]({'plain':!![]});var _0x26affe='FaxQueues';return db['UserProfileResource'][_0x948c('0x2b')]({'where':{'type':_0x26affe,'resourceId':_0x580c7b['id']}})[_0x948c('0x2a')](function(){return _0x6098d;});})['then'](function(){_0x23dd30[_0x948c('0x1f')](0xcc)[_0x948c('0x1e')]();});}};}function handleEntityNotFound(_0x52795a,_0x40939f){return function(_0x6ec939){if(!_0x6ec939){_0x52795a[_0x948c('0x1d')](0x194);}return _0x6ec939;};}function handleError(_0x3757ea,_0x527e7f){_0x527e7f=_0x527e7f||0x1f4;return function(_0x944401){logger[_0x948c('0x2d')](_0x944401[_0x948c('0x2e')]);if(_0x944401[_0x948c('0x2f')]){delete _0x944401[_0x948c('0x2f')];}_0x3757ea[_0x948c('0x1f')](_0x527e7f)[_0x948c('0x30')](_0x944401);};}exports[_0x948c('0x31')]=function(_0x5883a3,_0x127591){var _0x7f116d={},_0x426923={},_0x446dd4={'count':0x0,'rows':[]};var _0x28e2cf=_[_0x948c('0x32')](db['FaxQueue'][_0x948c('0x33')],function(_0x57f1f1){return{'name':_0x57f1f1['fieldName'],'type':_0x57f1f1[_0x948c('0x34')]['key']};});_0x426923[_0x948c('0x35')]=_[_0x948c('0x32')](_0x28e2cf,_0x948c('0x2f'));_0x426923[_0x948c('0x36')]=_[_0x948c('0x37')](_0x5883a3[_0x948c('0x36')]);_0x426923['filters']=_[_0x948c('0x38')](_0x426923[_0x948c('0x35')],_0x426923['query']);_0x7f116d[_0x948c('0x39')]=_[_0x948c('0x38')](_0x426923[_0x948c('0x35')],qs[_0x948c('0x3a')](_0x5883a3[_0x948c('0x36')][_0x948c('0x3a')]));_0x7f116d[_0x948c('0x39')]=_0x7f116d[_0x948c('0x39')][_0x948c('0x3b')]?_0x7f116d[_0x948c('0x39')]:_0x426923[_0x948c('0x35')];if(!_0x5883a3[_0x948c('0x36')][_0x948c('0x3c')](_0x948c('0x3d'))){_0x7f116d['limit']=qs[_0x948c('0x22')](_0x5883a3['query']['limit']);_0x7f116d['offset']=qs['offset'](_0x5883a3[_0x948c('0x36')][_0x948c('0x24')]);}_0x7f116d[_0x948c('0x3e')]=qs[_0x948c('0x3f')](_0x5883a3[_0x948c('0x36')][_0x948c('0x3f')]);_0x7f116d[_0x948c('0x40')]=qs['filters'](_[_0x948c('0x41')](_0x5883a3[_0x948c('0x36')],_0x426923[_0x948c('0x42')]),_0x28e2cf);if(_0x5883a3[_0x948c('0x36')][_0x948c('0x43')]){_0x7f116d[_0x948c('0x40')]=_[_0x948c('0x44')](_0x7f116d['where'],{'$or':_[_0x948c('0x32')](_0x28e2cf,function(_0x2bef13){if(_0x2bef13[_0x948c('0x34')]!==_0x948c('0x45')){var _0x59d317={};_0x59d317[_0x2bef13[_0x948c('0x2f')]]={'$like':'%'+_0x5883a3['query']['filter']+'%'};return _0x59d317;}})});}_0x7f116d=_[_0x948c('0x44')]({},_0x7f116d,_0x5883a3[_0x948c('0x46')]);var _0x5520a0={'where':_0x7f116d['where']};return db[_0x948c('0x47')][_0x948c('0x23')](_0x5520a0)[_0x948c('0x2a')](function(_0x1fecad){_0x446dd4[_0x948c('0x23')]=_0x1fecad;if(_0x5883a3[_0x948c('0x36')][_0x948c('0x48')]){_0x7f116d[_0x948c('0x49')]=[{'all':!![]}];}return db[_0x948c('0x47')][_0x948c('0x4a')](_0x7f116d);})[_0x948c('0x2a')](function(_0x38492c){_0x446dd4[_0x948c('0x4b')]=_0x38492c;return _0x446dd4;})[_0x948c('0x2a')](respondWithFilteredResult(_0x127591,_0x7f116d))[_0x948c('0x4c')](handleError(_0x127591,null));};exports[_0x948c('0x4d')]=function(_0x3df93b,_0x2038f0){var _0x60036a={'raw':!![],'where':{'id':_0x3df93b[_0x948c('0x4e')]['id']}},_0x306c18={};_0x306c18[_0x948c('0x35')]=_[_0x948c('0x37')](db[_0x948c('0x47')][_0x948c('0x33')]);_0x306c18['query']=_[_0x948c('0x37')](_0x3df93b['query']);_0x306c18['filters']=_[_0x948c('0x38')](_0x306c18[_0x948c('0x35')],_0x306c18[_0x948c('0x36')]);_0x60036a['attributes']=_[_0x948c('0x38')](_0x306c18[_0x948c('0x35')],qs[_0x948c('0x3a')](_0x3df93b[_0x948c('0x36')][_0x948c('0x3a')]));_0x60036a[_0x948c('0x39')]=_0x60036a[_0x948c('0x39')][_0x948c('0x3b')]?_0x60036a['attributes']:_0x306c18[_0x948c('0x35')];if(_0x3df93b[_0x948c('0x36')][_0x948c('0x48')]){_0x60036a['include']=[{'all':!![]}];}_0x60036a=_[_0x948c('0x44')]({},_0x60036a,_0x3df93b['options']);return db[_0x948c('0x47')][_0x948c('0x4f')](_0x60036a)[_0x948c('0x2a')](handleEntityNotFound(_0x2038f0,null))[_0x948c('0x2a')](respondWithResult(_0x2038f0,null))[_0x948c('0x4c')](handleError(_0x2038f0,null));};exports['create']=function(_0x3aa7b0,_0x37685a){return db[_0x948c('0x47')]['create'](_0x3aa7b0['body'],{})[_0x948c('0x2a')](function(_0x324d68){var _0x4a0aa1=_0x3aa7b0[_0x948c('0x50')]['get']({'plain':!![]});if(!_0x4a0aa1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a0aa1['role']===_0x948c('0x50')){var _0x24b6c1=_0x324d68[_0x948c('0x2c')]({'plain':!![]});var _0x4996ca=_0x948c('0x51');return db['UserProfileSection'][_0x948c('0x4f')]({'where':{'name':_0x4996ca,'userProfileId':_0x4a0aa1[_0x948c('0x52')]},'raw':!![]})[_0x948c('0x2a')](function(_0x48f457){if(_0x48f457&&_0x48f457['autoAssociation']===0x0){return db[_0x948c('0x53')]['create']({'name':_0x24b6c1[_0x948c('0x2f')],'resourceId':_0x24b6c1['id'],'type':_0x48f457['name'],'sectionId':_0x48f457['id']},{})[_0x948c('0x2a')](function(){return _0x324d68;});}else{return _0x324d68;}})['catch'](function(_0x4b0d6d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b0d6d);throw _0x4b0d6d;});}return _0x324d68;})[_0x948c('0x2a')](respondWithResult(_0x37685a,0xc9))[_0x948c('0x4c')](handleError(_0x37685a,null));};exports[_0x948c('0x29')]=function(_0x1b3085,_0x3a1c12){if(_0x1b3085[_0x948c('0x54')]['id']){delete _0x1b3085[_0x948c('0x54')]['id'];}return db[_0x948c('0x47')][_0x948c('0x4f')]({'where':{'id':_0x1b3085[_0x948c('0x4e')]['id']}})[_0x948c('0x2a')](handleEntityNotFound(_0x3a1c12,null))[_0x948c('0x2a')](saveUpdates(_0x1b3085[_0x948c('0x54')],null))[_0x948c('0x2a')](respondWithResult(_0x3a1c12,null))[_0x948c('0x4c')](handleError(_0x3a1c12,null));};exports[_0x948c('0x2b')]=function(_0x54ade9,_0x324ba4){return db['FaxQueue'][_0x948c('0x4f')]({'where':{'id':_0x54ade9[_0x948c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x324ba4,null))[_0x948c('0x2a')](removeEntity(_0x324ba4,null))[_0x948c('0x4c')](handleError(_0x324ba4,null));};exports['describe']=function(_0x8bbd86,_0x467d05){return db[_0x948c('0x47')][_0x948c('0x55')]()[_0x948c('0x2a')](respondWithResult(_0x467d05,null))[_0x948c('0x4c')](handleError(_0x467d05,null));};exports[_0x948c('0x56')]=function(_0x150047,_0x453e6d,_0x3f6743){var _0x597c1b={'raw':!![],'where':{}},_0x3d2173={},_0x47b5ea;return db[_0x948c('0x47')]['findOne']({'where':{'id':_0x150047['params']['id']}})['then'](handleEntityNotFound(_0x453e6d,null))[_0x948c('0x2a')](function(_0x73b8c9){if(_0x73b8c9){_0x47b5ea=_0x73b8c9[_0x948c('0x2c')]({'plain':!![]});_0x3d2173[_0x948c('0x35')]=_[_0x948c('0x37')](db['UserFaxQueue'][_0x948c('0x33')]);_0x3d2173[_0x948c('0x36')]=_[_0x948c('0x37')](_0x150047[_0x948c('0x36')]);_0x3d2173['filters']=_[_0x948c('0x38')](_0x3d2173[_0x948c('0x35')],_0x3d2173['query']);_0x597c1b[_0x948c('0x39')]=_[_0x948c('0x38')](_0x3d2173[_0x948c('0x35')],qs[_0x948c('0x3a')](_0x150047['query'][_0x948c('0x3a')]));_0x597c1b['attributes']=_0x597c1b['attributes'][_0x948c('0x3b')]?_0x597c1b[_0x948c('0x39')]:_0x3d2173[_0x948c('0x35')];if(!_0x150047[_0x948c('0x36')][_0x948c('0x3c')](_0x948c('0x3d'))){_0x597c1b[_0x948c('0x22')]=qs[_0x948c('0x22')](_0x150047[_0x948c('0x36')][_0x948c('0x22')]);_0x597c1b[_0x948c('0x24')]=qs[_0x948c('0x24')](_0x150047['query'][_0x948c('0x24')]);}_0x597c1b[_0x948c('0x3e')]=qs[_0x948c('0x3f')](_0x150047[_0x948c('0x36')][_0x948c('0x3f')]);_0x597c1b['where']=qs['filters'](_[_0x948c('0x41')](_0x150047[_0x948c('0x36')],_0x3d2173[_0x948c('0x42')]));_0x597c1b[_0x948c('0x40')]['FaxQueueId']=_0x73b8c9['id'];if(_0x150047[_0x948c('0x36')][_0x948c('0x43')]){_0x597c1b[_0x948c('0x40')]=_[_0x948c('0x44')](_0x597c1b[_0x948c('0x40')],{'$or':_['map'](_0x597c1b[_0x948c('0x39')],function(_0x339f32){var _0x31f2ec={};_0x31f2ec[_0x339f32]={'$like':'%'+_0x150047[_0x948c('0x36')][_0x948c('0x43')]+'%'};return _0x31f2ec;})});}_0x597c1b=_[_0x948c('0x44')]({},_0x597c1b,_0x150047['options']);return db[_0x948c('0x57')][_0x948c('0x4a')](_0x597c1b);}})[_0x948c('0x2a')](function(_0x55010a){if(_0x55010a){return db[_0x948c('0x58')][_0x948c('0x59')]({'where':{'id':_['map'](_0x55010a,_0x948c('0x5a')),'role':'agent'},'attributes':['id',_0x948c('0x2f'),_0x948c('0x5b'),_0x948c('0x5c'),_0x948c('0x5d')]});}})[_0x948c('0x2a')](function(_0x1b169e){if(_0x1b169e){return{'count':_0x1b169e[_0x948c('0x23')],'rows':_['map'](_0x1b169e[_0x948c('0x4b')],function(_0xa23e6c){return{'membername':_0xa23e6c[_0x948c('0x2f')],'UserId':_0xa23e6c['id'],'queue_name':_0x47b5ea['name'],'FaxQueueId':_0x47b5ea['id'],'interface':util['format'](_0x948c('0x5e'),_0x948c('0x5f'),_0xa23e6c[_0x948c('0x2f')]),'penalty':0x0,'paused':_0xa23e6c['faxPause'],'createdAt':_0xa23e6c['createdAt'],'updatedAt':_0xa23e6c[_0x948c('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x453e6d,_0x597c1b))[_0x948c('0x4c')](handleError(_0x453e6d,null));};exports[_0x948c('0x60')]=function(_0x1b8fb7,_0x26ca6d,_0x546d41){var _0x1caaa8={};var _0x543707={};var _0x160bf9;var _0x43a76f;return db[_0x948c('0x47')][_0x948c('0x61')]({'where':{'id':_0x1b8fb7['params']['id']}})['then'](handleEntityNotFound(_0x26ca6d,null))[_0x948c('0x2a')](function(_0x384bcd){if(_0x384bcd){_0x160bf9=_0x384bcd;_0x543707[_0x948c('0x35')]=_['keys'](db[_0x948c('0x62')][_0x948c('0x33')]);_0x543707['query']=_[_0x948c('0x37')](_0x1b8fb7[_0x948c('0x36')]);_0x543707[_0x948c('0x42')]=_[_0x948c('0x38')](_0x543707[_0x948c('0x35')],_0x543707[_0x948c('0x36')]);_0x1caaa8['attributes']=_['intersection'](_0x543707['model'],qs[_0x948c('0x3a')](_0x1b8fb7[_0x948c('0x36')]['fields']));_0x1caaa8[_0x948c('0x39')]=_0x1caaa8[_0x948c('0x39')][_0x948c('0x3b')]?_0x1caaa8[_0x948c('0x39')]:_0x543707[_0x948c('0x35')];_0x1caaa8[_0x948c('0x3e')]=qs[_0x948c('0x3f')](_0x1b8fb7[_0x948c('0x36')][_0x948c('0x3f')]);_0x1caaa8[_0x948c('0x40')]=qs[_0x948c('0x42')](_[_0x948c('0x41')](_0x1b8fb7[_0x948c('0x36')],_0x543707['filters']));if(_0x1b8fb7[_0x948c('0x36')][_0x948c('0x43')]){_0x1caaa8['where']=_[_0x948c('0x44')](_0x1caaa8['where'],{'$or':_[_0x948c('0x32')](_0x1caaa8[_0x948c('0x39')],function(_0x4cd086){var _0x4d1f2a={};_0x4d1f2a[_0x4cd086]={'$like':'%'+_0x1b8fb7['query']['filter']+'%'};return _0x4d1f2a;})});}_0x1caaa8=_[_0x948c('0x44')]({},_0x1caaa8,_0x1b8fb7['options']);return _0x160bf9[_0x948c('0x60')](_0x1caaa8);}})[_0x948c('0x2a')](function(_0x4f38dd){if(_0x4f38dd){_0x43a76f=_0x4f38dd[_0x948c('0x3b')];if(!_0x1b8fb7[_0x948c('0x36')][_0x948c('0x3c')]('nolimit')){_0x1caaa8['limit']=qs[_0x948c('0x22')](_0x1b8fb7[_0x948c('0x36')][_0x948c('0x22')]);_0x1caaa8[_0x948c('0x24')]=qs[_0x948c('0x24')](_0x1b8fb7[_0x948c('0x36')][_0x948c('0x24')]);}return _0x160bf9[_0x948c('0x60')](_0x1caaa8);}})[_0x948c('0x2a')](function(_0x57748c){if(_0x57748c){return _0x57748c?{'count':_0x43a76f,'rows':_0x57748c}:null;}})['then'](respondWithResult(_0x26ca6d,null))[_0x948c('0x4c')](handleError(_0x26ca6d,null));};exports[_0x948c('0x63')]=function(_0x342593,_0x219f57,_0x47d29b){var _0x4ba623=_0x342593[_0x948c('0x54')][_0x948c('0x64')];return db[_0x948c('0x62')][_0x948c('0x4a')]({'where':{'id':_0x4ba623},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x948c('0x2f'),'online',_0x948c('0x65'),_0x948c('0x66')],'raw':!![]}]})[_0x948c('0x2a')](function(_0x1cf57d){if(_0x1cf57d){var _0x459a03=_['flatMap'](_0x1cf57d,function(_0x543464){var _0x4405a1=_0x543464[_0x948c('0x2c')]({'plain':!![]});return _0x4405a1[_0x948c('0x67')];});return db['FaxQueue'][_0x948c('0x4f')]({'where':{'id':_0x342593['params']['id']}})[_0x948c('0x2a')](function(_0x4239eb){return db[_0x948c('0x68')]['transaction'](function(_0x4ee1da){return _0x4239eb['addTeams'](_0x4ba623,{'transaction':_0x4ee1da})['then'](function(){return BPromise[_0x948c('0x69')](_0x459a03,function(_0x41ead8){return db[_0x948c('0x57')][_0x948c('0x6a')]({'where':{'UserId':_0x41ead8['id'],'FaxQueueId':_0x342593[_0x948c('0x4e')]['id']},'transaction':_0x4ee1da});});})[_0x948c('0x2a')](function(){_0x459a03[_0x948c('0x6b')](function(_0x54deee){socket['emit'](_0x948c('0x6c'),{'UserId':_0x54deee['id'],'FaxQueueId':_0x4239eb['id']});});});});});}})['then'](respondWithStatusCode(_0x219f57,null))[_0x948c('0x4c')](handleError(_0x219f57,null));};exports[_0x948c('0x6d')]=function(_0x53d648,_0x32bdce,_0x888da2){return db[_0x948c('0x62')][_0x948c('0x4a')]({'where':{'id':_0x53d648[_0x948c('0x36')][_0x948c('0x64')]},'attributes':['id'],'include':[{'model':db[_0x948c('0x58')],'as':_0x948c('0x67'),'attributes':['id'],'raw':!![]}]})[_0x948c('0x2a')](handleEntityNotFound(_0x32bdce,null))[_0x948c('0x2a')](function(_0x122c42){var _0x30f519=_['map'](_0x122c42,'id');var _0x443592=[];var _0x47cac3=[];var _0x124f93=squel['select']();_0x124f93['field'](_0x948c('0x6e'))[_0x948c('0x6f')](_0x948c('0x70'),'tq')[_0x948c('0x71')]('user_has_teams','ut',_0x948c('0x72'))[_0x948c('0x40')](_0x948c('0x73'),_0x53d648['params']['id']);for(var _0x3a63d5=0x0;_0x3a63d5<_0x122c42[_0x948c('0x3b')];_0x3a63d5+=0x1){let _0xc5ab70=_0x122c42[_0x3a63d5];for(var _0x3aa09b=0x0;_0x3aa09b<_0xc5ab70[_0x948c('0x67')][_0x948c('0x3b')];_0x3aa09b+=0x1){let _0x381531=_0xc5ab70[_0x948c('0x67')][_0x3aa09b];var _0x200ff9=_0x124f93['clone']();_0x200ff9['where'](_0x948c('0x74'),_0x381531['id']);_0x47cac3[_0x948c('0x75')](db[_0x948c('0x68')][_0x948c('0x36')](_0x200ff9[_0x948c('0x76')](),{'type':db['sequelize'][_0x948c('0x77')][_0x948c('0x78')]})[_0x948c('0x2a')](function(_0x4fcdd3){if(_0x4fcdd3['length']===0x1){return _0x381531['id'];}else{var _0x252a9d=_[_0x948c('0x79')](_[_0x948c('0x32')](_0x4fcdd3,'TeamId'),function(_0x2f23bf){return _['includes'](_0x30f519,_0x2f23bf);});if(_0x252a9d){return _0x381531['id'];}}}));}}return BPromise[_0x948c('0x7a')](_0x47cac3)[_0x948c('0x2a')](function(_0x25a6fb){_0x443592=_(_0x443592)[_0x948c('0x7b')](_0x25a6fb)['compact']()[_0x948c('0x7c')]();return db[_0x948c('0x47')][_0x948c('0x4f')]({'where':{'id':_0x53d648[_0x948c('0x4e')]['id']}})[_0x948c('0x2a')](function(_0x441598){return db[_0x948c('0x68')][_0x948c('0x7d')](function(_0x570bb9){return _0x441598[_0x948c('0x6d')](_0x53d648[_0x948c('0x36')][_0x948c('0x64')],{'transaction':_0x570bb9})[_0x948c('0x2a')](function(){if(!_[_0x948c('0x7e')](_0x443592)){return _0x441598[_0x948c('0x7f')](_0x443592,{'transaction':_0x570bb9});}})['then'](function(){_0x443592[_0x948c('0x6b')](function(_0x231e65){socket[_0x948c('0x80')](_0x948c('0x81'),{'UserId':_0x231e65,'FaxQueueId':_0x441598['id']});});});});});});})[_0x948c('0x2a')](respondWithStatusCode(_0x32bdce,null))['catch'](handleError(_0x32bdce,null));};exports[_0x948c('0x82')]=function(_0x14fcd5,_0x5aa96e,_0x286797){return db[_0x948c('0x47')][_0x948c('0x4f')]({'where':{'id':_0x14fcd5[_0x948c('0x4e')]['id']}})[_0x948c('0x2a')](handleEntityNotFound(_0x5aa96e,null))[_0x948c('0x2a')](function(_0x46583d){if(_0x46583d){return _0x46583d[_0x948c('0x82')](_0x14fcd5[_0x948c('0x54')]['ids'],_[_0x948c('0x83')](_0x14fcd5[_0x948c('0x54')],['ids','id'])||{})[_0x948c('0x84')](function(_0x410029){for(var _0x226362=0x0;_0x226362<_0x14fcd5[_0x948c('0x54')]['ids'][_0x948c('0x3b')];_0x226362+=0x1){socket[_0x948c('0x80')](_0x948c('0x6c'),{'UserId':Number(_0x14fcd5[_0x948c('0x54')][_0x948c('0x64')][_0x226362]),'FaxQueueId':Number(_0x14fcd5[_0x948c('0x4e')]['id'])});}return _0x410029;});}})[_0x948c('0x2a')](respondWithResult(_0x5aa96e,null))[_0x948c('0x4c')](handleError(_0x5aa96e,null));};exports[_0x948c('0x7f')]=function(_0x2eb361,_0xcbe697,_0x4cb57d){return db[_0x948c('0x47')][_0x948c('0x4f')]({'where':{'id':_0x2eb361[_0x948c('0x4e')]['id']}})[_0x948c('0x2a')](handleEntityNotFound(_0xcbe697,null))[_0x948c('0x2a')](function(_0x188972){if(_0x188972){return _0x188972['removeAgents'](_0x2eb361[_0x948c('0x36')]['ids'])[_0x948c('0x2a')](function(){if(_[_0x948c('0x85')](_0x2eb361[_0x948c('0x36')][_0x948c('0x64')])){for(var _0x172bbf=0x0;_0x172bbf<_0x2eb361['query'][_0x948c('0x64')][_0x948c('0x3b')];_0x172bbf+=0x1){socket[_0x948c('0x80')](_0x948c('0x81'),{'UserId':Number(_0x2eb361[_0x948c('0x36')][_0x948c('0x64')][_0x172bbf]),'FaxQueueId':Number(_0x2eb361[_0x948c('0x4e')]['id'])});}}else{socket[_0x948c('0x80')]('userFaxQueue:remove',{'UserId':Number(_0x2eb361[_0x948c('0x36')][_0x948c('0x64')]),'FaxQueueId':Number(_0x2eb361[_0x948c('0x4e')]['id'])});}});}})[_0x948c('0x2a')](respondWithStatusCode(_0xcbe697,null))['catch'](handleError(_0xcbe697,null));};exports[_0x948c('0x86')]=function(_0x676c39,_0x3581d8,_0xf5d802){var _0x33effa={};var _0xa57bb7={};var _0xbd9ef8;var _0xd6f685;return db[_0x948c('0x47')]['findOne']({'where':{'id':_0x676c39[_0x948c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3581d8,null))[_0x948c('0x2a')](function(_0x22dc66){if(_0x22dc66){_0xbd9ef8=_0x22dc66;_0xa57bb7[_0x948c('0x35')]=_['keys'](db[_0x948c('0x58')][_0x948c('0x33')]);_0xa57bb7['query']=_[_0x948c('0x37')](_0x676c39['query']);_0xa57bb7['filters']=_[_0x948c('0x38')](_0xa57bb7[_0x948c('0x35')],_0xa57bb7[_0x948c('0x36')]);_0x33effa['attributes']=_[_0x948c('0x38')](_0xa57bb7[_0x948c('0x35')],qs[_0x948c('0x3a')](_0x676c39[_0x948c('0x36')][_0x948c('0x3a')]));_0x33effa[_0x948c('0x39')]=_0x33effa['attributes'][_0x948c('0x3b')]?_0x33effa[_0x948c('0x39')]:_0xa57bb7['model'];_0x33effa['order']=qs['sort'](_0x676c39[_0x948c('0x36')][_0x948c('0x3f')]);_0x33effa[_0x948c('0x40')]=qs[_0x948c('0x42')](_[_0x948c('0x41')](_0x676c39['query'],_0xa57bb7[_0x948c('0x42')]));if(_0x676c39[_0x948c('0x36')][_0x948c('0x43')]){_0x33effa['where']=_[_0x948c('0x44')](_0x33effa[_0x948c('0x40')],{'$or':_[_0x948c('0x32')](_0x33effa[_0x948c('0x39')],function(_0x5f1214){var _0x41bf86={};_0x41bf86[_0x5f1214]={'$like':'%'+_0x676c39[_0x948c('0x36')][_0x948c('0x43')]+'%'};return _0x41bf86;})});}_0x33effa=_[_0x948c('0x44')]({},_0x33effa,_0x676c39[_0x948c('0x46')]);return _0xbd9ef8[_0x948c('0x86')](_0x33effa);}})[_0x948c('0x2a')](function(_0x1c0e91){if(_0x1c0e91){_0xd6f685=_0x1c0e91[_0x948c('0x3b')];if(!_0x676c39[_0x948c('0x36')][_0x948c('0x3c')](_0x948c('0x3d'))){_0x33effa[_0x948c('0x22')]=qs['limit'](_0x676c39[_0x948c('0x36')][_0x948c('0x22')]);_0x33effa[_0x948c('0x24')]=qs[_0x948c('0x24')](_0x676c39[_0x948c('0x36')]['offset']);}return _0xbd9ef8[_0x948c('0x86')](_0x33effa);}})[_0x948c('0x2a')](function(_0x366983){if(_0x366983){return _0x366983?{'count':_0xd6f685,'rows':_0x366983}:null;}})['then'](respondWithResult(_0x3581d8,null))['catch'](handleError(_0x3581d8,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index de6ee32..99990c0 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 _0x6713=['emit','hasOwnProperty','hook','exports','../../mysqldb','update'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x6713,0x76));var _0x3671=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x6713[_0x1e3c16];return _0x47a0c9;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x3671('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3671('0x1'),'afterDestroy':'remove'};function emitEvent(_0x3cfd71){return function(_0x58f1da,_0x13e5a7,_0x3d935f){FaxQueueEvents[_0x3671('0x2')](_0x3cfd71+':'+_0x58f1da['id'],_0x58f1da);FaxQueueEvents[_0x3671('0x2')](_0x3cfd71,_0x58f1da);_0x3d935f(null);};}for(var e in events){if(events[_0x3671('0x3')](e)){var event=events[e];FaxQueue[_0x3671('0x4')](e,emitEvent(event));}}module[_0x3671('0x5')]=FaxQueueEvents; \ No newline at end of file +var _0x40bd=['hasOwnProperty','hook','../../mysqldb','FaxQueue','save','update','remove','emit'];(function(_0x198d9e,_0x2d6b7a){var _0x3d9561=function(_0x28be96){while(--_0x28be96){_0x198d9e['push'](_0x198d9e['shift']());}};_0x3d9561(++_0x2d6b7a);}(_0x40bd,0x6a));var _0xd40b=function(_0x2946b5,_0x131d9c){_0x2946b5=_0x2946b5-0x0;var _0x4b2e6d=_0x40bd[_0x2946b5];return _0x4b2e6d;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xd40b('0x0'))['db'][_0xd40b('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd40b('0x2'),'afterUpdate':_0xd40b('0x3'),'afterDestroy':_0xd40b('0x4')};function emitEvent(_0x1840fa){return function(_0x5ca24d,_0x1c9e42,_0x332c00){FaxQueueEvents[_0xd40b('0x5')](_0x1840fa+':'+_0x5ca24d['id'],_0x5ca24d);FaxQueueEvents[_0xd40b('0x5')](_0x1840fa,_0x5ca24d);_0x332c00(null);};}for(var e in events){if(events[_0xd40b('0x6')](e)){var event=events[e];FaxQueue[_0xd40b('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index e8b4015..1914473 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 _0xe442=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxQueue','lodash','util'];(function(_0x30a7dc,_0x9d3f5a){var _0xf88d05=function(_0x369e9e){while(--_0x369e9e){_0x30a7dc['push'](_0x30a7dc['shift']());}};_0xf88d05(++_0x9d3f5a);}(_0xe442,0x18a));var _0x2e44=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xe442[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x2e44('0x0'));var util=require(_0x2e44('0x1'));var logger=require(_0x2e44('0x2'))('api');var moment=require(_0x2e44('0x3'));var BPromise=require('bluebird');var rp=require(_0x2e44('0x4'));var fs=require('fs');var path=require(_0x2e44('0x5'));var rimraf=require(_0x2e44('0x6'));var config=require(_0x2e44('0x7'));var attributes=require('./faxQueue.attributes');module[_0x2e44('0x8')]=function(_0x3d21c6,_0x1e4b7f){return _0x3d21c6[_0x2e44('0x9')](_0x2e44('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0991=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x0991,0x191));var _0x1099=function(_0x4676bb,_0x113adc){_0x4676bb=_0x4676bb-0x0;var _0x39ddb7=_0x0991[_0x4676bb];return _0x39ddb7;};'use strict';var _=require(_0x1099('0x0'));var util=require(_0x1099('0x1'));var logger=require(_0x1099('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1099('0x3'));var fs=require('fs');var path=require(_0x1099('0x4'));var rimraf=require(_0x1099('0x5'));var config=require('../../config/environment');var attributes=require(_0x1099('0x6'));module[_0x1099('0x7')]=function(_0x2fe0dc,_0x4dd646){return _0x2fe0dc[_0x1099('0x8')](_0x1099('0x9'),attributes,{'tableName':_0x1099('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 64415a0..f0eb25f 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 _0x48c7=['FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','FaxQueue','options','attributes','limit','map','include','model','ShowFaxQueue','raw','where','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x49ed69,_0x5867ce){var _0x5e9426=function(_0x399d76){while(--_0x399d76){_0x49ed69['push'](_0x49ed69['shift']());}};_0x5e9426(++_0x5867ce);}(_0x48c7,0xf5));var _0x748c=function(_0x915de9,_0xabf9e5){_0x915de9=_0x915de9-0x0;var _0x274129=_0x48c7[_0x915de9];return _0x274129;};'use strict';var _=require(_0x748c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x748c('0x1'));var rs=require(_0x748c('0x2'));var fs=require('fs');var Redis=require(_0x748c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x748c('0x4'));var logger=require(_0x748c('0x5'))(_0x748c('0x6'));var config=require(_0x748c('0x7'));var jayson=require(_0x748c('0x8'));var client=jayson[_0x748c('0x9')]['http']({'port':0x232a});config['redis']=_[_0x748c('0xa')](config[_0x748c('0xb')],{'host':_0x748c('0xc'),'port':0x18eb});var socket=require(_0x748c('0xd'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x748c('0xe')](socket);function respondWithRpcPromise(_0x2004f6,_0x48e3aa,_0x3b1f51){return new BPromise(function(_0x391d78,_0x1471f3){return client[_0x748c('0xf')](_0x2004f6,_0x3b1f51)[_0x748c('0x10')](function(_0x40f3d5){logger[_0x748c('0x11')](_0x748c('0x12'),_0x48e3aa,_0x748c('0x13'));logger[_0x748c('0x14')](_0x748c('0x15'),_0x48e3aa,_0x748c('0x13'),JSON[_0x748c('0x16')](_0x40f3d5));if(_0x40f3d5['error']){if(_0x40f3d5[_0x748c('0x17')]['code']===0x1f4){logger[_0x748c('0x17')](_0x748c('0x12'),_0x48e3aa,_0x40f3d5[_0x748c('0x17')][_0x748c('0x18')]);return _0x1471f3(_0x40f3d5['error'][_0x748c('0x18')]);}logger[_0x748c('0x17')](_0x748c('0x12'),_0x48e3aa,_0x40f3d5[_0x748c('0x17')][_0x748c('0x18')]);return _0x391d78(_0x40f3d5[_0x748c('0x17')]['message']);}else{logger[_0x748c('0x11')](_0x748c('0x12'),_0x48e3aa,_0x748c('0x13'));_0x391d78(_0x40f3d5[_0x748c('0x19')][_0x748c('0x18')]);}})[_0x748c('0x1a')](function(_0xe2b0c4){logger[_0x748c('0x17')](_0x748c('0x12'),_0x48e3aa,_0xe2b0c4);_0x1471f3(_0xe2b0c4);});});}exports[_0x748c('0x1b')]=function(_0x4bd5a5){var _0x1be7a0=this;return new Promise(function(_0x591ba7,_0x4f9a59){return db[_0x748c('0x1c')]['findAll']({'raw':_0x4bd5a5[_0x748c('0x1d')]?_0x4bd5a5[_0x748c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4bd5a5[_0x748c('0x1d')]?_0x4bd5a5[_0x748c('0x1d')]['where']||null:null,'attributes':_0x4bd5a5[_0x748c('0x1d')]?_0x4bd5a5[_0x748c('0x1d')][_0x748c('0x1e')]||null:null,'limit':_0x4bd5a5['options']?_0x4bd5a5[_0x748c('0x1d')][_0x748c('0x1f')]||null:null,'include':_0x4bd5a5[_0x748c('0x1d')]?_0x4bd5a5['options']['include']?_[_0x748c('0x20')](_0x4bd5a5[_0x748c('0x1d')][_0x748c('0x21')],function(_0xad8ba9){return{'model':db[_0xad8ba9['model']],'as':_0xad8ba9['as'],'attributes':_0xad8ba9['attributes'],'include':_0xad8ba9[_0x748c('0x21')]?_['map'](_0xad8ba9[_0x748c('0x21')],function(_0x44c37f){return{'model':db[_0x44c37f[_0x748c('0x22')]],'as':_0x44c37f['as'],'attributes':_0x44c37f['attributes'],'include':_0x44c37f[_0x748c('0x21')]?_['map'](_0x44c37f[_0x748c('0x21')],function(_0x1c6a62){return{'model':db[_0x1c6a62['model']],'as':_0x1c6a62['as'],'attributes':_0x1c6a62[_0x748c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x748c('0x10')](function(_0x447d9d){logger['info']('GetFaxQueue',_0x4bd5a5);logger[_0x748c('0x14')](_0x748c('0x1b'),_0x4bd5a5,JSON[_0x748c('0x16')](_0x447d9d));_0x591ba7(_0x447d9d);})['catch'](function(_0x308c57){logger[_0x748c('0x17')](_0x748c('0x1b'),_0x308c57[_0x748c('0x18')],_0x4bd5a5);_0x4f9a59(_0x1be7a0[_0x748c('0x17')](0x1f4,_0x308c57[_0x748c('0x18')]));});});};exports[_0x748c('0x23')]=function(_0x523bfa){var _0x9df0e=this;return new Promise(function(_0x36a1c5,_0x13f7ce){return db[_0x748c('0x1c')]['find']({'raw':_0x523bfa[_0x748c('0x1d')]?_0x523bfa['options'][_0x748c('0x24')]===undefined?!![]:![]:!![],'where':_0x523bfa[_0x748c('0x1d')]?_0x523bfa['options'][_0x748c('0x25')]||null:null,'attributes':_0x523bfa[_0x748c('0x1d')]?_0x523bfa['options'][_0x748c('0x1e')]||null:null,'include':_0x523bfa[_0x748c('0x1d')]?_0x523bfa['options'][_0x748c('0x21')]?_[_0x748c('0x20')](_0x523bfa['options']['include'],function(_0x29bc2d){return{'model':db[_0x29bc2d['model']],'as':_0x29bc2d['as'],'attributes':_0x29bc2d[_0x748c('0x1e')],'include':_0x29bc2d[_0x748c('0x21')]?_[_0x748c('0x20')](_0x29bc2d['include'],function(_0x377739){return{'model':db[_0x377739[_0x748c('0x22')]],'as':_0x377739['as'],'attributes':_0x377739[_0x748c('0x1e')],'include':_0x377739[_0x748c('0x21')]?_['map'](_0x377739[_0x748c('0x21')],function(_0x18bc60){return{'model':db[_0x18bc60[_0x748c('0x22')]],'as':_0x18bc60['as'],'attributes':_0x18bc60[_0x748c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x748c('0x10')](function(_0x19dc80){logger[_0x748c('0x11')]('ShowFaxQueue',_0x523bfa);logger[_0x748c('0x14')]('ShowFaxQueue',_0x523bfa,JSON[_0x748c('0x16')](_0x19dc80));_0x36a1c5(_0x19dc80);})[_0x748c('0x1a')](function(_0x27fe89){logger['error']('ShowFaxQueue',_0x27fe89[_0x748c('0x18')],_0x523bfa);_0x13f7ce(_0x9df0e['error'](0x1f4,_0x27fe89['message']));});});}; \ No newline at end of file +var _0x377b=['jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','request\x20sent','debug','stringify','error','code','message','FaxQueue,\x20%s,\x20%s','info','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model','catch','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x386187,_0x1ad2ac){var _0x4abeaa=function(_0x251f63){while(--_0x251f63){_0x386187['push'](_0x386187['shift']());}};_0x4abeaa(++_0x1ad2ac);}(_0x377b,0x90));var _0xb377=function(_0x5778c9,_0x1b108d){_0x5778c9=_0x5778c9-0x0;var _0x3db288=_0x377b[_0x5778c9];return _0x3db288;};'use strict';var _=require(_0xb377('0x0'));var util=require(_0xb377('0x1'));var moment=require(_0xb377('0x2'));var BPromise=require(_0xb377('0x3'));var rs=require(_0xb377('0x4'));var fs=require('fs');var Redis=require(_0xb377('0x5'));var db=require(_0xb377('0x6'))['db'];var utils=require(_0xb377('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb377('0x8'));var client=jayson[_0xb377('0x9')][_0xb377('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb377('0xb')],{'host':_0xb377('0xc'),'port':0x18eb});var socket=require(_0xb377('0xd'))(new Redis(config[_0xb377('0xb')]));require('./faxQueue.socket')[_0xb377('0xe')](socket);function respondWithRpcPromise(_0x1634e8,_0x3ab2e,_0x5db344){return new BPromise(function(_0x25990a,_0xffab03){return client['request'](_0x1634e8,_0x5db344)[_0xb377('0xf')](function(_0x48d0f8){logger['info']('FaxQueue,\x20%s,\x20%s',_0x3ab2e,_0xb377('0x10'));logger[_0xb377('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3ab2e,_0xb377('0x10'),JSON[_0xb377('0x12')](_0x48d0f8));if(_0x48d0f8[_0xb377('0x13')]){if(_0x48d0f8[_0xb377('0x13')][_0xb377('0x14')]===0x1f4){logger[_0xb377('0x13')]('FaxQueue,\x20%s,\x20%s',_0x3ab2e,_0x48d0f8[_0xb377('0x13')][_0xb377('0x15')]);return _0xffab03(_0x48d0f8[_0xb377('0x13')]['message']);}logger[_0xb377('0x13')](_0xb377('0x16'),_0x3ab2e,_0x48d0f8[_0xb377('0x13')][_0xb377('0x15')]);return _0x25990a(_0x48d0f8[_0xb377('0x13')][_0xb377('0x15')]);}else{logger[_0xb377('0x17')](_0xb377('0x16'),_0x3ab2e,_0xb377('0x10'));_0x25990a(_0x48d0f8[_0xb377('0x18')][_0xb377('0x15')]);}})['catch'](function(_0x43496f){logger[_0xb377('0x13')]('FaxQueue,\x20%s,\x20%s',_0x3ab2e,_0x43496f);_0xffab03(_0x43496f);});});}exports[_0xb377('0x19')]=function(_0x1379e7){var _0x9d8525=this;return new Promise(function(_0x575564,_0x2bb9cd){return db[_0xb377('0x1a')][_0xb377('0x1b')]({'raw':_0x1379e7[_0xb377('0x1c')]?_0x1379e7['options'][_0xb377('0x1d')]===undefined?!![]:![]:!![],'where':_0x1379e7[_0xb377('0x1c')]?_0x1379e7['options'][_0xb377('0x1e')]||null:null,'attributes':_0x1379e7[_0xb377('0x1c')]?_0x1379e7[_0xb377('0x1c')][_0xb377('0x1f')]||null:null,'limit':_0x1379e7['options']?_0x1379e7['options']['limit']||null:null,'include':_0x1379e7[_0xb377('0x1c')]?_0x1379e7['options'][_0xb377('0x20')]?_['map'](_0x1379e7[_0xb377('0x1c')][_0xb377('0x20')],function(_0x1593db){return{'model':db[_0x1593db['model']],'as':_0x1593db['as'],'attributes':_0x1593db['attributes'],'include':_0x1593db[_0xb377('0x20')]?_[_0xb377('0x21')](_0x1593db[_0xb377('0x20')],function(_0x2cf374){return{'model':db[_0x2cf374[_0xb377('0x22')]],'as':_0x2cf374['as'],'attributes':_0x2cf374[_0xb377('0x1f')],'include':_0x2cf374[_0xb377('0x20')]?_[_0xb377('0x21')](_0x2cf374['include'],function(_0x1e7ad8){return{'model':db[_0x1e7ad8[_0xb377('0x22')]],'as':_0x1e7ad8['as'],'attributes':_0x1e7ad8[_0xb377('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb377('0xf')](function(_0x58847f){logger['info'](_0xb377('0x19'),_0x1379e7);logger[_0xb377('0x11')](_0xb377('0x19'),_0x1379e7,JSON[_0xb377('0x12')](_0x58847f));_0x575564(_0x58847f);})[_0xb377('0x23')](function(_0x75e281){logger['error'](_0xb377('0x19'),_0x75e281[_0xb377('0x15')],_0x1379e7);_0x2bb9cd(_0x9d8525[_0xb377('0x13')](0x1f4,_0x75e281[_0xb377('0x15')]));});});};exports[_0xb377('0x24')]=function(_0x19a907){var _0x4a5d75=this;return new Promise(function(_0x2c575d,_0x118fc7){return db['FaxQueue'][_0xb377('0x25')]({'raw':_0x19a907[_0xb377('0x1c')]?_0x19a907[_0xb377('0x1c')][_0xb377('0x1d')]===undefined?!![]:![]:!![],'where':_0x19a907['options']?_0x19a907[_0xb377('0x1c')][_0xb377('0x1e')]||null:null,'attributes':_0x19a907[_0xb377('0x1c')]?_0x19a907[_0xb377('0x1c')][_0xb377('0x1f')]||null:null,'include':_0x19a907['options']?_0x19a907[_0xb377('0x1c')][_0xb377('0x20')]?_['map'](_0x19a907['options'][_0xb377('0x20')],function(_0x5ad537){return{'model':db[_0x5ad537[_0xb377('0x22')]],'as':_0x5ad537['as'],'attributes':_0x5ad537[_0xb377('0x1f')],'include':_0x5ad537['include']?_[_0xb377('0x21')](_0x5ad537['include'],function(_0x518786){return{'model':db[_0x518786[_0xb377('0x22')]],'as':_0x518786['as'],'attributes':_0x518786[_0xb377('0x1f')],'include':_0x518786[_0xb377('0x20')]?_[_0xb377('0x21')](_0x518786[_0xb377('0x20')],function(_0x1cae2a){return{'model':db[_0x1cae2a[_0xb377('0x22')]],'as':_0x1cae2a['as'],'attributes':_0x1cae2a[_0xb377('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb377('0xf')](function(_0x41919f){logger[_0xb377('0x17')](_0xb377('0x24'),_0x19a907);logger['debug']('ShowFaxQueue',_0x19a907,JSON['stringify'](_0x41919f));_0x2c575d(_0x41919f);})[_0xb377('0x23')](function(_0x1d214e){logger[_0xb377('0x13')](_0xb377('0x24'),_0x1d214e['message'],_0x19a907);_0x118fc7(_0x4a5d75[_0xb377('0x13')](0x1f4,_0x1d214e[_0xb377('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 6ac3e4e..b963ed0 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 _0xc090=['register','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x13a4c2,_0x47c109){var _0x14b7b4=function(_0x22ce71){while(--_0x22ce71){_0x13a4c2['push'](_0x13a4c2['shift']());}};_0x14b7b4(++_0x47c109);}(_0xc090,0x112));var _0x0c09=function(_0x51a826,_0x5df508){_0x51a826=_0x51a826-0x0;var _0xa2d66e=_0xc090[_0x51a826];return _0xa2d66e;};'use strict';var FaxQueueEvents=require(_0x0c09('0x0'));var events=[_0x0c09('0x1'),_0x0c09('0x2'),_0x0c09('0x3')];function createListener(_0x1b6b5c,_0x1b296d){return function(_0x289436){_0x1b296d[_0x0c09('0x4')](_0x1b6b5c,_0x289436);};}function removeListener(_0x11984f,_0x487f03){return function(){FaxQueueEvents[_0x0c09('0x5')](_0x11984f,_0x487f03);};}exports[_0x0c09('0x6')]=function(_0x4f3f48){for(var _0x49a403=0x0,_0x4c2143=events['length'];_0x49a403<_0x4c2143;_0x49a403++){var _0x1f1a58=events[_0x49a403];var _0x2854d8=createListener(_0x0c09('0x7')+_0x1f1a58,_0x4f3f48);FaxQueueEvents['on'](_0x1f1a58,_0x2854d8);}}; \ No newline at end of file +var _0xd765=['save','remove','update','emit','removeListener','length','./faxQueue.events'];(function(_0x1a8f7b,_0x1c1279){var _0x3641fe=function(_0x1a8266){while(--_0x1a8266){_0x1a8f7b['push'](_0x1a8f7b['shift']());}};_0x3641fe(++_0x1c1279);}(_0xd765,0xdf));var _0x5d76=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd765[_0x27af45];return _0x18df21;};'use strict';var FaxQueueEvents=require(_0x5d76('0x0'));var events=[_0x5d76('0x1'),_0x5d76('0x2'),_0x5d76('0x3')];function createListener(_0x245264,_0x44fed4){return function(_0x4ce5da){_0x44fed4[_0x5d76('0x4')](_0x245264,_0x4ce5da);};}function removeListener(_0x5f18e0,_0x1a7983){return function(){FaxQueueEvents[_0x5d76('0x5')](_0x5f18e0,_0x1a7983);};}exports['register']=function(_0x280536){for(var _0x175058=0x0,_0x444693=events[_0x5d76('0x6')];_0x175058<_0x444693;_0x175058++){var _0x333db6=events[_0x175058];var _0x116d32=createListener('faxQueue:'+_0x333db6,_0x280536);FaxQueueEvents['on'](_0x333db6,_0x116d32);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index f8d219b..1d87703 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 _0x4819=['describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','/describe'];(function(_0x3a556e,_0x32191b){var _0xfe3a36=function(_0x9b32a3){while(--_0x9b32a3){_0x3a556e['push'](_0x3a556e['shift']());}};_0xfe3a36(++_0x32191b);}(_0x4819,0xcd));var _0x9481=function(_0x2afaf3,_0x4ebf7a){_0x2afaf3=_0x2afaf3-0x0;var _0xf45003=_0x4819[_0x2afaf3];return _0xf45003;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['get'](_0x9481('0x10'),auth['isAuthenticated'](),controller[_0x9481('0x11')]);router[_0x9481('0xd')](_0x9481('0x12'),auth[_0x9481('0xa')](),controller[_0x9481('0x13')]);router[_0x9481('0xd')](_0x9481('0x14'),auth[_0x9481('0xa')](),controller[_0x9481('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9481('0x16')]);router[_0x9481('0x17')](_0x9481('0x12'),auth[_0x9481('0xa')](),controller[_0x9481('0x18')]);router[_0x9481('0x17')](_0x9481('0x14'),auth['isAuthenticated'](),controller[_0x9481('0x19')]);router[_0x9481('0x1a')]('/:id',auth[_0x9481('0xa')](),controller['update']);router[_0x9481('0x1b')](_0x9481('0xe'),auth[_0x9481('0xa')](),controller[_0x9481('0x1c')]);router['delete']('/:id/teams',auth[_0x9481('0xa')](),controller['removeTeams']);router['delete'](_0x9481('0x14'),auth[_0x9481('0xa')](),controller[_0x9481('0x1d')]);module[_0x9481('0x1e')]=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(_0x41d44b,_0x22ef83){var _0x38dba7=function(_0x33952f){while(--_0x33952f){_0x41d44b['push'](_0x41d44b['shift']());}};_0x38dba7(++_0x22ef83);}(_0x33af,0xec));var _0xf33a=function(_0x2c4d9f,_0x266437){_0x2c4d9f=_0x2c4d9f-0x0;var _0x3c558a=_0x33af[_0x2c4d9f];return _0x3c558a;};'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 f79b77f..dff6458 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 _0x5824=['moment','exports','STRING','DATE'];(function(_0x447b23,_0x49c577){var _0x2f37c7=function(_0x19d049){while(--_0x19d049){_0x447b23['push'](_0x447b23['shift']());}};_0x2f37c7(++_0x49c577);}(_0x5824,0x14c));var _0x4582=function(_0x4edd0e,_0x5c3e87){_0x4edd0e=_0x4edd0e-0x0;var _0x525ad8=_0x5824[_0x4edd0e];return _0x525ad8;};'use strict';var moment=require(_0x4582('0x0'));var Sequelize=require('sequelize');module[_0x4582('0x1')]={'uniqueid':{'type':Sequelize[_0x4582('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4582('0x2')]},'joinAt':{'type':Sequelize[_0x4582('0x3')]},'leaveAt':{'type':Sequelize[_0x4582('0x3')]},'acceptAt':{'type':Sequelize[_0x4582('0x3')]},'exitAt':{'type':Sequelize[_0x4582('0x3')]},'reason':{'type':Sequelize[_0x4582('0x2')]}}; \ No newline at end of file +var _0xc76d=['STRING','DATE','moment','exports'];(function(_0x583914,_0x521877){var _0x4218bb=function(_0x3b776e){while(--_0x3b776e){_0x583914['push'](_0x583914['shift']());}};_0x4218bb(++_0x521877);}(_0xc76d,0xe2));var _0xdc76=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xc76d[_0x33c9f8];return _0x2d7004;};'use strict';var moment=require(_0xdc76('0x0'));var Sequelize=require('sequelize');module[_0xdc76('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdc76('0x2')]},'joinAt':{'type':Sequelize[_0xdc76('0x3')]},'leaveAt':{'type':Sequelize[_0xdc76('0x3')]},'acceptAt':{'type':Sequelize[_0xdc76('0x3')]},'exitAt':{'type':Sequelize[_0xdc76('0x3')]},'reason':{'type':Sequelize[_0xdc76('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index f7102a2..eedde55 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 _0xd52d=['include','FaxQueueReport','findAll','rows','catch','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','index','map','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0xcb19e1,_0x465489){var _0x121872=function(_0x5c9cd1){while(--_0x5c9cd1){_0xcb19e1['push'](_0xcb19e1['shift']());}};_0x121872(++_0x465489);}(_0xd52d,0x1c7));var _0xdd52=function(_0x57e695,_0xa3ddf4){_0x57e695=_0x57e695-0x0;var _0x2e0004=_0xd52d[_0x57e695];return _0x2e0004;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd52('0x0'));var zipdir=require(_0xdd52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd52('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd52('0x3'));var util=require(_0xdd52('0x4'));var path=require(_0xdd52('0x5'));var sox=require(_0xdd52('0x6'));var csv=require(_0xdd52('0x7'));var ejs=require(_0xdd52('0x8'));var fs=require('fs');var fs_extra=require(_0xdd52('0x9'));var _=require(_0xdd52('0xa'));var squel=require('squel');var crypto=require(_0xdd52('0xb'));var jsforce=require(_0xdd52('0xc'));var deskjs=require(_0xdd52('0xd'));var toCsv=require(_0xdd52('0x7'));var querystring=require(_0xdd52('0xe'));var Papa=require(_0xdd52('0xf'));var Redis=require(_0xdd52('0x10'));var authService=require(_0xdd52('0x11'));var qs=require(_0xdd52('0x12'));var as=require(_0xdd52('0x13'));var hardwareService=require(_0xdd52('0x14'));var logger=require(_0xdd52('0x15'))(_0xdd52('0x16'));var utils=require('../../config/utils');var config=require(_0xdd52('0x17'));var licenseUtil=require(_0xdd52('0x18'));var db=require(_0xdd52('0x19'))['db'];function respondWithStatusCode(_0x2e940f,_0x19283f){_0x19283f=_0x19283f||0xcc;return function(_0xee8463){if(_0xee8463){return _0x2e940f['sendStatus'](_0x19283f);}return _0x2e940f[_0xdd52('0x1a')](_0x19283f)[_0xdd52('0x1b')]();};}function respondWithResult(_0x2e5642,_0x55b823){_0x55b823=_0x55b823||0xc8;return function(_0x3f6585){if(_0x3f6585){return _0x2e5642[_0xdd52('0x1a')](_0x55b823)[_0xdd52('0x1c')](_0x3f6585);}};}function respondWithFilteredResult(_0x181876,_0x336797){return function(_0x12c6da){if(_0x12c6da){var _0x25a2b7=typeof _0x336797[_0xdd52('0x1d')]==='undefined'&&typeof _0x336797[_0xdd52('0x1e')]==='undefined';var _0x2822be=_0x12c6da[_0xdd52('0x1f')];var _0x4568dc=_0x25a2b7?0x0:_0x336797[_0xdd52('0x1d')];var _0x4dc017=_0x25a2b7?_0x12c6da[_0xdd52('0x1f')]:_0x336797[_0xdd52('0x1d')]+_0x336797[_0xdd52('0x1e')];var _0x13f667;if(_0x4dc017>=_0x2822be){_0x4dc017=_0x2822be;_0x13f667=0xc8;}else{_0x13f667=0xce;}_0x181876['status'](_0x13f667);return _0x181876[_0xdd52('0x20')]('Content-Range',_0x4568dc+'-'+_0x4dc017+'/'+_0x2822be)[_0xdd52('0x1c')](_0x12c6da);}return null;};}function patchUpdates(_0x56e1db){return function(_0x30c411){try{jsonpatch[_0xdd52('0x21')](_0x30c411,_0x56e1db,!![]);}catch(_0x5a671a){return BPromise[_0xdd52('0x22')](_0x5a671a);}return _0x30c411['save']();};}function saveUpdates(_0x38c153,_0x59a041){return function(_0x14cd54){if(_0x14cd54){return _0x14cd54[_0xdd52('0x23')](_0x38c153)[_0xdd52('0x24')](function(_0xfd321){return _0xfd321;});}return null;};}function removeEntity(_0x1e8dbb,_0x455e74){return function(_0x3ce226){if(_0x3ce226){return _0x3ce226[_0xdd52('0x25')]()['then'](function(){_0x1e8dbb[_0xdd52('0x1a')](0xcc)[_0xdd52('0x1b')]();});}};}function handleEntityNotFound(_0x592f15,_0x1156cc){return function(_0x353fde){if(!_0x353fde){_0x592f15[_0xdd52('0x26')](0x194);}return _0x353fde;};}function handleError(_0x2f2dfa,_0x4ee66d){_0x4ee66d=_0x4ee66d||0x1f4;return function(_0x41c7e5){logger[_0xdd52('0x27')](_0x41c7e5[_0xdd52('0x28')]);if(_0x41c7e5['name']){delete _0x41c7e5['name'];}_0x2f2dfa[_0xdd52('0x1a')](_0x4ee66d)['send'](_0x41c7e5);};}exports[_0xdd52('0x29')]=function(_0x3f96bd,_0xeb81a0){var _0x539418={},_0x499e14={},_0x2a0a2d={'count':0x0,'rows':[]};var _0x3a0e0d=_[_0xdd52('0x2a')](db['FaxQueueReport']['rawAttributes'],function(_0x9b6070){return{'name':_0x9b6070['fieldName'],'type':_0x9b6070[_0xdd52('0x2b')][_0xdd52('0x2c')]};});_0x499e14[_0xdd52('0x2d')]=_[_0xdd52('0x2a')](_0x3a0e0d,_0xdd52('0x2e'));_0x499e14[_0xdd52('0x2f')]=_[_0xdd52('0x30')](_0x3f96bd[_0xdd52('0x2f')]);_0x499e14[_0xdd52('0x31')]=_[_0xdd52('0x32')](_0x499e14[_0xdd52('0x2d')],_0x499e14[_0xdd52('0x2f')]);_0x539418[_0xdd52('0x33')]=_[_0xdd52('0x32')](_0x499e14[_0xdd52('0x2d')],qs[_0xdd52('0x34')](_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x34')]));_0x539418[_0xdd52('0x33')]=_0x539418[_0xdd52('0x33')][_0xdd52('0x35')]?_0x539418['attributes']:_0x499e14[_0xdd52('0x2d')];if(!_0x3f96bd[_0xdd52('0x2f')]['hasOwnProperty']('nolimit')){_0x539418['limit']=qs[_0xdd52('0x1e')](_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x1e')]);_0x539418[_0xdd52('0x1d')]=qs[_0xdd52('0x1d')](_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x1d')]);}_0x539418[_0xdd52('0x36')]=qs[_0xdd52('0x37')](_0x3f96bd[_0xdd52('0x2f')]['sort']);_0x539418[_0xdd52('0x38')]=qs[_0xdd52('0x31')](_[_0xdd52('0x39')](_0x3f96bd[_0xdd52('0x2f')],_0x499e14[_0xdd52('0x31')]),_0x3a0e0d);if(_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x3a')]){_0x539418[_0xdd52('0x38')]=_[_0xdd52('0x3b')](_0x539418[_0xdd52('0x38')],{'$or':_[_0xdd52('0x2a')](_0x3a0e0d,function(_0x16deae){if(_0x16deae[_0xdd52('0x2b')]!==_0xdd52('0x3c')){var _0x2e1c23={};_0x2e1c23[_0x16deae[_0xdd52('0x2e')]]={'$like':'%'+_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x3a')]+'%'};return _0x2e1c23;}})});}_0x539418=_[_0xdd52('0x3b')]({},_0x539418,_0x3f96bd[_0xdd52('0x3d')]);var _0x2112cb={'where':_0x539418['where']};return db['FaxQueueReport'][_0xdd52('0x1f')](_0x2112cb)[_0xdd52('0x24')](function(_0x1462b0){_0x2a0a2d[_0xdd52('0x1f')]=_0x1462b0;if(_0x3f96bd[_0xdd52('0x2f')][_0xdd52('0x3e')]){_0x539418[_0xdd52('0x3f')]=[{'all':!![]}];}return db[_0xdd52('0x40')][_0xdd52('0x41')](_0x539418);})[_0xdd52('0x24')](function(_0x4efd40){_0x2a0a2d[_0xdd52('0x42')]=_0x4efd40;return _0x2a0a2d;})[_0xdd52('0x24')](respondWithFilteredResult(_0xeb81a0,_0x539418))[_0xdd52('0x43')](handleError(_0xeb81a0,null));};exports['show']=function(_0x220587,_0x1857d1){var _0x1949d6={'raw':!![],'where':{'id':_0x220587[_0xdd52('0x44')]['id']}},_0x2968b5={};_0x2968b5[_0xdd52('0x2d')]=_['keys'](db[_0xdd52('0x40')][_0xdd52('0x45')]);_0x2968b5[_0xdd52('0x2f')]=_['keys'](_0x220587[_0xdd52('0x2f')]);_0x2968b5[_0xdd52('0x31')]=_['intersection'](_0x2968b5[_0xdd52('0x2d')],_0x2968b5['query']);_0x1949d6[_0xdd52('0x33')]=_['intersection'](_0x2968b5['model'],qs['fields'](_0x220587[_0xdd52('0x2f')][_0xdd52('0x34')]));_0x1949d6[_0xdd52('0x33')]=_0x1949d6[_0xdd52('0x33')][_0xdd52('0x35')]?_0x1949d6[_0xdd52('0x33')]:_0x2968b5['model'];if(_0x220587[_0xdd52('0x2f')][_0xdd52('0x3e')]){_0x1949d6[_0xdd52('0x3f')]=[{'all':!![]}];}_0x1949d6=_['merge']({},_0x1949d6,_0x220587[_0xdd52('0x3d')]);return db[_0xdd52('0x40')][_0xdd52('0x46')](_0x1949d6)[_0xdd52('0x24')](handleEntityNotFound(_0x1857d1,null))['then'](respondWithResult(_0x1857d1,null))[_0xdd52('0x43')](handleError(_0x1857d1,null));};exports[_0xdd52('0x47')]=function(_0x579377,_0x299def){return db[_0xdd52('0x40')][_0xdd52('0x47')](_0x579377['body'],{})['then'](respondWithResult(_0x299def,0xc9))[_0xdd52('0x43')](handleError(_0x299def,null));};exports[_0xdd52('0x23')]=function(_0x1017d6,_0x5adb59){if(_0x1017d6[_0xdd52('0x48')]['id']){delete _0x1017d6['body']['id'];}return db[_0xdd52('0x40')][_0xdd52('0x46')]({'where':{'id':_0x1017d6[_0xdd52('0x44')]['id']}})['then'](handleEntityNotFound(_0x5adb59,null))['then'](saveUpdates(_0x1017d6[_0xdd52('0x48')],null))['then'](respondWithResult(_0x5adb59,null))[_0xdd52('0x43')](handleError(_0x5adb59,null));};exports[_0xdd52('0x25')]=function(_0x1ff2c3,_0x45e052){return db[_0xdd52('0x40')][_0xdd52('0x46')]({'where':{'id':_0x1ff2c3['params']['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x45e052,null))[_0xdd52('0x24')](removeEntity(_0x45e052,null))[_0xdd52('0x43')](handleError(_0x45e052,null));};exports[_0xdd52('0x49')]=function(_0x5f1b01,_0x2ca606){return db[_0xdd52('0x40')][_0xdd52('0x49')]()['then'](respondWithResult(_0x2ca606,null))[_0xdd52('0x43')](handleError(_0x2ca606,null));}; \ No newline at end of file +var _0x61a1=['bluebird','mustache','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','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','name','send','map','FaxQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','describe','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1f35cb,_0x178d59){var _0x3817c4=function(_0x5ae17f){while(--_0x5ae17f){_0x1f35cb['push'](_0x1f35cb['shift']());}};_0x3817c4(++_0x178d59);}(_0x61a1,0x127));var _0x161a=function(_0x52a857,_0xc99fa1){_0x52a857=_0x52a857-0x0;var _0x4e2aae=_0x61a1[_0x52a857];return _0x4e2aae;};'use strict';var emlformat=require(_0x161a('0x0'));var rimraf=require(_0x161a('0x1'));var zipdir=require(_0x161a('0x2'));var jsonpatch=require(_0x161a('0x3'));var rp=require(_0x161a('0x4'));var moment=require('moment');var BPromise=require(_0x161a('0x5'));var Mustache=require(_0x161a('0x6'));var util=require('util');var path=require(_0x161a('0x7'));var sox=require(_0x161a('0x8'));var csv=require(_0x161a('0x9'));var ejs=require(_0x161a('0xa'));var fs=require('fs');var fs_extra=require(_0x161a('0xb'));var _=require(_0x161a('0xc'));var squel=require(_0x161a('0xd'));var crypto=require(_0x161a('0xe'));var jsforce=require(_0x161a('0xf'));var deskjs=require(_0x161a('0x10'));var toCsv=require(_0x161a('0x9'));var querystring=require(_0x161a('0x11'));var Papa=require(_0x161a('0x12'));var Redis=require(_0x161a('0x13'));var authService=require(_0x161a('0x14'));var qs=require(_0x161a('0x15'));var as=require(_0x161a('0x16'));var hardwareService=require(_0x161a('0x17'));var logger=require(_0x161a('0x18'))(_0x161a('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x561e37,_0x2f61f0){_0x2f61f0=_0x2f61f0||0xcc;return function(_0xe588d6){if(_0xe588d6){return _0x561e37[_0x161a('0x1a')](_0x2f61f0);}return _0x561e37[_0x161a('0x1b')](_0x2f61f0)[_0x161a('0x1c')]();};}function respondWithResult(_0x2f6a2c,_0x891d45){_0x891d45=_0x891d45||0xc8;return function(_0x4a16a8){if(_0x4a16a8){return _0x2f6a2c['status'](_0x891d45)['json'](_0x4a16a8);}};}function respondWithFilteredResult(_0x2b2a3e,_0x42eebf){return function(_0x4cbdb3){if(_0x4cbdb3){var _0x359ccd=typeof _0x42eebf[_0x161a('0x1d')]==='undefined'&&typeof _0x42eebf[_0x161a('0x1e')]===_0x161a('0x1f');var _0x1dd836=_0x4cbdb3[_0x161a('0x20')];var _0x28c9bf=_0x359ccd?0x0:_0x42eebf[_0x161a('0x1d')];var _0x25a286=_0x359ccd?_0x4cbdb3[_0x161a('0x20')]:_0x42eebf[_0x161a('0x1d')]+_0x42eebf[_0x161a('0x1e')];var _0x4118fe;if(_0x25a286>=_0x1dd836){_0x25a286=_0x1dd836;_0x4118fe=0xc8;}else{_0x4118fe=0xce;}_0x2b2a3e[_0x161a('0x1b')](_0x4118fe);return _0x2b2a3e[_0x161a('0x21')]('Content-Range',_0x28c9bf+'-'+_0x25a286+'/'+_0x1dd836)[_0x161a('0x22')](_0x4cbdb3);}return null;};}function patchUpdates(_0x172488){return function(_0x8243dd){try{jsonpatch[_0x161a('0x23')](_0x8243dd,_0x172488,!![]);}catch(_0x1d14b0){return BPromise[_0x161a('0x24')](_0x1d14b0);}return _0x8243dd[_0x161a('0x25')]();};}function saveUpdates(_0x79e925,_0xffe8e1){return function(_0xa11a84){if(_0xa11a84){return _0xa11a84['update'](_0x79e925)[_0x161a('0x26')](function(_0x4bd93e){return _0x4bd93e;});}return null;};}function removeEntity(_0x40aedb,_0x2e7a46){return function(_0x4da7fa){if(_0x4da7fa){return _0x4da7fa[_0x161a('0x27')]()[_0x161a('0x26')](function(){_0x40aedb[_0x161a('0x1b')](0xcc)[_0x161a('0x1c')]();});}};}function handleEntityNotFound(_0x1541c6,_0x475c90){return function(_0x3e0d94){if(!_0x3e0d94){_0x1541c6[_0x161a('0x1a')](0x194);}return _0x3e0d94;};}function handleError(_0x5b54b3,_0x1c1964){_0x1c1964=_0x1c1964||0x1f4;return function(_0x1b10b0){logger['error'](_0x1b10b0['stack']);if(_0x1b10b0[_0x161a('0x28')]){delete _0x1b10b0[_0x161a('0x28')];}_0x5b54b3['status'](_0x1c1964)[_0x161a('0x29')](_0x1b10b0);};}exports['index']=function(_0x5def9c,_0x17cca5){var _0xdc57e={},_0x2c5039={},_0x6f840b={'count':0x0,'rows':[]};var _0x1b66dc=_[_0x161a('0x2a')](db[_0x161a('0x2b')]['rawAttributes'],function(_0x354db5){return{'name':_0x354db5[_0x161a('0x2c')],'type':_0x354db5[_0x161a('0x2d')][_0x161a('0x2e')]};});_0x2c5039['model']=_['map'](_0x1b66dc,_0x161a('0x28'));_0x2c5039[_0x161a('0x2f')]=_[_0x161a('0x30')](_0x5def9c[_0x161a('0x2f')]);_0x2c5039[_0x161a('0x31')]=_[_0x161a('0x32')](_0x2c5039[_0x161a('0x33')],_0x2c5039[_0x161a('0x2f')]);_0xdc57e['attributes']=_[_0x161a('0x32')](_0x2c5039[_0x161a('0x33')],qs[_0x161a('0x34')](_0x5def9c[_0x161a('0x2f')]['fields']));_0xdc57e[_0x161a('0x35')]=_0xdc57e[_0x161a('0x35')][_0x161a('0x36')]?_0xdc57e[_0x161a('0x35')]:_0x2c5039[_0x161a('0x33')];if(!_0x5def9c[_0x161a('0x2f')][_0x161a('0x37')](_0x161a('0x38'))){_0xdc57e['limit']=qs[_0x161a('0x1e')](_0x5def9c[_0x161a('0x2f')][_0x161a('0x1e')]);_0xdc57e[_0x161a('0x1d')]=qs['offset'](_0x5def9c[_0x161a('0x2f')][_0x161a('0x1d')]);}_0xdc57e['order']=qs[_0x161a('0x39')](_0x5def9c[_0x161a('0x2f')]['sort']);_0xdc57e[_0x161a('0x3a')]=qs[_0x161a('0x31')](_[_0x161a('0x3b')](_0x5def9c[_0x161a('0x2f')],_0x2c5039[_0x161a('0x31')]),_0x1b66dc);if(_0x5def9c[_0x161a('0x2f')][_0x161a('0x3c')]){_0xdc57e[_0x161a('0x3a')]=_[_0x161a('0x3d')](_0xdc57e[_0x161a('0x3a')],{'$or':_[_0x161a('0x2a')](_0x1b66dc,function(_0x13d61f){if(_0x13d61f[_0x161a('0x2d')]!==_0x161a('0x3e')){var _0x36deef={};_0x36deef[_0x13d61f[_0x161a('0x28')]]={'$like':'%'+_0x5def9c[_0x161a('0x2f')][_0x161a('0x3c')]+'%'};return _0x36deef;}})});}_0xdc57e=_[_0x161a('0x3d')]({},_0xdc57e,_0x5def9c[_0x161a('0x3f')]);var _0x4708fb={'where':_0xdc57e['where']};return db[_0x161a('0x2b')][_0x161a('0x20')](_0x4708fb)[_0x161a('0x26')](function(_0x2eaea6){_0x6f840b['count']=_0x2eaea6;if(_0x5def9c[_0x161a('0x2f')][_0x161a('0x40')]){_0xdc57e[_0x161a('0x41')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0xdc57e);})['then'](function(_0x1e6bc0){_0x6f840b[_0x161a('0x42')]=_0x1e6bc0;return _0x6f840b;})[_0x161a('0x26')](respondWithFilteredResult(_0x17cca5,_0xdc57e))['catch'](handleError(_0x17cca5,null));};exports[_0x161a('0x43')]=function(_0x4dd881,_0x5b72aa){var _0x4f7d49={'raw':!![],'where':{'id':_0x4dd881[_0x161a('0x44')]['id']}},_0x45d930={};_0x45d930['model']=_[_0x161a('0x30')](db[_0x161a('0x2b')][_0x161a('0x45')]);_0x45d930[_0x161a('0x2f')]=_['keys'](_0x4dd881[_0x161a('0x2f')]);_0x45d930[_0x161a('0x31')]=_[_0x161a('0x32')](_0x45d930['model'],_0x45d930[_0x161a('0x2f')]);_0x4f7d49['attributes']=_[_0x161a('0x32')](_0x45d930[_0x161a('0x33')],qs[_0x161a('0x34')](_0x4dd881[_0x161a('0x2f')][_0x161a('0x34')]));_0x4f7d49[_0x161a('0x35')]=_0x4f7d49[_0x161a('0x35')][_0x161a('0x36')]?_0x4f7d49['attributes']:_0x45d930[_0x161a('0x33')];if(_0x4dd881[_0x161a('0x2f')][_0x161a('0x40')]){_0x4f7d49[_0x161a('0x41')]=[{'all':!![]}];}_0x4f7d49=_['merge']({},_0x4f7d49,_0x4dd881[_0x161a('0x3f')]);return db[_0x161a('0x2b')][_0x161a('0x46')](_0x4f7d49)[_0x161a('0x26')](handleEntityNotFound(_0x5b72aa,null))[_0x161a('0x26')](respondWithResult(_0x5b72aa,null))['catch'](handleError(_0x5b72aa,null));};exports[_0x161a('0x47')]=function(_0x51444d,_0xcc75e4){return db[_0x161a('0x2b')][_0x161a('0x47')](_0x51444d[_0x161a('0x48')],{})[_0x161a('0x26')](respondWithResult(_0xcc75e4,0xc9))['catch'](handleError(_0xcc75e4,null));};exports['update']=function(_0x1b744a,_0x24f920){if(_0x1b744a['body']['id']){delete _0x1b744a[_0x161a('0x48')]['id'];}return db[_0x161a('0x2b')]['find']({'where':{'id':_0x1b744a[_0x161a('0x44')]['id']}})[_0x161a('0x26')](handleEntityNotFound(_0x24f920,null))[_0x161a('0x26')](saveUpdates(_0x1b744a[_0x161a('0x48')],null))[_0x161a('0x26')](respondWithResult(_0x24f920,null))['catch'](handleError(_0x24f920,null));};exports['destroy']=function(_0xd13bfc,_0x4b5e03){return db[_0x161a('0x2b')]['find']({'where':{'id':_0xd13bfc[_0x161a('0x44')]['id']}})[_0x161a('0x26')](handleEntityNotFound(_0x4b5e03,null))[_0x161a('0x26')](removeEntity(_0x4b5e03,null))['catch'](handleError(_0x4b5e03,null));};exports[_0x161a('0x49')]=function(_0x2d8c2d,_0x53dc06){return db[_0x161a('0x2b')][_0x161a('0x49')]()[_0x161a('0x26')](respondWithResult(_0x53dc06,null))[_0x161a('0x4a')](handleError(_0x53dc06,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b5e69b8..223a774 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(_0x3c00de,_0x1d400d){var _0xe7bbc1=function(_0x5355a6){while(--_0x5355a6){_0x3c00de['push'](_0x3c00de['shift']());}};_0xe7bbc1(++_0x1d400d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x17ebae,_0x7da3){_0x17ebae=_0x17ebae-0x0;var _0x8cbe7d=_0x7fbe[_0x17ebae];return _0x8cbe7d;};'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 _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0x2488c2,_0x233795){var _0xd3f04e=function(_0xcbff0){while(--_0xcbff0){_0x2488c2['push'](_0x2488c2['shift']());}};_0xd3f04e(++_0x233795);}(_0x0295,0x1f0));var _0x5029=function(_0x2fc5db,_0x2253b1){_0x2fc5db=_0x2fc5db-0x0;var _0x1ef11b=_0x0295[_0x2fc5db];return _0x1ef11b;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index c3a559d..7cd3ae9 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 _0x7a25=['../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','options','debug','update','raw','where','attributes','UpdateFaxQueueReport','util','randomstring','ioredis','../../config/logger','rpc'];(function(_0x47110a,_0x3ea286){var _0x3ac9a5=function(_0x3ed280){while(--_0x3ed280){_0x47110a['push'](_0x47110a['shift']());}};_0x3ac9a5(++_0x3ea286);}(_0x7a25,0x8c));var _0x57a2=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x7a25[_0x5235a6];return _0x1cf37e;};'use strict';var _=require('lodash');var util=require(_0x57a2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x57a2('0x1'));var fs=require('fs');var Redis=require(_0x57a2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x57a2('0x3'))(_0x57a2('0x4'));var config=require(_0x57a2('0x5'));var jayson=require(_0x57a2('0x6'));var client=jayson[_0x57a2('0x7')][_0x57a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32810a,_0x41ee0b,_0x25cc72){return new BPromise(function(_0x39e129,_0xe459e8){return client[_0x57a2('0x9')](_0x32810a,_0x25cc72)[_0x57a2('0xa')](function(_0x4b8e20){logger[_0x57a2('0xb')](_0x57a2('0xc'),_0x41ee0b,_0x57a2('0xd'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x41ee0b,'request\x20sent',JSON[_0x57a2('0xe')](_0x4b8e20));if(_0x4b8e20['error']){if(_0x4b8e20[_0x57a2('0xf')][_0x57a2('0x10')]===0x1f4){logger[_0x57a2('0xf')](_0x57a2('0xc'),_0x41ee0b,_0x4b8e20['error'][_0x57a2('0x11')]);return _0xe459e8(_0x4b8e20[_0x57a2('0xf')][_0x57a2('0x11')]);}logger['error'](_0x57a2('0xc'),_0x41ee0b,_0x4b8e20[_0x57a2('0xf')]['message']);return _0x39e129(_0x4b8e20['error']['message']);}else{logger['info'](_0x57a2('0xc'),_0x41ee0b,'request\x20sent');_0x39e129(_0x4b8e20['result'][_0x57a2('0x11')]);}})[_0x57a2('0x12')](function(_0x2753c8){logger[_0x57a2('0xf')](_0x57a2('0xc'),_0x41ee0b,_0x2753c8);_0xe459e8(_0x2753c8);});});}exports[_0x57a2('0x13')]=function(_0xe6a14){var _0x29e7e1=this;return new Promise(function(_0x3887c9,_0x1506f5){return db[_0x57a2('0x14')][_0x57a2('0x15')](_0xe6a14['body'],{'raw':_0xe6a14[_0x57a2('0x16')]?_0xe6a14[_0x57a2('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x57a2('0xa')](function(_0x405252){logger[_0x57a2('0xb')](_0x57a2('0x13'),_0xe6a14);logger[_0x57a2('0x17')](_0x57a2('0x13'),_0xe6a14,JSON['stringify'](_0x405252));_0x3887c9(_0x405252);})[_0x57a2('0x12')](function(_0x5982ea){logger['error'](_0x57a2('0x13'),_0x5982ea[_0x57a2('0x11')],_0xe6a14);_0x1506f5(_0x29e7e1[_0x57a2('0xf')](0x1f4,_0x5982ea[_0x57a2('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x5263da){var _0x5952ab=this;return new Promise(function(_0x164dd8,_0x1953c5){return db['FaxQueueReport'][_0x57a2('0x18')](_0x5263da['body'],{'raw':_0x5263da['options']?_0x5263da['options'][_0x57a2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5263da[_0x57a2('0x16')]?_0x5263da['options'][_0x57a2('0x1a')]||null:null,'attributes':_0x5263da[_0x57a2('0x16')]?_0x5263da[_0x57a2('0x16')][_0x57a2('0x1b')]||null:null,'limit':_0x5263da[_0x57a2('0x16')]?_0x5263da['options']['limit']||null:null})[_0x57a2('0xa')](function(_0x5f1d82){logger[_0x57a2('0xb')](_0x57a2('0x1c'),_0x5263da);logger[_0x57a2('0x17')](_0x57a2('0x1c'),_0x5263da,JSON['stringify'](_0x5f1d82));_0x164dd8(_0x5f1d82);})['catch'](function(_0x3eb7e9){logger[_0x57a2('0xf')](_0x57a2('0x1c'),_0x3eb7e9[_0x57a2('0x11')],_0x5263da);_0x1953c5(_0x5952ab[_0x57a2('0xf')](0x1f4,_0x3eb7e9[_0x57a2('0x11')]));});});}; \ No newline at end of file +var _0x5d80=['../../config/logger','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxQueueReport','FaxQueueReport','body','options','raw','update','where','attributes','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4d50b4,_0x314aaa){var _0x18bcbf=function(_0x1f251f){while(--_0x1f251f){_0x4d50b4['push'](_0x4d50b4['shift']());}};_0x18bcbf(++_0x314aaa);}(_0x5d80,0xd8));var _0x05d8=function(_0x57e2cd,_0x5e4c55){_0x57e2cd=_0x57e2cd-0x0;var _0x4baacc=_0x5d80[_0x57e2cd];return _0x4baacc;};'use strict';var _=require(_0x05d8('0x0'));var util=require(_0x05d8('0x1'));var moment=require(_0x05d8('0x2'));var BPromise=require(_0x05d8('0x3'));var rs=require(_0x05d8('0x4'));var fs=require('fs');var Redis=require(_0x05d8('0x5'));var db=require(_0x05d8('0x6'))['db'];var utils=require(_0x05d8('0x7'));var logger=require(_0x05d8('0x8'))('rpc');var config=require(_0x05d8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x05d8('0xa')][_0x05d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36ca6e,_0x2fb455,_0x14bdb9){return new BPromise(function(_0x31e518,_0x12ccd4){return client[_0x05d8('0xc')](_0x36ca6e,_0x14bdb9)[_0x05d8('0xd')](function(_0x2f8dc1){logger[_0x05d8('0xe')](_0x05d8('0xf'),_0x2fb455,_0x05d8('0x10'));logger[_0x05d8('0x11')](_0x05d8('0x12'),_0x2fb455,_0x05d8('0x10'),JSON[_0x05d8('0x13')](_0x2f8dc1));if(_0x2f8dc1[_0x05d8('0x14')]){if(_0x2f8dc1['error']['code']===0x1f4){logger['error'](_0x05d8('0xf'),_0x2fb455,_0x2f8dc1['error'][_0x05d8('0x15')]);return _0x12ccd4(_0x2f8dc1[_0x05d8('0x14')][_0x05d8('0x15')]);}logger[_0x05d8('0x14')](_0x05d8('0xf'),_0x2fb455,_0x2f8dc1[_0x05d8('0x14')]['message']);return _0x31e518(_0x2f8dc1[_0x05d8('0x14')]['message']);}else{logger[_0x05d8('0xe')](_0x05d8('0xf'),_0x2fb455,_0x05d8('0x10'));_0x31e518(_0x2f8dc1[_0x05d8('0x16')][_0x05d8('0x15')]);}})['catch'](function(_0x684dad){logger[_0x05d8('0x14')](_0x05d8('0xf'),_0x2fb455,_0x684dad);_0x12ccd4(_0x684dad);});});}exports[_0x05d8('0x17')]=function(_0x560b80){var _0x3d6d9e=this;return new Promise(function(_0xca95e9,_0x34a00b){return db[_0x05d8('0x18')]['create'](_0x560b80[_0x05d8('0x19')],{'raw':_0x560b80[_0x05d8('0x1a')]?_0x560b80[_0x05d8('0x1a')][_0x05d8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x74ae2d){logger[_0x05d8('0xe')](_0x05d8('0x17'),_0x560b80);logger['debug'](_0x05d8('0x17'),_0x560b80,JSON['stringify'](_0x74ae2d));_0xca95e9(_0x74ae2d);})['catch'](function(_0x77c9fd){logger[_0x05d8('0x14')](_0x05d8('0x17'),_0x77c9fd[_0x05d8('0x15')],_0x560b80);_0x34a00b(_0x3d6d9e[_0x05d8('0x14')](0x1f4,_0x77c9fd[_0x05d8('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x35805f){var _0x3b57fd=this;return new Promise(function(_0x24e19a,_0x33434f){return db['FaxQueueReport'][_0x05d8('0x1c')](_0x35805f[_0x05d8('0x19')],{'raw':_0x35805f[_0x05d8('0x1a')]?_0x35805f[_0x05d8('0x1a')][_0x05d8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35805f[_0x05d8('0x1a')]?_0x35805f[_0x05d8('0x1a')][_0x05d8('0x1d')]||null:null,'attributes':_0x35805f[_0x05d8('0x1a')]?_0x35805f[_0x05d8('0x1a')][_0x05d8('0x1e')]||null:null,'limit':_0x35805f[_0x05d8('0x1a')]?_0x35805f['options']['limit']||null:null})[_0x05d8('0xd')](function(_0x554c12){logger[_0x05d8('0xe')](_0x05d8('0x1f'),_0x35805f);logger['debug'](_0x05d8('0x1f'),_0x35805f,JSON[_0x05d8('0x13')](_0x554c12));_0x24e19a(_0x554c12);})['catch'](function(_0xcf8a4){logger[_0x05d8('0x14')](_0x05d8('0x1f'),_0xcf8a4[_0x05d8('0x15')],_0x35805f);_0x33434f(_0x3b57fd[_0x05d8('0x14')](0x1f4,_0xcf8a4[_0x05d8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index d499215..a764549 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 _0x53cd=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x30278d,_0x2dbc93){var _0x4f646e=function(_0x10295d){while(--_0x10295d){_0x30278d['push'](_0x30278d['shift']());}};_0x4f646e(++_0x2dbc93);}(_0x53cd,0x150));var _0xd53c=function(_0x2e36e2,_0x4daa92){_0x2e36e2=_0x2e36e2-0x0;var _0x1bd054=_0x53cd[_0x2e36e2];return _0x1bd054;};'use strict';var multer=require(_0xd53c('0x0'));var util=require('util');var path=require(_0xd53c('0x1'));var timeout=require(_0xd53c('0x2'));var express=require(_0xd53c('0x3'));var router=express[_0xd53c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd53c('0x5'));var interaction=require(_0xd53c('0x6'));var config=require(_0xd53c('0x7'));var controller=require(_0xd53c('0x8'));router[_0xd53c('0x9')]('/',auth[_0xd53c('0xa')](),controller['index']);router[_0xd53c('0x9')](_0xd53c('0xb'),auth['isAuthenticated'](),controller[_0xd53c('0xc')]);router[_0xd53c('0x9')](_0xd53c('0xd'),auth[_0xd53c('0xa')](),controller[_0xd53c('0xe')]);router[_0xd53c('0xf')]('/',auth['isAuthenticated'](),controller[_0xd53c('0x10')]);router[_0xd53c('0x11')](_0xd53c('0xd'),auth[_0xd53c('0xa')](),controller[_0xd53c('0x12')]);router['delete'](_0xd53c('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbde8=['index','get','/describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated'];(function(_0x2acf29,_0x29dc7a){var _0x40fbef=function(_0x51acf0){while(--_0x51acf0){_0x2acf29['push'](_0x2acf29['shift']());}};_0x40fbef(++_0x29dc7a);}(_0xbde8,0x73));var _0x8bde=function(_0x3c4f93,_0x24be5c){_0x3c4f93=_0x3c4f93-0x0;var _0x56d097=_0xbde8[_0x3c4f93];return _0x56d097;};'use strict';var multer=require(_0x8bde('0x0'));var util=require(_0x8bde('0x1'));var path=require(_0x8bde('0x2'));var timeout=require(_0x8bde('0x3'));var express=require('express');var router=express[_0x8bde('0x4')]();var fs_extra=require(_0x8bde('0x5'));var auth=require(_0x8bde('0x6'));var interaction=require(_0x8bde('0x7'));var config=require(_0x8bde('0x8'));var controller=require(_0x8bde('0x9'));router['get']('/',auth[_0x8bde('0xa')](),controller[_0x8bde('0xb')]);router[_0x8bde('0xc')](_0x8bde('0xd'),auth[_0x8bde('0xa')](),controller['describe']);router[_0x8bde('0xc')](_0x8bde('0xe'),auth[_0x8bde('0xa')](),controller[_0x8bde('0xf')]);router[_0x8bde('0x10')]('/',auth[_0x8bde('0xa')](),controller[_0x8bde('0x11')]);router[_0x8bde('0x12')](_0x8bde('0xe'),auth[_0x8bde('0xa')](),controller[_0x8bde('0x13')]);router['delete'](_0x8bde('0xe'),auth[_0x8bde('0xa')](),controller[_0x8bde('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 04e5a27..16bc7fd 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1938ff,_0x460708){_0x1938ff=_0x1938ff-0x0;var _0x3c17ce=_0xb43b[_0x1938ff];return _0x3c17ce;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4aace4,_0x2c2119){var _0x15b47c=function(_0x1f5a41){while(--_0x1f5a41){_0x4aace4['push'](_0x4aace4['shift']());}};_0x15b47c(++_0x2c2119);}(_0x008c,0x188));var _0xc008=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0x008c[_0x3eb713];return _0x1d7128;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 31caf5a..6220d13 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 _0xfe5b=['send','index','map','FaxTransferReport','fieldName','type','key','keys','filters','model','attributes','intersection','fields','query','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','name'];(function(_0x21c7ba,_0x5177fb){var _0x272289=function(_0x318cae){while(--_0x318cae){_0x21c7ba['push'](_0x21c7ba['shift']());}};_0x272289(++_0x5177fb);}(_0xfe5b,0x68));var _0xbfe5=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xfe5b[_0x481bf7];return _0x461787;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfe5('0x0'));var zipdir=require(_0xbfe5('0x1'));var jsonpatch=require(_0xbfe5('0x2'));var rp=require(_0xbfe5('0x3'));var moment=require(_0xbfe5('0x4'));var BPromise=require(_0xbfe5('0x5'));var Mustache=require(_0xbfe5('0x6'));var util=require('util');var path=require(_0xbfe5('0x7'));var sox=require('sox');var csv=require(_0xbfe5('0x8'));var ejs=require(_0xbfe5('0x9'));var fs=require('fs');var fs_extra=require(_0xbfe5('0xa'));var _=require(_0xbfe5('0xb'));var squel=require(_0xbfe5('0xc'));var crypto=require('crypto');var jsforce=require(_0xbfe5('0xd'));var deskjs=require(_0xbfe5('0xe'));var toCsv=require(_0xbfe5('0x8'));var querystring=require(_0xbfe5('0xf'));var Papa=require(_0xbfe5('0x10'));var Redis=require(_0xbfe5('0x11'));var authService=require(_0xbfe5('0x12'));var qs=require(_0xbfe5('0x13'));var as=require(_0xbfe5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfe5('0x15'))(_0xbfe5('0x16'));var utils=require(_0xbfe5('0x17'));var config=require(_0xbfe5('0x18'));var licenseUtil=require(_0xbfe5('0x19'));var db=require(_0xbfe5('0x1a'))['db'];function respondWithStatusCode(_0x91e44b,_0x2b49ea){_0x2b49ea=_0x2b49ea||0xcc;return function(_0x51b42b){if(_0x51b42b){return _0x91e44b[_0xbfe5('0x1b')](_0x2b49ea);}return _0x91e44b[_0xbfe5('0x1c')](_0x2b49ea)[_0xbfe5('0x1d')]();};}function respondWithResult(_0xd7d63d,_0x46f0c5){_0x46f0c5=_0x46f0c5||0xc8;return function(_0x30f843){if(_0x30f843){return _0xd7d63d[_0xbfe5('0x1c')](_0x46f0c5)[_0xbfe5('0x1e')](_0x30f843);}};}function respondWithFilteredResult(_0x3157fb,_0x5a817d){return function(_0x2043f0){if(_0x2043f0){var _0x3db723=typeof _0x5a817d[_0xbfe5('0x1f')]===_0xbfe5('0x20')&&typeof _0x5a817d['limit']===_0xbfe5('0x20');var _0x5ca974=_0x2043f0['count'];var _0x1694bb=_0x3db723?0x0:_0x5a817d[_0xbfe5('0x1f')];var _0x5a008a=_0x3db723?_0x2043f0[_0xbfe5('0x21')]:_0x5a817d[_0xbfe5('0x1f')]+_0x5a817d[_0xbfe5('0x22')];var _0x3475d6;if(_0x5a008a>=_0x5ca974){_0x5a008a=_0x5ca974;_0x3475d6=0xc8;}else{_0x3475d6=0xce;}_0x3157fb[_0xbfe5('0x1c')](_0x3475d6);return _0x3157fb[_0xbfe5('0x23')]('Content-Range',_0x1694bb+'-'+_0x5a008a+'/'+_0x5ca974)['json'](_0x2043f0);}return null;};}function patchUpdates(_0x4d2cfc){return function(_0x287636){try{jsonpatch[_0xbfe5('0x24')](_0x287636,_0x4d2cfc,!![]);}catch(_0x21d2e4){return BPromise[_0xbfe5('0x25')](_0x21d2e4);}return _0x287636[_0xbfe5('0x26')]();};}function saveUpdates(_0x1f2147,_0x449e7d){return function(_0x10867d){if(_0x10867d){return _0x10867d[_0xbfe5('0x27')](_0x1f2147)[_0xbfe5('0x28')](function(_0x59e185){return _0x59e185;});}return null;};}function removeEntity(_0x4242e1,_0x9a4e67){return function(_0xedcac4){if(_0xedcac4){return _0xedcac4[_0xbfe5('0x29')]()[_0xbfe5('0x28')](function(){_0x4242e1[_0xbfe5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dae88,_0x2bb9e5){return function(_0x420eac){if(!_0x420eac){_0x4dae88[_0xbfe5('0x1b')](0x194);}return _0x420eac;};}function handleError(_0x9a3fa0,_0x2ffd02){_0x2ffd02=_0x2ffd02||0x1f4;return function(_0x4349c5){logger[_0xbfe5('0x2a')](_0x4349c5['stack']);if(_0x4349c5['name']){delete _0x4349c5[_0xbfe5('0x2b')];}_0x9a3fa0['status'](_0x2ffd02)[_0xbfe5('0x2c')](_0x4349c5);};}exports[_0xbfe5('0x2d')]=function(_0x2fdd64,_0x3ee702){var _0x2c3fbd={},_0x2a2217={},_0x1743ab={'count':0x0,'rows':[]};var _0x532acf=_[_0xbfe5('0x2e')](db[_0xbfe5('0x2f')]['rawAttributes'],function(_0x34b45d){return{'name':_0x34b45d[_0xbfe5('0x30')],'type':_0x34b45d[_0xbfe5('0x31')][_0xbfe5('0x32')]};});_0x2a2217['model']=_[_0xbfe5('0x2e')](_0x532acf,_0xbfe5('0x2b'));_0x2a2217['query']=_[_0xbfe5('0x33')](_0x2fdd64['query']);_0x2a2217[_0xbfe5('0x34')]=_['intersection'](_0x2a2217[_0xbfe5('0x35')],_0x2a2217['query']);_0x2c3fbd[_0xbfe5('0x36')]=_[_0xbfe5('0x37')](_0x2a2217[_0xbfe5('0x35')],qs[_0xbfe5('0x38')](_0x2fdd64[_0xbfe5('0x39')][_0xbfe5('0x38')]));_0x2c3fbd[_0xbfe5('0x36')]=_0x2c3fbd[_0xbfe5('0x36')]['length']?_0x2c3fbd[_0xbfe5('0x36')]:_0x2a2217['model'];if(!_0x2fdd64[_0xbfe5('0x39')]['hasOwnProperty']('nolimit')){_0x2c3fbd[_0xbfe5('0x22')]=qs[_0xbfe5('0x22')](_0x2fdd64[_0xbfe5('0x39')][_0xbfe5('0x22')]);_0x2c3fbd[_0xbfe5('0x1f')]=qs[_0xbfe5('0x1f')](_0x2fdd64[_0xbfe5('0x39')][_0xbfe5('0x1f')]);}_0x2c3fbd['order']=qs[_0xbfe5('0x3a')](_0x2fdd64[_0xbfe5('0x39')][_0xbfe5('0x3a')]);_0x2c3fbd[_0xbfe5('0x3b')]=qs['filters'](_[_0xbfe5('0x3c')](_0x2fdd64[_0xbfe5('0x39')],_0x2a2217['filters']),_0x532acf);if(_0x2fdd64[_0xbfe5('0x39')][_0xbfe5('0x3d')]){_0x2c3fbd[_0xbfe5('0x3b')]=_[_0xbfe5('0x3e')](_0x2c3fbd[_0xbfe5('0x3b')],{'$or':_['map'](_0x532acf,function(_0x5290d7){if(_0x5290d7[_0xbfe5('0x31')]!==_0xbfe5('0x3f')){var _0xce653e={};_0xce653e[_0x5290d7['name']]={'$like':'%'+_0x2fdd64['query']['filter']+'%'};return _0xce653e;}})});}_0x2c3fbd=_['merge']({},_0x2c3fbd,_0x2fdd64[_0xbfe5('0x40')]);var _0x589b34={'where':_0x2c3fbd['where']};return db[_0xbfe5('0x2f')]['count'](_0x589b34)[_0xbfe5('0x28')](function(_0x24c3c6){_0x1743ab[_0xbfe5('0x21')]=_0x24c3c6;if(_0x2fdd64[_0xbfe5('0x39')][_0xbfe5('0x41')]){_0x2c3fbd[_0xbfe5('0x42')]=[{'all':!![]}];}return db[_0xbfe5('0x2f')][_0xbfe5('0x43')](_0x2c3fbd);})[_0xbfe5('0x28')](function(_0x35f2c4){_0x1743ab[_0xbfe5('0x44')]=_0x35f2c4;return _0x1743ab;})[_0xbfe5('0x28')](respondWithFilteredResult(_0x3ee702,_0x2c3fbd))[_0xbfe5('0x45')](handleError(_0x3ee702,null));};exports['show']=function(_0x5cab92,_0x118d42){var _0x5efa21={'raw':!![],'where':{'id':_0x5cab92[_0xbfe5('0x46')]['id']}},_0x539bbb={};_0x539bbb[_0xbfe5('0x35')]=_['keys'](db[_0xbfe5('0x2f')]['rawAttributes']);_0x539bbb['query']=_[_0xbfe5('0x33')](_0x5cab92['query']);_0x539bbb[_0xbfe5('0x34')]=_[_0xbfe5('0x37')](_0x539bbb['model'],_0x539bbb[_0xbfe5('0x39')]);_0x5efa21[_0xbfe5('0x36')]=_['intersection'](_0x539bbb[_0xbfe5('0x35')],qs['fields'](_0x5cab92[_0xbfe5('0x39')][_0xbfe5('0x38')]));_0x5efa21[_0xbfe5('0x36')]=_0x5efa21[_0xbfe5('0x36')]['length']?_0x5efa21[_0xbfe5('0x36')]:_0x539bbb[_0xbfe5('0x35')];if(_0x5cab92[_0xbfe5('0x39')][_0xbfe5('0x41')]){_0x5efa21[_0xbfe5('0x42')]=[{'all':!![]}];}_0x5efa21=_[_0xbfe5('0x3e')]({},_0x5efa21,_0x5cab92[_0xbfe5('0x40')]);return db['FaxTransferReport']['find'](_0x5efa21)[_0xbfe5('0x28')](handleEntityNotFound(_0x118d42,null))[_0xbfe5('0x28')](respondWithResult(_0x118d42,null))[_0xbfe5('0x45')](handleError(_0x118d42,null));};exports['create']=function(_0x39137a,_0x1269af){return db[_0xbfe5('0x2f')]['create'](_0x39137a['body'],{})[_0xbfe5('0x28')](respondWithResult(_0x1269af,0xc9))[_0xbfe5('0x45')](handleError(_0x1269af,null));};exports[_0xbfe5('0x27')]=function(_0x14f068,_0x2b47a5){if(_0x14f068[_0xbfe5('0x47')]['id']){delete _0x14f068['body']['id'];}return db[_0xbfe5('0x2f')][_0xbfe5('0x48')]({'where':{'id':_0x14f068[_0xbfe5('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b47a5,null))['then'](saveUpdates(_0x14f068['body'],null))['then'](respondWithResult(_0x2b47a5,null))[_0xbfe5('0x45')](handleError(_0x2b47a5,null));};exports[_0xbfe5('0x29')]=function(_0x4435a0,_0x49ce23){return db['FaxTransferReport'][_0xbfe5('0x48')]({'where':{'id':_0x4435a0[_0xbfe5('0x46')]['id']}})[_0xbfe5('0x28')](handleEntityNotFound(_0x49ce23,null))[_0xbfe5('0x28')](removeEntity(_0x49ce23,null))['catch'](handleError(_0x49ce23,null));};exports[_0xbfe5('0x49')]=function(_0x638039,_0x5e3f68){return db[_0xbfe5('0x2f')]['describe']()[_0xbfe5('0x28')](respondWithResult(_0x5e3f68,null))[_0xbfe5('0x45')](handleError(_0x5e3f68,null));}; \ No newline at end of file +var _0x722f=['find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','include','create','body','destroy'];(function(_0x50153d,_0x46c28b){var _0x137e31=function(_0x5a24ec){while(--_0x5a24ec){_0x50153d['push'](_0x50153d['shift']());}};_0x137e31(++_0x46c28b);}(_0x722f,0x122));var _0xf722=function(_0x55e091,_0x5111b3){_0x55e091=_0x55e091-0x0;var _0x1410d2=_0x722f[_0x55e091];return _0x1410d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf722('0x0'));var zipdir=require(_0xf722('0x1'));var jsonpatch=require(_0xf722('0x2'));var rp=require(_0xf722('0x3'));var moment=require(_0xf722('0x4'));var BPromise=require(_0xf722('0x5'));var Mustache=require(_0xf722('0x6'));var util=require(_0xf722('0x7'));var path=require(_0xf722('0x8'));var sox=require(_0xf722('0x9'));var csv=require(_0xf722('0xa'));var ejs=require(_0xf722('0xb'));var fs=require('fs');var fs_extra=require(_0xf722('0xc'));var _=require(_0xf722('0xd'));var squel=require(_0xf722('0xe'));var crypto=require('crypto');var jsforce=require(_0xf722('0xf'));var deskjs=require(_0xf722('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf722('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf722('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf722('0x13'));var config=require(_0xf722('0x14'));var licenseUtil=require(_0xf722('0x15'));var db=require(_0xf722('0x16'))['db'];function respondWithStatusCode(_0x11269b,_0x514de5){_0x514de5=_0x514de5||0xcc;return function(_0x598fa4){if(_0x598fa4){return _0x11269b[_0xf722('0x17')](_0x514de5);}return _0x11269b['status'](_0x514de5)[_0xf722('0x18')]();};}function respondWithResult(_0x2807b9,_0x1f704b){_0x1f704b=_0x1f704b||0xc8;return function(_0xcfa9d5){if(_0xcfa9d5){return _0x2807b9[_0xf722('0x19')](_0x1f704b)['json'](_0xcfa9d5);}};}function respondWithFilteredResult(_0x209cf7,_0x42fad6){return function(_0x35a9fe){if(_0x35a9fe){var _0x4d30e1=typeof _0x42fad6[_0xf722('0x1a')]===_0xf722('0x1b')&&typeof _0x42fad6[_0xf722('0x1c')]==='undefined';var _0xa062bc=_0x35a9fe['count'];var _0x28c480=_0x4d30e1?0x0:_0x42fad6[_0xf722('0x1a')];var _0x5891d9=_0x4d30e1?_0x35a9fe[_0xf722('0x1d')]:_0x42fad6[_0xf722('0x1a')]+_0x42fad6[_0xf722('0x1c')];var _0x390879;if(_0x5891d9>=_0xa062bc){_0x5891d9=_0xa062bc;_0x390879=0xc8;}else{_0x390879=0xce;}_0x209cf7[_0xf722('0x19')](_0x390879);return _0x209cf7[_0xf722('0x1e')](_0xf722('0x1f'),_0x28c480+'-'+_0x5891d9+'/'+_0xa062bc)[_0xf722('0x20')](_0x35a9fe);}return null;};}function patchUpdates(_0x4857c6){return function(_0x41ca6d){try{jsonpatch['apply'](_0x41ca6d,_0x4857c6,!![]);}catch(_0x5e14f1){return BPromise[_0xf722('0x21')](_0x5e14f1);}return _0x41ca6d[_0xf722('0x22')]();};}function saveUpdates(_0x15b46c,_0x846f0a){return function(_0x5f2815){if(_0x5f2815){return _0x5f2815[_0xf722('0x23')](_0x15b46c)['then'](function(_0x305951){return _0x305951;});}return null;};}function removeEntity(_0x14cc2b,_0x136d7){return function(_0x3a9f69){if(_0x3a9f69){return _0x3a9f69['destroy']()[_0xf722('0x24')](function(){_0x14cc2b[_0xf722('0x19')](0xcc)[_0xf722('0x18')]();});}};}function handleEntityNotFound(_0x2a93a2,_0xe30d6){return function(_0x294a8e){if(!_0x294a8e){_0x2a93a2[_0xf722('0x17')](0x194);}return _0x294a8e;};}function handleError(_0x585f41,_0x47fe70){_0x47fe70=_0x47fe70||0x1f4;return function(_0x474c19){logger[_0xf722('0x25')](_0x474c19[_0xf722('0x26')]);if(_0x474c19[_0xf722('0x27')]){delete _0x474c19[_0xf722('0x27')];}_0x585f41[_0xf722('0x19')](_0x47fe70)[_0xf722('0x28')](_0x474c19);};}exports['index']=function(_0x4ec1e8,_0x405989){var _0x389255={},_0x3f06b3={},_0x45810f={'count':0x0,'rows':[]};var _0x5d9e1a=_[_0xf722('0x29')](db[_0xf722('0x2a')][_0xf722('0x2b')],function(_0x4b05dd){return{'name':_0x4b05dd[_0xf722('0x2c')],'type':_0x4b05dd['type']['key']};});_0x3f06b3['model']=_['map'](_0x5d9e1a,_0xf722('0x27'));_0x3f06b3[_0xf722('0x2d')]=_[_0xf722('0x2e')](_0x4ec1e8[_0xf722('0x2d')]);_0x3f06b3[_0xf722('0x2f')]=_[_0xf722('0x30')](_0x3f06b3[_0xf722('0x31')],_0x3f06b3[_0xf722('0x2d')]);_0x389255['attributes']=_[_0xf722('0x30')](_0x3f06b3[_0xf722('0x31')],qs[_0xf722('0x32')](_0x4ec1e8[_0xf722('0x2d')][_0xf722('0x32')]));_0x389255[_0xf722('0x33')]=_0x389255[_0xf722('0x33')][_0xf722('0x34')]?_0x389255['attributes']:_0x3f06b3[_0xf722('0x31')];if(!_0x4ec1e8[_0xf722('0x2d')]['hasOwnProperty'](_0xf722('0x35'))){_0x389255[_0xf722('0x1c')]=qs[_0xf722('0x1c')](_0x4ec1e8[_0xf722('0x2d')]['limit']);_0x389255[_0xf722('0x1a')]=qs[_0xf722('0x1a')](_0x4ec1e8[_0xf722('0x2d')][_0xf722('0x1a')]);}_0x389255['order']=qs[_0xf722('0x36')](_0x4ec1e8[_0xf722('0x2d')][_0xf722('0x36')]);_0x389255[_0xf722('0x37')]=qs[_0xf722('0x2f')](_['pick'](_0x4ec1e8[_0xf722('0x2d')],_0x3f06b3['filters']),_0x5d9e1a);if(_0x4ec1e8[_0xf722('0x2d')][_0xf722('0x38')]){_0x389255['where']=_['merge'](_0x389255[_0xf722('0x37')],{'$or':_[_0xf722('0x29')](_0x5d9e1a,function(_0x13a02a){if(_0x13a02a[_0xf722('0x39')]!==_0xf722('0x3a')){var _0x31af38={};_0x31af38[_0x13a02a[_0xf722('0x27')]]={'$like':'%'+_0x4ec1e8[_0xf722('0x2d')]['filter']+'%'};return _0x31af38;}})});}_0x389255=_[_0xf722('0x3b')]({},_0x389255,_0x4ec1e8[_0xf722('0x3c')]);var _0x1ed911={'where':_0x389255[_0xf722('0x37')]};return db[_0xf722('0x2a')][_0xf722('0x1d')](_0x1ed911)['then'](function(_0x4f7acb){_0x45810f[_0xf722('0x1d')]=_0x4f7acb;if(_0x4ec1e8[_0xf722('0x2d')][_0xf722('0x3d')]){_0x389255['include']=[{'all':!![]}];}return db[_0xf722('0x2a')][_0xf722('0x3e')](_0x389255);})[_0xf722('0x24')](function(_0x2e73e9){_0x45810f['rows']=_0x2e73e9;return _0x45810f;})[_0xf722('0x24')](respondWithFilteredResult(_0x405989,_0x389255))[_0xf722('0x3f')](handleError(_0x405989,null));};exports[_0xf722('0x40')]=function(_0x2f32d2,_0x4e2ce7){var _0x235d18={'raw':!![],'where':{'id':_0x2f32d2[_0xf722('0x41')]['id']}},_0x1a2e32={};_0x1a2e32['model']=_[_0xf722('0x2e')](db['FaxTransferReport'][_0xf722('0x2b')]);_0x1a2e32[_0xf722('0x2d')]=_[_0xf722('0x2e')](_0x2f32d2[_0xf722('0x2d')]);_0x1a2e32[_0xf722('0x2f')]=_[_0xf722('0x30')](_0x1a2e32[_0xf722('0x31')],_0x1a2e32[_0xf722('0x2d')]);_0x235d18[_0xf722('0x33')]=_[_0xf722('0x30')](_0x1a2e32[_0xf722('0x31')],qs['fields'](_0x2f32d2[_0xf722('0x2d')]['fields']));_0x235d18['attributes']=_0x235d18[_0xf722('0x33')]['length']?_0x235d18[_0xf722('0x33')]:_0x1a2e32[_0xf722('0x31')];if(_0x2f32d2[_0xf722('0x2d')][_0xf722('0x3d')]){_0x235d18[_0xf722('0x42')]=[{'all':!![]}];}_0x235d18=_[_0xf722('0x3b')]({},_0x235d18,_0x2f32d2['options']);return db[_0xf722('0x2a')]['find'](_0x235d18)[_0xf722('0x24')](handleEntityNotFound(_0x4e2ce7,null))[_0xf722('0x24')](respondWithResult(_0x4e2ce7,null))[_0xf722('0x3f')](handleError(_0x4e2ce7,null));};exports['create']=function(_0x17d90d,_0x464a9e){return db[_0xf722('0x2a')][_0xf722('0x43')](_0x17d90d[_0xf722('0x44')],{})[_0xf722('0x24')](respondWithResult(_0x464a9e,0xc9))['catch'](handleError(_0x464a9e,null));};exports[_0xf722('0x23')]=function(_0x224f39,_0x48d621){if(_0x224f39[_0xf722('0x44')]['id']){delete _0x224f39[_0xf722('0x44')]['id'];}return db[_0xf722('0x2a')]['find']({'where':{'id':_0x224f39[_0xf722('0x41')]['id']}})[_0xf722('0x24')](handleEntityNotFound(_0x48d621,null))[_0xf722('0x24')](saveUpdates(_0x224f39[_0xf722('0x44')],null))[_0xf722('0x24')](respondWithResult(_0x48d621,null))['catch'](handleError(_0x48d621,null));};exports[_0xf722('0x45')]=function(_0x1f6bcc,_0x4a7de8){return db[_0xf722('0x2a')][_0xf722('0x46')]({'where':{'id':_0x1f6bcc[_0xf722('0x41')]['id']}})['then'](handleEntityNotFound(_0x4a7de8,null))[_0xf722('0x24')](removeEntity(_0x4a7de8,null))[_0xf722('0x3f')](handleError(_0x4a7de8,null));};exports[_0xf722('0x47')]=function(_0x1a4a03,_0x4f52f1){return db[_0xf722('0x2a')][_0xf722('0x47')]()[_0xf722('0x24')](respondWithResult(_0x4f52f1,null))[_0xf722('0x3f')](handleError(_0x4f52f1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 72f9714..94b546c 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 _0xbcf7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api'];(function(_0x1aaebb,_0x20f616){var _0x403421=function(_0x4eb80d){while(--_0x4eb80d){_0x1aaebb['push'](_0x1aaebb['shift']());}};_0x403421(++_0x20f616);}(_0xbcf7,0xc1));var _0x7bcf=function(_0x3ca916,_0x23ae94){_0x3ca916=_0x3ca916-0x0;var _0x174857=_0xbcf7[_0x3ca916];return _0x174857;};'use strict';var _=require(_0x7bcf('0x0'));var util=require(_0x7bcf('0x1'));var logger=require('../../config/logger')(_0x7bcf('0x2'));var moment=require(_0x7bcf('0x3'));var BPromise=require(_0x7bcf('0x4'));var rp=require(_0x7bcf('0x5'));var fs=require('fs');var path=require(_0x7bcf('0x6'));var rimraf=require(_0x7bcf('0x7'));var config=require(_0x7bcf('0x8'));var attributes=require(_0x7bcf('0x9'));module[_0x7bcf('0xa')]=function(_0x12f594,_0xf61b29){return _0x12f594['define'](_0x7bcf('0xb'),attributes,{'tableName':_0x7bcf('0xc'),'paranoid':![],'indexes':[{'name':_0x7bcf('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x983f=['rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','util','../../config/logger','moment','request-promise','path'];(function(_0x5a06a1,_0x421abd){var _0x4c354f=function(_0x5bf25a){while(--_0x5bf25a){_0x5a06a1['push'](_0x5a06a1['shift']());}};_0x4c354f(++_0x421abd);}(_0x983f,0xd3));var _0xf983=function(_0x148d3d,_0x532f60){_0x148d3d=_0x148d3d-0x0;var _0x500576=_0x983f[_0x148d3d];return _0x500576;};'use strict';var _=require('lodash');var util=require(_0xf983('0x0'));var logger=require(_0xf983('0x1'))('api');var moment=require(_0xf983('0x2'));var BPromise=require('bluebird');var rp=require(_0xf983('0x3'));var fs=require('fs');var path=require(_0xf983('0x4'));var rimraf=require(_0xf983('0x5'));var config=require(_0xf983('0x6'));var attributes=require(_0xf983('0x7'));module[_0xf983('0x8')]=function(_0x48b74a,_0x120a32){return _0x48b74a[_0xf983('0x9')](_0xf983('0xa'),attributes,{'tableName':_0xf983('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','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 b6ab2b8..56c9aee 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 _0x2411=['request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5944c9,_0x52f4a3){var _0x1a3afe=function(_0x41ba7e){while(--_0x41ba7e){_0x5944c9['push'](_0x5944c9['shift']());}};_0x1a3afe(++_0x52f4a3);}(_0x2411,0x99));var _0x1241=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x2411[_0x166d93];return _0xba708;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1241('0x0'));var BPromise=require(_0x1241('0x1'));var rs=require(_0x1241('0x2'));var fs=require('fs');var Redis=require(_0x1241('0x3'));var db=require(_0x1241('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1241('0x5'))(_0x1241('0x6'));var config=require(_0x1241('0x7'));var jayson=require(_0x1241('0x8'));var client=jayson[_0x1241('0x9')][_0x1241('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f3a4f,_0xe62fc1,_0x571a00){return new BPromise(function(_0x51016a,_0x49f295){return client[_0x1241('0xb')](_0x3f3a4f,_0x571a00)['then'](function(_0x3c1abd){logger[_0x1241('0xc')](_0x1241('0xd'),_0xe62fc1,'request\x20sent');logger['debug'](_0x1241('0xe'),_0xe62fc1,_0x1241('0xf'),JSON[_0x1241('0x10')](_0x3c1abd));if(_0x3c1abd[_0x1241('0x11')]){if(_0x3c1abd[_0x1241('0x11')][_0x1241('0x12')]===0x1f4){logger[_0x1241('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0xe62fc1,_0x3c1abd[_0x1241('0x11')][_0x1241('0x13')]);return _0x49f295(_0x3c1abd[_0x1241('0x11')]['message']);}logger[_0x1241('0x11')](_0x1241('0xd'),_0xe62fc1,_0x3c1abd[_0x1241('0x11')][_0x1241('0x13')]);return _0x51016a(_0x3c1abd[_0x1241('0x11')][_0x1241('0x13')]);}else{logger[_0x1241('0xc')](_0x1241('0xd'),_0xe62fc1,'request\x20sent');_0x51016a(_0x3c1abd[_0x1241('0x14')][_0x1241('0x13')]);}})['catch'](function(_0x17ab93){logger[_0x1241('0x11')](_0x1241('0xd'),_0xe62fc1,_0x17ab93);_0x49f295(_0x17ab93);});});} \ No newline at end of file +var _0xbb75=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf39184,_0x856b12){var _0x37b8a1=function(_0x3edd07){while(--_0x3edd07){_0xf39184['push'](_0xf39184['shift']());}};_0x37b8a1(++_0x856b12);}(_0xbb75,0x121));var _0x5bb7=function(_0x38942f,_0x40d427){_0x38942f=_0x38942f-0x0;var _0x186ade=_0xbb75[_0x38942f];return _0x186ade;};'use strict';var _=require('lodash');var util=require(_0x5bb7('0x0'));var moment=require('moment');var BPromise=require(_0x5bb7('0x1'));var rs=require(_0x5bb7('0x2'));var fs=require('fs');var Redis=require(_0x5bb7('0x3'));var db=require(_0x5bb7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bb7('0x5'))(_0x5bb7('0x6'));var config=require(_0x5bb7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5bb7('0x8')][_0x5bb7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x167dbb,_0x1eebc8,_0x41db7f){return new BPromise(function(_0x4762ce,_0x4eacae){return client[_0x5bb7('0xa')](_0x167dbb,_0x41db7f)[_0x5bb7('0xb')](function(_0x5bfa20){logger[_0x5bb7('0xc')](_0x5bb7('0xd'),_0x1eebc8,_0x5bb7('0xe'));logger[_0x5bb7('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1eebc8,_0x5bb7('0xe'),JSON[_0x5bb7('0x10')](_0x5bfa20));if(_0x5bfa20[_0x5bb7('0x11')]){if(_0x5bfa20['error'][_0x5bb7('0x12')]===0x1f4){logger[_0x5bb7('0x11')](_0x5bb7('0xd'),_0x1eebc8,_0x5bfa20['error'][_0x5bb7('0x13')]);return _0x4eacae(_0x5bfa20['error'][_0x5bb7('0x13')]);}logger[_0x5bb7('0x11')](_0x5bb7('0xd'),_0x1eebc8,_0x5bfa20[_0x5bb7('0x11')]['message']);return _0x4762ce(_0x5bfa20['error'][_0x5bb7('0x13')]);}else{logger[_0x5bb7('0xc')](_0x5bb7('0xd'),_0x1eebc8,_0x5bb7('0xe'));_0x4762ce(_0x5bfa20[_0x5bb7('0x14')][_0x5bb7('0x13')]);}})['catch'](function(_0x27cd4a){logger[_0x5bb7('0x11')](_0x5bb7('0xd'),_0x1eebc8,_0x27cd4a);_0x4eacae(_0x27cd4a);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index ff91628..58da8dc 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 _0x9111=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','post','create'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x9111,0x74));var _0x1911=function(_0x4c9a17,_0x4c43f4){_0x4c9a17=_0x4c9a17-0x0;var _0x5ad17f=_0x9111[_0x4c9a17];return _0x5ad17f;};'use strict';var multer=require(_0x1911('0x0'));var util=require('util');var path=require(_0x1911('0x1'));var timeout=require(_0x1911('0x2'));var express=require(_0x1911('0x3'));var router=express[_0x1911('0x4')]();var fs_extra=require(_0x1911('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1911('0x6'));var config=require(_0x1911('0x7'));var controller=require('./faxTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1911('0x8')]);router['get'](_0x1911('0x9'),auth[_0x1911('0xa')](),controller[_0x1911('0xb')]);router[_0x1911('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1911('0xd')]);router[_0x1911('0xe')]('/',auth[_0x1911('0xa')](),controller[_0x1911('0xf')]);router[_0x1911('0x10')](_0x1911('0x11'),auth['isAuthenticated'](),controller[_0x1911('0x12')]);router[_0x1911('0x13')]('/:id',auth[_0x1911('0xa')](),controller[_0x1911('0x14')]);module[_0x1911('0x15')]=router; \ No newline at end of file +var _0x963c=['isAuthenticated','describe','show','post','create','put','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','index','/describe'];(function(_0x39e3f5,_0x3e65a5){var _0x166f20=function(_0xf73981){while(--_0xf73981){_0x39e3f5['push'](_0x39e3f5['shift']());}};_0x166f20(++_0x3e65a5);}(_0x963c,0x145));var _0xc963=function(_0x134e10,_0x1982fb){_0x134e10=_0x134e10-0x0;var _0x45bbb6=_0x963c[_0x134e10];return _0x45bbb6;};'use strict';var multer=require(_0xc963('0x0'));var util=require('util');var path=require(_0xc963('0x1'));var timeout=require(_0xc963('0x2'));var express=require('express');var router=express[_0xc963('0x3')]();var fs_extra=require(_0xc963('0x4'));var auth=require(_0xc963('0x5'));var interaction=require(_0xc963('0x6'));var config=require('../../config/environment');var controller=require(_0xc963('0x7'));router[_0xc963('0x8')]('/',auth['isAuthenticated'](),controller[_0xc963('0x9')]);router[_0xc963('0x8')](_0xc963('0xa'),auth[_0xc963('0xb')](),controller[_0xc963('0xc')]);router[_0xc963('0x8')]('/:id',auth[_0xc963('0xb')](),controller[_0xc963('0xd')]);router[_0xc963('0xe')]('/',auth['isAuthenticated'](),controller[_0xc963('0xf')]);router[_0xc963('0x10')]('/:id',auth[_0xc963('0xb')](),controller['update']);router[_0xc963('0x11')](_0xc963('0x12'),auth[_0xc963('0xb')](),controller[_0xc963('0x13')]);module[_0xc963('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index b518595..2b32b12 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 _0x68bc=['get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0x68bc,0xb4));var _0xc68b=function(_0x98d1ab,_0x5c30cf){_0x98d1ab=_0x98d1ab-0x0;var _0x402258=_0x68bc[_0x98d1ab];return _0x402258;};'use strict';var multer=require(_0xc68b('0x0'));var util=require(_0xc68b('0x1'));var path=require(_0xc68b('0x2'));var timeout=require(_0xc68b('0x3'));var express=require(_0xc68b('0x4'));var router=express[_0xc68b('0x5')]();var fs_extra=require(_0xc68b('0x6'));var auth=require(_0xc68b('0x7'));var interaction=require(_0xc68b('0x8'));var config=require(_0xc68b('0x9'));var controller=require(_0xc68b('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xc68b('0xb')]);router[_0xc68b('0xc')]('/:id',auth[_0xc68b('0xd')](),controller['show']);router[_0xc68b('0xc')](_0xc68b('0xe'),auth[_0xc68b('0xd')](),controller[_0xc68b('0xf')]);router['get'](_0xc68b('0x10'),auth['isAuthenticated'](),controller[_0xc68b('0x11')]);router[_0xc68b('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc68b('0xe'),auth[_0xc68b('0xd')](),controller['addConfiguration']);router[_0xc68b('0x13')](_0xc68b('0x14'),auth[_0xc68b('0xd')](),controller['update']);router[_0xc68b('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc68b('0x16')]);module[_0xc68b('0x17')]=router; \ No newline at end of file +var _0xd74d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','create','/:id/configurations','addConfiguration','put','delete','destroy','exports'];(function(_0xd048e4,_0xfdf32e){var _0x33342b=function(_0x569961){while(--_0x569961){_0xd048e4['push'](_0xd048e4['shift']());}};_0x33342b(++_0xfdf32e);}(_0xd74d,0x104));var _0xdd74=function(_0x2a1d5a,_0x3f5c19){_0x2a1d5a=_0x2a1d5a-0x0;var _0xaf6237=_0xd74d[_0x2a1d5a];return _0xaf6237;};'use strict';var multer=require('multer');var util=require(_0xdd74('0x0'));var path=require(_0xdd74('0x1'));var timeout=require(_0xdd74('0x2'));var express=require(_0xdd74('0x3'));var router=express['Router']();var fs_extra=require(_0xdd74('0x4'));var auth=require(_0xdd74('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdd74('0x6'));var controller=require('./intDeskAccount.controller');router[_0xdd74('0x7')]('/',auth[_0xdd74('0x8')](),controller[_0xdd74('0x9')]);router['get'](_0xdd74('0xa'),auth[_0xdd74('0x8')](),controller[_0xdd74('0xb')]);router[_0xdd74('0x7')]('/:id/configurations',auth[_0xdd74('0x8')](),controller['getConfigurations']);router['get'](_0xdd74('0xc'),auth[_0xdd74('0x8')](),controller['getFields']);router['post']('/',auth[_0xdd74('0x8')](),controller[_0xdd74('0xd')]);router['post'](_0xdd74('0xe'),auth[_0xdd74('0x8')](),controller[_0xdd74('0xf')]);router[_0xdd74('0x10')](_0xdd74('0xa'),auth[_0xdd74('0x8')](),controller['update']);router[_0xdd74('0x11')](_0xdd74('0xa'),auth[_0xdd74('0x8')](),controller[_0xdd74('0x12')]);module[_0xdd74('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 311bd21..f4b233a 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 _0x7e4f=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x1d2936,_0x30c806){var _0x2a8115=function(_0x95f8e4){while(--_0x95f8e4){_0x1d2936['push'](_0x1d2936['shift']());}};_0x2a8115(++_0x30c806);}(_0x7e4f,0x1cb));var _0xf7e4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7e4f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf7e4('0x0'));module[_0xf7e4('0x1')]={'name':{'type':Sequelize[_0xf7e4('0x2')]},'description':{'type':Sequelize[_0xf7e4('0x2')]},'username':{'type':Sequelize[_0xf7e4('0x2')]},'remoteUri':{'type':Sequelize[_0xf7e4('0x2')]},'authType':{'type':Sequelize[_0xf7e4('0x3')]('basic'),'defaultValue':_0xf7e4('0x4')},'password':{'type':Sequelize[_0xf7e4('0x2')]},'consumerKey':{'type':Sequelize[_0xf7e4('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf7e4('0x2')]},'tokenSecret':{'type':Sequelize[_0xf7e4('0x2')]},'serverUrl':{'type':Sequelize[_0xf7e4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf7e4('0x3')](_0xf7e4('0x5'),_0xf7e4('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x495a=['integrationTab','newTab','exports','STRING','basic'];(function(_0x335bef,_0x3b21d1){var _0x8914db=function(_0x1f9589){while(--_0x1f9589){_0x335bef['push'](_0x335bef['shift']());}};_0x8914db(++_0x3b21d1);}(_0x495a,0x1ab));var _0xa495=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x495a[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require('sequelize');module[_0xa495('0x0')]={'name':{'type':Sequelize[_0xa495('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xa495('0x2')},'password':{'type':Sequelize[_0xa495('0x1')]},'consumerKey':{'type':Sequelize[_0xa495('0x1')]},'consumerSecret':{'type':Sequelize[_0xa495('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xa495('0x1')]},'serverUrl':{'type':Sequelize[_0xa495('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa495('0x3'),_0xa495('0x4')),'defaultValue':_0xa495('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 2cc05f4..e8c6b44 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 _0x0299=['concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','query','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','findAll','rows','catch','show','intersection','fields','length','includeAll','include','find','create','body','findOne','params','DeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','password','consumerSecret','token','tokenSecret','substring','lastIndexOf','format','%s/custom_fields','application/json','headers','Basic\x20%s','%s:%s','username','toString','base64'];(function(_0x30c28e,_0x1b1ba2){var _0x547258=function(_0xd9a485){while(--_0xd9a485){_0x30c28e['push'](_0x30c28e['shift']());}};_0x547258(++_0x1b1ba2);}(_0x0299,0x14d));var _0x9029=function(_0x41e4f6,_0x66b2b5){_0x41e4f6=_0x41e4f6-0x0;var _0x2570a6=_0x0299[_0x41e4f6];return _0x2570a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9029('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9029('0x1'));var Mustache=require(_0x9029('0x2'));var util=require(_0x9029('0x3'));var path=require(_0x9029('0x4'));var sox=require(_0x9029('0x5'));var csv=require(_0x9029('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9029('0x7'));var _=require('lodash');var squel=require(_0x9029('0x8'));var crypto=require(_0x9029('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9029('0x6'));var querystring=require(_0x9029('0xa'));var Papa=require(_0x9029('0xb'));var Redis=require(_0x9029('0xc'));var authService=require(_0x9029('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9029('0xe'));var logger=require('../../config/logger')(_0x9029('0xf'));var utils=require(_0x9029('0x10'));var config=require(_0x9029('0x11'));var licenseUtil=require(_0x9029('0x12'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x23035d,_0x321bf8){_0x321bf8=_0x321bf8||0xcc;return function(_0x248ba9){if(_0x248ba9){return _0x23035d['sendStatus'](_0x321bf8);}return _0x23035d[_0x9029('0x13')](_0x321bf8)[_0x9029('0x14')]();};}function respondWithResult(_0x1b7b40,_0x20cd09){_0x20cd09=_0x20cd09||0xc8;return function(_0x181b5d){if(_0x181b5d){return _0x1b7b40[_0x9029('0x13')](_0x20cd09)['json'](_0x181b5d);}};}function respondWithFilteredResult(_0x459978,_0x1bd86a){return function(_0x845f93){if(_0x845f93){var _0x29fdf9=typeof _0x1bd86a[_0x9029('0x15')]==='undefined'&&typeof _0x1bd86a[_0x9029('0x16')]===_0x9029('0x17');var _0x16c0e4=_0x845f93[_0x9029('0x18')];var _0x167c1c=_0x29fdf9?0x0:_0x1bd86a[_0x9029('0x15')];var _0xe429ef=_0x29fdf9?_0x845f93['count']:_0x1bd86a[_0x9029('0x15')]+_0x1bd86a[_0x9029('0x16')];var _0x55890b;if(_0xe429ef>=_0x16c0e4){_0xe429ef=_0x16c0e4;_0x55890b=0xc8;}else{_0x55890b=0xce;}_0x459978['status'](_0x55890b);return _0x459978[_0x9029('0x19')](_0x9029('0x1a'),_0x167c1c+'-'+_0xe429ef+'/'+_0x16c0e4)[_0x9029('0x1b')](_0x845f93);}return null;};}function patchUpdates(_0x4f85c3){return function(_0x1df6f3){try{jsonpatch[_0x9029('0x1c')](_0x1df6f3,_0x4f85c3,!![]);}catch(_0x19e18c){return BPromise[_0x9029('0x1d')](_0x19e18c);}return _0x1df6f3[_0x9029('0x1e')]();};}function saveUpdates(_0x32ce80,_0x42317d){return function(_0x310966){if(_0x310966){return _0x310966[_0x9029('0x1f')](_0x32ce80)[_0x9029('0x20')](function(_0x4301a7){return _0x4301a7;});}return null;};}function removeEntity(_0x2830b7,_0x409f61){return function(_0x31f760){if(_0x31f760){return _0x31f760[_0x9029('0x21')]()[_0x9029('0x20')](function(){_0x2830b7[_0x9029('0x13')](0xcc)[_0x9029('0x14')]();});}};}function handleEntityNotFound(_0x217d41,_0x49d646){return function(_0x39771e){if(!_0x39771e){_0x217d41[_0x9029('0x22')](0x194);}return _0x39771e;};}function handleError(_0x5c212f,_0x48983e){_0x48983e=_0x48983e||0x1f4;return function(_0x2cf952){logger['error'](_0x2cf952['stack']);if(_0x2cf952[_0x9029('0x23')]){delete _0x2cf952[_0x9029('0x23')];}_0x5c212f['status'](_0x48983e)[_0x9029('0x24')](_0x2cf952);};}exports['index']=function(_0x448ffb,_0x501daf){var _0x4f763c={},_0x1f036b={},_0x1d1614={'count':0x0,'rows':[]};var _0x3fe964=_[_0x9029('0x25')](db[_0x9029('0x26')][_0x9029('0x27')],function(_0x14e5bf){return{'name':_0x14e5bf[_0x9029('0x28')],'type':_0x14e5bf[_0x9029('0x29')][_0x9029('0x2a')]};});_0x1f036b[_0x9029('0x2b')]=_[_0x9029('0x25')](_0x3fe964,'name');_0x1f036b['query']=_[_0x9029('0x2c')](_0x448ffb[_0x9029('0x2d')]);_0x1f036b['filters']=_['intersection'](_0x1f036b[_0x9029('0x2b')],_0x1f036b[_0x9029('0x2d')]);_0x4f763c[_0x9029('0x2e')]=_['intersection'](_0x1f036b[_0x9029('0x2b')],qs['fields'](_0x448ffb[_0x9029('0x2d')]['fields']));_0x4f763c['attributes']=_0x4f763c['attributes']['length']?_0x4f763c['attributes']:_0x1f036b[_0x9029('0x2b')];if(!_0x448ffb[_0x9029('0x2d')][_0x9029('0x2f')](_0x9029('0x30'))){_0x4f763c[_0x9029('0x16')]=qs[_0x9029('0x16')](_0x448ffb[_0x9029('0x2d')][_0x9029('0x16')]);_0x4f763c[_0x9029('0x15')]=qs[_0x9029('0x15')](_0x448ffb[_0x9029('0x2d')][_0x9029('0x15')]);}_0x4f763c[_0x9029('0x31')]=qs[_0x9029('0x32')](_0x448ffb[_0x9029('0x2d')][_0x9029('0x32')]);_0x4f763c[_0x9029('0x33')]=qs[_0x9029('0x34')](_[_0x9029('0x35')](_0x448ffb['query'],_0x1f036b[_0x9029('0x34')]),_0x3fe964);if(_0x448ffb['query'][_0x9029('0x36')]){_0x4f763c[_0x9029('0x33')]=_[_0x9029('0x37')](_0x4f763c[_0x9029('0x33')],{'$or':_[_0x9029('0x25')](_0x3fe964,function(_0x301623){if(_0x301623[_0x9029('0x29')]!=='VIRTUAL'){var _0x4345c2={};_0x4345c2[_0x301623[_0x9029('0x23')]]={'$like':'%'+_0x448ffb[_0x9029('0x2d')][_0x9029('0x36')]+'%'};return _0x4345c2;}})});}_0x4f763c=_[_0x9029('0x37')]({},_0x4f763c,_0x448ffb[_0x9029('0x38')]);var _0x31021a={'where':_0x4f763c[_0x9029('0x33')]};return db[_0x9029('0x26')][_0x9029('0x18')](_0x31021a)[_0x9029('0x20')](function(_0x1a800c){_0x1d1614[_0x9029('0x18')]=_0x1a800c;if(_0x448ffb[_0x9029('0x2d')]['includeAll']){_0x4f763c['include']=[{'all':!![]}];}return db['DeskAccount'][_0x9029('0x39')](_0x4f763c);})[_0x9029('0x20')](function(_0x373680){_0x1d1614[_0x9029('0x3a')]=_0x373680;return _0x1d1614;})['then'](respondWithFilteredResult(_0x501daf,_0x4f763c))[_0x9029('0x3b')](handleError(_0x501daf,null));};exports[_0x9029('0x3c')]=function(_0x445d3c,_0x253ffc){var _0xa67fcf={'raw':![],'where':{'id':_0x445d3c['params']['id']}},_0x4e541d={};_0x4e541d['model']=_[_0x9029('0x2c')](db[_0x9029('0x26')][_0x9029('0x27')]);_0x4e541d['query']=_['keys'](_0x445d3c[_0x9029('0x2d')]);_0x4e541d[_0x9029('0x34')]=_[_0x9029('0x3d')](_0x4e541d[_0x9029('0x2b')],_0x4e541d[_0x9029('0x2d')]);_0xa67fcf[_0x9029('0x2e')]=_[_0x9029('0x3d')](_0x4e541d['model'],qs[_0x9029('0x3e')](_0x445d3c['query'][_0x9029('0x3e')]));_0xa67fcf[_0x9029('0x2e')]=_0xa67fcf[_0x9029('0x2e')][_0x9029('0x3f')]?_0xa67fcf[_0x9029('0x2e')]:_0x4e541d[_0x9029('0x2b')];if(_0x445d3c[_0x9029('0x2d')][_0x9029('0x40')]){_0xa67fcf[_0x9029('0x41')]=[{'all':!![]}];}_0xa67fcf=_[_0x9029('0x37')]({},_0xa67fcf,_0x445d3c['options']);return db['DeskAccount'][_0x9029('0x42')](_0xa67fcf)[_0x9029('0x20')](handleEntityNotFound(_0x253ffc,null))[_0x9029('0x20')](respondWithResult(_0x253ffc,null))['catch'](handleError(_0x253ffc,null));};exports['create']=function(_0x53e6de,_0x2b9fa2){return db[_0x9029('0x26')][_0x9029('0x43')](_0x53e6de['body'],{})[_0x9029('0x20')](respondWithResult(_0x2b9fa2,0xc9))[_0x9029('0x3b')](handleError(_0x2b9fa2,null));};exports[_0x9029('0x1f')]=function(_0x2b1a56,_0x21f542){if(_0x2b1a56['body']['id']){delete _0x2b1a56[_0x9029('0x44')]['id'];}return db[_0x9029('0x26')]['find']({'where':{'id':_0x2b1a56['params']['id']}})['then'](handleEntityNotFound(_0x21f542,null))['then'](saveUpdates(_0x2b1a56[_0x9029('0x44')],null))[_0x9029('0x20')](respondWithResult(_0x21f542,null))[_0x9029('0x3b')](handleError(_0x21f542,null));};exports[_0x9029('0x21')]=function(_0x2c7721,_0x1ac73d){return db['DeskAccount'][_0x9029('0x42')]({'where':{'id':_0x2c7721['params']['id']}})[_0x9029('0x20')](handleEntityNotFound(_0x1ac73d,null))[_0x9029('0x20')](removeEntity(_0x1ac73d,null))[_0x9029('0x3b')](handleError(_0x1ac73d,null));};exports['getConfigurations']=function(_0x557468,_0xd3e1e1,_0x3ecfd5){var _0x22788c={};var _0x46aa05={};var _0x59e387;var _0xfbf987;return db[_0x9029('0x26')][_0x9029('0x45')]({'where':{'id':_0x557468[_0x9029('0x46')]['id']}})[_0x9029('0x20')](handleEntityNotFound(_0xd3e1e1,null))[_0x9029('0x20')](function(_0x535ee8){if(_0x535ee8){_0x59e387=_0x535ee8;_0x46aa05[_0x9029('0x2b')]=_[_0x9029('0x2c')](db[_0x9029('0x47')][_0x9029('0x27')]);_0x46aa05[_0x9029('0x2d')]=_['keys'](_0x557468[_0x9029('0x2d')]);_0x46aa05[_0x9029('0x34')]=_[_0x9029('0x3d')](_0x46aa05['model'],_0x46aa05[_0x9029('0x2d')]);_0x22788c[_0x9029('0x2e')]=_['intersection'](_0x46aa05[_0x9029('0x2b')],qs[_0x9029('0x3e')](_0x557468[_0x9029('0x2d')][_0x9029('0x3e')]));_0x22788c['attributes']=_0x22788c['attributes'][_0x9029('0x3f')]?_0x22788c['attributes']:_0x46aa05[_0x9029('0x2b')];_0x22788c[_0x9029('0x31')]=qs[_0x9029('0x32')](_0x557468[_0x9029('0x2d')][_0x9029('0x32')]);_0x22788c[_0x9029('0x33')]=qs[_0x9029('0x34')](_['pick'](_0x557468[_0x9029('0x2d')],_0x46aa05['filters']));if(_0x557468['query'][_0x9029('0x36')]){_0x22788c[_0x9029('0x33')]=_[_0x9029('0x37')](_0x22788c[_0x9029('0x33')],{'$or':_[_0x9029('0x25')](_0x22788c['attributes'],function(_0x54b042){var _0x19ca7c={};_0x19ca7c[_0x54b042]={'$like':'%'+_0x557468[_0x9029('0x2d')][_0x9029('0x36')]+'%'};return _0x19ca7c;})});}_0x22788c=_['merge']({},_0x22788c,_0x557468[_0x9029('0x38')]);return _0x59e387[_0x9029('0x48')](_0x22788c);}})['then'](function(_0x34fd04){if(_0x34fd04){_0xfbf987=_0x34fd04[_0x9029('0x3f')];if(!_0x557468[_0x9029('0x2d')][_0x9029('0x2f')](_0x9029('0x30'))){_0x22788c[_0x9029('0x16')]=qs['limit'](_0x557468[_0x9029('0x2d')][_0x9029('0x16')]);_0x22788c[_0x9029('0x15')]=qs['offset'](_0x557468['query']['offset']);}return _0x59e387[_0x9029('0x48')](_0x22788c);}})[_0x9029('0x20')](function(_0x30fd0b){if(_0x30fd0b){return _0x30fd0b?{'count':_0xfbf987,'rows':_0x30fd0b}:null;}})[_0x9029('0x20')](respondWithResult(_0xd3e1e1,null))[_0x9029('0x3b')](handleError(_0xd3e1e1,null));};exports[_0x9029('0x49')]=function(_0x11beb0,_0x1666ca,_0x4bb4d7){if(_0x11beb0[_0x9029('0x44')]['id']){delete _0x11beb0[_0x9029('0x44')]['id'];}return db[_0x9029('0x26')][_0x9029('0x45')]({'where':{'id':_0x11beb0[_0x9029('0x46')]['id']}})[_0x9029('0x20')](handleEntityNotFound(_0x1666ca,null))['then'](function(_0x579cac){if(_0x579cac){_0x11beb0[_0x9029('0x44')]['AccountId']=_0x579cac['id'];_0x11beb0[_0x9029('0x44')][_0x9029('0x4a')]=integrations[_0x9029('0x4b')](_0x11beb0[_0x9029('0x44')][_0x9029('0x4c')],_0x11beb0['body'][_0x9029('0x29')]);_0x11beb0[_0x9029('0x44')][_0x9029('0x4d')]=integrations[_0x9029('0x4e')](_0x11beb0[_0x9029('0x44')]['channel'],_0x11beb0[_0x9029('0x44')][_0x9029('0x29')]);return db[_0x9029('0x47')][_0x9029('0x43')](_0x11beb0[_0x9029('0x44')],{'include':[{'model':db[_0x9029('0x4f')],'as':_0x9029('0x4a')},{'model':db[_0x9029('0x4f')],'as':_0x9029('0x4d')}]});}return null;})[_0x9029('0x20')](respondWithResult(_0x1666ca,null))[_0x9029('0x3b')](handleError(_0x1666ca,null));};exports[_0x9029('0x50')]=function(_0x463611,_0x35a5ca,_0x3af615){var _0x3eff37=[{'name':_0x9029('0x51'),'label':_0x9029('0x51'),'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 _0x1586f8='';return db[_0x9029('0x26')][_0x9029('0x45')]({'where':{'id':_0x463611['params']['id']},'attributes':['id',_0x9029('0x52'),_0x9029('0x53'),'username',_0x9029('0x54'),'consumerKey',_0x9029('0x55'),_0x9029('0x56'),_0x9029('0x57')]})['then'](handleEntityNotFound(_0x35a5ca,null))[_0x9029('0x20')](function(_0x28ca84){if(_0x28ca84){_0x1586f8=_0x28ca84['remoteUri'];var _0x25d2c6=_0x1586f8['slice'](-0x1);if(_0x25d2c6==='/'){_0x1586f8=_0x1586f8[_0x9029('0x58')](0x0,_0x1586f8[_0x9029('0x59')](_0x25d2c6));}var _0x4a0ac6={'method':'GET','uri':util[_0x9029('0x5a')](_0x9029('0x5b'),_0x1586f8),'headers':{'Content-Type':'application/json','Accept':_0x9029('0x5c')},'json':!![]};if(_0x28ca84['authType']==='basic'){_0x4a0ac6[_0x9029('0x5d')]['Authorization']=util[_0x9029('0x5a')](_0x9029('0x5e'),new Buffer(util[_0x9029('0x5a')](_0x9029('0x5f'),_0x28ca84[_0x9029('0x60')],_0x28ca84[_0x9029('0x54')]))[_0x9029('0x61')](_0x9029('0x62')));}return rp(_0x4a0ac6)[_0x9029('0x20')](function(_0x4da9a3){return _0x3eff37[_0x9029('0x63')](_['map'](_0x4da9a3[_0x9029('0x64')][_0x9029('0x65')],function(_0x4634d3){return{'id':_0x4634d3[_0x9029('0x23')],'name':_0x4634d3[_0x9029('0x23')],'type':_0x4634d3[_0x9029('0x29')],'active':_0x4634d3['active'],'label':_0x4634d3[_0x9029('0x66')],'custom':!![]};}));});}})[_0x9029('0x20')](function(_0x43decc){return{'count':_0x43decc['length'],'rows':_0x43decc};})[_0x9029('0x20')](respondWithResult(_0x35a5ca,null))['catch'](function(_0x2101fe){var _0x18ceec=_0x463611[_0x9029('0x2d')][_0x9029('0x67')]?0x1f4:_0x2101fe['statusCode']||0x1f4;logger['error'](_0x9029('0x68'),_0x9029('0x50'),_0x18ceec,JSON[_0x9029('0x69')](_0x2101fe));delete _0x2101fe['name'];if(_0x18ceec===0x191){_0x18ceec=0x190;}_0x35a5ca['status'](_0x18ceec)[_0x9029('0x24')](_0x463611['query']['test']?{'message':_0x9029('0x6a'),'statusCode':_0x2101fe[_0x9029('0x6b')]}:_0x2101fe);});}; \ No newline at end of file +var _0x192c=['test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','DeskAccount','findAll','rows','show','params','includeAll','find','catch','create','body','update','DeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','priority','remoteUri','authType','username','consumerSecret','substring','lastIndexOf','GET','format','application/json','headers','Authorization','password','toString','_embedded','active','label'];(function(_0x5d75dd,_0x5605eb){var _0xdd48e2=function(_0x58dca0){while(--_0x58dca0){_0x5d75dd['push'](_0x5d75dd['shift']());}};_0xdd48e2(++_0x5605eb);}(_0x192c,0x71));var _0xc192=function(_0x34c2d4,_0x418ed2){_0x34c2d4=_0x34c2d4-0x0;var _0x38796a=_0x192c[_0x34c2d4];return _0x38796a;};'use strict';var emlformat=require(_0xc192('0x0'));var rimraf=require(_0xc192('0x1'));var zipdir=require(_0xc192('0x2'));var jsonpatch=require(_0xc192('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc192('0x4'));var Mustache=require(_0xc192('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc192('0x6'));var csv=require(_0xc192('0x7'));var ejs=require(_0xc192('0x8'));var fs=require('fs');var fs_extra=require(_0xc192('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc192('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc192('0xb'));var toCsv=require(_0xc192('0x7'));var querystring=require(_0xc192('0xc'));var Papa=require(_0xc192('0xd'));var Redis=require('ioredis');var authService=require(_0xc192('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc192('0xf'));var logger=require(_0xc192('0x10'))(_0xc192('0x11'));var utils=require(_0xc192('0x12'));var config=require(_0xc192('0x13'));var licenseUtil=require(_0xc192('0x14'));var db=require(_0xc192('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5701a9,_0x2c237a){_0x2c237a=_0x2c237a||0xcc;return function(_0x5adb64){if(_0x5adb64){return _0x5701a9[_0xc192('0x16')](_0x2c237a);}return _0x5701a9[_0xc192('0x17')](_0x2c237a)[_0xc192('0x18')]();};}function respondWithResult(_0x4c021a,_0x277bf1){_0x277bf1=_0x277bf1||0xc8;return function(_0x240e58){if(_0x240e58){return _0x4c021a[_0xc192('0x17')](_0x277bf1)['json'](_0x240e58);}};}function respondWithFilteredResult(_0x7624b4,_0x3188f1){return function(_0x44bc71){if(_0x44bc71){var _0x55bac2=typeof _0x3188f1[_0xc192('0x19')]===_0xc192('0x1a')&&typeof _0x3188f1[_0xc192('0x1b')]==='undefined';var _0x1de97c=_0x44bc71[_0xc192('0x1c')];var _0x395e86=_0x55bac2?0x0:_0x3188f1[_0xc192('0x19')];var _0x585cc4=_0x55bac2?_0x44bc71['count']:_0x3188f1[_0xc192('0x19')]+_0x3188f1[_0xc192('0x1b')];var _0x5ec228;if(_0x585cc4>=_0x1de97c){_0x585cc4=_0x1de97c;_0x5ec228=0xc8;}else{_0x5ec228=0xce;}_0x7624b4[_0xc192('0x17')](_0x5ec228);return _0x7624b4[_0xc192('0x1d')](_0xc192('0x1e'),_0x395e86+'-'+_0x585cc4+'/'+_0x1de97c)[_0xc192('0x1f')](_0x44bc71);}return null;};}function patchUpdates(_0x492040){return function(_0x5ac565){try{jsonpatch[_0xc192('0x20')](_0x5ac565,_0x492040,!![]);}catch(_0x58358c){return BPromise[_0xc192('0x21')](_0x58358c);}return _0x5ac565[_0xc192('0x22')]();};}function saveUpdates(_0x23e706,_0x44234a){return function(_0x74eaf4){if(_0x74eaf4){return _0x74eaf4['update'](_0x23e706)[_0xc192('0x23')](function(_0x5f246a){return _0x5f246a;});}return null;};}function removeEntity(_0x4a2bbf,_0x28eb08){return function(_0x19dfb0){if(_0x19dfb0){return _0x19dfb0['destroy']()[_0xc192('0x23')](function(){_0x4a2bbf[_0xc192('0x17')](0xcc)[_0xc192('0x18')]();});}};}function handleEntityNotFound(_0x429107,_0x32bcbf){return function(_0x27c7cd){if(!_0x27c7cd){_0x429107[_0xc192('0x16')](0x194);}return _0x27c7cd;};}function handleError(_0x4d52e5,_0xd2a984){_0xd2a984=_0xd2a984||0x1f4;return function(_0x5d8a15){logger[_0xc192('0x24')](_0x5d8a15[_0xc192('0x25')]);if(_0x5d8a15[_0xc192('0x26')]){delete _0x5d8a15['name'];}_0x4d52e5[_0xc192('0x17')](_0xd2a984)[_0xc192('0x27')](_0x5d8a15);};}exports[_0xc192('0x28')]=function(_0x512f61,_0x1d697f){var _0x1803af={},_0x3dbaef={},_0x48ef35={'count':0x0,'rows':[]};var _0x493e26=_[_0xc192('0x29')](db['DeskAccount'][_0xc192('0x2a')],function(_0x2c38cc){return{'name':_0x2c38cc[_0xc192('0x2b')],'type':_0x2c38cc[_0xc192('0x2c')][_0xc192('0x2d')]};});_0x3dbaef['model']=_[_0xc192('0x29')](_0x493e26,_0xc192('0x26'));_0x3dbaef[_0xc192('0x2e')]=_[_0xc192('0x2f')](_0x512f61[_0xc192('0x2e')]);_0x3dbaef['filters']=_[_0xc192('0x30')](_0x3dbaef['model'],_0x3dbaef[_0xc192('0x2e')]);_0x1803af[_0xc192('0x31')]=_[_0xc192('0x30')](_0x3dbaef[_0xc192('0x32')],qs[_0xc192('0x33')](_0x512f61[_0xc192('0x2e')]['fields']));_0x1803af[_0xc192('0x31')]=_0x1803af[_0xc192('0x31')][_0xc192('0x34')]?_0x1803af[_0xc192('0x31')]:_0x3dbaef['model'];if(!_0x512f61[_0xc192('0x2e')][_0xc192('0x35')](_0xc192('0x36'))){_0x1803af[_0xc192('0x1b')]=qs[_0xc192('0x1b')](_0x512f61[_0xc192('0x2e')][_0xc192('0x1b')]);_0x1803af[_0xc192('0x19')]=qs[_0xc192('0x19')](_0x512f61[_0xc192('0x2e')][_0xc192('0x19')]);}_0x1803af[_0xc192('0x37')]=qs[_0xc192('0x38')](_0x512f61[_0xc192('0x2e')][_0xc192('0x38')]);_0x1803af[_0xc192('0x39')]=qs[_0xc192('0x3a')](_['pick'](_0x512f61[_0xc192('0x2e')],_0x3dbaef[_0xc192('0x3a')]),_0x493e26);if(_0x512f61['query'][_0xc192('0x3b')]){_0x1803af[_0xc192('0x39')]=_['merge'](_0x1803af[_0xc192('0x39')],{'$or':_[_0xc192('0x29')](_0x493e26,function(_0x45c63b){if(_0x45c63b['type']!==_0xc192('0x3c')){var _0xed41c={};_0xed41c[_0x45c63b[_0xc192('0x26')]]={'$like':'%'+_0x512f61[_0xc192('0x2e')][_0xc192('0x3b')]+'%'};return _0xed41c;}})});}_0x1803af=_[_0xc192('0x3d')]({},_0x1803af,_0x512f61[_0xc192('0x3e')]);var _0x12da6a={'where':_0x1803af[_0xc192('0x39')]};return db['DeskAccount']['count'](_0x12da6a)[_0xc192('0x23')](function(_0x103322){_0x48ef35[_0xc192('0x1c')]=_0x103322;if(_0x512f61[_0xc192('0x2e')]['includeAll']){_0x1803af[_0xc192('0x3f')]=[{'all':!![]}];}return db[_0xc192('0x40')][_0xc192('0x41')](_0x1803af);})[_0xc192('0x23')](function(_0x331986){_0x48ef35[_0xc192('0x42')]=_0x331986;return _0x48ef35;})[_0xc192('0x23')](respondWithFilteredResult(_0x1d697f,_0x1803af))['catch'](handleError(_0x1d697f,null));};exports[_0xc192('0x43')]=function(_0x38b8c9,_0x5c675c){var _0x9bec9b={'raw':![],'where':{'id':_0x38b8c9[_0xc192('0x44')]['id']}},_0x2fdae2={};_0x2fdae2[_0xc192('0x32')]=_[_0xc192('0x2f')](db[_0xc192('0x40')][_0xc192('0x2a')]);_0x2fdae2[_0xc192('0x2e')]=_['keys'](_0x38b8c9['query']);_0x2fdae2[_0xc192('0x3a')]=_[_0xc192('0x30')](_0x2fdae2[_0xc192('0x32')],_0x2fdae2[_0xc192('0x2e')]);_0x9bec9b[_0xc192('0x31')]=_[_0xc192('0x30')](_0x2fdae2[_0xc192('0x32')],qs[_0xc192('0x33')](_0x38b8c9[_0xc192('0x2e')][_0xc192('0x33')]));_0x9bec9b[_0xc192('0x31')]=_0x9bec9b['attributes'][_0xc192('0x34')]?_0x9bec9b['attributes']:_0x2fdae2['model'];if(_0x38b8c9['query'][_0xc192('0x45')]){_0x9bec9b[_0xc192('0x3f')]=[{'all':!![]}];}_0x9bec9b=_[_0xc192('0x3d')]({},_0x9bec9b,_0x38b8c9[_0xc192('0x3e')]);return db[_0xc192('0x40')][_0xc192('0x46')](_0x9bec9b)[_0xc192('0x23')](handleEntityNotFound(_0x5c675c,null))['then'](respondWithResult(_0x5c675c,null))[_0xc192('0x47')](handleError(_0x5c675c,null));};exports[_0xc192('0x48')]=function(_0x580ea5,_0x253f55){return db[_0xc192('0x40')][_0xc192('0x48')](_0x580ea5[_0xc192('0x49')],{})['then'](respondWithResult(_0x253f55,0xc9))['catch'](handleError(_0x253f55,null));};exports[_0xc192('0x4a')]=function(_0x5ddb08,_0x43a46c){if(_0x5ddb08[_0xc192('0x49')]['id']){delete _0x5ddb08['body']['id'];}return db[_0xc192('0x40')][_0xc192('0x46')]({'where':{'id':_0x5ddb08['params']['id']}})[_0xc192('0x23')](handleEntityNotFound(_0x43a46c,null))[_0xc192('0x23')](saveUpdates(_0x5ddb08[_0xc192('0x49')],null))[_0xc192('0x23')](respondWithResult(_0x43a46c,null))[_0xc192('0x47')](handleError(_0x43a46c,null));};exports['destroy']=function(_0x162a8a,_0xc8d4d5){return db[_0xc192('0x40')]['find']({'where':{'id':_0x162a8a['params']['id']}})[_0xc192('0x23')](handleEntityNotFound(_0xc8d4d5,null))[_0xc192('0x23')](removeEntity(_0xc8d4d5,null))[_0xc192('0x47')](handleError(_0xc8d4d5,null));};exports['getConfigurations']=function(_0x3c64c7,_0x5d2d9b,_0x4d48d8){var _0x461c56={};var _0x5e9c19={};var _0x179dec;var _0x311efa;return db[_0xc192('0x40')]['findOne']({'where':{'id':_0x3c64c7[_0xc192('0x44')]['id']}})[_0xc192('0x23')](handleEntityNotFound(_0x5d2d9b,null))[_0xc192('0x23')](function(_0x21cdec){if(_0x21cdec){_0x179dec=_0x21cdec;_0x5e9c19['model']=_[_0xc192('0x2f')](db[_0xc192('0x4b')][_0xc192('0x2a')]);_0x5e9c19[_0xc192('0x2e')]=_[_0xc192('0x2f')](_0x3c64c7['query']);_0x5e9c19[_0xc192('0x3a')]=_['intersection'](_0x5e9c19[_0xc192('0x32')],_0x5e9c19[_0xc192('0x2e')]);_0x461c56[_0xc192('0x31')]=_['intersection'](_0x5e9c19[_0xc192('0x32')],qs[_0xc192('0x33')](_0x3c64c7['query']['fields']));_0x461c56[_0xc192('0x31')]=_0x461c56[_0xc192('0x31')][_0xc192('0x34')]?_0x461c56[_0xc192('0x31')]:_0x5e9c19[_0xc192('0x32')];_0x461c56[_0xc192('0x37')]=qs[_0xc192('0x38')](_0x3c64c7['query'][_0xc192('0x38')]);_0x461c56[_0xc192('0x39')]=qs[_0xc192('0x3a')](_['pick'](_0x3c64c7['query'],_0x5e9c19['filters']));if(_0x3c64c7[_0xc192('0x2e')]['filter']){_0x461c56[_0xc192('0x39')]=_[_0xc192('0x3d')](_0x461c56['where'],{'$or':_[_0xc192('0x29')](_0x461c56[_0xc192('0x31')],function(_0x2609b6){var _0x5a37d5={};_0x5a37d5[_0x2609b6]={'$like':'%'+_0x3c64c7['query'][_0xc192('0x3b')]+'%'};return _0x5a37d5;})});}_0x461c56=_[_0xc192('0x3d')]({},_0x461c56,_0x3c64c7[_0xc192('0x3e')]);return _0x179dec[_0xc192('0x4c')](_0x461c56);}})['then'](function(_0x434144){if(_0x434144){_0x311efa=_0x434144[_0xc192('0x34')];if(!_0x3c64c7['query'][_0xc192('0x35')](_0xc192('0x36'))){_0x461c56[_0xc192('0x1b')]=qs[_0xc192('0x1b')](_0x3c64c7['query'][_0xc192('0x1b')]);_0x461c56['offset']=qs[_0xc192('0x19')](_0x3c64c7[_0xc192('0x2e')][_0xc192('0x19')]);}return _0x179dec[_0xc192('0x4c')](_0x461c56);}})['then'](function(_0x401d68){if(_0x401d68){return _0x401d68?{'count':_0x311efa,'rows':_0x401d68}:null;}})['then'](respondWithResult(_0x5d2d9b,null))['catch'](handleError(_0x5d2d9b,null));};exports[_0xc192('0x4d')]=function(_0x3e018d,_0x11464c,_0x25a310){if(_0x3e018d['body']['id']){delete _0x3e018d['body']['id'];}return db[_0xc192('0x40')][_0xc192('0x4e')]({'where':{'id':_0x3e018d['params']['id']}})[_0xc192('0x23')](handleEntityNotFound(_0x11464c,null))['then'](function(_0x382ed9){if(_0x382ed9){_0x3e018d[_0xc192('0x49')][_0xc192('0x4f')]=_0x382ed9['id'];_0x3e018d[_0xc192('0x49')][_0xc192('0x50')]=integrations[_0xc192('0x51')](_0x3e018d['body'][_0xc192('0x52')],_0x3e018d['body'][_0xc192('0x2c')]);_0x3e018d['body']['Descriptions']=integrations[_0xc192('0x53')](_0x3e018d[_0xc192('0x49')][_0xc192('0x52')],_0x3e018d[_0xc192('0x49')]['type']);return db['DeskConfiguration']['create'](_0x3e018d[_0xc192('0x49')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0xc192('0x54')],'as':_0xc192('0x55')}]});}return null;})[_0xc192('0x23')](respondWithResult(_0x11464c,null))[_0xc192('0x47')](handleError(_0x11464c,null));};exports['getFields']=function(_0xc2e405,_0x62747e,_0x337d5b){var _0x2712fe=[{'name':_0xc192('0x56'),'label':_0xc192('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x48f2d2='';return db['DeskAccount']['findOne']({'where':{'id':_0xc2e405['params']['id']},'attributes':['id',_0xc192('0x57'),_0xc192('0x58'),_0xc192('0x59'),'password','consumerKey',_0xc192('0x5a'),'token','tokenSecret']})[_0xc192('0x23')](handleEntityNotFound(_0x62747e,null))[_0xc192('0x23')](function(_0x203421){if(_0x203421){_0x48f2d2=_0x203421[_0xc192('0x57')];var _0xbd20=_0x48f2d2['slice'](-0x1);if(_0xbd20==='/'){_0x48f2d2=_0x48f2d2[_0xc192('0x5b')](0x0,_0x48f2d2[_0xc192('0x5c')](_0xbd20));}var _0x3fff0d={'method':_0xc192('0x5d'),'uri':util[_0xc192('0x5e')]('%s/custom_fields',_0x48f2d2),'headers':{'Content-Type':_0xc192('0x5f'),'Accept':_0xc192('0x5f')},'json':!![]};if(_0x203421['authType']==='basic'){_0x3fff0d[_0xc192('0x60')][_0xc192('0x61')]=util[_0xc192('0x5e')]('Basic\x20%s',new Buffer(util[_0xc192('0x5e')]('%s:%s',_0x203421['username'],_0x203421[_0xc192('0x62')]))[_0xc192('0x63')]('base64'));}return rp(_0x3fff0d)['then'](function(_0x2b42d9){return _0x2712fe['concat'](_[_0xc192('0x29')](_0x2b42d9[_0xc192('0x64')]['entries'],function(_0x19745a){return{'id':_0x19745a[_0xc192('0x26')],'name':_0x19745a['name'],'type':_0x19745a[_0xc192('0x2c')],'active':_0x19745a[_0xc192('0x65')],'label':_0x19745a[_0xc192('0x66')],'custom':!![]};}));});}})[_0xc192('0x23')](function(_0x1f2bc2){return{'count':_0x1f2bc2[_0xc192('0x34')],'rows':_0x1f2bc2};})[_0xc192('0x23')](respondWithResult(_0x62747e,null))['catch'](function(_0x1b3d4c){var _0xf76338=_0xc2e405[_0xc192('0x2e')][_0xc192('0x67')]?0x1f4:_0x1b3d4c[_0xc192('0x68')]||0x1f4;logger[_0xc192('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xc192('0x69'),_0xf76338,JSON[_0xc192('0x6a')](_0x1b3d4c));delete _0x1b3d4c[_0xc192('0x26')];if(_0xf76338===0x191){_0xf76338=0x190;}_0x62747e['status'](_0xf76338)[_0xc192('0x27')](_0xc2e405[_0xc192('0x2e')][_0xc192('0x67')]?{'message':_0xc192('0x6b'),'statusCode':_0x1b3d4c[_0xc192('0x68')]}:_0x1b3d4c);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 1c6cba0..0161eb5 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 _0x3985=['./intDeskAccount.attributes','exports','define','lodash','api','moment','rimraf','../../config/environment'];(function(_0x155bbf,_0x1bca34){var _0x1cb0ac=function(_0x101c7c){while(--_0x101c7c){_0x155bbf['push'](_0x155bbf['shift']());}};_0x1cb0ac(++_0x1bca34);}(_0x3985,0x11b));var _0x5398=function(_0x5756a1,_0x380998){_0x5756a1=_0x5756a1-0x0;var _0x1e9f20=_0x3985[_0x5756a1];return _0x1e9f20;};'use strict';var _=require(_0x5398('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5398('0x1'));var moment=require(_0x5398('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5398('0x3'));var config=require(_0x5398('0x4'));var attributes=require(_0x5398('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x5398('0x6')]=function(_0x4be728,_0x43b01b){return _0x4be728[_0x5398('0x7')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d9c=['api','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x251468,_0x233aec){var _0x1b9ac9=function(_0x15a4ca){while(--_0x15a4ca){_0x251468['push'](_0x251468['shift']());}};_0x1b9ac9(++_0x233aec);}(_0x5d9c,0xdd));var _0xc5d9=function(_0x599395,_0x433fdc){_0x599395=_0x599395-0x0;var _0x47783b=_0x5d9c[_0x599395];return _0x47783b;};'use strict';var _=require(_0xc5d9('0x0'));var util=require(_0xc5d9('0x1'));var logger=require(_0xc5d9('0x2'))(_0xc5d9('0x3'));var moment=require(_0xc5d9('0x4'));var BPromise=require(_0xc5d9('0x5'));var rp=require(_0xc5d9('0x6'));var fs=require('fs');var path=require(_0xc5d9('0x7'));var rimraf=require('rimraf');var config=require(_0xc5d9('0x8'));var attributes=require(_0xc5d9('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xc5d9('0xa')]=function(_0x492fa3,_0x52a445){return _0x492fa3[_0xc5d9('0xb')](_0xc5d9('0xc'),attributes,{'tableName':_0xc5d9('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 7e62839..23e02e7 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 _0x7943=['bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowDeskAccount','find','lodash','util','moment'];(function(_0x36ed98,_0x19c7d2){var _0x46dfd1=function(_0x587390){while(--_0x587390){_0x36ed98['push'](_0x36ed98['shift']());}};_0x46dfd1(++_0x19c7d2);}(_0x7943,0x1e7));var _0x3794=function(_0x55c65d,_0x5d57a6){_0x55c65d=_0x55c65d-0x0;var _0x194c0a=_0x7943[_0x55c65d];return _0x194c0a;};'use strict';var _=require(_0x3794('0x0'));var util=require(_0x3794('0x1'));var moment=require(_0x3794('0x2'));var BPromise=require(_0x3794('0x3'));var rs=require(_0x3794('0x4'));var fs=require('fs');var Redis=require(_0x3794('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3794('0x6'))(_0x3794('0x7'));var config=require('../../config/environment');var jayson=require(_0x3794('0x8'));var client=jayson[_0x3794('0x9')][_0x3794('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20d6a6,_0x340f70,_0x884c04){return new BPromise(function(_0x31375e,_0xee7370){return client['request'](_0x20d6a6,_0x884c04)[_0x3794('0xb')](function(_0x2fe813){logger[_0x3794('0xc')](_0x3794('0xd'),_0x340f70,_0x3794('0xe'));logger[_0x3794('0xf')](_0x3794('0x10'),_0x340f70,_0x3794('0xe'),JSON[_0x3794('0x11')](_0x2fe813));if(_0x2fe813['error']){if(_0x2fe813[_0x3794('0x12')]['code']===0x1f4){logger['error'](_0x3794('0xd'),_0x340f70,_0x2fe813[_0x3794('0x12')]['message']);return _0xee7370(_0x2fe813[_0x3794('0x12')][_0x3794('0x13')]);}logger[_0x3794('0x12')](_0x3794('0xd'),_0x340f70,_0x2fe813[_0x3794('0x12')]['message']);return _0x31375e(_0x2fe813['error'][_0x3794('0x13')]);}else{logger[_0x3794('0xc')](_0x3794('0xd'),_0x340f70,_0x3794('0xe'));_0x31375e(_0x2fe813[_0x3794('0x14')]['message']);}})[_0x3794('0x15')](function(_0x5a580d){logger['error'](_0x3794('0xd'),_0x340f70,_0x5a580d);_0xee7370(_0x5a580d);});});}exports[_0x3794('0x16')]=function(_0x1556b8){var _0xb7dc19=this;return new Promise(function(_0x58c5b1,_0x3862d8){return db[_0x3794('0x17')][_0x3794('0x18')]({'raw':_0x1556b8['options']?_0x1556b8[_0x3794('0x19')][_0x3794('0x1a')]===undefined?!![]:![]:!![],'where':_0x1556b8[_0x3794('0x19')]?_0x1556b8['options'][_0x3794('0x1b')]||null:null,'attributes':_0x1556b8['options']?_0x1556b8[_0x3794('0x19')][_0x3794('0x1c')]||null:null,'limit':_0x1556b8[_0x3794('0x19')]?_0x1556b8[_0x3794('0x19')][_0x3794('0x1d')]||null:null,'include':_0x1556b8[_0x3794('0x19')]?_0x1556b8[_0x3794('0x19')]['include']?_[_0x3794('0x1e')](_0x1556b8['options'][_0x3794('0x1f')],function(_0x4ba065){return{'model':db[_0x4ba065[_0x3794('0x20')]],'as':_0x4ba065['as'],'attributes':_0x4ba065['attributes'],'include':_0x4ba065[_0x3794('0x1f')]?_['map'](_0x4ba065['include'],function(_0x2babd7){return{'model':db[_0x2babd7[_0x3794('0x20')]],'as':_0x2babd7['as'],'attributes':_0x2babd7['attributes'],'include':_0x2babd7[_0x3794('0x1f')]?_[_0x3794('0x1e')](_0x2babd7[_0x3794('0x1f')],function(_0x232edf){return{'model':db[_0x232edf['model']],'as':_0x232edf['as'],'attributes':_0x232edf[_0x3794('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3794('0xb')](function(_0x4abe04){logger[_0x3794('0xc')](_0x3794('0x16'),_0x1556b8);logger[_0x3794('0xf')](_0x3794('0x16'),_0x1556b8,JSON[_0x3794('0x11')](_0x4abe04));_0x58c5b1(_0x4abe04);})[_0x3794('0x15')](function(_0x504505){logger[_0x3794('0x12')](_0x3794('0x16'),_0x504505[_0x3794('0x13')],_0x1556b8);_0x3862d8(_0xb7dc19[_0x3794('0x12')](0x1f4,_0x504505['message']));});});};exports[_0x3794('0x21')]=function(_0x29666e){var _0x131f50=this;return new Promise(function(_0x1a5304,_0x37f5f5){return db[_0x3794('0x17')][_0x3794('0x22')]({'raw':_0x29666e['options']?_0x29666e[_0x3794('0x19')][_0x3794('0x1a')]===undefined?!![]:![]:!![],'where':_0x29666e[_0x3794('0x19')]?_0x29666e[_0x3794('0x19')][_0x3794('0x1b')]||null:null,'attributes':_0x29666e[_0x3794('0x19')]?_0x29666e[_0x3794('0x19')][_0x3794('0x1c')]||null:null,'include':_0x29666e[_0x3794('0x19')]?_0x29666e[_0x3794('0x19')][_0x3794('0x1f')]?_[_0x3794('0x1e')](_0x29666e[_0x3794('0x19')][_0x3794('0x1f')],function(_0x4337e2){return{'model':db[_0x4337e2[_0x3794('0x20')]],'as':_0x4337e2['as'],'attributes':_0x4337e2['attributes'],'include':_0x4337e2[_0x3794('0x1f')]?_[_0x3794('0x1e')](_0x4337e2['include'],function(_0x2ae2fd){return{'model':db[_0x2ae2fd[_0x3794('0x20')]],'as':_0x2ae2fd['as'],'attributes':_0x2ae2fd[_0x3794('0x1c')],'include':_0x2ae2fd[_0x3794('0x1f')]?_['map'](_0x2ae2fd[_0x3794('0x1f')],function(_0x1228bc){return{'model':db[_0x1228bc[_0x3794('0x20')]],'as':_0x1228bc['as'],'attributes':_0x1228bc[_0x3794('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3794('0xb')](function(_0x3b0658){logger['info'](_0x3794('0x21'),_0x29666e);logger['debug']('ShowDeskAccount',_0x29666e,JSON[_0x3794('0x11')](_0x3b0658));_0x1a5304(_0x3b0658);})['catch'](function(_0x2d7207){logger['error'](_0x3794('0x21'),_0x2d7207[_0x3794('0x13')],_0x29666e);_0x37f5f5(_0x131f50[_0x3794('0x12')](0x1f4,_0x2d7207[_0x3794('0x13')]));});});}; \ No newline at end of file +var _0x2a85=['error','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowDeskAccount','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xe63701,_0x3eea96){var _0xd2c84f=function(_0x17d960){while(--_0x17d960){_0xe63701['push'](_0xe63701['shift']());}};_0xd2c84f(++_0x3eea96);}(_0x2a85,0xe9));var _0x52a8=function(_0x116016,_0x4d82e3){_0x116016=_0x116016-0x0;var _0xdb2f77=_0x2a85[_0x116016];return _0xdb2f77;};'use strict';var _=require(_0x52a8('0x0'));var util=require(_0x52a8('0x1'));var moment=require('moment');var BPromise=require(_0x52a8('0x2'));var rs=require(_0x52a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52a8('0x4'))['db'];var utils=require(_0x52a8('0x5'));var logger=require(_0x52a8('0x6'))(_0x52a8('0x7'));var config=require(_0x52a8('0x8'));var jayson=require(_0x52a8('0x9'));var client=jayson[_0x52a8('0xa')][_0x52a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f03a4,_0x484ce5,_0x8a096b){return new BPromise(function(_0x18ff97,_0x827e5a){return client[_0x52a8('0xc')](_0x3f03a4,_0x8a096b)[_0x52a8('0xd')](function(_0x341057){logger[_0x52a8('0xe')]('DeskAccount,\x20%s,\x20%s',_0x484ce5,_0x52a8('0xf'));logger[_0x52a8('0x10')](_0x52a8('0x11'),_0x484ce5,_0x52a8('0xf'),JSON[_0x52a8('0x12')](_0x341057));if(_0x341057[_0x52a8('0x13')]){if(_0x341057[_0x52a8('0x13')]['code']===0x1f4){logger[_0x52a8('0x13')](_0x52a8('0x14'),_0x484ce5,_0x341057[_0x52a8('0x13')][_0x52a8('0x15')]);return _0x827e5a(_0x341057[_0x52a8('0x13')]['message']);}logger[_0x52a8('0x13')](_0x52a8('0x14'),_0x484ce5,_0x341057[_0x52a8('0x13')][_0x52a8('0x15')]);return _0x18ff97(_0x341057[_0x52a8('0x13')]['message']);}else{logger['info'](_0x52a8('0x14'),_0x484ce5,_0x52a8('0xf'));_0x18ff97(_0x341057[_0x52a8('0x16')][_0x52a8('0x15')]);}})[_0x52a8('0x17')](function(_0xc57db5){logger[_0x52a8('0x13')](_0x52a8('0x14'),_0x484ce5,_0xc57db5);_0x827e5a(_0xc57db5);});});}exports[_0x52a8('0x18')]=function(_0x23a028){var _0x55a9df=this;return new Promise(function(_0x25f5c9,_0x32af86){return db[_0x52a8('0x19')][_0x52a8('0x1a')]({'raw':_0x23a028[_0x52a8('0x1b')]?_0x23a028[_0x52a8('0x1b')][_0x52a8('0x1c')]===undefined?!![]:![]:!![],'where':_0x23a028[_0x52a8('0x1b')]?_0x23a028[_0x52a8('0x1b')]['where']||null:null,'attributes':_0x23a028[_0x52a8('0x1b')]?_0x23a028[_0x52a8('0x1b')][_0x52a8('0x1d')]||null:null,'limit':_0x23a028[_0x52a8('0x1b')]?_0x23a028[_0x52a8('0x1b')][_0x52a8('0x1e')]||null:null,'include':_0x23a028['options']?_0x23a028[_0x52a8('0x1b')][_0x52a8('0x1f')]?_[_0x52a8('0x20')](_0x23a028[_0x52a8('0x1b')][_0x52a8('0x1f')],function(_0x29374d){return{'model':db[_0x29374d[_0x52a8('0x21')]],'as':_0x29374d['as'],'attributes':_0x29374d[_0x52a8('0x1d')],'include':_0x29374d[_0x52a8('0x1f')]?_[_0x52a8('0x20')](_0x29374d[_0x52a8('0x1f')],function(_0x29b73f){return{'model':db[_0x29b73f[_0x52a8('0x21')]],'as':_0x29b73f['as'],'attributes':_0x29b73f['attributes'],'include':_0x29b73f[_0x52a8('0x1f')]?_['map'](_0x29b73f['include'],function(_0x178a7b){return{'model':db[_0x178a7b[_0x52a8('0x21')]],'as':_0x178a7b['as'],'attributes':_0x178a7b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b01d2){logger[_0x52a8('0xe')](_0x52a8('0x18'),_0x23a028);logger[_0x52a8('0x10')](_0x52a8('0x18'),_0x23a028,JSON[_0x52a8('0x12')](_0x5b01d2));_0x25f5c9(_0x5b01d2);})[_0x52a8('0x17')](function(_0x53c31b){logger[_0x52a8('0x13')](_0x52a8('0x18'),_0x53c31b[_0x52a8('0x15')],_0x23a028);_0x32af86(_0x55a9df['error'](0x1f4,_0x53c31b['message']));});});};exports[_0x52a8('0x22')]=function(_0x510140){var _0x26b028=this;return new Promise(function(_0x5a92c5,_0x34ac3d){return db['DeskAccount']['find']({'raw':_0x510140['options']?_0x510140[_0x52a8('0x1b')][_0x52a8('0x1c')]===undefined?!![]:![]:!![],'where':_0x510140['options']?_0x510140[_0x52a8('0x1b')][_0x52a8('0x23')]||null:null,'attributes':_0x510140[_0x52a8('0x1b')]?_0x510140[_0x52a8('0x1b')][_0x52a8('0x1d')]||null:null,'include':_0x510140[_0x52a8('0x1b')]?_0x510140['options']['include']?_['map'](_0x510140[_0x52a8('0x1b')][_0x52a8('0x1f')],function(_0x59b663){return{'model':db[_0x59b663[_0x52a8('0x21')]],'as':_0x59b663['as'],'attributes':_0x59b663[_0x52a8('0x1d')],'include':_0x59b663[_0x52a8('0x1f')]?_['map'](_0x59b663[_0x52a8('0x1f')],function(_0x923ef8){return{'model':db[_0x923ef8[_0x52a8('0x21')]],'as':_0x923ef8['as'],'attributes':_0x923ef8['attributes'],'include':_0x923ef8[_0x52a8('0x1f')]?_[_0x52a8('0x20')](_0x923ef8[_0x52a8('0x1f')],function(_0x13f22b){return{'model':db[_0x13f22b[_0x52a8('0x21')]],'as':_0x13f22b['as'],'attributes':_0x13f22b[_0x52a8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x52a8('0xd')](function(_0x1f97ca){logger['info'](_0x52a8('0x22'),_0x510140);logger['debug'](_0x52a8('0x22'),_0x510140,JSON[_0x52a8('0x12')](_0x1f97ca));_0x5a92c5(_0x1f97ca);})['catch'](function(_0xdda371){logger['error'](_0x52a8('0x22'),_0xdda371['message'],_0x510140);_0x34ac3d(_0x26b028[_0x52a8('0x13')](0x1f4,_0xdda371[_0x52a8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index c094b97..c20e827 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 _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x24ee4d,_0x346b64){var _0x305b6d=function(_0x548a93){while(--_0x548a93){_0x24ee4d['push'](_0x24ee4d['shift']());}};_0x305b6d(++_0x346b64);}(_0x34e8,0x12c));var _0x834e=function(_0x33de43,_0xc2de91){_0x33de43=_0x33de43-0x0;var _0x35d789=_0x34e8[_0x33de43];return _0x35d789;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x4a404f,_0x239620){var _0x21b50a=function(_0x505d60){while(--_0x505d60){_0x4a404f['push'](_0x4a404f['shift']());}};_0x21b50a(++_0x239620);}(_0x7217,0x19e));var _0x7721=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7217[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 431e09e..7cbdcb1 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 _0xf946=['sequelize','STRING'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0xf946,0x1b6));var _0x6f94=function(_0x4c9f76,_0x5e0403){_0x4c9f76=_0x4c9f76-0x0;var _0x551afe=_0xf946[_0x4c9f76];return _0x551afe;};'use strict';var Sequelize=require(_0x6f94('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f94('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb8e4=['sequelize','exports'];(function(_0x440fde,_0x445ce0){var _0x11052c=function(_0x49f547){while(--_0x49f547){_0x440fde['push'](_0x440fde['shift']());}};_0x11052c(++_0x445ce0);}(_0xb8e4,0x1c8));var _0x4b8e=function(_0x8ae91a,_0x43d70b){_0x8ae91a=_0x8ae91a-0x0;var _0x502e2e=_0xb8e4[_0x8ae91a];return _0x502e2e;};'use strict';var Sequelize=require(_0x4b8e('0x0'));module[_0x4b8e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 887fd44..1859649 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 _0x2d51=['params','length','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','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','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show'];(function(_0x3fa54d,_0x27170b){var _0x5680e7=function(_0x2d5813){while(--_0x2d5813){_0x3fa54d['push'](_0x3fa54d['shift']());}};_0x5680e7(++_0x27170b);}(_0x2d51,0x155));var _0x12d5=function(_0x34bbc0,_0x4e532d){_0x34bbc0=_0x34bbc0-0x0;var _0x412a0f=_0x2d51[_0x34bbc0];return _0x412a0f;};'use strict';var emlformat=require(_0x12d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12d5('0x1'));var jsonpatch=require(_0x12d5('0x2'));var rp=require(_0x12d5('0x3'));var moment=require(_0x12d5('0x4'));var BPromise=require(_0x12d5('0x5'));var Mustache=require(_0x12d5('0x6'));var util=require('util');var path=require(_0x12d5('0x7'));var sox=require(_0x12d5('0x8'));var csv=require(_0x12d5('0x9'));var ejs=require(_0x12d5('0xa'));var fs=require('fs');var fs_extra=require(_0x12d5('0xb'));var _=require(_0x12d5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x12d5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x12d5('0xe'));var Redis=require(_0x12d5('0xf'));var authService=require(_0x12d5('0x10'));var qs=require(_0x12d5('0x11'));var as=require(_0x12d5('0x12'));var hardwareService=require(_0x12d5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x12d5('0x14'));var config=require(_0x12d5('0x15'));var licenseUtil=require(_0x12d5('0x16'));var db=require(_0x12d5('0x17'))['db'];function respondWithStatusCode(_0x359048,_0x197522){_0x197522=_0x197522||0xcc;return function(_0x307376){if(_0x307376){return _0x359048[_0x12d5('0x18')](_0x197522);}return _0x359048[_0x12d5('0x19')](_0x197522)['end']();};}function respondWithResult(_0x4cc55e,_0x1015de){_0x1015de=_0x1015de||0xc8;return function(_0x30c644){if(_0x30c644){return _0x4cc55e['status'](_0x1015de)[_0x12d5('0x1a')](_0x30c644);}};}function respondWithFilteredResult(_0x5c75c9,_0x8d84a8){return function(_0x1d21e8){if(_0x1d21e8){var _0x2ea5c2=typeof _0x8d84a8['offset']===_0x12d5('0x1b')&&typeof _0x8d84a8[_0x12d5('0x1c')]===_0x12d5('0x1b');var _0x5f0ae8=_0x1d21e8[_0x12d5('0x1d')];var _0x10c402=_0x2ea5c2?0x0:_0x8d84a8[_0x12d5('0x1e')];var _0x3e265d=_0x2ea5c2?_0x1d21e8['count']:_0x8d84a8[_0x12d5('0x1e')]+_0x8d84a8[_0x12d5('0x1c')];var _0xd65916;if(_0x3e265d>=_0x5f0ae8){_0x3e265d=_0x5f0ae8;_0xd65916=0xc8;}else{_0xd65916=0xce;}_0x5c75c9[_0x12d5('0x19')](_0xd65916);return _0x5c75c9[_0x12d5('0x1f')](_0x12d5('0x20'),_0x10c402+'-'+_0x3e265d+'/'+_0x5f0ae8)['json'](_0x1d21e8);}return null;};}function patchUpdates(_0x3c266f){return function(_0x5f1c34){try{jsonpatch[_0x12d5('0x21')](_0x5f1c34,_0x3c266f,!![]);}catch(_0x3c31c3){return BPromise['reject'](_0x3c31c3);}return _0x5f1c34['save']();};}function saveUpdates(_0x560f3e,_0x8c01bd){return function(_0xb3e4ad){if(_0xb3e4ad){return _0xb3e4ad[_0x12d5('0x22')](_0x560f3e)[_0x12d5('0x23')](function(_0x2717c1){return _0x2717c1;});}return null;};}function removeEntity(_0x256587,_0x59a653){return function(_0xe01816){if(_0xe01816){return _0xe01816[_0x12d5('0x24')]()[_0x12d5('0x23')](function(){_0x256587['status'](0xcc)[_0x12d5('0x25')]();});}};}function handleEntityNotFound(_0x3a3a65,_0x391a70){return function(_0x2e4b36){if(!_0x2e4b36){_0x3a3a65[_0x12d5('0x18')](0x194);}return _0x2e4b36;};}function handleError(_0x4c27e4,_0x55134a){_0x55134a=_0x55134a||0x1f4;return function(_0x131618){logger[_0x12d5('0x26')](_0x131618['stack']);if(_0x131618['name']){delete _0x131618[_0x12d5('0x27')];}_0x4c27e4[_0x12d5('0x19')](_0x55134a)['send'](_0x131618);};}exports[_0x12d5('0x28')]=function(_0x52e2f7,_0x1827e0){var _0x2d1512={},_0x26e74f={},_0x32be61={'count':0x0,'rows':[]};var _0x200d03=_[_0x12d5('0x29')](db['DeskConfiguration'][_0x12d5('0x2a')],function(_0x1d6ab3){return{'name':_0x1d6ab3[_0x12d5('0x2b')],'type':_0x1d6ab3['type'][_0x12d5('0x2c')]};});_0x26e74f[_0x12d5('0x2d')]=_[_0x12d5('0x29')](_0x200d03,_0x12d5('0x27'));_0x26e74f['query']=_[_0x12d5('0x2e')](_0x52e2f7[_0x12d5('0x2f')]);_0x26e74f['filters']=_['intersection'](_0x26e74f['model'],_0x26e74f['query']);_0x2d1512['attributes']=_[_0x12d5('0x30')](_0x26e74f[_0x12d5('0x2d')],qs['fields'](_0x52e2f7[_0x12d5('0x2f')][_0x12d5('0x31')]));_0x2d1512[_0x12d5('0x32')]=_0x2d1512[_0x12d5('0x32')]['length']?_0x2d1512[_0x12d5('0x32')]:_0x26e74f[_0x12d5('0x2d')];if(!_0x52e2f7[_0x12d5('0x2f')][_0x12d5('0x33')](_0x12d5('0x34'))){_0x2d1512[_0x12d5('0x1c')]=qs[_0x12d5('0x1c')](_0x52e2f7['query']['limit']);_0x2d1512[_0x12d5('0x1e')]=qs[_0x12d5('0x1e')](_0x52e2f7['query'][_0x12d5('0x1e')]);}_0x2d1512[_0x12d5('0x35')]=qs[_0x12d5('0x36')](_0x52e2f7['query']['sort']);_0x2d1512[_0x12d5('0x37')]=qs[_0x12d5('0x38')](_[_0x12d5('0x39')](_0x52e2f7[_0x12d5('0x2f')],_0x26e74f[_0x12d5('0x38')]),_0x200d03);if(_0x52e2f7['query'][_0x12d5('0x3a')]){_0x2d1512['where']=_[_0x12d5('0x3b')](_0x2d1512[_0x12d5('0x37')],{'$or':_[_0x12d5('0x29')](_0x200d03,function(_0x1b774d){if(_0x1b774d[_0x12d5('0x3c')]!=='VIRTUAL'){var _0x21d979={};_0x21d979[_0x1b774d[_0x12d5('0x27')]]={'$like':'%'+_0x52e2f7['query']['filter']+'%'};return _0x21d979;}})});}_0x2d1512=_[_0x12d5('0x3b')]({},_0x2d1512,_0x52e2f7[_0x12d5('0x3d')]);var _0x49de5a={'where':_0x2d1512[_0x12d5('0x37')]};return db[_0x12d5('0x3e')][_0x12d5('0x1d')](_0x49de5a)[_0x12d5('0x23')](function(_0x4f5dfe){_0x32be61[_0x12d5('0x1d')]=_0x4f5dfe;if(_0x52e2f7[_0x12d5('0x2f')][_0x12d5('0x3f')]){_0x2d1512[_0x12d5('0x40')]=[{'all':!![]}];}return db[_0x12d5('0x3e')][_0x12d5('0x41')](_0x2d1512);})[_0x12d5('0x23')](function(_0x2d409d){_0x32be61[_0x12d5('0x42')]=_0x2d409d;return _0x32be61;})[_0x12d5('0x23')](respondWithFilteredResult(_0x1827e0,_0x2d1512))[_0x12d5('0x43')](handleError(_0x1827e0,null));};exports[_0x12d5('0x44')]=function(_0x4305d1,_0x991fad){var _0x12c673={'raw':![],'where':{'id':_0x4305d1[_0x12d5('0x45')]['id']}},_0x54c91c={};_0x54c91c[_0x12d5('0x2d')]=_[_0x12d5('0x2e')](db[_0x12d5('0x3e')]['rawAttributes']);_0x54c91c['query']=_[_0x12d5('0x2e')](_0x4305d1[_0x12d5('0x2f')]);_0x54c91c[_0x12d5('0x38')]=_['intersection'](_0x54c91c[_0x12d5('0x2d')],_0x54c91c[_0x12d5('0x2f')]);_0x12c673['attributes']=_[_0x12d5('0x30')](_0x54c91c[_0x12d5('0x2d')],qs[_0x12d5('0x31')](_0x4305d1[_0x12d5('0x2f')][_0x12d5('0x31')]));_0x12c673[_0x12d5('0x32')]=_0x12c673['attributes'][_0x12d5('0x46')]?_0x12c673[_0x12d5('0x32')]:_0x54c91c[_0x12d5('0x2d')];if(_0x4305d1[_0x12d5('0x2f')][_0x12d5('0x3f')]){_0x12c673[_0x12d5('0x40')]=[{'all':!![]}];}_0x12c673=_[_0x12d5('0x3b')]({},_0x12c673,_0x4305d1[_0x12d5('0x3d')]);return db[_0x12d5('0x3e')][_0x12d5('0x47')](_0x12c673)[_0x12d5('0x23')](handleEntityNotFound(_0x991fad,null))[_0x12d5('0x23')](respondWithResult(_0x991fad,null))[_0x12d5('0x43')](handleError(_0x991fad,null));};exports[_0x12d5('0x48')]=function(_0x1cb070,_0x571a66){return db[_0x12d5('0x3e')][_0x12d5('0x48')](_0x1cb070[_0x12d5('0x49')],{})['then'](respondWithResult(_0x571a66,0xc9))[_0x12d5('0x43')](handleError(_0x571a66,null));};exports['update']=function(_0x206d78,_0x57bb48){if(_0x206d78[_0x12d5('0x49')]['id']){delete _0x206d78[_0x12d5('0x49')]['id'];}return db[_0x12d5('0x3e')][_0x12d5('0x47')]({'where':{'id':_0x206d78[_0x12d5('0x45')]['id']}})['then'](handleEntityNotFound(_0x57bb48,null))[_0x12d5('0x23')](saveUpdates(_0x206d78[_0x12d5('0x49')],null))['then'](respondWithResult(_0x57bb48,null))['catch'](handleError(_0x57bb48,null));};exports[_0x12d5('0x24')]=function(_0x4f9897,_0x2471d3){return db[_0x12d5('0x3e')][_0x12d5('0x47')]({'where':{'id':_0x4f9897[_0x12d5('0x45')]['id']}})[_0x12d5('0x23')](handleEntityNotFound(_0x2471d3,null))[_0x12d5('0x23')](removeEntity(_0x2471d3,null))[_0x12d5('0x43')](handleError(_0x2471d3,null));};exports[_0x12d5('0x4a')]=function(_0x454228,_0x467f2d,_0x4f0b5c){var _0x1e9b87={};var _0x57d6da={};var _0x26ced7;var _0x480b79;return db[_0x12d5('0x3e')][_0x12d5('0x4b')]({'where':{'id':_0x454228[_0x12d5('0x45')]['id']}})[_0x12d5('0x23')](handleEntityNotFound(_0x467f2d,null))[_0x12d5('0x23')](function(_0x8cd370){if(_0x8cd370){_0x26ced7=_0x8cd370;_0x57d6da['model']=_[_0x12d5('0x2e')](db[_0x12d5('0x4c')][_0x12d5('0x2a')]);_0x57d6da['query']=_[_0x12d5('0x2e')](_0x454228[_0x12d5('0x2f')]);_0x57d6da['filters']=_[_0x12d5('0x30')](_0x57d6da[_0x12d5('0x2d')],_0x57d6da[_0x12d5('0x2f')]);_0x1e9b87[_0x12d5('0x32')]=_['intersection'](_0x57d6da[_0x12d5('0x2d')],qs['fields'](_0x454228[_0x12d5('0x2f')]['fields']));_0x1e9b87[_0x12d5('0x32')]=_0x1e9b87[_0x12d5('0x32')][_0x12d5('0x46')]?_0x1e9b87[_0x12d5('0x32')]:_0x57d6da['model'];_0x1e9b87['order']=qs[_0x12d5('0x36')](_0x454228[_0x12d5('0x2f')][_0x12d5('0x36')]);_0x1e9b87[_0x12d5('0x37')]=qs[_0x12d5('0x38')](_['pick'](_0x454228[_0x12d5('0x2f')],_0x57d6da[_0x12d5('0x38')]));if(_0x454228[_0x12d5('0x2f')]['filter']){_0x1e9b87[_0x12d5('0x37')]=_[_0x12d5('0x3b')](_0x1e9b87[_0x12d5('0x37')],{'$or':_[_0x12d5('0x29')](_0x1e9b87[_0x12d5('0x32')],function(_0xa6497a){var _0x1e7006={};_0x1e7006[_0xa6497a]={'$like':'%'+_0x454228[_0x12d5('0x2f')][_0x12d5('0x3a')]+'%'};return _0x1e7006;})});}_0x1e9b87=_['merge']({},_0x1e9b87,_0x454228['options']);return _0x26ced7['getFields'](_0x1e9b87);}})[_0x12d5('0x23')](function(_0x395706){if(_0x395706){_0x480b79=_0x395706[_0x12d5('0x46')];if(!_0x454228[_0x12d5('0x2f')][_0x12d5('0x33')](_0x12d5('0x34'))){_0x1e9b87[_0x12d5('0x1c')]=qs[_0x12d5('0x1c')](_0x454228[_0x12d5('0x2f')][_0x12d5('0x1c')]);_0x1e9b87[_0x12d5('0x1e')]=qs[_0x12d5('0x1e')](_0x454228[_0x12d5('0x2f')][_0x12d5('0x1e')]);}return _0x26ced7[_0x12d5('0x4a')](_0x1e9b87);}})[_0x12d5('0x23')](function(_0x5a0ea0){if(_0x5a0ea0){return _0x5a0ea0?{'count':_0x480b79,'rows':_0x5a0ea0}:null;}})[_0x12d5('0x23')](respondWithResult(_0x467f2d,null))['catch'](handleError(_0x467f2d,null));};exports[_0x12d5('0x4d')]=function(_0x373858,_0x1c72e4,_0x1ffaac){var _0x3b6ba8={};var _0x3ce81c={};var _0x17c8e1;var _0x1c1631;return db[_0x12d5('0x3e')][_0x12d5('0x4b')]({'where':{'id':_0x373858[_0x12d5('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c72e4,null))[_0x12d5('0x23')](function(_0x1ee3fe){if(_0x1ee3fe){_0x17c8e1=_0x1ee3fe;_0x3ce81c[_0x12d5('0x2d')]=_[_0x12d5('0x2e')](db[_0x12d5('0x4c')][_0x12d5('0x2a')]);_0x3ce81c[_0x12d5('0x2f')]=_[_0x12d5('0x2e')](_0x373858['query']);_0x3ce81c[_0x12d5('0x38')]=_['intersection'](_0x3ce81c[_0x12d5('0x2d')],_0x3ce81c['query']);_0x3b6ba8[_0x12d5('0x32')]=_['intersection'](_0x3ce81c[_0x12d5('0x2d')],qs['fields'](_0x373858[_0x12d5('0x2f')][_0x12d5('0x31')]));_0x3b6ba8[_0x12d5('0x32')]=_0x3b6ba8[_0x12d5('0x32')][_0x12d5('0x46')]?_0x3b6ba8['attributes']:_0x3ce81c[_0x12d5('0x2d')];_0x3b6ba8[_0x12d5('0x35')]=qs[_0x12d5('0x36')](_0x373858[_0x12d5('0x2f')][_0x12d5('0x36')]);_0x3b6ba8['where']=qs[_0x12d5('0x38')](_['pick'](_0x373858[_0x12d5('0x2f')],_0x3ce81c[_0x12d5('0x38')]));if(_0x373858['query'][_0x12d5('0x3a')]){_0x3b6ba8['where']=_[_0x12d5('0x3b')](_0x3b6ba8[_0x12d5('0x37')],{'$or':_[_0x12d5('0x29')](_0x3b6ba8[_0x12d5('0x32')],function(_0x361ceb){var _0x42782f={};_0x42782f[_0x361ceb]={'$like':'%'+_0x373858[_0x12d5('0x2f')][_0x12d5('0x3a')]+'%'};return _0x42782f;})});}_0x3b6ba8=_[_0x12d5('0x3b')]({},_0x3b6ba8,_0x373858[_0x12d5('0x3d')]);return _0x17c8e1[_0x12d5('0x4d')](_0x3b6ba8);}})[_0x12d5('0x23')](function(_0x30b780){if(_0x30b780){_0x1c1631=_0x30b780[_0x12d5('0x46')];if(!_0x373858[_0x12d5('0x2f')]['hasOwnProperty'](_0x12d5('0x34'))){_0x3b6ba8['limit']=qs[_0x12d5('0x1c')](_0x373858['query'][_0x12d5('0x1c')]);_0x3b6ba8['offset']=qs[_0x12d5('0x1e')](_0x373858[_0x12d5('0x2f')][_0x12d5('0x1e')]);}return _0x17c8e1['getSubjects'](_0x3b6ba8);}})[_0x12d5('0x23')](function(_0x179daa){if(_0x179daa){return _0x179daa?{'count':_0x1c1631,'rows':_0x179daa}:null;}})['then'](respondWithResult(_0x1c72e4,null))[_0x12d5('0x43')](handleError(_0x1c72e4,null));};exports[_0x12d5('0x4e')]=function(_0x4966cf,_0x1d8448,_0x419bb7){var _0x105118={};var _0x59fdf9={};var _0x206044;var _0x4aed94;return db[_0x12d5('0x3e')][_0x12d5('0x4b')]({'where':{'id':_0x4966cf[_0x12d5('0x45')]['id']}})[_0x12d5('0x23')](handleEntityNotFound(_0x1d8448,null))[_0x12d5('0x23')](function(_0x187481){if(_0x187481){_0x206044=_0x187481;_0x59fdf9[_0x12d5('0x2d')]=_[_0x12d5('0x2e')](db[_0x12d5('0x4c')][_0x12d5('0x2a')]);_0x59fdf9[_0x12d5('0x2f')]=_[_0x12d5('0x2e')](_0x4966cf['query']);_0x59fdf9[_0x12d5('0x38')]=_[_0x12d5('0x30')](_0x59fdf9[_0x12d5('0x2d')],_0x59fdf9[_0x12d5('0x2f')]);_0x105118['attributes']=_[_0x12d5('0x30')](_0x59fdf9['model'],qs['fields'](_0x4966cf[_0x12d5('0x2f')]['fields']));_0x105118[_0x12d5('0x32')]=_0x105118[_0x12d5('0x32')][_0x12d5('0x46')]?_0x105118[_0x12d5('0x32')]:_0x59fdf9[_0x12d5('0x2d')];_0x105118['order']=qs[_0x12d5('0x36')](_0x4966cf[_0x12d5('0x2f')][_0x12d5('0x36')]);_0x105118['where']=qs[_0x12d5('0x38')](_['pick'](_0x4966cf[_0x12d5('0x2f')],_0x59fdf9[_0x12d5('0x38')]));if(_0x4966cf['query']['filter']){_0x105118[_0x12d5('0x37')]=_['merge'](_0x105118[_0x12d5('0x37')],{'$or':_[_0x12d5('0x29')](_0x105118['attributes'],function(_0x5bb1e1){var _0x14cadf={};_0x14cadf[_0x5bb1e1]={'$like':'%'+_0x4966cf[_0x12d5('0x2f')][_0x12d5('0x3a')]+'%'};return _0x14cadf;})});}_0x105118=_[_0x12d5('0x3b')]({},_0x105118,_0x4966cf['options']);return _0x206044[_0x12d5('0x4e')](_0x105118);}})['then'](function(_0x12d1ea){if(_0x12d1ea){_0x4aed94=_0x12d1ea['length'];if(!_0x4966cf[_0x12d5('0x2f')][_0x12d5('0x33')](_0x12d5('0x34'))){_0x105118['limit']=qs['limit'](_0x4966cf[_0x12d5('0x2f')][_0x12d5('0x1c')]);_0x105118[_0x12d5('0x1e')]=qs[_0x12d5('0x1e')](_0x4966cf['query']['offset']);}return _0x206044[_0x12d5('0x4e')](_0x105118);}})[_0x12d5('0x23')](function(_0x20c74d){if(_0x20c74d){return _0x20c74d?{'count':_0x4aed94,'rows':_0x20c74d}:null;}})[_0x12d5('0x23')](respondWithResult(_0x1d8448,null))[_0x12d5('0x43')](handleError(_0x1d8448,null));};exports['getTags']=function(_0x54af47,_0x2b8261,_0x543ef8){var _0x180c97={};var _0x1d72f8={};var _0x63b55b;var _0x456ff5;return db[_0x12d5('0x3e')][_0x12d5('0x4b')]({'where':{'id':_0x54af47[_0x12d5('0x45')]['id']}})[_0x12d5('0x23')](handleEntityNotFound(_0x2b8261,null))[_0x12d5('0x23')](function(_0x49c499){if(_0x49c499){_0x63b55b=_0x49c499;_0x1d72f8['model']=_[_0x12d5('0x2e')](db[_0x12d5('0x4f')][_0x12d5('0x2a')]);_0x1d72f8['query']=_[_0x12d5('0x2e')](_0x54af47['query']);_0x1d72f8['filters']=_[_0x12d5('0x30')](_0x1d72f8[_0x12d5('0x2d')],_0x1d72f8[_0x12d5('0x2f')]);_0x180c97[_0x12d5('0x32')]=_['intersection'](_0x1d72f8[_0x12d5('0x2d')],qs[_0x12d5('0x31')](_0x54af47['query']['fields']));_0x180c97[_0x12d5('0x32')]=_0x180c97[_0x12d5('0x32')][_0x12d5('0x46')]?_0x180c97[_0x12d5('0x32')]:_0x1d72f8[_0x12d5('0x2d')];_0x180c97[_0x12d5('0x35')]=qs[_0x12d5('0x36')](_0x54af47[_0x12d5('0x2f')][_0x12d5('0x36')]);_0x180c97[_0x12d5('0x37')]=qs[_0x12d5('0x38')](_[_0x12d5('0x39')](_0x54af47['query'],_0x1d72f8[_0x12d5('0x38')]));if(_0x54af47[_0x12d5('0x2f')][_0x12d5('0x3a')]){_0x180c97[_0x12d5('0x37')]=_[_0x12d5('0x3b')](_0x180c97[_0x12d5('0x37')],{'$or':_[_0x12d5('0x29')](_0x180c97[_0x12d5('0x32')],function(_0x292f2e){var _0x1548ce={};_0x1548ce[_0x292f2e]={'$like':'%'+_0x54af47['query']['filter']+'%'};return _0x1548ce;})});}_0x180c97=_[_0x12d5('0x3b')]({},_0x180c97,_0x54af47[_0x12d5('0x3d')]);return _0x63b55b['getTags'](_0x180c97);}})['then'](function(_0x16973d){if(_0x16973d){_0x456ff5=_0x16973d[_0x12d5('0x46')];if(!_0x54af47[_0x12d5('0x2f')][_0x12d5('0x33')](_0x12d5('0x34'))){_0x180c97['limit']=qs[_0x12d5('0x1c')](_0x54af47[_0x12d5('0x2f')][_0x12d5('0x1c')]);_0x180c97[_0x12d5('0x1e')]=qs[_0x12d5('0x1e')](_0x54af47['query'][_0x12d5('0x1e')]);}return _0x63b55b[_0x12d5('0x50')](_0x180c97);}})[_0x12d5('0x23')](function(_0x213388){if(_0x213388){return _0x213388?{'count':_0x456ff5,'rows':_0x213388}:null;}})[_0x12d5('0x23')](respondWithResult(_0x2b8261,null))[_0x12d5('0x43')](handleError(_0x2b8261,null));};exports[_0x12d5('0x51')]=function(_0x368a6e,_0x5e4bcd,_0x4a096e){if(_0x368a6e[_0x12d5('0x49')]['id']){delete _0x368a6e[_0x12d5('0x49')]['id'];}return db[_0x12d5('0x3e')]['findOne']({'where':{'id':_0x368a6e[_0x12d5('0x45')]['id']}})[_0x12d5('0x23')](handleEntityNotFound(_0x5e4bcd,null))[_0x12d5('0x23')](function(_0x36ec3a){if(_0x36ec3a){return _0x36ec3a[_0x12d5('0x51')](_0x368a6e[_0x12d5('0x49')]['ids']||[]);}return null;})[_0x12d5('0x23')](respondWithResult(_0x5e4bcd,null))[_0x12d5('0x43')](handleError(_0x5e4bcd,null));}; \ No newline at end of file +var _0xb2f5=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','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','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields'];(function(_0x4cd614,_0x21a966){var _0x253d6d=function(_0x5f5d8c){while(--_0x5f5d8c){_0x4cd614['push'](_0x4cd614['shift']());}};_0x253d6d(++_0x21a966);}(_0xb2f5,0x118));var _0x5b2f=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xb2f5[_0x17b6e3];return _0x3906f3;};'use strict';var emlformat=require(_0x5b2f('0x0'));var rimraf=require(_0x5b2f('0x1'));var zipdir=require(_0x5b2f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b2f('0x3'));var moment=require(_0x5b2f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b2f('0x5'));var util=require(_0x5b2f('0x6'));var path=require('path');var sox=require(_0x5b2f('0x7'));var csv=require(_0x5b2f('0x8'));var ejs=require(_0x5b2f('0x9'));var fs=require('fs');var fs_extra=require(_0x5b2f('0xa'));var _=require(_0x5b2f('0xb'));var squel=require('squel');var crypto=require(_0x5b2f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5b2f('0x8'));var querystring=require(_0x5b2f('0xd'));var Papa=require('papaparse');var Redis=require(_0x5b2f('0xe'));var authService=require(_0x5b2f('0xf'));var qs=require(_0x5b2f('0x10'));var as=require(_0x5b2f('0x11'));var hardwareService=require(_0x5b2f('0x12'));var logger=require(_0x5b2f('0x13'))(_0x5b2f('0x14'));var utils=require(_0x5b2f('0x15'));var config=require(_0x5b2f('0x16'));var licenseUtil=require(_0x5b2f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4190b5,_0x113b0d){_0x113b0d=_0x113b0d||0xcc;return function(_0x2260f9){if(_0x2260f9){return _0x4190b5['sendStatus'](_0x113b0d);}return _0x4190b5[_0x5b2f('0x18')](_0x113b0d)[_0x5b2f('0x19')]();};}function respondWithResult(_0x14738f,_0xd5a7fd){_0xd5a7fd=_0xd5a7fd||0xc8;return function(_0x30c1dd){if(_0x30c1dd){return _0x14738f[_0x5b2f('0x18')](_0xd5a7fd)[_0x5b2f('0x1a')](_0x30c1dd);}};}function respondWithFilteredResult(_0x37cea2,_0x2121fe){return function(_0x7bf798){if(_0x7bf798){var _0x4a0648=typeof _0x2121fe['offset']===_0x5b2f('0x1b')&&typeof _0x2121fe[_0x5b2f('0x1c')]==='undefined';var _0x1314f9=_0x7bf798[_0x5b2f('0x1d')];var _0x1e0cf9=_0x4a0648?0x0:_0x2121fe['offset'];var _0x28f1cd=_0x4a0648?_0x7bf798[_0x5b2f('0x1d')]:_0x2121fe[_0x5b2f('0x1e')]+_0x2121fe[_0x5b2f('0x1c')];var _0x282954;if(_0x28f1cd>=_0x1314f9){_0x28f1cd=_0x1314f9;_0x282954=0xc8;}else{_0x282954=0xce;}_0x37cea2[_0x5b2f('0x18')](_0x282954);return _0x37cea2[_0x5b2f('0x1f')](_0x5b2f('0x20'),_0x1e0cf9+'-'+_0x28f1cd+'/'+_0x1314f9)[_0x5b2f('0x1a')](_0x7bf798);}return null;};}function patchUpdates(_0x46f4a7){return function(_0x1bd06d){try{jsonpatch[_0x5b2f('0x21')](_0x1bd06d,_0x46f4a7,!![]);}catch(_0x30501b){return BPromise[_0x5b2f('0x22')](_0x30501b);}return _0x1bd06d['save']();};}function saveUpdates(_0x21e1ce,_0x5075d6){return function(_0x53cd08){if(_0x53cd08){return _0x53cd08[_0x5b2f('0x23')](_0x21e1ce)['then'](function(_0x58a16c){return _0x58a16c;});}return null;};}function removeEntity(_0x5277d9,_0x514936){return function(_0x529581){if(_0x529581){return _0x529581['destroy']()[_0x5b2f('0x24')](function(){_0x5277d9[_0x5b2f('0x18')](0xcc)[_0x5b2f('0x19')]();});}};}function handleEntityNotFound(_0xc51c1a,_0x195fe8){return function(_0x4aac75){if(!_0x4aac75){_0xc51c1a['sendStatus'](0x194);}return _0x4aac75;};}function handleError(_0x4c4598,_0x309071){_0x309071=_0x309071||0x1f4;return function(_0x1d6ac8){logger['error'](_0x1d6ac8[_0x5b2f('0x25')]);if(_0x1d6ac8[_0x5b2f('0x26')]){delete _0x1d6ac8[_0x5b2f('0x26')];}_0x4c4598['status'](_0x309071)[_0x5b2f('0x27')](_0x1d6ac8);};}exports[_0x5b2f('0x28')]=function(_0x43f141,_0x561cfa){var _0x1be71a={},_0x366ce2={},_0x42ebe3={'count':0x0,'rows':[]};var _0x7c1085=_[_0x5b2f('0x29')](db[_0x5b2f('0x2a')][_0x5b2f('0x2b')],function(_0x47bca5){return{'name':_0x47bca5[_0x5b2f('0x2c')],'type':_0x47bca5[_0x5b2f('0x2d')][_0x5b2f('0x2e')]};});_0x366ce2[_0x5b2f('0x2f')]=_[_0x5b2f('0x29')](_0x7c1085,_0x5b2f('0x26'));_0x366ce2[_0x5b2f('0x30')]=_[_0x5b2f('0x31')](_0x43f141['query']);_0x366ce2['filters']=_[_0x5b2f('0x32')](_0x366ce2[_0x5b2f('0x2f')],_0x366ce2[_0x5b2f('0x30')]);_0x1be71a['attributes']=_[_0x5b2f('0x32')](_0x366ce2['model'],qs[_0x5b2f('0x33')](_0x43f141[_0x5b2f('0x30')][_0x5b2f('0x33')]));_0x1be71a[_0x5b2f('0x34')]=_0x1be71a[_0x5b2f('0x34')][_0x5b2f('0x35')]?_0x1be71a[_0x5b2f('0x34')]:_0x366ce2[_0x5b2f('0x2f')];if(!_0x43f141['query'][_0x5b2f('0x36')](_0x5b2f('0x37'))){_0x1be71a[_0x5b2f('0x1c')]=qs[_0x5b2f('0x1c')](_0x43f141[_0x5b2f('0x30')][_0x5b2f('0x1c')]);_0x1be71a['offset']=qs[_0x5b2f('0x1e')](_0x43f141[_0x5b2f('0x30')][_0x5b2f('0x1e')]);}_0x1be71a[_0x5b2f('0x38')]=qs[_0x5b2f('0x39')](_0x43f141[_0x5b2f('0x30')][_0x5b2f('0x39')]);_0x1be71a[_0x5b2f('0x3a')]=qs[_0x5b2f('0x3b')](_[_0x5b2f('0x3c')](_0x43f141[_0x5b2f('0x30')],_0x366ce2[_0x5b2f('0x3b')]),_0x7c1085);if(_0x43f141[_0x5b2f('0x30')][_0x5b2f('0x3d')]){_0x1be71a[_0x5b2f('0x3a')]=_[_0x5b2f('0x3e')](_0x1be71a[_0x5b2f('0x3a')],{'$or':_[_0x5b2f('0x29')](_0x7c1085,function(_0x25cbaa){if(_0x25cbaa['type']!==_0x5b2f('0x3f')){var _0x3ac07d={};_0x3ac07d[_0x25cbaa['name']]={'$like':'%'+_0x43f141['query'][_0x5b2f('0x3d')]+'%'};return _0x3ac07d;}})});}_0x1be71a=_[_0x5b2f('0x3e')]({},_0x1be71a,_0x43f141[_0x5b2f('0x40')]);var _0x44a1ba={'where':_0x1be71a[_0x5b2f('0x3a')]};return db[_0x5b2f('0x2a')][_0x5b2f('0x1d')](_0x44a1ba)['then'](function(_0xdf4668){_0x42ebe3[_0x5b2f('0x1d')]=_0xdf4668;if(_0x43f141[_0x5b2f('0x30')][_0x5b2f('0x41')]){_0x1be71a[_0x5b2f('0x42')]=[{'all':!![]}];}return db[_0x5b2f('0x2a')][_0x5b2f('0x43')](_0x1be71a);})[_0x5b2f('0x24')](function(_0x268845){_0x42ebe3['rows']=_0x268845;return _0x42ebe3;})['then'](respondWithFilteredResult(_0x561cfa,_0x1be71a))[_0x5b2f('0x44')](handleError(_0x561cfa,null));};exports[_0x5b2f('0x45')]=function(_0x362a39,_0x15cc34){var _0x3bfa07={'raw':![],'where':{'id':_0x362a39[_0x5b2f('0x46')]['id']}},_0x10d245={};_0x10d245[_0x5b2f('0x2f')]=_['keys'](db[_0x5b2f('0x2a')][_0x5b2f('0x2b')]);_0x10d245[_0x5b2f('0x30')]=_[_0x5b2f('0x31')](_0x362a39[_0x5b2f('0x30')]);_0x10d245[_0x5b2f('0x3b')]=_['intersection'](_0x10d245[_0x5b2f('0x2f')],_0x10d245[_0x5b2f('0x30')]);_0x3bfa07[_0x5b2f('0x34')]=_[_0x5b2f('0x32')](_0x10d245[_0x5b2f('0x2f')],qs[_0x5b2f('0x33')](_0x362a39[_0x5b2f('0x30')][_0x5b2f('0x33')]));_0x3bfa07[_0x5b2f('0x34')]=_0x3bfa07[_0x5b2f('0x34')][_0x5b2f('0x35')]?_0x3bfa07[_0x5b2f('0x34')]:_0x10d245[_0x5b2f('0x2f')];if(_0x362a39[_0x5b2f('0x30')]['includeAll']){_0x3bfa07[_0x5b2f('0x42')]=[{'all':!![]}];}_0x3bfa07=_[_0x5b2f('0x3e')]({},_0x3bfa07,_0x362a39[_0x5b2f('0x40')]);return db[_0x5b2f('0x2a')][_0x5b2f('0x47')](_0x3bfa07)[_0x5b2f('0x24')](handleEntityNotFound(_0x15cc34,null))['then'](respondWithResult(_0x15cc34,null))['catch'](handleError(_0x15cc34,null));};exports[_0x5b2f('0x48')]=function(_0x5cec61,_0x540703){return db['DeskConfiguration']['create'](_0x5cec61['body'],{})[_0x5b2f('0x24')](respondWithResult(_0x540703,0xc9))[_0x5b2f('0x44')](handleError(_0x540703,null));};exports[_0x5b2f('0x23')]=function(_0x237fe6,_0x32eba5){if(_0x237fe6[_0x5b2f('0x49')]['id']){delete _0x237fe6[_0x5b2f('0x49')]['id'];}return db['DeskConfiguration'][_0x5b2f('0x47')]({'where':{'id':_0x237fe6[_0x5b2f('0x46')]['id']}})[_0x5b2f('0x24')](handleEntityNotFound(_0x32eba5,null))[_0x5b2f('0x24')](saveUpdates(_0x237fe6['body'],null))[_0x5b2f('0x24')](respondWithResult(_0x32eba5,null))['catch'](handleError(_0x32eba5,null));};exports[_0x5b2f('0x4a')]=function(_0x1bb8e0,_0x39ed0f){return db[_0x5b2f('0x2a')]['find']({'where':{'id':_0x1bb8e0['params']['id']}})['then'](handleEntityNotFound(_0x39ed0f,null))[_0x5b2f('0x24')](removeEntity(_0x39ed0f,null))[_0x5b2f('0x44')](handleError(_0x39ed0f,null));};exports[_0x5b2f('0x4b')]=function(_0x12970d,_0x595a73,_0x3d9763){var _0x419174={};var _0x1aef04={};var _0xab0807;var _0x121c12;return db[_0x5b2f('0x2a')][_0x5b2f('0x4c')]({'where':{'id':_0x12970d[_0x5b2f('0x46')]['id']}})[_0x5b2f('0x24')](handleEntityNotFound(_0x595a73,null))[_0x5b2f('0x24')](function(_0x291fd3){if(_0x291fd3){_0xab0807=_0x291fd3;_0x1aef04[_0x5b2f('0x2f')]=_['keys'](db[_0x5b2f('0x4d')]['rawAttributes']);_0x1aef04[_0x5b2f('0x30')]=_['keys'](_0x12970d[_0x5b2f('0x30')]);_0x1aef04['filters']=_[_0x5b2f('0x32')](_0x1aef04[_0x5b2f('0x2f')],_0x1aef04['query']);_0x419174[_0x5b2f('0x34')]=_[_0x5b2f('0x32')](_0x1aef04['model'],qs[_0x5b2f('0x33')](_0x12970d[_0x5b2f('0x30')]['fields']));_0x419174[_0x5b2f('0x34')]=_0x419174['attributes']['length']?_0x419174['attributes']:_0x1aef04[_0x5b2f('0x2f')];_0x419174[_0x5b2f('0x38')]=qs[_0x5b2f('0x39')](_0x12970d[_0x5b2f('0x30')][_0x5b2f('0x39')]);_0x419174['where']=qs[_0x5b2f('0x3b')](_[_0x5b2f('0x3c')](_0x12970d[_0x5b2f('0x30')],_0x1aef04[_0x5b2f('0x3b')]));if(_0x12970d[_0x5b2f('0x30')][_0x5b2f('0x3d')]){_0x419174[_0x5b2f('0x3a')]=_[_0x5b2f('0x3e')](_0x419174[_0x5b2f('0x3a')],{'$or':_[_0x5b2f('0x29')](_0x419174['attributes'],function(_0x2436e2){var _0x5afdc1={};_0x5afdc1[_0x2436e2]={'$like':'%'+_0x12970d[_0x5b2f('0x30')][_0x5b2f('0x3d')]+'%'};return _0x5afdc1;})});}_0x419174=_[_0x5b2f('0x3e')]({},_0x419174,_0x12970d['options']);return _0xab0807[_0x5b2f('0x4b')](_0x419174);}})[_0x5b2f('0x24')](function(_0x9deeaf){if(_0x9deeaf){_0x121c12=_0x9deeaf[_0x5b2f('0x35')];if(!_0x12970d[_0x5b2f('0x30')][_0x5b2f('0x36')](_0x5b2f('0x37'))){_0x419174[_0x5b2f('0x1c')]=qs[_0x5b2f('0x1c')](_0x12970d['query'][_0x5b2f('0x1c')]);_0x419174[_0x5b2f('0x1e')]=qs[_0x5b2f('0x1e')](_0x12970d[_0x5b2f('0x30')]['offset']);}return _0xab0807[_0x5b2f('0x4b')](_0x419174);}})['then'](function(_0x19f5f5){if(_0x19f5f5){return _0x19f5f5?{'count':_0x121c12,'rows':_0x19f5f5}:null;}})[_0x5b2f('0x24')](respondWithResult(_0x595a73,null))['catch'](handleError(_0x595a73,null));};exports[_0x5b2f('0x4e')]=function(_0x23ed78,_0x51cff2,_0x62ce9b){var _0x1475e1={};var _0x57c69d={};var _0x5e1c4e;var _0x54f00c;return db[_0x5b2f('0x2a')][_0x5b2f('0x4c')]({'where':{'id':_0x23ed78['params']['id']}})['then'](handleEntityNotFound(_0x51cff2,null))['then'](function(_0x51e408){if(_0x51e408){_0x5e1c4e=_0x51e408;_0x57c69d[_0x5b2f('0x2f')]=_['keys'](db[_0x5b2f('0x4d')][_0x5b2f('0x2b')]);_0x57c69d[_0x5b2f('0x30')]=_[_0x5b2f('0x31')](_0x23ed78[_0x5b2f('0x30')]);_0x57c69d[_0x5b2f('0x3b')]=_[_0x5b2f('0x32')](_0x57c69d[_0x5b2f('0x2f')],_0x57c69d[_0x5b2f('0x30')]);_0x1475e1[_0x5b2f('0x34')]=_[_0x5b2f('0x32')](_0x57c69d[_0x5b2f('0x2f')],qs['fields'](_0x23ed78[_0x5b2f('0x30')][_0x5b2f('0x33')]));_0x1475e1[_0x5b2f('0x34')]=_0x1475e1[_0x5b2f('0x34')]['length']?_0x1475e1['attributes']:_0x57c69d[_0x5b2f('0x2f')];_0x1475e1[_0x5b2f('0x38')]=qs['sort'](_0x23ed78[_0x5b2f('0x30')][_0x5b2f('0x39')]);_0x1475e1[_0x5b2f('0x3a')]=qs[_0x5b2f('0x3b')](_[_0x5b2f('0x3c')](_0x23ed78['query'],_0x57c69d[_0x5b2f('0x3b')]));if(_0x23ed78['query'][_0x5b2f('0x3d')]){_0x1475e1[_0x5b2f('0x3a')]=_['merge'](_0x1475e1[_0x5b2f('0x3a')],{'$or':_[_0x5b2f('0x29')](_0x1475e1[_0x5b2f('0x34')],function(_0x47be1c){var _0x138f9d={};_0x138f9d[_0x47be1c]={'$like':'%'+_0x23ed78[_0x5b2f('0x30')][_0x5b2f('0x3d')]+'%'};return _0x138f9d;})});}_0x1475e1=_['merge']({},_0x1475e1,_0x23ed78[_0x5b2f('0x40')]);return _0x5e1c4e[_0x5b2f('0x4e')](_0x1475e1);}})[_0x5b2f('0x24')](function(_0xfca9f7){if(_0xfca9f7){_0x54f00c=_0xfca9f7[_0x5b2f('0x35')];if(!_0x23ed78[_0x5b2f('0x30')]['hasOwnProperty'](_0x5b2f('0x37'))){_0x1475e1[_0x5b2f('0x1c')]=qs[_0x5b2f('0x1c')](_0x23ed78[_0x5b2f('0x30')][_0x5b2f('0x1c')]);_0x1475e1['offset']=qs[_0x5b2f('0x1e')](_0x23ed78[_0x5b2f('0x30')][_0x5b2f('0x1e')]);}return _0x5e1c4e[_0x5b2f('0x4e')](_0x1475e1);}})[_0x5b2f('0x24')](function(_0x37a363){if(_0x37a363){return _0x37a363?{'count':_0x54f00c,'rows':_0x37a363}:null;}})[_0x5b2f('0x24')](respondWithResult(_0x51cff2,null))['catch'](handleError(_0x51cff2,null));};exports['getDescriptions']=function(_0xd0afcb,_0x52aa44,_0x2f9d82){var _0x195d47={};var _0x359cb6={};var _0x2c6985;var _0x275ed7;return db[_0x5b2f('0x2a')]['findOne']({'where':{'id':_0xd0afcb['params']['id']}})[_0x5b2f('0x24')](handleEntityNotFound(_0x52aa44,null))[_0x5b2f('0x24')](function(_0x55572f){if(_0x55572f){_0x2c6985=_0x55572f;_0x359cb6[_0x5b2f('0x2f')]=_['keys'](db['DeskField'][_0x5b2f('0x2b')]);_0x359cb6[_0x5b2f('0x30')]=_[_0x5b2f('0x31')](_0xd0afcb[_0x5b2f('0x30')]);_0x359cb6[_0x5b2f('0x3b')]=_[_0x5b2f('0x32')](_0x359cb6[_0x5b2f('0x2f')],_0x359cb6['query']);_0x195d47['attributes']=_[_0x5b2f('0x32')](_0x359cb6[_0x5b2f('0x2f')],qs[_0x5b2f('0x33')](_0xd0afcb['query'][_0x5b2f('0x33')]));_0x195d47[_0x5b2f('0x34')]=_0x195d47[_0x5b2f('0x34')][_0x5b2f('0x35')]?_0x195d47['attributes']:_0x359cb6[_0x5b2f('0x2f')];_0x195d47[_0x5b2f('0x38')]=qs[_0x5b2f('0x39')](_0xd0afcb[_0x5b2f('0x30')][_0x5b2f('0x39')]);_0x195d47[_0x5b2f('0x3a')]=qs[_0x5b2f('0x3b')](_['pick'](_0xd0afcb[_0x5b2f('0x30')],_0x359cb6[_0x5b2f('0x3b')]));if(_0xd0afcb[_0x5b2f('0x30')]['filter']){_0x195d47[_0x5b2f('0x3a')]=_[_0x5b2f('0x3e')](_0x195d47[_0x5b2f('0x3a')],{'$or':_[_0x5b2f('0x29')](_0x195d47[_0x5b2f('0x34')],function(_0x5c4d65){var _0x50c036={};_0x50c036[_0x5c4d65]={'$like':'%'+_0xd0afcb['query'][_0x5b2f('0x3d')]+'%'};return _0x50c036;})});}_0x195d47=_[_0x5b2f('0x3e')]({},_0x195d47,_0xd0afcb[_0x5b2f('0x40')]);return _0x2c6985[_0x5b2f('0x4f')](_0x195d47);}})[_0x5b2f('0x24')](function(_0x2c6572){if(_0x2c6572){_0x275ed7=_0x2c6572[_0x5b2f('0x35')];if(!_0xd0afcb[_0x5b2f('0x30')][_0x5b2f('0x36')](_0x5b2f('0x37'))){_0x195d47['limit']=qs[_0x5b2f('0x1c')](_0xd0afcb[_0x5b2f('0x30')]['limit']);_0x195d47['offset']=qs[_0x5b2f('0x1e')](_0xd0afcb[_0x5b2f('0x30')][_0x5b2f('0x1e')]);}return _0x2c6985['getDescriptions'](_0x195d47);}})[_0x5b2f('0x24')](function(_0x5bc12b){if(_0x5bc12b){return _0x5bc12b?{'count':_0x275ed7,'rows':_0x5bc12b}:null;}})[_0x5b2f('0x24')](respondWithResult(_0x52aa44,null))['catch'](handleError(_0x52aa44,null));};exports[_0x5b2f('0x50')]=function(_0x36ccc8,_0x9b84,_0x4aad9d){var _0x3e83a1={};var _0x27443a={};var _0x4d9ab2;var _0x148c51;return db['DeskConfiguration']['findOne']({'where':{'id':_0x36ccc8[_0x5b2f('0x46')]['id']}})[_0x5b2f('0x24')](handleEntityNotFound(_0x9b84,null))['then'](function(_0x40941e){if(_0x40941e){_0x4d9ab2=_0x40941e;_0x27443a[_0x5b2f('0x2f')]=_['keys'](db['Tag'][_0x5b2f('0x2b')]);_0x27443a[_0x5b2f('0x30')]=_[_0x5b2f('0x31')](_0x36ccc8[_0x5b2f('0x30')]);_0x27443a[_0x5b2f('0x3b')]=_['intersection'](_0x27443a[_0x5b2f('0x2f')],_0x27443a[_0x5b2f('0x30')]);_0x3e83a1[_0x5b2f('0x34')]=_[_0x5b2f('0x32')](_0x27443a[_0x5b2f('0x2f')],qs['fields'](_0x36ccc8['query']['fields']));_0x3e83a1['attributes']=_0x3e83a1[_0x5b2f('0x34')][_0x5b2f('0x35')]?_0x3e83a1[_0x5b2f('0x34')]:_0x27443a['model'];_0x3e83a1[_0x5b2f('0x38')]=qs[_0x5b2f('0x39')](_0x36ccc8[_0x5b2f('0x30')]['sort']);_0x3e83a1[_0x5b2f('0x3a')]=qs[_0x5b2f('0x3b')](_[_0x5b2f('0x3c')](_0x36ccc8[_0x5b2f('0x30')],_0x27443a[_0x5b2f('0x3b')]));if(_0x36ccc8[_0x5b2f('0x30')][_0x5b2f('0x3d')]){_0x3e83a1['where']=_[_0x5b2f('0x3e')](_0x3e83a1['where'],{'$or':_['map'](_0x3e83a1[_0x5b2f('0x34')],function(_0x25085f){var _0x48c773={};_0x48c773[_0x25085f]={'$like':'%'+_0x36ccc8[_0x5b2f('0x30')][_0x5b2f('0x3d')]+'%'};return _0x48c773;})});}_0x3e83a1=_['merge']({},_0x3e83a1,_0x36ccc8['options']);return _0x4d9ab2[_0x5b2f('0x50')](_0x3e83a1);}})[_0x5b2f('0x24')](function(_0x294048){if(_0x294048){_0x148c51=_0x294048[_0x5b2f('0x35')];if(!_0x36ccc8[_0x5b2f('0x30')][_0x5b2f('0x36')](_0x5b2f('0x37'))){_0x3e83a1[_0x5b2f('0x1c')]=qs[_0x5b2f('0x1c')](_0x36ccc8[_0x5b2f('0x30')]['limit']);_0x3e83a1['offset']=qs[_0x5b2f('0x1e')](_0x36ccc8[_0x5b2f('0x30')][_0x5b2f('0x1e')]);}return _0x4d9ab2['getTags'](_0x3e83a1);}})[_0x5b2f('0x24')](function(_0x27377d){if(_0x27377d){return _0x27377d?{'count':_0x148c51,'rows':_0x27377d}:null;}})[_0x5b2f('0x24')](respondWithResult(_0x9b84,null))['catch'](handleError(_0x9b84,null));};exports[_0x5b2f('0x51')]=function(_0xdfeec1,_0x267b08,_0xf02c8b){if(_0xdfeec1['body']['id']){delete _0xdfeec1[_0x5b2f('0x49')]['id'];}return db[_0x5b2f('0x2a')][_0x5b2f('0x4c')]({'where':{'id':_0xdfeec1[_0x5b2f('0x46')]['id']}})[_0x5b2f('0x24')](handleEntityNotFound(_0x267b08,null))[_0x5b2f('0x24')](function(_0x182584){if(_0x182584){return _0x182584[_0x5b2f('0x51')](_0xdfeec1[_0x5b2f('0x49')][_0x5b2f('0x52')]||[]);}return null;})[_0x5b2f('0x24')](respondWithResult(_0x267b08,null))[_0x5b2f('0x44')](handleError(_0x267b08,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 75617f8..481d071 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 _0xa436=['request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x34ac07,_0x380cf7){var _0x4bffd2=function(_0x5bdd1f){while(--_0x5bdd1f){_0x34ac07['push'](_0x34ac07['shift']());}};_0x4bffd2(++_0x380cf7);}(_0xa436,0xd8));var _0x6a43=function(_0x2a140a,_0x1f8ca1){_0x2a140a=_0x2a140a-0x0;var _0x1a5e1c=_0xa436[_0x2a140a];return _0x1a5e1c;};'use strict';var _=require('lodash');var util=require(_0x6a43('0x0'));var logger=require(_0x6a43('0x1'))(_0x6a43('0x2'));var moment=require(_0x6a43('0x3'));var BPromise=require(_0x6a43('0x4'));var rp=require(_0x6a43('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a43('0x6'));var config=require(_0x6a43('0x7'));var attributes=require(_0x6a43('0x8'));module[_0x6a43('0x9')]=function(_0x17e1e2,_0x56d4b4){return _0x17e1e2[_0x6a43('0xa')](_0x6a43('0xb'),attributes,{'tableName':_0x6a43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x176f=['int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x176f,0x97));var _0xf176=function(_0x5a0a09,_0x407c34){_0x5a0a09=_0x5a0a09-0x0;var _0x2a7e3e=_0x176f[_0x5a0a09];return _0x2a7e3e;};'use strict';var _=require(_0xf176('0x0'));var util=require(_0xf176('0x1'));var logger=require(_0xf176('0x2'))(_0xf176('0x3'));var moment=require(_0xf176('0x4'));var BPromise=require(_0xf176('0x5'));var rp=require(_0xf176('0x6'));var fs=require('fs');var path=require(_0xf176('0x7'));var rimraf=require(_0xf176('0x8'));var config=require(_0xf176('0x9'));var attributes=require(_0xf176('0xa'));module[_0xf176('0xb')]=function(_0x577df4,_0x52449a){return _0x577df4[_0xf176('0xc')](_0xf176('0xd'),attributes,{'tableName':_0xf176('0xe'),'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 82ee561..98f79d9 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 _0x34bd=['code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2ec593,_0x167967){var _0x1a9f9e=function(_0x20bad7){while(--_0x20bad7){_0x2ec593['push'](_0x2ec593['shift']());}};_0x1a9f9e(++_0x167967);}(_0x34bd,0x1d2));var _0xd34b=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0x34bd[_0x2e41e2];return _0x2844d6;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd34b('0x1'));var rs=require(_0xd34b('0x2'));var fs=require('fs');var Redis=require(_0xd34b('0x3'));var db=require(_0xd34b('0x4'))['db'];var utils=require(_0xd34b('0x5'));var logger=require(_0xd34b('0x6'))(_0xd34b('0x7'));var config=require('../../config/environment');var jayson=require(_0xd34b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56e3eb,_0x30d93b,_0x3654a5){return new BPromise(function(_0xf51a08,_0x25bce7){return client[_0xd34b('0x9')](_0x56e3eb,_0x3654a5)[_0xd34b('0xa')](function(_0x738328){logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,_0xd34b('0xd'));logger[_0xd34b('0xe')](_0xd34b('0xf'),_0x30d93b,'request\x20sent',JSON[_0xd34b('0x10')](_0x738328));if(_0x738328['error']){if(_0x738328[_0xd34b('0x11')][_0xd34b('0x12')]===0x1f4){logger[_0xd34b('0x11')](_0xd34b('0xc'),_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0x25bce7(_0x738328['error'][_0xd34b('0x13')]);}logger[_0xd34b('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0xf51a08(_0x738328[_0xd34b('0x11')]['message']);}else{logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,'request\x20sent');_0xf51a08(_0x738328[_0xd34b('0x14')]['message']);}})[_0xd34b('0x15')](function(_0x438b61){logger[_0xd34b('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x30d93b,_0x438b61);_0x25bce7(_0x438b61);});});} \ No newline at end of file +var _0x6659=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x155f4e,_0x555a4c){var _0x542e34=function(_0x59b79d){while(--_0x59b79d){_0x155f4e['push'](_0x155f4e['shift']());}};_0x542e34(++_0x555a4c);}(_0x6659,0x169));var _0x9665=function(_0x7c1a30,_0x3882b2){_0x7c1a30=_0x7c1a30-0x0;var _0x5ae84a=_0x6659[_0x7c1a30];return _0x5ae84a;};'use strict';var _=require(_0x9665('0x0'));var util=require(_0x9665('0x1'));var moment=require(_0x9665('0x2'));var BPromise=require(_0x9665('0x3'));var rs=require(_0x9665('0x4'));var fs=require('fs');var Redis=require(_0x9665('0x5'));var db=require(_0x9665('0x6'))['db'];var utils=require(_0x9665('0x7'));var logger=require('../../config/logger')(_0x9665('0x8'));var config=require(_0x9665('0x9'));var jayson=require(_0x9665('0xa'));var client=jayson[_0x9665('0xb')][_0x9665('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b36f8,_0x585ec6,_0x2404b1){return new BPromise(function(_0xe9d4ff,_0x1738a5){return client[_0x9665('0xd')](_0x3b36f8,_0x2404b1)[_0x9665('0xe')](function(_0x439736){logger[_0x9665('0xf')](_0x9665('0x10'),_0x585ec6,_0x9665('0x11'));logger[_0x9665('0x12')](_0x9665('0x13'),_0x585ec6,_0x9665('0x11'),JSON['stringify'](_0x439736));if(_0x439736[_0x9665('0x14')]){if(_0x439736['error'][_0x9665('0x15')]===0x1f4){logger[_0x9665('0x14')](_0x9665('0x10'),_0x585ec6,_0x439736[_0x9665('0x14')]['message']);return _0x1738a5(_0x439736[_0x9665('0x14')][_0x9665('0x16')]);}logger[_0x9665('0x14')](_0x9665('0x10'),_0x585ec6,_0x439736[_0x9665('0x14')][_0x9665('0x16')]);return _0xe9d4ff(_0x439736[_0x9665('0x14')]['message']);}else{logger[_0x9665('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x585ec6,_0x9665('0x11'));_0xe9d4ff(_0x439736['result']['message']);}})[_0x9665('0x17')](function(_0x51c83f){logger['error'](_0x9665('0x10'),_0x585ec6,_0x51c83f);_0x1738a5(_0x51c83f);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 491276b..792580e 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 _0xf643=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf643,0x122));var _0x3f64=function(_0x19d7e1,_0x4329dd){_0x19d7e1=_0x19d7e1-0x0;var _0x3e475a=_0xf643[_0x19d7e1];return _0x3e475a;};'use strict';var multer=require(_0x3f64('0x0'));var util=require(_0x3f64('0x1'));var path=require(_0x3f64('0x2'));var timeout=require(_0x3f64('0x3'));var express=require('express');var router=express[_0x3f64('0x4')]();var fs_extra=require(_0x3f64('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3f64('0x6'));var config=require(_0x3f64('0x7'));var controller=require(_0x3f64('0x8'));router[_0x3f64('0x9')]('/',auth[_0x3f64('0xa')](),controller[_0x3f64('0xb')]);router[_0x3f64('0x9')](_0x3f64('0xc'),auth[_0x3f64('0xa')](),controller[_0x3f64('0xd')]);router[_0x3f64('0xe')]('/',auth[_0x3f64('0xa')](),controller[_0x3f64('0xf')]);router[_0x3f64('0x10')](_0x3f64('0xc'),auth['isAuthenticated'](),controller[_0x3f64('0x11')]);router[_0x3f64('0x12')](_0x3f64('0xc'),auth['isAuthenticated'](),controller[_0x3f64('0x13')]);module[_0x3f64('0x14')]=router; \ No newline at end of file +var _0xd4bd=['../../config/environment','./intDeskField.controller','isAuthenticated','index','/:id','show','create','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x226f6a,_0x1c341b){var _0x7cdc1b=function(_0x3a9f9b){while(--_0x3a9f9b){_0x226f6a['push'](_0x226f6a['shift']());}};_0x7cdc1b(++_0x1c341b);}(_0xd4bd,0x19d));var _0xdd4b=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0xd4bd[_0x5bd4f6];return _0x33a165;};'use strict';var multer=require(_0xdd4b('0x0'));var util=require('util');var path=require(_0xdd4b('0x1'));var timeout=require(_0xdd4b('0x2'));var express=require(_0xdd4b('0x3'));var router=express['Router']();var fs_extra=require(_0xdd4b('0x4'));var auth=require(_0xdd4b('0x5'));var interaction=require(_0xdd4b('0x6'));var config=require(_0xdd4b('0x7'));var controller=require(_0xdd4b('0x8'));router['get']('/',auth[_0xdd4b('0x9')](),controller[_0xdd4b('0xa')]);router['get'](_0xdd4b('0xb'),auth['isAuthenticated'](),controller[_0xdd4b('0xc')]);router['post']('/',auth[_0xdd4b('0x9')](),controller[_0xdd4b('0xd')]);router['put'](_0xdd4b('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdd4b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xdd4b('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index fb24061..3b63e73 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 _0x4f29=['picklist','STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x5cfe6b,_0x3d6c0d){var _0x2b49f8=function(_0x322e95){while(--_0x322e95){_0x5cfe6b['push'](_0x5cfe6b['shift']());}};_0x2b49f8(++_0x3d6c0d);}(_0x4f29,0xb0));var _0x94f2=function(_0x19c799,_0x4cf62b){_0x19c799=_0x19c799-0x0;var _0x634575=_0x4f29[_0x19c799];return _0x634575;};'use strict';var Sequelize=require(_0x94f2('0x0'));module[_0x94f2('0x1')]={'type':{'type':Sequelize[_0x94f2('0x2')](_0x94f2('0x3'),'variable','customVariable','keyValue',_0x94f2('0x4')),'defaultValue':_0x94f2('0x3')},'content':{'type':Sequelize[_0x94f2('0x5')]},'key':{'type':Sequelize[_0x94f2('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x94f2('0x3'),_0x94f2('0x6'),_0x94f2('0x7'))},'keyContent':{'type':Sequelize[_0x94f2('0x5')]},'idField':{'type':Sequelize[_0x94f2('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x94f2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x94f2('0x5')]}}; \ No newline at end of file +var _0xfd58=['exports','ENUM','string','keyValue','picklist','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x16abf0,_0x8b4a22){var _0x1489dc=function(_0x338ad6){while(--_0x338ad6){_0x16abf0['push'](_0x16abf0['shift']());}};_0x1489dc(++_0x8b4a22);}(_0xfd58,0x12b));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x8fd5('0x0'));module[_0x8fd5('0x1')]={'type':{'type':Sequelize[_0x8fd5('0x2')](_0x8fd5('0x3'),'variable','customVariable',_0x8fd5('0x4'),_0x8fd5('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8fd5('0x6')]},'keyType':{'type':Sequelize[_0x8fd5('0x2')]('string',_0x8fd5('0x7'),_0x8fd5('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8fd5('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8fd5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8fd5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index e00165e..adf05d9 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 _0x5398=['include','catch','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll'];(function(_0x3bf3f1,_0x5b8238){var _0x5a0c0c=function(_0x303fac){while(--_0x303fac){_0x3bf3f1['push'](_0x3bf3f1['shift']());}};_0x5a0c0c(++_0x5b8238);}(_0x5398,0xe2));var _0x8539=function(_0x1a7706,_0x313413){_0x1a7706=_0x1a7706-0x0;var _0x4b0039=_0x5398[_0x1a7706];return _0x4b0039;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8539('0x0'));var zipdir=require(_0x8539('0x1'));var jsonpatch=require(_0x8539('0x2'));var rp=require(_0x8539('0x3'));var moment=require(_0x8539('0x4'));var BPromise=require(_0x8539('0x5'));var Mustache=require(_0x8539('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8539('0x7'));var csv=require(_0x8539('0x8'));var ejs=require(_0x8539('0x9'));var fs=require('fs');var fs_extra=require(_0x8539('0xa'));var _=require(_0x8539('0xb'));var squel=require(_0x8539('0xc'));var crypto=require('crypto');var jsforce=require(_0x8539('0xd'));var deskjs=require(_0x8539('0xe'));var toCsv=require(_0x8539('0x8'));var querystring=require(_0x8539('0xf'));var Papa=require(_0x8539('0x10'));var Redis=require(_0x8539('0x11'));var authService=require(_0x8539('0x12'));var qs=require(_0x8539('0x13'));var as=require(_0x8539('0x14'));var hardwareService=require(_0x8539('0x15'));var logger=require('../../config/logger')(_0x8539('0x16'));var utils=require(_0x8539('0x17'));var config=require(_0x8539('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8539('0x19'))['db'];function respondWithStatusCode(_0x377b14,_0x4d841){_0x4d841=_0x4d841||0xcc;return function(_0x25462b){if(_0x25462b){return _0x377b14['sendStatus'](_0x4d841);}return _0x377b14['status'](_0x4d841)[_0x8539('0x1a')]();};}function respondWithResult(_0x19ec7e,_0x8d56c9){_0x8d56c9=_0x8d56c9||0xc8;return function(_0x216bce){if(_0x216bce){return _0x19ec7e[_0x8539('0x1b')](_0x8d56c9)['json'](_0x216bce);}};}function respondWithFilteredResult(_0x52b95b,_0x27e479){return function(_0x24aab1){if(_0x24aab1){var _0x334def=typeof _0x27e479[_0x8539('0x1c')]===_0x8539('0x1d')&&typeof _0x27e479[_0x8539('0x1e')]===_0x8539('0x1d');var _0x5c2b6a=_0x24aab1[_0x8539('0x1f')];var _0x5f597d=_0x334def?0x0:_0x27e479['offset'];var _0x5883f6=_0x334def?_0x24aab1[_0x8539('0x1f')]:_0x27e479[_0x8539('0x1c')]+_0x27e479[_0x8539('0x1e')];var _0x260a2c;if(_0x5883f6>=_0x5c2b6a){_0x5883f6=_0x5c2b6a;_0x260a2c=0xc8;}else{_0x260a2c=0xce;}_0x52b95b[_0x8539('0x1b')](_0x260a2c);return _0x52b95b[_0x8539('0x20')](_0x8539('0x21'),_0x5f597d+'-'+_0x5883f6+'/'+_0x5c2b6a)[_0x8539('0x22')](_0x24aab1);}return null;};}function patchUpdates(_0x1cce5a){return function(_0x3360b1){try{jsonpatch['apply'](_0x3360b1,_0x1cce5a,!![]);}catch(_0x400b36){return BPromise['reject'](_0x400b36);}return _0x3360b1[_0x8539('0x23')]();};}function saveUpdates(_0x56e1b7,_0x14befc){return function(_0x59a14e){if(_0x59a14e){return _0x59a14e[_0x8539('0x24')](_0x56e1b7)[_0x8539('0x25')](function(_0xa3cf26){return _0xa3cf26;});}return null;};}function removeEntity(_0xb91efd,_0x28e1da){return function(_0x3a0711){if(_0x3a0711){return _0x3a0711[_0x8539('0x26')]()['then'](function(){_0xb91efd[_0x8539('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x527fce,_0x27b80c){return function(_0x28792d){if(!_0x28792d){_0x527fce[_0x8539('0x27')](0x194);}return _0x28792d;};}function handleError(_0x20d902,_0x567c20){_0x567c20=_0x567c20||0x1f4;return function(_0x4f04e8){logger[_0x8539('0x28')](_0x4f04e8[_0x8539('0x29')]);if(_0x4f04e8['name']){delete _0x4f04e8[_0x8539('0x2a')];}_0x20d902[_0x8539('0x1b')](_0x567c20)[_0x8539('0x2b')](_0x4f04e8);};}exports[_0x8539('0x2c')]=function(_0x4585ff,_0x11982f){var _0x452700={},_0x60346c={},_0x2a6fba={'count':0x0,'rows':[]};var _0xedb079=_[_0x8539('0x2d')](db[_0x8539('0x2e')][_0x8539('0x2f')],function(_0x437cd9){return{'name':_0x437cd9['fieldName'],'type':_0x437cd9[_0x8539('0x30')][_0x8539('0x31')]};});_0x60346c[_0x8539('0x32')]=_['map'](_0xedb079,_0x8539('0x2a'));_0x60346c[_0x8539('0x33')]=_['keys'](_0x4585ff[_0x8539('0x33')]);_0x60346c['filters']=_[_0x8539('0x34')](_0x60346c[_0x8539('0x32')],_0x60346c[_0x8539('0x33')]);_0x452700[_0x8539('0x35')]=_[_0x8539('0x34')](_0x60346c[_0x8539('0x32')],qs[_0x8539('0x36')](_0x4585ff[_0x8539('0x33')][_0x8539('0x36')]));_0x452700['attributes']=_0x452700[_0x8539('0x35')][_0x8539('0x37')]?_0x452700[_0x8539('0x35')]:_0x60346c[_0x8539('0x32')];if(!_0x4585ff[_0x8539('0x33')][_0x8539('0x38')](_0x8539('0x39'))){_0x452700[_0x8539('0x1e')]=qs[_0x8539('0x1e')](_0x4585ff[_0x8539('0x33')]['limit']);_0x452700[_0x8539('0x1c')]=qs['offset'](_0x4585ff[_0x8539('0x33')][_0x8539('0x1c')]);}_0x452700['order']=qs['sort'](_0x4585ff[_0x8539('0x33')][_0x8539('0x3a')]);_0x452700[_0x8539('0x3b')]=qs[_0x8539('0x3c')](_['pick'](_0x4585ff['query'],_0x60346c['filters']),_0xedb079);if(_0x4585ff[_0x8539('0x33')][_0x8539('0x3d')]){_0x452700[_0x8539('0x3b')]=_[_0x8539('0x3e')](_0x452700[_0x8539('0x3b')],{'$or':_[_0x8539('0x2d')](_0xedb079,function(_0x1ecef0){if(_0x1ecef0[_0x8539('0x30')]!==_0x8539('0x3f')){var _0x30a58b={};_0x30a58b[_0x1ecef0[_0x8539('0x2a')]]={'$like':'%'+_0x4585ff[_0x8539('0x33')][_0x8539('0x3d')]+'%'};return _0x30a58b;}})});}_0x452700=_['merge']({},_0x452700,_0x4585ff[_0x8539('0x40')]);var _0x25e711={'where':_0x452700[_0x8539('0x3b')]};return db[_0x8539('0x2e')][_0x8539('0x1f')](_0x25e711)[_0x8539('0x25')](function(_0x2425a2){_0x2a6fba[_0x8539('0x1f')]=_0x2425a2;if(_0x4585ff[_0x8539('0x33')][_0x8539('0x41')]){_0x452700[_0x8539('0x42')]=[{'all':!![]}];}return db[_0x8539('0x2e')]['findAll'](_0x452700);})[_0x8539('0x25')](function(_0x1a4a24){_0x2a6fba['rows']=_0x1a4a24;return _0x2a6fba;})['then'](respondWithFilteredResult(_0x11982f,_0x452700))[_0x8539('0x43')](handleError(_0x11982f,null));};exports['show']=function(_0x51af6a,_0x525514){var _0x3c9f47={'raw':!![],'where':{'id':_0x51af6a[_0x8539('0x44')]['id']}},_0x3a69cc={};_0x3a69cc[_0x8539('0x32')]=_[_0x8539('0x45')](db['DeskField'][_0x8539('0x2f')]);_0x3a69cc['query']=_[_0x8539('0x45')](_0x51af6a[_0x8539('0x33')]);_0x3a69cc[_0x8539('0x3c')]=_[_0x8539('0x34')](_0x3a69cc['model'],_0x3a69cc[_0x8539('0x33')]);_0x3c9f47[_0x8539('0x35')]=_[_0x8539('0x34')](_0x3a69cc[_0x8539('0x32')],qs[_0x8539('0x36')](_0x51af6a[_0x8539('0x33')][_0x8539('0x36')]));_0x3c9f47['attributes']=_0x3c9f47['attributes'][_0x8539('0x37')]?_0x3c9f47[_0x8539('0x35')]:_0x3a69cc[_0x8539('0x32')];if(_0x51af6a[_0x8539('0x33')][_0x8539('0x41')]){_0x3c9f47['include']=[{'all':!![]}];}_0x3c9f47=_[_0x8539('0x3e')]({},_0x3c9f47,_0x51af6a['options']);return db[_0x8539('0x2e')][_0x8539('0x46')](_0x3c9f47)[_0x8539('0x25')](handleEntityNotFound(_0x525514,null))['then'](respondWithResult(_0x525514,null))[_0x8539('0x43')](handleError(_0x525514,null));};exports['create']=function(_0x2c030c,_0x30d5df){return db[_0x8539('0x2e')][_0x8539('0x47')](_0x2c030c[_0x8539('0x48')],{})[_0x8539('0x25')](respondWithResult(_0x30d5df,0xc9))[_0x8539('0x43')](handleError(_0x30d5df,null));};exports[_0x8539('0x24')]=function(_0x5a81be,_0x2d11b8){if(_0x5a81be[_0x8539('0x48')]['id']){delete _0x5a81be['body']['id'];}return db[_0x8539('0x2e')][_0x8539('0x46')]({'where':{'id':_0x5a81be[_0x8539('0x44')]['id']}})[_0x8539('0x25')](handleEntityNotFound(_0x2d11b8,null))[_0x8539('0x25')](saveUpdates(_0x5a81be['body'],null))[_0x8539('0x25')](respondWithResult(_0x2d11b8,null))[_0x8539('0x43')](handleError(_0x2d11b8,null));};exports['destroy']=function(_0x18712b,_0xc1bf9c){return db[_0x8539('0x2e')][_0x8539('0x46')]({'where':{'id':_0x18712b[_0x8539('0x44')]['id']}})[_0x8539('0x25')](handleEntityNotFound(_0xc1bf9c,null))[_0x8539('0x25')](removeEntity(_0xc1bf9c,null))[_0x8539('0x43')](handleError(_0xc1bf9c,null));}; \ No newline at end of file +var _0x96fd=['map','DeskField','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','then','rows','show','params','length','include','find','catch','create','body','destroy','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','sendStatus','error','stack','name','send','index'];(function(_0x66f468,_0x3039cb){var _0x524b64=function(_0xc5ae0c){while(--_0xc5ae0c){_0x66f468['push'](_0x66f468['shift']());}};_0x524b64(++_0x3039cb);}(_0x96fd,0x1e9));var _0xd96f=function(_0x5ba391,_0x9a6ea2){_0x5ba391=_0x5ba391-0x0;var _0x8434ad=_0x96fd[_0x5ba391];return _0x8434ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd96f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd96f('0x1'));var rp=require(_0xd96f('0x2'));var moment=require('moment');var BPromise=require(_0xd96f('0x3'));var Mustache=require(_0xd96f('0x4'));var util=require(_0xd96f('0x5'));var path=require(_0xd96f('0x6'));var sox=require('sox');var csv=require(_0xd96f('0x7'));var ejs=require(_0xd96f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd96f('0x9'));var squel=require(_0xd96f('0xa'));var crypto=require(_0xd96f('0xb'));var jsforce=require(_0xd96f('0xc'));var deskjs=require(_0xd96f('0xd'));var toCsv=require(_0xd96f('0x7'));var querystring=require(_0xd96f('0xe'));var Papa=require(_0xd96f('0xf'));var Redis=require(_0xd96f('0x10'));var authService=require(_0xd96f('0x11'));var qs=require(_0xd96f('0x12'));var as=require(_0xd96f('0x13'));var hardwareService=require(_0xd96f('0x14'));var logger=require(_0xd96f('0x15'))(_0xd96f('0x16'));var utils=require(_0xd96f('0x17'));var config=require(_0xd96f('0x18'));var licenseUtil=require(_0xd96f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x492ec6,_0x94d2a3){_0x94d2a3=_0x94d2a3||0xcc;return function(_0x1624a9){if(_0x1624a9){return _0x492ec6['sendStatus'](_0x94d2a3);}return _0x492ec6['status'](_0x94d2a3)[_0xd96f('0x1a')]();};}function respondWithResult(_0x21e481,_0xbbff79){_0xbbff79=_0xbbff79||0xc8;return function(_0x46332d){if(_0x46332d){return _0x21e481[_0xd96f('0x1b')](_0xbbff79)[_0xd96f('0x1c')](_0x46332d);}};}function respondWithFilteredResult(_0x1b33c8,_0x2533ec){return function(_0x2e6e2c){if(_0x2e6e2c){var _0x28884d=typeof _0x2533ec['offset']===_0xd96f('0x1d')&&typeof _0x2533ec[_0xd96f('0x1e')]==='undefined';var _0x19b141=_0x2e6e2c[_0xd96f('0x1f')];var _0x45c990=_0x28884d?0x0:_0x2533ec[_0xd96f('0x20')];var _0x7663e3=_0x28884d?_0x2e6e2c[_0xd96f('0x1f')]:_0x2533ec['offset']+_0x2533ec[_0xd96f('0x1e')];var _0x392733;if(_0x7663e3>=_0x19b141){_0x7663e3=_0x19b141;_0x392733=0xc8;}else{_0x392733=0xce;}_0x1b33c8[_0xd96f('0x1b')](_0x392733);return _0x1b33c8['set'](_0xd96f('0x21'),_0x45c990+'-'+_0x7663e3+'/'+_0x19b141)[_0xd96f('0x1c')](_0x2e6e2c);}return null;};}function patchUpdates(_0x16f4af){return function(_0x13e975){try{jsonpatch[_0xd96f('0x22')](_0x13e975,_0x16f4af,!![]);}catch(_0x422e34){return BPromise[_0xd96f('0x23')](_0x422e34);}return _0x13e975['save']();};}function saveUpdates(_0x1897ce,_0x224f72){return function(_0x4de2ef){if(_0x4de2ef){return _0x4de2ef[_0xd96f('0x24')](_0x1897ce)['then'](function(_0x39e7b2){return _0x39e7b2;});}return null;};}function removeEntity(_0x57b82a,_0x5ade3f){return function(_0x33a00c){if(_0x33a00c){return _0x33a00c['destroy']()['then'](function(){_0x57b82a[_0xd96f('0x1b')](0xcc)[_0xd96f('0x1a')]();});}};}function handleEntityNotFound(_0x1b4b26,_0x1a232d){return function(_0xd4cfa){if(!_0xd4cfa){_0x1b4b26[_0xd96f('0x25')](0x194);}return _0xd4cfa;};}function handleError(_0x5f07db,_0x1d6996){_0x1d6996=_0x1d6996||0x1f4;return function(_0x24d81a){logger[_0xd96f('0x26')](_0x24d81a[_0xd96f('0x27')]);if(_0x24d81a[_0xd96f('0x28')]){delete _0x24d81a[_0xd96f('0x28')];}_0x5f07db[_0xd96f('0x1b')](_0x1d6996)[_0xd96f('0x29')](_0x24d81a);};}exports[_0xd96f('0x2a')]=function(_0x428961,_0x2b3b7c){var _0x286caf={},_0x1e2ade={},_0x1d76cc={'count':0x0,'rows':[]};var _0x42487d=_[_0xd96f('0x2b')](db[_0xd96f('0x2c')][_0xd96f('0x2d')],function(_0x22ef06){return{'name':_0x22ef06[_0xd96f('0x2e')],'type':_0x22ef06['type'][_0xd96f('0x2f')]};});_0x1e2ade[_0xd96f('0x30')]=_[_0xd96f('0x2b')](_0x42487d,'name');_0x1e2ade[_0xd96f('0x31')]=_[_0xd96f('0x32')](_0x428961[_0xd96f('0x31')]);_0x1e2ade['filters']=_[_0xd96f('0x33')](_0x1e2ade['model'],_0x1e2ade[_0xd96f('0x31')]);_0x286caf['attributes']=_[_0xd96f('0x33')](_0x1e2ade[_0xd96f('0x30')],qs[_0xd96f('0x34')](_0x428961[_0xd96f('0x31')][_0xd96f('0x34')]));_0x286caf[_0xd96f('0x35')]=_0x286caf[_0xd96f('0x35')]['length']?_0x286caf['attributes']:_0x1e2ade[_0xd96f('0x30')];if(!_0x428961['query']['hasOwnProperty']('nolimit')){_0x286caf[_0xd96f('0x1e')]=qs[_0xd96f('0x1e')](_0x428961[_0xd96f('0x31')][_0xd96f('0x1e')]);_0x286caf['offset']=qs[_0xd96f('0x20')](_0x428961[_0xd96f('0x31')][_0xd96f('0x20')]);}_0x286caf[_0xd96f('0x36')]=qs[_0xd96f('0x37')](_0x428961[_0xd96f('0x31')][_0xd96f('0x37')]);_0x286caf[_0xd96f('0x38')]=qs[_0xd96f('0x39')](_[_0xd96f('0x3a')](_0x428961[_0xd96f('0x31')],_0x1e2ade[_0xd96f('0x39')]),_0x42487d);if(_0x428961['query'][_0xd96f('0x3b')]){_0x286caf[_0xd96f('0x38')]=_[_0xd96f('0x3c')](_0x286caf[_0xd96f('0x38')],{'$or':_['map'](_0x42487d,function(_0xaeab78){if(_0xaeab78[_0xd96f('0x3d')]!==_0xd96f('0x3e')){var _0x4d4004={};_0x4d4004[_0xaeab78['name']]={'$like':'%'+_0x428961['query'][_0xd96f('0x3b')]+'%'};return _0x4d4004;}})});}_0x286caf=_[_0xd96f('0x3c')]({},_0x286caf,_0x428961[_0xd96f('0x3f')]);var _0x4621e1={'where':_0x286caf['where']};return db[_0xd96f('0x2c')][_0xd96f('0x1f')](_0x4621e1)['then'](function(_0x1f23ab){_0x1d76cc[_0xd96f('0x1f')]=_0x1f23ab;if(_0x428961[_0xd96f('0x31')][_0xd96f('0x40')]){_0x286caf['include']=[{'all':!![]}];}return db[_0xd96f('0x2c')]['findAll'](_0x286caf);})[_0xd96f('0x41')](function(_0x1b6de2){_0x1d76cc[_0xd96f('0x42')]=_0x1b6de2;return _0x1d76cc;})[_0xd96f('0x41')](respondWithFilteredResult(_0x2b3b7c,_0x286caf))['catch'](handleError(_0x2b3b7c,null));};exports[_0xd96f('0x43')]=function(_0x252290,_0x18d756){var _0x11f196={'raw':!![],'where':{'id':_0x252290[_0xd96f('0x44')]['id']}},_0x1fbfd6={};_0x1fbfd6[_0xd96f('0x30')]=_[_0xd96f('0x32')](db[_0xd96f('0x2c')][_0xd96f('0x2d')]);_0x1fbfd6[_0xd96f('0x31')]=_[_0xd96f('0x32')](_0x252290[_0xd96f('0x31')]);_0x1fbfd6[_0xd96f('0x39')]=_[_0xd96f('0x33')](_0x1fbfd6[_0xd96f('0x30')],_0x1fbfd6[_0xd96f('0x31')]);_0x11f196[_0xd96f('0x35')]=_['intersection'](_0x1fbfd6['model'],qs[_0xd96f('0x34')](_0x252290['query']['fields']));_0x11f196[_0xd96f('0x35')]=_0x11f196['attributes'][_0xd96f('0x45')]?_0x11f196[_0xd96f('0x35')]:_0x1fbfd6[_0xd96f('0x30')];if(_0x252290['query'][_0xd96f('0x40')]){_0x11f196[_0xd96f('0x46')]=[{'all':!![]}];}_0x11f196=_[_0xd96f('0x3c')]({},_0x11f196,_0x252290['options']);return db[_0xd96f('0x2c')][_0xd96f('0x47')](_0x11f196)[_0xd96f('0x41')](handleEntityNotFound(_0x18d756,null))[_0xd96f('0x41')](respondWithResult(_0x18d756,null))[_0xd96f('0x48')](handleError(_0x18d756,null));};exports[_0xd96f('0x49')]=function(_0x31cbf1,_0x3ecf49){return db[_0xd96f('0x2c')][_0xd96f('0x49')](_0x31cbf1[_0xd96f('0x4a')],{})[_0xd96f('0x41')](respondWithResult(_0x3ecf49,0xc9))['catch'](handleError(_0x3ecf49,null));};exports[_0xd96f('0x24')]=function(_0x1a2165,_0x3245cf){if(_0x1a2165['body']['id']){delete _0x1a2165[_0xd96f('0x4a')]['id'];}return db['DeskField'][_0xd96f('0x47')]({'where':{'id':_0x1a2165[_0xd96f('0x44')]['id']}})[_0xd96f('0x41')](handleEntityNotFound(_0x3245cf,null))[_0xd96f('0x41')](saveUpdates(_0x1a2165[_0xd96f('0x4a')],null))[_0xd96f('0x41')](respondWithResult(_0x3245cf,null))[_0xd96f('0x48')](handleError(_0x3245cf,null));};exports[_0xd96f('0x4b')]=function(_0x16b54c,_0x42f1d9){return db[_0xd96f('0x2c')][_0xd96f('0x47')]({'where':{'id':_0x16b54c[_0xd96f('0x44')]['id']}})[_0xd96f('0x41')](handleEntityNotFound(_0x42f1d9,null))[_0xd96f('0x41')](removeEntity(_0x42f1d9,null))['catch'](handleError(_0x42f1d9,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index a41185b..1622e00 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 _0xa29b=['desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xa29b,0x17a));var _0xba29=function(_0x1b2baf,_0x5e2a94){_0x1b2baf=_0x1b2baf-0x0;var _0x3d25a4=_0xa29b[_0x1b2baf];return _0x3d25a4;};'use strict';var _=require(_0xba29('0x0'));var util=require(_0xba29('0x1'));var logger=require(_0xba29('0x2'))(_0xba29('0x3'));var moment=require('moment');var BPromise=require(_0xba29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba29('0x5'));var rimraf=require(_0xba29('0x6'));var config=require(_0xba29('0x7'));var attributes=require(_0xba29('0x8'));module[_0xba29('0x9')]=function(_0x37efd0,_0x529917){return _0x37efd0[_0xba29('0xa')]('DeskField',attributes,{'tableName':_0xba29('0xb'),'paranoid':![],'indexes':[{'name':_0xba29('0xc'),'fields':[_0xba29('0xd'),_0xba29('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3293=['request-promise','path','exports','define','DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0xc492a3,_0x2b42ee){var _0x414593=function(_0x4489ad){while(--_0x4489ad){_0xc492a3['push'](_0xc492a3['shift']());}};_0x414593(++_0x2b42ee);}(_0x3293,0x1c2));var _0x3329=function(_0x59c04b,_0x2213e2){_0x59c04b=_0x59c04b-0x0;var _0x448427=_0x3293[_0x59c04b];return _0x448427;};'use strict';var _=require(_0x3329('0x0'));var util=require(_0x3329('0x1'));var logger=require(_0x3329('0x2'))(_0x3329('0x3'));var moment=require(_0x3329('0x4'));var BPromise=require('bluebird');var rp=require(_0x3329('0x5'));var fs=require('fs');var path=require(_0x3329('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x3329('0x7')]=function(_0x30f93f,_0x4b74a8){return _0x30f93f[_0x3329('0x8')](_0x3329('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x3329('0xa'),'fields':[_0x3329('0xb'),_0x3329('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 7619b9c..3fa9d6e 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 _0xd15d=['stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x37f455,_0x273019){var _0x5d7d32=function(_0x152ee9){while(--_0x152ee9){_0x37f455['push'](_0x37f455['shift']());}};_0x5d7d32(++_0x273019);}(_0xd15d,0x192));var _0xdd15=function(_0x148202,_0x132b6a){_0x148202=_0x148202-0x0;var _0x1b15ad=_0xd15d[_0x148202];return _0x1b15ad;};'use strict';var _=require(_0xdd15('0x0'));var util=require(_0xdd15('0x1'));var moment=require(_0xdd15('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd15('0x3'));var db=require(_0xdd15('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd15('0x5'))(_0xdd15('0x6'));var config=require(_0xdd15('0x7'));var jayson=require(_0xdd15('0x8'));var client=jayson[_0xdd15('0x9')][_0xdd15('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d3c52,_0x3fce44,_0x30b234){return new BPromise(function(_0x25d594,_0x3092fc){return client['request'](_0x3d3c52,_0x30b234)['then'](function(_0xc9dd92){logger[_0xdd15('0xb')](_0xdd15('0xc'),_0x3fce44,_0xdd15('0xd'));logger[_0xdd15('0xe')](_0xdd15('0xf'),_0x3fce44,'request\x20sent',JSON[_0xdd15('0x10')](_0xc9dd92));if(_0xc9dd92[_0xdd15('0x11')]){if(_0xc9dd92[_0xdd15('0x11')][_0xdd15('0x12')]===0x1f4){logger[_0xdd15('0x11')](_0xdd15('0xc'),_0x3fce44,_0xc9dd92[_0xdd15('0x11')][_0xdd15('0x13')]);return _0x3092fc(_0xc9dd92[_0xdd15('0x11')][_0xdd15('0x13')]);}logger['error'](_0xdd15('0xc'),_0x3fce44,_0xc9dd92[_0xdd15('0x11')]['message']);return _0x25d594(_0xc9dd92[_0xdd15('0x11')][_0xdd15('0x13')]);}else{logger['info'](_0xdd15('0xc'),_0x3fce44,_0xdd15('0xd'));_0x25d594(_0xc9dd92[_0xdd15('0x14')][_0xdd15('0x13')]);}})[_0xdd15('0x15')](function(_0x300b96){logger[_0xdd15('0x11')](_0xdd15('0xc'),_0x3fce44,_0x300b96);_0x3092fc(_0x300b96);});});} \ No newline at end of file +var _0x4a38=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','error','code','message','request\x20sent','catch'];(function(_0x3d7486,_0x5529e5){var _0x54e078=function(_0x57dd9c){while(--_0x57dd9c){_0x3d7486['push'](_0x3d7486['shift']());}};_0x54e078(++_0x5529e5);}(_0x4a38,0x18f));var _0x84a3=function(_0x4bae3c,_0x2ec5ca){_0x4bae3c=_0x4bae3c-0x0;var _0x34fb17=_0x4a38[_0x4bae3c];return _0x34fb17;};'use strict';var _=require(_0x84a3('0x0'));var util=require(_0x84a3('0x1'));var moment=require(_0x84a3('0x2'));var BPromise=require(_0x84a3('0x3'));var rs=require(_0x84a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x84a3('0x5'));var logger=require(_0x84a3('0x6'))('rpc');var config=require(_0x84a3('0x7'));var jayson=require(_0x84a3('0x8'));var client=jayson[_0x84a3('0x9')][_0x84a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16763e,_0x18173f,_0x229ef6){return new BPromise(function(_0x16b9e0,_0xd3936){return client[_0x84a3('0xb')](_0x16763e,_0x229ef6)[_0x84a3('0xc')](function(_0x57bd1c){logger[_0x84a3('0xd')](_0x84a3('0xe'),_0x18173f,'request\x20sent');logger[_0x84a3('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x18173f,'request\x20sent',JSON['stringify'](_0x57bd1c));if(_0x57bd1c[_0x84a3('0x10')]){if(_0x57bd1c[_0x84a3('0x10')][_0x84a3('0x11')]===0x1f4){logger[_0x84a3('0x10')](_0x84a3('0xe'),_0x18173f,_0x57bd1c['error'][_0x84a3('0x12')]);return _0xd3936(_0x57bd1c[_0x84a3('0x10')]['message']);}logger['error'](_0x84a3('0xe'),_0x18173f,_0x57bd1c['error'][_0x84a3('0x12')]);return _0x16b9e0(_0x57bd1c[_0x84a3('0x10')][_0x84a3('0x12')]);}else{logger[_0x84a3('0xd')](_0x84a3('0xe'),_0x18173f,_0x84a3('0x13'));_0x16b9e0(_0x57bd1c['result']['message']);}})[_0x84a3('0x14')](function(_0x53ab9f){logger['error'](_0x84a3('0xe'),_0x18173f,_0x53ab9f);_0xd3936(_0x53ab9f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 4ab5d56..a59742f 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 _0x8d71=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','delete','exports','multer'];(function(_0x5e689a,_0x1cee9a){var _0x488d91=function(_0x2f1544){while(--_0x2f1544){_0x5e689a['push'](_0x5e689a['shift']());}};_0x488d91(++_0x1cee9a);}(_0x8d71,0x77));var _0x18d7=function(_0x1d49dd,_0x4ddc93){_0x1d49dd=_0x1d49dd-0x0;var _0x5f1588=_0x8d71[_0x1d49dd];return _0x5f1588;};'use strict';var multer=require(_0x18d7('0x0'));var util=require(_0x18d7('0x1'));var path=require(_0x18d7('0x2'));var timeout=require('connect-timeout');var express=require(_0x18d7('0x3'));var router=express[_0x18d7('0x4')]();var fs_extra=require(_0x18d7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x18d7('0x6'));var config=require(_0x18d7('0x7'));var controller=require(_0x18d7('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x18d7('0x9')]);router[_0x18d7('0xa')](_0x18d7('0xb'),auth[_0x18d7('0xc')](),controller[_0x18d7('0xd')]);router['get'](_0x18d7('0xe'),auth[_0x18d7('0xc')](),controller[_0x18d7('0xf')]);router['get'](_0x18d7('0x10'),auth[_0x18d7('0xc')](),controller[_0x18d7('0x11')]);router['post']('/',auth[_0x18d7('0xc')](),controller[_0x18d7('0x12')]);router[_0x18d7('0x13')](_0x18d7('0xe'),auth[_0x18d7('0xc')](),controller['addConfiguration']);router[_0x18d7('0x14')](_0x18d7('0xb'),auth[_0x18d7('0xc')](),controller[_0x18d7('0x15')]);router[_0x18d7('0x16')](_0x18d7('0xb'),auth[_0x18d7('0xc')](),controller['destroy']);module[_0x18d7('0x17')]=router; \ No newline at end of file +var _0x4145=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x4b6fcf,_0xc7855c){var _0x42d1ed=function(_0x559ea4){while(--_0x559ea4){_0x4b6fcf['push'](_0x4b6fcf['shift']());}};_0x42d1ed(++_0xc7855c);}(_0x4145,0x13a));var _0x5414=function(_0x2a8305,_0x43153c){_0x2a8305=_0x2a8305-0x0;var _0x1578bb=_0x4145[_0x2a8305];return _0x1578bb;};'use strict';var multer=require(_0x5414('0x0'));var util=require(_0x5414('0x1'));var path=require('path');var timeout=require(_0x5414('0x2'));var express=require(_0x5414('0x3'));var router=express[_0x5414('0x4')]();var fs_extra=require(_0x5414('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5414('0x6'));var config=require('../../config/environment');var controller=require(_0x5414('0x7'));router[_0x5414('0x8')]('/',auth['isAuthenticated'](),controller[_0x5414('0x9')]);router['get']('/:id',auth[_0x5414('0xa')](),controller[_0x5414('0xb')]);router[_0x5414('0x8')](_0x5414('0xc'),auth[_0x5414('0xa')](),controller[_0x5414('0xd')]);router['get'](_0x5414('0xe'),auth['isAuthenticated'](),controller[_0x5414('0xf')]);router[_0x5414('0x10')]('/',auth['isAuthenticated'](),controller[_0x5414('0x11')]);router[_0x5414('0x10')]('/:id/configurations',auth[_0x5414('0xa')](),controller[_0x5414('0x12')]);router[_0x5414('0x13')]('/:id',auth[_0x5414('0xa')](),controller[_0x5414('0x14')]);router[_0x5414('0x15')]('/:id',auth[_0x5414('0xa')](),controller[_0x5414('0x16')]);module[_0x5414('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index d8bfce9..0b9d73c 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 _0xc906=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3f4683,_0x4062f9){var _0x1a80aa=function(_0x5dea92){while(--_0x5dea92){_0x3f4683['push'](_0x3f4683['shift']());}};_0x1a80aa(++_0x4062f9);}(_0xc906,0x1ad));var _0x6c90=function(_0x3c58c1,_0x3f255b){_0x3c58c1=_0x3c58c1-0x0;var _0x333946=_0xc906[_0x3c58c1];return _0x333946;};'use strict';var Sequelize=require(_0x6c90('0x0'));module[_0x6c90('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6c90('0x2')]},'password':{'type':Sequelize[_0x6c90('0x2')]},'remoteUri':{'type':Sequelize[_0x6c90('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x6c90('0x2')]},'clientSecret':{'type':Sequelize[_0x6c90('0x2')]},'serverUrl':{'type':Sequelize[_0x6c90('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6c90('0x2')]},'modernAuthentication':{'type':Sequelize[_0x6c90('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xce1a=['STRING','sequelize'];(function(_0xd1ea06,_0x279049){var _0xab5f2b=function(_0x23f93e){while(--_0x23f93e){_0xd1ea06['push'](_0xd1ea06['shift']());}};_0xab5f2b(++_0x279049);}(_0xce1a,0xbf));var _0xace1=function(_0x270f96,_0x551dec){_0x270f96=_0x270f96-0x0;var _0x3bd607=_0xce1a[_0x270f96];return _0x3bd607;};'use strict';var Sequelize=require(_0xace1('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xace1('0x1')]},'remoteUri':{'type':Sequelize[_0xace1('0x1')]},'tenantId':{'type':Sequelize[_0xace1('0x1')]},'clientId':{'type':Sequelize[_0xace1('0x1')]},'clientSecret':{'type':Sequelize[_0xace1('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xace1('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f2fcfe6..5b3b825 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 _0x9cc0=['getConfigurations','Dynamics365Configuration','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','channel','Dynamics365Field','substring','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','title','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','slainvokedidname','statecode','subjectidname','ticketnumber','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','test',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Bearer\x20','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','update','then','end','sendStatus','error','stack','name','send','map','Dynamics365Account','fieldName','key','query','keys','intersection','model','attributes','fields','length','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','rows','catch','show','rawAttributes','include','create','body','find','params','destroy'];(function(_0x41d7bf,_0x242f14){var _0x482038=function(_0x23fb2c){while(--_0x23fb2c){_0x41d7bf['push'](_0x41d7bf['shift']());}};_0x482038(++_0x242f14);}(_0x9cc0,0x81));var _0x09cc=function(_0x569c95,_0x54f839){_0x569c95=_0x569c95-0x0;var _0x2749b5=_0x9cc0[_0x569c95];return _0x2749b5;};'use strict';var rp=require(_0x09cc('0x0'));var util=require(_0x09cc('0x1'));var _=require(_0x09cc('0x2'));var qs=require(_0x09cc('0x3'));var logger=require(_0x09cc('0x4'))(_0x09cc('0x5'));var db=require(_0x09cc('0x6'))['db'];var integrations=require(_0x09cc('0x7'));function respondWithResult(_0x447bee,_0x521f79){_0x521f79=_0x521f79||0xc8;return function(_0x179cb2){if(_0x179cb2){return _0x447bee[_0x09cc('0x8')](_0x521f79)[_0x09cc('0x9')](_0x179cb2);}};}function respondWithFilteredResult(_0xc7fbd1,_0x58029e){return function(_0x5e6ee9){if(_0x5e6ee9){var _0x822d79=typeof _0x58029e[_0x09cc('0xa')]===_0x09cc('0xb')&&typeof _0x58029e[_0x09cc('0xc')]===_0x09cc('0xb');var _0xf84ba0=_0x5e6ee9['count'];var _0x3fd061=_0x822d79?0x0:_0x58029e['offset'];var _0x5032d8=_0x822d79?_0x5e6ee9[_0x09cc('0xd')]:_0x58029e[_0x09cc('0xa')]+_0x58029e[_0x09cc('0xc')];var _0x35b02b;if(_0x5032d8>=_0xf84ba0){_0x5032d8=_0xf84ba0;_0x35b02b=0xc8;}else{_0x35b02b=0xce;}_0xc7fbd1['status'](_0x35b02b);return _0xc7fbd1[_0x09cc('0xe')]('Content-Range',_0x3fd061+'-'+_0x5032d8+'/'+_0xf84ba0)['json'](_0x5e6ee9);}return null;};}function saveUpdates(_0x39d8d2){return function(_0x11c7c0){if(_0x11c7c0){return _0x11c7c0[_0x09cc('0xf')](_0x39d8d2)[_0x09cc('0x10')](function(_0x328e9c){return _0x328e9c;});}return null;};}function removeEntity(_0x1c72de){return function(_0x4a8fa5){if(_0x4a8fa5){return _0x4a8fa5['destroy']()[_0x09cc('0x10')](function(){_0x1c72de[_0x09cc('0x8')](0xcc)[_0x09cc('0x11')]();});}};}function handleEntityNotFound(_0x21a865){return function(_0x35ce3c){if(!_0x35ce3c){_0x21a865[_0x09cc('0x12')](0x194);}return _0x35ce3c;};}function handleError(_0x1317d1,_0x4a1599){_0x4a1599=_0x4a1599||0x1f4;return function(_0x58fdde){logger[_0x09cc('0x13')](_0x58fdde[_0x09cc('0x14')]);if(_0x58fdde[_0x09cc('0x15')]){delete _0x58fdde['name'];}_0x1317d1[_0x09cc('0x8')](_0x4a1599)[_0x09cc('0x16')](_0x58fdde);};}exports['index']=function(_0x964835,_0x45d2ec){var _0x540fdb={},_0x4342c9={},_0x2b058b={'count':0x0,'rows':[]};var _0x4f11c2=_[_0x09cc('0x17')](db[_0x09cc('0x18')]['rawAttributes'],function(_0x739703){return{'name':_0x739703[_0x09cc('0x19')],'type':_0x739703['type'][_0x09cc('0x1a')]};});_0x4342c9['model']=_['map'](_0x4f11c2,_0x09cc('0x15'));_0x4342c9[_0x09cc('0x1b')]=_[_0x09cc('0x1c')](_0x964835[_0x09cc('0x1b')]);_0x4342c9['filters']=_[_0x09cc('0x1d')](_0x4342c9[_0x09cc('0x1e')],_0x4342c9['query']);_0x540fdb[_0x09cc('0x1f')]=_['intersection'](_0x4342c9[_0x09cc('0x1e')],qs[_0x09cc('0x20')](_0x964835['query']['fields']));_0x540fdb[_0x09cc('0x1f')]=_0x540fdb[_0x09cc('0x1f')][_0x09cc('0x21')]?_0x540fdb[_0x09cc('0x1f')]:_0x4342c9[_0x09cc('0x1e')];if(!_0x964835[_0x09cc('0x1b')]['hasOwnProperty']('nolimit')){_0x540fdb['limit']=qs[_0x09cc('0xc')](_0x964835[_0x09cc('0x1b')][_0x09cc('0xc')]);_0x540fdb['offset']=qs['offset'](_0x964835[_0x09cc('0x1b')]['offset']);}_0x540fdb['order']=qs[_0x09cc('0x22')](_0x964835['query']['sort']);_0x540fdb['where']=qs[_0x09cc('0x23')](_[_0x09cc('0x24')](_0x964835[_0x09cc('0x1b')],_0x4342c9[_0x09cc('0x23')]),_0x4f11c2);if(_0x964835[_0x09cc('0x1b')][_0x09cc('0x25')]){_0x540fdb[_0x09cc('0x26')]=_[_0x09cc('0x27')](_0x540fdb['where'],{'$or':_[_0x09cc('0x17')](_0x4f11c2,function(_0x3c7c19){if(_0x3c7c19[_0x09cc('0x28')]!==_0x09cc('0x29')){var _0x7c38d4={};_0x7c38d4[_0x3c7c19[_0x09cc('0x15')]]={'$like':'%'+_0x964835[_0x09cc('0x1b')][_0x09cc('0x25')]+'%'};return _0x7c38d4;}})});}_0x540fdb=_[_0x09cc('0x27')]({},_0x540fdb,_0x964835[_0x09cc('0x2a')]);var _0x252977={'where':_0x540fdb[_0x09cc('0x26')]};return db[_0x09cc('0x18')]['count'](_0x252977)[_0x09cc('0x10')](function(_0x565609){_0x2b058b[_0x09cc('0xd')]=_0x565609;if(_0x964835[_0x09cc('0x1b')][_0x09cc('0x2b')]){_0x540fdb['include']=[{'all':!![]}];}return db[_0x09cc('0x18')]['findAll'](_0x540fdb);})['then'](function(_0x1081aa){_0x2b058b[_0x09cc('0x2c')]=_0x1081aa;return _0x2b058b;})['then'](respondWithFilteredResult(_0x45d2ec,_0x540fdb))[_0x09cc('0x2d')](handleError(_0x45d2ec,null));};exports[_0x09cc('0x2e')]=function(_0x329a64,_0x28f7ae){var _0x46b866={'raw':![],'where':{'id':_0x329a64['params']['id']}},_0x3e32b3={};_0x3e32b3['model']=_[_0x09cc('0x1c')](db['Dynamics365Account'][_0x09cc('0x2f')]);_0x3e32b3['query']=_[_0x09cc('0x1c')](_0x329a64[_0x09cc('0x1b')]);_0x3e32b3['filters']=_['intersection'](_0x3e32b3[_0x09cc('0x1e')],_0x3e32b3[_0x09cc('0x1b')]);_0x46b866[_0x09cc('0x1f')]=_[_0x09cc('0x1d')](_0x3e32b3[_0x09cc('0x1e')],qs[_0x09cc('0x20')](_0x329a64[_0x09cc('0x1b')]['fields']));_0x46b866[_0x09cc('0x1f')]=_0x46b866['attributes']['length']?_0x46b866['attributes']:_0x3e32b3['model'];if(_0x329a64[_0x09cc('0x1b')][_0x09cc('0x2b')]){_0x46b866[_0x09cc('0x30')]=[{'all':!![]}];}_0x46b866=_['merge']({},_0x46b866,_0x329a64[_0x09cc('0x2a')]);return db[_0x09cc('0x18')]['find'](_0x46b866)[_0x09cc('0x10')](handleEntityNotFound(_0x28f7ae,null))[_0x09cc('0x10')](respondWithResult(_0x28f7ae,null))[_0x09cc('0x2d')](handleError(_0x28f7ae,null));};exports[_0x09cc('0x31')]=function(_0xc72ef0,_0x1951d2){return db[_0x09cc('0x18')][_0x09cc('0x31')](_0xc72ef0[_0x09cc('0x32')],{})['then'](respondWithResult(_0x1951d2,0xc9))[_0x09cc('0x2d')](handleError(_0x1951d2,null));};exports['update']=function(_0x2815c3,_0x5e4b55){if(_0x2815c3[_0x09cc('0x32')]['id']){delete _0x2815c3[_0x09cc('0x32')]['id'];}return db[_0x09cc('0x18')][_0x09cc('0x33')]({'where':{'id':_0x2815c3[_0x09cc('0x34')]['id']}})[_0x09cc('0x10')](handleEntityNotFound(_0x5e4b55,null))['then'](saveUpdates(_0x2815c3[_0x09cc('0x32')],null))['then'](respondWithResult(_0x5e4b55,null))[_0x09cc('0x2d')](handleError(_0x5e4b55,null));};exports[_0x09cc('0x35')]=function(_0x1f86d3,_0x40dbbc){return db[_0x09cc('0x18')]['find']({'where':{'id':_0x1f86d3[_0x09cc('0x34')]['id']}})[_0x09cc('0x10')](handleEntityNotFound(_0x40dbbc,null))[_0x09cc('0x10')](removeEntity(_0x40dbbc,null))[_0x09cc('0x2d')](handleError(_0x40dbbc,null));};exports[_0x09cc('0x36')]=function(_0x330516,_0xb8a69b){var _0x7b00d0={};var _0x31bcff={};var _0x35589a;var _0x1d46c3;return db[_0x09cc('0x18')]['findOne']({'where':{'id':_0x330516[_0x09cc('0x34')]['id']}})['then'](handleEntityNotFound(_0xb8a69b,null))[_0x09cc('0x10')](function(_0x33415f){if(_0x33415f){_0x35589a=_0x33415f;_0x31bcff[_0x09cc('0x1e')]=_[_0x09cc('0x1c')](db[_0x09cc('0x37')][_0x09cc('0x2f')]);_0x31bcff[_0x09cc('0x1b')]=_['keys'](_0x330516['query']);_0x31bcff[_0x09cc('0x23')]=_[_0x09cc('0x1d')](_0x31bcff[_0x09cc('0x1e')],_0x31bcff[_0x09cc('0x1b')]);_0x7b00d0[_0x09cc('0x1f')]=_[_0x09cc('0x1d')](_0x31bcff['model'],qs[_0x09cc('0x20')](_0x330516[_0x09cc('0x1b')]['fields']));_0x7b00d0[_0x09cc('0x1f')]=_0x7b00d0[_0x09cc('0x1f')][_0x09cc('0x21')]?_0x7b00d0[_0x09cc('0x1f')]:_0x31bcff[_0x09cc('0x1e')];_0x7b00d0['order']=qs['sort'](_0x330516[_0x09cc('0x1b')][_0x09cc('0x22')]);_0x7b00d0['where']=qs[_0x09cc('0x23')](_[_0x09cc('0x24')](_0x330516[_0x09cc('0x1b')],_0x31bcff[_0x09cc('0x23')]));if(_0x330516[_0x09cc('0x1b')][_0x09cc('0x25')]){_0x7b00d0[_0x09cc('0x26')]=_[_0x09cc('0x27')](_0x7b00d0[_0x09cc('0x26')],{'$or':_[_0x09cc('0x17')](_0x7b00d0[_0x09cc('0x1f')],function(_0x56ec71){var _0x3c807d={};_0x3c807d[_0x56ec71]={'$like':'%'+_0x330516[_0x09cc('0x1b')][_0x09cc('0x25')]+'%'};return _0x3c807d;})});}_0x7b00d0=_[_0x09cc('0x27')]({},_0x7b00d0,_0x330516['options']);return _0x35589a[_0x09cc('0x36')](_0x7b00d0);}})[_0x09cc('0x10')](function(_0x457b13){if(_0x457b13){_0x1d46c3=_0x457b13['length'];if(!_0x330516[_0x09cc('0x1b')][_0x09cc('0x38')](_0x09cc('0x39'))){_0x7b00d0[_0x09cc('0xc')]=qs[_0x09cc('0xc')](_0x330516['query'][_0x09cc('0xc')]);_0x7b00d0[_0x09cc('0xa')]=qs[_0x09cc('0xa')](_0x330516[_0x09cc('0x1b')]['offset']);}return _0x35589a['getConfigurations'](_0x7b00d0);}})[_0x09cc('0x10')](function(_0x2b91c6){if(_0x2b91c6){return _0x2b91c6?{'count':_0x1d46c3,'rows':_0x2b91c6}:null;}})[_0x09cc('0x10')](respondWithResult(_0xb8a69b,null))[_0x09cc('0x2d')](handleError(_0xb8a69b,null));};exports[_0x09cc('0x3a')]=function(_0x12a9b5,_0x17a786){if(_0x12a9b5[_0x09cc('0x32')]['id']){delete _0x12a9b5[_0x09cc('0x32')]['id'];}return db[_0x09cc('0x18')][_0x09cc('0x3b')]({'where':{'id':_0x12a9b5[_0x09cc('0x34')]['id']}})[_0x09cc('0x10')](handleEntityNotFound(_0x17a786,null))[_0x09cc('0x10')](function(_0x5072ef){if(_0x5072ef){_0x12a9b5['body'][_0x09cc('0x3c')]=_0x5072ef['id'];_0x12a9b5[_0x09cc('0x32')][_0x09cc('0x3d')]=integrations['getSubjects'](_0x12a9b5[_0x09cc('0x32')][_0x09cc('0x3e')],_0x12a9b5[_0x09cc('0x32')][_0x09cc('0x28')]);_0x12a9b5['body']['Descriptions']=integrations['getDescriptions'](_0x12a9b5[_0x09cc('0x32')][_0x09cc('0x3e')],_0x12a9b5[_0x09cc('0x32')][_0x09cc('0x28')]);return db[_0x09cc('0x37')][_0x09cc('0x31')](_0x12a9b5[_0x09cc('0x32')],{'include':[{'model':db[_0x09cc('0x3f')],'as':_0x09cc('0x3d')},{'model':db[_0x09cc('0x3f')],'as':'Descriptions'}]});}return null;})[_0x09cc('0x10')](respondWithResult(_0x17a786,null))[_0x09cc('0x2d')](handleError(_0x17a786,null));};function sanitizeRemoteUri(_0x3fe75a){var _0xd13067=_0x3fe75a['slice'](-0x1);if(_0xd13067==='/')return _0x3fe75a[_0x09cc('0x40')](0x0,_0x3fe75a['lastIndexOf'](_0xd13067));return _0x3fe75a;}function getWebApiUrl(_0x108ae4){return util[_0x09cc('0x41')](_0x09cc('0x42'),_0x108ae4);}exports[_0x09cc('0x43')]=function(_0x53e5ec,_0x251a3c){var _0x261419=_0x53e5ec['query'][_0x09cc('0x44')];var _0x3170b3=_0x261419===_0x09cc('0x45')?_0x09cc('0x46'):'PhoneCall';var _0x46a9a7='';var _0x63f4c3='';var _0x294165='';var _0x295e88='';var _0x1c1c99='';var _0x4cef99='';var _0x340afd='';var _0x5c35f3='';var _0x4d7592=[_0x09cc('0x47'),'description','customerid',_0x09cc('0x48'),_0x09cc('0x49'),_0x09cc('0x4a'),'phonenumber',_0x09cc('0x4b'),_0x09cc('0x4c'),_0x09cc('0x4d')];var _0x18caaf=[_0x09cc('0x4e'),_0x09cc('0x4f'),_0x09cc('0x50'),'billedserviceunits',_0x09cc('0x51'),_0x09cc('0x52'),'contractdetailidname',_0x09cc('0x53'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x09cc('0x54'),_0x09cc('0x55'),_0x09cc('0x56'),_0x09cc('0x57'),_0x09cc('0x58'),'customeridname',_0x09cc('0x59'),_0x09cc('0x5a'),_0x09cc('0x5b'),_0x09cc('0x5c'),_0x09cc('0x5d'),_0x09cc('0x5e'),_0x09cc('0x5f'),_0x09cc('0x60'),_0x09cc('0x61'),'followupby',_0x09cc('0x62'),_0x09cc('0x63'),_0x09cc('0x64'),_0x09cc('0x65'),_0x09cc('0x66'),'modifiedbyexternalpartyname',_0x09cc('0x67'),_0x09cc('0x68'),_0x09cc('0x69'),_0x09cc('0x6a'),_0x09cc('0x6b'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x09cc('0x6c'),'numberofchildincidents',_0x09cc('0x6d'),_0x09cc('0x6e'),_0x09cc('0x6f'),_0x09cc('0x70'),'owneridyominame',_0x09cc('0x71'),_0x09cc('0x72'),_0x09cc('0x73'),_0x09cc('0x74'),_0x09cc('0x75'),'productserialnumber',_0x09cc('0x76'),_0x09cc('0x77'),_0x09cc('0x78'),'responsiblecontactidname',_0x09cc('0x79'),'sentimentvalue',_0x09cc('0x7a'),'slaname','socialprofileidname',_0x09cc('0x7b'),'statuscode',_0x09cc('0x7c'),_0x09cc('0x7d'),'timezoneruleversionnumber','transactioncurrencyidname','traversedpath',_0x09cc('0x7e'),'versionnumber'];var _0x17726e=_0x4d7592[_0x09cc('0x7f')](_0x18caaf);return db['Dynamics365Account']['findOne']({'where':{'id':_0x53e5ec[_0x09cc('0x34')]['id']},'attributes':['id',_0x09cc('0x80'),_0x09cc('0x81'),_0x09cc('0x82'),_0x09cc('0x83'),_0x09cc('0x84'),_0x09cc('0x85'),_0x09cc('0x86')],'include':[{'model':db[_0x09cc('0x87')],'as':_0x09cc('0x87'),'attributes':['id','data5',_0x09cc('0x88')]}]})[_0x09cc('0x10')](handleEntityNotFound(_0x251a3c,null))[_0x09cc('0x10')](function(_0x5044e1){if(_0x5044e1){if(_0x5044e1[_0x09cc('0x86')]){_0x5044e1[_0x09cc('0x89')]=_0x5044e1[_0x09cc('0x87')][_0x09cc('0x8a')];_0x5c35f3=sanitizeRemoteUri(_0x5044e1[_0x09cc('0x87')][_0x09cc('0x88')]);_0x340afd=getWebApiUrl(_0x5c35f3);return _0x5044e1;}_0x5c35f3=sanitizeRemoteUri(_0x5044e1['remoteUri']);_0x340afd=getWebApiUrl(_0x5c35f3);var _0x270a4c={'method':_0x09cc('0x8b'),'uri':'https://login.microsoftonline.com/'+_0x5044e1['tenantId']+_0x09cc('0x8c'),'form':{'client_id':_0x5044e1[_0x09cc('0x84')],'resource':_0x5c35f3,'username':_0x5044e1[_0x09cc('0x80')],'password':_0x5044e1[_0x09cc('0x81')],'grant_type':_0x09cc('0x81'),'client_secret':_0x5044e1[_0x09cc('0x85')]},'json':!![]};return rp(_0x270a4c);}})[_0x09cc('0x10')](function(_0x1c8b59){_0x4cef99=_0x1c8b59[_0x09cc('0x89')];var _0x3278af={'method':_0x09cc('0x8d'),'uri':encodeURI(_0x340afd+_0x09cc('0x8e')+_0x3170b3+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x4cef99,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3278af);})[_0x09cc('0x10')](function(_0x2dd1c6){var _0x25f6f3=_0x2dd1c6[_0x09cc('0x8f')][0x0];var _0x102715=_0x25f6f3[_0x09cc('0x90')];var _0x288006={'method':_0x09cc('0x8d'),'uri':_0x340afd+_0x09cc('0x91')+_0x102715+_0x09cc('0x92'),'headers':{'Authorization':'Bearer\x20'+_0x4cef99,'If-None-Match':null,'OData-Version':_0x09cc('0x93')},'json':!![]};return rp(_0x288006);})[_0x09cc('0x10')](function(_0x1338a9){_0x46a9a7=_0x1338a9;_0x63f4c3=_0x46a9a7[_0x09cc('0x94')];_0x63f4c3=_[_0x09cc('0x95')](_0x63f4c3,function(_0x712e1e){return!_0x17726e['includes'](_0x712e1e[_0x09cc('0x96')]);});var _0x5614bb=[];var _0x3ece0b=[];_0x63f4c3[_0x09cc('0x97')](function(_0x5d325e){if(_0x5d325e['@odata.type']){var _0x40e445=_0x5d325e[_0x09cc('0x98')][_0x09cc('0x40')](_0x5d325e[_0x09cc('0x98')][_0x09cc('0x99')]('.')+0x1);if(_0x40e445===_0x09cc('0x9a')){_0x5614bb[_0x09cc('0x9b')](getSelectList(_0x340afd,_0x261419,_0x3ece0b,_0x46a9a7[_0x09cc('0x90')],_0x5d325e[_0x09cc('0x90')],_0x4cef99));}}});return Promise[_0x09cc('0x9c')](_0x5614bb);})[_0x09cc('0x10')](function(_0x2b77df){_0x294165=_0x2b77df[0x0];var _0x529f19=[];var _0xc19a4c=[];_0x63f4c3[_0x09cc('0x97')](function(_0x1fd887){if(!_[_0x09cc('0x9d')](_0x1fd887['@odata.type'])){var _0x3c14a1=_0x1fd887[_0x09cc('0x98')][_0x09cc('0x40')](_0x1fd887[_0x09cc('0x98')][_0x09cc('0x99')]('.')+0x1);if(_0x3c14a1===_0x09cc('0x9e')){_0x529f19[_0x09cc('0x9b')](getBooleanList(_0x340afd,_0x261419,_0xc19a4c,_0x46a9a7[_0x09cc('0x90')],_0x1fd887[_0x09cc('0x90')],_0x4cef99));}}});return Promise['all'](_0x529f19);})[_0x09cc('0x10')](function(_0x3a97b7){_0x295e88=_0x3a97b7[0x0];var _0x522857=[];var _0xceb5a3=[];_0x63f4c3['forEach'](function(_0x172e3a){if(_0x172e3a[_0x09cc('0x98')]){var _0x5cdd04=_0x172e3a['@odata.type'][_0x09cc('0x40')](_0x172e3a['@odata.type']['lastIndexOf']('.')+0x1);if(_0x5cdd04==='StringAttributeMetadata'||_0x5cdd04===_0x09cc('0x9f')||_0x5cdd04===_0x09cc('0xa0')||_0x5cdd04===_0x09cc('0xa1')||_0x5cdd04===_0x09cc('0xa2')||_0x5cdd04===_0x09cc('0xa3')||_0x5cdd04==='StatusAttributeMetadata'||_0x5cdd04===_0x09cc('0xa4')||_0x5cdd04==='StateAttributeMetadata'||_0x5cdd04===_0x09cc('0xa5')){_0x522857[_0x09cc('0x9b')](getInputList(_0x340afd,_0x261419,_0x5cdd04,_0xceb5a3,_0x46a9a7['MetadataId'],_0x172e3a[_0x09cc('0x90')],_0x4cef99));}}});return Promise[_0x09cc('0x9c')](_0x522857);})[_0x09cc('0x10')](function(_0x4deb86){_0x1c1c99=_0x4deb86[0x0];var _0x241e9e=_0x294165[_0x09cc('0x7f')](_0x295e88)[_0x09cc('0x7f')](_0x1c1c99);var _0x401633={'count':_0x241e9e[_0x09cc('0x21')],'rows':_0x241e9e};return _0x401633;})[_0x09cc('0x10')](respondWithResult(_0x251a3c,null))[_0x09cc('0x2d')](function(_0x3659fd){var _0x36a4e1=_0x53e5ec[_0x09cc('0x1b')]['test']?0x1f4:_0x3659fd[_0x09cc('0xa6')]||0x1f4;logger[_0x09cc('0x13')](_0x3659fd[_0x09cc('0x14')]);delete _0x3659fd['name'];if(_0x36a4e1===0x191){_0x36a4e1=0x190;}_0x251a3c[_0x09cc('0x8')](_0x36a4e1)[_0x09cc('0x16')](_0x53e5ec[_0x09cc('0x1b')][_0x09cc('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x3659fd[_0x09cc('0xa6')]}:_0x3659fd);});};function getSelectList(_0x1ffdbc,_0x24974d,_0xed5c17,_0x2ce61c,_0x2331f9,_0x1c990e){var _0x20889f={'method':_0x09cc('0x8d'),'uri':_0x1ffdbc+'EntityDefinitions('+_0x2ce61c+_0x09cc('0xa8')+_0x2331f9+_0x09cc('0xa9')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x09cc('0xaa')+_0x1c990e,'If-None-Match':null,'OData-Version':_0x09cc('0x93')},'json':!![]};return rp(_0x20889f)[_0x09cc('0x10')](function(_0x29e45c){var _0x1653a9=[];var _0x2166c0=_0x29e45c[_0x09cc('0xab')][_0x09cc('0xac')];_0x2166c0[_0x09cc('0x97')](function(_0x128df1){_0x1653a9['push']({'name':_0x128df1[_0x09cc('0xad')][_0x09cc('0xae')][_0x09cc('0xad')],'value':String(_0x128df1[_0x09cc('0xaf')])});});var _0x33b397={'id':_0x24974d+'_'+_0x29e45c[_0x09cc('0x96')],'name':_0x29e45c[_0x09cc('0xb0')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x1653a9};_0xed5c17[_0x09cc('0x9b')](_0x33b397);return _0xed5c17;});}function getBooleanList(_0x19b494,_0x27efce,_0x24dbe5,_0x29c316,_0x8f03b5,_0x358e13){var _0x1eedc6={'method':_0x09cc('0x8d'),'uri':_0x19b494+_0x09cc('0x91')+_0x29c316+_0x09cc('0xa8')+_0x8f03b5+_0x09cc('0xb1'),'headers':{'Authorization':_0x09cc('0xaa')+_0x358e13,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1eedc6)[_0x09cc('0x10')](function(_0x5e9db7){var _0x1827b2=[];_0x1827b2['push']({'name':_0x5e9db7[_0x09cc('0xab')][_0x09cc('0xb2')][_0x09cc('0xad')][_0x09cc('0xae')][_0x09cc('0xad')],'value':_0x09cc('0xb3')},{'name':_0x5e9db7[_0x09cc('0xab')][_0x09cc('0xb4')][_0x09cc('0xad')][_0x09cc('0xae')][_0x09cc('0xad')],'value':_0x09cc('0xb5')});var _0x30599d={'id':_0x27efce+'_'+_0x5e9db7[_0x09cc('0x96')],'name':_0x5e9db7[_0x09cc('0xb0')][_0x09cc('0xae')][_0x09cc('0xad')],'custom':![],'options':_0x1827b2};_0x24dbe5['push'](_0x30599d);return _0x24dbe5;});}function getInputList(_0x518fdb,_0x57d00c,_0x26ac54,_0x445003,_0x287fc7,_0x3f434c,_0x3d7543){var _0x44de15={'method':_0x09cc('0x8d'),'uri':_0x518fdb+_0x09cc('0x91')+_0x287fc7+_0x09cc('0xa8')+_0x3f434c+_0x09cc('0xb6')+_0x26ac54+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x09cc('0xaa')+_0x3d7543,'If-None-Match':null,'OData-Version':_0x09cc('0x93')},'json':!![]};return rp(_0x44de15)['then'](function(_0x9083fd){var _0x5680fb={'id':_0x57d00c+'_'+_0x9083fd[_0x09cc('0x96')],'name':_0x9083fd[_0x09cc('0xb0')][_0x09cc('0xae')]?_0x9083fd['DisplayName'][_0x09cc('0xae')]['Label']:_0x9083fd['LogicalName'],'custom':![],'options':[]};_0x445003['push'](_0x5680fb);return _0x445003;});} \ No newline at end of file +var _0xf485=['stack','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','OptionSet','FalseOption','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','json','undefined','limit','count','offset','status','set','Content-Range','then','end','error','name','send','index','Dynamics365Account','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','getConfigurations','findOne','hasOwnProperty','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','username','remoteUri','clientId','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','password','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','concat','test'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xf485,0xd1));var _0x5f48=function(_0x10f5ea,_0xb6174a){_0x10f5ea=_0x10f5ea-0x0;var _0x3237b5=_0xf485[_0x10f5ea];return _0x3237b5;};'use strict';var rp=require(_0x5f48('0x0'));var util=require(_0x5f48('0x1'));var _=require(_0x5f48('0x2'));var qs=require(_0x5f48('0x3'));var logger=require(_0x5f48('0x4'))(_0x5f48('0x5'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5f48('0x6'));function respondWithResult(_0x312f79,_0x4c5d30){_0x4c5d30=_0x4c5d30||0xc8;return function(_0x46be2a){if(_0x46be2a){return _0x312f79['status'](_0x4c5d30)[_0x5f48('0x7')](_0x46be2a);}};}function respondWithFilteredResult(_0x518eb1,_0xb2021){return function(_0x126cb7){if(_0x126cb7){var _0x3c6f45=typeof _0xb2021['offset']===_0x5f48('0x8')&&typeof _0xb2021[_0x5f48('0x9')]===_0x5f48('0x8');var _0x5019de=_0x126cb7[_0x5f48('0xa')];var _0x2b51a2=_0x3c6f45?0x0:_0xb2021[_0x5f48('0xb')];var _0x1b1be7=_0x3c6f45?_0x126cb7[_0x5f48('0xa')]:_0xb2021['offset']+_0xb2021[_0x5f48('0x9')];var _0x2a650e;if(_0x1b1be7>=_0x5019de){_0x1b1be7=_0x5019de;_0x2a650e=0xc8;}else{_0x2a650e=0xce;}_0x518eb1[_0x5f48('0xc')](_0x2a650e);return _0x518eb1[_0x5f48('0xd')](_0x5f48('0xe'),_0x2b51a2+'-'+_0x1b1be7+'/'+_0x5019de)[_0x5f48('0x7')](_0x126cb7);}return null;};}function saveUpdates(_0x413230){return function(_0x5687f9){if(_0x5687f9){return _0x5687f9['update'](_0x413230)['then'](function(_0x721be3){return _0x721be3;});}return null;};}function removeEntity(_0x2dd14d){return function(_0x5be4b0){if(_0x5be4b0){return _0x5be4b0['destroy']()[_0x5f48('0xf')](function(){_0x2dd14d['status'](0xcc)[_0x5f48('0x10')]();});}};}function handleEntityNotFound(_0x55eaae){return function(_0x4c5f35){if(!_0x4c5f35){_0x55eaae['sendStatus'](0x194);}return _0x4c5f35;};}function handleError(_0x576fc5,_0x334508){_0x334508=_0x334508||0x1f4;return function(_0x58d606){logger[_0x5f48('0x11')](_0x58d606['stack']);if(_0x58d606[_0x5f48('0x12')]){delete _0x58d606[_0x5f48('0x12')];}_0x576fc5['status'](_0x334508)[_0x5f48('0x13')](_0x58d606);};}exports[_0x5f48('0x14')]=function(_0x3acd22,_0x5763af){var _0xb276b1={},_0x147033={},_0x434698={'count':0x0,'rows':[]};var _0x3fbea5=_['map'](db[_0x5f48('0x15')]['rawAttributes'],function(_0xa573de){return{'name':_0xa573de[_0x5f48('0x16')],'type':_0xa573de[_0x5f48('0x17')]['key']};});_0x147033[_0x5f48('0x18')]=_[_0x5f48('0x19')](_0x3fbea5,'name');_0x147033['query']=_[_0x5f48('0x1a')](_0x3acd22[_0x5f48('0x1b')]);_0x147033[_0x5f48('0x1c')]=_[_0x5f48('0x1d')](_0x147033['model'],_0x147033[_0x5f48('0x1b')]);_0xb276b1[_0x5f48('0x1e')]=_['intersection'](_0x147033[_0x5f48('0x18')],qs[_0x5f48('0x1f')](_0x3acd22[_0x5f48('0x1b')][_0x5f48('0x1f')]));_0xb276b1[_0x5f48('0x1e')]=_0xb276b1['attributes'][_0x5f48('0x20')]?_0xb276b1[_0x5f48('0x1e')]:_0x147033[_0x5f48('0x18')];if(!_0x3acd22['query']['hasOwnProperty'](_0x5f48('0x21'))){_0xb276b1[_0x5f48('0x9')]=qs[_0x5f48('0x9')](_0x3acd22[_0x5f48('0x1b')][_0x5f48('0x9')]);_0xb276b1['offset']=qs[_0x5f48('0xb')](_0x3acd22[_0x5f48('0x1b')][_0x5f48('0xb')]);}_0xb276b1[_0x5f48('0x22')]=qs[_0x5f48('0x23')](_0x3acd22[_0x5f48('0x1b')][_0x5f48('0x23')]);_0xb276b1[_0x5f48('0x24')]=qs[_0x5f48('0x1c')](_[_0x5f48('0x25')](_0x3acd22[_0x5f48('0x1b')],_0x147033['filters']),_0x3fbea5);if(_0x3acd22['query'][_0x5f48('0x26')]){_0xb276b1[_0x5f48('0x24')]=_[_0x5f48('0x27')](_0xb276b1[_0x5f48('0x24')],{'$or':_[_0x5f48('0x19')](_0x3fbea5,function(_0x1a11c0){if(_0x1a11c0['type']!==_0x5f48('0x28')){var _0x44b284={};_0x44b284[_0x1a11c0[_0x5f48('0x12')]]={'$like':'%'+_0x3acd22['query'][_0x5f48('0x26')]+'%'};return _0x44b284;}})});}_0xb276b1=_[_0x5f48('0x27')]({},_0xb276b1,_0x3acd22[_0x5f48('0x29')]);var _0x42757a={'where':_0xb276b1['where']};return db[_0x5f48('0x15')][_0x5f48('0xa')](_0x42757a)[_0x5f48('0xf')](function(_0x515b80){_0x434698[_0x5f48('0xa')]=_0x515b80;if(_0x3acd22[_0x5f48('0x1b')][_0x5f48('0x2a')]){_0xb276b1[_0x5f48('0x2b')]=[{'all':!![]}];}return db[_0x5f48('0x15')][_0x5f48('0x2c')](_0xb276b1);})[_0x5f48('0xf')](function(_0x1a5588){_0x434698[_0x5f48('0x2d')]=_0x1a5588;return _0x434698;})[_0x5f48('0xf')](respondWithFilteredResult(_0x5763af,_0xb276b1))[_0x5f48('0x2e')](handleError(_0x5763af,null));};exports[_0x5f48('0x2f')]=function(_0x153f06,_0x294cab){var _0x43d774={'raw':![],'where':{'id':_0x153f06[_0x5f48('0x30')]['id']}},_0x16febc={};_0x16febc[_0x5f48('0x18')]=_['keys'](db[_0x5f48('0x15')]['rawAttributes']);_0x16febc[_0x5f48('0x1b')]=_[_0x5f48('0x1a')](_0x153f06[_0x5f48('0x1b')]);_0x16febc[_0x5f48('0x1c')]=_['intersection'](_0x16febc['model'],_0x16febc[_0x5f48('0x1b')]);_0x43d774[_0x5f48('0x1e')]=_[_0x5f48('0x1d')](_0x16febc[_0x5f48('0x18')],qs[_0x5f48('0x1f')](_0x153f06['query']['fields']));_0x43d774['attributes']=_0x43d774['attributes'][_0x5f48('0x20')]?_0x43d774[_0x5f48('0x1e')]:_0x16febc['model'];if(_0x153f06['query'][_0x5f48('0x2a')]){_0x43d774['include']=[{'all':!![]}];}_0x43d774=_['merge']({},_0x43d774,_0x153f06[_0x5f48('0x29')]);return db['Dynamics365Account'][_0x5f48('0x31')](_0x43d774)['then'](handleEntityNotFound(_0x294cab,null))['then'](respondWithResult(_0x294cab,null))[_0x5f48('0x2e')](handleError(_0x294cab,null));};exports[_0x5f48('0x32')]=function(_0x3b42fa,_0x211544){return db[_0x5f48('0x15')]['create'](_0x3b42fa[_0x5f48('0x33')],{})[_0x5f48('0xf')](respondWithResult(_0x211544,0xc9))[_0x5f48('0x2e')](handleError(_0x211544,null));};exports[_0x5f48('0x34')]=function(_0x35064c,_0x1f5634){if(_0x35064c['body']['id']){delete _0x35064c['body']['id'];}return db['Dynamics365Account'][_0x5f48('0x31')]({'where':{'id':_0x35064c[_0x5f48('0x30')]['id']}})[_0x5f48('0xf')](handleEntityNotFound(_0x1f5634,null))['then'](saveUpdates(_0x35064c[_0x5f48('0x33')],null))[_0x5f48('0xf')](respondWithResult(_0x1f5634,null))[_0x5f48('0x2e')](handleError(_0x1f5634,null));};exports[_0x5f48('0x35')]=function(_0x35bfda,_0x495dcf){return db[_0x5f48('0x15')][_0x5f48('0x31')]({'where':{'id':_0x35bfda[_0x5f48('0x30')]['id']}})[_0x5f48('0xf')](handleEntityNotFound(_0x495dcf,null))['then'](removeEntity(_0x495dcf,null))[_0x5f48('0x2e')](handleError(_0x495dcf,null));};exports[_0x5f48('0x36')]=function(_0x5e86e8,_0x40bbc9){var _0x34a43e={};var _0x59d8a6={};var _0x5e3d4f;var _0x3cdab5;return db[_0x5f48('0x15')][_0x5f48('0x37')]({'where':{'id':_0x5e86e8[_0x5f48('0x30')]['id']}})[_0x5f48('0xf')](handleEntityNotFound(_0x40bbc9,null))[_0x5f48('0xf')](function(_0x4b3467){if(_0x4b3467){_0x5e3d4f=_0x4b3467;_0x59d8a6[_0x5f48('0x18')]=_[_0x5f48('0x1a')](db['Dynamics365Configuration']['rawAttributes']);_0x59d8a6[_0x5f48('0x1b')]=_[_0x5f48('0x1a')](_0x5e86e8['query']);_0x59d8a6[_0x5f48('0x1c')]=_[_0x5f48('0x1d')](_0x59d8a6[_0x5f48('0x18')],_0x59d8a6['query']);_0x34a43e[_0x5f48('0x1e')]=_[_0x5f48('0x1d')](_0x59d8a6[_0x5f48('0x18')],qs[_0x5f48('0x1f')](_0x5e86e8[_0x5f48('0x1b')][_0x5f48('0x1f')]));_0x34a43e[_0x5f48('0x1e')]=_0x34a43e['attributes'][_0x5f48('0x20')]?_0x34a43e[_0x5f48('0x1e')]:_0x59d8a6[_0x5f48('0x18')];_0x34a43e[_0x5f48('0x22')]=qs[_0x5f48('0x23')](_0x5e86e8[_0x5f48('0x1b')][_0x5f48('0x23')]);_0x34a43e[_0x5f48('0x24')]=qs[_0x5f48('0x1c')](_[_0x5f48('0x25')](_0x5e86e8[_0x5f48('0x1b')],_0x59d8a6[_0x5f48('0x1c')]));if(_0x5e86e8['query'][_0x5f48('0x26')]){_0x34a43e[_0x5f48('0x24')]=_[_0x5f48('0x27')](_0x34a43e[_0x5f48('0x24')],{'$or':_['map'](_0x34a43e['attributes'],function(_0x15cf42){var _0x44cd54={};_0x44cd54[_0x15cf42]={'$like':'%'+_0x5e86e8['query'][_0x5f48('0x26')]+'%'};return _0x44cd54;})});}_0x34a43e=_[_0x5f48('0x27')]({},_0x34a43e,_0x5e86e8[_0x5f48('0x29')]);return _0x5e3d4f[_0x5f48('0x36')](_0x34a43e);}})[_0x5f48('0xf')](function(_0xf9ab28){if(_0xf9ab28){_0x3cdab5=_0xf9ab28[_0x5f48('0x20')];if(!_0x5e86e8[_0x5f48('0x1b')][_0x5f48('0x38')](_0x5f48('0x21'))){_0x34a43e['limit']=qs['limit'](_0x5e86e8[_0x5f48('0x1b')][_0x5f48('0x9')]);_0x34a43e[_0x5f48('0xb')]=qs[_0x5f48('0xb')](_0x5e86e8[_0x5f48('0x1b')][_0x5f48('0xb')]);}return _0x5e3d4f[_0x5f48('0x36')](_0x34a43e);}})[_0x5f48('0xf')](function(_0x598a43){if(_0x598a43){return _0x598a43?{'count':_0x3cdab5,'rows':_0x598a43}:null;}})['then'](respondWithResult(_0x40bbc9,null))[_0x5f48('0x2e')](handleError(_0x40bbc9,null));};exports['addConfiguration']=function(_0x456363,_0x4bf5e4){if(_0x456363[_0x5f48('0x33')]['id']){delete _0x456363['body']['id'];}return db[_0x5f48('0x15')]['findOne']({'where':{'id':_0x456363[_0x5f48('0x30')]['id']}})['then'](handleEntityNotFound(_0x4bf5e4,null))[_0x5f48('0xf')](function(_0x307058){if(_0x307058){_0x456363[_0x5f48('0x33')][_0x5f48('0x39')]=_0x307058['id'];_0x456363[_0x5f48('0x33')][_0x5f48('0x3a')]=integrations['getSubjects'](_0x456363['body'][_0x5f48('0x3b')],_0x456363[_0x5f48('0x33')][_0x5f48('0x17')]);_0x456363[_0x5f48('0x33')][_0x5f48('0x3c')]=integrations[_0x5f48('0x3d')](_0x456363[_0x5f48('0x33')][_0x5f48('0x3b')],_0x456363['body'][_0x5f48('0x17')]);return db['Dynamics365Configuration']['create'](_0x456363[_0x5f48('0x33')],{'include':[{'model':db[_0x5f48('0x3e')],'as':_0x5f48('0x3a')},{'model':db[_0x5f48('0x3e')],'as':_0x5f48('0x3c')}]});}return null;})[_0x5f48('0xf')](respondWithResult(_0x4bf5e4,null))[_0x5f48('0x2e')](handleError(_0x4bf5e4,null));};function sanitizeRemoteUri(_0x1ac856){var _0x4e2f9c=_0x1ac856[_0x5f48('0x3f')](-0x1);if(_0x4e2f9c==='/')return _0x1ac856[_0x5f48('0x40')](0x0,_0x1ac856[_0x5f48('0x41')](_0x4e2f9c));return _0x1ac856;}function getWebApiUrl(_0x3f899a){return util[_0x5f48('0x42')](_0x5f48('0x43'),_0x3f899a);}exports[_0x5f48('0x44')]=function(_0x392394,_0x7acd4f){var _0x435d0f=_0x392394[_0x5f48('0x1b')][_0x5f48('0x45')];var _0x52842b=_0x435d0f===_0x5f48('0x46')?_0x5f48('0x47'):_0x5f48('0x48');var _0x28e4d3='';var _0xc1707e='';var _0x4de993='';var _0x3d290f='';var _0x385190='';var _0x409457='';var _0x1b8d04='';var _0x518332='';var _0x308b98=[_0x5f48('0x49'),_0x5f48('0x4a'),_0x5f48('0x4b'),'ownerid','caseorigincode',_0x5f48('0x4c'),_0x5f48('0x4d'),_0x5f48('0x4e'),_0x5f48('0x4f'),_0x5f48('0x50')];var _0x521a1d=[_0x5f48('0x51'),_0x5f48('0x52'),_0x5f48('0x53'),_0x5f48('0x54'),_0x5f48('0x55'),_0x5f48('0x56'),_0x5f48('0x57'),_0x5f48('0x58'),_0x5f48('0x59'),_0x5f48('0x5a'),_0x5f48('0x5b'),_0x5f48('0x5c'),'createdon',_0x5f48('0x5d'),_0x5f48('0x5e'),_0x5f48('0x5f'),'customeridtype','customeridyominame',_0x5f48('0x60'),_0x5f48('0x61'),_0x5f48('0x62'),_0x5f48('0x63'),_0x5f48('0x64'),_0x5f48('0x65'),_0x5f48('0x66'),'followupby',_0x5f48('0x67'),_0x5f48('0x68'),_0x5f48('0x69'),_0x5f48('0x6a'),'masteridname',_0x5f48('0x6b'),_0x5f48('0x6c'),'modifiedbyname',_0x5f48('0x6d'),_0x5f48('0x6e'),_0x5f48('0x6f'),_0x5f48('0x70'),'msdyn_incidenttypename',_0x5f48('0x71'),_0x5f48('0x72'),'onholdtime',_0x5f48('0x73'),_0x5f48('0x74'),_0x5f48('0x75'),_0x5f48('0x76'),'parentcaseidname','primarycontactidname',_0x5f48('0x77'),_0x5f48('0x78'),_0x5f48('0x79'),_0x5f48('0x7a'),_0x5f48('0x7b'),_0x5f48('0x7c'),_0x5f48('0x7d'),_0x5f48('0x7e'),_0x5f48('0x7f'),_0x5f48('0x80'),_0x5f48('0x81'),_0x5f48('0x82'),_0x5f48('0x83'),'statecode',_0x5f48('0x84'),_0x5f48('0x85'),_0x5f48('0x86'),_0x5f48('0x87'),_0x5f48('0x88'),_0x5f48('0x89'),'utcconversiontimezonecode',_0x5f48('0x8a')];var _0x1abb28=_0x308b98['concat'](_0x521a1d);return db[_0x5f48('0x15')][_0x5f48('0x37')]({'where':{'id':_0x392394['params']['id']},'attributes':['id',_0x5f48('0x8b'),'password',_0x5f48('0x8c'),'tenantId',_0x5f48('0x8d'),'clientSecret',_0x5f48('0x8e')],'include':[{'model':db[_0x5f48('0x8f')],'as':_0x5f48('0x8f'),'attributes':['id',_0x5f48('0x90'),_0x5f48('0x91')]}]})[_0x5f48('0xf')](handleEntityNotFound(_0x7acd4f,null))[_0x5f48('0xf')](function(_0x616e7e){if(_0x616e7e){if(_0x616e7e[_0x5f48('0x8e')]){_0x616e7e[_0x5f48('0x92')]=_0x616e7e[_0x5f48('0x8f')][_0x5f48('0x90')];_0x518332=sanitizeRemoteUri(_0x616e7e[_0x5f48('0x8f')][_0x5f48('0x91')]);_0x1b8d04=getWebApiUrl(_0x518332);return _0x616e7e;}_0x518332=sanitizeRemoteUri(_0x616e7e[_0x5f48('0x8c')]);_0x1b8d04=getWebApiUrl(_0x518332);var _0x1952c3={'method':_0x5f48('0x93'),'uri':_0x5f48('0x94')+_0x616e7e[_0x5f48('0x95')]+_0x5f48('0x96'),'form':{'client_id':_0x616e7e['clientId'],'resource':_0x518332,'username':_0x616e7e[_0x5f48('0x8b')],'password':_0x616e7e[_0x5f48('0x97')],'grant_type':_0x5f48('0x97'),'client_secret':_0x616e7e[_0x5f48('0x98')]},'json':!![]};return rp(_0x1952c3);}})['then'](function(_0x3e1bf3){_0x409457=_0x3e1bf3[_0x5f48('0x92')];var _0x5e7072={'method':_0x5f48('0x99'),'uri':encodeURI(_0x1b8d04+_0x5f48('0x9a')+_0x52842b+'\x27'),'headers':{'Authorization':_0x5f48('0x9b')+_0x409457,'If-None-Match':null,'OData-Version':_0x5f48('0x9c')},'json':!![]};return rp(_0x5e7072);})[_0x5f48('0xf')](function(_0x1129e8){var _0x4d8ab5=_0x1129e8[_0x5f48('0x9d')][0x0];var _0x47ba56=_0x4d8ab5[_0x5f48('0x9e')];var _0x4efe83={'method':_0x5f48('0x99'),'uri':_0x1b8d04+'EntityDefinitions('+_0x47ba56+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x5f48('0x9b')+_0x409457,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4efe83);})[_0x5f48('0xf')](function(_0x40f30e){_0x28e4d3=_0x40f30e;_0xc1707e=_0x28e4d3[_0x5f48('0x9f')];_0xc1707e=_[_0x5f48('0xa0')](_0xc1707e,function(_0x1d8626){return!_0x1abb28[_0x5f48('0xa1')](_0x1d8626[_0x5f48('0xa2')]);});var _0x480834=[];var _0xe87032=[];_0xc1707e[_0x5f48('0xa3')](function(_0xab2d6c){if(_0xab2d6c['@odata.type']){var _0x419ad8=_0xab2d6c[_0x5f48('0xa4')][_0x5f48('0x40')](_0xab2d6c[_0x5f48('0xa4')][_0x5f48('0x41')]('.')+0x1);if(_0x419ad8===_0x5f48('0xa5')){_0x480834[_0x5f48('0xa6')](getSelectList(_0x1b8d04,_0x435d0f,_0xe87032,_0x28e4d3[_0x5f48('0x9e')],_0xab2d6c[_0x5f48('0x9e')],_0x409457));}}});return Promise['all'](_0x480834);})[_0x5f48('0xf')](function(_0x2ad534){_0x4de993=_0x2ad534[0x0];var _0x3e8afc=[];var _0x173338=[];_0xc1707e[_0x5f48('0xa3')](function(_0x3ee6b5){if(!_['isNil'](_0x3ee6b5[_0x5f48('0xa4')])){var _0xc977ee=_0x3ee6b5[_0x5f48('0xa4')][_0x5f48('0x40')](_0x3ee6b5[_0x5f48('0xa4')][_0x5f48('0x41')]('.')+0x1);if(_0xc977ee===_0x5f48('0xa7')){_0x3e8afc['push'](getBooleanList(_0x1b8d04,_0x435d0f,_0x173338,_0x28e4d3['MetadataId'],_0x3ee6b5['MetadataId'],_0x409457));}}});return Promise[_0x5f48('0xa8')](_0x3e8afc);})[_0x5f48('0xf')](function(_0x38eb6f){_0x3d290f=_0x38eb6f[0x0];var _0x224980=[];var _0x396a7e=[];_0xc1707e[_0x5f48('0xa3')](function(_0x7adc1e){if(_0x7adc1e[_0x5f48('0xa4')]){var _0x2c8c8e=_0x7adc1e['@odata.type']['substring'](_0x7adc1e[_0x5f48('0xa4')][_0x5f48('0x41')]('.')+0x1);if(_0x2c8c8e===_0x5f48('0xa9')||_0x2c8c8e===_0x5f48('0xaa')||_0x2c8c8e===_0x5f48('0xab')||_0x2c8c8e===_0x5f48('0xac')||_0x2c8c8e==='MemoAttributeMetadata'||_0x2c8c8e==='DateTimeAttributeMetadata'||_0x2c8c8e===_0x5f48('0xad')||_0x2c8c8e===_0x5f48('0xae')||_0x2c8c8e==='StateAttributeMetadata'||_0x2c8c8e==='DecimalAttributeMetadata'){_0x224980['push'](getInputList(_0x1b8d04,_0x435d0f,_0x2c8c8e,_0x396a7e,_0x28e4d3[_0x5f48('0x9e')],_0x7adc1e['MetadataId'],_0x409457));}}});return Promise[_0x5f48('0xa8')](_0x224980);})[_0x5f48('0xf')](function(_0x2aca57){_0x385190=_0x2aca57[0x0];var _0xe50046=_0x4de993[_0x5f48('0xaf')](_0x3d290f)[_0x5f48('0xaf')](_0x385190);var _0x3ed3e3={'count':_0xe50046[_0x5f48('0x20')],'rows':_0xe50046};return _0x3ed3e3;})[_0x5f48('0xf')](respondWithResult(_0x7acd4f,null))[_0x5f48('0x2e')](function(_0x2e2245){var _0xc04861=_0x392394[_0x5f48('0x1b')][_0x5f48('0xb0')]?0x1f4:_0x2e2245['statusCode']||0x1f4;logger[_0x5f48('0x11')](_0x2e2245[_0x5f48('0xb1')]);delete _0x2e2245[_0x5f48('0x12')];if(_0xc04861===0x191){_0xc04861=0x190;}_0x7acd4f[_0x5f48('0xc')](_0xc04861)[_0x5f48('0x13')](_0x392394[_0x5f48('0x1b')][_0x5f48('0xb0')]?{'message':'Wrong\x20credentials','statusCode':_0x2e2245[_0x5f48('0xb2')]}:_0x2e2245);});};function getSelectList(_0x4d636f,_0x2da560,_0xf59985,_0x43710c,_0x31f8d6,_0x1fccf4){var _0x530161={'method':_0x5f48('0x99'),'uri':_0x4d636f+_0x5f48('0xb3')+_0x43710c+_0x5f48('0xb4')+_0x31f8d6+_0x5f48('0xb5')+_0x5f48('0xb6'),'headers':{'Authorization':_0x5f48('0x9b')+_0x1fccf4,'If-None-Match':null,'OData-Version':_0x5f48('0x9c')},'json':!![]};return rp(_0x530161)[_0x5f48('0xf')](function(_0x5a3b29){var _0x27b745=[];var _0x301f43=_0x5a3b29['OptionSet']['Options'];_0x301f43['forEach'](function(_0x1823bb){_0x27b745[_0x5f48('0xa6')]({'name':_0x1823bb[_0x5f48('0xb7')][_0x5f48('0xb8')][_0x5f48('0xb7')],'value':String(_0x1823bb[_0x5f48('0xb9')])});});var _0x32a2e9={'id':_0x2da560+'_'+_0x5a3b29[_0x5f48('0xa2')],'name':_0x5a3b29[_0x5f48('0xba')][_0x5f48('0xb8')]['Label'],'custom':![],'options':_0x27b745};_0xf59985[_0x5f48('0xa6')](_0x32a2e9);return _0xf59985;});}function getBooleanList(_0x1eab36,_0x5d439a,_0x4407f0,_0x341787,_0x4fc321,_0x293b2f){var _0x41c810={'method':_0x5f48('0x99'),'uri':_0x1eab36+_0x5f48('0xb3')+_0x341787+_0x5f48('0xb4')+_0x4fc321+_0x5f48('0xbb'),'headers':{'Authorization':_0x5f48('0x9b')+_0x293b2f,'If-None-Match':null,'OData-Version':_0x5f48('0x9c')},'json':!![]};return rp(_0x41c810)[_0x5f48('0xf')](function(_0x3dfa89){var _0x121f5b=[];_0x121f5b[_0x5f48('0xa6')]({'name':_0x3dfa89['OptionSet'][_0x5f48('0xbc')]['Label'][_0x5f48('0xb8')][_0x5f48('0xb7')],'value':'true'},{'name':_0x3dfa89[_0x5f48('0xbd')][_0x5f48('0xbe')][_0x5f48('0xb7')]['UserLocalizedLabel']['Label'],'value':_0x5f48('0xbf')});var _0x4eb9fe={'id':_0x5d439a+'_'+_0x3dfa89[_0x5f48('0xa2')],'name':_0x3dfa89[_0x5f48('0xba')][_0x5f48('0xb8')][_0x5f48('0xb7')],'custom':![],'options':_0x121f5b};_0x4407f0[_0x5f48('0xa6')](_0x4eb9fe);return _0x4407f0;});}function getInputList(_0xdd3df9,_0x14fbf1,_0xd9ef46,_0x52a9ff,_0x42897a,_0x2ee44f,_0x33bb00){var _0x46070a={'method':_0x5f48('0x99'),'uri':_0xdd3df9+'EntityDefinitions('+_0x42897a+_0x5f48('0xb4')+_0x2ee44f+')/Microsoft.Dynamics.CRM.'+_0xd9ef46+_0x5f48('0xc0'),'headers':{'Authorization':_0x5f48('0x9b')+_0x33bb00,'If-None-Match':null,'OData-Version':_0x5f48('0x9c')},'json':!![]};return rp(_0x46070a)[_0x5f48('0xf')](function(_0x33e5a9){var _0x5f0404={'id':_0x14fbf1+'_'+_0x33e5a9[_0x5f48('0xa2')],'name':_0x33e5a9[_0x5f48('0xba')][_0x5f48('0xb8')]?_0x33e5a9[_0x5f48('0xba')][_0x5f48('0xb8')]['Label']:_0x33e5a9[_0x5f48('0xa2')],'custom':![],'options':[]};_0x52a9ff[_0x5f48('0xa6')](_0x5f0404);return _0x52a9ff;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index da74dd1..512947f 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x5da3cb,_0x755e3b){var _0xc18c38=function(_0x1f9394){while(--_0x1f9394){_0x5da3cb['push'](_0x5da3cb['shift']());}};_0xc18c38(++_0x755e3b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index fcaad7c..b06d11e 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 _0xb7e5=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','attributes','include','map','model','GetDynamics365Account','ShowDynamics365Account','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x268420,_0x38509e){var _0x5f494d=function(_0x4f583e){while(--_0x4f583e){_0x268420['push'](_0x268420['shift']());}};_0x5f494d(++_0x38509e);}(_0xb7e5,0x66));var _0x5b7e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb7e5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5b7e('0x0'));var util=require(_0x5b7e('0x1'));var moment=require('moment');var BPromise=require(_0x5b7e('0x2'));var rs=require(_0x5b7e('0x3'));var fs=require('fs');var Redis=require(_0x5b7e('0x4'));var db=require(_0x5b7e('0x5'))['db'];var utils=require(_0x5b7e('0x6'));var logger=require('../../config/logger')(_0x5b7e('0x7'));var config=require(_0x5b7e('0x8'));var jayson=require(_0x5b7e('0x9'));var client=jayson[_0x5b7e('0xa')][_0x5b7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ca38d,_0x35ec98,_0x27fc43){return new BPromise(function(_0x58416c,_0x94bae5){return client[_0x5b7e('0xc')](_0x5ca38d,_0x27fc43)[_0x5b7e('0xd')](function(_0x171f2b){logger[_0x5b7e('0xe')](_0x5b7e('0xf'),_0x35ec98,_0x5b7e('0x10'));logger[_0x5b7e('0x11')](_0x5b7e('0x12'),_0x35ec98,_0x5b7e('0x10'),JSON[_0x5b7e('0x13')](_0x171f2b));if(_0x171f2b[_0x5b7e('0x14')]){if(_0x171f2b['error'][_0x5b7e('0x15')]===0x1f4){logger['error'](_0x5b7e('0xf'),_0x35ec98,_0x171f2b['error'][_0x5b7e('0x16')]);return _0x94bae5(_0x171f2b['error'][_0x5b7e('0x16')]);}logger[_0x5b7e('0x14')](_0x5b7e('0xf'),_0x35ec98,_0x171f2b[_0x5b7e('0x14')][_0x5b7e('0x16')]);return _0x58416c(_0x171f2b[_0x5b7e('0x14')][_0x5b7e('0x16')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x35ec98,'request\x20sent');_0x58416c(_0x171f2b[_0x5b7e('0x17')][_0x5b7e('0x16')]);}})[_0x5b7e('0x18')](function(_0x8ba639){logger['error'](_0x5b7e('0xf'),_0x35ec98,_0x8ba639);_0x94bae5(_0x8ba639);});});}exports['GetDynamics365Account']=function(_0x8f01f6){var _0x1e141b=this;return new Promise(function(_0x4a3dd7,_0x4d7dbb){return db['Dynamics365Account'][_0x5b7e('0x19')]({'raw':_0x8f01f6[_0x5b7e('0x1a')]?_0x8f01f6[_0x5b7e('0x1a')][_0x5b7e('0x1b')]===undefined?!![]:![]:!![],'where':_0x8f01f6[_0x5b7e('0x1a')]?_0x8f01f6[_0x5b7e('0x1a')]['where']||null:null,'attributes':_0x8f01f6['options']?_0x8f01f6[_0x5b7e('0x1a')][_0x5b7e('0x1c')]||null:null,'limit':_0x8f01f6['options']?_0x8f01f6[_0x5b7e('0x1a')]['limit']||null:null,'include':_0x8f01f6[_0x5b7e('0x1a')]?_0x8f01f6[_0x5b7e('0x1a')][_0x5b7e('0x1d')]?_[_0x5b7e('0x1e')](_0x8f01f6['options'][_0x5b7e('0x1d')],function(_0x25114b){return{'model':db[_0x25114b['model']],'as':_0x25114b['as'],'attributes':_0x25114b[_0x5b7e('0x1c')],'include':_0x25114b[_0x5b7e('0x1d')]?_[_0x5b7e('0x1e')](_0x25114b[_0x5b7e('0x1d')],function(_0x130413){return{'model':db[_0x130413['model']],'as':_0x130413['as'],'attributes':_0x130413[_0x5b7e('0x1c')],'include':_0x130413[_0x5b7e('0x1d')]?_[_0x5b7e('0x1e')](_0x130413[_0x5b7e('0x1d')],function(_0x184991){return{'model':db[_0x184991[_0x5b7e('0x1f')]],'as':_0x184991['as'],'attributes':_0x184991[_0x5b7e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5b7e('0xd')](function(_0x52a60a){logger[_0x5b7e('0xe')](_0x5b7e('0x20'),_0x8f01f6);logger['debug'](_0x5b7e('0x20'),_0x8f01f6,JSON[_0x5b7e('0x13')](_0x52a60a));_0x4a3dd7(_0x52a60a);})[_0x5b7e('0x18')](function(_0xfbdebe){logger[_0x5b7e('0x14')]('GetDynamics365Account',_0xfbdebe['message'],_0x8f01f6);_0x4d7dbb(_0x1e141b[_0x5b7e('0x14')](0x1f4,_0xfbdebe['message']));});});};exports[_0x5b7e('0x21')]=function(_0x1756a7){var _0x145f52=this;return new Promise(function(_0x465d5a,_0x48d963){return db['Dynamics365Account'][_0x5b7e('0x22')]({'raw':_0x1756a7[_0x5b7e('0x1a')]?_0x1756a7['options'][_0x5b7e('0x1b')]===undefined?!![]:![]:!![],'where':_0x1756a7[_0x5b7e('0x1a')]?_0x1756a7[_0x5b7e('0x1a')][_0x5b7e('0x23')]||null:null,'attributes':_0x1756a7['options']?_0x1756a7[_0x5b7e('0x1a')][_0x5b7e('0x1c')]||null:null,'include':_0x1756a7[_0x5b7e('0x1a')]?_0x1756a7[_0x5b7e('0x1a')]['include']?_[_0x5b7e('0x1e')](_0x1756a7['options'][_0x5b7e('0x1d')],function(_0x10e09a){return{'model':db[_0x10e09a[_0x5b7e('0x1f')]],'as':_0x10e09a['as'],'attributes':_0x10e09a['attributes'],'include':_0x10e09a['include']?_[_0x5b7e('0x1e')](_0x10e09a[_0x5b7e('0x1d')],function(_0xaaaf42){return{'model':db[_0xaaaf42['model']],'as':_0xaaaf42['as'],'attributes':_0xaaaf42[_0x5b7e('0x1c')],'include':_0xaaaf42[_0x5b7e('0x1d')]?_['map'](_0xaaaf42[_0x5b7e('0x1d')],function(_0x582161){return{'model':db[_0x582161[_0x5b7e('0x1f')]],'as':_0x582161['as'],'attributes':_0x582161['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dc2ed){logger['info'](_0x5b7e('0x21'),_0x1756a7);logger[_0x5b7e('0x11')](_0x5b7e('0x21'),_0x1756a7,JSON[_0x5b7e('0x13')](_0x5dc2ed));_0x465d5a(_0x5dc2ed);})[_0x5b7e('0x18')](function(_0x4fc8b3){logger[_0x5b7e('0x14')](_0x5b7e('0x21'),_0x4fc8b3[_0x5b7e('0x16')],_0x1756a7);_0x48d963(_0x145f52[_0x5b7e('0x14')](0x1f4,_0x4fc8b3['message']));});});}; \ No newline at end of file +var _0xe0b1=['lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','debug','GetDynamics365Account','find','ShowDynamics365Account'];(function(_0x1a7533,_0x195e04){var _0x5b20b2=function(_0x36f41f){while(--_0x36f41f){_0x1a7533['push'](_0x1a7533['shift']());}};_0x5b20b2(++_0x195e04);}(_0xe0b1,0x1ef));var _0x1e0b=function(_0x7767c3,_0x4825ac){_0x7767c3=_0x7767c3-0x0;var _0x1f22a1=_0xe0b1[_0x7767c3];return _0x1f22a1;};'use strict';var _=require(_0x1e0b('0x0'));var util=require(_0x1e0b('0x1'));var moment=require('moment');var BPromise=require(_0x1e0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e0b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1e0b('0x4'));var logger=require(_0x1e0b('0x5'))(_0x1e0b('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e0b('0x7'));var client=jayson['client'][_0x1e0b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5668fe,_0x217ba8,_0x1078a1){return new BPromise(function(_0x3d8f66,_0x49c15c){return client[_0x1e0b('0x9')](_0x5668fe,_0x1078a1)[_0x1e0b('0xa')](function(_0x4e5c64){logger[_0x1e0b('0xb')](_0x1e0b('0xc'),_0x217ba8,_0x1e0b('0xd'));logger['debug'](_0x1e0b('0xe'),_0x217ba8,'request\x20sent',JSON[_0x1e0b('0xf')](_0x4e5c64));if(_0x4e5c64[_0x1e0b('0x10')]){if(_0x4e5c64[_0x1e0b('0x10')]['code']===0x1f4){logger[_0x1e0b('0x10')](_0x1e0b('0xc'),_0x217ba8,_0x4e5c64['error'][_0x1e0b('0x11')]);return _0x49c15c(_0x4e5c64[_0x1e0b('0x10')][_0x1e0b('0x11')]);}logger[_0x1e0b('0x10')](_0x1e0b('0xc'),_0x217ba8,_0x4e5c64['error']['message']);return _0x3d8f66(_0x4e5c64['error'][_0x1e0b('0x11')]);}else{logger[_0x1e0b('0xb')](_0x1e0b('0xc'),_0x217ba8,_0x1e0b('0xd'));_0x3d8f66(_0x4e5c64[_0x1e0b('0x12')][_0x1e0b('0x11')]);}})[_0x1e0b('0x13')](function(_0x3fec49){logger[_0x1e0b('0x10')](_0x1e0b('0xc'),_0x217ba8,_0x3fec49);_0x49c15c(_0x3fec49);});});}exports['GetDynamics365Account']=function(_0x2fcb5f){var _0x474521=this;return new Promise(function(_0x1461ac,_0x4b616d){return db[_0x1e0b('0x14')][_0x1e0b('0x15')]({'raw':_0x2fcb5f[_0x1e0b('0x16')]?_0x2fcb5f['options'][_0x1e0b('0x17')]===undefined?!![]:![]:!![],'where':_0x2fcb5f[_0x1e0b('0x16')]?_0x2fcb5f[_0x1e0b('0x16')][_0x1e0b('0x18')]||null:null,'attributes':_0x2fcb5f[_0x1e0b('0x16')]?_0x2fcb5f[_0x1e0b('0x16')][_0x1e0b('0x19')]||null:null,'limit':_0x2fcb5f['options']?_0x2fcb5f['options']['limit']||null:null,'include':_0x2fcb5f['options']?_0x2fcb5f[_0x1e0b('0x16')][_0x1e0b('0x1a')]?_[_0x1e0b('0x1b')](_0x2fcb5f['options'][_0x1e0b('0x1a')],function(_0x1ec112){return{'model':db[_0x1ec112[_0x1e0b('0x1c')]],'as':_0x1ec112['as'],'attributes':_0x1ec112[_0x1e0b('0x19')],'include':_0x1ec112[_0x1e0b('0x1a')]?_['map'](_0x1ec112[_0x1e0b('0x1a')],function(_0x443701){return{'model':db[_0x443701['model']],'as':_0x443701['as'],'attributes':_0x443701[_0x1e0b('0x19')],'include':_0x443701[_0x1e0b('0x1a')]?_[_0x1e0b('0x1b')](_0x443701[_0x1e0b('0x1a')],function(_0x408412){return{'model':db[_0x408412[_0x1e0b('0x1c')]],'as':_0x408412['as'],'attributes':_0x408412[_0x1e0b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1e0b('0xa')](function(_0x4bcb5c){logger['info']('GetDynamics365Account',_0x2fcb5f);logger[_0x1e0b('0x1d')]('GetDynamics365Account',_0x2fcb5f,JSON[_0x1e0b('0xf')](_0x4bcb5c));_0x1461ac(_0x4bcb5c);})[_0x1e0b('0x13')](function(_0x55a617){logger['error'](_0x1e0b('0x1e'),_0x55a617[_0x1e0b('0x11')],_0x2fcb5f);_0x4b616d(_0x474521[_0x1e0b('0x10')](0x1f4,_0x55a617[_0x1e0b('0x11')]));});});};exports['ShowDynamics365Account']=function(_0xbf31ad){var _0x1be425=this;return new Promise(function(_0x5df09b,_0x5c1356){return db[_0x1e0b('0x14')][_0x1e0b('0x1f')]({'raw':_0xbf31ad[_0x1e0b('0x16')]?_0xbf31ad[_0x1e0b('0x16')][_0x1e0b('0x17')]===undefined?!![]:![]:!![],'where':_0xbf31ad[_0x1e0b('0x16')]?_0xbf31ad[_0x1e0b('0x16')][_0x1e0b('0x18')]||null:null,'attributes':_0xbf31ad[_0x1e0b('0x16')]?_0xbf31ad[_0x1e0b('0x16')][_0x1e0b('0x19')]||null:null,'include':_0xbf31ad['options']?_0xbf31ad[_0x1e0b('0x16')][_0x1e0b('0x1a')]?_[_0x1e0b('0x1b')](_0xbf31ad[_0x1e0b('0x16')]['include'],function(_0x5eec4f){return{'model':db[_0x5eec4f[_0x1e0b('0x1c')]],'as':_0x5eec4f['as'],'attributes':_0x5eec4f[_0x1e0b('0x19')],'include':_0x5eec4f['include']?_['map'](_0x5eec4f[_0x1e0b('0x1a')],function(_0x3689eb){return{'model':db[_0x3689eb['model']],'as':_0x3689eb['as'],'attributes':_0x3689eb['attributes'],'include':_0x3689eb[_0x1e0b('0x1a')]?_['map'](_0x3689eb['include'],function(_0x1710b2){return{'model':db[_0x1710b2[_0x1e0b('0x1c')]],'as':_0x1710b2['as'],'attributes':_0x1710b2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x422eca){logger[_0x1e0b('0xb')](_0x1e0b('0x20'),_0xbf31ad);logger['debug']('ShowDynamics365Account',_0xbf31ad,JSON[_0x1e0b('0xf')](_0x422eca));_0x5df09b(_0x422eca);})[_0x1e0b('0x13')](function(_0x179115){logger[_0x1e0b('0x10')](_0x1e0b('0x20'),_0x179115['message'],_0xbf31ad);_0x5c1356(_0x1be425[_0x1e0b('0x10')](0x1f4,_0x179115['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 7ee3f51..1dfa5bc 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 _0xa24a=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x90b533,_0x27f341){var _0x5cc0b5=function(_0x2fd8fb){while(--_0x2fd8fb){_0x90b533['push'](_0x90b533['shift']());}};_0x5cc0b5(++_0x27f341);}(_0xa24a,0x1a2));var _0xaa24=function(_0x44cad6,_0x17e43b){_0x44cad6=_0x44cad6-0x0;var _0x14f18e=_0xa24a[_0x44cad6];return _0x14f18e;};'use strict';var multer=require(_0xaa24('0x0'));var util=require(_0xaa24('0x1'));var path=require(_0xaa24('0x2'));var timeout=require(_0xaa24('0x3'));var express=require(_0xaa24('0x4'));var router=express[_0xaa24('0x5')]();var fs_extra=require(_0xaa24('0x6'));var auth=require(_0xaa24('0x7'));var interaction=require(_0xaa24('0x8'));var config=require(_0xaa24('0x9'));var controller=require('./intDynamics365Configuration.controller');router[_0xaa24('0xa')]('/',auth[_0xaa24('0xb')](),controller['index']);router[_0xaa24('0xa')](_0xaa24('0xc'),auth['isAuthenticated'](),controller[_0xaa24('0xd')]);router[_0xaa24('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaa24('0xe')]);router[_0xaa24('0xa')](_0xaa24('0xf'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x10')]);router[_0xaa24('0xa')](_0xaa24('0x11'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa24('0x13')]);router['put'](_0xaa24('0xc'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x14')]);router[_0xaa24('0x15')]('/:id',auth[_0xaa24('0xb')](),controller[_0xaa24('0x16')]);module[_0xaa24('0x17')]=router; \ No newline at end of file +var _0x1bfd=['/:id','/:id/fields','isAuthenticated','/:id/subjects','getSubjects','getDescriptions','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get'];(function(_0x3e4c48,_0x2ea959){var _0x2b397f=function(_0x3b6f7c){while(--_0x3b6f7c){_0x3e4c48['push'](_0x3e4c48['shift']());}};_0x2b397f(++_0x2ea959);}(_0x1bfd,0xbc));var _0xd1bf=function(_0x150829,_0x579cc8){_0x150829=_0x150829-0x0;var _0x217d3a=_0x1bfd[_0x150829];return _0x217d3a;};'use strict';var multer=require(_0xd1bf('0x0'));var util=require(_0xd1bf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd1bf('0x2'));var router=express[_0xd1bf('0x3')]();var fs_extra=require(_0xd1bf('0x4'));var auth=require(_0xd1bf('0x5'));var interaction=require(_0xd1bf('0x6'));var config=require(_0xd1bf('0x7'));var controller=require(_0xd1bf('0x8'));router[_0xd1bf('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd1bf('0x9')](_0xd1bf('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd1bf('0x9')](_0xd1bf('0xb'),auth[_0xd1bf('0xc')](),controller['getFields']);router[_0xd1bf('0x9')](_0xd1bf('0xd'),auth[_0xd1bf('0xc')](),controller[_0xd1bf('0xe')]);router[_0xd1bf('0x9')]('/:id/descriptions',auth[_0xd1bf('0xc')](),controller[_0xd1bf('0xf')]);router['post']('/',auth[_0xd1bf('0xc')](),controller[_0xd1bf('0x10')]);router[_0xd1bf('0x11')]('/:id',auth[_0xd1bf('0xc')](),controller[_0xd1bf('0x12')]);router[_0xd1bf('0x13')](_0xd1bf('0xa'),auth[_0xd1bf('0xc')](),controller[_0xd1bf('0x14')]);module[_0xd1bf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index baa5b3f..10fdf77 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 _0x4312=['ENUM','incident','contact','nothing','exports','STRING'];(function(_0x1b272e,_0x5e83a7){var _0x50b39a=function(_0x57b9bc){while(--_0x57b9bc){_0x1b272e['push'](_0x1b272e['shift']());}};_0x50b39a(++_0x5e83a7);}(_0x4312,0x7c));var _0x2431=function(_0xa8dc6d,_0x3bdfc2){_0xa8dc6d=_0xa8dc6d-0x0;var _0x141e04=_0x4312[_0xa8dc6d];return _0x141e04;};'use strict';var Sequelize=require('sequelize');module[_0x2431('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2431('0x1')]},'ticketType':{'type':Sequelize[_0x2431('0x2')](_0x2431('0x3'),'phonecall'),'defaultValue':_0x2431('0x3')},'moduleCreate':{'type':Sequelize[_0x2431('0x2')](_0x2431('0x4'),_0x2431('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x2431('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xfd73=['phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x562da1,_0x115e17){var _0x4b42d9=function(_0x745b82){while(--_0x745b82){_0x562da1['push'](_0x562da1['shift']());}};_0x4b42d9(++_0x115e17);}(_0xfd73,0x17e));var _0x3fd7=function(_0x1804b6,_0x448e23){_0x1804b6=_0x1804b6-0x0;var _0x55849e=_0xfd73[_0x1804b6];return _0x55849e;};'use strict';var Sequelize=require(_0x3fd7('0x0'));module[_0x3fd7('0x1')]={'name':{'type':Sequelize[_0x3fd7('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3fd7('0x3')](_0x3fd7('0x4'),_0x3fd7('0x5')),'defaultValue':_0x3fd7('0x4')},'moduleCreate':{'type':Sequelize[_0x3fd7('0x3')](_0x3fd7('0x6'),_0x3fd7('0x7')),'defaultValue':_0x3fd7('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x3fd7('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 5593c96..cd4e92e 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 _0x3a56=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','include','find','create','body','update','destroy','params','getFields','findOne','keys','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','save','then','end','error','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes'];(function(_0x3b0796,_0x3d5382){var _0x1bf181=function(_0x5a0654){while(--_0x5a0654){_0x3b0796['push'](_0x3b0796['shift']());}};_0x1bf181(++_0x3d5382);}(_0x3a56,0xbb));var _0x63a5=function(_0x1dd78b,_0x213fd9){_0x1dd78b=_0x1dd78b-0x0;var _0x2d9bf6=_0x3a56[_0x1dd78b];return _0x2d9bf6;};'use strict';var emlformat=require(_0x63a5('0x0'));var rimraf=require(_0x63a5('0x1'));var zipdir=require(_0x63a5('0x2'));var jsonpatch=require(_0x63a5('0x3'));var rp=require(_0x63a5('0x4'));var moment=require(_0x63a5('0x5'));var BPromise=require(_0x63a5('0x6'));var Mustache=require(_0x63a5('0x7'));var util=require(_0x63a5('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x63a5('0x9'));var ejs=require(_0x63a5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63a5('0xb'));var squel=require(_0x63a5('0xc'));var crypto=require(_0x63a5('0xd'));var jsforce=require(_0x63a5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x63a5('0x9'));var querystring=require('querystring');var Papa=require(_0x63a5('0xf'));var Redis=require(_0x63a5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x63a5('0x11'));var as=require(_0x63a5('0x12'));var hardwareService=require(_0x63a5('0x13'));var logger=require(_0x63a5('0x14'))(_0x63a5('0x15'));var utils=require(_0x63a5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x63a5('0x17'));var db=require(_0x63a5('0x18'))['db'];function respondWithStatusCode(_0x1f2898,_0xc5aeeb){_0xc5aeeb=_0xc5aeeb||0xcc;return function(_0x585a14){if(_0x585a14){return _0x1f2898[_0x63a5('0x19')](_0xc5aeeb);}return _0x1f2898[_0x63a5('0x1a')](_0xc5aeeb)['end']();};}function respondWithResult(_0x256f4e,_0x1745ab){_0x1745ab=_0x1745ab||0xc8;return function(_0x300815){if(_0x300815){return _0x256f4e[_0x63a5('0x1a')](_0x1745ab)[_0x63a5('0x1b')](_0x300815);}};}function respondWithFilteredResult(_0x1967b5,_0x30f1d6){return function(_0x24f895){if(_0x24f895){var _0x3ffaa5=typeof _0x30f1d6['offset']===_0x63a5('0x1c')&&typeof _0x30f1d6['limit']===_0x63a5('0x1c');var _0x536cd6=_0x24f895[_0x63a5('0x1d')];var _0xcbeda2=_0x3ffaa5?0x0:_0x30f1d6[_0x63a5('0x1e')];var _0x4840da=_0x3ffaa5?_0x24f895[_0x63a5('0x1d')]:_0x30f1d6['offset']+_0x30f1d6[_0x63a5('0x1f')];var _0x2b5402;if(_0x4840da>=_0x536cd6){_0x4840da=_0x536cd6;_0x2b5402=0xc8;}else{_0x2b5402=0xce;}_0x1967b5['status'](_0x2b5402);return _0x1967b5['set'](_0x63a5('0x20'),_0xcbeda2+'-'+_0x4840da+'/'+_0x536cd6)[_0x63a5('0x1b')](_0x24f895);}return null;};}function patchUpdates(_0x4551df){return function(_0x528915){try{jsonpatch['apply'](_0x528915,_0x4551df,!![]);}catch(_0xeb5619){return BPromise['reject'](_0xeb5619);}return _0x528915[_0x63a5('0x21')]();};}function saveUpdates(_0x3efffd,_0x3dfc27){return function(_0x1abde3){if(_0x1abde3){return _0x1abde3['update'](_0x3efffd)[_0x63a5('0x22')](function(_0xb30119){return _0xb30119;});}return null;};}function removeEntity(_0x4e540a,_0x12a6b5){return function(_0xdc7b44){if(_0xdc7b44){return _0xdc7b44['destroy']()[_0x63a5('0x22')](function(){_0x4e540a[_0x63a5('0x1a')](0xcc)[_0x63a5('0x23')]();});}};}function handleEntityNotFound(_0x1721e7,_0x19a059){return function(_0x4f3149){if(!_0x4f3149){_0x1721e7[_0x63a5('0x19')](0x194);}return _0x4f3149;};}function handleError(_0x264271,_0x368bd9){_0x368bd9=_0x368bd9||0x1f4;return function(_0x2f6979){logger[_0x63a5('0x24')](_0x2f6979['stack']);if(_0x2f6979['name']){delete _0x2f6979['name'];}_0x264271[_0x63a5('0x1a')](_0x368bd9)[_0x63a5('0x25')](_0x2f6979);};}exports[_0x63a5('0x26')]=function(_0x1b05b3,_0x1ee655){var _0x3ac7d4={},_0x25f7b0={},_0x5d9c23={'count':0x0,'rows':[]};var _0x3102f1=_[_0x63a5('0x27')](db[_0x63a5('0x28')][_0x63a5('0x29')],function(_0x148ace){return{'name':_0x148ace[_0x63a5('0x2a')],'type':_0x148ace['type'][_0x63a5('0x2b')]};});_0x25f7b0[_0x63a5('0x2c')]=_[_0x63a5('0x27')](_0x3102f1,_0x63a5('0x2d'));_0x25f7b0[_0x63a5('0x2e')]=_['keys'](_0x1b05b3[_0x63a5('0x2e')]);_0x25f7b0[_0x63a5('0x2f')]=_[_0x63a5('0x30')](_0x25f7b0[_0x63a5('0x2c')],_0x25f7b0[_0x63a5('0x2e')]);_0x3ac7d4[_0x63a5('0x31')]=_[_0x63a5('0x30')](_0x25f7b0[_0x63a5('0x2c')],qs[_0x63a5('0x32')](_0x1b05b3[_0x63a5('0x2e')][_0x63a5('0x32')]));_0x3ac7d4[_0x63a5('0x31')]=_0x3ac7d4[_0x63a5('0x31')][_0x63a5('0x33')]?_0x3ac7d4[_0x63a5('0x31')]:_0x25f7b0[_0x63a5('0x2c')];if(!_0x1b05b3[_0x63a5('0x2e')]['hasOwnProperty'](_0x63a5('0x34'))){_0x3ac7d4[_0x63a5('0x1f')]=qs[_0x63a5('0x1f')](_0x1b05b3['query']['limit']);_0x3ac7d4[_0x63a5('0x1e')]=qs[_0x63a5('0x1e')](_0x1b05b3[_0x63a5('0x2e')]['offset']);}_0x3ac7d4[_0x63a5('0x35')]=qs[_0x63a5('0x36')](_0x1b05b3['query'][_0x63a5('0x36')]);_0x3ac7d4[_0x63a5('0x37')]=qs[_0x63a5('0x2f')](_[_0x63a5('0x38')](_0x1b05b3[_0x63a5('0x2e')],_0x25f7b0['filters']),_0x3102f1);if(_0x1b05b3[_0x63a5('0x2e')][_0x63a5('0x39')]){_0x3ac7d4[_0x63a5('0x37')]=_[_0x63a5('0x3a')](_0x3ac7d4[_0x63a5('0x37')],{'$or':_[_0x63a5('0x27')](_0x3102f1,function(_0x5822d6){if(_0x5822d6[_0x63a5('0x3b')]!==_0x63a5('0x3c')){var _0x2635ce={};_0x2635ce[_0x5822d6['name']]={'$like':'%'+_0x1b05b3[_0x63a5('0x2e')][_0x63a5('0x39')]+'%'};return _0x2635ce;}})});}_0x3ac7d4=_[_0x63a5('0x3a')]({},_0x3ac7d4,_0x1b05b3[_0x63a5('0x3d')]);var _0x4a124a={'where':_0x3ac7d4[_0x63a5('0x37')]};return db[_0x63a5('0x28')][_0x63a5('0x1d')](_0x4a124a)['then'](function(_0x1d25b8){_0x5d9c23[_0x63a5('0x1d')]=_0x1d25b8;if(_0x1b05b3['query'][_0x63a5('0x3e')]){_0x3ac7d4['include']=[{'all':!![]}];}return db[_0x63a5('0x28')]['findAll'](_0x3ac7d4);})['then'](function(_0xe70ee7){_0x5d9c23[_0x63a5('0x3f')]=_0xe70ee7;return _0x5d9c23;})['then'](respondWithFilteredResult(_0x1ee655,_0x3ac7d4))[_0x63a5('0x40')](handleError(_0x1ee655,null));};exports['show']=function(_0x32094d,_0x360ff9){var _0x582801={'raw':![],'where':{'id':_0x32094d['params']['id']}},_0x2288ef={};_0x2288ef[_0x63a5('0x2c')]=_['keys'](db[_0x63a5('0x28')][_0x63a5('0x29')]);_0x2288ef[_0x63a5('0x2e')]=_['keys'](_0x32094d[_0x63a5('0x2e')]);_0x2288ef[_0x63a5('0x2f')]=_[_0x63a5('0x30')](_0x2288ef[_0x63a5('0x2c')],_0x2288ef[_0x63a5('0x2e')]);_0x582801[_0x63a5('0x31')]=_[_0x63a5('0x30')](_0x2288ef[_0x63a5('0x2c')],qs[_0x63a5('0x32')](_0x32094d[_0x63a5('0x2e')]['fields']));_0x582801[_0x63a5('0x31')]=_0x582801[_0x63a5('0x31')][_0x63a5('0x33')]?_0x582801[_0x63a5('0x31')]:_0x2288ef[_0x63a5('0x2c')];if(_0x32094d[_0x63a5('0x2e')]['includeAll']){_0x582801[_0x63a5('0x41')]=[{'all':!![]}];}_0x582801=_[_0x63a5('0x3a')]({},_0x582801,_0x32094d[_0x63a5('0x3d')]);return db['Dynamics365Configuration'][_0x63a5('0x42')](_0x582801)[_0x63a5('0x22')](handleEntityNotFound(_0x360ff9,null))[_0x63a5('0x22')](respondWithResult(_0x360ff9,null))[_0x63a5('0x40')](handleError(_0x360ff9,null));};exports[_0x63a5('0x43')]=function(_0x561a85,_0x4120d5){return db['Dynamics365Configuration'][_0x63a5('0x43')](_0x561a85[_0x63a5('0x44')],{})['then'](respondWithResult(_0x4120d5,0xc9))[_0x63a5('0x40')](handleError(_0x4120d5,null));};exports[_0x63a5('0x45')]=function(_0x53f527,_0xaded3d){if(_0x53f527[_0x63a5('0x44')]['id']){delete _0x53f527[_0x63a5('0x44')]['id'];}return db[_0x63a5('0x28')]['find']({'where':{'id':_0x53f527['params']['id']}})[_0x63a5('0x22')](handleEntityNotFound(_0xaded3d,null))[_0x63a5('0x22')](saveUpdates(_0x53f527[_0x63a5('0x44')],null))[_0x63a5('0x22')](respondWithResult(_0xaded3d,null))[_0x63a5('0x40')](handleError(_0xaded3d,null));};exports[_0x63a5('0x46')]=function(_0x337054,_0x317bc5){return db[_0x63a5('0x28')]['find']({'where':{'id':_0x337054[_0x63a5('0x47')]['id']}})[_0x63a5('0x22')](handleEntityNotFound(_0x317bc5,null))[_0x63a5('0x22')](removeEntity(_0x317bc5,null))['catch'](handleError(_0x317bc5,null));};exports[_0x63a5('0x48')]=function(_0x4085ea,_0x400038,_0x255082){var _0x1b8e81={};var _0x3344dc={};var _0x23d0c6;var _0x52181c;return db['Dynamics365Configuration'][_0x63a5('0x49')]({'where':{'id':_0x4085ea[_0x63a5('0x47')]['id']}})['then'](handleEntityNotFound(_0x400038,null))['then'](function(_0x242f9e){if(_0x242f9e){_0x23d0c6=_0x242f9e;_0x3344dc['model']=_[_0x63a5('0x4a')](db[_0x63a5('0x4b')][_0x63a5('0x29')]);_0x3344dc['query']=_[_0x63a5('0x4a')](_0x4085ea[_0x63a5('0x2e')]);_0x3344dc[_0x63a5('0x2f')]=_[_0x63a5('0x30')](_0x3344dc[_0x63a5('0x2c')],_0x3344dc['query']);_0x1b8e81['attributes']=_[_0x63a5('0x30')](_0x3344dc['model'],qs[_0x63a5('0x32')](_0x4085ea[_0x63a5('0x2e')][_0x63a5('0x32')]));_0x1b8e81['attributes']=_0x1b8e81[_0x63a5('0x31')][_0x63a5('0x33')]?_0x1b8e81[_0x63a5('0x31')]:_0x3344dc[_0x63a5('0x2c')];_0x1b8e81[_0x63a5('0x35')]=qs['sort'](_0x4085ea[_0x63a5('0x2e')][_0x63a5('0x36')]);_0x1b8e81[_0x63a5('0x37')]=qs[_0x63a5('0x2f')](_[_0x63a5('0x38')](_0x4085ea['query'],_0x3344dc[_0x63a5('0x2f')]));if(_0x4085ea['query'][_0x63a5('0x39')]){_0x1b8e81[_0x63a5('0x37')]=_[_0x63a5('0x3a')](_0x1b8e81[_0x63a5('0x37')],{'$or':_[_0x63a5('0x27')](_0x1b8e81[_0x63a5('0x31')],function(_0x344900){var _0x256f6c={};_0x256f6c[_0x344900]={'$like':'%'+_0x4085ea[_0x63a5('0x2e')]['filter']+'%'};return _0x256f6c;})});}_0x1b8e81=_[_0x63a5('0x3a')]({},_0x1b8e81,_0x4085ea[_0x63a5('0x3d')]);return _0x23d0c6['getFields'](_0x1b8e81);}})[_0x63a5('0x22')](function(_0x580b1e){if(_0x580b1e){_0x52181c=_0x580b1e['length'];if(!_0x4085ea['query'][_0x63a5('0x4c')]('nolimit')){_0x1b8e81[_0x63a5('0x1f')]=qs[_0x63a5('0x1f')](_0x4085ea[_0x63a5('0x2e')][_0x63a5('0x1f')]);_0x1b8e81[_0x63a5('0x1e')]=qs[_0x63a5('0x1e')](_0x4085ea['query'][_0x63a5('0x1e')]);}return _0x23d0c6[_0x63a5('0x48')](_0x1b8e81);}})[_0x63a5('0x22')](function(_0x4f5377){if(_0x4f5377){return _0x4f5377?{'count':_0x52181c,'rows':_0x4f5377}:null;}})[_0x63a5('0x22')](respondWithResult(_0x400038,null))['catch'](handleError(_0x400038,null));};exports[_0x63a5('0x4d')]=function(_0x36a43b,_0x1c1768,_0x401ee8){var _0x6e74b8={};var _0x13e3f5={};var _0x39897c;var _0x25f7ea;return db[_0x63a5('0x28')][_0x63a5('0x49')]({'where':{'id':_0x36a43b[_0x63a5('0x47')]['id']}})[_0x63a5('0x22')](handleEntityNotFound(_0x1c1768,null))[_0x63a5('0x22')](function(_0x383801){if(_0x383801){_0x39897c=_0x383801;_0x13e3f5[_0x63a5('0x2c')]=_[_0x63a5('0x4a')](db['Dynamics365Field'][_0x63a5('0x29')]);_0x13e3f5[_0x63a5('0x2e')]=_[_0x63a5('0x4a')](_0x36a43b['query']);_0x13e3f5[_0x63a5('0x2f')]=_[_0x63a5('0x30')](_0x13e3f5[_0x63a5('0x2c')],_0x13e3f5[_0x63a5('0x2e')]);_0x6e74b8[_0x63a5('0x31')]=_[_0x63a5('0x30')](_0x13e3f5[_0x63a5('0x2c')],qs[_0x63a5('0x32')](_0x36a43b[_0x63a5('0x2e')][_0x63a5('0x32')]));_0x6e74b8[_0x63a5('0x31')]=_0x6e74b8[_0x63a5('0x31')][_0x63a5('0x33')]?_0x6e74b8[_0x63a5('0x31')]:_0x13e3f5[_0x63a5('0x2c')];_0x6e74b8['order']=qs[_0x63a5('0x36')](_0x36a43b[_0x63a5('0x2e')][_0x63a5('0x36')]);_0x6e74b8['where']=qs[_0x63a5('0x2f')](_['pick'](_0x36a43b[_0x63a5('0x2e')],_0x13e3f5['filters']));if(_0x36a43b[_0x63a5('0x2e')][_0x63a5('0x39')]){_0x6e74b8[_0x63a5('0x37')]=_[_0x63a5('0x3a')](_0x6e74b8['where'],{'$or':_['map'](_0x6e74b8['attributes'],function(_0x1a380e){var _0x10eae7={};_0x10eae7[_0x1a380e]={'$like':'%'+_0x36a43b[_0x63a5('0x2e')][_0x63a5('0x39')]+'%'};return _0x10eae7;})});}_0x6e74b8=_[_0x63a5('0x3a')]({},_0x6e74b8,_0x36a43b[_0x63a5('0x3d')]);return _0x39897c[_0x63a5('0x4d')](_0x6e74b8);}})[_0x63a5('0x22')](function(_0x3082b4){if(_0x3082b4){_0x25f7ea=_0x3082b4['length'];if(!_0x36a43b['query'][_0x63a5('0x4c')]('nolimit')){_0x6e74b8[_0x63a5('0x1f')]=qs['limit'](_0x36a43b[_0x63a5('0x2e')][_0x63a5('0x1f')]);_0x6e74b8[_0x63a5('0x1e')]=qs[_0x63a5('0x1e')](_0x36a43b[_0x63a5('0x2e')][_0x63a5('0x1e')]);}return _0x39897c['getSubjects'](_0x6e74b8);}})[_0x63a5('0x22')](function(_0x458c91){if(_0x458c91){return _0x458c91?{'count':_0x25f7ea,'rows':_0x458c91}:null;}})['then'](respondWithResult(_0x1c1768,null))[_0x63a5('0x40')](handleError(_0x1c1768,null));};exports[_0x63a5('0x4e')]=function(_0x32f086,_0x281222,_0x3a6917){var _0x55e076={};var _0x25bb86={};var _0x3e8f5c;var _0x1b51b0;return db[_0x63a5('0x28')][_0x63a5('0x49')]({'where':{'id':_0x32f086[_0x63a5('0x47')]['id']}})[_0x63a5('0x22')](handleEntityNotFound(_0x281222,null))['then'](function(_0x5b8e1b){if(_0x5b8e1b){_0x3e8f5c=_0x5b8e1b;_0x25bb86['model']=_[_0x63a5('0x4a')](db[_0x63a5('0x4b')][_0x63a5('0x29')]);_0x25bb86['query']=_[_0x63a5('0x4a')](_0x32f086[_0x63a5('0x2e')]);_0x25bb86[_0x63a5('0x2f')]=_[_0x63a5('0x30')](_0x25bb86[_0x63a5('0x2c')],_0x25bb86[_0x63a5('0x2e')]);_0x55e076[_0x63a5('0x31')]=_[_0x63a5('0x30')](_0x25bb86['model'],qs['fields'](_0x32f086[_0x63a5('0x2e')]['fields']));_0x55e076[_0x63a5('0x31')]=_0x55e076[_0x63a5('0x31')][_0x63a5('0x33')]?_0x55e076[_0x63a5('0x31')]:_0x25bb86[_0x63a5('0x2c')];_0x55e076[_0x63a5('0x35')]=qs[_0x63a5('0x36')](_0x32f086[_0x63a5('0x2e')][_0x63a5('0x36')]);_0x55e076[_0x63a5('0x37')]=qs['filters'](_[_0x63a5('0x38')](_0x32f086['query'],_0x25bb86[_0x63a5('0x2f')]));if(_0x32f086[_0x63a5('0x2e')][_0x63a5('0x39')]){_0x55e076['where']=_[_0x63a5('0x3a')](_0x55e076[_0x63a5('0x37')],{'$or':_[_0x63a5('0x27')](_0x55e076[_0x63a5('0x31')],function(_0x41f9dc){var _0x1e69cc={};_0x1e69cc[_0x41f9dc]={'$like':'%'+_0x32f086[_0x63a5('0x2e')][_0x63a5('0x39')]+'%'};return _0x1e69cc;})});}_0x55e076=_[_0x63a5('0x3a')]({},_0x55e076,_0x32f086[_0x63a5('0x3d')]);return _0x3e8f5c[_0x63a5('0x4e')](_0x55e076);}})[_0x63a5('0x22')](function(_0xb04e1){if(_0xb04e1){_0x1b51b0=_0xb04e1[_0x63a5('0x33')];if(!_0x32f086['query'][_0x63a5('0x4c')](_0x63a5('0x34'))){_0x55e076[_0x63a5('0x1f')]=qs['limit'](_0x32f086[_0x63a5('0x2e')][_0x63a5('0x1f')]);_0x55e076[_0x63a5('0x1e')]=qs[_0x63a5('0x1e')](_0x32f086[_0x63a5('0x2e')][_0x63a5('0x1e')]);}return _0x3e8f5c[_0x63a5('0x4e')](_0x55e076);}})[_0x63a5('0x22')](function(_0x1fa6ca){if(_0x1fa6ca){return _0x1fa6ca?{'count':_0x1b51b0,'rows':_0x1fa6ca}:null;}})[_0x63a5('0x22')](respondWithResult(_0x281222,null))[_0x63a5('0x40')](handleError(_0x281222,null));}; \ No newline at end of file +var _0x08b3=['json','offset','undefined','count','Content-Range','apply','update','then','error','stack','name','map','Dynamics365Configuration','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','destroy','getFields','findOne','options','getSubjects','Dynamics365Field','order','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x08b3,0x1c3));var _0x308b=function(_0x13cb1b,_0x3a0771){_0x13cb1b=_0x13cb1b-0x0;var _0x2da823=_0x08b3[_0x13cb1b];return _0x2da823;};'use strict';var emlformat=require(_0x308b('0x0'));var rimraf=require(_0x308b('0x1'));var zipdir=require(_0x308b('0x2'));var jsonpatch=require(_0x308b('0x3'));var rp=require('request-promise');var moment=require(_0x308b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x308b('0x5'));var util=require(_0x308b('0x6'));var path=require(_0x308b('0x7'));var sox=require(_0x308b('0x8'));var csv=require('to-csv');var ejs=require(_0x308b('0x9'));var fs=require('fs');var fs_extra=require(_0x308b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x308b('0xb'));var jsforce=require(_0x308b('0xc'));var deskjs=require(_0x308b('0xd'));var toCsv=require(_0x308b('0xe'));var querystring=require(_0x308b('0xf'));var Papa=require(_0x308b('0x10'));var Redis=require(_0x308b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x308b('0x12'));var as=require(_0x308b('0x13'));var hardwareService=require(_0x308b('0x14'));var logger=require(_0x308b('0x15'))(_0x308b('0x16'));var utils=require('../../config/utils');var config=require(_0x308b('0x17'));var licenseUtil=require(_0x308b('0x18'));var db=require(_0x308b('0x19'))['db'];function respondWithStatusCode(_0x34d825,_0x2b82f9){_0x2b82f9=_0x2b82f9||0xcc;return function(_0x3c34b7){if(_0x3c34b7){return _0x34d825[_0x308b('0x1a')](_0x2b82f9);}return _0x34d825['status'](_0x2b82f9)[_0x308b('0x1b')]();};}function respondWithResult(_0x4d6716,_0x458775){_0x458775=_0x458775||0xc8;return function(_0x3541c4){if(_0x3541c4){return _0x4d6716[_0x308b('0x1c')](_0x458775)[_0x308b('0x1d')](_0x3541c4);}};}function respondWithFilteredResult(_0x2c7c2a,_0x4422c6){return function(_0x5f2147){if(_0x5f2147){var _0x16cda9=typeof _0x4422c6[_0x308b('0x1e')]===_0x308b('0x1f')&&typeof _0x4422c6['limit']==='undefined';var _0x30d6ac=_0x5f2147[_0x308b('0x20')];var _0x4cb161=_0x16cda9?0x0:_0x4422c6['offset'];var _0x574b44=_0x16cda9?_0x5f2147[_0x308b('0x20')]:_0x4422c6[_0x308b('0x1e')]+_0x4422c6['limit'];var _0x17fc33;if(_0x574b44>=_0x30d6ac){_0x574b44=_0x30d6ac;_0x17fc33=0xc8;}else{_0x17fc33=0xce;}_0x2c7c2a[_0x308b('0x1c')](_0x17fc33);return _0x2c7c2a['set'](_0x308b('0x21'),_0x4cb161+'-'+_0x574b44+'/'+_0x30d6ac)['json'](_0x5f2147);}return null;};}function patchUpdates(_0x631574){return function(_0x368ec1){try{jsonpatch[_0x308b('0x22')](_0x368ec1,_0x631574,!![]);}catch(_0x595d8f){return BPromise['reject'](_0x595d8f);}return _0x368ec1['save']();};}function saveUpdates(_0x163f31,_0x595024){return function(_0x37d9d6){if(_0x37d9d6){return _0x37d9d6[_0x308b('0x23')](_0x163f31)['then'](function(_0x267fd6){return _0x267fd6;});}return null;};}function removeEntity(_0x3c666c,_0x221b14){return function(_0x4328a3){if(_0x4328a3){return _0x4328a3['destroy']()[_0x308b('0x24')](function(){_0x3c666c[_0x308b('0x1c')](0xcc)[_0x308b('0x1b')]();});}};}function handleEntityNotFound(_0x4940ac,_0x332c68){return function(_0xc42e2a){if(!_0xc42e2a){_0x4940ac[_0x308b('0x1a')](0x194);}return _0xc42e2a;};}function handleError(_0x20b32b,_0x34c511){_0x34c511=_0x34c511||0x1f4;return function(_0x1a48c8){logger[_0x308b('0x25')](_0x1a48c8[_0x308b('0x26')]);if(_0x1a48c8['name']){delete _0x1a48c8[_0x308b('0x27')];}_0x20b32b['status'](_0x34c511)['send'](_0x1a48c8);};}exports['index']=function(_0x338af2,_0x558fef){var _0x106fa7={},_0x3ace04={},_0x1f5e6c={'count':0x0,'rows':[]};var _0x52468a=_[_0x308b('0x28')](db[_0x308b('0x29')][_0x308b('0x2a')],function(_0xb4bc0c){return{'name':_0xb4bc0c['fieldName'],'type':_0xb4bc0c[_0x308b('0x2b')][_0x308b('0x2c')]};});_0x3ace04[_0x308b('0x2d')]=_[_0x308b('0x28')](_0x52468a,_0x308b('0x27'));_0x3ace04[_0x308b('0x2e')]=_[_0x308b('0x2f')](_0x338af2[_0x308b('0x2e')]);_0x3ace04[_0x308b('0x30')]=_['intersection'](_0x3ace04[_0x308b('0x2d')],_0x3ace04[_0x308b('0x2e')]);_0x106fa7[_0x308b('0x31')]=_[_0x308b('0x32')](_0x3ace04[_0x308b('0x2d')],qs[_0x308b('0x33')](_0x338af2[_0x308b('0x2e')]['fields']));_0x106fa7[_0x308b('0x31')]=_0x106fa7[_0x308b('0x31')]['length']?_0x106fa7[_0x308b('0x31')]:_0x3ace04[_0x308b('0x2d')];if(!_0x338af2[_0x308b('0x2e')]['hasOwnProperty'](_0x308b('0x34'))){_0x106fa7[_0x308b('0x35')]=qs[_0x308b('0x35')](_0x338af2[_0x308b('0x2e')][_0x308b('0x35')]);_0x106fa7['offset']=qs[_0x308b('0x1e')](_0x338af2[_0x308b('0x2e')][_0x308b('0x1e')]);}_0x106fa7['order']=qs[_0x308b('0x36')](_0x338af2[_0x308b('0x2e')][_0x308b('0x36')]);_0x106fa7['where']=qs['filters'](_[_0x308b('0x37')](_0x338af2['query'],_0x3ace04['filters']),_0x52468a);if(_0x338af2[_0x308b('0x2e')][_0x308b('0x38')]){_0x106fa7[_0x308b('0x39')]=_[_0x308b('0x3a')](_0x106fa7[_0x308b('0x39')],{'$or':_[_0x308b('0x28')](_0x52468a,function(_0x2cf2a6){if(_0x2cf2a6[_0x308b('0x2b')]!==_0x308b('0x3b')){var _0x42325b={};_0x42325b[_0x2cf2a6['name']]={'$like':'%'+_0x338af2[_0x308b('0x2e')]['filter']+'%'};return _0x42325b;}})});}_0x106fa7=_[_0x308b('0x3a')]({},_0x106fa7,_0x338af2['options']);var _0x263519={'where':_0x106fa7['where']};return db[_0x308b('0x29')][_0x308b('0x20')](_0x263519)['then'](function(_0x478686){_0x1f5e6c[_0x308b('0x20')]=_0x478686;if(_0x338af2[_0x308b('0x2e')][_0x308b('0x3c')]){_0x106fa7[_0x308b('0x3d')]=[{'all':!![]}];}return db[_0x308b('0x29')][_0x308b('0x3e')](_0x106fa7);})[_0x308b('0x24')](function(_0xbd000d){_0x1f5e6c[_0x308b('0x3f')]=_0xbd000d;return _0x1f5e6c;})[_0x308b('0x24')](respondWithFilteredResult(_0x558fef,_0x106fa7))[_0x308b('0x40')](handleError(_0x558fef,null));};exports[_0x308b('0x41')]=function(_0x8d4a7,_0xd2f45b){var _0x216dde={'raw':![],'where':{'id':_0x8d4a7[_0x308b('0x42')]['id']}},_0x53cb7f={};_0x53cb7f[_0x308b('0x2d')]=_[_0x308b('0x2f')](db['Dynamics365Configuration'][_0x308b('0x2a')]);_0x53cb7f[_0x308b('0x2e')]=_[_0x308b('0x2f')](_0x8d4a7['query']);_0x53cb7f[_0x308b('0x30')]=_[_0x308b('0x32')](_0x53cb7f[_0x308b('0x2d')],_0x53cb7f[_0x308b('0x2e')]);_0x216dde[_0x308b('0x31')]=_[_0x308b('0x32')](_0x53cb7f[_0x308b('0x2d')],qs['fields'](_0x8d4a7[_0x308b('0x2e')][_0x308b('0x33')]));_0x216dde[_0x308b('0x31')]=_0x216dde[_0x308b('0x31')][_0x308b('0x43')]?_0x216dde[_0x308b('0x31')]:_0x53cb7f[_0x308b('0x2d')];if(_0x8d4a7[_0x308b('0x2e')][_0x308b('0x3c')]){_0x216dde[_0x308b('0x3d')]=[{'all':!![]}];}_0x216dde=_['merge']({},_0x216dde,_0x8d4a7['options']);return db[_0x308b('0x29')]['find'](_0x216dde)[_0x308b('0x24')](handleEntityNotFound(_0xd2f45b,null))[_0x308b('0x24')](respondWithResult(_0xd2f45b,null))[_0x308b('0x40')](handleError(_0xd2f45b,null));};exports[_0x308b('0x44')]=function(_0x1dafa9,_0x55119e){return db[_0x308b('0x29')][_0x308b('0x44')](_0x1dafa9[_0x308b('0x45')],{})['then'](respondWithResult(_0x55119e,0xc9))[_0x308b('0x40')](handleError(_0x55119e,null));};exports['update']=function(_0x307602,_0x2c4dbc){if(_0x307602[_0x308b('0x45')]['id']){delete _0x307602[_0x308b('0x45')]['id'];}return db[_0x308b('0x29')][_0x308b('0x46')]({'where':{'id':_0x307602[_0x308b('0x42')]['id']}})[_0x308b('0x24')](handleEntityNotFound(_0x2c4dbc,null))['then'](saveUpdates(_0x307602['body'],null))['then'](respondWithResult(_0x2c4dbc,null))[_0x308b('0x40')](handleError(_0x2c4dbc,null));};exports[_0x308b('0x47')]=function(_0xb86301,_0x132121){return db[_0x308b('0x29')][_0x308b('0x46')]({'where':{'id':_0xb86301['params']['id']}})[_0x308b('0x24')](handleEntityNotFound(_0x132121,null))[_0x308b('0x24')](removeEntity(_0x132121,null))['catch'](handleError(_0x132121,null));};exports[_0x308b('0x48')]=function(_0x157506,_0x278157,_0x18fdab){var _0x38d57a={};var _0xb96f7={};var _0x296532;var _0x590442;return db[_0x308b('0x29')][_0x308b('0x49')]({'where':{'id':_0x157506['params']['id']}})[_0x308b('0x24')](handleEntityNotFound(_0x278157,null))['then'](function(_0x58b21c){if(_0x58b21c){_0x296532=_0x58b21c;_0xb96f7['model']=_['keys'](db['Dynamics365Field'][_0x308b('0x2a')]);_0xb96f7[_0x308b('0x2e')]=_[_0x308b('0x2f')](_0x157506[_0x308b('0x2e')]);_0xb96f7[_0x308b('0x30')]=_[_0x308b('0x32')](_0xb96f7[_0x308b('0x2d')],_0xb96f7[_0x308b('0x2e')]);_0x38d57a[_0x308b('0x31')]=_['intersection'](_0xb96f7['model'],qs['fields'](_0x157506['query'][_0x308b('0x33')]));_0x38d57a[_0x308b('0x31')]=_0x38d57a['attributes'][_0x308b('0x43')]?_0x38d57a['attributes']:_0xb96f7[_0x308b('0x2d')];_0x38d57a['order']=qs[_0x308b('0x36')](_0x157506['query'][_0x308b('0x36')]);_0x38d57a[_0x308b('0x39')]=qs['filters'](_[_0x308b('0x37')](_0x157506[_0x308b('0x2e')],_0xb96f7[_0x308b('0x30')]));if(_0x157506[_0x308b('0x2e')][_0x308b('0x38')]){_0x38d57a['where']=_[_0x308b('0x3a')](_0x38d57a[_0x308b('0x39')],{'$or':_[_0x308b('0x28')](_0x38d57a[_0x308b('0x31')],function(_0x4b8dc8){var _0x1560e2={};_0x1560e2[_0x4b8dc8]={'$like':'%'+_0x157506[_0x308b('0x2e')]['filter']+'%'};return _0x1560e2;})});}_0x38d57a=_[_0x308b('0x3a')]({},_0x38d57a,_0x157506[_0x308b('0x4a')]);return _0x296532[_0x308b('0x48')](_0x38d57a);}})[_0x308b('0x24')](function(_0x323529){if(_0x323529){_0x590442=_0x323529[_0x308b('0x43')];if(!_0x157506[_0x308b('0x2e')]['hasOwnProperty'](_0x308b('0x34'))){_0x38d57a[_0x308b('0x35')]=qs[_0x308b('0x35')](_0x157506[_0x308b('0x2e')][_0x308b('0x35')]);_0x38d57a[_0x308b('0x1e')]=qs[_0x308b('0x1e')](_0x157506['query'][_0x308b('0x1e')]);}return _0x296532[_0x308b('0x48')](_0x38d57a);}})[_0x308b('0x24')](function(_0x1a4688){if(_0x1a4688){return _0x1a4688?{'count':_0x590442,'rows':_0x1a4688}:null;}})[_0x308b('0x24')](respondWithResult(_0x278157,null))[_0x308b('0x40')](handleError(_0x278157,null));};exports[_0x308b('0x4b')]=function(_0x33d19d,_0x606cbd,_0x592a78){var _0x529c4f={};var _0x434c32={};var _0x33d95d;var _0x10d6c4;return db[_0x308b('0x29')][_0x308b('0x49')]({'where':{'id':_0x33d19d[_0x308b('0x42')]['id']}})['then'](handleEntityNotFound(_0x606cbd,null))[_0x308b('0x24')](function(_0x27dbf1){if(_0x27dbf1){_0x33d95d=_0x27dbf1;_0x434c32[_0x308b('0x2d')]=_[_0x308b('0x2f')](db[_0x308b('0x4c')][_0x308b('0x2a')]);_0x434c32[_0x308b('0x2e')]=_[_0x308b('0x2f')](_0x33d19d[_0x308b('0x2e')]);_0x434c32[_0x308b('0x30')]=_[_0x308b('0x32')](_0x434c32[_0x308b('0x2d')],_0x434c32[_0x308b('0x2e')]);_0x529c4f['attributes']=_['intersection'](_0x434c32['model'],qs[_0x308b('0x33')](_0x33d19d[_0x308b('0x2e')][_0x308b('0x33')]));_0x529c4f['attributes']=_0x529c4f[_0x308b('0x31')][_0x308b('0x43')]?_0x529c4f[_0x308b('0x31')]:_0x434c32[_0x308b('0x2d')];_0x529c4f[_0x308b('0x4d')]=qs['sort'](_0x33d19d['query'][_0x308b('0x36')]);_0x529c4f[_0x308b('0x39')]=qs['filters'](_[_0x308b('0x37')](_0x33d19d['query'],_0x434c32[_0x308b('0x30')]));if(_0x33d19d[_0x308b('0x2e')][_0x308b('0x38')]){_0x529c4f[_0x308b('0x39')]=_[_0x308b('0x3a')](_0x529c4f['where'],{'$or':_[_0x308b('0x28')](_0x529c4f['attributes'],function(_0x44a062){var _0x5398b8={};_0x5398b8[_0x44a062]={'$like':'%'+_0x33d19d[_0x308b('0x2e')][_0x308b('0x38')]+'%'};return _0x5398b8;})});}_0x529c4f=_[_0x308b('0x3a')]({},_0x529c4f,_0x33d19d[_0x308b('0x4a')]);return _0x33d95d[_0x308b('0x4b')](_0x529c4f);}})[_0x308b('0x24')](function(_0x37b4cb){if(_0x37b4cb){_0x10d6c4=_0x37b4cb['length'];if(!_0x33d19d[_0x308b('0x2e')][_0x308b('0x4e')](_0x308b('0x34'))){_0x529c4f['limit']=qs['limit'](_0x33d19d[_0x308b('0x2e')][_0x308b('0x35')]);_0x529c4f[_0x308b('0x1e')]=qs[_0x308b('0x1e')](_0x33d19d[_0x308b('0x2e')][_0x308b('0x1e')]);}return _0x33d95d['getSubjects'](_0x529c4f);}})[_0x308b('0x24')](function(_0x135fea){if(_0x135fea){return _0x135fea?{'count':_0x10d6c4,'rows':_0x135fea}:null;}})[_0x308b('0x24')](respondWithResult(_0x606cbd,null))[_0x308b('0x40')](handleError(_0x606cbd,null));};exports[_0x308b('0x4f')]=function(_0x488597,_0x2b4e6e,_0x599a7f){var _0x5105e7={};var _0x27ea4e={};var _0x3252e1;var _0x20c455;return db[_0x308b('0x29')]['findOne']({'where':{'id':_0x488597[_0x308b('0x42')]['id']}})[_0x308b('0x24')](handleEntityNotFound(_0x2b4e6e,null))['then'](function(_0x2b9d89){if(_0x2b9d89){_0x3252e1=_0x2b9d89;_0x27ea4e['model']=_[_0x308b('0x2f')](db['Dynamics365Field'][_0x308b('0x2a')]);_0x27ea4e[_0x308b('0x2e')]=_[_0x308b('0x2f')](_0x488597[_0x308b('0x2e')]);_0x27ea4e['filters']=_[_0x308b('0x32')](_0x27ea4e[_0x308b('0x2d')],_0x27ea4e[_0x308b('0x2e')]);_0x5105e7[_0x308b('0x31')]=_[_0x308b('0x32')](_0x27ea4e[_0x308b('0x2d')],qs[_0x308b('0x33')](_0x488597[_0x308b('0x2e')][_0x308b('0x33')]));_0x5105e7[_0x308b('0x31')]=_0x5105e7['attributes'][_0x308b('0x43')]?_0x5105e7[_0x308b('0x31')]:_0x27ea4e[_0x308b('0x2d')];_0x5105e7[_0x308b('0x4d')]=qs[_0x308b('0x36')](_0x488597[_0x308b('0x2e')][_0x308b('0x36')]);_0x5105e7[_0x308b('0x39')]=qs[_0x308b('0x30')](_[_0x308b('0x37')](_0x488597[_0x308b('0x2e')],_0x27ea4e[_0x308b('0x30')]));if(_0x488597[_0x308b('0x2e')]['filter']){_0x5105e7[_0x308b('0x39')]=_[_0x308b('0x3a')](_0x5105e7[_0x308b('0x39')],{'$or':_[_0x308b('0x28')](_0x5105e7[_0x308b('0x31')],function(_0x11bdd2){var _0x5bf817={};_0x5bf817[_0x11bdd2]={'$like':'%'+_0x488597['query']['filter']+'%'};return _0x5bf817;})});}_0x5105e7=_['merge']({},_0x5105e7,_0x488597['options']);return _0x3252e1['getDescriptions'](_0x5105e7);}})['then'](function(_0x1103a6){if(_0x1103a6){_0x20c455=_0x1103a6[_0x308b('0x43')];if(!_0x488597[_0x308b('0x2e')]['hasOwnProperty']('nolimit')){_0x5105e7[_0x308b('0x35')]=qs['limit'](_0x488597[_0x308b('0x2e')][_0x308b('0x35')]);_0x5105e7[_0x308b('0x1e')]=qs['offset'](_0x488597[_0x308b('0x2e')][_0x308b('0x1e')]);}return _0x3252e1[_0x308b('0x4f')](_0x5105e7);}})['then'](function(_0x749322){if(_0x749322){return _0x749322?{'count':_0x20c455,'rows':_0x749322}:null;}})[_0x308b('0x24')](respondWithResult(_0x2b4e6e,null))[_0x308b('0x40')](handleError(_0x2b4e6e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 4ae4000..7df71ae 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x33a0f8,_0x3028f){var _0x211150=function(_0x5cc327){while(--_0x5cc327){_0x33a0f8['push'](_0x33a0f8['shift']());}};_0x211150(++_0x3028f);}(_0x9f62,0x154));var _0x29f6=function(_0x383897,_0x208a24){_0x383897=_0x383897-0x0;var _0x52fd10=_0x9f62[_0x383897];return _0x52fd10;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x3e74,0x175));var _0x43e7=function(_0x4c7bf5,_0x5a8d1a){_0x4c7bf5=_0x4c7bf5-0x0;var _0xf0c37b=_0x3e74[_0x4c7bf5];return _0xf0c37b;};'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/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 5eab576..5543a9c 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 _0xa15a=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent'];(function(_0x4c530b,_0x518d99){var _0x5f5d62=function(_0x5e809a){while(--_0x5e809a){_0x4c530b['push'](_0x4c530b['shift']());}};_0x5f5d62(++_0x518d99);}(_0xa15a,0x102));var _0xaa15=function(_0x201de9,_0x1f5ae1){_0x201de9=_0x201de9-0x0;var _0x1c6c96=_0xa15a[_0x201de9];return _0x1c6c96;};'use strict';var _=require('lodash');var util=require(_0xaa15('0x0'));var moment=require(_0xaa15('0x1'));var BPromise=require(_0xaa15('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa15('0x3'));var db=require(_0xaa15('0x4'))['db'];var utils=require(_0xaa15('0x5'));var logger=require('../../config/logger')(_0xaa15('0x6'));var config=require(_0xaa15('0x7'));var jayson=require(_0xaa15('0x8'));var client=jayson[_0xaa15('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f2a8f,_0x472052,_0x24cc0e){return new BPromise(function(_0x541df8,_0x33c059){return client[_0xaa15('0xa')](_0x2f2a8f,_0x24cc0e)[_0xaa15('0xb')](function(_0x272000){logger[_0xaa15('0xc')](_0xaa15('0xd'),_0x472052,_0xaa15('0xe'));logger[_0xaa15('0xf')](_0xaa15('0x10'),_0x472052,_0xaa15('0xe'),JSON['stringify'](_0x272000));if(_0x272000[_0xaa15('0x11')]){if(_0x272000[_0xaa15('0x11')]['code']===0x1f4){logger[_0xaa15('0x11')](_0xaa15('0xd'),_0x472052,_0x272000[_0xaa15('0x11')][_0xaa15('0x12')]);return _0x33c059(_0x272000[_0xaa15('0x11')][_0xaa15('0x12')]);}logger[_0xaa15('0x11')](_0xaa15('0xd'),_0x472052,_0x272000[_0xaa15('0x11')][_0xaa15('0x12')]);return _0x541df8(_0x272000[_0xaa15('0x11')]['message']);}else{logger[_0xaa15('0xc')](_0xaa15('0xd'),_0x472052,_0xaa15('0xe'));_0x541df8(_0x272000[_0xaa15('0x13')][_0xaa15('0x12')]);}})[_0xaa15('0x14')](function(_0x2090d2){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x472052,_0x2090d2);_0x33c059(_0x2090d2);});});} \ No newline at end of file +var _0x6312=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x442f57,_0x1b24bd){var _0x55c454=function(_0x4f6edd){while(--_0x4f6edd){_0x442f57['push'](_0x442f57['shift']());}};_0x55c454(++_0x1b24bd);}(_0x6312,0x104));var _0x2631=function(_0x48e904,_0x441161){_0x48e904=_0x48e904-0x0;var _0x1b7fb3=_0x6312[_0x48e904];return _0x1b7fb3;};'use strict';var _=require(_0x2631('0x0'));var util=require(_0x2631('0x1'));var moment=require(_0x2631('0x2'));var BPromise=require(_0x2631('0x3'));var rs=require(_0x2631('0x4'));var fs=require('fs');var Redis=require(_0x2631('0x5'));var db=require(_0x2631('0x6'))['db'];var utils=require(_0x2631('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2631('0x8'));var jayson=require(_0x2631('0x9'));var client=jayson[_0x2631('0xa')][_0x2631('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5248dd,_0x482167,_0xe1945f){return new BPromise(function(_0x56c49,_0x4e2fd7){return client[_0x2631('0xc')](_0x5248dd,_0xe1945f)[_0x2631('0xd')](function(_0x2b2cf1){logger[_0x2631('0xe')](_0x2631('0xf'),_0x482167,_0x2631('0x10'));logger[_0x2631('0x11')](_0x2631('0x12'),_0x482167,'request\x20sent',JSON[_0x2631('0x13')](_0x2b2cf1));if(_0x2b2cf1[_0x2631('0x14')]){if(_0x2b2cf1[_0x2631('0x14')]['code']===0x1f4){logger[_0x2631('0x14')](_0x2631('0xf'),_0x482167,_0x2b2cf1['error']['message']);return _0x4e2fd7(_0x2b2cf1['error']['message']);}logger[_0x2631('0x14')](_0x2631('0xf'),_0x482167,_0x2b2cf1[_0x2631('0x14')][_0x2631('0x15')]);return _0x56c49(_0x2b2cf1['error']['message']);}else{logger[_0x2631('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x482167,'request\x20sent');_0x56c49(_0x2b2cf1[_0x2631('0x16')][_0x2631('0x15')]);}})[_0x2631('0x17')](function(_0x186bcc){logger[_0x2631('0x14')](_0x2631('0xf'),_0x482167,_0x186bcc);_0x4e2fd7(_0x186bcc);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index f81f577..bd02f91 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 _0xda37=['index','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4a0d73,_0x3e5319){var _0x13e211=function(_0xfdaa5f){while(--_0xfdaa5f){_0x4a0d73['push'](_0x4a0d73['shift']());}};_0x13e211(++_0x3e5319);}(_0xda37,0xff));var _0x7da3=function(_0x1747ea,_0x5e72f9){_0x1747ea=_0x1747ea-0x0;var _0x63a130=_0xda37[_0x1747ea];return _0x63a130;};'use strict';var multer=require(_0x7da3('0x0'));var util=require(_0x7da3('0x1'));var path=require(_0x7da3('0x2'));var timeout=require(_0x7da3('0x3'));var express=require(_0x7da3('0x4'));var router=express[_0x7da3('0x5')]();var fs_extra=require(_0x7da3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7da3('0x7'));var config=require(_0x7da3('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x7da3('0x9')]('/',auth[_0x7da3('0xa')](),controller[_0x7da3('0xb')]);router[_0x7da3('0x9')]('/:id',auth[_0x7da3('0xa')](),controller['show']);router[_0x7da3('0xc')]('/',auth[_0x7da3('0xa')](),controller[_0x7da3('0xd')]);router[_0x7da3('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7da3('0xf')]);router[_0x7da3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7da3('0x11')]);module[_0x7da3('0x12')]=router; \ No newline at end of file +var _0x5dbd=['get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','index'];(function(_0x2461c2,_0x2c7fbf){var _0x5a0873=function(_0x34041e){while(--_0x34041e){_0x2461c2['push'](_0x2461c2['shift']());}};_0x5a0873(++_0x2c7fbf);}(_0x5dbd,0xb2));var _0xd5db=function(_0x31176b,_0x332008){_0x31176b=_0x31176b-0x0;var _0x1048df=_0x5dbd[_0x31176b];return _0x1048df;};'use strict';var multer=require(_0xd5db('0x0'));var util=require(_0xd5db('0x1'));var path=require(_0xd5db('0x2'));var timeout=require(_0xd5db('0x3'));var express=require('express');var router=express[_0xd5db('0x4')]();var fs_extra=require(_0xd5db('0x5'));var auth=require(_0xd5db('0x6'));var interaction=require(_0xd5db('0x7'));var config=require('../../config/environment');var controller=require(_0xd5db('0x8'));router['get']('/',auth[_0xd5db('0x9')](),controller[_0xd5db('0xa')]);router[_0xd5db('0xb')](_0xd5db('0xc'),auth[_0xd5db('0x9')](),controller[_0xd5db('0xd')]);router[_0xd5db('0xe')]('/',auth[_0xd5db('0x9')](),controller[_0xd5db('0xf')]);router[_0xd5db('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd5db('0x11')]);router[_0xd5db('0x12')](_0xd5db('0xc'),auth[_0xd5db('0x9')](),controller[_0xd5db('0x13')]);module[_0xd5db('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 42c6efd..20ae792 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 _0x9e8c=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9e8c,0x127));var _0xc9e8=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x9e8c[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require('sequelize');module[_0xc9e8('0x0')]={'type':{'type':Sequelize[_0xc9e8('0x1')](_0xc9e8('0x2'),_0xc9e8('0x3'),_0xc9e8('0x4'),_0xc9e8('0x5'),_0xc9e8('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc9e8('0x7')]},'keyType':{'type':Sequelize[_0xc9e8('0x1')](_0xc9e8('0x2'),_0xc9e8('0x3'),_0xc9e8('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc9e8('0x7')]}}; \ No newline at end of file +var _0x7370=['exports','ENUM','string','variable','customVariable','picklist','STRING','sequelize'];(function(_0x3feeb8,_0x183f4f){var _0x53add6=function(_0x2f6179){while(--_0x2f6179){_0x3feeb8['push'](_0x3feeb8['shift']());}};_0x53add6(++_0x183f4f);}(_0x7370,0x1e7));var _0x0737=function(_0x19d7bf,_0x265436){_0x19d7bf=_0x19d7bf-0x0;var _0x46494c=_0x7370[_0x19d7bf];return _0x46494c;};'use strict';var Sequelize=require(_0x0737('0x0'));module[_0x0737('0x1')]={'type':{'type':Sequelize[_0x0737('0x2')](_0x0737('0x3'),_0x0737('0x4'),_0x0737('0x5'),'keyValue',_0x0737('0x6')),'defaultValue':_0x0737('0x3')},'content':{'type':Sequelize[_0x0737('0x7')]},'key':{'type':Sequelize[_0x0737('0x7')]},'keyType':{'type':Sequelize[_0x0737('0x2')](_0x0737('0x3'),'variable',_0x0737('0x5'))},'keyContent':{'type':Sequelize[_0x0737('0x7')]},'idField':{'type':Sequelize[_0x0737('0x7')]},'nameField':{'type':Sequelize[_0x0737('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0737('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 9e92151..4ac5d5b 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 _0x49a2=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','then','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','keys','includeAll','create','body','update','find','destroy','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel'];(function(_0x3353b8,_0x200ba5){var _0x365e87=function(_0x34d89a){while(--_0x34d89a){_0x3353b8['push'](_0x3353b8['shift']());}};_0x365e87(++_0x200ba5);}(_0x49a2,0x150));var _0x249a=function(_0xbb0ce8,_0xb63549){_0xbb0ce8=_0xbb0ce8-0x0;var _0x1a1b17=_0x49a2[_0xbb0ce8];return _0x1a1b17;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x249a('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x249a('0x1'));var Mustache=require(_0x249a('0x2'));var util=require(_0x249a('0x3'));var path=require('path');var sox=require(_0x249a('0x4'));var csv=require(_0x249a('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x249a('0x6'));var _=require(_0x249a('0x7'));var squel=require(_0x249a('0x8'));var crypto=require(_0x249a('0x9'));var jsforce=require(_0x249a('0xa'));var deskjs=require(_0x249a('0xb'));var toCsv=require(_0x249a('0x5'));var querystring=require('querystring');var Papa=require(_0x249a('0xc'));var Redis=require('ioredis');var authService=require(_0x249a('0xd'));var qs=require(_0x249a('0xe'));var as=require(_0x249a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x249a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x249a('0x11'));var db=require(_0x249a('0x12'))['db'];function respondWithStatusCode(_0x1ab2e4,_0x1f4820){_0x1f4820=_0x1f4820||0xcc;return function(_0x455836){if(_0x455836){return _0x1ab2e4[_0x249a('0x13')](_0x1f4820);}return _0x1ab2e4[_0x249a('0x14')](_0x1f4820)[_0x249a('0x15')]();};}function respondWithResult(_0x3a9773,_0xf46cb6){_0xf46cb6=_0xf46cb6||0xc8;return function(_0x4e4a46){if(_0x4e4a46){return _0x3a9773['status'](_0xf46cb6)['json'](_0x4e4a46);}};}function respondWithFilteredResult(_0x14c487,_0x1c6485){return function(_0xeb6f8c){if(_0xeb6f8c){var _0x365e6e=typeof _0x1c6485[_0x249a('0x16')]===_0x249a('0x17')&&typeof _0x1c6485['limit']==='undefined';var _0x1248c2=_0xeb6f8c[_0x249a('0x18')];var _0x29da74=_0x365e6e?0x0:_0x1c6485[_0x249a('0x16')];var _0x3c7a63=_0x365e6e?_0xeb6f8c['count']:_0x1c6485[_0x249a('0x16')]+_0x1c6485['limit'];var _0x41b807;if(_0x3c7a63>=_0x1248c2){_0x3c7a63=_0x1248c2;_0x41b807=0xc8;}else{_0x41b807=0xce;}_0x14c487[_0x249a('0x14')](_0x41b807);return _0x14c487[_0x249a('0x19')](_0x249a('0x1a'),_0x29da74+'-'+_0x3c7a63+'/'+_0x1248c2)[_0x249a('0x1b')](_0xeb6f8c);}return null;};}function patchUpdates(_0x5df979){return function(_0x12bf6e){try{jsonpatch[_0x249a('0x1c')](_0x12bf6e,_0x5df979,!![]);}catch(_0x5a9068){return BPromise[_0x249a('0x1d')](_0x5a9068);}return _0x12bf6e[_0x249a('0x1e')]();};}function saveUpdates(_0x384a97,_0xe47b87){return function(_0x1bc1e1){if(_0x1bc1e1){return _0x1bc1e1['update'](_0x384a97)[_0x249a('0x1f')](function(_0x2fd489){return _0x2fd489;});}return null;};}function removeEntity(_0x8e9c65,_0x2fab6d){return function(_0x4d4ce5){if(_0x4d4ce5){return _0x4d4ce5['destroy']()[_0x249a('0x1f')](function(){_0x8e9c65[_0x249a('0x14')](0xcc)[_0x249a('0x15')]();});}};}function handleEntityNotFound(_0x537ec3,_0x278812){return function(_0x33bf05){if(!_0x33bf05){_0x537ec3['sendStatus'](0x194);}return _0x33bf05;};}function handleError(_0x399841,_0x5c5bed){_0x5c5bed=_0x5c5bed||0x1f4;return function(_0x1a01ed){logger['error'](_0x1a01ed['stack']);if(_0x1a01ed[_0x249a('0x20')]){delete _0x1a01ed[_0x249a('0x20')];}_0x399841[_0x249a('0x14')](_0x5c5bed)[_0x249a('0x21')](_0x1a01ed);};}exports[_0x249a('0x22')]=function(_0x4027c7,_0x4e0a47){var _0x4a0737={},_0x433ccd={},_0x2a1adc={'count':0x0,'rows':[]};var _0x8c86fb=_['map'](db[_0x249a('0x23')][_0x249a('0x24')],function(_0x57548c){return{'name':_0x57548c[_0x249a('0x25')],'type':_0x57548c[_0x249a('0x26')][_0x249a('0x27')]};});_0x433ccd[_0x249a('0x28')]=_[_0x249a('0x29')](_0x8c86fb,_0x249a('0x20'));_0x433ccd[_0x249a('0x2a')]=_['keys'](_0x4027c7[_0x249a('0x2a')]);_0x433ccd[_0x249a('0x2b')]=_[_0x249a('0x2c')](_0x433ccd['model'],_0x433ccd[_0x249a('0x2a')]);_0x4a0737['attributes']=_[_0x249a('0x2c')](_0x433ccd['model'],qs[_0x249a('0x2d')](_0x4027c7[_0x249a('0x2a')][_0x249a('0x2d')]));_0x4a0737[_0x249a('0x2e')]=_0x4a0737[_0x249a('0x2e')][_0x249a('0x2f')]?_0x4a0737[_0x249a('0x2e')]:_0x433ccd[_0x249a('0x28')];if(!_0x4027c7[_0x249a('0x2a')]['hasOwnProperty'](_0x249a('0x30'))){_0x4a0737[_0x249a('0x31')]=qs['limit'](_0x4027c7[_0x249a('0x2a')][_0x249a('0x31')]);_0x4a0737['offset']=qs['offset'](_0x4027c7[_0x249a('0x2a')][_0x249a('0x16')]);}_0x4a0737[_0x249a('0x32')]=qs[_0x249a('0x33')](_0x4027c7[_0x249a('0x2a')]['sort']);_0x4a0737[_0x249a('0x34')]=qs['filters'](_[_0x249a('0x35')](_0x4027c7['query'],_0x433ccd[_0x249a('0x2b')]),_0x8c86fb);if(_0x4027c7[_0x249a('0x2a')][_0x249a('0x36')]){_0x4a0737[_0x249a('0x34')]=_[_0x249a('0x37')](_0x4a0737[_0x249a('0x34')],{'$or':_[_0x249a('0x29')](_0x8c86fb,function(_0x5d3ab0){if(_0x5d3ab0[_0x249a('0x26')]!==_0x249a('0x38')){var _0x10165d={};_0x10165d[_0x5d3ab0[_0x249a('0x20')]]={'$like':'%'+_0x4027c7[_0x249a('0x2a')][_0x249a('0x36')]+'%'};return _0x10165d;}})});}_0x4a0737=_[_0x249a('0x37')]({},_0x4a0737,_0x4027c7[_0x249a('0x39')]);var _0x5bcddb={'where':_0x4a0737[_0x249a('0x34')]};return db[_0x249a('0x23')][_0x249a('0x18')](_0x5bcddb)[_0x249a('0x1f')](function(_0xc2f8e){_0x2a1adc[_0x249a('0x18')]=_0xc2f8e;if(_0x4027c7[_0x249a('0x2a')]['includeAll']){_0x4a0737[_0x249a('0x3a')]=[{'all':!![]}];}return db[_0x249a('0x23')]['findAll'](_0x4a0737);})[_0x249a('0x1f')](function(_0x52dba6){_0x2a1adc[_0x249a('0x3b')]=_0x52dba6;return _0x2a1adc;})[_0x249a('0x1f')](respondWithFilteredResult(_0x4e0a47,_0x4a0737))[_0x249a('0x3c')](handleError(_0x4e0a47,null));};exports['show']=function(_0x1c1987,_0x4ad8cd){var _0x43f785={'raw':!![],'where':{'id':_0x1c1987[_0x249a('0x3d')]['id']}},_0x18f3bb={};_0x18f3bb[_0x249a('0x28')]=_[_0x249a('0x3e')](db[_0x249a('0x23')][_0x249a('0x24')]);_0x18f3bb[_0x249a('0x2a')]=_[_0x249a('0x3e')](_0x1c1987[_0x249a('0x2a')]);_0x18f3bb[_0x249a('0x2b')]=_[_0x249a('0x2c')](_0x18f3bb[_0x249a('0x28')],_0x18f3bb['query']);_0x43f785[_0x249a('0x2e')]=_['intersection'](_0x18f3bb['model'],qs['fields'](_0x1c1987[_0x249a('0x2a')][_0x249a('0x2d')]));_0x43f785[_0x249a('0x2e')]=_0x43f785[_0x249a('0x2e')]['length']?_0x43f785[_0x249a('0x2e')]:_0x18f3bb[_0x249a('0x28')];if(_0x1c1987[_0x249a('0x2a')][_0x249a('0x3f')]){_0x43f785[_0x249a('0x3a')]=[{'all':!![]}];}_0x43f785=_[_0x249a('0x37')]({},_0x43f785,_0x1c1987[_0x249a('0x39')]);return db['Dynamics365Field']['find'](_0x43f785)['then'](handleEntityNotFound(_0x4ad8cd,null))[_0x249a('0x1f')](respondWithResult(_0x4ad8cd,null))[_0x249a('0x3c')](handleError(_0x4ad8cd,null));};exports[_0x249a('0x40')]=function(_0x4e9655,_0x5c0ca7){return db[_0x249a('0x23')][_0x249a('0x40')](_0x4e9655[_0x249a('0x41')],{})['then'](respondWithResult(_0x5c0ca7,0xc9))[_0x249a('0x3c')](handleError(_0x5c0ca7,null));};exports[_0x249a('0x42')]=function(_0x53ec58,_0x9df122){if(_0x53ec58[_0x249a('0x41')]['id']){delete _0x53ec58[_0x249a('0x41')]['id'];}return db['Dynamics365Field'][_0x249a('0x43')]({'where':{'id':_0x53ec58['params']['id']}})['then'](handleEntityNotFound(_0x9df122,null))['then'](saveUpdates(_0x53ec58[_0x249a('0x41')],null))[_0x249a('0x1f')](respondWithResult(_0x9df122,null))[_0x249a('0x3c')](handleError(_0x9df122,null));};exports[_0x249a('0x44')]=function(_0x20b1ac,_0x188c16){return db[_0x249a('0x23')][_0x249a('0x43')]({'where':{'id':_0x20b1ac['params']['id']}})['then'](handleEntityNotFound(_0x188c16,null))[_0x249a('0x1f')](removeEntity(_0x188c16,null))[_0x249a('0x3c')](handleError(_0x188c16,null));}; \ No newline at end of file +var _0xa7bd=['Content-Range','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','intersection','includeAll','catch','create','body','params','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set'];(function(_0x57171b,_0xfe67c6){var _0x33a2c8=function(_0x31e60d){while(--_0x31e60d){_0x57171b['push'](_0x57171b['shift']());}};_0x33a2c8(++_0xfe67c6);}(_0xa7bd,0x173));var _0xda7b=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xa7bd[_0x4b7895];return _0x264180;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xda7b('0x0'));var rp=require(_0xda7b('0x1'));var moment=require('moment');var BPromise=require(_0xda7b('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xda7b('0x3'));var sox=require(_0xda7b('0x4'));var csv=require(_0xda7b('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda7b('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xda7b('0x7'));var jsforce=require(_0xda7b('0x8'));var deskjs=require(_0xda7b('0x9'));var toCsv=require(_0xda7b('0x5'));var querystring=require(_0xda7b('0xa'));var Papa=require(_0xda7b('0xb'));var Redis=require(_0xda7b('0xc'));var authService=require(_0xda7b('0xd'));var qs=require(_0xda7b('0xe'));var as=require(_0xda7b('0xf'));var hardwareService=require(_0xda7b('0x10'));var logger=require(_0xda7b('0x11'))(_0xda7b('0x12'));var utils=require(_0xda7b('0x13'));var config=require(_0xda7b('0x14'));var licenseUtil=require(_0xda7b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x320b5a,_0x69718a){_0x69718a=_0x69718a||0xcc;return function(_0x30ac3a){if(_0x30ac3a){return _0x320b5a[_0xda7b('0x16')](_0x69718a);}return _0x320b5a[_0xda7b('0x17')](_0x69718a)[_0xda7b('0x18')]();};}function respondWithResult(_0x40f7f0,_0x4ef135){_0x4ef135=_0x4ef135||0xc8;return function(_0x100c89){if(_0x100c89){return _0x40f7f0[_0xda7b('0x17')](_0x4ef135)[_0xda7b('0x19')](_0x100c89);}};}function respondWithFilteredResult(_0x1ab3a0,_0x4baaf2){return function(_0x302abb){if(_0x302abb){var _0x19bc99=typeof _0x4baaf2['offset']==='undefined'&&typeof _0x4baaf2[_0xda7b('0x1a')]===_0xda7b('0x1b');var _0x16163e=_0x302abb[_0xda7b('0x1c')];var _0x21cf40=_0x19bc99?0x0:_0x4baaf2[_0xda7b('0x1d')];var _0x560671=_0x19bc99?_0x302abb[_0xda7b('0x1c')]:_0x4baaf2[_0xda7b('0x1d')]+_0x4baaf2[_0xda7b('0x1a')];var _0x3590cd;if(_0x560671>=_0x16163e){_0x560671=_0x16163e;_0x3590cd=0xc8;}else{_0x3590cd=0xce;}_0x1ab3a0['status'](_0x3590cd);return _0x1ab3a0[_0xda7b('0x1e')](_0xda7b('0x1f'),_0x21cf40+'-'+_0x560671+'/'+_0x16163e)[_0xda7b('0x19')](_0x302abb);}return null;};}function patchUpdates(_0x17af9f){return function(_0x4f1e4f){try{jsonpatch['apply'](_0x4f1e4f,_0x17af9f,!![]);}catch(_0xa73470){return BPromise['reject'](_0xa73470);}return _0x4f1e4f['save']();};}function saveUpdates(_0x3db775,_0x506760){return function(_0xa0f726){if(_0xa0f726){return _0xa0f726['update'](_0x3db775)[_0xda7b('0x20')](function(_0x481620){return _0x481620;});}return null;};}function removeEntity(_0x55e884,_0x1d8799){return function(_0x339a52){if(_0x339a52){return _0x339a52[_0xda7b('0x21')]()[_0xda7b('0x20')](function(){_0x55e884[_0xda7b('0x17')](0xcc)[_0xda7b('0x18')]();});}};}function handleEntityNotFound(_0x2f6534,_0x47cdbb){return function(_0x37c58f){if(!_0x37c58f){_0x2f6534['sendStatus'](0x194);}return _0x37c58f;};}function handleError(_0x59dc88,_0x1b3281){_0x1b3281=_0x1b3281||0x1f4;return function(_0x43ce2f){logger[_0xda7b('0x22')](_0x43ce2f[_0xda7b('0x23')]);if(_0x43ce2f[_0xda7b('0x24')]){delete _0x43ce2f[_0xda7b('0x24')];}_0x59dc88[_0xda7b('0x17')](_0x1b3281)[_0xda7b('0x25')](_0x43ce2f);};}exports[_0xda7b('0x26')]=function(_0xa25961,_0x29abf9){var _0x2fe389={},_0x5966a8={},_0x477ce6={'count':0x0,'rows':[]};var _0x1b821d=_[_0xda7b('0x27')](db[_0xda7b('0x28')][_0xda7b('0x29')],function(_0x23af8e){return{'name':_0x23af8e[_0xda7b('0x2a')],'type':_0x23af8e[_0xda7b('0x2b')]['key']};});_0x5966a8[_0xda7b('0x2c')]=_['map'](_0x1b821d,_0xda7b('0x24'));_0x5966a8['query']=_[_0xda7b('0x2d')](_0xa25961[_0xda7b('0x2e')]);_0x5966a8[_0xda7b('0x2f')]=_['intersection'](_0x5966a8[_0xda7b('0x2c')],_0x5966a8['query']);_0x2fe389[_0xda7b('0x30')]=_['intersection'](_0x5966a8[_0xda7b('0x2c')],qs[_0xda7b('0x31')](_0xa25961['query'][_0xda7b('0x31')]));_0x2fe389[_0xda7b('0x30')]=_0x2fe389[_0xda7b('0x30')][_0xda7b('0x32')]?_0x2fe389['attributes']:_0x5966a8['model'];if(!_0xa25961[_0xda7b('0x2e')][_0xda7b('0x33')]('nolimit')){_0x2fe389[_0xda7b('0x1a')]=qs['limit'](_0xa25961[_0xda7b('0x2e')]['limit']);_0x2fe389[_0xda7b('0x1d')]=qs[_0xda7b('0x1d')](_0xa25961[_0xda7b('0x2e')]['offset']);}_0x2fe389['order']=qs[_0xda7b('0x34')](_0xa25961[_0xda7b('0x2e')][_0xda7b('0x34')]);_0x2fe389[_0xda7b('0x35')]=qs[_0xda7b('0x2f')](_[_0xda7b('0x36')](_0xa25961[_0xda7b('0x2e')],_0x5966a8['filters']),_0x1b821d);if(_0xa25961['query'][_0xda7b('0x37')]){_0x2fe389['where']=_['merge'](_0x2fe389[_0xda7b('0x35')],{'$or':_[_0xda7b('0x27')](_0x1b821d,function(_0x33190d){if(_0x33190d['type']!==_0xda7b('0x38')){var _0x342ae2={};_0x342ae2[_0x33190d[_0xda7b('0x24')]]={'$like':'%'+_0xa25961[_0xda7b('0x2e')][_0xda7b('0x37')]+'%'};return _0x342ae2;}})});}_0x2fe389=_[_0xda7b('0x39')]({},_0x2fe389,_0xa25961[_0xda7b('0x3a')]);var _0x177664={'where':_0x2fe389['where']};return db['Dynamics365Field']['count'](_0x177664)['then'](function(_0x11dcf9){_0x477ce6['count']=_0x11dcf9;if(_0xa25961[_0xda7b('0x2e')]['includeAll']){_0x2fe389[_0xda7b('0x3b')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x2fe389);})[_0xda7b('0x20')](function(_0x46550f){_0x477ce6[_0xda7b('0x3c')]=_0x46550f;return _0x477ce6;})['then'](respondWithFilteredResult(_0x29abf9,_0x2fe389))['catch'](handleError(_0x29abf9,null));};exports['show']=function(_0x49b25d,_0x2650c0){var _0x138ee4={'raw':!![],'where':{'id':_0x49b25d['params']['id']}},_0x48b701={};_0x48b701[_0xda7b('0x2c')]=_[_0xda7b('0x2d')](db[_0xda7b('0x28')][_0xda7b('0x29')]);_0x48b701[_0xda7b('0x2e')]=_[_0xda7b('0x2d')](_0x49b25d[_0xda7b('0x2e')]);_0x48b701[_0xda7b('0x2f')]=_[_0xda7b('0x3d')](_0x48b701[_0xda7b('0x2c')],_0x48b701['query']);_0x138ee4[_0xda7b('0x30')]=_[_0xda7b('0x3d')](_0x48b701[_0xda7b('0x2c')],qs[_0xda7b('0x31')](_0x49b25d[_0xda7b('0x2e')][_0xda7b('0x31')]));_0x138ee4['attributes']=_0x138ee4[_0xda7b('0x30')][_0xda7b('0x32')]?_0x138ee4['attributes']:_0x48b701[_0xda7b('0x2c')];if(_0x49b25d['query'][_0xda7b('0x3e')]){_0x138ee4[_0xda7b('0x3b')]=[{'all':!![]}];}_0x138ee4=_['merge']({},_0x138ee4,_0x49b25d[_0xda7b('0x3a')]);return db[_0xda7b('0x28')]['find'](_0x138ee4)['then'](handleEntityNotFound(_0x2650c0,null))[_0xda7b('0x20')](respondWithResult(_0x2650c0,null))[_0xda7b('0x3f')](handleError(_0x2650c0,null));};exports[_0xda7b('0x40')]=function(_0x1cd67,_0x1fb2c3){return db[_0xda7b('0x28')][_0xda7b('0x40')](_0x1cd67['body'],{})[_0xda7b('0x20')](respondWithResult(_0x1fb2c3,0xc9))['catch'](handleError(_0x1fb2c3,null));};exports['update']=function(_0x3937e2,_0x3a2ac8){if(_0x3937e2[_0xda7b('0x41')]['id']){delete _0x3937e2[_0xda7b('0x41')]['id'];}return db[_0xda7b('0x28')]['find']({'where':{'id':_0x3937e2['params']['id']}})[_0xda7b('0x20')](handleEntityNotFound(_0x3a2ac8,null))[_0xda7b('0x20')](saveUpdates(_0x3937e2[_0xda7b('0x41')],null))[_0xda7b('0x20')](respondWithResult(_0x3a2ac8,null))[_0xda7b('0x3f')](handleError(_0x3a2ac8,null));};exports['destroy']=function(_0x19af1f,_0x68dd75){return db['Dynamics365Field']['find']({'where':{'id':_0x19af1f[_0xda7b('0x42')]['id']}})['then'](handleEntityNotFound(_0x68dd75,null))[_0xda7b('0x20')](removeEntity(_0x68dd75,null))[_0xda7b('0x3f')](handleError(_0x68dd75,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 45d22b1..cb2245d 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 _0xd0da=['./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x9313f7,_0x1aefbf){var _0x444562=function(_0x273a1b){while(--_0x273a1b){_0x9313f7['push'](_0x9313f7['shift']());}};_0x444562(++_0x1aefbf);}(_0xd0da,0x9b));var _0xad0d=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xd0da[_0x26fc81];return _0x9feece;};'use strict';var _=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var logger=require(_0xad0d('0x2'))(_0xad0d('0x3'));var moment=require(_0xad0d('0x4'));var BPromise=require(_0xad0d('0x5'));var rp=require(_0xad0d('0x6'));var fs=require('fs');var path=require(_0xad0d('0x7'));var rimraf=require(_0xad0d('0x8'));var config=require(_0xad0d('0x9'));var attributes=require(_0xad0d('0xa'));module['exports']=function(_0x570732,_0x512bc4){return _0x570732[_0xad0d('0xb')](_0xad0d('0xc'),attributes,{'tableName':_0xad0d('0xd'),'paranoid':![],'indexes':[{'name':_0xad0d('0xe'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa999=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','../../config/logger','api','moment'];(function(_0x177ae5,_0x156169){var _0x4501ae=function(_0x23f9fb){while(--_0x23f9fb){_0x177ae5['push'](_0x177ae5['shift']());}};_0x4501ae(++_0x156169);}(_0xa999,0x1af));var _0x9a99=function(_0x4d6543,_0x5c9215){_0x4d6543=_0x4d6543-0x0;var _0x312349=_0xa999[_0x4d6543];return _0x312349;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a99('0x0'))(_0x9a99('0x1'));var moment=require(_0x9a99('0x2'));var BPromise=require(_0x9a99('0x3'));var rp=require(_0x9a99('0x4'));var fs=require('fs');var path=require(_0x9a99('0x5'));var rimraf=require(_0x9a99('0x6'));var config=require(_0x9a99('0x7'));var attributes=require(_0x9a99('0x8'));module[_0x9a99('0x9')]=function(_0x16ed32,_0x43755e){return _0x16ed32[_0x9a99('0xa')]('Dynamics365Field',attributes,{'tableName':_0x9a99('0xb'),'paranoid':![],'indexes':[{'name':_0x9a99('0xc'),'fields':[_0x9a99('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 a0ad80c..7d59d40 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 _0x5cb7=['jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x231f04,_0x34cf59){var _0x2b2ec3=function(_0x5d4e17){while(--_0x5d4e17){_0x231f04['push'](_0x231f04['shift']());}};_0x2b2ec3(++_0x34cf59);}(_0x5cb7,0x118));var _0x75cb=function(_0x1123ac,_0x4d466e){_0x1123ac=_0x1123ac-0x0;var _0x4096c2=_0x5cb7[_0x1123ac];return _0x4096c2;};'use strict';var _=require(_0x75cb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x75cb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75cb('0x2'));var db=require(_0x75cb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x75cb('0x4'))('rpc');var config=require(_0x75cb('0x5'));var jayson=require(_0x75cb('0x6'));var client=jayson[_0x75cb('0x7')][_0x75cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1dcb76,_0x12e401,_0x31035e){return new BPromise(function(_0x5c59de,_0x48a9bf){return client[_0x75cb('0x9')](_0x1dcb76,_0x31035e)[_0x75cb('0xa')](function(_0x5e2be9){logger[_0x75cb('0xb')](_0x75cb('0xc'),_0x12e401,_0x75cb('0xd'));logger[_0x75cb('0xe')](_0x75cb('0xf'),_0x12e401,_0x75cb('0xd'),JSON[_0x75cb('0x10')](_0x5e2be9));if(_0x5e2be9[_0x75cb('0x11')]){if(_0x5e2be9[_0x75cb('0x11')][_0x75cb('0x12')]===0x1f4){logger[_0x75cb('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x12e401,_0x5e2be9[_0x75cb('0x11')]['message']);return _0x48a9bf(_0x5e2be9['error'][_0x75cb('0x13')]);}logger[_0x75cb('0x11')](_0x75cb('0xc'),_0x12e401,_0x5e2be9[_0x75cb('0x11')]['message']);return _0x5c59de(_0x5e2be9[_0x75cb('0x11')]['message']);}else{logger[_0x75cb('0xb')](_0x75cb('0xc'),_0x12e401,_0x75cb('0xd'));_0x5c59de(_0x5e2be9[_0x75cb('0x14')][_0x75cb('0x13')]);}})[_0x75cb('0x15')](function(_0x1e9d3b){logger[_0x75cb('0x11')](_0x75cb('0xc'),_0x12e401,_0x1e9d3b);_0x48a9bf(_0x1e9d3b);});});} \ No newline at end of file +var _0xe3b8=['error','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0xe3b8,0x17e));var _0x8e3b=function(_0x504136,_0x46e713){_0x504136=_0x504136-0x0;var _0x2f8844=_0xe3b8[_0x504136];return _0x2f8844;};'use strict';var _=require('lodash');var util=require(_0x8e3b('0x0'));var moment=require('moment');var BPromise=require(_0x8e3b('0x1'));var rs=require(_0x8e3b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e3b('0x3'))['db'];var utils=require(_0x8e3b('0x4'));var logger=require('../../config/logger')(_0x8e3b('0x5'));var config=require(_0x8e3b('0x6'));var jayson=require(_0x8e3b('0x7'));var client=jayson[_0x8e3b('0x8')][_0x8e3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4da892,_0x2c99ff,_0x1434ba){return new BPromise(function(_0x15135b,_0x46bf97){return client[_0x8e3b('0xa')](_0x4da892,_0x1434ba)['then'](function(_0x24e61e){logger[_0x8e3b('0xb')](_0x8e3b('0xc'),_0x2c99ff,_0x8e3b('0xd'));logger[_0x8e3b('0xe')](_0x8e3b('0xf'),_0x2c99ff,'request\x20sent',JSON[_0x8e3b('0x10')](_0x24e61e));if(_0x24e61e['error']){if(_0x24e61e[_0x8e3b('0x11')]['code']===0x1f4){logger[_0x8e3b('0x11')](_0x8e3b('0xc'),_0x2c99ff,_0x24e61e[_0x8e3b('0x11')][_0x8e3b('0x12')]);return _0x46bf97(_0x24e61e['error']['message']);}logger[_0x8e3b('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x2c99ff,_0x24e61e[_0x8e3b('0x11')][_0x8e3b('0x12')]);return _0x15135b(_0x24e61e[_0x8e3b('0x11')][_0x8e3b('0x12')]);}else{logger[_0x8e3b('0xb')](_0x8e3b('0xc'),_0x2c99ff,'request\x20sent');_0x15135b(_0x24e61e[_0x8e3b('0x13')]['message']);}})[_0x8e3b('0x14')](function(_0x1151be){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2c99ff,_0x1151be);_0x46bf97(_0x1151be);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index a72eee5..eb5c633 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 _0x4f95=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x4f95,0x6d));var _0x54f9=function(_0x55842f,_0x524dda){_0x55842f=_0x55842f-0x0;var _0xa1e4ec=_0x4f95[_0x55842f];return _0xa1e4ec;};'use strict';var multer=require(_0x54f9('0x0'));var util=require(_0x54f9('0x1'));var path=require(_0x54f9('0x2'));var timeout=require(_0x54f9('0x3'));var express=require(_0x54f9('0x4'));var router=express[_0x54f9('0x5')]();var fs_extra=require(_0x54f9('0x6'));var auth=require(_0x54f9('0x7'));var interaction=require(_0x54f9('0x8'));var config=require(_0x54f9('0x9'));var controller=require(_0x54f9('0xa'));router[_0x54f9('0xb')]('/',auth[_0x54f9('0xc')](),controller[_0x54f9('0xd')]);router['get'](_0x54f9('0xe'),auth['isAuthenticated'](),controller[_0x54f9('0xf')]);router[_0x54f9('0xb')](_0x54f9('0x10'),auth['isAuthenticated'](),controller[_0x54f9('0x11')]);router[_0x54f9('0xb')](_0x54f9('0x12'),auth['isAuthenticated'](),controller[_0x54f9('0x13')]);router[_0x54f9('0x14')]('/',auth[_0x54f9('0xc')](),controller[_0x54f9('0x15')]);router[_0x54f9('0x14')](_0x54f9('0x10'),auth[_0x54f9('0xc')](),controller[_0x54f9('0x16')]);router[_0x54f9('0x17')](_0x54f9('0xe'),auth[_0x54f9('0xc')](),controller[_0x54f9('0x18')]);router[_0x54f9('0x19')](_0x54f9('0xe'),auth[_0x54f9('0xc')](),controller[_0x54f9('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xeabc=['update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0xeabc,0xab));var _0xceab=function(_0x5e6e0d,_0x452182){_0x5e6e0d=_0x5e6e0d-0x0;var _0x823cae=_0xeabc[_0x5e6e0d];return _0x823cae;};'use strict';var multer=require(_0xceab('0x0'));var util=require(_0xceab('0x1'));var path=require('path');var timeout=require(_0xceab('0x2'));var express=require(_0xceab('0x3'));var router=express[_0xceab('0x4')]();var fs_extra=require(_0xceab('0x5'));var auth=require(_0xceab('0x6'));var interaction=require(_0xceab('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xceab('0x8')]('/',auth['isAuthenticated'](),controller[_0xceab('0x9')]);router[_0xceab('0x8')](_0xceab('0xa'),auth[_0xceab('0xb')](),controller['show']);router[_0xceab('0x8')](_0xceab('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xceab('0x8')]('/:id/fields',auth[_0xceab('0xb')](),controller[_0xceab('0xd')]);router[_0xceab('0xe')]('/',auth[_0xceab('0xb')](),controller[_0xceab('0xf')]);router[_0xceab('0xe')](_0xceab('0xc'),auth[_0xceab('0xb')](),controller[_0xceab('0x10')]);router[_0xceab('0x11')](_0xceab('0xa'),auth[_0xceab('0xb')](),controller[_0xceab('0x12')]);router['delete'](_0xceab('0xa'),auth[_0xceab('0xb')](),controller[_0xceab('0x13')]);module[_0xceab('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 2b885d7..dda8bb2 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 _0x160f=['sequelize','exports','STRING','username','remoteUri'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf160('0x0'));module[_0xf160('0x1')]={'name':{'type':Sequelize[_0xf160('0x2')]},'description':{'type':Sequelize[_0xf160('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xf160('0x3')},'apiKey':{'type':Sequelize[_0xf160('0x2')]},'remoteUri':{'type':Sequelize[_0xf160('0x2')],'unique':_0xf160('0x4')},'serverUrl':{'type':Sequelize[_0xf160('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe2cf=['remoteUri','exports','STRING','username'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x1dd6e7,_0x1cda2b){_0x1dd6e7=_0x1dd6e7-0x0;var _0xb53aa4=_0xe2cf[_0x1dd6e7];return _0xb53aa4;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfe2c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xfe2c('0x2')},'apiKey':{'type':Sequelize[_0xfe2c('0x1')]},'remoteUri':{'type':Sequelize[_0xfe2c('0x1')],'unique':_0xfe2c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 8321e9b..0267e3e 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 _0x6c63=['order','hasOwnProperty','nolimit','findOne','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','base64','requester','agent','description','priority','group','source','ticket_type','company','remove','includes','custom_dropdown','label','default','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','intersection','catch','create','body','find','FreshdeskConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c63,0x1ee));var _0x36c6=function(_0x1d03e5,_0x2a6171){_0x1d03e5=_0x1d03e5-0x0;var _0x11020e=_0x6c63[_0x1d03e5];return _0x11020e;};'use strict';var emlformat=require(_0x36c6('0x0'));var rimraf=require(_0x36c6('0x1'));var zipdir=require(_0x36c6('0x2'));var jsonpatch=require(_0x36c6('0x3'));var rp=require(_0x36c6('0x4'));var moment=require(_0x36c6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x36c6('0x6'));var util=require(_0x36c6('0x7'));var path=require(_0x36c6('0x8'));var sox=require(_0x36c6('0x9'));var csv=require(_0x36c6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x36c6('0xb'));var _=require(_0x36c6('0xc'));var squel=require(_0x36c6('0xd'));var crypto=require(_0x36c6('0xe'));var jsforce=require(_0x36c6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x36c6('0xa'));var querystring=require('querystring');var Papa=require(_0x36c6('0x10'));var Redis=require('ioredis');var authService=require(_0x36c6('0x11'));var qs=require(_0x36c6('0x12'));var as=require(_0x36c6('0x13'));var hardwareService=require(_0x36c6('0x14'));var logger=require(_0x36c6('0x15'))(_0x36c6('0x16'));var utils=require(_0x36c6('0x17'));var config=require(_0x36c6('0x18'));var licenseUtil=require(_0x36c6('0x19'));var db=require(_0x36c6('0x1a'))['db'];var integrations=require(_0x36c6('0x1b'));function respondWithStatusCode(_0x1bbb1b,_0x20213a){_0x20213a=_0x20213a||0xcc;return function(_0x41d7cb){if(_0x41d7cb){return _0x1bbb1b['sendStatus'](_0x20213a);}return _0x1bbb1b[_0x36c6('0x1c')](_0x20213a)[_0x36c6('0x1d')]();};}function respondWithResult(_0x1f9de1,_0x531c09){_0x531c09=_0x531c09||0xc8;return function(_0xdad7df){if(_0xdad7df){return _0x1f9de1[_0x36c6('0x1c')](_0x531c09)[_0x36c6('0x1e')](_0xdad7df);}};}function respondWithFilteredResult(_0x25b30e,_0x9e4cb6){return function(_0x56b28b){if(_0x56b28b){var _0x1adeec=typeof _0x9e4cb6[_0x36c6('0x1f')]===_0x36c6('0x20')&&typeof _0x9e4cb6[_0x36c6('0x21')]==='undefined';var _0x4f866c=_0x56b28b['count'];var _0x133d09=_0x1adeec?0x0:_0x9e4cb6['offset'];var _0x33d89c=_0x1adeec?_0x56b28b[_0x36c6('0x22')]:_0x9e4cb6[_0x36c6('0x1f')]+_0x9e4cb6['limit'];var _0x376c20;if(_0x33d89c>=_0x4f866c){_0x33d89c=_0x4f866c;_0x376c20=0xc8;}else{_0x376c20=0xce;}_0x25b30e[_0x36c6('0x1c')](_0x376c20);return _0x25b30e[_0x36c6('0x23')](_0x36c6('0x24'),_0x133d09+'-'+_0x33d89c+'/'+_0x4f866c)[_0x36c6('0x1e')](_0x56b28b);}return null;};}function patchUpdates(_0x6daa60){return function(_0x741725){try{jsonpatch['apply'](_0x741725,_0x6daa60,!![]);}catch(_0x53787d){return BPromise[_0x36c6('0x25')](_0x53787d);}return _0x741725[_0x36c6('0x26')]();};}function saveUpdates(_0x53911e,_0x597570){return function(_0x60d9f4){if(_0x60d9f4){return _0x60d9f4[_0x36c6('0x27')](_0x53911e)[_0x36c6('0x28')](function(_0xdd6931){return _0xdd6931;});}return null;};}function removeEntity(_0x2e12f7,_0x77240f){return function(_0x3f1fc9){if(_0x3f1fc9){return _0x3f1fc9[_0x36c6('0x29')]()['then'](function(){_0x2e12f7[_0x36c6('0x1c')](0xcc)[_0x36c6('0x1d')]();});}};}function handleEntityNotFound(_0x13c266,_0x599db1){return function(_0x1677d9){if(!_0x1677d9){_0x13c266[_0x36c6('0x2a')](0x194);}return _0x1677d9;};}function handleError(_0x2cfcdf,_0x83612d){_0x83612d=_0x83612d||0x1f4;return function(_0x51c0c5){logger[_0x36c6('0x2b')](_0x51c0c5['stack']);if(_0x51c0c5[_0x36c6('0x2c')]){delete _0x51c0c5[_0x36c6('0x2c')];}_0x2cfcdf['status'](_0x83612d)['send'](_0x51c0c5);};}exports[_0x36c6('0x2d')]=function(_0x294c9b,_0x26f4d4){var _0x4eae9a={},_0x50b21b={},_0x1df244={'count':0x0,'rows':[]};var _0x37ec63=_[_0x36c6('0x2e')](db[_0x36c6('0x2f')][_0x36c6('0x30')],function(_0x393894){return{'name':_0x393894[_0x36c6('0x31')],'type':_0x393894[_0x36c6('0x32')][_0x36c6('0x33')]};});_0x50b21b[_0x36c6('0x34')]=_[_0x36c6('0x2e')](_0x37ec63,_0x36c6('0x2c'));_0x50b21b[_0x36c6('0x35')]=_['keys'](_0x294c9b[_0x36c6('0x35')]);_0x50b21b[_0x36c6('0x36')]=_['intersection'](_0x50b21b[_0x36c6('0x34')],_0x50b21b[_0x36c6('0x35')]);_0x4eae9a[_0x36c6('0x37')]=_['intersection'](_0x50b21b['model'],qs['fields'](_0x294c9b[_0x36c6('0x35')][_0x36c6('0x38')]));_0x4eae9a[_0x36c6('0x37')]=_0x4eae9a[_0x36c6('0x37')][_0x36c6('0x39')]?_0x4eae9a[_0x36c6('0x37')]:_0x50b21b[_0x36c6('0x34')];if(!_0x294c9b[_0x36c6('0x35')]['hasOwnProperty']('nolimit')){_0x4eae9a[_0x36c6('0x21')]=qs[_0x36c6('0x21')](_0x294c9b[_0x36c6('0x35')][_0x36c6('0x21')]);_0x4eae9a['offset']=qs[_0x36c6('0x1f')](_0x294c9b['query'][_0x36c6('0x1f')]);}_0x4eae9a['order']=qs[_0x36c6('0x3a')](_0x294c9b[_0x36c6('0x35')]['sort']);_0x4eae9a[_0x36c6('0x3b')]=qs['filters'](_[_0x36c6('0x3c')](_0x294c9b[_0x36c6('0x35')],_0x50b21b[_0x36c6('0x36')]),_0x37ec63);if(_0x294c9b[_0x36c6('0x35')][_0x36c6('0x3d')]){_0x4eae9a['where']=_[_0x36c6('0x3e')](_0x4eae9a['where'],{'$or':_[_0x36c6('0x2e')](_0x37ec63,function(_0xaac639){if(_0xaac639['type']!==_0x36c6('0x3f')){var _0x40e560={};_0x40e560[_0xaac639[_0x36c6('0x2c')]]={'$like':'%'+_0x294c9b['query']['filter']+'%'};return _0x40e560;}})});}_0x4eae9a=_[_0x36c6('0x3e')]({},_0x4eae9a,_0x294c9b[_0x36c6('0x40')]);var _0x46eb51={'where':_0x4eae9a[_0x36c6('0x3b')]};return db[_0x36c6('0x2f')]['count'](_0x46eb51)[_0x36c6('0x28')](function(_0x11fca0){_0x1df244[_0x36c6('0x22')]=_0x11fca0;if(_0x294c9b['query'][_0x36c6('0x41')]){_0x4eae9a[_0x36c6('0x42')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x36c6('0x43')](_0x4eae9a);})['then'](function(_0x30882e){_0x1df244['rows']=_0x30882e;return _0x1df244;})[_0x36c6('0x28')](respondWithFilteredResult(_0x26f4d4,_0x4eae9a))['catch'](handleError(_0x26f4d4,null));};exports['show']=function(_0x328fac,_0x247574){var _0x76c618={'raw':![],'where':{'id':_0x328fac[_0x36c6('0x44')]['id']}},_0x14c69c={};_0x14c69c[_0x36c6('0x34')]=_[_0x36c6('0x45')](db[_0x36c6('0x2f')][_0x36c6('0x30')]);_0x14c69c['query']=_[_0x36c6('0x45')](_0x328fac[_0x36c6('0x35')]);_0x14c69c[_0x36c6('0x36')]=_[_0x36c6('0x46')](_0x14c69c[_0x36c6('0x34')],_0x14c69c[_0x36c6('0x35')]);_0x76c618[_0x36c6('0x37')]=_['intersection'](_0x14c69c['model'],qs[_0x36c6('0x38')](_0x328fac[_0x36c6('0x35')]['fields']));_0x76c618['attributes']=_0x76c618[_0x36c6('0x37')][_0x36c6('0x39')]?_0x76c618[_0x36c6('0x37')]:_0x14c69c[_0x36c6('0x34')];if(_0x328fac['query']['includeAll']){_0x76c618[_0x36c6('0x42')]=[{'all':!![]}];}_0x76c618=_[_0x36c6('0x3e')]({},_0x76c618,_0x328fac[_0x36c6('0x40')]);return db[_0x36c6('0x2f')]['find'](_0x76c618)['then'](handleEntityNotFound(_0x247574,null))[_0x36c6('0x28')](respondWithResult(_0x247574,null))[_0x36c6('0x47')](handleError(_0x247574,null));};exports[_0x36c6('0x48')]=function(_0x1fc75f,_0x22f061){return db[_0x36c6('0x2f')][_0x36c6('0x48')](_0x1fc75f['body'],{})[_0x36c6('0x28')](respondWithResult(_0x22f061,0xc9))[_0x36c6('0x47')](handleError(_0x22f061,null));};exports[_0x36c6('0x27')]=function(_0xa940f,_0x1ce4e0){if(_0xa940f[_0x36c6('0x49')]['id']){delete _0xa940f[_0x36c6('0x49')]['id'];}return db['FreshdeskAccount'][_0x36c6('0x4a')]({'where':{'id':_0xa940f['params']['id']}})[_0x36c6('0x28')](handleEntityNotFound(_0x1ce4e0,null))['then'](saveUpdates(_0xa940f[_0x36c6('0x49')],null))[_0x36c6('0x28')](respondWithResult(_0x1ce4e0,null))[_0x36c6('0x47')](handleError(_0x1ce4e0,null));};exports[_0x36c6('0x29')]=function(_0x5a2473,_0x2e0e50){return db[_0x36c6('0x2f')][_0x36c6('0x4a')]({'where':{'id':_0x5a2473[_0x36c6('0x44')]['id']}})[_0x36c6('0x28')](handleEntityNotFound(_0x2e0e50,null))['then'](removeEntity(_0x2e0e50,null))[_0x36c6('0x47')](handleError(_0x2e0e50,null));};exports['getConfigurations']=function(_0x14751c,_0x34f463,_0x549b30){var _0x30f791={};var _0x5ef605={};var _0x26284b;var _0x1e0eb0;return db[_0x36c6('0x2f')]['findOne']({'where':{'id':_0x14751c[_0x36c6('0x44')]['id']}})[_0x36c6('0x28')](handleEntityNotFound(_0x34f463,null))[_0x36c6('0x28')](function(_0x378f03){if(_0x378f03){_0x26284b=_0x378f03;_0x5ef605[_0x36c6('0x34')]=_[_0x36c6('0x45')](db[_0x36c6('0x4b')]['rawAttributes']);_0x5ef605[_0x36c6('0x35')]=_[_0x36c6('0x45')](_0x14751c['query']);_0x5ef605[_0x36c6('0x36')]=_[_0x36c6('0x46')](_0x5ef605[_0x36c6('0x34')],_0x5ef605[_0x36c6('0x35')]);_0x30f791['attributes']=_[_0x36c6('0x46')](_0x5ef605['model'],qs[_0x36c6('0x38')](_0x14751c[_0x36c6('0x35')][_0x36c6('0x38')]));_0x30f791[_0x36c6('0x37')]=_0x30f791[_0x36c6('0x37')]['length']?_0x30f791[_0x36c6('0x37')]:_0x5ef605[_0x36c6('0x34')];_0x30f791[_0x36c6('0x4c')]=qs[_0x36c6('0x3a')](_0x14751c[_0x36c6('0x35')][_0x36c6('0x3a')]);_0x30f791[_0x36c6('0x3b')]=qs[_0x36c6('0x36')](_['pick'](_0x14751c[_0x36c6('0x35')],_0x5ef605['filters']));if(_0x14751c[_0x36c6('0x35')][_0x36c6('0x3d')]){_0x30f791[_0x36c6('0x3b')]=_[_0x36c6('0x3e')](_0x30f791['where'],{'$or':_[_0x36c6('0x2e')](_0x30f791['attributes'],function(_0x575f70){var _0x3dd63a={};_0x3dd63a[_0x575f70]={'$like':'%'+_0x14751c[_0x36c6('0x35')]['filter']+'%'};return _0x3dd63a;})});}_0x30f791=_[_0x36c6('0x3e')]({},_0x30f791,_0x14751c['options']);return _0x26284b['getConfigurations'](_0x30f791);}})['then'](function(_0x1e2b91){if(_0x1e2b91){_0x1e0eb0=_0x1e2b91[_0x36c6('0x39')];if(!_0x14751c['query'][_0x36c6('0x4d')](_0x36c6('0x4e'))){_0x30f791['limit']=qs['limit'](_0x14751c[_0x36c6('0x35')]['limit']);_0x30f791[_0x36c6('0x1f')]=qs[_0x36c6('0x1f')](_0x14751c[_0x36c6('0x35')][_0x36c6('0x1f')]);}return _0x26284b['getConfigurations'](_0x30f791);}})['then'](function(_0x48ca52){if(_0x48ca52){return _0x48ca52?{'count':_0x1e0eb0,'rows':_0x48ca52}:null;}})['then'](respondWithResult(_0x34f463,null))[_0x36c6('0x47')](handleError(_0x34f463,null));};exports['addConfiguration']=function(_0x3f46c1,_0x2ced84,_0x4c93cc){if(_0x3f46c1[_0x36c6('0x49')]['id']){delete _0x3f46c1[_0x36c6('0x49')]['id'];}return db[_0x36c6('0x2f')][_0x36c6('0x4f')]({'where':{'id':_0x3f46c1[_0x36c6('0x44')]['id']}})[_0x36c6('0x28')](handleEntityNotFound(_0x2ced84,null))['then'](function(_0x25a61a){if(_0x25a61a){_0x3f46c1[_0x36c6('0x49')]['AccountId']=_0x25a61a['id'];_0x3f46c1[_0x36c6('0x49')][_0x36c6('0x50')]=integrations['getSubjects'](_0x3f46c1[_0x36c6('0x49')][_0x36c6('0x51')],_0x3f46c1['body'][_0x36c6('0x32')]);_0x3f46c1[_0x36c6('0x49')][_0x36c6('0x52')]=integrations[_0x36c6('0x53')](_0x3f46c1['body'][_0x36c6('0x51')],_0x3f46c1[_0x36c6('0x49')][_0x36c6('0x32')]);return db[_0x36c6('0x4b')][_0x36c6('0x48')](_0x3f46c1[_0x36c6('0x49')],{'include':[{'model':db[_0x36c6('0x54')],'as':_0x36c6('0x50')},{'model':db[_0x36c6('0x54')],'as':_0x36c6('0x52')}]});}return null;})[_0x36c6('0x28')](respondWithResult(_0x2ced84,null))['catch'](handleError(_0x2ced84,null));};exports[_0x36c6('0x55')]=function(_0x1c7140,_0x5331f4,_0x4f1a69){var _0x5c011a='';return db[_0x36c6('0x2f')]['findOne']({'where':{'id':_0x1c7140[_0x36c6('0x44')]['id']},'attributes':['id','remoteUri',_0x36c6('0x56')]})[_0x36c6('0x28')](handleEntityNotFound(_0x5331f4,null))[_0x36c6('0x28')](function(_0x147df6){if(_0x147df6){_0x5c011a=_0x147df6[_0x36c6('0x57')];var _0x1812a8=_0x5c011a[_0x36c6('0x58')](-0x1);if(_0x1812a8==='/'){_0x5c011a=_0x5c011a[_0x36c6('0x59')](0x0,_0x5c011a['lastIndexOf'](_0x1812a8));}return rp({'method':_0x36c6('0x5a'),'uri':util['format'](_0x36c6('0x5b'),_0x5c011a,_0x36c6('0x5c')),'headers':{'Authorization':util[_0x36c6('0x5d')](_0x36c6('0x5e'),new Buffer(util[_0x36c6('0x5d')]('%s:X',_0x147df6[_0x36c6('0x56')]))['toString'](_0x36c6('0x5f')))},'json':!![]});}})[_0x36c6('0x28')](function(_0x2fd721){if(_0x2fd721){var _0x4fba79=[_0x36c6('0x60'),'subject',_0x36c6('0x61'),_0x36c6('0x62'),_0x36c6('0x1c'),_0x36c6('0x63'),_0x36c6('0x64'),_0x36c6('0x65'),_0x36c6('0x66'),_0x36c6('0x64'),_0x36c6('0x67')];_[_0x36c6('0x68')](_0x2fd721,function(_0x20ae50){return _0x4fba79[_0x36c6('0x69')](_0x20ae50[_0x36c6('0x2c')])||!_0x20ae50['default']&&_0x20ae50[_0x36c6('0x32')]!=='custom_text'&&_0x20ae50[_0x36c6('0x32')]!==_0x36c6('0x6a');});return{'count':_0x2fd721['length'],'rows':_['map'](_0x2fd721,function(_0x80038d){return{'id':_0x80038d[_0x36c6('0x2c')],'name':_0x80038d[_0x36c6('0x6b')],'custom':!_0x80038d[_0x36c6('0x6c')],'options':_0x80038d['choices']?_[_0x36c6('0x2e')](_0x80038d['choices'],function(_0x144f8d){return{'name':_['capitalize'](_0x144f8d),'value':_0x144f8d};}):[]};})};}})[_0x36c6('0x28')](respondWithResult(_0x5331f4,null))[_0x36c6('0x47')](function(_0x355c15){var _0xac49c5=_0x1c7140[_0x36c6('0x35')][_0x36c6('0x6d')]?0x1f4:_0x355c15[_0x36c6('0x6e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x36c6('0x55'),_0xac49c5,JSON[_0x36c6('0x6f')](_0x355c15));delete _0x355c15[_0x36c6('0x2c')];if(_0xac49c5===0x191){_0xac49c5=0x190;}_0x5331f4[_0x36c6('0x1c')](_0xac49c5)[_0x36c6('0x70')](_0x1c7140[_0x36c6('0x35')][_0x36c6('0x6d')]?{'message':_0x36c6('0x71'),'statusCode':_0x355c15[_0x36c6('0x6e')]}:_0x355c15);});}; \ No newline at end of file +var _0x43b1=['base64','subject','agent','description','priority','ticket_type','group','remove','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','include','FreshdeskAccount','findAll','rows','show','length','options','find','catch','create','body','update','getConfigurations','findOne','params','FreshdeskConfiguration','rawAttributes','order','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','GET','%s/%s','api/v2/ticket_fields','Basic\x20%s','format','toString'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x43b1,0x7d));var _0x143b=function(_0xd8f8a,_0x4a1e05){_0xd8f8a=_0xd8f8a-0x0;var _0xa75ce9=_0x43b1[_0xd8f8a];return _0xa75ce9;};'use strict';var emlformat=require(_0x143b('0x0'));var rimraf=require(_0x143b('0x1'));var zipdir=require(_0x143b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x143b('0x3'));var moment=require('moment');var BPromise=require(_0x143b('0x4'));var Mustache=require(_0x143b('0x5'));var util=require(_0x143b('0x6'));var path=require(_0x143b('0x7'));var sox=require(_0x143b('0x8'));var csv=require(_0x143b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x143b('0xa'));var _=require(_0x143b('0xb'));var squel=require(_0x143b('0xc'));var crypto=require('crypto');var jsforce=require(_0x143b('0xd'));var deskjs=require(_0x143b('0xe'));var toCsv=require(_0x143b('0x9'));var querystring=require(_0x143b('0xf'));var Papa=require(_0x143b('0x10'));var Redis=require(_0x143b('0x11'));var authService=require(_0x143b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x143b('0x13'));var hardwareService=require(_0x143b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x143b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x143b('0x16'));var db=require(_0x143b('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2d6c07,_0x1ef389){_0x1ef389=_0x1ef389||0xcc;return function(_0x8d5095){if(_0x8d5095){return _0x2d6c07[_0x143b('0x18')](_0x1ef389);}return _0x2d6c07[_0x143b('0x19')](_0x1ef389)[_0x143b('0x1a')]();};}function respondWithResult(_0x1325c3,_0x40ce06){_0x40ce06=_0x40ce06||0xc8;return function(_0x2acea8){if(_0x2acea8){return _0x1325c3[_0x143b('0x19')](_0x40ce06)[_0x143b('0x1b')](_0x2acea8);}};}function respondWithFilteredResult(_0x3cc649,_0x2d746a){return function(_0x133603){if(_0x133603){var _0x11d3a9=typeof _0x2d746a[_0x143b('0x1c')]===_0x143b('0x1d')&&typeof _0x2d746a['limit']==='undefined';var _0x14c9bb=_0x133603[_0x143b('0x1e')];var _0x377f9c=_0x11d3a9?0x0:_0x2d746a[_0x143b('0x1c')];var _0x2201bc=_0x11d3a9?_0x133603[_0x143b('0x1e')]:_0x2d746a[_0x143b('0x1c')]+_0x2d746a[_0x143b('0x1f')];var _0x722d79;if(_0x2201bc>=_0x14c9bb){_0x2201bc=_0x14c9bb;_0x722d79=0xc8;}else{_0x722d79=0xce;}_0x3cc649[_0x143b('0x19')](_0x722d79);return _0x3cc649[_0x143b('0x20')]('Content-Range',_0x377f9c+'-'+_0x2201bc+'/'+_0x14c9bb)[_0x143b('0x1b')](_0x133603);}return null;};}function patchUpdates(_0x35df37){return function(_0xb37aa5){try{jsonpatch[_0x143b('0x21')](_0xb37aa5,_0x35df37,!![]);}catch(_0x1f9126){return BPromise[_0x143b('0x22')](_0x1f9126);}return _0xb37aa5[_0x143b('0x23')]();};}function saveUpdates(_0x1d5b5b,_0x5d0684){return function(_0x886476){if(_0x886476){return _0x886476['update'](_0x1d5b5b)[_0x143b('0x24')](function(_0x5bdebc){return _0x5bdebc;});}return null;};}function removeEntity(_0x549638,_0x56717f){return function(_0x100021){if(_0x100021){return _0x100021['destroy']()['then'](function(){_0x549638[_0x143b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35e097,_0x54eca6){return function(_0x425213){if(!_0x425213){_0x35e097[_0x143b('0x18')](0x194);}return _0x425213;};}function handleError(_0x1adf50,_0x4f5a17){_0x4f5a17=_0x4f5a17||0x1f4;return function(_0x47997b){logger['error'](_0x47997b['stack']);if(_0x47997b[_0x143b('0x25')]){delete _0x47997b['name'];}_0x1adf50['status'](_0x4f5a17)[_0x143b('0x26')](_0x47997b);};}exports[_0x143b('0x27')]=function(_0x6174a3,_0x5535b5){var _0xd1aa12={},_0x45ef09={},_0x42e136={'count':0x0,'rows':[]};var _0x41971e=_[_0x143b('0x28')](db['FreshdeskAccount']['rawAttributes'],function(_0x498ea4){return{'name':_0x498ea4['fieldName'],'type':_0x498ea4[_0x143b('0x29')][_0x143b('0x2a')]};});_0x45ef09[_0x143b('0x2b')]=_[_0x143b('0x28')](_0x41971e,_0x143b('0x25'));_0x45ef09[_0x143b('0x2c')]=_[_0x143b('0x2d')](_0x6174a3[_0x143b('0x2c')]);_0x45ef09[_0x143b('0x2e')]=_[_0x143b('0x2f')](_0x45ef09['model'],_0x45ef09[_0x143b('0x2c')]);_0xd1aa12[_0x143b('0x30')]=_['intersection'](_0x45ef09['model'],qs[_0x143b('0x31')](_0x6174a3[_0x143b('0x2c')][_0x143b('0x31')]));_0xd1aa12[_0x143b('0x30')]=_0xd1aa12['attributes']['length']?_0xd1aa12['attributes']:_0x45ef09['model'];if(!_0x6174a3[_0x143b('0x2c')][_0x143b('0x32')](_0x143b('0x33'))){_0xd1aa12['limit']=qs[_0x143b('0x1f')](_0x6174a3[_0x143b('0x2c')][_0x143b('0x1f')]);_0xd1aa12['offset']=qs[_0x143b('0x1c')](_0x6174a3[_0x143b('0x2c')][_0x143b('0x1c')]);}_0xd1aa12['order']=qs[_0x143b('0x34')](_0x6174a3[_0x143b('0x2c')]['sort']);_0xd1aa12['where']=qs['filters'](_[_0x143b('0x35')](_0x6174a3[_0x143b('0x2c')],_0x45ef09['filters']),_0x41971e);if(_0x6174a3[_0x143b('0x2c')][_0x143b('0x36')]){_0xd1aa12[_0x143b('0x37')]=_[_0x143b('0x38')](_0xd1aa12['where'],{'$or':_[_0x143b('0x28')](_0x41971e,function(_0x3cdc85){if(_0x3cdc85[_0x143b('0x29')]!==_0x143b('0x39')){var _0x21f16c={};_0x21f16c[_0x3cdc85['name']]={'$like':'%'+_0x6174a3[_0x143b('0x2c')][_0x143b('0x36')]+'%'};return _0x21f16c;}})});}_0xd1aa12=_[_0x143b('0x38')]({},_0xd1aa12,_0x6174a3['options']);var _0x14539c={'where':_0xd1aa12[_0x143b('0x37')]};return db['FreshdeskAccount'][_0x143b('0x1e')](_0x14539c)[_0x143b('0x24')](function(_0x395f59){_0x42e136[_0x143b('0x1e')]=_0x395f59;if(_0x6174a3[_0x143b('0x2c')]['includeAll']){_0xd1aa12[_0x143b('0x3a')]=[{'all':!![]}];}return db[_0x143b('0x3b')][_0x143b('0x3c')](_0xd1aa12);})[_0x143b('0x24')](function(_0xdb1d52){_0x42e136[_0x143b('0x3d')]=_0xdb1d52;return _0x42e136;})[_0x143b('0x24')](respondWithFilteredResult(_0x5535b5,_0xd1aa12))['catch'](handleError(_0x5535b5,null));};exports[_0x143b('0x3e')]=function(_0x19a1c1,_0x5a20e4){var _0x2f3816={'raw':![],'where':{'id':_0x19a1c1['params']['id']}},_0xf2cdd2={};_0xf2cdd2[_0x143b('0x2b')]=_[_0x143b('0x2d')](db[_0x143b('0x3b')]['rawAttributes']);_0xf2cdd2[_0x143b('0x2c')]=_[_0x143b('0x2d')](_0x19a1c1[_0x143b('0x2c')]);_0xf2cdd2[_0x143b('0x2e')]=_[_0x143b('0x2f')](_0xf2cdd2[_0x143b('0x2b')],_0xf2cdd2['query']);_0x2f3816[_0x143b('0x30')]=_[_0x143b('0x2f')](_0xf2cdd2[_0x143b('0x2b')],qs[_0x143b('0x31')](_0x19a1c1['query'][_0x143b('0x31')]));_0x2f3816[_0x143b('0x30')]=_0x2f3816[_0x143b('0x30')][_0x143b('0x3f')]?_0x2f3816[_0x143b('0x30')]:_0xf2cdd2[_0x143b('0x2b')];if(_0x19a1c1[_0x143b('0x2c')]['includeAll']){_0x2f3816['include']=[{'all':!![]}];}_0x2f3816=_['merge']({},_0x2f3816,_0x19a1c1[_0x143b('0x40')]);return db[_0x143b('0x3b')][_0x143b('0x41')](_0x2f3816)[_0x143b('0x24')](handleEntityNotFound(_0x5a20e4,null))[_0x143b('0x24')](respondWithResult(_0x5a20e4,null))[_0x143b('0x42')](handleError(_0x5a20e4,null));};exports[_0x143b('0x43')]=function(_0x3fd640,_0x46b46b){return db[_0x143b('0x3b')]['create'](_0x3fd640[_0x143b('0x44')],{})[_0x143b('0x24')](respondWithResult(_0x46b46b,0xc9))[_0x143b('0x42')](handleError(_0x46b46b,null));};exports[_0x143b('0x45')]=function(_0x48e3e5,_0x1e057d){if(_0x48e3e5['body']['id']){delete _0x48e3e5[_0x143b('0x44')]['id'];}return db[_0x143b('0x3b')]['find']({'where':{'id':_0x48e3e5['params']['id']}})[_0x143b('0x24')](handleEntityNotFound(_0x1e057d,null))[_0x143b('0x24')](saveUpdates(_0x48e3e5[_0x143b('0x44')],null))['then'](respondWithResult(_0x1e057d,null))[_0x143b('0x42')](handleError(_0x1e057d,null));};exports['destroy']=function(_0x409a65,_0x53535f){return db[_0x143b('0x3b')][_0x143b('0x41')]({'where':{'id':_0x409a65['params']['id']}})[_0x143b('0x24')](handleEntityNotFound(_0x53535f,null))[_0x143b('0x24')](removeEntity(_0x53535f,null))[_0x143b('0x42')](handleError(_0x53535f,null));};exports[_0x143b('0x46')]=function(_0x1cf6b5,_0x2b8cf1,_0x48a668){var _0xa2bdc5={};var _0x227d4e={};var _0x511594;var _0x48eb06;return db[_0x143b('0x3b')][_0x143b('0x47')]({'where':{'id':_0x1cf6b5[_0x143b('0x48')]['id']}})[_0x143b('0x24')](handleEntityNotFound(_0x2b8cf1,null))[_0x143b('0x24')](function(_0x3f1590){if(_0x3f1590){_0x511594=_0x3f1590;_0x227d4e[_0x143b('0x2b')]=_[_0x143b('0x2d')](db[_0x143b('0x49')][_0x143b('0x4a')]);_0x227d4e[_0x143b('0x2c')]=_[_0x143b('0x2d')](_0x1cf6b5['query']);_0x227d4e[_0x143b('0x2e')]=_[_0x143b('0x2f')](_0x227d4e[_0x143b('0x2b')],_0x227d4e[_0x143b('0x2c')]);_0xa2bdc5[_0x143b('0x30')]=_[_0x143b('0x2f')](_0x227d4e['model'],qs['fields'](_0x1cf6b5[_0x143b('0x2c')][_0x143b('0x31')]));_0xa2bdc5['attributes']=_0xa2bdc5[_0x143b('0x30')][_0x143b('0x3f')]?_0xa2bdc5[_0x143b('0x30')]:_0x227d4e['model'];_0xa2bdc5[_0x143b('0x4b')]=qs[_0x143b('0x34')](_0x1cf6b5['query'][_0x143b('0x34')]);_0xa2bdc5[_0x143b('0x37')]=qs[_0x143b('0x2e')](_['pick'](_0x1cf6b5[_0x143b('0x2c')],_0x227d4e[_0x143b('0x2e')]));if(_0x1cf6b5[_0x143b('0x2c')]['filter']){_0xa2bdc5[_0x143b('0x37')]=_['merge'](_0xa2bdc5[_0x143b('0x37')],{'$or':_[_0x143b('0x28')](_0xa2bdc5[_0x143b('0x30')],function(_0x39eb4c){var _0x52ec02={};_0x52ec02[_0x39eb4c]={'$like':'%'+_0x1cf6b5[_0x143b('0x2c')]['filter']+'%'};return _0x52ec02;})});}_0xa2bdc5=_[_0x143b('0x38')]({},_0xa2bdc5,_0x1cf6b5[_0x143b('0x40')]);return _0x511594[_0x143b('0x46')](_0xa2bdc5);}})[_0x143b('0x24')](function(_0x23b051){if(_0x23b051){_0x48eb06=_0x23b051[_0x143b('0x3f')];if(!_0x1cf6b5[_0x143b('0x2c')][_0x143b('0x32')](_0x143b('0x33'))){_0xa2bdc5[_0x143b('0x1f')]=qs[_0x143b('0x1f')](_0x1cf6b5[_0x143b('0x2c')][_0x143b('0x1f')]);_0xa2bdc5[_0x143b('0x1c')]=qs['offset'](_0x1cf6b5[_0x143b('0x2c')]['offset']);}return _0x511594[_0x143b('0x46')](_0xa2bdc5);}})[_0x143b('0x24')](function(_0x23ccde){if(_0x23ccde){return _0x23ccde?{'count':_0x48eb06,'rows':_0x23ccde}:null;}})[_0x143b('0x24')](respondWithResult(_0x2b8cf1,null))[_0x143b('0x42')](handleError(_0x2b8cf1,null));};exports[_0x143b('0x4c')]=function(_0x438c48,_0x213bb2,_0x4fcb86){if(_0x438c48[_0x143b('0x44')]['id']){delete _0x438c48[_0x143b('0x44')]['id'];}return db[_0x143b('0x3b')][_0x143b('0x47')]({'where':{'id':_0x438c48[_0x143b('0x48')]['id']}})[_0x143b('0x24')](handleEntityNotFound(_0x213bb2,null))[_0x143b('0x24')](function(_0x21df9a){if(_0x21df9a){_0x438c48[_0x143b('0x44')][_0x143b('0x4d')]=_0x21df9a['id'];_0x438c48[_0x143b('0x44')][_0x143b('0x4e')]=integrations[_0x143b('0x4f')](_0x438c48[_0x143b('0x44')][_0x143b('0x50')],_0x438c48['body']['type']);_0x438c48['body']['Descriptions']=integrations['getDescriptions'](_0x438c48[_0x143b('0x44')][_0x143b('0x50')],_0x438c48[_0x143b('0x44')][_0x143b('0x29')]);return db[_0x143b('0x49')]['create'](_0x438c48[_0x143b('0x44')],{'include':[{'model':db[_0x143b('0x51')],'as':_0x143b('0x4e')},{'model':db[_0x143b('0x51')],'as':_0x143b('0x52')}]});}return null;})[_0x143b('0x24')](respondWithResult(_0x213bb2,null))['catch'](handleError(_0x213bb2,null));};exports[_0x143b('0x53')]=function(_0x130837,_0x31771d,_0x508769){var _0x1d0403='';return db[_0x143b('0x3b')][_0x143b('0x47')]({'where':{'id':_0x130837[_0x143b('0x48')]['id']},'attributes':['id',_0x143b('0x54'),_0x143b('0x55')]})[_0x143b('0x24')](handleEntityNotFound(_0x31771d,null))[_0x143b('0x24')](function(_0x5fa2b2){if(_0x5fa2b2){_0x1d0403=_0x5fa2b2[_0x143b('0x54')];var _0x25641c=_0x1d0403['slice'](-0x1);if(_0x25641c==='/'){_0x1d0403=_0x1d0403[_0x143b('0x56')](0x0,_0x1d0403['lastIndexOf'](_0x25641c));}return rp({'method':_0x143b('0x57'),'uri':util['format'](_0x143b('0x58'),_0x1d0403,_0x143b('0x59')),'headers':{'Authorization':util['format'](_0x143b('0x5a'),new Buffer(util[_0x143b('0x5b')]('%s:X',_0x5fa2b2[_0x143b('0x55')]))[_0x143b('0x5c')](_0x143b('0x5d')))},'json':!![]});}})[_0x143b('0x24')](function(_0x69b2a2){if(_0x69b2a2){var _0x14a6a5=['requester',_0x143b('0x5e'),_0x143b('0x5f'),_0x143b('0x60'),_0x143b('0x19'),_0x143b('0x61'),'group','source',_0x143b('0x62'),_0x143b('0x63'),'company'];_[_0x143b('0x64')](_0x69b2a2,function(_0x29f1b1){return _0x14a6a5['includes'](_0x29f1b1[_0x143b('0x25')])||!_0x29f1b1[_0x143b('0x65')]&&_0x29f1b1['type']!==_0x143b('0x66')&&_0x29f1b1[_0x143b('0x29')]!=='custom_dropdown';});return{'count':_0x69b2a2[_0x143b('0x3f')],'rows':_[_0x143b('0x28')](_0x69b2a2,function(_0x2ff55e){return{'id':_0x2ff55e[_0x143b('0x25')],'name':_0x2ff55e[_0x143b('0x67')],'custom':!_0x2ff55e['default'],'options':_0x2ff55e[_0x143b('0x68')]?_[_0x143b('0x28')](_0x2ff55e['choices'],function(_0x58116b){return{'name':_[_0x143b('0x69')](_0x58116b),'value':_0x58116b};}):[]};})};}})[_0x143b('0x24')](respondWithResult(_0x31771d,null))[_0x143b('0x42')](function(_0x4b6f41){var _0x2336a7=_0x130837[_0x143b('0x2c')][_0x143b('0x6a')]?0x1f4:_0x4b6f41[_0x143b('0x6b')]||0x1f4;logger['error'](_0x143b('0x6c'),'getFields',_0x2336a7,JSON['stringify'](_0x4b6f41));delete _0x4b6f41[_0x143b('0x25')];if(_0x2336a7===0x191){_0x2336a7=0x190;}_0x31771d[_0x143b('0x19')](_0x2336a7)[_0x143b('0x26')](_0x130837[_0x143b('0x2c')][_0x143b('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x4b6f41['statusCode']}:_0x4b6f41);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index b701c11..25c9134 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 _0x544b=['exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x544b,0x1d7));var _0xb544=function(_0x52935e,_0x14a0be){_0x52935e=_0x52935e-0x0;var _0x4c8237=_0x544b[_0x52935e];return _0x4c8237;};'use strict';var _=require(_0xb544('0x0'));var util=require(_0xb544('0x1'));var logger=require(_0xb544('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb544('0x3'));var rp=require(_0xb544('0x4'));var fs=require('fs');var path=require(_0xb544('0x5'));var rimraf=require(_0xb544('0x6'));var config=require(_0xb544('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xb544('0x8'));module[_0xb544('0x9')]=function(_0x378eca,_0x55b314){return _0x378eca['define'](_0xb544('0xa'),attributes,{'tableName':_0xb544('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb058=['int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','FreshdeskAccount'];(function(_0x13e360,_0x287387){var _0x1674f4=function(_0x34e56e){while(--_0x34e56e){_0x13e360['push'](_0x13e360['shift']());}};_0x1674f4(++_0x287387);}(_0xb058,0xdd));var _0x8b05=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xb058[_0x18fb16];return _0x147b0d;};'use strict';var _=require(_0x8b05('0x0'));var util=require(_0x8b05('0x1'));var logger=require(_0x8b05('0x2'))(_0x8b05('0x3'));var moment=require(_0x8b05('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b05('0x5'));var rimraf=require(_0x8b05('0x6'));var config=require(_0x8b05('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x8b05('0x8')]=function(_0x1500f3,_0x5d4121){return _0x1500f3['define'](_0x8b05('0x9'),attributes,{'tableName':_0x8b05('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 244a2ae..8ea54c5 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 _0x37dc=['http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FreshdeskAccount','findAll','raw','options','limit','include','map','model','attributes','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','client'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x37dc,0x1e9));var _0xc37d=function(_0x5cb400,_0x531840){_0x5cb400=_0x5cb400-0x0;var _0x414515=_0x37dc[_0x5cb400];return _0x414515;};'use strict';var _=require(_0xc37d('0x0'));var util=require(_0xc37d('0x1'));var moment=require(_0xc37d('0x2'));var BPromise=require(_0xc37d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc37d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc37d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc37d('0x6')][_0xc37d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11fe31,_0x368c3b,_0x1d6e8b){return new BPromise(function(_0x2076b3,_0x79252d){return client[_0xc37d('0x8')](_0x11fe31,_0x1d6e8b)[_0xc37d('0x9')](function(_0x5a0a61){logger[_0xc37d('0xa')](_0xc37d('0xb'),_0x368c3b,'request\x20sent');logger[_0xc37d('0xc')](_0xc37d('0xd'),_0x368c3b,'request\x20sent',JSON[_0xc37d('0xe')](_0x5a0a61));if(_0x5a0a61[_0xc37d('0xf')]){if(_0x5a0a61['error'][_0xc37d('0x10')]===0x1f4){logger[_0xc37d('0xf')](_0xc37d('0xb'),_0x368c3b,_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);return _0x79252d(_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);}logger[_0xc37d('0xf')](_0xc37d('0xb'),_0x368c3b,_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);return _0x2076b3(_0x5a0a61[_0xc37d('0xf')]['message']);}else{logger['info'](_0xc37d('0xb'),_0x368c3b,'request\x20sent');_0x2076b3(_0x5a0a61['result'][_0xc37d('0x11')]);}})[_0xc37d('0x12')](function(_0x5b204f){logger[_0xc37d('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x368c3b,_0x5b204f);_0x79252d(_0x5b204f);});});}exports['GetFreshdeskAccount']=function(_0xcd23a5){var _0x1816f4=this;return new Promise(function(_0xfefa40,_0x36ee50){return db[_0xc37d('0x13')][_0xc37d('0x14')]({'raw':_0xcd23a5['options']?_0xcd23a5['options'][_0xc37d('0x15')]===undefined?!![]:![]:!![],'where':_0xcd23a5[_0xc37d('0x16')]?_0xcd23a5[_0xc37d('0x16')]['where']||null:null,'attributes':_0xcd23a5[_0xc37d('0x16')]?_0xcd23a5[_0xc37d('0x16')]['attributes']||null:null,'limit':_0xcd23a5[_0xc37d('0x16')]?_0xcd23a5['options'][_0xc37d('0x17')]||null:null,'include':_0xcd23a5[_0xc37d('0x16')]?_0xcd23a5[_0xc37d('0x16')][_0xc37d('0x18')]?_[_0xc37d('0x19')](_0xcd23a5[_0xc37d('0x16')][_0xc37d('0x18')],function(_0x1ab504){return{'model':db[_0x1ab504[_0xc37d('0x1a')]],'as':_0x1ab504['as'],'attributes':_0x1ab504['attributes'],'include':_0x1ab504[_0xc37d('0x18')]?_[_0xc37d('0x19')](_0x1ab504[_0xc37d('0x18')],function(_0x5c1dd7){return{'model':db[_0x5c1dd7[_0xc37d('0x1a')]],'as':_0x5c1dd7['as'],'attributes':_0x5c1dd7['attributes'],'include':_0x5c1dd7['include']?_[_0xc37d('0x19')](_0x5c1dd7[_0xc37d('0x18')],function(_0x459f13){return{'model':db[_0x459f13[_0xc37d('0x1a')]],'as':_0x459f13['as'],'attributes':_0x459f13[_0xc37d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a97ee){logger['info'](_0xc37d('0x1c'),_0xcd23a5);logger['debug'](_0xc37d('0x1c'),_0xcd23a5,JSON[_0xc37d('0xe')](_0x1a97ee));_0xfefa40(_0x1a97ee);})[_0xc37d('0x12')](function(_0x26be2a){logger[_0xc37d('0xf')](_0xc37d('0x1c'),_0x26be2a[_0xc37d('0x11')],_0xcd23a5);_0x36ee50(_0x1816f4[_0xc37d('0xf')](0x1f4,_0x26be2a['message']));});});};exports[_0xc37d('0x1d')]=function(_0x4a4f85){var _0x5993a3=this;return new Promise(function(_0xe86e22,_0x2a64fd){return db[_0xc37d('0x13')][_0xc37d('0x1e')]({'raw':_0x4a4f85[_0xc37d('0x16')]?_0x4a4f85[_0xc37d('0x16')][_0xc37d('0x15')]===undefined?!![]:![]:!![],'where':_0x4a4f85[_0xc37d('0x16')]?_0x4a4f85[_0xc37d('0x16')]['where']||null:null,'attributes':_0x4a4f85['options']?_0x4a4f85[_0xc37d('0x16')][_0xc37d('0x1b')]||null:null,'include':_0x4a4f85[_0xc37d('0x16')]?_0x4a4f85['options'][_0xc37d('0x18')]?_[_0xc37d('0x19')](_0x4a4f85[_0xc37d('0x16')]['include'],function(_0x29709e){return{'model':db[_0x29709e[_0xc37d('0x1a')]],'as':_0x29709e['as'],'attributes':_0x29709e[_0xc37d('0x1b')],'include':_0x29709e[_0xc37d('0x18')]?_[_0xc37d('0x19')](_0x29709e['include'],function(_0x4c6aab){return{'model':db[_0x4c6aab[_0xc37d('0x1a')]],'as':_0x4c6aab['as'],'attributes':_0x4c6aab['attributes'],'include':_0x4c6aab[_0xc37d('0x18')]?_[_0xc37d('0x19')](_0x4c6aab[_0xc37d('0x18')],function(_0x9febe3){return{'model':db[_0x9febe3[_0xc37d('0x1a')]],'as':_0x9febe3['as'],'attributes':_0x9febe3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f4feb){logger[_0xc37d('0xa')](_0xc37d('0x1d'),_0x4a4f85);logger['debug'](_0xc37d('0x1d'),_0x4a4f85,JSON[_0xc37d('0xe')](_0x3f4feb));_0xe86e22(_0x3f4feb);})[_0xc37d('0x12')](function(_0x25a3ab){logger[_0xc37d('0xf')](_0xc37d('0x1d'),_0x25a3ab[_0xc37d('0x11')],_0x4a4f85);_0x2a64fd(_0x5993a3['error'](0x1f4,_0x25a3ab['message']));});});}; \ No newline at end of file +var _0x2c00=['include','map','model','then','debug','catch','ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','FreshdeskAccount,\x20%s,\x20%s','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit'];(function(_0x272cc8,_0x136d01){var _0xeea593=function(_0x4489fa){while(--_0x4489fa){_0x272cc8['push'](_0x272cc8['shift']());}};_0xeea593(++_0x136d01);}(_0x2c00,0x138));var _0x02c0=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x2c00[_0x102ff9];return _0x24fa97;};'use strict';var _=require(_0x02c0('0x0'));var util=require(_0x02c0('0x1'));var moment=require('moment');var BPromise=require(_0x02c0('0x2'));var rs=require(_0x02c0('0x3'));var fs=require('fs');var Redis=require(_0x02c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x02c0('0x5'));var logger=require(_0x02c0('0x6'))(_0x02c0('0x7'));var config=require(_0x02c0('0x8'));var jayson=require(_0x02c0('0x9'));var client=jayson[_0x02c0('0xa')][_0x02c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15b880,_0x162403,_0x3b0185){return new BPromise(function(_0x554c5d,_0x4beff0){return client[_0x02c0('0xc')](_0x15b880,_0x3b0185)['then'](function(_0x2a2c42){logger[_0x02c0('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x162403,_0x02c0('0xe'));logger['debug'](_0x02c0('0xf'),_0x162403,_0x02c0('0xe'),JSON[_0x02c0('0x10')](_0x2a2c42));if(_0x2a2c42['error']){if(_0x2a2c42['error'][_0x02c0('0x11')]===0x1f4){logger[_0x02c0('0x12')](_0x02c0('0x13'),_0x162403,_0x2a2c42[_0x02c0('0x12')]['message']);return _0x4beff0(_0x2a2c42[_0x02c0('0x12')][_0x02c0('0x14')]);}logger[_0x02c0('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x162403,_0x2a2c42['error']['message']);return _0x554c5d(_0x2a2c42[_0x02c0('0x12')][_0x02c0('0x14')]);}else{logger[_0x02c0('0xd')](_0x02c0('0x13'),_0x162403,_0x02c0('0xe'));_0x554c5d(_0x2a2c42[_0x02c0('0x15')][_0x02c0('0x14')]);}})['catch'](function(_0x5bc74d){logger[_0x02c0('0x12')](_0x02c0('0x13'),_0x162403,_0x5bc74d);_0x4beff0(_0x5bc74d);});});}exports[_0x02c0('0x16')]=function(_0x21525c){var _0x89f638=this;return new Promise(function(_0x1a4c5c,_0x2b8ef5){return db[_0x02c0('0x17')][_0x02c0('0x18')]({'raw':_0x21525c[_0x02c0('0x19')]?_0x21525c['options'][_0x02c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x21525c[_0x02c0('0x19')]?_0x21525c['options'][_0x02c0('0x1b')]||null:null,'attributes':_0x21525c[_0x02c0('0x19')]?_0x21525c[_0x02c0('0x19')][_0x02c0('0x1c')]||null:null,'limit':_0x21525c[_0x02c0('0x19')]?_0x21525c['options'][_0x02c0('0x1d')]||null:null,'include':_0x21525c[_0x02c0('0x19')]?_0x21525c[_0x02c0('0x19')][_0x02c0('0x1e')]?_[_0x02c0('0x1f')](_0x21525c['options'][_0x02c0('0x1e')],function(_0x1e1071){return{'model':db[_0x1e1071['model']],'as':_0x1e1071['as'],'attributes':_0x1e1071[_0x02c0('0x1c')],'include':_0x1e1071[_0x02c0('0x1e')]?_[_0x02c0('0x1f')](_0x1e1071[_0x02c0('0x1e')],function(_0x69c9c1){return{'model':db[_0x69c9c1[_0x02c0('0x20')]],'as':_0x69c9c1['as'],'attributes':_0x69c9c1[_0x02c0('0x1c')],'include':_0x69c9c1[_0x02c0('0x1e')]?_['map'](_0x69c9c1['include'],function(_0x364636){return{'model':db[_0x364636['model']],'as':_0x364636['as'],'attributes':_0x364636['attributes']};}):[]};}):[]};}):[]:[]})[_0x02c0('0x21')](function(_0x595430){logger[_0x02c0('0xd')](_0x02c0('0x16'),_0x21525c);logger[_0x02c0('0x22')](_0x02c0('0x16'),_0x21525c,JSON[_0x02c0('0x10')](_0x595430));_0x1a4c5c(_0x595430);})[_0x02c0('0x23')](function(_0x202810){logger['error'](_0x02c0('0x16'),_0x202810[_0x02c0('0x14')],_0x21525c);_0x2b8ef5(_0x89f638['error'](0x1f4,_0x202810[_0x02c0('0x14')]));});});};exports[_0x02c0('0x24')]=function(_0xb6788a){var _0x535c47=this;return new Promise(function(_0x4084a7,_0x4f263e){return db[_0x02c0('0x17')][_0x02c0('0x25')]({'raw':_0xb6788a[_0x02c0('0x19')]?_0xb6788a['options']['raw']===undefined?!![]:![]:!![],'where':_0xb6788a[_0x02c0('0x19')]?_0xb6788a[_0x02c0('0x19')]['where']||null:null,'attributes':_0xb6788a[_0x02c0('0x19')]?_0xb6788a[_0x02c0('0x19')]['attributes']||null:null,'include':_0xb6788a['options']?_0xb6788a[_0x02c0('0x19')][_0x02c0('0x1e')]?_['map'](_0xb6788a['options']['include'],function(_0x498ff8){return{'model':db[_0x498ff8[_0x02c0('0x20')]],'as':_0x498ff8['as'],'attributes':_0x498ff8['attributes'],'include':_0x498ff8[_0x02c0('0x1e')]?_[_0x02c0('0x1f')](_0x498ff8[_0x02c0('0x1e')],function(_0x1bbf1e){return{'model':db[_0x1bbf1e[_0x02c0('0x20')]],'as':_0x1bbf1e['as'],'attributes':_0x1bbf1e[_0x02c0('0x1c')],'include':_0x1bbf1e[_0x02c0('0x1e')]?_[_0x02c0('0x1f')](_0x1bbf1e[_0x02c0('0x1e')],function(_0x11fe9b){return{'model':db[_0x11fe9b[_0x02c0('0x20')]],'as':_0x11fe9b['as'],'attributes':_0x11fe9b['attributes']};}):[]};}):[]};}):[]:[]})[_0x02c0('0x21')](function(_0x59eb47){logger[_0x02c0('0xd')]('ShowFreshdeskAccount',_0xb6788a);logger['debug'](_0x02c0('0x24'),_0xb6788a,JSON[_0x02c0('0x10')](_0x59eb47));_0x4084a7(_0x59eb47);})['catch'](function(_0x28f998){logger[_0x02c0('0x12')](_0x02c0('0x24'),_0x28f998[_0x02c0('0x14')],_0xb6788a);_0x4f263e(_0x535c47[_0x02c0('0x12')](0x1f4,_0x28f998[_0x02c0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 945536a..3c30ecf 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 _0x9f96=['/:id/descriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects'];(function(_0x14e58d,_0x3e2db6){var _0x48bcff=function(_0x4affff){while(--_0x4affff){_0x14e58d['push'](_0x14e58d['shift']());}};_0x48bcff(++_0x3e2db6);}(_0x9f96,0x1ee));var _0x69f9=function(_0x139528,_0x2f049b){_0x139528=_0x139528-0x0;var _0x55fd7f=_0x9f96[_0x139528];return _0x55fd7f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x69f9('0x0'));var express=require(_0x69f9('0x1'));var router=express[_0x69f9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x69f9('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x69f9('0x4'));router[_0x69f9('0x5')]('/',auth[_0x69f9('0x6')](),controller[_0x69f9('0x7')]);router['get'](_0x69f9('0x8'),auth[_0x69f9('0x6')](),controller['show']);router[_0x69f9('0x5')](_0x69f9('0x9'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x69f9('0xa'),auth[_0x69f9('0x6')](),controller[_0x69f9('0xb')]);router[_0x69f9('0x5')](_0x69f9('0xc'),auth['isAuthenticated'](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x69f9('0x6')](),controller[_0x69f9('0xd')]);router[_0x69f9('0xe')]('/',auth[_0x69f9('0x6')](),controller[_0x69f9('0xf')]);router['post'](_0x69f9('0x10'),auth[_0x69f9('0x6')](),controller[_0x69f9('0x11')]);router[_0x69f9('0x12')](_0x69f9('0x8'),auth[_0x69f9('0x6')](),controller[_0x69f9('0x13')]);router[_0x69f9('0x14')](_0x69f9('0x8'),auth[_0x69f9('0x6')](),controller[_0x69f9('0x15')]);module[_0x69f9('0x16')]=router; \ No newline at end of file +var _0x24ac=['/:id/tags','getTags','post','create','setTags','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x123601,_0x546b61){var _0x2d179b=function(_0x302c37){while(--_0x302c37){_0x123601['push'](_0x123601['shift']());}};_0x2d179b(++_0x546b61);}(_0x24ac,0xb8));var _0xc24a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24ac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc24a('0x0'));var util=require('util');var path=require(_0xc24a('0x1'));var timeout=require(_0xc24a('0x2'));var express=require(_0xc24a('0x3'));var router=express[_0xc24a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc24a('0x5'));var interaction=require(_0xc24a('0x6'));var config=require(_0xc24a('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xc24a('0x8')]('/',auth[_0xc24a('0x9')](),controller['index']);router['get']('/:id',auth[_0xc24a('0x9')](),controller[_0xc24a('0xa')]);router[_0xc24a('0x8')](_0xc24a('0xb'),auth['isAuthenticated'](),controller[_0xc24a('0xc')]);router[_0xc24a('0x8')](_0xc24a('0xd'),auth['isAuthenticated'](),controller[_0xc24a('0xe')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xc24a('0xf')]);router[_0xc24a('0x8')](_0xc24a('0x10'),auth[_0xc24a('0x9')](),controller[_0xc24a('0x11')]);router[_0xc24a('0x12')]('/',auth[_0xc24a('0x9')](),controller[_0xc24a('0x13')]);router[_0xc24a('0x12')](_0xc24a('0x10'),auth['isAuthenticated'](),controller[_0xc24a('0x14')]);router['put'](_0xc24a('0x15'),auth[_0xc24a('0x9')](),controller['update']);router[_0xc24a('0x16')](_0xc24a('0x15'),auth['isAuthenticated'](),controller[_0xc24a('0x17')]);module[_0xc24a('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 4591058..e9c188d 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 _0x15a0=['STRING','sequelize','exports'];(function(_0x1a76c1,_0x85d3c0){var _0x3d62f6=function(_0x1faa5a){while(--_0x1faa5a){_0x1a76c1['push'](_0x1a76c1['shift']());}};_0x3d62f6(++_0x85d3c0);}(_0x15a0,0x160));var _0x015a=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x15a0[_0x220afa];return _0x1b79d1;};'use strict';var Sequelize=require(_0x015a('0x0'));module[_0x015a('0x1')]={'name':{'type':Sequelize[_0x015a('0x2')]},'description':{'type':Sequelize[_0x015a('0x2')]}}; \ No newline at end of file +var _0x2c45=['sequelize','STRING'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0x2c45,0x8e));var _0x52c4=function(_0xebb8b7,_0x285c63){_0xebb8b7=_0xebb8b7-0x0;var _0x1e636b=_0x2c45[_0xebb8b7];return _0x1e636b;};'use strict';var Sequelize=require(_0x52c4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x52c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 5868995..60993e2 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 _0x85da=['status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x85da,0xdb));var _0xa85d=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x85da[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0xa85d('0x0'));var rimraf=require(_0xa85d('0x1'));var zipdir=require(_0xa85d('0x2'));var jsonpatch=require(_0xa85d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa85d('0x4'));var util=require(_0xa85d('0x5'));var path=require(_0xa85d('0x6'));var sox=require('sox');var csv=require(_0xa85d('0x7'));var ejs=require(_0xa85d('0x8'));var fs=require('fs');var fs_extra=require(_0xa85d('0x9'));var _=require('lodash');var squel=require(_0xa85d('0xa'));var crypto=require('crypto');var jsforce=require(_0xa85d('0xb'));var deskjs=require(_0xa85d('0xc'));var toCsv=require(_0xa85d('0x7'));var querystring=require(_0xa85d('0xd'));var Papa=require(_0xa85d('0xe'));var Redis=require(_0xa85d('0xf'));var authService=require(_0xa85d('0x10'));var qs=require(_0xa85d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa85d('0x12'));var logger=require('../../config/logger')(_0xa85d('0x13'));var utils=require('../../config/utils');var config=require(_0xa85d('0x14'));var licenseUtil=require(_0xa85d('0x15'));var db=require(_0xa85d('0x16'))['db'];function respondWithStatusCode(_0x1f21fd,_0x4cdc15){_0x4cdc15=_0x4cdc15||0xcc;return function(_0x585da2){if(_0x585da2){return _0x1f21fd[_0xa85d('0x17')](_0x4cdc15);}return _0x1f21fd['status'](_0x4cdc15)['end']();};}function respondWithResult(_0x1c1ac9,_0x4ee21e){_0x4ee21e=_0x4ee21e||0xc8;return function(_0x5bc3bc){if(_0x5bc3bc){return _0x1c1ac9[_0xa85d('0x18')](_0x4ee21e)[_0xa85d('0x19')](_0x5bc3bc);}};}function respondWithFilteredResult(_0x551068,_0x1992ab){return function(_0x2c484c){if(_0x2c484c){var _0x4128c3=typeof _0x1992ab[_0xa85d('0x1a')]===_0xa85d('0x1b')&&typeof _0x1992ab[_0xa85d('0x1c')]===_0xa85d('0x1b');var _0x64705a=_0x2c484c[_0xa85d('0x1d')];var _0x25b594=_0x4128c3?0x0:_0x1992ab[_0xa85d('0x1a')];var _0x553700=_0x4128c3?_0x2c484c[_0xa85d('0x1d')]:_0x1992ab[_0xa85d('0x1a')]+_0x1992ab[_0xa85d('0x1c')];var _0x361a85;if(_0x553700>=_0x64705a){_0x553700=_0x64705a;_0x361a85=0xc8;}else{_0x361a85=0xce;}_0x551068[_0xa85d('0x18')](_0x361a85);return _0x551068[_0xa85d('0x1e')](_0xa85d('0x1f'),_0x25b594+'-'+_0x553700+'/'+_0x64705a)[_0xa85d('0x19')](_0x2c484c);}return null;};}function patchUpdates(_0x36b76b){return function(_0x5dfad9){try{jsonpatch[_0xa85d('0x20')](_0x5dfad9,_0x36b76b,!![]);}catch(_0x29b66a){return BPromise['reject'](_0x29b66a);}return _0x5dfad9[_0xa85d('0x21')]();};}function saveUpdates(_0x3b9fd5,_0x2207d0){return function(_0x1aee8f){if(_0x1aee8f){return _0x1aee8f[_0xa85d('0x22')](_0x3b9fd5)['then'](function(_0x120794){return _0x120794;});}return null;};}function removeEntity(_0x2d01b3,_0x2395db){return function(_0x2539bd){if(_0x2539bd){return _0x2539bd[_0xa85d('0x23')]()[_0xa85d('0x24')](function(){_0x2d01b3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c2dc,_0x38e364){return function(_0x387ee8){if(!_0x387ee8){_0x24c2dc[_0xa85d('0x17')](0x194);}return _0x387ee8;};}function handleError(_0x41b310,_0x1e32e4){_0x1e32e4=_0x1e32e4||0x1f4;return function(_0x16b99c){logger['error'](_0x16b99c[_0xa85d('0x25')]);if(_0x16b99c['name']){delete _0x16b99c[_0xa85d('0x26')];}_0x41b310['status'](_0x1e32e4)[_0xa85d('0x27')](_0x16b99c);};}exports[_0xa85d('0x28')]=function(_0x28b4c4,_0x3e32f0){var _0x87080a={},_0x40e503={},_0x2f68eb={'count':0x0,'rows':[]};var _0x2e6442=_[_0xa85d('0x29')](db[_0xa85d('0x2a')][_0xa85d('0x2b')],function(_0x430a16){return{'name':_0x430a16['fieldName'],'type':_0x430a16[_0xa85d('0x2c')][_0xa85d('0x2d')]};});_0x40e503['model']=_[_0xa85d('0x29')](_0x2e6442,'name');_0x40e503[_0xa85d('0x2e')]=_['keys'](_0x28b4c4[_0xa85d('0x2e')]);_0x40e503[_0xa85d('0x2f')]=_[_0xa85d('0x30')](_0x40e503[_0xa85d('0x31')],_0x40e503[_0xa85d('0x2e')]);_0x87080a[_0xa85d('0x32')]=_[_0xa85d('0x30')](_0x40e503[_0xa85d('0x31')],qs['fields'](_0x28b4c4[_0xa85d('0x2e')][_0xa85d('0x33')]));_0x87080a['attributes']=_0x87080a[_0xa85d('0x32')][_0xa85d('0x34')]?_0x87080a['attributes']:_0x40e503[_0xa85d('0x31')];if(!_0x28b4c4[_0xa85d('0x2e')][_0xa85d('0x35')](_0xa85d('0x36'))){_0x87080a[_0xa85d('0x1c')]=qs[_0xa85d('0x1c')](_0x28b4c4[_0xa85d('0x2e')][_0xa85d('0x1c')]);_0x87080a[_0xa85d('0x1a')]=qs[_0xa85d('0x1a')](_0x28b4c4['query'][_0xa85d('0x1a')]);}_0x87080a[_0xa85d('0x37')]=qs[_0xa85d('0x38')](_0x28b4c4[_0xa85d('0x2e')][_0xa85d('0x38')]);_0x87080a['where']=qs[_0xa85d('0x2f')](_[_0xa85d('0x39')](_0x28b4c4[_0xa85d('0x2e')],_0x40e503[_0xa85d('0x2f')]),_0x2e6442);if(_0x28b4c4[_0xa85d('0x2e')][_0xa85d('0x3a')]){_0x87080a['where']=_[_0xa85d('0x3b')](_0x87080a[_0xa85d('0x3c')],{'$or':_['map'](_0x2e6442,function(_0x2a1833){if(_0x2a1833[_0xa85d('0x2c')]!=='VIRTUAL'){var _0x5ca616={};_0x5ca616[_0x2a1833[_0xa85d('0x26')]]={'$like':'%'+_0x28b4c4[_0xa85d('0x2e')][_0xa85d('0x3a')]+'%'};return _0x5ca616;}})});}_0x87080a=_['merge']({},_0x87080a,_0x28b4c4[_0xa85d('0x3d')]);var _0x27860f={'where':_0x87080a[_0xa85d('0x3c')]};return db[_0xa85d('0x2a')][_0xa85d('0x1d')](_0x27860f)['then'](function(_0x125ef2){_0x2f68eb[_0xa85d('0x1d')]=_0x125ef2;if(_0x28b4c4[_0xa85d('0x2e')][_0xa85d('0x3e')]){_0x87080a[_0xa85d('0x3f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xa85d('0x40')](_0x87080a);})[_0xa85d('0x24')](function(_0x4f3e3e){_0x2f68eb[_0xa85d('0x41')]=_0x4f3e3e;return _0x2f68eb;})[_0xa85d('0x24')](respondWithFilteredResult(_0x3e32f0,_0x87080a))[_0xa85d('0x42')](handleError(_0x3e32f0,null));};exports[_0xa85d('0x43')]=function(_0xccb92f,_0x5eb5ff){var _0x3d3b58={'raw':![],'where':{'id':_0xccb92f[_0xa85d('0x44')]['id']}},_0x31e7cd={};_0x31e7cd[_0xa85d('0x31')]=_[_0xa85d('0x45')](db[_0xa85d('0x2a')][_0xa85d('0x2b')]);_0x31e7cd[_0xa85d('0x2e')]=_[_0xa85d('0x45')](_0xccb92f[_0xa85d('0x2e')]);_0x31e7cd[_0xa85d('0x2f')]=_[_0xa85d('0x30')](_0x31e7cd[_0xa85d('0x31')],_0x31e7cd[_0xa85d('0x2e')]);_0x3d3b58[_0xa85d('0x32')]=_[_0xa85d('0x30')](_0x31e7cd[_0xa85d('0x31')],qs[_0xa85d('0x33')](_0xccb92f['query']['fields']));_0x3d3b58[_0xa85d('0x32')]=_0x3d3b58['attributes'][_0xa85d('0x34')]?_0x3d3b58[_0xa85d('0x32')]:_0x31e7cd[_0xa85d('0x31')];if(_0xccb92f[_0xa85d('0x2e')][_0xa85d('0x3e')]){_0x3d3b58['include']=[{'all':!![]}];}_0x3d3b58=_['merge']({},_0x3d3b58,_0xccb92f[_0xa85d('0x3d')]);return db[_0xa85d('0x2a')]['find'](_0x3d3b58)['then'](handleEntityNotFound(_0x5eb5ff,null))[_0xa85d('0x24')](respondWithResult(_0x5eb5ff,null))['catch'](handleError(_0x5eb5ff,null));};exports[_0xa85d('0x46')]=function(_0x12d6d5,_0x3b355e){return db[_0xa85d('0x2a')][_0xa85d('0x46')](_0x12d6d5['body'],{})[_0xa85d('0x24')](respondWithResult(_0x3b355e,0xc9))[_0xa85d('0x42')](handleError(_0x3b355e,null));};exports['update']=function(_0x3e8f6f,_0x34dc65){if(_0x3e8f6f[_0xa85d('0x47')]['id']){delete _0x3e8f6f[_0xa85d('0x47')]['id'];}return db['FreshdeskConfiguration'][_0xa85d('0x48')]({'where':{'id':_0x3e8f6f[_0xa85d('0x44')]['id']}})[_0xa85d('0x24')](handleEntityNotFound(_0x34dc65,null))[_0xa85d('0x24')](saveUpdates(_0x3e8f6f[_0xa85d('0x47')],null))[_0xa85d('0x24')](respondWithResult(_0x34dc65,null))[_0xa85d('0x42')](handleError(_0x34dc65,null));};exports[_0xa85d('0x23')]=function(_0x2a0b60,_0x484bca){return db[_0xa85d('0x2a')][_0xa85d('0x48')]({'where':{'id':_0x2a0b60[_0xa85d('0x44')]['id']}})[_0xa85d('0x24')](handleEntityNotFound(_0x484bca,null))[_0xa85d('0x24')](removeEntity(_0x484bca,null))['catch'](handleError(_0x484bca,null));};exports[_0xa85d('0x49')]=function(_0x3cdf9b,_0x51defc,_0x5b0b0d){var _0x8ac537={};var _0x2c4f80={};var _0x45605f;var _0x3f10a1;return db['FreshdeskConfiguration'][_0xa85d('0x4a')]({'where':{'id':_0x3cdf9b['params']['id']}})[_0xa85d('0x24')](handleEntityNotFound(_0x51defc,null))['then'](function(_0x3bf86c){if(_0x3bf86c){_0x45605f=_0x3bf86c;_0x2c4f80[_0xa85d('0x31')]=_[_0xa85d('0x45')](db[_0xa85d('0x4b')]['rawAttributes']);_0x2c4f80[_0xa85d('0x2e')]=_[_0xa85d('0x45')](_0x3cdf9b['query']);_0x2c4f80[_0xa85d('0x2f')]=_[_0xa85d('0x30')](_0x2c4f80[_0xa85d('0x31')],_0x2c4f80[_0xa85d('0x2e')]);_0x8ac537[_0xa85d('0x32')]=_[_0xa85d('0x30')](_0x2c4f80[_0xa85d('0x31')],qs['fields'](_0x3cdf9b[_0xa85d('0x2e')][_0xa85d('0x33')]));_0x8ac537[_0xa85d('0x32')]=_0x8ac537['attributes'][_0xa85d('0x34')]?_0x8ac537[_0xa85d('0x32')]:_0x2c4f80[_0xa85d('0x31')];_0x8ac537['order']=qs[_0xa85d('0x38')](_0x3cdf9b[_0xa85d('0x2e')][_0xa85d('0x38')]);_0x8ac537[_0xa85d('0x3c')]=qs[_0xa85d('0x2f')](_['pick'](_0x3cdf9b[_0xa85d('0x2e')],_0x2c4f80[_0xa85d('0x2f')]));if(_0x3cdf9b[_0xa85d('0x2e')][_0xa85d('0x3a')]){_0x8ac537[_0xa85d('0x3c')]=_[_0xa85d('0x3b')](_0x8ac537[_0xa85d('0x3c')],{'$or':_['map'](_0x8ac537[_0xa85d('0x32')],function(_0x38b767){var _0xe4f629={};_0xe4f629[_0x38b767]={'$like':'%'+_0x3cdf9b[_0xa85d('0x2e')]['filter']+'%'};return _0xe4f629;})});}_0x8ac537=_[_0xa85d('0x3b')]({},_0x8ac537,_0x3cdf9b[_0xa85d('0x3d')]);return _0x45605f[_0xa85d('0x49')](_0x8ac537);}})[_0xa85d('0x24')](function(_0x419fcd){if(_0x419fcd){_0x3f10a1=_0x419fcd[_0xa85d('0x34')];if(!_0x3cdf9b[_0xa85d('0x2e')][_0xa85d('0x35')](_0xa85d('0x36'))){_0x8ac537[_0xa85d('0x1c')]=qs[_0xa85d('0x1c')](_0x3cdf9b[_0xa85d('0x2e')][_0xa85d('0x1c')]);_0x8ac537[_0xa85d('0x1a')]=qs['offset'](_0x3cdf9b[_0xa85d('0x2e')][_0xa85d('0x1a')]);}return _0x45605f['getFields'](_0x8ac537);}})[_0xa85d('0x24')](function(_0x2a9aaf){if(_0x2a9aaf){return _0x2a9aaf?{'count':_0x3f10a1,'rows':_0x2a9aaf}:null;}})[_0xa85d('0x24')](respondWithResult(_0x51defc,null))['catch'](handleError(_0x51defc,null));};exports['getSubjects']=function(_0x57e76a,_0x5b4586,_0x5f8e7f){var _0x275949={};var _0x48124d={};var _0x1d36cd;var _0x2c4241;return db['FreshdeskConfiguration'][_0xa85d('0x4a')]({'where':{'id':_0x57e76a[_0xa85d('0x44')]['id']}})[_0xa85d('0x24')](handleEntityNotFound(_0x5b4586,null))[_0xa85d('0x24')](function(_0x2c1a43){if(_0x2c1a43){_0x1d36cd=_0x2c1a43;_0x48124d[_0xa85d('0x31')]=_['keys'](db[_0xa85d('0x4b')][_0xa85d('0x2b')]);_0x48124d['query']=_[_0xa85d('0x45')](_0x57e76a[_0xa85d('0x2e')]);_0x48124d[_0xa85d('0x2f')]=_[_0xa85d('0x30')](_0x48124d[_0xa85d('0x31')],_0x48124d[_0xa85d('0x2e')]);_0x275949['attributes']=_[_0xa85d('0x30')](_0x48124d[_0xa85d('0x31')],qs[_0xa85d('0x33')](_0x57e76a[_0xa85d('0x2e')][_0xa85d('0x33')]));_0x275949['attributes']=_0x275949['attributes'][_0xa85d('0x34')]?_0x275949[_0xa85d('0x32')]:_0x48124d[_0xa85d('0x31')];_0x275949[_0xa85d('0x37')]=qs[_0xa85d('0x38')](_0x57e76a[_0xa85d('0x2e')][_0xa85d('0x38')]);_0x275949[_0xa85d('0x3c')]=qs['filters'](_[_0xa85d('0x39')](_0x57e76a[_0xa85d('0x2e')],_0x48124d[_0xa85d('0x2f')]));if(_0x57e76a[_0xa85d('0x2e')][_0xa85d('0x3a')]){_0x275949[_0xa85d('0x3c')]=_[_0xa85d('0x3b')](_0x275949['where'],{'$or':_['map'](_0x275949[_0xa85d('0x32')],function(_0x5d4bda){var _0x26ec59={};_0x26ec59[_0x5d4bda]={'$like':'%'+_0x57e76a[_0xa85d('0x2e')][_0xa85d('0x3a')]+'%'};return _0x26ec59;})});}_0x275949=_[_0xa85d('0x3b')]({},_0x275949,_0x57e76a['options']);return _0x1d36cd[_0xa85d('0x4c')](_0x275949);}})['then'](function(_0xa992e3){if(_0xa992e3){_0x2c4241=_0xa992e3['length'];if(!_0x57e76a['query'][_0xa85d('0x35')]('nolimit')){_0x275949[_0xa85d('0x1c')]=qs[_0xa85d('0x1c')](_0x57e76a[_0xa85d('0x2e')][_0xa85d('0x1c')]);_0x275949[_0xa85d('0x1a')]=qs[_0xa85d('0x1a')](_0x57e76a['query'][_0xa85d('0x1a')]);}return _0x1d36cd[_0xa85d('0x4c')](_0x275949);}})['then'](function(_0x5a4776){if(_0x5a4776){return _0x5a4776?{'count':_0x2c4241,'rows':_0x5a4776}:null;}})[_0xa85d('0x24')](respondWithResult(_0x5b4586,null))[_0xa85d('0x42')](handleError(_0x5b4586,null));};exports[_0xa85d('0x4d')]=function(_0x310f9c,_0x1aebf2,_0x466445){var _0x2bf780={};var _0x3440ae={};var _0x1c455a;var _0x12cfba;return db['FreshdeskConfiguration'][_0xa85d('0x4a')]({'where':{'id':_0x310f9c[_0xa85d('0x44')]['id']}})[_0xa85d('0x24')](handleEntityNotFound(_0x1aebf2,null))[_0xa85d('0x24')](function(_0x126624){if(_0x126624){_0x1c455a=_0x126624;_0x3440ae[_0xa85d('0x31')]=_[_0xa85d('0x45')](db[_0xa85d('0x4b')][_0xa85d('0x2b')]);_0x3440ae[_0xa85d('0x2e')]=_[_0xa85d('0x45')](_0x310f9c[_0xa85d('0x2e')]);_0x3440ae['filters']=_['intersection'](_0x3440ae[_0xa85d('0x31')],_0x3440ae[_0xa85d('0x2e')]);_0x2bf780['attributes']=_['intersection'](_0x3440ae[_0xa85d('0x31')],qs[_0xa85d('0x33')](_0x310f9c[_0xa85d('0x2e')][_0xa85d('0x33')]));_0x2bf780[_0xa85d('0x32')]=_0x2bf780[_0xa85d('0x32')]['length']?_0x2bf780[_0xa85d('0x32')]:_0x3440ae[_0xa85d('0x31')];_0x2bf780['order']=qs[_0xa85d('0x38')](_0x310f9c['query'][_0xa85d('0x38')]);_0x2bf780['where']=qs[_0xa85d('0x2f')](_[_0xa85d('0x39')](_0x310f9c[_0xa85d('0x2e')],_0x3440ae[_0xa85d('0x2f')]));if(_0x310f9c[_0xa85d('0x2e')][_0xa85d('0x3a')]){_0x2bf780[_0xa85d('0x3c')]=_[_0xa85d('0x3b')](_0x2bf780[_0xa85d('0x3c')],{'$or':_['map'](_0x2bf780[_0xa85d('0x32')],function(_0x485017){var _0xb13ae1={};_0xb13ae1[_0x485017]={'$like':'%'+_0x310f9c[_0xa85d('0x2e')]['filter']+'%'};return _0xb13ae1;})});}_0x2bf780=_[_0xa85d('0x3b')]({},_0x2bf780,_0x310f9c[_0xa85d('0x3d')]);return _0x1c455a[_0xa85d('0x4d')](_0x2bf780);}})[_0xa85d('0x24')](function(_0x155632){if(_0x155632){_0x12cfba=_0x155632[_0xa85d('0x34')];if(!_0x310f9c[_0xa85d('0x2e')][_0xa85d('0x35')](_0xa85d('0x36'))){_0x2bf780[_0xa85d('0x1c')]=qs[_0xa85d('0x1c')](_0x310f9c['query'][_0xa85d('0x1c')]);_0x2bf780[_0xa85d('0x1a')]=qs[_0xa85d('0x1a')](_0x310f9c[_0xa85d('0x2e')]['offset']);}return _0x1c455a['getDescriptions'](_0x2bf780);}})[_0xa85d('0x24')](function(_0x27d933){if(_0x27d933){return _0x27d933?{'count':_0x12cfba,'rows':_0x27d933}:null;}})['then'](respondWithResult(_0x1aebf2,null))[_0xa85d('0x42')](handleError(_0x1aebf2,null));};exports['getTags']=function(_0x350052,_0x9dbb6a,_0x99798b){var _0x34ad9b={};var _0x3f3fce={};var _0x4cc468;var _0x4337c2;return db['FreshdeskConfiguration'][_0xa85d('0x4a')]({'where':{'id':_0x350052['params']['id']}})[_0xa85d('0x24')](handleEntityNotFound(_0x9dbb6a,null))[_0xa85d('0x24')](function(_0x507abf){if(_0x507abf){_0x4cc468=_0x507abf;_0x3f3fce[_0xa85d('0x31')]=_['keys'](db[_0xa85d('0x4e')]['rawAttributes']);_0x3f3fce[_0xa85d('0x2e')]=_[_0xa85d('0x45')](_0x350052[_0xa85d('0x2e')]);_0x3f3fce['filters']=_[_0xa85d('0x30')](_0x3f3fce[_0xa85d('0x31')],_0x3f3fce['query']);_0x34ad9b[_0xa85d('0x32')]=_[_0xa85d('0x30')](_0x3f3fce[_0xa85d('0x31')],qs[_0xa85d('0x33')](_0x350052[_0xa85d('0x2e')][_0xa85d('0x33')]));_0x34ad9b[_0xa85d('0x32')]=_0x34ad9b[_0xa85d('0x32')][_0xa85d('0x34')]?_0x34ad9b[_0xa85d('0x32')]:_0x3f3fce[_0xa85d('0x31')];_0x34ad9b['order']=qs['sort'](_0x350052[_0xa85d('0x2e')][_0xa85d('0x38')]);_0x34ad9b[_0xa85d('0x3c')]=qs[_0xa85d('0x2f')](_[_0xa85d('0x39')](_0x350052['query'],_0x3f3fce[_0xa85d('0x2f')]));if(_0x350052[_0xa85d('0x2e')][_0xa85d('0x3a')]){_0x34ad9b[_0xa85d('0x3c')]=_[_0xa85d('0x3b')](_0x34ad9b['where'],{'$or':_[_0xa85d('0x29')](_0x34ad9b['attributes'],function(_0x5bab6f){var _0x30e331={};_0x30e331[_0x5bab6f]={'$like':'%'+_0x350052['query'][_0xa85d('0x3a')]+'%'};return _0x30e331;})});}_0x34ad9b=_[_0xa85d('0x3b')]({},_0x34ad9b,_0x350052['options']);return _0x4cc468['getTags'](_0x34ad9b);}})['then'](function(_0x30efc3){if(_0x30efc3){_0x4337c2=_0x30efc3[_0xa85d('0x34')];if(!_0x350052['query'][_0xa85d('0x35')](_0xa85d('0x36'))){_0x34ad9b['limit']=qs[_0xa85d('0x1c')](_0x350052[_0xa85d('0x2e')][_0xa85d('0x1c')]);_0x34ad9b[_0xa85d('0x1a')]=qs[_0xa85d('0x1a')](_0x350052[_0xa85d('0x2e')][_0xa85d('0x1a')]);}return _0x4cc468['getTags'](_0x34ad9b);}})[_0xa85d('0x24')](function(_0x443ad1){if(_0x443ad1){return _0x443ad1?{'count':_0x4337c2,'rows':_0x443ad1}:null;}})[_0xa85d('0x24')](respondWithResult(_0x9dbb6a,null))[_0xa85d('0x42')](handleError(_0x9dbb6a,null));};exports['setTags']=function(_0x55c1e9,_0xd6018a,_0x169259){if(_0x55c1e9[_0xa85d('0x47')]['id']){delete _0x55c1e9[_0xa85d('0x47')]['id'];}return db['FreshdeskConfiguration'][_0xa85d('0x4a')]({'where':{'id':_0x55c1e9[_0xa85d('0x44')]['id']}})[_0xa85d('0x24')](handleEntityNotFound(_0xd6018a,null))[_0xa85d('0x24')](function(_0x12dfdb){if(_0x12dfdb){return _0x12dfdb[_0xa85d('0x4f')](_0x55c1e9[_0xa85d('0x47')][_0xa85d('0x50')]||[]);}return null;})[_0xa85d('0x24')](respondWithResult(_0xd6018a,null))['catch'](handleError(_0xd6018a,null));}; \ No newline at end of file +var _0x780d=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','find','create','body','getFields','findOne','FreshdeskField','options','getSubjects','getDescriptions','getTags','setTags','ids'];(function(_0x56e0ab,_0xaea814){var _0x5c8f76=function(_0x2eaae6){while(--_0x2eaae6){_0x56e0ab['push'](_0x56e0ab['shift']());}};_0x5c8f76(++_0xaea814);}(_0x780d,0xf3));var _0xd780=function(_0xc07e77,_0x131f5f){_0xc07e77=_0xc07e77-0x0;var _0x8a489e=_0x780d[_0xc07e77];return _0x8a489e;};'use strict';var emlformat=require(_0xd780('0x0'));var rimraf=require(_0xd780('0x1'));var zipdir=require(_0xd780('0x2'));var jsonpatch=require(_0xd780('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd780('0x4'));var Mustache=require(_0xd780('0x5'));var util=require(_0xd780('0x6'));var path=require(_0xd780('0x7'));var sox=require(_0xd780('0x8'));var csv=require(_0xd780('0x9'));var ejs=require(_0xd780('0xa'));var fs=require('fs');var fs_extra=require(_0xd780('0xb'));var _=require(_0xd780('0xc'));var squel=require(_0xd780('0xd'));var crypto=require(_0xd780('0xe'));var jsforce=require(_0xd780('0xf'));var deskjs=require(_0xd780('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd780('0x11'));var Redis=require(_0xd780('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd780('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd780('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ec7ce,_0x5875d4){_0x5875d4=_0x5875d4||0xcc;return function(_0x43b2b0){if(_0x43b2b0){return _0x3ec7ce[_0xd780('0x15')](_0x5875d4);}return _0x3ec7ce[_0xd780('0x16')](_0x5875d4)[_0xd780('0x17')]();};}function respondWithResult(_0x4f1856,_0x2d1f44){_0x2d1f44=_0x2d1f44||0xc8;return function(_0x66bc03){if(_0x66bc03){return _0x4f1856[_0xd780('0x16')](_0x2d1f44)[_0xd780('0x18')](_0x66bc03);}};}function respondWithFilteredResult(_0x4e19be,_0x262b1d){return function(_0x49e40e){if(_0x49e40e){var _0x45b893=typeof _0x262b1d[_0xd780('0x19')]===_0xd780('0x1a')&&typeof _0x262b1d[_0xd780('0x1b')]===_0xd780('0x1a');var _0xab888a=_0x49e40e[_0xd780('0x1c')];var _0x1a32f3=_0x45b893?0x0:_0x262b1d[_0xd780('0x19')];var _0x2d6651=_0x45b893?_0x49e40e['count']:_0x262b1d[_0xd780('0x19')]+_0x262b1d[_0xd780('0x1b')];var _0x12ed5b;if(_0x2d6651>=_0xab888a){_0x2d6651=_0xab888a;_0x12ed5b=0xc8;}else{_0x12ed5b=0xce;}_0x4e19be['status'](_0x12ed5b);return _0x4e19be[_0xd780('0x1d')]('Content-Range',_0x1a32f3+'-'+_0x2d6651+'/'+_0xab888a)['json'](_0x49e40e);}return null;};}function patchUpdates(_0x3d6550){return function(_0x5495f8){try{jsonpatch[_0xd780('0x1e')](_0x5495f8,_0x3d6550,!![]);}catch(_0x471c1e){return BPromise[_0xd780('0x1f')](_0x471c1e);}return _0x5495f8[_0xd780('0x20')]();};}function saveUpdates(_0x112de6,_0x2ed1b3){return function(_0xbdb6f0){if(_0xbdb6f0){return _0xbdb6f0[_0xd780('0x21')](_0x112de6)[_0xd780('0x22')](function(_0x778fc){return _0x778fc;});}return null;};}function removeEntity(_0xcb7909,_0x44498f){return function(_0xc57f0a){if(_0xc57f0a){return _0xc57f0a[_0xd780('0x23')]()[_0xd780('0x22')](function(){_0xcb7909['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27b87c,_0x59e7db){return function(_0x1f8214){if(!_0x1f8214){_0x27b87c[_0xd780('0x15')](0x194);}return _0x1f8214;};}function handleError(_0x241203,_0x34697f){_0x34697f=_0x34697f||0x1f4;return function(_0x38e781){logger[_0xd780('0x24')](_0x38e781['stack']);if(_0x38e781['name']){delete _0x38e781['name'];}_0x241203[_0xd780('0x16')](_0x34697f)[_0xd780('0x25')](_0x38e781);};}exports[_0xd780('0x26')]=function(_0x4ad4a6,_0x32dea1){var _0x3d13a7={},_0x16a340={},_0x10a81a={'count':0x0,'rows':[]};var _0x24b99d=_[_0xd780('0x27')](db[_0xd780('0x28')][_0xd780('0x29')],function(_0x5bb66b){return{'name':_0x5bb66b[_0xd780('0x2a')],'type':_0x5bb66b[_0xd780('0x2b')][_0xd780('0x2c')]};});_0x16a340[_0xd780('0x2d')]=_[_0xd780('0x27')](_0x24b99d,_0xd780('0x2e'));_0x16a340[_0xd780('0x2f')]=_['keys'](_0x4ad4a6[_0xd780('0x2f')]);_0x16a340[_0xd780('0x30')]=_[_0xd780('0x31')](_0x16a340['model'],_0x16a340['query']);_0x3d13a7[_0xd780('0x32')]=_[_0xd780('0x31')](_0x16a340['model'],qs[_0xd780('0x33')](_0x4ad4a6[_0xd780('0x2f')][_0xd780('0x33')]));_0x3d13a7[_0xd780('0x32')]=_0x3d13a7[_0xd780('0x32')][_0xd780('0x34')]?_0x3d13a7[_0xd780('0x32')]:_0x16a340[_0xd780('0x2d')];if(!_0x4ad4a6[_0xd780('0x2f')][_0xd780('0x35')](_0xd780('0x36'))){_0x3d13a7[_0xd780('0x1b')]=qs['limit'](_0x4ad4a6[_0xd780('0x2f')][_0xd780('0x1b')]);_0x3d13a7[_0xd780('0x19')]=qs[_0xd780('0x19')](_0x4ad4a6['query'][_0xd780('0x19')]);}_0x3d13a7[_0xd780('0x37')]=qs[_0xd780('0x38')](_0x4ad4a6[_0xd780('0x2f')][_0xd780('0x38')]);_0x3d13a7[_0xd780('0x39')]=qs[_0xd780('0x30')](_[_0xd780('0x3a')](_0x4ad4a6[_0xd780('0x2f')],_0x16a340[_0xd780('0x30')]),_0x24b99d);if(_0x4ad4a6['query']['filter']){_0x3d13a7[_0xd780('0x39')]=_[_0xd780('0x3b')](_0x3d13a7['where'],{'$or':_['map'](_0x24b99d,function(_0x8f36b2){if(_0x8f36b2[_0xd780('0x2b')]!==_0xd780('0x3c')){var _0x399d44={};_0x399d44[_0x8f36b2[_0xd780('0x2e')]]={'$like':'%'+_0x4ad4a6[_0xd780('0x2f')][_0xd780('0x3d')]+'%'};return _0x399d44;}})});}_0x3d13a7=_[_0xd780('0x3b')]({},_0x3d13a7,_0x4ad4a6['options']);var _0x437ac2={'where':_0x3d13a7[_0xd780('0x39')]};return db[_0xd780('0x28')]['count'](_0x437ac2)['then'](function(_0x5324d4){_0x10a81a[_0xd780('0x1c')]=_0x5324d4;if(_0x4ad4a6[_0xd780('0x2f')][_0xd780('0x3e')]){_0x3d13a7[_0xd780('0x3f')]=[{'all':!![]}];}return db[_0xd780('0x28')]['findAll'](_0x3d13a7);})[_0xd780('0x22')](function(_0x28f09a){_0x10a81a[_0xd780('0x40')]=_0x28f09a;return _0x10a81a;})[_0xd780('0x22')](respondWithFilteredResult(_0x32dea1,_0x3d13a7))[_0xd780('0x41')](handleError(_0x32dea1,null));};exports[_0xd780('0x42')]=function(_0x4c6b4c,_0x28d1ab){var _0x248d34={'raw':![],'where':{'id':_0x4c6b4c[_0xd780('0x43')]['id']}},_0x402178={};_0x402178[_0xd780('0x2d')]=_[_0xd780('0x44')](db[_0xd780('0x28')][_0xd780('0x29')]);_0x402178[_0xd780('0x2f')]=_[_0xd780('0x44')](_0x4c6b4c[_0xd780('0x2f')]);_0x402178[_0xd780('0x30')]=_[_0xd780('0x31')](_0x402178[_0xd780('0x2d')],_0x402178[_0xd780('0x2f')]);_0x248d34['attributes']=_['intersection'](_0x402178[_0xd780('0x2d')],qs[_0xd780('0x33')](_0x4c6b4c[_0xd780('0x2f')][_0xd780('0x33')]));_0x248d34[_0xd780('0x32')]=_0x248d34[_0xd780('0x32')][_0xd780('0x34')]?_0x248d34[_0xd780('0x32')]:_0x402178[_0xd780('0x2d')];if(_0x4c6b4c[_0xd780('0x2f')][_0xd780('0x3e')]){_0x248d34['include']=[{'all':!![]}];}_0x248d34=_[_0xd780('0x3b')]({},_0x248d34,_0x4c6b4c['options']);return db[_0xd780('0x28')][_0xd780('0x45')](_0x248d34)[_0xd780('0x22')](handleEntityNotFound(_0x28d1ab,null))['then'](respondWithResult(_0x28d1ab,null))[_0xd780('0x41')](handleError(_0x28d1ab,null));};exports['create']=function(_0x79a17c,_0x6ad1c1){return db['FreshdeskConfiguration'][_0xd780('0x46')](_0x79a17c[_0xd780('0x47')],{})[_0xd780('0x22')](respondWithResult(_0x6ad1c1,0xc9))[_0xd780('0x41')](handleError(_0x6ad1c1,null));};exports[_0xd780('0x21')]=function(_0x1d784d,_0xc5495){if(_0x1d784d[_0xd780('0x47')]['id']){delete _0x1d784d[_0xd780('0x47')]['id'];}return db['FreshdeskConfiguration'][_0xd780('0x45')]({'where':{'id':_0x1d784d[_0xd780('0x43')]['id']}})[_0xd780('0x22')](handleEntityNotFound(_0xc5495,null))['then'](saveUpdates(_0x1d784d[_0xd780('0x47')],null))['then'](respondWithResult(_0xc5495,null))['catch'](handleError(_0xc5495,null));};exports[_0xd780('0x23')]=function(_0x1afe11,_0x5cdde0){return db[_0xd780('0x28')][_0xd780('0x45')]({'where':{'id':_0x1afe11[_0xd780('0x43')]['id']}})['then'](handleEntityNotFound(_0x5cdde0,null))[_0xd780('0x22')](removeEntity(_0x5cdde0,null))[_0xd780('0x41')](handleError(_0x5cdde0,null));};exports[_0xd780('0x48')]=function(_0x2b81d1,_0x30d4f0,_0x5531fb){var _0x1a6dbf={};var _0x369bbe={};var _0x1cd7b3;var _0x594c87;return db['FreshdeskConfiguration'][_0xd780('0x49')]({'where':{'id':_0x2b81d1[_0xd780('0x43')]['id']}})[_0xd780('0x22')](handleEntityNotFound(_0x30d4f0,null))[_0xd780('0x22')](function(_0x87398){if(_0x87398){_0x1cd7b3=_0x87398;_0x369bbe[_0xd780('0x2d')]=_[_0xd780('0x44')](db[_0xd780('0x4a')][_0xd780('0x29')]);_0x369bbe['query']=_[_0xd780('0x44')](_0x2b81d1['query']);_0x369bbe['filters']=_[_0xd780('0x31')](_0x369bbe['model'],_0x369bbe[_0xd780('0x2f')]);_0x1a6dbf[_0xd780('0x32')]=_[_0xd780('0x31')](_0x369bbe[_0xd780('0x2d')],qs[_0xd780('0x33')](_0x2b81d1[_0xd780('0x2f')]['fields']));_0x1a6dbf[_0xd780('0x32')]=_0x1a6dbf[_0xd780('0x32')]['length']?_0x1a6dbf['attributes']:_0x369bbe[_0xd780('0x2d')];_0x1a6dbf[_0xd780('0x37')]=qs['sort'](_0x2b81d1['query'][_0xd780('0x38')]);_0x1a6dbf[_0xd780('0x39')]=qs['filters'](_[_0xd780('0x3a')](_0x2b81d1['query'],_0x369bbe[_0xd780('0x30')]));if(_0x2b81d1[_0xd780('0x2f')][_0xd780('0x3d')]){_0x1a6dbf[_0xd780('0x39')]=_[_0xd780('0x3b')](_0x1a6dbf[_0xd780('0x39')],{'$or':_[_0xd780('0x27')](_0x1a6dbf[_0xd780('0x32')],function(_0x5c107f){var _0x22b6c8={};_0x22b6c8[_0x5c107f]={'$like':'%'+_0x2b81d1[_0xd780('0x2f')][_0xd780('0x3d')]+'%'};return _0x22b6c8;})});}_0x1a6dbf=_[_0xd780('0x3b')]({},_0x1a6dbf,_0x2b81d1[_0xd780('0x4b')]);return _0x1cd7b3[_0xd780('0x48')](_0x1a6dbf);}})[_0xd780('0x22')](function(_0x4f921a){if(_0x4f921a){_0x594c87=_0x4f921a[_0xd780('0x34')];if(!_0x2b81d1['query']['hasOwnProperty'](_0xd780('0x36'))){_0x1a6dbf['limit']=qs[_0xd780('0x1b')](_0x2b81d1[_0xd780('0x2f')][_0xd780('0x1b')]);_0x1a6dbf[_0xd780('0x19')]=qs[_0xd780('0x19')](_0x2b81d1[_0xd780('0x2f')][_0xd780('0x19')]);}return _0x1cd7b3[_0xd780('0x48')](_0x1a6dbf);}})[_0xd780('0x22')](function(_0x107f35){if(_0x107f35){return _0x107f35?{'count':_0x594c87,'rows':_0x107f35}:null;}})['then'](respondWithResult(_0x30d4f0,null))[_0xd780('0x41')](handleError(_0x30d4f0,null));};exports[_0xd780('0x4c')]=function(_0x52b4bb,_0x425998,_0xe01b89){var _0x5bb2e6={};var _0x3dade9={};var _0x10a10c;var _0x2803ed;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x52b4bb['params']['id']}})['then'](handleEntityNotFound(_0x425998,null))[_0xd780('0x22')](function(_0x2332b8){if(_0x2332b8){_0x10a10c=_0x2332b8;_0x3dade9[_0xd780('0x2d')]=_[_0xd780('0x44')](db[_0xd780('0x4a')]['rawAttributes']);_0x3dade9[_0xd780('0x2f')]=_[_0xd780('0x44')](_0x52b4bb[_0xd780('0x2f')]);_0x3dade9[_0xd780('0x30')]=_[_0xd780('0x31')](_0x3dade9[_0xd780('0x2d')],_0x3dade9[_0xd780('0x2f')]);_0x5bb2e6['attributes']=_[_0xd780('0x31')](_0x3dade9[_0xd780('0x2d')],qs[_0xd780('0x33')](_0x52b4bb[_0xd780('0x2f')][_0xd780('0x33')]));_0x5bb2e6[_0xd780('0x32')]=_0x5bb2e6[_0xd780('0x32')]['length']?_0x5bb2e6[_0xd780('0x32')]:_0x3dade9[_0xd780('0x2d')];_0x5bb2e6[_0xd780('0x37')]=qs[_0xd780('0x38')](_0x52b4bb[_0xd780('0x2f')][_0xd780('0x38')]);_0x5bb2e6[_0xd780('0x39')]=qs[_0xd780('0x30')](_[_0xd780('0x3a')](_0x52b4bb[_0xd780('0x2f')],_0x3dade9['filters']));if(_0x52b4bb['query'][_0xd780('0x3d')]){_0x5bb2e6[_0xd780('0x39')]=_[_0xd780('0x3b')](_0x5bb2e6[_0xd780('0x39')],{'$or':_[_0xd780('0x27')](_0x5bb2e6['attributes'],function(_0x430426){var _0xbb56f4={};_0xbb56f4[_0x430426]={'$like':'%'+_0x52b4bb['query'][_0xd780('0x3d')]+'%'};return _0xbb56f4;})});}_0x5bb2e6=_[_0xd780('0x3b')]({},_0x5bb2e6,_0x52b4bb[_0xd780('0x4b')]);return _0x10a10c[_0xd780('0x4c')](_0x5bb2e6);}})[_0xd780('0x22')](function(_0x453997){if(_0x453997){_0x2803ed=_0x453997['length'];if(!_0x52b4bb['query']['hasOwnProperty'](_0xd780('0x36'))){_0x5bb2e6[_0xd780('0x1b')]=qs[_0xd780('0x1b')](_0x52b4bb['query']['limit']);_0x5bb2e6[_0xd780('0x19')]=qs['offset'](_0x52b4bb[_0xd780('0x2f')][_0xd780('0x19')]);}return _0x10a10c['getSubjects'](_0x5bb2e6);}})['then'](function(_0x52298d){if(_0x52298d){return _0x52298d?{'count':_0x2803ed,'rows':_0x52298d}:null;}})[_0xd780('0x22')](respondWithResult(_0x425998,null))[_0xd780('0x41')](handleError(_0x425998,null));};exports[_0xd780('0x4d')]=function(_0x3ad938,_0xa0bc7c,_0xa086c1){var _0x1e27d0={};var _0x20469f={};var _0x31ca7e;var _0x4c9ace;return db[_0xd780('0x28')][_0xd780('0x49')]({'where':{'id':_0x3ad938[_0xd780('0x43')]['id']}})['then'](handleEntityNotFound(_0xa0bc7c,null))[_0xd780('0x22')](function(_0x266b45){if(_0x266b45){_0x31ca7e=_0x266b45;_0x20469f[_0xd780('0x2d')]=_['keys'](db['FreshdeskField'][_0xd780('0x29')]);_0x20469f[_0xd780('0x2f')]=_[_0xd780('0x44')](_0x3ad938[_0xd780('0x2f')]);_0x20469f[_0xd780('0x30')]=_[_0xd780('0x31')](_0x20469f['model'],_0x20469f[_0xd780('0x2f')]);_0x1e27d0['attributes']=_[_0xd780('0x31')](_0x20469f[_0xd780('0x2d')],qs[_0xd780('0x33')](_0x3ad938[_0xd780('0x2f')][_0xd780('0x33')]));_0x1e27d0[_0xd780('0x32')]=_0x1e27d0['attributes'][_0xd780('0x34')]?_0x1e27d0['attributes']:_0x20469f[_0xd780('0x2d')];_0x1e27d0[_0xd780('0x37')]=qs['sort'](_0x3ad938['query'][_0xd780('0x38')]);_0x1e27d0['where']=qs['filters'](_[_0xd780('0x3a')](_0x3ad938[_0xd780('0x2f')],_0x20469f[_0xd780('0x30')]));if(_0x3ad938['query'][_0xd780('0x3d')]){_0x1e27d0[_0xd780('0x39')]=_[_0xd780('0x3b')](_0x1e27d0[_0xd780('0x39')],{'$or':_[_0xd780('0x27')](_0x1e27d0[_0xd780('0x32')],function(_0x22cee2){var _0x1d746b={};_0x1d746b[_0x22cee2]={'$like':'%'+_0x3ad938[_0xd780('0x2f')]['filter']+'%'};return _0x1d746b;})});}_0x1e27d0=_[_0xd780('0x3b')]({},_0x1e27d0,_0x3ad938[_0xd780('0x4b')]);return _0x31ca7e[_0xd780('0x4d')](_0x1e27d0);}})[_0xd780('0x22')](function(_0x2c806e){if(_0x2c806e){_0x4c9ace=_0x2c806e[_0xd780('0x34')];if(!_0x3ad938['query'][_0xd780('0x35')]('nolimit')){_0x1e27d0[_0xd780('0x1b')]=qs['limit'](_0x3ad938[_0xd780('0x2f')][_0xd780('0x1b')]);_0x1e27d0[_0xd780('0x19')]=qs[_0xd780('0x19')](_0x3ad938[_0xd780('0x2f')][_0xd780('0x19')]);}return _0x31ca7e[_0xd780('0x4d')](_0x1e27d0);}})[_0xd780('0x22')](function(_0x168caf){if(_0x168caf){return _0x168caf?{'count':_0x4c9ace,'rows':_0x168caf}:null;}})[_0xd780('0x22')](respondWithResult(_0xa0bc7c,null))[_0xd780('0x41')](handleError(_0xa0bc7c,null));};exports[_0xd780('0x4e')]=function(_0x552cea,_0x10c400,_0x30bd92){var _0x407f3a={};var _0xa152f7={};var _0x4cbd0d;var _0x2269f5;return db[_0xd780('0x28')][_0xd780('0x49')]({'where':{'id':_0x552cea['params']['id']}})['then'](handleEntityNotFound(_0x10c400,null))['then'](function(_0x58dcb9){if(_0x58dcb9){_0x4cbd0d=_0x58dcb9;_0xa152f7[_0xd780('0x2d')]=_[_0xd780('0x44')](db['Tag'][_0xd780('0x29')]);_0xa152f7[_0xd780('0x2f')]=_[_0xd780('0x44')](_0x552cea[_0xd780('0x2f')]);_0xa152f7[_0xd780('0x30')]=_[_0xd780('0x31')](_0xa152f7[_0xd780('0x2d')],_0xa152f7[_0xd780('0x2f')]);_0x407f3a[_0xd780('0x32')]=_[_0xd780('0x31')](_0xa152f7[_0xd780('0x2d')],qs['fields'](_0x552cea[_0xd780('0x2f')][_0xd780('0x33')]));_0x407f3a[_0xd780('0x32')]=_0x407f3a[_0xd780('0x32')]['length']?_0x407f3a[_0xd780('0x32')]:_0xa152f7[_0xd780('0x2d')];_0x407f3a['order']=qs[_0xd780('0x38')](_0x552cea[_0xd780('0x2f')][_0xd780('0x38')]);_0x407f3a[_0xd780('0x39')]=qs[_0xd780('0x30')](_[_0xd780('0x3a')](_0x552cea[_0xd780('0x2f')],_0xa152f7[_0xd780('0x30')]));if(_0x552cea[_0xd780('0x2f')][_0xd780('0x3d')]){_0x407f3a[_0xd780('0x39')]=_[_0xd780('0x3b')](_0x407f3a[_0xd780('0x39')],{'$or':_[_0xd780('0x27')](_0x407f3a[_0xd780('0x32')],function(_0x27334d){var _0x5be839={};_0x5be839[_0x27334d]={'$like':'%'+_0x552cea[_0xd780('0x2f')]['filter']+'%'};return _0x5be839;})});}_0x407f3a=_['merge']({},_0x407f3a,_0x552cea[_0xd780('0x4b')]);return _0x4cbd0d[_0xd780('0x4e')](_0x407f3a);}})[_0xd780('0x22')](function(_0x1d8b12){if(_0x1d8b12){_0x2269f5=_0x1d8b12[_0xd780('0x34')];if(!_0x552cea[_0xd780('0x2f')][_0xd780('0x35')](_0xd780('0x36'))){_0x407f3a['limit']=qs[_0xd780('0x1b')](_0x552cea[_0xd780('0x2f')][_0xd780('0x1b')]);_0x407f3a[_0xd780('0x19')]=qs['offset'](_0x552cea[_0xd780('0x2f')][_0xd780('0x19')]);}return _0x4cbd0d['getTags'](_0x407f3a);}})['then'](function(_0x18a5ce){if(_0x18a5ce){return _0x18a5ce?{'count':_0x2269f5,'rows':_0x18a5ce}:null;}})[_0xd780('0x22')](respondWithResult(_0x10c400,null))[_0xd780('0x41')](handleError(_0x10c400,null));};exports[_0xd780('0x4f')]=function(_0x350728,_0x4cbbb9,_0x301011){if(_0x350728[_0xd780('0x47')]['id']){delete _0x350728[_0xd780('0x47')]['id'];}return db['FreshdeskConfiguration'][_0xd780('0x49')]({'where':{'id':_0x350728[_0xd780('0x43')]['id']}})[_0xd780('0x22')](handleEntityNotFound(_0x4cbbb9,null))[_0xd780('0x22')](function(_0x24d517){if(_0x24d517){return _0x24d517[_0xd780('0x4f')](_0x350728[_0xd780('0x47')][_0xd780('0x50')]||[]);}return null;})['then'](respondWithResult(_0x4cbbb9,null))[_0xd780('0x41')](handleError(_0x4cbbb9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 4c329f7..412ec2d 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 _0xfba6=['exports','define','FreshdeskConfiguration','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18cf9a,_0xb19502){var _0x1203f7=function(_0x5f052a){while(--_0x5f052a){_0x18cf9a['push'](_0x18cf9a['shift']());}};_0x1203f7(++_0xb19502);}(_0xfba6,0x87));var _0x6fba=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0xfba6[_0x15af0f];return _0x2bd1cb;};'use strict';var _=require(_0x6fba('0x0'));var util=require('util');var logger=require(_0x6fba('0x1'))('api');var moment=require(_0x6fba('0x2'));var BPromise=require(_0x6fba('0x3'));var rp=require(_0x6fba('0x4'));var fs=require('fs');var path=require(_0x6fba('0x5'));var rimraf=require(_0x6fba('0x6'));var config=require(_0x6fba('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x6fba('0x8')]=function(_0x4a4e7e,_0x30e35f){return _0x4a4e7e[_0x6fba('0x9')](_0x6fba('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0f1=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf0f1,0xba));var _0x1f0f=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xf0f1[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x1f0f('0x0'));var util=require('util');var logger=require(_0x1f0f('0x1'))(_0x1f0f('0x2'));var moment=require(_0x1f0f('0x3'));var BPromise=require('bluebird');var rp=require(_0x1f0f('0x4'));var fs=require('fs');var path=require(_0x1f0f('0x5'));var rimraf=require(_0x1f0f('0x6'));var config=require(_0x1f0f('0x7'));var attributes=require(_0x1f0f('0x8'));module[_0x1f0f('0x9')]=function(_0x25ef79,_0x2664a9){return _0x25ef79[_0x1f0f('0xa')](_0x1f0f('0xb'),attributes,{'tableName':_0x1f0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 11a15c8..c3683bc 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 _0x17c0=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x17c0,0x182));var _0x017c=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x17c0[_0x3238ea];return _0x4aaac2;};'use strict';var _=require(_0x017c('0x0'));var util=require(_0x017c('0x1'));var moment=require(_0x017c('0x2'));var BPromise=require(_0x017c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x017c('0x4'));var db=require(_0x017c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x017c('0x6'))('rpc');var config=require(_0x017c('0x7'));var jayson=require(_0x017c('0x8'));var client=jayson[_0x017c('0x9')][_0x017c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x252587,_0x259cfc,_0xcdd847){return new BPromise(function(_0x5a0549,_0x4b295d){return client[_0x017c('0xb')](_0x252587,_0xcdd847)['then'](function(_0x299c4d){logger[_0x017c('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x259cfc,'request\x20sent');logger[_0x017c('0xd')](_0x017c('0xe'),_0x259cfc,_0x017c('0xf'),JSON[_0x017c('0x10')](_0x299c4d));if(_0x299c4d['error']){if(_0x299c4d[_0x017c('0x11')][_0x017c('0x12')]===0x1f4){logger[_0x017c('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x259cfc,_0x299c4d[_0x017c('0x11')][_0x017c('0x13')]);return _0x4b295d(_0x299c4d[_0x017c('0x11')][_0x017c('0x13')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x259cfc,_0x299c4d['error'][_0x017c('0x13')]);return _0x5a0549(_0x299c4d['error'][_0x017c('0x13')]);}else{logger['info'](_0x017c('0x14'),_0x259cfc,'request\x20sent');_0x5a0549(_0x299c4d[_0x017c('0x15')][_0x017c('0x13')]);}})[_0x017c('0x16')](function(_0x356d10){logger[_0x017c('0x11')](_0x017c('0x14'),_0x259cfc,_0x356d10);_0x4b295d(_0x356d10);});});} \ No newline at end of file +var _0x74b2=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird'];(function(_0x1ec1da,_0x5bcad7){var _0x446f11=function(_0x2ad488){while(--_0x2ad488){_0x1ec1da['push'](_0x1ec1da['shift']());}};_0x446f11(++_0x5bcad7);}(_0x74b2,0x146));var _0x274b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74b2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x274b('0x0'));var util=require(_0x274b('0x1'));var moment=require(_0x274b('0x2'));var BPromise=require(_0x274b('0x3'));var rs=require(_0x274b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x274b('0x5'))['db'];var utils=require(_0x274b('0x6'));var logger=require(_0x274b('0x7'))(_0x274b('0x8'));var config=require(_0x274b('0x9'));var jayson=require(_0x274b('0xa'));var client=jayson[_0x274b('0xb')][_0x274b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27b616,_0xcbcac7,_0x3bbdee){return new BPromise(function(_0x324f26,_0x228149){return client['request'](_0x27b616,_0x3bbdee)['then'](function(_0x58f8cf){logger[_0x274b('0xd')](_0x274b('0xe'),_0xcbcac7,_0x274b('0xf'));logger[_0x274b('0x10')](_0x274b('0x11'),_0xcbcac7,_0x274b('0xf'),JSON[_0x274b('0x12')](_0x58f8cf));if(_0x58f8cf['error']){if(_0x58f8cf[_0x274b('0x13')][_0x274b('0x14')]===0x1f4){logger[_0x274b('0x13')](_0x274b('0xe'),_0xcbcac7,_0x58f8cf[_0x274b('0x13')]['message']);return _0x228149(_0x58f8cf[_0x274b('0x13')][_0x274b('0x15')]);}logger['error'](_0x274b('0xe'),_0xcbcac7,_0x58f8cf[_0x274b('0x13')][_0x274b('0x15')]);return _0x324f26(_0x58f8cf[_0x274b('0x13')][_0x274b('0x15')]);}else{logger[_0x274b('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xcbcac7,'request\x20sent');_0x324f26(_0x58f8cf['result'][_0x274b('0x15')]);}})['catch'](function(_0x2d16c4){logger[_0x274b('0x13')](_0x274b('0xe'),_0xcbcac7,_0x2d16c4);_0x228149(_0x2d16c4);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index b784430..273158f 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 _0x94e6=['show','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','get','/:id'];(function(_0x2b467d,_0x2fc620){var _0x134406=function(_0x48eef6){while(--_0x48eef6){_0x2b467d['push'](_0x2b467d['shift']());}};_0x134406(++_0x2fc620);}(_0x94e6,0xbf));var _0x694e=function(_0x42f7f8,_0x1461ac){_0x42f7f8=_0x42f7f8-0x0;var _0x1f7583=_0x94e6[_0x42f7f8];return _0x1f7583;};'use strict';var multer=require(_0x694e('0x0'));var util=require(_0x694e('0x1'));var path=require(_0x694e('0x2'));var timeout=require(_0x694e('0x3'));var express=require('express');var router=express[_0x694e('0x4')]();var fs_extra=require(_0x694e('0x5'));var auth=require(_0x694e('0x6'));var interaction=require(_0x694e('0x7'));var config=require(_0x694e('0x8'));var controller=require(_0x694e('0x9'));router['get']('/',auth[_0x694e('0xa')](),controller['index']);router[_0x694e('0xb')](_0x694e('0xc'),auth[_0x694e('0xa')](),controller[_0x694e('0xd')]);router['post']('/',auth[_0x694e('0xa')](),controller['create']);router[_0x694e('0xe')]('/:id',auth[_0x694e('0xa')](),controller[_0x694e('0xf')]);router[_0x694e('0x10')]('/:id',auth[_0x694e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc123=['create','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x25a4c3,_0x47a662){var _0x3f7c43=function(_0x374f5b){while(--_0x374f5b){_0x25a4c3['push'](_0x25a4c3['shift']());}};_0x3f7c43(++_0x47a662);}(_0xc123,0x1f1));var _0x3c12=function(_0x4df603,_0x40e259){_0x4df603=_0x4df603-0x0;var _0x207f47=_0xc123[_0x4df603];return _0x207f47;};'use strict';var multer=require(_0x3c12('0x0'));var util=require('util');var path=require(_0x3c12('0x1'));var timeout=require(_0x3c12('0x2'));var express=require(_0x3c12('0x3'));var router=express[_0x3c12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3c12('0x5'));var interaction=require(_0x3c12('0x6'));var config=require(_0x3c12('0x7'));var controller=require(_0x3c12('0x8'));router[_0x3c12('0x9')]('/',auth[_0x3c12('0xa')](),controller[_0x3c12('0xb')]);router[_0x3c12('0x9')](_0x3c12('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3c12('0xa')](),controller[_0x3c12('0xd')]);router[_0x3c12('0xe')](_0x3c12('0xc'),auth[_0x3c12('0xa')](),controller[_0x3c12('0xf')]);router['delete']('/:id',auth[_0x3c12('0xa')](),controller['destroy']);module[_0x3c12('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index d151a39..11f51c5 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 _0x7faa=['BOOLEAN','sequelize','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1e68f4,_0x568228){var _0x20ed04=function(_0x27ee00){while(--_0x27ee00){_0x1e68f4['push'](_0x1e68f4['shift']());}};_0x20ed04(++_0x568228);}(_0x7faa,0x1ac));var _0xa7fa=function(_0x1a6e91,_0x1afa53){_0x1a6e91=_0x1a6e91-0x0;var _0x2281b1=_0x7faa[_0x1a6e91];return _0x2281b1;};'use strict';var Sequelize=require(_0xa7fa('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xa7fa('0x1'),_0xa7fa('0x2'),_0xa7fa('0x3'),_0xa7fa('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xa7fa('0x1'),_0xa7fa('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa7fa('0x5')]},'nameField':{'type':Sequelize[_0xa7fa('0x5')]},'customField':{'type':Sequelize[_0xa7fa('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa7fa('0x5')]}}; \ No newline at end of file +var _0x5c66=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x3a02c6,_0x27db58){var _0x460e70=function(_0x36323f){while(--_0x36323f){_0x3a02c6['push'](_0x3a02c6['shift']());}};_0x460e70(++_0x27db58);}(_0x5c66,0x75));var _0x65c6=function(_0x24d449,_0x479317){_0x24d449=_0x24d449-0x0;var _0xfa791b=_0x5c66[_0x24d449];return _0xfa791b;};'use strict';var Sequelize=require(_0x65c6('0x0'));module['exports']={'type':{'type':Sequelize[_0x65c6('0x1')](_0x65c6('0x2'),_0x65c6('0x3'),_0x65c6('0x4'),_0x65c6('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x65c6('0x6')]},'key':{'type':Sequelize[_0x65c6('0x6')]},'keyType':{'type':Sequelize[_0x65c6('0x1')](_0x65c6('0x2'),_0x65c6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x65c6('0x6')]},'idField':{'type':Sequelize[_0x65c6('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x65c6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x65c6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index bc50088..cbaecd1 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 _0xb6b1=['set','Content-Range','apply','reject','save','update','then','error','name','send','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x1122c4,_0x4eeedc){var _0x1ca049=function(_0x1fdcf){while(--_0x1fdcf){_0x1122c4['push'](_0x1122c4['shift']());}};_0x1ca049(++_0x4eeedc);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0xb6b1[_0x358806];return _0x19fdcb;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a317c,_0x47c318){return function(_0x15dfc7){if(!_0x15dfc7){_0x6a317c[_0x1b6b('0x16')](0x194);}return _0x15dfc7;};}function handleError(_0x466c0c,_0x308955){_0x308955=_0x308955||0x1f4;return function(_0xd41b04){logger[_0x1b6b('0x24')](_0xd41b04['stack']);if(_0xd41b04[_0x1b6b('0x25')]){delete _0xd41b04[_0x1b6b('0x25')];}_0x466c0c[_0x1b6b('0x17')](_0x308955)[_0x1b6b('0x26')](_0xd41b04);};}exports['index']=function(_0x23dac4,_0x5a46bd){var _0x5bbcd8={},_0x39b055={},_0x4e9843={'count':0x0,'rows':[]};var _0x165fe8=_[_0x1b6b('0x27')](db['FreshdeskField']['rawAttributes'],function(_0x36878c){return{'name':_0x36878c[_0x1b6b('0x28')],'type':_0x36878c['type']['key']};});_0x39b055[_0x1b6b('0x29')]=_[_0x1b6b('0x27')](_0x165fe8,_0x1b6b('0x25'));_0x39b055[_0x1b6b('0x2a')]=_['keys'](_0x23dac4[_0x1b6b('0x2a')]);_0x39b055[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],_0x39b055[_0x1b6b('0x2a')]);_0x5bbcd8[_0x1b6b('0x2d')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x23dac4['query'][_0x1b6b('0x2e')]));_0x5bbcd8[_0x1b6b('0x2d')]=_0x5bbcd8[_0x1b6b('0x2d')][_0x1b6b('0x2f')]?_0x5bbcd8['attributes']:_0x39b055[_0x1b6b('0x29')];if(!_0x23dac4['query'][_0x1b6b('0x30')]('nolimit')){_0x5bbcd8['limit']=qs[_0x1b6b('0x1b')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x1b')]);_0x5bbcd8['offset']=qs[_0x1b6b('0x19')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x19')]);}_0x5bbcd8[_0x1b6b('0x31')]=qs[_0x1b6b('0x32')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x32')]);_0x5bbcd8[_0x1b6b('0x33')]=qs[_0x1b6b('0x2b')](_[_0x1b6b('0x34')](_0x23dac4[_0x1b6b('0x2a')],_0x39b055[_0x1b6b('0x2b')]),_0x165fe8);if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x35')]){_0x5bbcd8['where']=_[_0x1b6b('0x36')](_0x5bbcd8[_0x1b6b('0x33')],{'$or':_['map'](_0x165fe8,function(_0x41e0db){if(_0x41e0db['type']!==_0x1b6b('0x37')){var _0x19049f={};_0x19049f[_0x41e0db[_0x1b6b('0x25')]]={'$like':'%'+_0x23dac4['query'][_0x1b6b('0x35')]+'%'};return _0x19049f;}})});}_0x5bbcd8=_[_0x1b6b('0x36')]({},_0x5bbcd8,_0x23dac4[_0x1b6b('0x38')]);var _0x5578d9={'where':_0x5bbcd8[_0x1b6b('0x33')]};return db[_0x1b6b('0x39')][_0x1b6b('0x1c')](_0x5578d9)['then'](function(_0x48ece6){_0x4e9843['count']=_0x48ece6;if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x3a')]){_0x5bbcd8[_0x1b6b('0x3b')]=[{'all':!![]}];}return db[_0x1b6b('0x39')][_0x1b6b('0x3c')](_0x5bbcd8);})[_0x1b6b('0x23')](function(_0xe8bea5){_0x4e9843['rows']=_0xe8bea5;return _0x4e9843;})[_0x1b6b('0x23')](respondWithFilteredResult(_0x5a46bd,_0x5bbcd8))[_0x1b6b('0x3d')](handleError(_0x5a46bd,null));};exports[_0x1b6b('0x3e')]=function(_0x31c2bf,_0x1dcba5){var _0x3d8374={'raw':!![],'where':{'id':_0x31c2bf[_0x1b6b('0x3f')]['id']}},_0x5cb83a={};_0x5cb83a[_0x1b6b('0x29')]=_[_0x1b6b('0x40')](db[_0x1b6b('0x39')][_0x1b6b('0x41')]);_0x5cb83a[_0x1b6b('0x2a')]=_[_0x1b6b('0x40')](_0x31c2bf[_0x1b6b('0x2a')]);_0x5cb83a[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],_0x5cb83a[_0x1b6b('0x2a')]);_0x3d8374['attributes']=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x31c2bf[_0x1b6b('0x2a')][_0x1b6b('0x2e')]));_0x3d8374[_0x1b6b('0x2d')]=_0x3d8374['attributes']['length']?_0x3d8374[_0x1b6b('0x2d')]:_0x5cb83a['model'];if(_0x31c2bf[_0x1b6b('0x2a')]['includeAll']){_0x3d8374[_0x1b6b('0x3b')]=[{'all':!![]}];}_0x3d8374=_[_0x1b6b('0x36')]({},_0x3d8374,_0x31c2bf[_0x1b6b('0x38')]);return db[_0x1b6b('0x39')]['find'](_0x3d8374)[_0x1b6b('0x23')](handleEntityNotFound(_0x1dcba5,null))['then'](respondWithResult(_0x1dcba5,null))['catch'](handleError(_0x1dcba5,null));};exports[_0x1b6b('0x42')]=function(_0x123045,_0x151774){return db[_0x1b6b('0x39')]['create'](_0x123045[_0x1b6b('0x43')],{})['then'](respondWithResult(_0x151774,0xc9))[_0x1b6b('0x3d')](handleError(_0x151774,null));};exports[_0x1b6b('0x22')]=function(_0x281f19,_0x4b0b47){if(_0x281f19[_0x1b6b('0x43')]['id']){delete _0x281f19['body']['id'];}return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x281f19[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x4b0b47,null))[_0x1b6b('0x23')](saveUpdates(_0x281f19[_0x1b6b('0x43')],null))[_0x1b6b('0x23')](respondWithResult(_0x4b0b47,null))[_0x1b6b('0x3d')](handleError(_0x4b0b47,null));};exports['destroy']=function(_0x4c1e02,_0x2be336){return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x4c1e02[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x2be336,null))[_0x1b6b('0x23')](removeEntity(_0x2be336,null))[_0x1b6b('0x3d')](handleError(_0x2be336,null));}; \ No newline at end of file +var _0x91a7=['filter','merge','where','VIRTUAL','options','findAll','rows','catch','rawAttributes','includeAll','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort'];(function(_0x2c21fa,_0x5f0a10){var _0x5aafc6=function(_0x1eb171){while(--_0x1eb171){_0x2c21fa['push'](_0x2c21fa['shift']());}};_0x5aafc6(++_0x5f0a10);}(_0x91a7,0xe7));var _0x791a=function(_0x489618,_0x233987){_0x489618=_0x489618-0x0;var _0x3d34b8=_0x91a7[_0x489618];return _0x3d34b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x53dc41,_0x5daecd){_0x5daecd=_0x5daecd||0xcc;return function(_0xc92016){if(_0xc92016){return _0x53dc41[_0x791a('0x16')](_0x5daecd);}return _0x53dc41['status'](_0x5daecd)[_0x791a('0x17')]();};}function respondWithResult(_0x3a2ec6,_0x5d5b11){_0x5d5b11=_0x5d5b11||0xc8;return function(_0x2887f0){if(_0x2887f0){return _0x3a2ec6[_0x791a('0x18')](_0x5d5b11)[_0x791a('0x19')](_0x2887f0);}};}function respondWithFilteredResult(_0x5cdf2,_0x55e845){return function(_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=typeof _0x55e845[_0x791a('0x1a')]===_0x791a('0x1b')&&typeof _0x55e845['limit']===_0x791a('0x1b');var _0x5bea2e=_0x2ce2e0[_0x791a('0x1c')];var _0x52941d=_0x575d11?0x0:_0x55e845['offset'];var _0x588d00=_0x575d11?_0x2ce2e0[_0x791a('0x1c')]:_0x55e845['offset']+_0x55e845['limit'];var _0x39c60b;if(_0x588d00>=_0x5bea2e){_0x588d00=_0x5bea2e;_0x39c60b=0xc8;}else{_0x39c60b=0xce;}_0x5cdf2[_0x791a('0x18')](_0x39c60b);return _0x5cdf2[_0x791a('0x1d')](_0x791a('0x1e'),_0x52941d+'-'+_0x588d00+'/'+_0x5bea2e)['json'](_0x2ce2e0);}return null;};}function patchUpdates(_0x189c0d){return function(_0xcb5e66){try{jsonpatch[_0x791a('0x1f')](_0xcb5e66,_0x189c0d,!![]);}catch(_0x280f1e){return BPromise['reject'](_0x280f1e);}return _0xcb5e66[_0x791a('0x20')]();};}function saveUpdates(_0x2054c6,_0x25bae5){return function(_0x9e17b5){if(_0x9e17b5){return _0x9e17b5[_0x791a('0x21')](_0x2054c6)[_0x791a('0x22')](function(_0x2241a0){return _0x2241a0;});}return null;};}function removeEntity(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(_0xe8e452){return _0xe8e452[_0x791a('0x23')]()['then'](function(){_0x45a67d[_0x791a('0x18')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x380329,_0x2966b8){return function(_0x4d748a){if(!_0x4d748a){_0x380329[_0x791a('0x16')](0x194);}return _0x4d748a;};}function handleError(_0x2db3f7,_0x51dcca){_0x51dcca=_0x51dcca||0x1f4;return function(_0xdfa84f){logger[_0x791a('0x24')](_0xdfa84f[_0x791a('0x25')]);if(_0xdfa84f['name']){delete _0xdfa84f[_0x791a('0x26')];}_0x2db3f7[_0x791a('0x18')](_0x51dcca)[_0x791a('0x27')](_0xdfa84f);};}exports[_0x791a('0x28')]=function(_0x4f423,_0x1a9c6b){var _0x628816={},_0x889534={},_0x58bbc0={'count':0x0,'rows':[]};var _0xbc3436=_[_0x791a('0x29')](db[_0x791a('0x2a')]['rawAttributes'],function(_0x1cdda9){return{'name':_0x1cdda9['fieldName'],'type':_0x1cdda9[_0x791a('0x2b')][_0x791a('0x2c')]};});_0x889534[_0x791a('0x2d')]=_[_0x791a('0x29')](_0xbc3436,_0x791a('0x26'));_0x889534[_0x791a('0x2e')]=_[_0x791a('0x2f')](_0x4f423['query']);_0x889534[_0x791a('0x30')]=_[_0x791a('0x31')](_0x889534[_0x791a('0x2d')],_0x889534[_0x791a('0x2e')]);_0x628816[_0x791a('0x32')]=_['intersection'](_0x889534[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x4f423[_0x791a('0x2e')][_0x791a('0x33')]));_0x628816[_0x791a('0x32')]=_0x628816['attributes'][_0x791a('0x34')]?_0x628816[_0x791a('0x32')]:_0x889534[_0x791a('0x2d')];if(!_0x4f423[_0x791a('0x2e')][_0x791a('0x35')]('nolimit')){_0x628816[_0x791a('0x36')]=qs['limit'](_0x4f423[_0x791a('0x2e')]['limit']);_0x628816['offset']=qs[_0x791a('0x1a')](_0x4f423[_0x791a('0x2e')][_0x791a('0x1a')]);}_0x628816[_0x791a('0x37')]=qs[_0x791a('0x38')](_0x4f423[_0x791a('0x2e')][_0x791a('0x38')]);_0x628816['where']=qs[_0x791a('0x30')](_['pick'](_0x4f423[_0x791a('0x2e')],_0x889534['filters']),_0xbc3436);if(_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]){_0x628816['where']=_[_0x791a('0x3a')](_0x628816[_0x791a('0x3b')],{'$or':_['map'](_0xbc3436,function(_0x45fbfa){if(_0x45fbfa[_0x791a('0x2b')]!==_0x791a('0x3c')){var _0x23db7d={};_0x23db7d[_0x45fbfa[_0x791a('0x26')]]={'$like':'%'+_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]+'%'};return _0x23db7d;}})});}_0x628816=_[_0x791a('0x3a')]({},_0x628816,_0x4f423[_0x791a('0x3d')]);var _0xeafbb5={'where':_0x628816['where']};return db[_0x791a('0x2a')][_0x791a('0x1c')](_0xeafbb5)[_0x791a('0x22')](function(_0x4efbf6){_0x58bbc0[_0x791a('0x1c')]=_0x4efbf6;if(_0x4f423['query']['includeAll']){_0x628816['include']=[{'all':!![]}];}return db[_0x791a('0x2a')][_0x791a('0x3e')](_0x628816);})['then'](function(_0x415c44){_0x58bbc0[_0x791a('0x3f')]=_0x415c44;return _0x58bbc0;})[_0x791a('0x22')](respondWithFilteredResult(_0x1a9c6b,_0x628816))[_0x791a('0x40')](handleError(_0x1a9c6b,null));};exports['show']=function(_0x483336,_0x57b9ba){var _0x2f0395={'raw':!![],'where':{'id':_0x483336['params']['id']}},_0x216dd3={};_0x216dd3[_0x791a('0x2d')]=_[_0x791a('0x2f')](db[_0x791a('0x2a')][_0x791a('0x41')]);_0x216dd3['query']=_[_0x791a('0x2f')](_0x483336['query']);_0x216dd3[_0x791a('0x30')]=_[_0x791a('0x31')](_0x216dd3[_0x791a('0x2d')],_0x216dd3[_0x791a('0x2e')]);_0x2f0395[_0x791a('0x32')]=_['intersection'](_0x216dd3[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x483336[_0x791a('0x2e')][_0x791a('0x33')]));_0x2f0395[_0x791a('0x32')]=_0x2f0395['attributes'][_0x791a('0x34')]?_0x2f0395[_0x791a('0x32')]:_0x216dd3['model'];if(_0x483336['query'][_0x791a('0x42')]){_0x2f0395[_0x791a('0x43')]=[{'all':!![]}];}_0x2f0395=_[_0x791a('0x3a')]({},_0x2f0395,_0x483336['options']);return db['FreshdeskField'][_0x791a('0x44')](_0x2f0395)[_0x791a('0x22')](handleEntityNotFound(_0x57b9ba,null))['then'](respondWithResult(_0x57b9ba,null))[_0x791a('0x40')](handleError(_0x57b9ba,null));};exports[_0x791a('0x45')]=function(_0x3eac77,_0x549980){return db['FreshdeskField'][_0x791a('0x45')](_0x3eac77[_0x791a('0x46')],{})[_0x791a('0x22')](respondWithResult(_0x549980,0xc9))[_0x791a('0x40')](handleError(_0x549980,null));};exports['update']=function(_0x2d7c7d,_0x9f768a){if(_0x2d7c7d[_0x791a('0x46')]['id']){delete _0x2d7c7d[_0x791a('0x46')]['id'];}return db['FreshdeskField'][_0x791a('0x44')]({'where':{'id':_0x2d7c7d[_0x791a('0x47')]['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x9f768a,null))[_0x791a('0x22')](saveUpdates(_0x2d7c7d[_0x791a('0x46')],null))[_0x791a('0x22')](respondWithResult(_0x9f768a,null))[_0x791a('0x40')](handleError(_0x9f768a,null));};exports['destroy']=function(_0xdcb1b,_0x1fd826){return db['FreshdeskField'][_0x791a('0x44')]({'where':{'id':_0xdcb1b[_0x791a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fd826,null))[_0x791a('0x22')](removeEntity(_0x1fd826,null))[_0x791a('0x40')](handleError(_0x1fd826,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 6c3146f..a1ab829 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 _0x7cf8=['./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x43f356,_0xd5c34){var _0x5d235d=function(_0x28ad31){while(--_0x28ad31){_0x43f356['push'](_0x43f356['shift']());}};_0x5d235d(++_0xd5c34);}(_0x7cf8,0x13a));var _0x87cf=function(_0x2a4ed8,_0x1c963b){_0x2a4ed8=_0x2a4ed8-0x0;var _0x260801=_0x7cf8[_0x2a4ed8];return _0x260801;};'use strict';var _=require(_0x87cf('0x0'));var util=require(_0x87cf('0x1'));var logger=require(_0x87cf('0x2'))(_0x87cf('0x3'));var moment=require(_0x87cf('0x4'));var BPromise=require(_0x87cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87cf('0x6'));var rimraf=require(_0x87cf('0x7'));var config=require('../../config/environment');var attributes=require(_0x87cf('0x8'));module[_0x87cf('0x9')]=function(_0x3bd3e0,_0x2c90ad){return _0x3bd3e0['define'](_0x87cf('0xa'),attributes,{'tableName':_0x87cf('0xb'),'paranoid':![],'indexes':[{'name':_0x87cf('0xc'),'fields':[_0x87cf('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d25=['freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d25,0x8e));var _0x55d2=function(_0x381854,_0xf66145){_0x381854=_0x381854-0x0;var _0x1cd8df=_0x5d25[_0x381854];return _0x1cd8df;};'use strict';var _=require(_0x55d2('0x0'));var util=require(_0x55d2('0x1'));var logger=require(_0x55d2('0x2'))('api');var moment=require(_0x55d2('0x3'));var BPromise=require(_0x55d2('0x4'));var rp=require(_0x55d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55d2('0x6'));var config=require('../../config/environment');var attributes=require(_0x55d2('0x7'));module[_0x55d2('0x8')]=function(_0x15543c,_0x53bbf2){return _0x15543c[_0x55d2('0x9')](_0x55d2('0xa'),attributes,{'tableName':_0x55d2('0xb'),'paranoid':![],'indexes':[{'name':_0x55d2('0xc'),'fields':['idField',_0x55d2('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 b86af5e..aa1c4f3 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 _0x110a=['FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','client','http','then','info','request\x20sent','debug'];(function(_0x52304f,_0xe96fed){var _0x31aed5=function(_0x3b0178){while(--_0x3b0178){_0x52304f['push'](_0x52304f['shift']());}};_0x31aed5(++_0xe96fed);}(_0x110a,0x184));var _0xa110=function(_0x5234a6,_0x44fa0a){_0x5234a6=_0x5234a6-0x0;var _0x473c8e=_0x110a[_0x5234a6];return _0x473c8e;};'use strict';var _=require(_0xa110('0x0'));var util=require(_0xa110('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa110('0x2'));var fs=require('fs');var Redis=require(_0xa110('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa110('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa110('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa110('0x6')][_0xa110('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x315135,_0x325abb,_0x288c56){return new BPromise(function(_0x313e19,_0x1d21c6){return client['request'](_0x315135,_0x288c56)[_0xa110('0x8')](function(_0x2eb398){logger[_0xa110('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x325abb,_0xa110('0xa'));logger[_0xa110('0xb')](_0xa110('0xc'),_0x325abb,_0xa110('0xa'),JSON[_0xa110('0xd')](_0x2eb398));if(_0x2eb398['error']){if(_0x2eb398['error'][_0xa110('0xe')]===0x1f4){logger[_0xa110('0xf')](_0xa110('0x10'),_0x325abb,_0x2eb398[_0xa110('0xf')][_0xa110('0x11')]);return _0x1d21c6(_0x2eb398[_0xa110('0xf')][_0xa110('0x11')]);}logger[_0xa110('0xf')](_0xa110('0x10'),_0x325abb,_0x2eb398['error'][_0xa110('0x11')]);return _0x313e19(_0x2eb398[_0xa110('0xf')][_0xa110('0x11')]);}else{logger[_0xa110('0x9')](_0xa110('0x10'),_0x325abb,'request\x20sent');_0x313e19(_0x2eb398[_0xa110('0x12')][_0xa110('0x11')]);}})[_0xa110('0x13')](function(_0x6a16d1){logger[_0xa110('0xf')](_0xa110('0x10'),_0x325abb,_0x6a16d1);_0x1d21c6(_0x6a16d1);});});} \ No newline at end of file +var _0x0d8c=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','code','message','error'];(function(_0x4486d7,_0x5d8cf2){var _0x32f705=function(_0x43ed2c){while(--_0x43ed2c){_0x4486d7['push'](_0x4486d7['shift']());}};_0x32f705(++_0x5d8cf2);}(_0x0d8c,0x12d));var _0xc0d8=function(_0x508609,_0x32d6ee){_0x508609=_0x508609-0x0;var _0x4c3701=_0x0d8c[_0x508609];return _0x4c3701;};'use strict';var _=require(_0xc0d8('0x0'));var util=require('util');var moment=require(_0xc0d8('0x1'));var BPromise=require('bluebird');var rs=require(_0xc0d8('0x2'));var fs=require('fs');var Redis=require(_0xc0d8('0x3'));var db=require(_0xc0d8('0x4'))['db'];var utils=require(_0xc0d8('0x5'));var logger=require(_0xc0d8('0x6'))(_0xc0d8('0x7'));var config=require(_0xc0d8('0x8'));var jayson=require(_0xc0d8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15b5d6,_0xcc51c6,_0x56bba4){return new BPromise(function(_0x4b7027,_0x237276){return client[_0xc0d8('0xa')](_0x15b5d6,_0x56bba4)[_0xc0d8('0xb')](function(_0x35534c){logger[_0xc0d8('0xc')](_0xc0d8('0xd'),_0xcc51c6,_0xc0d8('0xe'));logger[_0xc0d8('0xf')](_0xc0d8('0x10'),_0xcc51c6,'request\x20sent',JSON[_0xc0d8('0x11')](_0x35534c));if(_0x35534c['error']){if(_0x35534c['error'][_0xc0d8('0x12')]===0x1f4){logger['error'](_0xc0d8('0xd'),_0xcc51c6,_0x35534c['error'][_0xc0d8('0x13')]);return _0x237276(_0x35534c[_0xc0d8('0x14')]['message']);}logger[_0xc0d8('0x14')]('FreshdeskField,\x20%s,\x20%s',_0xcc51c6,_0x35534c[_0xc0d8('0x14')][_0xc0d8('0x13')]);return _0x4b7027(_0x35534c[_0xc0d8('0x14')][_0xc0d8('0x13')]);}else{logger[_0xc0d8('0xc')](_0xc0d8('0xd'),_0xcc51c6,'request\x20sent');_0x4b7027(_0x35534c[_0xc0d8('0x15')][_0xc0d8('0x13')]);}})[_0xc0d8('0x16')](function(_0x2ec524){logger[_0xc0d8('0x14')](_0xc0d8('0xd'),_0xcc51c6,_0x2ec524);_0x237276(_0x2ec524);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index dc41ea6..ca50666 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 _0x84a0=['isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x84a0,0x66));var _0x084a=function(_0x1b79d0,_0x1e1071){_0x1b79d0=_0x1b79d0-0x0;var _0xf7fc73=_0x84a0[_0x1b79d0];return _0xf7fc73;};'use strict';var multer=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var path=require(_0x084a('0x2'));var timeout=require(_0x084a('0x3'));var express=require('express');var router=express[_0x084a('0x4')]();var fs_extra=require(_0x084a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x084a('0x6'));var controller=require(_0x084a('0x7'));router['get']('/',auth[_0x084a('0x8')](),controller[_0x084a('0x9')]);router[_0x084a('0xa')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller['show']);router[_0x084a('0xa')](_0x084a('0xc'),auth[_0x084a('0x8')](),controller[_0x084a('0xd')]);router[_0x084a('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x084a('0xe')]);router[_0x084a('0xf')]('/',auth[_0x084a('0x8')](),controller[_0x084a('0x10')]);router[_0x084a('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x084a('0x11')]);router[_0x084a('0x12')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller[_0x084a('0x13')]);router[_0x084a('0x14')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller['destroy']);module[_0x084a('0x15')]=router; \ No newline at end of file +var _0xa571=['/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index'];(function(_0x5dd24b,_0xf78470){var _0x279050=function(_0x55dfa0){while(--_0x55dfa0){_0x5dd24b['push'](_0x5dd24b['shift']());}};_0x279050(++_0xf78470);}(_0xa571,0x107));var _0x1a57=function(_0x4e48ea,_0xdee973){_0x4e48ea=_0x4e48ea-0x0;var _0x38b05b=_0xa571[_0x4e48ea];return _0x38b05b;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getConfigurations']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router[_0x1a57('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')](_0x1a57('0xa'),auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x13')]('/:id',auth[_0x1a57('0x8')](),controller['destroy']);module[_0x1a57('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 12f9f58..82ea385 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 _0x3266=['remoteUri','sequelize','exports','STRING','username'];(function(_0x306250,_0x2c44ce){var _0x39e362=function(_0x3cf176){while(--_0x3cf176){_0x306250['push'](_0x306250['shift']());}};_0x39e362(++_0x2c44ce);}(_0x3266,0x6a));var _0x6326=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x3266[_0x5b8b97];return _0x1fdf84;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'name':{'type':Sequelize[_0x6326('0x2')]},'description':{'type':Sequelize[_0x6326('0x2')]},'username':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x3')},'apiKey':{'type':Sequelize[_0x6326('0x2')]},'remoteUri':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xdf55=['exports','STRING','remoteUri','sequelize'];(function(_0x15bea8,_0x595aa7){var _0x6080ed=function(_0xb589f4){while(--_0xb589f4){_0x15bea8['push'](_0x15bea8['shift']());}};_0x6080ed(++_0x595aa7);}(_0xdf55,0x83));var _0x5df5=function(_0x3cb52a,_0x5a586d){_0x3cb52a=_0x3cb52a-0x0;var _0x4e6bab=_0xdf55[_0x3cb52a];return _0x4e6bab;};'use strict';var Sequelize=require(_0x5df5('0x0'));module[_0x5df5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5df5('0x2')]},'username':{'type':Sequelize[_0x5df5('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x5df5('0x2')]},'remoteUri':{'type':Sequelize[_0x5df5('0x2')],'unique':_0x5df5('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index ba0706d..5e58e4f 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 _0x19a5=['Content-Range','apply','save','update','then','destroy','name','index','map','FreshsalesAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','findOne','FreshsalesConfiguration','order','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','slice','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','stringify','send','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0x19a5,0xa6));var _0x519a=function(_0x3ad33c,_0x2cfdeb){_0x3ad33c=_0x3ad33c-0x0;var _0x465d8e=_0x19a5[_0x3ad33c];return _0x465d8e;};'use strict';var emlformat=require(_0x519a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x519a('0x1'));var rp=require(_0x519a('0x2'));var moment=require(_0x519a('0x3'));var BPromise=require(_0x519a('0x4'));var Mustache=require(_0x519a('0x5'));var util=require('util');var path=require(_0x519a('0x6'));var sox=require(_0x519a('0x7'));var csv=require(_0x519a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x519a('0x9'));var _=require(_0x519a('0xa'));var squel=require(_0x519a('0xb'));var crypto=require('crypto');var jsforce=require(_0x519a('0xc'));var deskjs=require(_0x519a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x519a('0xe'));var Papa=require(_0x519a('0xf'));var Redis=require(_0x519a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x519a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x519a('0x12'));var utils=require(_0x519a('0x13'));var config=require(_0x519a('0x14'));var licenseUtil=require(_0x519a('0x15'));var db=require(_0x519a('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3c6406,_0x4b88a6){_0x4b88a6=_0x4b88a6||0xcc;return function(_0x15125f){if(_0x15125f){return _0x3c6406[_0x519a('0x17')](_0x4b88a6);}return _0x3c6406['status'](_0x4b88a6)[_0x519a('0x18')]();};}function respondWithResult(_0x3cd50e,_0x4d0bd8){_0x4d0bd8=_0x4d0bd8||0xc8;return function(_0x429d6a){if(_0x429d6a){return _0x3cd50e[_0x519a('0x19')](_0x4d0bd8)[_0x519a('0x1a')](_0x429d6a);}};}function respondWithFilteredResult(_0x408ac5,_0x37924e){return function(_0xd62e77){if(_0xd62e77){var _0x1498a=typeof _0x37924e[_0x519a('0x1b')]===_0x519a('0x1c')&&typeof _0x37924e['limit']===_0x519a('0x1c');var _0x7838cd=_0xd62e77['count'];var _0x1671ff=_0x1498a?0x0:_0x37924e[_0x519a('0x1b')];var _0x237a40=_0x1498a?_0xd62e77[_0x519a('0x1d')]:_0x37924e[_0x519a('0x1b')]+_0x37924e['limit'];var _0x33663;if(_0x237a40>=_0x7838cd){_0x237a40=_0x7838cd;_0x33663=0xc8;}else{_0x33663=0xce;}_0x408ac5[_0x519a('0x19')](_0x33663);return _0x408ac5['set'](_0x519a('0x1e'),_0x1671ff+'-'+_0x237a40+'/'+_0x7838cd)['json'](_0xd62e77);}return null;};}function patchUpdates(_0x38e1b7){return function(_0x5c6db1){try{jsonpatch[_0x519a('0x1f')](_0x5c6db1,_0x38e1b7,!![]);}catch(_0x5d3a38){return BPromise['reject'](_0x5d3a38);}return _0x5c6db1[_0x519a('0x20')]();};}function saveUpdates(_0x155d07,_0x3292be){return function(_0x280fa2){if(_0x280fa2){return _0x280fa2[_0x519a('0x21')](_0x155d07)[_0x519a('0x22')](function(_0x4b1cf9){return _0x4b1cf9;});}return null;};}function removeEntity(_0x2e4130,_0x365c7a){return function(_0x4f4c80){if(_0x4f4c80){return _0x4f4c80[_0x519a('0x23')]()[_0x519a('0x22')](function(){_0x2e4130[_0x519a('0x19')](0xcc)[_0x519a('0x18')]();});}};}function handleEntityNotFound(_0x531986,_0x3295a9){return function(_0x47ed16){if(!_0x47ed16){_0x531986[_0x519a('0x17')](0x194);}return _0x47ed16;};}function handleError(_0x2bd2c4,_0x322d77){_0x322d77=_0x322d77||0x1f4;return function(_0x5dba49){logger['error'](_0x5dba49['stack']);if(_0x5dba49[_0x519a('0x24')]){delete _0x5dba49[_0x519a('0x24')];}_0x2bd2c4[_0x519a('0x19')](_0x322d77)['send'](_0x5dba49);};}exports[_0x519a('0x25')]=function(_0x1eadd9,_0x511eb6){var _0x582d38={},_0x133e2a={},_0x49b75f={'count':0x0,'rows':[]};var _0x4b071f=_[_0x519a('0x26')](db[_0x519a('0x27')]['rawAttributes'],function(_0x490a15){return{'name':_0x490a15[_0x519a('0x28')],'type':_0x490a15['type'][_0x519a('0x29')]};});_0x133e2a[_0x519a('0x2a')]=_[_0x519a('0x26')](_0x4b071f,_0x519a('0x24'));_0x133e2a[_0x519a('0x2b')]=_[_0x519a('0x2c')](_0x1eadd9['query']);_0x133e2a[_0x519a('0x2d')]=_[_0x519a('0x2e')](_0x133e2a['model'],_0x133e2a['query']);_0x582d38[_0x519a('0x2f')]=_['intersection'](_0x133e2a['model'],qs[_0x519a('0x30')](_0x1eadd9[_0x519a('0x2b')][_0x519a('0x30')]));_0x582d38[_0x519a('0x2f')]=_0x582d38[_0x519a('0x2f')][_0x519a('0x31')]?_0x582d38[_0x519a('0x2f')]:_0x133e2a[_0x519a('0x2a')];if(!_0x1eadd9[_0x519a('0x2b')][_0x519a('0x32')](_0x519a('0x33'))){_0x582d38['limit']=qs[_0x519a('0x34')](_0x1eadd9[_0x519a('0x2b')][_0x519a('0x34')]);_0x582d38[_0x519a('0x1b')]=qs['offset'](_0x1eadd9[_0x519a('0x2b')][_0x519a('0x1b')]);}_0x582d38['order']=qs[_0x519a('0x35')](_0x1eadd9['query'][_0x519a('0x35')]);_0x582d38[_0x519a('0x36')]=qs[_0x519a('0x2d')](_[_0x519a('0x37')](_0x1eadd9[_0x519a('0x2b')],_0x133e2a[_0x519a('0x2d')]),_0x4b071f);if(_0x1eadd9[_0x519a('0x2b')]['filter']){_0x582d38[_0x519a('0x36')]=_[_0x519a('0x38')](_0x582d38[_0x519a('0x36')],{'$or':_[_0x519a('0x26')](_0x4b071f,function(_0x20fa62){if(_0x20fa62[_0x519a('0x39')]!==_0x519a('0x3a')){var _0x18e751={};_0x18e751[_0x20fa62[_0x519a('0x24')]]={'$like':'%'+_0x1eadd9['query'][_0x519a('0x3b')]+'%'};return _0x18e751;}})});}_0x582d38=_[_0x519a('0x38')]({},_0x582d38,_0x1eadd9[_0x519a('0x3c')]);var _0x3a1b7e={'where':_0x582d38['where']};return db[_0x519a('0x27')]['count'](_0x3a1b7e)['then'](function(_0x1307d3){_0x49b75f[_0x519a('0x1d')]=_0x1307d3;if(_0x1eadd9[_0x519a('0x2b')]['includeAll']){_0x582d38[_0x519a('0x3d')]=[{'all':!![]}];}return db[_0x519a('0x27')][_0x519a('0x3e')](_0x582d38);})['then'](function(_0x22bdd4){_0x49b75f[_0x519a('0x3f')]=_0x22bdd4;return _0x49b75f;})['then'](respondWithFilteredResult(_0x511eb6,_0x582d38))[_0x519a('0x40')](handleError(_0x511eb6,null));};exports[_0x519a('0x41')]=function(_0x219330,_0xf5b214){var _0x1eac2f={'raw':![],'where':{'id':_0x219330['params']['id']}},_0x18e162={};_0x18e162[_0x519a('0x2a')]=_[_0x519a('0x2c')](db[_0x519a('0x27')][_0x519a('0x42')]);_0x18e162['query']=_['keys'](_0x219330[_0x519a('0x2b')]);_0x18e162[_0x519a('0x2d')]=_[_0x519a('0x2e')](_0x18e162['model'],_0x18e162['query']);_0x1eac2f['attributes']=_['intersection'](_0x18e162['model'],qs[_0x519a('0x30')](_0x219330[_0x519a('0x2b')][_0x519a('0x30')]));_0x1eac2f[_0x519a('0x2f')]=_0x1eac2f[_0x519a('0x2f')][_0x519a('0x31')]?_0x1eac2f[_0x519a('0x2f')]:_0x18e162[_0x519a('0x2a')];if(_0x219330[_0x519a('0x2b')]['includeAll']){_0x1eac2f[_0x519a('0x3d')]=[{'all':!![]}];}_0x1eac2f=_[_0x519a('0x38')]({},_0x1eac2f,_0x219330['options']);return db[_0x519a('0x27')][_0x519a('0x43')](_0x1eac2f)[_0x519a('0x22')](handleEntityNotFound(_0xf5b214,null))[_0x519a('0x22')](respondWithResult(_0xf5b214,null))['catch'](handleError(_0xf5b214,null));};exports['create']=function(_0x3303cf,_0x236331){return db[_0x519a('0x27')][_0x519a('0x44')](_0x3303cf['body'],{})[_0x519a('0x22')](respondWithResult(_0x236331,0xc9))['catch'](handleError(_0x236331,null));};exports[_0x519a('0x21')]=function(_0x5f15a9,_0x135e17){if(_0x5f15a9['body']['id']){delete _0x5f15a9[_0x519a('0x45')]['id'];}return db['FreshsalesAccount'][_0x519a('0x43')]({'where':{'id':_0x5f15a9[_0x519a('0x46')]['id']}})[_0x519a('0x22')](handleEntityNotFound(_0x135e17,null))[_0x519a('0x22')](saveUpdates(_0x5f15a9[_0x519a('0x45')],null))[_0x519a('0x22')](respondWithResult(_0x135e17,null))[_0x519a('0x40')](handleError(_0x135e17,null));};exports[_0x519a('0x23')]=function(_0x2446d3,_0xb0d80f){return db[_0x519a('0x27')][_0x519a('0x43')]({'where':{'id':_0x2446d3['params']['id']}})[_0x519a('0x22')](handleEntityNotFound(_0xb0d80f,null))['then'](removeEntity(_0xb0d80f,null))[_0x519a('0x40')](handleError(_0xb0d80f,null));};exports['getConfigurations']=function(_0x2b84b5,_0xbabaef,_0x3c3460){var _0x4de09e={};var _0x2f37dc={};var _0x52ac9f;var _0x1fce1b;return db[_0x519a('0x27')][_0x519a('0x47')]({'where':{'id':_0x2b84b5[_0x519a('0x46')]['id']}})['then'](handleEntityNotFound(_0xbabaef,null))['then'](function(_0x240e4c){if(_0x240e4c){_0x52ac9f=_0x240e4c;_0x2f37dc['model']=_[_0x519a('0x2c')](db[_0x519a('0x48')][_0x519a('0x42')]);_0x2f37dc[_0x519a('0x2b')]=_[_0x519a('0x2c')](_0x2b84b5[_0x519a('0x2b')]);_0x2f37dc[_0x519a('0x2d')]=_['intersection'](_0x2f37dc['model'],_0x2f37dc[_0x519a('0x2b')]);_0x4de09e['attributes']=_[_0x519a('0x2e')](_0x2f37dc[_0x519a('0x2a')],qs[_0x519a('0x30')](_0x2b84b5['query'][_0x519a('0x30')]));_0x4de09e['attributes']=_0x4de09e['attributes'][_0x519a('0x31')]?_0x4de09e['attributes']:_0x2f37dc['model'];_0x4de09e[_0x519a('0x49')]=qs[_0x519a('0x35')](_0x2b84b5[_0x519a('0x2b')][_0x519a('0x35')]);_0x4de09e['where']=qs[_0x519a('0x2d')](_[_0x519a('0x37')](_0x2b84b5[_0x519a('0x2b')],_0x2f37dc[_0x519a('0x2d')]));if(_0x2b84b5[_0x519a('0x2b')]['filter']){_0x4de09e['where']=_[_0x519a('0x38')](_0x4de09e[_0x519a('0x36')],{'$or':_[_0x519a('0x26')](_0x4de09e[_0x519a('0x2f')],function(_0x3923e2){var _0x3f0512={};_0x3f0512[_0x3923e2]={'$like':'%'+_0x2b84b5[_0x519a('0x2b')][_0x519a('0x3b')]+'%'};return _0x3f0512;})});}_0x4de09e=_[_0x519a('0x38')]({},_0x4de09e,_0x2b84b5[_0x519a('0x3c')]);return _0x52ac9f[_0x519a('0x4a')](_0x4de09e);}})['then'](function(_0x37135c){if(_0x37135c){_0x1fce1b=_0x37135c[_0x519a('0x31')];if(!_0x2b84b5[_0x519a('0x2b')]['hasOwnProperty'](_0x519a('0x33'))){_0x4de09e[_0x519a('0x34')]=qs[_0x519a('0x34')](_0x2b84b5[_0x519a('0x2b')][_0x519a('0x34')]);_0x4de09e['offset']=qs[_0x519a('0x1b')](_0x2b84b5['query'][_0x519a('0x1b')]);}return _0x52ac9f['getConfigurations'](_0x4de09e);}})[_0x519a('0x22')](function(_0x3d4499){if(_0x3d4499){return _0x3d4499?{'count':_0x1fce1b,'rows':_0x3d4499}:null;}})[_0x519a('0x22')](respondWithResult(_0xbabaef,null))['catch'](handleError(_0xbabaef,null));};exports['addConfiguration']=function(_0x37207a,_0x3e5170,_0x4780e1){if(_0x37207a[_0x519a('0x45')]['id']){delete _0x37207a[_0x519a('0x45')]['id'];}return db[_0x519a('0x27')][_0x519a('0x47')]({'where':{'id':_0x37207a['params']['id']}})[_0x519a('0x22')](handleEntityNotFound(_0x3e5170,null))['then'](function(_0x30e682){if(_0x30e682){_0x37207a[_0x519a('0x45')][_0x519a('0x4b')]=_0x30e682['id'];_0x37207a[_0x519a('0x45')][_0x519a('0x4c')]=integrations[_0x519a('0x4d')](_0x37207a[_0x519a('0x45')][_0x519a('0x4e')],_0x37207a[_0x519a('0x45')][_0x519a('0x39')]);_0x37207a[_0x519a('0x45')][_0x519a('0x4f')]=integrations[_0x519a('0x50')](_0x37207a[_0x519a('0x45')]['channel'],_0x37207a[_0x519a('0x45')]['type']);return db['FreshsalesConfiguration'][_0x519a('0x44')](_0x37207a[_0x519a('0x45')],{'include':[{'model':db[_0x519a('0x51')],'as':_0x519a('0x4c')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x519a('0x22')](respondWithResult(_0x3e5170,null))[_0x519a('0x40')](handleError(_0x3e5170,null));};exports[_0x519a('0x52')]=function(_0x1ec9f5,_0x366014,_0x10e5ff){var _0x28e54a='';var _0x5f3d4b='';return db[_0x519a('0x27')][_0x519a('0x47')]({'where':{'id':_0x1ec9f5['params']['id']},'attributes':['id',_0x519a('0x53'),_0x519a('0x54'),'apiKey']})[_0x519a('0x22')](handleEntityNotFound(_0x366014,null))[_0x519a('0x22')](function(_0x59d7fc){if(_0x59d7fc){_0x5f3d4b=_0x59d7fc[_0x519a('0x53')];_0x28e54a=_0x59d7fc[_0x519a('0x54')];var _0x3a63c5=_0x59d7fc[_0x519a('0x54')][_0x519a('0x55')](-0x1);if(_0x3a63c5==='/'){_0x28e54a=_0x28e54a['substring'](0x0,_0x28e54a[_0x519a('0x56')](_0x3a63c5));}return rp({'method':_0x519a('0x57'),'uri':util['format'](_0x519a('0x58'),_0x28e54a,_0x519a('0x59')),'headers':{'Authorization':_0x519a('0x5a')+_0x59d7fc['apiKey']},'json':!![]});}})[_0x519a('0x22')](function(_0x48b1aa){if(_0x48b1aa){var _0x5c907c=_0x48b1aa[_0x519a('0x5b')];var _0x54be19=![];var _0x6f4bb5=null;for(_0x6f4bb5=0x0;_0x6f4bb5<_0x5c907c[_0x519a('0x31')];_0x6f4bb5++){if(_0x5c907c[_0x6f4bb5][_0x519a('0x5c')]===_0x5f3d4b){_0x54be19=!![];}}if(_0x54be19){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x519a('0x5d')});}}})[_0x519a('0x22')](respondWithResult(_0x366014,null))['catch'](function(_0x16573a){var _0x39d21d=_0x1ec9f5[_0x519a('0x2b')]['test']?0x1f4:_0x16573a[_0x519a('0x5e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x519a('0x52'),_0x39d21d,JSON[_0x519a('0x5f')](_0x16573a));delete _0x16573a[_0x519a('0x24')];if(_0x39d21d===0x191){_0x39d21d=0x190;}_0x366014[_0x519a('0x19')](_0x39d21d)[_0x519a('0x60')](_0x1ec9f5[_0x519a('0x2b')]['test']?{'message':_0x519a('0x61'),'statusCode':_0x16573a['statusCode']}:_0x16573a);});}; \ No newline at end of file +var _0xdb7e=['nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','update','destroy','getConfigurations','findOne','rawAttributes','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesConfiguration','FreshsalesField','Descriptions','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','%s%s','users','email','test','statusCode','error','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','index','FreshsalesAccount','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x256b80,_0x154304){var _0x15a8fa=function(_0x32b82b){while(--_0x32b82b){_0x256b80['push'](_0x256b80['shift']());}};_0x15a8fa(++_0x154304);}(_0xdb7e,0x1c6));var _0xedb7=function(_0x1faa95,_0x5aa902){_0x1faa95=_0x1faa95-0x0;var _0x1bdd3c=_0xdb7e[_0x1faa95];return _0x1bdd3c;};'use strict';var emlformat=require(_0xedb7('0x0'));var rimraf=require(_0xedb7('0x1'));var zipdir=require(_0xedb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedb7('0x3'));var moment=require(_0xedb7('0x4'));var BPromise=require(_0xedb7('0x5'));var Mustache=require(_0xedb7('0x6'));var util=require(_0xedb7('0x7'));var path=require(_0xedb7('0x8'));var sox=require(_0xedb7('0x9'));var csv=require(_0xedb7('0xa'));var ejs=require(_0xedb7('0xb'));var fs=require('fs');var fs_extra=require(_0xedb7('0xc'));var _=require(_0xedb7('0xd'));var squel=require('squel');var crypto=require(_0xedb7('0xe'));var jsforce=require(_0xedb7('0xf'));var deskjs=require(_0xedb7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xedb7('0x11'));var Redis=require('ioredis');var authService=require(_0xedb7('0x12'));var qs=require(_0xedb7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedb7('0x14'));var logger=require(_0xedb7('0x15'))(_0xedb7('0x16'));var utils=require(_0xedb7('0x17'));var config=require(_0xedb7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xedb7('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x492a9c,_0x1ae834){_0x1ae834=_0x1ae834||0xcc;return function(_0x47c67e){if(_0x47c67e){return _0x492a9c[_0xedb7('0x1a')](_0x1ae834);}return _0x492a9c[_0xedb7('0x1b')](_0x1ae834)[_0xedb7('0x1c')]();};}function respondWithResult(_0x1d36f3,_0x41a317){_0x41a317=_0x41a317||0xc8;return function(_0x14dcc6){if(_0x14dcc6){return _0x1d36f3[_0xedb7('0x1b')](_0x41a317)['json'](_0x14dcc6);}};}function respondWithFilteredResult(_0x4145f0,_0x45ff7c){return function(_0x43a3e2){if(_0x43a3e2){var _0x21cee6=typeof _0x45ff7c[_0xedb7('0x1d')]===_0xedb7('0x1e')&&typeof _0x45ff7c[_0xedb7('0x1f')]===_0xedb7('0x1e');var _0x4b8acb=_0x43a3e2[_0xedb7('0x20')];var _0x3151f8=_0x21cee6?0x0:_0x45ff7c['offset'];var _0x2ff012=_0x21cee6?_0x43a3e2[_0xedb7('0x20')]:_0x45ff7c[_0xedb7('0x1d')]+_0x45ff7c['limit'];var _0x4db3be;if(_0x2ff012>=_0x4b8acb){_0x2ff012=_0x4b8acb;_0x4db3be=0xc8;}else{_0x4db3be=0xce;}_0x4145f0[_0xedb7('0x1b')](_0x4db3be);return _0x4145f0[_0xedb7('0x21')](_0xedb7('0x22'),_0x3151f8+'-'+_0x2ff012+'/'+_0x4b8acb)['json'](_0x43a3e2);}return null;};}function patchUpdates(_0x56ca24){return function(_0x57fa6c){try{jsonpatch[_0xedb7('0x23')](_0x57fa6c,_0x56ca24,!![]);}catch(_0x10dfbe){return BPromise[_0xedb7('0x24')](_0x10dfbe);}return _0x57fa6c[_0xedb7('0x25')]();};}function saveUpdates(_0x25bf5d,_0x27c615){return function(_0x2e8149){if(_0x2e8149){return _0x2e8149['update'](_0x25bf5d)['then'](function(_0x4fb832){return _0x4fb832;});}return null;};}function removeEntity(_0x315fb2,_0x462f24){return function(_0x4e0aaa){if(_0x4e0aaa){return _0x4e0aaa['destroy']()[_0xedb7('0x26')](function(){_0x315fb2[_0xedb7('0x1b')](0xcc)[_0xedb7('0x1c')]();});}};}function handleEntityNotFound(_0x5bdd99,_0x567745){return function(_0x2cc9f6){if(!_0x2cc9f6){_0x5bdd99[_0xedb7('0x1a')](0x194);}return _0x2cc9f6;};}function handleError(_0x1fdde6,_0x1f51d5){_0x1f51d5=_0x1f51d5||0x1f4;return function(_0x2087c7){logger['error'](_0x2087c7[_0xedb7('0x27')]);if(_0x2087c7[_0xedb7('0x28')]){delete _0x2087c7[_0xedb7('0x28')];}_0x1fdde6[_0xedb7('0x1b')](_0x1f51d5)['send'](_0x2087c7);};}exports[_0xedb7('0x29')]=function(_0x3cdc41,_0x34be2a){var _0x4e82ad={},_0xe3db97={},_0xf55160={'count':0x0,'rows':[]};var _0x19e24b=_['map'](db[_0xedb7('0x2a')]['rawAttributes'],function(_0x420675){return{'name':_0x420675[_0xedb7('0x2b')],'type':_0x420675[_0xedb7('0x2c')][_0xedb7('0x2d')]};});_0xe3db97[_0xedb7('0x2e')]=_[_0xedb7('0x2f')](_0x19e24b,'name');_0xe3db97[_0xedb7('0x30')]=_[_0xedb7('0x31')](_0x3cdc41[_0xedb7('0x30')]);_0xe3db97[_0xedb7('0x32')]=_[_0xedb7('0x33')](_0xe3db97['model'],_0xe3db97[_0xedb7('0x30')]);_0x4e82ad['attributes']=_[_0xedb7('0x33')](_0xe3db97[_0xedb7('0x2e')],qs[_0xedb7('0x34')](_0x3cdc41[_0xedb7('0x30')][_0xedb7('0x34')]));_0x4e82ad['attributes']=_0x4e82ad[_0xedb7('0x35')][_0xedb7('0x36')]?_0x4e82ad[_0xedb7('0x35')]:_0xe3db97[_0xedb7('0x2e')];if(!_0x3cdc41[_0xedb7('0x30')][_0xedb7('0x37')](_0xedb7('0x38'))){_0x4e82ad[_0xedb7('0x1f')]=qs[_0xedb7('0x1f')](_0x3cdc41['query'][_0xedb7('0x1f')]);_0x4e82ad[_0xedb7('0x1d')]=qs['offset'](_0x3cdc41[_0xedb7('0x30')][_0xedb7('0x1d')]);}_0x4e82ad['order']=qs[_0xedb7('0x39')](_0x3cdc41[_0xedb7('0x30')]['sort']);_0x4e82ad[_0xedb7('0x3a')]=qs['filters'](_[_0xedb7('0x3b')](_0x3cdc41['query'],_0xe3db97['filters']),_0x19e24b);if(_0x3cdc41[_0xedb7('0x30')][_0xedb7('0x3c')]){_0x4e82ad['where']=_['merge'](_0x4e82ad[_0xedb7('0x3a')],{'$or':_[_0xedb7('0x2f')](_0x19e24b,function(_0x14ff3b){if(_0x14ff3b['type']!==_0xedb7('0x3d')){var _0x4dc85a={};_0x4dc85a[_0x14ff3b[_0xedb7('0x28')]]={'$like':'%'+_0x3cdc41['query'][_0xedb7('0x3c')]+'%'};return _0x4dc85a;}})});}_0x4e82ad=_[_0xedb7('0x3e')]({},_0x4e82ad,_0x3cdc41[_0xedb7('0x3f')]);var _0x24d681={'where':_0x4e82ad['where']};return db[_0xedb7('0x2a')][_0xedb7('0x20')](_0x24d681)[_0xedb7('0x26')](function(_0x45dedb){_0xf55160['count']=_0x45dedb;if(_0x3cdc41['query']['includeAll']){_0x4e82ad[_0xedb7('0x40')]=[{'all':!![]}];}return db[_0xedb7('0x2a')][_0xedb7('0x41')](_0x4e82ad);})[_0xedb7('0x26')](function(_0x3a29f3){_0xf55160['rows']=_0x3a29f3;return _0xf55160;})[_0xedb7('0x26')](respondWithFilteredResult(_0x34be2a,_0x4e82ad))[_0xedb7('0x42')](handleError(_0x34be2a,null));};exports[_0xedb7('0x43')]=function(_0x3d9266,_0x10d0c1){var _0x262cdb={'raw':![],'where':{'id':_0x3d9266[_0xedb7('0x44')]['id']}},_0x57f146={};_0x57f146[_0xedb7('0x2e')]=_[_0xedb7('0x31')](db[_0xedb7('0x2a')]['rawAttributes']);_0x57f146[_0xedb7('0x30')]=_[_0xedb7('0x31')](_0x3d9266[_0xedb7('0x30')]);_0x57f146['filters']=_[_0xedb7('0x33')](_0x57f146['model'],_0x57f146[_0xedb7('0x30')]);_0x262cdb[_0xedb7('0x35')]=_[_0xedb7('0x33')](_0x57f146[_0xedb7('0x2e')],qs['fields'](_0x3d9266[_0xedb7('0x30')][_0xedb7('0x34')]));_0x262cdb[_0xedb7('0x35')]=_0x262cdb['attributes'][_0xedb7('0x36')]?_0x262cdb[_0xedb7('0x35')]:_0x57f146[_0xedb7('0x2e')];if(_0x3d9266[_0xedb7('0x30')][_0xedb7('0x45')]){_0x262cdb['include']=[{'all':!![]}];}_0x262cdb=_[_0xedb7('0x3e')]({},_0x262cdb,_0x3d9266[_0xedb7('0x3f')]);return db['FreshsalesAccount'][_0xedb7('0x46')](_0x262cdb)[_0xedb7('0x26')](handleEntityNotFound(_0x10d0c1,null))[_0xedb7('0x26')](respondWithResult(_0x10d0c1,null))['catch'](handleError(_0x10d0c1,null));};exports[_0xedb7('0x47')]=function(_0x4785f8,_0x1f963d){return db[_0xedb7('0x2a')][_0xedb7('0x47')](_0x4785f8[_0xedb7('0x48')],{})[_0xedb7('0x26')](respondWithResult(_0x1f963d,0xc9))[_0xedb7('0x42')](handleError(_0x1f963d,null));};exports[_0xedb7('0x49')]=function(_0x4e9d58,_0x14404f){if(_0x4e9d58[_0xedb7('0x48')]['id']){delete _0x4e9d58['body']['id'];}return db[_0xedb7('0x2a')][_0xedb7('0x46')]({'where':{'id':_0x4e9d58['params']['id']}})[_0xedb7('0x26')](handleEntityNotFound(_0x14404f,null))[_0xedb7('0x26')](saveUpdates(_0x4e9d58[_0xedb7('0x48')],null))['then'](respondWithResult(_0x14404f,null))[_0xedb7('0x42')](handleError(_0x14404f,null));};exports[_0xedb7('0x4a')]=function(_0x453725,_0x5fcf33){return db[_0xedb7('0x2a')][_0xedb7('0x46')]({'where':{'id':_0x453725[_0xedb7('0x44')]['id']}})[_0xedb7('0x26')](handleEntityNotFound(_0x5fcf33,null))[_0xedb7('0x26')](removeEntity(_0x5fcf33,null))[_0xedb7('0x42')](handleError(_0x5fcf33,null));};exports[_0xedb7('0x4b')]=function(_0x5b58f7,_0x4af59e,_0x25c8d7){var _0x32792b={};var _0x5ed25c={};var _0x3baed2;var _0x37c8a2;return db[_0xedb7('0x2a')][_0xedb7('0x4c')]({'where':{'id':_0x5b58f7[_0xedb7('0x44')]['id']}})[_0xedb7('0x26')](handleEntityNotFound(_0x4af59e,null))[_0xedb7('0x26')](function(_0x46b6ce){if(_0x46b6ce){_0x3baed2=_0x46b6ce;_0x5ed25c[_0xedb7('0x2e')]=_[_0xedb7('0x31')](db['FreshsalesConfiguration'][_0xedb7('0x4d')]);_0x5ed25c['query']=_[_0xedb7('0x31')](_0x5b58f7[_0xedb7('0x30')]);_0x5ed25c[_0xedb7('0x32')]=_[_0xedb7('0x33')](_0x5ed25c[_0xedb7('0x2e')],_0x5ed25c[_0xedb7('0x30')]);_0x32792b[_0xedb7('0x35')]=_['intersection'](_0x5ed25c[_0xedb7('0x2e')],qs['fields'](_0x5b58f7[_0xedb7('0x30')][_0xedb7('0x34')]));_0x32792b[_0xedb7('0x35')]=_0x32792b[_0xedb7('0x35')][_0xedb7('0x36')]?_0x32792b[_0xedb7('0x35')]:_0x5ed25c[_0xedb7('0x2e')];_0x32792b['order']=qs[_0xedb7('0x39')](_0x5b58f7['query'][_0xedb7('0x39')]);_0x32792b['where']=qs[_0xedb7('0x32')](_[_0xedb7('0x3b')](_0x5b58f7['query'],_0x5ed25c['filters']));if(_0x5b58f7[_0xedb7('0x30')][_0xedb7('0x3c')]){_0x32792b[_0xedb7('0x3a')]=_[_0xedb7('0x3e')](_0x32792b['where'],{'$or':_[_0xedb7('0x2f')](_0x32792b['attributes'],function(_0x430be7){var _0x5f3103={};_0x5f3103[_0x430be7]={'$like':'%'+_0x5b58f7[_0xedb7('0x30')][_0xedb7('0x3c')]+'%'};return _0x5f3103;})});}_0x32792b=_[_0xedb7('0x3e')]({},_0x32792b,_0x5b58f7[_0xedb7('0x3f')]);return _0x3baed2[_0xedb7('0x4b')](_0x32792b);}})['then'](function(_0x227fb2){if(_0x227fb2){_0x37c8a2=_0x227fb2[_0xedb7('0x36')];if(!_0x5b58f7[_0xedb7('0x30')][_0xedb7('0x37')](_0xedb7('0x38'))){_0x32792b[_0xedb7('0x1f')]=qs[_0xedb7('0x1f')](_0x5b58f7[_0xedb7('0x30')][_0xedb7('0x1f')]);_0x32792b['offset']=qs[_0xedb7('0x1d')](_0x5b58f7['query'][_0xedb7('0x1d')]);}return _0x3baed2[_0xedb7('0x4b')](_0x32792b);}})['then'](function(_0x2c247e){if(_0x2c247e){return _0x2c247e?{'count':_0x37c8a2,'rows':_0x2c247e}:null;}})[_0xedb7('0x26')](respondWithResult(_0x4af59e,null))[_0xedb7('0x42')](handleError(_0x4af59e,null));};exports['addConfiguration']=function(_0x5c7e2f,_0x3916dc,_0x485ca1){if(_0x5c7e2f[_0xedb7('0x48')]['id']){delete _0x5c7e2f['body']['id'];}return db[_0xedb7('0x2a')]['findOne']({'where':{'id':_0x5c7e2f['params']['id']}})[_0xedb7('0x26')](handleEntityNotFound(_0x3916dc,null))[_0xedb7('0x26')](function(_0x29f7f3){if(_0x29f7f3){_0x5c7e2f[_0xedb7('0x48')][_0xedb7('0x4e')]=_0x29f7f3['id'];_0x5c7e2f[_0xedb7('0x48')][_0xedb7('0x4f')]=integrations[_0xedb7('0x50')](_0x5c7e2f[_0xedb7('0x48')][_0xedb7('0x51')],_0x5c7e2f[_0xedb7('0x48')][_0xedb7('0x2c')]);_0x5c7e2f[_0xedb7('0x48')]['Descriptions']=integrations[_0xedb7('0x52')](_0x5c7e2f[_0xedb7('0x48')][_0xedb7('0x51')],_0x5c7e2f[_0xedb7('0x48')]['type']);return db[_0xedb7('0x53')][_0xedb7('0x47')](_0x5c7e2f[_0xedb7('0x48')],{'include':[{'model':db[_0xedb7('0x54')],'as':_0xedb7('0x4f')},{'model':db[_0xedb7('0x54')],'as':_0xedb7('0x55')}]});}return null;})['then'](respondWithResult(_0x3916dc,null))[_0xedb7('0x42')](handleError(_0x3916dc,null));};exports[_0xedb7('0x56')]=function(_0x25606d,_0x11119e,_0x46dbec){var _0x19548b='';var _0x32acd0='';return db[_0xedb7('0x2a')][_0xedb7('0x4c')]({'where':{'id':_0x25606d[_0xedb7('0x44')]['id']},'attributes':['id','username',_0xedb7('0x57'),_0xedb7('0x58')]})[_0xedb7('0x26')](handleEntityNotFound(_0x11119e,null))['then'](function(_0x47d2ca){if(_0x47d2ca){_0x32acd0=_0x47d2ca[_0xedb7('0x59')];_0x19548b=_0x47d2ca[_0xedb7('0x57')];var _0x17d9c8=_0x47d2ca['remoteUri'][_0xedb7('0x5a')](-0x1);if(_0x17d9c8==='/'){_0x19548b=_0x19548b[_0xedb7('0x5b')](0x0,_0x19548b[_0xedb7('0x5c')](_0x17d9c8));}return rp({'method':'GET','uri':util['format'](_0xedb7('0x5d'),_0x19548b,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x47d2ca['apiKey']},'json':!![]});}})['then'](function(_0x3360e8){if(_0x3360e8){var _0x4f7775=_0x3360e8[_0xedb7('0x5e')];var _0x49cc9a=![];var _0x58379d=null;for(_0x58379d=0x0;_0x58379d<_0x4f7775[_0xedb7('0x36')];_0x58379d++){if(_0x4f7775[_0x58379d][_0xedb7('0x5f')]===_0x32acd0){_0x49cc9a=!![];}}if(_0x49cc9a){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x11119e,null))[_0xedb7('0x42')](function(_0x39f548){var _0x567ba2=_0x25606d[_0xedb7('0x30')][_0xedb7('0x60')]?0x1f4:_0x39f548[_0xedb7('0x61')]||0x1f4;logger[_0xedb7('0x62')]('getFields,\x20%s,\x20%s,\x20%s',_0xedb7('0x56'),_0x567ba2,JSON[_0xedb7('0x63')](_0x39f548));delete _0x39f548[_0xedb7('0x28')];if(_0x567ba2===0x191){_0x567ba2=0x190;}_0x11119e[_0xedb7('0x1b')](_0x567ba2)[_0xedb7('0x64')](_0x25606d[_0xedb7('0x30')]['test']?{'message':_0xedb7('0x65'),'statusCode':_0x39f548[_0xedb7('0x61')]}:_0x39f548);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index bc0cdb8..3ed588a 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 _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','bluebird'];(function(_0x4052c0,_0x4271ab){var _0x296f04=function(_0x5373fc){while(--_0x5373fc){_0x4052c0['push'](_0x4052c0['shift']());}};_0x296f04(++_0x4271ab);}(_0x5d58,0x187));var _0x85d5=function(_0x1fac1b,_0x80f51f){_0x1fac1b=_0x1fac1b-0x0;var _0x493d19=_0x5d58[_0x1fac1b];return _0x493d19;};'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('./intFreshsalesAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['define','int_freshsales_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x5b218a,_0x58aef1){var _0x3e3c2b=function(_0x152ce3){while(--_0x152ce3){_0x5b218a['push'](_0x5b218a['shift']());}};_0x3e3c2b(++_0x58aef1);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('FreshsalesAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index fe6263e..7490f7c 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 _0x4745=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','attributes','limit','include','map','model','then','raw','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xee2e7a,_0x58354d){var _0x319dd3=function(_0xa99240){while(--_0xa99240){_0xee2e7a['push'](_0xee2e7a['shift']());}};_0x319dd3(++_0x58354d);}(_0x4745,0x1e7));var _0x5474=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4745[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431f81,_0x57add7,_0x13929f){return new BPromise(function(_0x5d778b,_0x902ba8){return client[_0x5474('0xd')](_0x431f81,_0x13929f)['then'](function(_0xf876f8){logger[_0x5474('0xe')](_0x5474('0xf'),_0x57add7,_0x5474('0x10'));logger[_0x5474('0x11')](_0x5474('0x12'),_0x57add7,_0x5474('0x10'),JSON[_0x5474('0x13')](_0xf876f8));if(_0xf876f8['error']){if(_0xf876f8[_0x5474('0x14')][_0x5474('0x15')]===0x1f4){logger[_0x5474('0x14')](_0x5474('0xf'),_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x902ba8(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}logger[_0x5474('0x14')]('FreshsalesAccount,\x20%s,\x20%s',_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x5d778b(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x57add7,'request\x20sent');_0x5d778b(_0xf876f8['result'][_0x5474('0x16')]);}})[_0x5474('0x17')](function(_0x2da774){logger['error'](_0x5474('0xf'),_0x57add7,_0x2da774);_0x902ba8(_0x2da774);});});}exports[_0x5474('0x18')]=function(_0x56dbfa){var _0x22b37d=this;return new Promise(function(_0x198fc8,_0x18b0fe){return db[_0x5474('0x19')][_0x5474('0x1a')]({'raw':_0x56dbfa['options']?_0x56dbfa[_0x5474('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')]['where']||null:null,'attributes':_0x56dbfa['options']?_0x56dbfa['options'][_0x5474('0x1c')]||null:null,'limit':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1d')]||null:null,'include':_0x56dbfa[_0x5474('0x1b')]?_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x56dbfa[_0x5474('0x1b')][_0x5474('0x1e')],function(_0x542d1f){return{'model':db[_0x542d1f['model']],'as':_0x542d1f['as'],'attributes':_0x542d1f[_0x5474('0x1c')],'include':_0x542d1f[_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x542d1f['include'],function(_0x24997a){return{'model':db[_0x24997a['model']],'as':_0x24997a['as'],'attributes':_0x24997a[_0x5474('0x1c')],'include':_0x24997a[_0x5474('0x1e')]?_['map'](_0x24997a[_0x5474('0x1e')],function(_0x5d4cd7){return{'model':db[_0x5d4cd7[_0x5474('0x20')]],'as':_0x5d4cd7['as'],'attributes':_0x5d4cd7['attributes']};}):[]};}):[]};}):[]:[]})[_0x5474('0x21')](function(_0x1384e4){logger[_0x5474('0xe')]('GetFreshsalesAccount',_0x56dbfa);logger[_0x5474('0x11')](_0x5474('0x18'),_0x56dbfa,JSON['stringify'](_0x1384e4));_0x198fc8(_0x1384e4);})['catch'](function(_0x5d2381){logger['error'](_0x5474('0x18'),_0x5d2381[_0x5474('0x16')],_0x56dbfa);_0x18b0fe(_0x22b37d['error'](0x1f4,_0x5d2381[_0x5474('0x16')]));});});};exports['ShowFreshsalesAccount']=function(_0xc1e0ce){var _0x58f27a=this;return new Promise(function(_0x70774f,_0x530cdb){return db[_0x5474('0x19')]['find']({'raw':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce[_0x5474('0x1b')][_0x5474('0x22')]===undefined?!![]:![]:!![],'where':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce['options']['where']||null:null,'attributes':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce[_0x5474('0x1b')][_0x5474('0x1c')]||null:null,'include':_0xc1e0ce[_0x5474('0x1b')]?_0xc1e0ce['options']['include']?_[_0x5474('0x1f')](_0xc1e0ce[_0x5474('0x1b')]['include'],function(_0x3ce359){return{'model':db[_0x3ce359[_0x5474('0x20')]],'as':_0x3ce359['as'],'attributes':_0x3ce359[_0x5474('0x1c')],'include':_0x3ce359[_0x5474('0x1e')]?_['map'](_0x3ce359[_0x5474('0x1e')],function(_0x409111){return{'model':db[_0x409111[_0x5474('0x20')]],'as':_0x409111['as'],'attributes':_0x409111['attributes'],'include':_0x409111[_0x5474('0x1e')]?_[_0x5474('0x1f')](_0x409111[_0x5474('0x1e')],function(_0x2f4589){return{'model':db[_0x2f4589['model']],'as':_0x2f4589['as'],'attributes':_0x2f4589['attributes']};}):[]};}):[]};}):[]:[]})[_0x5474('0x21')](function(_0x3eccef){logger[_0x5474('0xe')](_0x5474('0x23'),_0xc1e0ce);logger['debug'](_0x5474('0x23'),_0xc1e0ce,JSON[_0x5474('0x13')](_0x3eccef));_0x70774f(_0x3eccef);})[_0x5474('0x17')](function(_0x22009e){logger['error']('ShowFreshsalesAccount',_0x22009e['message'],_0xc1e0ce);_0x530cdb(_0x58f27a[_0x5474('0x14')](0x1f4,_0x22009e['message']));});});}; \ No newline at end of file +var _0x1893=['request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowFreshsalesAccount','find','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s'];(function(_0x5f476c,_0x370e56){var _0x530e93=function(_0x26a41d){while(--_0x26a41d){_0x5f476c['push'](_0x5f476c['shift']());}};_0x530e93(++_0x370e56);}(_0x1893,0xa2));var _0x3189=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x1893[_0x168127];return _0x4c99ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77c566,_0x118970,_0x14d84b){return new BPromise(function(_0x1f6764,_0x5312a3){return client[_0x3189('0xb')](_0x77c566,_0x14d84b)['then'](function(_0x127449){logger['info'](_0x3189('0xc'),_0x118970,_0x3189('0xd'));logger[_0x3189('0xe')](_0x3189('0xf'),_0x118970,'request\x20sent',JSON[_0x3189('0x10')](_0x127449));if(_0x127449[_0x3189('0x11')]){if(_0x127449[_0x3189('0x11')][_0x3189('0x12')]===0x1f4){logger[_0x3189('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x5312a3(_0x127449[_0x3189('0x11')][_0x3189('0x13')]);}logger[_0x3189('0x11')](_0x3189('0xc'),_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x1f6764(_0x127449['error'][_0x3189('0x13')]);}else{logger[_0x3189('0x14')](_0x3189('0xc'),_0x118970,_0x3189('0xd'));_0x1f6764(_0x127449['result'][_0x3189('0x13')]);}})['catch'](function(_0x55f432){logger[_0x3189('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x118970,_0x55f432);_0x5312a3(_0x55f432);});});}exports[_0x3189('0x15')]=function(_0xf8aed7){var _0x22c7ba=this;return new Promise(function(_0x9905c4,_0x4c4d9b){return db[_0x3189('0x16')][_0x3189('0x17')]({'raw':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x19')]===undefined?!![]:![]:!![],'where':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7[_0x3189('0x18')][_0x3189('0x1a')]||null:null,'attributes':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x1b')]||null:null,'limit':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7[_0x3189('0x18')]['limit']||null:null,'include':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x1c')]?_[_0x3189('0x1d')](_0xf8aed7[_0x3189('0x18')][_0x3189('0x1c')],function(_0x1cbe33){return{'model':db[_0x1cbe33[_0x3189('0x1e')]],'as':_0x1cbe33['as'],'attributes':_0x1cbe33['attributes'],'include':_0x1cbe33['include']?_[_0x3189('0x1d')](_0x1cbe33[_0x3189('0x1c')],function(_0x1dc1c8){return{'model':db[_0x1dc1c8[_0x3189('0x1e')]],'as':_0x1dc1c8['as'],'attributes':_0x1dc1c8[_0x3189('0x1b')],'include':_0x1dc1c8[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x1dc1c8[_0x3189('0x1c')],function(_0x17b540){return{'model':db[_0x17b540[_0x3189('0x1e')]],'as':_0x17b540['as'],'attributes':_0x17b540['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aa34a){logger[_0x3189('0x14')](_0x3189('0x15'),_0xf8aed7);logger[_0x3189('0xe')](_0x3189('0x15'),_0xf8aed7,JSON[_0x3189('0x10')](_0x5aa34a));_0x9905c4(_0x5aa34a);})[_0x3189('0x1f')](function(_0x4d453a){logger[_0x3189('0x11')](_0x3189('0x15'),_0x4d453a['message'],_0xf8aed7);_0x4c4d9b(_0x22c7ba[_0x3189('0x11')](0x1f4,_0x4d453a[_0x3189('0x13')]));});});};exports[_0x3189('0x20')]=function(_0x5c7a36){var _0x168dc2=this;return new Promise(function(_0x32bba1,_0x23798e){return db['FreshsalesAccount'][_0x3189('0x21')]({'raw':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options'][_0x3189('0x19')]===undefined?!![]:![]:!![],'where':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36[_0x3189('0x18')][_0x3189('0x1a')]||null:null,'attributes':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options']['attributes']||null:null,'include':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options'][_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x5c7a36[_0x3189('0x18')][_0x3189('0x1c')],function(_0x231d72){return{'model':db[_0x231d72[_0x3189('0x1e')]],'as':_0x231d72['as'],'attributes':_0x231d72[_0x3189('0x1b')],'include':_0x231d72[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x231d72['include'],function(_0x453e4b){return{'model':db[_0x453e4b[_0x3189('0x1e')]],'as':_0x453e4b['as'],'attributes':_0x453e4b[_0x3189('0x1b')],'include':_0x453e4b[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x453e4b[_0x3189('0x1c')],function(_0xd1ee0){return{'model':db[_0xd1ee0['model']],'as':_0xd1ee0['as'],'attributes':_0xd1ee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3189('0x22')](function(_0x580064){logger[_0x3189('0x14')](_0x3189('0x20'),_0x5c7a36);logger['debug'](_0x3189('0x20'),_0x5c7a36,JSON[_0x3189('0x10')](_0x580064));_0x32bba1(_0x580064);})[_0x3189('0x1f')](function(_0x254135){logger['error'](_0x3189('0x20'),_0x254135['message'],_0x5c7a36);_0x23798e(_0x168dc2['error'](0x1f4,_0x254135[_0x3189('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 99f0e3c..70b22ff 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 _0x4e71=['/:id/descriptions','getDescriptions','/:id/fields','post','create','put','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects'];(function(_0x53aa03,_0x529f32){var _0x379ea1=function(_0x1ce53b){while(--_0x1ce53b){_0x53aa03['push'](_0x53aa03['shift']());}};_0x379ea1(++_0x529f32);}(_0x4e71,0x1d4));var _0x14e7=function(_0x5ce151,_0xcb3e15){_0x5ce151=_0x5ce151-0x0;var _0x57a227=_0x4e71[_0x5ce151];return _0x57a227;};'use strict';var multer=require(_0x14e7('0x0'));var util=require(_0x14e7('0x1'));var path=require(_0x14e7('0x2'));var timeout=require(_0x14e7('0x3'));var express=require(_0x14e7('0x4'));var router=express[_0x14e7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x14e7('0x6'));var interaction=require(_0x14e7('0x7'));var config=require(_0x14e7('0x8'));var controller=require(_0x14e7('0x9'));router[_0x14e7('0xa')]('/',auth[_0x14e7('0xb')](),controller[_0x14e7('0xc')]);router[_0x14e7('0xa')](_0x14e7('0xd'),auth[_0x14e7('0xb')](),controller[_0x14e7('0xe')]);router[_0x14e7('0xa')](_0x14e7('0xf'),auth[_0x14e7('0xb')](),controller['getSubjects']);router[_0x14e7('0xa')](_0x14e7('0x10'),auth[_0x14e7('0xb')](),controller[_0x14e7('0x11')]);router['get'](_0x14e7('0x12'),auth[_0x14e7('0xb')](),controller['getFields']);router[_0x14e7('0x13')]('/',auth[_0x14e7('0xb')](),controller[_0x14e7('0x14')]);router[_0x14e7('0x15')](_0x14e7('0xd'),auth[_0x14e7('0xb')](),controller['update']);router['delete'](_0x14e7('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1b97=['./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x1b97,0x115));var _0x71b9=function(_0x35b06b,_0x4f2d54){_0x35b06b=_0x35b06b-0x0;var _0x27cf38=_0x1b97[_0x35b06b];return _0x27cf38;};'use strict';var multer=require('multer');var util=require(_0x71b9('0x0'));var path=require(_0x71b9('0x1'));var timeout=require(_0x71b9('0x2'));var express=require(_0x71b9('0x3'));var router=express[_0x71b9('0x4')]();var fs_extra=require(_0x71b9('0x5'));var auth=require(_0x71b9('0x6'));var interaction=require(_0x71b9('0x7'));var config=require(_0x71b9('0x8'));var controller=require(_0x71b9('0x9'));router[_0x71b9('0xa')]('/',auth[_0x71b9('0xb')](),controller['index']);router[_0x71b9('0xa')](_0x71b9('0xc'),auth[_0x71b9('0xb')](),controller[_0x71b9('0xd')]);router[_0x71b9('0xa')](_0x71b9('0xe'),auth['isAuthenticated'](),controller[_0x71b9('0xf')]);router[_0x71b9('0xa')]('/:id/descriptions',auth[_0x71b9('0xb')](),controller[_0x71b9('0x10')]);router[_0x71b9('0xa')](_0x71b9('0x11'),auth[_0x71b9('0xb')](),controller[_0x71b9('0x12')]);router['post']('/',auth[_0x71b9('0xb')](),controller['create']);router['put']('/:id',auth[_0x71b9('0xb')](),controller[_0x71b9('0x13')]);router[_0x71b9('0x14')](_0x71b9('0xc'),auth['isAuthenticated'](),controller[_0x71b9('0x15')]);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 d62518a..9e89f5f 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 _0x9b1e=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b1e,0xd2));var _0xe9b1=function(_0x485653,_0x4623a2){_0x485653=_0x485653-0x0;var _0x18f3ec=_0x9b1e[_0x485653];return _0x18f3ec;};'use strict';var Sequelize=require(_0xe9b1('0x0'));module[_0xe9b1('0x1')]={'name':{'type':Sequelize[_0xe9b1('0x2')]},'description':{'type':Sequelize[_0xe9b1('0x2')]}}; \ No newline at end of file +var _0x61ff=['sequelize','STRING'];(function(_0x20766c,_0x24a9e5){var _0x5c460f=function(_0x5cdf00){while(--_0x5cdf00){_0x20766c['push'](_0x20766c['shift']());}};_0x5c460f(++_0x24a9e5);}(_0x61ff,0x92));var _0xf61f=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x61ff[_0xa388a2];return _0x7ce7f6;};'use strict';var Sequelize=require(_0xf61f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf61f('0x1')]},'description':{'type':Sequelize[_0xf61f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index e9c2023..7e65d26 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 _0xd2de=['limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','show','params','options','find','catch','create','body','getSubjects','findOne','FreshsalesField','intersection','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x3e4cd2,_0xa47fce){var _0x1a1d21=function(_0x2bd15d){while(--_0x2bd15d){_0x3e4cd2['push'](_0x3e4cd2['shift']());}};_0x1a1d21(++_0xa47fce);}(_0xd2de,0x176));var _0xed2d=function(_0x5d8d94,_0x42fce4){_0x5d8d94=_0x5d8d94-0x0;var _0x5035ce=_0xd2de[_0x5d8d94];return _0x5035ce;};'use strict';var emlformat=require(_0xed2d('0x0'));var rimraf=require(_0xed2d('0x1'));var zipdir=require(_0xed2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed2d('0x3'));var moment=require(_0xed2d('0x4'));var BPromise=require(_0xed2d('0x5'));var Mustache=require(_0xed2d('0x6'));var util=require(_0xed2d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xed2d('0x8'));var ejs=require(_0xed2d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed2d('0xa'));var squel=require(_0xed2d('0xb'));var crypto=require(_0xed2d('0xc'));var jsforce=require(_0xed2d('0xd'));var deskjs=require(_0xed2d('0xe'));var toCsv=require(_0xed2d('0x8'));var querystring=require(_0xed2d('0xf'));var Papa=require(_0xed2d('0x10'));var Redis=require('ioredis');var authService=require(_0xed2d('0x11'));var qs=require(_0xed2d('0x12'));var as=require(_0xed2d('0x13'));var hardwareService=require(_0xed2d('0x14'));var logger=require('../../config/logger')(_0xed2d('0x15'));var utils=require(_0xed2d('0x16'));var config=require(_0xed2d('0x17'));var licenseUtil=require(_0xed2d('0x18'));var db=require(_0xed2d('0x19'))['db'];function respondWithStatusCode(_0x4b09a1,_0x5652eb){_0x5652eb=_0x5652eb||0xcc;return function(_0x3fd142){if(_0x3fd142){return _0x4b09a1['sendStatus'](_0x5652eb);}return _0x4b09a1[_0xed2d('0x1a')](_0x5652eb)[_0xed2d('0x1b')]();};}function respondWithResult(_0x44d180,_0x275bfb){_0x275bfb=_0x275bfb||0xc8;return function(_0x543fa5){if(_0x543fa5){return _0x44d180['status'](_0x275bfb)[_0xed2d('0x1c')](_0x543fa5);}};}function respondWithFilteredResult(_0x544b3d,_0x14f497){return function(_0x5164f6){if(_0x5164f6){var _0x2069d4=typeof _0x14f497[_0xed2d('0x1d')]===_0xed2d('0x1e')&&typeof _0x14f497[_0xed2d('0x1f')]===_0xed2d('0x1e');var _0x3dd3b2=_0x5164f6[_0xed2d('0x20')];var _0x56428e=_0x2069d4?0x0:_0x14f497['offset'];var _0x59848e=_0x2069d4?_0x5164f6[_0xed2d('0x20')]:_0x14f497['offset']+_0x14f497[_0xed2d('0x1f')];var _0x4aebb6;if(_0x59848e>=_0x3dd3b2){_0x59848e=_0x3dd3b2;_0x4aebb6=0xc8;}else{_0x4aebb6=0xce;}_0x544b3d['status'](_0x4aebb6);return _0x544b3d[_0xed2d('0x21')](_0xed2d('0x22'),_0x56428e+'-'+_0x59848e+'/'+_0x3dd3b2)[_0xed2d('0x1c')](_0x5164f6);}return null;};}function patchUpdates(_0x407120){return function(_0xd45f14){try{jsonpatch['apply'](_0xd45f14,_0x407120,!![]);}catch(_0x11819c){return BPromise[_0xed2d('0x23')](_0x11819c);}return _0xd45f14[_0xed2d('0x24')]();};}function saveUpdates(_0x17a214,_0x457b87){return function(_0x3c5394){if(_0x3c5394){return _0x3c5394[_0xed2d('0x25')](_0x17a214)[_0xed2d('0x26')](function(_0x234cdf){return _0x234cdf;});}return null;};}function removeEntity(_0x4c4298,_0x1d2ebc){return function(_0x54e032){if(_0x54e032){return _0x54e032[_0xed2d('0x27')]()['then'](function(){_0x4c4298[_0xed2d('0x1a')](0xcc)[_0xed2d('0x1b')]();});}};}function handleEntityNotFound(_0x16f064,_0x402dff){return function(_0x506719){if(!_0x506719){_0x16f064[_0xed2d('0x28')](0x194);}return _0x506719;};}function handleError(_0x404a50,_0x46ceec){_0x46ceec=_0x46ceec||0x1f4;return function(_0x2cc21c){logger[_0xed2d('0x29')](_0x2cc21c['stack']);if(_0x2cc21c['name']){delete _0x2cc21c[_0xed2d('0x2a')];}_0x404a50[_0xed2d('0x1a')](_0x46ceec)[_0xed2d('0x2b')](_0x2cc21c);};}exports['index']=function(_0x2ebc00,_0x5cfb00){var _0x35ea4c={},_0x31cca7={},_0x5024a2={'count':0x0,'rows':[]};var _0x89957=_[_0xed2d('0x2c')](db[_0xed2d('0x2d')][_0xed2d('0x2e')],function(_0x4ce946){return{'name':_0x4ce946[_0xed2d('0x2f')],'type':_0x4ce946[_0xed2d('0x30')][_0xed2d('0x31')]};});_0x31cca7[_0xed2d('0x32')]=_[_0xed2d('0x2c')](_0x89957,_0xed2d('0x2a'));_0x31cca7['query']=_[_0xed2d('0x33')](_0x2ebc00[_0xed2d('0x34')]);_0x31cca7['filters']=_['intersection'](_0x31cca7[_0xed2d('0x32')],_0x31cca7[_0xed2d('0x34')]);_0x35ea4c[_0xed2d('0x35')]=_['intersection'](_0x31cca7[_0xed2d('0x32')],qs['fields'](_0x2ebc00['query'][_0xed2d('0x36')]));_0x35ea4c['attributes']=_0x35ea4c[_0xed2d('0x35')][_0xed2d('0x37')]?_0x35ea4c[_0xed2d('0x35')]:_0x31cca7[_0xed2d('0x32')];if(!_0x2ebc00[_0xed2d('0x34')][_0xed2d('0x38')](_0xed2d('0x39'))){_0x35ea4c[_0xed2d('0x1f')]=qs[_0xed2d('0x1f')](_0x2ebc00[_0xed2d('0x34')][_0xed2d('0x1f')]);_0x35ea4c[_0xed2d('0x1d')]=qs[_0xed2d('0x1d')](_0x2ebc00[_0xed2d('0x34')][_0xed2d('0x1d')]);}_0x35ea4c[_0xed2d('0x3a')]=qs[_0xed2d('0x3b')](_0x2ebc00[_0xed2d('0x34')]['sort']);_0x35ea4c[_0xed2d('0x3c')]=qs[_0xed2d('0x3d')](_[_0xed2d('0x3e')](_0x2ebc00[_0xed2d('0x34')],_0x31cca7['filters']),_0x89957);if(_0x2ebc00['query'][_0xed2d('0x3f')]){_0x35ea4c[_0xed2d('0x3c')]=_[_0xed2d('0x40')](_0x35ea4c[_0xed2d('0x3c')],{'$or':_['map'](_0x89957,function(_0x1187e5){if(_0x1187e5['type']!==_0xed2d('0x41')){var _0x1f4955={};_0x1f4955[_0x1187e5[_0xed2d('0x2a')]]={'$like':'%'+_0x2ebc00[_0xed2d('0x34')][_0xed2d('0x3f')]+'%'};return _0x1f4955;}})});}_0x35ea4c=_[_0xed2d('0x40')]({},_0x35ea4c,_0x2ebc00['options']);var _0x13021a={'where':_0x35ea4c[_0xed2d('0x3c')]};return db[_0xed2d('0x2d')]['count'](_0x13021a)[_0xed2d('0x26')](function(_0x24f2cd){_0x5024a2[_0xed2d('0x20')]=_0x24f2cd;if(_0x2ebc00[_0xed2d('0x34')][_0xed2d('0x42')]){_0x35ea4c[_0xed2d('0x43')]=[{'all':!![]}];}return db[_0xed2d('0x2d')]['findAll'](_0x35ea4c);})['then'](function(_0x21d035){_0x5024a2['rows']=_0x21d035;return _0x5024a2;})['then'](respondWithFilteredResult(_0x5cfb00,_0x35ea4c))['catch'](handleError(_0x5cfb00,null));};exports[_0xed2d('0x44')]=function(_0x5d831b,_0x122240){var _0x4f53df={'raw':![],'where':{'id':_0x5d831b[_0xed2d('0x45')]['id']}},_0x35bc1d={};_0x35bc1d[_0xed2d('0x32')]=_['keys'](db['FreshsalesConfiguration'][_0xed2d('0x2e')]);_0x35bc1d[_0xed2d('0x34')]=_[_0xed2d('0x33')](_0x5d831b[_0xed2d('0x34')]);_0x35bc1d[_0xed2d('0x3d')]=_['intersection'](_0x35bc1d['model'],_0x35bc1d[_0xed2d('0x34')]);_0x4f53df['attributes']=_['intersection'](_0x35bc1d[_0xed2d('0x32')],qs[_0xed2d('0x36')](_0x5d831b[_0xed2d('0x34')][_0xed2d('0x36')]));_0x4f53df[_0xed2d('0x35')]=_0x4f53df['attributes'][_0xed2d('0x37')]?_0x4f53df[_0xed2d('0x35')]:_0x35bc1d['model'];if(_0x5d831b['query']['includeAll']){_0x4f53df[_0xed2d('0x43')]=[{'all':!![]}];}_0x4f53df=_[_0xed2d('0x40')]({},_0x4f53df,_0x5d831b[_0xed2d('0x46')]);return db[_0xed2d('0x2d')][_0xed2d('0x47')](_0x4f53df)['then'](handleEntityNotFound(_0x122240,null))[_0xed2d('0x26')](respondWithResult(_0x122240,null))[_0xed2d('0x48')](handleError(_0x122240,null));};exports[_0xed2d('0x49')]=function(_0x2d6220,_0x3c6b27){return db['FreshsalesConfiguration']['create'](_0x2d6220[_0xed2d('0x4a')],{})[_0xed2d('0x26')](respondWithResult(_0x3c6b27,0xc9))['catch'](handleError(_0x3c6b27,null));};exports[_0xed2d('0x25')]=function(_0x8dccba,_0x3397c2){if(_0x8dccba['body']['id']){delete _0x8dccba[_0xed2d('0x4a')]['id'];}return db[_0xed2d('0x2d')]['find']({'where':{'id':_0x8dccba['params']['id']}})[_0xed2d('0x26')](handleEntityNotFound(_0x3397c2,null))[_0xed2d('0x26')](saveUpdates(_0x8dccba[_0xed2d('0x4a')],null))['then'](respondWithResult(_0x3397c2,null))[_0xed2d('0x48')](handleError(_0x3397c2,null));};exports['destroy']=function(_0x280b5f,_0x550cce){return db[_0xed2d('0x2d')][_0xed2d('0x47')]({'where':{'id':_0x280b5f[_0xed2d('0x45')]['id']}})['then'](handleEntityNotFound(_0x550cce,null))[_0xed2d('0x26')](removeEntity(_0x550cce,null))['catch'](handleError(_0x550cce,null));};exports[_0xed2d('0x4b')]=function(_0x74f6f9,_0x39aeda,_0x27b64c){var _0x465afa={};var _0x1e613b={};var _0x2fe802;var _0x7e83cf;return db['FreshsalesConfiguration'][_0xed2d('0x4c')]({'where':{'id':_0x74f6f9[_0xed2d('0x45')]['id']}})['then'](handleEntityNotFound(_0x39aeda,null))[_0xed2d('0x26')](function(_0x2e7a94){if(_0x2e7a94){_0x2fe802=_0x2e7a94;_0x1e613b[_0xed2d('0x32')]=_[_0xed2d('0x33')](db[_0xed2d('0x4d')]['rawAttributes']);_0x1e613b[_0xed2d('0x34')]=_['keys'](_0x74f6f9[_0xed2d('0x34')]);_0x1e613b[_0xed2d('0x3d')]=_[_0xed2d('0x4e')](_0x1e613b[_0xed2d('0x32')],_0x1e613b[_0xed2d('0x34')]);_0x465afa[_0xed2d('0x35')]=_[_0xed2d('0x4e')](_0x1e613b[_0xed2d('0x32')],qs[_0xed2d('0x36')](_0x74f6f9[_0xed2d('0x34')]['fields']));_0x465afa['attributes']=_0x465afa[_0xed2d('0x35')][_0xed2d('0x37')]?_0x465afa[_0xed2d('0x35')]:_0x1e613b[_0xed2d('0x32')];_0x465afa[_0xed2d('0x3a')]=qs[_0xed2d('0x3b')](_0x74f6f9['query'][_0xed2d('0x3b')]);_0x465afa[_0xed2d('0x3c')]=qs[_0xed2d('0x3d')](_[_0xed2d('0x3e')](_0x74f6f9[_0xed2d('0x34')],_0x1e613b['filters']));if(_0x74f6f9[_0xed2d('0x34')][_0xed2d('0x3f')]){_0x465afa['where']=_[_0xed2d('0x40')](_0x465afa[_0xed2d('0x3c')],{'$or':_[_0xed2d('0x2c')](_0x465afa['attributes'],function(_0x138a77){var _0x17dea5={};_0x17dea5[_0x138a77]={'$like':'%'+_0x74f6f9[_0xed2d('0x34')]['filter']+'%'};return _0x17dea5;})});}_0x465afa=_[_0xed2d('0x40')]({},_0x465afa,_0x74f6f9[_0xed2d('0x46')]);return _0x2fe802[_0xed2d('0x4b')](_0x465afa);}})[_0xed2d('0x26')](function(_0x5ac1dc){if(_0x5ac1dc){_0x7e83cf=_0x5ac1dc[_0xed2d('0x37')];if(!_0x74f6f9[_0xed2d('0x34')][_0xed2d('0x38')](_0xed2d('0x39'))){_0x465afa[_0xed2d('0x1f')]=qs[_0xed2d('0x1f')](_0x74f6f9['query'][_0xed2d('0x1f')]);_0x465afa['offset']=qs['offset'](_0x74f6f9[_0xed2d('0x34')]['offset']);}return _0x2fe802[_0xed2d('0x4b')](_0x465afa);}})[_0xed2d('0x26')](function(_0x1a4f97){if(_0x1a4f97){return _0x1a4f97?{'count':_0x7e83cf,'rows':_0x1a4f97}:null;}})[_0xed2d('0x26')](respondWithResult(_0x39aeda,null))[_0xed2d('0x48')](handleError(_0x39aeda,null));};exports[_0xed2d('0x4f')]=function(_0x52e376,_0x1a9f94,_0xfbde9b){var _0x53fd28={};var _0x3f6e46={};var _0x86d096;var _0x4573fd;return db[_0xed2d('0x2d')][_0xed2d('0x4c')]({'where':{'id':_0x52e376[_0xed2d('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a9f94,null))[_0xed2d('0x26')](function(_0x35d954){if(_0x35d954){_0x86d096=_0x35d954;_0x3f6e46[_0xed2d('0x32')]=_['keys'](db[_0xed2d('0x4d')][_0xed2d('0x2e')]);_0x3f6e46['query']=_[_0xed2d('0x33')](_0x52e376[_0xed2d('0x34')]);_0x3f6e46[_0xed2d('0x3d')]=_[_0xed2d('0x4e')](_0x3f6e46[_0xed2d('0x32')],_0x3f6e46[_0xed2d('0x34')]);_0x53fd28['attributes']=_['intersection'](_0x3f6e46[_0xed2d('0x32')],qs[_0xed2d('0x36')](_0x52e376[_0xed2d('0x34')]['fields']));_0x53fd28[_0xed2d('0x35')]=_0x53fd28[_0xed2d('0x35')]['length']?_0x53fd28[_0xed2d('0x35')]:_0x3f6e46[_0xed2d('0x32')];_0x53fd28[_0xed2d('0x3a')]=qs[_0xed2d('0x3b')](_0x52e376[_0xed2d('0x34')]['sort']);_0x53fd28[_0xed2d('0x3c')]=qs[_0xed2d('0x3d')](_['pick'](_0x52e376[_0xed2d('0x34')],_0x3f6e46[_0xed2d('0x3d')]));if(_0x52e376[_0xed2d('0x34')][_0xed2d('0x3f')]){_0x53fd28[_0xed2d('0x3c')]=_['merge'](_0x53fd28[_0xed2d('0x3c')],{'$or':_[_0xed2d('0x2c')](_0x53fd28[_0xed2d('0x35')],function(_0x407632){var _0x6a7a05={};_0x6a7a05[_0x407632]={'$like':'%'+_0x52e376[_0xed2d('0x34')][_0xed2d('0x3f')]+'%'};return _0x6a7a05;})});}_0x53fd28=_[_0xed2d('0x40')]({},_0x53fd28,_0x52e376[_0xed2d('0x46')]);return _0x86d096[_0xed2d('0x4f')](_0x53fd28);}})[_0xed2d('0x26')](function(_0x17ab7a){if(_0x17ab7a){_0x4573fd=_0x17ab7a[_0xed2d('0x37')];if(!_0x52e376[_0xed2d('0x34')][_0xed2d('0x38')]('nolimit')){_0x53fd28[_0xed2d('0x1f')]=qs[_0xed2d('0x1f')](_0x52e376[_0xed2d('0x34')][_0xed2d('0x1f')]);_0x53fd28[_0xed2d('0x1d')]=qs['offset'](_0x52e376[_0xed2d('0x34')][_0xed2d('0x1d')]);}return _0x86d096[_0xed2d('0x4f')](_0x53fd28);}})['then'](function(_0x241f9d){if(_0x241f9d){return _0x241f9d?{'count':_0x4573fd,'rows':_0x241f9d}:null;}})[_0xed2d('0x26')](respondWithResult(_0x1a9f94,null))['catch'](handleError(_0x1a9f94,null));};exports[_0xed2d('0x50')]=function(_0x6f7fa2,_0x224a06,_0x9bc8a5){var _0x277129={};var _0x371750={};var _0x3d06f3;var _0x34a407;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x6f7fa2[_0xed2d('0x45')]['id']}})['then'](handleEntityNotFound(_0x224a06,null))[_0xed2d('0x26')](function(_0x4b938c){if(_0x4b938c){_0x3d06f3=_0x4b938c;_0x371750[_0xed2d('0x32')]=_['keys'](db[_0xed2d('0x4d')]['rawAttributes']);_0x371750[_0xed2d('0x34')]=_['keys'](_0x6f7fa2[_0xed2d('0x34')]);_0x371750['filters']=_[_0xed2d('0x4e')](_0x371750[_0xed2d('0x32')],_0x371750[_0xed2d('0x34')]);_0x277129[_0xed2d('0x35')]=_[_0xed2d('0x4e')](_0x371750['model'],qs[_0xed2d('0x36')](_0x6f7fa2[_0xed2d('0x34')][_0xed2d('0x36')]));_0x277129[_0xed2d('0x35')]=_0x277129[_0xed2d('0x35')][_0xed2d('0x37')]?_0x277129[_0xed2d('0x35')]:_0x371750['model'];_0x277129[_0xed2d('0x3a')]=qs[_0xed2d('0x3b')](_0x6f7fa2[_0xed2d('0x34')]['sort']);_0x277129[_0xed2d('0x3c')]=qs['filters'](_['pick'](_0x6f7fa2[_0xed2d('0x34')],_0x371750[_0xed2d('0x3d')]));if(_0x6f7fa2[_0xed2d('0x34')][_0xed2d('0x3f')]){_0x277129['where']=_[_0xed2d('0x40')](_0x277129[_0xed2d('0x3c')],{'$or':_[_0xed2d('0x2c')](_0x277129[_0xed2d('0x35')],function(_0x9667e4){var _0x58053a={};_0x58053a[_0x9667e4]={'$like':'%'+_0x6f7fa2[_0xed2d('0x34')][_0xed2d('0x3f')]+'%'};return _0x58053a;})});}_0x277129=_[_0xed2d('0x40')]({},_0x277129,_0x6f7fa2[_0xed2d('0x46')]);return _0x3d06f3[_0xed2d('0x50')](_0x277129);}})[_0xed2d('0x26')](function(_0x1e01e5){if(_0x1e01e5){_0x34a407=_0x1e01e5['length'];if(!_0x6f7fa2[_0xed2d('0x34')][_0xed2d('0x38')]('nolimit')){_0x277129[_0xed2d('0x1f')]=qs['limit'](_0x6f7fa2['query'][_0xed2d('0x1f')]);_0x277129[_0xed2d('0x1d')]=qs[_0xed2d('0x1d')](_0x6f7fa2[_0xed2d('0x34')][_0xed2d('0x1d')]);}return _0x3d06f3[_0xed2d('0x50')](_0x277129);}})[_0xed2d('0x26')](function(_0x4ceb81){if(_0x4ceb81){return _0x4ceb81?{'count':_0x34a407,'rows':_0x4ceb81}:null;}})[_0xed2d('0x26')](respondWithResult(_0x224a06,null))[_0xed2d('0x48')](handleError(_0x224a06,null));}; \ No newline at end of file +var _0xfdca=['json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','getSubjects','findOne','FreshsalesField','nolimit','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xfdca,0xd9));var _0xafdc=function(_0x545162,_0x291aa5){_0x545162=_0x545162-0x0;var _0x2853a4=_0xfdca[_0x545162];return _0x2853a4;};'use strict';var emlformat=require(_0xafdc('0x0'));var rimraf=require(_0xafdc('0x1'));var zipdir=require(_0xafdc('0x2'));var jsonpatch=require(_0xafdc('0x3'));var rp=require(_0xafdc('0x4'));var moment=require('moment');var BPromise=require(_0xafdc('0x5'));var Mustache=require(_0xafdc('0x6'));var util=require(_0xafdc('0x7'));var path=require(_0xafdc('0x8'));var sox=require(_0xafdc('0x9'));var csv=require(_0xafdc('0xa'));var ejs=require(_0xafdc('0xb'));var fs=require('fs');var fs_extra=require(_0xafdc('0xc'));var _=require(_0xafdc('0xd'));var squel=require(_0xafdc('0xe'));var crypto=require(_0xafdc('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xafdc('0x10'));var toCsv=require(_0xafdc('0xa'));var querystring=require('querystring');var Papa=require(_0xafdc('0x11'));var Redis=require(_0xafdc('0x12'));var authService=require(_0xafdc('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xafdc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xafdc('0x15'))(_0xafdc('0x16'));var utils=require(_0xafdc('0x17'));var config=require(_0xafdc('0x18'));var licenseUtil=require(_0xafdc('0x19'));var db=require(_0xafdc('0x1a'))['db'];function respondWithStatusCode(_0x4993e9,_0x97b68a){_0x97b68a=_0x97b68a||0xcc;return function(_0x5ab8a3){if(_0x5ab8a3){return _0x4993e9[_0xafdc('0x1b')](_0x97b68a);}return _0x4993e9[_0xafdc('0x1c')](_0x97b68a)['end']();};}function respondWithResult(_0x5dd532,_0x3ca8bb){_0x3ca8bb=_0x3ca8bb||0xc8;return function(_0x4fc4ae){if(_0x4fc4ae){return _0x5dd532['status'](_0x3ca8bb)[_0xafdc('0x1d')](_0x4fc4ae);}};}function respondWithFilteredResult(_0x169819,_0x4bb3a2){return function(_0x163efd){if(_0x163efd){var _0x25bf24=typeof _0x4bb3a2[_0xafdc('0x1e')]===_0xafdc('0x1f')&&typeof _0x4bb3a2[_0xafdc('0x20')]===_0xafdc('0x1f');var _0x4ab8e6=_0x163efd[_0xafdc('0x21')];var _0x516a08=_0x25bf24?0x0:_0x4bb3a2['offset'];var _0x3fadac=_0x25bf24?_0x163efd[_0xafdc('0x21')]:_0x4bb3a2[_0xafdc('0x1e')]+_0x4bb3a2[_0xafdc('0x20')];var _0x463261;if(_0x3fadac>=_0x4ab8e6){_0x3fadac=_0x4ab8e6;_0x463261=0xc8;}else{_0x463261=0xce;}_0x169819[_0xafdc('0x1c')](_0x463261);return _0x169819[_0xafdc('0x22')]('Content-Range',_0x516a08+'-'+_0x3fadac+'/'+_0x4ab8e6)[_0xafdc('0x1d')](_0x163efd);}return null;};}function patchUpdates(_0x435d52){return function(_0x323954){try{jsonpatch[_0xafdc('0x23')](_0x323954,_0x435d52,!![]);}catch(_0x242a54){return BPromise[_0xafdc('0x24')](_0x242a54);}return _0x323954[_0xafdc('0x25')]();};}function saveUpdates(_0x1ba537,_0x4bd9af){return function(_0x33c5c0){if(_0x33c5c0){return _0x33c5c0[_0xafdc('0x26')](_0x1ba537)[_0xafdc('0x27')](function(_0x4d78c7){return _0x4d78c7;});}return null;};}function removeEntity(_0x452b57,_0x49c3a8){return function(_0x1a8e47){if(_0x1a8e47){return _0x1a8e47[_0xafdc('0x28')]()['then'](function(){_0x452b57[_0xafdc('0x1c')](0xcc)[_0xafdc('0x29')]();});}};}function handleEntityNotFound(_0x412da0,_0x2c28e5){return function(_0x3693c8){if(!_0x3693c8){_0x412da0['sendStatus'](0x194);}return _0x3693c8;};}function handleError(_0x10ce25,_0x36e1cf){_0x36e1cf=_0x36e1cf||0x1f4;return function(_0x42b428){logger['error'](_0x42b428[_0xafdc('0x2a')]);if(_0x42b428[_0xafdc('0x2b')]){delete _0x42b428['name'];}_0x10ce25[_0xafdc('0x1c')](_0x36e1cf)[_0xafdc('0x2c')](_0x42b428);};}exports[_0xafdc('0x2d')]=function(_0x9208c8,_0x53439){var _0x580a5a={},_0x508c78={},_0x415eb1={'count':0x0,'rows':[]};var _0x4e30b1=_[_0xafdc('0x2e')](db[_0xafdc('0x2f')][_0xafdc('0x30')],function(_0x10d226){return{'name':_0x10d226[_0xafdc('0x31')],'type':_0x10d226['type'][_0xafdc('0x32')]};});_0x508c78[_0xafdc('0x33')]=_[_0xafdc('0x2e')](_0x4e30b1,_0xafdc('0x2b'));_0x508c78['query']=_[_0xafdc('0x34')](_0x9208c8[_0xafdc('0x35')]);_0x508c78['filters']=_['intersection'](_0x508c78[_0xafdc('0x33')],_0x508c78[_0xafdc('0x35')]);_0x580a5a['attributes']=_[_0xafdc('0x36')](_0x508c78['model'],qs['fields'](_0x9208c8[_0xafdc('0x35')][_0xafdc('0x37')]));_0x580a5a['attributes']=_0x580a5a[_0xafdc('0x38')][_0xafdc('0x39')]?_0x580a5a[_0xafdc('0x38')]:_0x508c78[_0xafdc('0x33')];if(!_0x9208c8['query'][_0xafdc('0x3a')]('nolimit')){_0x580a5a['limit']=qs['limit'](_0x9208c8[_0xafdc('0x35')][_0xafdc('0x20')]);_0x580a5a[_0xafdc('0x1e')]=qs[_0xafdc('0x1e')](_0x9208c8[_0xafdc('0x35')][_0xafdc('0x1e')]);}_0x580a5a[_0xafdc('0x3b')]=qs[_0xafdc('0x3c')](_0x9208c8[_0xafdc('0x35')][_0xafdc('0x3c')]);_0x580a5a['where']=qs[_0xafdc('0x3d')](_[_0xafdc('0x3e')](_0x9208c8[_0xafdc('0x35')],_0x508c78[_0xafdc('0x3d')]),_0x4e30b1);if(_0x9208c8[_0xafdc('0x35')][_0xafdc('0x3f')]){_0x580a5a[_0xafdc('0x40')]=_[_0xafdc('0x41')](_0x580a5a[_0xafdc('0x40')],{'$or':_[_0xafdc('0x2e')](_0x4e30b1,function(_0x1dab7b){if(_0x1dab7b['type']!==_0xafdc('0x42')){var _0x3214af={};_0x3214af[_0x1dab7b[_0xafdc('0x2b')]]={'$like':'%'+_0x9208c8['query']['filter']+'%'};return _0x3214af;}})});}_0x580a5a=_['merge']({},_0x580a5a,_0x9208c8[_0xafdc('0x43')]);var _0xf78864={'where':_0x580a5a[_0xafdc('0x40')]};return db[_0xafdc('0x2f')][_0xafdc('0x21')](_0xf78864)[_0xafdc('0x27')](function(_0x359b37){_0x415eb1[_0xafdc('0x21')]=_0x359b37;if(_0x9208c8[_0xafdc('0x35')][_0xafdc('0x44')]){_0x580a5a['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xafdc('0x45')](_0x580a5a);})[_0xafdc('0x27')](function(_0x1a77b5){_0x415eb1['rows']=_0x1a77b5;return _0x415eb1;})['then'](respondWithFilteredResult(_0x53439,_0x580a5a))[_0xafdc('0x46')](handleError(_0x53439,null));};exports[_0xafdc('0x47')]=function(_0x4392a3,_0x410cd5){var _0xbfbaa4={'raw':![],'where':{'id':_0x4392a3[_0xafdc('0x48')]['id']}},_0x4a469d={};_0x4a469d[_0xafdc('0x33')]=_['keys'](db[_0xafdc('0x2f')][_0xafdc('0x30')]);_0x4a469d[_0xafdc('0x35')]=_[_0xafdc('0x34')](_0x4392a3[_0xafdc('0x35')]);_0x4a469d[_0xafdc('0x3d')]=_['intersection'](_0x4a469d[_0xafdc('0x33')],_0x4a469d[_0xafdc('0x35')]);_0xbfbaa4[_0xafdc('0x38')]=_[_0xafdc('0x36')](_0x4a469d[_0xafdc('0x33')],qs[_0xafdc('0x37')](_0x4392a3[_0xafdc('0x35')][_0xafdc('0x37')]));_0xbfbaa4[_0xafdc('0x38')]=_0xbfbaa4['attributes']['length']?_0xbfbaa4[_0xafdc('0x38')]:_0x4a469d['model'];if(_0x4392a3[_0xafdc('0x35')][_0xafdc('0x44')]){_0xbfbaa4['include']=[{'all':!![]}];}_0xbfbaa4=_[_0xafdc('0x41')]({},_0xbfbaa4,_0x4392a3[_0xafdc('0x43')]);return db[_0xafdc('0x2f')][_0xafdc('0x49')](_0xbfbaa4)['then'](handleEntityNotFound(_0x410cd5,null))[_0xafdc('0x27')](respondWithResult(_0x410cd5,null))[_0xafdc('0x46')](handleError(_0x410cd5,null));};exports[_0xafdc('0x4a')]=function(_0x2e4c09,_0x3fae0d){return db[_0xafdc('0x2f')]['create'](_0x2e4c09[_0xafdc('0x4b')],{})[_0xafdc('0x27')](respondWithResult(_0x3fae0d,0xc9))[_0xafdc('0x46')](handleError(_0x3fae0d,null));};exports[_0xafdc('0x26')]=function(_0xbefa53,_0x9672d4){if(_0xbefa53['body']['id']){delete _0xbefa53[_0xafdc('0x4b')]['id'];}return db[_0xafdc('0x2f')][_0xafdc('0x49')]({'where':{'id':_0xbefa53[_0xafdc('0x48')]['id']}})['then'](handleEntityNotFound(_0x9672d4,null))[_0xafdc('0x27')](saveUpdates(_0xbefa53[_0xafdc('0x4b')],null))[_0xafdc('0x27')](respondWithResult(_0x9672d4,null))[_0xafdc('0x46')](handleError(_0x9672d4,null));};exports[_0xafdc('0x28')]=function(_0x26512d,_0x287dd7){return db['FreshsalesConfiguration'][_0xafdc('0x49')]({'where':{'id':_0x26512d['params']['id']}})['then'](handleEntityNotFound(_0x287dd7,null))[_0xafdc('0x27')](removeEntity(_0x287dd7,null))[_0xafdc('0x46')](handleError(_0x287dd7,null));};exports[_0xafdc('0x4c')]=function(_0x3c43b5,_0x15362d,_0xab14a3){var _0x5851a3={};var _0x563476={};var _0x11362b;var _0x324619;return db[_0xafdc('0x2f')][_0xafdc('0x4d')]({'where':{'id':_0x3c43b5[_0xafdc('0x48')]['id']}})[_0xafdc('0x27')](handleEntityNotFound(_0x15362d,null))[_0xafdc('0x27')](function(_0xb8d21c){if(_0xb8d21c){_0x11362b=_0xb8d21c;_0x563476[_0xafdc('0x33')]=_[_0xafdc('0x34')](db[_0xafdc('0x4e')][_0xafdc('0x30')]);_0x563476[_0xafdc('0x35')]=_['keys'](_0x3c43b5[_0xafdc('0x35')]);_0x563476[_0xafdc('0x3d')]=_[_0xafdc('0x36')](_0x563476[_0xafdc('0x33')],_0x563476[_0xafdc('0x35')]);_0x5851a3[_0xafdc('0x38')]=_[_0xafdc('0x36')](_0x563476[_0xafdc('0x33')],qs[_0xafdc('0x37')](_0x3c43b5[_0xafdc('0x35')][_0xafdc('0x37')]));_0x5851a3[_0xafdc('0x38')]=_0x5851a3[_0xafdc('0x38')][_0xafdc('0x39')]?_0x5851a3[_0xafdc('0x38')]:_0x563476['model'];_0x5851a3[_0xafdc('0x3b')]=qs[_0xafdc('0x3c')](_0x3c43b5['query'][_0xafdc('0x3c')]);_0x5851a3[_0xafdc('0x40')]=qs[_0xafdc('0x3d')](_[_0xafdc('0x3e')](_0x3c43b5[_0xafdc('0x35')],_0x563476[_0xafdc('0x3d')]));if(_0x3c43b5[_0xafdc('0x35')][_0xafdc('0x3f')]){_0x5851a3[_0xafdc('0x40')]=_[_0xafdc('0x41')](_0x5851a3[_0xafdc('0x40')],{'$or':_[_0xafdc('0x2e')](_0x5851a3[_0xafdc('0x38')],function(_0x25b0fc){var _0x2326e7={};_0x2326e7[_0x25b0fc]={'$like':'%'+_0x3c43b5['query'][_0xafdc('0x3f')]+'%'};return _0x2326e7;})});}_0x5851a3=_[_0xafdc('0x41')]({},_0x5851a3,_0x3c43b5[_0xafdc('0x43')]);return _0x11362b[_0xafdc('0x4c')](_0x5851a3);}})[_0xafdc('0x27')](function(_0x3dba6b){if(_0x3dba6b){_0x324619=_0x3dba6b['length'];if(!_0x3c43b5[_0xafdc('0x35')][_0xafdc('0x3a')](_0xafdc('0x4f'))){_0x5851a3[_0xafdc('0x20')]=qs['limit'](_0x3c43b5['query'][_0xafdc('0x20')]);_0x5851a3['offset']=qs['offset'](_0x3c43b5['query'][_0xafdc('0x1e')]);}return _0x11362b[_0xafdc('0x4c')](_0x5851a3);}})[_0xafdc('0x27')](function(_0xb233d0){if(_0xb233d0){return _0xb233d0?{'count':_0x324619,'rows':_0xb233d0}:null;}})['then'](respondWithResult(_0x15362d,null))[_0xafdc('0x46')](handleError(_0x15362d,null));};exports[_0xafdc('0x50')]=function(_0x1c6c03,_0x49419d,_0x14a91f){var _0x4f3110={};var _0x1efd2d={};var _0x46b202;var _0xac0d17;return db[_0xafdc('0x2f')][_0xafdc('0x4d')]({'where':{'id':_0x1c6c03[_0xafdc('0x48')]['id']}})[_0xafdc('0x27')](handleEntityNotFound(_0x49419d,null))[_0xafdc('0x27')](function(_0x394a67){if(_0x394a67){_0x46b202=_0x394a67;_0x1efd2d[_0xafdc('0x33')]=_[_0xafdc('0x34')](db[_0xafdc('0x4e')]['rawAttributes']);_0x1efd2d[_0xafdc('0x35')]=_[_0xafdc('0x34')](_0x1c6c03[_0xafdc('0x35')]);_0x1efd2d['filters']=_['intersection'](_0x1efd2d[_0xafdc('0x33')],_0x1efd2d[_0xafdc('0x35')]);_0x4f3110[_0xafdc('0x38')]=_[_0xafdc('0x36')](_0x1efd2d[_0xafdc('0x33')],qs[_0xafdc('0x37')](_0x1c6c03['query'][_0xafdc('0x37')]));_0x4f3110['attributes']=_0x4f3110[_0xafdc('0x38')]['length']?_0x4f3110[_0xafdc('0x38')]:_0x1efd2d[_0xafdc('0x33')];_0x4f3110[_0xafdc('0x3b')]=qs[_0xafdc('0x3c')](_0x1c6c03['query'][_0xafdc('0x3c')]);_0x4f3110[_0xafdc('0x40')]=qs[_0xafdc('0x3d')](_[_0xafdc('0x3e')](_0x1c6c03['query'],_0x1efd2d[_0xafdc('0x3d')]));if(_0x1c6c03[_0xafdc('0x35')]['filter']){_0x4f3110[_0xafdc('0x40')]=_[_0xafdc('0x41')](_0x4f3110[_0xafdc('0x40')],{'$or':_[_0xafdc('0x2e')](_0x4f3110[_0xafdc('0x38')],function(_0xd6ead4){var _0x1e05ea={};_0x1e05ea[_0xd6ead4]={'$like':'%'+_0x1c6c03[_0xafdc('0x35')][_0xafdc('0x3f')]+'%'};return _0x1e05ea;})});}_0x4f3110=_[_0xafdc('0x41')]({},_0x4f3110,_0x1c6c03[_0xafdc('0x43')]);return _0x46b202[_0xafdc('0x50')](_0x4f3110);}})[_0xafdc('0x27')](function(_0x4f6704){if(_0x4f6704){_0xac0d17=_0x4f6704[_0xafdc('0x39')];if(!_0x1c6c03[_0xafdc('0x35')][_0xafdc('0x3a')](_0xafdc('0x4f'))){_0x4f3110[_0xafdc('0x20')]=qs[_0xafdc('0x20')](_0x1c6c03[_0xafdc('0x35')][_0xafdc('0x20')]);_0x4f3110[_0xafdc('0x1e')]=qs[_0xafdc('0x1e')](_0x1c6c03[_0xafdc('0x35')][_0xafdc('0x1e')]);}return _0x46b202[_0xafdc('0x50')](_0x4f3110);}})['then'](function(_0x4fbb49){if(_0x4fbb49){return _0x4fbb49?{'count':_0xac0d17,'rows':_0x4fbb49}:null;}})[_0xafdc('0x27')](respondWithResult(_0x49419d,null))[_0xafdc('0x46')](handleError(_0x49419d,null));};exports[_0xafdc('0x51')]=function(_0x2a372c,_0x3eba7f,_0x3fd74b){var _0x726a74={};var _0x453612={};var _0x5eddca;var _0x470506;return db[_0xafdc('0x2f')][_0xafdc('0x4d')]({'where':{'id':_0x2a372c['params']['id']}})[_0xafdc('0x27')](handleEntityNotFound(_0x3eba7f,null))['then'](function(_0x7733db){if(_0x7733db){_0x5eddca=_0x7733db;_0x453612[_0xafdc('0x33')]=_[_0xafdc('0x34')](db[_0xafdc('0x4e')][_0xafdc('0x30')]);_0x453612[_0xafdc('0x35')]=_[_0xafdc('0x34')](_0x2a372c[_0xafdc('0x35')]);_0x453612['filters']=_[_0xafdc('0x36')](_0x453612[_0xafdc('0x33')],_0x453612[_0xafdc('0x35')]);_0x726a74[_0xafdc('0x38')]=_[_0xafdc('0x36')](_0x453612[_0xafdc('0x33')],qs[_0xafdc('0x37')](_0x2a372c['query'][_0xafdc('0x37')]));_0x726a74[_0xafdc('0x38')]=_0x726a74[_0xafdc('0x38')]['length']?_0x726a74[_0xafdc('0x38')]:_0x453612[_0xafdc('0x33')];_0x726a74['order']=qs[_0xafdc('0x3c')](_0x2a372c['query']['sort']);_0x726a74[_0xafdc('0x40')]=qs[_0xafdc('0x3d')](_['pick'](_0x2a372c[_0xafdc('0x35')],_0x453612[_0xafdc('0x3d')]));if(_0x2a372c[_0xafdc('0x35')][_0xafdc('0x3f')]){_0x726a74[_0xafdc('0x40')]=_[_0xafdc('0x41')](_0x726a74[_0xafdc('0x40')],{'$or':_['map'](_0x726a74[_0xafdc('0x38')],function(_0x309e93){var _0x55311e={};_0x55311e[_0x309e93]={'$like':'%'+_0x2a372c[_0xafdc('0x35')][_0xafdc('0x3f')]+'%'};return _0x55311e;})});}_0x726a74=_[_0xafdc('0x41')]({},_0x726a74,_0x2a372c[_0xafdc('0x43')]);return _0x5eddca[_0xafdc('0x51')](_0x726a74);}})[_0xafdc('0x27')](function(_0xfb3a58){if(_0xfb3a58){_0x470506=_0xfb3a58[_0xafdc('0x39')];if(!_0x2a372c['query'][_0xafdc('0x3a')]('nolimit')){_0x726a74['limit']=qs[_0xafdc('0x20')](_0x2a372c[_0xafdc('0x35')][_0xafdc('0x20')]);_0x726a74[_0xafdc('0x1e')]=qs['offset'](_0x2a372c[_0xafdc('0x35')][_0xafdc('0x1e')]);}return _0x5eddca[_0xafdc('0x51')](_0x726a74);}})[_0xafdc('0x27')](function(_0x5274c0){if(_0x5274c0){return _0x5274c0?{'count':_0x470506,'rows':_0x5274c0}:null;}})[_0xafdc('0x27')](respondWithResult(_0x3eba7f,null))['catch'](handleError(_0x3eba7f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 6264aae..773a4c7 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 _0xc408=['exports','int_freshsales_configurations','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x293ea9,_0x4cccaf){var _0x21b67f=function(_0x211b30){while(--_0x211b30){_0x293ea9['push'](_0x293ea9['shift']());}};_0x21b67f(++_0x4cccaf);}(_0xc408,0x1af));var _0x8c40=function(_0x38c1bb,_0x25b291){_0x38c1bb=_0x38c1bb-0x0;var _0x12faa8=_0xc408[_0x38c1bb];return _0x12faa8;};'use strict';var _=require('lodash');var util=require(_0x8c40('0x0'));var logger=require('../../config/logger')(_0x8c40('0x1'));var moment=require(_0x8c40('0x2'));var BPromise=require(_0x8c40('0x3'));var rp=require(_0x8c40('0x4'));var fs=require('fs');var path=require(_0x8c40('0x5'));var rimraf=require(_0x8c40('0x6'));var config=require(_0x8c40('0x7'));var attributes=require(_0x8c40('0x8'));module[_0x8c40('0x9')]=function(_0x15ad42,_0x10b8e7){return _0x15ad42['define']('FreshsalesConfiguration',attributes,{'tableName':_0x8c40('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f4d=['define','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x12c48,_0x2a1a5c){var _0x4eff55=function(_0x3af699){while(--_0x3af699){_0x12c48['push'](_0x12c48['shift']());}};_0x4eff55(++_0x2a1a5c);}(_0x6f4d,0xbc));var _0xd6f4=function(_0x5d422e,_0x46e57f){_0x5d422e=_0x5d422e-0x0;var _0xef7fb6=_0x6f4d[_0x5d422e];return _0xef7fb6;};'use strict';var _=require(_0xd6f4('0x0'));var util=require('util');var logger=require(_0xd6f4('0x1'))(_0xd6f4('0x2'));var moment=require(_0xd6f4('0x3'));var BPromise=require(_0xd6f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6f4('0x5'));var rimraf=require(_0xd6f4('0x6'));var config=require(_0xd6f4('0x7'));var attributes=require(_0xd6f4('0x8'));module[_0xd6f4('0x9')]=function(_0x184039,_0x13cb6c){return _0x184039[_0xd6f4('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 2f2383d..6e10469 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 _0xe4fb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4320c3,_0x34aca0){var _0x772863=function(_0x20aa3b){while(--_0x20aa3b){_0x4320c3['push'](_0x4320c3['shift']());}};_0x772863(++_0x34aca0);}(_0xe4fb,0xcb));var _0xbe4f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe4fb[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xbe4f('0x0'));var util=require(_0xbe4f('0x1'));var moment=require(_0xbe4f('0x2'));var BPromise=require(_0xbe4f('0x3'));var rs=require(_0xbe4f('0x4'));var fs=require('fs');var Redis=require(_0xbe4f('0x5'));var db=require(_0xbe4f('0x6'))['db'];var utils=require(_0xbe4f('0x7'));var logger=require(_0xbe4f('0x8'))('rpc');var config=require(_0xbe4f('0x9'));var jayson=require(_0xbe4f('0xa'));var client=jayson[_0xbe4f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2be29e,_0x571b4e,_0x49378f){return new BPromise(function(_0x5b9272,_0x3ffed8){return client['request'](_0x2be29e,_0x49378f)['then'](function(_0x439c2b){logger[_0xbe4f('0xc')](_0xbe4f('0xd'),_0x571b4e,'request\x20sent');logger['debug'](_0xbe4f('0xe'),_0x571b4e,_0xbe4f('0xf'),JSON[_0xbe4f('0x10')](_0x439c2b));if(_0x439c2b[_0xbe4f('0x11')]){if(_0x439c2b['error'][_0xbe4f('0x12')]===0x1f4){logger['error'](_0xbe4f('0xd'),_0x571b4e,_0x439c2b[_0xbe4f('0x11')][_0xbe4f('0x13')]);return _0x3ffed8(_0x439c2b[_0xbe4f('0x11')][_0xbe4f('0x13')]);}logger[_0xbe4f('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x571b4e,_0x439c2b['error'][_0xbe4f('0x13')]);return _0x5b9272(_0x439c2b[_0xbe4f('0x11')]['message']);}else{logger['info'](_0xbe4f('0xd'),_0x571b4e,_0xbe4f('0xf'));_0x5b9272(_0x439c2b['result'][_0xbe4f('0x13')]);}})[_0xbe4f('0x14')](function(_0x4ad1af){logger['error'](_0xbe4f('0xd'),_0x571b4e,_0x4ad1af);_0x3ffed8(_0x4ad1af);});});} \ No newline at end of file +var _0xe90c=['stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../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'];(function(_0x473826,_0x343007){var _0x11fcbd=function(_0x44a6cf){while(--_0x44a6cf){_0x473826['push'](_0x473826['shift']());}};_0x11fcbd(++_0x343007);}(_0xe90c,0x78));var _0xce90=function(_0xa80941,_0x585e35){_0xa80941=_0xa80941-0x0;var _0x55c512=_0xe90c[_0xa80941];return _0x55c512;};'use strict';var _=require(_0xce90('0x0'));var util=require(_0xce90('0x1'));var moment=require(_0xce90('0x2'));var BPromise=require('bluebird');var rs=require(_0xce90('0x3'));var fs=require('fs');var Redis=require(_0xce90('0x4'));var db=require(_0xce90('0x5'))['db'];var utils=require(_0xce90('0x6'));var logger=require(_0xce90('0x7'))(_0xce90('0x8'));var config=require(_0xce90('0x9'));var jayson=require(_0xce90('0xa'));var client=jayson[_0xce90('0xb')][_0xce90('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2976fc,_0x194bee,_0x4a2830){return new BPromise(function(_0x162a4f,_0x37d069){return client['request'](_0x2976fc,_0x4a2830)[_0xce90('0xd')](function(_0x488ea3){logger[_0xce90('0xe')](_0xce90('0xf'),_0x194bee,_0xce90('0x10'));logger['debug'](_0xce90('0x11'),_0x194bee,_0xce90('0x10'),JSON[_0xce90('0x12')](_0x488ea3));if(_0x488ea3[_0xce90('0x13')]){if(_0x488ea3[_0xce90('0x13')][_0xce90('0x14')]===0x1f4){logger[_0xce90('0x13')](_0xce90('0xf'),_0x194bee,_0x488ea3[_0xce90('0x13')][_0xce90('0x15')]);return _0x37d069(_0x488ea3[_0xce90('0x13')][_0xce90('0x15')]);}logger[_0xce90('0x13')](_0xce90('0xf'),_0x194bee,_0x488ea3[_0xce90('0x13')][_0xce90('0x15')]);return _0x162a4f(_0x488ea3[_0xce90('0x13')]['message']);}else{logger[_0xce90('0xe')](_0xce90('0xf'),_0x194bee,'request\x20sent');_0x162a4f(_0x488ea3[_0xce90('0x16')]['message']);}})['catch'](function(_0x1ce8c2){logger[_0xce90('0x13')](_0xce90('0xf'),_0x194bee,_0x1ce8c2);_0x37d069(_0x1ce8c2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 1649195..86596c9 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 _0x65b3=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x3b6668,_0x3b3c41){var _0x4e47e6=function(_0x4120d3){while(--_0x4120d3){_0x3b6668['push'](_0x3b6668['shift']());}};_0x4e47e6(++_0x3b3c41);}(_0x65b3,0xc6));var _0x365b=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x65b3[_0x874cf1];return _0x233579;};'use strict';var multer=require(_0x365b('0x0'));var util=require(_0x365b('0x1'));var path=require(_0x365b('0x2'));var timeout=require(_0x365b('0x3'));var express=require(_0x365b('0x4'));var router=express[_0x365b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x365b('0x6'));var interaction=require(_0x365b('0x7'));var config=require(_0x365b('0x8'));var controller=require('./intFreshsalesField.controller');router[_0x365b('0x9')]('/',auth[_0x365b('0xa')](),controller[_0x365b('0xb')]);router['get'](_0x365b('0xc'),auth[_0x365b('0xa')](),controller[_0x365b('0xd')]);router[_0x365b('0xe')]('/',auth[_0x365b('0xa')](),controller['create']);router[_0x365b('0xf')](_0x365b('0xc'),auth[_0x365b('0xa')](),controller[_0x365b('0x10')]);router[_0x365b('0x11')]('/:id',auth[_0x365b('0xa')](),controller[_0x365b('0x12')]);module[_0x365b('0x13')]=router; \ No newline at end of file +var _0xae7b=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xe751cf,_0x2c695c){var _0x13faab=function(_0x2ae31e){while(--_0x2ae31e){_0xe751cf['push'](_0xe751cf['shift']());}};_0x13faab(++_0x2c695c);}(_0xae7b,0xbe));var _0xbae7=function(_0x5559f5,_0x54f928){_0x5559f5=_0x5559f5-0x0;var _0x56580b=_0xae7b[_0x5559f5];return _0x56580b;};'use strict';var multer=require(_0xbae7('0x0'));var util=require(_0xbae7('0x1'));var path=require(_0xbae7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbae7('0x3')]();var fs_extra=require(_0xbae7('0x4'));var auth=require(_0xbae7('0x5'));var interaction=require(_0xbae7('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router[_0xbae7('0x7')]('/',auth[_0xbae7('0x8')](),controller[_0xbae7('0x9')]);router['get'](_0xbae7('0xa'),auth['isAuthenticated'](),controller[_0xbae7('0xb')]);router[_0xbae7('0xc')]('/',auth[_0xbae7('0x8')](),controller['create']);router[_0xbae7('0xd')]('/:id',auth[_0xbae7('0x8')](),controller[_0xbae7('0xe')]);router[_0xbae7('0xf')](_0xbae7('0xa'),auth['isAuthenticated'](),controller[_0xbae7('0x10')]);module[_0xbae7('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 8f1a104..dab104f 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 _0x2a9b=['sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3471b0,_0x129077){var _0x22625d=function(_0xa9ddf6){while(--_0xa9ddf6){_0x3471b0['push'](_0x3471b0['shift']());}};_0x22625d(++_0x129077);}(_0x2a9b,0x68));var _0xb2a9=function(_0x383003,_0x1ec126){_0x383003=_0x383003-0x0;var _0x5e930b=_0x2a9b[_0x383003];return _0x5e930b;};'use strict';var Sequelize=require(_0xb2a9('0x0'));module['exports']={'type':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x2'),_0xb2a9('0x3'),_0xb2a9('0x4'),_0xb2a9('0x5'),_0xb2a9('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb2a9('0x1')](_0xb2a9('0x2'),_0xb2a9('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb2a9('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb2a9('0x7')]}}; \ No newline at end of file +var _0x244d=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x1a7eb3,_0x23bf97){var _0x19e176=function(_0x3419e9){while(--_0x3419e9){_0x1a7eb3['push'](_0x1a7eb3['shift']());}};_0x19e176(++_0x23bf97);}(_0x244d,0x1a2));var _0xd244=function(_0x54182c,_0x5a1596){_0x54182c=_0x54182c-0x0;var _0x366990=_0x244d[_0x54182c];return _0x366990;};'use strict';var Sequelize=require(_0xd244('0x0'));module[_0xd244('0x1')]={'type':{'type':Sequelize[_0xd244('0x2')](_0xd244('0x3'),_0xd244('0x4'),_0xd244('0x5'),_0xd244('0x6'),_0xd244('0x7')),'defaultValue':_0xd244('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd244('0x8')]},'keyType':{'type':Sequelize[_0xd244('0x2')](_0xd244('0x3'),_0xd244('0x4'),_0xd244('0x5'))},'keyContent':{'type':Sequelize[_0xd244('0x8')]},'idField':{'type':Sequelize[_0xd244('0x8')]},'nameField':{'type':Sequelize[_0xd244('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 05090de..f333cfe 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 _0xa0ca=['limit','count','apply','reject','save','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','FreshsalesField','findAll','catch','show','params','rawAttributes','include','options','find','create','body','update','fast-json-patch','bluebird','mustache','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0xa0ca,0x107));var _0xaa0c=function(_0x3c16f6,_0x342819){_0x3c16f6=_0x3c16f6-0x0;var _0x50a3ac=_0xa0ca[_0x3c16f6];return _0x50a3ac;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaa0c('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaa0c('0x1'));var Mustache=require(_0xaa0c('0x2'));var util=require('util');var path=require(_0xaa0c('0x3'));var sox=require('sox');var csv=require(_0xaa0c('0x4'));var ejs=require(_0xaa0c('0x5'));var fs=require('fs');var fs_extra=require(_0xaa0c('0x6'));var _=require(_0xaa0c('0x7'));var squel=require(_0xaa0c('0x8'));var crypto=require(_0xaa0c('0x9'));var jsforce=require(_0xaa0c('0xa'));var deskjs=require(_0xaa0c('0xb'));var toCsv=require('to-csv');var querystring=require(_0xaa0c('0xc'));var Papa=require(_0xaa0c('0xd'));var Redis=require(_0xaa0c('0xe'));var authService=require(_0xaa0c('0xf'));var qs=require(_0xaa0c('0x10'));var as=require(_0xaa0c('0x11'));var hardwareService=require(_0xaa0c('0x12'));var logger=require(_0xaa0c('0x13'))(_0xaa0c('0x14'));var utils=require(_0xaa0c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaa0c('0x16'));var db=require(_0xaa0c('0x17'))['db'];function respondWithStatusCode(_0x52d5d1,_0x4fc451){_0x4fc451=_0x4fc451||0xcc;return function(_0x1061e9){if(_0x1061e9){return _0x52d5d1[_0xaa0c('0x18')](_0x4fc451);}return _0x52d5d1[_0xaa0c('0x19')](_0x4fc451)[_0xaa0c('0x1a')]();};}function respondWithResult(_0x2119f0,_0x45722b){_0x45722b=_0x45722b||0xc8;return function(_0x1cb478){if(_0x1cb478){return _0x2119f0[_0xaa0c('0x19')](_0x45722b)[_0xaa0c('0x1b')](_0x1cb478);}};}function respondWithFilteredResult(_0x3ae8dd,_0x29ada1){return function(_0x19a63e){if(_0x19a63e){var _0x20430a=typeof _0x29ada1[_0xaa0c('0x1c')]==='undefined'&&typeof _0x29ada1[_0xaa0c('0x1d')]==='undefined';var _0x2a4ed9=_0x19a63e[_0xaa0c('0x1e')];var _0x1fdd38=_0x20430a?0x0:_0x29ada1['offset'];var _0x3d9619=_0x20430a?_0x19a63e[_0xaa0c('0x1e')]:_0x29ada1['offset']+_0x29ada1[_0xaa0c('0x1d')];var _0x285d52;if(_0x3d9619>=_0x2a4ed9){_0x3d9619=_0x2a4ed9;_0x285d52=0xc8;}else{_0x285d52=0xce;}_0x3ae8dd[_0xaa0c('0x19')](_0x285d52);return _0x3ae8dd['set']('Content-Range',_0x1fdd38+'-'+_0x3d9619+'/'+_0x2a4ed9)['json'](_0x19a63e);}return null;};}function patchUpdates(_0x457906){return function(_0x4a178e){try{jsonpatch[_0xaa0c('0x1f')](_0x4a178e,_0x457906,!![]);}catch(_0x183959){return BPromise[_0xaa0c('0x20')](_0x183959);}return _0x4a178e[_0xaa0c('0x21')]();};}function saveUpdates(_0x3c49a2,_0x475d90){return function(_0x329d6b){if(_0x329d6b){return _0x329d6b['update'](_0x3c49a2)[_0xaa0c('0x22')](function(_0x22fd67){return _0x22fd67;});}return null;};}function removeEntity(_0x158de8,_0x4c306d){return function(_0x4e946a){if(_0x4e946a){return _0x4e946a[_0xaa0c('0x23')]()['then'](function(){_0x158de8[_0xaa0c('0x19')](0xcc)[_0xaa0c('0x1a')]();});}};}function handleEntityNotFound(_0xc65e3d,_0x3c651a){return function(_0x23ef9f){if(!_0x23ef9f){_0xc65e3d[_0xaa0c('0x18')](0x194);}return _0x23ef9f;};}function handleError(_0x3e5736,_0x1ffee2){_0x1ffee2=_0x1ffee2||0x1f4;return function(_0x41cb54){logger[_0xaa0c('0x24')](_0x41cb54[_0xaa0c('0x25')]);if(_0x41cb54['name']){delete _0x41cb54[_0xaa0c('0x26')];}_0x3e5736['status'](_0x1ffee2)['send'](_0x41cb54);};}exports[_0xaa0c('0x27')]=function(_0x4192ae,_0x3a065d){var _0x25b33b={},_0x94b423={},_0x4c9f91={'count':0x0,'rows':[]};var _0x2da788=_[_0xaa0c('0x28')](db['FreshsalesField']['rawAttributes'],function(_0x1810a5){return{'name':_0x1810a5[_0xaa0c('0x29')],'type':_0x1810a5[_0xaa0c('0x2a')][_0xaa0c('0x2b')]};});_0x94b423[_0xaa0c('0x2c')]=_['map'](_0x2da788,'name');_0x94b423[_0xaa0c('0x2d')]=_[_0xaa0c('0x2e')](_0x4192ae[_0xaa0c('0x2d')]);_0x94b423[_0xaa0c('0x2f')]=_[_0xaa0c('0x30')](_0x94b423[_0xaa0c('0x2c')],_0x94b423[_0xaa0c('0x2d')]);_0x25b33b[_0xaa0c('0x31')]=_[_0xaa0c('0x30')](_0x94b423[_0xaa0c('0x2c')],qs['fields'](_0x4192ae[_0xaa0c('0x2d')]['fields']));_0x25b33b[_0xaa0c('0x31')]=_0x25b33b[_0xaa0c('0x31')][_0xaa0c('0x32')]?_0x25b33b[_0xaa0c('0x31')]:_0x94b423[_0xaa0c('0x2c')];if(!_0x4192ae[_0xaa0c('0x2d')][_0xaa0c('0x33')](_0xaa0c('0x34'))){_0x25b33b['limit']=qs[_0xaa0c('0x1d')](_0x4192ae[_0xaa0c('0x2d')][_0xaa0c('0x1d')]);_0x25b33b[_0xaa0c('0x1c')]=qs[_0xaa0c('0x1c')](_0x4192ae[_0xaa0c('0x2d')][_0xaa0c('0x1c')]);}_0x25b33b[_0xaa0c('0x35')]=qs['sort'](_0x4192ae[_0xaa0c('0x2d')][_0xaa0c('0x36')]);_0x25b33b[_0xaa0c('0x37')]=qs['filters'](_[_0xaa0c('0x38')](_0x4192ae['query'],_0x94b423[_0xaa0c('0x2f')]),_0x2da788);if(_0x4192ae['query']['filter']){_0x25b33b[_0xaa0c('0x37')]=_[_0xaa0c('0x39')](_0x25b33b[_0xaa0c('0x37')],{'$or':_[_0xaa0c('0x28')](_0x2da788,function(_0x23e881){if(_0x23e881[_0xaa0c('0x2a')]!==_0xaa0c('0x3a')){var _0x3fd78e={};_0x3fd78e[_0x23e881['name']]={'$like':'%'+_0x4192ae[_0xaa0c('0x2d')][_0xaa0c('0x3b')]+'%'};return _0x3fd78e;}})});}_0x25b33b=_['merge']({},_0x25b33b,_0x4192ae['options']);var _0x3f55fe={'where':_0x25b33b['where']};return db['FreshsalesField']['count'](_0x3f55fe)[_0xaa0c('0x22')](function(_0x27bd54){_0x4c9f91[_0xaa0c('0x1e')]=_0x27bd54;if(_0x4192ae['query'][_0xaa0c('0x3c')]){_0x25b33b['include']=[{'all':!![]}];}return db[_0xaa0c('0x3d')][_0xaa0c('0x3e')](_0x25b33b);})[_0xaa0c('0x22')](function(_0x174349){_0x4c9f91['rows']=_0x174349;return _0x4c9f91;})['then'](respondWithFilteredResult(_0x3a065d,_0x25b33b))[_0xaa0c('0x3f')](handleError(_0x3a065d,null));};exports[_0xaa0c('0x40')]=function(_0x4b97c2,_0x5293f2){var _0x366202={'raw':!![],'where':{'id':_0x4b97c2[_0xaa0c('0x41')]['id']}},_0x4a260b={};_0x4a260b[_0xaa0c('0x2c')]=_[_0xaa0c('0x2e')](db[_0xaa0c('0x3d')][_0xaa0c('0x42')]);_0x4a260b[_0xaa0c('0x2d')]=_[_0xaa0c('0x2e')](_0x4b97c2['query']);_0x4a260b['filters']=_[_0xaa0c('0x30')](_0x4a260b['model'],_0x4a260b[_0xaa0c('0x2d')]);_0x366202['attributes']=_['intersection'](_0x4a260b['model'],qs['fields'](_0x4b97c2[_0xaa0c('0x2d')]['fields']));_0x366202[_0xaa0c('0x31')]=_0x366202[_0xaa0c('0x31')][_0xaa0c('0x32')]?_0x366202[_0xaa0c('0x31')]:_0x4a260b['model'];if(_0x4b97c2[_0xaa0c('0x2d')]['includeAll']){_0x366202[_0xaa0c('0x43')]=[{'all':!![]}];}_0x366202=_['merge']({},_0x366202,_0x4b97c2[_0xaa0c('0x44')]);return db['FreshsalesField'][_0xaa0c('0x45')](_0x366202)['then'](handleEntityNotFound(_0x5293f2,null))[_0xaa0c('0x22')](respondWithResult(_0x5293f2,null))[_0xaa0c('0x3f')](handleError(_0x5293f2,null));};exports[_0xaa0c('0x46')]=function(_0x279037,_0x40a7e2){return db[_0xaa0c('0x3d')][_0xaa0c('0x46')](_0x279037[_0xaa0c('0x47')],{})[_0xaa0c('0x22')](respondWithResult(_0x40a7e2,0xc9))[_0xaa0c('0x3f')](handleError(_0x40a7e2,null));};exports[_0xaa0c('0x48')]=function(_0x1f5841,_0xfe2325){if(_0x1f5841['body']['id']){delete _0x1f5841[_0xaa0c('0x47')]['id'];}return db[_0xaa0c('0x3d')][_0xaa0c('0x45')]({'where':{'id':_0x1f5841['params']['id']}})[_0xaa0c('0x22')](handleEntityNotFound(_0xfe2325,null))[_0xaa0c('0x22')](saveUpdates(_0x1f5841[_0xaa0c('0x47')],null))[_0xaa0c('0x22')](respondWithResult(_0xfe2325,null))[_0xaa0c('0x3f')](handleError(_0xfe2325,null));};exports[_0xaa0c('0x23')]=function(_0x5e9290,_0x3c98c9){return db[_0xaa0c('0x3d')][_0xaa0c('0x45')]({'where':{'id':_0x5e9290[_0xaa0c('0x41')]['id']}})[_0xaa0c('0x22')](handleEntityNotFound(_0x3c98c9,null))['then'](removeEntity(_0x3c98c9,null))[_0xaa0c('0x3f')](handleError(_0x3c98c9,null));}; \ No newline at end of file +var _0x93b1=['order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','FreshsalesField','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','name','send','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit'];(function(_0x19d30e,_0x1cb29e){var _0x5bc850=function(_0x53e5f1){while(--_0x53e5f1){_0x19d30e['push'](_0x19d30e['shift']());}};_0x5bc850(++_0x1cb29e);}(_0x93b1,0x177));var _0x193b=function(_0x5b10e3,_0x49a5d2){_0x5b10e3=_0x5b10e3-0x0;var _0x513a08=_0x93b1[_0x5b10e3];return _0x513a08;};'use strict';var emlformat=require(_0x193b('0x0'));var rimraf=require(_0x193b('0x1'));var zipdir=require(_0x193b('0x2'));var jsonpatch=require(_0x193b('0x3'));var rp=require('request-promise');var moment=require(_0x193b('0x4'));var BPromise=require(_0x193b('0x5'));var Mustache=require(_0x193b('0x6'));var util=require(_0x193b('0x7'));var path=require(_0x193b('0x8'));var sox=require(_0x193b('0x9'));var csv=require(_0x193b('0xa'));var ejs=require(_0x193b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x193b('0xc'));var crypto=require(_0x193b('0xd'));var jsforce=require(_0x193b('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x193b('0xf'));var Papa=require(_0x193b('0x10'));var Redis=require(_0x193b('0x11'));var authService=require(_0x193b('0x12'));var qs=require(_0x193b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x193b('0x14'));var logger=require(_0x193b('0x15'))(_0x193b('0x16'));var utils=require(_0x193b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x193b('0x18'))['db'];function respondWithStatusCode(_0x5b631c,_0x168aba){_0x168aba=_0x168aba||0xcc;return function(_0x20e92b){if(_0x20e92b){return _0x5b631c[_0x193b('0x19')](_0x168aba);}return _0x5b631c[_0x193b('0x1a')](_0x168aba)[_0x193b('0x1b')]();};}function respondWithResult(_0x2438cb,_0x3ad182){_0x3ad182=_0x3ad182||0xc8;return function(_0x467144){if(_0x467144){return _0x2438cb[_0x193b('0x1a')](_0x3ad182)['json'](_0x467144);}};}function respondWithFilteredResult(_0x274f77,_0x449e04){return function(_0x531e6f){if(_0x531e6f){var _0x203784=typeof _0x449e04[_0x193b('0x1c')]===_0x193b('0x1d')&&typeof _0x449e04[_0x193b('0x1e')]===_0x193b('0x1d');var _0x2f1857=_0x531e6f[_0x193b('0x1f')];var _0x471005=_0x203784?0x0:_0x449e04['offset'];var _0x1a6560=_0x203784?_0x531e6f['count']:_0x449e04['offset']+_0x449e04[_0x193b('0x1e')];var _0xd853db;if(_0x1a6560>=_0x2f1857){_0x1a6560=_0x2f1857;_0xd853db=0xc8;}else{_0xd853db=0xce;}_0x274f77[_0x193b('0x1a')](_0xd853db);return _0x274f77[_0x193b('0x20')]('Content-Range',_0x471005+'-'+_0x1a6560+'/'+_0x2f1857)[_0x193b('0x21')](_0x531e6f);}return null;};}function patchUpdates(_0x150347){return function(_0xf7468a){try{jsonpatch[_0x193b('0x22')](_0xf7468a,_0x150347,!![]);}catch(_0x35a105){return BPromise[_0x193b('0x23')](_0x35a105);}return _0xf7468a['save']();};}function saveUpdates(_0xc96ce8,_0x44b6cb){return function(_0x43058a){if(_0x43058a){return _0x43058a[_0x193b('0x24')](_0xc96ce8)[_0x193b('0x25')](function(_0xdb9670){return _0xdb9670;});}return null;};}function removeEntity(_0xfdfcb4,_0x29e79d){return function(_0x2e789b){if(_0x2e789b){return _0x2e789b['destroy']()[_0x193b('0x25')](function(){_0xfdfcb4['status'](0xcc)[_0x193b('0x1b')]();});}};}function handleEntityNotFound(_0x3fc8d0,_0x2b2d48){return function(_0x3bfbb3){if(!_0x3bfbb3){_0x3fc8d0[_0x193b('0x19')](0x194);}return _0x3bfbb3;};}function handleError(_0x1d000f,_0x3b1cc5){_0x3b1cc5=_0x3b1cc5||0x1f4;return function(_0x32357b){logger['error'](_0x32357b['stack']);if(_0x32357b['name']){delete _0x32357b[_0x193b('0x26')];}_0x1d000f[_0x193b('0x1a')](_0x3b1cc5)[_0x193b('0x27')](_0x32357b);};}exports['index']=function(_0x511cd6,_0x2fadf7){var _0x3bf476={},_0x249cde={},_0x57bd4d={'count':0x0,'rows':[]};var _0xac4165=_['map'](db['FreshsalesField']['rawAttributes'],function(_0x4eea15){return{'name':_0x4eea15[_0x193b('0x28')],'type':_0x4eea15[_0x193b('0x29')][_0x193b('0x2a')]};});_0x249cde[_0x193b('0x2b')]=_[_0x193b('0x2c')](_0xac4165,_0x193b('0x26'));_0x249cde[_0x193b('0x2d')]=_[_0x193b('0x2e')](_0x511cd6[_0x193b('0x2d')]);_0x249cde['filters']=_[_0x193b('0x2f')](_0x249cde[_0x193b('0x2b')],_0x249cde[_0x193b('0x2d')]);_0x3bf476[_0x193b('0x30')]=_[_0x193b('0x2f')](_0x249cde[_0x193b('0x2b')],qs['fields'](_0x511cd6[_0x193b('0x2d')][_0x193b('0x31')]));_0x3bf476[_0x193b('0x30')]=_0x3bf476['attributes']['length']?_0x3bf476[_0x193b('0x30')]:_0x249cde['model'];if(!_0x511cd6['query']['hasOwnProperty'](_0x193b('0x32'))){_0x3bf476[_0x193b('0x1e')]=qs[_0x193b('0x1e')](_0x511cd6[_0x193b('0x2d')]['limit']);_0x3bf476[_0x193b('0x1c')]=qs['offset'](_0x511cd6[_0x193b('0x2d')][_0x193b('0x1c')]);}_0x3bf476[_0x193b('0x33')]=qs[_0x193b('0x34')](_0x511cd6['query'][_0x193b('0x34')]);_0x3bf476[_0x193b('0x35')]=qs['filters'](_[_0x193b('0x36')](_0x511cd6['query'],_0x249cde[_0x193b('0x37')]),_0xac4165);if(_0x511cd6[_0x193b('0x2d')][_0x193b('0x38')]){_0x3bf476[_0x193b('0x35')]=_[_0x193b('0x39')](_0x3bf476['where'],{'$or':_['map'](_0xac4165,function(_0x6d6a41){if(_0x6d6a41[_0x193b('0x29')]!==_0x193b('0x3a')){var _0x23c2e4={};_0x23c2e4[_0x6d6a41['name']]={'$like':'%'+_0x511cd6[_0x193b('0x2d')][_0x193b('0x38')]+'%'};return _0x23c2e4;}})});}_0x3bf476=_[_0x193b('0x39')]({},_0x3bf476,_0x511cd6[_0x193b('0x3b')]);var _0xe7a50b={'where':_0x3bf476['where']};return db['FreshsalesField'][_0x193b('0x1f')](_0xe7a50b)[_0x193b('0x25')](function(_0x251dfb){_0x57bd4d[_0x193b('0x1f')]=_0x251dfb;if(_0x511cd6['query'][_0x193b('0x3c')]){_0x3bf476[_0x193b('0x3d')]=[{'all':!![]}];}return db['FreshsalesField'][_0x193b('0x3e')](_0x3bf476);})[_0x193b('0x25')](function(_0x2bec7b){_0x57bd4d[_0x193b('0x3f')]=_0x2bec7b;return _0x57bd4d;})[_0x193b('0x25')](respondWithFilteredResult(_0x2fadf7,_0x3bf476))['catch'](handleError(_0x2fadf7,null));};exports['show']=function(_0x45bc6c,_0x2577ac){var _0x3f0c09={'raw':!![],'where':{'id':_0x45bc6c[_0x193b('0x40')]['id']}},_0xc885fa={};_0xc885fa['model']=_['keys'](db[_0x193b('0x41')][_0x193b('0x42')]);_0xc885fa['query']=_[_0x193b('0x2e')](_0x45bc6c[_0x193b('0x2d')]);_0xc885fa[_0x193b('0x37')]=_[_0x193b('0x2f')](_0xc885fa[_0x193b('0x2b')],_0xc885fa[_0x193b('0x2d')]);_0x3f0c09[_0x193b('0x30')]=_[_0x193b('0x2f')](_0xc885fa['model'],qs[_0x193b('0x31')](_0x45bc6c['query'][_0x193b('0x31')]));_0x3f0c09['attributes']=_0x3f0c09['attributes']['length']?_0x3f0c09[_0x193b('0x30')]:_0xc885fa[_0x193b('0x2b')];if(_0x45bc6c['query'][_0x193b('0x3c')]){_0x3f0c09[_0x193b('0x3d')]=[{'all':!![]}];}_0x3f0c09=_['merge']({},_0x3f0c09,_0x45bc6c[_0x193b('0x3b')]);return db[_0x193b('0x41')][_0x193b('0x43')](_0x3f0c09)['then'](handleEntityNotFound(_0x2577ac,null))[_0x193b('0x25')](respondWithResult(_0x2577ac,null))[_0x193b('0x44')](handleError(_0x2577ac,null));};exports[_0x193b('0x45')]=function(_0x951ef7,_0x30e97b){return db['FreshsalesField'][_0x193b('0x45')](_0x951ef7[_0x193b('0x46')],{})[_0x193b('0x25')](respondWithResult(_0x30e97b,0xc9))['catch'](handleError(_0x30e97b,null));};exports[_0x193b('0x24')]=function(_0x32e7b0,_0x5fcd43){if(_0x32e7b0[_0x193b('0x46')]['id']){delete _0x32e7b0['body']['id'];}return db['FreshsalesField'][_0x193b('0x43')]({'where':{'id':_0x32e7b0[_0x193b('0x40')]['id']}})[_0x193b('0x25')](handleEntityNotFound(_0x5fcd43,null))[_0x193b('0x25')](saveUpdates(_0x32e7b0[_0x193b('0x46')],null))[_0x193b('0x25')](respondWithResult(_0x5fcd43,null))[_0x193b('0x44')](handleError(_0x5fcd43,null));};exports['destroy']=function(_0x56066a,_0x143671){return db['FreshsalesField'][_0x193b('0x43')]({'where':{'id':_0x56066a[_0x193b('0x40')]['id']}})[_0x193b('0x25')](handleEntityNotFound(_0x143671,null))[_0x193b('0x25')](removeEntity(_0x143671,null))[_0x193b('0x44')](handleError(_0x143671,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 4aefbfb..f9b1037 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 _0x7a40=['idField','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index'];(function(_0x50efa9,_0x42685e){var _0x4e71f8=function(_0x244193){while(--_0x244193){_0x50efa9['push'](_0x50efa9['shift']());}};_0x4e71f8(++_0x42685e);}(_0x7a40,0x197));var _0x07a4=function(_0x11d929,_0x43970d){_0x11d929=_0x11d929-0x0;var _0x415c47=_0x7a40[_0x11d929];return _0x415c47;};'use strict';var _=require(_0x07a4('0x0'));var util=require(_0x07a4('0x1'));var logger=require(_0x07a4('0x2'))('api');var moment=require(_0x07a4('0x3'));var BPromise=require(_0x07a4('0x4'));var rp=require(_0x07a4('0x5'));var fs=require('fs');var path=require(_0x07a4('0x6'));var rimraf=require(_0x07a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x07a4('0x8'));module[_0x07a4('0x9')]=function(_0x3a53fb,_0x399d0f){return _0x3a53fb[_0x07a4('0xa')]('FreshsalesField',attributes,{'tableName':_0x07a4('0xb'),'paranoid':![],'indexes':[{'name':_0x07a4('0xc'),'fields':[_0x07a4('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fce=['../../config/logger','api','moment','bluebird','request-promise','path','FreshsalesField','freshsales_unique_index','FieldId','util'];(function(_0x9c9308,_0x293578){var _0x3c772c=function(_0x1c09e1){while(--_0x1c09e1){_0x9c9308['push'](_0x9c9308['shift']());}};_0x3c772c(++_0x293578);}(_0x3fce,0x121));var _0xe3fc=function(_0x1f5303,_0x354414){_0x1f5303=_0x1f5303-0x0;var _0x84ef1a=_0x3fce[_0x1f5303];return _0x84ef1a;};'use strict';var _=require('lodash');var util=require(_0xe3fc('0x0'));var logger=require(_0xe3fc('0x1'))(_0xe3fc('0x2'));var moment=require(_0xe3fc('0x3'));var BPromise=require(_0xe3fc('0x4'));var rp=require(_0xe3fc('0x5'));var fs=require('fs');var path=require(_0xe3fc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x36eff8,_0x2dc84d){return _0x36eff8['define'](_0xe3fc('0x7'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xe3fc('0x8'),'fields':['idField',_0xe3fc('0x9')],'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 277fdd3..c05085d 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 _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xd117,0x182));var _0x7d11=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xd117[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x4975,0x86));var _0x5497=function(_0xe5dad4,_0x34dbd3){_0xe5dad4=_0xe5dad4-0x0;var _0x558226=_0x4975[_0xe5dad4];return _0x558226;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 5f5d46c..25c6dff 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x30511e,_0x2367de){var _0x38df64=function(_0x13b45c){while(--_0x13b45c){_0x30511e['push'](_0x30511e['shift']());}};_0x38df64(++_0x2367de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x29fb88,_0x2dd883){var _0x278b55=function(_0x5cba3e){while(--_0x5cba3e){_0x29fb88['push'](_0x29fb88['shift']());}};_0x278b55(++_0x2dd883);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 9344d4e..9031540 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 _0xe666=['username','ENUM','integrationTab','sequelize','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe666,0x189));var _0x6e66=function(_0x5edb2e,_0x5bc71e){_0x5edb2e=_0x5edb2e-0x0;var _0x2786ee=_0xe666[_0x5edb2e];return _0x2786ee;};'use strict';var Sequelize=require(_0x6e66('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6e66('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6e66('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6e66('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x6e66('0x1')]},'securityToken':{'type':Sequelize[_0x6e66('0x1')]},'serverUrl':{'type':Sequelize[_0x6e66('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6e66('0x3')](_0x6e66('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xf8f2=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x47a6f3,_0x2c8947){_0x47a6f3=_0x47a6f3-0x0;var _0xef2dd2=_0xf8f2[_0x47a6f3];return _0xef2dd2;};'use strict';var Sequelize=require(_0x2f8f('0x0'));module[_0x2f8f('0x1')]={'name':{'type':Sequelize[_0x2f8f('0x2')]},'description':{'type':Sequelize[_0x2f8f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2f8f('0x3')},'remoteUri':{'type':Sequelize[_0x2f8f('0x2')]},'password':{'type':Sequelize[_0x2f8f('0x2')]},'clientId':{'type':Sequelize[_0x2f8f('0x2')]},'clientSecret':{'type':Sequelize[_0x2f8f('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2f8f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2f8f('0x4')](_0x2f8f('0x5'),_0x2f8f('0x6')),'defaultValue':_0x2f8f('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 9e3a3f0..9074b88 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 _0x1b85=['type','key','query','keys','intersection','model','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','options','then','count','includeAll','include','findAll','rows','show','fields','find','catch','create','body','params','getConfigurations','SalesforceConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientSecret','username','slice','substring','lastIndexOf','Connection','clientId','login','password','concat','securityToken','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName'];(function(_0xb13764,_0x4aab57){var _0x2c971a=function(_0x1e3d6d){while(--_0x1e3d6d){_0xb13764['push'](_0xb13764['shift']());}};_0x2c971a(++_0x4aab57);}(_0x1b85,0x1d3));var _0x51b8=function(_0xa66794,_0x27e8fe){_0xa66794=_0xa66794-0x0;var _0x41f8b5=_0x1b85[_0xa66794];return _0x41f8b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51b8('0x1'));var rp=require(_0x51b8('0x2'));var moment=require(_0x51b8('0x3'));var BPromise=require(_0x51b8('0x4'));var Mustache=require(_0x51b8('0x5'));var util=require(_0x51b8('0x6'));var path=require(_0x51b8('0x7'));var sox=require(_0x51b8('0x8'));var csv=require(_0x51b8('0x9'));var ejs=require(_0x51b8('0xa'));var fs=require('fs');var fs_extra=require(_0x51b8('0xb'));var _=require(_0x51b8('0xc'));var squel=require(_0x51b8('0xd'));var crypto=require('crypto');var jsforce=require(_0x51b8('0xe'));var deskjs=require(_0x51b8('0xf'));var toCsv=require(_0x51b8('0x9'));var querystring=require(_0x51b8('0x10'));var Papa=require(_0x51b8('0x11'));var Redis=require(_0x51b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x51b8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51b8('0x14'));var logger=require(_0x51b8('0x15'))(_0x51b8('0x16'));var utils=require(_0x51b8('0x17'));var config=require(_0x51b8('0x18'));var licenseUtil=require(_0x51b8('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56a441,_0x520e18){_0x520e18=_0x520e18||0xcc;return function(_0x42afc3){if(_0x42afc3){return _0x56a441[_0x51b8('0x1a')](_0x520e18);}return _0x56a441[_0x51b8('0x1b')](_0x520e18)[_0x51b8('0x1c')]();};}function respondWithResult(_0x589ea8,_0x575490){_0x575490=_0x575490||0xc8;return function(_0x1c84a1){if(_0x1c84a1){return _0x589ea8['status'](_0x575490)[_0x51b8('0x1d')](_0x1c84a1);}};}function respondWithFilteredResult(_0x14d372,_0x3963c0){return function(_0x2df933){if(_0x2df933){var _0x4d291c=typeof _0x3963c0['offset']===_0x51b8('0x1e')&&typeof _0x3963c0[_0x51b8('0x1f')]===_0x51b8('0x1e');var _0x5d1622=_0x2df933['count'];var _0x45d450=_0x4d291c?0x0:_0x3963c0[_0x51b8('0x20')];var _0x2d3b75=_0x4d291c?_0x2df933['count']:_0x3963c0[_0x51b8('0x20')]+_0x3963c0['limit'];var _0x38d14d;if(_0x2d3b75>=_0x5d1622){_0x2d3b75=_0x5d1622;_0x38d14d=0xc8;}else{_0x38d14d=0xce;}_0x14d372[_0x51b8('0x1b')](_0x38d14d);return _0x14d372[_0x51b8('0x21')](_0x51b8('0x22'),_0x45d450+'-'+_0x2d3b75+'/'+_0x5d1622)[_0x51b8('0x1d')](_0x2df933);}return null;};}function patchUpdates(_0x353a41){return function(_0x5bc40e){try{jsonpatch[_0x51b8('0x23')](_0x5bc40e,_0x353a41,!![]);}catch(_0x5e241d){return BPromise[_0x51b8('0x24')](_0x5e241d);}return _0x5bc40e[_0x51b8('0x25')]();};}function saveUpdates(_0x54c9e4,_0x23f4ff){return function(_0x12e902){if(_0x12e902){return _0x12e902[_0x51b8('0x26')](_0x54c9e4)['then'](function(_0x336ed2){return _0x336ed2;});}return null;};}function removeEntity(_0xd38044,_0x12f234){return function(_0x21245d){if(_0x21245d){return _0x21245d[_0x51b8('0x27')]()['then'](function(){_0xd38044[_0x51b8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d1e63,_0x4940f9){return function(_0x28cfde){if(!_0x28cfde){_0x5d1e63[_0x51b8('0x1a')](0x194);}return _0x28cfde;};}function handleError(_0x315e4c,_0x2aca32){_0x2aca32=_0x2aca32||0x1f4;return function(_0x50f8ed){logger[_0x51b8('0x28')](_0x50f8ed[_0x51b8('0x29')]);if(_0x50f8ed[_0x51b8('0x2a')]){delete _0x50f8ed[_0x51b8('0x2a')];}_0x315e4c[_0x51b8('0x1b')](_0x2aca32)[_0x51b8('0x2b')](_0x50f8ed);};}exports[_0x51b8('0x2c')]=function(_0x462126,_0x1dd62c){var _0x195ce8={},_0x3deeb3={},_0x23aa4b={'count':0x0,'rows':[]};var _0x1fc012=_[_0x51b8('0x2d')](db[_0x51b8('0x2e')][_0x51b8('0x2f')],function(_0x176bbb){return{'name':_0x176bbb[_0x51b8('0x30')],'type':_0x176bbb[_0x51b8('0x31')][_0x51b8('0x32')]};});_0x3deeb3['model']=_[_0x51b8('0x2d')](_0x1fc012,_0x51b8('0x2a'));_0x3deeb3[_0x51b8('0x33')]=_[_0x51b8('0x34')](_0x462126['query']);_0x3deeb3['filters']=_[_0x51b8('0x35')](_0x3deeb3[_0x51b8('0x36')],_0x3deeb3[_0x51b8('0x33')]);_0x195ce8[_0x51b8('0x37')]=_[_0x51b8('0x35')](_0x3deeb3[_0x51b8('0x36')],qs['fields'](_0x462126[_0x51b8('0x33')]['fields']));_0x195ce8['attributes']=_0x195ce8['attributes'][_0x51b8('0x38')]?_0x195ce8[_0x51b8('0x37')]:_0x3deeb3[_0x51b8('0x36')];if(!_0x462126[_0x51b8('0x33')]['hasOwnProperty'](_0x51b8('0x39'))){_0x195ce8[_0x51b8('0x1f')]=qs[_0x51b8('0x1f')](_0x462126[_0x51b8('0x33')][_0x51b8('0x1f')]);_0x195ce8[_0x51b8('0x20')]=qs[_0x51b8('0x20')](_0x462126[_0x51b8('0x33')][_0x51b8('0x20')]);}_0x195ce8[_0x51b8('0x3a')]=qs[_0x51b8('0x3b')](_0x462126['query'][_0x51b8('0x3b')]);_0x195ce8[_0x51b8('0x3c')]=qs[_0x51b8('0x3d')](_[_0x51b8('0x3e')](_0x462126[_0x51b8('0x33')],_0x3deeb3[_0x51b8('0x3d')]),_0x1fc012);if(_0x462126[_0x51b8('0x33')][_0x51b8('0x3f')]){_0x195ce8[_0x51b8('0x3c')]=_[_0x51b8('0x40')](_0x195ce8[_0x51b8('0x3c')],{'$or':_[_0x51b8('0x2d')](_0x1fc012,function(_0x4dd7cf){if(_0x4dd7cf[_0x51b8('0x31')]!=='VIRTUAL'){var _0x170d7a={};_0x170d7a[_0x4dd7cf[_0x51b8('0x2a')]]={'$like':'%'+_0x462126[_0x51b8('0x33')][_0x51b8('0x3f')]+'%'};return _0x170d7a;}})});}_0x195ce8=_[_0x51b8('0x40')]({},_0x195ce8,_0x462126[_0x51b8('0x41')]);var _0x3619a7={'where':_0x195ce8[_0x51b8('0x3c')]};return db[_0x51b8('0x2e')]['count'](_0x3619a7)[_0x51b8('0x42')](function(_0x28c170){_0x23aa4b[_0x51b8('0x43')]=_0x28c170;if(_0x462126[_0x51b8('0x33')][_0x51b8('0x44')]){_0x195ce8[_0x51b8('0x45')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x51b8('0x46')](_0x195ce8);})[_0x51b8('0x42')](function(_0x5b27ac){_0x23aa4b[_0x51b8('0x47')]=_0x5b27ac;return _0x23aa4b;})['then'](respondWithFilteredResult(_0x1dd62c,_0x195ce8))['catch'](handleError(_0x1dd62c,null));};exports[_0x51b8('0x48')]=function(_0x36faff,_0x5b5439){var _0x31ed58={'raw':![],'where':{'id':_0x36faff['params']['id']}},_0x5fe81={};_0x5fe81[_0x51b8('0x36')]=_[_0x51b8('0x34')](db[_0x51b8('0x2e')][_0x51b8('0x2f')]);_0x5fe81[_0x51b8('0x33')]=_[_0x51b8('0x34')](_0x36faff[_0x51b8('0x33')]);_0x5fe81['filters']=_[_0x51b8('0x35')](_0x5fe81[_0x51b8('0x36')],_0x5fe81[_0x51b8('0x33')]);_0x31ed58[_0x51b8('0x37')]=_[_0x51b8('0x35')](_0x5fe81[_0x51b8('0x36')],qs[_0x51b8('0x49')](_0x36faff[_0x51b8('0x33')][_0x51b8('0x49')]));_0x31ed58['attributes']=_0x31ed58[_0x51b8('0x37')][_0x51b8('0x38')]?_0x31ed58[_0x51b8('0x37')]:_0x5fe81[_0x51b8('0x36')];if(_0x36faff[_0x51b8('0x33')][_0x51b8('0x44')]){_0x31ed58['include']=[{'all':!![]}];}_0x31ed58=_[_0x51b8('0x40')]({},_0x31ed58,_0x36faff[_0x51b8('0x41')]);return db['SalesforceAccount'][_0x51b8('0x4a')](_0x31ed58)[_0x51b8('0x42')](handleEntityNotFound(_0x5b5439,null))['then'](respondWithResult(_0x5b5439,null))[_0x51b8('0x4b')](handleError(_0x5b5439,null));};exports[_0x51b8('0x4c')]=function(_0x409b53,_0x3058bc){return db['SalesforceAccount'][_0x51b8('0x4c')](_0x409b53['body'],{})[_0x51b8('0x42')](respondWithResult(_0x3058bc,0xc9))[_0x51b8('0x4b')](handleError(_0x3058bc,null));};exports[_0x51b8('0x26')]=function(_0x4644a3,_0x20623e){if(_0x4644a3['body']['id']){delete _0x4644a3[_0x51b8('0x4d')]['id'];}return db[_0x51b8('0x2e')][_0x51b8('0x4a')]({'where':{'id':_0x4644a3[_0x51b8('0x4e')]['id']}})[_0x51b8('0x42')](handleEntityNotFound(_0x20623e,null))[_0x51b8('0x42')](saveUpdates(_0x4644a3[_0x51b8('0x4d')],null))[_0x51b8('0x42')](respondWithResult(_0x20623e,null))['catch'](handleError(_0x20623e,null));};exports[_0x51b8('0x27')]=function(_0x7ba5b3,_0x364720){return db[_0x51b8('0x2e')][_0x51b8('0x4a')]({'where':{'id':_0x7ba5b3[_0x51b8('0x4e')]['id']}})[_0x51b8('0x42')](handleEntityNotFound(_0x364720,null))['then'](removeEntity(_0x364720,null))[_0x51b8('0x4b')](handleError(_0x364720,null));};exports[_0x51b8('0x4f')]=function(_0x102b03,_0x5e285b,_0x181bfa){var _0xfbeff9={};var _0x5669b1={};var _0xfcac10;var _0x13e160;return db['SalesforceAccount']['findOne']({'where':{'id':_0x102b03[_0x51b8('0x4e')]['id']}})[_0x51b8('0x42')](handleEntityNotFound(_0x5e285b,null))['then'](function(_0x1ca81f){if(_0x1ca81f){_0xfcac10=_0x1ca81f;_0x5669b1[_0x51b8('0x36')]=_[_0x51b8('0x34')](db[_0x51b8('0x50')][_0x51b8('0x2f')]);_0x5669b1[_0x51b8('0x33')]=_[_0x51b8('0x34')](_0x102b03[_0x51b8('0x33')]);_0x5669b1[_0x51b8('0x3d')]=_[_0x51b8('0x35')](_0x5669b1[_0x51b8('0x36')],_0x5669b1[_0x51b8('0x33')]);_0xfbeff9[_0x51b8('0x37')]=_[_0x51b8('0x35')](_0x5669b1[_0x51b8('0x36')],qs[_0x51b8('0x49')](_0x102b03[_0x51b8('0x33')][_0x51b8('0x49')]));_0xfbeff9[_0x51b8('0x37')]=_0xfbeff9[_0x51b8('0x37')][_0x51b8('0x38')]?_0xfbeff9[_0x51b8('0x37')]:_0x5669b1[_0x51b8('0x36')];_0xfbeff9['order']=qs[_0x51b8('0x3b')](_0x102b03['query'][_0x51b8('0x3b')]);_0xfbeff9[_0x51b8('0x3c')]=qs[_0x51b8('0x3d')](_[_0x51b8('0x3e')](_0x102b03[_0x51b8('0x33')],_0x5669b1[_0x51b8('0x3d')]));if(_0x102b03['query'][_0x51b8('0x3f')]){_0xfbeff9[_0x51b8('0x3c')]=_[_0x51b8('0x40')](_0xfbeff9[_0x51b8('0x3c')],{'$or':_['map'](_0xfbeff9[_0x51b8('0x37')],function(_0xdea287){var _0x59516b={};_0x59516b[_0xdea287]={'$like':'%'+_0x102b03['query'][_0x51b8('0x3f')]+'%'};return _0x59516b;})});}_0xfbeff9=_[_0x51b8('0x40')]({},_0xfbeff9,_0x102b03[_0x51b8('0x41')]);return _0xfcac10[_0x51b8('0x4f')](_0xfbeff9);}})[_0x51b8('0x42')](function(_0x56ed08){if(_0x56ed08){_0x13e160=_0x56ed08[_0x51b8('0x38')];if(!_0x102b03[_0x51b8('0x33')][_0x51b8('0x51')](_0x51b8('0x39'))){_0xfbeff9['limit']=qs[_0x51b8('0x1f')](_0x102b03[_0x51b8('0x33')][_0x51b8('0x1f')]);_0xfbeff9['offset']=qs['offset'](_0x102b03[_0x51b8('0x33')][_0x51b8('0x20')]);}return _0xfcac10[_0x51b8('0x4f')](_0xfbeff9);}})['then'](function(_0x2a5d56){if(_0x2a5d56){return _0x2a5d56?{'count':_0x13e160,'rows':_0x2a5d56}:null;}})[_0x51b8('0x42')](respondWithResult(_0x5e285b,null))[_0x51b8('0x4b')](handleError(_0x5e285b,null));};exports[_0x51b8('0x52')]=function(_0x195de8,_0x22543e,_0x4aef48){if(_0x195de8[_0x51b8('0x4d')]['id']){delete _0x195de8[_0x51b8('0x4d')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x195de8['params']['id']}})['then'](handleEntityNotFound(_0x22543e,null))[_0x51b8('0x42')](function(_0x3f60f4){if(_0x3f60f4){_0x195de8['body'][_0x51b8('0x53')]=_0x3f60f4['id'];_0x195de8[_0x51b8('0x4d')][_0x51b8('0x54')]=integrations[_0x51b8('0x55')](_0x195de8[_0x51b8('0x4d')][_0x51b8('0x56')],_0x195de8[_0x51b8('0x4d')][_0x51b8('0x31')]);_0x195de8[_0x51b8('0x4d')][_0x51b8('0x57')]=integrations[_0x51b8('0x58')](_0x195de8[_0x51b8('0x4d')][_0x51b8('0x56')],_0x195de8[_0x51b8('0x4d')][_0x51b8('0x31')]);return db['SalesforceConfiguration'][_0x51b8('0x4c')](_0x195de8[_0x51b8('0x4d')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x51b8('0x59')],'as':_0x51b8('0x57')}]});}return null;})['then'](respondWithResult(_0x22543e,null))['catch'](handleError(_0x22543e,null));};exports[_0x51b8('0x5a')]=function(_0x5166ef,_0x53d6b5,_0x274462){var _0x5ef052;var _0x1a73d1='';var _0x4eda5f='Task';return db[_0x51b8('0x2e')]['findOne']({'where':{'id':_0x5166ef[_0x51b8('0x4e')]['id']},'attributes':['id',_0x51b8('0x5b'),'clientId',_0x51b8('0x5c'),_0x51b8('0x5d'),'password','securityToken']})[_0x51b8('0x42')](handleEntityNotFound(_0x53d6b5,null))['then'](function(_0xc98c8e){if(_0xc98c8e){_0x1a73d1=_0xc98c8e['remoteUri'];var _0x112146=_0x1a73d1[_0x51b8('0x5e')](-0x1);if(_0x112146==='/'){_0x1a73d1=_0x1a73d1[_0x51b8('0x5f')](0x0,_0x1a73d1[_0x51b8('0x60')](_0x112146));}_0x5ef052=new jsforce[(_0x51b8('0x61'))]({'oauth2':{'loginUrl':_0x1a73d1,'clientId':_0xc98c8e[_0x51b8('0x62')],'clientSecret':_0xc98c8e['clientSecret']}});return _0x5ef052[_0x51b8('0x63')](_0xc98c8e[_0x51b8('0x5d')],_0xc98c8e[_0x51b8('0x64')][_0x51b8('0x65')](_0xc98c8e[_0x51b8('0x66')]));}})[_0x51b8('0x42')](function(_0xa295cf){if(_0xa295cf){if(!_['isNil'](_0x5166ef[_0x51b8('0x33')][_0x51b8('0x67')])){_0x4eda5f=_0x5166ef[_0x51b8('0x33')][_0x51b8('0x67')];}return _0x5ef052['sobject'](_0x4eda5f)[_0x51b8('0x68')]();}})[_0x51b8('0x42')](function(_0x1ad875){var _0x224ddc=[_0x51b8('0x69'),_0x51b8('0x6a'),_0x51b8('0x6b'),_0x51b8('0x6c'),'Subject',_0x51b8('0x6d')];var _0x10b9ec=[_0x51b8('0x6e'),_0x51b8('0x6f'),_0x51b8('0x70'),_0x51b8('0x71'),_0x51b8('0x72'),_0x51b8('0x73'),_0x51b8('0x74')];if(_0x1ad875){_[_0x51b8('0x75')](_0x1ad875[_0x51b8('0x49')],function(_0x3f4337){return _0x224ddc[_0x51b8('0x76')](_0x3f4337[_0x51b8('0x2a')])||!_0x10b9ec[_0x51b8('0x76')](_0x3f4337[_0x51b8('0x31')]);});return{'count':_0x1ad875[_0x51b8('0x49')][_0x51b8('0x38')],'rows':_[_0x51b8('0x2d')](_0x1ad875[_0x51b8('0x49')],function(_0x498add){return{'id':_0x498add['name'],'name':_0x498add[_0x51b8('0x77')],'custom':_0x498add[_0x51b8('0x78')],'options':_0x498add[_0x51b8('0x79')][_0x51b8('0x38')]>0x0?_[_0x51b8('0x2d')](_0x498add['picklistValues'],function(_0x1324a3){return{'name':_0x1324a3[_0x51b8('0x77')],'value':_0x1324a3['value']};}):_0x498add[_0x51b8('0x31')]=='boolean'?[{'name':'True','value':_0x51b8('0x7a')},{'name':_0x51b8('0x7b'),'value':_0x51b8('0x7c')}]:[]};})};}})[_0x51b8('0x42')](respondWithResult(_0x53d6b5,null))[_0x51b8('0x4b')](function(_0x5be6f0){var _0x23e146=_0x5166ef[_0x51b8('0x33')][_0x51b8('0x7d')]?0x1f4:_0x5be6f0[_0x51b8('0x7e')]||0x1f4;logger[_0x51b8('0x28')](_0x51b8('0x7f'),_0x51b8('0x5a'),_0x23e146,JSON['stringify'](_0x5be6f0));delete _0x5be6f0[_0x51b8('0x2a')];if(_0x23e146===0x191){_0x23e146=0x190;}_0x53d6b5['status'](_0x23e146)[_0x51b8('0x2b')](_0x5166ef[_0x51b8('0x33')]['test']?{'message':_0x51b8('0x80'),'statusCode':_0x5be6f0[_0x51b8('0x7e')]}:_0x5be6f0);});}; \ No newline at end of file +var _0x6f46=['picklistValues','value','True','true','False','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','statusCode','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','params','find','catch','create','update','body','getConfigurations','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Subjects','findOne','clientId','username','password','securityToken','slice','substring','clientSecret','ticketType','sobject','describe','OwnerId','Subject','Description','string','int','boolean','email','textarea','remove','includes','label','custom'];(function(_0x179444,_0x1bf117){var _0x50f4a=function(_0x25e0b8){while(--_0x25e0b8){_0x179444['push'](_0x179444['shift']());}};_0x50f4a(++_0x1bf117);}(_0x6f46,0x167));var _0x66f4=function(_0x42ab41,_0x3278cd){_0x42ab41=_0x42ab41-0x0;var _0x3794db=_0x6f46[_0x42ab41];return _0x3794db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x66f4('0x0'));var zipdir=require(_0x66f4('0x1'));var jsonpatch=require(_0x66f4('0x2'));var rp=require('request-promise');var moment=require(_0x66f4('0x3'));var BPromise=require(_0x66f4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x66f4('0x5'));var sox=require(_0x66f4('0x6'));var csv=require(_0x66f4('0x7'));var ejs=require(_0x66f4('0x8'));var fs=require('fs');var fs_extra=require(_0x66f4('0x9'));var _=require(_0x66f4('0xa'));var squel=require(_0x66f4('0xb'));var crypto=require(_0x66f4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x66f4('0xd'));var toCsv=require(_0x66f4('0x7'));var querystring=require('querystring');var Papa=require(_0x66f4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x66f4('0xf'));var as=require(_0x66f4('0x10'));var hardwareService=require(_0x66f4('0x11'));var logger=require(_0x66f4('0x12'))(_0x66f4('0x13'));var utils=require(_0x66f4('0x14'));var config=require(_0x66f4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x66f4('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x356e3c,_0xf357e5){_0xf357e5=_0xf357e5||0xcc;return function(_0x926df0){if(_0x926df0){return _0x356e3c['sendStatus'](_0xf357e5);}return _0x356e3c['status'](_0xf357e5)[_0x66f4('0x17')]();};}function respondWithResult(_0x18e987,_0x250039){_0x250039=_0x250039||0xc8;return function(_0x297a47){if(_0x297a47){return _0x18e987[_0x66f4('0x18')](_0x250039)[_0x66f4('0x19')](_0x297a47);}};}function respondWithFilteredResult(_0xa719bd,_0x2120fe){return function(_0x224808){if(_0x224808){var _0x439335=typeof _0x2120fe[_0x66f4('0x1a')]==='undefined'&&typeof _0x2120fe[_0x66f4('0x1b')]===_0x66f4('0x1c');var _0x4d58f3=_0x224808[_0x66f4('0x1d')];var _0x26fdd0=_0x439335?0x0:_0x2120fe['offset'];var _0x144cbe=_0x439335?_0x224808[_0x66f4('0x1d')]:_0x2120fe[_0x66f4('0x1a')]+_0x2120fe[_0x66f4('0x1b')];var _0x3437e3;if(_0x144cbe>=_0x4d58f3){_0x144cbe=_0x4d58f3;_0x3437e3=0xc8;}else{_0x3437e3=0xce;}_0xa719bd[_0x66f4('0x18')](_0x3437e3);return _0xa719bd[_0x66f4('0x1e')](_0x66f4('0x1f'),_0x26fdd0+'-'+_0x144cbe+'/'+_0x4d58f3)['json'](_0x224808);}return null;};}function patchUpdates(_0x51e870){return function(_0x2b8496){try{jsonpatch[_0x66f4('0x20')](_0x2b8496,_0x51e870,!![]);}catch(_0x41360b){return BPromise[_0x66f4('0x21')](_0x41360b);}return _0x2b8496[_0x66f4('0x22')]();};}function saveUpdates(_0x44a778,_0x40f62e){return function(_0x5522a1){if(_0x5522a1){return _0x5522a1['update'](_0x44a778)[_0x66f4('0x23')](function(_0x4ef576){return _0x4ef576;});}return null;};}function removeEntity(_0x280132,_0x5bf967){return function(_0x2ac6f9){if(_0x2ac6f9){return _0x2ac6f9[_0x66f4('0x24')]()[_0x66f4('0x23')](function(){_0x280132[_0x66f4('0x18')](0xcc)[_0x66f4('0x17')]();});}};}function handleEntityNotFound(_0x1d4a2b,_0x49f489){return function(_0x357fcd){if(!_0x357fcd){_0x1d4a2b[_0x66f4('0x25')](0x194);}return _0x357fcd;};}function handleError(_0x4b92c5,_0x3b954a){_0x3b954a=_0x3b954a||0x1f4;return function(_0x3286f4){logger['error'](_0x3286f4[_0x66f4('0x26')]);if(_0x3286f4[_0x66f4('0x27')]){delete _0x3286f4[_0x66f4('0x27')];}_0x4b92c5[_0x66f4('0x18')](_0x3b954a)[_0x66f4('0x28')](_0x3286f4);};}exports[_0x66f4('0x29')]=function(_0x3c8b5c,_0x244723){var _0x14bd88={},_0x246d44={},_0x237c6d={'count':0x0,'rows':[]};var _0x59c59b=_[_0x66f4('0x2a')](db[_0x66f4('0x2b')][_0x66f4('0x2c')],function(_0x39061e){return{'name':_0x39061e[_0x66f4('0x2d')],'type':_0x39061e['type']['key']};});_0x246d44[_0x66f4('0x2e')]=_[_0x66f4('0x2a')](_0x59c59b,'name');_0x246d44[_0x66f4('0x2f')]=_[_0x66f4('0x30')](_0x3c8b5c[_0x66f4('0x2f')]);_0x246d44[_0x66f4('0x31')]=_['intersection'](_0x246d44[_0x66f4('0x2e')],_0x246d44[_0x66f4('0x2f')]);_0x14bd88['attributes']=_[_0x66f4('0x32')](_0x246d44[_0x66f4('0x2e')],qs['fields'](_0x3c8b5c[_0x66f4('0x2f')][_0x66f4('0x33')]));_0x14bd88[_0x66f4('0x34')]=_0x14bd88[_0x66f4('0x34')][_0x66f4('0x35')]?_0x14bd88[_0x66f4('0x34')]:_0x246d44[_0x66f4('0x2e')];if(!_0x3c8b5c[_0x66f4('0x2f')][_0x66f4('0x36')](_0x66f4('0x37'))){_0x14bd88[_0x66f4('0x1b')]=qs['limit'](_0x3c8b5c[_0x66f4('0x2f')][_0x66f4('0x1b')]);_0x14bd88[_0x66f4('0x1a')]=qs[_0x66f4('0x1a')](_0x3c8b5c['query'][_0x66f4('0x1a')]);}_0x14bd88[_0x66f4('0x38')]=qs[_0x66f4('0x39')](_0x3c8b5c['query'][_0x66f4('0x39')]);_0x14bd88['where']=qs[_0x66f4('0x31')](_[_0x66f4('0x3a')](_0x3c8b5c['query'],_0x246d44['filters']),_0x59c59b);if(_0x3c8b5c['query'][_0x66f4('0x3b')]){_0x14bd88[_0x66f4('0x3c')]=_[_0x66f4('0x3d')](_0x14bd88[_0x66f4('0x3c')],{'$or':_[_0x66f4('0x2a')](_0x59c59b,function(_0x525b67){if(_0x525b67[_0x66f4('0x3e')]!=='VIRTUAL'){var _0xf8c3d2={};_0xf8c3d2[_0x525b67[_0x66f4('0x27')]]={'$like':'%'+_0x3c8b5c[_0x66f4('0x2f')]['filter']+'%'};return _0xf8c3d2;}})});}_0x14bd88=_[_0x66f4('0x3d')]({},_0x14bd88,_0x3c8b5c[_0x66f4('0x3f')]);var _0x530acc={'where':_0x14bd88['where']};return db[_0x66f4('0x2b')]['count'](_0x530acc)[_0x66f4('0x23')](function(_0xbc66bc){_0x237c6d[_0x66f4('0x1d')]=_0xbc66bc;if(_0x3c8b5c[_0x66f4('0x2f')][_0x66f4('0x40')]){_0x14bd88[_0x66f4('0x41')]=[{'all':!![]}];}return db[_0x66f4('0x2b')][_0x66f4('0x42')](_0x14bd88);})[_0x66f4('0x23')](function(_0x361968){_0x237c6d[_0x66f4('0x43')]=_0x361968;return _0x237c6d;})[_0x66f4('0x23')](respondWithFilteredResult(_0x244723,_0x14bd88))['catch'](handleError(_0x244723,null));};exports['show']=function(_0x40f403,_0x764b93){var _0x3a0cc4={'raw':![],'where':{'id':_0x40f403[_0x66f4('0x44')]['id']}},_0x2711e0={};_0x2711e0['model']=_[_0x66f4('0x30')](db['SalesforceAccount']['rawAttributes']);_0x2711e0['query']=_[_0x66f4('0x30')](_0x40f403[_0x66f4('0x2f')]);_0x2711e0[_0x66f4('0x31')]=_[_0x66f4('0x32')](_0x2711e0[_0x66f4('0x2e')],_0x2711e0[_0x66f4('0x2f')]);_0x3a0cc4['attributes']=_['intersection'](_0x2711e0[_0x66f4('0x2e')],qs['fields'](_0x40f403[_0x66f4('0x2f')]['fields']));_0x3a0cc4['attributes']=_0x3a0cc4[_0x66f4('0x34')][_0x66f4('0x35')]?_0x3a0cc4[_0x66f4('0x34')]:_0x2711e0[_0x66f4('0x2e')];if(_0x40f403[_0x66f4('0x2f')][_0x66f4('0x40')]){_0x3a0cc4[_0x66f4('0x41')]=[{'all':!![]}];}_0x3a0cc4=_['merge']({},_0x3a0cc4,_0x40f403[_0x66f4('0x3f')]);return db['SalesforceAccount'][_0x66f4('0x45')](_0x3a0cc4)[_0x66f4('0x23')](handleEntityNotFound(_0x764b93,null))['then'](respondWithResult(_0x764b93,null))[_0x66f4('0x46')](handleError(_0x764b93,null));};exports[_0x66f4('0x47')]=function(_0x2107f3,_0x5993a0){return db[_0x66f4('0x2b')][_0x66f4('0x47')](_0x2107f3['body'],{})[_0x66f4('0x23')](respondWithResult(_0x5993a0,0xc9))['catch'](handleError(_0x5993a0,null));};exports[_0x66f4('0x48')]=function(_0x48883e,_0x358cc4){if(_0x48883e[_0x66f4('0x49')]['id']){delete _0x48883e[_0x66f4('0x49')]['id'];}return db[_0x66f4('0x2b')][_0x66f4('0x45')]({'where':{'id':_0x48883e[_0x66f4('0x44')]['id']}})[_0x66f4('0x23')](handleEntityNotFound(_0x358cc4,null))[_0x66f4('0x23')](saveUpdates(_0x48883e[_0x66f4('0x49')],null))[_0x66f4('0x23')](respondWithResult(_0x358cc4,null))[_0x66f4('0x46')](handleError(_0x358cc4,null));};exports[_0x66f4('0x24')]=function(_0x229efb,_0x2840a7){return db['SalesforceAccount'][_0x66f4('0x45')]({'where':{'id':_0x229efb[_0x66f4('0x44')]['id']}})[_0x66f4('0x23')](handleEntityNotFound(_0x2840a7,null))[_0x66f4('0x23')](removeEntity(_0x2840a7,null))[_0x66f4('0x46')](handleError(_0x2840a7,null));};exports[_0x66f4('0x4a')]=function(_0x3f2283,_0x341129,_0x4c8ccf){var _0x3bfd34={};var _0x216cd5={};var _0xf500e0;var _0x2716fc;return db[_0x66f4('0x2b')]['findOne']({'where':{'id':_0x3f2283[_0x66f4('0x44')]['id']}})[_0x66f4('0x23')](handleEntityNotFound(_0x341129,null))['then'](function(_0x2c353c){if(_0x2c353c){_0xf500e0=_0x2c353c;_0x216cd5[_0x66f4('0x2e')]=_['keys'](db['SalesforceConfiguration'][_0x66f4('0x2c')]);_0x216cd5[_0x66f4('0x2f')]=_[_0x66f4('0x30')](_0x3f2283['query']);_0x216cd5['filters']=_[_0x66f4('0x32')](_0x216cd5[_0x66f4('0x2e')],_0x216cd5[_0x66f4('0x2f')]);_0x3bfd34[_0x66f4('0x34')]=_['intersection'](_0x216cd5[_0x66f4('0x2e')],qs['fields'](_0x3f2283[_0x66f4('0x2f')][_0x66f4('0x33')]));_0x3bfd34[_0x66f4('0x34')]=_0x3bfd34[_0x66f4('0x34')][_0x66f4('0x35')]?_0x3bfd34[_0x66f4('0x34')]:_0x216cd5[_0x66f4('0x2e')];_0x3bfd34[_0x66f4('0x38')]=qs['sort'](_0x3f2283[_0x66f4('0x2f')]['sort']);_0x3bfd34['where']=qs[_0x66f4('0x31')](_[_0x66f4('0x3a')](_0x3f2283['query'],_0x216cd5[_0x66f4('0x31')]));if(_0x3f2283[_0x66f4('0x2f')][_0x66f4('0x3b')]){_0x3bfd34['where']=_['merge'](_0x3bfd34[_0x66f4('0x3c')],{'$or':_[_0x66f4('0x2a')](_0x3bfd34[_0x66f4('0x34')],function(_0x19a70e){var _0x3467bf={};_0x3467bf[_0x19a70e]={'$like':'%'+_0x3f2283[_0x66f4('0x2f')]['filter']+'%'};return _0x3467bf;})});}_0x3bfd34=_[_0x66f4('0x3d')]({},_0x3bfd34,_0x3f2283['options']);return _0xf500e0[_0x66f4('0x4a')](_0x3bfd34);}})[_0x66f4('0x23')](function(_0x43fdb2){if(_0x43fdb2){_0x2716fc=_0x43fdb2[_0x66f4('0x35')];if(!_0x3f2283[_0x66f4('0x2f')][_0x66f4('0x36')]('nolimit')){_0x3bfd34[_0x66f4('0x1b')]=qs[_0x66f4('0x1b')](_0x3f2283['query'][_0x66f4('0x1b')]);_0x3bfd34['offset']=qs[_0x66f4('0x1a')](_0x3f2283[_0x66f4('0x2f')][_0x66f4('0x1a')]);}return _0xf500e0['getConfigurations'](_0x3bfd34);}})[_0x66f4('0x23')](function(_0x50dfce){if(_0x50dfce){return _0x50dfce?{'count':_0x2716fc,'rows':_0x50dfce}:null;}})[_0x66f4('0x23')](respondWithResult(_0x341129,null))[_0x66f4('0x46')](handleError(_0x341129,null));};exports['addConfiguration']=function(_0x2c6ea5,_0x42553c,_0x2a77b1){if(_0x2c6ea5[_0x66f4('0x49')]['id']){delete _0x2c6ea5['body']['id'];}return db[_0x66f4('0x2b')]['findOne']({'where':{'id':_0x2c6ea5[_0x66f4('0x44')]['id']}})[_0x66f4('0x23')](handleEntityNotFound(_0x42553c,null))[_0x66f4('0x23')](function(_0x55144a){if(_0x55144a){_0x2c6ea5[_0x66f4('0x49')]['AccountId']=_0x55144a['id'];_0x2c6ea5[_0x66f4('0x49')]['Subjects']=integrations[_0x66f4('0x4b')](_0x2c6ea5[_0x66f4('0x49')][_0x66f4('0x4c')],_0x2c6ea5[_0x66f4('0x49')]['type']);_0x2c6ea5[_0x66f4('0x49')][_0x66f4('0x4d')]=integrations[_0x66f4('0x4e')](_0x2c6ea5[_0x66f4('0x49')][_0x66f4('0x4c')],_0x2c6ea5[_0x66f4('0x49')][_0x66f4('0x3e')]);return db[_0x66f4('0x4f')][_0x66f4('0x47')](_0x2c6ea5['body'],{'include':[{'model':db[_0x66f4('0x50')],'as':_0x66f4('0x51')},{'model':db[_0x66f4('0x50')],'as':_0x66f4('0x4d')}]});}return null;})[_0x66f4('0x23')](respondWithResult(_0x42553c,null))[_0x66f4('0x46')](handleError(_0x42553c,null));};exports['getFields']=function(_0x10a3aa,_0xc0c81a,_0x4f2db9){var _0x45e68e;var _0x6ec365='';var _0x58a595='Task';return db[_0x66f4('0x2b')][_0x66f4('0x52')]({'where':{'id':_0x10a3aa[_0x66f4('0x44')]['id']},'attributes':['id','remoteUri',_0x66f4('0x53'),'clientSecret',_0x66f4('0x54'),_0x66f4('0x55'),_0x66f4('0x56')]})['then'](handleEntityNotFound(_0xc0c81a,null))['then'](function(_0x5bacb5){if(_0x5bacb5){_0x6ec365=_0x5bacb5['remoteUri'];var _0x4d946c=_0x6ec365[_0x66f4('0x57')](-0x1);if(_0x4d946c==='/'){_0x6ec365=_0x6ec365[_0x66f4('0x58')](0x0,_0x6ec365['lastIndexOf'](_0x4d946c));}_0x45e68e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x6ec365,'clientId':_0x5bacb5[_0x66f4('0x53')],'clientSecret':_0x5bacb5[_0x66f4('0x59')]}});return _0x45e68e['login'](_0x5bacb5[_0x66f4('0x54')],_0x5bacb5[_0x66f4('0x55')]['concat'](_0x5bacb5[_0x66f4('0x56')]));}})[_0x66f4('0x23')](function(_0x4fdd16){if(_0x4fdd16){if(!_['isNil'](_0x10a3aa[_0x66f4('0x2f')][_0x66f4('0x5a')])){_0x58a595=_0x10a3aa[_0x66f4('0x2f')][_0x66f4('0x5a')];}return _0x45e68e[_0x66f4('0x5b')](_0x58a595)[_0x66f4('0x5c')]();}})[_0x66f4('0x23')](function(_0x410ae7){var _0x287bd1=[_0x66f4('0x5d'),'ActivityDate','IsReminderSet','IsRecurrence',_0x66f4('0x5e'),_0x66f4('0x5f')];var _0x5e8b15=[_0x66f4('0x60'),_0x66f4('0x61'),'picklist',_0x66f4('0x62'),_0x66f4('0x63'),_0x66f4('0x64'),'phone'];if(_0x410ae7){_[_0x66f4('0x65')](_0x410ae7['fields'],function(_0x5b7a28){return _0x287bd1[_0x66f4('0x66')](_0x5b7a28['name'])||!_0x5e8b15[_0x66f4('0x66')](_0x5b7a28['type']);});return{'count':_0x410ae7['fields'][_0x66f4('0x35')],'rows':_[_0x66f4('0x2a')](_0x410ae7['fields'],function(_0x178704){return{'id':_0x178704[_0x66f4('0x27')],'name':_0x178704[_0x66f4('0x67')],'custom':_0x178704[_0x66f4('0x68')],'options':_0x178704[_0x66f4('0x69')][_0x66f4('0x35')]>0x0?_[_0x66f4('0x2a')](_0x178704[_0x66f4('0x69')],function(_0x5da5f0){return{'name':_0x5da5f0['label'],'value':_0x5da5f0[_0x66f4('0x6a')]};}):_0x178704[_0x66f4('0x3e')]==_0x66f4('0x62')?[{'name':_0x66f4('0x6b'),'value':_0x66f4('0x6c')},{'name':_0x66f4('0x6d'),'value':'false'}]:[]};})};}})[_0x66f4('0x23')](respondWithResult(_0xc0c81a,null))['catch'](function(_0x3f97a5){var _0x3ee773=_0x10a3aa[_0x66f4('0x2f')][_0x66f4('0x6e')]?0x1f4:_0x3f97a5['statusCode']||0x1f4;logger[_0x66f4('0x6f')](_0x66f4('0x70'),_0x66f4('0x71'),_0x3ee773,JSON[_0x66f4('0x72')](_0x3f97a5));delete _0x3f97a5[_0x66f4('0x27')];if(_0x3ee773===0x191){_0x3ee773=0x190;}_0xc0c81a[_0x66f4('0x18')](_0x3ee773)[_0x66f4('0x28')](_0x10a3aa[_0x66f4('0x2f')][_0x66f4('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x3f97a5[_0x66f4('0x73')]}:_0x3f97a5);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 7514028..0e4732b 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 _0x0c08=['../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x24a737,_0x3ff299){var _0x37b618=function(_0x3f0b2f){while(--_0x3f0b2f){_0x24a737['push'](_0x24a737['shift']());}};_0x37b618(++_0x3ff299);}(_0x0c08,0x1e6));var _0x80c0=function(_0x45d5ef,_0x10c29b){_0x45d5ef=_0x45d5ef-0x0;var _0x474d19=_0x0c08[_0x45d5ef];return _0x474d19;};'use strict';var _=require(_0x80c0('0x0'));var util=require(_0x80c0('0x1'));var logger=require('../../config/logger')(_0x80c0('0x2'));var moment=require(_0x80c0('0x3'));var BPromise=require(_0x80c0('0x4'));var rp=require(_0x80c0('0x5'));var fs=require('fs');var path=require(_0x80c0('0x6'));var rimraf=require('rimraf');var config=require(_0x80c0('0x7'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x80c0('0x8'));module[_0x80c0('0x9')]=function(_0x530251,_0x289745){return _0x530251[_0x80c0('0xa')](_0x80c0('0xb'),attributes,{'tableName':_0x80c0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf84=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','lodash','util'];(function(_0xbf23b4,_0x14c39c){var _0x24dfb2=function(_0x5abaac){while(--_0x5abaac){_0xbf23b4['push'](_0xbf23b4['shift']());}};_0x24dfb2(++_0x14c39c);}(_0xbf84,0x16a));var _0x4bf8=function(_0x53806d,_0x42fd3b){_0x53806d=_0x53806d-0x0;var _0x2cbadd=_0xbf84[_0x53806d];return _0x2cbadd;};'use strict';var _=require(_0x4bf8('0x0'));var util=require(_0x4bf8('0x1'));var logger=require(_0x4bf8('0x2'))(_0x4bf8('0x3'));var moment=require('moment');var BPromise=require(_0x4bf8('0x4'));var rp=require(_0x4bf8('0x5'));var fs=require('fs');var path=require(_0x4bf8('0x6'));var rimraf=require(_0x4bf8('0x7'));var config=require(_0x4bf8('0x8'));var attributes=require(_0x4bf8('0x9'));var integrations=require(_0x4bf8('0xa'));module['exports']=function(_0x352f50,_0x535ab7){return _0x352f50[_0x4bf8('0xb')]('SalesforceAccount',attributes,{'tableName':_0x4bf8('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 476c5ff..a6114a8 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 _0x97e4=['limit','include','map','model','attributes','then','debug','ShowSalesforceAccount','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where'];(function(_0xd99c22,_0x579862){var _0xbbb9e5=function(_0x1e7394){while(--_0x1e7394){_0xd99c22['push'](_0xd99c22['shift']());}};_0xbbb9e5(++_0x579862);}(_0x97e4,0x13f));var _0x497e=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x97e4[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x497e('0x0'));var util=require('util');var moment=require(_0x497e('0x1'));var BPromise=require(_0x497e('0x2'));var rs=require(_0x497e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x497e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x497e('0x5'))(_0x497e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x497e('0x7')][_0x497e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x375d2a,_0x4be8c9,_0x578f33){return new BPromise(function(_0x5800eb,_0x5953aa){return client['request'](_0x375d2a,_0x578f33)['then'](function(_0x3c8f9a){logger[_0x497e('0x9')](_0x497e('0xa'),_0x4be8c9,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4be8c9,_0x497e('0xb'),JSON[_0x497e('0xc')](_0x3c8f9a));if(_0x3c8f9a[_0x497e('0xd')]){if(_0x3c8f9a['error']['code']===0x1f4){logger[_0x497e('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x4be8c9,_0x3c8f9a['error'][_0x497e('0xe')]);return _0x5953aa(_0x3c8f9a['error'][_0x497e('0xe')]);}logger[_0x497e('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x4be8c9,_0x3c8f9a[_0x497e('0xd')][_0x497e('0xe')]);return _0x5800eb(_0x3c8f9a[_0x497e('0xd')]['message']);}else{logger[_0x497e('0x9')](_0x497e('0xa'),_0x4be8c9,_0x497e('0xb'));_0x5800eb(_0x3c8f9a['result']['message']);}})[_0x497e('0xf')](function(_0xbd6b91){logger[_0x497e('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x4be8c9,_0xbd6b91);_0x5953aa(_0xbd6b91);});});}exports[_0x497e('0x10')]=function(_0x42ab9b){var _0x4b3da5=this;return new Promise(function(_0x2bd315,_0x8b7601){return db[_0x497e('0x11')][_0x497e('0x12')]({'raw':_0x42ab9b['options']?_0x42ab9b[_0x497e('0x13')][_0x497e('0x14')]===undefined?!![]:![]:!![],'where':_0x42ab9b[_0x497e('0x13')]?_0x42ab9b[_0x497e('0x13')][_0x497e('0x15')]||null:null,'attributes':_0x42ab9b['options']?_0x42ab9b['options']['attributes']||null:null,'limit':_0x42ab9b['options']?_0x42ab9b[_0x497e('0x13')][_0x497e('0x16')]||null:null,'include':_0x42ab9b['options']?_0x42ab9b[_0x497e('0x13')][_0x497e('0x17')]?_[_0x497e('0x18')](_0x42ab9b[_0x497e('0x13')][_0x497e('0x17')],function(_0x3bf5d5){return{'model':db[_0x3bf5d5[_0x497e('0x19')]],'as':_0x3bf5d5['as'],'attributes':_0x3bf5d5['attributes'],'include':_0x3bf5d5[_0x497e('0x17')]?_[_0x497e('0x18')](_0x3bf5d5[_0x497e('0x17')],function(_0x55410c){return{'model':db[_0x55410c[_0x497e('0x19')]],'as':_0x55410c['as'],'attributes':_0x55410c['attributes'],'include':_0x55410c['include']?_[_0x497e('0x18')](_0x55410c[_0x497e('0x17')],function(_0x47a0f2){return{'model':db[_0x47a0f2['model']],'as':_0x47a0f2['as'],'attributes':_0x47a0f2[_0x497e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x497e('0x1b')](function(_0x216ebc){logger[_0x497e('0x9')]('GetSalesforceAccount',_0x42ab9b);logger[_0x497e('0x1c')](_0x497e('0x10'),_0x42ab9b,JSON[_0x497e('0xc')](_0x216ebc));_0x2bd315(_0x216ebc);})[_0x497e('0xf')](function(_0x2fe6e4){logger[_0x497e('0xd')](_0x497e('0x10'),_0x2fe6e4[_0x497e('0xe')],_0x42ab9b);_0x8b7601(_0x4b3da5[_0x497e('0xd')](0x1f4,_0x2fe6e4[_0x497e('0xe')]));});});};exports[_0x497e('0x1d')]=function(_0x322ca2){var _0x376a3f=this;return new Promise(function(_0x81f803,_0xd64c57){return db[_0x497e('0x11')][_0x497e('0x1e')]({'raw':_0x322ca2[_0x497e('0x13')]?_0x322ca2[_0x497e('0x13')][_0x497e('0x14')]===undefined?!![]:![]:!![],'where':_0x322ca2[_0x497e('0x13')]?_0x322ca2[_0x497e('0x13')][_0x497e('0x15')]||null:null,'attributes':_0x322ca2[_0x497e('0x13')]?_0x322ca2['options']['attributes']||null:null,'include':_0x322ca2['options']?_0x322ca2['options'][_0x497e('0x17')]?_['map'](_0x322ca2[_0x497e('0x13')][_0x497e('0x17')],function(_0x4bc1c5){return{'model':db[_0x4bc1c5[_0x497e('0x19')]],'as':_0x4bc1c5['as'],'attributes':_0x4bc1c5[_0x497e('0x1a')],'include':_0x4bc1c5[_0x497e('0x17')]?_[_0x497e('0x18')](_0x4bc1c5['include'],function(_0x351368){return{'model':db[_0x351368['model']],'as':_0x351368['as'],'attributes':_0x351368[_0x497e('0x1a')],'include':_0x351368[_0x497e('0x17')]?_['map'](_0x351368[_0x497e('0x17')],function(_0x24f8cf){return{'model':db[_0x24f8cf[_0x497e('0x19')]],'as':_0x24f8cf['as'],'attributes':_0x24f8cf[_0x497e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41236b){logger[_0x497e('0x9')](_0x497e('0x1d'),_0x322ca2);logger[_0x497e('0x1c')](_0x497e('0x1d'),_0x322ca2,JSON[_0x497e('0xc')](_0x41236b));_0x81f803(_0x41236b);})[_0x497e('0xf')](function(_0x2c6843){logger[_0x497e('0xd')](_0x497e('0x1d'),_0x2c6843[_0x497e('0xe')],_0x322ca2);_0xd64c57(_0x376a3f[_0x497e('0xd')](0x1f4,_0x2c6843[_0x497e('0xe')]));});});}; \ No newline at end of file +var _0x9d61=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','SalesforceAccount','findAll','options','where','attributes','limit','include','map','model','GetSalesforceAccount','catch','find','raw','ShowSalesforceAccount','lodash','util','moment','randomstring','ioredis'];(function(_0x48b387,_0x2f7950){var _0x435f48=function(_0xd943c){while(--_0xd943c){_0x48b387['push'](_0x48b387['shift']());}};_0x435f48(++_0x2f7950);}(_0x9d61,0xbe));var _0x19d6=function(_0x37e01e,_0x2c01f6){_0x37e01e=_0x37e01e-0x0;var _0x2f262b=_0x9d61[_0x37e01e];return _0x2f262b;};'use strict';var _=require(_0x19d6('0x0'));var util=require(_0x19d6('0x1'));var moment=require(_0x19d6('0x2'));var BPromise=require('bluebird');var rs=require(_0x19d6('0x3'));var fs=require('fs');var Redis=require(_0x19d6('0x4'));var db=require(_0x19d6('0x5'))['db'];var utils=require(_0x19d6('0x6'));var logger=require(_0x19d6('0x7'))(_0x19d6('0x8'));var config=require(_0x19d6('0x9'));var jayson=require(_0x19d6('0xa'));var client=jayson[_0x19d6('0xb')][_0x19d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x60a688,_0x593900,_0x4acea6){return new BPromise(function(_0x4cce5a,_0x55238d){return client[_0x19d6('0xd')](_0x60a688,_0x4acea6)[_0x19d6('0xe')](function(_0x31b54e){logger['info'](_0x19d6('0xf'),_0x593900,_0x19d6('0x10'));logger[_0x19d6('0x11')](_0x19d6('0x12'),_0x593900,_0x19d6('0x10'),JSON[_0x19d6('0x13')](_0x31b54e));if(_0x31b54e[_0x19d6('0x14')]){if(_0x31b54e['error'][_0x19d6('0x15')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x593900,_0x31b54e['error'][_0x19d6('0x16')]);return _0x55238d(_0x31b54e[_0x19d6('0x14')][_0x19d6('0x16')]);}logger[_0x19d6('0x14')](_0x19d6('0xf'),_0x593900,_0x31b54e[_0x19d6('0x14')][_0x19d6('0x16')]);return _0x4cce5a(_0x31b54e[_0x19d6('0x14')][_0x19d6('0x16')]);}else{logger[_0x19d6('0x17')](_0x19d6('0xf'),_0x593900,_0x19d6('0x10'));_0x4cce5a(_0x31b54e[_0x19d6('0x18')]['message']);}})['catch'](function(_0x8fb3ca){logger[_0x19d6('0x14')](_0x19d6('0xf'),_0x593900,_0x8fb3ca);_0x55238d(_0x8fb3ca);});});}exports['GetSalesforceAccount']=function(_0x3a4cfc){var _0x5c1b3b=this;return new Promise(function(_0x2f8336,_0x229e1b){return db[_0x19d6('0x19')][_0x19d6('0x1a')]({'raw':_0x3a4cfc[_0x19d6('0x1b')]?_0x3a4cfc[_0x19d6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3a4cfc[_0x19d6('0x1b')]?_0x3a4cfc[_0x19d6('0x1b')][_0x19d6('0x1c')]||null:null,'attributes':_0x3a4cfc['options']?_0x3a4cfc[_0x19d6('0x1b')][_0x19d6('0x1d')]||null:null,'limit':_0x3a4cfc[_0x19d6('0x1b')]?_0x3a4cfc[_0x19d6('0x1b')][_0x19d6('0x1e')]||null:null,'include':_0x3a4cfc[_0x19d6('0x1b')]?_0x3a4cfc[_0x19d6('0x1b')][_0x19d6('0x1f')]?_[_0x19d6('0x20')](_0x3a4cfc['options'][_0x19d6('0x1f')],function(_0x3a6b77){return{'model':db[_0x3a6b77[_0x19d6('0x21')]],'as':_0x3a6b77['as'],'attributes':_0x3a6b77[_0x19d6('0x1d')],'include':_0x3a6b77['include']?_[_0x19d6('0x20')](_0x3a6b77['include'],function(_0x121ce8){return{'model':db[_0x121ce8[_0x19d6('0x21')]],'as':_0x121ce8['as'],'attributes':_0x121ce8[_0x19d6('0x1d')],'include':_0x121ce8[_0x19d6('0x1f')]?_['map'](_0x121ce8['include'],function(_0x45fe67){return{'model':db[_0x45fe67[_0x19d6('0x21')]],'as':_0x45fe67['as'],'attributes':_0x45fe67['attributes']};}):[]};}):[]};}):[]:[]})[_0x19d6('0xe')](function(_0x133ecb){logger[_0x19d6('0x17')](_0x19d6('0x22'),_0x3a4cfc);logger['debug'](_0x19d6('0x22'),_0x3a4cfc,JSON[_0x19d6('0x13')](_0x133ecb));_0x2f8336(_0x133ecb);})[_0x19d6('0x23')](function(_0xeff08c){logger[_0x19d6('0x14')](_0x19d6('0x22'),_0xeff08c[_0x19d6('0x16')],_0x3a4cfc);_0x229e1b(_0x5c1b3b[_0x19d6('0x14')](0x1f4,_0xeff08c['message']));});});};exports['ShowSalesforceAccount']=function(_0x4dc800){var _0x34592a=this;return new Promise(function(_0x44ca6d,_0x1f3234){return db['SalesforceAccount'][_0x19d6('0x24')]({'raw':_0x4dc800[_0x19d6('0x1b')]?_0x4dc800[_0x19d6('0x1b')][_0x19d6('0x25')]===undefined?!![]:![]:!![],'where':_0x4dc800[_0x19d6('0x1b')]?_0x4dc800[_0x19d6('0x1b')]['where']||null:null,'attributes':_0x4dc800[_0x19d6('0x1b')]?_0x4dc800[_0x19d6('0x1b')][_0x19d6('0x1d')]||null:null,'include':_0x4dc800[_0x19d6('0x1b')]?_0x4dc800['options'][_0x19d6('0x1f')]?_['map'](_0x4dc800[_0x19d6('0x1b')]['include'],function(_0x23d1a6){return{'model':db[_0x23d1a6[_0x19d6('0x21')]],'as':_0x23d1a6['as'],'attributes':_0x23d1a6['attributes'],'include':_0x23d1a6[_0x19d6('0x1f')]?_[_0x19d6('0x20')](_0x23d1a6['include'],function(_0x47c056){return{'model':db[_0x47c056[_0x19d6('0x21')]],'as':_0x47c056['as'],'attributes':_0x47c056[_0x19d6('0x1d')],'include':_0x47c056[_0x19d6('0x1f')]?_[_0x19d6('0x20')](_0x47c056['include'],function(_0x3948bd){return{'model':db[_0x3948bd['model']],'as':_0x3948bd['as'],'attributes':_0x3948bd['attributes']};}):[]};}):[]};}):[]:[]})[_0x19d6('0xe')](function(_0x52986f){logger['info'](_0x19d6('0x26'),_0x4dc800);logger['debug'](_0x19d6('0x26'),_0x4dc800,JSON[_0x19d6('0x13')](_0x52986f));_0x44ca6d(_0x52986f);})[_0x19d6('0x23')](function(_0x4b2a93){logger['error'](_0x19d6('0x26'),_0x4b2a93[_0x19d6('0x16')],_0x4dc800);_0x1f3234(_0x34592a[_0x19d6('0x14')](0x1f4,_0x4b2a93[_0x19d6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 1dd82ec..595cd80 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(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x0b0e[_0x189305];return _0xea3406;};'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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x5dc4c7,_0x39132d){var _0x3255a9=function(_0xd9e717){while(--_0xd9e717){_0x5dc4c7['push'](_0x5dc4c7['shift']());}};_0x3255a9(++_0x39132d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 8b334e8..bbb59ec 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 _0x19cb=['sequelize','exports','STRING','ENUM','Task','contact_lead','lead','account_contact_lead','account','contact'];(function(_0x4bf5fd,_0x21a61f){var _0xaa79ab=function(_0x5c06e7){while(--_0x5c06e7){_0x4bf5fd['push'](_0x4bf5fd['shift']());}};_0xaa79ab(++_0x21a61f);}(_0x19cb,0x1cc));var _0xb19c=function(_0x40186c,_0x9637c8){_0x40186c=_0x40186c-0x0;var _0x5ef94d=_0x19cb[_0x40186c];return _0x5ef94d;};'use strict';var Sequelize=require(_0xb19c('0x0'));module[_0xb19c('0x1')]={'name':{'type':Sequelize[_0xb19c('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xb19c('0x3')](_0xb19c('0x4'),'Case'),'defaultValue':_0xb19c('0x4')},'moduleSearch':{'type':Sequelize[_0xb19c('0x3')](_0xb19c('0x5'),'contact',_0xb19c('0x6'),_0xb19c('0x7'),_0xb19c('0x8')),'defaultValue':_0xb19c('0x5')},'moduleCreate':{'type':Sequelize[_0xb19c('0x3')]('nothing',_0xb19c('0x9'),_0xb19c('0x6'),_0xb19c('0x8')),'defaultValue':_0xb19c('0x6')},'leadId':{'type':Sequelize[_0xb19c('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xb19c('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xb19c('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x97ca=['STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead','nothing','sequelize','exports'];(function(_0x494f7f,_0x34a09b){var _0x18ebe4=function(_0x178e2e){while(--_0x178e2e){_0x494f7f['push'](_0x494f7f['shift']());}};_0x18ebe4(++_0x34a09b);}(_0x97ca,0x18e));var _0xa97c=function(_0x3a115e,_0x3dac39){_0x3a115e=_0x3a115e-0x0;var _0x1b7e61=_0x97ca[_0x3a115e];return _0x1b7e61;};'use strict';var Sequelize=require(_0xa97c('0x0'));module[_0xa97c('0x1')]={'name':{'type':Sequelize[_0xa97c('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa97c('0x3')](_0xa97c('0x4'),_0xa97c('0x5')),'defaultValue':_0xa97c('0x4')},'moduleSearch':{'type':Sequelize[_0xa97c('0x3')](_0xa97c('0x6'),'contact',_0xa97c('0x7'),_0xa97c('0x8'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xa97c('0x3')](_0xa97c('0x9'),'contact','lead','account'),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xa97c('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 54762ab..47b4b92 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 _0x55e2=['sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','update','destroy','then','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','count','include','findAll','show','includeAll','find','create','body','catch','findOne','params','SalesforceField','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3731d0,_0x10c42d){var _0x1518c9=function(_0x1c3163){while(--_0x1c3163){_0x3731d0['push'](_0x3731d0['shift']());}};_0x1518c9(++_0x10c42d);}(_0x55e2,0xd8));var _0x255e=function(_0x5fab19,_0xab026a){_0x5fab19=_0x5fab19-0x0;var _0x53ea21=_0x55e2[_0x5fab19];return _0x53ea21;};'use strict';var emlformat=require(_0x255e('0x0'));var rimraf=require(_0x255e('0x1'));var zipdir=require(_0x255e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x255e('0x3'));var BPromise=require(_0x255e('0x4'));var Mustache=require('mustache');var util=require(_0x255e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x255e('0x6'));var ejs=require(_0x255e('0x7'));var fs=require('fs');var fs_extra=require(_0x255e('0x8'));var _=require('lodash');var squel=require(_0x255e('0x9'));var crypto=require(_0x255e('0xa'));var jsforce=require(_0x255e('0xb'));var deskjs=require(_0x255e('0xc'));var toCsv=require(_0x255e('0x6'));var querystring=require(_0x255e('0xd'));var Papa=require(_0x255e('0xe'));var Redis=require(_0x255e('0xf'));var authService=require(_0x255e('0x10'));var qs=require(_0x255e('0x11'));var as=require(_0x255e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x255e('0x13'))(_0x255e('0x14'));var utils=require(_0x255e('0x15'));var config=require(_0x255e('0x16'));var licenseUtil=require(_0x255e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e78d6,_0x37cb25){_0x37cb25=_0x37cb25||0xcc;return function(_0x2e1862){if(_0x2e1862){return _0x4e78d6[_0x255e('0x18')](_0x37cb25);}return _0x4e78d6[_0x255e('0x19')](_0x37cb25)[_0x255e('0x1a')]();};}function respondWithResult(_0x4acafd,_0x2f91d6){_0x2f91d6=_0x2f91d6||0xc8;return function(_0x1ef9c9){if(_0x1ef9c9){return _0x4acafd[_0x255e('0x19')](_0x2f91d6)[_0x255e('0x1b')](_0x1ef9c9);}};}function respondWithFilteredResult(_0x5a799e,_0x3b226c){return function(_0x30828f){if(_0x30828f){var _0xe0e1d9=typeof _0x3b226c['offset']==='undefined'&&typeof _0x3b226c[_0x255e('0x1c')]===_0x255e('0x1d');var _0x4d9c9d=_0x30828f['count'];var _0x160248=_0xe0e1d9?0x0:_0x3b226c['offset'];var _0x419940=_0xe0e1d9?_0x30828f['count']:_0x3b226c[_0x255e('0x1e')]+_0x3b226c[_0x255e('0x1c')];var _0x1d940c;if(_0x419940>=_0x4d9c9d){_0x419940=_0x4d9c9d;_0x1d940c=0xc8;}else{_0x1d940c=0xce;}_0x5a799e[_0x255e('0x19')](_0x1d940c);return _0x5a799e[_0x255e('0x1f')](_0x255e('0x20'),_0x160248+'-'+_0x419940+'/'+_0x4d9c9d)[_0x255e('0x1b')](_0x30828f);}return null;};}function patchUpdates(_0x12ba37){return function(_0x2d1d1a){try{jsonpatch[_0x255e('0x21')](_0x2d1d1a,_0x12ba37,!![]);}catch(_0x5ea5c0){return BPromise['reject'](_0x5ea5c0);}return _0x2d1d1a['save']();};}function saveUpdates(_0x51a958,_0x1ff4bf){return function(_0x3b3898){if(_0x3b3898){return _0x3b3898[_0x255e('0x22')](_0x51a958)['then'](function(_0x56e852){return _0x56e852;});}return null;};}function removeEntity(_0x5c4fa7,_0x189514){return function(_0x662022){if(_0x662022){return _0x662022[_0x255e('0x23')]()[_0x255e('0x24')](function(){_0x5c4fa7[_0x255e('0x19')](0xcc)[_0x255e('0x1a')]();});}};}function handleEntityNotFound(_0x588987,_0x4fafaa){return function(_0x547d45){if(!_0x547d45){_0x588987[_0x255e('0x18')](0x194);}return _0x547d45;};}function handleError(_0x7474d9,_0x576e95){_0x576e95=_0x576e95||0x1f4;return function(_0x4962e0){logger['error'](_0x4962e0[_0x255e('0x25')]);if(_0x4962e0['name']){delete _0x4962e0[_0x255e('0x26')];}_0x7474d9[_0x255e('0x19')](_0x576e95)[_0x255e('0x27')](_0x4962e0);};}exports[_0x255e('0x28')]=function(_0x5de3f4,_0x4c2a6d){var _0x1d6cfb={},_0x5d0e82={},_0x49d541={'count':0x0,'rows':[]};var _0x4e3678=_['map'](db[_0x255e('0x29')][_0x255e('0x2a')],function(_0x57d3e2){return{'name':_0x57d3e2[_0x255e('0x2b')],'type':_0x57d3e2[_0x255e('0x2c')][_0x255e('0x2d')]};});_0x5d0e82[_0x255e('0x2e')]=_[_0x255e('0x2f')](_0x4e3678,'name');_0x5d0e82[_0x255e('0x30')]=_[_0x255e('0x31')](_0x5de3f4[_0x255e('0x30')]);_0x5d0e82[_0x255e('0x32')]=_[_0x255e('0x33')](_0x5d0e82[_0x255e('0x2e')],_0x5d0e82[_0x255e('0x30')]);_0x1d6cfb[_0x255e('0x34')]=_['intersection'](_0x5d0e82['model'],qs[_0x255e('0x35')](_0x5de3f4[_0x255e('0x30')][_0x255e('0x35')]));_0x1d6cfb['attributes']=_0x1d6cfb[_0x255e('0x34')][_0x255e('0x36')]?_0x1d6cfb[_0x255e('0x34')]:_0x5d0e82[_0x255e('0x2e')];if(!_0x5de3f4[_0x255e('0x30')]['hasOwnProperty'](_0x255e('0x37'))){_0x1d6cfb[_0x255e('0x1c')]=qs[_0x255e('0x1c')](_0x5de3f4[_0x255e('0x30')]['limit']);_0x1d6cfb[_0x255e('0x1e')]=qs[_0x255e('0x1e')](_0x5de3f4[_0x255e('0x30')][_0x255e('0x1e')]);}_0x1d6cfb[_0x255e('0x38')]=qs[_0x255e('0x39')](_0x5de3f4['query']['sort']);_0x1d6cfb[_0x255e('0x3a')]=qs[_0x255e('0x32')](_['pick'](_0x5de3f4[_0x255e('0x30')],_0x5d0e82[_0x255e('0x32')]),_0x4e3678);if(_0x5de3f4[_0x255e('0x30')]['filter']){_0x1d6cfb[_0x255e('0x3a')]=_[_0x255e('0x3b')](_0x1d6cfb[_0x255e('0x3a')],{'$or':_[_0x255e('0x2f')](_0x4e3678,function(_0x505c7c){if(_0x505c7c['type']!==_0x255e('0x3c')){var _0x7d0a7d={};_0x7d0a7d[_0x505c7c['name']]={'$like':'%'+_0x5de3f4[_0x255e('0x30')][_0x255e('0x3d')]+'%'};return _0x7d0a7d;}})});}_0x1d6cfb=_['merge']({},_0x1d6cfb,_0x5de3f4[_0x255e('0x3e')]);var _0x165c63={'where':_0x1d6cfb['where']};return db['SalesforceConfiguration'][_0x255e('0x3f')](_0x165c63)[_0x255e('0x24')](function(_0x499edb){_0x49d541['count']=_0x499edb;if(_0x5de3f4['query']['includeAll']){_0x1d6cfb[_0x255e('0x40')]=[{'all':!![]}];}return db[_0x255e('0x29')][_0x255e('0x41')](_0x1d6cfb);})['then'](function(_0x595669){_0x49d541['rows']=_0x595669;return _0x49d541;})['then'](respondWithFilteredResult(_0x4c2a6d,_0x1d6cfb))['catch'](handleError(_0x4c2a6d,null));};exports[_0x255e('0x42')]=function(_0x5440cf,_0x2eecfc){var _0x1d6e31={'raw':![],'where':{'id':_0x5440cf['params']['id']}},_0xab19bd={};_0xab19bd[_0x255e('0x2e')]=_[_0x255e('0x31')](db[_0x255e('0x29')][_0x255e('0x2a')]);_0xab19bd['query']=_['keys'](_0x5440cf[_0x255e('0x30')]);_0xab19bd[_0x255e('0x32')]=_['intersection'](_0xab19bd[_0x255e('0x2e')],_0xab19bd[_0x255e('0x30')]);_0x1d6e31[_0x255e('0x34')]=_[_0x255e('0x33')](_0xab19bd[_0x255e('0x2e')],qs[_0x255e('0x35')](_0x5440cf[_0x255e('0x30')][_0x255e('0x35')]));_0x1d6e31[_0x255e('0x34')]=_0x1d6e31[_0x255e('0x34')][_0x255e('0x36')]?_0x1d6e31[_0x255e('0x34')]:_0xab19bd[_0x255e('0x2e')];if(_0x5440cf[_0x255e('0x30')][_0x255e('0x43')]){_0x1d6e31['include']=[{'all':!![]}];}_0x1d6e31=_[_0x255e('0x3b')]({},_0x1d6e31,_0x5440cf[_0x255e('0x3e')]);return db[_0x255e('0x29')][_0x255e('0x44')](_0x1d6e31)['then'](handleEntityNotFound(_0x2eecfc,null))[_0x255e('0x24')](respondWithResult(_0x2eecfc,null))['catch'](handleError(_0x2eecfc,null));};exports[_0x255e('0x45')]=function(_0x58a8be,_0x3988d9){return db[_0x255e('0x29')][_0x255e('0x45')](_0x58a8be[_0x255e('0x46')],{})[_0x255e('0x24')](respondWithResult(_0x3988d9,0xc9))['catch'](handleError(_0x3988d9,null));};exports['update']=function(_0x21d7a8,_0x22f44a){if(_0x21d7a8[_0x255e('0x46')]['id']){delete _0x21d7a8[_0x255e('0x46')]['id'];}return db[_0x255e('0x29')][_0x255e('0x44')]({'where':{'id':_0x21d7a8['params']['id']}})['then'](handleEntityNotFound(_0x22f44a,null))[_0x255e('0x24')](saveUpdates(_0x21d7a8[_0x255e('0x46')],null))[_0x255e('0x24')](respondWithResult(_0x22f44a,null))[_0x255e('0x47')](handleError(_0x22f44a,null));};exports[_0x255e('0x23')]=function(_0x1d64c3,_0x1235d4){return db[_0x255e('0x29')][_0x255e('0x44')]({'where':{'id':_0x1d64c3['params']['id']}})['then'](handleEntityNotFound(_0x1235d4,null))['then'](removeEntity(_0x1235d4,null))[_0x255e('0x47')](handleError(_0x1235d4,null));};exports['getFields']=function(_0x1052ae,_0x491508,_0x51448a){var _0x338033={};var _0x113c33={};var _0x3430c1;var _0x398b42;return db[_0x255e('0x29')][_0x255e('0x48')]({'where':{'id':_0x1052ae[_0x255e('0x49')]['id']}})[_0x255e('0x24')](handleEntityNotFound(_0x491508,null))['then'](function(_0x7c2394){if(_0x7c2394){_0x3430c1=_0x7c2394;_0x113c33['model']=_[_0x255e('0x31')](db[_0x255e('0x4a')]['rawAttributes']);_0x113c33[_0x255e('0x30')]=_[_0x255e('0x31')](_0x1052ae[_0x255e('0x30')]);_0x113c33[_0x255e('0x32')]=_[_0x255e('0x33')](_0x113c33[_0x255e('0x2e')],_0x113c33[_0x255e('0x30')]);_0x338033[_0x255e('0x34')]=_['intersection'](_0x113c33[_0x255e('0x2e')],qs['fields'](_0x1052ae[_0x255e('0x30')]['fields']));_0x338033[_0x255e('0x34')]=_0x338033['attributes'][_0x255e('0x36')]?_0x338033['attributes']:_0x113c33[_0x255e('0x2e')];_0x338033[_0x255e('0x38')]=qs[_0x255e('0x39')](_0x1052ae[_0x255e('0x30')][_0x255e('0x39')]);_0x338033[_0x255e('0x3a')]=qs['filters'](_[_0x255e('0x4b')](_0x1052ae[_0x255e('0x30')],_0x113c33[_0x255e('0x32')]));if(_0x1052ae['query'][_0x255e('0x3d')]){_0x338033[_0x255e('0x3a')]=_[_0x255e('0x3b')](_0x338033[_0x255e('0x3a')],{'$or':_[_0x255e('0x2f')](_0x338033[_0x255e('0x34')],function(_0x310238){var _0x490be1={};_0x490be1[_0x310238]={'$like':'%'+_0x1052ae[_0x255e('0x30')][_0x255e('0x3d')]+'%'};return _0x490be1;})});}_0x338033=_[_0x255e('0x3b')]({},_0x338033,_0x1052ae[_0x255e('0x3e')]);return _0x3430c1[_0x255e('0x4c')](_0x338033);}})[_0x255e('0x24')](function(_0x5a5934){if(_0x5a5934){_0x398b42=_0x5a5934[_0x255e('0x36')];if(!_0x1052ae['query'][_0x255e('0x4d')](_0x255e('0x37'))){_0x338033[_0x255e('0x1c')]=qs['limit'](_0x1052ae[_0x255e('0x30')][_0x255e('0x1c')]);_0x338033['offset']=qs['offset'](_0x1052ae[_0x255e('0x30')][_0x255e('0x1e')]);}return _0x3430c1[_0x255e('0x4c')](_0x338033);}})[_0x255e('0x24')](function(_0x258a68){if(_0x258a68){return _0x258a68?{'count':_0x398b42,'rows':_0x258a68}:null;}})['then'](respondWithResult(_0x491508,null))[_0x255e('0x47')](handleError(_0x491508,null));};exports[_0x255e('0x4e')]=function(_0xb3137b,_0x1b0b33,_0x4826d9){var _0x50f8ac={};var _0x3aebd5={};var _0x31f146;var _0x3099b8;return db[_0x255e('0x29')][_0x255e('0x48')]({'where':{'id':_0xb3137b[_0x255e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b0b33,null))[_0x255e('0x24')](function(_0x3c3b4f){if(_0x3c3b4f){_0x31f146=_0x3c3b4f;_0x3aebd5['model']=_['keys'](db[_0x255e('0x4a')][_0x255e('0x2a')]);_0x3aebd5[_0x255e('0x30')]=_['keys'](_0xb3137b[_0x255e('0x30')]);_0x3aebd5[_0x255e('0x32')]=_[_0x255e('0x33')](_0x3aebd5[_0x255e('0x2e')],_0x3aebd5[_0x255e('0x30')]);_0x50f8ac[_0x255e('0x34')]=_[_0x255e('0x33')](_0x3aebd5[_0x255e('0x2e')],qs['fields'](_0xb3137b[_0x255e('0x30')][_0x255e('0x35')]));_0x50f8ac[_0x255e('0x34')]=_0x50f8ac['attributes']['length']?_0x50f8ac['attributes']:_0x3aebd5['model'];_0x50f8ac[_0x255e('0x38')]=qs[_0x255e('0x39')](_0xb3137b[_0x255e('0x30')]['sort']);_0x50f8ac[_0x255e('0x3a')]=qs[_0x255e('0x32')](_['pick'](_0xb3137b['query'],_0x3aebd5['filters']));if(_0xb3137b['query'][_0x255e('0x3d')]){_0x50f8ac[_0x255e('0x3a')]=_[_0x255e('0x3b')](_0x50f8ac['where'],{'$or':_['map'](_0x50f8ac[_0x255e('0x34')],function(_0x523396){var _0x1cbd13={};_0x1cbd13[_0x523396]={'$like':'%'+_0xb3137b[_0x255e('0x30')]['filter']+'%'};return _0x1cbd13;})});}_0x50f8ac=_[_0x255e('0x3b')]({},_0x50f8ac,_0xb3137b['options']);return _0x31f146[_0x255e('0x4e')](_0x50f8ac);}})[_0x255e('0x24')](function(_0x4a9276){if(_0x4a9276){_0x3099b8=_0x4a9276[_0x255e('0x36')];if(!_0xb3137b['query'][_0x255e('0x4d')](_0x255e('0x37'))){_0x50f8ac[_0x255e('0x1c')]=qs[_0x255e('0x1c')](_0xb3137b[_0x255e('0x30')][_0x255e('0x1c')]);_0x50f8ac[_0x255e('0x1e')]=qs[_0x255e('0x1e')](_0xb3137b[_0x255e('0x30')]['offset']);}return _0x31f146[_0x255e('0x4e')](_0x50f8ac);}})['then'](function(_0x381c24){if(_0x381c24){return _0x381c24?{'count':_0x3099b8,'rows':_0x381c24}:null;}})[_0x255e('0x24')](respondWithResult(_0x1b0b33,null))[_0x255e('0x47')](handleError(_0x1b0b33,null));};exports['getDescriptions']=function(_0x113cd3,_0x3ef7ca,_0x303b8e){var _0x1ffcbb={};var _0x23f53e={};var _0x3cc39c;var _0xc576bb;return db[_0x255e('0x29')][_0x255e('0x48')]({'where':{'id':_0x113cd3[_0x255e('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ef7ca,null))[_0x255e('0x24')](function(_0x40d30e){if(_0x40d30e){_0x3cc39c=_0x40d30e;_0x23f53e[_0x255e('0x2e')]=_[_0x255e('0x31')](db[_0x255e('0x4a')][_0x255e('0x2a')]);_0x23f53e[_0x255e('0x30')]=_[_0x255e('0x31')](_0x113cd3[_0x255e('0x30')]);_0x23f53e['filters']=_[_0x255e('0x33')](_0x23f53e[_0x255e('0x2e')],_0x23f53e['query']);_0x1ffcbb[_0x255e('0x34')]=_[_0x255e('0x33')](_0x23f53e[_0x255e('0x2e')],qs[_0x255e('0x35')](_0x113cd3[_0x255e('0x30')][_0x255e('0x35')]));_0x1ffcbb[_0x255e('0x34')]=_0x1ffcbb[_0x255e('0x34')][_0x255e('0x36')]?_0x1ffcbb[_0x255e('0x34')]:_0x23f53e[_0x255e('0x2e')];_0x1ffcbb[_0x255e('0x38')]=qs[_0x255e('0x39')](_0x113cd3[_0x255e('0x30')][_0x255e('0x39')]);_0x1ffcbb['where']=qs[_0x255e('0x32')](_[_0x255e('0x4b')](_0x113cd3[_0x255e('0x30')],_0x23f53e[_0x255e('0x32')]));if(_0x113cd3['query'][_0x255e('0x3d')]){_0x1ffcbb[_0x255e('0x3a')]=_[_0x255e('0x3b')](_0x1ffcbb[_0x255e('0x3a')],{'$or':_[_0x255e('0x2f')](_0x1ffcbb[_0x255e('0x34')],function(_0x2cb326){var _0x2b0a85={};_0x2b0a85[_0x2cb326]={'$like':'%'+_0x113cd3['query'][_0x255e('0x3d')]+'%'};return _0x2b0a85;})});}_0x1ffcbb=_[_0x255e('0x3b')]({},_0x1ffcbb,_0x113cd3[_0x255e('0x3e')]);return _0x3cc39c[_0x255e('0x4f')](_0x1ffcbb);}})['then'](function(_0x1b795c){if(_0x1b795c){_0xc576bb=_0x1b795c['length'];if(!_0x113cd3[_0x255e('0x30')][_0x255e('0x4d')](_0x255e('0x37'))){_0x1ffcbb['limit']=qs['limit'](_0x113cd3[_0x255e('0x30')][_0x255e('0x1c')]);_0x1ffcbb[_0x255e('0x1e')]=qs['offset'](_0x113cd3[_0x255e('0x30')]['offset']);}return _0x3cc39c['getDescriptions'](_0x1ffcbb);}})[_0x255e('0x24')](function(_0x1bdbca){if(_0x1bdbca){return _0x1bdbca?{'count':_0xc576bb,'rows':_0x1bdbca}:null;}})[_0x255e('0x24')](respondWithResult(_0x3ef7ca,null))['catch'](handleError(_0x3ef7ca,null));}; \ No newline at end of file +var _0x294b=['body','update','destroy','getFields','findOne','filter','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','SalesforceConfiguration','includeAll','include','catch','params','rawAttributes','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb294('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb294('0x1'));var jsonpatch=require(_0xb294('0x2'));var rp=require(_0xb294('0x3'));var moment=require(_0xb294('0x4'));var BPromise=require(_0xb294('0x5'));var Mustache=require(_0xb294('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb294('0x7'));var csv=require(_0xb294('0x8'));var ejs=require(_0xb294('0x9'));var fs=require('fs');var fs_extra=require(_0xb294('0xa'));var _=require(_0xb294('0xb'));var squel=require('squel');var crypto=require(_0xb294('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb294('0xd'));var Papa=require(_0xb294('0xe'));var Redis=require(_0xb294('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb294('0x10'));var logger=require(_0xb294('0x11'))(_0xb294('0x12'));var utils=require(_0xb294('0x13'));var config=require(_0xb294('0x14'));var licenseUtil=require(_0xb294('0x15'));var db=require(_0xb294('0x16'))['db'];function respondWithStatusCode(_0x13a3fc,_0x2b2bb5){_0x2b2bb5=_0x2b2bb5||0xcc;return function(_0x3e0fe5){if(_0x3e0fe5){return _0x13a3fc['sendStatus'](_0x2b2bb5);}return _0x13a3fc['status'](_0x2b2bb5)[_0xb294('0x17')]();};}function respondWithResult(_0x4c0959,_0x4b5996){_0x4b5996=_0x4b5996||0xc8;return function(_0x22beca){if(_0x22beca){return _0x4c0959[_0xb294('0x18')](_0x4b5996)[_0xb294('0x19')](_0x22beca);}};}function respondWithFilteredResult(_0x366f8f,_0x3f7323){return function(_0x2f3b62){if(_0x2f3b62){var _0x1a4089=typeof _0x3f7323[_0xb294('0x1a')]===_0xb294('0x1b')&&typeof _0x3f7323[_0xb294('0x1c')]===_0xb294('0x1b');var _0x51110b=_0x2f3b62[_0xb294('0x1d')];var _0x1ecc68=_0x1a4089?0x0:_0x3f7323['offset'];var _0x5e8ce6=_0x1a4089?_0x2f3b62[_0xb294('0x1d')]:_0x3f7323[_0xb294('0x1a')]+_0x3f7323[_0xb294('0x1c')];var _0x449e81;if(_0x5e8ce6>=_0x51110b){_0x5e8ce6=_0x51110b;_0x449e81=0xc8;}else{_0x449e81=0xce;}_0x366f8f[_0xb294('0x18')](_0x449e81);return _0x366f8f['set']('Content-Range',_0x1ecc68+'-'+_0x5e8ce6+'/'+_0x51110b)[_0xb294('0x19')](_0x2f3b62);}return null;};}function patchUpdates(_0x46b2ac){return function(_0x526914){try{jsonpatch[_0xb294('0x1e')](_0x526914,_0x46b2ac,!![]);}catch(_0x18e7dd){return BPromise['reject'](_0x18e7dd);}return _0x526914[_0xb294('0x1f')]();};}function saveUpdates(_0x21b9b2,_0x33c416){return function(_0x4afd48){if(_0x4afd48){return _0x4afd48['update'](_0x21b9b2)[_0xb294('0x20')](function(_0x5bdc68){return _0x5bdc68;});}return null;};}function removeEntity(_0x36b173,_0x5be6d5){return function(_0x101339){if(_0x101339){return _0x101339['destroy']()[_0xb294('0x20')](function(){_0x36b173['status'](0xcc)[_0xb294('0x17')]();});}};}function handleEntityNotFound(_0x405b66,_0x2d0c62){return function(_0xabcb26){if(!_0xabcb26){_0x405b66[_0xb294('0x21')](0x194);}return _0xabcb26;};}function handleError(_0x469647,_0x2fe3a9){_0x2fe3a9=_0x2fe3a9||0x1f4;return function(_0x52853){logger[_0xb294('0x22')](_0x52853['stack']);if(_0x52853['name']){delete _0x52853[_0xb294('0x23')];}_0x469647[_0xb294('0x18')](_0x2fe3a9)[_0xb294('0x24')](_0x52853);};}exports[_0xb294('0x25')]=function(_0x47fca9,_0x59fbde){var _0x1167e5={},_0x3c2aa5={},_0x1efdb6={'count':0x0,'rows':[]};var _0x127ddd=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0xbb4a10){return{'name':_0xbb4a10[_0xb294('0x26')],'type':_0xbb4a10[_0xb294('0x27')][_0xb294('0x28')]};});_0x3c2aa5[_0xb294('0x29')]=_[_0xb294('0x2a')](_0x127ddd,_0xb294('0x23'));_0x3c2aa5[_0xb294('0x2b')]=_[_0xb294('0x2c')](_0x47fca9[_0xb294('0x2b')]);_0x3c2aa5[_0xb294('0x2d')]=_[_0xb294('0x2e')](_0x3c2aa5[_0xb294('0x29')],_0x3c2aa5['query']);_0x1167e5['attributes']=_[_0xb294('0x2e')](_0x3c2aa5['model'],qs[_0xb294('0x2f')](_0x47fca9[_0xb294('0x2b')][_0xb294('0x2f')]));_0x1167e5[_0xb294('0x30')]=_0x1167e5['attributes'][_0xb294('0x31')]?_0x1167e5[_0xb294('0x30')]:_0x3c2aa5[_0xb294('0x29')];if(!_0x47fca9[_0xb294('0x2b')][_0xb294('0x32')]('nolimit')){_0x1167e5['limit']=qs['limit'](_0x47fca9[_0xb294('0x2b')][_0xb294('0x1c')]);_0x1167e5[_0xb294('0x1a')]=qs[_0xb294('0x1a')](_0x47fca9[_0xb294('0x2b')][_0xb294('0x1a')]);}_0x1167e5[_0xb294('0x33')]=qs['sort'](_0x47fca9[_0xb294('0x2b')][_0xb294('0x34')]);_0x1167e5[_0xb294('0x35')]=qs[_0xb294('0x2d')](_[_0xb294('0x36')](_0x47fca9[_0xb294('0x2b')],_0x3c2aa5[_0xb294('0x2d')]),_0x127ddd);if(_0x47fca9[_0xb294('0x2b')]['filter']){_0x1167e5['where']=_[_0xb294('0x37')](_0x1167e5['where'],{'$or':_[_0xb294('0x2a')](_0x127ddd,function(_0x565546){if(_0x565546[_0xb294('0x27')]!==_0xb294('0x38')){var _0x2c92cb={};_0x2c92cb[_0x565546[_0xb294('0x23')]]={'$like':'%'+_0x47fca9[_0xb294('0x2b')]['filter']+'%'};return _0x2c92cb;}})});}_0x1167e5=_['merge']({},_0x1167e5,_0x47fca9[_0xb294('0x39')]);var _0x2693ec={'where':_0x1167e5[_0xb294('0x35')]};return db[_0xb294('0x3a')][_0xb294('0x1d')](_0x2693ec)[_0xb294('0x20')](function(_0x4ef87e){_0x1efdb6['count']=_0x4ef87e;if(_0x47fca9[_0xb294('0x2b')][_0xb294('0x3b')]){_0x1167e5[_0xb294('0x3c')]=[{'all':!![]}];}return db[_0xb294('0x3a')]['findAll'](_0x1167e5);})['then'](function(_0x1da557){_0x1efdb6['rows']=_0x1da557;return _0x1efdb6;})[_0xb294('0x20')](respondWithFilteredResult(_0x59fbde,_0x1167e5))[_0xb294('0x3d')](handleError(_0x59fbde,null));};exports['show']=function(_0x572e98,_0x4c1f43){var _0x20b1a2={'raw':![],'where':{'id':_0x572e98[_0xb294('0x3e')]['id']}},_0x164556={};_0x164556['model']=_[_0xb294('0x2c')](db[_0xb294('0x3a')][_0xb294('0x3f')]);_0x164556[_0xb294('0x2b')]=_[_0xb294('0x2c')](_0x572e98[_0xb294('0x2b')]);_0x164556[_0xb294('0x2d')]=_['intersection'](_0x164556['model'],_0x164556[_0xb294('0x2b')]);_0x20b1a2[_0xb294('0x30')]=_['intersection'](_0x164556['model'],qs[_0xb294('0x2f')](_0x572e98[_0xb294('0x2b')][_0xb294('0x2f')]));_0x20b1a2[_0xb294('0x30')]=_0x20b1a2['attributes'][_0xb294('0x31')]?_0x20b1a2['attributes']:_0x164556['model'];if(_0x572e98[_0xb294('0x2b')][_0xb294('0x3b')]){_0x20b1a2[_0xb294('0x3c')]=[{'all':!![]}];}_0x20b1a2=_[_0xb294('0x37')]({},_0x20b1a2,_0x572e98[_0xb294('0x39')]);return db['SalesforceConfiguration'][_0xb294('0x40')](_0x20b1a2)[_0xb294('0x20')](handleEntityNotFound(_0x4c1f43,null))[_0xb294('0x20')](respondWithResult(_0x4c1f43,null))['catch'](handleError(_0x4c1f43,null));};exports['create']=function(_0xce4f4,_0x3cdc29){return db[_0xb294('0x3a')][_0xb294('0x41')](_0xce4f4[_0xb294('0x42')],{})['then'](respondWithResult(_0x3cdc29,0xc9))[_0xb294('0x3d')](handleError(_0x3cdc29,null));};exports[_0xb294('0x43')]=function(_0x459a69,_0x3156e2){if(_0x459a69[_0xb294('0x42')]['id']){delete _0x459a69[_0xb294('0x42')]['id'];}return db[_0xb294('0x3a')][_0xb294('0x40')]({'where':{'id':_0x459a69[_0xb294('0x3e')]['id']}})[_0xb294('0x20')](handleEntityNotFound(_0x3156e2,null))['then'](saveUpdates(_0x459a69[_0xb294('0x42')],null))['then'](respondWithResult(_0x3156e2,null))[_0xb294('0x3d')](handleError(_0x3156e2,null));};exports[_0xb294('0x44')]=function(_0x249b59,_0xd64380){return db[_0xb294('0x3a')]['find']({'where':{'id':_0x249b59['params']['id']}})[_0xb294('0x20')](handleEntityNotFound(_0xd64380,null))[_0xb294('0x20')](removeEntity(_0xd64380,null))[_0xb294('0x3d')](handleError(_0xd64380,null));};exports[_0xb294('0x45')]=function(_0x5589c3,_0x10b068,_0x298d99){var _0x3de87c={};var _0xe7a03e={};var _0xf10527;var _0x173822;return db['SalesforceConfiguration'][_0xb294('0x46')]({'where':{'id':_0x5589c3[_0xb294('0x3e')]['id']}})['then'](handleEntityNotFound(_0x10b068,null))['then'](function(_0x1e09fa){if(_0x1e09fa){_0xf10527=_0x1e09fa;_0xe7a03e['model']=_[_0xb294('0x2c')](db['SalesforceField']['rawAttributes']);_0xe7a03e[_0xb294('0x2b')]=_[_0xb294('0x2c')](_0x5589c3[_0xb294('0x2b')]);_0xe7a03e[_0xb294('0x2d')]=_[_0xb294('0x2e')](_0xe7a03e[_0xb294('0x29')],_0xe7a03e[_0xb294('0x2b')]);_0x3de87c['attributes']=_['intersection'](_0xe7a03e[_0xb294('0x29')],qs[_0xb294('0x2f')](_0x5589c3[_0xb294('0x2b')]['fields']));_0x3de87c[_0xb294('0x30')]=_0x3de87c['attributes'][_0xb294('0x31')]?_0x3de87c[_0xb294('0x30')]:_0xe7a03e[_0xb294('0x29')];_0x3de87c[_0xb294('0x33')]=qs[_0xb294('0x34')](_0x5589c3[_0xb294('0x2b')]['sort']);_0x3de87c['where']=qs['filters'](_[_0xb294('0x36')](_0x5589c3[_0xb294('0x2b')],_0xe7a03e['filters']));if(_0x5589c3['query'][_0xb294('0x47')]){_0x3de87c[_0xb294('0x35')]=_[_0xb294('0x37')](_0x3de87c[_0xb294('0x35')],{'$or':_[_0xb294('0x2a')](_0x3de87c['attributes'],function(_0x42b74f){var _0x1ffc40={};_0x1ffc40[_0x42b74f]={'$like':'%'+_0x5589c3[_0xb294('0x2b')][_0xb294('0x47')]+'%'};return _0x1ffc40;})});}_0x3de87c=_[_0xb294('0x37')]({},_0x3de87c,_0x5589c3[_0xb294('0x39')]);return _0xf10527['getFields'](_0x3de87c);}})[_0xb294('0x20')](function(_0x12919f){if(_0x12919f){_0x173822=_0x12919f[_0xb294('0x31')];if(!_0x5589c3[_0xb294('0x2b')][_0xb294('0x32')](_0xb294('0x48'))){_0x3de87c[_0xb294('0x1c')]=qs['limit'](_0x5589c3['query'][_0xb294('0x1c')]);_0x3de87c['offset']=qs[_0xb294('0x1a')](_0x5589c3[_0xb294('0x2b')][_0xb294('0x1a')]);}return _0xf10527['getFields'](_0x3de87c);}})['then'](function(_0x1a5cc8){if(_0x1a5cc8){return _0x1a5cc8?{'count':_0x173822,'rows':_0x1a5cc8}:null;}})[_0xb294('0x20')](respondWithResult(_0x10b068,null))[_0xb294('0x3d')](handleError(_0x10b068,null));};exports[_0xb294('0x49')]=function(_0x50a6f0,_0x3f3e62,_0x50ae47){var _0x5bf068={};var _0x9fba26={};var _0x1d6d72;var _0x46cb25;return db['SalesforceConfiguration'][_0xb294('0x46')]({'where':{'id':_0x50a6f0['params']['id']}})[_0xb294('0x20')](handleEntityNotFound(_0x3f3e62,null))[_0xb294('0x20')](function(_0x29a855){if(_0x29a855){_0x1d6d72=_0x29a855;_0x9fba26['model']=_[_0xb294('0x2c')](db['SalesforceField'][_0xb294('0x3f')]);_0x9fba26['query']=_[_0xb294('0x2c')](_0x50a6f0['query']);_0x9fba26[_0xb294('0x2d')]=_[_0xb294('0x2e')](_0x9fba26['model'],_0x9fba26[_0xb294('0x2b')]);_0x5bf068['attributes']=_['intersection'](_0x9fba26[_0xb294('0x29')],qs[_0xb294('0x2f')](_0x50a6f0[_0xb294('0x2b')]['fields']));_0x5bf068[_0xb294('0x30')]=_0x5bf068['attributes'][_0xb294('0x31')]?_0x5bf068[_0xb294('0x30')]:_0x9fba26[_0xb294('0x29')];_0x5bf068[_0xb294('0x33')]=qs[_0xb294('0x34')](_0x50a6f0['query'][_0xb294('0x34')]);_0x5bf068['where']=qs[_0xb294('0x2d')](_[_0xb294('0x36')](_0x50a6f0['query'],_0x9fba26[_0xb294('0x2d')]));if(_0x50a6f0[_0xb294('0x2b')]['filter']){_0x5bf068[_0xb294('0x35')]=_[_0xb294('0x37')](_0x5bf068[_0xb294('0x35')],{'$or':_[_0xb294('0x2a')](_0x5bf068[_0xb294('0x30')],function(_0x6dace3){var _0x4cc290={};_0x4cc290[_0x6dace3]={'$like':'%'+_0x50a6f0[_0xb294('0x2b')][_0xb294('0x47')]+'%'};return _0x4cc290;})});}_0x5bf068=_[_0xb294('0x37')]({},_0x5bf068,_0x50a6f0['options']);return _0x1d6d72[_0xb294('0x49')](_0x5bf068);}})[_0xb294('0x20')](function(_0x32878d){if(_0x32878d){_0x46cb25=_0x32878d[_0xb294('0x31')];if(!_0x50a6f0[_0xb294('0x2b')][_0xb294('0x32')]('nolimit')){_0x5bf068[_0xb294('0x1c')]=qs[_0xb294('0x1c')](_0x50a6f0[_0xb294('0x2b')]['limit']);_0x5bf068[_0xb294('0x1a')]=qs[_0xb294('0x1a')](_0x50a6f0['query']['offset']);}return _0x1d6d72[_0xb294('0x49')](_0x5bf068);}})[_0xb294('0x20')](function(_0x5035ba){if(_0x5035ba){return _0x5035ba?{'count':_0x46cb25,'rows':_0x5035ba}:null;}})[_0xb294('0x20')](respondWithResult(_0x3f3e62,null))['catch'](handleError(_0x3f3e62,null));};exports[_0xb294('0x4a')]=function(_0x2efd3d,_0x4520d3,_0x42894d){var _0x299dc5={};var _0x58828a={};var _0xdd7998;var _0x2ca5a1;return db[_0xb294('0x3a')][_0xb294('0x46')]({'where':{'id':_0x2efd3d[_0xb294('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4520d3,null))['then'](function(_0x18d75a){if(_0x18d75a){_0xdd7998=_0x18d75a;_0x58828a[_0xb294('0x29')]=_['keys'](db['SalesforceField'][_0xb294('0x3f')]);_0x58828a['query']=_[_0xb294('0x2c')](_0x2efd3d[_0xb294('0x2b')]);_0x58828a[_0xb294('0x2d')]=_[_0xb294('0x2e')](_0x58828a['model'],_0x58828a['query']);_0x299dc5[_0xb294('0x30')]=_[_0xb294('0x2e')](_0x58828a[_0xb294('0x29')],qs[_0xb294('0x2f')](_0x2efd3d[_0xb294('0x2b')]['fields']));_0x299dc5[_0xb294('0x30')]=_0x299dc5[_0xb294('0x30')]['length']?_0x299dc5[_0xb294('0x30')]:_0x58828a[_0xb294('0x29')];_0x299dc5[_0xb294('0x33')]=qs[_0xb294('0x34')](_0x2efd3d[_0xb294('0x2b')][_0xb294('0x34')]);_0x299dc5[_0xb294('0x35')]=qs[_0xb294('0x2d')](_[_0xb294('0x36')](_0x2efd3d[_0xb294('0x2b')],_0x58828a[_0xb294('0x2d')]));if(_0x2efd3d[_0xb294('0x2b')]['filter']){_0x299dc5['where']=_['merge'](_0x299dc5[_0xb294('0x35')],{'$or':_[_0xb294('0x2a')](_0x299dc5[_0xb294('0x30')],function(_0x4446f0){var _0xc4e1d1={};_0xc4e1d1[_0x4446f0]={'$like':'%'+_0x2efd3d[_0xb294('0x2b')][_0xb294('0x47')]+'%'};return _0xc4e1d1;})});}_0x299dc5=_['merge']({},_0x299dc5,_0x2efd3d[_0xb294('0x39')]);return _0xdd7998[_0xb294('0x4a')](_0x299dc5);}})[_0xb294('0x20')](function(_0x1454d6){if(_0x1454d6){_0x2ca5a1=_0x1454d6[_0xb294('0x31')];if(!_0x2efd3d[_0xb294('0x2b')][_0xb294('0x32')](_0xb294('0x48'))){_0x299dc5[_0xb294('0x1c')]=qs[_0xb294('0x1c')](_0x2efd3d[_0xb294('0x2b')][_0xb294('0x1c')]);_0x299dc5[_0xb294('0x1a')]=qs['offset'](_0x2efd3d[_0xb294('0x2b')][_0xb294('0x1a')]);}return _0xdd7998['getDescriptions'](_0x299dc5);}})[_0xb294('0x20')](function(_0x3ba1a1){if(_0x3ba1a1){return _0x3ba1a1?{'count':_0x2ca5a1,'rows':_0x3ba1a1}:null;}})[_0xb294('0x20')](respondWithResult(_0x4520d3,null))[_0xb294('0x3d')](handleError(_0x4520d3,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7f38ec7..cc4993f 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 _0x117c=['define','SalesforceConfiguration','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x117c,0x91));var _0xc117=function(_0x5b7755,_0x44681c){_0x5b7755=_0x5b7755-0x0;var _0x1a9c39=_0x117c[_0x5b7755];return _0x1a9c39;};'use strict';var _=require(_0xc117('0x0'));var util=require(_0xc117('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc117('0x2'));var BPromise=require(_0xc117('0x3'));var rp=require(_0xc117('0x4'));var fs=require('fs');var path=require(_0xc117('0x5'));var rimraf=require(_0xc117('0x6'));var config=require(_0xc117('0x7'));var attributes=require(_0xc117('0x8'));module['exports']=function(_0x5d65a5,_0x7beb20){return _0x5d65a5[_0xc117('0x9')](_0xc117('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60ad=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x60ad,0x123));var _0xd60a=function(_0x108026,_0x2cda70){_0x108026=_0x108026-0x0;var _0x429e03=_0x60ad[_0x108026];return _0x429e03;};'use strict';var _=require(_0xd60a('0x0'));var util=require(_0xd60a('0x1'));var logger=require(_0xd60a('0x2'))('api');var moment=require(_0xd60a('0x3'));var BPromise=require(_0xd60a('0x4'));var rp=require(_0xd60a('0x5'));var fs=require('fs');var path=require(_0xd60a('0x6'));var rimraf=require('rimraf');var config=require(_0xd60a('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xd60a('0x8')]=function(_0x475adc,_0x385771){return _0x475adc[_0xd60a('0x9')](_0xd60a('0xa'),attributes,{'tableName':_0xd60a('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 d0726ab..745762a 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 _0xddba=['error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x216ccb,_0x1197e2){var _0xa6ab86=function(_0x2d8706){while(--_0x2d8706){_0x216ccb['push'](_0x216ccb['shift']());}};_0xa6ab86(++_0x1197e2);}(_0xddba,0x7e));var _0xaddb=function(_0x13c792,_0xdde31f){_0x13c792=_0x13c792-0x0;var _0x5505ff=_0xddba[_0x13c792];return _0x5505ff;};'use strict';var _=require('lodash');var util=require(_0xaddb('0x0'));var moment=require(_0xaddb('0x1'));var BPromise=require(_0xaddb('0x2'));var rs=require(_0xaddb('0x3'));var fs=require('fs');var Redis=require(_0xaddb('0x4'));var db=require(_0xaddb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaddb('0x6'))(_0xaddb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaddb('0x8')][_0xaddb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5def3a,_0x440323,_0x5b911e){return new BPromise(function(_0x2b2e10,_0x48747c){return client[_0xaddb('0xa')](_0x5def3a,_0x5b911e)['then'](function(_0x298e77){logger[_0xaddb('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x440323,_0xaddb('0xc'));logger['debug'](_0xaddb('0xd'),_0x440323,_0xaddb('0xc'),JSON['stringify'](_0x298e77));if(_0x298e77['error']){if(_0x298e77[_0xaddb('0xe')][_0xaddb('0xf')]===0x1f4){logger[_0xaddb('0xe')](_0xaddb('0x10'),_0x440323,_0x298e77['error'][_0xaddb('0x11')]);return _0x48747c(_0x298e77[_0xaddb('0xe')][_0xaddb('0x11')]);}logger['error'](_0xaddb('0x10'),_0x440323,_0x298e77[_0xaddb('0xe')]['message']);return _0x2b2e10(_0x298e77[_0xaddb('0xe')][_0xaddb('0x11')]);}else{logger[_0xaddb('0xb')](_0xaddb('0x10'),_0x440323,_0xaddb('0xc'));_0x2b2e10(_0x298e77[_0xaddb('0x12')][_0xaddb('0x11')]);}})[_0xaddb('0x13')](function(_0x454878){logger[_0xaddb('0xe')](_0xaddb('0x10'),_0x440323,_0x454878);_0x48747c(_0x454878);});});} \ No newline at end of file +var _0x8300=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash'];(function(_0x1f2116,_0x375db5){var _0x1c245d=function(_0x37f212){while(--_0x37f212){_0x1f2116['push'](_0x1f2116['shift']());}};_0x1c245d(++_0x375db5);}(_0x8300,0x1cd));var _0x0830=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x8300[_0x3bab09];return _0x164376;};'use strict';var _=require(_0x0830('0x0'));var util=require(_0x0830('0x1'));var moment=require(_0x0830('0x2'));var BPromise=require(_0x0830('0x3'));var rs=require(_0x0830('0x4'));var fs=require('fs');var Redis=require(_0x0830('0x5'));var db=require(_0x0830('0x6'))['db'];var utils=require(_0x0830('0x7'));var logger=require(_0x0830('0x8'))(_0x0830('0x9'));var config=require('../../config/environment');var jayson=require(_0x0830('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cc1ac,_0x201bcb,_0x25294d){return new BPromise(function(_0x52c23e,_0x27be26){return client[_0x0830('0xb')](_0x5cc1ac,_0x25294d)[_0x0830('0xc')](function(_0x5779b3){logger[_0x0830('0xd')](_0x0830('0xe'),_0x201bcb,'request\x20sent');logger[_0x0830('0xf')](_0x0830('0x10'),_0x201bcb,_0x0830('0x11'),JSON['stringify'](_0x5779b3));if(_0x5779b3[_0x0830('0x12')]){if(_0x5779b3[_0x0830('0x12')]['code']===0x1f4){logger[_0x0830('0x12')](_0x0830('0xe'),_0x201bcb,_0x5779b3[_0x0830('0x12')][_0x0830('0x13')]);return _0x27be26(_0x5779b3['error']['message']);}logger[_0x0830('0x12')](_0x0830('0xe'),_0x201bcb,_0x5779b3['error']['message']);return _0x52c23e(_0x5779b3[_0x0830('0x12')][_0x0830('0x13')]);}else{logger[_0x0830('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x201bcb,_0x0830('0x11'));_0x52c23e(_0x5779b3[_0x0830('0x14')][_0x0830('0x13')]);}})['catch'](function(_0x440c9c){logger[_0x0830('0x12')](_0x0830('0xe'),_0x201bcb,_0x440c9c);_0x27be26(_0x440c9c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 7a350fc..8decf6d 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 _0x28a7=['../../config/environment','isAuthenticated','index','get','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x397cad,_0x61f277){var _0x4b176b=function(_0x46a7d1){while(--_0x46a7d1){_0x397cad['push'](_0x397cad['shift']());}};_0x4b176b(++_0x61f277);}(_0x28a7,0x14e));var _0x728a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x28a7[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x728a('0x0'));var util=require('util');var path=require(_0x728a('0x1'));var timeout=require(_0x728a('0x2'));var express=require(_0x728a('0x3'));var router=express[_0x728a('0x4')]();var fs_extra=require(_0x728a('0x5'));var auth=require(_0x728a('0x6'));var interaction=require(_0x728a('0x7'));var config=require(_0x728a('0x8'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x728a('0x9')](),controller[_0x728a('0xa')]);router[_0x728a('0xb')](_0x728a('0xc'),auth[_0x728a('0x9')](),controller[_0x728a('0xd')]);router[_0x728a('0xe')]('/',auth['isAuthenticated'](),controller[_0x728a('0xf')]);router['put'](_0x728a('0xc'),auth[_0x728a('0x9')](),controller[_0x728a('0x10')]);router[_0x728a('0x11')](_0x728a('0xc'),auth[_0x728a('0x9')](),controller['destroy']);module[_0x728a('0x12')]=router; \ No newline at end of file +var _0x80bb=['index','show','post','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x1484f0,_0x153b14){var _0x3aaee=function(_0x323feb){while(--_0x323feb){_0x1484f0['push'](_0x1484f0['shift']());}};_0x3aaee(++_0x153b14);}(_0x80bb,0x147));var _0xb80b=function(_0x739d75,_0x8db80d){_0x739d75=_0x739d75-0x0;var _0x452430=_0x80bb[_0x739d75];return _0x452430;};'use strict';var multer=require(_0xb80b('0x0'));var util=require(_0xb80b('0x1'));var path=require(_0xb80b('0x2'));var timeout=require(_0xb80b('0x3'));var express=require(_0xb80b('0x4'));var router=express[_0xb80b('0x5')]();var fs_extra=require(_0xb80b('0x6'));var auth=require(_0xb80b('0x7'));var interaction=require(_0xb80b('0x8'));var config=require(_0xb80b('0x9'));var controller=require(_0xb80b('0xa'));router[_0xb80b('0xb')]('/',auth[_0xb80b('0xc')](),controller[_0xb80b('0xd')]);router[_0xb80b('0xb')]('/:id',auth[_0xb80b('0xc')](),controller[_0xb80b('0xe')]);router[_0xb80b('0xf')]('/',auth[_0xb80b('0xc')](),controller['create']);router['put'](_0xb80b('0x10'),auth[_0xb80b('0xc')](),controller[_0xb80b('0x11')]);router['delete']('/:id',auth[_0xb80b('0xc')](),controller[_0xb80b('0x12')]);module[_0xb80b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 72a09f1..a7fc453 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 _0x63c7=['sequelize','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x48d933,_0x4eaabe){var _0x4caf07=function(_0x403c1f){while(--_0x403c1f){_0x48d933['push'](_0x48d933['shift']());}};_0x4caf07(++_0x4eaabe);}(_0x63c7,0x1c8));var _0x763c=function(_0x3aafd0,_0x59f6b2){_0x3aafd0=_0x3aafd0-0x0;var _0x3adbc1=_0x63c7[_0x3aafd0];return _0x3adbc1;};'use strict';var Sequelize=require(_0x763c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x763c('0x1'),_0x763c('0x2'),_0x763c('0x3'),_0x763c('0x4'),_0x763c('0x5')),'defaultValue':_0x763c('0x1')},'content':{'type':Sequelize[_0x763c('0x6')]},'key':{'type':Sequelize[_0x763c('0x6')]},'keyType':{'type':Sequelize[_0x763c('0x7')](_0x763c('0x1'),_0x763c('0x2'),_0x763c('0x3'))},'keyContent':{'type':Sequelize[_0x763c('0x6')]},'idField':{'type':Sequelize[_0x763c('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa82e=['STRING','sequelize','ENUM','string','variable','customVariable','picklist'];(function(_0x33b2df,_0x3d30f7){var _0x5bac87=function(_0x35e035){while(--_0x35e035){_0x33b2df['push'](_0x33b2df['shift']());}};_0x5bac87(++_0x3d30f7);}(_0xa82e,0x104));var _0xea82=function(_0x376128,_0x292558){_0x376128=_0x376128-0x0;var _0x5845f3=_0xa82e[_0x376128];return _0x5845f3;};'use strict';var Sequelize=require(_0xea82('0x0'));module['exports']={'type':{'type':Sequelize[_0xea82('0x1')](_0xea82('0x2'),_0xea82('0x3'),_0xea82('0x4'),'keyValue',_0xea82('0x5')),'defaultValue':_0xea82('0x2')},'content':{'type':Sequelize[_0xea82('0x6')]},'key':{'type':Sequelize[_0xea82('0x6')]},'keyType':{'type':Sequelize[_0xea82('0x1')]('string','variable',_0xea82('0x4'))},'keyContent':{'type':Sequelize[_0xea82('0x6')]},'idField':{'type':Sequelize[_0xea82('0x6')]},'variableName':{'type':Sequelize[_0xea82('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index cc2e546..9627350 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 _0x76f7=['SalesforceField','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x2fbbff,_0x8072b6){var _0x593869=function(_0x2b9264){while(--_0x2b9264){_0x2fbbff['push'](_0x2fbbff['shift']());}};_0x593869(++_0x8072b6);}(_0x76f7,0x186));var _0x776f=function(_0x5f6b1a,_0x5d5684){_0x5f6b1a=_0x5f6b1a-0x0;var _0x3d0344=_0x76f7[_0x5f6b1a];return _0x3d0344;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x776f('0x0'));var zipdir=require(_0x776f('0x1'));var jsonpatch=require(_0x776f('0x2'));var rp=require('request-promise');var moment=require(_0x776f('0x3'));var BPromise=require(_0x776f('0x4'));var Mustache=require(_0x776f('0x5'));var util=require('util');var path=require(_0x776f('0x6'));var sox=require(_0x776f('0x7'));var csv=require(_0x776f('0x8'));var ejs=require(_0x776f('0x9'));var fs=require('fs');var fs_extra=require(_0x776f('0xa'));var _=require(_0x776f('0xb'));var squel=require(_0x776f('0xc'));var crypto=require(_0x776f('0xd'));var jsforce=require(_0x776f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x776f('0x8'));var querystring=require(_0x776f('0xf'));var Papa=require(_0x776f('0x10'));var Redis=require(_0x776f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x776f('0x12'));var as=require(_0x776f('0x13'));var hardwareService=require(_0x776f('0x14'));var logger=require(_0x776f('0x15'))('api');var utils=require(_0x776f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x776f('0x17'))['db'];function respondWithStatusCode(_0x50f514,_0x361f77){_0x361f77=_0x361f77||0xcc;return function(_0x125ce0){if(_0x125ce0){return _0x50f514[_0x776f('0x18')](_0x361f77);}return _0x50f514[_0x776f('0x19')](_0x361f77)[_0x776f('0x1a')]();};}function respondWithResult(_0x12908c,_0x1f5037){_0x1f5037=_0x1f5037||0xc8;return function(_0x3263e7){if(_0x3263e7){return _0x12908c[_0x776f('0x19')](_0x1f5037)['json'](_0x3263e7);}};}function respondWithFilteredResult(_0x401ab2,_0x4936cc){return function(_0x55fe55){if(_0x55fe55){var _0x369f87=typeof _0x4936cc[_0x776f('0x1b')]===_0x776f('0x1c')&&typeof _0x4936cc['limit']===_0x776f('0x1c');var _0x25b5ec=_0x55fe55['count'];var _0x3722ee=_0x369f87?0x0:_0x4936cc[_0x776f('0x1b')];var _0x2bfe0c=_0x369f87?_0x55fe55[_0x776f('0x1d')]:_0x4936cc[_0x776f('0x1b')]+_0x4936cc[_0x776f('0x1e')];var _0x487bfb;if(_0x2bfe0c>=_0x25b5ec){_0x2bfe0c=_0x25b5ec;_0x487bfb=0xc8;}else{_0x487bfb=0xce;}_0x401ab2[_0x776f('0x19')](_0x487bfb);return _0x401ab2[_0x776f('0x1f')]('Content-Range',_0x3722ee+'-'+_0x2bfe0c+'/'+_0x25b5ec)['json'](_0x55fe55);}return null;};}function patchUpdates(_0x30b1ff){return function(_0x39d4db){try{jsonpatch[_0x776f('0x20')](_0x39d4db,_0x30b1ff,!![]);}catch(_0x11d917){return BPromise[_0x776f('0x21')](_0x11d917);}return _0x39d4db[_0x776f('0x22')]();};}function saveUpdates(_0x3c4f9c,_0x3c79f8){return function(_0x2d6152){if(_0x2d6152){return _0x2d6152[_0x776f('0x23')](_0x3c4f9c)[_0x776f('0x24')](function(_0x13e014){return _0x13e014;});}return null;};}function removeEntity(_0x45b25d,_0x840c4c){return function(_0x5b284c){if(_0x5b284c){return _0x5b284c[_0x776f('0x25')]()[_0x776f('0x24')](function(){_0x45b25d[_0x776f('0x19')](0xcc)[_0x776f('0x1a')]();});}};}function handleEntityNotFound(_0x162c30,_0x2eb9b2){return function(_0x1bdd70){if(!_0x1bdd70){_0x162c30[_0x776f('0x18')](0x194);}return _0x1bdd70;};}function handleError(_0x2605b3,_0x4c7b42){_0x4c7b42=_0x4c7b42||0x1f4;return function(_0x235e04){logger['error'](_0x235e04[_0x776f('0x26')]);if(_0x235e04['name']){delete _0x235e04[_0x776f('0x27')];}_0x2605b3[_0x776f('0x19')](_0x4c7b42)[_0x776f('0x28')](_0x235e04);};}exports[_0x776f('0x29')]=function(_0x2a2979,_0xcd9bf){var _0x4afa34={},_0x51545b={},_0x5ea807={'count':0x0,'rows':[]};var _0x35629d=_['map'](db[_0x776f('0x2a')][_0x776f('0x2b')],function(_0x414d4c){return{'name':_0x414d4c['fieldName'],'type':_0x414d4c['type'][_0x776f('0x2c')]};});_0x51545b[_0x776f('0x2d')]=_[_0x776f('0x2e')](_0x35629d,_0x776f('0x27'));_0x51545b[_0x776f('0x2f')]=_['keys'](_0x2a2979[_0x776f('0x2f')]);_0x51545b[_0x776f('0x30')]=_[_0x776f('0x31')](_0x51545b[_0x776f('0x2d')],_0x51545b[_0x776f('0x2f')]);_0x4afa34[_0x776f('0x32')]=_[_0x776f('0x31')](_0x51545b[_0x776f('0x2d')],qs[_0x776f('0x33')](_0x2a2979[_0x776f('0x2f')][_0x776f('0x33')]));_0x4afa34['attributes']=_0x4afa34[_0x776f('0x32')][_0x776f('0x34')]?_0x4afa34[_0x776f('0x32')]:_0x51545b[_0x776f('0x2d')];if(!_0x2a2979[_0x776f('0x2f')][_0x776f('0x35')]('nolimit')){_0x4afa34[_0x776f('0x1e')]=qs[_0x776f('0x1e')](_0x2a2979['query'][_0x776f('0x1e')]);_0x4afa34[_0x776f('0x1b')]=qs[_0x776f('0x1b')](_0x2a2979[_0x776f('0x2f')][_0x776f('0x1b')]);}_0x4afa34[_0x776f('0x36')]=qs[_0x776f('0x37')](_0x2a2979[_0x776f('0x2f')][_0x776f('0x37')]);_0x4afa34[_0x776f('0x38')]=qs['filters'](_[_0x776f('0x39')](_0x2a2979[_0x776f('0x2f')],_0x51545b['filters']),_0x35629d);if(_0x2a2979[_0x776f('0x2f')][_0x776f('0x3a')]){_0x4afa34[_0x776f('0x38')]=_[_0x776f('0x3b')](_0x4afa34[_0x776f('0x38')],{'$or':_['map'](_0x35629d,function(_0x3ae3b2){if(_0x3ae3b2['type']!=='VIRTUAL'){var _0x11f50e={};_0x11f50e[_0x3ae3b2['name']]={'$like':'%'+_0x2a2979['query'][_0x776f('0x3a')]+'%'};return _0x11f50e;}})});}_0x4afa34=_[_0x776f('0x3b')]({},_0x4afa34,_0x2a2979['options']);var _0x48e553={'where':_0x4afa34[_0x776f('0x38')]};return db[_0x776f('0x2a')][_0x776f('0x1d')](_0x48e553)['then'](function(_0x4536f3){_0x5ea807[_0x776f('0x1d')]=_0x4536f3;if(_0x2a2979[_0x776f('0x2f')][_0x776f('0x3c')]){_0x4afa34[_0x776f('0x3d')]=[{'all':!![]}];}return db[_0x776f('0x2a')][_0x776f('0x3e')](_0x4afa34);})[_0x776f('0x24')](function(_0xed23f9){_0x5ea807[_0x776f('0x3f')]=_0xed23f9;return _0x5ea807;})['then'](respondWithFilteredResult(_0xcd9bf,_0x4afa34))[_0x776f('0x40')](handleError(_0xcd9bf,null));};exports[_0x776f('0x41')]=function(_0x4b50cc,_0x2f0577){var _0x4c77d6={'raw':!![],'where':{'id':_0x4b50cc[_0x776f('0x42')]['id']}},_0x716c1b={};_0x716c1b[_0x776f('0x2d')]=_[_0x776f('0x43')](db['SalesforceField']['rawAttributes']);_0x716c1b[_0x776f('0x2f')]=_[_0x776f('0x43')](_0x4b50cc[_0x776f('0x2f')]);_0x716c1b[_0x776f('0x30')]=_[_0x776f('0x31')](_0x716c1b[_0x776f('0x2d')],_0x716c1b['query']);_0x4c77d6[_0x776f('0x32')]=_[_0x776f('0x31')](_0x716c1b[_0x776f('0x2d')],qs['fields'](_0x4b50cc['query'][_0x776f('0x33')]));_0x4c77d6['attributes']=_0x4c77d6['attributes']['length']?_0x4c77d6['attributes']:_0x716c1b['model'];if(_0x4b50cc[_0x776f('0x2f')]['includeAll']){_0x4c77d6[_0x776f('0x3d')]=[{'all':!![]}];}_0x4c77d6=_[_0x776f('0x3b')]({},_0x4c77d6,_0x4b50cc[_0x776f('0x44')]);return db[_0x776f('0x2a')]['find'](_0x4c77d6)[_0x776f('0x24')](handleEntityNotFound(_0x2f0577,null))['then'](respondWithResult(_0x2f0577,null))[_0x776f('0x40')](handleError(_0x2f0577,null));};exports[_0x776f('0x45')]=function(_0x20b091,_0x30fc72){return db[_0x776f('0x2a')][_0x776f('0x45')](_0x20b091[_0x776f('0x46')],{})[_0x776f('0x24')](respondWithResult(_0x30fc72,0xc9))[_0x776f('0x40')](handleError(_0x30fc72,null));};exports['update']=function(_0x39d295,_0x2917aa){if(_0x39d295[_0x776f('0x46')]['id']){delete _0x39d295[_0x776f('0x46')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x39d295[_0x776f('0x42')]['id']}})[_0x776f('0x24')](handleEntityNotFound(_0x2917aa,null))[_0x776f('0x24')](saveUpdates(_0x39d295[_0x776f('0x46')],null))[_0x776f('0x24')](respondWithResult(_0x2917aa,null))[_0x776f('0x40')](handleError(_0x2917aa,null));};exports[_0x776f('0x25')]=function(_0x5e1952,_0x4f4b89){return db['SalesforceField'][_0x776f('0x47')]({'where':{'id':_0x5e1952['params']['id']}})[_0x776f('0x24')](handleEntityNotFound(_0x4f4b89,null))[_0x776f('0x24')](removeEntity(_0x4f4b89,null))[_0x776f('0x40')](handleError(_0x4f4b89,null));}; \ No newline at end of file +var _0x3311=['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','../../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','SalesforceField','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','params','eml-format','rimraf','zip-dir'];(function(_0x3d38f9,_0x214030){var _0x3032df=function(_0x4b1e29){while(--_0x4b1e29){_0x3d38f9['push'](_0x3d38f9['shift']());}};_0x3032df(++_0x214030);}(_0x3311,0x179));var _0x1331=function(_0x8577ac,_0x12771e){_0x8577ac=_0x8577ac-0x0;var _0xb3b7da=_0x3311[_0x8577ac];return _0xb3b7da;};'use strict';var emlformat=require(_0x1331('0x0'));var rimraf=require(_0x1331('0x1'));var zipdir=require(_0x1331('0x2'));var jsonpatch=require(_0x1331('0x3'));var rp=require(_0x1331('0x4'));var moment=require('moment');var BPromise=require(_0x1331('0x5'));var Mustache=require(_0x1331('0x6'));var util=require(_0x1331('0x7'));var path=require(_0x1331('0x8'));var sox=require(_0x1331('0x9'));var csv=require(_0x1331('0xa'));var ejs=require(_0x1331('0xb'));var fs=require('fs');var fs_extra=require(_0x1331('0xc'));var _=require(_0x1331('0xd'));var squel=require(_0x1331('0xe'));var crypto=require(_0x1331('0xf'));var jsforce=require(_0x1331('0x10'));var deskjs=require(_0x1331('0x11'));var toCsv=require(_0x1331('0xa'));var querystring=require(_0x1331('0x12'));var Papa=require(_0x1331('0x13'));var Redis=require('ioredis');var authService=require(_0x1331('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1331('0x15'))(_0x1331('0x16'));var utils=require(_0x1331('0x17'));var config=require(_0x1331('0x18'));var licenseUtil=require(_0x1331('0x19'));var db=require(_0x1331('0x1a'))['db'];function respondWithStatusCode(_0x440193,_0x13d6ee){_0x13d6ee=_0x13d6ee||0xcc;return function(_0x4c5b67){if(_0x4c5b67){return _0x440193[_0x1331('0x1b')](_0x13d6ee);}return _0x440193[_0x1331('0x1c')](_0x13d6ee)[_0x1331('0x1d')]();};}function respondWithResult(_0x4d438e,_0x365c41){_0x365c41=_0x365c41||0xc8;return function(_0x370bcf){if(_0x370bcf){return _0x4d438e[_0x1331('0x1c')](_0x365c41)[_0x1331('0x1e')](_0x370bcf);}};}function respondWithFilteredResult(_0x2473a9,_0x125b98){return function(_0xfe44b7){if(_0xfe44b7){var _0x2ae860=typeof _0x125b98[_0x1331('0x1f')]===_0x1331('0x20')&&typeof _0x125b98[_0x1331('0x21')]===_0x1331('0x20');var _0x2dad95=_0xfe44b7[_0x1331('0x22')];var _0xa99220=_0x2ae860?0x0:_0x125b98[_0x1331('0x1f')];var _0x5c0a78=_0x2ae860?_0xfe44b7[_0x1331('0x22')]:_0x125b98[_0x1331('0x1f')]+_0x125b98[_0x1331('0x21')];var _0x3fbf;if(_0x5c0a78>=_0x2dad95){_0x5c0a78=_0x2dad95;_0x3fbf=0xc8;}else{_0x3fbf=0xce;}_0x2473a9[_0x1331('0x1c')](_0x3fbf);return _0x2473a9[_0x1331('0x23')](_0x1331('0x24'),_0xa99220+'-'+_0x5c0a78+'/'+_0x2dad95)[_0x1331('0x1e')](_0xfe44b7);}return null;};}function patchUpdates(_0x55568c){return function(_0x568410){try{jsonpatch[_0x1331('0x25')](_0x568410,_0x55568c,!![]);}catch(_0x574c28){return BPromise[_0x1331('0x26')](_0x574c28);}return _0x568410[_0x1331('0x27')]();};}function saveUpdates(_0x4a94ec,_0x483812){return function(_0x31b386){if(_0x31b386){return _0x31b386['update'](_0x4a94ec)[_0x1331('0x28')](function(_0x4c9186){return _0x4c9186;});}return null;};}function removeEntity(_0x2672af,_0x1d5f77){return function(_0x48d336){if(_0x48d336){return _0x48d336['destroy']()[_0x1331('0x28')](function(){_0x2672af[_0x1331('0x1c')](0xcc)[_0x1331('0x1d')]();});}};}function handleEntityNotFound(_0x23dda4,_0x191db9){return function(_0x3da46d){if(!_0x3da46d){_0x23dda4[_0x1331('0x1b')](0x194);}return _0x3da46d;};}function handleError(_0x466616,_0x2d7eee){_0x2d7eee=_0x2d7eee||0x1f4;return function(_0x5f21ae){logger[_0x1331('0x29')](_0x5f21ae[_0x1331('0x2a')]);if(_0x5f21ae[_0x1331('0x2b')]){delete _0x5f21ae[_0x1331('0x2b')];}_0x466616[_0x1331('0x1c')](_0x2d7eee)['send'](_0x5f21ae);};}exports['index']=function(_0x4e7fc3,_0x9bc2bf){var _0x139df5={},_0x6618b8={},_0x486b72={'count':0x0,'rows':[]};var _0x12841a=_['map'](db[_0x1331('0x2c')][_0x1331('0x2d')],function(_0x3c8da2){return{'name':_0x3c8da2[_0x1331('0x2e')],'type':_0x3c8da2['type'][_0x1331('0x2f')]};});_0x6618b8[_0x1331('0x30')]=_[_0x1331('0x31')](_0x12841a,'name');_0x6618b8[_0x1331('0x32')]=_[_0x1331('0x33')](_0x4e7fc3[_0x1331('0x32')]);_0x6618b8['filters']=_[_0x1331('0x34')](_0x6618b8['model'],_0x6618b8['query']);_0x139df5[_0x1331('0x35')]=_[_0x1331('0x34')](_0x6618b8[_0x1331('0x30')],qs[_0x1331('0x36')](_0x4e7fc3[_0x1331('0x32')][_0x1331('0x36')]));_0x139df5[_0x1331('0x35')]=_0x139df5[_0x1331('0x35')][_0x1331('0x37')]?_0x139df5['attributes']:_0x6618b8['model'];if(!_0x4e7fc3[_0x1331('0x32')][_0x1331('0x38')](_0x1331('0x39'))){_0x139df5['limit']=qs[_0x1331('0x21')](_0x4e7fc3['query'][_0x1331('0x21')]);_0x139df5[_0x1331('0x1f')]=qs[_0x1331('0x1f')](_0x4e7fc3[_0x1331('0x32')][_0x1331('0x1f')]);}_0x139df5['order']=qs['sort'](_0x4e7fc3[_0x1331('0x32')][_0x1331('0x3a')]);_0x139df5[_0x1331('0x3b')]=qs[_0x1331('0x3c')](_[_0x1331('0x3d')](_0x4e7fc3['query'],_0x6618b8[_0x1331('0x3c')]),_0x12841a);if(_0x4e7fc3[_0x1331('0x32')][_0x1331('0x3e')]){_0x139df5['where']=_[_0x1331('0x3f')](_0x139df5['where'],{'$or':_[_0x1331('0x31')](_0x12841a,function(_0x4979e6){if(_0x4979e6[_0x1331('0x40')]!==_0x1331('0x41')){var _0x3c886d={};_0x3c886d[_0x4979e6[_0x1331('0x2b')]]={'$like':'%'+_0x4e7fc3[_0x1331('0x32')]['filter']+'%'};return _0x3c886d;}})});}_0x139df5=_[_0x1331('0x3f')]({},_0x139df5,_0x4e7fc3[_0x1331('0x42')]);var _0x1ed8df={'where':_0x139df5[_0x1331('0x3b')]};return db[_0x1331('0x2c')]['count'](_0x1ed8df)[_0x1331('0x28')](function(_0x455332){_0x486b72[_0x1331('0x22')]=_0x455332;if(_0x4e7fc3[_0x1331('0x32')]['includeAll']){_0x139df5[_0x1331('0x43')]=[{'all':!![]}];}return db[_0x1331('0x2c')][_0x1331('0x44')](_0x139df5);})[_0x1331('0x28')](function(_0x25068b){_0x486b72[_0x1331('0x45')]=_0x25068b;return _0x486b72;})['then'](respondWithFilteredResult(_0x9bc2bf,_0x139df5))[_0x1331('0x46')](handleError(_0x9bc2bf,null));};exports['show']=function(_0x58fe99,_0x3ed244){var _0x5dc137={'raw':!![],'where':{'id':_0x58fe99['params']['id']}},_0x564c1f={};_0x564c1f[_0x1331('0x30')]=_[_0x1331('0x33')](db['SalesforceField'][_0x1331('0x2d')]);_0x564c1f[_0x1331('0x32')]=_[_0x1331('0x33')](_0x58fe99['query']);_0x564c1f[_0x1331('0x3c')]=_['intersection'](_0x564c1f[_0x1331('0x30')],_0x564c1f['query']);_0x5dc137['attributes']=_['intersection'](_0x564c1f[_0x1331('0x30')],qs[_0x1331('0x36')](_0x58fe99[_0x1331('0x32')][_0x1331('0x36')]));_0x5dc137['attributes']=_0x5dc137[_0x1331('0x35')]['length']?_0x5dc137[_0x1331('0x35')]:_0x564c1f[_0x1331('0x30')];if(_0x58fe99['query'][_0x1331('0x47')]){_0x5dc137[_0x1331('0x43')]=[{'all':!![]}];}_0x5dc137=_['merge']({},_0x5dc137,_0x58fe99[_0x1331('0x42')]);return db['SalesforceField'][_0x1331('0x48')](_0x5dc137)[_0x1331('0x28')](handleEntityNotFound(_0x3ed244,null))['then'](respondWithResult(_0x3ed244,null))[_0x1331('0x46')](handleError(_0x3ed244,null));};exports[_0x1331('0x49')]=function(_0x54c7dc,_0x1431e1){return db[_0x1331('0x2c')]['create'](_0x54c7dc[_0x1331('0x4a')],{})['then'](respondWithResult(_0x1431e1,0xc9))[_0x1331('0x46')](handleError(_0x1431e1,null));};exports['update']=function(_0x908ef7,_0x406e27){if(_0x908ef7[_0x1331('0x4a')]['id']){delete _0x908ef7[_0x1331('0x4a')]['id'];}return db[_0x1331('0x2c')][_0x1331('0x48')]({'where':{'id':_0x908ef7[_0x1331('0x4b')]['id']}})[_0x1331('0x28')](handleEntityNotFound(_0x406e27,null))[_0x1331('0x28')](saveUpdates(_0x908ef7[_0x1331('0x4a')],null))['then'](respondWithResult(_0x406e27,null))[_0x1331('0x46')](handleError(_0x406e27,null));};exports['destroy']=function(_0x17d0a3,_0x4b1a47){return db[_0x1331('0x2c')][_0x1331('0x48')]({'where':{'id':_0x17d0a3['params']['id']}})[_0x1331('0x28')](handleEntityNotFound(_0x4b1a47,null))[_0x1331('0x28')](removeEntity(_0x4b1a47,null))[_0x1331('0x46')](handleError(_0x4b1a47,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index da7d4ad..fd31d65 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 _0xcac9=['api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x4e158a,_0x31b81e){var _0x168261=function(_0xdfa847){while(--_0xdfa847){_0x4e158a['push'](_0x4e158a['shift']());}};_0x168261(++_0x31b81e);}(_0xcac9,0x193));var _0x9cac=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0xcac9[_0xb65e77];return _0x38134b;};'use strict';var _=require(_0x9cac('0x0'));var util=require(_0x9cac('0x1'));var logger=require(_0x9cac('0x2'))(_0x9cac('0x3'));var moment=require('moment');var BPromise=require(_0x9cac('0x4'));var rp=require(_0x9cac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9cac('0x6'));var config=require(_0x9cac('0x7'));var attributes=require(_0x9cac('0x8'));module['exports']=function(_0x33b07,_0x3a7c9c){return _0x33b07[_0x9cac('0x9')](_0x9cac('0xa'),attributes,{'tableName':_0x9cac('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x9cac('0xc'),_0x9cac('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b58=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SalesforceField','salesforce_unique_index','idField'];(function(_0x3c1dac,_0x1b7ce9){var _0x3ad569=function(_0x510ca2){while(--_0x510ca2){_0x3c1dac['push'](_0x3c1dac['shift']());}};_0x3ad569(++_0x1b7ce9);}(_0x0b58,0xb4));var _0x80b5=function(_0x45ffad,_0x1c09f0){_0x45ffad=_0x45ffad-0x0;var _0x7c936e=_0x0b58[_0x45ffad];return _0x7c936e;};'use strict';var _=require('lodash');var util=require(_0x80b5('0x0'));var logger=require('../../config/logger')(_0x80b5('0x1'));var moment=require(_0x80b5('0x2'));var BPromise=require(_0x80b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80b5('0x4'));var rimraf=require(_0x80b5('0x5'));var config=require(_0x80b5('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x80b5('0x7')]=function(_0x4eda38,_0x2127fd){return _0x4eda38[_0x80b5('0x8')](_0x80b5('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x80b5('0xa'),'fields':[_0x80b5('0xb'),'FieldId'],'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 67be745..4735790 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 _0xa623=['rpc','../../config/environment','jayson/promise','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x9482cf,_0x38699f){var _0x401067=function(_0x3f3492){while(--_0x3f3492){_0x9482cf['push'](_0x9482cf['shift']());}};_0x401067(++_0x38699f);}(_0xa623,0x1e8));var _0x3a62=function(_0x5c6cae,_0x41ea05){_0x5c6cae=_0x5c6cae-0x0;var _0x74e4c2=_0xa623[_0x5c6cae];return _0x74e4c2;};'use strict';var _=require(_0x3a62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3a62('0x1'));var rs=require(_0x3a62('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a62('0x3'))['db'];var utils=require(_0x3a62('0x4'));var logger=require(_0x3a62('0x5'))(_0x3a62('0x6'));var config=require(_0x3a62('0x7'));var jayson=require(_0x3a62('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf6ee30,_0x5c6058,_0x468900){return new BPromise(function(_0x42e828,_0x29716e){return client[_0x3a62('0x9')](_0xf6ee30,_0x468900)[_0x3a62('0xa')](function(_0x4c0abe){logger[_0x3a62('0xb')](_0x3a62('0xc'),_0x5c6058,_0x3a62('0xd'));logger[_0x3a62('0xe')](_0x3a62('0xf'),_0x5c6058,'request\x20sent',JSON['stringify'](_0x4c0abe));if(_0x4c0abe[_0x3a62('0x10')]){if(_0x4c0abe[_0x3a62('0x10')]['code']===0x1f4){logger[_0x3a62('0x10')](_0x3a62('0xc'),_0x5c6058,_0x4c0abe[_0x3a62('0x10')][_0x3a62('0x11')]);return _0x29716e(_0x4c0abe['error'][_0x3a62('0x11')]);}logger[_0x3a62('0x10')](_0x3a62('0xc'),_0x5c6058,_0x4c0abe[_0x3a62('0x10')][_0x3a62('0x11')]);return _0x42e828(_0x4c0abe[_0x3a62('0x10')]['message']);}else{logger[_0x3a62('0xb')](_0x3a62('0xc'),_0x5c6058,_0x3a62('0xd'));_0x42e828(_0x4c0abe['result'][_0x3a62('0x11')]);}})[_0x3a62('0x12')](function(_0x3c0740){logger[_0x3a62('0x10')]('SalesforceField,\x20%s,\x20%s',_0x5c6058,_0x3c0740);_0x29716e(_0x3c0740);});});} \ No newline at end of file +var _0xecfa=['message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xecfa,0x192));var _0xaecf=function(_0x2992c9,_0x503403){_0x2992c9=_0x2992c9-0x0;var _0x15c9f1=_0xecfa[_0x2992c9];return _0x15c9f1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaecf('0x0'));var BPromise=require(_0xaecf('0x1'));var rs=require(_0xaecf('0x2'));var fs=require('fs');var Redis=require(_0xaecf('0x3'));var db=require(_0xaecf('0x4'))['db'];var utils=require(_0xaecf('0x5'));var logger=require(_0xaecf('0x6'))(_0xaecf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaecf('0x8')][_0xaecf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3236a7,_0xb18f85,_0x226916){return new BPromise(function(_0x1b43b5,_0x85fa04){return client[_0xaecf('0xa')](_0x3236a7,_0x226916)[_0xaecf('0xb')](function(_0xdbe46e){logger['info'](_0xaecf('0xc'),_0xb18f85,_0xaecf('0xd'));logger[_0xaecf('0xe')](_0xaecf('0xf'),_0xb18f85,_0xaecf('0xd'),JSON[_0xaecf('0x10')](_0xdbe46e));if(_0xdbe46e[_0xaecf('0x11')]){if(_0xdbe46e[_0xaecf('0x11')]['code']===0x1f4){logger['error'](_0xaecf('0xc'),_0xb18f85,_0xdbe46e['error'][_0xaecf('0x12')]);return _0x85fa04(_0xdbe46e[_0xaecf('0x11')][_0xaecf('0x12')]);}logger[_0xaecf('0x11')](_0xaecf('0xc'),_0xb18f85,_0xdbe46e[_0xaecf('0x11')][_0xaecf('0x12')]);return _0x1b43b5(_0xdbe46e[_0xaecf('0x11')]['message']);}else{logger['info'](_0xaecf('0xc'),_0xb18f85,_0xaecf('0xd'));_0x1b43b5(_0xdbe46e['result']['message']);}})[_0xaecf('0x13')](function(_0x1c7458){logger[_0xaecf('0x11')](_0xaecf('0xc'),_0xb18f85,_0x1c7458);_0x85fa04(_0x1c7458);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index b72c21c..db1d025 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 _0x2843=['/:id/fields','getFields','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x1d7e85,_0x327b11){var _0x28e292=function(_0x52d696){while(--_0x52d696){_0x1d7e85['push'](_0x1d7e85['shift']());}};_0x28e292(++_0x327b11);}(_0x2843,0x6a));var _0x3284=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x2843[_0x61b3ab];return _0x57097f;};'use strict';var multer=require(_0x3284('0x0'));var util=require(_0x3284('0x1'));var path=require(_0x3284('0x2'));var timeout=require(_0x3284('0x3'));var express=require(_0x3284('0x4'));var router=express[_0x3284('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3284('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3284('0x7'));var controller=require(_0x3284('0x8'));router[_0x3284('0x9')]('/',auth[_0x3284('0xa')](),controller[_0x3284('0xb')]);router[_0x3284('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3284('0xc')]);router['get'](_0x3284('0xd'),auth[_0x3284('0xa')](),controller['getConfigurations']);router['get'](_0x3284('0xe'),auth[_0x3284('0xa')](),controller[_0x3284('0xf')]);router[_0x3284('0x10')]('/',auth[_0x3284('0xa')](),controller[_0x3284('0x11')]);router[_0x3284('0x10')](_0x3284('0xd'),auth[_0x3284('0xa')](),controller['addConfiguration']);router[_0x3284('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3284('0x13')]);router[_0x3284('0x14')](_0x3284('0x15'),auth[_0x3284('0xa')](),controller[_0x3284('0x16')]);module[_0x3284('0x17')]=router; \ No newline at end of file +var _0x47e1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util'];(function(_0x5158cf,_0x777c1f){var _0x4c8dad=function(_0x1b843b){while(--_0x1b843b){_0x5158cf['push'](_0x5158cf['shift']());}};_0x4c8dad(++_0x777c1f);}(_0x47e1,0x76));var _0x147e=function(_0x4544be,_0x275746){_0x4544be=_0x4544be-0x0;var _0x28cb48=_0x47e1[_0x4544be];return _0x28cb48;};'use strict';var multer=require(_0x147e('0x0'));var util=require(_0x147e('0x1'));var path=require(_0x147e('0x2'));var timeout=require(_0x147e('0x3'));var express=require(_0x147e('0x4'));var router=express[_0x147e('0x5')]();var fs_extra=require(_0x147e('0x6'));var auth=require(_0x147e('0x7'));var interaction=require(_0x147e('0x8'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0x147e('0x9')]('/',auth[_0x147e('0xa')](),controller[_0x147e('0xb')]);router['get'](_0x147e('0xc'),auth[_0x147e('0xa')](),controller[_0x147e('0xd')]);router[_0x147e('0x9')](_0x147e('0xe'),auth[_0x147e('0xa')](),controller[_0x147e('0xf')]);router[_0x147e('0x9')](_0x147e('0x10'),auth[_0x147e('0xa')](),controller[_0x147e('0x11')]);router[_0x147e('0x12')]('/',auth[_0x147e('0xa')](),controller[_0x147e('0x13')]);router['post'](_0x147e('0xe'),auth[_0x147e('0xa')](),controller['addConfiguration']);router[_0x147e('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x147e('0x15')]);router[_0x147e('0x16')]('/:id',auth[_0x147e('0xa')](),controller[_0x147e('0x17')]);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 fda528a..7aa4914 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 _0x4555=['exports','STRING','sequelize'];(function(_0x341dc6,_0x3cf2be){var _0x34c6ea=function(_0x25b43a){while(--_0x25b43a){_0x341dc6['push'](_0x341dc6['shift']());}};_0x34c6ea(++_0x3cf2be);}(_0x4555,0xf2));var _0x5455=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4555[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5455('0x0'));module[_0x5455('0x1')]={'name':{'type':Sequelize[_0x5455('0x2')]},'description':{'type':Sequelize[_0x5455('0x2')]},'username':{'type':Sequelize[_0x5455('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x5455('0x2')]},'email':{'type':Sequelize[_0x5455('0x2')]},'remoteUri':{'type':Sequelize[_0x5455('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x5455('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xab70=['remoteUri','sequelize','STRING'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xab70,0x8b));var _0x0ab7=function(_0x19e67f,_0x1a8a9d){_0x19e67f=_0x19e67f-0x0;var _0x1e64a2=_0xab70[_0x19e67f];return _0x1e64a2;};'use strict';var Sequelize=require(_0x0ab7('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ab7('0x1')]},'description':{'type':Sequelize[_0x0ab7('0x1')]},'username':{'type':Sequelize[_0x0ab7('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x0ab7('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0ab7('0x1')],'unique':_0x0ab7('0x2')},'serverUrl':{'type':Sequelize[_0x0ab7('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 41251b9..5fcc496 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 _0x8dac=['../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','sort','where','VIRTUAL','filter','ServicenowAccount','includeAll','catch','show','params','fields','include','merge','find','create','update','body','getConfigurations','findOne','ServicenowConfiguration','order','pick','options','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','priority','sys_domain_path','rfc','time_worked','business_duration','group_list','work_end','reopened_time','caller_id','work_notes','short_description','delivery_task','assignment_group','business_stc','description','close_notes','closed_by','follow_up','parent_incident','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','sys_tags','escalation','upon_approval','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','assign','remove','includes','internalType','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','test','statusCode','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x570294,_0x139ae4){var _0x41b542=function(_0xea92ff){while(--_0xea92ff){_0x570294['push'](_0x570294['shift']());}};_0x41b542(++_0x139ae4);}(_0x8dac,0x154));var _0xc8da=function(_0x4f40ee,_0x5c03ba){_0x4f40ee=_0x4f40ee-0x0;var _0x4913b5=_0x8dac[_0x4f40ee];return _0x4913b5;};'use strict';var emlformat=require(_0xc8da('0x0'));var rimraf=require(_0xc8da('0x1'));var zipdir=require(_0xc8da('0x2'));var jsonpatch=require(_0xc8da('0x3'));var rp=require('request-promise');var moment=require(_0xc8da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc8da('0x5'));var util=require(_0xc8da('0x6'));var path=require(_0xc8da('0x7'));var sox=require(_0xc8da('0x8'));var csv=require(_0xc8da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8da('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8da('0xb'));var deskjs=require(_0xc8da('0xc'));var toCsv=require(_0xc8da('0x9'));var querystring=require(_0xc8da('0xd'));var Papa=require('papaparse');var Redis=require(_0xc8da('0xe'));var authService=require(_0xc8da('0xf'));var qs=require(_0xc8da('0x10'));var as=require(_0xc8da('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8da('0x12'))('api');var utils=require(_0xc8da('0x13'));var config=require(_0xc8da('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc8da('0x15'));function respondWithStatusCode(_0x11e72a,_0x2d6359){_0x2d6359=_0x2d6359||0xcc;return function(_0x276247){if(_0x276247){return _0x11e72a[_0xc8da('0x16')](_0x2d6359);}return _0x11e72a[_0xc8da('0x17')](_0x2d6359)['end']();};}function respondWithResult(_0x2ad9fe,_0x4a7bd9){_0x4a7bd9=_0x4a7bd9||0xc8;return function(_0x250419){if(_0x250419){return _0x2ad9fe[_0xc8da('0x17')](_0x4a7bd9)[_0xc8da('0x18')](_0x250419);}};}function respondWithFilteredResult(_0xc0ef54,_0x24c2fb){return function(_0x1e830b){if(_0x1e830b){var _0x432738=typeof _0x24c2fb[_0xc8da('0x19')]==='undefined'&&typeof _0x24c2fb[_0xc8da('0x1a')]===_0xc8da('0x1b');var _0x1fdc1d=_0x1e830b[_0xc8da('0x1c')];var _0x45dcae=_0x432738?0x0:_0x24c2fb[_0xc8da('0x19')];var _0x32c301=_0x432738?_0x1e830b[_0xc8da('0x1c')]:_0x24c2fb[_0xc8da('0x19')]+_0x24c2fb['limit'];var _0x49d7a7;if(_0x32c301>=_0x1fdc1d){_0x32c301=_0x1fdc1d;_0x49d7a7=0xc8;}else{_0x49d7a7=0xce;}_0xc0ef54['status'](_0x49d7a7);return _0xc0ef54[_0xc8da('0x1d')](_0xc8da('0x1e'),_0x45dcae+'-'+_0x32c301+'/'+_0x1fdc1d)[_0xc8da('0x18')](_0x1e830b);}return null;};}function patchUpdates(_0x579e83){return function(_0x1d4c71){try{jsonpatch[_0xc8da('0x1f')](_0x1d4c71,_0x579e83,!![]);}catch(_0x1abcb8){return BPromise['reject'](_0x1abcb8);}return _0x1d4c71[_0xc8da('0x20')]();};}function saveUpdates(_0x55414c,_0x10fbf0){return function(_0x584457){if(_0x584457){return _0x584457['update'](_0x55414c)[_0xc8da('0x21')](function(_0x483d59){return _0x483d59;});}return null;};}function removeEntity(_0x52a11e,_0x4cdf7c){return function(_0x1af0b2){if(_0x1af0b2){return _0x1af0b2[_0xc8da('0x22')]()[_0xc8da('0x21')](function(){_0x52a11e[_0xc8da('0x17')](0xcc)[_0xc8da('0x23')]();});}};}function handleEntityNotFound(_0x3b5ab5,_0x3f2e11){return function(_0x4ee31e){if(!_0x4ee31e){_0x3b5ab5['sendStatus'](0x194);}return _0x4ee31e;};}function handleError(_0x29b706,_0xaefaf){_0xaefaf=_0xaefaf||0x1f4;return function(_0x5fc679){logger[_0xc8da('0x24')](_0x5fc679[_0xc8da('0x25')]);if(_0x5fc679[_0xc8da('0x26')]){delete _0x5fc679['name'];}_0x29b706[_0xc8da('0x17')](_0xaefaf)[_0xc8da('0x27')](_0x5fc679);};}exports[_0xc8da('0x28')]=function(_0x37150d,_0x295526){var _0x39dfa7={},_0x12ae20={},_0x57837a={'count':0x0,'rows':[]};var _0x163edb=_['map'](db['ServicenowAccount'][_0xc8da('0x29')],function(_0xbdd7ae){return{'name':_0xbdd7ae['fieldName'],'type':_0xbdd7ae[_0xc8da('0x2a')][_0xc8da('0x2b')]};});_0x12ae20[_0xc8da('0x2c')]=_[_0xc8da('0x2d')](_0x163edb,_0xc8da('0x26'));_0x12ae20[_0xc8da('0x2e')]=_[_0xc8da('0x2f')](_0x37150d['query']);_0x12ae20[_0xc8da('0x30')]=_[_0xc8da('0x31')](_0x12ae20[_0xc8da('0x2c')],_0x12ae20['query']);_0x39dfa7[_0xc8da('0x32')]=_[_0xc8da('0x31')](_0x12ae20[_0xc8da('0x2c')],qs['fields'](_0x37150d['query']['fields']));_0x39dfa7[_0xc8da('0x32')]=_0x39dfa7[_0xc8da('0x32')][_0xc8da('0x33')]?_0x39dfa7[_0xc8da('0x32')]:_0x12ae20['model'];if(!_0x37150d[_0xc8da('0x2e')]['hasOwnProperty']('nolimit')){_0x39dfa7[_0xc8da('0x1a')]=qs[_0xc8da('0x1a')](_0x37150d[_0xc8da('0x2e')]['limit']);_0x39dfa7[_0xc8da('0x19')]=qs[_0xc8da('0x19')](_0x37150d[_0xc8da('0x2e')][_0xc8da('0x19')]);}_0x39dfa7['order']=qs['sort'](_0x37150d[_0xc8da('0x2e')][_0xc8da('0x34')]);_0x39dfa7[_0xc8da('0x35')]=qs['filters'](_['pick'](_0x37150d[_0xc8da('0x2e')],_0x12ae20[_0xc8da('0x30')]),_0x163edb);if(_0x37150d[_0xc8da('0x2e')]['filter']){_0x39dfa7[_0xc8da('0x35')]=_['merge'](_0x39dfa7[_0xc8da('0x35')],{'$or':_['map'](_0x163edb,function(_0x32df39){if(_0x32df39[_0xc8da('0x2a')]!==_0xc8da('0x36')){var _0x380378={};_0x380378[_0x32df39['name']]={'$like':'%'+_0x37150d[_0xc8da('0x2e')][_0xc8da('0x37')]+'%'};return _0x380378;}})});}_0x39dfa7=_['merge']({},_0x39dfa7,_0x37150d['options']);var _0x2993ac={'where':_0x39dfa7['where']};return db[_0xc8da('0x38')]['count'](_0x2993ac)[_0xc8da('0x21')](function(_0x7588d3){_0x57837a[_0xc8da('0x1c')]=_0x7588d3;if(_0x37150d[_0xc8da('0x2e')][_0xc8da('0x39')]){_0x39dfa7['include']=[{'all':!![]}];}return db[_0xc8da('0x38')]['findAll'](_0x39dfa7);})[_0xc8da('0x21')](function(_0xf4b317){_0x57837a['rows']=_0xf4b317;return _0x57837a;})['then'](respondWithFilteredResult(_0x295526,_0x39dfa7))[_0xc8da('0x3a')](handleError(_0x295526,null));};exports[_0xc8da('0x3b')]=function(_0x2c7cb0,_0x50e146){var _0xf75bd9={'raw':![],'where':{'id':_0x2c7cb0[_0xc8da('0x3c')]['id']}},_0x8cd794={};_0x8cd794['model']=_[_0xc8da('0x2f')](db[_0xc8da('0x38')][_0xc8da('0x29')]);_0x8cd794[_0xc8da('0x2e')]=_[_0xc8da('0x2f')](_0x2c7cb0['query']);_0x8cd794[_0xc8da('0x30')]=_['intersection'](_0x8cd794[_0xc8da('0x2c')],_0x8cd794['query']);_0xf75bd9[_0xc8da('0x32')]=_[_0xc8da('0x31')](_0x8cd794['model'],qs[_0xc8da('0x3d')](_0x2c7cb0[_0xc8da('0x2e')][_0xc8da('0x3d')]));_0xf75bd9[_0xc8da('0x32')]=_0xf75bd9[_0xc8da('0x32')][_0xc8da('0x33')]?_0xf75bd9[_0xc8da('0x32')]:_0x8cd794[_0xc8da('0x2c')];if(_0x2c7cb0[_0xc8da('0x2e')][_0xc8da('0x39')]){_0xf75bd9[_0xc8da('0x3e')]=[{'all':!![]}];}_0xf75bd9=_[_0xc8da('0x3f')]({},_0xf75bd9,_0x2c7cb0['options']);return db['ServicenowAccount'][_0xc8da('0x40')](_0xf75bd9)[_0xc8da('0x21')](handleEntityNotFound(_0x50e146,null))[_0xc8da('0x21')](respondWithResult(_0x50e146,null))[_0xc8da('0x3a')](handleError(_0x50e146,null));};exports[_0xc8da('0x41')]=function(_0x3a6b04,_0x4a6219){return db[_0xc8da('0x38')]['create'](_0x3a6b04['body'],{})[_0xc8da('0x21')](respondWithResult(_0x4a6219,0xc9))[_0xc8da('0x3a')](handleError(_0x4a6219,null));};exports[_0xc8da('0x42')]=function(_0x7ca146,_0x3407f0){if(_0x7ca146['body']['id']){delete _0x7ca146[_0xc8da('0x43')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x7ca146[_0xc8da('0x3c')]['id']}})[_0xc8da('0x21')](handleEntityNotFound(_0x3407f0,null))[_0xc8da('0x21')](saveUpdates(_0x7ca146[_0xc8da('0x43')],null))[_0xc8da('0x21')](respondWithResult(_0x3407f0,null))[_0xc8da('0x3a')](handleError(_0x3407f0,null));};exports[_0xc8da('0x22')]=function(_0x30a420,_0x26867e){return db[_0xc8da('0x38')]['find']({'where':{'id':_0x30a420['params']['id']}})[_0xc8da('0x21')](handleEntityNotFound(_0x26867e,null))[_0xc8da('0x21')](removeEntity(_0x26867e,null))[_0xc8da('0x3a')](handleError(_0x26867e,null));};exports[_0xc8da('0x44')]=function(_0x476895,_0xc6be12,_0x41fa4b){var _0xac870b={};var _0x5e1fd5={};var _0x30b506;var _0x5b2edc;return db[_0xc8da('0x38')][_0xc8da('0x45')]({'where':{'id':_0x476895['params']['id']}})[_0xc8da('0x21')](handleEntityNotFound(_0xc6be12,null))['then'](function(_0x125137){if(_0x125137){_0x30b506=_0x125137;_0x5e1fd5[_0xc8da('0x2c')]=_['keys'](db[_0xc8da('0x46')][_0xc8da('0x29')]);_0x5e1fd5[_0xc8da('0x2e')]=_[_0xc8da('0x2f')](_0x476895[_0xc8da('0x2e')]);_0x5e1fd5[_0xc8da('0x30')]=_[_0xc8da('0x31')](_0x5e1fd5[_0xc8da('0x2c')],_0x5e1fd5['query']);_0xac870b[_0xc8da('0x32')]=_['intersection'](_0x5e1fd5[_0xc8da('0x2c')],qs[_0xc8da('0x3d')](_0x476895[_0xc8da('0x2e')][_0xc8da('0x3d')]));_0xac870b[_0xc8da('0x32')]=_0xac870b[_0xc8da('0x32')][_0xc8da('0x33')]?_0xac870b['attributes']:_0x5e1fd5[_0xc8da('0x2c')];_0xac870b[_0xc8da('0x47')]=qs[_0xc8da('0x34')](_0x476895[_0xc8da('0x2e')][_0xc8da('0x34')]);_0xac870b[_0xc8da('0x35')]=qs[_0xc8da('0x30')](_[_0xc8da('0x48')](_0x476895[_0xc8da('0x2e')],_0x5e1fd5[_0xc8da('0x30')]));if(_0x476895[_0xc8da('0x2e')][_0xc8da('0x37')]){_0xac870b[_0xc8da('0x35')]=_[_0xc8da('0x3f')](_0xac870b[_0xc8da('0x35')],{'$or':_[_0xc8da('0x2d')](_0xac870b[_0xc8da('0x32')],function(_0x3d354d){var _0x480aab={};_0x480aab[_0x3d354d]={'$like':'%'+_0x476895['query'][_0xc8da('0x37')]+'%'};return _0x480aab;})});}_0xac870b=_[_0xc8da('0x3f')]({},_0xac870b,_0x476895[_0xc8da('0x49')]);return _0x30b506[_0xc8da('0x44')](_0xac870b);}})[_0xc8da('0x21')](function(_0x5db961){if(_0x5db961){_0x5b2edc=_0x5db961[_0xc8da('0x33')];if(!_0x476895[_0xc8da('0x2e')][_0xc8da('0x4a')](_0xc8da('0x4b'))){_0xac870b[_0xc8da('0x1a')]=qs['limit'](_0x476895['query']['limit']);_0xac870b[_0xc8da('0x19')]=qs[_0xc8da('0x19')](_0x476895[_0xc8da('0x2e')][_0xc8da('0x19')]);}return _0x30b506[_0xc8da('0x44')](_0xac870b);}})['then'](function(_0x15cbfa){if(_0x15cbfa){return _0x15cbfa?{'count':_0x5b2edc,'rows':_0x15cbfa}:null;}})[_0xc8da('0x21')](respondWithResult(_0xc6be12,null))[_0xc8da('0x3a')](handleError(_0xc6be12,null));};exports[_0xc8da('0x4c')]=function(_0x199135,_0x5562fb,_0x1348e9){if(_0x199135['body']['id']){delete _0x199135[_0xc8da('0x43')]['id'];}return db[_0xc8da('0x38')]['findOne']({'where':{'id':_0x199135[_0xc8da('0x3c')]['id']}})[_0xc8da('0x21')](handleEntityNotFound(_0x5562fb,null))['then'](function(_0x5a6e0a){if(_0x5a6e0a){_0x199135[_0xc8da('0x43')][_0xc8da('0x4d')]=_0x5a6e0a['id'];_0x199135[_0xc8da('0x43')][_0xc8da('0x4e')]=integrations[_0xc8da('0x4f')](_0x199135[_0xc8da('0x43')][_0xc8da('0x50')],_0x199135[_0xc8da('0x43')]['type']);_0x199135[_0xc8da('0x43')]['Descriptions']=integrations[_0xc8da('0x51')](_0x199135['body'][_0xc8da('0x50')],_0x199135[_0xc8da('0x43')][_0xc8da('0x2a')]);return db['ServicenowConfiguration'][_0xc8da('0x41')](_0x199135[_0xc8da('0x43')],{'include':[{'model':db[_0xc8da('0x52')],'as':_0xc8da('0x4e')},{'model':db[_0xc8da('0x52')],'as':_0xc8da('0x53')}]});}return null;})[_0xc8da('0x21')](respondWithResult(_0x5562fb,null))['catch'](handleError(_0x5562fb,null));};exports[_0xc8da('0x54')]=function(_0x15f27a,_0x1f7617,_0x58b7e9){var _0xd5984a=[_0xc8da('0x55'),_0xc8da('0x56'),_0xc8da('0x57'),'subcategory',_0xc8da('0x58'),_0xc8da('0x59'),_0xc8da('0x5a'),_0xc8da('0x5b'),_0xc8da('0x5c')];var _0x24f885=[_0xc8da('0x5d'),'made_sla',_0xc8da('0x5e'),'watch_list',_0xc8da('0x5f'),'sys_updated_on',_0xc8da('0x60'),'hold_reason',_0xc8da('0x61'),_0xc8da('0x62'),_0xc8da('0x63'),_0xc8da('0x64'),_0xc8da('0x65'),_0xc8da('0x66'),_0xc8da('0x67'),_0xc8da('0x68'),_0xc8da('0x69'),_0xc8da('0x6a'),_0xc8da('0x57'),'order',_0xc8da('0x6b'),'closed_at',_0xc8da('0x6c'),_0xc8da('0x6d'),_0xc8da('0x6e'),_0xc8da('0x6f'),'work_notes_list','business_service',_0xc8da('0x70'),_0xc8da('0x71'),_0xc8da('0x72'),_0xc8da('0x73'),'expected_start','opened_at',_0xc8da('0x74'),_0xc8da('0x75'),_0xc8da('0x76'),_0xc8da('0x77'),'resolved_at',_0xc8da('0x78'),'approval_set','subcategory',_0xc8da('0x79'),_0xc8da('0x7a'),_0xc8da('0x58'),'correlation_display',_0xc8da('0x7b'),'work_start',_0xc8da('0x7c'),_0xc8da('0x7d'),'additional_assignee_list',_0xc8da('0x7e'),'calendar_duration',_0xc8da('0x59'),'sys_class_name',_0xc8da('0x7f'),_0xc8da('0x80'),_0xc8da('0x81'),_0xc8da('0x82'),'sys_id','contact_type',_0xc8da('0x83'),_0xc8da('0x5a'),_0xc8da('0x84'),_0xc8da('0x85'),_0xc8da('0x86'),_0xc8da('0x87'),_0xc8da('0x88'),_0xc8da('0x89'),_0xc8da('0x5b'),_0xc8da('0x8a'),_0xc8da('0x8b'),_0xc8da('0x8c'),'comments_and_work_notes',_0xc8da('0x8d'),_0xc8da('0x8e'),'reopen_count',_0xc8da('0x8f'),_0xc8da('0x90'),_0xc8da('0x91'),'correlation_id','location',_0xc8da('0x5c')];var _0x149a38='';var _0x132f22='';var _0x462293=[];var _0x2520d1='';var _0x181ecd='';var _0x1fb29f=[];var _0x1e6f80='';var _0x98b9a0='';var _0x4d09c3={};var _0x137fb3='';return db[_0xc8da('0x38')][_0xc8da('0x45')]({'where':{'id':_0x15f27a[_0xc8da('0x3c')]['id']},'attributes':['id','username',_0xc8da('0x92'),_0xc8da('0x93'),_0xc8da('0x94'),'serverUrl']})[_0xc8da('0x21')](handleEntityNotFound(_0x1f7617,null))[_0xc8da('0x21')](function(_0x2bc6ed){if(_0x2bc6ed){_0x137fb3=_0x2bc6ed[_0xc8da('0x94')];var _0x2980fa=_0x137fb3[_0xc8da('0x95')](-0x1);if(_0x2980fa==='/'){_0x137fb3=_0x137fb3[_0xc8da('0x96')](0x0,_0x137fb3[_0xc8da('0x97')](_0x2980fa));}_0x98b9a0=util[_0xc8da('0x98')](_0xc8da('0x99'),_0x137fb3);_0x1e6f80=util[_0xc8da('0x98')](_0xc8da('0x9a'),_0x137fb3);_0x4d09c3={'user':_0x2bc6ed[_0xc8da('0x9b')],'pass':_0x2bc6ed['password']};var _0x8a79d0={'method':_0xc8da('0x9c'),'uri':_0x98b9a0+_0xc8da('0x9d'),'auth':_0x4d09c3,'json':!![]};return rp(_0x8a79d0);}})[_0xc8da('0x21')](function(_0x34f0f5){if(_0x34f0f5[_0xc8da('0x9e')][_0xc8da('0x33')]>0x0){_0x149a38=_0x34f0f5[_0xc8da('0x9e')];}console['log']('incident\x20table\x20objects',_0x149a38);_0x1fb29f=[];_0x132f22=Object[_0xc8da('0x9f')]([],_0x149a38);_[_0xc8da('0xa0')](_0x132f22,function(_0x446e02){return!_0xd5984a[_0xc8da('0xa1')](_0x446e02['name']);});_0x132f22['forEach'](function(_0x4d5c9a){var _0x13902c=createFieldObject(_0x1e6f80,_0x4d09c3,_0x4d5c9a[_0xc8da('0xa2')],_0x4d5c9a[_0xc8da('0x26')],_0x4d5c9a[_0xc8da('0xa3')],![]);_0x1fb29f[_0xc8da('0xa4')](_0x13902c);});return Promise[_0xc8da('0xa5')](_0x1fb29f);})['then'](function(_0x3adf0f){_0x462293=_0x3adf0f;_0x2520d1=Object[_0xc8da('0x9f')]([],_0x149a38);console[_0xc8da('0xa6')](_0xc8da('0xa7'),_0x149a38);_[_0xc8da('0xa0')](_0x2520d1,function(_0x2d23bd){return _0x24f885['includes'](_0x2d23bd[_0xc8da('0x26')]);});console[_0xc8da('0xa6')](_0xc8da('0xa8'),_0x2520d1);_0x1fb29f=[];_0x2520d1[_0xc8da('0xa9')](function(_0x49fdfc){var _0x438e40=createFieldObject(_0x1e6f80,_0x4d09c3,_0x49fdfc[_0xc8da('0xa2')],_0x49fdfc[_0xc8da('0x26')],_0x49fdfc[_0xc8da('0xa3')],!![]);_0x1fb29f['push'](_0x438e40);});return Promise[_0xc8da('0xa5')](_0x1fb29f);})['then'](function(_0x44185c){_0x181ecd=_0x44185c;var _0x577778=_0x462293[_0xc8da('0xaa')](_0x181ecd);return{'count':_0x577778['length'],'rows':_0x577778};})[_0xc8da('0x21')](respondWithResult(_0x1f7617,null))['catch'](function(_0x33eea1){console[_0xc8da('0xa6')]('ServiceNow\x20error:\x20'+_0x33eea1);var _0x39372f=_0x15f27a[_0xc8da('0x2e')][_0xc8da('0xab')]?0x1f4:_0x33eea1[_0xc8da('0xac')]||0x1f4;logger[_0xc8da('0x24')](_0x33eea1[_0xc8da('0x25')]);delete _0x33eea1[_0xc8da('0x26')];if(_0x39372f===0x191){_0x39372f=0x190;}_0x1f7617[_0xc8da('0x17')](_0x39372f)[_0xc8da('0x27')](_0x15f27a[_0xc8da('0x2e')]['test']?{'message':_0xc8da('0xad'),'statusCode':_0x33eea1[_0xc8da('0xac')]}:_0x33eea1);});};function createFieldObject(_0x2fb01b,_0x463256,_0x483130,_0x4adb60,_0x56640c,_0x37a92d){return new Promise(function(_0x204339,_0x3ce497){var _0x26272f={'id':_0x4adb60,'name':_0x56640c,'custom':_0x37a92d};if(_0x483130===_0xc8da('0xae')){_0x26272f['options']=[{'name':'True','value':_0xc8da('0xaf')},{'name':_0xc8da('0xb0'),'value':_0xc8da('0xb1')}];_0x204339(_0x26272f);}else{var _0x5e6639={'method':_0xc8da('0x9c'),'uri':_0x2fb01b+_0xc8da('0xb2')+_0x4adb60,'auth':_0x463256,'json':!![]};return rp(_0x5e6639)[_0xc8da('0x21')](function(_0x3d09cf){var _0x34749e=[];if(_0x3d09cf[_0xc8da('0x9e')][_0xc8da('0x33')]>0x0){_0x3d09cf['result'][_0xc8da('0xa9')](function(_0x5bf28d){if(_0x5bf28d['inactive']==='false'){var _0x3f63d0={'name':_0x5bf28d[_0xc8da('0xa3')],'value':_0x5bf28d[_0xc8da('0xb3')]};_0x34749e[_0xc8da('0xa4')](_0x3f63d0);}});}_0x26272f[_0xc8da('0x49')]=_0x34749e;if(_0x26272f[_0xc8da('0x49')]['length']>0x0){_0x204339(_0x26272f);}else{if(_0x37a92d==![]){_0x204339();}else{_0x204339(_0x26272f);}}});}});} \ No newline at end of file +var _0xa1c8=['keys','find','catch','create','body','getConfigurations','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','follow_up','parent_incident','sys_id','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','findOne','username','email','serverUrl','remoteUri','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','inactive','value','push','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ServicenowAccount','includeAll','include','findAll','rows','show','params'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa1c8,0x146));var _0x8a1c=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xa1c8[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a1c('0x0'));var zipdir=require(_0x8a1c('0x1'));var jsonpatch=require(_0x8a1c('0x2'));var rp=require(_0x8a1c('0x3'));var moment=require(_0x8a1c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8a1c('0x5'));var path=require('path');var sox=require(_0x8a1c('0x6'));var csv=require(_0x8a1c('0x7'));var ejs=require(_0x8a1c('0x8'));var fs=require('fs');var fs_extra=require(_0x8a1c('0x9'));var _=require(_0x8a1c('0xa'));var squel=require(_0x8a1c('0xb'));var crypto=require(_0x8a1c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8a1c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8a1c('0xe'));var Papa=require(_0x8a1c('0xf'));var Redis=require(_0x8a1c('0x10'));var authService=require(_0x8a1c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8a1c('0x12'));var hardwareService=require(_0x8a1c('0x13'));var logger=require(_0x8a1c('0x14'))('api');var utils=require(_0x8a1c('0x15'));var config=require(_0x8a1c('0x16'));var licenseUtil=require(_0x8a1c('0x17'));var db=require(_0x8a1c('0x18'))['db'];var integrations=require(_0x8a1c('0x19'));function respondWithStatusCode(_0x4df1c8,_0x5cb05a){_0x5cb05a=_0x5cb05a||0xcc;return function(_0x18be86){if(_0x18be86){return _0x4df1c8['sendStatus'](_0x5cb05a);}return _0x4df1c8[_0x8a1c('0x1a')](_0x5cb05a)['end']();};}function respondWithResult(_0x319571,_0x316fdf){_0x316fdf=_0x316fdf||0xc8;return function(_0x19c17f){if(_0x19c17f){return _0x319571[_0x8a1c('0x1a')](_0x316fdf)['json'](_0x19c17f);}};}function respondWithFilteredResult(_0x446ac0,_0x2e6966){return function(_0x5d5aa8){if(_0x5d5aa8){var _0x3ad3ce=typeof _0x2e6966[_0x8a1c('0x1b')]===_0x8a1c('0x1c')&&typeof _0x2e6966[_0x8a1c('0x1d')]===_0x8a1c('0x1c');var _0x4879da=_0x5d5aa8[_0x8a1c('0x1e')];var _0x1ef176=_0x3ad3ce?0x0:_0x2e6966[_0x8a1c('0x1b')];var _0x391030=_0x3ad3ce?_0x5d5aa8[_0x8a1c('0x1e')]:_0x2e6966[_0x8a1c('0x1b')]+_0x2e6966[_0x8a1c('0x1d')];var _0x3b23c9;if(_0x391030>=_0x4879da){_0x391030=_0x4879da;_0x3b23c9=0xc8;}else{_0x3b23c9=0xce;}_0x446ac0[_0x8a1c('0x1a')](_0x3b23c9);return _0x446ac0[_0x8a1c('0x1f')]('Content-Range',_0x1ef176+'-'+_0x391030+'/'+_0x4879da)['json'](_0x5d5aa8);}return null;};}function patchUpdates(_0x491edb){return function(_0x2bafc4){try{jsonpatch[_0x8a1c('0x20')](_0x2bafc4,_0x491edb,!![]);}catch(_0x53686b){return BPromise[_0x8a1c('0x21')](_0x53686b);}return _0x2bafc4['save']();};}function saveUpdates(_0xf321ad,_0x3e03fb){return function(_0x9b7ab7){if(_0x9b7ab7){return _0x9b7ab7[_0x8a1c('0x22')](_0xf321ad)[_0x8a1c('0x23')](function(_0x33a6cf){return _0x33a6cf;});}return null;};}function removeEntity(_0x168d03,_0xd8e296){return function(_0x162840){if(_0x162840){return _0x162840[_0x8a1c('0x24')]()[_0x8a1c('0x23')](function(){_0x168d03[_0x8a1c('0x1a')](0xcc)[_0x8a1c('0x25')]();});}};}function handleEntityNotFound(_0x3b494f,_0x5c5378){return function(_0x5e473c){if(!_0x5e473c){_0x3b494f['sendStatus'](0x194);}return _0x5e473c;};}function handleError(_0x461a6e,_0x68bed9){_0x68bed9=_0x68bed9||0x1f4;return function(_0xb1f22){logger[_0x8a1c('0x26')](_0xb1f22[_0x8a1c('0x27')]);if(_0xb1f22[_0x8a1c('0x28')]){delete _0xb1f22[_0x8a1c('0x28')];}_0x461a6e[_0x8a1c('0x1a')](_0x68bed9)[_0x8a1c('0x29')](_0xb1f22);};}exports['index']=function(_0x3d8903,_0x306d39){var _0x506358={},_0x4c9141={},_0x54c92f={'count':0x0,'rows':[]};var _0xa56ecf=_[_0x8a1c('0x2a')](db['ServicenowAccount'][_0x8a1c('0x2b')],function(_0x538772){return{'name':_0x538772[_0x8a1c('0x2c')],'type':_0x538772[_0x8a1c('0x2d')][_0x8a1c('0x2e')]};});_0x4c9141[_0x8a1c('0x2f')]=_[_0x8a1c('0x2a')](_0xa56ecf,_0x8a1c('0x28'));_0x4c9141[_0x8a1c('0x30')]=_['keys'](_0x3d8903[_0x8a1c('0x30')]);_0x4c9141[_0x8a1c('0x31')]=_[_0x8a1c('0x32')](_0x4c9141['model'],_0x4c9141[_0x8a1c('0x30')]);_0x506358[_0x8a1c('0x33')]=_[_0x8a1c('0x32')](_0x4c9141['model'],qs[_0x8a1c('0x34')](_0x3d8903[_0x8a1c('0x30')][_0x8a1c('0x34')]));_0x506358[_0x8a1c('0x33')]=_0x506358[_0x8a1c('0x33')][_0x8a1c('0x35')]?_0x506358[_0x8a1c('0x33')]:_0x4c9141[_0x8a1c('0x2f')];if(!_0x3d8903['query'][_0x8a1c('0x36')](_0x8a1c('0x37'))){_0x506358[_0x8a1c('0x1d')]=qs[_0x8a1c('0x1d')](_0x3d8903[_0x8a1c('0x30')]['limit']);_0x506358[_0x8a1c('0x1b')]=qs['offset'](_0x3d8903[_0x8a1c('0x30')][_0x8a1c('0x1b')]);}_0x506358[_0x8a1c('0x38')]=qs[_0x8a1c('0x39')](_0x3d8903[_0x8a1c('0x30')]['sort']);_0x506358[_0x8a1c('0x3a')]=qs[_0x8a1c('0x31')](_[_0x8a1c('0x3b')](_0x3d8903[_0x8a1c('0x30')],_0x4c9141[_0x8a1c('0x31')]),_0xa56ecf);if(_0x3d8903[_0x8a1c('0x30')][_0x8a1c('0x3c')]){_0x506358['where']=_[_0x8a1c('0x3d')](_0x506358['where'],{'$or':_['map'](_0xa56ecf,function(_0x58f8c1){if(_0x58f8c1[_0x8a1c('0x2d')]!==_0x8a1c('0x3e')){var _0x26930e={};_0x26930e[_0x58f8c1[_0x8a1c('0x28')]]={'$like':'%'+_0x3d8903[_0x8a1c('0x30')][_0x8a1c('0x3c')]+'%'};return _0x26930e;}})});}_0x506358=_[_0x8a1c('0x3d')]({},_0x506358,_0x3d8903['options']);var _0x486735={'where':_0x506358[_0x8a1c('0x3a')]};return db[_0x8a1c('0x3f')][_0x8a1c('0x1e')](_0x486735)[_0x8a1c('0x23')](function(_0x2d5ec6){_0x54c92f[_0x8a1c('0x1e')]=_0x2d5ec6;if(_0x3d8903[_0x8a1c('0x30')][_0x8a1c('0x40')]){_0x506358[_0x8a1c('0x41')]=[{'all':!![]}];}return db[_0x8a1c('0x3f')][_0x8a1c('0x42')](_0x506358);})[_0x8a1c('0x23')](function(_0x164366){_0x54c92f[_0x8a1c('0x43')]=_0x164366;return _0x54c92f;})[_0x8a1c('0x23')](respondWithFilteredResult(_0x306d39,_0x506358))['catch'](handleError(_0x306d39,null));};exports[_0x8a1c('0x44')]=function(_0x188fed,_0x5e7fa5){var _0x29f0d3={'raw':![],'where':{'id':_0x188fed[_0x8a1c('0x45')]['id']}},_0x12e502={};_0x12e502[_0x8a1c('0x2f')]=_[_0x8a1c('0x46')](db[_0x8a1c('0x3f')][_0x8a1c('0x2b')]);_0x12e502[_0x8a1c('0x30')]=_[_0x8a1c('0x46')](_0x188fed[_0x8a1c('0x30')]);_0x12e502[_0x8a1c('0x31')]=_['intersection'](_0x12e502[_0x8a1c('0x2f')],_0x12e502['query']);_0x29f0d3[_0x8a1c('0x33')]=_[_0x8a1c('0x32')](_0x12e502[_0x8a1c('0x2f')],qs[_0x8a1c('0x34')](_0x188fed[_0x8a1c('0x30')]['fields']));_0x29f0d3[_0x8a1c('0x33')]=_0x29f0d3['attributes'][_0x8a1c('0x35')]?_0x29f0d3[_0x8a1c('0x33')]:_0x12e502['model'];if(_0x188fed['query'][_0x8a1c('0x40')]){_0x29f0d3[_0x8a1c('0x41')]=[{'all':!![]}];}_0x29f0d3=_[_0x8a1c('0x3d')]({},_0x29f0d3,_0x188fed['options']);return db[_0x8a1c('0x3f')][_0x8a1c('0x47')](_0x29f0d3)[_0x8a1c('0x23')](handleEntityNotFound(_0x5e7fa5,null))[_0x8a1c('0x23')](respondWithResult(_0x5e7fa5,null))[_0x8a1c('0x48')](handleError(_0x5e7fa5,null));};exports[_0x8a1c('0x49')]=function(_0x49efec,_0x356e26){return db['ServicenowAccount'][_0x8a1c('0x49')](_0x49efec[_0x8a1c('0x4a')],{})[_0x8a1c('0x23')](respondWithResult(_0x356e26,0xc9))['catch'](handleError(_0x356e26,null));};exports['update']=function(_0x16d5d6,_0x4f3c86){if(_0x16d5d6[_0x8a1c('0x4a')]['id']){delete _0x16d5d6[_0x8a1c('0x4a')]['id'];}return db[_0x8a1c('0x3f')][_0x8a1c('0x47')]({'where':{'id':_0x16d5d6[_0x8a1c('0x45')]['id']}})[_0x8a1c('0x23')](handleEntityNotFound(_0x4f3c86,null))[_0x8a1c('0x23')](saveUpdates(_0x16d5d6['body'],null))[_0x8a1c('0x23')](respondWithResult(_0x4f3c86,null))[_0x8a1c('0x48')](handleError(_0x4f3c86,null));};exports[_0x8a1c('0x24')]=function(_0x4a4e79,_0x2d3e2f){return db[_0x8a1c('0x3f')][_0x8a1c('0x47')]({'where':{'id':_0x4a4e79[_0x8a1c('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d3e2f,null))[_0x8a1c('0x23')](removeEntity(_0x2d3e2f,null))[_0x8a1c('0x48')](handleError(_0x2d3e2f,null));};exports[_0x8a1c('0x4b')]=function(_0x9d0e0f,_0x302b34,_0x35bf46){var _0x1c0417={};var _0x53886c={};var _0x17ef8a;var _0x5c899e;return db[_0x8a1c('0x3f')]['findOne']({'where':{'id':_0x9d0e0f[_0x8a1c('0x45')]['id']}})[_0x8a1c('0x23')](handleEntityNotFound(_0x302b34,null))['then'](function(_0x1381b3){if(_0x1381b3){_0x17ef8a=_0x1381b3;_0x53886c[_0x8a1c('0x2f')]=_[_0x8a1c('0x46')](db['ServicenowConfiguration']['rawAttributes']);_0x53886c[_0x8a1c('0x30')]=_[_0x8a1c('0x46')](_0x9d0e0f[_0x8a1c('0x30')]);_0x53886c[_0x8a1c('0x31')]=_['intersection'](_0x53886c[_0x8a1c('0x2f')],_0x53886c[_0x8a1c('0x30')]);_0x1c0417[_0x8a1c('0x33')]=_[_0x8a1c('0x32')](_0x53886c[_0x8a1c('0x2f')],qs['fields'](_0x9d0e0f['query'][_0x8a1c('0x34')]));_0x1c0417[_0x8a1c('0x33')]=_0x1c0417[_0x8a1c('0x33')][_0x8a1c('0x35')]?_0x1c0417[_0x8a1c('0x33')]:_0x53886c[_0x8a1c('0x2f')];_0x1c0417[_0x8a1c('0x38')]=qs[_0x8a1c('0x39')](_0x9d0e0f[_0x8a1c('0x30')][_0x8a1c('0x39')]);_0x1c0417[_0x8a1c('0x3a')]=qs[_0x8a1c('0x31')](_[_0x8a1c('0x3b')](_0x9d0e0f['query'],_0x53886c['filters']));if(_0x9d0e0f[_0x8a1c('0x30')][_0x8a1c('0x3c')]){_0x1c0417[_0x8a1c('0x3a')]=_[_0x8a1c('0x3d')](_0x1c0417[_0x8a1c('0x3a')],{'$or':_[_0x8a1c('0x2a')](_0x1c0417['attributes'],function(_0x17aab3){var _0x36d374={};_0x36d374[_0x17aab3]={'$like':'%'+_0x9d0e0f[_0x8a1c('0x30')][_0x8a1c('0x3c')]+'%'};return _0x36d374;})});}_0x1c0417=_['merge']({},_0x1c0417,_0x9d0e0f[_0x8a1c('0x4c')]);return _0x17ef8a[_0x8a1c('0x4b')](_0x1c0417);}})[_0x8a1c('0x23')](function(_0x297dd6){if(_0x297dd6){_0x5c899e=_0x297dd6[_0x8a1c('0x35')];if(!_0x9d0e0f[_0x8a1c('0x30')][_0x8a1c('0x36')](_0x8a1c('0x37'))){_0x1c0417[_0x8a1c('0x1d')]=qs[_0x8a1c('0x1d')](_0x9d0e0f[_0x8a1c('0x30')][_0x8a1c('0x1d')]);_0x1c0417[_0x8a1c('0x1b')]=qs['offset'](_0x9d0e0f[_0x8a1c('0x30')][_0x8a1c('0x1b')]);}return _0x17ef8a[_0x8a1c('0x4b')](_0x1c0417);}})[_0x8a1c('0x23')](function(_0x59ca29){if(_0x59ca29){return _0x59ca29?{'count':_0x5c899e,'rows':_0x59ca29}:null;}})[_0x8a1c('0x23')](respondWithResult(_0x302b34,null))[_0x8a1c('0x48')](handleError(_0x302b34,null));};exports[_0x8a1c('0x4d')]=function(_0x1e831b,_0x99070e,_0x282092){if(_0x1e831b[_0x8a1c('0x4a')]['id']){delete _0x1e831b[_0x8a1c('0x4a')]['id'];}return db[_0x8a1c('0x3f')]['findOne']({'where':{'id':_0x1e831b[_0x8a1c('0x45')]['id']}})[_0x8a1c('0x23')](handleEntityNotFound(_0x99070e,null))[_0x8a1c('0x23')](function(_0x509bfa){if(_0x509bfa){_0x1e831b[_0x8a1c('0x4a')][_0x8a1c('0x4e')]=_0x509bfa['id'];_0x1e831b[_0x8a1c('0x4a')][_0x8a1c('0x4f')]=integrations[_0x8a1c('0x50')](_0x1e831b[_0x8a1c('0x4a')][_0x8a1c('0x51')],_0x1e831b[_0x8a1c('0x4a')][_0x8a1c('0x2d')]);_0x1e831b['body'][_0x8a1c('0x52')]=integrations[_0x8a1c('0x53')](_0x1e831b['body']['channel'],_0x1e831b['body']['type']);return db['ServicenowConfiguration'][_0x8a1c('0x49')](_0x1e831b[_0x8a1c('0x4a')],{'include':[{'model':db[_0x8a1c('0x54')],'as':_0x8a1c('0x4f')},{'model':db[_0x8a1c('0x54')],'as':_0x8a1c('0x52')}]});}return null;})[_0x8a1c('0x23')](respondWithResult(_0x99070e,null))['catch'](handleError(_0x99070e,null));};exports[_0x8a1c('0x55')]=function(_0x4588e0,_0x14a700,_0x41bd26){var _0x253a40=[_0x8a1c('0x56'),_0x8a1c('0x57'),_0x8a1c('0x58'),'subcategory',_0x8a1c('0x59'),_0x8a1c('0x5a'),_0x8a1c('0x5b'),_0x8a1c('0x5c'),_0x8a1c('0x5d')];var _0x4807aa=[_0x8a1c('0x5e'),'made_sla',_0x8a1c('0x5f'),_0x8a1c('0x60'),_0x8a1c('0x61'),_0x8a1c('0x62'),_0x8a1c('0x63'),_0x8a1c('0x57'),_0x8a1c('0x64'),_0x8a1c('0x65'),_0x8a1c('0x66'),_0x8a1c('0x67'),_0x8a1c('0x68'),_0x8a1c('0x69'),_0x8a1c('0x6a'),_0x8a1c('0x6b'),_0x8a1c('0x6c'),_0x8a1c('0x6d'),'knowledge','order','calendar_stc',_0x8a1c('0x6e'),_0x8a1c('0x6f'),_0x8a1c('0x70'),_0x8a1c('0x71'),'active',_0x8a1c('0x72'),_0x8a1c('0x73'),_0x8a1c('0x74'),_0x8a1c('0x75'),_0x8a1c('0x76'),_0x8a1c('0x77'),_0x8a1c('0x78'),_0x8a1c('0x79'),_0x8a1c('0x7a'),_0x8a1c('0x7b'),_0x8a1c('0x7c'),'reopened_time',_0x8a1c('0x7d'),_0x8a1c('0x7e'),'approval_set',_0x8a1c('0x7f'),_0x8a1c('0x80'),_0x8a1c('0x81'),_0x8a1c('0x59'),_0x8a1c('0x82'),_0x8a1c('0x83'),_0x8a1c('0x84'),_0x8a1c('0x85'),_0x8a1c('0x86'),_0x8a1c('0x87'),_0x8a1c('0x88'),_0x8a1c('0x89'),'notify','sys_class_name',_0x8a1c('0x8a'),'closed_by',_0x8a1c('0x8b'),_0x8a1c('0x8c'),_0x8a1c('0x8d'),'contact_type',_0x8a1c('0x8e'),'incident_state',_0x8a1c('0x8f'),'problem_id',_0x8a1c('0x90'),_0x8a1c('0x91'),_0x8a1c('0x92'),_0x8a1c('0x93'),_0x8a1c('0x5c'),_0x8a1c('0x94'),'sla_due',_0x8a1c('0x95'),_0x8a1c('0x96'),_0x8a1c('0x97'),_0x8a1c('0x98'),_0x8a1c('0x99'),_0x8a1c('0x9a'),_0x8a1c('0x9b'),_0x8a1c('0x9c'),_0x8a1c('0x9d'),_0x8a1c('0x9e'),_0x8a1c('0x5d')];var _0x2e41f8='';var _0x3ff48d='';var _0x6b44c9=[];var _0x2ba8c3='';var _0x5f2f69='';var _0x54b639=[];var _0x9af20b='';var _0x24ab03='';var _0x2ac3aa={};var _0x56ae3e='';return db[_0x8a1c('0x3f')][_0x8a1c('0x9f')]({'where':{'id':_0x4588e0[_0x8a1c('0x45')]['id']},'attributes':['id',_0x8a1c('0xa0'),'password',_0x8a1c('0xa1'),'remoteUri',_0x8a1c('0xa2')]})[_0x8a1c('0x23')](handleEntityNotFound(_0x14a700,null))[_0x8a1c('0x23')](function(_0x53bf32){if(_0x53bf32){_0x56ae3e=_0x53bf32[_0x8a1c('0xa3')];var _0x246e50=_0x56ae3e[_0x8a1c('0xa4')](-0x1);if(_0x246e50==='/'){_0x56ae3e=_0x56ae3e[_0x8a1c('0xa5')](0x0,_0x56ae3e[_0x8a1c('0xa6')](_0x246e50));}_0x24ab03=util['format'](_0x8a1c('0xa7'),_0x56ae3e);_0x9af20b=util[_0x8a1c('0xa8')](_0x8a1c('0xa9'),_0x56ae3e);_0x2ac3aa={'user':_0x53bf32[_0x8a1c('0xa0')],'pass':_0x53bf32[_0x8a1c('0xaa')]};var _0x3b85bd={'method':_0x8a1c('0xab'),'uri':_0x24ab03+_0x8a1c('0xac'),'auth':_0x2ac3aa,'json':!![]};return rp(_0x3b85bd);}})['then'](function(_0x32483f){if(_0x32483f['result'][_0x8a1c('0x35')]>0x0){_0x2e41f8=_0x32483f[_0x8a1c('0xad')];}console[_0x8a1c('0xae')](_0x8a1c('0xaf'),_0x2e41f8);_0x54b639=[];_0x3ff48d=Object['assign']([],_0x2e41f8);_[_0x8a1c('0xb0')](_0x3ff48d,function(_0x3d3dec){return!_0x253a40[_0x8a1c('0xb1')](_0x3d3dec['name']);});_0x3ff48d[_0x8a1c('0xb2')](function(_0x58edc6){var _0x3f040b=createFieldObject(_0x9af20b,_0x2ac3aa,_0x58edc6[_0x8a1c('0xb3')],_0x58edc6[_0x8a1c('0x28')],_0x58edc6[_0x8a1c('0xb4')],![]);_0x54b639['push'](_0x3f040b);});return Promise[_0x8a1c('0xb5')](_0x54b639);})[_0x8a1c('0x23')](function(_0x3e6fa4){_0x6b44c9=_0x3e6fa4;_0x2ba8c3=Object[_0x8a1c('0xb6')]([],_0x2e41f8);console[_0x8a1c('0xae')](_0x8a1c('0xb7'),_0x2e41f8);_[_0x8a1c('0xb0')](_0x2ba8c3,function(_0x265fd6){return _0x4807aa[_0x8a1c('0xb1')](_0x265fd6[_0x8a1c('0x28')]);});console[_0x8a1c('0xae')](_0x8a1c('0xb8'),_0x2ba8c3);_0x54b639=[];_0x2ba8c3[_0x8a1c('0xb2')](function(_0x57da13){var _0x5deabf=createFieldObject(_0x9af20b,_0x2ac3aa,_0x57da13[_0x8a1c('0xb3')],_0x57da13['name'],_0x57da13[_0x8a1c('0xb4')],!![]);_0x54b639['push'](_0x5deabf);});return Promise['all'](_0x54b639);})[_0x8a1c('0x23')](function(_0x370ab8){_0x5f2f69=_0x370ab8;var _0x90df34=_0x6b44c9[_0x8a1c('0xb9')](_0x5f2f69);return{'count':_0x90df34[_0x8a1c('0x35')],'rows':_0x90df34};})[_0x8a1c('0x23')](respondWithResult(_0x14a700,null))[_0x8a1c('0x48')](function(_0x3935aa){console['log'](_0x8a1c('0xba')+_0x3935aa);var _0x4b43c8=_0x4588e0[_0x8a1c('0x30')][_0x8a1c('0xbb')]?0x1f4:_0x3935aa[_0x8a1c('0xbc')]||0x1f4;logger['error'](_0x3935aa[_0x8a1c('0x27')]);delete _0x3935aa[_0x8a1c('0x28')];if(_0x4b43c8===0x191){_0x4b43c8=0x190;}_0x14a700[_0x8a1c('0x1a')](_0x4b43c8)[_0x8a1c('0x29')](_0x4588e0[_0x8a1c('0x30')][_0x8a1c('0xbb')]?{'message':_0x8a1c('0xbd'),'statusCode':_0x3935aa[_0x8a1c('0xbc')]}:_0x3935aa);});};function createFieldObject(_0xfd0ba5,_0x5efc42,_0x272b1f,_0x58d75f,_0x20f742,_0x2b5067){return new Promise(function(_0x558237,_0x5f095f){var _0x3964f9={'id':_0x58d75f,'name':_0x20f742,'custom':_0x2b5067};if(_0x272b1f===_0x8a1c('0xbe')){_0x3964f9[_0x8a1c('0x4c')]=[{'name':_0x8a1c('0xbf'),'value':_0x8a1c('0xc0')},{'name':_0x8a1c('0xc1'),'value':_0x8a1c('0xc2')}];_0x558237(_0x3964f9);}else{var _0x42dd38={'method':'GET','uri':_0xfd0ba5+'sys_choice?sysparm_query=name=incident^element='+_0x58d75f,'auth':_0x5efc42,'json':!![]};return rp(_0x42dd38)[_0x8a1c('0x23')](function(_0x115527){var _0x5b9a6d=[];if(_0x115527['result'][_0x8a1c('0x35')]>0x0){_0x115527[_0x8a1c('0xad')][_0x8a1c('0xb2')](function(_0xc93fdf){if(_0xc93fdf[_0x8a1c('0xc3')]===_0x8a1c('0xc2')){var _0x3532ff={'name':_0xc93fdf['label'],'value':_0xc93fdf[_0x8a1c('0xc4')]};_0x5b9a6d[_0x8a1c('0xc5')](_0x3532ff);}});}_0x3964f9['options']=_0x5b9a6d;if(_0x3964f9[_0x8a1c('0x4c')]['length']>0x0){_0x558237(_0x3964f9);}else{if(_0x2b5067==![]){_0x558237();}else{_0x558237(_0x3964f9);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index ede76b0..7cfb9fa 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 _0xeda8=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x44b604,_0x21c079){var _0x3968ac=function(_0x636989){while(--_0x636989){_0x44b604['push'](_0x44b604['shift']());}};_0x3968ac(++_0x21c079);}(_0xeda8,0x104));var _0x8eda=function(_0x3d91bb,_0x362cd2){_0x3d91bb=_0x3d91bb-0x0;var _0x48969a=_0xeda8[_0x3d91bb];return _0x48969a;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));var integrations=require(_0x8eda('0xa'));module[_0x8eda('0xb')]=function(_0x349361,_0x32abe8){return _0x349361['define'](_0x8eda('0xc'),attributes,{'tableName':_0x8eda('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31f0=['./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2ef9e7,_0x486990){var _0x25b86a=function(_0x502f0e){while(--_0x502f0e){_0x2ef9e7['push'](_0x2ef9e7['shift']());}};_0x25b86a(++_0x486990);}(_0x31f0,0xb7));var _0x031f=function(_0x5efc05,_0x238fde){_0x5efc05=_0x5efc05-0x0;var _0x2c2c0d=_0x31f0[_0x5efc05];return _0x2c2c0d;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x56328c,_0x3dc98e){return _0x56328c['define'](_0x031f('0x8'),attributes,{'tableName':_0x031f('0x9'),'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 513b551..757343c 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 _0xd874=['error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xd874,0x1cb));var _0x4d87=function(_0x1c3bf5,_0x2b97d4){_0x1c3bf5=_0x1c3bf5-0x0;var _0x5c42db=_0xd874[_0x1c3bf5];return _0x5c42db;};'use strict';var _=require(_0x4d87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4d87('0x1'));var rs=require(_0x4d87('0x2'));var fs=require('fs');var Redis=require(_0x4d87('0x3'));var db=require(_0x4d87('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4d87('0x5'));var jayson=require(_0x4d87('0x6'));var client=jayson[_0x4d87('0x7')][_0x4d87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x132db9,_0x2b28a1,_0x4bc8e0){return new BPromise(function(_0x3104f8,_0x496fe8){return client[_0x4d87('0x9')](_0x132db9,_0x4bc8e0)[_0x4d87('0xa')](function(_0xb57754){logger[_0x4d87('0xb')](_0x4d87('0xc'),_0x2b28a1,_0x4d87('0xd'));logger[_0x4d87('0xe')](_0x4d87('0xf'),_0x2b28a1,_0x4d87('0xd'),JSON[_0x4d87('0x10')](_0xb57754));if(_0xb57754[_0x4d87('0x11')]){if(_0xb57754[_0x4d87('0x11')][_0x4d87('0x12')]===0x1f4){logger['error'](_0x4d87('0xc'),_0x2b28a1,_0xb57754['error'][_0x4d87('0x13')]);return _0x496fe8(_0xb57754['error'][_0x4d87('0x13')]);}logger[_0x4d87('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x2b28a1,_0xb57754[_0x4d87('0x11')]['message']);return _0x3104f8(_0xb57754[_0x4d87('0x11')][_0x4d87('0x13')]);}else{logger[_0x4d87('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x2b28a1,_0x4d87('0xd'));_0x3104f8(_0xb57754[_0x4d87('0x14')][_0x4d87('0x13')]);}})[_0x4d87('0x15')](function(_0x136827){logger['error'](_0x4d87('0xc'),_0x2b28a1,_0x136827);_0x496fe8(_0x136827);});});}exports[_0x4d87('0x16')]=function(_0x4a78a5){var _0x23a40e=this;return new Promise(function(_0x147815,_0x1f3ff6){return db['ServicenowAccount'][_0x4d87('0x17')]({'raw':_0x4a78a5[_0x4d87('0x18')]?_0x4a78a5['options'][_0x4d87('0x19')]===undefined?!![]:![]:!![],'where':_0x4a78a5[_0x4d87('0x18')]?_0x4a78a5['options'][_0x4d87('0x1a')]||null:null,'attributes':_0x4a78a5[_0x4d87('0x18')]?_0x4a78a5[_0x4d87('0x18')][_0x4d87('0x1b')]||null:null,'limit':_0x4a78a5['options']?_0x4a78a5[_0x4d87('0x18')][_0x4d87('0x1c')]||null:null,'include':_0x4a78a5['options']?_0x4a78a5[_0x4d87('0x18')][_0x4d87('0x1d')]?_[_0x4d87('0x1e')](_0x4a78a5[_0x4d87('0x18')][_0x4d87('0x1d')],function(_0x2b88bf){return{'model':db[_0x2b88bf[_0x4d87('0x1f')]],'as':_0x2b88bf['as'],'attributes':_0x2b88bf['attributes'],'include':_0x2b88bf['include']?_['map'](_0x2b88bf[_0x4d87('0x1d')],function(_0x212831){return{'model':db[_0x212831[_0x4d87('0x1f')]],'as':_0x212831['as'],'attributes':_0x212831['attributes'],'include':_0x212831[_0x4d87('0x1d')]?_[_0x4d87('0x1e')](_0x212831[_0x4d87('0x1d')],function(_0x3e8ac1){return{'model':db[_0x3e8ac1[_0x4d87('0x1f')]],'as':_0x3e8ac1['as'],'attributes':_0x3e8ac1[_0x4d87('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4d87('0xa')](function(_0x1cdf02){logger['info']('GetServicenowAccount',_0x4a78a5);logger[_0x4d87('0xe')](_0x4d87('0x16'),_0x4a78a5,JSON[_0x4d87('0x10')](_0x1cdf02));_0x147815(_0x1cdf02);})[_0x4d87('0x15')](function(_0x480685){logger[_0x4d87('0x11')](_0x4d87('0x16'),_0x480685['message'],_0x4a78a5);_0x1f3ff6(_0x23a40e[_0x4d87('0x11')](0x1f4,_0x480685['message']));});});};exports[_0x4d87('0x20')]=function(_0x946c09){var _0x5757a2=this;return new Promise(function(_0x4ad778,_0x22e1f1){return db['ServicenowAccount'][_0x4d87('0x21')]({'raw':_0x946c09['options']?_0x946c09[_0x4d87('0x18')][_0x4d87('0x19')]===undefined?!![]:![]:!![],'where':_0x946c09[_0x4d87('0x18')]?_0x946c09[_0x4d87('0x18')]['where']||null:null,'attributes':_0x946c09[_0x4d87('0x18')]?_0x946c09[_0x4d87('0x18')]['attributes']||null:null,'include':_0x946c09[_0x4d87('0x18')]?_0x946c09['options'][_0x4d87('0x1d')]?_[_0x4d87('0x1e')](_0x946c09[_0x4d87('0x18')]['include'],function(_0x27af3d){return{'model':db[_0x27af3d['model']],'as':_0x27af3d['as'],'attributes':_0x27af3d[_0x4d87('0x1b')],'include':_0x27af3d[_0x4d87('0x1d')]?_[_0x4d87('0x1e')](_0x27af3d[_0x4d87('0x1d')],function(_0x52a2f3){return{'model':db[_0x52a2f3['model']],'as':_0x52a2f3['as'],'attributes':_0x52a2f3['attributes'],'include':_0x52a2f3[_0x4d87('0x1d')]?_[_0x4d87('0x1e')](_0x52a2f3[_0x4d87('0x1d')],function(_0x5e38f3){return{'model':db[_0x5e38f3[_0x4d87('0x1f')]],'as':_0x5e38f3['as'],'attributes':_0x5e38f3[_0x4d87('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4d87('0xa')](function(_0x45ec57){logger[_0x4d87('0xb')](_0x4d87('0x20'),_0x946c09);logger[_0x4d87('0xe')](_0x4d87('0x20'),_0x946c09,JSON[_0x4d87('0x10')](_0x45ec57));_0x4ad778(_0x45ec57);})[_0x4d87('0x15')](function(_0x3f8737){logger[_0x4d87('0x11')](_0x4d87('0x20'),_0x3f8737[_0x4d87('0x13')],_0x946c09);_0x22e1f1(_0x5757a2[_0x4d87('0x11')](0x1f4,_0x3f8737[_0x4d87('0x13')]));});});}; \ No newline at end of file +var _0x85b7=['client','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowServicenowAccount','find','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x85b7,0xaa));var _0x785b=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x85b7[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x785b('0x0'));var util=require(_0x785b('0x1'));var moment=require(_0x785b('0x2'));var BPromise=require(_0x785b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x785b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x785b('0x5'));var logger=require(_0x785b('0x6'))(_0x785b('0x7'));var config=require(_0x785b('0x8'));var jayson=require(_0x785b('0x9'));var client=jayson[_0x785b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15cd55,_0x5b58f3,_0x40dc4c){return new BPromise(function(_0x44ea40,_0x294e4a){return client[_0x785b('0xb')](_0x15cd55,_0x40dc4c)[_0x785b('0xc')](function(_0x3d30f3){logger['info'](_0x785b('0xd'),_0x5b58f3,_0x785b('0xe'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5b58f3,'request\x20sent',JSON['stringify'](_0x3d30f3));if(_0x3d30f3[_0x785b('0xf')]){if(_0x3d30f3['error'][_0x785b('0x10')]===0x1f4){logger['error'](_0x785b('0xd'),_0x5b58f3,_0x3d30f3[_0x785b('0xf')][_0x785b('0x11')]);return _0x294e4a(_0x3d30f3[_0x785b('0xf')]['message']);}logger['error'](_0x785b('0xd'),_0x5b58f3,_0x3d30f3[_0x785b('0xf')][_0x785b('0x11')]);return _0x44ea40(_0x3d30f3[_0x785b('0xf')][_0x785b('0x11')]);}else{logger[_0x785b('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x5b58f3,_0x785b('0xe'));_0x44ea40(_0x3d30f3[_0x785b('0x13')][_0x785b('0x11')]);}})['catch'](function(_0x237f1b){logger[_0x785b('0xf')](_0x785b('0xd'),_0x5b58f3,_0x237f1b);_0x294e4a(_0x237f1b);});});}exports[_0x785b('0x14')]=function(_0x54bdd4){var _0x5ddb85=this;return new Promise(function(_0xf35fe0,_0x17a9fc){return db[_0x785b('0x15')][_0x785b('0x16')]({'raw':_0x54bdd4[_0x785b('0x17')]?_0x54bdd4['options'][_0x785b('0x18')]===undefined?!![]:![]:!![],'where':_0x54bdd4['options']?_0x54bdd4[_0x785b('0x17')][_0x785b('0x19')]||null:null,'attributes':_0x54bdd4[_0x785b('0x17')]?_0x54bdd4[_0x785b('0x17')][_0x785b('0x1a')]||null:null,'limit':_0x54bdd4[_0x785b('0x17')]?_0x54bdd4[_0x785b('0x17')][_0x785b('0x1b')]||null:null,'include':_0x54bdd4[_0x785b('0x17')]?_0x54bdd4['options'][_0x785b('0x1c')]?_[_0x785b('0x1d')](_0x54bdd4[_0x785b('0x17')][_0x785b('0x1c')],function(_0x418cd9){return{'model':db[_0x418cd9[_0x785b('0x1e')]],'as':_0x418cd9['as'],'attributes':_0x418cd9[_0x785b('0x1a')],'include':_0x418cd9['include']?_[_0x785b('0x1d')](_0x418cd9[_0x785b('0x1c')],function(_0x1ecb53){return{'model':db[_0x1ecb53[_0x785b('0x1e')]],'as':_0x1ecb53['as'],'attributes':_0x1ecb53[_0x785b('0x1a')],'include':_0x1ecb53[_0x785b('0x1c')]?_[_0x785b('0x1d')](_0x1ecb53[_0x785b('0x1c')],function(_0x397590){return{'model':db[_0x397590['model']],'as':_0x397590['as'],'attributes':_0x397590[_0x785b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x785b('0xc')](function(_0x3835d8){logger[_0x785b('0x12')](_0x785b('0x14'),_0x54bdd4);logger[_0x785b('0x1f')](_0x785b('0x14'),_0x54bdd4,JSON[_0x785b('0x20')](_0x3835d8));_0xf35fe0(_0x3835d8);})['catch'](function(_0x511d81){logger[_0x785b('0xf')]('GetServicenowAccount',_0x511d81[_0x785b('0x11')],_0x54bdd4);_0x17a9fc(_0x5ddb85[_0x785b('0xf')](0x1f4,_0x511d81['message']));});});};exports[_0x785b('0x21')]=function(_0x52c5a9){var _0x1f5d75=this;return new Promise(function(_0x5c19ae,_0x52f517){return db[_0x785b('0x15')][_0x785b('0x22')]({'raw':_0x52c5a9[_0x785b('0x17')]?_0x52c5a9[_0x785b('0x17')][_0x785b('0x18')]===undefined?!![]:![]:!![],'where':_0x52c5a9[_0x785b('0x17')]?_0x52c5a9[_0x785b('0x17')][_0x785b('0x19')]||null:null,'attributes':_0x52c5a9[_0x785b('0x17')]?_0x52c5a9[_0x785b('0x17')][_0x785b('0x1a')]||null:null,'include':_0x52c5a9[_0x785b('0x17')]?_0x52c5a9[_0x785b('0x17')][_0x785b('0x1c')]?_[_0x785b('0x1d')](_0x52c5a9[_0x785b('0x17')]['include'],function(_0x1e88f5){return{'model':db[_0x1e88f5['model']],'as':_0x1e88f5['as'],'attributes':_0x1e88f5[_0x785b('0x1a')],'include':_0x1e88f5[_0x785b('0x1c')]?_[_0x785b('0x1d')](_0x1e88f5['include'],function(_0x4a5bc9){return{'model':db[_0x4a5bc9[_0x785b('0x1e')]],'as':_0x4a5bc9['as'],'attributes':_0x4a5bc9[_0x785b('0x1a')],'include':_0x4a5bc9[_0x785b('0x1c')]?_[_0x785b('0x1d')](_0x4a5bc9['include'],function(_0x1e44e2){return{'model':db[_0x1e44e2[_0x785b('0x1e')]],'as':_0x1e44e2['as'],'attributes':_0x1e44e2[_0x785b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x785b('0xc')](function(_0x2aef6c){logger[_0x785b('0x12')]('ShowServicenowAccount',_0x52c5a9);logger[_0x785b('0x1f')]('ShowServicenowAccount',_0x52c5a9,JSON['stringify'](_0x2aef6c));_0x5c19ae(_0x2aef6c);})[_0x785b('0x23')](function(_0x41650f){logger['error']('ShowServicenowAccount',_0x41650f['message'],_0x52c5a9);_0x52f517(_0x1f5d75[_0x785b('0xf')](0x1f4,_0x41650f['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 921a0e0..fd60918 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 _0x99ca=['/:id/subjects','getSubjects','/:id/descriptions','create','put','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields'];(function(_0x1065c8,_0x249b81){var _0x2208a2=function(_0x9b5406){while(--_0x9b5406){_0x1065c8['push'](_0x1065c8['shift']());}};_0x2208a2(++_0x249b81);}(_0x99ca,0x1ea));var _0xa99c=function(_0x2e061b,_0x44b05c){_0x2e061b=_0x2e061b-0x0;var _0x587974=_0x99ca[_0x2e061b];return _0x587974;};'use strict';var multer=require(_0xa99c('0x0'));var util=require(_0xa99c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa99c('0x2'));var router=express[_0xa99c('0x3')]();var fs_extra=require(_0xa99c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa99c('0x5'));var config=require('../../config/environment');var controller=require(_0xa99c('0x6'));router['get']('/',auth[_0xa99c('0x7')](),controller[_0xa99c('0x8')]);router[_0xa99c('0x9')](_0xa99c('0xa'),auth[_0xa99c('0x7')](),controller[_0xa99c('0xb')]);router[_0xa99c('0x9')](_0xa99c('0xc'),auth['isAuthenticated'](),controller[_0xa99c('0xd')]);router['get'](_0xa99c('0xe'),auth[_0xa99c('0x7')](),controller[_0xa99c('0xf')]);router[_0xa99c('0x9')](_0xa99c('0x10'),auth[_0xa99c('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0xa99c('0x7')](),controller[_0xa99c('0x11')]);router[_0xa99c('0x12')](_0xa99c('0xa'),auth[_0xa99c('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa99c('0x13')]);module[_0xa99c('0x14')]=router; \ No newline at end of file +var _0xa618=['../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x3f8a1b,_0xcb413a){var _0x1297c7=function(_0x39746a){while(--_0x39746a){_0x3f8a1b['push'](_0x3f8a1b['shift']());}};_0x1297c7(++_0xcb413a);}(_0xa618,0x1db));var _0x8a61=function(_0x35f8c1,_0x3f057f){_0x35f8c1=_0x35f8c1-0x0;var _0x1873e0=_0xa618[_0x35f8c1];return _0x1873e0;};'use strict';var multer=require('multer');var util=require(_0x8a61('0x0'));var path=require(_0x8a61('0x1'));var timeout=require(_0x8a61('0x2'));var express=require(_0x8a61('0x3'));var router=express[_0x8a61('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8a61('0x5'));var interaction=require(_0x8a61('0x6'));var config=require('../../config/environment');var controller=require(_0x8a61('0x7'));router[_0x8a61('0x8')]('/',auth[_0x8a61('0x9')](),controller['index']);router[_0x8a61('0x8')](_0x8a61('0xa'),auth[_0x8a61('0x9')](),controller[_0x8a61('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x8a61('0x8')](_0x8a61('0xc'),auth[_0x8a61('0x9')](),controller[_0x8a61('0xd')]);router[_0x8a61('0x8')](_0x8a61('0xe'),auth[_0x8a61('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x8a61('0x9')](),controller[_0x8a61('0xf')]);router[_0x8a61('0x10')](_0x8a61('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8a61('0x11')](_0x8a61('0xa'),auth[_0x8a61('0x9')](),controller[_0x8a61('0x12')]);module[_0x8a61('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 04828c7..f967494 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 _0x6f1a=['STRING','sequelize','exports'];(function(_0x49c949,_0x5666c7){var _0x2d3a33=function(_0x5af09d){while(--_0x5af09d){_0x49c949['push'](_0x49c949['shift']());}};_0x2d3a33(++_0x5666c7);}(_0x6f1a,0xe2));var _0xa6f1=function(_0x434003,_0x5b25c8){_0x434003=_0x434003-0x0;var _0x221609=_0x6f1a[_0x434003];return _0x221609;};'use strict';var Sequelize=require(_0xa6f1('0x0'));module[_0xa6f1('0x1')]={'name':{'type':Sequelize[_0xa6f1('0x2')]},'description':{'type':Sequelize[_0xa6f1('0x2')]}}; \ No newline at end of file +var _0xfb0c=['STRING','exports'];(function(_0x55874a,_0x1bda1c){var _0x129787=function(_0xcea03){while(--_0xcea03){_0x55874a['push'](_0x55874a['shift']());}};_0x129787(++_0x1bda1c);}(_0xfb0c,0x1db));var _0xcfb0=function(_0x19b194,_0x1d3bca){_0x19b194=_0x19b194-0x0;var _0x2465c5=_0xfb0c[_0x19b194];return _0x2465c5;};'use strict';var Sequelize=require('sequelize');module[_0xcfb0('0x0')]={'name':{'type':Sequelize[_0xcfb0('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b5fe1fe..b56ac95 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 _0x57e5=['Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','ServicenowConfiguration','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','getFields','order','filter','options','nolimit','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set'];(function(_0x166857,_0x17a80d){var _0x4583f3=function(_0x577de0){while(--_0x577de0){_0x166857['push'](_0x166857['shift']());}};_0x4583f3(++_0x17a80d);}(_0x57e5,0x11d));var _0x557e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x57e5[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require(_0x557e('0x0'));var rimraf=require(_0x557e('0x1'));var zipdir=require(_0x557e('0x2'));var jsonpatch=require(_0x557e('0x3'));var rp=require(_0x557e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x557e('0x5'));var path=require(_0x557e('0x6'));var sox=require(_0x557e('0x7'));var csv=require(_0x557e('0x8'));var ejs=require(_0x557e('0x9'));var fs=require('fs');var fs_extra=require(_0x557e('0xa'));var _=require(_0x557e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x557e('0xc'));var deskjs=require(_0x557e('0xd'));var toCsv=require(_0x557e('0x8'));var querystring=require(_0x557e('0xe'));var Papa=require(_0x557e('0xf'));var Redis=require(_0x557e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x557e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x557e('0x12'));var logger=require(_0x557e('0x13'))(_0x557e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x557e('0x15'));var db=require(_0x557e('0x16'))['db'];function respondWithStatusCode(_0xd37639,_0x71aeb4){_0x71aeb4=_0x71aeb4||0xcc;return function(_0x4fd817){if(_0x4fd817){return _0xd37639[_0x557e('0x17')](_0x71aeb4);}return _0xd37639[_0x557e('0x18')](_0x71aeb4)['end']();};}function respondWithResult(_0x37cf17,_0x1af0b6){_0x1af0b6=_0x1af0b6||0xc8;return function(_0x59de45){if(_0x59de45){return _0x37cf17['status'](_0x1af0b6)[_0x557e('0x19')](_0x59de45);}};}function respondWithFilteredResult(_0xa344ae,_0x1bb9fd){return function(_0x12a086){if(_0x12a086){var _0x32ae2f=typeof _0x1bb9fd[_0x557e('0x1a')]===_0x557e('0x1b')&&typeof _0x1bb9fd['limit']==='undefined';var _0x54cb2e=_0x12a086[_0x557e('0x1c')];var _0xdea603=_0x32ae2f?0x0:_0x1bb9fd[_0x557e('0x1a')];var _0x3c8c88=_0x32ae2f?_0x12a086['count']:_0x1bb9fd[_0x557e('0x1a')]+_0x1bb9fd[_0x557e('0x1d')];var _0x43cd71;if(_0x3c8c88>=_0x54cb2e){_0x3c8c88=_0x54cb2e;_0x43cd71=0xc8;}else{_0x43cd71=0xce;}_0xa344ae[_0x557e('0x18')](_0x43cd71);return _0xa344ae[_0x557e('0x1e')](_0x557e('0x1f'),_0xdea603+'-'+_0x3c8c88+'/'+_0x54cb2e)[_0x557e('0x19')](_0x12a086);}return null;};}function patchUpdates(_0x37b7fe){return function(_0x3b81bc){try{jsonpatch[_0x557e('0x20')](_0x3b81bc,_0x37b7fe,!![]);}catch(_0x29a086){return BPromise[_0x557e('0x21')](_0x29a086);}return _0x3b81bc[_0x557e('0x22')]();};}function saveUpdates(_0x3b3ac0,_0x2bfb8e){return function(_0x10d56e){if(_0x10d56e){return _0x10d56e[_0x557e('0x23')](_0x3b3ac0)['then'](function(_0x1ff97b){return _0x1ff97b;});}return null;};}function removeEntity(_0x59f71e,_0x32add6){return function(_0x5eb3f1){if(_0x5eb3f1){return _0x5eb3f1[_0x557e('0x24')]()[_0x557e('0x25')](function(){_0x59f71e[_0x557e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c316b,_0x20a189){return function(_0x4f7f1b){if(!_0x4f7f1b){_0x1c316b[_0x557e('0x17')](0x194);}return _0x4f7f1b;};}function handleError(_0x1d0c39,_0x4792a1){_0x4792a1=_0x4792a1||0x1f4;return function(_0x31bf0d){logger['error'](_0x31bf0d[_0x557e('0x26')]);if(_0x31bf0d[_0x557e('0x27')]){delete _0x31bf0d[_0x557e('0x27')];}_0x1d0c39['status'](_0x4792a1)[_0x557e('0x28')](_0x31bf0d);};}exports[_0x557e('0x29')]=function(_0x52e961,_0x21435a){var _0x446e46={},_0x36cad1={},_0x3d846d={'count':0x0,'rows':[]};var _0x4dc5fe=_[_0x557e('0x2a')](db[_0x557e('0x2b')]['rawAttributes'],function(_0x20da3c){return{'name':_0x20da3c[_0x557e('0x2c')],'type':_0x20da3c['type'][_0x557e('0x2d')]};});_0x36cad1[_0x557e('0x2e')]=_[_0x557e('0x2a')](_0x4dc5fe,_0x557e('0x27'));_0x36cad1[_0x557e('0x2f')]=_['keys'](_0x52e961['query']);_0x36cad1[_0x557e('0x30')]=_[_0x557e('0x31')](_0x36cad1[_0x557e('0x2e')],_0x36cad1[_0x557e('0x2f')]);_0x446e46[_0x557e('0x32')]=_['intersection'](_0x36cad1['model'],qs['fields'](_0x52e961['query'][_0x557e('0x33')]));_0x446e46[_0x557e('0x32')]=_0x446e46[_0x557e('0x32')][_0x557e('0x34')]?_0x446e46[_0x557e('0x32')]:_0x36cad1['model'];if(!_0x52e961[_0x557e('0x2f')][_0x557e('0x35')]('nolimit')){_0x446e46[_0x557e('0x1d')]=qs[_0x557e('0x1d')](_0x52e961[_0x557e('0x2f')][_0x557e('0x1d')]);_0x446e46[_0x557e('0x1a')]=qs['offset'](_0x52e961[_0x557e('0x2f')][_0x557e('0x1a')]);}_0x446e46['order']=qs[_0x557e('0x36')](_0x52e961[_0x557e('0x2f')][_0x557e('0x36')]);_0x446e46[_0x557e('0x37')]=qs['filters'](_[_0x557e('0x38')](_0x52e961[_0x557e('0x2f')],_0x36cad1['filters']),_0x4dc5fe);if(_0x52e961[_0x557e('0x2f')]['filter']){_0x446e46['where']=_[_0x557e('0x39')](_0x446e46[_0x557e('0x37')],{'$or':_[_0x557e('0x2a')](_0x4dc5fe,function(_0x358ec7){if(_0x358ec7['type']!=='VIRTUAL'){var _0x3f2e7a={};_0x3f2e7a[_0x358ec7[_0x557e('0x27')]]={'$like':'%'+_0x52e961['query']['filter']+'%'};return _0x3f2e7a;}})});}_0x446e46=_[_0x557e('0x39')]({},_0x446e46,_0x52e961['options']);var _0x10e8e9={'where':_0x446e46['where']};return db[_0x557e('0x2b')][_0x557e('0x1c')](_0x10e8e9)['then'](function(_0x3957d9){_0x3d846d[_0x557e('0x1c')]=_0x3957d9;if(_0x52e961[_0x557e('0x2f')][_0x557e('0x3a')]){_0x446e46[_0x557e('0x3b')]=[{'all':!![]}];}return db[_0x557e('0x2b')][_0x557e('0x3c')](_0x446e46);})[_0x557e('0x25')](function(_0x46fb80){_0x3d846d[_0x557e('0x3d')]=_0x46fb80;return _0x3d846d;})[_0x557e('0x25')](respondWithFilteredResult(_0x21435a,_0x446e46))[_0x557e('0x3e')](handleError(_0x21435a,null));};exports[_0x557e('0x3f')]=function(_0x5841ff,_0x5a2c80){var _0x17f7e1={'raw':![],'where':{'id':_0x5841ff[_0x557e('0x40')]['id']}},_0x53c7a4={};_0x53c7a4['model']=_[_0x557e('0x41')](db['ServicenowConfiguration'][_0x557e('0x42')]);_0x53c7a4[_0x557e('0x2f')]=_[_0x557e('0x41')](_0x5841ff['query']);_0x53c7a4[_0x557e('0x30')]=_[_0x557e('0x31')](_0x53c7a4[_0x557e('0x2e')],_0x53c7a4[_0x557e('0x2f')]);_0x17f7e1[_0x557e('0x32')]=_[_0x557e('0x31')](_0x53c7a4[_0x557e('0x2e')],qs['fields'](_0x5841ff[_0x557e('0x2f')][_0x557e('0x33')]));_0x17f7e1[_0x557e('0x32')]=_0x17f7e1['attributes'][_0x557e('0x34')]?_0x17f7e1['attributes']:_0x53c7a4['model'];if(_0x5841ff[_0x557e('0x2f')]['includeAll']){_0x17f7e1[_0x557e('0x3b')]=[{'all':!![]}];}_0x17f7e1=_[_0x557e('0x39')]({},_0x17f7e1,_0x5841ff['options']);return db[_0x557e('0x2b')]['find'](_0x17f7e1)[_0x557e('0x25')](handleEntityNotFound(_0x5a2c80,null))['then'](respondWithResult(_0x5a2c80,null))[_0x557e('0x3e')](handleError(_0x5a2c80,null));};exports[_0x557e('0x43')]=function(_0x19a202,_0x599f8a){return db['ServicenowConfiguration'][_0x557e('0x43')](_0x19a202[_0x557e('0x44')],{})[_0x557e('0x25')](respondWithResult(_0x599f8a,0xc9))[_0x557e('0x3e')](handleError(_0x599f8a,null));};exports[_0x557e('0x23')]=function(_0x5dbffc,_0x11c546){if(_0x5dbffc['body']['id']){delete _0x5dbffc[_0x557e('0x44')]['id'];}return db[_0x557e('0x2b')][_0x557e('0x45')]({'where':{'id':_0x5dbffc[_0x557e('0x40')]['id']}})['then'](handleEntityNotFound(_0x11c546,null))[_0x557e('0x25')](saveUpdates(_0x5dbffc[_0x557e('0x44')],null))['then'](respondWithResult(_0x11c546,null))['catch'](handleError(_0x11c546,null));};exports[_0x557e('0x24')]=function(_0xdffcc8,_0x2fb49b){return db[_0x557e('0x2b')][_0x557e('0x45')]({'where':{'id':_0xdffcc8[_0x557e('0x40')]['id']}})[_0x557e('0x25')](handleEntityNotFound(_0x2fb49b,null))[_0x557e('0x25')](removeEntity(_0x2fb49b,null))['catch'](handleError(_0x2fb49b,null));};exports[_0x557e('0x46')]=function(_0x14e837,_0x32e438,_0x20576d){var _0x4f429d={};var _0x5350c2={};var _0x25cbdb;var _0x25d3af;return db[_0x557e('0x2b')]['findOne']({'where':{'id':_0x14e837[_0x557e('0x40')]['id']}})['then'](handleEntityNotFound(_0x32e438,null))['then'](function(_0x33b9e1){if(_0x33b9e1){_0x25cbdb=_0x33b9e1;_0x5350c2[_0x557e('0x2e')]=_[_0x557e('0x41')](db['ServicenowField'][_0x557e('0x42')]);_0x5350c2[_0x557e('0x2f')]=_['keys'](_0x14e837[_0x557e('0x2f')]);_0x5350c2[_0x557e('0x30')]=_[_0x557e('0x31')](_0x5350c2[_0x557e('0x2e')],_0x5350c2[_0x557e('0x2f')]);_0x4f429d[_0x557e('0x32')]=_[_0x557e('0x31')](_0x5350c2[_0x557e('0x2e')],qs[_0x557e('0x33')](_0x14e837['query'][_0x557e('0x33')]));_0x4f429d[_0x557e('0x32')]=_0x4f429d[_0x557e('0x32')][_0x557e('0x34')]?_0x4f429d[_0x557e('0x32')]:_0x5350c2[_0x557e('0x2e')];_0x4f429d[_0x557e('0x47')]=qs['sort'](_0x14e837['query'][_0x557e('0x36')]);_0x4f429d[_0x557e('0x37')]=qs[_0x557e('0x30')](_[_0x557e('0x38')](_0x14e837[_0x557e('0x2f')],_0x5350c2[_0x557e('0x30')]));if(_0x14e837['query']['filter']){_0x4f429d[_0x557e('0x37')]=_[_0x557e('0x39')](_0x4f429d[_0x557e('0x37')],{'$or':_[_0x557e('0x2a')](_0x4f429d[_0x557e('0x32')],function(_0x4c5277){var _0x45ab15={};_0x45ab15[_0x4c5277]={'$like':'%'+_0x14e837['query'][_0x557e('0x48')]+'%'};return _0x45ab15;})});}_0x4f429d=_[_0x557e('0x39')]({},_0x4f429d,_0x14e837[_0x557e('0x49')]);return _0x25cbdb[_0x557e('0x46')](_0x4f429d);}})[_0x557e('0x25')](function(_0x1a9078){if(_0x1a9078){_0x25d3af=_0x1a9078[_0x557e('0x34')];if(!_0x14e837['query'][_0x557e('0x35')](_0x557e('0x4a'))){_0x4f429d[_0x557e('0x1d')]=qs[_0x557e('0x1d')](_0x14e837[_0x557e('0x2f')][_0x557e('0x1d')]);_0x4f429d['offset']=qs[_0x557e('0x1a')](_0x14e837[_0x557e('0x2f')][_0x557e('0x1a')]);}return _0x25cbdb[_0x557e('0x46')](_0x4f429d);}})['then'](function(_0x4116f9){if(_0x4116f9){return _0x4116f9?{'count':_0x25d3af,'rows':_0x4116f9}:null;}})[_0x557e('0x25')](respondWithResult(_0x32e438,null))[_0x557e('0x3e')](handleError(_0x32e438,null));};exports['getSubjects']=function(_0x24245c,_0x18758b,_0x37503b){var _0x10652a={};var _0x106011={};var _0x88954d;var _0x38925c;return db[_0x557e('0x2b')][_0x557e('0x4b')]({'where':{'id':_0x24245c['params']['id']}})[_0x557e('0x25')](handleEntityNotFound(_0x18758b,null))[_0x557e('0x25')](function(_0x5783ab){if(_0x5783ab){_0x88954d=_0x5783ab;_0x106011[_0x557e('0x2e')]=_[_0x557e('0x41')](db[_0x557e('0x4c')][_0x557e('0x42')]);_0x106011[_0x557e('0x2f')]=_[_0x557e('0x41')](_0x24245c[_0x557e('0x2f')]);_0x106011[_0x557e('0x30')]=_[_0x557e('0x31')](_0x106011[_0x557e('0x2e')],_0x106011[_0x557e('0x2f')]);_0x10652a[_0x557e('0x32')]=_['intersection'](_0x106011[_0x557e('0x2e')],qs['fields'](_0x24245c['query'][_0x557e('0x33')]));_0x10652a[_0x557e('0x32')]=_0x10652a[_0x557e('0x32')][_0x557e('0x34')]?_0x10652a['attributes']:_0x106011[_0x557e('0x2e')];_0x10652a[_0x557e('0x47')]=qs['sort'](_0x24245c[_0x557e('0x2f')][_0x557e('0x36')]);_0x10652a[_0x557e('0x37')]=qs['filters'](_[_0x557e('0x38')](_0x24245c[_0x557e('0x2f')],_0x106011[_0x557e('0x30')]));if(_0x24245c['query'][_0x557e('0x48')]){_0x10652a[_0x557e('0x37')]=_['merge'](_0x10652a['where'],{'$or':_[_0x557e('0x2a')](_0x10652a['attributes'],function(_0x3eb40c){var _0xf3d8a5={};_0xf3d8a5[_0x3eb40c]={'$like':'%'+_0x24245c[_0x557e('0x2f')][_0x557e('0x48')]+'%'};return _0xf3d8a5;})});}_0x10652a=_[_0x557e('0x39')]({},_0x10652a,_0x24245c['options']);return _0x88954d[_0x557e('0x4d')](_0x10652a);}})['then'](function(_0x1791cf){if(_0x1791cf){_0x38925c=_0x1791cf[_0x557e('0x34')];if(!_0x24245c[_0x557e('0x2f')][_0x557e('0x35')](_0x557e('0x4a'))){_0x10652a[_0x557e('0x1d')]=qs[_0x557e('0x1d')](_0x24245c['query'][_0x557e('0x1d')]);_0x10652a[_0x557e('0x1a')]=qs[_0x557e('0x1a')](_0x24245c[_0x557e('0x2f')]['offset']);}return _0x88954d[_0x557e('0x4d')](_0x10652a);}})[_0x557e('0x25')](function(_0x4ecb4b){if(_0x4ecb4b){return _0x4ecb4b?{'count':_0x38925c,'rows':_0x4ecb4b}:null;}})[_0x557e('0x25')](respondWithResult(_0x18758b,null))[_0x557e('0x3e')](handleError(_0x18758b,null));};exports[_0x557e('0x4e')]=function(_0x2f82e4,_0x5e6466,_0x40c4f0){var _0x44483c={};var _0x35a967={};var _0x486b0d;var _0x17e2ed;return db[_0x557e('0x2b')]['findOne']({'where':{'id':_0x2f82e4[_0x557e('0x40')]['id']}})[_0x557e('0x25')](handleEntityNotFound(_0x5e6466,null))[_0x557e('0x25')](function(_0x273d27){if(_0x273d27){_0x486b0d=_0x273d27;_0x35a967['model']=_[_0x557e('0x41')](db['ServicenowField'][_0x557e('0x42')]);_0x35a967['query']=_[_0x557e('0x41')](_0x2f82e4[_0x557e('0x2f')]);_0x35a967[_0x557e('0x30')]=_['intersection'](_0x35a967[_0x557e('0x2e')],_0x35a967[_0x557e('0x2f')]);_0x44483c['attributes']=_[_0x557e('0x31')](_0x35a967[_0x557e('0x2e')],qs[_0x557e('0x33')](_0x2f82e4['query'][_0x557e('0x33')]));_0x44483c[_0x557e('0x32')]=_0x44483c[_0x557e('0x32')][_0x557e('0x34')]?_0x44483c[_0x557e('0x32')]:_0x35a967[_0x557e('0x2e')];_0x44483c[_0x557e('0x47')]=qs[_0x557e('0x36')](_0x2f82e4['query'][_0x557e('0x36')]);_0x44483c[_0x557e('0x37')]=qs[_0x557e('0x30')](_[_0x557e('0x38')](_0x2f82e4[_0x557e('0x2f')],_0x35a967[_0x557e('0x30')]));if(_0x2f82e4['query']['filter']){_0x44483c[_0x557e('0x37')]=_['merge'](_0x44483c[_0x557e('0x37')],{'$or':_[_0x557e('0x2a')](_0x44483c[_0x557e('0x32')],function(_0x5cb3ed){var _0x428045={};_0x428045[_0x5cb3ed]={'$like':'%'+_0x2f82e4[_0x557e('0x2f')][_0x557e('0x48')]+'%'};return _0x428045;})});}_0x44483c=_['merge']({},_0x44483c,_0x2f82e4[_0x557e('0x49')]);return _0x486b0d[_0x557e('0x4e')](_0x44483c);}})['then'](function(_0x18c574){if(_0x18c574){_0x17e2ed=_0x18c574[_0x557e('0x34')];if(!_0x2f82e4['query'][_0x557e('0x35')](_0x557e('0x4a'))){_0x44483c[_0x557e('0x1d')]=qs['limit'](_0x2f82e4[_0x557e('0x2f')]['limit']);_0x44483c[_0x557e('0x1a')]=qs['offset'](_0x2f82e4['query']['offset']);}return _0x486b0d[_0x557e('0x4e')](_0x44483c);}})[_0x557e('0x25')](function(_0x198126){if(_0x198126){return _0x198126?{'count':_0x17e2ed,'rows':_0x198126}:null;}})[_0x557e('0x25')](respondWithResult(_0x5e6466,null))[_0x557e('0x3e')](handleError(_0x5e6466,null));}; \ No newline at end of file +var _0xd937=['../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','ServicenowConfiguration','rows','catch','show','params','length','options','create','body','find','findOne','ServicenowField','map','getFields','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x245f77,_0x3708f0){var _0x403319=function(_0x3c9423){while(--_0x3c9423){_0x245f77['push'](_0x245f77['shift']());}};_0x403319(++_0x3708f0);}(_0xd937,0x8c));var _0x7d93=function(_0x55c32c,_0x2e38e7){_0x55c32c=_0x55c32c-0x0;var _0x265e69=_0xd937[_0x55c32c];return _0x265e69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d93('0x0'));var zipdir=require(_0x7d93('0x1'));var jsonpatch=require(_0x7d93('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d93('0x3'));var Mustache=require(_0x7d93('0x4'));var util=require('util');var path=require(_0x7d93('0x5'));var sox=require('sox');var csv=require(_0x7d93('0x6'));var ejs=require(_0x7d93('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d93('0x8'));var squel=require('squel');var crypto=require(_0x7d93('0x9'));var jsforce=require(_0x7d93('0xa'));var deskjs=require(_0x7d93('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d93('0xc'));var Redis=require(_0x7d93('0xd'));var authService=require(_0x7d93('0xe'));var qs=require(_0x7d93('0xf'));var as=require(_0x7d93('0x10'));var hardwareService=require(_0x7d93('0x11'));var logger=require(_0x7d93('0x12'))(_0x7d93('0x13'));var utils=require(_0x7d93('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7d93('0x15'))['db'];function respondWithStatusCode(_0xb92cda,_0x7cf845){_0x7cf845=_0x7cf845||0xcc;return function(_0x3484ed){if(_0x3484ed){return _0xb92cda[_0x7d93('0x16')](_0x7cf845);}return _0xb92cda['status'](_0x7cf845)[_0x7d93('0x17')]();};}function respondWithResult(_0x3f2cb3,_0x399bda){_0x399bda=_0x399bda||0xc8;return function(_0x5bc45b){if(_0x5bc45b){return _0x3f2cb3[_0x7d93('0x18')](_0x399bda)['json'](_0x5bc45b);}};}function respondWithFilteredResult(_0x3b72f3,_0x57a905){return function(_0x387f2c){if(_0x387f2c){var _0x2a3967=typeof _0x57a905[_0x7d93('0x19')]===_0x7d93('0x1a')&&typeof _0x57a905[_0x7d93('0x1b')]===_0x7d93('0x1a');var _0x4d6935=_0x387f2c[_0x7d93('0x1c')];var _0x1fac7a=_0x2a3967?0x0:_0x57a905['offset'];var _0x1d0118=_0x2a3967?_0x387f2c[_0x7d93('0x1c')]:_0x57a905['offset']+_0x57a905[_0x7d93('0x1b')];var _0x2ed9c8;if(_0x1d0118>=_0x4d6935){_0x1d0118=_0x4d6935;_0x2ed9c8=0xc8;}else{_0x2ed9c8=0xce;}_0x3b72f3['status'](_0x2ed9c8);return _0x3b72f3[_0x7d93('0x1d')](_0x7d93('0x1e'),_0x1fac7a+'-'+_0x1d0118+'/'+_0x4d6935)[_0x7d93('0x1f')](_0x387f2c);}return null;};}function patchUpdates(_0x540c83){return function(_0x1d08f7){try{jsonpatch[_0x7d93('0x20')](_0x1d08f7,_0x540c83,!![]);}catch(_0x11fec5){return BPromise[_0x7d93('0x21')](_0x11fec5);}return _0x1d08f7[_0x7d93('0x22')]();};}function saveUpdates(_0x441774,_0x147be3){return function(_0x3757a4){if(_0x3757a4){return _0x3757a4['update'](_0x441774)['then'](function(_0xeb2f6a){return _0xeb2f6a;});}return null;};}function removeEntity(_0x33178b,_0xbc25be){return function(_0x56b03e){if(_0x56b03e){return _0x56b03e[_0x7d93('0x23')]()[_0x7d93('0x24')](function(){_0x33178b[_0x7d93('0x18')](0xcc)[_0x7d93('0x17')]();});}};}function handleEntityNotFound(_0x23ec97,_0x158aba){return function(_0x40cf34){if(!_0x40cf34){_0x23ec97[_0x7d93('0x16')](0x194);}return _0x40cf34;};}function handleError(_0x1b310e,_0x1455f8){_0x1455f8=_0x1455f8||0x1f4;return function(_0x5c1217){logger[_0x7d93('0x25')](_0x5c1217[_0x7d93('0x26')]);if(_0x5c1217['name']){delete _0x5c1217[_0x7d93('0x27')];}_0x1b310e[_0x7d93('0x18')](_0x1455f8)[_0x7d93('0x28')](_0x5c1217);};}exports[_0x7d93('0x29')]=function(_0x13af40,_0xabc2f0){var _0x15e3d5={},_0x396e40={},_0x33e9de={'count':0x0,'rows':[]};var _0x2fe996=_['map'](db['ServicenowConfiguration'][_0x7d93('0x2a')],function(_0x23df4e){return{'name':_0x23df4e[_0x7d93('0x2b')],'type':_0x23df4e[_0x7d93('0x2c')]['key']};});_0x396e40[_0x7d93('0x2d')]=_['map'](_0x2fe996,_0x7d93('0x27'));_0x396e40[_0x7d93('0x2e')]=_[_0x7d93('0x2f')](_0x13af40[_0x7d93('0x2e')]);_0x396e40[_0x7d93('0x30')]=_[_0x7d93('0x31')](_0x396e40[_0x7d93('0x2d')],_0x396e40['query']);_0x15e3d5['attributes']=_[_0x7d93('0x31')](_0x396e40[_0x7d93('0x2d')],qs[_0x7d93('0x32')](_0x13af40[_0x7d93('0x2e')]['fields']));_0x15e3d5[_0x7d93('0x33')]=_0x15e3d5[_0x7d93('0x33')]['length']?_0x15e3d5[_0x7d93('0x33')]:_0x396e40[_0x7d93('0x2d')];if(!_0x13af40[_0x7d93('0x2e')][_0x7d93('0x34')]('nolimit')){_0x15e3d5['limit']=qs['limit'](_0x13af40[_0x7d93('0x2e')][_0x7d93('0x1b')]);_0x15e3d5['offset']=qs['offset'](_0x13af40[_0x7d93('0x2e')]['offset']);}_0x15e3d5[_0x7d93('0x35')]=qs[_0x7d93('0x36')](_0x13af40[_0x7d93('0x2e')][_0x7d93('0x36')]);_0x15e3d5['where']=qs[_0x7d93('0x30')](_[_0x7d93('0x37')](_0x13af40[_0x7d93('0x2e')],_0x396e40[_0x7d93('0x30')]),_0x2fe996);if(_0x13af40[_0x7d93('0x2e')][_0x7d93('0x38')]){_0x15e3d5[_0x7d93('0x39')]=_[_0x7d93('0x3a')](_0x15e3d5[_0x7d93('0x39')],{'$or':_['map'](_0x2fe996,function(_0x2fe21c){if(_0x2fe21c[_0x7d93('0x2c')]!==_0x7d93('0x3b')){var _0x4d8a74={};_0x4d8a74[_0x2fe21c['name']]={'$like':'%'+_0x13af40['query']['filter']+'%'};return _0x4d8a74;}})});}_0x15e3d5=_['merge']({},_0x15e3d5,_0x13af40['options']);var _0x39bf15={'where':_0x15e3d5[_0x7d93('0x39')]};return db['ServicenowConfiguration'][_0x7d93('0x1c')](_0x39bf15)[_0x7d93('0x24')](function(_0x1f5705){_0x33e9de[_0x7d93('0x1c')]=_0x1f5705;if(_0x13af40[_0x7d93('0x2e')][_0x7d93('0x3c')]){_0x15e3d5[_0x7d93('0x3d')]=[{'all':!![]}];}return db[_0x7d93('0x3e')]['findAll'](_0x15e3d5);})[_0x7d93('0x24')](function(_0x1b2335){_0x33e9de[_0x7d93('0x3f')]=_0x1b2335;return _0x33e9de;})[_0x7d93('0x24')](respondWithFilteredResult(_0xabc2f0,_0x15e3d5))[_0x7d93('0x40')](handleError(_0xabc2f0,null));};exports[_0x7d93('0x41')]=function(_0x500921,_0x10ce31){var _0x36ad8b={'raw':![],'where':{'id':_0x500921[_0x7d93('0x42')]['id']}},_0x47087d={};_0x47087d['model']=_[_0x7d93('0x2f')](db['ServicenowConfiguration'][_0x7d93('0x2a')]);_0x47087d[_0x7d93('0x2e')]=_[_0x7d93('0x2f')](_0x500921[_0x7d93('0x2e')]);_0x47087d['filters']=_['intersection'](_0x47087d[_0x7d93('0x2d')],_0x47087d[_0x7d93('0x2e')]);_0x36ad8b[_0x7d93('0x33')]=_[_0x7d93('0x31')](_0x47087d['model'],qs['fields'](_0x500921[_0x7d93('0x2e')]['fields']));_0x36ad8b[_0x7d93('0x33')]=_0x36ad8b['attributes'][_0x7d93('0x43')]?_0x36ad8b[_0x7d93('0x33')]:_0x47087d[_0x7d93('0x2d')];if(_0x500921[_0x7d93('0x2e')][_0x7d93('0x3c')]){_0x36ad8b['include']=[{'all':!![]}];}_0x36ad8b=_['merge']({},_0x36ad8b,_0x500921[_0x7d93('0x44')]);return db['ServicenowConfiguration']['find'](_0x36ad8b)['then'](handleEntityNotFound(_0x10ce31,null))[_0x7d93('0x24')](respondWithResult(_0x10ce31,null))[_0x7d93('0x40')](handleError(_0x10ce31,null));};exports[_0x7d93('0x45')]=function(_0x13e866,_0x10eca4){return db[_0x7d93('0x3e')][_0x7d93('0x45')](_0x13e866[_0x7d93('0x46')],{})[_0x7d93('0x24')](respondWithResult(_0x10eca4,0xc9))['catch'](handleError(_0x10eca4,null));};exports['update']=function(_0x4f08de,_0x6ece85){if(_0x4f08de[_0x7d93('0x46')]['id']){delete _0x4f08de[_0x7d93('0x46')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x4f08de[_0x7d93('0x42')]['id']}})['then'](handleEntityNotFound(_0x6ece85,null))[_0x7d93('0x24')](saveUpdates(_0x4f08de[_0x7d93('0x46')],null))[_0x7d93('0x24')](respondWithResult(_0x6ece85,null))[_0x7d93('0x40')](handleError(_0x6ece85,null));};exports[_0x7d93('0x23')]=function(_0x2df1fb,_0x5c52ab){return db[_0x7d93('0x3e')][_0x7d93('0x47')]({'where':{'id':_0x2df1fb['params']['id']}})[_0x7d93('0x24')](handleEntityNotFound(_0x5c52ab,null))[_0x7d93('0x24')](removeEntity(_0x5c52ab,null))[_0x7d93('0x40')](handleError(_0x5c52ab,null));};exports['getFields']=function(_0x2423d4,_0x447faf,_0xd86be0){var _0x28b2cc={};var _0x5aef3f={};var _0x496e92;var _0x143402;return db[_0x7d93('0x3e')][_0x7d93('0x48')]({'where':{'id':_0x2423d4[_0x7d93('0x42')]['id']}})['then'](handleEntityNotFound(_0x447faf,null))[_0x7d93('0x24')](function(_0x2a4771){if(_0x2a4771){_0x496e92=_0x2a4771;_0x5aef3f['model']=_[_0x7d93('0x2f')](db[_0x7d93('0x49')][_0x7d93('0x2a')]);_0x5aef3f['query']=_[_0x7d93('0x2f')](_0x2423d4['query']);_0x5aef3f[_0x7d93('0x30')]=_['intersection'](_0x5aef3f['model'],_0x5aef3f[_0x7d93('0x2e')]);_0x28b2cc['attributes']=_['intersection'](_0x5aef3f[_0x7d93('0x2d')],qs[_0x7d93('0x32')](_0x2423d4[_0x7d93('0x2e')][_0x7d93('0x32')]));_0x28b2cc['attributes']=_0x28b2cc[_0x7d93('0x33')][_0x7d93('0x43')]?_0x28b2cc[_0x7d93('0x33')]:_0x5aef3f['model'];_0x28b2cc[_0x7d93('0x35')]=qs[_0x7d93('0x36')](_0x2423d4[_0x7d93('0x2e')][_0x7d93('0x36')]);_0x28b2cc[_0x7d93('0x39')]=qs[_0x7d93('0x30')](_[_0x7d93('0x37')](_0x2423d4[_0x7d93('0x2e')],_0x5aef3f['filters']));if(_0x2423d4[_0x7d93('0x2e')][_0x7d93('0x38')]){_0x28b2cc[_0x7d93('0x39')]=_[_0x7d93('0x3a')](_0x28b2cc[_0x7d93('0x39')],{'$or':_[_0x7d93('0x4a')](_0x28b2cc['attributes'],function(_0x284f24){var _0x558e50={};_0x558e50[_0x284f24]={'$like':'%'+_0x2423d4['query']['filter']+'%'};return _0x558e50;})});}_0x28b2cc=_[_0x7d93('0x3a')]({},_0x28b2cc,_0x2423d4[_0x7d93('0x44')]);return _0x496e92[_0x7d93('0x4b')](_0x28b2cc);}})[_0x7d93('0x24')](function(_0x588afe){if(_0x588afe){_0x143402=_0x588afe[_0x7d93('0x43')];if(!_0x2423d4[_0x7d93('0x2e')][_0x7d93('0x34')](_0x7d93('0x4c'))){_0x28b2cc[_0x7d93('0x1b')]=qs[_0x7d93('0x1b')](_0x2423d4[_0x7d93('0x2e')]['limit']);_0x28b2cc[_0x7d93('0x19')]=qs[_0x7d93('0x19')](_0x2423d4[_0x7d93('0x2e')][_0x7d93('0x19')]);}return _0x496e92[_0x7d93('0x4b')](_0x28b2cc);}})[_0x7d93('0x24')](function(_0x35d659){if(_0x35d659){return _0x35d659?{'count':_0x143402,'rows':_0x35d659}:null;}})[_0x7d93('0x24')](respondWithResult(_0x447faf,null))['catch'](handleError(_0x447faf,null));};exports['getSubjects']=function(_0xd49347,_0x494796,_0x439cee){var _0x3f48fb={};var _0x15bb74={};var _0x4f4b04;var _0x52cb23;return db[_0x7d93('0x3e')][_0x7d93('0x48')]({'where':{'id':_0xd49347[_0x7d93('0x42')]['id']}})['then'](handleEntityNotFound(_0x494796,null))[_0x7d93('0x24')](function(_0x13e385){if(_0x13e385){_0x4f4b04=_0x13e385;_0x15bb74[_0x7d93('0x2d')]=_[_0x7d93('0x2f')](db['ServicenowField'][_0x7d93('0x2a')]);_0x15bb74['query']=_[_0x7d93('0x2f')](_0xd49347[_0x7d93('0x2e')]);_0x15bb74[_0x7d93('0x30')]=_[_0x7d93('0x31')](_0x15bb74[_0x7d93('0x2d')],_0x15bb74[_0x7d93('0x2e')]);_0x3f48fb[_0x7d93('0x33')]=_['intersection'](_0x15bb74[_0x7d93('0x2d')],qs[_0x7d93('0x32')](_0xd49347[_0x7d93('0x2e')][_0x7d93('0x32')]));_0x3f48fb['attributes']=_0x3f48fb[_0x7d93('0x33')][_0x7d93('0x43')]?_0x3f48fb['attributes']:_0x15bb74[_0x7d93('0x2d')];_0x3f48fb['order']=qs[_0x7d93('0x36')](_0xd49347[_0x7d93('0x2e')][_0x7d93('0x36')]);_0x3f48fb[_0x7d93('0x39')]=qs['filters'](_[_0x7d93('0x37')](_0xd49347[_0x7d93('0x2e')],_0x15bb74[_0x7d93('0x30')]));if(_0xd49347[_0x7d93('0x2e')][_0x7d93('0x38')]){_0x3f48fb[_0x7d93('0x39')]=_[_0x7d93('0x3a')](_0x3f48fb[_0x7d93('0x39')],{'$or':_['map'](_0x3f48fb[_0x7d93('0x33')],function(_0x15260f){var _0x48f098={};_0x48f098[_0x15260f]={'$like':'%'+_0xd49347[_0x7d93('0x2e')]['filter']+'%'};return _0x48f098;})});}_0x3f48fb=_[_0x7d93('0x3a')]({},_0x3f48fb,_0xd49347[_0x7d93('0x44')]);return _0x4f4b04[_0x7d93('0x4d')](_0x3f48fb);}})[_0x7d93('0x24')](function(_0x9015ef){if(_0x9015ef){_0x52cb23=_0x9015ef['length'];if(!_0xd49347[_0x7d93('0x2e')][_0x7d93('0x34')](_0x7d93('0x4c'))){_0x3f48fb[_0x7d93('0x1b')]=qs['limit'](_0xd49347[_0x7d93('0x2e')][_0x7d93('0x1b')]);_0x3f48fb[_0x7d93('0x19')]=qs[_0x7d93('0x19')](_0xd49347[_0x7d93('0x2e')][_0x7d93('0x19')]);}return _0x4f4b04[_0x7d93('0x4d')](_0x3f48fb);}})[_0x7d93('0x24')](function(_0x4984fc){if(_0x4984fc){return _0x4984fc?{'count':_0x52cb23,'rows':_0x4984fc}:null;}})[_0x7d93('0x24')](respondWithResult(_0x494796,null))['catch'](handleError(_0x494796,null));};exports[_0x7d93('0x4e')]=function(_0x23e28b,_0x20604b,_0x5ee99f){var _0x505513={};var _0x1b78b9={};var _0x366ef1;var _0xacfb7e;return db[_0x7d93('0x3e')][_0x7d93('0x48')]({'where':{'id':_0x23e28b[_0x7d93('0x42')]['id']}})[_0x7d93('0x24')](handleEntityNotFound(_0x20604b,null))[_0x7d93('0x24')](function(_0x5cdb33){if(_0x5cdb33){_0x366ef1=_0x5cdb33;_0x1b78b9[_0x7d93('0x2d')]=_[_0x7d93('0x2f')](db[_0x7d93('0x49')][_0x7d93('0x2a')]);_0x1b78b9['query']=_[_0x7d93('0x2f')](_0x23e28b[_0x7d93('0x2e')]);_0x1b78b9[_0x7d93('0x30')]=_[_0x7d93('0x31')](_0x1b78b9[_0x7d93('0x2d')],_0x1b78b9[_0x7d93('0x2e')]);_0x505513[_0x7d93('0x33')]=_[_0x7d93('0x31')](_0x1b78b9['model'],qs[_0x7d93('0x32')](_0x23e28b[_0x7d93('0x2e')][_0x7d93('0x32')]));_0x505513['attributes']=_0x505513[_0x7d93('0x33')]['length']?_0x505513['attributes']:_0x1b78b9[_0x7d93('0x2d')];_0x505513[_0x7d93('0x35')]=qs['sort'](_0x23e28b['query'][_0x7d93('0x36')]);_0x505513['where']=qs[_0x7d93('0x30')](_['pick'](_0x23e28b[_0x7d93('0x2e')],_0x1b78b9[_0x7d93('0x30')]));if(_0x23e28b['query'][_0x7d93('0x38')]){_0x505513[_0x7d93('0x39')]=_['merge'](_0x505513[_0x7d93('0x39')],{'$or':_[_0x7d93('0x4a')](_0x505513[_0x7d93('0x33')],function(_0x4dee6b){var _0x532006={};_0x532006[_0x4dee6b]={'$like':'%'+_0x23e28b[_0x7d93('0x2e')][_0x7d93('0x38')]+'%'};return _0x532006;})});}_0x505513=_[_0x7d93('0x3a')]({},_0x505513,_0x23e28b[_0x7d93('0x44')]);return _0x366ef1[_0x7d93('0x4e')](_0x505513);}})['then'](function(_0x5600d3){if(_0x5600d3){_0xacfb7e=_0x5600d3['length'];if(!_0x23e28b[_0x7d93('0x2e')][_0x7d93('0x34')](_0x7d93('0x4c'))){_0x505513[_0x7d93('0x1b')]=qs[_0x7d93('0x1b')](_0x23e28b['query']['limit']);_0x505513[_0x7d93('0x19')]=qs[_0x7d93('0x19')](_0x23e28b['query'][_0x7d93('0x19')]);}return _0x366ef1[_0x7d93('0x4e')](_0x505513);}})[_0x7d93('0x24')](function(_0x21da97){if(_0x21da97){return _0x21da97?{'count':_0xacfb7e,'rows':_0x21da97}:null;}})[_0x7d93('0x24')](respondWithResult(_0x20604b,null))[_0x7d93('0x40')](handleError(_0x20604b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index c83c7bd..fb9b336 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 _0x4e2e=['exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x4453d1,_0x5f391a){_0x4453d1=_0x4453d1-0x0;var _0x5782b1=_0x4e2e[_0x4453d1];return _0x5782b1;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d21=['rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x18f10f,_0x54e5ca){var _0x45d091=function(_0x3e6067){while(--_0x3e6067){_0x18f10f['push'](_0x18f10f['shift']());}};_0x45d091(++_0x54e5ca);}(_0x1d21,0x158));var _0x11d2=function(_0x357a01,_0x1e57d0){_0x357a01=_0x357a01-0x0;var _0x252c1f=_0x1d21[_0x357a01];return _0x252c1f;};'use strict';var _=require(_0x11d2('0x0'));var util=require(_0x11d2('0x1'));var logger=require(_0x11d2('0x2'))(_0x11d2('0x3'));var moment=require('moment');var BPromise=require(_0x11d2('0x4'));var rp=require(_0x11d2('0x5'));var fs=require('fs');var path=require(_0x11d2('0x6'));var rimraf=require(_0x11d2('0x7'));var config=require('../../config/environment');var attributes=require(_0x11d2('0x8'));module[_0x11d2('0x9')]=function(_0x16e99c,_0x21a2d3){return _0x16e99c[_0x11d2('0xa')](_0x11d2('0xb'),attributes,{'tableName':_0x11d2('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 549b62f..b46e2ea 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 _0xcd15=['../../config/utils','../../config/environment','jayson/promise','client','http','request','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x26bd73,_0x1af6b2){var _0x35928c=function(_0x6f12d){while(--_0x6f12d){_0x26bd73['push'](_0x26bd73['shift']());}};_0x35928c(++_0x1af6b2);}(_0xcd15,0xf6));var _0x5cd1=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0xcd15[_0x4de877];return _0xb2cfeb;};'use strict';var _=require(_0x5cd1('0x0'));var util=require(_0x5cd1('0x1'));var moment=require(_0x5cd1('0x2'));var BPromise=require(_0x5cd1('0x3'));var rs=require(_0x5cd1('0x4'));var fs=require('fs');var Redis=require(_0x5cd1('0x5'));var db=require(_0x5cd1('0x6'))['db'];var utils=require(_0x5cd1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x5cd1('0x8'));var jayson=require(_0x5cd1('0x9'));var client=jayson[_0x5cd1('0xa')][_0x5cd1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a88e1,_0x3504fe,_0x2fd49f){return new BPromise(function(_0x27bfa7,_0x44056d){return client[_0x5cd1('0xc')](_0x3a88e1,_0x2fd49f)['then'](function(_0x17819e){logger['info'](_0x5cd1('0xd'),_0x3504fe,'request\x20sent');logger[_0x5cd1('0xe')](_0x5cd1('0xf'),_0x3504fe,'request\x20sent',JSON[_0x5cd1('0x10')](_0x17819e));if(_0x17819e[_0x5cd1('0x11')]){if(_0x17819e[_0x5cd1('0x11')][_0x5cd1('0x12')]===0x1f4){logger[_0x5cd1('0x11')](_0x5cd1('0xd'),_0x3504fe,_0x17819e[_0x5cd1('0x11')][_0x5cd1('0x13')]);return _0x44056d(_0x17819e[_0x5cd1('0x11')][_0x5cd1('0x13')]);}logger[_0x5cd1('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3504fe,_0x17819e[_0x5cd1('0x11')][_0x5cd1('0x13')]);return _0x27bfa7(_0x17819e[_0x5cd1('0x11')][_0x5cd1('0x13')]);}else{logger[_0x5cd1('0x14')](_0x5cd1('0xd'),_0x3504fe,'request\x20sent');_0x27bfa7(_0x17819e[_0x5cd1('0x15')][_0x5cd1('0x13')]);}})[_0x5cd1('0x16')](function(_0x3861e7){logger[_0x5cd1('0x11')](_0x5cd1('0xd'),_0x3504fe,_0x3861e7);_0x44056d(_0x3861e7);});});} \ No newline at end of file +var _0x964c=['../../config/logger','../../config/environment','jayson/promise','client','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x58417b,_0xc00192){var _0x418f5f=function(_0xce9685){while(--_0xce9685){_0x58417b['push'](_0x58417b['shift']());}};_0x418f5f(++_0xc00192);}(_0x964c,0x65));var _0xc964=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x964c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xc964('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc964('0x1'));var db=require(_0xc964('0x2'))['db'];var utils=require(_0xc964('0x3'));var logger=require(_0xc964('0x4'))('rpc');var config=require(_0xc964('0x5'));var jayson=require(_0xc964('0x6'));var client=jayson[_0xc964('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14a142,_0x55760d,_0x37e986){return new BPromise(function(_0x2332b6,_0x34a617){return client[_0xc964('0x8')](_0x14a142,_0x37e986)[_0xc964('0x9')](function(_0x45db6a){logger['info'](_0xc964('0xa'),_0x55760d,_0xc964('0xb'));logger[_0xc964('0xc')](_0xc964('0xd'),_0x55760d,_0xc964('0xb'),JSON[_0xc964('0xe')](_0x45db6a));if(_0x45db6a[_0xc964('0xf')]){if(_0x45db6a[_0xc964('0xf')][_0xc964('0x10')]===0x1f4){logger['error'](_0xc964('0xa'),_0x55760d,_0x45db6a['error'][_0xc964('0x11')]);return _0x34a617(_0x45db6a[_0xc964('0xf')]['message']);}logger[_0xc964('0xf')](_0xc964('0xa'),_0x55760d,_0x45db6a[_0xc964('0xf')][_0xc964('0x11')]);return _0x2332b6(_0x45db6a[_0xc964('0xf')][_0xc964('0x11')]);}else{logger[_0xc964('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x55760d,_0xc964('0xb'));_0x2332b6(_0x45db6a[_0xc964('0x13')][_0xc964('0x11')]);}})[_0xc964('0x14')](function(_0xebd260){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x55760d,_0xebd260);_0x34a617(_0xebd260);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 23a3e81..7285221 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 _0xf5f9=['post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show'];(function(_0x11decc,_0x2e3875){var _0x5e5193=function(_0x87051a){while(--_0x87051a){_0x11decc['push'](_0x11decc['shift']());}};_0x5e5193(++_0x2e3875);}(_0xf5f9,0xa9));var _0x9f5f=function(_0x25277c,_0xf854af){_0x25277c=_0x25277c-0x0;var _0x10d0f3=_0xf5f9[_0x25277c];return _0x10d0f3;};'use strict';var multer=require('multer');var util=require(_0x9f5f('0x0'));var path=require(_0x9f5f('0x1'));var timeout=require(_0x9f5f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f5f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9f5f('0x4'));var config=require(_0x9f5f('0x5'));var controller=require(_0x9f5f('0x6'));router[_0x9f5f('0x7')]('/',auth[_0x9f5f('0x8')](),controller['index']);router[_0x9f5f('0x7')](_0x9f5f('0x9'),auth[_0x9f5f('0x8')](),controller[_0x9f5f('0xa')]);router[_0x9f5f('0xb')]('/',auth['isAuthenticated'](),controller[_0x9f5f('0xc')]);router[_0x9f5f('0xd')](_0x9f5f('0x9'),auth[_0x9f5f('0x8')](),controller[_0x9f5f('0xe')]);router[_0x9f5f('0xf')](_0x9f5f('0x9'),auth[_0x9f5f('0x8')](),controller[_0x9f5f('0x10')]);module[_0x9f5f('0x11')]=router; \ No newline at end of file +var _0x2c98=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x58d6d9,_0x13cc24){var _0x146c6f=function(_0x1af79f){while(--_0x1af79f){_0x58d6d9['push'](_0x58d6d9['shift']());}};_0x146c6f(++_0x13cc24);}(_0x2c98,0xe1));var _0x82c9=function(_0x15c430,_0x3dcd47){_0x15c430=_0x15c430-0x0;var _0x426d0c=_0x2c98[_0x15c430];return _0x426d0c;};'use strict';var multer=require(_0x82c9('0x0'));var util=require(_0x82c9('0x1'));var path=require(_0x82c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x82c9('0x3'));var router=express[_0x82c9('0x4')]();var fs_extra=require(_0x82c9('0x5'));var auth=require(_0x82c9('0x6'));var interaction=require(_0x82c9('0x7'));var config=require(_0x82c9('0x8'));var controller=require(_0x82c9('0x9'));router[_0x82c9('0xa')]('/',auth['isAuthenticated'](),controller[_0x82c9('0xb')]);router[_0x82c9('0xa')](_0x82c9('0xc'),auth[_0x82c9('0xd')](),controller[_0x82c9('0xe')]);router[_0x82c9('0xf')]('/',auth[_0x82c9('0xd')](),controller[_0x82c9('0x10')]);router[_0x82c9('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x82c9('0x12')]);router[_0x82c9('0x13')](_0x82c9('0xc'),auth[_0x82c9('0xd')](),controller[_0x82c9('0x14')]);module[_0x82c9('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index c6e2b73..211a903 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 _0x6264=['STRING','ENUM','customVariable','BOOLEAN','sequelize','string','variable','keyValue','picklist'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x6264,0x1e1));var _0x4626=function(_0x337e2b,_0x483b3b){_0x337e2b=_0x337e2b-0x0;var _0x569e62=_0x6264[_0x337e2b];return _0x569e62;};'use strict';var Sequelize=require(_0x4626('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x4626('0x1'),_0x4626('0x2'),'customVariable',_0x4626('0x3'),_0x4626('0x4')),'defaultValue':_0x4626('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4626('0x5')]},'keyType':{'type':Sequelize[_0x4626('0x6')](_0x4626('0x1'),'variable',_0x4626('0x7'))},'keyContent':{'type':Sequelize[_0x4626('0x5')]},'idField':{'type':Sequelize[_0x4626('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4626('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xefe2=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefe2,0x128));var _0x2efe=function(_0x34142e,_0x49b707){_0x34142e=_0x34142e-0x0;var _0x116039=_0xefe2[_0x34142e];return _0x116039;};'use strict';var Sequelize=require(_0x2efe('0x0'));module[_0x2efe('0x1')]={'type':{'type':Sequelize[_0x2efe('0x2')](_0x2efe('0x3'),_0x2efe('0x4'),_0x2efe('0x5'),_0x2efe('0x6'),_0x2efe('0x7')),'defaultValue':_0x2efe('0x3')},'content':{'type':Sequelize[_0x2efe('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2efe('0x3'),_0x2efe('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x2efe('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2efe('0x8')]},'customField':{'type':Sequelize[_0x2efe('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 865753a..45d11c9 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 _0x302f=['destroy','name','send','ServicenowField','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','rows','catch','show','params','includeAll','options','find','create','body','eml-format','zip-dir','fast-json-patch','mustache','util','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/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','update','then'];(function(_0x459343,_0x14aff1){var _0x2bd002=function(_0x1b2102){while(--_0x1b2102){_0x459343['push'](_0x459343['shift']());}};_0x2bd002(++_0x14aff1);}(_0x302f,0x1c1));var _0xf302=function(_0x4bc9e6,_0x2b10ea){_0x4bc9e6=_0x4bc9e6-0x0;var _0x51afa5=_0x302f[_0x4bc9e6];return _0x51afa5;};'use strict';var emlformat=require(_0xf302('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf302('0x1'));var jsonpatch=require(_0xf302('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf302('0x3'));var util=require(_0xf302('0x4'));var path=require('path');var sox=require(_0xf302('0x5'));var csv=require(_0xf302('0x6'));var ejs=require(_0xf302('0x7'));var fs=require('fs');var fs_extra=require(_0xf302('0x8'));var _=require(_0xf302('0x9'));var squel=require(_0xf302('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf302('0xb'));var toCsv=require(_0xf302('0x6'));var querystring=require(_0xf302('0xc'));var Papa=require(_0xf302('0xd'));var Redis=require(_0xf302('0xe'));var authService=require(_0xf302('0xf'));var qs=require(_0xf302('0x10'));var as=require(_0xf302('0x11'));var hardwareService=require(_0xf302('0x12'));var logger=require('../../config/logger')(_0xf302('0x13'));var utils=require('../../config/utils');var config=require(_0xf302('0x14'));var licenseUtil=require(_0xf302('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dc1d7,_0x3f4f0e){_0x3f4f0e=_0x3f4f0e||0xcc;return function(_0x36aa7c){if(_0x36aa7c){return _0x3dc1d7[_0xf302('0x16')](_0x3f4f0e);}return _0x3dc1d7[_0xf302('0x17')](_0x3f4f0e)[_0xf302('0x18')]();};}function respondWithResult(_0x478e95,_0x548bf7){_0x548bf7=_0x548bf7||0xc8;return function(_0x4534ed){if(_0x4534ed){return _0x478e95[_0xf302('0x17')](_0x548bf7)[_0xf302('0x19')](_0x4534ed);}};}function respondWithFilteredResult(_0x276051,_0x30152e){return function(_0x1f9a16){if(_0x1f9a16){var _0x2bb69a=typeof _0x30152e[_0xf302('0x1a')]===_0xf302('0x1b')&&typeof _0x30152e[_0xf302('0x1c')]===_0xf302('0x1b');var _0x394cae=_0x1f9a16['count'];var _0x5c96cd=_0x2bb69a?0x0:_0x30152e[_0xf302('0x1a')];var _0x9b2773=_0x2bb69a?_0x1f9a16['count']:_0x30152e[_0xf302('0x1a')]+_0x30152e[_0xf302('0x1c')];var _0x375dd3;if(_0x9b2773>=_0x394cae){_0x9b2773=_0x394cae;_0x375dd3=0xc8;}else{_0x375dd3=0xce;}_0x276051['status'](_0x375dd3);return _0x276051[_0xf302('0x1d')](_0xf302('0x1e'),_0x5c96cd+'-'+_0x9b2773+'/'+_0x394cae)[_0xf302('0x19')](_0x1f9a16);}return null;};}function patchUpdates(_0x339ae3){return function(_0x4b07a3){try{jsonpatch['apply'](_0x4b07a3,_0x339ae3,!![]);}catch(_0x44ec5d){return BPromise['reject'](_0x44ec5d);}return _0x4b07a3[_0xf302('0x1f')]();};}function saveUpdates(_0x47bda8,_0x1255e2){return function(_0x105c2a){if(_0x105c2a){return _0x105c2a[_0xf302('0x20')](_0x47bda8)[_0xf302('0x21')](function(_0x48df6f){return _0x48df6f;});}return null;};}function removeEntity(_0xcbd964,_0x3c5b53){return function(_0xc1e245){if(_0xc1e245){return _0xc1e245[_0xf302('0x22')]()[_0xf302('0x21')](function(){_0xcbd964['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b5e49,_0x233382){return function(_0x29ad66){if(!_0x29ad66){_0x1b5e49[_0xf302('0x16')](0x194);}return _0x29ad66;};}function handleError(_0x338a4c,_0x394369){_0x394369=_0x394369||0x1f4;return function(_0x5328cc){logger['error'](_0x5328cc['stack']);if(_0x5328cc[_0xf302('0x23')]){delete _0x5328cc[_0xf302('0x23')];}_0x338a4c[_0xf302('0x17')](_0x394369)[_0xf302('0x24')](_0x5328cc);};}exports['index']=function(_0x38afad,_0x3741a3){var _0x33771a={},_0x19b88d={},_0x57dc42={'count':0x0,'rows':[]};var _0x5d1f54=_['map'](db[_0xf302('0x25')][_0xf302('0x26')],function(_0x1edbc6){return{'name':_0x1edbc6['fieldName'],'type':_0x1edbc6[_0xf302('0x27')][_0xf302('0x28')]};});_0x19b88d[_0xf302('0x29')]=_[_0xf302('0x2a')](_0x5d1f54,'name');_0x19b88d['query']=_[_0xf302('0x2b')](_0x38afad[_0xf302('0x2c')]);_0x19b88d[_0xf302('0x2d')]=_[_0xf302('0x2e')](_0x19b88d[_0xf302('0x29')],_0x19b88d[_0xf302('0x2c')]);_0x33771a[_0xf302('0x2f')]=_['intersection'](_0x19b88d[_0xf302('0x29')],qs[_0xf302('0x30')](_0x38afad[_0xf302('0x2c')][_0xf302('0x30')]));_0x33771a[_0xf302('0x2f')]=_0x33771a['attributes'][_0xf302('0x31')]?_0x33771a[_0xf302('0x2f')]:_0x19b88d[_0xf302('0x29')];if(!_0x38afad[_0xf302('0x2c')]['hasOwnProperty'](_0xf302('0x32'))){_0x33771a[_0xf302('0x1c')]=qs[_0xf302('0x1c')](_0x38afad[_0xf302('0x2c')][_0xf302('0x1c')]);_0x33771a[_0xf302('0x1a')]=qs['offset'](_0x38afad[_0xf302('0x2c')][_0xf302('0x1a')]);}_0x33771a[_0xf302('0x33')]=qs[_0xf302('0x34')](_0x38afad[_0xf302('0x2c')][_0xf302('0x34')]);_0x33771a[_0xf302('0x35')]=qs['filters'](_[_0xf302('0x36')](_0x38afad[_0xf302('0x2c')],_0x19b88d['filters']),_0x5d1f54);if(_0x38afad[_0xf302('0x2c')][_0xf302('0x37')]){_0x33771a[_0xf302('0x35')]=_[_0xf302('0x38')](_0x33771a['where'],{'$or':_[_0xf302('0x2a')](_0x5d1f54,function(_0x4406b0){if(_0x4406b0[_0xf302('0x27')]!==_0xf302('0x39')){var _0x7edd90={};_0x7edd90[_0x4406b0[_0xf302('0x23')]]={'$like':'%'+_0x38afad['query'][_0xf302('0x37')]+'%'};return _0x7edd90;}})});}_0x33771a=_[_0xf302('0x38')]({},_0x33771a,_0x38afad['options']);var _0x24e074={'where':_0x33771a[_0xf302('0x35')]};return db[_0xf302('0x25')][_0xf302('0x3a')](_0x24e074)[_0xf302('0x21')](function(_0x6f8dab){_0x57dc42[_0xf302('0x3a')]=_0x6f8dab;if(_0x38afad[_0xf302('0x2c')]['includeAll']){_0x33771a[_0xf302('0x3b')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x33771a);})[_0xf302('0x21')](function(_0x3998aa){_0x57dc42[_0xf302('0x3c')]=_0x3998aa;return _0x57dc42;})[_0xf302('0x21')](respondWithFilteredResult(_0x3741a3,_0x33771a))[_0xf302('0x3d')](handleError(_0x3741a3,null));};exports[_0xf302('0x3e')]=function(_0x30f1e0,_0x138edc){var _0x118d63={'raw':!![],'where':{'id':_0x30f1e0[_0xf302('0x3f')]['id']}},_0x43445b={};_0x43445b[_0xf302('0x29')]=_[_0xf302('0x2b')](db[_0xf302('0x25')][_0xf302('0x26')]);_0x43445b[_0xf302('0x2c')]=_[_0xf302('0x2b')](_0x30f1e0[_0xf302('0x2c')]);_0x43445b[_0xf302('0x2d')]=_['intersection'](_0x43445b[_0xf302('0x29')],_0x43445b[_0xf302('0x2c')]);_0x118d63['attributes']=_[_0xf302('0x2e')](_0x43445b['model'],qs[_0xf302('0x30')](_0x30f1e0[_0xf302('0x2c')]['fields']));_0x118d63['attributes']=_0x118d63[_0xf302('0x2f')][_0xf302('0x31')]?_0x118d63[_0xf302('0x2f')]:_0x43445b['model'];if(_0x30f1e0[_0xf302('0x2c')][_0xf302('0x40')]){_0x118d63[_0xf302('0x3b')]=[{'all':!![]}];}_0x118d63=_[_0xf302('0x38')]({},_0x118d63,_0x30f1e0[_0xf302('0x41')]);return db['ServicenowField'][_0xf302('0x42')](_0x118d63)['then'](handleEntityNotFound(_0x138edc,null))[_0xf302('0x21')](respondWithResult(_0x138edc,null))[_0xf302('0x3d')](handleError(_0x138edc,null));};exports[_0xf302('0x43')]=function(_0xdd9e41,_0x477664){return db['ServicenowField'][_0xf302('0x43')](_0xdd9e41[_0xf302('0x44')],{})['then'](respondWithResult(_0x477664,0xc9))[_0xf302('0x3d')](handleError(_0x477664,null));};exports[_0xf302('0x20')]=function(_0x56774b,_0x57dc17){if(_0x56774b[_0xf302('0x44')]['id']){delete _0x56774b['body']['id'];}return db['ServicenowField'][_0xf302('0x42')]({'where':{'id':_0x56774b[_0xf302('0x3f')]['id']}})[_0xf302('0x21')](handleEntityNotFound(_0x57dc17,null))[_0xf302('0x21')](saveUpdates(_0x56774b[_0xf302('0x44')],null))['then'](respondWithResult(_0x57dc17,null))[_0xf302('0x3d')](handleError(_0x57dc17,null));};exports['destroy']=function(_0x42f333,_0x35cc6b){return db[_0xf302('0x25')][_0xf302('0x42')]({'where':{'id':_0x42f333[_0xf302('0x3f')]['id']}})[_0xf302('0x21')](handleEntityNotFound(_0x35cc6b,null))[_0xf302('0x21')](removeEntity(_0x35cc6b,null))[_0xf302('0x3d')](handleError(_0x35cc6b,null));}; \ No newline at end of file +var _0x617c=['destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then'];(function(_0xf56f4c,_0x41f137){var _0x5797b3=function(_0x367411){while(--_0x367411){_0xf56f4c['push'](_0xf56f4c['shift']());}};_0x5797b3(++_0x41f137);}(_0x617c,0x150));var _0xc617=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x617c[_0x556bb1];return _0x45455f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc617('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc617('0x1'));var rp=require(_0xc617('0x2'));var moment=require(_0xc617('0x3'));var BPromise=require(_0xc617('0x4'));var Mustache=require('mustache');var util=require(_0xc617('0x5'));var path=require('path');var sox=require(_0xc617('0x6'));var csv=require(_0xc617('0x7'));var ejs=require(_0xc617('0x8'));var fs=require('fs');var fs_extra=require(_0xc617('0x9'));var _=require(_0xc617('0xa'));var squel=require(_0xc617('0xb'));var crypto=require(_0xc617('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc617('0xd'));var toCsv=require(_0xc617('0x7'));var querystring=require(_0xc617('0xe'));var Papa=require(_0xc617('0xf'));var Redis=require(_0xc617('0x10'));var authService=require(_0xc617('0x11'));var qs=require(_0xc617('0x12'));var as=require(_0xc617('0x13'));var hardwareService=require(_0xc617('0x14'));var logger=require('../../config/logger')(_0xc617('0x15'));var utils=require(_0xc617('0x16'));var config=require(_0xc617('0x17'));var licenseUtil=require(_0xc617('0x18'));var db=require(_0xc617('0x19'))['db'];function respondWithStatusCode(_0x3de348,_0x578e27){_0x578e27=_0x578e27||0xcc;return function(_0x394180){if(_0x394180){return _0x3de348[_0xc617('0x1a')](_0x578e27);}return _0x3de348[_0xc617('0x1b')](_0x578e27)[_0xc617('0x1c')]();};}function respondWithResult(_0xc12c63,_0x156816){_0x156816=_0x156816||0xc8;return function(_0x5ea20d){if(_0x5ea20d){return _0xc12c63['status'](_0x156816)[_0xc617('0x1d')](_0x5ea20d);}};}function respondWithFilteredResult(_0xabac3f,_0x22a803){return function(_0x4e86b3){if(_0x4e86b3){var _0x5e1637=typeof _0x22a803[_0xc617('0x1e')]===_0xc617('0x1f')&&typeof _0x22a803[_0xc617('0x20')]===_0xc617('0x1f');var _0x2b9974=_0x4e86b3[_0xc617('0x21')];var _0x23ee79=_0x5e1637?0x0:_0x22a803[_0xc617('0x1e')];var _0x233c07=_0x5e1637?_0x4e86b3[_0xc617('0x21')]:_0x22a803[_0xc617('0x1e')]+_0x22a803[_0xc617('0x20')];var _0x5af292;if(_0x233c07>=_0x2b9974){_0x233c07=_0x2b9974;_0x5af292=0xc8;}else{_0x5af292=0xce;}_0xabac3f[_0xc617('0x1b')](_0x5af292);return _0xabac3f['set']('Content-Range',_0x23ee79+'-'+_0x233c07+'/'+_0x2b9974)['json'](_0x4e86b3);}return null;};}function patchUpdates(_0x23c0bd){return function(_0x38a216){try{jsonpatch[_0xc617('0x22')](_0x38a216,_0x23c0bd,!![]);}catch(_0x2951fb){return BPromise[_0xc617('0x23')](_0x2951fb);}return _0x38a216[_0xc617('0x24')]();};}function saveUpdates(_0x5196ed,_0x43fdb0){return function(_0x1aad22){if(_0x1aad22){return _0x1aad22[_0xc617('0x25')](_0x5196ed)[_0xc617('0x26')](function(_0x265612){return _0x265612;});}return null;};}function removeEntity(_0x1f550e,_0xa38b1b){return function(_0x4bfcdf){if(_0x4bfcdf){return _0x4bfcdf[_0xc617('0x27')]()['then'](function(){_0x1f550e['status'](0xcc)[_0xc617('0x1c')]();});}};}function handleEntityNotFound(_0x16960c,_0xf90e9b){return function(_0x599a71){if(!_0x599a71){_0x16960c[_0xc617('0x1a')](0x194);}return _0x599a71;};}function handleError(_0x3344e9,_0x363637){_0x363637=_0x363637||0x1f4;return function(_0x2913ab){logger[_0xc617('0x28')](_0x2913ab[_0xc617('0x29')]);if(_0x2913ab[_0xc617('0x2a')]){delete _0x2913ab['name'];}_0x3344e9[_0xc617('0x1b')](_0x363637)[_0xc617('0x2b')](_0x2913ab);};}exports[_0xc617('0x2c')]=function(_0x47192a,_0x27fa18){var _0xb1106={},_0x262477={},_0x519c63={'count':0x0,'rows':[]};var _0x35ccde=_[_0xc617('0x2d')](db[_0xc617('0x2e')][_0xc617('0x2f')],function(_0x4456b8){return{'name':_0x4456b8[_0xc617('0x30')],'type':_0x4456b8[_0xc617('0x31')][_0xc617('0x32')]};});_0x262477[_0xc617('0x33')]=_['map'](_0x35ccde,_0xc617('0x2a'));_0x262477['query']=_['keys'](_0x47192a[_0xc617('0x34')]);_0x262477[_0xc617('0x35')]=_[_0xc617('0x36')](_0x262477[_0xc617('0x33')],_0x262477['query']);_0xb1106['attributes']=_[_0xc617('0x36')](_0x262477[_0xc617('0x33')],qs[_0xc617('0x37')](_0x47192a[_0xc617('0x34')][_0xc617('0x37')]));_0xb1106[_0xc617('0x38')]=_0xb1106[_0xc617('0x38')]['length']?_0xb1106[_0xc617('0x38')]:_0x262477[_0xc617('0x33')];if(!_0x47192a[_0xc617('0x34')][_0xc617('0x39')](_0xc617('0x3a'))){_0xb1106['limit']=qs[_0xc617('0x20')](_0x47192a[_0xc617('0x34')][_0xc617('0x20')]);_0xb1106[_0xc617('0x1e')]=qs[_0xc617('0x1e')](_0x47192a[_0xc617('0x34')][_0xc617('0x1e')]);}_0xb1106[_0xc617('0x3b')]=qs[_0xc617('0x3c')](_0x47192a[_0xc617('0x34')][_0xc617('0x3c')]);_0xb1106[_0xc617('0x3d')]=qs[_0xc617('0x35')](_[_0xc617('0x3e')](_0x47192a['query'],_0x262477[_0xc617('0x35')]),_0x35ccde);if(_0x47192a[_0xc617('0x34')][_0xc617('0x3f')]){_0xb1106[_0xc617('0x3d')]=_[_0xc617('0x40')](_0xb1106['where'],{'$or':_[_0xc617('0x2d')](_0x35ccde,function(_0x4b4183){if(_0x4b4183[_0xc617('0x31')]!=='VIRTUAL'){var _0x537f0e={};_0x537f0e[_0x4b4183[_0xc617('0x2a')]]={'$like':'%'+_0x47192a[_0xc617('0x34')][_0xc617('0x3f')]+'%'};return _0x537f0e;}})});}_0xb1106=_[_0xc617('0x40')]({},_0xb1106,_0x47192a[_0xc617('0x41')]);var _0x11724b={'where':_0xb1106[_0xc617('0x3d')]};return db[_0xc617('0x2e')]['count'](_0x11724b)[_0xc617('0x26')](function(_0x39b928){_0x519c63[_0xc617('0x21')]=_0x39b928;if(_0x47192a['query'][_0xc617('0x42')]){_0xb1106[_0xc617('0x43')]=[{'all':!![]}];}return db[_0xc617('0x2e')]['findAll'](_0xb1106);})['then'](function(_0xaac19e){_0x519c63[_0xc617('0x44')]=_0xaac19e;return _0x519c63;})[_0xc617('0x26')](respondWithFilteredResult(_0x27fa18,_0xb1106))['catch'](handleError(_0x27fa18,null));};exports[_0xc617('0x45')]=function(_0x2642a9,_0x2bcbe3){var _0x22d2bd={'raw':!![],'where':{'id':_0x2642a9[_0xc617('0x46')]['id']}},_0x468054={};_0x468054[_0xc617('0x33')]=_['keys'](db[_0xc617('0x2e')][_0xc617('0x2f')]);_0x468054[_0xc617('0x34')]=_['keys'](_0x2642a9[_0xc617('0x34')]);_0x468054[_0xc617('0x35')]=_[_0xc617('0x36')](_0x468054[_0xc617('0x33')],_0x468054[_0xc617('0x34')]);_0x22d2bd[_0xc617('0x38')]=_['intersection'](_0x468054['model'],qs[_0xc617('0x37')](_0x2642a9[_0xc617('0x34')][_0xc617('0x37')]));_0x22d2bd[_0xc617('0x38')]=_0x22d2bd[_0xc617('0x38')]['length']?_0x22d2bd[_0xc617('0x38')]:_0x468054[_0xc617('0x33')];if(_0x2642a9['query'][_0xc617('0x42')]){_0x22d2bd[_0xc617('0x43')]=[{'all':!![]}];}_0x22d2bd=_[_0xc617('0x40')]({},_0x22d2bd,_0x2642a9['options']);return db['ServicenowField'][_0xc617('0x47')](_0x22d2bd)[_0xc617('0x26')](handleEntityNotFound(_0x2bcbe3,null))['then'](respondWithResult(_0x2bcbe3,null))[_0xc617('0x48')](handleError(_0x2bcbe3,null));};exports['create']=function(_0x16142a,_0x5a93ef){return db[_0xc617('0x2e')][_0xc617('0x49')](_0x16142a['body'],{})[_0xc617('0x26')](respondWithResult(_0x5a93ef,0xc9))[_0xc617('0x48')](handleError(_0x5a93ef,null));};exports[_0xc617('0x25')]=function(_0x3b40c2,_0x351424){if(_0x3b40c2[_0xc617('0x4a')]['id']){delete _0x3b40c2[_0xc617('0x4a')]['id'];}return db[_0xc617('0x2e')][_0xc617('0x47')]({'where':{'id':_0x3b40c2['params']['id']}})[_0xc617('0x26')](handleEntityNotFound(_0x351424,null))[_0xc617('0x26')](saveUpdates(_0x3b40c2[_0xc617('0x4a')],null))[_0xc617('0x26')](respondWithResult(_0x351424,null))['catch'](handleError(_0x351424,null));};exports['destroy']=function(_0x4b86c9,_0x33352){return db['ServicenowField'][_0xc617('0x47')]({'where':{'id':_0x4b86c9['params']['id']}})[_0xc617('0x26')](handleEntityNotFound(_0x33352,null))[_0xc617('0x26')](removeEntity(_0x33352,null))[_0xc617('0x48')](handleError(_0x33352,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index f9b0987..10ccb62 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 _0xfe01=['../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfe01,0x170));var _0x1fe0=function(_0x61716,_0x5c0364){_0x61716=_0x61716-0x0;var _0x3cc3be=_0xfe01[_0x61716];return _0x3cc3be;};'use strict';var _=require(_0x1fe0('0x0'));var util=require(_0x1fe0('0x1'));var logger=require(_0x1fe0('0x2'))(_0x1fe0('0x3'));var moment=require(_0x1fe0('0x4'));var BPromise=require('bluebird');var rp=require(_0x1fe0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fe0('0x6'));var config=require(_0x1fe0('0x7'));var attributes=require(_0x1fe0('0x8'));module[_0x1fe0('0x9')]=function(_0x2d6369,_0x18e062){return _0x2d6369['define'](_0x1fe0('0xa'),attributes,{'tableName':_0x1fe0('0xb'),'paranoid':![],'indexes':[{'name':_0x1fe0('0xc'),'fields':[_0x1fe0('0xd'),_0x1fe0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x07f8=['FieldId','util','path','rimraf','exports','define','servicenow_unique_index','idField'];(function(_0x1c4f43,_0x576e5a){var _0x2f0624=function(_0x1fdf60){while(--_0x1fdf60){_0x1c4f43['push'](_0x1c4f43['shift']());}};_0x2f0624(++_0x576e5a);}(_0x07f8,0x101));var _0x807f=function(_0x424895,_0x14c6f8){_0x424895=_0x424895-0x0;var _0xbf70ff=_0x07f8[_0x424895];return _0xbf70ff;};'use strict';var _=require('lodash');var util=require(_0x807f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x807f('0x1'));var rimraf=require(_0x807f('0x2'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x807f('0x3')]=function(_0x52c76c,_0x4b9b10){return _0x52c76c[_0x807f('0x4')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x807f('0x5'),'fields':[_0x807f('0x6'),_0x807f('0x7')],'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 b091888..8bfdc63 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xda3f,0xec));var _0xfda3=function(_0xac3fe9,_0xe8299){_0xac3fe9=_0xac3fe9-0x0;var _0x380fd3=_0xda3f[_0xac3fe9];return _0x380fd3;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x13834c,_0x2335aa){var _0x56f6e8=function(_0x4da35d){while(--_0x4da35d){_0x13834c['push'](_0x13834c['shift']());}};_0x56f6e8(++_0x2335aa);}(_0xb7e7,0x121));var _0x7b7e=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb7e7[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 881d399..bda7e63 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x53de6e,_0x51632f){var _0x4cbd63=function(_0xd50050){while(--_0xd50050){_0x53de6e['push'](_0x53de6e['shift']());}};_0x4cbd63(++_0x51632f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x227d00,_0x1eba1f){var _0x549a50=function(_0x349c5e){while(--_0x349c5e){_0x227d00['push'](_0x227d00['shift']());}};_0x549a50(++_0x1eba1f);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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 b353902..a0ff756 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(_0x2fabb3,_0x1589a0){var _0x29026=function(_0x5505ef){while(--_0x5505ef){_0x2fabb3['push'](_0x2fabb3['shift']());}};_0x29026(++_0x1589a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x4193f9,_0x1ddab5){var _0x4ae7f3=function(_0xce9a94){while(--_0xce9a94){_0x4193f9['push'](_0x4193f9['shift']());}};_0x4ae7f3(++_0x1ddab5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 97f0ae2..56e0f38 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 _0x281e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','SugarcrmAccount','then','includeAll','include','findAll','rows','catch','show','params','intersection','create','update','body','find','findOne','SugarcrmConfiguration','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','module_fields','remove','includes','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x19fec1,_0x1cc62f){var _0x29cd35=function(_0x712a4f){while(--_0x712a4f){_0x19fec1['push'](_0x19fec1['shift']());}};_0x29cd35(++_0x1cc62f);}(_0x281e,0x7a));var _0xe281=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x281e[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe281('0x0'));var zipdir=require(_0xe281('0x1'));var jsonpatch=require(_0xe281('0x2'));var rp=require('request-promise');var moment=require(_0xe281('0x3'));var BPromise=require(_0xe281('0x4'));var Mustache=require(_0xe281('0x5'));var util=require(_0xe281('0x6'));var path=require(_0xe281('0x7'));var sox=require(_0xe281('0x8'));var csv=require(_0xe281('0x9'));var ejs=require(_0xe281('0xa'));var fs=require('fs');var fs_extra=require(_0xe281('0xb'));var _=require('lodash');var squel=require(_0xe281('0xc'));var crypto=require('crypto');var jsforce=require(_0xe281('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe281('0x9'));var querystring=require(_0xe281('0xe'));var Papa=require(_0xe281('0xf'));var Redis=require(_0xe281('0x10'));var authService=require(_0xe281('0x11'));var qs=require(_0xe281('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe281('0x13'));var logger=require(_0xe281('0x14'))(_0xe281('0x15'));var utils=require(_0xe281('0x16'));var config=require(_0xe281('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe281('0x18'))['db'];var integrations=require(_0xe281('0x19'));function respondWithStatusCode(_0x206b4,_0x2987c2){_0x2987c2=_0x2987c2||0xcc;return function(_0x4d9748){if(_0x4d9748){return _0x206b4[_0xe281('0x1a')](_0x2987c2);}return _0x206b4['status'](_0x2987c2)['end']();};}function respondWithResult(_0x7276a7,_0x123ef3){_0x123ef3=_0x123ef3||0xc8;return function(_0x30e35c){if(_0x30e35c){return _0x7276a7[_0xe281('0x1b')](_0x123ef3)[_0xe281('0x1c')](_0x30e35c);}};}function respondWithFilteredResult(_0x5442c8,_0x514272){return function(_0x163de1){if(_0x163de1){var _0xbcec2e=typeof _0x514272['offset']===_0xe281('0x1d')&&typeof _0x514272[_0xe281('0x1e')]===_0xe281('0x1d');var _0x39241b=_0x163de1[_0xe281('0x1f')];var _0x539fec=_0xbcec2e?0x0:_0x514272[_0xe281('0x20')];var _0x29531f=_0xbcec2e?_0x163de1[_0xe281('0x1f')]:_0x514272[_0xe281('0x20')]+_0x514272[_0xe281('0x1e')];var _0x4e881a;if(_0x29531f>=_0x39241b){_0x29531f=_0x39241b;_0x4e881a=0xc8;}else{_0x4e881a=0xce;}_0x5442c8[_0xe281('0x1b')](_0x4e881a);return _0x5442c8[_0xe281('0x21')](_0xe281('0x22'),_0x539fec+'-'+_0x29531f+'/'+_0x39241b)[_0xe281('0x1c')](_0x163de1);}return null;};}function patchUpdates(_0x5c801e){return function(_0x3230e3){try{jsonpatch[_0xe281('0x23')](_0x3230e3,_0x5c801e,!![]);}catch(_0x25804a){return BPromise[_0xe281('0x24')](_0x25804a);}return _0x3230e3[_0xe281('0x25')]();};}function saveUpdates(_0x1fae2a,_0x83f33a){return function(_0x33e07e){if(_0x33e07e){return _0x33e07e['update'](_0x1fae2a)['then'](function(_0x158af7){return _0x158af7;});}return null;};}function removeEntity(_0x321305,_0x455015){return function(_0x109fc5){if(_0x109fc5){return _0x109fc5[_0xe281('0x26')]()['then'](function(){_0x321305[_0xe281('0x1b')](0xcc)[_0xe281('0x27')]();});}};}function handleEntityNotFound(_0xcf47cf,_0x38e4e8){return function(_0x29af34){if(!_0x29af34){_0xcf47cf[_0xe281('0x1a')](0x194);}return _0x29af34;};}function handleError(_0x169809,_0x467ece){_0x467ece=_0x467ece||0x1f4;return function(_0x177e1c){logger[_0xe281('0x28')](_0x177e1c[_0xe281('0x29')]);if(_0x177e1c['name']){delete _0x177e1c[_0xe281('0x2a')];}_0x169809[_0xe281('0x1b')](_0x467ece)[_0xe281('0x2b')](_0x177e1c);};}exports[_0xe281('0x2c')]=function(_0x48f442,_0x357476){var _0x4245b9={},_0x1f7dfe={},_0x8df3ca={'count':0x0,'rows':[]};var _0x3b9e5d=_[_0xe281('0x2d')](db['SugarcrmAccount'][_0xe281('0x2e')],function(_0x28a200){return{'name':_0x28a200[_0xe281('0x2f')],'type':_0x28a200['type'][_0xe281('0x30')]};});_0x1f7dfe['model']=_['map'](_0x3b9e5d,'name');_0x1f7dfe[_0xe281('0x31')]=_[_0xe281('0x32')](_0x48f442[_0xe281('0x31')]);_0x1f7dfe['filters']=_['intersection'](_0x1f7dfe[_0xe281('0x33')],_0x1f7dfe['query']);_0x4245b9[_0xe281('0x34')]=_['intersection'](_0x1f7dfe[_0xe281('0x33')],qs['fields'](_0x48f442[_0xe281('0x31')][_0xe281('0x35')]));_0x4245b9[_0xe281('0x34')]=_0x4245b9['attributes'][_0xe281('0x36')]?_0x4245b9['attributes']:_0x1f7dfe[_0xe281('0x33')];if(!_0x48f442[_0xe281('0x31')][_0xe281('0x37')](_0xe281('0x38'))){_0x4245b9['limit']=qs[_0xe281('0x1e')](_0x48f442[_0xe281('0x31')][_0xe281('0x1e')]);_0x4245b9['offset']=qs[_0xe281('0x20')](_0x48f442['query']['offset']);}_0x4245b9[_0xe281('0x39')]=qs[_0xe281('0x3a')](_0x48f442[_0xe281('0x31')]['sort']);_0x4245b9[_0xe281('0x3b')]=qs[_0xe281('0x3c')](_[_0xe281('0x3d')](_0x48f442[_0xe281('0x31')],_0x1f7dfe[_0xe281('0x3c')]),_0x3b9e5d);if(_0x48f442[_0xe281('0x31')][_0xe281('0x3e')]){_0x4245b9[_0xe281('0x3b')]=_[_0xe281('0x3f')](_0x4245b9[_0xe281('0x3b')],{'$or':_[_0xe281('0x2d')](_0x3b9e5d,function(_0x16f045){if(_0x16f045[_0xe281('0x40')]!=='VIRTUAL'){var _0x13155b={};_0x13155b[_0x16f045[_0xe281('0x2a')]]={'$like':'%'+_0x48f442[_0xe281('0x31')][_0xe281('0x3e')]+'%'};return _0x13155b;}})});}_0x4245b9=_[_0xe281('0x3f')]({},_0x4245b9,_0x48f442[_0xe281('0x41')]);var _0x5ff813={'where':_0x4245b9['where']};return db[_0xe281('0x42')][_0xe281('0x1f')](_0x5ff813)[_0xe281('0x43')](function(_0x35cc5c){_0x8df3ca['count']=_0x35cc5c;if(_0x48f442['query'][_0xe281('0x44')]){_0x4245b9[_0xe281('0x45')]=[{'all':!![]}];}return db[_0xe281('0x42')][_0xe281('0x46')](_0x4245b9);})[_0xe281('0x43')](function(_0x59cd39){_0x8df3ca[_0xe281('0x47')]=_0x59cd39;return _0x8df3ca;})[_0xe281('0x43')](respondWithFilteredResult(_0x357476,_0x4245b9))[_0xe281('0x48')](handleError(_0x357476,null));};exports[_0xe281('0x49')]=function(_0x353b2a,_0x4474c2){var _0x56647d={'raw':![],'where':{'id':_0x353b2a[_0xe281('0x4a')]['id']}},_0x7b0eb2={};_0x7b0eb2['model']=_[_0xe281('0x32')](db[_0xe281('0x42')][_0xe281('0x2e')]);_0x7b0eb2['query']=_['keys'](_0x353b2a[_0xe281('0x31')]);_0x7b0eb2[_0xe281('0x3c')]=_[_0xe281('0x4b')](_0x7b0eb2[_0xe281('0x33')],_0x7b0eb2[_0xe281('0x31')]);_0x56647d[_0xe281('0x34')]=_[_0xe281('0x4b')](_0x7b0eb2['model'],qs['fields'](_0x353b2a[_0xe281('0x31')][_0xe281('0x35')]));_0x56647d[_0xe281('0x34')]=_0x56647d[_0xe281('0x34')][_0xe281('0x36')]?_0x56647d[_0xe281('0x34')]:_0x7b0eb2[_0xe281('0x33')];if(_0x353b2a[_0xe281('0x31')]['includeAll']){_0x56647d['include']=[{'all':!![]}];}_0x56647d=_[_0xe281('0x3f')]({},_0x56647d,_0x353b2a[_0xe281('0x41')]);return db[_0xe281('0x42')]['find'](_0x56647d)[_0xe281('0x43')](handleEntityNotFound(_0x4474c2,null))[_0xe281('0x43')](respondWithResult(_0x4474c2,null))['catch'](handleError(_0x4474c2,null));};exports['create']=function(_0x5b85f5,_0x325cb6){return db[_0xe281('0x42')][_0xe281('0x4c')](_0x5b85f5['body'],{})[_0xe281('0x43')](respondWithResult(_0x325cb6,0xc9))['catch'](handleError(_0x325cb6,null));};exports[_0xe281('0x4d')]=function(_0x5d2dcf,_0x3e722e){if(_0x5d2dcf[_0xe281('0x4e')]['id']){delete _0x5d2dcf[_0xe281('0x4e')]['id'];}return db[_0xe281('0x42')][_0xe281('0x4f')]({'where':{'id':_0x5d2dcf[_0xe281('0x4a')]['id']}})[_0xe281('0x43')](handleEntityNotFound(_0x3e722e,null))[_0xe281('0x43')](saveUpdates(_0x5d2dcf['body'],null))[_0xe281('0x43')](respondWithResult(_0x3e722e,null))[_0xe281('0x48')](handleError(_0x3e722e,null));};exports['destroy']=function(_0x278c30,_0x2f0915){return db[_0xe281('0x42')][_0xe281('0x4f')]({'where':{'id':_0x278c30[_0xe281('0x4a')]['id']}})[_0xe281('0x43')](handleEntityNotFound(_0x2f0915,null))[_0xe281('0x43')](removeEntity(_0x2f0915,null))['catch'](handleError(_0x2f0915,null));};exports['getConfigurations']=function(_0x3d79c3,_0x2e1c68,_0x3588e8){var _0x3b0bfc={};var _0x504ea8={};var _0x446a42;var _0x229c26;return db[_0xe281('0x42')][_0xe281('0x50')]({'where':{'id':_0x3d79c3[_0xe281('0x4a')]['id']}})[_0xe281('0x43')](handleEntityNotFound(_0x2e1c68,null))[_0xe281('0x43')](function(_0x56289a){if(_0x56289a){_0x446a42=_0x56289a;_0x504ea8[_0xe281('0x33')]=_['keys'](db[_0xe281('0x51')][_0xe281('0x2e')]);_0x504ea8['query']=_[_0xe281('0x32')](_0x3d79c3[_0xe281('0x31')]);_0x504ea8['filters']=_[_0xe281('0x4b')](_0x504ea8[_0xe281('0x33')],_0x504ea8[_0xe281('0x31')]);_0x3b0bfc['attributes']=_[_0xe281('0x4b')](_0x504ea8[_0xe281('0x33')],qs['fields'](_0x3d79c3[_0xe281('0x31')]['fields']));_0x3b0bfc['attributes']=_0x3b0bfc[_0xe281('0x34')][_0xe281('0x36')]?_0x3b0bfc[_0xe281('0x34')]:_0x504ea8['model'];_0x3b0bfc[_0xe281('0x39')]=qs[_0xe281('0x3a')](_0x3d79c3[_0xe281('0x31')][_0xe281('0x3a')]);_0x3b0bfc[_0xe281('0x3b')]=qs[_0xe281('0x3c')](_['pick'](_0x3d79c3['query'],_0x504ea8['filters']));if(_0x3d79c3[_0xe281('0x31')][_0xe281('0x3e')]){_0x3b0bfc[_0xe281('0x3b')]=_[_0xe281('0x3f')](_0x3b0bfc[_0xe281('0x3b')],{'$or':_[_0xe281('0x2d')](_0x3b0bfc[_0xe281('0x34')],function(_0x25fa72){var _0xefdb12={};_0xefdb12[_0x25fa72]={'$like':'%'+_0x3d79c3['query'][_0xe281('0x3e')]+'%'};return _0xefdb12;})});}_0x3b0bfc=_['merge']({},_0x3b0bfc,_0x3d79c3['options']);return _0x446a42['getConfigurations'](_0x3b0bfc);}})[_0xe281('0x43')](function(_0xb02b79){if(_0xb02b79){_0x229c26=_0xb02b79['length'];if(!_0x3d79c3['query'][_0xe281('0x37')]('nolimit')){_0x3b0bfc[_0xe281('0x1e')]=qs[_0xe281('0x1e')](_0x3d79c3['query'][_0xe281('0x1e')]);_0x3b0bfc[_0xe281('0x20')]=qs[_0xe281('0x20')](_0x3d79c3[_0xe281('0x31')][_0xe281('0x20')]);}return _0x446a42[_0xe281('0x52')](_0x3b0bfc);}})['then'](function(_0x51157a){if(_0x51157a){return _0x51157a?{'count':_0x229c26,'rows':_0x51157a}:null;}})[_0xe281('0x43')](respondWithResult(_0x2e1c68,null))[_0xe281('0x48')](handleError(_0x2e1c68,null));};exports['addConfiguration']=function(_0x166822,_0x2e028e,_0x45752e){if(_0x166822['body']['id']){delete _0x166822[_0xe281('0x4e')]['id'];}return db[_0xe281('0x42')][_0xe281('0x50')]({'where':{'id':_0x166822[_0xe281('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e028e,null))[_0xe281('0x43')](function(_0x11a21c){if(_0x11a21c){_0x166822[_0xe281('0x4e')][_0xe281('0x53')]=_0x11a21c['id'];_0x166822[_0xe281('0x4e')]['Subjects']=integrations[_0xe281('0x54')](_0x166822['body'][_0xe281('0x55')],_0x166822[_0xe281('0x4e')][_0xe281('0x40')]);_0x166822[_0xe281('0x4e')][_0xe281('0x56')]=integrations[_0xe281('0x57')](_0x166822[_0xe281('0x4e')][_0xe281('0x55')],_0x166822[_0xe281('0x4e')]['type']);return db[_0xe281('0x51')][_0xe281('0x4c')](_0x166822[_0xe281('0x4e')],{'include':[{'model':db[_0xe281('0x58')],'as':'Subjects'},{'model':db[_0xe281('0x58')],'as':_0xe281('0x56')}]});}return null;})[_0xe281('0x43')](respondWithResult(_0x2e028e,null))['catch'](handleError(_0x2e028e,null));};exports[_0xe281('0x59')]=function(_0x50c521,_0x10ecb3,_0x3249fa){var _0x587701='';var _0x20ac79=['id','name','assigned_user_id',_0xe281('0x5a'),_0xe281('0x5b'),_0xe281('0x5c'),_0xe281('0x5d'),_0xe281('0x5e'),_0xe281('0x5f'),_0xe281('0x60'),_0xe281('0x61'),_0xe281('0x62')];return db[_0xe281('0x42')]['findOne']({'where':{'id':_0x50c521[_0xe281('0x4a')]['id']},'attributes':['id','username',_0xe281('0x63'),_0xe281('0x64')]})['then'](handleEntityNotFound(_0x10ecb3,null))[_0xe281('0x43')](function(_0x2f3d88){if(_0x2f3d88){_0x587701=_0x2f3d88[_0xe281('0x64')];var _0x671c82=_0x587701[_0xe281('0x65')](-0x1);if(_0x671c82==='/'){_0x587701=_0x587701['substring'](0x0,_0x587701[_0xe281('0x66')](_0x671c82));}return rp({'method':_0xe281('0x67'),'uri':util[_0xe281('0x68')](_0xe281('0x69'),_0x587701,_0xe281('0x6a')),'json':!![],'form':{'method':_0xe281('0x6b'),'input_type':'JSON','response_type':_0xe281('0x6c'),'rest_data':JSON[_0xe281('0x6d')]({'user_auth':{'user_name':_0x2f3d88[_0xe281('0x6e')],'password':_0x2f3d88[_0xe281('0x63')],'encryption':_0xe281('0x6f')},'application':_0xe281('0x70')})}});}})[_0xe281('0x43')](function(_0x2b041a){if(_0x2b041a&&_0x2b041a['name']!==_0xe281('0x71')&&_0x2b041a[_0xe281('0x2a')]!==_0xe281('0x72')){return rp({'method':_0xe281('0x67'),'uri':util[_0xe281('0x68')]('%s%s',_0x587701,_0xe281('0x6a')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xe281('0x6c'),'response_type':_0xe281('0x6c'),'rest_data':JSON[_0xe281('0x6d')]({'session':_0x2b041a['id'],'module_name':_0xe281('0x73')})}})[_0xe281('0x43')](function(_0x5a1d70){if(_0x5a1d70){var _0x119f5a=_['values'](_0x5a1d70[_0xe281('0x74')]);_[_0xe281('0x75')](_0x119f5a,function(_0x38fc9f){return _0x20ac79[_0xe281('0x76')](_0x38fc9f['name']);});return{'count':_0x119f5a[_0xe281('0x36')],'rows':_[_0xe281('0x2d')](_0x119f5a,function(_0x3a0624){return{'id':_0x3a0624[_0xe281('0x2a')],'name':_0x3a0624['label'],'custom':_[_0xe281('0x77')](_0x3a0624[_0xe281('0x2a')],'_c')?!![]:![],'options':_0x3a0624[_0xe281('0x41')]?_[_0xe281('0x2d')](_[_0xe281('0x78')](_0x3a0624[_0xe281('0x41')]),function(_0x5f3884){return{'name':_0x5f3884[_0xe281('0x79')],'value':_0x5f3884[_0xe281('0x2a')]};}):[]};})};}})[_0xe281('0x43')](respondWithResult(_0x10ecb3,null))[_0xe281('0x48')](function(_0x98adf6){var _0x2d183e=_0x50c521['query'][_0xe281('0x7a')]?0x1f4:_0x98adf6[_0xe281('0x7b')]||0x1f4;logger[_0xe281('0x28')](_0xe281('0x7c'),'getFields',_0x2d183e,JSON[_0xe281('0x6d')](_0x98adf6));delete _0x98adf6['name'];if(_0x2d183e===0x191){_0x2d183e=0x190;}_0x10ecb3[_0xe281('0x1b')](_0x2d183e)[_0xe281('0x2b')](_0x50c521['query'][_0xe281('0x7a')]?{'message':_0xe281('0x7d'),'statusCode':_0x98adf6[_0xe281('0x7b')]}:_0x98adf6);});}else{var _0x403220=0x1f4;_0x10ecb3[_0xe281('0x1b')](_0x403220)[_0xe281('0x2b')]({'message':_0xe281('0x7d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x944e=['limit','count','offset','status','set','Content-Range','apply','reject','then','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SugarcrmAccount','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','update','destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','parent_name','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','options','value','test','statusCode','error','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','undefined'];(function(_0x8ea7f3,_0x475cce){var _0x4cea9d=function(_0x13ac73){while(--_0x13ac73){_0x8ea7f3['push'](_0x8ea7f3['shift']());}};_0x4cea9d(++_0x475cce);}(_0x944e,0x15a));var _0xe944=function(_0x233369,_0x5be2c9){_0x233369=_0x233369-0x0;var _0x40a709=_0x944e[_0x233369];return _0x40a709;};'use strict';var emlformat=require(_0xe944('0x0'));var rimraf=require(_0xe944('0x1'));var zipdir=require(_0xe944('0x2'));var jsonpatch=require(_0xe944('0x3'));var rp=require('request-promise');var moment=require(_0xe944('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe944('0x5'));var path=require(_0xe944('0x6'));var sox=require(_0xe944('0x7'));var csv=require(_0xe944('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe944('0x9'));var squel=require(_0xe944('0xa'));var crypto=require('crypto');var jsforce=require(_0xe944('0xb'));var deskjs=require(_0xe944('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe944('0xd'));var Papa=require('papaparse');var Redis=require(_0xe944('0xe'));var authService=require(_0xe944('0xf'));var qs=require(_0xe944('0x10'));var as=require(_0xe944('0x11'));var hardwareService=require(_0xe944('0x12'));var logger=require(_0xe944('0x13'))(_0xe944('0x14'));var utils=require('../../config/utils');var config=require(_0xe944('0x15'));var licenseUtil=require(_0xe944('0x16'));var db=require(_0xe944('0x17'))['db'];var integrations=require(_0xe944('0x18'));function respondWithStatusCode(_0x48ad08,_0x2da88a){_0x2da88a=_0x2da88a||0xcc;return function(_0x18f183){if(_0x18f183){return _0x48ad08[_0xe944('0x19')](_0x2da88a);}return _0x48ad08['status'](_0x2da88a)[_0xe944('0x1a')]();};}function respondWithResult(_0x4ee5c4,_0x444345){_0x444345=_0x444345||0xc8;return function(_0x248b58){if(_0x248b58){return _0x4ee5c4['status'](_0x444345)[_0xe944('0x1b')](_0x248b58);}};}function respondWithFilteredResult(_0xbe38f2,_0x297809){return function(_0x24e027){if(_0x24e027){var _0x460b81=typeof _0x297809['offset']===_0xe944('0x1c')&&typeof _0x297809[_0xe944('0x1d')]==='undefined';var _0x48d784=_0x24e027['count'];var _0x2492ad=_0x460b81?0x0:_0x297809['offset'];var _0x17c077=_0x460b81?_0x24e027[_0xe944('0x1e')]:_0x297809[_0xe944('0x1f')]+_0x297809[_0xe944('0x1d')];var _0x55d74d;if(_0x17c077>=_0x48d784){_0x17c077=_0x48d784;_0x55d74d=0xc8;}else{_0x55d74d=0xce;}_0xbe38f2[_0xe944('0x20')](_0x55d74d);return _0xbe38f2[_0xe944('0x21')](_0xe944('0x22'),_0x2492ad+'-'+_0x17c077+'/'+_0x48d784)['json'](_0x24e027);}return null;};}function patchUpdates(_0x3b1a2e){return function(_0x424945){try{jsonpatch[_0xe944('0x23')](_0x424945,_0x3b1a2e,!![]);}catch(_0x48608b){return BPromise[_0xe944('0x24')](_0x48608b);}return _0x424945['save']();};}function saveUpdates(_0x94ddb4,_0x4a665f){return function(_0x356146){if(_0x356146){return _0x356146['update'](_0x94ddb4)['then'](function(_0x300e7e){return _0x300e7e;});}return null;};}function removeEntity(_0x43161e,_0x1db988){return function(_0x2861ad){if(_0x2861ad){return _0x2861ad['destroy']()[_0xe944('0x25')](function(){_0x43161e['status'](0xcc)[_0xe944('0x1a')]();});}};}function handleEntityNotFound(_0x4d49ef,_0x5ae12d){return function(_0x109ea5){if(!_0x109ea5){_0x4d49ef['sendStatus'](0x194);}return _0x109ea5;};}function handleError(_0x39ea96,_0x5cc624){_0x5cc624=_0x5cc624||0x1f4;return function(_0x5c535f){logger['error'](_0x5c535f[_0xe944('0x26')]);if(_0x5c535f[_0xe944('0x27')]){delete _0x5c535f['name'];}_0x39ea96['status'](_0x5cc624)[_0xe944('0x28')](_0x5c535f);};}exports['index']=function(_0x4ad660,_0x4af86){var _0x32f8a1={},_0x3a09c5={},_0xe47fdc={'count':0x0,'rows':[]};var _0x3f0516=_['map'](db['SugarcrmAccount'][_0xe944('0x29')],function(_0x47b611){return{'name':_0x47b611[_0xe944('0x2a')],'type':_0x47b611[_0xe944('0x2b')][_0xe944('0x2c')]};});_0x3a09c5['model']=_[_0xe944('0x2d')](_0x3f0516,_0xe944('0x27'));_0x3a09c5[_0xe944('0x2e')]=_[_0xe944('0x2f')](_0x4ad660['query']);_0x3a09c5['filters']=_['intersection'](_0x3a09c5['model'],_0x3a09c5[_0xe944('0x2e')]);_0x32f8a1[_0xe944('0x30')]=_[_0xe944('0x31')](_0x3a09c5[_0xe944('0x32')],qs[_0xe944('0x33')](_0x4ad660[_0xe944('0x2e')][_0xe944('0x33')]));_0x32f8a1['attributes']=_0x32f8a1[_0xe944('0x30')]['length']?_0x32f8a1[_0xe944('0x30')]:_0x3a09c5[_0xe944('0x32')];if(!_0x4ad660[_0xe944('0x2e')][_0xe944('0x34')](_0xe944('0x35'))){_0x32f8a1['limit']=qs['limit'](_0x4ad660[_0xe944('0x2e')][_0xe944('0x1d')]);_0x32f8a1[_0xe944('0x1f')]=qs[_0xe944('0x1f')](_0x4ad660[_0xe944('0x2e')][_0xe944('0x1f')]);}_0x32f8a1[_0xe944('0x36')]=qs[_0xe944('0x37')](_0x4ad660['query'][_0xe944('0x37')]);_0x32f8a1[_0xe944('0x38')]=qs[_0xe944('0x39')](_[_0xe944('0x3a')](_0x4ad660['query'],_0x3a09c5[_0xe944('0x39')]),_0x3f0516);if(_0x4ad660[_0xe944('0x2e')][_0xe944('0x3b')]){_0x32f8a1['where']=_[_0xe944('0x3c')](_0x32f8a1[_0xe944('0x38')],{'$or':_[_0xe944('0x2d')](_0x3f0516,function(_0x2f7165){if(_0x2f7165[_0xe944('0x2b')]!==_0xe944('0x3d')){var _0x1f936a={};_0x1f936a[_0x2f7165['name']]={'$like':'%'+_0x4ad660[_0xe944('0x2e')][_0xe944('0x3b')]+'%'};return _0x1f936a;}})});}_0x32f8a1=_[_0xe944('0x3c')]({},_0x32f8a1,_0x4ad660['options']);var _0x377271={'where':_0x32f8a1['where']};return db[_0xe944('0x3e')][_0xe944('0x1e')](_0x377271)[_0xe944('0x25')](function(_0x4cf704){_0xe47fdc[_0xe944('0x1e')]=_0x4cf704;if(_0x4ad660['query'][_0xe944('0x3f')]){_0x32f8a1[_0xe944('0x40')]=[{'all':!![]}];}return db[_0xe944('0x3e')][_0xe944('0x41')](_0x32f8a1);})[_0xe944('0x25')](function(_0x110635){_0xe47fdc[_0xe944('0x42')]=_0x110635;return _0xe47fdc;})[_0xe944('0x25')](respondWithFilteredResult(_0x4af86,_0x32f8a1))['catch'](handleError(_0x4af86,null));};exports[_0xe944('0x43')]=function(_0x279032,_0xd0aeb9){var _0x97106={'raw':![],'where':{'id':_0x279032[_0xe944('0x44')]['id']}},_0x50a64e={};_0x50a64e[_0xe944('0x32')]=_[_0xe944('0x2f')](db['SugarcrmAccount'][_0xe944('0x29')]);_0x50a64e[_0xe944('0x2e')]=_['keys'](_0x279032[_0xe944('0x2e')]);_0x50a64e['filters']=_[_0xe944('0x31')](_0x50a64e['model'],_0x50a64e['query']);_0x97106[_0xe944('0x30')]=_[_0xe944('0x31')](_0x50a64e['model'],qs['fields'](_0x279032[_0xe944('0x2e')][_0xe944('0x33')]));_0x97106[_0xe944('0x30')]=_0x97106['attributes'][_0xe944('0x45')]?_0x97106['attributes']:_0x50a64e['model'];if(_0x279032[_0xe944('0x2e')][_0xe944('0x3f')]){_0x97106['include']=[{'all':!![]}];}_0x97106=_[_0xe944('0x3c')]({},_0x97106,_0x279032['options']);return db[_0xe944('0x3e')][_0xe944('0x46')](_0x97106)[_0xe944('0x25')](handleEntityNotFound(_0xd0aeb9,null))['then'](respondWithResult(_0xd0aeb9,null))[_0xe944('0x47')](handleError(_0xd0aeb9,null));};exports['create']=function(_0x43994d,_0x1fe435){return db[_0xe944('0x3e')][_0xe944('0x48')](_0x43994d[_0xe944('0x49')],{})[_0xe944('0x25')](respondWithResult(_0x1fe435,0xc9))[_0xe944('0x47')](handleError(_0x1fe435,null));};exports[_0xe944('0x4a')]=function(_0x47180a,_0x2362c0){if(_0x47180a[_0xe944('0x49')]['id']){delete _0x47180a[_0xe944('0x49')]['id'];}return db[_0xe944('0x3e')]['find']({'where':{'id':_0x47180a[_0xe944('0x44')]['id']}})[_0xe944('0x25')](handleEntityNotFound(_0x2362c0,null))[_0xe944('0x25')](saveUpdates(_0x47180a[_0xe944('0x49')],null))[_0xe944('0x25')](respondWithResult(_0x2362c0,null))[_0xe944('0x47')](handleError(_0x2362c0,null));};exports[_0xe944('0x4b')]=function(_0x38cca3,_0x28d1b1){return db[_0xe944('0x3e')]['find']({'where':{'id':_0x38cca3[_0xe944('0x44')]['id']}})['then'](handleEntityNotFound(_0x28d1b1,null))[_0xe944('0x25')](removeEntity(_0x28d1b1,null))[_0xe944('0x47')](handleError(_0x28d1b1,null));};exports[_0xe944('0x4c')]=function(_0x3d9e60,_0x579c10,_0x3227c7){var _0x415188={};var _0x5a84f4={};var _0x220d67;var _0x18c76a;return db['SugarcrmAccount'][_0xe944('0x4d')]({'where':{'id':_0x3d9e60['params']['id']}})[_0xe944('0x25')](handleEntityNotFound(_0x579c10,null))['then'](function(_0x4f32fe){if(_0x4f32fe){_0x220d67=_0x4f32fe;_0x5a84f4[_0xe944('0x32')]=_[_0xe944('0x2f')](db[_0xe944('0x4e')][_0xe944('0x29')]);_0x5a84f4[_0xe944('0x2e')]=_['keys'](_0x3d9e60[_0xe944('0x2e')]);_0x5a84f4[_0xe944('0x39')]=_[_0xe944('0x31')](_0x5a84f4[_0xe944('0x32')],_0x5a84f4[_0xe944('0x2e')]);_0x415188['attributes']=_[_0xe944('0x31')](_0x5a84f4['model'],qs[_0xe944('0x33')](_0x3d9e60[_0xe944('0x2e')][_0xe944('0x33')]));_0x415188[_0xe944('0x30')]=_0x415188[_0xe944('0x30')]['length']?_0x415188[_0xe944('0x30')]:_0x5a84f4['model'];_0x415188['order']=qs[_0xe944('0x37')](_0x3d9e60[_0xe944('0x2e')][_0xe944('0x37')]);_0x415188[_0xe944('0x38')]=qs[_0xe944('0x39')](_[_0xe944('0x3a')](_0x3d9e60['query'],_0x5a84f4[_0xe944('0x39')]));if(_0x3d9e60['query'][_0xe944('0x3b')]){_0x415188['where']=_[_0xe944('0x3c')](_0x415188['where'],{'$or':_['map'](_0x415188['attributes'],function(_0x445358){var _0x2b7b2d={};_0x2b7b2d[_0x445358]={'$like':'%'+_0x3d9e60['query'][_0xe944('0x3b')]+'%'};return _0x2b7b2d;})});}_0x415188=_[_0xe944('0x3c')]({},_0x415188,_0x3d9e60['options']);return _0x220d67[_0xe944('0x4c')](_0x415188);}})[_0xe944('0x25')](function(_0x429165){if(_0x429165){_0x18c76a=_0x429165['length'];if(!_0x3d9e60['query'][_0xe944('0x34')](_0xe944('0x35'))){_0x415188[_0xe944('0x1d')]=qs[_0xe944('0x1d')](_0x3d9e60[_0xe944('0x2e')][_0xe944('0x1d')]);_0x415188['offset']=qs[_0xe944('0x1f')](_0x3d9e60[_0xe944('0x2e')]['offset']);}return _0x220d67[_0xe944('0x4c')](_0x415188);}})[_0xe944('0x25')](function(_0x349a77){if(_0x349a77){return _0x349a77?{'count':_0x18c76a,'rows':_0x349a77}:null;}})['then'](respondWithResult(_0x579c10,null))[_0xe944('0x47')](handleError(_0x579c10,null));};exports[_0xe944('0x4f')]=function(_0x2883e4,_0x39615b,_0x5e7193){if(_0x2883e4['body']['id']){delete _0x2883e4[_0xe944('0x49')]['id'];}return db[_0xe944('0x3e')][_0xe944('0x4d')]({'where':{'id':_0x2883e4[_0xe944('0x44')]['id']}})[_0xe944('0x25')](handleEntityNotFound(_0x39615b,null))['then'](function(_0x52fd4f){if(_0x52fd4f){_0x2883e4['body']['AccountId']=_0x52fd4f['id'];_0x2883e4[_0xe944('0x49')]['Subjects']=integrations[_0xe944('0x50')](_0x2883e4['body']['channel'],_0x2883e4['body'][_0xe944('0x2b')]);_0x2883e4[_0xe944('0x49')][_0xe944('0x51')]=integrations[_0xe944('0x52')](_0x2883e4[_0xe944('0x49')][_0xe944('0x53')],_0x2883e4[_0xe944('0x49')][_0xe944('0x2b')]);return db['SugarcrmConfiguration']['create'](_0x2883e4[_0xe944('0x49')],{'include':[{'model':db['SugarcrmField'],'as':_0xe944('0x54')},{'model':db[_0xe944('0x55')],'as':'Descriptions'}]});}return null;})[_0xe944('0x25')](respondWithResult(_0x39615b,null))[_0xe944('0x47')](handleError(_0x39615b,null));};exports[_0xe944('0x56')]=function(_0x1b222a,_0xbcf2d7,_0x1f3f51){var _0x35903b='';var _0x5aa578=['id',_0xe944('0x27'),_0xe944('0x57'),_0xe944('0x58'),_0xe944('0x59'),_0xe944('0x5a'),_0xe944('0x5b'),'duration_minutes',_0xe944('0x5c'),_0xe944('0x5d'),_0xe944('0x5e'),'direction'];return db[_0xe944('0x3e')][_0xe944('0x4d')]({'where':{'id':_0x1b222a['params']['id']},'attributes':['id',_0xe944('0x5f'),_0xe944('0x60'),_0xe944('0x61')]})[_0xe944('0x25')](handleEntityNotFound(_0xbcf2d7,null))[_0xe944('0x25')](function(_0x348228){if(_0x348228){_0x35903b=_0x348228[_0xe944('0x61')];var _0x597f15=_0x35903b['slice'](-0x1);if(_0x597f15==='/'){_0x35903b=_0x35903b[_0xe944('0x62')](0x0,_0x35903b[_0xe944('0x63')](_0x597f15));}return rp({'method':_0xe944('0x64'),'uri':util[_0xe944('0x65')](_0xe944('0x66'),_0x35903b,_0xe944('0x67')),'json':!![],'form':{'method':_0xe944('0x68'),'input_type':_0xe944('0x69'),'response_type':_0xe944('0x69'),'rest_data':JSON[_0xe944('0x6a')]({'user_auth':{'user_name':_0x348228[_0xe944('0x5f')],'password':_0x348228['password'],'encryption':_0xe944('0x6b')},'application':_0xe944('0x6c')})}});}})[_0xe944('0x25')](function(_0x16d368){if(_0x16d368&&_0x16d368[_0xe944('0x27')]!==_0xe944('0x6d')&&_0x16d368[_0xe944('0x27')]!==_0xe944('0x6e')){return rp({'method':_0xe944('0x64'),'uri':util['format'](_0xe944('0x66'),_0x35903b,_0xe944('0x67')),'json':!![],'form':{'method':_0xe944('0x6f'),'input_type':_0xe944('0x69'),'response_type':_0xe944('0x69'),'rest_data':JSON[_0xe944('0x6a')]({'session':_0x16d368['id'],'module_name':_0xe944('0x70')})}})[_0xe944('0x25')](function(_0x266771){if(_0x266771){var _0x45e465=_[_0xe944('0x71')](_0x266771[_0xe944('0x72')]);_[_0xe944('0x73')](_0x45e465,function(_0x4b4659){return _0x5aa578[_0xe944('0x74')](_0x4b4659['name']);});return{'count':_0x45e465[_0xe944('0x45')],'rows':_['map'](_0x45e465,function(_0x3fcbe0){return{'id':_0x3fcbe0[_0xe944('0x27')],'name':_0x3fcbe0[_0xe944('0x75')],'custom':_[_0xe944('0x76')](_0x3fcbe0['name'],'_c')?!![]:![],'options':_0x3fcbe0['options']?_[_0xe944('0x2d')](_[_0xe944('0x71')](_0x3fcbe0[_0xe944('0x77')]),function(_0xfe6d10){return{'name':_0xfe6d10[_0xe944('0x78')],'value':_0xfe6d10[_0xe944('0x27')]};}):[]};})};}})['then'](respondWithResult(_0xbcf2d7,null))[_0xe944('0x47')](function(_0x436433){var _0x1e7eb2=_0x1b222a[_0xe944('0x2e')][_0xe944('0x79')]?0x1f4:_0x436433[_0xe944('0x7a')]||0x1f4;logger[_0xe944('0x7b')]('getFields,\x20%s,\x20%s,\x20%s',_0xe944('0x56'),_0x1e7eb2,JSON['stringify'](_0x436433));delete _0x436433[_0xe944('0x27')];if(_0x1e7eb2===0x191){_0x1e7eb2=0x190;}_0xbcf2d7[_0xe944('0x20')](_0x1e7eb2)['send'](_0x1b222a[_0xe944('0x2e')]['test']?{'message':_0xe944('0x7c'),'statusCode':_0x436433[_0xe944('0x7a')]}:_0x436433);});}else{var _0x4c902a=0x1f4;_0xbcf2d7[_0xe944('0x20')](_0x4c902a)[_0xe944('0x28')]({'message':_0xe944('0x7c'),'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 c421c12..4d8b18e 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 _0x8ce2=['util','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash'];(function(_0x22b005,_0x2a6515){var _0x58bd11=function(_0x3f66f5){while(--_0x3f66f5){_0x22b005['push'](_0x22b005['shift']());}};_0x58bd11(++_0x2a6515);}(_0x8ce2,0x18b));var _0x28ce=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ce2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x28ce('0x0'));var util=require(_0x28ce('0x1'));var logger=require('../../config/logger')(_0x28ce('0x2'));var moment=require(_0x28ce('0x3'));var BPromise=require(_0x28ce('0x4'));var rp=require(_0x28ce('0x5'));var fs=require('fs');var path=require(_0x28ce('0x6'));var rimraf=require(_0x28ce('0x7'));var config=require('../../config/environment');var attributes=require(_0x28ce('0x8'));var integrations=require(_0x28ce('0x9'));module[_0x28ce('0xa')]=function(_0x1a8370,_0x1c6b69){return _0x1a8370['define']('SugarcrmAccount',attributes,{'tableName':_0x28ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a6d=['../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9a6d,0x10b));var _0xd9a6=function(_0x71b118,_0x14d1b8){_0x71b118=_0x71b118-0x0;var _0x508d8b=_0x9a6d[_0x71b118];return _0x508d8b;};'use strict';var _=require(_0xd9a6('0x0'));var util=require(_0xd9a6('0x1'));var logger=require('../../config/logger')(_0xd9a6('0x2'));var moment=require(_0xd9a6('0x3'));var BPromise=require(_0xd9a6('0x4'));var rp=require(_0xd9a6('0x5'));var fs=require('fs');var path=require(_0xd9a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd9a6('0x7'));var attributes=require(_0xd9a6('0x8'));var integrations=require(_0xd9a6('0x9'));module['exports']=function(_0x2326a3,_0x585700){return _0x2326a3[_0xd9a6('0xa')]('SugarcrmAccount',attributes,{'tableName':_0xd9a6('0xb'),'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 9909e48..87ba0f3 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 _0xfb4a=['error','message','request\x20sent','result','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x48c1e4,_0x3a4613){var _0x3e983d=function(_0x28491b){while(--_0x28491b){_0x48c1e4['push'](_0x48c1e4['shift']());}};_0x3e983d(++_0x3a4613);}(_0xfb4a,0x16f));var _0xafb4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xfb4a[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xafb4('0x0'));var util=require(_0xafb4('0x1'));var moment=require(_0xafb4('0x2'));var BPromise=require(_0xafb4('0x3'));var rs=require(_0xafb4('0x4'));var fs=require('fs');var Redis=require(_0xafb4('0x5'));var db=require(_0xafb4('0x6'))['db'];var utils=require(_0xafb4('0x7'));var logger=require(_0xafb4('0x8'))(_0xafb4('0x9'));var config=require('../../config/environment');var jayson=require(_0xafb4('0xa'));var client=jayson[_0xafb4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x97e6f3,_0x5c926b,_0x116411){return new BPromise(function(_0x486caa,_0x36c2f1){return client[_0xafb4('0xc')](_0x97e6f3,_0x116411)[_0xafb4('0xd')](function(_0x28bfb3){logger[_0xafb4('0xe')](_0xafb4('0xf'),_0x5c926b,'request\x20sent');logger[_0xafb4('0x10')](_0xafb4('0x11'),_0x5c926b,'request\x20sent',JSON['stringify'](_0x28bfb3));if(_0x28bfb3[_0xafb4('0x12')]){if(_0x28bfb3[_0xafb4('0x12')]['code']===0x1f4){logger[_0xafb4('0x12')](_0xafb4('0xf'),_0x5c926b,_0x28bfb3[_0xafb4('0x12')]['message']);return _0x36c2f1(_0x28bfb3['error'][_0xafb4('0x13')]);}logger[_0xafb4('0x12')](_0xafb4('0xf'),_0x5c926b,_0x28bfb3[_0xafb4('0x12')][_0xafb4('0x13')]);return _0x486caa(_0x28bfb3['error'][_0xafb4('0x13')]);}else{logger[_0xafb4('0xe')](_0xafb4('0xf'),_0x5c926b,_0xafb4('0x14'));_0x486caa(_0x28bfb3[_0xafb4('0x15')][_0xafb4('0x13')]);}})['catch'](function(_0x42fa75){logger[_0xafb4('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x5c926b,_0x42fa75);_0x36c2f1(_0x42fa75);});});}exports[_0xafb4('0x16')]=function(_0x22c6ac){var _0x4f761f=this;return new Promise(function(_0x5f32ee,_0x56b383){return db[_0xafb4('0x17')]['findAll']({'raw':_0x22c6ac[_0xafb4('0x18')]?_0x22c6ac[_0xafb4('0x18')][_0xafb4('0x19')]===undefined?!![]:![]:!![],'where':_0x22c6ac[_0xafb4('0x18')]?_0x22c6ac['options'][_0xafb4('0x1a')]||null:null,'attributes':_0x22c6ac[_0xafb4('0x18')]?_0x22c6ac['options'][_0xafb4('0x1b')]||null:null,'limit':_0x22c6ac[_0xafb4('0x18')]?_0x22c6ac[_0xafb4('0x18')][_0xafb4('0x1c')]||null:null,'include':_0x22c6ac[_0xafb4('0x18')]?_0x22c6ac[_0xafb4('0x18')][_0xafb4('0x1d')]?_[_0xafb4('0x1e')](_0x22c6ac[_0xafb4('0x18')][_0xafb4('0x1d')],function(_0x3ea8a5){return{'model':db[_0x3ea8a5['model']],'as':_0x3ea8a5['as'],'attributes':_0x3ea8a5[_0xafb4('0x1b')],'include':_0x3ea8a5[_0xafb4('0x1d')]?_['map'](_0x3ea8a5['include'],function(_0x5f1b4f){return{'model':db[_0x5f1b4f['model']],'as':_0x5f1b4f['as'],'attributes':_0x5f1b4f['attributes'],'include':_0x5f1b4f[_0xafb4('0x1d')]?_[_0xafb4('0x1e')](_0x5f1b4f[_0xafb4('0x1d')],function(_0x206827){return{'model':db[_0x206827[_0xafb4('0x1f')]],'as':_0x206827['as'],'attributes':_0x206827['attributes']};}):[]};}):[]};}):[]:[]})[_0xafb4('0xd')](function(_0x38c965){logger[_0xafb4('0xe')](_0xafb4('0x16'),_0x22c6ac);logger['debug'](_0xafb4('0x16'),_0x22c6ac,JSON['stringify'](_0x38c965));_0x5f32ee(_0x38c965);})['catch'](function(_0x37902a){logger[_0xafb4('0x12')](_0xafb4('0x16'),_0x37902a[_0xafb4('0x13')],_0x22c6ac);_0x56b383(_0x4f761f['error'](0x1f4,_0x37902a[_0xafb4('0x13')]));});});};exports[_0xafb4('0x20')]=function(_0x35382c){var _0x22a509=this;return new Promise(function(_0x106e19,_0x39c170){return db['SugarcrmAccount'][_0xafb4('0x21')]({'raw':_0x35382c['options']?_0x35382c[_0xafb4('0x18')][_0xafb4('0x19')]===undefined?!![]:![]:!![],'where':_0x35382c[_0xafb4('0x18')]?_0x35382c[_0xafb4('0x18')][_0xafb4('0x1a')]||null:null,'attributes':_0x35382c[_0xafb4('0x18')]?_0x35382c['options'][_0xafb4('0x1b')]||null:null,'include':_0x35382c[_0xafb4('0x18')]?_0x35382c[_0xafb4('0x18')]['include']?_[_0xafb4('0x1e')](_0x35382c[_0xafb4('0x18')][_0xafb4('0x1d')],function(_0x3bba9f){return{'model':db[_0x3bba9f[_0xafb4('0x1f')]],'as':_0x3bba9f['as'],'attributes':_0x3bba9f[_0xafb4('0x1b')],'include':_0x3bba9f[_0xafb4('0x1d')]?_[_0xafb4('0x1e')](_0x3bba9f[_0xafb4('0x1d')],function(_0x42ec44){return{'model':db[_0x42ec44[_0xafb4('0x1f')]],'as':_0x42ec44['as'],'attributes':_0x42ec44['attributes'],'include':_0x42ec44[_0xafb4('0x1d')]?_['map'](_0x42ec44['include'],function(_0x672aa0){return{'model':db[_0x672aa0['model']],'as':_0x672aa0['as'],'attributes':_0x672aa0[_0xafb4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xafb4('0xd')](function(_0x1bba66){logger[_0xafb4('0xe')](_0xafb4('0x20'),_0x35382c);logger[_0xafb4('0x10')]('ShowSugarcrmAccount',_0x35382c,JSON['stringify'](_0x1bba66));_0x106e19(_0x1bba66);})[_0xafb4('0x22')](function(_0x3dbb0c){logger['error'](_0xafb4('0x20'),_0x3dbb0c['message'],_0x35382c);_0x39c170(_0x22a509[_0xafb4('0x12')](0x1f4,_0x3dbb0c[_0xafb4('0x13')]));});});}; \ No newline at end of file +var _0x6132=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','model','map','info','find','raw','ShowSugarcrmAccount','lodash','util','moment','randomstring'];(function(_0x4e4e4a,_0x35ff69){var _0xe6e20=function(_0xf48e35){while(--_0xf48e35){_0x4e4e4a['push'](_0x4e4e4a['shift']());}};_0xe6e20(++_0x35ff69);}(_0x6132,0xf8));var _0x2613=function(_0x3097c6,_0x27b0cd){_0x3097c6=_0x3097c6-0x0;var _0x2af92b=_0x6132[_0x3097c6];return _0x2af92b;};'use strict';var _=require(_0x2613('0x0'));var util=require(_0x2613('0x1'));var moment=require(_0x2613('0x2'));var BPromise=require('bluebird');var rs=require(_0x2613('0x3'));var fs=require('fs');var Redis=require(_0x2613('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2613('0x5'));var logger=require(_0x2613('0x6'))(_0x2613('0x7'));var config=require(_0x2613('0x8'));var jayson=require(_0x2613('0x9'));var client=jayson[_0x2613('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a483,_0x1dde05,_0x24b3dd){return new BPromise(function(_0x23c967,_0x4a06e7){return client[_0x2613('0xb')](_0x34a483,_0x24b3dd)[_0x2613('0xc')](function(_0x3c6e75){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x1dde05,'request\x20sent');logger[_0x2613('0xd')](_0x2613('0xe'),_0x1dde05,_0x2613('0xf'),JSON[_0x2613('0x10')](_0x3c6e75));if(_0x3c6e75['error']){if(_0x3c6e75[_0x2613('0x11')][_0x2613('0x12')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1dde05,_0x3c6e75[_0x2613('0x11')][_0x2613('0x13')]);return _0x4a06e7(_0x3c6e75[_0x2613('0x11')]['message']);}logger[_0x2613('0x11')](_0x2613('0x14'),_0x1dde05,_0x3c6e75[_0x2613('0x11')][_0x2613('0x13')]);return _0x23c967(_0x3c6e75['error'][_0x2613('0x13')]);}else{logger['info'](_0x2613('0x14'),_0x1dde05,_0x2613('0xf'));_0x23c967(_0x3c6e75['result'][_0x2613('0x13')]);}})[_0x2613('0x15')](function(_0x29f3af){logger['error'](_0x2613('0x14'),_0x1dde05,_0x29f3af);_0x4a06e7(_0x29f3af);});});}exports[_0x2613('0x16')]=function(_0x5a04d3){var _0x2f3a16=this;return new Promise(function(_0x533d48,_0x109f77){return db[_0x2613('0x17')][_0x2613('0x18')]({'raw':_0x5a04d3[_0x2613('0x19')]?_0x5a04d3[_0x2613('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5a04d3['options']?_0x5a04d3[_0x2613('0x19')][_0x2613('0x1a')]||null:null,'attributes':_0x5a04d3['options']?_0x5a04d3['options'][_0x2613('0x1b')]||null:null,'limit':_0x5a04d3[_0x2613('0x19')]?_0x5a04d3[_0x2613('0x19')][_0x2613('0x1c')]||null:null,'include':_0x5a04d3[_0x2613('0x19')]?_0x5a04d3[_0x2613('0x19')][_0x2613('0x1d')]?_['map'](_0x5a04d3[_0x2613('0x19')][_0x2613('0x1d')],function(_0x26a541){return{'model':db[_0x26a541[_0x2613('0x1e')]],'as':_0x26a541['as'],'attributes':_0x26a541[_0x2613('0x1b')],'include':_0x26a541['include']?_[_0x2613('0x1f')](_0x26a541['include'],function(_0x26f530){return{'model':db[_0x26f530['model']],'as':_0x26f530['as'],'attributes':_0x26f530[_0x2613('0x1b')],'include':_0x26f530[_0x2613('0x1d')]?_['map'](_0x26f530[_0x2613('0x1d')],function(_0x2f12e3){return{'model':db[_0x2f12e3[_0x2613('0x1e')]],'as':_0x2f12e3['as'],'attributes':_0x2f12e3[_0x2613('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2613('0xc')](function(_0x863c65){logger[_0x2613('0x20')](_0x2613('0x16'),_0x5a04d3);logger[_0x2613('0xd')](_0x2613('0x16'),_0x5a04d3,JSON[_0x2613('0x10')](_0x863c65));_0x533d48(_0x863c65);})[_0x2613('0x15')](function(_0x32de65){logger[_0x2613('0x11')](_0x2613('0x16'),_0x32de65['message'],_0x5a04d3);_0x109f77(_0x2f3a16['error'](0x1f4,_0x32de65['message']));});});};exports['ShowSugarcrmAccount']=function(_0x12a335){var _0x5a84af=this;return new Promise(function(_0x3cdc98,_0x5bbad6){return db[_0x2613('0x17')][_0x2613('0x21')]({'raw':_0x12a335[_0x2613('0x19')]?_0x12a335['options'][_0x2613('0x22')]===undefined?!![]:![]:!![],'where':_0x12a335[_0x2613('0x19')]?_0x12a335[_0x2613('0x19')][_0x2613('0x1a')]||null:null,'attributes':_0x12a335[_0x2613('0x19')]?_0x12a335[_0x2613('0x19')][_0x2613('0x1b')]||null:null,'include':_0x12a335[_0x2613('0x19')]?_0x12a335[_0x2613('0x19')][_0x2613('0x1d')]?_[_0x2613('0x1f')](_0x12a335[_0x2613('0x19')]['include'],function(_0x53ad25){return{'model':db[_0x53ad25[_0x2613('0x1e')]],'as':_0x53ad25['as'],'attributes':_0x53ad25[_0x2613('0x1b')],'include':_0x53ad25[_0x2613('0x1d')]?_[_0x2613('0x1f')](_0x53ad25[_0x2613('0x1d')],function(_0x534917){return{'model':db[_0x534917['model']],'as':_0x534917['as'],'attributes':_0x534917['attributes'],'include':_0x534917['include']?_[_0x2613('0x1f')](_0x534917[_0x2613('0x1d')],function(_0x31c7f4){return{'model':db[_0x31c7f4['model']],'as':_0x31c7f4['as'],'attributes':_0x31c7f4['attributes']};}):[]};}):[]};}):[]:[]})[_0x2613('0xc')](function(_0x471ae2){logger['info'](_0x2613('0x23'),_0x12a335);logger[_0x2613('0xd')](_0x2613('0x23'),_0x12a335,JSON[_0x2613('0x10')](_0x471ae2));_0x3cdc98(_0x471ae2);})[_0x2613('0x15')](function(_0x2e8958){logger[_0x2613('0x11')](_0x2613('0x23'),_0x2e8958[_0x2613('0x13')],_0x12a335);_0x5bbad6(_0x5a84af[_0x2613('0x11')](0x1f4,_0x2e8958[_0x2613('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 3716925..f2cede8 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 _0x44ec=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id','/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x44ec,0xd0));var _0xc44e=function(_0x514c5e,_0x8c0875){_0x514c5e=_0x514c5e-0x0;var _0x34c3e6=_0x44ec[_0x514c5e];return _0x34c3e6;};'use strict';var multer=require(_0xc44e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc44e('0x1'));var express=require(_0xc44e('0x2'));var router=express[_0xc44e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc44e('0x4'));var interaction=require(_0xc44e('0x5'));var config=require(_0xc44e('0x6'));var controller=require(_0xc44e('0x7'));router[_0xc44e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc44e('0x8')](_0xc44e('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc44e('0xa'),auth[_0xc44e('0xb')](),controller[_0xc44e('0xc')]);router['get']('/:id/subjects',auth[_0xc44e('0xb')](),controller[_0xc44e('0xd')]);router[_0xc44e('0x8')](_0xc44e('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xc44e('0xf')]('/',auth[_0xc44e('0xb')](),controller['create']);router[_0xc44e('0x10')](_0xc44e('0x9'),auth[_0xc44e('0xb')](),controller[_0xc44e('0x11')]);router[_0xc44e('0x12')]('/:id',auth[_0xc44e('0xb')](),controller[_0xc44e('0x13')]);module[_0xc44e('0x14')]=router; \ No newline at end of file +var _0xa130=['connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','show','getFields','/:id/subjects','/:id/descriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x4a30bb,_0x30ddfa){var _0x3b0a8f=function(_0x34fc2f){while(--_0x34fc2f){_0x4a30bb['push'](_0x4a30bb['shift']());}};_0x3b0a8f(++_0x30ddfa);}(_0xa130,0x1cb));var _0x0a13=function(_0x3ff361,_0x738b8d){_0x3ff361=_0x3ff361-0x0;var _0x23090e=_0xa130[_0x3ff361];return _0x23090e;};'use strict';var multer=require(_0x0a13('0x0'));var util=require(_0x0a13('0x1'));var path=require(_0x0a13('0x2'));var timeout=require(_0x0a13('0x3'));var express=require(_0x0a13('0x4'));var router=express[_0x0a13('0x5')]();var fs_extra=require(_0x0a13('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x0a13('0x7')]('/',auth[_0x0a13('0x8')](),controller[_0x0a13('0x9')]);router['get']('/:id',auth[_0x0a13('0x8')](),controller[_0x0a13('0xa')]);router['get']('/:id/fields',auth[_0x0a13('0x8')](),controller[_0x0a13('0xb')]);router[_0x0a13('0x7')](_0x0a13('0xc'),auth[_0x0a13('0x8')](),controller['getSubjects']);router[_0x0a13('0x7')](_0x0a13('0xd'),auth[_0x0a13('0x8')](),controller['getDescriptions']);router[_0x0a13('0xe')]('/',auth[_0x0a13('0x8')](),controller[_0x0a13('0xf')]);router[_0x0a13('0x10')](_0x0a13('0x11'),auth[_0x0a13('0x8')](),controller[_0x0a13('0x12')]);router[_0x0a13('0x13')](_0x0a13('0x11'),auth[_0x0a13('0x8')](),controller[_0x0a13('0x14')]);module[_0x0a13('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 1cb7430..83854d9 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 _0x904f=['exports','sequelize'];(function(_0x13b7fd,_0x4eaf7f){var _0x32a74a=function(_0x2c5d80){while(--_0x2c5d80){_0x13b7fd['push'](_0x13b7fd['shift']());}};_0x32a74a(++_0x4eaf7f);}(_0x904f,0x127));var _0xf904=function(_0x52b1e5,_0x6835f0){_0x52b1e5=_0x52b1e5-0x0;var _0x281da8=_0x904f[_0x52b1e5];return _0x281da8;};'use strict';var Sequelize=require(_0xf904('0x0'));module[_0xf904('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe04a=['exports','STRING','sequelize'];(function(_0x3a35a3,_0x5481a2){var _0x3824e6=function(_0x3513d9){while(--_0x3513d9){_0x3a35a3['push'](_0x3a35a3['shift']());}};_0x3824e6(++_0x5481a2);}(_0xe04a,0x17f));var _0xae04=function(_0x312b38,_0x1cfe9f){_0x312b38=_0x312b38-0x0;var _0x8d8abb=_0xe04a[_0x312b38];return _0x8d8abb;};'use strict';var Sequelize=require(_0xae04('0x0'));module[_0xae04('0x1')]={'name':{'type':Sequelize[_0xae04('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 2d28b13..1aa49e5 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 _0x4235=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','type','filter','merge','SugarcrmConfiguration','includeAll','findAll','rows','catch','options','find','create','body','update','params','findOne','SugarcrmField','rawAttributes','order','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x17e174,_0x4991f8){var _0x3f26f1=function(_0x169012){while(--_0x169012){_0x17e174['push'](_0x17e174['shift']());}};_0x3f26f1(++_0x4991f8);}(_0x4235,0xdf));var _0x5423=function(_0x9b14ee,_0x574340){_0x9b14ee=_0x9b14ee-0x0;var _0xc3fa3c=_0x4235[_0x9b14ee];return _0xc3fa3c;};'use strict';var emlformat=require(_0x5423('0x0'));var rimraf=require(_0x5423('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5423('0x2'));var rp=require(_0x5423('0x3'));var moment=require(_0x5423('0x4'));var BPromise=require(_0x5423('0x5'));var Mustache=require(_0x5423('0x6'));var util=require('util');var path=require(_0x5423('0x7'));var sox=require('sox');var csv=require(_0x5423('0x8'));var ejs=require(_0x5423('0x9'));var fs=require('fs');var fs_extra=require(_0x5423('0xa'));var _=require(_0x5423('0xb'));var squel=require(_0x5423('0xc'));var crypto=require(_0x5423('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5423('0xe'));var toCsv=require(_0x5423('0x8'));var querystring=require(_0x5423('0xf'));var Papa=require(_0x5423('0x10'));var Redis=require(_0x5423('0x11'));var authService=require(_0x5423('0x12'));var qs=require(_0x5423('0x13'));var as=require(_0x5423('0x14'));var hardwareService=require(_0x5423('0x15'));var logger=require('../../config/logger')(_0x5423('0x16'));var utils=require(_0x5423('0x17'));var config=require(_0x5423('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5423('0x19'))['db'];function respondWithStatusCode(_0x3b0537,_0x33eef2){_0x33eef2=_0x33eef2||0xcc;return function(_0xf021d9){if(_0xf021d9){return _0x3b0537[_0x5423('0x1a')](_0x33eef2);}return _0x3b0537[_0x5423('0x1b')](_0x33eef2)[_0x5423('0x1c')]();};}function respondWithResult(_0x1be534,_0x3beda7){_0x3beda7=_0x3beda7||0xc8;return function(_0x1365ab){if(_0x1365ab){return _0x1be534['status'](_0x3beda7)[_0x5423('0x1d')](_0x1365ab);}};}function respondWithFilteredResult(_0x404bc2,_0x294e87){return function(_0x4e3c3e){if(_0x4e3c3e){var _0xc36c27=typeof _0x294e87[_0x5423('0x1e')]===_0x5423('0x1f')&&typeof _0x294e87['limit']===_0x5423('0x1f');var _0x5957fe=_0x4e3c3e['count'];var _0x233c1c=_0xc36c27?0x0:_0x294e87[_0x5423('0x1e')];var _0x320376=_0xc36c27?_0x4e3c3e[_0x5423('0x20')]:_0x294e87[_0x5423('0x1e')]+_0x294e87[_0x5423('0x21')];var _0xb7ca81;if(_0x320376>=_0x5957fe){_0x320376=_0x5957fe;_0xb7ca81=0xc8;}else{_0xb7ca81=0xce;}_0x404bc2[_0x5423('0x1b')](_0xb7ca81);return _0x404bc2[_0x5423('0x22')](_0x5423('0x23'),_0x233c1c+'-'+_0x320376+'/'+_0x5957fe)[_0x5423('0x1d')](_0x4e3c3e);}return null;};}function patchUpdates(_0x57de45){return function(_0x26e278){try{jsonpatch[_0x5423('0x24')](_0x26e278,_0x57de45,!![]);}catch(_0x12df1e){return BPromise[_0x5423('0x25')](_0x12df1e);}return _0x26e278[_0x5423('0x26')]();};}function saveUpdates(_0x412b2b,_0x17bf19){return function(_0x21cdea){if(_0x21cdea){return _0x21cdea['update'](_0x412b2b)[_0x5423('0x27')](function(_0x3747b9){return _0x3747b9;});}return null;};}function removeEntity(_0x465ddd,_0x38ae43){return function(_0x245528){if(_0x245528){return _0x245528[_0x5423('0x28')]()[_0x5423('0x27')](function(){_0x465ddd['status'](0xcc)[_0x5423('0x1c')]();});}};}function handleEntityNotFound(_0x143b72,_0x166a15){return function(_0x3824bc){if(!_0x3824bc){_0x143b72[_0x5423('0x1a')](0x194);}return _0x3824bc;};}function handleError(_0x3da519,_0xef596d){_0xef596d=_0xef596d||0x1f4;return function(_0x5ddc4e){logger[_0x5423('0x29')](_0x5ddc4e[_0x5423('0x2a')]);if(_0x5ddc4e[_0x5423('0x2b')]){delete _0x5ddc4e['name'];}_0x3da519['status'](_0xef596d)['send'](_0x5ddc4e);};}exports[_0x5423('0x2c')]=function(_0x395228,_0xdc7a87){var _0x2513e2={},_0x3de37a={},_0x13a2db={'count':0x0,'rows':[]};var _0x51b348=_[_0x5423('0x2d')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x2bd689){return{'name':_0x2bd689[_0x5423('0x2e')],'type':_0x2bd689['type'][_0x5423('0x2f')]};});_0x3de37a['model']=_[_0x5423('0x2d')](_0x51b348,_0x5423('0x2b'));_0x3de37a[_0x5423('0x30')]=_[_0x5423('0x31')](_0x395228[_0x5423('0x30')]);_0x3de37a['filters']=_[_0x5423('0x32')](_0x3de37a[_0x5423('0x33')],_0x3de37a['query']);_0x2513e2[_0x5423('0x34')]=_[_0x5423('0x32')](_0x3de37a[_0x5423('0x33')],qs[_0x5423('0x35')](_0x395228[_0x5423('0x30')][_0x5423('0x35')]));_0x2513e2['attributes']=_0x2513e2['attributes'][_0x5423('0x36')]?_0x2513e2[_0x5423('0x34')]:_0x3de37a[_0x5423('0x33')];if(!_0x395228[_0x5423('0x30')][_0x5423('0x37')]('nolimit')){_0x2513e2[_0x5423('0x21')]=qs[_0x5423('0x21')](_0x395228[_0x5423('0x30')][_0x5423('0x21')]);_0x2513e2['offset']=qs[_0x5423('0x1e')](_0x395228[_0x5423('0x30')]['offset']);}_0x2513e2['order']=qs[_0x5423('0x38')](_0x395228[_0x5423('0x30')]['sort']);_0x2513e2[_0x5423('0x39')]=qs[_0x5423('0x3a')](_[_0x5423('0x3b')](_0x395228['query'],_0x3de37a['filters']),_0x51b348);if(_0x395228[_0x5423('0x30')]['filter']){_0x2513e2['where']=_['merge'](_0x2513e2['where'],{'$or':_[_0x5423('0x2d')](_0x51b348,function(_0x1743ad){if(_0x1743ad[_0x5423('0x3c')]!=='VIRTUAL'){var _0x5efa03={};_0x5efa03[_0x1743ad[_0x5423('0x2b')]]={'$like':'%'+_0x395228['query'][_0x5423('0x3d')]+'%'};return _0x5efa03;}})});}_0x2513e2=_[_0x5423('0x3e')]({},_0x2513e2,_0x395228['options']);var _0x311d8a={'where':_0x2513e2[_0x5423('0x39')]};return db[_0x5423('0x3f')][_0x5423('0x20')](_0x311d8a)[_0x5423('0x27')](function(_0x23ddd9){_0x13a2db[_0x5423('0x20')]=_0x23ddd9;if(_0x395228[_0x5423('0x30')][_0x5423('0x40')]){_0x2513e2['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x5423('0x41')](_0x2513e2);})['then'](function(_0x3960ea){_0x13a2db[_0x5423('0x42')]=_0x3960ea;return _0x13a2db;})[_0x5423('0x27')](respondWithFilteredResult(_0xdc7a87,_0x2513e2))[_0x5423('0x43')](handleError(_0xdc7a87,null));};exports['show']=function(_0x7e11b0,_0x5c1712){var _0x9069d9={'raw':![],'where':{'id':_0x7e11b0['params']['id']}},_0x2d576b={};_0x2d576b[_0x5423('0x33')]=_[_0x5423('0x31')](db[_0x5423('0x3f')]['rawAttributes']);_0x2d576b[_0x5423('0x30')]=_[_0x5423('0x31')](_0x7e11b0[_0x5423('0x30')]);_0x2d576b[_0x5423('0x3a')]=_[_0x5423('0x32')](_0x2d576b['model'],_0x2d576b[_0x5423('0x30')]);_0x9069d9['attributes']=_[_0x5423('0x32')](_0x2d576b[_0x5423('0x33')],qs[_0x5423('0x35')](_0x7e11b0[_0x5423('0x30')][_0x5423('0x35')]));_0x9069d9[_0x5423('0x34')]=_0x9069d9[_0x5423('0x34')][_0x5423('0x36')]?_0x9069d9['attributes']:_0x2d576b[_0x5423('0x33')];if(_0x7e11b0[_0x5423('0x30')][_0x5423('0x40')]){_0x9069d9['include']=[{'all':!![]}];}_0x9069d9=_[_0x5423('0x3e')]({},_0x9069d9,_0x7e11b0[_0x5423('0x44')]);return db['SugarcrmConfiguration'][_0x5423('0x45')](_0x9069d9)[_0x5423('0x27')](handleEntityNotFound(_0x5c1712,null))[_0x5423('0x27')](respondWithResult(_0x5c1712,null))['catch'](handleError(_0x5c1712,null));};exports[_0x5423('0x46')]=function(_0x2e547b,_0x177fcb){return db['SugarcrmConfiguration']['create'](_0x2e547b[_0x5423('0x47')],{})['then'](respondWithResult(_0x177fcb,0xc9))['catch'](handleError(_0x177fcb,null));};exports[_0x5423('0x48')]=function(_0x3cb778,_0x3d1882){if(_0x3cb778[_0x5423('0x47')]['id']){delete _0x3cb778[_0x5423('0x47')]['id'];}return db[_0x5423('0x3f')][_0x5423('0x45')]({'where':{'id':_0x3cb778[_0x5423('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d1882,null))[_0x5423('0x27')](saveUpdates(_0x3cb778[_0x5423('0x47')],null))[_0x5423('0x27')](respondWithResult(_0x3d1882,null))[_0x5423('0x43')](handleError(_0x3d1882,null));};exports[_0x5423('0x28')]=function(_0x3648d7,_0x42502d){return db[_0x5423('0x3f')][_0x5423('0x45')]({'where':{'id':_0x3648d7[_0x5423('0x49')]['id']}})[_0x5423('0x27')](handleEntityNotFound(_0x42502d,null))[_0x5423('0x27')](removeEntity(_0x42502d,null))[_0x5423('0x43')](handleError(_0x42502d,null));};exports['getFields']=function(_0x1b5231,_0x4cf640,_0x1dbd6a){var _0x2bf14e={};var _0x233387={};var _0x44b9ec;var _0x27152c;return db[_0x5423('0x3f')][_0x5423('0x4a')]({'where':{'id':_0x1b5231[_0x5423('0x49')]['id']}})[_0x5423('0x27')](handleEntityNotFound(_0x4cf640,null))[_0x5423('0x27')](function(_0x1e2968){if(_0x1e2968){_0x44b9ec=_0x1e2968;_0x233387[_0x5423('0x33')]=_['keys'](db[_0x5423('0x4b')][_0x5423('0x4c')]);_0x233387[_0x5423('0x30')]=_[_0x5423('0x31')](_0x1b5231['query']);_0x233387[_0x5423('0x3a')]=_[_0x5423('0x32')](_0x233387[_0x5423('0x33')],_0x233387['query']);_0x2bf14e[_0x5423('0x34')]=_['intersection'](_0x233387['model'],qs[_0x5423('0x35')](_0x1b5231[_0x5423('0x30')]['fields']));_0x2bf14e['attributes']=_0x2bf14e[_0x5423('0x34')][_0x5423('0x36')]?_0x2bf14e[_0x5423('0x34')]:_0x233387[_0x5423('0x33')];_0x2bf14e[_0x5423('0x4d')]=qs[_0x5423('0x38')](_0x1b5231['query'][_0x5423('0x38')]);_0x2bf14e[_0x5423('0x39')]=qs[_0x5423('0x3a')](_[_0x5423('0x3b')](_0x1b5231['query'],_0x233387[_0x5423('0x3a')]));if(_0x1b5231[_0x5423('0x30')]['filter']){_0x2bf14e[_0x5423('0x39')]=_[_0x5423('0x3e')](_0x2bf14e[_0x5423('0x39')],{'$or':_[_0x5423('0x2d')](_0x2bf14e[_0x5423('0x34')],function(_0xbf4484){var _0x25f071={};_0x25f071[_0xbf4484]={'$like':'%'+_0x1b5231[_0x5423('0x30')][_0x5423('0x3d')]+'%'};return _0x25f071;})});}_0x2bf14e=_[_0x5423('0x3e')]({},_0x2bf14e,_0x1b5231[_0x5423('0x44')]);return _0x44b9ec[_0x5423('0x4e')](_0x2bf14e);}})[_0x5423('0x27')](function(_0x30019c){if(_0x30019c){_0x27152c=_0x30019c[_0x5423('0x36')];if(!_0x1b5231[_0x5423('0x30')][_0x5423('0x37')](_0x5423('0x4f'))){_0x2bf14e[_0x5423('0x21')]=qs[_0x5423('0x21')](_0x1b5231['query'][_0x5423('0x21')]);_0x2bf14e[_0x5423('0x1e')]=qs[_0x5423('0x1e')](_0x1b5231[_0x5423('0x30')]['offset']);}return _0x44b9ec[_0x5423('0x4e')](_0x2bf14e);}})[_0x5423('0x27')](function(_0x39e2c6){if(_0x39e2c6){return _0x39e2c6?{'count':_0x27152c,'rows':_0x39e2c6}:null;}})[_0x5423('0x27')](respondWithResult(_0x4cf640,null))['catch'](handleError(_0x4cf640,null));};exports['getSubjects']=function(_0x13f68e,_0x449d77,_0x3d385e){var _0x39553b={};var _0xfc082f={};var _0x112643;var _0x293727;return db[_0x5423('0x3f')][_0x5423('0x4a')]({'where':{'id':_0x13f68e['params']['id']}})[_0x5423('0x27')](handleEntityNotFound(_0x449d77,null))['then'](function(_0x29cd95){if(_0x29cd95){_0x112643=_0x29cd95;_0xfc082f['model']=_[_0x5423('0x31')](db[_0x5423('0x4b')]['rawAttributes']);_0xfc082f['query']=_[_0x5423('0x31')](_0x13f68e[_0x5423('0x30')]);_0xfc082f[_0x5423('0x3a')]=_[_0x5423('0x32')](_0xfc082f[_0x5423('0x33')],_0xfc082f[_0x5423('0x30')]);_0x39553b['attributes']=_[_0x5423('0x32')](_0xfc082f[_0x5423('0x33')],qs['fields'](_0x13f68e[_0x5423('0x30')][_0x5423('0x35')]));_0x39553b[_0x5423('0x34')]=_0x39553b[_0x5423('0x34')][_0x5423('0x36')]?_0x39553b[_0x5423('0x34')]:_0xfc082f['model'];_0x39553b['order']=qs[_0x5423('0x38')](_0x13f68e[_0x5423('0x30')]['sort']);_0x39553b['where']=qs[_0x5423('0x3a')](_[_0x5423('0x3b')](_0x13f68e['query'],_0xfc082f['filters']));if(_0x13f68e[_0x5423('0x30')][_0x5423('0x3d')]){_0x39553b['where']=_[_0x5423('0x3e')](_0x39553b['where'],{'$or':_[_0x5423('0x2d')](_0x39553b['attributes'],function(_0x197751){var _0x21ce28={};_0x21ce28[_0x197751]={'$like':'%'+_0x13f68e[_0x5423('0x30')][_0x5423('0x3d')]+'%'};return _0x21ce28;})});}_0x39553b=_[_0x5423('0x3e')]({},_0x39553b,_0x13f68e[_0x5423('0x44')]);return _0x112643[_0x5423('0x50')](_0x39553b);}})['then'](function(_0x1be1e2){if(_0x1be1e2){_0x293727=_0x1be1e2[_0x5423('0x36')];if(!_0x13f68e['query'][_0x5423('0x37')](_0x5423('0x4f'))){_0x39553b[_0x5423('0x21')]=qs['limit'](_0x13f68e[_0x5423('0x30')][_0x5423('0x21')]);_0x39553b[_0x5423('0x1e')]=qs[_0x5423('0x1e')](_0x13f68e['query'][_0x5423('0x1e')]);}return _0x112643[_0x5423('0x50')](_0x39553b);}})[_0x5423('0x27')](function(_0x117398){if(_0x117398){return _0x117398?{'count':_0x293727,'rows':_0x117398}:null;}})[_0x5423('0x27')](respondWithResult(_0x449d77,null))[_0x5423('0x43')](handleError(_0x449d77,null));};exports[_0x5423('0x51')]=function(_0x1480dd,_0x4524ca,_0x1a03e1){var _0x2b9568={};var _0x197072={};var _0x58f6eb;var _0x3e8289;return db['SugarcrmConfiguration'][_0x5423('0x4a')]({'where':{'id':_0x1480dd[_0x5423('0x49')]['id']}})[_0x5423('0x27')](handleEntityNotFound(_0x4524ca,null))['then'](function(_0x59e262){if(_0x59e262){_0x58f6eb=_0x59e262;_0x197072['model']=_['keys'](db[_0x5423('0x4b')][_0x5423('0x4c')]);_0x197072[_0x5423('0x30')]=_[_0x5423('0x31')](_0x1480dd['query']);_0x197072[_0x5423('0x3a')]=_[_0x5423('0x32')](_0x197072[_0x5423('0x33')],_0x197072[_0x5423('0x30')]);_0x2b9568['attributes']=_['intersection'](_0x197072[_0x5423('0x33')],qs[_0x5423('0x35')](_0x1480dd['query'][_0x5423('0x35')]));_0x2b9568[_0x5423('0x34')]=_0x2b9568[_0x5423('0x34')][_0x5423('0x36')]?_0x2b9568['attributes']:_0x197072[_0x5423('0x33')];_0x2b9568[_0x5423('0x4d')]=qs['sort'](_0x1480dd['query'][_0x5423('0x38')]);_0x2b9568[_0x5423('0x39')]=qs[_0x5423('0x3a')](_['pick'](_0x1480dd['query'],_0x197072['filters']));if(_0x1480dd[_0x5423('0x30')]['filter']){_0x2b9568[_0x5423('0x39')]=_[_0x5423('0x3e')](_0x2b9568[_0x5423('0x39')],{'$or':_[_0x5423('0x2d')](_0x2b9568['attributes'],function(_0x3215f2){var _0x1d1b77={};_0x1d1b77[_0x3215f2]={'$like':'%'+_0x1480dd[_0x5423('0x30')][_0x5423('0x3d')]+'%'};return _0x1d1b77;})});}_0x2b9568=_[_0x5423('0x3e')]({},_0x2b9568,_0x1480dd[_0x5423('0x44')]);return _0x58f6eb['getDescriptions'](_0x2b9568);}})[_0x5423('0x27')](function(_0x2c9b25){if(_0x2c9b25){_0x3e8289=_0x2c9b25[_0x5423('0x36')];if(!_0x1480dd[_0x5423('0x30')][_0x5423('0x37')](_0x5423('0x4f'))){_0x2b9568[_0x5423('0x21')]=qs['limit'](_0x1480dd[_0x5423('0x30')][_0x5423('0x21')]);_0x2b9568[_0x5423('0x1e')]=qs[_0x5423('0x1e')](_0x1480dd[_0x5423('0x30')][_0x5423('0x1e')]);}return _0x58f6eb[_0x5423('0x51')](_0x2b9568);}})['then'](function(_0x81348d){if(_0x81348d){return _0x81348d?{'count':_0x3e8289,'rows':_0x81348d}:null;}})[_0x5423('0x27')](respondWithResult(_0x4524ca,null))[_0x5423('0x43')](handleError(_0x4524ca,null));}; \ No newline at end of file +var _0xe31e=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','save','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','SugarcrmConfiguration','then','includeAll','include','findAll','rows','catch','show','keys','intersection','options','find','create','body','update','params','getFields','SugarcrmField','order','nolimit','getSubjects','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0xe31e,0x1ce));var _0xee31=function(_0x1d5319,_0x359423){_0x1d5319=_0x1d5319-0x0;var _0x1e7028=_0xe31e[_0x1d5319];return _0x1e7028;};'use strict';var emlformat=require(_0xee31('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee31('0x1'));var jsonpatch=require(_0xee31('0x2'));var rp=require(_0xee31('0x3'));var moment=require(_0xee31('0x4'));var BPromise=require(_0xee31('0x5'));var Mustache=require(_0xee31('0x6'));var util=require(_0xee31('0x7'));var path=require(_0xee31('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee31('0x9'));var fs=require('fs');var fs_extra=require(_0xee31('0xa'));var _=require(_0xee31('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xee31('0xc'));var toCsv=require(_0xee31('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xee31('0xe'));var authService=require(_0xee31('0xf'));var qs=require(_0xee31('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee31('0x11'));var logger=require(_0xee31('0x12'))(_0xee31('0x13'));var utils=require(_0xee31('0x14'));var config=require(_0xee31('0x15'));var licenseUtil=require(_0xee31('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a87e4,_0x1c3036){_0x1c3036=_0x1c3036||0xcc;return function(_0x39088a){if(_0x39088a){return _0x4a87e4[_0xee31('0x17')](_0x1c3036);}return _0x4a87e4['status'](_0x1c3036)[_0xee31('0x18')]();};}function respondWithResult(_0xea25e2,_0x26caf4){_0x26caf4=_0x26caf4||0xc8;return function(_0x1ad957){if(_0x1ad957){return _0xea25e2[_0xee31('0x19')](_0x26caf4)[_0xee31('0x1a')](_0x1ad957);}};}function respondWithFilteredResult(_0x1c73b7,_0x25dd0a){return function(_0x15a736){if(_0x15a736){var _0x2be76a=typeof _0x25dd0a[_0xee31('0x1b')]===_0xee31('0x1c')&&typeof _0x25dd0a['limit']===_0xee31('0x1c');var _0x59e833=_0x15a736['count'];var _0x26ec64=_0x2be76a?0x0:_0x25dd0a[_0xee31('0x1b')];var _0x57d839=_0x2be76a?_0x15a736[_0xee31('0x1d')]:_0x25dd0a[_0xee31('0x1b')]+_0x25dd0a['limit'];var _0x5daa8d;if(_0x57d839>=_0x59e833){_0x57d839=_0x59e833;_0x5daa8d=0xc8;}else{_0x5daa8d=0xce;}_0x1c73b7[_0xee31('0x19')](_0x5daa8d);return _0x1c73b7['set'](_0xee31('0x1e'),_0x26ec64+'-'+_0x57d839+'/'+_0x59e833)['json'](_0x15a736);}return null;};}function patchUpdates(_0x3837bb){return function(_0x37941f){try{jsonpatch['apply'](_0x37941f,_0x3837bb,!![]);}catch(_0x3ca646){return BPromise[_0xee31('0x1f')](_0x3ca646);}return _0x37941f[_0xee31('0x20')]();};}function saveUpdates(_0x3e9c93,_0x4141d3){return function(_0x5e635f){if(_0x5e635f){return _0x5e635f['update'](_0x3e9c93)['then'](function(_0x30513a){return _0x30513a;});}return null;};}function removeEntity(_0x24d5b9,_0x1d1382){return function(_0x356ef5){if(_0x356ef5){return _0x356ef5[_0xee31('0x21')]()['then'](function(){_0x24d5b9[_0xee31('0x19')](0xcc)[_0xee31('0x18')]();});}};}function handleEntityNotFound(_0x55f909,_0x5bf0e8){return function(_0x500e16){if(!_0x500e16){_0x55f909[_0xee31('0x17')](0x194);}return _0x500e16;};}function handleError(_0x2f5939,_0x150947){_0x150947=_0x150947||0x1f4;return function(_0x24589a){logger[_0xee31('0x22')](_0x24589a[_0xee31('0x23')]);if(_0x24589a[_0xee31('0x24')]){delete _0x24589a[_0xee31('0x24')];}_0x2f5939['status'](_0x150947)[_0xee31('0x25')](_0x24589a);};}exports['index']=function(_0x587e14,_0x3a1f63){var _0x50a1b1={},_0x4efecf={},_0x54c3d7={'count':0x0,'rows':[]};var _0x351f37=_[_0xee31('0x26')](db['SugarcrmConfiguration'][_0xee31('0x27')],function(_0x51cf5f){return{'name':_0x51cf5f[_0xee31('0x28')],'type':_0x51cf5f[_0xee31('0x29')][_0xee31('0x2a')]};});_0x4efecf['model']=_[_0xee31('0x26')](_0x351f37,_0xee31('0x24'));_0x4efecf[_0xee31('0x2b')]=_['keys'](_0x587e14[_0xee31('0x2b')]);_0x4efecf[_0xee31('0x2c')]=_['intersection'](_0x4efecf[_0xee31('0x2d')],_0x4efecf[_0xee31('0x2b')]);_0x50a1b1[_0xee31('0x2e')]=_['intersection'](_0x4efecf[_0xee31('0x2d')],qs[_0xee31('0x2f')](_0x587e14[_0xee31('0x2b')][_0xee31('0x2f')]));_0x50a1b1[_0xee31('0x2e')]=_0x50a1b1[_0xee31('0x2e')][_0xee31('0x30')]?_0x50a1b1['attributes']:_0x4efecf[_0xee31('0x2d')];if(!_0x587e14[_0xee31('0x2b')][_0xee31('0x31')]('nolimit')){_0x50a1b1[_0xee31('0x32')]=qs[_0xee31('0x32')](_0x587e14[_0xee31('0x2b')][_0xee31('0x32')]);_0x50a1b1[_0xee31('0x1b')]=qs['offset'](_0x587e14[_0xee31('0x2b')][_0xee31('0x1b')]);}_0x50a1b1['order']=qs[_0xee31('0x33')](_0x587e14[_0xee31('0x2b')][_0xee31('0x33')]);_0x50a1b1[_0xee31('0x34')]=qs[_0xee31('0x2c')](_[_0xee31('0x35')](_0x587e14[_0xee31('0x2b')],_0x4efecf[_0xee31('0x2c')]),_0x351f37);if(_0x587e14[_0xee31('0x2b')][_0xee31('0x36')]){_0x50a1b1['where']=_[_0xee31('0x37')](_0x50a1b1[_0xee31('0x34')],{'$or':_[_0xee31('0x26')](_0x351f37,function(_0xea6563){if(_0xea6563['type']!==_0xee31('0x38')){var _0x428e52={};_0x428e52[_0xea6563[_0xee31('0x24')]]={'$like':'%'+_0x587e14[_0xee31('0x2b')][_0xee31('0x36')]+'%'};return _0x428e52;}})});}_0x50a1b1=_[_0xee31('0x37')]({},_0x50a1b1,_0x587e14['options']);var _0x3b032f={'where':_0x50a1b1['where']};return db[_0xee31('0x39')][_0xee31('0x1d')](_0x3b032f)[_0xee31('0x3a')](function(_0x455c5e){_0x54c3d7[_0xee31('0x1d')]=_0x455c5e;if(_0x587e14[_0xee31('0x2b')][_0xee31('0x3b')]){_0x50a1b1[_0xee31('0x3c')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xee31('0x3d')](_0x50a1b1);})[_0xee31('0x3a')](function(_0x141985){_0x54c3d7[_0xee31('0x3e')]=_0x141985;return _0x54c3d7;})['then'](respondWithFilteredResult(_0x3a1f63,_0x50a1b1))[_0xee31('0x3f')](handleError(_0x3a1f63,null));};exports[_0xee31('0x40')]=function(_0x5a7ae1,_0x560a6b){var _0x5f38ca={'raw':![],'where':{'id':_0x5a7ae1['params']['id']}},_0x26a971={};_0x26a971[_0xee31('0x2d')]=_[_0xee31('0x41')](db[_0xee31('0x39')][_0xee31('0x27')]);_0x26a971['query']=_[_0xee31('0x41')](_0x5a7ae1[_0xee31('0x2b')]);_0x26a971[_0xee31('0x2c')]=_[_0xee31('0x42')](_0x26a971[_0xee31('0x2d')],_0x26a971[_0xee31('0x2b')]);_0x5f38ca[_0xee31('0x2e')]=_[_0xee31('0x42')](_0x26a971['model'],qs[_0xee31('0x2f')](_0x5a7ae1[_0xee31('0x2b')][_0xee31('0x2f')]));_0x5f38ca[_0xee31('0x2e')]=_0x5f38ca[_0xee31('0x2e')][_0xee31('0x30')]?_0x5f38ca[_0xee31('0x2e')]:_0x26a971[_0xee31('0x2d')];if(_0x5a7ae1['query']['includeAll']){_0x5f38ca[_0xee31('0x3c')]=[{'all':!![]}];}_0x5f38ca=_[_0xee31('0x37')]({},_0x5f38ca,_0x5a7ae1[_0xee31('0x43')]);return db[_0xee31('0x39')][_0xee31('0x44')](_0x5f38ca)[_0xee31('0x3a')](handleEntityNotFound(_0x560a6b,null))[_0xee31('0x3a')](respondWithResult(_0x560a6b,null))[_0xee31('0x3f')](handleError(_0x560a6b,null));};exports[_0xee31('0x45')]=function(_0x2a6e14,_0x9ea63b){return db[_0xee31('0x39')][_0xee31('0x45')](_0x2a6e14[_0xee31('0x46')],{})['then'](respondWithResult(_0x9ea63b,0xc9))[_0xee31('0x3f')](handleError(_0x9ea63b,null));};exports[_0xee31('0x47')]=function(_0x5c6b5f,_0xb1092d){if(_0x5c6b5f[_0xee31('0x46')]['id']){delete _0x5c6b5f['body']['id'];}return db[_0xee31('0x39')][_0xee31('0x44')]({'where':{'id':_0x5c6b5f[_0xee31('0x48')]['id']}})['then'](handleEntityNotFound(_0xb1092d,null))['then'](saveUpdates(_0x5c6b5f[_0xee31('0x46')],null))[_0xee31('0x3a')](respondWithResult(_0xb1092d,null))[_0xee31('0x3f')](handleError(_0xb1092d,null));};exports[_0xee31('0x21')]=function(_0x485c1e,_0x53204a){return db[_0xee31('0x39')][_0xee31('0x44')]({'where':{'id':_0x485c1e[_0xee31('0x48')]['id']}})[_0xee31('0x3a')](handleEntityNotFound(_0x53204a,null))[_0xee31('0x3a')](removeEntity(_0x53204a,null))[_0xee31('0x3f')](handleError(_0x53204a,null));};exports[_0xee31('0x49')]=function(_0x2245b4,_0x17acb8,_0x478d60){var _0x410f61={};var _0x5d456c={};var _0x4bfda0;var _0x31a1bc;return db[_0xee31('0x39')]['findOne']({'where':{'id':_0x2245b4[_0xee31('0x48')]['id']}})['then'](handleEntityNotFound(_0x17acb8,null))[_0xee31('0x3a')](function(_0x58a40a){if(_0x58a40a){_0x4bfda0=_0x58a40a;_0x5d456c[_0xee31('0x2d')]=_[_0xee31('0x41')](db[_0xee31('0x4a')][_0xee31('0x27')]);_0x5d456c[_0xee31('0x2b')]=_[_0xee31('0x41')](_0x2245b4[_0xee31('0x2b')]);_0x5d456c['filters']=_[_0xee31('0x42')](_0x5d456c[_0xee31('0x2d')],_0x5d456c[_0xee31('0x2b')]);_0x410f61[_0xee31('0x2e')]=_[_0xee31('0x42')](_0x5d456c[_0xee31('0x2d')],qs[_0xee31('0x2f')](_0x2245b4[_0xee31('0x2b')]['fields']));_0x410f61[_0xee31('0x2e')]=_0x410f61[_0xee31('0x2e')]['length']?_0x410f61[_0xee31('0x2e')]:_0x5d456c[_0xee31('0x2d')];_0x410f61[_0xee31('0x4b')]=qs[_0xee31('0x33')](_0x2245b4[_0xee31('0x2b')][_0xee31('0x33')]);_0x410f61['where']=qs['filters'](_[_0xee31('0x35')](_0x2245b4['query'],_0x5d456c['filters']));if(_0x2245b4[_0xee31('0x2b')][_0xee31('0x36')]){_0x410f61[_0xee31('0x34')]=_[_0xee31('0x37')](_0x410f61[_0xee31('0x34')],{'$or':_['map'](_0x410f61[_0xee31('0x2e')],function(_0x18af21){var _0xa582d2={};_0xa582d2[_0x18af21]={'$like':'%'+_0x2245b4[_0xee31('0x2b')][_0xee31('0x36')]+'%'};return _0xa582d2;})});}_0x410f61=_[_0xee31('0x37')]({},_0x410f61,_0x2245b4[_0xee31('0x43')]);return _0x4bfda0[_0xee31('0x49')](_0x410f61);}})[_0xee31('0x3a')](function(_0x184b90){if(_0x184b90){_0x31a1bc=_0x184b90['length'];if(!_0x2245b4[_0xee31('0x2b')][_0xee31('0x31')](_0xee31('0x4c'))){_0x410f61[_0xee31('0x32')]=qs[_0xee31('0x32')](_0x2245b4[_0xee31('0x2b')]['limit']);_0x410f61['offset']=qs['offset'](_0x2245b4[_0xee31('0x2b')][_0xee31('0x1b')]);}return _0x4bfda0[_0xee31('0x49')](_0x410f61);}})['then'](function(_0x289634){if(_0x289634){return _0x289634?{'count':_0x31a1bc,'rows':_0x289634}:null;}})[_0xee31('0x3a')](respondWithResult(_0x17acb8,null))[_0xee31('0x3f')](handleError(_0x17acb8,null));};exports['getSubjects']=function(_0x4757f6,_0x293451,_0x1e8bca){var _0x5f1ee8={};var _0x3b0ad0={};var _0x2f033e;var _0x2435d0;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x4757f6['params']['id']}})[_0xee31('0x3a')](handleEntityNotFound(_0x293451,null))['then'](function(_0xe676b1){if(_0xe676b1){_0x2f033e=_0xe676b1;_0x3b0ad0[_0xee31('0x2d')]=_[_0xee31('0x41')](db['SugarcrmField']['rawAttributes']);_0x3b0ad0[_0xee31('0x2b')]=_[_0xee31('0x41')](_0x4757f6[_0xee31('0x2b')]);_0x3b0ad0[_0xee31('0x2c')]=_[_0xee31('0x42')](_0x3b0ad0[_0xee31('0x2d')],_0x3b0ad0[_0xee31('0x2b')]);_0x5f1ee8[_0xee31('0x2e')]=_['intersection'](_0x3b0ad0[_0xee31('0x2d')],qs['fields'](_0x4757f6[_0xee31('0x2b')][_0xee31('0x2f')]));_0x5f1ee8[_0xee31('0x2e')]=_0x5f1ee8[_0xee31('0x2e')][_0xee31('0x30')]?_0x5f1ee8[_0xee31('0x2e')]:_0x3b0ad0['model'];_0x5f1ee8[_0xee31('0x4b')]=qs['sort'](_0x4757f6[_0xee31('0x2b')]['sort']);_0x5f1ee8[_0xee31('0x34')]=qs['filters'](_[_0xee31('0x35')](_0x4757f6[_0xee31('0x2b')],_0x3b0ad0[_0xee31('0x2c')]));if(_0x4757f6[_0xee31('0x2b')]['filter']){_0x5f1ee8[_0xee31('0x34')]=_[_0xee31('0x37')](_0x5f1ee8['where'],{'$or':_[_0xee31('0x26')](_0x5f1ee8[_0xee31('0x2e')],function(_0x2e2113){var _0x12c3f8={};_0x12c3f8[_0x2e2113]={'$like':'%'+_0x4757f6[_0xee31('0x2b')]['filter']+'%'};return _0x12c3f8;})});}_0x5f1ee8=_[_0xee31('0x37')]({},_0x5f1ee8,_0x4757f6[_0xee31('0x43')]);return _0x2f033e[_0xee31('0x4d')](_0x5f1ee8);}})[_0xee31('0x3a')](function(_0x16683f){if(_0x16683f){_0x2435d0=_0x16683f[_0xee31('0x30')];if(!_0x4757f6[_0xee31('0x2b')][_0xee31('0x31')]('nolimit')){_0x5f1ee8['limit']=qs['limit'](_0x4757f6[_0xee31('0x2b')]['limit']);_0x5f1ee8['offset']=qs['offset'](_0x4757f6[_0xee31('0x2b')][_0xee31('0x1b')]);}return _0x2f033e[_0xee31('0x4d')](_0x5f1ee8);}})[_0xee31('0x3a')](function(_0x598f4b){if(_0x598f4b){return _0x598f4b?{'count':_0x2435d0,'rows':_0x598f4b}:null;}})[_0xee31('0x3a')](respondWithResult(_0x293451,null))[_0xee31('0x3f')](handleError(_0x293451,null));};exports[_0xee31('0x4e')]=function(_0x1fa294,_0x4eeb73,_0x108b1b){var _0x72b5f0={};var _0x487309={};var _0x41768a;var _0x4a21ee;return db[_0xee31('0x39')][_0xee31('0x4f')]({'where':{'id':_0x1fa294[_0xee31('0x48')]['id']}})[_0xee31('0x3a')](handleEntityNotFound(_0x4eeb73,null))[_0xee31('0x3a')](function(_0x355315){if(_0x355315){_0x41768a=_0x355315;_0x487309['model']=_[_0xee31('0x41')](db[_0xee31('0x4a')][_0xee31('0x27')]);_0x487309['query']=_[_0xee31('0x41')](_0x1fa294['query']);_0x487309[_0xee31('0x2c')]=_[_0xee31('0x42')](_0x487309[_0xee31('0x2d')],_0x487309[_0xee31('0x2b')]);_0x72b5f0[_0xee31('0x2e')]=_[_0xee31('0x42')](_0x487309['model'],qs[_0xee31('0x2f')](_0x1fa294[_0xee31('0x2b')][_0xee31('0x2f')]));_0x72b5f0[_0xee31('0x2e')]=_0x72b5f0['attributes'][_0xee31('0x30')]?_0x72b5f0[_0xee31('0x2e')]:_0x487309[_0xee31('0x2d')];_0x72b5f0['order']=qs[_0xee31('0x33')](_0x1fa294['query'][_0xee31('0x33')]);_0x72b5f0[_0xee31('0x34')]=qs[_0xee31('0x2c')](_[_0xee31('0x35')](_0x1fa294[_0xee31('0x2b')],_0x487309[_0xee31('0x2c')]));if(_0x1fa294[_0xee31('0x2b')][_0xee31('0x36')]){_0x72b5f0[_0xee31('0x34')]=_[_0xee31('0x37')](_0x72b5f0['where'],{'$or':_[_0xee31('0x26')](_0x72b5f0[_0xee31('0x2e')],function(_0x55df25){var _0x16a62d={};_0x16a62d[_0x55df25]={'$like':'%'+_0x1fa294['query'][_0xee31('0x36')]+'%'};return _0x16a62d;})});}_0x72b5f0=_[_0xee31('0x37')]({},_0x72b5f0,_0x1fa294['options']);return _0x41768a[_0xee31('0x4e')](_0x72b5f0);}})[_0xee31('0x3a')](function(_0x19119f){if(_0x19119f){_0x4a21ee=_0x19119f[_0xee31('0x30')];if(!_0x1fa294[_0xee31('0x2b')][_0xee31('0x31')](_0xee31('0x4c'))){_0x72b5f0[_0xee31('0x32')]=qs[_0xee31('0x32')](_0x1fa294[_0xee31('0x2b')][_0xee31('0x32')]);_0x72b5f0[_0xee31('0x1b')]=qs[_0xee31('0x1b')](_0x1fa294[_0xee31('0x2b')][_0xee31('0x1b')]);}return _0x41768a[_0xee31('0x4e')](_0x72b5f0);}})[_0xee31('0x3a')](function(_0x3072cb){if(_0x3072cb){return _0x3072cb?{'count':_0x4a21ee,'rows':_0x3072cb}:null;}})[_0xee31('0x3a')](respondWithResult(_0x4eeb73,null))[_0xee31('0x3f')](handleError(_0x4eeb73,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 118c89c..a1e9e1a 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 _0xd090=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x18d080,_0x5d376f){var _0x504176=function(_0x4b0d15){while(--_0x4b0d15){_0x18d080['push'](_0x18d080['shift']());}};_0x504176(++_0x5d376f);}(_0xd090,0x1ed));var _0x0d09=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd090[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0d09('0x0'));var util=require(_0x0d09('0x1'));var logger=require(_0x0d09('0x2'))(_0x0d09('0x3'));var moment=require(_0x0d09('0x4'));var BPromise=require(_0x0d09('0x5'));var rp=require(_0x0d09('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0d09('0x7'));var config=require(_0x0d09('0x8'));var attributes=require(_0x0d09('0x9'));module[_0x0d09('0xa')]=function(_0x4bda9a,_0x2f33dc){return _0x4bda9a[_0x0d09('0xb')](_0x0d09('0xc'),attributes,{'tableName':_0x0d09('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9632=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x48266d,_0x1ab050){var _0x11ff41=function(_0x417f1f){while(--_0x417f1f){_0x48266d['push'](_0x48266d['shift']());}};_0x11ff41(++_0x1ab050);}(_0x9632,0xe9));var _0x2963=function(_0x382a17,_0x46da44){_0x382a17=_0x382a17-0x0;var _0x25f156=_0x9632[_0x382a17];return _0x25f156;};'use strict';var _=require(_0x2963('0x0'));var util=require(_0x2963('0x1'));var logger=require(_0x2963('0x2'))(_0x2963('0x3'));var moment=require(_0x2963('0x4'));var BPromise=require(_0x2963('0x5'));var rp=require(_0x2963('0x6'));var fs=require('fs');var path=require(_0x2963('0x7'));var rimraf=require(_0x2963('0x8'));var config=require(_0x2963('0x9'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x2963('0xa')]=function(_0x151cd4,_0x2f4cbf){return _0x151cd4[_0x2963('0xb')](_0x2963('0xc'),attributes,{'tableName':_0x2963('0xd'),'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 71f26fd..618bccf 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 _0x75ea=['moment','bluebird','ioredis','../../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','code','error','message','result','catch','lodash'];(function(_0x5b348a,_0x462753){var _0x1101d1=function(_0x501e68){while(--_0x501e68){_0x5b348a['push'](_0x5b348a['shift']());}};_0x1101d1(++_0x462753);}(_0x75ea,0x15f));var _0xa75e=function(_0x5862fe,_0x24b377){_0x5862fe=_0x5862fe-0x0;var _0x1e3673=_0x75ea[_0x5862fe];return _0x1e3673;};'use strict';var _=require(_0xa75e('0x0'));var util=require('util');var moment=require(_0xa75e('0x1'));var BPromise=require(_0xa75e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa75e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa75e('0x4'));var logger=require(_0xa75e('0x5'))(_0xa75e('0x6'));var config=require('../../config/environment');var jayson=require(_0xa75e('0x7'));var client=jayson[_0xa75e('0x8')][_0xa75e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cf41f,_0x507079,_0x217080){return new BPromise(function(_0xcb4929,_0x151da8){return client[_0xa75e('0xa')](_0x3cf41f,_0x217080)[_0xa75e('0xb')](function(_0x156989){logger[_0xa75e('0xc')](_0xa75e('0xd'),_0x507079,_0xa75e('0xe'));logger[_0xa75e('0xf')](_0xa75e('0x10'),_0x507079,_0xa75e('0xe'),JSON['stringify'](_0x156989));if(_0x156989['error']){if(_0x156989['error'][_0xa75e('0x11')]===0x1f4){logger[_0xa75e('0x12')](_0xa75e('0xd'),_0x507079,_0x156989['error'][_0xa75e('0x13')]);return _0x151da8(_0x156989[_0xa75e('0x12')]['message']);}logger[_0xa75e('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x507079,_0x156989[_0xa75e('0x12')][_0xa75e('0x13')]);return _0xcb4929(_0x156989[_0xa75e('0x12')][_0xa75e('0x13')]);}else{logger[_0xa75e('0xc')](_0xa75e('0xd'),_0x507079,_0xa75e('0xe'));_0xcb4929(_0x156989[_0xa75e('0x14')][_0xa75e('0x13')]);}})[_0xa75e('0x15')](function(_0x3412b0){logger[_0xa75e('0x12')](_0xa75e('0xd'),_0x507079,_0x3412b0);_0x151da8(_0x3412b0);});});} \ No newline at end of file +var _0x1fb1=['request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x1fb1,0x106));var _0x11fb=function(_0x3f7c6e,_0x454e70){_0x3f7c6e=_0x3f7c6e-0x0;var _0x252041=_0x1fb1[_0x3f7c6e];return _0x252041;};'use strict';var _=require(_0x11fb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x11fb('0x1'));var fs=require('fs');var Redis=require(_0x11fb('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x11fb('0x3'));var logger=require(_0x11fb('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x11fb('0x5'));var client=jayson[_0x11fb('0x6')][_0x11fb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52f689,_0x11a30a,_0x324132){return new BPromise(function(_0x11c279,_0x35c87c){return client[_0x11fb('0x8')](_0x52f689,_0x324132)[_0x11fb('0x9')](function(_0x4e6d76){logger[_0x11fb('0xa')](_0x11fb('0xb'),_0x11a30a,_0x11fb('0xc'));logger[_0x11fb('0xd')](_0x11fb('0xe'),_0x11a30a,'request\x20sent',JSON['stringify'](_0x4e6d76));if(_0x4e6d76[_0x11fb('0xf')]){if(_0x4e6d76['error']['code']===0x1f4){logger[_0x11fb('0xf')](_0x11fb('0xb'),_0x11a30a,_0x4e6d76[_0x11fb('0xf')]['message']);return _0x35c87c(_0x4e6d76[_0x11fb('0xf')][_0x11fb('0x10')]);}logger[_0x11fb('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x11a30a,_0x4e6d76[_0x11fb('0xf')]['message']);return _0x11c279(_0x4e6d76['error'][_0x11fb('0x10')]);}else{logger[_0x11fb('0xa')](_0x11fb('0xb'),_0x11a30a,_0x11fb('0xc'));_0x11c279(_0x4e6d76[_0x11fb('0x11')][_0x11fb('0x10')]);}})['catch'](function(_0x1c1b73){logger['error'](_0x11fb('0xb'),_0x11a30a,_0x1c1b73);_0x35c87c(_0x1c1b73);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 9e70790..976da8a 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 _0x4495=['put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create'];(function(_0x16ec2a,_0x4e5213){var _0x27bdd7=function(_0x3bd68d){while(--_0x3bd68d){_0x16ec2a['push'](_0x16ec2a['shift']());}};_0x27bdd7(++_0x4e5213);}(_0x4495,0x1a4));var _0x5449=function(_0x35d819,_0x11d089){_0x35d819=_0x35d819-0x0;var _0x53c55d=_0x4495[_0x35d819];return _0x53c55d;};'use strict';var multer=require(_0x5449('0x0'));var util=require(_0x5449('0x1'));var path=require('path');var timeout=require(_0x5449('0x2'));var express=require(_0x5449('0x3'));var router=express['Router']();var fs_extra=require(_0x5449('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5449('0x5'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x5449('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5449('0x6')](_0x5449('0x7'),auth[_0x5449('0x8')](),controller[_0x5449('0x9')]);router[_0x5449('0xa')]('/',auth[_0x5449('0x8')](),controller[_0x5449('0xb')]);router[_0x5449('0xc')](_0x5449('0x7'),auth[_0x5449('0x8')](),controller['update']);router[_0x5449('0xd')](_0x5449('0x7'),auth[_0x5449('0x8')](),controller[_0x5449('0xe')]);module[_0x5449('0xf')]=router; \ No newline at end of file +var _0x66e2=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','show','/:id','update','delete','destroy','exports','path','connect-timeout'];(function(_0x178b0b,_0xdd2853){var _0x5b44c5=function(_0xe6f38b){while(--_0xe6f38b){_0x178b0b['push'](_0x178b0b['shift']());}};_0x5b44c5(++_0xdd2853);}(_0x66e2,0x14e));var _0x266e=function(_0x293866,_0x33ab3e){_0x293866=_0x293866-0x0;var _0x4b33c8=_0x66e2[_0x293866];return _0x4b33c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x266e('0x0'));var timeout=require(_0x266e('0x1'));var express=require(_0x266e('0x2'));var router=express['Router']();var fs_extra=require(_0x266e('0x3'));var auth=require(_0x266e('0x4'));var interaction=require(_0x266e('0x5'));var config=require(_0x266e('0x6'));var controller=require(_0x266e('0x7'));router[_0x266e('0x8')]('/',auth[_0x266e('0x9')](),controller['index']);router[_0x266e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x266e('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x266e('0xb'),auth['isAuthenticated'](),controller[_0x266e('0xc')]);router[_0x266e('0xd')](_0x266e('0xb'),auth[_0x266e('0x9')](),controller[_0x266e('0xe')]);module[_0x266e('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index e2c477d..3c9c216 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 _0x7811=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0xe6d5b1,_0x578f44){var _0x92fae0=function(_0x2c26c9){while(--_0x2c26c9){_0xe6d5b1['push'](_0xe6d5b1['shift']());}};_0x92fae0(++_0x578f44);}(_0x7811,0x1af));var _0x1781=function(_0x14d2e1,_0x3c66cb){_0x14d2e1=_0x14d2e1-0x0;var _0x3e0edf=_0x7811[_0x14d2e1];return _0x3e0edf;};'use strict';var Sequelize=require(_0x1781('0x0'));module[_0x1781('0x1')]={'type':{'type':Sequelize[_0x1781('0x2')](_0x1781('0x3'),_0x1781('0x4'),_0x1781('0x5'),_0x1781('0x6'),'picklist'),'defaultValue':_0x1781('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1781('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x1781('0x3'),'variable',_0x1781('0x5'))},'keyContent':{'type':Sequelize[_0x1781('0x7')]},'idField':{'type':Sequelize[_0x1781('0x7')]},'nameField':{'type':Sequelize[_0x1781('0x7')]},'customField':{'type':Sequelize[_0x1781('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe6d8=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN'];(function(_0x456af4,_0x16c8ec){var _0x10a5b5=function(_0x4a3ea8){while(--_0x4a3ea8){_0x456af4['push'](_0x456af4['shift']());}};_0x10a5b5(++_0x16c8ec);}(_0xe6d8,0x1b0));var _0x8e6d=function(_0x58c1ad,_0x349e71){_0x58c1ad=_0x58c1ad-0x0;var _0x22bddf=_0xe6d8[_0x58c1ad];return _0x22bddf;};'use strict';var Sequelize=require(_0x8e6d('0x0'));module[_0x8e6d('0x1')]={'type':{'type':Sequelize[_0x8e6d('0x2')](_0x8e6d('0x3'),'variable',_0x8e6d('0x4'),_0x8e6d('0x5'),'picklist'),'defaultValue':_0x8e6d('0x3')},'content':{'type':Sequelize[_0x8e6d('0x6')]},'key':{'type':Sequelize[_0x8e6d('0x6')]},'keyType':{'type':Sequelize[_0x8e6d('0x2')](_0x8e6d('0x3'),_0x8e6d('0x7'),_0x8e6d('0x4'))},'keyContent':{'type':Sequelize[_0x8e6d('0x6')]},'idField':{'type':Sequelize[_0x8e6d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8e6d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8e6d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 677d5f3..3832355 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 _0x63ee=['../../config/license/util','../../mysqldb','sendStatus','undefined','limit','count','offset','status','set','Content-Range','json','reject','save','update','then','error','name','map','SugarcrmField','rawAttributes','type','key','model','query','filters','attributes','length','nolimit','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','intersection','fields','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment'];(function(_0x5ec733,_0x3faf25){var _0x8dccc7=function(_0x39d6dd){while(--_0x39d6dd){_0x5ec733['push'](_0x5ec733['shift']());}};_0x8dccc7(++_0x3faf25);}(_0x63ee,0x1a3));var _0xe63e=function(_0x4c7b7a,_0x334615){_0x4c7b7a=_0x4c7b7a-0x0;var _0x3f680d=_0x63ee[_0x4c7b7a];return _0x3f680d;};'use strict';var emlformat=require(_0xe63e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe63e('0x1'));var jsonpatch=require(_0xe63e('0x2'));var rp=require(_0xe63e('0x3'));var moment=require(_0xe63e('0x4'));var BPromise=require(_0xe63e('0x5'));var Mustache=require(_0xe63e('0x6'));var util=require(_0xe63e('0x7'));var path=require(_0xe63e('0x8'));var sox=require(_0xe63e('0x9'));var csv=require(_0xe63e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe63e('0xb'));var _=require(_0xe63e('0xc'));var squel=require(_0xe63e('0xd'));var crypto=require(_0xe63e('0xe'));var jsforce=require(_0xe63e('0xf'));var deskjs=require(_0xe63e('0x10'));var toCsv=require(_0xe63e('0xa'));var querystring=require(_0xe63e('0x11'));var Papa=require(_0xe63e('0x12'));var Redis=require(_0xe63e('0x13'));var authService=require(_0xe63e('0x14'));var qs=require(_0xe63e('0x15'));var as=require(_0xe63e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe63e('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xe63e('0x18'));var licenseUtil=require(_0xe63e('0x19'));var db=require(_0xe63e('0x1a'))['db'];function respondWithStatusCode(_0x52603c,_0x55ebe7){_0x55ebe7=_0x55ebe7||0xcc;return function(_0x3e5a7a){if(_0x3e5a7a){return _0x52603c[_0xe63e('0x1b')](_0x55ebe7);}return _0x52603c['status'](_0x55ebe7)['end']();};}function respondWithResult(_0xae053d,_0x325094){_0x325094=_0x325094||0xc8;return function(_0x3db793){if(_0x3db793){return _0xae053d['status'](_0x325094)['json'](_0x3db793);}};}function respondWithFilteredResult(_0x401e0b,_0x6cf3be){return function(_0x5bc397){if(_0x5bc397){var _0x47ed2d=typeof _0x6cf3be['offset']===_0xe63e('0x1c')&&typeof _0x6cf3be[_0xe63e('0x1d')]===_0xe63e('0x1c');var _0x43832b=_0x5bc397[_0xe63e('0x1e')];var _0xb83b6f=_0x47ed2d?0x0:_0x6cf3be[_0xe63e('0x1f')];var _0x144475=_0x47ed2d?_0x5bc397[_0xe63e('0x1e')]:_0x6cf3be['offset']+_0x6cf3be['limit'];var _0x396ff5;if(_0x144475>=_0x43832b){_0x144475=_0x43832b;_0x396ff5=0xc8;}else{_0x396ff5=0xce;}_0x401e0b[_0xe63e('0x20')](_0x396ff5);return _0x401e0b[_0xe63e('0x21')](_0xe63e('0x22'),_0xb83b6f+'-'+_0x144475+'/'+_0x43832b)[_0xe63e('0x23')](_0x5bc397);}return null;};}function patchUpdates(_0x1063bc){return function(_0x51d95c){try{jsonpatch['apply'](_0x51d95c,_0x1063bc,!![]);}catch(_0x3d2a50){return BPromise[_0xe63e('0x24')](_0x3d2a50);}return _0x51d95c[_0xe63e('0x25')]();};}function saveUpdates(_0x2d31a3,_0x2665cc){return function(_0x2e8b71){if(_0x2e8b71){return _0x2e8b71[_0xe63e('0x26')](_0x2d31a3)[_0xe63e('0x27')](function(_0x4a2279){return _0x4a2279;});}return null;};}function removeEntity(_0x1d3f3a,_0x557f87){return function(_0x5ada35){if(_0x5ada35){return _0x5ada35['destroy']()[_0xe63e('0x27')](function(){_0x1d3f3a[_0xe63e('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f1adf,_0x46b389){return function(_0x416594){if(!_0x416594){_0x1f1adf['sendStatus'](0x194);}return _0x416594;};}function handleError(_0x44d6b0,_0x2f1656){_0x2f1656=_0x2f1656||0x1f4;return function(_0xc7b13a){logger[_0xe63e('0x28')](_0xc7b13a['stack']);if(_0xc7b13a[_0xe63e('0x29')]){delete _0xc7b13a['name'];}_0x44d6b0[_0xe63e('0x20')](_0x2f1656)['send'](_0xc7b13a);};}exports['index']=function(_0x150aae,_0x377c27){var _0x37c769={},_0xd5a75e={},_0x34fac0={'count':0x0,'rows':[]};var _0x4f60e9=_[_0xe63e('0x2a')](db[_0xe63e('0x2b')][_0xe63e('0x2c')],function(_0x4966af){return{'name':_0x4966af['fieldName'],'type':_0x4966af[_0xe63e('0x2d')][_0xe63e('0x2e')]};});_0xd5a75e[_0xe63e('0x2f')]=_[_0xe63e('0x2a')](_0x4f60e9,_0xe63e('0x29'));_0xd5a75e[_0xe63e('0x30')]=_['keys'](_0x150aae['query']);_0xd5a75e[_0xe63e('0x31')]=_['intersection'](_0xd5a75e[_0xe63e('0x2f')],_0xd5a75e[_0xe63e('0x30')]);_0x37c769[_0xe63e('0x32')]=_['intersection'](_0xd5a75e[_0xe63e('0x2f')],qs['fields'](_0x150aae[_0xe63e('0x30')]['fields']));_0x37c769[_0xe63e('0x32')]=_0x37c769['attributes'][_0xe63e('0x33')]?_0x37c769[_0xe63e('0x32')]:_0xd5a75e['model'];if(!_0x150aae[_0xe63e('0x30')]['hasOwnProperty'](_0xe63e('0x34'))){_0x37c769['limit']=qs[_0xe63e('0x1d')](_0x150aae['query'][_0xe63e('0x1d')]);_0x37c769['offset']=qs[_0xe63e('0x1f')](_0x150aae['query'][_0xe63e('0x1f')]);}_0x37c769['order']=qs['sort'](_0x150aae['query'][_0xe63e('0x35')]);_0x37c769['where']=qs['filters'](_[_0xe63e('0x36')](_0x150aae['query'],_0xd5a75e[_0xe63e('0x31')]),_0x4f60e9);if(_0x150aae[_0xe63e('0x30')]['filter']){_0x37c769['where']=_[_0xe63e('0x37')](_0x37c769[_0xe63e('0x38')],{'$or':_['map'](_0x4f60e9,function(_0x2910d8){if(_0x2910d8[_0xe63e('0x2d')]!==_0xe63e('0x39')){var _0xffd080={};_0xffd080[_0x2910d8['name']]={'$like':'%'+_0x150aae['query'][_0xe63e('0x3a')]+'%'};return _0xffd080;}})});}_0x37c769=_[_0xe63e('0x37')]({},_0x37c769,_0x150aae['options']);var _0x584205={'where':_0x37c769['where']};return db['SugarcrmField'][_0xe63e('0x1e')](_0x584205)[_0xe63e('0x27')](function(_0x1095a9){_0x34fac0[_0xe63e('0x1e')]=_0x1095a9;if(_0x150aae[_0xe63e('0x30')][_0xe63e('0x3b')]){_0x37c769[_0xe63e('0x3c')]=[{'all':!![]}];}return db['SugarcrmField'][_0xe63e('0x3d')](_0x37c769);})['then'](function(_0x266c5b){_0x34fac0[_0xe63e('0x3e')]=_0x266c5b;return _0x34fac0;})['then'](respondWithFilteredResult(_0x377c27,_0x37c769))[_0xe63e('0x3f')](handleError(_0x377c27,null));};exports[_0xe63e('0x40')]=function(_0x38f5a5,_0x2b4eea){var _0x151b4d={'raw':!![],'where':{'id':_0x38f5a5[_0xe63e('0x41')]['id']}},_0x322c4e={};_0x322c4e[_0xe63e('0x2f')]=_[_0xe63e('0x42')](db['SugarcrmField'][_0xe63e('0x2c')]);_0x322c4e[_0xe63e('0x30')]=_[_0xe63e('0x42')](_0x38f5a5['query']);_0x322c4e['filters']=_[_0xe63e('0x43')](_0x322c4e['model'],_0x322c4e[_0xe63e('0x30')]);_0x151b4d['attributes']=_[_0xe63e('0x43')](_0x322c4e[_0xe63e('0x2f')],qs[_0xe63e('0x44')](_0x38f5a5[_0xe63e('0x30')]['fields']));_0x151b4d['attributes']=_0x151b4d[_0xe63e('0x32')][_0xe63e('0x33')]?_0x151b4d['attributes']:_0x322c4e[_0xe63e('0x2f')];if(_0x38f5a5[_0xe63e('0x30')][_0xe63e('0x3b')]){_0x151b4d[_0xe63e('0x3c')]=[{'all':!![]}];}_0x151b4d=_['merge']({},_0x151b4d,_0x38f5a5[_0xe63e('0x45')]);return db[_0xe63e('0x2b')][_0xe63e('0x46')](_0x151b4d)['then'](handleEntityNotFound(_0x2b4eea,null))[_0xe63e('0x27')](respondWithResult(_0x2b4eea,null))[_0xe63e('0x3f')](handleError(_0x2b4eea,null));};exports[_0xe63e('0x47')]=function(_0x203c75,_0x4e8d9e){return db[_0xe63e('0x2b')][_0xe63e('0x47')](_0x203c75[_0xe63e('0x48')],{})[_0xe63e('0x27')](respondWithResult(_0x4e8d9e,0xc9))['catch'](handleError(_0x4e8d9e,null));};exports[_0xe63e('0x26')]=function(_0x4516da,_0xb62c43){if(_0x4516da[_0xe63e('0x48')]['id']){delete _0x4516da[_0xe63e('0x48')]['id'];}return db[_0xe63e('0x2b')][_0xe63e('0x46')]({'where':{'id':_0x4516da[_0xe63e('0x41')]['id']}})[_0xe63e('0x27')](handleEntityNotFound(_0xb62c43,null))[_0xe63e('0x27')](saveUpdates(_0x4516da[_0xe63e('0x48')],null))[_0xe63e('0x27')](respondWithResult(_0xb62c43,null))[_0xe63e('0x3f')](handleError(_0xb62c43,null));};exports[_0xe63e('0x49')]=function(_0x57466c,_0x4e35ed){return db[_0xe63e('0x2b')][_0xe63e('0x46')]({'where':{'id':_0x57466c[_0xe63e('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e35ed,null))[_0xe63e('0x27')](removeEntity(_0x4e35ed,null))[_0xe63e('0x3f')](handleError(_0x4e35ed,null));}; \ No newline at end of file +var _0xb46f=['length','hasOwnProperty','sort','where','pick','filters','merge','map','VIRTUAL','filter','options','SugarcrmField','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','name','index','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields'];(function(_0x34552c,_0x7d1c56){var _0x2ba90f=function(_0xe63f2e){while(--_0xe63f2e){_0x34552c['push'](_0x34552c['shift']());}};_0x2ba90f(++_0x7d1c56);}(_0xb46f,0xeb));var _0xfb46=function(_0x2b2977,_0x431e53){_0x2b2977=_0x2b2977-0x0;var _0xbdf49e=_0xb46f[_0x2b2977];return _0xbdf49e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb46('0x0'));var zipdir=require(_0xfb46('0x1'));var jsonpatch=require(_0xfb46('0x2'));var rp=require('request-promise');var moment=require(_0xfb46('0x3'));var BPromise=require(_0xfb46('0x4'));var Mustache=require('mustache');var util=require(_0xfb46('0x5'));var path=require(_0xfb46('0x6'));var sox=require(_0xfb46('0x7'));var csv=require(_0xfb46('0x8'));var ejs=require(_0xfb46('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb46('0xa'));var squel=require(_0xfb46('0xb'));var crypto=require('crypto');var jsforce=require(_0xfb46('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfb46('0x8'));var querystring=require(_0xfb46('0xd'));var Papa=require(_0xfb46('0xe'));var Redis=require(_0xfb46('0xf'));var authService=require(_0xfb46('0x10'));var qs=require(_0xfb46('0x11'));var as=require(_0xfb46('0x12'));var hardwareService=require(_0xfb46('0x13'));var logger=require(_0xfb46('0x14'))('api');var utils=require(_0xfb46('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfb46('0x16'))['db'];function respondWithStatusCode(_0x3328a2,_0x3503e0){_0x3503e0=_0x3503e0||0xcc;return function(_0xa17061){if(_0xa17061){return _0x3328a2[_0xfb46('0x17')](_0x3503e0);}return _0x3328a2['status'](_0x3503e0)['end']();};}function respondWithResult(_0x3d64ef,_0x500870){_0x500870=_0x500870||0xc8;return function(_0x408c63){if(_0x408c63){return _0x3d64ef[_0xfb46('0x18')](_0x500870)[_0xfb46('0x19')](_0x408c63);}};}function respondWithFilteredResult(_0x3e8c0b,_0x2ca93f){return function(_0x5e3a45){if(_0x5e3a45){var _0x4a8e20=typeof _0x2ca93f[_0xfb46('0x1a')]===_0xfb46('0x1b')&&typeof _0x2ca93f[_0xfb46('0x1c')]==='undefined';var _0x4527b0=_0x5e3a45[_0xfb46('0x1d')];var _0x292d2b=_0x4a8e20?0x0:_0x2ca93f['offset'];var _0x58cb66=_0x4a8e20?_0x5e3a45[_0xfb46('0x1d')]:_0x2ca93f[_0xfb46('0x1a')]+_0x2ca93f[_0xfb46('0x1c')];var _0x3a2781;if(_0x58cb66>=_0x4527b0){_0x58cb66=_0x4527b0;_0x3a2781=0xc8;}else{_0x3a2781=0xce;}_0x3e8c0b[_0xfb46('0x18')](_0x3a2781);return _0x3e8c0b[_0xfb46('0x1e')](_0xfb46('0x1f'),_0x292d2b+'-'+_0x58cb66+'/'+_0x4527b0)[_0xfb46('0x19')](_0x5e3a45);}return null;};}function patchUpdates(_0x3a10a0){return function(_0x1d4429){try{jsonpatch[_0xfb46('0x20')](_0x1d4429,_0x3a10a0,!![]);}catch(_0x661728){return BPromise['reject'](_0x661728);}return _0x1d4429['save']();};}function saveUpdates(_0x481957,_0x4015f8){return function(_0x4b0c61){if(_0x4b0c61){return _0x4b0c61[_0xfb46('0x21')](_0x481957)[_0xfb46('0x22')](function(_0x3bcd1e){return _0x3bcd1e;});}return null;};}function removeEntity(_0x1ce02e,_0x394d30){return function(_0x2f47cc){if(_0x2f47cc){return _0x2f47cc[_0xfb46('0x23')]()[_0xfb46('0x22')](function(){_0x1ce02e[_0xfb46('0x18')](0xcc)[_0xfb46('0x24')]();});}};}function handleEntityNotFound(_0xa5b2aa,_0x534188){return function(_0x1a92ee){if(!_0x1a92ee){_0xa5b2aa[_0xfb46('0x17')](0x194);}return _0x1a92ee;};}function handleError(_0x48e775,_0x1c8467){_0x1c8467=_0x1c8467||0x1f4;return function(_0x2bd72d){logger[_0xfb46('0x25')](_0x2bd72d['stack']);if(_0x2bd72d[_0xfb46('0x26')]){delete _0x2bd72d['name'];}_0x48e775[_0xfb46('0x18')](_0x1c8467)['send'](_0x2bd72d);};}exports[_0xfb46('0x27')]=function(_0x3d4fa4,_0x32a483){var _0x7c1757={},_0x393bbb={},_0x6d5c07={'count':0x0,'rows':[]};var _0x2d1dbf=_['map'](db['SugarcrmField'][_0xfb46('0x28')],function(_0x32884f){return{'name':_0x32884f[_0xfb46('0x29')],'type':_0x32884f['type'][_0xfb46('0x2a')]};});_0x393bbb['model']=_['map'](_0x2d1dbf,_0xfb46('0x26'));_0x393bbb[_0xfb46('0x2b')]=_[_0xfb46('0x2c')](_0x3d4fa4['query']);_0x393bbb['filters']=_[_0xfb46('0x2d')](_0x393bbb[_0xfb46('0x2e')],_0x393bbb[_0xfb46('0x2b')]);_0x7c1757[_0xfb46('0x2f')]=_[_0xfb46('0x2d')](_0x393bbb[_0xfb46('0x2e')],qs[_0xfb46('0x30')](_0x3d4fa4['query']['fields']));_0x7c1757['attributes']=_0x7c1757['attributes'][_0xfb46('0x31')]?_0x7c1757['attributes']:_0x393bbb['model'];if(!_0x3d4fa4[_0xfb46('0x2b')][_0xfb46('0x32')]('nolimit')){_0x7c1757[_0xfb46('0x1c')]=qs[_0xfb46('0x1c')](_0x3d4fa4['query'][_0xfb46('0x1c')]);_0x7c1757[_0xfb46('0x1a')]=qs[_0xfb46('0x1a')](_0x3d4fa4[_0xfb46('0x2b')][_0xfb46('0x1a')]);}_0x7c1757['order']=qs[_0xfb46('0x33')](_0x3d4fa4[_0xfb46('0x2b')][_0xfb46('0x33')]);_0x7c1757[_0xfb46('0x34')]=qs['filters'](_[_0xfb46('0x35')](_0x3d4fa4[_0xfb46('0x2b')],_0x393bbb[_0xfb46('0x36')]),_0x2d1dbf);if(_0x3d4fa4[_0xfb46('0x2b')]['filter']){_0x7c1757['where']=_[_0xfb46('0x37')](_0x7c1757[_0xfb46('0x34')],{'$or':_[_0xfb46('0x38')](_0x2d1dbf,function(_0x1ad84e){if(_0x1ad84e['type']!==_0xfb46('0x39')){var _0x31cf00={};_0x31cf00[_0x1ad84e[_0xfb46('0x26')]]={'$like':'%'+_0x3d4fa4[_0xfb46('0x2b')][_0xfb46('0x3a')]+'%'};return _0x31cf00;}})});}_0x7c1757=_['merge']({},_0x7c1757,_0x3d4fa4[_0xfb46('0x3b')]);var _0x97aa07={'where':_0x7c1757[_0xfb46('0x34')]};return db[_0xfb46('0x3c')][_0xfb46('0x1d')](_0x97aa07)['then'](function(_0x291228){_0x6d5c07['count']=_0x291228;if(_0x3d4fa4[_0xfb46('0x2b')][_0xfb46('0x3d')]){_0x7c1757[_0xfb46('0x3e')]=[{'all':!![]}];}return db[_0xfb46('0x3c')][_0xfb46('0x3f')](_0x7c1757);})[_0xfb46('0x22')](function(_0x424723){_0x6d5c07[_0xfb46('0x40')]=_0x424723;return _0x6d5c07;})[_0xfb46('0x22')](respondWithFilteredResult(_0x32a483,_0x7c1757))[_0xfb46('0x41')](handleError(_0x32a483,null));};exports[_0xfb46('0x42')]=function(_0x2c35f8,_0x11a2eb){var _0x36332e={'raw':!![],'where':{'id':_0x2c35f8[_0xfb46('0x43')]['id']}},_0x118aba={};_0x118aba['model']=_[_0xfb46('0x2c')](db[_0xfb46('0x3c')]['rawAttributes']);_0x118aba[_0xfb46('0x2b')]=_[_0xfb46('0x2c')](_0x2c35f8[_0xfb46('0x2b')]);_0x118aba['filters']=_['intersection'](_0x118aba[_0xfb46('0x2e')],_0x118aba[_0xfb46('0x2b')]);_0x36332e[_0xfb46('0x2f')]=_['intersection'](_0x118aba[_0xfb46('0x2e')],qs[_0xfb46('0x30')](_0x2c35f8[_0xfb46('0x2b')][_0xfb46('0x30')]));_0x36332e[_0xfb46('0x2f')]=_0x36332e['attributes'][_0xfb46('0x31')]?_0x36332e[_0xfb46('0x2f')]:_0x118aba['model'];if(_0x2c35f8[_0xfb46('0x2b')][_0xfb46('0x3d')]){_0x36332e[_0xfb46('0x3e')]=[{'all':!![]}];}_0x36332e=_[_0xfb46('0x37')]({},_0x36332e,_0x2c35f8['options']);return db['SugarcrmField'][_0xfb46('0x44')](_0x36332e)['then'](handleEntityNotFound(_0x11a2eb,null))[_0xfb46('0x22')](respondWithResult(_0x11a2eb,null))['catch'](handleError(_0x11a2eb,null));};exports[_0xfb46('0x45')]=function(_0x99128a,_0x48d3c0){return db[_0xfb46('0x3c')][_0xfb46('0x45')](_0x99128a[_0xfb46('0x46')],{})[_0xfb46('0x22')](respondWithResult(_0x48d3c0,0xc9))[_0xfb46('0x41')](handleError(_0x48d3c0,null));};exports[_0xfb46('0x21')]=function(_0x36b36e,_0x34f860){if(_0x36b36e[_0xfb46('0x46')]['id']){delete _0x36b36e['body']['id'];}return db[_0xfb46('0x3c')][_0xfb46('0x44')]({'where':{'id':_0x36b36e[_0xfb46('0x43')]['id']}})[_0xfb46('0x22')](handleEntityNotFound(_0x34f860,null))[_0xfb46('0x22')](saveUpdates(_0x36b36e[_0xfb46('0x46')],null))[_0xfb46('0x22')](respondWithResult(_0x34f860,null))[_0xfb46('0x41')](handleError(_0x34f860,null));};exports['destroy']=function(_0x1d309c,_0x2f4bf4){return db[_0xfb46('0x3c')][_0xfb46('0x44')]({'where':{'id':_0x1d309c[_0xfb46('0x43')]['id']}})[_0xfb46('0x22')](handleEntityNotFound(_0x2f4bf4,null))[_0xfb46('0x22')](removeEntity(_0x2f4bf4,null))[_0xfb46('0x41')](handleError(_0x2f4bf4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index cbe65e9..5ea7d09 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 _0xece6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','sugarcrm_unique_index','FieldId','util'];(function(_0x35bca2,_0x4ce50d){var _0x295d7a=function(_0x226e4d){while(--_0x226e4d){_0x35bca2['push'](_0x35bca2['shift']());}};_0x295d7a(++_0x4ce50d);}(_0xece6,0x110));var _0x6ece=function(_0x387b91,_0x1b362a){_0x387b91=_0x387b91-0x0;var _0x52759e=_0xece6[_0x387b91];return _0x52759e;};'use strict';var _=require('lodash');var util=require(_0x6ece('0x0'));var logger=require(_0x6ece('0x1'))(_0x6ece('0x2'));var moment=require(_0x6ece('0x3'));var BPromise=require(_0x6ece('0x4'));var rp=require(_0x6ece('0x5'));var fs=require('fs');var path=require(_0x6ece('0x6'));var rimraf=require(_0x6ece('0x7'));var config=require(_0x6ece('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x6ece('0x9')]=function(_0x573b7e,_0x167891){return _0x573b7e[_0x6ece('0xa')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x6ece('0xb'),'fields':['idField',_0x6ece('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3ba=['idField','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields'];(function(_0x55c547,_0x3e9904){var _0x49cc0f=function(_0x4014c4){while(--_0x4014c4){_0x55c547['push'](_0x55c547['shift']());}};_0x49cc0f(++_0x3e9904);}(_0xf3ba,0x6d));var _0xaf3b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xf3ba[_0x47e7cb];return _0x2a8874;};'use strict';var _=require('lodash');var util=require(_0xaf3b('0x0'));var logger=require(_0xaf3b('0x1'))(_0xaf3b('0x2'));var moment=require(_0xaf3b('0x3'));var BPromise=require(_0xaf3b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf3b('0x5'));var rimraf=require('rimraf');var config=require(_0xaf3b('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0xaf3b('0x7')]=function(_0x27447c,_0x2adc8f){return _0x27447c[_0xaf3b('0x8')](_0xaf3b('0x9'),attributes,{'tableName':_0xaf3b('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xaf3b('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index a99e87b..f1ee032 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 _0xcbc7=['error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x383954,_0x103ca6){var _0x5503b5=function(_0xf9098c){while(--_0xf9098c){_0x383954['push'](_0x383954['shift']());}};_0x5503b5(++_0x103ca6);}(_0xcbc7,0xa5));var _0x7cbc=function(_0xf482c1,_0x32cbca){_0xf482c1=_0xf482c1-0x0;var _0x184548=_0xcbc7[_0xf482c1];return _0x184548;};'use strict';var _=require(_0x7cbc('0x0'));var util=require(_0x7cbc('0x1'));var moment=require(_0x7cbc('0x2'));var BPromise=require('bluebird');var rs=require(_0x7cbc('0x3'));var fs=require('fs');var Redis=require(_0x7cbc('0x4'));var db=require(_0x7cbc('0x5'))['db'];var utils=require(_0x7cbc('0x6'));var logger=require(_0x7cbc('0x7'))(_0x7cbc('0x8'));var config=require(_0x7cbc('0x9'));var jayson=require(_0x7cbc('0xa'));var client=jayson[_0x7cbc('0xb')][_0x7cbc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5aeca6,_0x52c12f,_0x37a364){return new BPromise(function(_0x4dfb55,_0x44c062){return client['request'](_0x5aeca6,_0x37a364)[_0x7cbc('0xd')](function(_0x21fd62){logger[_0x7cbc('0xe')](_0x7cbc('0xf'),_0x52c12f,_0x7cbc('0x10'));logger[_0x7cbc('0x11')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x52c12f,_0x7cbc('0x10'),JSON[_0x7cbc('0x12')](_0x21fd62));if(_0x21fd62[_0x7cbc('0x13')]){if(_0x21fd62['error'][_0x7cbc('0x14')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x52c12f,_0x21fd62[_0x7cbc('0x13')][_0x7cbc('0x15')]);return _0x44c062(_0x21fd62[_0x7cbc('0x13')][_0x7cbc('0x15')]);}logger[_0x7cbc('0x13')](_0x7cbc('0xf'),_0x52c12f,_0x21fd62['error'][_0x7cbc('0x15')]);return _0x4dfb55(_0x21fd62[_0x7cbc('0x13')][_0x7cbc('0x15')]);}else{logger[_0x7cbc('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x52c12f,_0x7cbc('0x10'));_0x4dfb55(_0x21fd62['result']['message']);}})[_0x7cbc('0x16')](function(_0x4f4973){logger[_0x7cbc('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x52c12f,_0x4f4973);_0x44c062(_0x4f4973);});});} \ No newline at end of file +var _0xf6bc=['request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0xf6bc,0x14c));var _0xcf6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf6b('0x0'));var util=require(_0xcf6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcf6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf6b('0x3'))['db'];var utils=require(_0xcf6b('0x4'));var logger=require(_0xcf6b('0x5'))(_0xcf6b('0x6'));var config=require(_0xcf6b('0x7'));var jayson=require(_0xcf6b('0x8'));var client=jayson[_0xcf6b('0x9')][_0xcf6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e7f13,_0x1f1422,_0x2fd0c3){return new BPromise(function(_0x2c8086,_0x2a5aa6){return client[_0xcf6b('0xb')](_0x2e7f13,_0x2fd0c3)[_0xcf6b('0xc')](function(_0x49fe21){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1f1422,_0xcf6b('0xd'));logger[_0xcf6b('0xe')](_0xcf6b('0xf'),_0x1f1422,_0xcf6b('0xd'),JSON[_0xcf6b('0x10')](_0x49fe21));if(_0x49fe21['error']){if(_0x49fe21[_0xcf6b('0x11')]['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1f1422,_0x49fe21[_0xcf6b('0x11')][_0xcf6b('0x12')]);return _0x2a5aa6(_0x49fe21[_0xcf6b('0x11')][_0xcf6b('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1f1422,_0x49fe21[_0xcf6b('0x11')][_0xcf6b('0x12')]);return _0x2c8086(_0x49fe21[_0xcf6b('0x11')][_0xcf6b('0x12')]);}else{logger[_0xcf6b('0x13')](_0xcf6b('0x14'),_0x1f1422,_0xcf6b('0xd'));_0x2c8086(_0x49fe21[_0xcf6b('0x15')][_0xcf6b('0x12')]);}})[_0xcf6b('0x16')](function(_0x2fee72){logger[_0xcf6b('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1f1422,_0x2fee72);_0x2a5aa6(_0x2fee72);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 01e580b..f75e116 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 _0xd243=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x30b22d,_0x47ea84){var _0xe8b1d7=function(_0x1241ad){while(--_0x1241ad){_0x30b22d['push'](_0x30b22d['shift']());}};_0xe8b1d7(++_0x47ea84);}(_0xd243,0xaa));var _0x3d24=function(_0x108510,_0x3fd9fc){_0x108510=_0x108510-0x0;var _0x20baa9=_0xd243[_0x108510];return _0x20baa9;};'use strict';var multer=require(_0x3d24('0x0'));var util=require('util');var path=require(_0x3d24('0x1'));var timeout=require(_0x3d24('0x2'));var express=require(_0x3d24('0x3'));var router=express[_0x3d24('0x4')]();var fs_extra=require(_0x3d24('0x5'));var auth=require(_0x3d24('0x6'));var interaction=require(_0x3d24('0x7'));var config=require(_0x3d24('0x8'));var controller=require(_0x3d24('0x9'));router['get']('/',auth[_0x3d24('0xa')](),controller['index']);router[_0x3d24('0xb')](_0x3d24('0xc'),auth[_0x3d24('0xa')](),controller[_0x3d24('0xd')]);router[_0x3d24('0xb')](_0x3d24('0xe'),auth['isAuthenticated'](),controller[_0x3d24('0xf')]);router[_0x3d24('0xb')](_0x3d24('0x10'),auth['isAuthenticated'](),controller[_0x3d24('0x11')]);router[_0x3d24('0x12')]('/',auth[_0x3d24('0xa')](),controller['create']);router[_0x3d24('0x12')](_0x3d24('0xe'),auth[_0x3d24('0xa')](),controller[_0x3d24('0x13')]);router[_0x3d24('0x14')](_0x3d24('0xc'),auth[_0x3d24('0xa')](),controller[_0x3d24('0x15')]);router[_0x3d24('0x16')]('/:id',auth[_0x3d24('0xa')](),controller[_0x3d24('0x17')]);module[_0x3d24('0x18')]=router; \ No newline at end of file +var _0xb07f=['./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b0dd2,_0x4bed26){var _0x84b7db=function(_0x10798d){while(--_0x10798d){_0x1b0dd2['push'](_0x1b0dd2['shift']());}};_0x84b7db(++_0x4bed26);}(_0xb07f,0x109));var _0xfb07=function(_0x3ef613,_0x200282){_0x3ef613=_0x3ef613-0x0;var _0x5aa0cd=_0xb07f[_0x3ef613];return _0x5aa0cd;};'use strict';var multer=require(_0xfb07('0x0'));var util=require(_0xfb07('0x1'));var path=require(_0xfb07('0x2'));var timeout=require(_0xfb07('0x3'));var express=require(_0xfb07('0x4'));var router=express[_0xfb07('0x5')]();var fs_extra=require(_0xfb07('0x6'));var auth=require(_0xfb07('0x7'));var interaction=require(_0xfb07('0x8'));var config=require(_0xfb07('0x9'));var controller=require(_0xfb07('0xa'));router['get']('/',auth[_0xfb07('0xb')](),controller[_0xfb07('0xc')]);router[_0xfb07('0xd')](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0xf')]);router[_0xfb07('0xd')](_0xfb07('0x10'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x11')]);router[_0xfb07('0xd')](_0xfb07('0x12'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xfb07('0xb')](),controller[_0xfb07('0x13')]);router['post'](_0xfb07('0x10'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x14')]);router[_0xfb07('0x15')](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x16')]);router['delete'](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x17')]);module[_0xfb07('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index b228b5e..a7749cc 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 _0xe664=['STRING','HelpDesk','sequelize','exports'];(function(_0x4c46be,_0x2ddbe5){var _0x20c000=function(_0x3d8589){while(--_0x3d8589){_0x4c46be['push'](_0x4c46be['shift']());}};_0x20c000(++_0x2ddbe5);}(_0xe664,0x12e));var _0x4e66=function(_0x338435,_0x36604a){_0x338435=_0x338435-0x0;var _0x1131c4=_0xe664[_0x338435];return _0x1131c4;};'use strict';var Sequelize=require(_0x4e66('0x0'));module[_0x4e66('0x1')]={'name':{'type':Sequelize[_0x4e66('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4e66('0x2')]},'username':{'type':Sequelize[_0x4e66('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4e66('0x2')],'allowNull':![],'defaultValue':_0x4e66('0x3')},'remoteUri':{'type':Sequelize[_0x4e66('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4e66('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x4e66('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3e8d=['STRING','HelpDesk','sequelize','exports'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0x3e8d,0xca));var _0xd3e8=function(_0x41ce8e,_0x35b433){_0x41ce8e=_0x41ce8e-0x0;var _0x2aa1d2=_0x3e8d[_0x41ce8e];return _0x2aa1d2;};'use strict';var Sequelize=require(_0xd3e8('0x0'));module[_0xd3e8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd3e8('0x2')]},'username':{'type':Sequelize[_0xd3e8('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd3e8('0x2')],'allowNull':![],'defaultValue':_0xd3e8('0x3')},'remoteUri':{'type':Sequelize[_0xd3e8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd3e8('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xd3e8('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 40756bb..d5e3e0f 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 _0xd069=['sort','where','pick','VIRTUAL','options','VtigerAccount','then','includeAll','include','findAll','catch','show','params','length','merge','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','filter','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','lastIndexOf','%s/webservice.php','GET','getchallenge','POST','result','token','describe','sessionName','success','autogenerated','reference','includes','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','attributes','fields','query','nolimit','order'];(function(_0xa8171a,_0x594844){var _0x346ac3=function(_0x28248c){while(--_0x28248c){_0xa8171a['push'](_0xa8171a['shift']());}};_0x346ac3(++_0x594844);}(_0xd069,0x13c));var _0x9d06=function(_0x1e65f8,_0x16bea1){_0x1e65f8=_0x1e65f8-0x0;var _0x252c63=_0xd069[_0x1e65f8];return _0x252c63;};'use strict';var emlformat=require(_0x9d06('0x0'));var rimraf=require(_0x9d06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d06('0x2'));var moment=require('moment');var BPromise=require(_0x9d06('0x3'));var Mustache=require(_0x9d06('0x4'));var util=require(_0x9d06('0x5'));var path=require(_0x9d06('0x6'));var sox=require(_0x9d06('0x7'));var csv=require(_0x9d06('0x8'));var ejs=require(_0x9d06('0x9'));var fs=require('fs');var fs_extra=require(_0x9d06('0xa'));var _=require(_0x9d06('0xb'));var squel=require(_0x9d06('0xc'));var crypto=require(_0x9d06('0xd'));var jsforce=require(_0x9d06('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9d06('0x8'));var querystring=require(_0x9d06('0xf'));var Papa=require(_0x9d06('0x10'));var Redis=require('ioredis');var authService=require(_0x9d06('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9d06('0x12'));var hardwareService=require(_0x9d06('0x13'));var logger=require(_0x9d06('0x14'))(_0x9d06('0x15'));var utils=require(_0x9d06('0x16'));var config=require(_0x9d06('0x17'));var licenseUtil=require(_0x9d06('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9d06('0x19'));function respondWithStatusCode(_0x551c75,_0x269d98){_0x269d98=_0x269d98||0xcc;return function(_0x3db493){if(_0x3db493){return _0x551c75[_0x9d06('0x1a')](_0x269d98);}return _0x551c75[_0x9d06('0x1b')](_0x269d98)[_0x9d06('0x1c')]();};}function respondWithResult(_0x217935,_0x1b29e3){_0x1b29e3=_0x1b29e3||0xc8;return function(_0x6be661){if(_0x6be661){return _0x217935[_0x9d06('0x1b')](_0x1b29e3)[_0x9d06('0x1d')](_0x6be661);}};}function respondWithFilteredResult(_0xe0ff79,_0x32a116){return function(_0x50cd7b){if(_0x50cd7b){var _0xc43642=typeof _0x32a116[_0x9d06('0x1e')]===_0x9d06('0x1f')&&typeof _0x32a116[_0x9d06('0x20')]===_0x9d06('0x1f');var _0x175c3e=_0x50cd7b[_0x9d06('0x21')];var _0x3217c4=_0xc43642?0x0:_0x32a116[_0x9d06('0x1e')];var _0x5885ce=_0xc43642?_0x50cd7b['count']:_0x32a116[_0x9d06('0x1e')]+_0x32a116['limit'];var _0x40fd6a;if(_0x5885ce>=_0x175c3e){_0x5885ce=_0x175c3e;_0x40fd6a=0xc8;}else{_0x40fd6a=0xce;}_0xe0ff79['status'](_0x40fd6a);return _0xe0ff79[_0x9d06('0x22')](_0x9d06('0x23'),_0x3217c4+'-'+_0x5885ce+'/'+_0x175c3e)[_0x9d06('0x1d')](_0x50cd7b);}return null;};}function patchUpdates(_0x4d8b25){return function(_0x39c59d){try{jsonpatch[_0x9d06('0x24')](_0x39c59d,_0x4d8b25,!![]);}catch(_0x44c80f){return BPromise[_0x9d06('0x25')](_0x44c80f);}return _0x39c59d[_0x9d06('0x26')]();};}function saveUpdates(_0x1dd44e,_0x2199f3){return function(_0x4cddff){if(_0x4cddff){return _0x4cddff[_0x9d06('0x27')](_0x1dd44e)['then'](function(_0x2fdb57){return _0x2fdb57;});}return null;};}function removeEntity(_0x5826a9,_0x51cd4d){return function(_0x53a646){if(_0x53a646){return _0x53a646['destroy']()['then'](function(){_0x5826a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xde9832,_0x42a754){return function(_0x260285){if(!_0x260285){_0xde9832[_0x9d06('0x1a')](0x194);}return _0x260285;};}function handleError(_0x3e3cf7,_0x76e814){_0x76e814=_0x76e814||0x1f4;return function(_0x1f8793){logger[_0x9d06('0x28')](_0x1f8793[_0x9d06('0x29')]);if(_0x1f8793[_0x9d06('0x2a')]){delete _0x1f8793[_0x9d06('0x2a')];}_0x3e3cf7['status'](_0x76e814)[_0x9d06('0x2b')](_0x1f8793);};}exports[_0x9d06('0x2c')]=function(_0x44d0ce,_0xb72a82){var _0x4d0237={},_0xead242={},_0x4ac128={'count':0x0,'rows':[]};var _0x566071=_[_0x9d06('0x2d')](db['VtigerAccount'][_0x9d06('0x2e')],function(_0x5eb1a6){return{'name':_0x5eb1a6[_0x9d06('0x2f')],'type':_0x5eb1a6[_0x9d06('0x30')][_0x9d06('0x31')]};});_0xead242['model']=_[_0x9d06('0x2d')](_0x566071,_0x9d06('0x2a'));_0xead242['query']=_[_0x9d06('0x32')](_0x44d0ce['query']);_0xead242[_0x9d06('0x33')]=_[_0x9d06('0x34')](_0xead242[_0x9d06('0x35')],_0xead242['query']);_0x4d0237[_0x9d06('0x36')]=_['intersection'](_0xead242[_0x9d06('0x35')],qs[_0x9d06('0x37')](_0x44d0ce[_0x9d06('0x38')]['fields']));_0x4d0237[_0x9d06('0x36')]=_0x4d0237[_0x9d06('0x36')]['length']?_0x4d0237[_0x9d06('0x36')]:_0xead242[_0x9d06('0x35')];if(!_0x44d0ce[_0x9d06('0x38')]['hasOwnProperty'](_0x9d06('0x39'))){_0x4d0237[_0x9d06('0x20')]=qs[_0x9d06('0x20')](_0x44d0ce[_0x9d06('0x38')][_0x9d06('0x20')]);_0x4d0237['offset']=qs[_0x9d06('0x1e')](_0x44d0ce['query']['offset']);}_0x4d0237[_0x9d06('0x3a')]=qs[_0x9d06('0x3b')](_0x44d0ce[_0x9d06('0x38')][_0x9d06('0x3b')]);_0x4d0237[_0x9d06('0x3c')]=qs[_0x9d06('0x33')](_[_0x9d06('0x3d')](_0x44d0ce[_0x9d06('0x38')],_0xead242['filters']),_0x566071);if(_0x44d0ce['query']['filter']){_0x4d0237['where']=_['merge'](_0x4d0237[_0x9d06('0x3c')],{'$or':_[_0x9d06('0x2d')](_0x566071,function(_0x560ae5){if(_0x560ae5[_0x9d06('0x30')]!==_0x9d06('0x3e')){var _0xbfa566={};_0xbfa566[_0x560ae5[_0x9d06('0x2a')]]={'$like':'%'+_0x44d0ce[_0x9d06('0x38')]['filter']+'%'};return _0xbfa566;}})});}_0x4d0237=_['merge']({},_0x4d0237,_0x44d0ce[_0x9d06('0x3f')]);var _0x4c0f12={'where':_0x4d0237[_0x9d06('0x3c')]};return db[_0x9d06('0x40')]['count'](_0x4c0f12)[_0x9d06('0x41')](function(_0xd424f0){_0x4ac128[_0x9d06('0x21')]=_0xd424f0;if(_0x44d0ce[_0x9d06('0x38')][_0x9d06('0x42')]){_0x4d0237[_0x9d06('0x43')]=[{'all':!![]}];}return db['VtigerAccount'][_0x9d06('0x44')](_0x4d0237);})['then'](function(_0x20e03e){_0x4ac128['rows']=_0x20e03e;return _0x4ac128;})[_0x9d06('0x41')](respondWithFilteredResult(_0xb72a82,_0x4d0237))[_0x9d06('0x45')](handleError(_0xb72a82,null));};exports[_0x9d06('0x46')]=function(_0xdda698,_0x2542e1){var _0x21cf76={'raw':![],'where':{'id':_0xdda698[_0x9d06('0x47')]['id']}},_0x5dbf1d={};_0x5dbf1d[_0x9d06('0x35')]=_[_0x9d06('0x32')](db[_0x9d06('0x40')][_0x9d06('0x2e')]);_0x5dbf1d['query']=_[_0x9d06('0x32')](_0xdda698[_0x9d06('0x38')]);_0x5dbf1d['filters']=_[_0x9d06('0x34')](_0x5dbf1d[_0x9d06('0x35')],_0x5dbf1d['query']);_0x21cf76['attributes']=_[_0x9d06('0x34')](_0x5dbf1d['model'],qs[_0x9d06('0x37')](_0xdda698[_0x9d06('0x38')]['fields']));_0x21cf76[_0x9d06('0x36')]=_0x21cf76[_0x9d06('0x36')][_0x9d06('0x48')]?_0x21cf76[_0x9d06('0x36')]:_0x5dbf1d[_0x9d06('0x35')];if(_0xdda698[_0x9d06('0x38')]['includeAll']){_0x21cf76['include']=[{'all':!![]}];}_0x21cf76=_[_0x9d06('0x49')]({},_0x21cf76,_0xdda698[_0x9d06('0x3f')]);return db[_0x9d06('0x40')][_0x9d06('0x4a')](_0x21cf76)[_0x9d06('0x41')](handleEntityNotFound(_0x2542e1,null))[_0x9d06('0x41')](respondWithResult(_0x2542e1,null))[_0x9d06('0x45')](handleError(_0x2542e1,null));};exports['create']=function(_0x205758,_0x470af7){return db['VtigerAccount'][_0x9d06('0x4b')](_0x205758[_0x9d06('0x4c')],{})[_0x9d06('0x41')](respondWithResult(_0x470af7,0xc9))[_0x9d06('0x45')](handleError(_0x470af7,null));};exports[_0x9d06('0x27')]=function(_0x345d2a,_0x397754){if(_0x345d2a[_0x9d06('0x4c')]['id']){delete _0x345d2a[_0x9d06('0x4c')]['id'];}return db['VtigerAccount'][_0x9d06('0x4a')]({'where':{'id':_0x345d2a[_0x9d06('0x47')]['id']}})[_0x9d06('0x41')](handleEntityNotFound(_0x397754,null))[_0x9d06('0x41')](saveUpdates(_0x345d2a[_0x9d06('0x4c')],null))['then'](respondWithResult(_0x397754,null))[_0x9d06('0x45')](handleError(_0x397754,null));};exports[_0x9d06('0x4d')]=function(_0x5e34a9,_0x175afa){return db[_0x9d06('0x40')][_0x9d06('0x4a')]({'where':{'id':_0x5e34a9['params']['id']}})[_0x9d06('0x41')](handleEntityNotFound(_0x175afa,null))['then'](removeEntity(_0x175afa,null))[_0x9d06('0x45')](handleError(_0x175afa,null));};exports[_0x9d06('0x4e')]=function(_0x331ef1,_0x285101,_0x53cc2e){var _0x6a932b={};var _0x736485={};var _0x1f09f6;var _0x2c9204;return db[_0x9d06('0x40')][_0x9d06('0x4f')]({'where':{'id':_0x331ef1[_0x9d06('0x47')]['id']}})[_0x9d06('0x41')](handleEntityNotFound(_0x285101,null))['then'](function(_0x4eabdf){if(_0x4eabdf){_0x1f09f6=_0x4eabdf;_0x736485[_0x9d06('0x35')]=_[_0x9d06('0x32')](db[_0x9d06('0x50')][_0x9d06('0x2e')]);_0x736485[_0x9d06('0x38')]=_[_0x9d06('0x32')](_0x331ef1[_0x9d06('0x38')]);_0x736485[_0x9d06('0x33')]=_[_0x9d06('0x34')](_0x736485['model'],_0x736485[_0x9d06('0x38')]);_0x6a932b['attributes']=_['intersection'](_0x736485['model'],qs[_0x9d06('0x37')](_0x331ef1[_0x9d06('0x38')][_0x9d06('0x37')]));_0x6a932b['attributes']=_0x6a932b[_0x9d06('0x36')][_0x9d06('0x48')]?_0x6a932b[_0x9d06('0x36')]:_0x736485[_0x9d06('0x35')];_0x6a932b[_0x9d06('0x3a')]=qs[_0x9d06('0x3b')](_0x331ef1[_0x9d06('0x38')]['sort']);_0x6a932b['where']=qs[_0x9d06('0x33')](_[_0x9d06('0x3d')](_0x331ef1[_0x9d06('0x38')],_0x736485[_0x9d06('0x33')]));if(_0x331ef1[_0x9d06('0x38')][_0x9d06('0x51')]){_0x6a932b[_0x9d06('0x3c')]=_[_0x9d06('0x49')](_0x6a932b[_0x9d06('0x3c')],{'$or':_[_0x9d06('0x2d')](_0x6a932b[_0x9d06('0x36')],function(_0xf27e30){var _0x42ba2f={};_0x42ba2f[_0xf27e30]={'$like':'%'+_0x331ef1[_0x9d06('0x38')][_0x9d06('0x51')]+'%'};return _0x42ba2f;})});}_0x6a932b=_[_0x9d06('0x49')]({},_0x6a932b,_0x331ef1['options']);return _0x1f09f6[_0x9d06('0x4e')](_0x6a932b);}})[_0x9d06('0x41')](function(_0x641fc){if(_0x641fc){_0x2c9204=_0x641fc[_0x9d06('0x48')];if(!_0x331ef1[_0x9d06('0x38')][_0x9d06('0x52')]('nolimit')){_0x6a932b[_0x9d06('0x20')]=qs['limit'](_0x331ef1['query'][_0x9d06('0x20')]);_0x6a932b[_0x9d06('0x1e')]=qs[_0x9d06('0x1e')](_0x331ef1['query'][_0x9d06('0x1e')]);}return _0x1f09f6[_0x9d06('0x4e')](_0x6a932b);}})['then'](function(_0x2f78f0){if(_0x2f78f0){return _0x2f78f0?{'count':_0x2c9204,'rows':_0x2f78f0}:null;}})['then'](respondWithResult(_0x285101,null))['catch'](handleError(_0x285101,null));};exports[_0x9d06('0x53')]=function(_0x4a249a,_0x1a9453,_0x366ebc){if(_0x4a249a[_0x9d06('0x4c')]['id']){delete _0x4a249a[_0x9d06('0x4c')]['id'];}return db[_0x9d06('0x40')][_0x9d06('0x4f')]({'where':{'id':_0x4a249a[_0x9d06('0x47')]['id']}})[_0x9d06('0x41')](handleEntityNotFound(_0x1a9453,null))[_0x9d06('0x41')](function(_0x189d70){if(_0x189d70){_0x4a249a[_0x9d06('0x4c')]['AccountId']=_0x189d70['id'];_0x4a249a[_0x9d06('0x4c')][_0x9d06('0x54')]=integrations[_0x9d06('0x55')](_0x4a249a[_0x9d06('0x4c')][_0x9d06('0x56')],_0x4a249a[_0x9d06('0x4c')]['type']);_0x4a249a[_0x9d06('0x4c')][_0x9d06('0x57')]=integrations['getDescriptions'](_0x4a249a[_0x9d06('0x4c')][_0x9d06('0x56')],_0x4a249a[_0x9d06('0x4c')][_0x9d06('0x30')]);return db[_0x9d06('0x50')][_0x9d06('0x4b')](_0x4a249a[_0x9d06('0x4c')],{'include':[{'model':db[_0x9d06('0x58')],'as':'Subjects'},{'model':db[_0x9d06('0x58')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1a9453,null))['catch'](handleError(_0x1a9453,null));};var md5=require(_0x9d06('0x59'));exports[_0x9d06('0x5a')]=function(_0x2ad679,_0x274687,_0x3f6b62){var _0x2e0b28=null;var _0x530b5=null;var _0x2bee14=null;var _0x125456=null;var _0x4c114c='';return db[_0x9d06('0x40')]['findOne']({'where':{'id':_0x2ad679[_0x9d06('0x47')]['id']},'attributes':['id',_0x9d06('0x2a'),_0x9d06('0x5b'),_0x9d06('0x5c'),'moduleName',_0x9d06('0x5d'),_0x9d06('0x5e'),_0x9d06('0x5f')]})['then'](handleEntityNotFound(_0x274687,null))[_0x9d06('0x41')](function(_0x5a9700){if(_0x5a9700){_0x2e0b28=_0x5a9700[_0x9d06('0x5b')];_0x530b5=_0x5a9700[_0x9d06('0x5f')];_0x2bee14=_0x5a9700[_0x9d06('0x60')];_0x4c114c=_0x5a9700['remoteUri'];var _0x14e924=_0x4c114c['slice'](-0x1);if(_0x14e924==='/'){_0x4c114c=_0x4c114c['substring'](0x0,_0x4c114c[_0x9d06('0x61')](_0x14e924));}_0x125456=util['format'](_0x9d06('0x62'),_0x4c114c);var _0x5f044b={'method':_0x9d06('0x63'),'uri':_0x125456,'qs':{'operation':_0x9d06('0x64'),'username':_0x5a9700[_0x9d06('0x5b')]},'json':!![]};return rp(_0x5f044b);}})[_0x9d06('0x41')](function(_0x5eb781){if(_0x5eb781['success']){var _0x497963={'method':_0x9d06('0x65'),'uri':_0x125456,'form':{'operation':'login','username':_0x2e0b28,'accessKey':md5(_0x5eb781[_0x9d06('0x66')][_0x9d06('0x67')]+_0x530b5)},'json':!![]};return rp(_0x497963);}})[_0x9d06('0x41')](function(_0x1ecb93){if(_0x1ecb93['success']){var _0x33bc64={'method':_0x9d06('0x63'),'uri':_0x125456,'qs':{'operation':_0x9d06('0x68'),'username':_0x2e0b28,'sessionName':_0x1ecb93[_0x9d06('0x66')][_0x9d06('0x69')],'elementType':_0x2bee14},'json':!![]};return rp(_0x33bc64);}})[_0x9d06('0x41')](function(_0x370b78){if(_0x370b78[_0x9d06('0x6a')]){var _0x5ae02c=[_0x9d06('0x6b'),_0x9d06('0x6c'),'owner'];_['remove'](_0x370b78[_0x9d06('0x66')][_0x9d06('0x37')],function(_0x4d36d0){return _0x5ae02c[_0x9d06('0x6d')](_0x4d36d0[_0x9d06('0x30')]['name']);});_[_0x9d06('0x6e')](_0x370b78[_0x9d06('0x66')]['fields'],function(_0x172926){return _0x172926[_0x9d06('0x6f')]===_0x9d06('0x70');});return{'count':_0x370b78[_0x9d06('0x66')][_0x9d06('0x37')][_0x9d06('0x48')],'rows':_[_0x9d06('0x2d')](_0x370b78[_0x9d06('0x66')][_0x9d06('0x37')],function(_0xa0eb83){return{'id':_0xa0eb83[_0x9d06('0x2a')],'name':_0xa0eb83[_0x9d06('0x71')],'custom':_[_0x9d06('0x72')](_0xa0eb83['name'],_0x9d06('0x73'))?!![]:![],'options':_0xa0eb83[_0x9d06('0x30')][_0x9d06('0x2a')]===_0x9d06('0x74')&&_0xa0eb83[_0x9d06('0x30')][_0x9d06('0x75')][_0x9d06('0x48')]>0x0?_[_0x9d06('0x2d')](_0xa0eb83[_0x9d06('0x30')][_0x9d06('0x75')],function(_0x4c8093){return{'name':_0x4c8093[_0x9d06('0x71')],'value':_0x4c8093[_0x9d06('0x76')]};}):[]};})};}})[_0x9d06('0x41')](respondWithResult(_0x274687,null))[_0x9d06('0x45')](function(_0xfce6c1){console['log'](_0x9d06('0x77')+_0xfce6c1);var _0xac39de=_0x2ad679['query'][_0x9d06('0x78')]?0x1f4:_0xfce6c1[_0x9d06('0x79')]||0x1f4;logger[_0x9d06('0x28')](_0x9d06('0x7a'),'getFields',_0xac39de,JSON[_0x9d06('0x7b')](_0xfce6c1));delete _0xfce6c1[_0x9d06('0x2a')];if(_0xac39de===0x191){_0xac39de=0x190;}_0x274687[_0x9d06('0x1b')](_0xac39de)['send'](_0x2ad679[_0x9d06('0x38')]['test']?{'message':_0x9d06('0x7c'),'statusCode':_0xfce6c1['statusCode']}:_0xfce6c1);});}; \ No newline at end of file +var _0x8bfb=['remoteUri','accessKey','slice','substring','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','owner','remove','result','includes','editable','label','startsWith','cf_','picklistValues','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','end','error','stack','name','map','VtigerAccount','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','VtigerField','Descriptions','getFields','username'];(function(_0x19b4aa,_0x3353be){var _0x40479e=function(_0xba7e20){while(--_0xba7e20){_0x19b4aa['push'](_0x19b4aa['shift']());}};_0x40479e(++_0x3353be);}(_0x8bfb,0x95));var _0xb8bf=function(_0x219597,_0x225bba){_0x219597=_0x219597-0x0;var _0x3fd8f2=_0x8bfb[_0x219597];return _0x3fd8f2;};'use strict';var emlformat=require(_0xb8bf('0x0'));var rimraf=require(_0xb8bf('0x1'));var zipdir=require(_0xb8bf('0x2'));var jsonpatch=require(_0xb8bf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8bf('0x4'));var util=require(_0xb8bf('0x5'));var path=require(_0xb8bf('0x6'));var sox=require(_0xb8bf('0x7'));var csv=require(_0xb8bf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8bf('0x9'));var squel=require('squel');var crypto=require(_0xb8bf('0xa'));var jsforce=require(_0xb8bf('0xb'));var deskjs=require(_0xb8bf('0xc'));var toCsv=require(_0xb8bf('0x8'));var querystring=require(_0xb8bf('0xd'));var Papa=require(_0xb8bf('0xe'));var Redis=require(_0xb8bf('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8bf('0x10'));var as=require(_0xb8bf('0x11'));var hardwareService=require(_0xb8bf('0x12'));var logger=require(_0xb8bf('0x13'))(_0xb8bf('0x14'));var utils=require(_0xb8bf('0x15'));var config=require(_0xb8bf('0x16'));var licenseUtil=require(_0xb8bf('0x17'));var db=require(_0xb8bf('0x18'))['db'];var integrations=require(_0xb8bf('0x19'));function respondWithStatusCode(_0x13d37b,_0x445059){_0x445059=_0x445059||0xcc;return function(_0x2b4c33){if(_0x2b4c33){return _0x13d37b['sendStatus'](_0x445059);}return _0x13d37b['status'](_0x445059)['end']();};}function respondWithResult(_0x5584b7,_0x1d1785){_0x1d1785=_0x1d1785||0xc8;return function(_0x579aee){if(_0x579aee){return _0x5584b7[_0xb8bf('0x1a')](_0x1d1785)[_0xb8bf('0x1b')](_0x579aee);}};}function respondWithFilteredResult(_0x5a2e48,_0x26c775){return function(_0x97eca5){if(_0x97eca5){var _0x54daca=typeof _0x26c775[_0xb8bf('0x1c')]===_0xb8bf('0x1d')&&typeof _0x26c775['limit']===_0xb8bf('0x1d');var _0x10970f=_0x97eca5[_0xb8bf('0x1e')];var _0x366803=_0x54daca?0x0:_0x26c775[_0xb8bf('0x1c')];var _0xf3daad=_0x54daca?_0x97eca5[_0xb8bf('0x1e')]:_0x26c775[_0xb8bf('0x1c')]+_0x26c775['limit'];var _0x57d44b;if(_0xf3daad>=_0x10970f){_0xf3daad=_0x10970f;_0x57d44b=0xc8;}else{_0x57d44b=0xce;}_0x5a2e48[_0xb8bf('0x1a')](_0x57d44b);return _0x5a2e48[_0xb8bf('0x1f')](_0xb8bf('0x20'),_0x366803+'-'+_0xf3daad+'/'+_0x10970f)[_0xb8bf('0x1b')](_0x97eca5);}return null;};}function patchUpdates(_0x1a6f2e){return function(_0x4affd3){try{jsonpatch['apply'](_0x4affd3,_0x1a6f2e,!![]);}catch(_0x18068a){return BPromise[_0xb8bf('0x21')](_0x18068a);}return _0x4affd3[_0xb8bf('0x22')]();};}function saveUpdates(_0x61efc8,_0x19ae1e){return function(_0x59623e){if(_0x59623e){return _0x59623e['update'](_0x61efc8)[_0xb8bf('0x23')](function(_0x53d58f){return _0x53d58f;});}return null;};}function removeEntity(_0x56920a,_0x53d58d){return function(_0x5141d0){if(_0x5141d0){return _0x5141d0[_0xb8bf('0x24')]()['then'](function(){_0x56920a[_0xb8bf('0x1a')](0xcc)[_0xb8bf('0x25')]();});}};}function handleEntityNotFound(_0x7bbb3a,_0x18e625){return function(_0x5dd1d4){if(!_0x5dd1d4){_0x7bbb3a['sendStatus'](0x194);}return _0x5dd1d4;};}function handleError(_0x31eb4b,_0x9368c4){_0x9368c4=_0x9368c4||0x1f4;return function(_0x343414){logger[_0xb8bf('0x26')](_0x343414[_0xb8bf('0x27')]);if(_0x343414[_0xb8bf('0x28')]){delete _0x343414['name'];}_0x31eb4b['status'](_0x9368c4)['send'](_0x343414);};}exports['index']=function(_0x172725,_0x32c1c6){var _0xe08083={},_0xbbc940={},_0x50a193={'count':0x0,'rows':[]};var _0x1b1afe=_[_0xb8bf('0x29')](db[_0xb8bf('0x2a')]['rawAttributes'],function(_0x505fb6){return{'name':_0x505fb6['fieldName'],'type':_0x505fb6[_0xb8bf('0x2b')][_0xb8bf('0x2c')]};});_0xbbc940['model']=_[_0xb8bf('0x29')](_0x1b1afe,_0xb8bf('0x28'));_0xbbc940['query']=_[_0xb8bf('0x2d')](_0x172725[_0xb8bf('0x2e')]);_0xbbc940[_0xb8bf('0x2f')]=_['intersection'](_0xbbc940['model'],_0xbbc940[_0xb8bf('0x2e')]);_0xe08083['attributes']=_[_0xb8bf('0x30')](_0xbbc940[_0xb8bf('0x31')],qs[_0xb8bf('0x32')](_0x172725[_0xb8bf('0x2e')][_0xb8bf('0x32')]));_0xe08083[_0xb8bf('0x33')]=_0xe08083[_0xb8bf('0x33')][_0xb8bf('0x34')]?_0xe08083[_0xb8bf('0x33')]:_0xbbc940['model'];if(!_0x172725[_0xb8bf('0x2e')][_0xb8bf('0x35')](_0xb8bf('0x36'))){_0xe08083[_0xb8bf('0x37')]=qs[_0xb8bf('0x37')](_0x172725[_0xb8bf('0x2e')][_0xb8bf('0x37')]);_0xe08083['offset']=qs[_0xb8bf('0x1c')](_0x172725[_0xb8bf('0x2e')]['offset']);}_0xe08083[_0xb8bf('0x38')]=qs[_0xb8bf('0x39')](_0x172725[_0xb8bf('0x2e')]['sort']);_0xe08083[_0xb8bf('0x3a')]=qs[_0xb8bf('0x2f')](_['pick'](_0x172725['query'],_0xbbc940[_0xb8bf('0x2f')]),_0x1b1afe);if(_0x172725[_0xb8bf('0x2e')][_0xb8bf('0x3b')]){_0xe08083['where']=_[_0xb8bf('0x3c')](_0xe08083['where'],{'$or':_[_0xb8bf('0x29')](_0x1b1afe,function(_0x402fbb){if(_0x402fbb[_0xb8bf('0x2b')]!==_0xb8bf('0x3d')){var _0x2b004e={};_0x2b004e[_0x402fbb[_0xb8bf('0x28')]]={'$like':'%'+_0x172725[_0xb8bf('0x2e')][_0xb8bf('0x3b')]+'%'};return _0x2b004e;}})});}_0xe08083=_[_0xb8bf('0x3c')]({},_0xe08083,_0x172725[_0xb8bf('0x3e')]);var _0x1dda9d={'where':_0xe08083[_0xb8bf('0x3a')]};return db['VtigerAccount']['count'](_0x1dda9d)['then'](function(_0x5c518a){_0x50a193[_0xb8bf('0x1e')]=_0x5c518a;if(_0x172725[_0xb8bf('0x2e')][_0xb8bf('0x3f')]){_0xe08083[_0xb8bf('0x40')]=[{'all':!![]}];}return db[_0xb8bf('0x2a')][_0xb8bf('0x41')](_0xe08083);})[_0xb8bf('0x23')](function(_0x3cef82){_0x50a193[_0xb8bf('0x42')]=_0x3cef82;return _0x50a193;})[_0xb8bf('0x23')](respondWithFilteredResult(_0x32c1c6,_0xe08083))[_0xb8bf('0x43')](handleError(_0x32c1c6,null));};exports[_0xb8bf('0x44')]=function(_0x378340,_0x2cce9b){var _0x1ff898={'raw':![],'where':{'id':_0x378340[_0xb8bf('0x45')]['id']}},_0x201a0e={};_0x201a0e[_0xb8bf('0x31')]=_[_0xb8bf('0x2d')](db[_0xb8bf('0x2a')][_0xb8bf('0x46')]);_0x201a0e[_0xb8bf('0x2e')]=_[_0xb8bf('0x2d')](_0x378340[_0xb8bf('0x2e')]);_0x201a0e[_0xb8bf('0x2f')]=_['intersection'](_0x201a0e['model'],_0x201a0e[_0xb8bf('0x2e')]);_0x1ff898['attributes']=_[_0xb8bf('0x30')](_0x201a0e[_0xb8bf('0x31')],qs[_0xb8bf('0x32')](_0x378340[_0xb8bf('0x2e')]['fields']));_0x1ff898[_0xb8bf('0x33')]=_0x1ff898[_0xb8bf('0x33')]['length']?_0x1ff898[_0xb8bf('0x33')]:_0x201a0e[_0xb8bf('0x31')];if(_0x378340[_0xb8bf('0x2e')]['includeAll']){_0x1ff898['include']=[{'all':!![]}];}_0x1ff898=_[_0xb8bf('0x3c')]({},_0x1ff898,_0x378340[_0xb8bf('0x3e')]);return db['VtigerAccount'][_0xb8bf('0x47')](_0x1ff898)['then'](handleEntityNotFound(_0x2cce9b,null))[_0xb8bf('0x23')](respondWithResult(_0x2cce9b,null))['catch'](handleError(_0x2cce9b,null));};exports[_0xb8bf('0x48')]=function(_0x1ad020,_0x715494){return db['VtigerAccount'][_0xb8bf('0x48')](_0x1ad020[_0xb8bf('0x49')],{})[_0xb8bf('0x23')](respondWithResult(_0x715494,0xc9))[_0xb8bf('0x43')](handleError(_0x715494,null));};exports['update']=function(_0x4d280a,_0x4dfd82){if(_0x4d280a[_0xb8bf('0x49')]['id']){delete _0x4d280a[_0xb8bf('0x49')]['id'];}return db[_0xb8bf('0x2a')][_0xb8bf('0x47')]({'where':{'id':_0x4d280a[_0xb8bf('0x45')]['id']}})[_0xb8bf('0x23')](handleEntityNotFound(_0x4dfd82,null))[_0xb8bf('0x23')](saveUpdates(_0x4d280a[_0xb8bf('0x49')],null))['then'](respondWithResult(_0x4dfd82,null))[_0xb8bf('0x43')](handleError(_0x4dfd82,null));};exports[_0xb8bf('0x24')]=function(_0xd665bf,_0x1bca47){return db['VtigerAccount'][_0xb8bf('0x47')]({'where':{'id':_0xd665bf[_0xb8bf('0x45')]['id']}})[_0xb8bf('0x23')](handleEntityNotFound(_0x1bca47,null))[_0xb8bf('0x23')](removeEntity(_0x1bca47,null))['catch'](handleError(_0x1bca47,null));};exports[_0xb8bf('0x4a')]=function(_0x5cec7e,_0x2e8872,_0x149162){var _0x420f11={};var _0x15ba6d={};var _0x5bddf1;var _0x31e533;return db[_0xb8bf('0x2a')][_0xb8bf('0x4b')]({'where':{'id':_0x5cec7e[_0xb8bf('0x45')]['id']}})[_0xb8bf('0x23')](handleEntityNotFound(_0x2e8872,null))[_0xb8bf('0x23')](function(_0x55a0f1){if(_0x55a0f1){_0x5bddf1=_0x55a0f1;_0x15ba6d[_0xb8bf('0x31')]=_[_0xb8bf('0x2d')](db[_0xb8bf('0x4c')]['rawAttributes']);_0x15ba6d['query']=_[_0xb8bf('0x2d')](_0x5cec7e[_0xb8bf('0x2e')]);_0x15ba6d[_0xb8bf('0x2f')]=_[_0xb8bf('0x30')](_0x15ba6d[_0xb8bf('0x31')],_0x15ba6d[_0xb8bf('0x2e')]);_0x420f11[_0xb8bf('0x33')]=_[_0xb8bf('0x30')](_0x15ba6d[_0xb8bf('0x31')],qs[_0xb8bf('0x32')](_0x5cec7e[_0xb8bf('0x2e')][_0xb8bf('0x32')]));_0x420f11[_0xb8bf('0x33')]=_0x420f11['attributes']['length']?_0x420f11['attributes']:_0x15ba6d[_0xb8bf('0x31')];_0x420f11[_0xb8bf('0x38')]=qs['sort'](_0x5cec7e[_0xb8bf('0x2e')]['sort']);_0x420f11[_0xb8bf('0x3a')]=qs[_0xb8bf('0x2f')](_[_0xb8bf('0x4d')](_0x5cec7e[_0xb8bf('0x2e')],_0x15ba6d[_0xb8bf('0x2f')]));if(_0x5cec7e[_0xb8bf('0x2e')][_0xb8bf('0x3b')]){_0x420f11[_0xb8bf('0x3a')]=_['merge'](_0x420f11[_0xb8bf('0x3a')],{'$or':_[_0xb8bf('0x29')](_0x420f11[_0xb8bf('0x33')],function(_0x38c7f8){var _0x275c32={};_0x275c32[_0x38c7f8]={'$like':'%'+_0x5cec7e[_0xb8bf('0x2e')]['filter']+'%'};return _0x275c32;})});}_0x420f11=_[_0xb8bf('0x3c')]({},_0x420f11,_0x5cec7e[_0xb8bf('0x3e')]);return _0x5bddf1['getConfigurations'](_0x420f11);}})[_0xb8bf('0x23')](function(_0x1c600c){if(_0x1c600c){_0x31e533=_0x1c600c[_0xb8bf('0x34')];if(!_0x5cec7e['query'][_0xb8bf('0x35')](_0xb8bf('0x36'))){_0x420f11[_0xb8bf('0x37')]=qs['limit'](_0x5cec7e[_0xb8bf('0x2e')][_0xb8bf('0x37')]);_0x420f11[_0xb8bf('0x1c')]=qs[_0xb8bf('0x1c')](_0x5cec7e[_0xb8bf('0x2e')][_0xb8bf('0x1c')]);}return _0x5bddf1['getConfigurations'](_0x420f11);}})[_0xb8bf('0x23')](function(_0x339e80){if(_0x339e80){return _0x339e80?{'count':_0x31e533,'rows':_0x339e80}:null;}})[_0xb8bf('0x23')](respondWithResult(_0x2e8872,null))[_0xb8bf('0x43')](handleError(_0x2e8872,null));};exports[_0xb8bf('0x4e')]=function(_0x3c3149,_0x4bea8f,_0x16f474){if(_0x3c3149['body']['id']){delete _0x3c3149[_0xb8bf('0x49')]['id'];}return db[_0xb8bf('0x2a')][_0xb8bf('0x4b')]({'where':{'id':_0x3c3149['params']['id']}})[_0xb8bf('0x23')](handleEntityNotFound(_0x4bea8f,null))['then'](function(_0x2365fa){if(_0x2365fa){_0x3c3149[_0xb8bf('0x49')][_0xb8bf('0x4f')]=_0x2365fa['id'];_0x3c3149[_0xb8bf('0x49')][_0xb8bf('0x50')]=integrations[_0xb8bf('0x51')](_0x3c3149['body'][_0xb8bf('0x52')],_0x3c3149['body']['type']);_0x3c3149[_0xb8bf('0x49')]['Descriptions']=integrations['getDescriptions'](_0x3c3149[_0xb8bf('0x49')]['channel'],_0x3c3149['body'][_0xb8bf('0x2b')]);return db[_0xb8bf('0x4c')][_0xb8bf('0x48')](_0x3c3149[_0xb8bf('0x49')],{'include':[{'model':db[_0xb8bf('0x53')],'as':_0xb8bf('0x50')},{'model':db[_0xb8bf('0x53')],'as':_0xb8bf('0x54')}]});}return null;})['then'](respondWithResult(_0x4bea8f,null))[_0xb8bf('0x43')](handleError(_0x4bea8f,null));};var md5=require('md5');exports[_0xb8bf('0x55')]=function(_0x4f6428,_0x33c03c,_0x1a941c){var _0x2a6b53=null;var _0x38b882=null;var _0x1b8569=null;var _0x50288e=null;var _0x5a74f0='';return db[_0xb8bf('0x2a')][_0xb8bf('0x4b')]({'where':{'id':_0x4f6428[_0xb8bf('0x45')]['id']},'attributes':['id','name',_0xb8bf('0x56'),'description','moduleName',_0xb8bf('0x57'),'serverUrl',_0xb8bf('0x58')]})['then'](handleEntityNotFound(_0x33c03c,null))[_0xb8bf('0x23')](function(_0x2a3154){if(_0x2a3154){_0x2a6b53=_0x2a3154['username'];_0x38b882=_0x2a3154[_0xb8bf('0x58')];_0x1b8569=_0x2a3154['moduleName'];_0x5a74f0=_0x2a3154[_0xb8bf('0x57')];var _0x48f6a9=_0x5a74f0[_0xb8bf('0x59')](-0x1);if(_0x48f6a9==='/'){_0x5a74f0=_0x5a74f0[_0xb8bf('0x5a')](0x0,_0x5a74f0['lastIndexOf'](_0x48f6a9));}_0x50288e=util['format'](_0xb8bf('0x5b'),_0x5a74f0);var _0x598e83={'method':_0xb8bf('0x5c'),'uri':_0x50288e,'qs':{'operation':_0xb8bf('0x5d'),'username':_0x2a3154['username']},'json':!![]};return rp(_0x598e83);}})[_0xb8bf('0x23')](function(_0x495d9b){if(_0x495d9b[_0xb8bf('0x5e')]){var _0x32d96d={'method':_0xb8bf('0x5f'),'uri':_0x50288e,'form':{'operation':_0xb8bf('0x60'),'username':_0x2a6b53,'accessKey':md5(_0x495d9b['result'][_0xb8bf('0x61')]+_0x38b882)},'json':!![]};return rp(_0x32d96d);}})['then'](function(_0x3d74c6){if(_0x3d74c6['success']){var _0x1bc7b1={'method':_0xb8bf('0x5c'),'uri':_0x50288e,'qs':{'operation':_0xb8bf('0x62'),'username':_0x2a6b53,'sessionName':_0x3d74c6['result'][_0xb8bf('0x63')],'elementType':_0x1b8569},'json':!![]};return rp(_0x1bc7b1);}})['then'](function(_0x5863bc){if(_0x5863bc[_0xb8bf('0x5e')]){var _0x2f8cb3=[_0xb8bf('0x64'),'reference',_0xb8bf('0x65')];_[_0xb8bf('0x66')](_0x5863bc[_0xb8bf('0x67')][_0xb8bf('0x32')],function(_0x5b2149){return _0x2f8cb3[_0xb8bf('0x68')](_0x5b2149[_0xb8bf('0x2b')][_0xb8bf('0x28')]);});_[_0xb8bf('0x66')](_0x5863bc[_0xb8bf('0x67')][_0xb8bf('0x32')],function(_0x544d8a){return _0x544d8a[_0xb8bf('0x69')]==='false';});return{'count':_0x5863bc[_0xb8bf('0x67')][_0xb8bf('0x32')][_0xb8bf('0x34')],'rows':_[_0xb8bf('0x29')](_0x5863bc['result'][_0xb8bf('0x32')],function(_0x241daf){return{'id':_0x241daf['name'],'name':_0x241daf[_0xb8bf('0x6a')],'custom':_[_0xb8bf('0x6b')](_0x241daf[_0xb8bf('0x28')],_0xb8bf('0x6c'))?!![]:![],'options':_0x241daf[_0xb8bf('0x2b')]['name']==='picklist'&&_0x241daf[_0xb8bf('0x2b')][_0xb8bf('0x6d')][_0xb8bf('0x34')]>0x0?_[_0xb8bf('0x29')](_0x241daf[_0xb8bf('0x2b')][_0xb8bf('0x6d')],function(_0x5531f7){return{'name':_0x5531f7[_0xb8bf('0x6a')],'value':_0x5531f7['value']};}):[]};})};}})[_0xb8bf('0x23')](respondWithResult(_0x33c03c,null))[_0xb8bf('0x43')](function(_0x3d35bc){console[_0xb8bf('0x6e')](_0xb8bf('0x6f')+_0x3d35bc);var _0x1a1745=_0x4f6428['query']['test']?0x1f4:_0x3d35bc['statusCode']||0x1f4;logger['error'](_0xb8bf('0x70'),'getFields',_0x1a1745,JSON[_0xb8bf('0x71')](_0x3d35bc));delete _0x3d35bc['name'];if(_0x1a1745===0x191){_0x1a1745=0x190;}_0x33c03c[_0xb8bf('0x1a')](_0x1a1745)[_0xb8bf('0x72')](_0x4f6428['query'][_0xb8bf('0x73')]?{'message':_0xb8bf('0x74'),'statusCode':_0x3d35bc[_0xb8bf('0x75')]}:_0x3d35bc);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 1f00517..b00a451 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 _0x414f=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x161b9f,_0x45dd26){var _0xca91b5=function(_0x5be6e4){while(--_0x5be6e4){_0x161b9f['push'](_0x161b9f['shift']());}};_0xca91b5(++_0x45dd26);}(_0x414f,0x13f));var _0xf414=function(_0x121195,_0x2cd8b8){_0x121195=_0x121195-0x0;var _0x363aea=_0x414f[_0x121195];return _0x363aea;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var logger=require(_0xf414('0x1'))(_0xf414('0x2'));var moment=require('moment');var BPromise=require(_0xf414('0x3'));var rp=require(_0xf414('0x4'));var fs=require('fs');var path=require(_0xf414('0x5'));var rimraf=require(_0xf414('0x6'));var config=require(_0xf414('0x7'));var attributes=require(_0xf414('0x8'));var integrations=require(_0xf414('0x9'));module['exports']=function(_0x3be83a,_0x4cdcdb){return _0x3be83a[_0xf414('0xa')](_0xf414('0xb'),attributes,{'tableName':_0xf414('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2efe=['util','api','moment','bluebird','request-promise','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2efe,0x1bb));var _0xe2ef=function(_0x102fd4,_0x28cd7c){_0x102fd4=_0x102fd4-0x0;var _0x5f196e=_0x2efe[_0x102fd4];return _0x5f196e;};'use strict';var _=require(_0xe2ef('0x0'));var util=require(_0xe2ef('0x1'));var logger=require('../../config/logger')(_0xe2ef('0x2'));var moment=require(_0xe2ef('0x3'));var BPromise=require(_0xe2ef('0x4'));var rp=require(_0xe2ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2ef('0x6'));var config=require('../../config/environment');var attributes=require(_0xe2ef('0x7'));var integrations=require(_0xe2ef('0x8'));module['exports']=function(_0x97990d,_0x31f307){return _0x97990d[_0xe2ef('0x9')](_0xe2ef('0xa'),attributes,{'tableName':_0xe2ef('0xb'),'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 f2c10d9..7506a0a 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 _0x9354=['catch','GetVtigerAccount','findAll','options','where','attributes','limit','include','map','model','then','stringify','ShowVtigerAccount','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x2c4c0c,_0x29e0ea){var _0x3542cb=function(_0x4bd06d){while(--_0x4bd06d){_0x2c4c0c['push'](_0x2c4c0c['shift']());}};_0x3542cb(++_0x29e0ea);}(_0x9354,0x96));var _0x4935=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x9354[_0x9fd887];return _0x1a54ab;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e47bd,_0x118d36,_0x2d735e){return new BPromise(function(_0x10793e,_0x4c9902){return client[_0x4935('0xb')](_0x2e47bd,_0x2d735e)['then'](function(_0x2aac9a){logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));logger[_0x4935('0xf')](_0x4935('0x10'),_0x118d36,'request\x20sent',JSON['stringify'](_0x2aac9a));if(_0x2aac9a[_0x4935('0x11')]){if(_0x2aac9a['error']['code']===0x1f4){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x4c9902(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x10793e(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}else{logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));_0x10793e(_0x2aac9a[_0x4935('0x13')]['message']);}})[_0x4935('0x14')](function(_0x46526a){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x46526a);_0x4c9902(_0x46526a);});});}exports[_0x4935('0x15')]=function(_0x429ef3){var _0x4ebc63=this;return new Promise(function(_0xd70eff,_0x145277){return db['VtigerAccount'][_0x4935('0x16')]({'raw':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x18')]||null:null,'attributes':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x19')]||null:null,'limit':_0x429ef3[_0x4935('0x17')]?_0x429ef3[_0x4935('0x17')][_0x4935('0x1a')]||null:null,'include':_0x429ef3['options']?_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x429ef3[_0x4935('0x17')][_0x4935('0x1b')],function(_0x53530f){return{'model':db[_0x53530f['model']],'as':_0x53530f['as'],'attributes':_0x53530f[_0x4935('0x19')],'include':_0x53530f[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x53530f[_0x4935('0x1b')],function(_0x344e51){return{'model':db[_0x344e51[_0x4935('0x1d')]],'as':_0x344e51['as'],'attributes':_0x344e51[_0x4935('0x19')],'include':_0x344e51[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x344e51[_0x4935('0x1b')],function(_0x1d08b5){return{'model':db[_0x1d08b5[_0x4935('0x1d')]],'as':_0x1d08b5['as'],'attributes':_0x1d08b5[_0x4935('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x359522){logger['info']('GetVtigerAccount',_0x429ef3);logger['debug'](_0x4935('0x15'),_0x429ef3,JSON[_0x4935('0x1f')](_0x359522));_0xd70eff(_0x359522);})['catch'](function(_0x3f0707){logger[_0x4935('0x11')](_0x4935('0x15'),_0x3f0707[_0x4935('0x12')],_0x429ef3);_0x145277(_0x4ebc63[_0x4935('0x11')](0x1f4,_0x3f0707[_0x4935('0x12')]));});});};exports[_0x4935('0x20')]=function(_0x2fe6da){var _0x5b3c8e=this;return new Promise(function(_0xb7fe2a,_0x2dcb0b){return db['VtigerAccount']['find']({'raw':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da['options'][_0x4935('0x21')]===undefined?!![]:![]:!![],'where':_0x2fe6da[_0x4935('0x17')]?_0x2fe6da[_0x4935('0x17')]['where']||null:null,'attributes':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x19')]||null:null,'include':_0x2fe6da['options']?_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')]?_[_0x4935('0x1c')](_0x2fe6da[_0x4935('0x17')][_0x4935('0x1b')],function(_0x4a69bc){return{'model':db[_0x4a69bc['model']],'as':_0x4a69bc['as'],'attributes':_0x4a69bc[_0x4935('0x19')],'include':_0x4a69bc[_0x4935('0x1b')]?_['map'](_0x4a69bc['include'],function(_0xb3d934){return{'model':db[_0xb3d934['model']],'as':_0xb3d934['as'],'attributes':_0xb3d934[_0x4935('0x19')],'include':_0xb3d934[_0x4935('0x1b')]?_[_0x4935('0x1c')](_0xb3d934[_0x4935('0x1b')],function(_0x1d77b8){return{'model':db[_0x1d77b8[_0x4935('0x1d')]],'as':_0x1d77b8['as'],'attributes':_0x1d77b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4935('0x1e')](function(_0x51b7ac){logger[_0x4935('0xc')]('ShowVtigerAccount',_0x2fe6da);logger[_0x4935('0xf')]('ShowVtigerAccount',_0x2fe6da,JSON[_0x4935('0x1f')](_0x51b7ac));_0xb7fe2a(_0x51b7ac);})[_0x4935('0x14')](function(_0x352679){logger[_0x4935('0x11')](_0x4935('0x20'),_0x352679[_0x4935('0x12')],_0x2fe6da);_0x2dcb0b(_0x5b3c8e[_0x4935('0x11')](0x1f4,_0x352679['message']));});});}; \ No newline at end of file +var _0xa5fa=['jayson/promise','client','http','request','info','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowVtigerAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2208de,_0x9b7e0f){var _0x355c64=function(_0x5a55ac){while(--_0x5a55ac){_0x2208de['push'](_0x2208de['shift']());}};_0x355c64(++_0x9b7e0f);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x4b90b7,_0x2b0ab0){_0x4b90b7=_0x4b90b7-0x0;var _0x36ac5f=_0xa5fa[_0x4b90b7];return _0x36ac5f;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b606,_0x302138,_0xc326df){return new BPromise(function(_0x74f64f,_0x3f550e){return client[_0xaa5f('0xb')](_0x13b606,_0xc326df)['then'](function(_0x1674c2){logger[_0xaa5f('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x302138,'request\x20sent',JSON[_0xaa5f('0xe')](_0x1674c2));if(_0x1674c2['error']){if(_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x10')]===0x1f4){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')]['message']);return _0x3f550e(_0x1674c2[_0xaa5f('0xf')]['message']);}logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x12')]);return _0x74f64f(_0x1674c2[_0xaa5f('0xf')]['message']);}else{logger['info'](_0xaa5f('0x11'),_0x302138,_0xaa5f('0x13'));_0x74f64f(_0x1674c2[_0xaa5f('0x14')][_0xaa5f('0x12')]);}})[_0xaa5f('0x15')](function(_0x1fa36a){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1fa36a);_0x3f550e(_0x1fa36a);});});}exports[_0xaa5f('0x16')]=function(_0x3d874f){var _0x22175f=this;return new Promise(function(_0x1019e8,_0x4f4cd5){return db[_0xaa5f('0x17')][_0xaa5f('0x18')]({'raw':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f[_0xaa5f('0x19')][_0xaa5f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f[_0xaa5f('0x19')][_0xaa5f('0x1b')]||null:null,'attributes':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f[_0xaa5f('0x19')][_0xaa5f('0x1c')]||null:null,'limit':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f[_0xaa5f('0x19')]['limit']||null:null,'include':_0x3d874f[_0xaa5f('0x19')]?_0x3d874f['options'][_0xaa5f('0x1d')]?_[_0xaa5f('0x1e')](_0x3d874f['options'][_0xaa5f('0x1d')],function(_0x1032ce){return{'model':db[_0x1032ce['model']],'as':_0x1032ce['as'],'attributes':_0x1032ce[_0xaa5f('0x1c')],'include':_0x1032ce[_0xaa5f('0x1d')]?_[_0xaa5f('0x1e')](_0x1032ce[_0xaa5f('0x1d')],function(_0x1f66c0){return{'model':db[_0x1f66c0[_0xaa5f('0x1f')]],'as':_0x1f66c0['as'],'attributes':_0x1f66c0[_0xaa5f('0x1c')],'include':_0x1f66c0[_0xaa5f('0x1d')]?_['map'](_0x1f66c0[_0xaa5f('0x1d')],function(_0x3a66e8){return{'model':db[_0x3a66e8[_0xaa5f('0x1f')]],'as':_0x3a66e8['as'],'attributes':_0x3a66e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa5f('0x20')](function(_0x269209){logger[_0xaa5f('0xc')]('GetVtigerAccount',_0x3d874f);logger[_0xaa5f('0xd')]('GetVtigerAccount',_0x3d874f,JSON['stringify'](_0x269209));_0x1019e8(_0x269209);})[_0xaa5f('0x15')](function(_0x50998f){logger[_0xaa5f('0xf')]('GetVtigerAccount',_0x50998f['message'],_0x3d874f);_0x4f4cd5(_0x22175f['error'](0x1f4,_0x50998f[_0xaa5f('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x310828){var _0xc0bb03=this;return new Promise(function(_0x555876,_0x58f608){return db[_0xaa5f('0x17')]['find']({'raw':_0x310828[_0xaa5f('0x19')]?_0x310828[_0xaa5f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x310828[_0xaa5f('0x19')]?_0x310828[_0xaa5f('0x19')][_0xaa5f('0x1b')]||null:null,'attributes':_0x310828['options']?_0x310828[_0xaa5f('0x19')][_0xaa5f('0x1c')]||null:null,'include':_0x310828['options']?_0x310828['options']['include']?_['map'](_0x310828[_0xaa5f('0x19')][_0xaa5f('0x1d')],function(_0x2a6015){return{'model':db[_0x2a6015[_0xaa5f('0x1f')]],'as':_0x2a6015['as'],'attributes':_0x2a6015[_0xaa5f('0x1c')],'include':_0x2a6015[_0xaa5f('0x1d')]?_[_0xaa5f('0x1e')](_0x2a6015['include'],function(_0x1ab07f){return{'model':db[_0x1ab07f[_0xaa5f('0x1f')]],'as':_0x1ab07f['as'],'attributes':_0x1ab07f[_0xaa5f('0x1c')],'include':_0x1ab07f[_0xaa5f('0x1d')]?_[_0xaa5f('0x1e')](_0x1ab07f[_0xaa5f('0x1d')],function(_0x49442c){return{'model':db[_0x49442c[_0xaa5f('0x1f')]],'as':_0x49442c['as'],'attributes':_0x49442c[_0xaa5f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xaa5f('0x20')](function(_0x2ac0f8){logger[_0xaa5f('0xc')]('ShowVtigerAccount',_0x310828);logger['debug'](_0xaa5f('0x21'),_0x310828,JSON[_0xaa5f('0xe')](_0x2ac0f8));_0x555876(_0x2ac0f8);})[_0xaa5f('0x15')](function(_0x964105){logger['error'](_0xaa5f('0x21'),_0x964105[_0xaa5f('0x12')],_0x310828);_0x58f608(_0xc0bb03[_0xaa5f('0xf')](0x1f4,_0x964105[_0xaa5f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 957cb70..c57c5fc 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 _0xcf0b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','delete','path','connect-timeout','express','Router'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xcf0b,0xc2));var _0xbcf0=function(_0x1e8982,_0x37bfc7){_0x1e8982=_0x1e8982-0x0;var _0x115066=_0xcf0b[_0x1e8982];return _0x115066;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbcf0('0x0'));var timeout=require(_0xbcf0('0x1'));var express=require(_0xbcf0('0x2'));var router=express[_0xbcf0('0x3')]();var fs_extra=require(_0xbcf0('0x4'));var auth=require(_0xbcf0('0x5'));var interaction=require(_0xbcf0('0x6'));var config=require(_0xbcf0('0x7'));var controller=require(_0xbcf0('0x8'));router[_0xbcf0('0x9')]('/',auth['isAuthenticated'](),controller[_0xbcf0('0xa')]);router[_0xbcf0('0x9')]('/:id',auth[_0xbcf0('0xb')](),controller[_0xbcf0('0xc')]);router[_0xbcf0('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbcf0('0xd')]);router[_0xbcf0('0x9')](_0xbcf0('0xe'),auth['isAuthenticated'](),controller[_0xbcf0('0xf')]);router['get'](_0xbcf0('0x10'),auth[_0xbcf0('0xb')](),controller[_0xbcf0('0x11')]);router[_0xbcf0('0x12')]('/',auth[_0xbcf0('0xb')](),controller['create']);router[_0xbcf0('0x13')](_0xbcf0('0x14'),auth[_0xbcf0('0xb')](),controller['update']);router[_0xbcf0('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5ebb=['/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show'];(function(_0x440b10,_0x5b4ac7){var _0x1d3434=function(_0x101ef1){while(--_0x101ef1){_0x440b10['push'](_0x440b10['shift']());}};_0x1d3434(++_0x5b4ac7);}(_0x5ebb,0x1ee));var _0xb5eb=function(_0x178faf,_0x13f8fa){_0x178faf=_0x178faf-0x0;var _0x197d98=_0x5ebb[_0x178faf];return _0x197d98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb5eb('0x0'));var timeout=require(_0xb5eb('0x1'));var express=require(_0xb5eb('0x2'));var router=express[_0xb5eb('0x3')]();var fs_extra=require(_0xb5eb('0x4'));var auth=require(_0xb5eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb5eb('0x6'));var controller=require(_0xb5eb('0x7'));router[_0xb5eb('0x8')]('/',auth[_0xb5eb('0x9')](),controller[_0xb5eb('0xa')]);router[_0xb5eb('0x8')]('/:id',auth[_0xb5eb('0x9')](),controller[_0xb5eb('0xb')]);router[_0xb5eb('0x8')](_0xb5eb('0xc'),auth[_0xb5eb('0x9')](),controller[_0xb5eb('0xd')]);router[_0xb5eb('0x8')](_0xb5eb('0xe'),auth['isAuthenticated'](),controller[_0xb5eb('0xf')]);router[_0xb5eb('0x8')]('/:id/descriptions',auth[_0xb5eb('0x9')](),controller[_0xb5eb('0x10')]);router[_0xb5eb('0x11')]('/',auth[_0xb5eb('0x9')](),controller[_0xb5eb('0x12')]);router[_0xb5eb('0x13')](_0xb5eb('0x14'),auth[_0xb5eb('0x9')](),controller[_0xb5eb('0x15')]);router[_0xb5eb('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 85dae07..ce8de99 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 _0xf55a=['STRING','sequelize','exports'];(function(_0x46307f,_0x55db2f){var _0x5a3320=function(_0x5c7abf){while(--_0x5c7abf){_0x46307f['push'](_0x46307f['shift']());}};_0x5a3320(++_0x55db2f);}(_0xf55a,0x67));var _0xaf55=function(_0x3c9577,_0x21f16e){_0x3c9577=_0x3c9577-0x0;var _0xd0f3ea=_0xf55a[_0x3c9577];return _0xd0f3ea;};'use strict';var Sequelize=require(_0xaf55('0x0'));module[_0xaf55('0x1')]={'name':{'type':Sequelize[_0xaf55('0x2')]},'description':{'type':Sequelize[_0xaf55('0x2')]}}; \ No newline at end of file +var _0x4f2e=['exports','STRING','sequelize'];(function(_0x5c4013,_0x5e8460){var _0x287aeb=function(_0x34b86c){while(--_0x34b86c){_0x5c4013['push'](_0x5c4013['shift']());}};_0x287aeb(++_0x5e8460);}(_0x4f2e,0x176));var _0xe4f2=function(_0xff9b9d,_0x55eb38){_0xff9b9d=_0xff9b9d-0x0;var _0x267e23=_0x4f2e[_0xff9b9d];return _0x267e23;};'use strict';var Sequelize=require(_0xe4f2('0x0'));module[_0xe4f2('0x1')]={'name':{'type':Sequelize[_0xe4f2('0x2')]},'description':{'type':Sequelize[_0xe4f2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2a51b39..2a3b258 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 _0xbe7c=['filters','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','VtigerField','order','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where'];(function(_0x4b9dc9,_0x14b3a2){var _0x57b302=function(_0x4f99ff){while(--_0x4f99ff){_0x4b9dc9['push'](_0x4b9dc9['shift']());}};_0x57b302(++_0x14b3a2);}(_0xbe7c,0x108));var _0xcbe7=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe7c[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0xcbe7('0x0'));var rimraf=require(_0xcbe7('0x1'));var zipdir=require(_0xcbe7('0x2'));var jsonpatch=require(_0xcbe7('0x3'));var rp=require(_0xcbe7('0x4'));var moment=require('moment');var BPromise=require(_0xcbe7('0x5'));var Mustache=require(_0xcbe7('0x6'));var util=require('util');var path=require(_0xcbe7('0x7'));var sox=require(_0xcbe7('0x8'));var csv=require('to-csv');var ejs=require(_0xcbe7('0x9'));var fs=require('fs');var fs_extra=require(_0xcbe7('0xa'));var _=require(_0xcbe7('0xb'));var squel=require('squel');var crypto=require(_0xcbe7('0xc'));var jsforce=require(_0xcbe7('0xd'));var deskjs=require(_0xcbe7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcbe7('0xf'));var Papa=require(_0xcbe7('0x10'));var Redis=require(_0xcbe7('0x11'));var authService=require(_0xcbe7('0x12'));var qs=require(_0xcbe7('0x13'));var as=require(_0xcbe7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbe7('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcbe7('0x16'));var licenseUtil=require(_0xcbe7('0x17'));var db=require(_0xcbe7('0x18'))['db'];function respondWithStatusCode(_0x5c81bc,_0x23696b){_0x23696b=_0x23696b||0xcc;return function(_0x53907c){if(_0x53907c){return _0x5c81bc[_0xcbe7('0x19')](_0x23696b);}return _0x5c81bc[_0xcbe7('0x1a')](_0x23696b)[_0xcbe7('0x1b')]();};}function respondWithResult(_0x5d8f17,_0xed726f){_0xed726f=_0xed726f||0xc8;return function(_0x2ae58b){if(_0x2ae58b){return _0x5d8f17['status'](_0xed726f)[_0xcbe7('0x1c')](_0x2ae58b);}};}function respondWithFilteredResult(_0x43fc21,_0x4a4431){return function(_0x3e860b){if(_0x3e860b){var _0x4da77e=typeof _0x4a4431[_0xcbe7('0x1d')]==='undefined'&&typeof _0x4a4431[_0xcbe7('0x1e')]==='undefined';var _0x3d7c74=_0x3e860b[_0xcbe7('0x1f')];var _0x393ae6=_0x4da77e?0x0:_0x4a4431['offset'];var _0x45c16d=_0x4da77e?_0x3e860b[_0xcbe7('0x1f')]:_0x4a4431[_0xcbe7('0x1d')]+_0x4a4431['limit'];var _0x232a87;if(_0x45c16d>=_0x3d7c74){_0x45c16d=_0x3d7c74;_0x232a87=0xc8;}else{_0x232a87=0xce;}_0x43fc21[_0xcbe7('0x1a')](_0x232a87);return _0x43fc21[_0xcbe7('0x20')](_0xcbe7('0x21'),_0x393ae6+'-'+_0x45c16d+'/'+_0x3d7c74)['json'](_0x3e860b);}return null;};}function patchUpdates(_0x177661){return function(_0x4e2027){try{jsonpatch[_0xcbe7('0x22')](_0x4e2027,_0x177661,!![]);}catch(_0x189980){return BPromise['reject'](_0x189980);}return _0x4e2027[_0xcbe7('0x23')]();};}function saveUpdates(_0x9ee4ce,_0x522aad){return function(_0x31d862){if(_0x31d862){return _0x31d862[_0xcbe7('0x24')](_0x9ee4ce)[_0xcbe7('0x25')](function(_0x470784){return _0x470784;});}return null;};}function removeEntity(_0x58f512,_0x5e14f9){return function(_0x46bcbd){if(_0x46bcbd){return _0x46bcbd[_0xcbe7('0x26')]()[_0xcbe7('0x25')](function(){_0x58f512[_0xcbe7('0x1a')](0xcc)[_0xcbe7('0x1b')]();});}};}function handleEntityNotFound(_0x39be8a,_0x311492){return function(_0xa3c2cd){if(!_0xa3c2cd){_0x39be8a[_0xcbe7('0x19')](0x194);}return _0xa3c2cd;};}function handleError(_0xe98233,_0x50e71b){_0x50e71b=_0x50e71b||0x1f4;return function(_0x30e25d){logger[_0xcbe7('0x27')](_0x30e25d[_0xcbe7('0x28')]);if(_0x30e25d[_0xcbe7('0x29')]){delete _0x30e25d[_0xcbe7('0x29')];}_0xe98233['status'](_0x50e71b)['send'](_0x30e25d);};}exports[_0xcbe7('0x2a')]=function(_0x1805a8,_0x2f47bd){var _0x1397ce={},_0x2b2a99={},_0xfb3e81={'count':0x0,'rows':[]};var _0x246e34=_[_0xcbe7('0x2b')](db[_0xcbe7('0x2c')][_0xcbe7('0x2d')],function(_0x2c78ad){return{'name':_0x2c78ad[_0xcbe7('0x2e')],'type':_0x2c78ad[_0xcbe7('0x2f')][_0xcbe7('0x30')]};});_0x2b2a99['model']=_['map'](_0x246e34,_0xcbe7('0x29'));_0x2b2a99[_0xcbe7('0x31')]=_[_0xcbe7('0x32')](_0x1805a8['query']);_0x2b2a99['filters']=_[_0xcbe7('0x33')](_0x2b2a99[_0xcbe7('0x34')],_0x2b2a99[_0xcbe7('0x31')]);_0x1397ce['attributes']=_[_0xcbe7('0x33')](_0x2b2a99[_0xcbe7('0x34')],qs[_0xcbe7('0x35')](_0x1805a8[_0xcbe7('0x31')][_0xcbe7('0x35')]));_0x1397ce['attributes']=_0x1397ce[_0xcbe7('0x36')][_0xcbe7('0x37')]?_0x1397ce['attributes']:_0x2b2a99[_0xcbe7('0x34')];if(!_0x1805a8[_0xcbe7('0x31')][_0xcbe7('0x38')](_0xcbe7('0x39'))){_0x1397ce[_0xcbe7('0x1e')]=qs[_0xcbe7('0x1e')](_0x1805a8[_0xcbe7('0x31')][_0xcbe7('0x1e')]);_0x1397ce[_0xcbe7('0x1d')]=qs[_0xcbe7('0x1d')](_0x1805a8[_0xcbe7('0x31')][_0xcbe7('0x1d')]);}_0x1397ce['order']=qs[_0xcbe7('0x3a')](_0x1805a8[_0xcbe7('0x31')][_0xcbe7('0x3a')]);_0x1397ce[_0xcbe7('0x3b')]=qs[_0xcbe7('0x3c')](_[_0xcbe7('0x3d')](_0x1805a8[_0xcbe7('0x31')],_0x2b2a99['filters']),_0x246e34);if(_0x1805a8['query'][_0xcbe7('0x3e')]){_0x1397ce[_0xcbe7('0x3b')]=_['merge'](_0x1397ce[_0xcbe7('0x3b')],{'$or':_[_0xcbe7('0x2b')](_0x246e34,function(_0x30a644){if(_0x30a644[_0xcbe7('0x2f')]!=='VIRTUAL'){var _0x4b1ac2={};_0x4b1ac2[_0x30a644['name']]={'$like':'%'+_0x1805a8[_0xcbe7('0x31')][_0xcbe7('0x3e')]+'%'};return _0x4b1ac2;}})});}_0x1397ce=_[_0xcbe7('0x3f')]({},_0x1397ce,_0x1805a8['options']);var _0x2354e1={'where':_0x1397ce[_0xcbe7('0x3b')]};return db['VtigerConfiguration']['count'](_0x2354e1)[_0xcbe7('0x25')](function(_0x4432c9){_0xfb3e81[_0xcbe7('0x1f')]=_0x4432c9;if(_0x1805a8['query']['includeAll']){_0x1397ce[_0xcbe7('0x40')]=[{'all':!![]}];}return db[_0xcbe7('0x2c')][_0xcbe7('0x41')](_0x1397ce);})['then'](function(_0x551037){_0xfb3e81[_0xcbe7('0x42')]=_0x551037;return _0xfb3e81;})[_0xcbe7('0x25')](respondWithFilteredResult(_0x2f47bd,_0x1397ce))[_0xcbe7('0x43')](handleError(_0x2f47bd,null));};exports[_0xcbe7('0x44')]=function(_0xcbde22,_0xba22a8){var _0x1d2065={'raw':![],'where':{'id':_0xcbde22[_0xcbe7('0x45')]['id']}},_0xafc91b={};_0xafc91b[_0xcbe7('0x34')]=_[_0xcbe7('0x32')](db[_0xcbe7('0x2c')]['rawAttributes']);_0xafc91b[_0xcbe7('0x31')]=_[_0xcbe7('0x32')](_0xcbde22[_0xcbe7('0x31')]);_0xafc91b[_0xcbe7('0x3c')]=_[_0xcbe7('0x33')](_0xafc91b[_0xcbe7('0x34')],_0xafc91b['query']);_0x1d2065['attributes']=_[_0xcbe7('0x33')](_0xafc91b[_0xcbe7('0x34')],qs[_0xcbe7('0x35')](_0xcbde22[_0xcbe7('0x31')][_0xcbe7('0x35')]));_0x1d2065['attributes']=_0x1d2065[_0xcbe7('0x36')]['length']?_0x1d2065[_0xcbe7('0x36')]:_0xafc91b['model'];if(_0xcbde22[_0xcbe7('0x31')][_0xcbe7('0x46')]){_0x1d2065[_0xcbe7('0x40')]=[{'all':!![]}];}_0x1d2065=_[_0xcbe7('0x3f')]({},_0x1d2065,_0xcbde22[_0xcbe7('0x47')]);return db[_0xcbe7('0x2c')][_0xcbe7('0x48')](_0x1d2065)[_0xcbe7('0x25')](handleEntityNotFound(_0xba22a8,null))[_0xcbe7('0x25')](respondWithResult(_0xba22a8,null))[_0xcbe7('0x43')](handleError(_0xba22a8,null));};exports[_0xcbe7('0x49')]=function(_0x5a026a,_0x5cde9b){return db[_0xcbe7('0x2c')][_0xcbe7('0x49')](_0x5a026a[_0xcbe7('0x4a')],{})[_0xcbe7('0x25')](respondWithResult(_0x5cde9b,0xc9))['catch'](handleError(_0x5cde9b,null));};exports[_0xcbe7('0x24')]=function(_0x41a9c2,_0x1751ef){if(_0x41a9c2[_0xcbe7('0x4a')]['id']){delete _0x41a9c2[_0xcbe7('0x4a')]['id'];}return db['VtigerConfiguration'][_0xcbe7('0x48')]({'where':{'id':_0x41a9c2[_0xcbe7('0x45')]['id']}})[_0xcbe7('0x25')](handleEntityNotFound(_0x1751ef,null))[_0xcbe7('0x25')](saveUpdates(_0x41a9c2[_0xcbe7('0x4a')],null))[_0xcbe7('0x25')](respondWithResult(_0x1751ef,null))[_0xcbe7('0x43')](handleError(_0x1751ef,null));};exports[_0xcbe7('0x26')]=function(_0x52d31e,_0x3fd82c){return db[_0xcbe7('0x2c')][_0xcbe7('0x48')]({'where':{'id':_0x52d31e[_0xcbe7('0x45')]['id']}})['then'](handleEntityNotFound(_0x3fd82c,null))[_0xcbe7('0x25')](removeEntity(_0x3fd82c,null))[_0xcbe7('0x43')](handleError(_0x3fd82c,null));};exports['getFields']=function(_0xf625ab,_0x798b7a,_0x13d334){var _0x4faf07={};var _0x1639a9={};var _0x44a9c0;var _0xd9539b;return db['VtigerConfiguration']['findOne']({'where':{'id':_0xf625ab[_0xcbe7('0x45')]['id']}})[_0xcbe7('0x25')](handleEntityNotFound(_0x798b7a,null))[_0xcbe7('0x25')](function(_0x2d2299){if(_0x2d2299){_0x44a9c0=_0x2d2299;_0x1639a9[_0xcbe7('0x34')]=_[_0xcbe7('0x32')](db[_0xcbe7('0x4b')][_0xcbe7('0x2d')]);_0x1639a9['query']=_[_0xcbe7('0x32')](_0xf625ab[_0xcbe7('0x31')]);_0x1639a9[_0xcbe7('0x3c')]=_[_0xcbe7('0x33')](_0x1639a9[_0xcbe7('0x34')],_0x1639a9[_0xcbe7('0x31')]);_0x4faf07[_0xcbe7('0x36')]=_['intersection'](_0x1639a9['model'],qs[_0xcbe7('0x35')](_0xf625ab[_0xcbe7('0x31')][_0xcbe7('0x35')]));_0x4faf07[_0xcbe7('0x36')]=_0x4faf07['attributes'][_0xcbe7('0x37')]?_0x4faf07['attributes']:_0x1639a9[_0xcbe7('0x34')];_0x4faf07[_0xcbe7('0x4c')]=qs[_0xcbe7('0x3a')](_0xf625ab[_0xcbe7('0x31')]['sort']);_0x4faf07[_0xcbe7('0x3b')]=qs[_0xcbe7('0x3c')](_['pick'](_0xf625ab[_0xcbe7('0x31')],_0x1639a9[_0xcbe7('0x3c')]));if(_0xf625ab[_0xcbe7('0x31')]['filter']){_0x4faf07[_0xcbe7('0x3b')]=_[_0xcbe7('0x3f')](_0x4faf07[_0xcbe7('0x3b')],{'$or':_[_0xcbe7('0x2b')](_0x4faf07['attributes'],function(_0x1b7404){var _0x119171={};_0x119171[_0x1b7404]={'$like':'%'+_0xf625ab[_0xcbe7('0x31')][_0xcbe7('0x3e')]+'%'};return _0x119171;})});}_0x4faf07=_[_0xcbe7('0x3f')]({},_0x4faf07,_0xf625ab[_0xcbe7('0x47')]);return _0x44a9c0[_0xcbe7('0x4d')](_0x4faf07);}})[_0xcbe7('0x25')](function(_0x54b479){if(_0x54b479){_0xd9539b=_0x54b479[_0xcbe7('0x37')];if(!_0xf625ab[_0xcbe7('0x31')][_0xcbe7('0x38')](_0xcbe7('0x39'))){_0x4faf07[_0xcbe7('0x1e')]=qs['limit'](_0xf625ab[_0xcbe7('0x31')][_0xcbe7('0x1e')]);_0x4faf07[_0xcbe7('0x1d')]=qs[_0xcbe7('0x1d')](_0xf625ab[_0xcbe7('0x31')][_0xcbe7('0x1d')]);}return _0x44a9c0[_0xcbe7('0x4d')](_0x4faf07);}})[_0xcbe7('0x25')](function(_0x4264e2){if(_0x4264e2){return _0x4264e2?{'count':_0xd9539b,'rows':_0x4264e2}:null;}})[_0xcbe7('0x25')](respondWithResult(_0x798b7a,null))[_0xcbe7('0x43')](handleError(_0x798b7a,null));};exports[_0xcbe7('0x4e')]=function(_0x2b7f36,_0x87fa99,_0xa80250){var _0x4f0dc7={};var _0x5a6b6f={};var _0x4ac745;var _0xfb580a;return db[_0xcbe7('0x2c')][_0xcbe7('0x4f')]({'where':{'id':_0x2b7f36[_0xcbe7('0x45')]['id']}})[_0xcbe7('0x25')](handleEntityNotFound(_0x87fa99,null))[_0xcbe7('0x25')](function(_0x40e6ed){if(_0x40e6ed){_0x4ac745=_0x40e6ed;_0x5a6b6f[_0xcbe7('0x34')]=_['keys'](db[_0xcbe7('0x4b')][_0xcbe7('0x2d')]);_0x5a6b6f[_0xcbe7('0x31')]=_[_0xcbe7('0x32')](_0x2b7f36[_0xcbe7('0x31')]);_0x5a6b6f[_0xcbe7('0x3c')]=_['intersection'](_0x5a6b6f[_0xcbe7('0x34')],_0x5a6b6f[_0xcbe7('0x31')]);_0x4f0dc7[_0xcbe7('0x36')]=_[_0xcbe7('0x33')](_0x5a6b6f[_0xcbe7('0x34')],qs['fields'](_0x2b7f36[_0xcbe7('0x31')]['fields']));_0x4f0dc7['attributes']=_0x4f0dc7[_0xcbe7('0x36')][_0xcbe7('0x37')]?_0x4f0dc7[_0xcbe7('0x36')]:_0x5a6b6f[_0xcbe7('0x34')];_0x4f0dc7[_0xcbe7('0x4c')]=qs[_0xcbe7('0x3a')](_0x2b7f36[_0xcbe7('0x31')][_0xcbe7('0x3a')]);_0x4f0dc7[_0xcbe7('0x3b')]=qs['filters'](_['pick'](_0x2b7f36[_0xcbe7('0x31')],_0x5a6b6f['filters']));if(_0x2b7f36[_0xcbe7('0x31')][_0xcbe7('0x3e')]){_0x4f0dc7[_0xcbe7('0x3b')]=_[_0xcbe7('0x3f')](_0x4f0dc7[_0xcbe7('0x3b')],{'$or':_[_0xcbe7('0x2b')](_0x4f0dc7[_0xcbe7('0x36')],function(_0x582968){var _0x513828={};_0x513828[_0x582968]={'$like':'%'+_0x2b7f36[_0xcbe7('0x31')]['filter']+'%'};return _0x513828;})});}_0x4f0dc7=_[_0xcbe7('0x3f')]({},_0x4f0dc7,_0x2b7f36[_0xcbe7('0x47')]);return _0x4ac745[_0xcbe7('0x4e')](_0x4f0dc7);}})[_0xcbe7('0x25')](function(_0x27d453){if(_0x27d453){_0xfb580a=_0x27d453[_0xcbe7('0x37')];if(!_0x2b7f36['query']['hasOwnProperty'](_0xcbe7('0x39'))){_0x4f0dc7['limit']=qs[_0xcbe7('0x1e')](_0x2b7f36[_0xcbe7('0x31')][_0xcbe7('0x1e')]);_0x4f0dc7['offset']=qs['offset'](_0x2b7f36[_0xcbe7('0x31')]['offset']);}return _0x4ac745[_0xcbe7('0x4e')](_0x4f0dc7);}})['then'](function(_0x502e37){if(_0x502e37){return _0x502e37?{'count':_0xfb580a,'rows':_0x502e37}:null;}})[_0xcbe7('0x25')](respondWithResult(_0x87fa99,null))[_0xcbe7('0x43')](handleError(_0x87fa99,null));};exports[_0xcbe7('0x50')]=function(_0x14e6a2,_0x25dbf2,_0x3cbd75){var _0x5b54d4={};var _0x46ab34={};var _0x3dde81;var _0x58600a;return db[_0xcbe7('0x2c')][_0xcbe7('0x4f')]({'where':{'id':_0x14e6a2['params']['id']}})[_0xcbe7('0x25')](handleEntityNotFound(_0x25dbf2,null))[_0xcbe7('0x25')](function(_0xcf77a5){if(_0xcf77a5){_0x3dde81=_0xcf77a5;_0x46ab34[_0xcbe7('0x34')]=_['keys'](db[_0xcbe7('0x4b')][_0xcbe7('0x2d')]);_0x46ab34[_0xcbe7('0x31')]=_['keys'](_0x14e6a2['query']);_0x46ab34[_0xcbe7('0x3c')]=_['intersection'](_0x46ab34['model'],_0x46ab34[_0xcbe7('0x31')]);_0x5b54d4[_0xcbe7('0x36')]=_[_0xcbe7('0x33')](_0x46ab34[_0xcbe7('0x34')],qs[_0xcbe7('0x35')](_0x14e6a2[_0xcbe7('0x31')]['fields']));_0x5b54d4[_0xcbe7('0x36')]=_0x5b54d4[_0xcbe7('0x36')]['length']?_0x5b54d4[_0xcbe7('0x36')]:_0x46ab34[_0xcbe7('0x34')];_0x5b54d4[_0xcbe7('0x4c')]=qs[_0xcbe7('0x3a')](_0x14e6a2[_0xcbe7('0x31')][_0xcbe7('0x3a')]);_0x5b54d4[_0xcbe7('0x3b')]=qs[_0xcbe7('0x3c')](_[_0xcbe7('0x3d')](_0x14e6a2[_0xcbe7('0x31')],_0x46ab34['filters']));if(_0x14e6a2['query'][_0xcbe7('0x3e')]){_0x5b54d4[_0xcbe7('0x3b')]=_[_0xcbe7('0x3f')](_0x5b54d4['where'],{'$or':_['map'](_0x5b54d4[_0xcbe7('0x36')],function(_0x31799b){var _0x7a9bd1={};_0x7a9bd1[_0x31799b]={'$like':'%'+_0x14e6a2[_0xcbe7('0x31')]['filter']+'%'};return _0x7a9bd1;})});}_0x5b54d4=_[_0xcbe7('0x3f')]({},_0x5b54d4,_0x14e6a2[_0xcbe7('0x47')]);return _0x3dde81[_0xcbe7('0x50')](_0x5b54d4);}})[_0xcbe7('0x25')](function(_0x45c890){if(_0x45c890){_0x58600a=_0x45c890[_0xcbe7('0x37')];if(!_0x14e6a2[_0xcbe7('0x31')][_0xcbe7('0x38')]('nolimit')){_0x5b54d4['limit']=qs[_0xcbe7('0x1e')](_0x14e6a2[_0xcbe7('0x31')][_0xcbe7('0x1e')]);_0x5b54d4[_0xcbe7('0x1d')]=qs[_0xcbe7('0x1d')](_0x14e6a2[_0xcbe7('0x31')]['offset']);}return _0x3dde81['getDescriptions'](_0x5b54d4);}})[_0xcbe7('0x25')](function(_0x110668){if(_0x110668){return _0x110668?{'count':_0x58600a,'rows':_0x110668}:null;}})[_0xcbe7('0x25')](respondWithResult(_0x25dbf2,null))[_0xcbe7('0x43')](handleError(_0x25dbf2,null));}; \ No newline at end of file +var _0xd517=['VIRTUAL','options','catch','includeAll','include','find','create','body','params','getFields','VtigerField','nolimit','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','undefined','limit','count','offset','status','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where'];(function(_0x3616c6,_0x25ecf1){var _0x55244b=function(_0x2d9d67){while(--_0x2d9d67){_0x3616c6['push'](_0x3616c6['shift']());}};_0x55244b(++_0x25ecf1);}(_0xd517,0x1dd));var _0x7d51=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0xd517[_0x5ca5bc];return _0x26ca86;};'use strict';var emlformat=require(_0x7d51('0x0'));var rimraf=require(_0x7d51('0x1'));var zipdir=require(_0x7d51('0x2'));var jsonpatch=require(_0x7d51('0x3'));var rp=require(_0x7d51('0x4'));var moment=require('moment');var BPromise=require(_0x7d51('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7d51('0x6'));var sox=require(_0x7d51('0x7'));var csv=require(_0x7d51('0x8'));var ejs=require(_0x7d51('0x9'));var fs=require('fs');var fs_extra=require(_0x7d51('0xa'));var _=require(_0x7d51('0xb'));var squel=require(_0x7d51('0xc'));var crypto=require(_0x7d51('0xd'));var jsforce=require(_0x7d51('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d51('0xf'));var Papa=require(_0x7d51('0x10'));var Redis=require(_0x7d51('0x11'));var authService=require(_0x7d51('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d51('0x13'));var logger=require(_0x7d51('0x14'))(_0x7d51('0x15'));var utils=require('../../config/utils');var config=require(_0x7d51('0x16'));var licenseUtil=require(_0x7d51('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x862d23,_0x4d2446){_0x4d2446=_0x4d2446||0xcc;return function(_0x5df8db){if(_0x5df8db){return _0x862d23[_0x7d51('0x18')](_0x4d2446);}return _0x862d23['status'](_0x4d2446)['end']();};}function respondWithResult(_0xdffda4,_0xe77939){_0xe77939=_0xe77939||0xc8;return function(_0xad66fb){if(_0xad66fb){return _0xdffda4['status'](_0xe77939)['json'](_0xad66fb);}};}function respondWithFilteredResult(_0x305c26,_0x1ea497){return function(_0x31c95c){if(_0x31c95c){var _0x102eb7=typeof _0x1ea497['offset']===_0x7d51('0x19')&&typeof _0x1ea497[_0x7d51('0x1a')]==='undefined';var _0x55968a=_0x31c95c[_0x7d51('0x1b')];var _0x2ef330=_0x102eb7?0x0:_0x1ea497[_0x7d51('0x1c')];var _0x48a5e5=_0x102eb7?_0x31c95c[_0x7d51('0x1b')]:_0x1ea497[_0x7d51('0x1c')]+_0x1ea497[_0x7d51('0x1a')];var _0x48b55b;if(_0x48a5e5>=_0x55968a){_0x48a5e5=_0x55968a;_0x48b55b=0xc8;}else{_0x48b55b=0xce;}_0x305c26[_0x7d51('0x1d')](_0x48b55b);return _0x305c26['set'](_0x7d51('0x1e'),_0x2ef330+'-'+_0x48a5e5+'/'+_0x55968a)['json'](_0x31c95c);}return null;};}function patchUpdates(_0x3401f8){return function(_0x401c96){try{jsonpatch[_0x7d51('0x1f')](_0x401c96,_0x3401f8,!![]);}catch(_0x207f3c){return BPromise[_0x7d51('0x20')](_0x207f3c);}return _0x401c96[_0x7d51('0x21')]();};}function saveUpdates(_0x2ebce3,_0x17463e){return function(_0x1d9daf){if(_0x1d9daf){return _0x1d9daf[_0x7d51('0x22')](_0x2ebce3)[_0x7d51('0x23')](function(_0x1f940a){return _0x1f940a;});}return null;};}function removeEntity(_0x44f118,_0x1e1f8c){return function(_0x24bf87){if(_0x24bf87){return _0x24bf87[_0x7d51('0x24')]()[_0x7d51('0x23')](function(){_0x44f118['status'](0xcc)[_0x7d51('0x25')]();});}};}function handleEntityNotFound(_0x9dc472,_0x4d197a){return function(_0x20d785){if(!_0x20d785){_0x9dc472[_0x7d51('0x18')](0x194);}return _0x20d785;};}function handleError(_0xd262e6,_0x12ee8a){_0x12ee8a=_0x12ee8a||0x1f4;return function(_0xf98473){logger[_0x7d51('0x26')](_0xf98473[_0x7d51('0x27')]);if(_0xf98473[_0x7d51('0x28')]){delete _0xf98473[_0x7d51('0x28')];}_0xd262e6[_0x7d51('0x1d')](_0x12ee8a)['send'](_0xf98473);};}exports['index']=function(_0x5029eb,_0x2b5b48){var _0x3e4b64={},_0x34bb5b={},_0x5ae6c6={'count':0x0,'rows':[]};var _0x17e735=_['map'](db[_0x7d51('0x29')][_0x7d51('0x2a')],function(_0x3d8969){return{'name':_0x3d8969[_0x7d51('0x2b')],'type':_0x3d8969[_0x7d51('0x2c')][_0x7d51('0x2d')]};});_0x34bb5b[_0x7d51('0x2e')]=_[_0x7d51('0x2f')](_0x17e735,_0x7d51('0x28'));_0x34bb5b[_0x7d51('0x30')]=_[_0x7d51('0x31')](_0x5029eb[_0x7d51('0x30')]);_0x34bb5b[_0x7d51('0x32')]=_[_0x7d51('0x33')](_0x34bb5b[_0x7d51('0x2e')],_0x34bb5b['query']);_0x3e4b64['attributes']=_[_0x7d51('0x33')](_0x34bb5b['model'],qs[_0x7d51('0x34')](_0x5029eb[_0x7d51('0x30')][_0x7d51('0x34')]));_0x3e4b64['attributes']=_0x3e4b64[_0x7d51('0x35')][_0x7d51('0x36')]?_0x3e4b64[_0x7d51('0x35')]:_0x34bb5b[_0x7d51('0x2e')];if(!_0x5029eb[_0x7d51('0x30')][_0x7d51('0x37')]('nolimit')){_0x3e4b64[_0x7d51('0x1a')]=qs[_0x7d51('0x1a')](_0x5029eb[_0x7d51('0x30')][_0x7d51('0x1a')]);_0x3e4b64['offset']=qs[_0x7d51('0x1c')](_0x5029eb[_0x7d51('0x30')][_0x7d51('0x1c')]);}_0x3e4b64[_0x7d51('0x38')]=qs['sort'](_0x5029eb[_0x7d51('0x30')][_0x7d51('0x39')]);_0x3e4b64['where']=qs['filters'](_[_0x7d51('0x3a')](_0x5029eb[_0x7d51('0x30')],_0x34bb5b[_0x7d51('0x32')]),_0x17e735);if(_0x5029eb[_0x7d51('0x30')][_0x7d51('0x3b')]){_0x3e4b64['where']=_[_0x7d51('0x3c')](_0x3e4b64[_0x7d51('0x3d')],{'$or':_['map'](_0x17e735,function(_0x1e3734){if(_0x1e3734[_0x7d51('0x2c')]!==_0x7d51('0x3e')){var _0x323adb={};_0x323adb[_0x1e3734[_0x7d51('0x28')]]={'$like':'%'+_0x5029eb[_0x7d51('0x30')][_0x7d51('0x3b')]+'%'};return _0x323adb;}})});}_0x3e4b64=_['merge']({},_0x3e4b64,_0x5029eb[_0x7d51('0x3f')]);var _0x27b37b={'where':_0x3e4b64['where']};return db[_0x7d51('0x29')][_0x7d51('0x1b')](_0x27b37b)['then'](function(_0x2ba385){_0x5ae6c6['count']=_0x2ba385;if(_0x5029eb[_0x7d51('0x30')]['includeAll']){_0x3e4b64['include']=[{'all':!![]}];}return db[_0x7d51('0x29')]['findAll'](_0x3e4b64);})[_0x7d51('0x23')](function(_0x3ba4a3){_0x5ae6c6['rows']=_0x3ba4a3;return _0x5ae6c6;})[_0x7d51('0x23')](respondWithFilteredResult(_0x2b5b48,_0x3e4b64))[_0x7d51('0x40')](handleError(_0x2b5b48,null));};exports['show']=function(_0x4819cc,_0x9b98d0){var _0x470859={'raw':![],'where':{'id':_0x4819cc['params']['id']}},_0x54b829={};_0x54b829[_0x7d51('0x2e')]=_[_0x7d51('0x31')](db[_0x7d51('0x29')]['rawAttributes']);_0x54b829[_0x7d51('0x30')]=_[_0x7d51('0x31')](_0x4819cc[_0x7d51('0x30')]);_0x54b829['filters']=_[_0x7d51('0x33')](_0x54b829[_0x7d51('0x2e')],_0x54b829[_0x7d51('0x30')]);_0x470859['attributes']=_[_0x7d51('0x33')](_0x54b829[_0x7d51('0x2e')],qs[_0x7d51('0x34')](_0x4819cc[_0x7d51('0x30')][_0x7d51('0x34')]));_0x470859[_0x7d51('0x35')]=_0x470859[_0x7d51('0x35')][_0x7d51('0x36')]?_0x470859[_0x7d51('0x35')]:_0x54b829[_0x7d51('0x2e')];if(_0x4819cc[_0x7d51('0x30')][_0x7d51('0x41')]){_0x470859[_0x7d51('0x42')]=[{'all':!![]}];}_0x470859=_[_0x7d51('0x3c')]({},_0x470859,_0x4819cc[_0x7d51('0x3f')]);return db[_0x7d51('0x29')][_0x7d51('0x43')](_0x470859)[_0x7d51('0x23')](handleEntityNotFound(_0x9b98d0,null))[_0x7d51('0x23')](respondWithResult(_0x9b98d0,null))[_0x7d51('0x40')](handleError(_0x9b98d0,null));};exports[_0x7d51('0x44')]=function(_0x46ccb5,_0x52969d){return db[_0x7d51('0x29')][_0x7d51('0x44')](_0x46ccb5[_0x7d51('0x45')],{})[_0x7d51('0x23')](respondWithResult(_0x52969d,0xc9))[_0x7d51('0x40')](handleError(_0x52969d,null));};exports[_0x7d51('0x22')]=function(_0x595619,_0x302d4e){if(_0x595619['body']['id']){delete _0x595619['body']['id'];}return db[_0x7d51('0x29')][_0x7d51('0x43')]({'where':{'id':_0x595619[_0x7d51('0x46')]['id']}})[_0x7d51('0x23')](handleEntityNotFound(_0x302d4e,null))[_0x7d51('0x23')](saveUpdates(_0x595619[_0x7d51('0x45')],null))[_0x7d51('0x23')](respondWithResult(_0x302d4e,null))[_0x7d51('0x40')](handleError(_0x302d4e,null));};exports[_0x7d51('0x24')]=function(_0x5b7ad3,_0x31d9d4){return db[_0x7d51('0x29')][_0x7d51('0x43')]({'where':{'id':_0x5b7ad3[_0x7d51('0x46')]['id']}})[_0x7d51('0x23')](handleEntityNotFound(_0x31d9d4,null))[_0x7d51('0x23')](removeEntity(_0x31d9d4,null))['catch'](handleError(_0x31d9d4,null));};exports[_0x7d51('0x47')]=function(_0x37e52c,_0x5a4e37,_0x510ca1){var _0x465259={};var _0x152880={};var _0x2f37ea;var _0xf6e105;return db[_0x7d51('0x29')]['findOne']({'where':{'id':_0x37e52c[_0x7d51('0x46')]['id']}})[_0x7d51('0x23')](handleEntityNotFound(_0x5a4e37,null))[_0x7d51('0x23')](function(_0x35d4e9){if(_0x35d4e9){_0x2f37ea=_0x35d4e9;_0x152880['model']=_[_0x7d51('0x31')](db[_0x7d51('0x48')]['rawAttributes']);_0x152880[_0x7d51('0x30')]=_[_0x7d51('0x31')](_0x37e52c[_0x7d51('0x30')]);_0x152880[_0x7d51('0x32')]=_[_0x7d51('0x33')](_0x152880[_0x7d51('0x2e')],_0x152880[_0x7d51('0x30')]);_0x465259['attributes']=_[_0x7d51('0x33')](_0x152880['model'],qs[_0x7d51('0x34')](_0x37e52c[_0x7d51('0x30')][_0x7d51('0x34')]));_0x465259[_0x7d51('0x35')]=_0x465259[_0x7d51('0x35')][_0x7d51('0x36')]?_0x465259[_0x7d51('0x35')]:_0x152880[_0x7d51('0x2e')];_0x465259[_0x7d51('0x38')]=qs[_0x7d51('0x39')](_0x37e52c[_0x7d51('0x30')][_0x7d51('0x39')]);_0x465259[_0x7d51('0x3d')]=qs[_0x7d51('0x32')](_[_0x7d51('0x3a')](_0x37e52c['query'],_0x152880[_0x7d51('0x32')]));if(_0x37e52c[_0x7d51('0x30')][_0x7d51('0x3b')]){_0x465259[_0x7d51('0x3d')]=_[_0x7d51('0x3c')](_0x465259[_0x7d51('0x3d')],{'$or':_[_0x7d51('0x2f')](_0x465259['attributes'],function(_0x4f5afc){var _0x5e49a8={};_0x5e49a8[_0x4f5afc]={'$like':'%'+_0x37e52c[_0x7d51('0x30')][_0x7d51('0x3b')]+'%'};return _0x5e49a8;})});}_0x465259=_[_0x7d51('0x3c')]({},_0x465259,_0x37e52c[_0x7d51('0x3f')]);return _0x2f37ea[_0x7d51('0x47')](_0x465259);}})[_0x7d51('0x23')](function(_0x11fb28){if(_0x11fb28){_0xf6e105=_0x11fb28[_0x7d51('0x36')];if(!_0x37e52c[_0x7d51('0x30')][_0x7d51('0x37')](_0x7d51('0x49'))){_0x465259[_0x7d51('0x1a')]=qs[_0x7d51('0x1a')](_0x37e52c[_0x7d51('0x30')][_0x7d51('0x1a')]);_0x465259[_0x7d51('0x1c')]=qs['offset'](_0x37e52c[_0x7d51('0x30')][_0x7d51('0x1c')]);}return _0x2f37ea[_0x7d51('0x47')](_0x465259);}})[_0x7d51('0x23')](function(_0x4fc9be){if(_0x4fc9be){return _0x4fc9be?{'count':_0xf6e105,'rows':_0x4fc9be}:null;}})[_0x7d51('0x23')](respondWithResult(_0x5a4e37,null))[_0x7d51('0x40')](handleError(_0x5a4e37,null));};exports[_0x7d51('0x4a')]=function(_0x58c519,_0x1f1aa8,_0x3a7743){var _0x21dfd5={};var _0x207d6e={};var _0x11f4eb;var _0x2104cd;return db[_0x7d51('0x29')]['findOne']({'where':{'id':_0x58c519['params']['id']}})[_0x7d51('0x23')](handleEntityNotFound(_0x1f1aa8,null))[_0x7d51('0x23')](function(_0x10a935){if(_0x10a935){_0x11f4eb=_0x10a935;_0x207d6e[_0x7d51('0x2e')]=_[_0x7d51('0x31')](db[_0x7d51('0x48')][_0x7d51('0x2a')]);_0x207d6e['query']=_[_0x7d51('0x31')](_0x58c519[_0x7d51('0x30')]);_0x207d6e[_0x7d51('0x32')]=_['intersection'](_0x207d6e[_0x7d51('0x2e')],_0x207d6e[_0x7d51('0x30')]);_0x21dfd5[_0x7d51('0x35')]=_[_0x7d51('0x33')](_0x207d6e[_0x7d51('0x2e')],qs[_0x7d51('0x34')](_0x58c519[_0x7d51('0x30')][_0x7d51('0x34')]));_0x21dfd5[_0x7d51('0x35')]=_0x21dfd5[_0x7d51('0x35')]['length']?_0x21dfd5[_0x7d51('0x35')]:_0x207d6e[_0x7d51('0x2e')];_0x21dfd5[_0x7d51('0x38')]=qs[_0x7d51('0x39')](_0x58c519[_0x7d51('0x30')][_0x7d51('0x39')]);_0x21dfd5[_0x7d51('0x3d')]=qs[_0x7d51('0x32')](_['pick'](_0x58c519[_0x7d51('0x30')],_0x207d6e[_0x7d51('0x32')]));if(_0x58c519[_0x7d51('0x30')][_0x7d51('0x3b')]){_0x21dfd5[_0x7d51('0x3d')]=_['merge'](_0x21dfd5[_0x7d51('0x3d')],{'$or':_[_0x7d51('0x2f')](_0x21dfd5[_0x7d51('0x35')],function(_0x34de8f){var _0x4948e1={};_0x4948e1[_0x34de8f]={'$like':'%'+_0x58c519[_0x7d51('0x30')][_0x7d51('0x3b')]+'%'};return _0x4948e1;})});}_0x21dfd5=_['merge']({},_0x21dfd5,_0x58c519[_0x7d51('0x3f')]);return _0x11f4eb[_0x7d51('0x4a')](_0x21dfd5);}})['then'](function(_0x279597){if(_0x279597){_0x2104cd=_0x279597[_0x7d51('0x36')];if(!_0x58c519[_0x7d51('0x30')][_0x7d51('0x37')](_0x7d51('0x49'))){_0x21dfd5[_0x7d51('0x1a')]=qs['limit'](_0x58c519[_0x7d51('0x30')][_0x7d51('0x1a')]);_0x21dfd5['offset']=qs[_0x7d51('0x1c')](_0x58c519[_0x7d51('0x30')][_0x7d51('0x1c')]);}return _0x11f4eb[_0x7d51('0x4a')](_0x21dfd5);}})['then'](function(_0x926724){if(_0x926724){return _0x926724?{'count':_0x2104cd,'rows':_0x926724}:null;}})[_0x7d51('0x23')](respondWithResult(_0x1f1aa8,null))[_0x7d51('0x40')](handleError(_0x1f1aa8,null));};exports[_0x7d51('0x4b')]=function(_0x489265,_0x3aa11f,_0x45ef17){var _0x173de3={};var _0x387f96={};var _0x1af356;var _0x5e313f;return db['VtigerConfiguration'][_0x7d51('0x4c')]({'where':{'id':_0x489265[_0x7d51('0x46')]['id']}})[_0x7d51('0x23')](handleEntityNotFound(_0x3aa11f,null))[_0x7d51('0x23')](function(_0x2b422f){if(_0x2b422f){_0x1af356=_0x2b422f;_0x387f96[_0x7d51('0x2e')]=_[_0x7d51('0x31')](db[_0x7d51('0x48')][_0x7d51('0x2a')]);_0x387f96[_0x7d51('0x30')]=_['keys'](_0x489265[_0x7d51('0x30')]);_0x387f96['filters']=_[_0x7d51('0x33')](_0x387f96[_0x7d51('0x2e')],_0x387f96['query']);_0x173de3[_0x7d51('0x35')]=_[_0x7d51('0x33')](_0x387f96[_0x7d51('0x2e')],qs[_0x7d51('0x34')](_0x489265['query'][_0x7d51('0x34')]));_0x173de3[_0x7d51('0x35')]=_0x173de3[_0x7d51('0x35')][_0x7d51('0x36')]?_0x173de3[_0x7d51('0x35')]:_0x387f96[_0x7d51('0x2e')];_0x173de3[_0x7d51('0x38')]=qs[_0x7d51('0x39')](_0x489265[_0x7d51('0x30')][_0x7d51('0x39')]);_0x173de3[_0x7d51('0x3d')]=qs[_0x7d51('0x32')](_[_0x7d51('0x3a')](_0x489265[_0x7d51('0x30')],_0x387f96[_0x7d51('0x32')]));if(_0x489265[_0x7d51('0x30')][_0x7d51('0x3b')]){_0x173de3[_0x7d51('0x3d')]=_[_0x7d51('0x3c')](_0x173de3[_0x7d51('0x3d')],{'$or':_['map'](_0x173de3[_0x7d51('0x35')],function(_0x252df3){var _0x4ecab2={};_0x4ecab2[_0x252df3]={'$like':'%'+_0x489265[_0x7d51('0x30')][_0x7d51('0x3b')]+'%'};return _0x4ecab2;})});}_0x173de3=_[_0x7d51('0x3c')]({},_0x173de3,_0x489265['options']);return _0x1af356[_0x7d51('0x4b')](_0x173de3);}})[_0x7d51('0x23')](function(_0x567465){if(_0x567465){_0x5e313f=_0x567465[_0x7d51('0x36')];if(!_0x489265[_0x7d51('0x30')][_0x7d51('0x37')](_0x7d51('0x49'))){_0x173de3[_0x7d51('0x1a')]=qs['limit'](_0x489265[_0x7d51('0x30')][_0x7d51('0x1a')]);_0x173de3[_0x7d51('0x1c')]=qs['offset'](_0x489265[_0x7d51('0x30')][_0x7d51('0x1c')]);}return _0x1af356[_0x7d51('0x4b')](_0x173de3);}})[_0x7d51('0x23')](function(_0x180663){if(_0x180663){return _0x180663?{'count':_0x5e313f,'rows':_0x180663}:null;}})['then'](respondWithResult(_0x3aa11f,null))[_0x7d51('0x40')](handleError(_0x3aa11f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 2a44976..774113c 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 _0x0c57=['moment','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x0c57,0x75));var _0x70c5=function(_0x12dea2,_0x9b6ffa){_0x12dea2=_0x12dea2-0x0;var _0x19c881=_0x0c57[_0x12dea2];return _0x19c881;};'use strict';var _=require(_0x70c5('0x0'));var util=require('util');var logger=require(_0x70c5('0x1'))(_0x70c5('0x2'));var moment=require(_0x70c5('0x3'));var BPromise=require('bluebird');var rp=require(_0x70c5('0x4'));var fs=require('fs');var path=require(_0x70c5('0x5'));var rimraf=require(_0x70c5('0x6'));var config=require('../../config/environment');var attributes=require(_0x70c5('0x7'));module[_0x70c5('0x8')]=function(_0x4bfc48,_0x3da8bf){return _0x4bfc48[_0x70c5('0x9')](_0x70c5('0xa'),attributes,{'tableName':_0x70c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd993=['VtigerConfiguration','int_vtiger_configurations','../../config/logger','bluebird','path','rimraf','./intVtigerConfiguration.attributes','exports','define'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd993,0x158));var _0x3d99=function(_0x4192b6,_0x24c143){_0x4192b6=_0x4192b6-0x0;var _0x439a6e=_0xd993[_0x4192b6];return _0x439a6e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3d99('0x0'))('api');var moment=require('moment');var BPromise=require(_0x3d99('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d99('0x2'));var rimraf=require(_0x3d99('0x3'));var config=require('../../config/environment');var attributes=require(_0x3d99('0x4'));module[_0x3d99('0x5')]=function(_0x58d95c,_0x597944){return _0x58d95c[_0x3d99('0x6')](_0x3d99('0x7'),attributes,{'tableName':_0x3d99('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 9b2a20d..3b0be9a 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 _0x08f4=['then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08f4,0x11f));var _0x408f=function(_0x138c9b,_0x12182d){_0x138c9b=_0x138c9b-0x0;var _0x4b1001=_0x08f4[_0x138c9b];return _0x4b1001;};'use strict';var _=require(_0x408f('0x0'));var util=require(_0x408f('0x1'));var moment=require('moment');var BPromise=require(_0x408f('0x2'));var rs=require(_0x408f('0x3'));var fs=require('fs');var Redis=require(_0x408f('0x4'));var db=require(_0x408f('0x5'))['db'];var utils=require(_0x408f('0x6'));var logger=require(_0x408f('0x7'))(_0x408f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x408f('0x9')][_0x408f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e5da,_0x1c4049,_0x4d357f){return new BPromise(function(_0x5bbe8e,_0x399aba){return client[_0x408f('0xb')](_0x45e5da,_0x4d357f)[_0x408f('0xc')](function(_0x3a800a){logger[_0x408f('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x1c4049,_0x408f('0xe'));logger[_0x408f('0xf')](_0x408f('0x10'),_0x1c4049,_0x408f('0xe'),JSON[_0x408f('0x11')](_0x3a800a));if(_0x3a800a[_0x408f('0x12')]){if(_0x3a800a['error'][_0x408f('0x13')]===0x1f4){logger[_0x408f('0x12')](_0x408f('0x14'),_0x1c4049,_0x3a800a[_0x408f('0x12')][_0x408f('0x15')]);return _0x399aba(_0x3a800a[_0x408f('0x12')][_0x408f('0x15')]);}logger[_0x408f('0x12')](_0x408f('0x14'),_0x1c4049,_0x3a800a['error'][_0x408f('0x15')]);return _0x5bbe8e(_0x3a800a[_0x408f('0x12')][_0x408f('0x15')]);}else{logger['info'](_0x408f('0x14'),_0x1c4049,_0x408f('0xe'));_0x5bbe8e(_0x3a800a['result']['message']);}})[_0x408f('0x16')](function(_0x333e1a){logger[_0x408f('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x1c4049,_0x333e1a);_0x399aba(_0x333e1a);});});} \ No newline at end of file +var _0x1803=['then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x1803,0x113));var _0x3180=function(_0x277a25,_0x361f87){_0x277a25=_0x277a25-0x0;var _0x53580e=_0x1803[_0x277a25];return _0x53580e;};'use strict';var _=require(_0x3180('0x0'));var util=require('util');var moment=require(_0x3180('0x1'));var BPromise=require(_0x3180('0x2'));var rs=require(_0x3180('0x3'));var fs=require('fs');var Redis=require(_0x3180('0x4'));var db=require(_0x3180('0x5'))['db'];var utils=require(_0x3180('0x6'));var logger=require('../../config/logger')(_0x3180('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3180('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ac830,_0x4d07d9,_0x3b5aae){return new BPromise(function(_0x10b8a4,_0x21b996){return client[_0x3180('0x9')](_0x4ac830,_0x3b5aae)[_0x3180('0xa')](function(_0x2544f3){logger[_0x3180('0xb')](_0x3180('0xc'),_0x4d07d9,_0x3180('0xd'));logger['debug'](_0x3180('0xe'),_0x4d07d9,_0x3180('0xd'),JSON['stringify'](_0x2544f3));if(_0x2544f3[_0x3180('0xf')]){if(_0x2544f3[_0x3180('0xf')][_0x3180('0x10')]===0x1f4){logger[_0x3180('0xf')](_0x3180('0xc'),_0x4d07d9,_0x2544f3[_0x3180('0xf')]['message']);return _0x21b996(_0x2544f3[_0x3180('0xf')][_0x3180('0x11')]);}logger[_0x3180('0xf')](_0x3180('0xc'),_0x4d07d9,_0x2544f3['error'][_0x3180('0x11')]);return _0x10b8a4(_0x2544f3[_0x3180('0xf')]['message']);}else{logger['info'](_0x3180('0xc'),_0x4d07d9,_0x3180('0xd'));_0x10b8a4(_0x2544f3[_0x3180('0x12')][_0x3180('0x11')]);}})['catch'](function(_0x31bd4c){logger[_0x3180('0xf')](_0x3180('0xc'),_0x4d07d9,_0x31bd4c);_0x21b996(_0x31bd4c);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 96f00a9..bd130fe 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 _0xba6a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','create','/:id','update','delete','destroy','multer','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xba6a,0x14e));var _0xaba6=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xba6a[_0x2d89ce];return _0x3fad10;};'use strict';var multer=require(_0xaba6('0x0'));var util=require(_0xaba6('0x1'));var path=require('path');var timeout=require(_0xaba6('0x2'));var express=require('express');var router=express[_0xaba6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaba6('0x4'));var interaction=require(_0xaba6('0x5'));var config=require(_0xaba6('0x6'));var controller=require(_0xaba6('0x7'));router[_0xaba6('0x8')]('/',auth[_0xaba6('0x9')](),controller[_0xaba6('0xa')]);router[_0xaba6('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xaba6('0xb')]);router['put'](_0xaba6('0xc'),auth[_0xaba6('0x9')](),controller[_0xaba6('0xd')]);router[_0xaba6('0xe')](_0xaba6('0xc'),auth[_0xaba6('0x9')](),controller[_0xaba6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x1b95=['update','destroy','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','/:id','isAuthenticated','show','post','create','put'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x1b95,0xd2));var _0x51b9=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x1b95[_0x40bffc];return _0x3007e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51b9('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x51b9('0x1')]();var fs_extra=require(_0x51b9('0x2'));var auth=require(_0x51b9('0x3'));var interaction=require(_0x51b9('0x4'));var config=require(_0x51b9('0x5'));var controller=require(_0x51b9('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x51b9('0x7')](_0x51b9('0x8'),auth[_0x51b9('0x9')](),controller[_0x51b9('0xa')]);router[_0x51b9('0xb')]('/',auth[_0x51b9('0x9')](),controller[_0x51b9('0xc')]);router[_0x51b9('0xd')](_0x51b9('0x8'),auth['isAuthenticated'](),controller[_0x51b9('0xe')]);router['delete']('/:id',auth[_0x51b9('0x9')](),controller[_0x51b9('0xf')]);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 c7fe722..5be75c5 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 _0xcf23=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5e5dff,_0x4d8f5a){var _0x408a07=function(_0x4f237a){while(--_0x4f237a){_0x5e5dff['push'](_0x5e5dff['shift']());}};_0x408a07(++_0x4d8f5a);}(_0xcf23,0x1e7));var _0x3cf2=function(_0x50feae,_0x5c84bd){_0x50feae=_0x50feae-0x0;var _0x1d2bef=_0xcf23[_0x50feae];return _0x1d2bef;};'use strict';var Sequelize=require(_0x3cf2('0x0'));module[_0x3cf2('0x1')]={'type':{'type':Sequelize[_0x3cf2('0x2')](_0x3cf2('0x3'),_0x3cf2('0x4'),_0x3cf2('0x5'),_0x3cf2('0x6'),_0x3cf2('0x7')),'defaultValue':_0x3cf2('0x3')},'content':{'type':Sequelize[_0x3cf2('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x3cf2('0x3'),_0x3cf2('0x4'),_0x3cf2('0x5'))},'keyContent':{'type':Sequelize[_0x3cf2('0x8')]},'idField':{'type':Sequelize[_0x3cf2('0x8')]},'nameField':{'type':Sequelize[_0x3cf2('0x8')]},'customField':{'type':Sequelize[_0x3cf2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3cf2('0x8')]}}; \ No newline at end of file +var _0x1aee=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x1aee,0x1cd));var _0xe1ae=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x1aee[_0x4eaa4c];return _0x15aec6;};'use strict';var Sequelize=require(_0xe1ae('0x0'));module[_0xe1ae('0x1')]={'type':{'type':Sequelize[_0xe1ae('0x2')](_0xe1ae('0x3'),_0xe1ae('0x4'),_0xe1ae('0x5'),'keyValue',_0xe1ae('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe1ae('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xe1ae('0x3'),'variable',_0xe1ae('0x5'))},'keyContent':{'type':Sequelize[_0xe1ae('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe1ae('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe1ae('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b462d3e..4b7c498 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 _0xb66d=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x5d52a9,_0x5a2dd5){var _0xd4a021=function(_0x210aee){while(--_0x210aee){_0x5d52a9['push'](_0x5d52a9['shift']());}};_0xd4a021(++_0x5a2dd5);}(_0xb66d,0x114));var _0xdb66=function(_0x23fcec,_0x48ec4c){_0x23fcec=_0x23fcec-0x0;var _0x447567=_0xb66d[_0x23fcec];return _0x447567;};'use strict';var emlformat=require(_0xdb66('0x0'));var rimraf=require(_0xdb66('0x1'));var zipdir=require(_0xdb66('0x2'));var jsonpatch=require(_0xdb66('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb66('0x4'));var Mustache=require(_0xdb66('0x5'));var util=require(_0xdb66('0x6'));var path=require('path');var sox=require(_0xdb66('0x7'));var csv=require(_0xdb66('0x8'));var ejs=require(_0xdb66('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb66('0xa'));var squel=require(_0xdb66('0xb'));var crypto=require(_0xdb66('0xc'));var jsforce=require(_0xdb66('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdb66('0xe'));var Papa=require(_0xdb66('0xf'));var Redis=require(_0xdb66('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdb66('0x11'));var as=require(_0xdb66('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb66('0x13'))(_0xdb66('0x14'));var utils=require('../../config/utils');var config=require(_0xdb66('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21022f,_0x38a149){_0x38a149=_0x38a149||0xcc;return function(_0x6ab5f1){if(_0x6ab5f1){return _0x21022f['sendStatus'](_0x38a149);}return _0x21022f['status'](_0x38a149)['end']();};}function respondWithResult(_0x45542c,_0x27c75b){_0x27c75b=_0x27c75b||0xc8;return function(_0x3fe884){if(_0x3fe884){return _0x45542c['status'](_0x27c75b)[_0xdb66('0x16')](_0x3fe884);}};}function respondWithFilteredResult(_0x44e3f,_0x345880){return function(_0x5acde0){if(_0x5acde0){var _0x160ea7=typeof _0x345880['offset']===_0xdb66('0x17')&&typeof _0x345880[_0xdb66('0x18')]===_0xdb66('0x17');var _0x3d7749=_0x5acde0[_0xdb66('0x19')];var _0x6b8982=_0x160ea7?0x0:_0x345880[_0xdb66('0x1a')];var _0x58ab41=_0x160ea7?_0x5acde0[_0xdb66('0x19')]:_0x345880[_0xdb66('0x1a')]+_0x345880[_0xdb66('0x18')];var _0xe221be;if(_0x58ab41>=_0x3d7749){_0x58ab41=_0x3d7749;_0xe221be=0xc8;}else{_0xe221be=0xce;}_0x44e3f[_0xdb66('0x1b')](_0xe221be);return _0x44e3f[_0xdb66('0x1c')](_0xdb66('0x1d'),_0x6b8982+'-'+_0x58ab41+'/'+_0x3d7749)[_0xdb66('0x16')](_0x5acde0);}return null;};}function patchUpdates(_0x103a36){return function(_0x2fecc2){try{jsonpatch['apply'](_0x2fecc2,_0x103a36,!![]);}catch(_0x36b50c){return BPromise[_0xdb66('0x1e')](_0x36b50c);}return _0x2fecc2[_0xdb66('0x1f')]();};}function saveUpdates(_0x36a02f,_0x5d279e){return function(_0x4958b9){if(_0x4958b9){return _0x4958b9[_0xdb66('0x20')](_0x36a02f)[_0xdb66('0x21')](function(_0x24472b){return _0x24472b;});}return null;};}function removeEntity(_0x2b635b,_0x3edb10){return function(_0x3ee6d2){if(_0x3ee6d2){return _0x3ee6d2[_0xdb66('0x22')]()[_0xdb66('0x21')](function(){_0x2b635b[_0xdb66('0x1b')](0xcc)[_0xdb66('0x23')]();});}};}function handleEntityNotFound(_0x118b0e,_0x53bbf9){return function(_0x5c0076){if(!_0x5c0076){_0x118b0e[_0xdb66('0x24')](0x194);}return _0x5c0076;};}function handleError(_0x2ac6aa,_0x5b8686){_0x5b8686=_0x5b8686||0x1f4;return function(_0x1ec2f1){logger[_0xdb66('0x25')](_0x1ec2f1[_0xdb66('0x26')]);if(_0x1ec2f1[_0xdb66('0x27')]){delete _0x1ec2f1['name'];}_0x2ac6aa[_0xdb66('0x1b')](_0x5b8686)[_0xdb66('0x28')](_0x1ec2f1);};}exports['index']=function(_0x2933cc,_0xb78b94){var _0x32ec24={},_0x257241={},_0x9fac0d={'count':0x0,'rows':[]};var _0x22b257=_[_0xdb66('0x29')](db[_0xdb66('0x2a')][_0xdb66('0x2b')],function(_0x50b879){return{'name':_0x50b879[_0xdb66('0x2c')],'type':_0x50b879[_0xdb66('0x2d')][_0xdb66('0x2e')]};});_0x257241[_0xdb66('0x2f')]=_[_0xdb66('0x29')](_0x22b257,_0xdb66('0x27'));_0x257241[_0xdb66('0x30')]=_[_0xdb66('0x31')](_0x2933cc[_0xdb66('0x30')]);_0x257241[_0xdb66('0x32')]=_[_0xdb66('0x33')](_0x257241[_0xdb66('0x2f')],_0x257241[_0xdb66('0x30')]);_0x32ec24[_0xdb66('0x34')]=_[_0xdb66('0x33')](_0x257241[_0xdb66('0x2f')],qs[_0xdb66('0x35')](_0x2933cc['query']['fields']));_0x32ec24[_0xdb66('0x34')]=_0x32ec24['attributes'][_0xdb66('0x36')]?_0x32ec24[_0xdb66('0x34')]:_0x257241[_0xdb66('0x2f')];if(!_0x2933cc[_0xdb66('0x30')]['hasOwnProperty'](_0xdb66('0x37'))){_0x32ec24[_0xdb66('0x18')]=qs[_0xdb66('0x18')](_0x2933cc[_0xdb66('0x30')]['limit']);_0x32ec24[_0xdb66('0x1a')]=qs[_0xdb66('0x1a')](_0x2933cc[_0xdb66('0x30')]['offset']);}_0x32ec24[_0xdb66('0x38')]=qs[_0xdb66('0x39')](_0x2933cc[_0xdb66('0x30')][_0xdb66('0x39')]);_0x32ec24[_0xdb66('0x3a')]=qs[_0xdb66('0x32')](_[_0xdb66('0x3b')](_0x2933cc[_0xdb66('0x30')],_0x257241[_0xdb66('0x32')]),_0x22b257);if(_0x2933cc[_0xdb66('0x30')]['filter']){_0x32ec24['where']=_[_0xdb66('0x3c')](_0x32ec24['where'],{'$or':_['map'](_0x22b257,function(_0x14457b){if(_0x14457b[_0xdb66('0x2d')]!==_0xdb66('0x3d')){var _0x18d7a0={};_0x18d7a0[_0x14457b[_0xdb66('0x27')]]={'$like':'%'+_0x2933cc['query'][_0xdb66('0x3e')]+'%'};return _0x18d7a0;}})});}_0x32ec24=_[_0xdb66('0x3c')]({},_0x32ec24,_0x2933cc[_0xdb66('0x3f')]);var _0x39238d={'where':_0x32ec24['where']};return db[_0xdb66('0x2a')]['count'](_0x39238d)[_0xdb66('0x21')](function(_0xebf98e){_0x9fac0d[_0xdb66('0x19')]=_0xebf98e;if(_0x2933cc[_0xdb66('0x30')][_0xdb66('0x40')]){_0x32ec24['include']=[{'all':!![]}];}return db[_0xdb66('0x2a')][_0xdb66('0x41')](_0x32ec24);})[_0xdb66('0x21')](function(_0x129c83){_0x9fac0d[_0xdb66('0x42')]=_0x129c83;return _0x9fac0d;})['then'](respondWithFilteredResult(_0xb78b94,_0x32ec24))[_0xdb66('0x43')](handleError(_0xb78b94,null));};exports['show']=function(_0x253b82,_0x1700a5){var _0x3f8cc4={'raw':!![],'where':{'id':_0x253b82[_0xdb66('0x44')]['id']}},_0x2c5abd={};_0x2c5abd['model']=_[_0xdb66('0x31')](db[_0xdb66('0x2a')][_0xdb66('0x2b')]);_0x2c5abd[_0xdb66('0x30')]=_['keys'](_0x253b82[_0xdb66('0x30')]);_0x2c5abd['filters']=_['intersection'](_0x2c5abd[_0xdb66('0x2f')],_0x2c5abd[_0xdb66('0x30')]);_0x3f8cc4[_0xdb66('0x34')]=_['intersection'](_0x2c5abd[_0xdb66('0x2f')],qs['fields'](_0x253b82[_0xdb66('0x30')]['fields']));_0x3f8cc4['attributes']=_0x3f8cc4[_0xdb66('0x34')][_0xdb66('0x36')]?_0x3f8cc4[_0xdb66('0x34')]:_0x2c5abd['model'];if(_0x253b82['query'][_0xdb66('0x40')]){_0x3f8cc4[_0xdb66('0x45')]=[{'all':!![]}];}_0x3f8cc4=_[_0xdb66('0x3c')]({},_0x3f8cc4,_0x253b82[_0xdb66('0x3f')]);return db['VtigerField'][_0xdb66('0x46')](_0x3f8cc4)[_0xdb66('0x21')](handleEntityNotFound(_0x1700a5,null))[_0xdb66('0x21')](respondWithResult(_0x1700a5,null))[_0xdb66('0x43')](handleError(_0x1700a5,null));};exports[_0xdb66('0x47')]=function(_0x1e5cda,_0x461802){return db[_0xdb66('0x2a')][_0xdb66('0x47')](_0x1e5cda[_0xdb66('0x48')],{})[_0xdb66('0x21')](respondWithResult(_0x461802,0xc9))[_0xdb66('0x43')](handleError(_0x461802,null));};exports[_0xdb66('0x20')]=function(_0xcd604,_0x168d2d){if(_0xcd604[_0xdb66('0x48')]['id']){delete _0xcd604['body']['id'];}return db['VtigerField'][_0xdb66('0x46')]({'where':{'id':_0xcd604[_0xdb66('0x44')]['id']}})[_0xdb66('0x21')](handleEntityNotFound(_0x168d2d,null))['then'](saveUpdates(_0xcd604[_0xdb66('0x48')],null))['then'](respondWithResult(_0x168d2d,null))[_0xdb66('0x43')](handleError(_0x168d2d,null));};exports[_0xdb66('0x22')]=function(_0x509ef5,_0x72bef1){return db[_0xdb66('0x2a')][_0xdb66('0x46')]({'where':{'id':_0x509ef5[_0xdb66('0x44')]['id']}})[_0xdb66('0x21')](handleEntityNotFound(_0x72bef1,null))[_0xdb66('0x21')](removeEntity(_0x72bef1,null))[_0xdb66('0x43')](handleError(_0x72bef1,null));}; \ No newline at end of file +var _0x059f=['name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','VtigerField','findAll','rows','catch','show','params','find','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','error','stack'];(function(_0x48d122,_0x4bcd20){var _0x36e303=function(_0x2b7a2e){while(--_0x2b7a2e){_0x48d122['push'](_0x48d122['shift']());}};_0x36e303(++_0x4bcd20);}(_0x059f,0x1f1));var _0xf059=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x059f[_0x5bfa44];return _0x43815f;};'use strict';var emlformat=require(_0xf059('0x0'));var rimraf=require(_0xf059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf059('0x2'));var rp=require(_0xf059('0x3'));var moment=require(_0xf059('0x4'));var BPromise=require(_0xf059('0x5'));var Mustache=require(_0xf059('0x6'));var util=require(_0xf059('0x7'));var path=require(_0xf059('0x8'));var sox=require(_0xf059('0x9'));var csv=require(_0xf059('0xa'));var ejs=require(_0xf059('0xb'));var fs=require('fs');var fs_extra=require(_0xf059('0xc'));var _=require(_0xf059('0xd'));var squel=require(_0xf059('0xe'));var crypto=require(_0xf059('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf059('0x10'));var toCsv=require(_0xf059('0xa'));var querystring=require(_0xf059('0x11'));var Papa=require('papaparse');var Redis=require(_0xf059('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf059('0x13'));var as=require(_0xf059('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf059('0x15'))(_0xf059('0x16'));var utils=require(_0xf059('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf059('0x18'));var db=require(_0xf059('0x19'))['db'];function respondWithStatusCode(_0x40a38e,_0x567453){_0x567453=_0x567453||0xcc;return function(_0x25be57){if(_0x25be57){return _0x40a38e[_0xf059('0x1a')](_0x567453);}return _0x40a38e['status'](_0x567453)[_0xf059('0x1b')]();};}function respondWithResult(_0x661719,_0x1a28f1){_0x1a28f1=_0x1a28f1||0xc8;return function(_0x25dc72){if(_0x25dc72){return _0x661719[_0xf059('0x1c')](_0x1a28f1)['json'](_0x25dc72);}};}function respondWithFilteredResult(_0x2329a1,_0x12ad16){return function(_0x148136){if(_0x148136){var _0x56bf89=typeof _0x12ad16[_0xf059('0x1d')]==='undefined'&&typeof _0x12ad16[_0xf059('0x1e')]===_0xf059('0x1f');var _0x5f00a0=_0x148136['count'];var _0x32a528=_0x56bf89?0x0:_0x12ad16['offset'];var _0xed6211=_0x56bf89?_0x148136[_0xf059('0x20')]:_0x12ad16[_0xf059('0x1d')]+_0x12ad16['limit'];var _0x120822;if(_0xed6211>=_0x5f00a0){_0xed6211=_0x5f00a0;_0x120822=0xc8;}else{_0x120822=0xce;}_0x2329a1[_0xf059('0x1c')](_0x120822);return _0x2329a1[_0xf059('0x21')](_0xf059('0x22'),_0x32a528+'-'+_0xed6211+'/'+_0x5f00a0)[_0xf059('0x23')](_0x148136);}return null;};}function patchUpdates(_0x78355d){return function(_0x3e8ad5){try{jsonpatch[_0xf059('0x24')](_0x3e8ad5,_0x78355d,!![]);}catch(_0x5644ce){return BPromise[_0xf059('0x25')](_0x5644ce);}return _0x3e8ad5[_0xf059('0x26')]();};}function saveUpdates(_0x18e837,_0x571bb1){return function(_0x5ef028){if(_0x5ef028){return _0x5ef028['update'](_0x18e837)[_0xf059('0x27')](function(_0x6572fe){return _0x6572fe;});}return null;};}function removeEntity(_0x1de5ea,_0x2061da){return function(_0x470656){if(_0x470656){return _0x470656['destroy']()['then'](function(){_0x1de5ea[_0xf059('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x300a43,_0x4981cc){return function(_0x52a44b){if(!_0x52a44b){_0x300a43[_0xf059('0x1a')](0x194);}return _0x52a44b;};}function handleError(_0x4e00b6,_0x1a8c4a){_0x1a8c4a=_0x1a8c4a||0x1f4;return function(_0x499441){logger[_0xf059('0x28')](_0x499441[_0xf059('0x29')]);if(_0x499441[_0xf059('0x2a')]){delete _0x499441[_0xf059('0x2a')];}_0x4e00b6[_0xf059('0x1c')](_0x1a8c4a)[_0xf059('0x2b')](_0x499441);};}exports[_0xf059('0x2c')]=function(_0x21fc51,_0x278801){var _0x56fdeb={},_0x3d23b0={},_0x538dd7={'count':0x0,'rows':[]};var _0x5081d2=_[_0xf059('0x2d')](db['VtigerField'][_0xf059('0x2e')],function(_0x1375f3){return{'name':_0x1375f3[_0xf059('0x2f')],'type':_0x1375f3[_0xf059('0x30')][_0xf059('0x31')]};});_0x3d23b0[_0xf059('0x32')]=_[_0xf059('0x2d')](_0x5081d2,'name');_0x3d23b0[_0xf059('0x33')]=_[_0xf059('0x34')](_0x21fc51[_0xf059('0x33')]);_0x3d23b0[_0xf059('0x35')]=_[_0xf059('0x36')](_0x3d23b0['model'],_0x3d23b0[_0xf059('0x33')]);_0x56fdeb['attributes']=_[_0xf059('0x36')](_0x3d23b0[_0xf059('0x32')],qs[_0xf059('0x37')](_0x21fc51['query'][_0xf059('0x37')]));_0x56fdeb[_0xf059('0x38')]=_0x56fdeb[_0xf059('0x38')][_0xf059('0x39')]?_0x56fdeb[_0xf059('0x38')]:_0x3d23b0['model'];if(!_0x21fc51['query'][_0xf059('0x3a')]('nolimit')){_0x56fdeb[_0xf059('0x1e')]=qs[_0xf059('0x1e')](_0x21fc51[_0xf059('0x33')][_0xf059('0x1e')]);_0x56fdeb[_0xf059('0x1d')]=qs[_0xf059('0x1d')](_0x21fc51[_0xf059('0x33')][_0xf059('0x1d')]);}_0x56fdeb[_0xf059('0x3b')]=qs[_0xf059('0x3c')](_0x21fc51[_0xf059('0x33')][_0xf059('0x3c')]);_0x56fdeb[_0xf059('0x3d')]=qs[_0xf059('0x35')](_[_0xf059('0x3e')](_0x21fc51[_0xf059('0x33')],_0x3d23b0['filters']),_0x5081d2);if(_0x21fc51[_0xf059('0x33')][_0xf059('0x3f')]){_0x56fdeb[_0xf059('0x3d')]=_[_0xf059('0x40')](_0x56fdeb[_0xf059('0x3d')],{'$or':_['map'](_0x5081d2,function(_0x4c2b68){if(_0x4c2b68[_0xf059('0x30')]!=='VIRTUAL'){var _0x52444d={};_0x52444d[_0x4c2b68[_0xf059('0x2a')]]={'$like':'%'+_0x21fc51['query'][_0xf059('0x3f')]+'%'};return _0x52444d;}})});}_0x56fdeb=_[_0xf059('0x40')]({},_0x56fdeb,_0x21fc51[_0xf059('0x41')]);var _0x5e0375={'where':_0x56fdeb['where']};return db['VtigerField'][_0xf059('0x20')](_0x5e0375)[_0xf059('0x27')](function(_0x51ead9){_0x538dd7['count']=_0x51ead9;if(_0x21fc51['query'][_0xf059('0x42')]){_0x56fdeb[_0xf059('0x43')]=[{'all':!![]}];}return db[_0xf059('0x44')][_0xf059('0x45')](_0x56fdeb);})[_0xf059('0x27')](function(_0x35a269){_0x538dd7[_0xf059('0x46')]=_0x35a269;return _0x538dd7;})[_0xf059('0x27')](respondWithFilteredResult(_0x278801,_0x56fdeb))[_0xf059('0x47')](handleError(_0x278801,null));};exports[_0xf059('0x48')]=function(_0x37175f,_0x28b7f2){var _0x106298={'raw':!![],'where':{'id':_0x37175f[_0xf059('0x49')]['id']}},_0x33137c={};_0x33137c[_0xf059('0x32')]=_[_0xf059('0x34')](db[_0xf059('0x44')][_0xf059('0x2e')]);_0x33137c[_0xf059('0x33')]=_[_0xf059('0x34')](_0x37175f[_0xf059('0x33')]);_0x33137c[_0xf059('0x35')]=_[_0xf059('0x36')](_0x33137c['model'],_0x33137c[_0xf059('0x33')]);_0x106298[_0xf059('0x38')]=_[_0xf059('0x36')](_0x33137c[_0xf059('0x32')],qs[_0xf059('0x37')](_0x37175f[_0xf059('0x33')][_0xf059('0x37')]));_0x106298[_0xf059('0x38')]=_0x106298[_0xf059('0x38')]['length']?_0x106298[_0xf059('0x38')]:_0x33137c[_0xf059('0x32')];if(_0x37175f[_0xf059('0x33')]['includeAll']){_0x106298[_0xf059('0x43')]=[{'all':!![]}];}_0x106298=_[_0xf059('0x40')]({},_0x106298,_0x37175f['options']);return db[_0xf059('0x44')][_0xf059('0x4a')](_0x106298)[_0xf059('0x27')](handleEntityNotFound(_0x28b7f2,null))[_0xf059('0x27')](respondWithResult(_0x28b7f2,null))[_0xf059('0x47')](handleError(_0x28b7f2,null));};exports['create']=function(_0x324f2d,_0x22a0ba){return db[_0xf059('0x44')]['create'](_0x324f2d[_0xf059('0x4b')],{})[_0xf059('0x27')](respondWithResult(_0x22a0ba,0xc9))[_0xf059('0x47')](handleError(_0x22a0ba,null));};exports['update']=function(_0x56ed69,_0x327b26){if(_0x56ed69['body']['id']){delete _0x56ed69[_0xf059('0x4b')]['id'];}return db[_0xf059('0x44')][_0xf059('0x4a')]({'where':{'id':_0x56ed69[_0xf059('0x49')]['id']}})['then'](handleEntityNotFound(_0x327b26,null))[_0xf059('0x27')](saveUpdates(_0x56ed69[_0xf059('0x4b')],null))['then'](respondWithResult(_0x327b26,null))[_0xf059('0x47')](handleError(_0x327b26,null));};exports[_0xf059('0x4c')]=function(_0x455857,_0x245149){return db[_0xf059('0x44')][_0xf059('0x4a')]({'where':{'id':_0x455857['params']['id']}})[_0xf059('0x27')](handleEntityNotFound(_0x245149,null))[_0xf059('0x27')](removeEntity(_0x245149,null))['catch'](handleError(_0x245149,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index b571d61..743a1f5 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 _0x6c4d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','FieldId','lodash'];(function(_0x31f0f4,_0x56eb1a){var _0x21f7d8=function(_0x437df6){while(--_0x437df6){_0x31f0f4['push'](_0x31f0f4['shift']());}};_0x21f7d8(++_0x56eb1a);}(_0x6c4d,0xcf));var _0xd6c4=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6c4d[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0xd6c4('0x0'));var util=require(_0xd6c4('0x1'));var logger=require(_0xd6c4('0x2'))(_0xd6c4('0x3'));var moment=require(_0xd6c4('0x4'));var BPromise=require(_0xd6c4('0x5'));var rp=require(_0xd6c4('0x6'));var fs=require('fs');var path=require(_0xd6c4('0x7'));var rimraf=require(_0xd6c4('0x8'));var config=require(_0xd6c4('0x9'));var attributes=require(_0xd6c4('0xa'));module[_0xd6c4('0xb')]=function(_0x43d868,_0x32d472){return _0x43d868[_0xd6c4('0xc')](_0xd6c4('0xd'),attributes,{'tableName':_0xd6c4('0xe'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xd6c4('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1669=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','FieldId','lodash','util'];(function(_0x487558,_0x4191d0){var _0x6204f7=function(_0x2f6b88){while(--_0x2f6b88){_0x487558['push'](_0x487558['shift']());}};_0x6204f7(++_0x4191d0);}(_0x1669,0x10c));var _0x9166=function(_0x36dcf5,_0x3de341){_0x36dcf5=_0x36dcf5-0x0;var _0x2e3eb6=_0x1669[_0x36dcf5];return _0x2e3eb6;};'use strict';var _=require(_0x9166('0x0'));var util=require(_0x9166('0x1'));var logger=require(_0x9166('0x2'))(_0x9166('0x3'));var moment=require(_0x9166('0x4'));var BPromise=require('bluebird');var rp=require(_0x9166('0x5'));var fs=require('fs');var path=require(_0x9166('0x6'));var rimraf=require(_0x9166('0x7'));var config=require(_0x9166('0x8'));var attributes=require(_0x9166('0x9'));module[_0x9166('0xa')]=function(_0x2cec7e,_0x369956){return _0x2cec7e[_0x9166('0xb')](_0x9166('0xc'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x9166('0xd'),'fields':['idField',_0x9166('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 4aa48f3..d4a52e6 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 _0x0360=['rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','VtigerField,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x586452,_0x2139e1){var _0x274c2a=function(_0x22cfdd){while(--_0x22cfdd){_0x586452['push'](_0x586452['shift']());}};_0x274c2a(++_0x2139e1);}(_0x0360,0x15a));var _0x0036=function(_0x3d2b78,_0x5272fd){_0x3d2b78=_0x3d2b78-0x0;var _0x3d474a=_0x0360[_0x3d2b78];return _0x3d474a;};'use strict';var _=require(_0x0036('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0036('0x1'));var rs=require(_0x0036('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0036('0x3'))['db'];var utils=require(_0x0036('0x4'));var logger=require(_0x0036('0x5'))(_0x0036('0x6'));var config=require('../../config/environment');var jayson=require(_0x0036('0x7'));var client=jayson[_0x0036('0x8')][_0x0036('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x332273,_0x2ae95c,_0x24dfc4){return new BPromise(function(_0x49c56d,_0x3216ec){return client[_0x0036('0xa')](_0x332273,_0x24dfc4)[_0x0036('0xb')](function(_0x595452){logger['info']('VtigerField,\x20%s,\x20%s',_0x2ae95c,_0x0036('0xc'));logger[_0x0036('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x2ae95c,'request\x20sent',JSON[_0x0036('0xe')](_0x595452));if(_0x595452[_0x0036('0xf')]){if(_0x595452[_0x0036('0xf')][_0x0036('0x10')]===0x1f4){logger[_0x0036('0xf')](_0x0036('0x11'),_0x2ae95c,_0x595452[_0x0036('0xf')][_0x0036('0x12')]);return _0x3216ec(_0x595452[_0x0036('0xf')]['message']);}logger[_0x0036('0xf')](_0x0036('0x11'),_0x2ae95c,_0x595452[_0x0036('0xf')][_0x0036('0x12')]);return _0x49c56d(_0x595452['error']['message']);}else{logger[_0x0036('0x13')](_0x0036('0x11'),_0x2ae95c,_0x0036('0xc'));_0x49c56d(_0x595452[_0x0036('0x14')][_0x0036('0x12')]);}})[_0x0036('0x15')](function(_0x2abf43){logger['error'](_0x0036('0x11'),_0x2ae95c,_0x2abf43);_0x3216ec(_0x2abf43);});});} \ No newline at end of file +var _0x42c8=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x42c8,0x110));var _0x842c=function(_0x57ebed,_0xfac0ac){_0x57ebed=_0x57ebed-0x0;var _0x3a0874=_0x42c8[_0x57ebed];return _0x3a0874;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x842c('0x0'));var BPromise=require(_0x842c('0x1'));var rs=require(_0x842c('0x2'));var fs=require('fs');var Redis=require(_0x842c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x842c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x842c('0x5'));var jayson=require(_0x842c('0x6'));var client=jayson[_0x842c('0x7')][_0x842c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x194568,_0x4a4aa7,_0x3837e5){return new BPromise(function(_0xe76956,_0x79540c){return client[_0x842c('0x9')](_0x194568,_0x3837e5)[_0x842c('0xa')](function(_0x3ff857){logger[_0x842c('0xb')](_0x842c('0xc'),_0x4a4aa7,_0x842c('0xd'));logger[_0x842c('0xe')](_0x842c('0xf'),_0x4a4aa7,_0x842c('0xd'),JSON[_0x842c('0x10')](_0x3ff857));if(_0x3ff857[_0x842c('0x11')]){if(_0x3ff857[_0x842c('0x11')][_0x842c('0x12')]===0x1f4){logger[_0x842c('0x11')](_0x842c('0xc'),_0x4a4aa7,_0x3ff857[_0x842c('0x11')][_0x842c('0x13')]);return _0x79540c(_0x3ff857['error'][_0x842c('0x13')]);}logger[_0x842c('0x11')]('VtigerField,\x20%s,\x20%s',_0x4a4aa7,_0x3ff857[_0x842c('0x11')]['message']);return _0xe76956(_0x3ff857[_0x842c('0x11')][_0x842c('0x13')]);}else{logger[_0x842c('0xb')]('VtigerField,\x20%s,\x20%s',_0x4a4aa7,'request\x20sent');_0xe76956(_0x3ff857[_0x842c('0x14')][_0x842c('0x13')]);}})[_0x842c('0x15')](function(_0x582a95){logger[_0x842c('0x11')](_0x842c('0xc'),_0x4a4aa7,_0x582a95);_0x79540c(_0x582a95);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index a6d4f07..4bfca73 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 _0x6391=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','/:id','destroy','exports','multer'];(function(_0x43b88c,_0x46fb04){var _0x407299=function(_0x16dcd3){while(--_0x16dcd3){_0x43b88c['push'](_0x43b88c['shift']());}};_0x407299(++_0x46fb04);}(_0x6391,0x1df));var _0x1639=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x6391[_0x3c5f8d];return _0x3b7beb;};'use strict';var multer=require(_0x1639('0x0'));var util=require(_0x1639('0x1'));var path=require(_0x1639('0x2'));var timeout=require(_0x1639('0x3'));var express=require('express');var router=express[_0x1639('0x4')]();var fs_extra=require(_0x1639('0x5'));var auth=require(_0x1639('0x6'));var interaction=require(_0x1639('0x7'));var config=require('../../config/environment');var controller=require(_0x1639('0x8'));router[_0x1639('0x9')]('/',auth[_0x1639('0xa')](),controller[_0x1639('0xb')]);router[_0x1639('0x9')]('/:id',auth[_0x1639('0xa')](),controller['show']);router[_0x1639('0x9')](_0x1639('0xc'),auth[_0x1639('0xa')](),controller[_0x1639('0xd')]);router[_0x1639('0x9')](_0x1639('0xe'),auth[_0x1639('0xa')](),controller[_0x1639('0xf')]);router['post']('/',auth[_0x1639('0xa')](),controller[_0x1639('0x10')]);router[_0x1639('0x11')](_0x1639('0xc'),auth[_0x1639('0xa')](),controller[_0x1639('0x12')]);router[_0x1639('0x13')]('/:id',auth[_0x1639('0xa')](),controller['update']);router[_0x1639('0x14')](_0x1639('0x15'),auth[_0x1639('0xa')](),controller[_0x1639('0x16')]);module[_0x1639('0x17')]=router; \ No newline at end of file +var _0x9d43=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9d43,0x1af));var _0x39d4=function(_0x4c3da1,_0x147578){_0x4c3da1=_0x4c3da1-0x0;var _0x2cb9b=_0x9d43[_0x4c3da1];return _0x2cb9b;};'use strict';var multer=require(_0x39d4('0x0'));var util=require(_0x39d4('0x1'));var path=require(_0x39d4('0x2'));var timeout=require('connect-timeout');var express=require(_0x39d4('0x3'));var router=express[_0x39d4('0x4')]();var fs_extra=require(_0x39d4('0x5'));var auth=require(_0x39d4('0x6'));var interaction=require(_0x39d4('0x7'));var config=require(_0x39d4('0x8'));var controller=require(_0x39d4('0x9'));router[_0x39d4('0xa')]('/',auth[_0x39d4('0xb')](),controller[_0x39d4('0xc')]);router['get']('/:id',auth[_0x39d4('0xb')](),controller[_0x39d4('0xd')]);router[_0x39d4('0xa')](_0x39d4('0xe'),auth[_0x39d4('0xb')](),controller['getConfigurations']);router[_0x39d4('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x39d4('0xf')]);router[_0x39d4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x39d4('0x10')](_0x39d4('0xe'),auth[_0x39d4('0xb')](),controller[_0x39d4('0x11')]);router[_0x39d4('0x12')](_0x39d4('0x13'),auth[_0x39d4('0xb')](),controller[_0x39d4('0x14')]);router[_0x39d4('0x15')](_0x39d4('0x13'),auth[_0x39d4('0xb')](),controller[_0x39d4('0x16')]);module[_0x39d4('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8095fa4..a278954 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 _0xb422=['newTab','STRING','ENUM','token','password','integrationTab'];(function(_0x5dcb2b,_0x2bdec7){var _0x4b7fc6=function(_0x2137f9){while(--_0x2137f9){_0x5dcb2b['push'](_0x5dcb2b['shift']());}};_0x4b7fc6(++_0x2bdec7);}(_0xb422,0x85));var _0x2b42=function(_0x5758c9,_0x3e7929){_0x5758c9=_0x5758c9-0x0;var _0x46892f=_0xb422[_0x5758c9];return _0x46892f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2b42('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x2b42('0x0')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2b42('0x0')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x2b42('0x1')]('password',_0x2b42('0x2')),'defaultValue':_0x2b42('0x3')},'serverUrl':{'type':Sequelize[_0x2b42('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2b42('0x4'),_0x2b42('0x5')),'defaultValue':_0x2b42('0x4')}}; \ No newline at end of file +var _0x2aa3=['password','integrationTab','newTab','sequelize','exports','STRING','remoteUri','ENUM'];(function(_0x55441b,_0x5ef62c){var _0x5b081a=function(_0x3a8133){while(--_0x3a8133){_0x55441b['push'](_0x55441b['shift']());}};_0x5b081a(++_0x5ef62c);}(_0x2aa3,0x83));var _0x32aa=function(_0x5098f6,_0x30d720){_0x5098f6=_0x5098f6-0x0;var _0x4377b2=_0x2aa3[_0x5098f6];return _0x4377b2;};'use strict';var Sequelize=require(_0x32aa('0x0'));module[_0x32aa('0x1')]={'name':{'type':Sequelize[_0x32aa('0x2')]},'description':{'type':Sequelize[_0x32aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x32aa('0x2')]},'token':{'type':Sequelize[_0x32aa('0x2')]},'remoteUri':{'type':Sequelize[_0x32aa('0x2')],'unique':_0x32aa('0x3')},'authType':{'type':Sequelize[_0x32aa('0x4')](_0x32aa('0x5'),'token'),'defaultValue':_0x32aa('0x5')},'serverUrl':{'type':Sequelize[_0x32aa('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x32aa('0x4')](_0x32aa('0x6'),_0x32aa('0x7')),'defaultValue':_0x32aa('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 0446fa1..fc59ba9 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 _0x0565=['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','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','ZendeskConfiguration','pick','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','username','password','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials'];(function(_0x159272,_0x4b788a){var _0x39d0e8=function(_0xd553b1){while(--_0xd553b1){_0x159272['push'](_0x159272['shift']());}};_0x39d0e8(++_0x4b788a);}(_0x0565,0xf2));var _0x5056=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x0565[_0x47fd36];return _0x21a0fc;};'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'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x53e98a,_0x2d44fb){_0x2d44fb=_0x2d44fb||0xcc;return function(_0x4b183a){if(_0x4b183a){return _0x53e98a[_0x5056('0x19')](_0x2d44fb);}return _0x53e98a[_0x5056('0x1a')](_0x2d44fb)[_0x5056('0x1b')]();};}function respondWithResult(_0x543cee,_0x1e8b64){_0x1e8b64=_0x1e8b64||0xc8;return function(_0x29d05f){if(_0x29d05f){return _0x543cee[_0x5056('0x1a')](_0x1e8b64)[_0x5056('0x1c')](_0x29d05f);}};}function respondWithFilteredResult(_0x21561d,_0x6a044a){return function(_0x4ac332){if(_0x4ac332){var _0x2b7a17=typeof _0x6a044a['offset']===_0x5056('0x1d')&&typeof _0x6a044a[_0x5056('0x1e')]===_0x5056('0x1d');var _0x1f2ac6=_0x4ac332[_0x5056('0x1f')];var _0x51b21e=_0x2b7a17?0x0:_0x6a044a[_0x5056('0x20')];var _0x56537e=_0x2b7a17?_0x4ac332['count']:_0x6a044a['offset']+_0x6a044a[_0x5056('0x1e')];var _0x517bf3;if(_0x56537e>=_0x1f2ac6){_0x56537e=_0x1f2ac6;_0x517bf3=0xc8;}else{_0x517bf3=0xce;}_0x21561d[_0x5056('0x1a')](_0x517bf3);return _0x21561d[_0x5056('0x21')](_0x5056('0x22'),_0x51b21e+'-'+_0x56537e+'/'+_0x1f2ac6)[_0x5056('0x1c')](_0x4ac332);}return null;};}function patchUpdates(_0x33035c){return function(_0x4835fd){try{jsonpatch[_0x5056('0x23')](_0x4835fd,_0x33035c,!![]);}catch(_0x3cfd41){return BPromise['reject'](_0x3cfd41);}return _0x4835fd[_0x5056('0x24')]();};}function saveUpdates(_0x1bccef,_0x2564d0){return function(_0x58b16d){if(_0x58b16d){return _0x58b16d[_0x5056('0x25')](_0x1bccef)[_0x5056('0x26')](function(_0x5afbfe){return _0x5afbfe;});}return null;};}function removeEntity(_0x4a64be,_0x29e166){return function(_0x2f36a3){if(_0x2f36a3){return _0x2f36a3[_0x5056('0x27')]()[_0x5056('0x26')](function(){_0x4a64be['status'](0xcc)[_0x5056('0x1b')]();});}};}function handleEntityNotFound(_0x25409f,_0x5d1656){return function(_0x2c4290){if(!_0x2c4290){_0x25409f['sendStatus'](0x194);}return _0x2c4290;};}function handleError(_0x15f03f,_0x39d539){_0x39d539=_0x39d539||0x1f4;return function(_0x1106e5){logger[_0x5056('0x28')](_0x1106e5[_0x5056('0x29')]);if(_0x1106e5['name']){delete _0x1106e5[_0x5056('0x2a')];}_0x15f03f[_0x5056('0x1a')](_0x39d539)[_0x5056('0x2b')](_0x1106e5);};}exports[_0x5056('0x2c')]=function(_0x53e6db,_0x24d33e){var _0x5b0270={},_0x70246c={},_0x49fe67={'count':0x0,'rows':[]};var _0x56ccba=_['map'](db[_0x5056('0x2d')][_0x5056('0x2e')],function(_0x482939){return{'name':_0x482939[_0x5056('0x2f')],'type':_0x482939[_0x5056('0x30')][_0x5056('0x31')]};});_0x70246c[_0x5056('0x32')]=_[_0x5056('0x33')](_0x56ccba,_0x5056('0x2a'));_0x70246c[_0x5056('0x34')]=_[_0x5056('0x35')](_0x53e6db[_0x5056('0x34')]);_0x70246c[_0x5056('0x36')]=_[_0x5056('0x37')](_0x70246c['model'],_0x70246c['query']);_0x5b0270[_0x5056('0x38')]=_[_0x5056('0x37')](_0x70246c['model'],qs[_0x5056('0x39')](_0x53e6db[_0x5056('0x34')]['fields']));_0x5b0270[_0x5056('0x38')]=_0x5b0270[_0x5056('0x38')][_0x5056('0x3a')]?_0x5b0270[_0x5056('0x38')]:_0x70246c[_0x5056('0x32')];if(!_0x53e6db[_0x5056('0x34')][_0x5056('0x3b')](_0x5056('0x3c'))){_0x5b0270[_0x5056('0x1e')]=qs[_0x5056('0x1e')](_0x53e6db[_0x5056('0x34')][_0x5056('0x1e')]);_0x5b0270[_0x5056('0x20')]=qs[_0x5056('0x20')](_0x53e6db[_0x5056('0x34')]['offset']);}_0x5b0270[_0x5056('0x3d')]=qs['sort'](_0x53e6db[_0x5056('0x34')][_0x5056('0x3e')]);_0x5b0270[_0x5056('0x3f')]=qs[_0x5056('0x36')](_['pick'](_0x53e6db[_0x5056('0x34')],_0x70246c[_0x5056('0x36')]),_0x56ccba);if(_0x53e6db['query'][_0x5056('0x40')]){_0x5b0270['where']=_[_0x5056('0x41')](_0x5b0270[_0x5056('0x3f')],{'$or':_[_0x5056('0x33')](_0x56ccba,function(_0x502732){if(_0x502732[_0x5056('0x30')]!==_0x5056('0x42')){var _0x308133={};_0x308133[_0x502732[_0x5056('0x2a')]]={'$like':'%'+_0x53e6db[_0x5056('0x34')][_0x5056('0x40')]+'%'};return _0x308133;}})});}_0x5b0270=_[_0x5056('0x41')]({},_0x5b0270,_0x53e6db[_0x5056('0x43')]);var _0x15553e={'where':_0x5b0270[_0x5056('0x3f')]};return db[_0x5056('0x2d')][_0x5056('0x1f')](_0x15553e)[_0x5056('0x26')](function(_0x1e28f4){_0x49fe67[_0x5056('0x1f')]=_0x1e28f4;if(_0x53e6db[_0x5056('0x34')]['includeAll']){_0x5b0270['include']=[{'all':!![]}];}return db[_0x5056('0x2d')][_0x5056('0x44')](_0x5b0270);})[_0x5056('0x26')](function(_0x3a76d2){_0x49fe67[_0x5056('0x45')]=_0x3a76d2;return _0x49fe67;})[_0x5056('0x26')](respondWithFilteredResult(_0x24d33e,_0x5b0270))[_0x5056('0x46')](handleError(_0x24d33e,null));};exports[_0x5056('0x47')]=function(_0x48ab5e,_0x58f12f){var _0x68a385={'raw':![],'where':{'id':_0x48ab5e[_0x5056('0x48')]['id']}},_0x1b3a5e={};_0x1b3a5e['model']=_[_0x5056('0x35')](db['ZendeskAccount'][_0x5056('0x2e')]);_0x1b3a5e[_0x5056('0x34')]=_[_0x5056('0x35')](_0x48ab5e[_0x5056('0x34')]);_0x1b3a5e[_0x5056('0x36')]=_[_0x5056('0x37')](_0x1b3a5e['model'],_0x1b3a5e[_0x5056('0x34')]);_0x68a385[_0x5056('0x38')]=_[_0x5056('0x37')](_0x1b3a5e['model'],qs['fields'](_0x48ab5e['query']['fields']));_0x68a385[_0x5056('0x38')]=_0x68a385[_0x5056('0x38')][_0x5056('0x3a')]?_0x68a385[_0x5056('0x38')]:_0x1b3a5e[_0x5056('0x32')];if(_0x48ab5e['query']['includeAll']){_0x68a385[_0x5056('0x49')]=[{'all':!![]}];}_0x68a385=_[_0x5056('0x41')]({},_0x68a385,_0x48ab5e[_0x5056('0x43')]);return db[_0x5056('0x2d')][_0x5056('0x4a')](_0x68a385)[_0x5056('0x26')](handleEntityNotFound(_0x58f12f,null))[_0x5056('0x26')](respondWithResult(_0x58f12f,null))['catch'](handleError(_0x58f12f,null));};exports['create']=function(_0x14e3f5,_0x3c2988){return db['ZendeskAccount'][_0x5056('0x4b')](_0x14e3f5[_0x5056('0x4c')],{})['then'](respondWithResult(_0x3c2988,0xc9))['catch'](handleError(_0x3c2988,null));};exports[_0x5056('0x25')]=function(_0x1ab1a9,_0x50aa03){if(_0x1ab1a9['body']['id']){delete _0x1ab1a9[_0x5056('0x4c')]['id'];}return db[_0x5056('0x2d')]['find']({'where':{'id':_0x1ab1a9['params']['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x50aa03,null))[_0x5056('0x26')](saveUpdates(_0x1ab1a9[_0x5056('0x4c')],null))[_0x5056('0x26')](respondWithResult(_0x50aa03,null))[_0x5056('0x46')](handleError(_0x50aa03,null));};exports[_0x5056('0x27')]=function(_0x97f7d8,_0x366ba2){return db[_0x5056('0x2d')][_0x5056('0x4a')]({'where':{'id':_0x97f7d8[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x366ba2,null))[_0x5056('0x26')](removeEntity(_0x366ba2,null))[_0x5056('0x46')](handleError(_0x366ba2,null));};exports[_0x5056('0x4d')]=function(_0x4bf758,_0x5c1c29,_0x5bf887){var _0xb1fd25={};var _0x428701={};var _0x1c84b1;var _0x35776b;return db[_0x5056('0x2d')]['findOne']({'where':{'id':_0x4bf758[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x5c1c29,null))[_0x5056('0x26')](function(_0x3d22cc){if(_0x3d22cc){_0x1c84b1=_0x3d22cc;_0x428701[_0x5056('0x32')]=_[_0x5056('0x35')](db[_0x5056('0x4e')][_0x5056('0x2e')]);_0x428701[_0x5056('0x34')]=_[_0x5056('0x35')](_0x4bf758[_0x5056('0x34')]);_0x428701[_0x5056('0x36')]=_[_0x5056('0x37')](_0x428701['model'],_0x428701[_0x5056('0x34')]);_0xb1fd25[_0x5056('0x38')]=_[_0x5056('0x37')](_0x428701['model'],qs[_0x5056('0x39')](_0x4bf758[_0x5056('0x34')][_0x5056('0x39')]));_0xb1fd25[_0x5056('0x38')]=_0xb1fd25['attributes']['length']?_0xb1fd25['attributes']:_0x428701[_0x5056('0x32')];_0xb1fd25['order']=qs[_0x5056('0x3e')](_0x4bf758[_0x5056('0x34')][_0x5056('0x3e')]);_0xb1fd25[_0x5056('0x3f')]=qs[_0x5056('0x36')](_[_0x5056('0x4f')](_0x4bf758['query'],_0x428701['filters']));if(_0x4bf758[_0x5056('0x34')][_0x5056('0x40')]){_0xb1fd25['where']=_[_0x5056('0x41')](_0xb1fd25[_0x5056('0x3f')],{'$or':_[_0x5056('0x33')](_0xb1fd25[_0x5056('0x38')],function(_0x44b75e){var _0x524308={};_0x524308[_0x44b75e]={'$like':'%'+_0x4bf758[_0x5056('0x34')][_0x5056('0x40')]+'%'};return _0x524308;})});}_0xb1fd25=_['merge']({},_0xb1fd25,_0x4bf758[_0x5056('0x43')]);return _0x1c84b1[_0x5056('0x4d')](_0xb1fd25);}})[_0x5056('0x26')](function(_0x1d59ac){if(_0x1d59ac){_0x35776b=_0x1d59ac[_0x5056('0x3a')];if(!_0x4bf758[_0x5056('0x34')][_0x5056('0x3b')](_0x5056('0x3c'))){_0xb1fd25[_0x5056('0x1e')]=qs[_0x5056('0x1e')](_0x4bf758[_0x5056('0x34')][_0x5056('0x1e')]);_0xb1fd25[_0x5056('0x20')]=qs['offset'](_0x4bf758[_0x5056('0x34')][_0x5056('0x20')]);}return _0x1c84b1[_0x5056('0x4d')](_0xb1fd25);}})[_0x5056('0x26')](function(_0x267ba4){if(_0x267ba4){return _0x267ba4?{'count':_0x35776b,'rows':_0x267ba4}:null;}})[_0x5056('0x26')](respondWithResult(_0x5c1c29,null))['catch'](handleError(_0x5c1c29,null));};exports[_0x5056('0x50')]=function(_0x4e343e,_0x1c3684,_0x277939){if(_0x4e343e['body']['id']){delete _0x4e343e['body']['id'];}return db[_0x5056('0x2d')][_0x5056('0x51')]({'where':{'id':_0x4e343e[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x1c3684,null))['then'](function(_0x521384){if(_0x521384){_0x4e343e[_0x5056('0x4c')][_0x5056('0x52')]=_0x521384['id'];_0x4e343e[_0x5056('0x4c')]['Subjects']=integrations[_0x5056('0x53')](_0x4e343e['body'][_0x5056('0x54')],_0x4e343e[_0x5056('0x4c')][_0x5056('0x30')]);_0x4e343e['body'][_0x5056('0x55')]=integrations[_0x5056('0x56')](_0x4e343e[_0x5056('0x4c')][_0x5056('0x54')],_0x4e343e[_0x5056('0x4c')][_0x5056('0x30')]);return db[_0x5056('0x4e')]['create'](_0x4e343e[_0x5056('0x4c')],{'include':[{'model':db[_0x5056('0x57')],'as':_0x5056('0x58')},{'model':db['ZendeskField'],'as':_0x5056('0x55')}]});}return null;})['then'](respondWithResult(_0x1c3684,null))[_0x5056('0x46')](handleError(_0x1c3684,null));};exports[_0x5056('0x59')]=function(_0x3c7d5c,_0x45eac9,_0x5639a1){var _0x2a856c='';return db[_0x5056('0x2d')]['findOne']({'where':{'id':_0x3c7d5c[_0x5056('0x48')]['id']},'attributes':['id','username','password',_0x5056('0x5a'),_0x5056('0x5b'),_0x5056('0x5c')]})[_0x5056('0x26')](handleEntityNotFound(_0x45eac9,null))[_0x5056('0x26')](function(_0x88270d){if(_0x88270d){_0x2a856c=_0x88270d[_0x5056('0x5c')];var _0x3aa15f=_0x2a856c[_0x5056('0x5d')](-0x1);if(_0x3aa15f==='/'){_0x2a856c=_0x2a856c[_0x5056('0x5e')](0x0,_0x2a856c[_0x5056('0x5f')](_0x3aa15f));}var _0x153143={'method':'GET','uri':util[_0x5056('0x60')]('%s/%s',_0x2a856c,_0x5056('0x61')),'json':!![]};switch(_0x88270d[_0x5056('0x5b')]){case'password':_0x153143[_0x5056('0x62')]={'Authorization':util[_0x5056('0x60')](_0x5056('0x63'),new Buffer(util[_0x5056('0x60')](_0x5056('0x64'),_0x88270d[_0x5056('0x65')],_0x88270d[_0x5056('0x66')]))[_0x5056('0x67')]('base64'))};break;case _0x5056('0x5a'):_0x153143[_0x5056('0x62')]={'Authorization':util[_0x5056('0x60')](_0x5056('0x63'),new Buffer(util[_0x5056('0x60')]('%s/token:%s',_0x88270d[_0x5056('0x65')],_0x88270d['token']))[_0x5056('0x67')](_0x5056('0x68')))};break;default:throw new db[(_0x5056('0x69'))][(_0x5056('0x6a'))](_0x5056('0x6b'));}return rp(_0x153143);}})[_0x5056('0x26')](function(_0x2be789){if(_0x2be789){var _0x5f41de=[_0x5056('0x6c'),_0x5056('0x6d'),_0x5056('0x6e'),_0x5056('0x6f')];_[_0x5056('0x70')](_0x2be789[_0x5056('0x61')],function(_0x3f34b6){return _0x5f41de['includes'](_0x3f34b6['type']);});return{'count':_0x2be789['ticket_fields'][_0x5056('0x3a')],'rows':_['map'](_0x2be789[_0x5056('0x61')],function(_0x43d241){return{'id':_0x43d241['id'],'name':_0x43d241[_0x5056('0x71')]>0x7?_0x43d241['title']:_0x43d241[_0x5056('0x30')],'custom':_0x43d241['position']>0x7?!![]:![],'options':_0x43d241[_0x5056('0x72')]?_0x43d241[_0x5056('0x72')]:_0x43d241[_0x5056('0x73')]?_0x43d241['custom_field_options']:[]};})};}})[_0x5056('0x26')](respondWithResult(_0x45eac9,null))['catch'](function(_0x54b0ba){var _0x2ed978=_0x3c7d5c[_0x5056('0x34')]['test']?0x1f4:_0x54b0ba[_0x5056('0x74')]||0x1f4;logger['error'](_0x5056('0x75'),_0x5056('0x59'),_0x2ed978,JSON[_0x5056('0x76')](_0x54b0ba));delete _0x54b0ba[_0x5056('0x2a')];if(_0x2ed978===0x191){_0x2ed978=0x190;}_0x45eac9[_0x5056('0x1a')](_0x2ed978)[_0x5056('0x2b')](_0x3c7d5c['query'][_0x5056('0x77')]?{'message':_0x5056('0x78'),'statusCode':_0x54b0ba[_0x5056('0x74')]}:_0x54b0ba);});}; \ No newline at end of file +var _0x373d=['ZendeskField','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','base64','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','position','title','system_field_options','custom_field_options','test','stringify','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','ZendeskAccount','rows','catch','show','keys','rawAttributes','find','create','body','params','findOne','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0xf7a9cf,_0x2cfa33){var _0x7fdc45=function(_0x44b354){while(--_0x44b354){_0xf7a9cf['push'](_0xf7a9cf['shift']());}};_0x7fdc45(++_0x2cfa33);}(_0x373d,0x1e2));var _0xd373=function(_0x19a206,_0x1d7556){_0x19a206=_0x19a206-0x0;var _0x7514ac=_0x373d[_0x19a206];return _0x7514ac;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5ab89c,_0xcd9b8c){_0xcd9b8c=_0xcd9b8c||0xcc;return function(_0x14a0ee){if(_0x14a0ee){return _0x5ab89c['sendStatus'](_0xcd9b8c);}return _0x5ab89c[_0xd373('0x15')](_0xcd9b8c)[_0xd373('0x16')]();};}function respondWithResult(_0x27c161,_0x23ed86){_0x23ed86=_0x23ed86||0xc8;return function(_0x28b2bf){if(_0x28b2bf){return _0x27c161[_0xd373('0x15')](_0x23ed86)[_0xd373('0x17')](_0x28b2bf);}};}function respondWithFilteredResult(_0x2eacb1,_0x5a286a){return function(_0x2c5854){if(_0x2c5854){var _0x3a5316=typeof _0x5a286a[_0xd373('0x18')]===_0xd373('0x19')&&typeof _0x5a286a['limit']===_0xd373('0x19');var _0x5eab00=_0x2c5854[_0xd373('0x1a')];var _0x36d47a=_0x3a5316?0x0:_0x5a286a['offset'];var _0x1bbdbd=_0x3a5316?_0x2c5854['count']:_0x5a286a['offset']+_0x5a286a[_0xd373('0x1b')];var _0x186fdd;if(_0x1bbdbd>=_0x5eab00){_0x1bbdbd=_0x5eab00;_0x186fdd=0xc8;}else{_0x186fdd=0xce;}_0x2eacb1[_0xd373('0x15')](_0x186fdd);return _0x2eacb1[_0xd373('0x1c')](_0xd373('0x1d'),_0x36d47a+'-'+_0x1bbdbd+'/'+_0x5eab00)[_0xd373('0x17')](_0x2c5854);}return null;};}function patchUpdates(_0x4ba510){return function(_0x18b681){try{jsonpatch[_0xd373('0x1e')](_0x18b681,_0x4ba510,!![]);}catch(_0x1378a0){return BPromise[_0xd373('0x1f')](_0x1378a0);}return _0x18b681[_0xd373('0x20')]();};}function saveUpdates(_0x3aa1c5,_0x4f64bd){return function(_0x355fca){if(_0x355fca){return _0x355fca[_0xd373('0x21')](_0x3aa1c5)[_0xd373('0x22')](function(_0x209ca7){return _0x209ca7;});}return null;};}function removeEntity(_0x217ee7,_0x238ffd){return function(_0x466a03){if(_0x466a03){return _0x466a03[_0xd373('0x23')]()[_0xd373('0x22')](function(){_0x217ee7[_0xd373('0x15')](0xcc)[_0xd373('0x16')]();});}};}function handleEntityNotFound(_0x34f05a,_0x388182){return function(_0x420a30){if(!_0x420a30){_0x34f05a[_0xd373('0x24')](0x194);}return _0x420a30;};}function handleError(_0x38ba50,_0x50b987){_0x50b987=_0x50b987||0x1f4;return function(_0x13a012){logger[_0xd373('0x25')](_0x13a012[_0xd373('0x26')]);if(_0x13a012[_0xd373('0x27')]){delete _0x13a012[_0xd373('0x27')];}_0x38ba50[_0xd373('0x15')](_0x50b987)[_0xd373('0x28')](_0x13a012);};}exports[_0xd373('0x29')]=function(_0x2869e5,_0x158825){var _0xbc420b={},_0x2ee37c={},_0x7dad3e={'count':0x0,'rows':[]};var _0x5287e7=_[_0xd373('0x2a')](db['ZendeskAccount']['rawAttributes'],function(_0xedc8f3){return{'name':_0xedc8f3[_0xd373('0x2b')],'type':_0xedc8f3[_0xd373('0x2c')][_0xd373('0x2d')]};});_0x2ee37c[_0xd373('0x2e')]=_['map'](_0x5287e7,_0xd373('0x27'));_0x2ee37c[_0xd373('0x2f')]=_['keys'](_0x2869e5[_0xd373('0x2f')]);_0x2ee37c[_0xd373('0x30')]=_[_0xd373('0x31')](_0x2ee37c[_0xd373('0x2e')],_0x2ee37c[_0xd373('0x2f')]);_0xbc420b[_0xd373('0x32')]=_[_0xd373('0x31')](_0x2ee37c[_0xd373('0x2e')],qs[_0xd373('0x33')](_0x2869e5['query'][_0xd373('0x33')]));_0xbc420b[_0xd373('0x32')]=_0xbc420b[_0xd373('0x32')][_0xd373('0x34')]?_0xbc420b[_0xd373('0x32')]:_0x2ee37c[_0xd373('0x2e')];if(!_0x2869e5[_0xd373('0x2f')][_0xd373('0x35')](_0xd373('0x36'))){_0xbc420b[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0x2869e5[_0xd373('0x2f')][_0xd373('0x1b')]);_0xbc420b[_0xd373('0x18')]=qs[_0xd373('0x18')](_0x2869e5['query'][_0xd373('0x18')]);}_0xbc420b[_0xd373('0x37')]=qs[_0xd373('0x38')](_0x2869e5[_0xd373('0x2f')]['sort']);_0xbc420b[_0xd373('0x39')]=qs[_0xd373('0x30')](_[_0xd373('0x3a')](_0x2869e5[_0xd373('0x2f')],_0x2ee37c[_0xd373('0x30')]),_0x5287e7);if(_0x2869e5[_0xd373('0x2f')]['filter']){_0xbc420b['where']=_[_0xd373('0x3b')](_0xbc420b['where'],{'$or':_[_0xd373('0x2a')](_0x5287e7,function(_0xe19d5b){if(_0xe19d5b[_0xd373('0x2c')]!=='VIRTUAL'){var _0x287136={};_0x287136[_0xe19d5b[_0xd373('0x27')]]={'$like':'%'+_0x2869e5[_0xd373('0x2f')][_0xd373('0x3c')]+'%'};return _0x287136;}})});}_0xbc420b=_['merge']({},_0xbc420b,_0x2869e5['options']);var _0x5de74e={'where':_0xbc420b[_0xd373('0x39')]};return db['ZendeskAccount'][_0xd373('0x1a')](_0x5de74e)[_0xd373('0x22')](function(_0x4e5e80){_0x7dad3e['count']=_0x4e5e80;if(_0x2869e5['query'][_0xd373('0x3d')]){_0xbc420b[_0xd373('0x3e')]=[{'all':!![]}];}return db[_0xd373('0x3f')]['findAll'](_0xbc420b);})['then'](function(_0xb87e16){_0x7dad3e[_0xd373('0x40')]=_0xb87e16;return _0x7dad3e;})['then'](respondWithFilteredResult(_0x158825,_0xbc420b))[_0xd373('0x41')](handleError(_0x158825,null));};exports[_0xd373('0x42')]=function(_0x1e3de1,_0x9989e4){var _0x2d8c7d={'raw':![],'where':{'id':_0x1e3de1['params']['id']}},_0x4e8bc6={};_0x4e8bc6[_0xd373('0x2e')]=_[_0xd373('0x43')](db[_0xd373('0x3f')][_0xd373('0x44')]);_0x4e8bc6['query']=_[_0xd373('0x43')](_0x1e3de1['query']);_0x4e8bc6[_0xd373('0x30')]=_[_0xd373('0x31')](_0x4e8bc6[_0xd373('0x2e')],_0x4e8bc6[_0xd373('0x2f')]);_0x2d8c7d[_0xd373('0x32')]=_['intersection'](_0x4e8bc6[_0xd373('0x2e')],qs[_0xd373('0x33')](_0x1e3de1['query'][_0xd373('0x33')]));_0x2d8c7d[_0xd373('0x32')]=_0x2d8c7d[_0xd373('0x32')][_0xd373('0x34')]?_0x2d8c7d[_0xd373('0x32')]:_0x4e8bc6[_0xd373('0x2e')];if(_0x1e3de1[_0xd373('0x2f')][_0xd373('0x3d')]){_0x2d8c7d[_0xd373('0x3e')]=[{'all':!![]}];}_0x2d8c7d=_[_0xd373('0x3b')]({},_0x2d8c7d,_0x1e3de1['options']);return db['ZendeskAccount'][_0xd373('0x45')](_0x2d8c7d)['then'](handleEntityNotFound(_0x9989e4,null))[_0xd373('0x22')](respondWithResult(_0x9989e4,null))['catch'](handleError(_0x9989e4,null));};exports['create']=function(_0x5cbc16,_0x280598){return db[_0xd373('0x3f')][_0xd373('0x46')](_0x5cbc16[_0xd373('0x47')],{})[_0xd373('0x22')](respondWithResult(_0x280598,0xc9))[_0xd373('0x41')](handleError(_0x280598,null));};exports[_0xd373('0x21')]=function(_0x4d1088,_0x28ec3e){if(_0x4d1088['body']['id']){delete _0x4d1088[_0xd373('0x47')]['id'];}return db[_0xd373('0x3f')]['find']({'where':{'id':_0x4d1088[_0xd373('0x48')]['id']}})['then'](handleEntityNotFound(_0x28ec3e,null))[_0xd373('0x22')](saveUpdates(_0x4d1088[_0xd373('0x47')],null))[_0xd373('0x22')](respondWithResult(_0x28ec3e,null))[_0xd373('0x41')](handleError(_0x28ec3e,null));};exports[_0xd373('0x23')]=function(_0x4bc631,_0x4971a0){return db['ZendeskAccount'][_0xd373('0x45')]({'where':{'id':_0x4bc631[_0xd373('0x48')]['id']}})['then'](handleEntityNotFound(_0x4971a0,null))[_0xd373('0x22')](removeEntity(_0x4971a0,null))[_0xd373('0x41')](handleError(_0x4971a0,null));};exports['getConfigurations']=function(_0xae7067,_0xb6b583,_0x102101){var _0x473af2={};var _0x3b5e70={};var _0xa2758;var _0xc255ec;return db[_0xd373('0x3f')][_0xd373('0x49')]({'where':{'id':_0xae7067[_0xd373('0x48')]['id']}})[_0xd373('0x22')](handleEntityNotFound(_0xb6b583,null))['then'](function(_0x4b2645){if(_0x4b2645){_0xa2758=_0x4b2645;_0x3b5e70['model']=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x3b5e70[_0xd373('0x2f')]=_[_0xd373('0x43')](_0xae7067['query']);_0x3b5e70['filters']=_['intersection'](_0x3b5e70[_0xd373('0x2e')],_0x3b5e70[_0xd373('0x2f')]);_0x473af2['attributes']=_['intersection'](_0x3b5e70[_0xd373('0x2e')],qs[_0xd373('0x33')](_0xae7067[_0xd373('0x2f')][_0xd373('0x33')]));_0x473af2[_0xd373('0x32')]=_0x473af2['attributes'][_0xd373('0x34')]?_0x473af2[_0xd373('0x32')]:_0x3b5e70[_0xd373('0x2e')];_0x473af2[_0xd373('0x37')]=qs[_0xd373('0x38')](_0xae7067[_0xd373('0x2f')][_0xd373('0x38')]);_0x473af2[_0xd373('0x39')]=qs[_0xd373('0x30')](_[_0xd373('0x3a')](_0xae7067[_0xd373('0x2f')],_0x3b5e70[_0xd373('0x30')]));if(_0xae7067[_0xd373('0x2f')][_0xd373('0x3c')]){_0x473af2[_0xd373('0x39')]=_['merge'](_0x473af2[_0xd373('0x39')],{'$or':_[_0xd373('0x2a')](_0x473af2[_0xd373('0x32')],function(_0x4dba1d){var _0x2bdadf={};_0x2bdadf[_0x4dba1d]={'$like':'%'+_0xae7067['query'][_0xd373('0x3c')]+'%'};return _0x2bdadf;})});}_0x473af2=_['merge']({},_0x473af2,_0xae7067[_0xd373('0x4a')]);return _0xa2758[_0xd373('0x4b')](_0x473af2);}})[_0xd373('0x22')](function(_0x19924a){if(_0x19924a){_0xc255ec=_0x19924a[_0xd373('0x34')];if(!_0xae7067[_0xd373('0x2f')][_0xd373('0x35')](_0xd373('0x36'))){_0x473af2[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0xae7067[_0xd373('0x2f')][_0xd373('0x1b')]);_0x473af2[_0xd373('0x18')]=qs[_0xd373('0x18')](_0xae7067[_0xd373('0x2f')][_0xd373('0x18')]);}return _0xa2758[_0xd373('0x4b')](_0x473af2);}})[_0xd373('0x22')](function(_0x209e76){if(_0x209e76){return _0x209e76?{'count':_0xc255ec,'rows':_0x209e76}:null;}})[_0xd373('0x22')](respondWithResult(_0xb6b583,null))[_0xd373('0x41')](handleError(_0xb6b583,null));};exports[_0xd373('0x4c')]=function(_0x296242,_0x5133,_0x2ada2f){if(_0x296242[_0xd373('0x47')]['id']){delete _0x296242['body']['id'];}return db[_0xd373('0x3f')][_0xd373('0x49')]({'where':{'id':_0x296242[_0xd373('0x48')]['id']}})['then'](handleEntityNotFound(_0x5133,null))[_0xd373('0x22')](function(_0x2d9019){if(_0x2d9019){_0x296242[_0xd373('0x47')][_0xd373('0x4d')]=_0x2d9019['id'];_0x296242[_0xd373('0x47')][_0xd373('0x4e')]=integrations[_0xd373('0x4f')](_0x296242['body'][_0xd373('0x50')],_0x296242[_0xd373('0x47')][_0xd373('0x2c')]);_0x296242[_0xd373('0x47')][_0xd373('0x51')]=integrations[_0xd373('0x52')](_0x296242[_0xd373('0x47')][_0xd373('0x50')],_0x296242['body'][_0xd373('0x2c')]);return db['ZendeskConfiguration'][_0xd373('0x46')](_0x296242[_0xd373('0x47')],{'include':[{'model':db[_0xd373('0x53')],'as':_0xd373('0x4e')},{'model':db[_0xd373('0x53')],'as':_0xd373('0x51')}]});}return null;})[_0xd373('0x22')](respondWithResult(_0x5133,null))[_0xd373('0x41')](handleError(_0x5133,null));};exports['getFields']=function(_0x237f15,_0x5c5855,_0x40f5ad){var _0x27fcbe='';return db[_0xd373('0x3f')][_0xd373('0x49')]({'where':{'id':_0x237f15[_0xd373('0x48')]['id']},'attributes':['id',_0xd373('0x54'),_0xd373('0x55'),'token',_0xd373('0x56'),_0xd373('0x57')]})[_0xd373('0x22')](handleEntityNotFound(_0x5c5855,null))['then'](function(_0x4035d4){if(_0x4035d4){_0x27fcbe=_0x4035d4[_0xd373('0x57')];var _0xaf9102=_0x27fcbe[_0xd373('0x58')](-0x1);if(_0xaf9102==='/'){_0x27fcbe=_0x27fcbe[_0xd373('0x59')](0x0,_0x27fcbe[_0xd373('0x5a')](_0xaf9102));}var _0x6c7c8d={'method':_0xd373('0x5b'),'uri':util[_0xd373('0x5c')](_0xd373('0x5d'),_0x27fcbe,_0xd373('0x5e')),'json':!![]};switch(_0x4035d4[_0xd373('0x56')]){case'password':_0x6c7c8d[_0xd373('0x5f')]={'Authorization':util[_0xd373('0x5c')](_0xd373('0x60'),new Buffer(util['format'](_0xd373('0x61'),_0x4035d4[_0xd373('0x54')],_0x4035d4[_0xd373('0x55')]))['toString'](_0xd373('0x62')))};break;case'token':_0x6c7c8d[_0xd373('0x5f')]={'Authorization':util[_0xd373('0x5c')](_0xd373('0x60'),new Buffer(util[_0xd373('0x5c')]('%s/token:%s',_0x4035d4[_0xd373('0x54')],_0x4035d4['token']))[_0xd373('0x63')](_0xd373('0x62')))};break;default:throw new db[(_0xd373('0x64'))][(_0xd373('0x65'))](_0xd373('0x66'));}return rp(_0x6c7c8d);}})[_0xd373('0x22')](function(_0x53c0a7){if(_0x53c0a7){var _0xb01a00=['subject',_0xd373('0x67'),'group','assignee'];_[_0xd373('0x68')](_0x53c0a7[_0xd373('0x5e')],function(_0x1cff58){return _0xb01a00[_0xd373('0x69')](_0x1cff58['type']);});return{'count':_0x53c0a7['ticket_fields'][_0xd373('0x34')],'rows':_[_0xd373('0x2a')](_0x53c0a7[_0xd373('0x5e')],function(_0x25bf55){return{'id':_0x25bf55['id'],'name':_0x25bf55[_0xd373('0x6a')]>0x7?_0x25bf55[_0xd373('0x6b')]:_0x25bf55[_0xd373('0x2c')],'custom':_0x25bf55[_0xd373('0x6a')]>0x7?!![]:![],'options':_0x25bf55[_0xd373('0x6c')]?_0x25bf55[_0xd373('0x6c')]:_0x25bf55['custom_field_options']?_0x25bf55[_0xd373('0x6d')]:[]};})};}})[_0xd373('0x22')](respondWithResult(_0x5c5855,null))[_0xd373('0x41')](function(_0xa77a42){var _0x9bdd39=_0x237f15[_0xd373('0x2f')][_0xd373('0x6e')]?0x1f4:_0xa77a42['statusCode']||0x1f4;logger[_0xd373('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x9bdd39,JSON[_0xd373('0x6f')](_0xa77a42));delete _0xa77a42[_0xd373('0x27')];if(_0x9bdd39===0x191){_0x9bdd39=0x190;}_0x5c5855[_0xd373('0x15')](_0x9bdd39)[_0xd373('0x28')](_0x237f15[_0xd373('0x2f')][_0xd373('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0xa77a42[_0xd373('0x70')]}:_0xa77a42);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 27c637e..b444b88 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 _0x1f92=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x1f92,0xd4));var _0x21f9=function(_0x68906,_0x36eef3){_0x68906=_0x68906-0x0;var _0x3a8160=_0x1f92[_0x68906];return _0x3a8160;};'use strict';var _=require(_0x21f9('0x0'));var util=require(_0x21f9('0x1'));var logger=require(_0x21f9('0x2'))(_0x21f9('0x3'));var moment=require(_0x21f9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x21f9('0x5'));var rimraf=require('rimraf');var config=require(_0x21f9('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x21f9('0x7')]=function(_0x54b8bc,_0x3f9b9c){return _0x54b8bc['define'](_0x21f9('0x8'),attributes,{'tableName':_0x21f9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc564=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc564,0x150));var _0x4c56=function(_0x1ef6a7,_0x246458){_0x1ef6a7=_0x1ef6a7-0x0;var _0x1b256e=_0xc564[_0x1ef6a7];return _0x1b256e;};'use strict';var _=require(_0x4c56('0x0'));var util=require(_0x4c56('0x1'));var logger=require(_0x4c56('0x2'))(_0x4c56('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4c56('0x4'));var fs=require('fs');var path=require(_0x4c56('0x5'));var rimraf=require(_0x4c56('0x6'));var config=require(_0x4c56('0x7'));var attributes=require(_0x4c56('0x8'));var integrations=require(_0x4c56('0x9'));module[_0x4c56('0xa')]=function(_0x1c43a2,_0x5b1a61){return _0x1c43a2['define'](_0x4c56('0xb'),attributes,{'tableName':_0x4c56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 7174cbe..60352f4 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 _0xf28c=['model','GetZendeskAccount','ShowZendeskAccount','ZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','limit','map','include','attributes'];(function(_0x270c38,_0x23b1b8){var _0x3afde8=function(_0xb6dfdb){while(--_0xb6dfdb){_0x270c38['push'](_0x270c38['shift']());}};_0x3afde8(++_0x23b1b8);}(_0xf28c,0x148));var _0xcf28=function(_0x352d1b,_0x54732b){_0x352d1b=_0x352d1b-0x0;var _0x1ce277=_0xf28c[_0x352d1b];return _0x1ce277;};'use strict';var _=require(_0xcf28('0x0'));var util=require(_0xcf28('0x1'));var moment=require(_0xcf28('0x2'));var BPromise=require(_0xcf28('0x3'));var rs=require(_0xcf28('0x4'));var fs=require('fs');var Redis=require(_0xcf28('0x5'));var db=require(_0xcf28('0x6'))['db'];var utils=require(_0xcf28('0x7'));var logger=require(_0xcf28('0x8'))('rpc');var config=require(_0xcf28('0x9'));var jayson=require(_0xcf28('0xa'));var client=jayson['client'][_0xcf28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c0afd,_0x389f61,_0x760252){return new BPromise(function(_0x24e953,_0x162b4a){return client[_0xcf28('0xc')](_0x4c0afd,_0x760252)[_0xcf28('0xd')](function(_0xd682d1){logger[_0xcf28('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x389f61,_0xcf28('0xf'));logger[_0xcf28('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x389f61,'request\x20sent',JSON[_0xcf28('0x11')](_0xd682d1));if(_0xd682d1[_0xcf28('0x12')]){if(_0xd682d1[_0xcf28('0x12')][_0xcf28('0x13')]===0x1f4){logger[_0xcf28('0x12')](_0xcf28('0x14'),_0x389f61,_0xd682d1['error'][_0xcf28('0x15')]);return _0x162b4a(_0xd682d1[_0xcf28('0x12')][_0xcf28('0x15')]);}logger[_0xcf28('0x12')](_0xcf28('0x14'),_0x389f61,_0xd682d1[_0xcf28('0x12')][_0xcf28('0x15')]);return _0x24e953(_0xd682d1[_0xcf28('0x12')][_0xcf28('0x15')]);}else{logger[_0xcf28('0xe')](_0xcf28('0x14'),_0x389f61,_0xcf28('0xf'));_0x24e953(_0xd682d1[_0xcf28('0x16')]['message']);}})[_0xcf28('0x17')](function(_0x238f40){logger[_0xcf28('0x12')](_0xcf28('0x14'),_0x389f61,_0x238f40);_0x162b4a(_0x238f40);});});}exports['GetZendeskAccount']=function(_0x1b34c0){var _0x667608=this;return new Promise(function(_0x55a45e,_0x2e05bd){return db['ZendeskAccount'][_0xcf28('0x18')]({'raw':_0x1b34c0[_0xcf28('0x19')]?_0x1b34c0[_0xcf28('0x19')][_0xcf28('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b34c0['options']?_0x1b34c0['options'][_0xcf28('0x1b')]||null:null,'attributes':_0x1b34c0[_0xcf28('0x19')]?_0x1b34c0['options']['attributes']||null:null,'limit':_0x1b34c0['options']?_0x1b34c0[_0xcf28('0x19')][_0xcf28('0x1c')]||null:null,'include':_0x1b34c0[_0xcf28('0x19')]?_0x1b34c0['options']['include']?_[_0xcf28('0x1d')](_0x1b34c0[_0xcf28('0x19')][_0xcf28('0x1e')],function(_0xd9a72b){return{'model':db[_0xd9a72b['model']],'as':_0xd9a72b['as'],'attributes':_0xd9a72b[_0xcf28('0x1f')],'include':_0xd9a72b[_0xcf28('0x1e')]?_['map'](_0xd9a72b[_0xcf28('0x1e')],function(_0x39ce22){return{'model':db[_0x39ce22['model']],'as':_0x39ce22['as'],'attributes':_0x39ce22[_0xcf28('0x1f')],'include':_0x39ce22[_0xcf28('0x1e')]?_['map'](_0x39ce22[_0xcf28('0x1e')],function(_0x38a78d){return{'model':db[_0x38a78d[_0xcf28('0x20')]],'as':_0x38a78d['as'],'attributes':_0x38a78d[_0xcf28('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcf28('0xd')](function(_0x200d2b){logger[_0xcf28('0xe')](_0xcf28('0x21'),_0x1b34c0);logger['debug'](_0xcf28('0x21'),_0x1b34c0,JSON[_0xcf28('0x11')](_0x200d2b));_0x55a45e(_0x200d2b);})[_0xcf28('0x17')](function(_0x38089c){logger['error'](_0xcf28('0x21'),_0x38089c['message'],_0x1b34c0);_0x2e05bd(_0x667608[_0xcf28('0x12')](0x1f4,_0x38089c[_0xcf28('0x15')]));});});};exports[_0xcf28('0x22')]=function(_0x1956fb){var _0x3e2d56=this;return new Promise(function(_0x2ae6e2,_0x93f26d){return db[_0xcf28('0x23')]['find']({'raw':_0x1956fb[_0xcf28('0x19')]?_0x1956fb[_0xcf28('0x19')][_0xcf28('0x1a')]===undefined?!![]:![]:!![],'where':_0x1956fb['options']?_0x1956fb[_0xcf28('0x19')][_0xcf28('0x1b')]||null:null,'attributes':_0x1956fb[_0xcf28('0x19')]?_0x1956fb[_0xcf28('0x19')][_0xcf28('0x1f')]||null:null,'include':_0x1956fb['options']?_0x1956fb[_0xcf28('0x19')][_0xcf28('0x1e')]?_[_0xcf28('0x1d')](_0x1956fb['options'][_0xcf28('0x1e')],function(_0x2bbe76){return{'model':db[_0x2bbe76['model']],'as':_0x2bbe76['as'],'attributes':_0x2bbe76[_0xcf28('0x1f')],'include':_0x2bbe76[_0xcf28('0x1e')]?_['map'](_0x2bbe76[_0xcf28('0x1e')],function(_0x3dcd20){return{'model':db[_0x3dcd20[_0xcf28('0x20')]],'as':_0x3dcd20['as'],'attributes':_0x3dcd20[_0xcf28('0x1f')],'include':_0x3dcd20[_0xcf28('0x1e')]?_[_0xcf28('0x1d')](_0x3dcd20[_0xcf28('0x1e')],function(_0x15bd58){return{'model':db[_0x15bd58['model']],'as':_0x15bd58['as'],'attributes':_0x15bd58[_0xcf28('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcf28('0xd')](function(_0x33a447){logger[_0xcf28('0xe')](_0xcf28('0x22'),_0x1956fb);logger[_0xcf28('0x10')](_0xcf28('0x22'),_0x1956fb,JSON[_0xcf28('0x11')](_0x33a447));_0x2ae6e2(_0x33a447);})[_0xcf28('0x17')](function(_0x147b0f){logger[_0xcf28('0x12')](_0xcf28('0x22'),_0x147b0f[_0xcf28('0x15')],_0x1956fb);_0x93f26d(_0x3e2d56[_0xcf28('0x12')](0x1f4,_0x147b0f['message']));});});}; \ No newline at end of file +var _0xb35f=['result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','ZendeskAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x37182d,_0x53d60c){var _0x4d911e=function(_0x116eed){while(--_0x116eed){_0x37182d['push'](_0x37182d['shift']());}};_0x4d911e(++_0x53d60c);}(_0xb35f,0x1c8));var _0xfb35=function(_0x3c0d90,_0x3382d3){_0x3c0d90=_0x3c0d90-0x0;var _0x950f5e=_0xb35f[_0x3c0d90];return _0x950f5e;};'use strict';var _=require('lodash');var util=require(_0xfb35('0x0'));var moment=require(_0xfb35('0x1'));var BPromise=require(_0xfb35('0x2'));var rs=require(_0xfb35('0x3'));var fs=require('fs');var Redis=require(_0xfb35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb35('0x5'));var logger=require(_0xfb35('0x6'))(_0xfb35('0x7'));var config=require(_0xfb35('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfb35('0x9')][_0xfb35('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f7e7,_0x100855,_0x526095){return new BPromise(function(_0x4208b0,_0x5497ad){return client['request'](_0x51f7e7,_0x526095)[_0xfb35('0xb')](function(_0x12cd54){logger[_0xfb35('0xc')](_0xfb35('0xd'),_0x100855,_0xfb35('0xe'));logger[_0xfb35('0xf')](_0xfb35('0x10'),_0x100855,_0xfb35('0xe'),JSON[_0xfb35('0x11')](_0x12cd54));if(_0x12cd54[_0xfb35('0x12')]){if(_0x12cd54[_0xfb35('0x12')]['code']===0x1f4){logger[_0xfb35('0x12')](_0xfb35('0xd'),_0x100855,_0x12cd54[_0xfb35('0x12')][_0xfb35('0x13')]);return _0x5497ad(_0x12cd54[_0xfb35('0x12')][_0xfb35('0x13')]);}logger['error'](_0xfb35('0xd'),_0x100855,_0x12cd54[_0xfb35('0x12')][_0xfb35('0x13')]);return _0x4208b0(_0x12cd54['error'][_0xfb35('0x13')]);}else{logger[_0xfb35('0xc')](_0xfb35('0xd'),_0x100855,_0xfb35('0xe'));_0x4208b0(_0x12cd54[_0xfb35('0x14')][_0xfb35('0x13')]);}})[_0xfb35('0x15')](function(_0x29ce07){logger[_0xfb35('0x12')](_0xfb35('0xd'),_0x100855,_0x29ce07);_0x5497ad(_0x29ce07);});});}exports[_0xfb35('0x16')]=function(_0x48b12b){var _0x55dab2=this;return new Promise(function(_0x23ec62,_0x93da3){return db['ZendeskAccount'][_0xfb35('0x17')]({'raw':_0x48b12b[_0xfb35('0x18')]?_0x48b12b['options'][_0xfb35('0x19')]===undefined?!![]:![]:!![],'where':_0x48b12b['options']?_0x48b12b[_0xfb35('0x18')][_0xfb35('0x1a')]||null:null,'attributes':_0x48b12b[_0xfb35('0x18')]?_0x48b12b['options'][_0xfb35('0x1b')]||null:null,'limit':_0x48b12b[_0xfb35('0x18')]?_0x48b12b[_0xfb35('0x18')][_0xfb35('0x1c')]||null:null,'include':_0x48b12b[_0xfb35('0x18')]?_0x48b12b['options'][_0xfb35('0x1d')]?_[_0xfb35('0x1e')](_0x48b12b[_0xfb35('0x18')][_0xfb35('0x1d')],function(_0x3dad84){return{'model':db[_0x3dad84[_0xfb35('0x1f')]],'as':_0x3dad84['as'],'attributes':_0x3dad84[_0xfb35('0x1b')],'include':_0x3dad84[_0xfb35('0x1d')]?_['map'](_0x3dad84['include'],function(_0x434bd9){return{'model':db[_0x434bd9['model']],'as':_0x434bd9['as'],'attributes':_0x434bd9[_0xfb35('0x1b')],'include':_0x434bd9[_0xfb35('0x1d')]?_[_0xfb35('0x1e')](_0x434bd9['include'],function(_0x438874){return{'model':db[_0x438874[_0xfb35('0x1f')]],'as':_0x438874['as'],'attributes':_0x438874['attributes']};}):[]};}):[]};}):[]:[]})[_0xfb35('0xb')](function(_0x3fa419){logger[_0xfb35('0xc')](_0xfb35('0x16'),_0x48b12b);logger[_0xfb35('0xf')](_0xfb35('0x16'),_0x48b12b,JSON[_0xfb35('0x11')](_0x3fa419));_0x23ec62(_0x3fa419);})[_0xfb35('0x15')](function(_0x1c258d){logger['error'](_0xfb35('0x16'),_0x1c258d['message'],_0x48b12b);_0x93da3(_0x55dab2[_0xfb35('0x12')](0x1f4,_0x1c258d[_0xfb35('0x13')]));});});};exports[_0xfb35('0x20')]=function(_0x2caade){var _0x329c07=this;return new Promise(function(_0x2cf720,_0x308753){return db[_0xfb35('0x21')]['find']({'raw':_0x2caade[_0xfb35('0x18')]?_0x2caade[_0xfb35('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2caade[_0xfb35('0x18')]?_0x2caade[_0xfb35('0x18')][_0xfb35('0x1a')]||null:null,'attributes':_0x2caade['options']?_0x2caade[_0xfb35('0x18')]['attributes']||null:null,'include':_0x2caade['options']?_0x2caade['options'][_0xfb35('0x1d')]?_[_0xfb35('0x1e')](_0x2caade[_0xfb35('0x18')]['include'],function(_0x45913a){return{'model':db[_0x45913a[_0xfb35('0x1f')]],'as':_0x45913a['as'],'attributes':_0x45913a[_0xfb35('0x1b')],'include':_0x45913a['include']?_[_0xfb35('0x1e')](_0x45913a[_0xfb35('0x1d')],function(_0x459bfc){return{'model':db[_0x459bfc[_0xfb35('0x1f')]],'as':_0x459bfc['as'],'attributes':_0x459bfc[_0xfb35('0x1b')],'include':_0x459bfc[_0xfb35('0x1d')]?_[_0xfb35('0x1e')](_0x459bfc[_0xfb35('0x1d')],function(_0x448cf2){return{'model':db[_0x448cf2[_0xfb35('0x1f')]],'as':_0x448cf2['as'],'attributes':_0x448cf2[_0xfb35('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfb35('0xb')](function(_0x41b492){logger['info']('ShowZendeskAccount',_0x2caade);logger[_0xfb35('0xf')](_0xfb35('0x20'),_0x2caade,JSON[_0xfb35('0x11')](_0x41b492));_0x2cf720(_0x41b492);})['catch'](function(_0x2efb64){logger[_0xfb35('0x12')](_0xfb35('0x20'),_0x2efb64['message'],_0x2caade);_0x308753(_0x329c07[_0xfb35('0x12')](0x1f4,_0x2efb64['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 757c155..1ff5a7d 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 _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x3ff417,_0x1217d8){var _0x208cee=function(_0x165a04){while(--_0x165a04){_0x3ff417['push'](_0x3ff417['shift']());}};_0x208cee(++_0x1217d8);}(_0x4483,0x1a3));var _0x3448=function(_0x47c340,_0x547bd3){_0x47c340=_0x47c340-0x0;var _0x105f2f=_0x4483[_0x47c340];return _0x105f2f;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router; \ No newline at end of file +var _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x10bc1e,_0x283895){var _0x1d93c3=function(_0x30c98e){while(--_0x30c98e){_0x10bc1e['push'](_0x10bc1e['shift']());}};_0x1d93c3(++_0x283895);}(_0x087b,0x11a));var _0xb087=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x087b[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 07a718d..6d05f64 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 _0x3a4b=['sequelize','exports','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3a4b,0x147));var _0xb3a4=function(_0x483fc0,_0x5ae1f4){_0x483fc0=_0x483fc0-0x0;var _0x554ec5=_0x3a4b[_0x483fc0];return _0x554ec5;};'use strict';var Sequelize=require(_0xb3a4('0x0'));module[_0xb3a4('0x1')]={'name':{'type':Sequelize[_0xb3a4('0x2')]},'description':{'type':Sequelize[_0xb3a4('0x2')]}}; \ No newline at end of file +var _0x257b=['sequelize','exports','STRING'];(function(_0x3bdadb,_0x21bafa){var _0x2dd4c0=function(_0x22b3c0){while(--_0x22b3c0){_0x3bdadb['push'](_0x3bdadb['shift']());}};_0x2dd4c0(++_0x21bafa);}(_0x257b,0x183));var _0xb257=function(_0x5d4120,_0x2f283b){_0x5d4120=_0x5d4120-0x0;var _0x20c550=_0x257b[_0x5d4120];return _0x20c550;};'use strict';var Sequelize=require(_0xb257('0x0'));module[_0xb257('0x1')]={'name':{'type':Sequelize[_0xb257('0x2')]},'description':{'type':Sequelize[_0xb257('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index c95baaa..ab07c24 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 _0x392f=['api','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','getFields','ZendeskField','hasOwnProperty','findOne','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x49d31e,_0x194576){var _0x5a69e1=function(_0x11e622){while(--_0x11e622){_0x49d31e['push'](_0x49d31e['shift']());}};_0x5a69e1(++_0x194576);}(_0x392f,0xdc));var _0xf392=function(_0x280cc1,_0x5ea95b){_0x280cc1=_0x280cc1-0x0;var _0x1e3fcb=_0x392f[_0x280cc1];return _0x1e3fcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf392('0x0'));var zipdir=require(_0xf392('0x1'));var jsonpatch=require(_0xf392('0x2'));var rp=require(_0xf392('0x3'));var moment=require(_0xf392('0x4'));var BPromise=require(_0xf392('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf392('0x6'));var csv=require(_0xf392('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf392('0x8'));var _=require(_0xf392('0x9'));var squel=require('squel');var crypto=require(_0xf392('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf392('0x7'));var querystring=require(_0xf392('0xb'));var Papa=require(_0xf392('0xc'));var Redis=require(_0xf392('0xd'));var authService=require(_0xf392('0xe'));var qs=require(_0xf392('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf392('0x10'));var logger=require('../../config/logger')(_0xf392('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a9d55,_0x32c2c0){_0x32c2c0=_0x32c2c0||0xcc;return function(_0x24cf09){if(_0x24cf09){return _0x5a9d55['sendStatus'](_0x32c2c0);}return _0x5a9d55[_0xf392('0x12')](_0x32c2c0)[_0xf392('0x13')]();};}function respondWithResult(_0x30a956,_0x6c31c3){_0x6c31c3=_0x6c31c3||0xc8;return function(_0x31a5c5){if(_0x31a5c5){return _0x30a956['status'](_0x6c31c3)[_0xf392('0x14')](_0x31a5c5);}};}function respondWithFilteredResult(_0x6ca6a2,_0x1c97e1){return function(_0x3dc9f4){if(_0x3dc9f4){var _0x1ed7b8=typeof _0x1c97e1['offset']===_0xf392('0x15')&&typeof _0x1c97e1[_0xf392('0x16')]===_0xf392('0x15');var _0x4783d8=_0x3dc9f4[_0xf392('0x17')];var _0x1ad815=_0x1ed7b8?0x0:_0x1c97e1['offset'];var _0x10505e=_0x1ed7b8?_0x3dc9f4[_0xf392('0x17')]:_0x1c97e1[_0xf392('0x18')]+_0x1c97e1[_0xf392('0x16')];var _0x215443;if(_0x10505e>=_0x4783d8){_0x10505e=_0x4783d8;_0x215443=0xc8;}else{_0x215443=0xce;}_0x6ca6a2[_0xf392('0x12')](_0x215443);return _0x6ca6a2[_0xf392('0x19')](_0xf392('0x1a'),_0x1ad815+'-'+_0x10505e+'/'+_0x4783d8)['json'](_0x3dc9f4);}return null;};}function patchUpdates(_0x585801){return function(_0x31489c){try{jsonpatch[_0xf392('0x1b')](_0x31489c,_0x585801,!![]);}catch(_0x19329c){return BPromise[_0xf392('0x1c')](_0x19329c);}return _0x31489c[_0xf392('0x1d')]();};}function saveUpdates(_0xdaa969,_0x2cb582){return function(_0x561afe){if(_0x561afe){return _0x561afe[_0xf392('0x1e')](_0xdaa969)[_0xf392('0x1f')](function(_0x57b91a){return _0x57b91a;});}return null;};}function removeEntity(_0x270722,_0x1c313b){return function(_0x465e6c){if(_0x465e6c){return _0x465e6c[_0xf392('0x20')]()[_0xf392('0x1f')](function(){_0x270722[_0xf392('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cfdce,_0xfc6e31){return function(_0x7ebec0){if(!_0x7ebec0){_0x1cfdce['sendStatus'](0x194);}return _0x7ebec0;};}function handleError(_0x4d481a,_0x29a042){_0x29a042=_0x29a042||0x1f4;return function(_0x55eccd){logger['error'](_0x55eccd[_0xf392('0x21')]);if(_0x55eccd['name']){delete _0x55eccd[_0xf392('0x22')];}_0x4d481a[_0xf392('0x12')](_0x29a042)[_0xf392('0x23')](_0x55eccd);};}exports[_0xf392('0x24')]=function(_0x4f9beb,_0xd1120a){var _0x28ed88={},_0x4bd9f8={},_0x22b4e7={'count':0x0,'rows':[]};var _0x26c04e=_[_0xf392('0x25')](db[_0xf392('0x26')]['rawAttributes'],function(_0x2cd9ac){return{'name':_0x2cd9ac[_0xf392('0x27')],'type':_0x2cd9ac[_0xf392('0x28')][_0xf392('0x29')]};});_0x4bd9f8[_0xf392('0x2a')]=_['map'](_0x26c04e,_0xf392('0x22'));_0x4bd9f8[_0xf392('0x2b')]=_[_0xf392('0x2c')](_0x4f9beb[_0xf392('0x2b')]);_0x4bd9f8['filters']=_[_0xf392('0x2d')](_0x4bd9f8[_0xf392('0x2a')],_0x4bd9f8[_0xf392('0x2b')]);_0x28ed88[_0xf392('0x2e')]=_[_0xf392('0x2d')](_0x4bd9f8[_0xf392('0x2a')],qs[_0xf392('0x2f')](_0x4f9beb[_0xf392('0x2b')]['fields']));_0x28ed88[_0xf392('0x2e')]=_0x28ed88[_0xf392('0x2e')]['length']?_0x28ed88[_0xf392('0x2e')]:_0x4bd9f8['model'];if(!_0x4f9beb[_0xf392('0x2b')]['hasOwnProperty'](_0xf392('0x30'))){_0x28ed88[_0xf392('0x16')]=qs[_0xf392('0x16')](_0x4f9beb[_0xf392('0x2b')]['limit']);_0x28ed88[_0xf392('0x18')]=qs[_0xf392('0x18')](_0x4f9beb[_0xf392('0x2b')]['offset']);}_0x28ed88[_0xf392('0x31')]=qs[_0xf392('0x32')](_0x4f9beb[_0xf392('0x2b')][_0xf392('0x32')]);_0x28ed88[_0xf392('0x33')]=qs[_0xf392('0x34')](_[_0xf392('0x35')](_0x4f9beb[_0xf392('0x2b')],_0x4bd9f8[_0xf392('0x34')]),_0x26c04e);if(_0x4f9beb[_0xf392('0x2b')][_0xf392('0x36')]){_0x28ed88[_0xf392('0x33')]=_[_0xf392('0x37')](_0x28ed88[_0xf392('0x33')],{'$or':_[_0xf392('0x25')](_0x26c04e,function(_0x35c302){if(_0x35c302[_0xf392('0x28')]!==_0xf392('0x38')){var _0x391b64={};_0x391b64[_0x35c302[_0xf392('0x22')]]={'$like':'%'+_0x4f9beb[_0xf392('0x2b')]['filter']+'%'};return _0x391b64;}})});}_0x28ed88=_[_0xf392('0x37')]({},_0x28ed88,_0x4f9beb[_0xf392('0x39')]);var _0x5240fe={'where':_0x28ed88[_0xf392('0x33')]};return db[_0xf392('0x26')]['count'](_0x5240fe)[_0xf392('0x1f')](function(_0x3b493b){_0x22b4e7[_0xf392('0x17')]=_0x3b493b;if(_0x4f9beb[_0xf392('0x2b')][_0xf392('0x3a')]){_0x28ed88[_0xf392('0x3b')]=[{'all':!![]}];}return db[_0xf392('0x26')][_0xf392('0x3c')](_0x28ed88);})[_0xf392('0x1f')](function(_0x277f61){_0x22b4e7[_0xf392('0x3d')]=_0x277f61;return _0x22b4e7;})[_0xf392('0x1f')](respondWithFilteredResult(_0xd1120a,_0x28ed88))[_0xf392('0x3e')](handleError(_0xd1120a,null));};exports[_0xf392('0x3f')]=function(_0xef448c,_0x3ace16){var _0x28893a={'raw':![],'where':{'id':_0xef448c[_0xf392('0x40')]['id']}},_0x515359={};_0x515359[_0xf392('0x2a')]=_[_0xf392('0x2c')](db[_0xf392('0x26')][_0xf392('0x41')]);_0x515359[_0xf392('0x2b')]=_[_0xf392('0x2c')](_0xef448c['query']);_0x515359['filters']=_[_0xf392('0x2d')](_0x515359[_0xf392('0x2a')],_0x515359[_0xf392('0x2b')]);_0x28893a[_0xf392('0x2e')]=_['intersection'](_0x515359[_0xf392('0x2a')],qs[_0xf392('0x2f')](_0xef448c['query'][_0xf392('0x2f')]));_0x28893a['attributes']=_0x28893a[_0xf392('0x2e')][_0xf392('0x42')]?_0x28893a[_0xf392('0x2e')]:_0x515359[_0xf392('0x2a')];if(_0xef448c[_0xf392('0x2b')]['includeAll']){_0x28893a['include']=[{'all':!![]}];}_0x28893a=_[_0xf392('0x37')]({},_0x28893a,_0xef448c[_0xf392('0x39')]);return db[_0xf392('0x26')][_0xf392('0x43')](_0x28893a)['then'](handleEntityNotFound(_0x3ace16,null))[_0xf392('0x1f')](respondWithResult(_0x3ace16,null))[_0xf392('0x3e')](handleError(_0x3ace16,null));};exports[_0xf392('0x44')]=function(_0x4a8081,_0x218ed6){return db[_0xf392('0x26')][_0xf392('0x44')](_0x4a8081[_0xf392('0x45')],{})[_0xf392('0x1f')](respondWithResult(_0x218ed6,0xc9))[_0xf392('0x3e')](handleError(_0x218ed6,null));};exports[_0xf392('0x1e')]=function(_0x29d4e2,_0x68c134){if(_0x29d4e2[_0xf392('0x45')]['id']){delete _0x29d4e2[_0xf392('0x45')]['id'];}return db[_0xf392('0x26')][_0xf392('0x43')]({'where':{'id':_0x29d4e2[_0xf392('0x40')]['id']}})['then'](handleEntityNotFound(_0x68c134,null))[_0xf392('0x1f')](saveUpdates(_0x29d4e2[_0xf392('0x45')],null))[_0xf392('0x1f')](respondWithResult(_0x68c134,null))[_0xf392('0x3e')](handleError(_0x68c134,null));};exports[_0xf392('0x20')]=function(_0x4ae193,_0x5bdd6a){return db[_0xf392('0x26')]['find']({'where':{'id':_0x4ae193[_0xf392('0x40')]['id']}})['then'](handleEntityNotFound(_0x5bdd6a,null))[_0xf392('0x1f')](removeEntity(_0x5bdd6a,null))[_0xf392('0x3e')](handleError(_0x5bdd6a,null));};exports[_0xf392('0x46')]=function(_0x177398,_0x3afb4b,_0x31de3b){var _0x2f317e={};var _0x4d8e33={};var _0x41452c;var _0x1217bd;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x177398[_0xf392('0x40')]['id']}})['then'](handleEntityNotFound(_0x3afb4b,null))['then'](function(_0x3c3d72){if(_0x3c3d72){_0x41452c=_0x3c3d72;_0x4d8e33[_0xf392('0x2a')]=_[_0xf392('0x2c')](db[_0xf392('0x47')][_0xf392('0x41')]);_0x4d8e33[_0xf392('0x2b')]=_[_0xf392('0x2c')](_0x177398[_0xf392('0x2b')]);_0x4d8e33[_0xf392('0x34')]=_[_0xf392('0x2d')](_0x4d8e33[_0xf392('0x2a')],_0x4d8e33['query']);_0x2f317e[_0xf392('0x2e')]=_['intersection'](_0x4d8e33[_0xf392('0x2a')],qs[_0xf392('0x2f')](_0x177398[_0xf392('0x2b')]['fields']));_0x2f317e[_0xf392('0x2e')]=_0x2f317e[_0xf392('0x2e')]['length']?_0x2f317e['attributes']:_0x4d8e33[_0xf392('0x2a')];_0x2f317e['order']=qs[_0xf392('0x32')](_0x177398[_0xf392('0x2b')][_0xf392('0x32')]);_0x2f317e[_0xf392('0x33')]=qs[_0xf392('0x34')](_[_0xf392('0x35')](_0x177398[_0xf392('0x2b')],_0x4d8e33[_0xf392('0x34')]));if(_0x177398[_0xf392('0x2b')]['filter']){_0x2f317e['where']=_['merge'](_0x2f317e[_0xf392('0x33')],{'$or':_[_0xf392('0x25')](_0x2f317e['attributes'],function(_0x1a0f36){var _0x552b5c={};_0x552b5c[_0x1a0f36]={'$like':'%'+_0x177398['query'][_0xf392('0x36')]+'%'};return _0x552b5c;})});}_0x2f317e=_[_0xf392('0x37')]({},_0x2f317e,_0x177398[_0xf392('0x39')]);return _0x41452c['getFields'](_0x2f317e);}})['then'](function(_0x16a677){if(_0x16a677){_0x1217bd=_0x16a677[_0xf392('0x42')];if(!_0x177398[_0xf392('0x2b')][_0xf392('0x48')](_0xf392('0x30'))){_0x2f317e[_0xf392('0x16')]=qs[_0xf392('0x16')](_0x177398[_0xf392('0x2b')][_0xf392('0x16')]);_0x2f317e['offset']=qs['offset'](_0x177398[_0xf392('0x2b')]['offset']);}return _0x41452c[_0xf392('0x46')](_0x2f317e);}})[_0xf392('0x1f')](function(_0x2e84ca){if(_0x2e84ca){return _0x2e84ca?{'count':_0x1217bd,'rows':_0x2e84ca}:null;}})['then'](respondWithResult(_0x3afb4b,null))[_0xf392('0x3e')](handleError(_0x3afb4b,null));};exports['getSubjects']=function(_0x5eea04,_0xf3fcce,_0x3565f9){var _0x316712={};var _0x8d71dd={};var _0x4e96a6;var _0x360728;return db[_0xf392('0x26')][_0xf392('0x49')]({'where':{'id':_0x5eea04[_0xf392('0x40')]['id']}})['then'](handleEntityNotFound(_0xf3fcce,null))[_0xf392('0x1f')](function(_0x4525cc){if(_0x4525cc){_0x4e96a6=_0x4525cc;_0x8d71dd['model']=_[_0xf392('0x2c')](db['ZendeskField'][_0xf392('0x41')]);_0x8d71dd[_0xf392('0x2b')]=_[_0xf392('0x2c')](_0x5eea04['query']);_0x8d71dd[_0xf392('0x34')]=_[_0xf392('0x2d')](_0x8d71dd[_0xf392('0x2a')],_0x8d71dd['query']);_0x316712['attributes']=_[_0xf392('0x2d')](_0x8d71dd['model'],qs[_0xf392('0x2f')](_0x5eea04['query'][_0xf392('0x2f')]));_0x316712['attributes']=_0x316712[_0xf392('0x2e')]['length']?_0x316712[_0xf392('0x2e')]:_0x8d71dd['model'];_0x316712[_0xf392('0x31')]=qs[_0xf392('0x32')](_0x5eea04[_0xf392('0x2b')][_0xf392('0x32')]);_0x316712[_0xf392('0x33')]=qs[_0xf392('0x34')](_[_0xf392('0x35')](_0x5eea04[_0xf392('0x2b')],_0x8d71dd[_0xf392('0x34')]));if(_0x5eea04[_0xf392('0x2b')]['filter']){_0x316712[_0xf392('0x33')]=_[_0xf392('0x37')](_0x316712[_0xf392('0x33')],{'$or':_['map'](_0x316712[_0xf392('0x2e')],function(_0x29a98c){var _0x53e64d={};_0x53e64d[_0x29a98c]={'$like':'%'+_0x5eea04['query'][_0xf392('0x36')]+'%'};return _0x53e64d;})});}_0x316712=_['merge']({},_0x316712,_0x5eea04[_0xf392('0x39')]);return _0x4e96a6['getSubjects'](_0x316712);}})[_0xf392('0x1f')](function(_0x36c00e){if(_0x36c00e){_0x360728=_0x36c00e['length'];if(!_0x5eea04['query'][_0xf392('0x48')](_0xf392('0x30'))){_0x316712['limit']=qs[_0xf392('0x16')](_0x5eea04['query'][_0xf392('0x16')]);_0x316712['offset']=qs[_0xf392('0x18')](_0x5eea04[_0xf392('0x2b')][_0xf392('0x18')]);}return _0x4e96a6['getSubjects'](_0x316712);}})['then'](function(_0x406057){if(_0x406057){return _0x406057?{'count':_0x360728,'rows':_0x406057}:null;}})[_0xf392('0x1f')](respondWithResult(_0xf3fcce,null))[_0xf392('0x3e')](handleError(_0xf3fcce,null));};exports[_0xf392('0x4a')]=function(_0x7170c5,_0x48e8ca,_0x44f494){var _0x259920={};var _0x4132dd={};var _0x2a9f40;var _0x5777c8;return db[_0xf392('0x26')]['findOne']({'where':{'id':_0x7170c5[_0xf392('0x40')]['id']}})[_0xf392('0x1f')](handleEntityNotFound(_0x48e8ca,null))[_0xf392('0x1f')](function(_0x247dc){if(_0x247dc){_0x2a9f40=_0x247dc;_0x4132dd[_0xf392('0x2a')]=_[_0xf392('0x2c')](db['ZendeskField']['rawAttributes']);_0x4132dd['query']=_[_0xf392('0x2c')](_0x7170c5['query']);_0x4132dd[_0xf392('0x34')]=_[_0xf392('0x2d')](_0x4132dd[_0xf392('0x2a')],_0x4132dd['query']);_0x259920['attributes']=_[_0xf392('0x2d')](_0x4132dd[_0xf392('0x2a')],qs[_0xf392('0x2f')](_0x7170c5[_0xf392('0x2b')][_0xf392('0x2f')]));_0x259920[_0xf392('0x2e')]=_0x259920['attributes'][_0xf392('0x42')]?_0x259920['attributes']:_0x4132dd[_0xf392('0x2a')];_0x259920['order']=qs[_0xf392('0x32')](_0x7170c5['query'][_0xf392('0x32')]);_0x259920[_0xf392('0x33')]=qs[_0xf392('0x34')](_[_0xf392('0x35')](_0x7170c5[_0xf392('0x2b')],_0x4132dd[_0xf392('0x34')]));if(_0x7170c5['query']['filter']){_0x259920[_0xf392('0x33')]=_['merge'](_0x259920[_0xf392('0x33')],{'$or':_[_0xf392('0x25')](_0x259920[_0xf392('0x2e')],function(_0x5e36e4){var _0x9a7340={};_0x9a7340[_0x5e36e4]={'$like':'%'+_0x7170c5[_0xf392('0x2b')][_0xf392('0x36')]+'%'};return _0x9a7340;})});}_0x259920=_[_0xf392('0x37')]({},_0x259920,_0x7170c5[_0xf392('0x39')]);return _0x2a9f40[_0xf392('0x4a')](_0x259920);}})['then'](function(_0x2f0e51){if(_0x2f0e51){_0x5777c8=_0x2f0e51['length'];if(!_0x7170c5[_0xf392('0x2b')]['hasOwnProperty']('nolimit')){_0x259920[_0xf392('0x16')]=qs[_0xf392('0x16')](_0x7170c5[_0xf392('0x2b')][_0xf392('0x16')]);_0x259920[_0xf392('0x18')]=qs[_0xf392('0x18')](_0x7170c5[_0xf392('0x2b')]['offset']);}return _0x2a9f40[_0xf392('0x4a')](_0x259920);}})[_0xf392('0x1f')](function(_0x2dca2e){if(_0x2dca2e){return _0x2dca2e?{'count':_0x5777c8,'rows':_0x2dca2e}:null;}})['then'](respondWithResult(_0x48e8ca,null))['catch'](handleError(_0x48e8ca,null));};exports[_0xf392('0x4b')]=function(_0x42678f,_0x1b82a0,_0x52483e){var _0x201936={};var _0x314bad={};var _0x290ea8;var _0x39978c;return db['ZendeskConfiguration'][_0xf392('0x49')]({'where':{'id':_0x42678f['params']['id']}})[_0xf392('0x1f')](handleEntityNotFound(_0x1b82a0,null))[_0xf392('0x1f')](function(_0x1df775){if(_0x1df775){_0x290ea8=_0x1df775;_0x314bad[_0xf392('0x2a')]=_[_0xf392('0x2c')](db[_0xf392('0x4c')]['rawAttributes']);_0x314bad[_0xf392('0x2b')]=_['keys'](_0x42678f[_0xf392('0x2b')]);_0x314bad['filters']=_['intersection'](_0x314bad['model'],_0x314bad[_0xf392('0x2b')]);_0x201936[_0xf392('0x2e')]=_[_0xf392('0x2d')](_0x314bad['model'],qs['fields'](_0x42678f['query'][_0xf392('0x2f')]));_0x201936['attributes']=_0x201936[_0xf392('0x2e')][_0xf392('0x42')]?_0x201936[_0xf392('0x2e')]:_0x314bad[_0xf392('0x2a')];_0x201936[_0xf392('0x31')]=qs[_0xf392('0x32')](_0x42678f[_0xf392('0x2b')][_0xf392('0x32')]);_0x201936['where']=qs['filters'](_[_0xf392('0x35')](_0x42678f[_0xf392('0x2b')],_0x314bad[_0xf392('0x34')]));if(_0x42678f[_0xf392('0x2b')][_0xf392('0x36')]){_0x201936['where']=_[_0xf392('0x37')](_0x201936[_0xf392('0x33')],{'$or':_[_0xf392('0x25')](_0x201936[_0xf392('0x2e')],function(_0x36cf71){var _0x44a9ac={};_0x44a9ac[_0x36cf71]={'$like':'%'+_0x42678f[_0xf392('0x2b')][_0xf392('0x36')]+'%'};return _0x44a9ac;})});}_0x201936=_[_0xf392('0x37')]({},_0x201936,_0x42678f[_0xf392('0x39')]);return _0x290ea8['getTags'](_0x201936);}})[_0xf392('0x1f')](function(_0xfeb587){if(_0xfeb587){_0x39978c=_0xfeb587[_0xf392('0x42')];if(!_0x42678f[_0xf392('0x2b')][_0xf392('0x48')](_0xf392('0x30'))){_0x201936[_0xf392('0x16')]=qs[_0xf392('0x16')](_0x42678f['query'][_0xf392('0x16')]);_0x201936['offset']=qs['offset'](_0x42678f[_0xf392('0x2b')][_0xf392('0x18')]);}return _0x290ea8[_0xf392('0x4b')](_0x201936);}})['then'](function(_0x324c48){if(_0x324c48){return _0x324c48?{'count':_0x39978c,'rows':_0x324c48}:null;}})[_0xf392('0x1f')](respondWithResult(_0x1b82a0,null))[_0xf392('0x3e')](handleError(_0x1b82a0,null));};exports[_0xf392('0x4d')]=function(_0x57de8e,_0xe7d7e7,_0x2d57b7){if(_0x57de8e[_0xf392('0x45')]['id']){delete _0x57de8e['body']['id'];}return db[_0xf392('0x26')][_0xf392('0x49')]({'where':{'id':_0x57de8e['params']['id']}})['then'](handleEntityNotFound(_0xe7d7e7,null))[_0xf392('0x1f')](function(_0x31fc72){if(_0x31fc72){return _0x31fc72[_0xf392('0x4d')](_0x57de8e[_0xf392('0x45')][_0xf392('0x4e')]||[]);}return null;})[_0xf392('0x1f')](respondWithResult(_0xe7d7e7,null))[_0xf392('0x3e')](handleError(_0xe7d7e7,null));}; \ No newline at end of file +var _0xf044=['json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','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'];(function(_0x1f54d7,_0xafc682){var _0x355fc0=function(_0x158e0e){while(--_0x158e0e){_0x1f54d7['push'](_0x1f54d7['shift']());}};_0x355fc0(++_0xafc682);}(_0xf044,0x12e));var _0x4f04=function(_0x30ffb2,_0x3c6b1a){_0x30ffb2=_0x30ffb2-0x0;var _0x1d78b9=_0xf044[_0x30ffb2];return _0x1d78b9;};'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(_0x4f04('0x0'));var moment=require(_0x4f04('0x1'));var BPromise=require(_0x4f04('0x2'));var Mustache=require(_0x4f04('0x3'));var util=require(_0x4f04('0x4'));var path=require(_0x4f04('0x5'));var sox=require(_0x4f04('0x6'));var csv=require('to-csv');var ejs=require(_0x4f04('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f04('0x8'));var squel=require('squel');var crypto=require(_0x4f04('0x9'));var jsforce=require(_0x4f04('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4f04('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f04('0xc'));var authService=require(_0x4f04('0xd'));var qs=require(_0x4f04('0xe'));var as=require(_0x4f04('0xf'));var hardwareService=require(_0x4f04('0x10'));var logger=require(_0x4f04('0x11'))(_0x4f04('0x12'));var utils=require(_0x4f04('0x13'));var config=require(_0x4f04('0x14'));var licenseUtil=require(_0x4f04('0x15'));var db=require(_0x4f04('0x16'))['db'];function respondWithStatusCode(_0x362dc5,_0x1454de){_0x1454de=_0x1454de||0xcc;return function(_0x4b0091){if(_0x4b0091){return _0x362dc5[_0x4f04('0x17')](_0x1454de);}return _0x362dc5[_0x4f04('0x18')](_0x1454de)[_0x4f04('0x19')]();};}function respondWithResult(_0x27597a,_0x1cb340){_0x1cb340=_0x1cb340||0xc8;return function(_0x19ccfb){if(_0x19ccfb){return _0x27597a[_0x4f04('0x18')](_0x1cb340)['json'](_0x19ccfb);}};}function respondWithFilteredResult(_0x2ee37d,_0xf43499){return function(_0x21181c){if(_0x21181c){var _0x578821=typeof _0xf43499[_0x4f04('0x1a')]===_0x4f04('0x1b')&&typeof _0xf43499[_0x4f04('0x1c')]==='undefined';var _0x92cc4=_0x21181c[_0x4f04('0x1d')];var _0x40d777=_0x578821?0x0:_0xf43499[_0x4f04('0x1a')];var _0x2ff955=_0x578821?_0x21181c['count']:_0xf43499[_0x4f04('0x1a')]+_0xf43499['limit'];var _0x5a2118;if(_0x2ff955>=_0x92cc4){_0x2ff955=_0x92cc4;_0x5a2118=0xc8;}else{_0x5a2118=0xce;}_0x2ee37d[_0x4f04('0x18')](_0x5a2118);return _0x2ee37d['set']('Content-Range',_0x40d777+'-'+_0x2ff955+'/'+_0x92cc4)[_0x4f04('0x1e')](_0x21181c);}return null;};}function patchUpdates(_0x51012e){return function(_0x21dac7){try{jsonpatch[_0x4f04('0x1f')](_0x21dac7,_0x51012e,!![]);}catch(_0x2057e1){return BPromise[_0x4f04('0x20')](_0x2057e1);}return _0x21dac7[_0x4f04('0x21')]();};}function saveUpdates(_0x57d5a5,_0x4c15dc){return function(_0x5bf30c){if(_0x5bf30c){return _0x5bf30c[_0x4f04('0x22')](_0x57d5a5)[_0x4f04('0x23')](function(_0x2ddffb){return _0x2ddffb;});}return null;};}function removeEntity(_0xc1c1d4,_0x5b8ea2){return function(_0x4d0822){if(_0x4d0822){return _0x4d0822[_0x4f04('0x24')]()[_0x4f04('0x23')](function(){_0xc1c1d4[_0x4f04('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x334c55,_0x4bcedc){return function(_0x104205){if(!_0x104205){_0x334c55[_0x4f04('0x17')](0x194);}return _0x104205;};}function handleError(_0x7a085f,_0x2a2971){_0x2a2971=_0x2a2971||0x1f4;return function(_0x2c8744){logger[_0x4f04('0x25')](_0x2c8744[_0x4f04('0x26')]);if(_0x2c8744[_0x4f04('0x27')]){delete _0x2c8744[_0x4f04('0x27')];}_0x7a085f['status'](_0x2a2971)['send'](_0x2c8744);};}exports[_0x4f04('0x28')]=function(_0x15dba8,_0x266897){var _0x1518ed={},_0x33f234={},_0x20a969={'count':0x0,'rows':[]};var _0x47105e=_[_0x4f04('0x29')](db['ZendeskConfiguration'][_0x4f04('0x2a')],function(_0x14f767){return{'name':_0x14f767[_0x4f04('0x2b')],'type':_0x14f767['type'][_0x4f04('0x2c')]};});_0x33f234[_0x4f04('0x2d')]=_[_0x4f04('0x29')](_0x47105e,'name');_0x33f234['query']=_[_0x4f04('0x2e')](_0x15dba8[_0x4f04('0x2f')]);_0x33f234[_0x4f04('0x30')]=_[_0x4f04('0x31')](_0x33f234[_0x4f04('0x2d')],_0x33f234[_0x4f04('0x2f')]);_0x1518ed['attributes']=_[_0x4f04('0x31')](_0x33f234[_0x4f04('0x2d')],qs[_0x4f04('0x32')](_0x15dba8[_0x4f04('0x2f')][_0x4f04('0x32')]));_0x1518ed[_0x4f04('0x33')]=_0x1518ed[_0x4f04('0x33')][_0x4f04('0x34')]?_0x1518ed[_0x4f04('0x33')]:_0x33f234[_0x4f04('0x2d')];if(!_0x15dba8[_0x4f04('0x2f')][_0x4f04('0x35')](_0x4f04('0x36'))){_0x1518ed['limit']=qs[_0x4f04('0x1c')](_0x15dba8[_0x4f04('0x2f')][_0x4f04('0x1c')]);_0x1518ed[_0x4f04('0x1a')]=qs[_0x4f04('0x1a')](_0x15dba8[_0x4f04('0x2f')][_0x4f04('0x1a')]);}_0x1518ed[_0x4f04('0x37')]=qs[_0x4f04('0x38')](_0x15dba8[_0x4f04('0x2f')]['sort']);_0x1518ed[_0x4f04('0x39')]=qs['filters'](_[_0x4f04('0x3a')](_0x15dba8[_0x4f04('0x2f')],_0x33f234[_0x4f04('0x30')]),_0x47105e);if(_0x15dba8['query'][_0x4f04('0x3b')]){_0x1518ed['where']=_[_0x4f04('0x3c')](_0x1518ed[_0x4f04('0x39')],{'$or':_['map'](_0x47105e,function(_0x3b2e95){if(_0x3b2e95[_0x4f04('0x3d')]!==_0x4f04('0x3e')){var _0x43909f={};_0x43909f[_0x3b2e95[_0x4f04('0x27')]]={'$like':'%'+_0x15dba8[_0x4f04('0x2f')][_0x4f04('0x3b')]+'%'};return _0x43909f;}})});}_0x1518ed=_['merge']({},_0x1518ed,_0x15dba8[_0x4f04('0x3f')]);var _0x4f730b={'where':_0x1518ed[_0x4f04('0x39')]};return db[_0x4f04('0x40')][_0x4f04('0x1d')](_0x4f730b)[_0x4f04('0x23')](function(_0x32ba21){_0x20a969[_0x4f04('0x1d')]=_0x32ba21;if(_0x15dba8['query'][_0x4f04('0x41')]){_0x1518ed[_0x4f04('0x42')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x4f04('0x43')](_0x1518ed);})[_0x4f04('0x23')](function(_0x1c1e20){_0x20a969[_0x4f04('0x44')]=_0x1c1e20;return _0x20a969;})['then'](respondWithFilteredResult(_0x266897,_0x1518ed))[_0x4f04('0x45')](handleError(_0x266897,null));};exports['show']=function(_0xb868e7,_0x489b6c){var _0x4c76e5={'raw':![],'where':{'id':_0xb868e7[_0x4f04('0x46')]['id']}},_0x4f6e0a={};_0x4f6e0a[_0x4f04('0x2d')]=_[_0x4f04('0x2e')](db['ZendeskConfiguration'][_0x4f04('0x2a')]);_0x4f6e0a[_0x4f04('0x2f')]=_[_0x4f04('0x2e')](_0xb868e7[_0x4f04('0x2f')]);_0x4f6e0a['filters']=_['intersection'](_0x4f6e0a[_0x4f04('0x2d')],_0x4f6e0a['query']);_0x4c76e5[_0x4f04('0x33')]=_[_0x4f04('0x31')](_0x4f6e0a[_0x4f04('0x2d')],qs[_0x4f04('0x32')](_0xb868e7['query'][_0x4f04('0x32')]));_0x4c76e5['attributes']=_0x4c76e5[_0x4f04('0x33')][_0x4f04('0x34')]?_0x4c76e5[_0x4f04('0x33')]:_0x4f6e0a[_0x4f04('0x2d')];if(_0xb868e7[_0x4f04('0x2f')][_0x4f04('0x41')]){_0x4c76e5[_0x4f04('0x42')]=[{'all':!![]}];}_0x4c76e5=_[_0x4f04('0x3c')]({},_0x4c76e5,_0xb868e7[_0x4f04('0x3f')]);return db[_0x4f04('0x40')][_0x4f04('0x47')](_0x4c76e5)['then'](handleEntityNotFound(_0x489b6c,null))[_0x4f04('0x23')](respondWithResult(_0x489b6c,null))[_0x4f04('0x45')](handleError(_0x489b6c,null));};exports[_0x4f04('0x48')]=function(_0x2380f5,_0x21b0b0){return db[_0x4f04('0x40')]['create'](_0x2380f5[_0x4f04('0x49')],{})[_0x4f04('0x23')](respondWithResult(_0x21b0b0,0xc9))['catch'](handleError(_0x21b0b0,null));};exports[_0x4f04('0x22')]=function(_0x3dd034,_0x7e321a){if(_0x3dd034[_0x4f04('0x49')]['id']){delete _0x3dd034['body']['id'];}return db[_0x4f04('0x40')]['find']({'where':{'id':_0x3dd034[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x7e321a,null))['then'](saveUpdates(_0x3dd034['body'],null))[_0x4f04('0x23')](respondWithResult(_0x7e321a,null))['catch'](handleError(_0x7e321a,null));};exports['destroy']=function(_0xf57b0c,_0x1f5e8e){return db[_0x4f04('0x40')][_0x4f04('0x47')]({'where':{'id':_0xf57b0c[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x1f5e8e,null))['then'](removeEntity(_0x1f5e8e,null))['catch'](handleError(_0x1f5e8e,null));};exports['getFields']=function(_0x33772f,_0x420d20,_0x28c13a){var _0x4d7626={};var _0x469326={};var _0x1cafb9;var _0x362dbf;return db[_0x4f04('0x40')][_0x4f04('0x4a')]({'where':{'id':_0x33772f[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x420d20,null))[_0x4f04('0x23')](function(_0x13019c){if(_0x13019c){_0x1cafb9=_0x13019c;_0x469326[_0x4f04('0x2d')]=_[_0x4f04('0x2e')](db[_0x4f04('0x4b')]['rawAttributes']);_0x469326['query']=_[_0x4f04('0x2e')](_0x33772f['query']);_0x469326[_0x4f04('0x30')]=_[_0x4f04('0x31')](_0x469326[_0x4f04('0x2d')],_0x469326[_0x4f04('0x2f')]);_0x4d7626[_0x4f04('0x33')]=_['intersection'](_0x469326[_0x4f04('0x2d')],qs['fields'](_0x33772f[_0x4f04('0x2f')][_0x4f04('0x32')]));_0x4d7626['attributes']=_0x4d7626[_0x4f04('0x33')][_0x4f04('0x34')]?_0x4d7626[_0x4f04('0x33')]:_0x469326[_0x4f04('0x2d')];_0x4d7626[_0x4f04('0x37')]=qs[_0x4f04('0x38')](_0x33772f[_0x4f04('0x2f')][_0x4f04('0x38')]);_0x4d7626['where']=qs[_0x4f04('0x30')](_[_0x4f04('0x3a')](_0x33772f['query'],_0x469326[_0x4f04('0x30')]));if(_0x33772f[_0x4f04('0x2f')][_0x4f04('0x3b')]){_0x4d7626['where']=_[_0x4f04('0x3c')](_0x4d7626[_0x4f04('0x39')],{'$or':_[_0x4f04('0x29')](_0x4d7626[_0x4f04('0x33')],function(_0xc71a9a){var _0x278934={};_0x278934[_0xc71a9a]={'$like':'%'+_0x33772f[_0x4f04('0x2f')][_0x4f04('0x3b')]+'%'};return _0x278934;})});}_0x4d7626=_[_0x4f04('0x3c')]({},_0x4d7626,_0x33772f[_0x4f04('0x3f')]);return _0x1cafb9[_0x4f04('0x4c')](_0x4d7626);}})[_0x4f04('0x23')](function(_0x38fb3b){if(_0x38fb3b){_0x362dbf=_0x38fb3b['length'];if(!_0x33772f[_0x4f04('0x2f')]['hasOwnProperty'](_0x4f04('0x36'))){_0x4d7626[_0x4f04('0x1c')]=qs[_0x4f04('0x1c')](_0x33772f[_0x4f04('0x2f')][_0x4f04('0x1c')]);_0x4d7626[_0x4f04('0x1a')]=qs[_0x4f04('0x1a')](_0x33772f[_0x4f04('0x2f')][_0x4f04('0x1a')]);}return _0x1cafb9[_0x4f04('0x4c')](_0x4d7626);}})[_0x4f04('0x23')](function(_0x401d2c){if(_0x401d2c){return _0x401d2c?{'count':_0x362dbf,'rows':_0x401d2c}:null;}})[_0x4f04('0x23')](respondWithResult(_0x420d20,null))[_0x4f04('0x45')](handleError(_0x420d20,null));};exports['getSubjects']=function(_0x444b95,_0x445a99,_0x111d57){var _0x2a63ff={};var _0x2d0ff9={};var _0x1fc972;var _0x3c1aec;return db['ZendeskConfiguration'][_0x4f04('0x4a')]({'where':{'id':_0x444b95[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x445a99,null))[_0x4f04('0x23')](function(_0x544bdd){if(_0x544bdd){_0x1fc972=_0x544bdd;_0x2d0ff9['model']=_[_0x4f04('0x2e')](db['ZendeskField'][_0x4f04('0x2a')]);_0x2d0ff9[_0x4f04('0x2f')]=_[_0x4f04('0x2e')](_0x444b95[_0x4f04('0x2f')]);_0x2d0ff9[_0x4f04('0x30')]=_[_0x4f04('0x31')](_0x2d0ff9['model'],_0x2d0ff9[_0x4f04('0x2f')]);_0x2a63ff[_0x4f04('0x33')]=_[_0x4f04('0x31')](_0x2d0ff9['model'],qs[_0x4f04('0x32')](_0x444b95['query'][_0x4f04('0x32')]));_0x2a63ff[_0x4f04('0x33')]=_0x2a63ff['attributes'][_0x4f04('0x34')]?_0x2a63ff[_0x4f04('0x33')]:_0x2d0ff9[_0x4f04('0x2d')];_0x2a63ff[_0x4f04('0x37')]=qs[_0x4f04('0x38')](_0x444b95['query']['sort']);_0x2a63ff[_0x4f04('0x39')]=qs[_0x4f04('0x30')](_[_0x4f04('0x3a')](_0x444b95[_0x4f04('0x2f')],_0x2d0ff9[_0x4f04('0x30')]));if(_0x444b95[_0x4f04('0x2f')][_0x4f04('0x3b')]){_0x2a63ff[_0x4f04('0x39')]=_[_0x4f04('0x3c')](_0x2a63ff[_0x4f04('0x39')],{'$or':_[_0x4f04('0x29')](_0x2a63ff[_0x4f04('0x33')],function(_0x2c2d36){var _0x30565f={};_0x30565f[_0x2c2d36]={'$like':'%'+_0x444b95[_0x4f04('0x2f')]['filter']+'%'};return _0x30565f;})});}_0x2a63ff=_[_0x4f04('0x3c')]({},_0x2a63ff,_0x444b95['options']);return _0x1fc972[_0x4f04('0x4d')](_0x2a63ff);}})[_0x4f04('0x23')](function(_0x473065){if(_0x473065){_0x3c1aec=_0x473065[_0x4f04('0x34')];if(!_0x444b95[_0x4f04('0x2f')][_0x4f04('0x35')](_0x4f04('0x36'))){_0x2a63ff[_0x4f04('0x1c')]=qs[_0x4f04('0x1c')](_0x444b95[_0x4f04('0x2f')][_0x4f04('0x1c')]);_0x2a63ff[_0x4f04('0x1a')]=qs[_0x4f04('0x1a')](_0x444b95['query'][_0x4f04('0x1a')]);}return _0x1fc972[_0x4f04('0x4d')](_0x2a63ff);}})[_0x4f04('0x23')](function(_0x3e725e){if(_0x3e725e){return _0x3e725e?{'count':_0x3c1aec,'rows':_0x3e725e}:null;}})[_0x4f04('0x23')](respondWithResult(_0x445a99,null))[_0x4f04('0x45')](handleError(_0x445a99,null));};exports['getDescriptions']=function(_0xd9395b,_0x4e376a,_0x37a1d7){var _0x38b718={};var _0x1d5d08={};var _0x436776;var _0x2fb954;return db[_0x4f04('0x40')][_0x4f04('0x4a')]({'where':{'id':_0xd9395b['params']['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x4e376a,null))[_0x4f04('0x23')](function(_0x26a8bc){if(_0x26a8bc){_0x436776=_0x26a8bc;_0x1d5d08[_0x4f04('0x2d')]=_[_0x4f04('0x2e')](db['ZendeskField'][_0x4f04('0x2a')]);_0x1d5d08[_0x4f04('0x2f')]=_[_0x4f04('0x2e')](_0xd9395b[_0x4f04('0x2f')]);_0x1d5d08[_0x4f04('0x30')]=_[_0x4f04('0x31')](_0x1d5d08[_0x4f04('0x2d')],_0x1d5d08['query']);_0x38b718[_0x4f04('0x33')]=_[_0x4f04('0x31')](_0x1d5d08[_0x4f04('0x2d')],qs[_0x4f04('0x32')](_0xd9395b[_0x4f04('0x2f')][_0x4f04('0x32')]));_0x38b718[_0x4f04('0x33')]=_0x38b718[_0x4f04('0x33')]['length']?_0x38b718['attributes']:_0x1d5d08[_0x4f04('0x2d')];_0x38b718['order']=qs[_0x4f04('0x38')](_0xd9395b[_0x4f04('0x2f')][_0x4f04('0x38')]);_0x38b718[_0x4f04('0x39')]=qs[_0x4f04('0x30')](_[_0x4f04('0x3a')](_0xd9395b[_0x4f04('0x2f')],_0x1d5d08[_0x4f04('0x30')]));if(_0xd9395b[_0x4f04('0x2f')][_0x4f04('0x3b')]){_0x38b718['where']=_[_0x4f04('0x3c')](_0x38b718[_0x4f04('0x39')],{'$or':_[_0x4f04('0x29')](_0x38b718['attributes'],function(_0x585ba3){var _0x8d8f67={};_0x8d8f67[_0x585ba3]={'$like':'%'+_0xd9395b[_0x4f04('0x2f')][_0x4f04('0x3b')]+'%'};return _0x8d8f67;})});}_0x38b718=_[_0x4f04('0x3c')]({},_0x38b718,_0xd9395b['options']);return _0x436776['getDescriptions'](_0x38b718);}})['then'](function(_0x46cb2b){if(_0x46cb2b){_0x2fb954=_0x46cb2b[_0x4f04('0x34')];if(!_0xd9395b[_0x4f04('0x2f')][_0x4f04('0x35')](_0x4f04('0x36'))){_0x38b718[_0x4f04('0x1c')]=qs['limit'](_0xd9395b[_0x4f04('0x2f')][_0x4f04('0x1c')]);_0x38b718[_0x4f04('0x1a')]=qs[_0x4f04('0x1a')](_0xd9395b[_0x4f04('0x2f')]['offset']);}return _0x436776[_0x4f04('0x4e')](_0x38b718);}})['then'](function(_0x284d87){if(_0x284d87){return _0x284d87?{'count':_0x2fb954,'rows':_0x284d87}:null;}})[_0x4f04('0x23')](respondWithResult(_0x4e376a,null))[_0x4f04('0x45')](handleError(_0x4e376a,null));};exports[_0x4f04('0x4f')]=function(_0x422d78,_0x38ed64,_0x3c5c7e){var _0x418e14={};var _0x5be88c={};var _0x8ea3b7;var _0x10c0a7;return db[_0x4f04('0x40')][_0x4f04('0x4a')]({'where':{'id':_0x422d78[_0x4f04('0x46')]['id']}})['then'](handleEntityNotFound(_0x38ed64,null))[_0x4f04('0x23')](function(_0x526e01){if(_0x526e01){_0x8ea3b7=_0x526e01;_0x5be88c[_0x4f04('0x2d')]=_['keys'](db[_0x4f04('0x50')]['rawAttributes']);_0x5be88c[_0x4f04('0x2f')]=_[_0x4f04('0x2e')](_0x422d78['query']);_0x5be88c[_0x4f04('0x30')]=_[_0x4f04('0x31')](_0x5be88c[_0x4f04('0x2d')],_0x5be88c[_0x4f04('0x2f')]);_0x418e14[_0x4f04('0x33')]=_[_0x4f04('0x31')](_0x5be88c['model'],qs[_0x4f04('0x32')](_0x422d78['query'][_0x4f04('0x32')]));_0x418e14['attributes']=_0x418e14[_0x4f04('0x33')][_0x4f04('0x34')]?_0x418e14[_0x4f04('0x33')]:_0x5be88c[_0x4f04('0x2d')];_0x418e14[_0x4f04('0x37')]=qs['sort'](_0x422d78[_0x4f04('0x2f')][_0x4f04('0x38')]);_0x418e14[_0x4f04('0x39')]=qs['filters'](_[_0x4f04('0x3a')](_0x422d78['query'],_0x5be88c['filters']));if(_0x422d78[_0x4f04('0x2f')][_0x4f04('0x3b')]){_0x418e14[_0x4f04('0x39')]=_['merge'](_0x418e14[_0x4f04('0x39')],{'$or':_['map'](_0x418e14[_0x4f04('0x33')],function(_0x2ba876){var _0x44eb36={};_0x44eb36[_0x2ba876]={'$like':'%'+_0x422d78['query'][_0x4f04('0x3b')]+'%'};return _0x44eb36;})});}_0x418e14=_[_0x4f04('0x3c')]({},_0x418e14,_0x422d78[_0x4f04('0x3f')]);return _0x8ea3b7[_0x4f04('0x4f')](_0x418e14);}})[_0x4f04('0x23')](function(_0x4c2dde){if(_0x4c2dde){_0x10c0a7=_0x4c2dde[_0x4f04('0x34')];if(!_0x422d78['query'][_0x4f04('0x35')](_0x4f04('0x36'))){_0x418e14[_0x4f04('0x1c')]=qs[_0x4f04('0x1c')](_0x422d78[_0x4f04('0x2f')]['limit']);_0x418e14['offset']=qs[_0x4f04('0x1a')](_0x422d78[_0x4f04('0x2f')][_0x4f04('0x1a')]);}return _0x8ea3b7['getTags'](_0x418e14);}})[_0x4f04('0x23')](function(_0x4feb06){if(_0x4feb06){return _0x4feb06?{'count':_0x10c0a7,'rows':_0x4feb06}:null;}})[_0x4f04('0x23')](respondWithResult(_0x38ed64,null))[_0x4f04('0x45')](handleError(_0x38ed64,null));};exports[_0x4f04('0x51')]=function(_0x3ae218,_0x1be4ee,_0x293b61){if(_0x3ae218[_0x4f04('0x49')]['id']){delete _0x3ae218['body']['id'];}return db[_0x4f04('0x40')][_0x4f04('0x4a')]({'where':{'id':_0x3ae218[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x1be4ee,null))[_0x4f04('0x23')](function(_0x3fcc67){if(_0x3fcc67){return _0x3fcc67[_0x4f04('0x51')](_0x3ae218[_0x4f04('0x49')][_0x4f04('0x52')]||[]);}return null;})[_0x4f04('0x23')](respondWithResult(_0x1be4ee,null))[_0x4f04('0x45')](handleError(_0x1be4ee,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c08001b..5dfd699 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 _0x2032=['int_zendesk_configurations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x940351,_0x3fb1f0){var _0x599d4c=function(_0x2929bb){while(--_0x2929bb){_0x940351['push'](_0x940351['shift']());}};_0x599d4c(++_0x3fb1f0);}(_0x2032,0xd9));var _0x2203=function(_0x960635,_0x144a5c){_0x960635=_0x960635-0x0;var _0x418c7b=_0x2032[_0x960635];return _0x418c7b;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefda=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment','request-promise','path','rimraf'];(function(_0x1a8e85,_0x4525db){var _0x5a4e2a=function(_0xf785a9){while(--_0xf785a9){_0x1a8e85['push'](_0x1a8e85['shift']());}};_0x5a4e2a(++_0x4525db);}(_0xefda,0x96));var _0xaefd=function(_0x4275de,_0x3a94f0){_0x4275de=_0x4275de-0x0;var _0x525ada=_0xefda[_0x4275de];return _0x525ada;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('0xb'),'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 c7938ed..51cbb38 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 _0xb538=['ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb538,0x193));var _0x8b53=function(_0x33de48,_0x4a153e){_0x33de48=_0x33de48-0x0;var _0x1e0c7a=_0xb538[_0x33de48];return _0x1e0c7a;};'use strict';var _=require(_0x8b53('0x0'));var util=require(_0x8b53('0x1'));var moment=require(_0x8b53('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b53('0x3'));var fs=require('fs');var Redis=require(_0x8b53('0x4'));var db=require(_0x8b53('0x5'))['db'];var utils=require(_0x8b53('0x6'));var logger=require(_0x8b53('0x7'))(_0x8b53('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b53('0x9')][_0x8b53('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e6cb1,_0x1b9f98,_0x3d76e7){return new BPromise(function(_0x14765d,_0x2cfc5a){return client[_0x8b53('0xb')](_0x1e6cb1,_0x3d76e7)['then'](function(_0x83f044){logger[_0x8b53('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1b9f98,_0x8b53('0xd'));logger['debug'](_0x8b53('0xe'),_0x1b9f98,_0x8b53('0xd'),JSON['stringify'](_0x83f044));if(_0x83f044[_0x8b53('0xf')]){if(_0x83f044[_0x8b53('0xf')][_0x8b53('0x10')]===0x1f4){logger[_0x8b53('0xf')](_0x8b53('0x11'),_0x1b9f98,_0x83f044['error'][_0x8b53('0x12')]);return _0x2cfc5a(_0x83f044[_0x8b53('0xf')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x1b9f98,_0x83f044[_0x8b53('0xf')][_0x8b53('0x12')]);return _0x14765d(_0x83f044['error'][_0x8b53('0x12')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x1b9f98,_0x8b53('0xd'));_0x14765d(_0x83f044[_0x8b53('0x13')][_0x8b53('0x12')]);}})[_0x8b53('0x14')](function(_0x290eef){logger[_0x8b53('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1b9f98,_0x290eef);_0x2cfc5a(_0x290eef);});});} \ No newline at end of file +var _0x55af=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x548601,_0x53c7c8){var _0x135fb6=function(_0x191d29){while(--_0x191d29){_0x548601['push'](_0x548601['shift']());}};_0x135fb6(++_0x53c7c8);}(_0x55af,0x1df));var _0xf55a=function(_0x17669c,_0x3645ec){_0x17669c=_0x17669c-0x0;var _0x768700=_0x55af[_0x17669c];return _0x768700;};'use strict';var _=require(_0xf55a('0x0'));var util=require(_0xf55a('0x1'));var moment=require(_0xf55a('0x2'));var BPromise=require(_0xf55a('0x3'));var rs=require(_0xf55a('0x4'));var fs=require('fs');var Redis=require(_0xf55a('0x5'));var db=require(_0xf55a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf55a('0x7'))(_0xf55a('0x8'));var config=require(_0xf55a('0x9'));var jayson=require(_0xf55a('0xa'));var client=jayson[_0xf55a('0xb')][_0xf55a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x243c5f,_0x3eb179,_0x3bf254){return new BPromise(function(_0x29384b,_0x152d02){return client[_0xf55a('0xd')](_0x243c5f,_0x3bf254)['then'](function(_0xb2e403){logger[_0xf55a('0xe')](_0xf55a('0xf'),_0x3eb179,_0xf55a('0x10'));logger[_0xf55a('0x11')](_0xf55a('0x12'),_0x3eb179,_0xf55a('0x10'),JSON[_0xf55a('0x13')](_0xb2e403));if(_0xb2e403[_0xf55a('0x14')]){if(_0xb2e403[_0xf55a('0x14')][_0xf55a('0x15')]===0x1f4){logger[_0xf55a('0x14')](_0xf55a('0xf'),_0x3eb179,_0xb2e403[_0xf55a('0x14')]['message']);return _0x152d02(_0xb2e403[_0xf55a('0x14')]['message']);}logger[_0xf55a('0x14')](_0xf55a('0xf'),_0x3eb179,_0xb2e403[_0xf55a('0x14')]['message']);return _0x29384b(_0xb2e403['error'][_0xf55a('0x16')]);}else{logger[_0xf55a('0xe')](_0xf55a('0xf'),_0x3eb179,_0xf55a('0x10'));_0x29384b(_0xb2e403[_0xf55a('0x17')][_0xf55a('0x16')]);}})['catch'](function(_0x13b94d){logger[_0xf55a('0x14')](_0xf55a('0xf'),_0x3eb179,_0x13b94d);_0x152d02(_0x13b94d);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index afaef53..07ebbb6 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 _0x3d5e=['post','put','/:id','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x3d5e,0x1c7));var _0xe3d5=function(_0x18f7e0,_0x40d5e3){_0x18f7e0=_0x18f7e0-0x0;var _0x3ceeae=_0x3d5e[_0x18f7e0];return _0x3ceeae;};'use strict';var multer=require(_0xe3d5('0x0'));var util=require('util');var path=require(_0xe3d5('0x1'));var timeout=require(_0xe3d5('0x2'));var express=require('express');var router=express[_0xe3d5('0x3')]();var fs_extra=require(_0xe3d5('0x4'));var auth=require(_0xe3d5('0x5'));var interaction=require(_0xe3d5('0x6'));var config=require(_0xe3d5('0x7'));var controller=require(_0xe3d5('0x8'));router[_0xe3d5('0x9')]('/',auth[_0xe3d5('0xa')](),controller[_0xe3d5('0xb')]);router[_0xe3d5('0x9')]('/:id',auth[_0xe3d5('0xa')](),controller[_0xe3d5('0xc')]);router[_0xe3d5('0xd')]('/',auth[_0xe3d5('0xa')](),controller['create']);router[_0xe3d5('0xe')](_0xe3d5('0xf'),auth[_0xe3d5('0xa')](),controller[_0xe3d5('0x10')]);router[_0xe3d5('0x11')](_0xe3d5('0xf'),auth[_0xe3d5('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xedc3=['/:id','post','create','put','delete','exports','multer','util','connect-timeout','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x117b07,_0x1afd5e){var _0xc811c7=function(_0x5938fa){while(--_0x5938fa){_0x117b07['push'](_0x117b07['shift']());}};_0xc811c7(++_0x1afd5e);}(_0xedc3,0x164));var _0x3edc=function(_0x152184,_0x5aa561){_0x152184=_0x152184-0x0;var _0x58aded=_0xedc3[_0x152184];return _0x58aded;};'use strict';var multer=require(_0x3edc('0x0'));var util=require(_0x3edc('0x1'));var path=require('path');var timeout=require(_0x3edc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3edc('0x3'));var config=require('../../config/environment');var controller=require(_0x3edc('0x4'));router[_0x3edc('0x5')]('/',auth[_0x3edc('0x6')](),controller[_0x3edc('0x7')]);router[_0x3edc('0x5')](_0x3edc('0x8'),auth[_0x3edc('0x6')](),controller['show']);router[_0x3edc('0x9')]('/',auth['isAuthenticated'](),controller[_0x3edc('0xa')]);router[_0x3edc('0xb')](_0x3edc('0x8'),auth[_0x3edc('0x6')](),controller['update']);router[_0x3edc('0xc')](_0x3edc('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x3edc('0xd')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 8127421..de437c7 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 _0x4bd7=['keyValue','picklist','string','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','variable'];(function(_0x1c16ee,_0xefb5ba){var _0x1a8f88=function(_0x138192){while(--_0x138192){_0x1c16ee['push'](_0x1c16ee['shift']());}};_0x1a8f88(++_0xefb5ba);}(_0x4bd7,0x147));var _0x74bd=function(_0x227378,_0x2073f2){_0x227378=_0x227378-0x0;var _0x502efe=_0x4bd7[_0x227378];return _0x502efe;};'use strict';var Sequelize=require(_0x74bd('0x0'));module[_0x74bd('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x74bd('0x2'),'customVariable',_0x74bd('0x3'),_0x74bd('0x4')),'defaultValue':_0x74bd('0x5')},'content':{'type':Sequelize[_0x74bd('0x6')]},'key':{'type':Sequelize[_0x74bd('0x6')]},'keyType':{'type':Sequelize[_0x74bd('0x7')](_0x74bd('0x5'),_0x74bd('0x2'),_0x74bd('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x74bd('0x6')]},'customField':{'type':Sequelize[_0x74bd('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x74bd('0x6')]}}; \ No newline at end of file +var _0xf542=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x3533ef,_0x4af4c8){var _0x2e1f96=function(_0x5e0d12){while(--_0x5e0d12){_0x3533ef['push'](_0x3533ef['shift']());}};_0x2e1f96(++_0x4af4c8);}(_0xf542,0xd7));var _0x2f54=function(_0x52ef90,_0x43cd52){_0x52ef90=_0x52ef90-0x0;var _0x4dc57f=_0xf542[_0x52ef90];return _0x4dc57f;};'use strict';var Sequelize=require(_0x2f54('0x0'));module['exports']={'type':{'type':Sequelize[_0x2f54('0x1')](_0x2f54('0x2'),_0x2f54('0x3'),_0x2f54('0x4'),'keyValue',_0x2f54('0x5')),'defaultValue':_0x2f54('0x2')},'content':{'type':Sequelize[_0x2f54('0x6')]},'key':{'type':Sequelize[_0x2f54('0x6')]},'keyType':{'type':Sequelize[_0x2f54('0x1')](_0x2f54('0x2'),_0x2f54('0x3'),_0x2f54('0x4'))},'keyContent':{'type':Sequelize[_0x2f54('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2f54('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2f54('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 494b02a..d852657 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 _0x6f75=['papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','ZendeskField','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x358478,_0x5f2729){var _0x1aa513=function(_0x2a969c){while(--_0x2a969c){_0x358478['push'](_0x358478['shift']());}};_0x1aa513(++_0x5f2729);}(_0x6f75,0x15a));var _0x56f7=function(_0x224578,_0x14e99f){_0x224578=_0x224578-0x0;var _0x2a7669=_0x6f75[_0x224578];return _0x2a7669;};'use strict';var emlformat=require(_0x56f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x56f7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x56f7('0x2'));var moment=require(_0x56f7('0x3'));var BPromise=require(_0x56f7('0x4'));var Mustache=require('mustache');var util=require(_0x56f7('0x5'));var path=require('path');var sox=require(_0x56f7('0x6'));var csv=require(_0x56f7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56f7('0x8'));var _=require('lodash');var squel=require(_0x56f7('0x9'));var crypto=require(_0x56f7('0xa'));var jsforce=require(_0x56f7('0xb'));var deskjs=require(_0x56f7('0xc'));var toCsv=require(_0x56f7('0x7'));var querystring=require(_0x56f7('0xd'));var Papa=require(_0x56f7('0xe'));var Redis=require(_0x56f7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x56f7('0x10'));var hardwareService=require(_0x56f7('0x11'));var logger=require(_0x56f7('0x12'))(_0x56f7('0x13'));var utils=require('../../config/utils');var config=require(_0x56f7('0x14'));var licenseUtil=require(_0x56f7('0x15'));var db=require(_0x56f7('0x16'))['db'];function respondWithStatusCode(_0x3568df,_0x520898){_0x520898=_0x520898||0xcc;return function(_0x244098){if(_0x244098){return _0x3568df[_0x56f7('0x17')](_0x520898);}return _0x3568df[_0x56f7('0x18')](_0x520898)[_0x56f7('0x19')]();};}function respondWithResult(_0x1e0f45,_0x5e2823){_0x5e2823=_0x5e2823||0xc8;return function(_0x4e65f7){if(_0x4e65f7){return _0x1e0f45[_0x56f7('0x18')](_0x5e2823)[_0x56f7('0x1a')](_0x4e65f7);}};}function respondWithFilteredResult(_0x8e4526,_0x3aa932){return function(_0x4ef2f6){if(_0x4ef2f6){var _0x4f4e1d=typeof _0x3aa932[_0x56f7('0x1b')]===_0x56f7('0x1c')&&typeof _0x3aa932[_0x56f7('0x1d')]===_0x56f7('0x1c');var _0x12dd9e=_0x4ef2f6['count'];var _0x5b6ef1=_0x4f4e1d?0x0:_0x3aa932[_0x56f7('0x1b')];var _0x1df7f4=_0x4f4e1d?_0x4ef2f6[_0x56f7('0x1e')]:_0x3aa932['offset']+_0x3aa932['limit'];var _0x2f6a2d;if(_0x1df7f4>=_0x12dd9e){_0x1df7f4=_0x12dd9e;_0x2f6a2d=0xc8;}else{_0x2f6a2d=0xce;}_0x8e4526['status'](_0x2f6a2d);return _0x8e4526['set'](_0x56f7('0x1f'),_0x5b6ef1+'-'+_0x1df7f4+'/'+_0x12dd9e)[_0x56f7('0x1a')](_0x4ef2f6);}return null;};}function patchUpdates(_0x43ddf5){return function(_0x1324e9){try{jsonpatch['apply'](_0x1324e9,_0x43ddf5,!![]);}catch(_0x4ded30){return BPromise[_0x56f7('0x20')](_0x4ded30);}return _0x1324e9[_0x56f7('0x21')]();};}function saveUpdates(_0x6a3111,_0x2152ba){return function(_0x1c467c){if(_0x1c467c){return _0x1c467c[_0x56f7('0x22')](_0x6a3111)['then'](function(_0x50ff77){return _0x50ff77;});}return null;};}function removeEntity(_0x1e37b1,_0x1d3eb4){return function(_0x5ed1b5){if(_0x5ed1b5){return _0x5ed1b5[_0x56f7('0x23')]()[_0x56f7('0x24')](function(){_0x1e37b1[_0x56f7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bbef0,_0xd4f7f6){return function(_0x43c720){if(!_0x43c720){_0x1bbef0['sendStatus'](0x194);}return _0x43c720;};}function handleError(_0x247b7b,_0x5d2deb){_0x5d2deb=_0x5d2deb||0x1f4;return function(_0x256f9e){logger['error'](_0x256f9e[_0x56f7('0x25')]);if(_0x256f9e['name']){delete _0x256f9e[_0x56f7('0x26')];}_0x247b7b[_0x56f7('0x18')](_0x5d2deb)[_0x56f7('0x27')](_0x256f9e);};}exports[_0x56f7('0x28')]=function(_0x2b4b96,_0x3d9a3a){var _0x45adfb={},_0x37551c={},_0x230af8={'count':0x0,'rows':[]};var _0x3155a1=_[_0x56f7('0x29')](db[_0x56f7('0x2a')][_0x56f7('0x2b')],function(_0x599cdc){return{'name':_0x599cdc['fieldName'],'type':_0x599cdc['type'][_0x56f7('0x2c')]};});_0x37551c['model']=_[_0x56f7('0x29')](_0x3155a1,'name');_0x37551c[_0x56f7('0x2d')]=_[_0x56f7('0x2e')](_0x2b4b96[_0x56f7('0x2d')]);_0x37551c['filters']=_[_0x56f7('0x2f')](_0x37551c[_0x56f7('0x30')],_0x37551c['query']);_0x45adfb[_0x56f7('0x31')]=_[_0x56f7('0x2f')](_0x37551c[_0x56f7('0x30')],qs[_0x56f7('0x32')](_0x2b4b96[_0x56f7('0x2d')][_0x56f7('0x32')]));_0x45adfb[_0x56f7('0x31')]=_0x45adfb[_0x56f7('0x31')][_0x56f7('0x33')]?_0x45adfb['attributes']:_0x37551c['model'];if(!_0x2b4b96[_0x56f7('0x2d')][_0x56f7('0x34')](_0x56f7('0x35'))){_0x45adfb[_0x56f7('0x1d')]=qs['limit'](_0x2b4b96['query']['limit']);_0x45adfb[_0x56f7('0x1b')]=qs[_0x56f7('0x1b')](_0x2b4b96[_0x56f7('0x2d')][_0x56f7('0x1b')]);}_0x45adfb['order']=qs['sort'](_0x2b4b96[_0x56f7('0x2d')][_0x56f7('0x36')]);_0x45adfb[_0x56f7('0x37')]=qs[_0x56f7('0x38')](_[_0x56f7('0x39')](_0x2b4b96[_0x56f7('0x2d')],_0x37551c['filters']),_0x3155a1);if(_0x2b4b96[_0x56f7('0x2d')][_0x56f7('0x3a')]){_0x45adfb[_0x56f7('0x37')]=_[_0x56f7('0x3b')](_0x45adfb[_0x56f7('0x37')],{'$or':_[_0x56f7('0x29')](_0x3155a1,function(_0x1db9e3){if(_0x1db9e3[_0x56f7('0x3c')]!=='VIRTUAL'){var _0x3713e4={};_0x3713e4[_0x1db9e3[_0x56f7('0x26')]]={'$like':'%'+_0x2b4b96['query'][_0x56f7('0x3a')]+'%'};return _0x3713e4;}})});}_0x45adfb=_[_0x56f7('0x3b')]({},_0x45adfb,_0x2b4b96[_0x56f7('0x3d')]);var _0x2bddf9={'where':_0x45adfb[_0x56f7('0x37')]};return db[_0x56f7('0x2a')][_0x56f7('0x1e')](_0x2bddf9)['then'](function(_0x1104ab){_0x230af8[_0x56f7('0x1e')]=_0x1104ab;if(_0x2b4b96[_0x56f7('0x2d')]['includeAll']){_0x45adfb['include']=[{'all':!![]}];}return db[_0x56f7('0x2a')][_0x56f7('0x3e')](_0x45adfb);})[_0x56f7('0x24')](function(_0x4a1901){_0x230af8[_0x56f7('0x3f')]=_0x4a1901;return _0x230af8;})[_0x56f7('0x24')](respondWithFilteredResult(_0x3d9a3a,_0x45adfb))['catch'](handleError(_0x3d9a3a,null));};exports[_0x56f7('0x40')]=function(_0x51c1e5,_0x528356){var _0x367eb5={'raw':!![],'where':{'id':_0x51c1e5[_0x56f7('0x41')]['id']}},_0x53c195={};_0x53c195[_0x56f7('0x30')]=_[_0x56f7('0x2e')](db[_0x56f7('0x2a')]['rawAttributes']);_0x53c195['query']=_[_0x56f7('0x2e')](_0x51c1e5[_0x56f7('0x2d')]);_0x53c195['filters']=_[_0x56f7('0x2f')](_0x53c195[_0x56f7('0x30')],_0x53c195[_0x56f7('0x2d')]);_0x367eb5[_0x56f7('0x31')]=_['intersection'](_0x53c195[_0x56f7('0x30')],qs[_0x56f7('0x32')](_0x51c1e5[_0x56f7('0x2d')][_0x56f7('0x32')]));_0x367eb5[_0x56f7('0x31')]=_0x367eb5['attributes'][_0x56f7('0x33')]?_0x367eb5['attributes']:_0x53c195['model'];if(_0x51c1e5[_0x56f7('0x2d')][_0x56f7('0x42')]){_0x367eb5[_0x56f7('0x43')]=[{'all':!![]}];}_0x367eb5=_['merge']({},_0x367eb5,_0x51c1e5[_0x56f7('0x3d')]);return db['ZendeskField'][_0x56f7('0x44')](_0x367eb5)[_0x56f7('0x24')](handleEntityNotFound(_0x528356,null))[_0x56f7('0x24')](respondWithResult(_0x528356,null))[_0x56f7('0x45')](handleError(_0x528356,null));};exports[_0x56f7('0x46')]=function(_0x301eb4,_0x17261b){return db[_0x56f7('0x2a')][_0x56f7('0x46')](_0x301eb4[_0x56f7('0x47')],{})[_0x56f7('0x24')](respondWithResult(_0x17261b,0xc9))[_0x56f7('0x45')](handleError(_0x17261b,null));};exports['update']=function(_0x2d20b8,_0x57bea5){if(_0x2d20b8[_0x56f7('0x47')]['id']){delete _0x2d20b8[_0x56f7('0x47')]['id'];}return db['ZendeskField'][_0x56f7('0x44')]({'where':{'id':_0x2d20b8[_0x56f7('0x41')]['id']}})['then'](handleEntityNotFound(_0x57bea5,null))['then'](saveUpdates(_0x2d20b8[_0x56f7('0x47')],null))[_0x56f7('0x24')](respondWithResult(_0x57bea5,null))[_0x56f7('0x45')](handleError(_0x57bea5,null));};exports[_0x56f7('0x23')]=function(_0x536eb4,_0xc8187b){return db[_0x56f7('0x2a')][_0x56f7('0x44')]({'where':{'id':_0x536eb4[_0x56f7('0x41')]['id']}})[_0x56f7('0x24')](handleEntityNotFound(_0xc8187b,null))[_0x56f7('0x24')](removeEntity(_0xc8187b,null))[_0x56f7('0x45')](handleError(_0xc8187b,null));}; \ No newline at end of file +var _0x53d5=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','error','name','index','ZendeskField','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','eml-format','rimraf'];(function(_0x26415b,_0x55e4d2){var _0x45aad5=function(_0x3c06d6){while(--_0x3c06d6){_0x26415b['push'](_0x26415b['shift']());}};_0x45aad5(++_0x55e4d2);}(_0x53d5,0x1cc));var _0x553d=function(_0xee7f65,_0x4ff021){_0xee7f65=_0xee7f65-0x0;var _0x5449bc=_0x53d5[_0xee7f65];return _0x5449bc;};'use strict';var emlformat=require(_0x553d('0x0'));var rimraf=require(_0x553d('0x1'));var zipdir=require(_0x553d('0x2'));var jsonpatch=require(_0x553d('0x3'));var rp=require(_0x553d('0x4'));var moment=require(_0x553d('0x5'));var BPromise=require(_0x553d('0x6'));var Mustache=require('mustache');var util=require(_0x553d('0x7'));var path=require(_0x553d('0x8'));var sox=require(_0x553d('0x9'));var csv=require(_0x553d('0xa'));var ejs=require(_0x553d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x553d('0xc'));var squel=require(_0x553d('0xd'));var crypto=require(_0x553d('0xe'));var jsforce=require(_0x553d('0xf'));var deskjs=require(_0x553d('0x10'));var toCsv=require(_0x553d('0xa'));var querystring=require(_0x553d('0x11'));var Papa=require(_0x553d('0x12'));var Redis=require(_0x553d('0x13'));var authService=require(_0x553d('0x14'));var qs=require(_0x553d('0x15'));var as=require(_0x553d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x553d('0x17'));var utils=require('../../config/utils');var config=require(_0x553d('0x18'));var licenseUtil=require(_0x553d('0x19'));var db=require(_0x553d('0x1a'))['db'];function respondWithStatusCode(_0x1a54ea,_0x41f6c1){_0x41f6c1=_0x41f6c1||0xcc;return function(_0x4285c0){if(_0x4285c0){return _0x1a54ea[_0x553d('0x1b')](_0x41f6c1);}return _0x1a54ea[_0x553d('0x1c')](_0x41f6c1)[_0x553d('0x1d')]();};}function respondWithResult(_0x32b169,_0x3cb13c){_0x3cb13c=_0x3cb13c||0xc8;return function(_0xd11e74){if(_0xd11e74){return _0x32b169['status'](_0x3cb13c)[_0x553d('0x1e')](_0xd11e74);}};}function respondWithFilteredResult(_0x5caa96,_0x1d4f35){return function(_0x2de0c1){if(_0x2de0c1){var _0x12b505=typeof _0x1d4f35['offset']==='undefined'&&typeof _0x1d4f35[_0x553d('0x1f')]===_0x553d('0x20');var _0x2857c5=_0x2de0c1['count'];var _0x2ab468=_0x12b505?0x0:_0x1d4f35[_0x553d('0x21')];var _0x343ce5=_0x12b505?_0x2de0c1[_0x553d('0x22')]:_0x1d4f35[_0x553d('0x21')]+_0x1d4f35[_0x553d('0x1f')];var _0x719651;if(_0x343ce5>=_0x2857c5){_0x343ce5=_0x2857c5;_0x719651=0xc8;}else{_0x719651=0xce;}_0x5caa96[_0x553d('0x1c')](_0x719651);return _0x5caa96[_0x553d('0x23')](_0x553d('0x24'),_0x2ab468+'-'+_0x343ce5+'/'+_0x2857c5)[_0x553d('0x1e')](_0x2de0c1);}return null;};}function patchUpdates(_0x4950e7){return function(_0x11bc86){try{jsonpatch[_0x553d('0x25')](_0x11bc86,_0x4950e7,!![]);}catch(_0x4c5f0f){return BPromise[_0x553d('0x26')](_0x4c5f0f);}return _0x11bc86[_0x553d('0x27')]();};}function saveUpdates(_0x4d00e3,_0x5bbd2d){return function(_0x4a6e0e){if(_0x4a6e0e){return _0x4a6e0e['update'](_0x4d00e3)[_0x553d('0x28')](function(_0x53b217){return _0x53b217;});}return null;};}function removeEntity(_0x82dd3a,_0xacc984){return function(_0x2e4f1b){if(_0x2e4f1b){return _0x2e4f1b[_0x553d('0x29')]()[_0x553d('0x28')](function(){_0x82dd3a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2caed9,_0x491dc2){return function(_0x576c56){if(!_0x576c56){_0x2caed9[_0x553d('0x1b')](0x194);}return _0x576c56;};}function handleError(_0x517a1c,_0x677832){_0x677832=_0x677832||0x1f4;return function(_0x2c0484){logger[_0x553d('0x2a')](_0x2c0484['stack']);if(_0x2c0484[_0x553d('0x2b')]){delete _0x2c0484[_0x553d('0x2b')];}_0x517a1c[_0x553d('0x1c')](_0x677832)['send'](_0x2c0484);};}exports[_0x553d('0x2c')]=function(_0x39943d,_0x2bf05d){var _0x50fbc3={},_0x37ddd7={},_0x180a66={'count':0x0,'rows':[]};var _0xc3d157=_['map'](db[_0x553d('0x2d')]['rawAttributes'],function(_0x174fea){return{'name':_0x174fea[_0x553d('0x2e')],'type':_0x174fea[_0x553d('0x2f')][_0x553d('0x30')]};});_0x37ddd7[_0x553d('0x31')]=_[_0x553d('0x32')](_0xc3d157,_0x553d('0x2b'));_0x37ddd7[_0x553d('0x33')]=_['keys'](_0x39943d[_0x553d('0x33')]);_0x37ddd7[_0x553d('0x34')]=_[_0x553d('0x35')](_0x37ddd7[_0x553d('0x31')],_0x37ddd7[_0x553d('0x33')]);_0x50fbc3[_0x553d('0x36')]=_[_0x553d('0x35')](_0x37ddd7[_0x553d('0x31')],qs['fields'](_0x39943d[_0x553d('0x33')][_0x553d('0x37')]));_0x50fbc3[_0x553d('0x36')]=_0x50fbc3['attributes'][_0x553d('0x38')]?_0x50fbc3[_0x553d('0x36')]:_0x37ddd7[_0x553d('0x31')];if(!_0x39943d[_0x553d('0x33')][_0x553d('0x39')](_0x553d('0x3a'))){_0x50fbc3[_0x553d('0x1f')]=qs[_0x553d('0x1f')](_0x39943d['query']['limit']);_0x50fbc3[_0x553d('0x21')]=qs[_0x553d('0x21')](_0x39943d['query'][_0x553d('0x21')]);}_0x50fbc3['order']=qs['sort'](_0x39943d[_0x553d('0x33')]['sort']);_0x50fbc3[_0x553d('0x3b')]=qs['filters'](_[_0x553d('0x3c')](_0x39943d[_0x553d('0x33')],_0x37ddd7['filters']),_0xc3d157);if(_0x39943d['query'][_0x553d('0x3d')]){_0x50fbc3[_0x553d('0x3b')]=_[_0x553d('0x3e')](_0x50fbc3[_0x553d('0x3b')],{'$or':_['map'](_0xc3d157,function(_0x19ed0e){if(_0x19ed0e[_0x553d('0x2f')]!=='VIRTUAL'){var _0xfac8ee={};_0xfac8ee[_0x19ed0e['name']]={'$like':'%'+_0x39943d[_0x553d('0x33')][_0x553d('0x3d')]+'%'};return _0xfac8ee;}})});}_0x50fbc3=_[_0x553d('0x3e')]({},_0x50fbc3,_0x39943d[_0x553d('0x3f')]);var _0x50776a={'where':_0x50fbc3['where']};return db[_0x553d('0x2d')][_0x553d('0x22')](_0x50776a)[_0x553d('0x28')](function(_0x32dfb8){_0x180a66[_0x553d('0x22')]=_0x32dfb8;if(_0x39943d[_0x553d('0x33')][_0x553d('0x40')]){_0x50fbc3[_0x553d('0x41')]=[{'all':!![]}];}return db[_0x553d('0x2d')][_0x553d('0x42')](_0x50fbc3);})['then'](function(_0x431fdb){_0x180a66[_0x553d('0x43')]=_0x431fdb;return _0x180a66;})['then'](respondWithFilteredResult(_0x2bf05d,_0x50fbc3))[_0x553d('0x44')](handleError(_0x2bf05d,null));};exports[_0x553d('0x45')]=function(_0x5cfbbc,_0x1caab8){var _0x60cdd3={'raw':!![],'where':{'id':_0x5cfbbc[_0x553d('0x46')]['id']}},_0x40bc7a={};_0x40bc7a[_0x553d('0x31')]=_[_0x553d('0x47')](db['ZendeskField'][_0x553d('0x48')]);_0x40bc7a[_0x553d('0x33')]=_[_0x553d('0x47')](_0x5cfbbc['query']);_0x40bc7a[_0x553d('0x34')]=_[_0x553d('0x35')](_0x40bc7a['model'],_0x40bc7a[_0x553d('0x33')]);_0x60cdd3[_0x553d('0x36')]=_[_0x553d('0x35')](_0x40bc7a[_0x553d('0x31')],qs[_0x553d('0x37')](_0x5cfbbc[_0x553d('0x33')][_0x553d('0x37')]));_0x60cdd3[_0x553d('0x36')]=_0x60cdd3[_0x553d('0x36')]['length']?_0x60cdd3[_0x553d('0x36')]:_0x40bc7a['model'];if(_0x5cfbbc[_0x553d('0x33')]['includeAll']){_0x60cdd3[_0x553d('0x41')]=[{'all':!![]}];}_0x60cdd3=_[_0x553d('0x3e')]({},_0x60cdd3,_0x5cfbbc['options']);return db[_0x553d('0x2d')][_0x553d('0x49')](_0x60cdd3)[_0x553d('0x28')](handleEntityNotFound(_0x1caab8,null))[_0x553d('0x28')](respondWithResult(_0x1caab8,null))[_0x553d('0x44')](handleError(_0x1caab8,null));};exports['create']=function(_0x28a20b,_0x545dbf){return db[_0x553d('0x2d')][_0x553d('0x4a')](_0x28a20b[_0x553d('0x4b')],{})[_0x553d('0x28')](respondWithResult(_0x545dbf,0xc9))[_0x553d('0x44')](handleError(_0x545dbf,null));};exports[_0x553d('0x4c')]=function(_0xb6b182,_0x29259a){if(_0xb6b182[_0x553d('0x4b')]['id']){delete _0xb6b182[_0x553d('0x4b')]['id'];}return db[_0x553d('0x2d')][_0x553d('0x49')]({'where':{'id':_0xb6b182[_0x553d('0x46')]['id']}})[_0x553d('0x28')](handleEntityNotFound(_0x29259a,null))[_0x553d('0x28')](saveUpdates(_0xb6b182[_0x553d('0x4b')],null))[_0x553d('0x28')](respondWithResult(_0x29259a,null))['catch'](handleError(_0x29259a,null));};exports[_0x553d('0x29')]=function(_0x1ed718,_0x2e1ff6){return db[_0x553d('0x2d')]['find']({'where':{'id':_0x1ed718['params']['id']}})[_0x553d('0x28')](handleEntityNotFound(_0x2e1ff6,null))[_0x553d('0x28')](removeEntity(_0x2e1ff6,null))[_0x553d('0x44')](handleError(_0x2e1ff6,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index dc04a84..cd5ba70 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 _0x0432=['FieldId','lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports','zendesk_unique_index','idField'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x0432,0x140));var _0x2043=function(_0x58f4b5,_0x3c5720){_0x58f4b5=_0x58f4b5-0x0;var _0x2f35a4=_0x0432[_0x58f4b5];return _0x2f35a4;};'use strict';var _=require(_0x2043('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2043('0x1'));var moment=require(_0x2043('0x2'));var BPromise=require('bluebird');var rp=require(_0x2043('0x3'));var fs=require('fs');var path=require(_0x2043('0x4'));var rimraf=require(_0x2043('0x5'));var config=require(_0x2043('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x2043('0x7')]=function(_0x35063f,_0x1a87d4){return _0x35063f['define']('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x2043('0x8'),'fields':[_0x2043('0x9'),_0x2043('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x443b=['define','ZendeskField','int_zendesk_fields','idField','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports'];(function(_0x23a959,_0x5c39dd){var _0x2b73dd=function(_0x2ced19){while(--_0x2ced19){_0x23a959['push'](_0x23a959['shift']());}};_0x2b73dd(++_0x5c39dd);}(_0x443b,0x170));var _0xb443=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x443b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb443('0x0'));var util=require(_0xb443('0x1'));var logger=require(_0xb443('0x2'))('api');var moment=require(_0xb443('0x3'));var BPromise=require('bluebird');var rp=require(_0xb443('0x4'));var fs=require('fs');var path=require(_0xb443('0x5'));var rimraf=require(_0xb443('0x6'));var config=require(_0xb443('0x7'));var attributes=require(_0xb443('0x8'));module[_0xb443('0x9')]=function(_0x343367,_0x25e6b8){return _0x343367[_0xb443('0xa')](_0xb443('0xb'),attributes,{'tableName':_0xb443('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xb443('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index e5aa037..52b3052 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 _0x7339=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','result'];(function(_0x9030,_0x2bf8ca){var _0x3ea9d5=function(_0x307afd){while(--_0x307afd){_0x9030['push'](_0x9030['shift']());}};_0x3ea9d5(++_0x2bf8ca);}(_0x7339,0x141));var _0x9733=function(_0x3aaa7a,_0x48e4b0){_0x3aaa7a=_0x3aaa7a-0x0;var _0x41fb1f=_0x7339[_0x3aaa7a];return _0x41fb1f;};'use strict';var _=require(_0x9733('0x0'));var util=require(_0x9733('0x1'));var moment=require('moment');var BPromise=require(_0x9733('0x2'));var rs=require(_0x9733('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9733('0x4'))['db'];var utils=require(_0x9733('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9733('0x6'));var jayson=require(_0x9733('0x7'));var client=jayson[_0x9733('0x8')][_0x9733('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4727b3,_0x55a5fc,_0x4af304){return new BPromise(function(_0x553c5a,_0x1c80c3){return client['request'](_0x4727b3,_0x4af304)['then'](function(_0x205cd9){logger[_0x9733('0xa')]('ZendeskField,\x20%s,\x20%s',_0x55a5fc,_0x9733('0xb'));logger[_0x9733('0xc')](_0x9733('0xd'),_0x55a5fc,_0x9733('0xb'),JSON['stringify'](_0x205cd9));if(_0x205cd9['error']){if(_0x205cd9[_0x9733('0xe')][_0x9733('0xf')]===0x1f4){logger[_0x9733('0xe')](_0x9733('0x10'),_0x55a5fc,_0x205cd9[_0x9733('0xe')]['message']);return _0x1c80c3(_0x205cd9[_0x9733('0xe')][_0x9733('0x11')]);}logger[_0x9733('0xe')](_0x9733('0x10'),_0x55a5fc,_0x205cd9[_0x9733('0xe')][_0x9733('0x11')]);return _0x553c5a(_0x205cd9[_0x9733('0xe')][_0x9733('0x11')]);}else{logger[_0x9733('0xa')](_0x9733('0x10'),_0x55a5fc,_0x9733('0xb'));_0x553c5a(_0x205cd9[_0x9733('0x12')][_0x9733('0x11')]);}})[_0x9733('0x13')](function(_0x5d9718){logger[_0x9733('0xe')](_0x9733('0x10'),_0x55a5fc,_0x5d9718);_0x1c80c3(_0x5d9718);});});} \ No newline at end of file +var _0x6f20=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x6f20,0x76));var _0x06f2=function(_0x461886,_0x4fc171){_0x461886=_0x461886-0x0;var _0x295e0a=_0x6f20[_0x461886];return _0x295e0a;};'use strict';var _=require(_0x06f2('0x0'));var util=require(_0x06f2('0x1'));var moment=require(_0x06f2('0x2'));var BPromise=require('bluebird');var rs=require(_0x06f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x06f2('0x4'));var logger=require(_0x06f2('0x5'))('rpc');var config=require(_0x06f2('0x6'));var jayson=require(_0x06f2('0x7'));var client=jayson['client'][_0x06f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d3794,_0x1aa39f,_0x4a0021){return new BPromise(function(_0xb3fc17,_0x3c10e8){return client[_0x06f2('0x9')](_0x4d3794,_0x4a0021)[_0x06f2('0xa')](function(_0x27a1f8){logger[_0x06f2('0xb')](_0x06f2('0xc'),_0x1aa39f,_0x06f2('0xd'));logger[_0x06f2('0xe')](_0x06f2('0xf'),_0x1aa39f,_0x06f2('0xd'),JSON[_0x06f2('0x10')](_0x27a1f8));if(_0x27a1f8['error']){if(_0x27a1f8[_0x06f2('0x11')][_0x06f2('0x12')]===0x1f4){logger[_0x06f2('0x11')]('ZendeskField,\x20%s,\x20%s',_0x1aa39f,_0x27a1f8['error'][_0x06f2('0x13')]);return _0x3c10e8(_0x27a1f8[_0x06f2('0x11')][_0x06f2('0x13')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x1aa39f,_0x27a1f8[_0x06f2('0x11')][_0x06f2('0x13')]);return _0xb3fc17(_0x27a1f8[_0x06f2('0x11')]['message']);}else{logger[_0x06f2('0xb')](_0x06f2('0xc'),_0x1aa39f,_0x06f2('0xd'));_0xb3fc17(_0x27a1f8[_0x06f2('0x14')][_0x06f2('0x13')]);}})[_0x06f2('0x15')](function(_0xed33f1){logger[_0x06f2('0x11')]('ZendeskField,\x20%s,\x20%s',_0x1aa39f,_0xed33f1);_0x3c10e8(_0xed33f1);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 6eb7326..2beb2ce 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 _0x651c=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','getConfigurations','/:id/fields','create','addConfiguration','put','/:id','update','delete','destroy','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x651c,0x11e));var _0xc651=function(_0x50c492,_0x5c1e67){_0x50c492=_0x50c492-0x0;var _0x3505a8=_0x651c[_0x50c492];return _0x3505a8;};'use strict';var multer=require(_0xc651('0x0'));var util=require(_0xc651('0x1'));var path=require('path');var timeout=require(_0xc651('0x2'));var express=require(_0xc651('0x3'));var router=express[_0xc651('0x4')]();var fs_extra=require(_0xc651('0x5'));var auth=require(_0xc651('0x6'));var interaction=require(_0xc651('0x7'));var config=require(_0xc651('0x8'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xc651('0x9')](),controller[_0xc651('0xa')]);router[_0xc651('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0xc651('0xc')]);router[_0xc651('0xb')](_0xc651('0xd'),auth[_0xc651('0x9')](),controller['getFields']);router['post']('/',auth[_0xc651('0x9')](),controller[_0xc651('0xe')]);router['post']('/:id/configurations',auth[_0xc651('0x9')](),controller[_0xc651('0xf')]);router[_0xc651('0x10')](_0xc651('0x11'),auth[_0xc651('0x9')](),controller[_0xc651('0x12')]);router[_0xc651('0x13')](_0xc651('0x11'),auth[_0xc651('0x9')](),controller[_0xc651('0x14')]);module[_0xc651('0x15')]=router; \ No newline at end of file +var _0xaefa=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','delete','destroy'];(function(_0x46d652,_0x409dfc){var _0x253db0=function(_0x2c53d3){while(--_0x2c53d3){_0x46d652['push'](_0x46d652['shift']());}};_0x253db0(++_0x409dfc);}(_0xaefa,0x12b));var _0xaaef=function(_0x1134ab,_0x1550ad){_0x1134ab=_0x1134ab-0x0;var _0xa387f=_0xaefa[_0x1134ab];return _0xa387f;};'use strict';var multer=require(_0xaaef('0x0'));var util=require(_0xaaef('0x1'));var path=require(_0xaaef('0x2'));var timeout=require(_0xaaef('0x3'));var express=require(_0xaaef('0x4'));var router=express[_0xaaef('0x5')]();var fs_extra=require(_0xaaef('0x6'));var auth=require(_0xaaef('0x7'));var interaction=require(_0xaaef('0x8'));var config=require('../../config/environment');var controller=require(_0xaaef('0x9'));router[_0xaaef('0xa')]('/',auth[_0xaaef('0xb')](),controller[_0xaaef('0xc')]);router['get'](_0xaaef('0xd'),auth[_0xaaef('0xb')](),controller[_0xaaef('0xe')]);router['get'](_0xaaef('0xf'),auth['isAuthenticated'](),controller[_0xaaef('0x10')]);router[_0xaaef('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaaef('0x11')]);router[_0xaaef('0x12')]('/',auth[_0xaaef('0xb')](),controller[_0xaaef('0x13')]);router['post'](_0xaaef('0xf'),auth[_0xaaef('0xb')](),controller[_0xaaef('0x14')]);router['put'](_0xaaef('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaaef('0x15')](_0xaaef('0xd'),auth[_0xaaef('0xb')](),controller[_0xaaef('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 9ddd28c..5e62d97 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 _0x41bb=['exports','STRING','sequelize'];(function(_0x19e57f,_0x4ae750){var _0x469556=function(_0xf6968b){while(--_0xf6968b){_0x19e57f['push'](_0x19e57f['shift']());}};_0x469556(++_0x4ae750);}(_0x41bb,0xc5));var _0xb41b=function(_0x101038,_0x353c1a){_0x101038=_0x101038-0x0;var _0x1d2641=_0x41bb[_0x101038];return _0x1d2641;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file +var _0xbec5=['STRING','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbec5,0xe5));var _0x5bec=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0xbec5[_0x13137e];return _0x346261;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bec('0x2')]},'host':{'type':Sequelize[_0x5bec('0x2')]},'zone':{'type':Sequelize[_0x5bec('0x2')]},'clientId':{'type':Sequelize[_0x5bec('0x2')]},'clientSecret':{'type':Sequelize[_0x5bec('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x5bec('0x2')]},'refreshToken':{'type':Sequelize[_0x5bec('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 2d2fbb0..2f251a5 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 _0x3ca5=['getConfigurations','findOne','ZohoConfiguration','addConfiguration','body','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Call_Result','remove','includes','api_name','push','display_label','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','keys','includeAll','options','find','create','catch'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3ca5,0x1c3));var _0x53ca=function(_0x2d2e7a,_0x30bffc){_0x2d2e7a=_0x2d2e7a-0x0;var _0x30b94a=_0x3ca5[_0x2d2e7a];return _0x30b94a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53ca('0x0'));var zipdir=require(_0x53ca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53ca('0x2'));var moment=require(_0x53ca('0x3'));var BPromise=require(_0x53ca('0x4'));var Mustache=require('mustache');var util=require(_0x53ca('0x5'));var path=require(_0x53ca('0x6'));var sox=require(_0x53ca('0x7'));var csv=require(_0x53ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x53ca('0x9'));var _=require('lodash');var squel=require(_0x53ca('0xa'));var crypto=require(_0x53ca('0xb'));var jsforce=require(_0x53ca('0xc'));var deskjs=require(_0x53ca('0xd'));var toCsv=require('to-csv');var querystring=require(_0x53ca('0xe'));var Papa=require(_0x53ca('0xf'));var Redis=require(_0x53ca('0x10'));var authService=require(_0x53ca('0x11'));var qs=require(_0x53ca('0x12'));var as=require(_0x53ca('0x13'));var hardwareService=require(_0x53ca('0x14'));var logger=require(_0x53ca('0x15'))(_0x53ca('0x16'));var utils=require(_0x53ca('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x53ca('0x18'));function respondWithStatusCode(_0x4d015a,_0x1c84f7){_0x1c84f7=_0x1c84f7||0xcc;return function(_0xeb279b){if(_0xeb279b){return _0x4d015a[_0x53ca('0x19')](_0x1c84f7);}return _0x4d015a[_0x53ca('0x1a')](_0x1c84f7)[_0x53ca('0x1b')]();};}function respondWithResult(_0x1b9e36,_0x13c4a1){_0x13c4a1=_0x13c4a1||0xc8;return function(_0x26204b){if(_0x26204b){return _0x1b9e36[_0x53ca('0x1a')](_0x13c4a1)[_0x53ca('0x1c')](_0x26204b);}};}function respondWithFilteredResult(_0x5afb9c,_0xf0db44){return function(_0x4582c2){if(_0x4582c2){var _0x50c35e=typeof _0xf0db44[_0x53ca('0x1d')]===_0x53ca('0x1e')&&typeof _0xf0db44[_0x53ca('0x1f')]==='undefined';var _0x497996=_0x4582c2[_0x53ca('0x20')];var _0x2758ff=_0x50c35e?0x0:_0xf0db44[_0x53ca('0x1d')];var _0x173843=_0x50c35e?_0x4582c2['count']:_0xf0db44[_0x53ca('0x1d')]+_0xf0db44[_0x53ca('0x1f')];var _0x2b4005;if(_0x173843>=_0x497996){_0x173843=_0x497996;_0x2b4005=0xc8;}else{_0x2b4005=0xce;}_0x5afb9c[_0x53ca('0x1a')](_0x2b4005);return _0x5afb9c['set']('Content-Range',_0x2758ff+'-'+_0x173843+'/'+_0x497996)[_0x53ca('0x1c')](_0x4582c2);}return null;};}function patchUpdates(_0x5d27d9){return function(_0x198eec){try{jsonpatch[_0x53ca('0x21')](_0x198eec,_0x5d27d9,!![]);}catch(_0x1c6c08){return BPromise[_0x53ca('0x22')](_0x1c6c08);}return _0x198eec[_0x53ca('0x23')]();};}function saveUpdates(_0x607a0a,_0x476519){return function(_0x182922){if(_0x182922){return _0x182922[_0x53ca('0x24')](_0x607a0a)[_0x53ca('0x25')](function(_0x247b21){return _0x247b21;});}return null;};}function removeEntity(_0x134d53,_0x28dd5e){return function(_0x78bd6d){if(_0x78bd6d){return _0x78bd6d[_0x53ca('0x26')]()['then'](function(){_0x134d53['status'](0xcc)[_0x53ca('0x1b')]();});}};}function handleEntityNotFound(_0x4fe4d9,_0x5f1190){return function(_0x4c75d9){if(!_0x4c75d9){_0x4fe4d9['sendStatus'](0x194);}return _0x4c75d9;};}function handleError(_0x3de287,_0x230fe3){_0x230fe3=_0x230fe3||0x1f4;return function(_0x48df20){logger[_0x53ca('0x27')](_0x48df20[_0x53ca('0x28')]);if(_0x48df20[_0x53ca('0x29')]){delete _0x48df20[_0x53ca('0x29')];}_0x3de287['status'](_0x230fe3)[_0x53ca('0x2a')](_0x48df20);};}exports[_0x53ca('0x2b')]=function(_0x3a402e,_0x1671ca){var _0x384b00={},_0x4e564c={},_0x2efdfc={'count':0x0,'rows':[]};var _0x362459=_[_0x53ca('0x2c')](db[_0x53ca('0x2d')][_0x53ca('0x2e')],function(_0x1e7d54){return{'name':_0x1e7d54[_0x53ca('0x2f')],'type':_0x1e7d54[_0x53ca('0x30')][_0x53ca('0x31')]};});_0x4e564c['model']=_['map'](_0x362459,_0x53ca('0x29'));_0x4e564c[_0x53ca('0x32')]=_['keys'](_0x3a402e[_0x53ca('0x32')]);_0x4e564c['filters']=_[_0x53ca('0x33')](_0x4e564c['model'],_0x4e564c[_0x53ca('0x32')]);_0x384b00[_0x53ca('0x34')]=_[_0x53ca('0x33')](_0x4e564c[_0x53ca('0x35')],qs[_0x53ca('0x36')](_0x3a402e[_0x53ca('0x32')]['fields']));_0x384b00[_0x53ca('0x34')]=_0x384b00[_0x53ca('0x34')][_0x53ca('0x37')]?_0x384b00[_0x53ca('0x34')]:_0x4e564c[_0x53ca('0x35')];if(!_0x3a402e['query'][_0x53ca('0x38')](_0x53ca('0x39'))){_0x384b00[_0x53ca('0x1f')]=qs[_0x53ca('0x1f')](_0x3a402e[_0x53ca('0x32')][_0x53ca('0x1f')]);_0x384b00[_0x53ca('0x1d')]=qs[_0x53ca('0x1d')](_0x3a402e[_0x53ca('0x32')][_0x53ca('0x1d')]);}_0x384b00[_0x53ca('0x3a')]=qs[_0x53ca('0x3b')](_0x3a402e[_0x53ca('0x32')][_0x53ca('0x3b')]);_0x384b00[_0x53ca('0x3c')]=qs[_0x53ca('0x3d')](_[_0x53ca('0x3e')](_0x3a402e[_0x53ca('0x32')],_0x4e564c[_0x53ca('0x3d')]),_0x362459);if(_0x3a402e[_0x53ca('0x32')][_0x53ca('0x3f')]){_0x384b00[_0x53ca('0x3c')]=_[_0x53ca('0x40')](_0x384b00['where'],{'$or':_[_0x53ca('0x2c')](_0x362459,function(_0x20cda9){if(_0x20cda9[_0x53ca('0x30')]!==_0x53ca('0x41')){var _0x12c7cb={};_0x12c7cb[_0x20cda9[_0x53ca('0x29')]]={'$like':'%'+_0x3a402e[_0x53ca('0x32')]['filter']+'%'};return _0x12c7cb;}})});}_0x384b00=_[_0x53ca('0x40')]({},_0x384b00,_0x3a402e['options']);var _0xd762d2={'where':_0x384b00['where']};return db[_0x53ca('0x2d')]['count'](_0xd762d2)[_0x53ca('0x25')](function(_0x48da6d){_0x2efdfc[_0x53ca('0x20')]=_0x48da6d;if(_0x3a402e[_0x53ca('0x32')]['includeAll']){_0x384b00[_0x53ca('0x42')]=[{'all':!![]}];}return db[_0x53ca('0x2d')][_0x53ca('0x43')](_0x384b00);})['then'](function(_0x33d2c7){_0x2efdfc[_0x53ca('0x44')]=_0x33d2c7;return _0x2efdfc;})[_0x53ca('0x25')](respondWithFilteredResult(_0x1671ca,_0x384b00))['catch'](handleError(_0x1671ca,null));};exports[_0x53ca('0x45')]=function(_0x39ef05,_0x21e941){var _0x44bbfd={'raw':![],'where':{'id':_0x39ef05[_0x53ca('0x46')]['id']}},_0x5719f4={};_0x5719f4[_0x53ca('0x35')]=_['keys'](db[_0x53ca('0x2d')][_0x53ca('0x2e')]);_0x5719f4['query']=_[_0x53ca('0x47')](_0x39ef05[_0x53ca('0x32')]);_0x5719f4[_0x53ca('0x3d')]=_[_0x53ca('0x33')](_0x5719f4[_0x53ca('0x35')],_0x5719f4[_0x53ca('0x32')]);_0x44bbfd['attributes']=_[_0x53ca('0x33')](_0x5719f4[_0x53ca('0x35')],qs['fields'](_0x39ef05[_0x53ca('0x32')][_0x53ca('0x36')]));_0x44bbfd[_0x53ca('0x34')]=_0x44bbfd['attributes'][_0x53ca('0x37')]?_0x44bbfd['attributes']:_0x5719f4[_0x53ca('0x35')];if(_0x39ef05['query'][_0x53ca('0x48')]){_0x44bbfd['include']=[{'all':!![]}];}_0x44bbfd=_[_0x53ca('0x40')]({},_0x44bbfd,_0x39ef05[_0x53ca('0x49')]);return db['ZohoAccount'][_0x53ca('0x4a')](_0x44bbfd)[_0x53ca('0x25')](handleEntityNotFound(_0x21e941,null))[_0x53ca('0x25')](respondWithResult(_0x21e941,null))['catch'](handleError(_0x21e941,null));};exports[_0x53ca('0x4b')]=function(_0x1322b2,_0xd91fa1){return db[_0x53ca('0x2d')][_0x53ca('0x4b')](_0x1322b2['body'],{})['then'](respondWithResult(_0xd91fa1,0xc9))[_0x53ca('0x4c')](handleError(_0xd91fa1,null));};exports[_0x53ca('0x24')]=function(_0x2ba762,_0x6cf2b3){if(_0x2ba762['body']['id']){delete _0x2ba762['body']['id'];}return db[_0x53ca('0x2d')][_0x53ca('0x4a')]({'where':{'id':_0x2ba762[_0x53ca('0x46')]['id']}})[_0x53ca('0x25')](handleEntityNotFound(_0x6cf2b3,null))[_0x53ca('0x25')](saveUpdates(_0x2ba762['body'],null))[_0x53ca('0x25')](respondWithResult(_0x6cf2b3,null))['catch'](handleError(_0x6cf2b3,null));};exports[_0x53ca('0x26')]=function(_0x5a4f00,_0x41351f){return db[_0x53ca('0x2d')][_0x53ca('0x4a')]({'where':{'id':_0x5a4f00['params']['id']}})['then'](handleEntityNotFound(_0x41351f,null))['then'](removeEntity(_0x41351f,null))[_0x53ca('0x4c')](handleError(_0x41351f,null));};exports[_0x53ca('0x4d')]=function(_0x19e542,_0xec2e40,_0x449d05){var _0x481fc5={};var _0x12061e={};var _0x1c8e70;var _0x3bf869;return db[_0x53ca('0x2d')][_0x53ca('0x4e')]({'where':{'id':_0x19e542['params']['id']}})['then'](handleEntityNotFound(_0xec2e40,null))[_0x53ca('0x25')](function(_0x3fb41d){if(_0x3fb41d){_0x1c8e70=_0x3fb41d;_0x12061e[_0x53ca('0x35')]=_[_0x53ca('0x47')](db[_0x53ca('0x4f')][_0x53ca('0x2e')]);_0x12061e[_0x53ca('0x32')]=_[_0x53ca('0x47')](_0x19e542[_0x53ca('0x32')]);_0x12061e[_0x53ca('0x3d')]=_['intersection'](_0x12061e[_0x53ca('0x35')],_0x12061e[_0x53ca('0x32')]);_0x481fc5[_0x53ca('0x34')]=_[_0x53ca('0x33')](_0x12061e['model'],qs[_0x53ca('0x36')](_0x19e542['query'][_0x53ca('0x36')]));_0x481fc5[_0x53ca('0x34')]=_0x481fc5[_0x53ca('0x34')][_0x53ca('0x37')]?_0x481fc5[_0x53ca('0x34')]:_0x12061e[_0x53ca('0x35')];_0x481fc5[_0x53ca('0x3a')]=qs[_0x53ca('0x3b')](_0x19e542[_0x53ca('0x32')][_0x53ca('0x3b')]);_0x481fc5['where']=qs[_0x53ca('0x3d')](_['pick'](_0x19e542[_0x53ca('0x32')],_0x12061e['filters']));if(_0x19e542['query'][_0x53ca('0x3f')]){_0x481fc5['where']=_[_0x53ca('0x40')](_0x481fc5[_0x53ca('0x3c')],{'$or':_[_0x53ca('0x2c')](_0x481fc5[_0x53ca('0x34')],function(_0x204ce9){var _0x1a8623={};_0x1a8623[_0x204ce9]={'$like':'%'+_0x19e542[_0x53ca('0x32')][_0x53ca('0x3f')]+'%'};return _0x1a8623;})});}_0x481fc5=_[_0x53ca('0x40')]({},_0x481fc5,_0x19e542['options']);return _0x1c8e70['getConfigurations'](_0x481fc5);}})[_0x53ca('0x25')](function(_0x117534){if(_0x117534){_0x3bf869=_0x117534[_0x53ca('0x37')];if(!_0x19e542[_0x53ca('0x32')][_0x53ca('0x38')](_0x53ca('0x39'))){_0x481fc5[_0x53ca('0x1f')]=qs[_0x53ca('0x1f')](_0x19e542[_0x53ca('0x32')]['limit']);_0x481fc5[_0x53ca('0x1d')]=qs[_0x53ca('0x1d')](_0x19e542[_0x53ca('0x32')]['offset']);}return _0x1c8e70[_0x53ca('0x4d')](_0x481fc5);}})[_0x53ca('0x25')](function(_0x4d8064){if(_0x4d8064){return _0x4d8064?{'count':_0x3bf869,'rows':_0x4d8064}:null;}})[_0x53ca('0x25')](respondWithResult(_0xec2e40,null))[_0x53ca('0x4c')](handleError(_0xec2e40,null));};exports[_0x53ca('0x50')]=function(_0x544dd4,_0x5c6ff5,_0x36907e){if(_0x544dd4[_0x53ca('0x51')]['id']){delete _0x544dd4[_0x53ca('0x51')]['id'];}return db[_0x53ca('0x2d')][_0x53ca('0x4e')]({'where':{'id':_0x544dd4[_0x53ca('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c6ff5,null))[_0x53ca('0x25')](function(_0x4c9f3a){if(_0x4c9f3a){_0x544dd4[_0x53ca('0x51')][_0x53ca('0x52')]=_0x4c9f3a['id'];_0x544dd4[_0x53ca('0x51')][_0x53ca('0x53')]=integrations[_0x53ca('0x54')](_0x544dd4['body'][_0x53ca('0x55')],_0x544dd4['body'][_0x53ca('0x30')]);_0x544dd4[_0x53ca('0x51')][_0x53ca('0x56')]=integrations[_0x53ca('0x57')](_0x544dd4[_0x53ca('0x51')][_0x53ca('0x55')],_0x544dd4['body']['type']);return db[_0x53ca('0x4f')][_0x53ca('0x4b')](_0x544dd4['body'],{'include':[{'model':db[_0x53ca('0x58')],'as':_0x53ca('0x53')},{'model':db[_0x53ca('0x58')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5c6ff5,null))[_0x53ca('0x4c')](handleError(_0x5c6ff5,null));};function getAccessToken(_0x3c02f1){return new Promise(function(_0x5945b6,_0x31851f){var _0x25f1d0;switch(_0x3c02f1['zone']){case'US':_0x25f1d0=_0x53ca('0x59');break;case'AU':_0x25f1d0=_0x53ca('0x5a');break;case'EU':_0x25f1d0=_0x53ca('0x5b');break;case'IN':_0x25f1d0=_0x53ca('0x5c');break;case'CN':_0x25f1d0=_0x53ca('0x5d');break;default:_0x25f1d0=_0x53ca('0x5b');break;}var _0x500889={'method':_0x53ca('0x5e'),'uri':_0x25f1d0+_0x53ca('0x5f'),'qs':{'refresh_token':_0x3c02f1[_0x53ca('0x60')],'client_id':_0x3c02f1[_0x53ca('0x61')],'client_secret':_0x3c02f1[_0x53ca('0x62')],'grant_type':_0x53ca('0x63')},'json':!![]};return rp(_0x500889)['then'](function(_0x552480){if(_0x552480['access_token']){_0x5945b6(_0x552480['access_token']);}else{_0x31851f(_0x53ca('0x64'));}})[_0x53ca('0x4c')](function(_0x548e0e){_0x31851f(_0x548e0e);});});}exports[_0x53ca('0x65')]=function(_0x2e8377,_0xaa6867,_0x19242c){var _0x3fdd72,_0x224570,_0x30bd4d,_0x3b6fe3,_0x4dae33;return db[_0x53ca('0x2d')][_0x53ca('0x4e')]({'where':{'id':_0x2e8377[_0x53ca('0x46')]['id']},'attributes':['id',_0x53ca('0x66'),_0x53ca('0x67'),_0x53ca('0x61'),'clientSecret',_0x53ca('0x68'),_0x53ca('0x69'),_0x53ca('0x60')]})[_0x53ca('0x25')](handleEntityNotFound(_0xaa6867,null))[_0x53ca('0x25')](function(_0x356287){_0x4dae33=_0x356287;_0x3fdd72=_0x4dae33[_0x53ca('0x66')];_0x224570=_0x3fdd72===_0x53ca('0x6a')?'eu':_0x53ca('0x6b');_0x30bd4d=_0x4dae33[_0x53ca('0x68')];var _0x4d33d7=_0x30bd4d['slice'](-0x1);if(_0x4d33d7==='/'||_0x4d33d7==='\x5c'||_0x4d33d7===':'){_0x30bd4d=_0x30bd4d[_0x53ca('0x6c')](0x0,_0x30bd4d[_0x53ca('0x6d')](_0x4d33d7));}if(!_0x4dae33['refreshToken']){throw new Error(_0x53ca('0x6e'));}return getAccessToken(_0x4dae33);})[_0x53ca('0x25')](function(_0x13555e){if(_0x13555e){return rp({'method':_0x53ca('0x6f'),'uri':util[_0x53ca('0x70')](_0x53ca('0x71'),_0x224570),'qs':{'module':_0x53ca('0x72')},'headers':{'Authorization':_0x53ca('0x73')+_0x13555e},'json':!![]});}})[_0x53ca('0x25')](function(_0x20c9db){if(_0x20c9db){if(_0x20c9db['response']&&_0x20c9db[_0x53ca('0x74')][_0x53ca('0x27')]){throw new Error(_0x20c9db['response']['error'][_0x53ca('0x75')]);}var _0x93f5d0=[];var _0x2f83a4=[];var _0x33b51f=[_0x53ca('0x76'),'Subject','Description','WhoId','Call_Duration',_0x53ca('0x77'),'Call_Start_Time','Call_Type'];_0x2f83a4=_[_0x53ca('0x78')](_0x20c9db[_0x53ca('0x36')],function(_0x56fecd){return _0x33b51f[_0x53ca('0x79')](_0x56fecd[_0x53ca('0x7a')]);});for(var _0x473491=0x0;_0x473491<_0x2f83a4['length'];_0x473491++){if(_0x2f83a4[_0x473491]['system_mandatory']===![]){_0x93f5d0[_0x53ca('0x7b')]({'id':_0x2f83a4[_0x473491]['id'],'name':_0x2f83a4[_0x473491][_0x53ca('0x7c')],'custom':_0x2f83a4[_0x473491]['custom_field'],'options':_0x2f83a4[_0x473491][_0x53ca('0x7d')]===_0x53ca('0x7e')&&_0x2f83a4[_0x473491][_0x53ca('0x7f')][_0x53ca('0x37')]>-0x1?_[_0x53ca('0x2c')](_0x2f83a4[_0x473491][_0x53ca('0x7f')],function(_0x38614d){return{'name':_0x38614d,'value':_0x38614d};}):[]});}}return{'count':_0x93f5d0[_0x53ca('0x37')],'rows':_0x93f5d0};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xaa6867,null))['catch'](function(_0x111f82){var _0x16d162=_0x2e8377[_0x53ca('0x32')][_0x53ca('0x80')]?0x1f4:_0x111f82['statusCode']||0x1f4;logger[_0x53ca('0x27')](_0x53ca('0x81'),_0x53ca('0x65'),_0x16d162,JSON['stringify'](_0x111f82));delete _0x111f82[_0x53ca('0x29')];if(_0x16d162===0x191){_0x16d162=0x190;}_0xaa6867['status'](_0x16d162)['send'](_0x2e8377[_0x53ca('0x32')][_0x53ca('0x80')]?{'message':_0x53ca('0x82'),'statusCode':_0x111f82[_0x53ca('0x83')]}:_0x111f82);});}; \ No newline at end of file +var _0x15b8=['attributes','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','length','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0x2c45a5,_0x5ef843){var _0x291748=function(_0x5e80f3){while(--_0x5e80f3){_0x2c45a5['push'](_0x2c45a5['shift']());}};_0x291748(++_0x5ef843);}(_0x15b8,0xcd));var _0x815b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x15b8[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x815b('0x0'));var zipdir=require(_0x815b('0x1'));var jsonpatch=require(_0x815b('0x2'));var rp=require(_0x815b('0x3'));var moment=require(_0x815b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x815b('0x5'));var util=require(_0x815b('0x6'));var path=require(_0x815b('0x7'));var sox=require(_0x815b('0x8'));var csv=require(_0x815b('0x9'));var ejs=require(_0x815b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x815b('0xb'));var squel=require(_0x815b('0xc'));var crypto=require(_0x815b('0xd'));var jsforce=require(_0x815b('0xe'));var deskjs=require(_0x815b('0xf'));var toCsv=require(_0x815b('0x9'));var querystring=require(_0x815b('0x10'));var Papa=require(_0x815b('0x11'));var Redis=require(_0x815b('0x12'));var authService=require(_0x815b('0x13'));var qs=require(_0x815b('0x14'));var as=require(_0x815b('0x15'));var hardwareService=require(_0x815b('0x16'));var logger=require(_0x815b('0x17'))(_0x815b('0x18'));var utils=require(_0x815b('0x19'));var config=require(_0x815b('0x1a'));var licenseUtil=require(_0x815b('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1ca5d5,_0x1d25ab){_0x1d25ab=_0x1d25ab||0xcc;return function(_0x512bc8){if(_0x512bc8){return _0x1ca5d5['sendStatus'](_0x1d25ab);}return _0x1ca5d5['status'](_0x1d25ab)[_0x815b('0x1c')]();};}function respondWithResult(_0x5c89eb,_0x5814ee){_0x5814ee=_0x5814ee||0xc8;return function(_0x3dbba1){if(_0x3dbba1){return _0x5c89eb[_0x815b('0x1d')](_0x5814ee)[_0x815b('0x1e')](_0x3dbba1);}};}function respondWithFilteredResult(_0x59ea04,_0x495431){return function(_0x14f14f){if(_0x14f14f){var _0xf2d146=typeof _0x495431[_0x815b('0x1f')]===_0x815b('0x20')&&typeof _0x495431[_0x815b('0x21')]===_0x815b('0x20');var _0x58c4c7=_0x14f14f[_0x815b('0x22')];var _0x26a8a3=_0xf2d146?0x0:_0x495431[_0x815b('0x1f')];var _0x2ade43=_0xf2d146?_0x14f14f[_0x815b('0x22')]:_0x495431[_0x815b('0x1f')]+_0x495431['limit'];var _0x4313a9;if(_0x2ade43>=_0x58c4c7){_0x2ade43=_0x58c4c7;_0x4313a9=0xc8;}else{_0x4313a9=0xce;}_0x59ea04[_0x815b('0x1d')](_0x4313a9);return _0x59ea04[_0x815b('0x23')](_0x815b('0x24'),_0x26a8a3+'-'+_0x2ade43+'/'+_0x58c4c7)[_0x815b('0x1e')](_0x14f14f);}return null;};}function patchUpdates(_0x4acb47){return function(_0x431705){try{jsonpatch[_0x815b('0x25')](_0x431705,_0x4acb47,!![]);}catch(_0x134b42){return BPromise['reject'](_0x134b42);}return _0x431705['save']();};}function saveUpdates(_0x3ffdb7,_0x2923ed){return function(_0x30208e){if(_0x30208e){return _0x30208e[_0x815b('0x26')](_0x3ffdb7)[_0x815b('0x27')](function(_0x31ab20){return _0x31ab20;});}return null;};}function removeEntity(_0x11f1c1,_0x480c89){return function(_0x4a2431){if(_0x4a2431){return _0x4a2431[_0x815b('0x28')]()[_0x815b('0x27')](function(){_0x11f1c1[_0x815b('0x1d')](0xcc)[_0x815b('0x1c')]();});}};}function handleEntityNotFound(_0x1486c6,_0x3115c7){return function(_0x37d3a1){if(!_0x37d3a1){_0x1486c6[_0x815b('0x29')](0x194);}return _0x37d3a1;};}function handleError(_0x57345c,_0x27b4e1){_0x27b4e1=_0x27b4e1||0x1f4;return function(_0x39a5fa){logger[_0x815b('0x2a')](_0x39a5fa['stack']);if(_0x39a5fa[_0x815b('0x2b')]){delete _0x39a5fa[_0x815b('0x2b')];}_0x57345c['status'](_0x27b4e1)[_0x815b('0x2c')](_0x39a5fa);};}exports[_0x815b('0x2d')]=function(_0x1b1b13,_0x3b76d4){var _0xb04f={},_0x1bc921={},_0x3ba4d4={'count':0x0,'rows':[]};var _0x2c12c3=_[_0x815b('0x2e')](db[_0x815b('0x2f')]['rawAttributes'],function(_0x1ed8f1){return{'name':_0x1ed8f1[_0x815b('0x30')],'type':_0x1ed8f1[_0x815b('0x31')][_0x815b('0x32')]};});_0x1bc921[_0x815b('0x33')]=_[_0x815b('0x2e')](_0x2c12c3,'name');_0x1bc921[_0x815b('0x34')]=_[_0x815b('0x35')](_0x1b1b13[_0x815b('0x34')]);_0x1bc921[_0x815b('0x36')]=_[_0x815b('0x37')](_0x1bc921['model'],_0x1bc921[_0x815b('0x34')]);_0xb04f['attributes']=_[_0x815b('0x37')](_0x1bc921[_0x815b('0x33')],qs[_0x815b('0x38')](_0x1b1b13['query'][_0x815b('0x38')]));_0xb04f['attributes']=_0xb04f['attributes']['length']?_0xb04f[_0x815b('0x39')]:_0x1bc921['model'];if(!_0x1b1b13[_0x815b('0x34')]['hasOwnProperty'](_0x815b('0x3a'))){_0xb04f[_0x815b('0x21')]=qs['limit'](_0x1b1b13[_0x815b('0x34')]['limit']);_0xb04f['offset']=qs[_0x815b('0x1f')](_0x1b1b13[_0x815b('0x34')][_0x815b('0x1f')]);}_0xb04f['order']=qs[_0x815b('0x3b')](_0x1b1b13[_0x815b('0x34')][_0x815b('0x3b')]);_0xb04f['where']=qs[_0x815b('0x36')](_[_0x815b('0x3c')](_0x1b1b13[_0x815b('0x34')],_0x1bc921['filters']),_0x2c12c3);if(_0x1b1b13[_0x815b('0x34')][_0x815b('0x3d')]){_0xb04f[_0x815b('0x3e')]=_[_0x815b('0x3f')](_0xb04f[_0x815b('0x3e')],{'$or':_['map'](_0x2c12c3,function(_0x5a1b3d){if(_0x5a1b3d[_0x815b('0x31')]!=='VIRTUAL'){var _0x5e4519={};_0x5e4519[_0x5a1b3d[_0x815b('0x2b')]]={'$like':'%'+_0x1b1b13[_0x815b('0x34')]['filter']+'%'};return _0x5e4519;}})});}_0xb04f=_[_0x815b('0x3f')]({},_0xb04f,_0x1b1b13[_0x815b('0x40')]);var _0x3cf5ce={'where':_0xb04f[_0x815b('0x3e')]};return db[_0x815b('0x2f')][_0x815b('0x22')](_0x3cf5ce)[_0x815b('0x27')](function(_0x5de7e1){_0x3ba4d4[_0x815b('0x22')]=_0x5de7e1;if(_0x1b1b13[_0x815b('0x34')][_0x815b('0x41')]){_0xb04f[_0x815b('0x42')]=[{'all':!![]}];}return db[_0x815b('0x2f')][_0x815b('0x43')](_0xb04f);})['then'](function(_0x1c9ae7){_0x3ba4d4[_0x815b('0x44')]=_0x1c9ae7;return _0x3ba4d4;})[_0x815b('0x27')](respondWithFilteredResult(_0x3b76d4,_0xb04f))[_0x815b('0x45')](handleError(_0x3b76d4,null));};exports[_0x815b('0x46')]=function(_0x496eb5,_0x390e83){var _0x44a8a7={'raw':![],'where':{'id':_0x496eb5[_0x815b('0x47')]['id']}},_0x26630d={};_0x26630d[_0x815b('0x33')]=_['keys'](db[_0x815b('0x2f')][_0x815b('0x48')]);_0x26630d[_0x815b('0x34')]=_[_0x815b('0x35')](_0x496eb5[_0x815b('0x34')]);_0x26630d[_0x815b('0x36')]=_[_0x815b('0x37')](_0x26630d['model'],_0x26630d[_0x815b('0x34')]);_0x44a8a7['attributes']=_[_0x815b('0x37')](_0x26630d[_0x815b('0x33')],qs[_0x815b('0x38')](_0x496eb5[_0x815b('0x34')][_0x815b('0x38')]));_0x44a8a7[_0x815b('0x39')]=_0x44a8a7[_0x815b('0x39')]['length']?_0x44a8a7[_0x815b('0x39')]:_0x26630d[_0x815b('0x33')];if(_0x496eb5['query'][_0x815b('0x41')]){_0x44a8a7[_0x815b('0x42')]=[{'all':!![]}];}_0x44a8a7=_[_0x815b('0x3f')]({},_0x44a8a7,_0x496eb5[_0x815b('0x40')]);return db[_0x815b('0x2f')][_0x815b('0x49')](_0x44a8a7)[_0x815b('0x27')](handleEntityNotFound(_0x390e83,null))[_0x815b('0x27')](respondWithResult(_0x390e83,null))['catch'](handleError(_0x390e83,null));};exports[_0x815b('0x4a')]=function(_0xc1e0a,_0x164a17){return db[_0x815b('0x2f')]['create'](_0xc1e0a[_0x815b('0x4b')],{})[_0x815b('0x27')](respondWithResult(_0x164a17,0xc9))[_0x815b('0x45')](handleError(_0x164a17,null));};exports[_0x815b('0x26')]=function(_0x1fd570,_0x10dc8d){if(_0x1fd570['body']['id']){delete _0x1fd570[_0x815b('0x4b')]['id'];}return db[_0x815b('0x2f')][_0x815b('0x49')]({'where':{'id':_0x1fd570['params']['id']}})['then'](handleEntityNotFound(_0x10dc8d,null))['then'](saveUpdates(_0x1fd570['body'],null))[_0x815b('0x27')](respondWithResult(_0x10dc8d,null))['catch'](handleError(_0x10dc8d,null));};exports[_0x815b('0x28')]=function(_0x8bf43f,_0x4c543c){return db[_0x815b('0x2f')][_0x815b('0x49')]({'where':{'id':_0x8bf43f[_0x815b('0x47')]['id']}})[_0x815b('0x27')](handleEntityNotFound(_0x4c543c,null))[_0x815b('0x27')](removeEntity(_0x4c543c,null))[_0x815b('0x45')](handleError(_0x4c543c,null));};exports[_0x815b('0x4c')]=function(_0x52aa0a,_0x266803,_0x2b6f71){var _0x3c9c87={};var _0x2ee054={};var _0x53aeb0;var _0x991211;return db[_0x815b('0x2f')][_0x815b('0x4d')]({'where':{'id':_0x52aa0a[_0x815b('0x47')]['id']}})[_0x815b('0x27')](handleEntityNotFound(_0x266803,null))['then'](function(_0x4b4471){if(_0x4b4471){_0x53aeb0=_0x4b4471;_0x2ee054['model']=_[_0x815b('0x35')](db['ZohoConfiguration']['rawAttributes']);_0x2ee054['query']=_[_0x815b('0x35')](_0x52aa0a[_0x815b('0x34')]);_0x2ee054[_0x815b('0x36')]=_[_0x815b('0x37')](_0x2ee054[_0x815b('0x33')],_0x2ee054[_0x815b('0x34')]);_0x3c9c87['attributes']=_[_0x815b('0x37')](_0x2ee054[_0x815b('0x33')],qs[_0x815b('0x38')](_0x52aa0a[_0x815b('0x34')]['fields']));_0x3c9c87[_0x815b('0x39')]=_0x3c9c87['attributes'][_0x815b('0x4e')]?_0x3c9c87[_0x815b('0x39')]:_0x2ee054['model'];_0x3c9c87[_0x815b('0x4f')]=qs[_0x815b('0x3b')](_0x52aa0a[_0x815b('0x34')][_0x815b('0x3b')]);_0x3c9c87[_0x815b('0x3e')]=qs['filters'](_[_0x815b('0x3c')](_0x52aa0a[_0x815b('0x34')],_0x2ee054[_0x815b('0x36')]));if(_0x52aa0a[_0x815b('0x34')][_0x815b('0x3d')]){_0x3c9c87[_0x815b('0x3e')]=_[_0x815b('0x3f')](_0x3c9c87[_0x815b('0x3e')],{'$or':_[_0x815b('0x2e')](_0x3c9c87[_0x815b('0x39')],function(_0x1f75ae){var _0x2c9ae2={};_0x2c9ae2[_0x1f75ae]={'$like':'%'+_0x52aa0a[_0x815b('0x34')][_0x815b('0x3d')]+'%'};return _0x2c9ae2;})});}_0x3c9c87=_[_0x815b('0x3f')]({},_0x3c9c87,_0x52aa0a[_0x815b('0x40')]);return _0x53aeb0['getConfigurations'](_0x3c9c87);}})[_0x815b('0x27')](function(_0x20aa2c){if(_0x20aa2c){_0x991211=_0x20aa2c['length'];if(!_0x52aa0a[_0x815b('0x34')][_0x815b('0x50')](_0x815b('0x3a'))){_0x3c9c87['limit']=qs[_0x815b('0x21')](_0x52aa0a[_0x815b('0x34')][_0x815b('0x21')]);_0x3c9c87[_0x815b('0x1f')]=qs['offset'](_0x52aa0a['query'][_0x815b('0x1f')]);}return _0x53aeb0[_0x815b('0x4c')](_0x3c9c87);}})[_0x815b('0x27')](function(_0x29c3f1){if(_0x29c3f1){return _0x29c3f1?{'count':_0x991211,'rows':_0x29c3f1}:null;}})[_0x815b('0x27')](respondWithResult(_0x266803,null))['catch'](handleError(_0x266803,null));};exports[_0x815b('0x51')]=function(_0x251da8,_0x3393f8,_0x3417a1){if(_0x251da8[_0x815b('0x4b')]['id']){delete _0x251da8[_0x815b('0x4b')]['id'];}return db[_0x815b('0x2f')][_0x815b('0x4d')]({'where':{'id':_0x251da8['params']['id']}})['then'](handleEntityNotFound(_0x3393f8,null))[_0x815b('0x27')](function(_0x477d66){if(_0x477d66){_0x251da8[_0x815b('0x4b')][_0x815b('0x52')]=_0x477d66['id'];_0x251da8[_0x815b('0x4b')][_0x815b('0x53')]=integrations[_0x815b('0x54')](_0x251da8[_0x815b('0x4b')][_0x815b('0x55')],_0x251da8[_0x815b('0x4b')][_0x815b('0x31')]);_0x251da8[_0x815b('0x4b')]['Descriptions']=integrations[_0x815b('0x56')](_0x251da8[_0x815b('0x4b')]['channel'],_0x251da8[_0x815b('0x4b')]['type']);return db[_0x815b('0x57')][_0x815b('0x4a')](_0x251da8[_0x815b('0x4b')],{'include':[{'model':db[_0x815b('0x58')],'as':'Subjects'},{'model':db[_0x815b('0x58')],'as':_0x815b('0x59')}]});}return null;})[_0x815b('0x27')](respondWithResult(_0x3393f8,null))[_0x815b('0x45')](handleError(_0x3393f8,null));};function getAccessToken(_0x3794ea){return new Promise(function(_0x1a6908,_0x29d44c){var _0x1f988a;switch(_0x3794ea[_0x815b('0x5a')]){case'US':_0x1f988a=_0x815b('0x5b');break;case'AU':_0x1f988a=_0x815b('0x5c');break;case'EU':_0x1f988a=_0x815b('0x5d');break;case'IN':_0x1f988a=_0x815b('0x5e');break;case'CN':_0x1f988a=_0x815b('0x5f');break;default:_0x1f988a=_0x815b('0x5d');break;}var _0x296d1e={'method':_0x815b('0x60'),'uri':_0x1f988a+_0x815b('0x61'),'qs':{'refresh_token':_0x3794ea[_0x815b('0x62')],'client_id':_0x3794ea['clientId'],'client_secret':_0x3794ea[_0x815b('0x63')],'grant_type':_0x815b('0x64')},'json':!![]};return rp(_0x296d1e)['then'](function(_0x23b96c){if(_0x23b96c['access_token']){_0x1a6908(_0x23b96c[_0x815b('0x65')]);}else{_0x29d44c(_0x815b('0x66'));}})[_0x815b('0x45')](function(_0x1906fc){_0x29d44c(_0x1906fc);});});}exports[_0x815b('0x67')]=function(_0x556926,_0x7ced0c,_0xefefb2){var _0x12d821,_0x10a9fc,_0x5efad5,_0x13d829,_0x29681f;return db['ZohoAccount'][_0x815b('0x4d')]({'where':{'id':_0x556926[_0x815b('0x47')]['id']},'attributes':['id','host',_0x815b('0x5a'),'clientId','clientSecret',_0x815b('0x68'),_0x815b('0x69'),'refreshToken']})[_0x815b('0x27')](handleEntityNotFound(_0x7ced0c,null))[_0x815b('0x27')](function(_0xcea9e9){_0x29681f=_0xcea9e9;_0x12d821=_0x29681f[_0x815b('0x6a')];_0x10a9fc=_0x12d821==='zoho.eu'?'eu':_0x815b('0x6b');_0x5efad5=_0x29681f[_0x815b('0x68')];var _0x584d6c=_0x5efad5['slice'](-0x1);if(_0x584d6c==='/'||_0x584d6c==='\x5c'||_0x584d6c===':'){_0x5efad5=_0x5efad5[_0x815b('0x6c')](0x0,_0x5efad5[_0x815b('0x6d')](_0x584d6c));}if(!_0x29681f[_0x815b('0x62')]){throw new Error(_0x815b('0x6e'));}return getAccessToken(_0x29681f);})[_0x815b('0x27')](function(_0x19b812){if(_0x19b812){return rp({'method':_0x815b('0x6f'),'uri':util[_0x815b('0x70')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x10a9fc),'qs':{'module':'Calls'},'headers':{'Authorization':_0x815b('0x71')+_0x19b812},'json':!![]});}})[_0x815b('0x27')](function(_0x99f338){if(_0x99f338){if(_0x99f338[_0x815b('0x72')]&&_0x99f338[_0x815b('0x72')][_0x815b('0x2a')]){throw new Error(_0x99f338[_0x815b('0x72')][_0x815b('0x2a')]['message']);}var _0x29a2c1=[];var _0x3aa2fc=[];var _0x59bd20=['Owner','Subject',_0x815b('0x73'),_0x815b('0x74'),'Call_Duration',_0x815b('0x75'),_0x815b('0x76'),_0x815b('0x77')];_0x3aa2fc=_[_0x815b('0x78')](_0x99f338[_0x815b('0x38')],function(_0x5114b4){return _0x59bd20['includes'](_0x5114b4[_0x815b('0x79')]);});for(var _0x353fba=0x0;_0x353fba<_0x3aa2fc[_0x815b('0x4e')];_0x353fba++){if(_0x3aa2fc[_0x353fba]['system_mandatory']===![]){_0x29a2c1[_0x815b('0x7a')]({'id':_0x3aa2fc[_0x353fba]['id'],'name':_0x3aa2fc[_0x353fba][_0x815b('0x7b')],'custom':_0x3aa2fc[_0x353fba][_0x815b('0x7c')],'options':_0x3aa2fc[_0x353fba][_0x815b('0x7d')]===_0x815b('0x7e')&&_0x3aa2fc[_0x353fba]['pick_list_values'][_0x815b('0x4e')]>-0x1?_['map'](_0x3aa2fc[_0x353fba][_0x815b('0x7f')],function(_0x2261bc){return{'name':_0x2261bc,'value':_0x2261bc};}):[]});}}return{'count':_0x29a2c1[_0x815b('0x4e')],'rows':_0x29a2c1};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x7ced0c,null))['catch'](function(_0x3c535b){var _0x2b48ce=_0x556926['query'][_0x815b('0x80')]?0x1f4:_0x3c535b['statusCode']||0x1f4;logger[_0x815b('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x815b('0x67'),_0x2b48ce,JSON[_0x815b('0x81')](_0x3c535b));delete _0x3c535b[_0x815b('0x2b')];if(_0x2b48ce===0x191){_0x2b48ce=0x190;}_0x7ced0c[_0x815b('0x1d')](_0x2b48ce)['send'](_0x556926[_0x815b('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3c535b[_0x815b('0x82')]}:_0x3c535b);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index fd58fac..a868813 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 _0x083e=['ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','host','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','lastIndexOf','then','info'];(function(_0x44f4c1,_0x117b72){var _0x2f87c4=function(_0xeb877f){while(--_0xeb877f){_0x44f4c1['push'](_0x44f4c1['shift']());}};_0x2f87c4(++_0x117b72);}(_0x083e,0x1c5));var _0xe083=function(_0x4c3ece,_0x57053e){_0x4c3ece=_0x4c3ece-0x0;var _0x409c1d=_0x083e[_0x4c3ece];return _0x409c1d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe083('0x0'))(_0xe083('0x1'));var moment=require('moment');var BPromise=require(_0xe083('0x2'));var rp=require(_0xe083('0x3'));var fs=require('fs');var path=require(_0xe083('0x4'));var rimraf=require(_0xe083('0x5'));var config=require(_0xe083('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xe083('0x7'));module[_0xe083('0x8')]=function(_0x48303b,_0x3574b0){return _0x48303b['define'](_0xe083('0x9'),attributes,{'tableName':_0xe083('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d0ed8,_0x253d2b,_0x3f8de1){if(_0x5d0ed8[_0xe083('0xb')](_0xe083('0xc'))||_0x5d0ed8[_0xe083('0xb')](_0xe083('0xd'))||_0x5d0ed8['changed']('clientId')||_0x5d0ed8[_0xe083('0xb')](_0xe083('0xe'))||_0x5d0ed8[_0xe083('0xb')](_0xe083('0xf'))||_0x5d0ed8[_0xe083('0xb')](_0xe083('0x10'))){var _0x18cc07,_0x3efcef;_0x18cc07=_0x5d0ed8[_0xe083('0xd')];var _0x830782=_0x18cc07['slice'](-0x1);if(_0x830782==='/'||_0x830782==='\x5c'||_0x830782===':'){_0x18cc07=_0x18cc07[_0xe083('0x11')](0x0,_0x18cc07['lastIndexOf'](_0x830782));}switch(_0x5d0ed8['zone']){case'US':_0x3efcef=_0xe083('0x12');break;case'AU':_0x3efcef=_0xe083('0x13');break;case'IN':_0x3efcef=_0xe083('0x14');break;case'CN':_0x3efcef=_0xe083('0x15');break;default:_0x3efcef=_0xe083('0x16');break;}var _0x5dc23d={'method':_0xe083('0x17'),'uri':_0x3efcef+_0xe083('0x18'),'form':{'grant_type':_0xe083('0x19'),'client_id':_0x5d0ed8[_0xe083('0x1a')],'client_secret':_0x5d0ed8['clientSecret'],'redirect_uri':_0x5d0ed8[_0xe083('0xd')],'code':_0x5d0ed8[_0xe083('0xf')]},'headers':{'Content-Type':_0xe083('0x1b')}};return rp(_0x5dc23d)['then'](function(_0x250b38){var _0x4bc780=JSON[_0xe083('0x1c')](_0x250b38);if(_0x4bc780[_0xe083('0x1d')]){_0x5d0ed8[_0xe083('0x1e')]=_0x4bc780[_0xe083('0x1d')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5d0ed8[_0xe083('0x1f')],_0x5d0ed8['id']));}else{logger[_0xe083('0x20')](util[_0xe083('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5d0ed8[_0xe083('0x1f')],_0x5d0ed8['id']),util['inspect'](_0x4bc780,{'showHidden':![],'depth':null}));}return _0x3f8de1(null,_0x253d2b);})['catch'](function(_0x3efb09){logger['error'](util[_0xe083('0x21')](_0xe083('0x22'),_0x5d0ed8[_0xe083('0x1f')],_0x5d0ed8['id']),util[_0xe083('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3f8de1(_0x3efb09);});}else{return _0x3f8de1(null,_0x253d2b);}},'beforeUpdate':function(_0xc5634,_0x72491d,_0x4f01e3){if(_0xc5634[_0xe083('0xb')]('zone')||_0xc5634[_0xe083('0xb')](_0xe083('0xd'))||_0xc5634[_0xe083('0xb')]('clientId')||_0xc5634[_0xe083('0xb')](_0xe083('0xe'))||_0xc5634[_0xe083('0xb')](_0xe083('0xf'))||_0xc5634[_0xe083('0xb')](_0xe083('0x10'))){var _0x5b18d7,_0x5a3bb9;_0x5b18d7=_0xc5634[_0xe083('0xd')];var _0x11273a=_0x5b18d7['slice'](-0x1);if(_0x11273a==='/'||_0x11273a==='\x5c'||_0x11273a===':'){_0x5b18d7=_0x5b18d7[_0xe083('0x11')](0x0,_0x5b18d7[_0xe083('0x24')](_0x11273a));}switch(_0xc5634['zone']){case'US':_0x5a3bb9='https://accounts.zoho.com';break;case'AU':_0x5a3bb9=_0xe083('0x13');break;case'IN':_0x5a3bb9=_0xe083('0x14');break;case'CN':_0x5a3bb9=_0xe083('0x15');break;default:_0x5a3bb9=_0xe083('0x16');break;}var _0x1d01e1={'method':_0xe083('0x17'),'uri':_0x5a3bb9+_0xe083('0x18'),'form':{'grant_type':_0xe083('0x19'),'client_id':_0xc5634[_0xe083('0x1a')],'client_secret':_0xc5634[_0xe083('0xe')],'redirect_uri':_0xc5634['serverUrl'],'code':_0xc5634[_0xe083('0xf')]},'headers':{'Content-Type':_0xe083('0x1b')}};return rp(_0x1d01e1)[_0xe083('0x25')](function(_0x3ba86a){var _0x193375=JSON[_0xe083('0x1c')](_0x3ba86a);if(_0x193375[_0xe083('0x1d')]){_0xc5634['refreshToken']=_0x193375[_0xe083('0x1d')];logger[_0xe083('0x26')](util[_0xe083('0x21')](_0xe083('0x27'),_0xc5634[_0xe083('0x1f')],_0xc5634['id']));}else{logger['error'](util[_0xe083('0x21')](_0xe083('0x22'),_0xc5634['name'],_0xc5634['id']),util[_0xe083('0x23')](_0x193375,{'showHidden':![],'depth':null}));}return _0x4f01e3(null,_0x72491d);})[_0xe083('0x28')](function(_0x2a5f52){logger['error'](util[_0xe083('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xc5634[_0xe083('0x1f')],_0xc5634['id']),util[_0xe083('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x4f01e3(_0x2a5f52);});}else{return _0x4f01e3(null,_0x72491d);}}}});}; \ No newline at end of file +var _0x1666=['code','serverUrl','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientSecret','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','slice','https://accounts.zoho.eu','application/x-www-form-urlencoded','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','clientId'];(function(_0xf5d70,_0x4ec030){var _0x969051=function(_0x30f7ef){while(--_0x30f7ef){_0xf5d70['push'](_0xf5d70['shift']());}};_0x969051(++_0x4ec030);}(_0x1666,0xbf));var _0x6166=function(_0x209d0e,_0x4aa37b){_0x209d0e=_0x209d0e-0x0;var _0xbab272=_0x1666[_0x209d0e];return _0xbab272;};'use strict';var _=require(_0x6166('0x0'));var util=require('util');var logger=require(_0x6166('0x1'))(_0x6166('0x2'));var moment=require(_0x6166('0x3'));var BPromise=require(_0x6166('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6166('0x5'));var config=require(_0x6166('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x6166('0x7'));module[_0x6166('0x8')]=function(_0x5a530c,_0x593187){return _0x5a530c[_0x6166('0x9')]('ZohoAccount',attributes,{'tableName':_0x6166('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x730db0,_0x374c21,_0xf9e694){if(_0x730db0[_0x6166('0xb')](_0x6166('0xc'))||_0x730db0[_0x6166('0xb')]('serverUrl')||_0x730db0[_0x6166('0xb')](_0x6166('0xd'))||_0x730db0['changed']('clientSecret')||_0x730db0[_0x6166('0xb')](_0x6166('0xe'))||_0x730db0['changed']('host')){var _0x906dd3,_0x26b9b2;_0x906dd3=_0x730db0[_0x6166('0xf')];var _0x723cb7=_0x906dd3['slice'](-0x1);if(_0x723cb7==='/'||_0x723cb7==='\x5c'||_0x723cb7===':'){_0x906dd3=_0x906dd3[_0x6166('0x10')](0x0,_0x906dd3[_0x6166('0x11')](_0x723cb7));}switch(_0x730db0['zone']){case'US':_0x26b9b2='https://accounts.zoho.com';break;case'AU':_0x26b9b2=_0x6166('0x12');break;case'IN':_0x26b9b2=_0x6166('0x13');break;case'CN':_0x26b9b2=_0x6166('0x14');break;default:_0x26b9b2='https://accounts.zoho.eu';break;}var _0x3fec65={'method':_0x6166('0x15'),'uri':_0x26b9b2+_0x6166('0x16'),'form':{'grant_type':_0x6166('0x17'),'client_id':_0x730db0[_0x6166('0xd')],'client_secret':_0x730db0[_0x6166('0x18')],'redirect_uri':_0x730db0[_0x6166('0xf')],'code':_0x730db0['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3fec65)[_0x6166('0x19')](function(_0x13487e){var _0x1b605a=JSON[_0x6166('0x1a')](_0x13487e);if(_0x1b605a[_0x6166('0x1b')]){_0x730db0[_0x6166('0x1c')]=_0x1b605a['refresh_token'];logger[_0x6166('0x1d')](util['format'](_0x6166('0x1e'),_0x730db0[_0x6166('0x1f')],_0x730db0['id']));}else{logger[_0x6166('0x20')](util[_0x6166('0x21')](_0x6166('0x22'),_0x730db0['name'],_0x730db0['id']),util[_0x6166('0x23')](_0x1b605a,{'showHidden':![],'depth':null}));}return _0xf9e694(null,_0x374c21);})[_0x6166('0x24')](function(_0x5d8e7d){logger[_0x6166('0x20')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x730db0[_0x6166('0x1f')],_0x730db0['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xf9e694(_0x5d8e7d);});}else{return _0xf9e694(null,_0x374c21);}},'beforeUpdate':function(_0x3619b6,_0x197c57,_0x362b21){if(_0x3619b6[_0x6166('0xb')](_0x6166('0xc'))||_0x3619b6['changed'](_0x6166('0xf'))||_0x3619b6[_0x6166('0xb')](_0x6166('0xd'))||_0x3619b6['changed'](_0x6166('0x18'))||_0x3619b6[_0x6166('0xb')](_0x6166('0xe'))||_0x3619b6[_0x6166('0xb')](_0x6166('0x25'))){var _0x492fe6,_0x506f9a;_0x492fe6=_0x3619b6['serverUrl'];var _0xc257ba=_0x492fe6[_0x6166('0x26')](-0x1);if(_0xc257ba==='/'||_0xc257ba==='\x5c'||_0xc257ba===':'){_0x492fe6=_0x492fe6[_0x6166('0x10')](0x0,_0x492fe6['lastIndexOf'](_0xc257ba));}switch(_0x3619b6[_0x6166('0xc')]){case'US':_0x506f9a='https://accounts.zoho.com';break;case'AU':_0x506f9a='https://accounts.zoho.com.au';break;case'IN':_0x506f9a=_0x6166('0x13');break;case'CN':_0x506f9a='https://accounts.zoho.com.cn';break;default:_0x506f9a=_0x6166('0x27');break;}var _0x38ca42={'method':'POST','uri':_0x506f9a+_0x6166('0x16'),'form':{'grant_type':_0x6166('0x17'),'client_id':_0x3619b6[_0x6166('0xd')],'client_secret':_0x3619b6['clientSecret'],'redirect_uri':_0x3619b6[_0x6166('0xf')],'code':_0x3619b6[_0x6166('0xe')]},'headers':{'Content-Type':_0x6166('0x28')}};return rp(_0x38ca42)[_0x6166('0x19')](function(_0x3efae1){var _0x2cd91e=JSON['parse'](_0x3efae1);if(_0x2cd91e[_0x6166('0x1b')]){_0x3619b6[_0x6166('0x1c')]=_0x2cd91e[_0x6166('0x1b')];logger[_0x6166('0x1d')](util[_0x6166('0x21')](_0x6166('0x1e'),_0x3619b6[_0x6166('0x1f')],_0x3619b6['id']));}else{logger[_0x6166('0x20')](util[_0x6166('0x21')](_0x6166('0x22'),_0x3619b6[_0x6166('0x1f')],_0x3619b6['id']),util['inspect'](_0x2cd91e,{'showHidden':![],'depth':null}));}return _0x362b21(null,_0x197c57);})[_0x6166('0x24')](function(_0x2c2b3a){logger[_0x6166('0x20')](util['format'](_0x6166('0x22'),_0x3619b6[_0x6166('0x1f')],_0x3619b6['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x362b21(_0x2c2b3a);});}else{return _0x362b21(null,_0x197c57);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index b7f3e93..7f16f4d 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 _0x5c96=['error','code','message','result','catch','ZohoAccount','findAll','options','attributes','limit','include','map','model','GetZohoAccount','find','raw','where','ShowZohoAccount','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x5c96,0x133));var _0x65c9=function(_0x568678,_0xe658fe){_0x568678=_0x568678-0x0;var _0x42ce62=_0x5c96[_0x568678];return _0x42ce62;};'use strict';var _=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var moment=require(_0x65c9('0x2'));var BPromise=require(_0x65c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65c9('0x4'));var db=require(_0x65c9('0x5'))['db'];var utils=require(_0x65c9('0x6'));var logger=require(_0x65c9('0x7'))(_0x65c9('0x8'));var config=require(_0x65c9('0x9'));var jayson=require(_0x65c9('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x502c63,_0x4eb25b,_0x1a9b93){return new BPromise(function(_0x10a355,_0x1c679d){return client['request'](_0x502c63,_0x1a9b93)[_0x65c9('0xb')](function(_0x3249da){logger[_0x65c9('0xc')](_0x65c9('0xd'),_0x4eb25b,_0x65c9('0xe'));logger[_0x65c9('0xf')](_0x65c9('0x10'),_0x4eb25b,'request\x20sent',JSON['stringify'](_0x3249da));if(_0x3249da['error']){if(_0x3249da[_0x65c9('0x11')][_0x65c9('0x12')]===0x1f4){logger[_0x65c9('0x11')](_0x65c9('0xd'),_0x4eb25b,_0x3249da[_0x65c9('0x11')]['message']);return _0x1c679d(_0x3249da[_0x65c9('0x11')][_0x65c9('0x13')]);}logger[_0x65c9('0x11')](_0x65c9('0xd'),_0x4eb25b,_0x3249da['error'][_0x65c9('0x13')]);return _0x10a355(_0x3249da[_0x65c9('0x11')][_0x65c9('0x13')]);}else{logger[_0x65c9('0xc')](_0x65c9('0xd'),_0x4eb25b,_0x65c9('0xe'));_0x10a355(_0x3249da[_0x65c9('0x14')][_0x65c9('0x13')]);}})[_0x65c9('0x15')](function(_0x25c0e9){logger[_0x65c9('0x11')](_0x65c9('0xd'),_0x4eb25b,_0x25c0e9);_0x1c679d(_0x25c0e9);});});}exports['GetZohoAccount']=function(_0x51f948){var _0x36f667=this;return new Promise(function(_0x167b49,_0x469ac0){return db[_0x65c9('0x16')][_0x65c9('0x17')]({'raw':_0x51f948[_0x65c9('0x18')]?_0x51f948[_0x65c9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x51f948[_0x65c9('0x18')]?_0x51f948['options']['where']||null:null,'attributes':_0x51f948['options']?_0x51f948['options'][_0x65c9('0x19')]||null:null,'limit':_0x51f948[_0x65c9('0x18')]?_0x51f948[_0x65c9('0x18')][_0x65c9('0x1a')]||null:null,'include':_0x51f948[_0x65c9('0x18')]?_0x51f948[_0x65c9('0x18')][_0x65c9('0x1b')]?_[_0x65c9('0x1c')](_0x51f948[_0x65c9('0x18')][_0x65c9('0x1b')],function(_0x240438){return{'model':db[_0x240438['model']],'as':_0x240438['as'],'attributes':_0x240438[_0x65c9('0x19')],'include':_0x240438[_0x65c9('0x1b')]?_[_0x65c9('0x1c')](_0x240438[_0x65c9('0x1b')],function(_0x4692b4){return{'model':db[_0x4692b4[_0x65c9('0x1d')]],'as':_0x4692b4['as'],'attributes':_0x4692b4[_0x65c9('0x19')],'include':_0x4692b4['include']?_[_0x65c9('0x1c')](_0x4692b4[_0x65c9('0x1b')],function(_0x5e4b8a){return{'model':db[_0x5e4b8a[_0x65c9('0x1d')]],'as':_0x5e4b8a['as'],'attributes':_0x5e4b8a[_0x65c9('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1db634){logger[_0x65c9('0xc')]('GetZohoAccount',_0x51f948);logger['debug'](_0x65c9('0x1e'),_0x51f948,JSON['stringify'](_0x1db634));_0x167b49(_0x1db634);})[_0x65c9('0x15')](function(_0x50fb61){logger[_0x65c9('0x11')]('GetZohoAccount',_0x50fb61[_0x65c9('0x13')],_0x51f948);_0x469ac0(_0x36f667[_0x65c9('0x11')](0x1f4,_0x50fb61[_0x65c9('0x13')]));});});};exports['ShowZohoAccount']=function(_0x393173){var _0x172d86=this;return new Promise(function(_0x499fa6,_0xdcd766){return db['ZohoAccount'][_0x65c9('0x1f')]({'raw':_0x393173[_0x65c9('0x18')]?_0x393173[_0x65c9('0x18')][_0x65c9('0x20')]===undefined?!![]:![]:!![],'where':_0x393173['options']?_0x393173[_0x65c9('0x18')][_0x65c9('0x21')]||null:null,'attributes':_0x393173[_0x65c9('0x18')]?_0x393173['options'][_0x65c9('0x19')]||null:null,'include':_0x393173[_0x65c9('0x18')]?_0x393173['options'][_0x65c9('0x1b')]?_['map'](_0x393173[_0x65c9('0x18')][_0x65c9('0x1b')],function(_0x1e5dd9){return{'model':db[_0x1e5dd9[_0x65c9('0x1d')]],'as':_0x1e5dd9['as'],'attributes':_0x1e5dd9['attributes'],'include':_0x1e5dd9[_0x65c9('0x1b')]?_[_0x65c9('0x1c')](_0x1e5dd9['include'],function(_0x27284e){return{'model':db[_0x27284e[_0x65c9('0x1d')]],'as':_0x27284e['as'],'attributes':_0x27284e[_0x65c9('0x19')],'include':_0x27284e[_0x65c9('0x1b')]?_[_0x65c9('0x1c')](_0x27284e[_0x65c9('0x1b')],function(_0x56fd0d){return{'model':db[_0x56fd0d[_0x65c9('0x1d')]],'as':_0x56fd0d['as'],'attributes':_0x56fd0d[_0x65c9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x65c9('0xb')](function(_0x111818){logger[_0x65c9('0xc')](_0x65c9('0x22'),_0x393173);logger[_0x65c9('0xf')](_0x65c9('0x22'),_0x393173,JSON[_0x65c9('0x23')](_0x111818));_0x499fa6(_0x111818);})['catch'](function(_0x102cfb){logger['error'](_0x65c9('0x22'),_0x102cfb[_0x65c9('0x13')],_0x393173);_0xdcd766(_0x172d86['error'](0x1f4,_0x102cfb['message']));});});}; \ No newline at end of file +var _0xce62=['info','request\x20sent','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowZohoAccount','find','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xce62,0x83));var _0x2ce6=function(_0x2d72ad,_0x891d64){_0x2d72ad=_0x2d72ad-0x0;var _0x4aef8b=_0xce62[_0x2d72ad];return _0x4aef8b;};'use strict';var _=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var moment=require('moment');var BPromise=require(_0x2ce6('0x2'));var rs=require(_0x2ce6('0x3'));var fs=require('fs');var Redis=require(_0x2ce6('0x4'));var db=require(_0x2ce6('0x5'))['db'];var utils=require(_0x2ce6('0x6'));var logger=require(_0x2ce6('0x7'))('rpc');var config=require(_0x2ce6('0x8'));var jayson=require(_0x2ce6('0x9'));var client=jayson[_0x2ce6('0xa')][_0x2ce6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf425,_0x2c66c2,_0x5b7f02){return new BPromise(function(_0x46ef52,_0x12f647){return client['request'](_0xcf425,_0x5b7f02)[_0x2ce6('0xc')](function(_0x2e6eae){logger[_0x2ce6('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'),JSON['stringify'](_0x2e6eae));if(_0x2e6eae[_0x2ce6('0xf')]){if(_0x2e6eae['error'][_0x2ce6('0x10')]===0x1f4){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);return _0x12f647(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}logger[_0x2ce6('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')]['message']);return _0x46ef52(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}else{logger[_0x2ce6('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));_0x46ef52(_0x2e6eae[_0x2ce6('0x13')][_0x2ce6('0x12')]);}})[_0x2ce6('0x14')](function(_0x38032e){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x38032e);_0x12f647(_0x38032e);});});}exports[_0x2ce6('0x15')]=function(_0x353894){var _0x37b5d1=this;return new Promise(function(_0x4f9ceb,_0xa00781){return db[_0x2ce6('0x16')][_0x2ce6('0x17')]({'raw':_0x353894['options']?_0x353894[_0x2ce6('0x18')][_0x2ce6('0x19')]===undefined?!![]:![]:!![],'where':_0x353894[_0x2ce6('0x18')]?_0x353894[_0x2ce6('0x18')][_0x2ce6('0x1a')]||null:null,'attributes':_0x353894['options']?_0x353894[_0x2ce6('0x18')]['attributes']||null:null,'limit':_0x353894['options']?_0x353894[_0x2ce6('0x18')][_0x2ce6('0x1b')]||null:null,'include':_0x353894[_0x2ce6('0x18')]?_0x353894['options'][_0x2ce6('0x1c')]?_[_0x2ce6('0x1d')](_0x353894[_0x2ce6('0x18')][_0x2ce6('0x1c')],function(_0x5a4656){return{'model':db[_0x5a4656[_0x2ce6('0x1e')]],'as':_0x5a4656['as'],'attributes':_0x5a4656[_0x2ce6('0x1f')],'include':_0x5a4656[_0x2ce6('0x1c')]?_[_0x2ce6('0x1d')](_0x5a4656[_0x2ce6('0x1c')],function(_0x366ada){return{'model':db[_0x366ada[_0x2ce6('0x1e')]],'as':_0x366ada['as'],'attributes':_0x366ada['attributes'],'include':_0x366ada['include']?_['map'](_0x366ada[_0x2ce6('0x1c')],function(_0x2df836){return{'model':db[_0x2df836['model']],'as':_0x2df836['as'],'attributes':_0x2df836['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ce6('0xc')](function(_0x126e43){logger[_0x2ce6('0xd')](_0x2ce6('0x15'),_0x353894);logger['debug']('GetZohoAccount',_0x353894,JSON[_0x2ce6('0x20')](_0x126e43));_0x4f9ceb(_0x126e43);})[_0x2ce6('0x14')](function(_0x2fd596){logger['error']('GetZohoAccount',_0x2fd596['message'],_0x353894);_0xa00781(_0x37b5d1[_0x2ce6('0xf')](0x1f4,_0x2fd596['message']));});});};exports[_0x2ce6('0x21')]=function(_0x287568){var _0x1669ae=this;return new Promise(function(_0x396092,_0x3c9bad){return db['ZohoAccount'][_0x2ce6('0x22')]({'raw':_0x287568[_0x2ce6('0x18')]?_0x287568[_0x2ce6('0x18')][_0x2ce6('0x19')]===undefined?!![]:![]:!![],'where':_0x287568['options']?_0x287568[_0x2ce6('0x18')][_0x2ce6('0x1a')]||null:null,'attributes':_0x287568[_0x2ce6('0x18')]?_0x287568['options'][_0x2ce6('0x1f')]||null:null,'include':_0x287568[_0x2ce6('0x18')]?_0x287568[_0x2ce6('0x18')][_0x2ce6('0x1c')]?_[_0x2ce6('0x1d')](_0x287568[_0x2ce6('0x18')]['include'],function(_0x28734c){return{'model':db[_0x28734c['model']],'as':_0x28734c['as'],'attributes':_0x28734c['attributes'],'include':_0x28734c['include']?_[_0x2ce6('0x1d')](_0x28734c[_0x2ce6('0x1c')],function(_0xc50a7b){return{'model':db[_0xc50a7b[_0x2ce6('0x1e')]],'as':_0xc50a7b['as'],'attributes':_0xc50a7b[_0x2ce6('0x1f')],'include':_0xc50a7b[_0x2ce6('0x1c')]?_[_0x2ce6('0x1d')](_0xc50a7b[_0x2ce6('0x1c')],function(_0x3702b0){return{'model':db[_0x3702b0[_0x2ce6('0x1e')]],'as':_0x3702b0['as'],'attributes':_0x3702b0[_0x2ce6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2ce6('0xc')](function(_0x3553d2){logger[_0x2ce6('0xd')](_0x2ce6('0x21'),_0x287568);logger[_0x2ce6('0x23')]('ShowZohoAccount',_0x287568,JSON[_0x2ce6('0x20')](_0x3553d2));_0x396092(_0x3553d2);})[_0x2ce6('0x14')](function(_0x13346e){logger[_0x2ce6('0xf')]('ShowZohoAccount',_0x13346e[_0x2ce6('0x12')],_0x287568);_0x3c9bad(_0x1669ae['error'](0x1f4,_0x13346e[_0x2ce6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 6af5753..f3b175a 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 _0x097d=['index','get','/:id','show','isAuthenticated','getFields','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller'];(function(_0x3f4ba5,_0x189026){var _0x5bfdd5=function(_0x48dd4a){while(--_0x48dd4a){_0x3f4ba5['push'](_0x3f4ba5['shift']());}};_0x5bfdd5(++_0x189026);}(_0x097d,0x65));var _0xd097=function(_0x64bec,_0x37225c){_0x64bec=_0x64bec-0x0;var _0x46b9c6=_0x097d[_0x64bec];return _0x46b9c6;};'use strict';var multer=require(_0xd097('0x0'));var util=require(_0xd097('0x1'));var path=require(_0xd097('0x2'));var timeout=require(_0xd097('0x3'));var express=require(_0xd097('0x4'));var router=express['Router']();var fs_extra=require(_0xd097('0x5'));var auth=require(_0xd097('0x6'));var interaction=require(_0xd097('0x7'));var config=require('../../config/environment');var controller=require(_0xd097('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd097('0x9')]);router[_0xd097('0xa')](_0xd097('0xb'),auth['isAuthenticated'](),controller[_0xd097('0xc')]);router[_0xd097('0xa')]('/:id/fields',auth[_0xd097('0xd')](),controller[_0xd097('0xe')]);router[_0xd097('0xa')]('/:id/subjects',auth[_0xd097('0xd')](),controller['getSubjects']);router[_0xd097('0xa')](_0xd097('0xf'),auth[_0xd097('0xd')](),controller[_0xd097('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd097('0x11')](_0xd097('0xb'),auth[_0xd097('0xd')](),controller[_0xd097('0x12')]);router[_0xd097('0x13')](_0xd097('0xb'),auth['isAuthenticated'](),controller[_0xd097('0x14')]);module[_0xd097('0x15')]=router; \ No newline at end of file +var _0x3ac0=['isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get'];(function(_0x317333,_0x191c3e){var _0x206e17=function(_0x24e519){while(--_0x24e519){_0x317333['push'](_0x317333['shift']());}};_0x206e17(++_0x191c3e);}(_0x3ac0,0x120));var _0x03ac=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x3ac0[_0x11ca63];return _0x41f1f6;};'use strict';var multer=require(_0x03ac('0x0'));var util=require(_0x03ac('0x1'));var path=require(_0x03ac('0x2'));var timeout=require(_0x03ac('0x3'));var express=require(_0x03ac('0x4'));var router=express[_0x03ac('0x5')]();var fs_extra=require(_0x03ac('0x6'));var auth=require(_0x03ac('0x7'));var interaction=require(_0x03ac('0x8'));var config=require(_0x03ac('0x9'));var controller=require(_0x03ac('0xa'));router[_0x03ac('0xb')]('/',auth[_0x03ac('0xc')](),controller[_0x03ac('0xd')]);router['get'](_0x03ac('0xe'),auth['isAuthenticated'](),controller[_0x03ac('0xf')]);router['get'](_0x03ac('0x10'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x03ac('0x11'),auth[_0x03ac('0xc')](),controller[_0x03ac('0x12')]);router[_0x03ac('0xb')](_0x03ac('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x03ac('0x14')]('/',auth['isAuthenticated'](),controller[_0x03ac('0x15')]);router[_0x03ac('0x16')](_0x03ac('0xe'),auth['isAuthenticated'](),controller[_0x03ac('0x17')]);router['delete'](_0x03ac('0xe'),auth['isAuthenticated'](),controller[_0x03ac('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 1ba7273..2120371 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 _0x9fd0=['contact_lead','STRING','sequelize','lead','contact','nothing','ENUM'];(function(_0x2f3522,_0x2130f4){var _0x4b8074=function(_0x23fcdf){while(--_0x23fcdf){_0x2f3522['push'](_0x2f3522['shift']());}};_0x4b8074(++_0x2130f4);}(_0x9fd0,0x1c2));var _0x09fd=function(_0x52a4a9,_0x4f4e11){_0x52a4a9=_0x52a4a9-0x0;var _0x298229=_0x9fd0[_0x52a4a9];return _0x298229;};'use strict';var Sequelize=require(_0x09fd('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x09fd('0x1'),_0x09fd('0x2'),_0x09fd('0x3')),'defaultValue':_0x09fd('0x1')},'moduleSearch':{'type':Sequelize[_0x09fd('0x4')](_0x09fd('0x5'),_0x09fd('0x2'),_0x09fd('0x1')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x09fd('0x6')]}}; \ No newline at end of file +var _0x7b3a=['ENUM','contact_lead','contact','sequelize','STRING','lead'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x7b3a,0x93));var _0xa7b3=function(_0x468dbb,_0x1aba59){_0x468dbb=_0x468dbb-0x0;var _0x5796d1=_0x7b3a[_0x468dbb];return _0x5796d1;};'use strict';var Sequelize=require(_0xa7b3('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7b3('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xa7b3('0x2'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xa7b3('0x3')](_0xa7b3('0x4'),_0xa7b3('0x5'),_0xa7b3('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xa7b3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 9b924d7..9052164 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 _0xfab7=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getFields','findOne','ZohoField','getSubjects','hasOwnProperty','getDescriptions','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'];(function(_0x3ce221,_0x22d678){var _0x3995b8=function(_0x4f0a97){while(--_0x4f0a97){_0x3ce221['push'](_0x3ce221['shift']());}};_0x3995b8(++_0x22d678);}(_0xfab7,0x1a1));var _0x7fab=function(_0x1f2f56,_0x1ddfc8){_0x1f2f56=_0x1f2f56-0x0;var _0x30bebc=_0xfab7[_0x1f2f56];return _0x30bebc;};'use strict';var emlformat=require(_0x7fab('0x0'));var rimraf=require(_0x7fab('0x1'));var zipdir=require(_0x7fab('0x2'));var jsonpatch=require(_0x7fab('0x3'));var rp=require(_0x7fab('0x4'));var moment=require(_0x7fab('0x5'));var BPromise=require(_0x7fab('0x6'));var Mustache=require(_0x7fab('0x7'));var util=require(_0x7fab('0x8'));var path=require(_0x7fab('0x9'));var sox=require(_0x7fab('0xa'));var csv=require(_0x7fab('0xb'));var ejs=require(_0x7fab('0xc'));var fs=require('fs');var fs_extra=require(_0x7fab('0xd'));var _=require(_0x7fab('0xe'));var squel=require('squel');var crypto=require(_0x7fab('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7fab('0x10'));var toCsv=require(_0x7fab('0xb'));var querystring=require(_0x7fab('0x11'));var Papa=require(_0x7fab('0x12'));var Redis=require('ioredis');var authService=require(_0x7fab('0x13'));var qs=require(_0x7fab('0x14'));var as=require(_0x7fab('0x15'));var hardwareService=require(_0x7fab('0x16'));var logger=require(_0x7fab('0x17'))(_0x7fab('0x18'));var utils=require(_0x7fab('0x19'));var config=require(_0x7fab('0x1a'));var licenseUtil=require(_0x7fab('0x1b'));var db=require(_0x7fab('0x1c'))['db'];function respondWithStatusCode(_0x24c558,_0x45aa4a){_0x45aa4a=_0x45aa4a||0xcc;return function(_0x2f11a8){if(_0x2f11a8){return _0x24c558[_0x7fab('0x1d')](_0x45aa4a);}return _0x24c558['status'](_0x45aa4a)[_0x7fab('0x1e')]();};}function respondWithResult(_0x1ed935,_0x40d932){_0x40d932=_0x40d932||0xc8;return function(_0x306fdf){if(_0x306fdf){return _0x1ed935[_0x7fab('0x1f')](_0x40d932)[_0x7fab('0x20')](_0x306fdf);}};}function respondWithFilteredResult(_0x2c25ed,_0x5395fd){return function(_0x4bbb75){if(_0x4bbb75){var _0x1bd303=typeof _0x5395fd['offset']===_0x7fab('0x21')&&typeof _0x5395fd[_0x7fab('0x22')]===_0x7fab('0x21');var _0x2c63dd=_0x4bbb75['count'];var _0xa7a631=_0x1bd303?0x0:_0x5395fd[_0x7fab('0x23')];var _0x14b4e5=_0x1bd303?_0x4bbb75['count']:_0x5395fd[_0x7fab('0x23')]+_0x5395fd['limit'];var _0x3cf1ae;if(_0x14b4e5>=_0x2c63dd){_0x14b4e5=_0x2c63dd;_0x3cf1ae=0xc8;}else{_0x3cf1ae=0xce;}_0x2c25ed[_0x7fab('0x1f')](_0x3cf1ae);return _0x2c25ed[_0x7fab('0x24')](_0x7fab('0x25'),_0xa7a631+'-'+_0x14b4e5+'/'+_0x2c63dd)[_0x7fab('0x20')](_0x4bbb75);}return null;};}function patchUpdates(_0x4a898b){return function(_0x16cc43){try{jsonpatch[_0x7fab('0x26')](_0x16cc43,_0x4a898b,!![]);}catch(_0x30ae76){return BPromise[_0x7fab('0x27')](_0x30ae76);}return _0x16cc43[_0x7fab('0x28')]();};}function saveUpdates(_0x284a04,_0x7db87){return function(_0x452d19){if(_0x452d19){return _0x452d19['update'](_0x284a04)['then'](function(_0x5c5f53){return _0x5c5f53;});}return null;};}function removeEntity(_0xeb084d,_0x50e717){return function(_0x521a55){if(_0x521a55){return _0x521a55[_0x7fab('0x29')]()[_0x7fab('0x2a')](function(){_0xeb084d[_0x7fab('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21312a,_0x4af994){return function(_0x3e735c){if(!_0x3e735c){_0x21312a[_0x7fab('0x1d')](0x194);}return _0x3e735c;};}function handleError(_0x231aa7,_0x4e7745){_0x4e7745=_0x4e7745||0x1f4;return function(_0x3efad7){logger[_0x7fab('0x2b')](_0x3efad7[_0x7fab('0x2c')]);if(_0x3efad7[_0x7fab('0x2d')]){delete _0x3efad7[_0x7fab('0x2d')];}_0x231aa7[_0x7fab('0x1f')](_0x4e7745)[_0x7fab('0x2e')](_0x3efad7);};}exports[_0x7fab('0x2f')]=function(_0x26f48a,_0x241627){var _0x4d65df={},_0x1fa1b4={},_0x55cdde={'count':0x0,'rows':[]};var _0xd06217=_[_0x7fab('0x30')](db[_0x7fab('0x31')][_0x7fab('0x32')],function(_0x125f8f){return{'name':_0x125f8f[_0x7fab('0x33')],'type':_0x125f8f['type'][_0x7fab('0x34')]};});_0x1fa1b4[_0x7fab('0x35')]=_['map'](_0xd06217,_0x7fab('0x2d'));_0x1fa1b4[_0x7fab('0x36')]=_['keys'](_0x26f48a['query']);_0x1fa1b4[_0x7fab('0x37')]=_[_0x7fab('0x38')](_0x1fa1b4[_0x7fab('0x35')],_0x1fa1b4[_0x7fab('0x36')]);_0x4d65df[_0x7fab('0x39')]=_[_0x7fab('0x38')](_0x1fa1b4[_0x7fab('0x35')],qs['fields'](_0x26f48a[_0x7fab('0x36')][_0x7fab('0x3a')]));_0x4d65df[_0x7fab('0x39')]=_0x4d65df[_0x7fab('0x39')][_0x7fab('0x3b')]?_0x4d65df[_0x7fab('0x39')]:_0x1fa1b4[_0x7fab('0x35')];if(!_0x26f48a[_0x7fab('0x36')]['hasOwnProperty'](_0x7fab('0x3c'))){_0x4d65df['limit']=qs[_0x7fab('0x22')](_0x26f48a[_0x7fab('0x36')]['limit']);_0x4d65df[_0x7fab('0x23')]=qs[_0x7fab('0x23')](_0x26f48a[_0x7fab('0x36')][_0x7fab('0x23')]);}_0x4d65df[_0x7fab('0x3d')]=qs[_0x7fab('0x3e')](_0x26f48a[_0x7fab('0x36')]['sort']);_0x4d65df['where']=qs[_0x7fab('0x37')](_[_0x7fab('0x3f')](_0x26f48a[_0x7fab('0x36')],_0x1fa1b4['filters']),_0xd06217);if(_0x26f48a['query']['filter']){_0x4d65df[_0x7fab('0x40')]=_[_0x7fab('0x41')](_0x4d65df[_0x7fab('0x40')],{'$or':_[_0x7fab('0x30')](_0xd06217,function(_0x49c4a5){if(_0x49c4a5[_0x7fab('0x42')]!==_0x7fab('0x43')){var _0x468905={};_0x468905[_0x49c4a5['name']]={'$like':'%'+_0x26f48a[_0x7fab('0x36')][_0x7fab('0x44')]+'%'};return _0x468905;}})});}_0x4d65df=_[_0x7fab('0x41')]({},_0x4d65df,_0x26f48a[_0x7fab('0x45')]);var _0x47b3e6={'where':_0x4d65df[_0x7fab('0x40')]};return db[_0x7fab('0x31')][_0x7fab('0x46')](_0x47b3e6)[_0x7fab('0x2a')](function(_0x357186){_0x55cdde[_0x7fab('0x46')]=_0x357186;if(_0x26f48a['query'][_0x7fab('0x47')]){_0x4d65df[_0x7fab('0x48')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x7fab('0x49')](_0x4d65df);})[_0x7fab('0x2a')](function(_0x1f5244){_0x55cdde[_0x7fab('0x4a')]=_0x1f5244;return _0x55cdde;})[_0x7fab('0x2a')](respondWithFilteredResult(_0x241627,_0x4d65df))[_0x7fab('0x4b')](handleError(_0x241627,null));};exports[_0x7fab('0x4c')]=function(_0x3eac83,_0x3dd7ba){var _0x5a62a7={'raw':![],'where':{'id':_0x3eac83[_0x7fab('0x4d')]['id']}},_0x143f1d={};_0x143f1d[_0x7fab('0x35')]=_[_0x7fab('0x4e')](db[_0x7fab('0x31')][_0x7fab('0x32')]);_0x143f1d['query']=_['keys'](_0x3eac83['query']);_0x143f1d[_0x7fab('0x37')]=_['intersection'](_0x143f1d[_0x7fab('0x35')],_0x143f1d['query']);_0x5a62a7['attributes']=_[_0x7fab('0x38')](_0x143f1d[_0x7fab('0x35')],qs[_0x7fab('0x3a')](_0x3eac83[_0x7fab('0x36')][_0x7fab('0x3a')]));_0x5a62a7[_0x7fab('0x39')]=_0x5a62a7[_0x7fab('0x39')][_0x7fab('0x3b')]?_0x5a62a7[_0x7fab('0x39')]:_0x143f1d['model'];if(_0x3eac83['query']['includeAll']){_0x5a62a7[_0x7fab('0x48')]=[{'all':!![]}];}_0x5a62a7=_['merge']({},_0x5a62a7,_0x3eac83[_0x7fab('0x45')]);return db['ZohoConfiguration']['find'](_0x5a62a7)[_0x7fab('0x2a')](handleEntityNotFound(_0x3dd7ba,null))[_0x7fab('0x2a')](respondWithResult(_0x3dd7ba,null))['catch'](handleError(_0x3dd7ba,null));};exports[_0x7fab('0x4f')]=function(_0x1a7fa7,_0xa5899e){return db[_0x7fab('0x31')][_0x7fab('0x4f')](_0x1a7fa7[_0x7fab('0x50')],{})[_0x7fab('0x2a')](respondWithResult(_0xa5899e,0xc9))[_0x7fab('0x4b')](handleError(_0xa5899e,null));};exports['update']=function(_0x4927a8,_0x30c4d4){if(_0x4927a8['body']['id']){delete _0x4927a8[_0x7fab('0x50')]['id'];}return db['ZohoConfiguration'][_0x7fab('0x51')]({'where':{'id':_0x4927a8['params']['id']}})[_0x7fab('0x2a')](handleEntityNotFound(_0x30c4d4,null))[_0x7fab('0x2a')](saveUpdates(_0x4927a8[_0x7fab('0x50')],null))[_0x7fab('0x2a')](respondWithResult(_0x30c4d4,null))[_0x7fab('0x4b')](handleError(_0x30c4d4,null));};exports['destroy']=function(_0x4f5ec3,_0x2c2147){return db['ZohoConfiguration'][_0x7fab('0x51')]({'where':{'id':_0x4f5ec3[_0x7fab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2c2147,null))[_0x7fab('0x2a')](removeEntity(_0x2c2147,null))[_0x7fab('0x4b')](handleError(_0x2c2147,null));};exports[_0x7fab('0x52')]=function(_0x1fae40,_0x6cc1a1,_0x1a46f9){var _0x450d14={};var _0x7eca6f={};var _0x23d330;var _0xf495fa;return db['ZohoConfiguration'][_0x7fab('0x53')]({'where':{'id':_0x1fae40[_0x7fab('0x4d')]['id']}})[_0x7fab('0x2a')](handleEntityNotFound(_0x6cc1a1,null))[_0x7fab('0x2a')](function(_0x20fa3f){if(_0x20fa3f){_0x23d330=_0x20fa3f;_0x7eca6f[_0x7fab('0x35')]=_[_0x7fab('0x4e')](db[_0x7fab('0x54')]['rawAttributes']);_0x7eca6f[_0x7fab('0x36')]=_[_0x7fab('0x4e')](_0x1fae40[_0x7fab('0x36')]);_0x7eca6f[_0x7fab('0x37')]=_[_0x7fab('0x38')](_0x7eca6f[_0x7fab('0x35')],_0x7eca6f[_0x7fab('0x36')]);_0x450d14[_0x7fab('0x39')]=_['intersection'](_0x7eca6f['model'],qs[_0x7fab('0x3a')](_0x1fae40[_0x7fab('0x36')][_0x7fab('0x3a')]));_0x450d14['attributes']=_0x450d14[_0x7fab('0x39')][_0x7fab('0x3b')]?_0x450d14[_0x7fab('0x39')]:_0x7eca6f[_0x7fab('0x35')];_0x450d14[_0x7fab('0x3d')]=qs[_0x7fab('0x3e')](_0x1fae40['query'][_0x7fab('0x3e')]);_0x450d14[_0x7fab('0x40')]=qs[_0x7fab('0x37')](_[_0x7fab('0x3f')](_0x1fae40[_0x7fab('0x36')],_0x7eca6f[_0x7fab('0x37')]));if(_0x1fae40[_0x7fab('0x36')]['filter']){_0x450d14[_0x7fab('0x40')]=_['merge'](_0x450d14[_0x7fab('0x40')],{'$or':_[_0x7fab('0x30')](_0x450d14[_0x7fab('0x39')],function(_0x406b3d){var _0x19725b={};_0x19725b[_0x406b3d]={'$like':'%'+_0x1fae40['query']['filter']+'%'};return _0x19725b;})});}_0x450d14=_[_0x7fab('0x41')]({},_0x450d14,_0x1fae40[_0x7fab('0x45')]);return _0x23d330['getFields'](_0x450d14);}})['then'](function(_0x7b2acc){if(_0x7b2acc){_0xf495fa=_0x7b2acc['length'];if(!_0x1fae40[_0x7fab('0x36')]['hasOwnProperty'](_0x7fab('0x3c'))){_0x450d14[_0x7fab('0x22')]=qs['limit'](_0x1fae40['query'][_0x7fab('0x22')]);_0x450d14[_0x7fab('0x23')]=qs[_0x7fab('0x23')](_0x1fae40[_0x7fab('0x36')][_0x7fab('0x23')]);}return _0x23d330[_0x7fab('0x52')](_0x450d14);}})[_0x7fab('0x2a')](function(_0x1f4dd3){if(_0x1f4dd3){return _0x1f4dd3?{'count':_0xf495fa,'rows':_0x1f4dd3}:null;}})[_0x7fab('0x2a')](respondWithResult(_0x6cc1a1,null))[_0x7fab('0x4b')](handleError(_0x6cc1a1,null));};exports['getSubjects']=function(_0x3d232c,_0x533943,_0x17a2b8){var _0x4723d6={};var _0x2f8d7a={};var _0x44bfd7;var _0x2cd74c;return db[_0x7fab('0x31')][_0x7fab('0x53')]({'where':{'id':_0x3d232c[_0x7fab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x533943,null))[_0x7fab('0x2a')](function(_0x3712b0){if(_0x3712b0){_0x44bfd7=_0x3712b0;_0x2f8d7a['model']=_['keys'](db[_0x7fab('0x54')][_0x7fab('0x32')]);_0x2f8d7a['query']=_[_0x7fab('0x4e')](_0x3d232c[_0x7fab('0x36')]);_0x2f8d7a['filters']=_['intersection'](_0x2f8d7a['model'],_0x2f8d7a[_0x7fab('0x36')]);_0x4723d6[_0x7fab('0x39')]=_[_0x7fab('0x38')](_0x2f8d7a[_0x7fab('0x35')],qs['fields'](_0x3d232c[_0x7fab('0x36')][_0x7fab('0x3a')]));_0x4723d6[_0x7fab('0x39')]=_0x4723d6[_0x7fab('0x39')][_0x7fab('0x3b')]?_0x4723d6['attributes']:_0x2f8d7a[_0x7fab('0x35')];_0x4723d6[_0x7fab('0x3d')]=qs[_0x7fab('0x3e')](_0x3d232c[_0x7fab('0x36')][_0x7fab('0x3e')]);_0x4723d6[_0x7fab('0x40')]=qs[_0x7fab('0x37')](_['pick'](_0x3d232c[_0x7fab('0x36')],_0x2f8d7a[_0x7fab('0x37')]));if(_0x3d232c['query'][_0x7fab('0x44')]){_0x4723d6[_0x7fab('0x40')]=_[_0x7fab('0x41')](_0x4723d6['where'],{'$or':_['map'](_0x4723d6[_0x7fab('0x39')],function(_0x5cbb7c){var _0x543eba={};_0x543eba[_0x5cbb7c]={'$like':'%'+_0x3d232c['query'][_0x7fab('0x44')]+'%'};return _0x543eba;})});}_0x4723d6=_[_0x7fab('0x41')]({},_0x4723d6,_0x3d232c[_0x7fab('0x45')]);return _0x44bfd7[_0x7fab('0x55')](_0x4723d6);}})[_0x7fab('0x2a')](function(_0x17a08a){if(_0x17a08a){_0x2cd74c=_0x17a08a[_0x7fab('0x3b')];if(!_0x3d232c[_0x7fab('0x36')][_0x7fab('0x56')](_0x7fab('0x3c'))){_0x4723d6[_0x7fab('0x22')]=qs[_0x7fab('0x22')](_0x3d232c[_0x7fab('0x36')][_0x7fab('0x22')]);_0x4723d6[_0x7fab('0x23')]=qs[_0x7fab('0x23')](_0x3d232c[_0x7fab('0x36')]['offset']);}return _0x44bfd7[_0x7fab('0x55')](_0x4723d6);}})[_0x7fab('0x2a')](function(_0x366d48){if(_0x366d48){return _0x366d48?{'count':_0x2cd74c,'rows':_0x366d48}:null;}})['then'](respondWithResult(_0x533943,null))[_0x7fab('0x4b')](handleError(_0x533943,null));};exports['getDescriptions']=function(_0x24f372,_0x3addf2,_0x171b99){var _0x4bb874={};var _0x1afae7={};var _0x3354cf;var _0x31b148;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x24f372[_0x7fab('0x4d')]['id']}})[_0x7fab('0x2a')](handleEntityNotFound(_0x3addf2,null))[_0x7fab('0x2a')](function(_0x3c99ac){if(_0x3c99ac){_0x3354cf=_0x3c99ac;_0x1afae7[_0x7fab('0x35')]=_[_0x7fab('0x4e')](db[_0x7fab('0x54')]['rawAttributes']);_0x1afae7[_0x7fab('0x36')]=_[_0x7fab('0x4e')](_0x24f372['query']);_0x1afae7[_0x7fab('0x37')]=_['intersection'](_0x1afae7[_0x7fab('0x35')],_0x1afae7[_0x7fab('0x36')]);_0x4bb874['attributes']=_['intersection'](_0x1afae7[_0x7fab('0x35')],qs[_0x7fab('0x3a')](_0x24f372[_0x7fab('0x36')]['fields']));_0x4bb874['attributes']=_0x4bb874['attributes'][_0x7fab('0x3b')]?_0x4bb874[_0x7fab('0x39')]:_0x1afae7[_0x7fab('0x35')];_0x4bb874[_0x7fab('0x3d')]=qs[_0x7fab('0x3e')](_0x24f372[_0x7fab('0x36')][_0x7fab('0x3e')]);_0x4bb874[_0x7fab('0x40')]=qs[_0x7fab('0x37')](_['pick'](_0x24f372[_0x7fab('0x36')],_0x1afae7[_0x7fab('0x37')]));if(_0x24f372['query']['filter']){_0x4bb874[_0x7fab('0x40')]=_[_0x7fab('0x41')](_0x4bb874[_0x7fab('0x40')],{'$or':_[_0x7fab('0x30')](_0x4bb874[_0x7fab('0x39')],function(_0x157169){var _0x59f931={};_0x59f931[_0x157169]={'$like':'%'+_0x24f372[_0x7fab('0x36')][_0x7fab('0x44')]+'%'};return _0x59f931;})});}_0x4bb874=_['merge']({},_0x4bb874,_0x24f372['options']);return _0x3354cf['getDescriptions'](_0x4bb874);}})[_0x7fab('0x2a')](function(_0x2d40d4){if(_0x2d40d4){_0x31b148=_0x2d40d4['length'];if(!_0x24f372[_0x7fab('0x36')]['hasOwnProperty'](_0x7fab('0x3c'))){_0x4bb874['limit']=qs[_0x7fab('0x22')](_0x24f372[_0x7fab('0x36')][_0x7fab('0x22')]);_0x4bb874[_0x7fab('0x23')]=qs[_0x7fab('0x23')](_0x24f372[_0x7fab('0x36')]['offset']);}return _0x3354cf[_0x7fab('0x57')](_0x4bb874);}})[_0x7fab('0x2a')](function(_0x363c11){if(_0x363c11){return _0x363c11?{'count':_0x31b148,'rows':_0x363c11}:null;}})[_0x7fab('0x2a')](respondWithResult(_0x3addf2,null))[_0x7fab('0x4b')](handleError(_0x3addf2,null));}; \ No newline at end of file +var _0xd5bd=['length','pick','filter','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getFields','ZohoField'];(function(_0x2743d3,_0x37af6c){var _0x1edbeb=function(_0x12738a){while(--_0x12738a){_0x2743d3['push'](_0x2743d3['shift']());}};_0x1edbeb(++_0x37af6c);}(_0xd5bd,0xf3));var _0xdd5b=function(_0x309e57,_0xe1c277){_0x309e57=_0x309e57-0x0;var _0x313c98=_0xd5bd[_0x309e57];return _0x313c98;};'use strict';var emlformat=require(_0xdd5b('0x0'));var rimraf=require(_0xdd5b('0x1'));var zipdir=require(_0xdd5b('0x2'));var jsonpatch=require(_0xdd5b('0x3'));var rp=require(_0xdd5b('0x4'));var moment=require(_0xdd5b('0x5'));var BPromise=require(_0xdd5b('0x6'));var Mustache=require('mustache');var util=require(_0xdd5b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdd5b('0x8'));var ejs=require(_0xdd5b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd5b('0xa'));var squel=require(_0xdd5b('0xb'));var crypto=require(_0xdd5b('0xc'));var jsforce=require(_0xdd5b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdd5b('0x8'));var querystring=require(_0xdd5b('0xe'));var Papa=require(_0xdd5b('0xf'));var Redis=require(_0xdd5b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd5b('0x11'));var logger=require(_0xdd5b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xdd5b('0x13'));var licenseUtil=require(_0xdd5b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f949,_0x552f93){_0x552f93=_0x552f93||0xcc;return function(_0xd17148){if(_0xd17148){return _0x38f949[_0xdd5b('0x15')](_0x552f93);}return _0x38f949[_0xdd5b('0x16')](_0x552f93)[_0xdd5b('0x17')]();};}function respondWithResult(_0x161d4f,_0x5c7524){_0x5c7524=_0x5c7524||0xc8;return function(_0x145ceb){if(_0x145ceb){return _0x161d4f[_0xdd5b('0x16')](_0x5c7524)[_0xdd5b('0x18')](_0x145ceb);}};}function respondWithFilteredResult(_0x38729e,_0x46d96e){return function(_0xc9787b){if(_0xc9787b){var _0xd060d3=typeof _0x46d96e[_0xdd5b('0x19')]===_0xdd5b('0x1a')&&typeof _0x46d96e[_0xdd5b('0x1b')]===_0xdd5b('0x1a');var _0x9947bd=_0xc9787b[_0xdd5b('0x1c')];var _0x2ca201=_0xd060d3?0x0:_0x46d96e['offset'];var _0x54c0f6=_0xd060d3?_0xc9787b[_0xdd5b('0x1c')]:_0x46d96e['offset']+_0x46d96e[_0xdd5b('0x1b')];var _0x2c32fa;if(_0x54c0f6>=_0x9947bd){_0x54c0f6=_0x9947bd;_0x2c32fa=0xc8;}else{_0x2c32fa=0xce;}_0x38729e[_0xdd5b('0x16')](_0x2c32fa);return _0x38729e[_0xdd5b('0x1d')](_0xdd5b('0x1e'),_0x2ca201+'-'+_0x54c0f6+'/'+_0x9947bd)[_0xdd5b('0x18')](_0xc9787b);}return null;};}function patchUpdates(_0x8ef147){return function(_0x290fe6){try{jsonpatch[_0xdd5b('0x1f')](_0x290fe6,_0x8ef147,!![]);}catch(_0x459576){return BPromise[_0xdd5b('0x20')](_0x459576);}return _0x290fe6[_0xdd5b('0x21')]();};}function saveUpdates(_0x1ba5ba,_0x2efa4f){return function(_0x519aac){if(_0x519aac){return _0x519aac[_0xdd5b('0x22')](_0x1ba5ba)[_0xdd5b('0x23')](function(_0x47caff){return _0x47caff;});}return null;};}function removeEntity(_0x57a688,_0x3866e3){return function(_0x11875d){if(_0x11875d){return _0x11875d[_0xdd5b('0x24')]()['then'](function(){_0x57a688['status'](0xcc)[_0xdd5b('0x17')]();});}};}function handleEntityNotFound(_0x3c2ddb,_0x15b6a9){return function(_0x296932){if(!_0x296932){_0x3c2ddb[_0xdd5b('0x15')](0x194);}return _0x296932;};}function handleError(_0x18c3d2,_0x383990){_0x383990=_0x383990||0x1f4;return function(_0x23a7be){logger['error'](_0x23a7be[_0xdd5b('0x25')]);if(_0x23a7be[_0xdd5b('0x26')]){delete _0x23a7be['name'];}_0x18c3d2[_0xdd5b('0x16')](_0x383990)['send'](_0x23a7be);};}exports[_0xdd5b('0x27')]=function(_0xe032fa,_0x24b598){var _0x43e03c={},_0x1443cf={},_0x486674={'count':0x0,'rows':[]};var _0x59e5a3=_[_0xdd5b('0x28')](db['ZohoConfiguration'][_0xdd5b('0x29')],function(_0xd1246e){return{'name':_0xd1246e[_0xdd5b('0x2a')],'type':_0xd1246e['type'][_0xdd5b('0x2b')]};});_0x1443cf[_0xdd5b('0x2c')]=_[_0xdd5b('0x28')](_0x59e5a3,_0xdd5b('0x26'));_0x1443cf['query']=_['keys'](_0xe032fa[_0xdd5b('0x2d')]);_0x1443cf[_0xdd5b('0x2e')]=_[_0xdd5b('0x2f')](_0x1443cf[_0xdd5b('0x2c')],_0x1443cf['query']);_0x43e03c[_0xdd5b('0x30')]=_[_0xdd5b('0x2f')](_0x1443cf['model'],qs[_0xdd5b('0x31')](_0xe032fa[_0xdd5b('0x2d')][_0xdd5b('0x31')]));_0x43e03c[_0xdd5b('0x30')]=_0x43e03c['attributes']['length']?_0x43e03c[_0xdd5b('0x30')]:_0x1443cf[_0xdd5b('0x2c')];if(!_0xe032fa['query'][_0xdd5b('0x32')](_0xdd5b('0x33'))){_0x43e03c[_0xdd5b('0x1b')]=qs['limit'](_0xe032fa['query'][_0xdd5b('0x1b')]);_0x43e03c[_0xdd5b('0x19')]=qs[_0xdd5b('0x19')](_0xe032fa[_0xdd5b('0x2d')]['offset']);}_0x43e03c[_0xdd5b('0x34')]=qs[_0xdd5b('0x35')](_0xe032fa[_0xdd5b('0x2d')][_0xdd5b('0x35')]);_0x43e03c[_0xdd5b('0x36')]=qs[_0xdd5b('0x2e')](_['pick'](_0xe032fa[_0xdd5b('0x2d')],_0x1443cf[_0xdd5b('0x2e')]),_0x59e5a3);if(_0xe032fa[_0xdd5b('0x2d')]['filter']){_0x43e03c['where']=_[_0xdd5b('0x37')](_0x43e03c[_0xdd5b('0x36')],{'$or':_[_0xdd5b('0x28')](_0x59e5a3,function(_0xdfc438){if(_0xdfc438[_0xdd5b('0x38')]!==_0xdd5b('0x39')){var _0x4cf973={};_0x4cf973[_0xdfc438[_0xdd5b('0x26')]]={'$like':'%'+_0xe032fa[_0xdd5b('0x2d')]['filter']+'%'};return _0x4cf973;}})});}_0x43e03c=_['merge']({},_0x43e03c,_0xe032fa[_0xdd5b('0x3a')]);var _0x554604={'where':_0x43e03c[_0xdd5b('0x36')]};return db[_0xdd5b('0x3b')][_0xdd5b('0x1c')](_0x554604)[_0xdd5b('0x23')](function(_0x2ce2c3){_0x486674[_0xdd5b('0x1c')]=_0x2ce2c3;if(_0xe032fa['query'][_0xdd5b('0x3c')]){_0x43e03c[_0xdd5b('0x3d')]=[{'all':!![]}];}return db[_0xdd5b('0x3b')][_0xdd5b('0x3e')](_0x43e03c);})['then'](function(_0x33009f){_0x486674[_0xdd5b('0x3f')]=_0x33009f;return _0x486674;})['then'](respondWithFilteredResult(_0x24b598,_0x43e03c))[_0xdd5b('0x40')](handleError(_0x24b598,null));};exports[_0xdd5b('0x41')]=function(_0x136f48,_0x35b49d){var _0x326834={'raw':![],'where':{'id':_0x136f48[_0xdd5b('0x42')]['id']}},_0xf8f0c5={};_0xf8f0c5[_0xdd5b('0x2c')]=_[_0xdd5b('0x43')](db[_0xdd5b('0x3b')]['rawAttributes']);_0xf8f0c5[_0xdd5b('0x2d')]=_['keys'](_0x136f48[_0xdd5b('0x2d')]);_0xf8f0c5[_0xdd5b('0x2e')]=_[_0xdd5b('0x2f')](_0xf8f0c5['model'],_0xf8f0c5[_0xdd5b('0x2d')]);_0x326834['attributes']=_[_0xdd5b('0x2f')](_0xf8f0c5[_0xdd5b('0x2c')],qs[_0xdd5b('0x31')](_0x136f48[_0xdd5b('0x2d')][_0xdd5b('0x31')]));_0x326834[_0xdd5b('0x30')]=_0x326834['attributes']['length']?_0x326834['attributes']:_0xf8f0c5[_0xdd5b('0x2c')];if(_0x136f48[_0xdd5b('0x2d')][_0xdd5b('0x3c')]){_0x326834[_0xdd5b('0x3d')]=[{'all':!![]}];}_0x326834=_[_0xdd5b('0x37')]({},_0x326834,_0x136f48['options']);return db[_0xdd5b('0x3b')][_0xdd5b('0x44')](_0x326834)[_0xdd5b('0x23')](handleEntityNotFound(_0x35b49d,null))[_0xdd5b('0x23')](respondWithResult(_0x35b49d,null))['catch'](handleError(_0x35b49d,null));};exports[_0xdd5b('0x45')]=function(_0x527930,_0x57bfc4){return db['ZohoConfiguration'][_0xdd5b('0x45')](_0x527930['body'],{})[_0xdd5b('0x23')](respondWithResult(_0x57bfc4,0xc9))[_0xdd5b('0x40')](handleError(_0x57bfc4,null));};exports[_0xdd5b('0x22')]=function(_0x548f65,_0x363f98){if(_0x548f65[_0xdd5b('0x46')]['id']){delete _0x548f65[_0xdd5b('0x46')]['id'];}return db[_0xdd5b('0x3b')][_0xdd5b('0x44')]({'where':{'id':_0x548f65[_0xdd5b('0x42')]['id']}})[_0xdd5b('0x23')](handleEntityNotFound(_0x363f98,null))['then'](saveUpdates(_0x548f65[_0xdd5b('0x46')],null))[_0xdd5b('0x23')](respondWithResult(_0x363f98,null))['catch'](handleError(_0x363f98,null));};exports[_0xdd5b('0x24')]=function(_0x2941ba,_0x350eb0){return db['ZohoConfiguration'][_0xdd5b('0x44')]({'where':{'id':_0x2941ba['params']['id']}})[_0xdd5b('0x23')](handleEntityNotFound(_0x350eb0,null))[_0xdd5b('0x23')](removeEntity(_0x350eb0,null))[_0xdd5b('0x40')](handleError(_0x350eb0,null));};exports[_0xdd5b('0x47')]=function(_0x402401,_0x32717f,_0x14ab0f){var _0x350b09={};var _0x135d0e={};var _0x4ac813;var _0x610536;return db[_0xdd5b('0x3b')]['findOne']({'where':{'id':_0x402401[_0xdd5b('0x42')]['id']}})[_0xdd5b('0x23')](handleEntityNotFound(_0x32717f,null))[_0xdd5b('0x23')](function(_0x740db1){if(_0x740db1){_0x4ac813=_0x740db1;_0x135d0e[_0xdd5b('0x2c')]=_['keys'](db[_0xdd5b('0x48')][_0xdd5b('0x29')]);_0x135d0e['query']=_[_0xdd5b('0x43')](_0x402401[_0xdd5b('0x2d')]);_0x135d0e['filters']=_[_0xdd5b('0x2f')](_0x135d0e[_0xdd5b('0x2c')],_0x135d0e[_0xdd5b('0x2d')]);_0x350b09[_0xdd5b('0x30')]=_['intersection'](_0x135d0e[_0xdd5b('0x2c')],qs['fields'](_0x402401[_0xdd5b('0x2d')][_0xdd5b('0x31')]));_0x350b09[_0xdd5b('0x30')]=_0x350b09[_0xdd5b('0x30')][_0xdd5b('0x49')]?_0x350b09[_0xdd5b('0x30')]:_0x135d0e[_0xdd5b('0x2c')];_0x350b09[_0xdd5b('0x34')]=qs[_0xdd5b('0x35')](_0x402401[_0xdd5b('0x2d')][_0xdd5b('0x35')]);_0x350b09[_0xdd5b('0x36')]=qs[_0xdd5b('0x2e')](_[_0xdd5b('0x4a')](_0x402401[_0xdd5b('0x2d')],_0x135d0e['filters']));if(_0x402401[_0xdd5b('0x2d')][_0xdd5b('0x4b')]){_0x350b09[_0xdd5b('0x36')]=_[_0xdd5b('0x37')](_0x350b09[_0xdd5b('0x36')],{'$or':_[_0xdd5b('0x28')](_0x350b09[_0xdd5b('0x30')],function(_0x43aace){var _0x9f13a7={};_0x9f13a7[_0x43aace]={'$like':'%'+_0x402401[_0xdd5b('0x2d')]['filter']+'%'};return _0x9f13a7;})});}_0x350b09=_[_0xdd5b('0x37')]({},_0x350b09,_0x402401['options']);return _0x4ac813[_0xdd5b('0x47')](_0x350b09);}})[_0xdd5b('0x23')](function(_0x279077){if(_0x279077){_0x610536=_0x279077[_0xdd5b('0x49')];if(!_0x402401[_0xdd5b('0x2d')]['hasOwnProperty'](_0xdd5b('0x33'))){_0x350b09[_0xdd5b('0x1b')]=qs[_0xdd5b('0x1b')](_0x402401[_0xdd5b('0x2d')][_0xdd5b('0x1b')]);_0x350b09[_0xdd5b('0x19')]=qs[_0xdd5b('0x19')](_0x402401[_0xdd5b('0x2d')][_0xdd5b('0x19')]);}return _0x4ac813[_0xdd5b('0x47')](_0x350b09);}})[_0xdd5b('0x23')](function(_0x24f5a1){if(_0x24f5a1){return _0x24f5a1?{'count':_0x610536,'rows':_0x24f5a1}:null;}})[_0xdd5b('0x23')](respondWithResult(_0x32717f,null))[_0xdd5b('0x40')](handleError(_0x32717f,null));};exports[_0xdd5b('0x4c')]=function(_0x4351d2,_0x2dadb4,_0x2aa10c){var _0x34465a={};var _0x5c9222={};var _0x1e8857;var _0x207a85;return db[_0xdd5b('0x3b')]['findOne']({'where':{'id':_0x4351d2[_0xdd5b('0x42')]['id']}})[_0xdd5b('0x23')](handleEntityNotFound(_0x2dadb4,null))[_0xdd5b('0x23')](function(_0x595793){if(_0x595793){_0x1e8857=_0x595793;_0x5c9222[_0xdd5b('0x2c')]=_[_0xdd5b('0x43')](db['ZohoField']['rawAttributes']);_0x5c9222[_0xdd5b('0x2d')]=_[_0xdd5b('0x43')](_0x4351d2[_0xdd5b('0x2d')]);_0x5c9222['filters']=_['intersection'](_0x5c9222[_0xdd5b('0x2c')],_0x5c9222[_0xdd5b('0x2d')]);_0x34465a[_0xdd5b('0x30')]=_[_0xdd5b('0x2f')](_0x5c9222['model'],qs['fields'](_0x4351d2['query'][_0xdd5b('0x31')]));_0x34465a[_0xdd5b('0x30')]=_0x34465a[_0xdd5b('0x30')][_0xdd5b('0x49')]?_0x34465a[_0xdd5b('0x30')]:_0x5c9222[_0xdd5b('0x2c')];_0x34465a[_0xdd5b('0x34')]=qs[_0xdd5b('0x35')](_0x4351d2[_0xdd5b('0x2d')][_0xdd5b('0x35')]);_0x34465a[_0xdd5b('0x36')]=qs[_0xdd5b('0x2e')](_[_0xdd5b('0x4a')](_0x4351d2['query'],_0x5c9222[_0xdd5b('0x2e')]));if(_0x4351d2[_0xdd5b('0x2d')][_0xdd5b('0x4b')]){_0x34465a['where']=_[_0xdd5b('0x37')](_0x34465a[_0xdd5b('0x36')],{'$or':_['map'](_0x34465a[_0xdd5b('0x30')],function(_0x40d6ef){var _0x157dad={};_0x157dad[_0x40d6ef]={'$like':'%'+_0x4351d2[_0xdd5b('0x2d')][_0xdd5b('0x4b')]+'%'};return _0x157dad;})});}_0x34465a=_['merge']({},_0x34465a,_0x4351d2[_0xdd5b('0x3a')]);return _0x1e8857[_0xdd5b('0x4c')](_0x34465a);}})[_0xdd5b('0x23')](function(_0x3c741e){if(_0x3c741e){_0x207a85=_0x3c741e[_0xdd5b('0x49')];if(!_0x4351d2[_0xdd5b('0x2d')][_0xdd5b('0x32')](_0xdd5b('0x33'))){_0x34465a[_0xdd5b('0x1b')]=qs['limit'](_0x4351d2['query']['limit']);_0x34465a['offset']=qs[_0xdd5b('0x19')](_0x4351d2[_0xdd5b('0x2d')][_0xdd5b('0x19')]);}return _0x1e8857['getSubjects'](_0x34465a);}})[_0xdd5b('0x23')](function(_0x260f59){if(_0x260f59){return _0x260f59?{'count':_0x207a85,'rows':_0x260f59}:null;}})[_0xdd5b('0x23')](respondWithResult(_0x2dadb4,null))[_0xdd5b('0x40')](handleError(_0x2dadb4,null));};exports[_0xdd5b('0x4d')]=function(_0x1a1f8b,_0x2b0396,_0x47acde){var _0x148dea={};var _0x2bb014={};var _0x4819e9;var _0x505983;return db[_0xdd5b('0x3b')][_0xdd5b('0x4e')]({'where':{'id':_0x1a1f8b[_0xdd5b('0x42')]['id']}})[_0xdd5b('0x23')](handleEntityNotFound(_0x2b0396,null))[_0xdd5b('0x23')](function(_0x452948){if(_0x452948){_0x4819e9=_0x452948;_0x2bb014['model']=_[_0xdd5b('0x43')](db['ZohoField'][_0xdd5b('0x29')]);_0x2bb014[_0xdd5b('0x2d')]=_['keys'](_0x1a1f8b[_0xdd5b('0x2d')]);_0x2bb014['filters']=_[_0xdd5b('0x2f')](_0x2bb014[_0xdd5b('0x2c')],_0x2bb014[_0xdd5b('0x2d')]);_0x148dea[_0xdd5b('0x30')]=_[_0xdd5b('0x2f')](_0x2bb014[_0xdd5b('0x2c')],qs[_0xdd5b('0x31')](_0x1a1f8b[_0xdd5b('0x2d')]['fields']));_0x148dea['attributes']=_0x148dea[_0xdd5b('0x30')][_0xdd5b('0x49')]?_0x148dea[_0xdd5b('0x30')]:_0x2bb014[_0xdd5b('0x2c')];_0x148dea[_0xdd5b('0x34')]=qs['sort'](_0x1a1f8b[_0xdd5b('0x2d')][_0xdd5b('0x35')]);_0x148dea[_0xdd5b('0x36')]=qs[_0xdd5b('0x2e')](_[_0xdd5b('0x4a')](_0x1a1f8b['query'],_0x2bb014[_0xdd5b('0x2e')]));if(_0x1a1f8b[_0xdd5b('0x2d')][_0xdd5b('0x4b')]){_0x148dea[_0xdd5b('0x36')]=_[_0xdd5b('0x37')](_0x148dea[_0xdd5b('0x36')],{'$or':_['map'](_0x148dea[_0xdd5b('0x30')],function(_0x18ccf7){var _0x482f54={};_0x482f54[_0x18ccf7]={'$like':'%'+_0x1a1f8b[_0xdd5b('0x2d')][_0xdd5b('0x4b')]+'%'};return _0x482f54;})});}_0x148dea=_['merge']({},_0x148dea,_0x1a1f8b[_0xdd5b('0x3a')]);return _0x4819e9[_0xdd5b('0x4d')](_0x148dea);}})[_0xdd5b('0x23')](function(_0x1ce0ea){if(_0x1ce0ea){_0x505983=_0x1ce0ea[_0xdd5b('0x49')];if(!_0x1a1f8b[_0xdd5b('0x2d')][_0xdd5b('0x32')](_0xdd5b('0x33'))){_0x148dea['limit']=qs['limit'](_0x1a1f8b[_0xdd5b('0x2d')][_0xdd5b('0x1b')]);_0x148dea[_0xdd5b('0x19')]=qs[_0xdd5b('0x19')](_0x1a1f8b[_0xdd5b('0x2d')][_0xdd5b('0x19')]);}return _0x4819e9[_0xdd5b('0x4d')](_0x148dea);}})[_0xdd5b('0x23')](function(_0x1a12b5){if(_0x1a12b5){return _0x1a12b5?{'count':_0x505983,'rows':_0x1a12b5}:null;}})[_0xdd5b('0x23')](respondWithResult(_0x2b0396,null))[_0xdd5b('0x40')](handleError(_0x2b0396,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 0b3ed1d..0fed43e 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 _0x187f=['moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','define','ZohoConfiguration','lodash','util','../../config/logger','api'];(function(_0x14249f,_0x4a47eb){var _0x1dceca=function(_0x5832d2){while(--_0x5832d2){_0x14249f['push'](_0x14249f['shift']());}};_0x1dceca(++_0x4a47eb);}(_0x187f,0x1e8));var _0xf187=function(_0x5f2e2b,_0xd2f400){_0x5f2e2b=_0x5f2e2b-0x0;var _0x25fd11=_0x187f[_0x5f2e2b];return _0x25fd11;};'use strict';var _=require(_0xf187('0x0'));var util=require(_0xf187('0x1'));var logger=require(_0xf187('0x2'))(_0xf187('0x3'));var moment=require(_0xf187('0x4'));var BPromise=require(_0xf187('0x5'));var rp=require(_0xf187('0x6'));var fs=require('fs');var path=require(_0xf187('0x7'));var rimraf=require(_0xf187('0x8'));var config=require('../../config/environment');var attributes=require(_0xf187('0x9'));module['exports']=function(_0x5b75a0,_0x1cd229){return _0x5b75a0[_0xf187('0xa')](_0xf187('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc619=['exports','define','int_zoho_configurations','../../config/logger','api','request-promise','path','rimraf','./intZohoConfiguration.attributes'];(function(_0x43044e,_0x5725d6){var _0x1c6b54=function(_0x5d1a1b){while(--_0x5d1a1b){_0x43044e['push'](_0x43044e['shift']());}};_0x1c6b54(++_0x5725d6);}(_0xc619,0x150));var _0x9c61=function(_0x55e149,_0x9c8d11){_0x55e149=_0x55e149-0x0;var _0x1a3d5f=_0xc619[_0x55e149];return _0x1a3d5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9c61('0x0'))(_0x9c61('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9c61('0x2'));var fs=require('fs');var path=require(_0x9c61('0x3'));var rimraf=require(_0x9c61('0x4'));var config=require('../../config/environment');var attributes=require(_0x9c61('0x5'));module[_0x9c61('0x6')]=function(_0x284553,_0x34fa49){return _0x284553[_0x9c61('0x7')]('ZohoConfiguration',attributes,{'tableName':_0x9c61('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index fb087c5..ed14862 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 _0x2543=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x2543,0x131));var _0x3254=function(_0x4ec42,_0x36177b){_0x4ec42=_0x4ec42-0x0;var _0x385e11=_0x2543[_0x4ec42];return _0x385e11;};'use strict';var _=require(_0x3254('0x0'));var util=require(_0x3254('0x1'));var moment=require(_0x3254('0x2'));var BPromise=require(_0x3254('0x3'));var rs=require(_0x3254('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3254('0x5'))['db'];var utils=require(_0x3254('0x6'));var logger=require('../../config/logger')(_0x3254('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3254('0x8')][_0x3254('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31f900,_0x1cb0fb,_0x174c65){return new BPromise(function(_0x15a902,_0x3464a0){return client[_0x3254('0xa')](_0x31f900,_0x174c65)[_0x3254('0xb')](function(_0x4d1e2d){logger[_0x3254('0xc')](_0x3254('0xd'),_0x1cb0fb,_0x3254('0xe'));logger[_0x3254('0xf')](_0x3254('0x10'),_0x1cb0fb,'request\x20sent',JSON[_0x3254('0x11')](_0x4d1e2d));if(_0x4d1e2d[_0x3254('0x12')]){if(_0x4d1e2d[_0x3254('0x12')][_0x3254('0x13')]===0x1f4){logger[_0x3254('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x1cb0fb,_0x4d1e2d[_0x3254('0x12')][_0x3254('0x14')]);return _0x3464a0(_0x4d1e2d['error'][_0x3254('0x14')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x1cb0fb,_0x4d1e2d[_0x3254('0x12')][_0x3254('0x14')]);return _0x15a902(_0x4d1e2d[_0x3254('0x12')][_0x3254('0x14')]);}else{logger[_0x3254('0xc')](_0x3254('0xd'),_0x1cb0fb,_0x3254('0xe'));_0x15a902(_0x4d1e2d['result'][_0x3254('0x14')]);}})[_0x3254('0x15')](function(_0x3909b6){logger[_0x3254('0x12')](_0x3254('0xd'),_0x1cb0fb,_0x3909b6);_0x3464a0(_0x3909b6);});});} \ No newline at end of file +var _0xe665=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xe665,0x17d));var _0x5e66=function(_0x122d08,_0x3376c5){_0x122d08=_0x122d08-0x0;var _0x1013a8=_0xe665[_0x122d08];return _0x1013a8;};'use strict';var _=require(_0x5e66('0x0'));var util=require(_0x5e66('0x1'));var moment=require(_0x5e66('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e66('0x3'))['db'];var utils=require(_0x5e66('0x4'));var logger=require(_0x5e66('0x5'))(_0x5e66('0x6'));var config=require(_0x5e66('0x7'));var jayson=require(_0x5e66('0x8'));var client=jayson[_0x5e66('0x9')][_0x5e66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b357d,_0xe475da,_0x26cbd3){return new BPromise(function(_0x2d2978,_0x45e5c6){return client[_0x5e66('0xb')](_0x4b357d,_0x26cbd3)[_0x5e66('0xc')](function(_0x486337){logger[_0x5e66('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0xe475da,_0x5e66('0xe'));logger[_0x5e66('0xf')](_0x5e66('0x10'),_0xe475da,_0x5e66('0xe'),JSON[_0x5e66('0x11')](_0x486337));if(_0x486337['error']){if(_0x486337['error'][_0x5e66('0x12')]===0x1f4){logger[_0x5e66('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0xe475da,_0x486337[_0x5e66('0x13')][_0x5e66('0x14')]);return _0x45e5c6(_0x486337[_0x5e66('0x13')][_0x5e66('0x14')]);}logger[_0x5e66('0x13')](_0x5e66('0x15'),_0xe475da,_0x486337[_0x5e66('0x13')][_0x5e66('0x14')]);return _0x2d2978(_0x486337[_0x5e66('0x13')][_0x5e66('0x14')]);}else{logger[_0x5e66('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0xe475da,_0x5e66('0xe'));_0x2d2978(_0x486337[_0x5e66('0x16')][_0x5e66('0x14')]);}})[_0x5e66('0x17')](function(_0x4bf42b){logger[_0x5e66('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0xe475da,_0x4bf42b);_0x45e5c6(_0x4bf42b);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 38c5dcd..8974d56 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 _0xd893=['util','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x4f9eab,_0x43a872){var _0xda74b5=function(_0x2399bd){while(--_0x2399bd){_0x4f9eab['push'](_0x4f9eab['shift']());}};_0xda74b5(++_0x43a872);}(_0xd893,0xa0));var _0x3d89=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd893[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x3d89('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3d89('0x1'));var router=express[_0x3d89('0x2')]();var fs_extra=require(_0x3d89('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3d89('0x4'));var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0x3d89('0x5')]('/',auth[_0x3d89('0x6')](),controller[_0x3d89('0x7')]);router[_0x3d89('0x5')](_0x3d89('0x8'),auth[_0x3d89('0x6')](),controller[_0x3d89('0x9')]);router[_0x3d89('0xa')]('/',auth['isAuthenticated'](),controller[_0x3d89('0xb')]);router[_0x3d89('0xc')](_0x3d89('0x8'),auth[_0x3d89('0x6')](),controller[_0x3d89('0xd')]);router['delete'](_0x3d89('0x8'),auth['isAuthenticated'](),controller[_0x3d89('0xe')]);module[_0x3d89('0xf')]=router; \ No newline at end of file +var _0xbc1a=['show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated'];(function(_0x5bdcaa,_0x99659e){var _0x38001d=function(_0x81ef11){while(--_0x81ef11){_0x5bdcaa['push'](_0x5bdcaa['shift']());}};_0x38001d(++_0x99659e);}(_0xbc1a,0x138));var _0xabc1=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xbc1a[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0xabc1('0x0'));var util=require(_0xabc1('0x1'));var path=require(_0xabc1('0x2'));var timeout=require(_0xabc1('0x3'));var express=require('express');var router=express[_0xabc1('0x4')]();var fs_extra=require(_0xabc1('0x5'));var auth=require(_0xabc1('0x6'));var interaction=require(_0xabc1('0x7'));var config=require('../../config/environment');var controller=require(_0xabc1('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xabc1('0x9')]('/:id',auth[_0xabc1('0xa')](),controller[_0xabc1('0xb')]);router[_0xabc1('0xc')]('/',auth[_0xabc1('0xa')](),controller['create']);router[_0xabc1('0xd')](_0xabc1('0xe'),auth[_0xabc1('0xa')](),controller[_0xabc1('0xf')]);router[_0xabc1('0x10')](_0xabc1('0xe'),auth[_0xabc1('0xa')](),controller[_0xabc1('0x11')]);module[_0xabc1('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 1bc20a0..f02126e 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 _0x6b73=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x4db291,_0x347e80){var _0x345a5b=function(_0x4488e9){while(--_0x4488e9){_0x4db291['push'](_0x4db291['shift']());}};_0x345a5b(++_0x347e80);}(_0x6b73,0x1f4));var _0x36b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b73[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x36b7('0x0'));module['exports']={'type':{'type':Sequelize[_0x36b7('0x1')](_0x36b7('0x2'),_0x36b7('0x3'),_0x36b7('0x4'),_0x36b7('0x5'),_0x36b7('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x36b7('0x7')]},'keyType':{'type':Sequelize[_0x36b7('0x1')](_0x36b7('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x36b7('0x7')]},'idField':{'type':Sequelize[_0x36b7('0x7')]},'nameField':{'type':Sequelize[_0x36b7('0x7')]},'customField':{'type':Sequelize[_0x36b7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x36b7('0x7')]}}; \ No newline at end of file +var _0xeb8c=['string','variable','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x5e79e1,_0x45b5fb){var _0x3afa21=function(_0xefe8f2){while(--_0xefe8f2){_0x5e79e1['push'](_0x5e79e1['shift']());}};_0x3afa21(++_0x45b5fb);}(_0xeb8c,0xf3));var _0xceb8=function(_0x3af573,_0xfd7182){_0x3af573=_0x3af573-0x0;var _0x20406c=_0xeb8c[_0x3af573];return _0x20406c;};'use strict';var Sequelize=require(_0xceb8('0x0'));module['exports']={'type':{'type':Sequelize[_0xceb8('0x1')](_0xceb8('0x2'),_0xceb8('0x3'),'customVariable','keyValue',_0xceb8('0x4')),'defaultValue':_0xceb8('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xceb8('0x5')]},'idField':{'type':Sequelize[_0xceb8('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xceb8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xceb8('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index c7ad150..45feb51 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 _0x80f2=['hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoField','count','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x80f2,0xf8));var _0x280f=function(_0x31a6b8,_0x51ec83){_0x31a6b8=_0x31a6b8-0x0;var _0x4d7526=_0x80f2[_0x31a6b8];return _0x4d7526;};'use strict';var emlformat=require(_0x280f('0x0'));var rimraf=require(_0x280f('0x1'));var zipdir=require(_0x280f('0x2'));var jsonpatch=require(_0x280f('0x3'));var rp=require('request-promise');var moment=require(_0x280f('0x4'));var BPromise=require(_0x280f('0x5'));var Mustache=require(_0x280f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x280f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x280f('0x8'));var jsforce=require(_0x280f('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x280f('0xa'));var querystring=require('querystring');var Papa=require(_0x280f('0xb'));var Redis=require('ioredis');var authService=require(_0x280f('0xc'));var qs=require(_0x280f('0xd'));var as=require(_0x280f('0xe'));var hardwareService=require(_0x280f('0xf'));var logger=require(_0x280f('0x10'))(_0x280f('0x11'));var utils=require(_0x280f('0x12'));var config=require(_0x280f('0x13'));var licenseUtil=require(_0x280f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4917c7,_0x21d85a){_0x21d85a=_0x21d85a||0xcc;return function(_0x443472){if(_0x443472){return _0x4917c7[_0x280f('0x15')](_0x21d85a);}return _0x4917c7['status'](_0x21d85a)[_0x280f('0x16')]();};}function respondWithResult(_0x1c8aeb,_0x1064ab){_0x1064ab=_0x1064ab||0xc8;return function(_0x2d03fe){if(_0x2d03fe){return _0x1c8aeb[_0x280f('0x17')](_0x1064ab)[_0x280f('0x18')](_0x2d03fe);}};}function respondWithFilteredResult(_0x687032,_0x47e4c6){return function(_0x12d65a){if(_0x12d65a){var _0x178302=typeof _0x47e4c6[_0x280f('0x19')]===_0x280f('0x1a')&&typeof _0x47e4c6[_0x280f('0x1b')]===_0x280f('0x1a');var _0x647e58=_0x12d65a['count'];var _0x1f5d41=_0x178302?0x0:_0x47e4c6['offset'];var _0x154606=_0x178302?_0x12d65a['count']:_0x47e4c6[_0x280f('0x19')]+_0x47e4c6['limit'];var _0x49d722;if(_0x154606>=_0x647e58){_0x154606=_0x647e58;_0x49d722=0xc8;}else{_0x49d722=0xce;}_0x687032[_0x280f('0x17')](_0x49d722);return _0x687032[_0x280f('0x1c')](_0x280f('0x1d'),_0x1f5d41+'-'+_0x154606+'/'+_0x647e58)['json'](_0x12d65a);}return null;};}function patchUpdates(_0x161486){return function(_0x475a24){try{jsonpatch[_0x280f('0x1e')](_0x475a24,_0x161486,!![]);}catch(_0x40810b){return BPromise[_0x280f('0x1f')](_0x40810b);}return _0x475a24[_0x280f('0x20')]();};}function saveUpdates(_0x47a701,_0x1fce31){return function(_0x31fcc7){if(_0x31fcc7){return _0x31fcc7[_0x280f('0x21')](_0x47a701)['then'](function(_0x10c4fa){return _0x10c4fa;});}return null;};}function removeEntity(_0x3c76ae,_0x1b7d5f){return function(_0x43ef4f){if(_0x43ef4f){return _0x43ef4f[_0x280f('0x22')]()[_0x280f('0x23')](function(){_0x3c76ae[_0x280f('0x17')](0xcc)[_0x280f('0x16')]();});}};}function handleEntityNotFound(_0x530bb6,_0x3e9e99){return function(_0x4a3fb6){if(!_0x4a3fb6){_0x530bb6[_0x280f('0x15')](0x194);}return _0x4a3fb6;};}function handleError(_0x5f5582,_0x314917){_0x314917=_0x314917||0x1f4;return function(_0x472447){logger[_0x280f('0x24')](_0x472447[_0x280f('0x25')]);if(_0x472447['name']){delete _0x472447[_0x280f('0x26')];}_0x5f5582[_0x280f('0x17')](_0x314917)[_0x280f('0x27')](_0x472447);};}exports[_0x280f('0x28')]=function(_0x5f3de4,_0x3968db){var _0xfaeb35={},_0x556cf0={},_0x5bc6d0={'count':0x0,'rows':[]};var _0x2d7fb0=_[_0x280f('0x29')](db['ZohoField'][_0x280f('0x2a')],function(_0x46f39d){return{'name':_0x46f39d['fieldName'],'type':_0x46f39d[_0x280f('0x2b')][_0x280f('0x2c')]};});_0x556cf0['model']=_['map'](_0x2d7fb0,_0x280f('0x26'));_0x556cf0[_0x280f('0x2d')]=_['keys'](_0x5f3de4[_0x280f('0x2d')]);_0x556cf0[_0x280f('0x2e')]=_[_0x280f('0x2f')](_0x556cf0[_0x280f('0x30')],_0x556cf0[_0x280f('0x2d')]);_0xfaeb35[_0x280f('0x31')]=_['intersection'](_0x556cf0[_0x280f('0x30')],qs[_0x280f('0x32')](_0x5f3de4[_0x280f('0x2d')][_0x280f('0x32')]));_0xfaeb35[_0x280f('0x31')]=_0xfaeb35[_0x280f('0x31')][_0x280f('0x33')]?_0xfaeb35[_0x280f('0x31')]:_0x556cf0['model'];if(!_0x5f3de4[_0x280f('0x2d')][_0x280f('0x34')](_0x280f('0x35'))){_0xfaeb35[_0x280f('0x1b')]=qs['limit'](_0x5f3de4[_0x280f('0x2d')]['limit']);_0xfaeb35[_0x280f('0x19')]=qs[_0x280f('0x19')](_0x5f3de4[_0x280f('0x2d')]['offset']);}_0xfaeb35[_0x280f('0x36')]=qs[_0x280f('0x37')](_0x5f3de4[_0x280f('0x2d')][_0x280f('0x37')]);_0xfaeb35['where']=qs[_0x280f('0x2e')](_[_0x280f('0x38')](_0x5f3de4[_0x280f('0x2d')],_0x556cf0[_0x280f('0x2e')]),_0x2d7fb0);if(_0x5f3de4[_0x280f('0x2d')][_0x280f('0x39')]){_0xfaeb35[_0x280f('0x3a')]=_[_0x280f('0x3b')](_0xfaeb35[_0x280f('0x3a')],{'$or':_[_0x280f('0x29')](_0x2d7fb0,function(_0x5857ca){if(_0x5857ca[_0x280f('0x2b')]!==_0x280f('0x3c')){var _0x19f2bb={};_0x19f2bb[_0x5857ca[_0x280f('0x26')]]={'$like':'%'+_0x5f3de4[_0x280f('0x2d')][_0x280f('0x39')]+'%'};return _0x19f2bb;}})});}_0xfaeb35=_[_0x280f('0x3b')]({},_0xfaeb35,_0x5f3de4[_0x280f('0x3d')]);var _0x260e48={'where':_0xfaeb35[_0x280f('0x3a')]};return db[_0x280f('0x3e')][_0x280f('0x3f')](_0x260e48)[_0x280f('0x23')](function(_0x30416c){_0x5bc6d0['count']=_0x30416c;if(_0x5f3de4[_0x280f('0x2d')][_0x280f('0x40')]){_0xfaeb35[_0x280f('0x41')]=[{'all':!![]}];}return db[_0x280f('0x3e')][_0x280f('0x42')](_0xfaeb35);})[_0x280f('0x23')](function(_0x5d8038){_0x5bc6d0[_0x280f('0x43')]=_0x5d8038;return _0x5bc6d0;})[_0x280f('0x23')](respondWithFilteredResult(_0x3968db,_0xfaeb35))[_0x280f('0x44')](handleError(_0x3968db,null));};exports[_0x280f('0x45')]=function(_0x41dea4,_0x1d2bb1){var _0x2305ed={'raw':!![],'where':{'id':_0x41dea4[_0x280f('0x46')]['id']}},_0x1bbc02={};_0x1bbc02[_0x280f('0x30')]=_[_0x280f('0x47')](db[_0x280f('0x3e')]['rawAttributes']);_0x1bbc02[_0x280f('0x2d')]=_[_0x280f('0x47')](_0x41dea4[_0x280f('0x2d')]);_0x1bbc02[_0x280f('0x2e')]=_['intersection'](_0x1bbc02['model'],_0x1bbc02[_0x280f('0x2d')]);_0x2305ed[_0x280f('0x31')]=_[_0x280f('0x2f')](_0x1bbc02[_0x280f('0x30')],qs[_0x280f('0x32')](_0x41dea4[_0x280f('0x2d')][_0x280f('0x32')]));_0x2305ed[_0x280f('0x31')]=_0x2305ed[_0x280f('0x31')][_0x280f('0x33')]?_0x2305ed[_0x280f('0x31')]:_0x1bbc02[_0x280f('0x30')];if(_0x41dea4[_0x280f('0x2d')][_0x280f('0x40')]){_0x2305ed[_0x280f('0x41')]=[{'all':!![]}];}_0x2305ed=_[_0x280f('0x3b')]({},_0x2305ed,_0x41dea4[_0x280f('0x3d')]);return db[_0x280f('0x3e')]['find'](_0x2305ed)[_0x280f('0x23')](handleEntityNotFound(_0x1d2bb1,null))[_0x280f('0x23')](respondWithResult(_0x1d2bb1,null))[_0x280f('0x44')](handleError(_0x1d2bb1,null));};exports[_0x280f('0x48')]=function(_0x242f49,_0x24b40){return db[_0x280f('0x3e')]['create'](_0x242f49[_0x280f('0x49')],{})[_0x280f('0x23')](respondWithResult(_0x24b40,0xc9))['catch'](handleError(_0x24b40,null));};exports[_0x280f('0x21')]=function(_0x7f759b,_0x3b08ab){if(_0x7f759b['body']['id']){delete _0x7f759b[_0x280f('0x49')]['id'];}return db[_0x280f('0x3e')][_0x280f('0x4a')]({'where':{'id':_0x7f759b['params']['id']}})[_0x280f('0x23')](handleEntityNotFound(_0x3b08ab,null))['then'](saveUpdates(_0x7f759b['body'],null))['then'](respondWithResult(_0x3b08ab,null))[_0x280f('0x44')](handleError(_0x3b08ab,null));};exports[_0x280f('0x22')]=function(_0x43f3d6,_0x4c5164){return db[_0x280f('0x3e')][_0x280f('0x4a')]({'where':{'id':_0x43f3d6[_0x280f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c5164,null))['then'](removeEntity(_0x4c5164,null))['catch'](handleError(_0x4c5164,null));}; \ No newline at end of file +var _0xbaaa=['params','include','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','rows','show'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0xbaaa,0x137));var _0xabaa=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xbaaa[_0x2f45ea];return _0x485a84;};'use strict';var emlformat=require(_0xabaa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabaa('0x1'));var jsonpatch=require(_0xabaa('0x2'));var rp=require(_0xabaa('0x3'));var moment=require('moment');var BPromise=require(_0xabaa('0x4'));var Mustache=require(_0xabaa('0x5'));var util=require(_0xabaa('0x6'));var path=require('path');var sox=require(_0xabaa('0x7'));var csv=require(_0xabaa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabaa('0x9'));var _=require('lodash');var squel=require(_0xabaa('0xa'));var crypto=require(_0xabaa('0xb'));var jsforce=require(_0xabaa('0xc'));var deskjs=require(_0xabaa('0xd'));var toCsv=require(_0xabaa('0x8'));var querystring=require(_0xabaa('0xe'));var Papa=require(_0xabaa('0xf'));var Redis=require(_0xabaa('0x10'));var authService=require(_0xabaa('0x11'));var qs=require(_0xabaa('0x12'));var as=require(_0xabaa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabaa('0x14'))(_0xabaa('0x15'));var utils=require(_0xabaa('0x16'));var config=require(_0xabaa('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x145ecc,_0x3fed03){_0x3fed03=_0x3fed03||0xcc;return function(_0x5c30ca){if(_0x5c30ca){return _0x145ecc[_0xabaa('0x18')](_0x3fed03);}return _0x145ecc['status'](_0x3fed03)[_0xabaa('0x19')]();};}function respondWithResult(_0x3628b4,_0x58389d){_0x58389d=_0x58389d||0xc8;return function(_0x406b53){if(_0x406b53){return _0x3628b4['status'](_0x58389d)[_0xabaa('0x1a')](_0x406b53);}};}function respondWithFilteredResult(_0x2dc59c,_0x38338c){return function(_0x14fbf3){if(_0x14fbf3){var _0x50d120=typeof _0x38338c[_0xabaa('0x1b')]===_0xabaa('0x1c')&&typeof _0x38338c['limit']===_0xabaa('0x1c');var _0x5a9f2e=_0x14fbf3[_0xabaa('0x1d')];var _0x3b2bcf=_0x50d120?0x0:_0x38338c[_0xabaa('0x1b')];var _0x456e48=_0x50d120?_0x14fbf3[_0xabaa('0x1d')]:_0x38338c[_0xabaa('0x1b')]+_0x38338c['limit'];var _0x3335cf;if(_0x456e48>=_0x5a9f2e){_0x456e48=_0x5a9f2e;_0x3335cf=0xc8;}else{_0x3335cf=0xce;}_0x2dc59c[_0xabaa('0x1e')](_0x3335cf);return _0x2dc59c[_0xabaa('0x1f')](_0xabaa('0x20'),_0x3b2bcf+'-'+_0x456e48+'/'+_0x5a9f2e)[_0xabaa('0x1a')](_0x14fbf3);}return null;};}function patchUpdates(_0x21122a){return function(_0x2a1c56){try{jsonpatch[_0xabaa('0x21')](_0x2a1c56,_0x21122a,!![]);}catch(_0x44e33f){return BPromise[_0xabaa('0x22')](_0x44e33f);}return _0x2a1c56[_0xabaa('0x23')]();};}function saveUpdates(_0x466ff1,_0x4fa671){return function(_0x17ffda){if(_0x17ffda){return _0x17ffda[_0xabaa('0x24')](_0x466ff1)[_0xabaa('0x25')](function(_0x5040fc){return _0x5040fc;});}return null;};}function removeEntity(_0x13b2f6,_0x3f5379){return function(_0x117f64){if(_0x117f64){return _0x117f64[_0xabaa('0x26')]()['then'](function(){_0x13b2f6['status'](0xcc)[_0xabaa('0x19')]();});}};}function handleEntityNotFound(_0x5ad9c7,_0x5f3f62){return function(_0x19b745){if(!_0x19b745){_0x5ad9c7[_0xabaa('0x18')](0x194);}return _0x19b745;};}function handleError(_0x94a27f,_0x6c9a13){_0x6c9a13=_0x6c9a13||0x1f4;return function(_0x386ec1){logger[_0xabaa('0x27')](_0x386ec1[_0xabaa('0x28')]);if(_0x386ec1[_0xabaa('0x29')]){delete _0x386ec1[_0xabaa('0x29')];}_0x94a27f[_0xabaa('0x1e')](_0x6c9a13)[_0xabaa('0x2a')](_0x386ec1);};}exports[_0xabaa('0x2b')]=function(_0x2bb8dd,_0x34ceb8){var _0x24c4d8={},_0x57eff4={},_0x556952={'count':0x0,'rows':[]};var _0x431135=_[_0xabaa('0x2c')](db[_0xabaa('0x2d')][_0xabaa('0x2e')],function(_0x499fcc){return{'name':_0x499fcc[_0xabaa('0x2f')],'type':_0x499fcc['type']['key']};});_0x57eff4['model']=_[_0xabaa('0x2c')](_0x431135,_0xabaa('0x29'));_0x57eff4['query']=_[_0xabaa('0x30')](_0x2bb8dd[_0xabaa('0x31')]);_0x57eff4[_0xabaa('0x32')]=_[_0xabaa('0x33')](_0x57eff4[_0xabaa('0x34')],_0x57eff4[_0xabaa('0x31')]);_0x24c4d8[_0xabaa('0x35')]=_[_0xabaa('0x33')](_0x57eff4[_0xabaa('0x34')],qs[_0xabaa('0x36')](_0x2bb8dd[_0xabaa('0x31')][_0xabaa('0x36')]));_0x24c4d8[_0xabaa('0x35')]=_0x24c4d8[_0xabaa('0x35')][_0xabaa('0x37')]?_0x24c4d8['attributes']:_0x57eff4['model'];if(!_0x2bb8dd[_0xabaa('0x31')][_0xabaa('0x38')](_0xabaa('0x39'))){_0x24c4d8['limit']=qs['limit'](_0x2bb8dd[_0xabaa('0x31')][_0xabaa('0x3a')]);_0x24c4d8[_0xabaa('0x1b')]=qs[_0xabaa('0x1b')](_0x2bb8dd[_0xabaa('0x31')][_0xabaa('0x1b')]);}_0x24c4d8['order']=qs[_0xabaa('0x3b')](_0x2bb8dd[_0xabaa('0x31')][_0xabaa('0x3b')]);_0x24c4d8[_0xabaa('0x3c')]=qs['filters'](_[_0xabaa('0x3d')](_0x2bb8dd['query'],_0x57eff4['filters']),_0x431135);if(_0x2bb8dd['query']['filter']){_0x24c4d8[_0xabaa('0x3c')]=_[_0xabaa('0x3e')](_0x24c4d8[_0xabaa('0x3c')],{'$or':_[_0xabaa('0x2c')](_0x431135,function(_0x42ce93){if(_0x42ce93[_0xabaa('0x3f')]!==_0xabaa('0x40')){var _0x59e9c0={};_0x59e9c0[_0x42ce93[_0xabaa('0x29')]]={'$like':'%'+_0x2bb8dd[_0xabaa('0x31')][_0xabaa('0x41')]+'%'};return _0x59e9c0;}})});}_0x24c4d8=_[_0xabaa('0x3e')]({},_0x24c4d8,_0x2bb8dd['options']);var _0x14a45={'where':_0x24c4d8[_0xabaa('0x3c')]};return db[_0xabaa('0x2d')][_0xabaa('0x1d')](_0x14a45)[_0xabaa('0x25')](function(_0x4bdd31){_0x556952[_0xabaa('0x1d')]=_0x4bdd31;if(_0x2bb8dd[_0xabaa('0x31')][_0xabaa('0x42')]){_0x24c4d8['include']=[{'all':!![]}];}return db[_0xabaa('0x2d')]['findAll'](_0x24c4d8);})[_0xabaa('0x25')](function(_0x20a94e){_0x556952[_0xabaa('0x43')]=_0x20a94e;return _0x556952;})[_0xabaa('0x25')](respondWithFilteredResult(_0x34ceb8,_0x24c4d8))['catch'](handleError(_0x34ceb8,null));};exports[_0xabaa('0x44')]=function(_0x3dbcde,_0x3319f2){var _0x17e637={'raw':!![],'where':{'id':_0x3dbcde[_0xabaa('0x45')]['id']}},_0x7371cd={};_0x7371cd[_0xabaa('0x34')]=_[_0xabaa('0x30')](db['ZohoField']['rawAttributes']);_0x7371cd[_0xabaa('0x31')]=_[_0xabaa('0x30')](_0x3dbcde[_0xabaa('0x31')]);_0x7371cd[_0xabaa('0x32')]=_[_0xabaa('0x33')](_0x7371cd[_0xabaa('0x34')],_0x7371cd[_0xabaa('0x31')]);_0x17e637[_0xabaa('0x35')]=_['intersection'](_0x7371cd[_0xabaa('0x34')],qs[_0xabaa('0x36')](_0x3dbcde[_0xabaa('0x31')]['fields']));_0x17e637[_0xabaa('0x35')]=_0x17e637['attributes'][_0xabaa('0x37')]?_0x17e637[_0xabaa('0x35')]:_0x7371cd[_0xabaa('0x34')];if(_0x3dbcde[_0xabaa('0x31')][_0xabaa('0x42')]){_0x17e637[_0xabaa('0x46')]=[{'all':!![]}];}_0x17e637=_[_0xabaa('0x3e')]({},_0x17e637,_0x3dbcde[_0xabaa('0x47')]);return db[_0xabaa('0x2d')][_0xabaa('0x48')](_0x17e637)[_0xabaa('0x25')](handleEntityNotFound(_0x3319f2,null))[_0xabaa('0x25')](respondWithResult(_0x3319f2,null))[_0xabaa('0x49')](handleError(_0x3319f2,null));};exports['create']=function(_0x106ae9,_0x305331){return db['ZohoField'][_0xabaa('0x4a')](_0x106ae9[_0xabaa('0x4b')],{})['then'](respondWithResult(_0x305331,0xc9))[_0xabaa('0x49')](handleError(_0x305331,null));};exports[_0xabaa('0x24')]=function(_0x2fca30,_0x1a0e97){if(_0x2fca30[_0xabaa('0x4b')]['id']){delete _0x2fca30[_0xabaa('0x4b')]['id'];}return db[_0xabaa('0x2d')][_0xabaa('0x48')]({'where':{'id':_0x2fca30['params']['id']}})[_0xabaa('0x25')](handleEntityNotFound(_0x1a0e97,null))['then'](saveUpdates(_0x2fca30[_0xabaa('0x4b')],null))[_0xabaa('0x25')](respondWithResult(_0x1a0e97,null))[_0xabaa('0x49')](handleError(_0x1a0e97,null));};exports[_0xabaa('0x26')]=function(_0x1cf4a7,_0x59b748){return db['ZohoField'][_0xabaa('0x48')]({'where':{'id':_0x1cf4a7['params']['id']}})['then'](handleEntityNotFound(_0x59b748,null))[_0xabaa('0x25')](removeEntity(_0x59b748,null))['catch'](handleError(_0x59b748,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2b1ff6b..0acdfec 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 _0x6050=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','zoho_unique_index','idField','FieldId','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6050,0x196));var _0x0605=function(_0x91123d,_0x5ae04d){_0x91123d=_0x91123d-0x0;var _0x33d970=_0x6050[_0x91123d];return _0x33d970;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0605('0x9'),'fields':[_0x0605('0xa'),_0x0605('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x90b1=['FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','ZohoField','int_zoho_fields','zoho_unique_index','idField'];(function(_0x2b2bf2,_0x9427bc){var _0x16df83=function(_0x459656){while(--_0x459656){_0x2b2bf2['push'](_0x2b2bf2['shift']());}};_0x16df83(++_0x9427bc);}(_0x90b1,0x1bb));var _0x190b=function(_0x101713,_0x5fd5cd){_0x101713=_0x101713-0x0;var _0x22dab7=_0x90b1[_0x101713];return _0x22dab7;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xb'),_0x190b('0xc')],'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 990de97..2f18275 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 _0x61b1=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3bfbe8,_0x207828){var _0x2f00b7=function(_0x48f2d2){while(--_0x48f2d2){_0x3bfbe8['push'](_0x3bfbe8['shift']());}};_0x2f00b7(++_0x207828);}(_0x61b1,0x8a));var _0x161b=function(_0x293631,_0x8a2425){_0x293631=_0x293631-0x0;var _0x14a287=_0x61b1[_0x293631];return _0x14a287;};'use strict';var _=require(_0x161b('0x0'));var util=require(_0x161b('0x1'));var moment=require(_0x161b('0x2'));var BPromise=require(_0x161b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x161b('0x4'));var db=require(_0x161b('0x5'))['db'];var utils=require(_0x161b('0x6'));var logger=require(_0x161b('0x7'))(_0x161b('0x8'));var config=require('../../config/environment');var jayson=require(_0x161b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe274ff,_0x822413,_0xf3b09c){return new BPromise(function(_0x5aca76,_0x33e341){return client[_0x161b('0xa')](_0xe274ff,_0xf3b09c)[_0x161b('0xb')](function(_0x52e90d){logger[_0x161b('0xc')](_0x161b('0xd'),_0x822413,_0x161b('0xe'));logger[_0x161b('0xf')](_0x161b('0x10'),_0x822413,_0x161b('0xe'),JSON[_0x161b('0x11')](_0x52e90d));if(_0x52e90d[_0x161b('0x12')]){if(_0x52e90d[_0x161b('0x12')][_0x161b('0x13')]===0x1f4){logger[_0x161b('0x12')](_0x161b('0xd'),_0x822413,_0x52e90d[_0x161b('0x12')][_0x161b('0x14')]);return _0x33e341(_0x52e90d['error'][_0x161b('0x14')]);}logger[_0x161b('0x12')](_0x161b('0xd'),_0x822413,_0x52e90d[_0x161b('0x12')]['message']);return _0x5aca76(_0x52e90d[_0x161b('0x12')][_0x161b('0x14')]);}else{logger['info'](_0x161b('0xd'),_0x822413,'request\x20sent');_0x5aca76(_0x52e90d['result'][_0x161b('0x14')]);}})[_0x161b('0x15')](function(_0x44313c){logger[_0x161b('0x12')](_0x161b('0xd'),_0x822413,_0x44313c);_0x33e341(_0x44313c);});});} \ No newline at end of file +var _0x9061=['stringify','error','code','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s'];(function(_0x428018,_0x2e3229){var _0x49fefa=function(_0x3dacdc){while(--_0x3dacdc){_0x428018['push'](_0x428018['shift']());}};_0x49fefa(++_0x2e3229);}(_0x9061,0x1d3));var _0x1906=function(_0x286ccc,_0x18cf30){_0x286ccc=_0x286ccc-0x0;var _0x43e094=_0x9061[_0x286ccc];return _0x43e094;};'use strict';var _=require(_0x1906('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1906('0x1'));var fs=require('fs');var Redis=require(_0x1906('0x2'));var db=require(_0x1906('0x3'))['db'];var utils=require(_0x1906('0x4'));var logger=require(_0x1906('0x5'))(_0x1906('0x6'));var config=require(_0x1906('0x7'));var jayson=require(_0x1906('0x8'));var client=jayson[_0x1906('0x9')][_0x1906('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c284f,_0x857e2b,_0x4ea304){return new BPromise(function(_0x210f9f,_0x39e3dd){return client['request'](_0x4c284f,_0x4ea304)[_0x1906('0xb')](function(_0x3c23d8){logger[_0x1906('0xc')](_0x1906('0xd'),_0x857e2b,_0x1906('0xe'));logger[_0x1906('0xf')](_0x1906('0x10'),_0x857e2b,'request\x20sent',JSON[_0x1906('0x11')](_0x3c23d8));if(_0x3c23d8['error']){if(_0x3c23d8[_0x1906('0x12')][_0x1906('0x13')]===0x1f4){logger[_0x1906('0x12')](_0x1906('0xd'),_0x857e2b,_0x3c23d8[_0x1906('0x12')][_0x1906('0x14')]);return _0x39e3dd(_0x3c23d8[_0x1906('0x12')]['message']);}logger[_0x1906('0x12')](_0x1906('0xd'),_0x857e2b,_0x3c23d8[_0x1906('0x12')][_0x1906('0x14')]);return _0x210f9f(_0x3c23d8[_0x1906('0x12')][_0x1906('0x14')]);}else{logger[_0x1906('0xc')]('ZohoField,\x20%s,\x20%s',_0x857e2b,_0x1906('0xe'));_0x210f9f(_0x3c23d8['result']['message']);}})[_0x1906('0x15')](function(_0x52e7a5){logger['error'](_0x1906('0xd'),_0x857e2b,_0x52e7a5);_0x39e3dd(_0x52e7a5);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index bb95245..21d8a33 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(_0x55223b,_0x325306){var _0x4dcc8a=function(_0x218f5f){while(--_0x218f5f){_0x55223b['push'](_0x55223b['shift']());}};_0x4dcc8a(++_0x325306);}(_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(_0x29d293,_0x24e061){var _0x2d44c6=function(_0x584711){while(--_0x584711){_0x29d293['push'](_0x29d293['shift']());}};_0x2d44c6(++_0x24e061);}(_0x70e0,0x17b));var _0x070e=function(_0x26deb2,_0x4b8dcd){_0x26deb2=_0x26deb2-0x0;var _0x426a56=_0x70e0[_0x26deb2];return _0x426a56;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 00b1da5..a523b4d 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 _0x3da4=['app.js','INTEGER','BOOLEAN','sequelize','exports','unique_name_and_version','STRING'];(function(_0x53a6cb,_0x445fb7){var _0x9c6f28=function(_0x184a29){while(--_0x184a29){_0x53a6cb['push'](_0x53a6cb['shift']());}};_0x9c6f28(++_0x445fb7);}(_0x3da4,0xce));var _0x43da=function(_0x46735a,_0x53bbfb){_0x46735a=_0x46735a-0x0;var _0x220f05=_0x3da4[_0x46735a];return _0x220f05;};'use strict';var Sequelize=require(_0x43da('0x0'));module[_0x43da('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x43da('0x2')},'version':{'type':Sequelize[_0x43da('0x3')],'allowNull':![],'unique':_0x43da('0x2')},'main':{'type':Sequelize[_0x43da('0x3')],'defaultValue':_0x43da('0x4')},'filename':{'type':Sequelize[_0x43da('0x3')]},'path':{'type':Sequelize[_0x43da('0x3')]},'type':{'type':Sequelize[_0x43da('0x3')]},'size':{'type':Sequelize[_0x43da('0x5')]},'active':{'type':Sequelize[_0x43da('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x43da('0x3')]},'state':{'type':Sequelize[_0x43da('0x3')],'unique':'state'},'description':{'type':Sequelize[_0x43da('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x43da('0x3')]},'link':{'type':Sequelize[_0x43da('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x6f70=['sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN','state'];(function(_0x542d43,_0x2a1d55){var _0xdfeaab=function(_0xe44c96){while(--_0xe44c96){_0x542d43['push'](_0x542d43['shift']());}};_0xdfeaab(++_0x2a1d55);}(_0x6f70,0x110));var _0x06f7=function(_0x5e0843,_0x2a3b01){_0x5e0843=_0x5e0843-0x0;var _0x92df5c=_0x6f70[_0x5e0843];return _0x92df5c;};'use strict';var Sequelize=require(_0x06f7('0x0'));module[_0x06f7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x06f7('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x06f7('0x2')},'main':{'type':Sequelize[_0x06f7('0x3')],'defaultValue':_0x06f7('0x4')},'filename':{'type':Sequelize[_0x06f7('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x06f7('0x3')]},'size':{'type':Sequelize[_0x06f7('0x5')]},'active':{'type':Sequelize[_0x06f7('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x06f7('0x3')]},'logo':{'type':Sequelize[_0x06f7('0x3')]},'state':{'type':Sequelize[_0x06f7('0x3')],'unique':_0x06f7('0x7')},'description':{'type':Sequelize[_0x06f7('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 70c1724..60a1a8e 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 _0xba34=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','Integration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x126b53,_0x27a8bf){var _0x2fd378=function(_0x2bcb1d){while(--_0x2bcb1d){_0x126b53['push'](_0x126b53['shift']());}};_0x2fd378(++_0x27a8bf);}(_0xba34,0x119));var _0x4ba3=function(_0x2e55af,_0xf586f9){_0x2e55af=_0x2e55af-0x0;var _0x135ead=_0xba34[_0x2e55af];return _0x135ead;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['Integration']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));}; \ No newline at end of file +var _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x477e17,_0x15def8){var _0x1c20b0=function(_0x1a9bb8){while(--_0x1a9bb8){_0x477e17['push'](_0x477e17['shift']());}};_0x1c20b0(++_0x15def8);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xfcf0[_0x4cbf20];return _0x582ae4;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 1bed21a..e678270 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 _0x80a8=['bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','moment'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x80a8,0x104));var _0x880a=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x80a8[_0x52666e];return _0x515330;};'use strict';var _=require(_0x880a('0x0'));var util=require(_0x880a('0x1'));var logger=require(_0x880a('0x2'))('api');var moment=require(_0x880a('0x3'));var BPromise=require(_0x880a('0x4'));var rp=require(_0x880a('0x5'));var fs=require('fs');var path=require(_0x880a('0x6'));var rimraf=require('rimraf');var config=require(_0x880a('0x7'));var attributes=require(_0x880a('0x8'));module[_0x880a('0x9')]=function(_0x369fce,_0x169ef2){return _0x369fce[_0x880a('0xa')](_0x880a('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36be=['Integration','integrations','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./integration.attributes','exports','define'];(function(_0x310b74,_0xf2e378){var _0x61a45c=function(_0x1ab799){while(--_0x1ab799){_0x310b74['push'](_0x310b74['shift']());}};_0x61a45c(++_0xf2e378);}(_0x36be,0x1af));var _0xe36b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x36be[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xe36b('0x0'));var util=require('util');var logger=require(_0xe36b('0x1'))('api');var moment=require(_0xe36b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe36b('0x3'));var rimraf=require(_0xe36b('0x4'));var config=require(_0xe36b('0x5'));var attributes=require(_0xe36b('0x6'));module[_0xe36b('0x7')]=function(_0x3ac45a,_0x2f06ac){return _0x3ac45a[_0xe36b('0x8')](_0xe36b('0x9'),attributes,{'tableName':_0xe36b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 6fe250e..944872e 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x327b9c,_0x24e125){var _0x199ed3=function(_0x1d5b87){while(--_0x1d5b87){_0x327b9c['push'](_0x327b9c['shift']());}};_0x199ed3(++_0x24e125);}(_0xd943,0x15d));var _0x3d94=function(_0x9ea26b,_0xe4d9e2){_0x9ea26b=_0x9ea26b-0x0;var _0x266105=_0xd943[_0x9ea26b];return _0x266105;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x4975,0x86));var _0x5497=function(_0x543706,_0x3ea03e){_0x543706=_0x543706-0x0;var _0x1c72da=_0x4975[_0x543706];return _0x1c72da;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 6bb6a32..6b72d4f 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 _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x4847ea,_0x105497){var _0x3d543e=function(_0x401100){while(--_0x401100){_0x4847ea['push'](_0x4847ea['shift']());}};_0x3d543e(++_0x105497);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ec3d1,_0x2d82b2){_0x2ec3d1=_0x2ec3d1-0x0;var _0x2551e2=_0x5fab[_0x2ec3d1];return _0x2551e2;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x4137,0xf8));var _0x7413=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4137[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index c497244..45e2217 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 _0x11c7=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','sequelize'];(function(_0x57a66a,_0x2e5bb8){var _0x2a9007=function(_0x351136){while(--_0x351136){_0x57a66a['push'](_0x57a66a['shift']());}};_0x2a9007(++_0x2e5bb8);}(_0x11c7,0x81));var _0x711c=function(_0x4bc337,_0x5a9492){_0x4bc337=_0x4bc337-0x0;var _0x1890f2=_0x11c7[_0x4bc337];return _0x1890f2;};'use strict';var Sequelize=require(_0x711c('0x0'));module[_0x711c('0x1')]={'integration':{'type':Sequelize[_0x711c('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x711c('0x2')]},'ticketId':{'type':Sequelize[_0x711c('0x2')]},'integrationId':{'type':Sequelize[_0x711c('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x711c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x711c('0x2')]},'queue':{'type':Sequelize[_0x711c('0x2')]},'interface':{'type':Sequelize[_0x711c('0x2')]},'membername':{'type':Sequelize[_0x711c('0x2')]},'agentcalledAt':{'type':Sequelize[_0x711c('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x711c('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x711c('0x4')]},'talktime':{'type':Sequelize[_0x711c('0x3')]},'agentacw':{'type':Sequelize[_0x711c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x711c('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x711c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x711c('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x711c('0x4')]},'lastevent':{'type':Sequelize[_0x711c('0x2')]},'channel':{'type':Sequelize[_0x711c('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x711c('0x2')]},'connectedlinenum':{'type':Sequelize[_0x711c('0x2')]},'connectedlinename':{'type':Sequelize[_0x711c('0x2')]},'language':{'type':Sequelize[_0x711c('0x2')]},'accountcode':{'type':Sequelize[_0x711c('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x711c('0x2')]},'priority':{'type':Sequelize[_0x711c('0x2')]},'destchannel':{'type':Sequelize[_0x711c('0x2')]},'destchannelstate':{'type':Sequelize[_0x711c('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x711c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x711c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x711c('0x2')]},'destlanguage':{'type':Sequelize[_0x711c('0x2')]},'destaccountcode':{'type':Sequelize[_0x711c('0x2')]},'destcontext':{'type':Sequelize[_0x711c('0x2')]},'destexten':{'type':Sequelize[_0x711c('0x2')]},'destpriority':{'type':Sequelize[_0x711c('0x2')]},'destuniqueid':{'type':Sequelize[_0x711c('0x2')]},'messageId':{'type':Sequelize[_0x711c('0x2')]},'inReplyTo':{'type':Sequelize[_0x711c('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x711c('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x711c('0x6')]},'html':{'type':Sequelize[_0x711c('0x6')]},'text':{'type':Sequelize[_0x711c('0x6')]},'status':{'type':Sequelize[_0x711c('0x7')](_0x711c('0x8'),'SENDING',_0x711c('0x9'),'FAILED')},'url':{'type':Sequelize[_0x711c('0x2')]},'app':{'type':Sequelize[_0x711c('0x2')]},'appdata':{'type':Sequelize[_0x711c('0x2')]},'projectId':{'type':Sequelize[_0x711c('0x3')]}}; \ No newline at end of file +var _0x3651=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','sequelize'];(function(_0x3ea5ca,_0x41f135){var _0x4c83b7=function(_0x23e3c3){while(--_0x23e3c3){_0x3ea5ca['push'](_0x3ea5ca['shift']());}};_0x4c83b7(++_0x41f135);}(_0x3651,0x95));var _0x1365=function(_0x231135,_0x17003c){_0x231135=_0x231135-0x0;var _0x1a1dc3=_0x3651[_0x231135];return _0x1a1dc3;};'use strict';var Sequelize=require(_0x1365('0x0'));module[_0x1365('0x1')]={'integration':{'type':Sequelize[_0x1365('0x2')]},'eventChannel':{'type':Sequelize[_0x1365('0x2')]},'exitStatus':{'type':Sequelize[_0x1365('0x2')]},'ticketId':{'type':Sequelize[_0x1365('0x2')]},'integrationId':{'type':Sequelize[_0x1365('0x3')]},'contacts':{'type':Sequelize[_0x1365('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1365('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1365('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1365('0x2')]},'agentcalledAt':{'type':Sequelize[_0x1365('0x4')]},'agentconnectAt':{'type':Sequelize[_0x1365('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x1365('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1365('0x4')]},'talktime':{'type':Sequelize[_0x1365('0x3')]},'agentacw':{'type':Sequelize[_0x1365('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x1365('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x1365('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1365('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1365('0x4')]},'lastevent':{'type':Sequelize[_0x1365('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1365('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1365('0x2')]},'connectedlinename':{'type':Sequelize[_0x1365('0x2')]},'language':{'type':Sequelize[_0x1365('0x2')]},'accountcode':{'type':Sequelize[_0x1365('0x2')]},'context':{'type':Sequelize[_0x1365('0x2')]},'exten':{'type':Sequelize[_0x1365('0x2')]},'priority':{'type':Sequelize[_0x1365('0x2')]},'destchannel':{'type':Sequelize[_0x1365('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x1365('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x1365('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1365('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1365('0x2')]},'destlanguage':{'type':Sequelize[_0x1365('0x2')]},'destaccountcode':{'type':Sequelize[_0x1365('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x1365('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x1365('0x2')]},'messageId':{'type':Sequelize[_0x1365('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x1365('0x2')]},'from':{'type':Sequelize[_0x1365('0x2')]},'to':{'type':Sequelize[_0x1365('0x2')]},'cc':{'type':Sequelize[_0x1365('0x2')]},'attachment':{'type':Sequelize[_0x1365('0x6')]},'html':{'type':Sequelize[_0x1365('0x6')]},'text':{'type':Sequelize[_0x1365('0x6')]},'status':{'type':Sequelize[_0x1365('0x7')]('SENT',_0x1365('0x8'),_0x1365('0x9'),'FAILED')},'url':{'type':Sequelize[_0x1365('0x2')]},'app':{'type':Sequelize[_0x1365('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x1365('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index e0b1fe7..8ddaa04 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 _0xbdb0=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','map','IntegrationReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','keys','includeAll','options','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x4d1f59,_0x4483ec){var _0x468441=function(_0x183185){while(--_0x183185){_0x4d1f59['push'](_0x4d1f59['shift']());}};_0x468441(++_0x4483ec);}(_0xbdb0,0x164));var _0x0bdb=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0xbdb0[_0x15dbca];return _0x326533;};'use strict';var emlformat=require(_0x0bdb('0x0'));var rimraf=require(_0x0bdb('0x1'));var zipdir=require(_0x0bdb('0x2'));var jsonpatch=require(_0x0bdb('0x3'));var rp=require(_0x0bdb('0x4'));var moment=require('moment');var BPromise=require(_0x0bdb('0x5'));var Mustache=require(_0x0bdb('0x6'));var util=require(_0x0bdb('0x7'));var path=require('path');var sox=require(_0x0bdb('0x8'));var csv=require(_0x0bdb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0bdb('0xa'));var squel=require(_0x0bdb('0xb'));var crypto=require(_0x0bdb('0xc'));var jsforce=require(_0x0bdb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0bdb('0x9'));var querystring=require(_0x0bdb('0xe'));var Papa=require(_0x0bdb('0xf'));var Redis=require(_0x0bdb('0x10'));var authService=require(_0x0bdb('0x11'));var qs=require(_0x0bdb('0x12'));var as=require(_0x0bdb('0x13'));var hardwareService=require(_0x0bdb('0x14'));var logger=require(_0x0bdb('0x15'))(_0x0bdb('0x16'));var utils=require(_0x0bdb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0bdb('0x18'));var db=require(_0x0bdb('0x19'))['db'];function respondWithStatusCode(_0x538320,_0x340446){_0x340446=_0x340446||0xcc;return function(_0x54fc33){if(_0x54fc33){return _0x538320[_0x0bdb('0x1a')](_0x340446);}return _0x538320['status'](_0x340446)[_0x0bdb('0x1b')]();};}function respondWithResult(_0x3b7edd,_0x3aa727){_0x3aa727=_0x3aa727||0xc8;return function(_0x595eb0){if(_0x595eb0){return _0x3b7edd[_0x0bdb('0x1c')](_0x3aa727)['json'](_0x595eb0);}};}function respondWithFilteredResult(_0x591af2,_0x354d6e){return function(_0x3a4964){if(_0x3a4964){var _0x1d3b9e=typeof _0x354d6e['offset']===_0x0bdb('0x1d')&&typeof _0x354d6e[_0x0bdb('0x1e')]===_0x0bdb('0x1d');var _0x1f1f1f=_0x3a4964[_0x0bdb('0x1f')];var _0x49d44d=_0x1d3b9e?0x0:_0x354d6e[_0x0bdb('0x20')];var _0x5ba333=_0x1d3b9e?_0x3a4964[_0x0bdb('0x1f')]:_0x354d6e['offset']+_0x354d6e[_0x0bdb('0x1e')];var _0x778b45;if(_0x5ba333>=_0x1f1f1f){_0x5ba333=_0x1f1f1f;_0x778b45=0xc8;}else{_0x778b45=0xce;}_0x591af2[_0x0bdb('0x1c')](_0x778b45);return _0x591af2[_0x0bdb('0x21')](_0x0bdb('0x22'),_0x49d44d+'-'+_0x5ba333+'/'+_0x1f1f1f)[_0x0bdb('0x23')](_0x3a4964);}return null;};}function patchUpdates(_0x3680d1){return function(_0x34c46f){try{jsonpatch['apply'](_0x34c46f,_0x3680d1,!![]);}catch(_0x12a57e){return BPromise[_0x0bdb('0x24')](_0x12a57e);}return _0x34c46f['save']();};}function saveUpdates(_0x597aea,_0x5628fb){return function(_0x2c8a54){if(_0x2c8a54){return _0x2c8a54[_0x0bdb('0x25')](_0x597aea)[_0x0bdb('0x26')](function(_0x48a665){return _0x48a665;});}return null;};}function removeEntity(_0x17da8d,_0x1b31f5){return function(_0x23e6ee){if(_0x23e6ee){return _0x23e6ee[_0x0bdb('0x27')]()[_0x0bdb('0x26')](function(){_0x17da8d[_0x0bdb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x239006,_0x1eda9a){return function(_0xfc7951){if(!_0xfc7951){_0x239006[_0x0bdb('0x1a')](0x194);}return _0xfc7951;};}function handleError(_0x3cd48f,_0x1fc760){_0x1fc760=_0x1fc760||0x1f4;return function(_0x207850){logger[_0x0bdb('0x28')](_0x207850[_0x0bdb('0x29')]);if(_0x207850[_0x0bdb('0x2a')]){delete _0x207850[_0x0bdb('0x2a')];}_0x3cd48f[_0x0bdb('0x1c')](_0x1fc760)[_0x0bdb('0x2b')](_0x207850);};}exports['index']=function(_0x589eb6,_0x220936){var _0x18ccde={},_0x540fff={},_0x3632ea={'count':0x0,'rows':[]};var _0x392739=_[_0x0bdb('0x2c')](db[_0x0bdb('0x2d')]['rawAttributes'],function(_0x3d61f0){return{'name':_0x3d61f0[_0x0bdb('0x2e')],'type':_0x3d61f0[_0x0bdb('0x2f')][_0x0bdb('0x30')]};});_0x540fff[_0x0bdb('0x31')]=_[_0x0bdb('0x2c')](_0x392739,_0x0bdb('0x2a'));_0x540fff['query']=_['keys'](_0x589eb6[_0x0bdb('0x32')]);_0x540fff[_0x0bdb('0x33')]=_['intersection'](_0x540fff['model'],_0x540fff[_0x0bdb('0x32')]);_0x18ccde[_0x0bdb('0x34')]=_[_0x0bdb('0x35')](_0x540fff[_0x0bdb('0x31')],qs[_0x0bdb('0x36')](_0x589eb6[_0x0bdb('0x32')][_0x0bdb('0x36')]));_0x18ccde[_0x0bdb('0x34')]=_0x18ccde[_0x0bdb('0x34')][_0x0bdb('0x37')]?_0x18ccde['attributes']:_0x540fff[_0x0bdb('0x31')];if(!_0x589eb6[_0x0bdb('0x32')][_0x0bdb('0x38')](_0x0bdb('0x39'))){_0x18ccde[_0x0bdb('0x1e')]=qs[_0x0bdb('0x1e')](_0x589eb6['query']['limit']);_0x18ccde[_0x0bdb('0x20')]=qs[_0x0bdb('0x20')](_0x589eb6[_0x0bdb('0x32')][_0x0bdb('0x20')]);}_0x18ccde['order']=qs['sort'](_0x589eb6['query'][_0x0bdb('0x3a')]);_0x18ccde[_0x0bdb('0x3b')]=qs['filters'](_[_0x0bdb('0x3c')](_0x589eb6[_0x0bdb('0x32')],_0x540fff[_0x0bdb('0x33')]),_0x392739);if(_0x589eb6[_0x0bdb('0x32')][_0x0bdb('0x3d')]){_0x18ccde[_0x0bdb('0x3b')]=_[_0x0bdb('0x3e')](_0x18ccde[_0x0bdb('0x3b')],{'$or':_['map'](_0x392739,function(_0xefe6cd){if(_0xefe6cd[_0x0bdb('0x2f')]!==_0x0bdb('0x3f')){var _0x599ef5={};_0x599ef5[_0xefe6cd[_0x0bdb('0x2a')]]={'$like':'%'+_0x589eb6['query'][_0x0bdb('0x3d')]+'%'};return _0x599ef5;}})});}_0x18ccde=_['merge']({},_0x18ccde,_0x589eb6['options']);var _0x11435e={'where':_0x18ccde['where']};return db[_0x0bdb('0x2d')][_0x0bdb('0x1f')](_0x11435e)[_0x0bdb('0x26')](function(_0x4c861e){_0x3632ea[_0x0bdb('0x1f')]=_0x4c861e;if(_0x589eb6[_0x0bdb('0x32')]['includeAll']){_0x18ccde[_0x0bdb('0x40')]=[{'all':!![]}];}return db['IntegrationReport'][_0x0bdb('0x41')](_0x18ccde);})[_0x0bdb('0x26')](function(_0x563b67){_0x3632ea[_0x0bdb('0x42')]=_0x563b67;return _0x3632ea;})[_0x0bdb('0x26')](respondWithFilteredResult(_0x220936,_0x18ccde))[_0x0bdb('0x43')](handleError(_0x220936,null));};exports['show']=function(_0x546aed,_0x33e7f9){var _0x4e1de1={'raw':![],'where':{'id':_0x546aed[_0x0bdb('0x44')]['id']}},_0x522868={};_0x522868['model']=_[_0x0bdb('0x45')](db[_0x0bdb('0x2d')]['rawAttributes']);_0x522868[_0x0bdb('0x32')]=_[_0x0bdb('0x45')](_0x546aed[_0x0bdb('0x32')]);_0x522868[_0x0bdb('0x33')]=_[_0x0bdb('0x35')](_0x522868['model'],_0x522868[_0x0bdb('0x32')]);_0x4e1de1[_0x0bdb('0x34')]=_[_0x0bdb('0x35')](_0x522868[_0x0bdb('0x31')],qs['fields'](_0x546aed[_0x0bdb('0x32')][_0x0bdb('0x36')]));_0x4e1de1[_0x0bdb('0x34')]=_0x4e1de1[_0x0bdb('0x34')][_0x0bdb('0x37')]?_0x4e1de1[_0x0bdb('0x34')]:_0x522868[_0x0bdb('0x31')];if(_0x546aed[_0x0bdb('0x32')][_0x0bdb('0x46')]){_0x4e1de1[_0x0bdb('0x40')]=[{'all':!![]}];}_0x4e1de1=_['merge']({},_0x4e1de1,_0x546aed[_0x0bdb('0x47')]);return db[_0x0bdb('0x2d')]['find'](_0x4e1de1)[_0x0bdb('0x26')](handleEntityNotFound(_0x33e7f9,null))[_0x0bdb('0x26')](respondWithResult(_0x33e7f9,null))[_0x0bdb('0x43')](handleError(_0x33e7f9,null));};exports['create']=function(_0x2a15ce,_0x536c1a){return db[_0x0bdb('0x2d')]['create'](_0x2a15ce[_0x0bdb('0x48')],{})[_0x0bdb('0x26')](respondWithResult(_0x536c1a,0xc9))[_0x0bdb('0x43')](handleError(_0x536c1a,null));};exports['update']=function(_0x3571e0,_0x4aacb6){if(_0x3571e0['body']['id']){delete _0x3571e0[_0x0bdb('0x48')]['id'];}return db[_0x0bdb('0x2d')]['find']({'where':{'id':_0x3571e0['params']['id']}})[_0x0bdb('0x26')](handleEntityNotFound(_0x4aacb6,null))[_0x0bdb('0x26')](saveUpdates(_0x3571e0[_0x0bdb('0x48')],null))[_0x0bdb('0x26')](respondWithResult(_0x4aacb6,null))[_0x0bdb('0x43')](handleError(_0x4aacb6,null));};exports[_0x0bdb('0x27')]=function(_0x574867,_0x385c47){return db[_0x0bdb('0x2d')]['find']({'where':{'id':_0x574867[_0x0bdb('0x44')]['id']}})[_0x0bdb('0x26')](handleEntityNotFound(_0x385c47,null))[_0x0bdb('0x26')](removeEntity(_0x385c47,null))[_0x0bdb('0x43')](handleError(_0x385c47,null));};exports[_0x0bdb('0x49')]=function(_0xe53448,_0x2c2d95){return db[_0x0bdb('0x2d')]['describe']()[_0x0bdb('0x26')](respondWithResult(_0x2c2d95,null))[_0x0bdb('0x43')](handleError(_0x2c2d95,null));}; \ No newline at end of file +var _0x3a24=['Content-Range','apply','save','then','sendStatus','error','stack','send','IntegrationReport','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','includeAll','include','catch','show','keys','options','create','update','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set'];(function(_0x23b91a,_0x54f87d){var _0x1b79fd=function(_0x3fd326){while(--_0x3fd326){_0x23b91a['push'](_0x23b91a['shift']());}};_0x1b79fd(++_0x54f87d);}(_0x3a24,0x19f));var _0x43a2=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x3a24[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require(_0x43a2('0x0'));var rimraf=require(_0x43a2('0x1'));var zipdir=require(_0x43a2('0x2'));var jsonpatch=require(_0x43a2('0x3'));var rp=require(_0x43a2('0x4'));var moment=require(_0x43a2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x43a2('0x6'));var util=require(_0x43a2('0x7'));var path=require(_0x43a2('0x8'));var sox=require(_0x43a2('0x9'));var csv=require(_0x43a2('0xa'));var ejs=require(_0x43a2('0xb'));var fs=require('fs');var fs_extra=require(_0x43a2('0xc'));var _=require(_0x43a2('0xd'));var squel=require(_0x43a2('0xe'));var crypto=require('crypto');var jsforce=require(_0x43a2('0xf'));var deskjs=require(_0x43a2('0x10'));var toCsv=require(_0x43a2('0xa'));var querystring=require(_0x43a2('0x11'));var Papa=require(_0x43a2('0x12'));var Redis=require(_0x43a2('0x13'));var authService=require(_0x43a2('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x43a2('0x15'));var hardwareService=require(_0x43a2('0x16'));var logger=require(_0x43a2('0x17'))(_0x43a2('0x18'));var utils=require(_0x43a2('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x43a2('0x1a'))['db'];function respondWithStatusCode(_0x3d7e69,_0x17975a){_0x17975a=_0x17975a||0xcc;return function(_0x2f4fdc){if(_0x2f4fdc){return _0x3d7e69['sendStatus'](_0x17975a);}return _0x3d7e69[_0x43a2('0x1b')](_0x17975a)[_0x43a2('0x1c')]();};}function respondWithResult(_0x1d324a,_0x5bf46d){_0x5bf46d=_0x5bf46d||0xc8;return function(_0x2ab4fb){if(_0x2ab4fb){return _0x1d324a['status'](_0x5bf46d)[_0x43a2('0x1d')](_0x2ab4fb);}};}function respondWithFilteredResult(_0x52118f,_0x1a458d){return function(_0x49f9be){if(_0x49f9be){var _0x48fda0=typeof _0x1a458d[_0x43a2('0x1e')]===_0x43a2('0x1f')&&typeof _0x1a458d['limit']===_0x43a2('0x1f');var _0x45ae64=_0x49f9be[_0x43a2('0x20')];var _0x14677b=_0x48fda0?0x0:_0x1a458d[_0x43a2('0x1e')];var _0x312234=_0x48fda0?_0x49f9be[_0x43a2('0x20')]:_0x1a458d[_0x43a2('0x1e')]+_0x1a458d[_0x43a2('0x21')];var _0x18efc1;if(_0x312234>=_0x45ae64){_0x312234=_0x45ae64;_0x18efc1=0xc8;}else{_0x18efc1=0xce;}_0x52118f[_0x43a2('0x1b')](_0x18efc1);return _0x52118f[_0x43a2('0x22')](_0x43a2('0x23'),_0x14677b+'-'+_0x312234+'/'+_0x45ae64)[_0x43a2('0x1d')](_0x49f9be);}return null;};}function patchUpdates(_0x29e2d6){return function(_0x83afc4){try{jsonpatch[_0x43a2('0x24')](_0x83afc4,_0x29e2d6,!![]);}catch(_0x2373a0){return BPromise['reject'](_0x2373a0);}return _0x83afc4[_0x43a2('0x25')]();};}function saveUpdates(_0x18c47b,_0x58f090){return function(_0x2bc464){if(_0x2bc464){return _0x2bc464['update'](_0x18c47b)[_0x43a2('0x26')](function(_0x39da48){return _0x39da48;});}return null;};}function removeEntity(_0x5e5b41,_0x580847){return function(_0x2ab4db){if(_0x2ab4db){return _0x2ab4db['destroy']()[_0x43a2('0x26')](function(){_0x5e5b41[_0x43a2('0x1b')](0xcc)[_0x43a2('0x1c')]();});}};}function handleEntityNotFound(_0x31589a,_0x10e882){return function(_0x53ef35){if(!_0x53ef35){_0x31589a[_0x43a2('0x27')](0x194);}return _0x53ef35;};}function handleError(_0x4c5338,_0x4c2c28){_0x4c2c28=_0x4c2c28||0x1f4;return function(_0x450ab2){logger[_0x43a2('0x28')](_0x450ab2[_0x43a2('0x29')]);if(_0x450ab2['name']){delete _0x450ab2['name'];}_0x4c5338[_0x43a2('0x1b')](_0x4c2c28)[_0x43a2('0x2a')](_0x450ab2);};}exports['index']=function(_0x50c2a1,_0x1a5d9b){var _0x58783e={},_0xc7678d={},_0x511195={'count':0x0,'rows':[]};var _0x3c5ae6=_['map'](db[_0x43a2('0x2b')][_0x43a2('0x2c')],function(_0x2b74c3){return{'name':_0x2b74c3[_0x43a2('0x2d')],'type':_0x2b74c3[_0x43a2('0x2e')][_0x43a2('0x2f')]};});_0xc7678d[_0x43a2('0x30')]=_['map'](_0x3c5ae6,'name');_0xc7678d[_0x43a2('0x31')]=_['keys'](_0x50c2a1[_0x43a2('0x31')]);_0xc7678d[_0x43a2('0x32')]=_['intersection'](_0xc7678d['model'],_0xc7678d[_0x43a2('0x31')]);_0x58783e['attributes']=_['intersection'](_0xc7678d[_0x43a2('0x30')],qs[_0x43a2('0x33')](_0x50c2a1[_0x43a2('0x31')][_0x43a2('0x33')]));_0x58783e[_0x43a2('0x34')]=_0x58783e[_0x43a2('0x34')][_0x43a2('0x35')]?_0x58783e[_0x43a2('0x34')]:_0xc7678d[_0x43a2('0x30')];if(!_0x50c2a1[_0x43a2('0x31')][_0x43a2('0x36')](_0x43a2('0x37'))){_0x58783e[_0x43a2('0x21')]=qs[_0x43a2('0x21')](_0x50c2a1[_0x43a2('0x31')][_0x43a2('0x21')]);_0x58783e[_0x43a2('0x1e')]=qs['offset'](_0x50c2a1[_0x43a2('0x31')]['offset']);}_0x58783e[_0x43a2('0x38')]=qs[_0x43a2('0x39')](_0x50c2a1[_0x43a2('0x31')][_0x43a2('0x39')]);_0x58783e[_0x43a2('0x3a')]=qs[_0x43a2('0x32')](_['pick'](_0x50c2a1[_0x43a2('0x31')],_0xc7678d[_0x43a2('0x32')]),_0x3c5ae6);if(_0x50c2a1['query'][_0x43a2('0x3b')]){_0x58783e['where']=_[_0x43a2('0x3c')](_0x58783e[_0x43a2('0x3a')],{'$or':_['map'](_0x3c5ae6,function(_0x414759){if(_0x414759[_0x43a2('0x2e')]!==_0x43a2('0x3d')){var _0x451bb2={};_0x451bb2[_0x414759[_0x43a2('0x3e')]]={'$like':'%'+_0x50c2a1['query']['filter']+'%'};return _0x451bb2;}})});}_0x58783e=_['merge']({},_0x58783e,_0x50c2a1['options']);var _0x48cba0={'where':_0x58783e[_0x43a2('0x3a')]};return db[_0x43a2('0x2b')]['count'](_0x48cba0)[_0x43a2('0x26')](function(_0x55e187){_0x511195[_0x43a2('0x20')]=_0x55e187;if(_0x50c2a1['query'][_0x43a2('0x3f')]){_0x58783e[_0x43a2('0x40')]=[{'all':!![]}];}return db[_0x43a2('0x2b')]['findAll'](_0x58783e);})[_0x43a2('0x26')](function(_0x5b9904){_0x511195['rows']=_0x5b9904;return _0x511195;})[_0x43a2('0x26')](respondWithFilteredResult(_0x1a5d9b,_0x58783e))[_0x43a2('0x41')](handleError(_0x1a5d9b,null));};exports[_0x43a2('0x42')]=function(_0x44004d,_0x48435d){var _0x1667af={'raw':![],'where':{'id':_0x44004d['params']['id']}},_0x5ed512={};_0x5ed512[_0x43a2('0x30')]=_[_0x43a2('0x43')](db[_0x43a2('0x2b')][_0x43a2('0x2c')]);_0x5ed512[_0x43a2('0x31')]=_[_0x43a2('0x43')](_0x44004d['query']);_0x5ed512[_0x43a2('0x32')]=_['intersection'](_0x5ed512[_0x43a2('0x30')],_0x5ed512['query']);_0x1667af[_0x43a2('0x34')]=_['intersection'](_0x5ed512['model'],qs[_0x43a2('0x33')](_0x44004d[_0x43a2('0x31')]['fields']));_0x1667af[_0x43a2('0x34')]=_0x1667af[_0x43a2('0x34')][_0x43a2('0x35')]?_0x1667af[_0x43a2('0x34')]:_0x5ed512[_0x43a2('0x30')];if(_0x44004d[_0x43a2('0x31')][_0x43a2('0x3f')]){_0x1667af[_0x43a2('0x40')]=[{'all':!![]}];}_0x1667af=_[_0x43a2('0x3c')]({},_0x1667af,_0x44004d[_0x43a2('0x44')]);return db[_0x43a2('0x2b')]['find'](_0x1667af)[_0x43a2('0x26')](handleEntityNotFound(_0x48435d,null))[_0x43a2('0x26')](respondWithResult(_0x48435d,null))['catch'](handleError(_0x48435d,null));};exports[_0x43a2('0x45')]=function(_0x5498ac,_0x17574b){return db['IntegrationReport'][_0x43a2('0x45')](_0x5498ac['body'],{})['then'](respondWithResult(_0x17574b,0xc9))['catch'](handleError(_0x17574b,null));};exports[_0x43a2('0x46')]=function(_0x37a926,_0x1508e6){if(_0x37a926['body']['id']){delete _0x37a926[_0x43a2('0x47')]['id'];}return db[_0x43a2('0x2b')][_0x43a2('0x48')]({'where':{'id':_0x37a926['params']['id']}})[_0x43a2('0x26')](handleEntityNotFound(_0x1508e6,null))['then'](saveUpdates(_0x37a926[_0x43a2('0x47')],null))['then'](respondWithResult(_0x1508e6,null))[_0x43a2('0x41')](handleError(_0x1508e6,null));};exports[_0x43a2('0x49')]=function(_0x3dd77d,_0x30b3c0){return db[_0x43a2('0x2b')][_0x43a2('0x48')]({'where':{'id':_0x3dd77d['params']['id']}})[_0x43a2('0x26')](handleEntityNotFound(_0x30b3c0,null))[_0x43a2('0x26')](removeEntity(_0x30b3c0,null))[_0x43a2('0x41')](handleError(_0x30b3c0,null));};exports[_0x43a2('0x4a')]=function(_0x52a1c8,_0x40846c){return db['IntegrationReport']['describe']()[_0x43a2('0x26')](respondWithResult(_0x40846c,null))['catch'](handleError(_0x40846c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 1b0e942..1d472c4 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 _0xfa3b=['rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0xfa3b,0x190));var _0xbfa3=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0xfa3b[_0x21090b];return _0x3c68d7;};'use strict';var _=require(_0xbfa3('0x0'));var util=require(_0xbfa3('0x1'));var logger=require(_0xbfa3('0x2'))(_0xbfa3('0x3'));var moment=require(_0xbfa3('0x4'));var BPromise=require(_0xbfa3('0x5'));var rp=require(_0xbfa3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfa3('0x7'));var config=require(_0xbfa3('0x8'));var attributes=require(_0xbfa3('0x9'));module['exports']=function(_0x2373c9,_0x1862c7){return _0x2373c9['define'](_0xbfa3('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26e2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','define','report_integration'];(function(_0x9b18a3,_0x156333){var _0x84f1d3=function(_0x1c2b52){while(--_0x1c2b52){_0x9b18a3['push'](_0x9b18a3['shift']());}};_0x84f1d3(++_0x156333);}(_0x26e2,0x11e));var _0x226e=function(_0x38e605,_0x58a110){_0x38e605=_0x38e605-0x0;var _0x395cbb=_0x26e2[_0x38e605];return _0x395cbb;};'use strict';var _=require(_0x226e('0x0'));var util=require(_0x226e('0x1'));var logger=require(_0x226e('0x2'))(_0x226e('0x3'));var moment=require(_0x226e('0x4'));var BPromise=require(_0x226e('0x5'));var rp=require(_0x226e('0x6'));var fs=require('fs');var path=require(_0x226e('0x7'));var rimraf=require(_0x226e('0x8'));var config=require(_0x226e('0x9'));var attributes=require(_0x226e('0xa'));module['exports']=function(_0x421a1a,_0x3521ef){return _0x421a1a[_0x226e('0xb')]('IntegrationReport',attributes,{'tableName':_0x226e('0xc'),'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 9436ab7..c132264 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 _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3429bf,_0x164efc){var _0x37782c=function(_0x343cc4){while(--_0x343cc4){_0x3429bf['push'](_0x3429bf['shift']());}};_0x37782c(++_0x164efc);}(_0x326f,0xd1));var _0xf326=function(_0x581224,_0x3f5f62){_0x581224=_0x581224-0x0;var _0xd9de12=_0x326f[_0x581224];return _0xd9de12;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4ceac1,_0x35ec37){var _0x861aa1=function(_0xc69ac8){while(--_0xc69ac8){_0x4ceac1['push'](_0x4ceac1['shift']());}};_0x861aa1(++_0x35ec37);}(_0x57ca,0x108));var _0xa57c=function(_0x16c6d7,_0x31e4a6){_0x16c6d7=_0x16c6d7-0x0;var _0x44d166=_0x57ca[_0x16c6d7];return _0x44d166;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b755101..1008e05 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 _0xe5e0=['get','isAuthenticated','/:id','show','/:id/sub_intervals','create','post','addInterval','/:id/sub_intervals/create_many','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller'];(function(_0x51e7d8,_0x56d4d4){var _0x27b10e=function(_0x3a76aa){while(--_0x3a76aa){_0x51e7d8['push'](_0x51e7d8['shift']());}};_0x27b10e(++_0x56d4d4);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x507eab,_0x4e07e2){_0x507eab=_0x507eab-0x0;var _0x42ed44=_0xe5e0[_0x507eab];return _0x42ed44;};'use strict';var multer=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var path=require(_0x0e5e('0x2'));var timeout=require(_0x0e5e('0x3'));var express=require(_0x0e5e('0x4'));var router=express[_0x0e5e('0x5')]();var fs_extra=require(_0x0e5e('0x6'));var auth=require(_0x0e5e('0x7'));var interaction=require(_0x0e5e('0x8'));var config=require('../../config/environment');var controller=require(_0x0e5e('0x9'));router[_0x0e5e('0xa')]('/',auth[_0x0e5e('0xb')](),controller['index']);router[_0x0e5e('0xa')](_0x0e5e('0xc'),auth[_0x0e5e('0xb')](),controller[_0x0e5e('0xd')]);router[_0x0e5e('0xa')](_0x0e5e('0xe'),auth[_0x0e5e('0xb')](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0x0e5e('0xf')]);router[_0x0e5e('0x10')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x0e5e('0x11')]);router[_0x0e5e('0x10')](_0x0e5e('0x12'),auth[_0x0e5e('0xb')](),controller['addIntervals']);router[_0x0e5e('0x13')](_0x0e5e('0xc'),auth['isAuthenticated'](),controller[_0x0e5e('0x14')]);router[_0x0e5e('0x15')](_0x0e5e('0xc'),auth['isAuthenticated'](),controller[_0x0e5e('0x16')]);module[_0x0e5e('0x17')]=router; \ No newline at end of file +var _0x2178=['get','isAuthenticated','index','/:id','show','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./interval.controller'];(function(_0x1206ce,_0x592dc2){var _0x18b56b=function(_0xcfcaac){while(--_0xcfcaac){_0x1206ce['push'](_0x1206ce['shift']());}};_0x18b56b(++_0x592dc2);}(_0x2178,0x1b0));var _0x8217=function(_0x356312,_0x4e93b7){_0x356312=_0x356312-0x0;var _0x1b1055=_0x2178[_0x356312];return _0x1b1055;};'use strict';var multer=require(_0x8217('0x0'));var util=require('util');var path=require(_0x8217('0x1'));var timeout=require(_0x8217('0x2'));var express=require(_0x8217('0x3'));var router=express['Router']();var fs_extra=require(_0x8217('0x4'));var auth=require(_0x8217('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8217('0x6'));var controller=require(_0x8217('0x7'));router[_0x8217('0x8')]('/',auth[_0x8217('0x9')](),controller[_0x8217('0xa')]);router[_0x8217('0x8')](_0x8217('0xb'),auth[_0x8217('0x9')](),controller[_0x8217('0xc')]);router['get']('/:id/sub_intervals',auth[_0x8217('0x9')](),controller[_0x8217('0xd')]);router[_0x8217('0xe')]('/',auth['isAuthenticated'](),controller[_0x8217('0xf')]);router['post']('/:id/sub_intervals',auth[_0x8217('0x9')](),controller[_0x8217('0x10')]);router[_0x8217('0xe')](_0x8217('0x11'),auth[_0x8217('0x9')](),controller[_0x8217('0x12')]);router[_0x8217('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8217('0x14')](_0x8217('0xb'),auth[_0x8217('0x9')](),controller[_0x8217('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index ec57c38..4627db6 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 _0x1a9a=['STRING','sequelize','exports'];(function(_0x2baac3,_0x15f486){var _0x2ca814=function(_0x30e412){while(--_0x30e412){_0x2baac3['push'](_0x2baac3['shift']());}};_0x2ca814(++_0x15f486);}(_0x1a9a,0x10f));var _0xa1a9=function(_0x4fd475,_0x5a2f44){_0x4fd475=_0x4fd475-0x0;var _0x5e47a9=_0x1a9a[_0x4fd475];return _0x5e47a9;};'use strict';var Sequelize=require(_0xa1a9('0x0'));module[_0xa1a9('0x1')]={'name':{'type':Sequelize[_0xa1a9('0x2')]},'description':{'type':Sequelize[_0xa1a9('0x2')]},'interval':{'type':Sequelize[_0xa1a9('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x08b2=['sequelize','exports','STRING'];(function(_0x47a110,_0x506692){var _0x2b3615=function(_0x283774){while(--_0x283774){_0x47a110['push'](_0x47a110['shift']());}};_0x2b3615(++_0x506692);}(_0x08b2,0xf3));var _0x208b=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x08b2[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0x208b('0x0'));module[_0x208b('0x1')]={'name':{'type':Sequelize[_0x208b('0x2')]},'description':{'type':Sequelize[_0x208b('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index fee546a..7aac481 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 _0xd9e2=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','send','index','map','Interval','fieldName','type','key','model','name','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','keys','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Intervals','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','addInterval','IntervalId','findOne','getIntervals','hasOwnProperty','addIntervals','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x42945c,_0x1a5938){var _0xdd2de0=function(_0x1a1b5c){while(--_0x1a1b5c){_0x42945c['push'](_0x42945c['shift']());}};_0xdd2de0(++_0x1a5938);}(_0xd9e2,0x10a));var _0x2d9e=function(_0x393909,_0x2e0350){_0x393909=_0x393909-0x0;var _0x27d291=_0xd9e2[_0x393909];return _0x27d291;};'use strict';var emlformat=require(_0x2d9e('0x0'));var rimraf=require(_0x2d9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d9e('0x2'));var rp=require(_0x2d9e('0x3'));var moment=require(_0x2d9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d9e('0x5'));var util=require(_0x2d9e('0x6'));var path=require(_0x2d9e('0x7'));var sox=require(_0x2d9e('0x8'));var csv=require(_0x2d9e('0x9'));var ejs=require(_0x2d9e('0xa'));var fs=require('fs');var fs_extra=require(_0x2d9e('0xb'));var _=require('lodash');var squel=require(_0x2d9e('0xc'));var crypto=require(_0x2d9e('0xd'));var jsforce=require(_0x2d9e('0xe'));var deskjs=require(_0x2d9e('0xf'));var toCsv=require(_0x2d9e('0x9'));var querystring=require(_0x2d9e('0x10'));var Papa=require(_0x2d9e('0x11'));var Redis=require(_0x2d9e('0x12'));var authService=require(_0x2d9e('0x13'));var qs=require(_0x2d9e('0x14'));var as=require(_0x2d9e('0x15'));var hardwareService=require(_0x2d9e('0x16'));var logger=require(_0x2d9e('0x17'))(_0x2d9e('0x18'));var utils=require('../../config/utils');var config=require(_0x2d9e('0x19'));var licenseUtil=require(_0x2d9e('0x1a'));var db=require(_0x2d9e('0x1b'))['db'];var extensions=require(_0x2d9e('0x1c'));function respondWithStatusCode(_0x4f056,_0x549fbd){_0x549fbd=_0x549fbd||0xcc;return function(_0x40f4a8){if(_0x40f4a8){return _0x4f056['sendStatus'](_0x549fbd);}return _0x4f056[_0x2d9e('0x1d')](_0x549fbd)[_0x2d9e('0x1e')]();};}function respondWithResult(_0x2fa5e2,_0x4604ca){_0x4604ca=_0x4604ca||0xc8;return function(_0x41a1c5){if(_0x41a1c5){return _0x2fa5e2[_0x2d9e('0x1d')](_0x4604ca)['json'](_0x41a1c5);}};}function respondWithFilteredResult(_0x2a4b1b,_0x32074e){return function(_0x4f139f){if(_0x4f139f){var _0x794cea=typeof _0x32074e['offset']===_0x2d9e('0x1f')&&typeof _0x32074e[_0x2d9e('0x20')]==='undefined';var _0x3b1ac4=_0x4f139f['count'];var _0x4062fd=_0x794cea?0x0:_0x32074e[_0x2d9e('0x21')];var _0x30c5bf=_0x794cea?_0x4f139f[_0x2d9e('0x22')]:_0x32074e[_0x2d9e('0x21')]+_0x32074e[_0x2d9e('0x20')];var _0x235b54;if(_0x30c5bf>=_0x3b1ac4){_0x30c5bf=_0x3b1ac4;_0x235b54=0xc8;}else{_0x235b54=0xce;}_0x2a4b1b['status'](_0x235b54);return _0x2a4b1b[_0x2d9e('0x23')](_0x2d9e('0x24'),_0x4062fd+'-'+_0x30c5bf+'/'+_0x3b1ac4)[_0x2d9e('0x25')](_0x4f139f);}return null;};}function patchUpdates(_0x416799){return function(_0x3cc699){try{jsonpatch[_0x2d9e('0x26')](_0x3cc699,_0x416799,!![]);}catch(_0xaf7d){return BPromise[_0x2d9e('0x27')](_0xaf7d);}return _0x3cc699['save']();};}function saveUpdates(_0x5102f2,_0x4a59bf){return function(_0x14305e){if(_0x14305e){return _0x14305e[_0x2d9e('0x28')](_0x5102f2)[_0x2d9e('0x29')](function(_0x23e3dd){return _0x23e3dd;});}return null;};}function removeEntity(_0x376a76,_0x94fd3c){return function(_0x1d1012){if(_0x1d1012){return _0x1d1012[_0x2d9e('0x2a')]()[_0x2d9e('0x29')](function(){var _0x11dcbc=_0x1d1012['get']({'plain':!![]});var _0x3e95eb='Intervals';return db['UserProfileResource'][_0x2d9e('0x2a')]({'where':{'type':_0x3e95eb,'resourceId':_0x11dcbc['id']}})[_0x2d9e('0x29')](function(){return _0x1d1012;});})[_0x2d9e('0x29')](function(){_0x376a76[_0x2d9e('0x1d')](0xcc)[_0x2d9e('0x1e')]();});}};}function handleEntityNotFound(_0x29fc4e,_0xd56204){return function(_0x47502e){if(!_0x47502e){_0x29fc4e['sendStatus'](0x194);}return _0x47502e;};}function handleError(_0x4c3ee6,_0x34664a){_0x34664a=_0x34664a||0x1f4;return function(_0x5aad94){logger['error'](_0x5aad94['stack']);if(_0x5aad94['name']){delete _0x5aad94['name'];}_0x4c3ee6[_0x2d9e('0x1d')](_0x34664a)[_0x2d9e('0x2b')](_0x5aad94);};}exports[_0x2d9e('0x2c')]=function(_0x1f152f,_0xf3fa42){var _0x37e1ee={},_0x488dd7={},_0x3ac958={'count':0x0,'rows':[]};var _0x3ca512=_[_0x2d9e('0x2d')](db[_0x2d9e('0x2e')]['rawAttributes'],function(_0x29e603){return{'name':_0x29e603[_0x2d9e('0x2f')],'type':_0x29e603[_0x2d9e('0x30')][_0x2d9e('0x31')]};});_0x488dd7[_0x2d9e('0x32')]=_['map'](_0x3ca512,_0x2d9e('0x33'));_0x488dd7[_0x2d9e('0x34')]=_['keys'](_0x1f152f[_0x2d9e('0x34')]);_0x488dd7['filters']=_[_0x2d9e('0x35')](_0x488dd7[_0x2d9e('0x32')],_0x488dd7[_0x2d9e('0x34')]);_0x37e1ee[_0x2d9e('0x36')]=_['intersection'](_0x488dd7['model'],qs[_0x2d9e('0x37')](_0x1f152f['query'][_0x2d9e('0x37')]));_0x37e1ee[_0x2d9e('0x36')]=_0x37e1ee[_0x2d9e('0x36')][_0x2d9e('0x38')]?_0x37e1ee['attributes']:_0x488dd7[_0x2d9e('0x32')];if(!_0x1f152f['query']['hasOwnProperty'](_0x2d9e('0x39'))){_0x37e1ee[_0x2d9e('0x20')]=qs[_0x2d9e('0x20')](_0x1f152f[_0x2d9e('0x34')]['limit']);_0x37e1ee[_0x2d9e('0x21')]=qs[_0x2d9e('0x21')](_0x1f152f['query'][_0x2d9e('0x21')]);}_0x37e1ee[_0x2d9e('0x3a')]=qs[_0x2d9e('0x3b')](_0x1f152f['query'][_0x2d9e('0x3b')]);_0x37e1ee[_0x2d9e('0x3c')]=qs[_0x2d9e('0x3d')](_['pick'](_0x1f152f[_0x2d9e('0x34')],_0x488dd7[_0x2d9e('0x3d')]),_0x3ca512);if(_0x1f152f['query']['filter']){_0x37e1ee[_0x2d9e('0x3c')]=_[_0x2d9e('0x3e')](_0x37e1ee[_0x2d9e('0x3c')],{'$or':_['map'](_0x3ca512,function(_0xa36c25){if(_0xa36c25[_0x2d9e('0x30')]!==_0x2d9e('0x3f')){var _0x364d1b={};_0x364d1b[_0xa36c25[_0x2d9e('0x33')]]={'$like':'%'+_0x1f152f['query'][_0x2d9e('0x40')]+'%'};return _0x364d1b;}})});}_0x37e1ee=_[_0x2d9e('0x3e')]({},_0x37e1ee,_0x1f152f[_0x2d9e('0x41')]);var _0x244b1d={'where':_0x37e1ee['where']};return db['Interval']['count'](_0x244b1d)['then'](function(_0x53315f){_0x3ac958[_0x2d9e('0x22')]=_0x53315f;if(_0x1f152f[_0x2d9e('0x34')][_0x2d9e('0x42')]){_0x37e1ee[_0x2d9e('0x43')]=[{'all':!![]}];}return db[_0x2d9e('0x2e')][_0x2d9e('0x44')](_0x37e1ee);})['then'](function(_0xa014c1){_0x3ac958['rows']=_0xa014c1;return _0x3ac958;})['then'](respondWithFilteredResult(_0xf3fa42,_0x37e1ee))['catch'](handleError(_0xf3fa42,null));};exports[_0x2d9e('0x45')]=function(_0x28c92f,_0x5739fe){var _0xd801a4={'raw':!![],'where':{'id':_0x28c92f['params']['id']}},_0x42c7f4={};_0x42c7f4[_0x2d9e('0x32')]=_[_0x2d9e('0x46')](db['Interval'][_0x2d9e('0x47')]);_0x42c7f4[_0x2d9e('0x34')]=_[_0x2d9e('0x46')](_0x28c92f[_0x2d9e('0x34')]);_0x42c7f4[_0x2d9e('0x3d')]=_[_0x2d9e('0x35')](_0x42c7f4[_0x2d9e('0x32')],_0x42c7f4[_0x2d9e('0x34')]);_0xd801a4[_0x2d9e('0x36')]=_[_0x2d9e('0x35')](_0x42c7f4['model'],qs[_0x2d9e('0x37')](_0x28c92f['query']['fields']));_0xd801a4[_0x2d9e('0x36')]=_0xd801a4[_0x2d9e('0x36')]['length']?_0xd801a4[_0x2d9e('0x36')]:_0x42c7f4[_0x2d9e('0x32')];if(_0x28c92f[_0x2d9e('0x34')][_0x2d9e('0x42')]){_0xd801a4['include']=[{'all':!![]}];}_0xd801a4=_['merge']({},_0xd801a4,_0x28c92f['options']);return db[_0x2d9e('0x2e')]['find'](_0xd801a4)[_0x2d9e('0x29')](handleEntityNotFound(_0x5739fe,null))[_0x2d9e('0x29')](respondWithResult(_0x5739fe,null))['catch'](handleError(_0x5739fe,null));};exports[_0x2d9e('0x48')]=function(_0x167a54,_0x57d725){return db[_0x2d9e('0x2e')]['create'](_0x167a54[_0x2d9e('0x49')],{})[_0x2d9e('0x29')](function(_0x5905eb){var _0x251460=_0x167a54['user']['get']({'plain':!![]});if(!_0x251460)throw new Error(_0x2d9e('0x4a'));if(_0x251460[_0x2d9e('0x4b')]==='user'){var _0x28a4f4=_0x5905eb[_0x2d9e('0x4c')]({'plain':!![]});var _0x355709=_0x2d9e('0x4d');return db[_0x2d9e('0x4e')][_0x2d9e('0x4f')]({'where':{'name':_0x355709,'userProfileId':_0x251460['userProfileId']},'raw':!![]})['then'](function(_0xdd660d){if(_0xdd660d&&_0xdd660d[_0x2d9e('0x50')]===0x0){return db[_0x2d9e('0x51')][_0x2d9e('0x48')]({'name':_0x28a4f4[_0x2d9e('0x33')],'resourceId':_0x28a4f4['id'],'type':_0xdd660d[_0x2d9e('0x33')],'sectionId':_0xdd660d['id']},{})[_0x2d9e('0x29')](function(){return _0x5905eb;});}else{return _0x5905eb;}})['catch'](function(_0x4672fd){logger[_0x2d9e('0x52')](_0x2d9e('0x53'),_0x4672fd);throw _0x4672fd;});}return _0x5905eb;})[_0x2d9e('0x29')](respondWithResult(_0x57d725,0xc9))[_0x2d9e('0x54')](handleError(_0x57d725,null));};exports[_0x2d9e('0x28')]=function(_0x1bc5c2,_0x92e41e){if(_0x1bc5c2[_0x2d9e('0x49')]['id']){delete _0x1bc5c2[_0x2d9e('0x49')]['id'];}return db[_0x2d9e('0x2e')][_0x2d9e('0x4f')]({'where':{'id':_0x1bc5c2['params']['id']}})[_0x2d9e('0x29')](handleEntityNotFound(_0x92e41e,null))['then'](saveUpdates(_0x1bc5c2[_0x2d9e('0x49')],null))[_0x2d9e('0x29')](respondWithResult(_0x92e41e,null))[_0x2d9e('0x54')](handleError(_0x92e41e,null));};exports[_0x2d9e('0x2a')]=function(_0x343647,_0xf00d0d){return db[_0x2d9e('0x2e')][_0x2d9e('0x4f')]({'where':{'id':_0x343647[_0x2d9e('0x55')]['id']}})[_0x2d9e('0x29')](handleEntityNotFound(_0xf00d0d,null))[_0x2d9e('0x29')](removeEntity(_0xf00d0d,null))[_0x2d9e('0x54')](handleError(_0xf00d0d,null));};exports[_0x2d9e('0x56')]=function(_0x31084e,_0x175d1d,_0x1ae2f3){if(_0x31084e[_0x2d9e('0x49')]['id']){delete _0x31084e[_0x2d9e('0x49')]['id'];}return db['Interval'][_0x2d9e('0x4f')]({'where':{'id':_0x31084e['params']['id']}})[_0x2d9e('0x29')](handleEntityNotFound(_0x175d1d,null))[_0x2d9e('0x29')](function(_0x30ee55){if(_0x30ee55){_0x31084e[_0x2d9e('0x49')][_0x2d9e('0x57')]=_0x30ee55['id'];return db[_0x2d9e('0x2e')]['create'](_0x31084e[_0x2d9e('0x49')]);}})['then'](respondWithResult(_0x175d1d,null))['catch'](handleError(_0x175d1d,null));};exports['getIntervals']=function(_0x4b92c6,_0x16b3c6,_0x597fa2){var _0x16380f={};var _0x2f3c77={};var _0xae5d98;var _0x2078de;return db[_0x2d9e('0x2e')][_0x2d9e('0x58')]({'where':{'id':_0x4b92c6[_0x2d9e('0x55')]['id']}})[_0x2d9e('0x29')](handleEntityNotFound(_0x16b3c6,null))['then'](function(_0x7e3370){if(_0x7e3370){_0xae5d98=_0x7e3370;_0x2f3c77['model']=_['keys'](db[_0x2d9e('0x2e')][_0x2d9e('0x47')]);_0x2f3c77[_0x2d9e('0x34')]=_[_0x2d9e('0x46')](_0x4b92c6['query']);_0x2f3c77[_0x2d9e('0x3d')]=_['intersection'](_0x2f3c77[_0x2d9e('0x32')],_0x2f3c77[_0x2d9e('0x34')]);_0x16380f[_0x2d9e('0x36')]=_[_0x2d9e('0x35')](_0x2f3c77['model'],qs['fields'](_0x4b92c6[_0x2d9e('0x34')][_0x2d9e('0x37')]));_0x16380f[_0x2d9e('0x36')]=_0x16380f['attributes'][_0x2d9e('0x38')]?_0x16380f[_0x2d9e('0x36')]:_0x2f3c77[_0x2d9e('0x32')];_0x16380f['order']=qs[_0x2d9e('0x3b')](_0x4b92c6['query']['sort']);_0x16380f[_0x2d9e('0x3c')]=qs[_0x2d9e('0x3d')](_['pick'](_0x4b92c6[_0x2d9e('0x34')],_0x2f3c77['filters']));if(_0x4b92c6[_0x2d9e('0x34')][_0x2d9e('0x40')]){_0x16380f[_0x2d9e('0x3c')]=_['merge'](_0x16380f[_0x2d9e('0x3c')],{'$or':_['map'](_0x16380f['attributes'],function(_0x41337d){var _0x559f36={};_0x559f36[_0x41337d]={'$like':'%'+_0x4b92c6[_0x2d9e('0x34')][_0x2d9e('0x40')]+'%'};return _0x559f36;})});}_0x16380f=_[_0x2d9e('0x3e')]({},_0x16380f,_0x4b92c6[_0x2d9e('0x41')]);return _0xae5d98[_0x2d9e('0x59')](_0x16380f);}})['then'](function(_0x53e424){if(_0x53e424){_0x2078de=_0x53e424[_0x2d9e('0x38')];if(!_0x4b92c6[_0x2d9e('0x34')][_0x2d9e('0x5a')](_0x2d9e('0x39'))){_0x16380f[_0x2d9e('0x20')]=qs[_0x2d9e('0x20')](_0x4b92c6[_0x2d9e('0x34')][_0x2d9e('0x20')]);_0x16380f[_0x2d9e('0x21')]=qs[_0x2d9e('0x21')](_0x4b92c6[_0x2d9e('0x34')]['offset']);}return _0xae5d98['getIntervals'](_0x16380f);}})['then'](function(_0x15a25a){if(_0x15a25a){return _0x15a25a?{'count':_0x2078de,'rows':_0x15a25a}:null;}})[_0x2d9e('0x29')](respondWithResult(_0x16b3c6,null))[_0x2d9e('0x54')](handleError(_0x16b3c6,null));};exports[_0x2d9e('0x5b')]=function(_0x8f2db5,_0xea2915,_0x4af402){return db[_0x2d9e('0x2e')][_0x2d9e('0x58')]({'where':{'id':_0x8f2db5[_0x2d9e('0x55')]['id']}})[_0x2d9e('0x29')](handleEntityNotFound(_0xea2915,null))[_0x2d9e('0x29')](function(_0x1d0ad2){if(_0x1d0ad2){return db['sequelize']['transaction'](function(_0x3d1c1b){return db[_0x2d9e('0x2e')]['destroy']({'where':{'IntervalId':_0x8f2db5[_0x2d9e('0x55')]['id']},'transaction':_0x3d1c1b})[_0x2d9e('0x29')](function(_0x281ff0){var _0x18d20b=_[_0x2d9e('0x2d')](_0x8f2db5[_0x2d9e('0x49')],function(_0x34688d){delete _0x34688d['id'];_0x34688d[_0x2d9e('0x57')]=_0x8f2db5['params']['id'];return _0x34688d;});return db['Interval'][_0x2d9e('0x5c')](_0x18d20b,{'transaction':_0x3d1c1b});});})['then'](function(){return db[_0x2d9e('0x2e')]['findAll']({'where':{'IntervalId':_0x8f2db5[_0x2d9e('0x55')]['id']}});});}})['then'](respondWithResult(_0xea2915,null))['catch'](handleError(_0xea2915,null));}; \ No newline at end of file +var _0x2345=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','name','map','Interval','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','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','findOne','getIntervals','hasOwnProperty','transaction','IntervalId','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x2345,0x1af));var _0x5234=function(_0x57b06e,_0x55fd9c){_0x57b06e=_0x57b06e-0x0;var _0x3fab1a=_0x2345[_0x57b06e];return _0x3fab1a;};'use strict';var emlformat=require(_0x5234('0x0'));var rimraf=require(_0x5234('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5234('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5234('0x3'));var Mustache=require(_0x5234('0x4'));var util=require('util');var path=require(_0x5234('0x5'));var sox=require(_0x5234('0x6'));var csv=require(_0x5234('0x7'));var ejs=require(_0x5234('0x8'));var fs=require('fs');var fs_extra=require(_0x5234('0x9'));var _=require(_0x5234('0xa'));var squel=require(_0x5234('0xb'));var crypto=require(_0x5234('0xc'));var jsforce=require(_0x5234('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5234('0x7'));var querystring=require(_0x5234('0xe'));var Papa=require(_0x5234('0xf'));var Redis=require(_0x5234('0x10'));var authService=require(_0x5234('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5234('0x12'));var hardwareService=require(_0x5234('0x13'));var logger=require(_0x5234('0x14'))(_0x5234('0x15'));var utils=require('../../config/utils');var config=require(_0x5234('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5234('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x3424ad,_0x1e1086){_0x1e1086=_0x1e1086||0xcc;return function(_0x30325e){if(_0x30325e){return _0x3424ad[_0x5234('0x18')](_0x1e1086);}return _0x3424ad['status'](_0x1e1086)[_0x5234('0x19')]();};}function respondWithResult(_0x1ff810,_0x3a013f){_0x3a013f=_0x3a013f||0xc8;return function(_0xc063e){if(_0xc063e){return _0x1ff810[_0x5234('0x1a')](_0x3a013f)[_0x5234('0x1b')](_0xc063e);}};}function respondWithFilteredResult(_0x1edeb3,_0x5d320d){return function(_0x41bf20){if(_0x41bf20){var _0x14b346=typeof _0x5d320d[_0x5234('0x1c')]===_0x5234('0x1d')&&typeof _0x5d320d[_0x5234('0x1e')]===_0x5234('0x1d');var _0x205d82=_0x41bf20[_0x5234('0x1f')];var _0x48550b=_0x14b346?0x0:_0x5d320d[_0x5234('0x1c')];var _0x18353e=_0x14b346?_0x41bf20['count']:_0x5d320d[_0x5234('0x1c')]+_0x5d320d[_0x5234('0x1e')];var _0x301e57;if(_0x18353e>=_0x205d82){_0x18353e=_0x205d82;_0x301e57=0xc8;}else{_0x301e57=0xce;}_0x1edeb3[_0x5234('0x1a')](_0x301e57);return _0x1edeb3[_0x5234('0x20')](_0x5234('0x21'),_0x48550b+'-'+_0x18353e+'/'+_0x205d82)[_0x5234('0x1b')](_0x41bf20);}return null;};}function patchUpdates(_0x49eb4b){return function(_0xb09421){try{jsonpatch['apply'](_0xb09421,_0x49eb4b,!![]);}catch(_0x1c4f79){return BPromise[_0x5234('0x22')](_0x1c4f79);}return _0xb09421[_0x5234('0x23')]();};}function saveUpdates(_0x162391,_0x1547c8){return function(_0x198680){if(_0x198680){return _0x198680[_0x5234('0x24')](_0x162391)[_0x5234('0x25')](function(_0x1d0806){return _0x1d0806;});}return null;};}function removeEntity(_0x23c1c0,_0x56b755){return function(_0x6f0cb5){if(_0x6f0cb5){return _0x6f0cb5[_0x5234('0x26')]()[_0x5234('0x25')](function(){var _0x51cc8b=_0x6f0cb5[_0x5234('0x27')]({'plain':!![]});var _0x78594f=_0x5234('0x28');return db[_0x5234('0x29')][_0x5234('0x26')]({'where':{'type':_0x78594f,'resourceId':_0x51cc8b['id']}})[_0x5234('0x25')](function(){return _0x6f0cb5;});})[_0x5234('0x25')](function(){_0x23c1c0[_0x5234('0x1a')](0xcc)[_0x5234('0x19')]();});}};}function handleEntityNotFound(_0x289bcc,_0x2f4685){return function(_0x1e58e0){if(!_0x1e58e0){_0x289bcc[_0x5234('0x18')](0x194);}return _0x1e58e0;};}function handleError(_0x2ed432,_0x4773b4){_0x4773b4=_0x4773b4||0x1f4;return function(_0xcf15a2){logger[_0x5234('0x2a')](_0xcf15a2['stack']);if(_0xcf15a2[_0x5234('0x2b')]){delete _0xcf15a2['name'];}_0x2ed432['status'](_0x4773b4)['send'](_0xcf15a2);};}exports['index']=function(_0x158a40,_0x4ee876){var _0x576c76={},_0x28ee7f={},_0x21225b={'count':0x0,'rows':[]};var _0x3a1b94=_[_0x5234('0x2c')](db[_0x5234('0x2d')][_0x5234('0x2e')],function(_0x54f1dd){return{'name':_0x54f1dd[_0x5234('0x2f')],'type':_0x54f1dd[_0x5234('0x30')]['key']};});_0x28ee7f['model']=_[_0x5234('0x2c')](_0x3a1b94,_0x5234('0x2b'));_0x28ee7f[_0x5234('0x31')]=_['keys'](_0x158a40[_0x5234('0x31')]);_0x28ee7f['filters']=_[_0x5234('0x32')](_0x28ee7f[_0x5234('0x33')],_0x28ee7f[_0x5234('0x31')]);_0x576c76[_0x5234('0x34')]=_[_0x5234('0x32')](_0x28ee7f['model'],qs[_0x5234('0x35')](_0x158a40[_0x5234('0x31')][_0x5234('0x35')]));_0x576c76[_0x5234('0x34')]=_0x576c76[_0x5234('0x34')]['length']?_0x576c76['attributes']:_0x28ee7f[_0x5234('0x33')];if(!_0x158a40[_0x5234('0x31')]['hasOwnProperty'](_0x5234('0x36'))){_0x576c76[_0x5234('0x1e')]=qs[_0x5234('0x1e')](_0x158a40[_0x5234('0x31')][_0x5234('0x1e')]);_0x576c76[_0x5234('0x1c')]=qs['offset'](_0x158a40[_0x5234('0x31')][_0x5234('0x1c')]);}_0x576c76[_0x5234('0x37')]=qs[_0x5234('0x38')](_0x158a40[_0x5234('0x31')]['sort']);_0x576c76['where']=qs[_0x5234('0x39')](_[_0x5234('0x3a')](_0x158a40[_0x5234('0x31')],_0x28ee7f[_0x5234('0x39')]),_0x3a1b94);if(_0x158a40['query'][_0x5234('0x3b')]){_0x576c76[_0x5234('0x3c')]=_[_0x5234('0x3d')](_0x576c76[_0x5234('0x3c')],{'$or':_[_0x5234('0x2c')](_0x3a1b94,function(_0x5b495b){if(_0x5b495b[_0x5234('0x30')]!==_0x5234('0x3e')){var _0xb7e2c5={};_0xb7e2c5[_0x5b495b[_0x5234('0x2b')]]={'$like':'%'+_0x158a40[_0x5234('0x31')][_0x5234('0x3b')]+'%'};return _0xb7e2c5;}})});}_0x576c76=_[_0x5234('0x3d')]({},_0x576c76,_0x158a40[_0x5234('0x3f')]);var _0x4613f1={'where':_0x576c76[_0x5234('0x3c')]};return db[_0x5234('0x2d')][_0x5234('0x1f')](_0x4613f1)[_0x5234('0x25')](function(_0x3257ba){_0x21225b[_0x5234('0x1f')]=_0x3257ba;if(_0x158a40['query'][_0x5234('0x40')]){_0x576c76[_0x5234('0x41')]=[{'all':!![]}];}return db[_0x5234('0x2d')][_0x5234('0x42')](_0x576c76);})[_0x5234('0x25')](function(_0x496485){_0x21225b[_0x5234('0x43')]=_0x496485;return _0x21225b;})[_0x5234('0x25')](respondWithFilteredResult(_0x4ee876,_0x576c76))[_0x5234('0x44')](handleError(_0x4ee876,null));};exports[_0x5234('0x45')]=function(_0x445638,_0x1a6d98){var _0x3fc4ff={'raw':!![],'where':{'id':_0x445638[_0x5234('0x46')]['id']}},_0x536a7a={};_0x536a7a[_0x5234('0x33')]=_[_0x5234('0x47')](db[_0x5234('0x2d')]['rawAttributes']);_0x536a7a['query']=_[_0x5234('0x47')](_0x445638[_0x5234('0x31')]);_0x536a7a[_0x5234('0x39')]=_[_0x5234('0x32')](_0x536a7a[_0x5234('0x33')],_0x536a7a['query']);_0x3fc4ff[_0x5234('0x34')]=_['intersection'](_0x536a7a[_0x5234('0x33')],qs['fields'](_0x445638[_0x5234('0x31')][_0x5234('0x35')]));_0x3fc4ff[_0x5234('0x34')]=_0x3fc4ff[_0x5234('0x34')][_0x5234('0x48')]?_0x3fc4ff[_0x5234('0x34')]:_0x536a7a[_0x5234('0x33')];if(_0x445638[_0x5234('0x31')][_0x5234('0x40')]){_0x3fc4ff['include']=[{'all':!![]}];}_0x3fc4ff=_[_0x5234('0x3d')]({},_0x3fc4ff,_0x445638[_0x5234('0x3f')]);return db[_0x5234('0x2d')][_0x5234('0x49')](_0x3fc4ff)[_0x5234('0x25')](handleEntityNotFound(_0x1a6d98,null))[_0x5234('0x25')](respondWithResult(_0x1a6d98,null))[_0x5234('0x44')](handleError(_0x1a6d98,null));};exports[_0x5234('0x4a')]=function(_0x207ace,_0x396869){return db[_0x5234('0x2d')]['create'](_0x207ace[_0x5234('0x4b')],{})['then'](function(_0x36f6d9){var _0x4e2d0c=_0x207ace[_0x5234('0x4c')][_0x5234('0x27')]({'plain':!![]});if(!_0x4e2d0c)throw new Error(_0x5234('0x4d'));if(_0x4e2d0c[_0x5234('0x4e')]===_0x5234('0x4c')){var _0x42769e=_0x36f6d9[_0x5234('0x27')]({'plain':!![]});var _0x26f339=_0x5234('0x28');return db[_0x5234('0x4f')][_0x5234('0x49')]({'where':{'name':_0x26f339,'userProfileId':_0x4e2d0c[_0x5234('0x50')]},'raw':!![]})[_0x5234('0x25')](function(_0x59449a){if(_0x59449a&&_0x59449a[_0x5234('0x51')]===0x0){return db[_0x5234('0x29')][_0x5234('0x4a')]({'name':_0x42769e[_0x5234('0x2b')],'resourceId':_0x42769e['id'],'type':_0x59449a[_0x5234('0x2b')],'sectionId':_0x59449a['id']},{})[_0x5234('0x25')](function(){return _0x36f6d9;});}else{return _0x36f6d9;}})[_0x5234('0x44')](function(_0x1fb0a3){logger['error'](_0x5234('0x52'),_0x1fb0a3);throw _0x1fb0a3;});}return _0x36f6d9;})[_0x5234('0x25')](respondWithResult(_0x396869,0xc9))[_0x5234('0x44')](handleError(_0x396869,null));};exports[_0x5234('0x24')]=function(_0x5dd2fe,_0x4d88aa){if(_0x5dd2fe[_0x5234('0x4b')]['id']){delete _0x5dd2fe[_0x5234('0x4b')]['id'];}return db[_0x5234('0x2d')][_0x5234('0x49')]({'where':{'id':_0x5dd2fe[_0x5234('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d88aa,null))[_0x5234('0x25')](saveUpdates(_0x5dd2fe[_0x5234('0x4b')],null))[_0x5234('0x25')](respondWithResult(_0x4d88aa,null))[_0x5234('0x44')](handleError(_0x4d88aa,null));};exports[_0x5234('0x26')]=function(_0x2f2d96,_0x321289){return db['Interval'][_0x5234('0x49')]({'where':{'id':_0x2f2d96[_0x5234('0x46')]['id']}})['then'](handleEntityNotFound(_0x321289,null))[_0x5234('0x25')](removeEntity(_0x321289,null))[_0x5234('0x44')](handleError(_0x321289,null));};exports['addInterval']=function(_0x5be6e4,_0x41a199,_0x1d2d6a){if(_0x5be6e4[_0x5234('0x4b')]['id']){delete _0x5be6e4[_0x5234('0x4b')]['id'];}return db[_0x5234('0x2d')]['find']({'where':{'id':_0x5be6e4['params']['id']}})[_0x5234('0x25')](handleEntityNotFound(_0x41a199,null))[_0x5234('0x25')](function(_0x3dcddb){if(_0x3dcddb){_0x5be6e4[_0x5234('0x4b')]['IntervalId']=_0x3dcddb['id'];return db[_0x5234('0x2d')]['create'](_0x5be6e4['body']);}})[_0x5234('0x25')](respondWithResult(_0x41a199,null))['catch'](handleError(_0x41a199,null));};exports['getIntervals']=function(_0x248046,_0xb18410,_0x1c6338){var _0x3a0ae2={};var _0x128579={};var _0x534280;var _0x43ce96;return db['Interval'][_0x5234('0x53')]({'where':{'id':_0x248046[_0x5234('0x46')]['id']}})['then'](handleEntityNotFound(_0xb18410,null))['then'](function(_0x1fd833){if(_0x1fd833){_0x534280=_0x1fd833;_0x128579[_0x5234('0x33')]=_[_0x5234('0x47')](db[_0x5234('0x2d')][_0x5234('0x2e')]);_0x128579[_0x5234('0x31')]=_['keys'](_0x248046[_0x5234('0x31')]);_0x128579[_0x5234('0x39')]=_['intersection'](_0x128579[_0x5234('0x33')],_0x128579[_0x5234('0x31')]);_0x3a0ae2[_0x5234('0x34')]=_[_0x5234('0x32')](_0x128579[_0x5234('0x33')],qs[_0x5234('0x35')](_0x248046[_0x5234('0x31')][_0x5234('0x35')]));_0x3a0ae2[_0x5234('0x34')]=_0x3a0ae2['attributes'][_0x5234('0x48')]?_0x3a0ae2['attributes']:_0x128579['model'];_0x3a0ae2[_0x5234('0x37')]=qs[_0x5234('0x38')](_0x248046[_0x5234('0x31')][_0x5234('0x38')]);_0x3a0ae2['where']=qs['filters'](_[_0x5234('0x3a')](_0x248046[_0x5234('0x31')],_0x128579[_0x5234('0x39')]));if(_0x248046[_0x5234('0x31')][_0x5234('0x3b')]){_0x3a0ae2[_0x5234('0x3c')]=_[_0x5234('0x3d')](_0x3a0ae2[_0x5234('0x3c')],{'$or':_[_0x5234('0x2c')](_0x3a0ae2[_0x5234('0x34')],function(_0x4dcfb0){var _0x3494cc={};_0x3494cc[_0x4dcfb0]={'$like':'%'+_0x248046[_0x5234('0x31')]['filter']+'%'};return _0x3494cc;})});}_0x3a0ae2=_[_0x5234('0x3d')]({},_0x3a0ae2,_0x248046['options']);return _0x534280[_0x5234('0x54')](_0x3a0ae2);}})['then'](function(_0x34c205){if(_0x34c205){_0x43ce96=_0x34c205[_0x5234('0x48')];if(!_0x248046[_0x5234('0x31')][_0x5234('0x55')](_0x5234('0x36'))){_0x3a0ae2[_0x5234('0x1e')]=qs[_0x5234('0x1e')](_0x248046['query'][_0x5234('0x1e')]);_0x3a0ae2['offset']=qs[_0x5234('0x1c')](_0x248046[_0x5234('0x31')][_0x5234('0x1c')]);}return _0x534280[_0x5234('0x54')](_0x3a0ae2);}})[_0x5234('0x25')](function(_0x53f44e){if(_0x53f44e){return _0x53f44e?{'count':_0x43ce96,'rows':_0x53f44e}:null;}})[_0x5234('0x25')](respondWithResult(_0xb18410,null))[_0x5234('0x44')](handleError(_0xb18410,null));};exports['addIntervals']=function(_0x36a02a,_0x2d2569,_0x38c370){return db[_0x5234('0x2d')][_0x5234('0x53')]({'where':{'id':_0x36a02a['params']['id']}})[_0x5234('0x25')](handleEntityNotFound(_0x2d2569,null))['then'](function(_0x5dec5e){if(_0x5dec5e){return db['sequelize'][_0x5234('0x56')](function(_0x212f03){return db['Interval'][_0x5234('0x26')]({'where':{'IntervalId':_0x36a02a[_0x5234('0x46')]['id']},'transaction':_0x212f03})[_0x5234('0x25')](function(_0x28faac){var _0xc3737d=_[_0x5234('0x2c')](_0x36a02a[_0x5234('0x4b')],function(_0x537d50){delete _0x537d50['id'];_0x537d50[_0x5234('0x57')]=_0x36a02a['params']['id'];return _0x537d50;});return db[_0x5234('0x2d')]['bulkCreate'](_0xc3737d,{'transaction':_0x212f03});});})[_0x5234('0x25')](function(){return db[_0x5234('0x2d')][_0x5234('0x42')]({'where':{'IntervalId':_0x36a02a[_0x5234('0x46')]['id']}});});}})[_0x5234('0x25')](respondWithResult(_0x2d2569,null))[_0x5234('0x44')](handleError(_0x2d2569,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 409d8f5..fb18e24 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 _0x4961=['exports','define','Interval','rewrite','lodash','util','../../config/logger','api','bluebird','rimraf','../../components/extensions/rewrite'];(function(_0x15b4cd,_0x15d00f){var _0x3f5718=function(_0x2fbab3){while(--_0x2fbab3){_0x15b4cd['push'](_0x15b4cd['shift']());}};_0x3f5718(++_0x15d00f);}(_0x4961,0x1a6));var _0x1496=function(_0x33a905,_0x3725e0){_0x33a905=_0x33a905-0x0;var _0x5aeca7=_0x4961[_0x33a905];return _0x5aeca7;};'use strict';var _=require(_0x1496('0x0'));var util=require(_0x1496('0x1'));var logger=require(_0x1496('0x2'))(_0x1496('0x3'));var moment=require('moment');var BPromise=require(_0x1496('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1496('0x5'));var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0x1496('0x6'));module[_0x1496('0x7')]=function(_0x4af50d,_0x81bda2){return _0x4af50d[_0x1496('0x8')](_0x1496('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4392d1,_0x230290){extensions['rewrite'](_0x4af50d,_0x4392d1);},'afterBulkCreate':function(_0x3ab125,_0x3e6ef6,_0x4f4a89){_0x4f4a89();extensions['rewrite'](_0x4af50d,_0x3ab125[0x0]);},'afterUpdate':function(_0x416d01,_0x1a1609){extensions['rewrite'](_0x4af50d,_0x416d01);},'afterDestroy':function(_0x5d9a9e,_0x2a6efc){extensions[_0x1496('0xa')](_0x4af50d,_0x5d9a9e);}}});}; \ No newline at end of file +var _0xf561=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xf561,0x195));var _0x1f56=function(_0x461695,_0x447787){_0x461695=_0x461695-0x0;var _0x29472a=_0xf561[_0x461695];return _0x29472a;};'use strict';var _=require(_0x1f56('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1f56('0x1'));var moment=require(_0x1f56('0x2'));var BPromise=require(_0x1f56('0x3'));var rp=require(_0x1f56('0x4'));var fs=require('fs');var path=require(_0x1f56('0x5'));var rimraf=require(_0x1f56('0x6'));var config=require(_0x1f56('0x7'));var attributes=require(_0x1f56('0x8'));var extensions=require(_0x1f56('0x9'));module[_0x1f56('0xa')]=function(_0x4654eb,_0x5d13a4){return _0x4654eb[_0x1f56('0xb')](_0x1f56('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e8d98,_0x22aba6){extensions[_0x1f56('0xd')](_0x4654eb,_0x4e8d98);},'afterBulkCreate':function(_0x12f57c,_0x37e556,_0x3d36fa){_0x3d36fa();extensions[_0x1f56('0xd')](_0x4654eb,_0x12f57c[0x0]);},'afterUpdate':function(_0xbb6061,_0x6bafdc){extensions[_0x1f56('0xd')](_0x4654eb,_0xbb6061);},'afterDestroy':function(_0x5d2feb,_0x2611d9){extensions[_0x1f56('0xd')](_0x4654eb,_0x5d2feb);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 64c314a..e5d1ab7 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 88a571e..aacc167 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x3ced47,_0x28f492){var _0x3ad748=function(_0x5ba887){while(--_0x5ba887){_0x3ced47['push'](_0x3ced47['shift']());}};_0x3ad748(++_0x28f492);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d745a,_0x107671){_0x1d745a=_0x1d745a-0x0;var _0x5d34f8=_0x5f2f[_0x1d745a];return _0x5d34f8;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x388720,_0x2c10ca){var _0x2bd37a=function(_0x57a0ed){while(--_0x57a0ed){_0x388720['push'](_0x388720['shift']());}};_0x2bd37a(++_0x2c10ca);}(_0xdb28,0x106));var _0x8db2=function(_0x355068,_0x2207d9){_0x355068=_0x355068-0x0;var _0x2c50d6=_0xdb28[_0x355068];return _0x2c50d6;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 05cb718..08b61fb 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 _0x49c7=['name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','stringify','utf8','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','headers','x-forwarded-for','remoteAddress','connection','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','Bug','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0x49c7,0x121));var _0x749c=function(_0x3325bd,_0x3102eb){_0x3325bd=_0x3325bd-0x0;var _0x10a37d=_0x49c7[_0x3325bd];return _0x10a37d;};'use strict';var BPromise=require(_0x749c('0x0'));var https=require(_0x749c('0x1'));var logger=require('../../config/logger')(_0x749c('0x2'));var USERNAME=_0x749c('0x3');var PASSWORD=_0x749c('0x4');function openIssue(_0x2e32c4,_0x4e959e){var _0x395dc={'fields':{'project':{'key':_0x2e32c4[_0x749c('0x5')]||_0x749c('0x6')},'summary':(_0x2e32c4[_0x749c('0x7')]||_0x749c('0x8'))+_0x749c('0x9')+_0x2e32c4['ip'],'description':_0x2e32c4[_0x749c('0xa')]||JSON['stringify'](_0x2e32c4),'issuetype':{'name':_0x2e32c4['issuetype']||_0x749c('0xb')}}};_0x395dc['fields']['customfield_11500']=_0x2e32c4[_0x749c('0xc')];_0x395dc[_0x749c('0xd')][_0x749c('0xe')]=_0x2e32c4[_0x749c('0xf')];_0x395dc[_0x749c('0xd')][_0x749c('0x10')]=_0x2e32c4[_0x749c('0x11')];_0x395dc[_0x749c('0xd')][_0x749c('0x12')]=_0x2e32c4[_0x749c('0x13')];_0x395dc[_0x749c('0xd')][_0x749c('0x14')]=_0x2e32c4[_0x749c('0x15')];_0x395dc['fields'][_0x749c('0x16')]=_0x2e32c4['ip'];var _0x5e5281={'host':_0x749c('0x17'),'port':0x1bb,'path':_0x749c('0x18'),'method':_0x749c('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x749c('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x749c('0x1b')]('base64')}};var _0x3b9d4d=JSON[_0x749c('0x1c')](_0x395dc);var _0x1039a2=https['request'](_0x5e5281,function(_0x40a335){_0x40a335['setEncoding'](_0x749c('0x1d'));var _0x1f06eb='';_0x40a335['on']('data',function(_0x4f1684){_0x1f06eb+=_0x4f1684;});_0x40a335['on'](_0x749c('0x1e'),function(){if(_0x4e959e){return _0x4e959e[_0x749c('0x1f')](_0x40a335[_0x749c('0x20')])[_0x749c('0x21')](JSON[_0x749c('0x22')](_0x1f06eb));}});});_0x1039a2['on']('error',function(_0x4ada14){if(_0x4e959e){return _0x4e959e['status'](0x1f4)[_0x749c('0x21')]({'errors':[{'message':_0x749c('0x23'),'type':_0x749c('0x24')}]});}});_0x1039a2[_0x749c('0x25')](_0x3b9d4d);_0x1039a2[_0x749c('0x1e')]();}exports['openIssue']=openIssue;exports[_0x749c('0x26')]=function(_0x5028ce,_0x3d81c5){_0x5028ce[_0x749c('0x27')]['ip']=_0x5028ce[_0x749c('0x28')][_0x749c('0x29')]||_0x5028ce['connection'][_0x749c('0x2a')]||_0x5028ce['socket']['remoteAddress']||_0x5028ce[_0x749c('0x2b')]['socket'][_0x749c('0x2a')];return openIssue(_0x5028ce[_0x749c('0x27')],_0x3d81c5);}; \ No newline at end of file +var _0xe3be=['fields','customfield_11500','email','customfield_11501','oldToken','newToken','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','request','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','body','headers','x-forwarded-for','connection','socket','remoteAddress','bluebird','api','support','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xe3be,0xd0));var _0xee3b=function(_0x30f11d,_0x3cda8e){_0x30f11d=_0x30f11d-0x0;var _0x4ca3a0=_0xe3be[_0x30f11d];return _0x4ca3a0;};'use strict';var BPromise=require(_0xee3b('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xee3b('0x1'));var USERNAME=_0xee3b('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5f0bb9,_0x1c4eae){var _0x55cdbd={'fields':{'project':{'key':_0x5f0bb9[_0xee3b('0x3')]||_0xee3b('0x4')},'summary':(_0x5f0bb9[_0xee3b('0x5')]||_0xee3b('0x6'))+_0xee3b('0x7')+_0x5f0bb9['ip'],'description':_0x5f0bb9[_0xee3b('0x8')]||JSON[_0xee3b('0x9')](_0x5f0bb9),'issuetype':{'name':_0x5f0bb9[_0xee3b('0xa')]||_0xee3b('0xb')}}};_0x55cdbd[_0xee3b('0xc')][_0xee3b('0xd')]=_0x5f0bb9[_0xee3b('0xe')];_0x55cdbd[_0xee3b('0xc')][_0xee3b('0xf')]=_0x5f0bb9[_0xee3b('0x10')];_0x55cdbd[_0xee3b('0xc')]['customfield_11502']=_0x5f0bb9[_0xee3b('0x11')];_0x55cdbd[_0xee3b('0xc')]['customfield_11503']=_0x5f0bb9['name'];_0x55cdbd[_0xee3b('0xc')]['customfield_11504']=_0x5f0bb9['reason'];_0x55cdbd[_0xee3b('0xc')][_0xee3b('0x12')]=_0x5f0bb9['ip'];var _0x5c0709={'host':_0xee3b('0x13'),'port':0x1bb,'path':_0xee3b('0x14'),'method':_0xee3b('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xee3b('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xee3b('0x17')]('base64')}};var _0x419b56=JSON[_0xee3b('0x9')](_0x55cdbd);var _0x1795d2=https[_0xee3b('0x18')](_0x5c0709,function(_0x27176d){_0x27176d[_0xee3b('0x19')](_0xee3b('0x1a'));var _0x4625e2='';_0x27176d['on'](_0xee3b('0x1b'),function(_0x12e711){_0x4625e2+=_0x12e711;});_0x27176d['on']('end',function(){if(_0x1c4eae){return _0x1c4eae[_0xee3b('0x1c')](_0x27176d[_0xee3b('0x1d')])[_0xee3b('0x1e')](JSON[_0xee3b('0x1f')](_0x4625e2));}});});_0x1795d2['on'](_0xee3b('0x20'),function(_0x1283a1){if(_0x1c4eae){return _0x1c4eae[_0xee3b('0x1c')](0x1f4)[_0xee3b('0x1e')]({'errors':[{'message':_0xee3b('0x21'),'type':_0xee3b('0x22')}]});}});_0x1795d2[_0xee3b('0x23')](_0x419b56);_0x1795d2[_0xee3b('0x24')]();}exports[_0xee3b('0x25')]=openIssue;exports['send']=function(_0x59f477,_0x247cfb){_0x59f477[_0xee3b('0x26')]['ip']=_0x59f477[_0xee3b('0x27')][_0xee3b('0x28')]||_0x59f477[_0xee3b('0x29')]['remoteAddress']||_0x59f477[_0xee3b('0x2a')][_0xee3b('0x2b')]||_0x59f477[_0xee3b('0x29')]['socket'][_0xee3b('0x2b')];return openIssue(_0x59f477['body'],_0x247cfb);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 4fbee74..b83c4f0 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f7a=['isAuthenticated','index','/describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x35b157,_0x156bc9){var _0x4bd6b3=function(_0x28092e){while(--_0x28092e){_0x35b157['push'](_0x35b157['shift']());}};_0x4bd6b3(++_0x156bc9);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x3e7a91,_0x26a7a1){_0x3e7a91=_0x3e7a91-0x0;var _0x227594=_0x6f7a[_0x3e7a91];return _0x227594;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa6f7('0x11')](_0xa6f7('0xe'),auth['isAuthenticated'](),controller[_0xa6f7('0x12')]);router['delete'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x13')]);module[_0xa6f7('0x14')]=router; \ No newline at end of file +var _0x55e0=['./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x53ea0a,_0x24904d){var _0x776a77=function(_0x23759b){while(--_0x23759b){_0x53ea0a['push'](_0x53ea0a['shift']());}};_0x776a77(++_0x24904d);}(_0x55e0,0xdc));var _0x055e=function(_0x5dc325,_0xeac27c){_0x5dc325=_0x5dc325-0x0;var _0x5a7e24=_0x55e0[_0x5dc325];return _0x5a7e24;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/describe',auth[_0x055e('0xa')](),controller[_0x055e('0xb')]);router[_0x055e('0x9')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller['show']);router[_0x055e('0xd')]('/',auth[_0x055e('0xa')](),controller[_0x055e('0xe')]);router[_0x055e('0xf')](_0x055e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x055e('0x10')]('/:id',auth[_0x055e('0xa')](),controller[_0x055e('0x11')]);module[_0x055e('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 29c0f4d..a1b4eef 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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x320d2d,_0x94293e){_0x320d2d=_0x320d2d-0x0;var _0x130969=_0x7a54[_0x320d2d];return _0x130969;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x780abb,_0x5f6741){_0x780abb=_0x780abb-0x0;var _0x28a7f2=_0x7a54[_0x780abb];return _0x28a7f2;};'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 16af4e7..6e324d1 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 _0xcf71=['intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','query','keys'];(function(_0x32f4a8,_0x20e3d1){var _0x3df796=function(_0x220862){while(--_0x220862){_0x32f4a8['push'](_0x32f4a8['shift']());}};_0x3df796(++_0x20e3d1);}(_0xcf71,0xba));var _0x1cf7=function(_0x45a7a6,_0x380289){_0x45a7a6=_0x45a7a6-0x0;var _0x514f51=_0xcf71[_0x45a7a6];return _0x514f51;};'use strict';var emlformat=require(_0x1cf7('0x0'));var rimraf=require(_0x1cf7('0x1'));var zipdir=require(_0x1cf7('0x2'));var jsonpatch=require(_0x1cf7('0x3'));var rp=require('request-promise');var moment=require(_0x1cf7('0x4'));var BPromise=require(_0x1cf7('0x5'));var Mustache=require(_0x1cf7('0x6'));var util=require(_0x1cf7('0x7'));var path=require(_0x1cf7('0x8'));var sox=require(_0x1cf7('0x9'));var csv=require(_0x1cf7('0xa'));var ejs=require(_0x1cf7('0xb'));var fs=require('fs');var fs_extra=require(_0x1cf7('0xc'));var _=require(_0x1cf7('0xd'));var squel=require(_0x1cf7('0xe'));var crypto=require(_0x1cf7('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1cf7('0xa'));var querystring=require(_0x1cf7('0x10'));var Papa=require(_0x1cf7('0x11'));var Redis=require('ioredis');var authService=require(_0x1cf7('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1cf7('0x13'));var logger=require(_0x1cf7('0x14'))(_0x1cf7('0x15'));var utils=require(_0x1cf7('0x16'));var config=require(_0x1cf7('0x17'));var licenseUtil=require(_0x1cf7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18dc3b,_0x58c99f){_0x58c99f=_0x58c99f||0xcc;return function(_0x1ad008){if(_0x1ad008){return _0x18dc3b['sendStatus'](_0x58c99f);}return _0x18dc3b[_0x1cf7('0x19')](_0x58c99f)[_0x1cf7('0x1a')]();};}function respondWithResult(_0x5a1b77,_0x33d5b2){_0x33d5b2=_0x33d5b2||0xc8;return function(_0x328d2c){if(_0x328d2c){return _0x5a1b77[_0x1cf7('0x19')](_0x33d5b2)[_0x1cf7('0x1b')](_0x328d2c);}};}function respondWithFilteredResult(_0x1bab03,_0x43d6e){return function(_0x769ee3){if(_0x769ee3){var _0x172915=typeof _0x43d6e[_0x1cf7('0x1c')]===_0x1cf7('0x1d')&&typeof _0x43d6e[_0x1cf7('0x1e')]===_0x1cf7('0x1d');var _0x3f762b=_0x769ee3['count'];var _0x391553=_0x172915?0x0:_0x43d6e[_0x1cf7('0x1c')];var _0x13875c=_0x172915?_0x769ee3['count']:_0x43d6e[_0x1cf7('0x1c')]+_0x43d6e[_0x1cf7('0x1e')];var _0xf1a5ba;if(_0x13875c>=_0x3f762b){_0x13875c=_0x3f762b;_0xf1a5ba=0xc8;}else{_0xf1a5ba=0xce;}_0x1bab03['status'](_0xf1a5ba);return _0x1bab03[_0x1cf7('0x1f')](_0x1cf7('0x20'),_0x391553+'-'+_0x13875c+'/'+_0x3f762b)[_0x1cf7('0x1b')](_0x769ee3);}return null;};}function patchUpdates(_0x37fc26){return function(_0x2c20c4){try{jsonpatch[_0x1cf7('0x21')](_0x2c20c4,_0x37fc26,!![]);}catch(_0x3ad138){return BPromise[_0x1cf7('0x22')](_0x3ad138);}return _0x2c20c4[_0x1cf7('0x23')]();};}function saveUpdates(_0x256151,_0x4ec792){return function(_0x345997){if(_0x345997){return _0x345997[_0x1cf7('0x24')](_0x256151)[_0x1cf7('0x25')](function(_0x1f293c){return _0x1f293c;});}return null;};}function removeEntity(_0x7baff3,_0x1c9100){return function(_0x31b4e9){if(_0x31b4e9){return _0x31b4e9[_0x1cf7('0x26')]()['then'](function(){_0x7baff3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af3e8,_0x489d1f){return function(_0x42046b){if(!_0x42046b){_0x3af3e8[_0x1cf7('0x27')](0x194);}return _0x42046b;};}function handleError(_0x3db370,_0x1ce3ae){_0x1ce3ae=_0x1ce3ae||0x1f4;return function(_0x4dcf35){logger['error'](_0x4dcf35[_0x1cf7('0x28')]);if(_0x4dcf35[_0x1cf7('0x29')]){delete _0x4dcf35[_0x1cf7('0x29')];}_0x3db370[_0x1cf7('0x19')](_0x1ce3ae)[_0x1cf7('0x2a')](_0x4dcf35);};}exports[_0x1cf7('0x2b')]=function(_0x131e8b,_0x5e2047){var _0x125c48={},_0x5c6fee={},_0x4719fe={'count':0x0,'rows':[]};var _0x3d2f45=_[_0x1cf7('0x2c')](db[_0x1cf7('0x2d')][_0x1cf7('0x2e')],function(_0x3efa9c){return{'name':_0x3efa9c[_0x1cf7('0x2f')],'type':_0x3efa9c[_0x1cf7('0x30')]['key']};});_0x5c6fee['model']=_[_0x1cf7('0x2c')](_0x3d2f45,_0x1cf7('0x29'));_0x5c6fee[_0x1cf7('0x31')]=_[_0x1cf7('0x32')](_0x131e8b[_0x1cf7('0x31')]);_0x5c6fee['filters']=_[_0x1cf7('0x33')](_0x5c6fee['model'],_0x5c6fee[_0x1cf7('0x31')]);_0x125c48[_0x1cf7('0x34')]=_['intersection'](_0x5c6fee[_0x1cf7('0x35')],qs[_0x1cf7('0x36')](_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x36')]));_0x125c48[_0x1cf7('0x34')]=_0x125c48[_0x1cf7('0x34')]['length']?_0x125c48[_0x1cf7('0x34')]:_0x5c6fee['model'];if(!_0x131e8b['query'][_0x1cf7('0x37')](_0x1cf7('0x38'))){_0x125c48[_0x1cf7('0x1e')]=qs[_0x1cf7('0x1e')](_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x1e')]);_0x125c48['offset']=qs['offset'](_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x1c')]);}_0x125c48[_0x1cf7('0x39')]=qs[_0x1cf7('0x3a')](_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x3a')]);_0x125c48[_0x1cf7('0x3b')]=qs[_0x1cf7('0x3c')](_[_0x1cf7('0x3d')](_0x131e8b[_0x1cf7('0x31')],_0x5c6fee['filters']),_0x3d2f45);if(_0x131e8b[_0x1cf7('0x31')]['filter']){_0x125c48[_0x1cf7('0x3b')]=_[_0x1cf7('0x3e')](_0x125c48['where'],{'$or':_['map'](_0x3d2f45,function(_0x5a0a7c){if(_0x5a0a7c['type']!==_0x1cf7('0x3f')){var _0x197497={};_0x197497[_0x5a0a7c[_0x1cf7('0x29')]]={'$like':'%'+_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x40')]+'%'};return _0x197497;}})});}_0x125c48=_[_0x1cf7('0x3e')]({},_0x125c48,_0x131e8b[_0x1cf7('0x41')]);var _0x7cfd70={'where':_0x125c48['where']};return db[_0x1cf7('0x2d')][_0x1cf7('0x42')](_0x7cfd70)[_0x1cf7('0x25')](function(_0x35a4e2){_0x4719fe[_0x1cf7('0x42')]=_0x35a4e2;if(_0x131e8b[_0x1cf7('0x31')][_0x1cf7('0x43')]){_0x125c48[_0x1cf7('0x44')]=[{'all':!![]}];}return db[_0x1cf7('0x2d')][_0x1cf7('0x45')](_0x125c48);})[_0x1cf7('0x25')](function(_0x359486){_0x4719fe[_0x1cf7('0x46')]=_0x359486;return _0x4719fe;})['then'](respondWithFilteredResult(_0x5e2047,_0x125c48))[_0x1cf7('0x47')](handleError(_0x5e2047,null));};exports[_0x1cf7('0x48')]=function(_0x16bf17,_0xb9d92f){var _0x5aa0a3={'raw':!![],'where':{'id':_0x16bf17['params']['id']}},_0x3307b4={};_0x3307b4[_0x1cf7('0x35')]=_[_0x1cf7('0x32')](db[_0x1cf7('0x2d')][_0x1cf7('0x2e')]);_0x3307b4[_0x1cf7('0x31')]=_[_0x1cf7('0x32')](_0x16bf17[_0x1cf7('0x31')]);_0x3307b4[_0x1cf7('0x3c')]=_['intersection'](_0x3307b4[_0x1cf7('0x35')],_0x3307b4[_0x1cf7('0x31')]);_0x5aa0a3[_0x1cf7('0x34')]=_[_0x1cf7('0x33')](_0x3307b4[_0x1cf7('0x35')],qs[_0x1cf7('0x36')](_0x16bf17[_0x1cf7('0x31')][_0x1cf7('0x36')]));_0x5aa0a3[_0x1cf7('0x34')]=_0x5aa0a3['attributes'][_0x1cf7('0x49')]?_0x5aa0a3[_0x1cf7('0x34')]:_0x3307b4[_0x1cf7('0x35')];if(_0x16bf17['query'][_0x1cf7('0x43')]){_0x5aa0a3[_0x1cf7('0x44')]=[{'all':!![]}];}_0x5aa0a3=_[_0x1cf7('0x3e')]({},_0x5aa0a3,_0x16bf17[_0x1cf7('0x41')]);return db[_0x1cf7('0x2d')][_0x1cf7('0x4a')](_0x5aa0a3)[_0x1cf7('0x25')](handleEntityNotFound(_0xb9d92f,null))[_0x1cf7('0x25')](respondWithResult(_0xb9d92f,null))['catch'](handleError(_0xb9d92f,null));};exports[_0x1cf7('0x4b')]=function(_0x218b58,_0x3828d0){return db[_0x1cf7('0x2d')][_0x1cf7('0x4b')](_0x218b58[_0x1cf7('0x4c')],{})[_0x1cf7('0x25')](respondWithResult(_0x3828d0,0xc9))[_0x1cf7('0x47')](handleError(_0x3828d0,null));};exports[_0x1cf7('0x24')]=function(_0x4f27fc,_0xa608b6){if(_0x4f27fc[_0x1cf7('0x4c')]['id']){delete _0x4f27fc['body']['id'];}return db[_0x1cf7('0x2d')][_0x1cf7('0x4a')]({'where':{'id':_0x4f27fc[_0x1cf7('0x4d')]['id']}})[_0x1cf7('0x25')](handleEntityNotFound(_0xa608b6,null))[_0x1cf7('0x25')](saveUpdates(_0x4f27fc[_0x1cf7('0x4c')],null))[_0x1cf7('0x25')](respondWithResult(_0xa608b6,null))[_0x1cf7('0x47')](handleError(_0xa608b6,null));};exports['destroy']=function(_0x4c291c,_0x1004cf){return db[_0x1cf7('0x2d')][_0x1cf7('0x4a')]({'where':{'id':_0x4c291c[_0x1cf7('0x4d')]['id']}})[_0x1cf7('0x25')](handleEntityNotFound(_0x1004cf,null))[_0x1cf7('0x25')](removeEntity(_0x1004cf,null))[_0x1cf7('0x47')](handleError(_0x1004cf,null));};exports[_0x1cf7('0x4e')]=function(_0x3b9dc9,_0x230a77){return db[_0x1cf7('0x2d')][_0x1cf7('0x4e')]()[_0x1cf7('0x25')](respondWithResult(_0x230a77,null))[_0x1cf7('0x47')](handleError(_0x230a77,null));}; \ No newline at end of file +var _0xf8b2=['sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','JscriptyAnswerReport','include','findAll','then','rows','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x4e00da,_0x6c9063){_0x4e00da=_0x4e00da-0x0;var _0x2f9c7a=_0xf8b2[_0x4e00da];return _0x2f9c7a;};'use strict';var emlformat=require(_0x2f8b('0x0'));var rimraf=require(_0x2f8b('0x1'));var zipdir=require(_0x2f8b('0x2'));var jsonpatch=require(_0x2f8b('0x3'));var rp=require(_0x2f8b('0x4'));var moment=require(_0x2f8b('0x5'));var BPromise=require(_0x2f8b('0x6'));var Mustache=require(_0x2f8b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2f8b('0x8'));var csv=require(_0x2f8b('0x9'));var ejs=require(_0x2f8b('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8b('0xb'));var _=require(_0x2f8b('0xc'));var squel=require(_0x2f8b('0xd'));var crypto=require(_0x2f8b('0xe'));var jsforce=require(_0x2f8b('0xf'));var deskjs=require(_0x2f8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2f8b('0x11'));var Papa=require(_0x2f8b('0x12'));var Redis=require(_0x2f8b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f8b('0x14'));var as=require(_0x2f8b('0x15'));var hardwareService=require(_0x2f8b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2f8b('0x17'));var config=require(_0x2f8b('0x18'));var licenseUtil=require(_0x2f8b('0x19'));var db=require(_0x2f8b('0x1a'))['db'];function respondWithStatusCode(_0x175111,_0x4cb1e0){_0x4cb1e0=_0x4cb1e0||0xcc;return function(_0x16d5a2){if(_0x16d5a2){return _0x175111['sendStatus'](_0x4cb1e0);}return _0x175111[_0x2f8b('0x1b')](_0x4cb1e0)[_0x2f8b('0x1c')]();};}function respondWithResult(_0x1b6a17,_0x15634){_0x15634=_0x15634||0xc8;return function(_0xf9cbe0){if(_0xf9cbe0){return _0x1b6a17[_0x2f8b('0x1b')](_0x15634)[_0x2f8b('0x1d')](_0xf9cbe0);}};}function respondWithFilteredResult(_0x2b6003,_0x532fe4){return function(_0x14a248){if(_0x14a248){var _0xdec711=typeof _0x532fe4[_0x2f8b('0x1e')]===_0x2f8b('0x1f')&&typeof _0x532fe4[_0x2f8b('0x20')]===_0x2f8b('0x1f');var _0x3d65ee=_0x14a248[_0x2f8b('0x21')];var _0x35ec40=_0xdec711?0x0:_0x532fe4['offset'];var _0x23dd63=_0xdec711?_0x14a248[_0x2f8b('0x21')]:_0x532fe4[_0x2f8b('0x1e')]+_0x532fe4['limit'];var _0xdc8171;if(_0x23dd63>=_0x3d65ee){_0x23dd63=_0x3d65ee;_0xdc8171=0xc8;}else{_0xdc8171=0xce;}_0x2b6003['status'](_0xdc8171);return _0x2b6003[_0x2f8b('0x22')](_0x2f8b('0x23'),_0x35ec40+'-'+_0x23dd63+'/'+_0x3d65ee)[_0x2f8b('0x1d')](_0x14a248);}return null;};}function patchUpdates(_0x26d78f){return function(_0x3be6dc){try{jsonpatch['apply'](_0x3be6dc,_0x26d78f,!![]);}catch(_0x29c2f3){return BPromise[_0x2f8b('0x24')](_0x29c2f3);}return _0x3be6dc[_0x2f8b('0x25')]();};}function saveUpdates(_0x17b251,_0x3ad38b){return function(_0x1ffbae){if(_0x1ffbae){return _0x1ffbae[_0x2f8b('0x26')](_0x17b251)['then'](function(_0x273950){return _0x273950;});}return null;};}function removeEntity(_0x23f73c,_0x3560c4){return function(_0x41e12b){if(_0x41e12b){return _0x41e12b[_0x2f8b('0x27')]()['then'](function(){_0x23f73c[_0x2f8b('0x1b')](0xcc)[_0x2f8b('0x1c')]();});}};}function handleEntityNotFound(_0x152492,_0x46a95a){return function(_0x183e51){if(!_0x183e51){_0x152492[_0x2f8b('0x28')](0x194);}return _0x183e51;};}function handleError(_0x45e313,_0x347f5a){_0x347f5a=_0x347f5a||0x1f4;return function(_0x4145b3){logger['error'](_0x4145b3[_0x2f8b('0x29')]);if(_0x4145b3['name']){delete _0x4145b3[_0x2f8b('0x2a')];}_0x45e313[_0x2f8b('0x1b')](_0x347f5a)[_0x2f8b('0x2b')](_0x4145b3);};}exports[_0x2f8b('0x2c')]=function(_0x72b23b,_0x4adacd){var _0x2cfbea={},_0x5cc78c={},_0x5207a8={'count':0x0,'rows':[]};var _0x194e75=_[_0x2f8b('0x2d')](db['JscriptyAnswerReport'][_0x2f8b('0x2e')],function(_0x20d80c){return{'name':_0x20d80c[_0x2f8b('0x2f')],'type':_0x20d80c[_0x2f8b('0x30')][_0x2f8b('0x31')]};});_0x5cc78c[_0x2f8b('0x32')]=_['map'](_0x194e75,_0x2f8b('0x2a'));_0x5cc78c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0x72b23b[_0x2f8b('0x33')]);_0x5cc78c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x5cc78c[_0x2f8b('0x32')],_0x5cc78c['query']);_0x2cfbea[_0x2f8b('0x37')]=_['intersection'](_0x5cc78c[_0x2f8b('0x32')],qs[_0x2f8b('0x38')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x38')]));_0x2cfbea[_0x2f8b('0x37')]=_0x2cfbea[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x2cfbea[_0x2f8b('0x37')]:_0x5cc78c[_0x2f8b('0x32')];if(!_0x72b23b['query']['hasOwnProperty'](_0x2f8b('0x3a'))){_0x2cfbea[_0x2f8b('0x20')]=qs[_0x2f8b('0x20')](_0x72b23b[_0x2f8b('0x33')]['limit']);_0x2cfbea[_0x2f8b('0x1e')]=qs[_0x2f8b('0x1e')](_0x72b23b[_0x2f8b('0x33')][_0x2f8b('0x1e')]);}_0x2cfbea[_0x2f8b('0x3b')]=qs['sort'](_0x72b23b['query'][_0x2f8b('0x3c')]);_0x2cfbea[_0x2f8b('0x3d')]=qs[_0x2f8b('0x35')](_[_0x2f8b('0x3e')](_0x72b23b[_0x2f8b('0x33')],_0x5cc78c[_0x2f8b('0x35')]),_0x194e75);if(_0x72b23b[_0x2f8b('0x33')]['filter']){_0x2cfbea[_0x2f8b('0x3d')]=_[_0x2f8b('0x3f')](_0x2cfbea['where'],{'$or':_[_0x2f8b('0x2d')](_0x194e75,function(_0x4594b2){if(_0x4594b2[_0x2f8b('0x30')]!=='VIRTUAL'){var _0xa1d8de={};_0xa1d8de[_0x4594b2[_0x2f8b('0x2a')]]={'$like':'%'+_0x72b23b['query'][_0x2f8b('0x40')]+'%'};return _0xa1d8de;}})});}_0x2cfbea=_[_0x2f8b('0x3f')]({},_0x2cfbea,_0x72b23b['options']);var _0x92b37a={'where':_0x2cfbea['where']};return db[_0x2f8b('0x41')][_0x2f8b('0x21')](_0x92b37a)['then'](function(_0x9030da){_0x5207a8[_0x2f8b('0x21')]=_0x9030da;if(_0x72b23b[_0x2f8b('0x33')]['includeAll']){_0x2cfbea[_0x2f8b('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x2f8b('0x43')](_0x2cfbea);})[_0x2f8b('0x44')](function(_0x1ff6e7){_0x5207a8[_0x2f8b('0x45')]=_0x1ff6e7;return _0x5207a8;})[_0x2f8b('0x44')](respondWithFilteredResult(_0x4adacd,_0x2cfbea))[_0x2f8b('0x46')](handleError(_0x4adacd,null));};exports[_0x2f8b('0x47')]=function(_0xa2fc94,_0x1c0b64){var _0x40577c={'raw':!![],'where':{'id':_0xa2fc94[_0x2f8b('0x48')]['id']}},_0x45c92c={};_0x45c92c[_0x2f8b('0x32')]=_[_0x2f8b('0x34')](db[_0x2f8b('0x41')][_0x2f8b('0x2e')]);_0x45c92c[_0x2f8b('0x33')]=_[_0x2f8b('0x34')](_0xa2fc94[_0x2f8b('0x33')]);_0x45c92c[_0x2f8b('0x35')]=_[_0x2f8b('0x36')](_0x45c92c[_0x2f8b('0x32')],_0x45c92c[_0x2f8b('0x33')]);_0x40577c[_0x2f8b('0x37')]=_[_0x2f8b('0x36')](_0x45c92c['model'],qs['fields'](_0xa2fc94['query'][_0x2f8b('0x38')]));_0x40577c['attributes']=_0x40577c[_0x2f8b('0x37')][_0x2f8b('0x39')]?_0x40577c[_0x2f8b('0x37')]:_0x45c92c['model'];if(_0xa2fc94[_0x2f8b('0x33')]['includeAll']){_0x40577c[_0x2f8b('0x42')]=[{'all':!![]}];}_0x40577c=_['merge']({},_0x40577c,_0xa2fc94[_0x2f8b('0x49')]);return db[_0x2f8b('0x41')]['find'](_0x40577c)[_0x2f8b('0x44')](handleEntityNotFound(_0x1c0b64,null))[_0x2f8b('0x44')](respondWithResult(_0x1c0b64,null))[_0x2f8b('0x46')](handleError(_0x1c0b64,null));};exports[_0x2f8b('0x4a')]=function(_0x1e6ac2,_0x465d59){return db[_0x2f8b('0x41')][_0x2f8b('0x4a')](_0x1e6ac2[_0x2f8b('0x4b')],{})['then'](respondWithResult(_0x465d59,0xc9))[_0x2f8b('0x46')](handleError(_0x465d59,null));};exports[_0x2f8b('0x26')]=function(_0x2d79f9,_0x1bb257){if(_0x2d79f9[_0x2f8b('0x4b')]['id']){delete _0x2d79f9['body']['id'];}return db[_0x2f8b('0x41')][_0x2f8b('0x4c')]({'where':{'id':_0x2d79f9[_0x2f8b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bb257,null))[_0x2f8b('0x44')](saveUpdates(_0x2d79f9['body'],null))[_0x2f8b('0x44')](respondWithResult(_0x1bb257,null))[_0x2f8b('0x46')](handleError(_0x1bb257,null));};exports[_0x2f8b('0x27')]=function(_0x3a25bb,_0x17b855){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x3a25bb['params']['id']}})[_0x2f8b('0x44')](handleEntityNotFound(_0x17b855,null))[_0x2f8b('0x44')](removeEntity(_0x17b855,null))[_0x2f8b('0x46')](handleError(_0x17b855,null));};exports[_0x2f8b('0x4d')]=function(_0x49e047,_0x5ea07d){return db[_0x2f8b('0x41')][_0x2f8b('0x4d')]()[_0x2f8b('0x44')](respondWithResult(_0x5ea07d,null))[_0x2f8b('0x46')](handleError(_0x5ea07d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index b66fc05..da6c005 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 _0xd4ed=['util','../../config/logger','api','moment','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash'];(function(_0x1fc818,_0x4ed00c){var _0x3290ea=function(_0xef35f7){while(--_0xef35f7){_0x1fc818['push'](_0x1fc818['shift']());}};_0x3290ea(++_0x4ed00c);}(_0xd4ed,0x83));var _0xdd4e=function(_0x525959,_0x3f0013){_0x525959=_0x525959-0x0;var _0x251f1b=_0xd4ed[_0x525959];return _0x251f1b;};'use strict';var _=require(_0xdd4e('0x0'));var util=require(_0xdd4e('0x1'));var logger=require(_0xdd4e('0x2'))(_0xdd4e('0x3'));var moment=require(_0xdd4e('0x4'));var BPromise=require('bluebird');var rp=require(_0xdd4e('0x5'));var fs=require('fs');var path=require(_0xdd4e('0x6'));var rimraf=require(_0xdd4e('0x7'));var config=require('../../config/environment');var attributes=require(_0xdd4e('0x8'));module[_0xdd4e('0x9')]=function(_0x4d99c0,_0x15dc55){return _0x4d99c0[_0xdd4e('0xa')](_0xdd4e('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b32=['path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','../../config/logger','api','moment'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0x3b32,0x1f0));var _0x23b3=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x3b32[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x23b3('0x0'));var util=require('util');var logger=require(_0x23b3('0x1'))(_0x23b3('0x2'));var moment=require(_0x23b3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x23b3('0x4'));var rimraf=require('rimraf');var config=require(_0x23b3('0x5'));var attributes=require(_0x23b3('0x6'));module[_0x23b3('0x7')]=function(_0x23e584,_0x4832f6){return _0x23e584[_0x23b3('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x23b3('0x9'),'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 99cf8fa..6ad6505 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 _0x18c1=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x18c1,0x1c3));var _0x118c=function(_0x2dc519,_0x1fb1b0){_0x2dc519=_0x2dc519-0x0;var _0x5a5066=_0x18c1[_0x2dc519];return _0x5a5066;};'use strict';var _=require(_0x118c('0x0'));var util=require('util');var moment=require(_0x118c('0x1'));var BPromise=require('bluebird');var rs=require(_0x118c('0x2'));var fs=require('fs');var Redis=require(_0x118c('0x3'));var db=require(_0x118c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x118c('0x5'))(_0x118c('0x6'));var config=require('../../config/environment');var jayson=require(_0x118c('0x7'));var client=jayson[_0x118c('0x8')][_0x118c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xff1bbf,_0x3a76eb,_0x39b505){return new BPromise(function(_0x47e1ae,_0x16b578){return client[_0x118c('0xa')](_0xff1bbf,_0x39b505)['then'](function(_0x38c7e8){logger[_0x118c('0xb')](_0x118c('0xc'),_0x3a76eb,_0x118c('0xd'));logger[_0x118c('0xe')](_0x118c('0xf'),_0x3a76eb,_0x118c('0xd'),JSON[_0x118c('0x10')](_0x38c7e8));if(_0x38c7e8[_0x118c('0x11')]){if(_0x38c7e8['error']['code']===0x1f4){logger['error'](_0x118c('0xc'),_0x3a76eb,_0x38c7e8['error']['message']);return _0x16b578(_0x38c7e8['error']['message']);}logger[_0x118c('0x11')](_0x118c('0xc'),_0x3a76eb,_0x38c7e8['error'][_0x118c('0x12')]);return _0x47e1ae(_0x38c7e8[_0x118c('0x11')]['message']);}else{logger[_0x118c('0xb')](_0x118c('0xc'),_0x3a76eb,'request\x20sent');_0x47e1ae(_0x38c7e8[_0x118c('0x13')][_0x118c('0x12')]);}})[_0x118c('0x14')](function(_0x54e5b8){logger[_0x118c('0x11')](_0x118c('0xc'),_0x3a76eb,_0x54e5b8);_0x16b578(_0x54e5b8);});});} \ No newline at end of file +var _0x82ae=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x583c95,_0x2caa4d){var _0x1cb317=function(_0x1e2fd1){while(--_0x1e2fd1){_0x583c95['push'](_0x583c95['shift']());}};_0x1cb317(++_0x2caa4d);}(_0x82ae,0x1d6));var _0xe82a=function(_0xc03d34,_0x51c649){_0xc03d34=_0xc03d34-0x0;var _0x3e5e13=_0x82ae[_0xc03d34];return _0x3e5e13;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe82a('0x0'));var BPromise=require('bluebird');var rs=require(_0xe82a('0x1'));var fs=require('fs');var Redis=require(_0xe82a('0x2'));var db=require(_0xe82a('0x3'))['db'];var utils=require(_0xe82a('0x4'));var logger=require(_0xe82a('0x5'))(_0xe82a('0x6'));var config=require(_0xe82a('0x7'));var jayson=require(_0xe82a('0x8'));var client=jayson[_0xe82a('0x9')][_0xe82a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x428b58,_0x36ec4c,_0x28b10a){return new BPromise(function(_0x14583,_0x535aff){return client[_0xe82a('0xb')](_0x428b58,_0x28b10a)[_0xe82a('0xc')](function(_0x56507f){logger[_0xe82a('0xd')](_0xe82a('0xe'),_0x36ec4c,_0xe82a('0xf'));logger['debug'](_0xe82a('0x10'),_0x36ec4c,_0xe82a('0xf'),JSON[_0xe82a('0x11')](_0x56507f));if(_0x56507f['error']){if(_0x56507f[_0xe82a('0x12')]['code']===0x1f4){logger['error'](_0xe82a('0xe'),_0x36ec4c,_0x56507f[_0xe82a('0x12')]['message']);return _0x535aff(_0x56507f[_0xe82a('0x12')][_0xe82a('0x13')]);}logger[_0xe82a('0x12')](_0xe82a('0xe'),_0x36ec4c,_0x56507f[_0xe82a('0x12')][_0xe82a('0x13')]);return _0x14583(_0x56507f[_0xe82a('0x12')][_0xe82a('0x13')]);}else{logger[_0xe82a('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x36ec4c,_0xe82a('0xf'));_0x14583(_0x56507f[_0xe82a('0x14')][_0xe82a('0x13')]);}})[_0xe82a('0x15')](function(_0x288fc4){logger[_0xe82a('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x36ec4c,_0x288fc4);_0x535aff(_0x288fc4);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index f54eb8d..062f02f 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 _0x42b7=['update','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','put'];(function(_0x584355,_0x295318){var _0x32c3f9=function(_0x4aa0c1){while(--_0x4aa0c1){_0x584355['push'](_0x584355['shift']());}};_0x32c3f9(++_0x295318);}(_0x42b7,0x136));var _0x742b=function(_0x5ba9ac,_0x19219f){_0x5ba9ac=_0x5ba9ac-0x0;var _0x429802=_0x42b7[_0x5ba9ac];return _0x429802;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x742b('0x0'));var express=require(_0x742b('0x1'));var router=express[_0x742b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x742b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x742b('0x4'));var controller=require(_0x742b('0x5'));router[_0x742b('0x6')]('/',auth[_0x742b('0x7')](),controller['index']);router[_0x742b('0x6')](_0x742b('0x8'),auth[_0x742b('0x7')](),controller[_0x742b('0x9')]);router[_0x742b('0x6')](_0x742b('0xa'),auth[_0x742b('0x7')](),controller[_0x742b('0xb')]);router[_0x742b('0x6')](_0x742b('0xc'),auth[_0x742b('0x7')](),controller[_0x742b('0xd')]);router[_0x742b('0x6')](_0x742b('0xe'),auth['isAuthenticated'](),timeout('30s'),controller[_0x742b('0xf')]);router['post']('/',auth[_0x742b('0x7')](),controller[_0x742b('0x10')]);router[_0x742b('0x11')](_0x742b('0x12'),auth[_0x742b('0x7')](),controller['clone']);router[_0x742b('0x13')](_0x742b('0x8'),auth[_0x742b('0x7')](),controller[_0x742b('0x14')]);router['delete'](_0x742b('0x8'),auth[_0x742b('0x7')](),controller['destroy']);module[_0x742b('0x15')]=router; \ No newline at end of file +var _0x65b5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','put','/:id','delete','destroy','exports','multer','connect-timeout'];(function(_0x396cd9,_0x5db59d){var _0xc102f=function(_0x13d658){while(--_0x13d658){_0x396cd9['push'](_0x396cd9['shift']());}};_0xc102f(++_0x5db59d);}(_0x65b5,0x1ae));var _0x565b=function(_0x55f5be,_0x1f7af3){_0x55f5be=_0x55f5be-0x0;var _0x3c4ce6=_0x65b5[_0x55f5be];return _0x3c4ce6;};'use strict';var multer=require(_0x565b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x565b('0x1'));var express=require(_0x565b('0x2'));var router=express[_0x565b('0x3')]();var fs_extra=require(_0x565b('0x4'));var auth=require(_0x565b('0x5'));var interaction=require(_0x565b('0x6'));var config=require('../../config/environment');var controller=require(_0x565b('0x7'));router[_0x565b('0x8')]('/',auth[_0x565b('0x9')](),controller['index']);router[_0x565b('0x8')]('/:id',auth[_0x565b('0x9')](),controller['show']);router[_0x565b('0x8')](_0x565b('0xa'),auth[_0x565b('0x9')](),controller[_0x565b('0xb')]);router[_0x565b('0x8')]('/:id/answers',auth[_0x565b('0x9')](),controller[_0x565b('0xc')]);router['get'](_0x565b('0xd'),auth[_0x565b('0x9')](),timeout(_0x565b('0xe')),controller[_0x565b('0xf')]);router['post']('/',auth[_0x565b('0x9')](),controller[_0x565b('0x10')]);router[_0x565b('0x11')](_0x565b('0x12'),auth['isAuthenticated'](),controller['clone']);router[_0x565b('0x13')](_0x565b('0x14'),auth[_0x565b('0x9')](),controller['update']);router[_0x565b('0x15')](_0x565b('0x14'),auth['isAuthenticated'](),controller[_0x565b('0x16')]);module[_0x565b('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 84abfcb..0340e4b 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 _0xf175=['getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0xf175,0x73));var _0x5f17=function(_0x581af6,_0x4bcda7){_0x581af6=_0x581af6-0x0;var _0x357601=_0xf175[_0x581af6];return _0x357601;};'use strict';var Sequelize=require(_0x5f17('0x0'));var _=require(_0x5f17('0x1'));var util=require('util');module[_0x5f17('0x2')]={'name':{'type':Sequelize[_0x5f17('0x3')],'unique':_0x5f17('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x5f17('0x5')](_0x5f17('0x6')),'set':function(_0x2da75b){if(_[_0x5f17('0x7')](_0x2da75b)){this[_0x5f17('0x8')](_0x5f17('0x9'),JSON[_0x5f17('0xa')](_0x2da75b));}else if(_['isString'](_0x2da75b)){this['setDataValue'](_0x5f17('0x9'),_0x2da75b);}else{this['setDataValue']('formData',util[_0x5f17('0xb')](_0x5f17('0xc'),this[_0x5f17('0xd')](_0x5f17('0x4'))||'',this[_0x5f17('0xd')](_0x5f17('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x5f17('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x7188=['util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7188,0x8e));var _0x8718=function(_0x3d9ba7,_0x1c8b5f){_0x3d9ba7=_0x3d9ba7-0x0;var _0x4621ce=_0x7188[_0x3d9ba7];return _0x4621ce;};'use strict';var Sequelize=require(_0x8718('0x0'));var _=require(_0x8718('0x1'));var util=require(_0x8718('0x2'));module[_0x8718('0x3')]={'name':{'type':Sequelize[_0x8718('0x4')],'unique':_0x8718('0x5')},'description':{'type':Sequelize[_0x8718('0x4')]},'formData':{'type':Sequelize[_0x8718('0x6')](_0x8718('0x7')),'set':function(_0x382680){if(_[_0x8718('0x8')](_0x382680)){this[_0x8718('0x9')]('formData',JSON[_0x8718('0xa')](_0x382680));}else if(_['isString'](_0x382680)){this[_0x8718('0x9')](_0x8718('0xb'),_0x382680);}else{this[_0x8718('0x9')](_0x8718('0xb'),util['format'](_0x8718('0xc'),this[_0x8718('0xd')](_0x8718('0x5'))||'',this[_0x8718('0xd')](_0x8718('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8718('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e399ae9..113687a 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 _0x8952=['replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','destroy','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf'];(function(_0x100332,_0x4296e1){var _0x308ffc=function(_0x43791b){while(--_0x43791b){_0x100332['push'](_0x100332['shift']());}};_0x308ffc(++_0x4296e1);}(_0x8952,0x17e));var _0x2895=function(_0x3f585f,_0x597f5a){_0x3f585f=_0x3f585f-0x0;var _0x41d592=_0x8952[_0x3f585f];return _0x41d592;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];function respondWithStatusCode(_0x3924be,_0x4b1342){_0x4b1342=_0x4b1342||0xcc;return function(_0x32574c){if(_0x32574c){return _0x3924be[_0x2895('0x15')](_0x4b1342);}return _0x3924be['status'](_0x4b1342)['end']();};}function respondWithResult(_0x1d1493,_0x2ca2ac){_0x2ca2ac=_0x2ca2ac||0xc8;return function(_0x5777a0){if(_0x5777a0){return _0x1d1493[_0x2895('0x16')](_0x2ca2ac)[_0x2895('0x17')](_0x5777a0);}};}function respondWithFilteredResult(_0x27b50e,_0x1ae013){return function(_0x1d3659){if(_0x1d3659){var _0x2627e6=typeof _0x1ae013[_0x2895('0x18')]===_0x2895('0x19')&&typeof _0x1ae013[_0x2895('0x1a')]===_0x2895('0x19');var _0x10a1bf=_0x1d3659[_0x2895('0x1b')];var _0xbf8b63=_0x2627e6?0x0:_0x1ae013[_0x2895('0x18')];var _0x155124=_0x2627e6?_0x1d3659[_0x2895('0x1b')]:_0x1ae013[_0x2895('0x18')]+_0x1ae013[_0x2895('0x1a')];var _0x5a8eab;if(_0x155124>=_0x10a1bf){_0x155124=_0x10a1bf;_0x5a8eab=0xc8;}else{_0x5a8eab=0xce;}_0x27b50e['status'](_0x5a8eab);return _0x27b50e['set'](_0x2895('0x1c'),_0xbf8b63+'-'+_0x155124+'/'+_0x10a1bf)[_0x2895('0x17')](_0x1d3659);}return null;};}function patchUpdates(_0x3ec4da){return function(_0x593e47){try{jsonpatch[_0x2895('0x1d')](_0x593e47,_0x3ec4da,!![]);}catch(_0x190b79){return BPromise[_0x2895('0x1e')](_0x190b79);}return _0x593e47[_0x2895('0x1f')]();};}function saveUpdates(_0x8b75e0,_0x5dbbfe){return function(_0x30c6c3){if(_0x30c6c3){return _0x30c6c3[_0x2895('0x20')](_0x8b75e0)['then'](function(_0x142e58){return _0x142e58;});}return null;};}function removeEntity(_0x384357,_0x6f8ad4){return function(_0x511286){if(_0x511286){return _0x511286['destroy']()[_0x2895('0x21')](function(){var _0x4569b5=_0x511286[_0x2895('0x22')]({'plain':!![]});var _0x4a21cf=_0x2895('0x23');return db[_0x2895('0x24')]['destroy']({'where':{'type':_0x4a21cf,'resourceId':_0x4569b5['id']}})[_0x2895('0x21')](function(){return _0x511286;});})[_0x2895('0x21')](function(){_0x384357[_0x2895('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320661,_0x30f491){return function(_0x5eedfc){if(!_0x5eedfc){_0x320661[_0x2895('0x15')](0x194);}return _0x5eedfc;};}function handleError(_0x501898,_0x5d70f5){_0x5d70f5=_0x5d70f5||0x1f4;return function(_0x18a935){logger['error'](_0x18a935[_0x2895('0x25')]);if(_0x18a935[_0x2895('0x26')]){delete _0x18a935['name'];}_0x501898['status'](_0x5d70f5)[_0x2895('0x27')](_0x18a935);};}exports[_0x2895('0x28')]=function(_0x190e07,_0x14e343){var _0x14d150={},_0xa61689={},_0x34e110={'count':0x0,'rows':[]};var _0x546514=_[_0x2895('0x29')](db[_0x2895('0x2a')][_0x2895('0x2b')],function(_0x5546eb){return{'name':_0x5546eb[_0x2895('0x2c')],'type':_0x5546eb[_0x2895('0x2d')][_0x2895('0x2e')]};});_0xa61689[_0x2895('0x2f')]=_['map'](_0x546514,_0x2895('0x26'));_0xa61689[_0x2895('0x30')]=_[_0x2895('0x31')](_0x190e07[_0x2895('0x30')]);_0xa61689[_0x2895('0x32')]=_['intersection'](_0xa61689['model'],_0xa61689[_0x2895('0x30')]);_0x14d150[_0x2895('0x33')]=_['intersection'](_0xa61689[_0x2895('0x2f')],qs['fields'](_0x190e07[_0x2895('0x30')][_0x2895('0x34')]));_0x14d150['attributes']=_0x14d150[_0x2895('0x33')]['length']?_0x14d150[_0x2895('0x33')]:_0xa61689['model'];if(!_0x190e07['query'][_0x2895('0x35')](_0x2895('0x36'))){_0x14d150[_0x2895('0x1a')]=qs['limit'](_0x190e07[_0x2895('0x30')][_0x2895('0x1a')]);_0x14d150[_0x2895('0x18')]=qs[_0x2895('0x18')](_0x190e07[_0x2895('0x30')][_0x2895('0x18')]);}_0x14d150[_0x2895('0x37')]=qs[_0x2895('0x38')](_0x190e07[_0x2895('0x30')][_0x2895('0x38')]);_0x14d150['where']=qs[_0x2895('0x32')](_[_0x2895('0x39')](_0x190e07[_0x2895('0x30')],_0xa61689[_0x2895('0x32')]),_0x546514);if(_0x190e07[_0x2895('0x30')][_0x2895('0x3a')]){_0x14d150[_0x2895('0x3b')]=_['merge'](_0x14d150['where'],{'$or':_[_0x2895('0x29')](_0x546514,function(_0x29dc63){if(_0x29dc63[_0x2895('0x2d')]!==_0x2895('0x3c')){var _0x21bf07={};_0x21bf07[_0x29dc63[_0x2895('0x26')]]={'$like':'%'+_0x190e07['query']['filter']+'%'};return _0x21bf07;}})});}_0x14d150=_[_0x2895('0x3d')]({},_0x14d150,_0x190e07[_0x2895('0x3e')]);var _0x5ce598={'where':_0x14d150['where']};return db[_0x2895('0x2a')][_0x2895('0x1b')](_0x5ce598)[_0x2895('0x21')](function(_0x28967f){_0x34e110[_0x2895('0x1b')]=_0x28967f;if(_0x190e07[_0x2895('0x30')]['includeAll']){_0x14d150[_0x2895('0x3f')]=[{'all':!![]}];}return db[_0x2895('0x2a')][_0x2895('0x40')](_0x14d150);})[_0x2895('0x21')](function(_0x4af6d6){_0x34e110[_0x2895('0x41')]=_0x4af6d6;return _0x34e110;})[_0x2895('0x21')](respondWithFilteredResult(_0x14e343,_0x14d150))[_0x2895('0x42')](handleError(_0x14e343,null));};exports[_0x2895('0x43')]=function(_0x564983,_0x4ef9fe){var _0x46580f={'raw':![],'where':{'id':_0x564983[_0x2895('0x44')]['id']}},_0x19ce85={};_0x19ce85[_0x2895('0x2f')]=_[_0x2895('0x31')](db['JscriptyProject']['rawAttributes']);_0x19ce85[_0x2895('0x30')]=_[_0x2895('0x31')](_0x564983[_0x2895('0x30')]);_0x19ce85[_0x2895('0x32')]=_[_0x2895('0x45')](_0x19ce85[_0x2895('0x2f')],_0x19ce85[_0x2895('0x30')]);_0x46580f['attributes']=_[_0x2895('0x45')](_0x19ce85[_0x2895('0x2f')],qs[_0x2895('0x34')](_0x564983[_0x2895('0x30')][_0x2895('0x34')]));_0x46580f[_0x2895('0x33')]=_0x46580f[_0x2895('0x33')][_0x2895('0x46')]?_0x46580f['attributes']:_0x19ce85[_0x2895('0x2f')];if(_0x564983[_0x2895('0x30')][_0x2895('0x47')]){_0x46580f['include']=[{'all':!![]}];}_0x46580f=_[_0x2895('0x3d')]({},_0x46580f,_0x564983[_0x2895('0x3e')]);return db['JscriptyProject'][_0x2895('0x48')](_0x46580f)[_0x2895('0x21')](handleEntityNotFound(_0x4ef9fe,null))[_0x2895('0x21')](respondWithResult(_0x4ef9fe,null))[_0x2895('0x42')](handleError(_0x4ef9fe,null));};exports[_0x2895('0x49')]=function(_0x3cc331,_0x11e53a){return db['JscriptyProject'][_0x2895('0x49')](_0x3cc331[_0x2895('0x4a')],{})['then'](function(_0x4e1d47){var _0x574839=_0x3cc331[_0x2895('0x4b')][_0x2895('0x22')]({'plain':!![]});if(!_0x574839)throw new Error(_0x2895('0x4c'));if(_0x574839[_0x2895('0x4d')]===_0x2895('0x4b')){var _0x3c5261=_0x4e1d47[_0x2895('0x22')]({'plain':!![]});var _0x7df911=_0x2895('0x23');return db[_0x2895('0x4e')][_0x2895('0x48')]({'where':{'name':_0x7df911,'userProfileId':_0x574839[_0x2895('0x4f')]},'raw':!![]})[_0x2895('0x21')](function(_0x1481f5){if(_0x1481f5&&_0x1481f5[_0x2895('0x50')]===0x0){return db[_0x2895('0x24')][_0x2895('0x49')]({'name':_0x3c5261[_0x2895('0x26')],'resourceId':_0x3c5261['id'],'type':_0x1481f5[_0x2895('0x26')],'sectionId':_0x1481f5['id']},{})[_0x2895('0x21')](function(){return _0x4e1d47;});}else{return _0x4e1d47;}})[_0x2895('0x42')](function(_0x90ed5d){logger[_0x2895('0x51')](_0x2895('0x52'),_0x90ed5d);throw _0x90ed5d;});}return _0x4e1d47;})[_0x2895('0x21')](respondWithResult(_0x11e53a,0xc9))[_0x2895('0x42')](handleError(_0x11e53a,null));};exports[_0x2895('0x53')]=function(_0x290ed7,_0xc9e24e){var _0x4128f1={'where':{'id':_0x290ed7['params']['id']}},_0x6ea75f={};_0x6ea75f[_0x2895('0x2f')]=_[_0x2895('0x31')](db[_0x2895('0x2a')][_0x2895('0x2b')]);_0x4128f1[_0x2895('0x33')]=_[_0x2895('0x45')](_0x6ea75f['model'],qs[_0x2895('0x34')](_0x290ed7['query'][_0x2895('0x34')]));_0x4128f1[_0x2895('0x33')]=_0x4128f1[_0x2895('0x33')][_0x2895('0x46')]?_0x4128f1[_0x2895('0x33')]:_0x6ea75f['model'];if(_0x290ed7['query'][_0x2895('0x47')]){_0x4128f1[_0x2895('0x3f')]=[{'all':!![]}];}_0x4128f1=_[_0x2895('0x3d')]({},_0x4128f1,_0x290ed7['options']);return db[_0x2895('0x2a')]['find'](_0x4128f1)[_0x2895('0x21')](handleEntityNotFound(_0xc9e24e,null))['then'](function(_0x511b77){if(_0x511b77){var _0x49c4fd=_0x511b77['get']({'plain':!![]});_0x49c4fd=qs[_0x2895('0x54')](_0x49c4fd,['id',_0x2895('0x55'),_0x2895('0x56')]);_0x290ed7[_0x2895('0x4a')]=_[_0x2895('0x54')](_0x290ed7[_0x2895('0x4a')],['id',_0x2895('0x55'),'updatedAt']);return db[_0x2895('0x2a')][_0x2895('0x49')](_['merge'](_0x49c4fd,_0x290ed7[_0x2895('0x4a')]),{'include':_0x290ed7['query']['includeAll']?[{'all':!![]}]:undefined})[_0x2895('0x21')](function(_0x14d7f9){var _0x50299a=_0x290ed7[_0x2895('0x4b')][_0x2895('0x22')]({'plain':!![]});if(!_0x50299a)throw new Error(_0x2895('0x4c'));if(_0x50299a[_0x2895('0x4d')]==='user'){var _0x2d3f5b=_0x14d7f9['get']({'plain':!![]});var _0x409e2b='Projects';return db['UserProfileSection'][_0x2895('0x48')]({'where':{'name':_0x409e2b,'userProfileId':_0x50299a['userProfileId']},'raw':!![]})[_0x2895('0x21')](function(_0x39a28b){if(_0x39a28b&&_0x39a28b[_0x2895('0x50')]===0x0){return db['UserProfileResource'][_0x2895('0x49')]({'name':_0x2d3f5b[_0x2895('0x26')],'resourceId':_0x2d3f5b['id'],'type':_0x39a28b['name'],'sectionId':_0x39a28b['id']},{})['then'](function(){return _0x14d7f9;});}else{return _0x14d7f9;}})[_0x2895('0x42')](function(_0x347445){logger['error'](_0x2895('0x52'),_0x347445);throw _0x347445;});}return _0x14d7f9;});}})['then'](respondWithResult(_0xc9e24e,0xc9))['catch'](handleError(_0xc9e24e,null));};exports[_0x2895('0x20')]=function(_0x3241cb,_0x16b39c){if(_0x3241cb['body']['id']){delete _0x3241cb[_0x2895('0x4a')]['id'];}return db[_0x2895('0x2a')][_0x2895('0x48')]({'where':{'id':_0x3241cb[_0x2895('0x44')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0x16b39c,null))[_0x2895('0x21')](saveUpdates(_0x3241cb[_0x2895('0x4a')],null))['then'](respondWithResult(_0x16b39c,null))[_0x2895('0x42')](handleError(_0x16b39c,null));};exports[_0x2895('0x57')]=function(_0x40eb11,_0x115e04){return db[_0x2895('0x2a')][_0x2895('0x48')]({'where':{'id':_0x40eb11[_0x2895('0x44')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0x115e04,null))['then'](removeEntity(_0x115e04,null))[_0x2895('0x42')](handleError(_0x115e04,null));};exports[_0x2895('0x58')]=function(_0x16f369,_0x2288ff,_0xb7d7e5){var _0x160d15={'raw':!![],'where':{}};var _0x24b5a5={};var _0xb1e70b={'count':0x0,'rows':[]};return db[_0x2895('0x2a')][_0x2895('0x59')]({'where':{'id':_0x16f369['params']['id']}})[_0x2895('0x21')](handleEntityNotFound(_0x2288ff,null))[_0x2895('0x21')](function(_0xd90e52){if(_0xd90e52){_0x24b5a5[_0x2895('0x2f')]=_[_0x2895('0x31')](db[_0x2895('0x5a')][_0x2895('0x2b')]);_0x24b5a5[_0x2895('0x30')]=_[_0x2895('0x31')](_0x16f369[_0x2895('0x30')]);_0x24b5a5['filters']=_[_0x2895('0x45')](_0x24b5a5[_0x2895('0x2f')],_0x24b5a5[_0x2895('0x30')]);_0x160d15[_0x2895('0x33')]=_[_0x2895('0x45')](_0x24b5a5['model'],qs[_0x2895('0x34')](_0x16f369[_0x2895('0x30')]['fields']));_0x160d15['attributes']=_0x160d15['attributes'][_0x2895('0x46')]?_0x160d15[_0x2895('0x33')]:_0x24b5a5[_0x2895('0x2f')];if(!_0x16f369[_0x2895('0x30')][_0x2895('0x35')]('nolimit')){_0x160d15['limit']=qs[_0x2895('0x1a')](_0x16f369['query'][_0x2895('0x1a')]);_0x160d15['offset']=qs[_0x2895('0x18')](_0x16f369[_0x2895('0x30')]['offset']);}_0x160d15[_0x2895('0x37')]=qs[_0x2895('0x38')](_0x16f369[_0x2895('0x30')][_0x2895('0x38')]);_0x160d15['where']=qs['filters'](_[_0x2895('0x39')](_0x16f369['query'],_0x24b5a5['filters']));_0x160d15[_0x2895('0x3b')][_0x2895('0x5b')]=_0xd90e52['id'];if(_0x16f369[_0x2895('0x30')][_0x2895('0x3a')]){_0x160d15['where']=_[_0x2895('0x3d')](_0x160d15[_0x2895('0x3b')],{'$or':_[_0x2895('0x29')](_0x160d15[_0x2895('0x33')],function(_0x8fcb17){var _0x45e80c={};_0x45e80c[_0x8fcb17]={'$like':'%'+_0x16f369[_0x2895('0x30')][_0x2895('0x3a')]+'%'};return _0x45e80c;})});}_0x160d15=_[_0x2895('0x3d')]({},_0x160d15,_0x16f369[_0x2895('0x3e')]);return db[_0x2895('0x5a')][_0x2895('0x1b')]({'where':_0x160d15['where']})[_0x2895('0x21')](function(_0x11127b){_0xb1e70b[_0x2895('0x1b')]=_0x11127b;if(_0x16f369['query'][_0x2895('0x47')]){_0x160d15[_0x2895('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2895('0x40')](_0x160d15);})[_0x2895('0x21')](function(_0x2c1207){_0xb1e70b['rows']=_0x2c1207;return _0xb1e70b;});}})[_0x2895('0x21')](respondWithFilteredResult(_0x2288ff,_0x160d15))[_0x2895('0x42')](handleError(_0x2288ff,null));};exports[_0x2895('0x5c')]=function(_0x3fc6a1,_0x504a53,_0x311b06){var _0x210d1b={'raw':!![],'where':{}};var _0x465c50={};var _0x4aea3f={'count':0x0,'rows':[]};return db[_0x2895('0x2a')]['findOne']({'where':{'id':_0x3fc6a1[_0x2895('0x44')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0x504a53,null))[_0x2895('0x21')](function(_0x253e07){if(_0x253e07){_0x465c50['model']=_[_0x2895('0x31')](db[_0x2895('0x5d')][_0x2895('0x2b')]);_0x465c50['query']=_[_0x2895('0x31')](_0x3fc6a1['query']);_0x465c50[_0x2895('0x32')]=_[_0x2895('0x45')](_0x465c50['model'],_0x465c50['query']);_0x210d1b[_0x2895('0x33')]=_[_0x2895('0x45')](_0x465c50['model'],qs[_0x2895('0x34')](_0x3fc6a1[_0x2895('0x30')]['fields']));_0x210d1b[_0x2895('0x33')]=_0x210d1b[_0x2895('0x33')][_0x2895('0x46')]?_0x210d1b[_0x2895('0x33')]:_0x465c50[_0x2895('0x2f')];if(!_0x3fc6a1['query'][_0x2895('0x35')](_0x2895('0x36'))){_0x210d1b[_0x2895('0x1a')]=qs[_0x2895('0x1a')](_0x3fc6a1[_0x2895('0x30')]['limit']);_0x210d1b[_0x2895('0x18')]=qs[_0x2895('0x18')](_0x3fc6a1[_0x2895('0x30')][_0x2895('0x18')]);}_0x210d1b['order']=qs[_0x2895('0x38')](_0x3fc6a1[_0x2895('0x30')][_0x2895('0x38')]);_0x210d1b[_0x2895('0x3b')]=qs['filters'](_[_0x2895('0x39')](_0x3fc6a1[_0x2895('0x30')],_0x465c50[_0x2895('0x32')]));_0x210d1b[_0x2895('0x3b')][_0x2895('0x5b')]=_0x253e07['id'];if(_0x3fc6a1[_0x2895('0x30')]['filter']){_0x210d1b[_0x2895('0x3b')]=_[_0x2895('0x3d')](_0x210d1b[_0x2895('0x3b')],{'$or':_['map'](_0x210d1b['attributes'],function(_0x1ff21e){var _0x312817={};_0x312817[_0x1ff21e]={'$like':'%'+_0x3fc6a1[_0x2895('0x30')][_0x2895('0x3a')]+'%'};return _0x312817;})});}_0x210d1b=_[_0x2895('0x3d')]({},_0x210d1b,_0x3fc6a1['options']);return db[_0x2895('0x5d')][_0x2895('0x1b')]({'where':_0x210d1b[_0x2895('0x3b')]})['then'](function(_0x5c0937){_0x4aea3f[_0x2895('0x1b')]=_0x5c0937;if(_0x3fc6a1[_0x2895('0x30')][_0x2895('0x47')]){_0x210d1b['include']=[{'all':!![]}];}return db[_0x2895('0x5d')][_0x2895('0x40')](_0x210d1b);})[_0x2895('0x21')](function(_0x256a05){_0x4aea3f['rows']=_0x256a05;return _0x4aea3f;});}})[_0x2895('0x21')](respondWithFilteredResult(_0x504a53,_0x210d1b))[_0x2895('0x42')](handleError(_0x504a53,null));};function char(_0x71d436){return _0x2895('0x5e')===typeof _0x71d436?String[_0x2895('0x5f')][_0x2895('0x1d')](null,arguments):_0x71d436;}function needsEncapsulation(_0x3ae81f){return!!_0x3ae81f&&(_0x3ae81f[_0x2895('0x60')]()[_0x2895('0x61')](char(0xd))>=0x0||_0x3ae81f[_0x2895('0x60')]()[_0x2895('0x61')](char(0xa))>=0x0||_0x3ae81f[_0x2895('0x60')]()[_0x2895('0x61')](char(0x2c))>=0x0||_0x3ae81f[_0x2895('0x60')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5afb17){var _0x4b8c0f=char(0x22),_0x4f47e2='\x5c'+char(0x22),_0x440fbf=_0x5afb17[_0x2895('0x60')]()[_0x2895('0x62')](new RegExp(_0x4b8c0f,'g'),_0x4f47e2);return _0x4b8c0f+_0x440fbf+_0x4b8c0f;}exports[_0x2895('0x63')]=function(_0x227d11,_0x309b79,_0x8278ab){var _0x26e451,_0x26278b;var _0x1ebe43={'where':{'ProjectId':_0x227d11[_0x2895('0x44')]['id']}};if(_0x227d11[_0x2895('0x30')][_0x2895('0x64')]){_0x1ebe43[_0x2895('0x3b')]['starttime']=JSON[_0x2895('0x65')](_0x227d11[_0x2895('0x30')][_0x2895('0x64')]);}return db['JscriptySessionReport']['findAll'](_0x1ebe43)[_0x2895('0x21')](handleEntityNotFound(_0x309b79,null))[_0x2895('0x21')](function(_0x5c417d){if(_0x5c417d){_0x26e451=_0x5c417d;return db[_0x2895('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0x2895('0x29')](_0x26e451,'id')},'ProjectId':_0x227d11[_0x2895('0x44')]['id']},'order':_0x2895('0x67')});}})[_0x2895('0x21')](handleEntityNotFound(_0x309b79,null))[_0x2895('0x21')](function(_0x44d95d){if(_0x44d95d){_0x26278b=_0x44d95d;var _0x28f401={};for(var _0x5ee204=0x0,_0x11131a=_0x26278b[_0x2895('0x46')];_0x5ee204<_0x11131a;_0x5ee204++){if(!_0x28f401['hasOwnProperty'](_0x26278b[_0x5ee204][_0x2895('0x68')])){_0x28f401[_0x26278b[_0x5ee204][_0x2895('0x68')]]=needsEncapsulation(_0x26278b[_0x5ee204]['question'])?encapsulate(_0x26278b[_0x5ee204][_0x2895('0x69')]):_0x26278b[_0x5ee204][_0x2895('0x69')];}}var _0x1c5536=[],_0x5399d9={};for(var _0x272318=0x0,_0x3cda01=_0x26e451[_0x2895('0x46')];_0x272318<_0x3cda01;_0x272318++){_0x5399d9={'ProjectId':_0x227d11[_0x2895('0x44')]['id'],'SessionId':_0x26e451[_0x272318]['id'],'StartTime':moment(_0x26e451[_0x272318][_0x2895('0x6a')])[_0x2895('0x6b')](_0x2895('0x6c'))};for(var _0x3d3e82=0x0,_0xeafd57=_0x26278b[_0x2895('0x46')];_0x3d3e82<_0xeafd57;_0x3d3e82++){if(_0x26278b[_0x3d3e82]['SessionId']==_0x26e451[_0x272318]['id']&&_0x28f401[_0x2895('0x35')](_0x26278b[_0x3d3e82][_0x2895('0x68')])){_0x5399d9[_0x28f401[_0x26278b[_0x3d3e82][_0x2895('0x68')]]]=_0x26278b[_0x3d3e82][_0x2895('0x6d')];}}for(var _0x3ea24c in _0x28f401){if(!_0x5399d9[_0x2895('0x35')](_0x28f401[_0x3ea24c])){_0x5399d9[_0x28f401[_0x3ea24c]]=null;}}_0x1c5536[_0x2895('0x6e')](_0x5399d9);}return _0x1c5536;}})['then'](function(_0x17055a){if(!_['isEmpty'](_0x17055a)){var _0x168910=toCsv(_0x17055a);var _0x590171=Date[_0x2895('0x6f')]();fs[_0x2895('0x70')](util[_0x2895('0x6b')](_0x2895('0x71'),_0x227d11[_0x2895('0x44')]['id'],_0x590171),_0x168910);_0x309b79['setHeader'](_0x2895('0x72'),_0x2895('0x73')+util[_0x2895('0x6b')](_0x2895('0x74'),_0x227d11[_0x2895('0x44')]['id'],_0x590171));_0x309b79[_0x2895('0x75')](_0x2895('0x76'),'text/csv');return _0x309b79[_0x2895('0x77')](util[_0x2895('0x6b')](_0x2895('0x71'),_0x227d11[_0x2895('0x44')]['id'],_0x590171));}else{return _0x309b79['sendStatus'](0xcc);}})[_0x2895('0x42')](handleError(_0x309b79,null));}; \ No newline at end of file +var _0xdafb=['model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','update','getSessions','findOne','JscriptySessionReport','rawAttributes','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','Projects','UserProfileResource','destroy','error','name','index','map','JscriptyProject','fieldName','type','key'];(function(_0x4dd8f9,_0xd92970){var _0x491f7a=function(_0x5b8227){while(--_0x5b8227){_0x4dd8f9['push'](_0x4dd8f9['shift']());}};_0x491f7a(++_0xd92970);}(_0xdafb,0x1a9));var _0xbdaf=function(_0xa841c0,_0xcdb466){_0xa841c0=_0xa841c0-0x0;var _0x3d6734=_0xdafb[_0xa841c0];return _0x3d6734;};'use strict';var emlformat=require(_0xbdaf('0x0'));var rimraf=require(_0xbdaf('0x1'));var zipdir=require(_0xbdaf('0x2'));var jsonpatch=require(_0xbdaf('0x3'));var rp=require(_0xbdaf('0x4'));var moment=require(_0xbdaf('0x5'));var BPromise=require(_0xbdaf('0x6'));var Mustache=require(_0xbdaf('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbdaf('0x8'));var ejs=require(_0xbdaf('0x9'));var fs=require('fs');var fs_extra=require(_0xbdaf('0xa'));var _=require(_0xbdaf('0xb'));var squel=require(_0xbdaf('0xc'));var crypto=require(_0xbdaf('0xd'));var jsforce=require(_0xbdaf('0xe'));var deskjs=require(_0xbdaf('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbdaf('0x10'));var Redis=require(_0xbdaf('0x11'));var authService=require(_0xbdaf('0x12'));var qs=require(_0xbdaf('0x13'));var as=require(_0xbdaf('0x14'));var hardwareService=require(_0xbdaf('0x15'));var logger=require(_0xbdaf('0x16'))('api');var utils=require(_0xbdaf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbdaf('0x18'));var db=require(_0xbdaf('0x19'))['db'];function respondWithStatusCode(_0x4206c9,_0x2e5c81){_0x2e5c81=_0x2e5c81||0xcc;return function(_0x8a0033){if(_0x8a0033){return _0x4206c9[_0xbdaf('0x1a')](_0x2e5c81);}return _0x4206c9[_0xbdaf('0x1b')](_0x2e5c81)[_0xbdaf('0x1c')]();};}function respondWithResult(_0x47de5c,_0x202320){_0x202320=_0x202320||0xc8;return function(_0x484ce3){if(_0x484ce3){return _0x47de5c['status'](_0x202320)['json'](_0x484ce3);}};}function respondWithFilteredResult(_0x3b9bce,_0x22eaab){return function(_0x459558){if(_0x459558){var _0x558785=typeof _0x22eaab[_0xbdaf('0x1d')]==='undefined'&&typeof _0x22eaab[_0xbdaf('0x1e')]===_0xbdaf('0x1f');var _0x216382=_0x459558[_0xbdaf('0x20')];var _0x25b884=_0x558785?0x0:_0x22eaab[_0xbdaf('0x1d')];var _0x7ff20c=_0x558785?_0x459558[_0xbdaf('0x20')]:_0x22eaab[_0xbdaf('0x1d')]+_0x22eaab[_0xbdaf('0x1e')];var _0xa12892;if(_0x7ff20c>=_0x216382){_0x7ff20c=_0x216382;_0xa12892=0xc8;}else{_0xa12892=0xce;}_0x3b9bce[_0xbdaf('0x1b')](_0xa12892);return _0x3b9bce[_0xbdaf('0x21')](_0xbdaf('0x22'),_0x25b884+'-'+_0x7ff20c+'/'+_0x216382)[_0xbdaf('0x23')](_0x459558);}return null;};}function patchUpdates(_0x2b4e37){return function(_0x5dc382){try{jsonpatch[_0xbdaf('0x24')](_0x5dc382,_0x2b4e37,!![]);}catch(_0x21ed88){return BPromise[_0xbdaf('0x25')](_0x21ed88);}return _0x5dc382[_0xbdaf('0x26')]();};}function saveUpdates(_0x16b15c,_0x260689){return function(_0x130459){if(_0x130459){return _0x130459['update'](_0x16b15c)[_0xbdaf('0x27')](function(_0x545ab2){return _0x545ab2;});}return null;};}function removeEntity(_0x3a3ce8,_0x52089c){return function(_0x1c0fbc){if(_0x1c0fbc){return _0x1c0fbc['destroy']()[_0xbdaf('0x27')](function(){var _0x44d991=_0x1c0fbc['get']({'plain':!![]});var _0x3edb73=_0xbdaf('0x28');return db[_0xbdaf('0x29')][_0xbdaf('0x2a')]({'where':{'type':_0x3edb73,'resourceId':_0x44d991['id']}})[_0xbdaf('0x27')](function(){return _0x1c0fbc;});})['then'](function(){_0x3a3ce8['status'](0xcc)[_0xbdaf('0x1c')]();});}};}function handleEntityNotFound(_0x5b4449,_0x5ad8a6){return function(_0x802578){if(!_0x802578){_0x5b4449[_0xbdaf('0x1a')](0x194);}return _0x802578;};}function handleError(_0x1cefc2,_0x50ea52){_0x50ea52=_0x50ea52||0x1f4;return function(_0xba7944){logger[_0xbdaf('0x2b')](_0xba7944['stack']);if(_0xba7944[_0xbdaf('0x2c')]){delete _0xba7944[_0xbdaf('0x2c')];}_0x1cefc2['status'](_0x50ea52)['send'](_0xba7944);};}exports[_0xbdaf('0x2d')]=function(_0x33aa4e,_0x4fb4f){var _0x349687={},_0x427336={},_0x293c37={'count':0x0,'rows':[]};var _0x53e3b2=_[_0xbdaf('0x2e')](db[_0xbdaf('0x2f')]['rawAttributes'],function(_0x538ee9){return{'name':_0x538ee9[_0xbdaf('0x30')],'type':_0x538ee9[_0xbdaf('0x31')][_0xbdaf('0x32')]};});_0x427336[_0xbdaf('0x33')]=_[_0xbdaf('0x2e')](_0x53e3b2,'name');_0x427336[_0xbdaf('0x34')]=_[_0xbdaf('0x35')](_0x33aa4e['query']);_0x427336['filters']=_[_0xbdaf('0x36')](_0x427336[_0xbdaf('0x33')],_0x427336['query']);_0x349687['attributes']=_['intersection'](_0x427336[_0xbdaf('0x33')],qs[_0xbdaf('0x37')](_0x33aa4e[_0xbdaf('0x34')][_0xbdaf('0x37')]));_0x349687[_0xbdaf('0x38')]=_0x349687[_0xbdaf('0x38')]['length']?_0x349687[_0xbdaf('0x38')]:_0x427336[_0xbdaf('0x33')];if(!_0x33aa4e['query'][_0xbdaf('0x39')](_0xbdaf('0x3a'))){_0x349687[_0xbdaf('0x1e')]=qs[_0xbdaf('0x1e')](_0x33aa4e[_0xbdaf('0x34')][_0xbdaf('0x1e')]);_0x349687[_0xbdaf('0x1d')]=qs['offset'](_0x33aa4e[_0xbdaf('0x34')][_0xbdaf('0x1d')]);}_0x349687[_0xbdaf('0x3b')]=qs[_0xbdaf('0x3c')](_0x33aa4e[_0xbdaf('0x34')][_0xbdaf('0x3c')]);_0x349687['where']=qs[_0xbdaf('0x3d')](_[_0xbdaf('0x3e')](_0x33aa4e[_0xbdaf('0x34')],_0x427336[_0xbdaf('0x3d')]),_0x53e3b2);if(_0x33aa4e[_0xbdaf('0x34')][_0xbdaf('0x3f')]){_0x349687[_0xbdaf('0x40')]=_[_0xbdaf('0x41')](_0x349687[_0xbdaf('0x40')],{'$or':_[_0xbdaf('0x2e')](_0x53e3b2,function(_0x1c2411){if(_0x1c2411[_0xbdaf('0x31')]!=='VIRTUAL'){var _0x43df53={};_0x43df53[_0x1c2411[_0xbdaf('0x2c')]]={'$like':'%'+_0x33aa4e['query'][_0xbdaf('0x3f')]+'%'};return _0x43df53;}})});}_0x349687=_[_0xbdaf('0x41')]({},_0x349687,_0x33aa4e[_0xbdaf('0x42')]);var _0x59f622={'where':_0x349687[_0xbdaf('0x40')]};return db[_0xbdaf('0x2f')][_0xbdaf('0x20')](_0x59f622)[_0xbdaf('0x27')](function(_0x17125f){_0x293c37['count']=_0x17125f;if(_0x33aa4e['query'][_0xbdaf('0x43')]){_0x349687[_0xbdaf('0x44')]=[{'all':!![]}];}return db[_0xbdaf('0x2f')][_0xbdaf('0x45')](_0x349687);})[_0xbdaf('0x27')](function(_0x5319ca){_0x293c37[_0xbdaf('0x46')]=_0x5319ca;return _0x293c37;})[_0xbdaf('0x27')](respondWithFilteredResult(_0x4fb4f,_0x349687))[_0xbdaf('0x47')](handleError(_0x4fb4f,null));};exports['show']=function(_0x755c1,_0x3c157d){var _0x3b20ef={'raw':![],'where':{'id':_0x755c1[_0xbdaf('0x48')]['id']}},_0x250b6f={};_0x250b6f[_0xbdaf('0x33')]=_[_0xbdaf('0x35')](db[_0xbdaf('0x2f')]['rawAttributes']);_0x250b6f[_0xbdaf('0x34')]=_[_0xbdaf('0x35')](_0x755c1[_0xbdaf('0x34')]);_0x250b6f[_0xbdaf('0x3d')]=_[_0xbdaf('0x36')](_0x250b6f['model'],_0x250b6f[_0xbdaf('0x34')]);_0x3b20ef['attributes']=_[_0xbdaf('0x36')](_0x250b6f[_0xbdaf('0x33')],qs['fields'](_0x755c1[_0xbdaf('0x34')][_0xbdaf('0x37')]));_0x3b20ef[_0xbdaf('0x38')]=_0x3b20ef[_0xbdaf('0x38')][_0xbdaf('0x49')]?_0x3b20ef[_0xbdaf('0x38')]:_0x250b6f[_0xbdaf('0x33')];if(_0x755c1[_0xbdaf('0x34')][_0xbdaf('0x43')]){_0x3b20ef[_0xbdaf('0x44')]=[{'all':!![]}];}_0x3b20ef=_[_0xbdaf('0x41')]({},_0x3b20ef,_0x755c1[_0xbdaf('0x42')]);return db[_0xbdaf('0x2f')][_0xbdaf('0x4a')](_0x3b20ef)[_0xbdaf('0x27')](handleEntityNotFound(_0x3c157d,null))['then'](respondWithResult(_0x3c157d,null))[_0xbdaf('0x47')](handleError(_0x3c157d,null));};exports['create']=function(_0x185529,_0x232629){return db[_0xbdaf('0x2f')][_0xbdaf('0x4b')](_0x185529[_0xbdaf('0x4c')],{})[_0xbdaf('0x27')](function(_0x4ff243){var _0x53a572=_0x185529['user'][_0xbdaf('0x4d')]({'plain':!![]});if(!_0x53a572)throw new Error(_0xbdaf('0x4e'));if(_0x53a572['role']===_0xbdaf('0x4f')){var _0x2cbf06=_0x4ff243[_0xbdaf('0x4d')]({'plain':!![]});var _0x3f3ec3='Projects';return db[_0xbdaf('0x50')][_0xbdaf('0x4a')]({'where':{'name':_0x3f3ec3,'userProfileId':_0x53a572[_0xbdaf('0x51')]},'raw':!![]})[_0xbdaf('0x27')](function(_0x1f3022){if(_0x1f3022&&_0x1f3022[_0xbdaf('0x52')]===0x0){return db[_0xbdaf('0x29')][_0xbdaf('0x4b')]({'name':_0x2cbf06[_0xbdaf('0x2c')],'resourceId':_0x2cbf06['id'],'type':_0x1f3022[_0xbdaf('0x2c')],'sectionId':_0x1f3022['id']},{})[_0xbdaf('0x27')](function(){return _0x4ff243;});}else{return _0x4ff243;}})[_0xbdaf('0x47')](function(_0x3cb6b7){logger[_0xbdaf('0x2b')](_0xbdaf('0x53'),_0x3cb6b7);throw _0x3cb6b7;});}return _0x4ff243;})[_0xbdaf('0x27')](respondWithResult(_0x232629,0xc9))['catch'](handleError(_0x232629,null));};exports['clone']=function(_0x5ab9e2,_0x38feb3){var _0x134f9c={'where':{'id':_0x5ab9e2[_0xbdaf('0x48')]['id']}},_0xf595e0={};_0xf595e0[_0xbdaf('0x33')]=_[_0xbdaf('0x35')](db['JscriptyProject']['rawAttributes']);_0x134f9c['attributes']=_['intersection'](_0xf595e0['model'],qs[_0xbdaf('0x37')](_0x5ab9e2['query'][_0xbdaf('0x37')]));_0x134f9c[_0xbdaf('0x38')]=_0x134f9c[_0xbdaf('0x38')]['length']?_0x134f9c[_0xbdaf('0x38')]:_0xf595e0[_0xbdaf('0x33')];if(_0x5ab9e2['query']['includeAll']){_0x134f9c[_0xbdaf('0x44')]=[{'all':!![]}];}_0x134f9c=_[_0xbdaf('0x41')]({},_0x134f9c,_0x5ab9e2[_0xbdaf('0x42')]);return db[_0xbdaf('0x2f')][_0xbdaf('0x4a')](_0x134f9c)['then'](handleEntityNotFound(_0x38feb3,null))[_0xbdaf('0x27')](function(_0x4ae904){if(_0x4ae904){var _0x5e5269=_0x4ae904[_0xbdaf('0x4d')]({'plain':!![]});_0x5e5269=qs[_0xbdaf('0x54')](_0x5e5269,['id',_0xbdaf('0x55'),_0xbdaf('0x56')]);_0x5ab9e2[_0xbdaf('0x4c')]=_[_0xbdaf('0x54')](_0x5ab9e2[_0xbdaf('0x4c')],['id',_0xbdaf('0x55'),_0xbdaf('0x56')]);return db[_0xbdaf('0x2f')][_0xbdaf('0x4b')](_[_0xbdaf('0x41')](_0x5e5269,_0x5ab9e2['body']),{'include':_0x5ab9e2[_0xbdaf('0x34')][_0xbdaf('0x43')]?[{'all':!![]}]:undefined})[_0xbdaf('0x27')](function(_0x419fe1){var _0x1c8f4b=_0x5ab9e2[_0xbdaf('0x4f')][_0xbdaf('0x4d')]({'plain':!![]});if(!_0x1c8f4b)throw new Error(_0xbdaf('0x4e'));if(_0x1c8f4b[_0xbdaf('0x57')]===_0xbdaf('0x4f')){var _0x133f86=_0x419fe1[_0xbdaf('0x4d')]({'plain':!![]});var _0x2f88c3=_0xbdaf('0x28');return db[_0xbdaf('0x50')][_0xbdaf('0x4a')]({'where':{'name':_0x2f88c3,'userProfileId':_0x1c8f4b[_0xbdaf('0x51')]},'raw':!![]})[_0xbdaf('0x27')](function(_0x3bed8d){if(_0x3bed8d&&_0x3bed8d[_0xbdaf('0x52')]===0x0){return db[_0xbdaf('0x29')][_0xbdaf('0x4b')]({'name':_0x133f86[_0xbdaf('0x2c')],'resourceId':_0x133f86['id'],'type':_0x3bed8d[_0xbdaf('0x2c')],'sectionId':_0x3bed8d['id']},{})['then'](function(){return _0x419fe1;});}else{return _0x419fe1;}})['catch'](function(_0x1caa74){logger['error'](_0xbdaf('0x53'),_0x1caa74);throw _0x1caa74;});}return _0x419fe1;});}})[_0xbdaf('0x27')](respondWithResult(_0x38feb3,0xc9))[_0xbdaf('0x47')](handleError(_0x38feb3,null));};exports[_0xbdaf('0x58')]=function(_0x4a3177,_0x43eda5){if(_0x4a3177[_0xbdaf('0x4c')]['id']){delete _0x4a3177['body']['id'];}return db[_0xbdaf('0x2f')][_0xbdaf('0x4a')]({'where':{'id':_0x4a3177[_0xbdaf('0x48')]['id']}})['then'](handleEntityNotFound(_0x43eda5,null))['then'](saveUpdates(_0x4a3177[_0xbdaf('0x4c')],null))[_0xbdaf('0x27')](respondWithResult(_0x43eda5,null))['catch'](handleError(_0x43eda5,null));};exports[_0xbdaf('0x2a')]=function(_0x399269,_0x57422f){return db[_0xbdaf('0x2f')][_0xbdaf('0x4a')]({'where':{'id':_0x399269[_0xbdaf('0x48')]['id']}})['then'](handleEntityNotFound(_0x57422f,null))[_0xbdaf('0x27')](removeEntity(_0x57422f,null))[_0xbdaf('0x47')](handleError(_0x57422f,null));};exports[_0xbdaf('0x59')]=function(_0x3baa93,_0x387b81,_0x54e4b4){var _0x3e61f8={'raw':!![],'where':{}};var _0x158eea={};var _0x2b6d21={'count':0x0,'rows':[]};return db[_0xbdaf('0x2f')][_0xbdaf('0x5a')]({'where':{'id':_0x3baa93['params']['id']}})[_0xbdaf('0x27')](handleEntityNotFound(_0x387b81,null))[_0xbdaf('0x27')](function(_0x245b2b){if(_0x245b2b){_0x158eea[_0xbdaf('0x33')]=_['keys'](db[_0xbdaf('0x5b')][_0xbdaf('0x5c')]);_0x158eea['query']=_[_0xbdaf('0x35')](_0x3baa93[_0xbdaf('0x34')]);_0x158eea[_0xbdaf('0x3d')]=_[_0xbdaf('0x36')](_0x158eea['model'],_0x158eea[_0xbdaf('0x34')]);_0x3e61f8[_0xbdaf('0x38')]=_[_0xbdaf('0x36')](_0x158eea[_0xbdaf('0x33')],qs[_0xbdaf('0x37')](_0x3baa93[_0xbdaf('0x34')][_0xbdaf('0x37')]));_0x3e61f8[_0xbdaf('0x38')]=_0x3e61f8[_0xbdaf('0x38')][_0xbdaf('0x49')]?_0x3e61f8[_0xbdaf('0x38')]:_0x158eea['model'];if(!_0x3baa93[_0xbdaf('0x34')][_0xbdaf('0x39')](_0xbdaf('0x3a'))){_0x3e61f8[_0xbdaf('0x1e')]=qs['limit'](_0x3baa93[_0xbdaf('0x34')][_0xbdaf('0x1e')]);_0x3e61f8[_0xbdaf('0x1d')]=qs['offset'](_0x3baa93['query']['offset']);}_0x3e61f8['order']=qs[_0xbdaf('0x3c')](_0x3baa93[_0xbdaf('0x34')]['sort']);_0x3e61f8[_0xbdaf('0x40')]=qs[_0xbdaf('0x3d')](_[_0xbdaf('0x3e')](_0x3baa93[_0xbdaf('0x34')],_0x158eea[_0xbdaf('0x3d')]));_0x3e61f8[_0xbdaf('0x40')][_0xbdaf('0x5d')]=_0x245b2b['id'];if(_0x3baa93['query'][_0xbdaf('0x3f')]){_0x3e61f8[_0xbdaf('0x40')]=_[_0xbdaf('0x41')](_0x3e61f8[_0xbdaf('0x40')],{'$or':_[_0xbdaf('0x2e')](_0x3e61f8['attributes'],function(_0xf8d09d){var _0x115ff5={};_0x115ff5[_0xf8d09d]={'$like':'%'+_0x3baa93['query'][_0xbdaf('0x3f')]+'%'};return _0x115ff5;})});}_0x3e61f8=_[_0xbdaf('0x41')]({},_0x3e61f8,_0x3baa93[_0xbdaf('0x42')]);return db[_0xbdaf('0x5b')]['count']({'where':_0x3e61f8[_0xbdaf('0x40')]})[_0xbdaf('0x27')](function(_0x2bb080){_0x2b6d21[_0xbdaf('0x20')]=_0x2bb080;if(_0x3baa93[_0xbdaf('0x34')][_0xbdaf('0x43')]){_0x3e61f8[_0xbdaf('0x44')]=[{'all':!![]}];}return db[_0xbdaf('0x5b')][_0xbdaf('0x45')](_0x3e61f8);})[_0xbdaf('0x27')](function(_0x2b017d){_0x2b6d21['rows']=_0x2b017d;return _0x2b6d21;});}})[_0xbdaf('0x27')](respondWithFilteredResult(_0x387b81,_0x3e61f8))[_0xbdaf('0x47')](handleError(_0x387b81,null));};exports[_0xbdaf('0x5e')]=function(_0x3596fc,_0x47031f,_0x59357e){var _0x1af45b={'raw':!![],'where':{}};var _0x1f6428={};var _0x28f407={'count':0x0,'rows':[]};return db[_0xbdaf('0x2f')]['findOne']({'where':{'id':_0x3596fc[_0xbdaf('0x48')]['id']}})['then'](handleEntityNotFound(_0x47031f,null))[_0xbdaf('0x27')](function(_0x5e491d){if(_0x5e491d){_0x1f6428[_0xbdaf('0x33')]=_['keys'](db[_0xbdaf('0x5f')][_0xbdaf('0x5c')]);_0x1f6428[_0xbdaf('0x34')]=_[_0xbdaf('0x35')](_0x3596fc['query']);_0x1f6428[_0xbdaf('0x3d')]=_[_0xbdaf('0x36')](_0x1f6428[_0xbdaf('0x33')],_0x1f6428['query']);_0x1af45b[_0xbdaf('0x38')]=_[_0xbdaf('0x36')](_0x1f6428['model'],qs[_0xbdaf('0x37')](_0x3596fc[_0xbdaf('0x34')][_0xbdaf('0x37')]));_0x1af45b['attributes']=_0x1af45b[_0xbdaf('0x38')][_0xbdaf('0x49')]?_0x1af45b[_0xbdaf('0x38')]:_0x1f6428['model'];if(!_0x3596fc[_0xbdaf('0x34')][_0xbdaf('0x39')]('nolimit')){_0x1af45b['limit']=qs['limit'](_0x3596fc['query'][_0xbdaf('0x1e')]);_0x1af45b['offset']=qs[_0xbdaf('0x1d')](_0x3596fc[_0xbdaf('0x34')][_0xbdaf('0x1d')]);}_0x1af45b[_0xbdaf('0x3b')]=qs[_0xbdaf('0x3c')](_0x3596fc[_0xbdaf('0x34')][_0xbdaf('0x3c')]);_0x1af45b['where']=qs[_0xbdaf('0x3d')](_[_0xbdaf('0x3e')](_0x3596fc['query'],_0x1f6428[_0xbdaf('0x3d')]));_0x1af45b[_0xbdaf('0x40')][_0xbdaf('0x5d')]=_0x5e491d['id'];if(_0x3596fc['query']['filter']){_0x1af45b[_0xbdaf('0x40')]=_['merge'](_0x1af45b[_0xbdaf('0x40')],{'$or':_[_0xbdaf('0x2e')](_0x1af45b[_0xbdaf('0x38')],function(_0x1c0bd3){var _0x1983ab={};_0x1983ab[_0x1c0bd3]={'$like':'%'+_0x3596fc[_0xbdaf('0x34')][_0xbdaf('0x3f')]+'%'};return _0x1983ab;})});}_0x1af45b=_[_0xbdaf('0x41')]({},_0x1af45b,_0x3596fc[_0xbdaf('0x42')]);return db[_0xbdaf('0x5f')]['count']({'where':_0x1af45b['where']})[_0xbdaf('0x27')](function(_0x4a7e05){_0x28f407[_0xbdaf('0x20')]=_0x4a7e05;if(_0x3596fc[_0xbdaf('0x34')][_0xbdaf('0x43')]){_0x1af45b[_0xbdaf('0x44')]=[{'all':!![]}];}return db[_0xbdaf('0x5f')][_0xbdaf('0x45')](_0x1af45b);})[_0xbdaf('0x27')](function(_0x1c9d4c){_0x28f407[_0xbdaf('0x46')]=_0x1c9d4c;return _0x28f407;});}})[_0xbdaf('0x27')](respondWithFilteredResult(_0x47031f,_0x1af45b))['catch'](handleError(_0x47031f,null));};function char(_0x5beb4b){return _0xbdaf('0x60')===typeof _0x5beb4b?String[_0xbdaf('0x61')][_0xbdaf('0x24')](null,arguments):_0x5beb4b;}function needsEncapsulation(_0x4c4691){return!!_0x4c4691&&(_0x4c4691['toString']()['indexOf'](char(0xd))>=0x0||_0x4c4691[_0xbdaf('0x62')]()[_0xbdaf('0x63')](char(0xa))>=0x0||_0x4c4691[_0xbdaf('0x62')]()[_0xbdaf('0x63')](char(0x2c))>=0x0||_0x4c4691[_0xbdaf('0x62')]()[_0xbdaf('0x63')](char(0x22))>=0x0);}function encapsulate(_0x2abe0e){var _0x36ef24=char(0x22),_0x1c504c='\x5c'+char(0x22),_0x161727=_0x2abe0e[_0xbdaf('0x62')]()[_0xbdaf('0x64')](new RegExp(_0x36ef24,'g'),_0x1c504c);return _0x36ef24+_0x161727+_0x36ef24;}exports[_0xbdaf('0x65')]=function(_0x121b86,_0x441b46,_0x5a2a7d){var _0x8b9107,_0x10b60c;var _0x1a60f2={'where':{'ProjectId':_0x121b86[_0xbdaf('0x48')]['id']}};if(_0x121b86['query'][_0xbdaf('0x66')]){_0x1a60f2[_0xbdaf('0x40')]['starttime']=JSON['parse'](_0x121b86[_0xbdaf('0x34')][_0xbdaf('0x66')]);}return db[_0xbdaf('0x5b')][_0xbdaf('0x45')](_0x1a60f2)['then'](handleEntityNotFound(_0x441b46,null))[_0xbdaf('0x27')](function(_0x283061){if(_0x283061){_0x8b9107=_0x283061;return db[_0xbdaf('0x67')][_0xbdaf('0x45')]({'where':{'SessionId':{'$in':_[_0xbdaf('0x2e')](_0x8b9107,'id')},'ProjectId':_0x121b86[_0xbdaf('0x48')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x441b46,null))[_0xbdaf('0x27')](function(_0x21abdf){if(_0x21abdf){_0x10b60c=_0x21abdf;var _0x2ea8d8={};for(var _0x31245f=0x0,_0x3cd3bb=_0x10b60c[_0xbdaf('0x49')];_0x31245f<_0x3cd3bb;_0x31245f++){if(!_0x2ea8d8['hasOwnProperty'](_0x10b60c[_0x31245f][_0xbdaf('0x68')])){_0x2ea8d8[_0x10b60c[_0x31245f][_0xbdaf('0x68')]]=needsEncapsulation(_0x10b60c[_0x31245f][_0xbdaf('0x69')])?encapsulate(_0x10b60c[_0x31245f]['question']):_0x10b60c[_0x31245f]['question'];}}var _0x2a369c=[],_0xf051df={};for(var _0x3462fe=0x0,_0x2a535e=_0x8b9107[_0xbdaf('0x49')];_0x3462fe<_0x2a535e;_0x3462fe++){_0xf051df={'ProjectId':_0x121b86['params']['id'],'SessionId':_0x8b9107[_0x3462fe]['id'],'StartTime':moment(_0x8b9107[_0x3462fe][_0xbdaf('0x6a')])[_0xbdaf('0x6b')](_0xbdaf('0x6c'))};for(var _0x18fa34=0x0,_0x2f93e4=_0x10b60c[_0xbdaf('0x49')];_0x18fa34<_0x2f93e4;_0x18fa34++){if(_0x10b60c[_0x18fa34]['SessionId']==_0x8b9107[_0x3462fe]['id']&&_0x2ea8d8[_0xbdaf('0x39')](_0x10b60c[_0x18fa34][_0xbdaf('0x68')])){_0xf051df[_0x2ea8d8[_0x10b60c[_0x18fa34]['questionId']]]=_0x10b60c[_0x18fa34]['answer'];}}for(var _0x39cf03 in _0x2ea8d8){if(!_0xf051df[_0xbdaf('0x39')](_0x2ea8d8[_0x39cf03])){_0xf051df[_0x2ea8d8[_0x39cf03]]=null;}}_0x2a369c[_0xbdaf('0x6d')](_0xf051df);}return _0x2a369c;}})[_0xbdaf('0x27')](function(_0x5e034f){if(!_[_0xbdaf('0x6e')](_0x5e034f)){var _0x581cb4=toCsv(_0x5e034f);var _0x3328cb=Date['now']();fs[_0xbdaf('0x6f')](util[_0xbdaf('0x6b')](_0xbdaf('0x70'),_0x121b86[_0xbdaf('0x48')]['id'],_0x3328cb),_0x581cb4);_0x441b46['setHeader'](_0xbdaf('0x71'),_0xbdaf('0x72')+util[_0xbdaf('0x6b')]('Jscripty_Project_%d_Summary_%s.csv',_0x121b86[_0xbdaf('0x48')]['id'],_0x3328cb));_0x441b46[_0xbdaf('0x73')](_0xbdaf('0x74'),_0xbdaf('0x75'));return _0x441b46[_0xbdaf('0x76')](util[_0xbdaf('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x121b86[_0xbdaf('0x48')]['id'],_0x3328cb));}else{return _0x441b46[_0xbdaf('0x1a')](0xcc);}})[_0xbdaf('0x47')](handleError(_0x441b46,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 735c12e..1a6b456 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 _0x446c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','jscripty_projects'];(function(_0x42eeb4,_0x3a9aac){var _0x104d10=function(_0x1154c9){while(--_0x1154c9){_0x42eeb4['push'](_0x42eeb4['shift']());}};_0x104d10(++_0x3a9aac);}(_0x446c,0x156));var _0xc446=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x446c[_0x2f6541];return _0x4d76d8;};'use strict';var _=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var logger=require(_0xc446('0x2'))(_0xc446('0x3'));var moment=require('moment');var BPromise=require(_0xc446('0x4'));var rp=require(_0xc446('0x5'));var fs=require('fs');var path=require(_0xc446('0x6'));var rimraf=require('rimraf');var config=require(_0xc446('0x7'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x115a9e,_0x235050){return _0x115a9e['define']('JscriptyProject',attributes,{'tableName':_0xc446('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52ad=['./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x52ad,0x1d8));var _0xd52a=function(_0x21f223,_0x38e73b){_0x21f223=_0x21f223-0x0;var _0x47dc40=_0x52ad[_0x21f223];return _0x47dc40;};'use strict';var _=require(_0xd52a('0x0'));var util=require(_0xd52a('0x1'));var logger=require(_0xd52a('0x2'))(_0xd52a('0x3'));var moment=require('moment');var BPromise=require(_0xd52a('0x4'));var rp=require(_0xd52a('0x5'));var fs=require('fs');var path=require(_0xd52a('0x6'));var rimraf=require(_0xd52a('0x7'));var config=require(_0xd52a('0x8'));var attributes=require(_0xd52a('0x9'));module[_0xd52a('0xa')]=function(_0x1f8aec,_0x186c1e){return _0x1f8aec['define'](_0xd52a('0xb'),attributes,{'tableName':_0xd52a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 152e1d2..55fd542 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x20cc24,_0xf659b5){var _0x382d36=function(_0x49991f){while(--_0x49991f){_0x20cc24['push'](_0x20cc24['shift']());}};_0x382d36(++_0xf659b5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0xcb91[_0x1399d6];return _0x4a9db4;};'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')]('JscriptyProject,\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','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x15f4d2,_0x3cb7c6){var _0x127d6a=function(_0x4ceb2f){while(--_0x4ceb2f){_0x15f4d2['push'](_0x15f4d2['shift']());}};_0x127d6a(++_0x3cb7c6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xcb91[_0x562f3b];return _0x1edd55;};'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')]('JscriptyProject,\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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 92bef74..538789b 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 _0x3fb7=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','delete','destroy','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3fb7,0xc8));var _0x73fb=function(_0x5de4c7,_0x1f41e0){_0x5de4c7=_0x5de4c7-0x0;var _0x1beb57=_0x3fb7[_0x5de4c7];return _0x1beb57;};'use strict';var multer=require(_0x73fb('0x0'));var util=require(_0x73fb('0x1'));var path=require(_0x73fb('0x2'));var timeout=require('connect-timeout');var express=require(_0x73fb('0x3'));var router=express[_0x73fb('0x4')]();var fs_extra=require(_0x73fb('0x5'));var auth=require(_0x73fb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x73fb('0x7'));var controller=require(_0x73fb('0x8'));router[_0x73fb('0x9')]('/',auth[_0x73fb('0xa')](),controller['index']);router[_0x73fb('0x9')](_0x73fb('0xb'),auth['isAuthenticated'](),controller[_0x73fb('0xc')]);router[_0x73fb('0x9')](_0x73fb('0xd'),auth[_0x73fb('0xa')](),controller[_0x73fb('0xe')]);router[_0x73fb('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x73fb('0x10')]('/:id',auth[_0x73fb('0xa')](),controller['update']);router[_0x73fb('0x11')](_0x73fb('0xd'),auth[_0x73fb('0xa')](),controller[_0x73fb('0x12')]);module[_0x73fb('0x13')]=router; \ No newline at end of file +var _0x09f1=['/:id','show','post','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x558fce,_0x308ed1){var _0xbaa91=function(_0x448580){while(--_0x448580){_0x558fce['push'](_0x558fce['shift']());}};_0xbaa91(++_0x308ed1);}(_0x09f1,0xd7));var _0x109f=function(_0x5147e8,_0x246041){_0x5147e8=_0x5147e8-0x0;var _0x201199=_0x09f1[_0x5147e8];return _0x201199;};'use strict';var multer=require(_0x109f('0x0'));var util=require(_0x109f('0x1'));var path=require(_0x109f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x109f('0x3'));var auth=require(_0x109f('0x4'));var interaction=require(_0x109f('0x5'));var config=require(_0x109f('0x6'));var controller=require(_0x109f('0x7'));router[_0x109f('0x8')]('/',auth[_0x109f('0x9')](),controller[_0x109f('0xa')]);router[_0x109f('0x8')](_0x109f('0xb'),auth['isAuthenticated'](),controller[_0x109f('0xc')]);router[_0x109f('0x8')](_0x109f('0xd'),auth[_0x109f('0x9')](),controller[_0x109f('0xe')]);router[_0x109f('0xf')]('/',auth[_0x109f('0x9')](),controller['create']);router['put'](_0x109f('0xd'),auth['isAuthenticated'](),controller[_0x109f('0x10')]);router['delete'](_0x109f('0xd'),auth[_0x109f('0x9')](),controller[_0x109f('0x11')]);module[_0x109f('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 4018504..c5e7cce 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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x3ae664,_0x37a081){_0x3ae664=_0x3ae664-0x0;var _0x234d50=_0x7a54[_0x3ae664];return _0x234d50;};'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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x1d08b4,_0x8bd28f){_0x1d08b4=_0x1d08b4-0x0;var _0x42a1f6=_0x7a54[_0x1d08b4];return _0x42a1f6;};'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 7ba147a..8d7f9ac 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 _0x61f2=['JscriptyQuestionReport','findAll','rows','catch','params','length','includeAll','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0x61f2,0x9e));var _0x261f=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x61f2[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0x261f('0x0'));var rimraf=require(_0x261f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x261f('0x2'));var rp=require(_0x261f('0x3'));var moment=require(_0x261f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x261f('0x5'));var util=require(_0x261f('0x6'));var path=require(_0x261f('0x7'));var sox=require(_0x261f('0x8'));var csv=require(_0x261f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x261f('0xa'));var _=require(_0x261f('0xb'));var squel=require(_0x261f('0xc'));var crypto=require(_0x261f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x261f('0xe'));var toCsv=require(_0x261f('0x9'));var querystring=require(_0x261f('0xf'));var Papa=require(_0x261f('0x10'));var Redis=require('ioredis');var authService=require(_0x261f('0x11'));var qs=require(_0x261f('0x12'));var as=require(_0x261f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x261f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x261f('0x15'));var db=require(_0x261f('0x16'))['db'];function respondWithStatusCode(_0x1dded5,_0x47571f){_0x47571f=_0x47571f||0xcc;return function(_0x3fa666){if(_0x3fa666){return _0x1dded5[_0x261f('0x17')](_0x47571f);}return _0x1dded5[_0x261f('0x18')](_0x47571f)[_0x261f('0x19')]();};}function respondWithResult(_0x32afa6,_0x52bba7){_0x52bba7=_0x52bba7||0xc8;return function(_0x21b9be){if(_0x21b9be){return _0x32afa6[_0x261f('0x18')](_0x52bba7)[_0x261f('0x1a')](_0x21b9be);}};}function respondWithFilteredResult(_0x81f1d3,_0x155868){return function(_0x15ed44){if(_0x15ed44){var _0x8e7630=typeof _0x155868[_0x261f('0x1b')]===_0x261f('0x1c')&&typeof _0x155868['limit']===_0x261f('0x1c');var _0x13664c=_0x15ed44[_0x261f('0x1d')];var _0x32f703=_0x8e7630?0x0:_0x155868['offset'];var _0xf31f96=_0x8e7630?_0x15ed44['count']:_0x155868['offset']+_0x155868[_0x261f('0x1e')];var _0x1f0acf;if(_0xf31f96>=_0x13664c){_0xf31f96=_0x13664c;_0x1f0acf=0xc8;}else{_0x1f0acf=0xce;}_0x81f1d3[_0x261f('0x18')](_0x1f0acf);return _0x81f1d3['set'](_0x261f('0x1f'),_0x32f703+'-'+_0xf31f96+'/'+_0x13664c)[_0x261f('0x1a')](_0x15ed44);}return null;};}function patchUpdates(_0x1c1c1e){return function(_0x38de37){try{jsonpatch[_0x261f('0x20')](_0x38de37,_0x1c1c1e,!![]);}catch(_0xf7a7d7){return BPromise[_0x261f('0x21')](_0xf7a7d7);}return _0x38de37[_0x261f('0x22')]();};}function saveUpdates(_0x5156d2,_0x1a9e5e){return function(_0x54a9aa){if(_0x54a9aa){return _0x54a9aa[_0x261f('0x23')](_0x5156d2)[_0x261f('0x24')](function(_0x4c89ed){return _0x4c89ed;});}return null;};}function removeEntity(_0x1bbc73,_0x1b9a44){return function(_0x39a084){if(_0x39a084){return _0x39a084[_0x261f('0x25')]()[_0x261f('0x24')](function(){_0x1bbc73[_0x261f('0x18')](0xcc)[_0x261f('0x19')]();});}};}function handleEntityNotFound(_0x48686d,_0x5afdf9){return function(_0x3d756e){if(!_0x3d756e){_0x48686d['sendStatus'](0x194);}return _0x3d756e;};}function handleError(_0x2460a1,_0x2ffc85){_0x2ffc85=_0x2ffc85||0x1f4;return function(_0x39b2e5){logger['error'](_0x39b2e5[_0x261f('0x26')]);if(_0x39b2e5[_0x261f('0x27')]){delete _0x39b2e5['name'];}_0x2460a1[_0x261f('0x18')](_0x2ffc85)['send'](_0x39b2e5);};}exports[_0x261f('0x28')]=function(_0xf2845c,_0x2da428){var _0x1398cc={},_0x5a21e8={},_0x136cd5={'count':0x0,'rows':[]};var _0x212308=_[_0x261f('0x29')](db['JscriptyQuestionReport'][_0x261f('0x2a')],function(_0x232d6e){return{'name':_0x232d6e[_0x261f('0x2b')],'type':_0x232d6e[_0x261f('0x2c')]['key']};});_0x5a21e8[_0x261f('0x2d')]=_[_0x261f('0x29')](_0x212308,_0x261f('0x27'));_0x5a21e8[_0x261f('0x2e')]=_['keys'](_0xf2845c[_0x261f('0x2e')]);_0x5a21e8[_0x261f('0x2f')]=_['intersection'](_0x5a21e8['model'],_0x5a21e8[_0x261f('0x2e')]);_0x1398cc[_0x261f('0x30')]=_[_0x261f('0x31')](_0x5a21e8[_0x261f('0x2d')],qs[_0x261f('0x32')](_0xf2845c[_0x261f('0x2e')][_0x261f('0x32')]));_0x1398cc[_0x261f('0x30')]=_0x1398cc['attributes']['length']?_0x1398cc[_0x261f('0x30')]:_0x5a21e8[_0x261f('0x2d')];if(!_0xf2845c[_0x261f('0x2e')][_0x261f('0x33')](_0x261f('0x34'))){_0x1398cc[_0x261f('0x1e')]=qs[_0x261f('0x1e')](_0xf2845c['query']['limit']);_0x1398cc[_0x261f('0x1b')]=qs[_0x261f('0x1b')](_0xf2845c[_0x261f('0x2e')][_0x261f('0x1b')]);}_0x1398cc[_0x261f('0x35')]=qs[_0x261f('0x36')](_0xf2845c['query'][_0x261f('0x36')]);_0x1398cc['where']=qs[_0x261f('0x2f')](_[_0x261f('0x37')](_0xf2845c['query'],_0x5a21e8['filters']),_0x212308);if(_0xf2845c[_0x261f('0x2e')][_0x261f('0x38')]){_0x1398cc['where']=_[_0x261f('0x39')](_0x1398cc['where'],{'$or':_[_0x261f('0x29')](_0x212308,function(_0x209cf9){if(_0x209cf9['type']!==_0x261f('0x3a')){var _0x88f000={};_0x88f000[_0x209cf9[_0x261f('0x27')]]={'$like':'%'+_0xf2845c[_0x261f('0x2e')]['filter']+'%'};return _0x88f000;}})});}_0x1398cc=_[_0x261f('0x39')]({},_0x1398cc,_0xf2845c[_0x261f('0x3b')]);var _0x52efb8={'where':_0x1398cc[_0x261f('0x3c')]};return db[_0x261f('0x3d')][_0x261f('0x1d')](_0x52efb8)[_0x261f('0x24')](function(_0xa244e2){_0x136cd5[_0x261f('0x1d')]=_0xa244e2;if(_0xf2845c[_0x261f('0x2e')]['includeAll']){_0x1398cc['include']=[{'all':!![]}];}return db[_0x261f('0x3d')][_0x261f('0x3e')](_0x1398cc);})[_0x261f('0x24')](function(_0x32c2f9){_0x136cd5[_0x261f('0x3f')]=_0x32c2f9;return _0x136cd5;})[_0x261f('0x24')](respondWithFilteredResult(_0x2da428,_0x1398cc))[_0x261f('0x40')](handleError(_0x2da428,null));};exports['show']=function(_0x6e77fb,_0x394038){var _0x1ad0cb={'raw':!![],'where':{'id':_0x6e77fb[_0x261f('0x41')]['id']}},_0x3ba2ee={};_0x3ba2ee[_0x261f('0x2d')]=_['keys'](db[_0x261f('0x3d')][_0x261f('0x2a')]);_0x3ba2ee['query']=_['keys'](_0x6e77fb[_0x261f('0x2e')]);_0x3ba2ee[_0x261f('0x2f')]=_['intersection'](_0x3ba2ee[_0x261f('0x2d')],_0x3ba2ee['query']);_0x1ad0cb[_0x261f('0x30')]=_[_0x261f('0x31')](_0x3ba2ee[_0x261f('0x2d')],qs[_0x261f('0x32')](_0x6e77fb[_0x261f('0x2e')]['fields']));_0x1ad0cb[_0x261f('0x30')]=_0x1ad0cb[_0x261f('0x30')][_0x261f('0x42')]?_0x1ad0cb[_0x261f('0x30')]:_0x3ba2ee['model'];if(_0x6e77fb['query'][_0x261f('0x43')]){_0x1ad0cb[_0x261f('0x44')]=[{'all':!![]}];}_0x1ad0cb=_[_0x261f('0x39')]({},_0x1ad0cb,_0x6e77fb[_0x261f('0x3b')]);return db[_0x261f('0x3d')]['find'](_0x1ad0cb)[_0x261f('0x24')](handleEntityNotFound(_0x394038,null))[_0x261f('0x24')](respondWithResult(_0x394038,null))['catch'](handleError(_0x394038,null));};exports[_0x261f('0x45')]=function(_0x5eaf11,_0x55b7ae){return db['JscriptyQuestionReport'][_0x261f('0x45')](_0x5eaf11['body'],{})[_0x261f('0x24')](respondWithResult(_0x55b7ae,0xc9))[_0x261f('0x40')](handleError(_0x55b7ae,null));};exports[_0x261f('0x23')]=function(_0x4306ad,_0x578c84){if(_0x4306ad[_0x261f('0x46')]['id']){delete _0x4306ad[_0x261f('0x46')]['id'];}return db['JscriptyQuestionReport'][_0x261f('0x47')]({'where':{'id':_0x4306ad[_0x261f('0x41')]['id']}})[_0x261f('0x24')](handleEntityNotFound(_0x578c84,null))[_0x261f('0x24')](saveUpdates(_0x4306ad[_0x261f('0x46')],null))['then'](respondWithResult(_0x578c84,null))['catch'](handleError(_0x578c84,null));};exports[_0x261f('0x25')]=function(_0x20edcd,_0x19f7a1){return db[_0x261f('0x3d')][_0x261f('0x47')]({'where':{'id':_0x20edcd['params']['id']}})[_0x261f('0x24')](handleEntityNotFound(_0x19f7a1,null))[_0x261f('0x24')](removeEntity(_0x19f7a1,null))[_0x261f('0x40')](handleError(_0x19f7a1,null));};exports['describe']=function(_0x2e2125,_0x4c4104){return db[_0x261f('0x3d')][_0x261f('0x48')]()[_0x261f('0x24')](respondWithResult(_0x4c4104,null))[_0x261f('0x40')](handleError(_0x4c4104,null));}; \ No newline at end of file +var _0xe7cd=['update','then','destroy','sendStatus','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyQuestionReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x3927a9,_0x253765){var _0xa3231a=function(_0x454f44){while(--_0x454f44){_0x3927a9['push'](_0x3927a9['shift']());}};_0xa3231a(++_0x253765);}(_0xe7cd,0xb2));var _0xde7c=function(_0x679b99,_0x5b09c7){_0x679b99=_0x679b99-0x0;var _0x2e6eae=_0xe7cd[_0x679b99];return _0x2e6eae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xde7c('0x0'));var jsonpatch=require(_0xde7c('0x1'));var rp=require(_0xde7c('0x2'));var moment=require(_0xde7c('0x3'));var BPromise=require(_0xde7c('0x4'));var Mustache=require(_0xde7c('0x5'));var util=require(_0xde7c('0x6'));var path=require(_0xde7c('0x7'));var sox=require(_0xde7c('0x8'));var csv=require('to-csv');var ejs=require(_0xde7c('0x9'));var fs=require('fs');var fs_extra=require(_0xde7c('0xa'));var _=require(_0xde7c('0xb'));var squel=require('squel');var crypto=require(_0xde7c('0xc'));var jsforce=require(_0xde7c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xde7c('0xe'));var Papa=require(_0xde7c('0xf'));var Redis=require('ioredis');var authService=require(_0xde7c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde7c('0x11'));var utils=require(_0xde7c('0x12'));var config=require(_0xde7c('0x13'));var licenseUtil=require(_0xde7c('0x14'));var db=require(_0xde7c('0x15'))['db'];function respondWithStatusCode(_0x36bcb4,_0x516410){_0x516410=_0x516410||0xcc;return function(_0x46a0a9){if(_0x46a0a9){return _0x36bcb4['sendStatus'](_0x516410);}return _0x36bcb4[_0xde7c('0x16')](_0x516410)[_0xde7c('0x17')]();};}function respondWithResult(_0x1bda13,_0x454030){_0x454030=_0x454030||0xc8;return function(_0x266f23){if(_0x266f23){return _0x1bda13[_0xde7c('0x16')](_0x454030)['json'](_0x266f23);}};}function respondWithFilteredResult(_0x3c2e27,_0x31717b){return function(_0x5d2ff6){if(_0x5d2ff6){var _0x4cdaff=typeof _0x31717b[_0xde7c('0x18')]==='undefined'&&typeof _0x31717b[_0xde7c('0x19')]===_0xde7c('0x1a');var _0x49f3dd=_0x5d2ff6[_0xde7c('0x1b')];var _0x4a81d8=_0x4cdaff?0x0:_0x31717b[_0xde7c('0x18')];var _0x540d73=_0x4cdaff?_0x5d2ff6[_0xde7c('0x1b')]:_0x31717b['offset']+_0x31717b['limit'];var _0x2adeb9;if(_0x540d73>=_0x49f3dd){_0x540d73=_0x49f3dd;_0x2adeb9=0xc8;}else{_0x2adeb9=0xce;}_0x3c2e27[_0xde7c('0x16')](_0x2adeb9);return _0x3c2e27[_0xde7c('0x1c')](_0xde7c('0x1d'),_0x4a81d8+'-'+_0x540d73+'/'+_0x49f3dd)['json'](_0x5d2ff6);}return null;};}function patchUpdates(_0x4efd73){return function(_0x3c0a0a){try{jsonpatch[_0xde7c('0x1e')](_0x3c0a0a,_0x4efd73,!![]);}catch(_0x5a6cee){return BPromise[_0xde7c('0x1f')](_0x5a6cee);}return _0x3c0a0a['save']();};}function saveUpdates(_0x319d38,_0x1f5427){return function(_0x5cbd3f){if(_0x5cbd3f){return _0x5cbd3f[_0xde7c('0x20')](_0x319d38)[_0xde7c('0x21')](function(_0x4111e2){return _0x4111e2;});}return null;};}function removeEntity(_0x4c77c6,_0x49e215){return function(_0x20a029){if(_0x20a029){return _0x20a029[_0xde7c('0x22')]()[_0xde7c('0x21')](function(){_0x4c77c6['status'](0xcc)[_0xde7c('0x17')]();});}};}function handleEntityNotFound(_0x29323f,_0x4681df){return function(_0x30d6bc){if(!_0x30d6bc){_0x29323f[_0xde7c('0x23')](0x194);}return _0x30d6bc;};}function handleError(_0x511a1a,_0x548049){_0x548049=_0x548049||0x1f4;return function(_0x87c9d4){logger['error'](_0x87c9d4[_0xde7c('0x24')]);if(_0x87c9d4[_0xde7c('0x25')]){delete _0x87c9d4[_0xde7c('0x25')];}_0x511a1a['status'](_0x548049)['send'](_0x87c9d4);};}exports['index']=function(_0x2cb4c4,_0x4bffb8){var _0x393097={},_0x476f93={},_0x263b55={'count':0x0,'rows':[]};var _0x1a9c2c=_[_0xde7c('0x26')](db['JscriptyQuestionReport'][_0xde7c('0x27')],function(_0x344f1a){return{'name':_0x344f1a[_0xde7c('0x28')],'type':_0x344f1a[_0xde7c('0x29')][_0xde7c('0x2a')]};});_0x476f93[_0xde7c('0x2b')]=_[_0xde7c('0x26')](_0x1a9c2c,_0xde7c('0x25'));_0x476f93[_0xde7c('0x2c')]=_['keys'](_0x2cb4c4[_0xde7c('0x2c')]);_0x476f93[_0xde7c('0x2d')]=_[_0xde7c('0x2e')](_0x476f93[_0xde7c('0x2b')],_0x476f93[_0xde7c('0x2c')]);_0x393097[_0xde7c('0x2f')]=_[_0xde7c('0x2e')](_0x476f93[_0xde7c('0x2b')],qs[_0xde7c('0x30')](_0x2cb4c4['query'][_0xde7c('0x30')]));_0x393097[_0xde7c('0x2f')]=_0x393097[_0xde7c('0x2f')]['length']?_0x393097[_0xde7c('0x2f')]:_0x476f93[_0xde7c('0x2b')];if(!_0x2cb4c4['query']['hasOwnProperty'](_0xde7c('0x31'))){_0x393097[_0xde7c('0x19')]=qs[_0xde7c('0x19')](_0x2cb4c4[_0xde7c('0x2c')]['limit']);_0x393097[_0xde7c('0x18')]=qs[_0xde7c('0x18')](_0x2cb4c4[_0xde7c('0x2c')][_0xde7c('0x18')]);}_0x393097['order']=qs[_0xde7c('0x32')](_0x2cb4c4[_0xde7c('0x2c')][_0xde7c('0x32')]);_0x393097[_0xde7c('0x33')]=qs['filters'](_[_0xde7c('0x34')](_0x2cb4c4[_0xde7c('0x2c')],_0x476f93[_0xde7c('0x2d')]),_0x1a9c2c);if(_0x2cb4c4['query']['filter']){_0x393097[_0xde7c('0x33')]=_[_0xde7c('0x35')](_0x393097[_0xde7c('0x33')],{'$or':_[_0xde7c('0x26')](_0x1a9c2c,function(_0x1a8180){if(_0x1a8180[_0xde7c('0x29')]!==_0xde7c('0x36')){var _0x4812d1={};_0x4812d1[_0x1a8180['name']]={'$like':'%'+_0x2cb4c4[_0xde7c('0x2c')][_0xde7c('0x37')]+'%'};return _0x4812d1;}})});}_0x393097=_[_0xde7c('0x35')]({},_0x393097,_0x2cb4c4[_0xde7c('0x38')]);var _0x510d42={'where':_0x393097[_0xde7c('0x33')]};return db[_0xde7c('0x39')][_0xde7c('0x1b')](_0x510d42)[_0xde7c('0x21')](function(_0x2277af){_0x263b55[_0xde7c('0x1b')]=_0x2277af;if(_0x2cb4c4[_0xde7c('0x2c')][_0xde7c('0x3a')]){_0x393097[_0xde7c('0x3b')]=[{'all':!![]}];}return db[_0xde7c('0x39')][_0xde7c('0x3c')](_0x393097);})[_0xde7c('0x21')](function(_0x23c2b4){_0x263b55[_0xde7c('0x3d')]=_0x23c2b4;return _0x263b55;})['then'](respondWithFilteredResult(_0x4bffb8,_0x393097))[_0xde7c('0x3e')](handleError(_0x4bffb8,null));};exports[_0xde7c('0x3f')]=function(_0xc06654,_0x317e21){var _0x4676bd={'raw':!![],'where':{'id':_0xc06654[_0xde7c('0x40')]['id']}},_0x4342ff={};_0x4342ff[_0xde7c('0x2b')]=_['keys'](db[_0xde7c('0x39')][_0xde7c('0x27')]);_0x4342ff[_0xde7c('0x2c')]=_['keys'](_0xc06654[_0xde7c('0x2c')]);_0x4342ff['filters']=_['intersection'](_0x4342ff['model'],_0x4342ff['query']);_0x4676bd[_0xde7c('0x2f')]=_[_0xde7c('0x2e')](_0x4342ff[_0xde7c('0x2b')],qs[_0xde7c('0x30')](_0xc06654[_0xde7c('0x2c')]['fields']));_0x4676bd[_0xde7c('0x2f')]=_0x4676bd[_0xde7c('0x2f')][_0xde7c('0x41')]?_0x4676bd[_0xde7c('0x2f')]:_0x4342ff[_0xde7c('0x2b')];if(_0xc06654['query']['includeAll']){_0x4676bd[_0xde7c('0x3b')]=[{'all':!![]}];}_0x4676bd=_[_0xde7c('0x35')]({},_0x4676bd,_0xc06654[_0xde7c('0x38')]);return db['JscriptyQuestionReport'][_0xde7c('0x42')](_0x4676bd)['then'](handleEntityNotFound(_0x317e21,null))[_0xde7c('0x21')](respondWithResult(_0x317e21,null))[_0xde7c('0x3e')](handleError(_0x317e21,null));};exports[_0xde7c('0x43')]=function(_0x5b6d6f,_0x2d15a8){return db['JscriptyQuestionReport']['create'](_0x5b6d6f[_0xde7c('0x44')],{})[_0xde7c('0x21')](respondWithResult(_0x2d15a8,0xc9))['catch'](handleError(_0x2d15a8,null));};exports[_0xde7c('0x20')]=function(_0x1062d8,_0x50715e){if(_0x1062d8['body']['id']){delete _0x1062d8['body']['id'];}return db[_0xde7c('0x39')][_0xde7c('0x42')]({'where':{'id':_0x1062d8[_0xde7c('0x40')]['id']}})[_0xde7c('0x21')](handleEntityNotFound(_0x50715e,null))[_0xde7c('0x21')](saveUpdates(_0x1062d8[_0xde7c('0x44')],null))[_0xde7c('0x21')](respondWithResult(_0x50715e,null))['catch'](handleError(_0x50715e,null));};exports[_0xde7c('0x22')]=function(_0x8f7973,_0x4910d4){return db[_0xde7c('0x39')][_0xde7c('0x42')]({'where':{'id':_0x8f7973[_0xde7c('0x40')]['id']}})[_0xde7c('0x21')](handleEntityNotFound(_0x4910d4,null))[_0xde7c('0x21')](removeEntity(_0x4910d4,null))['catch'](handleError(_0x4910d4,null));};exports['describe']=function(_0x4183b4,_0xc512f0){return db[_0xde7c('0x39')][_0xde7c('0x45')]()['then'](respondWithResult(_0xc512f0,null))[_0xde7c('0x3e')](handleError(_0xc512f0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 134f374..a7273a0 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 _0x753e=['report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x753e,0xfd));var _0xe753=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x753e[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0xe753('0x0'));var util=require('util');var logger=require(_0xe753('0x1'))(_0xe753('0x2'));var moment=require(_0xe753('0x3'));var BPromise=require(_0xe753('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe753('0x5'));var rimraf=require(_0xe753('0x6'));var config=require(_0xe753('0x7'));var attributes=require(_0xe753('0x8'));module[_0xe753('0x9')]=function(_0x1a0eea,_0x28df4f){return _0x1a0eea['define'](_0xe753('0xa'),attributes,{'tableName':_0xe753('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81c5=['define','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x81c5,0xe6));var _0x581c=function(_0x578898,_0x41c94d){_0x578898=_0x578898-0x0;var _0x4f3d49=_0x81c5[_0x578898];return _0x4f3d49;};'use strict';var _=require(_0x581c('0x0'));var util=require(_0x581c('0x1'));var logger=require(_0x581c('0x2'))(_0x581c('0x3'));var moment=require('moment');var BPromise=require(_0x581c('0x4'));var rp=require(_0x581c('0x5'));var fs=require('fs');var path=require(_0x581c('0x6'));var rimraf=require(_0x581c('0x7'));var config=require(_0x581c('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x581c('0x9')]=function(_0x1fcc4f,_0x400c77){return _0x1fcc4f[_0x581c('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x581c('0xb'),'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 488259d..e693414 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 _0x7c86=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','request\x20sent','debug'];(function(_0x21554d,_0xd7c37e){var _0x5bf3b9=function(_0x4a9a40){while(--_0x4a9a40){_0x21554d['push'](_0x21554d['shift']());}};_0x5bf3b9(++_0xd7c37e);}(_0x7c86,0x64));var _0x67c8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x7c86[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x67c8('0x0'));var util=require('util');var moment=require(_0x67c8('0x1'));var BPromise=require(_0x67c8('0x2'));var rs=require(_0x67c8('0x3'));var fs=require('fs');var Redis=require(_0x67c8('0x4'));var db=require(_0x67c8('0x5'))['db'];var utils=require(_0x67c8('0x6'));var logger=require('../../config/logger')(_0x67c8('0x7'));var config=require(_0x67c8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67c8('0x9')][_0x67c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x142b75,_0x1209bd,_0x36d13f){return new BPromise(function(_0x3821a0,_0xd1f3e3){return client[_0x67c8('0xb')](_0x142b75,_0x36d13f)['then'](function(_0x3a0584){logger[_0x67c8('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1209bd,_0x67c8('0xd'));logger[_0x67c8('0xe')](_0x67c8('0xf'),_0x1209bd,_0x67c8('0xd'),JSON[_0x67c8('0x10')](_0x3a0584));if(_0x3a0584[_0x67c8('0x11')]){if(_0x3a0584[_0x67c8('0x11')][_0x67c8('0x12')]===0x1f4){logger['error'](_0x67c8('0x13'),_0x1209bd,_0x3a0584[_0x67c8('0x11')]['message']);return _0xd1f3e3(_0x3a0584['error']['message']);}logger[_0x67c8('0x11')](_0x67c8('0x13'),_0x1209bd,_0x3a0584[_0x67c8('0x11')][_0x67c8('0x14')]);return _0x3821a0(_0x3a0584[_0x67c8('0x11')][_0x67c8('0x14')]);}else{logger[_0x67c8('0xc')](_0x67c8('0x13'),_0x1209bd,'request\x20sent');_0x3821a0(_0x3a0584[_0x67c8('0x15')][_0x67c8('0x14')]);}})[_0x67c8('0x16')](function(_0x380b3a){logger[_0x67c8('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1209bd,_0x380b3a);_0xd1f3e3(_0x380b3a);});});} \ No newline at end of file +var _0x340c=['../../config/logger','jayson/promise','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x413c1b,_0x2a75c3){var _0x12dab3=function(_0x19840a){while(--_0x19840a){_0x413c1b['push'](_0x413c1b['shift']());}};_0x12dab3(++_0x2a75c3);}(_0x340c,0x134));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc340('0x0'));var util=require(_0xc340('0x1'));var moment=require(_0xc340('0x2'));var BPromise=require(_0xc340('0x3'));var rs=require(_0xc340('0x4'));var fs=require('fs');var Redis=require(_0xc340('0x5'));var db=require(_0xc340('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc340('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc340('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32696a,_0x415902,_0x256092){return new BPromise(function(_0x51d870,_0x133834){return client['request'](_0x32696a,_0x256092)[_0xc340('0x9')](function(_0x58e7f8){logger[_0xc340('0xa')](_0xc340('0xb'),_0x415902,_0xc340('0xc'));logger[_0xc340('0xd')](_0xc340('0xe'),_0x415902,_0xc340('0xc'),JSON[_0xc340('0xf')](_0x58e7f8));if(_0x58e7f8['error']){if(_0x58e7f8[_0xc340('0x10')][_0xc340('0x11')]===0x1f4){logger[_0xc340('0x10')](_0xc340('0xb'),_0x415902,_0x58e7f8[_0xc340('0x10')][_0xc340('0x12')]);return _0x133834(_0x58e7f8[_0xc340('0x10')][_0xc340('0x12')]);}logger[_0xc340('0x10')](_0xc340('0xb'),_0x415902,_0x58e7f8[_0xc340('0x10')][_0xc340('0x12')]);return _0x51d870(_0x58e7f8['error']['message']);}else{logger[_0xc340('0xa')](_0xc340('0xb'),_0x415902,'request\x20sent');_0x51d870(_0x58e7f8[_0xc340('0x13')][_0xc340('0x12')]);}})[_0xc340('0x14')](function(_0x46d848){logger[_0xc340('0x10')](_0xc340('0xb'),_0x415902,_0x46d848);_0x133834(_0x46d848);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index fbd884a..b9a0181 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 _0x3ac3=['show','/:id/questions','getQuestions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x59fffa,_0x5a61db){var _0x281d4e=function(_0x5327ca){while(--_0x5327ca){_0x59fffa['push'](_0x59fffa['shift']());}};_0x281d4e(++_0x5a61db);}(_0x3ac3,0xf9));var _0x33ac=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x3ac3[_0x2bc1fe];return _0x1a47a5;};'use strict';var multer=require(_0x33ac('0x0'));var util=require(_0x33ac('0x1'));var path=require(_0x33ac('0x2'));var timeout=require(_0x33ac('0x3'));var express=require(_0x33ac('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(_0x33ac('0x5'));var controller=require(_0x33ac('0x6'));router[_0x33ac('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x33ac('0x8')](),controller[_0x33ac('0x9')]);router[_0x33ac('0x7')](_0x33ac('0xa'),auth[_0x33ac('0x8')](),controller[_0x33ac('0xb')]);router[_0x33ac('0x7')](_0x33ac('0xc'),auth[_0x33ac('0x8')](),controller[_0x33ac('0xd')]);router[_0x33ac('0xe')]('/',auth[_0x33ac('0x8')](),controller[_0x33ac('0xf')]);router[_0x33ac('0x10')]('/:id',auth[_0x33ac('0x8')](),controller[_0x33ac('0x11')]);router[_0x33ac('0x12')](_0x33ac('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x33ac('0x13')]=router; \ No newline at end of file +var _0xcffd=['index','/describe','isAuthenticated','/:id','/:id/questions','getQuestions','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get'];(function(_0x317a15,_0x391d0b){var _0x4c4d77=function(_0x52b935){while(--_0x52b935){_0x317a15['push'](_0x317a15['shift']());}};_0x4c4d77(++_0x391d0b);}(_0xcffd,0x7a));var _0xdcff=function(_0x874541,_0x474c7e){_0x874541=_0x874541-0x0;var _0x18df05=_0xcffd[_0x874541];return _0x18df05;};'use strict';var multer=require(_0xdcff('0x0'));var util=require('util');var path=require(_0xdcff('0x1'));var timeout=require(_0xdcff('0x2'));var express=require(_0xdcff('0x3'));var router=express[_0xdcff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdcff('0x5'));var interaction=require(_0xdcff('0x6'));var config=require(_0xdcff('0x7'));var controller=require(_0xdcff('0x8'));router[_0xdcff('0x9')]('/',auth['isAuthenticated'](),controller[_0xdcff('0xa')]);router[_0xdcff('0x9')](_0xdcff('0xb'),auth[_0xdcff('0xc')](),controller['describe']);router[_0xdcff('0x9')](_0xdcff('0xd'),auth[_0xdcff('0xc')](),controller['show']);router[_0xdcff('0x9')](_0xdcff('0xe'),auth[_0xdcff('0xc')](),controller[_0xdcff('0xf')]);router[_0xdcff('0x10')]('/',auth['isAuthenticated'](),controller[_0xdcff('0x11')]);router['put'](_0xdcff('0xd'),auth[_0xdcff('0xc')](),controller[_0xdcff('0x12')]);router[_0xdcff('0x13')]('/:id',auth[_0xdcff('0xc')](),controller[_0xdcff('0x14')]);module[_0xdcff('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 20018f9..f3b9886 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 _0x458b=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','setDataValue','starttime','endtime','format'];(function(_0x3ac946,_0x52a63a){var _0x10826c=function(_0x3c33ea){while(--_0x3c33ea){_0x3ac946['push'](_0x3ac946['shift']());}};_0x10826c(++_0x52a63a);}(_0x458b,0x6f));var _0xb458=function(_0x232635,_0x1dcb1b){_0x232635=_0x232635-0x0;var _0x27028b=_0x458b[_0x232635];return _0x27028b;};'use strict';var moment=require(_0xb458('0x0'));var Sequelize=require('sequelize');module[_0xb458('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4b7074){this[_0xb458('0x2')](_0xb458('0x3'),_0x4b7074);this[_0xb458('0x2')](_0xb458('0x4'),moment()[_0xb458('0x5')](_0xb458('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xb458('0x7')]},'projectname':{'type':Sequelize[_0xb458('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb458('0x7')]},'calleridname':{'type':Sequelize[_0xb458('0x7')]},'calleridnum':{'type':Sequelize[_0xb458('0x7')]},'completed':{'type':Sequelize[_0xb458('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xb555=['sequelize','exports','setDataValue','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment'];(function(_0x426adc,_0x5d45a1){var _0x2cbc34=function(_0x39cce6){while(--_0x39cce6){_0x426adc['push'](_0x426adc['shift']());}};_0x2cbc34(++_0x5d45a1);}(_0xb555,0xef));var _0x5b55=function(_0x95d45e,_0x292e7d){_0x95d45e=_0x95d45e-0x0;var _0x4ce5fe=_0xb555[_0x95d45e];return _0x4ce5fe;};'use strict';var moment=require(_0x5b55('0x0'));var Sequelize=require(_0x5b55('0x1'));module[_0x5b55('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3e2776){this[_0x5b55('0x3')]('starttime',_0x3e2776);this[_0x5b55('0x3')]('endtime',moment()['format'](_0x5b55('0x4')));}},'endtime':{'type':Sequelize[_0x5b55('0x5')]},'membername':{'type':Sequelize[_0x5b55('0x6')]},'projectname':{'type':Sequelize[_0x5b55('0x6')]},'queue':{'type':Sequelize[_0x5b55('0x6')]},'uniqueid':{'type':Sequelize[_0x5b55('0x6')]},'calleridname':{'type':Sequelize[_0x5b55('0x6')]},'calleridnum':{'type':Sequelize[_0x5b55('0x6')]},'completed':{'type':Sequelize[_0x5b55('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index dbc912b..9dcf1a6 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 _0x46a7=['sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','findOne','JscriptyQuestionReport','order','SessionId','rimraf','zip-dir','moment','util','path'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x46a7,0x186));var _0x746a=function(_0x290bc6,_0x45bf7c){_0x290bc6=_0x290bc6-0x0;var _0xc13096=_0x46a7[_0x290bc6];return _0xc13096;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x746a('0x0'));var zipdir=require(_0x746a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x746a('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x746a('0x3'));var path=require(_0x746a('0x4'));var sox=require(_0x746a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x746a('0x6'));var _=require(_0x746a('0x7'));var squel=require(_0x746a('0x8'));var crypto=require(_0x746a('0x9'));var jsforce=require(_0x746a('0xa'));var deskjs=require(_0x746a('0xb'));var toCsv=require(_0x746a('0xc'));var querystring=require(_0x746a('0xd'));var Papa=require(_0x746a('0xe'));var Redis=require(_0x746a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x746a('0x10'));var as=require(_0x746a('0x11'));var hardwareService=require(_0x746a('0x12'));var logger=require(_0x746a('0x13'))('api');var utils=require(_0x746a('0x14'));var config=require(_0x746a('0x15'));var licenseUtil=require(_0x746a('0x16'));var db=require(_0x746a('0x17'))['db'];function respondWithStatusCode(_0x3c9f5b,_0x2153d6){_0x2153d6=_0x2153d6||0xcc;return function(_0x2c0656){if(_0x2c0656){return _0x3c9f5b[_0x746a('0x18')](_0x2153d6);}return _0x3c9f5b[_0x746a('0x19')](_0x2153d6)[_0x746a('0x1a')]();};}function respondWithResult(_0x5ab6dd,_0x5f38de){_0x5f38de=_0x5f38de||0xc8;return function(_0x51388b){if(_0x51388b){return _0x5ab6dd[_0x746a('0x19')](_0x5f38de)[_0x746a('0x1b')](_0x51388b);}};}function respondWithFilteredResult(_0x2dfc53,_0x1c3866){return function(_0x2dbe0e){if(_0x2dbe0e){var _0x157bb7=typeof _0x1c3866[_0x746a('0x1c')]===_0x746a('0x1d')&&typeof _0x1c3866[_0x746a('0x1e')]===_0x746a('0x1d');var _0x48d669=_0x2dbe0e[_0x746a('0x1f')];var _0x26c408=_0x157bb7?0x0:_0x1c3866[_0x746a('0x1c')];var _0x429e4a=_0x157bb7?_0x2dbe0e[_0x746a('0x1f')]:_0x1c3866[_0x746a('0x1c')]+_0x1c3866['limit'];var _0x2e2043;if(_0x429e4a>=_0x48d669){_0x429e4a=_0x48d669;_0x2e2043=0xc8;}else{_0x2e2043=0xce;}_0x2dfc53[_0x746a('0x19')](_0x2e2043);return _0x2dfc53[_0x746a('0x20')](_0x746a('0x21'),_0x26c408+'-'+_0x429e4a+'/'+_0x48d669)[_0x746a('0x1b')](_0x2dbe0e);}return null;};}function patchUpdates(_0x4234b4){return function(_0x2e9458){try{jsonpatch[_0x746a('0x22')](_0x2e9458,_0x4234b4,!![]);}catch(_0x461e52){return BPromise['reject'](_0x461e52);}return _0x2e9458['save']();};}function saveUpdates(_0x4ced34,_0x3e1ef2){return function(_0x336372){if(_0x336372){return _0x336372['update'](_0x4ced34)[_0x746a('0x23')](function(_0x2afe6c){return _0x2afe6c;});}return null;};}function removeEntity(_0x49ac0d,_0x5cf427){return function(_0x40038b){if(_0x40038b){return _0x40038b[_0x746a('0x24')]()['then'](function(){_0x49ac0d['status'](0xcc)[_0x746a('0x1a')]();});}};}function handleEntityNotFound(_0x1d7bab,_0x34defc){return function(_0x6831ac){if(!_0x6831ac){_0x1d7bab[_0x746a('0x18')](0x194);}return _0x6831ac;};}function handleError(_0x39ac89,_0x197ff3){_0x197ff3=_0x197ff3||0x1f4;return function(_0x5b4d45){logger[_0x746a('0x25')](_0x5b4d45['stack']);if(_0x5b4d45[_0x746a('0x26')]){delete _0x5b4d45['name'];}_0x39ac89[_0x746a('0x19')](_0x197ff3)[_0x746a('0x27')](_0x5b4d45);};}exports['index']=function(_0x30937f,_0x302b5f){var _0x573685={},_0x2f9dd4={},_0x19fd7d={'count':0x0,'rows':[]};var _0x2fe244=_[_0x746a('0x28')](db[_0x746a('0x29')][_0x746a('0x2a')],function(_0x3adb75){return{'name':_0x3adb75[_0x746a('0x2b')],'type':_0x3adb75[_0x746a('0x2c')][_0x746a('0x2d')]};});_0x2f9dd4['model']=_[_0x746a('0x28')](_0x2fe244,'name');_0x2f9dd4['query']=_[_0x746a('0x2e')](_0x30937f[_0x746a('0x2f')]);_0x2f9dd4['filters']=_[_0x746a('0x30')](_0x2f9dd4[_0x746a('0x31')],_0x2f9dd4['query']);_0x573685[_0x746a('0x32')]=_[_0x746a('0x30')](_0x2f9dd4['model'],qs[_0x746a('0x33')](_0x30937f[_0x746a('0x2f')][_0x746a('0x33')]));_0x573685[_0x746a('0x32')]=_0x573685[_0x746a('0x32')][_0x746a('0x34')]?_0x573685[_0x746a('0x32')]:_0x2f9dd4[_0x746a('0x31')];if(!_0x30937f[_0x746a('0x2f')][_0x746a('0x35')](_0x746a('0x36'))){_0x573685[_0x746a('0x1e')]=qs[_0x746a('0x1e')](_0x30937f[_0x746a('0x2f')]['limit']);_0x573685[_0x746a('0x1c')]=qs[_0x746a('0x1c')](_0x30937f['query'][_0x746a('0x1c')]);}_0x573685['order']=qs[_0x746a('0x37')](_0x30937f[_0x746a('0x2f')][_0x746a('0x37')]);_0x573685[_0x746a('0x38')]=qs['filters'](_[_0x746a('0x39')](_0x30937f[_0x746a('0x2f')],_0x2f9dd4[_0x746a('0x3a')]),_0x2fe244);if(_0x30937f['query'][_0x746a('0x3b')]){_0x573685[_0x746a('0x38')]=_[_0x746a('0x3c')](_0x573685[_0x746a('0x38')],{'$or':_['map'](_0x2fe244,function(_0x19d856){if(_0x19d856[_0x746a('0x2c')]!==_0x746a('0x3d')){var _0x5a3bdd={};_0x5a3bdd[_0x19d856['name']]={'$like':'%'+_0x30937f[_0x746a('0x2f')][_0x746a('0x3b')]+'%'};return _0x5a3bdd;}})});}_0x573685=_['merge']({},_0x573685,_0x30937f[_0x746a('0x3e')]);var _0x398268={'where':_0x573685['where']};return db[_0x746a('0x29')][_0x746a('0x1f')](_0x398268)['then'](function(_0x14ac58){_0x19fd7d[_0x746a('0x1f')]=_0x14ac58;if(_0x30937f[_0x746a('0x2f')]['includeAll']){_0x573685[_0x746a('0x3f')]=[{'all':!![]}];}return db[_0x746a('0x29')][_0x746a('0x40')](_0x573685);})['then'](function(_0x3d2852){_0x19fd7d[_0x746a('0x41')]=_0x3d2852;return _0x19fd7d;})[_0x746a('0x23')](respondWithFilteredResult(_0x302b5f,_0x573685))[_0x746a('0x42')](handleError(_0x302b5f,null));};exports[_0x746a('0x43')]=function(_0x26f69c,_0x5e017d){var _0x4ec1c9={'raw':!![],'where':{'id':_0x26f69c[_0x746a('0x44')]['id']}},_0x44be67={};_0x44be67[_0x746a('0x31')]=_[_0x746a('0x2e')](db[_0x746a('0x29')][_0x746a('0x2a')]);_0x44be67[_0x746a('0x2f')]=_[_0x746a('0x2e')](_0x26f69c[_0x746a('0x2f')]);_0x44be67[_0x746a('0x3a')]=_['intersection'](_0x44be67[_0x746a('0x31')],_0x44be67['query']);_0x4ec1c9[_0x746a('0x32')]=_[_0x746a('0x30')](_0x44be67['model'],qs[_0x746a('0x33')](_0x26f69c[_0x746a('0x2f')][_0x746a('0x33')]));_0x4ec1c9['attributes']=_0x4ec1c9[_0x746a('0x32')][_0x746a('0x34')]?_0x4ec1c9[_0x746a('0x32')]:_0x44be67[_0x746a('0x31')];if(_0x26f69c['query'][_0x746a('0x45')]){_0x4ec1c9[_0x746a('0x3f')]=[{'all':!![]}];}_0x4ec1c9=_[_0x746a('0x3c')]({},_0x4ec1c9,_0x26f69c[_0x746a('0x3e')]);return db['JscriptySessionReport'][_0x746a('0x46')](_0x4ec1c9)[_0x746a('0x23')](handleEntityNotFound(_0x5e017d,null))[_0x746a('0x23')](respondWithResult(_0x5e017d,null))['catch'](handleError(_0x5e017d,null));};exports[_0x746a('0x47')]=function(_0x184254,_0x19862d){return db[_0x746a('0x29')][_0x746a('0x47')](_0x184254[_0x746a('0x48')],{})[_0x746a('0x23')](respondWithResult(_0x19862d,0xc9))[_0x746a('0x42')](handleError(_0x19862d,null));};exports[_0x746a('0x49')]=function(_0xf4ec92,_0x31ee2d){if(_0xf4ec92[_0x746a('0x48')]['id']){delete _0xf4ec92[_0x746a('0x48')]['id'];}return db[_0x746a('0x29')]['find']({'where':{'id':_0xf4ec92[_0x746a('0x44')]['id']}})[_0x746a('0x23')](handleEntityNotFound(_0x31ee2d,null))[_0x746a('0x23')](saveUpdates(_0xf4ec92[_0x746a('0x48')],null))[_0x746a('0x23')](respondWithResult(_0x31ee2d,null))[_0x746a('0x42')](handleError(_0x31ee2d,null));};exports[_0x746a('0x24')]=function(_0x36dc17,_0x5db73e){return db[_0x746a('0x29')][_0x746a('0x46')]({'where':{'id':_0x36dc17[_0x746a('0x44')]['id']}})[_0x746a('0x23')](handleEntityNotFound(_0x5db73e,null))[_0x746a('0x23')](removeEntity(_0x5db73e,null))[_0x746a('0x42')](handleError(_0x5db73e,null));};exports[_0x746a('0x4a')]=function(_0xdca18,_0x3b6f1b){return db[_0x746a('0x29')][_0x746a('0x4a')]()['then'](respondWithResult(_0x3b6f1b,null))['catch'](handleError(_0x3b6f1b,null));};exports['getQuestions']=function(_0x599d84,_0x1d0d83,_0x3e277e){var _0x452ed7={'raw':!![],'where':{}};var _0x321244={};var _0x241f40={'count':0x0,'rows':[]};return db[_0x746a('0x29')][_0x746a('0x4b')]({'where':{'id':_0x599d84[_0x746a('0x44')]['id']}})[_0x746a('0x23')](handleEntityNotFound(_0x1d0d83,null))[_0x746a('0x23')](function(_0x5f2bcb){if(_0x5f2bcb){_0x321244[_0x746a('0x31')]=_[_0x746a('0x2e')](db[_0x746a('0x4c')][_0x746a('0x2a')]);_0x321244[_0x746a('0x2f')]=_[_0x746a('0x2e')](_0x599d84[_0x746a('0x2f')]);_0x321244['filters']=_[_0x746a('0x30')](_0x321244[_0x746a('0x31')],_0x321244[_0x746a('0x2f')]);_0x452ed7['attributes']=_[_0x746a('0x30')](_0x321244[_0x746a('0x31')],qs[_0x746a('0x33')](_0x599d84['query']['fields']));_0x452ed7[_0x746a('0x32')]=_0x452ed7['attributes'][_0x746a('0x34')]?_0x452ed7[_0x746a('0x32')]:_0x321244[_0x746a('0x31')];if(!_0x599d84[_0x746a('0x2f')][_0x746a('0x35')]('nolimit')){_0x452ed7[_0x746a('0x1e')]=qs[_0x746a('0x1e')](_0x599d84[_0x746a('0x2f')][_0x746a('0x1e')]);_0x452ed7[_0x746a('0x1c')]=qs[_0x746a('0x1c')](_0x599d84['query'][_0x746a('0x1c')]);}_0x452ed7[_0x746a('0x4d')]=qs[_0x746a('0x37')](_0x599d84['query'][_0x746a('0x37')]);_0x452ed7['where']=qs['filters'](_[_0x746a('0x39')](_0x599d84[_0x746a('0x2f')],_0x321244[_0x746a('0x3a')]));_0x452ed7[_0x746a('0x38')][_0x746a('0x4e')]=_0x5f2bcb['id'];if(_0x599d84['query'][_0x746a('0x3b')]){_0x452ed7[_0x746a('0x38')]=_[_0x746a('0x3c')](_0x452ed7['where'],{'$or':_[_0x746a('0x28')](_0x452ed7[_0x746a('0x32')],function(_0x12cf8e){var _0x5ebfa6={};_0x5ebfa6[_0x12cf8e]={'$like':'%'+_0x599d84[_0x746a('0x2f')]['filter']+'%'};return _0x5ebfa6;})});}_0x452ed7=_[_0x746a('0x3c')]({},_0x452ed7,_0x599d84[_0x746a('0x3e')]);return db['JscriptyQuestionReport'][_0x746a('0x1f')]({'where':_0x452ed7[_0x746a('0x38')]})['then'](function(_0x25da23){_0x241f40[_0x746a('0x1f')]=_0x25da23;if(_0x599d84[_0x746a('0x2f')]['includeAll']){_0x452ed7[_0x746a('0x3f')]=[{'all':!![]}];}return db[_0x746a('0x4c')][_0x746a('0x40')](_0x452ed7);})[_0x746a('0x23')](function(_0x228c4d){_0x241f40['rows']=_0x228c4d;return _0x241f40;});}})[_0x746a('0x23')](respondWithFilteredResult(_0x1d0d83,_0x452ed7))[_0x746a('0x42')](handleError(_0x1d0d83,null));}; \ No newline at end of file +var _0xd414=['where','pick','filter','merge','type','options','count','rows','catch','show','params','fields','includeAll','include','find','create','body','describe','getQuestions','findOne','keys','JscriptyQuestionReport','length','nolimit','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','undefined','offset','set','json','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','key','model','query','filters','intersection','attributes','hasOwnProperty','limit','order','sort'];(function(_0xb18500,_0xfdb750){var _0x5310d7=function(_0x1a8286){while(--_0x1a8286){_0xb18500['push'](_0xb18500['shift']());}};_0x5310d7(++_0xfdb750);}(_0xd414,0x19f));var _0x4d41=function(_0x48c282,_0x336df9){_0x48c282=_0x48c282-0x0;var _0x5c9e74=_0xd414[_0x48c282];return _0x5c9e74;};'use strict';var emlformat=require(_0x4d41('0x0'));var rimraf=require(_0x4d41('0x1'));var zipdir=require(_0x4d41('0x2'));var jsonpatch=require(_0x4d41('0x3'));var rp=require(_0x4d41('0x4'));var moment=require('moment');var BPromise=require(_0x4d41('0x5'));var Mustache=require(_0x4d41('0x6'));var util=require(_0x4d41('0x7'));var path=require(_0x4d41('0x8'));var sox=require(_0x4d41('0x9'));var csv=require(_0x4d41('0xa'));var ejs=require(_0x4d41('0xb'));var fs=require('fs');var fs_extra=require(_0x4d41('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4d41('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4d41('0xe'));var toCsv=require(_0x4d41('0xa'));var querystring=require(_0x4d41('0xf'));var Papa=require(_0x4d41('0x10'));var Redis=require(_0x4d41('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d41('0x12'));var logger=require(_0x4d41('0x13'))(_0x4d41('0x14'));var utils=require(_0x4d41('0x15'));var config=require(_0x4d41('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x261c93,_0x3b3fed){_0x3b3fed=_0x3b3fed||0xcc;return function(_0x29493c){if(_0x29493c){return _0x261c93['sendStatus'](_0x3b3fed);}return _0x261c93['status'](_0x3b3fed)['end']();};}function respondWithResult(_0x259cab,_0x5cc078){_0x5cc078=_0x5cc078||0xc8;return function(_0x171cff){if(_0x171cff){return _0x259cab[_0x4d41('0x17')](_0x5cc078)['json'](_0x171cff);}};}function respondWithFilteredResult(_0x2ba2a5,_0x15d41c){return function(_0x86294b){if(_0x86294b){var _0x331e13=typeof _0x15d41c['offset']===_0x4d41('0x18')&&typeof _0x15d41c['limit']===_0x4d41('0x18');var _0x1beda6=_0x86294b['count'];var _0x24e928=_0x331e13?0x0:_0x15d41c[_0x4d41('0x19')];var _0x2a00d1=_0x331e13?_0x86294b['count']:_0x15d41c[_0x4d41('0x19')]+_0x15d41c['limit'];var _0x5babda;if(_0x2a00d1>=_0x1beda6){_0x2a00d1=_0x1beda6;_0x5babda=0xc8;}else{_0x5babda=0xce;}_0x2ba2a5[_0x4d41('0x17')](_0x5babda);return _0x2ba2a5[_0x4d41('0x1a')]('Content-Range',_0x24e928+'-'+_0x2a00d1+'/'+_0x1beda6)[_0x4d41('0x1b')](_0x86294b);}return null;};}function patchUpdates(_0x706c5e){return function(_0x36c9c3){try{jsonpatch[_0x4d41('0x1c')](_0x36c9c3,_0x706c5e,!![]);}catch(_0x27b772){return BPromise[_0x4d41('0x1d')](_0x27b772);}return _0x36c9c3[_0x4d41('0x1e')]();};}function saveUpdates(_0x96c5ca,_0x271697){return function(_0xa4fe8b){if(_0xa4fe8b){return _0xa4fe8b['update'](_0x96c5ca)[_0x4d41('0x1f')](function(_0x4b03ad){return _0x4b03ad;});}return null;};}function removeEntity(_0x28596f,_0x502e12){return function(_0x403265){if(_0x403265){return _0x403265[_0x4d41('0x20')]()[_0x4d41('0x1f')](function(){_0x28596f[_0x4d41('0x17')](0xcc)[_0x4d41('0x21')]();});}};}function handleEntityNotFound(_0x1da90d,_0x4d3d1d){return function(_0x1d2cb7){if(!_0x1d2cb7){_0x1da90d[_0x4d41('0x22')](0x194);}return _0x1d2cb7;};}function handleError(_0x3dee85,_0x103a40){_0x103a40=_0x103a40||0x1f4;return function(_0x1a7942){logger[_0x4d41('0x23')](_0x1a7942[_0x4d41('0x24')]);if(_0x1a7942[_0x4d41('0x25')]){delete _0x1a7942[_0x4d41('0x25')];}_0x3dee85[_0x4d41('0x17')](_0x103a40)[_0x4d41('0x26')](_0x1a7942);};}exports[_0x4d41('0x27')]=function(_0x3846d8,_0x5906c9){var _0x20b1ee={},_0x2920fb={},_0x4fc45b={'count':0x0,'rows':[]};var _0x6bbc1=_[_0x4d41('0x28')](db[_0x4d41('0x29')][_0x4d41('0x2a')],function(_0x3eac69){return{'name':_0x3eac69['fieldName'],'type':_0x3eac69['type'][_0x4d41('0x2b')]};});_0x2920fb[_0x4d41('0x2c')]=_[_0x4d41('0x28')](_0x6bbc1,_0x4d41('0x25'));_0x2920fb[_0x4d41('0x2d')]=_['keys'](_0x3846d8[_0x4d41('0x2d')]);_0x2920fb[_0x4d41('0x2e')]=_['intersection'](_0x2920fb[_0x4d41('0x2c')],_0x2920fb[_0x4d41('0x2d')]);_0x20b1ee['attributes']=_[_0x4d41('0x2f')](_0x2920fb['model'],qs['fields'](_0x3846d8['query']['fields']));_0x20b1ee['attributes']=_0x20b1ee[_0x4d41('0x30')]['length']?_0x20b1ee['attributes']:_0x2920fb['model'];if(!_0x3846d8[_0x4d41('0x2d')][_0x4d41('0x31')]('nolimit')){_0x20b1ee[_0x4d41('0x32')]=qs[_0x4d41('0x32')](_0x3846d8[_0x4d41('0x2d')][_0x4d41('0x32')]);_0x20b1ee[_0x4d41('0x19')]=qs[_0x4d41('0x19')](_0x3846d8[_0x4d41('0x2d')][_0x4d41('0x19')]);}_0x20b1ee[_0x4d41('0x33')]=qs[_0x4d41('0x34')](_0x3846d8['query'][_0x4d41('0x34')]);_0x20b1ee[_0x4d41('0x35')]=qs[_0x4d41('0x2e')](_[_0x4d41('0x36')](_0x3846d8['query'],_0x2920fb[_0x4d41('0x2e')]),_0x6bbc1);if(_0x3846d8[_0x4d41('0x2d')][_0x4d41('0x37')]){_0x20b1ee[_0x4d41('0x35')]=_[_0x4d41('0x38')](_0x20b1ee[_0x4d41('0x35')],{'$or':_[_0x4d41('0x28')](_0x6bbc1,function(_0x22382c){if(_0x22382c[_0x4d41('0x39')]!=='VIRTUAL'){var _0x1e34bc={};_0x1e34bc[_0x22382c[_0x4d41('0x25')]]={'$like':'%'+_0x3846d8[_0x4d41('0x2d')]['filter']+'%'};return _0x1e34bc;}})});}_0x20b1ee=_[_0x4d41('0x38')]({},_0x20b1ee,_0x3846d8[_0x4d41('0x3a')]);var _0x5106ba={'where':_0x20b1ee[_0x4d41('0x35')]};return db[_0x4d41('0x29')][_0x4d41('0x3b')](_0x5106ba)[_0x4d41('0x1f')](function(_0x474499){_0x4fc45b['count']=_0x474499;if(_0x3846d8[_0x4d41('0x2d')]['includeAll']){_0x20b1ee['include']=[{'all':!![]}];}return db[_0x4d41('0x29')]['findAll'](_0x20b1ee);})['then'](function(_0x49eb55){_0x4fc45b[_0x4d41('0x3c')]=_0x49eb55;return _0x4fc45b;})[_0x4d41('0x1f')](respondWithFilteredResult(_0x5906c9,_0x20b1ee))[_0x4d41('0x3d')](handleError(_0x5906c9,null));};exports[_0x4d41('0x3e')]=function(_0xf87ddd,_0x44dfef){var _0x115cd1={'raw':!![],'where':{'id':_0xf87ddd[_0x4d41('0x3f')]['id']}},_0x4b7166={};_0x4b7166['model']=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x4b7166[_0x4d41('0x2d')]=_['keys'](_0xf87ddd[_0x4d41('0x2d')]);_0x4b7166[_0x4d41('0x2e')]=_[_0x4d41('0x2f')](_0x4b7166[_0x4d41('0x2c')],_0x4b7166[_0x4d41('0x2d')]);_0x115cd1['attributes']=_[_0x4d41('0x2f')](_0x4b7166[_0x4d41('0x2c')],qs[_0x4d41('0x40')](_0xf87ddd['query']['fields']));_0x115cd1[_0x4d41('0x30')]=_0x115cd1[_0x4d41('0x30')]['length']?_0x115cd1[_0x4d41('0x30')]:_0x4b7166[_0x4d41('0x2c')];if(_0xf87ddd[_0x4d41('0x2d')][_0x4d41('0x41')]){_0x115cd1[_0x4d41('0x42')]=[{'all':!![]}];}_0x115cd1=_[_0x4d41('0x38')]({},_0x115cd1,_0xf87ddd[_0x4d41('0x3a')]);return db[_0x4d41('0x29')][_0x4d41('0x43')](_0x115cd1)[_0x4d41('0x1f')](handleEntityNotFound(_0x44dfef,null))[_0x4d41('0x1f')](respondWithResult(_0x44dfef,null))[_0x4d41('0x3d')](handleError(_0x44dfef,null));};exports[_0x4d41('0x44')]=function(_0x524fc1,_0x3ae0c1){return db[_0x4d41('0x29')]['create'](_0x524fc1['body'],{})[_0x4d41('0x1f')](respondWithResult(_0x3ae0c1,0xc9))[_0x4d41('0x3d')](handleError(_0x3ae0c1,null));};exports['update']=function(_0x55f40f,_0x3bcaf7){if(_0x55f40f[_0x4d41('0x45')]['id']){delete _0x55f40f[_0x4d41('0x45')]['id'];}return db[_0x4d41('0x29')][_0x4d41('0x43')]({'where':{'id':_0x55f40f[_0x4d41('0x3f')]['id']}})[_0x4d41('0x1f')](handleEntityNotFound(_0x3bcaf7,null))['then'](saveUpdates(_0x55f40f[_0x4d41('0x45')],null))[_0x4d41('0x1f')](respondWithResult(_0x3bcaf7,null))[_0x4d41('0x3d')](handleError(_0x3bcaf7,null));};exports['destroy']=function(_0x2075e4,_0x3bff26){return db[_0x4d41('0x29')]['find']({'where':{'id':_0x2075e4[_0x4d41('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3bff26,null))[_0x4d41('0x1f')](removeEntity(_0x3bff26,null))[_0x4d41('0x3d')](handleError(_0x3bff26,null));};exports[_0x4d41('0x46')]=function(_0x38700a,_0x1f85c0){return db[_0x4d41('0x29')][_0x4d41('0x46')]()[_0x4d41('0x1f')](respondWithResult(_0x1f85c0,null))[_0x4d41('0x3d')](handleError(_0x1f85c0,null));};exports[_0x4d41('0x47')]=function(_0x3571df,_0x19c5e7,_0x2b3549){var _0x5918da={'raw':!![],'where':{}};var _0x2ee6d0={};var _0x4f5d0e={'count':0x0,'rows':[]};return db[_0x4d41('0x29')][_0x4d41('0x48')]({'where':{'id':_0x3571df[_0x4d41('0x3f')]['id']}})[_0x4d41('0x1f')](handleEntityNotFound(_0x19c5e7,null))['then'](function(_0x13fce6){if(_0x13fce6){_0x2ee6d0[_0x4d41('0x2c')]=_[_0x4d41('0x49')](db[_0x4d41('0x4a')][_0x4d41('0x2a')]);_0x2ee6d0[_0x4d41('0x2d')]=_['keys'](_0x3571df[_0x4d41('0x2d')]);_0x2ee6d0[_0x4d41('0x2e')]=_[_0x4d41('0x2f')](_0x2ee6d0[_0x4d41('0x2c')],_0x2ee6d0['query']);_0x5918da[_0x4d41('0x30')]=_[_0x4d41('0x2f')](_0x2ee6d0[_0x4d41('0x2c')],qs[_0x4d41('0x40')](_0x3571df[_0x4d41('0x2d')][_0x4d41('0x40')]));_0x5918da['attributes']=_0x5918da[_0x4d41('0x30')][_0x4d41('0x4b')]?_0x5918da[_0x4d41('0x30')]:_0x2ee6d0[_0x4d41('0x2c')];if(!_0x3571df[_0x4d41('0x2d')][_0x4d41('0x31')](_0x4d41('0x4c'))){_0x5918da[_0x4d41('0x32')]=qs[_0x4d41('0x32')](_0x3571df['query']['limit']);_0x5918da[_0x4d41('0x19')]=qs[_0x4d41('0x19')](_0x3571df['query'][_0x4d41('0x19')]);}_0x5918da[_0x4d41('0x33')]=qs[_0x4d41('0x34')](_0x3571df['query'][_0x4d41('0x34')]);_0x5918da[_0x4d41('0x35')]=qs[_0x4d41('0x2e')](_[_0x4d41('0x36')](_0x3571df['query'],_0x2ee6d0[_0x4d41('0x2e')]));_0x5918da[_0x4d41('0x35')][_0x4d41('0x4d')]=_0x13fce6['id'];if(_0x3571df[_0x4d41('0x2d')][_0x4d41('0x37')]){_0x5918da[_0x4d41('0x35')]=_[_0x4d41('0x38')](_0x5918da[_0x4d41('0x35')],{'$or':_[_0x4d41('0x28')](_0x5918da[_0x4d41('0x30')],function(_0x246cf2){var _0x166680={};_0x166680[_0x246cf2]={'$like':'%'+_0x3571df[_0x4d41('0x2d')][_0x4d41('0x37')]+'%'};return _0x166680;})});}_0x5918da=_[_0x4d41('0x38')]({},_0x5918da,_0x3571df[_0x4d41('0x3a')]);return db[_0x4d41('0x4a')][_0x4d41('0x3b')]({'where':_0x5918da[_0x4d41('0x35')]})[_0x4d41('0x1f')](function(_0x1d803c){_0x4f5d0e[_0x4d41('0x3b')]=_0x1d803c;if(_0x3571df[_0x4d41('0x2d')][_0x4d41('0x41')]){_0x5918da['include']=[{'all':!![]}];}return db[_0x4d41('0x4a')]['findAll'](_0x5918da);})[_0x4d41('0x1f')](function(_0x532f88){_0x4f5d0e[_0x4d41('0x3c')]=_0x532f88;return _0x4f5d0e;});}})[_0x4d41('0x1f')](respondWithFilteredResult(_0x19c5e7,_0x5918da))[_0x4d41('0x3d')](handleError(_0x19c5e7,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 9fbd475..3a7b883 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 _0x25fa=['path','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2f0769,_0x2106db){var _0x2f6c26=function(_0x365ccc){while(--_0x365ccc){_0x2f0769['push'](_0x2f0769['shift']());}};_0x2f6c26(++_0x2106db);}(_0x25fa,0x109));var _0xa25f=function(_0x38b697,_0x4d9fa8){_0x38b697=_0x38b697-0x0;var _0x54e3ba=_0x25fa[_0x38b697];return _0x54e3ba;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require('moment');var BPromise=require(_0xa25f('0x3'));var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa25f('0x6'));module['exports']=function(_0x2ea9ea,_0x3ab530){return _0x2ea9ea[_0xa25f('0x7')](_0xa25f('0x8'),attributes,{'tableName':_0xa25f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x38a782,_0x6f162b){var _0x31cbec=function(_0x486371){while(--_0x486371){_0x38a782['push'](_0x38a782['shift']());}};_0x31cbec(++_0x6f162b);}(_0x6050,0x196));var _0x0605=function(_0x329acb,_0x331f05){_0x329acb=_0x329acb-0x0;var _0xab2021=_0x6050[_0x329acb];return _0xab2021;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','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 1b2bbda..0f171d5 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 _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xacf4,0xe7));var _0x4acf=function(_0x5144e6,_0x561398){_0x5144e6=_0x5144e6-0x0;var _0x5c1472=_0xacf4[_0x5144e6];return _0x5c1472;};'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 _0x323f=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x15e4bc,_0x18419d){var _0x44c04b=function(_0x223810){while(--_0x223810){_0x15e4bc['push'](_0x15e4bc['shift']());}};_0x44c04b(++_0x18419d);}(_0x323f,0x1ee));var _0xf323=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x323f[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 822c25a..eacdfb7 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 _0xb269=['/:id','isAuthenticated','update','get','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','put'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0xb269,0xcd));var _0x9b26=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb269[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x9b26('0x0'));var path=require(_0x9b26('0x1'));var timeout=require(_0x9b26('0x2'));var express=require(_0x9b26('0x3'));var router=express[_0x9b26('0x4')]();var fs_extra=require(_0x9b26('0x5'));var auth=require(_0x9b26('0x6'));var interaction=require(_0x9b26('0x7'));var config=require(_0x9b26('0x8'));var controller=require(_0x9b26('0x9'));router['get']('/',controller['index']);router[_0x9b26('0xa')](_0x9b26('0xb'),auth[_0x9b26('0xc')](),controller[_0x9b26('0xd')]);router[_0x9b26('0xe')](_0x9b26('0xf'),auth['isAuthenticated'](),controller[_0x9b26('0x10')]);module[_0x9b26('0x11')]=router; \ No newline at end of file +var _0x65a9=['index','/:id','isAuthenticated','update','get','/download_log_file','downloadLogFile','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x5a6ed0,_0x538cda){var _0x47cc20=function(_0x316e56){while(--_0x316e56){_0x5a6ed0['push'](_0x5a6ed0['shift']());}};_0x47cc20(++_0x538cda);}(_0x65a9,0x98));var _0x965a=function(_0x155311,_0xd14eea){_0x155311=_0x155311-0x0;var _0x2dd4a9=_0x65a9[_0x155311];return _0x2dd4a9;};'use strict';var multer=require(_0x965a('0x0'));var util=require('util');var path=require(_0x965a('0x1'));var timeout=require(_0x965a('0x2'));var express=require(_0x965a('0x3'));var router=express[_0x965a('0x4')]();var fs_extra=require(_0x965a('0x5'));var auth=require(_0x965a('0x6'));var interaction=require(_0x965a('0x7'));var config=require(_0x965a('0x8'));var controller=require(_0x965a('0x9'));router['get']('/',controller[_0x965a('0xa')]);router['put'](_0x965a('0xb'),auth[_0x965a('0xc')](),controller[_0x965a('0xd')]);router[_0x965a('0xe')](_0x965a('0xf'),auth[_0x965a('0xc')](),controller[_0x965a('0x10')]);module[_0x965a('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index caccc0b..4b68199 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 _0x345a=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0x345a,0x9e));var _0xa345=function(_0x9ab2ee,_0x43bafe){_0x9ab2ee=_0x9ab2ee-0x0;var _0x47c0f3=_0x345a[_0x9ab2ee];return _0x47c0f3;};'use strict';var Sequelize=require(_0xa345('0x0'));module[_0xa345('0x1')]={'license':{'type':Sequelize[_0xa345('0x2')]},'data1':{'type':Sequelize[_0xa345('0x3')]},'data2':{'type':Sequelize[_0xa345('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xa345('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa072=['exports','TEXT','STRING','INTEGER'];(function(_0x53c2b9,_0x1dbc82){var _0x2c677b=function(_0x3a7310){while(--_0x3a7310){_0x53c2b9['push'](_0x53c2b9['shift']());}};_0x2c677b(++_0x1dbc82);}(_0xa072,0x15c));var _0x2a07=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0xa072[_0x3b594b];return _0x1ea5f8;};'use strict';var Sequelize=require('sequelize');module[_0x2a07('0x0')]={'license':{'type':Sequelize[_0x2a07('0x1')]},'data1':{'type':Sequelize[_0x2a07('0x2')]},'data2':{'type':Sequelize[_0x2a07('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x2a07('0x3')],'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 2508423..e870906 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 _0x67dc=['intersection','attributes','fields','length','merge','getLicense','then','catch','body','find','params','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','xcally','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters'];(function(_0x39d8fe,_0xae071e){var _0x4b52a6=function(_0xa91476){while(--_0xa91476){_0x39d8fe['push'](_0x39d8fe['shift']());}};_0x4b52a6(++_0xae071e);}(_0x67dc,0xf0));var _0xc67d=function(_0x2e655a,_0x6d5799){_0x2e655a=_0x2e655a-0x0;var _0x26f13b=_0x67dc[_0x2e655a];return _0x26f13b;};'use strict';var emlformat=require(_0xc67d('0x0'));var rimraf=require(_0xc67d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc67d('0x2'));var BPromise=require(_0xc67d('0x3'));var Mustache=require('mustache');var util=require(_0xc67d('0x4'));var path=require(_0xc67d('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc67d('0x6'));var fs=require('fs');var fs_extra=require(_0xc67d('0x7'));var _=require(_0xc67d('0x8'));var squel=require(_0xc67d('0x9'));var crypto=require(_0xc67d('0xa'));var jsforce=require(_0xc67d('0xb'));var deskjs=require(_0xc67d('0xc'));var toCsv=require(_0xc67d('0xd'));var querystring=require(_0xc67d('0xe'));var Papa=require(_0xc67d('0xf'));var Redis=require(_0xc67d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc67d('0x11'));var as=require(_0xc67d('0x12'));var hardwareService=require(_0xc67d('0x13'));var logger=require(_0xc67d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc67d('0x15'));var licenseUtil=require(_0xc67d('0x16'));var db=require(_0xc67d('0x17'))['db'];function respondWithStatusCode(_0x5b9e14,_0x575eaa){_0x575eaa=_0x575eaa||0xcc;return function(_0x2bca27){if(_0x2bca27){return _0x5b9e14[_0xc67d('0x18')](_0x575eaa);}return _0x5b9e14[_0xc67d('0x19')](_0x575eaa)['end']();};}function respondWithResult(_0x5285ea,_0xf221bc){_0xf221bc=_0xf221bc||0xc8;return function(_0x16e7a7){if(_0x16e7a7){return _0x5285ea[_0xc67d('0x19')](_0xf221bc)[_0xc67d('0x1a')](_0x16e7a7);}};}function respondWithFilteredResult(_0x41f497,_0x3f8d16){return function(_0x4af1aa){if(_0x4af1aa){var _0xe8dd95=typeof _0x3f8d16[_0xc67d('0x1b')]===_0xc67d('0x1c')&&typeof _0x3f8d16[_0xc67d('0x1d')]===_0xc67d('0x1c');var _0x3b1d25=_0x4af1aa['count'];var _0x57789b=_0xe8dd95?0x0:_0x3f8d16[_0xc67d('0x1b')];var _0x3e6cc3=_0xe8dd95?_0x4af1aa[_0xc67d('0x1e')]:_0x3f8d16[_0xc67d('0x1b')]+_0x3f8d16[_0xc67d('0x1d')];var _0x3480b0;if(_0x3e6cc3>=_0x3b1d25){_0x3e6cc3=_0x3b1d25;_0x3480b0=0xc8;}else{_0x3480b0=0xce;}_0x41f497['status'](_0x3480b0);return _0x41f497[_0xc67d('0x1f')](_0xc67d('0x20'),_0x57789b+'-'+_0x3e6cc3+'/'+_0x3b1d25)['json'](_0x4af1aa);}return null;};}function patchUpdates(_0x25a8be){return function(_0x1acb6f){try{jsonpatch[_0xc67d('0x21')](_0x1acb6f,_0x25a8be,!![]);}catch(_0x45891d){return BPromise['reject'](_0x45891d);}return _0x1acb6f[_0xc67d('0x22')]();};}function saveUpdates(_0x1d3816,_0x39c54c){return function(_0x39fc1f){if(_0x39fc1f){return _0x39fc1f[_0xc67d('0x23')](_0x1d3816)['then'](function(_0x4c92c1){return _0x4c92c1;});}return null;};}function removeEntity(_0x283f66,_0x493972){return function(_0x427bc8){if(_0x427bc8){return _0x427bc8[_0xc67d('0x24')]()['then'](function(){_0x283f66[_0xc67d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fdadb,_0x2dbc33){return function(_0x322a93){if(!_0x322a93){_0x1fdadb[_0xc67d('0x18')](0x194);}return _0x322a93;};}function handleError(_0x5753da,_0x259a59){_0x259a59=_0x259a59||0x1f4;return function(_0x15601c){logger[_0xc67d('0x25')](_0x15601c[_0xc67d('0x26')]);if(_0x15601c[_0xc67d('0x27')]){delete _0x15601c[_0xc67d('0x27')];}_0x5753da[_0xc67d('0x19')](_0x259a59)[_0xc67d('0x28')](_0x15601c);};}var utilLicense=require(_0xc67d('0x16'));exports[_0xc67d('0x29')]=function(_0x311ba7,_0x2e97c3){var _0x23fd01={'raw':!![],'where':{'id':0x1}},_0x5837ec={};_0x5837ec[_0xc67d('0x2a')]=_[_0xc67d('0x2b')](db[_0xc67d('0x2c')][_0xc67d('0x2d')]);_0x5837ec[_0xc67d('0x2e')]=_['keys'](_0x311ba7[_0xc67d('0x2e')]);_0x5837ec[_0xc67d('0x2f')]=_[_0xc67d('0x30')](_0x5837ec['model'],_0x5837ec['query']);_0x23fd01[_0xc67d('0x31')]=_[_0xc67d('0x30')](_0x5837ec[_0xc67d('0x2a')],qs[_0xc67d('0x32')](_0x311ba7[_0xc67d('0x2e')][_0xc67d('0x32')]));_0x23fd01[_0xc67d('0x31')]=_0x23fd01[_0xc67d('0x31')][_0xc67d('0x33')]?_0x23fd01[_0xc67d('0x31')]:_0x5837ec['model'];_0x23fd01=_[_0xc67d('0x34')]({},_0x23fd01,_0x311ba7['options']);return utilLicense[_0xc67d('0x35')](_0x23fd01)[_0xc67d('0x36')](respondWithResult(_0x2e97c3,null))[_0xc67d('0x37')](handleError(_0x2e97c3,null));};exports[_0xc67d('0x23')]=function(_0xe6cc21,_0x4fa1d2){if(_0xe6cc21['body']['id']){delete _0xe6cc21[_0xc67d('0x38')]['id'];}return db[_0xc67d('0x2c')][_0xc67d('0x39')]({'where':{'id':_0xe6cc21[_0xc67d('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4fa1d2,null))['then'](function(_0x911639){var _0x25fcfd=_0x911639[_0xc67d('0x3b')]({'plain':!![]});return utilLicense[_0xc67d('0x3c')](_0x25fcfd,_0xe6cc21[_0xc67d('0x38')][_0xc67d('0x3d')]);})['then'](function(_0x400718){if(!_0x400718['demo']){return saveUpdates(_0xe6cc21[_0xc67d('0x38')],null);}return _0x400718;})['then'](respondWithResult(_0x4fa1d2,null))['catch'](handleError(_0x4fa1d2,null));};exports[_0xc67d('0x3e')]=function(_0x110843,_0x1cd7cb){var _0x19cc44=_0xc67d('0x3f');var _0x3d7c0a=path[_0xc67d('0x40')](_0xc67d('0x41'),'log',_0xc67d('0x42'),_0x19cc44);_0x1cd7cb['setHeader'](_0xc67d('0x43'),_0xc67d('0x44')+_0x19cc44);_0x1cd7cb[_0xc67d('0x1f')](_0xc67d('0x45'),_0xc67d('0x46'));_0x1cd7cb[_0xc67d('0x47')](_0x3d7c0a);}; \ No newline at end of file +var _0xdff9=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','model','keys','License','rawAttributes','query','filters','attributes','intersection','length','options','getLicense','body','find','params','get','checkLicense','demo','catch','license-info.log','join','/var','log','xcally','setHeader','attachment;\x20filename=','set','Content-Type','text/plain','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xdff9,0x87));var _0x9dff=function(_0x51ff57,_0x2eb3b2){_0x51ff57=_0x51ff57-0x0;var _0x72c1b1=_0xdff9[_0x51ff57];return _0x72c1b1;};'use strict';var emlformat=require(_0x9dff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9dff('0x1'));var jsonpatch=require(_0x9dff('0x2'));var rp=require(_0x9dff('0x3'));var moment=require('moment');var BPromise=require(_0x9dff('0x4'));var Mustache=require(_0x9dff('0x5'));var util=require(_0x9dff('0x6'));var path=require(_0x9dff('0x7'));var sox=require(_0x9dff('0x8'));var csv=require('to-csv');var ejs=require(_0x9dff('0x9'));var fs=require('fs');var fs_extra=require(_0x9dff('0xa'));var _=require(_0x9dff('0xb'));var squel=require('squel');var crypto=require(_0x9dff('0xc'));var jsforce=require(_0x9dff('0xd'));var deskjs=require(_0x9dff('0xe'));var toCsv=require(_0x9dff('0xf'));var querystring=require(_0x9dff('0x10'));var Papa=require(_0x9dff('0x11'));var Redis=require(_0x9dff('0x12'));var authService=require(_0x9dff('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9dff('0x14'));var hardwareService=require(_0x9dff('0x15'));var logger=require(_0x9dff('0x16'))(_0x9dff('0x17'));var utils=require('../../config/utils');var config=require(_0x9dff('0x18'));var licenseUtil=require(_0x9dff('0x19'));var db=require(_0x9dff('0x1a'))['db'];function respondWithStatusCode(_0x459fac,_0x5ec1cd){_0x5ec1cd=_0x5ec1cd||0xcc;return function(_0x3b5843){if(_0x3b5843){return _0x459fac[_0x9dff('0x1b')](_0x5ec1cd);}return _0x459fac[_0x9dff('0x1c')](_0x5ec1cd)[_0x9dff('0x1d')]();};}function respondWithResult(_0x1722f5,_0x2a5ae9){_0x2a5ae9=_0x2a5ae9||0xc8;return function(_0x1b25f4){if(_0x1b25f4){return _0x1722f5[_0x9dff('0x1c')](_0x2a5ae9)['json'](_0x1b25f4);}};}function respondWithFilteredResult(_0x12586e,_0x785c58){return function(_0x5413d7){if(_0x5413d7){var _0x3be67f=typeof _0x785c58[_0x9dff('0x1e')]===_0x9dff('0x1f')&&typeof _0x785c58[_0x9dff('0x20')]==='undefined';var _0x585763=_0x5413d7[_0x9dff('0x21')];var _0x28f9be=_0x3be67f?0x0:_0x785c58[_0x9dff('0x1e')];var _0x3f132a=_0x3be67f?_0x5413d7[_0x9dff('0x21')]:_0x785c58[_0x9dff('0x1e')]+_0x785c58[_0x9dff('0x20')];var _0x17d7a7;if(_0x3f132a>=_0x585763){_0x3f132a=_0x585763;_0x17d7a7=0xc8;}else{_0x17d7a7=0xce;}_0x12586e[_0x9dff('0x1c')](_0x17d7a7);return _0x12586e['set'](_0x9dff('0x22'),_0x28f9be+'-'+_0x3f132a+'/'+_0x585763)[_0x9dff('0x23')](_0x5413d7);}return null;};}function patchUpdates(_0x4e65b6){return function(_0xc8b2c2){try{jsonpatch[_0x9dff('0x24')](_0xc8b2c2,_0x4e65b6,!![]);}catch(_0x10eb7f){return BPromise[_0x9dff('0x25')](_0x10eb7f);}return _0xc8b2c2[_0x9dff('0x26')]();};}function saveUpdates(_0x1b74d2,_0x265706){return function(_0x514839){if(_0x514839){return _0x514839['update'](_0x1b74d2)[_0x9dff('0x27')](function(_0x8eb603){return _0x8eb603;});}return null;};}function removeEntity(_0x10978d,_0x542b86){return function(_0xb1a201){if(_0xb1a201){return _0xb1a201[_0x9dff('0x28')]()[_0x9dff('0x27')](function(){_0x10978d['status'](0xcc)[_0x9dff('0x1d')]();});}};}function handleEntityNotFound(_0x2db0f3,_0x1e9ff4){return function(_0x1ef836){if(!_0x1ef836){_0x2db0f3[_0x9dff('0x1b')](0x194);}return _0x1ef836;};}function handleError(_0x34bac3,_0x3e2982){_0x3e2982=_0x3e2982||0x1f4;return function(_0x433261){logger[_0x9dff('0x29')](_0x433261['stack']);if(_0x433261[_0x9dff('0x2a')]){delete _0x433261[_0x9dff('0x2a')];}_0x34bac3[_0x9dff('0x1c')](_0x3e2982)[_0x9dff('0x2b')](_0x433261);};}var utilLicense=require('../../config/license/util');exports[_0x9dff('0x2c')]=function(_0x3bd8eb,_0x342088){var _0x16299f={'raw':!![],'where':{'id':0x1}},_0x32b26a={};_0x32b26a[_0x9dff('0x2d')]=_[_0x9dff('0x2e')](db[_0x9dff('0x2f')][_0x9dff('0x30')]);_0x32b26a['query']=_[_0x9dff('0x2e')](_0x3bd8eb[_0x9dff('0x31')]);_0x32b26a[_0x9dff('0x32')]=_['intersection'](_0x32b26a[_0x9dff('0x2d')],_0x32b26a[_0x9dff('0x31')]);_0x16299f[_0x9dff('0x33')]=_[_0x9dff('0x34')](_0x32b26a[_0x9dff('0x2d')],qs['fields'](_0x3bd8eb[_0x9dff('0x31')]['fields']));_0x16299f[_0x9dff('0x33')]=_0x16299f[_0x9dff('0x33')][_0x9dff('0x35')]?_0x16299f[_0x9dff('0x33')]:_0x32b26a[_0x9dff('0x2d')];_0x16299f=_['merge']({},_0x16299f,_0x3bd8eb[_0x9dff('0x36')]);return utilLicense[_0x9dff('0x37')](_0x16299f)[_0x9dff('0x27')](respondWithResult(_0x342088,null))['catch'](handleError(_0x342088,null));};exports['update']=function(_0x2688f8,_0x2742d0){if(_0x2688f8[_0x9dff('0x38')]['id']){delete _0x2688f8[_0x9dff('0x38')]['id'];}return db[_0x9dff('0x2f')][_0x9dff('0x39')]({'where':{'id':_0x2688f8[_0x9dff('0x3a')]['id']}})[_0x9dff('0x27')](handleEntityNotFound(_0x2742d0,null))[_0x9dff('0x27')](function(_0x3d56b4){var _0x236254=_0x3d56b4[_0x9dff('0x3b')]({'plain':!![]});return utilLicense[_0x9dff('0x3c')](_0x236254,_0x2688f8[_0x9dff('0x38')]['key']);})[_0x9dff('0x27')](function(_0x1b4b7f){if(!_0x1b4b7f[_0x9dff('0x3d')]){return saveUpdates(_0x2688f8['body'],null);}return _0x1b4b7f;})[_0x9dff('0x27')](respondWithResult(_0x2742d0,null))[_0x9dff('0x3e')](handleError(_0x2742d0,null));};exports['downloadLogFile']=function(_0x241d4e,_0x24cd28){var _0x179109=_0x9dff('0x3f');var _0x4dd096=path[_0x9dff('0x40')](_0x9dff('0x41'),_0x9dff('0x42'),_0x9dff('0x43'),_0x179109);_0x24cd28[_0x9dff('0x44')]('Content-disposition',_0x9dff('0x45')+_0x179109);_0x24cd28[_0x9dff('0x46')](_0x9dff('0x47'),_0x9dff('0x48'));_0x24cd28[_0x9dff('0x49')](_0x4dd096);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 70653bf..2cc2077 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 _0xb125=['license','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','License'];(function(_0xd4c264,_0x26754b){var _0x349e1f=function(_0x180d55){while(--_0x180d55){_0xd4c264['push'](_0xd4c264['shift']());}};_0x349e1f(++_0x26754b);}(_0xb125,0xd9));var _0x5b12=function(_0x257d7d,_0x1ad592){_0x257d7d=_0x257d7d-0x0;var _0x5771fe=_0xb125[_0x257d7d];return _0x5771fe;};'use strict';var _=require('lodash');var util=require(_0x5b12('0x0'));var logger=require(_0x5b12('0x1'))(_0x5b12('0x2'));var moment=require('moment');var BPromise=require(_0x5b12('0x3'));var rp=require(_0x5b12('0x4'));var fs=require('fs');var path=require(_0x5b12('0x5'));var rimraf=require(_0x5b12('0x6'));var config=require(_0x5b12('0x7'));var attributes=require('./license.attributes');module[_0x5b12('0x8')]=function(_0x37b6cf,_0x153895){return _0x37b6cf[_0x5b12('0x9')](_0x5b12('0xa'),attributes,{'tableName':_0x5b12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79c7=['moment','request-promise','rimraf','../../config/environment','./license.attributes','exports','define','license','util','../../config/logger','api'];(function(_0x5128f3,_0x44c5af){var _0x2dcc81=function(_0x4bfb1a){while(--_0x4bfb1a){_0x5128f3['push'](_0x5128f3['shift']());}};_0x2dcc81(++_0x44c5af);}(_0x79c7,0x19f));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x779c('0x0'));var logger=require(_0x779c('0x1'))(_0x779c('0x2'));var moment=require(_0x779c('0x3'));var BPromise=require('bluebird');var rp=require(_0x779c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x779c('0x5'));var config=require(_0x779c('0x6'));var attributes=require(_0x779c('0x7'));module[_0x779c('0x8')]=function(_0x1d7c51,_0x35d41d){return _0x1d7c51[_0x779c('0x9')]('License',attributes,{'tableName':_0x779c('0xa'),'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 743b551..8852f30 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 _0xf78e=['info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','License,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x1bd027,_0x36080c){var _0x3cc6ed=function(_0x45240f){while(--_0x45240f){_0x1bd027['push'](_0x1bd027['shift']());}};_0x3cc6ed(++_0x36080c);}(_0xf78e,0x1d8));var _0xef78=function(_0x1bebb0,_0x1253ba){_0x1bebb0=_0x1bebb0-0x0;var _0x1cfd40=_0xf78e[_0x1bebb0];return _0x1cfd40;};'use strict';var _=require('lodash');var util=require(_0xef78('0x0'));var moment=require(_0xef78('0x1'));var BPromise=require(_0xef78('0x2'));var rs=require(_0xef78('0x3'));var fs=require('fs');var Redis=require(_0xef78('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef78('0x5'));var logger=require(_0xef78('0x6'))(_0xef78('0x7'));var config=require(_0xef78('0x8'));var jayson=require(_0xef78('0x9'));var client=jayson['client'][_0xef78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d45aa,_0x43e9d2,_0x5c9aa9){return new BPromise(function(_0x76ae09,_0x4d31a6){return client['request'](_0x5d45aa,_0x5c9aa9)['then'](function(_0x56ac41){logger[_0xef78('0xb')]('License,\x20%s,\x20%s',_0x43e9d2,_0xef78('0xc'));logger['debug'](_0xef78('0xd'),_0x43e9d2,_0xef78('0xc'),JSON[_0xef78('0xe')](_0x56ac41));if(_0x56ac41[_0xef78('0xf')]){if(_0x56ac41[_0xef78('0xf')][_0xef78('0x10')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x43e9d2,_0x56ac41[_0xef78('0xf')][_0xef78('0x11')]);return _0x4d31a6(_0x56ac41[_0xef78('0xf')][_0xef78('0x11')]);}logger[_0xef78('0xf')]('License,\x20%s,\x20%s',_0x43e9d2,_0x56ac41[_0xef78('0xf')][_0xef78('0x11')]);return _0x76ae09(_0x56ac41[_0xef78('0xf')]['message']);}else{logger['info'](_0xef78('0x12'),_0x43e9d2,_0xef78('0xc'));_0x76ae09(_0x56ac41[_0xef78('0x13')][_0xef78('0x11')]);}})[_0xef78('0x14')](function(_0x5f410e){logger['error'](_0xef78('0x12'),_0x43e9d2,_0x5f410e);_0x4d31a6(_0x5f410e);});});} \ No newline at end of file +var _0xb4d1=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5570b7,_0x4737d5){var _0x32ba78=function(_0x243878){while(--_0x243878){_0x5570b7['push'](_0x5570b7['shift']());}};_0x32ba78(++_0x4737d5);}(_0xb4d1,0x116));var _0x1b4d=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xb4d1[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x1b4d('0x0'));var util=require('util');var moment=require(_0x1b4d('0x1'));var BPromise=require(_0x1b4d('0x2'));var rs=require(_0x1b4d('0x3'));var fs=require('fs');var Redis=require(_0x1b4d('0x4'));var db=require(_0x1b4d('0x5'))['db'];var utils=require(_0x1b4d('0x6'));var logger=require(_0x1b4d('0x7'))('rpc');var config=require(_0x1b4d('0x8'));var jayson=require(_0x1b4d('0x9'));var client=jayson[_0x1b4d('0xa')][_0x1b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44895e,_0x1ca878,_0x1b23dc){return new BPromise(function(_0x22ae36,_0x1564dc){return client[_0x1b4d('0xc')](_0x44895e,_0x1b23dc)[_0x1b4d('0xd')](function(_0x1826c2){logger[_0x1b4d('0xe')](_0x1b4d('0xf'),_0x1ca878,_0x1b4d('0x10'));logger[_0x1b4d('0x11')](_0x1b4d('0x12'),_0x1ca878,_0x1b4d('0x10'),JSON[_0x1b4d('0x13')](_0x1826c2));if(_0x1826c2[_0x1b4d('0x14')]){if(_0x1826c2[_0x1b4d('0x14')][_0x1b4d('0x15')]===0x1f4){logger[_0x1b4d('0x14')](_0x1b4d('0xf'),_0x1ca878,_0x1826c2['error'][_0x1b4d('0x16')]);return _0x1564dc(_0x1826c2[_0x1b4d('0x14')][_0x1b4d('0x16')]);}logger[_0x1b4d('0x14')](_0x1b4d('0xf'),_0x1ca878,_0x1826c2['error']['message']);return _0x22ae36(_0x1826c2[_0x1b4d('0x14')][_0x1b4d('0x16')]);}else{logger[_0x1b4d('0xe')](_0x1b4d('0xf'),_0x1ca878,_0x1b4d('0x10'));_0x22ae36(_0x1826c2[_0x1b4d('0x17')][_0x1b4d('0x16')]);}})[_0x1b4d('0x18')](function(_0xc5b671){logger[_0x1b4d('0x14')](_0x1b4d('0xf'),_0x1ca878,_0xc5b671);_0x1564dc(_0xc5b671);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index d812e5d..8189be3 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 _0xd96e=['getApplications','/:id/messages','/:id/verify','/:id/users','getAgents','post','/:id/dispositions','addAnswer','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeSmtp','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xd96e,0xa0));var _0xed96=function(_0x2dabc0,_0x491762){_0x2dabc0=_0x2dabc0-0x0;var _0x3a3cea=_0xd96e[_0x2dabc0];return _0x3a3cea;};'use strict';var multer=require(_0xed96('0x0'));var util=require('util');var path=require(_0xed96('0x1'));var timeout=require(_0xed96('0x2'));var express=require('express');var router=express[_0xed96('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xed96('0x4'));var interaction=require(_0xed96('0x5'));var config=require(_0xed96('0x6'));var controller=require('./mailAccount.controller');router[_0xed96('0x7')]('/',auth['isAuthenticated'](),controller[_0xed96('0x8')]);router[_0xed96('0x7')](_0xed96('0x9'),auth[_0xed96('0xa')](),controller[_0xed96('0xb')]);router[_0xed96('0x7')](_0xed96('0xc'),auth['isAuthenticated'](),controller[_0xed96('0xd')]);router[_0xed96('0x7')]('/:id/dispositions',auth[_0xed96('0xa')](),controller[_0xed96('0xe')]);router[_0xed96('0x7')](_0xed96('0xf'),auth['isAuthenticated'](),controller[_0xed96('0x10')]);router[_0xed96('0x7')](_0xed96('0x11'),auth[_0xed96('0xa')](),controller[_0xed96('0x12')]);router[_0xed96('0x7')](_0xed96('0x13'),auth[_0xed96('0xa')](),controller[_0xed96('0x14')]);router[_0xed96('0x7')](_0xed96('0x15'),auth[_0xed96('0xa')](),controller[_0xed96('0x16')]);router[_0xed96('0x7')](_0xed96('0x17'),auth[_0xed96('0xa')](),controller[_0xed96('0x18')]);router[_0xed96('0x7')](_0xed96('0x19'),auth['isAuthenticated'](),controller['getMessages']);router[_0xed96('0x7')](_0xed96('0x1a'),auth[_0xed96('0xa')](),controller['verifySmtp']);router[_0xed96('0x7')](_0xed96('0x1b'),auth[_0xed96('0xa')](),controller[_0xed96('0x1c')]);router[_0xed96('0x1d')](_0xed96('0x1e'),auth[_0xed96('0xa')](),controller['addDisposition']);router[_0xed96('0x1d')](_0xed96('0xf'),auth[_0xed96('0xa')](),controller[_0xed96('0x1f')]);router[_0xed96('0x1d')]('/',auth[_0xed96('0xa')](),controller['create']);router[_0xed96('0x1d')](_0xed96('0x11'),auth[_0xed96('0xa')](),controller[_0xed96('0x20')]);router[_0xed96('0x1d')](_0xed96('0x13'),auth['isAuthenticated'](),controller[_0xed96('0x21')]);router[_0xed96('0x1d')](_0xed96('0x15'),auth[_0xed96('0xa')](),controller['addInteraction']);router[_0xed96('0x1d')](_0xed96('0x17'),auth['isAuthenticated'](),controller[_0xed96('0x22')]);router[_0xed96('0x1d')](_0xed96('0x23'),auth[_0xed96('0xa')](),controller[_0xed96('0x24')]);router[_0xed96('0x1d')](_0xed96('0x1b'),auth[_0xed96('0xa')](),controller[_0xed96('0x25')]);router[_0xed96('0x26')](_0xed96('0xc'),auth[_0xed96('0xa')](),controller[_0xed96('0x27')]);router['delete'](_0xed96('0x1e'),auth['isAuthenticated'](),controller[_0xed96('0x28')]);router[_0xed96('0x29')](_0xed96('0xf'),auth[_0xed96('0xa')](),controller[_0xed96('0x2a')]);router['delete'](_0xed96('0x11'),auth['isAuthenticated'](),controller['removeImap']);router[_0xed96('0x29')](_0xed96('0x13'),auth[_0xed96('0xa')](),controller[_0xed96('0x2b')]);router[_0xed96('0x29')](_0xed96('0xc'),auth[_0xed96('0xa')](),controller[_0xed96('0x2c')]);router[_0xed96('0x29')](_0xed96('0x1b'),auth[_0xed96('0xa')](),controller['removeAgents']);module[_0xed96('0x2d')]=router; \ No newline at end of file +var _0x8cd0=['getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','create','addImap','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers'];(function(_0x1278c4,_0x5c2d2d){var _0x365887=function(_0x316fc4){while(--_0x316fc4){_0x1278c4['push'](_0x1278c4['shift']());}};_0x365887(++_0x5c2d2d);}(_0x8cd0,0x13d));var _0x08cd=function(_0x2b64be,_0x4af169){_0x2b64be=_0x2b64be-0x0;var _0xe2a293=_0x8cd0[_0x2b64be];return _0xe2a293;};'use strict';var multer=require(_0x08cd('0x0'));var util=require(_0x08cd('0x1'));var path=require(_0x08cd('0x2'));var timeout=require(_0x08cd('0x3'));var express=require(_0x08cd('0x4'));var router=express[_0x08cd('0x5')]();var fs_extra=require(_0x08cd('0x6'));var auth=require(_0x08cd('0x7'));var interaction=require(_0x08cd('0x8'));var config=require('../../config/environment');var controller=require(_0x08cd('0x9'));router[_0x08cd('0xa')]('/',auth[_0x08cd('0xb')](),controller['index']);router[_0x08cd('0xa')]('/describe',auth[_0x08cd('0xb')](),controller[_0x08cd('0xc')]);router[_0x08cd('0xa')](_0x08cd('0xd'),auth['isAuthenticated'](),controller[_0x08cd('0xe')]);router[_0x08cd('0xa')](_0x08cd('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x08cd('0xa')](_0x08cd('0x10'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x11')]);router[_0x08cd('0xa')](_0x08cd('0x12'),auth['isAuthenticated'](),controller[_0x08cd('0x13')]);router[_0x08cd('0xa')](_0x08cd('0x14'),auth['isAuthenticated'](),controller[_0x08cd('0x15')]);router[_0x08cd('0xa')](_0x08cd('0x16'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x17')]);router[_0x08cd('0xa')](_0x08cd('0x18'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x19')]);router[_0x08cd('0xa')](_0x08cd('0x1a'),auth['isAuthenticated'](),controller[_0x08cd('0x1b')]);router[_0x08cd('0xa')](_0x08cd('0x1c'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x1d')]);router['get'](_0x08cd('0x1e'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x1f')]);router[_0x08cd('0x20')](_0x08cd('0xf'),auth[_0x08cd('0xb')](),controller['addDisposition']);router[_0x08cd('0x20')](_0x08cd('0x10'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x21')]);router[_0x08cd('0x20')]('/',auth[_0x08cd('0xb')](),controller[_0x08cd('0x22')]);router['post'](_0x08cd('0x12'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x23')]);router[_0x08cd('0x20')]('/:id/out_servers',auth[_0x08cd('0xb')](),controller['addSmtp']);router[_0x08cd('0x20')](_0x08cd('0x16'),auth[_0x08cd('0xb')](),controller['addInteraction']);router[_0x08cd('0x20')](_0x08cd('0x18'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x24')]);router[_0x08cd('0x20')](_0x08cd('0x25'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x26')]);router['post']('/:id/users',auth[_0x08cd('0xb')](),controller[_0x08cd('0x27')]);router[_0x08cd('0x28')](_0x08cd('0xd'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x29')]);router[_0x08cd('0x2a')](_0x08cd('0xf'),auth[_0x08cd('0xb')](),controller[_0x08cd('0x2b')]);router['delete']('/:id/canned_answers',auth[_0x08cd('0xb')](),controller[_0x08cd('0x2c')]);router[_0x08cd('0x2a')](_0x08cd('0x12'),auth['isAuthenticated'](),controller[_0x08cd('0x2d')]);router[_0x08cd('0x2a')](_0x08cd('0x14'),auth['isAuthenticated'](),controller[_0x08cd('0x2e')]);router[_0x08cd('0x2a')]('/:id',auth[_0x08cd('0xb')](),controller[_0x08cd('0x2f')]);router['delete'](_0x08cd('0x1e'),auth[_0x08cd('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index b9d6bb5..91893a2 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 _0x0a3c=['ENUM','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x0a3c,0x1c0));var _0xc0a3=function(_0x16fc5c,_0x2a72fd){_0x16fc5c=_0x16fc5c-0x0;var _0x492d96=_0x0a3c[_0x16fc5c];return _0x492d96;};'use strict';var Sequelize=require(_0xc0a3('0x0'));module[_0xc0a3('0x1')]={'description':{'type':Sequelize[_0xc0a3('0x2')]},'name':{'type':Sequelize[_0xc0a3('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xc0a3('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xc0a3('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xc0a3('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xc0a3('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xc0a3('0x4')]},'markAsUnread':{'type':Sequelize[_0xc0a3('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xc0a3('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xc0a3('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xc0a3('0x4')],'defaultValue':function(){return _0xc0a3('0x6');}},'notificationSound':{'type':Sequelize[_0xc0a3('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc0a3('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc0a3('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc0a3('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc0a3('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc0a3('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc0a3('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xc0a3('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc0a3('0x8'),'set':function(_0x4b0fdc){if(!_0x4b0fdc)this[_0xc0a3('0x9')](_0xc0a3('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x4b0fdc);}},'provider':{'type':Sequelize[_0xc0a3('0xb')]('gmail','hotmail',_0xc0a3('0xc'),_0xc0a3('0xd')),'defaultValue':null,'get':function(){if(!this[_0xc0a3('0xe')]('provider'))return _0xc0a3('0xf');return this[_0xc0a3('0xe')](_0xc0a3('0x10'));},'set':function(_0x42fa13){if(_0x42fa13===_0xc0a3('0xf'))_0x42fa13=null;return this[_0xc0a3('0x9')](_0xc0a3('0x10'),_0x42fa13);}}}; \ No newline at end of file +var _0x3c07=['outlook365','custom','getDataValue','provider','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','gmail','yahoo'];(function(_0x51b193,_0x1fd11a){var _0x4bc7e4=function(_0x4319f0){while(--_0x4319f0){_0x51b193['push'](_0x51b193['shift']());}};_0x4bc7e4(++_0x1fd11a);}(_0x3c07,0x70));var _0x73c0=function(_0x281d23,_0x20d215){_0x281d23=_0x281d23-0x0;var _0x6b91db=_0x3c07[_0x281d23];return _0x6b91db;};'use strict';var Sequelize=require('sequelize');module[_0x73c0('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x73c0('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x73c0('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x73c0('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x73c0('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x73c0('0x3')]},'markAsUnread':{'type':Sequelize[_0x73c0('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x73c0('0x2')],'allowNull':![],'defaultValue':_0x73c0('0x4')},'fontSize':{'type':Sequelize[_0x73c0('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x73c0('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x73c0('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x73c0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x73c0('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x73c0('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x73c0('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x73c0('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x73c0('0x1')],'defaultValue':![],'comment':_0x73c0('0x8'),'set':function(_0x27c92a){if(!_0x27c92a)this['setDataValue'](_0x73c0('0x9'),null);this[_0x73c0('0xa')](_0x73c0('0xb'),_0x27c92a);}},'provider':{'type':Sequelize['ENUM'](_0x73c0('0xc'),'hotmail',_0x73c0('0xd'),_0x73c0('0xe')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0x73c0('0xf');return this[_0x73c0('0x10')](_0x73c0('0x11'));},'set':function(_0x44adb6){if(_0x44adb6===_0x73c0('0xf'))_0x44adb6=null;return this[_0x73c0('0xa')](_0x73c0('0x11'),_0x44adb6);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 95c0623..952e5e7 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 _0x7e75=['host','port','secure','service','authentication','Smtp','index','MailServerIn','Imap','MailServerOut','Pause','map','MailAccount','rawAttributes','fieldName','type','key','keys','filters','intersection','model','attributes','fields','query','length','sort','pick','filter','where','VIRTUAL','includeAll','include','mandatoryDispositionPause','merge','find','body','custom','provider','update','describe','addDisposition','params','MailAccountId','hasOwnProperty','nolimit','order','options','Disposition','findAll','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','findOne','rows','removeAnswers','email','ListId','active','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','internal','Tag','Tags','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','updatedAt','DESC','CloudProvider','isNil','from','attachments','server/files/attachments','basename','SendMail','sendMail','List','List\x20not\x20found','Contacts','messageId','attach','out','format','Interaction','getSmtpOptions','VerifySmtp','verifySmtp','Sequelize','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','client','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','limit','undefined','count','offset','json','destroy','get','UserProfileResource','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId'];(function(_0x57c9c7,_0xb70a91){var _0x48ad8b=function(_0x51af55){while(--_0x51af55){_0x57c9c7['push'](_0x57c9c7['shift']());}};_0x48ad8b(++_0xb70a91);}(_0x7e75,0x83));var _0x57e7=function(_0x3e170f,_0x15b1a5){_0x3e170f=_0x3e170f-0x0;var _0x33be7c=_0x7e75[_0x3e170f];return _0x33be7c;};'use strict';var moment=require(_0x57e7('0x0'));var BPromise=require(_0x57e7('0x1'));var util=require(_0x57e7('0x2'));var path=require('path');var _=require(_0x57e7('0x3'));var juice=require('juice');var Redis=require(_0x57e7('0x4'));var qs=require(_0x57e7('0x5'));var logger=require(_0x57e7('0x6'))(_0x57e7('0x7'));var config=require(_0x57e7('0x8'));var db=require(_0x57e7('0x9'))['db'];config[_0x57e7('0xa')]=_[_0x57e7('0xb')](config[_0x57e7('0xa')],{'host':_0x57e7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57e7('0xa')]));require('./mailAccount.socket')[_0x57e7('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x57e7('0xe')][_0x57e7('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x192bcc,_0x12a930,_0x3cb77f,_0x7b4aea){return new BPromise(function(_0x1831f3,_0x22e296){var _0x44c970=_0x7b4aea||client;return _0x44c970[_0x57e7('0x10')](_0x192bcc,_0x3cb77f)[_0x57e7('0x11')](function(_0x1254dc){logger[_0x57e7('0x12')]('MailAccount,\x20%s,\x20%s',_0x12a930,_0x57e7('0x13'));logger[_0x57e7('0x14')](_0x57e7('0x15'),_0x12a930,_0x57e7('0x13'),JSON[_0x57e7('0x16')](_0x1254dc));if(_0x1254dc['error']){if(_0x1254dc[_0x57e7('0x17')][_0x57e7('0x18')]===0x1f4){logger['error'](_0x57e7('0x19'),_0x12a930,_0x1254dc[_0x57e7('0x17')][_0x57e7('0x1a')]);return _0x22e296(_0x1254dc['error'][_0x57e7('0x1a')]);}logger[_0x57e7('0x17')](_0x57e7('0x19'),_0x12a930,_0x1254dc['error'][_0x57e7('0x1a')]);return _0x1831f3(_0x1254dc[_0x57e7('0x17')][_0x57e7('0x1a')]);}else{logger[_0x57e7('0x12')]('MailAccount,\x20%s,\x20%s',_0x12a930,_0x57e7('0x13'));_0x1831f3(_0x1254dc[_0x57e7('0x1b')][_0x57e7('0x1a')]);}})[_0x57e7('0x1c')](function(_0x58e158){logger['error']('MailAccount,\x20%s,\x20%s',_0x12a930,_0x58e158);_0x22e296(_0x58e158);});});}function respondWithStatusCode(_0x1199a0,_0x32c0a5){_0x32c0a5=_0x32c0a5||0xcc;return function(_0x4c8c7c){if(_0x4c8c7c){return _0x1199a0[_0x57e7('0x1d')](_0x32c0a5);}return _0x1199a0[_0x57e7('0x1e')](_0x32c0a5)[_0x57e7('0x1f')]();};}function respondWithResult(_0x2bd8e8,_0x19801b){_0x19801b=_0x19801b||0xc8;return function(_0x21ff87){if(_0x21ff87){return _0x2bd8e8['status'](_0x19801b)['json'](_0x21ff87);}};}function respondWithFilteredResult(_0x541787,_0x491eff){return function(_0x43b9fe){if(_0x43b9fe){var _0x490bb8=typeof _0x491eff['offset']==='undefined'&&typeof _0x491eff[_0x57e7('0x20')]===_0x57e7('0x21');var _0x388392=_0x43b9fe[_0x57e7('0x22')];var _0x4e564c=_0x490bb8?0x0:_0x491eff[_0x57e7('0x23')];var _0x2d6646=_0x490bb8?_0x43b9fe['count']:_0x491eff[_0x57e7('0x23')]+_0x491eff[_0x57e7('0x20')];var _0x1f45b7;if(_0x2d6646>=_0x388392){_0x2d6646=_0x388392;_0x1f45b7=0xc8;}else{_0x1f45b7=0xce;}_0x541787[_0x57e7('0x1e')](_0x1f45b7);return _0x541787['set']('Content-Range',_0x4e564c+'-'+_0x2d6646+'/'+_0x388392)[_0x57e7('0x24')](_0x43b9fe);}return null;};}function saveUpdates(_0x51be8a){return function(_0x4a73ef){if(_0x4a73ef){return _0x4a73ef['update'](_0x51be8a)[_0x57e7('0x11')](function(_0x3947f3){return _0x3947f3;});}return null;};}function removeEntity(_0x140b55){return function(_0x2e8602){if(_0x2e8602){return _0x2e8602[_0x57e7('0x25')]()[_0x57e7('0x11')](function(){var _0x1257f4=_0x2e8602[_0x57e7('0x26')]({'plain':!![]});var _0xefa555='MailAccounts';return db[_0x57e7('0x27')]['destroy']({'where':{'type':_0xefa555,'resourceId':_0x1257f4['id']}})[_0x57e7('0x11')](function(){return _0x2e8602;});})[_0x57e7('0x11')](function(){_0x140b55[_0x57e7('0x1e')](0xcc)[_0x57e7('0x1f')]();});}};}function handleEntityNotFound(_0x2e310f){return function(_0x100e6f){if(!_0x100e6f){_0x2e310f['sendStatus'](0x194);}return _0x100e6f;};}function handleError(_0x5e367b,_0x18f998){_0x18f998=_0x18f998||0x1f4;return function(_0x2c250d){logger[_0x57e7('0x17')](_0x2c250d[_0x57e7('0x28')]);if(_0x2c250d[_0x57e7('0x29')]){delete _0x2c250d[_0x57e7('0x29')];}_0x5e367b[_0x57e7('0x1e')](_0x18f998)[_0x57e7('0x2a')](_0x2c250d);};}function getImapHost(_0x2b8488){switch(_0x2b8488){case _0x57e7('0x2b'):return'imap.gmail.com';case _0x57e7('0x2c'):return _0x57e7('0x2d');case'hotmail':return'imap-mail.outlook.com';case _0x57e7('0x2e'):return'outlook.office365.com';}throw new Error(_0x57e7('0x2f'),_0x2b8488);}function getSmtpHost(_0x5e6ef1){switch(_0x5e6ef1){case'gmail':return _0x57e7('0x30');case _0x57e7('0x2c'):return _0x57e7('0x31');case _0x57e7('0x32'):return _0x57e7('0x33');case _0x57e7('0x2e'):return _0x57e7('0x34');}throw new Error(_0x57e7('0x2f'),_0x5e6ef1);}function getAuthenticationOptions(_0x2b2d6b,_0x5907f7){var _0x2fe17c={};var _0x16d8f3={};if(_0x2b2d6b){_0x2fe17c[_0x57e7('0x35')]=_0x16d8f3['user']=_0x5907f7[_0x57e7('0x36')];_0x2fe17c[_0x57e7('0x37')]=_0x16d8f3[_0x57e7('0x38')]=_0x5907f7[_0x57e7('0x37')];if(_0x5907f7[_0x57e7('0x39')]){_0x2fe17c['modernAuthentication']=_0x16d8f3[_0x57e7('0x39')]=!![];_0x2fe17c['CloudProviderId']=_0x16d8f3[_0x57e7('0x3a')]=_0x5907f7[_0x57e7('0x3a')];_0x2fe17c['password']=_0x16d8f3[_0x57e7('0x38')]=null;}else{_0x2fe17c[_0x57e7('0x3a')]=_0x16d8f3[_0x57e7('0x3a')]=null;}_0x2fe17c[_0x57e7('0x3b')]=getImapHost(_0x2b2d6b);_0x2fe17c[_0x57e7('0x3c')]=0x3e1;_0x16d8f3['host']=getSmtpHost(_0x2b2d6b);_0x16d8f3[_0x57e7('0x3c')]=0x24b;_0x16d8f3[_0x57e7('0x3d')]=![];_0x2fe17c[_0x57e7('0x3e')]=_0x16d8f3[_0x57e7('0x3e')]=null;}else{if(_0x5907f7[_0x57e7('0x3f')]){_0x2fe17c['user']=_0x16d8f3[_0x57e7('0x35')]=_0x5907f7['username'];_0x2fe17c['password']=_0x16d8f3[_0x57e7('0x38')]=_0x5907f7[_0x57e7('0x37')];}else{_0x2fe17c[_0x57e7('0x3f')]=_0x16d8f3[_0x57e7('0x3f')]=![];_0x2fe17c[_0x57e7('0x35')]=_0x16d8f3[_0x57e7('0x35')]=null;_0x2fe17c[_0x57e7('0x37')]=_0x16d8f3[_0x57e7('0x38')]=null;}_0x2fe17c[_0x57e7('0x3b')]=_0x5907f7['Imap'][_0x57e7('0x3b')];_0x2fe17c[_0x57e7('0x3c')]=_0x5907f7['Imap'][_0x57e7('0x3c')];_0x16d8f3[_0x57e7('0x3b')]=_0x5907f7[_0x57e7('0x40')]['host'];_0x16d8f3['port']=_0x5907f7[_0x57e7('0x40')][_0x57e7('0x3c')];}return{'Imap':_0x2fe17c,'Smtp':_0x16d8f3};}exports[_0x57e7('0x41')]=function(_0x414e06,_0x5aa77c){var _0x79e8c6={'include':[{'model':db[_0x57e7('0x42')],'as':_0x57e7('0x43')},{'model':db[_0x57e7('0x44')],'as':_0x57e7('0x40')},{'model':db[_0x57e7('0x45')],'as':'mandatoryDispositionPause'}]},_0x5c0636={},_0x18e096={'count':0x0,'rows':[]};var _0x3dcc9=_[_0x57e7('0x46')](db[_0x57e7('0x47')][_0x57e7('0x48')],function(_0x2dcf02){return{'name':_0x2dcf02[_0x57e7('0x49')],'type':_0x2dcf02[_0x57e7('0x4a')][_0x57e7('0x4b')]};});_0x5c0636['model']=_['map'](_0x3dcc9,_0x57e7('0x29'));_0x5c0636['query']=_[_0x57e7('0x4c')](_0x414e06['query']);_0x5c0636[_0x57e7('0x4d')]=_[_0x57e7('0x4e')](_0x5c0636[_0x57e7('0x4f')],_0x5c0636['query']);_0x79e8c6[_0x57e7('0x50')]=_[_0x57e7('0x4e')](_0x5c0636[_0x57e7('0x4f')],qs[_0x57e7('0x51')](_0x414e06[_0x57e7('0x52')]['fields']));_0x79e8c6[_0x57e7('0x50')]=_0x79e8c6[_0x57e7('0x50')][_0x57e7('0x53')]?_0x79e8c6[_0x57e7('0x50')]:_0x5c0636[_0x57e7('0x4f')];if(!_0x414e06[_0x57e7('0x52')]['hasOwnProperty']('nolimit')){_0x79e8c6[_0x57e7('0x20')]=qs[_0x57e7('0x20')](_0x414e06[_0x57e7('0x52')][_0x57e7('0x20')]);_0x79e8c6[_0x57e7('0x23')]=qs[_0x57e7('0x23')](_0x414e06[_0x57e7('0x52')][_0x57e7('0x23')]);}_0x79e8c6['order']=qs[_0x57e7('0x54')](_0x414e06[_0x57e7('0x52')]['sort']);_0x79e8c6['where']=qs[_0x57e7('0x4d')](_[_0x57e7('0x55')](_0x414e06[_0x57e7('0x52')],_0x5c0636[_0x57e7('0x4d')]),_0x3dcc9);if(_0x414e06['query'][_0x57e7('0x56')]){_0x79e8c6[_0x57e7('0x57')]=_['merge'](_0x79e8c6[_0x57e7('0x57')],{'$or':_['map'](_0x3dcc9,function(_0x12516c){if(_0x12516c['type']!==_0x57e7('0x58')){var _0xe50d5a={};_0xe50d5a[_0x12516c[_0x57e7('0x29')]]={'$like':'%'+_0x414e06[_0x57e7('0x52')][_0x57e7('0x56')]+'%'};return _0xe50d5a;}})});}_0x79e8c6=_['merge']({},_0x79e8c6,_0x414e06['options']);var _0x26a197={'where':_0x79e8c6[_0x57e7('0x57')]};return db[_0x57e7('0x47')]['count'](_0x26a197)[_0x57e7('0x11')](function(_0x1c8321){_0x18e096['count']=_0x1c8321;if(_0x414e06[_0x57e7('0x52')][_0x57e7('0x59')]){_0x79e8c6[_0x57e7('0x5a')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x79e8c6);})[_0x57e7('0x11')](function(_0x573c3d){_0x18e096['rows']=_0x573c3d;return _0x18e096;})[_0x57e7('0x11')](respondWithFilteredResult(_0x5aa77c,_0x79e8c6))[_0x57e7('0x1c')](handleError(_0x5aa77c,null));};exports['show']=function(_0x14cff7,_0xdbaba0){var _0x5e94b0={'raw':![],'where':{'id':_0x14cff7['params']['id']},'include':[{'model':db[_0x57e7('0x42')],'as':_0x57e7('0x43')},{'model':db[_0x57e7('0x44')],'as':'Smtp'},{'model':db[_0x57e7('0x45')],'as':_0x57e7('0x5b')}]},_0x15bb78={};_0x15bb78[_0x57e7('0x4f')]=_[_0x57e7('0x4c')](db[_0x57e7('0x47')][_0x57e7('0x48')]);_0x15bb78['query']=_[_0x57e7('0x4c')](_0x14cff7[_0x57e7('0x52')]);_0x15bb78[_0x57e7('0x4d')]=_[_0x57e7('0x4e')](_0x15bb78[_0x57e7('0x4f')],_0x15bb78['query']);_0x5e94b0['attributes']=_['intersection'](_0x15bb78[_0x57e7('0x4f')],qs[_0x57e7('0x51')](_0x14cff7[_0x57e7('0x52')][_0x57e7('0x51')]));_0x5e94b0[_0x57e7('0x50')]=_0x5e94b0[_0x57e7('0x50')][_0x57e7('0x53')]?_0x5e94b0[_0x57e7('0x50')]:_0x15bb78['model'];if(_0x14cff7[_0x57e7('0x52')][_0x57e7('0x59')]){_0x5e94b0[_0x57e7('0x5a')]=[{'all':!![]}];}_0x5e94b0=_[_0x57e7('0x5c')]({},_0x5e94b0,_0x14cff7['options']);return db['MailAccount'][_0x57e7('0x5d')](_0x5e94b0)[_0x57e7('0x11')](handleEntityNotFound(_0xdbaba0,null))['then'](respondWithResult(_0xdbaba0,null))[_0x57e7('0x1c')](handleError(_0xdbaba0,null));};exports['update']=function(_0x55a5a2,_0x3ea571){if(_0x55a5a2['body']['id']){delete _0x55a5a2[_0x57e7('0x5e')]['id'];}var _0x18ec86=_0x55a5a2[_0x57e7('0x5e')]['provider']===_0x57e7('0x5f')?null:_0x55a5a2['body'][_0x57e7('0x60')];var _0x3b68c8=_0x55a5a2[_0x57e7('0x5e')][_0x57e7('0x43')]||{};var _0x5d945d=_0x55a5a2[_0x57e7('0x5e')][_0x57e7('0x40')]||{};if(_0x18ec86){_0x3b68c8['host']=getImapHost(_0x18ec86);_0x3b68c8[_0x57e7('0x3c')]=0x3e1;_0x5d945d[_0x57e7('0x3b')]=getSmtpHost(_0x18ec86);_0x5d945d[_0x57e7('0x3c')]=0x24b;_0x5d945d[_0x57e7('0x3d')]=![];}if(_0x5d945d[_0x57e7('0x39')]){_0x5d945d['secure']=![];}else{_0x5d945d[_0x57e7('0x3a')]=null;}if(!_0x3b68c8[_0x57e7('0x39')])_0x3b68c8[_0x57e7('0x3a')]=null;_0x55a5a2[_0x57e7('0x5e')][_0x57e7('0x43')]=_0x3b68c8;_0x55a5a2[_0x57e7('0x5e')]['Smtp']=_0x5d945d;return db[_0x57e7('0x47')][_0x57e7('0x5d')]({'where':{'id':_0x55a5a2['params']['id']},'include':[{'model':db[_0x57e7('0x42')],'as':_0x57e7('0x43')},{'model':db[_0x57e7('0x44')],'as':_0x57e7('0x40')},{'model':db[_0x57e7('0x45')],'as':_0x57e7('0x5b')}]})[_0x57e7('0x11')](handleEntityNotFound(_0x3ea571,null))[_0x57e7('0x11')](function(_0x1573c6){if(!_0x1573c6)throw new Error('Mail\x20Account\x20not\x20found');if(_0x1573c6['service'])delete _0x55a5a2[_0x57e7('0x5e')]['Imap'];return _0x1573c6;})['then'](saveUpdates(_0x55a5a2[_0x57e7('0x5e')],null))[_0x57e7('0x11')](function(_0x249c38){if(!_0x55a5a2[_0x57e7('0x5e')]['Imap'])return _0x249c38;return db[_0x57e7('0x42')][_0x57e7('0x61')](_0x55a5a2[_0x57e7('0x5e')][_0x57e7('0x43')],{'where':{'MailAccountId':_0x249c38['id']}})['then'](function(){return _0x249c38;});})[_0x57e7('0x11')](function(_0x625c41){if(!_0x55a5a2[_0x57e7('0x5e')][_0x57e7('0x40')])return _0x625c41;return db[_0x57e7('0x44')]['update'](_0x55a5a2[_0x57e7('0x5e')][_0x57e7('0x40')],{'where':{'MailAccountId':_0x625c41['id']}})['then'](function(){return _0x625c41;});})[_0x57e7('0x11')](respondWithResult(_0x3ea571,null))[_0x57e7('0x1c')](handleError(_0x3ea571,null));};exports[_0x57e7('0x62')]=function(_0x4e00d9,_0x100ef8){return db[_0x57e7('0x47')][_0x57e7('0x62')]()['then'](respondWithResult(_0x100ef8,null))['catch'](handleError(_0x100ef8,null));};exports[_0x57e7('0x63')]=function(_0x874774,_0x3b00ca){if(_0x874774['body']['id']){delete _0x874774[_0x57e7('0x5e')]['id'];}return db[_0x57e7('0x47')][_0x57e7('0x5d')]({'where':{'id':_0x874774[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x3b00ca,null))[_0x57e7('0x11')](function(_0x4f26b9){if(_0x4f26b9){_0x874774[_0x57e7('0x5e')][_0x57e7('0x65')]=_0x4f26b9['id'];return db['Disposition']['create'](_0x874774[_0x57e7('0x5e')]);}})[_0x57e7('0x11')](respondWithResult(_0x3b00ca,null))[_0x57e7('0x1c')](handleError(_0x3b00ca,null));};exports['getDispositions']=function(_0x365326,_0x156c7c){var _0x326aab={'raw':![],'where':{}};var _0x1e56af={};var _0x2df050={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x365326['params']['id']}})['then'](handleEntityNotFound(_0x156c7c,null))[_0x57e7('0x11')](function(_0x5e44c5){if(_0x5e44c5){_0x1e56af['model']=_[_0x57e7('0x4c')](db['Disposition']['rawAttributes']);_0x1e56af[_0x57e7('0x52')]=_[_0x57e7('0x4c')](_0x365326[_0x57e7('0x52')]);_0x1e56af[_0x57e7('0x4d')]=_['intersection'](_0x1e56af['model'],_0x1e56af[_0x57e7('0x52')]);_0x326aab['attributes']=_['intersection'](_0x1e56af[_0x57e7('0x4f')],qs[_0x57e7('0x51')](_0x365326[_0x57e7('0x52')]['fields']));_0x326aab[_0x57e7('0x50')]=_0x326aab[_0x57e7('0x50')][_0x57e7('0x53')]?_0x326aab[_0x57e7('0x50')]:_0x1e56af[_0x57e7('0x4f')];if(!_0x365326['query'][_0x57e7('0x66')](_0x57e7('0x67'))){_0x326aab[_0x57e7('0x20')]=qs[_0x57e7('0x20')](_0x365326['query'][_0x57e7('0x20')]);_0x326aab['offset']=qs['offset'](_0x365326['query'][_0x57e7('0x23')]);}_0x326aab[_0x57e7('0x68')]=qs[_0x57e7('0x54')](_0x365326[_0x57e7('0x52')][_0x57e7('0x54')]);_0x326aab['where']=qs[_0x57e7('0x4d')](_[_0x57e7('0x55')](_0x365326[_0x57e7('0x52')],_0x1e56af[_0x57e7('0x4d')]));_0x326aab[_0x57e7('0x57')]['MailAccountId']=_0x5e44c5['id'];if(_0x365326[_0x57e7('0x52')][_0x57e7('0x56')]){_0x326aab[_0x57e7('0x57')]=_[_0x57e7('0x5c')](_0x326aab[_0x57e7('0x57')],{'$or':_['map'](_0x326aab[_0x57e7('0x50')],function(_0x531916){var _0x518ca0={};_0x518ca0[_0x531916]={'$like':'%'+_0x365326['query'][_0x57e7('0x56')]+'%'};return _0x518ca0;})});}_0x326aab=_['merge']({},_0x326aab,_0x365326[_0x57e7('0x69')]);return db[_0x57e7('0x6a')][_0x57e7('0x22')]({'where':_0x326aab[_0x57e7('0x57')]})['then'](function(_0x80de1e){_0x2df050['count']=_0x80de1e;if(_0x365326[_0x57e7('0x52')][_0x57e7('0x59')]){_0x326aab[_0x57e7('0x5a')]=[{'all':!![]}];}return db[_0x57e7('0x6a')][_0x57e7('0x6b')](_0x326aab);})['then'](function(_0x14ae14){_0x2df050['rows']=_0x14ae14;return _0x2df050;});}})[_0x57e7('0x11')](respondWithFilteredResult(_0x156c7c,_0x326aab))['catch'](handleError(_0x156c7c,null));};exports[_0x57e7('0x6c')]=function(_0x2341f2,_0x33631b){return db['MailAccount'][_0x57e7('0x5d')]({'where':{'id':_0x2341f2[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x33631b,null))[_0x57e7('0x11')](function(_0x52595a){if(_0x52595a){return _0x52595a['removeDispositions'](_0x2341f2[_0x57e7('0x52')][_0x57e7('0x6d')]);}})['then'](respondWithStatusCode(_0x33631b,null))[_0x57e7('0x1c')](handleError(_0x33631b,null));};exports[_0x57e7('0x6e')]=function(_0x115e47,_0x14b231){if(_0x115e47['body']['id']){delete _0x115e47[_0x57e7('0x5e')]['id'];}return db['MailAccount'][_0x57e7('0x5d')]({'where':{'id':_0x115e47[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x14b231,null))['then'](function(_0x40e7e4){if(_0x40e7e4){_0x115e47[_0x57e7('0x5e')][_0x57e7('0x65')]=_0x40e7e4['id'];return db[_0x57e7('0x6f')][_0x57e7('0x70')](_0x115e47['body']);}})['then'](respondWithResult(_0x14b231,null))[_0x57e7('0x1c')](handleError(_0x14b231,null));};exports[_0x57e7('0x71')]=function(_0x411a4f,_0x8e1190){var _0x504cce={'raw':![],'where':{}};var _0x4cc49d={};var _0x2addf0={'count':0x0,'rows':[]};return db[_0x57e7('0x47')][_0x57e7('0x72')]({'where':{'id':_0x411a4f[_0x57e7('0x64')]['id']}})['then'](handleEntityNotFound(_0x8e1190,null))[_0x57e7('0x11')](function(_0x4364d9){if(_0x4364d9){_0x4cc49d[_0x57e7('0x4f')]=_[_0x57e7('0x4c')](db[_0x57e7('0x6f')][_0x57e7('0x48')]);_0x4cc49d['query']=_['keys'](_0x411a4f[_0x57e7('0x52')]);_0x4cc49d[_0x57e7('0x4d')]=_[_0x57e7('0x4e')](_0x4cc49d[_0x57e7('0x4f')],_0x4cc49d[_0x57e7('0x52')]);_0x504cce[_0x57e7('0x50')]=_[_0x57e7('0x4e')](_0x4cc49d[_0x57e7('0x4f')],qs[_0x57e7('0x51')](_0x411a4f[_0x57e7('0x52')][_0x57e7('0x51')]));_0x504cce[_0x57e7('0x50')]=_0x504cce['attributes'][_0x57e7('0x53')]?_0x504cce[_0x57e7('0x50')]:_0x4cc49d[_0x57e7('0x4f')];if(!_0x411a4f['query']['hasOwnProperty'](_0x57e7('0x67'))){_0x504cce[_0x57e7('0x20')]=qs[_0x57e7('0x20')](_0x411a4f[_0x57e7('0x52')][_0x57e7('0x20')]);_0x504cce[_0x57e7('0x23')]=qs['offset'](_0x411a4f['query'][_0x57e7('0x23')]);}_0x504cce[_0x57e7('0x68')]=qs[_0x57e7('0x54')](_0x411a4f[_0x57e7('0x52')][_0x57e7('0x54')]);_0x504cce['where']=qs['filters'](_[_0x57e7('0x55')](_0x411a4f[_0x57e7('0x52')],_0x4cc49d[_0x57e7('0x4d')]));_0x504cce[_0x57e7('0x57')][_0x57e7('0x65')]=_0x4364d9['id'];if(_0x411a4f[_0x57e7('0x52')][_0x57e7('0x56')]){_0x504cce[_0x57e7('0x57')]=_[_0x57e7('0x5c')](_0x504cce[_0x57e7('0x57')],{'$or':_[_0x57e7('0x46')](_0x504cce[_0x57e7('0x50')],function(_0x4d87fa){var _0x4b286f={};_0x4b286f[_0x4d87fa]={'$like':'%'+_0x411a4f[_0x57e7('0x52')][_0x57e7('0x56')]+'%'};return _0x4b286f;})});}_0x504cce=_[_0x57e7('0x5c')]({},_0x504cce,_0x411a4f[_0x57e7('0x69')]);return db['CannedAnswer']['count']({'where':_0x504cce[_0x57e7('0x57')]})[_0x57e7('0x11')](function(_0x30cdb4){_0x2addf0['count']=_0x30cdb4;if(_0x411a4f[_0x57e7('0x52')][_0x57e7('0x59')]){_0x504cce[_0x57e7('0x5a')]=[{'all':!![]}];}return db[_0x57e7('0x6f')][_0x57e7('0x6b')](_0x504cce);})['then'](function(_0xa3ac8c){_0x2addf0[_0x57e7('0x73')]=_0xa3ac8c;return _0x2addf0;});}})[_0x57e7('0x11')](respondWithFilteredResult(_0x8e1190,_0x504cce))[_0x57e7('0x1c')](handleError(_0x8e1190,null));};exports[_0x57e7('0x74')]=function(_0x4f9ff6,_0x267814){return db[_0x57e7('0x47')][_0x57e7('0x5d')]({'where':{'id':_0x4f9ff6['params']['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x267814,null))[_0x57e7('0x11')](function(_0x1f5c86){if(_0x1f5c86){return _0x1f5c86[_0x57e7('0x74')](_0x4f9ff6['query'][_0x57e7('0x6d')]);}})[_0x57e7('0x11')](respondWithStatusCode(_0x267814,null))[_0x57e7('0x1c')](handleError(_0x267814,null));};exports[_0x57e7('0x70')]=function(_0xbc5b6d,_0x55e129){var _0x45662d={'name':_0xbc5b6d[_0x57e7('0x5e')][_0x57e7('0x29')],'key':_0xbc5b6d[_0x57e7('0x5e')]['key'],'provider':_0xbc5b6d[_0x57e7('0x5e')]['provider']==='custom'?null:_0xbc5b6d[_0x57e7('0x5e')][_0x57e7('0x60')],'email':_0xbc5b6d[_0x57e7('0x5e')][_0x57e7('0x75')],'ListId':_0xbc5b6d['body'][_0x57e7('0x76')],'active':!_['isNil'](_0xbc5b6d[_0x57e7('0x5e')][_0x57e7('0x77')])?_0xbc5b6d['body'][_0x57e7('0x77')]:!![],'description':_0xbc5b6d[_0x57e7('0x5e')]['description']||null};var _0x10862f=getAuthenticationOptions(_0x45662d[_0x57e7('0x60')],_0xbc5b6d[_0x57e7('0x5e')]);_0x45662d['Imap']=_0x10862f[_0x57e7('0x43')];_0x45662d[_0x57e7('0x40')]=_0x10862f[_0x57e7('0x40')];return db['MailAccount'][_0x57e7('0x70')](_0x45662d,{'include':[{'model':db[_0x57e7('0x44')],'as':_0x57e7('0x40')},{'model':db[_0x57e7('0x42')],'as':'Imap'}]})[_0x57e7('0x11')](function(_0x96b53d){var _0x365317=_0xbc5b6d[_0x57e7('0x35')][_0x57e7('0x26')]({'plain':!![]});if(!_0x365317)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x365317[_0x57e7('0x78')]==='user'){var _0x4cea72=_0x96b53d[_0x57e7('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x57e7('0x5d')]({'where':{'name':'MailAccounts','userProfileId':_0x365317[_0x57e7('0x79')]},'raw':!![]})['then'](function(_0xb3604e){if(_0xb3604e&&_0xb3604e['autoAssociation']===0x0){return db[_0x57e7('0x27')][_0x57e7('0x70')]({'name':_0x4cea72['name'],'resourceId':_0x4cea72['id'],'type':_0xb3604e[_0x57e7('0x29')],'sectionId':_0xb3604e['id']},{})['then'](function(){return _0x96b53d;});}else{return _0x96b53d;}})[_0x57e7('0x1c')](function(_0x5c27ba){logger[_0x57e7('0x17')](_0x57e7('0x7a'),_0x5c27ba);throw _0x5c27ba;});}return _0x96b53d;})[_0x57e7('0x11')](respondWithResult(_0x55e129,0xc9))[_0x57e7('0x1c')](handleError(_0x55e129,null));};exports['getImap']=function(_0x290be3,_0x400f8b){return db['MailAccount'][_0x57e7('0x72')]({'where':{'id':_0x290be3['params']['id']}})['then'](handleEntityNotFound(_0x400f8b,null))[_0x57e7('0x11')](function(_0x10998f){if(_0x10998f){return _0x10998f[_0x57e7('0x7b')]();}return null;})[_0x57e7('0x11')](respondWithResult(_0x400f8b,null))['catch'](handleError(_0x400f8b,null));};exports[_0x57e7('0x7c')]=function(_0x1b2aa6,_0x4fe1a6){if(_0x1b2aa6[_0x57e7('0x5e')]['id']){delete _0x1b2aa6[_0x57e7('0x5e')]['id'];}return db[_0x57e7('0x47')][_0x57e7('0x5d')]({'where':{'id':_0x1b2aa6[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x4fe1a6,null))['then'](function(_0x3a01c7){if(_0x3a01c7){_0x1b2aa6[_0x57e7('0x5e')]['MailAccountId']=_0x3a01c7['id'];return db[_0x57e7('0x42')][_0x57e7('0x70')](_0x1b2aa6[_0x57e7('0x5e')]);}})[_0x57e7('0x11')](respondWithResult(_0x4fe1a6,null))[_0x57e7('0x1c')](handleError(_0x4fe1a6,null));};exports['removeImap']=function(_0x59befe,_0x3bc6b2){return db['MailAccount']['findOne']({'where':{'id':_0x59befe['params']['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x3bc6b2,null))[_0x57e7('0x11')](function(_0x3f2aa6){if(_0x3f2aa6){return _0x3f2aa6[_0x57e7('0x7d')](null);}return null;})[_0x57e7('0x11')](respondWithStatusCode(_0x3bc6b2,null))[_0x57e7('0x1c')](handleError(_0x3bc6b2,null));};exports[_0x57e7('0x7e')]=function(_0x1a45e4,_0x38b2c9){return db[_0x57e7('0x47')][_0x57e7('0x72')]({'where':{'id':_0x1a45e4[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x38b2c9,null))[_0x57e7('0x11')](function(_0x4ffd45){if(_0x4ffd45){return _0x4ffd45[_0x57e7('0x7e')]();}return null;})[_0x57e7('0x11')](respondWithResult(_0x38b2c9,null))[_0x57e7('0x1c')](handleError(_0x38b2c9,null));};exports[_0x57e7('0x7f')]=function(_0x2f653b,_0x1324f5){if(_0x2f653b['body']['id']){delete _0x2f653b[_0x57e7('0x5e')]['id'];}return db[_0x57e7('0x47')][_0x57e7('0x5d')]({'where':{'id':_0x2f653b[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x1324f5,null))['then'](function(_0x3e761c){if(_0x3e761c){_0x2f653b[_0x57e7('0x5e')][_0x57e7('0x65')]=_0x3e761c['id'];return db['MailServerOut'][_0x57e7('0x70')](_0x2f653b[_0x57e7('0x5e')]);}})[_0x57e7('0x11')](respondWithResult(_0x1324f5,null))['catch'](handleError(_0x1324f5,null));};exports[_0x57e7('0x80')]=function(_0x46c016,_0x307538){return db[_0x57e7('0x47')][_0x57e7('0x72')]({'where':{'id':_0x46c016[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x307538,null))[_0x57e7('0x11')](function(_0x487db0){if(_0x487db0){return _0x487db0['setSmtp'](null);}return null;})[_0x57e7('0x11')](respondWithStatusCode(_0x307538,null))[_0x57e7('0x1c')](handleError(_0x307538,null));};exports[_0x57e7('0x81')]=function(_0x5cdafc,_0x475a72){return db[_0x57e7('0x82')][_0x57e7('0x5d')]({'where':{'id':_0x5cdafc[_0x57e7('0x64')]['id']}})['then'](handleEntityNotFound(_0x475a72,null))['then'](function(_0x2f0a13){if(_0x2f0a13){return _0x2f0a13[_0x57e7('0x81')](_0x5cdafc[_0x57e7('0x5e')]['ids'],_[_0x57e7('0x83')](_0x5cdafc[_0x57e7('0x5e')],[_0x57e7('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x475a72,null))[_0x57e7('0x1c')](handleError(_0x475a72,null));};exports[_0x57e7('0x84')]=function(_0x1a887e,_0x15834d){var _0x505eb4={'raw':![],'where':{}};var _0x398741={};var _0x35fae2={'count':0x0,'rows':[]};return db['MailAccount'][_0x57e7('0x72')]({'where':{'id':_0x1a887e[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x15834d,null))[_0x57e7('0x11')](function(_0x2082ca){if(_0x2082ca){_0x398741[_0x57e7('0x4f')]=_[_0x57e7('0x4c')](db[_0x57e7('0x82')]['rawAttributes']);_0x398741[_0x57e7('0x52')]=_[_0x57e7('0x4c')](_0x1a887e[_0x57e7('0x52')]);_0x398741[_0x57e7('0x4d')]=_[_0x57e7('0x4e')](_0x398741['model'],_0x398741['query']);_0x505eb4[_0x57e7('0x50')]=_['intersection'](_0x398741[_0x57e7('0x4f')],qs[_0x57e7('0x51')](_0x1a887e[_0x57e7('0x52')][_0x57e7('0x51')]));_0x505eb4[_0x57e7('0x50')]=_0x505eb4['attributes'][_0x57e7('0x53')]?_0x505eb4['attributes']:_0x398741['model'];if(!_0x1a887e['query'][_0x57e7('0x66')](_0x57e7('0x67'))){_0x505eb4[_0x57e7('0x20')]=qs[_0x57e7('0x20')](_0x1a887e[_0x57e7('0x52')]['limit']);_0x505eb4[_0x57e7('0x23')]=qs[_0x57e7('0x23')](_0x1a887e[_0x57e7('0x52')][_0x57e7('0x23')]);}_0x505eb4['order']=qs[_0x57e7('0x54')](_0x1a887e['query'][_0x57e7('0x54')]);_0x505eb4['where']=qs[_0x57e7('0x4d')](_['pick'](_0x1a887e[_0x57e7('0x52')],_0x398741[_0x57e7('0x4d')]));_0x505eb4[_0x57e7('0x57')][_0x57e7('0x65')]=_0x2082ca['id'];if(_0x1a887e[_0x57e7('0x52')]['filter']){_0x505eb4[_0x57e7('0x57')]=_[_0x57e7('0x5c')](_0x505eb4[_0x57e7('0x57')],{'$or':_['map'](_0x505eb4['attributes'],function(_0x1e9246){var _0x532550={};_0x532550[_0x1e9246]={'$like':'%'+_0x1a887e[_0x57e7('0x52')][_0x57e7('0x56')]+'%'};return _0x532550;})});}_0x505eb4=_[_0x57e7('0x5c')]({},_0x505eb4,_0x1a887e[_0x57e7('0x69')]);return db['MailInteraction'][_0x57e7('0x22')]({'where':_0x505eb4[_0x57e7('0x57')]})[_0x57e7('0x11')](function(_0x478a2d){_0x35fae2[_0x57e7('0x22')]=_0x478a2d;if(_0x1a887e[_0x57e7('0x52')]['includeAll']){_0x505eb4[_0x57e7('0x5a')]=[{'model':db[_0x57e7('0x85')],'as':_0x57e7('0x86'),'required':![]},{'model':db[_0x57e7('0x87')],'as':'Owner','attributes':[_0x57e7('0x29'),'fullname',_0x57e7('0x88')],'required':![]},{'model':db[_0x57e7('0x89')],'as':_0x57e7('0x8a'),'attributes':['id','name','color'],'where':_0x1a887e[_0x57e7('0x52')][_0x57e7('0x8b')]?{'id':_0x1a887e['query'][_0x57e7('0x8b')]}:undefined,'required':_0x1a887e[_0x57e7('0x52')][_0x57e7('0x8b')]?!![]:![]}];}return db[_0x57e7('0x82')]['findAll'](_0x505eb4);})[_0x57e7('0x11')](function(_0xd9edd4){_0x35fae2[_0x57e7('0x73')]=_0xd9edd4;return _0x35fae2;});}})['then'](respondWithFilteredResult(_0x15834d,_0x505eb4))[_0x57e7('0x1c')](handleError(_0x15834d,null));};exports[_0x57e7('0x8c')]=function addApplications(_0x2a7962,_0x515ace){var _0xbdd8d1=_0x2a7962[_0x57e7('0x64')]['id'];var _0x2b5181=_0x2a7962[_0x57e7('0x5e')];var _0x2ff18a=0xc8;var _0x5988ab=null;return db['sequelize'][_0x57e7('0x8d')]({'isolationLevel':db[_0x57e7('0x8e')][_0x57e7('0x8f')][_0x57e7('0x90')][_0x57e7('0x91')]},function(_0x19e02a){return db[_0x57e7('0x47')][_0x57e7('0x72')]({'where':{'id':_0xbdd8d1},'transaction':_0x19e02a})['then'](function(_0x18a34b){if(_0x18a34b){return db[_0x57e7('0x92')][_0x57e7('0x25')]({'where':{'MailAccountId':_0xbdd8d1},'transaction':_0x19e02a})[_0x57e7('0x11')](function(){var _0x2c66ff=_['map'](_0x2b5181,function(_0x425a37){_0x425a37[_0x57e7('0x65')]=_0xbdd8d1;return _0x425a37;});return db[_0x57e7('0x92')][_0x57e7('0x93')](_0x2c66ff,{'transaction':_0x19e02a});});}else{_0x2ff18a=0x194;_0x5988ab=[];}});})['then'](function(){if(_0x2ff18a!==0x194){return db[_0x57e7('0x92')][_0x57e7('0x94')]({'where':{'MailAccountId':_0xbdd8d1},'order':_0x57e7('0x95')})[_0x57e7('0x11')](function(_0x5eabff){_0x5988ab=_0x5eabff;});}})[_0x57e7('0x1c')](function(_0x602cfe){_0x2ff18a=0x1f4;logger[_0x57e7('0x17')](_0x602cfe[_0x57e7('0x28')]);if(_0x602cfe[_0x57e7('0x29')]){delete _0x602cfe[_0x57e7('0x29')];}_0x5988ab=_0x602cfe;})[_0x57e7('0x96')](function(){if(_0x5988ab===null){_0x515ace[_0x57e7('0x1d')](_0x2ff18a);}else{if(_0x2ff18a===0x1f4){_0x515ace['status'](_0x2ff18a)[_0x57e7('0x2a')](_0x5988ab);}else{_0x515ace['status'](_0x2ff18a)['json'](_0x5988ab);}}});};exports[_0x57e7('0x97')]=function(_0x2b617a,_0x22f6cb){var _0x50d815={};var _0x426421={};var _0x20f9be;var _0x317e50;return db['MailAccount'][_0x57e7('0x72')]({'where':{'id':_0x2b617a[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x22f6cb,null))[_0x57e7('0x11')](function(_0x340afd){if(_0x340afd){_0x20f9be=_0x340afd;_0x426421[_0x57e7('0x4f')]=_[_0x57e7('0x4c')](db[_0x57e7('0x92')][_0x57e7('0x48')]);_0x426421[_0x57e7('0x52')]=_['keys'](_0x2b617a[_0x57e7('0x52')]);_0x426421[_0x57e7('0x4d')]=_[_0x57e7('0x4e')](_0x426421[_0x57e7('0x4f')],_0x426421[_0x57e7('0x52')]);_0x50d815[_0x57e7('0x50')]=_[_0x57e7('0x4e')](_0x426421[_0x57e7('0x4f')],qs[_0x57e7('0x51')](_0x2b617a[_0x57e7('0x52')][_0x57e7('0x51')]));_0x50d815[_0x57e7('0x50')]=_0x50d815[_0x57e7('0x50')][_0x57e7('0x53')]?_0x50d815[_0x57e7('0x50')]:_0x426421['model'];_0x50d815[_0x57e7('0x68')]=qs[_0x57e7('0x54')](_0x2b617a[_0x57e7('0x52')][_0x57e7('0x54')]);_0x50d815[_0x57e7('0x57')]=qs[_0x57e7('0x4d')](_[_0x57e7('0x55')](_0x2b617a[_0x57e7('0x52')],_0x426421[_0x57e7('0x4d')]));if(_0x2b617a[_0x57e7('0x52')][_0x57e7('0x56')]){_0x50d815[_0x57e7('0x57')]=_['merge'](_0x50d815[_0x57e7('0x57')],{'$or':_[_0x57e7('0x46')](_0x50d815[_0x57e7('0x50')],function(_0x55dd2b){var _0x232cb3={};_0x232cb3[_0x55dd2b]={'$like':'%'+_0x2b617a[_0x57e7('0x52')][_0x57e7('0x56')]+'%'};return _0x232cb3;})});}_0x50d815=_[_0x57e7('0x5c')]({},_0x50d815,_0x2b617a[_0x57e7('0x69')]);return _0x20f9be['getApplications'](_0x50d815);}})[_0x57e7('0x11')](function(_0x1b4cb2){if(_0x1b4cb2){_0x317e50=_0x1b4cb2['length'];if(!_0x2b617a['query'][_0x57e7('0x66')](_0x57e7('0x67'))){_0x50d815['limit']=qs[_0x57e7('0x20')](_0x2b617a[_0x57e7('0x52')]['limit']);_0x50d815[_0x57e7('0x23')]=qs[_0x57e7('0x23')](_0x2b617a['query'][_0x57e7('0x23')]);}return _0x20f9be['getApplications'](_0x50d815);}})['then'](function(_0x856e5c){if(_0x856e5c){return _0x856e5c?{'count':_0x317e50,'rows':_0x856e5c}:null;}})['then'](respondWithResult(_0x22f6cb,null))[_0x57e7('0x1c')](handleError(_0x22f6cb,null));};exports[_0x57e7('0x98')]=function(_0x4237ee,_0x1be9ed){var _0x3b2c96={'raw':!![],'where':{}};var _0x5162be={};var _0x192380={'count':0x0,'rows':[]};return db[_0x57e7('0x47')][_0x57e7('0x72')]({'where':{'id':_0x4237ee[_0x57e7('0x64')]['id']}})['then'](handleEntityNotFound(_0x1be9ed,null))[_0x57e7('0x11')](function(_0x50d1e2){if(_0x50d1e2){_0x5162be[_0x57e7('0x4f')]=_['keys'](db['MailMessage'][_0x57e7('0x48')]);_0x5162be[_0x57e7('0x52')]=_['keys'](_0x4237ee[_0x57e7('0x52')]);_0x5162be[_0x57e7('0x4d')]=_[_0x57e7('0x4e')](_0x5162be[_0x57e7('0x4f')],_0x5162be[_0x57e7('0x52')]);_0x3b2c96[_0x57e7('0x50')]=_[_0x57e7('0x4e')](_0x5162be['model'],qs[_0x57e7('0x51')](_0x4237ee[_0x57e7('0x52')][_0x57e7('0x51')]));_0x3b2c96[_0x57e7('0x50')]=_0x3b2c96['attributes'][_0x57e7('0x53')]?_0x3b2c96['attributes']:_0x5162be[_0x57e7('0x4f')];if(!_0x4237ee['query']['hasOwnProperty'](_0x57e7('0x67'))){_0x3b2c96['limit']=qs[_0x57e7('0x20')](_0x4237ee[_0x57e7('0x52')][_0x57e7('0x20')]);_0x3b2c96[_0x57e7('0x23')]=qs[_0x57e7('0x23')](_0x4237ee[_0x57e7('0x52')]['offset']);}_0x3b2c96[_0x57e7('0x68')]=qs[_0x57e7('0x54')](_0x4237ee['query'][_0x57e7('0x54')]);_0x3b2c96['where']=qs['filters'](_[_0x57e7('0x55')](_0x4237ee[_0x57e7('0x52')],_0x5162be[_0x57e7('0x4d')]));_0x3b2c96['where']['MailAccountId']=_0x50d1e2['id'];if(_0x4237ee[_0x57e7('0x52')][_0x57e7('0x56')]){_0x3b2c96['where']=_[_0x57e7('0x5c')](_0x3b2c96[_0x57e7('0x57')],{'$or':_[_0x57e7('0x46')](_0x3b2c96[_0x57e7('0x50')],function(_0x4cdca5){var _0xdb40d9={};_0xdb40d9[_0x4cdca5]={'$like':'%'+_0x4237ee[_0x57e7('0x52')]['filter']+'%'};return _0xdb40d9;})});}if(_0x4237ee[_0x57e7('0x52')]['$gte']){var _0x5b3800=_0x4237ee[_0x57e7('0x52')][_0x57e7('0x99')][_0x57e7('0x9a')](',');var _0x1c9b6f={};_0x1c9b6f[_0x5b3800[0x0]]={'$gte':moment(_0x5b3800[0x1])['format'](_0x57e7('0x9b'))};_0x3b2c96[_0x57e7('0x57')]=_['merge'](_0x3b2c96[_0x57e7('0x57')],_0x1c9b6f);}_0x3b2c96=_[_0x57e7('0x5c')]({},_0x3b2c96,_0x4237ee[_0x57e7('0x69')]);return db[_0x57e7('0x9c')][_0x57e7('0x22')]({'where':_0x3b2c96[_0x57e7('0x57')]})['then'](function(_0x4248a5){_0x192380[_0x57e7('0x22')]=_0x4248a5;if(_0x4237ee['query'][_0x57e7('0x59')]){_0x3b2c96[_0x57e7('0x5a')]=[{'all':!![]}];}return db[_0x57e7('0x9c')][_0x57e7('0x6b')](_0x3b2c96);})['then'](function(_0x1a2acc){if(_0x4237ee[_0x57e7('0x52')][_0x57e7('0x9d')]===_0x57e7('0x9e')){for(var _0x2d9461=0x0;_0x2d9461<_0x1a2acc['length'];_0x2d9461++){_0x1a2acc[_0x2d9461][_0x57e7('0x5e')]=juice(_0x1a2acc[_0x2d9461][_0x57e7('0x5e')]);}}_0x192380['rows']=_0x1a2acc;return _0x192380;});}})[_0x57e7('0x11')](respondWithFilteredResult(_0x1be9ed,_0x3b2c96))['catch'](handleError(_0x1be9ed,null));};exports['send']=function(_0xf6cd9f,_0x325701){var _0x30c438,_0x2c1b3c={},_0x51a234;if(_0xf6cd9f[_0x57e7('0x5e')]['to']){_0x51a234=_0xf6cd9f[_0x57e7('0x5e')]['to']['split'](',')[0x0];}return db[_0x57e7('0x47')][_0x57e7('0x5d')]({'where':{'id':_0xf6cd9f[_0x57e7('0x64')]['id']},'include':[{'model':db[_0x57e7('0x9f')],'as':'List','include':[{'model':db[_0x57e7('0x85')],'as':'Contacts','where':{'email':_0x51a234},'limit':0x1,'order':[[_0x57e7('0xa0'),_0x57e7('0xa1')]]}]},{'model':db[_0x57e7('0x44')],'as':_0x57e7('0x40'),'raw':!![],'include':[{'model':db[_0x57e7('0xa2')],'as':_0x57e7('0xa2'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x325701,null))['then'](function(_0x26a4bc){if(!_0x26a4bc)return;_0x30c438=_0x26a4bc;if(!_0x26a4bc[_0x57e7('0x40')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x57e7('0xa3')](_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xa4')])){_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xa4')]=util['format']('%s\x20<%s>',_0x26a4bc[_0x57e7('0x29')],_0x26a4bc[_0x57e7('0x75')]||_0x26a4bc[_0x57e7('0x40')][_0x57e7('0x35')]);}if(_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xa5')]&&_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xa5')][_0x57e7('0x53')]){for(var _0x43a625=0x0;_0x43a625<_0xf6cd9f[_0x57e7('0x5e')]['attachments'][_0x57e7('0x53')];_0x43a625+=0x1){_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xa5')][_0x43a625]={'filename':_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xa5')][_0x43a625][_0x57e7('0x29')],'path':path['join'](config['root'],_0x57e7('0xa6'),_0xf6cd9f['body']['attachments'][_0x43a625][_0x57e7('0xa7')])};}}var _0x5e0c09=_0x26a4bc['getSmtpOptions']();return respondWithRpcPromise(_0x57e7('0xa8'),_0x57e7('0xa9'),{'account':_0x5e0c09,'message':_0xf6cd9f[_0x57e7('0x5e')]});})[_0x57e7('0x11')](function(_0x6ffd38){if(!_0x6ffd38)return;_0x2c1b3c=_0x6ffd38;if(!_0x30c438[_0x57e7('0xaa')])throw new Error(_0x57e7('0xab'));if(_0x30c438[_0x57e7('0xaa')][_0x57e7('0xac')]['length'])return _0x30c438[_0x57e7('0xaa')][_0x57e7('0xac')][0x0];return db[_0x57e7('0x85')][_0x57e7('0x70')](_[_0x57e7('0xb')](_0xf6cd9f[_0x57e7('0x5e')],{'firstName':_0xf6cd9f[_0x57e7('0x5e')]['to'],'email':_0xf6cd9f[_0x57e7('0x5e')]['to'],'phone':_0xf6cd9f['body']['to'],'ListId':_0x30c438['ListId']}));})[_0x57e7('0x11')](function(_0x35ca82){if(!_0x35ca82)return;var _0x139ab9={'UserId':_0xf6cd9f[_0x57e7('0x35')]['id'],'ContactId':_0x35ca82['id'],'MailAccountId':_0x30c438['id'],'inReplyTo':_0x2c1b3c[_0x57e7('0xad')],'to':_0xf6cd9f[_0x57e7('0x5e')]['from'],'cc':_0xf6cd9f[_0x57e7('0x5e')]['cc'],'subject':_0xf6cd9f[_0x57e7('0x5e')]['subject'],'attach':_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xae')],'firstMsgDirection':_0x57e7('0xaf'),'lastMsgAt':moment()[_0x57e7('0xb0')](_0x57e7('0x9b')),'lastMsgDirection':'out','Messages':[_[_0x57e7('0x5c')](_0xf6cd9f[_0x57e7('0x5e')],{'messageId':_0x2c1b3c[_0x57e7('0xad')],'sentAt':moment()[_0x57e7('0xb0')](_0x57e7('0x9b')),'read':!![],'MailAccountId':_0x30c438['id'],'UserId':_0xf6cd9f[_0x57e7('0x35')]['id'],'ContactId':_0x35ca82['id']})]};if(_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xb1')]){_0x139ab9=_[_0x57e7('0x5c')](_0x139ab9,_0xf6cd9f[_0x57e7('0x5e')][_0x57e7('0xb1')]);}return db[_0x57e7('0x82')][_0x57e7('0x70')](_0x139ab9,{'include':[{'model':db[_0x57e7('0x9c')],'as':'Messages'}]});})[_0x57e7('0x11')](respondWithResult(_0x325701,null))[_0x57e7('0x1c')](handleError(_0x325701,null));};exports['verifySmtp']=function(_0x53bc39,_0x2ba68a){return db['MailAccount'][_0x57e7('0x5d')]({'where':{'id':_0x53bc39[_0x57e7('0x64')]['id']},'include':[{'model':db[_0x57e7('0x44')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x57e7('0xa2')],'as':_0x57e7('0xa2'),'raw':!![]}]}]})[_0x57e7('0x11')](handleEntityNotFound(_0x2ba68a,null))[_0x57e7('0x11')](function(_0x349176){if(!_0x349176['Smtp'])return;var _0x122ffe=_0x349176[_0x57e7('0xb2')]();return respondWithRpcPromise(_0x57e7('0xb3'),_0x57e7('0xb4'),{'account':_0x122ffe});})[_0x57e7('0x11')](respondWithResult(_0x2ba68a,null))['catch'](handleError(_0x2ba68a,null));};exports[_0x57e7('0x25')]=function(_0x27d185,_0x4fe2ee){return db['MailAccount'][_0x57e7('0x5d')]({'where':{'id':_0x27d185[_0x57e7('0x64')]['id']}})['then'](handleEntityNotFound(_0x4fe2ee,null))[_0x57e7('0x11')](function(_0x51ca0c){if(_0x51ca0c&&_0x51ca0c['service']){throw new db[(_0x57e7('0xb5'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x51ca0c;})[_0x57e7('0x11')](removeEntity(_0x4fe2ee,null))[_0x57e7('0x1c')](handleError(_0x4fe2ee,null));};exports['addAgents']=function(_0x12b6f0,_0xcc3ea3){return db['MailAccount'][_0x57e7('0x5d')]({'where':{'id':_0x12b6f0['params']['id']}})['then'](handleEntityNotFound(_0xcc3ea3,null))[_0x57e7('0x11')](function(_0x54607f){if(_0x54607f){return _0x54607f[_0x57e7('0xb6')](_0x12b6f0[_0x57e7('0x5e')][_0x57e7('0x6d')],_['omit'](_0x12b6f0[_0x57e7('0x5e')],['ids','id'])||{})[_0x57e7('0xb7')](function(_0x40edab){for(var _0x531ada=0x0;_0x531ada<_0x12b6f0[_0x57e7('0x5e')][_0x57e7('0x6d')][_0x57e7('0x53')];_0x531ada+=0x1){socket[_0x57e7('0xb8')](_0x57e7('0xb9'),{'UserId':Number(_0x12b6f0['body'][_0x57e7('0x6d')][_0x531ada]),'MailAccountId':Number(_0x12b6f0['params']['id'])});}return _0x40edab;});}})[_0x57e7('0x11')](respondWithResult(_0xcc3ea3,null))['catch'](handleError(_0xcc3ea3,null));};exports[_0x57e7('0xba')]=function(_0x562015,_0x3dcbd1){return db[_0x57e7('0x47')][_0x57e7('0x5d')]({'where':{'id':_0x562015['params']['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x3dcbd1,null))[_0x57e7('0x11')](function(_0x4e245d){if(_0x4e245d){return _0x4e245d[_0x57e7('0xba')](_0x562015[_0x57e7('0x52')][_0x57e7('0x6d')])[_0x57e7('0x11')](function(){if(_[_0x57e7('0xbb')](_0x562015[_0x57e7('0x52')][_0x57e7('0x6d')])){for(var _0x22bb6c=0x0;_0x22bb6c<_0x562015['query']['ids'][_0x57e7('0x53')];_0x22bb6c+=0x1){socket['emit'](_0x57e7('0xbc'),{'UserId':Number(_0x562015[_0x57e7('0x52')][_0x57e7('0x6d')][_0x22bb6c]),'MailAccountId':Number(_0x562015[_0x57e7('0x64')]['id'])});}}else{socket['emit'](_0x57e7('0xbc'),{'UserId':Number(_0x562015[_0x57e7('0x52')]['ids']),'MailAccountId':Number(_0x562015[_0x57e7('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x3dcbd1,null))[_0x57e7('0x1c')](handleError(_0x3dcbd1,null));};exports['getAgents']=function(_0x3b045b,_0x25570f){var _0x44b938={};var _0x20b501={};var _0x5685d5;var _0x4bd1f5;return db['MailAccount'][_0x57e7('0x72')]({'where':{'id':_0x3b045b[_0x57e7('0x64')]['id']}})[_0x57e7('0x11')](handleEntityNotFound(_0x25570f,null))[_0x57e7('0x11')](function(_0xb075b2){if(_0xb075b2){_0x5685d5=_0xb075b2;_0x20b501[_0x57e7('0x4f')]=_[_0x57e7('0x4c')](db[_0x57e7('0x87')]['rawAttributes']);_0x20b501[_0x57e7('0x52')]=_[_0x57e7('0x4c')](_0x3b045b['query']);_0x20b501[_0x57e7('0x4d')]=_[_0x57e7('0x4e')](_0x20b501[_0x57e7('0x4f')],_0x20b501[_0x57e7('0x52')]);_0x44b938[_0x57e7('0x50')]=_[_0x57e7('0x4e')](_0x20b501[_0x57e7('0x4f')],qs[_0x57e7('0x51')](_0x3b045b[_0x57e7('0x52')]['fields']));_0x44b938[_0x57e7('0x50')]=_0x44b938[_0x57e7('0x50')][_0x57e7('0x53')]?_0x44b938['attributes']:_0x20b501[_0x57e7('0x4f')];_0x44b938[_0x57e7('0x68')]=qs[_0x57e7('0x54')](_0x3b045b['query'][_0x57e7('0x54')]);_0x44b938[_0x57e7('0x57')]=qs[_0x57e7('0x4d')](_['pick'](_0x3b045b['query'],_0x20b501[_0x57e7('0x4d')]));if(_0x3b045b[_0x57e7('0x52')][_0x57e7('0x56')]){_0x44b938[_0x57e7('0x57')]=_[_0x57e7('0x5c')](_0x44b938[_0x57e7('0x57')],{'$or':_['map'](_0x44b938[_0x57e7('0x50')],function(_0x15f564){var _0x24fa98={};_0x24fa98[_0x15f564]={'$like':'%'+_0x3b045b['query'][_0x57e7('0x56')]+'%'};return _0x24fa98;})});}_0x44b938=_[_0x57e7('0x5c')]({},_0x44b938,_0x3b045b['options']);return _0x5685d5[_0x57e7('0xbd')](_0x44b938);}})[_0x57e7('0x11')](function(_0xe0ff1f){if(_0xe0ff1f){_0x4bd1f5=_0xe0ff1f['length'];if(!_0x3b045b[_0x57e7('0x52')]['hasOwnProperty'](_0x57e7('0x67'))){_0x44b938[_0x57e7('0x20')]=qs[_0x57e7('0x20')](_0x3b045b['query']['limit']);_0x44b938['offset']=qs[_0x57e7('0x23')](_0x3b045b[_0x57e7('0x52')][_0x57e7('0x23')]);}return _0x5685d5[_0x57e7('0xbd')](_0x44b938);}})[_0x57e7('0x11')](function(_0xc18cbf){if(_0xc18cbf){return _0xc18cbf?{'count':_0x4bd1f5,'rows':_0xc18cbf}:null;}})['then'](respondWithResult(_0x25570f,null))[_0x57e7('0x1c')](handleError(_0x25570f,null));}; \ No newline at end of file +var _0x9c25=['stack','name','send','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','body','provider','find','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','custom','description','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','getSmtpOptions','List\x20not\x20found','ListId','messageId','attach','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','path','lodash','juice','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9c25,0x163));var _0x59c2=function(_0x81dade,_0x214864){_0x81dade=_0x81dade-0x0;var _0x3b7224=_0x9c25[_0x81dade];return _0x3b7224;};'use strict';var moment=require('moment');var BPromise=require(_0x59c2('0x0'));var util=require('util');var path=require(_0x59c2('0x1'));var _=require(_0x59c2('0x2'));var juice=require(_0x59c2('0x3'));var Redis=require(_0x59c2('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x59c2('0x5'))('api');var config=require(_0x59c2('0x6'));var db=require(_0x59c2('0x7'))['db'];config[_0x59c2('0x8')]=_[_0x59c2('0x9')](config[_0x59c2('0x8')],{'host':_0x59c2('0xa'),'port':0x18eb});var socket=require(_0x59c2('0xb'))(new Redis(config[_0x59c2('0x8')]));require(_0x59c2('0xc'))[_0x59c2('0xd')](socket);var jayson=require(_0x59c2('0xe'));var client=jayson[_0x59c2('0xf')][_0x59c2('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x2b8bd8,_0x2c9b3f,_0x2c5707,_0x2e6426){return new BPromise(function(_0x1b62db,_0x36f9f9){var _0x5adaaf=_0x2e6426||client;return _0x5adaaf[_0x59c2('0x11')](_0x2b8bd8,_0x2c5707)[_0x59c2('0x12')](function(_0x44917f){logger['info'](_0x59c2('0x13'),_0x2c9b3f,_0x59c2('0x14'));logger[_0x59c2('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2c9b3f,'request\x20sent',JSON['stringify'](_0x44917f));if(_0x44917f[_0x59c2('0x16')]){if(_0x44917f[_0x59c2('0x16')][_0x59c2('0x17')]===0x1f4){logger[_0x59c2('0x16')]('MailAccount,\x20%s,\x20%s',_0x2c9b3f,_0x44917f[_0x59c2('0x16')][_0x59c2('0x18')]);return _0x36f9f9(_0x44917f['error'][_0x59c2('0x18')]);}logger[_0x59c2('0x16')](_0x59c2('0x13'),_0x2c9b3f,_0x44917f[_0x59c2('0x16')][_0x59c2('0x18')]);return _0x1b62db(_0x44917f[_0x59c2('0x16')][_0x59c2('0x18')]);}else{logger[_0x59c2('0x19')](_0x59c2('0x13'),_0x2c9b3f,_0x59c2('0x14'));_0x1b62db(_0x44917f[_0x59c2('0x1a')][_0x59c2('0x18')]);}})[_0x59c2('0x1b')](function(_0x10c184){logger['error'](_0x59c2('0x13'),_0x2c9b3f,_0x10c184);_0x36f9f9(_0x10c184);});});}function respondWithStatusCode(_0x3a9292,_0xf7a986){_0xf7a986=_0xf7a986||0xcc;return function(_0x4ccb05){if(_0x4ccb05){return _0x3a9292[_0x59c2('0x1c')](_0xf7a986);}return _0x3a9292[_0x59c2('0x1d')](_0xf7a986)[_0x59c2('0x1e')]();};}function respondWithResult(_0x523b58,_0xe4aa0b){_0xe4aa0b=_0xe4aa0b||0xc8;return function(_0x4618f8){if(_0x4618f8){return _0x523b58[_0x59c2('0x1d')](_0xe4aa0b)[_0x59c2('0x1f')](_0x4618f8);}};}function respondWithFilteredResult(_0x23e609,_0x55fb4e){return function(_0x5c5754){if(_0x5c5754){var _0x282d9a=typeof _0x55fb4e[_0x59c2('0x20')]===_0x59c2('0x21')&&typeof _0x55fb4e[_0x59c2('0x22')]===_0x59c2('0x21');var _0x523250=_0x5c5754[_0x59c2('0x23')];var _0x25a071=_0x282d9a?0x0:_0x55fb4e['offset'];var _0xc8c08e=_0x282d9a?_0x5c5754[_0x59c2('0x23')]:_0x55fb4e[_0x59c2('0x20')]+_0x55fb4e[_0x59c2('0x22')];var _0x3bbb56;if(_0xc8c08e>=_0x523250){_0xc8c08e=_0x523250;_0x3bbb56=0xc8;}else{_0x3bbb56=0xce;}_0x23e609[_0x59c2('0x1d')](_0x3bbb56);return _0x23e609[_0x59c2('0x24')](_0x59c2('0x25'),_0x25a071+'-'+_0xc8c08e+'/'+_0x523250)['json'](_0x5c5754);}return null;};}function saveUpdates(_0x2f8a0c){return function(_0x138c29){if(_0x138c29){return _0x138c29[_0x59c2('0x26')](_0x2f8a0c)[_0x59c2('0x12')](function(_0x32e32c){return _0x32e32c;});}return null;};}function removeEntity(_0x5f02d1){return function(_0x196585){if(_0x196585){return _0x196585[_0x59c2('0x27')]()[_0x59c2('0x12')](function(){var _0x5e893a=_0x196585[_0x59c2('0x28')]({'plain':!![]});var _0x196b74=_0x59c2('0x29');return db[_0x59c2('0x2a')][_0x59c2('0x27')]({'where':{'type':_0x196b74,'resourceId':_0x5e893a['id']}})[_0x59c2('0x12')](function(){return _0x196585;});})[_0x59c2('0x12')](function(){_0x5f02d1['status'](0xcc)[_0x59c2('0x1e')]();});}};}function handleEntityNotFound(_0xa4aa8e){return function(_0x445007){if(!_0x445007){_0xa4aa8e['sendStatus'](0x194);}return _0x445007;};}function handleError(_0x381619,_0x33a58d){_0x33a58d=_0x33a58d||0x1f4;return function(_0x17f39b){logger[_0x59c2('0x16')](_0x17f39b[_0x59c2('0x2b')]);if(_0x17f39b['name']){delete _0x17f39b[_0x59c2('0x2c')];}_0x381619['status'](_0x33a58d)[_0x59c2('0x2d')](_0x17f39b);};}function getImapHost(_0x21e4dc){switch(_0x21e4dc){case _0x59c2('0x2e'):return'imap.gmail.com';case _0x59c2('0x2f'):return'imap.mail.yahoo.com';case _0x59c2('0x30'):return _0x59c2('0x31');case _0x59c2('0x32'):return _0x59c2('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0x21e4dc);}function getSmtpHost(_0x512a8a){switch(_0x512a8a){case'gmail':return _0x59c2('0x34');case _0x59c2('0x2f'):return _0x59c2('0x35');case _0x59c2('0x30'):return'smtp-mail.outlook.com';case _0x59c2('0x32'):return _0x59c2('0x36');}throw new Error(_0x59c2('0x37'),_0x512a8a);}function getAuthenticationOptions(_0x29af34,_0x3bdb38){var _0x8d0ab9={};var _0x1dda7e={};if(_0x29af34){_0x8d0ab9[_0x59c2('0x38')]=_0x1dda7e[_0x59c2('0x38')]=_0x3bdb38[_0x59c2('0x39')];_0x8d0ab9[_0x59c2('0x3a')]=_0x1dda7e[_0x59c2('0x3b')]=_0x3bdb38[_0x59c2('0x3a')];if(_0x3bdb38['modernAuthentication']){_0x8d0ab9[_0x59c2('0x3c')]=_0x1dda7e['modernAuthentication']=!![];_0x8d0ab9[_0x59c2('0x3d')]=_0x1dda7e[_0x59c2('0x3d')]=_0x3bdb38['CloudProviderId'];_0x8d0ab9[_0x59c2('0x3a')]=_0x1dda7e[_0x59c2('0x3b')]=null;}else{_0x8d0ab9[_0x59c2('0x3d')]=_0x1dda7e['CloudProviderId']=null;}_0x8d0ab9[_0x59c2('0x3e')]=getImapHost(_0x29af34);_0x8d0ab9[_0x59c2('0x3f')]=0x3e1;_0x1dda7e[_0x59c2('0x3e')]=getSmtpHost(_0x29af34);_0x1dda7e['port']=0x24b;_0x1dda7e[_0x59c2('0x40')]=![];_0x8d0ab9['service']=_0x1dda7e[_0x59c2('0x41')]=null;}else{if(_0x3bdb38[_0x59c2('0x42')]){_0x8d0ab9[_0x59c2('0x38')]=_0x1dda7e['user']=_0x3bdb38['username'];_0x8d0ab9[_0x59c2('0x3a')]=_0x1dda7e[_0x59c2('0x3b')]=_0x3bdb38['password'];}else{_0x8d0ab9['authentication']=_0x1dda7e[_0x59c2('0x42')]=![];_0x8d0ab9['user']=_0x1dda7e[_0x59c2('0x38')]=null;_0x8d0ab9[_0x59c2('0x3a')]=_0x1dda7e['pass']=null;}_0x8d0ab9[_0x59c2('0x3e')]=_0x3bdb38[_0x59c2('0x43')][_0x59c2('0x3e')];_0x8d0ab9['port']=_0x3bdb38[_0x59c2('0x43')]['port'];_0x1dda7e[_0x59c2('0x3e')]=_0x3bdb38[_0x59c2('0x44')][_0x59c2('0x3e')];_0x1dda7e[_0x59c2('0x3f')]=_0x3bdb38[_0x59c2('0x44')][_0x59c2('0x3f')];}return{'Imap':_0x8d0ab9,'Smtp':_0x1dda7e};}exports[_0x59c2('0x45')]=function(_0x4409af,_0x40d83b){var _0x78f1fd={'include':[{'model':db[_0x59c2('0x46')],'as':_0x59c2('0x43')},{'model':db[_0x59c2('0x47')],'as':'Smtp'},{'model':db[_0x59c2('0x48')],'as':_0x59c2('0x49')}]},_0x33692e={},_0x13b4fb={'count':0x0,'rows':[]};var _0x468fca=_[_0x59c2('0x4a')](db[_0x59c2('0x4b')][_0x59c2('0x4c')],function(_0x33f912){return{'name':_0x33f912[_0x59c2('0x4d')],'type':_0x33f912[_0x59c2('0x4e')]['key']};});_0x33692e[_0x59c2('0x4f')]=_[_0x59c2('0x4a')](_0x468fca,_0x59c2('0x2c'));_0x33692e[_0x59c2('0x50')]=_[_0x59c2('0x51')](_0x4409af[_0x59c2('0x50')]);_0x33692e[_0x59c2('0x52')]=_[_0x59c2('0x53')](_0x33692e[_0x59c2('0x4f')],_0x33692e[_0x59c2('0x50')]);_0x78f1fd[_0x59c2('0x54')]=_[_0x59c2('0x53')](_0x33692e[_0x59c2('0x4f')],qs[_0x59c2('0x55')](_0x4409af['query']['fields']));_0x78f1fd[_0x59c2('0x54')]=_0x78f1fd[_0x59c2('0x54')]['length']?_0x78f1fd[_0x59c2('0x54')]:_0x33692e[_0x59c2('0x4f')];if(!_0x4409af['query'][_0x59c2('0x56')](_0x59c2('0x57'))){_0x78f1fd[_0x59c2('0x22')]=qs[_0x59c2('0x22')](_0x4409af[_0x59c2('0x50')][_0x59c2('0x22')]);_0x78f1fd[_0x59c2('0x20')]=qs[_0x59c2('0x20')](_0x4409af[_0x59c2('0x50')][_0x59c2('0x20')]);}_0x78f1fd[_0x59c2('0x58')]=qs[_0x59c2('0x59')](_0x4409af[_0x59c2('0x50')][_0x59c2('0x59')]);_0x78f1fd[_0x59c2('0x5a')]=qs['filters'](_[_0x59c2('0x5b')](_0x4409af[_0x59c2('0x50')],_0x33692e[_0x59c2('0x52')]),_0x468fca);if(_0x4409af[_0x59c2('0x50')][_0x59c2('0x5c')]){_0x78f1fd[_0x59c2('0x5a')]=_[_0x59c2('0x5d')](_0x78f1fd['where'],{'$or':_['map'](_0x468fca,function(_0x5d4b63){if(_0x5d4b63[_0x59c2('0x4e')]!==_0x59c2('0x5e')){var _0x2f3f89={};_0x2f3f89[_0x5d4b63[_0x59c2('0x2c')]]={'$like':'%'+_0x4409af['query'][_0x59c2('0x5c')]+'%'};return _0x2f3f89;}})});}_0x78f1fd=_[_0x59c2('0x5d')]({},_0x78f1fd,_0x4409af[_0x59c2('0x5f')]);var _0x91e08a={'where':_0x78f1fd[_0x59c2('0x5a')]};return db[_0x59c2('0x4b')][_0x59c2('0x23')](_0x91e08a)[_0x59c2('0x12')](function(_0xfd0ab3){_0x13b4fb[_0x59c2('0x23')]=_0xfd0ab3;if(_0x4409af[_0x59c2('0x50')]['includeAll']){_0x78f1fd[_0x59c2('0x60')]=[{'all':!![]}];}return db['MailAccount'][_0x59c2('0x61')](_0x78f1fd);})[_0x59c2('0x12')](function(_0x443bb6){_0x13b4fb[_0x59c2('0x62')]=_0x443bb6;return _0x13b4fb;})[_0x59c2('0x12')](respondWithFilteredResult(_0x40d83b,_0x78f1fd))[_0x59c2('0x1b')](handleError(_0x40d83b,null));};exports[_0x59c2('0x63')]=function(_0x6206cd,_0x390727){var _0xf1a3a2={'raw':![],'where':{'id':_0x6206cd[_0x59c2('0x64')]['id']},'include':[{'model':db[_0x59c2('0x46')],'as':_0x59c2('0x43')},{'model':db['MailServerOut'],'as':_0x59c2('0x44')},{'model':db[_0x59c2('0x48')],'as':_0x59c2('0x49')}]},_0x2ab42f={};_0x2ab42f[_0x59c2('0x4f')]=_[_0x59c2('0x51')](db[_0x59c2('0x4b')][_0x59c2('0x4c')]);_0x2ab42f[_0x59c2('0x50')]=_[_0x59c2('0x51')](_0x6206cd[_0x59c2('0x50')]);_0x2ab42f[_0x59c2('0x52')]=_[_0x59c2('0x53')](_0x2ab42f[_0x59c2('0x4f')],_0x2ab42f[_0x59c2('0x50')]);_0xf1a3a2[_0x59c2('0x54')]=_[_0x59c2('0x53')](_0x2ab42f[_0x59c2('0x4f')],qs[_0x59c2('0x55')](_0x6206cd[_0x59c2('0x50')]['fields']));_0xf1a3a2['attributes']=_0xf1a3a2[_0x59c2('0x54')]['length']?_0xf1a3a2[_0x59c2('0x54')]:_0x2ab42f['model'];if(_0x6206cd[_0x59c2('0x50')][_0x59c2('0x65')]){_0xf1a3a2[_0x59c2('0x60')]=[{'all':!![]}];}_0xf1a3a2=_[_0x59c2('0x5d')]({},_0xf1a3a2,_0x6206cd[_0x59c2('0x5f')]);return db[_0x59c2('0x4b')]['find'](_0xf1a3a2)['then'](handleEntityNotFound(_0x390727,null))['then'](respondWithResult(_0x390727,null))[_0x59c2('0x1b')](handleError(_0x390727,null));};exports[_0x59c2('0x26')]=function(_0x4d3ec1,_0x12b6e5){if(_0x4d3ec1[_0x59c2('0x66')]['id']){delete _0x4d3ec1[_0x59c2('0x66')]['id'];}var _0x53a9d9=_0x4d3ec1[_0x59c2('0x66')][_0x59c2('0x67')]==='custom'?null:_0x4d3ec1[_0x59c2('0x66')]['provider'];var _0x321393=_0x4d3ec1['body'][_0x59c2('0x43')]||{};var _0x2d4b3f=_0x4d3ec1[_0x59c2('0x66')]['Smtp']||{};if(_0x53a9d9){_0x321393[_0x59c2('0x3e')]=getImapHost(_0x53a9d9);_0x321393[_0x59c2('0x3f')]=0x3e1;_0x2d4b3f[_0x59c2('0x3e')]=getSmtpHost(_0x53a9d9);_0x2d4b3f[_0x59c2('0x3f')]=0x24b;_0x2d4b3f[_0x59c2('0x40')]=![];}if(_0x2d4b3f['modernAuthentication']){_0x2d4b3f[_0x59c2('0x40')]=![];}else{_0x2d4b3f[_0x59c2('0x3d')]=null;}if(!_0x321393['modernAuthentication'])_0x321393[_0x59c2('0x3d')]=null;_0x4d3ec1[_0x59c2('0x66')][_0x59c2('0x43')]=_0x321393;_0x4d3ec1[_0x59c2('0x66')][_0x59c2('0x44')]=_0x2d4b3f;return db[_0x59c2('0x4b')][_0x59c2('0x68')]({'where':{'id':_0x4d3ec1[_0x59c2('0x64')]['id']},'include':[{'model':db[_0x59c2('0x46')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x59c2('0x44')},{'model':db[_0x59c2('0x48')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x12b6e5,null))[_0x59c2('0x12')](function(_0x20a18f){if(!_0x20a18f)throw new Error(_0x59c2('0x69'));if(_0x20a18f[_0x59c2('0x41')])delete _0x4d3ec1[_0x59c2('0x66')]['Imap'];return _0x20a18f;})['then'](saveUpdates(_0x4d3ec1[_0x59c2('0x66')],null))[_0x59c2('0x12')](function(_0x56305e){if(!_0x4d3ec1['body'][_0x59c2('0x43')])return _0x56305e;return db[_0x59c2('0x46')]['update'](_0x4d3ec1['body'][_0x59c2('0x43')],{'where':{'MailAccountId':_0x56305e['id']}})[_0x59c2('0x12')](function(){return _0x56305e;});})[_0x59c2('0x12')](function(_0x23d3a2){if(!_0x4d3ec1['body'][_0x59c2('0x44')])return _0x23d3a2;return db[_0x59c2('0x47')][_0x59c2('0x26')](_0x4d3ec1['body'][_0x59c2('0x44')],{'where':{'MailAccountId':_0x23d3a2['id']}})[_0x59c2('0x12')](function(){return _0x23d3a2;});})['then'](respondWithResult(_0x12b6e5,null))[_0x59c2('0x1b')](handleError(_0x12b6e5,null));};exports[_0x59c2('0x6a')]=function(_0x2f939a,_0x8b83c8){return db[_0x59c2('0x4b')]['describe']()[_0x59c2('0x12')](respondWithResult(_0x8b83c8,null))[_0x59c2('0x1b')](handleError(_0x8b83c8,null));};exports[_0x59c2('0x6b')]=function(_0x15c16f,_0x436b38){if(_0x15c16f[_0x59c2('0x66')]['id']){delete _0x15c16f['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x15c16f['params']['id']}})['then'](handleEntityNotFound(_0x436b38,null))[_0x59c2('0x12')](function(_0x47bc2f){if(_0x47bc2f){_0x15c16f[_0x59c2('0x66')][_0x59c2('0x6c')]=_0x47bc2f['id'];return db[_0x59c2('0x6d')][_0x59c2('0x6e')](_0x15c16f['body']);}})[_0x59c2('0x12')](respondWithResult(_0x436b38,null))[_0x59c2('0x1b')](handleError(_0x436b38,null));};exports[_0x59c2('0x6f')]=function(_0x25020d,_0x382446){var _0x431538={'raw':![],'where':{}};var _0x5408c0={};var _0x28c705={'count':0x0,'rows':[]};return db[_0x59c2('0x4b')][_0x59c2('0x70')]({'where':{'id':_0x25020d[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x382446,null))[_0x59c2('0x12')](function(_0x52ecaf){if(_0x52ecaf){_0x5408c0[_0x59c2('0x4f')]=_['keys'](db[_0x59c2('0x6d')][_0x59c2('0x4c')]);_0x5408c0[_0x59c2('0x50')]=_['keys'](_0x25020d['query']);_0x5408c0['filters']=_['intersection'](_0x5408c0['model'],_0x5408c0[_0x59c2('0x50')]);_0x431538['attributes']=_[_0x59c2('0x53')](_0x5408c0[_0x59c2('0x4f')],qs['fields'](_0x25020d[_0x59c2('0x50')]['fields']));_0x431538[_0x59c2('0x54')]=_0x431538[_0x59c2('0x54')][_0x59c2('0x71')]?_0x431538[_0x59c2('0x54')]:_0x5408c0[_0x59c2('0x4f')];if(!_0x25020d['query'][_0x59c2('0x56')](_0x59c2('0x57'))){_0x431538[_0x59c2('0x22')]=qs['limit'](_0x25020d[_0x59c2('0x50')][_0x59c2('0x22')]);_0x431538['offset']=qs[_0x59c2('0x20')](_0x25020d['query']['offset']);}_0x431538['order']=qs[_0x59c2('0x59')](_0x25020d[_0x59c2('0x50')][_0x59c2('0x59')]);_0x431538[_0x59c2('0x5a')]=qs[_0x59c2('0x52')](_[_0x59c2('0x5b')](_0x25020d[_0x59c2('0x50')],_0x5408c0['filters']));_0x431538['where']['MailAccountId']=_0x52ecaf['id'];if(_0x25020d['query']['filter']){_0x431538[_0x59c2('0x5a')]=_['merge'](_0x431538[_0x59c2('0x5a')],{'$or':_[_0x59c2('0x4a')](_0x431538[_0x59c2('0x54')],function(_0x2b729b){var _0x526b48={};_0x526b48[_0x2b729b]={'$like':'%'+_0x25020d['query'][_0x59c2('0x5c')]+'%'};return _0x526b48;})});}_0x431538=_[_0x59c2('0x5d')]({},_0x431538,_0x25020d[_0x59c2('0x5f')]);return db[_0x59c2('0x6d')][_0x59c2('0x23')]({'where':_0x431538[_0x59c2('0x5a')]})[_0x59c2('0x12')](function(_0x4c2512){_0x28c705[_0x59c2('0x23')]=_0x4c2512;if(_0x25020d[_0x59c2('0x50')][_0x59c2('0x65')]){_0x431538['include']=[{'all':!![]}];}return db[_0x59c2('0x6d')][_0x59c2('0x61')](_0x431538);})[_0x59c2('0x12')](function(_0x33aa8f){_0x28c705['rows']=_0x33aa8f;return _0x28c705;});}})[_0x59c2('0x12')](respondWithFilteredResult(_0x382446,_0x431538))[_0x59c2('0x1b')](handleError(_0x382446,null));};exports[_0x59c2('0x72')]=function(_0x271f66,_0x5b6fc8){return db[_0x59c2('0x4b')][_0x59c2('0x68')]({'where':{'id':_0x271f66[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x5b6fc8,null))[_0x59c2('0x12')](function(_0xfc8451){if(_0xfc8451){return _0xfc8451[_0x59c2('0x72')](_0x271f66[_0x59c2('0x50')][_0x59c2('0x73')]);}})[_0x59c2('0x12')](respondWithStatusCode(_0x5b6fc8,null))[_0x59c2('0x1b')](handleError(_0x5b6fc8,null));};exports[_0x59c2('0x74')]=function(_0x302b65,_0x528c36){if(_0x302b65[_0x59c2('0x66')]['id']){delete _0x302b65['body']['id'];}return db[_0x59c2('0x4b')][_0x59c2('0x68')]({'where':{'id':_0x302b65['params']['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x528c36,null))[_0x59c2('0x12')](function(_0x480685){if(_0x480685){_0x302b65[_0x59c2('0x66')][_0x59c2('0x6c')]=_0x480685['id'];return db[_0x59c2('0x75')][_0x59c2('0x6e')](_0x302b65['body']);}})[_0x59c2('0x12')](respondWithResult(_0x528c36,null))[_0x59c2('0x1b')](handleError(_0x528c36,null));};exports[_0x59c2('0x76')]=function(_0x233261,_0xf45767){var _0x18ef8e={'raw':![],'where':{}};var _0x12a0dd={};var _0x4fd3b7={'count':0x0,'rows':[]};return db[_0x59c2('0x4b')][_0x59c2('0x70')]({'where':{'id':_0x233261[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0xf45767,null))[_0x59c2('0x12')](function(_0x2e152a){if(_0x2e152a){_0x12a0dd[_0x59c2('0x4f')]=_[_0x59c2('0x51')](db[_0x59c2('0x75')][_0x59c2('0x4c')]);_0x12a0dd['query']=_[_0x59c2('0x51')](_0x233261[_0x59c2('0x50')]);_0x12a0dd[_0x59c2('0x52')]=_[_0x59c2('0x53')](_0x12a0dd['model'],_0x12a0dd[_0x59c2('0x50')]);_0x18ef8e[_0x59c2('0x54')]=_[_0x59c2('0x53')](_0x12a0dd['model'],qs[_0x59c2('0x55')](_0x233261[_0x59c2('0x50')][_0x59c2('0x55')]));_0x18ef8e[_0x59c2('0x54')]=_0x18ef8e[_0x59c2('0x54')][_0x59c2('0x71')]?_0x18ef8e[_0x59c2('0x54')]:_0x12a0dd[_0x59c2('0x4f')];if(!_0x233261[_0x59c2('0x50')][_0x59c2('0x56')](_0x59c2('0x57'))){_0x18ef8e[_0x59c2('0x22')]=qs[_0x59c2('0x22')](_0x233261['query']['limit']);_0x18ef8e[_0x59c2('0x20')]=qs[_0x59c2('0x20')](_0x233261['query'][_0x59c2('0x20')]);}_0x18ef8e['order']=qs['sort'](_0x233261['query']['sort']);_0x18ef8e[_0x59c2('0x5a')]=qs[_0x59c2('0x52')](_[_0x59c2('0x5b')](_0x233261[_0x59c2('0x50')],_0x12a0dd['filters']));_0x18ef8e['where']['MailAccountId']=_0x2e152a['id'];if(_0x233261[_0x59c2('0x50')]['filter']){_0x18ef8e[_0x59c2('0x5a')]=_['merge'](_0x18ef8e[_0x59c2('0x5a')],{'$or':_[_0x59c2('0x4a')](_0x18ef8e['attributes'],function(_0x386af1){var _0x1aca7f={};_0x1aca7f[_0x386af1]={'$like':'%'+_0x233261['query'][_0x59c2('0x5c')]+'%'};return _0x1aca7f;})});}_0x18ef8e=_[_0x59c2('0x5d')]({},_0x18ef8e,_0x233261[_0x59c2('0x5f')]);return db['CannedAnswer'][_0x59c2('0x23')]({'where':_0x18ef8e[_0x59c2('0x5a')]})[_0x59c2('0x12')](function(_0x1c4c50){_0x4fd3b7[_0x59c2('0x23')]=_0x1c4c50;if(_0x233261[_0x59c2('0x50')][_0x59c2('0x65')]){_0x18ef8e['include']=[{'all':!![]}];}return db[_0x59c2('0x75')][_0x59c2('0x61')](_0x18ef8e);})[_0x59c2('0x12')](function(_0x539c3c){_0x4fd3b7[_0x59c2('0x62')]=_0x539c3c;return _0x4fd3b7;});}})[_0x59c2('0x12')](respondWithFilteredResult(_0xf45767,_0x18ef8e))['catch'](handleError(_0xf45767,null));};exports[_0x59c2('0x77')]=function(_0x1aa6fb,_0x3fad33){return db[_0x59c2('0x4b')]['find']({'where':{'id':_0x1aa6fb[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x3fad33,null))[_0x59c2('0x12')](function(_0x16f42e){if(_0x16f42e){return _0x16f42e[_0x59c2('0x77')](_0x1aa6fb[_0x59c2('0x50')][_0x59c2('0x73')]);}})[_0x59c2('0x12')](respondWithStatusCode(_0x3fad33,null))[_0x59c2('0x1b')](handleError(_0x3fad33,null));};exports['create']=function(_0x7d202c,_0xe551e){var _0x51fc1d={'name':_0x7d202c[_0x59c2('0x66')][_0x59c2('0x2c')],'key':_0x7d202c[_0x59c2('0x66')][_0x59c2('0x78')],'provider':_0x7d202c[_0x59c2('0x66')]['provider']===_0x59c2('0x79')?null:_0x7d202c[_0x59c2('0x66')][_0x59c2('0x67')],'email':_0x7d202c[_0x59c2('0x66')]['email'],'ListId':_0x7d202c[_0x59c2('0x66')]['ListId'],'active':!_['isNil'](_0x7d202c[_0x59c2('0x66')]['active'])?_0x7d202c[_0x59c2('0x66')]['active']:!![],'description':_0x7d202c[_0x59c2('0x66')][_0x59c2('0x7a')]||null};var _0x3c178c=getAuthenticationOptions(_0x51fc1d[_0x59c2('0x67')],_0x7d202c[_0x59c2('0x66')]);_0x51fc1d[_0x59c2('0x43')]=_0x3c178c[_0x59c2('0x43')];_0x51fc1d['Smtp']=_0x3c178c[_0x59c2('0x44')];return db[_0x59c2('0x4b')]['create'](_0x51fc1d,{'include':[{'model':db['MailServerOut'],'as':_0x59c2('0x44')},{'model':db[_0x59c2('0x46')],'as':_0x59c2('0x43')}]})['then'](function(_0x8e68c2){var _0xc34d4=_0x7d202c[_0x59c2('0x38')][_0x59c2('0x28')]({'plain':!![]});if(!_0xc34d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc34d4[_0x59c2('0x7b')]===_0x59c2('0x38')){var _0x198dc5=_0x8e68c2[_0x59c2('0x28')]({'plain':!![]});return db[_0x59c2('0x7c')][_0x59c2('0x68')]({'where':{'name':_0x59c2('0x29'),'userProfileId':_0xc34d4[_0x59c2('0x7d')]},'raw':!![]})[_0x59c2('0x12')](function(_0x3a13a1){if(_0x3a13a1&&_0x3a13a1[_0x59c2('0x7e')]===0x0){return db[_0x59c2('0x2a')][_0x59c2('0x6e')]({'name':_0x198dc5[_0x59c2('0x2c')],'resourceId':_0x198dc5['id'],'type':_0x3a13a1[_0x59c2('0x2c')],'sectionId':_0x3a13a1['id']},{})[_0x59c2('0x12')](function(){return _0x8e68c2;});}else{return _0x8e68c2;}})[_0x59c2('0x1b')](function(_0xf454b9){logger[_0x59c2('0x16')](_0x59c2('0x7f'),_0xf454b9);throw _0xf454b9;});}return _0x8e68c2;})[_0x59c2('0x12')](respondWithResult(_0xe551e,0xc9))[_0x59c2('0x1b')](handleError(_0xe551e,null));};exports[_0x59c2('0x80')]=function(_0x4c8f47,_0x179e61){return db[_0x59c2('0x4b')][_0x59c2('0x70')]({'where':{'id':_0x4c8f47[_0x59c2('0x64')]['id']}})['then'](handleEntityNotFound(_0x179e61,null))[_0x59c2('0x12')](function(_0x290038){if(_0x290038){return _0x290038[_0x59c2('0x80')]();}return null;})[_0x59c2('0x12')](respondWithResult(_0x179e61,null))[_0x59c2('0x1b')](handleError(_0x179e61,null));};exports['addImap']=function(_0x2d72c5,_0x3be38e){if(_0x2d72c5[_0x59c2('0x66')]['id']){delete _0x2d72c5[_0x59c2('0x66')]['id'];}return db[_0x59c2('0x4b')]['find']({'where':{'id':_0x2d72c5[_0x59c2('0x64')]['id']}})['then'](handleEntityNotFound(_0x3be38e,null))[_0x59c2('0x12')](function(_0x3ae37a){if(_0x3ae37a){_0x2d72c5[_0x59c2('0x66')]['MailAccountId']=_0x3ae37a['id'];return db[_0x59c2('0x46')]['create'](_0x2d72c5[_0x59c2('0x66')]);}})[_0x59c2('0x12')](respondWithResult(_0x3be38e,null))[_0x59c2('0x1b')](handleError(_0x3be38e,null));};exports[_0x59c2('0x81')]=function(_0x13166f,_0x1a1528){return db[_0x59c2('0x4b')][_0x59c2('0x70')]({'where':{'id':_0x13166f['params']['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x1a1528,null))[_0x59c2('0x12')](function(_0xd36011){if(_0xd36011){return _0xd36011[_0x59c2('0x82')](null);}return null;})[_0x59c2('0x12')](respondWithStatusCode(_0x1a1528,null))[_0x59c2('0x1b')](handleError(_0x1a1528,null));};exports['getSmtp']=function(_0x2a6628,_0x487351){return db[_0x59c2('0x4b')]['findOne']({'where':{'id':_0x2a6628[_0x59c2('0x64')]['id']}})['then'](handleEntityNotFound(_0x487351,null))['then'](function(_0x23dbb9){if(_0x23dbb9){return _0x23dbb9[_0x59c2('0x83')]();}return null;})['then'](respondWithResult(_0x487351,null))[_0x59c2('0x1b')](handleError(_0x487351,null));};exports[_0x59c2('0x84')]=function(_0x5b7eb9,_0x20b277){if(_0x5b7eb9[_0x59c2('0x66')]['id']){delete _0x5b7eb9[_0x59c2('0x66')]['id'];}return db[_0x59c2('0x4b')]['find']({'where':{'id':_0x5b7eb9[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x20b277,null))[_0x59c2('0x12')](function(_0x5c037b){if(_0x5c037b){_0x5b7eb9[_0x59c2('0x66')][_0x59c2('0x6c')]=_0x5c037b['id'];return db['MailServerOut']['create'](_0x5b7eb9[_0x59c2('0x66')]);}})['then'](respondWithResult(_0x20b277,null))['catch'](handleError(_0x20b277,null));};exports[_0x59c2('0x85')]=function(_0x220c76,_0x4dc71b){return db[_0x59c2('0x4b')][_0x59c2('0x70')]({'where':{'id':_0x220c76[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x4dc71b,null))['then'](function(_0x243872){if(_0x243872){return _0x243872[_0x59c2('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x4dc71b,null))[_0x59c2('0x1b')](handleError(_0x4dc71b,null));};exports['addInteraction']=function(_0x2d0312,_0x397b1c){return db[_0x59c2('0x87')]['find']({'where':{'id':_0x2d0312[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x397b1c,null))[_0x59c2('0x12')](function(_0x1ae357){if(_0x1ae357){return _0x1ae357[_0x59c2('0x88')](_0x2d0312[_0x59c2('0x66')]['ids'],_[_0x59c2('0x89')](_0x2d0312['body'],['ids','id'])||{});}})[_0x59c2('0x12')](respondWithResult(_0x397b1c,null))['catch'](handleError(_0x397b1c,null));};exports[_0x59c2('0x8a')]=function(_0x5b4525,_0x52f1e4){var _0x507556={'raw':![],'where':{}};var _0x27eccc={};var _0x5c1422={'count':0x0,'rows':[]};return db['MailAccount'][_0x59c2('0x70')]({'where':{'id':_0x5b4525[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x52f1e4,null))[_0x59c2('0x12')](function(_0x1a2572){if(_0x1a2572){_0x27eccc[_0x59c2('0x4f')]=_[_0x59c2('0x51')](db['MailInteraction'][_0x59c2('0x4c')]);_0x27eccc[_0x59c2('0x50')]=_[_0x59c2('0x51')](_0x5b4525[_0x59c2('0x50')]);_0x27eccc[_0x59c2('0x52')]=_[_0x59c2('0x53')](_0x27eccc[_0x59c2('0x4f')],_0x27eccc[_0x59c2('0x50')]);_0x507556[_0x59c2('0x54')]=_[_0x59c2('0x53')](_0x27eccc[_0x59c2('0x4f')],qs[_0x59c2('0x55')](_0x5b4525[_0x59c2('0x50')]['fields']));_0x507556['attributes']=_0x507556[_0x59c2('0x54')][_0x59c2('0x71')]?_0x507556[_0x59c2('0x54')]:_0x27eccc[_0x59c2('0x4f')];if(!_0x5b4525[_0x59c2('0x50')]['hasOwnProperty'](_0x59c2('0x57'))){_0x507556[_0x59c2('0x22')]=qs[_0x59c2('0x22')](_0x5b4525[_0x59c2('0x50')][_0x59c2('0x22')]);_0x507556[_0x59c2('0x20')]=qs[_0x59c2('0x20')](_0x5b4525['query'][_0x59c2('0x20')]);}_0x507556[_0x59c2('0x58')]=qs[_0x59c2('0x59')](_0x5b4525['query']['sort']);_0x507556['where']=qs[_0x59c2('0x52')](_[_0x59c2('0x5b')](_0x5b4525[_0x59c2('0x50')],_0x27eccc[_0x59c2('0x52')]));_0x507556[_0x59c2('0x5a')][_0x59c2('0x6c')]=_0x1a2572['id'];if(_0x5b4525[_0x59c2('0x50')][_0x59c2('0x5c')]){_0x507556[_0x59c2('0x5a')]=_[_0x59c2('0x5d')](_0x507556[_0x59c2('0x5a')],{'$or':_[_0x59c2('0x4a')](_0x507556[_0x59c2('0x54')],function(_0x241d8b){var _0xeefd36={};_0xeefd36[_0x241d8b]={'$like':'%'+_0x5b4525[_0x59c2('0x50')]['filter']+'%'};return _0xeefd36;})});}_0x507556=_[_0x59c2('0x5d')]({},_0x507556,_0x5b4525[_0x59c2('0x5f')]);return db[_0x59c2('0x87')][_0x59c2('0x23')]({'where':_0x507556['where']})[_0x59c2('0x12')](function(_0x3428de){_0x5c1422['count']=_0x3428de;if(_0x5b4525['query']['includeAll']){_0x507556[_0x59c2('0x60')]=[{'model':db[_0x59c2('0x8b')],'as':_0x59c2('0x8c'),'required':![]},{'model':db[_0x59c2('0x8d')],'as':_0x59c2('0x8e'),'attributes':[_0x59c2('0x2c'),'fullname',_0x59c2('0x8f')],'required':![]},{'model':db[_0x59c2('0x90')],'as':'Tags','attributes':['id',_0x59c2('0x2c'),'color'],'where':_0x5b4525[_0x59c2('0x50')][_0x59c2('0x91')]?{'id':_0x5b4525['query']['tag']}:undefined,'required':_0x5b4525['query']['tag']?!![]:![]}];}return db[_0x59c2('0x87')][_0x59c2('0x61')](_0x507556);})[_0x59c2('0x12')](function(_0x489708){_0x5c1422['rows']=_0x489708;return _0x5c1422;});}})[_0x59c2('0x12')](respondWithFilteredResult(_0x52f1e4,_0x507556))[_0x59c2('0x1b')](handleError(_0x52f1e4,null));};exports[_0x59c2('0x92')]=function addApplications(_0x29ff50,_0x53d096){var _0x2f12a9=_0x29ff50['params']['id'];var _0x12a951=_0x29ff50[_0x59c2('0x66')];var _0x46d821=0xc8;var _0x55844f=null;return db['sequelize'][_0x59c2('0x93')]({'isolationLevel':db[_0x59c2('0x94')][_0x59c2('0x95')]['ISOLATION_LEVELS'][_0x59c2('0x96')]},function(_0x41da95){return db[_0x59c2('0x4b')][_0x59c2('0x70')]({'where':{'id':_0x2f12a9},'transaction':_0x41da95})[_0x59c2('0x12')](function(_0x13b170){if(_0x13b170){return db[_0x59c2('0x97')]['destroy']({'where':{'MailAccountId':_0x2f12a9},'transaction':_0x41da95})[_0x59c2('0x12')](function(){var _0x2dbd1c=_[_0x59c2('0x4a')](_0x12a951,function(_0x253527){_0x253527[_0x59c2('0x6c')]=_0x2f12a9;return _0x253527;});return db[_0x59c2('0x97')][_0x59c2('0x98')](_0x2dbd1c,{'transaction':_0x41da95});});}else{_0x46d821=0x194;_0x55844f=[];}});})['then'](function(){if(_0x46d821!==0x194){return db['MailApplication'][_0x59c2('0x99')]({'where':{'MailAccountId':_0x2f12a9},'order':_0x59c2('0x9a')})[_0x59c2('0x12')](function(_0x34e325){_0x55844f=_0x34e325;});}})[_0x59c2('0x1b')](function(_0x2007c5){_0x46d821=0x1f4;logger[_0x59c2('0x16')](_0x2007c5['stack']);if(_0x2007c5[_0x59c2('0x2c')]){delete _0x2007c5['name'];}_0x55844f=_0x2007c5;})[_0x59c2('0x9b')](function(){if(_0x55844f===null){_0x53d096['sendStatus'](_0x46d821);}else{if(_0x46d821===0x1f4){_0x53d096[_0x59c2('0x1d')](_0x46d821)[_0x59c2('0x2d')](_0x55844f);}else{_0x53d096[_0x59c2('0x1d')](_0x46d821)[_0x59c2('0x1f')](_0x55844f);}}});};exports[_0x59c2('0x9c')]=function(_0x4b01f1,_0x4d718b){var _0x3c261e={};var _0x1b1232={};var _0x4537be;var _0x130ff7;return db[_0x59c2('0x4b')][_0x59c2('0x70')]({'where':{'id':_0x4b01f1['params']['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x4d718b,null))['then'](function(_0x321f94){if(_0x321f94){_0x4537be=_0x321f94;_0x1b1232[_0x59c2('0x4f')]=_[_0x59c2('0x51')](db[_0x59c2('0x97')][_0x59c2('0x4c')]);_0x1b1232['query']=_[_0x59c2('0x51')](_0x4b01f1[_0x59c2('0x50')]);_0x1b1232['filters']=_[_0x59c2('0x53')](_0x1b1232['model'],_0x1b1232['query']);_0x3c261e[_0x59c2('0x54')]=_[_0x59c2('0x53')](_0x1b1232[_0x59c2('0x4f')],qs[_0x59c2('0x55')](_0x4b01f1[_0x59c2('0x50')][_0x59c2('0x55')]));_0x3c261e[_0x59c2('0x54')]=_0x3c261e[_0x59c2('0x54')]['length']?_0x3c261e[_0x59c2('0x54')]:_0x1b1232['model'];_0x3c261e[_0x59c2('0x58')]=qs[_0x59c2('0x59')](_0x4b01f1[_0x59c2('0x50')][_0x59c2('0x59')]);_0x3c261e[_0x59c2('0x5a')]=qs[_0x59c2('0x52')](_[_0x59c2('0x5b')](_0x4b01f1[_0x59c2('0x50')],_0x1b1232['filters']));if(_0x4b01f1['query'][_0x59c2('0x5c')]){_0x3c261e[_0x59c2('0x5a')]=_[_0x59c2('0x5d')](_0x3c261e['where'],{'$or':_[_0x59c2('0x4a')](_0x3c261e[_0x59c2('0x54')],function(_0x785243){var _0x314fd5={};_0x314fd5[_0x785243]={'$like':'%'+_0x4b01f1[_0x59c2('0x50')][_0x59c2('0x5c')]+'%'};return _0x314fd5;})});}_0x3c261e=_[_0x59c2('0x5d')]({},_0x3c261e,_0x4b01f1[_0x59c2('0x5f')]);return _0x4537be[_0x59c2('0x9c')](_0x3c261e);}})[_0x59c2('0x12')](function(_0x5cc182){if(_0x5cc182){_0x130ff7=_0x5cc182[_0x59c2('0x71')];if(!_0x4b01f1[_0x59c2('0x50')][_0x59c2('0x56')]('nolimit')){_0x3c261e['limit']=qs[_0x59c2('0x22')](_0x4b01f1['query']['limit']);_0x3c261e[_0x59c2('0x20')]=qs[_0x59c2('0x20')](_0x4b01f1[_0x59c2('0x50')][_0x59c2('0x20')]);}return _0x4537be[_0x59c2('0x9c')](_0x3c261e);}})[_0x59c2('0x12')](function(_0xdf3acd){if(_0xdf3acd){return _0xdf3acd?{'count':_0x130ff7,'rows':_0xdf3acd}:null;}})[_0x59c2('0x12')](respondWithResult(_0x4d718b,null))['catch'](handleError(_0x4d718b,null));};exports[_0x59c2('0x9d')]=function(_0x22b34f,_0x2aea7a){var _0x42337f={'raw':!![],'where':{}};var _0x17a3b9={};var _0x16a6f6={'count':0x0,'rows':[]};return db['MailAccount'][_0x59c2('0x70')]({'where':{'id':_0x22b34f['params']['id']}})['then'](handleEntityNotFound(_0x2aea7a,null))[_0x59c2('0x12')](function(_0x52d697){if(_0x52d697){_0x17a3b9[_0x59c2('0x4f')]=_[_0x59c2('0x51')](db[_0x59c2('0x9e')][_0x59c2('0x4c')]);_0x17a3b9[_0x59c2('0x50')]=_[_0x59c2('0x51')](_0x22b34f[_0x59c2('0x50')]);_0x17a3b9[_0x59c2('0x52')]=_['intersection'](_0x17a3b9[_0x59c2('0x4f')],_0x17a3b9['query']);_0x42337f[_0x59c2('0x54')]=_['intersection'](_0x17a3b9[_0x59c2('0x4f')],qs['fields'](_0x22b34f[_0x59c2('0x50')][_0x59c2('0x55')]));_0x42337f[_0x59c2('0x54')]=_0x42337f[_0x59c2('0x54')][_0x59c2('0x71')]?_0x42337f[_0x59c2('0x54')]:_0x17a3b9[_0x59c2('0x4f')];if(!_0x22b34f[_0x59c2('0x50')]['hasOwnProperty'](_0x59c2('0x57'))){_0x42337f[_0x59c2('0x22')]=qs['limit'](_0x22b34f[_0x59c2('0x50')][_0x59c2('0x22')]);_0x42337f[_0x59c2('0x20')]=qs[_0x59c2('0x20')](_0x22b34f[_0x59c2('0x50')][_0x59c2('0x20')]);}_0x42337f[_0x59c2('0x58')]=qs['sort'](_0x22b34f['query']['sort']);_0x42337f['where']=qs['filters'](_[_0x59c2('0x5b')](_0x22b34f[_0x59c2('0x50')],_0x17a3b9[_0x59c2('0x52')]));_0x42337f[_0x59c2('0x5a')][_0x59c2('0x6c')]=_0x52d697['id'];if(_0x22b34f[_0x59c2('0x50')]['filter']){_0x42337f[_0x59c2('0x5a')]=_[_0x59c2('0x5d')](_0x42337f[_0x59c2('0x5a')],{'$or':_[_0x59c2('0x4a')](_0x42337f['attributes'],function(_0x30c5d8){var _0x23df63={};_0x23df63[_0x30c5d8]={'$like':'%'+_0x22b34f[_0x59c2('0x50')][_0x59c2('0x5c')]+'%'};return _0x23df63;})});}if(_0x22b34f[_0x59c2('0x50')][_0x59c2('0x9f')]){var _0x424332=_0x22b34f[_0x59c2('0x50')]['$gte'][_0x59c2('0xa0')](',');var _0x22c690={};_0x22c690[_0x424332[0x0]]={'$gte':moment(_0x424332[0x1])[_0x59c2('0xa1')](_0x59c2('0xa2'))};_0x42337f[_0x59c2('0x5a')]=_[_0x59c2('0x5d')](_0x42337f['where'],_0x22c690);}_0x42337f=_[_0x59c2('0x5d')]({},_0x42337f,_0x22b34f[_0x59c2('0x5f')]);return db[_0x59c2('0x9e')][_0x59c2('0x23')]({'where':_0x42337f[_0x59c2('0x5a')]})['then'](function(_0x876357){_0x16a6f6[_0x59c2('0x23')]=_0x876357;if(_0x22b34f[_0x59c2('0x50')]['includeAll']){_0x42337f[_0x59c2('0x60')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x42337f);})[_0x59c2('0x12')](function(_0x5113e9){if(_0x22b34f[_0x59c2('0x50')][_0x59c2('0xa3')]===_0x59c2('0xa4')){for(var _0x429e6f=0x0;_0x429e6f<_0x5113e9[_0x59c2('0x71')];_0x429e6f++){_0x5113e9[_0x429e6f][_0x59c2('0x66')]=juice(_0x5113e9[_0x429e6f][_0x59c2('0x66')]);}}_0x16a6f6['rows']=_0x5113e9;return _0x16a6f6;});}})[_0x59c2('0x12')](respondWithFilteredResult(_0x2aea7a,_0x42337f))[_0x59c2('0x1b')](handleError(_0x2aea7a,null));};exports[_0x59c2('0x2d')]=function(_0x26b52b,_0x39f2f7){var _0x4c16b4,_0xb5effa={},_0x4c019e;if(_0x26b52b[_0x59c2('0x66')]['to']){_0x4c019e=_0x26b52b['body']['to']['split'](',')[0x0];}return db[_0x59c2('0x4b')][_0x59c2('0x68')]({'where':{'id':_0x26b52b[_0x59c2('0x64')]['id']},'include':[{'model':db['CmList'],'as':_0x59c2('0xa5'),'include':[{'model':db[_0x59c2('0x8b')],'as':_0x59c2('0xa6'),'where':{'email':_0x4c019e},'limit':0x1,'order':[[_0x59c2('0xa7'),_0x59c2('0xa8')]]}]},{'model':db[_0x59c2('0x47')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x59c2('0xa9')],'as':_0x59c2('0xa9'),'raw':!![]}]}]})[_0x59c2('0x12')](handleEntityNotFound(_0x39f2f7,null))[_0x59c2('0x12')](function(_0x5760b7){if(!_0x5760b7)return;_0x4c16b4=_0x5760b7;if(!_0x5760b7[_0x59c2('0x44')])throw new Error(_0x59c2('0xaa'));if(_[_0x59c2('0xab')](_0x26b52b[_0x59c2('0x66')][_0x59c2('0xac')])){_0x26b52b[_0x59c2('0x66')][_0x59c2('0xac')]=util[_0x59c2('0xa1')](_0x59c2('0xad'),_0x5760b7[_0x59c2('0x2c')],_0x5760b7[_0x59c2('0xae')]||_0x5760b7[_0x59c2('0x44')]['user']);}if(_0x26b52b['body'][_0x59c2('0xaf')]&&_0x26b52b[_0x59c2('0x66')][_0x59c2('0xaf')][_0x59c2('0x71')]){for(var _0x3788e7=0x0;_0x3788e7<_0x26b52b[_0x59c2('0x66')][_0x59c2('0xaf')][_0x59c2('0x71')];_0x3788e7+=0x1){_0x26b52b['body'][_0x59c2('0xaf')][_0x3788e7]={'filename':_0x26b52b['body']['attachments'][_0x3788e7]['name'],'path':path[_0x59c2('0xb0')](config[_0x59c2('0xb1')],_0x59c2('0xb2'),_0x26b52b[_0x59c2('0x66')][_0x59c2('0xaf')][_0x3788e7][_0x59c2('0xb3')])};}}var _0x5606a8=_0x5760b7[_0x59c2('0xb4')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5606a8,'message':_0x26b52b['body']});})[_0x59c2('0x12')](function(_0x247543){if(!_0x247543)return;_0xb5effa=_0x247543;if(!_0x4c16b4[_0x59c2('0xa5')])throw new Error(_0x59c2('0xb5'));if(_0x4c16b4[_0x59c2('0xa5')][_0x59c2('0xa6')][_0x59c2('0x71')])return _0x4c16b4['List'][_0x59c2('0xa6')][0x0];return db[_0x59c2('0x8b')][_0x59c2('0x6e')](_[_0x59c2('0x9')](_0x26b52b['body'],{'firstName':_0x26b52b['body']['to'],'email':_0x26b52b[_0x59c2('0x66')]['to'],'phone':_0x26b52b[_0x59c2('0x66')]['to'],'ListId':_0x4c16b4[_0x59c2('0xb6')]}));})[_0x59c2('0x12')](function(_0x1f43db){if(!_0x1f43db)return;var _0x3f170b={'UserId':_0x26b52b[_0x59c2('0x38')]['id'],'ContactId':_0x1f43db['id'],'MailAccountId':_0x4c16b4['id'],'inReplyTo':_0xb5effa[_0x59c2('0xb7')],'to':_0x26b52b[_0x59c2('0x66')][_0x59c2('0xac')],'cc':_0x26b52b['body']['cc'],'subject':_0x26b52b[_0x59c2('0x66')]['subject'],'attach':_0x26b52b[_0x59c2('0x66')][_0x59c2('0xb8')],'firstMsgDirection':_0x59c2('0xb9'),'lastMsgAt':moment()[_0x59c2('0xa1')](_0x59c2('0xa2')),'lastMsgDirection':_0x59c2('0xb9'),'Messages':[_[_0x59c2('0x5d')](_0x26b52b[_0x59c2('0x66')],{'messageId':_0xb5effa[_0x59c2('0xb7')],'sentAt':moment()['format'](_0x59c2('0xa2')),'read':!![],'MailAccountId':_0x4c16b4['id'],'UserId':_0x26b52b[_0x59c2('0x38')]['id'],'ContactId':_0x1f43db['id']})]};if(_0x26b52b[_0x59c2('0x66')]['Interaction']){_0x3f170b=_[_0x59c2('0x5d')](_0x3f170b,_0x26b52b[_0x59c2('0x66')][_0x59c2('0xba')]);}return db[_0x59c2('0x87')]['create'](_0x3f170b,{'include':[{'model':db['MailMessage'],'as':_0x59c2('0xbb')}]});})[_0x59c2('0x12')](respondWithResult(_0x39f2f7,null))[_0x59c2('0x1b')](handleError(_0x39f2f7,null));};exports['verifySmtp']=function(_0x1d661d,_0x3faab8){return db['MailAccount'][_0x59c2('0x68')]({'where':{'id':_0x1d661d[_0x59c2('0x64')]['id']},'include':[{'model':db[_0x59c2('0x47')],'as':_0x59c2('0x44'),'raw':!![],'include':[{'model':db[_0x59c2('0xa9')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x3faab8,null))[_0x59c2('0x12')](function(_0x355726){if(!_0x355726[_0x59c2('0x44')])return;var _0x448b40=_0x355726[_0x59c2('0xb4')]();return respondWithRpcPromise('VerifySmtp',_0x59c2('0xbc'),{'account':_0x448b40});})[_0x59c2('0x12')](respondWithResult(_0x3faab8,null))[_0x59c2('0x1b')](handleError(_0x3faab8,null));};exports['destroy']=function(_0x49eb9b,_0x7d4e5b){return db[_0x59c2('0x4b')]['find']({'where':{'id':_0x49eb9b[_0x59c2('0x64')]['id']}})['then'](handleEntityNotFound(_0x7d4e5b,null))[_0x59c2('0x12')](function(_0x18e197){if(_0x18e197&&_0x18e197['service']){throw new db[(_0x59c2('0xbd'))][(_0x59c2('0xbe'))](_0x59c2('0xbf'));}return _0x18e197;})['then'](removeEntity(_0x7d4e5b,null))[_0x59c2('0x1b')](handleError(_0x7d4e5b,null));};exports['addAgents']=function(_0x564d46,_0x358837){return db[_0x59c2('0x4b')][_0x59c2('0x68')]({'where':{'id':_0x564d46[_0x59c2('0x64')]['id']}})['then'](handleEntityNotFound(_0x358837,null))[_0x59c2('0x12')](function(_0x3eb5e4){if(_0x3eb5e4){return _0x3eb5e4['addAgents'](_0x564d46[_0x59c2('0x66')][_0x59c2('0x73')],_['omit'](_0x564d46[_0x59c2('0x66')],[_0x59c2('0x73'),'id'])||{})[_0x59c2('0xc0')](function(_0x254a46){for(var _0x534b53=0x0;_0x534b53<_0x564d46[_0x59c2('0x66')][_0x59c2('0x73')]['length'];_0x534b53+=0x1){socket[_0x59c2('0xc1')](_0x59c2('0xc2'),{'UserId':Number(_0x564d46[_0x59c2('0x66')]['ids'][_0x534b53]),'MailAccountId':Number(_0x564d46['params']['id'])});}return _0x254a46;});}})[_0x59c2('0x12')](respondWithResult(_0x358837,null))[_0x59c2('0x1b')](handleError(_0x358837,null));};exports[_0x59c2('0xc3')]=function(_0x11af8b,_0x132244){return db['MailAccount'][_0x59c2('0x68')]({'where':{'id':_0x11af8b[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x132244,null))[_0x59c2('0x12')](function(_0x45969a){if(_0x45969a){return _0x45969a[_0x59c2('0xc3')](_0x11af8b[_0x59c2('0x50')][_0x59c2('0x73')])[_0x59c2('0x12')](function(){if(_[_0x59c2('0xc4')](_0x11af8b['query'][_0x59c2('0x73')])){for(var _0x16b85b=0x0;_0x16b85b<_0x11af8b['query'][_0x59c2('0x73')]['length'];_0x16b85b+=0x1){socket[_0x59c2('0xc1')](_0x59c2('0xc5'),{'UserId':Number(_0x11af8b[_0x59c2('0x50')][_0x59c2('0x73')][_0x16b85b]),'MailAccountId':Number(_0x11af8b['params']['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x11af8b['query'][_0x59c2('0x73')]),'MailAccountId':Number(_0x11af8b[_0x59c2('0x64')]['id'])});}});}})[_0x59c2('0x12')](respondWithStatusCode(_0x132244,null))[_0x59c2('0x1b')](handleError(_0x132244,null));};exports[_0x59c2('0xc6')]=function(_0x387c39,_0x9630ae){var _0x38af59={};var _0xc04105={};var _0x129168;var _0x574113;return db[_0x59c2('0x4b')]['findOne']({'where':{'id':_0x387c39[_0x59c2('0x64')]['id']}})[_0x59c2('0x12')](handleEntityNotFound(_0x9630ae,null))[_0x59c2('0x12')](function(_0x2d2b1e){if(_0x2d2b1e){_0x129168=_0x2d2b1e;_0xc04105[_0x59c2('0x4f')]=_[_0x59c2('0x51')](db[_0x59c2('0x8d')]['rawAttributes']);_0xc04105['query']=_['keys'](_0x387c39[_0x59c2('0x50')]);_0xc04105['filters']=_['intersection'](_0xc04105[_0x59c2('0x4f')],_0xc04105[_0x59c2('0x50')]);_0x38af59['attributes']=_[_0x59c2('0x53')](_0xc04105[_0x59c2('0x4f')],qs[_0x59c2('0x55')](_0x387c39[_0x59c2('0x50')][_0x59c2('0x55')]));_0x38af59['attributes']=_0x38af59['attributes'][_0x59c2('0x71')]?_0x38af59[_0x59c2('0x54')]:_0xc04105[_0x59c2('0x4f')];_0x38af59[_0x59c2('0x58')]=qs[_0x59c2('0x59')](_0x387c39[_0x59c2('0x50')][_0x59c2('0x59')]);_0x38af59['where']=qs['filters'](_['pick'](_0x387c39[_0x59c2('0x50')],_0xc04105['filters']));if(_0x387c39[_0x59c2('0x50')][_0x59c2('0x5c')]){_0x38af59[_0x59c2('0x5a')]=_[_0x59c2('0x5d')](_0x38af59[_0x59c2('0x5a')],{'$or':_['map'](_0x38af59[_0x59c2('0x54')],function(_0x129606){var _0x4dd7ea={};_0x4dd7ea[_0x129606]={'$like':'%'+_0x387c39[_0x59c2('0x50')][_0x59c2('0x5c')]+'%'};return _0x4dd7ea;})});}_0x38af59=_[_0x59c2('0x5d')]({},_0x38af59,_0x387c39[_0x59c2('0x5f')]);return _0x129168[_0x59c2('0xc6')](_0x38af59);}})[_0x59c2('0x12')](function(_0x567429){if(_0x567429){_0x574113=_0x567429['length'];if(!_0x387c39[_0x59c2('0x50')][_0x59c2('0x56')](_0x59c2('0x57'))){_0x38af59[_0x59c2('0x22')]=qs[_0x59c2('0x22')](_0x387c39[_0x59c2('0x50')][_0x59c2('0x22')]);_0x38af59[_0x59c2('0x20')]=qs['offset'](_0x387c39[_0x59c2('0x50')][_0x59c2('0x20')]);}return _0x129168['getAgents'](_0x38af59);}})[_0x59c2('0x12')](function(_0x13c44e){if(_0x13c44e){return _0x13c44e?{'count':_0x574113,'rows':_0x13c44e}:null;}})['then'](respondWithResult(_0x9630ae,null))[_0x59c2('0x1b')](handleError(_0x9630ae,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index cc109a4..ae3961f 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 _0x3809=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners','update','remove'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0x3809,0xca));var _0x9380=function(_0xc92a71,_0x5523d7){_0xc92a71=_0xc92a71-0x0;var _0x5e3012=_0x3809[_0xc92a71];return _0x5e3012;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x9380('0x0'))['db'][_0x9380('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9380('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9380('0x3'),'afterDestroy':_0x9380('0x4')};function emitEvent(_0x4f7bc9){return function(_0x543db6,_0x1b2648,_0x1e32bb){MailAccountEvents[_0x9380('0x5')](_0x4f7bc9+':'+_0x543db6['id'],_0x543db6);MailAccountEvents[_0x9380('0x5')](_0x4f7bc9,_0x543db6);_0x1e32bb(null);};}for(var e in events){if(events[_0x9380('0x6')](e)){var event=events[e];MailAccount[_0x9380('0x7')](e,emitEvent(event));}}module[_0x9380('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x5acc=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x5acc,0x1ed));var _0xc5ac=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5acc[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0xc5ac('0x0'));var MailAccount=require(_0xc5ac('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc5ac('0x2'),'afterUpdate':_0xc5ac('0x3'),'afterDestroy':_0xc5ac('0x4')};function emitEvent(_0x5eb162){return function(_0x461e94,_0x100e45,_0x14d6ec){MailAccountEvents['emit'](_0x5eb162+':'+_0x461e94['id'],_0x461e94);MailAccountEvents[_0xc5ac('0x5')](_0x5eb162,_0x461e94);_0x14d6ec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xc5ac('0x6')](e,emitEvent(event));}}module[_0xc5ac('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 a3e9347..c96a2f8 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 _0x07b5=['user','./mailAccount.attributes','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','auth','OAuth2'];(function(_0x5d3508,_0x3c0412){var _0x2890e3=function(_0x32b213){while(--_0x32b213){_0x5d3508['push'](_0x5d3508['shift']());}};_0x2890e3(++_0x3c0412);}(_0x07b5,0x1c1));var _0x507b=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0x07b5[_0x1e172a];return _0x96338b;};'use strict';var attributes=require(_0x507b('0x0'));module['exports']=function(_0x395dcf){return _0x395dcf['define'](_0x507b('0x1'),attributes,{'tableName':_0x507b('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x247c79=this;var _0x4a48ef={'id':_0x247c79['id'],'tls':{'rejectUnauthorized':![]}};if(_0x247c79[_0x507b('0x3')]!==_0x507b('0x4')){_0x4a48ef[_0x507b('0x5')]=_0x247c79[_0x507b('0x3')];}else{_0x4a48ef[_0x507b('0x6')]=_0x247c79[_0x507b('0x7')]['host'];_0x4a48ef[_0x507b('0x8')]=_0x247c79['Smtp'][_0x507b('0x8')];_0x4a48ef[_0x507b('0x9')]=_0x247c79[_0x507b('0x7')][_0x507b('0x9')];}if(_0x247c79['Smtp'][_0x507b('0xa')]){if(_0x247c79[_0x507b('0x7')][_0x507b('0xb')]){if(!_0x247c79[_0x507b('0x7')][_0x507b('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x4a48ef[_0x507b('0xd')]={'type':_0x507b('0xe'),'user':_0x247c79[_0x507b('0x7')][_0x507b('0xf')],'accessToken':_0x247c79['Smtp'][_0x507b('0xc')]['data5']};}else{_0x4a48ef[_0x507b('0xd')]={'user':_0x247c79[_0x507b('0x7')][_0x507b('0xf')],'pass':_0x247c79[_0x507b('0x7')]['pass']};}}return _0x4a48ef;}}});}; \ No newline at end of file +var _0xe36f=['port','secure','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','CloudProvider','pass','./mailAccount.attributes','exports','MailAccount','provider','service','host','Smtp'];(function(_0x19f856,_0x45c872){var _0x5d8177=function(_0x5c46c7){while(--_0x5c46c7){_0x19f856['push'](_0x19f856['shift']());}};_0x5d8177(++_0x45c872);}(_0xe36f,0x9e));var _0xfe36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe36f[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xfe36('0x0'));module[_0xfe36('0x1')]=function(_0x9a2a41){return _0x9a2a41['define'](_0xfe36('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5d62d8=this;var _0x34b7e1={'id':_0x5d62d8['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5d62d8[_0xfe36('0x3')]!=='custom'){_0x34b7e1[_0xfe36('0x4')]=_0x5d62d8['provider'];}else{_0x34b7e1[_0xfe36('0x5')]=_0x5d62d8[_0xfe36('0x6')][_0xfe36('0x5')];_0x34b7e1['port']=_0x5d62d8[_0xfe36('0x6')][_0xfe36('0x7')];_0x34b7e1[_0xfe36('0x8')]=_0x5d62d8['Smtp'][_0xfe36('0x8')];}if(_0x5d62d8[_0xfe36('0x6')]['authentication']){if(_0x5d62d8['Smtp'][_0xfe36('0x9')]){if(!_0x5d62d8[_0xfe36('0x6')]['CloudProvider'])throw new Error(_0xfe36('0xa'));_0x34b7e1[_0xfe36('0xb')]={'type':'OAuth2','user':_0x5d62d8['Smtp'][_0xfe36('0xc')],'accessToken':_0x5d62d8[_0xfe36('0x6')][_0xfe36('0xd')]['data5']};}else{_0x34b7e1['auth']={'user':_0x5d62d8['Smtp']['user'],'pass':_0x5d62d8[_0xfe36('0x6')][_0xfe36('0xe')]};}}return _0x34b7e1;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index d36f80a..fb1f074 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 _0xd943=['MailServerOut','Smtp','CloudProvider','get','account','omit','smtpOptions','applications','list','asc','autoclose','close','Contacts','length','defaults','ListId','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','create','spread','attach','interaction','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailAccount','findAll','options','where','attributes','limit','include','map','model','stringify','GetMailAccount','ShowMailAccount','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','updatedAt','CompanyId','isNil','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','DESC','MailApplication','Applications'];(function(_0x5027eb,_0xe4f02a){var _0x475dca=function(_0x12ee7c){while(--_0x12ee7c){_0x5027eb['push'](_0x5027eb['shift']());}};_0x475dca(++_0xe4f02a);}(_0xd943,0x15d));var _0x3d94=function(_0x196174,_0x1e4654){_0x196174=_0x196174-0x0;var _0x970b2b=_0xd943[_0x196174];return _0x970b2b;};'use strict';var _=require(_0x3d94('0x0'));var moment=require(_0x3d94('0x1'));var BPromise=require(_0x3d94('0x2'));var rs=require(_0x3d94('0x3'));var Redis=require('ioredis');var db=require(_0x3d94('0x4'))['db'];var logger=require(_0x3d94('0x5'))(_0x3d94('0x6'));var config=require(_0x3d94('0x7'));var jayson=require(_0x3d94('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0x3d94('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3d94('0xa'))(new Redis(config[_0x3d94('0x9')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3984a3,_0x27e381,_0x1cc58c){return new BPromise(function(_0x5908a7,_0x182066){return client['request'](_0x3984a3,_0x1cc58c)[_0x3d94('0xb')](function(_0x301536){logger['info'](_0x3d94('0xc'),_0x27e381,_0x3d94('0xd'));logger[_0x3d94('0xe')](_0x3d94('0xf'),_0x27e381,_0x3d94('0xd'),JSON['stringify'](_0x301536));if(_0x301536[_0x3d94('0x10')]){if(_0x301536[_0x3d94('0x10')][_0x3d94('0x11')]===0x1f4){logger['error'](_0x3d94('0xc'),_0x27e381,_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);return _0x182066(_0x301536['error'][_0x3d94('0x12')]);}logger[_0x3d94('0x10')](_0x3d94('0xc'),_0x27e381,_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);return _0x5908a7(_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);}else{logger[_0x3d94('0x13')]('MailAccount,\x20%s,\x20%s',_0x27e381,_0x3d94('0xd'));_0x5908a7(_0x301536[_0x3d94('0x14')][_0x3d94('0x12')]);}})[_0x3d94('0x15')](function(_0x4afc92){logger[_0x3d94('0x10')](_0x3d94('0xc'),_0x27e381,_0x4afc92);_0x182066(_0x4afc92);});});}exports['GetMailAccount']=function(_0x9bca24){var _0x59b741=this;return new Promise(function(_0x28bead,_0x193934){return db[_0x3d94('0x16')][_0x3d94('0x17')]({'raw':_0x9bca24[_0x3d94('0x18')]?_0x9bca24['options']['raw']===undefined?!![]:![]:!![],'where':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x19')]||null:null,'attributes':_0x9bca24['options']?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1a')]||null:null,'limit':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1b')]||null:null,'include':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1c')],function(_0x192839){return{'model':db[_0x192839[_0x3d94('0x1e')]],'as':_0x192839['as'],'attributes':_0x192839[_0x3d94('0x1a')],'include':_0x192839[_0x3d94('0x1c')]?_['map'](_0x192839[_0x3d94('0x1c')],function(_0x558fd2){return{'model':db[_0x558fd2[_0x3d94('0x1e')]],'as':_0x558fd2['as'],'attributes':_0x558fd2[_0x3d94('0x1a')],'include':_0x558fd2[_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x558fd2[_0x3d94('0x1c')],function(_0x82b568){return{'model':db[_0x82b568[_0x3d94('0x1e')]],'as':_0x82b568['as'],'attributes':_0x82b568['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x362642){logger['info']('GetMailAccount',_0x9bca24);logger[_0x3d94('0xe')]('GetMailAccount',_0x9bca24,JSON[_0x3d94('0x1f')](_0x362642));_0x28bead(_0x362642);})[_0x3d94('0x15')](function(_0x32403a){logger['error'](_0x3d94('0x20'),_0x32403a['message'],_0x9bca24);_0x193934(_0x59b741[_0x3d94('0x10')](0x1f4,_0x32403a['message']));});});};exports[_0x3d94('0x21')]=function(_0x215ad7){var _0x29b1ff=this;return new Promise(function(_0x246f88,_0x50560c){return db[_0x3d94('0x16')]['find']({'raw':_0x215ad7[_0x3d94('0x18')]?_0x215ad7[_0x3d94('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x215ad7['options']?_0x215ad7[_0x3d94('0x18')][_0x3d94('0x19')]||null:null,'attributes':_0x215ad7[_0x3d94('0x18')]?_0x215ad7['options'][_0x3d94('0x1a')]||null:null,'include':_0x215ad7[_0x3d94('0x18')]?_0x215ad7['options'][_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x215ad7[_0x3d94('0x18')][_0x3d94('0x1c')],function(_0x782c1){return{'model':db[_0x782c1['model']],'as':_0x782c1['as'],'attributes':_0x782c1[_0x3d94('0x1a')],'include':_0x782c1[_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x782c1[_0x3d94('0x1c')],function(_0xb493f1){return{'model':db[_0xb493f1[_0x3d94('0x1e')]],'as':_0xb493f1['as'],'attributes':_0xb493f1['attributes'],'include':_0xb493f1['include']?_[_0x3d94('0x1d')](_0xb493f1[_0x3d94('0x1c')],function(_0x1c1b25){return{'model':db[_0x1c1b25[_0x3d94('0x1e')]],'as':_0x1c1b25['as'],'attributes':_0x1c1b25[_0x3d94('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3d94('0xb')](function(_0x2ef743){if(_0x215ad7[_0x3d94('0x18')][_0x3d94('0x22')]===!![])_0x2ef743[_0x3d94('0x23')]('smtpOptions',_0x2ef743[_0x3d94('0x24')]());logger[_0x3d94('0x13')](_0x3d94('0x21'),_0x215ad7);logger[_0x3d94('0xe')]('ShowMailAccount',_0x215ad7,JSON[_0x3d94('0x1f')](_0x2ef743));_0x246f88(_0x2ef743);})[_0x3d94('0x15')](function(_0x35e0e6){logger[_0x3d94('0x10')](_0x3d94('0x21'),_0x35e0e6['message'],_0x215ad7);_0x50560c(_0x29b1ff[_0x3d94('0x10')](0x1f4,_0x35e0e6[_0x3d94('0x12')]));});});};exports[_0x3d94('0x25')]=function(_0x485066){var _0x4eee4d=this;return new Promise(function(_0x4d8a8f,_0x47905e){var _0x3b3550={'body':_0x485066[_0x3d94('0x26')],'channel':_0x3d94('0x27')};var _0x146ccb=_[_0x3d94('0x28')](_[_0x3d94('0x29')](db[_0x3d94('0x2a')]['rawAttributes']),['createdAt',_0x3d94('0x2b'),_0x3d94('0x2c'),'ListId']);var _0x2d0aa2=![];if(_0x485066['body']['id']){delete _0x485066[_0x3d94('0x26')]['id'];}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x26')])||_0x485066['body'][_0x3d94('0x26')]===''){return _0x47905e(_0x4eee4d['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x146ccb));}if(!_[_0x3d94('0x30')](_0x146ccb,_0x485066['body'][_0x3d94('0x2f')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,_0x3d94('0x31')+_0x146ccb));}var _0x15c8e7={};_0x15c8e7[_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')]]=_0x485066[_0x3d94('0x26')]['from'];return db[_0x3d94('0x16')][_0x3d94('0x32')]({'where':{'id':_0x485066['account']['id']},'include':[{'model':db['CmList'],'as':_0x3d94('0x33'),'include':[{'model':db[_0x3d94('0x2a')],'as':'Contacts','where':_0x15c8e7,'limit':0x1,'order':[[_0x3d94('0x2b'),_0x3d94('0x34')]]}]},{'model':db[_0x3d94('0x35')],'as':_0x3d94('0x36')},{'model':db[_0x3d94('0x37')],'as':_0x3d94('0x38'),'include':[{'model':db[_0x3d94('0x39')],'as':_0x3d94('0x39')}]}]})[_0x3d94('0xb')](function(_0x2429bc){if(_0x2429bc&&_0x2429bc[_0x3d94('0x33')]){var _0x29682b=_0x2429bc[_0x3d94('0x3a')]({'plain':!![]});_0x3b3550[_0x3d94('0x3b')]=_[_0x3d94('0x3c')](_0x29682b,['Applications',_0x3d94('0x33')]);_0x3b3550[_0x3d94('0x3b')][_0x3d94('0x3d')]=_0x2429bc[_0x3d94('0x24')]();_0x3b3550[_0x3d94('0x3e')]=_0x29682b[_0x3d94('0x36')];_0x3b3550[_0x3d94('0x3f')]=_0x29682b[_0x3d94('0x33')];_0x3b3550[_0x3d94('0x3e')]=_['orderBy'](_0x3b3550[_0x3d94('0x3e')],['priority'],[_0x3d94('0x40')]);if(_0x3b3550[_0x3d94('0x3b')]&&_0x3b3550['account'][_0x3d94('0x41')]){_0x3b3550['applications']['push']({'id':0x0,'priority':_0x3b3550[_0x3d94('0x3e')]['length']+0x1,'app':_0x3d94('0x42'),'appdata':_0x3d94('0x41'),'interval':'*,*,*,*'});}if(_0x3b3550[_0x3d94('0x3b')]['Applications']){delete _0x3b3550['account'][_0x3d94('0x36')];}if(_0x3b3550[_0x3d94('0x3b')][_0x3d94('0x33')]){delete _0x3b3550[_0x3d94('0x3b')][_0x3d94('0x33')];}if(_0x29682b[_0x3d94('0x33')][_0x3d94('0x43')][_0x3d94('0x44')]){return _0x29682b[_0x3d94('0x33')]['Contacts'][0x0];}var _0x28cfbb=_[_0x3d94('0x45')](_0x485066[_0x3d94('0x26')],{'firstName':_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')],'ListId':_0x29682b[_0x3d94('0x46')]});_0x28cfbb[_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')]]=_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')];return db[_0x3d94('0x2a')]['create'](_0x28cfbb);}else{throw new Error(_0x3d94('0x47'));}})['then'](function(_0x709841){_0x3b3550[_0x3d94('0x48')]=_0x709841;if(_0x709841){if(!_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')]){_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')]=rs[_0x3d94('0x4a')]()+'\x20'+_0x485066['body']['message'][_0x3d94('0x2e')];}var _0x4bd97c={'ContactId':_0x709841['id'],'MailAccountId':_0x485066[_0x3d94('0x3b')]['id'],'inReplyTo':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x49')],'to':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x2e')],'cc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['cc'],'subject':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x4b')],'attach':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['attach'],'lastMsgAt':moment()[_0x3d94('0x4c')](_0x3d94('0x4d')),'lastMsgDirection':'in'};return db[_0x3d94('0x4e')][_0x3d94('0x32')]({'where':{'closed':![],'MailAccountId':_0x485066['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x3d94('0x4f'),'attributes':[_0x3d94('0x49')],'where':{'messageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['inReplyTo']}}]})[_0x3d94('0xb')](function(_0x1c99d1){if(_0x1c99d1){return[_0x1c99d1,![]];}return db['MailInteraction'][_0x3d94('0x50')](_0x4bd97c)[_0x3d94('0xb')](function(_0x336e36){return[_0x336e36,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3d94('0x51')](function(_0x227372,_0x585531){if(_0x227372){_0x2d0aa2=_0x585531;if(!_0x585531){return _0x227372['update']({'inReplyTo':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['messageId'],'to':_0x485066['body']['message'][_0x3d94('0x2e')],'cc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['cc'],'subject':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['subject'],'attach':_0x227372[_0x3d94('0x52')]?_0x227372[_0x3d94('0x52')]:_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x52')],'substatus':null,'substatusAt':moment()[_0x3d94('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x3d94('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x227372;}}})[_0x3d94('0xb')](function(_0x41d561){_0x3b3550[_0x3d94('0x53')]=_0x41d561[_0x3d94('0x3a')]({'plain':!![]});_0x3b3550[_0x3d94('0x53')][_0x3d94('0x54')]=_0x2d0aa2;return db['MailMessage']['create']({'body':_0x485066[_0x3d94('0x26')]['body'],'MailAccountId':_0x485066['account']['id'],'MailInteractionId':_0x41d561['id'],'direction':'in','ContactId':_0x3b3550['contact']['id'],'messageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')],'from':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x2e')],'to':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['to'],'cc':_0x485066['body'][_0x3d94('0x12')]['cc'],'subject':_0x485066['body'][_0x3d94('0x12')][_0x3d94('0x4b')],'attach':_0x485066[_0x3d94('0x26')]['message']['attach'],'Attachments':_0x485066['body'][_0x3d94('0x12')][_0x3d94('0x55')],'originTo':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x56')],'originCc':_0x485066['body']['message'][_0x3d94('0x57')],'bcc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['bcc'],'ChatWebsiteId':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x58')]||null,'originChannel':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x59')]||_0x3d94('0x5a'),'ChatOfflineMessageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x5b')]||null},{'include':[{'model':db[_0x3d94('0x5c')],'as':_0x3d94('0x5d')}]});})[_0x3d94('0xb')](function(_0xe6cfd1){_0x3b3550[_0x3d94('0x12')]=_0xe6cfd1;if(_0x3b3550['interaction'][_0x3d94('0x5e')]){return db[_0x3d94('0x5f')][_0x3d94('0x32')]({'attributes':['id',_0x3d94('0x60')],'where':{'id':_0x3b3550['interaction'][_0x3d94('0x5e')]}})['then'](function(_0x4f217f){if(_0x4f217f){_0x3b3550[_0x3d94('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3d94('0x61'),'appdata':_0x4f217f[_0x3d94('0x60')]+','+(_0x3b3550['account'][_0x3d94('0x62')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3d94('0x63'),_0x3d94('0x64'),_0x3b3550);});}return respondWithRpcPromise('Start','startRouting',_0x3b3550);})['then'](function(_0x833d96){_0x4d8a8f(_0x833d96);})['catch'](function(_0x5a8114){_0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,_0x5a8114[_0x3d94('0x12')]));});});}; \ No newline at end of file +var _0xc2c7=['defaults','./mailAccount.socket','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','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','DESC','MailApplication','Smtp','CloudProvider','get','omit','Applications','applications','orderBy','asc','autoclose','push','close','Contacts','length','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x2bf143,_0x13e73a){var _0xcfa4a=function(_0x40c503){while(--_0x40c503){_0x2bf143['push'](_0x2bf143['shift']());}};_0xcfa4a(++_0x13e73a);}(_0xc2c7,0x134));var _0x7c2c=function(_0x260be3,_0x16f900){_0x260be3=_0x260be3-0x0;var _0x4e1bda=_0xc2c7[_0x260be3];return _0x4e1bda;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var BPromise=require(_0x7c2c('0x1'));var rs=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c2c('0x8')]({'port':0x232c});config[_0x7c2c('0x9')]=_[_0x7c2c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2c('0x9')]));require(_0x7c2c('0xb'))[_0x7c2c('0xc')](socket);function respondWithRpcPromise(_0x3b780b,_0x279cff,_0x57b107){return new BPromise(function(_0x3093d2,_0x307bec){return client[_0x7c2c('0xd')](_0x3b780b,_0x57b107)[_0x7c2c('0xe')](function(_0x2587ec){logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x279cff,_0x7c2c('0x11'));logger[_0x7c2c('0x12')](_0x7c2c('0x13'),_0x279cff,_0x7c2c('0x11'),JSON[_0x7c2c('0x14')](_0x2587ec));if(_0x2587ec[_0x7c2c('0x15')]){if(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x16')]===0x1f4){logger[_0x7c2c('0x15')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x2587ec['error'][_0x7c2c('0x17')]);return _0x307bec(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x17')]);}logger['error'](_0x7c2c('0x10'),_0x279cff,_0x2587ec[_0x7c2c('0x15')]['message']);return _0x3093d2(_0x2587ec[_0x7c2c('0x15')]['message']);}else{logger[_0x7c2c('0xf')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x7c2c('0x11'));_0x3093d2(_0x2587ec[_0x7c2c('0x18')][_0x7c2c('0x17')]);}})[_0x7c2c('0x19')](function(_0x17df4a){logger[_0x7c2c('0x15')](_0x7c2c('0x10'),_0x279cff,_0x17df4a);_0x307bec(_0x17df4a);});});}exports[_0x7c2c('0x1a')]=function(_0x2d356e){var _0x39c5f3=this;return new Promise(function(_0x40eaef,_0x2381b4){return db['MailAccount'][_0x7c2c('0x1b')]({'raw':_0x2d356e['options']?_0x2d356e['options'][_0x7c2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1e')]||null:null,'attributes':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'limit':_0x2d356e['options']?_0x2d356e[_0x7c2c('0x1d')]['limit']||null:null,'include':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x2d356e[_0x7c2c('0x1d')]['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x22')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1f')],'include':_0x4d6ec7[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x4d6ec7[_0x7c2c('0x20')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x22')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes'],'include':_0xa8e145[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0xa8e145[_0x7c2c('0x20')],function(_0x22d03f){return{'model':db[_0x22d03f[_0x7c2c('0x22')]],'as':_0x22d03f['as'],'attributes':_0x22d03f[_0x7c2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0x26f472){logger[_0x7c2c('0xf')]('GetMailAccount',_0x2d356e);logger[_0x7c2c('0x12')](_0x7c2c('0x1a'),_0x2d356e,JSON[_0x7c2c('0x14')](_0x26f472));_0x40eaef(_0x26f472);})[_0x7c2c('0x19')](function(_0x53ad23){logger[_0x7c2c('0x15')](_0x7c2c('0x1a'),_0x53ad23[_0x7c2c('0x17')],_0x2d356e);_0x2381b4(_0x39c5f3[_0x7c2c('0x15')](0x1f4,_0x53ad23[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x23')]=function(_0x463ef7){var _0x57af44=this;return new Promise(function(_0x1969f4,_0x1acf75){return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'raw':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['raw']===undefined?!![]:![]:!![],'where':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['where']||null:null,'attributes':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'include':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x20')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x22')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1f')],'include':_0x204968[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x204968[_0x7c2c('0x20')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x22')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1f')],'include':_0x3230a1['include']?_['map'](_0x3230a1[_0x7c2c('0x20')],function(_0x4acc5d){return{'model':db[_0x4acc5d['model']],'as':_0x4acc5d['as'],'attributes':_0x4acc5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0xc77f11){if(_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x26')]===!![])_0xc77f11[_0x7c2c('0x27')](_0x7c2c('0x28'),_0xc77f11[_0x7c2c('0x29')]());logger[_0x7c2c('0xf')](_0x7c2c('0x23'),_0x463ef7);logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x463ef7,JSON['stringify'](_0xc77f11));_0x1969f4(_0xc77f11);})['catch'](function(_0x3920b6){logger[_0x7c2c('0x15')](_0x7c2c('0x23'),_0x3920b6[_0x7c2c('0x17')],_0x463ef7);_0x1acf75(_0x57af44['error'](0x1f4,_0x3920b6[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x2a')]=function(_0x93e2a8){var _0x45fddf=this;return new Promise(function(_0x18e288,_0x8b0dc9){var _0x12c9cd={'body':_0x93e2a8[_0x7c2c('0x2b')],'channel':_0x7c2c('0x2c')};var _0x4e1f79=_[_0x7c2c('0x2d')](_['keys'](db[_0x7c2c('0x2e')][_0x7c2c('0x2f')]),['createdAt',_0x7c2c('0x30'),'CompanyId',_0x7c2c('0x31')]);var _0x33b2be=![];if(_0x93e2a8[_0x7c2c('0x2b')]['id']){delete _0x93e2a8[_0x7c2c('0x2b')]['id'];}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')]['from'])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x32')));}if(_[_0x7c2c('0x33')](_0x93e2a8[_0x7c2c('0x2b')]['body'])||_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x2b')]===''){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x34')));}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}if(!_[_0x7c2c('0x36')](_0x4e1f79,_0x93e2a8[_0x7c2c('0x2b')]['mapKey'])){return _0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}var _0x51e3b7={};_0x51e3b7[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'where':{'id':_0x93e2a8[_0x7c2c('0x38')]['id']},'include':[{'model':db[_0x7c2c('0x39')],'as':_0x7c2c('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51e3b7,'limit':0x1,'order':[[_0x7c2c('0x30'),_0x7c2c('0x3b')]]}]},{'model':db[_0x7c2c('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7c2c('0x3d'),'include':[{'model':db[_0x7c2c('0x3e')],'as':_0x7c2c('0x3e')}]}]})[_0x7c2c('0xe')](function(_0x5f3de8){if(_0x5f3de8&&_0x5f3de8['List']){var _0x587667=_0x5f3de8[_0x7c2c('0x3f')]({'plain':!![]});_0x12c9cd[_0x7c2c('0x38')]=_[_0x7c2c('0x40')](_0x587667,[_0x7c2c('0x41'),_0x7c2c('0x3a')]);_0x12c9cd['account'][_0x7c2c('0x28')]=_0x5f3de8[_0x7c2c('0x29')]();_0x12c9cd['applications']=_0x587667[_0x7c2c('0x41')];_0x12c9cd['list']=_0x587667[_0x7c2c('0x3a')];_0x12c9cd[_0x7c2c('0x42')]=_[_0x7c2c('0x43')](_0x12c9cd['applications'],['priority'],[_0x7c2c('0x44')]);if(_0x12c9cd['account']&&_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x45')]){_0x12c9cd['applications'][_0x7c2c('0x46')]({'id':0x0,'priority':_0x12c9cd[_0x7c2c('0x42')]['length']+0x1,'app':_0x7c2c('0x47'),'appdata':_0x7c2c('0x45'),'interval':'*,*,*,*'});}if(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x41')]){delete _0x12c9cd[_0x7c2c('0x38')]['Applications'];}if(_0x12c9cd[_0x7c2c('0x38')]['List']){delete _0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x3a')];}if(_0x587667['List'][_0x7c2c('0x48')][_0x7c2c('0x49')]){return _0x587667[_0x7c2c('0x3a')][_0x7c2c('0x48')][0x0];}var _0x481b9e=_[_0x7c2c('0xa')](_0x93e2a8[_0x7c2c('0x2b')],{'firstName':_0x93e2a8['body'][_0x7c2c('0x37')],'ListId':_0x587667['ListId']});_0x481b9e[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x2e')]['create'](_0x481b9e);}else{throw new Error(_0x7c2c('0x4a'));}})[_0x7c2c('0xe')](function(_0x4c4661){_0x12c9cd['contact']=_0x4c4661;if(_0x4c4661){if(!_0x93e2a8['body'][_0x7c2c('0x17')]['messageId']){_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x4b')]=rs[_0x7c2c('0x4c')]()+'\x20'+_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x37')];}var _0x1ee34d={'ContactId':_0x4c4661['id'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'inReplyTo':_0x93e2a8[_0x7c2c('0x2b')]['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8[_0x7c2c('0x2b')]['message']['attach'],'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7c2c('0x25')]({'where':{'closed':![],'MailAccountId':_0x93e2a8['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x7c2c('0x50'),'attributes':[_0x7c2c('0x4b')],'where':{'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x51')]}}]})[_0x7c2c('0xe')](function(_0x2d4459){if(_0x2d4459){return[_0x2d4459,![]];}return db[_0x7c2c('0x52')][_0x7c2c('0x53')](_0x1ee34d)[_0x7c2c('0xe')](function(_0xd01d59){return[_0xd01d59,!![]];});});}else{throw new Error(_0x7c2c('0x54'));}})[_0x7c2c('0x55')](function(_0x3d44f8,_0x559005){if(_0x3d44f8){_0x33b2be=_0x559005;if(!_0x559005){return _0x3d44f8[_0x7c2c('0x56')]({'inReplyTo':_0x93e2a8['body']['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['subject'],'attach':_0x3d44f8[_0x7c2c('0x57')]?_0x3d44f8[_0x7c2c('0x57')]:_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x57')],'substatus':null,'substatusAt':moment()[_0x7c2c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'});}else{return _0x3d44f8;}}})['then'](function(_0x39d319){_0x12c9cd[_0x7c2c('0x58')]=_0x39d319['get']({'plain':!![]});_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x59')]=_0x33b2be;return db['MailMessage']['create']({'body':_0x93e2a8[_0x7c2c('0x2b')]['body'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'MailInteractionId':_0x39d319['id'],'direction':'in','ContactId':_0x12c9cd['contact']['id'],'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['messageId'],'from':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x37')],'to':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['to'],'cc':_0x93e2a8['body'][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x57')],'Attachments':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5a')],'originTo':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5b')],'originCc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5c')],'bcc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5d')],'ChatWebsiteId':_0x93e2a8['body']['message'][_0x7c2c('0x5e')]||null,'originChannel':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['originChannel']||_0x7c2c('0x5f'),'ChatOfflineMessageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7c2c('0x60')],'as':_0x7c2c('0x61')}]});})[_0x7c2c('0xe')](function(_0x8f8b42){_0x12c9cd['message']=_0x8f8b42;if(_0x12c9cd[_0x7c2c('0x58')]['UserId']){return db[_0x7c2c('0x62')]['find']({'attributes':['id',_0x7c2c('0x63')],'where':{'id':_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x64')]}})[_0x7c2c('0xe')](function(_0x43eb9d){if(_0x43eb9d){_0x12c9cd[_0x7c2c('0x42')][_0x7c2c('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43eb9d[_0x7c2c('0x63')]+','+(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x66')]||0xa),'interval':_0x7c2c('0x67')});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);})['then'](function(_0x2d75b8){_0x18e288(_0x2d75b8);})[_0x7c2c('0x19')](function(_0x2391a7){_0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,_0x2391a7[_0x7c2c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 72a8947..84dfe6d 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 _0xc4cf=['length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x51b268,_0x309e0c){var _0x310e92=function(_0x3972e8){while(--_0x3972e8){_0x51b268['push'](_0x51b268['shift']());}};_0x310e92(++_0x309e0c);}(_0xc4cf,0xc8));var _0xfc4c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc4cf[_0x40a045];return _0x1a687c;};'use strict';var MailAccountEvents=require(_0xfc4c('0x0'));var events=[_0xfc4c('0x1'),_0xfc4c('0x2'),_0xfc4c('0x3')];function createListener(_0x31768b,_0x40866c){return function(_0x1d8819){_0x40866c['emit'](_0x31768b,_0x1d8819);};}function removeListener(_0x38555e,_0x39fa2f){return function(){MailAccountEvents['removeListener'](_0x38555e,_0x39fa2f);};}exports['register']=function(_0x427f44){for(var _0x29b037=0x0,_0x14d02b=events[_0xfc4c('0x4')];_0x29b037<_0x14d02b;_0x29b037++){var _0x500cfb=events[_0x29b037];var _0x2f5f5b=createListener(_0xfc4c('0x5')+_0x500cfb,_0x427f44);MailAccountEvents['on'](_0x500cfb,_0x2f5f5b);}}; \ No newline at end of file +var _0x0be2=['update','removeListener','register','length','mailAccount:','remove'];(function(_0x2abd57,_0x33e416){var _0x4bf622=function(_0x3d600e){while(--_0x3d600e){_0x2abd57['push'](_0x2abd57['shift']());}};_0x4bf622(++_0x33e416);}(_0x0be2,0x8f));var _0x20be=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x0be2[_0x3bb5b4];return _0x586c60;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x20be('0x0'),_0x20be('0x1')];function createListener(_0x43cfea,_0x9e9d5b){return function(_0x1168c4){_0x9e9d5b['emit'](_0x43cfea,_0x1168c4);};}function removeListener(_0xbc9bff,_0x5de6ce){return function(){MailAccountEvents[_0x20be('0x2')](_0xbc9bff,_0x5de6ce);};}exports[_0x20be('0x3')]=function(_0x14f8c2){for(var _0x2c5262=0x0,_0x494951=events[_0x20be('0x4')];_0x2c5262<_0x494951;_0x2c5262++){var _0x3bd3f4=events[_0x2c5262];var _0x16e122=createListener(_0x20be('0x5')+_0x3bd3f4,_0x14f8c2);MailAccountEvents['on'](_0x3bd3f4,_0x16e122);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 98397ec..ff63737 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 _0x6c02=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','update','destroy','exports','multer','util'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x6c02,0x67));var _0x26c0=function(_0x4a38af,_0x59ce00){_0x4a38af=_0x4a38af-0x0;var _0x1c74dd=_0x6c02[_0x4a38af];return _0x1c74dd;};'use strict';var multer=require(_0x26c0('0x0'));var util=require(_0x26c0('0x1'));var path=require('path');var timeout=require(_0x26c0('0x2'));var express=require(_0x26c0('0x3'));var router=express['Router']();var fs_extra=require(_0x26c0('0x4'));var auth=require(_0x26c0('0x5'));var interaction=require(_0x26c0('0x6'));var config=require(_0x26c0('0x7'));var controller=require('./mailApplication.controller');router[_0x26c0('0x8')](_0x26c0('0x9'),auth[_0x26c0('0xa')](),controller[_0x26c0('0xb')]);router['put']('/:id',auth[_0x26c0('0xa')](),controller[_0x26c0('0xc')]);router['delete'](_0x26c0('0x9'),auth[_0x26c0('0xa')](),controller[_0x26c0('0xd')]);module[_0x26c0('0xe')]=router; \ No newline at end of file +var _0xab26=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','put','update','destroy','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xab26,0x1c0));var _0x6ab2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xab26[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x6ab2('0x0'));var path=require(_0x6ab2('0x1'));var timeout=require(_0x6ab2('0x2'));var express=require(_0x6ab2('0x3'));var router=express[_0x6ab2('0x4')]();var fs_extra=require(_0x6ab2('0x5'));var auth=require(_0x6ab2('0x6'));var interaction=require(_0x6ab2('0x7'));var config=require('../../config/environment');var controller=require(_0x6ab2('0x8'));router['get'](_0x6ab2('0x9'),auth[_0x6ab2('0xa')](),controller[_0x6ab2('0xb')]);router[_0x6ab2('0xc')](_0x6ab2('0x9'),auth[_0x6ab2('0xa')](),controller[_0x6ab2('0xd')]);router['delete'](_0x6ab2('0x9'),auth[_0x6ab2('0xa')](),controller[_0x6ab2('0xe')]);module[_0x6ab2('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 e3396a8..b93f959 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 _0xd28a=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x3162b5,_0x1dea85){var _0x45f5ad=function(_0x5e0617){while(--_0x5e0617){_0x3162b5['push'](_0x3162b5['shift']());}};_0x45f5ad(++_0x1dea85);}(_0xd28a,0xc7));var _0xad28=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xd28a[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xad28('0x0'));module[_0xad28('0x1')]={'priority':{'type':Sequelize[_0xad28('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xad28('0x3')},'appdata':{'type':Sequelize[_0xad28('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xad28('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3689=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x5dfe2f,_0x50d958){var _0x268dec=function(_0x3aa178){while(--_0x3aa178){_0x5dfe2f['push'](_0x5dfe2f['shift']());}};_0x268dec(++_0x50d958);}(_0x3689,0xa6));var _0x9368=function(_0x514255,_0x33cff3){_0x514255=_0x514255-0x0;var _0x35b8f6=_0x3689[_0x514255];return _0x35b8f6;};'use strict';var Sequelize=require(_0x9368('0x0'));module[_0x9368('0x1')]={'priority':{'type':Sequelize[_0x9368('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9368('0x3')],'allowNull':![],'defaultValue':_0x9368('0x4')},'appdata':{'type':Sequelize[_0x9368('0x5')]()},'description':{'type':Sequelize[_0x9368('0x3')]},'interval':{'type':Sequelize[_0x9368('0x3')],'defaultValue':_0x9368('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 0beacf7..806f563 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 _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(_0x4cbb83,_0x458799){var _0x1a56ab=function(_0x1aa655){while(--_0x1aa655){_0x4cbb83['push'](_0x4cbb83['shift']());}};_0x1a56ab(++_0x458799);}(_0x9bde,0xe1));var _0xe9bd=function(_0x15dbdb,_0x407141){_0x15dbdb=_0x15dbdb-0x0;var _0xa7362c=_0x9bde[_0x15dbdb];return _0xa7362c;};'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 +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x169432,_0x130a1b){var _0x3bf91c=function(_0x44e50e){while(--_0x44e50e){_0x169432['push'](_0x169432['shift']());}};_0x3bf91c(++_0x130a1b);}(_0x54ef,0x112));var _0xf54e=function(_0x35aefc,_0x99e7f2){_0x35aefc=_0x35aefc-0x0;var _0x151456=_0x54ef[_0x35aefc];return _0x151456;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 953cd48..d784387 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 _0x175c=['bluebird','request-promise','path','rimraf','./mailApplication.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x123831,_0x8fe1d6){var _0x47455b=function(_0x36f9ab){while(--_0x36f9ab){_0x123831['push'](_0x123831['shift']());}};_0x47455b(++_0x8fe1d6);}(_0x175c,0x1ec));var _0xc175=function(_0x53033d,_0x247f9c){_0x53033d=_0x53033d-0x0;var _0x36fd94=_0x175c[_0x53033d];return _0x36fd94;};'use strict';var _=require(_0xc175('0x0'));var util=require(_0xc175('0x1'));var logger=require(_0xc175('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc175('0x3'));var rp=require(_0xc175('0x4'));var fs=require('fs');var path=require(_0xc175('0x5'));var rimraf=require(_0xc175('0x6'));var config=require('../../config/environment');var attributes=require(_0xc175('0x7'));module['exports']=function(_0x2766fe,_0x23a211){return _0x2766fe[_0xc175('0x8')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc175('0x9'),'collate':_0xc175('0xa')});}; \ No newline at end of file +var _0xa0bf=['request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0xa0bf,0x8b));var _0xfa0b=function(_0x24c9cc,_0x43e45e){_0x24c9cc=_0x24c9cc-0x0;var _0x210e08=_0xa0bf[_0x24c9cc];return _0x210e08;};'use strict';var _=require(_0xfa0b('0x0'));var util=require('util');var logger=require(_0xfa0b('0x1'))(_0xfa0b('0x2'));var moment=require(_0xfa0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xfa0b('0x4'));var fs=require('fs');var path=require(_0xfa0b('0x5'));var rimraf=require(_0xfa0b('0x6'));var config=require(_0xfa0b('0x7'));var attributes=require(_0xfa0b('0x8'));module[_0xfa0b('0x9')]=function(_0x21adac,_0x4d919d){return _0x21adac[_0xfa0b('0xa')]('MailApplication',attributes,{'tableName':_0xfa0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa0b('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6f5237f..b8e287c 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 _0x3170=['debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','options','raw','where','attributes','limit','then','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3170,0xf9));var _0x0317=function(_0x482d06,_0x1c7c4a){_0x482d06=_0x482d06-0x0;var _0x3bdd88=_0x3170[_0x482d06];return _0x3bdd88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0317('0x0'));var BPromise=require(_0x0317('0x1'));var rs=require(_0x0317('0x2'));var fs=require('fs');var Redis=require(_0x0317('0x3'));var db=require(_0x0317('0x4'))['db'];var utils=require(_0x0317('0x5'));var logger=require(_0x0317('0x6'))(_0x0317('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0317('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25eb22,_0x24e47d,_0x437486){return new BPromise(function(_0x26f827,_0xfa72e9){return client[_0x0317('0x9')](_0x25eb22,_0x437486)['then'](function(_0x4dbcd3){logger[_0x0317('0xa')]('MailApplication,\x20%s,\x20%s',_0x24e47d,_0x0317('0xb'));logger[_0x0317('0xc')](_0x0317('0xd'),_0x24e47d,_0x0317('0xb'),JSON['stringify'](_0x4dbcd3));if(_0x4dbcd3[_0x0317('0xe')]){if(_0x4dbcd3[_0x0317('0xe')][_0x0317('0xf')]===0x1f4){logger[_0x0317('0xe')](_0x0317('0x10'),_0x24e47d,_0x4dbcd3[_0x0317('0xe')][_0x0317('0x11')]);return _0xfa72e9(_0x4dbcd3[_0x0317('0xe')][_0x0317('0x11')]);}logger[_0x0317('0xe')](_0x0317('0x10'),_0x24e47d,_0x4dbcd3[_0x0317('0xe')]['message']);return _0x26f827(_0x4dbcd3[_0x0317('0xe')]['message']);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x24e47d,_0x0317('0xb'));_0x26f827(_0x4dbcd3[_0x0317('0x12')]['message']);}})[_0x0317('0x13')](function(_0x5c780c){logger[_0x0317('0xe')](_0x0317('0x10'),_0x24e47d,_0x5c780c);_0xfa72e9(_0x5c780c);});});}exports[_0x0317('0x14')]=function(_0x134745){var _0x478774=this;return new Promise(function(_0x38fb0e,_0x39ac30){return db['MailApplication'][_0x0317('0x15')](_0x134745['body'],{'raw':_0x134745[_0x0317('0x16')]?_0x134745[_0x0317('0x16')][_0x0317('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x134745[_0x0317('0x16')]?_0x134745[_0x0317('0x16')][_0x0317('0x18')]||null:null,'attributes':_0x134745[_0x0317('0x16')]?_0x134745['options'][_0x0317('0x19')]||null:null,'limit':_0x134745[_0x0317('0x16')]?_0x134745['options'][_0x0317('0x1a')]||null:null})[_0x0317('0x1b')](function(_0x53edc4){logger[_0x0317('0xa')](_0x0317('0x14'),_0x134745);logger[_0x0317('0xc')](_0x0317('0x14'),_0x134745,JSON[_0x0317('0x1c')](_0x53edc4));_0x38fb0e(_0x53edc4);})[_0x0317('0x13')](function(_0x3a9ba0){logger['error']('UpdateMailApplication',_0x3a9ba0[_0x0317('0x11')],_0x134745);_0x39ac30(_0x478774[_0x0317('0xe')](0x1f4,_0x3a9ba0[_0x0317('0x11')]));});});}; \ No newline at end of file +var _0xca88=['request','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateMailApplication','MailApplication','body','options','raw','attributes','limit','then','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x56b9f2,_0x2b736c){var _0x1d9c26=function(_0x190326){while(--_0x190326){_0x56b9f2['push'](_0x56b9f2['shift']());}};_0x1d9c26(++_0x2b736c);}(_0xca88,0x18c));var _0x8ca8=function(_0x5280f8,_0x1bce8c){_0x5280f8=_0x5280f8-0x0;var _0x518c84=_0xca88[_0x5280f8];return _0x518c84;};'use strict';var _=require(_0x8ca8('0x0'));var util=require('util');var moment=require(_0x8ca8('0x1'));var BPromise=require(_0x8ca8('0x2'));var rs=require(_0x8ca8('0x3'));var fs=require('fs');var Redis=require(_0x8ca8('0x4'));var db=require(_0x8ca8('0x5'))['db'];var utils=require(_0x8ca8('0x6'));var logger=require(_0x8ca8('0x7'))('rpc');var config=require(_0x8ca8('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x129c44,_0x114df2,_0x4c912e){return new BPromise(function(_0x4d733b,_0x436d1f){return client[_0x8ca8('0x9')](_0x129c44,_0x4c912e)['then'](function(_0x516b87){logger[_0x8ca8('0xa')](_0x8ca8('0xb'),_0x114df2,'request\x20sent');logger['debug'](_0x8ca8('0xc'),_0x114df2,_0x8ca8('0xd'),JSON['stringify'](_0x516b87));if(_0x516b87[_0x8ca8('0xe')]){if(_0x516b87[_0x8ca8('0xe')][_0x8ca8('0xf')]===0x1f4){logger[_0x8ca8('0xe')]('MailApplication,\x20%s,\x20%s',_0x114df2,_0x516b87['error'][_0x8ca8('0x10')]);return _0x436d1f(_0x516b87['error'][_0x8ca8('0x10')]);}logger[_0x8ca8('0xe')](_0x8ca8('0xb'),_0x114df2,_0x516b87[_0x8ca8('0xe')][_0x8ca8('0x10')]);return _0x4d733b(_0x516b87[_0x8ca8('0xe')]['message']);}else{logger['info'](_0x8ca8('0xb'),_0x114df2,_0x8ca8('0xd'));_0x4d733b(_0x516b87['result'][_0x8ca8('0x10')]);}})[_0x8ca8('0x11')](function(_0x525034){logger[_0x8ca8('0xe')](_0x8ca8('0xb'),_0x114df2,_0x525034);_0x436d1f(_0x525034);});});}exports[_0x8ca8('0x12')]=function(_0x1df841){var _0x12b2bc=this;return new Promise(function(_0x2913be,_0x1037de){return db[_0x8ca8('0x13')]['update'](_0x1df841[_0x8ca8('0x14')],{'raw':_0x1df841[_0x8ca8('0x15')]?_0x1df841[_0x8ca8('0x15')][_0x8ca8('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1df841[_0x8ca8('0x15')]?_0x1df841[_0x8ca8('0x15')]['where']||null:null,'attributes':_0x1df841[_0x8ca8('0x15')]?_0x1df841[_0x8ca8('0x15')][_0x8ca8('0x17')]||null:null,'limit':_0x1df841['options']?_0x1df841[_0x8ca8('0x15')][_0x8ca8('0x18')]||null:null})[_0x8ca8('0x19')](function(_0x2ce47d){logger[_0x8ca8('0xa')]('UpdateMailApplication',_0x1df841);logger[_0x8ca8('0x1a')](_0x8ca8('0x12'),_0x1df841,JSON['stringify'](_0x2ce47d));_0x2913be(_0x2ce47d);})['catch'](function(_0x67a32e){logger[_0x8ca8('0xe')]('UpdateMailApplication',_0x67a32e[_0x8ca8('0x10')],_0x1df841);_0x1037de(_0x12b2bc['error'](0x1f4,_0x67a32e[_0x8ca8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 82d16eb..3fef06d 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 _0x727b=['create','/:id/messages','/:id/tags','mailinteraction:addtags','addTags','tracked','update','delete','mail','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','getMessages','download','post'];(function(_0x4a73c0,_0x1072e3){var _0x3b4fa3=function(_0x20e2b6){while(--_0x20e2b6){_0x4a73c0['push'](_0x4a73c0['shift']());}};_0x3b4fa3(++_0x1072e3);}(_0x727b,0xe3));var _0xb727=function(_0x569bda,_0x383e42){_0x569bda=_0x569bda-0x0;var _0x1b8c62=_0x727b[_0x569bda];return _0x1b8c62;};'use strict';var express=require(_0xb727('0x0'));var router=express[_0xb727('0x1')]();var auth=require(_0xb727('0x2'));var interaction=require(_0xb727('0x3'));var controller=require('./mailInteraction.controller');router[_0xb727('0x4')]('/',auth[_0xb727('0x5')](),controller[_0xb727('0x6')]);router['get'](_0xb727('0x7'),auth['isAuthenticated'](),controller[_0xb727('0x8')]);router[_0xb727('0x4')]('/:id',auth[_0xb727('0x5')](),controller[_0xb727('0x9')]);router[_0xb727('0x4')]('/:id/messages',auth[_0xb727('0x5')](),controller[_0xb727('0xa')]);router['get']('/:id/download',auth[_0xb727('0x5')](),controller[_0xb727('0xb')]);router[_0xb727('0xc')]('/',auth['isAuthenticated'](),controller[_0xb727('0xd')]);router[_0xb727('0xc')](_0xb727('0xe'),auth[_0xb727('0x5')](),controller['addMessage']);router['post'](_0xb727('0xf'),auth[_0xb727('0x5')](),interaction['tracked']('mail',_0xb727('0x10')),controller[_0xb727('0x11')]);router['put']('/:id',auth[_0xb727('0x5')](),interaction[_0xb727('0x12')]('mail','mailinteraction:update'),controller[_0xb727('0x13')]);router[_0xb727('0x14')]('/:id',auth['isAuthenticated'](),interaction[_0xb727('0x12')](_0xb727('0x15'),'mailinteraction:destroy'),controller['destroy']);router[_0xb727('0x14')](_0xb727('0xf'),auth[_0xb727('0x5')](),controller[_0xb727('0x16')]);module[_0xb727('0x17')]=router; \ No newline at end of file +var _0x0b69=['describe','/:id','/:id/messages','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated'];(function(_0x390ab3,_0x23e9f8){var _0x4c4fe0=function(_0x2970b6){while(--_0x2970b6){_0x390ab3['push'](_0x390ab3['shift']());}};_0x4c4fe0(++_0x23e9f8);}(_0x0b69,0x1ee));var _0x90b6=function(_0x178d88,_0x56f3c9){_0x178d88=_0x178d88-0x0;var _0x283891=_0x0b69[_0x178d88];return _0x283891;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x90b6('0x0'));var controller=require(_0x90b6('0x1'));router[_0x90b6('0x2')]('/',auth['isAuthenticated'](),controller[_0x90b6('0x3')]);router['get'](_0x90b6('0x4'),auth[_0x90b6('0x5')](),controller[_0x90b6('0x6')]);router[_0x90b6('0x2')](_0x90b6('0x7'),auth[_0x90b6('0x5')](),controller['show']);router[_0x90b6('0x2')](_0x90b6('0x8'),auth[_0x90b6('0x5')](),controller['getMessages']);router[_0x90b6('0x2')]('/:id/download',auth[_0x90b6('0x5')](),controller[_0x90b6('0x9')]);router['post']('/',auth[_0x90b6('0x5')](),controller[_0x90b6('0xa')]);router[_0x90b6('0xb')](_0x90b6('0x8'),auth[_0x90b6('0x5')](),controller[_0x90b6('0xc')]);router[_0x90b6('0xb')](_0x90b6('0xd'),auth[_0x90b6('0x5')](),interaction[_0x90b6('0xe')](_0x90b6('0xf'),_0x90b6('0x10')),controller[_0x90b6('0x11')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x90b6('0xf'),_0x90b6('0x12')),controller[_0x90b6('0x13')]);router[_0x90b6('0x14')](_0x90b6('0x7'),auth['isAuthenticated'](),interaction['tracked'](_0x90b6('0xf'),_0x90b6('0x15')),controller[_0x90b6('0x16')]);router[_0x90b6('0x14')](_0x90b6('0xd'),auth[_0x90b6('0x5')](),controller[_0x90b6('0x17')]);module[_0x90b6('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 052f969..4ee240d 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 _0x2e2b=['long','ENUM','out','sequelize','iconv','BOOLEAN','DATE','STRING','TEXT'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x2e2b,0xc9));var _0xb2e2=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x2e2b[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0xb2e2('0x0'));var iconv=require(_0xb2e2('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb2e2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb2e2('0x3')]},'disposition':{'type':Sequelize[_0xb2e2('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb2e2('0x4')]},'inReplyTo':{'type':Sequelize[_0xb2e2('0x4')](0x1fe)},'to':{'type':Sequelize[_0xb2e2('0x4')]},'cc':{'type':Sequelize[_0xb2e2('0x5')](_0xb2e2('0x6'))},'subject':{'type':Sequelize[_0xb2e2('0x5')]()},'attach':{'type':Sequelize[_0xb2e2('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb2e2('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xb2e2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb2e2('0x7')]('in',_0xb2e2('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb2e2('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb2e2('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb2e2('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb73=['DATE','ENUM','iconv','BOOLEAN','STRING','long'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0xdb73,0x98));var _0x3db7=function(_0x1db732,_0x579dba){_0x1db732=_0x1db732-0x0;var _0x244cd5=_0xdb73[_0x1db732];return _0x244cd5;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x3db7('0x0'));module['exports']={'closed':{'type':Sequelize[_0x3db7('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3db7('0x2')]},'secondDisposition':{'type':Sequelize[_0x3db7('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3db7('0x2')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x3db7('0x2')]},'cc':{'type':Sequelize['TEXT'](_0x3db7('0x3'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x3db7('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3db7('0x4')]},'substatus':{'type':Sequelize[_0x3db7('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x3db7('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3db7('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3db7('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3db7('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3db7('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2f40ab1..59fcfd2 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 _0xd260=['include','options','body','catch','update','find','addMessage','MailMessage','ids','omit','getMessages','findOne','fields','nolimit','sort','where','pick','filter','merge','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','from','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','headers','bcc','Bcc','Attachments','length','basename','existsSync','type','readFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','path','juice','ioredis','../../components/parsers/qs','api','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','stack','name','send','index','map','MailInteraction','rawAttributes','key','mail','user','show','params','keys','query','filters','intersection','model','attributes','includeAll'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xd260,0x18f));var _0x0d26=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd260[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require(_0x0d26('0x0'));var rimraf=require(_0x0d26('0x1'));var zipdir=require(_0x0d26('0x2'));var moment=require('moment');var BPromise=require(_0x0d26('0x3'));var util=require(_0x0d26('0x4'));var path=require(_0x0d26('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0x0d26('0x6'));var Redis=require(_0x0d26('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x0d26('0x8'));var logger=require('../../config/logger')(_0x0d26('0x9'));var config=require(_0x0d26('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x0d26('0xb'));config[_0x0d26('0xc')]=_[_0x0d26('0xd')](config[_0x0d26('0xc')],{'host':_0x0d26('0xe'),'port':0x18eb});var socket=require(_0x0d26('0xf'))(new Redis(config[_0x0d26('0xc')]));require(_0x0d26('0x10'))[_0x0d26('0x11')](socket);function respondWithStatusCode(_0x73cac9,_0x5ecdeb){_0x5ecdeb=_0x5ecdeb||0xcc;return function(_0x128423){if(_0x128423){return _0x73cac9[_0x0d26('0x12')](_0x5ecdeb);}return _0x73cac9['status'](_0x5ecdeb)[_0x0d26('0x13')]();};}function respondWithResult(_0x2003f7,_0x147315){_0x147315=_0x147315||0xc8;return function(_0x1278f4){if(_0x1278f4){return _0x2003f7[_0x0d26('0x14')](_0x147315)[_0x0d26('0x15')](_0x1278f4);}};}function respondWithFilteredResult(_0x27f528,_0x1b6ffc){return function(_0x3e7234){if(_0x3e7234){var _0x451226=typeof _0x1b6ffc[_0x0d26('0x16')]===_0x0d26('0x17')&&typeof _0x1b6ffc[_0x0d26('0x18')]===_0x0d26('0x17');var _0x2d5d5d=_0x3e7234[_0x0d26('0x19')];var _0x3de988=_0x451226?0x0:_0x1b6ffc[_0x0d26('0x16')];var _0x47350f=_0x451226?_0x3e7234[_0x0d26('0x19')]:_0x1b6ffc[_0x0d26('0x16')]+_0x1b6ffc[_0x0d26('0x18')];var _0x4faa64;if(_0x47350f>=_0x2d5d5d){_0x47350f=_0x2d5d5d;_0x4faa64=0xc8;}else{_0x4faa64=0xce;}_0x27f528[_0x0d26('0x14')](_0x4faa64);return _0x27f528[_0x0d26('0x1a')](_0x0d26('0x1b'),_0x3de988+'-'+_0x47350f+'/'+_0x2d5d5d)[_0x0d26('0x15')](_0x3e7234);}return null;};}function saveUpdates(_0x1deb7c){return function(_0x11f3d1){if(_0x11f3d1){return _0x11f3d1['update'](_0x1deb7c)[_0x0d26('0x1c')](function(_0xb6d681){return _0xb6d681;});}return null;};}function removeEntity(_0x26d0c7){return function(_0x509078){if(_0x509078){return _0x509078[_0x0d26('0x1d')]()['then'](function(){_0x26d0c7[_0x0d26('0x14')](0xcc)[_0x0d26('0x13')]();});}};}function handleEntityNotFound(_0xc3c60b){return function(_0xa06043){if(!_0xa06043){_0xc3c60b[_0x0d26('0x12')](0x194);}return _0xa06043;};}function handleError(_0x109742,_0x2723db){_0x2723db=_0x2723db||0x1f4;return function(_0x14453b){logger['error'](_0x14453b[_0x0d26('0x1e')]);if(_0x14453b[_0x0d26('0x1f')]){delete _0x14453b[_0x0d26('0x1f')];}_0x109742[_0x0d26('0x14')](_0x2723db)[_0x0d26('0x20')](_0x14453b);};}exports[_0x0d26('0x21')]=function(_0x46650c,_0x4b2c23){var _0x2d8f80={};var _0x465a0b=_[_0x0d26('0x22')](db[_0x0d26('0x23')][_0x0d26('0x24')],function(_0x359fd3){return{'name':_0x359fd3['fieldName'],'type':_0x359fd3['type'][_0x0d26('0x25')]};});_0x2d8f80=qs['getOptions'](_0x465a0b,_0x46650c);return interaction['findAll'](_0x0d26('0x26'),_0x46650c['query'],_0x46650c[_0x0d26('0x27')],_0x2d8f80,_0x465a0b)[_0x0d26('0x1c')](respondWithFilteredResult(_0x4b2c23,_0x2d8f80))['catch'](handleError(_0x4b2c23,null));};exports[_0x0d26('0x28')]=function(_0x24cf6e,_0x35004c){var _0x3f4549={'raw':![],'where':{'id':_0x24cf6e[_0x0d26('0x29')]['id']}},_0xf9de45={};_0xf9de45['model']=_[_0x0d26('0x2a')](db['MailInteraction']['rawAttributes']);_0xf9de45[_0x0d26('0x2b')]=_[_0x0d26('0x2a')](_0x24cf6e[_0x0d26('0x2b')]);_0xf9de45[_0x0d26('0x2c')]=_[_0x0d26('0x2d')](_0xf9de45[_0x0d26('0x2e')],_0xf9de45[_0x0d26('0x2b')]);_0x3f4549['attributes']=_[_0x0d26('0x2d')](_0xf9de45[_0x0d26('0x2e')],qs['fields'](_0x24cf6e['query']['fields']));_0x3f4549['attributes']=_0x3f4549[_0x0d26('0x2f')]['length']?_0x3f4549[_0x0d26('0x2f')]:_0xf9de45[_0x0d26('0x2e')];if(_0x24cf6e[_0x0d26('0x2b')][_0x0d26('0x30')]){_0x3f4549[_0x0d26('0x31')]=[{'all':!![]}];}_0x3f4549=_['merge']({},_0x3f4549,_0x24cf6e[_0x0d26('0x32')]);return db[_0x0d26('0x23')]['find'](_0x3f4549)[_0x0d26('0x1c')](handleEntityNotFound(_0x35004c,null))[_0x0d26('0x1c')](respondWithResult(_0x35004c,null))['catch'](handleError(_0x35004c,null));};exports['create']=function(_0x29113a,_0x58cfa2){return db[_0x0d26('0x23')]['create'](_0x29113a[_0x0d26('0x33')],{})[_0x0d26('0x1c')](respondWithResult(_0x58cfa2,0xc9))[_0x0d26('0x34')](handleError(_0x58cfa2,null));};exports[_0x0d26('0x35')]=function(_0xfa02aa,_0x5b8c36){if(_0xfa02aa['body']['id']){delete _0xfa02aa[_0x0d26('0x33')]['id'];}return db[_0x0d26('0x23')][_0x0d26('0x36')]({'where':{'id':_0xfa02aa[_0x0d26('0x29')]['id']}})['then'](handleEntityNotFound(_0x5b8c36,null))[_0x0d26('0x1c')](saveUpdates(_0xfa02aa['body'],null))[_0x0d26('0x1c')](respondWithResult(_0x5b8c36,null))[_0x0d26('0x34')](handleError(_0x5b8c36,null));};exports[_0x0d26('0x1d')]=function(_0x332658,_0x12bf08){return db[_0x0d26('0x23')]['find']({'where':{'id':_0x332658[_0x0d26('0x29')]['id']}})['then'](handleEntityNotFound(_0x12bf08,null))[_0x0d26('0x1c')](removeEntity(_0x12bf08,null))[_0x0d26('0x34')](handleError(_0x12bf08,null));};exports['describe']=function(_0x2c0899,_0x858bb0){return db[_0x0d26('0x23')]['describe']()[_0x0d26('0x1c')](respondWithResult(_0x858bb0,null))[_0x0d26('0x34')](handleError(_0x858bb0,null));};exports[_0x0d26('0x37')]=function(_0x523414,_0x5be63a){return db[_0x0d26('0x38')][_0x0d26('0x36')]({'where':{'id':_0x523414['params']['id']}})[_0x0d26('0x1c')](handleEntityNotFound(_0x5be63a,null))['then'](function(_0x2821b2){if(_0x2821b2){return _0x2821b2['addMessage'](_0x523414[_0x0d26('0x33')][_0x0d26('0x39')],_[_0x0d26('0x3a')](_0x523414[_0x0d26('0x33')],[_0x0d26('0x39'),'id'])||{});}})['then'](respondWithResult(_0x5be63a,null))[_0x0d26('0x34')](handleError(_0x5be63a,null));};exports[_0x0d26('0x3b')]=function(_0x2fed10,_0x5dee41){var _0x1d1cb5={'raw':![],'where':{}};var _0x1b8c83={};var _0x484184={'count':0x0,'rows':[]};return db[_0x0d26('0x23')][_0x0d26('0x3c')]({'where':{'id':_0x2fed10[_0x0d26('0x29')]['id']}})[_0x0d26('0x1c')](handleEntityNotFound(_0x5dee41,null))[_0x0d26('0x1c')](function(_0x4904a6){if(_0x4904a6){_0x1b8c83['model']=_[_0x0d26('0x2a')](db['MailMessage'][_0x0d26('0x24')]);_0x1b8c83[_0x0d26('0x2b')]=_[_0x0d26('0x2a')](_0x2fed10[_0x0d26('0x2b')]);_0x1b8c83[_0x0d26('0x2c')]=_['intersection'](_0x1b8c83[_0x0d26('0x2e')],_0x1b8c83[_0x0d26('0x2b')]);_0x1d1cb5[_0x0d26('0x2f')]=_[_0x0d26('0x2d')](_0x1b8c83[_0x0d26('0x2e')],qs[_0x0d26('0x3d')](_0x2fed10[_0x0d26('0x2b')][_0x0d26('0x3d')]));_0x1d1cb5[_0x0d26('0x2f')]=_0x1d1cb5[_0x0d26('0x2f')]['length']?_0x1d1cb5['attributes']:_0x1b8c83[_0x0d26('0x2e')];if(!_0x2fed10['query']['hasOwnProperty'](_0x0d26('0x3e'))){_0x1d1cb5[_0x0d26('0x18')]=qs[_0x0d26('0x18')](_0x2fed10[_0x0d26('0x2b')]['limit']);_0x1d1cb5['offset']=qs['offset'](_0x2fed10[_0x0d26('0x2b')][_0x0d26('0x16')]);}_0x1d1cb5['order']=qs[_0x0d26('0x3f')](_0x2fed10[_0x0d26('0x2b')][_0x0d26('0x3f')]);_0x1d1cb5[_0x0d26('0x40')]=qs['filters'](_[_0x0d26('0x41')](_0x2fed10[_0x0d26('0x2b')],_0x1b8c83['filters']));_0x1d1cb5[_0x0d26('0x40')]['MailInteractionId']=_0x4904a6['id'];if(_0x2fed10[_0x0d26('0x2b')][_0x0d26('0x42')]){_0x1d1cb5[_0x0d26('0x40')]=_[_0x0d26('0x43')](_0x1d1cb5[_0x0d26('0x40')],{'$or':_[_0x0d26('0x22')](_0x1d1cb5[_0x0d26('0x2f')],function(_0x3ed557){var _0x1d46f6={};_0x1d46f6[_0x3ed557]={'$like':'%'+_0x2fed10['query'][_0x0d26('0x42')]+'%'};return _0x1d46f6;})});}if(_0x2fed10[_0x0d26('0x2b')][_0x0d26('0x44')]){var _0x25d194=_0x2fed10[_0x0d26('0x2b')]['$gte']['split'](',');var _0x9e1fb5={};_0x9e1fb5[_0x25d194[0x0]]={'$gte':moment(_0x25d194[0x1])['format'](_0x0d26('0x45'))};_0x1d1cb5[_0x0d26('0x40')]=_[_0x0d26('0x43')](_0x1d1cb5['where'],_0x9e1fb5);}_0x1d1cb5=_[_0x0d26('0x43')]({},_0x1d1cb5,_0x2fed10[_0x0d26('0x32')]);return db['MailMessage'][_0x0d26('0x19')]({'where':_0x1d1cb5[_0x0d26('0x40')]})[_0x0d26('0x1c')](function(_0x504b30){_0x484184[_0x0d26('0x19')]=_0x504b30;if(_0x2fed10[_0x0d26('0x2b')][_0x0d26('0x30')]){_0x1d1cb5[_0x0d26('0x31')]=[{'all':!![]}];}return db[_0x0d26('0x38')][_0x0d26('0x46')](_0x1d1cb5);})['then'](function(_0x43bb5c){if(_0x2fed10[_0x0d26('0x2b')][_0x0d26('0x47')]===_0x0d26('0x48')){for(var _0x56fb33=0x0;_0x56fb33<_0x43bb5c['length'];_0x56fb33++){_0x43bb5c[_0x56fb33][_0x0d26('0x33')]=juice(_0x43bb5c[_0x56fb33][_0x0d26('0x33')]);}}_0x484184['rows']=_0x43bb5c;return _0x484184;});}})[_0x0d26('0x1c')](respondWithFilteredResult(_0x5dee41,_0x1d1cb5))[_0x0d26('0x34')](handleError(_0x5dee41,null));};exports['addTags']=function(_0x241a49,_0x16715f){return db[_0x0d26('0x23')][_0x0d26('0x36')]({'where':{'id':_0x241a49['params']['id']}})['then'](handleEntityNotFound(_0x16715f,null))[_0x0d26('0x1c')](function(_0x3d561a){if(_0x3d561a){return _0x3d561a[_0x0d26('0x49')](_0x241a49[_0x0d26('0x33')][_0x0d26('0x39')],_[_0x0d26('0x3a')](_0x241a49[_0x0d26('0x33')],[_0x0d26('0x39'),'id'])||{})[_0x0d26('0x4a')](function(){return db[_0x0d26('0x4b')]['findAll']({'attributes':['id','name',_0x0d26('0x4c')],'where':{'id':_0x241a49['body']['ids']}});})[_0x0d26('0x1c')](function(_0x5c3ddb){socket[_0x0d26('0x4d')](_0x0d26('0x4e'),{'id':Number(_0x241a49[_0x0d26('0x29')]['id']),'tags':_0x5c3ddb||[]});return{'id':Number(_0x241a49[_0x0d26('0x29')]['id']),'tags':_0x5c3ddb||[]};});}})[_0x0d26('0x1c')](respondWithResult(_0x16715f,null))[_0x0d26('0x34')](handleError(_0x16715f,null));};exports[_0x0d26('0x4f')]=function(_0x3df56d,_0xb07b16){return db[_0x0d26('0x23')][_0x0d26('0x36')]({'where':{'id':_0x3df56d['params']['id']}})[_0x0d26('0x1c')](handleEntityNotFound(_0xb07b16,null))[_0x0d26('0x1c')](function(_0x5d86ef){if(_0x5d86ef){return _0x5d86ef['removeTags'](_0x3df56d['query']['ids']);}})[_0x0d26('0x1c')](respondWithStatusCode(_0xb07b16,null))[_0x0d26('0x34')](handleError(_0xb07b16,null));};exports[_0x0d26('0x50')]=function(_0x3e0719,_0x4fbf08){var _0x3a93bd=moment()['unix']()[_0x0d26('0x51')]();var _0x48bf3d=path[_0x0d26('0x52')](config[_0x0d26('0x53')],_0x0d26('0x54'),_0x0d26('0x55'),_0x0d26('0x56'));var _0x5e190a=path['join'](config['root'],_0x0d26('0x54'),_0x0d26('0x55'),_0x0d26('0x57'));var _0x337f03=path[_0x0d26('0x52')](_0x48bf3d,_0x3a93bd);var _0x5b01eb=util[_0x0d26('0x58')](_0x0d26('0x59'),_0x3e0719['params']['id'],_0x3a93bd);var _0x39f310=path[_0x0d26('0x52')](_0x48bf3d,_0x5b01eb);var _0x1d01d6=[];if(_0x3e0719[_0x0d26('0x2b')][_0x0d26('0x57')]){_0x1d01d6[_0x0d26('0x5a')]({'model':db[_0x0d26('0x5b')],'as':'Attachments','raw':!![]});}var _0x4fd4e1=[{'model':db[_0x0d26('0x38')],'as':_0x0d26('0x5c'),'attributes':['id','body',_0x0d26('0x5d'),'to','cc','bcc',_0x0d26('0x5e'),_0x0d26('0x5f')],'where':{'secret':![]},'order':qs[_0x0d26('0x3f')]('id'),'include':_0x1d01d6}];return db[_0x0d26('0x23')][_0x0d26('0x36')]({'where':{'id':_0x3e0719[_0x0d26('0x29')]['id']},'include':_0x4fd4e1})[_0x0d26('0x1c')](handleEntityNotFound(_0x4fbf08,null))['then'](function(_0xec50e7){if(_0xec50e7&&_0xec50e7[_0x0d26('0x5c')]){var _0x22430a=_0xec50e7[_0x0d26('0x60')]({'plain':!![]});fs[_0x0d26('0x61')](_0x337f03);return BPromise[_0x0d26('0x62')](_0x22430a[_0x0d26('0x5c')],function(_0x5260d6,_0x180bc0){var _0x54d55e={'from':_0x5260d6[_0x0d26('0x5d')],'to':_0x5260d6['to']||_0x0d26('0x63'),'subject':_0x5260d6[_0x0d26('0x5e')],'html':htmlEntities[_0x0d26('0x64')](_0x5260d6['body']),'headers':{'Date':moment(_0x5260d6[_0x0d26('0x5f')])[_0x0d26('0x58')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5260d6['cc']){_0x54d55e[_0x0d26('0x65')]['Cc']=_0x5260d6['cc'];}if(_0x5260d6[_0x0d26('0x66')]){_0x54d55e[_0x0d26('0x65')][_0x0d26('0x67')]=_0x5260d6['bcc'];}return new BPromise(function(_0x367dc4,_0xd720e3){if(_0x5260d6[_0x0d26('0x68')]){for(var _0x456bd3=0x0;_0x456bd3<_0x5260d6[_0x0d26('0x68')][_0x0d26('0x69')];_0x456bd3++){var _0x3b52d3=_0x5260d6[_0x0d26('0x68')][_0x456bd3];var _0x7c0b41=path['join'](_0x5e190a,_0x3b52d3[_0x0d26('0x6a')]);if(fs[_0x0d26('0x6b')](_0x7c0b41)){_0x54d55e[_0x0d26('0x57')]['push']({'name':_0x3b52d3[_0x0d26('0x1f')],'contentType':_0x3b52d3[_0x0d26('0x6c')],'data':fs[_0x0d26('0x6d')](_0x7c0b41)});}}}emlformat['build'](_0x54d55e,function(_0x1649d7,_0x138c7b){if(_0x1649d7)return _0xd720e3(_0x1649d7);fs['writeFileSync'](path[_0x0d26('0x52')](_0x337f03,util[_0x0d26('0x58')](_0x0d26('0x6e'),_0x180bc0)),_0x138c7b);return _0x367dc4(_0x138c7b);});});})[_0x0d26('0x1c')](function(){return new BPromise(function(_0x492632,_0x392395){zipdir(_0x337f03,{'saveTo':_0x39f310},function(_0x4dbfd2,_0x579900){if(_0x4dbfd2)return _0x392395(_0x4dbfd2);return _0x492632(_0x579900);});})[_0x0d26('0x1c')](function(){return new BPromise(function(_0x5e480b,_0x4cb42a){rimraf(_0x337f03,function(_0x50892a){if(_0x50892a)_0x4cb42a(_0x50892a);return _0x5e480b();});});})['then'](function(){return _0x4fbf08[_0x0d26('0x50')](_0x39f310,_0x5b01eb,function(_0x541e7f){if(!_0x541e7f)fs[_0x0d26('0x6f')](_0x39f310);});});});}else{return _0x4fbf08['sendStatus'](0xc8);}})['catch'](handleError(_0x4fbf08,null));}; \ No newline at end of file +var _0x2947=['rawAttributes','filters','hasOwnProperty','nolimit','order','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','files','server','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','each','missing.recipient@your.company.com','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments','basename','existsSync','push','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','end','error','name','send','MailInteraction','fieldName','type','key','getOptions','findAll','mail','user','catch','show','params','model','keys','query','intersection','attributes','fields','length','include','merge','options','find','create','body','addMessage','MailMessage','ids','omit','getMessages','findOne'];(function(_0x123a22,_0x3fd5f6){var _0x2c8673=function(_0x4858bf){while(--_0x4858bf){_0x123a22['push'](_0x123a22['shift']());}};_0x2c8673(++_0x3fd5f6);}(_0x2947,0x189));var _0x7294=function(_0x4cc464,_0x28e996){_0x4cc464=_0x4cc464-0x0;var _0xa077ac=_0x2947[_0x4cc464];return _0xa077ac;};'use strict';var emlformat=require(_0x7294('0x0'));var rimraf=require(_0x7294('0x1'));var zipdir=require(_0x7294('0x2'));var moment=require(_0x7294('0x3'));var BPromise=require(_0x7294('0x4'));var util=require(_0x7294('0x5'));var path=require(_0x7294('0x6'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x7294('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x7294('0x8'));var logger=require(_0x7294('0x9'))(_0x7294('0xa'));var config=require(_0x7294('0xb'));var db=require(_0x7294('0xc'))['db'];var htmlEntities=require(_0x7294('0xd'));config[_0x7294('0xe')]=_[_0x7294('0xf')](config[_0x7294('0xe')],{'host':_0x7294('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7294('0xe')]));require(_0x7294('0x11'))['register'](socket);function respondWithStatusCode(_0x52b728,_0x5da286){_0x5da286=_0x5da286||0xcc;return function(_0x73344b){if(_0x73344b){return _0x52b728[_0x7294('0x12')](_0x5da286);}return _0x52b728[_0x7294('0x13')](_0x5da286)['end']();};}function respondWithResult(_0x4f3834,_0x6ce993){_0x6ce993=_0x6ce993||0xc8;return function(_0x5cea7){if(_0x5cea7){return _0x4f3834[_0x7294('0x13')](_0x6ce993)[_0x7294('0x14')](_0x5cea7);}};}function respondWithFilteredResult(_0x20d046,_0x3377c6){return function(_0x401d5c){if(_0x401d5c){var _0x7a36ad=typeof _0x3377c6[_0x7294('0x15')]===_0x7294('0x16')&&typeof _0x3377c6[_0x7294('0x17')]===_0x7294('0x16');var _0x3473cc=_0x401d5c[_0x7294('0x18')];var _0x38c4a0=_0x7a36ad?0x0:_0x3377c6[_0x7294('0x15')];var _0x502b33=_0x7a36ad?_0x401d5c[_0x7294('0x18')]:_0x3377c6[_0x7294('0x15')]+_0x3377c6[_0x7294('0x17')];var _0x10d168;if(_0x502b33>=_0x3473cc){_0x502b33=_0x3473cc;_0x10d168=0xc8;}else{_0x10d168=0xce;}_0x20d046[_0x7294('0x13')](_0x10d168);return _0x20d046['set'](_0x7294('0x19'),_0x38c4a0+'-'+_0x502b33+'/'+_0x3473cc)[_0x7294('0x14')](_0x401d5c);}return null;};}function saveUpdates(_0x1dd96c){return function(_0x1c2705){if(_0x1c2705){return _0x1c2705[_0x7294('0x1a')](_0x1dd96c)[_0x7294('0x1b')](function(_0x4d2ea2){return _0x4d2ea2;});}return null;};}function removeEntity(_0x50eac6){return function(_0x1e726f){if(_0x1e726f){return _0x1e726f[_0x7294('0x1c')]()[_0x7294('0x1b')](function(){_0x50eac6[_0x7294('0x13')](0xcc)[_0x7294('0x1d')]();});}};}function handleEntityNotFound(_0x1c6ab6){return function(_0x38a00c){if(!_0x38a00c){_0x1c6ab6['sendStatus'](0x194);}return _0x38a00c;};}function handleError(_0x49761e,_0x4581c1){_0x4581c1=_0x4581c1||0x1f4;return function(_0x18caa3){logger[_0x7294('0x1e')](_0x18caa3['stack']);if(_0x18caa3[_0x7294('0x1f')]){delete _0x18caa3[_0x7294('0x1f')];}_0x49761e[_0x7294('0x13')](_0x4581c1)[_0x7294('0x20')](_0x18caa3);};}exports['index']=function(_0x5af4d8,_0x57b1df){var _0x585731={};var _0x6528cf=_['map'](db[_0x7294('0x21')]['rawAttributes'],function(_0x59caf4){return{'name':_0x59caf4[_0x7294('0x22')],'type':_0x59caf4[_0x7294('0x23')][_0x7294('0x24')]};});_0x585731=qs[_0x7294('0x25')](_0x6528cf,_0x5af4d8);return interaction[_0x7294('0x26')](_0x7294('0x27'),_0x5af4d8['query'],_0x5af4d8[_0x7294('0x28')],_0x585731,_0x6528cf)[_0x7294('0x1b')](respondWithFilteredResult(_0x57b1df,_0x585731))[_0x7294('0x29')](handleError(_0x57b1df,null));};exports[_0x7294('0x2a')]=function(_0xfce2dc,_0x31850e){var _0x2a488e={'raw':![],'where':{'id':_0xfce2dc[_0x7294('0x2b')]['id']}},_0x37932d={};_0x37932d[_0x7294('0x2c')]=_[_0x7294('0x2d')](db[_0x7294('0x21')]['rawAttributes']);_0x37932d[_0x7294('0x2e')]=_[_0x7294('0x2d')](_0xfce2dc[_0x7294('0x2e')]);_0x37932d['filters']=_[_0x7294('0x2f')](_0x37932d['model'],_0x37932d['query']);_0x2a488e[_0x7294('0x30')]=_[_0x7294('0x2f')](_0x37932d[_0x7294('0x2c')],qs[_0x7294('0x31')](_0xfce2dc['query'][_0x7294('0x31')]));_0x2a488e[_0x7294('0x30')]=_0x2a488e[_0x7294('0x30')][_0x7294('0x32')]?_0x2a488e[_0x7294('0x30')]:_0x37932d['model'];if(_0xfce2dc[_0x7294('0x2e')]['includeAll']){_0x2a488e[_0x7294('0x33')]=[{'all':!![]}];}_0x2a488e=_[_0x7294('0x34')]({},_0x2a488e,_0xfce2dc[_0x7294('0x35')]);return db[_0x7294('0x21')][_0x7294('0x36')](_0x2a488e)['then'](handleEntityNotFound(_0x31850e,null))[_0x7294('0x1b')](respondWithResult(_0x31850e,null))[_0x7294('0x29')](handleError(_0x31850e,null));};exports['create']=function(_0x1355e2,_0x3e5ac7){return db[_0x7294('0x21')][_0x7294('0x37')](_0x1355e2[_0x7294('0x38')],{})[_0x7294('0x1b')](respondWithResult(_0x3e5ac7,0xc9))[_0x7294('0x29')](handleError(_0x3e5ac7,null));};exports[_0x7294('0x1a')]=function(_0x24b914,_0x345d39){if(_0x24b914[_0x7294('0x38')]['id']){delete _0x24b914['body']['id'];}return db[_0x7294('0x21')]['find']({'where':{'id':_0x24b914[_0x7294('0x2b')]['id']}})[_0x7294('0x1b')](handleEntityNotFound(_0x345d39,null))[_0x7294('0x1b')](saveUpdates(_0x24b914[_0x7294('0x38')],null))[_0x7294('0x1b')](respondWithResult(_0x345d39,null))[_0x7294('0x29')](handleError(_0x345d39,null));};exports[_0x7294('0x1c')]=function(_0xd33e1b,_0xde7860){return db['MailInteraction']['find']({'where':{'id':_0xd33e1b[_0x7294('0x2b')]['id']}})[_0x7294('0x1b')](handleEntityNotFound(_0xde7860,null))[_0x7294('0x1b')](removeEntity(_0xde7860,null))[_0x7294('0x29')](handleError(_0xde7860,null));};exports['describe']=function(_0x4f805c,_0x363886){return db[_0x7294('0x21')]['describe']()[_0x7294('0x1b')](respondWithResult(_0x363886,null))['catch'](handleError(_0x363886,null));};exports[_0x7294('0x39')]=function(_0x4414cb,_0x3e4581){return db[_0x7294('0x3a')][_0x7294('0x36')]({'where':{'id':_0x4414cb[_0x7294('0x2b')]['id']}})[_0x7294('0x1b')](handleEntityNotFound(_0x3e4581,null))[_0x7294('0x1b')](function(_0x25a59c){if(_0x25a59c){return _0x25a59c[_0x7294('0x39')](_0x4414cb[_0x7294('0x38')][_0x7294('0x3b')],_[_0x7294('0x3c')](_0x4414cb[_0x7294('0x38')],[_0x7294('0x3b'),'id'])||{});}})[_0x7294('0x1b')](respondWithResult(_0x3e4581,null))['catch'](handleError(_0x3e4581,null));};exports[_0x7294('0x3d')]=function(_0x328f3c,_0x195af7){var _0x507b88={'raw':![],'where':{}};var _0x455a4={};var _0x2bc855={'count':0x0,'rows':[]};return db[_0x7294('0x21')][_0x7294('0x3e')]({'where':{'id':_0x328f3c[_0x7294('0x2b')]['id']}})['then'](handleEntityNotFound(_0x195af7,null))[_0x7294('0x1b')](function(_0x588e06){if(_0x588e06){_0x455a4[_0x7294('0x2c')]=_['keys'](db[_0x7294('0x3a')][_0x7294('0x3f')]);_0x455a4['query']=_[_0x7294('0x2d')](_0x328f3c[_0x7294('0x2e')]);_0x455a4[_0x7294('0x40')]=_[_0x7294('0x2f')](_0x455a4[_0x7294('0x2c')],_0x455a4[_0x7294('0x2e')]);_0x507b88['attributes']=_['intersection'](_0x455a4[_0x7294('0x2c')],qs[_0x7294('0x31')](_0x328f3c[_0x7294('0x2e')]['fields']));_0x507b88[_0x7294('0x30')]=_0x507b88['attributes'][_0x7294('0x32')]?_0x507b88[_0x7294('0x30')]:_0x455a4[_0x7294('0x2c')];if(!_0x328f3c[_0x7294('0x2e')][_0x7294('0x41')](_0x7294('0x42'))){_0x507b88[_0x7294('0x17')]=qs[_0x7294('0x17')](_0x328f3c['query'][_0x7294('0x17')]);_0x507b88[_0x7294('0x15')]=qs[_0x7294('0x15')](_0x328f3c[_0x7294('0x2e')]['offset']);}_0x507b88[_0x7294('0x43')]=qs[_0x7294('0x44')](_0x328f3c[_0x7294('0x2e')][_0x7294('0x44')]);_0x507b88['where']=qs[_0x7294('0x40')](_['pick'](_0x328f3c[_0x7294('0x2e')],_0x455a4['filters']));_0x507b88[_0x7294('0x45')]['MailInteractionId']=_0x588e06['id'];if(_0x328f3c['query']['filter']){_0x507b88[_0x7294('0x45')]=_[_0x7294('0x34')](_0x507b88[_0x7294('0x45')],{'$or':_['map'](_0x507b88[_0x7294('0x30')],function(_0x350ac8){var _0x36ac06={};_0x36ac06[_0x350ac8]={'$like':'%'+_0x328f3c[_0x7294('0x2e')][_0x7294('0x46')]+'%'};return _0x36ac06;})});}if(_0x328f3c[_0x7294('0x2e')][_0x7294('0x47')]){var _0x5f3ba1=_0x328f3c[_0x7294('0x2e')][_0x7294('0x47')][_0x7294('0x48')](',');var _0x4c7beb={};_0x4c7beb[_0x5f3ba1[0x0]]={'$gte':moment(_0x5f3ba1[0x1])[_0x7294('0x49')](_0x7294('0x4a'))};_0x507b88[_0x7294('0x45')]=_[_0x7294('0x34')](_0x507b88['where'],_0x4c7beb);}_0x507b88=_[_0x7294('0x34')]({},_0x507b88,_0x328f3c[_0x7294('0x35')]);return db[_0x7294('0x3a')][_0x7294('0x18')]({'where':_0x507b88[_0x7294('0x45')]})[_0x7294('0x1b')](function(_0x1e6958){_0x2bc855[_0x7294('0x18')]=_0x1e6958;if(_0x328f3c[_0x7294('0x2e')][_0x7294('0x4b')]){_0x507b88[_0x7294('0x33')]=[{'all':!![]}];}return db['MailMessage'][_0x7294('0x26')](_0x507b88);})[_0x7294('0x1b')](function(_0x4173f6){if(_0x328f3c[_0x7294('0x2e')][_0x7294('0x4c')]===_0x7294('0x4d')){for(var _0x23b2c9=0x0;_0x23b2c9<_0x4173f6[_0x7294('0x32')];_0x23b2c9++){_0x4173f6[_0x23b2c9]['body']=juice(_0x4173f6[_0x23b2c9][_0x7294('0x38')]);}}_0x2bc855['rows']=_0x4173f6;return _0x2bc855;});}})['then'](respondWithFilteredResult(_0x195af7,_0x507b88))['catch'](handleError(_0x195af7,null));};exports[_0x7294('0x4e')]=function(_0x29a053,_0x4106bc){return db[_0x7294('0x21')][_0x7294('0x36')]({'where':{'id':_0x29a053[_0x7294('0x2b')]['id']}})[_0x7294('0x1b')](handleEntityNotFound(_0x4106bc,null))[_0x7294('0x1b')](function(_0x24aac1){if(_0x24aac1){return _0x24aac1[_0x7294('0x4f')](_0x29a053[_0x7294('0x38')][_0x7294('0x3b')],_['omit'](_0x29a053['body'],[_0x7294('0x3b'),'id'])||{})[_0x7294('0x50')](function(){return db[_0x7294('0x51')]['findAll']({'attributes':['id',_0x7294('0x1f'),_0x7294('0x52')],'where':{'id':_0x29a053[_0x7294('0x38')][_0x7294('0x3b')]}});})[_0x7294('0x1b')](function(_0x4478d3){socket[_0x7294('0x53')](_0x7294('0x54'),{'id':Number(_0x29a053[_0x7294('0x2b')]['id']),'tags':_0x4478d3||[]});return{'id':Number(_0x29a053['params']['id']),'tags':_0x4478d3||[]};});}})[_0x7294('0x1b')](respondWithResult(_0x4106bc,null))[_0x7294('0x29')](handleError(_0x4106bc,null));};exports[_0x7294('0x55')]=function(_0x4e929f,_0x34add7){return db[_0x7294('0x21')]['find']({'where':{'id':_0x4e929f['params']['id']}})[_0x7294('0x1b')](handleEntityNotFound(_0x34add7,null))['then'](function(_0x21c8fd){if(_0x21c8fd){return _0x21c8fd['removeTags'](_0x4e929f['query']['ids']);}})['then'](respondWithStatusCode(_0x34add7,null))[_0x7294('0x29')](handleError(_0x34add7,null));};exports[_0x7294('0x56')]=function(_0xdd2dfc,_0x54e0b4){var _0x1ed5bf=moment()[_0x7294('0x57')]()[_0x7294('0x58')]();var _0x2e9157=path[_0x7294('0x59')](config[_0x7294('0x5a')],'server',_0x7294('0x5b'),'tmp');var _0x2424ac=path[_0x7294('0x59')](config[_0x7294('0x5a')],_0x7294('0x5c'),'files',_0x7294('0x5d'));var _0xa428bd=path[_0x7294('0x59')](_0x2e9157,_0x1ed5bf);var _0x294715=util[_0x7294('0x49')](_0x7294('0x5e'),_0xdd2dfc[_0x7294('0x2b')]['id'],_0x1ed5bf);var _0x4012f4=path[_0x7294('0x59')](_0x2e9157,_0x294715);var _0x13688d=[];if(_0xdd2dfc[_0x7294('0x2e')][_0x7294('0x5d')]){_0x13688d['push']({'model':db[_0x7294('0x5f')],'as':'Attachments','raw':!![]});}var _0x36e43b=[{'model':db[_0x7294('0x3a')],'as':'Messages','attributes':['id',_0x7294('0x38'),'from','to','cc','bcc','subject','createdAt'],'where':{'secret':![]},'order':qs[_0x7294('0x44')]('id'),'include':_0x13688d}];return db[_0x7294('0x21')][_0x7294('0x36')]({'where':{'id':_0xdd2dfc['params']['id']},'include':_0x36e43b})[_0x7294('0x1b')](handleEntityNotFound(_0x54e0b4,null))[_0x7294('0x1b')](function(_0x370f12){if(_0x370f12&&_0x370f12[_0x7294('0x60')]){var _0x28cada=_0x370f12[_0x7294('0x61')]({'plain':!![]});fs[_0x7294('0x62')](_0xa428bd);return BPromise[_0x7294('0x63')](_0x28cada['Messages'],function(_0x26db17,_0x31c0b8){var _0x8d18ff={'from':_0x26db17['from'],'to':_0x26db17['to']||_0x7294('0x64'),'subject':_0x26db17[_0x7294('0x65')],'html':htmlEntities[_0x7294('0x66')](_0x26db17[_0x7294('0x38')]),'headers':{'Date':moment(_0x26db17['createdAt'])['format'](_0x7294('0x67'))},'attachments':[]};if(_0x26db17['cc']){_0x8d18ff[_0x7294('0x68')]['Cc']=_0x26db17['cc'];}if(_0x26db17[_0x7294('0x69')]){_0x8d18ff[_0x7294('0x68')]['Bcc']=_0x26db17[_0x7294('0x69')];}return new BPromise(function(_0x12d652,_0x8b05dc){if(_0x26db17['Attachments']){for(var _0x3bd844=0x0;_0x3bd844<_0x26db17['Attachments']['length'];_0x3bd844++){var _0xe541da=_0x26db17[_0x7294('0x6a')][_0x3bd844];var _0x48319e=path[_0x7294('0x59')](_0x2424ac,_0xe541da[_0x7294('0x6b')]);if(fs[_0x7294('0x6c')](_0x48319e)){_0x8d18ff[_0x7294('0x5d')][_0x7294('0x6d')]({'name':_0xe541da['name'],'contentType':_0xe541da['type'],'data':fs[_0x7294('0x6e')](_0x48319e)});}}}emlformat['build'](_0x8d18ff,function(_0x1634a3,_0x3ca3c0){if(_0x1634a3)return _0x8b05dc(_0x1634a3);fs[_0x7294('0x6f')](path[_0x7294('0x59')](_0xa428bd,util[_0x7294('0x49')](_0x7294('0x70'),_0x31c0b8)),_0x3ca3c0);return _0x12d652(_0x3ca3c0);});});})[_0x7294('0x1b')](function(){return new BPromise(function(_0xa0ce8e,_0x364f5){zipdir(_0xa428bd,{'saveTo':_0x4012f4},function(_0x2ba604,_0x3c5305){if(_0x2ba604)return _0x364f5(_0x2ba604);return _0xa0ce8e(_0x3c5305);});})[_0x7294('0x1b')](function(){return new BPromise(function(_0x473a38,_0x2cc4b5){rimraf(_0xa428bd,function(_0x474414){if(_0x474414)_0x2cc4b5(_0x474414);return _0x473a38();});});})[_0x7294('0x1b')](function(){return _0x54e0b4[_0x7294('0x56')](_0x4012f4,_0x294715,function(_0x8134b2){if(!_0x8134b2)fs[_0x7294('0x71')](_0x4012f4);});});});}else{return _0x54e0b4['sendStatus'](0xc8);}})[_0x7294('0x29')](handleError(_0x54e0b4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 156b51f..2958fc3 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 _0x1bb4=['remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update'];(function(_0x379f38,_0x32be37){var _0x2656c7=function(_0x450679){while(--_0x450679){_0x379f38['push'](_0x379f38['shift']());}};_0x2656c7(++_0x32be37);}(_0x1bb4,0x13d));var _0x41bb=function(_0x3f65cd,_0x30237f){_0x3f65cd=_0x3f65cd-0x0;var _0x20b147=_0x1bb4[_0x3f65cd];return _0x20b147;};'use strict';var EventEmitter=require(_0x41bb('0x0'));var MailInteraction=require(_0x41bb('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x41bb('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x41bb('0x3')](0x0);var events={'afterCreate':_0x41bb('0x4'),'afterUpdate':_0x41bb('0x5'),'afterDestroy':_0x41bb('0x6')};function emitEvent(_0xc31109){return function(_0x52d496,_0x11831a,_0x488473){_0x52d496[_0x41bb('0x7')]({'attributes':['id'],'raw':!![]})[_0x41bb('0x8')](function(_0x45d19c){_0x52d496[_0x41bb('0x9')](_0x41bb('0xa'),_0x45d19c[_0x41bb('0xb')](function(_0x2399fa){return{'id':_0x2399fa['id']};}));return MailMessage[_0x41bb('0xc')]({'where':{'MailInteractionId':_0x52d496['id'],'direction':'in','read':![]},'raw':!![]});})[_0x41bb('0x8')](function(_0x59829e){_0x52d496[_0x41bb('0x9')]('unreadMessages',_0x59829e[_0x41bb('0xd')]);MailInteractionEvents['emit'](_0xc31109+':'+_0x52d496['id'],_0x52d496);MailInteractionEvents[_0x41bb('0xe')](_0xc31109,_0x52d496);_0x488473(null);})[_0x41bb('0xf')](_0x488473(null));};}for(var e in events){if(events[_0x41bb('0x10')](e)){var event=events[e];MailInteraction[_0x41bb('0x11')](e,emitEvent(event));}}module[_0x41bb('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0x15d6=['map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','Users'];(function(_0x488f67,_0x3017a7){var _0xc8115e=function(_0x53740b){while(--_0x53740b){_0x488f67['push'](_0x488f67['shift']());}};_0xc8115e(++_0x3017a7);}(_0x15d6,0xb3));var _0x615d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x15d6[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x615d('0x0'));var MailInteraction=require(_0x615d('0x1'))['db'][_0x615d('0x2')];var MailMessage=require(_0x615d('0x1'))['db'][_0x615d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x615d('0x4')](0x0);var events={'afterCreate':_0x615d('0x5'),'afterUpdate':_0x615d('0x6'),'afterDestroy':_0x615d('0x7')};function emitEvent(_0x5d4beb){return function(_0x3b1633,_0x39ac99,_0x5296d4){_0x3b1633['getUsers']({'attributes':['id'],'raw':!![]})[_0x615d('0x8')](function(_0x872abb){_0x3b1633[_0x615d('0x9')](_0x615d('0xa'),_0x872abb[_0x615d('0xb')](function(_0x651aa){return{'id':_0x651aa['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x3b1633['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x38b0c7){_0x3b1633[_0x615d('0x9')](_0x615d('0xc'),_0x38b0c7[_0x615d('0xd')]);MailInteractionEvents[_0x615d('0xe')](_0x5d4beb+':'+_0x3b1633['id'],_0x3b1633);MailInteractionEvents[_0x615d('0xe')](_0x5d4beb,_0x3b1633);_0x5296d4(null);})[_0x615d('0xf')](_0x5296d4(null));};}for(var e in events){if(events[_0x615d('0x10')](e)){var event=events[e];MailInteraction[_0x615d('0x11')](e,emitEvent(event));}}module[_0x615d('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b4414a1..268d3df 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 _0xc250=['get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0x573a45,_0x1f7469){var _0x1b5d7f=function(_0x52e67f){while(--_0x52e67f){_0x573a45['push'](_0x573a45['shift']());}};_0x1b5d7f(++_0x1f7469);}(_0xc250,0x128));var _0x0c25=function(_0x407652,_0x57f859){_0x407652=_0x407652-0x0;var _0x3b3474=_0xc250[_0x407652];return _0x3b3474;};'use strict';var _=require(_0x0c25('0x0'));var util=require(_0x0c25('0x1'));var logger=require(_0x0c25('0x2'))(_0x0c25('0x3'));var moment=require(_0x0c25('0x4'));var BPromise=require(_0x0c25('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c25('0x6'));var rimraf=require(_0x0c25('0x7'));var config=require(_0x0c25('0x8'));var attributes=require(_0x0c25('0x9'));module[_0x0c25('0xa')]=function(_0x215103,_0x2b9bfe){return _0x215103[_0x0c25('0xb')](_0x0c25('0xc'),attributes,{'tableName':_0x0c25('0xd'),'paranoid':![],'indexes':[{'name':_0x0c25('0xe'),'fields':[_0x0c25('0xf'),'to'],'type':_0x0c25('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x8ddd4e,_0x3da07f,_0x2a761c){if(_0x8ddd4e[_0x0c25('0x11')]){_0x8ddd4e['substatusAt']=moment()[_0x0c25('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x8ddd4e[_0x0c25('0x13')]){_0x8ddd4e[_0x0c25('0x14')]=moment()[_0x0c25('0x12')](_0x0c25('0x15'));}_0x2a761c(null,_0x3da07f);},'beforeUpdate':function(_0x352a8f,_0x51c468,_0x61482f){if(_0x352a8f['changed'](_0x0c25('0x11'))){_0x352a8f['substatusAt']=_0x352a8f[_0x0c25('0x11')]?moment()['format'](_0x0c25('0x15')):null;}if(_0x352a8f[_0x0c25('0x16')]('closed')){_0x352a8f[_0x0c25('0x14')]=moment()[_0x0c25('0x12')](_0x0c25('0x15'));_0x352a8f[_0x0c25('0x11')]=null;_0x352a8f['substatusAt']=null;}_0x61482f(null,_0x352a8f);},'afterUpdate':function(_0x36a3eb,_0xf21cd,_0x2d648a){var _0x1e1538=_0x215103['models'];var _0x51c8c3=_0x36a3eb[_0x0c25('0x17')]({'plain':!![]});if(_0x51c8c3['closed']){return _0x1e1538[_0x0c25('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x51c8c3['id']}})[_0x0c25('0x19')](function(){_0x2d648a();})[_0x0c25('0x1a')](function(_0x1b4be0){_0x2d648a(_0x1b4be0);});}else{_0x2d648a();}}},'charset':_0x0c25('0x1b'),'collate':_0x0c25('0x1c')});}; \ No newline at end of file +var _0x69b9=['../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x271dc9,_0x5c1711){var _0x4019de=function(_0x142a25){while(--_0x142a25){_0x271dc9['push'](_0x271dc9['shift']());}};_0x4019de(++_0x5c1711);}(_0x69b9,0x121));var _0x969b=function(_0x43dc45,_0x34bf78){_0x43dc45=_0x43dc45-0x0;var _0x12a64a=_0x69b9[_0x43dc45];return _0x12a64a;};'use strict';var _=require(_0x969b('0x0'));var util=require(_0x969b('0x1'));var logger=require(_0x969b('0x2'))(_0x969b('0x3'));var moment=require('moment');var BPromise=require(_0x969b('0x4'));var rp=require(_0x969b('0x5'));var fs=require('fs');var path=require(_0x969b('0x6'));var rimraf=require(_0x969b('0x7'));var config=require(_0x969b('0x8'));var attributes=require(_0x969b('0x9'));module[_0x969b('0xa')]=function(_0x215ae2,_0x56d2fc){return _0x215ae2['define'](_0x969b('0xb'),attributes,{'tableName':_0x969b('0xc'),'paranoid':![],'indexes':[{'name':_0x969b('0xd'),'fields':[_0x969b('0xe'),'to'],'type':_0x969b('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x30206a,_0x535248,_0x292b37){if(_0x30206a[_0x969b('0x10')]){_0x30206a[_0x969b('0x11')]=moment()[_0x969b('0x12')](_0x969b('0x13'));}if(_0x30206a[_0x969b('0x14')]){_0x30206a[_0x969b('0x15')]=moment()[_0x969b('0x12')](_0x969b('0x13'));}_0x292b37(null,_0x535248);},'beforeUpdate':function(_0xffdaa7,_0x36cde7,_0x46fad6){if(_0xffdaa7[_0x969b('0x16')](_0x969b('0x10'))){_0xffdaa7[_0x969b('0x11')]=_0xffdaa7[_0x969b('0x10')]?moment()['format'](_0x969b('0x13')):null;}if(_0xffdaa7[_0x969b('0x16')]('closed')){_0xffdaa7[_0x969b('0x15')]=moment()['format'](_0x969b('0x13'));_0xffdaa7[_0x969b('0x10')]=null;_0xffdaa7[_0x969b('0x11')]=null;}_0x46fad6(null,_0xffdaa7);},'afterUpdate':function(_0x5544f9,_0x398556,_0x1910fa){var _0x1e83c3=_0x215ae2['models'];var _0x247b2a=_0x5544f9['get']({'plain':!![]});if(_0x247b2a[_0x969b('0x14')]){return _0x1e83c3['MailMessage'][_0x969b('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x247b2a['id']}})['then'](function(){_0x1910fa();})[_0x969b('0x18')](function(_0x54737e){_0x1910fa(_0x54737e);});}else{_0x1910fa();}}},'charset':_0x969b('0x19'),'collate':_0x969b('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 85e145d..2e3c92a 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 _0x4cc7=['debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','AddTagsToMailInteraction','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x4eb630,_0x3d9678){var _0x100f5d=function(_0xf09ac){while(--_0xf09ac){_0x4eb630['push'](_0x4eb630['shift']());}};_0x100f5d(++_0x3d9678);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x3f31b9,_0xba9238){_0x3f31b9=_0x3f31b9-0x0;var _0x3def9d=_0x4cc7[_0x3f31b9];return _0x3def9d;};'use strict';var _=require(_0x74cc('0x0'));var util=require(_0x74cc('0x1'));var moment=require(_0x74cc('0x2'));var BPromise=require(_0x74cc('0x3'));var rs=require(_0x74cc('0x4'));var fs=require('fs');var Redis=require(_0x74cc('0x5'));var db=require(_0x74cc('0x6'))['db'];var utils=require(_0x74cc('0x7'));var logger=require('../../config/logger')(_0x74cc('0x8'));var config=require(_0x74cc('0x9'));var jayson=require(_0x74cc('0xa'));var client=jayson[_0x74cc('0xb')][_0x74cc('0xc')]({'port':0x232a});config[_0x74cc('0xd')]=_[_0x74cc('0xe')](config[_0x74cc('0xd')],{'host':_0x74cc('0xf'),'port':0x18eb});var socket=require(_0x74cc('0x10'))(new Redis(config[_0x74cc('0xd')]));require(_0x74cc('0x11'))[_0x74cc('0x12')](socket);function respondWithRpcPromise(_0x493be4,_0x2b10f5,_0x19d928){return new BPromise(function(_0x21e3a5,_0x20fb78){return client[_0x74cc('0x13')](_0x493be4,_0x19d928)[_0x74cc('0x14')](function(_0x2d2d17){logger[_0x74cc('0x15')](_0x74cc('0x16'),_0x2b10f5,_0x74cc('0x17'));logger[_0x74cc('0x18')](_0x74cc('0x19'),_0x2b10f5,'request\x20sent',JSON[_0x74cc('0x1a')](_0x2d2d17));if(_0x2d2d17[_0x74cc('0x1b')]){if(_0x2d2d17[_0x74cc('0x1b')]['code']===0x1f4){logger[_0x74cc('0x1b')](_0x74cc('0x16'),_0x2b10f5,_0x2d2d17[_0x74cc('0x1b')][_0x74cc('0x1c')]);return _0x20fb78(_0x2d2d17[_0x74cc('0x1b')][_0x74cc('0x1c')]);}logger[_0x74cc('0x1b')](_0x74cc('0x16'),_0x2b10f5,_0x2d2d17[_0x74cc('0x1b')]['message']);return _0x21e3a5(_0x2d2d17['error'][_0x74cc('0x1c')]);}else{logger[_0x74cc('0x15')](_0x74cc('0x16'),_0x2b10f5,_0x74cc('0x17'));_0x21e3a5(_0x2d2d17[_0x74cc('0x1d')]['message']);}})[_0x74cc('0x1e')](function(_0x1bd301){logger[_0x74cc('0x1b')](_0x74cc('0x16'),_0x2b10f5,_0x1bd301);_0x20fb78(_0x1bd301);});});}exports[_0x74cc('0x1f')]=function(_0x744ea2){var _0x3dc1c1=this;return new Promise(function(_0x261bf7,_0x477605){return db[_0x74cc('0x20')]['update'](_0x744ea2[_0x74cc('0x21')],{'raw':_0x744ea2[_0x74cc('0x22')]?_0x744ea2[_0x74cc('0x22')][_0x74cc('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x744ea2[_0x74cc('0x22')]?_0x744ea2[_0x74cc('0x22')][_0x74cc('0x24')]||null:null,'attributes':_0x744ea2[_0x74cc('0x22')]?_0x744ea2[_0x74cc('0x22')]['attributes']||null:null,'limit':_0x744ea2[_0x74cc('0x22')]?_0x744ea2[_0x74cc('0x22')]['limit']||null:null})[_0x74cc('0x14')](function(_0x1a2707){logger[_0x74cc('0x15')](_0x74cc('0x1f'),_0x744ea2);logger[_0x74cc('0x18')]('UpdateMailInteraction',_0x744ea2,JSON[_0x74cc('0x1a')](_0x1a2707));_0x261bf7(_0x1a2707);})[_0x74cc('0x1e')](function(_0x47c32f){logger[_0x74cc('0x1b')](_0x74cc('0x1f'),_0x47c32f[_0x74cc('0x1c')],_0x744ea2);_0x477605(_0x3dc1c1[_0x74cc('0x1b')](0x1f4,_0x47c32f[_0x74cc('0x1c')]));});});};exports[_0x74cc('0x25')]=function(_0x581872){return new Promise(function(_0x2c671c,_0x42a856){return db['MailInteraction']['find']({'where':_0x581872[_0x74cc('0x22')]?_0x581872[_0x74cc('0x22')][_0x74cc('0x24')]||null:null})[_0x74cc('0x14')](function(_0x24e26a){if(_0x24e26a){return _0x24e26a[_0x74cc('0x26')](_0x581872[_0x74cc('0x21')]['ids'],_[_0x74cc('0x27')](_0x581872[_0x74cc('0x21')],[_0x74cc('0x28'),'id'])||{});}})['spread'](function(_0x2d87c2){logger[_0x74cc('0x15')](_0x74cc('0x29'),_0x581872);logger[_0x74cc('0x18')](_0x74cc('0x29'),_0x581872,JSON[_0x74cc('0x1a')](_0x2d87c2));_0x2c671c(_0x2d87c2);})[_0x74cc('0x1e')](function(_0x12b72a){logger[_0x74cc('0x1b')](_0x74cc('0x29'),_0x12b72a[_0x74cc('0x1c')],_0x581872);_0x42a856(_this[_0x74cc('0x1b')](0x1f4,_0x12b72a[_0x74cc('0x1c')]));});});}; \ No newline at end of file +var _0x83ed=['MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','update','options','where','attributes','debug','AddTagsToMailInteraction','MailInteraction','find','addTags','body','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x1cf111,_0x964e0a){var _0x5b27ae=function(_0x508c44){while(--_0x508c44){_0x1cf111['push'](_0x1cf111['shift']());}};_0x5b27ae(++_0x964e0a);}(_0x83ed,0x66));var _0xd83e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x83ed[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xd83e('0x0'));var util=require('util');var moment=require(_0xd83e('0x1'));var BPromise=require(_0xd83e('0x2'));var rs=require(_0xd83e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd83e('0x4'))['db'];var utils=require(_0xd83e('0x5'));var logger=require(_0xd83e('0x6'))(_0xd83e('0x7'));var config=require(_0xd83e('0x8'));var jayson=require(_0xd83e('0x9'));var client=jayson[_0xd83e('0xa')][_0xd83e('0xb')]({'port':0x232a});config[_0xd83e('0xc')]=_['defaults'](config[_0xd83e('0xc')],{'host':_0xd83e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd83e('0xc')]));require(_0xd83e('0xe'))[_0xd83e('0xf')](socket);function respondWithRpcPromise(_0x4f089a,_0x43e440,_0x594ee2){return new BPromise(function(_0x28fb2a,_0x4d64fb){return client[_0xd83e('0x10')](_0x4f089a,_0x594ee2)[_0xd83e('0x11')](function(_0x5c211d){logger[_0xd83e('0x12')](_0xd83e('0x13'),_0x43e440,_0xd83e('0x14'));logger['debug'](_0xd83e('0x15'),_0x43e440,_0xd83e('0x14'),JSON[_0xd83e('0x16')](_0x5c211d));if(_0x5c211d[_0xd83e('0x17')]){if(_0x5c211d[_0xd83e('0x17')][_0xd83e('0x18')]===0x1f4){logger[_0xd83e('0x17')](_0xd83e('0x13'),_0x43e440,_0x5c211d[_0xd83e('0x17')][_0xd83e('0x19')]);return _0x4d64fb(_0x5c211d[_0xd83e('0x17')][_0xd83e('0x19')]);}logger[_0xd83e('0x17')]('MailInteraction,\x20%s,\x20%s',_0x43e440,_0x5c211d['error'][_0xd83e('0x19')]);return _0x28fb2a(_0x5c211d['error'][_0xd83e('0x19')]);}else{logger['info'](_0xd83e('0x13'),_0x43e440,_0xd83e('0x14'));_0x28fb2a(_0x5c211d['result']['message']);}})[_0xd83e('0x1a')](function(_0x1b161f){logger[_0xd83e('0x17')](_0xd83e('0x13'),_0x43e440,_0x1b161f);_0x4d64fb(_0x1b161f);});});}exports[_0xd83e('0x1b')]=function(_0x1c58ae){var _0x22f18e=this;return new Promise(function(_0x3815b6,_0x1bd8e5){return db['MailInteraction'][_0xd83e('0x1c')](_0x1c58ae['body'],{'raw':_0x1c58ae[_0xd83e('0x1d')]?_0x1c58ae[_0xd83e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c58ae[_0xd83e('0x1d')]?_0x1c58ae[_0xd83e('0x1d')][_0xd83e('0x1e')]||null:null,'attributes':_0x1c58ae[_0xd83e('0x1d')]?_0x1c58ae[_0xd83e('0x1d')][_0xd83e('0x1f')]||null:null,'limit':_0x1c58ae[_0xd83e('0x1d')]?_0x1c58ae[_0xd83e('0x1d')]['limit']||null:null})['then'](function(_0x57988b){logger['info'](_0xd83e('0x1b'),_0x1c58ae);logger[_0xd83e('0x20')](_0xd83e('0x1b'),_0x1c58ae,JSON[_0xd83e('0x16')](_0x57988b));_0x3815b6(_0x57988b);})[_0xd83e('0x1a')](function(_0x2bc6f8){logger[_0xd83e('0x17')](_0xd83e('0x1b'),_0x2bc6f8[_0xd83e('0x19')],_0x1c58ae);_0x1bd8e5(_0x22f18e[_0xd83e('0x17')](0x1f4,_0x2bc6f8[_0xd83e('0x19')]));});});};exports[_0xd83e('0x21')]=function(_0x40e2d2){return new Promise(function(_0x57f55b,_0x27a905){return db[_0xd83e('0x22')][_0xd83e('0x23')]({'where':_0x40e2d2[_0xd83e('0x1d')]?_0x40e2d2['options'][_0xd83e('0x1e')]||null:null})['then'](function(_0x53792b){if(_0x53792b){return _0x53792b[_0xd83e('0x24')](_0x40e2d2[_0xd83e('0x25')][_0xd83e('0x26')],_[_0xd83e('0x27')](_0x40e2d2[_0xd83e('0x25')],['ids','id'])||{});}})['spread'](function(_0x1bcf09){logger[_0xd83e('0x12')](_0xd83e('0x28'),_0x40e2d2);logger[_0xd83e('0x20')]('AddTags',_0x40e2d2,JSON[_0xd83e('0x16')](_0x1bcf09));_0x57f55b(_0x1bcf09);})[_0xd83e('0x1a')](function(_0x32c48b){logger[_0xd83e('0x17')](_0xd83e('0x28'),_0x32c48b[_0xd83e('0x19')],_0x40e2d2);_0x27a905(_this[_0xd83e('0x17')](0x1f4,_0x32c48b[_0xd83e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index ee7f380..80900cc 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 _0x683e=['update','emit','register','length','mailInteraction:','save','remove'];(function(_0x33e5e8,_0x2be019){var _0x16b6b1=function(_0x45b719){while(--_0x45b719){_0x33e5e8['push'](_0x33e5e8['shift']());}};_0x16b6b1(++_0x2be019);}(_0x683e,0x17f));var _0xe683=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x683e[_0x229d7e];return _0xa78280;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xe683('0x0'),_0xe683('0x1'),_0xe683('0x2')];function createListener(_0x39a137,_0x1c7a4a){return function(_0x500a03){_0x1c7a4a[_0xe683('0x3')](_0x39a137,_0x500a03);};}function removeListener(_0x136433,_0x3cdb06){return function(){MailInteractionEvents['removeListener'](_0x136433,_0x3cdb06);};}exports[_0xe683('0x4')]=function(_0x5ddf24){for(var _0xb82829=0x0,_0x42d6fa=events[_0xe683('0x5')];_0xb82829<_0x42d6fa;_0xb82829++){var _0x2822fa=events[_0xb82829];var _0x3f2dbd=createListener(_0xe683('0x6')+_0x2822fa,_0x5ddf24);MailInteractionEvents['on'](_0x2822fa,_0x3f2dbd);}}; \ No newline at end of file +var _0x5dae=['length','mailInteraction:','save','remove','update','emit','removeListener'];(function(_0x5c788b,_0x86118a){var _0x200cde=function(_0x4a5d9e){while(--_0x4a5d9e){_0x5c788b['push'](_0x5c788b['shift']());}};_0x200cde(++_0x86118a);}(_0x5dae,0xb8));var _0xe5da=function(_0x278fdb,_0xe40cc7){_0x278fdb=_0x278fdb-0x0;var _0x5f4ad2=_0x5dae[_0x278fdb];return _0x5f4ad2;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xe5da('0x0'),_0xe5da('0x1'),_0xe5da('0x2')];function createListener(_0x16303b,_0x3d9566){return function(_0x2e1164){_0x3d9566[_0xe5da('0x3')](_0x16303b,_0x2e1164);};}function removeListener(_0x39dc53,_0x415e00){return function(){MailInteractionEvents[_0xe5da('0x4')](_0x39dc53,_0x415e00);};}exports['register']=function(_0x495740){for(var _0x1c12ce=0x0,_0x2ca8ed=events[_0xe5da('0x5')];_0x1c12ce<_0x2ca8ed;_0x1c12ce++){var _0x225144=events[_0x1c12ce];var _0x403281=createListener(_0xe5da('0x6')+_0x225144,_0x495740);MailInteractionEvents['on'](_0x225144,_0x403281);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d73eabf..c20781c 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 _0x8b1a=['/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b1a,0x152));var _0xa8b1=function(_0x169423,_0x3bc7cc){_0x169423=_0x169423-0x0;var _0x4ddcda=_0x8b1a[_0x169423];return _0x4ddcda;};'use strict';var multer=require(_0xa8b1('0x0'));var util=require(_0xa8b1('0x1'));var path=require(_0xa8b1('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8b1('0x3'));var router=express[_0xa8b1('0x4')]();var fs_extra=require(_0xa8b1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa8b1('0x6'));var config=require(_0xa8b1('0x7'));var controller=require(_0xa8b1('0x8'));router[_0xa8b1('0x9')]('/',auth[_0xa8b1('0xa')](),controller[_0xa8b1('0xb')]);router['get'](_0xa8b1('0xc'),auth[_0xa8b1('0xa')](),controller['describe']);router[_0xa8b1('0x9')](_0xa8b1('0xd'),auth['isAuthenticated'](),controller[_0xa8b1('0xe')]);router[_0xa8b1('0x9')](_0xa8b1('0xf'),auth['isAuthenticated'](),controller['download']);router[_0xa8b1('0x10')]('/',auth['isAuthenticated'](),interaction[_0xa8b1('0x11')](_0xa8b1('0x12'),_0xa8b1('0x13')),controller[_0xa8b1('0x14')]);router[_0xa8b1('0x15')](_0xa8b1('0xd'),auth[_0xa8b1('0xa')](),controller[_0xa8b1('0x16')]);router['put'](_0xa8b1('0x17'),auth[_0xa8b1('0xa')](),controller['accept']);router[_0xa8b1('0x15')]('/:id/reject',auth[_0xa8b1('0xa')](),controller['reject']);router[_0xa8b1('0x18')](_0xa8b1('0xd'),auth[_0xa8b1('0xa')](),controller[_0xa8b1('0x19')]);module[_0xa8b1('0x1a')]=router; \ No newline at end of file +var _0xe235=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x5567d8,_0x5f1c97){var _0x253709=function(_0x19b407){while(--_0x19b407){_0x5567d8['push'](_0x5567d8['shift']());}};_0x253709(++_0x5f1c97);}(_0xe235,0xe4));var _0x5e23=function(_0x500f19,_0x5590a2){_0x500f19=_0x500f19-0x0;var _0x11ba6b=_0xe235[_0x500f19];return _0x11ba6b;};'use strict';var multer=require(_0x5e23('0x0'));var util=require(_0x5e23('0x1'));var path=require(_0x5e23('0x2'));var timeout=require(_0x5e23('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5e23('0x4'));var auth=require(_0x5e23('0x5'));var interaction=require(_0x5e23('0x6'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0x5e23('0x7')]('/',auth[_0x5e23('0x8')](),controller[_0x5e23('0x9')]);router[_0x5e23('0x7')](_0x5e23('0xa'),auth[_0x5e23('0x8')](),controller[_0x5e23('0xb')]);router[_0x5e23('0x7')](_0x5e23('0xc'),auth[_0x5e23('0x8')](),controller[_0x5e23('0xd')]);router[_0x5e23('0x7')](_0x5e23('0xe'),auth[_0x5e23('0x8')](),controller['download']);router[_0x5e23('0xf')]('/',auth[_0x5e23('0x8')](),interaction[_0x5e23('0x10')]('mail',_0x5e23('0x11')),controller['create']);router[_0x5e23('0x12')](_0x5e23('0xc'),auth['isAuthenticated'](),controller[_0x5e23('0x13')]);router[_0x5e23('0x12')](_0x5e23('0x14'),auth[_0x5e23('0x8')](),controller['accept']);router['put'](_0x5e23('0x15'),auth[_0x5e23('0x8')](),controller[_0x5e23('0x16')]);router[_0x5e23('0x17')](_0x5e23('0xc'),auth[_0x5e23('0x8')](),controller[_0x5e23('0x18')]);module[_0x5e23('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 66319f2..70f18b1 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 _0xce9e=['long','medium','ENUM','out','STRING','DATE','BOOLEAN','Email','Chat','sequelize','lodash','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce9e,0x189));var _0xece9=function(_0x178619,_0x35734e){_0x178619=_0x178619-0x0;var _0x2a71e9=_0xce9e[_0x178619];return _0x2a71e9;};'use strict';var Sequelize=require(_0xece9('0x0'));var _=require(_0xece9('0x1'));module['exports']={'body':{'type':Sequelize[_0xece9('0x2')](_0xece9('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xece9('0x2')](_0xece9('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xece9('0x5')]('in',_0xece9('0x6')),'defaultValue':_0xece9('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xece9('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0xece9('0x3'))},'cc':{'type':Sequelize['TEXT'](_0xece9('0x3'))},'bcc':{'type':Sequelize[_0xece9('0x2')](_0xece9('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xece9('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xece9('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xece9('0x8')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0xece9('0x2')](_0xece9('0x3'))},'originChannel':{'type':Sequelize[_0xece9('0x5')](_0xece9('0xa'),_0xece9('0xb')),'defaultValue':_0xece9('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xbab2=['medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email','Chat','lodash','exports','long','TEXT'];(function(_0xfec1e7,_0x96b3a3){var _0x2399d3=function(_0xb7dd83){while(--_0xb7dd83){_0xfec1e7['push'](_0xfec1e7['shift']());}};_0x2399d3(++_0x96b3a3);}(_0xbab2,0x1ea));var _0x2bab=function(_0x40e347,_0x49b841){_0x40e347=_0x40e347-0x0;var _0x545db2=_0xbab2[_0x40e347];return _0x545db2;};'use strict';var Sequelize=require('sequelize');var _=require(_0x2bab('0x0'));module[_0x2bab('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2bab('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2bab('0x3')](_0x2bab('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2bab('0x5')]('in',_0x2bab('0x6')),'defaultValue':_0x2bab('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x2bab('0x7')]},'to':{'type':Sequelize[_0x2bab('0x3')](_0x2bab('0x2'))},'cc':{'type':Sequelize[_0x2bab('0x3')]('long')},'bcc':{'type':Sequelize[_0x2bab('0x3')](_0x2bab('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x2bab('0x8')]},'attach':{'type':Sequelize[_0x2bab('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2bab('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2bab('0x8')]},'originTo':{'type':Sequelize[_0x2bab('0x3')](_0x2bab('0x2'))},'originCc':{'type':Sequelize[_0x2bab('0x3')](_0x2bab('0x2'))},'originChannel':{'type':Sequelize[_0x2bab('0x5')](_0x2bab('0xb'),_0x2bab('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index a854cee..f53d4c8 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 _0x2e92=['reject','rejectmessage','download','unix','toString','server','files','tmp','join','message-%s.eml','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','moment','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','result','status','json','offset','undefined','limit','count','set','update','destroy','end','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','catch','params','includeAll','find','body','describe','create','direction','out','split','MailAccount','MailAccountId','CmList','Contacts','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','root','basename','List','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','email'];(function(_0x16ee48,_0x4e660d){var _0x23f7bf=function(_0x31464e){while(--_0x31464e){_0x16ee48['push'](_0x16ee48['shift']());}};_0x23f7bf(++_0x4e660d);}(_0x2e92,0x1ee));var _0x22e9=function(_0x569aad,_0x3003ff){_0x569aad=_0x569aad-0x0;var _0xb99a35=_0x2e92[_0x569aad];return _0xb99a35;};'use strict';var emlformat=require('eml-format');var moment=require(_0x22e9('0x0'));var BPromise=require(_0x22e9('0x1'));var util=require(_0x22e9('0x2'));var path=require(_0x22e9('0x3'));var fs=require('fs');var _=require(_0x22e9('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x22e9('0x5'));var qs=require(_0x22e9('0x6'));var logger=require('../../config/logger')(_0x22e9('0x7'));var interaction_log=require(_0x22e9('0x8'))(_0x22e9('0x9'));var config=require(_0x22e9('0xa'));var db=require(_0x22e9('0xb'))['db'];config[_0x22e9('0xc')]=_[_0x22e9('0xd')](config[_0x22e9('0xc')],{'host':_0x22e9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22e9('0xc')]));var htmlEntities=require('html-entities');require(_0x22e9('0xf'))[_0x22e9('0x10')](socket);var jayson=require(_0x22e9('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson['client'][_0x22e9('0x12')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f2129,_0x5c798c,_0x523b05,_0x16241d){return new BPromise(function(_0x56d990,_0x32985d){var _0x36d44f=_0x16241d||client;return _0x36d44f[_0x22e9('0x13')](_0x3f2129,_0x523b05)[_0x22e9('0x14')](function(_0x2ccee2){logger[_0x22e9('0x15')]('MailMessage,\x20%s,\x20%s',_0x5c798c,_0x22e9('0x16'));logger[_0x22e9('0x17')](_0x22e9('0x18'),_0x5c798c,'request\x20sent',JSON['stringify'](_0x2ccee2));if(_0x2ccee2[_0x22e9('0x19')]){if(_0x2ccee2[_0x22e9('0x19')][_0x22e9('0x1a')]===0x1f4){logger[_0x22e9('0x19')](_0x22e9('0x1b'),_0x5c798c,_0x2ccee2[_0x22e9('0x19')][_0x22e9('0x1c')]);return _0x32985d(_0x2ccee2['error']['message']);}logger['error'](_0x22e9('0x1b'),_0x5c798c,_0x2ccee2[_0x22e9('0x19')][_0x22e9('0x1c')]);return _0x56d990(_0x2ccee2[_0x22e9('0x19')][_0x22e9('0x1c')]);}else{logger[_0x22e9('0x15')](_0x22e9('0x1b'),_0x5c798c,_0x22e9('0x16'));_0x56d990(_0x2ccee2[_0x22e9('0x1d')][_0x22e9('0x1c')]);}})['catch'](function(_0x5f0e47){logger[_0x22e9('0x19')](_0x22e9('0x1b'),_0x5c798c,_0x5f0e47);_0x32985d(_0x5f0e47);});});}function respondWithResult(_0x20e183,_0x449079){_0x449079=_0x449079||0xc8;return function(_0x506cc6){if(_0x506cc6){return _0x20e183[_0x22e9('0x1e')](_0x449079)[_0x22e9('0x1f')](_0x506cc6);}};}function respondWithFilteredResult(_0xbe6d94,_0x33da37){return function(_0xe58b90){if(_0xe58b90){var _0x1dcfed=typeof _0x33da37[_0x22e9('0x20')]===_0x22e9('0x21')&&typeof _0x33da37[_0x22e9('0x22')]===_0x22e9('0x21');var _0x39d22c=_0xe58b90[_0x22e9('0x23')];var _0x485453=_0x1dcfed?0x0:_0x33da37[_0x22e9('0x20')];var _0x215dc5=_0x1dcfed?_0xe58b90['count']:_0x33da37[_0x22e9('0x20')]+_0x33da37[_0x22e9('0x22')];var _0x543717;if(_0x215dc5>=_0x39d22c){_0x215dc5=_0x39d22c;_0x543717=0xc8;}else{_0x543717=0xce;}_0xbe6d94[_0x22e9('0x1e')](_0x543717);return _0xbe6d94[_0x22e9('0x24')]('Content-Range',_0x485453+'-'+_0x215dc5+'/'+_0x39d22c)[_0x22e9('0x1f')](_0xe58b90);}return null;};}function saveUpdates(_0x410843){return function(_0xbb66f7){if(_0xbb66f7){return _0xbb66f7[_0x22e9('0x25')](_0x410843)[_0x22e9('0x14')](function(_0x3bf287){return _0x3bf287;});}return null;};}function removeEntity(_0x59d03a){return function(_0x48cbc7){if(_0x48cbc7){return _0x48cbc7[_0x22e9('0x26')]()[_0x22e9('0x14')](function(){_0x59d03a[_0x22e9('0x1e')](0xcc)[_0x22e9('0x27')]();});}};}function handleEntityNotFound(_0x1b9780){return function(_0x1ffa61){if(!_0x1ffa61){_0x1b9780['sendStatus'](0x194);}return _0x1ffa61;};}function handleError(_0x5a015c,_0xf596b1){_0xf596b1=_0xf596b1||0x1f4;return function(_0x5a6194){logger['error'](_0x5a6194[_0x22e9('0x28')]);if(_0x5a6194[_0x22e9('0x29')]){delete _0x5a6194[_0x22e9('0x29')];}_0x5a015c['status'](_0xf596b1)[_0x22e9('0x2a')](_0x5a6194);};}exports[_0x22e9('0x2b')]=function(_0x4daccf,_0x1170b5){var _0x5a2028={},_0x9cf3c8={},_0x3aad95={'count':0x0,'rows':[]};var _0x547713=_['map'](db[_0x22e9('0x2c')][_0x22e9('0x2d')],function(_0x4d3902){return{'name':_0x4d3902[_0x22e9('0x2e')],'type':_0x4d3902[_0x22e9('0x2f')][_0x22e9('0x30')]};});_0x9cf3c8['model']=_[_0x22e9('0x31')](_0x547713,'name');_0x9cf3c8[_0x22e9('0x32')]=_[_0x22e9('0x33')](_0x4daccf[_0x22e9('0x32')]);_0x9cf3c8[_0x22e9('0x34')]=_[_0x22e9('0x35')](_0x9cf3c8[_0x22e9('0x36')],_0x9cf3c8[_0x22e9('0x32')]);_0x5a2028[_0x22e9('0x37')]=_['intersection'](_0x9cf3c8[_0x22e9('0x36')],qs['fields'](_0x4daccf[_0x22e9('0x32')][_0x22e9('0x38')]));_0x5a2028[_0x22e9('0x37')]=_0x5a2028[_0x22e9('0x37')][_0x22e9('0x39')]?_0x5a2028['attributes']:_0x9cf3c8['model'];if(!_0x4daccf[_0x22e9('0x32')]['hasOwnProperty'](_0x22e9('0x3a'))){_0x5a2028[_0x22e9('0x22')]=qs[_0x22e9('0x22')](_0x4daccf[_0x22e9('0x32')]['limit']);_0x5a2028[_0x22e9('0x20')]=qs[_0x22e9('0x20')](_0x4daccf[_0x22e9('0x32')]['offset']);}_0x5a2028['order']=qs[_0x22e9('0x3b')](_0x4daccf[_0x22e9('0x32')][_0x22e9('0x3b')]);_0x5a2028['where']=qs[_0x22e9('0x34')](_[_0x22e9('0x3c')](_0x4daccf['query'],_0x9cf3c8[_0x22e9('0x34')]),_0x547713);if(_0x4daccf[_0x22e9('0x32')][_0x22e9('0x3d')]){_0x5a2028[_0x22e9('0x3e')]=_[_0x22e9('0x3f')](_0x5a2028[_0x22e9('0x3e')],{'$or':_[_0x22e9('0x31')](_0x547713,function(_0x4a5132){if(_0x4a5132[_0x22e9('0x2f')]!==_0x22e9('0x40')){var _0xeaea0b={};_0xeaea0b[_0x4a5132[_0x22e9('0x29')]]={'$like':'%'+_0x4daccf['query'][_0x22e9('0x3d')]+'%'};return _0xeaea0b;}})});}_0x5a2028=_[_0x22e9('0x3f')]({},_0x5a2028,_0x4daccf[_0x22e9('0x41')]);var _0x1033d3={'where':_0x5a2028['where']};return db[_0x22e9('0x2c')]['count'](_0x1033d3)[_0x22e9('0x14')](function(_0x54427a){_0x3aad95['count']=_0x54427a;if(_0x4daccf[_0x22e9('0x32')]['includeAll']){_0x5a2028[_0x22e9('0x42')]=[{'all':!![]}];}return db[_0x22e9('0x2c')]['findAll'](_0x5a2028);})[_0x22e9('0x14')](function(_0x1efba7){_0x3aad95['rows']=_0x1efba7;return _0x3aad95;})['then'](respondWithFilteredResult(_0x1170b5,_0x5a2028))[_0x22e9('0x43')](handleError(_0x1170b5,null));};exports['show']=function(_0x5bd19e,_0x1e08cf){var _0x1b69ed={'raw':!![],'where':{'id':_0x5bd19e[_0x22e9('0x44')]['id']}},_0x1a3177={};_0x1a3177[_0x22e9('0x36')]=_[_0x22e9('0x33')](db[_0x22e9('0x2c')][_0x22e9('0x2d')]);_0x1a3177[_0x22e9('0x32')]=_[_0x22e9('0x33')](_0x5bd19e[_0x22e9('0x32')]);_0x1a3177[_0x22e9('0x34')]=_[_0x22e9('0x35')](_0x1a3177['model'],_0x1a3177[_0x22e9('0x32')]);_0x1b69ed[_0x22e9('0x37')]=_['intersection'](_0x1a3177[_0x22e9('0x36')],qs[_0x22e9('0x38')](_0x5bd19e[_0x22e9('0x32')][_0x22e9('0x38')]));_0x1b69ed[_0x22e9('0x37')]=_0x1b69ed[_0x22e9('0x37')]['length']?_0x1b69ed[_0x22e9('0x37')]:_0x1a3177['model'];if(_0x5bd19e[_0x22e9('0x32')][_0x22e9('0x45')]){_0x1b69ed['include']=[{'all':!![]}];}_0x1b69ed=_[_0x22e9('0x3f')]({},_0x1b69ed,_0x5bd19e[_0x22e9('0x41')]);return db[_0x22e9('0x2c')][_0x22e9('0x46')](_0x1b69ed)[_0x22e9('0x14')](handleEntityNotFound(_0x1e08cf,null))[_0x22e9('0x14')](respondWithResult(_0x1e08cf,null))[_0x22e9('0x43')](handleError(_0x1e08cf,null));};exports[_0x22e9('0x25')]=function(_0x515bc3,_0x57a8c8){if(_0x515bc3['body']['id']){delete _0x515bc3[_0x22e9('0x47')]['id'];}return db[_0x22e9('0x2c')][_0x22e9('0x46')]({'where':{'id':_0x515bc3[_0x22e9('0x44')]['id']}})['then'](handleEntityNotFound(_0x57a8c8,null))[_0x22e9('0x14')](saveUpdates(_0x515bc3[_0x22e9('0x47')],null))[_0x22e9('0x14')](respondWithResult(_0x57a8c8,null))[_0x22e9('0x43')](handleError(_0x57a8c8,null));};exports[_0x22e9('0x26')]=function(_0x476d4d,_0x160a8f){return db[_0x22e9('0x2c')]['find']({'where':{'id':_0x476d4d[_0x22e9('0x44')]['id']}})['then'](handleEntityNotFound(_0x160a8f,null))['then'](removeEntity(_0x160a8f,null))[_0x22e9('0x43')](handleError(_0x160a8f,null));};exports[_0x22e9('0x48')]=function(_0x1e1010,_0x3ab2dc){return db['MailMessage'][_0x22e9('0x48')]()[_0x22e9('0x14')](respondWithResult(_0x3ab2dc,null))['catch'](handleError(_0x3ab2dc,null));};exports[_0x22e9('0x49')]=function(_0x5d13e3,_0x54594d){return db[_0x22e9('0x2c')][_0x22e9('0x49')](_0x5d13e3[_0x22e9('0x47')])[_0x22e9('0x14')](function(_0x18f9e5){if(_0x18f9e5){if(_0x18f9e5[_0x22e9('0x4a')]===_0x22e9('0x4b')&&!_0x18f9e5['secret']){var _0x554c51,_0x36d06a,_0x1779f8;if(_0x5d13e3[_0x22e9('0x47')]['to']){_0x36d06a=_0x5d13e3[_0x22e9('0x47')]['to'][_0x22e9('0x4c')](',')[0x0];}return db[_0x22e9('0x4d')]['findOne']({'where':{'id':_0x18f9e5[_0x22e9('0x4e')]},'include':[{'model':db[_0x22e9('0x4f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x22e9('0x50'),'where':{'email':_0x36d06a},'limit':0x1,'order':[['updatedAt',_0x22e9('0x51')]]}]},{'model':db[_0x22e9('0x52')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x22e9('0x53')],'as':_0x22e9('0x53'),'raw':!![]}]}]})['then'](function(_0x2d89d0){_0x554c51=_0x2d89d0;if(!_0x554c51||!_0x554c51[_0x22e9('0x54')])return;var _0x18e601=_0x554c51[_0x22e9('0x55')]();if(_0x5d13e3[_0x22e9('0x47')][_0x22e9('0x56')]&&_0x5d13e3[_0x22e9('0x47')][_0x22e9('0x56')][_0x22e9('0x39')]){for(var _0x2ea2ce=0x0;_0x2ea2ce<_0x5d13e3[_0x22e9('0x47')][_0x22e9('0x56')][_0x22e9('0x39')];_0x2ea2ce+=0x1){_0x5d13e3[_0x22e9('0x47')][_0x22e9('0x56')][_0x2ea2ce]={'filename':_0x5d13e3['body'][_0x22e9('0x56')][_0x2ea2ce][_0x22e9('0x29')],'path':path['join'](config[_0x22e9('0x57')],'server/files/attachments',_0x5d13e3[_0x22e9('0x47')][_0x22e9('0x56')][_0x2ea2ce][_0x22e9('0x58')])};}}_0x1779f8={'account':_0x18e601,'message':_0x5d13e3['body']};return;})['then'](function(){if(_0x554c51[_0x22e9('0x59')]){if(_0x554c51[_0x22e9('0x59')][_0x22e9('0x50')][_0x22e9('0x39')]){return _0x554c51[_0x22e9('0x59')][_0x22e9('0x50')][0x0];}else{return db[_0x22e9('0x5a')][_0x22e9('0x49')](_[_0x22e9('0xd')](_0x5d13e3[_0x22e9('0x47')],{'firstName':_0x5d13e3[_0x22e9('0x47')]['to'],'email':_0x5d13e3[_0x22e9('0x47')]['to'],'phone':_0x5d13e3[_0x22e9('0x47')]['to'],'ListId':_0x554c51[_0x22e9('0x5b')]}));}}else{throw new Error(_0x22e9('0x5c'));}})[_0x22e9('0x14')](function(){if(_0x1779f8){return respondWithRpcPromise(_0x22e9('0x5d'),_0x22e9('0x5e'),_0x1779f8,client9003)[_0x22e9('0x14')](function(_0x10e4ea){return _0x18f9e5[_0x22e9('0x25')]({'read':!![],'messageId':_0x10e4ea[_0x22e9('0x5f')],'sentAt':moment()[_0x22e9('0x60')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x22e9('0x43')](function(_0xb6760f){logger[_0x22e9('0x19')]('%s',JSON['stringify'](_0xb6760f));return _0x18f9e5;});}return _0x18f9e5;});}return _0x18f9e5;}})['then'](respondWithResult(_0x54594d,0xc9))[_0x22e9('0x43')](handleError(_0x54594d,null));};exports[_0x22e9('0x61')]=function(_0x172dfe,_0x1ad5eb){var _0x5bf405={'agent':{},'channel':'mail'};if(_0x172dfe[_0x22e9('0x47')]['id']){delete _0x172dfe[_0x22e9('0x47')]['id'];}_0x172dfe[_0x22e9('0x47')][_0x22e9('0x62')]=!![];_0x172dfe[_0x22e9('0x47')][_0x22e9('0x63')]=moment()[_0x22e9('0x60')](_0x22e9('0x64'));_0x172dfe['body'][_0x22e9('0x65')]=_0x172dfe[_0x22e9('0x47')][_0x22e9('0x65')]||_0x172dfe[_0x22e9('0x66')]['id'];_0x5bf405['agent']['id']=_0x172dfe[_0x22e9('0x47')][_0x22e9('0x65')];return db[_0x22e9('0x2c')][_0x22e9('0x46')]({'where':{'id':_0x172dfe[_0x22e9('0x44')]['id'],'UserId':null}})[_0x22e9('0x14')](handleEntityNotFound(_0x1ad5eb,null))[_0x22e9('0x14')](saveUpdates(_0x172dfe[_0x22e9('0x47')],null))[_0x22e9('0x14')](function(_0x905c17){if(_0x905c17){_0x5bf405[_0x22e9('0x1c')]=_0x905c17[_0x22e9('0x67')]({'plain':!![]});return db[_0x22e9('0x68')]['find']({'where':{'id':_0x905c17[_0x22e9('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x1ad5eb,null))[_0x22e9('0x14')](function(_0x30fe97){if(_0x30fe97){return _0x30fe97[_0x22e9('0x25')]({'UserId':_0x172dfe['body'][_0x22e9('0x65')],'read1stAt':_[_0x22e9('0x6a')](_0x30fe97['read1stAt'])?moment()[_0x22e9('0x60')](_0x22e9('0x64')):undefined});}return null;})[_0x22e9('0x14')](function(_0x310d9d){if(_0x310d9d){_0x5bf405[_0x22e9('0x6b')]=_0x310d9d[_0x22e9('0x67')]({'plain':!![]});interaction_log['info'](_0x22e9('0x6c'),_0x172dfe[_0x22e9('0x66')]['id'],_0x172dfe[_0x22e9('0x66')]['name'],_0x172dfe[_0x22e9('0x66')][_0x22e9('0x6d')],_0x5bf405['interaction']['id'],_0x172dfe[_0x22e9('0x47')]?JSON[_0x22e9('0x6e')](_0x172dfe[_0x22e9('0x47')]):_0x22e9('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x22e9('0x70'),_0x5bf405);}return null;})[_0x22e9('0x14')](function(_0x2fa32c){var _0x47cff1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2fa32c[_0x22e9('0x1c')][_0x22e9('0x71')];return db[_0x22e9('0x72')][_0x22e9('0x32')](_0x47cff1,{'type':db[_0x22e9('0x73')][_0x22e9('0x74')][_0x22e9('0x75')],'raw':!![]})[_0x22e9('0x14')](function(_0x177689){return _0x177689;});})['then'](function(_0x503659){if(_0x503659){_0x5bf405[_0x22e9('0x1c')]['contact']=_0x503659[0x0];if(!_0x172dfe[_0x22e9('0x47')]['UserId'])return;return db[_0x22e9('0x76')][_0x22e9('0x46')]({'where':{'id':_0x172dfe[_0x22e9('0x47')]['UserId'],'role':_0x22e9('0x77')},'attributes':['id',_0x22e9('0x29'),_0x22e9('0x78'),'email',_0x22e9('0x79')],'raw':!![]});}return null;})[_0x22e9('0x14')](function(_0x5f52f2){if(!_0x5f52f2)return null;_0x5bf405['message']['agent']=_0x5f52f2;return _0x5bf405;})[_0x22e9('0x14')](function(_0x32c38b){if(_0x32c38b){if(_0x172dfe['body'][_0x22e9('0x7a')]){_0x5bf405['message'][_0x22e9('0x7b')]=util[_0x22e9('0x60')](_0x22e9('0x7c'),_0x172dfe[_0x22e9('0x66')][_0x22e9('0x29')]);_0x5bf405[_0x22e9('0x1c')][_0x22e9('0x7d')]=_0x5bf405['channel'];_0x5bf405[_0x22e9('0x1c')][_0x22e9('0x7e')]=_0x5bf405['channel'];_0x5bf405[_0x22e9('0x1c')][_0x22e9('0x7f')]=_0x22e9('0x61');_0x5bf405['message']['body']=htmlToText[_0x22e9('0x80')](_0x5bf405[_0x22e9('0x1c')][_0x22e9('0x47')]);return respondWithRpcPromise(_0x22e9('0x81'),_0x22e9('0x81'),{'event':'acceptmessage','message':_0x5bf405[_0x22e9('0x1c')]},client9002)[_0x22e9('0x14')](function(){return _0x5bf405;});}return _0x5bf405;}return null;})[_0x22e9('0x14')](respondWithResult(_0x1ad5eb,null))['catch'](handleError(_0x1ad5eb,null));};exports['reject']=function(_0x316d58,_0xdc9920){var _0x18870a={'agent':{},'channel':_0x22e9('0x82')};if(_0x316d58[_0x22e9('0x47')]['id']){delete _0x316d58[_0x22e9('0x47')]['id'];}_0x316d58[_0x22e9('0x47')][_0x22e9('0x65')]=_0x316d58[_0x22e9('0x47')][_0x22e9('0x65')]||_0x316d58[_0x22e9('0x66')]['id'];_0x18870a[_0x22e9('0x77')]['id']=_0x316d58[_0x22e9('0x47')][_0x22e9('0x65')];return db[_0x22e9('0x2c')][_0x22e9('0x46')]({'where':{'id':_0x316d58[_0x22e9('0x44')]['id'],'UserId':null}})[_0x22e9('0x14')](handleEntityNotFound(_0xdc9920,null))[_0x22e9('0x14')](function(_0x34679c){if(_0x34679c){_0x18870a['message']=_0x34679c[_0x22e9('0x67')]({'plain':!![]});return db[_0x22e9('0x68')]['find']({'where':{'id':_0x34679c[_0x22e9('0x69')]}});}return null;})[_0x22e9('0x14')](handleEntityNotFound(_0xdc9920,null))[_0x22e9('0x14')](function(_0x419c26){if(_0x419c26){_0x18870a[_0x22e9('0x6b')]=_0x419c26[_0x22e9('0x67')]({'plain':!![]});interaction_log[_0x22e9('0x15')](_0x22e9('0x83'),_0x316d58['user']['id'],_0x316d58[_0x22e9('0x66')][_0x22e9('0x29')],_0x316d58[_0x22e9('0x66')]['role'],_0x18870a['interaction']['id'],_0x316d58[_0x22e9('0x47')]?JSON['stringify'](_0x316d58[_0x22e9('0x47')]):'null');return respondWithRpcPromise(_0x22e9('0x84'),'rejectMessage',_0x18870a);}return null;})[_0x22e9('0x14')](function(_0x2a405b){var _0x71b2a7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a405b[_0x22e9('0x1c')][_0x22e9('0x71')];return db[_0x22e9('0x72')]['query'](_0x71b2a7,{'type':db[_0x22e9('0x73')][_0x22e9('0x74')][_0x22e9('0x75')],'raw':!![]})[_0x22e9('0x14')](function(_0x36e825){return _0x36e825;});})[_0x22e9('0x14')](function(_0x525263){if(_0x525263){_0x18870a[_0x22e9('0x1c')]['contact']=_0x525263[0x0];if(!_0x316d58[_0x22e9('0x47')][_0x22e9('0x65')])return;return db[_0x22e9('0x76')][_0x22e9('0x46')]({'where':{'id':_0x316d58[_0x22e9('0x47')][_0x22e9('0x65')],'role':_0x22e9('0x77')},'attributes':['id',_0x22e9('0x29'),'fullname',_0x22e9('0x85'),'internal'],'raw':!![]});}return null;})[_0x22e9('0x14')](function(_0x537d92){if(!_0x537d92)return null;_0x18870a[_0x22e9('0x1c')][_0x22e9('0x77')]=_0x537d92;return _0x18870a;})['then'](function(_0x3bfeba){if(_0x3bfeba){_0x3bfeba[_0x22e9('0x1c')]['interface']=util['format'](_0x22e9('0x7c'),_0x316d58[_0x22e9('0x66')][_0x22e9('0x29')]);_0x3bfeba[_0x22e9('0x1c')]['channel']=_0x18870a['channel'];_0x3bfeba['message'][_0x22e9('0x7e')]=_0x18870a['channel'];_0x3bfeba['message'][_0x22e9('0x7f')]=_0x22e9('0x86');_0x3bfeba[_0x22e9('0x1c')][_0x22e9('0x47')]=htmlToText['fromString'](_0x18870a[_0x22e9('0x1c')][_0x22e9('0x47')]);respondWithRpcPromise('EventManager',_0x22e9('0x81'),{'event':_0x22e9('0x87'),'message':_0x3bfeba['message']},client9002);return _0x18870a;}return null;})[_0x22e9('0x14')](respondWithResult(_0xdc9920,null))[_0x22e9('0x43')](handleError(_0xdc9920,null));};exports[_0x22e9('0x88')]=function(_0x13c43f,_0x13fe8d){var _0xbe8d99=moment()[_0x22e9('0x89')]()[_0x22e9('0x8a')]();var _0x327e85=path['join'](config[_0x22e9('0x57')],_0x22e9('0x8b'),_0x22e9('0x8c'),_0x22e9('0x8d'));var _0x43f00c=path[_0x22e9('0x8e')](config['root'],_0x22e9('0x8b'),_0x22e9('0x8c'),_0x22e9('0x56'));var _0x16ab20=util[_0x22e9('0x60')](_0x22e9('0x8f'),_0xbe8d99);return db['MailMessage'][_0x22e9('0x46')]({'where':{'id':_0x13c43f[_0x22e9('0x44')]['id']},'attributes':['id',_0x22e9('0x47'),_0x22e9('0x90'),'to','cc',_0x22e9('0x91'),_0x22e9('0x92'),_0x22e9('0x93')],'include':_0x13c43f[_0x22e9('0x32')]['attachments']?[{'model':db['Attachment'],'as':_0x22e9('0x94')}]:undefined})[_0x22e9('0x14')](handleEntityNotFound(_0x13fe8d,null))[_0x22e9('0x14')](function(_0x1c7f25){if(_0x1c7f25){var _0x330464=_0x1c7f25;var _0x4706c3={'from':_0x330464[_0x22e9('0x90')],'to':_0x330464['to'],'subject':_0x330464['subject'],'html':htmlEntities[_0x22e9('0x95')](_0x330464['body']),'headers':{'Date':moment(_0x330464[_0x22e9('0x93')])[_0x22e9('0x60')](_0x22e9('0x96'))},'attachments':[]};if(_0x1c7f25['cc']){_0x4706c3['headers']['Cc']=_0x1c7f25['cc'];}if(_0x1c7f25[_0x22e9('0x91')]){_0x4706c3[_0x22e9('0x97')][_0x22e9('0x98')]=_0x1c7f25[_0x22e9('0x91')];}return new BPromise(function(_0x16d293,_0x20d799){if(_0x1c7f25[_0x22e9('0x94')]){for(var _0x132579=0x0;_0x132579<_0x1c7f25[_0x22e9('0x94')][_0x22e9('0x39')];_0x132579++){var _0x3b2e0b=_0x1c7f25['Attachments'][_0x132579];var _0x2f33f5=path[_0x22e9('0x8e')](_0x43f00c,_0x3b2e0b[_0x22e9('0x58')]);if(fs[_0x22e9('0x99')](_0x2f33f5)){_0x4706c3['attachments']['push']({'name':_0x3b2e0b['name'],'contentType':_0x3b2e0b[_0x22e9('0x2f')],'data':fs[_0x22e9('0x9a')](_0x2f33f5)});}}}emlformat[_0x22e9('0x9b')](_0x4706c3,function(_0x4a953a,_0x29c41e){if(_0x4a953a)return _0x20d799(_0x4a953a);fs[_0x22e9('0x9c')](path[_0x22e9('0x8e')](_0x327e85,_0x16ab20),_0x29c41e);return _0x16d293(_0x29c41e);});});}})[_0x22e9('0x14')](function(_0x56c269){if(_0x56c269){return _0x13fe8d['download'](path[_0x22e9('0x8e')](_0x327e85,_0x16ab20),_0x16ab20,function(_0x598a66){if(!_0x598a66)fs['unlinkSync'](path[_0x22e9('0x8e')](_0x327e85,_0x16ab20));});}})[_0x22e9('0x43')](handleError(_0x13fe8d,null));}; \ No newline at end of file +var _0x2080=['body','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','attachments','join','root','basename','Contacts','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','read','readAt','UserId','agent','get','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','fromString','rejectmessage','download','toString','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','readFileSync','build','writeFileSync','eml-format','moment','bluebird','util','path','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x2080,0xf1));var _0x0208=function(_0x1c6045,_0x46d59f){_0x1c6045=_0x1c6045-0x0;var _0x257e28=_0x2080[_0x1c6045];return _0x257e28;};'use strict';var emlformat=require(_0x0208('0x0'));var moment=require(_0x0208('0x1'));var BPromise=require(_0x0208('0x2'));var util=require(_0x0208('0x3'));var path=require(_0x0208('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0x0208('0x5'));var logger=require(_0x0208('0x6'))('api');var interaction_log=require(_0x0208('0x6'))(_0x0208('0x7'));var config=require(_0x0208('0x8'));var db=require('../../mysqldb')['db'];config[_0x0208('0x9')]=_[_0x0208('0xa')](config[_0x0208('0x9')],{'host':_0x0208('0xb'),'port':0x18eb});var socket=require(_0x0208('0xc'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0x0208('0xd'))['register'](socket);var jayson=require(_0x0208('0xe'));var client=jayson[_0x0208('0xf')]['http']({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x0208('0xf')][_0x0208('0x10')]({'port':0x232a});function respondWithRpcPromise(_0xe414d7,_0x362bd8,_0x24522e,_0x427a21){return new BPromise(function(_0x4eabec,_0xc1dc6){var _0x2bfaa4=_0x427a21||client;return _0x2bfaa4[_0x0208('0x11')](_0xe414d7,_0x24522e)[_0x0208('0x12')](function(_0x386305){logger[_0x0208('0x13')](_0x0208('0x14'),_0x362bd8,_0x0208('0x15'));logger[_0x0208('0x16')](_0x0208('0x17'),_0x362bd8,'request\x20sent',JSON[_0x0208('0x18')](_0x386305));if(_0x386305[_0x0208('0x19')]){if(_0x386305[_0x0208('0x19')][_0x0208('0x1a')]===0x1f4){logger['error'](_0x0208('0x14'),_0x362bd8,_0x386305[_0x0208('0x19')][_0x0208('0x1b')]);return _0xc1dc6(_0x386305['error'][_0x0208('0x1b')]);}logger['error'](_0x0208('0x14'),_0x362bd8,_0x386305[_0x0208('0x19')]['message']);return _0x4eabec(_0x386305[_0x0208('0x19')][_0x0208('0x1b')]);}else{logger[_0x0208('0x13')]('MailMessage,\x20%s,\x20%s',_0x362bd8,'request\x20sent');_0x4eabec(_0x386305[_0x0208('0x1c')][_0x0208('0x1b')]);}})['catch'](function(_0x92031e){logger[_0x0208('0x19')](_0x0208('0x14'),_0x362bd8,_0x92031e);_0xc1dc6(_0x92031e);});});}function respondWithResult(_0x4e9a78,_0x519dd3){_0x519dd3=_0x519dd3||0xc8;return function(_0x3b1b05){if(_0x3b1b05){return _0x4e9a78['status'](_0x519dd3)[_0x0208('0x1d')](_0x3b1b05);}};}function respondWithFilteredResult(_0x1c0165,_0x5ec847){return function(_0x285b01){if(_0x285b01){var _0x5016ba=typeof _0x5ec847[_0x0208('0x1e')]===_0x0208('0x1f')&&typeof _0x5ec847[_0x0208('0x20')]===_0x0208('0x1f');var _0x42bc34=_0x285b01[_0x0208('0x21')];var _0x5262a5=_0x5016ba?0x0:_0x5ec847['offset'];var _0x5cb5ef=_0x5016ba?_0x285b01[_0x0208('0x21')]:_0x5ec847[_0x0208('0x1e')]+_0x5ec847[_0x0208('0x20')];var _0x359d9d;if(_0x5cb5ef>=_0x42bc34){_0x5cb5ef=_0x42bc34;_0x359d9d=0xc8;}else{_0x359d9d=0xce;}_0x1c0165[_0x0208('0x22')](_0x359d9d);return _0x1c0165[_0x0208('0x23')](_0x0208('0x24'),_0x5262a5+'-'+_0x5cb5ef+'/'+_0x42bc34)['json'](_0x285b01);}return null;};}function saveUpdates(_0x5b2241){return function(_0x5754a2){if(_0x5754a2){return _0x5754a2[_0x0208('0x25')](_0x5b2241)[_0x0208('0x12')](function(_0x148404){return _0x148404;});}return null;};}function removeEntity(_0x388bc5){return function(_0xd7073d){if(_0xd7073d){return _0xd7073d[_0x0208('0x26')]()[_0x0208('0x12')](function(){_0x388bc5[_0x0208('0x22')](0xcc)[_0x0208('0x27')]();});}};}function handleEntityNotFound(_0x4128ad){return function(_0x51527b){if(!_0x51527b){_0x4128ad[_0x0208('0x28')](0x194);}return _0x51527b;};}function handleError(_0x22238d,_0x1036b3){_0x1036b3=_0x1036b3||0x1f4;return function(_0x23efc9){logger['error'](_0x23efc9['stack']);if(_0x23efc9['name']){delete _0x23efc9[_0x0208('0x29')];}_0x22238d['status'](_0x1036b3)[_0x0208('0x2a')](_0x23efc9);};}exports[_0x0208('0x2b')]=function(_0x314c57,_0x221910){var _0x41407b={},_0x11e1b7={},_0xaa808a={'count':0x0,'rows':[]};var _0x2c44da=_[_0x0208('0x2c')](db[_0x0208('0x2d')][_0x0208('0x2e')],function(_0x122c4a){return{'name':_0x122c4a[_0x0208('0x2f')],'type':_0x122c4a['type'][_0x0208('0x30')]};});_0x11e1b7[_0x0208('0x31')]=_[_0x0208('0x2c')](_0x2c44da,_0x0208('0x29'));_0x11e1b7[_0x0208('0x32')]=_[_0x0208('0x33')](_0x314c57[_0x0208('0x32')]);_0x11e1b7[_0x0208('0x34')]=_[_0x0208('0x35')](_0x11e1b7[_0x0208('0x31')],_0x11e1b7['query']);_0x41407b[_0x0208('0x36')]=_['intersection'](_0x11e1b7['model'],qs['fields'](_0x314c57['query'][_0x0208('0x37')]));_0x41407b[_0x0208('0x36')]=_0x41407b[_0x0208('0x36')][_0x0208('0x38')]?_0x41407b[_0x0208('0x36')]:_0x11e1b7[_0x0208('0x31')];if(!_0x314c57['query'][_0x0208('0x39')](_0x0208('0x3a'))){_0x41407b[_0x0208('0x20')]=qs[_0x0208('0x20')](_0x314c57[_0x0208('0x32')][_0x0208('0x20')]);_0x41407b['offset']=qs[_0x0208('0x1e')](_0x314c57[_0x0208('0x32')][_0x0208('0x1e')]);}_0x41407b[_0x0208('0x3b')]=qs[_0x0208('0x3c')](_0x314c57['query'][_0x0208('0x3c')]);_0x41407b[_0x0208('0x3d')]=qs['filters'](_[_0x0208('0x3e')](_0x314c57[_0x0208('0x32')],_0x11e1b7[_0x0208('0x34')]),_0x2c44da);if(_0x314c57['query'][_0x0208('0x3f')]){_0x41407b['where']=_[_0x0208('0x40')](_0x41407b[_0x0208('0x3d')],{'$or':_['map'](_0x2c44da,function(_0x586853){if(_0x586853[_0x0208('0x41')]!==_0x0208('0x42')){var _0xd172ff={};_0xd172ff[_0x586853[_0x0208('0x29')]]={'$like':'%'+_0x314c57[_0x0208('0x32')]['filter']+'%'};return _0xd172ff;}})});}_0x41407b=_['merge']({},_0x41407b,_0x314c57[_0x0208('0x43')]);var _0x153113={'where':_0x41407b[_0x0208('0x3d')]};return db[_0x0208('0x2d')][_0x0208('0x21')](_0x153113)[_0x0208('0x12')](function(_0x140cce){_0xaa808a['count']=_0x140cce;if(_0x314c57[_0x0208('0x32')][_0x0208('0x44')]){_0x41407b[_0x0208('0x45')]=[{'all':!![]}];}return db[_0x0208('0x2d')]['findAll'](_0x41407b);})[_0x0208('0x12')](function(_0x22613f){_0xaa808a[_0x0208('0x46')]=_0x22613f;return _0xaa808a;})[_0x0208('0x12')](respondWithFilteredResult(_0x221910,_0x41407b))[_0x0208('0x47')](handleError(_0x221910,null));};exports[_0x0208('0x48')]=function(_0xf7ce04,_0x2f7cc7){var _0x4d1a6f={'raw':!![],'where':{'id':_0xf7ce04[_0x0208('0x49')]['id']}},_0x39083c={};_0x39083c[_0x0208('0x31')]=_[_0x0208('0x33')](db[_0x0208('0x2d')][_0x0208('0x2e')]);_0x39083c['query']=_['keys'](_0xf7ce04[_0x0208('0x32')]);_0x39083c[_0x0208('0x34')]=_['intersection'](_0x39083c[_0x0208('0x31')],_0x39083c['query']);_0x4d1a6f[_0x0208('0x36')]=_[_0x0208('0x35')](_0x39083c['model'],qs[_0x0208('0x37')](_0xf7ce04[_0x0208('0x32')]['fields']));_0x4d1a6f[_0x0208('0x36')]=_0x4d1a6f[_0x0208('0x36')][_0x0208('0x38')]?_0x4d1a6f['attributes']:_0x39083c[_0x0208('0x31')];if(_0xf7ce04[_0x0208('0x32')]['includeAll']){_0x4d1a6f[_0x0208('0x45')]=[{'all':!![]}];}_0x4d1a6f=_[_0x0208('0x40')]({},_0x4d1a6f,_0xf7ce04['options']);return db[_0x0208('0x2d')][_0x0208('0x4a')](_0x4d1a6f)[_0x0208('0x12')](handleEntityNotFound(_0x2f7cc7,null))[_0x0208('0x12')](respondWithResult(_0x2f7cc7,null))[_0x0208('0x47')](handleError(_0x2f7cc7,null));};exports[_0x0208('0x25')]=function(_0x1d2717,_0x1fe3f9){if(_0x1d2717['body']['id']){delete _0x1d2717[_0x0208('0x4b')]['id'];}return db[_0x0208('0x2d')]['find']({'where':{'id':_0x1d2717[_0x0208('0x49')]['id']}})[_0x0208('0x12')](handleEntityNotFound(_0x1fe3f9,null))['then'](saveUpdates(_0x1d2717[_0x0208('0x4b')],null))['then'](respondWithResult(_0x1fe3f9,null))[_0x0208('0x47')](handleError(_0x1fe3f9,null));};exports[_0x0208('0x26')]=function(_0x2c6b30,_0x57fbd1){return db[_0x0208('0x2d')][_0x0208('0x4a')]({'where':{'id':_0x2c6b30[_0x0208('0x49')]['id']}})[_0x0208('0x12')](handleEntityNotFound(_0x57fbd1,null))[_0x0208('0x12')](removeEntity(_0x57fbd1,null))['catch'](handleError(_0x57fbd1,null));};exports[_0x0208('0x4c')]=function(_0xbdc118,_0x25fc6f){return db[_0x0208('0x2d')]['describe']()['then'](respondWithResult(_0x25fc6f,null))[_0x0208('0x47')](handleError(_0x25fc6f,null));};exports[_0x0208('0x4d')]=function(_0x111d5f,_0x4cdfb4){return db[_0x0208('0x2d')]['create'](_0x111d5f[_0x0208('0x4b')])[_0x0208('0x12')](function(_0x468881){if(_0x468881){if(_0x468881[_0x0208('0x4e')]===_0x0208('0x4f')&&!_0x468881[_0x0208('0x50')]){var _0x2c2b11,_0x2f3744,_0x565e04;if(_0x111d5f[_0x0208('0x4b')]['to']){_0x2f3744=_0x111d5f[_0x0208('0x4b')]['to'][_0x0208('0x51')](',')[0x0];}return db[_0x0208('0x52')]['findOne']({'where':{'id':_0x468881[_0x0208('0x53')]},'include':[{'model':db[_0x0208('0x54')],'as':_0x0208('0x55'),'include':[{'model':db[_0x0208('0x56')],'as':'Contacts','where':{'email':_0x2f3744},'limit':0x1,'order':[[_0x0208('0x57'),_0x0208('0x58')]]}]},{'model':db[_0x0208('0x59')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0208('0x5a')],'as':'CloudProvider','raw':!![]}]}]})[_0x0208('0x12')](function(_0x55f308){_0x2c2b11=_0x55f308;if(!_0x2c2b11||!_0x2c2b11[_0x0208('0x5b')])return;var _0x327be9=_0x2c2b11['getSmtpOptions']();if(_0x111d5f[_0x0208('0x4b')]['attachments']&&_0x111d5f['body']['attachments'][_0x0208('0x38')]){for(var _0x4d2e9a=0x0;_0x4d2e9a<_0x111d5f['body']['attachments'][_0x0208('0x38')];_0x4d2e9a+=0x1){_0x111d5f[_0x0208('0x4b')][_0x0208('0x5c')][_0x4d2e9a]={'filename':_0x111d5f[_0x0208('0x4b')][_0x0208('0x5c')][_0x4d2e9a][_0x0208('0x29')],'path':path[_0x0208('0x5d')](config[_0x0208('0x5e')],'server/files/attachments',_0x111d5f['body']['attachments'][_0x4d2e9a][_0x0208('0x5f')])};}}_0x565e04={'account':_0x327be9,'message':_0x111d5f['body']};return;})[_0x0208('0x12')](function(){if(_0x2c2b11['List']){if(_0x2c2b11[_0x0208('0x55')][_0x0208('0x60')][_0x0208('0x38')]){return _0x2c2b11[_0x0208('0x55')][_0x0208('0x60')][0x0];}else{return db[_0x0208('0x56')][_0x0208('0x4d')](_['defaults'](_0x111d5f[_0x0208('0x4b')],{'firstName':_0x111d5f[_0x0208('0x4b')]['to'],'email':_0x111d5f[_0x0208('0x4b')]['to'],'phone':_0x111d5f[_0x0208('0x4b')]['to'],'ListId':_0x2c2b11['ListId']}));}}else{throw new Error(_0x0208('0x61'));}})['then'](function(){if(_0x565e04){return respondWithRpcPromise(_0x0208('0x62'),_0x0208('0x63'),_0x565e04,client9003)[_0x0208('0x12')](function(_0x1365e9){return _0x468881[_0x0208('0x25')]({'read':!![],'messageId':_0x1365e9[_0x0208('0x64')],'sentAt':moment()[_0x0208('0x65')](_0x0208('0x66'))});})[_0x0208('0x47')](function(_0x5d257a){logger['error']('%s',JSON[_0x0208('0x18')](_0x5d257a));return _0x468881;});}return _0x468881;});}return _0x468881;}})[_0x0208('0x12')](respondWithResult(_0x4cdfb4,0xc9))[_0x0208('0x47')](handleError(_0x4cdfb4,null));};exports['accept']=function(_0x2b77b6,_0x3b6121){var _0x4d5637={'agent':{},'channel':'mail'};if(_0x2b77b6[_0x0208('0x4b')]['id']){delete _0x2b77b6['body']['id'];}_0x2b77b6['body'][_0x0208('0x67')]=!![];_0x2b77b6[_0x0208('0x4b')][_0x0208('0x68')]=moment()[_0x0208('0x65')](_0x0208('0x66'));_0x2b77b6[_0x0208('0x4b')][_0x0208('0x69')]=_0x2b77b6[_0x0208('0x4b')][_0x0208('0x69')]||_0x2b77b6['user']['id'];_0x4d5637[_0x0208('0x6a')]['id']=_0x2b77b6['body'][_0x0208('0x69')];return db[_0x0208('0x2d')]['find']({'where':{'id':_0x2b77b6[_0x0208('0x49')]['id'],'UserId':null}})[_0x0208('0x12')](handleEntityNotFound(_0x3b6121,null))['then'](saveUpdates(_0x2b77b6[_0x0208('0x4b')],null))[_0x0208('0x12')](function(_0x109969){if(_0x109969){_0x4d5637['message']=_0x109969[_0x0208('0x6b')]({'plain':!![]});return db['MailInteraction'][_0x0208('0x4a')]({'where':{'id':_0x109969['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3b6121,null))['then'](function(_0x41020f){if(_0x41020f){return _0x41020f[_0x0208('0x25')]({'UserId':_0x2b77b6[_0x0208('0x4b')][_0x0208('0x69')],'read1stAt':_[_0x0208('0x6c')](_0x41020f[_0x0208('0x6d')])?moment()[_0x0208('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2ac1d8){if(_0x2ac1d8){_0x4d5637[_0x0208('0x6e')]=_0x2ac1d8[_0x0208('0x6b')]({'plain':!![]});interaction_log['info'](_0x0208('0x6f'),_0x2b77b6[_0x0208('0x70')]['id'],_0x2b77b6['user'][_0x0208('0x29')],_0x2b77b6[_0x0208('0x70')]['role'],_0x4d5637[_0x0208('0x6e')]['id'],_0x2b77b6[_0x0208('0x4b')]?JSON['stringify'](_0x2b77b6[_0x0208('0x4b')]):_0x0208('0x71'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x4d5637);}return null;})[_0x0208('0x12')](function(_0x30d2d4){var _0x203cbe='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x30d2d4[_0x0208('0x1b')][_0x0208('0x72')];return db[_0x0208('0x73')][_0x0208('0x32')](_0x203cbe,{'type':db[_0x0208('0x74')][_0x0208('0x75')]['SELECT'],'raw':!![]})[_0x0208('0x12')](function(_0x2d2225){return _0x2d2225;});})['then'](function(_0xe68087){if(_0xe68087){_0x4d5637[_0x0208('0x1b')]['contact']=_0xe68087[0x0];if(!_0x2b77b6[_0x0208('0x4b')][_0x0208('0x69')])return;return db[_0x0208('0x76')][_0x0208('0x4a')]({'where':{'id':_0x2b77b6[_0x0208('0x4b')][_0x0208('0x69')],'role':_0x0208('0x6a')},'attributes':['id',_0x0208('0x29'),_0x0208('0x77'),_0x0208('0x78'),_0x0208('0x79')],'raw':!![]});}return null;})[_0x0208('0x12')](function(_0xb7e432){if(!_0xb7e432)return null;_0x4d5637[_0x0208('0x1b')][_0x0208('0x6a')]=_0xb7e432;return _0x4d5637;})['then'](function(_0x2139a6){if(_0x2139a6){if(_0x2b77b6[_0x0208('0x4b')][_0x0208('0x7a')]){_0x4d5637[_0x0208('0x1b')][_0x0208('0x7b')]=util[_0x0208('0x65')](_0x0208('0x7c'),_0x2b77b6[_0x0208('0x70')][_0x0208('0x29')]);_0x4d5637[_0x0208('0x1b')][_0x0208('0x7d')]=_0x4d5637['channel'];_0x4d5637[_0x0208('0x1b')][_0x0208('0x7e')]=_0x4d5637[_0x0208('0x7d')];_0x4d5637[_0x0208('0x1b')][_0x0208('0x7f')]=_0x0208('0x80');_0x4d5637['message'][_0x0208('0x4b')]=htmlToText['fromString'](_0x4d5637['message'][_0x0208('0x4b')]);return respondWithRpcPromise(_0x0208('0x81'),_0x0208('0x81'),{'event':'acceptmessage','message':_0x4d5637[_0x0208('0x1b')]},client9002)['then'](function(){return _0x4d5637;});}return _0x4d5637;}return null;})[_0x0208('0x12')](respondWithResult(_0x3b6121,null))['catch'](handleError(_0x3b6121,null));};exports[_0x0208('0x82')]=function(_0x3d5463,_0x195856){var _0x3b9bae={'agent':{},'channel':'mail'};if(_0x3d5463[_0x0208('0x4b')]['id']){delete _0x3d5463[_0x0208('0x4b')]['id'];}_0x3d5463[_0x0208('0x4b')][_0x0208('0x69')]=_0x3d5463[_0x0208('0x4b')][_0x0208('0x69')]||_0x3d5463[_0x0208('0x70')]['id'];_0x3b9bae['agent']['id']=_0x3d5463[_0x0208('0x4b')][_0x0208('0x69')];return db[_0x0208('0x2d')][_0x0208('0x4a')]({'where':{'id':_0x3d5463[_0x0208('0x49')]['id'],'UserId':null}})[_0x0208('0x12')](handleEntityNotFound(_0x195856,null))[_0x0208('0x12')](function(_0x46f6aa){if(_0x46f6aa){_0x3b9bae[_0x0208('0x1b')]=_0x46f6aa[_0x0208('0x6b')]({'plain':!![]});return db[_0x0208('0x83')][_0x0208('0x4a')]({'where':{'id':_0x46f6aa['MailInteractionId']}});}return null;})[_0x0208('0x12')](handleEntityNotFound(_0x195856,null))['then'](function(_0x20bea6){if(_0x20bea6){_0x3b9bae[_0x0208('0x6e')]=_0x20bea6[_0x0208('0x6b')]({'plain':!![]});interaction_log[_0x0208('0x13')](_0x0208('0x84'),_0x3d5463[_0x0208('0x70')]['id'],_0x3d5463[_0x0208('0x70')][_0x0208('0x29')],_0x3d5463[_0x0208('0x70')][_0x0208('0x85')],_0x3b9bae['interaction']['id'],_0x3d5463[_0x0208('0x4b')]?JSON['stringify'](_0x3d5463[_0x0208('0x4b')]):_0x0208('0x71'));return respondWithRpcPromise(_0x0208('0x86'),_0x0208('0x87'),_0x3b9bae);}return null;})[_0x0208('0x12')](function(_0x5b51db){var _0x1f838b=_0x0208('0x88')+_0x5b51db['message'][_0x0208('0x72')];return db[_0x0208('0x73')][_0x0208('0x32')](_0x1f838b,{'type':db['Sequelize'][_0x0208('0x75')]['SELECT'],'raw':!![]})[_0x0208('0x12')](function(_0x352f62){return _0x352f62;});})[_0x0208('0x12')](function(_0x19709a){if(_0x19709a){_0x3b9bae[_0x0208('0x1b')][_0x0208('0x89')]=_0x19709a[0x0];if(!_0x3d5463['body']['UserId'])return;return db['User'][_0x0208('0x4a')]({'where':{'id':_0x3d5463[_0x0208('0x4b')][_0x0208('0x69')],'role':'agent'},'attributes':['id',_0x0208('0x29'),'fullname',_0x0208('0x78'),_0x0208('0x79')],'raw':!![]});}return null;})[_0x0208('0x12')](function(_0x1e2539){if(!_0x1e2539)return null;_0x3b9bae[_0x0208('0x1b')][_0x0208('0x6a')]=_0x1e2539;return _0x3b9bae;})[_0x0208('0x12')](function(_0x1c9e0e){if(_0x1c9e0e){_0x1c9e0e[_0x0208('0x1b')][_0x0208('0x7b')]=util[_0x0208('0x65')]('SIP/%s',_0x3d5463[_0x0208('0x70')][_0x0208('0x29')]);_0x1c9e0e[_0x0208('0x1b')]['channel']=_0x3b9bae[_0x0208('0x7d')];_0x1c9e0e['message'][_0x0208('0x7e')]=_0x3b9bae['channel'];_0x1c9e0e['message'][_0x0208('0x7f')]='reject';_0x1c9e0e['message']['body']=htmlToText[_0x0208('0x8a')](_0x3b9bae[_0x0208('0x1b')][_0x0208('0x4b')]);respondWithRpcPromise(_0x0208('0x81'),'EventManager',{'event':_0x0208('0x8b'),'message':_0x1c9e0e[_0x0208('0x1b')]},client9002);return _0x3b9bae;}return null;})[_0x0208('0x12')](respondWithResult(_0x195856,null))['catch'](handleError(_0x195856,null));};exports[_0x0208('0x8c')]=function(_0x2fc497,_0x2dd756){var _0x3cbb5e=moment()['unix']()[_0x0208('0x8d')]();var _0xd9d88f=path[_0x0208('0x5d')](config['root'],_0x0208('0x8e'),'files','tmp');var _0x3ecf14=path['join'](config[_0x0208('0x5e')],_0x0208('0x8e'),_0x0208('0x8f'),_0x0208('0x5c'));var _0x85e7a=util[_0x0208('0x65')](_0x0208('0x90'),_0x3cbb5e);return db[_0x0208('0x2d')]['find']({'where':{'id':_0x2fc497[_0x0208('0x49')]['id']},'attributes':['id',_0x0208('0x4b'),_0x0208('0x91'),'to','cc',_0x0208('0x92'),_0x0208('0x93'),_0x0208('0x94')],'include':_0x2fc497[_0x0208('0x32')][_0x0208('0x5c')]?[{'model':db[_0x0208('0x95')],'as':_0x0208('0x96')}]:undefined})[_0x0208('0x12')](handleEntityNotFound(_0x2dd756,null))[_0x0208('0x12')](function(_0x3873d5){if(_0x3873d5){var _0x3697db=_0x3873d5;var _0x219690={'from':_0x3697db[_0x0208('0x91')],'to':_0x3697db['to'],'subject':_0x3697db[_0x0208('0x93')],'html':htmlEntities[_0x0208('0x97')](_0x3697db[_0x0208('0x4b')]),'headers':{'Date':moment(_0x3697db['createdAt'])[_0x0208('0x65')](_0x0208('0x98'))},'attachments':[]};if(_0x3873d5['cc']){_0x219690[_0x0208('0x99')]['Cc']=_0x3873d5['cc'];}if(_0x3873d5[_0x0208('0x92')]){_0x219690[_0x0208('0x99')]['Bcc']=_0x3873d5[_0x0208('0x92')];}return new BPromise(function(_0x323c8f,_0xcb2a32){if(_0x3873d5['Attachments']){for(var _0x28fda6=0x0;_0x28fda6<_0x3873d5[_0x0208('0x96')][_0x0208('0x38')];_0x28fda6++){var _0x4a1141=_0x3873d5['Attachments'][_0x28fda6];var _0x4707c6=path[_0x0208('0x5d')](_0x3ecf14,_0x4a1141[_0x0208('0x5f')]);if(fs[_0x0208('0x9a')](_0x4707c6)){_0x219690[_0x0208('0x5c')]['push']({'name':_0x4a1141[_0x0208('0x29')],'contentType':_0x4a1141[_0x0208('0x41')],'data':fs[_0x0208('0x9b')](_0x4707c6)});}}}emlformat[_0x0208('0x9c')](_0x219690,function(_0x32342f,_0x375fe6){if(_0x32342f)return _0xcb2a32(_0x32342f);fs[_0x0208('0x9d')](path[_0x0208('0x5d')](_0xd9d88f,_0x85e7a),_0x375fe6);return _0x323c8f(_0x375fe6);});});}})[_0x0208('0x12')](function(_0x45e403){if(_0x45e403){return _0x2dd756['download'](path[_0x0208('0x5d')](_0xd9d88f,_0x85e7a),_0x85e7a,function(_0x58b304){if(!_0x58b304)fs['unlinkSync'](path[_0x0208('0x5d')](_0xd9d88f,_0x85e7a));});}})[_0x0208('0x47')](handleError(_0x2dd756,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index c976b7f..3c161ae 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 _0x4b8a=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','update','remove'];(function(_0x2dad55,_0xcd6eca){var _0x5a74ce=function(_0x42ce3f){while(--_0x42ce3f){_0x2dad55['push'](_0x2dad55['shift']());}};_0x5a74ce(++_0xcd6eca);}(_0x4b8a,0xdc));var _0xa4b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b8a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa4b8('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xa4b8('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa4b8('0x2'),'afterDestroy':_0xa4b8('0x3')};function emitEvent(_0x1e0d41){return function(_0x2578cd,_0x13bb97,_0x51933e){MailMessageEvents[_0xa4b8('0x4')](_0x1e0d41+':'+_0x2578cd['id'],_0x2578cd);MailMessageEvents[_0xa4b8('0x4')](_0x1e0d41,_0x2578cd);_0x51933e(null);};}for(var e in events){if(events[_0xa4b8('0x5')](e)){var event=events[e];MailMessage[_0xa4b8('0x6')](e,emitEvent(event));}}module[_0xa4b8('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x3af4=['exports','MailMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x3af4,0xe9));var _0x43af=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x3af4[_0x5a3cf0];return _0x5a64ee;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x43af('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x43af('0x1')](0x0);var events={'afterCreate':_0x43af('0x2'),'afterUpdate':_0x43af('0x3'),'afterDestroy':_0x43af('0x4')};function emitEvent(_0x2b73a0){return function(_0x56981a,_0x14aab8,_0x300f6d){MailMessageEvents[_0x43af('0x5')](_0x2b73a0+':'+_0x56981a['id'],_0x56981a);MailMessageEvents['emit'](_0x2b73a0,_0x56981a);_0x300f6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x43af('0x6')](e,emitEvent(event));}}module[_0x43af('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 d2d65c8..c3f7461 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 _0x0bd8=['UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','../../config/environment','exports','define','messageId','fti_mail_messages','plainBody','body','fromString','get','direction','toLowerCase','secret','isNil'];(function(_0x6cf622,_0x146e67){var _0x1887fe=function(_0xe16cbd){while(--_0xe16cbd){_0x6cf622['push'](_0x6cf622['shift']());}};_0x1887fe(++_0x146e67);}(_0x0bd8,0x82));var _0x80bd=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0x0bd8[_0x1f7996];return _0x584609;};'use strict';var _=require(_0x80bd('0x0'));var util=require(_0x80bd('0x1'));var logger=require(_0x80bd('0x2'))(_0x80bd('0x3'));var moment=require(_0x80bd('0x4'));var BPromise=require('bluebird');var rp=require(_0x80bd('0x5'));var htmlToText=require(_0x80bd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x80bd('0x7'));var attributes=require('./mailMessage.attributes');module[_0x80bd('0x8')]=function(_0x5ed503,_0x2291e8){return _0x5ed503[_0x80bd('0x9')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x80bd('0xa'),'fields':[_0x80bd('0xa')]},{'name':_0x80bd('0xb'),'fields':[_0x80bd('0xc'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x309f0b,_0x458389,_0x11d820){if(_0x309f0b[_0x80bd('0xd')]){_0x309f0b[_0x80bd('0xc')]=htmlToText[_0x80bd('0xe')](_0x309f0b[_0x80bd('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x11d820(null,_0x458389);},'afterCreate':function(_0x1a2c25,_0x533747,_0x4fda29){var _0x39bc33=_0x5ed503['models'];var _0x4d86a=_0x1a2c25[_0x80bd('0xf')]({'plain':!![]});if(_0x4d86a[_0x80bd('0x10')][_0x80bd('0x11')]()==='in'||_0x4d86a['direction'][_0x80bd('0x11')]()==='out'&&!_0x4d86a[_0x80bd('0x12')]&&!_[_0x80bd('0x13')](_0x4d86a[_0x80bd('0x14')])){_0x39bc33[_0x80bd('0x15')][_0x80bd('0x16')]({'where':{'id':_0x4d86a[_0x80bd('0x17')]}})[_0x80bd('0x18')](function(_0x4d27f0){if(_0x4d27f0){_0x4d27f0[_0x80bd('0x19')]({'lastMsgAt':_0x4d86a[_0x80bd('0x1a')],'lastMsgDirection':_0x4d86a['direction'][_0x80bd('0x11')]()});}})['catch'](function(_0x2b6b87){console[_0x80bd('0x1b')](_0x2b6b87);});}_0x4fda29();}},'charset':_0x80bd('0x1c'),'collate':_0x80bd('0x1d')});}; \ No newline at end of file +var _0xe61b=['./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','../../config/environment'];(function(_0x17d40b,_0x3d7dc1){var _0x2ae7f7=function(_0x58fa94){while(--_0x58fa94){_0x17d40b['push'](_0x17d40b['shift']());}};_0x2ae7f7(++_0x3d7dc1);}(_0xe61b,0xa0));var _0xbe61=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0xe61b[_0x22dac7];return _0x3e6cfa;};'use strict';var _=require(_0xbe61('0x0'));var util=require(_0xbe61('0x1'));var logger=require(_0xbe61('0x2'))(_0xbe61('0x3'));var moment=require(_0xbe61('0x4'));var BPromise=require(_0xbe61('0x5'));var rp=require(_0xbe61('0x6'));var htmlToText=require(_0xbe61('0x7'));var fs=require('fs');var path=require(_0xbe61('0x8'));var rimraf=require('rimraf');var config=require(_0xbe61('0x9'));var attributes=require(_0xbe61('0xa'));module[_0xbe61('0xb')]=function(_0x5ba033,_0x4a3871){return _0x5ba033[_0xbe61('0xc')](_0xbe61('0xd'),attributes,{'tableName':_0xbe61('0xe'),'paranoid':![],'indexes':[{'name':_0xbe61('0xf'),'fields':['messageId']},{'name':_0xbe61('0x10'),'fields':['plainBody',_0xbe61('0x11')],'type':_0xbe61('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4955c0,_0x4243a9,_0x57b938){if(_0x4955c0[_0xbe61('0x13')]){_0x4955c0['plainBody']=htmlToText['fromString'](_0x4955c0['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x57b938(null,_0x4243a9);},'afterCreate':function(_0x531115,_0x1ab99c,_0x33b14f){var _0x59414c=_0x5ba033['models'];var _0x38ca45=_0x531115[_0xbe61('0x14')]({'plain':!![]});if(_0x38ca45[_0xbe61('0x15')][_0xbe61('0x16')]()==='in'||_0x38ca45[_0xbe61('0x15')][_0xbe61('0x16')]()===_0xbe61('0x17')&&!_0x38ca45[_0xbe61('0x18')]&&!_[_0xbe61('0x19')](_0x38ca45['UserId'])){_0x59414c[_0xbe61('0x1a')][_0xbe61('0x1b')]({'where':{'id':_0x38ca45[_0xbe61('0x1c')]}})[_0xbe61('0x1d')](function(_0x466550){if(_0x466550){_0x466550['update']({'lastMsgAt':_0x38ca45[_0xbe61('0x1e')],'lastMsgDirection':_0x38ca45[_0xbe61('0x15')][_0xbe61('0x16')]()});}})['catch'](function(_0x3003c1){console[_0xbe61('0x1f')](_0x3003c1);});}_0x33b14f();}},'charset':_0xbe61('0x20'),'collate':_0xbe61('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 1acb629..dcd2559 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 _0xaebd=['MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage','create','body','options','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailMessage.socket','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x45d937,_0x9cb187){_0x45d937=_0x45d937-0x0;var _0x115bf8=_0xaebd[_0x45d937];return _0x115bf8;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});config[_0xdaeb('0xb')]=_[_0xdaeb('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdaeb('0xd'))(new Redis(config[_0xdaeb('0xb')]));require(_0xdaeb('0xe'))['register'](socket);function respondWithRpcPromise(_0xbb4b72,_0x494d42,_0x3e83f3){return new BPromise(function(_0x4ba89d,_0x2218d6){return client['request'](_0xbb4b72,_0x3e83f3)[_0xdaeb('0xf')](function(_0x3f0e95){logger['info']('MailMessage,\x20%s,\x20%s',_0x494d42,_0xdaeb('0x10'));logger['debug'](_0xdaeb('0x11'),_0x494d42,_0xdaeb('0x10'),JSON[_0xdaeb('0x12')](_0x3f0e95));if(_0x3f0e95[_0xdaeb('0x13')]){if(_0x3f0e95[_0xdaeb('0x13')][_0xdaeb('0x14')]===0x1f4){logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x3f0e95['error'][_0xdaeb('0x15')]);return _0x2218d6(_0x3f0e95[_0xdaeb('0x13')][_0xdaeb('0x15')]);}logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x3f0e95['error'][_0xdaeb('0x15')]);return _0x4ba89d(_0x3f0e95['error']['message']);}else{logger[_0xdaeb('0x16')](_0xdaeb('0x17'),_0x494d42,_0xdaeb('0x10'));_0x4ba89d(_0x3f0e95[_0xdaeb('0x18')][_0xdaeb('0x15')]);}})[_0xdaeb('0x19')](function(_0x501f77){logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x501f77);_0x2218d6(_0x501f77);});});}exports[_0xdaeb('0x1a')]=function(_0x13b3f2){var _0x18bd81=this;return new Promise(function(_0x5360ce,_0x4e97e0){return db[_0xdaeb('0x1b')][_0xdaeb('0x1c')](_0x13b3f2[_0xdaeb('0x1d')],{'raw':_0x13b3f2[_0xdaeb('0x1e')]?_0x13b3f2[_0xdaeb('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2c969d){logger[_0xdaeb('0x16')](_0xdaeb('0x1a'),_0x13b3f2);logger[_0xdaeb('0x1f')](_0xdaeb('0x1a'),_0x13b3f2,JSON['stringify'](_0x2c969d));_0x5360ce(_0x2c969d);})[_0xdaeb('0x19')](function(_0x4dc25f){logger[_0xdaeb('0x13')](_0xdaeb('0x1a'),_0x4dc25f[_0xdaeb('0x15')],_0x13b3f2);_0x4e97e0(_0x18bd81[_0xdaeb('0x13')](0x1f4,_0x4dc25f[_0xdaeb('0x15')]));});});}; \ No newline at end of file +var _0x0120=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0120,0x6f));var _0x0012=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0120[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0012('0xc')](config[_0x0012('0xd')],{'host':_0x0012('0xe'),'port':0x18eb});var socket=require(_0x0012('0xf'))(new Redis(config[_0x0012('0xd')]));require('./mailMessage.socket')[_0x0012('0x10')](socket);function respondWithRpcPromise(_0x2d484c,_0x1dc1b2,_0x323282){return new BPromise(function(_0x520171,_0x2d4674){return client['request'](_0x2d484c,_0x323282)[_0x0012('0x11')](function(_0x1d1c02){logger[_0x0012('0x12')](_0x0012('0x13'),_0x1dc1b2,_0x0012('0x14'));logger['debug'](_0x0012('0x15'),_0x1dc1b2,'request\x20sent',JSON['stringify'](_0x1d1c02));if(_0x1d1c02['error']){if(_0x1d1c02['error'][_0x0012('0x16')]===0x1f4){logger['error'](_0x0012('0x13'),_0x1dc1b2,_0x1d1c02[_0x0012('0x17')]['message']);return _0x2d4674(_0x1d1c02[_0x0012('0x17')][_0x0012('0x18')]);}logger[_0x0012('0x17')](_0x0012('0x13'),_0x1dc1b2,_0x1d1c02['error']['message']);return _0x520171(_0x1d1c02[_0x0012('0x17')][_0x0012('0x18')]);}else{logger[_0x0012('0x12')](_0x0012('0x13'),_0x1dc1b2,_0x0012('0x14'));_0x520171(_0x1d1c02[_0x0012('0x19')][_0x0012('0x18')]);}})[_0x0012('0x1a')](function(_0x5b236f){logger[_0x0012('0x17')](_0x0012('0x13'),_0x1dc1b2,_0x5b236f);_0x2d4674(_0x5b236f);});});}exports['CreateMailMessage']=function(_0x45d00b){var _0x1f54fc=this;return new Promise(function(_0xa2e623,_0x2c837e){return db['MailMessage']['create'](_0x45d00b[_0x0012('0x1b')],{'raw':_0x45d00b[_0x0012('0x1c')]?_0x45d00b[_0x0012('0x1c')][_0x0012('0x1d')]===undefined?!![]:![]:!![]})[_0x0012('0x11')](function(_0x2e6a2c){logger[_0x0012('0x12')](_0x0012('0x1e'),_0x45d00b);logger['debug'](_0x0012('0x1e'),_0x45d00b,JSON[_0x0012('0x1f')](_0x2e6a2c));_0xa2e623(_0x2e6a2c);})['catch'](function(_0x36cf42){logger[_0x0012('0x17')](_0x0012('0x1e'),_0x36cf42[_0x0012('0x18')],_0x45d00b);_0x2c837e(_0x1f54fc[_0x0012('0x17')](0x1f4,_0x36cf42['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 9752dd8..f07c8f2 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 _0x1666=['emit','removeListener','length','./mailMessage.events','save','update'];(function(_0x358da6,_0x1093cb){var _0x5e9964=function(_0x398a5f){while(--_0x398a5f){_0x358da6['push'](_0x358da6['shift']());}};_0x5e9964(++_0x1093cb);}(_0x1666,0x75));var _0x6166=function(_0x1716bc,_0x301032){_0x1716bc=_0x1716bc-0x0;var _0x3c926f=_0x1666[_0x1716bc];return _0x3c926f;};'use strict';var MailMessageEvents=require(_0x6166('0x0'));var events=[_0x6166('0x1'),'remove',_0x6166('0x2')];function createListener(_0x2aab7c,_0x309080){return function(_0x3284b6){_0x309080[_0x6166('0x3')](_0x2aab7c,_0x3284b6);};}function removeListener(_0x15afdd,_0x597cf2){return function(){MailMessageEvents[_0x6166('0x4')](_0x15afdd,_0x597cf2);};}exports['register']=function(_0x2ee359){for(var _0x1d4f2a=0x0,_0x211a92=events[_0x6166('0x5')];_0x1d4f2a<_0x211a92;_0x1d4f2a++){var _0x3a29ca=events[_0x1d4f2a];var _0x4873da=createListener('mailMessage:'+_0x3a29ca,_0x2ee359);MailMessageEvents['on'](_0x3a29ca,_0x4873da);}}; \ No newline at end of file +var _0x5cad=['emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5cad,0x8c));var _0xd5ca=function(_0x157c61,_0x30bd32){_0x157c61=_0x157c61-0x0;var _0x2da230=_0x5cad[_0x157c61];return _0x2da230;};'use strict';var MailMessageEvents=require(_0xd5ca('0x0'));var events=[_0xd5ca('0x1'),_0xd5ca('0x2'),_0xd5ca('0x3')];function createListener(_0x104a70,_0x451fb7){return function(_0xf7b122){_0x451fb7[_0xd5ca('0x4')](_0x104a70,_0xf7b122);};}function removeListener(_0x1cb9de,_0x1eb4a5){return function(){MailMessageEvents[_0xd5ca('0x5')](_0x1cb9de,_0x1eb4a5);};}exports[_0xd5ca('0x6')]=function(_0x2c8582){for(var _0x462093=0x0,_0x33574c=events[_0xd5ca('0x7')];_0x462093<_0x33574c;_0x462093++){var _0x9cc275=events[_0x462093];var _0x1aa01e=createListener(_0xd5ca('0x8')+_0x9cc275,_0x2c8582);MailMessageEvents['on'](_0x9cc275,_0x1aa01e);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 9e025e2..e7b9209 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 _0x7f56=['delete','destroy','removeTeams','/:id/users','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','post','/:id/teams','addAgents'];(function(_0x3aac36,_0x287fe1){var _0x519fe0=function(_0x1da7de){while(--_0x1da7de){_0x3aac36['push'](_0x3aac36['shift']());}};_0x519fe0(++_0x287fe1);}(_0x7f56,0x164));var _0x67f5=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0x7f56[_0x4cfa2e];return _0x279b50;};'use strict';var multer=require('multer');var util=require(_0x67f5('0x0'));var path=require(_0x67f5('0x1'));var timeout=require(_0x67f5('0x2'));var express=require(_0x67f5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x67f5('0x4'));var interaction=require(_0x67f5('0x5'));var config=require('../../config/environment');var controller=require(_0x67f5('0x6'));router[_0x67f5('0x7')]('/',auth[_0x67f5('0x8')](),controller[_0x67f5('0x9')]);router['get'](_0x67f5('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x67f5('0x7')](_0x67f5('0xb'),auth[_0x67f5('0x8')](),controller[_0x67f5('0xc')]);router[_0x67f5('0x7')](_0x67f5('0xd'),auth['isAuthenticated'](),controller[_0x67f5('0xe')]);router[_0x67f5('0x7')]('/:id/teams',auth[_0x67f5('0x8')](),controller[_0x67f5('0xf')]);router[_0x67f5('0x7')]('/:id/users',auth[_0x67f5('0x8')](),controller['getAgents']);router['post']('/',auth[_0x67f5('0x8')](),controller['create']);router[_0x67f5('0x10')](_0x67f5('0x11'),auth[_0x67f5('0x8')](),controller['addTeams']);router['post']('/:id/users',auth[_0x67f5('0x8')](),controller[_0x67f5('0x12')]);router['put'](_0x67f5('0xb'),auth[_0x67f5('0x8')](),controller['update']);router[_0x67f5('0x13')]('/:id',auth[_0x67f5('0x8')](),controller[_0x67f5('0x14')]);router['delete'](_0x67f5('0x11'),auth['isAuthenticated'](),controller[_0x67f5('0x15')]);router['delete'](_0x67f5('0x16'),auth['isAuthenticated'](),controller[_0x67f5('0x17')]);module[_0x67f5('0x18')]=router; \ No newline at end of file +var _0xf45b=['post','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents'];(function(_0xb6298b,_0x2631cc){var _0x3239d9=function(_0x1dd401){while(--_0x1dd401){_0xb6298b['push'](_0xb6298b['shift']());}};_0x3239d9(++_0x2631cc);}(_0xf45b,0x191));var _0xbf45=function(_0x294726,_0x5db9e9){_0x294726=_0x294726-0x0;var _0x39e2e3=_0xf45b[_0x294726];return _0x39e2e3;};'use strict';var multer=require('multer');var util=require(_0xbf45('0x0'));var path=require(_0xbf45('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf45('0x2'));var router=express[_0xbf45('0x3')]();var fs_extra=require(_0xbf45('0x4'));var auth=require(_0xbf45('0x5'));var interaction=require(_0xbf45('0x6'));var config=require('../../config/environment');var controller=require(_0xbf45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbf45('0x8')]);router[_0xbf45('0x9')](_0xbf45('0xa'),auth[_0xbf45('0xb')](),controller[_0xbf45('0xc')]);router[_0xbf45('0x9')](_0xbf45('0xd'),auth[_0xbf45('0xb')](),controller[_0xbf45('0xe')]);router[_0xbf45('0x9')]('/:id/members',auth[_0xbf45('0xb')](),controller[_0xbf45('0xf')]);router[_0xbf45('0x9')](_0xbf45('0x10'),auth[_0xbf45('0xb')](),controller['getTeams']);router[_0xbf45('0x9')](_0xbf45('0x11'),auth['isAuthenticated'](),controller[_0xbf45('0x12')]);router[_0xbf45('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf45('0x13')](_0xbf45('0x10'),auth[_0xbf45('0xb')](),controller[_0xbf45('0x14')]);router['post'](_0xbf45('0x11'),auth[_0xbf45('0xb')](),controller[_0xbf45('0x15')]);router[_0xbf45('0x16')](_0xbf45('0xd'),auth[_0xbf45('0xb')](),controller[_0xbf45('0x17')]);router[_0xbf45('0x18')]('/:id',auth[_0xbf45('0xb')](),controller[_0xbf45('0x19')]);router['delete']('/:id/teams',auth[_0xbf45('0xb')](),controller['removeTeams']);router[_0xbf45('0x18')]('/:id/users',auth[_0xbf45('0xb')](),controller[_0xbf45('0x1a')]);module[_0xbf45('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 521094f..480fdda 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 _0xa55f=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x4afe33,_0x1fa632){var _0x187951=function(_0x13e56d){while(--_0x13e56d){_0x4afe33['push'](_0x4afe33['shift']());}};_0x187951(++_0x1fa632);}(_0xa55f,0x134));var _0xfa55=function(_0x1eaefc,_0x398dac){_0x1eaefc=_0x1eaefc-0x0;var _0x5a734d=_0xa55f[_0x1eaefc];return _0x5a734d;};'use strict';var Sequelize=require(_0xfa55('0x0'));module[_0xfa55('0x1')]={'name':{'type':Sequelize[_0xfa55('0x2')],'unique':_0xfa55('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfa55('0x2')]},'timeout':{'type':Sequelize[_0xfa55('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa55('0x5')](_0xfa55('0x6'),_0xfa55('0x7'),_0xfa55('0x8'))}}; \ No newline at end of file +var _0x9b29=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x502773,_0xe55d92){var _0x568f34=function(_0x44a7f9){while(--_0x44a7f9){_0x502773['push'](_0x502773['shift']());}};_0x568f34(++_0xe55d92);}(_0x9b29,0x17c));var _0x99b2=function(_0x547839,_0x6ccef8){_0x547839=_0x547839-0x0;var _0x2904f=_0x9b29[_0x547839];return _0x2904f;};'use strict';var Sequelize=require(_0x99b2('0x0'));module[_0x99b2('0x1')]={'name':{'type':Sequelize[_0x99b2('0x2')],'unique':_0x99b2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x99b2('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x99b2('0x4')](_0x99b2('0x5'),_0x99b2('0x6'),_0x99b2('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 2dc3136..91ea398 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 _0xb63f=['findOrCreate','forEach','emit','removeTeams','select','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','addAgents','omit','spread','userMailQueue:save','removeAgents','userMailQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','MailQueues','UserProfileResource','destroy','end','sendStatus','error','stack','name','index','MailQueue','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','nolimit','order','MailQueueId','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','rawAttributes','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xb63f,0xa3));var _0xfb63=function(_0x2a6754,_0x277259){_0x2a6754=_0x2a6754-0x0;var _0x17feda=_0xb63f[_0x2a6754];return _0x17feda;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb63('0x0'));var jsonpatch=require(_0xfb63('0x1'));var rp=require(_0xfb63('0x2'));var moment=require(_0xfb63('0x3'));var BPromise=require(_0xfb63('0x4'));var Mustache=require(_0xfb63('0x5'));var util=require(_0xfb63('0x6'));var path=require(_0xfb63('0x7'));var sox=require(_0xfb63('0x8'));var csv=require('to-csv');var ejs=require(_0xfb63('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb63('0xa'));var squel=require(_0xfb63('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb63('0xc'));var querystring=require(_0xfb63('0xd'));var Papa=require(_0xfb63('0xe'));var Redis=require('ioredis');var authService=require(_0xfb63('0xf'));var qs=require(_0xfb63('0x10'));var as=require(_0xfb63('0x11'));var hardwareService=require(_0xfb63('0x12'));var logger=require(_0xfb63('0x13'))(_0xfb63('0x14'));var utils=require(_0xfb63('0x15'));var config=require(_0xfb63('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfb63('0x17')]=_[_0xfb63('0x18')](config[_0xfb63('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb63('0x19'))(new Redis(config[_0xfb63('0x17')]));require('./mailQueue.socket')[_0xfb63('0x1a')](socket);function respondWithStatusCode(_0x377d1e,_0x3a4fb8){_0x3a4fb8=_0x3a4fb8||0xcc;return function(_0x1b3d4d){if(_0x1b3d4d){return _0x377d1e['sendStatus'](_0x3a4fb8);}return _0x377d1e[_0xfb63('0x1b')](_0x3a4fb8)['end']();};}function respondWithResult(_0x19f196,_0x24cd53){_0x24cd53=_0x24cd53||0xc8;return function(_0x2a3ddd){if(_0x2a3ddd){return _0x19f196[_0xfb63('0x1b')](_0x24cd53)[_0xfb63('0x1c')](_0x2a3ddd);}};}function respondWithFilteredResult(_0x49081d,_0x2ac69a){return function(_0x5dfd32){if(_0x5dfd32){var _0x43a9ad=typeof _0x2ac69a['offset']===_0xfb63('0x1d')&&typeof _0x2ac69a[_0xfb63('0x1e')]===_0xfb63('0x1d');var _0x452f1e=_0x5dfd32['count'];var _0x3fb8f9=_0x43a9ad?0x0:_0x2ac69a['offset'];var _0x26d109=_0x43a9ad?_0x5dfd32[_0xfb63('0x1f')]:_0x2ac69a['offset']+_0x2ac69a[_0xfb63('0x1e')];var _0x23c4fb;if(_0x26d109>=_0x452f1e){_0x26d109=_0x452f1e;_0x23c4fb=0xc8;}else{_0x23c4fb=0xce;}_0x49081d['status'](_0x23c4fb);return _0x49081d[_0xfb63('0x20')](_0xfb63('0x21'),_0x3fb8f9+'-'+_0x26d109+'/'+_0x452f1e)[_0xfb63('0x1c')](_0x5dfd32);}return null;};}function patchUpdates(_0x34e22c){return function(_0x32f813){try{jsonpatch[_0xfb63('0x22')](_0x32f813,_0x34e22c,!![]);}catch(_0x17f81e){return BPromise[_0xfb63('0x23')](_0x17f81e);}return _0x32f813[_0xfb63('0x24')]();};}function saveUpdates(_0xa7612f,_0x3d21b5){return function(_0x1e5bd7){if(_0x1e5bd7){return _0x1e5bd7[_0xfb63('0x25')](_0xa7612f)[_0xfb63('0x26')](function(_0x26036d){return _0x26036d;});}return null;};}function removeEntity(_0x19ea95,_0x1b8f0a){return function(_0x443dbd){if(_0x443dbd){return _0x443dbd['destroy']()[_0xfb63('0x26')](function(){var _0x4c80c1=_0x443dbd['get']({'plain':!![]});var _0x2035d2=_0xfb63('0x27');return db[_0xfb63('0x28')][_0xfb63('0x29')]({'where':{'type':_0x2035d2,'resourceId':_0x4c80c1['id']}})[_0xfb63('0x26')](function(){return _0x443dbd;});})[_0xfb63('0x26')](function(){_0x19ea95['status'](0xcc)[_0xfb63('0x2a')]();});}};}function handleEntityNotFound(_0x2a008e,_0x441dd7){return function(_0x188501){if(!_0x188501){_0x2a008e[_0xfb63('0x2b')](0x194);}return _0x188501;};}function handleError(_0x30ea17,_0xa8d6af){_0xa8d6af=_0xa8d6af||0x1f4;return function(_0xc20ddf){logger[_0xfb63('0x2c')](_0xc20ddf[_0xfb63('0x2d')]);if(_0xc20ddf[_0xfb63('0x2e')]){delete _0xc20ddf['name'];}_0x30ea17[_0xfb63('0x1b')](_0xa8d6af)['send'](_0xc20ddf);};}exports[_0xfb63('0x2f')]=function(_0xa9512b,_0x379936){var _0x4e0446={},_0x58f4fe={},_0x25d887={'count':0x0,'rows':[]};var _0x4e00d4=_['map'](db[_0xfb63('0x30')]['rawAttributes'],function(_0xdb158f){return{'name':_0xdb158f[_0xfb63('0x31')],'type':_0xdb158f[_0xfb63('0x32')][_0xfb63('0x33')]};});_0x58f4fe[_0xfb63('0x34')]=_[_0xfb63('0x35')](_0x4e00d4,_0xfb63('0x2e'));_0x58f4fe[_0xfb63('0x36')]=_['keys'](_0xa9512b['query']);_0x58f4fe[_0xfb63('0x37')]=_['intersection'](_0x58f4fe[_0xfb63('0x34')],_0x58f4fe[_0xfb63('0x36')]);_0x4e0446[_0xfb63('0x38')]=_[_0xfb63('0x39')](_0x58f4fe[_0xfb63('0x34')],qs['fields'](_0xa9512b['query'][_0xfb63('0x3a')]));_0x4e0446[_0xfb63('0x38')]=_0x4e0446['attributes']['length']?_0x4e0446['attributes']:_0x58f4fe[_0xfb63('0x34')];if(!_0xa9512b[_0xfb63('0x36')][_0xfb63('0x3b')]('nolimit')){_0x4e0446[_0xfb63('0x1e')]=qs[_0xfb63('0x1e')](_0xa9512b[_0xfb63('0x36')][_0xfb63('0x1e')]);_0x4e0446[_0xfb63('0x3c')]=qs[_0xfb63('0x3c')](_0xa9512b[_0xfb63('0x36')]['offset']);}_0x4e0446['order']=qs[_0xfb63('0x3d')](_0xa9512b['query'][_0xfb63('0x3d')]);_0x4e0446[_0xfb63('0x3e')]=qs[_0xfb63('0x37')](_[_0xfb63('0x3f')](_0xa9512b[_0xfb63('0x36')],_0x58f4fe[_0xfb63('0x37')]),_0x4e00d4);if(_0xa9512b[_0xfb63('0x36')][_0xfb63('0x40')]){_0x4e0446[_0xfb63('0x3e')]=_[_0xfb63('0x41')](_0x4e0446[_0xfb63('0x3e')],{'$or':_[_0xfb63('0x35')](_0x4e00d4,function(_0x1417a4){if(_0x1417a4[_0xfb63('0x32')]!==_0xfb63('0x42')){var _0x233cd5={};_0x233cd5[_0x1417a4[_0xfb63('0x2e')]]={'$like':'%'+_0xa9512b[_0xfb63('0x36')][_0xfb63('0x40')]+'%'};return _0x233cd5;}})});}_0x4e0446=_[_0xfb63('0x41')]({},_0x4e0446,_0xa9512b[_0xfb63('0x43')]);var _0x480f7f={'where':_0x4e0446['where']};return db[_0xfb63('0x30')]['count'](_0x480f7f)[_0xfb63('0x26')](function(_0x1fc68b){_0x25d887[_0xfb63('0x1f')]=_0x1fc68b;if(_0xa9512b[_0xfb63('0x36')][_0xfb63('0x44')]){_0x4e0446[_0xfb63('0x45')]=[{'all':!![]}];}return db[_0xfb63('0x30')][_0xfb63('0x46')](_0x4e0446);})[_0xfb63('0x26')](function(_0x9db24f){_0x25d887[_0xfb63('0x47')]=_0x9db24f;return _0x25d887;})[_0xfb63('0x26')](respondWithFilteredResult(_0x379936,_0x4e0446))['catch'](handleError(_0x379936,null));};exports[_0xfb63('0x48')]=function(_0x1125e9,_0x3d0b61){var _0x18501d={'raw':!![],'where':{'id':_0x1125e9[_0xfb63('0x49')]['id']}},_0xe5f57={};_0xe5f57[_0xfb63('0x34')]=_[_0xfb63('0x4a')](db[_0xfb63('0x30')]['rawAttributes']);_0xe5f57[_0xfb63('0x36')]=_[_0xfb63('0x4a')](_0x1125e9[_0xfb63('0x36')]);_0xe5f57[_0xfb63('0x37')]=_[_0xfb63('0x39')](_0xe5f57[_0xfb63('0x34')],_0xe5f57['query']);_0x18501d[_0xfb63('0x38')]=_[_0xfb63('0x39')](_0xe5f57[_0xfb63('0x34')],qs[_0xfb63('0x3a')](_0x1125e9[_0xfb63('0x36')][_0xfb63('0x3a')]));_0x18501d[_0xfb63('0x38')]=_0x18501d[_0xfb63('0x38')][_0xfb63('0x4b')]?_0x18501d['attributes']:_0xe5f57[_0xfb63('0x34')];if(_0x1125e9[_0xfb63('0x36')][_0xfb63('0x44')]){_0x18501d[_0xfb63('0x45')]=[{'all':!![]}];}_0x18501d=_[_0xfb63('0x41')]({},_0x18501d,_0x1125e9[_0xfb63('0x43')]);return db[_0xfb63('0x30')][_0xfb63('0x4c')](_0x18501d)[_0xfb63('0x26')](handleEntityNotFound(_0x3d0b61,null))['then'](respondWithResult(_0x3d0b61,null))[_0xfb63('0x4d')](handleError(_0x3d0b61,null));};exports[_0xfb63('0x4e')]=function(_0xe5920c,_0x2365ed){return db[_0xfb63('0x30')][_0xfb63('0x4e')](_0xe5920c['body'],{})[_0xfb63('0x26')](function(_0x24aa62){var _0x4a20e6=_0xe5920c[_0xfb63('0x4f')][_0xfb63('0x50')]({'plain':!![]});if(!_0x4a20e6)throw new Error(_0xfb63('0x51'));if(_0x4a20e6[_0xfb63('0x52')]===_0xfb63('0x4f')){var _0x2c4f2b=_0x24aa62[_0xfb63('0x50')]({'plain':!![]});var _0x43c1a8=_0xfb63('0x27');return db[_0xfb63('0x53')][_0xfb63('0x4c')]({'where':{'name':_0x43c1a8,'userProfileId':_0x4a20e6['userProfileId']},'raw':!![]})[_0xfb63('0x26')](function(_0x464a67){if(_0x464a67&&_0x464a67[_0xfb63('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x2c4f2b[_0xfb63('0x2e')],'resourceId':_0x2c4f2b['id'],'type':_0x464a67[_0xfb63('0x2e')],'sectionId':_0x464a67['id']},{})[_0xfb63('0x26')](function(){return _0x24aa62;});}else{return _0x24aa62;}})[_0xfb63('0x4d')](function(_0x5a39f7){logger[_0xfb63('0x2c')](_0xfb63('0x55'),_0x5a39f7);throw _0x5a39f7;});}return _0x24aa62;})[_0xfb63('0x26')](respondWithResult(_0x2365ed,0xc9))[_0xfb63('0x4d')](handleError(_0x2365ed,null));};exports[_0xfb63('0x25')]=function(_0x33f0e3,_0x189200){if(_0x33f0e3[_0xfb63('0x56')]['id']){delete _0x33f0e3['body']['id'];}return db[_0xfb63('0x30')][_0xfb63('0x4c')]({'where':{'id':_0x33f0e3[_0xfb63('0x49')]['id']}})[_0xfb63('0x26')](handleEntityNotFound(_0x189200,null))['then'](saveUpdates(_0x33f0e3[_0xfb63('0x56')],null))[_0xfb63('0x26')](respondWithResult(_0x189200,null))[_0xfb63('0x4d')](handleError(_0x189200,null));};exports[_0xfb63('0x29')]=function(_0x4343b3,_0x577310){return db['MailQueue'][_0xfb63('0x4c')]({'where':{'id':_0x4343b3[_0xfb63('0x49')]['id']}})[_0xfb63('0x26')](handleEntityNotFound(_0x577310,null))[_0xfb63('0x26')](removeEntity(_0x577310,null))[_0xfb63('0x4d')](handleError(_0x577310,null));};exports['describe']=function(_0x299c88,_0x5900af){return db[_0xfb63('0x30')][_0xfb63('0x57')]()[_0xfb63('0x26')](respondWithResult(_0x5900af,null))[_0xfb63('0x4d')](handleError(_0x5900af,null));};exports[_0xfb63('0x58')]=function(_0xe1afef,_0x396094,_0x4c5267){var _0x131da9={'raw':!![],'where':{}},_0x2fddcd={},_0x460c52;return db['MailQueue'][_0xfb63('0x59')]({'where':{'id':_0xe1afef[_0xfb63('0x49')]['id']}})[_0xfb63('0x26')](handleEntityNotFound(_0x396094,null))[_0xfb63('0x26')](function(_0x582058){if(_0x582058){_0x460c52=_0x582058['get']({'plain':!![]});_0x2fddcd['model']=_['keys'](db[_0xfb63('0x5a')]['rawAttributes']);_0x2fddcd[_0xfb63('0x36')]=_[_0xfb63('0x4a')](_0xe1afef[_0xfb63('0x36')]);_0x2fddcd['filters']=_[_0xfb63('0x39')](_0x2fddcd[_0xfb63('0x34')],_0x2fddcd[_0xfb63('0x36')]);_0x131da9[_0xfb63('0x38')]=_[_0xfb63('0x39')](_0x2fddcd['model'],qs[_0xfb63('0x3a')](_0xe1afef[_0xfb63('0x36')]['fields']));_0x131da9['attributes']=_0x131da9[_0xfb63('0x38')][_0xfb63('0x4b')]?_0x131da9[_0xfb63('0x38')]:_0x2fddcd['model'];if(!_0xe1afef[_0xfb63('0x36')][_0xfb63('0x3b')](_0xfb63('0x5b'))){_0x131da9[_0xfb63('0x1e')]=qs[_0xfb63('0x1e')](_0xe1afef['query']['limit']);_0x131da9[_0xfb63('0x3c')]=qs[_0xfb63('0x3c')](_0xe1afef[_0xfb63('0x36')][_0xfb63('0x3c')]);}_0x131da9[_0xfb63('0x5c')]=qs[_0xfb63('0x3d')](_0xe1afef['query'][_0xfb63('0x3d')]);_0x131da9[_0xfb63('0x3e')]=qs[_0xfb63('0x37')](_[_0xfb63('0x3f')](_0xe1afef[_0xfb63('0x36')],_0x2fddcd[_0xfb63('0x37')]));_0x131da9[_0xfb63('0x3e')][_0xfb63('0x5d')]=_0x582058['id'];if(_0xe1afef['query']['filter']){_0x131da9['where']=_[_0xfb63('0x41')](_0x131da9[_0xfb63('0x3e')],{'$or':_[_0xfb63('0x35')](_0x131da9[_0xfb63('0x38')],function(_0x28a608){var _0x592452={};_0x592452[_0x28a608]={'$like':'%'+_0xe1afef['query']['filter']+'%'};return _0x592452;})});}_0x131da9=_[_0xfb63('0x41')]({},_0x131da9,_0xe1afef[_0xfb63('0x43')]);return db['UserMailQueue']['findAll'](_0x131da9);}})[_0xfb63('0x26')](function(_0x4a2bd1){if(_0x4a2bd1){return db[_0xfb63('0x5e')][_0xfb63('0x5f')]({'where':{'id':_[_0xfb63('0x35')](_0x4a2bd1,'UserId'),'role':_0xfb63('0x60')},'attributes':['id',_0xfb63('0x2e'),_0xfb63('0x61'),_0xfb63('0x62'),_0xfb63('0x63')]});}})[_0xfb63('0x26')](function(_0x4b6359){if(_0x4b6359){return{'count':_0x4b6359[_0xfb63('0x1f')],'rows':_[_0xfb63('0x35')](_0x4b6359[_0xfb63('0x47')],function(_0x4919ae){return{'membername':_0x4919ae['name'],'UserId':_0x4919ae['id'],'queue_name':_0x460c52[_0xfb63('0x2e')],'MailQueueId':_0x460c52['id'],'interface':util[_0xfb63('0x64')](_0xfb63('0x65'),_0xfb63('0x66'),_0x4919ae[_0xfb63('0x2e')]),'penalty':0x0,'paused':_0x4919ae[_0xfb63('0x61')],'createdAt':_0x4919ae[_0xfb63('0x63')],'updatedAt':_0x4919ae['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x396094,_0x131da9))[_0xfb63('0x4d')](handleError(_0x396094,null));};exports[_0xfb63('0x67')]=function(_0x46374b,_0x27f15d,_0xa5e3a0){var _0x5dc933={};var _0x2742ca={};var _0x2637c9;var _0x113d26;return db['MailQueue'][_0xfb63('0x59')]({'where':{'id':_0x46374b[_0xfb63('0x49')]['id']}})[_0xfb63('0x26')](handleEntityNotFound(_0x27f15d,null))[_0xfb63('0x26')](function(_0x46a3e2){if(_0x46a3e2){_0x2637c9=_0x46a3e2;_0x2742ca['model']=_[_0xfb63('0x4a')](db[_0xfb63('0x68')][_0xfb63('0x69')]);_0x2742ca[_0xfb63('0x36')]=_[_0xfb63('0x4a')](_0x46374b['query']);_0x2742ca[_0xfb63('0x37')]=_[_0xfb63('0x39')](_0x2742ca['model'],_0x2742ca[_0xfb63('0x36')]);_0x5dc933[_0xfb63('0x38')]=_[_0xfb63('0x39')](_0x2742ca[_0xfb63('0x34')],qs[_0xfb63('0x3a')](_0x46374b[_0xfb63('0x36')][_0xfb63('0x3a')]));_0x5dc933[_0xfb63('0x38')]=_0x5dc933['attributes'][_0xfb63('0x4b')]?_0x5dc933[_0xfb63('0x38')]:_0x2742ca[_0xfb63('0x34')];_0x5dc933[_0xfb63('0x5c')]=qs[_0xfb63('0x3d')](_0x46374b['query'][_0xfb63('0x3d')]);_0x5dc933[_0xfb63('0x3e')]=qs[_0xfb63('0x37')](_[_0xfb63('0x3f')](_0x46374b['query'],_0x2742ca[_0xfb63('0x37')]));if(_0x46374b[_0xfb63('0x36')][_0xfb63('0x40')]){_0x5dc933['where']=_[_0xfb63('0x41')](_0x5dc933[_0xfb63('0x3e')],{'$or':_['map'](_0x5dc933[_0xfb63('0x38')],function(_0x1ff58a){var _0x36916e={};_0x36916e[_0x1ff58a]={'$like':'%'+_0x46374b[_0xfb63('0x36')]['filter']+'%'};return _0x36916e;})});}_0x5dc933=_[_0xfb63('0x41')]({},_0x5dc933,_0x46374b[_0xfb63('0x43')]);return _0x2637c9[_0xfb63('0x67')](_0x5dc933);}})[_0xfb63('0x26')](function(_0x849adc){if(_0x849adc){_0x113d26=_0x849adc['length'];if(!_0x46374b[_0xfb63('0x36')][_0xfb63('0x3b')](_0xfb63('0x5b'))){_0x5dc933[_0xfb63('0x1e')]=qs[_0xfb63('0x1e')](_0x46374b[_0xfb63('0x36')][_0xfb63('0x1e')]);_0x5dc933['offset']=qs['offset'](_0x46374b['query'][_0xfb63('0x3c')]);}return _0x2637c9[_0xfb63('0x67')](_0x5dc933);}})[_0xfb63('0x26')](function(_0x14457e){if(_0x14457e){return _0x14457e?{'count':_0x113d26,'rows':_0x14457e}:null;}})[_0xfb63('0x26')](respondWithResult(_0x27f15d,null))[_0xfb63('0x4d')](handleError(_0x27f15d,null));};exports[_0xfb63('0x6a')]=function(_0x5669cd,_0x35d033,_0x3f4b1f){var _0x459d9e=_0x5669cd[_0xfb63('0x56')][_0xfb63('0x6b')];return db[_0xfb63('0x68')][_0xfb63('0x46')]({'where':{'id':_0x459d9e},'attributes':['id'],'include':[{'model':db[_0xfb63('0x5e')],'as':_0xfb63('0x6c'),'attributes':['id',_0xfb63('0x2e'),_0xfb63('0x6d'),'voicePause',_0xfb63('0x6e')],'raw':!![]}]})[_0xfb63('0x26')](function(_0x57ad4d){if(_0x57ad4d){var _0x2e3387=_[_0xfb63('0x6f')](_0x57ad4d,function(_0xa681c8){var _0xbed71b=_0xa681c8['get']({'plain':!![]});return _0xbed71b['Agents'];});return db[_0xfb63('0x30')]['find']({'where':{'id':_0x5669cd['params']['id']}})[_0xfb63('0x26')](function(_0x370529){return db[_0xfb63('0x70')][_0xfb63('0x71')](function(_0x49ab1c){return _0x370529['addTeams'](_0x459d9e,{'transaction':_0x49ab1c})[_0xfb63('0x26')](function(){return BPromise[_0xfb63('0x72')](_0x2e3387,function(_0x52fd6d){return db[_0xfb63('0x5a')][_0xfb63('0x73')]({'where':{'UserId':_0x52fd6d['id'],'MailQueueId':_0x5669cd[_0xfb63('0x49')]['id']},'transaction':_0x49ab1c});});})[_0xfb63('0x26')](function(){_0x2e3387[_0xfb63('0x74')](function(_0x55c1e1){socket[_0xfb63('0x75')]('userMailQueue:save',{'UserId':_0x55c1e1['id'],'MailQueueId':_0x370529['id']});});});});});}})[_0xfb63('0x26')](respondWithStatusCode(_0x35d033,null))['catch'](handleError(_0x35d033,null));};exports[_0xfb63('0x76')]=function(_0x5c1a11,_0x8017c0,_0x520e67){return db[_0xfb63('0x68')][_0xfb63('0x46')]({'where':{'id':_0x5c1a11[_0xfb63('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xfb63('0x5e')],'as':_0xfb63('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x8017c0,null))[_0xfb63('0x26')](function(_0x4934c2){var _0x1ec796=_['map'](_0x4934c2,'id');var _0x256c24=[];var _0x257cff=[];var _0x197069=squel[_0xfb63('0x77')]();_0x197069['field']('tq.TeamId')['from']('team_has_mail_queues','tq')['join'](_0xfb63('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfb63('0x3e')]('MailQueueId\x20=\x20?',_0x5c1a11[_0xfb63('0x49')]['id']);for(var _0x41dac5=0x0;_0x41dac5<_0x4934c2[_0xfb63('0x4b')];_0x41dac5+=0x1){let _0x18fc50=_0x4934c2[_0x41dac5];for(var _0x50b8f5=0x0;_0x50b8f5<_0x18fc50[_0xfb63('0x6c')]['length'];_0x50b8f5+=0x1){let _0x15cd14=_0x18fc50['Agents'][_0x50b8f5];var _0x52b9da=_0x197069[_0xfb63('0x79')]();_0x52b9da[_0xfb63('0x3e')](_0xfb63('0x7a'),_0x15cd14['id']);_0x257cff[_0xfb63('0x7b')](db[_0xfb63('0x70')]['query'](_0x52b9da[_0xfb63('0x7c')](),{'type':db['sequelize'][_0xfb63('0x7d')][_0xfb63('0x7e')]})[_0xfb63('0x26')](function(_0x426bbe){if(_0x426bbe[_0xfb63('0x4b')]===0x1){return _0x15cd14['id'];}else{var _0x4327f0=_[_0xfb63('0x7f')](_[_0xfb63('0x35')](_0x426bbe,_0xfb63('0x80')),function(_0x22acb5){return _['includes'](_0x1ec796,_0x22acb5);});if(_0x4327f0){return _0x15cd14['id'];}}}));}}return BPromise[_0xfb63('0x81')](_0x257cff)['then'](function(_0x586fa0){_0x256c24=_(_0x256c24)[_0xfb63('0x82')](_0x586fa0)['compact']()[_0xfb63('0x83')]();return db[_0xfb63('0x30')][_0xfb63('0x4c')]({'where':{'id':_0x5c1a11['params']['id']}})[_0xfb63('0x26')](function(_0x3151a3){return db[_0xfb63('0x70')][_0xfb63('0x71')](function(_0x27fdf3){return _0x3151a3[_0xfb63('0x76')](_0x5c1a11['query'][_0xfb63('0x6b')],{'transaction':_0x27fdf3})[_0xfb63('0x26')](function(){if(!_['isEmpty'](_0x256c24)){return _0x3151a3['removeAgents'](_0x256c24,{'transaction':_0x27fdf3});}})['then'](function(){_0x256c24[_0xfb63('0x74')](function(_0x434769){socket['emit']('userMailQueue:remove',{'UserId':_0x434769,'MailQueueId':_0x3151a3['id']});});});});});});})[_0xfb63('0x26')](respondWithStatusCode(_0x8017c0,null))[_0xfb63('0x4d')](handleError(_0x8017c0,null));};exports[_0xfb63('0x84')]=function(_0x2e2fba,_0x410b9c,_0xbf8aae){return db['MailQueue']['find']({'where':{'id':_0x2e2fba['params']['id']}})[_0xfb63('0x26')](handleEntityNotFound(_0x410b9c,null))[_0xfb63('0x26')](function(_0x2a6ea5){if(_0x2a6ea5){return _0x2a6ea5[_0xfb63('0x84')](_0x2e2fba[_0xfb63('0x56')][_0xfb63('0x6b')],_[_0xfb63('0x85')](_0x2e2fba[_0xfb63('0x56')],[_0xfb63('0x6b'),'id'])||{})[_0xfb63('0x86')](function(_0x23f750){for(var _0x1862f4=0x0;_0x1862f4<_0x2e2fba[_0xfb63('0x56')][_0xfb63('0x6b')][_0xfb63('0x4b')];_0x1862f4+=0x1){socket[_0xfb63('0x75')](_0xfb63('0x87'),{'UserId':Number(_0x2e2fba[_0xfb63('0x56')]['ids'][_0x1862f4]),'MailQueueId':Number(_0x2e2fba['params']['id'])});}return _0x23f750;});}})[_0xfb63('0x26')](respondWithResult(_0x410b9c,null))['catch'](handleError(_0x410b9c,null));};exports['removeAgents']=function(_0x62dbc7,_0x42dd4e,_0x3cc3ac){return db['MailQueue'][_0xfb63('0x4c')]({'where':{'id':_0x62dbc7[_0xfb63('0x49')]['id']}})[_0xfb63('0x26')](handleEntityNotFound(_0x42dd4e,null))[_0xfb63('0x26')](function(_0x20f59d){if(_0x20f59d){return _0x20f59d[_0xfb63('0x88')](_0x62dbc7['query'][_0xfb63('0x6b')])[_0xfb63('0x26')](function(){if(_['isArray'](_0x62dbc7['query'][_0xfb63('0x6b')])){for(var _0x45104c=0x0;_0x45104c<_0x62dbc7[_0xfb63('0x36')]['ids'][_0xfb63('0x4b')];_0x45104c+=0x1){socket['emit'](_0xfb63('0x89'),{'UserId':Number(_0x62dbc7[_0xfb63('0x36')][_0xfb63('0x6b')][_0x45104c]),'MailQueueId':Number(_0x62dbc7[_0xfb63('0x49')]['id'])});}}else{socket['emit'](_0xfb63('0x89'),{'UserId':Number(_0x62dbc7[_0xfb63('0x36')][_0xfb63('0x6b')]),'MailQueueId':Number(_0x62dbc7['params']['id'])});}});}})[_0xfb63('0x26')](respondWithStatusCode(_0x42dd4e,null))[_0xfb63('0x4d')](handleError(_0x42dd4e,null));};exports[_0xfb63('0x8a')]=function(_0x1bb6fc,_0x174abd,_0x382d62){var _0x384759={};var _0x551cea={};var _0x25fa08;var _0x20d6e1;return db['MailQueue'][_0xfb63('0x59')]({'where':{'id':_0x1bb6fc[_0xfb63('0x49')]['id']}})['then'](handleEntityNotFound(_0x174abd,null))[_0xfb63('0x26')](function(_0x39dd4f){if(_0x39dd4f){_0x25fa08=_0x39dd4f;_0x551cea['model']=_[_0xfb63('0x4a')](db['User'][_0xfb63('0x69')]);_0x551cea[_0xfb63('0x36')]=_['keys'](_0x1bb6fc[_0xfb63('0x36')]);_0x551cea[_0xfb63('0x37')]=_['intersection'](_0x551cea[_0xfb63('0x34')],_0x551cea[_0xfb63('0x36')]);_0x384759[_0xfb63('0x38')]=_[_0xfb63('0x39')](_0x551cea[_0xfb63('0x34')],qs[_0xfb63('0x3a')](_0x1bb6fc[_0xfb63('0x36')][_0xfb63('0x3a')]));_0x384759[_0xfb63('0x38')]=_0x384759[_0xfb63('0x38')][_0xfb63('0x4b')]?_0x384759[_0xfb63('0x38')]:_0x551cea[_0xfb63('0x34')];_0x384759[_0xfb63('0x5c')]=qs['sort'](_0x1bb6fc[_0xfb63('0x36')]['sort']);_0x384759[_0xfb63('0x3e')]=qs[_0xfb63('0x37')](_[_0xfb63('0x3f')](_0x1bb6fc[_0xfb63('0x36')],_0x551cea[_0xfb63('0x37')]));if(_0x1bb6fc['query'][_0xfb63('0x40')]){_0x384759[_0xfb63('0x3e')]=_['merge'](_0x384759[_0xfb63('0x3e')],{'$or':_[_0xfb63('0x35')](_0x384759['attributes'],function(_0x33bbf0){var _0x266c05={};_0x266c05[_0x33bbf0]={'$like':'%'+_0x1bb6fc['query']['filter']+'%'};return _0x266c05;})});}_0x384759=_[_0xfb63('0x41')]({},_0x384759,_0x1bb6fc[_0xfb63('0x43')]);return _0x25fa08['getAgents'](_0x384759);}})['then'](function(_0x5a111d){if(_0x5a111d){_0x20d6e1=_0x5a111d[_0xfb63('0x4b')];if(!_0x1bb6fc['query']['hasOwnProperty']('nolimit')){_0x384759[_0xfb63('0x1e')]=qs[_0xfb63('0x1e')](_0x1bb6fc[_0xfb63('0x36')][_0xfb63('0x1e')]);_0x384759['offset']=qs[_0xfb63('0x3c')](_0x1bb6fc[_0xfb63('0x36')][_0xfb63('0x3c')]);}return _0x25fa08[_0xfb63('0x8a')](_0x384759);}})['then'](function(_0x3ed619){if(_0x3ed619){return _0x3ed619?{'count':_0x20d6e1,'rows':_0x3ed619}:null;}})[_0xfb63('0x26')](respondWithResult(_0x174abd,null))[_0xfb63('0x4d')](handleError(_0x174abd,null));}; \ No newline at end of file +var _0x5beb=['catch','show','params','length','find','create','body','role','user','MailQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','createdAt','rows','format','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','userMailQueue:save','field','tq.TeamId','from','team_has_mail_queues','join','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','removeAgents','userMailQueue:remove','addAgents','spread','emit','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','name','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x2e4495,_0x1cd00d){var _0x4b4244=function(_0x1c9b36){while(--_0x1c9b36){_0x2e4495['push'](_0x2e4495['shift']());}};_0x4b4244(++_0x1cd00d);}(_0x5beb,0x15c));var _0xb5be=function(_0xdc7886,_0x57ebb2){_0xdc7886=_0xdc7886-0x0;var _0x1680a4=_0x5beb[_0xdc7886];return _0x1680a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5be('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5be('0x1'));var rp=require(_0xb5be('0x2'));var moment=require(_0xb5be('0x3'));var BPromise=require(_0xb5be('0x4'));var Mustache=require('mustache');var util=require(_0xb5be('0x5'));var path=require(_0xb5be('0x6'));var sox=require('sox');var csv=require(_0xb5be('0x7'));var ejs=require(_0xb5be('0x8'));var fs=require('fs');var fs_extra=require(_0xb5be('0x9'));var _=require(_0xb5be('0xa'));var squel=require(_0xb5be('0xb'));var crypto=require(_0xb5be('0xc'));var jsforce=require(_0xb5be('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb5be('0x7'));var querystring=require(_0xb5be('0xe'));var Papa=require('papaparse');var Redis=require(_0xb5be('0xf'));var authService=require(_0xb5be('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb5be('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5be('0x12'))(_0xb5be('0x13'));var utils=require(_0xb5be('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb5be('0x15'));var db=require(_0xb5be('0x16'))['db'];config['redis']=_[_0xb5be('0x17')](config[_0xb5be('0x18')],{'host':_0xb5be('0x19'),'port':0x18eb});var socket=require(_0xb5be('0x1a'))(new Redis(config[_0xb5be('0x18')]));require(_0xb5be('0x1b'))[_0xb5be('0x1c')](socket);function respondWithStatusCode(_0x1c2246,_0x5b78c6){_0x5b78c6=_0x5b78c6||0xcc;return function(_0x3c6a94){if(_0x3c6a94){return _0x1c2246[_0xb5be('0x1d')](_0x5b78c6);}return _0x1c2246[_0xb5be('0x1e')](_0x5b78c6)['end']();};}function respondWithResult(_0x512828,_0x4679ac){_0x4679ac=_0x4679ac||0xc8;return function(_0x1eff86){if(_0x1eff86){return _0x512828[_0xb5be('0x1e')](_0x4679ac)['json'](_0x1eff86);}};}function respondWithFilteredResult(_0x2e9146,_0x404360){return function(_0xff25c4){if(_0xff25c4){var _0x11a020=typeof _0x404360['offset']===_0xb5be('0x1f')&&typeof _0x404360['limit']===_0xb5be('0x1f');var _0xa6071d=_0xff25c4[_0xb5be('0x20')];var _0x4b6bc2=_0x11a020?0x0:_0x404360[_0xb5be('0x21')];var _0x5586df=_0x11a020?_0xff25c4[_0xb5be('0x20')]:_0x404360[_0xb5be('0x21')]+_0x404360[_0xb5be('0x22')];var _0x57281e;if(_0x5586df>=_0xa6071d){_0x5586df=_0xa6071d;_0x57281e=0xc8;}else{_0x57281e=0xce;}_0x2e9146[_0xb5be('0x1e')](_0x57281e);return _0x2e9146[_0xb5be('0x23')](_0xb5be('0x24'),_0x4b6bc2+'-'+_0x5586df+'/'+_0xa6071d)[_0xb5be('0x25')](_0xff25c4);}return null;};}function patchUpdates(_0x4c40fb){return function(_0x4382bc){try{jsonpatch[_0xb5be('0x26')](_0x4382bc,_0x4c40fb,!![]);}catch(_0x2ce9f4){return BPromise[_0xb5be('0x27')](_0x2ce9f4);}return _0x4382bc[_0xb5be('0x28')]();};}function saveUpdates(_0x2c87fd,_0x223040){return function(_0x214c01){if(_0x214c01){return _0x214c01[_0xb5be('0x29')](_0x2c87fd)['then'](function(_0x1126f7){return _0x1126f7;});}return null;};}function removeEntity(_0x19d361,_0x17c1d5){return function(_0xffd30d){if(_0xffd30d){return _0xffd30d[_0xb5be('0x2a')]()[_0xb5be('0x2b')](function(){var _0x946d96=_0xffd30d[_0xb5be('0x2c')]({'plain':!![]});var _0x15b649='MailQueues';return db[_0xb5be('0x2d')]['destroy']({'where':{'type':_0x15b649,'resourceId':_0x946d96['id']}})[_0xb5be('0x2b')](function(){return _0xffd30d;});})[_0xb5be('0x2b')](function(){_0x19d361['status'](0xcc)[_0xb5be('0x2e')]();});}};}function handleEntityNotFound(_0x58233e,_0x3762cf){return function(_0x4f79ed){if(!_0x4f79ed){_0x58233e[_0xb5be('0x1d')](0x194);}return _0x4f79ed;};}function handleError(_0x1d97e4,_0x1a0daf){_0x1a0daf=_0x1a0daf||0x1f4;return function(_0x221a73){logger[_0xb5be('0x2f')](_0x221a73['stack']);if(_0x221a73['name']){delete _0x221a73[_0xb5be('0x30')];}_0x1d97e4[_0xb5be('0x1e')](_0x1a0daf)['send'](_0x221a73);};}exports[_0xb5be('0x31')]=function(_0x3d22a8,_0x588769){var _0xcd8a8f={},_0x3eebe2={},_0x16df4f={'count':0x0,'rows':[]};var _0x3127ee=_[_0xb5be('0x32')](db[_0xb5be('0x33')][_0xb5be('0x34')],function(_0x2d4302){return{'name':_0x2d4302[_0xb5be('0x35')],'type':_0x2d4302[_0xb5be('0x36')][_0xb5be('0x37')]};});_0x3eebe2[_0xb5be('0x38')]=_[_0xb5be('0x32')](_0x3127ee,_0xb5be('0x30'));_0x3eebe2[_0xb5be('0x39')]=_[_0xb5be('0x3a')](_0x3d22a8[_0xb5be('0x39')]);_0x3eebe2[_0xb5be('0x3b')]=_[_0xb5be('0x3c')](_0x3eebe2[_0xb5be('0x38')],_0x3eebe2[_0xb5be('0x39')]);_0xcd8a8f['attributes']=_[_0xb5be('0x3c')](_0x3eebe2[_0xb5be('0x38')],qs[_0xb5be('0x3d')](_0x3d22a8[_0xb5be('0x39')][_0xb5be('0x3d')]));_0xcd8a8f[_0xb5be('0x3e')]=_0xcd8a8f[_0xb5be('0x3e')]['length']?_0xcd8a8f['attributes']:_0x3eebe2['model'];if(!_0x3d22a8[_0xb5be('0x39')]['hasOwnProperty'](_0xb5be('0x3f'))){_0xcd8a8f[_0xb5be('0x22')]=qs[_0xb5be('0x22')](_0x3d22a8['query'][_0xb5be('0x22')]);_0xcd8a8f[_0xb5be('0x21')]=qs['offset'](_0x3d22a8['query'][_0xb5be('0x21')]);}_0xcd8a8f[_0xb5be('0x40')]=qs[_0xb5be('0x41')](_0x3d22a8[_0xb5be('0x39')][_0xb5be('0x41')]);_0xcd8a8f[_0xb5be('0x42')]=qs[_0xb5be('0x3b')](_[_0xb5be('0x43')](_0x3d22a8[_0xb5be('0x39')],_0x3eebe2['filters']),_0x3127ee);if(_0x3d22a8[_0xb5be('0x39')][_0xb5be('0x44')]){_0xcd8a8f['where']=_[_0xb5be('0x45')](_0xcd8a8f[_0xb5be('0x42')],{'$or':_[_0xb5be('0x32')](_0x3127ee,function(_0x412207){if(_0x412207[_0xb5be('0x36')]!==_0xb5be('0x46')){var _0x168b40={};_0x168b40[_0x412207[_0xb5be('0x30')]]={'$like':'%'+_0x3d22a8[_0xb5be('0x39')][_0xb5be('0x44')]+'%'};return _0x168b40;}})});}_0xcd8a8f=_['merge']({},_0xcd8a8f,_0x3d22a8[_0xb5be('0x47')]);var _0x22599a={'where':_0xcd8a8f[_0xb5be('0x42')]};return db['MailQueue'][_0xb5be('0x20')](_0x22599a)[_0xb5be('0x2b')](function(_0x242037){_0x16df4f[_0xb5be('0x20')]=_0x242037;if(_0x3d22a8[_0xb5be('0x39')][_0xb5be('0x48')]){_0xcd8a8f[_0xb5be('0x49')]=[{'all':!![]}];}return db['MailQueue'][_0xb5be('0x4a')](_0xcd8a8f);})[_0xb5be('0x2b')](function(_0x20d290){_0x16df4f['rows']=_0x20d290;return _0x16df4f;})['then'](respondWithFilteredResult(_0x588769,_0xcd8a8f))[_0xb5be('0x4b')](handleError(_0x588769,null));};exports[_0xb5be('0x4c')]=function(_0x1eaf12,_0x1ac991){var _0x2c61f8={'raw':!![],'where':{'id':_0x1eaf12[_0xb5be('0x4d')]['id']}},_0x59268e={};_0x59268e[_0xb5be('0x38')]=_['keys'](db[_0xb5be('0x33')][_0xb5be('0x34')]);_0x59268e[_0xb5be('0x39')]=_[_0xb5be('0x3a')](_0x1eaf12[_0xb5be('0x39')]);_0x59268e[_0xb5be('0x3b')]=_[_0xb5be('0x3c')](_0x59268e[_0xb5be('0x38')],_0x59268e[_0xb5be('0x39')]);_0x2c61f8[_0xb5be('0x3e')]=_[_0xb5be('0x3c')](_0x59268e[_0xb5be('0x38')],qs[_0xb5be('0x3d')](_0x1eaf12[_0xb5be('0x39')]['fields']));_0x2c61f8[_0xb5be('0x3e')]=_0x2c61f8['attributes'][_0xb5be('0x4e')]?_0x2c61f8[_0xb5be('0x3e')]:_0x59268e[_0xb5be('0x38')];if(_0x1eaf12[_0xb5be('0x39')][_0xb5be('0x48')]){_0x2c61f8[_0xb5be('0x49')]=[{'all':!![]}];}_0x2c61f8=_[_0xb5be('0x45')]({},_0x2c61f8,_0x1eaf12[_0xb5be('0x47')]);return db['MailQueue'][_0xb5be('0x4f')](_0x2c61f8)[_0xb5be('0x2b')](handleEntityNotFound(_0x1ac991,null))[_0xb5be('0x2b')](respondWithResult(_0x1ac991,null))[_0xb5be('0x4b')](handleError(_0x1ac991,null));};exports[_0xb5be('0x50')]=function(_0x1a777c,_0x5ecf33){return db[_0xb5be('0x33')]['create'](_0x1a777c[_0xb5be('0x51')],{})['then'](function(_0x287a2f){var _0x40bcfd=_0x1a777c['user']['get']({'plain':!![]});if(!_0x40bcfd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40bcfd[_0xb5be('0x52')]===_0xb5be('0x53')){var _0x79281=_0x287a2f[_0xb5be('0x2c')]({'plain':!![]});var _0xd1cb4f=_0xb5be('0x54');return db['UserProfileSection'][_0xb5be('0x4f')]({'where':{'name':_0xd1cb4f,'userProfileId':_0x40bcfd[_0xb5be('0x55')]},'raw':!![]})[_0xb5be('0x2b')](function(_0x2d8603){if(_0x2d8603&&_0x2d8603[_0xb5be('0x56')]===0x0){return db[_0xb5be('0x2d')][_0xb5be('0x50')]({'name':_0x79281[_0xb5be('0x30')],'resourceId':_0x79281['id'],'type':_0x2d8603[_0xb5be('0x30')],'sectionId':_0x2d8603['id']},{})[_0xb5be('0x2b')](function(){return _0x287a2f;});}else{return _0x287a2f;}})[_0xb5be('0x4b')](function(_0x27af58){logger['error'](_0xb5be('0x57'),_0x27af58);throw _0x27af58;});}return _0x287a2f;})[_0xb5be('0x2b')](respondWithResult(_0x5ecf33,0xc9))[_0xb5be('0x4b')](handleError(_0x5ecf33,null));};exports[_0xb5be('0x29')]=function(_0x2cda70,_0x27bb25){if(_0x2cda70[_0xb5be('0x51')]['id']){delete _0x2cda70['body']['id'];}return db['MailQueue'][_0xb5be('0x4f')]({'where':{'id':_0x2cda70[_0xb5be('0x4d')]['id']}})[_0xb5be('0x2b')](handleEntityNotFound(_0x27bb25,null))[_0xb5be('0x2b')](saveUpdates(_0x2cda70[_0xb5be('0x51')],null))[_0xb5be('0x2b')](respondWithResult(_0x27bb25,null))[_0xb5be('0x4b')](handleError(_0x27bb25,null));};exports[_0xb5be('0x2a')]=function(_0x301f63,_0x5eed7c){return db[_0xb5be('0x33')][_0xb5be('0x4f')]({'where':{'id':_0x301f63[_0xb5be('0x4d')]['id']}})[_0xb5be('0x2b')](handleEntityNotFound(_0x5eed7c,null))[_0xb5be('0x2b')](removeEntity(_0x5eed7c,null))[_0xb5be('0x4b')](handleError(_0x5eed7c,null));};exports[_0xb5be('0x58')]=function(_0x13c840,_0x5452d6){return db[_0xb5be('0x33')]['describe']()[_0xb5be('0x2b')](respondWithResult(_0x5452d6,null))['catch'](handleError(_0x5452d6,null));};exports[_0xb5be('0x59')]=function(_0x2957ea,_0x3d0441,_0x333a90){var _0x5ca7f5={'raw':!![],'where':{}},_0xb20dff={},_0x1b773c;return db['MailQueue'][_0xb5be('0x5a')]({'where':{'id':_0x2957ea[_0xb5be('0x4d')]['id']}})[_0xb5be('0x2b')](handleEntityNotFound(_0x3d0441,null))['then'](function(_0x2c1e27){if(_0x2c1e27){_0x1b773c=_0x2c1e27[_0xb5be('0x2c')]({'plain':!![]});_0xb20dff['model']=_[_0xb5be('0x3a')](db[_0xb5be('0x5b')][_0xb5be('0x34')]);_0xb20dff[_0xb5be('0x39')]=_[_0xb5be('0x3a')](_0x2957ea[_0xb5be('0x39')]);_0xb20dff[_0xb5be('0x3b')]=_[_0xb5be('0x3c')](_0xb20dff['model'],_0xb20dff[_0xb5be('0x39')]);_0x5ca7f5[_0xb5be('0x3e')]=_['intersection'](_0xb20dff[_0xb5be('0x38')],qs[_0xb5be('0x3d')](_0x2957ea[_0xb5be('0x39')]['fields']));_0x5ca7f5[_0xb5be('0x3e')]=_0x5ca7f5[_0xb5be('0x3e')]['length']?_0x5ca7f5[_0xb5be('0x3e')]:_0xb20dff[_0xb5be('0x38')];if(!_0x2957ea['query'][_0xb5be('0x5c')](_0xb5be('0x3f'))){_0x5ca7f5[_0xb5be('0x22')]=qs[_0xb5be('0x22')](_0x2957ea[_0xb5be('0x39')][_0xb5be('0x22')]);_0x5ca7f5[_0xb5be('0x21')]=qs[_0xb5be('0x21')](_0x2957ea[_0xb5be('0x39')]['offset']);}_0x5ca7f5['order']=qs[_0xb5be('0x41')](_0x2957ea['query'][_0xb5be('0x41')]);_0x5ca7f5['where']=qs[_0xb5be('0x3b')](_[_0xb5be('0x43')](_0x2957ea[_0xb5be('0x39')],_0xb20dff[_0xb5be('0x3b')]));_0x5ca7f5['where'][_0xb5be('0x5d')]=_0x2c1e27['id'];if(_0x2957ea[_0xb5be('0x39')]['filter']){_0x5ca7f5[_0xb5be('0x42')]=_[_0xb5be('0x45')](_0x5ca7f5[_0xb5be('0x42')],{'$or':_[_0xb5be('0x32')](_0x5ca7f5[_0xb5be('0x3e')],function(_0x249222){var _0x5650f2={};_0x5650f2[_0x249222]={'$like':'%'+_0x2957ea[_0xb5be('0x39')]['filter']+'%'};return _0x5650f2;})});}_0x5ca7f5=_[_0xb5be('0x45')]({},_0x5ca7f5,_0x2957ea[_0xb5be('0x47')]);return db[_0xb5be('0x5b')][_0xb5be('0x4a')](_0x5ca7f5);}})[_0xb5be('0x2b')](function(_0x15a15a){if(_0x15a15a){return db[_0xb5be('0x5e')][_0xb5be('0x5f')]({'where':{'id':_[_0xb5be('0x32')](_0x15a15a,_0xb5be('0x60')),'role':_0xb5be('0x61')},'attributes':['id',_0xb5be('0x30'),_0xb5be('0x62'),'updatedAt',_0xb5be('0x63')]});}})[_0xb5be('0x2b')](function(_0x581512){if(_0x581512){return{'count':_0x581512[_0xb5be('0x20')],'rows':_['map'](_0x581512[_0xb5be('0x64')],function(_0x4bd3f6){return{'membername':_0x4bd3f6[_0xb5be('0x30')],'UserId':_0x4bd3f6['id'],'queue_name':_0x1b773c[_0xb5be('0x30')],'MailQueueId':_0x1b773c['id'],'interface':util[_0xb5be('0x65')]('%s/%s',_0xb5be('0x66'),_0x4bd3f6[_0xb5be('0x30')]),'penalty':0x0,'paused':_0x4bd3f6[_0xb5be('0x62')],'createdAt':_0x4bd3f6[_0xb5be('0x63')],'updatedAt':_0x4bd3f6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb5be('0x2b')](respondWithFilteredResult(_0x3d0441,_0x5ca7f5))[_0xb5be('0x4b')](handleError(_0x3d0441,null));};exports[_0xb5be('0x67')]=function(_0x23b161,_0x4bcf7b,_0x5ba98e){var _0x3fe15f={};var _0x5a99b0={};var _0x32e11f;var _0x4f5e65;return db['MailQueue']['findOne']({'where':{'id':_0x23b161[_0xb5be('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4bcf7b,null))[_0xb5be('0x2b')](function(_0xc7cd5d){if(_0xc7cd5d){_0x32e11f=_0xc7cd5d;_0x5a99b0[_0xb5be('0x38')]=_[_0xb5be('0x3a')](db[_0xb5be('0x68')][_0xb5be('0x34')]);_0x5a99b0['query']=_[_0xb5be('0x3a')](_0x23b161[_0xb5be('0x39')]);_0x5a99b0[_0xb5be('0x3b')]=_['intersection'](_0x5a99b0[_0xb5be('0x38')],_0x5a99b0['query']);_0x3fe15f[_0xb5be('0x3e')]=_[_0xb5be('0x3c')](_0x5a99b0[_0xb5be('0x38')],qs[_0xb5be('0x3d')](_0x23b161[_0xb5be('0x39')]['fields']));_0x3fe15f[_0xb5be('0x3e')]=_0x3fe15f[_0xb5be('0x3e')][_0xb5be('0x4e')]?_0x3fe15f[_0xb5be('0x3e')]:_0x5a99b0[_0xb5be('0x38')];_0x3fe15f[_0xb5be('0x40')]=qs[_0xb5be('0x41')](_0x23b161[_0xb5be('0x39')]['sort']);_0x3fe15f[_0xb5be('0x42')]=qs[_0xb5be('0x3b')](_['pick'](_0x23b161[_0xb5be('0x39')],_0x5a99b0['filters']));if(_0x23b161[_0xb5be('0x39')][_0xb5be('0x44')]){_0x3fe15f['where']=_[_0xb5be('0x45')](_0x3fe15f['where'],{'$or':_[_0xb5be('0x32')](_0x3fe15f[_0xb5be('0x3e')],function(_0x104ca4){var _0x5cb00e={};_0x5cb00e[_0x104ca4]={'$like':'%'+_0x23b161[_0xb5be('0x39')][_0xb5be('0x44')]+'%'};return _0x5cb00e;})});}_0x3fe15f=_[_0xb5be('0x45')]({},_0x3fe15f,_0x23b161[_0xb5be('0x47')]);return _0x32e11f[_0xb5be('0x67')](_0x3fe15f);}})[_0xb5be('0x2b')](function(_0x5daae8){if(_0x5daae8){_0x4f5e65=_0x5daae8[_0xb5be('0x4e')];if(!_0x23b161[_0xb5be('0x39')][_0xb5be('0x5c')]('nolimit')){_0x3fe15f[_0xb5be('0x22')]=qs[_0xb5be('0x22')](_0x23b161['query']['limit']);_0x3fe15f[_0xb5be('0x21')]=qs[_0xb5be('0x21')](_0x23b161[_0xb5be('0x39')][_0xb5be('0x21')]);}return _0x32e11f[_0xb5be('0x67')](_0x3fe15f);}})[_0xb5be('0x2b')](function(_0x1de65a){if(_0x1de65a){return _0x1de65a?{'count':_0x4f5e65,'rows':_0x1de65a}:null;}})['then'](respondWithResult(_0x4bcf7b,null))[_0xb5be('0x4b')](handleError(_0x4bcf7b,null));};exports[_0xb5be('0x69')]=function(_0x3e4577,_0x48b9cc,_0x561b7c){var _0x48a354=_0x3e4577[_0xb5be('0x51')][_0xb5be('0x6a')];return db[_0xb5be('0x68')][_0xb5be('0x4a')]({'where':{'id':_0x48a354},'attributes':['id'],'include':[{'model':db[_0xb5be('0x5e')],'as':_0xb5be('0x6b'),'attributes':['id',_0xb5be('0x30'),_0xb5be('0x6c'),_0xb5be('0x6d'),_0xb5be('0x6e')],'raw':!![]}]})[_0xb5be('0x2b')](function(_0x1ae54b){if(_0x1ae54b){var _0x5af8fd=_[_0xb5be('0x6f')](_0x1ae54b,function(_0x241b53){var _0x1ed2b8=_0x241b53[_0xb5be('0x2c')]({'plain':!![]});return _0x1ed2b8[_0xb5be('0x6b')];});return db[_0xb5be('0x33')][_0xb5be('0x4f')]({'where':{'id':_0x3e4577[_0xb5be('0x4d')]['id']}})[_0xb5be('0x2b')](function(_0x5032c0){return db['sequelize']['transaction'](function(_0xf4a8ac){return _0x5032c0[_0xb5be('0x69')](_0x48a354,{'transaction':_0xf4a8ac})[_0xb5be('0x2b')](function(){return BPromise[_0xb5be('0x70')](_0x5af8fd,function(_0x428862){return db[_0xb5be('0x5b')][_0xb5be('0x71')]({'where':{'UserId':_0x428862['id'],'MailQueueId':_0x3e4577[_0xb5be('0x4d')]['id']},'transaction':_0xf4a8ac});});})['then'](function(){_0x5af8fd[_0xb5be('0x72')](function(_0xce86b5){socket['emit'](_0xb5be('0x73'),{'UserId':_0xce86b5['id'],'MailQueueId':_0x5032c0['id']});});});});});}})[_0xb5be('0x2b')](respondWithStatusCode(_0x48b9cc,null))[_0xb5be('0x4b')](handleError(_0x48b9cc,null));};exports['removeTeams']=function(_0x1d0845,_0x51f766,_0x5014c3){return db[_0xb5be('0x68')][_0xb5be('0x4a')]({'where':{'id':_0x1d0845['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xb5be('0x5e')],'as':_0xb5be('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x51f766,null))[_0xb5be('0x2b')](function(_0x1bb0bd){var _0x4a3d60=_[_0xb5be('0x32')](_0x1bb0bd,'id');var _0x495273=[];var _0x2b4cd1=[];var _0x1d197c=squel['select']();_0x1d197c[_0xb5be('0x74')](_0xb5be('0x75'))[_0xb5be('0x76')](_0xb5be('0x77'),'tq')[_0xb5be('0x78')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb5be('0x42')](_0xb5be('0x79'),_0x1d0845['params']['id']);for(var _0x421cd0=0x0;_0x421cd0<_0x1bb0bd[_0xb5be('0x4e')];_0x421cd0+=0x1){let _0xcb46=_0x1bb0bd[_0x421cd0];for(var _0x1377e5=0x0;_0x1377e5<_0xcb46[_0xb5be('0x6b')][_0xb5be('0x4e')];_0x1377e5+=0x1){let _0x58b464=_0xcb46[_0xb5be('0x6b')][_0x1377e5];var _0x41bc42=_0x1d197c[_0xb5be('0x7a')]();_0x41bc42[_0xb5be('0x42')](_0xb5be('0x7b'),_0x58b464['id']);_0x2b4cd1['push'](db['sequelize'][_0xb5be('0x39')](_0x41bc42['toString'](),{'type':db[_0xb5be('0x7c')][_0xb5be('0x7d')][_0xb5be('0x7e')]})[_0xb5be('0x2b')](function(_0x3ac4ea){if(_0x3ac4ea[_0xb5be('0x4e')]===0x1){return _0x58b464['id'];}else{var _0x3a73b7=_[_0xb5be('0x7f')](_[_0xb5be('0x32')](_0x3ac4ea,_0xb5be('0x80')),function(_0x78df56){return _[_0xb5be('0x81')](_0x4a3d60,_0x78df56);});if(_0x3a73b7){return _0x58b464['id'];}}}));}}return BPromise[_0xb5be('0x82')](_0x2b4cd1)[_0xb5be('0x2b')](function(_0x48687c){_0x495273=_(_0x495273)['union'](_0x48687c)[_0xb5be('0x83')]()[_0xb5be('0x84')]();return db['MailQueue'][_0xb5be('0x4f')]({'where':{'id':_0x1d0845['params']['id']}})[_0xb5be('0x2b')](function(_0x2efb00){return db[_0xb5be('0x7c')][_0xb5be('0x85')](function(_0x303a90){return _0x2efb00['removeTeams'](_0x1d0845['query'][_0xb5be('0x6a')],{'transaction':_0x303a90})['then'](function(){if(!_['isEmpty'](_0x495273)){return _0x2efb00[_0xb5be('0x86')](_0x495273,{'transaction':_0x303a90});}})['then'](function(){_0x495273[_0xb5be('0x72')](function(_0x474ed2){socket['emit'](_0xb5be('0x87'),{'UserId':_0x474ed2,'MailQueueId':_0x2efb00['id']});});});});});});})['then'](respondWithStatusCode(_0x51f766,null))[_0xb5be('0x4b')](handleError(_0x51f766,null));};exports['addAgents']=function(_0x3dc888,_0x4051b0,_0x53cc91){return db[_0xb5be('0x33')][_0xb5be('0x4f')]({'where':{'id':_0x3dc888[_0xb5be('0x4d')]['id']}})[_0xb5be('0x2b')](handleEntityNotFound(_0x4051b0,null))[_0xb5be('0x2b')](function(_0x14a929){if(_0x14a929){return _0x14a929[_0xb5be('0x88')](_0x3dc888[_0xb5be('0x51')]['ids'],_['omit'](_0x3dc888[_0xb5be('0x51')],[_0xb5be('0x6a'),'id'])||{})[_0xb5be('0x89')](function(_0x57f3b6){for(var _0x9bc4b5=0x0;_0x9bc4b5<_0x3dc888['body'][_0xb5be('0x6a')][_0xb5be('0x4e')];_0x9bc4b5+=0x1){socket[_0xb5be('0x8a')](_0xb5be('0x73'),{'UserId':Number(_0x3dc888[_0xb5be('0x51')][_0xb5be('0x6a')][_0x9bc4b5]),'MailQueueId':Number(_0x3dc888[_0xb5be('0x4d')]['id'])});}return _0x57f3b6;});}})[_0xb5be('0x2b')](respondWithResult(_0x4051b0,null))['catch'](handleError(_0x4051b0,null));};exports['removeAgents']=function(_0x582533,_0x1c6559,_0xa24e30){return db['MailQueue'][_0xb5be('0x4f')]({'where':{'id':_0x582533[_0xb5be('0x4d')]['id']}})[_0xb5be('0x2b')](handleEntityNotFound(_0x1c6559,null))[_0xb5be('0x2b')](function(_0x42a0b1){if(_0x42a0b1){return _0x42a0b1[_0xb5be('0x86')](_0x582533[_0xb5be('0x39')][_0xb5be('0x6a')])[_0xb5be('0x2b')](function(){if(_[_0xb5be('0x8b')](_0x582533[_0xb5be('0x39')][_0xb5be('0x6a')])){for(var _0x4996b7=0x0;_0x4996b7<_0x582533[_0xb5be('0x39')][_0xb5be('0x6a')]['length'];_0x4996b7+=0x1){socket['emit'](_0xb5be('0x87'),{'UserId':Number(_0x582533[_0xb5be('0x39')][_0xb5be('0x6a')][_0x4996b7]),'MailQueueId':Number(_0x582533[_0xb5be('0x4d')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x582533[_0xb5be('0x39')]['ids']),'MailQueueId':Number(_0x582533['params']['id'])});}});}})[_0xb5be('0x2b')](respondWithStatusCode(_0x1c6559,null))[_0xb5be('0x4b')](handleError(_0x1c6559,null));};exports[_0xb5be('0x8c')]=function(_0x2ac0b8,_0x516f2,_0x24b6bd){var _0x287822={};var _0x560bcd={};var _0x332e83;var _0x39c4a2;return db[_0xb5be('0x33')][_0xb5be('0x5a')]({'where':{'id':_0x2ac0b8[_0xb5be('0x4d')]['id']}})[_0xb5be('0x2b')](handleEntityNotFound(_0x516f2,null))[_0xb5be('0x2b')](function(_0x20bf17){if(_0x20bf17){_0x332e83=_0x20bf17;_0x560bcd[_0xb5be('0x38')]=_['keys'](db[_0xb5be('0x5e')]['rawAttributes']);_0x560bcd[_0xb5be('0x39')]=_[_0xb5be('0x3a')](_0x2ac0b8[_0xb5be('0x39')]);_0x560bcd[_0xb5be('0x3b')]=_[_0xb5be('0x3c')](_0x560bcd[_0xb5be('0x38')],_0x560bcd[_0xb5be('0x39')]);_0x287822[_0xb5be('0x3e')]=_['intersection'](_0x560bcd[_0xb5be('0x38')],qs[_0xb5be('0x3d')](_0x2ac0b8[_0xb5be('0x39')]['fields']));_0x287822[_0xb5be('0x3e')]=_0x287822[_0xb5be('0x3e')][_0xb5be('0x4e')]?_0x287822['attributes']:_0x560bcd[_0xb5be('0x38')];_0x287822[_0xb5be('0x40')]=qs['sort'](_0x2ac0b8[_0xb5be('0x39')]['sort']);_0x287822[_0xb5be('0x42')]=qs[_0xb5be('0x3b')](_[_0xb5be('0x43')](_0x2ac0b8[_0xb5be('0x39')],_0x560bcd[_0xb5be('0x3b')]));if(_0x2ac0b8[_0xb5be('0x39')][_0xb5be('0x44')]){_0x287822['where']=_[_0xb5be('0x45')](_0x287822[_0xb5be('0x42')],{'$or':_[_0xb5be('0x32')](_0x287822[_0xb5be('0x3e')],function(_0x4901f7){var _0x4f15da={};_0x4f15da[_0x4901f7]={'$like':'%'+_0x2ac0b8['query'][_0xb5be('0x44')]+'%'};return _0x4f15da;})});}_0x287822=_['merge']({},_0x287822,_0x2ac0b8['options']);return _0x332e83[_0xb5be('0x8c')](_0x287822);}})[_0xb5be('0x2b')](function(_0x34bb91){if(_0x34bb91){_0x39c4a2=_0x34bb91[_0xb5be('0x4e')];if(!_0x2ac0b8[_0xb5be('0x39')][_0xb5be('0x5c')](_0xb5be('0x3f'))){_0x287822['limit']=qs[_0xb5be('0x22')](_0x2ac0b8['query'][_0xb5be('0x22')]);_0x287822[_0xb5be('0x21')]=qs['offset'](_0x2ac0b8[_0xb5be('0x39')][_0xb5be('0x21')]);}return _0x332e83['getAgents'](_0x287822);}})[_0xb5be('0x2b')](function(_0x2a3505){if(_0x2a3505){return _0x2a3505?{'count':_0x39c4a2,'rows':_0x2a3505}:null;}})[_0xb5be('0x2b')](respondWithResult(_0x516f2,null))[_0xb5be('0x4b')](handleError(_0x516f2,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 562c8c1..30f9184 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 _0x4097=['save','update','emit','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x4a604c,_0x5438ce){var _0x2ac851=function(_0x558b1c){while(--_0x558b1c){_0x4a604c['push'](_0x4a604c['shift']());}};_0x2ac851(++_0x5438ce);}(_0x4097,0xb2));var _0x7409=function(_0x997430,_0x5cd138){_0x997430=_0x997430-0x0;var _0x594b35=_0x4097[_0x997430];return _0x594b35;};'use strict';var EventEmitter=require(_0x7409('0x0'));var MailQueue=require(_0x7409('0x1'))['db'][_0x7409('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7409('0x3')](0x0);var events={'afterCreate':_0x7409('0x4'),'afterUpdate':_0x7409('0x5'),'afterDestroy':'remove'};function emitEvent(_0x231e61){return function(_0x2738ef,_0x56bf52,_0x4f0037){MailQueueEvents[_0x7409('0x6')](_0x231e61+':'+_0x2738ef['id'],_0x2738ef);MailQueueEvents['emit'](_0x231e61,_0x2738ef);_0x4f0037(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xd073=['events','../../mysqldb','MailQueue','setMaxListeners','update','emit','exports'];(function(_0x101bcc,_0x11daf2){var _0x42a7b4=function(_0x5075c1){while(--_0x5075c1){_0x101bcc['push'](_0x101bcc['shift']());}};_0x42a7b4(++_0x11daf2);}(_0xd073,0x93));var _0x3d07=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd073[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x3d07('0x0'));var MailQueue=require(_0x3d07('0x1'))['db'][_0x3d07('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x3d07('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d07('0x4'),'afterDestroy':'remove'};function emitEvent(_0x17760c){return function(_0x2ed05a,_0x53ae8c,_0x1e2a7d){MailQueueEvents[_0x3d07('0x5')](_0x17760c+':'+_0x2ed05a['id'],_0x2ed05a);MailQueueEvents['emit'](_0x17760c,_0x2ed05a);_0x1e2a7d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x3d07('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 87d512e..5135636 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 _0x5c52=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x5c52,0x157));var _0x25c5=function(_0x579456,_0x412b36){_0x579456=_0x579456-0x0;var _0x5ea592=_0x5c52[_0x579456];return _0x5ea592;};'use strict';var _=require(_0x25c5('0x0'));var util=require(_0x25c5('0x1'));var logger=require(_0x25c5('0x2'))('api');var moment=require(_0x25c5('0x3'));var BPromise=require(_0x25c5('0x4'));var rp=require(_0x25c5('0x5'));var fs=require('fs');var path=require(_0x25c5('0x6'));var rimraf=require(_0x25c5('0x7'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x5c97e5,_0x26cdaa){return _0x5c97e5[_0x25c5('0x8')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x251e=['rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','moment','bluebird','request-promise','path'];(function(_0x28836b,_0x389433){var _0x51f3f8=function(_0x503226){while(--_0x503226){_0x28836b['push'](_0x28836b['shift']());}};_0x51f3f8(++_0x389433);}(_0x251e,0x7f));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe251('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe251('0x1'));var BPromise=require(_0xe251('0x2'));var rp=require(_0xe251('0x3'));var fs=require('fs');var path=require(_0xe251('0x4'));var rimraf=require(_0xe251('0x5'));var config=require('../../config/environment');var attributes=require(_0xe251('0x6'));module[_0xe251('0x7')]=function(_0x246ff3,_0x1fffbb){return _0x246ff3[_0xe251('0x8')](_0xe251('0x9'),attributes,{'tableName':_0xe251('0xa'),'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 b1fe4f4..7e5c7c6 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 _0x28bc=['ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','MailQueue,\x20%s,\x20%s','message','error','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','map','model','ShowMailQueue','find','raw','where','lodash','util','moment','bluebird','randomstring'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x28bc,0x79));var _0xc28b=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x28bc[_0x5e6cb8];return _0x3faeb3;};'use strict';var _=require(_0xc28b('0x0'));var util=require(_0xc28b('0x1'));var moment=require(_0xc28b('0x2'));var BPromise=require(_0xc28b('0x3'));var rs=require(_0xc28b('0x4'));var fs=require('fs');var Redis=require(_0xc28b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc28b('0x6'));var logger=require(_0xc28b('0x7'))(_0xc28b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc28b('0x9')]['http']({'port':0x232a});config[_0xc28b('0xa')]=_[_0xc28b('0xb')](config[_0xc28b('0xa')],{'host':_0xc28b('0xc'),'port':0x18eb});var socket=require(_0xc28b('0xd'))(new Redis(config[_0xc28b('0xa')]));require(_0xc28b('0xe'))[_0xc28b('0xf')](socket);function respondWithRpcPromise(_0x5c54e8,_0x12c8df,_0x3d594a){return new BPromise(function(_0x13f2e4,_0x25be93){return client[_0xc28b('0x10')](_0x5c54e8,_0x3d594a)[_0xc28b('0x11')](function(_0xd20d95){logger[_0xc28b('0x12')]('MailQueue,\x20%s,\x20%s',_0x12c8df,_0xc28b('0x13'));logger[_0xc28b('0x14')](_0xc28b('0x15'),_0x12c8df,'request\x20sent',JSON[_0xc28b('0x16')](_0xd20d95));if(_0xd20d95['error']){if(_0xd20d95['error'][_0xc28b('0x17')]===0x1f4){logger['error'](_0xc28b('0x18'),_0x12c8df,_0xd20d95['error'][_0xc28b('0x19')]);return _0x25be93(_0xd20d95[_0xc28b('0x1a')][_0xc28b('0x19')]);}logger[_0xc28b('0x1a')]('MailQueue,\x20%s,\x20%s',_0x12c8df,_0xd20d95[_0xc28b('0x1a')]['message']);return _0x13f2e4(_0xd20d95[_0xc28b('0x1a')]['message']);}else{logger[_0xc28b('0x12')](_0xc28b('0x18'),_0x12c8df,_0xc28b('0x13'));_0x13f2e4(_0xd20d95[_0xc28b('0x1b')][_0xc28b('0x19')]);}})[_0xc28b('0x1c')](function(_0x443ed3){logger[_0xc28b('0x1a')]('MailQueue,\x20%s,\x20%s',_0x12c8df,_0x443ed3);_0x25be93(_0x443ed3);});});}exports[_0xc28b('0x1d')]=function(_0xcb8a97){var _0x293735=this;return new Promise(function(_0x59c15b,_0x270c5e){return db[_0xc28b('0x1e')][_0xc28b('0x1f')]({'raw':_0xcb8a97[_0xc28b('0x20')]?_0xcb8a97[_0xc28b('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xcb8a97[_0xc28b('0x20')]?_0xcb8a97[_0xc28b('0x20')]['where']||null:null,'attributes':_0xcb8a97[_0xc28b('0x20')]?_0xcb8a97[_0xc28b('0x20')][_0xc28b('0x21')]||null:null,'limit':_0xcb8a97[_0xc28b('0x20')]?_0xcb8a97[_0xc28b('0x20')][_0xc28b('0x22')]||null:null,'include':_0xcb8a97[_0xc28b('0x20')]?_0xcb8a97[_0xc28b('0x20')][_0xc28b('0x23')]?_[_0xc28b('0x24')](_0xcb8a97[_0xc28b('0x20')][_0xc28b('0x23')],function(_0x1a1365){return{'model':db[_0x1a1365[_0xc28b('0x25')]],'as':_0x1a1365['as'],'attributes':_0x1a1365[_0xc28b('0x21')],'include':_0x1a1365[_0xc28b('0x23')]?_[_0xc28b('0x24')](_0x1a1365[_0xc28b('0x23')],function(_0x1bf1e1){return{'model':db[_0x1bf1e1[_0xc28b('0x25')]],'as':_0x1bf1e1['as'],'attributes':_0x1bf1e1[_0xc28b('0x21')],'include':_0x1bf1e1[_0xc28b('0x23')]?_[_0xc28b('0x24')](_0x1bf1e1[_0xc28b('0x23')],function(_0x3ae598){return{'model':db[_0x3ae598[_0xc28b('0x25')]],'as':_0x3ae598['as'],'attributes':_0x3ae598[_0xc28b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc28b('0x11')](function(_0x13ca00){logger['info'](_0xc28b('0x1d'),_0xcb8a97);logger[_0xc28b('0x14')]('GetMailQueue',_0xcb8a97,JSON[_0xc28b('0x16')](_0x13ca00));_0x59c15b(_0x13ca00);})[_0xc28b('0x1c')](function(_0x75cd37){logger['error'](_0xc28b('0x1d'),_0x75cd37[_0xc28b('0x19')],_0xcb8a97);_0x270c5e(_0x293735[_0xc28b('0x1a')](0x1f4,_0x75cd37[_0xc28b('0x19')]));});});};exports[_0xc28b('0x26')]=function(_0x572939){var _0x372868=this;return new Promise(function(_0x11f89b,_0x3f5b68){return db[_0xc28b('0x1e')][_0xc28b('0x27')]({'raw':_0x572939[_0xc28b('0x20')]?_0x572939[_0xc28b('0x20')][_0xc28b('0x28')]===undefined?!![]:![]:!![],'where':_0x572939[_0xc28b('0x20')]?_0x572939['options'][_0xc28b('0x29')]||null:null,'attributes':_0x572939['options']?_0x572939[_0xc28b('0x20')][_0xc28b('0x21')]||null:null,'include':_0x572939['options']?_0x572939[_0xc28b('0x20')][_0xc28b('0x23')]?_['map'](_0x572939[_0xc28b('0x20')][_0xc28b('0x23')],function(_0x1b4eef){return{'model':db[_0x1b4eef[_0xc28b('0x25')]],'as':_0x1b4eef['as'],'attributes':_0x1b4eef[_0xc28b('0x21')],'include':_0x1b4eef['include']?_[_0xc28b('0x24')](_0x1b4eef[_0xc28b('0x23')],function(_0x473004){return{'model':db[_0x473004[_0xc28b('0x25')]],'as':_0x473004['as'],'attributes':_0x473004['attributes'],'include':_0x473004[_0xc28b('0x23')]?_['map'](_0x473004[_0xc28b('0x23')],function(_0x129f42){return{'model':db[_0x129f42[_0xc28b('0x25')]],'as':_0x129f42['as'],'attributes':_0x129f42[_0xc28b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc28b('0x11')](function(_0x23fef9){logger['info'](_0xc28b('0x26'),_0x572939);logger[_0xc28b('0x14')](_0xc28b('0x26'),_0x572939,JSON[_0xc28b('0x16')](_0x23fef9));_0x11f89b(_0x23fef9);})['catch'](function(_0x57574f){logger[_0xc28b('0x1a')](_0xc28b('0x26'),_0x57574f[_0xc28b('0x19')],_0x572939);_0x3f5b68(_0x372868[_0xc28b('0x1a')](0x1f4,_0x57574f['message']));});});}; \ No newline at end of file +var _0x89e8=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','attributes','limit','include','map','model','then','ShowMailQueue','find','debug','lodash','util','moment','bluebird'];(function(_0x10f060,_0x312a7b){var _0x512722=function(_0x2b0ce0){while(--_0x2b0ce0){_0x10f060['push'](_0x10f060['shift']());}};_0x512722(++_0x312a7b);}(_0x89e8,0x74));var _0x889e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x89e8[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});config['redis']=_[_0x889e('0xb')](config['redis'],{'host':_0x889e('0xc'),'port':0x18eb});var socket=require(_0x889e('0xd'))(new Redis(config[_0x889e('0xe')]));require('./mailQueue.socket')[_0x889e('0xf')](socket);function respondWithRpcPromise(_0x222865,_0x2ff8d6,_0x180426){return new BPromise(function(_0x5b2560,_0x470089){return client[_0x889e('0x10')](_0x222865,_0x180426)['then'](function(_0x35e2fc){logger[_0x889e('0x11')](_0x889e('0x12'),_0x2ff8d6,_0x889e('0x13'));logger['debug'](_0x889e('0x14'),_0x2ff8d6,_0x889e('0x13'),JSON[_0x889e('0x15')](_0x35e2fc));if(_0x35e2fc['error']){if(_0x35e2fc[_0x889e('0x16')][_0x889e('0x17')]===0x1f4){logger[_0x889e('0x16')](_0x889e('0x12'),_0x2ff8d6,_0x35e2fc[_0x889e('0x16')]['message']);return _0x470089(_0x35e2fc['error'][_0x889e('0x18')]);}logger[_0x889e('0x16')](_0x889e('0x12'),_0x2ff8d6,_0x35e2fc[_0x889e('0x16')]['message']);return _0x5b2560(_0x35e2fc[_0x889e('0x16')][_0x889e('0x18')]);}else{logger['info'](_0x889e('0x12'),_0x2ff8d6,'request\x20sent');_0x5b2560(_0x35e2fc[_0x889e('0x19')][_0x889e('0x18')]);}})[_0x889e('0x1a')](function(_0x1bd9ef){logger[_0x889e('0x16')]('MailQueue,\x20%s,\x20%s',_0x2ff8d6,_0x1bd9ef);_0x470089(_0x1bd9ef);});});}exports[_0x889e('0x1b')]=function(_0x17f559){var _0x4c14ed=this;return new Promise(function(_0x3c8889,_0x11abba){return db[_0x889e('0x1c')]['findAll']({'raw':_0x17f559[_0x889e('0x1d')]?_0x17f559[_0x889e('0x1d')][_0x889e('0x1e')]===undefined?!![]:![]:!![],'where':_0x17f559[_0x889e('0x1d')]?_0x17f559['options']['where']||null:null,'attributes':_0x17f559[_0x889e('0x1d')]?_0x17f559[_0x889e('0x1d')][_0x889e('0x1f')]||null:null,'limit':_0x17f559['options']?_0x17f559[_0x889e('0x1d')][_0x889e('0x20')]||null:null,'include':_0x17f559[_0x889e('0x1d')]?_0x17f559['options'][_0x889e('0x21')]?_['map'](_0x17f559[_0x889e('0x1d')][_0x889e('0x21')],function(_0x2fc97a){return{'model':db[_0x2fc97a['model']],'as':_0x2fc97a['as'],'attributes':_0x2fc97a[_0x889e('0x1f')],'include':_0x2fc97a['include']?_[_0x889e('0x22')](_0x2fc97a[_0x889e('0x21')],function(_0x2a836e){return{'model':db[_0x2a836e[_0x889e('0x23')]],'as':_0x2a836e['as'],'attributes':_0x2a836e['attributes'],'include':_0x2a836e['include']?_[_0x889e('0x22')](_0x2a836e['include'],function(_0x349eab){return{'model':db[_0x349eab[_0x889e('0x23')]],'as':_0x349eab['as'],'attributes':_0x349eab[_0x889e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x889e('0x24')](function(_0x2553ff){logger['info']('GetMailQueue',_0x17f559);logger['debug']('GetMailQueue',_0x17f559,JSON[_0x889e('0x15')](_0x2553ff));_0x3c8889(_0x2553ff);})[_0x889e('0x1a')](function(_0x3eeb7d){logger[_0x889e('0x16')]('GetMailQueue',_0x3eeb7d['message'],_0x17f559);_0x11abba(_0x4c14ed[_0x889e('0x16')](0x1f4,_0x3eeb7d[_0x889e('0x18')]));});});};exports[_0x889e('0x25')]=function(_0x7e99e9){var _0x43726b=this;return new Promise(function(_0x3dd7d2,_0x3c9ccf){return db['MailQueue'][_0x889e('0x26')]({'raw':_0x7e99e9['options']?_0x7e99e9['options'][_0x889e('0x1e')]===undefined?!![]:![]:!![],'where':_0x7e99e9[_0x889e('0x1d')]?_0x7e99e9[_0x889e('0x1d')]['where']||null:null,'attributes':_0x7e99e9[_0x889e('0x1d')]?_0x7e99e9['options'][_0x889e('0x1f')]||null:null,'include':_0x7e99e9[_0x889e('0x1d')]?_0x7e99e9[_0x889e('0x1d')][_0x889e('0x21')]?_[_0x889e('0x22')](_0x7e99e9[_0x889e('0x1d')][_0x889e('0x21')],function(_0x4ede0c){return{'model':db[_0x4ede0c[_0x889e('0x23')]],'as':_0x4ede0c['as'],'attributes':_0x4ede0c['attributes'],'include':_0x4ede0c[_0x889e('0x21')]?_['map'](_0x4ede0c[_0x889e('0x21')],function(_0x834f97){return{'model':db[_0x834f97[_0x889e('0x23')]],'as':_0x834f97['as'],'attributes':_0x834f97[_0x889e('0x1f')],'include':_0x834f97[_0x889e('0x21')]?_[_0x889e('0x22')](_0x834f97['include'],function(_0x20110e){return{'model':db[_0x20110e[_0x889e('0x23')]],'as':_0x20110e['as'],'attributes':_0x20110e[_0x889e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x889e('0x24')](function(_0x1aefce){logger[_0x889e('0x11')](_0x889e('0x25'),_0x7e99e9);logger[_0x889e('0x27')](_0x889e('0x25'),_0x7e99e9,JSON[_0x889e('0x15')](_0x1aefce));_0x3dd7d2(_0x1aefce);})[_0x889e('0x1a')](function(_0x257d62){logger['error']('ShowMailQueue',_0x257d62[_0x889e('0x18')],_0x7e99e9);_0x3c9ccf(_0x43726b[_0x889e('0x16')](0x1f4,_0x257d62[_0x889e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 5900f85..93484b5 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 _0xa66e=['save','remove','update','emit','removeListener','length','./mailQueue.events'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xa66e,0xf4));var _0xea66=function(_0x1a5719,_0x29e7e7){_0x1a5719=_0x1a5719-0x0;var _0x20978d=_0xa66e[_0x1a5719];return _0x20978d;};'use strict';var MailQueueEvents=require(_0xea66('0x0'));var events=[_0xea66('0x1'),_0xea66('0x2'),_0xea66('0x3')];function createListener(_0x345961,_0x6e8eca){return function(_0x586e35){_0x6e8eca[_0xea66('0x4')](_0x345961,_0x586e35);};}function removeListener(_0x38638b,_0xc7fc47){return function(){MailQueueEvents[_0xea66('0x5')](_0x38638b,_0xc7fc47);};}exports['register']=function(_0x256407){for(var _0x20a440=0x0,_0x5c3566=events[_0xea66('0x6')];_0x20a440<_0x5c3566;_0x20a440++){var _0x19ce28=events[_0x20a440];var _0x240543=createListener('mailQueue:'+_0x19ce28,_0x256407);MailQueueEvents['on'](_0x19ce28,_0x240543);}}; \ No newline at end of file +var _0xbdb1=['emit','removeListener','register','length','mailQueue:','./mailQueue.events','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbdb1,0x6d));var _0x1bdb=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xbdb1[_0x26f702];return _0x11417d;};'use strict';var MailQueueEvents=require(_0x1bdb('0x0'));var events=[_0x1bdb('0x1'),'remove',_0x1bdb('0x2')];function createListener(_0x31e405,_0x2b4796){return function(_0x4b67b4){_0x2b4796[_0x1bdb('0x3')](_0x31e405,_0x4b67b4);};}function removeListener(_0x23e51e,_0x412756){return function(){MailQueueEvents[_0x1bdb('0x4')](_0x23e51e,_0x412756);};}exports[_0x1bdb('0x5')]=function(_0x52ba35){for(var _0x47c158=0x0,_0x32f0d8=events[_0x1bdb('0x6')];_0x47c158<_0x32f0d8;_0x47c158++){var _0x4256c4=events[_0x47c158];var _0x164764=createListener(_0x1bdb('0x7')+_0x4256c4,_0x52ba35);MailQueueEvents['on'](_0x4256c4,_0x164764);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f292788..b0d7e80 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 _0xe124=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x8fa4bc,_0x5cd2af){var _0x35b6a7=function(_0x357c25){while(--_0x357c25){_0x8fa4bc['push'](_0x8fa4bc['shift']());}};_0x35b6a7(++_0x5cd2af);}(_0xe124,0xc0));var _0x4e12=function(_0x3aba3c,_0x296b04){_0x3aba3c=_0x3aba3c-0x0;var _0x552311=_0xe124[_0x3aba3c];return _0x552311;};'use strict';var multer=require(_0x4e12('0x0'));var util=require(_0x4e12('0x1'));var path=require(_0x4e12('0x2'));var timeout=require(_0x4e12('0x3'));var express=require(_0x4e12('0x4'));var router=express['Router']();var fs_extra=require(_0x4e12('0x5'));var auth=require(_0x4e12('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x4e12('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4e12('0x7')](_0x4e12('0x8'),auth['isAuthenticated'](),controller[_0x4e12('0x9')]);router['get'](_0x4e12('0xa'),auth[_0x4e12('0xb')](),controller[_0x4e12('0xc')]);router[_0x4e12('0xd')]('/',auth[_0x4e12('0xb')](),controller[_0x4e12('0xe')]);router[_0x4e12('0xf')]('/:id',auth[_0x4e12('0xb')](),controller[_0x4e12('0x10')]);router[_0x4e12('0x11')](_0x4e12('0xa'),auth['isAuthenticated'](),controller[_0x4e12('0x12')]);module['exports']=router; \ No newline at end of file +var _0x898e=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x374ba3,_0x4af646){var _0x51d852=function(_0x131009){while(--_0x131009){_0x374ba3['push'](_0x374ba3['shift']());}};_0x51d852(++_0x4af646);}(_0x898e,0x1ea));var _0xe898=function(_0x2b5eab,_0x25d917){_0x2b5eab=_0x2b5eab-0x0;var _0x251c27=_0x898e[_0x2b5eab];return _0x251c27;};'use strict';var multer=require('multer');var util=require(_0xe898('0x0'));var path=require('path');var timeout=require(_0xe898('0x1'));var express=require(_0xe898('0x2'));var router=express[_0xe898('0x3')]();var fs_extra=require(_0xe898('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe898('0x5'));var config=require(_0xe898('0x6'));var controller=require('./mailQueueReport.controller');router[_0xe898('0x7')]('/',auth[_0xe898('0x8')](),controller['index']);router[_0xe898('0x7')](_0xe898('0x9'),auth[_0xe898('0x8')](),controller[_0xe898('0xa')]);router[_0xe898('0x7')]('/:id',auth[_0xe898('0x8')](),controller[_0xe898('0xb')]);router['post']('/',auth[_0xe898('0x8')](),controller[_0xe898('0xc')]);router[_0xe898('0xd')](_0xe898('0xe'),auth[_0xe898('0x8')](),controller[_0xe898('0xf')]);router[_0xe898('0x10')](_0xe898('0xe'),auth[_0xe898('0x8')](),controller[_0xe898('0x11')]);module[_0xe898('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index abf67c5..39276c3 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 _0x0d1e=['DATE','moment','sequelize','exports','STRING'];(function(_0x314ccb,_0x38886e){var _0x257b48=function(_0x381cf7){while(--_0x381cf7){_0x314ccb['push'](_0x314ccb['shift']());}};_0x257b48(++_0x38886e);}(_0x0d1e,0xab));var _0xe0d1=function(_0x446e42,_0x5b7ee0){_0x446e42=_0x446e42-0x0;var _0x248ba9=_0x0d1e[_0x446e42];return _0x248ba9;};'use strict';var moment=require(_0xe0d1('0x0'));var Sequelize=require(_0xe0d1('0x1'));module[_0xe0d1('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe0d1('0x3')]},'joinAt':{'type':Sequelize[_0xe0d1('0x4')]},'leaveAt':{'type':Sequelize[_0xe0d1('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe0d1('0x4')]},'reason':{'type':Sequelize[_0xe0d1('0x3')]}}; \ No newline at end of file +var _0x17f0=['moment','sequelize','exports','STRING','DATE'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x17f0,0x91));var _0x017f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x17f0[_0x413feb];return _0x40ee88;};'use strict';var moment=require(_0x017f('0x0'));var Sequelize=require(_0x017f('0x1'));module[_0x017f('0x2')]={'uniqueid':{'type':Sequelize[_0x017f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x017f('0x3')]},'joinAt':{'type':Sequelize[_0x017f('0x4')]},'leaveAt':{'type':Sequelize[_0x017f('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x017f('0x4')]},'reason':{'type':Sequelize[_0x017f('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 99c3d8f..02b737e 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 _0x2a07=['index','map','MailQueueReport','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','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2a07,0x74));var _0x72a0=function(_0x5a9776,_0x4b5ab3){_0x5a9776=_0x5a9776-0x0;var _0x454edb=_0x2a07[_0x5a9776];return _0x454edb;};'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['MailQueueReport'][_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['MailQueueReport']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));};exports[_0x72a0('0x4f')]=function(_0x50c8d7,_0xc0f323){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0xc0f323,null))[_0x72a0('0x46')](handleError(_0xc0f323,null));}; \ No newline at end of file +var _0x7046=['map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','MailQueueReport','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send'];(function(_0x214d26,_0x3d8fe1){var _0x2190bc=function(_0x5098a9){while(--_0x5098a9){_0x214d26['push'](_0x214d26['shift']());}};_0x2190bc(++_0x3d8fe1);}(_0x7046,0x144));var _0x6704=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7046[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6704('0x0'));var rimraf=require(_0x6704('0x1'));var zipdir=require(_0x6704('0x2'));var jsonpatch=require(_0x6704('0x3'));var rp=require('request-promise');var moment=require(_0x6704('0x4'));var BPromise=require(_0x6704('0x5'));var Mustache=require(_0x6704('0x6'));var util=require('util');var path=require(_0x6704('0x7'));var sox=require(_0x6704('0x8'));var csv=require(_0x6704('0x9'));var ejs=require(_0x6704('0xa'));var fs=require('fs');var fs_extra=require(_0x6704('0xb'));var _=require('lodash');var squel=require(_0x6704('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6704('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6704('0xe'));var Redis=require(_0x6704('0xf'));var authService=require(_0x6704('0x10'));var qs=require(_0x6704('0x11'));var as=require(_0x6704('0x12'));var hardwareService=require(_0x6704('0x13'));var logger=require(_0x6704('0x14'))(_0x6704('0x15'));var utils=require('../../config/utils');var config=require(_0x6704('0x16'));var licenseUtil=require(_0x6704('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2feb52,_0x1db0ad){_0x1db0ad=_0x1db0ad||0xcc;return function(_0x327e03){if(_0x327e03){return _0x2feb52[_0x6704('0x18')](_0x1db0ad);}return _0x2feb52[_0x6704('0x19')](_0x1db0ad)[_0x6704('0x1a')]();};}function respondWithResult(_0x17b9bc,_0x2da4df){_0x2da4df=_0x2da4df||0xc8;return function(_0x24ece3){if(_0x24ece3){return _0x17b9bc['status'](_0x2da4df)[_0x6704('0x1b')](_0x24ece3);}};}function respondWithFilteredResult(_0x1752bc,_0x35082b){return function(_0x4fef80){if(_0x4fef80){var _0x11782a=typeof _0x35082b[_0x6704('0x1c')]===_0x6704('0x1d')&&typeof _0x35082b[_0x6704('0x1e')]===_0x6704('0x1d');var _0x5adb35=_0x4fef80[_0x6704('0x1f')];var _0x31d732=_0x11782a?0x0:_0x35082b[_0x6704('0x1c')];var _0xe49450=_0x11782a?_0x4fef80[_0x6704('0x1f')]:_0x35082b['offset']+_0x35082b[_0x6704('0x1e')];var _0x2f6eae;if(_0xe49450>=_0x5adb35){_0xe49450=_0x5adb35;_0x2f6eae=0xc8;}else{_0x2f6eae=0xce;}_0x1752bc[_0x6704('0x19')](_0x2f6eae);return _0x1752bc[_0x6704('0x20')](_0x6704('0x21'),_0x31d732+'-'+_0xe49450+'/'+_0x5adb35)[_0x6704('0x1b')](_0x4fef80);}return null;};}function patchUpdates(_0x42b27f){return function(_0x5bb33e){try{jsonpatch[_0x6704('0x22')](_0x5bb33e,_0x42b27f,!![]);}catch(_0xf6d433){return BPromise[_0x6704('0x23')](_0xf6d433);}return _0x5bb33e['save']();};}function saveUpdates(_0x4dca58,_0x48d829){return function(_0x3e183b){if(_0x3e183b){return _0x3e183b[_0x6704('0x24')](_0x4dca58)[_0x6704('0x25')](function(_0x41f89e){return _0x41f89e;});}return null;};}function removeEntity(_0x56d1e1,_0xf2c459){return function(_0xabb97a){if(_0xabb97a){return _0xabb97a[_0x6704('0x26')]()[_0x6704('0x25')](function(){_0x56d1e1[_0x6704('0x19')](0xcc)[_0x6704('0x1a')]();});}};}function handleEntityNotFound(_0x2acafd,_0x5d50ff){return function(_0x896227){if(!_0x896227){_0x2acafd[_0x6704('0x18')](0x194);}return _0x896227;};}function handleError(_0x36bea4,_0x1bdfee){_0x1bdfee=_0x1bdfee||0x1f4;return function(_0x118d93){logger['error'](_0x118d93['stack']);if(_0x118d93[_0x6704('0x27')]){delete _0x118d93[_0x6704('0x27')];}_0x36bea4[_0x6704('0x19')](_0x1bdfee)[_0x6704('0x28')](_0x118d93);};}exports['index']=function(_0x1def46,_0x18cd98){var _0x5c229d={},_0x588814={},_0x16e749={'count':0x0,'rows':[]};var _0x5363c9=_[_0x6704('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x7e193e){return{'name':_0x7e193e[_0x6704('0x2a')],'type':_0x7e193e[_0x6704('0x2b')]['key']};});_0x588814[_0x6704('0x2c')]=_[_0x6704('0x29')](_0x5363c9,_0x6704('0x27'));_0x588814[_0x6704('0x2d')]=_[_0x6704('0x2e')](_0x1def46[_0x6704('0x2d')]);_0x588814[_0x6704('0x2f')]=_[_0x6704('0x30')](_0x588814[_0x6704('0x2c')],_0x588814[_0x6704('0x2d')]);_0x5c229d[_0x6704('0x31')]=_[_0x6704('0x30')](_0x588814[_0x6704('0x2c')],qs[_0x6704('0x32')](_0x1def46[_0x6704('0x2d')][_0x6704('0x32')]));_0x5c229d[_0x6704('0x31')]=_0x5c229d[_0x6704('0x31')][_0x6704('0x33')]?_0x5c229d[_0x6704('0x31')]:_0x588814[_0x6704('0x2c')];if(!_0x1def46[_0x6704('0x2d')][_0x6704('0x34')](_0x6704('0x35'))){_0x5c229d[_0x6704('0x1e')]=qs['limit'](_0x1def46['query']['limit']);_0x5c229d[_0x6704('0x1c')]=qs[_0x6704('0x1c')](_0x1def46[_0x6704('0x2d')]['offset']);}_0x5c229d[_0x6704('0x36')]=qs['sort'](_0x1def46[_0x6704('0x2d')][_0x6704('0x37')]);_0x5c229d[_0x6704('0x38')]=qs[_0x6704('0x2f')](_[_0x6704('0x39')](_0x1def46[_0x6704('0x2d')],_0x588814[_0x6704('0x2f')]),_0x5363c9);if(_0x1def46[_0x6704('0x2d')]['filter']){_0x5c229d['where']=_[_0x6704('0x3a')](_0x5c229d[_0x6704('0x38')],{'$or':_['map'](_0x5363c9,function(_0x48f3c2){if(_0x48f3c2[_0x6704('0x2b')]!=='VIRTUAL'){var _0xd7e27b={};_0xd7e27b[_0x48f3c2[_0x6704('0x27')]]={'$like':'%'+_0x1def46[_0x6704('0x2d')][_0x6704('0x3b')]+'%'};return _0xd7e27b;}})});}_0x5c229d=_['merge']({},_0x5c229d,_0x1def46[_0x6704('0x3c')]);var _0x1ee017={'where':_0x5c229d['where']};return db[_0x6704('0x3d')]['count'](_0x1ee017)[_0x6704('0x25')](function(_0x714c83){_0x16e749[_0x6704('0x1f')]=_0x714c83;if(_0x1def46['query'][_0x6704('0x3e')]){_0x5c229d[_0x6704('0x3f')]=[{'all':!![]}];}return db[_0x6704('0x3d')]['findAll'](_0x5c229d);})[_0x6704('0x25')](function(_0x444d36){_0x16e749[_0x6704('0x40')]=_0x444d36;return _0x16e749;})[_0x6704('0x25')](respondWithFilteredResult(_0x18cd98,_0x5c229d))['catch'](handleError(_0x18cd98,null));};exports[_0x6704('0x41')]=function(_0x50cc74,_0x2defda){var _0x45a217={'raw':!![],'where':{'id':_0x50cc74[_0x6704('0x42')]['id']}},_0x10fc26={};_0x10fc26['model']=_['keys'](db['MailQueueReport'][_0x6704('0x43')]);_0x10fc26['query']=_[_0x6704('0x2e')](_0x50cc74['query']);_0x10fc26[_0x6704('0x2f')]=_[_0x6704('0x30')](_0x10fc26['model'],_0x10fc26[_0x6704('0x2d')]);_0x45a217[_0x6704('0x31')]=_[_0x6704('0x30')](_0x10fc26[_0x6704('0x2c')],qs[_0x6704('0x32')](_0x50cc74['query'][_0x6704('0x32')]));_0x45a217[_0x6704('0x31')]=_0x45a217[_0x6704('0x31')][_0x6704('0x33')]?_0x45a217[_0x6704('0x31')]:_0x10fc26['model'];if(_0x50cc74[_0x6704('0x2d')]['includeAll']){_0x45a217[_0x6704('0x3f')]=[{'all':!![]}];}_0x45a217=_[_0x6704('0x3a')]({},_0x45a217,_0x50cc74[_0x6704('0x3c')]);return db[_0x6704('0x3d')][_0x6704('0x44')](_0x45a217)['then'](handleEntityNotFound(_0x2defda,null))[_0x6704('0x25')](respondWithResult(_0x2defda,null))[_0x6704('0x45')](handleError(_0x2defda,null));};exports['create']=function(_0x1b9d36,_0x17a98a){return db[_0x6704('0x3d')][_0x6704('0x46')](_0x1b9d36[_0x6704('0x47')],{})[_0x6704('0x25')](respondWithResult(_0x17a98a,0xc9))['catch'](handleError(_0x17a98a,null));};exports[_0x6704('0x24')]=function(_0x5b0713,_0xb73442){if(_0x5b0713['body']['id']){delete _0x5b0713[_0x6704('0x47')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x5b0713[_0x6704('0x42')]['id']}})[_0x6704('0x25')](handleEntityNotFound(_0xb73442,null))[_0x6704('0x25')](saveUpdates(_0x5b0713[_0x6704('0x47')],null))[_0x6704('0x25')](respondWithResult(_0xb73442,null))[_0x6704('0x45')](handleError(_0xb73442,null));};exports['destroy']=function(_0x5b9e28,_0x254cf7){return db[_0x6704('0x3d')][_0x6704('0x44')]({'where':{'id':_0x5b9e28[_0x6704('0x42')]['id']}})[_0x6704('0x25')](handleEntityNotFound(_0x254cf7,null))[_0x6704('0x25')](removeEntity(_0x254cf7,null))[_0x6704('0x45')](handleError(_0x254cf7,null));};exports[_0x6704('0x48')]=function(_0x1fcfb0,_0x44e4a5){return db[_0x6704('0x3d')][_0x6704('0x48')]()[_0x6704('0x25')](respondWithResult(_0x44e4a5,null))[_0x6704('0x45')](handleError(_0x44e4a5,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b19b436..6ecb294 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 _0xbbd7=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','request-promise','path'];(function(_0x21147d,_0x30e40a){var _0x281b65=function(_0x1761c3){while(--_0x1761c3){_0x21147d['push'](_0x21147d['shift']());}};_0x281b65(++_0x30e40a);}(_0xbbd7,0x8c));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7bbd('0x0'));var logger=require(_0x7bbd('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7bbd('0x2'));var fs=require('fs');var path=require(_0x7bbd('0x3'));var rimraf=require(_0x7bbd('0x4'));var config=require(_0x7bbd('0x5'));var attributes=require(_0x7bbd('0x6'));module[_0x7bbd('0x7')]=function(_0x46e0a5,_0x530aa9){return _0x46e0a5[_0x7bbd('0x8')](_0x7bbd('0x9'),attributes,{'tableName':_0x7bbd('0xa'),'paranoid':![],'indexes':[{'name':_0x7bbd('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x697f=['exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','./mailQueueReport.attributes'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x697f,0x13d));var _0xf697=function(_0x451a75,_0x196269){_0x451a75=_0x451a75-0x0;var _0x4fe769=_0x697f[_0x451a75];return _0x4fe769;};'use strict';var _=require(_0xf697('0x0'));var util=require(_0xf697('0x1'));var logger=require(_0xf697('0x2'))(_0xf697('0x3'));var moment=require(_0xf697('0x4'));var BPromise=require(_0xf697('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(_0xf697('0x6'));module[_0xf697('0x7')]=function(_0x3448b4,_0x492116){return _0x3448b4[_0xf697('0x8')](_0xf697('0x9'),attributes,{'tableName':_0xf697('0xa'),'paranoid':![],'indexes':[{'name':_0xf697('0xb'),'fields':[_0xf697('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 9442f1b..bda6770 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 _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(_0x1b31d0,_0x5b6aa2){var _0x209c6d=function(_0x45415e){while(--_0x45415e){_0x1b31d0['push'](_0x1b31d0['shift']());}};_0x209c6d(++_0x5b6aa2);}(_0xdb28,0x106));var _0x8db2=function(_0xb5744c,_0x260ee1){_0xb5744c=_0xb5744c-0x0;var _0x2b7824=_0xdb28[_0xb5744c];return _0x2b7824;};'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 +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x48a943,_0x4b1045){var _0x226b78=function(_0x4472a7){while(--_0x4472a7){_0x48a943['push'](_0x48a943['shift']());}};_0x226b78(++_0x4b1045);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'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')]('MailQueueReport,\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);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 1d066c3..43459e9 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x26cab7,_0x1ccfca){var _0x31ba06=function(_0x1ed04a){while(--_0x1ed04a){_0x26cab7['push'](_0x26cab7['shift']());}};_0x31ba06(++_0x1ccfca);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x37a505,_0x319129){var _0x5d094e=function(_0x5b78ea){while(--_0x5b78ea){_0x37a505['push'](_0x37a505['shift']());}};_0x5d094e(++_0x319129);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'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 0ac828b..9f10c15 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 _0x82c6=['STRING','BOOLEAN','INTEGER','INBOX','exports'];(function(_0x37c288,_0x4e5382){var _0x3bd1b5=function(_0x1515ab){while(--_0x1515ab){_0x37c288['push'](_0x37c288['shift']());}};_0x3bd1b5(++_0x4e5382);}(_0x82c6,0x1bc));var _0x682c=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x82c6[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x682c('0x0')]={'description':{'type':Sequelize[_0x682c('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x682c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x682c('0x1')]},'password':{'type':Sequelize[_0x682c('0x1')]},'port':{'type':Sequelize[_0x682c('0x3')]},'tls':{'type':Sequelize[_0x682c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x682c('0x1')],'defaultValue':_0x682c('0x4')},'connTimeout':{'type':Sequelize[_0x682c('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x682c('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x682c('0x1')]},'modernAuthentication':{'type':Sequelize[_0x682c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x529d=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x5d3ee2,_0x2c2db4){var _0x97aae3=function(_0x8c5355){while(--_0x8c5355){_0x5d3ee2['push'](_0x5d3ee2['shift']());}};_0x97aae3(++_0x2c2db4);}(_0x529d,0x177));var _0xd529=function(_0x3ba4a5,_0x4465e6){_0x3ba4a5=_0x3ba4a5-0x0;var _0x27b68f=_0x529d[_0x3ba4a5];return _0x27b68f;};'use strict';var Sequelize=require(_0xd529('0x0'));module[_0xd529('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd529('0x2')]},'authentication':{'type':Sequelize[_0xd529('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xd529('0x2')]},'password':{'type':Sequelize[_0xd529('0x2')]},'port':{'type':Sequelize[_0xd529('0x4')]},'tls':{'type':Sequelize[_0xd529('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xd529('0x5')},'connTimeout':{'type':Sequelize[_0xd529('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd529('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xd529('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 c4b37c2..9c71b66 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 _0xe6a3=['./mailServerIn.attributes','exports','define','MailServerIn','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe6a3,0x67));var _0x3e6a=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xe6a3[_0x2459fd];return _0x364cd2;};'use strict';var _=require(_0x3e6a('0x0'));var util=require('util');var logger=require(_0x3e6a('0x1'))(_0x3e6a('0x2'));var moment=require(_0x3e6a('0x3'));var BPromise=require('bluebird');var rp=require(_0x3e6a('0x4'));var fs=require('fs');var path=require(_0x3e6a('0x5'));var rimraf=require(_0x3e6a('0x6'));var config=require('../../config/environment');var attributes=require(_0x3e6a('0x7'));module[_0x3e6a('0x8')]=function(_0x1de1bb,_0xb21da0){return _0x1de1bb[_0x3e6a('0x9')](_0x3e6a('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4046=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4046,0x168));var _0x6404=function(_0x588d0e,_0x153af1){_0x588d0e=_0x588d0e-0x0;var _0x232fd6=_0x4046[_0x588d0e];return _0x232fd6;};'use strict';var _=require(_0x6404('0x0'));var util=require(_0x6404('0x1'));var logger=require(_0x6404('0x2'))(_0x6404('0x3'));var moment=require(_0x6404('0x4'));var BPromise=require('bluebird');var rp=require(_0x6404('0x5'));var fs=require('fs');var path=require(_0x6404('0x6'));var rimraf=require(_0x6404('0x7'));var config=require(_0x6404('0x8'));var attributes=require(_0x6404('0x9'));module['exports']=function(_0x1d871a,_0x43e600){return _0x1d871a[_0x6404('0xa')](_0x6404('0xb'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 513b71a..b8e09af 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 _0xde9d=['info','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x1d5b81,_0x2cb446){var _0x476dba=function(_0x547e51){while(--_0x547e51){_0x1d5b81['push'](_0x1d5b81['shift']());}};_0x476dba(++_0x2cb446);}(_0xde9d,0x156));var _0xdde9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xde9d[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xdde9('0x0'));var util=require(_0xdde9('0x1'));var moment=require(_0xdde9('0x2'));var BPromise=require(_0xdde9('0x3'));var rs=require(_0xdde9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdde9('0x5'))['db'];var utils=require(_0xdde9('0x6'));var logger=require(_0xdde9('0x7'))('rpc');var config=require(_0xdde9('0x8'));var jayson=require(_0xdde9('0x9'));var client=jayson[_0xdde9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x289ccb,_0x1431f0,_0x229168){return new BPromise(function(_0x3be8c1,_0x35268e){return client['request'](_0x289ccb,_0x229168)[_0xdde9('0xb')](function(_0x4fe44d){logger['info'](_0xdde9('0xc'),_0x1431f0,_0xdde9('0xd'));logger[_0xdde9('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x1431f0,_0xdde9('0xd'),JSON['stringify'](_0x4fe44d));if(_0x4fe44d['error']){if(_0x4fe44d[_0xdde9('0xf')][_0xdde9('0x10')]===0x1f4){logger[_0xdde9('0xf')]('MailServerIn,\x20%s,\x20%s',_0x1431f0,_0x4fe44d['error'][_0xdde9('0x11')]);return _0x35268e(_0x4fe44d[_0xdde9('0xf')]['message']);}logger['error'](_0xdde9('0xc'),_0x1431f0,_0x4fe44d[_0xdde9('0xf')]['message']);return _0x3be8c1(_0x4fe44d[_0xdde9('0xf')][_0xdde9('0x11')]);}else{logger[_0xdde9('0x12')]('MailServerIn,\x20%s,\x20%s',_0x1431f0,_0xdde9('0xd'));_0x3be8c1(_0x4fe44d['result']['message']);}})[_0xdde9('0x13')](function(_0x5c319d){logger['error']('MailServerIn,\x20%s,\x20%s',_0x1431f0,_0x5c319d);_0x35268e(_0x5c319d);});});}exports[_0xdde9('0x14')]=function(_0x2e0ed9){var _0x34259e=this;return new Promise(function(_0x2e4b89,_0x23dc91){return db[_0xdde9('0x15')][_0xdde9('0x16')]({'raw':_0x2e0ed9[_0xdde9('0x17')]?_0x2e0ed9[_0xdde9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2e0ed9['options']?_0x2e0ed9[_0xdde9('0x17')][_0xdde9('0x18')]||null:null,'attributes':_0x2e0ed9[_0xdde9('0x17')]?_0x2e0ed9[_0xdde9('0x17')][_0xdde9('0x19')]||null:null,'limit':_0x2e0ed9[_0xdde9('0x17')]?_0x2e0ed9[_0xdde9('0x17')]['limit']||null:null,'include':_0x2e0ed9[_0xdde9('0x17')]?_0x2e0ed9[_0xdde9('0x17')][_0xdde9('0x1a')]?_['map'](_0x2e0ed9['options'][_0xdde9('0x1a')],function(_0x22a8af){return{'model':db[_0x22a8af[_0xdde9('0x1b')]],'as':_0x22a8af['as'],'attributes':_0x22a8af['attributes'],'include':_0x22a8af[_0xdde9('0x1a')]?_[_0xdde9('0x1c')](_0x22a8af[_0xdde9('0x1a')],function(_0xfe0286){return{'model':db[_0xfe0286['model']],'as':_0xfe0286['as'],'attributes':_0xfe0286['attributes'],'include':_0xfe0286['include']?_[_0xdde9('0x1c')](_0xfe0286['include'],function(_0x2c10c1){return{'model':db[_0x2c10c1[_0xdde9('0x1b')]],'as':_0x2c10c1['as'],'attributes':_0x2c10c1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f549){logger[_0xdde9('0x12')](_0xdde9('0x14'),_0x2e0ed9);logger['debug'](_0xdde9('0x14'),_0x2e0ed9,JSON[_0xdde9('0x1d')](_0x2f549));_0x2e4b89(_0x2f549);})[_0xdde9('0x13')](function(_0x42f3bd){logger[_0xdde9('0xf')](_0xdde9('0x14'),_0x42f3bd[_0xdde9('0x11')],_0x2e0ed9);_0x23dc91(_0x34259e[_0xdde9('0xf')](0x1f4,_0x42f3bd[_0xdde9('0x11')]));});});}; \ No newline at end of file +var _0xee6e=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','findAll','options','where','attributes','limit','include','model','map','info','lodash','moment','bluebird','randomstring'];(function(_0x4670df,_0x433288){var _0x326082=function(_0x582361){while(--_0x582361){_0x4670df['push'](_0x4670df['shift']());}};_0x326082(++_0x433288);}(_0xee6e,0x128));var _0xeee6=function(_0x409891,_0x573551){_0x409891=_0x409891-0x0;var _0x11420e=_0xee6e[_0x409891];return _0x11420e;};'use strict';var _=require(_0xeee6('0x0'));var util=require('util');var moment=require(_0xeee6('0x1'));var BPromise=require(_0xeee6('0x2'));var rs=require(_0xeee6('0x3'));var fs=require('fs');var Redis=require(_0xeee6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeee6('0x5'));var logger=require(_0xeee6('0x6'))(_0xeee6('0x7'));var config=require(_0xeee6('0x8'));var jayson=require(_0xeee6('0x9'));var client=jayson['client'][_0xeee6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x121049,_0x30a928,_0x118a66){return new BPromise(function(_0x2a8227,_0x7aa501){return client['request'](_0x121049,_0x118a66)[_0xeee6('0xb')](function(_0x2fdb4b){logger['info'](_0xeee6('0xc'),_0x30a928,_0xeee6('0xd'));logger[_0xeee6('0xe')](_0xeee6('0xf'),_0x30a928,_0xeee6('0xd'),JSON['stringify'](_0x2fdb4b));if(_0x2fdb4b['error']){if(_0x2fdb4b[_0xeee6('0x10')][_0xeee6('0x11')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x30a928,_0x2fdb4b[_0xeee6('0x10')][_0xeee6('0x12')]);return _0x7aa501(_0x2fdb4b['error'][_0xeee6('0x12')]);}logger[_0xeee6('0x10')](_0xeee6('0xc'),_0x30a928,_0x2fdb4b[_0xeee6('0x10')][_0xeee6('0x12')]);return _0x2a8227(_0x2fdb4b[_0xeee6('0x10')][_0xeee6('0x12')]);}else{logger['info'](_0xeee6('0xc'),_0x30a928,'request\x20sent');_0x2a8227(_0x2fdb4b['result']['message']);}})[_0xeee6('0x13')](function(_0x4e0c7e){logger[_0xeee6('0x10')]('MailServerIn,\x20%s,\x20%s',_0x30a928,_0x4e0c7e);_0x7aa501(_0x4e0c7e);});});}exports[_0xeee6('0x14')]=function(_0x2efef4){var _0x3041d9=this;return new Promise(function(_0x3b467d,_0x32b15e){return db['MailServerIn'][_0xeee6('0x15')]({'raw':_0x2efef4[_0xeee6('0x16')]?_0x2efef4['options']['raw']===undefined?!![]:![]:!![],'where':_0x2efef4['options']?_0x2efef4[_0xeee6('0x16')][_0xeee6('0x17')]||null:null,'attributes':_0x2efef4[_0xeee6('0x16')]?_0x2efef4['options'][_0xeee6('0x18')]||null:null,'limit':_0x2efef4[_0xeee6('0x16')]?_0x2efef4[_0xeee6('0x16')][_0xeee6('0x19')]||null:null,'include':_0x2efef4[_0xeee6('0x16')]?_0x2efef4['options'][_0xeee6('0x1a')]?_['map'](_0x2efef4[_0xeee6('0x16')][_0xeee6('0x1a')],function(_0x3b1d23){return{'model':db[_0x3b1d23[_0xeee6('0x1b')]],'as':_0x3b1d23['as'],'attributes':_0x3b1d23[_0xeee6('0x18')],'include':_0x3b1d23[_0xeee6('0x1a')]?_[_0xeee6('0x1c')](_0x3b1d23[_0xeee6('0x1a')],function(_0x33c9ee){return{'model':db[_0x33c9ee[_0xeee6('0x1b')]],'as':_0x33c9ee['as'],'attributes':_0x33c9ee[_0xeee6('0x18')],'include':_0x33c9ee[_0xeee6('0x1a')]?_['map'](_0x33c9ee[_0xeee6('0x1a')],function(_0x360c3c){return{'model':db[_0x360c3c['model']],'as':_0x360c3c['as'],'attributes':_0x360c3c[_0xeee6('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeee6('0xb')](function(_0x1aa20d){logger[_0xeee6('0x1d')](_0xeee6('0x14'),_0x2efef4);logger['debug'](_0xeee6('0x14'),_0x2efef4,JSON['stringify'](_0x1aa20d));_0x3b467d(_0x1aa20d);})[_0xeee6('0x13')](function(_0x378cbc){logger['error']('GetMailServerIn',_0x378cbc['message'],_0x2efef4);_0x32b15e(_0x3041d9['error'](0x1f4,_0x378cbc[_0xeee6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index d566d6f..d62e570 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +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(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 41ea711..e558e46 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 _0xac4a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xac4a,0x13f));var _0xaac4=function(_0x51c65e,_0x2d43f1){_0x51c65e=_0x51c65e-0x0;var _0x332c37=_0xac4a[_0x51c65e];return _0x332c37;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'description':{'type':Sequelize[_0xaac4('0x2')]},'host':{'type':Sequelize[_0xaac4('0x2')]},'user':{'type':Sequelize[_0xaac4('0x2')]},'pass':{'type':Sequelize[_0xaac4('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xaac4('0x2')]},'authentication':{'type':Sequelize[_0xaac4('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xaac4('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4e81=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0xf5dbed,_0x28884b){var _0x1b102f=function(_0x198396){while(--_0x198396){_0xf5dbed['push'](_0xf5dbed['shift']());}};_0x1b102f(++_0x28884b);}(_0x4e81,0x1bc));var _0x14e8=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x4e81[_0x1e500e];return _0x10dc5e;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'description':{'type':Sequelize[_0x14e8('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x14e8('0x3')]},'secure':{'type':Sequelize[_0x14e8('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x14e8('0x2')]},'authentication':{'type':Sequelize[_0x14e8('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x14e8('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 160d47a..9e5701e 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 _0x4ff8=['catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','send','index','MailServerOut','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','find','create','body'];(function(_0x2f5c07,_0x4e9a3d){var _0x216f75=function(_0x3cef5e){while(--_0x3cef5e){_0x2f5c07['push'](_0x2f5c07['shift']());}};_0x216f75(++_0x4e9a3d);}(_0x4ff8,0xca));var _0x84ff=function(_0x86cf98,_0x2fca22){_0x86cf98=_0x86cf98-0x0;var _0x4c347f=_0x4ff8[_0x86cf98];return _0x4c347f;};'use strict';var emlformat=require(_0x84ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x84ff('0x1'));var jsonpatch=require(_0x84ff('0x2'));var rp=require(_0x84ff('0x3'));var moment=require('moment');var BPromise=require(_0x84ff('0x4'));var Mustache=require(_0x84ff('0x5'));var util=require(_0x84ff('0x6'));var path=require(_0x84ff('0x7'));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(_0x84ff('0x8'));var squel=require(_0x84ff('0x9'));var crypto=require('crypto');var jsforce=require(_0x84ff('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x84ff('0xb'));var Papa=require(_0x84ff('0xc'));var Redis=require(_0x84ff('0xd'));var authService=require(_0x84ff('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84ff('0xf'));var logger=require(_0x84ff('0x10'))(_0x84ff('0x11'));var utils=require(_0x84ff('0x12'));var config=require(_0x84ff('0x13'));var licenseUtil=require(_0x84ff('0x14'));var db=require(_0x84ff('0x15'))['db'];function respondWithStatusCode(_0x334f8e,_0x1a04b5){_0x1a04b5=_0x1a04b5||0xcc;return function(_0x372e16){if(_0x372e16){return _0x334f8e['sendStatus'](_0x1a04b5);}return _0x334f8e['status'](_0x1a04b5)[_0x84ff('0x16')]();};}function respondWithResult(_0x1d7f5b,_0x424144){_0x424144=_0x424144||0xc8;return function(_0x3df405){if(_0x3df405){return _0x1d7f5b[_0x84ff('0x17')](_0x424144)[_0x84ff('0x18')](_0x3df405);}};}function respondWithFilteredResult(_0x5b7813,_0x4a0d63){return function(_0x28504a){if(_0x28504a){var _0x2743e9=typeof _0x4a0d63[_0x84ff('0x19')]===_0x84ff('0x1a')&&typeof _0x4a0d63[_0x84ff('0x1b')]===_0x84ff('0x1a');var _0xfd8d15=_0x28504a[_0x84ff('0x1c')];var _0x1cedb0=_0x2743e9?0x0:_0x4a0d63[_0x84ff('0x19')];var _0x584591=_0x2743e9?_0x28504a[_0x84ff('0x1c')]:_0x4a0d63['offset']+_0x4a0d63[_0x84ff('0x1b')];var _0x2874ff;if(_0x584591>=_0xfd8d15){_0x584591=_0xfd8d15;_0x2874ff=0xc8;}else{_0x2874ff=0xce;}_0x5b7813[_0x84ff('0x17')](_0x2874ff);return _0x5b7813['set']('Content-Range',_0x1cedb0+'-'+_0x584591+'/'+_0xfd8d15)[_0x84ff('0x18')](_0x28504a);}return null;};}function patchUpdates(_0x27bbdc){return function(_0x3ec9c5){try{jsonpatch[_0x84ff('0x1d')](_0x3ec9c5,_0x27bbdc,!![]);}catch(_0x5b8a43){return BPromise['reject'](_0x5b8a43);}return _0x3ec9c5[_0x84ff('0x1e')]();};}function saveUpdates(_0x184563,_0x2c5eaa){return function(_0x2cbae9){if(_0x2cbae9){return _0x2cbae9[_0x84ff('0x1f')](_0x184563)[_0x84ff('0x20')](function(_0x4501db){return _0x4501db;});}return null;};}function removeEntity(_0x4474ef,_0x276ba2){return function(_0x4d772d){if(_0x4d772d){return _0x4d772d[_0x84ff('0x21')]()[_0x84ff('0x20')](function(){_0x4474ef[_0x84ff('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f24d0,_0x444589){return function(_0x27236c){if(!_0x27236c){_0x2f24d0['sendStatus'](0x194);}return _0x27236c;};}function handleError(_0x40320e,_0x56c5ce){_0x56c5ce=_0x56c5ce||0x1f4;return function(_0x4f1c40){logger[_0x84ff('0x22')](_0x4f1c40[_0x84ff('0x23')]);if(_0x4f1c40[_0x84ff('0x24')]){delete _0x4f1c40[_0x84ff('0x24')];}_0x40320e[_0x84ff('0x17')](_0x56c5ce)[_0x84ff('0x25')](_0x4f1c40);};}exports[_0x84ff('0x26')]=function(_0x1bb083,_0x41cda7){var _0x7fe606={},_0x295f51={},_0x5bac4c={'count':0x0,'rows':[]};var _0x5d234a=_['map'](db[_0x84ff('0x27')]['rawAttributes'],function(_0x3b0918){return{'name':_0x3b0918[_0x84ff('0x28')],'type':_0x3b0918[_0x84ff('0x29')][_0x84ff('0x2a')]};});_0x295f51[_0x84ff('0x2b')]=_['map'](_0x5d234a,_0x84ff('0x24'));_0x295f51[_0x84ff('0x2c')]=_['keys'](_0x1bb083[_0x84ff('0x2c')]);_0x295f51[_0x84ff('0x2d')]=_['intersection'](_0x295f51[_0x84ff('0x2b')],_0x295f51[_0x84ff('0x2c')]);_0x7fe606[_0x84ff('0x2e')]=_[_0x84ff('0x2f')](_0x295f51[_0x84ff('0x2b')],qs[_0x84ff('0x30')](_0x1bb083[_0x84ff('0x2c')][_0x84ff('0x30')]));_0x7fe606[_0x84ff('0x2e')]=_0x7fe606[_0x84ff('0x2e')][_0x84ff('0x31')]?_0x7fe606[_0x84ff('0x2e')]:_0x295f51[_0x84ff('0x2b')];if(!_0x1bb083[_0x84ff('0x2c')][_0x84ff('0x32')]('nolimit')){_0x7fe606[_0x84ff('0x1b')]=qs[_0x84ff('0x1b')](_0x1bb083['query'][_0x84ff('0x1b')]);_0x7fe606[_0x84ff('0x19')]=qs[_0x84ff('0x19')](_0x1bb083[_0x84ff('0x2c')]['offset']);}_0x7fe606['order']=qs[_0x84ff('0x33')](_0x1bb083['query'][_0x84ff('0x33')]);_0x7fe606[_0x84ff('0x34')]=qs[_0x84ff('0x2d')](_[_0x84ff('0x35')](_0x1bb083[_0x84ff('0x2c')],_0x295f51[_0x84ff('0x2d')]),_0x5d234a);if(_0x1bb083['query'][_0x84ff('0x36')]){_0x7fe606['where']=_[_0x84ff('0x37')](_0x7fe606[_0x84ff('0x34')],{'$or':_['map'](_0x5d234a,function(_0x30eabb){if(_0x30eabb[_0x84ff('0x29')]!==_0x84ff('0x38')){var _0x52d7d7={};_0x52d7d7[_0x30eabb['name']]={'$like':'%'+_0x1bb083[_0x84ff('0x2c')][_0x84ff('0x36')]+'%'};return _0x52d7d7;}})});}_0x7fe606=_['merge']({},_0x7fe606,_0x1bb083['options']);var _0x89b964={'where':_0x7fe606[_0x84ff('0x34')]};return db[_0x84ff('0x27')]['count'](_0x89b964)[_0x84ff('0x20')](function(_0x50b94a){_0x5bac4c[_0x84ff('0x1c')]=_0x50b94a;if(_0x1bb083[_0x84ff('0x2c')][_0x84ff('0x39')]){_0x7fe606[_0x84ff('0x3a')]=[{'all':!![]}];}return db[_0x84ff('0x27')][_0x84ff('0x3b')](_0x7fe606);})[_0x84ff('0x20')](function(_0x550a00){_0x5bac4c[_0x84ff('0x3c')]=_0x550a00;return _0x5bac4c;})[_0x84ff('0x20')](respondWithFilteredResult(_0x41cda7,_0x7fe606))['catch'](handleError(_0x41cda7,null));};exports['show']=function(_0x5c4fca,_0x4be24d){var _0x2f4d87={'raw':!![],'where':{'id':_0x5c4fca[_0x84ff('0x3d')]['id']}},_0xca719={};_0xca719['model']=_['keys'](db[_0x84ff('0x27')][_0x84ff('0x3e')]);_0xca719[_0x84ff('0x2c')]=_['keys'](_0x5c4fca['query']);_0xca719[_0x84ff('0x2d')]=_[_0x84ff('0x2f')](_0xca719[_0x84ff('0x2b')],_0xca719[_0x84ff('0x2c')]);_0x2f4d87[_0x84ff('0x2e')]=_[_0x84ff('0x2f')](_0xca719[_0x84ff('0x2b')],qs[_0x84ff('0x30')](_0x5c4fca[_0x84ff('0x2c')][_0x84ff('0x30')]));_0x2f4d87[_0x84ff('0x2e')]=_0x2f4d87[_0x84ff('0x2e')]['length']?_0x2f4d87[_0x84ff('0x2e')]:_0xca719['model'];if(_0x5c4fca[_0x84ff('0x2c')][_0x84ff('0x39')]){_0x2f4d87[_0x84ff('0x3a')]=[{'all':!![]}];}_0x2f4d87=_[_0x84ff('0x37')]({},_0x2f4d87,_0x5c4fca['options']);return db[_0x84ff('0x27')][_0x84ff('0x3f')](_0x2f4d87)[_0x84ff('0x20')](handleEntityNotFound(_0x4be24d,null))[_0x84ff('0x20')](respondWithResult(_0x4be24d,null))['catch'](handleError(_0x4be24d,null));};exports[_0x84ff('0x40')]=function(_0x1608be,_0x30d971){return db[_0x84ff('0x27')][_0x84ff('0x40')](_0x1608be[_0x84ff('0x41')],{})[_0x84ff('0x20')](respondWithResult(_0x30d971,0xc9))['catch'](handleError(_0x30d971,null));};exports[_0x84ff('0x1f')]=function(_0x49ff2a,_0x471292){if(_0x49ff2a[_0x84ff('0x41')]['id']){delete _0x49ff2a[_0x84ff('0x41')]['id'];}return db[_0x84ff('0x27')]['find']({'where':{'id':_0x49ff2a[_0x84ff('0x3d')]['id']}})['then'](handleEntityNotFound(_0x471292,null))['then'](saveUpdates(_0x49ff2a[_0x84ff('0x41')],null))[_0x84ff('0x20')](respondWithResult(_0x471292,null))[_0x84ff('0x42')](handleError(_0x471292,null));};exports[_0x84ff('0x21')]=function(_0xeb3579,_0x9f52ea){return db[_0x84ff('0x27')][_0x84ff('0x3f')]({'where':{'id':_0xeb3579[_0x84ff('0x3d')]['id']}})[_0x84ff('0x20')](handleEntityNotFound(_0x9f52ea,null))['then'](removeEntity(_0x9f52ea,null))[_0x84ff('0x42')](handleError(_0x9f52ea,null));}; \ No newline at end of file +var _0xf03f=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','MailServerOut','findAll','rows','show','length','includeAll','include','merge','find','create','body','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x18caac,_0x21caf4){var _0x14ac14=function(_0x14354b){while(--_0x14354b){_0x18caac['push'](_0x18caac['shift']());}};_0x14ac14(++_0x21caf4);}(_0xf03f,0x11b));var _0xff03=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xf03f[_0x3bd52b];return _0x1e5b89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff03('0x0'));var zipdir=require(_0xff03('0x1'));var jsonpatch=require(_0xff03('0x2'));var rp=require(_0xff03('0x3'));var moment=require(_0xff03('0x4'));var BPromise=require(_0xff03('0x5'));var Mustache=require(_0xff03('0x6'));var util=require(_0xff03('0x7'));var path=require(_0xff03('0x8'));var sox=require(_0xff03('0x9'));var csv=require('to-csv');var ejs=require(_0xff03('0xa'));var fs=require('fs');var fs_extra=require(_0xff03('0xb'));var _=require(_0xff03('0xc'));var squel=require('squel');var crypto=require(_0xff03('0xd'));var jsforce=require(_0xff03('0xe'));var deskjs=require(_0xff03('0xf'));var toCsv=require(_0xff03('0x10'));var querystring=require(_0xff03('0x11'));var Papa=require(_0xff03('0x12'));var Redis=require(_0xff03('0x13'));var authService=require(_0xff03('0x14'));var qs=require(_0xff03('0x15'));var as=require(_0xff03('0x16'));var hardwareService=require(_0xff03('0x17'));var logger=require(_0xff03('0x18'))(_0xff03('0x19'));var utils=require('../../config/utils');var config=require(_0xff03('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xff03('0x1b'))['db'];function respondWithStatusCode(_0x488333,_0x2f8345){_0x2f8345=_0x2f8345||0xcc;return function(_0x493901){if(_0x493901){return _0x488333[_0xff03('0x1c')](_0x2f8345);}return _0x488333[_0xff03('0x1d')](_0x2f8345)['end']();};}function respondWithResult(_0x3a7553,_0x4f7a3c){_0x4f7a3c=_0x4f7a3c||0xc8;return function(_0x1ec0e4){if(_0x1ec0e4){return _0x3a7553['status'](_0x4f7a3c)[_0xff03('0x1e')](_0x1ec0e4);}};}function respondWithFilteredResult(_0x36c596,_0x232062){return function(_0x363619){if(_0x363619){var _0x228161=typeof _0x232062[_0xff03('0x1f')]===_0xff03('0x20')&&typeof _0x232062[_0xff03('0x21')]===_0xff03('0x20');var _0x55febc=_0x363619[_0xff03('0x22')];var _0x1ee701=_0x228161?0x0:_0x232062['offset'];var _0x127206=_0x228161?_0x363619['count']:_0x232062[_0xff03('0x1f')]+_0x232062[_0xff03('0x21')];var _0x1fb5e9;if(_0x127206>=_0x55febc){_0x127206=_0x55febc;_0x1fb5e9=0xc8;}else{_0x1fb5e9=0xce;}_0x36c596[_0xff03('0x1d')](_0x1fb5e9);return _0x36c596['set']('Content-Range',_0x1ee701+'-'+_0x127206+'/'+_0x55febc)[_0xff03('0x1e')](_0x363619);}return null;};}function patchUpdates(_0x37f2c9){return function(_0x2c1888){try{jsonpatch[_0xff03('0x23')](_0x2c1888,_0x37f2c9,!![]);}catch(_0xf438e){return BPromise[_0xff03('0x24')](_0xf438e);}return _0x2c1888[_0xff03('0x25')]();};}function saveUpdates(_0x3ea29e,_0x4c659a){return function(_0xcc4a1b){if(_0xcc4a1b){return _0xcc4a1b[_0xff03('0x26')](_0x3ea29e)[_0xff03('0x27')](function(_0x1a96e8){return _0x1a96e8;});}return null;};}function removeEntity(_0x10bd81,_0x25630c){return function(_0x2931bc){if(_0x2931bc){return _0x2931bc[_0xff03('0x28')]()[_0xff03('0x27')](function(){_0x10bd81['status'](0xcc)[_0xff03('0x29')]();});}};}function handleEntityNotFound(_0x4d1a81,_0x32ccdd){return function(_0x41915f){if(!_0x41915f){_0x4d1a81[_0xff03('0x1c')](0x194);}return _0x41915f;};}function handleError(_0x49b25d,_0x382c0c){_0x382c0c=_0x382c0c||0x1f4;return function(_0x3d1916){logger[_0xff03('0x2a')](_0x3d1916[_0xff03('0x2b')]);if(_0x3d1916[_0xff03('0x2c')]){delete _0x3d1916['name'];}_0x49b25d[_0xff03('0x1d')](_0x382c0c)['send'](_0x3d1916);};}exports['index']=function(_0x271fd9,_0xbe5b77){var _0x3dc3e8={},_0x163928={},_0x127879={'count':0x0,'rows':[]};var _0x4e7fbd=_[_0xff03('0x2d')](db['MailServerOut'][_0xff03('0x2e')],function(_0x595b8d){return{'name':_0x595b8d['fieldName'],'type':_0x595b8d[_0xff03('0x2f')]['key']};});_0x163928[_0xff03('0x30')]=_[_0xff03('0x2d')](_0x4e7fbd,'name');_0x163928[_0xff03('0x31')]=_[_0xff03('0x32')](_0x271fd9[_0xff03('0x31')]);_0x163928[_0xff03('0x33')]=_['intersection'](_0x163928['model'],_0x163928[_0xff03('0x31')]);_0x3dc3e8[_0xff03('0x34')]=_[_0xff03('0x35')](_0x163928[_0xff03('0x30')],qs[_0xff03('0x36')](_0x271fd9[_0xff03('0x31')][_0xff03('0x36')]));_0x3dc3e8[_0xff03('0x34')]=_0x3dc3e8['attributes']['length']?_0x3dc3e8[_0xff03('0x34')]:_0x163928[_0xff03('0x30')];if(!_0x271fd9[_0xff03('0x31')][_0xff03('0x37')](_0xff03('0x38'))){_0x3dc3e8[_0xff03('0x21')]=qs[_0xff03('0x21')](_0x271fd9['query'][_0xff03('0x21')]);_0x3dc3e8[_0xff03('0x1f')]=qs[_0xff03('0x1f')](_0x271fd9[_0xff03('0x31')][_0xff03('0x1f')]);}_0x3dc3e8[_0xff03('0x39')]=qs[_0xff03('0x3a')](_0x271fd9[_0xff03('0x31')][_0xff03('0x3a')]);_0x3dc3e8['where']=qs[_0xff03('0x33')](_[_0xff03('0x3b')](_0x271fd9['query'],_0x163928[_0xff03('0x33')]),_0x4e7fbd);if(_0x271fd9[_0xff03('0x31')][_0xff03('0x3c')]){_0x3dc3e8[_0xff03('0x3d')]=_['merge'](_0x3dc3e8[_0xff03('0x3d')],{'$or':_[_0xff03('0x2d')](_0x4e7fbd,function(_0x4fcdc1){if(_0x4fcdc1[_0xff03('0x2f')]!=='VIRTUAL'){var _0x43d44d={};_0x43d44d[_0x4fcdc1['name']]={'$like':'%'+_0x271fd9[_0xff03('0x31')][_0xff03('0x3c')]+'%'};return _0x43d44d;}})});}_0x3dc3e8=_['merge']({},_0x3dc3e8,_0x271fd9['options']);var _0x10c492={'where':_0x3dc3e8['where']};return db[_0xff03('0x3e')][_0xff03('0x22')](_0x10c492)[_0xff03('0x27')](function(_0x17382b){_0x127879['count']=_0x17382b;if(_0x271fd9[_0xff03('0x31')]['includeAll']){_0x3dc3e8['include']=[{'all':!![]}];}return db[_0xff03('0x3e')][_0xff03('0x3f')](_0x3dc3e8);})[_0xff03('0x27')](function(_0x2e12fb){_0x127879[_0xff03('0x40')]=_0x2e12fb;return _0x127879;})['then'](respondWithFilteredResult(_0xbe5b77,_0x3dc3e8))['catch'](handleError(_0xbe5b77,null));};exports[_0xff03('0x41')]=function(_0x26d4e2,_0x20f09f){var _0x4e8615={'raw':!![],'where':{'id':_0x26d4e2['params']['id']}},_0xa822a={};_0xa822a[_0xff03('0x30')]=_[_0xff03('0x32')](db[_0xff03('0x3e')][_0xff03('0x2e')]);_0xa822a['query']=_['keys'](_0x26d4e2[_0xff03('0x31')]);_0xa822a[_0xff03('0x33')]=_[_0xff03('0x35')](_0xa822a[_0xff03('0x30')],_0xa822a[_0xff03('0x31')]);_0x4e8615['attributes']=_[_0xff03('0x35')](_0xa822a['model'],qs[_0xff03('0x36')](_0x26d4e2[_0xff03('0x31')]['fields']));_0x4e8615[_0xff03('0x34')]=_0x4e8615[_0xff03('0x34')][_0xff03('0x42')]?_0x4e8615[_0xff03('0x34')]:_0xa822a['model'];if(_0x26d4e2[_0xff03('0x31')][_0xff03('0x43')]){_0x4e8615[_0xff03('0x44')]=[{'all':!![]}];}_0x4e8615=_[_0xff03('0x45')]({},_0x4e8615,_0x26d4e2['options']);return db['MailServerOut'][_0xff03('0x46')](_0x4e8615)['then'](handleEntityNotFound(_0x20f09f,null))[_0xff03('0x27')](respondWithResult(_0x20f09f,null))['catch'](handleError(_0x20f09f,null));};exports[_0xff03('0x47')]=function(_0x133b5a,_0x42c95e){return db[_0xff03('0x3e')][_0xff03('0x47')](_0x133b5a['body'],{})[_0xff03('0x27')](respondWithResult(_0x42c95e,0xc9))['catch'](handleError(_0x42c95e,null));};exports[_0xff03('0x26')]=function(_0x125e28,_0x1a63c2){if(_0x125e28[_0xff03('0x48')]['id']){delete _0x125e28[_0xff03('0x48')]['id'];}return db[_0xff03('0x3e')][_0xff03('0x46')]({'where':{'id':_0x125e28[_0xff03('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a63c2,null))[_0xff03('0x27')](saveUpdates(_0x125e28['body'],null))['then'](respondWithResult(_0x1a63c2,null))[_0xff03('0x4a')](handleError(_0x1a63c2,null));};exports['destroy']=function(_0x512a34,_0xebdc63){return db['MailServerOut'][_0xff03('0x46')]({'where':{'id':_0x512a34[_0xff03('0x49')]['id']}})[_0xff03('0x27')](handleEntityNotFound(_0xebdc63,null))[_0xff03('0x27')](removeEntity(_0xebdc63,null))['catch'](handleError(_0xebdc63,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 1749473..72b54c1 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 _0xea16=['request-promise','path','../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xea16,0x1b7));var _0x6ea1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xea16[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x6ea1('0x0'));var util=require('util');var logger=require(_0x6ea1('0x1'))(_0x6ea1('0x2'));var moment=require(_0x6ea1('0x3'));var BPromise=require(_0x6ea1('0x4'));var rp=require(_0x6ea1('0x5'));var fs=require('fs');var path=require(_0x6ea1('0x6'));var rimraf=require('rimraf');var config=require(_0x6ea1('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x6ea1('0x8')]=function(_0x36a470,_0x198154){return _0x36a470[_0x6ea1('0x9')](_0x6ea1('0xa'),attributes,{'tableName':_0x6ea1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe836=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0x322856,_0x2c3d3d){var _0x3d3416=function(_0x16e881){while(--_0x16e881){_0x322856['push'](_0x322856['shift']());}};_0x3d3416(++_0x2c3d3d);}(_0xe836,0x9c));var _0x6e83=function(_0x3ee449,_0x3df1a8){_0x3ee449=_0x3ee449-0x0;var _0x39113b=_0xe836[_0x3ee449];return _0x39113b;};'use strict';var _=require('lodash');var util=require(_0x6e83('0x0'));var logger=require(_0x6e83('0x1'))(_0x6e83('0x2'));var moment=require(_0x6e83('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e83('0x4'));var fs=require('fs');var path=require(_0x6e83('0x5'));var rimraf=require(_0x6e83('0x6'));var config=require(_0x6e83('0x7'));var attributes=require(_0x6e83('0x8'));module[_0x6e83('0x9')]=function(_0x12ab19,_0x230b76){return _0x12ab19[_0x6e83('0xa')](_0x6e83('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 1e82b69..22e69c8 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x65860c,_0x24fb98){_0x65860c=_0x65860c-0x0;var _0xab295a=_0x7a54[_0x65860c];return _0xab295a;};'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 _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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x102283,_0x1b013f){_0x102283=_0x102283-0x0;var _0x11bca4=_0x7a54[_0x102283];return _0x11bca4;};'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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c891329..8735a44 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 _0xfa88=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','destroy'];(function(_0x483577,_0x490906){var _0x17ff0d=function(_0x45126a){while(--_0x45126a){_0x483577['push'](_0x483577['shift']());}};_0x17ff0d(++_0x490906);}(_0xfa88,0x1b9));var _0x8fa8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfa88[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x8fa8('0x0'));var path=require(_0x8fa8('0x1'));var timeout=require(_0x8fa8('0x2'));var express=require(_0x8fa8('0x3'));var router=express[_0x8fa8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8fa8('0x5'));var interaction=require(_0x8fa8('0x6'));var config=require(_0x8fa8('0x7'));var controller=require(_0x8fa8('0x8'));router[_0x8fa8('0x9')]('/',auth[_0x8fa8('0xa')](),controller[_0x8fa8('0xb')]);router[_0x8fa8('0x9')](_0x8fa8('0xc'),auth['isAuthenticated'](),controller[_0x8fa8('0xd')]);router[_0x8fa8('0x9')](_0x8fa8('0xe'),auth[_0x8fa8('0xa')](),controller[_0x8fa8('0xf')]);router['post']('/',auth[_0x8fa8('0xa')](),controller[_0x8fa8('0x10')]);router['put'](_0x8fa8('0xe'),auth[_0x8fa8('0xa')](),controller[_0x8fa8('0x11')]);router['delete'](_0x8fa8('0xe'),auth[_0x8fa8('0xa')](),controller[_0x8fa8('0x12')]);module[_0x8fa8('0x13')]=router; \ No newline at end of file +var _0x3b00=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0x3b00,0x1b4));var _0x03b0=function(_0x2d5f65,_0x315b72){_0x2d5f65=_0x2d5f65-0x0;var _0x4a83cc=_0x3b00[_0x2d5f65];return _0x4a83cc;};'use strict';var multer=require(_0x03b0('0x0'));var util=require(_0x03b0('0x1'));var path=require(_0x03b0('0x2'));var timeout=require(_0x03b0('0x3'));var express=require(_0x03b0('0x4'));var router=express[_0x03b0('0x5')]();var fs_extra=require(_0x03b0('0x6'));var auth=require(_0x03b0('0x7'));var interaction=require(_0x03b0('0x8'));var config=require(_0x03b0('0x9'));var controller=require(_0x03b0('0xa'));router[_0x03b0('0xb')]('/',auth[_0x03b0('0xc')](),controller[_0x03b0('0xd')]);router[_0x03b0('0xb')](_0x03b0('0xe'),auth[_0x03b0('0xc')](),controller['describe']);router[_0x03b0('0xb')](_0x03b0('0xf'),auth[_0x03b0('0xc')](),controller[_0x03b0('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x03b0('0xf'),auth[_0x03b0('0xc')](),controller['update']);router[_0x03b0('0x11')](_0x03b0('0xf'),auth[_0x03b0('0xc')](),controller[_0x03b0('0x12')]);module[_0x03b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 7cc0f6a..b4830df 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 _0xef17=['STRING','name','sequelize','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xef17,0x136));var _0x7ef1=function(_0x1b1735,_0x522ff3){_0x1b1735=_0x1b1735-0x0;var _0x6d520a=_0xef17[_0x1b1735];return _0x6d520a;};'use strict';var Sequelize=require(_0x7ef1('0x0'));module[_0x7ef1('0x1')]={'name':{'type':Sequelize[_0x7ef1('0x2')],'unique':_0x7ef1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7ef1('0x2')]}}; \ No newline at end of file +var _0xc1c6=['STRING','sequelize','exports'];(function(_0x3a60fb,_0x4003cd){var _0x37c1fb=function(_0x17fdf2){while(--_0x17fdf2){_0x3a60fb['push'](_0x3a60fb['shift']());}};_0x37c1fb(++_0x4003cd);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x153a3c,_0x10936e){_0x153a3c=_0x153a3c-0x0;var _0x24d403=_0xc1c6[_0x153a3c];return _0x24d403;};'use strict';var Sequelize=require(_0x6c1c('0x0'));module[_0x6c1c('0x1')]={'name':{'type':Sequelize[_0x6c1c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6c1c('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 7c889c9..85006a3 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 _0x0a58=['describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','reject','then','destroy','error','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','catch','params','length','include','options','find','create','update','body'];(function(_0x21781e,_0x5eb457){var _0x4ee232=function(_0x1ebafb){while(--_0x1ebafb){_0x21781e['push'](_0x21781e['shift']());}};_0x4ee232(++_0x5eb457);}(_0x0a58,0x89));var _0x80a5=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0a58[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x80a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x80a5('0x1'));var jsonpatch=require(_0x80a5('0x2'));var rp=require(_0x80a5('0x3'));var moment=require(_0x80a5('0x4'));var BPromise=require(_0x80a5('0x5'));var Mustache=require(_0x80a5('0x6'));var util=require('util');var path=require('path');var sox=require(_0x80a5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80a5('0x8'));var _=require('lodash');var squel=require(_0x80a5('0x9'));var crypto=require(_0x80a5('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x80a5('0xb'));var querystring=require(_0x80a5('0xc'));var Papa=require('papaparse');var Redis=require(_0x80a5('0xd'));var authService=require(_0x80a5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x80a5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80a5('0x10'))('api');var utils=require(_0x80a5('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x80a5('0x12'));var db=require(_0x80a5('0x13'))['db'];function respondWithStatusCode(_0x3e359f,_0x3a1abb){_0x3a1abb=_0x3a1abb||0xcc;return function(_0x12f631){if(_0x12f631){return _0x3e359f[_0x80a5('0x14')](_0x3a1abb);}return _0x3e359f[_0x80a5('0x15')](_0x3a1abb)[_0x80a5('0x16')]();};}function respondWithResult(_0x271085,_0x1f7143){_0x1f7143=_0x1f7143||0xc8;return function(_0x3e9f07){if(_0x3e9f07){return _0x271085[_0x80a5('0x15')](_0x1f7143)['json'](_0x3e9f07);}};}function respondWithFilteredResult(_0x6736bc,_0x25f315){return function(_0x1a72ed){if(_0x1a72ed){var _0x120212=typeof _0x25f315['offset']==='undefined'&&typeof _0x25f315[_0x80a5('0x17')]===_0x80a5('0x18');var _0x38f897=_0x1a72ed[_0x80a5('0x19')];var _0x2863fb=_0x120212?0x0:_0x25f315[_0x80a5('0x1a')];var _0x5b3383=_0x120212?_0x1a72ed[_0x80a5('0x19')]:_0x25f315[_0x80a5('0x1a')]+_0x25f315[_0x80a5('0x17')];var _0x34cf61;if(_0x5b3383>=_0x38f897){_0x5b3383=_0x38f897;_0x34cf61=0xc8;}else{_0x34cf61=0xce;}_0x6736bc[_0x80a5('0x15')](_0x34cf61);return _0x6736bc[_0x80a5('0x1b')]('Content-Range',_0x2863fb+'-'+_0x5b3383+'/'+_0x38f897)[_0x80a5('0x1c')](_0x1a72ed);}return null;};}function patchUpdates(_0x172d15){return function(_0x346f84){try{jsonpatch[_0x80a5('0x1d')](_0x346f84,_0x172d15,!![]);}catch(_0x51487b){return BPromise[_0x80a5('0x1e')](_0x51487b);}return _0x346f84['save']();};}function saveUpdates(_0x14b6cb,_0x3c7460){return function(_0x21a9e5){if(_0x21a9e5){return _0x21a9e5['update'](_0x14b6cb)[_0x80a5('0x1f')](function(_0x4803de){return _0x4803de;});}return null;};}function removeEntity(_0x1c5ab0,_0x397fdd){return function(_0x12fbc0){if(_0x12fbc0){return _0x12fbc0[_0x80a5('0x20')]()[_0x80a5('0x1f')](function(){_0x1c5ab0[_0x80a5('0x15')](0xcc)[_0x80a5('0x16')]();});}};}function handleEntityNotFound(_0x57d6b6,_0x56aada){return function(_0x224ca6){if(!_0x224ca6){_0x57d6b6[_0x80a5('0x14')](0x194);}return _0x224ca6;};}function handleError(_0x39f8dd,_0x4b2d3a){_0x4b2d3a=_0x4b2d3a||0x1f4;return function(_0x2c0306){logger[_0x80a5('0x21')](_0x2c0306['stack']);if(_0x2c0306[_0x80a5('0x22')]){delete _0x2c0306[_0x80a5('0x22')];}_0x39f8dd['status'](_0x4b2d3a)[_0x80a5('0x23')](_0x2c0306);};}exports['index']=function(_0x5b1b18,_0x42a0dd){var _0x4cf409={},_0x427d05={},_0x22d4d7={'count':0x0,'rows':[]};var _0x41411a=_[_0x80a5('0x24')](db[_0x80a5('0x25')][_0x80a5('0x26')],function(_0x410b8d){return{'name':_0x410b8d[_0x80a5('0x27')],'type':_0x410b8d[_0x80a5('0x28')][_0x80a5('0x29')]};});_0x427d05[_0x80a5('0x2a')]=_[_0x80a5('0x24')](_0x41411a,_0x80a5('0x22'));_0x427d05[_0x80a5('0x2b')]=_[_0x80a5('0x2c')](_0x5b1b18[_0x80a5('0x2b')]);_0x427d05[_0x80a5('0x2d')]=_[_0x80a5('0x2e')](_0x427d05[_0x80a5('0x2a')],_0x427d05[_0x80a5('0x2b')]);_0x4cf409[_0x80a5('0x2f')]=_['intersection'](_0x427d05[_0x80a5('0x2a')],qs[_0x80a5('0x30')](_0x5b1b18[_0x80a5('0x2b')][_0x80a5('0x30')]));_0x4cf409[_0x80a5('0x2f')]=_0x4cf409[_0x80a5('0x2f')]['length']?_0x4cf409[_0x80a5('0x2f')]:_0x427d05[_0x80a5('0x2a')];if(!_0x5b1b18[_0x80a5('0x2b')][_0x80a5('0x31')](_0x80a5('0x32'))){_0x4cf409['limit']=qs[_0x80a5('0x17')](_0x5b1b18['query']['limit']);_0x4cf409[_0x80a5('0x1a')]=qs[_0x80a5('0x1a')](_0x5b1b18['query']['offset']);}_0x4cf409[_0x80a5('0x33')]=qs[_0x80a5('0x34')](_0x5b1b18[_0x80a5('0x2b')]['sort']);_0x4cf409['where']=qs[_0x80a5('0x2d')](_['pick'](_0x5b1b18[_0x80a5('0x2b')],_0x427d05[_0x80a5('0x2d')]),_0x41411a);if(_0x5b1b18[_0x80a5('0x2b')]['filter']){_0x4cf409[_0x80a5('0x35')]=_['merge'](_0x4cf409[_0x80a5('0x35')],{'$or':_[_0x80a5('0x24')](_0x41411a,function(_0x214006){if(_0x214006['type']!==_0x80a5('0x36')){var _0x55bfd3={};_0x55bfd3[_0x214006[_0x80a5('0x22')]]={'$like':'%'+_0x5b1b18['query'][_0x80a5('0x37')]+'%'};return _0x55bfd3;}})});}_0x4cf409=_[_0x80a5('0x38')]({},_0x4cf409,_0x5b1b18['options']);var _0x268cbf={'where':_0x4cf409[_0x80a5('0x35')]};return db[_0x80a5('0x25')][_0x80a5('0x19')](_0x268cbf)[_0x80a5('0x1f')](function(_0xea21e4){_0x22d4d7[_0x80a5('0x19')]=_0xea21e4;if(_0x5b1b18[_0x80a5('0x2b')][_0x80a5('0x39')]){_0x4cf409['include']=[{'all':!![]}];}return db[_0x80a5('0x25')]['findAll'](_0x4cf409);})[_0x80a5('0x1f')](function(_0x254c5b){_0x22d4d7['rows']=_0x254c5b;return _0x22d4d7;})['then'](respondWithFilteredResult(_0x42a0dd,_0x4cf409))[_0x80a5('0x3a')](handleError(_0x42a0dd,null));};exports['show']=function(_0x26e393,_0x31ab10){var _0x535a43={'raw':!![],'where':{'id':_0x26e393[_0x80a5('0x3b')]['id']}},_0x498c81={};_0x498c81[_0x80a5('0x2a')]=_[_0x80a5('0x2c')](db[_0x80a5('0x25')][_0x80a5('0x26')]);_0x498c81[_0x80a5('0x2b')]=_['keys'](_0x26e393[_0x80a5('0x2b')]);_0x498c81[_0x80a5('0x2d')]=_[_0x80a5('0x2e')](_0x498c81[_0x80a5('0x2a')],_0x498c81[_0x80a5('0x2b')]);_0x535a43[_0x80a5('0x2f')]=_[_0x80a5('0x2e')](_0x498c81[_0x80a5('0x2a')],qs[_0x80a5('0x30')](_0x26e393[_0x80a5('0x2b')][_0x80a5('0x30')]));_0x535a43['attributes']=_0x535a43[_0x80a5('0x2f')][_0x80a5('0x3c')]?_0x535a43['attributes']:_0x498c81[_0x80a5('0x2a')];if(_0x26e393[_0x80a5('0x2b')][_0x80a5('0x39')]){_0x535a43[_0x80a5('0x3d')]=[{'all':!![]}];}_0x535a43=_[_0x80a5('0x38')]({},_0x535a43,_0x26e393[_0x80a5('0x3e')]);return db[_0x80a5('0x25')][_0x80a5('0x3f')](_0x535a43)[_0x80a5('0x1f')](handleEntityNotFound(_0x31ab10,null))[_0x80a5('0x1f')](respondWithResult(_0x31ab10,null))[_0x80a5('0x3a')](handleError(_0x31ab10,null));};exports[_0x80a5('0x40')]=function(_0x26f7ea,_0x531acc){return db[_0x80a5('0x25')][_0x80a5('0x40')](_0x26f7ea['body'],{})[_0x80a5('0x1f')](respondWithResult(_0x531acc,0xc9))['catch'](handleError(_0x531acc,null));};exports[_0x80a5('0x41')]=function(_0x376db4,_0x3ca53a){if(_0x376db4['body']['id']){delete _0x376db4['body']['id'];}return db[_0x80a5('0x25')][_0x80a5('0x3f')]({'where':{'id':_0x376db4[_0x80a5('0x3b')]['id']}})[_0x80a5('0x1f')](handleEntityNotFound(_0x3ca53a,null))[_0x80a5('0x1f')](saveUpdates(_0x376db4[_0x80a5('0x42')],null))[_0x80a5('0x1f')](respondWithResult(_0x3ca53a,null))[_0x80a5('0x3a')](handleError(_0x3ca53a,null));};exports[_0x80a5('0x20')]=function(_0xe783e7,_0x39cb31){return db['MailSubstatus']['find']({'where':{'id':_0xe783e7[_0x80a5('0x3b')]['id']}})['then'](handleEntityNotFound(_0x39cb31,null))[_0x80a5('0x1f')](removeEntity(_0x39cb31,null))[_0x80a5('0x3a')](handleError(_0x39cb31,null));};exports['describe']=function(_0x3e624c,_0x2990ce){return db[_0x80a5('0x25')][_0x80a5('0x43')]()[_0x80a5('0x1f')](respondWithResult(_0x2990ce,null))['catch'](handleError(_0x2990ce,null));}; \ No newline at end of file +var _0xf2c8=['sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','name','send','map','MailSubstatus','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xf2c8,0x124));var _0x8f2c=function(_0x326ef4,_0x2a20ea){_0x326ef4=_0x326ef4-0x0;var _0x30594b=_0xf2c8[_0x326ef4];return _0x30594b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f2c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f2c('0x1'));var rp=require(_0x8f2c('0x2'));var moment=require(_0x8f2c('0x3'));var BPromise=require(_0x8f2c('0x4'));var Mustache=require(_0x8f2c('0x5'));var util=require(_0x8f2c('0x6'));var path=require(_0x8f2c('0x7'));var sox=require(_0x8f2c('0x8'));var csv=require(_0x8f2c('0x9'));var ejs=require(_0x8f2c('0xa'));var fs=require('fs');var fs_extra=require(_0x8f2c('0xb'));var _=require(_0x8f2c('0xc'));var squel=require(_0x8f2c('0xd'));var crypto=require(_0x8f2c('0xe'));var jsforce=require(_0x8f2c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8f2c('0x9'));var querystring=require(_0x8f2c('0x10'));var Papa=require(_0x8f2c('0x11'));var Redis=require(_0x8f2c('0x12'));var authService=require(_0x8f2c('0x13'));var qs=require(_0x8f2c('0x14'));var as=require(_0x8f2c('0x15'));var hardwareService=require(_0x8f2c('0x16'));var logger=require('../../config/logger')(_0x8f2c('0x17'));var utils=require(_0x8f2c('0x18'));var config=require(_0x8f2c('0x19'));var licenseUtil=require(_0x8f2c('0x1a'));var db=require(_0x8f2c('0x1b'))['db'];function respondWithStatusCode(_0x4d9ef6,_0x9a00c2){_0x9a00c2=_0x9a00c2||0xcc;return function(_0x2a796a){if(_0x2a796a){return _0x4d9ef6[_0x8f2c('0x1c')](_0x9a00c2);}return _0x4d9ef6[_0x8f2c('0x1d')](_0x9a00c2)[_0x8f2c('0x1e')]();};}function respondWithResult(_0x58f27c,_0x1a7fba){_0x1a7fba=_0x1a7fba||0xc8;return function(_0x32ee3f){if(_0x32ee3f){return _0x58f27c['status'](_0x1a7fba)['json'](_0x32ee3f);}};}function respondWithFilteredResult(_0x3af5ba,_0x3f096d){return function(_0x3961d7){if(_0x3961d7){var _0x5aac25=typeof _0x3f096d[_0x8f2c('0x1f')]===_0x8f2c('0x20')&&typeof _0x3f096d[_0x8f2c('0x21')]===_0x8f2c('0x20');var _0x41194c=_0x3961d7[_0x8f2c('0x22')];var _0x55da68=_0x5aac25?0x0:_0x3f096d['offset'];var _0x1fbcd1=_0x5aac25?_0x3961d7[_0x8f2c('0x22')]:_0x3f096d[_0x8f2c('0x1f')]+_0x3f096d[_0x8f2c('0x21')];var _0x17da61;if(_0x1fbcd1>=_0x41194c){_0x1fbcd1=_0x41194c;_0x17da61=0xc8;}else{_0x17da61=0xce;}_0x3af5ba[_0x8f2c('0x1d')](_0x17da61);return _0x3af5ba[_0x8f2c('0x23')]('Content-Range',_0x55da68+'-'+_0x1fbcd1+'/'+_0x41194c)[_0x8f2c('0x24')](_0x3961d7);}return null;};}function patchUpdates(_0x34e11e){return function(_0x4858ff){try{jsonpatch['apply'](_0x4858ff,_0x34e11e,!![]);}catch(_0x37adaa){return BPromise[_0x8f2c('0x25')](_0x37adaa);}return _0x4858ff[_0x8f2c('0x26')]();};}function saveUpdates(_0x46d794,_0x247697){return function(_0xfa2ba1){if(_0xfa2ba1){return _0xfa2ba1[_0x8f2c('0x27')](_0x46d794)[_0x8f2c('0x28')](function(_0x14b5c5){return _0x14b5c5;});}return null;};}function removeEntity(_0x3c1ecf,_0x3b4ba0){return function(_0xfe401d){if(_0xfe401d){return _0xfe401d[_0x8f2c('0x29')]()[_0x8f2c('0x28')](function(){_0x3c1ecf[_0x8f2c('0x1d')](0xcc)[_0x8f2c('0x1e')]();});}};}function handleEntityNotFound(_0xb03240,_0x9a1f5f){return function(_0x1261bb){if(!_0x1261bb){_0xb03240[_0x8f2c('0x1c')](0x194);}return _0x1261bb;};}function handleError(_0x1451a5,_0x21d6cf){_0x21d6cf=_0x21d6cf||0x1f4;return function(_0x5a46e5){logger[_0x8f2c('0x2a')](_0x5a46e5[_0x8f2c('0x2b')]);if(_0x5a46e5[_0x8f2c('0x2c')]){delete _0x5a46e5['name'];}_0x1451a5['status'](_0x21d6cf)[_0x8f2c('0x2d')](_0x5a46e5);};}exports['index']=function(_0x5829dc,_0x4a698e){var _0x273ce0={},_0x193bcf={},_0x4e17c4={'count':0x0,'rows':[]};var _0x1cbd60=_[_0x8f2c('0x2e')](db[_0x8f2c('0x2f')]['rawAttributes'],function(_0x1d1ea6){return{'name':_0x1d1ea6[_0x8f2c('0x30')],'type':_0x1d1ea6[_0x8f2c('0x31')][_0x8f2c('0x32')]};});_0x193bcf[_0x8f2c('0x33')]=_['map'](_0x1cbd60,'name');_0x193bcf[_0x8f2c('0x34')]=_[_0x8f2c('0x35')](_0x5829dc[_0x8f2c('0x34')]);_0x193bcf['filters']=_[_0x8f2c('0x36')](_0x193bcf['model'],_0x193bcf[_0x8f2c('0x34')]);_0x273ce0[_0x8f2c('0x37')]=_[_0x8f2c('0x36')](_0x193bcf[_0x8f2c('0x33')],qs[_0x8f2c('0x38')](_0x5829dc[_0x8f2c('0x34')][_0x8f2c('0x38')]));_0x273ce0[_0x8f2c('0x37')]=_0x273ce0[_0x8f2c('0x37')][_0x8f2c('0x39')]?_0x273ce0[_0x8f2c('0x37')]:_0x193bcf['model'];if(!_0x5829dc[_0x8f2c('0x34')][_0x8f2c('0x3a')](_0x8f2c('0x3b'))){_0x273ce0['limit']=qs[_0x8f2c('0x21')](_0x5829dc[_0x8f2c('0x34')][_0x8f2c('0x21')]);_0x273ce0['offset']=qs[_0x8f2c('0x1f')](_0x5829dc[_0x8f2c('0x34')][_0x8f2c('0x1f')]);}_0x273ce0[_0x8f2c('0x3c')]=qs[_0x8f2c('0x3d')](_0x5829dc[_0x8f2c('0x34')]['sort']);_0x273ce0[_0x8f2c('0x3e')]=qs[_0x8f2c('0x3f')](_['pick'](_0x5829dc[_0x8f2c('0x34')],_0x193bcf[_0x8f2c('0x3f')]),_0x1cbd60);if(_0x5829dc[_0x8f2c('0x34')]['filter']){_0x273ce0[_0x8f2c('0x3e')]=_['merge'](_0x273ce0[_0x8f2c('0x3e')],{'$or':_['map'](_0x1cbd60,function(_0xcd9097){if(_0xcd9097[_0x8f2c('0x31')]!==_0x8f2c('0x40')){var _0x43a651={};_0x43a651[_0xcd9097[_0x8f2c('0x2c')]]={'$like':'%'+_0x5829dc[_0x8f2c('0x34')][_0x8f2c('0x41')]+'%'};return _0x43a651;}})});}_0x273ce0=_[_0x8f2c('0x42')]({},_0x273ce0,_0x5829dc[_0x8f2c('0x43')]);var _0x3607c2={'where':_0x273ce0[_0x8f2c('0x3e')]};return db[_0x8f2c('0x2f')][_0x8f2c('0x22')](_0x3607c2)[_0x8f2c('0x28')](function(_0x137364){_0x4e17c4[_0x8f2c('0x22')]=_0x137364;if(_0x5829dc['query'][_0x8f2c('0x44')]){_0x273ce0[_0x8f2c('0x45')]=[{'all':!![]}];}return db['MailSubstatus'][_0x8f2c('0x46')](_0x273ce0);})[_0x8f2c('0x28')](function(_0x4e055d){_0x4e17c4[_0x8f2c('0x47')]=_0x4e055d;return _0x4e17c4;})[_0x8f2c('0x28')](respondWithFilteredResult(_0x4a698e,_0x273ce0))[_0x8f2c('0x48')](handleError(_0x4a698e,null));};exports[_0x8f2c('0x49')]=function(_0x4180cb,_0x26e14f){var _0x1cb720={'raw':!![],'where':{'id':_0x4180cb['params']['id']}},_0x49baff={};_0x49baff[_0x8f2c('0x33')]=_[_0x8f2c('0x35')](db[_0x8f2c('0x2f')][_0x8f2c('0x4a')]);_0x49baff[_0x8f2c('0x34')]=_[_0x8f2c('0x35')](_0x4180cb[_0x8f2c('0x34')]);_0x49baff[_0x8f2c('0x3f')]=_['intersection'](_0x49baff['model'],_0x49baff['query']);_0x1cb720['attributes']=_[_0x8f2c('0x36')](_0x49baff['model'],qs[_0x8f2c('0x38')](_0x4180cb[_0x8f2c('0x34')][_0x8f2c('0x38')]));_0x1cb720[_0x8f2c('0x37')]=_0x1cb720['attributes']['length']?_0x1cb720[_0x8f2c('0x37')]:_0x49baff[_0x8f2c('0x33')];if(_0x4180cb['query'][_0x8f2c('0x44')]){_0x1cb720[_0x8f2c('0x45')]=[{'all':!![]}];}_0x1cb720=_[_0x8f2c('0x42')]({},_0x1cb720,_0x4180cb[_0x8f2c('0x43')]);return db[_0x8f2c('0x2f')][_0x8f2c('0x4b')](_0x1cb720)['then'](handleEntityNotFound(_0x26e14f,null))[_0x8f2c('0x28')](respondWithResult(_0x26e14f,null))['catch'](handleError(_0x26e14f,null));};exports['create']=function(_0x8ef2e8,_0x42ce9c){return db['MailSubstatus'][_0x8f2c('0x4c')](_0x8ef2e8[_0x8f2c('0x4d')],{})[_0x8f2c('0x28')](respondWithResult(_0x42ce9c,0xc9))[_0x8f2c('0x48')](handleError(_0x42ce9c,null));};exports[_0x8f2c('0x27')]=function(_0x2ff9f9,_0xaec5cb){if(_0x2ff9f9['body']['id']){delete _0x2ff9f9[_0x8f2c('0x4d')]['id'];}return db[_0x8f2c('0x2f')][_0x8f2c('0x4b')]({'where':{'id':_0x2ff9f9[_0x8f2c('0x4e')]['id']}})[_0x8f2c('0x28')](handleEntityNotFound(_0xaec5cb,null))[_0x8f2c('0x28')](saveUpdates(_0x2ff9f9['body'],null))[_0x8f2c('0x28')](respondWithResult(_0xaec5cb,null))['catch'](handleError(_0xaec5cb,null));};exports[_0x8f2c('0x29')]=function(_0x471595,_0x296eb7){return db[_0x8f2c('0x2f')][_0x8f2c('0x4b')]({'where':{'id':_0x471595['params']['id']}})[_0x8f2c('0x28')](handleEntityNotFound(_0x296eb7,null))[_0x8f2c('0x28')](removeEntity(_0x296eb7,null))[_0x8f2c('0x48')](handleError(_0x296eb7,null));};exports[_0x8f2c('0x4f')]=function(_0x3848ae,_0x9f10dd){return db['MailSubstatus'][_0x8f2c('0x4f')]()[_0x8f2c('0x28')](respondWithResult(_0x9f10dd,null))[_0x8f2c('0x48')](handleError(_0x9f10dd,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index d82459f..c7e2118 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 _0x3cce=['emit','hasOwnProperty','hook','exports','events','MailSubstatus','update'];(function(_0x3aa6c5,_0x3533b1){var _0xb0fe84=function(_0x2929f1){while(--_0x2929f1){_0x3aa6c5['push'](_0x3aa6c5['shift']());}};_0xb0fe84(++_0x3533b1);}(_0x3cce,0x14d));var _0xe3cc=function(_0x136e37,_0xcb0f92){_0x136e37=_0x136e37-0x0;var _0x27a9ac=_0x3cce[_0x136e37];return _0x27a9ac;};'use strict';var EventEmitter=require(_0xe3cc('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xe3cc('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xe3cc('0x2')};function emitEvent(_0x2e9093){return function(_0x1d3cd0,_0x197531,_0x2bb2f1){MailSubstatusEvents[_0xe3cc('0x3')](_0x2e9093+':'+_0x1d3cd0['id'],_0x1d3cd0);MailSubstatusEvents['emit'](_0x2e9093,_0x1d3cd0);_0x2bb2f1(null);};}for(var e in events){if(events[_0xe3cc('0x4')](e)){var event=events[e];MailSubstatus[_0xe3cc('0x5')](e,emitEvent(event));}}module[_0xe3cc('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x846a=['events','../../mysqldb','MailSubstatus','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x539bf7,_0x24f72d){var _0x33ae1d=function(_0x1db0ea){while(--_0x1db0ea){_0x539bf7['push'](_0x539bf7['shift']());}};_0x33ae1d(++_0x24f72d);}(_0x846a,0x1d0));var _0xa846=function(_0x4834e0,_0x37ef9e){_0x4834e0=_0x4834e0-0x0;var _0xeee930=_0x846a[_0x4834e0];return _0xeee930;};'use strict';var EventEmitter=require(_0xa846('0x0'));var MailSubstatus=require(_0xa846('0x1'))['db'][_0xa846('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa846('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x34725a){return function(_0x4e98e6,_0xf7d0be,_0x479cda){MailSubstatusEvents[_0xa846('0x4')](_0x34725a+':'+_0x4e98e6['id'],_0x4e98e6);MailSubstatusEvents[_0xa846('0x4')](_0x34725a,_0x4e98e6);_0x479cda(null);};}for(var e in events){if(events[_0xa846('0x5')](e)){var event=events[e];MailSubstatus[_0xa846('0x6')](e,emitEvent(event));}}module[_0xa846('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 4463f8a..ce7eb86 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 _0xb973=['update','name','mailSubstatus','_previousDataValues','then','catch','models','MailSubstatus','mail_substatuses','Condition'];(function(_0x265be4,_0xb82560){var _0x40560f=function(_0x8e6415){while(--_0x8e6415){_0x265be4['push'](_0x265be4['shift']());}};_0x40560f(++_0xb82560);}(_0xb973,0xd8));var _0x3b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb973[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x508863){var _0x5c6210=_0x508863[_0x3b97('0x0')];return _0x508863['define'](_0x3b97('0x1'),attributes,{'tableName':_0x3b97('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x33a7b3,_0x1936d6,_0x31fbb0){return _0x5c6210[_0x3b97('0x3')][_0x3b97('0x4')]({'value':_0x33a7b3[_0x3b97('0x5')]},{'where':{'field':_0x3b97('0x6'),'value':_0x33a7b3[_0x3b97('0x7')]['name']}})[_0x3b97('0x8')](function(){_0x31fbb0();})[_0x3b97('0x9')](function(_0x263c7a){_0x31fbb0(_0x263c7a);});}}});}; \ No newline at end of file +var _0x27d1=['exports','models','define','MailSubstatus','Condition','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes'];(function(_0x1fbd72,_0x5b353f){var _0x47e61a=function(_0x24581a){while(--_0x24581a){_0x1fbd72['push'](_0x1fbd72['shift']());}};_0x47e61a(++_0x5b353f);}(_0x27d1,0xe6));var _0x127d=function(_0x23c564,_0x2823d1){_0x23c564=_0x23c564-0x0;var _0x32cf9f=_0x27d1[_0x23c564];return _0x32cf9f;};'use strict';var attributes=require(_0x127d('0x0'));module[_0x127d('0x1')]=function(_0x4d00d0){var _0x28da9a=_0x4d00d0[_0x127d('0x2')];return _0x4d00d0[_0x127d('0x3')](_0x127d('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5e4252,_0x3102cc,_0x2ad2f8){return _0x28da9a[_0x127d('0x5')]['update']({'value':_0x5e4252[_0x127d('0x6')]},{'where':{'field':_0x127d('0x7'),'value':_0x5e4252[_0x127d('0x8')][_0x127d('0x6')]}})[_0x127d('0x9')](function(){_0x2ad2f8();})[_0x127d('0xa')](function(_0x1531fe){_0x2ad2f8(_0x1531fe);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index f912350..e8cfd01 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 _0x8d92=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','code','error','MailSubstatus,\x20%s,\x20%s','message','result','catch'];(function(_0x1c90a7,_0x115e4d){var _0x408b33=function(_0x4b2b46){while(--_0x4b2b46){_0x1c90a7['push'](_0x1c90a7['shift']());}};_0x408b33(++_0x115e4d);}(_0x8d92,0xc0));var _0x28d9=function(_0x2cfc8c,_0x5472df){_0x2cfc8c=_0x2cfc8c-0x0;var _0x1de813=_0x8d92[_0x2cfc8c];return _0x1de813;};'use strict';var _=require(_0x28d9('0x0'));var util=require(_0x28d9('0x1'));var moment=require(_0x28d9('0x2'));var BPromise=require(_0x28d9('0x3'));var rs=require(_0x28d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28d9('0x5'))['db'];var utils=require(_0x28d9('0x6'));var logger=require('../../config/logger')(_0x28d9('0x7'));var config=require(_0x28d9('0x8'));var jayson=require(_0x28d9('0x9'));var client=jayson[_0x28d9('0xa')][_0x28d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcdf77c,_0x1b8601,_0x30d65b){return new BPromise(function(_0x511060,_0x1f21bc){return client[_0x28d9('0xc')](_0xcdf77c,_0x30d65b)[_0x28d9('0xd')](function(_0x211b43){logger[_0x28d9('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x1b8601,_0x28d9('0xf'));logger[_0x28d9('0x10')](_0x28d9('0x11'),_0x1b8601,'request\x20sent',JSON['stringify'](_0x211b43));if(_0x211b43['error']){if(_0x211b43['error'][_0x28d9('0x12')]===0x1f4){logger[_0x28d9('0x13')](_0x28d9('0x14'),_0x1b8601,_0x211b43['error'][_0x28d9('0x15')]);return _0x1f21bc(_0x211b43['error'][_0x28d9('0x15')]);}logger[_0x28d9('0x13')](_0x28d9('0x14'),_0x1b8601,_0x211b43[_0x28d9('0x13')][_0x28d9('0x15')]);return _0x511060(_0x211b43[_0x28d9('0x13')]['message']);}else{logger['info'](_0x28d9('0x14'),_0x1b8601,_0x28d9('0xf'));_0x511060(_0x211b43[_0x28d9('0x16')]['message']);}})[_0x28d9('0x17')](function(_0x27a664){logger['error'](_0x28d9('0x14'),_0x1b8601,_0x27a664);_0x1f21bc(_0x27a664);});});} \ No newline at end of file +var _0x8dd6=['../../config/environment','client','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','stringify','code','message','error','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x11c990,_0x49ab64){var _0x57af11=function(_0x426a49){while(--_0x426a49){_0x11c990['push'](_0x11c990['shift']());}};_0x57af11(++_0x49ab64);}(_0x8dd6,0x1b1));var _0x68dd=function(_0x6e884c,_0x2b1a31){_0x6e884c=_0x6e884c-0x0;var _0x3d9895=_0x8dd6[_0x6e884c];return _0x3d9895;};'use strict';var _=require(_0x68dd('0x0'));var util=require(_0x68dd('0x1'));var moment=require(_0x68dd('0x2'));var BPromise=require('bluebird');var rs=require(_0x68dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68dd('0x4'))['db'];var utils=require(_0x68dd('0x5'));var logger=require(_0x68dd('0x6'))(_0x68dd('0x7'));var config=require(_0x68dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x68dd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e28f3,_0x590470,_0x42d192){return new BPromise(function(_0x224a2f,_0x383144){return client[_0x68dd('0xa')](_0x5e28f3,_0x42d192)[_0x68dd('0xb')](function(_0xe40220){logger[_0x68dd('0xc')](_0x68dd('0xd'),_0x590470,'request\x20sent');logger[_0x68dd('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x590470,_0x68dd('0xf'),JSON[_0x68dd('0x10')](_0xe40220));if(_0xe40220['error']){if(_0xe40220['error'][_0x68dd('0x11')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x590470,_0xe40220['error'][_0x68dd('0x12')]);return _0x383144(_0xe40220['error'][_0x68dd('0x12')]);}logger[_0x68dd('0x13')](_0x68dd('0xd'),_0x590470,_0xe40220[_0x68dd('0x13')][_0x68dd('0x12')]);return _0x224a2f(_0xe40220['error'][_0x68dd('0x12')]);}else{logger['info'](_0x68dd('0xd'),_0x590470,_0x68dd('0xf'));_0x224a2f(_0xe40220['result'][_0x68dd('0x12')]);}})[_0x68dd('0x14')](function(_0xa80ba){logger['error'](_0x68dd('0xd'),_0x590470,_0xa80ba);_0x383144(_0xa80ba);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 5916c42..4032d44 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 _0xf3c1=['isAuthenticated','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get'];(function(_0x3d740d,_0x373d2a){var _0x3e32be=function(_0x5438e5){while(--_0x5438e5){_0x3d740d['push'](_0x3d740d['shift']());}};_0x3e32be(++_0x373d2a);}(_0xf3c1,0x1b1));var _0x1f3c=function(_0x4774a9,_0x35f1eb){_0x4774a9=_0x4774a9-0x0;var _0xa92f8e=_0xf3c1[_0x4774a9];return _0xa92f8e;};'use strict';var multer=require(_0x1f3c('0x0'));var util=require(_0x1f3c('0x1'));var path=require(_0x1f3c('0x2'));var timeout=require(_0x1f3c('0x3'));var express=require('express');var router=express[_0x1f3c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1f3c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1f3c('0x6'));var controller=require(_0x1f3c('0x7'));router[_0x1f3c('0x8')]('/',auth[_0x1f3c('0x9')](),controller['index']);router[_0x1f3c('0x8')]('/describe',auth[_0x1f3c('0x9')](),controller['describe']);router['get'](_0x1f3c('0xa'),auth[_0x1f3c('0x9')](),controller[_0x1f3c('0xb')]);router[_0x1f3c('0xc')]('/',auth['isAuthenticated'](),controller[_0x1f3c('0xd')]);router[_0x1f3c('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1f3c('0xf')](_0x1f3c('0xa'),auth[_0x1f3c('0x9')](),controller['destroy']);module[_0x1f3c('0x10')]=router; \ No newline at end of file +var _0xaa2d=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xaa2d,0x1e1));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdaa2('0x0'));var util=require(_0xdaa2('0x1'));var path=require(_0xdaa2('0x2'));var timeout=require('connect-timeout');var express=require(_0xdaa2('0x3'));var router=express[_0xdaa2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdaa2('0x5'));var interaction=require(_0xdaa2('0x6'));var config=require(_0xdaa2('0x7'));var controller=require('./mailTransferReport.controller');router[_0xdaa2('0x8')]('/',auth[_0xdaa2('0x9')](),controller['index']);router[_0xdaa2('0x8')](_0xdaa2('0xa'),auth[_0xdaa2('0x9')](),controller[_0xdaa2('0xb')]);router[_0xdaa2('0x8')](_0xdaa2('0xc'),auth[_0xdaa2('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdaa2('0xd')]);router[_0xdaa2('0xe')]('/:id',auth[_0xdaa2('0x9')](),controller[_0xdaa2('0xf')]);router[_0xdaa2('0x10')](_0xdaa2('0xc'),auth[_0xdaa2('0x9')](),controller['destroy']);module[_0xdaa2('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index c2e96f2..6284d7b 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x9bde,0xe1));var _0xe9bd=function(_0x14dc1,_0x4aff25){_0x14dc1=_0x14dc1-0x0;var _0x19ede2=_0x9bde[_0x14dc1];return _0x19ede2;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x1f09e4,_0x4522e8){var _0x2da258=function(_0x5c42be){while(--_0x5c42be){_0x1f09e4['push'](_0x1f09e4['shift']());}};_0x2da258(++_0x4522e8);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f4600,_0x4845eb){_0x3f4600=_0x3f4600-0x0;var _0x34cf20=_0xedd9[_0x3f4600];return _0x34cf20;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 429fdf4..737fc29 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 _0xe1ad=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','save','update','then','destroy','sendStatus','name','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0xe1ad,0xd7));var _0xde1a=function(_0x371734,_0x2f28ea){_0x371734=_0x371734-0x0;var _0x3bc107=_0xe1ad[_0x371734];return _0x3bc107;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde1a('0x0'));var zipdir=require(_0xde1a('0x1'));var jsonpatch=require(_0xde1a('0x2'));var rp=require(_0xde1a('0x3'));var moment=require(_0xde1a('0x4'));var BPromise=require(_0xde1a('0x5'));var Mustache=require('mustache');var util=require(_0xde1a('0x6'));var path=require(_0xde1a('0x7'));var sox=require(_0xde1a('0x8'));var csv=require(_0xde1a('0x9'));var ejs=require(_0xde1a('0xa'));var fs=require('fs');var fs_extra=require(_0xde1a('0xb'));var _=require(_0xde1a('0xc'));var squel=require('squel');var crypto=require(_0xde1a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xde1a('0xe'));var toCsv=require(_0xde1a('0x9'));var querystring=require(_0xde1a('0xf'));var Papa=require(_0xde1a('0x10'));var Redis=require(_0xde1a('0x11'));var authService=require(_0xde1a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde1a('0x13'));var hardwareService=require(_0xde1a('0x14'));var logger=require(_0xde1a('0x15'))('api');var utils=require(_0xde1a('0x16'));var config=require(_0xde1a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xde1a('0x18'))['db'];function respondWithStatusCode(_0x3c9601,_0x4f1692){_0x4f1692=_0x4f1692||0xcc;return function(_0x53071e){if(_0x53071e){return _0x3c9601['sendStatus'](_0x4f1692);}return _0x3c9601[_0xde1a('0x19')](_0x4f1692)[_0xde1a('0x1a')]();};}function respondWithResult(_0x591b4e,_0x45a177){_0x45a177=_0x45a177||0xc8;return function(_0x17a0eb){if(_0x17a0eb){return _0x591b4e[_0xde1a('0x19')](_0x45a177)['json'](_0x17a0eb);}};}function respondWithFilteredResult(_0x2dbb77,_0x5e9792){return function(_0x4036ca){if(_0x4036ca){var _0x53b420=typeof _0x5e9792[_0xde1a('0x1b')]===_0xde1a('0x1c')&&typeof _0x5e9792['limit']===_0xde1a('0x1c');var _0x1a542a=_0x4036ca[_0xde1a('0x1d')];var _0x520aa4=_0x53b420?0x0:_0x5e9792[_0xde1a('0x1b')];var _0x337b8d=_0x53b420?_0x4036ca[_0xde1a('0x1d')]:_0x5e9792[_0xde1a('0x1b')]+_0x5e9792[_0xde1a('0x1e')];var _0x26a40c;if(_0x337b8d>=_0x1a542a){_0x337b8d=_0x1a542a;_0x26a40c=0xc8;}else{_0x26a40c=0xce;}_0x2dbb77[_0xde1a('0x19')](_0x26a40c);return _0x2dbb77[_0xde1a('0x1f')](_0xde1a('0x20'),_0x520aa4+'-'+_0x337b8d+'/'+_0x1a542a)[_0xde1a('0x21')](_0x4036ca);}return null;};}function patchUpdates(_0xbf9099){return function(_0x40e631){try{jsonpatch['apply'](_0x40e631,_0xbf9099,!![]);}catch(_0x2c3c83){return BPromise['reject'](_0x2c3c83);}return _0x40e631[_0xde1a('0x22')]();};}function saveUpdates(_0x542797,_0x265a45){return function(_0x372525){if(_0x372525){return _0x372525[_0xde1a('0x23')](_0x542797)[_0xde1a('0x24')](function(_0x21d6cc){return _0x21d6cc;});}return null;};}function removeEntity(_0x1890b6,_0x4e0935){return function(_0x3dc378){if(_0x3dc378){return _0x3dc378[_0xde1a('0x25')]()[_0xde1a('0x24')](function(){_0x1890b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc95f,_0x4a65ac){return function(_0x368fe7){if(!_0x368fe7){_0x4fc95f[_0xde1a('0x26')](0x194);}return _0x368fe7;};}function handleError(_0x4e6ddf,_0x4e93aa){_0x4e93aa=_0x4e93aa||0x1f4;return function(_0x345dc2){logger['error'](_0x345dc2['stack']);if(_0x345dc2['name']){delete _0x345dc2[_0xde1a('0x27')];}_0x4e6ddf[_0xde1a('0x19')](_0x4e93aa)['send'](_0x345dc2);};}exports[_0xde1a('0x28')]=function(_0x2106c1,_0x353a82){var _0x4b2cd7={},_0x145177={},_0x13356a={'count':0x0,'rows':[]};var _0x386ca5=_[_0xde1a('0x29')](db[_0xde1a('0x2a')][_0xde1a('0x2b')],function(_0x2a6abf){return{'name':_0x2a6abf[_0xde1a('0x2c')],'type':_0x2a6abf[_0xde1a('0x2d')]['key']};});_0x145177[_0xde1a('0x2e')]=_[_0xde1a('0x29')](_0x386ca5,_0xde1a('0x27'));_0x145177[_0xde1a('0x2f')]=_[_0xde1a('0x30')](_0x2106c1[_0xde1a('0x2f')]);_0x145177[_0xde1a('0x31')]=_[_0xde1a('0x32')](_0x145177['model'],_0x145177[_0xde1a('0x2f')]);_0x4b2cd7[_0xde1a('0x33')]=_[_0xde1a('0x32')](_0x145177[_0xde1a('0x2e')],qs[_0xde1a('0x34')](_0x2106c1[_0xde1a('0x2f')][_0xde1a('0x34')]));_0x4b2cd7[_0xde1a('0x33')]=_0x4b2cd7['attributes'][_0xde1a('0x35')]?_0x4b2cd7[_0xde1a('0x33')]:_0x145177[_0xde1a('0x2e')];if(!_0x2106c1['query'][_0xde1a('0x36')](_0xde1a('0x37'))){_0x4b2cd7[_0xde1a('0x1e')]=qs[_0xde1a('0x1e')](_0x2106c1[_0xde1a('0x2f')][_0xde1a('0x1e')]);_0x4b2cd7['offset']=qs[_0xde1a('0x1b')](_0x2106c1[_0xde1a('0x2f')]['offset']);}_0x4b2cd7[_0xde1a('0x38')]=qs[_0xde1a('0x39')](_0x2106c1[_0xde1a('0x2f')][_0xde1a('0x39')]);_0x4b2cd7['where']=qs[_0xde1a('0x31')](_[_0xde1a('0x3a')](_0x2106c1[_0xde1a('0x2f')],_0x145177[_0xde1a('0x31')]),_0x386ca5);if(_0x2106c1[_0xde1a('0x2f')]['filter']){_0x4b2cd7[_0xde1a('0x3b')]=_[_0xde1a('0x3c')](_0x4b2cd7['where'],{'$or':_['map'](_0x386ca5,function(_0x26b99e){if(_0x26b99e[_0xde1a('0x2d')]!==_0xde1a('0x3d')){var _0x1b29d6={};_0x1b29d6[_0x26b99e[_0xde1a('0x27')]]={'$like':'%'+_0x2106c1[_0xde1a('0x2f')][_0xde1a('0x3e')]+'%'};return _0x1b29d6;}})});}_0x4b2cd7=_[_0xde1a('0x3c')]({},_0x4b2cd7,_0x2106c1[_0xde1a('0x3f')]);var _0x19bb9d={'where':_0x4b2cd7[_0xde1a('0x3b')]};return db['MailTransferReport'][_0xde1a('0x1d')](_0x19bb9d)[_0xde1a('0x24')](function(_0x55ef6a){_0x13356a['count']=_0x55ef6a;if(_0x2106c1[_0xde1a('0x2f')][_0xde1a('0x40')]){_0x4b2cd7[_0xde1a('0x41')]=[{'all':!![]}];}return db[_0xde1a('0x2a')][_0xde1a('0x42')](_0x4b2cd7);})['then'](function(_0x212c08){_0x13356a['rows']=_0x212c08;return _0x13356a;})['then'](respondWithFilteredResult(_0x353a82,_0x4b2cd7))['catch'](handleError(_0x353a82,null));};exports[_0xde1a('0x43')]=function(_0x4f17b6,_0x39ed7a){var _0x5cdaae={'raw':!![],'where':{'id':_0x4f17b6['params']['id']}},_0x2b4acc={};_0x2b4acc[_0xde1a('0x2e')]=_[_0xde1a('0x30')](db[_0xde1a('0x2a')]['rawAttributes']);_0x2b4acc['query']=_['keys'](_0x4f17b6[_0xde1a('0x2f')]);_0x2b4acc[_0xde1a('0x31')]=_[_0xde1a('0x32')](_0x2b4acc[_0xde1a('0x2e')],_0x2b4acc[_0xde1a('0x2f')]);_0x5cdaae['attributes']=_[_0xde1a('0x32')](_0x2b4acc[_0xde1a('0x2e')],qs['fields'](_0x4f17b6['query']['fields']));_0x5cdaae[_0xde1a('0x33')]=_0x5cdaae[_0xde1a('0x33')][_0xde1a('0x35')]?_0x5cdaae[_0xde1a('0x33')]:_0x2b4acc[_0xde1a('0x2e')];if(_0x4f17b6[_0xde1a('0x2f')][_0xde1a('0x40')]){_0x5cdaae[_0xde1a('0x41')]=[{'all':!![]}];}_0x5cdaae=_[_0xde1a('0x3c')]({},_0x5cdaae,_0x4f17b6[_0xde1a('0x3f')]);return db['MailTransferReport'][_0xde1a('0x44')](_0x5cdaae)['then'](handleEntityNotFound(_0x39ed7a,null))[_0xde1a('0x24')](respondWithResult(_0x39ed7a,null))[_0xde1a('0x45')](handleError(_0x39ed7a,null));};exports[_0xde1a('0x46')]=function(_0x4de684,_0x27396c){return db[_0xde1a('0x2a')][_0xde1a('0x46')](_0x4de684[_0xde1a('0x47')],{})[_0xde1a('0x24')](respondWithResult(_0x27396c,0xc9))[_0xde1a('0x45')](handleError(_0x27396c,null));};exports['update']=function(_0x26b91b,_0x19c304){if(_0x26b91b[_0xde1a('0x47')]['id']){delete _0x26b91b['body']['id'];}return db[_0xde1a('0x2a')][_0xde1a('0x44')]({'where':{'id':_0x26b91b[_0xde1a('0x48')]['id']}})[_0xde1a('0x24')](handleEntityNotFound(_0x19c304,null))[_0xde1a('0x24')](saveUpdates(_0x26b91b[_0xde1a('0x47')],null))[_0xde1a('0x24')](respondWithResult(_0x19c304,null))[_0xde1a('0x45')](handleError(_0x19c304,null));};exports['destroy']=function(_0xb26e2f,_0x9d3215){return db[_0xde1a('0x2a')][_0xde1a('0x44')]({'where':{'id':_0xb26e2f[_0xde1a('0x48')]['id']}})[_0xde1a('0x24')](handleEntityNotFound(_0x9d3215,null))[_0xde1a('0x24')](removeEntity(_0x9d3215,null))[_0xde1a('0x45')](handleError(_0x9d3215,null));};exports[_0xde1a('0x49')]=function(_0x5ce739,_0x1fc9f5){return db[_0xde1a('0x2a')][_0xde1a('0x49')]()['then'](respondWithResult(_0x1fc9f5,null))[_0xde1a('0x45')](handleError(_0x1fc9f5,null));}; \ No newline at end of file +var _0x84f9=['path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../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','limit','offset','count','set','apply','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MailTransferReport','includeAll','include','rows','show','params','keys','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x9edfba,_0x2e18e5){var _0x202480=function(_0x3b7442){while(--_0x3b7442){_0x9edfba['push'](_0x9edfba['shift']());}};_0x202480(++_0x2e18e5);}(_0x84f9,0x16b));var _0x984f=function(_0x4ab9d8,_0x211196){_0x4ab9d8=_0x4ab9d8-0x0;var _0x2b7b2e=_0x84f9[_0x4ab9d8];return _0x2b7b2e;};'use strict';var emlformat=require(_0x984f('0x0'));var rimraf=require(_0x984f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x984f('0x2'));var rp=require(_0x984f('0x3'));var moment=require(_0x984f('0x4'));var BPromise=require(_0x984f('0x5'));var Mustache=require('mustache');var util=require(_0x984f('0x6'));var path=require(_0x984f('0x7'));var sox=require('sox');var csv=require(_0x984f('0x8'));var ejs=require(_0x984f('0x9'));var fs=require('fs');var fs_extra=require(_0x984f('0xa'));var _=require(_0x984f('0xb'));var squel=require(_0x984f('0xc'));var crypto=require('crypto');var jsforce=require(_0x984f('0xd'));var deskjs=require(_0x984f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x984f('0xf'));var qs=require(_0x984f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x984f('0x11'));var logger=require(_0x984f('0x12'))(_0x984f('0x13'));var utils=require(_0x984f('0x14'));var config=require(_0x984f('0x15'));var licenseUtil=require(_0x984f('0x16'));var db=require(_0x984f('0x17'))['db'];function respondWithStatusCode(_0x3f06f2,_0x1873eb){_0x1873eb=_0x1873eb||0xcc;return function(_0x53ebe9){if(_0x53ebe9){return _0x3f06f2[_0x984f('0x18')](_0x1873eb);}return _0x3f06f2[_0x984f('0x19')](_0x1873eb)[_0x984f('0x1a')]();};}function respondWithResult(_0xab4960,_0x3f5f19){_0x3f5f19=_0x3f5f19||0xc8;return function(_0x53e21e){if(_0x53e21e){return _0xab4960[_0x984f('0x19')](_0x3f5f19)[_0x984f('0x1b')](_0x53e21e);}};}function respondWithFilteredResult(_0x384403,_0x35d147){return function(_0x6602b5){if(_0x6602b5){var _0x4b334d=typeof _0x35d147['offset']===_0x984f('0x1c')&&typeof _0x35d147[_0x984f('0x1d')]===_0x984f('0x1c');var _0xc4030f=_0x6602b5['count'];var _0x47271e=_0x4b334d?0x0:_0x35d147[_0x984f('0x1e')];var _0x39dafe=_0x4b334d?_0x6602b5[_0x984f('0x1f')]:_0x35d147['offset']+_0x35d147['limit'];var _0x4a2789;if(_0x39dafe>=_0xc4030f){_0x39dafe=_0xc4030f;_0x4a2789=0xc8;}else{_0x4a2789=0xce;}_0x384403[_0x984f('0x19')](_0x4a2789);return _0x384403[_0x984f('0x20')]('Content-Range',_0x47271e+'-'+_0x39dafe+'/'+_0xc4030f)[_0x984f('0x1b')](_0x6602b5);}return null;};}function patchUpdates(_0x3b4b32){return function(_0x2f610c){try{jsonpatch[_0x984f('0x21')](_0x2f610c,_0x3b4b32,!![]);}catch(_0x23cb2b){return BPromise['reject'](_0x23cb2b);}return _0x2f610c[_0x984f('0x22')]();};}function saveUpdates(_0x120ca9,_0x3bf6ad){return function(_0x691b49){if(_0x691b49){return _0x691b49[_0x984f('0x23')](_0x120ca9)[_0x984f('0x24')](function(_0x397c88){return _0x397c88;});}return null;};}function removeEntity(_0x47a725,_0x8e6a4e){return function(_0x4b9199){if(_0x4b9199){return _0x4b9199['destroy']()[_0x984f('0x24')](function(){_0x47a725['status'](0xcc)[_0x984f('0x1a')]();});}};}function handleEntityNotFound(_0x3c28ad,_0x48fb34){return function(_0x14d0b0){if(!_0x14d0b0){_0x3c28ad[_0x984f('0x18')](0x194);}return _0x14d0b0;};}function handleError(_0x1753a0,_0x20afb0){_0x20afb0=_0x20afb0||0x1f4;return function(_0xb96353){logger[_0x984f('0x25')](_0xb96353[_0x984f('0x26')]);if(_0xb96353[_0x984f('0x27')]){delete _0xb96353[_0x984f('0x27')];}_0x1753a0[_0x984f('0x19')](_0x20afb0)[_0x984f('0x28')](_0xb96353);};}exports['index']=function(_0x1e4f37,_0x5462a6){var _0x35ed42={},_0x3f07d6={},_0x4f4c32={'count':0x0,'rows':[]};var _0x94dc6e=_[_0x984f('0x29')](db['MailTransferReport'][_0x984f('0x2a')],function(_0x2584ea){return{'name':_0x2584ea[_0x984f('0x2b')],'type':_0x2584ea[_0x984f('0x2c')][_0x984f('0x2d')]};});_0x3f07d6[_0x984f('0x2e')]=_[_0x984f('0x29')](_0x94dc6e,_0x984f('0x27'));_0x3f07d6[_0x984f('0x2f')]=_['keys'](_0x1e4f37[_0x984f('0x2f')]);_0x3f07d6[_0x984f('0x30')]=_[_0x984f('0x31')](_0x3f07d6[_0x984f('0x2e')],_0x3f07d6[_0x984f('0x2f')]);_0x35ed42[_0x984f('0x32')]=_[_0x984f('0x31')](_0x3f07d6[_0x984f('0x2e')],qs[_0x984f('0x33')](_0x1e4f37[_0x984f('0x2f')][_0x984f('0x33')]));_0x35ed42[_0x984f('0x32')]=_0x35ed42[_0x984f('0x32')][_0x984f('0x34')]?_0x35ed42[_0x984f('0x32')]:_0x3f07d6[_0x984f('0x2e')];if(!_0x1e4f37[_0x984f('0x2f')][_0x984f('0x35')](_0x984f('0x36'))){_0x35ed42[_0x984f('0x1d')]=qs[_0x984f('0x1d')](_0x1e4f37['query'][_0x984f('0x1d')]);_0x35ed42[_0x984f('0x1e')]=qs['offset'](_0x1e4f37[_0x984f('0x2f')]['offset']);}_0x35ed42['order']=qs[_0x984f('0x37')](_0x1e4f37[_0x984f('0x2f')]['sort']);_0x35ed42[_0x984f('0x38')]=qs[_0x984f('0x30')](_['pick'](_0x1e4f37[_0x984f('0x2f')],_0x3f07d6[_0x984f('0x30')]),_0x94dc6e);if(_0x1e4f37[_0x984f('0x2f')][_0x984f('0x39')]){_0x35ed42[_0x984f('0x38')]=_[_0x984f('0x3a')](_0x35ed42[_0x984f('0x38')],{'$or':_[_0x984f('0x29')](_0x94dc6e,function(_0x565f2c){if(_0x565f2c['type']!==_0x984f('0x3b')){var _0x1b0bc8={};_0x1b0bc8[_0x565f2c['name']]={'$like':'%'+_0x1e4f37['query'][_0x984f('0x39')]+'%'};return _0x1b0bc8;}})});}_0x35ed42=_[_0x984f('0x3a')]({},_0x35ed42,_0x1e4f37[_0x984f('0x3c')]);var _0x1b72b8={'where':_0x35ed42[_0x984f('0x38')]};return db[_0x984f('0x3d')][_0x984f('0x1f')](_0x1b72b8)['then'](function(_0x5bde2e){_0x4f4c32['count']=_0x5bde2e;if(_0x1e4f37[_0x984f('0x2f')][_0x984f('0x3e')]){_0x35ed42[_0x984f('0x3f')]=[{'all':!![]}];}return db[_0x984f('0x3d')]['findAll'](_0x35ed42);})['then'](function(_0x58297b){_0x4f4c32[_0x984f('0x40')]=_0x58297b;return _0x4f4c32;})['then'](respondWithFilteredResult(_0x5462a6,_0x35ed42))['catch'](handleError(_0x5462a6,null));};exports[_0x984f('0x41')]=function(_0x54ffdd,_0x39aa29){var _0x4344b1={'raw':!![],'where':{'id':_0x54ffdd[_0x984f('0x42')]['id']}},_0x24d27b={};_0x24d27b[_0x984f('0x2e')]=_[_0x984f('0x43')](db[_0x984f('0x3d')][_0x984f('0x2a')]);_0x24d27b[_0x984f('0x2f')]=_[_0x984f('0x43')](_0x54ffdd[_0x984f('0x2f')]);_0x24d27b[_0x984f('0x30')]=_[_0x984f('0x31')](_0x24d27b[_0x984f('0x2e')],_0x24d27b[_0x984f('0x2f')]);_0x4344b1[_0x984f('0x32')]=_[_0x984f('0x31')](_0x24d27b[_0x984f('0x2e')],qs['fields'](_0x54ffdd[_0x984f('0x2f')]['fields']));_0x4344b1[_0x984f('0x32')]=_0x4344b1[_0x984f('0x32')][_0x984f('0x34')]?_0x4344b1[_0x984f('0x32')]:_0x24d27b[_0x984f('0x2e')];if(_0x54ffdd['query'][_0x984f('0x3e')]){_0x4344b1[_0x984f('0x3f')]=[{'all':!![]}];}_0x4344b1=_[_0x984f('0x3a')]({},_0x4344b1,_0x54ffdd[_0x984f('0x3c')]);return db[_0x984f('0x3d')][_0x984f('0x44')](_0x4344b1)[_0x984f('0x24')](handleEntityNotFound(_0x39aa29,null))[_0x984f('0x24')](respondWithResult(_0x39aa29,null))[_0x984f('0x45')](handleError(_0x39aa29,null));};exports[_0x984f('0x46')]=function(_0x34231b,_0xcd7ac0){return db[_0x984f('0x3d')]['create'](_0x34231b[_0x984f('0x47')],{})['then'](respondWithResult(_0xcd7ac0,0xc9))[_0x984f('0x45')](handleError(_0xcd7ac0,null));};exports[_0x984f('0x23')]=function(_0x481903,_0x4aa180){if(_0x481903[_0x984f('0x47')]['id']){delete _0x481903[_0x984f('0x47')]['id'];}return db['MailTransferReport'][_0x984f('0x44')]({'where':{'id':_0x481903['params']['id']}})[_0x984f('0x24')](handleEntityNotFound(_0x4aa180,null))['then'](saveUpdates(_0x481903[_0x984f('0x47')],null))[_0x984f('0x24')](respondWithResult(_0x4aa180,null))[_0x984f('0x45')](handleError(_0x4aa180,null));};exports[_0x984f('0x48')]=function(_0x5a9048,_0x258162){return db[_0x984f('0x3d')][_0x984f('0x44')]({'where':{'id':_0x5a9048[_0x984f('0x42')]['id']}})[_0x984f('0x24')](handleEntityNotFound(_0x258162,null))[_0x984f('0x24')](removeEntity(_0x258162,null))['catch'](handleError(_0x258162,null));};exports['describe']=function(_0x5d607c,_0x271c23){return db[_0x984f('0x3d')][_0x984f('0x49')]()[_0x984f('0x24')](respondWithResult(_0x271c23,null))[_0x984f('0x45')](handleError(_0x271c23,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c52b1f7..7f3e391 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 _0x50b9=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3a6c8d,_0x3a400a){var _0x50e983=function(_0x5f11a5){while(--_0x5f11a5){_0x3a6c8d['push'](_0x3a6c8d['shift']());}};_0x50e983(++_0x3a400a);}(_0x50b9,0x171));var _0x950b=function(_0x3f6f78,_0x222d85){_0x3f6f78=_0x3f6f78-0x0;var _0x534963=_0x50b9[_0x3f6f78];return _0x534963;};'use strict';var _=require(_0x950b('0x0'));var util=require('util');var logger=require(_0x950b('0x1'))('api');var moment=require(_0x950b('0x2'));var BPromise=require(_0x950b('0x3'));var rp=require(_0x950b('0x4'));var fs=require('fs');var path=require(_0x950b('0x5'));var rimraf=require(_0x950b('0x6'));var config=require(_0x950b('0x7'));var attributes=require(_0x950b('0x8'));module[_0x950b('0x9')]=function(_0xc9024,_0x56ce3f){return _0xc9024[_0x950b('0xa')](_0x950b('0xb'),attributes,{'tableName':_0x950b('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x367c=['report_mail_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport'];(function(_0x425dd0,_0x2070d8){var _0x5ecde7=function(_0x4ed7da){while(--_0x4ed7da){_0x425dd0['push'](_0x425dd0['shift']());}};_0x5ecde7(++_0x2070d8);}(_0x367c,0x1b4));var _0xc367=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0x367c[_0x3efe87];return _0x56a4cc;};'use strict';var _=require('lodash');var util=require(_0xc367('0x0'));var logger=require(_0xc367('0x1'))(_0xc367('0x2'));var moment=require(_0xc367('0x3'));var BPromise=require(_0xc367('0x4'));var rp=require(_0xc367('0x5'));var fs=require('fs');var path=require(_0xc367('0x6'));var rimraf=require(_0xc367('0x7'));var config=require(_0xc367('0x8'));var attributes=require(_0xc367('0x9'));module[_0xc367('0xa')]=function(_0x2bafa9,_0x4f8967){return _0x2bafa9['define'](_0xc367('0xb'),attributes,{'tableName':_0xc367('0xc'),'paranoid':![],'indexes':[{'name':_0xc367('0xd'),'fields':[_0xc367('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 3a817ce..933a6ba 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 _0x1fb4=['request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0x32bdff,_0xfd9741){var _0x251420=function(_0x2b699a){while(--_0x2b699a){_0x32bdff['push'](_0x32bdff['shift']());}};_0x251420(++_0xfd9741);}(_0x1fb4,0xed));var _0x41fb=function(_0x239bcd,_0x44cf65){_0x239bcd=_0x239bcd-0x0;var _0x511a85=_0x1fb4[_0x239bcd];return _0x511a85;};'use strict';var _=require(_0x41fb('0x0'));var util=require(_0x41fb('0x1'));var moment=require(_0x41fb('0x2'));var BPromise=require(_0x41fb('0x3'));var rs=require(_0x41fb('0x4'));var fs=require('fs');var Redis=require(_0x41fb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x41fb('0x6'));var logger=require(_0x41fb('0x7'))(_0x41fb('0x8'));var config=require(_0x41fb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x41fb('0xa')][_0x41fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x165009,_0xdfba49,_0x1da4eb){return new BPromise(function(_0x4440a1,_0x3b8939){return client[_0x41fb('0xc')](_0x165009,_0x1da4eb)[_0x41fb('0xd')](function(_0x590eb9){logger[_0x41fb('0xe')](_0x41fb('0xf'),_0xdfba49,_0x41fb('0x10'));logger[_0x41fb('0x11')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xdfba49,_0x41fb('0x10'),JSON[_0x41fb('0x12')](_0x590eb9));if(_0x590eb9[_0x41fb('0x13')]){if(_0x590eb9['error'][_0x41fb('0x14')]===0x1f4){logger[_0x41fb('0x13')](_0x41fb('0xf'),_0xdfba49,_0x590eb9[_0x41fb('0x13')]['message']);return _0x3b8939(_0x590eb9[_0x41fb('0x13')][_0x41fb('0x15')]);}logger[_0x41fb('0x13')](_0x41fb('0xf'),_0xdfba49,_0x590eb9[_0x41fb('0x13')]['message']);return _0x4440a1(_0x590eb9['error'][_0x41fb('0x15')]);}else{logger[_0x41fb('0xe')](_0x41fb('0xf'),_0xdfba49,_0x41fb('0x10'));_0x4440a1(_0x590eb9['result'][_0x41fb('0x15')]);}})[_0x41fb('0x16')](function(_0x350f35){logger[_0x41fb('0x13')](_0x41fb('0xf'),_0xdfba49,_0x350f35);_0x3b8939(_0x350f35);});});} \ No newline at end of file +var _0x2317=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then'];(function(_0x4811e7,_0xbfd782){var _0x36b7e4=function(_0x547d36){while(--_0x547d36){_0x4811e7['push'](_0x4811e7['shift']());}};_0x36b7e4(++_0xbfd782);}(_0x2317,0xb2));var _0x7231=function(_0x32ad2f,_0x1b574a){_0x32ad2f=_0x32ad2f-0x0;var _0x4ae8d4=_0x2317[_0x32ad2f];return _0x4ae8d4;};'use strict';var _=require(_0x7231('0x0'));var util=require(_0x7231('0x1'));var moment=require(_0x7231('0x2'));var BPromise=require(_0x7231('0x3'));var rs=require(_0x7231('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7231('0x5'))['db'];var utils=require(_0x7231('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7231('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7231('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cd00a,_0x16eb16,_0x4d3a9a){return new BPromise(function(_0x5bce0d,_0x2734ab){return client[_0x7231('0x9')](_0x3cd00a,_0x4d3a9a)[_0x7231('0xa')](function(_0x5368e5){logger[_0x7231('0xb')](_0x7231('0xc'),_0x16eb16,_0x7231('0xd'));logger[_0x7231('0xe')](_0x7231('0xf'),_0x16eb16,_0x7231('0xd'),JSON['stringify'](_0x5368e5));if(_0x5368e5[_0x7231('0x10')]){if(_0x5368e5['error'][_0x7231('0x11')]===0x1f4){logger[_0x7231('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x16eb16,_0x5368e5[_0x7231('0x10')][_0x7231('0x12')]);return _0x2734ab(_0x5368e5[_0x7231('0x10')][_0x7231('0x12')]);}logger[_0x7231('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x16eb16,_0x5368e5[_0x7231('0x10')][_0x7231('0x12')]);return _0x5bce0d(_0x5368e5[_0x7231('0x10')][_0x7231('0x12')]);}else{logger[_0x7231('0xb')](_0x7231('0xc'),_0x16eb16,'request\x20sent');_0x5bce0d(_0x5368e5[_0x7231('0x13')][_0x7231('0x12')]);}})[_0x7231('0x14')](function(_0x3356db){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x16eb16,_0x3356db);_0x2734ab(_0x3356db);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 628bf66..7ec2089 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 _0x86ba=['get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../config/environment'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0x86ba,0x1e8));var _0xa86b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x86ba[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xa86b('0x0'));var util=require(_0xa86b('0x1'));var path=require(_0xa86b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa86b('0x3')]();var fs_extra=require(_0xa86b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa86b('0x5'));var controller=require('./memberReport.controller');router[_0xa86b('0x6')]('/',auth[_0xa86b('0x7')](),controller[_0xa86b('0x8')]);router[_0xa86b('0x6')](_0xa86b('0x9'),auth[_0xa86b('0x7')](),controller[_0xa86b('0xa')]);router[_0xa86b('0x6')]('/:id',auth[_0xa86b('0x7')](),controller[_0xa86b('0xb')]);router[_0xa86b('0xc')]('/',auth['isAuthenticated'](),controller[_0xa86b('0xd')]);router[_0xa86b('0xe')](_0xa86b('0xf'),auth[_0xa86b('0x7')](),controller[_0xa86b('0x10')]);router[_0xa86b('0x11')](_0xa86b('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xa86b('0x12')]=router; \ No newline at end of file +var _0x0535=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x9c40d8,_0x4ff8f9){var _0x1e9010=function(_0x103287){while(--_0x103287){_0x9c40d8['push'](_0x9c40d8['shift']());}};_0x1e9010(++_0x4ff8f9);}(_0x0535,0x1b5));var _0x5053=function(_0x3865ad,_0x39ae05){_0x3865ad=_0x3865ad-0x0;var _0xcd60bb=_0x0535[_0x3865ad];return _0xcd60bb;};'use strict';var multer=require(_0x5053('0x0'));var util=require(_0x5053('0x1'));var path=require(_0x5053('0x2'));var timeout=require(_0x5053('0x3'));var express=require(_0x5053('0x4'));var router=express[_0x5053('0x5')]();var fs_extra=require(_0x5053('0x6'));var auth=require(_0x5053('0x7'));var interaction=require(_0x5053('0x8'));var config=require(_0x5053('0x9'));var controller=require(_0x5053('0xa'));router[_0x5053('0xb')]('/',auth[_0x5053('0xc')](),controller['index']);router[_0x5053('0xb')](_0x5053('0xd'),auth[_0x5053('0xc')](),controller[_0x5053('0xe')]);router[_0x5053('0xb')](_0x5053('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x5053('0x10')]('/',auth[_0x5053('0xc')](),controller[_0x5053('0x11')]);router['put'](_0x5053('0xf'),auth[_0x5053('0xc')](),controller[_0x5053('0x12')]);router[_0x5053('0x13')](_0x5053('0xf'),auth['isAuthenticated'](),controller[_0x5053('0x14')]);module[_0x5053('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index ae25e01..eca1f7f 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 _0xe4ee=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment'];(function(_0x1d1eaf,_0x31b7bc){var _0xb0dc37=function(_0x2db2d4){while(--_0x2db2d4){_0x1d1eaf['push'](_0x1d1eaf['shift']());}};_0xb0dc37(++_0x31b7bc);}(_0xe4ee,0xca));var _0xee4e=function(_0x55f264,_0x30f731){_0x55f264=_0x55f264-0x0;var _0x1c46ac=_0xe4ee[_0x55f264];return _0x1c46ac;};'use strict';var Sequelize=require(_0xee4e('0x0'));var moment=require(_0xee4e('0x1'));module[_0xee4e('0x2')]={'channel':{'type':Sequelize[_0xee4e('0x3')]},'membername':{'type':Sequelize[_0xee4e('0x3')]},'interface':{'type':Sequelize[_0xee4e('0x3')]},'type':{'type':Sequelize[_0xee4e('0x3')],'defaultValue':_0xee4e('0x4'),'comment':_0xee4e('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xee4e('0x6')],'set':function(_0x473d98){var _0x3b390d=moment(_0x473d98);var _0x225cde=moment(this['getDataValue'](_0xee4e('0x7')));var _0x5e38c0=_0x3b390d[_0xee4e('0x8')](_0x225cde,_0xee4e('0x9'));this[_0xee4e('0xa')](_0xee4e('0xb'),_0x473d98);this[_0xee4e('0xa')]('duration',_0x5e38c0>=0x0?_0x5e38c0:null);}},'data1':{'type':Sequelize[_0xee4e('0x3')],'comment':_0xee4e('0xc')},'data2':{'type':Sequelize[_0xee4e('0x3')],'comment':_0xee4e('0xd')},'data3':{'type':Sequelize[_0xee4e('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xee4e('0x3')],'comment':_0xee4e('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0xee4e('0xf')},'role':{'type':Sequelize[_0xee4e('0x3')]},'internal':{'type':Sequelize[_0xee4e('0x10')]},'uniqueid':{'type':Sequelize[_0xee4e('0x3')]}}; \ No newline at end of file +var _0xb5a2=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x2132b7,_0x52e70b){var _0x2f0592=function(_0x1861af){while(--_0x1861af){_0x2132b7['push'](_0x2132b7['shift']());}};_0x2f0592(++_0x52e70b);}(_0xb5a2,0x136));var _0x2b5a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb5a2[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x2b5a('0x0'));var moment=require(_0x2b5a('0x1'));module[_0x2b5a('0x2')]={'channel':{'type':Sequelize[_0x2b5a('0x3')]},'membername':{'type':Sequelize[_0x2b5a('0x3')]},'interface':{'type':Sequelize[_0x2b5a('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x2b5a('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x2b5a('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2b5a('0x6')],'set':function(_0x4a5343){var _0x49605f=moment(_0x4a5343);var _0x18dcd3=moment(this['getDataValue']('enterAt'));var _0xeea1df=_0x49605f[_0x2b5a('0x7')](_0x18dcd3,_0x2b5a('0x8'));this[_0x2b5a('0x9')](_0x2b5a('0xa'),_0x4a5343);this[_0x2b5a('0x9')](_0x2b5a('0xb'),_0xeea1df>=0x0?_0xeea1df:null);}},'data1':{'type':Sequelize[_0x2b5a('0x3')],'comment':_0x2b5a('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x2b5a('0xd')},'data3':{'type':Sequelize[_0x2b5a('0x3')],'comment':_0x2b5a('0xe')},'data4':{'type':Sequelize[_0x2b5a('0x3')],'comment':_0x2b5a('0xf')},'data5':{'type':Sequelize[_0x2b5a('0x3')],'comment':_0x2b5a('0x10')},'role':{'type':Sequelize[_0x2b5a('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2b5a('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index c6ab945..fd3c3fb 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x548201,_0x17184c){var _0xbd5349=function(_0x3c83b9){while(--_0x3c83b9){_0x548201['push'](_0x548201['shift']());}};_0xbd5349(++_0x17184c);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x5d9b37,_0x48fefc){var _0x297f17=function(_0x59d0a8){while(--_0x59d0a8){_0x5d9b37['push'](_0x5d9b37['shift']());}};_0x297f17(++_0x48fefc);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index f4990e5..5504ac7 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 _0x1c59=['membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','exports','define','membername_interface'];(function(_0xbc5e53,_0x5c06ae){var _0x56b9a8=function(_0xece28d){while(--_0xece28d){_0xbc5e53['push'](_0xbc5e53['shift']());}};_0x56b9a8(++_0x5c06ae);}(_0x1c59,0x18e));var _0x91c5=function(_0x4031af,_0x2f9433){_0x4031af=_0x4031af-0x0;var _0x44dd90=_0x1c59[_0x4031af];return _0x44dd90;};'use strict';var _=require(_0x91c5('0x0'));var util=require(_0x91c5('0x1'));var logger=require(_0x91c5('0x2'))(_0x91c5('0x3'));var moment=require(_0x91c5('0x4'));var BPromise=require(_0x91c5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91c5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x91c5('0x7')]=function(_0x4c23bd,_0x135d6b){return _0x4c23bd[_0x91c5('0x8')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x91c5('0x9'),'fields':[_0x91c5('0xa'),_0x91c5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xce79=['./memberReport.attributes','exports','MemberReport','report_member','lodash','util','api','moment','bluebird','../../config/environment'];(function(_0x5805bb,_0x26b7c1){var _0x128608=function(_0x25562b){while(--_0x25562b){_0x5805bb['push'](_0x5805bb['shift']());}};_0x128608(++_0x26b7c1);}(_0xce79,0xc2));var _0x9ce7=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0xce79[_0x5cab28];return _0xa3554d;};'use strict';var _=require(_0x9ce7('0x0'));var util=require(_0x9ce7('0x1'));var logger=require('../../config/logger')(_0x9ce7('0x2'));var moment=require(_0x9ce7('0x3'));var BPromise=require(_0x9ce7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ce7('0x5'));var attributes=require(_0x9ce7('0x6'));module[_0x9ce7('0x7')]=function(_0x6b9896,_0x3cdf23){return _0x6b9896['define'](_0x9ce7('0x8'),attributes,{'tableName':_0x9ce7('0x9'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index ad7b5ad..9f62d57 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 _0x16a6=['options','raw','limit','include','map','model','attributes','debug','catch','CreateMemberReport','MemberReport','body','UpdateMemberReport','update','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','findAll'];(function(_0x5e5ce2,_0x16a3a2){var _0x202455=function(_0x58d66d){while(--_0x58d66d){_0x5e5ce2['push'](_0x5e5ce2['shift']());}};_0x202455(++_0x16a3a2);}(_0x16a6,0x15c));var _0x616a=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x16a6[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x616a('0x0'));var util=require(_0x616a('0x1'));var moment=require('moment');var BPromise=require(_0x616a('0x2'));var rs=require(_0x616a('0x3'));var fs=require('fs');var Redis=require(_0x616a('0x4'));var db=require(_0x616a('0x5'))['db'];var utils=require(_0x616a('0x6'));var logger=require(_0x616a('0x7'))('rpc');var config=require(_0x616a('0x8'));var jayson=require(_0x616a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x938824,_0x455029,_0x574141){return new BPromise(function(_0x4ef45c,_0x19ecf9){return client['request'](_0x938824,_0x574141)[_0x616a('0xa')](function(_0x54dbce){logger[_0x616a('0xb')](_0x616a('0xc'),_0x455029,_0x616a('0xd'));logger['debug'](_0x616a('0xe'),_0x455029,_0x616a('0xd'),JSON[_0x616a('0xf')](_0x54dbce));if(_0x54dbce[_0x616a('0x10')]){if(_0x54dbce[_0x616a('0x10')][_0x616a('0x11')]===0x1f4){logger[_0x616a('0x10')](_0x616a('0xc'),_0x455029,_0x54dbce['error'][_0x616a('0x12')]);return _0x19ecf9(_0x54dbce[_0x616a('0x10')][_0x616a('0x12')]);}logger[_0x616a('0x10')](_0x616a('0xc'),_0x455029,_0x54dbce['error'][_0x616a('0x12')]);return _0x4ef45c(_0x54dbce[_0x616a('0x10')][_0x616a('0x12')]);}else{logger[_0x616a('0xb')](_0x616a('0xc'),_0x455029,'request\x20sent');_0x4ef45c(_0x54dbce[_0x616a('0x13')][_0x616a('0x12')]);}})['catch'](function(_0x5d1981){logger[_0x616a('0x10')](_0x616a('0xc'),_0x455029,_0x5d1981);_0x19ecf9(_0x5d1981);});});}exports[_0x616a('0x14')]=function(_0x4d59e7){var _0x5f447d=this;return new Promise(function(_0x1f3241,_0x5b4c52){return db['MemberReport'][_0x616a('0x15')]({'raw':_0x4d59e7[_0x616a('0x16')]?_0x4d59e7[_0x616a('0x16')][_0x616a('0x17')]===undefined?!![]:![]:!![],'where':_0x4d59e7['options']?_0x4d59e7['options']['where']||null:null,'attributes':_0x4d59e7['options']?_0x4d59e7['options']['attributes']||null:null,'limit':_0x4d59e7[_0x616a('0x16')]?_0x4d59e7['options'][_0x616a('0x18')]||null:null,'include':_0x4d59e7[_0x616a('0x16')]?_0x4d59e7['options'][_0x616a('0x19')]?_[_0x616a('0x1a')](_0x4d59e7[_0x616a('0x16')][_0x616a('0x19')],function(_0x500c22){return{'model':db[_0x500c22[_0x616a('0x1b')]],'as':_0x500c22['as'],'attributes':_0x500c22[_0x616a('0x1c')],'include':_0x500c22[_0x616a('0x19')]?_[_0x616a('0x1a')](_0x500c22['include'],function(_0x3e11f2){return{'model':db[_0x3e11f2['model']],'as':_0x3e11f2['as'],'attributes':_0x3e11f2[_0x616a('0x1c')],'include':_0x3e11f2[_0x616a('0x19')]?_['map'](_0x3e11f2['include'],function(_0x50c6b8){return{'model':db[_0x50c6b8[_0x616a('0x1b')]],'as':_0x50c6b8['as'],'attributes':_0x50c6b8[_0x616a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x616a('0xa')](function(_0x1ba9db){logger['info'](_0x616a('0x14'),_0x4d59e7);logger[_0x616a('0x1d')](_0x616a('0x14'),_0x4d59e7,JSON[_0x616a('0xf')](_0x1ba9db));_0x1f3241(_0x1ba9db);})[_0x616a('0x1e')](function(_0x87db00){logger[_0x616a('0x10')]('GetMemberReport',_0x87db00[_0x616a('0x12')],_0x4d59e7);_0x5b4c52(_0x5f447d[_0x616a('0x10')](0x1f4,_0x87db00['message']));});});};exports[_0x616a('0x1f')]=function(_0x5c4a65){var _0x5f00d0=this;return new Promise(function(_0x4726a1,_0x4032d8){return db[_0x616a('0x20')]['create'](_0x5c4a65[_0x616a('0x21')],{'raw':_0x5c4a65[_0x616a('0x16')]?_0x5c4a65[_0x616a('0x16')][_0x616a('0x17')]===undefined?!![]:![]:!![]})[_0x616a('0xa')](function(_0x3bfbd1){logger['info'](_0x616a('0x1f'),_0x5c4a65);logger['debug'](_0x616a('0x1f'),_0x5c4a65,JSON[_0x616a('0xf')](_0x3bfbd1));_0x4726a1(_0x3bfbd1);})[_0x616a('0x1e')](function(_0x5bfc46){logger[_0x616a('0x10')](_0x616a('0x1f'),_0x5bfc46['message'],_0x5c4a65);_0x4032d8(_0x5f00d0['error'](0x1f4,_0x5bfc46[_0x616a('0x12')]));});});};exports[_0x616a('0x22')]=function(_0x3e7301){var _0x12fd21=this;return new Promise(function(_0x562688,_0x50b9bb){return db['MemberReport'][_0x616a('0x23')](_0x3e7301[_0x616a('0x21')],{'raw':_0x3e7301[_0x616a('0x16')]?_0x3e7301[_0x616a('0x16')][_0x616a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e7301[_0x616a('0x16')]?_0x3e7301[_0x616a('0x16')][_0x616a('0x24')]||null:null,'attributes':_0x3e7301[_0x616a('0x16')]?_0x3e7301[_0x616a('0x16')]['attributes']||null:null,'limit':_0x3e7301[_0x616a('0x16')]?_0x3e7301['options'][_0x616a('0x18')]||null:null})[_0x616a('0xa')](function(_0x2201de){logger[_0x616a('0xb')](_0x616a('0x22'),_0x3e7301);logger[_0x616a('0x1d')](_0x616a('0x22'),_0x3e7301,JSON[_0x616a('0xf')](_0x2201de));_0x562688(_0x2201de);})[_0x616a('0x1e')](function(_0x58d2ce){logger[_0x616a('0x10')](_0x616a('0x22'),_0x58d2ce[_0x616a('0x12')],_0x3e7301);_0x50b9bb(_0x12fd21[_0x616a('0x10')](0x1f4,_0x58d2ce['message']));});});}; \ No newline at end of file +var _0xcf71=['catch','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','debug','CreateMemberReport','create','body','update','UpdateMemberReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x3d6699,_0x398369){var _0x3ea73f=function(_0x2a996e){while(--_0x2a996e){_0x3d6699['push'](_0x3d6699['shift']());}};_0x3ea73f(++_0x398369);}(_0xcf71,0xba));var _0x1cf7=function(_0x4e18bb,_0x2b28df){_0x4e18bb=_0x4e18bb-0x0;var _0x5ebf1f=_0xcf71[_0x4e18bb];return _0x5ebf1f;};'use strict';var _=require(_0x1cf7('0x0'));var util=require(_0x1cf7('0x1'));var moment=require(_0x1cf7('0x2'));var BPromise=require(_0x1cf7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cf7('0x4'));var db=require(_0x1cf7('0x5'))['db'];var utils=require(_0x1cf7('0x6'));var logger=require(_0x1cf7('0x7'))(_0x1cf7('0x8'));var config=require(_0x1cf7('0x9'));var jayson=require(_0x1cf7('0xa'));var client=jayson[_0x1cf7('0xb')][_0x1cf7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45ee6b,_0x2de84d,_0x19b626){return new BPromise(function(_0x4f908a,_0x52c8c8){return client[_0x1cf7('0xd')](_0x45ee6b,_0x19b626)[_0x1cf7('0xe')](function(_0x406ba0){logger['info'](_0x1cf7('0xf'),_0x2de84d,'request\x20sent');logger['debug'](_0x1cf7('0x10'),_0x2de84d,_0x1cf7('0x11'),JSON[_0x1cf7('0x12')](_0x406ba0));if(_0x406ba0[_0x1cf7('0x13')]){if(_0x406ba0[_0x1cf7('0x13')][_0x1cf7('0x14')]===0x1f4){logger['error'](_0x1cf7('0xf'),_0x2de84d,_0x406ba0['error'][_0x1cf7('0x15')]);return _0x52c8c8(_0x406ba0['error'][_0x1cf7('0x15')]);}logger[_0x1cf7('0x13')]('MemberReport,\x20%s,\x20%s',_0x2de84d,_0x406ba0[_0x1cf7('0x13')][_0x1cf7('0x15')]);return _0x4f908a(_0x406ba0[_0x1cf7('0x13')][_0x1cf7('0x15')]);}else{logger[_0x1cf7('0x16')](_0x1cf7('0xf'),_0x2de84d,_0x1cf7('0x11'));_0x4f908a(_0x406ba0[_0x1cf7('0x17')][_0x1cf7('0x15')]);}})[_0x1cf7('0x18')](function(_0x2a3671){logger[_0x1cf7('0x13')](_0x1cf7('0xf'),_0x2de84d,_0x2a3671);_0x52c8c8(_0x2a3671);});});}exports['GetMemberReport']=function(_0x391553){var _0x1a8a23=this;return new Promise(function(_0x13875c,_0x502516){return db[_0x1cf7('0x19')][_0x1cf7('0x1a')]({'raw':_0x391553[_0x1cf7('0x1b')]?_0x391553['options'][_0x1cf7('0x1c')]===undefined?!![]:![]:!![],'where':_0x391553[_0x1cf7('0x1b')]?_0x391553[_0x1cf7('0x1b')][_0x1cf7('0x1d')]||null:null,'attributes':_0x391553[_0x1cf7('0x1b')]?_0x391553[_0x1cf7('0x1b')][_0x1cf7('0x1e')]||null:null,'limit':_0x391553[_0x1cf7('0x1b')]?_0x391553[_0x1cf7('0x1b')][_0x1cf7('0x1f')]||null:null,'include':_0x391553['options']?_0x391553[_0x1cf7('0x1b')][_0x1cf7('0x20')]?_[_0x1cf7('0x21')](_0x391553[_0x1cf7('0x1b')][_0x1cf7('0x20')],function(_0x1c9100){return{'model':db[_0x1c9100[_0x1cf7('0x22')]],'as':_0x1c9100['as'],'attributes':_0x1c9100[_0x1cf7('0x1e')],'include':_0x1c9100['include']?_['map'](_0x1c9100['include'],function(_0x3af3e8){return{'model':db[_0x3af3e8['model']],'as':_0x3af3e8['as'],'attributes':_0x3af3e8[_0x1cf7('0x1e')],'include':_0x3af3e8[_0x1cf7('0x20')]?_[_0x1cf7('0x21')](_0x3af3e8[_0x1cf7('0x20')],function(_0x4dcf35){return{'model':db[_0x4dcf35['model']],'as':_0x4dcf35['as'],'attributes':_0x4dcf35[_0x1cf7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1cf7('0xe')](function(_0x1a9b20){logger[_0x1cf7('0x16')](_0x1cf7('0x23'),_0x391553);logger[_0x1cf7('0x24')](_0x1cf7('0x23'),_0x391553,JSON[_0x1cf7('0x12')](_0x1a9b20));_0x13875c(_0x1a9b20);})[_0x1cf7('0x18')](function(_0x5c6fee){logger[_0x1cf7('0x13')](_0x1cf7('0x23'),_0x5c6fee[_0x1cf7('0x15')],_0x391553);_0x502516(_0x1a8a23[_0x1cf7('0x13')](0x1f4,_0x5c6fee[_0x1cf7('0x15')]));});});};exports[_0x1cf7('0x25')]=function(_0x369a35){var _0x1d9e7a=this;return new Promise(function(_0x5754e8,_0x47f088){return db[_0x1cf7('0x19')][_0x1cf7('0x26')](_0x369a35[_0x1cf7('0x27')],{'raw':_0x369a35[_0x1cf7('0x1b')]?_0x369a35[_0x1cf7('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x1cf7('0xe')](function(_0x5d33b1){logger[_0x1cf7('0x16')](_0x1cf7('0x25'),_0x369a35);logger['debug'](_0x1cf7('0x25'),_0x369a35,JSON[_0x1cf7('0x12')](_0x5d33b1));_0x5754e8(_0x5d33b1);})[_0x1cf7('0x18')](function(_0x3f3aa7){logger[_0x1cf7('0x13')](_0x1cf7('0x25'),_0x3f3aa7['message'],_0x369a35);_0x47f088(_0x1d9e7a[_0x1cf7('0x13')](0x1f4,_0x3f3aa7['message']));});});};exports['UpdateMemberReport']=function(_0x3f634c){var _0x3d0eca=this;return new Promise(function(_0x440de3,_0x302f02){return db[_0x1cf7('0x19')][_0x1cf7('0x28')](_0x3f634c['body'],{'raw':_0x3f634c['options']?_0x3f634c[_0x1cf7('0x1b')][_0x1cf7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f634c[_0x1cf7('0x1b')]?_0x3f634c[_0x1cf7('0x1b')][_0x1cf7('0x1d')]||null:null,'attributes':_0x3f634c[_0x1cf7('0x1b')]?_0x3f634c[_0x1cf7('0x1b')][_0x1cf7('0x1e')]||null:null,'limit':_0x3f634c[_0x1cf7('0x1b')]?_0x3f634c[_0x1cf7('0x1b')]['limit']||null:null})[_0x1cf7('0xe')](function(_0x4eb6cd){logger[_0x1cf7('0x16')](_0x1cf7('0x29'),_0x3f634c);logger['debug']('UpdateMemberReport',_0x3f634c,JSON['stringify'](_0x4eb6cd));_0x440de3(_0x4eb6cd);})['catch'](function(_0x233a3c){logger[_0x1cf7('0x13')](_0x1cf7('0x29'),_0x233a3c[_0x1cf7('0x15')],_0x3f634c);_0x302f02(_0x3d0eca[_0x1cf7('0x13')](0x1f4,_0x233a3c[_0x1cf7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index be731ee..7ee938a 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 _0xeac1=['../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util','path','connect-timeout','Router'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0xeac1,0x146));var _0x1eac=function(_0x19c755,_0x269545){_0x19c755=_0x19c755-0x0;var _0xb2afb6=_0xeac1[_0x19c755];return _0xb2afb6;};'use strict';var multer=require('multer');var util=require(_0x1eac('0x0'));var path=require(_0x1eac('0x1'));var timeout=require(_0x1eac('0x2'));var express=require('express');var router=express[_0x1eac('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1eac('0x4'));var config=require(_0x1eac('0x5'));var controller=require(_0x1eac('0x6'));router[_0x1eac('0x7')]('/',controller[_0x1eac('0x8')]);module[_0x1eac('0x9')]=router; \ No newline at end of file +var _0x7d26=['../../config/environment','./migration.controller','get','index','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x518eaa,_0x3ac18c){var _0x48f29b=function(_0x175011){while(--_0x175011){_0x518eaa['push'](_0x518eaa['shift']());}};_0x48f29b(++_0x3ac18c);}(_0x7d26,0xcb));var _0x67d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7d26[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x67d2('0x0'));var util=require(_0x67d2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x67d2('0x2')]();var fs_extra=require(_0x67d2('0x3'));var auth=require(_0x67d2('0x4'));var interaction=require(_0x67d2('0x5'));var config=require(_0x67d2('0x6'));var controller=require(_0x67d2('0x7'));router[_0x67d2('0x8')]('/',controller[_0x67d2('0x9')]);module[_0x67d2('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index f1bfb0d..987b2dd 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 _0x2b5e=['version','sequelize','STRING'];(function(_0x10984b,_0x532410){var _0x56f7e7=function(_0x258d0f){while(--_0x258d0f){_0x10984b['push'](_0x10984b['shift']());}};_0x56f7e7(++_0x532410);}(_0x2b5e,0x199));var _0xe2b5=function(_0x32c57d,_0x4b455a){_0x32c57d=_0x32c57d-0x0;var _0x353d7f=_0x2b5e[_0x32c57d];return _0x353d7f;};'use strict';var Sequelize=require(_0xe2b5('0x0'));module['exports']={'version':{'type':Sequelize[_0xe2b5('0x1')],'unique':_0xe2b5('0x2')}}; \ No newline at end of file +var _0x10b2=['exports','version','sequelize'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x10b2,0x134));var _0x210b=function(_0x5c06c5,_0x2a98dc){_0x5c06c5=_0x5c06c5-0x0;var _0x5b6d90=_0x10b2[_0x5c06c5];return _0x5b6d90;};'use strict';var Sequelize=require(_0x210b('0x0'));module[_0x210b('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x210b('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 55684b0..3f9d673 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 _0x2a4d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','save','then','error','stack','name','send','index','map','Migration','fieldName','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','count','includeAll','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x345a1b,_0x189c9e){var _0x1b24ec=function(_0x4437af){while(--_0x4437af){_0x345a1b['push'](_0x345a1b['shift']());}};_0x1b24ec(++_0x189c9e);}(_0x2a4d,0x6d));var _0xd2a4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2a4d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd2a4('0x0'));var rimraf=require(_0xd2a4('0x1'));var zipdir=require(_0xd2a4('0x2'));var jsonpatch=require(_0xd2a4('0x3'));var rp=require(_0xd2a4('0x4'));var moment=require(_0xd2a4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd2a4('0x6'));var util=require(_0xd2a4('0x7'));var path=require(_0xd2a4('0x8'));var sox=require(_0xd2a4('0x9'));var csv=require(_0xd2a4('0xa'));var ejs=require(_0xd2a4('0xb'));var fs=require('fs');var fs_extra=require(_0xd2a4('0xc'));var _=require(_0xd2a4('0xd'));var squel=require(_0xd2a4('0xe'));var crypto=require(_0xd2a4('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd2a4('0x10'));var toCsv=require(_0xd2a4('0xa'));var querystring=require('querystring');var Papa=require(_0xd2a4('0x11'));var Redis=require(_0xd2a4('0x12'));var authService=require(_0xd2a4('0x13'));var qs=require(_0xd2a4('0x14'));var as=require(_0xd2a4('0x15'));var hardwareService=require(_0xd2a4('0x16'));var logger=require(_0xd2a4('0x17'))(_0xd2a4('0x18'));var utils=require(_0xd2a4('0x19'));var config=require(_0xd2a4('0x1a'));var licenseUtil=require(_0xd2a4('0x1b'));var db=require(_0xd2a4('0x1c'))['db'];function respondWithStatusCode(_0x51e1fe,_0x1a41bc){_0x1a41bc=_0x1a41bc||0xcc;return function(_0x2b955d){if(_0x2b955d){return _0x51e1fe[_0xd2a4('0x1d')](_0x1a41bc);}return _0x51e1fe[_0xd2a4('0x1e')](_0x1a41bc)[_0xd2a4('0x1f')]();};}function respondWithResult(_0x4584da,_0x4a3224){_0x4a3224=_0x4a3224||0xc8;return function(_0x17c6a8){if(_0x17c6a8){return _0x4584da['status'](_0x4a3224)[_0xd2a4('0x20')](_0x17c6a8);}};}function respondWithFilteredResult(_0x1c290e,_0x5dea22){return function(_0x19dc56){if(_0x19dc56){var _0x20fc9b=typeof _0x5dea22[_0xd2a4('0x21')]==='undefined'&&typeof _0x5dea22['limit']===_0xd2a4('0x22');var _0x22d1e0=_0x19dc56['count'];var _0x4a73fb=_0x20fc9b?0x0:_0x5dea22[_0xd2a4('0x21')];var _0x1d21d1=_0x20fc9b?_0x19dc56['count']:_0x5dea22[_0xd2a4('0x21')]+_0x5dea22[_0xd2a4('0x23')];var _0x11c6db;if(_0x1d21d1>=_0x22d1e0){_0x1d21d1=_0x22d1e0;_0x11c6db=0xc8;}else{_0x11c6db=0xce;}_0x1c290e['status'](_0x11c6db);return _0x1c290e[_0xd2a4('0x24')]('Content-Range',_0x4a73fb+'-'+_0x1d21d1+'/'+_0x22d1e0)['json'](_0x19dc56);}return null;};}function patchUpdates(_0xfefde8){return function(_0x4e7442){try{jsonpatch['apply'](_0x4e7442,_0xfefde8,!![]);}catch(_0x15ea91){return BPromise['reject'](_0x15ea91);}return _0x4e7442[_0xd2a4('0x25')]();};}function saveUpdates(_0x47ea42,_0x48328e){return function(_0x1ff34a){if(_0x1ff34a){return _0x1ff34a['update'](_0x47ea42)[_0xd2a4('0x26')](function(_0x38cdc6){return _0x38cdc6;});}return null;};}function removeEntity(_0x45892b,_0x35cf0b){return function(_0x190542){if(_0x190542){return _0x190542['destroy']()[_0xd2a4('0x26')](function(){_0x45892b[_0xd2a4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x100ab0,_0x28738f){return function(_0x34877c){if(!_0x34877c){_0x100ab0[_0xd2a4('0x1d')](0x194);}return _0x34877c;};}function handleError(_0xaafa05,_0x4d5dac){_0x4d5dac=_0x4d5dac||0x1f4;return function(_0x4375c9){logger[_0xd2a4('0x27')](_0x4375c9[_0xd2a4('0x28')]);if(_0x4375c9[_0xd2a4('0x29')]){delete _0x4375c9[_0xd2a4('0x29')];}_0xaafa05[_0xd2a4('0x1e')](_0x4d5dac)[_0xd2a4('0x2a')](_0x4375c9);};}exports[_0xd2a4('0x2b')]=function(_0x4bab3c,_0x304f18){var _0x492c37={},_0x307523={},_0x18da79={'count':0x0,'rows':[]};var _0x261b53=_[_0xd2a4('0x2c')](db[_0xd2a4('0x2d')]['rawAttributes'],function(_0x417d1b){return{'name':_0x417d1b[_0xd2a4('0x2e')],'type':_0x417d1b['type'][_0xd2a4('0x2f')]};});_0x307523['model']=_[_0xd2a4('0x2c')](_0x261b53,_0xd2a4('0x29'));_0x307523[_0xd2a4('0x30')]=_['keys'](_0x4bab3c[_0xd2a4('0x30')]);_0x307523['filters']=_[_0xd2a4('0x31')](_0x307523[_0xd2a4('0x32')],_0x307523['query']);_0x492c37['attributes']=_[_0xd2a4('0x31')](_0x307523[_0xd2a4('0x32')],qs[_0xd2a4('0x33')](_0x4bab3c[_0xd2a4('0x30')][_0xd2a4('0x33')]));_0x492c37[_0xd2a4('0x34')]=_0x492c37[_0xd2a4('0x34')][_0xd2a4('0x35')]?_0x492c37['attributes']:_0x307523[_0xd2a4('0x32')];if(!_0x4bab3c[_0xd2a4('0x30')][_0xd2a4('0x36')](_0xd2a4('0x37'))){_0x492c37[_0xd2a4('0x23')]=qs['limit'](_0x4bab3c[_0xd2a4('0x30')]['limit']);_0x492c37['offset']=qs[_0xd2a4('0x21')](_0x4bab3c[_0xd2a4('0x30')][_0xd2a4('0x21')]);}_0x492c37['order']=qs[_0xd2a4('0x38')](_0x4bab3c[_0xd2a4('0x30')]['sort']);_0x492c37[_0xd2a4('0x39')]=qs[_0xd2a4('0x3a')](_['pick'](_0x4bab3c['query'],_0x307523['filters']),_0x261b53);if(_0x4bab3c[_0xd2a4('0x30')][_0xd2a4('0x3b')]){_0x492c37[_0xd2a4('0x39')]=_['merge'](_0x492c37[_0xd2a4('0x39')],{'$or':_['map'](_0x261b53,function(_0xdafa4a){if(_0xdafa4a[_0xd2a4('0x3c')]!==_0xd2a4('0x3d')){var _0x27875f={};_0x27875f[_0xdafa4a[_0xd2a4('0x29')]]={'$like':'%'+_0x4bab3c[_0xd2a4('0x30')][_0xd2a4('0x3b')]+'%'};return _0x27875f;}})});}_0x492c37=_['merge']({},_0x492c37,_0x4bab3c['options']);var _0x560793={'where':_0x492c37[_0xd2a4('0x39')]};return db[_0xd2a4('0x2d')]['count'](_0x560793)['then'](function(_0x51e589){_0x18da79[_0xd2a4('0x3e')]=_0x51e589;if(_0x4bab3c[_0xd2a4('0x30')][_0xd2a4('0x3f')]){_0x492c37['include']=[{'all':!![]}];}return db[_0xd2a4('0x2d')][_0xd2a4('0x40')](_0x492c37);})[_0xd2a4('0x26')](function(_0x344ca0){_0x18da79[_0xd2a4('0x41')]=_0x344ca0;return _0x18da79;})[_0xd2a4('0x26')](respondWithFilteredResult(_0x304f18,_0x492c37))[_0xd2a4('0x42')](handleError(_0x304f18,null));}; \ No newline at end of file +var _0x6d44=['fields','nolimit','order','filters','pick','merge','where','VIRTUAL','options','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','name','send','index','map','fieldName','type','model','query','intersection','attributes'];(function(_0x3278ec,_0x121195){var _0x50dcfc=function(_0x214a25){while(--_0x214a25){_0x3278ec['push'](_0x3278ec['shift']());}};_0x50dcfc(++_0x121195);}(_0x6d44,0x8d));var _0x46d4=function(_0x1bce27,_0x468041){_0x1bce27=_0x1bce27-0x0;var _0x18747d=_0x6d44[_0x1bce27];return _0x18747d;};'use strict';var emlformat=require(_0x46d4('0x0'));var rimraf=require(_0x46d4('0x1'));var zipdir=require(_0x46d4('0x2'));var jsonpatch=require(_0x46d4('0x3'));var rp=require('request-promise');var moment=require(_0x46d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46d4('0x5'));var util=require(_0x46d4('0x6'));var path=require(_0x46d4('0x7'));var sox=require(_0x46d4('0x8'));var csv=require('to-csv');var ejs=require(_0x46d4('0x9'));var fs=require('fs');var fs_extra=require(_0x46d4('0xa'));var _=require(_0x46d4('0xb'));var squel=require(_0x46d4('0xc'));var crypto=require(_0x46d4('0xd'));var jsforce=require(_0x46d4('0xe'));var deskjs=require(_0x46d4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x46d4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x46d4('0x11'));var as=require(_0x46d4('0x12'));var hardwareService=require(_0x46d4('0x13'));var logger=require(_0x46d4('0x14'))('api');var utils=require(_0x46d4('0x15'));var config=require(_0x46d4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x46d4('0x17'))['db'];function respondWithStatusCode(_0x55fd9a,_0x1f1d93){_0x1f1d93=_0x1f1d93||0xcc;return function(_0x442150){if(_0x442150){return _0x55fd9a['sendStatus'](_0x1f1d93);}return _0x55fd9a[_0x46d4('0x18')](_0x1f1d93)[_0x46d4('0x19')]();};}function respondWithResult(_0x5bc70f,_0x4d3670){_0x4d3670=_0x4d3670||0xc8;return function(_0x5749c9){if(_0x5749c9){return _0x5bc70f[_0x46d4('0x18')](_0x4d3670)['json'](_0x5749c9);}};}function respondWithFilteredResult(_0x1b0e70,_0x263bdc){return function(_0x58e821){if(_0x58e821){var _0x118fb5=typeof _0x263bdc[_0x46d4('0x1a')]===_0x46d4('0x1b')&&typeof _0x263bdc[_0x46d4('0x1c')]===_0x46d4('0x1b');var _0x393c8c=_0x58e821[_0x46d4('0x1d')];var _0x3cd9d3=_0x118fb5?0x0:_0x263bdc['offset'];var _0x3d93f2=_0x118fb5?_0x58e821['count']:_0x263bdc['offset']+_0x263bdc['limit'];var _0x455711;if(_0x3d93f2>=_0x393c8c){_0x3d93f2=_0x393c8c;_0x455711=0xc8;}else{_0x455711=0xce;}_0x1b0e70[_0x46d4('0x18')](_0x455711);return _0x1b0e70[_0x46d4('0x1e')](_0x46d4('0x1f'),_0x3cd9d3+'-'+_0x3d93f2+'/'+_0x393c8c)[_0x46d4('0x20')](_0x58e821);}return null;};}function patchUpdates(_0x5d2d5e){return function(_0x230e48){try{jsonpatch[_0x46d4('0x21')](_0x230e48,_0x5d2d5e,!![]);}catch(_0x21e27b){return BPromise[_0x46d4('0x22')](_0x21e27b);}return _0x230e48['save']();};}function saveUpdates(_0x524309,_0x1bdfea){return function(_0x17529f){if(_0x17529f){return _0x17529f[_0x46d4('0x23')](_0x524309)['then'](function(_0x36b9a2){return _0x36b9a2;});}return null;};}function removeEntity(_0x250a67,_0x4ec228){return function(_0x812f4a){if(_0x812f4a){return _0x812f4a['destroy']()[_0x46d4('0x24')](function(){_0x250a67['status'](0xcc)[_0x46d4('0x19')]();});}};}function handleEntityNotFound(_0x58fa73,_0x3abbe3){return function(_0x3066c5){if(!_0x3066c5){_0x58fa73[_0x46d4('0x25')](0x194);}return _0x3066c5;};}function handleError(_0x481aeb,_0x2afb48){_0x2afb48=_0x2afb48||0x1f4;return function(_0x4a687b){logger['error'](_0x4a687b['stack']);if(_0x4a687b[_0x46d4('0x26')]){delete _0x4a687b[_0x46d4('0x26')];}_0x481aeb['status'](_0x2afb48)[_0x46d4('0x27')](_0x4a687b);};}exports[_0x46d4('0x28')]=function(_0x43ccc1,_0x154907){var _0x65016b={},_0x21836a={},_0x38d63d={'count':0x0,'rows':[]};var _0x21f8f0=_[_0x46d4('0x29')](db['Migration']['rawAttributes'],function(_0x4e6763){return{'name':_0x4e6763[_0x46d4('0x2a')],'type':_0x4e6763[_0x46d4('0x2b')]['key']};});_0x21836a[_0x46d4('0x2c')]=_[_0x46d4('0x29')](_0x21f8f0,_0x46d4('0x26'));_0x21836a[_0x46d4('0x2d')]=_['keys'](_0x43ccc1[_0x46d4('0x2d')]);_0x21836a['filters']=_[_0x46d4('0x2e')](_0x21836a[_0x46d4('0x2c')],_0x21836a[_0x46d4('0x2d')]);_0x65016b[_0x46d4('0x2f')]=_['intersection'](_0x21836a['model'],qs[_0x46d4('0x30')](_0x43ccc1[_0x46d4('0x2d')][_0x46d4('0x30')]));_0x65016b[_0x46d4('0x2f')]=_0x65016b[_0x46d4('0x2f')]['length']?_0x65016b[_0x46d4('0x2f')]:_0x21836a[_0x46d4('0x2c')];if(!_0x43ccc1[_0x46d4('0x2d')]['hasOwnProperty'](_0x46d4('0x31'))){_0x65016b[_0x46d4('0x1c')]=qs['limit'](_0x43ccc1[_0x46d4('0x2d')][_0x46d4('0x1c')]);_0x65016b['offset']=qs[_0x46d4('0x1a')](_0x43ccc1[_0x46d4('0x2d')][_0x46d4('0x1a')]);}_0x65016b[_0x46d4('0x32')]=qs['sort'](_0x43ccc1[_0x46d4('0x2d')]['sort']);_0x65016b['where']=qs[_0x46d4('0x33')](_[_0x46d4('0x34')](_0x43ccc1['query'],_0x21836a[_0x46d4('0x33')]),_0x21f8f0);if(_0x43ccc1[_0x46d4('0x2d')]['filter']){_0x65016b['where']=_[_0x46d4('0x35')](_0x65016b[_0x46d4('0x36')],{'$or':_[_0x46d4('0x29')](_0x21f8f0,function(_0x439d57){if(_0x439d57[_0x46d4('0x2b')]!==_0x46d4('0x37')){var _0x1a66f4={};_0x1a66f4[_0x439d57[_0x46d4('0x26')]]={'$like':'%'+_0x43ccc1['query']['filter']+'%'};return _0x1a66f4;}})});}_0x65016b=_[_0x46d4('0x35')]({},_0x65016b,_0x43ccc1[_0x46d4('0x38')]);var _0x5af30b={'where':_0x65016b[_0x46d4('0x36')]};return db[_0x46d4('0x39')][_0x46d4('0x1d')](_0x5af30b)[_0x46d4('0x24')](function(_0x4f6f0a){_0x38d63d[_0x46d4('0x1d')]=_0x4f6f0a;if(_0x43ccc1[_0x46d4('0x2d')][_0x46d4('0x3a')]){_0x65016b[_0x46d4('0x3b')]=[{'all':!![]}];}return db[_0x46d4('0x39')][_0x46d4('0x3c')](_0x65016b);})[_0x46d4('0x24')](function(_0x519148){_0x38d63d[_0x46d4('0x3d')]=_0x519148;return _0x38d63d;})[_0x46d4('0x24')](respondWithFilteredResult(_0x154907,_0x65016b))[_0x46d4('0x3e')](handleError(_0x154907,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 94ff52e..91ab635 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 _0xaba9=['exports','Migration','migrations','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes'];(function(_0x5ccc8b,_0x31f0af){var _0x54356e=function(_0x2d89e1){while(--_0x2d89e1){_0x5ccc8b['push'](_0x5ccc8b['shift']());}};_0x54356e(++_0x31f0af);}(_0xaba9,0x137));var _0x9aba=function(_0x91faeb,_0x1e067b){_0x91faeb=_0x91faeb-0x0;var _0x415778=_0xaba9[_0x91faeb];return _0x415778;};'use strict';var _=require(_0x9aba('0x0'));var util=require(_0x9aba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9aba('0x2'));var rp=require(_0x9aba('0x3'));var fs=require('fs');var path=require(_0x9aba('0x4'));var rimraf=require(_0x9aba('0x5'));var config=require(_0x9aba('0x6'));var attributes=require(_0x9aba('0x7'));module[_0x9aba('0x8')]=function(_0x3753c1,_0x1ff91f){return _0x3753c1['define'](_0x9aba('0x9'),attributes,{'tableName':_0x9aba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb2e=['../../config/logger','bluebird','request-promise','../../config/environment','exports','define','Migration','lodash','util'];(function(_0x41ebdf,_0x44d7c6){var _0x3878f4=function(_0x5ce1b5){while(--_0x5ce1b5){_0x41ebdf['push'](_0x41ebdf['shift']());}};_0x3878f4(++_0x44d7c6);}(_0xdb2e,0x142));var _0xedb2=function(_0x14afd4,_0x4d1f83){_0x14afd4=_0x14afd4-0x0;var _0x2c095f=_0xdb2e[_0x14afd4];return _0x2c095f;};'use strict';var _=require(_0xedb2('0x0'));var util=require(_0xedb2('0x1'));var logger=require(_0xedb2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xedb2('0x3'));var rp=require(_0xedb2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xedb2('0x5'));var attributes=require('./migration.attributes');module[_0xedb2('0x6')]=function(_0xa5d546,_0x16f48a){return _0xa5d546[_0xedb2('0x7')](_0xedb2('0x8'),attributes,{'tableName':'migrations','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 01b759f..8721fba 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 _0x9aea=['result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x4983aa,_0xa15188){var _0x5b433f=function(_0x147fe5){while(--_0x147fe5){_0x4983aa['push'](_0x4983aa['shift']());}};_0x5b433f(++_0xa15188);}(_0x9aea,0xdd));var _0xa9ae=function(_0x56d03b,_0x44e560){_0x56d03b=_0x56d03b-0x0;var _0x567461=_0x9aea[_0x56d03b];return _0x567461;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var moment=require(_0xa9ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9ae('0x2'));var fs=require('fs');var Redis=require(_0xa9ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ae('0x4'));var logger=require(_0xa9ae('0x5'))(_0xa9ae('0x6'));var config=require(_0xa9ae('0x7'));var jayson=require(_0xa9ae('0x8'));var client=jayson['client'][_0xa9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22734b,_0x1e57c4,_0x53e52c){return new BPromise(function(_0x1f2e4b,_0x3917f0){return client[_0xa9ae('0xa')](_0x22734b,_0x53e52c)[_0xa9ae('0xb')](function(_0x1882dc){logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));logger[_0xa9ae('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x1e57c4,_0xa9ae('0xe'),JSON['stringify'](_0x1882dc));if(_0x1882dc[_0xa9ae('0x10')]){if(_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x11')]===0x1f4){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x3917f0(_0x1882dc[_0xa9ae('0x10')]['message']);}logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x1f2e4b(_0x1882dc['error'][_0xa9ae('0x12')]);}else{logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));_0x1f2e4b(_0x1882dc[_0xa9ae('0x13')][_0xa9ae('0x12')]);}})['catch'](function(_0x3e4810){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x3e4810);_0x3917f0(_0x3e4810);});});} \ No newline at end of file +var _0x94dc=['../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94dc,0xb1));var _0xc94d=function(_0x525885,_0x66735f){_0x525885=_0x525885-0x0;var _0x4bf266=_0x94dc[_0x525885];return _0x4bf266;};'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')]('Migration,\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']('Migration,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d1ab9a8..5049c8c 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 _0xdb7e=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x4f39fd,_0x36d85f){var _0x4ef809=function(_0x52ef4c){while(--_0x52ef4c){_0x4f39fd['push'](_0x4f39fd['shift']());}};_0x4ef809(++_0x36d85f);}(_0xdb7e,0x11a));var _0xedb7=function(_0x214f5f,_0x2d3374){_0x214f5f=_0x214f5f-0x0;var _0x18bb90=_0xdb7e[_0x214f5f];return _0x18bb90;};'use strict';var multer=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var path=require(_0xedb7('0x2'));var timeout=require('connect-timeout');var express=require(_0xedb7('0x3'));var router=express[_0xedb7('0x4')]();var fs_extra=require(_0xedb7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xedb7('0x6'));var config=require(_0xedb7('0x7'));var controller=require(_0xedb7('0x8'));router[_0xedb7('0x9')]('/',auth[_0xedb7('0xa')](),controller[_0xedb7('0xb')]);router[_0xedb7('0x9')](_0xedb7('0xc'),auth[_0xedb7('0xa')](),controller[_0xedb7('0xd')]);router['post']('/',auth[_0xedb7('0xa')](),controller[_0xedb7('0xe')]);router[_0xedb7('0xf')](_0xedb7('0xc'),auth[_0xedb7('0xa')](),controller[_0xedb7('0x10')]);router[_0xedb7('0x11')](_0xedb7('0xc'),auth[_0xedb7('0xa')](),controller[_0xedb7('0x12')]);module[_0xedb7('0x13')]=router; \ No newline at end of file +var _0x27de=['index','/:id','show','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated'];(function(_0xcea2ac,_0x451a85){var _0x46b94b=function(_0x55d0b4){while(--_0x55d0b4){_0xcea2ac['push'](_0xcea2ac['shift']());}};_0x46b94b(++_0x451a85);}(_0x27de,0x111));var _0xe27d=function(_0x24e134,_0x21f184){_0x24e134=_0x24e134-0x0;var _0x85e110=_0x27de[_0x24e134];return _0x85e110;};'use strict';var multer=require(_0xe27d('0x0'));var util=require(_0xe27d('0x1'));var path=require(_0xe27d('0x2'));var timeout=require(_0xe27d('0x3'));var express=require(_0xe27d('0x4'));var router=express[_0xe27d('0x5')]();var fs_extra=require(_0xe27d('0x6'));var auth=require(_0xe27d('0x7'));var interaction=require(_0xe27d('0x8'));var config=require('../../config/environment');var controller=require(_0xe27d('0x9'));router[_0xe27d('0xa')]('/',auth[_0xe27d('0xb')](),controller[_0xe27d('0xc')]);router[_0xe27d('0xa')](_0xe27d('0xd'),auth[_0xe27d('0xb')](),controller[_0xe27d('0xe')]);router['post']('/',auth[_0xe27d('0xb')](),controller[_0xe27d('0xf')]);router[_0xe27d('0x10')](_0xe27d('0xd'),auth[_0xe27d('0xb')](),controller[_0xe27d('0x11')]);router[_0xe27d('0x12')]('/:id',auth[_0xe27d('0xb')](),controller['destroy']);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 b25ec25..7fe1b09 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 _0x55d5=['externip','stun','turn','STRING','exports','ENUM'];(function(_0x1ff971,_0x26a35b){var _0x48df24=function(_0x515de5){while(--_0x515de5){_0x1ff971['push'](_0x1ff971['shift']());}};_0x48df24(++_0x26a35b);}(_0x55d5,0x8e));var _0x555d=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x55d5[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require('sequelize');module[_0x555d('0x0')]={'type':{'type':Sequelize[_0x555d('0x1')]('localnet',_0x555d('0x2'),_0x555d('0x3'),_0x555d('0x4'))},'value':{'type':Sequelize[_0x555d('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x555d('0x5')]}}; \ No newline at end of file +var _0x3af9=['exports','ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x5a2a22,_0x1f3dc8){var _0xf9f942=function(_0xa0aad2){while(--_0xa0aad2){_0x5a2a22['push'](_0x5a2a22['shift']());}};_0xf9f942(++_0x1f3dc8);}(_0x3af9,0x1aa));var _0x93af=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3af9[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x93af('0x0'));module[_0x93af('0x1')]={'type':{'type':Sequelize[_0x93af('0x2')](_0x93af('0x3'),_0x93af('0x4'),_0x93af('0x5'),'turn')},'value':{'type':Sequelize[_0x93af('0x6')]},'username':{'type':Sequelize[_0x93af('0x6')]},'password':{'type':Sequelize[_0x93af('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index c9fadb3..584442f 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 _0x5f35=['format','/etc/asterisk/sip_xcally_%s.conf','join','/etc/asterisk/stun_xcally.conf','toUpperCase','TURN','server/files/templates/network.ejs','toLowerCase','chan_sip.so','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','undefined','limit','count','set','json','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','Network','find','create','body','STUN','readFileSync','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so'];(function(_0x5b64da,_0x183c4d){var _0x1e4b9f=function(_0x16404e){while(--_0x16404e){_0x5b64da['push'](_0x5b64da['shift']());}};_0x1e4b9f(++_0x183c4d);}(_0x5f35,0x165));var _0x55f3=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0x5f35[_0x2181b1];return _0x530548;};'use strict';var util=require(_0x55f3('0x0'));var path=require(_0x55f3('0x1'));var ejs=require(_0x55f3('0x2'));var fs=require('fs');var _=require(_0x55f3('0x3'));var qs=require(_0x55f3('0x4'));var logger=require(_0x55f3('0x5'))(_0x55f3('0x6'));var config=require('../../config/environment');var db=require(_0x55f3('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x55f3('0x8')][_0x55f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x282faf,_0x527769,_0x3cdfab,_0xafd8bd){return new Promise(function(_0x6e18c7,_0x5b732c){var _0x29d2bb=_0xafd8bd||client;return _0x29d2bb[_0x55f3('0xa')](_0x282faf,_0x3cdfab)[_0x55f3('0xb')](function(_0x1d0028){logger[_0x55f3('0xc')](_0x55f3('0xd'),_0x527769,_0x55f3('0xe'));logger[_0x55f3('0xf')](_0x55f3('0x10'),_0x527769,'request\x20sent',JSON['stringify'](_0x1d0028));if(_0x1d0028[_0x55f3('0x11')]){if(_0x1d0028[_0x55f3('0x11')][_0x55f3('0x12')]===0x1f4){logger[_0x55f3('0x11')](_0x55f3('0xd'),_0x527769,_0x1d0028['error'][_0x55f3('0x13')]);return _0x5b732c(_0x1d0028[_0x55f3('0x11')][_0x55f3('0x13')]);}logger[_0x55f3('0x11')](_0x55f3('0xd'),_0x527769,_0x1d0028[_0x55f3('0x11')]['message']);return _0x6e18c7(_0x1d0028[_0x55f3('0x11')][_0x55f3('0x13')]);}else{logger['info'](_0x55f3('0xd'),_0x527769,_0x55f3('0xe'));_0x6e18c7(_0x1d0028[_0x55f3('0x14')][_0x55f3('0x13')]);}})[_0x55f3('0x15')](function(_0x233130){logger[_0x55f3('0x11')](_0x55f3('0xd'),_0x527769,_0x233130);_0x5b732c(_0x233130);});});}function respondWithResult(_0x33e679,_0x73971d){_0x73971d=_0x73971d||0xc8;return function(_0x13f2ab){if(_0x13f2ab){return _0x33e679[_0x55f3('0x16')](_0x73971d)['json'](_0x13f2ab);}};}function respondWithFilteredResult(_0x51e9c4,_0x5898ae){return function(_0x48574c){if(_0x48574c){var _0x589647=typeof _0x5898ae[_0x55f3('0x17')]===_0x55f3('0x18')&&typeof _0x5898ae[_0x55f3('0x19')]===_0x55f3('0x18');var _0x4f2afe=_0x48574c[_0x55f3('0x1a')];var _0x5d41af=_0x589647?0x0:_0x5898ae[_0x55f3('0x17')];var _0x3ffd31=_0x589647?_0x48574c[_0x55f3('0x1a')]:_0x5898ae[_0x55f3('0x17')]+_0x5898ae[_0x55f3('0x19')];var _0x1d6da1;if(_0x3ffd31>=_0x4f2afe){_0x3ffd31=_0x4f2afe;_0x1d6da1=0xc8;}else{_0x1d6da1=0xce;}_0x51e9c4['status'](_0x1d6da1);return _0x51e9c4[_0x55f3('0x1b')]('Content-Range',_0x5d41af+'-'+_0x3ffd31+'/'+_0x4f2afe)[_0x55f3('0x1c')](_0x48574c);}return null;};}function saveUpdates(_0x57fc41){return function(_0x369dc9){if(_0x369dc9){return _0x369dc9[_0x55f3('0x1d')](_0x57fc41)['then'](function(_0x281d3a){return _0x281d3a;});}return null;};}function removeEntity(_0x6d7373){return function(_0x1f10e1){if(_0x1f10e1){return _0x1f10e1[_0x55f3('0x1e')]()[_0x55f3('0xb')](function(){_0x6d7373[_0x55f3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27a6d3){return function(_0xd69c65){if(!_0xd69c65){_0x27a6d3[_0x55f3('0x1f')](0x194);}return _0xd69c65;};}function handleError(_0x1e7ab8,_0x586b39){_0x586b39=_0x586b39||0x1f4;return function(_0x490de9){logger[_0x55f3('0x11')](_0x490de9[_0x55f3('0x20')]);if(_0x490de9['name']){delete _0x490de9[_0x55f3('0x21')];}_0x1e7ab8['status'](_0x586b39)[_0x55f3('0x22')](_0x490de9);};}exports[_0x55f3('0x23')]=function(_0x1db8e4,_0x326b16){var _0x38810e={},_0x374662={},_0x6a3af3={'count':0x0,'rows':[]};var _0x4a61e9=_[_0x55f3('0x24')](db['Network'][_0x55f3('0x25')],function(_0x25d6df){return{'name':_0x25d6df[_0x55f3('0x26')],'type':_0x25d6df[_0x55f3('0x27')]['key']};});_0x374662['model']=_[_0x55f3('0x24')](_0x4a61e9,_0x55f3('0x21'));_0x374662[_0x55f3('0x28')]=_['keys'](_0x1db8e4['query']);_0x374662['filters']=_[_0x55f3('0x29')](_0x374662[_0x55f3('0x2a')],_0x374662[_0x55f3('0x28')]);_0x38810e[_0x55f3('0x2b')]=_[_0x55f3('0x29')](_0x374662[_0x55f3('0x2a')],qs[_0x55f3('0x2c')](_0x1db8e4['query']['fields']));_0x38810e[_0x55f3('0x2b')]=_0x38810e[_0x55f3('0x2b')][_0x55f3('0x2d')]?_0x38810e[_0x55f3('0x2b')]:_0x374662[_0x55f3('0x2a')];if(!_0x1db8e4[_0x55f3('0x28')][_0x55f3('0x2e')](_0x55f3('0x2f'))){_0x38810e[_0x55f3('0x19')]=qs[_0x55f3('0x19')](_0x1db8e4['query'][_0x55f3('0x19')]);_0x38810e['offset']=qs[_0x55f3('0x17')](_0x1db8e4['query'][_0x55f3('0x17')]);}_0x38810e[_0x55f3('0x30')]=qs[_0x55f3('0x31')](_0x1db8e4[_0x55f3('0x28')][_0x55f3('0x31')]);_0x38810e[_0x55f3('0x32')]=qs[_0x55f3('0x33')](_[_0x55f3('0x34')](_0x1db8e4[_0x55f3('0x28')],_0x374662[_0x55f3('0x33')]),_0x4a61e9);if(_0x1db8e4[_0x55f3('0x28')][_0x55f3('0x35')]){_0x38810e[_0x55f3('0x32')]=_[_0x55f3('0x36')](_0x38810e[_0x55f3('0x32')],{'$or':_[_0x55f3('0x24')](_0x4a61e9,function(_0x1823c8){if(_0x1823c8[_0x55f3('0x27')]!==_0x55f3('0x37')){var _0x38c6d6={};_0x38c6d6[_0x1823c8['name']]={'$like':'%'+_0x1db8e4['query'][_0x55f3('0x35')]+'%'};return _0x38c6d6;}})});}_0x38810e=_['merge']({},_0x38810e,_0x1db8e4[_0x55f3('0x38')]);var _0x4e7410={'where':_0x38810e[_0x55f3('0x32')]};return db['Network']['count'](_0x4e7410)[_0x55f3('0xb')](function(_0x341de6){_0x6a3af3['count']=_0x341de6;if(_0x1db8e4[_0x55f3('0x28')][_0x55f3('0x39')]){_0x38810e[_0x55f3('0x3a')]=[{'all':!![]}];}return db['Network'][_0x55f3('0x3b')](_0x38810e);})[_0x55f3('0xb')](function(_0x5c7f83){_0x6a3af3[_0x55f3('0x3c')]=_0x5c7f83;return _0x6a3af3;})[_0x55f3('0xb')](respondWithFilteredResult(_0x326b16,_0x38810e))[_0x55f3('0x15')](handleError(_0x326b16,null));};exports['show']=function(_0x4a2124,_0x1f7a15){var _0x8831f1={'raw':!![],'where':{'id':_0x4a2124[_0x55f3('0x3d')]['id']}},_0x11ceb8={};_0x11ceb8['model']=_[_0x55f3('0x3e')](db['Network'][_0x55f3('0x25')]);_0x11ceb8[_0x55f3('0x28')]=_[_0x55f3('0x3e')](_0x4a2124[_0x55f3('0x28')]);_0x11ceb8[_0x55f3('0x33')]=_['intersection'](_0x11ceb8[_0x55f3('0x2a')],_0x11ceb8[_0x55f3('0x28')]);_0x8831f1[_0x55f3('0x2b')]=_[_0x55f3('0x29')](_0x11ceb8['model'],qs[_0x55f3('0x2c')](_0x4a2124[_0x55f3('0x28')][_0x55f3('0x2c')]));_0x8831f1[_0x55f3('0x2b')]=_0x8831f1[_0x55f3('0x2b')][_0x55f3('0x2d')]?_0x8831f1[_0x55f3('0x2b')]:_0x11ceb8[_0x55f3('0x2a')];if(_0x4a2124[_0x55f3('0x28')][_0x55f3('0x39')]){_0x8831f1['include']=[{'all':!![]}];}_0x8831f1=_[_0x55f3('0x36')]({},_0x8831f1,_0x4a2124[_0x55f3('0x38')]);return db[_0x55f3('0x3f')][_0x55f3('0x40')](_0x8831f1)[_0x55f3('0xb')](handleEntityNotFound(_0x1f7a15,null))[_0x55f3('0xb')](respondWithResult(_0x1f7a15,null))[_0x55f3('0x15')](handleError(_0x1f7a15,null));};exports[_0x55f3('0x41')]=function(_0xc36bf6,_0x2240bf){var _0x2e7de7;return db[_0x55f3('0x3f')][_0x55f3('0x41')](_0xc36bf6[_0x55f3('0x42')],{'raw':!![]})[_0x55f3('0xb')](function(_0x3d8f8b){_0x2e7de7=_0x3d8f8b;return db[_0x55f3('0x3f')]['findAll']({'where':{'type':_0xc36bf6[_0x55f3('0x42')][_0x55f3('0x27')]},'raw':!![]});})['then'](function(_0x125038){if(_0x2e7de7['type']['toUpperCase']()==_0x55f3('0x43')){var _0x3d1dfb=fs[_0x55f3('0x44')](path['join'](config['root'],_0x55f3('0x45')),_0x55f3('0x46'));var _0x5d377a=ejs[_0x55f3('0x47')](_0x3d1dfb,{'networks':_0x125038||[]});fs[_0x55f3('0x48')]('/etc/asterisk/stun_xcally.conf',_0x5d377a);return respondWithRpcPromise(_0x55f3('0x49'),_0x55f3('0x41'),{'module':'res_stun_monitor.so'});}else if(_0x2e7de7[_0x55f3('0x27')]['toUpperCase']()=='TURN'){var _0x4b4bbd=fs[_0x55f3('0x44')](path['join'](config[_0x55f3('0x4a')],_0x55f3('0x4b')),'utf8');var _0x3824cc=ejs[_0x55f3('0x47')](_0x4b4bbd,{'networks':_0x125038||[]});fs[_0x55f3('0x48')](_0x55f3('0x4c'),_0x3824cc);return respondWithRpcPromise('Reload',_0x55f3('0x41'),{'module':_0x55f3('0x4d')});}else{var _0x316ad8=fs[_0x55f3('0x44')](path['join'](config[_0x55f3('0x4a')],'server/files/templates/network.ejs'),_0x55f3('0x46'));var _0x3fbaa6=ejs['render'](_0x316ad8,{'networks':_0x125038||[]});fs[_0x55f3('0x48')](util[_0x55f3('0x4e')](_0x55f3('0x4f'),_0xc36bf6[_0x55f3('0x42')][_0x55f3('0x27')]['toLowerCase']()),_0x3fbaa6);return respondWithRpcPromise(_0x55f3('0x49'),'create',{'module':'chan_sip.so'});}})[_0x55f3('0xb')](function(){return _0x2e7de7;})[_0x55f3('0xb')](respondWithResult(_0x2240bf,0xc9))[_0x55f3('0x15')](handleError(_0x2240bf,null));};exports[_0x55f3('0x1d')]=function(_0x377d58,_0x806b32){var _0x2eaee7;return db[_0x55f3('0x3f')][_0x55f3('0x40')]({'where':{'id':_0x377d58[_0x55f3('0x3d')]['id']}})[_0x55f3('0xb')](handleEntityNotFound(_0x806b32,null))[_0x55f3('0xb')](saveUpdates(_0x377d58[_0x55f3('0x42')],null))[_0x55f3('0xb')](function(_0x21127f){if(_0x21127f){_0x2eaee7=_0x21127f;return db['Network'][_0x55f3('0x3b')]({'where':{'type':_0x2eaee7['type']},'raw':!![]});}return null;})[_0x55f3('0xb')](function(_0x14ccb3){if(_0x2eaee7[_0x55f3('0x27')]['toUpperCase']()==_0x55f3('0x43')){var _0x55d44c=fs[_0x55f3('0x44')](path[_0x55f3('0x50')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x536d08=ejs[_0x55f3('0x47')](_0x55d44c,{'networks':_0x14ccb3||[]});fs['writeFileSync'](_0x55f3('0x51'),_0x536d08);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else if(_0x2eaee7[_0x55f3('0x27')][_0x55f3('0x52')]()==_0x55f3('0x53')){var _0x1cc07a=fs['readFileSync'](path[_0x55f3('0x50')](config[_0x55f3('0x4a')],_0x55f3('0x4b')),_0x55f3('0x46'));var _0x546dda=ejs[_0x55f3('0x47')](_0x1cc07a,{'networks':_0x14ccb3||[]});fs[_0x55f3('0x48')](_0x55f3('0x4c'),_0x546dda);return respondWithRpcPromise(_0x55f3('0x49'),_0x55f3('0x1d'),{'module':_0x55f3('0x4d')});}else{var _0x341f60=fs['readFileSync'](path[_0x55f3('0x50')](config[_0x55f3('0x4a')],_0x55f3('0x54')),_0x55f3('0x46'));var _0x4b5b7=ejs['render'](_0x341f60,{'networks':_0x14ccb3||[]});fs['writeFileSync'](util['format'](_0x55f3('0x4f'),_0x377d58['body'][_0x55f3('0x27')][_0x55f3('0x55')]()),_0x4b5b7);return respondWithRpcPromise(_0x55f3('0x49'),_0x55f3('0x1d'),{'module':_0x55f3('0x56')});}})[_0x55f3('0xb')](function(_0xb13c67){if(_0xb13c67){return _0x2eaee7;}return null;})[_0x55f3('0xb')](respondWithResult(_0x806b32,null))[_0x55f3('0x15')](handleError(_0x806b32,null));};exports[_0x55f3('0x1e')]=function(_0x3e4a08,_0x5a0a66){var _0x158865;return db['Network'][_0x55f3('0x40')]({'where':{'id':_0x3e4a08['params']['id']}})[_0x55f3('0xb')](function(_0x5d7e2c){_0x158865=_0x5d7e2c;return _0x5d7e2c;})[_0x55f3('0xb')](handleEntityNotFound(_0x5a0a66,null))[_0x55f3('0xb')](removeEntity(_0x5a0a66,null))[_0x55f3('0xb')](function(){if(_0x158865){return db[_0x55f3('0x3f')][_0x55f3('0x3b')]({'where':{'type':_0x158865[_0x55f3('0x27')]},'raw':!![]});}})['then'](function(_0x249901){if(_0x158865[_0x55f3('0x27')][_0x55f3('0x52')]()==_0x55f3('0x43')){var _0x51fb2b=fs[_0x55f3('0x44')](path[_0x55f3('0x50')](config[_0x55f3('0x4a')],_0x55f3('0x45')),_0x55f3('0x46'));var _0x5c447e=ejs['render'](_0x51fb2b,{'networks':_0x249901||[]});fs[_0x55f3('0x48')](_0x55f3('0x51'),_0x5c447e);return respondWithRpcPromise(_0x55f3('0x49'),'destroy',{'module':_0x55f3('0x4d')});}else if(_0x158865[_0x55f3('0x27')][_0x55f3('0x52')]()==_0x55f3('0x53')){var _0x5e68ff=fs[_0x55f3('0x44')](path[_0x55f3('0x50')](config[_0x55f3('0x4a')],_0x55f3('0x4b')),_0x55f3('0x46'));var _0x37a775=ejs[_0x55f3('0x47')](_0x5e68ff,{'networks':_0x249901||[]});fs[_0x55f3('0x48')](_0x55f3('0x4c'),_0x37a775);return respondWithRpcPromise(_0x55f3('0x49'),_0x55f3('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x27c8cb=fs[_0x55f3('0x44')](path[_0x55f3('0x50')](config[_0x55f3('0x4a')],'server/files/templates/network.ejs'),_0x55f3('0x46'));var _0x27a67e=ejs[_0x55f3('0x47')](_0x27c8cb,{'networks':_0x249901||[]});fs[_0x55f3('0x48')](util[_0x55f3('0x4e')]('/etc/asterisk/sip_xcally_%s.conf',_0x158865[_0x55f3('0x27')][_0x55f3('0x55')]()),_0x27a67e);return respondWithRpcPromise(_0x55f3('0x49'),_0x55f3('0x1e'),{'module':_0x55f3('0x56')});}})['catch'](handleError(_0x5a0a66,null));}; \ No newline at end of file +var _0xc9a5=['catch','show','params','fields','create','body','type','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','STUN','/etc/asterisk/stun_xcally.conf','server/files/templates/network.ejs','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','message','status','json','limit','undefined','count','offset','Content-Range','update','destroy','sendStatus','stack','name','send','map','Network','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x50bfe7,_0x12131e){var _0xcf368=function(_0x2ba476){while(--_0x2ba476){_0x50bfe7['push'](_0x50bfe7['shift']());}};_0xcf368(++_0x12131e);}(_0xc9a5,0x127));var _0x5c9a=function(_0x2e8ab6,_0x49bdea){_0x2e8ab6=_0x2e8ab6-0x0;var _0x429260=_0xc9a5[_0x2e8ab6];return _0x429260;};'use strict';var util=require(_0x5c9a('0x0'));var path=require(_0x5c9a('0x1'));var ejs=require(_0x5c9a('0x2'));var fs=require('fs');var _=require(_0x5c9a('0x3'));var qs=require(_0x5c9a('0x4'));var logger=require(_0x5c9a('0x5'))(_0x5c9a('0x6'));var config=require(_0x5c9a('0x7'));var db=require(_0x5c9a('0x8'))['db'];var jayson=require(_0x5c9a('0x9'));var client=jayson[_0x5c9a('0xa')][_0x5c9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45833f,_0x5ca3a2,_0x26487d,_0x32e26d){return new Promise(function(_0x3d04bc,_0x42c98a){var _0x542b0f=_0x32e26d||client;return _0x542b0f[_0x5c9a('0xc')](_0x45833f,_0x26487d)[_0x5c9a('0xd')](function(_0x522600){logger[_0x5c9a('0xe')](_0x5c9a('0xf'),_0x5ca3a2,_0x5c9a('0x10'));logger[_0x5c9a('0x11')](_0x5c9a('0x12'),_0x5ca3a2,'request\x20sent',JSON[_0x5c9a('0x13')](_0x522600));if(_0x522600['error']){if(_0x522600['error'][_0x5c9a('0x14')]===0x1f4){logger[_0x5c9a('0x15')](_0x5c9a('0xf'),_0x5ca3a2,_0x522600['error'][_0x5c9a('0x16')]);return _0x42c98a(_0x522600[_0x5c9a('0x15')][_0x5c9a('0x16')]);}logger[_0x5c9a('0x15')](_0x5c9a('0xf'),_0x5ca3a2,_0x522600[_0x5c9a('0x15')][_0x5c9a('0x16')]);return _0x3d04bc(_0x522600['error'][_0x5c9a('0x16')]);}else{logger['info'](_0x5c9a('0xf'),_0x5ca3a2,'request\x20sent');_0x3d04bc(_0x522600['result'][_0x5c9a('0x16')]);}})['catch'](function(_0x3f75dd){logger['error'](_0x5c9a('0xf'),_0x5ca3a2,_0x3f75dd);_0x42c98a(_0x3f75dd);});});}function respondWithResult(_0xb2ae0f,_0x4b79b5){_0x4b79b5=_0x4b79b5||0xc8;return function(_0x10bd26){if(_0x10bd26){return _0xb2ae0f[_0x5c9a('0x17')](_0x4b79b5)[_0x5c9a('0x18')](_0x10bd26);}};}function respondWithFilteredResult(_0x5eeb7a,_0x3c0721){return function(_0x36bea5){if(_0x36bea5){var _0x1868c9=typeof _0x3c0721['offset']==='undefined'&&typeof _0x3c0721[_0x5c9a('0x19')]===_0x5c9a('0x1a');var _0x111c46=_0x36bea5[_0x5c9a('0x1b')];var _0x37a259=_0x1868c9?0x0:_0x3c0721[_0x5c9a('0x1c')];var _0x59e580=_0x1868c9?_0x36bea5[_0x5c9a('0x1b')]:_0x3c0721[_0x5c9a('0x1c')]+_0x3c0721[_0x5c9a('0x19')];var _0x498434;if(_0x59e580>=_0x111c46){_0x59e580=_0x111c46;_0x498434=0xc8;}else{_0x498434=0xce;}_0x5eeb7a['status'](_0x498434);return _0x5eeb7a['set'](_0x5c9a('0x1d'),_0x37a259+'-'+_0x59e580+'/'+_0x111c46)[_0x5c9a('0x18')](_0x36bea5);}return null;};}function saveUpdates(_0x127b15){return function(_0x10ca29){if(_0x10ca29){return _0x10ca29[_0x5c9a('0x1e')](_0x127b15)['then'](function(_0x538f35){return _0x538f35;});}return null;};}function removeEntity(_0x470532){return function(_0x4d3244){if(_0x4d3244){return _0x4d3244[_0x5c9a('0x1f')]()['then'](function(){_0x470532['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dda97){return function(_0x3e148b){if(!_0x3e148b){_0x2dda97[_0x5c9a('0x20')](0x194);}return _0x3e148b;};}function handleError(_0x3de2f9,_0x21081a){_0x21081a=_0x21081a||0x1f4;return function(_0x233167){logger[_0x5c9a('0x15')](_0x233167[_0x5c9a('0x21')]);if(_0x233167[_0x5c9a('0x22')]){delete _0x233167[_0x5c9a('0x22')];}_0x3de2f9['status'](_0x21081a)[_0x5c9a('0x23')](_0x233167);};}exports['index']=function(_0x21bff3,_0x4b459d){var _0x34c1ba={},_0x58302d={},_0x75e5b6={'count':0x0,'rows':[]};var _0x4417e9=_[_0x5c9a('0x24')](db[_0x5c9a('0x25')][_0x5c9a('0x26')],function(_0x4c9daf){return{'name':_0x4c9daf[_0x5c9a('0x27')],'type':_0x4c9daf['type']['key']};});_0x58302d[_0x5c9a('0x28')]=_[_0x5c9a('0x24')](_0x4417e9,'name');_0x58302d['query']=_[_0x5c9a('0x29')](_0x21bff3[_0x5c9a('0x2a')]);_0x58302d[_0x5c9a('0x2b')]=_[_0x5c9a('0x2c')](_0x58302d[_0x5c9a('0x28')],_0x58302d[_0x5c9a('0x2a')]);_0x34c1ba[_0x5c9a('0x2d')]=_[_0x5c9a('0x2c')](_0x58302d['model'],qs['fields'](_0x21bff3[_0x5c9a('0x2a')]['fields']));_0x34c1ba[_0x5c9a('0x2d')]=_0x34c1ba[_0x5c9a('0x2d')][_0x5c9a('0x2e')]?_0x34c1ba[_0x5c9a('0x2d')]:_0x58302d[_0x5c9a('0x28')];if(!_0x21bff3[_0x5c9a('0x2a')][_0x5c9a('0x2f')](_0x5c9a('0x30'))){_0x34c1ba[_0x5c9a('0x19')]=qs[_0x5c9a('0x19')](_0x21bff3['query'][_0x5c9a('0x19')]);_0x34c1ba[_0x5c9a('0x1c')]=qs[_0x5c9a('0x1c')](_0x21bff3[_0x5c9a('0x2a')][_0x5c9a('0x1c')]);}_0x34c1ba[_0x5c9a('0x31')]=qs[_0x5c9a('0x32')](_0x21bff3['query'][_0x5c9a('0x32')]);_0x34c1ba[_0x5c9a('0x33')]=qs['filters'](_[_0x5c9a('0x34')](_0x21bff3[_0x5c9a('0x2a')],_0x58302d[_0x5c9a('0x2b')]),_0x4417e9);if(_0x21bff3[_0x5c9a('0x2a')][_0x5c9a('0x35')]){_0x34c1ba[_0x5c9a('0x33')]=_[_0x5c9a('0x36')](_0x34c1ba[_0x5c9a('0x33')],{'$or':_['map'](_0x4417e9,function(_0x3f7a9f){if(_0x3f7a9f['type']!==_0x5c9a('0x37')){var _0x380670={};_0x380670[_0x3f7a9f[_0x5c9a('0x22')]]={'$like':'%'+_0x21bff3[_0x5c9a('0x2a')]['filter']+'%'};return _0x380670;}})});}_0x34c1ba=_[_0x5c9a('0x36')]({},_0x34c1ba,_0x21bff3[_0x5c9a('0x38')]);var _0x535f40={'where':_0x34c1ba[_0x5c9a('0x33')]};return db['Network'][_0x5c9a('0x1b')](_0x535f40)['then'](function(_0x8017ee){_0x75e5b6[_0x5c9a('0x1b')]=_0x8017ee;if(_0x21bff3[_0x5c9a('0x2a')][_0x5c9a('0x39')]){_0x34c1ba[_0x5c9a('0x3a')]=[{'all':!![]}];}return db[_0x5c9a('0x25')][_0x5c9a('0x3b')](_0x34c1ba);})[_0x5c9a('0xd')](function(_0x1b6d66){_0x75e5b6[_0x5c9a('0x3c')]=_0x1b6d66;return _0x75e5b6;})['then'](respondWithFilteredResult(_0x4b459d,_0x34c1ba))[_0x5c9a('0x3d')](handleError(_0x4b459d,null));};exports[_0x5c9a('0x3e')]=function(_0x334b2f,_0x55c91b){var _0x2b39fd={'raw':!![],'where':{'id':_0x334b2f[_0x5c9a('0x3f')]['id']}},_0x2624b6={};_0x2624b6[_0x5c9a('0x28')]=_[_0x5c9a('0x29')](db['Network'][_0x5c9a('0x26')]);_0x2624b6[_0x5c9a('0x2a')]=_[_0x5c9a('0x29')](_0x334b2f['query']);_0x2624b6[_0x5c9a('0x2b')]=_['intersection'](_0x2624b6[_0x5c9a('0x28')],_0x2624b6['query']);_0x2b39fd[_0x5c9a('0x2d')]=_[_0x5c9a('0x2c')](_0x2624b6[_0x5c9a('0x28')],qs[_0x5c9a('0x40')](_0x334b2f[_0x5c9a('0x2a')][_0x5c9a('0x40')]));_0x2b39fd['attributes']=_0x2b39fd[_0x5c9a('0x2d')][_0x5c9a('0x2e')]?_0x2b39fd['attributes']:_0x2624b6[_0x5c9a('0x28')];if(_0x334b2f[_0x5c9a('0x2a')][_0x5c9a('0x39')]){_0x2b39fd[_0x5c9a('0x3a')]=[{'all':!![]}];}_0x2b39fd=_[_0x5c9a('0x36')]({},_0x2b39fd,_0x334b2f[_0x5c9a('0x38')]);return db[_0x5c9a('0x25')]['find'](_0x2b39fd)[_0x5c9a('0xd')](handleEntityNotFound(_0x55c91b,null))[_0x5c9a('0xd')](respondWithResult(_0x55c91b,null))[_0x5c9a('0x3d')](handleError(_0x55c91b,null));};exports[_0x5c9a('0x41')]=function(_0x392009,_0x49f717){var _0x26c2f7;return db[_0x5c9a('0x25')][_0x5c9a('0x41')](_0x392009[_0x5c9a('0x42')],{'raw':!![]})[_0x5c9a('0xd')](function(_0x3a914e){_0x26c2f7=_0x3a914e;return db[_0x5c9a('0x25')]['findAll']({'where':{'type':_0x392009[_0x5c9a('0x42')][_0x5c9a('0x43')]},'raw':!![]});})[_0x5c9a('0xd')](function(_0x57e017){if(_0x26c2f7[_0x5c9a('0x43')][_0x5c9a('0x44')]()=='STUN'){var _0x4d9e01=fs[_0x5c9a('0x45')](path[_0x5c9a('0x46')](config[_0x5c9a('0x47')],_0x5c9a('0x48')),_0x5c9a('0x49'));var _0x2fb3fe=ejs['render'](_0x4d9e01,{'networks':_0x57e017||[]});fs[_0x5c9a('0x4a')]('/etc/asterisk/stun_xcally.conf',_0x2fb3fe);return respondWithRpcPromise(_0x5c9a('0x4b'),_0x5c9a('0x41'),{'module':_0x5c9a('0x4c')});}else if(_0x26c2f7[_0x5c9a('0x43')][_0x5c9a('0x44')]()==_0x5c9a('0x4d')){var _0x496fca=fs['readFileSync'](path[_0x5c9a('0x46')](config['root'],_0x5c9a('0x4e')),_0x5c9a('0x49'));var _0x3bfad8=ejs['render'](_0x496fca,{'networks':_0x57e017||[]});fs[_0x5c9a('0x4a')](_0x5c9a('0x4f'),_0x3bfad8);return respondWithRpcPromise(_0x5c9a('0x4b'),_0x5c9a('0x41'),{'module':_0x5c9a('0x4c')});}else{var _0x36f753=fs[_0x5c9a('0x45')](path[_0x5c9a('0x46')](config[_0x5c9a('0x47')],'server/files/templates/network.ejs'),_0x5c9a('0x49'));var _0x394f2b=ejs[_0x5c9a('0x50')](_0x36f753,{'networks':_0x57e017||[]});fs['writeFileSync'](util[_0x5c9a('0x51')](_0x5c9a('0x52'),_0x392009['body']['type'][_0x5c9a('0x53')]()),_0x394f2b);return respondWithRpcPromise(_0x5c9a('0x4b'),_0x5c9a('0x41'),{'module':_0x5c9a('0x54')});}})[_0x5c9a('0xd')](function(){return _0x26c2f7;})[_0x5c9a('0xd')](respondWithResult(_0x49f717,0xc9))[_0x5c9a('0x3d')](handleError(_0x49f717,null));};exports[_0x5c9a('0x1e')]=function(_0x134395,_0x5e603a){var _0x5e0b47;return db[_0x5c9a('0x25')][_0x5c9a('0x55')]({'where':{'id':_0x134395[_0x5c9a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5e603a,null))[_0x5c9a('0xd')](saveUpdates(_0x134395[_0x5c9a('0x42')],null))[_0x5c9a('0xd')](function(_0x3ac5f9){if(_0x3ac5f9){_0x5e0b47=_0x3ac5f9;return db[_0x5c9a('0x25')][_0x5c9a('0x3b')]({'where':{'type':_0x5e0b47[_0x5c9a('0x43')]},'raw':!![]});}return null;})[_0x5c9a('0xd')](function(_0x5f260e){if(_0x5e0b47[_0x5c9a('0x43')][_0x5c9a('0x44')]()==_0x5c9a('0x56')){var _0x5730af=fs['readFileSync'](path[_0x5c9a('0x46')](config[_0x5c9a('0x47')],_0x5c9a('0x48')),'utf8');var _0x13eab6=ejs[_0x5c9a('0x50')](_0x5730af,{'networks':_0x5f260e||[]});fs[_0x5c9a('0x4a')](_0x5c9a('0x57'),_0x13eab6);return respondWithRpcPromise(_0x5c9a('0x4b'),_0x5c9a('0x1e'),{'module':'res_stun_monitor.so'});}else if(_0x5e0b47[_0x5c9a('0x43')]['toUpperCase']()==_0x5c9a('0x4d')){var _0x1aebd3=fs[_0x5c9a('0x45')](path[_0x5c9a('0x46')](config[_0x5c9a('0x47')],_0x5c9a('0x4e')),_0x5c9a('0x49'));var _0x253de7=ejs['render'](_0x1aebd3,{'networks':_0x5f260e||[]});fs[_0x5c9a('0x4a')](_0x5c9a('0x4f'),_0x253de7);return respondWithRpcPromise('Reload',_0x5c9a('0x1e'),{'module':_0x5c9a('0x4c')});}else{var _0x4d65a5=fs[_0x5c9a('0x45')](path[_0x5c9a('0x46')](config[_0x5c9a('0x47')],'server/files/templates/network.ejs'),_0x5c9a('0x49'));var _0x30a1b0=ejs['render'](_0x4d65a5,{'networks':_0x5f260e||[]});fs[_0x5c9a('0x4a')](util['format'](_0x5c9a('0x52'),_0x134395[_0x5c9a('0x42')][_0x5c9a('0x43')][_0x5c9a('0x53')]()),_0x30a1b0);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}})[_0x5c9a('0xd')](function(_0x2d800a){if(_0x2d800a){return _0x5e0b47;}return null;})[_0x5c9a('0xd')](respondWithResult(_0x5e603a,null))[_0x5c9a('0x3d')](handleError(_0x5e603a,null));};exports[_0x5c9a('0x1f')]=function(_0x50cb0d,_0x73736b){var _0x2b11f1;return db['Network']['find']({'where':{'id':_0x50cb0d[_0x5c9a('0x3f')]['id']}})[_0x5c9a('0xd')](function(_0x2fdfd3){_0x2b11f1=_0x2fdfd3;return _0x2fdfd3;})[_0x5c9a('0xd')](handleEntityNotFound(_0x73736b,null))[_0x5c9a('0xd')](removeEntity(_0x73736b,null))[_0x5c9a('0xd')](function(){if(_0x2b11f1){return db[_0x5c9a('0x25')]['findAll']({'where':{'type':_0x2b11f1[_0x5c9a('0x43')]},'raw':!![]});}})[_0x5c9a('0xd')](function(_0x23bb68){if(_0x2b11f1[_0x5c9a('0x43')][_0x5c9a('0x44')]()==_0x5c9a('0x56')){var _0x1b3bf5=fs[_0x5c9a('0x45')](path[_0x5c9a('0x46')](config['root'],_0x5c9a('0x48')),'utf8');var _0x2c57e0=ejs[_0x5c9a('0x50')](_0x1b3bf5,{'networks':_0x23bb68||[]});fs[_0x5c9a('0x4a')](_0x5c9a('0x57'),_0x2c57e0);return respondWithRpcPromise(_0x5c9a('0x4b'),'destroy',{'module':_0x5c9a('0x4c')});}else if(_0x2b11f1[_0x5c9a('0x43')]['toUpperCase']()=='TURN'){var _0x1f8dc1=fs[_0x5c9a('0x45')](path[_0x5c9a('0x46')](config[_0x5c9a('0x47')],_0x5c9a('0x4e')),'utf8');var _0x2df437=ejs[_0x5c9a('0x50')](_0x1f8dc1,{'networks':_0x23bb68||[]});fs['writeFileSync'](_0x5c9a('0x4f'),_0x2df437);return respondWithRpcPromise(_0x5c9a('0x4b'),'destroy',{'module':_0x5c9a('0x4c')});}else{var _0x5be538=fs[_0x5c9a('0x45')](path[_0x5c9a('0x46')](config[_0x5c9a('0x47')],_0x5c9a('0x58')),_0x5c9a('0x49'));var _0x4dddd2=ejs[_0x5c9a('0x50')](_0x5be538,{'networks':_0x23bb68||[]});fs['writeFileSync'](util[_0x5c9a('0x51')](_0x5c9a('0x52'),_0x2b11f1[_0x5c9a('0x43')]['toLowerCase']()),_0x4dddd2);return respondWithRpcPromise(_0x5c9a('0x4b'),_0x5c9a('0x1f'),{'module':_0x5c9a('0x54')});}})[_0x5c9a('0x3d')](handleError(_0x73736b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 7f5de35..39b9372 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 _0x702d=['exports','define','Network','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x58065c,_0x2df29d){var _0x4e925a=function(_0x50fb7a){while(--_0x50fb7a){_0x58065c['push'](_0x58065c['shift']());}};_0x4e925a(++_0x2df29d);}(_0x702d,0x147));var _0xd702=function(_0x37e161,_0x146d3d){_0x37e161=_0x37e161-0x0;var _0x2a5c18=_0x702d[_0x37e161];return _0x2a5c18;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./network.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./network.attributes','exports','define','network','../../config/logger','api','moment','bluebird','path'];(function(_0x219364,_0xd046d2){var _0x47c153=function(_0xbee4fb){while(--_0xbee4fb){_0x219364['push'](_0x219364['shift']());}};_0x47c153(++_0xd046d2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xcb91[_0x35485a];return _0x5148e6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('Network',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index f64cef9..fbbf6e6 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ffde5,_0x4cff03){var _0x589ee6=function(_0x1f0415){while(--_0x1f0415){_0x3ffde5['push'](_0x3ffde5['shift']());}};_0x589ee6(++_0x4cff03);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36fded,_0x2f2eb7){var _0x588440=function(_0x396d57){while(--_0x396d57){_0x36fded['push'](_0x36fded['shift']());}};_0x588440(++_0x2f2eb7);}(_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 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 e6f76dc..0ecbf7d 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 _0xe289=['../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','addDisposition','notify','/:id/users','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe289,0x138));var _0x9e28=function(_0x28d093,_0x29e543){_0x28d093=_0x28d093-0x0;var _0x490f3d=_0xe289[_0x28d093];return _0x490f3d;};'use strict';var multer=require(_0x9e28('0x0'));var util=require(_0x9e28('0x1'));var path=require(_0x9e28('0x2'));var timeout=require(_0x9e28('0x3'));var express=require(_0x9e28('0x4'));var router=express[_0x9e28('0x5')]();var fs_extra=require(_0x9e28('0x6'));var auth=require(_0x9e28('0x7'));var interaction=require(_0x9e28('0x8'));var config=require(_0x9e28('0x9'));var controller=require(_0x9e28('0xa'));router['get']('/',auth[_0x9e28('0xb')](),controller[_0x9e28('0xc')]);router[_0x9e28('0xd')](_0x9e28('0xe'),auth['isAuthenticated'](),controller[_0x9e28('0xf')]);router[_0x9e28('0xd')](_0x9e28('0x10'),auth[_0x9e28('0xb')](),controller[_0x9e28('0x11')]);router[_0x9e28('0xd')](_0x9e28('0x12'),auth['isAuthenticated'](),controller[_0x9e28('0x13')]);router['get'](_0x9e28('0x14'),auth[_0x9e28('0xb')](),controller[_0x9e28('0x15')]);router[_0x9e28('0xd')](_0x9e28('0x16'),auth['isAuthenticated'](),controller[_0x9e28('0x17')]);router['get'](_0x9e28('0x18'),auth[_0x9e28('0xb')](),controller[_0x9e28('0x19')]);router[_0x9e28('0xd')]('/:id/users',auth[_0x9e28('0xb')](),controller[_0x9e28('0x1a')]);router[_0x9e28('0x1b')]('/',auth[_0x9e28('0xb')](),controller['create']);router[_0x9e28('0x1b')](_0x9e28('0x12'),auth[_0x9e28('0xb')](),controller[_0x9e28('0x1c')]);router[_0x9e28('0x1b')]('/:id/canned_answers',auth[_0x9e28('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x9e28('0x1d')]);router['post'](_0x9e28('0x16'),auth[_0x9e28('0xb')](),controller['addApplications']);router[_0x9e28('0x1b')](_0x9e28('0x1e'),auth[_0x9e28('0xb')](),controller['addAgents']);router[_0x9e28('0x1b')](_0x9e28('0x1f'),auth['isAuthenticated'](),controller[_0x9e28('0x20')]);router[_0x9e28('0x21')](_0x9e28('0x10'),auth[_0x9e28('0xb')](),controller['update']);router[_0x9e28('0x22')](_0x9e28('0x10'),auth[_0x9e28('0xb')](),controller[_0x9e28('0x23')]);router[_0x9e28('0x22')](_0x9e28('0x12'),auth[_0x9e28('0xb')](),controller[_0x9e28('0x24')]);router[_0x9e28('0x22')]('/:id/canned_answers',auth[_0x9e28('0xb')](),controller[_0x9e28('0x25')]);router[_0x9e28('0x22')](_0x9e28('0x1e'),auth['isAuthenticated'](),controller[_0x9e28('0x26')]);module[_0x9e28('0x27')]=router; \ No newline at end of file +var _0x9f60=['../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4e9c85,_0x196ab1){var _0x11522f=function(_0x18ccec){while(--_0x18ccec){_0x4e9c85['push'](_0x4e9c85['shift']());}};_0x11522f(++_0x196ab1);}(_0x9f60,0x189));var _0x09f6=function(_0xc148a0,_0x4b77e7){_0xc148a0=_0xc148a0-0x0;var _0x168df4=_0x9f60[_0xc148a0];return _0x168df4;};'use strict';var multer=require(_0x09f6('0x0'));var util=require(_0x09f6('0x1'));var path=require('path');var timeout=require(_0x09f6('0x2'));var express=require(_0x09f6('0x3'));var router=express['Router']();var fs_extra=require(_0x09f6('0x4'));var auth=require(_0x09f6('0x5'));var interaction=require(_0x09f6('0x6'));var config=require(_0x09f6('0x7'));var controller=require(_0x09f6('0x8'));router[_0x09f6('0x9')]('/',auth[_0x09f6('0xa')](),controller[_0x09f6('0xb')]);router['get'](_0x09f6('0xc'),auth[_0x09f6('0xa')](),controller['describe']);router[_0x09f6('0x9')](_0x09f6('0xd'),auth['isAuthenticated'](),controller[_0x09f6('0xe')]);router[_0x09f6('0x9')](_0x09f6('0xf'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x10')]);router['get'](_0x09f6('0x11'),auth['isAuthenticated'](),controller[_0x09f6('0x12')]);router[_0x09f6('0x9')](_0x09f6('0x13'),auth['isAuthenticated'](),controller[_0x09f6('0x14')]);router[_0x09f6('0x9')](_0x09f6('0x15'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x16')]);router['get'](_0x09f6('0x17'),auth['isAuthenticated'](),controller['getAgents']);router[_0x09f6('0x18')]('/',auth[_0x09f6('0xa')](),controller[_0x09f6('0x19')]);router[_0x09f6('0x18')](_0x09f6('0xf'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x1a')]);router[_0x09f6('0x18')](_0x09f6('0x11'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x1b')]);router[_0x09f6('0x18')](_0x09f6('0x1c'),controller[_0x09f6('0x1d')]);router[_0x09f6('0x18')]('/:id/applications',auth[_0x09f6('0xa')](),controller[_0x09f6('0x1e')]);router[_0x09f6('0x18')](_0x09f6('0x17'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x1f')]);router[_0x09f6('0x18')](_0x09f6('0x20'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x21')]);router[_0x09f6('0x22')](_0x09f6('0xd'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x23')]);router[_0x09f6('0x24')](_0x09f6('0xd'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x25')]);router['delete'](_0x09f6('0xf'),auth[_0x09f6('0xa')](),controller[_0x09f6('0x26')]);router[_0x09f6('0x24')](_0x09f6('0x11'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x09f6('0x24')](_0x09f6('0x17'),auth[_0x09f6('0xa')](),controller['removeAgents']);module[_0x09f6('0x27')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 727f730..5b05b54 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 _0xc6b0=['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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xc6b0,0x19f));var _0x0c6b=function(_0x153a9f,_0x4ab2bd){_0x153a9f=_0x153a9f-0x0;var _0x11b1e0=_0xc6b0[_0x153a9f];return _0x11b1e0;};'use strict';var Sequelize=require(_0x0c6b('0x0'));var rs=require(_0x0c6b('0x1'));module[_0x0c6b('0x2')]={'name':{'type':Sequelize[_0x0c6b('0x3')],'unique':_0x0c6b('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x0c6b('0x3')]},'token':{'type':Sequelize[_0x0c6b('0x3')],'defaultValue':function(){return rs[_0x0c6b('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0c6b('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0c6b('0x6')],'defaultValue':function(){return _0x0c6b('0x7');}},'notificationSound':{'type':Sequelize[_0x0c6b('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0c6b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0c6b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0c6b('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0c6b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0c6b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0c6b('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x0c6b('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x0c6b('0x8')],'defaultValue':![],'comment':_0x0c6b('0xb'),'set':function(_0x17be46){if(!_0x17be46)this[_0x0c6b('0xc')](_0x0c6b('0xd'),null);this[_0x0c6b('0xc')](_0x0c6b('0xe'),_0x17be46);}}}; \ No newline at end of file +var _0x44c7=['generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name'];(function(_0x1219ba,_0x195743){var _0x582035=function(_0x374e34){while(--_0x374e34){_0x1219ba['push'](_0x1219ba['shift']());}};_0x582035(++_0x195743);}(_0x44c7,0x1a9));var _0x744c=function(_0x115595,_0x3a1dad){_0x115595=_0x115595-0x0;var _0x444fca=_0x44c7[_0x115595];return _0x444fca;};'use strict';var Sequelize=require(_0x744c('0x0'));var rs=require(_0x744c('0x1'));module['exports']={'name':{'type':Sequelize[_0x744c('0x2')],'unique':_0x744c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x744c('0x2')]},'token':{'type':Sequelize[_0x744c('0x2')],'defaultValue':function(){return rs[_0x744c('0x4')]();}},'replyUri':{'type':Sequelize[_0x744c('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x744c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x744c('0x5');}},'notificationSound':{'type':Sequelize[_0x744c('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x744c('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x744c('0x2')]},'queueTransfer':{'type':Sequelize[_0x744c('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x744c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x744c('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x744c('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x744c('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x744c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x744c('0x6')],'defaultValue':![],'comment':_0x744c('0x9'),'set':function(_0x11829f){if(!_0x11829f)this[_0x744c('0xa')](_0x744c('0xb'),null);this[_0x744c('0xa')](_0x744c('0xc'),_0x11829f);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 865d784..63e10ea 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 _0x6453=['name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','include','OpenchannelAccount','findAll','show','fields','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','hasOwnProperty','rows','removeDispositions','ids','addAnswer','findOne','CannedAnswer','notify','openchannel','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','Applications','account','applications','orderBy','priority','asc','Contacts','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','finally','getApplications','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','emit','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack'];(function(_0x3df004,_0x1159f1){var _0x3081f3=function(_0x14da4c){while(--_0x14da4c){_0x3df004['push'](_0x3df004['shift']());}};_0x3081f3(++_0x1159f1);}(_0x6453,0x88));var _0x3645=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x6453[_0x1fa759];return _0x2da9f4;};'use strict';var emlformat=require(_0x3645('0x0'));var rimraf=require(_0x3645('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3645('0x2'));var rp=require(_0x3645('0x3'));var moment=require(_0x3645('0x4'));var BPromise=require(_0x3645('0x5'));var Mustache=require(_0x3645('0x6'));var util=require(_0x3645('0x7'));var path=require(_0x3645('0x8'));var sox=require(_0x3645('0x9'));var csv=require(_0x3645('0xa'));var ejs=require(_0x3645('0xb'));var fs=require('fs');var fs_extra=require(_0x3645('0xc'));var _=require(_0x3645('0xd'));var squel=require(_0x3645('0xe'));var crypto=require(_0x3645('0xf'));var jsforce=require(_0x3645('0x10'));var deskjs=require(_0x3645('0x11'));var toCsv=require(_0x3645('0xa'));var querystring=require(_0x3645('0x12'));var Papa=require(_0x3645('0x13'));var Redis=require(_0x3645('0x14'));var authService=require(_0x3645('0x15'));var qs=require(_0x3645('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3645('0x17'));var logger=require(_0x3645('0x18'))(_0x3645('0x19'));var utils=require('../../config/utils');var config=require(_0x3645('0x1a'));var licenseUtil=require(_0x3645('0x1b'));var db=require(_0x3645('0x1c'))['db'];config['redis']=_[_0x3645('0x1d')](config[_0x3645('0x1e')],{'host':'localhost','port':0x18eb});var socket=require(_0x3645('0x1f'))(new Redis(config[_0x3645('0x1e')]));require(_0x3645('0x20'))[_0x3645('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3645('0x22')][_0x3645('0x23')]({'port':0x232c});var client9002=jayson[_0x3645('0x22')][_0x3645('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x5f34a5,_0x5b1fd4,_0x234893,_0x563948){return new BPromise(function(_0x3fb185,_0x178c18){var _0x1e143a=_0x563948||client;return _0x1e143a['request'](_0x5f34a5,_0x234893)[_0x3645('0x24')](function(_0x5c90f7){logger[_0x3645('0x25')](_0x3645('0x26'),_0x5b1fd4,_0x3645('0x27'));logger[_0x3645('0x28')](_0x3645('0x29'),_0x5b1fd4,'request\x20sent',JSON[_0x3645('0x2a')](_0x5c90f7));if(_0x5c90f7[_0x3645('0x2b')]){if(_0x5c90f7[_0x3645('0x2b')][_0x3645('0x2c')]===0x1f4){logger['error'](_0x3645('0x26'),_0x5b1fd4,_0x5c90f7[_0x3645('0x2b')][_0x3645('0x2d')]);return _0x178c18(_0x5c90f7[_0x3645('0x2b')][_0x3645('0x2d')]);}logger[_0x3645('0x2b')](_0x3645('0x26'),_0x5b1fd4,_0x5c90f7[_0x3645('0x2b')][_0x3645('0x2d')]);return _0x3fb185(_0x5c90f7[_0x3645('0x2b')][_0x3645('0x2d')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5b1fd4,_0x3645('0x27'));_0x3fb185(_0x5c90f7[_0x3645('0x2e')][_0x3645('0x2d')]);}})['catch'](function(_0x587638){logger['error'](_0x3645('0x26'),_0x5b1fd4,_0x587638);_0x178c18(_0x587638);});});}function respondWithStatusCode(_0x5dcc92,_0x361ada){_0x361ada=_0x361ada||0xcc;return function(_0x252153){if(_0x252153){return _0x5dcc92[_0x3645('0x2f')](_0x361ada);}return _0x5dcc92['status'](_0x361ada)[_0x3645('0x30')]();};}function respondWithResult(_0x5b7a4a,_0x2e6f70){_0x2e6f70=_0x2e6f70||0xc8;return function(_0x24145d){if(_0x24145d){return _0x5b7a4a[_0x3645('0x31')](_0x2e6f70)[_0x3645('0x32')](_0x24145d);}};}function respondWithFilteredResult(_0x354124,_0x68ab41){return function(_0xc85c29){if(_0xc85c29){var _0x6c745a=typeof _0x68ab41[_0x3645('0x33')]==='undefined'&&typeof _0x68ab41['limit']===_0x3645('0x34');var _0x3c4fbb=_0xc85c29[_0x3645('0x35')];var _0x3d5c88=_0x6c745a?0x0:_0x68ab41[_0x3645('0x33')];var _0x47d3e9=_0x6c745a?_0xc85c29[_0x3645('0x35')]:_0x68ab41['offset']+_0x68ab41[_0x3645('0x36')];var _0x55fb59;if(_0x47d3e9>=_0x3c4fbb){_0x47d3e9=_0x3c4fbb;_0x55fb59=0xc8;}else{_0x55fb59=0xce;}_0x354124[_0x3645('0x31')](_0x55fb59);return _0x354124[_0x3645('0x37')](_0x3645('0x38'),_0x3d5c88+'-'+_0x47d3e9+'/'+_0x3c4fbb)[_0x3645('0x32')](_0xc85c29);}return null;};}function patchUpdates(_0x5ba909){return function(_0x46d264){try{jsonpatch[_0x3645('0x39')](_0x46d264,_0x5ba909,!![]);}catch(_0x2b7adb){return BPromise[_0x3645('0x3a')](_0x2b7adb);}return _0x46d264[_0x3645('0x3b')]();};}function saveUpdates(_0x1010e7,_0x3bf145){return function(_0x1ea181){if(_0x1ea181){return _0x1ea181[_0x3645('0x3c')](_0x1010e7)[_0x3645('0x24')](function(_0xd21cc7){return _0xd21cc7;});}return null;};}function removeEntity(_0x574d7e,_0x14360f){return function(_0xc82f21){if(_0xc82f21){return _0xc82f21[_0x3645('0x3d')]()['then'](function(){var _0x163a12=_0xc82f21[_0x3645('0x3e')]({'plain':!![]});var _0x3f2030='OpenchannelAccounts';return db[_0x3645('0x3f')][_0x3645('0x3d')]({'where':{'type':_0x3f2030,'resourceId':_0x163a12['id']}})[_0x3645('0x24')](function(){return _0xc82f21;});})[_0x3645('0x24')](function(){_0x574d7e[_0x3645('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ff897,_0x3246fd){return function(_0x4752c5){if(!_0x4752c5){_0x4ff897[_0x3645('0x2f')](0x194);}return _0x4752c5;};}function handleError(_0x344766,_0x18d0e4){_0x18d0e4=_0x18d0e4||0x1f4;return function(_0x44ddbe){logger[_0x3645('0x2b')](_0x44ddbe[_0x3645('0x40')]);if(_0x44ddbe[_0x3645('0x41')]){delete _0x44ddbe[_0x3645('0x41')];}_0x344766[_0x3645('0x31')](_0x18d0e4)[_0x3645('0x42')](_0x44ddbe);};}exports[_0x3645('0x43')]=function(_0x3922ac,_0x5edfbb){var _0x32694d={'include':[{'model':db[_0x3645('0x44')],'as':_0x3645('0x45')}]},_0x35c224={},_0x113cd1={'count':0x0,'rows':[]};var _0x212f34=_[_0x3645('0x46')](db['OpenchannelAccount'][_0x3645('0x47')],function(_0x42fccb){return{'name':_0x42fccb[_0x3645('0x48')],'type':_0x42fccb['type'][_0x3645('0x49')]};});_0x35c224[_0x3645('0x4a')]=_[_0x3645('0x46')](_0x212f34,'name');_0x35c224[_0x3645('0x4b')]=_[_0x3645('0x4c')](_0x3922ac[_0x3645('0x4b')]);_0x35c224['filters']=_[_0x3645('0x4d')](_0x35c224['model'],_0x35c224['query']);_0x32694d[_0x3645('0x4e')]=_[_0x3645('0x4d')](_0x35c224[_0x3645('0x4a')],qs['fields'](_0x3922ac['query']['fields']));_0x32694d[_0x3645('0x4e')]=_0x32694d['attributes'][_0x3645('0x4f')]?_0x32694d['attributes']:_0x35c224[_0x3645('0x4a')];if(!_0x3922ac['query']['hasOwnProperty'](_0x3645('0x50'))){_0x32694d[_0x3645('0x36')]=qs[_0x3645('0x36')](_0x3922ac['query'][_0x3645('0x36')]);_0x32694d[_0x3645('0x33')]=qs['offset'](_0x3922ac['query'][_0x3645('0x33')]);}_0x32694d[_0x3645('0x51')]=qs[_0x3645('0x52')](_0x3922ac['query'][_0x3645('0x52')]);_0x32694d[_0x3645('0x53')]=qs[_0x3645('0x54')](_[_0x3645('0x55')](_0x3922ac[_0x3645('0x4b')],_0x35c224[_0x3645('0x54')]),_0x212f34);if(_0x3922ac['query'][_0x3645('0x56')]){_0x32694d[_0x3645('0x53')]=_[_0x3645('0x57')](_0x32694d[_0x3645('0x53')],{'$or':_[_0x3645('0x46')](_0x212f34,function(_0x51b42a){if(_0x51b42a[_0x3645('0x58')]!==_0x3645('0x59')){var _0x148674={};_0x148674[_0x51b42a[_0x3645('0x41')]]={'$like':'%'+_0x3922ac[_0x3645('0x4b')][_0x3645('0x56')]+'%'};return _0x148674;}})});}_0x32694d=_[_0x3645('0x57')]({},_0x32694d,_0x3922ac['options']);var _0x3418c5={'where':_0x32694d['where']};return db['OpenchannelAccount']['count'](_0x3418c5)[_0x3645('0x24')](function(_0x2654e8){_0x113cd1['count']=_0x2654e8;if(_0x3922ac[_0x3645('0x4b')]['includeAll']){_0x32694d[_0x3645('0x5a')]=[{'all':!![]}];}return db[_0x3645('0x5b')][_0x3645('0x5c')](_0x32694d);})['then'](function(_0xeaa51f){_0x113cd1['rows']=_0xeaa51f;return _0x113cd1;})[_0x3645('0x24')](respondWithFilteredResult(_0x5edfbb,_0x32694d))['catch'](handleError(_0x5edfbb,null));};exports[_0x3645('0x5d')]=function(_0x552148,_0x37b059){var _0x44f05f={'raw':![],'where':{'id':_0x552148['params']['id']},'include':[{'model':db[_0x3645('0x44')],'as':_0x3645('0x45')}]},_0x386c68={};_0x386c68[_0x3645('0x4a')]=_[_0x3645('0x4c')](db[_0x3645('0x5b')][_0x3645('0x47')]);_0x386c68[_0x3645('0x4b')]=_[_0x3645('0x4c')](_0x552148[_0x3645('0x4b')]);_0x386c68[_0x3645('0x54')]=_[_0x3645('0x4d')](_0x386c68['model'],_0x386c68[_0x3645('0x4b')]);_0x44f05f[_0x3645('0x4e')]=_[_0x3645('0x4d')](_0x386c68[_0x3645('0x4a')],qs[_0x3645('0x5e')](_0x552148[_0x3645('0x4b')][_0x3645('0x5e')]));_0x44f05f[_0x3645('0x4e')]=_0x44f05f[_0x3645('0x4e')][_0x3645('0x4f')]?_0x44f05f[_0x3645('0x4e')]:_0x386c68[_0x3645('0x4a')];if(_0x552148[_0x3645('0x4b')][_0x3645('0x5f')]){_0x44f05f[_0x3645('0x5a')]=[{'all':!![]}];}_0x44f05f=_['merge']({},_0x44f05f,_0x552148[_0x3645('0x60')]);return db[_0x3645('0x5b')][_0x3645('0x61')](_0x44f05f)['then'](handleEntityNotFound(_0x37b059,null))[_0x3645('0x24')](respondWithResult(_0x37b059,null))[_0x3645('0x62')](handleError(_0x37b059,null));};exports[_0x3645('0x63')]=function(_0x32f48f,_0x19dbc6){return db['OpenchannelAccount'][_0x3645('0x63')](_0x32f48f[_0x3645('0x64')],{})['then'](function(_0x238d98){var _0x1bd6e1=_0x32f48f[_0x3645('0x65')][_0x3645('0x3e')]({'plain':!![]});if(!_0x1bd6e1)throw new Error(_0x3645('0x66'));if(_0x1bd6e1[_0x3645('0x67')]==='user'){var _0x58f2b3=_0x238d98['get']({'plain':!![]});var _0x3293d3=_0x3645('0x68');return db[_0x3645('0x69')][_0x3645('0x61')]({'where':{'name':_0x3293d3,'userProfileId':_0x1bd6e1['userProfileId']},'raw':!![]})[_0x3645('0x24')](function(_0xc00110){if(_0xc00110&&_0xc00110[_0x3645('0x6a')]===0x0){return db[_0x3645('0x3f')][_0x3645('0x63')]({'name':_0x58f2b3[_0x3645('0x41')],'resourceId':_0x58f2b3['id'],'type':_0xc00110['name'],'sectionId':_0xc00110['id']},{})[_0x3645('0x24')](function(){return _0x238d98;});}else{return _0x238d98;}})[_0x3645('0x62')](function(_0x5c6485){logger[_0x3645('0x2b')](_0x3645('0x6b'),_0x5c6485);throw _0x5c6485;});}return _0x238d98;})[_0x3645('0x24')](respondWithResult(_0x19dbc6,0xc9))['catch'](handleError(_0x19dbc6,null));};exports[_0x3645('0x3c')]=function(_0x4e5b07,_0x214987){if(_0x4e5b07[_0x3645('0x64')]['id']){delete _0x4e5b07[_0x3645('0x64')]['id'];}return db[_0x3645('0x5b')][_0x3645('0x61')]({'where':{'id':_0x4e5b07['params']['id']},'include':[{'model':db[_0x3645('0x44')],'as':_0x3645('0x45')}]})['then'](handleEntityNotFound(_0x214987,null))['then'](saveUpdates(_0x4e5b07[_0x3645('0x64')],null))['then'](respondWithResult(_0x214987,null))[_0x3645('0x62')](handleError(_0x214987,null));};exports['destroy']=function(_0x37ac67,_0x562c5f){return db['OpenchannelAccount'][_0x3645('0x61')]({'where':{'id':_0x37ac67[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x562c5f,null))[_0x3645('0x24')](removeEntity(_0x562c5f,null))[_0x3645('0x62')](handleError(_0x562c5f,null));};exports[_0x3645('0x6d')]=function(_0x1d05df,_0x25b496){return db[_0x3645('0x5b')][_0x3645('0x6d')]()[_0x3645('0x24')](respondWithResult(_0x25b496,null))[_0x3645('0x62')](handleError(_0x25b496,null));};exports[_0x3645('0x6e')]=function(_0x5ab30c,_0x9d130f,_0x94a04){if(_0x5ab30c[_0x3645('0x64')]['id']){delete _0x5ab30c[_0x3645('0x64')]['id'];}return db[_0x3645('0x5b')]['find']({'where':{'id':_0x5ab30c['params']['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x9d130f,null))[_0x3645('0x24')](function(_0x45a74f){if(_0x45a74f){_0x5ab30c[_0x3645('0x64')][_0x3645('0x6f')]=_0x45a74f['id'];return db[_0x3645('0x70')][_0x3645('0x63')](_0x5ab30c[_0x3645('0x64')]);}})[_0x3645('0x24')](respondWithResult(_0x9d130f,null))[_0x3645('0x62')](handleError(_0x9d130f,null));};exports[_0x3645('0x71')]=function(_0xb27388,_0x232059,_0x4bc60e){var _0x54237f={'raw':![],'where':{}};var _0x3d4f1d={};var _0x3b7047={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0xb27388[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x232059,null))[_0x3645('0x24')](function(_0x255d50){if(_0x255d50){_0x3d4f1d['model']=_[_0x3645('0x4c')](db[_0x3645('0x70')][_0x3645('0x47')]);_0x3d4f1d['query']=_[_0x3645('0x4c')](_0xb27388[_0x3645('0x4b')]);_0x3d4f1d[_0x3645('0x54')]=_[_0x3645('0x4d')](_0x3d4f1d[_0x3645('0x4a')],_0x3d4f1d[_0x3645('0x4b')]);_0x54237f[_0x3645('0x4e')]=_[_0x3645('0x4d')](_0x3d4f1d[_0x3645('0x4a')],qs['fields'](_0xb27388[_0x3645('0x4b')]['fields']));_0x54237f['attributes']=_0x54237f['attributes'][_0x3645('0x4f')]?_0x54237f[_0x3645('0x4e')]:_0x3d4f1d['model'];if(!_0xb27388[_0x3645('0x4b')][_0x3645('0x72')](_0x3645('0x50'))){_0x54237f[_0x3645('0x36')]=qs[_0x3645('0x36')](_0xb27388[_0x3645('0x4b')][_0x3645('0x36')]);_0x54237f[_0x3645('0x33')]=qs[_0x3645('0x33')](_0xb27388[_0x3645('0x4b')][_0x3645('0x33')]);}_0x54237f['order']=qs['sort'](_0xb27388['query'][_0x3645('0x52')]);_0x54237f['where']=qs[_0x3645('0x54')](_[_0x3645('0x55')](_0xb27388[_0x3645('0x4b')],_0x3d4f1d['filters']));_0x54237f[_0x3645('0x53')][_0x3645('0x6f')]=_0x255d50['id'];if(_0xb27388['query']['filter']){_0x54237f[_0x3645('0x53')]=_['merge'](_0x54237f['where'],{'$or':_[_0x3645('0x46')](_0x54237f[_0x3645('0x4e')],function(_0x5268c6){var _0x540a18={};_0x540a18[_0x5268c6]={'$like':'%'+_0xb27388[_0x3645('0x4b')][_0x3645('0x56')]+'%'};return _0x540a18;})});}_0x54237f=_[_0x3645('0x57')]({},_0x54237f,_0xb27388['options']);return db[_0x3645('0x70')][_0x3645('0x35')]({'where':_0x54237f['where']})[_0x3645('0x24')](function(_0x34efd4){_0x3b7047[_0x3645('0x35')]=_0x34efd4;if(_0xb27388[_0x3645('0x4b')][_0x3645('0x5f')]){_0x54237f[_0x3645('0x5a')]=[{'all':!![]}];}return db[_0x3645('0x70')][_0x3645('0x5c')](_0x54237f);})[_0x3645('0x24')](function(_0x2e0489){_0x3b7047[_0x3645('0x73')]=_0x2e0489;return _0x3b7047;});}})['then'](respondWithFilteredResult(_0x232059,_0x54237f))[_0x3645('0x62')](handleError(_0x232059,null));};exports[_0x3645('0x74')]=function(_0x4f6edb,_0x529849,_0x3f4c06){return db[_0x3645('0x5b')][_0x3645('0x61')]({'where':{'id':_0x4f6edb[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x529849,null))[_0x3645('0x24')](function(_0x5dca0d){if(_0x5dca0d){return _0x5dca0d[_0x3645('0x74')](_0x4f6edb[_0x3645('0x4b')][_0x3645('0x75')]);}})[_0x3645('0x24')](respondWithStatusCode(_0x529849,null))[_0x3645('0x62')](handleError(_0x529849,null));};exports[_0x3645('0x76')]=function(_0x5913f4,_0x49a5f2,_0x555344){if(_0x5913f4['body']['id']){delete _0x5913f4['body']['id'];}return db[_0x3645('0x5b')][_0x3645('0x61')]({'where':{'id':_0x5913f4[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x49a5f2,null))['then'](function(_0x2fe5c5){if(_0x2fe5c5){_0x5913f4[_0x3645('0x64')][_0x3645('0x6f')]=_0x2fe5c5['id'];return db['CannedAnswer']['create'](_0x5913f4[_0x3645('0x64')]);}})[_0x3645('0x24')](respondWithResult(_0x49a5f2,null))[_0x3645('0x62')](handleError(_0x49a5f2,null));};exports['getAnswers']=function(_0x1711d0,_0x585190,_0x5b64bb){var _0x3cce76={'raw':![],'where':{}};var _0x48eb31={};var _0x573cc1={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3645('0x77')]({'where':{'id':_0x1711d0[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x585190,null))[_0x3645('0x24')](function(_0xfb146f){if(_0xfb146f){_0x48eb31[_0x3645('0x4a')]=_[_0x3645('0x4c')](db[_0x3645('0x78')][_0x3645('0x47')]);_0x48eb31['query']=_[_0x3645('0x4c')](_0x1711d0['query']);_0x48eb31[_0x3645('0x54')]=_['intersection'](_0x48eb31[_0x3645('0x4a')],_0x48eb31[_0x3645('0x4b')]);_0x3cce76[_0x3645('0x4e')]=_['intersection'](_0x48eb31[_0x3645('0x4a')],qs[_0x3645('0x5e')](_0x1711d0[_0x3645('0x4b')][_0x3645('0x5e')]));_0x3cce76[_0x3645('0x4e')]=_0x3cce76[_0x3645('0x4e')][_0x3645('0x4f')]?_0x3cce76['attributes']:_0x48eb31[_0x3645('0x4a')];if(!_0x1711d0[_0x3645('0x4b')]['hasOwnProperty'](_0x3645('0x50'))){_0x3cce76[_0x3645('0x36')]=qs[_0x3645('0x36')](_0x1711d0['query'][_0x3645('0x36')]);_0x3cce76[_0x3645('0x33')]=qs['offset'](_0x1711d0[_0x3645('0x4b')][_0x3645('0x33')]);}_0x3cce76['order']=qs[_0x3645('0x52')](_0x1711d0[_0x3645('0x4b')][_0x3645('0x52')]);_0x3cce76[_0x3645('0x53')]=qs[_0x3645('0x54')](_['pick'](_0x1711d0['query'],_0x48eb31[_0x3645('0x54')]));_0x3cce76[_0x3645('0x53')][_0x3645('0x6f')]=_0xfb146f['id'];if(_0x1711d0[_0x3645('0x4b')][_0x3645('0x56')]){_0x3cce76[_0x3645('0x53')]=_[_0x3645('0x57')](_0x3cce76['where'],{'$or':_[_0x3645('0x46')](_0x3cce76[_0x3645('0x4e')],function(_0x4a589c){var _0x52217e={};_0x52217e[_0x4a589c]={'$like':'%'+_0x1711d0[_0x3645('0x4b')][_0x3645('0x56')]+'%'};return _0x52217e;})});}_0x3cce76=_[_0x3645('0x57')]({},_0x3cce76,_0x1711d0[_0x3645('0x60')]);return db['CannedAnswer'][_0x3645('0x35')]({'where':_0x3cce76['where']})[_0x3645('0x24')](function(_0x22e614){_0x573cc1[_0x3645('0x35')]=_0x22e614;if(_0x1711d0['query'][_0x3645('0x5f')]){_0x3cce76['include']=[{'all':!![]}];}return db[_0x3645('0x78')][_0x3645('0x5c')](_0x3cce76);})[_0x3645('0x24')](function(_0x340f63){_0x573cc1[_0x3645('0x73')]=_0x340f63;return _0x573cc1;});}})[_0x3645('0x24')](respondWithFilteredResult(_0x585190,_0x3cce76))['catch'](handleError(_0x585190,null));};exports['removeAnswers']=function(_0x407242,_0x5ec1a8,_0x24b81c){return db[_0x3645('0x5b')][_0x3645('0x61')]({'where':{'id':_0x407242[_0x3645('0x6c')]['id']}})['then'](handleEntityNotFound(_0x5ec1a8,null))['then'](function(_0x1f366a){if(_0x1f366a){return _0x1f366a['removeAnswers'](_0x407242[_0x3645('0x4b')]['ids']);}})[_0x3645('0x24')](respondWithStatusCode(_0x5ec1a8,null))[_0x3645('0x62')](handleError(_0x5ec1a8,null));};exports[_0x3645('0x79')]=function(_0x17646e,_0x1f9d9b,_0x2a7a9c){var _0x269734={'body':_0x17646e['body'],'channel':_0x3645('0x7a')};var _0x43ea12=[];var _0x484473=[];var _0x395419={};var _0x3517d2=![];return db[_0x3645('0x7b')][_0x3645('0x6d')]()['then'](function(_0x20cfc8){if(!_0x20cfc8){throw new db[(_0x3645('0x7c'))][(_0x3645('0x7d'))]('no\x20available\x20attributes');}_0x43ea12=_['difference'](_[_0x3645('0x4c')](_0x20cfc8),[_0x3645('0x7e'),_0x3645('0x7f')]);_0x484473=_[_0x3645('0x80')](_[_0x3645('0x4c')](_0x20cfc8),[_0x3645('0x7e'),_0x3645('0x7f'),'CompanyId',_0x3645('0x81')]);if(_0x17646e[_0x3645('0x64')]['id']){delete _0x17646e['body']['id'];}if(_[_0x3645('0x82')](_0x17646e[_0x3645('0x64')][_0x3645('0x83')])){throw new db[(_0x3645('0x7c'))][(_0x3645('0x7d'))](_0x3645('0x84'));}if(_[_0x3645('0x82')](_0x17646e['body']['body'])||_0x17646e[_0x3645('0x64')][_0x3645('0x64')]===''){throw new db[(_0x3645('0x7c'))][(_0x3645('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3645('0x82')](_0x17646e['body'][_0x3645('0x85')])){throw new db[(_0x3645('0x7c'))][(_0x3645('0x7d'))](_0x3645('0x86')+_0x484473);}if(!_[_0x3645('0x87')](_0x484473,_0x17646e[_0x3645('0x64')][_0x3645('0x85')])){throw new db[(_0x3645('0x7c'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x484473);}_0x395419[_0x17646e[_0x3645('0x64')][_0x3645('0x85')]]=_0x17646e[_0x3645('0x64')]['from'];})[_0x3645('0x24')](function(){return db[_0x3645('0x5b')][_0x3645('0x61')]({'where':{'id':_0x17646e['params']['id']},'include':[{'model':db[_0x3645('0x88')],'as':_0x3645('0x89'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x395419,'limit':0x1,'order':[[_0x3645('0x7f'),_0x3645('0x8a')]]}]},{'model':db['OpenchannelApplication'],'as':_0x3645('0x8b')}]});})[_0x3645('0x24')](handleEntityNotFound(_0x1f9d9b,null))[_0x3645('0x24')](function(_0x1e645c){if(_0x1e645c&&_0x1e645c[_0x3645('0x89')]){_0x269734[_0x3645('0x8c')]=_0x1e645c;_0x269734[_0x3645('0x8d')]=_0x1e645c['Applications'];_0x269734['list']=_0x1e645c[_0x3645('0x89')];_0x269734[_0x3645('0x8d')]=_[_0x3645('0x8e')](_0x269734[_0x3645('0x8d')],[_0x3645('0x8f')],[_0x3645('0x90')]);if(_0x269734[_0x3645('0x8c')][_0x3645('0x8b')]){delete _0x269734[_0x3645('0x8c')][_0x3645('0x8b')];}if(_0x269734[_0x3645('0x8c')][_0x3645('0x89')]&&_0x269734[_0x3645('0x8c')]['List'][_0x3645('0x91')][_0x3645('0x4f')]){return _0x269734[_0x3645('0x8c')][_0x3645('0x89')][_0x3645('0x91')][0x0];}var _0x32672b=_[_0x3645('0x1d')](_0x17646e[_0x3645('0x64')],{'firstName':_0x17646e[_0x3645('0x64')][_0x3645('0x83')],'ListId':_0x1e645c['ListId']});_0x32672b[_0x17646e['body'][_0x3645('0x85')]]=_0x17646e[_0x3645('0x64')]['from'];return db[_0x3645('0x7b')][_0x3645('0x63')](_0x32672b,{'fields':_0x43ea12,'raw':!![]});}})[_0x3645('0x24')](handleEntityNotFound(_0x1f9d9b,null))[_0x3645('0x24')](function(_0x1f9498){_0x269734[_0x3645('0x92')]=_0x1f9498;if(_0x1f9498){var _0x5ee71f={'ContactId':_0x1f9498['id'],'OpenchannelAccountId':_0x17646e[_0x3645('0x6c')]['id'],'from':(_0x1f9498[_0x3645('0x93')]||'')+'\x20'+(_0x1f9498[_0x3645('0x94')]||'')};var _0x2c749b={'OpenchannelAccountId':_0x17646e[_0x3645('0x6c')]['id'],'closed':![]};if(_0x17646e[_0x3645('0x64')][_0x3645('0x95')]){_0x2c749b['threadId']=_0x17646e[_0x3645('0x64')][_0x3645('0x95')];return db['OpenchannelInteraction'][_0x3645('0x61')]({'where':_0x2c749b})[_0x3645('0x24')](function(_0xd3e7de){if(_0xd3e7de){return[_0xd3e7de,![]];}_0x5ee71f[_0x3645('0x95')]=_0x17646e[_0x3645('0x64')]['threadId'];_0x5ee71f[_0x3645('0x96')]=_0x17646e[_0x3645('0x64')]['externalUrl'];return db[_0x3645('0x97')]['create'](_0x5ee71f)[_0x3645('0x24')](function(_0x31e7a1){return[_0x31e7a1,!![]];});});}else{_0x2c749b[_0x3645('0x95')]=null;}_0x2c749b[_0x3645('0x98')]=_0x1f9498['id'];return db['OpenchannelInteraction'][_0x3645('0x61')]({'where':_0x2c749b})[_0x3645('0x24')](function(_0x3047bd){if(_0x3047bd){return[_0x3047bd,![]];}return db[_0x3645('0x97')][_0x3645('0x63')](_0x5ee71f)[_0x3645('0x24')](function(_0x5dc99b){return[_0x5dc99b,!![]];});});}})[_0x3645('0x99')](function(_0x3c69e6,_0x274ff1){if(_0x3c69e6){_0x3517d2=_0x274ff1;if(!_0x274ff1){var _0x1806da={'from':(_0x269734[_0x3645('0x92')][_0x3645('0x93')]||'')+'\x20'+(_0x269734[_0x3645('0x92')][_0x3645('0x94')]||'')};if(_0x17646e[_0x3645('0x64')][_0x3645('0x95')]&&_0x17646e[_0x3645('0x64')][_0x3645('0x9a')]&&_0x17646e[_0x3645('0x64')][_0x3645('0x95')]!=_0x17646e['body'][_0x3645('0x9a')]){_0x1806da[_0x3645('0x95')]=_0x17646e[_0x3645('0x64')][_0x3645('0x9a')];}return _0x3c69e6[_0x3645('0x3c')](_0x1806da);}else{return _0x3c69e6;}}})[_0x3645('0x24')](function(_0x198646){_0x269734[_0x3645('0x9b')]=_0x198646[_0x3645('0x3e')]({'plain':!![]});_0x269734['interaction'][_0x3645('0x9c')]=_0x3517d2;if(_0x269734[_0x3645('0x9b')][_0x3645('0x9c')]){if(_0x269734[_0x3645('0x8c')][_0x3645('0x9d')]){_0x269734[_0x3645('0x8d')][_0x3645('0x9e')]({'id':0x0,'priority':_0x269734[_0x3645('0x8d')]['length']+0x1,'app':_0x3645('0x9f'),'appdata':_0x3645('0xa0'),'interval':'*,*,*,*'});}}return db[_0x3645('0xa1')][_0x3645('0x63')]({'body':_0x17646e['body'][_0x3645('0x64')],'OpenchannelAccountId':_0x17646e[_0x3645('0x6c')]['id'],'OpenchannelInteractionId':_0x198646['id'],'direction':'in','ContactId':_0x269734['contact']['id'],'AttachmentId':_0x17646e[_0x3645('0x64')]['AttachmentId']});})[_0x3645('0x24')](function(_0x5ee214){_0x269734[_0x3645('0x2d')]=_0x5ee214;if(_0x269734['interaction']['UserId']){return db[_0x3645('0xa2')][_0x3645('0x61')]({'attributes':['id',_0x3645('0x41')],'where':{'id':_0x269734[_0x3645('0x9b')][_0x3645('0xa3')]}})[_0x3645('0x24')](function(_0x37b4b8){if(_0x37b4b8){_0x269734[_0x3645('0x8d')][_0x3645('0xa4')]({'id':0x0,'priority':0x0,'app':_0x3645('0xa5'),'appdata':_0x37b4b8[_0x3645('0x41')]+','+(_0x269734[_0x3645('0x8c')][_0x3645('0xa6')]||0xa),'interval':_0x3645('0xa7')});_0x269734[_0x3645('0xa8')]=![];}return respondWithRpcPromise(_0x3645('0xa9'),'startRouting',_0x269734);});}return respondWithRpcPromise('Start',_0x3645('0xaa'),_0x269734);})[_0x3645('0x24')](function(_0x32236e){respondWithRpcPromise('EventManager',_0x3645('0xab'),{'event':_0x3645('0x79'),'message':_0x32236e},client9002);return _0x32236e;})[_0x3645('0x24')](respondWithResult(_0x1f9d9b,null))[_0x3645('0x62')](handleError(_0x1f9d9b,null));};exports[_0x3645('0xac')]=function(_0x71f2cd,_0x290644){var _0x21200e=_0x71f2cd['params']['id'];var _0x23336b=_0x71f2cd[_0x3645('0x64')];var _0x2bf61f=0xc8;var _0x4e53d8=null;return db[_0x3645('0xad')][_0x3645('0xae')]({'isolationLevel':db[_0x3645('0xad')][_0x3645('0xaf')][_0x3645('0xb0')][_0x3645('0xb1')]},function(_0x916a4d){return db['OpenchannelAccount'][_0x3645('0x77')]({'where':{'id':_0x21200e},'transaction':_0x916a4d})[_0x3645('0x24')](function(_0x5b8615){if(_0x5b8615){return db[_0x3645('0xb2')][_0x3645('0x3d')]({'where':{'OpenchannelAccountId':_0x21200e},'transaction':_0x916a4d})['then'](function(){var _0x94e386=_[_0x3645('0x46')](_0x23336b,function(_0x190de5){_0x190de5[_0x3645('0x6f')]=_0x21200e;return _0x190de5;});return db[_0x3645('0xb2')][_0x3645('0xb3')](_0x94e386,{'transaction':_0x916a4d});});}else{_0x2bf61f=0x194;_0x4e53d8=[];}});})[_0x3645('0x24')](function(){if(_0x2bf61f!==0x194){return db[_0x3645('0xb2')][_0x3645('0xb4')]({'where':{'OpenchannelAccountId':_0x21200e},'order':_0x3645('0x8f')})[_0x3645('0x24')](function(_0x3f49b4){_0x4e53d8=_0x3f49b4;});}})['catch'](function(_0x2588ce){_0x2bf61f=0x1f4;logger[_0x3645('0x2b')](_0x2588ce[_0x3645('0x40')]);if(_0x2588ce[_0x3645('0x41')]){delete _0x2588ce[_0x3645('0x41')];}_0x4e53d8=_0x2588ce;})[_0x3645('0xb5')](function(){if(_0x4e53d8===null){_0x290644[_0x3645('0x2f')](_0x2bf61f);}else{if(_0x2bf61f===0x1f4){_0x290644[_0x3645('0x31')](_0x2bf61f)['send'](_0x4e53d8);}else{_0x290644[_0x3645('0x31')](_0x2bf61f)[_0x3645('0x32')](_0x4e53d8);}}});};exports[_0x3645('0xb6')]=function(_0x1104a2,_0x340350,_0x4ed245){var _0x120779={};var _0x4c8c0c={};var _0x53ce18;var _0x2ee1e4;return db['OpenchannelAccount'][_0x3645('0x77')]({'where':{'id':_0x1104a2[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x340350,null))['then'](function(_0x962c3d){if(_0x962c3d){_0x53ce18=_0x962c3d;_0x4c8c0c['model']=_[_0x3645('0x4c')](db['OpenchannelApplication']['rawAttributes']);_0x4c8c0c['query']=_['keys'](_0x1104a2[_0x3645('0x4b')]);_0x4c8c0c[_0x3645('0x54')]=_['intersection'](_0x4c8c0c[_0x3645('0x4a')],_0x4c8c0c[_0x3645('0x4b')]);_0x120779[_0x3645('0x4e')]=_[_0x3645('0x4d')](_0x4c8c0c[_0x3645('0x4a')],qs['fields'](_0x1104a2['query'][_0x3645('0x5e')]));_0x120779['attributes']=_0x120779[_0x3645('0x4e')][_0x3645('0x4f')]?_0x120779[_0x3645('0x4e')]:_0x4c8c0c[_0x3645('0x4a')];_0x120779[_0x3645('0x51')]=qs['sort'](_0x1104a2[_0x3645('0x4b')][_0x3645('0x52')]);_0x120779[_0x3645('0x53')]=qs['filters'](_['pick'](_0x1104a2['query'],_0x4c8c0c['filters']));if(_0x1104a2[_0x3645('0x4b')][_0x3645('0x56')]){_0x120779['where']=_[_0x3645('0x57')](_0x120779[_0x3645('0x53')],{'$or':_['map'](_0x120779['attributes'],function(_0x2d998f){var _0x167f5b={};_0x167f5b[_0x2d998f]={'$like':'%'+_0x1104a2[_0x3645('0x4b')]['filter']+'%'};return _0x167f5b;})});}_0x120779=_[_0x3645('0x57')]({},_0x120779,_0x1104a2['options']);return _0x53ce18[_0x3645('0xb6')](_0x120779);}})[_0x3645('0x24')](function(_0x2c09f4){if(_0x2c09f4){_0x2ee1e4=_0x2c09f4[_0x3645('0x4f')];if(!_0x1104a2[_0x3645('0x4b')][_0x3645('0x72')]('nolimit')){_0x120779['limit']=qs[_0x3645('0x36')](_0x1104a2[_0x3645('0x4b')][_0x3645('0x36')]);_0x120779[_0x3645('0x33')]=qs[_0x3645('0x33')](_0x1104a2[_0x3645('0x4b')]['offset']);}return _0x53ce18['getApplications'](_0x120779);}})[_0x3645('0x24')](function(_0x134b2a){if(_0x134b2a){return _0x134b2a?{'count':_0x2ee1e4,'rows':_0x134b2a}:null;}})[_0x3645('0x24')](respondWithResult(_0x340350,null))[_0x3645('0x62')](handleError(_0x340350,null));};exports['getInteractions']=function(_0xc0c661,_0x4f430c,_0x4c6cae){var _0x1db047={'raw':![],'where':{}};var _0x45febe={};var _0x293448={'count':0x0,'rows':[]};return db[_0x3645('0x5b')][_0x3645('0x77')]({'where':{'id':_0xc0c661[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x4f430c,null))[_0x3645('0x24')](function(_0x5ac597){if(_0x5ac597){_0x45febe[_0x3645('0x4a')]=_[_0x3645('0x4c')](db[_0x3645('0x97')][_0x3645('0x47')]);_0x45febe[_0x3645('0x4b')]=_['keys'](_0xc0c661[_0x3645('0x4b')]);_0x45febe[_0x3645('0x54')]=_[_0x3645('0x4d')](_0x45febe['model'],_0x45febe[_0x3645('0x4b')]);_0x1db047[_0x3645('0x4e')]=_[_0x3645('0x4d')](_0x45febe[_0x3645('0x4a')],qs[_0x3645('0x5e')](_0xc0c661[_0x3645('0x4b')]['fields']));_0x1db047[_0x3645('0x4e')]=_0x1db047[_0x3645('0x4e')][_0x3645('0x4f')]?_0x1db047[_0x3645('0x4e')]:_0x45febe[_0x3645('0x4a')];if(!_0xc0c661[_0x3645('0x4b')][_0x3645('0x72')](_0x3645('0x50'))){_0x1db047[_0x3645('0x36')]=qs[_0x3645('0x36')](_0xc0c661[_0x3645('0x4b')][_0x3645('0x36')]);_0x1db047[_0x3645('0x33')]=qs['offset'](_0xc0c661[_0x3645('0x4b')][_0x3645('0x33')]);}_0x1db047['order']=qs['sort'](_0xc0c661['query'][_0x3645('0x52')]);_0x1db047[_0x3645('0x53')]=qs['filters'](_['pick'](_0xc0c661[_0x3645('0x4b')],_0x45febe[_0x3645('0x54')]));_0x1db047[_0x3645('0x53')][_0x3645('0x6f')]=_0x5ac597['id'];if(_0xc0c661[_0x3645('0x4b')][_0x3645('0x56')]){_0x1db047[_0x3645('0x53')]=_[_0x3645('0x57')](_0x1db047[_0x3645('0x53')],{'$or':_[_0x3645('0x46')](_0x1db047[_0x3645('0x4e')],function(_0x3a95d7){var _0x5d3e6e={};_0x5d3e6e[_0x3a95d7]={'$like':'%'+_0xc0c661['query']['filter']+'%'};return _0x5d3e6e;})});}_0x1db047=_[_0x3645('0x57')]({},_0x1db047,_0xc0c661[_0x3645('0x60')]);return db[_0x3645('0x97')][_0x3645('0x35')]({'where':_0x1db047['where']})[_0x3645('0x24')](function(_0xdcb7b9){_0x293448['count']=_0xdcb7b9;if(_0xc0c661[_0x3645('0x4b')][_0x3645('0x5f')]){_0x1db047[_0x3645('0x5a')]=[{'model':db[_0x3645('0x7b')],'as':_0x3645('0xb7'),'required':![]},{'model':db['User'],'as':_0x3645('0xb8'),'attributes':['name',_0x3645('0xb9'),_0x3645('0xba')],'required':![]},{'model':db[_0x3645('0xbb')],'as':'Tags','attributes':['id','name',_0x3645('0xbc')],'where':_0xc0c661[_0x3645('0x4b')][_0x3645('0xbd')]?{'id':_0xc0c661['query'][_0x3645('0xbd')]}:undefined,'required':_0xc0c661[_0x3645('0x4b')][_0x3645('0xbd')]?!![]:![]}];}return db[_0x3645('0x97')][_0x3645('0x5c')](_0x1db047);})[_0x3645('0x24')](function(_0x3a1cf4){_0x293448[_0x3645('0x73')]=_0x3a1cf4;return _0x293448;});}})[_0x3645('0x24')](respondWithFilteredResult(_0x4f430c,_0x1db047))[_0x3645('0x62')](handleError(_0x4f430c,null));};exports[_0x3645('0xbe')]=function(_0x5200b0,_0x2c37ac,_0x54a658){return db[_0x3645('0x5b')]['find']({'where':{'id':_0x5200b0[_0x3645('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2c37ac,null))['then'](function(_0x228cae){if(_0x228cae){return _0x228cae['addAgents'](_0x5200b0[_0x3645('0x64')][_0x3645('0x75')],_[_0x3645('0xbf')](_0x5200b0[_0x3645('0x64')],[_0x3645('0x75'),'id'])||{})[_0x3645('0x99')](function(_0x47850f){for(var _0x5e1e81=0x0;_0x5e1e81<_0x5200b0[_0x3645('0x64')]['ids'][_0x3645('0x4f')];_0x5e1e81+=0x1){socket['emit'](_0x3645('0xc0'),{'UserId':Number(_0x5200b0[_0x3645('0x64')][_0x3645('0x75')][_0x5e1e81]),'OpenchannelAccountId':Number(_0x5200b0[_0x3645('0x6c')]['id'])});}return _0x47850f;});}})[_0x3645('0x24')](respondWithResult(_0x2c37ac,null))['catch'](handleError(_0x2c37ac,null));};exports[_0x3645('0xc1')]=function(_0x5cc69c,_0x2db4ba,_0x3de5a1){return db['OpenchannelAccount'][_0x3645('0x61')]({'where':{'id':_0x5cc69c[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x2db4ba,null))[_0x3645('0x24')](function(_0x368968){if(_0x368968){return _0x368968[_0x3645('0xc1')](_0x5cc69c['query'][_0x3645('0x75')])[_0x3645('0x24')](function(){if(_['isArray'](_0x5cc69c['query'][_0x3645('0x75')])){for(var _0x429297=0x0;_0x429297<_0x5cc69c[_0x3645('0x4b')][_0x3645('0x75')][_0x3645('0x4f')];_0x429297+=0x1){socket['emit'](_0x3645('0xc2'),{'UserId':Number(_0x5cc69c[_0x3645('0x4b')][_0x3645('0x75')][_0x429297]),'OpenchannelAccountId':Number(_0x5cc69c[_0x3645('0x6c')]['id'])});}}else{socket[_0x3645('0xc3')](_0x3645('0xc2'),{'UserId':Number(_0x5cc69c[_0x3645('0x4b')][_0x3645('0x75')]),'OpenchannelAccountId':Number(_0x5cc69c['params']['id'])});}});}})[_0x3645('0x24')](respondWithStatusCode(_0x2db4ba,null))['catch'](handleError(_0x2db4ba,null));};exports[_0x3645('0xc4')]=function(_0x525d97,_0x54c699,_0x246fc0){var _0x332afb={};var _0x47f683={};var _0x1dde56;var _0x481485;return db['OpenchannelAccount'][_0x3645('0x77')]({'where':{'id':_0x525d97[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x54c699,null))[_0x3645('0x24')](function(_0x2bcd0a){if(_0x2bcd0a){_0x1dde56=_0x2bcd0a;_0x47f683[_0x3645('0x4a')]=_['keys'](db[_0x3645('0xa2')]['rawAttributes']);_0x47f683[_0x3645('0x4b')]=_['keys'](_0x525d97[_0x3645('0x4b')]);_0x47f683[_0x3645('0x54')]=_[_0x3645('0x4d')](_0x47f683[_0x3645('0x4a')],_0x47f683[_0x3645('0x4b')]);_0x332afb[_0x3645('0x4e')]=_[_0x3645('0x4d')](_0x47f683[_0x3645('0x4a')],qs['fields'](_0x525d97[_0x3645('0x4b')][_0x3645('0x5e')]));_0x332afb[_0x3645('0x4e')]=_0x332afb[_0x3645('0x4e')]['length']?_0x332afb[_0x3645('0x4e')]:_0x47f683[_0x3645('0x4a')];_0x332afb['order']=qs[_0x3645('0x52')](_0x525d97[_0x3645('0x4b')][_0x3645('0x52')]);_0x332afb[_0x3645('0x53')]=qs['filters'](_[_0x3645('0x55')](_0x525d97[_0x3645('0x4b')],_0x47f683[_0x3645('0x54')]));if(_0x525d97[_0x3645('0x4b')][_0x3645('0x56')]){_0x332afb[_0x3645('0x53')]=_['merge'](_0x332afb[_0x3645('0x53')],{'$or':_[_0x3645('0x46')](_0x332afb[_0x3645('0x4e')],function(_0x17b71d){var _0x1a41f9={};_0x1a41f9[_0x17b71d]={'$like':'%'+_0x525d97[_0x3645('0x4b')]['filter']+'%'};return _0x1a41f9;})});}_0x332afb=_[_0x3645('0x57')]({},_0x332afb,_0x525d97['options']);return _0x1dde56[_0x3645('0xc4')](_0x332afb);}})['then'](function(_0x35a748){if(_0x35a748){_0x481485=_0x35a748[_0x3645('0x4f')];if(!_0x525d97[_0x3645('0x4b')]['hasOwnProperty'](_0x3645('0x50'))){_0x332afb[_0x3645('0x36')]=qs[_0x3645('0x36')](_0x525d97['query'][_0x3645('0x36')]);_0x332afb['offset']=qs[_0x3645('0x33')](_0x525d97['query'][_0x3645('0x33')]);}return _0x1dde56[_0x3645('0xc4')](_0x332afb);}})[_0x3645('0x24')](function(_0x490c9a){if(_0x490c9a){return _0x490c9a?{'count':_0x481485,'rows':_0x490c9a}:null;}})[_0x3645('0x24')](respondWithResult(_0x54c699,null))[_0x3645('0x62')](handleError(_0x54c699,null));};exports['send']=function(_0x25875e,_0x388cb6,_0x3e9543){var _0x5a55e0,_0x3af285,_0x1272f5;if(_[_0x3645('0x82')](_0x25875e['body'][_0x3645('0x64')])||_0x25875e['body'][_0x3645('0x64')]===''){throw new db['Sequelize'][(_0x3645('0x7d'))](_0x3645('0xc5'));}if(_[_0x3645('0x82')](_0x25875e[_0x3645('0x64')]['to'])){}_0x5a55e0=_0x25875e[_0x3645('0x64')]['to'];return db[_0x3645('0x5b')][_0x3645('0x77')]({'where':{'id':_0x25875e[_0x3645('0x6c')]['id']}})[_0x3645('0x24')](handleEntityNotFound(_0x388cb6,null))[_0x3645('0x24')](function(_0x2f92b5){if(_0x2f92b5){return db['OpenchannelAccount'][_0x3645('0x61')]({'where':{'id':_0x2f92b5['id']},'include':[{'model':db[_0x3645('0x88')],'as':'List','include':[{'model':db[_0x3645('0x7b')],'as':'Contacts','where':{[_0x2f92b5[_0x3645('0x85')]]:_0x5a55e0},'limit':0x1,'order':[['updatedAt',_0x3645('0x8a')]]}]}]})[_0x3645('0x24')](handleEntityNotFound(_0x388cb6,null))[_0x3645('0x24')](function(_0x2f8cd3){if(_0x2f8cd3&&_0x2f8cd3[_0x3645('0x89')]){_0x3af285=_0x2f8cd3[_0x3645('0x3e')]({'plain':!![]});if(_0x3af285[_0x3645('0x89')]&&_0x3af285['List'][_0x3645('0x91')][_0x3645('0x4f')]){return _0x3af285[_0x3645('0x89')][_0x3645('0x91')][0x0];}return db[_0x3645('0x7b')]['create'](_[_0x3645('0x1d')](_0x25875e['body'],{'firstName':_0x5a55e0,[_0x2f8cd3[_0x3645('0x85')]]:_0x5a55e0,'phone':_0x5a55e0,'ListId':_0x3af285[_0x3645('0x81')]}));}})['then'](handleEntityNotFound(_0x388cb6,null))[_0x3645('0x24')](function(_0x438827){if(_0x438827){_0x1272f5=_0x438827;return db[_0x3645('0x97')][_0x3645('0x61')]({'where':{'ContactId':_0x1272f5['id'],'closed':![],'OpenchannelAccountId':_0x3af285['id']}})[_0x3645('0x24')](function(_0x179969){if(_0x179969){return[_0x179969,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x25875e[_0x3645('0x65')]['id'],'ContactId':_0x1272f5['id'],'OpenchannelAccountId':_0x3af285['id'],'lastMsgDirection':_0x3645('0xc6'),'firstMsgDirection':_0x3645('0xc6'),'Messages':[_[_0x3645('0x57')](_0x25875e['body'],{'read':![],'body':_0x25875e['body']['body'],'OpenchannelAccountId':_0x3af285['id'],'UserId':_0x25875e[_0x3645('0x65')]['id'],'ContactId':_0x1272f5['id']})]},{'include':[{'model':db[_0x3645('0xa1')],'as':_0x3645('0xc7')}]})[_0x3645('0x24')](function(_0xa7530b){return[_0xa7530b,!![]];});});}})[_0x3645('0x99')](function(_0x17f88b,_0x4337bf){if(_0x4337bf){return _0x17f88b;}return db[_0x3645('0xa1')]['create'](_['merge'](_0x25875e[_0x3645('0x64')],{'read':![],'body':_0x25875e[_0x3645('0x64')]['body'],'OpenchannelAccountId':_0x3af285['id'],'OpenchannelInteractionId':_0x17f88b['id'],'UserId':_0x25875e[_0x3645('0x65')]['id'],'ContactId':_0x1272f5['id']}))[_0x3645('0x24')](function(_0x3b937a){_0x17f88b[_0x3645('0xc8')][_0x3645('0xc7')]=[];_0x17f88b['dataValues'][_0x3645('0xc7')][_0x3645('0x9e')](_0x3b937a[_0x3645('0xc8')]);return _0x17f88b;});});}})[_0x3645('0x24')](respondWithResult(_0x388cb6,null))[_0x3645('0x62')](handleError(_0x388cb6,null));}; \ No newline at end of file +var _0xac92=['query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','length','find','create','body','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','OpenchannelAccountId','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','internal','Tag','Tags','color','tag','rows','addAgents','ids','omit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelAccount.socket','register','jayson/promise','client','request','then','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','type','key'];(function(_0x4c0b73,_0x50bcee){var _0x206ec0=function(_0x2d0174){while(--_0x2d0174){_0x4c0b73['push'](_0x4c0b73['shift']());}};_0x206ec0(++_0x50bcee);}(_0xac92,0x7b));var _0x2ac9=function(_0xaf1c27,_0xa82106){_0xaf1c27=_0xaf1c27-0x0;var _0x816633=_0xac92[_0xaf1c27];return _0x816633;};'use strict';var emlformat=require(_0x2ac9('0x0'));var rimraf=require(_0x2ac9('0x1'));var zipdir=require(_0x2ac9('0x2'));var jsonpatch=require(_0x2ac9('0x3'));var rp=require(_0x2ac9('0x4'));var moment=require(_0x2ac9('0x5'));var BPromise=require(_0x2ac9('0x6'));var Mustache=require(_0x2ac9('0x7'));var util=require('util');var path=require(_0x2ac9('0x8'));var sox=require(_0x2ac9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ac9('0xa'));var squel=require(_0x2ac9('0xb'));var crypto=require(_0x2ac9('0xc'));var jsforce=require(_0x2ac9('0xd'));var deskjs=require(_0x2ac9('0xe'));var toCsv=require(_0x2ac9('0xf'));var querystring=require(_0x2ac9('0x10'));var Papa=require('papaparse');var Redis=require(_0x2ac9('0x11'));var authService=require(_0x2ac9('0x12'));var qs=require(_0x2ac9('0x13'));var as=require(_0x2ac9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2ac9('0x15'));var utils=require('../../config/utils');var config=require(_0x2ac9('0x16'));var licenseUtil=require(_0x2ac9('0x17'));var db=require(_0x2ac9('0x18'))['db'];config['redis']=_[_0x2ac9('0x19')](config[_0x2ac9('0x1a')],{'host':_0x2ac9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ac9('0x1a')]));require(_0x2ac9('0x1c'))[_0x2ac9('0x1d')](socket);var jayson=require(_0x2ac9('0x1e'));var client=jayson[_0x2ac9('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x2ac9('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c1c8b,_0x3a7034,_0x11703f,_0x55d410){return new BPromise(function(_0x22d971,_0x43c1f7){var _0x4a1416=_0x55d410||client;return _0x4a1416[_0x2ac9('0x20')](_0x3c1c8b,_0x11703f)[_0x2ac9('0x21')](function(_0x6269b6){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3a7034,_0x2ac9('0x22'));logger['debug'](_0x2ac9('0x23'),_0x3a7034,'request\x20sent',JSON[_0x2ac9('0x24')](_0x6269b6));if(_0x6269b6[_0x2ac9('0x25')]){if(_0x6269b6['error']['code']===0x1f4){logger[_0x2ac9('0x25')](_0x2ac9('0x26'),_0x3a7034,_0x6269b6[_0x2ac9('0x25')][_0x2ac9('0x27')]);return _0x43c1f7(_0x6269b6['error'][_0x2ac9('0x27')]);}logger[_0x2ac9('0x25')](_0x2ac9('0x26'),_0x3a7034,_0x6269b6[_0x2ac9('0x25')][_0x2ac9('0x27')]);return _0x22d971(_0x6269b6['error'][_0x2ac9('0x27')]);}else{logger['info'](_0x2ac9('0x26'),_0x3a7034,'request\x20sent');_0x22d971(_0x6269b6[_0x2ac9('0x28')]['message']);}})[_0x2ac9('0x29')](function(_0x17ee06){logger[_0x2ac9('0x25')](_0x2ac9('0x26'),_0x3a7034,_0x17ee06);_0x43c1f7(_0x17ee06);});});}function respondWithStatusCode(_0x5af6b4,_0x101b1c){_0x101b1c=_0x101b1c||0xcc;return function(_0x17244c){if(_0x17244c){return _0x5af6b4[_0x2ac9('0x2a')](_0x101b1c);}return _0x5af6b4['status'](_0x101b1c)[_0x2ac9('0x2b')]();};}function respondWithResult(_0x3f5f44,_0x42428b){_0x42428b=_0x42428b||0xc8;return function(_0x228797){if(_0x228797){return _0x3f5f44[_0x2ac9('0x2c')](_0x42428b)[_0x2ac9('0x2d')](_0x228797);}};}function respondWithFilteredResult(_0x2dc8ac,_0xcc2f9c){return function(_0x2d5c5c){if(_0x2d5c5c){var _0x3c4201=typeof _0xcc2f9c[_0x2ac9('0x2e')]===_0x2ac9('0x2f')&&typeof _0xcc2f9c[_0x2ac9('0x30')]===_0x2ac9('0x2f');var _0x3cbb8b=_0x2d5c5c[_0x2ac9('0x31')];var _0x24e543=_0x3c4201?0x0:_0xcc2f9c[_0x2ac9('0x2e')];var _0x4e0a65=_0x3c4201?_0x2d5c5c[_0x2ac9('0x31')]:_0xcc2f9c['offset']+_0xcc2f9c[_0x2ac9('0x30')];var _0x5eb3f8;if(_0x4e0a65>=_0x3cbb8b){_0x4e0a65=_0x3cbb8b;_0x5eb3f8=0xc8;}else{_0x5eb3f8=0xce;}_0x2dc8ac[_0x2ac9('0x2c')](_0x5eb3f8);return _0x2dc8ac[_0x2ac9('0x32')](_0x2ac9('0x33'),_0x24e543+'-'+_0x4e0a65+'/'+_0x3cbb8b)['json'](_0x2d5c5c);}return null;};}function patchUpdates(_0x16bf97){return function(_0xfd438d){try{jsonpatch[_0x2ac9('0x34')](_0xfd438d,_0x16bf97,!![]);}catch(_0x386587){return BPromise[_0x2ac9('0x35')](_0x386587);}return _0xfd438d[_0x2ac9('0x36')]();};}function saveUpdates(_0xddab72,_0x46fcef){return function(_0x40495e){if(_0x40495e){return _0x40495e[_0x2ac9('0x37')](_0xddab72)['then'](function(_0x44f852){return _0x44f852;});}return null;};}function removeEntity(_0x3d3fb0,_0x2a76bb){return function(_0x1bbac2){if(_0x1bbac2){return _0x1bbac2[_0x2ac9('0x38')]()[_0x2ac9('0x21')](function(){var _0x3a928b=_0x1bbac2[_0x2ac9('0x39')]({'plain':!![]});var _0x51c134='OpenchannelAccounts';return db['UserProfileResource'][_0x2ac9('0x38')]({'where':{'type':_0x51c134,'resourceId':_0x3a928b['id']}})[_0x2ac9('0x21')](function(){return _0x1bbac2;});})[_0x2ac9('0x21')](function(){_0x3d3fb0[_0x2ac9('0x2c')](0xcc)[_0x2ac9('0x2b')]();});}};}function handleEntityNotFound(_0x343135,_0x21bc71){return function(_0x2b0775){if(!_0x2b0775){_0x343135[_0x2ac9('0x2a')](0x194);}return _0x2b0775;};}function handleError(_0x332582,_0x4ba2fe){_0x4ba2fe=_0x4ba2fe||0x1f4;return function(_0xfa4b87){logger['error'](_0xfa4b87[_0x2ac9('0x3a')]);if(_0xfa4b87[_0x2ac9('0x3b')]){delete _0xfa4b87[_0x2ac9('0x3b')];}_0x332582[_0x2ac9('0x2c')](_0x4ba2fe)[_0x2ac9('0x3c')](_0xfa4b87);};}exports[_0x2ac9('0x3d')]=function(_0x42a8d6,_0x2860d2){var _0x7cef5b={'include':[{'model':db[_0x2ac9('0x3e')],'as':_0x2ac9('0x3f')}]},_0x586899={},_0x2208c8={'count':0x0,'rows':[]};var _0x4404bd=_[_0x2ac9('0x40')](db[_0x2ac9('0x41')]['rawAttributes'],function(_0x280577){return{'name':_0x280577['fieldName'],'type':_0x280577[_0x2ac9('0x42')][_0x2ac9('0x43')]};});_0x586899['model']=_[_0x2ac9('0x40')](_0x4404bd,_0x2ac9('0x3b'));_0x586899[_0x2ac9('0x44')]=_[_0x2ac9('0x45')](_0x42a8d6[_0x2ac9('0x44')]);_0x586899[_0x2ac9('0x46')]=_[_0x2ac9('0x47')](_0x586899[_0x2ac9('0x48')],_0x586899[_0x2ac9('0x44')]);_0x7cef5b[_0x2ac9('0x49')]=_[_0x2ac9('0x47')](_0x586899['model'],qs[_0x2ac9('0x4a')](_0x42a8d6['query'][_0x2ac9('0x4a')]));_0x7cef5b[_0x2ac9('0x49')]=_0x7cef5b[_0x2ac9('0x49')]['length']?_0x7cef5b[_0x2ac9('0x49')]:_0x586899[_0x2ac9('0x48')];if(!_0x42a8d6[_0x2ac9('0x44')]['hasOwnProperty'](_0x2ac9('0x4b'))){_0x7cef5b['limit']=qs[_0x2ac9('0x30')](_0x42a8d6[_0x2ac9('0x44')]['limit']);_0x7cef5b[_0x2ac9('0x2e')]=qs[_0x2ac9('0x2e')](_0x42a8d6[_0x2ac9('0x44')][_0x2ac9('0x2e')]);}_0x7cef5b[_0x2ac9('0x4c')]=qs[_0x2ac9('0x4d')](_0x42a8d6['query'][_0x2ac9('0x4d')]);_0x7cef5b[_0x2ac9('0x4e')]=qs[_0x2ac9('0x46')](_[_0x2ac9('0x4f')](_0x42a8d6[_0x2ac9('0x44')],_0x586899[_0x2ac9('0x46')]),_0x4404bd);if(_0x42a8d6[_0x2ac9('0x44')][_0x2ac9('0x50')]){_0x7cef5b[_0x2ac9('0x4e')]=_[_0x2ac9('0x51')](_0x7cef5b[_0x2ac9('0x4e')],{'$or':_['map'](_0x4404bd,function(_0x34f67b){if(_0x34f67b[_0x2ac9('0x42')]!==_0x2ac9('0x52')){var _0x349327={};_0x349327[_0x34f67b['name']]={'$like':'%'+_0x42a8d6['query'][_0x2ac9('0x50')]+'%'};return _0x349327;}})});}_0x7cef5b=_[_0x2ac9('0x51')]({},_0x7cef5b,_0x42a8d6[_0x2ac9('0x53')]);var _0x39a402={'where':_0x7cef5b['where']};return db[_0x2ac9('0x41')][_0x2ac9('0x31')](_0x39a402)[_0x2ac9('0x21')](function(_0x43ebd4){_0x2208c8[_0x2ac9('0x31')]=_0x43ebd4;if(_0x42a8d6['query'][_0x2ac9('0x54')]){_0x7cef5b[_0x2ac9('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x2ac9('0x56')](_0x7cef5b);})[_0x2ac9('0x21')](function(_0x3f344c){_0x2208c8['rows']=_0x3f344c;return _0x2208c8;})[_0x2ac9('0x21')](respondWithFilteredResult(_0x2860d2,_0x7cef5b))[_0x2ac9('0x29')](handleError(_0x2860d2,null));};exports[_0x2ac9('0x57')]=function(_0x2aebc7,_0x443ef0){var _0x4d4f31={'raw':![],'where':{'id':_0x2aebc7[_0x2ac9('0x58')]['id']},'include':[{'model':db[_0x2ac9('0x3e')],'as':_0x2ac9('0x3f')}]},_0x1f584a={};_0x1f584a[_0x2ac9('0x48')]=_['keys'](db['OpenchannelAccount'][_0x2ac9('0x59')]);_0x1f584a[_0x2ac9('0x44')]=_[_0x2ac9('0x45')](_0x2aebc7[_0x2ac9('0x44')]);_0x1f584a[_0x2ac9('0x46')]=_[_0x2ac9('0x47')](_0x1f584a[_0x2ac9('0x48')],_0x1f584a[_0x2ac9('0x44')]);_0x4d4f31[_0x2ac9('0x49')]=_[_0x2ac9('0x47')](_0x1f584a[_0x2ac9('0x48')],qs[_0x2ac9('0x4a')](_0x2aebc7[_0x2ac9('0x44')][_0x2ac9('0x4a')]));_0x4d4f31[_0x2ac9('0x49')]=_0x4d4f31['attributes'][_0x2ac9('0x5a')]?_0x4d4f31[_0x2ac9('0x49')]:_0x1f584a[_0x2ac9('0x48')];if(_0x2aebc7['query'][_0x2ac9('0x54')]){_0x4d4f31[_0x2ac9('0x55')]=[{'all':!![]}];}_0x4d4f31=_['merge']({},_0x4d4f31,_0x2aebc7[_0x2ac9('0x53')]);return db[_0x2ac9('0x41')][_0x2ac9('0x5b')](_0x4d4f31)[_0x2ac9('0x21')](handleEntityNotFound(_0x443ef0,null))['then'](respondWithResult(_0x443ef0,null))[_0x2ac9('0x29')](handleError(_0x443ef0,null));};exports['create']=function(_0x10e091,_0x367bc8){return db[_0x2ac9('0x41')][_0x2ac9('0x5c')](_0x10e091[_0x2ac9('0x5d')],{})[_0x2ac9('0x21')](function(_0x5666e1){var _0x102264=_0x10e091[_0x2ac9('0x5e')][_0x2ac9('0x39')]({'plain':!![]});if(!_0x102264)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x102264[_0x2ac9('0x5f')]==='user'){var _0x316091=_0x5666e1['get']({'plain':!![]});var _0xb10b98='OpenchannelAccounts';return db['UserProfileSection'][_0x2ac9('0x5b')]({'where':{'name':_0xb10b98,'userProfileId':_0x102264['userProfileId']},'raw':!![]})[_0x2ac9('0x21')](function(_0x1524f9){if(_0x1524f9&&_0x1524f9[_0x2ac9('0x60')]===0x0){return db[_0x2ac9('0x61')][_0x2ac9('0x5c')]({'name':_0x316091[_0x2ac9('0x3b')],'resourceId':_0x316091['id'],'type':_0x1524f9['name'],'sectionId':_0x1524f9['id']},{})['then'](function(){return _0x5666e1;});}else{return _0x5666e1;}})['catch'](function(_0x6377b1){logger[_0x2ac9('0x25')](_0x2ac9('0x62'),_0x6377b1);throw _0x6377b1;});}return _0x5666e1;})[_0x2ac9('0x21')](respondWithResult(_0x367bc8,0xc9))[_0x2ac9('0x29')](handleError(_0x367bc8,null));};exports[_0x2ac9('0x37')]=function(_0x167069,_0x51fead){if(_0x167069[_0x2ac9('0x5d')]['id']){delete _0x167069['body']['id'];}return db['OpenchannelAccount'][_0x2ac9('0x5b')]({'where':{'id':_0x167069[_0x2ac9('0x58')]['id']},'include':[{'model':db[_0x2ac9('0x3e')],'as':_0x2ac9('0x3f')}]})[_0x2ac9('0x21')](handleEntityNotFound(_0x51fead,null))[_0x2ac9('0x21')](saveUpdates(_0x167069['body'],null))[_0x2ac9('0x21')](respondWithResult(_0x51fead,null))[_0x2ac9('0x29')](handleError(_0x51fead,null));};exports[_0x2ac9('0x38')]=function(_0x17ac33,_0x33500d){return db[_0x2ac9('0x41')][_0x2ac9('0x5b')]({'where':{'id':_0x17ac33['params']['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x33500d,null))[_0x2ac9('0x21')](removeEntity(_0x33500d,null))['catch'](handleError(_0x33500d,null));};exports[_0x2ac9('0x63')]=function(_0x54e056,_0x5b5ae1){return db[_0x2ac9('0x41')][_0x2ac9('0x63')]()[_0x2ac9('0x21')](respondWithResult(_0x5b5ae1,null))[_0x2ac9('0x29')](handleError(_0x5b5ae1,null));};exports[_0x2ac9('0x64')]=function(_0x51ba88,_0x5453a8,_0x5b47a8){if(_0x51ba88[_0x2ac9('0x5d')]['id']){delete _0x51ba88[_0x2ac9('0x5d')]['id'];}return db['OpenchannelAccount'][_0x2ac9('0x5b')]({'where':{'id':_0x51ba88[_0x2ac9('0x58')]['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x5453a8,null))[_0x2ac9('0x21')](function(_0x587a2e){if(_0x587a2e){_0x51ba88[_0x2ac9('0x5d')]['OpenchannelAccountId']=_0x587a2e['id'];return db[_0x2ac9('0x65')]['create'](_0x51ba88[_0x2ac9('0x5d')]);}})[_0x2ac9('0x21')](respondWithResult(_0x5453a8,null))[_0x2ac9('0x29')](handleError(_0x5453a8,null));};exports[_0x2ac9('0x66')]=function(_0x4ed35e,_0x17b0aa,_0x3675b0){var _0x31d202={'raw':![],'where':{}};var _0x3ed4d3={};var _0x32dd6f={'count':0x0,'rows':[]};return db[_0x2ac9('0x41')][_0x2ac9('0x67')]({'where':{'id':_0x4ed35e[_0x2ac9('0x58')]['id']}})['then'](handleEntityNotFound(_0x17b0aa,null))['then'](function(_0x5eb7bf){if(_0x5eb7bf){_0x3ed4d3[_0x2ac9('0x48')]=_[_0x2ac9('0x45')](db[_0x2ac9('0x65')][_0x2ac9('0x59')]);_0x3ed4d3[_0x2ac9('0x44')]=_[_0x2ac9('0x45')](_0x4ed35e[_0x2ac9('0x44')]);_0x3ed4d3['filters']=_[_0x2ac9('0x47')](_0x3ed4d3[_0x2ac9('0x48')],_0x3ed4d3[_0x2ac9('0x44')]);_0x31d202[_0x2ac9('0x49')]=_['intersection'](_0x3ed4d3['model'],qs[_0x2ac9('0x4a')](_0x4ed35e[_0x2ac9('0x44')]['fields']));_0x31d202[_0x2ac9('0x49')]=_0x31d202['attributes'][_0x2ac9('0x5a')]?_0x31d202[_0x2ac9('0x49')]:_0x3ed4d3[_0x2ac9('0x48')];if(!_0x4ed35e[_0x2ac9('0x44')][_0x2ac9('0x68')]('nolimit')){_0x31d202[_0x2ac9('0x30')]=qs[_0x2ac9('0x30')](_0x4ed35e[_0x2ac9('0x44')][_0x2ac9('0x30')]);_0x31d202[_0x2ac9('0x2e')]=qs[_0x2ac9('0x2e')](_0x4ed35e[_0x2ac9('0x44')][_0x2ac9('0x2e')]);}_0x31d202[_0x2ac9('0x4c')]=qs[_0x2ac9('0x4d')](_0x4ed35e[_0x2ac9('0x44')][_0x2ac9('0x4d')]);_0x31d202[_0x2ac9('0x4e')]=qs[_0x2ac9('0x46')](_[_0x2ac9('0x4f')](_0x4ed35e[_0x2ac9('0x44')],_0x3ed4d3['filters']));_0x31d202['where'][_0x2ac9('0x69')]=_0x5eb7bf['id'];if(_0x4ed35e[_0x2ac9('0x44')][_0x2ac9('0x50')]){_0x31d202[_0x2ac9('0x4e')]=_[_0x2ac9('0x51')](_0x31d202[_0x2ac9('0x4e')],{'$or':_['map'](_0x31d202['attributes'],function(_0x2f1efb){var _0x100316={};_0x100316[_0x2f1efb]={'$like':'%'+_0x4ed35e[_0x2ac9('0x44')]['filter']+'%'};return _0x100316;})});}_0x31d202=_[_0x2ac9('0x51')]({},_0x31d202,_0x4ed35e[_0x2ac9('0x53')]);return db['Disposition']['count']({'where':_0x31d202[_0x2ac9('0x4e')]})[_0x2ac9('0x21')](function(_0xc6a079){_0x32dd6f[_0x2ac9('0x31')]=_0xc6a079;if(_0x4ed35e['query'][_0x2ac9('0x54')]){_0x31d202[_0x2ac9('0x55')]=[{'all':!![]}];}return db[_0x2ac9('0x65')][_0x2ac9('0x56')](_0x31d202);})[_0x2ac9('0x21')](function(_0x523e7e){_0x32dd6f['rows']=_0x523e7e;return _0x32dd6f;});}})['then'](respondWithFilteredResult(_0x17b0aa,_0x31d202))['catch'](handleError(_0x17b0aa,null));};exports[_0x2ac9('0x6a')]=function(_0x41599e,_0x117a2c,_0x976793){return db[_0x2ac9('0x41')]['find']({'where':{'id':_0x41599e['params']['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x117a2c,null))[_0x2ac9('0x21')](function(_0x4bba10){if(_0x4bba10){return _0x4bba10[_0x2ac9('0x6a')](_0x41599e['query']['ids']);}})[_0x2ac9('0x21')](respondWithStatusCode(_0x117a2c,null))[_0x2ac9('0x29')](handleError(_0x117a2c,null));};exports[_0x2ac9('0x6b')]=function(_0x21220c,_0x34924b,_0x4a78f4){if(_0x21220c[_0x2ac9('0x5d')]['id']){delete _0x21220c[_0x2ac9('0x5d')]['id'];}return db[_0x2ac9('0x41')]['find']({'where':{'id':_0x21220c[_0x2ac9('0x58')]['id']}})['then'](handleEntityNotFound(_0x34924b,null))[_0x2ac9('0x21')](function(_0x14a6f4){if(_0x14a6f4){_0x21220c['body'][_0x2ac9('0x69')]=_0x14a6f4['id'];return db['CannedAnswer'][_0x2ac9('0x5c')](_0x21220c[_0x2ac9('0x5d')]);}})[_0x2ac9('0x21')](respondWithResult(_0x34924b,null))[_0x2ac9('0x29')](handleError(_0x34924b,null));};exports[_0x2ac9('0x6c')]=function(_0x3d72ee,_0x2b4dad,_0x33b2b8){var _0x2553da={'raw':![],'where':{}};var _0x3742dc={};var _0xc5c5bb={'count':0x0,'rows':[]};return db[_0x2ac9('0x41')][_0x2ac9('0x67')]({'where':{'id':_0x3d72ee[_0x2ac9('0x58')]['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x2b4dad,null))[_0x2ac9('0x21')](function(_0x540184){if(_0x540184){_0x3742dc['model']=_[_0x2ac9('0x45')](db[_0x2ac9('0x6d')]['rawAttributes']);_0x3742dc[_0x2ac9('0x44')]=_[_0x2ac9('0x45')](_0x3d72ee[_0x2ac9('0x44')]);_0x3742dc[_0x2ac9('0x46')]=_['intersection'](_0x3742dc[_0x2ac9('0x48')],_0x3742dc[_0x2ac9('0x44')]);_0x2553da[_0x2ac9('0x49')]=_[_0x2ac9('0x47')](_0x3742dc['model'],qs[_0x2ac9('0x4a')](_0x3d72ee[_0x2ac9('0x44')][_0x2ac9('0x4a')]));_0x2553da[_0x2ac9('0x49')]=_0x2553da['attributes'][_0x2ac9('0x5a')]?_0x2553da[_0x2ac9('0x49')]:_0x3742dc['model'];if(!_0x3d72ee[_0x2ac9('0x44')][_0x2ac9('0x68')](_0x2ac9('0x4b'))){_0x2553da['limit']=qs['limit'](_0x3d72ee[_0x2ac9('0x44')]['limit']);_0x2553da[_0x2ac9('0x2e')]=qs['offset'](_0x3d72ee['query'][_0x2ac9('0x2e')]);}_0x2553da['order']=qs[_0x2ac9('0x4d')](_0x3d72ee[_0x2ac9('0x44')]['sort']);_0x2553da['where']=qs['filters'](_['pick'](_0x3d72ee[_0x2ac9('0x44')],_0x3742dc['filters']));_0x2553da[_0x2ac9('0x4e')][_0x2ac9('0x69')]=_0x540184['id'];if(_0x3d72ee[_0x2ac9('0x44')][_0x2ac9('0x50')]){_0x2553da[_0x2ac9('0x4e')]=_[_0x2ac9('0x51')](_0x2553da[_0x2ac9('0x4e')],{'$or':_[_0x2ac9('0x40')](_0x2553da[_0x2ac9('0x49')],function(_0xff94b6){var _0x5a471f={};_0x5a471f[_0xff94b6]={'$like':'%'+_0x3d72ee[_0x2ac9('0x44')][_0x2ac9('0x50')]+'%'};return _0x5a471f;})});}_0x2553da=_[_0x2ac9('0x51')]({},_0x2553da,_0x3d72ee[_0x2ac9('0x53')]);return db[_0x2ac9('0x6d')][_0x2ac9('0x31')]({'where':_0x2553da[_0x2ac9('0x4e')]})[_0x2ac9('0x21')](function(_0x1daf6e){_0xc5c5bb[_0x2ac9('0x31')]=_0x1daf6e;if(_0x3d72ee['query'][_0x2ac9('0x54')]){_0x2553da['include']=[{'all':!![]}];}return db[_0x2ac9('0x6d')][_0x2ac9('0x56')](_0x2553da);})['then'](function(_0x23466c){_0xc5c5bb['rows']=_0x23466c;return _0xc5c5bb;});}})['then'](respondWithFilteredResult(_0x2b4dad,_0x2553da))['catch'](handleError(_0x2b4dad,null));};exports[_0x2ac9('0x6e')]=function(_0x3ec83d,_0x5db7c0,_0xb519dc){return db[_0x2ac9('0x41')][_0x2ac9('0x5b')]({'where':{'id':_0x3ec83d[_0x2ac9('0x58')]['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x5db7c0,null))['then'](function(_0x342f4f){if(_0x342f4f){return _0x342f4f[_0x2ac9('0x6e')](_0x3ec83d['query']['ids']);}})[_0x2ac9('0x21')](respondWithStatusCode(_0x5db7c0,null))[_0x2ac9('0x29')](handleError(_0x5db7c0,null));};exports[_0x2ac9('0x6f')]=function(_0x21f53d,_0x151a8e,_0x599c4e){var _0x4e0a66={'body':_0x21f53d[_0x2ac9('0x5d')],'channel':_0x2ac9('0x70')};var _0x5e8da0=[];var _0x3961ea=[];var _0x5ca4ae={};var _0x75c689=![];return db[_0x2ac9('0x71')][_0x2ac9('0x63')]()[_0x2ac9('0x21')](function(_0x4ec0a8){if(!_0x4ec0a8){throw new db['Sequelize'][(_0x2ac9('0x72'))](_0x2ac9('0x73'));}_0x5e8da0=_[_0x2ac9('0x74')](_['keys'](_0x4ec0a8),['createdAt',_0x2ac9('0x75')]);_0x3961ea=_[_0x2ac9('0x74')](_[_0x2ac9('0x45')](_0x4ec0a8),[_0x2ac9('0x76'),'updatedAt','CompanyId',_0x2ac9('0x77')]);if(_0x21f53d[_0x2ac9('0x5d')]['id']){delete _0x21f53d[_0x2ac9('0x5d')]['id'];}if(_[_0x2ac9('0x78')](_0x21f53d[_0x2ac9('0x5d')]['from'])){throw new db[(_0x2ac9('0x79'))][(_0x2ac9('0x72'))](_0x2ac9('0x7a'));}if(_['isNil'](_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x5d')])||_0x21f53d['body'][_0x2ac9('0x5d')]===''){throw new db[(_0x2ac9('0x79'))]['ValidationError'](_0x2ac9('0x7b'));}if(_['isNil'](_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x7c')])){throw new db[(_0x2ac9('0x79'))][(_0x2ac9('0x72'))](_0x2ac9('0x7d')+_0x3961ea);}if(!_['includes'](_0x3961ea,_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x7c')])){throw new db[(_0x2ac9('0x79'))][(_0x2ac9('0x72'))](_0x2ac9('0x7e')+_0x3961ea);}_0x5ca4ae[_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x7c')]]=_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x7f')];})[_0x2ac9('0x21')](function(){return db[_0x2ac9('0x41')]['find']({'where':{'id':_0x21f53d[_0x2ac9('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x2ac9('0x80'),'include':[{'model':db[_0x2ac9('0x71')],'as':_0x2ac9('0x81'),'where':_0x5ca4ae,'limit':0x1,'order':[[_0x2ac9('0x75'),_0x2ac9('0x82')]]}]},{'model':db[_0x2ac9('0x83')],'as':_0x2ac9('0x84')}]});})[_0x2ac9('0x21')](handleEntityNotFound(_0x151a8e,null))[_0x2ac9('0x21')](function(_0x17e2ea){if(_0x17e2ea&&_0x17e2ea[_0x2ac9('0x80')]){_0x4e0a66[_0x2ac9('0x85')]=_0x17e2ea;_0x4e0a66[_0x2ac9('0x86')]=_0x17e2ea[_0x2ac9('0x84')];_0x4e0a66[_0x2ac9('0x87')]=_0x17e2ea[_0x2ac9('0x80')];_0x4e0a66['applications']=_[_0x2ac9('0x88')](_0x4e0a66[_0x2ac9('0x86')],[_0x2ac9('0x89')],[_0x2ac9('0x8a')]);if(_0x4e0a66[_0x2ac9('0x85')]['Applications']){delete _0x4e0a66['account'][_0x2ac9('0x84')];}if(_0x4e0a66['account']['List']&&_0x4e0a66[_0x2ac9('0x85')]['List']['Contacts'][_0x2ac9('0x5a')]){return _0x4e0a66['account'][_0x2ac9('0x80')][_0x2ac9('0x81')][0x0];}var _0x2210f1=_[_0x2ac9('0x19')](_0x21f53d[_0x2ac9('0x5d')],{'firstName':_0x21f53d['body']['from'],'ListId':_0x17e2ea[_0x2ac9('0x77')]});_0x2210f1[_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x7c')]]=_0x21f53d[_0x2ac9('0x5d')]['from'];return db['CmContact'][_0x2ac9('0x5c')](_0x2210f1,{'fields':_0x5e8da0,'raw':!![]});}})['then'](handleEntityNotFound(_0x151a8e,null))[_0x2ac9('0x21')](function(_0x39a040){_0x4e0a66[_0x2ac9('0x8b')]=_0x39a040;if(_0x39a040){var _0x490eea={'ContactId':_0x39a040['id'],'OpenchannelAccountId':_0x21f53d[_0x2ac9('0x58')]['id'],'from':(_0x39a040[_0x2ac9('0x8c')]||'')+'\x20'+(_0x39a040[_0x2ac9('0x8d')]||'')};var _0x4417c3={'OpenchannelAccountId':_0x21f53d['params']['id'],'closed':![]};if(_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x8e')]){_0x4417c3[_0x2ac9('0x8e')]=_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x8e')];return db[_0x2ac9('0x8f')][_0x2ac9('0x5b')]({'where':_0x4417c3})['then'](function(_0x527e8b){if(_0x527e8b){return[_0x527e8b,![]];}_0x490eea[_0x2ac9('0x8e')]=_0x21f53d[_0x2ac9('0x5d')]['threadId'];_0x490eea['externalUrl']=_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x90')];return db['OpenchannelInteraction'][_0x2ac9('0x5c')](_0x490eea)[_0x2ac9('0x21')](function(_0x48c36c){return[_0x48c36c,!![]];});});}else{_0x4417c3[_0x2ac9('0x8e')]=null;}_0x4417c3['ContactId']=_0x39a040['id'];return db[_0x2ac9('0x8f')]['find']({'where':_0x4417c3})[_0x2ac9('0x21')](function(_0x4fdf04){if(_0x4fdf04){return[_0x4fdf04,![]];}return db[_0x2ac9('0x8f')]['create'](_0x490eea)[_0x2ac9('0x21')](function(_0x2c264a){return[_0x2c264a,!![]];});});}})[_0x2ac9('0x91')](function(_0x4c0a33,_0x5d1900){if(_0x4c0a33){_0x75c689=_0x5d1900;if(!_0x5d1900){var _0x30571f={'from':(_0x4e0a66[_0x2ac9('0x8b')][_0x2ac9('0x8c')]||'')+'\x20'+(_0x4e0a66[_0x2ac9('0x8b')][_0x2ac9('0x8d')]||'')};if(_0x21f53d['body'][_0x2ac9('0x8e')]&&_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x92')]&&_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x8e')]!=_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x92')]){_0x30571f[_0x2ac9('0x8e')]=_0x21f53d['body'][_0x2ac9('0x92')];}return _0x4c0a33[_0x2ac9('0x37')](_0x30571f);}else{return _0x4c0a33;}}})[_0x2ac9('0x21')](function(_0x49f043){_0x4e0a66['interaction']=_0x49f043['get']({'plain':!![]});_0x4e0a66[_0x2ac9('0x93')]['created']=_0x75c689;if(_0x4e0a66[_0x2ac9('0x93')][_0x2ac9('0x94')]){if(_0x4e0a66['account'][_0x2ac9('0x95')]){_0x4e0a66[_0x2ac9('0x86')]['push']({'id':0x0,'priority':_0x4e0a66[_0x2ac9('0x86')][_0x2ac9('0x5a')]+0x1,'app':_0x2ac9('0x96'),'appdata':_0x2ac9('0x97'),'interval':_0x2ac9('0x98')});}}return db[_0x2ac9('0x99')][_0x2ac9('0x5c')]({'body':_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x5d')],'OpenchannelAccountId':_0x21f53d[_0x2ac9('0x58')]['id'],'OpenchannelInteractionId':_0x49f043['id'],'direction':'in','ContactId':_0x4e0a66[_0x2ac9('0x8b')]['id'],'AttachmentId':_0x21f53d[_0x2ac9('0x5d')][_0x2ac9('0x9a')]});})['then'](function(_0x5c9b22){_0x4e0a66['message']=_0x5c9b22;if(_0x4e0a66[_0x2ac9('0x93')][_0x2ac9('0x9b')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x4e0a66[_0x2ac9('0x93')]['UserId']}})[_0x2ac9('0x21')](function(_0x302d87){if(_0x302d87){_0x4e0a66[_0x2ac9('0x86')][_0x2ac9('0x9c')]({'id':0x0,'priority':0x0,'app':_0x2ac9('0x9d'),'appdata':_0x302d87[_0x2ac9('0x3b')]+','+(_0x4e0a66['account'][_0x2ac9('0x9e')]||0xa),'interval':_0x2ac9('0x98')});_0x4e0a66[_0x2ac9('0x9f')]=![];}return respondWithRpcPromise(_0x2ac9('0xa0'),_0x2ac9('0xa1'),_0x4e0a66);});}return respondWithRpcPromise('Start','startRouting',_0x4e0a66);})[_0x2ac9('0x21')](function(_0x1325c6){respondWithRpcPromise(_0x2ac9('0xa2'),_0x2ac9('0xa2'),{'event':_0x2ac9('0x6f'),'message':_0x1325c6},client9002);return _0x1325c6;})[_0x2ac9('0x21')](respondWithResult(_0x151a8e,null))['catch'](handleError(_0x151a8e,null));};exports[_0x2ac9('0xa3')]=function(_0x4c1ec5,_0x1ac664){var _0x229978=_0x4c1ec5[_0x2ac9('0x58')]['id'];var _0x501f90=_0x4c1ec5[_0x2ac9('0x5d')];var _0x17f64d=0xc8;var _0x2bf43d=null;return db[_0x2ac9('0xa4')][_0x2ac9('0xa5')]({'isolationLevel':db[_0x2ac9('0xa4')][_0x2ac9('0xa6')][_0x2ac9('0xa7')][_0x2ac9('0xa8')]},function(_0x32f047){return db['OpenchannelAccount'][_0x2ac9('0x67')]({'where':{'id':_0x229978},'transaction':_0x32f047})['then'](function(_0x2debb3){if(_0x2debb3){return db[_0x2ac9('0x83')]['destroy']({'where':{'OpenchannelAccountId':_0x229978},'transaction':_0x32f047})[_0x2ac9('0x21')](function(){var _0x509a2a=_[_0x2ac9('0x40')](_0x501f90,function(_0x3b0f00){_0x3b0f00[_0x2ac9('0x69')]=_0x229978;return _0x3b0f00;});return db[_0x2ac9('0x83')][_0x2ac9('0xa9')](_0x509a2a,{'transaction':_0x32f047});});}else{_0x17f64d=0x194;_0x2bf43d=[];}});})[_0x2ac9('0x21')](function(){if(_0x17f64d!==0x194){return db[_0x2ac9('0x83')][_0x2ac9('0xaa')]({'where':{'OpenchannelAccountId':_0x229978},'order':_0x2ac9('0x89')})[_0x2ac9('0x21')](function(_0x1e1baa){_0x2bf43d=_0x1e1baa;});}})['catch'](function(_0x1e4a7c){_0x17f64d=0x1f4;logger[_0x2ac9('0x25')](_0x1e4a7c[_0x2ac9('0x3a')]);if(_0x1e4a7c['name']){delete _0x1e4a7c[_0x2ac9('0x3b')];}_0x2bf43d=_0x1e4a7c;})['finally'](function(){if(_0x2bf43d===null){_0x1ac664[_0x2ac9('0x2a')](_0x17f64d);}else{if(_0x17f64d===0x1f4){_0x1ac664['status'](_0x17f64d)[_0x2ac9('0x3c')](_0x2bf43d);}else{_0x1ac664['status'](_0x17f64d)['json'](_0x2bf43d);}}});};exports[_0x2ac9('0xab')]=function(_0x38a140,_0x178a82,_0x1ea20f){var _0x172a1={};var _0x535488={};var _0x41c9e1;var _0x16fa2f;return db['OpenchannelAccount'][_0x2ac9('0x67')]({'where':{'id':_0x38a140[_0x2ac9('0x58')]['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x178a82,null))[_0x2ac9('0x21')](function(_0x54e938){if(_0x54e938){_0x41c9e1=_0x54e938;_0x535488[_0x2ac9('0x48')]=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x535488[_0x2ac9('0x44')]=_[_0x2ac9('0x45')](_0x38a140[_0x2ac9('0x44')]);_0x535488[_0x2ac9('0x46')]=_[_0x2ac9('0x47')](_0x535488[_0x2ac9('0x48')],_0x535488['query']);_0x172a1[_0x2ac9('0x49')]=_[_0x2ac9('0x47')](_0x535488['model'],qs[_0x2ac9('0x4a')](_0x38a140['query'][_0x2ac9('0x4a')]));_0x172a1[_0x2ac9('0x49')]=_0x172a1['attributes'][_0x2ac9('0x5a')]?_0x172a1['attributes']:_0x535488[_0x2ac9('0x48')];_0x172a1['order']=qs[_0x2ac9('0x4d')](_0x38a140[_0x2ac9('0x44')]['sort']);_0x172a1[_0x2ac9('0x4e')]=qs['filters'](_[_0x2ac9('0x4f')](_0x38a140[_0x2ac9('0x44')],_0x535488[_0x2ac9('0x46')]));if(_0x38a140[_0x2ac9('0x44')][_0x2ac9('0x50')]){_0x172a1[_0x2ac9('0x4e')]=_[_0x2ac9('0x51')](_0x172a1[_0x2ac9('0x4e')],{'$or':_[_0x2ac9('0x40')](_0x172a1[_0x2ac9('0x49')],function(_0xaa0932){var _0x39074f={};_0x39074f[_0xaa0932]={'$like':'%'+_0x38a140['query']['filter']+'%'};return _0x39074f;})});}_0x172a1=_[_0x2ac9('0x51')]({},_0x172a1,_0x38a140[_0x2ac9('0x53')]);return _0x41c9e1[_0x2ac9('0xab')](_0x172a1);}})[_0x2ac9('0x21')](function(_0x5c068c){if(_0x5c068c){_0x16fa2f=_0x5c068c[_0x2ac9('0x5a')];if(!_0x38a140['query'][_0x2ac9('0x68')]('nolimit')){_0x172a1['limit']=qs[_0x2ac9('0x30')](_0x38a140[_0x2ac9('0x44')][_0x2ac9('0x30')]);_0x172a1[_0x2ac9('0x2e')]=qs[_0x2ac9('0x2e')](_0x38a140[_0x2ac9('0x44')]['offset']);}return _0x41c9e1[_0x2ac9('0xab')](_0x172a1);}})['then'](function(_0x357dc2){if(_0x357dc2){return _0x357dc2?{'count':_0x16fa2f,'rows':_0x357dc2}:null;}})[_0x2ac9('0x21')](respondWithResult(_0x178a82,null))['catch'](handleError(_0x178a82,null));};exports[_0x2ac9('0xac')]=function(_0x3e227c,_0x4a7142,_0x3cf75f){var _0x1697ce={'raw':![],'where':{}};var _0x3ad967={};var _0x3d10eb={'count':0x0,'rows':[]};return db[_0x2ac9('0x41')]['findOne']({'where':{'id':_0x3e227c['params']['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x4a7142,null))[_0x2ac9('0x21')](function(_0x43ea7e){if(_0x43ea7e){_0x3ad967[_0x2ac9('0x48')]=_['keys'](db[_0x2ac9('0x8f')][_0x2ac9('0x59')]);_0x3ad967[_0x2ac9('0x44')]=_[_0x2ac9('0x45')](_0x3e227c['query']);_0x3ad967[_0x2ac9('0x46')]=_[_0x2ac9('0x47')](_0x3ad967[_0x2ac9('0x48')],_0x3ad967[_0x2ac9('0x44')]);_0x1697ce[_0x2ac9('0x49')]=_[_0x2ac9('0x47')](_0x3ad967[_0x2ac9('0x48')],qs[_0x2ac9('0x4a')](_0x3e227c[_0x2ac9('0x44')][_0x2ac9('0x4a')]));_0x1697ce[_0x2ac9('0x49')]=_0x1697ce[_0x2ac9('0x49')]['length']?_0x1697ce['attributes']:_0x3ad967[_0x2ac9('0x48')];if(!_0x3e227c[_0x2ac9('0x44')][_0x2ac9('0x68')](_0x2ac9('0x4b'))){_0x1697ce[_0x2ac9('0x30')]=qs['limit'](_0x3e227c[_0x2ac9('0x44')][_0x2ac9('0x30')]);_0x1697ce[_0x2ac9('0x2e')]=qs[_0x2ac9('0x2e')](_0x3e227c[_0x2ac9('0x44')][_0x2ac9('0x2e')]);}_0x1697ce[_0x2ac9('0x4c')]=qs[_0x2ac9('0x4d')](_0x3e227c[_0x2ac9('0x44')][_0x2ac9('0x4d')]);_0x1697ce[_0x2ac9('0x4e')]=qs[_0x2ac9('0x46')](_[_0x2ac9('0x4f')](_0x3e227c[_0x2ac9('0x44')],_0x3ad967['filters']));_0x1697ce[_0x2ac9('0x4e')][_0x2ac9('0x69')]=_0x43ea7e['id'];if(_0x3e227c[_0x2ac9('0x44')][_0x2ac9('0x50')]){_0x1697ce[_0x2ac9('0x4e')]=_[_0x2ac9('0x51')](_0x1697ce['where'],{'$or':_['map'](_0x1697ce[_0x2ac9('0x49')],function(_0x55adf3){var _0x272c30={};_0x272c30[_0x55adf3]={'$like':'%'+_0x3e227c[_0x2ac9('0x44')]['filter']+'%'};return _0x272c30;})});}_0x1697ce=_[_0x2ac9('0x51')]({},_0x1697ce,_0x3e227c[_0x2ac9('0x53')]);return db[_0x2ac9('0x8f')][_0x2ac9('0x31')]({'where':_0x1697ce[_0x2ac9('0x4e')]})[_0x2ac9('0x21')](function(_0x2b1567){_0x3d10eb[_0x2ac9('0x31')]=_0x2b1567;if(_0x3e227c[_0x2ac9('0x44')][_0x2ac9('0x54')]){_0x1697ce[_0x2ac9('0x55')]=[{'model':db[_0x2ac9('0x71')],'as':_0x2ac9('0xad'),'required':![]},{'model':db[_0x2ac9('0xae')],'as':'Owner','attributes':[_0x2ac9('0x3b'),'fullname',_0x2ac9('0xaf')],'required':![]},{'model':db[_0x2ac9('0xb0')],'as':_0x2ac9('0xb1'),'attributes':['id',_0x2ac9('0x3b'),_0x2ac9('0xb2')],'where':_0x3e227c[_0x2ac9('0x44')][_0x2ac9('0xb3')]?{'id':_0x3e227c[_0x2ac9('0x44')]['tag']}:undefined,'required':_0x3e227c['query'][_0x2ac9('0xb3')]?!![]:![]}];}return db[_0x2ac9('0x8f')]['findAll'](_0x1697ce);})['then'](function(_0x18b651){_0x3d10eb[_0x2ac9('0xb4')]=_0x18b651;return _0x3d10eb;});}})[_0x2ac9('0x21')](respondWithFilteredResult(_0x4a7142,_0x1697ce))[_0x2ac9('0x29')](handleError(_0x4a7142,null));};exports['addAgents']=function(_0x19afbb,_0x4d6887,_0xa5cb68){return db[_0x2ac9('0x41')][_0x2ac9('0x5b')]({'where':{'id':_0x19afbb[_0x2ac9('0x58')]['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x4d6887,null))[_0x2ac9('0x21')](function(_0x12ebfd){if(_0x12ebfd){return _0x12ebfd[_0x2ac9('0xb5')](_0x19afbb[_0x2ac9('0x5d')][_0x2ac9('0xb6')],_[_0x2ac9('0xb7')](_0x19afbb[_0x2ac9('0x5d')],[_0x2ac9('0xb6'),'id'])||{})[_0x2ac9('0x91')](function(_0x498864){for(var _0x14da7d=0x0;_0x14da7d<_0x19afbb[_0x2ac9('0x5d')]['ids']['length'];_0x14da7d+=0x1){socket['emit'](_0x2ac9('0xb8'),{'UserId':Number(_0x19afbb['body'][_0x2ac9('0xb6')][_0x14da7d]),'OpenchannelAccountId':Number(_0x19afbb[_0x2ac9('0x58')]['id'])});}return _0x498864;});}})['then'](respondWithResult(_0x4d6887,null))[_0x2ac9('0x29')](handleError(_0x4d6887,null));};exports[_0x2ac9('0xb9')]=function(_0x4ce662,_0x2838b2,_0x2281a4){return db[_0x2ac9('0x41')][_0x2ac9('0x5b')]({'where':{'id':_0x4ce662[_0x2ac9('0x58')]['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x2838b2,null))[_0x2ac9('0x21')](function(_0x3d6353){if(_0x3d6353){return _0x3d6353[_0x2ac9('0xb9')](_0x4ce662['query'][_0x2ac9('0xb6')])[_0x2ac9('0x21')](function(){if(_['isArray'](_0x4ce662['query'][_0x2ac9('0xb6')])){for(var _0x31a69b=0x0;_0x31a69b<_0x4ce662[_0x2ac9('0x44')]['ids'][_0x2ac9('0x5a')];_0x31a69b+=0x1){socket['emit'](_0x2ac9('0xba'),{'UserId':Number(_0x4ce662['query'][_0x2ac9('0xb6')][_0x31a69b]),'OpenchannelAccountId':Number(_0x4ce662[_0x2ac9('0x58')]['id'])});}}else{socket['emit'](_0x2ac9('0xba'),{'UserId':Number(_0x4ce662[_0x2ac9('0x44')][_0x2ac9('0xb6')]),'OpenchannelAccountId':Number(_0x4ce662[_0x2ac9('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x2838b2,null))[_0x2ac9('0x29')](handleError(_0x2838b2,null));};exports[_0x2ac9('0xbb')]=function(_0x24773a,_0x3f9588,_0x3001b7){var _0x2c6d61={};var _0x589341={};var _0x296368;var _0x541e97;return db[_0x2ac9('0x41')]['findOne']({'where':{'id':_0x24773a[_0x2ac9('0x58')]['id']}})[_0x2ac9('0x21')](handleEntityNotFound(_0x3f9588,null))[_0x2ac9('0x21')](function(_0x4dca8d){if(_0x4dca8d){_0x296368=_0x4dca8d;_0x589341['model']=_['keys'](db[_0x2ac9('0xae')][_0x2ac9('0x59')]);_0x589341[_0x2ac9('0x44')]=_[_0x2ac9('0x45')](_0x24773a[_0x2ac9('0x44')]);_0x589341[_0x2ac9('0x46')]=_[_0x2ac9('0x47')](_0x589341[_0x2ac9('0x48')],_0x589341['query']);_0x2c6d61['attributes']=_[_0x2ac9('0x47')](_0x589341['model'],qs[_0x2ac9('0x4a')](_0x24773a['query'][_0x2ac9('0x4a')]));_0x2c6d61[_0x2ac9('0x49')]=_0x2c6d61[_0x2ac9('0x49')]['length']?_0x2c6d61[_0x2ac9('0x49')]:_0x589341[_0x2ac9('0x48')];_0x2c6d61[_0x2ac9('0x4c')]=qs[_0x2ac9('0x4d')](_0x24773a[_0x2ac9('0x44')][_0x2ac9('0x4d')]);_0x2c6d61[_0x2ac9('0x4e')]=qs[_0x2ac9('0x46')](_['pick'](_0x24773a['query'],_0x589341['filters']));if(_0x24773a['query'][_0x2ac9('0x50')]){_0x2c6d61[_0x2ac9('0x4e')]=_[_0x2ac9('0x51')](_0x2c6d61[_0x2ac9('0x4e')],{'$or':_[_0x2ac9('0x40')](_0x2c6d61[_0x2ac9('0x49')],function(_0x196d57){var _0x38dea2={};_0x38dea2[_0x196d57]={'$like':'%'+_0x24773a[_0x2ac9('0x44')][_0x2ac9('0x50')]+'%'};return _0x38dea2;})});}_0x2c6d61=_[_0x2ac9('0x51')]({},_0x2c6d61,_0x24773a[_0x2ac9('0x53')]);return _0x296368[_0x2ac9('0xbb')](_0x2c6d61);}})['then'](function(_0x4eab31){if(_0x4eab31){_0x541e97=_0x4eab31[_0x2ac9('0x5a')];if(!_0x24773a['query'][_0x2ac9('0x68')](_0x2ac9('0x4b'))){_0x2c6d61[_0x2ac9('0x30')]=qs[_0x2ac9('0x30')](_0x24773a[_0x2ac9('0x44')][_0x2ac9('0x30')]);_0x2c6d61[_0x2ac9('0x2e')]=qs['offset'](_0x24773a[_0x2ac9('0x44')]['offset']);}return _0x296368['getAgents'](_0x2c6d61);}})[_0x2ac9('0x21')](function(_0x58a699){if(_0x58a699){return _0x58a699?{'count':_0x541e97,'rows':_0x58a699}:null;}})[_0x2ac9('0x21')](respondWithResult(_0x3f9588,null))[_0x2ac9('0x29')](handleError(_0x3f9588,null));};exports['send']=function(_0x2c7dbc,_0x452fbf,_0x312fdf){var _0x4e6711,_0xadb827,_0x2f8348;if(_[_0x2ac9('0x78')](_0x2c7dbc['body'][_0x2ac9('0x5d')])||_0x2c7dbc[_0x2ac9('0x5d')]['body']===''){throw new db[(_0x2ac9('0x79'))]['ValidationError'](_0x2ac9('0x7b'));}if(_[_0x2ac9('0x78')](_0x2c7dbc[_0x2ac9('0x5d')]['to'])){}_0x4e6711=_0x2c7dbc[_0x2ac9('0x5d')]['to'];return db['OpenchannelAccount'][_0x2ac9('0x67')]({'where':{'id':_0x2c7dbc[_0x2ac9('0x58')]['id']}})['then'](handleEntityNotFound(_0x452fbf,null))[_0x2ac9('0x21')](function(_0x28b123){if(_0x28b123){return db['OpenchannelAccount'][_0x2ac9('0x5b')]({'where':{'id':_0x28b123['id']},'include':[{'model':db['CmList'],'as':_0x2ac9('0x80'),'include':[{'model':db[_0x2ac9('0x71')],'as':'Contacts','where':{[_0x28b123[_0x2ac9('0x7c')]]:_0x4e6711},'limit':0x1,'order':[[_0x2ac9('0x75'),_0x2ac9('0x82')]]}]}]})[_0x2ac9('0x21')](handleEntityNotFound(_0x452fbf,null))[_0x2ac9('0x21')](function(_0x2aec95){if(_0x2aec95&&_0x2aec95[_0x2ac9('0x80')]){_0xadb827=_0x2aec95[_0x2ac9('0x39')]({'plain':!![]});if(_0xadb827[_0x2ac9('0x80')]&&_0xadb827['List']['Contacts'][_0x2ac9('0x5a')]){return _0xadb827[_0x2ac9('0x80')][_0x2ac9('0x81')][0x0];}return db['CmContact'][_0x2ac9('0x5c')](_[_0x2ac9('0x19')](_0x2c7dbc[_0x2ac9('0x5d')],{'firstName':_0x4e6711,[_0x2aec95[_0x2ac9('0x7c')]]:_0x4e6711,'phone':_0x4e6711,'ListId':_0xadb827[_0x2ac9('0x77')]}));}})['then'](handleEntityNotFound(_0x452fbf,null))['then'](function(_0x215c59){if(_0x215c59){_0x2f8348=_0x215c59;return db[_0x2ac9('0x8f')][_0x2ac9('0x5b')]({'where':{'ContactId':_0x2f8348['id'],'closed':![],'OpenchannelAccountId':_0xadb827['id']}})[_0x2ac9('0x21')](function(_0x3002b6){if(_0x3002b6){return[_0x3002b6,![]];}return db[_0x2ac9('0x8f')][_0x2ac9('0x5c')]({'UserId':_0x2c7dbc[_0x2ac9('0x5e')]['id'],'ContactId':_0x2f8348['id'],'OpenchannelAccountId':_0xadb827['id'],'lastMsgDirection':_0x2ac9('0xbc'),'firstMsgDirection':_0x2ac9('0xbc'),'Messages':[_[_0x2ac9('0x51')](_0x2c7dbc['body'],{'read':![],'body':_0x2c7dbc['body'][_0x2ac9('0x5d')],'OpenchannelAccountId':_0xadb827['id'],'UserId':_0x2c7dbc['user']['id'],'ContactId':_0x2f8348['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x2ac9('0xbd')}]})['then'](function(_0x43e43){return[_0x43e43,!![]];});});}})[_0x2ac9('0x91')](function(_0x5d7961,_0x24bbbe){if(_0x24bbbe){return _0x5d7961;}return db['OpenchannelMessage']['create'](_[_0x2ac9('0x51')](_0x2c7dbc['body'],{'read':![],'body':_0x2c7dbc[_0x2ac9('0x5d')][_0x2ac9('0x5d')],'OpenchannelAccountId':_0xadb827['id'],'OpenchannelInteractionId':_0x5d7961['id'],'UserId':_0x2c7dbc[_0x2ac9('0x5e')]['id'],'ContactId':_0x2f8348['id']}))[_0x2ac9('0x21')](function(_0xcdfc5f){_0x5d7961[_0x2ac9('0xbe')][_0x2ac9('0xbd')]=[];_0x5d7961['dataValues'][_0x2ac9('0xbd')]['push'](_0xcdfc5f[_0x2ac9('0xbe')]);return _0x5d7961;});});}})[_0x2ac9('0x21')](respondWithResult(_0x452fbf,null))[_0x2ac9('0x29')](handleError(_0x452fbf,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 26dc0dd..b23d02c 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 _0x0713=['exports','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4c2bdc,_0x5915d7){var _0x5a3222=function(_0x2262dd){while(--_0x2262dd){_0x4c2bdc['push'](_0x4c2bdc['shift']());}};_0x5a3222(++_0x5915d7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x3071('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3071('0x1')](0x0);var events={'afterCreate':_0x3071('0x2'),'afterUpdate':_0x3071('0x3'),'afterDestroy':_0x3071('0x4')};function emitEvent(_0x52b5fb){return function(_0x2c547f,_0x7b18a4,_0x33a70c){OpenchannelAccountEvents[_0x3071('0x5')](_0x52b5fb+':'+_0x2c547f['id'],_0x2c547f);OpenchannelAccountEvents[_0x3071('0x5')](_0x52b5fb,_0x2c547f);_0x33a70c(null);};}for(var e in events){if(events[_0x3071('0x6')](e)){var event=events[e];OpenchannelAccount[_0x3071('0x7')](e,emitEvent(event));}}module[_0x3071('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x13f6=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x24e543,_0x548699){var _0x3e07eb=function(_0x47fb80){while(--_0x47fb80){_0x24e543['push'](_0x24e543['shift']());}};_0x3e07eb(++_0x548699);}(_0x13f6,0x124));var _0x613f=function(_0x267c7b,_0x2eb4fa){_0x267c7b=_0x267c7b-0x0;var _0x2b9132=_0x13f6[_0x267c7b];return _0x2b9132;};'use strict';var EventEmitter=require(_0x613f('0x0'));var OpenchannelAccount=require(_0x613f('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613f('0x2'),'afterUpdate':_0x613f('0x3'),'afterDestroy':_0x613f('0x4')};function emitEvent(_0x5414ff){return function(_0x179f6e,_0x1e01e3,_0x20af2f){OpenchannelAccountEvents['emit'](_0x5414ff+':'+_0x179f6e['id'],_0x179f6e);OpenchannelAccountEvents[_0x613f('0x5')](_0x5414ff,_0x179f6e);_0x20af2f(null);};}for(var e in events){if(events[_0x613f('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](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 14e0015..cb2cd20 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(_0x588959,_0x4b16c3){var _0x3b4419=function(_0x4682c4){while(--_0x4682c4){_0x588959['push'](_0x588959['shift']());}};_0x3b4419(++_0x4b16c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x70d226,_0x309a32){var _0x29827c=function(_0x570407){while(--_0x570407){_0x70d226['push'](_0x70d226['shift']());}};_0x29827c(++_0x309a32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 1adbd7e..0c81bf5 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 _0xc29b=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x208f6b,_0x248a93){var _0x5f2983=function(_0x5deac3){while(--_0x5deac3){_0x208f6b['push'](_0x208f6b['shift']());}};_0x5f2983(++_0x248a93);}(_0xc29b,0x12d));var _0xbc29=function(_0x41e218,_0x33d6c2){_0x41e218=_0x41e218-0x0;var _0x271389=_0xc29b[_0x41e218];return _0x271389;};'use strict';var _=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var moment=require(_0xbc29('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc29('0x3'));var fs=require('fs');var Redis=require(_0xbc29('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc29('0x5'));var logger=require(_0xbc29('0x6'))(_0xbc29('0x7'));var config=require(_0xbc29('0x8'));var jayson=require(_0xbc29('0x9'));var client=jayson[_0xbc29('0xa')][_0xbc29('0xb')]({'port':0x232a});config[_0xbc29('0xc')]=_[_0xbc29('0xd')](config[_0xbc29('0xc')],{'host':_0xbc29('0xe'),'port':0x18eb});var socket=require(_0xbc29('0xf'))(new Redis(config[_0xbc29('0xc')]));require(_0xbc29('0x10'))[_0xbc29('0x11')](socket);function respondWithRpcPromise(_0x36d1e3,_0x13a581,_0x2f591c){return new BPromise(function(_0x35ece9,_0x2710ad){return client['request'](_0x36d1e3,_0x2f591c)[_0xbc29('0x12')](function(_0x888953){logger[_0xbc29('0x13')](_0xbc29('0x14'),_0x13a581,_0xbc29('0x15'));logger[_0xbc29('0x16')](_0xbc29('0x17'),_0x13a581,'request\x20sent',JSON[_0xbc29('0x18')](_0x888953));if(_0x888953[_0xbc29('0x19')]){if(_0x888953[_0xbc29('0x19')]['code']===0x1f4){logger['error'](_0xbc29('0x14'),_0x13a581,_0x888953['error'][_0xbc29('0x1a')]);return _0x2710ad(_0x888953[_0xbc29('0x19')][_0xbc29('0x1a')]);}logger['error'](_0xbc29('0x14'),_0x13a581,_0x888953['error'][_0xbc29('0x1a')]);return _0x35ece9(_0x888953[_0xbc29('0x19')][_0xbc29('0x1a')]);}else{logger[_0xbc29('0x13')](_0xbc29('0x14'),_0x13a581,_0xbc29('0x15'));_0x35ece9(_0x888953['result'][_0xbc29('0x1a')]);}})[_0xbc29('0x1b')](function(_0x4eadbe){logger['error'](_0xbc29('0x14'),_0x13a581,_0x4eadbe);_0x2710ad(_0x4eadbe);});});} \ No newline at end of file +var _0x0bb5=['redis','defaults','localhost','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5ce4b1,_0xd3dbe9){var _0x12b687=function(_0x4a8bc4){while(--_0x4a8bc4){_0x5ce4b1['push'](_0x5ce4b1['shift']());}};_0x12b687(++_0xd3dbe9);}(_0x0bb5,0x148));var _0x50bb=function(_0x5d19dd,_0x55f7af){_0x5d19dd=_0x5d19dd-0x0;var _0x3c9101=_0x0bb5[_0x5d19dd];return _0x3c9101;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x50bb('0xa')]=_[_0x50bb('0xb')](config[_0x50bb('0xa')],{'host':_0x50bb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x50bb('0xd'))[_0x50bb('0xe')](socket);function respondWithRpcPromise(_0x3ae598,_0x239a89,_0x5512e1){return new BPromise(function(_0x36f7a1,_0x2edeeb){return client[_0x50bb('0xf')](_0x3ae598,_0x5512e1)[_0x50bb('0x10')](function(_0x346422){logger[_0x50bb('0x11')](_0x50bb('0x12'),_0x239a89,'request\x20sent');logger[_0x50bb('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x239a89,_0x50bb('0x14'),JSON[_0x50bb('0x15')](_0x346422));if(_0x346422[_0x50bb('0x16')]){if(_0x346422['error'][_0x50bb('0x17')]===0x1f4){logger[_0x50bb('0x16')](_0x50bb('0x12'),_0x239a89,_0x346422['error'][_0x50bb('0x18')]);return _0x2edeeb(_0x346422['error'][_0x50bb('0x18')]);}logger[_0x50bb('0x16')](_0x50bb('0x12'),_0x239a89,_0x346422[_0x50bb('0x16')][_0x50bb('0x18')]);return _0x36f7a1(_0x346422['error'][_0x50bb('0x18')]);}else{logger[_0x50bb('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x239a89,_0x50bb('0x14'));_0x36f7a1(_0x346422['result'][_0x50bb('0x18')]);}})[_0x50bb('0x19')](function(_0x4b06f5){logger['error'](_0x50bb('0x12'),_0x239a89,_0x4b06f5);_0x2edeeb(_0x4b06f5);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 0ac4fdd..465ef75 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 _0x4c6d=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x59aa51,_0x1873f3){var _0x50f0a2=function(_0x32181e){while(--_0x32181e){_0x59aa51['push'](_0x59aa51['shift']());}};_0x50f0a2(++_0x1873f3);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x281797,_0x223cca){_0x281797=_0x281797-0x0;var _0x10dca9=_0x4c6d[_0x281797];return _0x10dca9;};'use strict';var OpenchannelAccountEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){OpenchannelAccountEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);OpenchannelAccountEvents['on'](_0x5d4fce,_0x440ee3);}}; \ No newline at end of file +var _0xb377=['remove','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x234f24,_0x29c477){var _0x17f035=function(_0x4335f4){while(--_0x4335f4){_0x234f24['push'](_0x234f24['shift']());}};_0x17f035(++_0x29c477);}(_0xb377,0x1b6));var _0x7b37=function(_0x772d7e,_0x20981b){_0x772d7e=_0x772d7e-0x0;var _0x23cb2c=_0xb377[_0x772d7e];return _0x23cb2c;};'use strict';var OpenchannelAccountEvents=require(_0x7b37('0x0'));var events=[_0x7b37('0x1'),_0x7b37('0x2'),_0x7b37('0x3')];function createListener(_0xbcbce6,_0x36868b){return function(_0x15bc68){_0x36868b[_0x7b37('0x4')](_0xbcbce6,_0x15bc68);};}function removeListener(_0x2018bd,_0x13f4c4){return function(){OpenchannelAccountEvents[_0x7b37('0x5')](_0x2018bd,_0x13f4c4);};}exports[_0x7b37('0x6')]=function(_0x58edf9){for(var _0x516b62=0x0,_0x409d34=events['length'];_0x516b62<_0x409d34;_0x516b62++){var _0x5afdb8=events[_0x516b62];var _0x3de992=createListener(_0x7b37('0x7')+_0x5afdb8,_0x58edf9);OpenchannelAccountEvents['on'](_0x5afdb8,_0x3de992);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index c5d419b..5922504 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 _0xabff=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xabff,0xa8));var _0xfabf=function(_0x3aadde,_0x50f23f){_0x3aadde=_0x3aadde-0x0;var _0x21df4e=_0xabff[_0x3aadde];return _0x21df4e;};'use strict';var multer=require(_0xfabf('0x0'));var util=require(_0xfabf('0x1'));var path=require(_0xfabf('0x2'));var timeout=require(_0xfabf('0x3'));var express=require(_0xfabf('0x4'));var router=express[_0xfabf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfabf('0x6'));var interaction=require(_0xfabf('0x7'));var config=require(_0xfabf('0x8'));var controller=require(_0xfabf('0x9'));router[_0xfabf('0xa')]('/',auth['isAuthenticated'](),controller[_0xfabf('0xb')]);router[_0xfabf('0xa')](_0xfabf('0xc'),auth[_0xfabf('0xd')](),controller[_0xfabf('0xe')]);router['post']('/',auth[_0xfabf('0xd')](),controller[_0xfabf('0xf')]);router[_0xfabf('0x10')](_0xfabf('0xc'),auth['isAuthenticated'](),controller[_0xfabf('0x11')]);router[_0xfabf('0x12')]('/:id',auth[_0xfabf('0xd')](),controller[_0xfabf('0x13')]);module[_0xfabf('0x14')]=router; \ No newline at end of file +var _0xfbcf=['../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','create','put','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32dd7d,_0x365016){var _0x38e84c=function(_0x67b5ec){while(--_0x67b5ec){_0x32dd7d['push'](_0x32dd7d['shift']());}};_0x38e84c(++_0x365016);}(_0xfbcf,0x12b));var _0xffbc=function(_0x4a6fb8,_0x1c0e0f){_0x4a6fb8=_0x4a6fb8-0x0;var _0xe92da=_0xfbcf[_0x4a6fb8];return _0xe92da;};'use strict';var multer=require('multer');var util=require(_0xffbc('0x0'));var path=require('path');var timeout=require(_0xffbc('0x1'));var express=require(_0xffbc('0x2'));var router=express[_0xffbc('0x3')]();var fs_extra=require(_0xffbc('0x4'));var auth=require(_0xffbc('0x5'));var interaction=require(_0xffbc('0x6'));var config=require(_0xffbc('0x7'));var controller=require(_0xffbc('0x8'));router['get']('/',auth[_0xffbc('0x9')](),controller[_0xffbc('0xa')]);router[_0xffbc('0xb')]('/:id',auth[_0xffbc('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xffbc('0xc')]);router[_0xffbc('0xd')](_0xffbc('0xe'),auth[_0xffbc('0x9')](),controller[_0xffbc('0xf')]);router['delete'](_0xffbc('0xe'),auth[_0xffbc('0x9')](),controller[_0xffbc('0x10')]);module[_0xffbc('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3fab86f..568803e 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 _0x337c=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x337c,0x151));var _0xc337=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x337c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc337('0x0'));module[_0xc337('0x1')]={'priority':{'type':Sequelize[_0xc337('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc337('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc337('0x4')]},'interval':{'type':Sequelize[_0xc337('0x4')],'defaultValue':_0xc337('0x5')}}; \ No newline at end of file +var _0x70b1=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1bb775,_0x28aae2){var _0x3d3064=function(_0x20a515){while(--_0x20a515){_0x1bb775['push'](_0x1bb775['shift']());}};_0x3d3064(++_0x28aae2);}(_0x70b1,0x1e8));var _0x170b=function(_0x2fca79,_0x3c2358){_0x2fca79=_0x2fca79-0x0;var _0x42e044=_0x70b1[_0x2fca79];return _0x42e044;};'use strict';var Sequelize=require(_0x170b('0x0'));module[_0x170b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x170b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x170b('0x3')]()},'description':{'type':Sequelize[_0x170b('0x2')]},'interval':{'type':Sequelize[_0x170b('0x2')],'defaultValue':_0x170b('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 17e438b..61baccf 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 _0xae1d=['reject','update','then','end','sendStatus','error','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','pick','filters','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','length','find','catch','create','body','destroy','eml-format','request-promise','moment','bluebird','mustache','to-csv','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','status','json','offset','undefined','count','limit','set','apply'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0xae1d,0x18b));var _0xdae1=function(_0x59a3e9,_0x27fb38){_0x59a3e9=_0x59a3e9-0x0;var _0x5179ac=_0xae1d[_0x59a3e9];return _0x5179ac;};'use strict';var emlformat=require(_0xdae1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdae1('0x1'));var moment=require(_0xdae1('0x2'));var BPromise=require(_0xdae1('0x3'));var Mustache=require(_0xdae1('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdae1('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdae1('0x6'));var _=require(_0xdae1('0x7'));var squel=require(_0xdae1('0x8'));var crypto=require('crypto');var jsforce=require(_0xdae1('0x9'));var deskjs=require(_0xdae1('0xa'));var toCsv=require(_0xdae1('0x5'));var querystring=require(_0xdae1('0xb'));var Papa=require(_0xdae1('0xc'));var Redis=require(_0xdae1('0xd'));var authService=require(_0xdae1('0xe'));var qs=require(_0xdae1('0xf'));var as=require(_0xdae1('0x10'));var hardwareService=require(_0xdae1('0x11'));var logger=require(_0xdae1('0x12'))(_0xdae1('0x13'));var utils=require(_0xdae1('0x14'));var config=require(_0xdae1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdae1('0x16'))['db'];function respondWithStatusCode(_0x431738,_0x55255d){_0x55255d=_0x55255d||0xcc;return function(_0x11769e){if(_0x11769e){return _0x431738['sendStatus'](_0x55255d);}return _0x431738[_0xdae1('0x17')](_0x55255d)['end']();};}function respondWithResult(_0x1b167a,_0x563771){_0x563771=_0x563771||0xc8;return function(_0x4bc06c){if(_0x4bc06c){return _0x1b167a[_0xdae1('0x17')](_0x563771)[_0xdae1('0x18')](_0x4bc06c);}};}function respondWithFilteredResult(_0x38f9f9,_0x3c4e64){return function(_0x4e067b){if(_0x4e067b){var _0x3f62ff=typeof _0x3c4e64[_0xdae1('0x19')]===_0xdae1('0x1a')&&typeof _0x3c4e64['limit']==='undefined';var _0x10e306=_0x4e067b[_0xdae1('0x1b')];var _0x150584=_0x3f62ff?0x0:_0x3c4e64[_0xdae1('0x19')];var _0x401017=_0x3f62ff?_0x4e067b[_0xdae1('0x1b')]:_0x3c4e64[_0xdae1('0x19')]+_0x3c4e64[_0xdae1('0x1c')];var _0x19b023;if(_0x401017>=_0x10e306){_0x401017=_0x10e306;_0x19b023=0xc8;}else{_0x19b023=0xce;}_0x38f9f9['status'](_0x19b023);return _0x38f9f9[_0xdae1('0x1d')]('Content-Range',_0x150584+'-'+_0x401017+'/'+_0x10e306)[_0xdae1('0x18')](_0x4e067b);}return null;};}function patchUpdates(_0x45d78d){return function(_0x2ef2b8){try{jsonpatch[_0xdae1('0x1e')](_0x2ef2b8,_0x45d78d,!![]);}catch(_0x5e769d){return BPromise[_0xdae1('0x1f')](_0x5e769d);}return _0x2ef2b8['save']();};}function saveUpdates(_0x4d7912,_0x528e1b){return function(_0x46c3cc){if(_0x46c3cc){return _0x46c3cc[_0xdae1('0x20')](_0x4d7912)[_0xdae1('0x21')](function(_0x1be400){return _0x1be400;});}return null;};}function removeEntity(_0x312870,_0x1c90c7){return function(_0x1d8947){if(_0x1d8947){return _0x1d8947['destroy']()[_0xdae1('0x21')](function(){_0x312870[_0xdae1('0x17')](0xcc)[_0xdae1('0x22')]();});}};}function handleEntityNotFound(_0x4caf40,_0x2690dc){return function(_0x1047d6){if(!_0x1047d6){_0x4caf40[_0xdae1('0x23')](0x194);}return _0x1047d6;};}function handleError(_0x4d164f,_0x19d589){_0x19d589=_0x19d589||0x1f4;return function(_0x482cb1){logger[_0xdae1('0x24')](_0x482cb1['stack']);if(_0x482cb1[_0xdae1('0x25')]){delete _0x482cb1[_0xdae1('0x25')];}_0x4d164f[_0xdae1('0x17')](_0x19d589)[_0xdae1('0x26')](_0x482cb1);};}exports[_0xdae1('0x27')]=function(_0x5657ef,_0x2818f6){var _0x1d74ed={},_0x3a120a={},_0x5d50c9={'count':0x0,'rows':[]};var _0x3fbd27=_[_0xdae1('0x28')](db[_0xdae1('0x29')][_0xdae1('0x2a')],function(_0x2cbf25){return{'name':_0x2cbf25['fieldName'],'type':_0x2cbf25[_0xdae1('0x2b')][_0xdae1('0x2c')]};});_0x3a120a[_0xdae1('0x2d')]=_[_0xdae1('0x28')](_0x3fbd27,_0xdae1('0x25'));_0x3a120a[_0xdae1('0x2e')]=_[_0xdae1('0x2f')](_0x5657ef[_0xdae1('0x2e')]);_0x3a120a['filters']=_[_0xdae1('0x30')](_0x3a120a['model'],_0x3a120a[_0xdae1('0x2e')]);_0x1d74ed[_0xdae1('0x31')]=_[_0xdae1('0x30')](_0x3a120a[_0xdae1('0x2d')],qs['fields'](_0x5657ef[_0xdae1('0x2e')][_0xdae1('0x32')]));_0x1d74ed[_0xdae1('0x31')]=_0x1d74ed[_0xdae1('0x31')]['length']?_0x1d74ed[_0xdae1('0x31')]:_0x3a120a[_0xdae1('0x2d')];if(!_0x5657ef[_0xdae1('0x2e')]['hasOwnProperty'](_0xdae1('0x33'))){_0x1d74ed[_0xdae1('0x1c')]=qs[_0xdae1('0x1c')](_0x5657ef[_0xdae1('0x2e')]['limit']);_0x1d74ed['offset']=qs['offset'](_0x5657ef[_0xdae1('0x2e')][_0xdae1('0x19')]);}_0x1d74ed['order']=qs[_0xdae1('0x34')](_0x5657ef[_0xdae1('0x2e')]['sort']);_0x1d74ed['where']=qs['filters'](_[_0xdae1('0x35')](_0x5657ef['query'],_0x3a120a[_0xdae1('0x36')]),_0x3fbd27);if(_0x5657ef[_0xdae1('0x2e')]['filter']){_0x1d74ed[_0xdae1('0x37')]=_[_0xdae1('0x38')](_0x1d74ed['where'],{'$or':_['map'](_0x3fbd27,function(_0x545248){if(_0x545248[_0xdae1('0x2b')]!==_0xdae1('0x39')){var _0x136ccc={};_0x136ccc[_0x545248[_0xdae1('0x25')]]={'$like':'%'+_0x5657ef[_0xdae1('0x2e')][_0xdae1('0x3a')]+'%'};return _0x136ccc;}})});}_0x1d74ed=_[_0xdae1('0x38')]({},_0x1d74ed,_0x5657ef[_0xdae1('0x3b')]);var _0x4ae222={'where':_0x1d74ed['where']};return db[_0xdae1('0x29')]['count'](_0x4ae222)['then'](function(_0xfd03c8){_0x5d50c9[_0xdae1('0x1b')]=_0xfd03c8;if(_0x5657ef[_0xdae1('0x2e')]['includeAll']){_0x1d74ed[_0xdae1('0x3c')]=[{'all':!![]}];}return db[_0xdae1('0x29')][_0xdae1('0x3d')](_0x1d74ed);})[_0xdae1('0x21')](function(_0x470017){_0x5d50c9[_0xdae1('0x3e')]=_0x470017;return _0x5d50c9;})[_0xdae1('0x21')](respondWithFilteredResult(_0x2818f6,_0x1d74ed))['catch'](handleError(_0x2818f6,null));};exports[_0xdae1('0x3f')]=function(_0x4ae115,_0x1677e5){var _0x5260c4={'raw':!![],'where':{'id':_0x4ae115[_0xdae1('0x40')]['id']}},_0xc377f2={};_0xc377f2[_0xdae1('0x2d')]=_[_0xdae1('0x2f')](db[_0xdae1('0x29')][_0xdae1('0x2a')]);_0xc377f2[_0xdae1('0x2e')]=_[_0xdae1('0x2f')](_0x4ae115['query']);_0xc377f2['filters']=_['intersection'](_0xc377f2[_0xdae1('0x2d')],_0xc377f2[_0xdae1('0x2e')]);_0x5260c4['attributes']=_[_0xdae1('0x30')](_0xc377f2[_0xdae1('0x2d')],qs['fields'](_0x4ae115[_0xdae1('0x2e')][_0xdae1('0x32')]));_0x5260c4[_0xdae1('0x31')]=_0x5260c4[_0xdae1('0x31')][_0xdae1('0x41')]?_0x5260c4[_0xdae1('0x31')]:_0xc377f2[_0xdae1('0x2d')];if(_0x4ae115[_0xdae1('0x2e')]['includeAll']){_0x5260c4[_0xdae1('0x3c')]=[{'all':!![]}];}_0x5260c4=_[_0xdae1('0x38')]({},_0x5260c4,_0x4ae115[_0xdae1('0x3b')]);return db[_0xdae1('0x29')][_0xdae1('0x42')](_0x5260c4)['then'](handleEntityNotFound(_0x1677e5,null))[_0xdae1('0x21')](respondWithResult(_0x1677e5,null))[_0xdae1('0x43')](handleError(_0x1677e5,null));};exports[_0xdae1('0x44')]=function(_0x46ff10,_0x1e1f47){return db[_0xdae1('0x29')]['create'](_0x46ff10[_0xdae1('0x45')],{})[_0xdae1('0x21')](respondWithResult(_0x1e1f47,0xc9))['catch'](handleError(_0x1e1f47,null));};exports[_0xdae1('0x20')]=function(_0x564a68,_0x374fcc){if(_0x564a68[_0xdae1('0x45')]['id']){delete _0x564a68[_0xdae1('0x45')]['id'];}return db[_0xdae1('0x29')]['find']({'where':{'id':_0x564a68[_0xdae1('0x40')]['id']}})[_0xdae1('0x21')](handleEntityNotFound(_0x374fcc,null))['then'](saveUpdates(_0x564a68[_0xdae1('0x45')],null))[_0xdae1('0x21')](respondWithResult(_0x374fcc,null))[_0xdae1('0x43')](handleError(_0x374fcc,null));};exports[_0xdae1('0x46')]=function(_0x1dbe03,_0x32c486){return db[_0xdae1('0x29')][_0xdae1('0x42')]({'where':{'id':_0x1dbe03[_0xdae1('0x40')]['id']}})[_0xdae1('0x21')](handleEntityNotFound(_0x32c486,null))['then'](removeEntity(_0x32c486,null))['catch'](handleError(_0x32c486,null));}; \ No newline at end of file +var _0x4d7c=['count','set','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x2bfd54,_0x50ab56){var _0x711287=function(_0xed54a6){while(--_0xed54a6){_0x2bfd54['push'](_0x2bfd54['shift']());}};_0x711287(++_0x50ab56);}(_0x4d7c,0x76));var _0xc4d7=function(_0x548bbf,_0x5cf15b){_0x548bbf=_0x548bbf-0x0;var _0x26b37d=_0x4d7c[_0x548bbf];return _0x26b37d;};'use strict';var emlformat=require(_0xc4d7('0x0'));var rimraf=require(_0xc4d7('0x1'));var zipdir=require(_0xc4d7('0x2'));var jsonpatch=require(_0xc4d7('0x3'));var rp=require(_0xc4d7('0x4'));var moment=require(_0xc4d7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc4d7('0x6'));var util=require(_0xc4d7('0x7'));var path=require(_0xc4d7('0x8'));var sox=require(_0xc4d7('0x9'));var csv=require(_0xc4d7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4d7('0xb'));var jsforce=require(_0xc4d7('0xc'));var deskjs=require(_0xc4d7('0xd'));var toCsv=require(_0xc4d7('0xa'));var querystring=require(_0xc4d7('0xe'));var Papa=require(_0xc4d7('0xf'));var Redis=require(_0xc4d7('0x10'));var authService=require(_0xc4d7('0x11'));var qs=require(_0xc4d7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4d7('0x13'));var logger=require(_0xc4d7('0x14'))(_0xc4d7('0x15'));var utils=require(_0xc4d7('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc4d7('0x17'))['db'];function respondWithStatusCode(_0x201504,_0x2ecb98){_0x2ecb98=_0x2ecb98||0xcc;return function(_0x21ec16){if(_0x21ec16){return _0x201504[_0xc4d7('0x18')](_0x2ecb98);}return _0x201504[_0xc4d7('0x19')](_0x2ecb98)['end']();};}function respondWithResult(_0x2433c1,_0x255c49){_0x255c49=_0x255c49||0xc8;return function(_0x345238){if(_0x345238){return _0x2433c1[_0xc4d7('0x19')](_0x255c49)[_0xc4d7('0x1a')](_0x345238);}};}function respondWithFilteredResult(_0x117379,_0x21265b){return function(_0xa4f9a0){if(_0xa4f9a0){var _0x21206c=typeof _0x21265b[_0xc4d7('0x1b')]===_0xc4d7('0x1c')&&typeof _0x21265b[_0xc4d7('0x1d')]===_0xc4d7('0x1c');var _0x5b28e5=_0xa4f9a0[_0xc4d7('0x1e')];var _0xd5b478=_0x21206c?0x0:_0x21265b[_0xc4d7('0x1b')];var _0x1dcd4e=_0x21206c?_0xa4f9a0['count']:_0x21265b[_0xc4d7('0x1b')]+_0x21265b[_0xc4d7('0x1d')];var _0x38c4da;if(_0x1dcd4e>=_0x5b28e5){_0x1dcd4e=_0x5b28e5;_0x38c4da=0xc8;}else{_0x38c4da=0xce;}_0x117379[_0xc4d7('0x19')](_0x38c4da);return _0x117379[_0xc4d7('0x1f')]('Content-Range',_0xd5b478+'-'+_0x1dcd4e+'/'+_0x5b28e5)[_0xc4d7('0x1a')](_0xa4f9a0);}return null;};}function patchUpdates(_0x47dacd){return function(_0x59425c){try{jsonpatch[_0xc4d7('0x20')](_0x59425c,_0x47dacd,!![]);}catch(_0x40fcf2){return BPromise[_0xc4d7('0x21')](_0x40fcf2);}return _0x59425c['save']();};}function saveUpdates(_0x199d46,_0x23acbc){return function(_0x13cd56){if(_0x13cd56){return _0x13cd56[_0xc4d7('0x22')](_0x199d46)['then'](function(_0x2194a2){return _0x2194a2;});}return null;};}function removeEntity(_0x439402,_0x122d11){return function(_0x5a040b){if(_0x5a040b){return _0x5a040b[_0xc4d7('0x23')]()[_0xc4d7('0x24')](function(){_0x439402['status'](0xcc)[_0xc4d7('0x25')]();});}};}function handleEntityNotFound(_0xf89330,_0x4a28fd){return function(_0xd80095){if(!_0xd80095){_0xf89330[_0xc4d7('0x18')](0x194);}return _0xd80095;};}function handleError(_0x5a7d8e,_0x5411c1){_0x5411c1=_0x5411c1||0x1f4;return function(_0x1a2d14){logger[_0xc4d7('0x26')](_0x1a2d14[_0xc4d7('0x27')]);if(_0x1a2d14[_0xc4d7('0x28')]){delete _0x1a2d14[_0xc4d7('0x28')];}_0x5a7d8e['status'](_0x5411c1)[_0xc4d7('0x29')](_0x1a2d14);};}exports[_0xc4d7('0x2a')]=function(_0x14bb51,_0x5ed95c){var _0x2694c0={},_0x3f1110={},_0x517a87={'count':0x0,'rows':[]};var _0x40f6d3=_[_0xc4d7('0x2b')](db['OpenchannelApplication']['rawAttributes'],function(_0x26a9a7){return{'name':_0x26a9a7[_0xc4d7('0x2c')],'type':_0x26a9a7[_0xc4d7('0x2d')][_0xc4d7('0x2e')]};});_0x3f1110[_0xc4d7('0x2f')]=_[_0xc4d7('0x2b')](_0x40f6d3,_0xc4d7('0x28'));_0x3f1110[_0xc4d7('0x30')]=_['keys'](_0x14bb51[_0xc4d7('0x30')]);_0x3f1110[_0xc4d7('0x31')]=_['intersection'](_0x3f1110['model'],_0x3f1110[_0xc4d7('0x30')]);_0x2694c0[_0xc4d7('0x32')]=_[_0xc4d7('0x33')](_0x3f1110['model'],qs['fields'](_0x14bb51[_0xc4d7('0x30')][_0xc4d7('0x34')]));_0x2694c0[_0xc4d7('0x32')]=_0x2694c0[_0xc4d7('0x32')][_0xc4d7('0x35')]?_0x2694c0[_0xc4d7('0x32')]:_0x3f1110[_0xc4d7('0x2f')];if(!_0x14bb51[_0xc4d7('0x30')][_0xc4d7('0x36')](_0xc4d7('0x37'))){_0x2694c0[_0xc4d7('0x1d')]=qs[_0xc4d7('0x1d')](_0x14bb51['query'][_0xc4d7('0x1d')]);_0x2694c0['offset']=qs['offset'](_0x14bb51[_0xc4d7('0x30')][_0xc4d7('0x1b')]);}_0x2694c0['order']=qs[_0xc4d7('0x38')](_0x14bb51[_0xc4d7('0x30')][_0xc4d7('0x38')]);_0x2694c0[_0xc4d7('0x39')]=qs['filters'](_[_0xc4d7('0x3a')](_0x14bb51[_0xc4d7('0x30')],_0x3f1110[_0xc4d7('0x31')]),_0x40f6d3);if(_0x14bb51['query']['filter']){_0x2694c0['where']=_[_0xc4d7('0x3b')](_0x2694c0[_0xc4d7('0x39')],{'$or':_[_0xc4d7('0x2b')](_0x40f6d3,function(_0x582e5d){if(_0x582e5d['type']!=='VIRTUAL'){var _0x152856={};_0x152856[_0x582e5d['name']]={'$like':'%'+_0x14bb51['query']['filter']+'%'};return _0x152856;}})});}_0x2694c0=_[_0xc4d7('0x3b')]({},_0x2694c0,_0x14bb51[_0xc4d7('0x3c')]);var _0x2172e7={'where':_0x2694c0[_0xc4d7('0x39')]};return db[_0xc4d7('0x3d')][_0xc4d7('0x1e')](_0x2172e7)['then'](function(_0xca9437){_0x517a87[_0xc4d7('0x1e')]=_0xca9437;if(_0x14bb51[_0xc4d7('0x30')][_0xc4d7('0x3e')]){_0x2694c0[_0xc4d7('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xc4d7('0x40')](_0x2694c0);})[_0xc4d7('0x24')](function(_0x2086a3){_0x517a87[_0xc4d7('0x41')]=_0x2086a3;return _0x517a87;})['then'](respondWithFilteredResult(_0x5ed95c,_0x2694c0))[_0xc4d7('0x42')](handleError(_0x5ed95c,null));};exports[_0xc4d7('0x43')]=function(_0x5d8712,_0x484085){var _0x10a1db={'raw':!![],'where':{'id':_0x5d8712['params']['id']}},_0x966899={};_0x966899['model']=_[_0xc4d7('0x44')](db[_0xc4d7('0x3d')][_0xc4d7('0x45')]);_0x966899['query']=_[_0xc4d7('0x44')](_0x5d8712[_0xc4d7('0x30')]);_0x966899[_0xc4d7('0x31')]=_[_0xc4d7('0x33')](_0x966899[_0xc4d7('0x2f')],_0x966899[_0xc4d7('0x30')]);_0x10a1db[_0xc4d7('0x32')]=_[_0xc4d7('0x33')](_0x966899[_0xc4d7('0x2f')],qs[_0xc4d7('0x34')](_0x5d8712[_0xc4d7('0x30')]['fields']));_0x10a1db['attributes']=_0x10a1db[_0xc4d7('0x32')][_0xc4d7('0x35')]?_0x10a1db['attributes']:_0x966899[_0xc4d7('0x2f')];if(_0x5d8712['query'][_0xc4d7('0x3e')]){_0x10a1db[_0xc4d7('0x3f')]=[{'all':!![]}];}_0x10a1db=_['merge']({},_0x10a1db,_0x5d8712[_0xc4d7('0x3c')]);return db[_0xc4d7('0x3d')][_0xc4d7('0x46')](_0x10a1db)[_0xc4d7('0x24')](handleEntityNotFound(_0x484085,null))[_0xc4d7('0x24')](respondWithResult(_0x484085,null))[_0xc4d7('0x42')](handleError(_0x484085,null));};exports['create']=function(_0x340135,_0x53f161){return db[_0xc4d7('0x3d')][_0xc4d7('0x47')](_0x340135[_0xc4d7('0x48')],{})[_0xc4d7('0x24')](respondWithResult(_0x53f161,0xc9))[_0xc4d7('0x42')](handleError(_0x53f161,null));};exports[_0xc4d7('0x22')]=function(_0x203f80,_0x539696){if(_0x203f80[_0xc4d7('0x48')]['id']){delete _0x203f80[_0xc4d7('0x48')]['id'];}return db[_0xc4d7('0x3d')][_0xc4d7('0x46')]({'where':{'id':_0x203f80[_0xc4d7('0x49')]['id']}})['then'](handleEntityNotFound(_0x539696,null))[_0xc4d7('0x24')](saveUpdates(_0x203f80[_0xc4d7('0x48')],null))[_0xc4d7('0x24')](respondWithResult(_0x539696,null))[_0xc4d7('0x42')](handleError(_0x539696,null));};exports[_0xc4d7('0x23')]=function(_0x51fd4c,_0x2eec37){return db[_0xc4d7('0x3d')][_0xc4d7('0x46')]({'where':{'id':_0x51fd4c[_0xc4d7('0x49')]['id']}})[_0xc4d7('0x24')](handleEntityNotFound(_0x2eec37,null))[_0xc4d7('0x24')](removeEntity(_0x2eec37,null))[_0xc4d7('0x42')](handleError(_0x2eec37,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index dff2f5e..ca2667b 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 _0x7593=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x12151c,_0x7e205d){var _0x33a0eb=function(_0x5eaf33){while(--_0x5eaf33){_0x12151c['push'](_0x12151c['shift']());}};_0x33a0eb(++_0x7e205d);}(_0x7593,0xb7));var _0x3759=function(_0x29c8c4,_0x2cdf25){_0x29c8c4=_0x29c8c4-0x0;var _0xf11b18=_0x7593[_0x29c8c4];return _0xf11b18;};'use strict';var _=require(_0x3759('0x0'));var util=require('util');var logger=require(_0x3759('0x1'))(_0x3759('0x2'));var moment=require('moment');var BPromise=require(_0x3759('0x3'));var rp=require(_0x3759('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3759('0x5'));var config=require(_0x3759('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0x3759('0x7')]=function(_0x59d99b,_0x5a3317){return _0x59d99b[_0x3759('0x8')](_0x3759('0x9'),attributes,{'tableName':_0x3759('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3759('0xb'),'collate':_0x3759('0xc')});}; \ No newline at end of file +var _0xd2c6=['path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2478da,_0x224f3f){var _0x39f027=function(_0x535a3f){while(--_0x535a3f){_0x2478da['push'](_0x2478da['shift']());}};_0x39f027(++_0x224f3f);}(_0xd2c6,0xf7));var _0x6d2c=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xd2c6[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require(_0x6d2c('0x0'));var logger=require(_0x6d2c('0x1'))(_0x6d2c('0x2'));var moment=require('moment');var BPromise=require(_0x6d2c('0x3'));var rp=require(_0x6d2c('0x4'));var fs=require('fs');var path=require(_0x6d2c('0x5'));var rimraf=require(_0x6d2c('0x6'));var config=require(_0x6d2c('0x7'));var attributes=require(_0x6d2c('0x8'));module[_0x6d2c('0x9')]=function(_0x27b8e9,_0x105e31){return _0x27b8e9['define'](_0x6d2c('0xa'),attributes,{'tableName':_0x6d2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d2c('0xc'),'collate':_0x6d2c('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 3d7eb9c..7f0b226 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 _0xc335=['message','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','error','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc335,0xd9));var _0x5c33=function(_0x2abbb1,_0x504498){_0x2abbb1=_0x2abbb1-0x0;var _0x50ee1c=_0xc335[_0x2abbb1];return _0x50ee1c;};'use strict';var _=require(_0x5c33('0x0'));var util=require(_0x5c33('0x1'));var moment=require('moment');var BPromise=require(_0x5c33('0x2'));var rs=require(_0x5c33('0x3'));var fs=require('fs');var Redis=require(_0x5c33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c33('0x5'));var logger=require(_0x5c33('0x6'))(_0x5c33('0x7'));var config=require(_0x5c33('0x8'));var jayson=require(_0x5c33('0x9'));var client=jayson[_0x5c33('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x249e1a,_0x3c21a6,_0x9f43c3){return new BPromise(function(_0x89a2aa,_0x2befe1){return client[_0x5c33('0xb')](_0x249e1a,_0x9f43c3)['then'](function(_0x30396f){logger[_0x5c33('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x3c21a6,_0x5c33('0xd'));logger[_0x5c33('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x3c21a6,_0x5c33('0xd'),JSON['stringify'](_0x30396f));if(_0x30396f[_0x5c33('0xf')]){if(_0x30396f['error']['code']===0x1f4){logger[_0x5c33('0xf')](_0x5c33('0x10'),_0x3c21a6,_0x30396f[_0x5c33('0xf')][_0x5c33('0x11')]);return _0x2befe1(_0x30396f[_0x5c33('0xf')][_0x5c33('0x11')]);}logger[_0x5c33('0xf')](_0x5c33('0x10'),_0x3c21a6,_0x30396f['error']['message']);return _0x89a2aa(_0x30396f[_0x5c33('0xf')]['message']);}else{logger['info'](_0x5c33('0x10'),_0x3c21a6,_0x5c33('0xd'));_0x89a2aa(_0x30396f['result'][_0x5c33('0x11')]);}})[_0x5c33('0x12')](function(_0x41717d){logger['error'](_0x5c33('0x10'),_0x3c21a6,_0x41717d);_0x2befe1(_0x41717d);});});}exports[_0x5c33('0x13')]=function(_0xa00387){var _0xdfdc15=this;return new Promise(function(_0x178b19,_0x52a8a2){return db[_0x5c33('0x14')]['update'](_0xa00387[_0x5c33('0x15')],{'raw':_0xa00387[_0x5c33('0x16')]?_0xa00387['options'][_0x5c33('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa00387[_0x5c33('0x16')]?_0xa00387[_0x5c33('0x16')][_0x5c33('0x18')]||null:null,'attributes':_0xa00387[_0x5c33('0x16')]?_0xa00387[_0x5c33('0x16')]['attributes']||null:null,'limit':_0xa00387[_0x5c33('0x16')]?_0xa00387[_0x5c33('0x16')]['limit']||null:null})[_0x5c33('0x19')](function(_0x288e36){logger[_0x5c33('0xc')](_0x5c33('0x13'),_0xa00387);logger[_0x5c33('0xe')](_0x5c33('0x13'),_0xa00387,JSON['stringify'](_0x288e36));_0x178b19(_0x288e36);})[_0x5c33('0x12')](function(_0x2459ee){logger[_0x5c33('0xf')](_0x5c33('0x13'),_0x2459ee['message'],_0xa00387);_0x52a8a2(_0xdfdc15[_0x5c33('0xf')](0x1f4,_0x2459ee['message']));});});}; \ No newline at end of file +var _0x58d0=['attributes','limit','info','debug','lodash','util','moment','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateOpenchannelApplication','update','options','where'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x58d0,0x1a4));var _0x058d=function(_0x3231ee,_0x44e1ef){_0x3231ee=_0x3231ee-0x0;var _0x2092f1=_0x58d0[_0x3231ee];return _0x2092f1;};'use strict';var _=require(_0x058d('0x0'));var util=require(_0x058d('0x1'));var moment=require(_0x058d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x058d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x058d('0x4'))(_0x058d('0x5'));var config=require('../../config/environment');var jayson=require(_0x058d('0x6'));var client=jayson[_0x058d('0x7')][_0x058d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43a984,_0x18bc41,_0xcf0d6d){return new BPromise(function(_0x3dd787,_0x1f84fa){return client['request'](_0x43a984,_0xcf0d6d)[_0x058d('0x9')](function(_0x51656c){logger['info'](_0x058d('0xa'),_0x18bc41,'request\x20sent');logger['debug'](_0x058d('0xb'),_0x18bc41,_0x058d('0xc'),JSON[_0x058d('0xd')](_0x51656c));if(_0x51656c['error']){if(_0x51656c[_0x058d('0xe')][_0x058d('0xf')]===0x1f4){logger[_0x058d('0xe')](_0x058d('0xa'),_0x18bc41,_0x51656c[_0x058d('0xe')][_0x058d('0x10')]);return _0x1f84fa(_0x51656c[_0x058d('0xe')][_0x058d('0x10')]);}logger[_0x058d('0xe')](_0x058d('0xa'),_0x18bc41,_0x51656c[_0x058d('0xe')][_0x058d('0x10')]);return _0x3dd787(_0x51656c[_0x058d('0xe')][_0x058d('0x10')]);}else{logger['info'](_0x058d('0xa'),_0x18bc41,_0x058d('0xc'));_0x3dd787(_0x51656c[_0x058d('0x11')]['message']);}})['catch'](function(_0x3bceb1){logger[_0x058d('0xe')](_0x058d('0xa'),_0x18bc41,_0x3bceb1);_0x1f84fa(_0x3bceb1);});});}exports[_0x058d('0x12')]=function(_0x50046e){var _0x4e6310=this;return new Promise(function(_0x233619,_0x3ef0dd){return db['OpenchannelApplication'][_0x058d('0x13')](_0x50046e['body'],{'raw':_0x50046e[_0x058d('0x14')]?_0x50046e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50046e[_0x058d('0x14')]?_0x50046e[_0x058d('0x14')][_0x058d('0x15')]||null:null,'attributes':_0x50046e[_0x058d('0x14')]?_0x50046e['options'][_0x058d('0x16')]||null:null,'limit':_0x50046e[_0x058d('0x14')]?_0x50046e[_0x058d('0x14')][_0x058d('0x17')]||null:null})[_0x058d('0x9')](function(_0x42f150){logger[_0x058d('0x18')](_0x058d('0x12'),_0x50046e);logger[_0x058d('0x19')](_0x058d('0x12'),_0x50046e,JSON[_0x058d('0xd')](_0x42f150));_0x233619(_0x42f150);})['catch'](function(_0x247860){logger[_0x058d('0xe')](_0x058d('0x12'),_0x247860[_0x058d('0x10')],_0x50046e);_0x3ef0dd(_0x4e6310['error'](0x1f4,_0x247860[_0x058d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index fdab48d..f24cce0 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 _0x6383=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','download','post','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','update','delete','/:id/tags','exports','multer','util'];(function(_0x61c2cc,_0x1fa642){var _0x1e8ddf=function(_0x1c0d4c){while(--_0x1c0d4c){_0x61c2cc['push'](_0x61c2cc['shift']());}};_0x1e8ddf(++_0x1fa642);}(_0x6383,0x15a));var _0x3638=function(_0x59a41a,_0x54d624){_0x59a41a=_0x59a41a-0x0;var _0x1492a4=_0x6383[_0x59a41a];return _0x1492a4;};'use strict';var multer=require(_0x3638('0x0'));var util=require(_0x3638('0x1'));var path=require(_0x3638('0x2'));var timeout=require(_0x3638('0x3'));var express=require(_0x3638('0x4'));var router=express[_0x3638('0x5')]();var fs_extra=require(_0x3638('0x6'));var auth=require(_0x3638('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0x3638('0x8')]('/',auth[_0x3638('0x9')](),controller['index']);router[_0x3638('0x8')](_0x3638('0xa'),auth[_0x3638('0x9')](),controller[_0x3638('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3638('0xc')]);router['get'](_0x3638('0xd'),auth['isAuthenticated'](),controller[_0x3638('0xe')]);router[_0x3638('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x3638('0xf')]);router[_0x3638('0x10')]('/',auth[_0x3638('0x9')](),controller['create']);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x3638('0x11')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x3638('0x12')](_0x3638('0x13'),_0x3638('0x14')),controller[_0x3638('0x15')]);router[_0x3638('0x16')](_0x3638('0x17'),auth[_0x3638('0x9')](),interaction[_0x3638('0x12')]('openchannel',_0x3638('0x18')),controller[_0x3638('0x19')]);router['delete'](_0x3638('0x17'),auth[_0x3638('0x9')](),interaction['tracked'](_0x3638('0x13'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x3638('0x1a')](_0x3638('0x1b'),auth[_0x3638('0x9')](),controller['removeTags']);module[_0x3638('0x1c')]=router; \ No newline at end of file +var _0x3820=['/describe','describe','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index'];(function(_0x27354a,_0x4421e4){var _0x5796b2=function(_0x4a966e){while(--_0x4a966e){_0x27354a['push'](_0x27354a['shift']());}};_0x5796b2(++_0x4421e4);}(_0x3820,0x1c1));var _0x0382=function(_0x293a6b,_0x3b9ede){_0x293a6b=_0x293a6b-0x0;var _0x2d371c=_0x3820[_0x293a6b];return _0x2d371c;};'use strict';var multer=require(_0x0382('0x0'));var util=require(_0x0382('0x1'));var path=require(_0x0382('0x2'));var timeout=require(_0x0382('0x3'));var express=require(_0x0382('0x4'));var router=express[_0x0382('0x5')]();var fs_extra=require(_0x0382('0x6'));var auth=require(_0x0382('0x7'));var interaction=require(_0x0382('0x8'));var config=require('../../config/environment');var controller=require(_0x0382('0x9'));router[_0x0382('0xa')]('/',auth[_0x0382('0xb')](),controller[_0x0382('0xc')]);router['get'](_0x0382('0xd'),auth['isAuthenticated'](),controller[_0x0382('0xe')]);router['get']('/:id',auth[_0x0382('0xb')](),controller[_0x0382('0xf')]);router[_0x0382('0xa')]('/:id/messages',auth[_0x0382('0xb')](),controller[_0x0382('0x10')]);router[_0x0382('0xa')]('/:id/download',auth[_0x0382('0xb')](),controller[_0x0382('0x11')]);router[_0x0382('0x12')]('/',auth[_0x0382('0xb')](),controller[_0x0382('0x13')]);router[_0x0382('0x12')](_0x0382('0x14'),auth[_0x0382('0xb')](),controller[_0x0382('0x15')]);router['post'](_0x0382('0x16'),auth[_0x0382('0xb')](),interaction[_0x0382('0x17')]('openchannel',_0x0382('0x18')),controller[_0x0382('0x19')]);router[_0x0382('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x0382('0x17')](_0x0382('0x1b'),_0x0382('0x1c')),controller['update']);router[_0x0382('0x1d')](_0x0382('0x1e'),auth['isAuthenticated'](),interaction[_0x0382('0x17')](_0x0382('0x1b'),'openchannelinteraction:destroy'),controller[_0x0382('0x1f')]);router[_0x0382('0x1d')]('/:id/tags',auth[_0x0382('0xb')](),controller['removeTags']);module[_0x0382('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 625ffed..8a57a2b 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 _0x9f94=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x8b6b0c,_0x2e259f){var _0x45b7c3=function(_0x4bc39d){while(--_0x4bc39d){_0x8b6b0c['push'](_0x8b6b0c['shift']());}};_0x45b7c3(++_0x2e259f);}(_0x9f94,0x1e7));var _0x49f9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9f94[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x49f9('0x0'));module[_0x49f9('0x1')]={'closed':{'type':Sequelize[_0x49f9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x49f9('0x3')]},'thirdDisposition':{'type':Sequelize[_0x49f9('0x3')]},'note':{'type':Sequelize[_0x49f9('0x3')]},'read1stAt':{'type':Sequelize[_0x49f9('0x4')]},'threadId':{'type':Sequelize[_0x49f9('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x49f9('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x49f9('0x5')]('in',_0x49f9('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x49f9('0x5')]('in',_0x49f9('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x49f9('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x49f9('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x073e=['sequelize','exports','BOOLEAN','DATE','STRING','out','ENUM'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x073e,0x181));var _0xe073=function(_0x49a520,_0x1487c9){_0x49a520=_0x49a520-0x0;var _0xb16d86=_0x073e[_0x49a520];return _0xb16d86;};'use strict';var Sequelize=require(_0xe073('0x0'));module[_0xe073('0x1')]={'closed':{'type':Sequelize[_0xe073('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe073('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe073('0x4')]},'read1stAt':{'type':Sequelize[_0xe073('0x3')]},'threadId':{'type':Sequelize[_0xe073('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe073('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xe073('0x6')]('in',_0xe073('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe073('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xe073('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 e317e0a..46cc816 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 _0xe08c=['downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','util','path','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','show','from','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','params','describe','addMessage','OpenchannelMessage','ids','findOne','hasOwnProperty','nolimit','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','name','color','emit','removeTags','download','unix','toString','root','server','files','tmp','attachments','transcript-%d-%s.zip','join','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','Account','Owner','fullname','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','Private','basename','pipe','createWriteStream','direction','out','System','value','renderFile','views'];(function(_0x1d9af9,_0x364240){var _0x21fd4f=function(_0x34fa7e){while(--_0x34fa7e){_0x1d9af9['push'](_0x1d9af9['shift']());}};_0x21fd4f(++_0x364240);}(_0xe08c,0x87));var _0xce08=function(_0x5efb91,_0x39b378){_0x5efb91=_0x5efb91-0x0;var _0x57ff36=_0xe08c[_0x5efb91];return _0x57ff36;};'use strict';var rimraf=require(_0xce08('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var util=require(_0xce08('0x1'));var path=require(_0xce08('0x2'));var ejs=require(_0xce08('0x3'));var fs=require('fs');var _=require(_0xce08('0x4'));var Redis=require(_0xce08('0x5'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xce08('0x6'));var logger=require(_0xce08('0x7'))(_0xce08('0x8'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xce08('0x9')]=_[_0xce08('0xa')](config[_0xce08('0x9')],{'host':_0xce08('0xb'),'port':0x18eb});var socket=require(_0xce08('0xc'))(new Redis(config[_0xce08('0x9')]));require('./openchannelInteraction.socket')[_0xce08('0xd')](socket);function respondWithStatusCode(_0x35cf4f,_0xad935a){_0xad935a=_0xad935a||0xcc;return function(_0xd7ed99){if(_0xd7ed99){return _0x35cf4f['sendStatus'](_0xad935a);}return _0x35cf4f[_0xce08('0xe')](_0xad935a)[_0xce08('0xf')]();};}function respondWithResult(_0x2f3ec4,_0x40d4da){_0x40d4da=_0x40d4da||0xc8;return function(_0x5c6b47){if(_0x5c6b47){return _0x2f3ec4[_0xce08('0xe')](_0x40d4da)[_0xce08('0x10')](_0x5c6b47);}};}function respondWithFilteredResult(_0x368ddc,_0x736558){return function(_0x1597f4){if(_0x1597f4){var _0x50bf18=typeof _0x736558['offset']===_0xce08('0x11')&&typeof _0x736558[_0xce08('0x12')]===_0xce08('0x11');var _0x1bb404=_0x1597f4['count'];var _0x448862=_0x50bf18?0x0:_0x736558[_0xce08('0x13')];var _0x3016d8=_0x50bf18?_0x1597f4[_0xce08('0x14')]:_0x736558[_0xce08('0x13')]+_0x736558[_0xce08('0x12')];var _0x242cba;if(_0x3016d8>=_0x1bb404){_0x3016d8=_0x1bb404;_0x242cba=0xc8;}else{_0x242cba=0xce;}_0x368ddc[_0xce08('0xe')](_0x242cba);return _0x368ddc[_0xce08('0x15')](_0xce08('0x16'),_0x448862+'-'+_0x3016d8+'/'+_0x1bb404)['json'](_0x1597f4);}return null;};}function saveUpdates(_0x466163){return function(_0x20ee56){if(_0x20ee56){return _0x20ee56[_0xce08('0x17')](_0x466163)[_0xce08('0x18')](function(_0x38d2cd){return _0x38d2cd;});}return null;};}function removeEntity(_0x4ae1fc){return function(_0x17d7d9){if(_0x17d7d9){return _0x17d7d9[_0xce08('0x19')]()[_0xce08('0x18')](function(){_0x4ae1fc[_0xce08('0xe')](0xcc)[_0xce08('0xf')]();});}};}function handleEntityNotFound(_0x3d0d6f){return function(_0x651c9d){if(!_0x651c9d){_0x3d0d6f[_0xce08('0x1a')](0x194);}return _0x651c9d;};}function handleError(_0x33d3b8,_0x3dd147){_0x3dd147=_0x3dd147||0x1f4;return function(_0x228053){logger[_0xce08('0x1b')](_0x228053[_0xce08('0x1c')]);if(_0x228053['name']){delete _0x228053['name'];}_0x33d3b8[_0xce08('0xe')](_0x3dd147)[_0xce08('0x1d')](_0x228053);};}exports[_0xce08('0x1e')]=function(_0x27da04,_0x19d317){var _0x6949da={};var _0x3c7763=_[_0xce08('0x1f')](db[_0xce08('0x20')][_0xce08('0x21')],function(_0x548dca){return{'name':_0x548dca[_0xce08('0x22')],'type':_0x548dca[_0xce08('0x23')][_0xce08('0x24')]};});_0x6949da=qs[_0xce08('0x25')](_0x3c7763,_0x27da04);return interaction[_0xce08('0x26')](_0xce08('0x27'),_0x27da04[_0xce08('0x28')],_0x27da04[_0xce08('0x29')],_0x6949da,_0x3c7763)[_0xce08('0x18')](respondWithFilteredResult(_0x19d317,_0x6949da))['catch'](handleError(_0x19d317,null));};exports[_0xce08('0x2a')]=function(_0x395f4c,_0x269ec4){var _0x211727={};if(_0x395f4c[_0xce08('0x28')][_0xce08('0x23')]&&_0x395f4c[_0xce08('0x28')][_0xce08('0x23')]===_0xce08('0x2b')){_0x211727[_0xce08('0x2b')]=_0x395f4c['params']['id'];}else{_0x211727['id']=_0x395f4c['params']['id'];}var _0xf83071={'raw':![],'where':_0x211727},_0x2ee6a2={};_0x2ee6a2[_0xce08('0x2c')]=_[_0xce08('0x2d')](db[_0xce08('0x20')][_0xce08('0x21')]);_0x2ee6a2[_0xce08('0x28')]=_[_0xce08('0x2d')](_0x395f4c['query']);_0x2ee6a2[_0xce08('0x2e')]=_[_0xce08('0x2f')](_0x2ee6a2[_0xce08('0x2c')],_0x2ee6a2[_0xce08('0x28')]);_0xf83071[_0xce08('0x30')]=_['intersection'](_0x2ee6a2[_0xce08('0x2c')],qs[_0xce08('0x31')](_0x395f4c[_0xce08('0x28')][_0xce08('0x31')]));_0xf83071['attributes']=_0xf83071[_0xce08('0x30')][_0xce08('0x32')]?_0xf83071[_0xce08('0x30')]:_0x2ee6a2[_0xce08('0x2c')];if(_0x395f4c['query'][_0xce08('0x33')]){_0xf83071['include']=[{'all':!![]}];}_0xf83071=_[_0xce08('0x34')]({},_0xf83071,_0x395f4c[_0xce08('0x35')]);return db[_0xce08('0x20')][_0xce08('0x36')](_0xf83071)[_0xce08('0x18')](handleEntityNotFound(_0x269ec4,null))[_0xce08('0x18')](respondWithResult(_0x269ec4,null))[_0xce08('0x37')](handleError(_0x269ec4,null));};exports['create']=function(_0x2ec97e,_0x247184){return db[_0xce08('0x20')][_0xce08('0x38')](_0x2ec97e[_0xce08('0x39')],{})[_0xce08('0x18')](respondWithResult(_0x247184,0xc9))[_0xce08('0x37')](handleError(_0x247184,null));};exports[_0xce08('0x17')]=function(_0x4eccf0,_0x1871ed){if(_0x4eccf0[_0xce08('0x39')]['id']){delete _0x4eccf0[_0xce08('0x39')]['id'];}return db[_0xce08('0x20')][_0xce08('0x36')]({'where':{'id':_0x4eccf0[_0xce08('0x3a')]['id']}})[_0xce08('0x18')](handleEntityNotFound(_0x1871ed,null))[_0xce08('0x18')](saveUpdates(_0x4eccf0[_0xce08('0x39')],null))[_0xce08('0x18')](respondWithResult(_0x1871ed,null))[_0xce08('0x37')](handleError(_0x1871ed,null));};exports['destroy']=function(_0x4fe79e,_0x1fbe73){return db['OpenchannelInteraction'][_0xce08('0x36')]({'where':{'id':_0x4fe79e[_0xce08('0x3a')]['id']}})[_0xce08('0x18')](handleEntityNotFound(_0x1fbe73,null))[_0xce08('0x18')](removeEntity(_0x1fbe73,null))['catch'](handleError(_0x1fbe73,null));};exports[_0xce08('0x3b')]=function(_0x22e928,_0x30ef1e){return db[_0xce08('0x20')][_0xce08('0x3b')]()[_0xce08('0x18')](respondWithResult(_0x30ef1e,null))[_0xce08('0x37')](handleError(_0x30ef1e,null));};exports[_0xce08('0x3c')]=function(_0x4219cb,_0x548785){return db[_0xce08('0x3d')][_0xce08('0x36')]({'where':{'id':_0x4219cb[_0xce08('0x3a')]['id']}})[_0xce08('0x18')](handleEntityNotFound(_0x548785,null))[_0xce08('0x18')](function(_0xcad5f2){if(_0xcad5f2){return _0xcad5f2[_0xce08('0x3c')](_0x4219cb[_0xce08('0x39')][_0xce08('0x3e')],_['omit'](_0x4219cb[_0xce08('0x39')],[_0xce08('0x3e'),'id'])||{});}})[_0xce08('0x18')](respondWithResult(_0x548785,null))['catch'](handleError(_0x548785,null));};exports['getMessages']=function(_0x5a58b2,_0x219513){var _0x292ca1={'raw':![],'where':{}};var _0x27a7d2={};var _0xa037f3={'count':0x0,'rows':[]};return db[_0xce08('0x20')][_0xce08('0x3f')]({'where':{'id':_0x5a58b2[_0xce08('0x3a')]['id']}})['then'](handleEntityNotFound(_0x219513,null))['then'](function(_0x2f063e){if(_0x2f063e){_0x27a7d2[_0xce08('0x2c')]=_[_0xce08('0x2d')](db[_0xce08('0x3d')]['rawAttributes']);_0x27a7d2[_0xce08('0x28')]=_[_0xce08('0x2d')](_0x5a58b2[_0xce08('0x28')]);_0x27a7d2[_0xce08('0x2e')]=_['intersection'](_0x27a7d2[_0xce08('0x2c')],_0x27a7d2[_0xce08('0x28')]);_0x292ca1[_0xce08('0x30')]=_[_0xce08('0x2f')](_0x27a7d2[_0xce08('0x2c')],qs[_0xce08('0x31')](_0x5a58b2[_0xce08('0x28')][_0xce08('0x31')]));_0x292ca1[_0xce08('0x30')]=_0x292ca1[_0xce08('0x30')][_0xce08('0x32')]?_0x292ca1['attributes']:_0x27a7d2[_0xce08('0x2c')];if(!_0x5a58b2[_0xce08('0x28')][_0xce08('0x40')](_0xce08('0x41'))){_0x292ca1[_0xce08('0x12')]=qs[_0xce08('0x12')](_0x5a58b2[_0xce08('0x28')][_0xce08('0x12')]);_0x292ca1['offset']=qs[_0xce08('0x13')](_0x5a58b2[_0xce08('0x28')][_0xce08('0x13')]);}_0x292ca1['order']=qs[_0xce08('0x42')](_0x5a58b2[_0xce08('0x28')][_0xce08('0x42')]);_0x292ca1[_0xce08('0x43')]=qs['filters'](_[_0xce08('0x44')](_0x5a58b2['query'],_0x27a7d2['filters']));_0x292ca1[_0xce08('0x43')][_0xce08('0x45')]=_0x2f063e['id'];if(_0x5a58b2[_0xce08('0x28')][_0xce08('0x46')]){_0x292ca1[_0xce08('0x43')]=_[_0xce08('0x34')](_0x292ca1[_0xce08('0x43')],{'$or':_[_0xce08('0x1f')](_0x292ca1[_0xce08('0x30')],function(_0x2b42ec){var _0x3009dc={};_0x3009dc[_0x2b42ec]={'$like':'%'+_0x5a58b2[_0xce08('0x28')][_0xce08('0x46')]+'%'};return _0x3009dc;})});}if(_0x5a58b2[_0xce08('0x28')][_0xce08('0x47')]){var _0x5af7d5=_0x5a58b2[_0xce08('0x28')][_0xce08('0x47')][_0xce08('0x48')](',');var _0x3a4101={};_0x3a4101[_0x5af7d5[0x0]]={'$gte':moment(_0x5af7d5[0x1])[_0xce08('0x49')](_0xce08('0x4a'))};_0x292ca1[_0xce08('0x43')]=_['merge'](_0x292ca1[_0xce08('0x43')],_0x3a4101);}_0x292ca1=_['merge']({},_0x292ca1,_0x5a58b2['options']);return db['OpenchannelMessage'][_0xce08('0x14')]({'where':_0x292ca1[_0xce08('0x43')]})[_0xce08('0x18')](function(_0x597b41){_0xa037f3[_0xce08('0x14')]=_0x597b41;if(_0x5a58b2[_0xce08('0x28')]['includeAll']){_0x292ca1[_0xce08('0x4b')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xce08('0x26')](_0x292ca1);})[_0xce08('0x18')](function(_0x39da1c){_0xa037f3[_0xce08('0x4c')]=_0x39da1c;return _0xa037f3;});}})[_0xce08('0x18')](respondWithFilteredResult(_0x219513,_0x292ca1))[_0xce08('0x37')](handleError(_0x219513,null));};exports[_0xce08('0x4d')]=function(_0x374deb,_0xd025a4){return db['OpenchannelInteraction']['find']({'where':{'id':_0x374deb[_0xce08('0x3a')]['id']}})[_0xce08('0x18')](handleEntityNotFound(_0xd025a4,null))[_0xce08('0x18')](function(_0x5219a9){if(_0x5219a9){return _0x5219a9[_0xce08('0x4e')](_0x374deb['body']['ids'],_['omit'](_0x374deb[_0xce08('0x39')],['ids','id'])||{})[_0xce08('0x4f')](function(){return db[_0xce08('0x50')][_0xce08('0x26')]({'attributes':['id',_0xce08('0x51'),_0xce08('0x52')],'where':{'id':_0x374deb['body']['ids']}});})[_0xce08('0x18')](function(_0x4d872b){socket[_0xce08('0x53')]('openchannelInteractionTags:save',{'id':Number(_0x374deb['params']['id']),'tags':_0x4d872b||[]});return{'id':Number(_0x374deb['params']['id']),'tags':_0x4d872b||[]};});}})[_0xce08('0x18')](respondWithResult(_0xd025a4,null))[_0xce08('0x37')](handleError(_0xd025a4,null));};exports[_0xce08('0x54')]=function(_0x2aa32e,_0x2f947b){return db[_0xce08('0x20')][_0xce08('0x36')]({'where':{'id':_0x2aa32e[_0xce08('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2f947b,null))[_0xce08('0x18')](function(_0x3c3964){if(_0x3c3964){return _0x3c3964[_0xce08('0x54')](_0x2aa32e[_0xce08('0x28')][_0xce08('0x3e')]);}})['then'](respondWithStatusCode(_0x2f947b,null))[_0xce08('0x37')](handleError(_0x2f947b,null));};exports[_0xce08('0x55')]=function(_0x165cac,_0x5449cc){var _0x4001d8=moment()[_0xce08('0x56')]()[_0xce08('0x57')]();var _0xb9a6aa=path['join'](config[_0xce08('0x58')],_0xce08('0x59'),_0xce08('0x5a'),_0xce08('0x5b'));var _0x1bb004=path['join'](config[_0xce08('0x58')],_0xce08('0x59'),_0xce08('0x5a'),_0xce08('0x5c'));var _0x3a73f5=path['join'](_0xb9a6aa,_0x4001d8);var _0x2ccc0f=util['format'](_0xce08('0x5d'),_0x165cac['params']['id'],_0x4001d8);var _0x4eaee7=path[_0xce08('0x5e')](_0xb9a6aa,_0x2ccc0f);var _0x3dba08=[];_0x3dba08[_0xce08('0x5f')]({'model':db[_0xce08('0x60')],'as':_0xce08('0x60'),'attributes':['id','fullname'],'raw':!![]});_0x3dba08[_0xce08('0x5f')]({'model':db[_0xce08('0x61')],'as':_0xce08('0x62'),'attributes':['id',_0xce08('0x63'),_0xce08('0x64')],'raw':!![]});if(_0x165cac[_0xce08('0x28')][_0xce08('0x5c')]){_0x3dba08[_0xce08('0x5f')]({'model':db[_0xce08('0x65')],'as':_0xce08('0x65'),'raw':!![]});}var _0x5903be=[{'model':db[_0xce08('0x3d')],'as':_0xce08('0x66'),'attributes':['id',_0xce08('0x39'),_0xce08('0x67'),'direction',_0xce08('0x68'),_0xce08('0x69')],'include':_0x3dba08}];_0x5903be[_0xce08('0x5f')]({'model':db['OpenchannelAccount'],'as':_0xce08('0x6a'),'attributes':['id',_0xce08('0x51')]});_0x5903be[_0xce08('0x5f')]({'model':db['User'],'as':_0xce08('0x6b'),'attributes':['id',_0xce08('0x6c')]});return db[_0xce08('0x20')]['find']({'where':{'id':_0x165cac['params']['id']},'include':_0x5903be})[_0xce08('0x18')](handleEntityNotFound(_0x5449cc,null))[_0xce08('0x18')](function(_0x202c6c){if(_0x202c6c){var _0xc14a3=_0x202c6c['get']({'plain':!![]});fs[_0xce08('0x6d')](_0x3a73f5);var _0x53a132={'channel':_0xce08('0x6e'),'account':_0xc14a3[_0xce08('0x6a')]['name'],'agent':_0xc14a3[_0xce08('0x6b')]?_0xc14a3[_0xce08('0x6b')]['fullname']:_0xce08('0x6f'),'createdAt':moment(_0xc14a3[_0xce08('0x67')])[_0xce08('0x49')](_0xce08('0x4a'))[_0xce08('0x57')](),'closedAt':_0xc14a3[_0xce08('0x70')]?moment(_0xc14a3[_0xce08('0x71')])[_0xce08('0x49')](_0xce08('0x4a'))['toString']():'','disposition':_0xc14a3[_0xce08('0x72')],'visibility':_0xc14a3['threadId']?'Public':_0xce08('0x73'),'messages':_(_0xc14a3[_0xce08('0x66')])[_0xce08('0x46')]({'secret':![]})['map'](function(_0x2436b4){if(_0x2436b4[_0xce08('0x65')]){var _0x5badee=path[_0xce08('0x5e')](_0x1bb004,_0x2436b4['Attachment'][_0xce08('0x74')]);if(fs['existsSync'](_0x5badee)){fs['createReadStream'](_0x5badee)[_0xce08('0x75')](fs[_0xce08('0x76')](path['join'](_0x3a73f5,_0x2436b4[_0xce08('0x65')][_0xce08('0x74')])));}}return{'date':moment(_0x2436b4['createdAt'])[_0xce08('0x49')](_0xce08('0x4a'))[_0xce08('0x57')](),'sender':_0x2436b4[_0xce08('0x77')]===_0xce08('0x78')?_0x2436b4[_0xce08('0x60')]?_0x2436b4[_0xce08('0x60')][_0xce08('0x6c')]:_0xce08('0x79'):_0x2436b4['Contact']['firstName']+(_0x2436b4[_0xce08('0x62')][_0xce08('0x64')]?'\x20'+_0x2436b4[_0xce08('0x62')][_0xce08('0x64')]:''),'body':_0x2436b4[_0xce08('0x65')]?_0x2436b4[_0xce08('0x65')]['basename']:_0x2436b4['body'],'direction':_0x2436b4['direction']===_0xce08('0x78')?'A':'C','secret':_0x2436b4['secret'],'read':_0x2436b4[_0xce08('0x69')],'attachment':_0x2436b4[_0xce08('0x65')]};})[_0xce08('0x7a')]()};return ejs[_0xce08('0x7b')](path[_0xce08('0x5e')](config[_0xce08('0x58')],_0xce08('0x59'),_0xce08('0x7c'),_0xce08('0x7d')),{'interaction':_0x53a132})[_0xce08('0x18')](function(_0x501868){var _0x23cf25=path[_0xce08('0x5e')](_0x3a73f5,_0xce08('0x7e')+_0xc14a3['id']+'-'+_0x4001d8+_0xce08('0x7f'));var _0x2da4f9={'path':_0x23cf25,'channel':_0xce08('0x6e'),'interactionId':_0xc14a3['id']};return pdf[_0xce08('0x80')](_0x501868,_0x2da4f9);})[_0xce08('0x18')](function(){return new Promise(function(_0x35e5c4,_0xab09a6){zipdir(_0x3a73f5,{'saveTo':_0x4eaee7},function(_0x1f0004,_0x39a726){if(_0x1f0004)return _0xab09a6(_0x1f0004);return _0x35e5c4(_0x39a726);});})[_0xce08('0x18')](function(){return new Promise(function(_0x368bba,_0x2ac07d){rimraf(_0x3a73f5,function(_0x38f91f){if(_0x38f91f)_0x2ac07d(_0x38f91f);return _0x368bba();});});})[_0xce08('0x18')](function(){return _0x5449cc['download'](_0x4eaee7,_0x2ccc0f,function(_0x345606){if(_0x345606){logger[_0xce08('0x1b')]('Unable\x20to\x20delete\x20zip\x20file',_0x345606);}else{fs[_0xce08('0x81')](_0x4eaee7);}});});});}else{return _0x5449cc[_0xce08('0x1a')](0xc8);}})['catch'](handleError(_0x5449cc,null));}; \ No newline at end of file +var _0x1db7=['attachments','format','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','Private','basename','existsSync','createReadStream','pipe','out','value','renderFile','transcript-','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','util','path','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','localhost','register','status','json','offset','undefined','count','limit','set','update','then','destroy','end','sendStatus','stack','name','index','map','OpenchannelInteraction','getOptions','query','catch','show','type','from','params','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','filters','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','setTags','spread','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files'];(function(_0x288843,_0xa8ae27){var _0x116bad=function(_0xf9d819){while(--_0xf9d819){_0x288843['push'](_0x288843['shift']());}};_0x116bad(++_0xa8ae27);}(_0x1db7,0x18b));var _0x71db=function(_0x2ee846,_0x117c2e){_0x2ee846=_0x2ee846-0x0;var _0x1118f3=_0x1db7[_0x2ee846];return _0x1118f3;};'use strict';var rimraf=require(_0x71db('0x0'));var zipdir=require(_0x71db('0x1'));var moment=require(_0x71db('0x2'));var util=require(_0x71db('0x3'));var path=require(_0x71db('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x71db('0x5'));var qs=require(_0x71db('0x6'));var pdf=require(_0x71db('0x7'));var logger=require(_0x71db('0x8'))(_0x71db('0x9'));var config=require(_0x71db('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x71db('0xb')](config[_0x71db('0xc')],{'host':_0x71db('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x71db('0xe')](socket);function respondWithStatusCode(_0x2639b0,_0xbe9aff){_0xbe9aff=_0xbe9aff||0xcc;return function(_0x51f41e){if(_0x51f41e){return _0x2639b0['sendStatus'](_0xbe9aff);}return _0x2639b0[_0x71db('0xf')](_0xbe9aff)['end']();};}function respondWithResult(_0x1d8a49,_0x5adee8){_0x5adee8=_0x5adee8||0xc8;return function(_0x57c0a8){if(_0x57c0a8){return _0x1d8a49[_0x71db('0xf')](_0x5adee8)[_0x71db('0x10')](_0x57c0a8);}};}function respondWithFilteredResult(_0x5a0b22,_0x19409f){return function(_0x3bd4fd){if(_0x3bd4fd){var _0x3d3f07=typeof _0x19409f[_0x71db('0x11')]==='undefined'&&typeof _0x19409f['limit']===_0x71db('0x12');var _0x42fb9b=_0x3bd4fd[_0x71db('0x13')];var _0x512107=_0x3d3f07?0x0:_0x19409f[_0x71db('0x11')];var _0x2169df=_0x3d3f07?_0x3bd4fd['count']:_0x19409f[_0x71db('0x11')]+_0x19409f[_0x71db('0x14')];var _0x532684;if(_0x2169df>=_0x42fb9b){_0x2169df=_0x42fb9b;_0x532684=0xc8;}else{_0x532684=0xce;}_0x5a0b22[_0x71db('0xf')](_0x532684);return _0x5a0b22[_0x71db('0x15')]('Content-Range',_0x512107+'-'+_0x2169df+'/'+_0x42fb9b)[_0x71db('0x10')](_0x3bd4fd);}return null;};}function saveUpdates(_0x2d4107){return function(_0x5448e0){if(_0x5448e0){return _0x5448e0[_0x71db('0x16')](_0x2d4107)[_0x71db('0x17')](function(_0x2c0cf2){return _0x2c0cf2;});}return null;};}function removeEntity(_0x52a104){return function(_0x17d27e){if(_0x17d27e){return _0x17d27e[_0x71db('0x18')]()['then'](function(){_0x52a104[_0x71db('0xf')](0xcc)[_0x71db('0x19')]();});}};}function handleEntityNotFound(_0x20729a){return function(_0x1a8d3e){if(!_0x1a8d3e){_0x20729a[_0x71db('0x1a')](0x194);}return _0x1a8d3e;};}function handleError(_0x2c36ca,_0x3f3ec5){_0x3f3ec5=_0x3f3ec5||0x1f4;return function(_0x3db7eb){logger['error'](_0x3db7eb[_0x71db('0x1b')]);if(_0x3db7eb[_0x71db('0x1c')]){delete _0x3db7eb[_0x71db('0x1c')];}_0x2c36ca[_0x71db('0xf')](_0x3f3ec5)['send'](_0x3db7eb);};}exports[_0x71db('0x1d')]=function(_0x13583a,_0x561e2e){var _0x2c04e5={};var _0x1c1262=_[_0x71db('0x1e')](db[_0x71db('0x1f')]['rawAttributes'],function(_0xcb70d8){return{'name':_0xcb70d8['fieldName'],'type':_0xcb70d8['type']['key']};});_0x2c04e5=qs[_0x71db('0x20')](_0x1c1262,_0x13583a);return interaction['findAll']('openchannel',_0x13583a[_0x71db('0x21')],_0x13583a['user'],_0x2c04e5,_0x1c1262)[_0x71db('0x17')](respondWithFilteredResult(_0x561e2e,_0x2c04e5))[_0x71db('0x22')](handleError(_0x561e2e,null));};exports[_0x71db('0x23')]=function(_0x42d484,_0x4c0700){var _0x25588a={};if(_0x42d484['query'][_0x71db('0x24')]&&_0x42d484[_0x71db('0x21')][_0x71db('0x24')]==='from'){_0x25588a[_0x71db('0x25')]=_0x42d484[_0x71db('0x26')]['id'];}else{_0x25588a['id']=_0x42d484['params']['id'];}var _0x2e4666={'raw':![],'where':_0x25588a},_0x3a9e3c={};_0x3a9e3c[_0x71db('0x27')]=_[_0x71db('0x28')](db[_0x71db('0x1f')][_0x71db('0x29')]);_0x3a9e3c['query']=_[_0x71db('0x28')](_0x42d484[_0x71db('0x21')]);_0x3a9e3c['filters']=_[_0x71db('0x2a')](_0x3a9e3c['model'],_0x3a9e3c['query']);_0x2e4666[_0x71db('0x2b')]=_[_0x71db('0x2a')](_0x3a9e3c[_0x71db('0x27')],qs[_0x71db('0x2c')](_0x42d484[_0x71db('0x21')][_0x71db('0x2c')]));_0x2e4666[_0x71db('0x2b')]=_0x2e4666[_0x71db('0x2b')][_0x71db('0x2d')]?_0x2e4666['attributes']:_0x3a9e3c[_0x71db('0x27')];if(_0x42d484[_0x71db('0x21')][_0x71db('0x2e')]){_0x2e4666[_0x71db('0x2f')]=[{'all':!![]}];}_0x2e4666=_[_0x71db('0x30')]({},_0x2e4666,_0x42d484['options']);return db['OpenchannelInteraction'][_0x71db('0x31')](_0x2e4666)[_0x71db('0x17')](handleEntityNotFound(_0x4c0700,null))[_0x71db('0x17')](respondWithResult(_0x4c0700,null))[_0x71db('0x22')](handleError(_0x4c0700,null));};exports[_0x71db('0x32')]=function(_0x2c6f6f,_0x10f29d){return db['OpenchannelInteraction'][_0x71db('0x32')](_0x2c6f6f[_0x71db('0x33')],{})['then'](respondWithResult(_0x10f29d,0xc9))['catch'](handleError(_0x10f29d,null));};exports[_0x71db('0x16')]=function(_0x482b1a,_0x35f4bf){if(_0x482b1a['body']['id']){delete _0x482b1a['body']['id'];}return db[_0x71db('0x1f')][_0x71db('0x31')]({'where':{'id':_0x482b1a[_0x71db('0x26')]['id']}})[_0x71db('0x17')](handleEntityNotFound(_0x35f4bf,null))[_0x71db('0x17')](saveUpdates(_0x482b1a[_0x71db('0x33')],null))[_0x71db('0x17')](respondWithResult(_0x35f4bf,null))['catch'](handleError(_0x35f4bf,null));};exports[_0x71db('0x18')]=function(_0x536920,_0x161dd4){return db[_0x71db('0x1f')][_0x71db('0x31')]({'where':{'id':_0x536920['params']['id']}})['then'](handleEntityNotFound(_0x161dd4,null))[_0x71db('0x17')](removeEntity(_0x161dd4,null))['catch'](handleError(_0x161dd4,null));};exports[_0x71db('0x34')]=function(_0x334008,_0x1a0489){return db[_0x71db('0x1f')][_0x71db('0x34')]()[_0x71db('0x17')](respondWithResult(_0x1a0489,null))[_0x71db('0x22')](handleError(_0x1a0489,null));};exports['addMessage']=function(_0x30319b,_0x3a50d6){return db['OpenchannelMessage'][_0x71db('0x31')]({'where':{'id':_0x30319b['params']['id']}})[_0x71db('0x17')](handleEntityNotFound(_0x3a50d6,null))[_0x71db('0x17')](function(_0x243dc1){if(_0x243dc1){return _0x243dc1[_0x71db('0x35')](_0x30319b[_0x71db('0x33')][_0x71db('0x36')],_[_0x71db('0x37')](_0x30319b[_0x71db('0x33')],[_0x71db('0x36'),'id'])||{});}})[_0x71db('0x17')](respondWithResult(_0x3a50d6,null))[_0x71db('0x22')](handleError(_0x3a50d6,null));};exports[_0x71db('0x38')]=function(_0x1f9a6a,_0x331865){var _0x1617ed={'raw':![],'where':{}};var _0x1e362a={};var _0x5da747={'count':0x0,'rows':[]};return db[_0x71db('0x1f')]['findOne']({'where':{'id':_0x1f9a6a[_0x71db('0x26')]['id']}})[_0x71db('0x17')](handleEntityNotFound(_0x331865,null))['then'](function(_0x4f935c){if(_0x4f935c){_0x1e362a['model']=_[_0x71db('0x28')](db[_0x71db('0x39')]['rawAttributes']);_0x1e362a[_0x71db('0x21')]=_[_0x71db('0x28')](_0x1f9a6a[_0x71db('0x21')]);_0x1e362a[_0x71db('0x3a')]=_['intersection'](_0x1e362a[_0x71db('0x27')],_0x1e362a['query']);_0x1617ed[_0x71db('0x2b')]=_[_0x71db('0x2a')](_0x1e362a['model'],qs[_0x71db('0x2c')](_0x1f9a6a['query'][_0x71db('0x2c')]));_0x1617ed[_0x71db('0x2b')]=_0x1617ed['attributes'][_0x71db('0x2d')]?_0x1617ed[_0x71db('0x2b')]:_0x1e362a[_0x71db('0x27')];if(!_0x1f9a6a[_0x71db('0x21')][_0x71db('0x3b')](_0x71db('0x3c'))){_0x1617ed[_0x71db('0x14')]=qs[_0x71db('0x14')](_0x1f9a6a[_0x71db('0x21')][_0x71db('0x14')]);_0x1617ed[_0x71db('0x11')]=qs['offset'](_0x1f9a6a[_0x71db('0x21')]['offset']);}_0x1617ed[_0x71db('0x3d')]=qs[_0x71db('0x3e')](_0x1f9a6a[_0x71db('0x21')][_0x71db('0x3e')]);_0x1617ed[_0x71db('0x3f')]=qs[_0x71db('0x3a')](_['pick'](_0x1f9a6a[_0x71db('0x21')],_0x1e362a[_0x71db('0x3a')]));_0x1617ed[_0x71db('0x3f')][_0x71db('0x40')]=_0x4f935c['id'];if(_0x1f9a6a[_0x71db('0x21')][_0x71db('0x41')]){_0x1617ed['where']=_['merge'](_0x1617ed[_0x71db('0x3f')],{'$or':_[_0x71db('0x1e')](_0x1617ed[_0x71db('0x2b')],function(_0x22c515){var _0x3324c8={};_0x3324c8[_0x22c515]={'$like':'%'+_0x1f9a6a[_0x71db('0x21')][_0x71db('0x41')]+'%'};return _0x3324c8;})});}if(_0x1f9a6a[_0x71db('0x21')][_0x71db('0x42')]){var _0x23be9c=_0x1f9a6a[_0x71db('0x21')]['$gte'][_0x71db('0x43')](',');var _0xe8a1f1={};_0xe8a1f1[_0x23be9c[0x0]]={'$gte':moment(_0x23be9c[0x1])['format'](_0x71db('0x44'))};_0x1617ed[_0x71db('0x3f')]=_[_0x71db('0x30')](_0x1617ed[_0x71db('0x3f')],_0xe8a1f1);}_0x1617ed=_['merge']({},_0x1617ed,_0x1f9a6a[_0x71db('0x45')]);return db[_0x71db('0x39')]['count']({'where':_0x1617ed[_0x71db('0x3f')]})[_0x71db('0x17')](function(_0x32d39d){_0x5da747[_0x71db('0x13')]=_0x32d39d;if(_0x1f9a6a['query'][_0x71db('0x2e')]){_0x1617ed['include']=[{'all':!![]}];}return db[_0x71db('0x39')][_0x71db('0x46')](_0x1617ed);})[_0x71db('0x17')](function(_0x2ae693){_0x5da747[_0x71db('0x47')]=_0x2ae693;return _0x5da747;});}})[_0x71db('0x17')](respondWithFilteredResult(_0x331865,_0x1617ed))[_0x71db('0x22')](handleError(_0x331865,null));};exports['addTags']=function(_0x24e134,_0x2cbf1d){return db[_0x71db('0x1f')]['find']({'where':{'id':_0x24e134['params']['id']}})[_0x71db('0x17')](handleEntityNotFound(_0x2cbf1d,null))[_0x71db('0x17')](function(_0x3596eb){if(_0x3596eb){return _0x3596eb[_0x71db('0x48')](_0x24e134[_0x71db('0x33')][_0x71db('0x36')],_['omit'](_0x24e134[_0x71db('0x33')],[_0x71db('0x36'),'id'])||{})[_0x71db('0x49')](function(){return db[_0x71db('0x4a')][_0x71db('0x46')]({'attributes':['id',_0x71db('0x1c'),'color'],'where':{'id':_0x24e134[_0x71db('0x33')][_0x71db('0x36')]}});})[_0x71db('0x17')](function(_0x54aa5d){socket[_0x71db('0x4b')](_0x71db('0x4c'),{'id':Number(_0x24e134['params']['id']),'tags':_0x54aa5d||[]});return{'id':Number(_0x24e134['params']['id']),'tags':_0x54aa5d||[]};});}})['then'](respondWithResult(_0x2cbf1d,null))[_0x71db('0x22')](handleError(_0x2cbf1d,null));};exports['removeTags']=function(_0x5ebb96,_0x56b40e){return db[_0x71db('0x1f')][_0x71db('0x31')]({'where':{'id':_0x5ebb96['params']['id']}})[_0x71db('0x17')](handleEntityNotFound(_0x56b40e,null))[_0x71db('0x17')](function(_0x1a3486){if(_0x1a3486){return _0x1a3486[_0x71db('0x4d')](_0x5ebb96[_0x71db('0x21')]['ids']);}})[_0x71db('0x17')](respondWithStatusCode(_0x56b40e,null))[_0x71db('0x22')](handleError(_0x56b40e,null));};exports[_0x71db('0x4e')]=function(_0x2db9b6,_0x1e0235){var _0x24e388=moment()[_0x71db('0x4f')]()[_0x71db('0x50')]();var _0x2e9b3f=path[_0x71db('0x51')](config[_0x71db('0x52')],_0x71db('0x53'),'files','tmp');var _0xb4c1ad=path[_0x71db('0x51')](config[_0x71db('0x52')],_0x71db('0x53'),_0x71db('0x54'),_0x71db('0x55'));var _0x1f1f7a=path[_0x71db('0x51')](_0x2e9b3f,_0x24e388);var _0x264743=util[_0x71db('0x56')](_0x71db('0x57'),_0x2db9b6[_0x71db('0x26')]['id'],_0x24e388);var _0x3ac5bb=path[_0x71db('0x51')](_0x2e9b3f,_0x264743);var _0x3042e9=[];_0x3042e9['push']({'model':db['User'],'as':_0x71db('0x58'),'attributes':['id',_0x71db('0x59')],'raw':!![]});_0x3042e9[_0x71db('0x5a')]({'model':db[_0x71db('0x5b')],'as':_0x71db('0x5c'),'attributes':['id',_0x71db('0x5d'),_0x71db('0x5e')],'raw':!![]});if(_0x2db9b6[_0x71db('0x21')][_0x71db('0x55')]){_0x3042e9[_0x71db('0x5a')]({'model':db['Attachment'],'as':_0x71db('0x5f'),'raw':!![]});}var _0xc4bf56=[{'model':db['OpenchannelMessage'],'as':_0x71db('0x60'),'attributes':['id',_0x71db('0x33'),_0x71db('0x61'),_0x71db('0x62'),_0x71db('0x63'),_0x71db('0x64')],'include':_0x3042e9}];_0xc4bf56[_0x71db('0x5a')]({'model':db['OpenchannelAccount'],'as':_0x71db('0x65'),'attributes':['id',_0x71db('0x1c')]});_0xc4bf56['push']({'model':db[_0x71db('0x58')],'as':_0x71db('0x66'),'attributes':['id',_0x71db('0x59')]});return db[_0x71db('0x1f')][_0x71db('0x31')]({'where':{'id':_0x2db9b6[_0x71db('0x26')]['id']},'include':_0xc4bf56})['then'](handleEntityNotFound(_0x1e0235,null))[_0x71db('0x17')](function(_0x347c6e){if(_0x347c6e){var _0x2a5ab0=_0x347c6e[_0x71db('0x67')]({'plain':!![]});fs[_0x71db('0x68')](_0x1f1f7a);var _0x55cd3b={'channel':_0x71db('0x69'),'account':_0x2a5ab0[_0x71db('0x65')]['name'],'agent':_0x2a5ab0[_0x71db('0x66')]?_0x2a5ab0['Owner'][_0x71db('0x59')]:_0x71db('0x6a'),'createdAt':moment(_0x2a5ab0[_0x71db('0x61')])[_0x71db('0x56')](_0x71db('0x44'))[_0x71db('0x50')](),'closedAt':_0x2a5ab0['closed']?moment(_0x2a5ab0[_0x71db('0x6b')])[_0x71db('0x56')](_0x71db('0x44'))[_0x71db('0x50')]():'','disposition':_0x2a5ab0['disposition'],'visibility':_0x2a5ab0['threadId']?'Public':_0x71db('0x6c'),'messages':_(_0x2a5ab0['Messages'])[_0x71db('0x41')]({'secret':![]})[_0x71db('0x1e')](function(_0x48dd1a){if(_0x48dd1a[_0x71db('0x5f')]){var _0x11d543=path[_0x71db('0x51')](_0xb4c1ad,_0x48dd1a[_0x71db('0x5f')][_0x71db('0x6d')]);if(fs[_0x71db('0x6e')](_0x11d543)){fs[_0x71db('0x6f')](_0x11d543)[_0x71db('0x70')](fs['createWriteStream'](path[_0x71db('0x51')](_0x1f1f7a,_0x48dd1a['Attachment'][_0x71db('0x6d')])));}}return{'date':moment(_0x48dd1a['createdAt'])[_0x71db('0x56')]('YYYY-MM-DD\x20HH:mm:ss')[_0x71db('0x50')](),'sender':_0x48dd1a[_0x71db('0x62')]===_0x71db('0x71')?_0x48dd1a['User']?_0x48dd1a[_0x71db('0x58')][_0x71db('0x59')]:'System':_0x48dd1a[_0x71db('0x5c')]['firstName']+(_0x48dd1a['Contact'][_0x71db('0x5e')]?'\x20'+_0x48dd1a[_0x71db('0x5c')][_0x71db('0x5e')]:''),'body':_0x48dd1a[_0x71db('0x5f')]?_0x48dd1a[_0x71db('0x5f')][_0x71db('0x6d')]:_0x48dd1a[_0x71db('0x33')],'direction':_0x48dd1a[_0x71db('0x62')]===_0x71db('0x71')?'A':'C','secret':_0x48dd1a['secret'],'read':_0x48dd1a[_0x71db('0x64')],'attachment':_0x48dd1a[_0x71db('0x5f')]};})[_0x71db('0x72')]()};return ejs[_0x71db('0x73')](path[_0x71db('0x51')](config[_0x71db('0x52')],'server','views','downloadInteraction.ejs'),{'interaction':_0x55cd3b})['then'](function(_0x534aab){var _0x2c6acb=path[_0x71db('0x51')](_0x1f1f7a,_0x71db('0x74')+_0x2a5ab0['id']+'-'+_0x24e388+'.pdf');var _0x3968f0={'path':_0x2c6acb,'channel':_0x71db('0x69'),'interactionId':_0x2a5ab0['id']};return pdf[_0x71db('0x75')](_0x534aab,_0x3968f0);})[_0x71db('0x17')](function(){return new Promise(function(_0x43b5c5,_0x26fef6){zipdir(_0x1f1f7a,{'saveTo':_0x3ac5bb},function(_0x3d415f,_0x170aa2){if(_0x3d415f)return _0x26fef6(_0x3d415f);return _0x43b5c5(_0x170aa2);});})[_0x71db('0x17')](function(){return new Promise(function(_0xfb52c9,_0xf7f28f){rimraf(_0x1f1f7a,function(_0x7660f3){if(_0x7660f3)_0xf7f28f(_0x7660f3);return _0xfb52c9();});});})['then'](function(){return _0x1e0235[_0x71db('0x4e')](_0x3ac5bb,_0x264743,function(_0x5c69d6){if(_0x5c69d6){logger[_0x71db('0x76')](_0x71db('0x77'),_0x5c69d6);}else{fs['unlinkSync'](_0x3ac5bb);}});});});}else{return _0x1e0235[_0x71db('0x1a')](0xc8);}})[_0x71db('0x22')](handleError(_0x1e0235,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index ca61dff..237fd20 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 _0x6ae1=['emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','remove','then','map','findAll','unreadMessages','length'];(function(_0x1c86af,_0x40f50d){var _0xbdd025=function(_0xd168a4){while(--_0xd168a4){_0x1c86af['push'](_0x1c86af['shift']());}};_0xbdd025(++_0x40f50d);}(_0x6ae1,0x184));var _0x16ae=function(_0x3f9f89,_0x4e81f1){_0x3f9f89=_0x3f9f89-0x0;var _0x36a167=_0x6ae1[_0x3f9f89];return _0x36a167;};'use strict';var EventEmitter=require(_0x16ae('0x0'));var OpenchannelInteraction=require(_0x16ae('0x1'))['db'][_0x16ae('0x2')];var OpenchannelMessage=require(_0x16ae('0x1'))['db'][_0x16ae('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x16ae('0x4')](0x0);var events={'afterCreate':_0x16ae('0x5'),'afterUpdate':'update','afterDestroy':_0x16ae('0x6')};function emitEvent(_0x13ace9){return function(_0x2dabd5,_0x274d57,_0x17b317){_0x2dabd5['getUsers']({'attributes':['id'],'raw':!![]})[_0x16ae('0x7')](function(_0x221ec4){_0x2dabd5['setDataValue']('Users',_0x221ec4[_0x16ae('0x8')](function(_0x22f9c4){return{'id':_0x22f9c4['id']};}));return OpenchannelMessage[_0x16ae('0x9')]({'where':{'OpenchannelInteractionId':_0x2dabd5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16ae('0x7')](function(_0x334244){_0x2dabd5['setDataValue'](_0x16ae('0xa'),_0x334244[_0x16ae('0xb')]);OpenchannelInteractionEvents[_0x16ae('0xc')](_0x13ace9+':'+_0x2dabd5['id'],_0x2dabd5);OpenchannelInteractionEvents['emit'](_0x13ace9,_0x2dabd5);_0x17b317(null);})[_0x16ae('0xd')](_0x17b317(null));};}for(var e in events){if(events[_0x16ae('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x16ae('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1615=['length','emit','hook','events','../../mysqldb','setMaxListeners','then','Users','map','setDataValue','unreadMessages'];(function(_0x88c397,_0x52f0ac){var _0x4c00a3=function(_0x3b4cac){while(--_0x3b4cac){_0x88c397['push'](_0x88c397['shift']());}};_0x4c00a3(++_0x52f0ac);}(_0x1615,0xd4));var _0x5161=function(_0x18d19c,_0x4382d6){_0x18d19c=_0x18d19c-0x0;var _0x5f2a31=_0x1615[_0x18d19c];return _0x5f2a31;};'use strict';var EventEmitter=require(_0x5161('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x5161('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x5161('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x238538){return function(_0x4892d5,_0x152956,_0x11a02c){_0x4892d5['getUsers']({'attributes':['id'],'raw':!![]})[_0x5161('0x3')](function(_0x3f0abc){_0x4892d5['setDataValue'](_0x5161('0x4'),_0x3f0abc[_0x5161('0x5')](function(_0x3fcbda){return{'id':_0x3fcbda['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4892d5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ef40a){_0x4892d5[_0x5161('0x6')](_0x5161('0x7'),_0x4ef40a[_0x5161('0x8')]);OpenchannelInteractionEvents[_0x5161('0x9')](_0x238538+':'+_0x4892d5['id'],_0x4892d5);OpenchannelInteractionEvents['emit'](_0x238538,_0x4892d5);_0x11a02c(null);})['catch'](_0x11a02c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x5161('0xa')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 4867618..322f7fa 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 _0x927c=['define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x13f5c5,_0x387922){var _0x18c264=function(_0x3c73f7){while(--_0x3c73f7){_0x13f5c5['push'](_0x13f5c5['shift']());}};_0x18c264(++_0x387922);}(_0x927c,0x190));var _0xc927=function(_0xd4bf22,_0x44f447){_0xd4bf22=_0xd4bf22-0x0;var _0x35c1f4=_0x927c[_0xd4bf22];return _0x35c1f4;};'use strict';var _=require('lodash');var util=require(_0xc927('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc927('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc927('0x2'));var config=require(_0xc927('0x3'));var attributes=require(_0xc927('0x4'));module[_0xc927('0x5')]=function(_0xa9e945,_0x411603){return _0xa9e945[_0xc927('0x6')](_0xc927('0x7'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc927('0x8'),'collate':_0xc927('0x9'),'hooks':{'beforeUpdate':function(_0x3f04ee,_0xd49cd6,_0x46c771){if(_0x3f04ee[_0xc927('0xa')]('closed')){_0x3f04ee[_0xc927('0xb')]=moment()[_0xc927('0xc')](_0xc927('0xd'));}_0x46c771(null,_0x3f04ee);}}});}; \ No newline at end of file +var _0x2481=['moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x1f3540,_0xf76e3e){var _0x402c01=function(_0x39e30c){while(--_0x39e30c){_0x1f3540['push'](_0x1f3540['shift']());}};_0x402c01(++_0xf76e3e);}(_0x2481,0x119));var _0x1248=function(_0x381935,_0x3f29e1){_0x381935=_0x381935-0x0;var _0x2dd2c7=_0x2481[_0x381935];return _0x2dd2c7;};'use strict';var _=require(_0x1248('0x0'));var util=require(_0x1248('0x1'));var logger=require(_0x1248('0x2'))(_0x1248('0x3'));var moment=require(_0x1248('0x4'));var BPromise=require(_0x1248('0x5'));var rp=require(_0x1248('0x6'));var fs=require('fs');var path=require(_0x1248('0x7'));var rimraf=require('rimraf');var config=require(_0x1248('0x8'));var attributes=require(_0x1248('0x9'));module[_0x1248('0xa')]=function(_0x4edbf6,_0x453dd3){return _0x4edbf6[_0x1248('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0x1248('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1248('0xd'),'hooks':{'beforeUpdate':function(_0x30afda,_0x8e07d8,_0x1e2eb2){if(_0x30afda[_0x1248('0xe')](_0x1248('0xf'))){_0x30afda[_0x1248('0x10')]=moment()[_0x1248('0x11')](_0x1248('0x12'));}_0x1e2eb2(null,_0x30afda);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 61a151f..fff63d4 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 _0x3b45=['./openchannelInteraction.socket','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','limit','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3b45,0x1a5));var _0x53b4=function(_0x46971a,_0x165d2e){_0x46971a=_0x46971a-0x0;var _0x2f9092=_0x3b45[_0x46971a];return _0x2f9092;};'use strict';var _=require(_0x53b4('0x0'));var util=require(_0x53b4('0x1'));var moment=require('moment');var BPromise=require(_0x53b4('0x2'));var rs=require(_0x53b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b4('0x4'))['db'];var utils=require(_0x53b4('0x5'));var logger=require(_0x53b4('0x6'))(_0x53b4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x53b4('0x8')][_0x53b4('0x9')]({'port':0x232a});config[_0x53b4('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x53b4('0xb'))['register'](socket);function respondWithRpcPromise(_0x5e3552,_0x1b1e87,_0x441b3f){return new BPromise(function(_0x33de73,_0x310e67){return client[_0x53b4('0xc')](_0x5e3552,_0x441b3f)[_0x53b4('0xd')](function(_0x49ae99){logger['info'](_0x53b4('0xe'),_0x1b1e87,_0x53b4('0xf'));logger[_0x53b4('0x10')](_0x53b4('0x11'),_0x1b1e87,_0x53b4('0xf'),JSON[_0x53b4('0x12')](_0x49ae99));if(_0x49ae99['error']){if(_0x49ae99[_0x53b4('0x13')]['code']===0x1f4){logger['error'](_0x53b4('0xe'),_0x1b1e87,_0x49ae99['error'][_0x53b4('0x14')]);return _0x310e67(_0x49ae99['error'][_0x53b4('0x14')]);}logger['error'](_0x53b4('0xe'),_0x1b1e87,_0x49ae99[_0x53b4('0x13')]['message']);return _0x33de73(_0x49ae99[_0x53b4('0x13')][_0x53b4('0x14')]);}else{logger[_0x53b4('0x15')](_0x53b4('0xe'),_0x1b1e87,'request\x20sent');_0x33de73(_0x49ae99[_0x53b4('0x16')][_0x53b4('0x14')]);}})[_0x53b4('0x17')](function(_0x4f6ec5){logger[_0x53b4('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1b1e87,_0x4f6ec5);_0x310e67(_0x4f6ec5);});});}exports[_0x53b4('0x18')]=function(_0x4c517c){var _0x342a16=this;return new Promise(function(_0x45b71f,_0x3304c8){return db[_0x53b4('0x19')]['update'](_0x4c517c[_0x53b4('0x1a')],{'raw':_0x4c517c['options']?_0x4c517c[_0x53b4('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c517c[_0x53b4('0x1b')]?_0x4c517c[_0x53b4('0x1b')][_0x53b4('0x1c')]||null:null,'attributes':_0x4c517c[_0x53b4('0x1b')]?_0x4c517c[_0x53b4('0x1b')]['attributes']||null:null,'limit':_0x4c517c[_0x53b4('0x1b')]?_0x4c517c[_0x53b4('0x1b')][_0x53b4('0x1d')]||null:null})[_0x53b4('0xd')](function(_0x34f46a){logger[_0x53b4('0x15')](_0x53b4('0x18'),_0x4c517c);logger[_0x53b4('0x10')](_0x53b4('0x18'),_0x4c517c,JSON[_0x53b4('0x12')](_0x34f46a));_0x45b71f(_0x34f46a);})['catch'](function(_0x190d3d){logger[_0x53b4('0x13')](_0x53b4('0x18'),_0x190d3d['message'],_0x4c517c);_0x3304c8(_0x342a16[_0x53b4('0x13')](0x1f4,_0x190d3d[_0x53b4('0x14')]));});});};exports[_0x53b4('0x1e')]=function(_0x5815c3){return new Promise(function(_0x3d7200,_0x3a4f9f){return db[_0x53b4('0x19')][_0x53b4('0x1f')]({'where':_0x5815c3[_0x53b4('0x1b')]?_0x5815c3[_0x53b4('0x1b')][_0x53b4('0x1c')]||null:null})[_0x53b4('0xd')](function(_0x49c8aa){if(_0x49c8aa){return _0x49c8aa[_0x53b4('0x20')](_0x5815c3[_0x53b4('0x1a')][_0x53b4('0x21')],_['omit'](_0x5815c3['body'],[_0x53b4('0x21'),'id'])||{});}})[_0x53b4('0x22')](function(_0x5a0046){logger[_0x53b4('0x15')]('AddTags',_0x5815c3);logger[_0x53b4('0x10')](_0x53b4('0x23'),_0x5815c3,JSON[_0x53b4('0x12')](_0x5a0046));_0x3d7200(_0x5a0046);})[_0x53b4('0x17')](function(_0x21255d){logger[_0x53b4('0x13')](_0x53b4('0x23'),_0x21255d['message'],_0x5815c3);_0x3a4f9f(_this[_0x53b4('0x13')](0x1f4,_0x21255d[_0x53b4('0x14')]));});});}; \ No newline at end of file +var _0x40af=['moment','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x40af,0x15d));var _0xf40a=function(_0x3c1cbf,_0xcd2c2c){_0x3c1cbf=_0x3c1cbf-0x0;var _0x31d56e=_0x40af[_0x3c1cbf];return _0x31d56e;};'use strict';var _=require(_0xf40a('0x0'));var util=require(_0xf40a('0x1'));var moment=require(_0xf40a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf40a('0x3'));var db=require(_0xf40a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf40a('0x5'));var config=require(_0xf40a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf40a('0x7')]['http']({'port':0x232a});config[_0xf40a('0x8')]=_['defaults'](config[_0xf40a('0x8')],{'host':_0xf40a('0x9'),'port':0x18eb});var socket=require(_0xf40a('0xa'))(new Redis(config[_0xf40a('0x8')]));require('./openchannelInteraction.socket')[_0xf40a('0xb')](socket);function respondWithRpcPromise(_0x4219f2,_0x5b3a9a,_0x222401){return new BPromise(function(_0x3405e9,_0x43276a){return client[_0xf40a('0xc')](_0x4219f2,_0x222401)[_0xf40a('0xd')](function(_0x595f9a){logger[_0xf40a('0xe')](_0xf40a('0xf'),_0x5b3a9a,_0xf40a('0x10'));logger[_0xf40a('0x11')](_0xf40a('0x12'),_0x5b3a9a,_0xf40a('0x10'),JSON['stringify'](_0x595f9a));if(_0x595f9a['error']){if(_0x595f9a[_0xf40a('0x13')][_0xf40a('0x14')]===0x1f4){logger[_0xf40a('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5b3a9a,_0x595f9a[_0xf40a('0x13')][_0xf40a('0x15')]);return _0x43276a(_0x595f9a[_0xf40a('0x13')][_0xf40a('0x15')]);}logger['error'](_0xf40a('0xf'),_0x5b3a9a,_0x595f9a['error'][_0xf40a('0x15')]);return _0x3405e9(_0x595f9a[_0xf40a('0x13')][_0xf40a('0x15')]);}else{logger[_0xf40a('0xe')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5b3a9a,_0xf40a('0x10'));_0x3405e9(_0x595f9a['result'][_0xf40a('0x15')]);}})[_0xf40a('0x16')](function(_0x95f8b9){logger[_0xf40a('0x13')](_0xf40a('0xf'),_0x5b3a9a,_0x95f8b9);_0x43276a(_0x95f8b9);});});}exports[_0xf40a('0x17')]=function(_0x4b36f6){var _0x1a0dcd=this;return new Promise(function(_0x859546,_0x3b013e){return db[_0xf40a('0x18')][_0xf40a('0x19')](_0x4b36f6[_0xf40a('0x1a')],{'raw':_0x4b36f6[_0xf40a('0x1b')]?_0x4b36f6[_0xf40a('0x1b')][_0xf40a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b36f6[_0xf40a('0x1b')]?_0x4b36f6[_0xf40a('0x1b')][_0xf40a('0x1d')]||null:null,'attributes':_0x4b36f6[_0xf40a('0x1b')]?_0x4b36f6[_0xf40a('0x1b')]['attributes']||null:null,'limit':_0x4b36f6['options']?_0x4b36f6['options'][_0xf40a('0x1e')]||null:null})[_0xf40a('0xd')](function(_0x2c34ee){logger[_0xf40a('0xe')]('UpdateOpenchannelInteraction',_0x4b36f6);logger[_0xf40a('0x11')](_0xf40a('0x17'),_0x4b36f6,JSON[_0xf40a('0x1f')](_0x2c34ee));_0x859546(_0x2c34ee);})['catch'](function(_0xf18220){logger[_0xf40a('0x13')](_0xf40a('0x17'),_0xf18220['message'],_0x4b36f6);_0x3b013e(_0x1a0dcd[_0xf40a('0x13')](0x1f4,_0xf18220['message']));});});};exports[_0xf40a('0x20')]=function(_0x516866){return new Promise(function(_0x35d911,_0x756766){return db[_0xf40a('0x18')][_0xf40a('0x21')]({'where':_0x516866[_0xf40a('0x1b')]?_0x516866['options'][_0xf40a('0x1d')]||null:null})[_0xf40a('0xd')](function(_0x34859e){if(_0x34859e){return _0x34859e[_0xf40a('0x22')](_0x516866['body'][_0xf40a('0x23')],_[_0xf40a('0x24')](_0x516866[_0xf40a('0x1a')],[_0xf40a('0x23'),'id'])||{});}})[_0xf40a('0x25')](function(_0x5bfee3){logger[_0xf40a('0xe')]('AddTags',_0x516866);logger[_0xf40a('0x11')](_0xf40a('0x26'),_0x516866,JSON[_0xf40a('0x1f')](_0x5bfee3));_0x35d911(_0x5bfee3);})['catch'](function(_0x4fbc38){logger[_0xf40a('0x13')](_0xf40a('0x26'),_0x4fbc38[_0xf40a('0x15')],_0x516866);_0x756766(_this[_0xf40a('0x13')](0x1f4,_0x4fbc38[_0xf40a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a8a3ca7..59f97e7 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 _0x7525=['emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save','update'];(function(_0x42ed3d,_0x5b4f9f){var _0x497170=function(_0x1de0a4){while(--_0x1de0a4){_0x42ed3d['push'](_0x42ed3d['shift']());}};_0x497170(++_0x5b4f9f);}(_0x7525,0x169));var _0x5752=function(_0x5ac0ce,_0x2a79f2){_0x5ac0ce=_0x5ac0ce-0x0;var _0x136050=_0x7525[_0x5ac0ce];return _0x136050;};'use strict';var OpenchannelInteractionEvents=require(_0x5752('0x0'));var events=[_0x5752('0x1'),'remove',_0x5752('0x2')];function createListener(_0x40a98c,_0x4d8bf1){return function(_0x25ed9f){_0x4d8bf1[_0x5752('0x3')](_0x40a98c,_0x25ed9f);};}function removeListener(_0x5452b0,_0x36163f){return function(){OpenchannelInteractionEvents[_0x5752('0x4')](_0x5452b0,_0x36163f);};}exports['register']=function(_0x1cf413){for(var _0x4fc10c=0x0,_0x5e619b=events[_0x5752('0x5')];_0x4fc10c<_0x5e619b;_0x4fc10c++){var _0x1fa6ed=events[_0x4fc10c];var _0x23e4ed=createListener(_0x5752('0x6')+_0x1fa6ed,_0x1cf413);OpenchannelInteractionEvents['on'](_0x1fa6ed,_0x23e4ed);}}; \ No newline at end of file +var _0x59dc=['remove','update','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x49d69b,_0x45ab87){var _0x513df0=function(_0x3c2010){while(--_0x3c2010){_0x49d69b['push'](_0x49d69b['shift']());}};_0x513df0(++_0x45ab87);}(_0x59dc,0x148));var _0xc59d=function(_0x118851,_0x5baa08){_0x118851=_0x118851-0x0;var _0x5ba187=_0x59dc[_0x118851];return _0x5ba187;};'use strict';var OpenchannelInteractionEvents=require(_0xc59d('0x0'));var events=['save',_0xc59d('0x1'),_0xc59d('0x2')];function createListener(_0x169dc8,_0x37df9a){return function(_0x25a05e){_0x37df9a[_0xc59d('0x3')](_0x169dc8,_0x25a05e);};}function removeListener(_0x1e1cf8,_0x4a8486){return function(){OpenchannelInteractionEvents[_0xc59d('0x4')](_0x1e1cf8,_0x4a8486);};}exports['register']=function(_0x4eaadd){for(var _0x4ee915=0x0,_0x2fc069=events[_0xc59d('0x5')];_0x4ee915<_0x2fc069;_0x4ee915++){var _0xdeda3d=events[_0x4ee915];var _0x36d674=createListener(_0xc59d('0x6')+_0xdeda3d,_0x4eaadd);OpenchannelInteractionEvents['on'](_0xdeda3d,_0x36d674);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 85d96df..75bb6cc 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 _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(_0x2fed8d,_0x109b41){_0x2fed8d=_0x2fed8d-0x0;var _0x3f1ad7=_0x70e0[_0x2fed8d];return _0x3f1ad7;};'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 +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x3068c8,_0x1f5504){var _0x40c6e4=function(_0x4e1f11){while(--_0x4e1f11){_0x3068c8['push'](_0x3068c8['shift']());}};_0x40c6e4(++_0x1f5504);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0xcb91[_0x3b4b1d];return _0x488c36;};'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('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 3351071..d80e160 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 _0x0901=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x0901,0x134));var _0x1090=function(_0x952eb,_0x42ec03){_0x952eb=_0x952eb-0x0;var _0x2fd0e9=_0x0901[_0x952eb];return _0x2fd0e9;};'use strict';var Sequelize=require(_0x1090('0x0'));module[_0x1090('0x1')]={'body':{'type':Sequelize[_0x1090('0x2')](_0x1090('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1090('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x1090('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x1090('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1090('0x6')]},'providerName':{'type':Sequelize[_0x1090('0x7')]},'providerResponse':{'type':Sequelize[_0x1090('0x2')]}}; \ No newline at end of file +var _0x4213=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x44c6cc,_0x37e378){var _0x20188c=function(_0x4e8c6f){while(--_0x4e8c6f){_0x44c6cc['push'](_0x44c6cc['shift']());}};_0x20188c(++_0x37e378);}(_0x4213,0x77));var _0x3421=function(_0x225f3f,_0x2b5e7d){_0x225f3f=_0x225f3f-0x0;var _0x28fc97=_0x4213[_0x225f3f];return _0x28fc97;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'body':{'type':Sequelize[_0x3421('0x2')](_0x3421('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3421('0x5')]('in','out'),'defaultValue':_0x3421('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3421('0x7')]},'providerResponse':{'type':Sequelize[_0x3421('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b88705c..431d23a 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 _0x2ca0=['name','index','map','OpenchannelMessage','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','params','rawAttributes','length','find','create','body','update','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE: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','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','role','RejectMessage','rejectMessage','internal','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','http','request','then','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','OpenchannelMessage,\x20%s,\x20%s','info','catch','sendStatus','end','offset','undefined','limit','status','set','json','apply','reject','save','destroy','stack'];(function(_0x49bfb8,_0x5b6e2b){var _0x1be0b7=function(_0x3df70f){while(--_0x3df70f){_0x49bfb8['push'](_0x49bfb8['shift']());}};_0x1be0b7(++_0x5b6e2b);}(_0x2ca0,0x154));var _0x02ca=function(_0x52b016,_0x33ec6e){_0x52b016=_0x52b016-0x0;var _0x13e797=_0x2ca0[_0x52b016];return _0x13e797;};'use strict';var emlformat=require(_0x02ca('0x0'));var rimraf=require(_0x02ca('0x1'));var zipdir=require(_0x02ca('0x2'));var jsonpatch=require(_0x02ca('0x3'));var rp=require(_0x02ca('0x4'));var moment=require('moment');var BPromise=require(_0x02ca('0x5'));var Mustache=require(_0x02ca('0x6'));var util=require(_0x02ca('0x7'));var path=require(_0x02ca('0x8'));var sox=require(_0x02ca('0x9'));var csv=require(_0x02ca('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x02ca('0xb'));var _=require(_0x02ca('0xc'));var squel=require('squel');var crypto=require(_0x02ca('0xd'));var jsforce=require(_0x02ca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x02ca('0xa'));var querystring=require('querystring');var Papa=require(_0x02ca('0xf'));var Redis=require(_0x02ca('0x10'));var authService=require(_0x02ca('0x11'));var qs=require(_0x02ca('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02ca('0x13'));var logger=require(_0x02ca('0x14'))(_0x02ca('0x15'));var utils=require(_0x02ca('0x16'));var config=require(_0x02ca('0x17'));var licenseUtil=require(_0x02ca('0x18'));var db=require(_0x02ca('0x19'))['db'];config['redis']=_['defaults'](config[_0x02ca('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x02ca('0x1b'))(new Redis(config[_0x02ca('0x1a')]));require('./openchannelMessage.socket')[_0x02ca('0x1c')](socket);var jayson=require(_0x02ca('0x1d'));var client=jayson['client'][_0x02ca('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x02ca('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xb4751a,_0x31c652,_0x1cfdc1,_0x2beb9c){return new BPromise(function(_0x4ed336,_0x297cc0){var _0x42da41=_0x2beb9c||client;return _0x42da41[_0x02ca('0x1f')](_0xb4751a,_0x1cfdc1)[_0x02ca('0x20')](function(_0x72931b){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x31c652,'request\x20sent');logger[_0x02ca('0x21')](_0x02ca('0x22'),_0x31c652,_0x02ca('0x23'),JSON[_0x02ca('0x24')](_0x72931b));if(_0x72931b['error']){if(_0x72931b['error'][_0x02ca('0x25')]===0x1f4){logger[_0x02ca('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x31c652,_0x72931b[_0x02ca('0x26')][_0x02ca('0x27')]);return _0x297cc0(_0x72931b['error']['message']);}logger[_0x02ca('0x26')](_0x02ca('0x28'),_0x31c652,_0x72931b[_0x02ca('0x26')][_0x02ca('0x27')]);return _0x4ed336(_0x72931b[_0x02ca('0x26')][_0x02ca('0x27')]);}else{logger[_0x02ca('0x29')](_0x02ca('0x28'),_0x31c652,_0x02ca('0x23'));_0x4ed336(_0x72931b['result']['message']);}})[_0x02ca('0x2a')](function(_0x29d94c){logger['error'](_0x02ca('0x28'),_0x31c652,_0x29d94c);_0x297cc0(_0x29d94c);});});}function respondWithStatusCode(_0x42662f,_0x557226){_0x557226=_0x557226||0xcc;return function(_0x4207bc){if(_0x4207bc){return _0x42662f[_0x02ca('0x2b')](_0x557226);}return _0x42662f['status'](_0x557226)[_0x02ca('0x2c')]();};}function respondWithResult(_0x3add31,_0x4ed679){_0x4ed679=_0x4ed679||0xc8;return function(_0x2d9101){if(_0x2d9101){return _0x3add31['status'](_0x4ed679)['json'](_0x2d9101);}};}function respondWithFilteredResult(_0x798d14,_0x1f9fd6){return function(_0x3acaad){if(_0x3acaad){var _0x4bca9b=typeof _0x1f9fd6[_0x02ca('0x2d')]===_0x02ca('0x2e')&&typeof _0x1f9fd6[_0x02ca('0x2f')]==='undefined';var _0x165099=_0x3acaad['count'];var _0xe1655=_0x4bca9b?0x0:_0x1f9fd6[_0x02ca('0x2d')];var _0x45f251=_0x4bca9b?_0x3acaad['count']:_0x1f9fd6[_0x02ca('0x2d')]+_0x1f9fd6[_0x02ca('0x2f')];var _0x150208;if(_0x45f251>=_0x165099){_0x45f251=_0x165099;_0x150208=0xc8;}else{_0x150208=0xce;}_0x798d14[_0x02ca('0x30')](_0x150208);return _0x798d14[_0x02ca('0x31')]('Content-Range',_0xe1655+'-'+_0x45f251+'/'+_0x165099)[_0x02ca('0x32')](_0x3acaad);}return null;};}function patchUpdates(_0x58eee4){return function(_0x57e328){try{jsonpatch[_0x02ca('0x33')](_0x57e328,_0x58eee4,!![]);}catch(_0x179737){return BPromise[_0x02ca('0x34')](_0x179737);}return _0x57e328[_0x02ca('0x35')]();};}function saveUpdates(_0x55db12,_0x395869){return function(_0xf382f9){if(_0xf382f9){return _0xf382f9['update'](_0x55db12)[_0x02ca('0x20')](function(_0x8581e5){return _0x8581e5;});}return null;};}function removeEntity(_0x29fce2,_0x4da551){return function(_0x4b4e11){if(_0x4b4e11){return _0x4b4e11[_0x02ca('0x36')]()[_0x02ca('0x20')](function(){_0x29fce2['status'](0xcc)[_0x02ca('0x2c')]();});}};}function handleEntityNotFound(_0x2dcd63,_0x1f2bf4){return function(_0x1c46bf){if(!_0x1c46bf){_0x2dcd63[_0x02ca('0x2b')](0x194);}return _0x1c46bf;};}function handleError(_0x270c83,_0x331e22){_0x331e22=_0x331e22||0x1f4;return function(_0x480b99){logger[_0x02ca('0x26')](_0x480b99[_0x02ca('0x37')]);if(_0x480b99[_0x02ca('0x38')]){delete _0x480b99[_0x02ca('0x38')];}_0x270c83[_0x02ca('0x30')](_0x331e22)['send'](_0x480b99);};}exports[_0x02ca('0x39')]=function(_0x3f4ba0,_0x37970f){var _0x528591={},_0x2e47f9={},_0xe5f696={'count':0x0,'rows':[]};var _0x215645=_[_0x02ca('0x3a')](db[_0x02ca('0x3b')]['rawAttributes'],function(_0x48a5e4){return{'name':_0x48a5e4['fieldName'],'type':_0x48a5e4[_0x02ca('0x3c')][_0x02ca('0x3d')]};});_0x2e47f9['model']=_['map'](_0x215645,'name');_0x2e47f9[_0x02ca('0x3e')]=_[_0x02ca('0x3f')](_0x3f4ba0[_0x02ca('0x3e')]);_0x2e47f9[_0x02ca('0x40')]=_[_0x02ca('0x41')](_0x2e47f9['model'],_0x2e47f9[_0x02ca('0x3e')]);_0x528591['attributes']=_['intersection'](_0x2e47f9[_0x02ca('0x42')],qs[_0x02ca('0x43')](_0x3f4ba0[_0x02ca('0x3e')][_0x02ca('0x43')]));_0x528591[_0x02ca('0x44')]=_0x528591['attributes']['length']?_0x528591['attributes']:_0x2e47f9[_0x02ca('0x42')];if(!_0x3f4ba0[_0x02ca('0x3e')][_0x02ca('0x45')](_0x02ca('0x46'))){_0x528591[_0x02ca('0x2f')]=qs[_0x02ca('0x2f')](_0x3f4ba0[_0x02ca('0x3e')][_0x02ca('0x2f')]);_0x528591[_0x02ca('0x2d')]=qs[_0x02ca('0x2d')](_0x3f4ba0[_0x02ca('0x3e')][_0x02ca('0x2d')]);}_0x528591['order']=qs['sort'](_0x3f4ba0['query'][_0x02ca('0x47')]);_0x528591[_0x02ca('0x48')]=qs['filters'](_[_0x02ca('0x49')](_0x3f4ba0[_0x02ca('0x3e')],_0x2e47f9[_0x02ca('0x40')]),_0x215645);if(_0x3f4ba0[_0x02ca('0x3e')][_0x02ca('0x4a')]){_0x528591[_0x02ca('0x48')]=_[_0x02ca('0x4b')](_0x528591[_0x02ca('0x48')],{'$or':_[_0x02ca('0x3a')](_0x215645,function(_0x4645a7){if(_0x4645a7[_0x02ca('0x3c')]!==_0x02ca('0x4c')){var _0x18c314={};_0x18c314[_0x4645a7[_0x02ca('0x38')]]={'$like':'%'+_0x3f4ba0['query'][_0x02ca('0x4a')]+'%'};return _0x18c314;}})});}_0x528591=_['merge']({},_0x528591,_0x3f4ba0[_0x02ca('0x4d')]);var _0x143ca7={'where':_0x528591[_0x02ca('0x48')]};return db['OpenchannelMessage'][_0x02ca('0x4e')](_0x143ca7)[_0x02ca('0x20')](function(_0x4551a7){_0xe5f696[_0x02ca('0x4e')]=_0x4551a7;if(_0x3f4ba0['query']['includeAll']){_0x528591[_0x02ca('0x4f')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x02ca('0x50')](_0x528591);})[_0x02ca('0x20')](function(_0x47e0f4){_0xe5f696[_0x02ca('0x51')]=_0x47e0f4;return _0xe5f696;})['then'](respondWithFilteredResult(_0x37970f,_0x528591))['catch'](handleError(_0x37970f,null));};exports[_0x02ca('0x52')]=function(_0x3aa401,_0x4a59a4){var _0x22fb33={'raw':!![],'where':{'id':_0x3aa401[_0x02ca('0x53')]['id']}},_0x36bdba={};_0x36bdba[_0x02ca('0x42')]=_[_0x02ca('0x3f')](db[_0x02ca('0x3b')][_0x02ca('0x54')]);_0x36bdba[_0x02ca('0x3e')]=_[_0x02ca('0x3f')](_0x3aa401[_0x02ca('0x3e')]);_0x36bdba[_0x02ca('0x40')]=_['intersection'](_0x36bdba['model'],_0x36bdba[_0x02ca('0x3e')]);_0x22fb33[_0x02ca('0x44')]=_[_0x02ca('0x41')](_0x36bdba[_0x02ca('0x42')],qs[_0x02ca('0x43')](_0x3aa401[_0x02ca('0x3e')][_0x02ca('0x43')]));_0x22fb33['attributes']=_0x22fb33[_0x02ca('0x44')][_0x02ca('0x55')]?_0x22fb33['attributes']:_0x36bdba[_0x02ca('0x42')];if(_0x3aa401[_0x02ca('0x3e')]['includeAll']){_0x22fb33[_0x02ca('0x4f')]=[{'all':!![]}];}_0x22fb33=_['merge']({},_0x22fb33,_0x3aa401[_0x02ca('0x4d')]);return db[_0x02ca('0x3b')][_0x02ca('0x56')](_0x22fb33)['then'](handleEntityNotFound(_0x4a59a4,null))[_0x02ca('0x20')](respondWithResult(_0x4a59a4,null))[_0x02ca('0x2a')](handleError(_0x4a59a4,null));};exports[_0x02ca('0x57')]=function(_0x1636c0,_0x5a8c8c){return db['OpenchannelMessage']['create'](_0x1636c0[_0x02ca('0x58')],{})[_0x02ca('0x20')](respondWithResult(_0x5a8c8c,0xc9))[_0x02ca('0x2a')](handleError(_0x5a8c8c,null));};exports[_0x02ca('0x59')]=function(_0xe8ebe1,_0x3a8cd6){if(_0xe8ebe1[_0x02ca('0x58')]['id']){delete _0xe8ebe1['body']['id'];}return db[_0x02ca('0x3b')][_0x02ca('0x56')]({'where':{'id':_0xe8ebe1['params']['id']}})['then'](handleEntityNotFound(_0x3a8cd6,null))[_0x02ca('0x20')](saveUpdates(_0xe8ebe1[_0x02ca('0x58')],null))['then'](respondWithResult(_0x3a8cd6,null))['catch'](handleError(_0x3a8cd6,null));};exports[_0x02ca('0x36')]=function(_0x18645a,_0x28d2e5){return db[_0x02ca('0x3b')]['find']({'where':{'id':_0x18645a['params']['id']}})[_0x02ca('0x20')](handleEntityNotFound(_0x28d2e5,null))['then'](removeEntity(_0x28d2e5,null))[_0x02ca('0x2a')](handleError(_0x28d2e5,null));};exports[_0x02ca('0x5a')]=function(_0xe6d63b,_0x35ef78){return db[_0x02ca('0x3b')][_0x02ca('0x5a')]()[_0x02ca('0x20')](respondWithResult(_0x35ef78,null))['catch'](handleError(_0x35ef78,null));};var interaction_log=require(_0x02ca('0x14'))('openchannel-interactions');exports[_0x02ca('0x5b')]=function(_0x3b3dd6,_0x2f8f82,_0x47c73e){var _0x2cad38={'agent':{},'channel':_0x02ca('0x5c')};if(_0x3b3dd6[_0x02ca('0x58')]['id']){delete _0x3b3dd6[_0x02ca('0x58')]['id'];}_0x3b3dd6[_0x02ca('0x58')][_0x02ca('0x5d')]=!![];_0x3b3dd6[_0x02ca('0x58')][_0x02ca('0x5e')]=moment()[_0x02ca('0x5f')](_0x02ca('0x60'));_0x3b3dd6[_0x02ca('0x58')]['UserId']=_0x3b3dd6[_0x02ca('0x58')][_0x02ca('0x61')]||_0x3b3dd6[_0x02ca('0x62')]['id'];_0x2cad38[_0x02ca('0x63')]['id']=_0x3b3dd6['body']['UserId'];return db[_0x02ca('0x3b')][_0x02ca('0x56')]({'where':{'id':_0x3b3dd6[_0x02ca('0x53')]['id'],'UserId':null}})[_0x02ca('0x20')](handleEntityNotFound(_0x2f8f82,null))['then'](saveUpdates(_0x3b3dd6['body'],null))[_0x02ca('0x20')](function(_0x5a63f2){if(_0x5a63f2){_0x2cad38['message']=_0x5a63f2['get']({'plain':!![]});return db[_0x02ca('0x64')][_0x02ca('0x56')]({'where':{'id':_0x5a63f2[_0x02ca('0x65')]}});}return null;})[_0x02ca('0x20')](handleEntityNotFound(_0x2f8f82,null))[_0x02ca('0x20')](function(_0x2dad6d){if(_0x2dad6d){return _0x2dad6d['update']({'UserId':_0x3b3dd6[_0x02ca('0x58')]['UserId'],'read1stAt':_[_0x02ca('0x66')](_0x2dad6d[_0x02ca('0x67')])?moment()[_0x02ca('0x5f')](_0x02ca('0x60')):undefined});}return null;})[_0x02ca('0x20')](function(_0x23fde0){if(_0x23fde0){_0x2cad38[_0x02ca('0x68')]=_0x23fde0[_0x02ca('0x69')]({'plain':!![]});interaction_log[_0x02ca('0x29')](_0x02ca('0x6a'),_0x3b3dd6['user']['id'],_0x3b3dd6[_0x02ca('0x62')][_0x02ca('0x38')],_0x3b3dd6[_0x02ca('0x62')]['role'],_0x2cad38['interaction']['id'],_0x3b3dd6['body']?JSON['stringify'](_0x3b3dd6[_0x02ca('0x58')]):_0x02ca('0x6b'));return respondWithRpcPromise(_0x02ca('0x6c'),_0x02ca('0x6d'),_0x2cad38);}return null;})['then'](function(_0x2e9473){var _0x3925ea=_0x02ca('0x6e')+_0x2e9473[_0x02ca('0x27')][_0x02ca('0x6f')];return db['sequelize']['query'](_0x3925ea,{'type':db[_0x02ca('0x70')][_0x02ca('0x71')][_0x02ca('0x72')],'raw':!![]})[_0x02ca('0x20')](function(_0x469e9b){return _0x469e9b;});})[_0x02ca('0x20')](function(_0x3ef9aa){if(_0x3ef9aa){_0x2cad38[_0x02ca('0x27')][_0x02ca('0x73')]=_0x3ef9aa[0x0];if(!_0x3b3dd6[_0x02ca('0x58')][_0x02ca('0x61')])return;return db[_0x02ca('0x74')]['find']({'where':{'id':_0x3b3dd6['body'][_0x02ca('0x61')],'role':_0x02ca('0x63')},'attributes':['id',_0x02ca('0x38'),_0x02ca('0x75'),_0x02ca('0x76'),'internal'],'raw':!![]});}return null;})[_0x02ca('0x20')](function(_0x22902f){if(!_0x22902f)return null;_0x2cad38['message'][_0x02ca('0x63')]=_0x22902f;return _0x2cad38;})['then'](function(_0x1bfb6d){if(_0x1bfb6d){if(_0x3b3dd6['body'][_0x02ca('0x77')]){_0x2cad38[_0x02ca('0x27')]['interface']=util[_0x02ca('0x5f')](_0x02ca('0x78'),_0x3b3dd6[_0x02ca('0x62')]['name']);_0x2cad38[_0x02ca('0x27')]['channel']=_0x2cad38[_0x02ca('0x79')];_0x2cad38[_0x02ca('0x27')][_0x02ca('0x7a')]=_0x2cad38['channel'];_0x2cad38[_0x02ca('0x27')][_0x02ca('0x7b')]=_0x02ca('0x5b');return respondWithRpcPromise(_0x02ca('0x7c'),_0x02ca('0x7c'),{'event':_0x02ca('0x7d'),'message':_0x2cad38['message']},client9002)[_0x02ca('0x20')](function(){return _0x2cad38;});}return _0x2cad38;}return null;})[_0x02ca('0x20')](respondWithResult(_0x2f8f82,null))[_0x02ca('0x2a')](handleError(_0x2f8f82,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports['reject']=function(_0x362fa1,_0x14a302,_0x57640d){var _0x5f188c={'agent':{},'channel':'openchannel'};if(_0x362fa1[_0x02ca('0x58')]['id']){delete _0x362fa1['body']['id'];}_0x362fa1[_0x02ca('0x58')][_0x02ca('0x61')]=_0x362fa1[_0x02ca('0x58')][_0x02ca('0x61')]||_0x362fa1[_0x02ca('0x62')]['id'];_0x5f188c['agent']['id']=_0x362fa1[_0x02ca('0x58')][_0x02ca('0x61')];return db[_0x02ca('0x3b')][_0x02ca('0x56')]({'where':{'id':_0x362fa1[_0x02ca('0x53')]['id'],'UserId':null}})[_0x02ca('0x20')](handleEntityNotFound(_0x14a302,null))['then'](function(_0x157ec3){if(_0x157ec3){_0x5f188c['message']=_0x157ec3['get']({'plain':!![]});return db[_0x02ca('0x64')][_0x02ca('0x56')]({'where':{'id':_0x157ec3[_0x02ca('0x65')]}});}return null;})[_0x02ca('0x20')](handleEntityNotFound(_0x14a302,null))['then'](function(_0x1e903d){if(_0x1e903d){_0x5f188c[_0x02ca('0x68')]=_0x1e903d[_0x02ca('0x69')]({'plain':!![]});interaction_log[_0x02ca('0x29')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x362fa1[_0x02ca('0x62')]['id'],_0x362fa1[_0x02ca('0x62')][_0x02ca('0x38')],_0x362fa1['user'][_0x02ca('0x7e')],_0x5f188c[_0x02ca('0x68')]['id'],_0x362fa1[_0x02ca('0x58')]?JSON[_0x02ca('0x24')](_0x362fa1[_0x02ca('0x58')]):_0x02ca('0x6b'));return respondWithRpcPromise(_0x02ca('0x7f'),_0x02ca('0x80'),_0x5f188c);}return null;})[_0x02ca('0x20')](function(_0x11d220){var _0x46f769=_0x02ca('0x6e')+_0x11d220[_0x02ca('0x27')][_0x02ca('0x6f')];return db['sequelize']['query'](_0x46f769,{'type':db['Sequelize'][_0x02ca('0x71')][_0x02ca('0x72')],'raw':!![]})[_0x02ca('0x20')](function(_0x5a27d2){return _0x5a27d2;});})['then'](function(_0x1f8829){if(_0x1f8829){_0x5f188c[_0x02ca('0x27')][_0x02ca('0x73')]=_0x1f8829[0x0];if(!_0x362fa1[_0x02ca('0x58')][_0x02ca('0x61')])return;return db[_0x02ca('0x74')][_0x02ca('0x56')]({'where':{'id':_0x362fa1[_0x02ca('0x58')]['UserId'],'role':_0x02ca('0x63')},'attributes':['id','name',_0x02ca('0x75'),_0x02ca('0x76'),_0x02ca('0x81')],'raw':!![]});}return null;})[_0x02ca('0x20')](function(_0x1877a9){if(!_0x1877a9)return null;_0x5f188c['message'][_0x02ca('0x63')]=_0x1877a9;return _0x5f188c;})[_0x02ca('0x20')](function(_0x16d288){if(_0x16d288){_0x16d288[_0x02ca('0x27')][_0x02ca('0x82')]=util[_0x02ca('0x5f')](_0x02ca('0x78'),_0x362fa1['user']['name']);_0x16d288[_0x02ca('0x27')][_0x02ca('0x79')]=_0x5f188c[_0x02ca('0x79')];_0x16d288[_0x02ca('0x27')]['motionChannel']=_0x5f188c['channel'];_0x16d288[_0x02ca('0x27')]['event']=_0x02ca('0x34');respondWithRpcPromise(_0x02ca('0x7c'),_0x02ca('0x7c'),{'event':_0x02ca('0x83'),'message':_0x16d288['message']},client9002);return _0x5f188c;}return null;})['then'](respondWithResult(_0x14a302,null))[_0x02ca('0x2a')](handleError(_0x14a302,null));}; \ No newline at end of file +var _0x50fb=['request\x20sent','error','code','message','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','map','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','OpenchannelMessage','include','rows','catch','params','rawAttributes','includeAll','create','body','find','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','get','OpenchannelInteractionId','read1stAt','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','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','fullname','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5de7f2,_0x358f95){var _0x1095d3=function(_0xc6093c){while(--_0xc6093c){_0x5de7f2['push'](_0x5de7f2['shift']());}};_0x1095d3(++_0x358f95);}(_0x50fb,0x1df));var _0xb50f=function(_0x4cbe09,_0x5615ee){_0x4cbe09=_0x4cbe09-0x0;var _0x5894ad=_0x50fb[_0x4cbe09];return _0x5894ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb50f('0x0'));var zipdir=require(_0xb50f('0x1'));var jsonpatch=require(_0xb50f('0x2'));var rp=require(_0xb50f('0x3'));var moment=require(_0xb50f('0x4'));var BPromise=require(_0xb50f('0x5'));var Mustache=require(_0xb50f('0x6'));var util=require(_0xb50f('0x7'));var path=require('path');var sox=require(_0xb50f('0x8'));var csv=require(_0xb50f('0x9'));var ejs=require(_0xb50f('0xa'));var fs=require('fs');var fs_extra=require(_0xb50f('0xb'));var _=require('lodash');var squel=require(_0xb50f('0xc'));var crypto=require(_0xb50f('0xd'));var jsforce=require(_0xb50f('0xe'));var deskjs=require(_0xb50f('0xf'));var toCsv=require(_0xb50f('0x9'));var querystring=require(_0xb50f('0x10'));var Papa=require(_0xb50f('0x11'));var Redis=require(_0xb50f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb50f('0x13'));var as=require(_0xb50f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb50f('0x15'))(_0xb50f('0x16'));var utils=require(_0xb50f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb50f('0x18')]=_[_0xb50f('0x19')](config[_0xb50f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb50f('0x1a'))(new Redis(config[_0xb50f('0x18')]));require(_0xb50f('0x1b'))[_0xb50f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb50f('0x1d')][_0xb50f('0x1e')]({'port':0x232c});var client9002=jayson[_0xb50f('0x1d')][_0xb50f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xa9076f,_0x425b29,_0x377053,_0x43b968){return new BPromise(function(_0x1e6c00,_0x5f5075){var _0x4eb92e=_0x43b968||client;return _0x4eb92e[_0xb50f('0x1f')](_0xa9076f,_0x377053)[_0xb50f('0x20')](function(_0xf69e49){logger[_0xb50f('0x21')](_0xb50f('0x22'),_0x425b29,'request\x20sent');logger[_0xb50f('0x23')](_0xb50f('0x24'),_0x425b29,_0xb50f('0x25'),JSON['stringify'](_0xf69e49));if(_0xf69e49['error']){if(_0xf69e49[_0xb50f('0x26')][_0xb50f('0x27')]===0x1f4){logger[_0xb50f('0x26')](_0xb50f('0x22'),_0x425b29,_0xf69e49[_0xb50f('0x26')][_0xb50f('0x28')]);return _0x5f5075(_0xf69e49['error'][_0xb50f('0x28')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x425b29,_0xf69e49[_0xb50f('0x26')][_0xb50f('0x28')]);return _0x1e6c00(_0xf69e49[_0xb50f('0x26')]['message']);}else{logger[_0xb50f('0x21')](_0xb50f('0x22'),_0x425b29,_0xb50f('0x25'));_0x1e6c00(_0xf69e49['result']['message']);}})['catch'](function(_0x1f7953){logger[_0xb50f('0x26')](_0xb50f('0x22'),_0x425b29,_0x1f7953);_0x5f5075(_0x1f7953);});});}function respondWithStatusCode(_0x533a48,_0x3c0f9d){_0x3c0f9d=_0x3c0f9d||0xcc;return function(_0x2ab37f){if(_0x2ab37f){return _0x533a48[_0xb50f('0x29')](_0x3c0f9d);}return _0x533a48[_0xb50f('0x2a')](_0x3c0f9d)[_0xb50f('0x2b')]();};}function respondWithResult(_0x24e496,_0x22d2ce){_0x22d2ce=_0x22d2ce||0xc8;return function(_0xc489f8){if(_0xc489f8){return _0x24e496[_0xb50f('0x2a')](_0x22d2ce)[_0xb50f('0x2c')](_0xc489f8);}};}function respondWithFilteredResult(_0x24fc95,_0x41c15e){return function(_0xd79e30){if(_0xd79e30){var _0xfc1814=typeof _0x41c15e[_0xb50f('0x2d')]==='undefined'&&typeof _0x41c15e[_0xb50f('0x2e')]==='undefined';var _0x48f23e=_0xd79e30[_0xb50f('0x2f')];var _0x33ced1=_0xfc1814?0x0:_0x41c15e[_0xb50f('0x2d')];var _0x4b2995=_0xfc1814?_0xd79e30[_0xb50f('0x2f')]:_0x41c15e[_0xb50f('0x2d')]+_0x41c15e[_0xb50f('0x2e')];var _0x5ef042;if(_0x4b2995>=_0x48f23e){_0x4b2995=_0x48f23e;_0x5ef042=0xc8;}else{_0x5ef042=0xce;}_0x24fc95[_0xb50f('0x2a')](_0x5ef042);return _0x24fc95[_0xb50f('0x30')](_0xb50f('0x31'),_0x33ced1+'-'+_0x4b2995+'/'+_0x48f23e)['json'](_0xd79e30);}return null;};}function patchUpdates(_0x5c4411){return function(_0x284d89){try{jsonpatch[_0xb50f('0x32')](_0x284d89,_0x5c4411,!![]);}catch(_0x55e16e){return BPromise[_0xb50f('0x33')](_0x55e16e);}return _0x284d89['save']();};}function saveUpdates(_0x3ccf33,_0x2d4634){return function(_0xc7a755){if(_0xc7a755){return _0xc7a755[_0xb50f('0x34')](_0x3ccf33)['then'](function(_0x37fa14){return _0x37fa14;});}return null;};}function removeEntity(_0x4533b5,_0x119997){return function(_0x474508){if(_0x474508){return _0x474508[_0xb50f('0x35')]()[_0xb50f('0x20')](function(){_0x4533b5[_0xb50f('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x447a0c,_0x41c038){return function(_0x167b74){if(!_0x167b74){_0x447a0c[_0xb50f('0x29')](0x194);}return _0x167b74;};}function handleError(_0x4ff410,_0x1f85fc){_0x1f85fc=_0x1f85fc||0x1f4;return function(_0x1bac85){logger['error'](_0x1bac85[_0xb50f('0x36')]);if(_0x1bac85[_0xb50f('0x37')]){delete _0x1bac85['name'];}_0x4ff410['status'](_0x1f85fc)[_0xb50f('0x38')](_0x1bac85);};}exports['index']=function(_0x457be2,_0x13846f){var _0x455a1a={},_0x4b4171={},_0x106682={'count':0x0,'rows':[]};var _0x299173=_[_0xb50f('0x39')](db['OpenchannelMessage']['rawAttributes'],function(_0x4c34c7){return{'name':_0x4c34c7[_0xb50f('0x3a')],'type':_0x4c34c7[_0xb50f('0x3b')]['key']};});_0x4b4171[_0xb50f('0x3c')]=_[_0xb50f('0x39')](_0x299173,_0xb50f('0x37'));_0x4b4171['query']=_[_0xb50f('0x3d')](_0x457be2[_0xb50f('0x3e')]);_0x4b4171['filters']=_[_0xb50f('0x3f')](_0x4b4171[_0xb50f('0x3c')],_0x4b4171[_0xb50f('0x3e')]);_0x455a1a[_0xb50f('0x40')]=_[_0xb50f('0x3f')](_0x4b4171[_0xb50f('0x3c')],qs[_0xb50f('0x41')](_0x457be2[_0xb50f('0x3e')][_0xb50f('0x41')]));_0x455a1a[_0xb50f('0x40')]=_0x455a1a['attributes'][_0xb50f('0x42')]?_0x455a1a[_0xb50f('0x40')]:_0x4b4171[_0xb50f('0x3c')];if(!_0x457be2[_0xb50f('0x3e')][_0xb50f('0x43')](_0xb50f('0x44'))){_0x455a1a['limit']=qs['limit'](_0x457be2[_0xb50f('0x3e')]['limit']);_0x455a1a[_0xb50f('0x2d')]=qs[_0xb50f('0x2d')](_0x457be2[_0xb50f('0x3e')][_0xb50f('0x2d')]);}_0x455a1a[_0xb50f('0x45')]=qs[_0xb50f('0x46')](_0x457be2[_0xb50f('0x3e')][_0xb50f('0x46')]);_0x455a1a[_0xb50f('0x47')]=qs[_0xb50f('0x48')](_[_0xb50f('0x49')](_0x457be2[_0xb50f('0x3e')],_0x4b4171['filters']),_0x299173);if(_0x457be2[_0xb50f('0x3e')]['filter']){_0x455a1a['where']=_[_0xb50f('0x4a')](_0x455a1a[_0xb50f('0x47')],{'$or':_[_0xb50f('0x39')](_0x299173,function(_0x5838d7){if(_0x5838d7['type']!==_0xb50f('0x4b')){var _0x2012e0={};_0x2012e0[_0x5838d7['name']]={'$like':'%'+_0x457be2[_0xb50f('0x3e')]['filter']+'%'};return _0x2012e0;}})});}_0x455a1a=_[_0xb50f('0x4a')]({},_0x455a1a,_0x457be2[_0xb50f('0x4c')]);var _0x4100c0={'where':_0x455a1a[_0xb50f('0x47')]};return db[_0xb50f('0x4d')]['count'](_0x4100c0)[_0xb50f('0x20')](function(_0x129786){_0x106682[_0xb50f('0x2f')]=_0x129786;if(_0x457be2[_0xb50f('0x3e')]['includeAll']){_0x455a1a[_0xb50f('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x455a1a);})['then'](function(_0x29a634){_0x106682[_0xb50f('0x4f')]=_0x29a634;return _0x106682;})[_0xb50f('0x20')](respondWithFilteredResult(_0x13846f,_0x455a1a))[_0xb50f('0x50')](handleError(_0x13846f,null));};exports['show']=function(_0x1afbf1,_0x6d4128){var _0x184963={'raw':!![],'where':{'id':_0x1afbf1[_0xb50f('0x51')]['id']}},_0x48daaf={};_0x48daaf['model']=_[_0xb50f('0x3d')](db[_0xb50f('0x4d')][_0xb50f('0x52')]);_0x48daaf[_0xb50f('0x3e')]=_[_0xb50f('0x3d')](_0x1afbf1[_0xb50f('0x3e')]);_0x48daaf[_0xb50f('0x48')]=_[_0xb50f('0x3f')](_0x48daaf['model'],_0x48daaf[_0xb50f('0x3e')]);_0x184963[_0xb50f('0x40')]=_[_0xb50f('0x3f')](_0x48daaf[_0xb50f('0x3c')],qs[_0xb50f('0x41')](_0x1afbf1[_0xb50f('0x3e')][_0xb50f('0x41')]));_0x184963[_0xb50f('0x40')]=_0x184963[_0xb50f('0x40')][_0xb50f('0x42')]?_0x184963[_0xb50f('0x40')]:_0x48daaf[_0xb50f('0x3c')];if(_0x1afbf1[_0xb50f('0x3e')][_0xb50f('0x53')]){_0x184963[_0xb50f('0x4e')]=[{'all':!![]}];}_0x184963=_[_0xb50f('0x4a')]({},_0x184963,_0x1afbf1['options']);return db[_0xb50f('0x4d')]['find'](_0x184963)[_0xb50f('0x20')](handleEntityNotFound(_0x6d4128,null))[_0xb50f('0x20')](respondWithResult(_0x6d4128,null))[_0xb50f('0x50')](handleError(_0x6d4128,null));};exports['create']=function(_0x7eeb7f,_0x31367b){return db[_0xb50f('0x4d')][_0xb50f('0x54')](_0x7eeb7f[_0xb50f('0x55')],{})[_0xb50f('0x20')](respondWithResult(_0x31367b,0xc9))[_0xb50f('0x50')](handleError(_0x31367b,null));};exports[_0xb50f('0x34')]=function(_0x561cbb,_0x3a159f){if(_0x561cbb[_0xb50f('0x55')]['id']){delete _0x561cbb[_0xb50f('0x55')]['id'];}return db[_0xb50f('0x4d')]['find']({'where':{'id':_0x561cbb[_0xb50f('0x51')]['id']}})[_0xb50f('0x20')](handleEntityNotFound(_0x3a159f,null))[_0xb50f('0x20')](saveUpdates(_0x561cbb[_0xb50f('0x55')],null))[_0xb50f('0x20')](respondWithResult(_0x3a159f,null))['catch'](handleError(_0x3a159f,null));};exports[_0xb50f('0x35')]=function(_0x378ad2,_0x50541b){return db['OpenchannelMessage'][_0xb50f('0x56')]({'where':{'id':_0x378ad2[_0xb50f('0x51')]['id']}})['then'](handleEntityNotFound(_0x50541b,null))[_0xb50f('0x20')](removeEntity(_0x50541b,null))[_0xb50f('0x50')](handleError(_0x50541b,null));};exports[_0xb50f('0x57')]=function(_0x97b256,_0x234181){return db[_0xb50f('0x4d')]['describe']()['then'](respondWithResult(_0x234181,null))['catch'](handleError(_0x234181,null));};var interaction_log=require(_0xb50f('0x15'))(_0xb50f('0x58'));exports[_0xb50f('0x59')]=function(_0x6157e3,_0x414a64,_0x4b9e88){var _0xc3329d={'agent':{},'channel':_0xb50f('0x5a')};if(_0x6157e3[_0xb50f('0x55')]['id']){delete _0x6157e3['body']['id'];}_0x6157e3[_0xb50f('0x55')][_0xb50f('0x5b')]=!![];_0x6157e3['body'][_0xb50f('0x5c')]=moment()[_0xb50f('0x5d')](_0xb50f('0x5e'));_0x6157e3[_0xb50f('0x55')]['UserId']=_0x6157e3[_0xb50f('0x55')]['UserId']||_0x6157e3['user']['id'];_0xc3329d[_0xb50f('0x5f')]['id']=_0x6157e3['body'][_0xb50f('0x60')];return db['OpenchannelMessage'][_0xb50f('0x56')]({'where':{'id':_0x6157e3[_0xb50f('0x51')]['id'],'UserId':null}})[_0xb50f('0x20')](handleEntityNotFound(_0x414a64,null))[_0xb50f('0x20')](saveUpdates(_0x6157e3[_0xb50f('0x55')],null))[_0xb50f('0x20')](function(_0x343e79){if(_0x343e79){_0xc3329d[_0xb50f('0x28')]=_0x343e79[_0xb50f('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb50f('0x56')]({'where':{'id':_0x343e79[_0xb50f('0x62')]}});}return null;})[_0xb50f('0x20')](handleEntityNotFound(_0x414a64,null))[_0xb50f('0x20')](function(_0x38dc70){if(_0x38dc70){return _0x38dc70[_0xb50f('0x34')]({'UserId':_0x6157e3[_0xb50f('0x55')][_0xb50f('0x60')],'read1stAt':_['isNil'](_0x38dc70[_0xb50f('0x63')])?moment()[_0xb50f('0x5d')](_0xb50f('0x5e')):undefined});}return null;})[_0xb50f('0x20')](function(_0x472fad){if(_0x472fad){_0xc3329d[_0xb50f('0x64')]=_0x472fad[_0xb50f('0x61')]({'plain':!![]});interaction_log[_0xb50f('0x21')](_0xb50f('0x65'),_0x6157e3[_0xb50f('0x66')]['id'],_0x6157e3[_0xb50f('0x66')][_0xb50f('0x37')],_0x6157e3[_0xb50f('0x66')]['role'],_0xc3329d[_0xb50f('0x64')]['id'],_0x6157e3['body']?JSON[_0xb50f('0x67')](_0x6157e3['body']):_0xb50f('0x68'));return respondWithRpcPromise(_0xb50f('0x69'),_0xb50f('0x6a'),_0xc3329d);}return null;})[_0xb50f('0x20')](function(_0x1a60ee){var _0x44c208=_0xb50f('0x6b')+_0x1a60ee[_0xb50f('0x28')][_0xb50f('0x6c')];return db[_0xb50f('0x6d')][_0xb50f('0x3e')](_0x44c208,{'type':db['Sequelize'][_0xb50f('0x6e')][_0xb50f('0x6f')],'raw':!![]})[_0xb50f('0x20')](function(_0x59dc40){return _0x59dc40;});})[_0xb50f('0x20')](function(_0x2f3605){if(_0x2f3605){_0xc3329d['message'][_0xb50f('0x70')]=_0x2f3605[0x0];if(!_0x6157e3['body'][_0xb50f('0x60')])return;return db[_0xb50f('0x71')][_0xb50f('0x56')]({'where':{'id':_0x6157e3[_0xb50f('0x55')][_0xb50f('0x60')],'role':_0xb50f('0x5f')},'attributes':['id',_0xb50f('0x37'),'fullname',_0xb50f('0x72'),_0xb50f('0x73')],'raw':!![]});}return null;})['then'](function(_0x40671c){if(!_0x40671c)return null;_0xc3329d[_0xb50f('0x28')][_0xb50f('0x5f')]=_0x40671c;return _0xc3329d;})[_0xb50f('0x20')](function(_0x268de1){if(_0x268de1){if(_0x6157e3[_0xb50f('0x55')][_0xb50f('0x74')]){_0xc3329d[_0xb50f('0x28')][_0xb50f('0x75')]=util[_0xb50f('0x5d')](_0xb50f('0x76'),_0x6157e3[_0xb50f('0x66')][_0xb50f('0x37')]);_0xc3329d[_0xb50f('0x28')][_0xb50f('0x77')]=_0xc3329d['channel'];_0xc3329d[_0xb50f('0x28')][_0xb50f('0x78')]=_0xc3329d['channel'];_0xc3329d[_0xb50f('0x28')][_0xb50f('0x79')]=_0xb50f('0x59');return respondWithRpcPromise('EventManager',_0xb50f('0x7a'),{'event':_0xb50f('0x7b'),'message':_0xc3329d[_0xb50f('0x28')]},client9002)['then'](function(){return _0xc3329d;});}return _0xc3329d;}return null;})['then'](respondWithResult(_0x414a64,null))[_0xb50f('0x50')](handleError(_0x414a64,null));};var interaction_log=require(_0xb50f('0x15'))(_0xb50f('0x58'));exports[_0xb50f('0x33')]=function(_0x2731d9,_0x50bb67,_0xf37dd5){var _0x4ea2a9={'agent':{},'channel':_0xb50f('0x5a')};if(_0x2731d9[_0xb50f('0x55')]['id']){delete _0x2731d9[_0xb50f('0x55')]['id'];}_0x2731d9[_0xb50f('0x55')][_0xb50f('0x60')]=_0x2731d9['body'][_0xb50f('0x60')]||_0x2731d9['user']['id'];_0x4ea2a9[_0xb50f('0x5f')]['id']=_0x2731d9[_0xb50f('0x55')]['UserId'];return db['OpenchannelMessage'][_0xb50f('0x56')]({'where':{'id':_0x2731d9[_0xb50f('0x51')]['id'],'UserId':null}})[_0xb50f('0x20')](handleEntityNotFound(_0x50bb67,null))[_0xb50f('0x20')](function(_0x1d1e15){if(_0x1d1e15){_0x4ea2a9[_0xb50f('0x28')]=_0x1d1e15[_0xb50f('0x61')]({'plain':!![]});return db[_0xb50f('0x7c')][_0xb50f('0x56')]({'where':{'id':_0x1d1e15[_0xb50f('0x62')]}});}return null;})[_0xb50f('0x20')](handleEntityNotFound(_0x50bb67,null))['then'](function(_0x44b87b){if(_0x44b87b){_0x4ea2a9[_0xb50f('0x64')]=_0x44b87b[_0xb50f('0x61')]({'plain':!![]});interaction_log[_0xb50f('0x21')](_0xb50f('0x7d'),_0x2731d9[_0xb50f('0x66')]['id'],_0x2731d9[_0xb50f('0x66')]['name'],_0x2731d9[_0xb50f('0x66')]['role'],_0x4ea2a9[_0xb50f('0x64')]['id'],_0x2731d9[_0xb50f('0x55')]?JSON['stringify'](_0x2731d9['body']):'null');return respondWithRpcPromise('RejectMessage',_0xb50f('0x7e'),_0x4ea2a9);}return null;})[_0xb50f('0x20')](function(_0x135a20){var _0x1b482d=_0xb50f('0x6b')+_0x135a20[_0xb50f('0x28')]['ContactId'];return db[_0xb50f('0x6d')][_0xb50f('0x3e')](_0x1b482d,{'type':db[_0xb50f('0x7f')][_0xb50f('0x6e')][_0xb50f('0x6f')],'raw':!![]})[_0xb50f('0x20')](function(_0x39f01a){return _0x39f01a;});})[_0xb50f('0x20')](function(_0xa3d8bb){if(_0xa3d8bb){_0x4ea2a9[_0xb50f('0x28')][_0xb50f('0x70')]=_0xa3d8bb[0x0];if(!_0x2731d9[_0xb50f('0x55')][_0xb50f('0x60')])return;return db[_0xb50f('0x71')][_0xb50f('0x56')]({'where':{'id':_0x2731d9[_0xb50f('0x55')][_0xb50f('0x60')],'role':_0xb50f('0x5f')},'attributes':['id',_0xb50f('0x37'),_0xb50f('0x80'),_0xb50f('0x72'),'internal'],'raw':!![]});}return null;})[_0xb50f('0x20')](function(_0x12c39b){if(!_0x12c39b)return null;_0x4ea2a9[_0xb50f('0x28')][_0xb50f('0x5f')]=_0x12c39b;return _0x4ea2a9;})['then'](function(_0x2ac963){if(_0x2ac963){_0x2ac963[_0xb50f('0x28')][_0xb50f('0x75')]=util[_0xb50f('0x5d')](_0xb50f('0x76'),_0x2731d9[_0xb50f('0x66')][_0xb50f('0x37')]);_0x2ac963[_0xb50f('0x28')][_0xb50f('0x77')]=_0x4ea2a9['channel'];_0x2ac963[_0xb50f('0x28')][_0xb50f('0x78')]=_0x4ea2a9[_0xb50f('0x77')];_0x2ac963['message'][_0xb50f('0x79')]=_0xb50f('0x33');respondWithRpcPromise(_0xb50f('0x7a'),_0xb50f('0x7a'),{'event':'rejectmessage','message':_0x2ac963[_0xb50f('0x28')]},client9002);return _0x4ea2a9;}return null;})[_0xb50f('0x20')](respondWithResult(_0x50bb67,null))[_0xb50f('0x50')](handleError(_0x50bb67,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 44426dd..3f936b3 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 _0x5806=['save','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x2f8530,_0x5cbd67){var _0x5e814e=function(_0x490b29){while(--_0x490b29){_0x2f8530['push'](_0x2f8530['shift']());}};_0x5e814e(++_0x5cbd67);}(_0x5806,0x99));var _0x6580=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x5806[_0x432fca];return _0x3adba4;};'use strict';var EventEmitter=require(_0x6580('0x0'));var OpenchannelMessage=require(_0x6580('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x6580('0x2')](0x0);var events={'afterCreate':_0x6580('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xfe6d13){return function(_0x4a429b,_0x2eb183,_0xf3ea61){OpenchannelMessageEvents[_0x6580('0x4')](_0xfe6d13+':'+_0x4a429b['id'],_0x4a429b);OpenchannelMessageEvents['emit'](_0xfe6d13,_0x4a429b);_0xf3ea61(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x6580('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x5384=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5384,0x1e5));var _0x4538=function(_0x5b54de,_0x4a0432){_0x5b54de=_0x5b54de-0x0;var _0x4d8131=_0x5384[_0x5b54de];return _0x4d8131;};'use strict';var EventEmitter=require(_0x4538('0x0'));var OpenchannelMessage=require(_0x4538('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x4538('0x2')](0x0);var events={'afterCreate':_0x4538('0x3'),'afterUpdate':_0x4538('0x4'),'afterDestroy':_0x4538('0x5')};function emitEvent(_0x4e1eee){return function(_0x4bf8f7,_0x401c9d,_0x1cad6e){OpenchannelMessageEvents[_0x4538('0x6')](_0x4e1eee+':'+_0x4bf8f7['id'],_0x4bf8f7);OpenchannelMessageEvents[_0x4538('0x6')](_0x4e1eee,_0x4bf8f7);_0x1cad6e(null);};}for(var e in events){if(events[_0x4538('0x7')](e)){var event=events[e];OpenchannelMessage[_0x4538('0x8')](e,emitEvent(event));}}module[_0x4538('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index c53b4e5..d5aaf12 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 _0x3380=['GET','format','threadId','catch','error','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','describe','then','OpenchannelAccount','OpenchannelAccountId','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Interactions','length','Interaction','omit','POST'];(function(_0x44eee2,_0x37a131){var _0x3bb1a0=function(_0x4a4f2c){while(--_0x4a4f2c){_0x44eee2['push'](_0x44eee2['shift']());}};_0x3bb1a0(++_0x37a131);}(_0x3380,0x190));var _0x0338=function(_0x425d5b,_0xc3569e){_0x425d5b=_0x425d5b-0x0;var _0x37c9c0=_0x3380[_0x425d5b];return _0x37c9c0;};'use strict';var _=require(_0x0338('0x0'));var util=require('util');var logger=require(_0x0338('0x1'))(_0x0338('0x2'));var moment=require(_0x0338('0x3'));var BPromise=require('bluebird');var rp=require(_0x0338('0x4'));var fs=require('fs');var path=require(_0x0338('0x5'));var rimraf=require(_0x0338('0x6'));var config=require('../../config/environment');var attributes=require(_0x0338('0x7'));module[_0x0338('0x8')]=function(_0x3de2ad,_0x2b0e16){return _0x3de2ad[_0x0338('0x9')](_0x0338('0xa'),attributes,{'tableName':_0x0338('0xb'),'paranoid':![],'indexes':[{'name':_0x0338('0xc'),'fields':[_0x0338('0xd')],'type':_0x0338('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c2541,_0x32dabb,_0x531f51){var _0x2a43a5=_0x3de2ad['models'];var _0x4f41b2=_0x1c2541[_0x0338('0xf')]({'plain':!![]});if(_0x4f41b2[_0x0338('0x10')][_0x0338('0x11')]()==='in'||_0x4f41b2[_0x0338('0x10')][_0x0338('0x11')]()===_0x0338('0x12')&&!_0x4f41b2[_0x0338('0x13')]&&!_[_0x0338('0x14')](_0x4f41b2['UserId'])){_0x2a43a5[_0x0338('0x15')][_0x0338('0x16')]({'where':{'id':_0x4f41b2[_0x0338('0x17')]}})['then'](function(_0x470626){if(_0x470626){_0x470626[_0x0338('0x18')]({'lastMsgAt':_0x4f41b2['createdAt'],'lastMsgDirection':_0x4f41b2[_0x0338('0x10')][_0x0338('0x11')]()});}})['catch'](function(_0x4b0a6c){console['error'](_0x4b0a6c);});}if(_0x4f41b2[_0x0338('0x10')]==='out'&&!_0x4f41b2['secret']){var _0x2f47f7;_0x2a43a5['CmContact'][_0x0338('0x19')]()[_0x0338('0x1a')](function(_0x45ffa3){return _0x2a43a5[_0x0338('0x1b')]['find']({'where':{'id':_0x4f41b2[_0x0338('0x1c')]},'include':[{'model':_0x2a43a5[_0x0338('0x15')],'as':'Interactions','where':{'id':_0x4f41b2[_0x0338('0x17')]},'limit':0x1,'include':[{'model':_0x2a43a5[_0x0338('0x1d')],'as':_0x0338('0x1e'),'attributes':_[_0x0338('0x1f')](_0x45ffa3)}]}]});})[_0x0338('0x1a')](function(_0x406258){_0x2f47f7=_0x406258[_0x0338('0xf')]({'plain':!![]});if(_0x2f47f7&&_0x2f47f7[_0x0338('0x20')]){logger[_0x0338('0x21')](_0x0338('0x22'),_0x0338('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x4f41b2['id'],_0x2f47f7[_0x0338('0x20')]));if(_0x2f47f7[_0x0338('0x24')]&&_0x2f47f7[_0x0338('0x24')][_0x0338('0x25')]){_0x4f41b2[_0x0338('0x26')]=_[_0x0338('0x27')](_0x2f47f7[_0x0338('0x24')][0x0],_0x0338('0x1e'));_0x4f41b2['Contact']=_0x2f47f7[_0x0338('0x24')][0x0]['Contact'];}var _0x32dabb={'method':_0x0338('0x28'),'uri':encodeURI(_0x2f47f7['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x32dabb['method']){case _0x0338('0x29'):_0x32dabb['qs']=_0x4f41b2;break;case _0x0338('0x28'):_0x32dabb[_0x0338('0xd')]=_0x4f41b2;break;}return rp(_0x32dabb)[_0x0338('0x1a')](function(_0x2190b1){logger['info'](_0x0338('0x22'),_0x0338('0x23'),util[_0x0338('0x2a')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4f41b2['id'],_0x2f47f7[_0x0338('0x20')]));if(_0x2190b1['body']['threadId']&&_0x2190b1[_0x0338('0xd')][_0x0338('0x2b')]!=_0x4f41b2[_0x0338('0x26')][_0x0338('0x2b')]){return _0x2a43a5[_0x0338('0x15')][_0x0338('0x18')]({'threadId':_0x2190b1[_0x0338('0xd')][_0x0338('0x2b')]},{'where':{'id':_0x4f41b2[_0x0338('0x26')]['id']}});}else{return;}})[_0x0338('0x1a')](function(){return _0x1c2541[_0x0338('0x18')]({'read':!![]});})[_0x0338('0x2c')](function(_0x2e3941){logger[_0x0338('0x2d')](_0x0338('0x22'),_0x0338('0x23'),util['inspect'](_0x2e3941,{'showHidden':![],'depth':null}));_0x531f51();});}else{_0x531f51();}})[_0x0338('0x2e')](function(){_0x531f51();});}else{_0x531f51();}}},'charset':_0x0338('0x2f'),'collate':_0x0338('0x30')});}; \ No newline at end of file +var _0xf2fe=['finally','lodash','api','moment','request-promise','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','OpenchannelAccountId','OpenchannelInteraction','Interactions','get','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interaction','omit','Contact','POST','method','GET','body','threadId','error','inspect'];(function(_0x2300fa,_0x41c382){var _0x11fef0=function(_0x597ffb){while(--_0x597ffb){_0x2300fa['push'](_0x2300fa['shift']());}};_0x11fef0(++_0x41c382);}(_0xf2fe,0x169));var _0xef2f=function(_0x5c9592,_0x27f77a){_0x5c9592=_0x5c9592-0x0;var _0x2f81f9=_0xf2fe[_0x5c9592];return _0x2f81f9;};'use strict';var _=require(_0xef2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xef2f('0x1'));var moment=require(_0xef2f('0x2'));var BPromise=require('bluebird');var rp=require(_0xef2f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xef2f('0x4'));var attributes=require(_0xef2f('0x5'));module['exports']=function(_0x4c1e39,_0x5753b9){return _0x4c1e39[_0xef2f('0x6')](_0xef2f('0x7'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xef2f('0x8'),'fields':['body'],'type':_0xef2f('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc98ff5,_0x338507,_0x3483ec){var _0x1744dd=_0x4c1e39[_0xef2f('0xa')];var _0x56c375=_0xc98ff5['get']({'plain':!![]});if(_0x56c375[_0xef2f('0xb')][_0xef2f('0xc')]()==='in'||_0x56c375[_0xef2f('0xb')][_0xef2f('0xc')]()===_0xef2f('0xd')&&!_0x56c375[_0xef2f('0xe')]&&!_[_0xef2f('0xf')](_0x56c375['UserId'])){_0x1744dd['OpenchannelInteraction'][_0xef2f('0x10')]({'where':{'id':_0x56c375[_0xef2f('0x11')]}})[_0xef2f('0x12')](function(_0x5e8403){if(_0x5e8403){_0x5e8403[_0xef2f('0x13')]({'lastMsgAt':_0x56c375[_0xef2f('0x14')],'lastMsgDirection':_0x56c375[_0xef2f('0xb')][_0xef2f('0xc')]()});}})[_0xef2f('0x15')](function(_0x2fa5fe){console['error'](_0x2fa5fe);});}if(_0x56c375[_0xef2f('0xb')]===_0xef2f('0xd')&&!_0x56c375[_0xef2f('0xe')]){var _0x5de20f;_0x1744dd[_0xef2f('0x16')][_0xef2f('0x17')]()[_0xef2f('0x12')](function(_0x3f2986){return _0x1744dd['OpenchannelAccount']['find']({'where':{'id':_0x56c375[_0xef2f('0x18')]},'include':[{'model':_0x1744dd[_0xef2f('0x19')],'as':_0xef2f('0x1a'),'where':{'id':_0x56c375[_0xef2f('0x11')]},'limit':0x1,'include':[{'model':_0x1744dd[_0xef2f('0x16')],'as':'Contact','attributes':_['keys'](_0x3f2986)}]}]});})[_0xef2f('0x12')](function(_0x19932d){_0x5de20f=_0x19932d[_0xef2f('0x1b')]({'plain':!![]});if(_0x5de20f&&_0x5de20f['replyUri']){logger[_0xef2f('0x1c')](_0xef2f('0x1d'),_0xef2f('0x1e'),util[_0xef2f('0x1f')](_0xef2f('0x20'),_0x56c375['id'],_0x5de20f[_0xef2f('0x21')]));if(_0x5de20f[_0xef2f('0x1a')]&&_0x5de20f['Interactions']['length']){_0x56c375[_0xef2f('0x22')]=_[_0xef2f('0x23')](_0x5de20f[_0xef2f('0x1a')][0x0],_0xef2f('0x24'));_0x56c375[_0xef2f('0x24')]=_0x5de20f[_0xef2f('0x1a')][0x0][_0xef2f('0x24')];}var _0x338507={'method':_0xef2f('0x25'),'uri':encodeURI(_0x5de20f[_0xef2f('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x338507[_0xef2f('0x26')]){case _0xef2f('0x27'):_0x338507['qs']=_0x56c375;break;case'POST':_0x338507[_0xef2f('0x28')]=_0x56c375;break;}return rp(_0x338507)[_0xef2f('0x12')](function(_0x3dc226){logger[_0xef2f('0x1c')](_0xef2f('0x1d'),'afterCreate',util[_0xef2f('0x1f')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x56c375['id'],_0x5de20f['replyUri']));if(_0x3dc226[_0xef2f('0x28')][_0xef2f('0x29')]&&_0x3dc226['body'][_0xef2f('0x29')]!=_0x56c375[_0xef2f('0x22')][_0xef2f('0x29')]){return _0x1744dd[_0xef2f('0x19')][_0xef2f('0x13')]({'threadId':_0x3dc226['body'][_0xef2f('0x29')]},{'where':{'id':_0x56c375[_0xef2f('0x22')]['id']}});}else{return;}})[_0xef2f('0x12')](function(){return _0xc98ff5[_0xef2f('0x13')]({'read':!![]});})[_0xef2f('0x15')](function(_0x709056){logger[_0xef2f('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0xef2f('0x1e'),util[_0xef2f('0x2b')](_0x709056,{'showHidden':![],'depth':null}));_0x3483ec();});}else{_0x3483ec();}})[_0xef2f('0x2c')](function(){_0x3483ec();});}else{_0x3483ec();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 99bcc2d..a7e6dc7 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x54623d,_0x4f43aa){var _0x56edea=function(_0x3ad9ec){while(--_0x3ad9ec){_0x54623d['push'](_0x54623d['shift']());}};_0x56edea(++_0x4f43aa);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4f9387,_0x302f73){var _0x1098d0=function(_0xe68b2c){while(--_0xe68b2c){_0x4f9387['push'](_0x4f9387['shift']());}};_0x1098d0(++_0x302f73);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5e91da,_0x13f1ea){_0x5e91da=_0x5e91da-0x0;var _0x584c38=_0x5f2f[_0x5e91da];return _0x584c38;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ae78a99..6d614ff 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 _0x7e5f=['./openchannelMessage.events','save','update','emit','removeListener','register','length'];(function(_0x3d4241,_0x5d89ea){var _0x1e4654=function(_0x14039b){while(--_0x14039b){_0x3d4241['push'](_0x3d4241['shift']());}};_0x1e4654(++_0x5d89ea);}(_0x7e5f,0x18f));var _0xf7e5=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x7e5f[_0x455c6c];return _0x488242;};'use strict';var OpenchannelMessageEvents=require(_0xf7e5('0x0'));var events=[_0xf7e5('0x1'),'remove',_0xf7e5('0x2')];function createListener(_0x55917b,_0x27acbf){return function(_0xa3676e){_0x27acbf[_0xf7e5('0x3')](_0x55917b,_0xa3676e);};}function removeListener(_0x597c74,_0x82d6bf){return function(){OpenchannelMessageEvents[_0xf7e5('0x4')](_0x597c74,_0x82d6bf);};}exports[_0xf7e5('0x5')]=function(_0x13e3e5){for(var _0x2fe2cf=0x0,_0x13deaf=events[_0xf7e5('0x6')];_0x2fe2cf<_0x13deaf;_0x2fe2cf++){var _0x57aa1f=events[_0x2fe2cf];var _0x33f5b2=createListener('openchannelMessage:'+_0x57aa1f,_0x13e3e5);OpenchannelMessageEvents['on'](_0x57aa1f,_0x33f5b2);}}; \ No newline at end of file +var _0xf20b=['emit','removeListener','register','length','openchannelMessage:','remove','update'];(function(_0x13b19c,_0xb59e9d){var _0x57d1a3=function(_0x4c7d9c){while(--_0x4c7d9c){_0x13b19c['push'](_0x13b19c['shift']());}};_0x57d1a3(++_0xb59e9d);}(_0xf20b,0x1da));var _0xbf20=function(_0x48f4cd,_0x4ab403){_0x48f4cd=_0x48f4cd-0x0;var _0x5dbc5b=_0xf20b[_0x48f4cd];return _0x5dbc5b;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xbf20('0x0'),_0xbf20('0x1')];function createListener(_0x3e54cd,_0x18c697){return function(_0x15346f){_0x18c697[_0xbf20('0x2')](_0x3e54cd,_0x15346f);};}function removeListener(_0x5404ff,_0x377aba){return function(){OpenchannelMessageEvents[_0xbf20('0x3')](_0x5404ff,_0x377aba);};}exports[_0xbf20('0x4')]=function(_0x5da397){for(var _0xbb3f3c=0x0,_0x410802=events[_0xbf20('0x5')];_0xbb3f3c<_0x410802;_0xbb3f3c++){var _0x3e28d7=events[_0xbb3f3c];var _0x216191=createListener(_0xbf20('0x6')+_0x3e28d7,_0x5da397);OpenchannelMessageEvents['on'](_0x3e28d7,_0x216191);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index b11c947..ef661ce 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 _0x4676=['post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4676,0x6f));var _0x6467=function(_0x1ff2b2,_0x5f1d33){_0x1ff2b2=_0x1ff2b2-0x0;var _0x3eda75=_0x4676[_0x1ff2b2];return _0x3eda75;};'use strict';var multer=require(_0x6467('0x0'));var util=require(_0x6467('0x1'));var path=require(_0x6467('0x2'));var timeout=require(_0x6467('0x3'));var express=require(_0x6467('0x4'));var router=express[_0x6467('0x5')]();var fs_extra=require(_0x6467('0x6'));var auth=require(_0x6467('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6467('0x8'));var controller=require(_0x6467('0x9'));router[_0x6467('0xa')]('/',auth[_0x6467('0xb')](),controller[_0x6467('0xc')]);router[_0x6467('0xa')]('/describe',auth[_0x6467('0xb')](),controller[_0x6467('0xd')]);router[_0x6467('0xa')](_0x6467('0xe'),auth['isAuthenticated'](),controller[_0x6467('0xf')]);router[_0x6467('0xa')](_0x6467('0x10'),auth[_0x6467('0xb')](),controller[_0x6467('0x11')]);router['get'](_0x6467('0x12'),auth['isAuthenticated'](),controller[_0x6467('0x13')]);router[_0x6467('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x6467('0x14')]);router[_0x6467('0x15')]('/',auth['isAuthenticated'](),controller[_0x6467('0x16')]);router[_0x6467('0x15')](_0x6467('0x12'),auth[_0x6467('0xb')](),controller[_0x6467('0x17')]);router[_0x6467('0x15')](_0x6467('0x18'),auth[_0x6467('0xb')](),controller[_0x6467('0x19')]);router[_0x6467('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x6467('0x1b')]);router[_0x6467('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x6467('0x1d')]);router[_0x6467('0x1c')](_0x6467('0x12'),auth['isAuthenticated'](),controller[_0x6467('0x1e')]);router[_0x6467('0x1c')](_0x6467('0x18'),auth[_0x6467('0xb')](),controller[_0x6467('0x1f')]);module[_0x6467('0x20')]=router; \ No newline at end of file +var _0x90c5=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','addTeams','post','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util'];(function(_0x5205f0,_0x2d6b4e){var _0x584640=function(_0x333682){while(--_0x333682){_0x5205f0['push'](_0x5205f0['shift']());}};_0x584640(++_0x2d6b4e);}(_0x90c5,0x178));var _0x590c=function(_0x4ec061,_0x332d18){_0x4ec061=_0x4ec061-0x0;var _0x379807=_0x90c5[_0x4ec061];return _0x379807;};'use strict';var multer=require(_0x590c('0x0'));var util=require(_0x590c('0x1'));var path=require(_0x590c('0x2'));var timeout=require(_0x590c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x590c('0x4'));var interaction=require(_0x590c('0x5'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x590c('0x6')]('/',auth[_0x590c('0x7')](),controller[_0x590c('0x8')]);router[_0x590c('0x6')](_0x590c('0x9'),auth['isAuthenticated'](),controller[_0x590c('0xa')]);router[_0x590c('0x6')](_0x590c('0xb'),auth[_0x590c('0x7')](),controller[_0x590c('0xc')]);router[_0x590c('0x6')](_0x590c('0xd'),auth[_0x590c('0x7')](),controller[_0x590c('0xe')]);router['get'](_0x590c('0xf'),auth[_0x590c('0x7')](),controller[_0x590c('0x10')]);router[_0x590c('0x6')]('/:id/users',auth[_0x590c('0x7')](),controller['getAgents']);router['post']('/',auth[_0x590c('0x7')](),controller['create']);router['post'](_0x590c('0xf'),auth['isAuthenticated'](),controller[_0x590c('0x11')]);router[_0x590c('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x590c('0x13')]);router[_0x590c('0x14')](_0x590c('0xb'),auth['isAuthenticated'](),controller[_0x590c('0x15')]);router[_0x590c('0x16')](_0x590c('0xb'),auth[_0x590c('0x7')](),controller[_0x590c('0x17')]);router[_0x590c('0x16')](_0x590c('0xf'),auth[_0x590c('0x7')](),controller[_0x590c('0x18')]);router[_0x590c('0x16')]('/:id/users',auth[_0x590c('0x7')](),controller[_0x590c('0x19')]);module[_0x590c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 078bd80..1a9193b 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 _0x1ee8=['beepall','sequelize','STRING','name','INTEGER','ENUM'];(function(_0x1317ed,_0x57217d){var _0xbaeca=function(_0x24e517){while(--_0x24e517){_0x1317ed['push'](_0x1317ed['shift']());}};_0xbaeca(++_0x57217d);}(_0x1ee8,0x1c9));var _0x81ee=function(_0x53c167,_0x1db97d){_0x53c167=_0x53c167-0x0;var _0x7ab633=_0x1ee8[_0x53c167];return _0x7ab633;};'use strict';var Sequelize=require(_0x81ee('0x0'));module['exports']={'name':{'type':Sequelize[_0x81ee('0x1')],'unique':_0x81ee('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x81ee('0x1')]},'timeout':{'type':Sequelize[_0x81ee('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x81ee('0x4')]('rrmemory',_0x81ee('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xcaf1=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0xcaf1,0x198));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x1caf('0x0')]={'name':{'type':Sequelize[_0x1caf('0x1')],'unique':_0x1caf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1caf('0x1')]},'timeout':{'type':Sequelize[_0x1caf('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1caf('0x4')](_0x1caf('0x5'),_0x1caf('0x6'),_0x1caf('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index e594a99..f19565c 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 _0x13db=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','map','keys','filters','model','attributes','intersection','fields','length','query','hasOwnProperty','nolimit','limit','sort','where','merge','filter','options','include','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','order','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','pick','addTeams','ids','Agents','online','flatMap','sequelize','transaction','each','forEach','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','emit','userOpenchannelQueue:save','isArray','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x13db,0x19a));var _0xb13d=function(_0x247dfc,_0x344f34){_0x247dfc=_0x247dfc-0x0;var _0x36ef5a=_0x13db[_0x247dfc];return _0x36ef5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb13d('0x0'));var zipdir=require(_0xb13d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb13d('0x2'));var BPromise=require(_0xb13d('0x3'));var Mustache=require(_0xb13d('0x4'));var util=require(_0xb13d('0x5'));var path=require(_0xb13d('0x6'));var sox=require(_0xb13d('0x7'));var csv=require(_0xb13d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb13d('0x9'));var squel=require('squel');var crypto=require(_0xb13d('0xa'));var jsforce=require(_0xb13d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb13d('0xc'));var Redis=require(_0xb13d('0xd'));var authService=require(_0xb13d('0xe'));var qs=require(_0xb13d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb13d('0x10'));var logger=require(_0xb13d('0x11'))(_0xb13d('0x12'));var utils=require(_0xb13d('0x13'));var config=require(_0xb13d('0x14'));var licenseUtil=require(_0xb13d('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb13d('0x16')](config[_0xb13d('0x17')],{'host':_0xb13d('0x18'),'port':0x18eb});var socket=require(_0xb13d('0x19'))(new Redis(config['redis']));require(_0xb13d('0x1a'))[_0xb13d('0x1b')](socket);function respondWithStatusCode(_0x2353a1,_0x10b065){_0x10b065=_0x10b065||0xcc;return function(_0x2caabf){if(_0x2caabf){return _0x2353a1[_0xb13d('0x1c')](_0x10b065);}return _0x2353a1[_0xb13d('0x1d')](_0x10b065)['end']();};}function respondWithResult(_0x46e361,_0x50269f){_0x50269f=_0x50269f||0xc8;return function(_0x4a5687){if(_0x4a5687){return _0x46e361[_0xb13d('0x1d')](_0x50269f)['json'](_0x4a5687);}};}function respondWithFilteredResult(_0x401c82,_0x488f34){return function(_0x4f5744){if(_0x4f5744){var _0x48de75=typeof _0x488f34[_0xb13d('0x1e')]===_0xb13d('0x1f')&&typeof _0x488f34['limit']===_0xb13d('0x1f');var _0x52dcb5=_0x4f5744['count'];var _0x572206=_0x48de75?0x0:_0x488f34[_0xb13d('0x1e')];var _0x4a12a7=_0x48de75?_0x4f5744[_0xb13d('0x20')]:_0x488f34[_0xb13d('0x1e')]+_0x488f34['limit'];var _0x4e1014;if(_0x4a12a7>=_0x52dcb5){_0x4a12a7=_0x52dcb5;_0x4e1014=0xc8;}else{_0x4e1014=0xce;}_0x401c82['status'](_0x4e1014);return _0x401c82[_0xb13d('0x21')]('Content-Range',_0x572206+'-'+_0x4a12a7+'/'+_0x52dcb5)[_0xb13d('0x22')](_0x4f5744);}return null;};}function patchUpdates(_0x470959){return function(_0x1e4232){try{jsonpatch[_0xb13d('0x23')](_0x1e4232,_0x470959,!![]);}catch(_0x27eee9){return BPromise[_0xb13d('0x24')](_0x27eee9);}return _0x1e4232[_0xb13d('0x25')]();};}function saveUpdates(_0xd98dc8,_0x380a50){return function(_0x2b0f91){if(_0x2b0f91){return _0x2b0f91[_0xb13d('0x26')](_0xd98dc8)[_0xb13d('0x27')](function(_0x46d50d){return _0x46d50d;});}return null;};}function removeEntity(_0x153ff6,_0x28eddf){return function(_0x55adc8){if(_0x55adc8){return _0x55adc8[_0xb13d('0x28')]()[_0xb13d('0x27')](function(){var _0x3b5c8c=_0x55adc8[_0xb13d('0x29')]({'plain':!![]});var _0x214124='OpenchannelQueues';return db[_0xb13d('0x2a')]['destroy']({'where':{'type':_0x214124,'resourceId':_0x3b5c8c['id']}})[_0xb13d('0x27')](function(){return _0x55adc8;});})['then'](function(){_0x153ff6[_0xb13d('0x1d')](0xcc)[_0xb13d('0x2b')]();});}};}function handleEntityNotFound(_0x22380d,_0x11f462){return function(_0x24e0bb){if(!_0x24e0bb){_0x22380d['sendStatus'](0x194);}return _0x24e0bb;};}function handleError(_0x4bc75a,_0x237ddd){_0x237ddd=_0x237ddd||0x1f4;return function(_0x468741){logger[_0xb13d('0x2c')](_0x468741[_0xb13d('0x2d')]);if(_0x468741['name']){delete _0x468741[_0xb13d('0x2e')];}_0x4bc75a[_0xb13d('0x1d')](_0x237ddd)[_0xb13d('0x2f')](_0x468741);};}exports[_0xb13d('0x30')]=function(_0xad6b12,_0x3a5a41){var _0x1434f7={},_0x2c1591={},_0x58e941={'count':0x0,'rows':[]};var _0x1205d3=_['map'](db[_0xb13d('0x31')][_0xb13d('0x32')],function(_0x6726d8){return{'name':_0x6726d8[_0xb13d('0x33')],'type':_0x6726d8[_0xb13d('0x34')]['key']};});_0x2c1591['model']=_[_0xb13d('0x35')](_0x1205d3,_0xb13d('0x2e'));_0x2c1591['query']=_[_0xb13d('0x36')](_0xad6b12['query']);_0x2c1591[_0xb13d('0x37')]=_['intersection'](_0x2c1591[_0xb13d('0x38')],_0x2c1591['query']);_0x1434f7[_0xb13d('0x39')]=_[_0xb13d('0x3a')](_0x2c1591[_0xb13d('0x38')],qs['fields'](_0xad6b12['query'][_0xb13d('0x3b')]));_0x1434f7[_0xb13d('0x39')]=_0x1434f7[_0xb13d('0x39')][_0xb13d('0x3c')]?_0x1434f7[_0xb13d('0x39')]:_0x2c1591[_0xb13d('0x38')];if(!_0xad6b12[_0xb13d('0x3d')][_0xb13d('0x3e')](_0xb13d('0x3f'))){_0x1434f7['limit']=qs[_0xb13d('0x40')](_0xad6b12[_0xb13d('0x3d')][_0xb13d('0x40')]);_0x1434f7[_0xb13d('0x1e')]=qs['offset'](_0xad6b12[_0xb13d('0x3d')][_0xb13d('0x1e')]);}_0x1434f7['order']=qs['sort'](_0xad6b12[_0xb13d('0x3d')][_0xb13d('0x41')]);_0x1434f7[_0xb13d('0x42')]=qs[_0xb13d('0x37')](_['pick'](_0xad6b12[_0xb13d('0x3d')],_0x2c1591[_0xb13d('0x37')]),_0x1205d3);if(_0xad6b12[_0xb13d('0x3d')]['filter']){_0x1434f7[_0xb13d('0x42')]=_[_0xb13d('0x43')](_0x1434f7['where'],{'$or':_[_0xb13d('0x35')](_0x1205d3,function(_0x5ecc68){if(_0x5ecc68[_0xb13d('0x34')]!=='VIRTUAL'){var _0x6bdfe9={};_0x6bdfe9[_0x5ecc68['name']]={'$like':'%'+_0xad6b12[_0xb13d('0x3d')][_0xb13d('0x44')]+'%'};return _0x6bdfe9;}})});}_0x1434f7=_[_0xb13d('0x43')]({},_0x1434f7,_0xad6b12[_0xb13d('0x45')]);var _0x2da92b={'where':_0x1434f7[_0xb13d('0x42')]};return db['OpenchannelQueue'][_0xb13d('0x20')](_0x2da92b)[_0xb13d('0x27')](function(_0x5b6082){_0x58e941[_0xb13d('0x20')]=_0x5b6082;if(_0xad6b12['query']['includeAll']){_0x1434f7[_0xb13d('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x1434f7);})[_0xb13d('0x27')](function(_0x17620e){_0x58e941[_0xb13d('0x47')]=_0x17620e;return _0x58e941;})[_0xb13d('0x27')](respondWithFilteredResult(_0x3a5a41,_0x1434f7))[_0xb13d('0x48')](handleError(_0x3a5a41,null));};exports[_0xb13d('0x49')]=function(_0x3ffe3d,_0x4a10e8){var _0x2b9879={'raw':!![],'where':{'id':_0x3ffe3d['params']['id']}},_0x4d5863={};_0x4d5863['model']=_[_0xb13d('0x36')](db[_0xb13d('0x31')][_0xb13d('0x32')]);_0x4d5863[_0xb13d('0x3d')]=_[_0xb13d('0x36')](_0x3ffe3d[_0xb13d('0x3d')]);_0x4d5863['filters']=_['intersection'](_0x4d5863['model'],_0x4d5863[_0xb13d('0x3d')]);_0x2b9879[_0xb13d('0x39')]=_['intersection'](_0x4d5863[_0xb13d('0x38')],qs['fields'](_0x3ffe3d['query'][_0xb13d('0x3b')]));_0x2b9879['attributes']=_0x2b9879['attributes'][_0xb13d('0x3c')]?_0x2b9879['attributes']:_0x4d5863[_0xb13d('0x38')];if(_0x3ffe3d[_0xb13d('0x3d')][_0xb13d('0x4a')]){_0x2b9879[_0xb13d('0x46')]=[{'all':!![]}];}_0x2b9879=_['merge']({},_0x2b9879,_0x3ffe3d['options']);return db[_0xb13d('0x31')]['find'](_0x2b9879)['then'](handleEntityNotFound(_0x4a10e8,null))['then'](respondWithResult(_0x4a10e8,null))[_0xb13d('0x48')](handleError(_0x4a10e8,null));};exports[_0xb13d('0x4b')]=function(_0x321a41,_0x26718c){return db[_0xb13d('0x31')][_0xb13d('0x4b')](_0x321a41[_0xb13d('0x4c')],{})[_0xb13d('0x27')](function(_0x24a2ae){var _0x25bccc=_0x321a41[_0xb13d('0x4d')][_0xb13d('0x29')]({'plain':!![]});if(!_0x25bccc)throw new Error(_0xb13d('0x4e'));if(_0x25bccc[_0xb13d('0x4f')]===_0xb13d('0x4d')){var _0x8e718c=_0x24a2ae[_0xb13d('0x29')]({'plain':!![]});var _0x29cc62=_0xb13d('0x50');return db[_0xb13d('0x51')][_0xb13d('0x52')]({'where':{'name':_0x29cc62,'userProfileId':_0x25bccc[_0xb13d('0x53')]},'raw':!![]})[_0xb13d('0x27')](function(_0x550e2f){if(_0x550e2f&&_0x550e2f['autoAssociation']===0x0){return db[_0xb13d('0x2a')][_0xb13d('0x4b')]({'name':_0x8e718c['name'],'resourceId':_0x8e718c['id'],'type':_0x550e2f['name'],'sectionId':_0x550e2f['id']},{})[_0xb13d('0x27')](function(){return _0x24a2ae;});}else{return _0x24a2ae;}})['catch'](function(_0x88f4fc){logger['error'](_0xb13d('0x54'),_0x88f4fc);throw _0x88f4fc;});}return _0x24a2ae;})[_0xb13d('0x27')](respondWithResult(_0x26718c,0xc9))[_0xb13d('0x48')](handleError(_0x26718c,null));};exports[_0xb13d('0x26')]=function(_0x1c0197,_0x59494d){if(_0x1c0197[_0xb13d('0x4c')]['id']){delete _0x1c0197[_0xb13d('0x4c')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x1c0197[_0xb13d('0x55')]['id']}})[_0xb13d('0x27')](handleEntityNotFound(_0x59494d,null))[_0xb13d('0x27')](saveUpdates(_0x1c0197['body'],null))['then'](respondWithResult(_0x59494d,null))[_0xb13d('0x48')](handleError(_0x59494d,null));};exports[_0xb13d('0x28')]=function(_0x44ad6d,_0x5c3415){return db['OpenchannelQueue'][_0xb13d('0x52')]({'where':{'id':_0x44ad6d['params']['id']}})[_0xb13d('0x27')](handleEntityNotFound(_0x5c3415,null))[_0xb13d('0x27')](removeEntity(_0x5c3415,null))[_0xb13d('0x48')](handleError(_0x5c3415,null));};exports[_0xb13d('0x56')]=function(_0x74ef8,_0x4438b0){return db[_0xb13d('0x31')][_0xb13d('0x56')]()[_0xb13d('0x27')](respondWithResult(_0x4438b0,null))[_0xb13d('0x48')](handleError(_0x4438b0,null));};exports[_0xb13d('0x57')]=function(_0x5f10e2,_0xb04b0c,_0x31a3be){var _0x48a392={'raw':!![],'where':{}},_0x1391c4={},_0x11207f;return db['OpenchannelQueue'][_0xb13d('0x58')]({'where':{'id':_0x5f10e2[_0xb13d('0x55')]['id']}})['then'](handleEntityNotFound(_0xb04b0c,null))[_0xb13d('0x27')](function(_0x35d2e6){if(_0x35d2e6){_0x11207f=_0x35d2e6[_0xb13d('0x29')]({'plain':!![]});_0x1391c4['model']=_[_0xb13d('0x36')](db[_0xb13d('0x59')]['rawAttributes']);_0x1391c4[_0xb13d('0x3d')]=_[_0xb13d('0x36')](_0x5f10e2[_0xb13d('0x3d')]);_0x1391c4[_0xb13d('0x37')]=_[_0xb13d('0x3a')](_0x1391c4[_0xb13d('0x38')],_0x1391c4[_0xb13d('0x3d')]);_0x48a392[_0xb13d('0x39')]=_[_0xb13d('0x3a')](_0x1391c4[_0xb13d('0x38')],qs[_0xb13d('0x3b')](_0x5f10e2[_0xb13d('0x3d')][_0xb13d('0x3b')]));_0x48a392[_0xb13d('0x39')]=_0x48a392[_0xb13d('0x39')][_0xb13d('0x3c')]?_0x48a392['attributes']:_0x1391c4['model'];if(!_0x5f10e2[_0xb13d('0x3d')]['hasOwnProperty'](_0xb13d('0x3f'))){_0x48a392[_0xb13d('0x40')]=qs[_0xb13d('0x40')](_0x5f10e2['query'][_0xb13d('0x40')]);_0x48a392[_0xb13d('0x1e')]=qs[_0xb13d('0x1e')](_0x5f10e2[_0xb13d('0x3d')][_0xb13d('0x1e')]);}_0x48a392[_0xb13d('0x5a')]=qs[_0xb13d('0x41')](_0x5f10e2[_0xb13d('0x3d')]['sort']);_0x48a392[_0xb13d('0x42')]=qs['filters'](_['pick'](_0x5f10e2[_0xb13d('0x3d')],_0x1391c4['filters']));_0x48a392[_0xb13d('0x42')][_0xb13d('0x5b')]=_0x35d2e6['id'];if(_0x5f10e2[_0xb13d('0x3d')][_0xb13d('0x44')]){_0x48a392[_0xb13d('0x42')]=_['merge'](_0x48a392[_0xb13d('0x42')],{'$or':_['map'](_0x48a392['attributes'],function(_0x58088f){var _0x47e12d={};_0x47e12d[_0x58088f]={'$like':'%'+_0x5f10e2['query']['filter']+'%'};return _0x47e12d;})});}_0x48a392=_[_0xb13d('0x43')]({},_0x48a392,_0x5f10e2[_0xb13d('0x45')]);return db['UserOpenchannelQueue'][_0xb13d('0x5c')](_0x48a392);}})['then'](function(_0x1afbd0){if(_0x1afbd0){return db[_0xb13d('0x5d')][_0xb13d('0x5e')]({'where':{'id':_['map'](_0x1afbd0,_0xb13d('0x5f')),'role':_0xb13d('0x60')},'attributes':['id',_0xb13d('0x2e'),_0xb13d('0x61'),'updatedAt',_0xb13d('0x62')]});}})[_0xb13d('0x27')](function(_0x2976ea){if(_0x2976ea){return{'count':_0x2976ea[_0xb13d('0x20')],'rows':_['map'](_0x2976ea[_0xb13d('0x47')],function(_0x43aca2){return{'membername':_0x43aca2[_0xb13d('0x2e')],'UserId':_0x43aca2['id'],'queue_name':_0x11207f[_0xb13d('0x2e')],'OpenchannelQueueId':_0x11207f['id'],'interface':util['format'](_0xb13d('0x63'),_0xb13d('0x64'),_0x43aca2[_0xb13d('0x2e')]),'penalty':0x0,'paused':_0x43aca2[_0xb13d('0x61')],'createdAt':_0x43aca2['createdAt'],'updatedAt':_0x43aca2[_0xb13d('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb13d('0x27')](respondWithFilteredResult(_0xb04b0c,_0x48a392))[_0xb13d('0x48')](handleError(_0xb04b0c,null));};exports[_0xb13d('0x66')]=function(_0x3cddcb,_0x58821d,_0x3f7994){var _0x3f9391={};var _0x30a025={};var _0x3e2691;var _0x1b130f;return db[_0xb13d('0x31')][_0xb13d('0x58')]({'where':{'id':_0x3cddcb['params']['id']}})[_0xb13d('0x27')](handleEntityNotFound(_0x58821d,null))[_0xb13d('0x27')](function(_0x5c6623){if(_0x5c6623){_0x3e2691=_0x5c6623;_0x30a025[_0xb13d('0x38')]=_[_0xb13d('0x36')](db[_0xb13d('0x67')]['rawAttributes']);_0x30a025[_0xb13d('0x3d')]=_[_0xb13d('0x36')](_0x3cddcb[_0xb13d('0x3d')]);_0x30a025['filters']=_['intersection'](_0x30a025[_0xb13d('0x38')],_0x30a025[_0xb13d('0x3d')]);_0x3f9391[_0xb13d('0x39')]=_[_0xb13d('0x3a')](_0x30a025[_0xb13d('0x38')],qs['fields'](_0x3cddcb[_0xb13d('0x3d')][_0xb13d('0x3b')]));_0x3f9391[_0xb13d('0x39')]=_0x3f9391[_0xb13d('0x39')][_0xb13d('0x3c')]?_0x3f9391[_0xb13d('0x39')]:_0x30a025[_0xb13d('0x38')];_0x3f9391[_0xb13d('0x5a')]=qs[_0xb13d('0x41')](_0x3cddcb[_0xb13d('0x3d')][_0xb13d('0x41')]);_0x3f9391[_0xb13d('0x42')]=qs[_0xb13d('0x37')](_[_0xb13d('0x68')](_0x3cddcb[_0xb13d('0x3d')],_0x30a025[_0xb13d('0x37')]));if(_0x3cddcb[_0xb13d('0x3d')][_0xb13d('0x44')]){_0x3f9391[_0xb13d('0x42')]=_[_0xb13d('0x43')](_0x3f9391[_0xb13d('0x42')],{'$or':_[_0xb13d('0x35')](_0x3f9391[_0xb13d('0x39')],function(_0x41526a){var _0x4c10f6={};_0x4c10f6[_0x41526a]={'$like':'%'+_0x3cddcb['query'][_0xb13d('0x44')]+'%'};return _0x4c10f6;})});}_0x3f9391=_[_0xb13d('0x43')]({},_0x3f9391,_0x3cddcb['options']);return _0x3e2691[_0xb13d('0x66')](_0x3f9391);}})[_0xb13d('0x27')](function(_0x371581){if(_0x371581){_0x1b130f=_0x371581[_0xb13d('0x3c')];if(!_0x3cddcb['query'][_0xb13d('0x3e')](_0xb13d('0x3f'))){_0x3f9391['limit']=qs['limit'](_0x3cddcb['query'][_0xb13d('0x40')]);_0x3f9391[_0xb13d('0x1e')]=qs['offset'](_0x3cddcb[_0xb13d('0x3d')][_0xb13d('0x1e')]);}return _0x3e2691['getTeams'](_0x3f9391);}})[_0xb13d('0x27')](function(_0x478b44){if(_0x478b44){return _0x478b44?{'count':_0x1b130f,'rows':_0x478b44}:null;}})[_0xb13d('0x27')](respondWithResult(_0x58821d,null))['catch'](handleError(_0x58821d,null));};exports[_0xb13d('0x69')]=function(_0x18054d,_0x26d5c3,_0x3d310d){var _0x420195=_0x18054d['body'][_0xb13d('0x6a')];return db[_0xb13d('0x67')][_0xb13d('0x5c')]({'where':{'id':_0x420195},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb13d('0x6b'),'attributes':['id',_0xb13d('0x2e'),_0xb13d('0x6c'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0xe73516){if(_0xe73516){var _0x250fe3=_[_0xb13d('0x6d')](_0xe73516,function(_0x1377c4){var _0x43ae7b=_0x1377c4['get']({'plain':!![]});return _0x43ae7b[_0xb13d('0x6b')];});return db[_0xb13d('0x31')][_0xb13d('0x52')]({'where':{'id':_0x18054d[_0xb13d('0x55')]['id']}})[_0xb13d('0x27')](function(_0x241010){return db[_0xb13d('0x6e')][_0xb13d('0x6f')](function(_0x352d2d){return _0x241010[_0xb13d('0x69')](_0x420195,{'transaction':_0x352d2d})[_0xb13d('0x27')](function(){return BPromise[_0xb13d('0x70')](_0x250fe3,function(_0x3eb576){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x3eb576['id'],'OpenchannelQueueId':_0x18054d['params']['id']},'transaction':_0x352d2d});});})[_0xb13d('0x27')](function(){_0x250fe3[_0xb13d('0x71')](function(_0x46078f){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x46078f['id'],'OpenchannelQueueId':_0x241010['id']});});});});});}})[_0xb13d('0x27')](respondWithStatusCode(_0x26d5c3,null))[_0xb13d('0x48')](handleError(_0x26d5c3,null));};exports[_0xb13d('0x72')]=function(_0x38b73b,_0x5be23a,_0x25d299){return db['Team'][_0xb13d('0x5c')]({'where':{'id':_0x38b73b[_0xb13d('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb13d('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xb13d('0x27')](handleEntityNotFound(_0x5be23a,null))[_0xb13d('0x27')](function(_0x5ad39d){var _0x483c8d=_[_0xb13d('0x35')](_0x5ad39d,'id');var _0xb841aa=[];var _0x33a39f=[];var _0x4b9ce0=squel[_0xb13d('0x73')]();_0x4b9ce0[_0xb13d('0x74')](_0xb13d('0x75'))[_0xb13d('0x76')](_0xb13d('0x77'),'tq')[_0xb13d('0x78')](_0xb13d('0x79'),'ut',_0xb13d('0x7a'))[_0xb13d('0x42')]('OpenchannelQueueId\x20=\x20?',_0x38b73b[_0xb13d('0x55')]['id']);for(var _0x10ec09=0x0;_0x10ec09<_0x5ad39d[_0xb13d('0x3c')];_0x10ec09+=0x1){let _0x16acd4=_0x5ad39d[_0x10ec09];for(var _0x21696b=0x0;_0x21696b<_0x16acd4['Agents'][_0xb13d('0x3c')];_0x21696b+=0x1){let _0x6e7414=_0x16acd4[_0xb13d('0x6b')][_0x21696b];var _0x149574=_0x4b9ce0['clone']();_0x149574['where']('ut.UserId\x20=\x20?',_0x6e7414['id']);_0x33a39f[_0xb13d('0x7b')](db[_0xb13d('0x6e')]['query'](_0x149574[_0xb13d('0x7c')](),{'type':db['sequelize'][_0xb13d('0x7d')][_0xb13d('0x7e')]})[_0xb13d('0x27')](function(_0x15fbc0){if(_0x15fbc0['length']===0x1){return _0x6e7414['id'];}else{var _0xd613fa=_[_0xb13d('0x7f')](_[_0xb13d('0x35')](_0x15fbc0,_0xb13d('0x80')),function(_0x4f167f){return _[_0xb13d('0x81')](_0x483c8d,_0x4f167f);});if(_0xd613fa){return _0x6e7414['id'];}}}));}}return BPromise[_0xb13d('0x82')](_0x33a39f)[_0xb13d('0x27')](function(_0x55af1a){_0xb841aa=_(_0xb841aa)[_0xb13d('0x83')](_0x55af1a)[_0xb13d('0x84')]()[_0xb13d('0x85')]();return db[_0xb13d('0x31')][_0xb13d('0x52')]({'where':{'id':_0x38b73b['params']['id']}})[_0xb13d('0x27')](function(_0x12ab22){return db[_0xb13d('0x6e')][_0xb13d('0x6f')](function(_0x5a9929){return _0x12ab22[_0xb13d('0x72')](_0x38b73b[_0xb13d('0x3d')][_0xb13d('0x6a')],{'transaction':_0x5a9929})['then'](function(){if(!_['isEmpty'](_0xb841aa)){return _0x12ab22[_0xb13d('0x86')](_0xb841aa,{'transaction':_0x5a9929});}})[_0xb13d('0x27')](function(){_0xb841aa[_0xb13d('0x71')](function(_0x424997){socket['emit'](_0xb13d('0x87'),{'UserId':_0x424997,'OpenchannelQueueId':_0x12ab22['id']});});});});});});})[_0xb13d('0x27')](respondWithStatusCode(_0x5be23a,null))[_0xb13d('0x48')](handleError(_0x5be23a,null));};exports['addAgents']=function(_0x25b187,_0x39807f,_0x53f559){return db['OpenchannelQueue']['find']({'where':{'id':_0x25b187[_0xb13d('0x55')]['id']}})['then'](handleEntityNotFound(_0x39807f,null))['then'](function(_0x2701a2){if(_0x2701a2){return _0x2701a2[_0xb13d('0x88')](_0x25b187[_0xb13d('0x4c')][_0xb13d('0x6a')],_['omit'](_0x25b187[_0xb13d('0x4c')],[_0xb13d('0x6a'),'id'])||{})['spread'](function(_0xbd0a9d){for(var _0x30515f=0x0;_0x30515f<_0x25b187[_0xb13d('0x4c')][_0xb13d('0x6a')]['length'];_0x30515f+=0x1){socket[_0xb13d('0x89')](_0xb13d('0x8a'),{'UserId':Number(_0x25b187['body']['ids'][_0x30515f]),'OpenchannelQueueId':Number(_0x25b187[_0xb13d('0x55')]['id'])});}return _0xbd0a9d;});}})[_0xb13d('0x27')](respondWithResult(_0x39807f,null))[_0xb13d('0x48')](handleError(_0x39807f,null));};exports[_0xb13d('0x86')]=function(_0x315061,_0x29585e,_0x4eca68){return db['OpenchannelQueue'][_0xb13d('0x52')]({'where':{'id':_0x315061[_0xb13d('0x55')]['id']}})[_0xb13d('0x27')](handleEntityNotFound(_0x29585e,null))['then'](function(_0x4c7774){if(_0x4c7774){return _0x4c7774[_0xb13d('0x86')](_0x315061[_0xb13d('0x3d')][_0xb13d('0x6a')])[_0xb13d('0x27')](function(){if(_[_0xb13d('0x8b')](_0x315061[_0xb13d('0x3d')][_0xb13d('0x6a')])){for(var _0x400c97=0x0;_0x400c97<_0x315061[_0xb13d('0x3d')][_0xb13d('0x6a')]['length'];_0x400c97+=0x1){socket[_0xb13d('0x89')](_0xb13d('0x87'),{'UserId':Number(_0x315061[_0xb13d('0x3d')][_0xb13d('0x6a')][_0x400c97]),'OpenchannelQueueId':Number(_0x315061[_0xb13d('0x55')]['id'])});}}else{socket[_0xb13d('0x89')]('userOpenchannelQueue:remove',{'UserId':Number(_0x315061[_0xb13d('0x3d')][_0xb13d('0x6a')]),'OpenchannelQueueId':Number(_0x315061[_0xb13d('0x55')]['id'])});}});}})[_0xb13d('0x27')](respondWithStatusCode(_0x29585e,null))['catch'](handleError(_0x29585e,null));};exports[_0xb13d('0x8c')]=function(_0x505246,_0xc16b2d,_0x4623ea){var _0x14cf5e={};var _0x33a1ee={};var _0x96c333;var _0x4c48ab;return db[_0xb13d('0x31')][_0xb13d('0x58')]({'where':{'id':_0x505246[_0xb13d('0x55')]['id']}})[_0xb13d('0x27')](handleEntityNotFound(_0xc16b2d,null))[_0xb13d('0x27')](function(_0x54f23d){if(_0x54f23d){_0x96c333=_0x54f23d;_0x33a1ee[_0xb13d('0x38')]=_[_0xb13d('0x36')](db[_0xb13d('0x5d')][_0xb13d('0x32')]);_0x33a1ee[_0xb13d('0x3d')]=_[_0xb13d('0x36')](_0x505246[_0xb13d('0x3d')]);_0x33a1ee[_0xb13d('0x37')]=_['intersection'](_0x33a1ee['model'],_0x33a1ee[_0xb13d('0x3d')]);_0x14cf5e[_0xb13d('0x39')]=_[_0xb13d('0x3a')](_0x33a1ee[_0xb13d('0x38')],qs[_0xb13d('0x3b')](_0x505246[_0xb13d('0x3d')][_0xb13d('0x3b')]));_0x14cf5e[_0xb13d('0x39')]=_0x14cf5e['attributes'][_0xb13d('0x3c')]?_0x14cf5e['attributes']:_0x33a1ee[_0xb13d('0x38')];_0x14cf5e[_0xb13d('0x5a')]=qs[_0xb13d('0x41')](_0x505246[_0xb13d('0x3d')][_0xb13d('0x41')]);_0x14cf5e['where']=qs[_0xb13d('0x37')](_[_0xb13d('0x68')](_0x505246['query'],_0x33a1ee[_0xb13d('0x37')]));if(_0x505246[_0xb13d('0x3d')][_0xb13d('0x44')]){_0x14cf5e[_0xb13d('0x42')]=_[_0xb13d('0x43')](_0x14cf5e[_0xb13d('0x42')],{'$or':_[_0xb13d('0x35')](_0x14cf5e[_0xb13d('0x39')],function(_0xf3e155){var _0x2da2ab={};_0x2da2ab[_0xf3e155]={'$like':'%'+_0x505246[_0xb13d('0x3d')][_0xb13d('0x44')]+'%'};return _0x2da2ab;})});}_0x14cf5e=_[_0xb13d('0x43')]({},_0x14cf5e,_0x505246[_0xb13d('0x45')]);return _0x96c333[_0xb13d('0x8c')](_0x14cf5e);}})[_0xb13d('0x27')](function(_0x1b8c87){if(_0x1b8c87){_0x4c48ab=_0x1b8c87[_0xb13d('0x3c')];if(!_0x505246[_0xb13d('0x3d')]['hasOwnProperty'](_0xb13d('0x3f'))){_0x14cf5e['limit']=qs[_0xb13d('0x40')](_0x505246[_0xb13d('0x3d')]['limit']);_0x14cf5e[_0xb13d('0x1e')]=qs[_0xb13d('0x1e')](_0x505246[_0xb13d('0x3d')][_0xb13d('0x1e')]);}return _0x96c333[_0xb13d('0x8c')](_0x14cf5e);}})['then'](function(_0x44e5f2){if(_0x44e5f2){return _0x44e5f2?{'count':_0x4c48ab,'rows':_0x44e5f2}:null;}})[_0xb13d('0x27')](respondWithResult(_0xc16b2d,null))['catch'](handleError(_0xc16b2d,null));}; \ No newline at end of file +var _0xa618=['isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','limit','offset','count','json','apply','reject','save','update','then','destroy','get','OpenchannelQueues','stack','name','index','map','OpenchannelQueue','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','rawAttributes','fields','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','emit','userOpenchannelQueue:save','select','field','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams'];(function(_0x37b2bf,_0x460061){var _0x2d6b40=function(_0x3b6d7b){while(--_0x3b6d7b){_0x37b2bf['push'](_0x37b2bf['shift']());}};_0x2d6b40(++_0x460061);}(_0xa618,0x123));var _0x8a61=function(_0x4d747b,_0x1757d7){_0x4d747b=_0x4d747b-0x0;var _0x738d87=_0xa618[_0x4d747b];return _0x738d87;};'use strict';var emlformat=require(_0x8a61('0x0'));var rimraf=require(_0x8a61('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8a61('0x2'));var moment=require(_0x8a61('0x3'));var BPromise=require(_0x8a61('0x4'));var Mustache=require(_0x8a61('0x5'));var util=require('util');var path=require(_0x8a61('0x6'));var sox=require(_0x8a61('0x7'));var csv=require(_0x8a61('0x8'));var ejs=require(_0x8a61('0x9'));var fs=require('fs');var fs_extra=require(_0x8a61('0xa'));var _=require(_0x8a61('0xb'));var squel=require(_0x8a61('0xc'));var crypto=require(_0x8a61('0xd'));var jsforce=require(_0x8a61('0xe'));var deskjs=require(_0x8a61('0xf'));var toCsv=require(_0x8a61('0x8'));var querystring=require(_0x8a61('0x10'));var Papa=require('papaparse');var Redis=require(_0x8a61('0x11'));var authService=require(_0x8a61('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8a61('0x13'));var hardwareService=require(_0x8a61('0x14'));var logger=require('../../config/logger')(_0x8a61('0x15'));var utils=require('../../config/utils');var config=require(_0x8a61('0x16'));var licenseUtil=require(_0x8a61('0x17'));var db=require(_0x8a61('0x18'))['db'];config[_0x8a61('0x19')]=_[_0x8a61('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8a61('0x1b'))(new Redis(config[_0x8a61('0x19')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x23b003,_0xff1c4e){_0xff1c4e=_0xff1c4e||0xcc;return function(_0x3b5555){if(_0x3b5555){return _0x23b003[_0x8a61('0x1c')](_0xff1c4e);}return _0x23b003[_0x8a61('0x1d')](_0xff1c4e)[_0x8a61('0x1e')]();};}function respondWithResult(_0x41bfd8,_0x519b5b){_0x519b5b=_0x519b5b||0xc8;return function(_0x4a903e){if(_0x4a903e){return _0x41bfd8[_0x8a61('0x1d')](_0x519b5b)['json'](_0x4a903e);}};}function respondWithFilteredResult(_0x4ff160,_0x51891a){return function(_0x480472){if(_0x480472){var _0x1f9194=typeof _0x51891a['offset']==='undefined'&&typeof _0x51891a[_0x8a61('0x1f')]==='undefined';var _0x446790=_0x480472['count'];var _0x27c5a5=_0x1f9194?0x0:_0x51891a[_0x8a61('0x20')];var _0x55a50c=_0x1f9194?_0x480472[_0x8a61('0x21')]:_0x51891a[_0x8a61('0x20')]+_0x51891a[_0x8a61('0x1f')];var _0x3121dd;if(_0x55a50c>=_0x446790){_0x55a50c=_0x446790;_0x3121dd=0xc8;}else{_0x3121dd=0xce;}_0x4ff160[_0x8a61('0x1d')](_0x3121dd);return _0x4ff160['set']('Content-Range',_0x27c5a5+'-'+_0x55a50c+'/'+_0x446790)[_0x8a61('0x22')](_0x480472);}return null;};}function patchUpdates(_0x552e41){return function(_0x483a86){try{jsonpatch[_0x8a61('0x23')](_0x483a86,_0x552e41,!![]);}catch(_0xb4ff6b){return BPromise[_0x8a61('0x24')](_0xb4ff6b);}return _0x483a86[_0x8a61('0x25')]();};}function saveUpdates(_0x9f9331,_0x33b828){return function(_0x3fb9c5){if(_0x3fb9c5){return _0x3fb9c5[_0x8a61('0x26')](_0x9f9331)[_0x8a61('0x27')](function(_0x460171){return _0x460171;});}return null;};}function removeEntity(_0xac05b2,_0x50fac3){return function(_0x7b036f){if(_0x7b036f){return _0x7b036f[_0x8a61('0x28')]()[_0x8a61('0x27')](function(){var _0x2b9d43=_0x7b036f[_0x8a61('0x29')]({'plain':!![]});var _0x3bd771=_0x8a61('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x3bd771,'resourceId':_0x2b9d43['id']}})[_0x8a61('0x27')](function(){return _0x7b036f;});})[_0x8a61('0x27')](function(){_0xac05b2[_0x8a61('0x1d')](0xcc)[_0x8a61('0x1e')]();});}};}function handleEntityNotFound(_0x323f1f,_0xd6c8fc){return function(_0x490822){if(!_0x490822){_0x323f1f['sendStatus'](0x194);}return _0x490822;};}function handleError(_0x5eef50,_0xad89c7){_0xad89c7=_0xad89c7||0x1f4;return function(_0x376f03){logger['error'](_0x376f03[_0x8a61('0x2b')]);if(_0x376f03[_0x8a61('0x2c')]){delete _0x376f03['name'];}_0x5eef50[_0x8a61('0x1d')](_0xad89c7)['send'](_0x376f03);};}exports[_0x8a61('0x2d')]=function(_0x168512,_0x4edacd){var _0x5982e9={},_0x4479ac={},_0x1511d6={'count':0x0,'rows':[]};var _0x3f0580=_[_0x8a61('0x2e')](db[_0x8a61('0x2f')]['rawAttributes'],function(_0x20aab6){return{'name':_0x20aab6['fieldName'],'type':_0x20aab6[_0x8a61('0x30')][_0x8a61('0x31')]};});_0x4479ac[_0x8a61('0x32')]=_['map'](_0x3f0580,_0x8a61('0x2c'));_0x4479ac['query']=_[_0x8a61('0x33')](_0x168512[_0x8a61('0x34')]);_0x4479ac[_0x8a61('0x35')]=_[_0x8a61('0x36')](_0x4479ac[_0x8a61('0x32')],_0x4479ac[_0x8a61('0x34')]);_0x5982e9[_0x8a61('0x37')]=_[_0x8a61('0x36')](_0x4479ac[_0x8a61('0x32')],qs['fields'](_0x168512[_0x8a61('0x34')]['fields']));_0x5982e9['attributes']=_0x5982e9[_0x8a61('0x37')][_0x8a61('0x38')]?_0x5982e9[_0x8a61('0x37')]:_0x4479ac['model'];if(!_0x168512['query'][_0x8a61('0x39')]('nolimit')){_0x5982e9[_0x8a61('0x1f')]=qs[_0x8a61('0x1f')](_0x168512[_0x8a61('0x34')]['limit']);_0x5982e9[_0x8a61('0x20')]=qs[_0x8a61('0x20')](_0x168512[_0x8a61('0x34')][_0x8a61('0x20')]);}_0x5982e9[_0x8a61('0x3a')]=qs['sort'](_0x168512['query'][_0x8a61('0x3b')]);_0x5982e9[_0x8a61('0x3c')]=qs['filters'](_[_0x8a61('0x3d')](_0x168512[_0x8a61('0x34')],_0x4479ac[_0x8a61('0x35')]),_0x3f0580);if(_0x168512[_0x8a61('0x34')][_0x8a61('0x3e')]){_0x5982e9['where']=_[_0x8a61('0x3f')](_0x5982e9[_0x8a61('0x3c')],{'$or':_[_0x8a61('0x2e')](_0x3f0580,function(_0x1c299a){if(_0x1c299a[_0x8a61('0x30')]!=='VIRTUAL'){var _0xffeea7={};_0xffeea7[_0x1c299a[_0x8a61('0x2c')]]={'$like':'%'+_0x168512[_0x8a61('0x34')][_0x8a61('0x3e')]+'%'};return _0xffeea7;}})});}_0x5982e9=_[_0x8a61('0x3f')]({},_0x5982e9,_0x168512[_0x8a61('0x40')]);var _0x4f0291={'where':_0x5982e9[_0x8a61('0x3c')]};return db[_0x8a61('0x2f')][_0x8a61('0x21')](_0x4f0291)[_0x8a61('0x27')](function(_0x5dda0c){_0x1511d6[_0x8a61('0x21')]=_0x5dda0c;if(_0x168512[_0x8a61('0x34')]['includeAll']){_0x5982e9[_0x8a61('0x41')]=[{'all':!![]}];}return db[_0x8a61('0x2f')][_0x8a61('0x42')](_0x5982e9);})[_0x8a61('0x27')](function(_0x4392c3){_0x1511d6['rows']=_0x4392c3;return _0x1511d6;})[_0x8a61('0x27')](respondWithFilteredResult(_0x4edacd,_0x5982e9))[_0x8a61('0x43')](handleError(_0x4edacd,null));};exports[_0x8a61('0x44')]=function(_0x5a1ba4,_0x1bd732){var _0x4b48f2={'raw':!![],'where':{'id':_0x5a1ba4[_0x8a61('0x45')]['id']}},_0x7fa6dd={};_0x7fa6dd[_0x8a61('0x32')]=_[_0x8a61('0x33')](db[_0x8a61('0x2f')][_0x8a61('0x46')]);_0x7fa6dd[_0x8a61('0x34')]=_['keys'](_0x5a1ba4[_0x8a61('0x34')]);_0x7fa6dd[_0x8a61('0x35')]=_['intersection'](_0x7fa6dd[_0x8a61('0x32')],_0x7fa6dd[_0x8a61('0x34')]);_0x4b48f2[_0x8a61('0x37')]=_[_0x8a61('0x36')](_0x7fa6dd[_0x8a61('0x32')],qs[_0x8a61('0x47')](_0x5a1ba4[_0x8a61('0x34')]['fields']));_0x4b48f2[_0x8a61('0x37')]=_0x4b48f2[_0x8a61('0x37')][_0x8a61('0x38')]?_0x4b48f2['attributes']:_0x7fa6dd[_0x8a61('0x32')];if(_0x5a1ba4[_0x8a61('0x34')][_0x8a61('0x48')]){_0x4b48f2['include']=[{'all':!![]}];}_0x4b48f2=_[_0x8a61('0x3f')]({},_0x4b48f2,_0x5a1ba4[_0x8a61('0x40')]);return db[_0x8a61('0x2f')][_0x8a61('0x49')](_0x4b48f2)['then'](handleEntityNotFound(_0x1bd732,null))[_0x8a61('0x27')](respondWithResult(_0x1bd732,null))['catch'](handleError(_0x1bd732,null));};exports[_0x8a61('0x4a')]=function(_0x35abbf,_0x347a94){return db[_0x8a61('0x2f')][_0x8a61('0x4a')](_0x35abbf[_0x8a61('0x4b')],{})[_0x8a61('0x27')](function(_0x3e769c){var _0x483a19=_0x35abbf['user']['get']({'plain':!![]});if(!_0x483a19)throw new Error(_0x8a61('0x4c'));if(_0x483a19[_0x8a61('0x4d')]===_0x8a61('0x4e')){var _0x3c4b2e=_0x3e769c[_0x8a61('0x29')]({'plain':!![]});var _0x4cde31=_0x8a61('0x2a');return db[_0x8a61('0x4f')][_0x8a61('0x49')]({'where':{'name':_0x4cde31,'userProfileId':_0x483a19[_0x8a61('0x50')]},'raw':!![]})['then'](function(_0x3a56cf){if(_0x3a56cf&&_0x3a56cf[_0x8a61('0x51')]===0x0){return db['UserProfileResource'][_0x8a61('0x4a')]({'name':_0x3c4b2e[_0x8a61('0x2c')],'resourceId':_0x3c4b2e['id'],'type':_0x3a56cf[_0x8a61('0x2c')],'sectionId':_0x3a56cf['id']},{})[_0x8a61('0x27')](function(){return _0x3e769c;});}else{return _0x3e769c;}})[_0x8a61('0x43')](function(_0x5c1c70){logger[_0x8a61('0x52')](_0x8a61('0x53'),_0x5c1c70);throw _0x5c1c70;});}return _0x3e769c;})[_0x8a61('0x27')](respondWithResult(_0x347a94,0xc9))['catch'](handleError(_0x347a94,null));};exports[_0x8a61('0x26')]=function(_0x1b1422,_0x288d23){if(_0x1b1422[_0x8a61('0x4b')]['id']){delete _0x1b1422[_0x8a61('0x4b')]['id'];}return db[_0x8a61('0x2f')]['find']({'where':{'id':_0x1b1422['params']['id']}})['then'](handleEntityNotFound(_0x288d23,null))[_0x8a61('0x27')](saveUpdates(_0x1b1422['body'],null))[_0x8a61('0x27')](respondWithResult(_0x288d23,null))[_0x8a61('0x43')](handleError(_0x288d23,null));};exports[_0x8a61('0x28')]=function(_0x4b5a0d,_0xbb5384){return db['OpenchannelQueue'][_0x8a61('0x49')]({'where':{'id':_0x4b5a0d[_0x8a61('0x45')]['id']}})[_0x8a61('0x27')](handleEntityNotFound(_0xbb5384,null))[_0x8a61('0x27')](removeEntity(_0xbb5384,null))[_0x8a61('0x43')](handleError(_0xbb5384,null));};exports[_0x8a61('0x54')]=function(_0x4f4dfc,_0x1a7526){return db[_0x8a61('0x2f')][_0x8a61('0x54')]()[_0x8a61('0x27')](respondWithResult(_0x1a7526,null))['catch'](handleError(_0x1a7526,null));};exports[_0x8a61('0x55')]=function(_0x72990,_0x4fe26a,_0x2dbf3d){var _0x31fb26={'raw':!![],'where':{}},_0x1a5d60={},_0xbfd8af;return db[_0x8a61('0x2f')][_0x8a61('0x56')]({'where':{'id':_0x72990['params']['id']}})[_0x8a61('0x27')](handleEntityNotFound(_0x4fe26a,null))[_0x8a61('0x27')](function(_0x5c6b84){if(_0x5c6b84){_0xbfd8af=_0x5c6b84[_0x8a61('0x29')]({'plain':!![]});_0x1a5d60[_0x8a61('0x32')]=_[_0x8a61('0x33')](db['UserOpenchannelQueue'][_0x8a61('0x46')]);_0x1a5d60[_0x8a61('0x34')]=_[_0x8a61('0x33')](_0x72990[_0x8a61('0x34')]);_0x1a5d60['filters']=_[_0x8a61('0x36')](_0x1a5d60[_0x8a61('0x32')],_0x1a5d60[_0x8a61('0x34')]);_0x31fb26['attributes']=_['intersection'](_0x1a5d60['model'],qs['fields'](_0x72990[_0x8a61('0x34')]['fields']));_0x31fb26[_0x8a61('0x37')]=_0x31fb26[_0x8a61('0x37')][_0x8a61('0x38')]?_0x31fb26[_0x8a61('0x37')]:_0x1a5d60[_0x8a61('0x32')];if(!_0x72990[_0x8a61('0x34')][_0x8a61('0x39')](_0x8a61('0x57'))){_0x31fb26[_0x8a61('0x1f')]=qs[_0x8a61('0x1f')](_0x72990[_0x8a61('0x34')]['limit']);_0x31fb26['offset']=qs[_0x8a61('0x20')](_0x72990[_0x8a61('0x34')][_0x8a61('0x20')]);}_0x31fb26[_0x8a61('0x3a')]=qs[_0x8a61('0x3b')](_0x72990[_0x8a61('0x34')][_0x8a61('0x3b')]);_0x31fb26[_0x8a61('0x3c')]=qs[_0x8a61('0x35')](_[_0x8a61('0x3d')](_0x72990[_0x8a61('0x34')],_0x1a5d60['filters']));_0x31fb26[_0x8a61('0x3c')][_0x8a61('0x58')]=_0x5c6b84['id'];if(_0x72990[_0x8a61('0x34')][_0x8a61('0x3e')]){_0x31fb26['where']=_[_0x8a61('0x3f')](_0x31fb26['where'],{'$or':_[_0x8a61('0x2e')](_0x31fb26[_0x8a61('0x37')],function(_0xebaf3e){var _0x3dd7e9={};_0x3dd7e9[_0xebaf3e]={'$like':'%'+_0x72990['query'][_0x8a61('0x3e')]+'%'};return _0x3dd7e9;})});}_0x31fb26=_['merge']({},_0x31fb26,_0x72990[_0x8a61('0x40')]);return db[_0x8a61('0x59')][_0x8a61('0x42')](_0x31fb26);}})[_0x8a61('0x27')](function(_0x30215e){if(_0x30215e){return db[_0x8a61('0x5a')][_0x8a61('0x5b')]({'where':{'id':_[_0x8a61('0x2e')](_0x30215e,_0x8a61('0x5c')),'role':_0x8a61('0x5d')},'attributes':['id',_0x8a61('0x2c'),'openchannelPause',_0x8a61('0x5e'),_0x8a61('0x5f')]});}})[_0x8a61('0x27')](function(_0x16c466){if(_0x16c466){return{'count':_0x16c466[_0x8a61('0x21')],'rows':_['map'](_0x16c466['rows'],function(_0x304dda){return{'membername':_0x304dda[_0x8a61('0x2c')],'UserId':_0x304dda['id'],'queue_name':_0xbfd8af[_0x8a61('0x2c')],'OpenchannelQueueId':_0xbfd8af['id'],'interface':util[_0x8a61('0x60')](_0x8a61('0x61'),_0x8a61('0x62'),_0x304dda[_0x8a61('0x2c')]),'penalty':0x0,'paused':_0x304dda[_0x8a61('0x63')],'createdAt':_0x304dda[_0x8a61('0x5f')],'updatedAt':_0x304dda['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8a61('0x27')](respondWithFilteredResult(_0x4fe26a,_0x31fb26))[_0x8a61('0x43')](handleError(_0x4fe26a,null));};exports[_0x8a61('0x64')]=function(_0x3f58d4,_0xc49f61,_0x1ad6af){var _0x333d88={};var _0x9ca7fa={};var _0x5a1804;var _0x2b5cf9;return db[_0x8a61('0x2f')][_0x8a61('0x56')]({'where':{'id':_0x3f58d4[_0x8a61('0x45')]['id']}})[_0x8a61('0x27')](handleEntityNotFound(_0xc49f61,null))['then'](function(_0x53b15a){if(_0x53b15a){_0x5a1804=_0x53b15a;_0x9ca7fa[_0x8a61('0x32')]=_['keys'](db['Team'][_0x8a61('0x46')]);_0x9ca7fa[_0x8a61('0x34')]=_[_0x8a61('0x33')](_0x3f58d4[_0x8a61('0x34')]);_0x9ca7fa[_0x8a61('0x35')]=_['intersection'](_0x9ca7fa[_0x8a61('0x32')],_0x9ca7fa['query']);_0x333d88[_0x8a61('0x37')]=_['intersection'](_0x9ca7fa[_0x8a61('0x32')],qs[_0x8a61('0x47')](_0x3f58d4[_0x8a61('0x34')][_0x8a61('0x47')]));_0x333d88[_0x8a61('0x37')]=_0x333d88['attributes']['length']?_0x333d88[_0x8a61('0x37')]:_0x9ca7fa[_0x8a61('0x32')];_0x333d88[_0x8a61('0x3a')]=qs['sort'](_0x3f58d4[_0x8a61('0x34')][_0x8a61('0x3b')]);_0x333d88[_0x8a61('0x3c')]=qs[_0x8a61('0x35')](_[_0x8a61('0x3d')](_0x3f58d4['query'],_0x9ca7fa[_0x8a61('0x35')]));if(_0x3f58d4[_0x8a61('0x34')][_0x8a61('0x3e')]){_0x333d88[_0x8a61('0x3c')]=_[_0x8a61('0x3f')](_0x333d88[_0x8a61('0x3c')],{'$or':_[_0x8a61('0x2e')](_0x333d88[_0x8a61('0x37')],function(_0x235f8f){var _0x4c8e91={};_0x4c8e91[_0x235f8f]={'$like':'%'+_0x3f58d4[_0x8a61('0x34')]['filter']+'%'};return _0x4c8e91;})});}_0x333d88=_[_0x8a61('0x3f')]({},_0x333d88,_0x3f58d4[_0x8a61('0x40')]);return _0x5a1804['getTeams'](_0x333d88);}})[_0x8a61('0x27')](function(_0x37305f){if(_0x37305f){_0x2b5cf9=_0x37305f[_0x8a61('0x38')];if(!_0x3f58d4['query'][_0x8a61('0x39')]('nolimit')){_0x333d88['limit']=qs[_0x8a61('0x1f')](_0x3f58d4['query'][_0x8a61('0x1f')]);_0x333d88[_0x8a61('0x20')]=qs[_0x8a61('0x20')](_0x3f58d4[_0x8a61('0x34')][_0x8a61('0x20')]);}return _0x5a1804[_0x8a61('0x64')](_0x333d88);}})['then'](function(_0x3b1356){if(_0x3b1356){return _0x3b1356?{'count':_0x2b5cf9,'rows':_0x3b1356}:null;}})['then'](respondWithResult(_0xc49f61,null))['catch'](handleError(_0xc49f61,null));};exports['addTeams']=function(_0x1fbeae,_0x4f9893,_0xa4f216){var _0x2474f3=_0x1fbeae[_0x8a61('0x4b')][_0x8a61('0x65')];return db[_0x8a61('0x66')][_0x8a61('0x42')]({'where':{'id':_0x2474f3},'attributes':['id'],'include':[{'model':db[_0x8a61('0x5a')],'as':'Agents','attributes':['id',_0x8a61('0x2c'),_0x8a61('0x67'),_0x8a61('0x68'),_0x8a61('0x69')],'raw':!![]}]})['then'](function(_0x2f02f1){if(_0x2f02f1){var _0x3fe5af=_[_0x8a61('0x6a')](_0x2f02f1,function(_0x2aac8d){var _0x3a5ba9=_0x2aac8d['get']({'plain':!![]});return _0x3a5ba9[_0x8a61('0x6b')];});return db['OpenchannelQueue'][_0x8a61('0x49')]({'where':{'id':_0x1fbeae[_0x8a61('0x45')]['id']}})['then'](function(_0x1a8bb3){return db[_0x8a61('0x6c')][_0x8a61('0x6d')](function(_0x20971d){return _0x1a8bb3[_0x8a61('0x6e')](_0x2474f3,{'transaction':_0x20971d})['then'](function(){return BPromise[_0x8a61('0x6f')](_0x3fe5af,function(_0x116958){return db[_0x8a61('0x59')][_0x8a61('0x70')]({'where':{'UserId':_0x116958['id'],'OpenchannelQueueId':_0x1fbeae[_0x8a61('0x45')]['id']},'transaction':_0x20971d});});})[_0x8a61('0x27')](function(){_0x3fe5af['forEach'](function(_0x101487){socket[_0x8a61('0x71')](_0x8a61('0x72'),{'UserId':_0x101487['id'],'OpenchannelQueueId':_0x1a8bb3['id']});});});});});}})[_0x8a61('0x27')](respondWithStatusCode(_0x4f9893,null))[_0x8a61('0x43')](handleError(_0x4f9893,null));};exports['removeTeams']=function(_0x11f3ea,_0x2de761,_0x350553){return db[_0x8a61('0x66')][_0x8a61('0x42')]({'where':{'id':_0x11f3ea[_0x8a61('0x34')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8a61('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x8a61('0x27')](handleEntityNotFound(_0x2de761,null))['then'](function(_0x2feaf2){var _0x6a29aa=_[_0x8a61('0x2e')](_0x2feaf2,'id');var _0x54dfdd=[];var _0x4970b7=[];var _0x1d765d=squel[_0x8a61('0x73')]();_0x1d765d[_0x8a61('0x74')]('tq.TeamId')[_0x8a61('0x75')](_0x8a61('0x76'),'tq')['join'](_0x8a61('0x77'),'ut',_0x8a61('0x78'))[_0x8a61('0x3c')]('OpenchannelQueueId\x20=\x20?',_0x11f3ea['params']['id']);for(var _0x18cb15=0x0;_0x18cb15<_0x2feaf2['length'];_0x18cb15+=0x1){let _0x2f3bb2=_0x2feaf2[_0x18cb15];for(var _0x20234f=0x0;_0x20234f<_0x2f3bb2[_0x8a61('0x6b')][_0x8a61('0x38')];_0x20234f+=0x1){let _0x1571bb=_0x2f3bb2[_0x8a61('0x6b')][_0x20234f];var _0x15b8b1=_0x1d765d['clone']();_0x15b8b1['where'](_0x8a61('0x79'),_0x1571bb['id']);_0x4970b7[_0x8a61('0x7a')](db[_0x8a61('0x6c')][_0x8a61('0x34')](_0x15b8b1['toString'](),{'type':db[_0x8a61('0x6c')][_0x8a61('0x7b')][_0x8a61('0x7c')]})['then'](function(_0x4b7f41){if(_0x4b7f41['length']===0x1){return _0x1571bb['id'];}else{var _0x10538d=_[_0x8a61('0x7d')](_[_0x8a61('0x2e')](_0x4b7f41,_0x8a61('0x7e')),function(_0x185cf7){return _['includes'](_0x6a29aa,_0x185cf7);});if(_0x10538d){return _0x1571bb['id'];}}}));}}return BPromise[_0x8a61('0x7f')](_0x4970b7)['then'](function(_0x3d93a4){_0x54dfdd=_(_0x54dfdd)[_0x8a61('0x80')](_0x3d93a4)[_0x8a61('0x81')]()[_0x8a61('0x82')]();return db['OpenchannelQueue'][_0x8a61('0x49')]({'where':{'id':_0x11f3ea[_0x8a61('0x45')]['id']}})['then'](function(_0x40e2cd){return db['sequelize'][_0x8a61('0x6d')](function(_0x53cedf){return _0x40e2cd[_0x8a61('0x83')](_0x11f3ea['query'][_0x8a61('0x65')],{'transaction':_0x53cedf})['then'](function(){if(!_[_0x8a61('0x84')](_0x54dfdd)){return _0x40e2cd[_0x8a61('0x85')](_0x54dfdd,{'transaction':_0x53cedf});}})['then'](function(){_0x54dfdd[_0x8a61('0x86')](function(_0x56b810){socket['emit'](_0x8a61('0x87'),{'UserId':_0x56b810,'OpenchannelQueueId':_0x40e2cd['id']});});});});});});})[_0x8a61('0x27')](respondWithStatusCode(_0x2de761,null))[_0x8a61('0x43')](handleError(_0x2de761,null));};exports[_0x8a61('0x88')]=function(_0x5e46d3,_0x21d3f2,_0x3b9f88){return db[_0x8a61('0x2f')]['find']({'where':{'id':_0x5e46d3[_0x8a61('0x45')]['id']}})[_0x8a61('0x27')](handleEntityNotFound(_0x21d3f2,null))[_0x8a61('0x27')](function(_0x14d341){if(_0x14d341){return _0x14d341[_0x8a61('0x88')](_0x5e46d3['body'][_0x8a61('0x65')],_[_0x8a61('0x89')](_0x5e46d3[_0x8a61('0x4b')],[_0x8a61('0x65'),'id'])||{})[_0x8a61('0x8a')](function(_0x571f41){for(var _0x30b51d=0x0;_0x30b51d<_0x5e46d3[_0x8a61('0x4b')][_0x8a61('0x65')][_0x8a61('0x38')];_0x30b51d+=0x1){socket[_0x8a61('0x71')](_0x8a61('0x72'),{'UserId':Number(_0x5e46d3[_0x8a61('0x4b')][_0x8a61('0x65')][_0x30b51d]),'OpenchannelQueueId':Number(_0x5e46d3[_0x8a61('0x45')]['id'])});}return _0x571f41;});}})[_0x8a61('0x27')](respondWithResult(_0x21d3f2,null))[_0x8a61('0x43')](handleError(_0x21d3f2,null));};exports[_0x8a61('0x85')]=function(_0x5783cf,_0x2963f3,_0x534650){return db[_0x8a61('0x2f')][_0x8a61('0x49')]({'where':{'id':_0x5783cf[_0x8a61('0x45')]['id']}})['then'](handleEntityNotFound(_0x2963f3,null))[_0x8a61('0x27')](function(_0x23a03c){if(_0x23a03c){return _0x23a03c[_0x8a61('0x85')](_0x5783cf[_0x8a61('0x34')][_0x8a61('0x65')])[_0x8a61('0x27')](function(){if(_[_0x8a61('0x8b')](_0x5783cf[_0x8a61('0x34')][_0x8a61('0x65')])){for(var _0x20467f=0x0;_0x20467f<_0x5783cf['query'][_0x8a61('0x65')]['length'];_0x20467f+=0x1){socket[_0x8a61('0x71')](_0x8a61('0x87'),{'UserId':Number(_0x5783cf['query'][_0x8a61('0x65')][_0x20467f]),'OpenchannelQueueId':Number(_0x5783cf[_0x8a61('0x45')]['id'])});}}else{socket[_0x8a61('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x5783cf[_0x8a61('0x34')][_0x8a61('0x65')]),'OpenchannelQueueId':Number(_0x5783cf[_0x8a61('0x45')]['id'])});}});}})[_0x8a61('0x27')](respondWithStatusCode(_0x2963f3,null))[_0x8a61('0x43')](handleError(_0x2963f3,null));};exports['getAgents']=function(_0x2c485b,_0x3fedf5,_0xe00506){var _0x9df1eb={};var _0x5a43b1={};var _0x5218bc;var _0x390466;return db[_0x8a61('0x2f')][_0x8a61('0x56')]({'where':{'id':_0x2c485b[_0x8a61('0x45')]['id']}})[_0x8a61('0x27')](handleEntityNotFound(_0x3fedf5,null))[_0x8a61('0x27')](function(_0x5fd939){if(_0x5fd939){_0x5218bc=_0x5fd939;_0x5a43b1[_0x8a61('0x32')]=_[_0x8a61('0x33')](db['User']['rawAttributes']);_0x5a43b1[_0x8a61('0x34')]=_[_0x8a61('0x33')](_0x2c485b[_0x8a61('0x34')]);_0x5a43b1['filters']=_['intersection'](_0x5a43b1[_0x8a61('0x32')],_0x5a43b1['query']);_0x9df1eb[_0x8a61('0x37')]=_[_0x8a61('0x36')](_0x5a43b1[_0x8a61('0x32')],qs[_0x8a61('0x47')](_0x2c485b['query'][_0x8a61('0x47')]));_0x9df1eb[_0x8a61('0x37')]=_0x9df1eb[_0x8a61('0x37')][_0x8a61('0x38')]?_0x9df1eb[_0x8a61('0x37')]:_0x5a43b1[_0x8a61('0x32')];_0x9df1eb[_0x8a61('0x3a')]=qs[_0x8a61('0x3b')](_0x2c485b[_0x8a61('0x34')]['sort']);_0x9df1eb[_0x8a61('0x3c')]=qs['filters'](_[_0x8a61('0x3d')](_0x2c485b[_0x8a61('0x34')],_0x5a43b1[_0x8a61('0x35')]));if(_0x2c485b[_0x8a61('0x34')]['filter']){_0x9df1eb['where']=_[_0x8a61('0x3f')](_0x9df1eb[_0x8a61('0x3c')],{'$or':_[_0x8a61('0x2e')](_0x9df1eb[_0x8a61('0x37')],function(_0x2a5a03){var _0x51a20e={};_0x51a20e[_0x2a5a03]={'$like':'%'+_0x2c485b[_0x8a61('0x34')][_0x8a61('0x3e')]+'%'};return _0x51a20e;})});}_0x9df1eb=_['merge']({},_0x9df1eb,_0x2c485b[_0x8a61('0x40')]);return _0x5218bc[_0x8a61('0x8c')](_0x9df1eb);}})['then'](function(_0xb03312){if(_0xb03312){_0x390466=_0xb03312[_0x8a61('0x38')];if(!_0x2c485b[_0x8a61('0x34')][_0x8a61('0x39')](_0x8a61('0x57'))){_0x9df1eb[_0x8a61('0x1f')]=qs[_0x8a61('0x1f')](_0x2c485b['query']['limit']);_0x9df1eb['offset']=qs[_0x8a61('0x20')](_0x2c485b[_0x8a61('0x34')][_0x8a61('0x20')]);}return _0x5218bc['getAgents'](_0x9df1eb);}})['then'](function(_0x323cd4){if(_0x323cd4){return _0x323cd4?{'count':_0x390466,'rows':_0x323cd4}:null;}})[_0x8a61('0x27')](respondWithResult(_0x3fedf5,null))['catch'](handleError(_0x3fedf5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 24832b6..6e6e947 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 _0x6ac1=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3a9d77,_0xdc466){var _0x130f80=function(_0x740c4a){while(--_0x740c4a){_0x3a9d77['push'](_0x3a9d77['shift']());}};_0x130f80(++_0xdc466);}(_0x6ac1,0x8b));var _0x16ac=function(_0x372047,_0x7f5c2b){_0x372047=_0x372047-0x0;var _0x44f282=_0x6ac1[_0x372047];return _0x44f282;};'use strict';var EventEmitter=require(_0x16ac('0x0'));var OpenchannelQueue=require(_0x16ac('0x1'))['db'][_0x16ac('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x16ac('0x3')](0x0);var events={'afterCreate':_0x16ac('0x4'),'afterUpdate':_0x16ac('0x5'),'afterDestroy':_0x16ac('0x6')};function emitEvent(_0x2610b3){return function(_0xbcd7e4,_0x77e1e,_0x2eda63){OpenchannelQueueEvents[_0x16ac('0x7')](_0x2610b3+':'+_0xbcd7e4['id'],_0xbcd7e4);OpenchannelQueueEvents[_0x16ac('0x7')](_0x2610b3,_0xbcd7e4);_0x2eda63(null);};}for(var e in events){if(events[_0x16ac('0x8')](e)){var event=events[e];OpenchannelQueue[_0x16ac('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x225b=['emit','hasOwnProperty','exports','OpenchannelQueue','save','remove'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x225b,0x135));var _0xb225=function(_0x653afa,_0x89cb4e){_0x653afa=_0x653afa-0x0;var _0x5bc548=_0x225b[_0x653afa];return _0x5bc548;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0xb225('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb225('0x1'),'afterUpdate':'update','afterDestroy':_0xb225('0x2')};function emitEvent(_0x4a205f){return function(_0x112a05,_0x360f07,_0x41817f){OpenchannelQueueEvents['emit'](_0x4a205f+':'+_0x112a05['id'],_0x112a05);OpenchannelQueueEvents[_0xb225('0x3')](_0x4a205f,_0x112a05);_0x41817f(null);};}for(var e in events){if(events[_0xb225('0x4')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xb225('0x5')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 22459a2..752e3c7 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 _0x0a45=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x3ba65f,_0x27ae7a){var _0x1d6e18=function(_0x54c6be){while(--_0x54c6be){_0x3ba65f['push'](_0x3ba65f['shift']());}};_0x1d6e18(++_0x27ae7a);}(_0x0a45,0x1dc));var _0x50a4=function(_0x59c70e,_0x15a701){_0x59c70e=_0x59c70e-0x0;var _0x2dd06e=_0x0a45[_0x59c70e];return _0x2dd06e;};'use strict';var _=require(_0x50a4('0x0'));var util=require(_0x50a4('0x1'));var logger=require(_0x50a4('0x2'))('api');var moment=require(_0x50a4('0x3'));var BPromise=require(_0x50a4('0x4'));var rp=require(_0x50a4('0x5'));var fs=require('fs');var path=require(_0x50a4('0x6'));var rimraf=require(_0x50a4('0x7'));var config=require(_0x50a4('0x8'));var attributes=require(_0x50a4('0x9'));module[_0x50a4('0xa')]=function(_0x3b9eab,_0x591c79){return _0x3b9eab[_0x50a4('0xb')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10fc=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10fc,0x181));var _0xc10f=function(_0x3b13ba,_0x4ce4dd){_0x3b13ba=_0x3b13ba-0x0;var _0x451c83=_0x10fc[_0x3b13ba];return _0x451c83;};'use strict';var _=require(_0xc10f('0x0'));var util=require(_0xc10f('0x1'));var logger=require(_0xc10f('0x2'))(_0xc10f('0x3'));var moment=require(_0xc10f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc10f('0x5'));var rimraf=require(_0xc10f('0x6'));var config=require(_0xc10f('0x7'));var attributes=require(_0xc10f('0x8'));module[_0xc10f('0x9')]=function(_0xd5735a,_0x4c4a11){return _0xd5735a[_0xc10f('0xa')](_0xc10f('0xb'),attributes,{'tableName':_0xc10f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 442bc24..0928da4 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 _0xc891=['error','code','message','result','catch','OpenchannelQueue','options','limit','include','map','model','attributes','GetOpenchannelQueue','ShowOpenchannelQueue','raw','where','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x166d1f,_0x158cbf){var _0x4808ca=function(_0x224181){while(--_0x224181){_0x166d1f['push'](_0x166d1f['shift']());}};_0x4808ca(++_0x158cbf);}(_0xc891,0xc9));var _0x1c89=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xc891[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1c89('0x0'));var rs=require(_0x1c89('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c89('0x2'))['db'];var utils=require(_0x1c89('0x3'));var logger=require(_0x1c89('0x4'))(_0x1c89('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c89('0x6')][_0x1c89('0x7')]({'port':0x232a});config[_0x1c89('0x8')]=_[_0x1c89('0x9')](config[_0x1c89('0x8')],{'host':_0x1c89('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1c89('0xb'))[_0x1c89('0xc')](socket);function respondWithRpcPromise(_0x137cd9,_0x280958,_0xd4c33f){return new BPromise(function(_0x11f899,_0x1a51ce){return client[_0x1c89('0xd')](_0x137cd9,_0xd4c33f)[_0x1c89('0xe')](function(_0x1673ad){logger[_0x1c89('0xf')](_0x1c89('0x10'),_0x280958,_0x1c89('0x11'));logger[_0x1c89('0x12')](_0x1c89('0x13'),_0x280958,_0x1c89('0x11'),JSON[_0x1c89('0x14')](_0x1673ad));if(_0x1673ad[_0x1c89('0x15')]){if(_0x1673ad[_0x1c89('0x15')][_0x1c89('0x16')]===0x1f4){logger[_0x1c89('0x15')](_0x1c89('0x10'),_0x280958,_0x1673ad[_0x1c89('0x15')]['message']);return _0x1a51ce(_0x1673ad['error']['message']);}logger[_0x1c89('0x15')](_0x1c89('0x10'),_0x280958,_0x1673ad['error'][_0x1c89('0x17')]);return _0x11f899(_0x1673ad[_0x1c89('0x15')][_0x1c89('0x17')]);}else{logger[_0x1c89('0xf')](_0x1c89('0x10'),_0x280958,_0x1c89('0x11'));_0x11f899(_0x1673ad[_0x1c89('0x18')][_0x1c89('0x17')]);}})[_0x1c89('0x19')](function(_0x33f9a6){logger['error'](_0x1c89('0x10'),_0x280958,_0x33f9a6);_0x1a51ce(_0x33f9a6);});});}exports['GetOpenchannelQueue']=function(_0x556fce){var _0x2374f3=this;return new Promise(function(_0x32a985,_0x2bbcdd){return db[_0x1c89('0x1a')]['findAll']({'raw':_0x556fce[_0x1c89('0x1b')]?_0x556fce[_0x1c89('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x556fce[_0x1c89('0x1b')]?_0x556fce[_0x1c89('0x1b')]['where']||null:null,'attributes':_0x556fce[_0x1c89('0x1b')]?_0x556fce[_0x1c89('0x1b')]['attributes']||null:null,'limit':_0x556fce[_0x1c89('0x1b')]?_0x556fce[_0x1c89('0x1b')][_0x1c89('0x1c')]||null:null,'include':_0x556fce['options']?_0x556fce['options'][_0x1c89('0x1d')]?_[_0x1c89('0x1e')](_0x556fce[_0x1c89('0x1b')][_0x1c89('0x1d')],function(_0x8f1d63){return{'model':db[_0x8f1d63[_0x1c89('0x1f')]],'as':_0x8f1d63['as'],'attributes':_0x8f1d63[_0x1c89('0x20')],'include':_0x8f1d63[_0x1c89('0x1d')]?_[_0x1c89('0x1e')](_0x8f1d63['include'],function(_0x1b93a4){return{'model':db[_0x1b93a4['model']],'as':_0x1b93a4['as'],'attributes':_0x1b93a4[_0x1c89('0x20')],'include':_0x1b93a4[_0x1c89('0x1d')]?_[_0x1c89('0x1e')](_0x1b93a4[_0x1c89('0x1d')],function(_0xbd874a){return{'model':db[_0xbd874a['model']],'as':_0xbd874a['as'],'attributes':_0xbd874a[_0x1c89('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ade41){logger[_0x1c89('0xf')](_0x1c89('0x21'),_0x556fce);logger[_0x1c89('0x12')](_0x1c89('0x21'),_0x556fce,JSON['stringify'](_0x4ade41));_0x32a985(_0x4ade41);})[_0x1c89('0x19')](function(_0xeb2164){logger['error'](_0x1c89('0x21'),_0xeb2164[_0x1c89('0x17')],_0x556fce);_0x2bbcdd(_0x2374f3[_0x1c89('0x15')](0x1f4,_0xeb2164[_0x1c89('0x17')]));});});};exports[_0x1c89('0x22')]=function(_0x40074d){var _0x2279e6=this;return new Promise(function(_0x1915b7,_0x453893){return db['OpenchannelQueue']['find']({'raw':_0x40074d['options']?_0x40074d['options'][_0x1c89('0x23')]===undefined?!![]:![]:!![],'where':_0x40074d['options']?_0x40074d[_0x1c89('0x1b')][_0x1c89('0x24')]||null:null,'attributes':_0x40074d[_0x1c89('0x1b')]?_0x40074d[_0x1c89('0x1b')][_0x1c89('0x20')]||null:null,'include':_0x40074d[_0x1c89('0x1b')]?_0x40074d[_0x1c89('0x1b')][_0x1c89('0x1d')]?_[_0x1c89('0x1e')](_0x40074d[_0x1c89('0x1b')][_0x1c89('0x1d')],function(_0x3a0087){return{'model':db[_0x3a0087['model']],'as':_0x3a0087['as'],'attributes':_0x3a0087[_0x1c89('0x20')],'include':_0x3a0087[_0x1c89('0x1d')]?_[_0x1c89('0x1e')](_0x3a0087[_0x1c89('0x1d')],function(_0x35199a){return{'model':db[_0x35199a[_0x1c89('0x1f')]],'as':_0x35199a['as'],'attributes':_0x35199a[_0x1c89('0x20')],'include':_0x35199a[_0x1c89('0x1d')]?_['map'](_0x35199a[_0x1c89('0x1d')],function(_0x15852a){return{'model':db[_0x15852a[_0x1c89('0x1f')]],'as':_0x15852a['as'],'attributes':_0x15852a[_0x1c89('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1c89('0xe')](function(_0x52964f){logger[_0x1c89('0xf')](_0x1c89('0x22'),_0x40074d);logger[_0x1c89('0x12')]('ShowOpenchannelQueue',_0x40074d,JSON['stringify'](_0x52964f));_0x1915b7(_0x52964f);})['catch'](function(_0x19635c){logger[_0x1c89('0x15')]('ShowOpenchannelQueue',_0x19635c['message'],_0x40074d);_0x453893(_0x2279e6[_0x1c89('0x15')](0x1f4,_0x19635c['message']));});});}; \ No newline at end of file +var _0x3741=['where','attributes','limit','include','model','map','GetOpenchannelQueue','ShowOpenchannelQueue','find','raw','then','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','OpenchannelQueue','findAll','options'];(function(_0x4dd932,_0x319c67){var _0x1eb872=function(_0x250342){while(--_0x250342){_0x4dd932['push'](_0x4dd932['shift']());}};_0x1eb872(++_0x319c67);}(_0x3741,0x1a6));var _0x1374=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x3741[_0x176317];return _0xef2759;};'use strict';var _=require(_0x1374('0x0'));var util=require(_0x1374('0x1'));var moment=require(_0x1374('0x2'));var BPromise=require('bluebird');var rs=require(_0x1374('0x3'));var fs=require('fs');var Redis=require(_0x1374('0x4'));var db=require(_0x1374('0x5'))['db'];var utils=require(_0x1374('0x6'));var logger=require(_0x1374('0x7'))(_0x1374('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1374('0x9')]['http']({'port':0x232a});config[_0x1374('0xa')]=_['defaults'](config[_0x1374('0xa')],{'host':_0x1374('0xb'),'port':0x18eb});var socket=require(_0x1374('0xc'))(new Redis(config['redis']));require(_0x1374('0xd'))[_0x1374('0xe')](socket);function respondWithRpcPromise(_0x1552e5,_0x492481,_0x3b30c7){return new BPromise(function(_0x8bb8dc,_0x29f204){return client[_0x1374('0xf')](_0x1552e5,_0x3b30c7)['then'](function(_0x246cd0){logger['info'](_0x1374('0x10'),_0x492481,_0x1374('0x11'));logger[_0x1374('0x12')](_0x1374('0x13'),_0x492481,_0x1374('0x11'),JSON['stringify'](_0x246cd0));if(_0x246cd0['error']){if(_0x246cd0[_0x1374('0x14')][_0x1374('0x15')]===0x1f4){logger[_0x1374('0x14')](_0x1374('0x10'),_0x492481,_0x246cd0[_0x1374('0x14')]['message']);return _0x29f204(_0x246cd0[_0x1374('0x14')]['message']);}logger[_0x1374('0x14')](_0x1374('0x10'),_0x492481,_0x246cd0['error'][_0x1374('0x16')]);return _0x8bb8dc(_0x246cd0[_0x1374('0x14')][_0x1374('0x16')]);}else{logger[_0x1374('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x492481,_0x1374('0x11'));_0x8bb8dc(_0x246cd0[_0x1374('0x18')][_0x1374('0x16')]);}})[_0x1374('0x19')](function(_0x128b8c){logger[_0x1374('0x14')](_0x1374('0x10'),_0x492481,_0x128b8c);_0x29f204(_0x128b8c);});});}exports['GetOpenchannelQueue']=function(_0x181bbc){var _0x370f9d=this;return new Promise(function(_0x6647ee,_0x413b0d){return db[_0x1374('0x1a')][_0x1374('0x1b')]({'raw':_0x181bbc[_0x1374('0x1c')]?_0x181bbc[_0x1374('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x181bbc[_0x1374('0x1c')]?_0x181bbc[_0x1374('0x1c')][_0x1374('0x1d')]||null:null,'attributes':_0x181bbc[_0x1374('0x1c')]?_0x181bbc['options'][_0x1374('0x1e')]||null:null,'limit':_0x181bbc[_0x1374('0x1c')]?_0x181bbc['options'][_0x1374('0x1f')]||null:null,'include':_0x181bbc[_0x1374('0x1c')]?_0x181bbc[_0x1374('0x1c')][_0x1374('0x20')]?_['map'](_0x181bbc[_0x1374('0x1c')]['include'],function(_0x2406d1){return{'model':db[_0x2406d1[_0x1374('0x21')]],'as':_0x2406d1['as'],'attributes':_0x2406d1[_0x1374('0x1e')],'include':_0x2406d1[_0x1374('0x20')]?_[_0x1374('0x22')](_0x2406d1[_0x1374('0x20')],function(_0x338b08){return{'model':db[_0x338b08[_0x1374('0x21')]],'as':_0x338b08['as'],'attributes':_0x338b08[_0x1374('0x1e')],'include':_0x338b08[_0x1374('0x20')]?_['map'](_0x338b08['include'],function(_0x4001bf){return{'model':db[_0x4001bf[_0x1374('0x21')]],'as':_0x4001bf['as'],'attributes':_0x4001bf[_0x1374('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c0b49){logger[_0x1374('0x17')](_0x1374('0x23'),_0x181bbc);logger[_0x1374('0x12')]('GetOpenchannelQueue',_0x181bbc,JSON['stringify'](_0x1c0b49));_0x6647ee(_0x1c0b49);})['catch'](function(_0x462b97){logger['error'](_0x1374('0x23'),_0x462b97[_0x1374('0x16')],_0x181bbc);_0x413b0d(_0x370f9d[_0x1374('0x14')](0x1f4,_0x462b97['message']));});});};exports[_0x1374('0x24')]=function(_0x5ae8cb){var _0x3e7e7f=this;return new Promise(function(_0x3af83f,_0x11c861){return db['OpenchannelQueue'][_0x1374('0x25')]({'raw':_0x5ae8cb['options']?_0x5ae8cb[_0x1374('0x1c')][_0x1374('0x26')]===undefined?!![]:![]:!![],'where':_0x5ae8cb[_0x1374('0x1c')]?_0x5ae8cb[_0x1374('0x1c')][_0x1374('0x1d')]||null:null,'attributes':_0x5ae8cb[_0x1374('0x1c')]?_0x5ae8cb[_0x1374('0x1c')]['attributes']||null:null,'include':_0x5ae8cb[_0x1374('0x1c')]?_0x5ae8cb[_0x1374('0x1c')][_0x1374('0x20')]?_[_0x1374('0x22')](_0x5ae8cb[_0x1374('0x1c')][_0x1374('0x20')],function(_0x239cb8){return{'model':db[_0x239cb8[_0x1374('0x21')]],'as':_0x239cb8['as'],'attributes':_0x239cb8[_0x1374('0x1e')],'include':_0x239cb8[_0x1374('0x20')]?_['map'](_0x239cb8[_0x1374('0x20')],function(_0x4341a7){return{'model':db[_0x4341a7[_0x1374('0x21')]],'as':_0x4341a7['as'],'attributes':_0x4341a7['attributes'],'include':_0x4341a7[_0x1374('0x20')]?_[_0x1374('0x22')](_0x4341a7[_0x1374('0x20')],function(_0x3945f1){return{'model':db[_0x3945f1[_0x1374('0x21')]],'as':_0x3945f1['as'],'attributes':_0x3945f1[_0x1374('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1374('0x27')](function(_0x513e5f){logger[_0x1374('0x17')](_0x1374('0x24'),_0x5ae8cb);logger[_0x1374('0x12')](_0x1374('0x24'),_0x5ae8cb,JSON[_0x1374('0x28')](_0x513e5f));_0x3af83f(_0x513e5f);})[_0x1374('0x19')](function(_0x277f57){logger[_0x1374('0x14')](_0x1374('0x24'),_0x277f57[_0x1374('0x16')],_0x5ae8cb);_0x11c861(_0x3e7e7f[_0x1374('0x14')](0x1f4,_0x277f57[_0x1374('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index e987769..e6fec27 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 _0x2e57=['openchannelQueue:','remove','update','emit','removeListener','register','length'];(function(_0xb8a1b3,_0x257316){var _0x5a2b3a=function(_0xba30b1){while(--_0xba30b1){_0xb8a1b3['push'](_0xb8a1b3['shift']());}};_0x5a2b3a(++_0x257316);}(_0x2e57,0x6a));var _0x72e5=function(_0xe5c8d3,_0x28164c){_0xe5c8d3=_0xe5c8d3-0x0;var _0x23a4db=_0x2e57[_0xe5c8d3];return _0x23a4db;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x72e5('0x0'),_0x72e5('0x1')];function createListener(_0x134e90,_0x3dddab){return function(_0x31b48a){_0x3dddab[_0x72e5('0x2')](_0x134e90,_0x31b48a);};}function removeListener(_0x51ede4,_0x74d5f7){return function(){OpenchannelQueueEvents[_0x72e5('0x3')](_0x51ede4,_0x74d5f7);};}exports[_0x72e5('0x4')]=function(_0x43cd38){for(var _0x57d3e9=0x0,_0x3bbbff=events[_0x72e5('0x5')];_0x57d3e9<_0x3bbbff;_0x57d3e9++){var _0x1597a1=events[_0x57d3e9];var _0x49bda2=createListener(_0x72e5('0x6')+_0x1597a1,_0x43cd38);OpenchannelQueueEvents['on'](_0x1597a1,_0x49bda2);}}; \ No newline at end of file +var _0xbc78=['register','openchannelQueue:','save','remove','update'];(function(_0x346e29,_0x4341f1){var _0x5098ff=function(_0x38516a){while(--_0x38516a){_0x346e29['push'](_0x346e29['shift']());}};_0x5098ff(++_0x4341f1);}(_0xbc78,0x101));var _0x8bc7=function(_0x64370e,_0x191a6d){_0x64370e=_0x64370e-0x0;var _0x556cc7=_0xbc78[_0x64370e];return _0x556cc7;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x8bc7('0x0'),_0x8bc7('0x1'),_0x8bc7('0x2')];function createListener(_0x590b1d,_0x4d1353){return function(_0x4315d0){_0x4d1353['emit'](_0x590b1d,_0x4315d0);};}function removeListener(_0x3d0770,_0xc08ae1){return function(){OpenchannelQueueEvents['removeListener'](_0x3d0770,_0xc08ae1);};}exports[_0x8bc7('0x3')]=function(_0x8ea6c7){for(var _0x337aab=0x0,_0x51facc=events['length'];_0x337aab<_0x51facc;_0x337aab++){var _0x24484d=events[_0x337aab];var _0x506930=createListener(_0x8bc7('0x4')+_0x24484d,_0x8ea6c7);OpenchannelQueueEvents['on'](_0x24484d,_0x506930);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 7cd83b1..0cb3496 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 _0x63b8=['describe','/:id','show','create','put','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0x63b8,0x1af));var _0x863b=function(_0x321a18,_0x4859dd){_0x321a18=_0x321a18-0x0;var _0x5c908a=_0x63b8[_0x321a18];return _0x5c908a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x863b('0x0'));var timeout=require(_0x863b('0x1'));var express=require(_0x863b('0x2'));var router=express[_0x863b('0x3')]();var fs_extra=require(_0x863b('0x4'));var auth=require(_0x863b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x863b('0x6'));router[_0x863b('0x7')]('/',auth['isAuthenticated'](),controller[_0x863b('0x8')]);router[_0x863b('0x7')](_0x863b('0x9'),auth[_0x863b('0xa')](),controller[_0x863b('0xb')]);router['get'](_0x863b('0xc'),auth[_0x863b('0xa')](),controller[_0x863b('0xd')]);router['post']('/',auth[_0x863b('0xa')](),controller[_0x863b('0xe')]);router[_0x863b('0xf')](_0x863b('0xc'),auth[_0x863b('0xa')](),controller['update']);router['delete'](_0x863b('0xc'),auth[_0x863b('0xa')](),controller['destroy']);module[_0x863b('0x10')]=router; \ No newline at end of file +var _0xc003=['/describe','describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get'];(function(_0xb564b0,_0x1bde80){var _0x24e9d2=function(_0x595194){while(--_0x595194){_0xb564b0['push'](_0xb564b0['shift']());}};_0x24e9d2(++_0x1bde80);}(_0xc003,0x198));var _0x3c00=function(_0x5545dd,_0x51898b){_0x5545dd=_0x5545dd-0x0;var _0x7999f9=_0xc003[_0x5545dd];return _0x7999f9;};'use strict';var multer=require(_0x3c00('0x0'));var util=require(_0x3c00('0x1'));var path=require(_0x3c00('0x2'));var timeout=require(_0x3c00('0x3'));var express=require(_0x3c00('0x4'));var router=express[_0x3c00('0x5')]();var fs_extra=require(_0x3c00('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3c00('0x7'));var controller=require(_0x3c00('0x8'));router['get']('/',auth[_0x3c00('0x9')](),controller[_0x3c00('0xa')]);router[_0x3c00('0xb')](_0x3c00('0xc'),auth[_0x3c00('0x9')](),controller[_0x3c00('0xd')]);router[_0x3c00('0xb')](_0x3c00('0xe'),auth[_0x3c00('0x9')](),controller[_0x3c00('0xf')]);router[_0x3c00('0x10')]('/',auth[_0x3c00('0x9')](),controller[_0x3c00('0x11')]);router[_0x3c00('0x12')](_0x3c00('0xe'),auth[_0x3c00('0x9')](),controller[_0x3c00('0x13')]);router['delete'](_0x3c00('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3c00('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index e7da59c..926581f 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 _0xc541=['exports','STRING','DATE','moment','sequelize'];(function(_0x12cbd8,_0x8ef0ce){var _0x2fb1ab=function(_0x57242c){while(--_0x57242c){_0x12cbd8['push'](_0x12cbd8['shift']());}};_0x2fb1ab(++_0x8ef0ce);}(_0xc541,0x139));var _0x1c54=function(_0x3bfdde,_0x306be4){_0x3bfdde=_0x3bfdde-0x0;var _0x3f752a=_0xc541[_0x3bfdde];return _0x3f752a;};'use strict';var moment=require(_0x1c54('0x0'));var Sequelize=require(_0x1c54('0x1'));module[_0x1c54('0x2')]={'uniqueid':{'type':Sequelize[_0x1c54('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1c54('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1c54('0x4')]},'exitAt':{'type':Sequelize[_0x1c54('0x4')]},'reason':{'type':Sequelize[_0x1c54('0x3')]}}; \ No newline at end of file +var _0x4e20=['sequelize','exports','STRING','DATE','moment'];(function(_0x432059,_0x66abaf){var _0x2d2f20=function(_0x4b4bf7){while(--_0x4b4bf7){_0x432059['push'](_0x432059['shift']());}};_0x2d2f20(++_0x66abaf);}(_0x4e20,0x121));var _0x04e2=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x4e20[_0x46ae5a];return _0x434986;};'use strict';var moment=require(_0x04e2('0x0'));var Sequelize=require(_0x04e2('0x1'));module[_0x04e2('0x2')]={'uniqueid':{'type':Sequelize[_0x04e2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x04e2('0x3')]},'joinAt':{'type':Sequelize[_0x04e2('0x4')]},'leaveAt':{'type':Sequelize[_0x04e2('0x4')]},'acceptAt':{'type':Sequelize[_0x04e2('0x4')]},'exitAt':{'type':Sequelize[_0x04e2('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 7fd25d9..e8dc516 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 _0x1383=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','name','send','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','catch','params','keys','includeAll','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x21f420,_0x4fa5e3){var _0x5456f9=function(_0x2c1030){while(--_0x2c1030){_0x21f420['push'](_0x21f420['shift']());}};_0x5456f9(++_0x4fa5e3);}(_0x1383,0x158));var _0x3138=function(_0x3d0cdd,_0xfc7d60){_0x3d0cdd=_0x3d0cdd-0x0;var _0x268b22=_0x1383[_0x3d0cdd];return _0x268b22;};'use strict';var emlformat=require(_0x3138('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3138('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3138('0x2'));var moment=require(_0x3138('0x3'));var BPromise=require(_0x3138('0x4'));var Mustache=require(_0x3138('0x5'));var util=require(_0x3138('0x6'));var path=require(_0x3138('0x7'));var sox=require('sox');var csv=require(_0x3138('0x8'));var ejs=require(_0x3138('0x9'));var fs=require('fs');var fs_extra=require(_0x3138('0xa'));var _=require(_0x3138('0xb'));var squel=require(_0x3138('0xc'));var crypto=require(_0x3138('0xd'));var jsforce=require(_0x3138('0xe'));var deskjs=require(_0x3138('0xf'));var toCsv=require(_0x3138('0x8'));var querystring=require(_0x3138('0x10'));var Papa=require(_0x3138('0x11'));var Redis=require(_0x3138('0x12'));var authService=require(_0x3138('0x13'));var qs=require(_0x3138('0x14'));var as=require(_0x3138('0x15'));var hardwareService=require(_0x3138('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3138('0x17'));var licenseUtil=require(_0x3138('0x18'));var db=require(_0x3138('0x19'))['db'];function respondWithStatusCode(_0x136296,_0x41ec95){_0x41ec95=_0x41ec95||0xcc;return function(_0x1e274b){if(_0x1e274b){return _0x136296[_0x3138('0x1a')](_0x41ec95);}return _0x136296[_0x3138('0x1b')](_0x41ec95)[_0x3138('0x1c')]();};}function respondWithResult(_0x59907b,_0x3340a2){_0x3340a2=_0x3340a2||0xc8;return function(_0x4c642d){if(_0x4c642d){return _0x59907b[_0x3138('0x1b')](_0x3340a2)[_0x3138('0x1d')](_0x4c642d);}};}function respondWithFilteredResult(_0x5efa12,_0x55a300){return function(_0x39653e){if(_0x39653e){var _0x5a5cfa=typeof _0x55a300[_0x3138('0x1e')]==='undefined'&&typeof _0x55a300[_0x3138('0x1f')]===_0x3138('0x20');var _0x3f28e6=_0x39653e[_0x3138('0x21')];var _0x1866c8=_0x5a5cfa?0x0:_0x55a300['offset'];var _0x48ba1f=_0x5a5cfa?_0x39653e[_0x3138('0x21')]:_0x55a300[_0x3138('0x1e')]+_0x55a300[_0x3138('0x1f')];var _0x434b1e;if(_0x48ba1f>=_0x3f28e6){_0x48ba1f=_0x3f28e6;_0x434b1e=0xc8;}else{_0x434b1e=0xce;}_0x5efa12[_0x3138('0x1b')](_0x434b1e);return _0x5efa12[_0x3138('0x22')](_0x3138('0x23'),_0x1866c8+'-'+_0x48ba1f+'/'+_0x3f28e6)[_0x3138('0x1d')](_0x39653e);}return null;};}function patchUpdates(_0x265b0d){return function(_0x30c5cc){try{jsonpatch[_0x3138('0x24')](_0x30c5cc,_0x265b0d,!![]);}catch(_0x171e83){return BPromise['reject'](_0x171e83);}return _0x30c5cc['save']();};}function saveUpdates(_0x314a81,_0x18ab1b){return function(_0x2689e8){if(_0x2689e8){return _0x2689e8[_0x3138('0x25')](_0x314a81)['then'](function(_0x46b6a1){return _0x46b6a1;});}return null;};}function removeEntity(_0x161ef9,_0x35d754){return function(_0x4ae7e0){if(_0x4ae7e0){return _0x4ae7e0[_0x3138('0x26')]()[_0x3138('0x27')](function(){_0x161ef9[_0x3138('0x1b')](0xcc)[_0x3138('0x1c')]();});}};}function handleEntityNotFound(_0x402feb,_0x46a398){return function(_0x3d8fe7){if(!_0x3d8fe7){_0x402feb[_0x3138('0x1a')](0x194);}return _0x3d8fe7;};}function handleError(_0x290434,_0x38faaf){_0x38faaf=_0x38faaf||0x1f4;return function(_0x4bfe15){logger['error'](_0x4bfe15['stack']);if(_0x4bfe15[_0x3138('0x28')]){delete _0x4bfe15[_0x3138('0x28')];}_0x290434['status'](_0x38faaf)[_0x3138('0x29')](_0x4bfe15);};}exports['index']=function(_0x2f3bf3,_0x29ab30){var _0x278a83={},_0x33d2e8={},_0x1b4634={'count':0x0,'rows':[]};var _0x17c685=_['map'](db[_0x3138('0x2a')][_0x3138('0x2b')],function(_0x370491){return{'name':_0x370491[_0x3138('0x2c')],'type':_0x370491[_0x3138('0x2d')][_0x3138('0x2e')]};});_0x33d2e8[_0x3138('0x2f')]=_[_0x3138('0x30')](_0x17c685,_0x3138('0x28'));_0x33d2e8[_0x3138('0x31')]=_['keys'](_0x2f3bf3[_0x3138('0x31')]);_0x33d2e8['filters']=_[_0x3138('0x32')](_0x33d2e8['model'],_0x33d2e8[_0x3138('0x31')]);_0x278a83[_0x3138('0x33')]=_[_0x3138('0x32')](_0x33d2e8['model'],qs['fields'](_0x2f3bf3['query'][_0x3138('0x34')]));_0x278a83[_0x3138('0x33')]=_0x278a83[_0x3138('0x33')][_0x3138('0x35')]?_0x278a83[_0x3138('0x33')]:_0x33d2e8['model'];if(!_0x2f3bf3[_0x3138('0x31')][_0x3138('0x36')](_0x3138('0x37'))){_0x278a83[_0x3138('0x1f')]=qs[_0x3138('0x1f')](_0x2f3bf3[_0x3138('0x31')][_0x3138('0x1f')]);_0x278a83[_0x3138('0x1e')]=qs[_0x3138('0x1e')](_0x2f3bf3['query'][_0x3138('0x1e')]);}_0x278a83['order']=qs['sort'](_0x2f3bf3[_0x3138('0x31')][_0x3138('0x38')]);_0x278a83[_0x3138('0x39')]=qs['filters'](_[_0x3138('0x3a')](_0x2f3bf3[_0x3138('0x31')],_0x33d2e8[_0x3138('0x3b')]),_0x17c685);if(_0x2f3bf3[_0x3138('0x31')][_0x3138('0x3c')]){_0x278a83[_0x3138('0x39')]=_[_0x3138('0x3d')](_0x278a83[_0x3138('0x39')],{'$or':_[_0x3138('0x30')](_0x17c685,function(_0x2c2577){if(_0x2c2577[_0x3138('0x2d')]!==_0x3138('0x3e')){var _0xea1177={};_0xea1177[_0x2c2577['name']]={'$like':'%'+_0x2f3bf3['query']['filter']+'%'};return _0xea1177;}})});}_0x278a83=_[_0x3138('0x3d')]({},_0x278a83,_0x2f3bf3[_0x3138('0x3f')]);var _0x231757={'where':_0x278a83[_0x3138('0x39')]};return db[_0x3138('0x2a')]['count'](_0x231757)[_0x3138('0x27')](function(_0x5d4b9b){_0x1b4634[_0x3138('0x21')]=_0x5d4b9b;if(_0x2f3bf3[_0x3138('0x31')]['includeAll']){_0x278a83[_0x3138('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x278a83);})[_0x3138('0x27')](function(_0x1622c4){_0x1b4634['rows']=_0x1622c4;return _0x1b4634;})[_0x3138('0x27')](respondWithFilteredResult(_0x29ab30,_0x278a83))[_0x3138('0x41')](handleError(_0x29ab30,null));};exports['show']=function(_0x2502b7,_0x33fdb8){var _0x5726e8={'raw':!![],'where':{'id':_0x2502b7[_0x3138('0x42')]['id']}},_0xe7c8b7={};_0xe7c8b7[_0x3138('0x2f')]=_[_0x3138('0x43')](db[_0x3138('0x2a')][_0x3138('0x2b')]);_0xe7c8b7['query']=_[_0x3138('0x43')](_0x2502b7[_0x3138('0x31')]);_0xe7c8b7[_0x3138('0x3b')]=_['intersection'](_0xe7c8b7[_0x3138('0x2f')],_0xe7c8b7['query']);_0x5726e8[_0x3138('0x33')]=_[_0x3138('0x32')](_0xe7c8b7[_0x3138('0x2f')],qs[_0x3138('0x34')](_0x2502b7['query']['fields']));_0x5726e8[_0x3138('0x33')]=_0x5726e8['attributes']['length']?_0x5726e8[_0x3138('0x33')]:_0xe7c8b7['model'];if(_0x2502b7[_0x3138('0x31')][_0x3138('0x44')]){_0x5726e8[_0x3138('0x40')]=[{'all':!![]}];}_0x5726e8=_[_0x3138('0x3d')]({},_0x5726e8,_0x2502b7[_0x3138('0x3f')]);return db['OpenchannelQueueReport'][_0x3138('0x45')](_0x5726e8)[_0x3138('0x27')](handleEntityNotFound(_0x33fdb8,null))['then'](respondWithResult(_0x33fdb8,null))[_0x3138('0x41')](handleError(_0x33fdb8,null));};exports[_0x3138('0x46')]=function(_0x8f5cc,_0x275f35){return db[_0x3138('0x2a')][_0x3138('0x46')](_0x8f5cc['body'],{})[_0x3138('0x27')](respondWithResult(_0x275f35,0xc9))['catch'](handleError(_0x275f35,null));};exports[_0x3138('0x25')]=function(_0x9d7ebe,_0x125141){if(_0x9d7ebe['body']['id']){delete _0x9d7ebe[_0x3138('0x47')]['id'];}return db[_0x3138('0x2a')][_0x3138('0x45')]({'where':{'id':_0x9d7ebe[_0x3138('0x42')]['id']}})['then'](handleEntityNotFound(_0x125141,null))[_0x3138('0x27')](saveUpdates(_0x9d7ebe[_0x3138('0x47')],null))['then'](respondWithResult(_0x125141,null))[_0x3138('0x41')](handleError(_0x125141,null));};exports[_0x3138('0x26')]=function(_0x44b924,_0x47f357){return db[_0x3138('0x2a')][_0x3138('0x45')]({'where':{'id':_0x44b924[_0x3138('0x42')]['id']}})[_0x3138('0x27')](handleEntityNotFound(_0x47f357,null))[_0x3138('0x27')](removeEntity(_0x47f357,null))[_0x3138('0x41')](handleError(_0x47f357,null));};exports[_0x3138('0x48')]=function(_0x4ba0a4,_0x2ba6cf){return db[_0x3138('0x2a')][_0x3138('0x48')]()[_0x3138('0x27')](respondWithResult(_0x2ba6cf,null))[_0x3138('0x41')](handleError(_0x2ba6cf,null));}; \ No newline at end of file +var _0x7a34=['destroy','then','status','sendStatus','error','name','send','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','OpenchannelQueueReport','findAll','rows','catch','params','rawAttributes','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','Content-Range','json','reject','save','update'];(function(_0x55b073,_0x10f057){var _0x544b2b=function(_0xef5836){while(--_0xef5836){_0x55b073['push'](_0x55b073['shift']());}};_0x544b2b(++_0x10f057);}(_0x7a34,0x1ea));var _0x47a3=function(_0x5be74,_0x3e3d89){_0x5be74=_0x5be74-0x0;var _0x2f2a2a=_0x7a34[_0x5be74];return _0x2f2a2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47a3('0x0'));var zipdir=require(_0x47a3('0x1'));var jsonpatch=require(_0x47a3('0x2'));var rp=require(_0x47a3('0x3'));var moment=require(_0x47a3('0x4'));var BPromise=require(_0x47a3('0x5'));var Mustache=require(_0x47a3('0x6'));var util=require(_0x47a3('0x7'));var path=require('path');var sox=require(_0x47a3('0x8'));var csv=require(_0x47a3('0x9'));var ejs=require(_0x47a3('0xa'));var fs=require('fs');var fs_extra=require(_0x47a3('0xb'));var _=require('lodash');var squel=require(_0x47a3('0xc'));var crypto=require('crypto');var jsforce=require(_0x47a3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x47a3('0xe'));var Papa=require(_0x47a3('0xf'));var Redis=require(_0x47a3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x47a3('0x11'));var as=require(_0x47a3('0x12'));var hardwareService=require(_0x47a3('0x13'));var logger=require(_0x47a3('0x14'))(_0x47a3('0x15'));var utils=require(_0x47a3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x47a3('0x17'));var db=require(_0x47a3('0x18'))['db'];function respondWithStatusCode(_0x485150,_0x25cbb7){_0x25cbb7=_0x25cbb7||0xcc;return function(_0x387f91){if(_0x387f91){return _0x485150['sendStatus'](_0x25cbb7);}return _0x485150['status'](_0x25cbb7)[_0x47a3('0x19')]();};}function respondWithResult(_0x219c07,_0x4fe090){_0x4fe090=_0x4fe090||0xc8;return function(_0x12cd95){if(_0x12cd95){return _0x219c07['status'](_0x4fe090)['json'](_0x12cd95);}};}function respondWithFilteredResult(_0x1b4db3,_0x54359c){return function(_0x2c0b69){if(_0x2c0b69){var _0x5cf744=typeof _0x54359c[_0x47a3('0x1a')]===_0x47a3('0x1b')&&typeof _0x54359c[_0x47a3('0x1c')]===_0x47a3('0x1b');var _0x5c9ba8=_0x2c0b69[_0x47a3('0x1d')];var _0x5c3947=_0x5cf744?0x0:_0x54359c['offset'];var _0x100c52=_0x5cf744?_0x2c0b69[_0x47a3('0x1d')]:_0x54359c['offset']+_0x54359c[_0x47a3('0x1c')];var _0x4825c5;if(_0x100c52>=_0x5c9ba8){_0x100c52=_0x5c9ba8;_0x4825c5=0xc8;}else{_0x4825c5=0xce;}_0x1b4db3['status'](_0x4825c5);return _0x1b4db3['set'](_0x47a3('0x1e'),_0x5c3947+'-'+_0x100c52+'/'+_0x5c9ba8)[_0x47a3('0x1f')](_0x2c0b69);}return null;};}function patchUpdates(_0x4eb5d3){return function(_0x13ffdc){try{jsonpatch['apply'](_0x13ffdc,_0x4eb5d3,!![]);}catch(_0x50eeb2){return BPromise[_0x47a3('0x20')](_0x50eeb2);}return _0x13ffdc[_0x47a3('0x21')]();};}function saveUpdates(_0xe436d4,_0x2e2e51){return function(_0x423e78){if(_0x423e78){return _0x423e78[_0x47a3('0x22')](_0xe436d4)['then'](function(_0x2ef47f){return _0x2ef47f;});}return null;};}function removeEntity(_0x32f8ac,_0x3ee0c5){return function(_0x260b85){if(_0x260b85){return _0x260b85[_0x47a3('0x23')]()[_0x47a3('0x24')](function(){_0x32f8ac[_0x47a3('0x25')](0xcc)[_0x47a3('0x19')]();});}};}function handleEntityNotFound(_0x53b9ee,_0x4e01b3){return function(_0x53165b){if(!_0x53165b){_0x53b9ee[_0x47a3('0x26')](0x194);}return _0x53165b;};}function handleError(_0x2d7a8f,_0x253cdc){_0x253cdc=_0x253cdc||0x1f4;return function(_0x3b41da){logger[_0x47a3('0x27')](_0x3b41da['stack']);if(_0x3b41da[_0x47a3('0x28')]){delete _0x3b41da[_0x47a3('0x28')];}_0x2d7a8f['status'](_0x253cdc)[_0x47a3('0x29')](_0x3b41da);};}exports['index']=function(_0x4db8eb,_0x3142a5){var _0x2ffaca={},_0x55a11b={},_0x7f14c3={'count':0x0,'rows':[]};var _0xc9ea6=_['map'](db['OpenchannelQueueReport']['rawAttributes'],function(_0x48bbd6){return{'name':_0x48bbd6[_0x47a3('0x2a')],'type':_0x48bbd6[_0x47a3('0x2b')][_0x47a3('0x2c')]};});_0x55a11b[_0x47a3('0x2d')]=_[_0x47a3('0x2e')](_0xc9ea6,_0x47a3('0x28'));_0x55a11b['query']=_[_0x47a3('0x2f')](_0x4db8eb[_0x47a3('0x30')]);_0x55a11b['filters']=_['intersection'](_0x55a11b[_0x47a3('0x2d')],_0x55a11b['query']);_0x2ffaca[_0x47a3('0x31')]=_[_0x47a3('0x32')](_0x55a11b['model'],qs[_0x47a3('0x33')](_0x4db8eb[_0x47a3('0x30')][_0x47a3('0x33')]));_0x2ffaca[_0x47a3('0x31')]=_0x2ffaca[_0x47a3('0x31')][_0x47a3('0x34')]?_0x2ffaca[_0x47a3('0x31')]:_0x55a11b[_0x47a3('0x2d')];if(!_0x4db8eb[_0x47a3('0x30')][_0x47a3('0x35')](_0x47a3('0x36'))){_0x2ffaca['limit']=qs['limit'](_0x4db8eb[_0x47a3('0x30')][_0x47a3('0x1c')]);_0x2ffaca[_0x47a3('0x1a')]=qs[_0x47a3('0x1a')](_0x4db8eb['query'][_0x47a3('0x1a')]);}_0x2ffaca['order']=qs[_0x47a3('0x37')](_0x4db8eb[_0x47a3('0x30')][_0x47a3('0x37')]);_0x2ffaca['where']=qs[_0x47a3('0x38')](_[_0x47a3('0x39')](_0x4db8eb['query'],_0x55a11b['filters']),_0xc9ea6);if(_0x4db8eb[_0x47a3('0x30')][_0x47a3('0x3a')]){_0x2ffaca['where']=_['merge'](_0x2ffaca[_0x47a3('0x3b')],{'$or':_[_0x47a3('0x2e')](_0xc9ea6,function(_0x2cc071){if(_0x2cc071[_0x47a3('0x2b')]!==_0x47a3('0x3c')){var _0x473598={};_0x473598[_0x2cc071['name']]={'$like':'%'+_0x4db8eb[_0x47a3('0x30')][_0x47a3('0x3a')]+'%'};return _0x473598;}})});}_0x2ffaca=_[_0x47a3('0x3d')]({},_0x2ffaca,_0x4db8eb[_0x47a3('0x3e')]);var _0x1d67a8={'where':_0x2ffaca[_0x47a3('0x3b')]};return db['OpenchannelQueueReport'][_0x47a3('0x1d')](_0x1d67a8)[_0x47a3('0x24')](function(_0x285e7c){_0x7f14c3[_0x47a3('0x1d')]=_0x285e7c;if(_0x4db8eb[_0x47a3('0x30')][_0x47a3('0x3f')]){_0x2ffaca['include']=[{'all':!![]}];}return db[_0x47a3('0x40')][_0x47a3('0x41')](_0x2ffaca);})[_0x47a3('0x24')](function(_0x4b18e4){_0x7f14c3[_0x47a3('0x42')]=_0x4b18e4;return _0x7f14c3;})[_0x47a3('0x24')](respondWithFilteredResult(_0x3142a5,_0x2ffaca))[_0x47a3('0x43')](handleError(_0x3142a5,null));};exports['show']=function(_0xb2c2ea,_0x59c7db){var _0xfb8a73={'raw':!![],'where':{'id':_0xb2c2ea[_0x47a3('0x44')]['id']}},_0x3c9a24={};_0x3c9a24[_0x47a3('0x2d')]=_[_0x47a3('0x2f')](db[_0x47a3('0x40')][_0x47a3('0x45')]);_0x3c9a24['query']=_[_0x47a3('0x2f')](_0xb2c2ea[_0x47a3('0x30')]);_0x3c9a24[_0x47a3('0x38')]=_[_0x47a3('0x32')](_0x3c9a24[_0x47a3('0x2d')],_0x3c9a24[_0x47a3('0x30')]);_0xfb8a73['attributes']=_[_0x47a3('0x32')](_0x3c9a24[_0x47a3('0x2d')],qs[_0x47a3('0x33')](_0xb2c2ea[_0x47a3('0x30')][_0x47a3('0x33')]));_0xfb8a73[_0x47a3('0x31')]=_0xfb8a73[_0x47a3('0x31')][_0x47a3('0x34')]?_0xfb8a73[_0x47a3('0x31')]:_0x3c9a24[_0x47a3('0x2d')];if(_0xb2c2ea[_0x47a3('0x30')][_0x47a3('0x3f')]){_0xfb8a73[_0x47a3('0x46')]=[{'all':!![]}];}_0xfb8a73=_['merge']({},_0xfb8a73,_0xb2c2ea[_0x47a3('0x3e')]);return db[_0x47a3('0x40')][_0x47a3('0x47')](_0xfb8a73)[_0x47a3('0x24')](handleEntityNotFound(_0x59c7db,null))['then'](respondWithResult(_0x59c7db,null))[_0x47a3('0x43')](handleError(_0x59c7db,null));};exports[_0x47a3('0x48')]=function(_0x46c975,_0x2f4cbd){return db[_0x47a3('0x40')][_0x47a3('0x48')](_0x46c975['body'],{})[_0x47a3('0x24')](respondWithResult(_0x2f4cbd,0xc9))[_0x47a3('0x43')](handleError(_0x2f4cbd,null));};exports[_0x47a3('0x22')]=function(_0x27b465,_0x21ccda){if(_0x27b465[_0x47a3('0x49')]['id']){delete _0x27b465[_0x47a3('0x49')]['id'];}return db[_0x47a3('0x40')][_0x47a3('0x47')]({'where':{'id':_0x27b465[_0x47a3('0x44')]['id']}})[_0x47a3('0x24')](handleEntityNotFound(_0x21ccda,null))[_0x47a3('0x24')](saveUpdates(_0x27b465[_0x47a3('0x49')],null))[_0x47a3('0x24')](respondWithResult(_0x21ccda,null))[_0x47a3('0x43')](handleError(_0x21ccda,null));};exports[_0x47a3('0x23')]=function(_0x296977,_0x5aee5b){return db[_0x47a3('0x40')][_0x47a3('0x47')]({'where':{'id':_0x296977[_0x47a3('0x44')]['id']}})[_0x47a3('0x24')](handleEntityNotFound(_0x5aee5b,null))['then'](removeEntity(_0x5aee5b,null))[_0x47a3('0x43')](handleError(_0x5aee5b,null));};exports[_0x47a3('0x4a')]=function(_0x10ead8,_0x44c62f){return db[_0x47a3('0x40')][_0x47a3('0x4a')]()[_0x47a3('0x24')](respondWithResult(_0x44c62f,null))['catch'](handleError(_0x44c62f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f9b5761..e866fa8 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x5d44ed,_0x3ff59b){var _0x124871=function(_0xc9be4c){while(--_0xc9be4c){_0x5d44ed['push'](_0x5d44ed['shift']());}};_0x124871(++_0x3ff59b);}(_0x5fc3,0xa8));var _0x35fc=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0x5fc3[_0xe5b349];return _0x26b0ad;};'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 +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x1a41ff,_0x23dd03){var _0x5863fa=function(_0x433c41){while(--_0x433c41){_0x1a41ff['push'](_0x1a41ff['shift']());}};_0x5863fa(++_0x23dd03);}(_0x326f,0xd1));var _0xf326=function(_0x2c1efc,_0x2cc9bd){_0x2c1efc=_0x2c1efc-0x0;var _0x2705f8=_0x326f[_0x2c1efc];return _0x2705f8;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 20c2760..c2cfc7c 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 _0x8f59=['raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','then','debug','stringify','catch','update'];(function(_0x4e751b,_0x19ab9a){var _0x30523e=function(_0x54d949){while(--_0x54d949){_0x4e751b['push'](_0x4e751b['shift']());}};_0x30523e(++_0x19ab9a);}(_0x8f59,0x11d));var _0x98f5=function(_0x347498,_0x332242){_0x347498=_0x347498-0x0;var _0x334f2b=_0x8f59[_0x347498];return _0x334f2b;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2acf,_0x5869ee,_0x5e91b3){return new BPromise(function(_0x109417,_0x1cd8a8){return client[_0x98f5('0xc')](_0x2e2acf,_0x5e91b3)['then'](function(_0x456329){logger[_0x98f5('0xd')](_0x98f5('0xe'),_0x5869ee,_0x98f5('0xf'));logger['debug'](_0x98f5('0x10'),_0x5869ee,'request\x20sent',JSON['stringify'](_0x456329));if(_0x456329[_0x98f5('0x11')]){if(_0x456329[_0x98f5('0x11')]['code']===0x1f4){logger[_0x98f5('0x11')](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);return _0x1cd8a8(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}logger['error'](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')]['message']);return _0x109417(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}else{logger[_0x98f5('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5869ee,_0x98f5('0xf'));_0x109417(_0x456329[_0x98f5('0x13')][_0x98f5('0x12')]);}})['catch'](function(_0x440cfa){logger[_0x98f5('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5869ee,_0x440cfa);_0x1cd8a8(_0x440cfa);});});}exports[_0x98f5('0x14')]=function(_0x51a567){var _0x10c57c=this;return new Promise(function(_0x9e42dd,_0x2291d5){return db[_0x98f5('0x15')][_0x98f5('0x16')](_0x51a567[_0x98f5('0x17')],{'raw':_0x51a567['options']?_0x51a567[_0x98f5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x98f5('0x19')](function(_0x191f23){logger['info'](_0x98f5('0x14'),_0x51a567);logger[_0x98f5('0x1a')](_0x98f5('0x14'),_0x51a567,JSON[_0x98f5('0x1b')](_0x191f23));_0x9e42dd(_0x191f23);})[_0x98f5('0x1c')](function(_0x3dc7c2){logger[_0x98f5('0x11')]('CreateOpenchannelQueueReport',_0x3dc7c2[_0x98f5('0x12')],_0x51a567);_0x2291d5(_0x10c57c['error'](0x1f4,_0x3dc7c2[_0x98f5('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x44bfbb){var _0x40c69b=this;return new Promise(function(_0x106b24,_0x5c64e){return db[_0x98f5('0x15')][_0x98f5('0x1d')](_0x44bfbb[_0x98f5('0x17')],{'raw':_0x44bfbb['options']?_0x44bfbb[_0x98f5('0x18')][_0x98f5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44bfbb['options']?_0x44bfbb[_0x98f5('0x18')][_0x98f5('0x1f')]||null:null,'attributes':_0x44bfbb[_0x98f5('0x18')]?_0x44bfbb[_0x98f5('0x18')][_0x98f5('0x20')]||null:null,'limit':_0x44bfbb[_0x98f5('0x18')]?_0x44bfbb[_0x98f5('0x18')][_0x98f5('0x21')]||null:null})['then'](function(_0x4c10b8){logger[_0x98f5('0xd')](_0x98f5('0x22'),_0x44bfbb);logger[_0x98f5('0x1a')](_0x98f5('0x22'),_0x44bfbb,JSON[_0x98f5('0x1b')](_0x4c10b8));_0x106b24(_0x4c10b8);})[_0x98f5('0x1c')](function(_0x5e9d73){logger[_0x98f5('0x11')](_0x98f5('0x22'),_0x5e9d73[_0x98f5('0x12')],_0x44bfbb);_0x5c64e(_0x40c69b[_0x98f5('0x11')](0x1f4,_0x5e9d73[_0x98f5('0x12')]));});});}; \ No newline at end of file +var _0x02ce=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelQueueReport','create','body'];(function(_0x2510f4,_0x597a8b){var _0x1afbce=function(_0x114a4e){while(--_0x114a4e){_0x2510f4['push'](_0x2510f4['shift']());}};_0x1afbce(++_0x597a8b);}(_0x02ce,0x1ac));var _0xe02c=function(_0x562261,_0x1584af){_0x562261=_0x562261-0x0;var _0x331e36=_0x02ce[_0x562261];return _0x331e36;};'use strict';var _=require(_0xe02c('0x0'));var util=require(_0xe02c('0x1'));var moment=require(_0xe02c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe02c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe02c('0x4'))['db'];var utils=require(_0xe02c('0x5'));var logger=require(_0xe02c('0x6'))(_0xe02c('0x7'));var config=require(_0xe02c('0x8'));var jayson=require(_0xe02c('0x9'));var client=jayson[_0xe02c('0xa')][_0xe02c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36a87f,_0x4fecb3,_0x5eabb0){return new BPromise(function(_0x3c757e,_0x2d85d7){return client[_0xe02c('0xc')](_0x36a87f,_0x5eabb0)[_0xe02c('0xd')](function(_0x2afbf5){logger[_0xe02c('0xe')](_0xe02c('0xf'),_0x4fecb3,_0xe02c('0x10'));logger[_0xe02c('0x11')](_0xe02c('0x12'),_0x4fecb3,_0xe02c('0x10'),JSON[_0xe02c('0x13')](_0x2afbf5));if(_0x2afbf5[_0xe02c('0x14')]){if(_0x2afbf5[_0xe02c('0x14')][_0xe02c('0x15')]===0x1f4){logger[_0xe02c('0x14')](_0xe02c('0xf'),_0x4fecb3,_0x2afbf5[_0xe02c('0x14')]['message']);return _0x2d85d7(_0x2afbf5[_0xe02c('0x14')]['message']);}logger['error'](_0xe02c('0xf'),_0x4fecb3,_0x2afbf5['error'][_0xe02c('0x16')]);return _0x3c757e(_0x2afbf5['error'][_0xe02c('0x16')]);}else{logger['info'](_0xe02c('0xf'),_0x4fecb3,_0xe02c('0x10'));_0x3c757e(_0x2afbf5['result'][_0xe02c('0x16')]);}})[_0xe02c('0x17')](function(_0x51676c){logger[_0xe02c('0x14')](_0xe02c('0xf'),_0x4fecb3,_0x51676c);_0x2d85d7(_0x51676c);});});}exports['CreateOpenchannelQueueReport']=function(_0x52917f){var _0x3e37bf=this;return new Promise(function(_0x49604a,_0x1f8f37){return db[_0xe02c('0x18')][_0xe02c('0x19')](_0x52917f[_0xe02c('0x1a')],{'raw':_0x52917f[_0xe02c('0x1b')]?_0x52917f['options'][_0xe02c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4ea9b5){logger[_0xe02c('0xe')](_0xe02c('0x1d'),_0x52917f);logger['debug'](_0xe02c('0x1d'),_0x52917f,JSON[_0xe02c('0x13')](_0x4ea9b5));_0x49604a(_0x4ea9b5);})['catch'](function(_0x38dce2){logger[_0xe02c('0x14')](_0xe02c('0x1d'),_0x38dce2[_0xe02c('0x16')],_0x52917f);_0x1f8f37(_0x3e37bf[_0xe02c('0x14')](0x1f4,_0x38dce2[_0xe02c('0x16')]));});});};exports[_0xe02c('0x1e')]=function(_0xf41d4c){var _0xeae877=this;return new Promise(function(_0x18b538,_0x60b65e){return db['OpenchannelQueueReport'][_0xe02c('0x1f')](_0xf41d4c[_0xe02c('0x1a')],{'raw':_0xf41d4c[_0xe02c('0x1b')]?_0xf41d4c[_0xe02c('0x1b')][_0xe02c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf41d4c[_0xe02c('0x1b')]?_0xf41d4c[_0xe02c('0x1b')][_0xe02c('0x20')]||null:null,'attributes':_0xf41d4c['options']?_0xf41d4c[_0xe02c('0x1b')][_0xe02c('0x21')]||null:null,'limit':_0xf41d4c[_0xe02c('0x1b')]?_0xf41d4c['options'][_0xe02c('0x22')]||null:null})[_0xe02c('0xd')](function(_0x445421){logger[_0xe02c('0xe')](_0xe02c('0x1e'),_0xf41d4c);logger[_0xe02c('0x11')](_0xe02c('0x1e'),_0xf41d4c,JSON[_0xe02c('0x13')](_0x445421));_0x18b538(_0x445421);})[_0xe02c('0x17')](function(_0x288004){logger[_0xe02c('0x14')]('UpdateOpenchannelQueueReport',_0x288004[_0xe02c('0x16')],_0xf41d4c);_0x60b65e(_0xeae877[_0xe02c('0x14')](0x1f4,_0x288004[_0xe02c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index e4e56da..0192ed1 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 _0xd3fb=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x58dc9a,_0x142c8e){var _0x264c4d=function(_0x1911e9){while(--_0x1911e9){_0x58dc9a['push'](_0x58dc9a['shift']());}};_0x264c4d(++_0x142c8e);}(_0xd3fb,0xf3));var _0xbd3f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd3fb[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xbd3f('0x0'));var util=require('util');var path=require(_0xbd3f('0x1'));var timeout=require(_0xbd3f('0x2'));var express=require(_0xbd3f('0x3'));var router=express[_0xbd3f('0x4')]();var fs_extra=require(_0xbd3f('0x5'));var auth=require(_0xbd3f('0x6'));var interaction=require(_0xbd3f('0x7'));var config=require(_0xbd3f('0x8'));var controller=require(_0xbd3f('0x9'));router[_0xbd3f('0xa')]('/',auth[_0xbd3f('0xb')](),controller['index']);router['get']('/describe',auth[_0xbd3f('0xb')](),controller[_0xbd3f('0xc')]);router['get'](_0xbd3f('0xd'),auth[_0xbd3f('0xb')](),controller[_0xbd3f('0xe')]);router[_0xbd3f('0xf')]('/',auth[_0xbd3f('0xb')](),controller[_0xbd3f('0x10')]);router[_0xbd3f('0x11')](_0xbd3f('0xd'),auth[_0xbd3f('0xb')](),controller[_0xbd3f('0x12')]);router[_0xbd3f('0x13')](_0xbd3f('0xd'),auth[_0xbd3f('0xb')](),controller[_0xbd3f('0x14')]);module[_0xbd3f('0x15')]=router; \ No newline at end of file +var _0x3782=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','update','delete','destroy','exports'];(function(_0xfe4eb9,_0x18be11){var _0x39453e=function(_0x48a960){while(--_0x48a960){_0xfe4eb9['push'](_0xfe4eb9['shift']());}};_0x39453e(++_0x18be11);}(_0x3782,0xf2));var _0x2378=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3782[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2378('0x0'));var util=require(_0x2378('0x1'));var path=require(_0x2378('0x2'));var timeout=require(_0x2378('0x3'));var express=require(_0x2378('0x4'));var router=express[_0x2378('0x5')]();var fs_extra=require(_0x2378('0x6'));var auth=require(_0x2378('0x7'));var interaction=require(_0x2378('0x8'));var config=require(_0x2378('0x9'));var controller=require(_0x2378('0xa'));router[_0x2378('0xb')]('/',auth[_0x2378('0xc')](),controller[_0x2378('0xd')]);router[_0x2378('0xb')](_0x2378('0xe'),auth[_0x2378('0xc')](),controller[_0x2378('0xf')]);router[_0x2378('0xb')](_0x2378('0x10'),auth[_0x2378('0xc')](),controller['show']);router[_0x2378('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x2378('0xc')](),controller[_0x2378('0x12')]);router[_0x2378('0x13')]('/:id',auth[_0x2378('0xc')](),controller[_0x2378('0x14')]);module[_0x2378('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index d80d095..4073123 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x9bde,0xe1));var _0xe9bd=function(_0xda0adb,_0x3cc762){_0xda0adb=_0xda0adb-0x0;var _0x4d8b41=_0x9bde[_0xda0adb];return _0x4d8b41;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5df716,_0x5bfe11){var _0x57a85d=function(_0x2af77b){while(--_0x2af77b){_0x5df716['push'](_0x5df716['shift']());}};_0x57a85d(++_0x5bfe11);}(_0x00bb,0x1d8));var _0xb00b=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x00bb[_0x47a7d0];return _0xb9bd08;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 86a2276..aefe30a 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 _0xa518=['merge','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','offset','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x32f0db,_0x52d403){var _0x3f7c50=function(_0x281df2){while(--_0x281df2){_0x32f0db['push'](_0x32f0db['shift']());}};_0x3f7c50(++_0x52d403);}(_0xa518,0x1a3));var _0x8a51=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xa518[_0x57486e];return _0x5f110b;};'use strict';var emlformat=require(_0x8a51('0x0'));var rimraf=require(_0x8a51('0x1'));var zipdir=require(_0x8a51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a51('0x3'));var moment=require('moment');var BPromise=require(_0x8a51('0x4'));var Mustache=require(_0x8a51('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8a51('0x6'));var csv=require(_0x8a51('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a51('0x8'));var _=require(_0x8a51('0x9'));var squel=require(_0x8a51('0xa'));var crypto=require(_0x8a51('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8a51('0xc'));var toCsv=require(_0x8a51('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8a51('0xd'));var as=require(_0x8a51('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a51('0xf'))('api');var utils=require(_0x8a51('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x8a51('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x432edb,_0x44cd84){_0x44cd84=_0x44cd84||0xcc;return function(_0x76013f){if(_0x76013f){return _0x432edb[_0x8a51('0x12')](_0x44cd84);}return _0x432edb['status'](_0x44cd84)['end']();};}function respondWithResult(_0xa60e44,_0xabd436){_0xabd436=_0xabd436||0xc8;return function(_0x1d8e0a){if(_0x1d8e0a){return _0xa60e44['status'](_0xabd436)['json'](_0x1d8e0a);}};}function respondWithFilteredResult(_0x22fb11,_0x1a1ecd){return function(_0x88963c){if(_0x88963c){var _0x37d95a=typeof _0x1a1ecd[_0x8a51('0x13')]==='undefined'&&typeof _0x1a1ecd['limit']==='undefined';var _0x1113d7=_0x88963c[_0x8a51('0x14')];var _0x4e7241=_0x37d95a?0x0:_0x1a1ecd[_0x8a51('0x13')];var _0x2f814f=_0x37d95a?_0x88963c['count']:_0x1a1ecd[_0x8a51('0x13')]+_0x1a1ecd[_0x8a51('0x15')];var _0x2b6a17;if(_0x2f814f>=_0x1113d7){_0x2f814f=_0x1113d7;_0x2b6a17=0xc8;}else{_0x2b6a17=0xce;}_0x22fb11[_0x8a51('0x16')](_0x2b6a17);return _0x22fb11[_0x8a51('0x17')](_0x8a51('0x18'),_0x4e7241+'-'+_0x2f814f+'/'+_0x1113d7)['json'](_0x88963c);}return null;};}function patchUpdates(_0x4399cf){return function(_0x1502f3){try{jsonpatch[_0x8a51('0x19')](_0x1502f3,_0x4399cf,!![]);}catch(_0x452dc0){return BPromise[_0x8a51('0x1a')](_0x452dc0);}return _0x1502f3[_0x8a51('0x1b')]();};}function saveUpdates(_0x2780f7,_0x7d21f){return function(_0x1c4324){if(_0x1c4324){return _0x1c4324[_0x8a51('0x1c')](_0x2780f7)[_0x8a51('0x1d')](function(_0x5f3e6b){return _0x5f3e6b;});}return null;};}function removeEntity(_0xc22785,_0x15e17a){return function(_0x283879){if(_0x283879){return _0x283879[_0x8a51('0x1e')]()['then'](function(){_0xc22785[_0x8a51('0x16')](0xcc)[_0x8a51('0x1f')]();});}};}function handleEntityNotFound(_0xca2849,_0x3e4545){return function(_0x3ee0fd){if(!_0x3ee0fd){_0xca2849['sendStatus'](0x194);}return _0x3ee0fd;};}function handleError(_0x1d5ad8,_0x403704){_0x403704=_0x403704||0x1f4;return function(_0x1072c8){logger[_0x8a51('0x20')](_0x1072c8[_0x8a51('0x21')]);if(_0x1072c8[_0x8a51('0x22')]){delete _0x1072c8[_0x8a51('0x22')];}_0x1d5ad8[_0x8a51('0x16')](_0x403704)[_0x8a51('0x23')](_0x1072c8);};}exports[_0x8a51('0x24')]=function(_0x308793,_0xb6cc77){var _0x13df48={},_0x2b8453={},_0x42a340={'count':0x0,'rows':[]};var _0xb8f98c=_[_0x8a51('0x25')](db[_0x8a51('0x26')][_0x8a51('0x27')],function(_0x5d4ff7){return{'name':_0x5d4ff7[_0x8a51('0x28')],'type':_0x5d4ff7[_0x8a51('0x29')]['key']};});_0x2b8453[_0x8a51('0x2a')]=_[_0x8a51('0x25')](_0xb8f98c,_0x8a51('0x22'));_0x2b8453[_0x8a51('0x2b')]=_[_0x8a51('0x2c')](_0x308793[_0x8a51('0x2b')]);_0x2b8453[_0x8a51('0x2d')]=_[_0x8a51('0x2e')](_0x2b8453['model'],_0x2b8453['query']);_0x13df48[_0x8a51('0x2f')]=_[_0x8a51('0x2e')](_0x2b8453[_0x8a51('0x2a')],qs[_0x8a51('0x30')](_0x308793[_0x8a51('0x2b')][_0x8a51('0x30')]));_0x13df48[_0x8a51('0x2f')]=_0x13df48[_0x8a51('0x2f')][_0x8a51('0x31')]?_0x13df48[_0x8a51('0x2f')]:_0x2b8453[_0x8a51('0x2a')];if(!_0x308793['query'][_0x8a51('0x32')](_0x8a51('0x33'))){_0x13df48[_0x8a51('0x15')]=qs[_0x8a51('0x15')](_0x308793[_0x8a51('0x2b')]['limit']);_0x13df48['offset']=qs[_0x8a51('0x13')](_0x308793['query'][_0x8a51('0x13')]);}_0x13df48[_0x8a51('0x34')]=qs[_0x8a51('0x35')](_0x308793['query'][_0x8a51('0x35')]);_0x13df48['where']=qs['filters'](_[_0x8a51('0x36')](_0x308793[_0x8a51('0x2b')],_0x2b8453[_0x8a51('0x2d')]),_0xb8f98c);if(_0x308793[_0x8a51('0x2b')][_0x8a51('0x37')]){_0x13df48[_0x8a51('0x38')]=_[_0x8a51('0x39')](_0x13df48[_0x8a51('0x38')],{'$or':_[_0x8a51('0x25')](_0xb8f98c,function(_0x3fa230){if(_0x3fa230['type']!=='VIRTUAL'){var _0x25c360={};_0x25c360[_0x3fa230[_0x8a51('0x22')]]={'$like':'%'+_0x308793[_0x8a51('0x2b')][_0x8a51('0x37')]+'%'};return _0x25c360;}})});}_0x13df48=_['merge']({},_0x13df48,_0x308793[_0x8a51('0x3a')]);var _0x453d1e={'where':_0x13df48[_0x8a51('0x38')]};return db[_0x8a51('0x26')][_0x8a51('0x14')](_0x453d1e)['then'](function(_0x3e4b18){_0x42a340[_0x8a51('0x14')]=_0x3e4b18;if(_0x308793[_0x8a51('0x2b')][_0x8a51('0x3b')]){_0x13df48[_0x8a51('0x3c')]=[{'all':!![]}];}return db[_0x8a51('0x26')][_0x8a51('0x3d')](_0x13df48);})[_0x8a51('0x1d')](function(_0x4e20d4){_0x42a340['rows']=_0x4e20d4;return _0x42a340;})[_0x8a51('0x1d')](respondWithFilteredResult(_0xb6cc77,_0x13df48))[_0x8a51('0x3e')](handleError(_0xb6cc77,null));};exports['show']=function(_0x5ec577,_0x1dd109){var _0x5ce508={'raw':!![],'where':{'id':_0x5ec577[_0x8a51('0x3f')]['id']}},_0xf438c2={};_0xf438c2[_0x8a51('0x2a')]=_[_0x8a51('0x2c')](db['OpenchannelTransferReport'][_0x8a51('0x27')]);_0xf438c2[_0x8a51('0x2b')]=_[_0x8a51('0x2c')](_0x5ec577[_0x8a51('0x2b')]);_0xf438c2[_0x8a51('0x2d')]=_[_0x8a51('0x2e')](_0xf438c2[_0x8a51('0x2a')],_0xf438c2[_0x8a51('0x2b')]);_0x5ce508[_0x8a51('0x2f')]=_[_0x8a51('0x2e')](_0xf438c2[_0x8a51('0x2a')],qs[_0x8a51('0x30')](_0x5ec577['query'][_0x8a51('0x30')]));_0x5ce508[_0x8a51('0x2f')]=_0x5ce508[_0x8a51('0x2f')][_0x8a51('0x31')]?_0x5ce508['attributes']:_0xf438c2[_0x8a51('0x2a')];if(_0x5ec577[_0x8a51('0x2b')][_0x8a51('0x3b')]){_0x5ce508[_0x8a51('0x3c')]=[{'all':!![]}];}_0x5ce508=_[_0x8a51('0x39')]({},_0x5ce508,_0x5ec577[_0x8a51('0x3a')]);return db[_0x8a51('0x26')][_0x8a51('0x40')](_0x5ce508)[_0x8a51('0x1d')](handleEntityNotFound(_0x1dd109,null))[_0x8a51('0x1d')](respondWithResult(_0x1dd109,null))[_0x8a51('0x3e')](handleError(_0x1dd109,null));};exports[_0x8a51('0x41')]=function(_0x23de19,_0x57e8){return db[_0x8a51('0x26')]['create'](_0x23de19[_0x8a51('0x42')],{})[_0x8a51('0x1d')](respondWithResult(_0x57e8,0xc9))[_0x8a51('0x3e')](handleError(_0x57e8,null));};exports[_0x8a51('0x1c')]=function(_0x54955a,_0x19a0ef){if(_0x54955a[_0x8a51('0x42')]['id']){delete _0x54955a[_0x8a51('0x42')]['id'];}return db[_0x8a51('0x26')][_0x8a51('0x40')]({'where':{'id':_0x54955a[_0x8a51('0x3f')]['id']}})[_0x8a51('0x1d')](handleEntityNotFound(_0x19a0ef,null))['then'](saveUpdates(_0x54955a['body'],null))[_0x8a51('0x1d')](respondWithResult(_0x19a0ef,null))[_0x8a51('0x3e')](handleError(_0x19a0ef,null));};exports[_0x8a51('0x1e')]=function(_0x308c26,_0x5aca1f){return db[_0x8a51('0x26')][_0x8a51('0x40')]({'where':{'id':_0x308c26['params']['id']}})[_0x8a51('0x1d')](handleEntityNotFound(_0x5aca1f,null))[_0x8a51('0x1d')](removeEntity(_0x5aca1f,null))[_0x8a51('0x3e')](handleError(_0x5aca1f,null));};exports[_0x8a51('0x43')]=function(_0x56ae67,_0x2af5a0){return db[_0x8a51('0x26')][_0x8a51('0x43')]()[_0x8a51('0x1d')](respondWithResult(_0x2af5a0,null))[_0x8a51('0x3e')](handleError(_0x2af5a0,null));}; \ No newline at end of file +var _0x1582=['where','pick','filter','merge','type','VIRTUAL','options','OpenchannelTransferReport','includeAll','findAll','rows','catch','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort'];(function(_0x329a90,_0x358158){var _0x2f8e6d=function(_0xb910c){while(--_0xb910c){_0x329a90['push'](_0x329a90['shift']());}};_0x2f8e6d(++_0x358158);}(_0x1582,0x1d4));var _0x2158=function(_0x324645,_0xdc9c60){_0x324645=_0x324645-0x0;var _0x518909=_0x1582[_0x324645];return _0x518909;};'use strict';var emlformat=require(_0x2158('0x0'));var rimraf=require(_0x2158('0x1'));var zipdir=require(_0x2158('0x2'));var jsonpatch=require(_0x2158('0x3'));var rp=require('request-promise');var moment=require(_0x2158('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2158('0x5'));var path=require(_0x2158('0x6'));var sox=require('sox');var csv=require(_0x2158('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2158('0x8'));var _=require(_0x2158('0x9'));var squel=require(_0x2158('0xa'));var crypto=require(_0x2158('0xb'));var jsforce=require(_0x2158('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2158('0x7'));var querystring=require(_0x2158('0xd'));var Papa=require(_0x2158('0xe'));var Redis=require(_0x2158('0xf'));var authService=require(_0x2158('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2158('0x11'));var hardwareService=require(_0x2158('0x12'));var logger=require(_0x2158('0x13'))(_0x2158('0x14'));var utils=require(_0x2158('0x15'));var config=require(_0x2158('0x16'));var licenseUtil=require(_0x2158('0x17'));var db=require(_0x2158('0x18'))['db'];function respondWithStatusCode(_0xe60555,_0x370837){_0x370837=_0x370837||0xcc;return function(_0x243f8c){if(_0x243f8c){return _0xe60555['sendStatus'](_0x370837);}return _0xe60555[_0x2158('0x19')](_0x370837)[_0x2158('0x1a')]();};}function respondWithResult(_0x44d61a,_0xed07e9){_0xed07e9=_0xed07e9||0xc8;return function(_0x1f3dd1){if(_0x1f3dd1){return _0x44d61a[_0x2158('0x19')](_0xed07e9)['json'](_0x1f3dd1);}};}function respondWithFilteredResult(_0x10257f,_0x4f3937){return function(_0x1ba013){if(_0x1ba013){var _0x4102c0=typeof _0x4f3937[_0x2158('0x1b')]===_0x2158('0x1c')&&typeof _0x4f3937[_0x2158('0x1d')]==='undefined';var _0x3d36ce=_0x1ba013['count'];var _0x3608e5=_0x4102c0?0x0:_0x4f3937[_0x2158('0x1b')];var _0x592426=_0x4102c0?_0x1ba013[_0x2158('0x1e')]:_0x4f3937['offset']+_0x4f3937['limit'];var _0x43bcfb;if(_0x592426>=_0x3d36ce){_0x592426=_0x3d36ce;_0x43bcfb=0xc8;}else{_0x43bcfb=0xce;}_0x10257f['status'](_0x43bcfb);return _0x10257f[_0x2158('0x1f')](_0x2158('0x20'),_0x3608e5+'-'+_0x592426+'/'+_0x3d36ce)['json'](_0x1ba013);}return null;};}function patchUpdates(_0x3919d5){return function(_0x39b6d1){try{jsonpatch[_0x2158('0x21')](_0x39b6d1,_0x3919d5,!![]);}catch(_0x860e3a){return BPromise[_0x2158('0x22')](_0x860e3a);}return _0x39b6d1[_0x2158('0x23')]();};}function saveUpdates(_0x13961c,_0x24d9e8){return function(_0xcea525){if(_0xcea525){return _0xcea525[_0x2158('0x24')](_0x13961c)[_0x2158('0x25')](function(_0x590314){return _0x590314;});}return null;};}function removeEntity(_0x460926,_0x1f4325){return function(_0x561cf6){if(_0x561cf6){return _0x561cf6[_0x2158('0x26')]()[_0x2158('0x25')](function(){_0x460926[_0x2158('0x19')](0xcc)[_0x2158('0x1a')]();});}};}function handleEntityNotFound(_0x159830,_0x192474){return function(_0x5a7cad){if(!_0x5a7cad){_0x159830[_0x2158('0x27')](0x194);}return _0x5a7cad;};}function handleError(_0x2ca52f,_0x1b344b){_0x1b344b=_0x1b344b||0x1f4;return function(_0xa23c43){logger[_0x2158('0x28')](_0xa23c43[_0x2158('0x29')]);if(_0xa23c43[_0x2158('0x2a')]){delete _0xa23c43['name'];}_0x2ca52f[_0x2158('0x19')](_0x1b344b)['send'](_0xa23c43);};}exports[_0x2158('0x2b')]=function(_0x308070,_0x326392){var _0x2a8771={},_0x393167={},_0xaf8d9={'count':0x0,'rows':[]};var _0x137211=_[_0x2158('0x2c')](db['OpenchannelTransferReport'][_0x2158('0x2d')],function(_0xc0d973){return{'name':_0xc0d973[_0x2158('0x2e')],'type':_0xc0d973['type']['key']};});_0x393167[_0x2158('0x2f')]=_[_0x2158('0x2c')](_0x137211,_0x2158('0x2a'));_0x393167[_0x2158('0x30')]=_[_0x2158('0x31')](_0x308070[_0x2158('0x30')]);_0x393167[_0x2158('0x32')]=_[_0x2158('0x33')](_0x393167['model'],_0x393167['query']);_0x2a8771['attributes']=_[_0x2158('0x33')](_0x393167['model'],qs[_0x2158('0x34')](_0x308070[_0x2158('0x30')][_0x2158('0x34')]));_0x2a8771[_0x2158('0x35')]=_0x2a8771['attributes'][_0x2158('0x36')]?_0x2a8771[_0x2158('0x35')]:_0x393167[_0x2158('0x2f')];if(!_0x308070['query'][_0x2158('0x37')]('nolimit')){_0x2a8771[_0x2158('0x1d')]=qs['limit'](_0x308070[_0x2158('0x30')][_0x2158('0x1d')]);_0x2a8771[_0x2158('0x1b')]=qs[_0x2158('0x1b')](_0x308070['query'][_0x2158('0x1b')]);}_0x2a8771['order']=qs[_0x2158('0x38')](_0x308070['query'][_0x2158('0x38')]);_0x2a8771[_0x2158('0x39')]=qs[_0x2158('0x32')](_[_0x2158('0x3a')](_0x308070['query'],_0x393167['filters']),_0x137211);if(_0x308070[_0x2158('0x30')][_0x2158('0x3b')]){_0x2a8771['where']=_[_0x2158('0x3c')](_0x2a8771[_0x2158('0x39')],{'$or':_[_0x2158('0x2c')](_0x137211,function(_0xff1594){if(_0xff1594[_0x2158('0x3d')]!==_0x2158('0x3e')){var _0x3f4833={};_0x3f4833[_0xff1594[_0x2158('0x2a')]]={'$like':'%'+_0x308070[_0x2158('0x30')][_0x2158('0x3b')]+'%'};return _0x3f4833;}})});}_0x2a8771=_['merge']({},_0x2a8771,_0x308070[_0x2158('0x3f')]);var _0x450c49={'where':_0x2a8771[_0x2158('0x39')]};return db[_0x2158('0x40')][_0x2158('0x1e')](_0x450c49)[_0x2158('0x25')](function(_0x2bb537){_0xaf8d9['count']=_0x2bb537;if(_0x308070[_0x2158('0x30')][_0x2158('0x41')]){_0x2a8771['include']=[{'all':!![]}];}return db[_0x2158('0x40')][_0x2158('0x42')](_0x2a8771);})[_0x2158('0x25')](function(_0x57c9a1){_0xaf8d9[_0x2158('0x43')]=_0x57c9a1;return _0xaf8d9;})[_0x2158('0x25')](respondWithFilteredResult(_0x326392,_0x2a8771))[_0x2158('0x44')](handleError(_0x326392,null));};exports['show']=function(_0x45e76b,_0x11ad46){var _0x32a56e={'raw':!![],'where':{'id':_0x45e76b[_0x2158('0x45')]['id']}},_0x384f3a={};_0x384f3a['model']=_['keys'](db[_0x2158('0x40')][_0x2158('0x2d')]);_0x384f3a[_0x2158('0x30')]=_[_0x2158('0x31')](_0x45e76b[_0x2158('0x30')]);_0x384f3a[_0x2158('0x32')]=_[_0x2158('0x33')](_0x384f3a[_0x2158('0x2f')],_0x384f3a[_0x2158('0x30')]);_0x32a56e[_0x2158('0x35')]=_[_0x2158('0x33')](_0x384f3a[_0x2158('0x2f')],qs[_0x2158('0x34')](_0x45e76b[_0x2158('0x30')]['fields']));_0x32a56e[_0x2158('0x35')]=_0x32a56e[_0x2158('0x35')]['length']?_0x32a56e['attributes']:_0x384f3a[_0x2158('0x2f')];if(_0x45e76b['query'][_0x2158('0x41')]){_0x32a56e[_0x2158('0x46')]=[{'all':!![]}];}_0x32a56e=_['merge']({},_0x32a56e,_0x45e76b[_0x2158('0x3f')]);return db[_0x2158('0x40')][_0x2158('0x47')](_0x32a56e)[_0x2158('0x25')](handleEntityNotFound(_0x11ad46,null))[_0x2158('0x25')](respondWithResult(_0x11ad46,null))[_0x2158('0x44')](handleError(_0x11ad46,null));};exports[_0x2158('0x48')]=function(_0x499eaf,_0x4ca615){return db[_0x2158('0x40')][_0x2158('0x48')](_0x499eaf[_0x2158('0x49')],{})[_0x2158('0x25')](respondWithResult(_0x4ca615,0xc9))['catch'](handleError(_0x4ca615,null));};exports['update']=function(_0x19e37a,_0x188283){if(_0x19e37a[_0x2158('0x49')]['id']){delete _0x19e37a[_0x2158('0x49')]['id'];}return db['OpenchannelTransferReport'][_0x2158('0x47')]({'where':{'id':_0x19e37a['params']['id']}})['then'](handleEntityNotFound(_0x188283,null))[_0x2158('0x25')](saveUpdates(_0x19e37a['body'],null))[_0x2158('0x25')](respondWithResult(_0x188283,null))[_0x2158('0x44')](handleError(_0x188283,null));};exports['destroy']=function(_0xef1f2,_0x4e2ab3){return db[_0x2158('0x40')][_0x2158('0x47')]({'where':{'id':_0xef1f2[_0x2158('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e2ab3,null))[_0x2158('0x25')](removeEntity(_0x4e2ab3,null))[_0x2158('0x44')](handleError(_0x4e2ab3,null));};exports[_0x2158('0x4a')]=function(_0x3d026c,_0x728d38){return db[_0x2158('0x40')][_0x2158('0x4a')]()[_0x2158('0x25')](respondWithResult(_0x728d38,null))[_0x2158('0x44')](handleError(_0x728d38,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e164e3a..c73e841 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 _0x2c2c=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','define'];(function(_0x2b7d94,_0xaa50ab){var _0x34a28c=function(_0x7d3f8a){while(--_0x7d3f8a){_0x2b7d94['push'](_0x2b7d94['shift']());}};_0x34a28c(++_0xaa50ab);}(_0x2c2c,0x107));var _0xc2c2=function(_0x5cb5bb,_0x53ba7b){_0x5cb5bb=_0x5cb5bb-0x0;var _0x5df83f=_0x2c2c[_0x5cb5bb];return _0x5df83f;};'use strict';var _=require('lodash');var util=require(_0xc2c2('0x0'));var logger=require(_0xc2c2('0x1'))('api');var moment=require(_0xc2c2('0x2'));var BPromise=require('bluebird');var rp=require(_0xc2c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2c2('0x4'));var config=require(_0xc2c2('0x5'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x48970e,_0x356b6f){return _0x48970e[_0xc2c2('0x6')](_0xc2c2('0x7'),attributes,{'tableName':_0xc2c2('0x8'),'paranoid':![],'indexes':[{'name':_0xc2c2('0x9'),'fields':[_0xc2c2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ca7=['../../config/logger','moment','bluebird','path','rimraf','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2ca7,0x12a));var _0x72ca=function(_0x4edb69,_0x39e24b){_0x4edb69=_0x4edb69-0x0;var _0x2f8e49=_0x2ca7[_0x4edb69];return _0x2f8e49;};'use strict';var _=require(_0x72ca('0x0'));var util=require(_0x72ca('0x1'));var logger=require(_0x72ca('0x2'))('api');var moment=require(_0x72ca('0x3'));var BPromise=require(_0x72ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72ca('0x5'));var rimraf=require(_0x72ca('0x6'));var config=require('../../config/environment');var attributes=require(_0x72ca('0x7'));module[_0x72ca('0x8')]=function(_0x9727e6,_0x37f632){return _0x9727e6[_0x72ca('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x72ca('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x72ca('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d1c39cb..ed65c79 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 _0xac31=['code','OpenchannelTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5db59c,_0x11cc79){var _0x2a1f41=function(_0x35cfa4){while(--_0x35cfa4){_0x5db59c['push'](_0x5db59c['shift']());}};_0x2a1f41(++_0x11cc79);}(_0xac31,0xca));var _0x1ac3=function(_0x3090db,_0x507d0d){_0x3090db=_0x3090db-0x0;var _0x598daf=_0xac31[_0x3090db];return _0x598daf;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file +var _0xdb94=['request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xdb94,0xe5));var _0x4db9=function(_0x413c34,_0xc4458a){_0x413c34=_0x413c34-0x0;var _0x5b1f58=_0xdb94[_0x413c34];return _0x5b1f58;};'use strict';var _=require('lodash');var util=require(_0x4db9('0x0'));var moment=require(_0x4db9('0x1'));var BPromise=require('bluebird');var rs=require(_0x4db9('0x2'));var fs=require('fs');var Redis=require(_0x4db9('0x3'));var db=require(_0x4db9('0x4'))['db'];var utils=require(_0x4db9('0x5'));var logger=require(_0x4db9('0x6'))('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4db9('0x8')][_0x4db9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dddb9,_0x3404f6,_0x42a857){return new BPromise(function(_0x57c701,_0x45d5a3){return client[_0x4db9('0xa')](_0x1dddb9,_0x42a857)[_0x4db9('0xb')](function(_0x3501f9){logger[_0x4db9('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3404f6,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x3404f6,_0x4db9('0xd'),JSON[_0x4db9('0x10')](_0x3501f9));if(_0x3501f9[_0x4db9('0x11')]){if(_0x3501f9['error'][_0x4db9('0x12')]===0x1f4){logger[_0x4db9('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3404f6,_0x3501f9['error'][_0x4db9('0x13')]);return _0x45d5a3(_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);}logger['error'](_0x4db9('0x14'),_0x3404f6,_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);return _0x57c701(_0x3501f9[_0x4db9('0x11')][_0x4db9('0x13')]);}else{logger['info'](_0x4db9('0x14'),_0x3404f6,_0x4db9('0xd'));_0x57c701(_0x3501f9['result'][_0x4db9('0x13')]);}})[_0x4db9('0x15')](function(_0x42fbb8){logger['error'](_0x4db9('0x14'),_0x3404f6,_0x42fbb8);_0x45d5a3(_0x42fbb8);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0ff0845..e4e0e26 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 _0x3f22=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','post'];(function(_0x331a41,_0x9a4aa0){var _0x1bf696=function(_0x260ce1){while(--_0x260ce1){_0x331a41['push'](_0x331a41['shift']());}};_0x1bf696(++_0x9a4aa0);}(_0x3f22,0x18b));var _0x23f2=function(_0x55ce3a,_0x293f93){_0x55ce3a=_0x55ce3a-0x0;var _0x20dc2f=_0x3f22[_0x55ce3a];return _0x20dc2f;};'use strict';var multer=require(_0x23f2('0x0'));var util=require(_0x23f2('0x1'));var path=require(_0x23f2('0x2'));var timeout=require(_0x23f2('0x3'));var express=require(_0x23f2('0x4'));var router=express[_0x23f2('0x5')]();var fs_extra=require(_0x23f2('0x6'));var auth=require(_0x23f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x23f2('0x8')]('/',auth[_0x23f2('0x9')](),controller[_0x23f2('0xa')]);router[_0x23f2('0x8')](_0x23f2('0xb'),auth[_0x23f2('0x9')](),controller['show']);router[_0x23f2('0xc')]('/',auth[_0x23f2('0x9')](),controller['create']);router[_0x23f2('0xd')](_0x23f2('0xb'),auth[_0x23f2('0x9')](),controller[_0x23f2('0xe')]);router[_0x23f2('0xf')](_0x23f2('0xb'),auth[_0x23f2('0x9')](),controller['destroy']);module[_0x23f2('0x10')]=router; \ No newline at end of file +var _0x649c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','post','create','put','delete','util'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x649c,0x1cf));var _0xc649=function(_0x2bf03d,_0x47207e){_0x2bf03d=_0x2bf03d-0x0;var _0x5e1c1b=_0x649c[_0x2bf03d];return _0x5e1c1b;};'use strict';var multer=require('multer');var util=require(_0xc649('0x0'));var path=require('path');var timeout=require(_0xc649('0x1'));var express=require(_0xc649('0x2'));var router=express[_0xc649('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc649('0x4'));var interaction=require(_0xc649('0x5'));var config=require(_0xc649('0x6'));var controller=require(_0xc649('0x7'));router[_0xc649('0x8')]('/',auth[_0xc649('0x9')](),controller[_0xc649('0xa')]);router[_0xc649('0x8')](_0xc649('0xb'),auth[_0xc649('0x9')](),controller['show']);router[_0xc649('0xc')]('/',auth['isAuthenticated'](),controller[_0xc649('0xd')]);router[_0xc649('0xe')](_0xc649('0xb'),auth[_0xc649('0x9')](),controller['update']);router[_0xc649('0xf')](_0xc649('0xb'),auth[_0xc649('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 95ec43a..7b6e10e 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 _0x4d6d=['sequelize','exports','name'];(function(_0x211c9c,_0x5c5a83){var _0x367e88=function(_0x1b29bd){while(--_0x1b29bd){_0x211c9c['push'](_0x211c9c['shift']());}};_0x367e88(++_0x5c5a83);}(_0x4d6d,0x84));var _0xd4d6=function(_0x5b84cd,_0x1102eb){_0x5b84cd=_0x5b84cd-0x0;var _0x231456=_0x4d6d[_0x5b84cd];return _0x231456;};'use strict';var Sequelize=require(_0xd4d6('0x0'));module[_0xd4d6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd4d6('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c1e=['STRING','name','sequelize','exports'];(function(_0xb4d8e7,_0x1c9f15){var _0x54b3f4=function(_0xd7bb1b){while(--_0xd7bb1b){_0xb4d8e7['push'](_0xb4d8e7['shift']());}};_0x54b3f4(++_0x1c9f15);}(_0x9c1e,0xe6));var _0xe9c1=function(_0x51b65b,_0x437865){_0x51b65b=_0x51b65b-0x0;var _0x52aa3f=_0x9c1e[_0x51b65b];return _0x52aa3f;};'use strict';var Sequelize=require(_0xe9c1('0x0'));module[_0xe9c1('0x1')]={'name':{'type':Sequelize[_0xe9c1('0x2')],'unique':_0xe9c1('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xe9c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 385789a..e886c82 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 _0xdba7=['UserProfileResource','end','error','stack','name','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','update','then','destroy','get','Pauses'];(function(_0x5a0a9f,_0x1ad79a){var _0x5b27c0=function(_0x447608){while(--_0x447608){_0x5a0a9f['push'](_0x5a0a9f['shift']());}};_0x5b27c0(++_0x1ad79a);}(_0xdba7,0xd3));var _0x7dba=function(_0x3a4b38,_0x3e6c6d){_0x3a4b38=_0x3a4b38-0x0;var _0x4e65ee=_0xdba7[_0x3a4b38];return _0x4e65ee;};'use strict';var emlformat=require(_0x7dba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7dba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7dba('0x2'));var BPromise=require(_0x7dba('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7dba('0x4'));var sox=require('sox');var csv=require(_0x7dba('0x5'));var ejs=require(_0x7dba('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dba('0x7'));var squel=require(_0x7dba('0x8'));var crypto=require(_0x7dba('0x9'));var jsforce=require(_0x7dba('0xa'));var deskjs=require(_0x7dba('0xb'));var toCsv=require(_0x7dba('0x5'));var querystring=require(_0x7dba('0xc'));var Papa=require(_0x7dba('0xd'));var Redis=require(_0x7dba('0xe'));var authService=require(_0x7dba('0xf'));var qs=require(_0x7dba('0x10'));var as=require(_0x7dba('0x11'));var hardwareService=require(_0x7dba('0x12'));var logger=require(_0x7dba('0x13'))(_0x7dba('0x14'));var utils=require(_0x7dba('0x15'));var config=require(_0x7dba('0x16'));var licenseUtil=require(_0x7dba('0x17'));var db=require(_0x7dba('0x18'))['db'];function respondWithStatusCode(_0x505897,_0x2adeef){_0x2adeef=_0x2adeef||0xcc;return function(_0x1787ee){if(_0x1787ee){return _0x505897[_0x7dba('0x19')](_0x2adeef);}return _0x505897[_0x7dba('0x1a')](_0x2adeef)['end']();};}function respondWithResult(_0x5d0dd0,_0x233b6b){_0x233b6b=_0x233b6b||0xc8;return function(_0x715831){if(_0x715831){return _0x5d0dd0['status'](_0x233b6b)[_0x7dba('0x1b')](_0x715831);}};}function respondWithFilteredResult(_0x174f5e,_0x41c672){return function(_0x14ff43){if(_0x14ff43){var _0x4a79b9=typeof _0x41c672[_0x7dba('0x1c')]===_0x7dba('0x1d')&&typeof _0x41c672[_0x7dba('0x1e')]===_0x7dba('0x1d');var _0x482de9=_0x14ff43[_0x7dba('0x1f')];var _0xfeaeaa=_0x4a79b9?0x0:_0x41c672[_0x7dba('0x1c')];var _0x35f5cb=_0x4a79b9?_0x14ff43[_0x7dba('0x1f')]:_0x41c672[_0x7dba('0x1c')]+_0x41c672[_0x7dba('0x1e')];var _0x286acd;if(_0x35f5cb>=_0x482de9){_0x35f5cb=_0x482de9;_0x286acd=0xc8;}else{_0x286acd=0xce;}_0x174f5e['status'](_0x286acd);return _0x174f5e['set']('Content-Range',_0xfeaeaa+'-'+_0x35f5cb+'/'+_0x482de9)[_0x7dba('0x1b')](_0x14ff43);}return null;};}function patchUpdates(_0xdfb7eb){return function(_0x36e96c){try{jsonpatch['apply'](_0x36e96c,_0xdfb7eb,!![]);}catch(_0x1db40e){return BPromise[_0x7dba('0x20')](_0x1db40e);}return _0x36e96c['save']();};}function saveUpdates(_0x4088da,_0x325b72){return function(_0x45f86f){if(_0x45f86f){return _0x45f86f[_0x7dba('0x21')](_0x4088da)[_0x7dba('0x22')](function(_0x55190b){return _0x55190b;});}return null;};}function removeEntity(_0x2250f5,_0x5dad10){return function(_0x12ecbe){if(_0x12ecbe){return _0x12ecbe[_0x7dba('0x23')]()[_0x7dba('0x22')](function(){var _0x4763d1=_0x12ecbe[_0x7dba('0x24')]({'plain':!![]});var _0x5537be=_0x7dba('0x25');return db[_0x7dba('0x26')][_0x7dba('0x23')]({'where':{'type':_0x5537be,'resourceId':_0x4763d1['id']}})[_0x7dba('0x22')](function(){return _0x12ecbe;});})[_0x7dba('0x22')](function(){_0x2250f5[_0x7dba('0x1a')](0xcc)[_0x7dba('0x27')]();});}};}function handleEntityNotFound(_0x294af1,_0x36e9d9){return function(_0x59d915){if(!_0x59d915){_0x294af1[_0x7dba('0x19')](0x194);}return _0x59d915;};}function handleError(_0x3cd65c,_0x50c1eb){_0x50c1eb=_0x50c1eb||0x1f4;return function(_0x251202){logger[_0x7dba('0x28')](_0x251202[_0x7dba('0x29')]);if(_0x251202['name']){delete _0x251202[_0x7dba('0x2a')];}_0x3cd65c[_0x7dba('0x1a')](_0x50c1eb)['send'](_0x251202);};}exports[_0x7dba('0x2b')]=function(_0x2ef134,_0x51367e){var _0x4e52d1={},_0x35e0b6={},_0xfb5ba7={'count':0x0,'rows':[]};var _0x40775e=_[_0x7dba('0x2c')](db[_0x7dba('0x2d')][_0x7dba('0x2e')],function(_0x46fc81){return{'name':_0x46fc81[_0x7dba('0x2f')],'type':_0x46fc81[_0x7dba('0x30')][_0x7dba('0x31')]};});_0x35e0b6[_0x7dba('0x32')]=_['map'](_0x40775e,_0x7dba('0x2a'));_0x35e0b6[_0x7dba('0x33')]=_[_0x7dba('0x34')](_0x2ef134[_0x7dba('0x33')]);_0x35e0b6[_0x7dba('0x35')]=_['intersection'](_0x35e0b6[_0x7dba('0x32')],_0x35e0b6[_0x7dba('0x33')]);_0x4e52d1[_0x7dba('0x36')]=_[_0x7dba('0x37')](_0x35e0b6['model'],qs['fields'](_0x2ef134['query'][_0x7dba('0x38')]));_0x4e52d1[_0x7dba('0x36')]=_0x4e52d1['attributes'][_0x7dba('0x39')]?_0x4e52d1[_0x7dba('0x36')]:_0x35e0b6[_0x7dba('0x32')];if(!_0x2ef134[_0x7dba('0x33')][_0x7dba('0x3a')](_0x7dba('0x3b'))){_0x4e52d1['limit']=qs[_0x7dba('0x1e')](_0x2ef134[_0x7dba('0x33')]['limit']);_0x4e52d1[_0x7dba('0x1c')]=qs[_0x7dba('0x1c')](_0x2ef134['query']['offset']);}_0x4e52d1[_0x7dba('0x3c')]=qs[_0x7dba('0x3d')](_0x2ef134['query'][_0x7dba('0x3d')]);_0x4e52d1[_0x7dba('0x3e')]=qs[_0x7dba('0x35')](_[_0x7dba('0x3f')](_0x2ef134[_0x7dba('0x33')],_0x35e0b6[_0x7dba('0x35')]),_0x40775e);if(_0x2ef134[_0x7dba('0x33')][_0x7dba('0x40')]){_0x4e52d1[_0x7dba('0x3e')]=_['merge'](_0x4e52d1[_0x7dba('0x3e')],{'$or':_[_0x7dba('0x2c')](_0x40775e,function(_0x3629d4){if(_0x3629d4[_0x7dba('0x30')]!==_0x7dba('0x41')){var _0x49201b={};_0x49201b[_0x3629d4[_0x7dba('0x2a')]]={'$like':'%'+_0x2ef134[_0x7dba('0x33')][_0x7dba('0x40')]+'%'};return _0x49201b;}})});}_0x4e52d1=_['merge']({},_0x4e52d1,_0x2ef134[_0x7dba('0x42')]);var _0x543e02={'where':_0x4e52d1[_0x7dba('0x3e')]};return db[_0x7dba('0x2d')][_0x7dba('0x1f')](_0x543e02)[_0x7dba('0x22')](function(_0x2951d6){_0xfb5ba7[_0x7dba('0x1f')]=_0x2951d6;if(_0x2ef134[_0x7dba('0x33')]['includeAll']){_0x4e52d1[_0x7dba('0x43')]=[{'all':!![]}];}return db['Pause'][_0x7dba('0x44')](_0x4e52d1);})[_0x7dba('0x22')](function(_0x484230){_0xfb5ba7[_0x7dba('0x45')]=_0x484230;return _0xfb5ba7;})[_0x7dba('0x22')](respondWithFilteredResult(_0x51367e,_0x4e52d1))[_0x7dba('0x46')](handleError(_0x51367e,null));};exports[_0x7dba('0x47')]=function(_0x2d6970,_0x5c7e82){var _0x559f00={'raw':!![],'where':{'id':_0x2d6970[_0x7dba('0x48')]['id']}},_0x3013af={};_0x3013af[_0x7dba('0x32')]=_[_0x7dba('0x34')](db[_0x7dba('0x2d')]['rawAttributes']);_0x3013af[_0x7dba('0x33')]=_[_0x7dba('0x34')](_0x2d6970[_0x7dba('0x33')]);_0x3013af[_0x7dba('0x35')]=_['intersection'](_0x3013af[_0x7dba('0x32')],_0x3013af[_0x7dba('0x33')]);_0x559f00[_0x7dba('0x36')]=_['intersection'](_0x3013af[_0x7dba('0x32')],qs[_0x7dba('0x38')](_0x2d6970[_0x7dba('0x33')][_0x7dba('0x38')]));_0x559f00[_0x7dba('0x36')]=_0x559f00[_0x7dba('0x36')]['length']?_0x559f00['attributes']:_0x3013af[_0x7dba('0x32')];if(_0x2d6970['query'][_0x7dba('0x49')]){_0x559f00[_0x7dba('0x43')]=[{'all':!![]}];}_0x559f00=_['merge']({},_0x559f00,_0x2d6970['options']);return db['Pause'][_0x7dba('0x4a')](_0x559f00)[_0x7dba('0x22')](handleEntityNotFound(_0x5c7e82,null))[_0x7dba('0x22')](respondWithResult(_0x5c7e82,null))['catch'](handleError(_0x5c7e82,null));};exports[_0x7dba('0x4b')]=function(_0x37692d,_0x2e56db){return db['Pause']['create'](_0x37692d['body'],{})[_0x7dba('0x22')](function(_0x35bd2d){var _0x4037e5=_0x37692d[_0x7dba('0x4c')][_0x7dba('0x24')]({'plain':!![]});if(!_0x4037e5)throw new Error(_0x7dba('0x4d'));if(_0x4037e5[_0x7dba('0x4e')]===_0x7dba('0x4c')){var _0x2fe756=_0x35bd2d[_0x7dba('0x24')]({'plain':!![]});var _0x43d406=_0x7dba('0x25');return db[_0x7dba('0x4f')]['find']({'where':{'name':_0x43d406,'userProfileId':_0x4037e5['userProfileId']},'raw':!![]})[_0x7dba('0x22')](function(_0x582faf){if(_0x582faf&&_0x582faf[_0x7dba('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2fe756[_0x7dba('0x2a')],'resourceId':_0x2fe756['id'],'type':_0x582faf[_0x7dba('0x2a')],'sectionId':_0x582faf['id']},{})[_0x7dba('0x22')](function(){return _0x35bd2d;});}else{return _0x35bd2d;}})[_0x7dba('0x46')](function(_0x37fcbc){logger['error'](_0x7dba('0x51'),_0x37fcbc);throw _0x37fcbc;});}return _0x35bd2d;})[_0x7dba('0x22')](respondWithResult(_0x2e56db,0xc9))['catch'](handleError(_0x2e56db,null));};exports[_0x7dba('0x21')]=function(_0x415c74,_0x4c5da){if(_0x415c74[_0x7dba('0x52')]['id']){delete _0x415c74[_0x7dba('0x52')]['id'];}return db[_0x7dba('0x2d')][_0x7dba('0x4a')]({'where':{'id':_0x415c74['params']['id']}})[_0x7dba('0x22')](handleEntityNotFound(_0x4c5da,null))[_0x7dba('0x22')](saveUpdates(_0x415c74[_0x7dba('0x52')],null))['then'](respondWithResult(_0x4c5da,null))['catch'](handleError(_0x4c5da,null));};exports[_0x7dba('0x23')]=function(_0x5bd32f,_0x341cc9){return db[_0x7dba('0x2d')][_0x7dba('0x4a')]({'where':{'id':_0x5bd32f[_0x7dba('0x48')]['id']}})[_0x7dba('0x22')](handleEntityNotFound(_0x341cc9,null))[_0x7dba('0x22')](removeEntity(_0x341cc9,null))['catch'](handleError(_0x341cc9,null));}; \ No newline at end of file +var _0x3929=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','stack','name','index','map','Pause','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','findAll','rows','catch','params','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x37ad08,_0x43a0ca){var _0x595444=function(_0x4a7246){while(--_0x4a7246){_0x37ad08['push'](_0x37ad08['shift']());}};_0x595444(++_0x43a0ca);}(_0x3929,0x13c));var _0x9392=function(_0x4baa11,_0x7c6290){_0x4baa11=_0x4baa11-0x0;var _0x219273=_0x3929[_0x4baa11];return _0x219273;};'use strict';var emlformat=require(_0x9392('0x0'));var rimraf=require(_0x9392('0x1'));var zipdir=require(_0x9392('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9392('0x3'));var moment=require(_0x9392('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9392('0x5'));var sox=require(_0x9392('0x6'));var csv=require(_0x9392('0x7'));var ejs=require(_0x9392('0x8'));var fs=require('fs');var fs_extra=require(_0x9392('0x9'));var _=require('lodash');var squel=require(_0x9392('0xa'));var crypto=require(_0x9392('0xb'));var jsforce=require(_0x9392('0xc'));var deskjs=require(_0x9392('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9392('0xe'));var Papa=require(_0x9392('0xf'));var Redis=require(_0x9392('0x10'));var authService=require(_0x9392('0x11'));var qs=require(_0x9392('0x12'));var as=require(_0x9392('0x13'));var hardwareService=require(_0x9392('0x14'));var logger=require('../../config/logger')(_0x9392('0x15'));var utils=require(_0x9392('0x16'));var config=require(_0x9392('0x17'));var licenseUtil=require(_0x9392('0x18'));var db=require(_0x9392('0x19'))['db'];function respondWithStatusCode(_0x42c1f4,_0x1a4d73){_0x1a4d73=_0x1a4d73||0xcc;return function(_0x5a8b3a){if(_0x5a8b3a){return _0x42c1f4[_0x9392('0x1a')](_0x1a4d73);}return _0x42c1f4['status'](_0x1a4d73)[_0x9392('0x1b')]();};}function respondWithResult(_0x4c7c8a,_0x25119c){_0x25119c=_0x25119c||0xc8;return function(_0x419397){if(_0x419397){return _0x4c7c8a[_0x9392('0x1c')](_0x25119c)[_0x9392('0x1d')](_0x419397);}};}function respondWithFilteredResult(_0x57a4ba,_0xf04b44){return function(_0x2f02a5){if(_0x2f02a5){var _0x1fffb4=typeof _0xf04b44[_0x9392('0x1e')]===_0x9392('0x1f')&&typeof _0xf04b44[_0x9392('0x20')]===_0x9392('0x1f');var _0x4503b4=_0x2f02a5[_0x9392('0x21')];var _0x269b55=_0x1fffb4?0x0:_0xf04b44[_0x9392('0x1e')];var _0x2b3e8b=_0x1fffb4?_0x2f02a5[_0x9392('0x21')]:_0xf04b44['offset']+_0xf04b44[_0x9392('0x20')];var _0x45def5;if(_0x2b3e8b>=_0x4503b4){_0x2b3e8b=_0x4503b4;_0x45def5=0xc8;}else{_0x45def5=0xce;}_0x57a4ba[_0x9392('0x1c')](_0x45def5);return _0x57a4ba['set'](_0x9392('0x22'),_0x269b55+'-'+_0x2b3e8b+'/'+_0x4503b4)[_0x9392('0x1d')](_0x2f02a5);}return null;};}function patchUpdates(_0x3b9fca){return function(_0x103c8a){try{jsonpatch[_0x9392('0x23')](_0x103c8a,_0x3b9fca,!![]);}catch(_0x558e56){return BPromise[_0x9392('0x24')](_0x558e56);}return _0x103c8a[_0x9392('0x25')]();};}function saveUpdates(_0x512821,_0x327431){return function(_0xa03561){if(_0xa03561){return _0xa03561[_0x9392('0x26')](_0x512821)[_0x9392('0x27')](function(_0x3f733a){return _0x3f733a;});}return null;};}function removeEntity(_0x46ae6f,_0x382451){return function(_0x3b9f24){if(_0x3b9f24){return _0x3b9f24[_0x9392('0x28')]()[_0x9392('0x27')](function(){var _0x58898f=_0x3b9f24[_0x9392('0x29')]({'plain':!![]});var _0xc7dd70=_0x9392('0x2a');return db['UserProfileResource'][_0x9392('0x28')]({'where':{'type':_0xc7dd70,'resourceId':_0x58898f['id']}})[_0x9392('0x27')](function(){return _0x3b9f24;});})[_0x9392('0x27')](function(){_0x46ae6f[_0x9392('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2549e0,_0x1a2b6c){return function(_0x4b2e4d){if(!_0x4b2e4d){_0x2549e0[_0x9392('0x1a')](0x194);}return _0x4b2e4d;};}function handleError(_0x185df,_0x4d2662){_0x4d2662=_0x4d2662||0x1f4;return function(_0x4593ce){logger['error'](_0x4593ce[_0x9392('0x2b')]);if(_0x4593ce['name']){delete _0x4593ce[_0x9392('0x2c')];}_0x185df[_0x9392('0x1c')](_0x4d2662)['send'](_0x4593ce);};}exports[_0x9392('0x2d')]=function(_0x48d6de,_0x39d0ce){var _0x540b85={},_0x23ad81={},_0x5e18f3={'count':0x0,'rows':[]};var _0xb61504=_[_0x9392('0x2e')](db[_0x9392('0x2f')]['rawAttributes'],function(_0x59fe36){return{'name':_0x59fe36['fieldName'],'type':_0x59fe36[_0x9392('0x30')][_0x9392('0x31')]};});_0x23ad81['model']=_[_0x9392('0x2e')](_0xb61504,_0x9392('0x2c'));_0x23ad81[_0x9392('0x32')]=_['keys'](_0x48d6de[_0x9392('0x32')]);_0x23ad81[_0x9392('0x33')]=_[_0x9392('0x34')](_0x23ad81[_0x9392('0x35')],_0x23ad81['query']);_0x540b85[_0x9392('0x36')]=_[_0x9392('0x34')](_0x23ad81[_0x9392('0x35')],qs[_0x9392('0x37')](_0x48d6de[_0x9392('0x32')][_0x9392('0x37')]));_0x540b85['attributes']=_0x540b85['attributes'][_0x9392('0x38')]?_0x540b85[_0x9392('0x36')]:_0x23ad81[_0x9392('0x35')];if(!_0x48d6de[_0x9392('0x32')][_0x9392('0x39')]('nolimit')){_0x540b85[_0x9392('0x20')]=qs[_0x9392('0x20')](_0x48d6de[_0x9392('0x32')][_0x9392('0x20')]);_0x540b85[_0x9392('0x1e')]=qs[_0x9392('0x1e')](_0x48d6de[_0x9392('0x32')][_0x9392('0x1e')]);}_0x540b85[_0x9392('0x3a')]=qs['sort'](_0x48d6de[_0x9392('0x32')][_0x9392('0x3b')]);_0x540b85[_0x9392('0x3c')]=qs[_0x9392('0x33')](_[_0x9392('0x3d')](_0x48d6de[_0x9392('0x32')],_0x23ad81[_0x9392('0x33')]),_0xb61504);if(_0x48d6de[_0x9392('0x32')]['filter']){_0x540b85[_0x9392('0x3c')]=_['merge'](_0x540b85[_0x9392('0x3c')],{'$or':_['map'](_0xb61504,function(_0xb341be){if(_0xb341be[_0x9392('0x30')]!==_0x9392('0x3e')){var _0x3a9eee={};_0x3a9eee[_0xb341be['name']]={'$like':'%'+_0x48d6de['query'][_0x9392('0x3f')]+'%'};return _0x3a9eee;}})});}_0x540b85=_[_0x9392('0x40')]({},_0x540b85,_0x48d6de[_0x9392('0x41')]);var _0x4c350b={'where':_0x540b85[_0x9392('0x3c')]};return db[_0x9392('0x2f')]['count'](_0x4c350b)[_0x9392('0x27')](function(_0x146c69){_0x5e18f3['count']=_0x146c69;if(_0x48d6de[_0x9392('0x32')]['includeAll']){_0x540b85['include']=[{'all':!![]}];}return db['Pause'][_0x9392('0x42')](_0x540b85);})[_0x9392('0x27')](function(_0x53f778){_0x5e18f3[_0x9392('0x43')]=_0x53f778;return _0x5e18f3;})[_0x9392('0x27')](respondWithFilteredResult(_0x39d0ce,_0x540b85))[_0x9392('0x44')](handleError(_0x39d0ce,null));};exports['show']=function(_0x27fd5b,_0x6aa5f3){var _0x8bd6bb={'raw':!![],'where':{'id':_0x27fd5b[_0x9392('0x45')]['id']}},_0x2dbcb9={};_0x2dbcb9[_0x9392('0x35')]=_[_0x9392('0x46')](db[_0x9392('0x2f')]['rawAttributes']);_0x2dbcb9[_0x9392('0x32')]=_[_0x9392('0x46')](_0x27fd5b[_0x9392('0x32')]);_0x2dbcb9[_0x9392('0x33')]=_['intersection'](_0x2dbcb9['model'],_0x2dbcb9[_0x9392('0x32')]);_0x8bd6bb[_0x9392('0x36')]=_['intersection'](_0x2dbcb9['model'],qs[_0x9392('0x37')](_0x27fd5b[_0x9392('0x32')][_0x9392('0x37')]));_0x8bd6bb[_0x9392('0x36')]=_0x8bd6bb['attributes']['length']?_0x8bd6bb[_0x9392('0x36')]:_0x2dbcb9['model'];if(_0x27fd5b[_0x9392('0x32')][_0x9392('0x47')]){_0x8bd6bb[_0x9392('0x48')]=[{'all':!![]}];}_0x8bd6bb=_[_0x9392('0x40')]({},_0x8bd6bb,_0x27fd5b[_0x9392('0x41')]);return db[_0x9392('0x2f')]['find'](_0x8bd6bb)['then'](handleEntityNotFound(_0x6aa5f3,null))['then'](respondWithResult(_0x6aa5f3,null))[_0x9392('0x44')](handleError(_0x6aa5f3,null));};exports['create']=function(_0x218e48,_0x3d172b){return db[_0x9392('0x2f')][_0x9392('0x49')](_0x218e48[_0x9392('0x4a')],{})[_0x9392('0x27')](function(_0x52b047){var _0x83cf26=_0x218e48[_0x9392('0x4b')]['get']({'plain':!![]});if(!_0x83cf26)throw new Error(_0x9392('0x4c'));if(_0x83cf26[_0x9392('0x4d')]==='user'){var _0x17d52d=_0x52b047['get']({'plain':!![]});var _0x121984='Pauses';return db['UserProfileSection']['find']({'where':{'name':_0x121984,'userProfileId':_0x83cf26[_0x9392('0x4e')]},'raw':!![]})[_0x9392('0x27')](function(_0x524c43){if(_0x524c43&&_0x524c43[_0x9392('0x4f')]===0x0){return db[_0x9392('0x50')][_0x9392('0x49')]({'name':_0x17d52d[_0x9392('0x2c')],'resourceId':_0x17d52d['id'],'type':_0x524c43[_0x9392('0x2c')],'sectionId':_0x524c43['id']},{})[_0x9392('0x27')](function(){return _0x52b047;});}else{return _0x52b047;}})['catch'](function(_0x50ffce){logger[_0x9392('0x51')](_0x9392('0x52'),_0x50ffce);throw _0x50ffce;});}return _0x52b047;})[_0x9392('0x27')](respondWithResult(_0x3d172b,0xc9))[_0x9392('0x44')](handleError(_0x3d172b,null));};exports[_0x9392('0x26')]=function(_0x38c629,_0x4c7af2){if(_0x38c629['body']['id']){delete _0x38c629[_0x9392('0x4a')]['id'];}return db[_0x9392('0x2f')][_0x9392('0x53')]({'where':{'id':_0x38c629[_0x9392('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c7af2,null))[_0x9392('0x27')](saveUpdates(_0x38c629[_0x9392('0x4a')],null))[_0x9392('0x27')](respondWithResult(_0x4c7af2,null))[_0x9392('0x44')](handleError(_0x4c7af2,null));};exports[_0x9392('0x28')]=function(_0x23579a,_0x2554bf){return db[_0x9392('0x2f')][_0x9392('0x53')]({'where':{'id':_0x23579a['params']['id']}})[_0x9392('0x27')](handleEntityNotFound(_0x2554bf,null))[_0x9392('0x27')](removeEntity(_0x2554bf,null))['catch'](handleError(_0x2554bf,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ef71dc6..e95fc43 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 _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x200c99,_0x43f7ab){var _0x385b0b=function(_0x42b6f4){while(--_0x42b6f4){_0x200c99['push'](_0x200c99['shift']());}};_0x385b0b(++_0x43f7ab);}(_0x326f,0xd1));var _0xf326=function(_0x4f6e70,_0x3b4a1f){_0x4f6e70=_0x4f6e70-0x0;var _0x1902a9=_0x326f[_0x4f6e70];return _0x1902a9;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index b8a34f1..894482c 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(_0x46b321,_0x54690e){var _0x57ad21=function(_0x3dedd7){while(--_0x3dedd7){_0x46b321['push'](_0x46b321['shift']());}};_0x57ad21(++_0x54690e);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0xb10b[_0x4b5813];return _0x423465;};'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(_0x44b34b,_0x561bf9){var _0x525e7c=function(_0x345611){while(--_0x345611){_0x44b34b['push'](_0x44b34b['shift']());}};_0x525e7c(++_0x561bf9);}(_0xb10b,0x12a));var _0xbb10=function(_0x49253a,_0x4883d1){_0x49253a=_0x49253a-0x0;var _0x471008=_0xb10b[_0x49253a];return _0x471008;};'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 5a38ad9..b3aa84c 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 _0xb4e6=['put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','/webhook','webhookPost'];(function(_0x8411f6,_0x524eec){var _0xcc62d=function(_0x38c6e5){while(--_0x38c6e5){_0x8411f6['push'](_0x8411f6['shift']());}};_0xcc62d(++_0x524eec);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0xb4e6[_0xd578cb];return _0x775533;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var fs_extra=require(_0x6b4e('0x5'));var auth=require(_0x6b4e('0x6'));var interaction=require(_0x6b4e('0x7'));var config=require('../../config/environment');var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')]('/webhook',controller['webhookGet']);router[_0x6b4e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b4e('0xb')]);router[_0x6b4e('0x9')](_0x6b4e('0xc'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xd')]);var upload=multer({'storage':multer[_0x6b4e('0xe')]({'destination':function(_0x323487,_0x49c734,_0x39b4ec){_0x39b4ec(null,path[_0x6b4e('0xf')](config['root'],_0x6b4e('0x10')));},'filename':function(_0x9cd7da,_0x432399,_0x2b2ce0){_0x432399[_0x6b4e('0x11')]=_0x432399[_0x6b4e('0x11')][_0x6b4e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b2ce0(null,util['format'](_0x6b4e('0x13'),path[_0x6b4e('0x14')](_0x432399['originalname'],path[_0x6b4e('0x15')](_0x432399['originalname'])),Date[_0x6b4e('0x16')](),path[_0x6b4e('0x15')](_0x432399[_0x6b4e('0x11')])));}})});router[_0x6b4e('0x17')]('/',upload[_0x6b4e('0x18')](_0x6b4e('0x19')),controller['upload']);router['post'](_0x6b4e('0x1a'),controller[_0x6b4e('0x1b')]);router[_0x6b4e('0x1c')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1e')]);router[_0x6b4e('0x1f')](_0x6b4e('0x1d'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x1f')]);module[_0x6b4e('0x20')]=router; \ No newline at end of file +var _0x579c=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','extname','file','upload','post','/webhook','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3d5d9d,_0x4a3ffd){var _0x41bcf8=function(_0x17256c){while(--_0x17256c){_0x3d5d9d['push'](_0x3d5d9d['shift']());}};_0x41bcf8(++_0x4a3ffd);}(_0x579c,0xda));var _0xc579=function(_0x25c32c,_0x6a37d4){_0x25c32c=_0x25c32c-0x0;var _0x5ddd56=_0x579c[_0x25c32c];return _0x5ddd56;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/webhook',controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth[_0xc579('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xc579('0x10')]({'destination':function(_0x2048bc,_0x17e37f,_0x3684b7){_0x3684b7(null,path[_0xc579('0x11')](config[_0xc579('0x12')],_0xc579('0x13')));},'filename':function(_0x1905b7,_0x421812,_0x441028){_0x421812[_0xc579('0x14')]=_0x421812['originalname'][_0xc579('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x441028(null,util['format'](_0xc579('0x16'),path['basename'](_0x421812[_0xc579('0x14')],path['extname'](_0x421812[_0xc579('0x14')])),Date['now'](),path[_0xc579('0x17')](_0x421812[_0xc579('0x14')])));}})});router['post']('/',upload['single'](_0xc579('0x18')),controller[_0xc579('0x19')]);router[_0xc579('0x1a')](_0xc579('0x1b'),controller[_0xc579('0x1c')]);router[_0xc579('0x1d')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x1e')]);router[_0xc579('0x1f')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3252e8c..98c0755 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 _0x7a15=['ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x58009c,_0xa8b347){var _0x435316=function(_0x12530f){while(--_0x12530f){_0x58009c['push'](_0x58009c['shift']());}};_0x435316(++_0xa8b347);}(_0x7a15,0xfc));var _0x57a1=function(_0x394f4f,_0x4cc102){_0x394f4f=_0x394f4f-0x0;var _0x25c3f0=_0x7a15[_0x394f4f];return _0x25c3f0;};'use strict';var Sequelize=require(_0x57a1('0x0'));module[_0x57a1('0x1')]={'name':{'type':Sequelize[_0x57a1('0x2')]},'type':{'type':Sequelize[_0x57a1('0x3')](_0x57a1('0x4'),_0x57a1('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x57a1('0x6')]},'path':{'type':Sequelize[_0x57a1('0x2')],'comment':_0x57a1('0x7')},'active':{'type':Sequelize[_0x57a1('0x8')],'defaultValue':0x0,'comment':_0x57a1('0x9')},'sidebar':{'type':Sequelize['ENUM'](_0x57a1('0xa'),_0x57a1('0xb'),_0x57a1('0xc'),_0x57a1('0xd')),'defaultValue':'always','comment':_0x57a1('0xe')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x57a1('0x2')]},'agentUrl':{'type':Sequelize[_0x57a1('0x2')]},'scriptName':{'type':Sequelize[_0x57a1('0x2')]},'scriptPath':{'type':Sequelize[_0x57a1('0x2')]}}; \ No newline at end of file +var _0xe549=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script'];(function(_0x178c4c,_0x56618f){var _0x269699=function(_0x58cde3){while(--_0x58cde3){_0x178c4c['push'](_0x178c4c['shift']());}};_0x269699(++_0x56618f);}(_0xe549,0x112));var _0x9e54=function(_0x3b0790,_0x83b869){_0x3b0790=_0x3b0790-0x0;var _0x74d69f=_0xe549[_0x3b0790];return _0x74d69f;};'use strict';var Sequelize=require(_0x9e54('0x0'));module[_0x9e54('0x1')]={'name':{'type':Sequelize[_0x9e54('0x2')]},'type':{'type':Sequelize[_0x9e54('0x3')](_0x9e54('0x4'),_0x9e54('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9e54('0x6')]},'path':{'type':Sequelize[_0x9e54('0x2')],'comment':_0x9e54('0x7')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9e54('0x8')},'sidebar':{'type':Sequelize[_0x9e54('0x3')](_0x9e54('0x9'),_0x9e54('0xa'),_0x9e54('0xb'),_0x9e54('0xc')),'defaultValue':_0x9e54('0xb'),'comment':_0x9e54('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x9e54('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x9e54('0x2')]},'scriptPath':{'type':Sequelize[_0x9e54('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 1018344..09687c1 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 _0x3736=['util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','get','Plugins','UserProfileResource','end','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','attributes','query','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','length','include','find','download','params','path','join','format','basename','createWriteStream','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','root','server/files/plugins','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','plugins','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','method','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x26f833,_0x50cedf){var _0x5a8801=function(_0x37fb8f){while(--_0x37fb8f){_0x26f833['push'](_0x26f833['shift']());}};_0x5a8801(++_0x50cedf);}(_0x3736,0x1e8));var _0x6373=function(_0x2d19d0,_0x384301){_0x2d19d0=_0x2d19d0-0x0;var _0x31655f=_0x3736[_0x2d19d0];return _0x31655f;};'use strict';var emlformat=require(_0x6373('0x0'));var rimraf=require(_0x6373('0x1'));var zipdir=require(_0x6373('0x2'));var jsonpatch=require(_0x6373('0x3'));var rp=require(_0x6373('0x4'));var moment=require(_0x6373('0x5'));var BPromise=require(_0x6373('0x6'));var Mustache=require('mustache');var util=require(_0x6373('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6373('0x8'));var fs=require('fs');var fs_extra=require(_0x6373('0x9'));var _=require(_0x6373('0xa'));var squel=require(_0x6373('0xb'));var crypto=require('crypto');var jsforce=require(_0x6373('0xc'));var deskjs=require(_0x6373('0xd'));var toCsv=require(_0x6373('0xe'));var querystring=require(_0x6373('0xf'));var Papa=require(_0x6373('0x10'));var extract=require('extract-zip');var rimraf=require(_0x6373('0x1'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x6373('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6373('0x12'));var hardwareService=require(_0x6373('0x13'));var logger=require('../../config/logger')(_0x6373('0x14'));var utils=require(_0x6373('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6373('0x16'));var db=require(_0x6373('0x17'))['db'];config[_0x6373('0x18')]=_['defaults'](config[_0x6373('0x18')],{'host':_0x6373('0x19'),'port':0x18eb});var socket=require(_0x6373('0x1a'))(new Redis(config['redis']));require(_0x6373('0x1b'))[_0x6373('0x1c')](socket);function respondWithStatusCode(_0x43e5d1,_0xadaf8d){_0xadaf8d=_0xadaf8d||0xcc;return function(_0x46a87d){if(_0x46a87d){return _0x43e5d1[_0x6373('0x1d')](_0xadaf8d);}return _0x43e5d1['status'](_0xadaf8d)['end']();};}function respondWithResult(_0x3010dd,_0x1f55b9){_0x1f55b9=_0x1f55b9||0xc8;return function(_0x145467){if(_0x145467){return _0x3010dd[_0x6373('0x1e')](_0x1f55b9)[_0x6373('0x1f')](_0x145467);}};}function respondWithFilteredResult(_0x35fcda,_0x4b19d9){return function(_0x394075){if(_0x394075){var _0x2e5d31=typeof _0x4b19d9[_0x6373('0x20')]==='undefined'&&typeof _0x4b19d9[_0x6373('0x21')]===_0x6373('0x22');var _0x4c20d1=_0x394075[_0x6373('0x23')];var _0x1379c8=_0x2e5d31?0x0:_0x4b19d9[_0x6373('0x20')];var _0x5f5888=_0x2e5d31?_0x394075['count']:_0x4b19d9[_0x6373('0x20')]+_0x4b19d9[_0x6373('0x21')];var _0x48a3d8;if(_0x5f5888>=_0x4c20d1){_0x5f5888=_0x4c20d1;_0x48a3d8=0xc8;}else{_0x48a3d8=0xce;}_0x35fcda['status'](_0x48a3d8);return _0x35fcda[_0x6373('0x24')](_0x6373('0x25'),_0x1379c8+'-'+_0x5f5888+'/'+_0x4c20d1)['json'](_0x394075);}return null;};}function patchUpdates(_0x368278){return function(_0x1b9efd){try{jsonpatch[_0x6373('0x26')](_0x1b9efd,_0x368278,!![]);}catch(_0x4e734a){return BPromise['reject'](_0x4e734a);}return _0x1b9efd['save']();};}function saveUpdates(_0x4f8062,_0x5ae597){return function(_0x52e955){if(_0x52e955){return _0x52e955[_0x6373('0x27')](_0x4f8062)[_0x6373('0x28')](function(_0x5f1beb){return _0x5f1beb;});}return null;};}function removeEntity(_0x43a1e3,_0x2f2d6d){return function(_0x5f3406){if(_0x5f3406){return _0x5f3406[_0x6373('0x29')]()[_0x6373('0x28')](function(){var _0x4cf32c=_0x5f3406[_0x6373('0x2a')]({'plain':!![]});var _0x3c95d9=_0x6373('0x2b');return db[_0x6373('0x2c')][_0x6373('0x29')]({'where':{'type':_0x3c95d9,'resourceId':_0x4cf32c['id']}})['then'](function(){return _0x5f3406;});})['then'](function(){_0x43a1e3[_0x6373('0x1e')](0xcc)[_0x6373('0x2d')]();});}};}function handleEntityNotFound(_0x349633,_0xc5992){return function(_0x57906c){if(!_0x57906c){_0x349633[_0x6373('0x1d')](0x194);}return _0x57906c;};}function handleError(_0x473022,_0x23267a){_0x23267a=_0x23267a||0x1f4;return function(_0x5d6fa7){logger['error'](_0x5d6fa7[_0x6373('0x2e')]);if(_0x5d6fa7[_0x6373('0x2f')]){delete _0x5d6fa7[_0x6373('0x2f')];}_0x473022[_0x6373('0x1e')](_0x23267a)[_0x6373('0x30')](_0x5d6fa7);};}exports[_0x6373('0x31')]=function(_0x557fa8,_0x537e0b){var _0x309e55={},_0x4f9237={},_0x1a6b2e={'count':0x0,'rows':[]};var _0x301a62=_[_0x6373('0x32')](db[_0x6373('0x33')][_0x6373('0x34')],function(_0x3f5442){return{'name':_0x3f5442[_0x6373('0x35')],'type':_0x3f5442[_0x6373('0x36')][_0x6373('0x37')]};});_0x4f9237[_0x6373('0x38')]=_['map'](_0x301a62,'name');_0x4f9237['query']=_[_0x6373('0x39')](_0x557fa8['query']);_0x4f9237[_0x6373('0x3a')]=_[_0x6373('0x3b')](_0x4f9237['model'],_0x4f9237['query']);_0x309e55['attributes']=_[_0x6373('0x3b')](_0x4f9237['model'],qs[_0x6373('0x3c')](_0x557fa8['query'][_0x6373('0x3c')]));_0x309e55[_0x6373('0x3d')]=_0x309e55[_0x6373('0x3d')]['length']?_0x309e55[_0x6373('0x3d')]:_0x4f9237[_0x6373('0x38')];if(!_0x557fa8[_0x6373('0x3e')]['hasOwnProperty'](_0x6373('0x3f'))){_0x309e55['limit']=qs['limit'](_0x557fa8[_0x6373('0x3e')][_0x6373('0x21')]);_0x309e55[_0x6373('0x20')]=qs['offset'](_0x557fa8[_0x6373('0x3e')][_0x6373('0x20')]);}_0x309e55[_0x6373('0x40')]=qs[_0x6373('0x41')](_0x557fa8[_0x6373('0x3e')][_0x6373('0x41')]);_0x309e55[_0x6373('0x42')]=qs[_0x6373('0x3a')](_[_0x6373('0x43')](_0x557fa8[_0x6373('0x3e')],_0x4f9237[_0x6373('0x3a')]),_0x301a62);if(_0x557fa8[_0x6373('0x3e')][_0x6373('0x44')]){_0x309e55['where']=_[_0x6373('0x45')](_0x309e55[_0x6373('0x42')],{'$or':_[_0x6373('0x32')](_0x301a62,function(_0x4fda81){if(_0x4fda81['type']!=='VIRTUAL'){var _0x22899a={};_0x22899a[_0x4fda81[_0x6373('0x2f')]]={'$like':'%'+_0x557fa8['query'][_0x6373('0x44')]+'%'};return _0x22899a;}})});}_0x309e55=_[_0x6373('0x45')]({},_0x309e55,_0x557fa8[_0x6373('0x46')]);var _0x44c3b={'where':_0x309e55[_0x6373('0x42')]};return db[_0x6373('0x33')][_0x6373('0x23')](_0x44c3b)['then'](function(_0x3cdcbc){_0x1a6b2e[_0x6373('0x23')]=_0x3cdcbc;if(_0x557fa8['query'][_0x6373('0x47')]){_0x309e55['include']=[{'all':!![]}];}return db[_0x6373('0x33')]['findAll'](_0x309e55);})[_0x6373('0x28')](function(_0x1838b6){_0x1a6b2e[_0x6373('0x48')]=_0x1838b6;return _0x1a6b2e;})['then'](respondWithFilteredResult(_0x537e0b,_0x309e55))[_0x6373('0x49')](handleError(_0x537e0b,null));};exports[_0x6373('0x4a')]=function(_0x42222c,_0x403031){var _0x35eaa5={'raw':!![],'where':{'id':_0x42222c['params']['id']}},_0x12e7e2={};_0x12e7e2[_0x6373('0x38')]=_[_0x6373('0x39')](db[_0x6373('0x33')][_0x6373('0x34')]);_0x12e7e2[_0x6373('0x3e')]=_[_0x6373('0x39')](_0x42222c[_0x6373('0x3e')]);_0x12e7e2['filters']=_[_0x6373('0x3b')](_0x12e7e2['model'],_0x12e7e2[_0x6373('0x3e')]);_0x35eaa5['attributes']=_['intersection'](_0x12e7e2[_0x6373('0x38')],qs['fields'](_0x42222c['query'][_0x6373('0x3c')]));_0x35eaa5[_0x6373('0x3d')]=_0x35eaa5['attributes'][_0x6373('0x4b')]?_0x35eaa5['attributes']:_0x12e7e2['model'];if(_0x42222c[_0x6373('0x3e')][_0x6373('0x47')]){_0x35eaa5[_0x6373('0x4c')]=[{'all':!![]}];}_0x35eaa5=_[_0x6373('0x45')]({},_0x35eaa5,_0x42222c[_0x6373('0x46')]);return db[_0x6373('0x33')][_0x6373('0x4d')](_0x35eaa5)[_0x6373('0x28')](handleEntityNotFound(_0x403031,null))['then'](respondWithResult(_0x403031,null))[_0x6373('0x49')](handleError(_0x403031,null));};exports[_0x6373('0x4e')]=function(_0x95de21,_0x36612b,_0x457288){return db[_0x6373('0x33')][_0x6373('0x4d')]({'where':{'id':_0x95de21[_0x6373('0x4f')]['id']},'attributes':[_0x6373('0x2f'),_0x6373('0x50')],'raw':!![]})[_0x6373('0x28')](handleEntityNotFound(_0x36612b,null))[_0x6373('0x28')](function(_0x505f34){if(_0x505f34){var _0x32b3e4=path[_0x6373('0x51')](config['root'],'server/files/plugins',util[_0x6373('0x52')]('%s.zip',path[_0x6373('0x53')](_0x505f34['path'])));var _0x2febd3=fs[_0x6373('0x54')](_0x32b3e4);var _0x794c67=archiver('zip',{'zlib':{'level':0x9}});_0x794c67['on'](_0x6373('0x55'),function(_0x52b322){if(_0x52b322[_0x6373('0x56')]===_0x6373('0x57')){logger[_0x6373('0x58')](_0x52b322);}else{throw new db[(_0x6373('0x59'))][(_0x6373('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x794c67['on'](_0x6373('0x58'),function(_0x348218){throw new db[(_0x6373('0x59'))]['Error'](_0x6373('0x5b'));});_0x794c67[_0x6373('0x5c')](_0x2febd3);_0x794c67['glob'](_0x6373('0x5d'),{'cwd':path[_0x6373('0x51')](config[_0x6373('0x5e')],_0x6373('0x5f'),path['dirname'](_0x505f34[_0x6373('0x50')])),'ignore':[path[_0x6373('0x51')](path[_0x6373('0x53')](_0x505f34[_0x6373('0x50')]),_0x6373('0x60')),path[_0x6373('0x51')](path[_0x6373('0x53')](_0x505f34[_0x6373('0x50')]),_0x6373('0x61'))],'nodir':!![]})['finalize']();_0x2febd3['on'](_0x6373('0x62'),function(){if(!fs[_0x6373('0x63')](_0x32b3e4)){throw new db[(_0x6373('0x59'))]['Error'](_0x6373('0x64'));}return _0x36612b[_0x6373('0x4e')](_0x32b3e4,util[_0x6373('0x52')]('%s.zip',path['basename'](_0x505f34[_0x6373('0x50')])),function(_0x1086b7){if(_0x1086b7){throw new db[(_0x6373('0x59'))][(_0x6373('0x5a'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x6373('0x65')](_0x32b3e4);logger[_0x6373('0x66')]('Download\x20completed');logger[_0x6373('0x66')](_0x6373('0x67'));});});}return null;})[_0x6373('0x49')](handleError(_0x36612b,null));};exports[_0x6373('0x68')]=function(_0xc027c3,_0x577313,_0x538384){var _0x39dc16=path[_0x6373('0x53')](_0xc027c3[_0x6373('0x69')]['filename'],path['extname'](_0xc027c3[_0x6373('0x69')][_0x6373('0x6a')]));var _0x469f64=path[_0x6373('0x51')](config[_0x6373('0x5e')],'server/files/plugins',_0xc027c3[_0x6373('0x69')][_0x6373('0x6a')]);var _0x405d6b=path['join'](config[_0x6373('0x5e')],_0x6373('0x5f'),_0x39dc16);logger['info'](_0x6373('0x6b'),_0x469f64);logger[_0x6373('0x66')]('Plugin\x20upload\x20destination:\x20%s',_0x405d6b);try{fs[_0x6373('0x6c')](_0x469f64,parseInt(_0x6373('0x6d'),0x8));extract(_0x469f64,{'dir':_0x405d6b},function(_0x3c0ab5){if(_0x3c0ab5){logger[_0x6373('0x58')](_0x3c0ab5);handleError(_0x3c0ab5,!![]);};var _0x3afc5f=fs[_0x6373('0x6e')](_0x405d6b);if(_0x3afc5f[_0x6373('0x4b')]>0x1){removeReferences(_0x469f64,_0x405d6b);logger[_0x6373('0x58')](_0x6373('0x6f'));return _0x538384(new Error(_0x6373('0x6f')));}var _0x522a92=fs[_0x6373('0x70')](path[_0x6373('0x51')](_0x405d6b,_0x3afc5f[0x0]));if(_0x522a92[_0x6373('0x71')]()){removeReferences(_0x469f64,_0x405d6b);logger['error'](_0x6373('0x6f'));return _0x538384(new Error('Invalid\x20plugin\x20structure'));}if(_0x522a92['isDirectory']()){var _0x3ce830=fs['readdirSync'](path[_0x6373('0x51')](_0x405d6b,_0x3afc5f[0x0]));if(_0x3ce830[_0x6373('0x4b')]===0x0){removeReferences(_0x469f64,_0x405d6b);logger[_0x6373('0x58')]('Invalid\x20plugin\x20structure');return _0x538384(new Error('Invalid\x20plugin\x20structure'));}var _0x244ef0=_0x3ce830[_0x6373('0x72')](function(_0x5412b1){return _0x5412b1==='manifest.json';});if(!_0x244ef0){return _0x538384(new Error(_0x6373('0x73')));}var _0x23c1ab=fs[_0x6373('0x74')](path[_0x6373('0x51')](_0x405d6b,_0x3afc5f[0x0],_0x6373('0x75')));var _0xf8b04e=JSON[_0x6373('0x76')](_0x23c1ab);if('undefined'==typeof _0xf8b04e[_0x6373('0x2f')]){return _0x538384(new Error(_0x6373('0x77')));}if('undefined'==typeof _0xf8b04e['type']){return _0x538384(new Error(_0x6373('0x78')));}if(_0x6373('0x22')==typeof _0xf8b04e[_0x6373('0x79')]){return _0x538384(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0xf8b04e[_0x6373('0x7a')]){return _0x538384(new Error(_0x6373('0x7b')));}if(_0xf8b04e['type']===_0x6373('0x7c')){if('undefined'==typeof _0xf8b04e[_0x6373('0x7a')][_0x6373('0x7d')]){return _0x538384(new Error(_0x6373('0x7e')));}if(_0x6373('0x22')==typeof _0xf8b04e[_0x6373('0x7a')][_0x6373('0x7d')][_0x6373('0x7f')]&&'undefined'==typeof _0xf8b04e[_0x6373('0x7a')][_0x6373('0x7d')][_0x6373('0x80')]){return _0x538384(new Error(_0x6373('0x81')));}}else if(_0xf8b04e[_0x6373('0x36')]===_0x6373('0x82')){if(_0x6373('0x22')==typeof _0xf8b04e['parameters'][_0x6373('0x83')]){return _0x538384(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x6373('0x22')==typeof _0xf8b04e[_0x6373('0x7a')][_0x6373('0x84')]){return _0x538384(new Error(_0x6373('0x85')));}}else{return _0x538384(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x506fc8=_0xf8b04e[_0x6373('0x2f')];var _0x2b63df=_0xf8b04e[_0x6373('0x86')];var _0x1f62f9=_0xf8b04e[_0x6373('0x36')];var _0xce1afd=_0xf8b04e[_0x6373('0x87')]?_0xf8b04e[_0x6373('0x87')]:_0x6373('0x88');var _0x54011b=_0xf8b04e[_0x6373('0x89')]?_0xf8b04e[_0x6373('0x89')]:_0x6373('0x8a');var _0x1141ce='';var _0xc7e0ff='';var _0x566a0d='';var _0x59d456='';var _0x5a3f03=_0xf8b04e[_0x6373('0x79')];if(_0x1f62f9===_0x6373('0x7c')){if(_0x6373('0x22')!=typeof _0xf8b04e[_0x6373('0x7a')][_0x6373('0x7d')]['admin']){var _0x215c54=_0xf8b04e[_0x6373('0x7a')][_0x6373('0x7d')][_0x6373('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x6373('0x8b')](_0x215c54)){_0x1141ce=path[_0x6373('0x51')]('plugins',_0x39dc16,_0x3afc5f[0x0],_0x215c54);}else{_0x1141ce=_0x215c54;}}else{logger[_0x6373('0x66')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0xf8b04e['parameters'][_0x6373('0x7d')][_0x6373('0x80')]){var _0x14fa9a=_0xf8b04e[_0x6373('0x7a')][_0x6373('0x7d')][_0x6373('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x6373('0x8b')](_0x14fa9a)){_0xc7e0ff=path[_0x6373('0x51')](_0x6373('0x8c'),_0x39dc16,_0x3afc5f[0x0],_0x14fa9a);}else{_0xc7e0ff=_0x14fa9a;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1f62f9===_0x6373('0x82')){_0x566a0d=_0xf8b04e[_0x6373('0x7a')]['scriptName'];_0x59d456=_0xf8b04e['parameters'][_0x6373('0x84')];if('undefined'!=typeof _0xf8b04e['parameters']['views']){if(_0x6373('0x22')!=typeof _0xf8b04e[_0x6373('0x7a')]['views'][_0x6373('0x7f')]){var _0x215c54=_0xf8b04e['parameters']['views'][_0x6373('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x6373('0x8b')](_0x215c54)){_0x1141ce=path[_0x6373('0x51')](_0x6373('0x8c'),_0x39dc16,_0x3afc5f[0x0],_0x215c54);}else{_0x1141ce=_0x215c54;}}if(_0x6373('0x22')!=typeof _0xf8b04e[_0x6373('0x7a')][_0x6373('0x7d')][_0x6373('0x80')]){var _0x14fa9a=_0xf8b04e['parameters'][_0x6373('0x7d')][_0x6373('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x14fa9a)){_0xc7e0ff=path['join'](_0x6373('0x8c'),_0x39dc16,_0x3afc5f[0x0],_0x14fa9a);}else{_0xc7e0ff=_0x14fa9a;}}}}var _0x3f69af={'name':_0x506fc8,'description':_0x2b63df,'path':path[_0x6373('0x51')](_0x39dc16,_0x3afc5f[0x0]),'type':_0x1f62f9,'sidebar':_0xce1afd,'icon':_0x54011b,'adminUrl':_0x1141ce,'agentUrl':_0xc7e0ff,'scriptName':_0x566a0d,'scriptPath':_0x59d456,'version':_0x5a3f03};removeReferences(_0x469f64,null);return db[_0x6373('0x33')][_0x6373('0x8d')](_0x3f69af)[_0x6373('0x28')](function(_0x4418f1){var _0x4a953f={'role':_0xc027c3[_0x6373('0x8e')][_0x6373('0x8f')],'userProfileId':_0xc027c3[_0x6373('0x8e')][_0x6373('0x90')]};if(!_0x4a953f)throw new Error(_0x6373('0x91'));if(_0x4a953f[_0x6373('0x8f')]===_0x6373('0x92')){var _0x2d41f8=_0x4418f1[_0x6373('0x2a')]({'plain':!![]});return db[_0x6373('0x93')][_0x6373('0x4d')]({'where':{'name':_0x6373('0x2b'),'userProfileId':_0x4a953f[_0x6373('0x90')]},'raw':!![]})[_0x6373('0x28')](function(_0x1770f2){if(_0x1770f2&&_0x1770f2['autoAssociation']===0x0){return db[_0x6373('0x2c')][_0x6373('0x8d')]({'name':_0x2d41f8[_0x6373('0x2f')],'resourceId':_0x2d41f8['id'],'type':_0x1770f2['name'],'sectionId':_0x1770f2['id']},{})['then'](function(){return _0x4418f1;});}else{return _0x4418f1;}})['catch'](function(_0x2c589d){logger['error'](_0x6373('0x94'),_0x2c589d);throw _0x2c589d;});}return _0x4418f1;})['then'](respondWithResult(_0x577313,null))[_0x6373('0x49')](handleError(_0x577313,null));}});}catch(_0x24135c){_0x577313[_0x6373('0x1e')](0x1f4)[_0x6373('0x30')](_0x24135c);}};function removeReferences(_0x54dc3e,_0x282bf1){try{if(_0x54dc3e){fs[_0x6373('0x65')](_0x54dc3e);logger[_0x6373('0x66')]('Zip\x20archive\x20removed');}if(_0x282bf1){rimraf(_0x282bf1,function(){});logger[_0x6373('0x66')]('Extracted\x20folder\x20removed');}}catch(_0x5d0d7d){logger['error'](_0x5d0d7d);}}exports['update']=function(_0x4b177c,_0x5bf3aa,_0x3bb916){return db[_0x6373('0x33')]['find']({'where':{'id':_0x4b177c[_0x6373('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5bf3aa,null))[_0x6373('0x28')](saveUpdates(_0x4b177c['body'],null))[_0x6373('0x28')](respondWithResult(_0x5bf3aa,null))[_0x6373('0x49')](handleError(_0x5bf3aa,null));};exports[_0x6373('0x95')]=function(_0x5bdc9e,_0x434f42,_0x47b48a){return db[_0x6373('0x33')][_0x6373('0x4d')]({'where':{'id':_0x5bdc9e[_0x6373('0x4f')]['id']}})['then'](function(_0x49219e){if(_0x49219e){return _0x49219e[_0x6373('0x29')]();}})['then'](function(_0x14181d){rimraf(path['join'](config[_0x6373('0x5e')],_0x6373('0x5f'),path[_0x6373('0x96')](_0x14181d['path'])),function(){});return _0x14181d;})['then'](handleEntityNotFound(_0x434f42,null))[_0x6373('0x28')](respondWithStatusCode(_0x434f42,null))[_0x6373('0x49')](handleError(_0x434f42,null));};exports['webhookGet']=function(_0x5e61a7,_0x50364b,_0x1bcfdc){return BPromise[_0x6373('0x97')]()[_0x6373('0x28')](function(){if(!_0x5e61a7['query'][_0x6373('0x50')]){throw new Error(_0x6373('0x98'));}if(!_0x5e61a7[_0x6373('0x3e')][_0x6373('0x99')]){throw new Error(_0x6373('0x9a'));}var _0x5d372f=_0x5e61a7['query'][_0x6373('0x9b')]?_0x5e61a7[_0x6373('0x3e')][_0x6373('0x9b')]+':'+_0x5e61a7[_0x6373('0x3e')][_0x6373('0x99')]:_0x6373('0x9c')+_0x5e61a7['query'][_0x6373('0x99')];var _0x273b3c=_0x5e61a7[_0x6373('0x3e')][_0x6373('0x1f')]?_0x5e61a7[_0x6373('0x3e')][_0x6373('0x1f')]:!![];var _0x5e132b=_0x5e61a7['query'][_0x6373('0x9d')]?_0x5e61a7[_0x6373('0x3e')][_0x6373('0x9d')]:null;var _0x591950={'method':_0x5e61a7['method'],'uri':util[_0x6373('0x52')](_0x6373('0x9e'),_0x5d372f,_0x5e61a7['query'][_0x6373('0x50')]),'json':_0x273b3c,'resolveWithFullResponse':!![],'encoding':_0x5e132b,'qs':_0x5e61a7['query']};if(_0x5e61a7[_0x6373('0x9f')]){_0x591950[_0x6373('0x9f')]=_0x5e61a7[_0x6373('0x9f')];if(_0x591950['headers'][_0x6373('0xa0')]){delete _0x591950[_0x6373('0x9f')][_0x6373('0xa0')];}}if(_0x591950[_0x6373('0x9f')][_0x6373('0xa1')]){delete _0x591950[_0x6373('0x9f')][_0x6373('0xa1')];}return rp(_0x591950);})[_0x6373('0x28')](function(_0x3f52e2){if(_0x3f52e2){_0x50364b[_0x6373('0x24')](_0x3f52e2[_0x6373('0x9f')]);logger[_0x6373('0x66')](_0x3f52e2[_0x6373('0x8e')]);if(_[_0x6373('0xa2')](_0x5e61a7[_0x6373('0x3e')]['path'],_0x6373('0x4e'))&&_0x3f52e2[_0x6373('0xa3')]==0x1f4){return _0x50364b[_0x6373('0x1d')](_0x3f52e2['statusCode']);}else{return _0x50364b[_0x6373('0x1e')](_0x3f52e2[_0x6373('0xa3')])[_0x6373('0x30')](_0x3f52e2[_0x6373('0x8e')]);}}else{return _0x50364b['sendStatus'](0xc8);}})[_0x6373('0x49')](handleError(_0x50364b,null));};exports['webhookPost']=function(_0x2ae40d,_0x55b4a5,_0x13fb15){return BPromise['resolve']()['then'](function(){if(!_0x2ae40d[_0x6373('0x3e')][_0x6373('0x50')]){throw new Error(_0x6373('0x98'));}if(!_0x2ae40d[_0x6373('0x3e')]['port']){throw new Error(_0x6373('0x9a'));}var _0x5da33e=_0x2ae40d[_0x6373('0x3e')][_0x6373('0x9b')]?_0x2ae40d['query'][_0x6373('0x9b')]+':'+_0x2ae40d[_0x6373('0x3e')]['port']:_0x6373('0x9c')+_0x2ae40d[_0x6373('0x3e')]['port'];var _0x3bb35a=_0x2ae40d[_0x6373('0x3e')][_0x6373('0x1f')]?_0x2ae40d[_0x6373('0x3e')][_0x6373('0x1f')]:!![];var _0x593027=_0x2ae40d[_0x6373('0x3e')][_0x6373('0x9d')]?_0x2ae40d['query'][_0x6373('0x9d')]:null;var _0x50ca17={'method':_0x2ae40d[_0x6373('0xa4')],'uri':util[_0x6373('0x52')](_0x6373('0x9e'),_0x5da33e,_0x2ae40d[_0x6373('0x3e')]['path']),'json':_0x3bb35a,'resolveWithFullResponse':!![],'encoding':_0x593027,'body':_0x2ae40d[_0x6373('0x8e')]};if(_0x2ae40d['headers']){_0x50ca17['headers']=_0x2ae40d[_0x6373('0x9f')];if(_0x50ca17[_0x6373('0x9f')]['content-length']){delete _0x50ca17[_0x6373('0x9f')]['content-length'];}}if(_0x50ca17[_0x6373('0x9f')][_0x6373('0xa1')]){delete _0x50ca17[_0x6373('0x9f')][_0x6373('0xa1')];}return rp(_0x50ca17);})[_0x6373('0x28')](function(_0x42ce9e){if(_0x42ce9e){_0x55b4a5[_0x6373('0x24')](_0x42ce9e[_0x6373('0x9f')]);logger[_0x6373('0x66')](_0x42ce9e[_0x6373('0x8e')]);return _0x55b4a5[_0x6373('0x1e')](_0x42ce9e[_0x6373('0xa3')])[_0x6373('0x30')](_0x42ce9e[_0x6373('0x8e')]);}else{return _0x55b4a5[_0x6373('0x1d')](0xc8);}})[_0x6373('0x49')](handleError(_0x55b4a5,null));}; \ No newline at end of file +var _0x22a0=['Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','Plugin\x20manifest\x20missing','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','Warning:\x20admin\x20view\x20not\x20specified','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','catch','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','json','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','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','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','offset','limit','count','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','Plugin','findAll','rows','params','intersection','download','join','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','format','Error','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','readdirSync'];(function(_0x446aed,_0x4a12fa){var _0x41b155=function(_0x49fe86){while(--_0x49fe86){_0x446aed['push'](_0x446aed['shift']());}};_0x41b155(++_0x4a12fa);}(_0x22a0,0xe8));var _0x022a=function(_0x1a03be,_0x11cb19){_0x1a03be=_0x1a03be-0x0;var _0x110919=_0x22a0[_0x1a03be];return _0x110919;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x022a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x022a('0x1'));var rp=require(_0x022a('0x2'));var moment=require(_0x022a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x022a('0x4'));var util=require(_0x022a('0x5'));var path=require(_0x022a('0x6'));var sox=require(_0x022a('0x7'));var csv=require(_0x022a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x022a('0x9'));var _=require(_0x022a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x022a('0xb'));var deskjs=require(_0x022a('0xc'));var toCsv=require(_0x022a('0x8'));var querystring=require('querystring');var Papa=require(_0x022a('0xd'));var extract=require(_0x022a('0xe'));var rimraf=require(_0x022a('0x0'));var archiver=require('archiver');var Redis=require(_0x022a('0xf'));var authService=require(_0x022a('0x10'));var qs=require(_0x022a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x022a('0x12'));var logger=require(_0x022a('0x13'))('api');var utils=require(_0x022a('0x14'));var config=require(_0x022a('0x15'));var licenseUtil=require(_0x022a('0x16'));var db=require(_0x022a('0x17'))['db'];config['redis']=_['defaults'](config[_0x022a('0x18')],{'host':_0x022a('0x19'),'port':0x18eb});var socket=require(_0x022a('0x1a'))(new Redis(config[_0x022a('0x18')]));require('./plugin.socket')[_0x022a('0x1b')](socket);function respondWithStatusCode(_0x26ab4a,_0x25b874){_0x25b874=_0x25b874||0xcc;return function(_0x43e0cc){if(_0x43e0cc){return _0x26ab4a['sendStatus'](_0x25b874);}return _0x26ab4a[_0x022a('0x1c')](_0x25b874)[_0x022a('0x1d')]();};}function respondWithResult(_0x3527bb,_0x5a807d){_0x5a807d=_0x5a807d||0xc8;return function(_0xe67376){if(_0xe67376){return _0x3527bb[_0x022a('0x1c')](_0x5a807d)['json'](_0xe67376);}};}function respondWithFilteredResult(_0x382dd7,_0x2cd5a6){return function(_0xd1159c){if(_0xd1159c){var _0x5223c4=typeof _0x2cd5a6[_0x022a('0x1e')]==='undefined'&&typeof _0x2cd5a6[_0x022a('0x1f')]==='undefined';var _0x8d8b74=_0xd1159c[_0x022a('0x20')];var _0x2fc7e6=_0x5223c4?0x0:_0x2cd5a6['offset'];var _0x1323c6=_0x5223c4?_0xd1159c[_0x022a('0x20')]:_0x2cd5a6[_0x022a('0x1e')]+_0x2cd5a6[_0x022a('0x1f')];var _0x45764c;if(_0x1323c6>=_0x8d8b74){_0x1323c6=_0x8d8b74;_0x45764c=0xc8;}else{_0x45764c=0xce;}_0x382dd7[_0x022a('0x1c')](_0x45764c);return _0x382dd7['set']('Content-Range',_0x2fc7e6+'-'+_0x1323c6+'/'+_0x8d8b74)['json'](_0xd1159c);}return null;};}function patchUpdates(_0x235e31){return function(_0xd0636f){try{jsonpatch[_0x022a('0x21')](_0xd0636f,_0x235e31,!![]);}catch(_0x17f293){return BPromise[_0x022a('0x22')](_0x17f293);}return _0xd0636f['save']();};}function saveUpdates(_0x1aa15e,_0x12eaa9){return function(_0x1d2bb4){if(_0x1d2bb4){return _0x1d2bb4[_0x022a('0x23')](_0x1aa15e)[_0x022a('0x24')](function(_0x3d71e2){return _0x3d71e2;});}return null;};}function removeEntity(_0x19d8a5,_0x55683d){return function(_0x14cc47){if(_0x14cc47){return _0x14cc47[_0x022a('0x25')]()['then'](function(){var _0x5501ae=_0x14cc47[_0x022a('0x26')]({'plain':!![]});var _0x33475d=_0x022a('0x27');return db[_0x022a('0x28')][_0x022a('0x25')]({'where':{'type':_0x33475d,'resourceId':_0x5501ae['id']}})['then'](function(){return _0x14cc47;});})[_0x022a('0x24')](function(){_0x19d8a5['status'](0xcc)[_0x022a('0x1d')]();});}};}function handleEntityNotFound(_0x3e4cb3,_0x13128f){return function(_0x8d07e4){if(!_0x8d07e4){_0x3e4cb3[_0x022a('0x29')](0x194);}return _0x8d07e4;};}function handleError(_0x38c8c8,_0x34f9b8){_0x34f9b8=_0x34f9b8||0x1f4;return function(_0x7e82d2){logger[_0x022a('0x2a')](_0x7e82d2[_0x022a('0x2b')]);if(_0x7e82d2[_0x022a('0x2c')]){delete _0x7e82d2[_0x022a('0x2c')];}_0x38c8c8['status'](_0x34f9b8)[_0x022a('0x2d')](_0x7e82d2);};}exports[_0x022a('0x2e')]=function(_0x58cd13,_0x4e51bc){var _0xfd0028={},_0x5683da={},_0x36af72={'count':0x0,'rows':[]};var _0x325d70=_[_0x022a('0x2f')](db['Plugin'][_0x022a('0x30')],function(_0x271cf9){return{'name':_0x271cf9[_0x022a('0x31')],'type':_0x271cf9['type'][_0x022a('0x32')]};});_0x5683da['model']=_[_0x022a('0x2f')](_0x325d70,'name');_0x5683da[_0x022a('0x33')]=_[_0x022a('0x34')](_0x58cd13[_0x022a('0x33')]);_0x5683da['filters']=_['intersection'](_0x5683da[_0x022a('0x35')],_0x5683da[_0x022a('0x33')]);_0xfd0028[_0x022a('0x36')]=_['intersection'](_0x5683da[_0x022a('0x35')],qs['fields'](_0x58cd13[_0x022a('0x33')][_0x022a('0x37')]));_0xfd0028[_0x022a('0x36')]=_0xfd0028['attributes'][_0x022a('0x38')]?_0xfd0028[_0x022a('0x36')]:_0x5683da[_0x022a('0x35')];if(!_0x58cd13[_0x022a('0x33')][_0x022a('0x39')]('nolimit')){_0xfd0028[_0x022a('0x1f')]=qs[_0x022a('0x1f')](_0x58cd13['query']['limit']);_0xfd0028[_0x022a('0x1e')]=qs[_0x022a('0x1e')](_0x58cd13[_0x022a('0x33')][_0x022a('0x1e')]);}_0xfd0028[_0x022a('0x3a')]=qs[_0x022a('0x3b')](_0x58cd13['query'][_0x022a('0x3b')]);_0xfd0028[_0x022a('0x3c')]=qs[_0x022a('0x3d')](_[_0x022a('0x3e')](_0x58cd13[_0x022a('0x33')],_0x5683da[_0x022a('0x3d')]),_0x325d70);if(_0x58cd13['query'][_0x022a('0x3f')]){_0xfd0028[_0x022a('0x3c')]=_['merge'](_0xfd0028[_0x022a('0x3c')],{'$or':_[_0x022a('0x2f')](_0x325d70,function(_0x3b4f26){if(_0x3b4f26[_0x022a('0x40')]!=='VIRTUAL'){var _0x1a87a9={};_0x1a87a9[_0x3b4f26[_0x022a('0x2c')]]={'$like':'%'+_0x58cd13[_0x022a('0x33')][_0x022a('0x3f')]+'%'};return _0x1a87a9;}})});}_0xfd0028=_[_0x022a('0x41')]({},_0xfd0028,_0x58cd13[_0x022a('0x42')]);var _0x59908c={'where':_0xfd0028[_0x022a('0x3c')]};return db['Plugin'][_0x022a('0x20')](_0x59908c)['then'](function(_0x5c7e33){_0x36af72[_0x022a('0x20')]=_0x5c7e33;if(_0x58cd13[_0x022a('0x33')][_0x022a('0x43')]){_0xfd0028[_0x022a('0x44')]=[{'all':!![]}];}return db[_0x022a('0x45')][_0x022a('0x46')](_0xfd0028);})[_0x022a('0x24')](function(_0x4d8f09){_0x36af72[_0x022a('0x47')]=_0x4d8f09;return _0x36af72;})['then'](respondWithFilteredResult(_0x4e51bc,_0xfd0028))['catch'](handleError(_0x4e51bc,null));};exports['show']=function(_0x3ad0e8,_0x10efbc){var _0x474501={'raw':!![],'where':{'id':_0x3ad0e8[_0x022a('0x48')]['id']}},_0x931bb2={};_0x931bb2[_0x022a('0x35')]=_[_0x022a('0x34')](db[_0x022a('0x45')][_0x022a('0x30')]);_0x931bb2[_0x022a('0x33')]=_[_0x022a('0x34')](_0x3ad0e8[_0x022a('0x33')]);_0x931bb2[_0x022a('0x3d')]=_[_0x022a('0x49')](_0x931bb2['model'],_0x931bb2[_0x022a('0x33')]);_0x474501['attributes']=_[_0x022a('0x49')](_0x931bb2[_0x022a('0x35')],qs[_0x022a('0x37')](_0x3ad0e8[_0x022a('0x33')][_0x022a('0x37')]));_0x474501[_0x022a('0x36')]=_0x474501[_0x022a('0x36')][_0x022a('0x38')]?_0x474501[_0x022a('0x36')]:_0x931bb2[_0x022a('0x35')];if(_0x3ad0e8['query'][_0x022a('0x43')]){_0x474501[_0x022a('0x44')]=[{'all':!![]}];}_0x474501=_[_0x022a('0x41')]({},_0x474501,_0x3ad0e8[_0x022a('0x42')]);return db[_0x022a('0x45')]['find'](_0x474501)['then'](handleEntityNotFound(_0x10efbc,null))['then'](respondWithResult(_0x10efbc,null))['catch'](handleError(_0x10efbc,null));};exports[_0x022a('0x4a')]=function(_0x414e07,_0x186b3a,_0x5c02cc){return db[_0x022a('0x45')]['find']({'where':{'id':_0x414e07[_0x022a('0x48')]['id']},'attributes':[_0x022a('0x2c'),_0x022a('0x6')],'raw':!![]})[_0x022a('0x24')](handleEntityNotFound(_0x186b3a,null))[_0x022a('0x24')](function(_0x487ce8){if(_0x487ce8){var _0x248131=path[_0x022a('0x4b')](config['root'],_0x022a('0x4c'),util['format'](_0x022a('0x4d'),path[_0x022a('0x4e')](_0x487ce8[_0x022a('0x6')])));var _0x187b8c=fs[_0x022a('0x4f')](_0x248131);var _0x5dfe26=archiver(_0x022a('0x50'),{'zlib':{'level':0x9}});_0x5dfe26['on'](_0x022a('0x51'),function(_0x4709eb){if(_0x4709eb[_0x022a('0x52')]===_0x022a('0x53')){logger[_0x022a('0x2a')](_0x4709eb);}else{throw new db['Sequelize']['Error'](_0x022a('0x54'));}});_0x5dfe26['on'](_0x022a('0x2a'),function(_0x3235dc){throw new db[(_0x022a('0x55'))]['Error'](_0x022a('0x54'));});_0x5dfe26[_0x022a('0x56')](_0x187b8c);_0x5dfe26[_0x022a('0x57')](_0x022a('0x58'),{'cwd':path[_0x022a('0x4b')](config[_0x022a('0x59')],_0x022a('0x4c'),path[_0x022a('0x5a')](_0x487ce8['path'])),'ignore':[path[_0x022a('0x4b')](path[_0x022a('0x4e')](_0x487ce8['path']),_0x022a('0x5b')),path['join'](path['basename'](_0x487ce8[_0x022a('0x6')]),_0x022a('0x5c'))],'nodir':!![]})[_0x022a('0x5d')]();_0x187b8c['on'](_0x022a('0x5e'),function(){if(!fs['existsSync'](_0x248131)){throw new db[(_0x022a('0x55'))]['Error'](_0x022a('0x5f'));}return _0x186b3a[_0x022a('0x4a')](_0x248131,util[_0x022a('0x60')](_0x022a('0x4d'),path[_0x022a('0x4e')](_0x487ce8[_0x022a('0x6')])),function(_0x1e4079){if(_0x1e4079){throw new db[(_0x022a('0x55'))][(_0x022a('0x61'))](_0x022a('0x62'));}fs[_0x022a('0x63')](_0x248131);logger[_0x022a('0x64')](_0x022a('0x65'));logger[_0x022a('0x64')](_0x022a('0x66'));});});}return null;})['catch'](handleError(_0x186b3a,null));};exports[_0x022a('0x67')]=function(_0x343c1a,_0x3dc331,_0x211425){var _0x55f235=path[_0x022a('0x4e')](_0x343c1a['file'][_0x022a('0x68')],path[_0x022a('0x69')](_0x343c1a[_0x022a('0x6a')][_0x022a('0x68')]));var _0x95ae0a=path['join'](config[_0x022a('0x59')],_0x022a('0x4c'),_0x343c1a[_0x022a('0x6a')]['filename']);var _0x39ccea=path['join'](config[_0x022a('0x59')],_0x022a('0x4c'),_0x55f235);logger[_0x022a('0x64')](_0x022a('0x6b'),_0x95ae0a);logger[_0x022a('0x64')](_0x022a('0x6c'),_0x39ccea);try{fs[_0x022a('0x6d')](_0x95ae0a,parseInt(_0x022a('0x6e'),0x8));extract(_0x95ae0a,{'dir':_0x39ccea},function(_0x46c42e){if(_0x46c42e){logger[_0x022a('0x2a')](_0x46c42e);handleError(_0x46c42e,!![]);};var _0x351e42=fs[_0x022a('0x6f')](_0x39ccea);if(_0x351e42[_0x022a('0x38')]>0x1){removeReferences(_0x95ae0a,_0x39ccea);logger[_0x022a('0x2a')](_0x022a('0x70'));return _0x211425(new Error(_0x022a('0x70')));}var _0x54d14b=fs[_0x022a('0x71')](path[_0x022a('0x4b')](_0x39ccea,_0x351e42[0x0]));if(_0x54d14b[_0x022a('0x72')]()){removeReferences(_0x95ae0a,_0x39ccea);logger[_0x022a('0x2a')](_0x022a('0x70'));return _0x211425(new Error(_0x022a('0x70')));}if(_0x54d14b[_0x022a('0x73')]()){var _0x14f706=fs[_0x022a('0x6f')](path[_0x022a('0x4b')](_0x39ccea,_0x351e42[0x0]));if(_0x14f706['length']===0x0){removeReferences(_0x95ae0a,_0x39ccea);logger[_0x022a('0x2a')]('Invalid\x20plugin\x20structure');return _0x211425(new Error(_0x022a('0x70')));}var _0x598502=_0x14f706['some'](function(_0x9aabb0){return _0x9aabb0==='manifest.json';});if(!_0x598502){return _0x211425(new Error(_0x022a('0x74')));}var _0x135f9c=fs['readFileSync'](path[_0x022a('0x4b')](_0x39ccea,_0x351e42[0x0],_0x022a('0x75')));var _0x1b05fb=JSON[_0x022a('0x76')](_0x135f9c);if(_0x022a('0x77')==typeof _0x1b05fb['name']){return _0x211425(new Error(_0x022a('0x78')));}if(_0x022a('0x77')==typeof _0x1b05fb[_0x022a('0x40')]){return _0x211425(new Error(_0x022a('0x79')));}if(_0x022a('0x77')==typeof _0x1b05fb[_0x022a('0x7a')]){return _0x211425(new Error(_0x022a('0x7b')));}if(_0x022a('0x77')==typeof _0x1b05fb[_0x022a('0x7c')]){return _0x211425(new Error(_0x022a('0x7d')));}if(_0x1b05fb[_0x022a('0x40')]===_0x022a('0x7e')){if(_0x022a('0x77')==typeof _0x1b05fb[_0x022a('0x7c')][_0x022a('0x7f')]){return _0x211425(new Error(_0x022a('0x80')));}if('undefined'==typeof _0x1b05fb[_0x022a('0x7c')][_0x022a('0x7f')][_0x022a('0x81')]&&_0x022a('0x77')==typeof _0x1b05fb[_0x022a('0x7c')]['views'][_0x022a('0x82')]){return _0x211425(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1b05fb[_0x022a('0x40')]==='script'){if(_0x022a('0x77')==typeof _0x1b05fb[_0x022a('0x7c')]['scriptName']){return _0x211425(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x1b05fb[_0x022a('0x7c')][_0x022a('0x83')]){return _0x211425(new Error(_0x022a('0x84')));}}else{return _0x211425(new Error(_0x022a('0x85')));}var _0x5b7be0=_0x1b05fb['name'];var _0x3da697=_0x1b05fb['description'];var _0x68970f=_0x1b05fb[_0x022a('0x40')];var _0x59dbc1=_0x1b05fb['sidebar']?_0x1b05fb[_0x022a('0x86')]:'always';var _0xf42a27=_0x1b05fb[_0x022a('0x87')]?_0x1b05fb[_0x022a('0x87')]:_0x022a('0x88');var _0x402de4='';var _0x163703='';var _0x392a3a='';var _0x405a87='';var _0x18d131=_0x1b05fb[_0x022a('0x7a')];if(_0x68970f===_0x022a('0x7e')){if('undefined'!=typeof _0x1b05fb[_0x022a('0x7c')]['views']['admin']){var _0x4645a5=_0x1b05fb['parameters'][_0x022a('0x7f')][_0x022a('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4645a5)){_0x402de4=path[_0x022a('0x4b')]('plugins',_0x55f235,_0x351e42[0x0],_0x4645a5);}else{_0x402de4=_0x4645a5;}}else{logger[_0x022a('0x64')](_0x022a('0x89'));}if('undefined'!=typeof _0x1b05fb[_0x022a('0x7c')][_0x022a('0x7f')][_0x022a('0x82')]){var _0x3ef92c=_0x1b05fb[_0x022a('0x7c')]['views'][_0x022a('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x022a('0x8a')](_0x3ef92c)){_0x163703=path[_0x022a('0x4b')](_0x022a('0x8b'),_0x55f235,_0x351e42[0x0],_0x3ef92c);}else{_0x163703=_0x3ef92c;}}else{logger[_0x022a('0x64')](_0x022a('0x8c'));}}else if(_0x68970f===_0x022a('0x8d')){_0x392a3a=_0x1b05fb['parameters'][_0x022a('0x8e')];_0x405a87=_0x1b05fb[_0x022a('0x7c')][_0x022a('0x83')];if(_0x022a('0x77')!=typeof _0x1b05fb[_0x022a('0x7c')][_0x022a('0x7f')]){if(_0x022a('0x77')!=typeof _0x1b05fb[_0x022a('0x7c')][_0x022a('0x7f')][_0x022a('0x81')]){var _0x4645a5=_0x1b05fb[_0x022a('0x7c')]['views'][_0x022a('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x022a('0x8a')](_0x4645a5)){_0x402de4=path[_0x022a('0x4b')](_0x022a('0x8b'),_0x55f235,_0x351e42[0x0],_0x4645a5);}else{_0x402de4=_0x4645a5;}}if(_0x022a('0x77')!=typeof _0x1b05fb[_0x022a('0x7c')]['views'][_0x022a('0x82')]){var _0x3ef92c=_0x1b05fb[_0x022a('0x7c')]['views'][_0x022a('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x022a('0x8a')](_0x3ef92c)){_0x163703=path[_0x022a('0x4b')](_0x022a('0x8b'),_0x55f235,_0x351e42[0x0],_0x3ef92c);}else{_0x163703=_0x3ef92c;}}}}var _0xd33571={'name':_0x5b7be0,'description':_0x3da697,'path':path[_0x022a('0x4b')](_0x55f235,_0x351e42[0x0]),'type':_0x68970f,'sidebar':_0x59dbc1,'icon':_0xf42a27,'adminUrl':_0x402de4,'agentUrl':_0x163703,'scriptName':_0x392a3a,'scriptPath':_0x405a87,'version':_0x18d131};removeReferences(_0x95ae0a,null);return db[_0x022a('0x45')][_0x022a('0x8f')](_0xd33571)[_0x022a('0x24')](function(_0x157d46){var _0xc25e18={'role':_0x343c1a[_0x022a('0x90')]['role'],'userProfileId':_0x343c1a[_0x022a('0x90')][_0x022a('0x91')]};if(!_0xc25e18)throw new Error(_0x022a('0x92'));if(_0xc25e18['role']===_0x022a('0x93')){var _0x422f30=_0x157d46[_0x022a('0x26')]({'plain':!![]});return db[_0x022a('0x94')][_0x022a('0x95')]({'where':{'name':_0x022a('0x27'),'userProfileId':_0xc25e18['userProfileId']},'raw':!![]})['then'](function(_0x2ee353){if(_0x2ee353&&_0x2ee353[_0x022a('0x96')]===0x0){return db[_0x022a('0x28')][_0x022a('0x8f')]({'name':_0x422f30['name'],'resourceId':_0x422f30['id'],'type':_0x2ee353[_0x022a('0x2c')],'sectionId':_0x2ee353['id']},{})[_0x022a('0x24')](function(){return _0x157d46;});}else{return _0x157d46;}})[_0x022a('0x97')](function(_0x3d9dd3){logger[_0x022a('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d9dd3);throw _0x3d9dd3;});}return _0x157d46;})['then'](respondWithResult(_0x3dc331,null))['catch'](handleError(_0x3dc331,null));}});}catch(_0x57b2d1){_0x3dc331[_0x022a('0x1c')](0x1f4)[_0x022a('0x2d')](_0x57b2d1);}};function removeReferences(_0x388da3,_0x80a748){try{if(_0x388da3){fs[_0x022a('0x63')](_0x388da3);logger[_0x022a('0x64')](_0x022a('0x98'));}if(_0x80a748){rimraf(_0x80a748,function(){});logger[_0x022a('0x64')](_0x022a('0x99'));}}catch(_0x24d4f5){logger[_0x022a('0x2a')](_0x24d4f5);}}exports['update']=function(_0x2755cc,_0x335dbc,_0xf5dbda){return db[_0x022a('0x45')][_0x022a('0x95')]({'where':{'id':_0x2755cc[_0x022a('0x48')]['id']}})['then'](handleEntityNotFound(_0x335dbc,null))[_0x022a('0x24')](saveUpdates(_0x2755cc[_0x022a('0x90')],null))[_0x022a('0x24')](respondWithResult(_0x335dbc,null))[_0x022a('0x97')](handleError(_0x335dbc,null));};exports['delete']=function(_0x251ef0,_0x31e585,_0x10954e){return db['Plugin'][_0x022a('0x95')]({'where':{'id':_0x251ef0['params']['id']}})[_0x022a('0x24')](function(_0x1f17d6){if(_0x1f17d6){return _0x1f17d6[_0x022a('0x25')]();}})[_0x022a('0x24')](function(_0x17a194){rimraf(path[_0x022a('0x4b')](config[_0x022a('0x59')],'server/files/plugins',path[_0x022a('0x5a')](_0x17a194[_0x022a('0x6')])),function(){});return _0x17a194;})['then'](handleEntityNotFound(_0x31e585,null))[_0x022a('0x24')](respondWithStatusCode(_0x31e585,null))['catch'](handleError(_0x31e585,null));};exports[_0x022a('0x9a')]=function(_0x18e695,_0x26fc38,_0x517f2e){return BPromise[_0x022a('0x9b')]()[_0x022a('0x24')](function(){if(!_0x18e695[_0x022a('0x33')][_0x022a('0x6')]){throw new Error(_0x022a('0x9c'));}if(!_0x18e695[_0x022a('0x33')]['port']){throw new Error(_0x022a('0x9d'));}var _0x213e02=_0x18e695[_0x022a('0x33')][_0x022a('0x9e')]?_0x18e695[_0x022a('0x33')]['hostname']+':'+_0x18e695['query']['port']:_0x022a('0x9f')+_0x18e695[_0x022a('0x33')][_0x022a('0xa0')];var _0x5878a1=_0x18e695[_0x022a('0x33')]['json']?_0x18e695[_0x022a('0x33')][_0x022a('0xa1')]:!![];var _0x346f25=_0x18e695[_0x022a('0x33')][_0x022a('0xa2')]?_0x18e695[_0x022a('0x33')]['encoding']:null;var _0x1e901c={'method':_0x18e695[_0x022a('0xa3')],'uri':util['format'](_0x022a('0xa4'),_0x213e02,_0x18e695[_0x022a('0x33')]['path']),'json':_0x5878a1,'resolveWithFullResponse':!![],'encoding':_0x346f25,'qs':_0x18e695[_0x022a('0x33')]};if(_0x18e695[_0x022a('0xa5')]){_0x1e901c['headers']=_0x18e695['headers'];if(_0x1e901c[_0x022a('0xa5')][_0x022a('0xa6')]){delete _0x1e901c[_0x022a('0xa5')]['content-length'];}}if(_0x1e901c[_0x022a('0xa5')][_0x022a('0xa7')]){delete _0x1e901c[_0x022a('0xa5')]['content-type'];}return rp(_0x1e901c);})[_0x022a('0x24')](function(_0x232635){if(_0x232635){_0x26fc38[_0x022a('0xa8')](_0x232635[_0x022a('0xa5')]);logger[_0x022a('0x64')](_0x232635[_0x022a('0x90')]);if(_[_0x022a('0xa9')](_0x18e695[_0x022a('0x33')][_0x022a('0x6')],_0x022a('0x4a'))&&_0x232635[_0x022a('0xaa')]==0x1f4){return _0x26fc38[_0x022a('0x29')](_0x232635['statusCode']);}else{return _0x26fc38[_0x022a('0x1c')](_0x232635[_0x022a('0xaa')])[_0x022a('0x2d')](_0x232635[_0x022a('0x90')]);}}else{return _0x26fc38['sendStatus'](0xc8);}})[_0x022a('0x97')](handleError(_0x26fc38,null));};exports[_0x022a('0xab')]=function(_0x5296c9,_0x3a1276,_0x4cd36b){return BPromise[_0x022a('0x9b')]()[_0x022a('0x24')](function(){if(!_0x5296c9['query'][_0x022a('0x6')]){throw new Error(_0x022a('0x9c'));}if(!_0x5296c9['query'][_0x022a('0xa0')]){throw new Error(_0x022a('0x9d'));}var _0x592ec1=_0x5296c9[_0x022a('0x33')][_0x022a('0x9e')]?_0x5296c9[_0x022a('0x33')][_0x022a('0x9e')]+':'+_0x5296c9[_0x022a('0x33')][_0x022a('0xa0')]:_0x022a('0x9f')+_0x5296c9[_0x022a('0x33')][_0x022a('0xa0')];var _0x54dd48=_0x5296c9[_0x022a('0x33')][_0x022a('0xa1')]?_0x5296c9[_0x022a('0x33')][_0x022a('0xa1')]:!![];var _0x53310a=_0x5296c9[_0x022a('0x33')][_0x022a('0xa2')]?_0x5296c9['query'][_0x022a('0xa2')]:null;var _0x2419e5={'method':_0x5296c9['method'],'uri':util[_0x022a('0x60')](_0x022a('0xa4'),_0x592ec1,_0x5296c9[_0x022a('0x33')]['path']),'json':_0x54dd48,'resolveWithFullResponse':!![],'encoding':_0x53310a,'body':_0x5296c9[_0x022a('0x90')]};if(_0x5296c9[_0x022a('0xa5')]){_0x2419e5['headers']=_0x5296c9[_0x022a('0xa5')];if(_0x2419e5[_0x022a('0xa5')]['content-length']){delete _0x2419e5[_0x022a('0xa5')][_0x022a('0xa6')];}}if(_0x2419e5[_0x022a('0xa5')][_0x022a('0xa7')]){delete _0x2419e5['headers'][_0x022a('0xa7')];}return rp(_0x2419e5);})[_0x022a('0x24')](function(_0x570004){if(_0x570004){_0x3a1276[_0x022a('0xa8')](_0x570004['headers']);logger[_0x022a('0x64')](_0x570004[_0x022a('0x90')]);return _0x3a1276['status'](_0x570004['statusCode'])[_0x022a('0x2d')](_0x570004[_0x022a('0x90')]);}else{return _0x3a1276[_0x022a('0x29')](0xc8);}})[_0x022a('0x97')](handleError(_0x3a1276,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index de69f39..eef709b 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 _0xa899=['exports','events','../../mysqldb','Plugin','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1a4a71,_0x254e39){var _0x352160=function(_0x2ed3a6){while(--_0x2ed3a6){_0x1a4a71['push'](_0x1a4a71['shift']());}};_0x352160(++_0x254e39);}(_0xa899,0x155));var _0x9a89=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0xa899[_0x580b15];return _0x1adb1b;};'use strict';var EventEmitter=require(_0x9a89('0x0'));var Plugin=require(_0x9a89('0x1'))['db'][_0x9a89('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a89('0x3'),'afterUpdate':_0x9a89('0x4'),'afterDestroy':_0x9a89('0x5')};function emitEvent(_0x45233c){return function(_0x405c47,_0x15c431,_0x105758){PluginEvents[_0x9a89('0x6')](_0x45233c+':'+_0x405c47['id'],_0x405c47);PluginEvents[_0x9a89('0x6')](_0x45233c,_0x405c47);_0x105758(null);};}for(var e in events){if(events[_0x9a89('0x7')](e)){var event=events[e];Plugin[_0x9a89('0x8')](e,emitEvent(event));}}module[_0x9a89('0x9')]=PluginEvents; \ No newline at end of file +var _0x15c6=['exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x20c3e5,_0x18ccb7){var _0x3222d8=function(_0x15c917){while(--_0x15c917){_0x20c3e5['push'](_0x20c3e5['shift']());}};_0x3222d8(++_0x18ccb7);}(_0x15c6,0x1cd));var _0x615c=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x15c6[_0x2f8530];return _0x5e814e;};'use strict';var EventEmitter=require(_0x615c('0x0'));var Plugin=require(_0x615c('0x1'))['db'][_0x615c('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x615c('0x3')](0x0);var events={'afterCreate':_0x615c('0x4'),'afterUpdate':_0x615c('0x5'),'afterDestroy':_0x615c('0x6')};function emitEvent(_0x28cf45){return function(_0x4bb54c,_0x5143f9,_0x5ea94e){PluginEvents[_0x615c('0x7')](_0x28cf45+':'+_0x4bb54c['id'],_0x4bb54c);PluginEvents[_0x615c('0x7')](_0x28cf45,_0x4bb54c);_0x5ea94e(null);};}for(var e in events){if(events[_0x615c('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x615c('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 68a5667..3be4d78 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 _0x6c19=['exports','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x35b558,_0xeb7d5c){var _0x481909=function(_0x3aea9c){while(--_0x3aea9c){_0x35b558['push'](_0x35b558['shift']());}};_0x481909(++_0xeb7d5c);}(_0x6c19,0x12e));var _0x96c1=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x6c19[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0x96c1('0x0'));var util=require(_0x96c1('0x1'));var logger=require(_0x96c1('0x2'))(_0x96c1('0x3'));var moment=require(_0x96c1('0x4'));var BPromise=require(_0x96c1('0x5'));var rp=require(_0x96c1('0x6'));var fs=require('fs');var path=require(_0x96c1('0x7'));var rimraf=require(_0x96c1('0x8'));var config=require(_0x96c1('0x9'));var attributes=require('./plugin.attributes');module[_0x96c1('0xa')]=function(_0x489c8b,_0x3e7b35){return _0x489c8b['define'](_0x96c1('0xb'),attributes,{'tableName':_0x96c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0018=['request-promise','../../config/environment','exports','define','Plugin','plugins','util','../../config/logger','moment','bluebird'];(function(_0x3ac179,_0x2832d4){var _0x5565f1=function(_0x7695a1){while(--_0x7695a1){_0x3ac179['push'](_0x3ac179['shift']());}};_0x5565f1(++_0x2832d4);}(_0x0018,0xa6));var _0x8001=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x0018[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x8001('0x0'));var logger=require(_0x8001('0x1'))('api');var moment=require(_0x8001('0x2'));var BPromise=require(_0x8001('0x3'));var rp=require(_0x8001('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8001('0x5'));var attributes=require('./plugin.attributes');module[_0x8001('0x6')]=function(_0x44893a,_0x1ad58a){return _0x44893a[_0x8001('0x7')](_0x8001('0x8'),attributes,{'tableName':_0x8001('0x9'),'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 f47fc71..8e2a3b9 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 _0x066f=['register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0xbfa03e,_0x28b4bf){var _0x2def32=function(_0x573361){while(--_0x573361){_0xbfa03e['push'](_0xbfa03e['shift']());}};_0x2def32(++_0x28b4bf);}(_0x066f,0x101));var _0xf066=function(_0xac3f1f,_0x579235){_0xac3f1f=_0xac3f1f-0x0;var _0x6f5571=_0x066f[_0xac3f1f];return _0x6f5571;};'use strict';var _=require(_0xf066('0x0'));var util=require(_0xf066('0x1'));var moment=require(_0xf066('0x2'));var BPromise=require(_0xf066('0x3'));var rs=require(_0xf066('0x4'));var fs=require('fs');var Redis=require(_0xf066('0x5'));var db=require(_0xf066('0x6'))['db'];var utils=require(_0xf066('0x7'));var logger=require('../../config/logger')(_0xf066('0x8'));var config=require('../../config/environment');var jayson=require(_0xf066('0x9'));var client=jayson[_0xf066('0xa')][_0xf066('0xb')]({'port':0x232a});config[_0xf066('0xc')]=_[_0xf066('0xd')](config[_0xf066('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf066('0xe'))(new Redis(config['redis']));require('./plugin.socket')[_0xf066('0xf')](socket);function respondWithRpcPromise(_0x4975a9,_0x278238,_0x3a15fa){return new BPromise(function(_0x13c7f2,_0x5a9816){return client[_0xf066('0x10')](_0x4975a9,_0x3a15fa)[_0xf066('0x11')](function(_0x2529ea){logger[_0xf066('0x12')]('Plugin,\x20%s,\x20%s',_0x278238,_0xf066('0x13'));logger[_0xf066('0x14')](_0xf066('0x15'),_0x278238,_0xf066('0x13'),JSON[_0xf066('0x16')](_0x2529ea));if(_0x2529ea[_0xf066('0x17')]){if(_0x2529ea['error']['code']===0x1f4){logger[_0xf066('0x17')](_0xf066('0x18'),_0x278238,_0x2529ea[_0xf066('0x17')][_0xf066('0x19')]);return _0x5a9816(_0x2529ea['error']['message']);}logger[_0xf066('0x17')](_0xf066('0x18'),_0x278238,_0x2529ea[_0xf066('0x17')][_0xf066('0x19')]);return _0x13c7f2(_0x2529ea[_0xf066('0x17')]['message']);}else{logger[_0xf066('0x12')](_0xf066('0x18'),_0x278238,'request\x20sent');_0x13c7f2(_0x2529ea[_0xf066('0x1a')][_0xf066('0x19')]);}})[_0xf066('0x1b')](function(_0x13c009){logger[_0xf066('0x17')]('Plugin,\x20%s,\x20%s',_0x278238,_0x13c009);_0x5a9816(_0x13c009);});});}exports[_0xf066('0x1c')]=function(_0x1eea66){var _0x4215bf=this;return new Promise(function(_0x58782a,_0x19ebd3){return db[_0xf066('0x1d')][_0xf066('0x1e')](_0x1eea66[_0xf066('0x1f')],{'raw':_0x1eea66[_0xf066('0x20')]?_0x1eea66[_0xf066('0x20')][_0xf066('0x21')]===undefined?!![]:![]:!![]})[_0xf066('0x11')](function(_0x5afc2d){logger[_0xf066('0x12')]('CreatePlugin',_0x1eea66);logger[_0xf066('0x14')](_0xf066('0x1c'),_0x1eea66,JSON[_0xf066('0x16')](_0x5afc2d));_0x58782a(_0x5afc2d);})[_0xf066('0x1b')](function(_0x5e1f8d){logger['error'](_0xf066('0x1c'),_0x5e1f8d[_0xf066('0x19')],_0x1eea66);_0x19ebd3(_0x4215bf[_0xf066('0x17')](0x1f4,_0x5e1f8d[_0xf066('0x19')]));});});}; \ No newline at end of file +var _0xfe8e=['Plugin','create','body','options','raw','info','lodash','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreatePlugin'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xfe8e,0x1c6));var _0xefe8=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0xfe8e[_0x3c4062];return _0x3f5bf3;};'use strict';var _=require(_0xefe8('0x0'));var util=require('util');var moment=require(_0xefe8('0x1'));var BPromise=require(_0xefe8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefe8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xefe8('0x4'))('rpc');var config=require(_0xefe8('0x5'));var jayson=require(_0xefe8('0x6'));var client=jayson[_0xefe8('0x7')][_0xefe8('0x8')]({'port':0x232a});config[_0xefe8('0x9')]=_[_0xefe8('0xa')](config[_0xefe8('0x9')],{'host':_0xefe8('0xb'),'port':0x18eb});var socket=require(_0xefe8('0xc'))(new Redis(config[_0xefe8('0x9')]));require(_0xefe8('0xd'))[_0xefe8('0xe')](socket);function respondWithRpcPromise(_0x3b226f,_0x52286d,_0x33188a){return new BPromise(function(_0x48e053,_0xce3ba2){return client['request'](_0x3b226f,_0x33188a)[_0xefe8('0xf')](function(_0x3b9c25){logger['info'](_0xefe8('0x10'),_0x52286d,_0xefe8('0x11'));logger[_0xefe8('0x12')](_0xefe8('0x13'),_0x52286d,'request\x20sent',JSON[_0xefe8('0x14')](_0x3b9c25));if(_0x3b9c25[_0xefe8('0x15')]){if(_0x3b9c25[_0xefe8('0x15')]['code']===0x1f4){logger[_0xefe8('0x15')](_0xefe8('0x10'),_0x52286d,_0x3b9c25[_0xefe8('0x15')]['message']);return _0xce3ba2(_0x3b9c25[_0xefe8('0x15')][_0xefe8('0x16')]);}logger[_0xefe8('0x15')](_0xefe8('0x10'),_0x52286d,_0x3b9c25['error']['message']);return _0x48e053(_0x3b9c25[_0xefe8('0x15')][_0xefe8('0x16')]);}else{logger['info'](_0xefe8('0x10'),_0x52286d,_0xefe8('0x11'));_0x48e053(_0x3b9c25[_0xefe8('0x17')][_0xefe8('0x16')]);}})[_0xefe8('0x18')](function(_0x3cf422){logger[_0xefe8('0x15')](_0xefe8('0x10'),_0x52286d,_0x3cf422);_0xce3ba2(_0x3cf422);});});}exports[_0xefe8('0x19')]=function(_0x9308ce){var _0x3a1f60=this;return new Promise(function(_0x19367e,_0x51914c){return db[_0xefe8('0x1a')][_0xefe8('0x1b')](_0x9308ce[_0xefe8('0x1c')],{'raw':_0x9308ce[_0xefe8('0x1d')]?_0x9308ce['options'][_0xefe8('0x1e')]===undefined?!![]:![]:!![]})[_0xefe8('0xf')](function(_0x461c5a){logger[_0xefe8('0x1f')](_0xefe8('0x19'),_0x9308ce);logger[_0xefe8('0x12')](_0xefe8('0x19'),_0x9308ce,JSON[_0xefe8('0x14')](_0x461c5a));_0x19367e(_0x461c5a);})['catch'](function(_0x4599a3){logger['error'](_0xefe8('0x19'),_0x4599a3[_0xefe8('0x16')],_0x9308ce);_0x51914c(_0x3a1f60[_0xefe8('0x15')](0x1f4,_0x4599a3[_0xefe8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index c83ef2d..8c3a01b 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 _0x8b0e=['plugin:','./plugin.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3a0863,_0x4cd5ef){var _0x85c557=function(_0x3011cb){while(--_0x3011cb){_0x3a0863['push'](_0x3a0863['shift']());}};_0x85c557(++_0x4cd5ef);}(_0x8b0e,0x10f));var _0xe8b0=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0x8b0e[_0x152136];return _0x20df44;};'use strict';var PluginEvents=require(_0xe8b0('0x0'));var events=[_0xe8b0('0x1'),_0xe8b0('0x2'),_0xe8b0('0x3')];function createListener(_0x5cba1d,_0x31bed0){return function(_0x454943){_0x31bed0[_0xe8b0('0x4')](_0x5cba1d,_0x454943);};}function removeListener(_0xf87e14,_0x2ed717){return function(){PluginEvents[_0xe8b0('0x5')](_0xf87e14,_0x2ed717);};}exports[_0xe8b0('0x6')]=function(_0x55d5c3){for(var _0x1bd3a7=0x0,_0x120b36=events[_0xe8b0('0x7')];_0x1bd3a7<_0x120b36;_0x1bd3a7++){var _0x1e852b=events[_0x1bd3a7];var _0x944f0d=createListener(_0xe8b0('0x8')+_0x1e852b,_0x55d5c3);PluginEvents['on'](_0x1e852b,_0x944f0d);}}; \ No newline at end of file +var _0xd083=['plugin:','./plugin.events','save','remove','update','emit','removeListener','register','length'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0xd083,0x76));var _0x3d08=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0xd083[_0x1aba25];return _0x47d997;};'use strict';var PluginEvents=require(_0x3d08('0x0'));var events=[_0x3d08('0x1'),_0x3d08('0x2'),_0x3d08('0x3')];function createListener(_0x5f3d78,_0x2646f4){return function(_0x89c42e){_0x2646f4[_0x3d08('0x4')](_0x5f3d78,_0x89c42e);};}function removeListener(_0x4d151f,_0x977a1c){return function(){PluginEvents[_0x3d08('0x5')](_0x4d151f,_0x977a1c);};}exports[_0x3d08('0x6')]=function(_0x53cf19){for(var _0x573530=0x0,_0x1ebb4d=events[_0x3d08('0x7')];_0x573530<_0x1ebb4d;_0x573530++){var _0x1c017e=events[_0x573530];var _0x5a6c47=createListener(_0x3d08('0x8')+_0x1c017e,_0x53cf19);PluginEvents['on'](_0x1c017e,_0x5a6c47);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 0f319e9..4e500c4 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(_0x1d4888,_0x487429){var _0x20f171=function(_0xcb7200){while(--_0xcb7200){_0x1d4888['push'](_0x1d4888['shift']());}};_0x20f171(++_0x487429);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x29b1dd,_0x55d4ac){var _0x1a7f6d=function(_0x51b619){while(--_0x51b619){_0x29b1dd['push'](_0x29b1dd['shift']());}};_0x1a7f6d(++_0x55d4ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 2ff4f43..c55abd9 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 _0x39cb=['create','body','join','../../files/plugins','cwd','chdir','start','send','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','../../config/pm2','../../config/logger','path','child_process','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','describe','params'];(function(_0x3a8a0e,_0x5dfa91){var _0x4b40fc=function(_0x4b2a9d){while(--_0x4b2a9d){_0x3a8a0e['push'](_0x3a8a0e['shift']());}};_0x4b40fc(++_0x5dfa91);}(_0x39cb,0x1bd));var _0xb39c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x39cb[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var pm2=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var path=require(_0xb39c('0x2'));var exec=require(_0xb39c('0x3'))['exec'];var BPromise=require(_0xb39c('0x4'));function handleEntityNotFound(_0x285eca,_0x398d07){return function(_0x2bca14){if(!_0x2bca14){_0x285eca[_0xb39c('0x5')](0x194);;}return _0x2bca14;};}function respondWithResult(_0x4ae4cf,_0x32cdcd){_0x32cdcd=_0x32cdcd||0xc8;return function(_0x2fc868){if(_0x2fc868){return _0x4ae4cf[_0xb39c('0x6')](_0x32cdcd)[_0xb39c('0x7')](_0x2fc868);}return null;};}function handleError(_0x47d6d7,_0x5ae14a){_0x5ae14a=_0x5ae14a||0x1f4;return function(_0x41557b){logger[_0xb39c('0x8')](_0x41557b[_0xb39c('0x9')]);if(_0x41557b[_0xb39c('0xa')]){delete _0x41557b['name'];}_0x47d6d7['status'](_0x5ae14a)['send'](_0x41557b);};}function execChildProcess(){return new BPromise(function(_0x1de94f,_0x497ffc){exec(_0xb39c('0xb'),function(_0x1088ee,_0x433ee8,_0x340622){logger[_0xb39c('0xc')](_0x433ee8);logger[_0xb39c('0xc')](_0x340622);if(_0x1088ee){logger['error'](_0x1088ee);return _0x497ffc(_0x1088ee);}return _0x1de94f(_0x433ee8);});});}exports[_0xb39c('0xd')]=function(_0x468995,_0x2620cd){return pm2['list']()[_0xb39c('0xe')](function(_0x40a6d3){if(_0x40a6d3){var _0x42a203=_[_0xb39c('0xf')](_0x40a6d3,function(_0x469fa9){return _0x469fa9[_0xb39c('0xa')]===_0xb39c('0x10')||_0x469fa9['name']===_0xb39c('0x11');});return{'rows':_0x42a203,'count':_0x42a203[_0xb39c('0x12')]};}return null;})[_0xb39c('0xe')](respondWithResult(_0x2620cd,null))[_0xb39c('0x13')](handleError(_0x2620cd,null));};exports[_0xb39c('0x14')]=function(_0x3b7fad,_0x1a2f48){return pm2[_0xb39c('0x15')](_0x3b7fad[_0xb39c('0x16')]['id'])[_0xb39c('0xe')](respondWithResult(_0x1a2f48,null))['then'](handleEntityNotFound(_0x1a2f48,null))[_0xb39c('0x13')](handleError(_0x1a2f48,null));};exports[_0xb39c('0x17')]=function(_0x28bbe1,_0x447352){if(_0x28bbe1['body'][_0xb39c('0xa')]&&_0x28bbe1[_0xb39c('0x18')]['script']){var _0x2d8e93=path[_0xb39c('0x19')](__dirname,_0xb39c('0x1a'),_0x28bbe1['body']['script']);var _0x2789fd=process[_0xb39c('0x1b')]();process[_0xb39c('0x1c')](path['dirname'](_0x2d8e93));return execChildProcess()[_0xb39c('0xe')](function(_0x438207){process[_0xb39c('0x1c')](_0x2789fd);return pm2[_0xb39c('0x1d')]({'name':_0x28bbe1[_0xb39c('0x18')]['name'],'script':_0x2d8e93});})[_0xb39c('0xe')](function(_0xbeab7e){pm2['dump']();return _0xbeab7e[0x0];})[_0xb39c('0xe')](respondWithResult(_0x447352,0xc9))[_0xb39c('0x13')](handleError(_0x447352,null));}else{return _0x447352[_0xb39c('0x6')](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x1f')});}};exports['update']=function(_0x23a2f1,_0x299c27){if(_0x23a2f1[_0xb39c('0x18')]['id']){delete _0x23a2f1['body']['id'];}var _0x41fff2={'online':_0xb39c('0x20'),'stopped':'stop'};if(_0x41fff2[_0xb39c('0x21')](_0x23a2f1[_0xb39c('0x18')][_0xb39c('0x6')])){return pm2[_0x41fff2[_0x23a2f1['body'][_0xb39c('0x6')]]](_0x23a2f1[_0xb39c('0x16')]['id'])['then'](respondWithResult(_0x299c27,0xc8))[_0xb39c('0x13')](handleError(_0x299c27,null));}else{return _0x299c27['status'](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x22')});}};exports[_0xb39c('0x23')]=function(_0x7339b4,_0x17eb7b){if(_0x7339b4['body']['id']){delete _0x7339b4[_0xb39c('0x18')]['id'];}if(_0x7339b4['params']['id']){return pm2[_0xb39c('0x24')](_0x7339b4['params']['id'])[_0xb39c('0xe')](function(_0xe2111a){pm2[_0xb39c('0x25')]();return _0xe2111a[0x0];})[_0xb39c('0xe')](respondWithResult(_0x17eb7b,null))['catch'](handleError(_0x17eb7b,null));}else{return _0x17eb7b['status'](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x26')});}}; \ No newline at end of file +var _0x0fd9=['error','index','list','reject','express','then','catch','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','hasOwnProperty','Unknown\x20status','params','Unknown\x20id','../../config/pm2','../../config/logger','api','path','bluebird','sendStatus','status','stack','name','send','npm\x20install','info'];(function(_0x5d78ff,_0x2d5570){var _0x43beeb=function(_0x370834){while(--_0x370834){_0x5d78ff['push'](_0x5d78ff['shift']());}};_0x43beeb(++_0x2d5570);}(_0x0fd9,0xa3));var _0x90fd=function(_0x591a90,_0x5525b0){_0x591a90=_0x591a90-0x0;var _0x551587=_0x0fd9[_0x591a90];return _0x551587;};'use strict';var _=require('lodash');var pm2=require(_0x90fd('0x0'));var logger=require(_0x90fd('0x1'))(_0x90fd('0x2'));var path=require(_0x90fd('0x3'));var exec=require('child_process')['exec'];var BPromise=require(_0x90fd('0x4'));function handleEntityNotFound(_0x2a5f76,_0xb7cf6){return function(_0x37a8be){if(!_0x37a8be){_0x2a5f76[_0x90fd('0x5')](0x194);;}return _0x37a8be;};}function respondWithResult(_0x23e11b,_0x5e2107){_0x5e2107=_0x5e2107||0xc8;return function(_0x4ff2d4){if(_0x4ff2d4){return _0x23e11b[_0x90fd('0x6')](_0x5e2107)['json'](_0x4ff2d4);}return null;};}function handleError(_0x5a604a,_0x2acef7){_0x2acef7=_0x2acef7||0x1f4;return function(_0x1becf2){logger['error'](_0x1becf2[_0x90fd('0x7')]);if(_0x1becf2[_0x90fd('0x8')]){delete _0x1becf2[_0x90fd('0x8')];}_0x5a604a[_0x90fd('0x6')](_0x2acef7)[_0x90fd('0x9')](_0x1becf2);};}function execChildProcess(){return new BPromise(function(_0x3be346,_0x2aae77){exec(_0x90fd('0xa'),function(_0x3c541e,_0x48943e,_0x23c417){logger[_0x90fd('0xb')](_0x48943e);logger['info'](_0x23c417);if(_0x3c541e){logger[_0x90fd('0xc')](_0x3c541e);return _0x2aae77(_0x3c541e);}return _0x3be346(_0x48943e);});});}exports[_0x90fd('0xd')]=function(_0x19a594,_0x5f28ab){return pm2[_0x90fd('0xe')]()['then'](function(_0x1cae40){if(_0x1cae40){var _0xb402d9=_[_0x90fd('0xf')](_0x1cae40,function(_0x1b3f3b){return _0x1b3f3b[_0x90fd('0x8')]===_0x90fd('0x10')||_0x1b3f3b[_0x90fd('0x8')]==='motion2';});return{'rows':_0xb402d9,'count':_0xb402d9['length']};}return null;})[_0x90fd('0x11')](respondWithResult(_0x5f28ab,null))[_0x90fd('0x12')](handleError(_0x5f28ab,null));};exports['show']=function(_0x130489,_0x13a694){return pm2[_0x90fd('0x13')](_0x130489['params']['id'])[_0x90fd('0x11')](respondWithResult(_0x13a694,null))[_0x90fd('0x11')](handleEntityNotFound(_0x13a694,null))[_0x90fd('0x12')](handleError(_0x13a694,null));};exports[_0x90fd('0x14')]=function(_0x251957,_0x58866f){if(_0x251957[_0x90fd('0x15')][_0x90fd('0x8')]&&_0x251957[_0x90fd('0x15')][_0x90fd('0x16')]){var _0x19e79b=path[_0x90fd('0x17')](__dirname,_0x90fd('0x18'),_0x251957[_0x90fd('0x15')][_0x90fd('0x16')]);var _0x493c26=process[_0x90fd('0x19')]();process[_0x90fd('0x1a')](path[_0x90fd('0x1b')](_0x19e79b));return execChildProcess()[_0x90fd('0x11')](function(_0x411a6a){process[_0x90fd('0x1a')](_0x493c26);return pm2[_0x90fd('0x1c')]({'name':_0x251957[_0x90fd('0x15')]['name'],'script':_0x19e79b});})[_0x90fd('0x11')](function(_0x52b066){pm2[_0x90fd('0x1d')]();return _0x52b066[0x0];})[_0x90fd('0x11')](respondWithResult(_0x58866f,0xc9))[_0x90fd('0x12')](handleError(_0x58866f,null));}else{return _0x58866f[_0x90fd('0x6')](0x1f4)[_0x90fd('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x90fd('0x1e')]=function(_0xe333f0,_0x2fffe6){if(_0xe333f0[_0x90fd('0x15')]['id']){delete _0xe333f0[_0x90fd('0x15')]['id'];}var _0x428bc2={'online':'restart','stopped':'stop'};if(_0x428bc2[_0x90fd('0x1f')](_0xe333f0[_0x90fd('0x15')][_0x90fd('0x6')])){return pm2[_0x428bc2[_0xe333f0[_0x90fd('0x15')][_0x90fd('0x6')]]](_0xe333f0['params']['id'])['then'](respondWithResult(_0x2fffe6,0xc8))[_0x90fd('0x12')](handleError(_0x2fffe6,null));}else{return _0x2fffe6[_0x90fd('0x6')](0x1f4)[_0x90fd('0x9')]({'message':_0x90fd('0x20')});}};exports['destroy']=function(_0x59aede,_0x12dea4){if(_0x59aede[_0x90fd('0x15')]['id']){delete _0x59aede[_0x90fd('0x15')]['id'];}if(_0x59aede[_0x90fd('0x21')]['id']){return pm2['delete'](_0x59aede[_0x90fd('0x21')]['id'])[_0x90fd('0x11')](function(_0x7fb8bc){pm2[_0x90fd('0x1d')]();return _0x7fb8bc[0x0];})[_0x90fd('0x11')](respondWithResult(_0x12dea4,null))[_0x90fd('0x12')](handleError(_0x12dea4,null));}else{return _0x12dea4[_0x90fd('0x6')](0x1f4)[_0x90fd('0x9')]({'message':_0x90fd('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 59fca94..f5ccc25 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 _0xe0de=['isAuthenticated','getQueues','express','Router','get','/agents','getAgents','/queues'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xe0de,0xc2));var _0xee0d=function(_0x37ff07,_0x1601fc){_0x37ff07=_0x37ff07-0x0;var _0x5794cd=_0xe0de[_0x37ff07];return _0x5794cd;};'use strict';var express=require(_0xee0d('0x0'));var router=express[_0xee0d('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0xee0d('0x2')](_0xee0d('0x3'),auth['isAuthenticated'](),controller[_0xee0d('0x4')]);router[_0xee0d('0x2')](_0xee0d('0x5'),auth[_0xee0d('0x6')](),controller[_0xee0d('0x7')]);module['exports']=router; \ No newline at end of file +var _0x557d=['/queues','exports','express','Router','./realtime.controller','/agents','isAuthenticated','getAgents'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x557d,0x112));var _0xd557=function(_0x251a35,_0x11dbe0){_0x251a35=_0x251a35-0x0;var _0xb2d599=_0x557d[_0x251a35];return _0xb2d599;};'use strict';var express=require(_0xd557('0x0'));var router=express[_0xd557('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd557('0x2'));router['get'](_0xd557('0x3'),auth[_0xd557('0x4')](),controller[_0xd557('0x5')]);router['get'](_0xd557('0x6'),auth[_0xd557('0x4')](),controller['getQueues']);module[_0xd557('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index dbd142e..29306be 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 _0xfcfb=['resolve','channel','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','fieldName','key','agent','getOptions','literal','FIELD(id,','order','forEach','user','role','userProfileId','assign','getResources','User','findAndCountAll','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','Queue','map','type','QueueCampaigns','UserProfile','all','util','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','client','offset','limit','undefined','count','status','set','Content-Range','json','error','stack','name','send','voice','startCase','Queues','then','format','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','push','pTalking','originated','message','Trunk','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','waiting','busy','outbound','find','merge','filter','queue','length','connectedlinenum','internal','talking','getMembers','UserId','accountcode','online','voiceStatus','paused','Pause','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','query','globalStatusFilter','pauseTypeFilter','pause','*pause'];(function(_0x21024f,_0x57aff2){var _0x41b11c=function(_0x3c6a98){while(--_0x3c6a98){_0x21024f['push'](_0x21024f['shift']());}};_0x41b11c(++_0x57aff2);}(_0xfcfb,0x9d));var _0xbfcf=function(_0x1446fc,_0x13d287){_0x1446fc=_0x1446fc-0x0;var _0x184ce1=_0xfcfb[_0x1446fc];return _0x184ce1;};'use strict';var util=require(_0xbfcf('0x0'));var _=require('lodash');var jayson=require(_0xbfcf('0x1'));var rta=require(_0xbfcf('0x2'));var qs=require(_0xbfcf('0x3'));var utils=require('../../config/utils');var logger=require(_0xbfcf('0x4'))(_0xbfcf('0x5'));var db=require(_0xbfcf('0x6'))['db'];var amiClient=jayson['client'][_0xbfcf('0x7')]({'port':0x232a});var routingClient=jayson[_0xbfcf('0x8')][_0xbfcf('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x2f73b4,_0x39011a){return function(_0x531aa6){if(_0x531aa6){var _0x4681c2=typeof _0x39011a[_0xbfcf('0x9')]==='undefined'&&typeof _0x39011a[_0xbfcf('0xa')]===_0xbfcf('0xb');var _0x1ca392=_0x531aa6[_0xbfcf('0xc')];var _0x527c86=_0x4681c2?0x0:_0x39011a[_0xbfcf('0x9')];var _0x166571=_0x4681c2?_0x531aa6[_0xbfcf('0xc')]:_0x39011a[_0xbfcf('0x9')]+_0x39011a[_0xbfcf('0xa')];var _0xcd5793;if(_0x166571>=_0x1ca392){_0x166571=_0x1ca392;_0xcd5793=0xc8;}else{_0xcd5793=0xce;}_0x2f73b4[_0xbfcf('0xd')](_0xcd5793);return _0x2f73b4[_0xbfcf('0xe')](_0xbfcf('0xf'),_0x527c86+'-'+_0x166571+'/'+_0x1ca392)[_0xbfcf('0x10')](_0x531aa6);}return null;};}function handleError(_0x246132,_0x1ad84a){_0x1ad84a=_0x1ad84a||0x1f4;return function(_0x11d1a3){logger[_0xbfcf('0x11')](_0x11d1a3[_0xbfcf('0x12')]);if(_0x11d1a3['name']){delete _0x11d1a3[_0xbfcf('0x13')];}_0x246132[_0xbfcf('0xd')](_0x1ad84a)[_0xbfcf('0x14')](_0x11d1a3);};}function getRealtimeQueues(_0x26ddba,_0x1f37c0){return new Promise(function(_0x5d86be,_0x32a3c8){var _0x271d5c=_0x1f37c0===_0xbfcf('0x15')?amiClient:routingClient;return _0x271d5c['request'](_[_0xbfcf('0x16')](_0x1f37c0)+_0xbfcf('0x17'),_0x26ddba)[_0xbfcf('0x18')](function(_0x524616){if(_0x524616[_0xbfcf('0x11')])throw new Error(util[_0xbfcf('0x19')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1f37c0));return _0x5d86be(_0x524616[_0xbfcf('0x1a')]);})[_0xbfcf('0x1b')](function(_0xf37d11){_0x32a3c8(_0xf37d11);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x50b245,_0x5aab4f){return amiClient['request'](_0xbfcf('0x1c'),{})[_0xbfcf('0x18')](function(_0x1c4907){if(_0x1c4907[_0xbfcf('0x11')])throw new Error(_0xbfcf('0x1d'));return _0x50b245(_0x1c4907['result']);})[_0xbfcf('0x1b')](function(_0x3e0da2){_0x5aab4f(_0x3e0da2);});});}function initializeQueues(_0xe7db0a,_0x226ddb,_0x17bfa,_0x4ff106){var _0x577dae=[_0xbfcf('0x1e'),'available','waiting','talking','paused'];if(_0x17bfa==='voice'&&_0x4ff106==='outbound'){_0x577dae[_0xbfcf('0x1f')](_0xbfcf('0x20'),_0xbfcf('0x21'),_0xbfcf('0x22'),'dialActive','dialMethod',_0xbfcf('0x23'),'startPredictive','startProgressive',_0xbfcf('0x24'),_0xbfcf('0x25'),'erlangAbandonmentRate',_0xbfcf('0x26'),'dialPredictiveInterval',_0xbfcf('0x27'),_0xbfcf('0x28'),_0xbfcf('0x29'),_0xbfcf('0x2a'),_0xbfcf('0x2b'),_0xbfcf('0x2c'),_0xbfcf('0x2d'),_0xbfcf('0x2e'),_0xbfcf('0x2f'));}return _0xe7db0a['map'](function(_0x59415c){var _0x4038e3=_0x59415c[_0xbfcf('0x30')]({'plain':!![]});_0x4038e3[_0xbfcf('0x31')]=[];_0x4038e3['paused']=0x0;_0x4038e3[_0xbfcf('0x32')]=0x0;_0x4038e3[_0xbfcf('0x1e')]=0x0;_0x4038e3['available']=0x0;_0x4038e3[_0xbfcf('0x33')]=0x0;if(_0x17bfa==='voice'){_0x4038e3['talking']=0x0;_0x4038e3[_0xbfcf('0x34')]=0x0;if(_0x4ff106===_0xbfcf('0x35')){_0x4038e3[_0xbfcf('0x20')]=0x0;_0x4038e3[_0xbfcf('0x21')]=0x0;}}var _0x197197=_[_0xbfcf('0x36')](_0x226ddb,['id',_0x4038e3['id']]);if(_0x197197)_[_0xbfcf('0x37')](_0x4038e3,_['pick'](_0x197197,_0x577dae));return _0x4038e3;});}function updateAgentVoiceStatus(_0x12a82a,_0x23676c,_0x15c6b1){var _0x2ade0b=_[_0xbfcf('0x38')](_0x15c6b1,[_0xbfcf('0x39'),_0x23676c[_0xbfcf('0x13')]]);if(_0x2ade0b[_0xbfcf('0x3a')]===0x0)return _0x12a82a[_0xbfcf('0x34')]=!![];if(_['some'](_0x2ade0b,[_0xbfcf('0x3b'),_0x12a82a[_0xbfcf('0x3c')]['toString']()]))return _0x12a82a[_0xbfcf('0x3d')]=!![];if(!_0x12a82a[_0xbfcf('0x3d')])return _0x12a82a[_0xbfcf('0x34')]=!![];}function getVoiceQueueAgents(_0x47dd81,_0x24e451,_0x3b269d,_0x17db17){var _0x497cf9=_[_0xbfcf('0x36')](_0x24e451,['id',_0x47dd81['id']]);if(!_0x497cf9)return _0x47dd81;return _0x497cf9[_0xbfcf('0x3e')]({'raw':!![]})['then'](function(_0xdf5215){for(var _0x288410=0x0;_0x288410<_0xdf5215[_0xbfcf('0x3a')];_0x288410++){var _0x1dd4c1=_[_0xbfcf('0x36')](_0x3b269d,['id',_0xdf5215[_0x288410]['UserId']]);if(!_0x1dd4c1){_0x1dd4c1={'id':_0xdf5215[_0x288410][_0xbfcf('0x3f')],'name':_0xdf5215[_0x288410][_0xbfcf('0x3f')],'accountcode':'','online':![]};}var _0x4fe050={'id':_0x1dd4c1['id'],'name':_0x1dd4c1[_0xbfcf('0x13')],'internal':_0x1dd4c1[_0xbfcf('0x40')],'online':Boolean(_0x1dd4c1[_0xbfcf('0x41')]),'paused':Boolean(_0xdf5215[_0x288410]['paused'])};if(_0x1dd4c1[_0xbfcf('0x42')]===_0xbfcf('0x3d'))updateAgentVoiceStatus(_0x4fe050,_0x47dd81,_0x17db17);if(_0x4fe050[_0xbfcf('0x41')])_0x47dd81[_0xbfcf('0x32')]++;if(_0x4fe050[_0xbfcf('0x34')])_0x47dd81[_0xbfcf('0x34')]++;if(_0x4fe050[_0xbfcf('0x43')]&&!_0x4fe050['busy']&&!_0x4fe050[_0xbfcf('0x3d')])_0x47dd81[_0xbfcf('0x43')]++;_0x47dd81['agents'][_0xbfcf('0x1f')](_0x4fe050);}return _0x47dd81;});}function getQueueAgents(_0x3c7758,_0x5e090e,_0x54c8af){var _0x1567d4='User'+_[_0xbfcf('0x16')](_0x54c8af)+'Queue';var _0x5c032e=_0x54c8af+_0xbfcf('0x44');return db[_0x1567d4]['findAll']({'where':{[_[_0xbfcf('0x16')](_0x54c8af)+'QueueId']:_0x3c7758['id']},'raw':!![]})[_0xbfcf('0x18')](function(_0x58cc3f){for(var _0x2664ad=0x0;_0x2664ad<_0x58cc3f['length'];_0x2664ad++){var _0x429cc7=_[_0xbfcf('0x36')](_0x5e090e,['id',_0x58cc3f[_0x2664ad][_0xbfcf('0x3f')]]);if(!_0x429cc7){_0x429cc7={'id':_0x58cc3f[_0x2664ad][_0xbfcf('0x3f')],'name':_0x58cc3f[_0x2664ad][_0xbfcf('0x3f')],'online':![],['pauseField']:![]};}var _0x571f55={'id':_0x429cc7['id'],'name':_0x429cc7[_0xbfcf('0x13')],'online':Boolean(_0x429cc7[_0xbfcf('0x41')]),'paused':Boolean(_0x429cc7[_0x5c032e])};if(_0x571f55[_0xbfcf('0x41')])_0x3c7758[_0xbfcf('0x32')]++;_0x3c7758['agents'][_0xbfcf('0x1f')](_0x571f55);}return _0x3c7758;});}function validateChannel(_0x17ffb0){var _0x23d732=utils[_0xbfcf('0x45')]();if(!_[_0xbfcf('0x46')](_0x23d732,_0x17ffb0[_0xbfcf('0x47')]()))throw new Error(_0xbfcf('0x48'));return _0x17ffb0[_0xbfcf('0x47')]();}exports[_0xbfcf('0x49')]=function(_0x4d536f,_0x53cce4){var _0x5de634={'count':0x0,'rows':[]};var _0x444b3f={};var _0x48fa3b;var _0x3f7a80;var _0x10e426;var _0x83f99a;var _0x21c7b9=utils[_0xbfcf('0x45')]();var _0xc2c9b=_0x4d536f['query']['globalQueueFilter'];var _0xc6f96d=_0x4d536f[_0xbfcf('0x4a')][_0xbfcf('0x4b')];var _0x9bb00a=_0x4d536f['query'][_0xbfcf('0x4c')];var _0x3019e9=_0xc6f96d===_0xbfcf('0x4d')||_0xc6f96d===_0xbfcf('0x4e')?!![]:![];var _0x50bb98=[];var _0x24e2ab;Promise[_0xbfcf('0x4f')]()[_0xbfcf('0x18')](function(){if(_0x4d536f[_0xbfcf('0x4a')][_0xbfcf('0x50')]){_0x48fa3b=validateChannel(_0x4d536f['query'][_0xbfcf('0x50')]);}if(!_0x4d536f[_0xbfcf('0x4a')][_0xbfcf('0x51')]||!_0x4d536f[_0xbfcf('0x4a')][_0xbfcf('0x51')][_0xbfcf('0x46')](_0xbfcf('0x52'))){_0x4d536f[_0xbfcf('0x4a')][_0xbfcf('0x51')]=rta[_0xbfcf('0x53')](_0x4d536f[_0xbfcf('0x4a')]['sort']);return;}var _0x18bcb2=rta[_0xbfcf('0x54')](_0x4d536f['query'][_0xbfcf('0x51')]);_0x4d536f['query']['sort']=_0x18bcb2[_0xbfcf('0x55')][_0xbfcf('0x56')](',');_0x3f7a80=_0x18bcb2['order'];})['then'](function(){if(!_0xc2c9b){return[];}return rta[_0xbfcf('0x57')](_0xc2c9b,_0x48fa3b);})[_0xbfcf('0x18')](function(_0x4a44cd){_0x50bb98=_0x4a44cd;return rta[_0xbfcf('0x58')]();})[_0xbfcf('0x18')](function(_0x55533b){_0x83f99a=_0x55533b[_0xbfcf('0x59')];if((!_0xc6f96d||_0x3019e9)&&!_0x3f7a80){return _0x50bb98;}if(_0x3f7a80&&!_0xc6f96d){return rta[_0xbfcf('0x5a')](_0x83f99a,_0x50bb98,_0x3f7a80);}else{return rta[_0xbfcf('0x5b')](_0x83f99a,_0x50bb98,_0xc6f96d);}})['then'](function(_0x2e3089){_0x50bb98=_0x2e3089;var _0x11c0a2=![];if(_0x50bb98[_0xbfcf('0x3a')]===0x0){if(_0xc2c9b||_0xc6f96d){_0x11c0a2=!![];}if(_0x3019e9){_0x11c0a2=![];}}if(_0x11c0a2){return _0x5de634;}var _0x5b6b91=_['map'](db['User'][_0xbfcf('0x5c')],function(_0xbd6559){return{'name':_0xbd6559[_0xbfcf('0x5d')],'type':_0xbd6559['type'][_0xbfcf('0x5e')]};});_0x4d536f['query']['role']=_0xbfcf('0x5f');_0x4d536f[_0xbfcf('0x4a')][_0xbfcf('0x41')]=!![];_0x444b3f=qs[_0xbfcf('0x60')](_0x5b6b91,_0x4d536f);_0x444b3f['raw']=!![];var _0x91da04=[];if(_0x50bb98[_0xbfcf('0x3a')]>0x0){_0x91da04[_0xbfcf('0x1f')]({'id':{'$in':_0x50bb98}});if(_0x3f7a80&&!_0xc6f96d){_0x24e2ab=[db['sequelize'][_0xbfcf('0x61')](_0xbfcf('0x62')+_0x50bb98+')')];_0x444b3f[_0xbfcf('0x63')]=_0x24e2ab;}}if(_0x3019e9){_0x21c7b9['forEach'](function(_0x28f295){var _0x21cbb8=!![];if(_0xc6f96d===_0xbfcf('0x4e')&&_0x48fa3b!==_0x28f295){_0x21cbb8=![];}_0x91da04[_0xbfcf('0x1f')]({[_0x28f295+'Pause']:_0x21cbb8});});if(_0x9bb00a){_0x91da04[_0xbfcf('0x1f')]({'pauseType':_0x9bb00a});}}else if(_0xc6f96d){_0x21c7b9[_0xbfcf('0x64')](function(_0x5e7c21){_0x91da04[_0xbfcf('0x1f')]({[_0x5e7c21+_0xbfcf('0x44')]:![]});});}_0x444b3f['where']=_['merge'](_0x444b3f['where'],{'$and':_0x91da04});if(_0x4d536f[_0xbfcf('0x65')][_0xbfcf('0x66')]===_0xbfcf('0x65')){var _0x3e7368={'params':{'id':_0x4d536f[_0xbfcf('0x65')][_0xbfcf('0x67')]},'query':{'section':'Agents','role':_0xbfcf('0x5f'),'online':!![],'raw':!![],'ids':_0x50bb98,'customSorting':_0x24e2ab}};if(_0x3019e9){_0x3e7368[_0xbfcf('0x4a')]['extraQueryConditions']=_0x91da04;}_0x3e7368[_0xbfcf('0x4a')]=Object[_0xbfcf('0x68')](_0x3e7368[_0xbfcf('0x4a')],_0x4d536f['query']);delete _0x3e7368[_0xbfcf('0x4a')]['id'];return db['UserProfile'][_0xbfcf('0x69')](_0x3e7368);}return db[_0xbfcf('0x6a')][_0xbfcf('0x6b')](_0x444b3f);})[_0xbfcf('0x18')](function(_0x5e123c){_0x5de634[_0xbfcf('0xc')]=_0x5e123c[_0xbfcf('0xc')];_0x10e426=_0x5e123c['rows'];return _0x10e426['map'](function(_0x42a82a){var _0x4f66e3=_[_0xbfcf('0x36')](_0x83f99a,['id',_0x42a82a['id']]);if(_0x4f66e3){var _0x3e3bd6=rta[_0xbfcf('0x6c')](_0x4f66e3);_[_0xbfcf('0x37')](_0x42a82a,_0x3e3bd6);}_0x42a82a[_0xbfcf('0x52')]=rta[_0xbfcf('0x6d')](_0x42a82a);if(_0x42a82a[_0xbfcf('0x52')][_0xbfcf('0x46')]('pause')){_0x21c7b9[_0xbfcf('0x64')](function(_0x14be2d){if(_0x42a82a[_0x14be2d+_0xbfcf('0x44')]){_0x42a82a[_0x14be2d+_0xbfcf('0x6e')]=_0xbfcf('0x4d');}});}return _0x42a82a;});})['then'](function(_0x3395c8){if(!_0x3f7a80||_0x24e2ab){return _0x3395c8;}return rta[_0xbfcf('0x6f')](_0x3395c8,_0x3f7a80);})[_0xbfcf('0x18')](function(_0xa099c5){_0x5de634[_0xbfcf('0x59')]=_0xa099c5;return _0x5de634;})[_0xbfcf('0x18')](respondWithFilteredResult(_0x53cce4,_0x444b3f))['catch'](handleError(_0x53cce4,null));};exports['getQueues']=function(_0x3c843a,_0x47ebf3){var _0x3df4f3={'count':0x0,'rows':[]},_0xf3a7a6={},_0x2d1175,_0x19a347,_0x3ab3f9,_0x4f661e,_0x170d3b;Promise['resolve']()[_0xbfcf('0x18')](function(){if(_0x3c843a['query'][_0xbfcf('0x50')])_0x2d1175=validateChannel(_0x3c843a[_0xbfcf('0x4a')][_0xbfcf('0x50')]);var _0x48164e=_[_0xbfcf('0x16')](_0x2d1175)+_0xbfcf('0x70');var _0x5c4d77=_[_0xbfcf('0x71')](db[_0x48164e][_0xbfcf('0x5c')],function(_0x5b28e1){return{'name':_0x5b28e1[_0xbfcf('0x5d')],'type':_0x5b28e1[_0xbfcf('0x72')][_0xbfcf('0x5e')]};});_0xf3a7a6=qs['getOptions'](_0x5c4d77,_0x3c843a);if(_0x3c843a['user'][_0xbfcf('0x66')]===_0xbfcf('0x65')){var _0xe9a79a={'params':{'id':_0x3c843a[_0xbfcf('0x65')][_0xbfcf('0x67')]},'query':{'section':_0x2d1175===_0xbfcf('0x15')&&_0x3c843a[_0xbfcf('0x4a')][_0xbfcf('0x72')]===_0xbfcf('0x35')?_0xbfcf('0x73'):_[_0xbfcf('0x16')](_0x2d1175)+_0xbfcf('0x17'),'type':_0x3c843a[_0xbfcf('0x4a')][_0xbfcf('0x72')],'nolimit':!![],'sort':_0xbfcf('0x13'),'filter':_0x3c843a[_0xbfcf('0x4a')][_0xbfcf('0x38')]}};return db[_0xbfcf('0x74')]['getResources'](_0xe9a79a);}return db[_0x48164e][_0xbfcf('0x6b')](_0xf3a7a6);})[_0xbfcf('0x18')](function(_0x34015c){_0x3df4f3[_0xbfcf('0xc')]=_0x34015c['count'];_0x19a347=_0x34015c[_0xbfcf('0x59')];return getRealtimeQueues(_0x3c843a,_0x2d1175);})['then'](function(_0x358346){_0x4f661e=_0x358346[_0xbfcf('0x59')];return rta['getRealtimeAgents']();})['then'](function(_0x2d96e9){_0x3ab3f9=_0x2d96e9['rows'];if(_0x2d1175!=_0xbfcf('0x15'))return;return getRealtimeVoiceQueueChannels();})[_0xbfcf('0x18')](function(_0x49f7d4){_0x170d3b=_0x49f7d4?_0x49f7d4[_0xbfcf('0x59')]:[];return initializeQueues(_0x19a347,_0x4f661e,_0x2d1175,_0x3c843a['query']['type']);})[_0xbfcf('0x18')](function(_0x3fd6df){var _0x41378b=_0x3fd6df[_0xbfcf('0x71')](function(_0x1f2ba6){if(_0x2d1175===_0xbfcf('0x15'))return getVoiceQueueAgents(_0x1f2ba6,_0x19a347,_0x3ab3f9,_0x170d3b);else return getQueueAgents(_0x1f2ba6,_0x3ab3f9,_0x2d1175);});return Promise[_0xbfcf('0x75')](_0x41378b);})[_0xbfcf('0x18')](function(_0x5ccb9e){_0x3df4f3['rows']=_0x5ccb9e;return _0x3df4f3;})[_0xbfcf('0x18')](respondWithFilteredResult(_0x47ebf3,_0xf3a7a6))[_0xbfcf('0x1b')](handleError(_0x47ebf3,null));}; \ No newline at end of file +var _0x8af3=['Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','catch','paused','originated','message','dialActive','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','loggedInDb','loggedIn','available','waiting','busy','outbound','find','merge','pick','filter','queue','some','internal','toString','talking','getMembers','length','UserId','accountcode','voiceStatus','online','push','Queue','Pause','findAll','includes','toLowerCase','Invalid\x20channel','getAgents','getChannels','query','globalStatusFilter','pause','*pause','resolve','channel','sort','join','order','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','User','rawAttributes','fieldName','role','getOptions','literal','FIELD(id,','forEach','where','user','Agents','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','globalStatus','Status','sortAgentsByStatus','getQueues','type','userProfileId','QueueCampaigns','util','lodash','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','client','http','offset','undefined','count','limit','status','set','Content-Range','json','error','stack','name','voice','request','startCase','Queues','then','format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8af3,0x140));var _0x38af=function(_0x560f7b,_0x53c477){_0x560f7b=_0x560f7b-0x0;var _0x35910f=_0x8af3[_0x560f7b];return _0x35910f;};'use strict';var util=require(_0x38af('0x0'));var _=require(_0x38af('0x1'));var jayson=require('jayson/promise');var rta=require(_0x38af('0x2'));var qs=require(_0x38af('0x3'));var utils=require(_0x38af('0x4'));var logger=require(_0x38af('0x5'))('api');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x38af('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0x38af('0x6')][_0x38af('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x37702d,_0x12eb4d){return function(_0x2d0473){if(_0x2d0473){var _0x4ad48d=typeof _0x12eb4d[_0x38af('0x8')]===_0x38af('0x9')&&typeof _0x12eb4d['limit']===_0x38af('0x9');var _0x34e880=_0x2d0473[_0x38af('0xa')];var _0x3dacb1=_0x4ad48d?0x0:_0x12eb4d[_0x38af('0x8')];var _0x5ce610=_0x4ad48d?_0x2d0473[_0x38af('0xa')]:_0x12eb4d[_0x38af('0x8')]+_0x12eb4d[_0x38af('0xb')];var _0x4ac327;if(_0x5ce610>=_0x34e880){_0x5ce610=_0x34e880;_0x4ac327=0xc8;}else{_0x4ac327=0xce;}_0x37702d[_0x38af('0xc')](_0x4ac327);return _0x37702d[_0x38af('0xd')](_0x38af('0xe'),_0x3dacb1+'-'+_0x5ce610+'/'+_0x34e880)[_0x38af('0xf')](_0x2d0473);}return null;};}function handleError(_0x4c4a13,_0x2c7e8b){_0x2c7e8b=_0x2c7e8b||0x1f4;return function(_0x5d7eab){logger[_0x38af('0x10')](_0x5d7eab[_0x38af('0x11')]);if(_0x5d7eab['name']){delete _0x5d7eab[_0x38af('0x12')];}_0x4c4a13[_0x38af('0xc')](_0x2c7e8b)['send'](_0x5d7eab);};}function getRealtimeQueues(_0x9734da,_0x2a1538){return new Promise(function(_0x34a986,_0x5cbc73){var _0x3e9e1c=_0x2a1538===_0x38af('0x13')?amiClient:routingClient;return _0x3e9e1c[_0x38af('0x14')](_[_0x38af('0x15')](_0x2a1538)+_0x38af('0x16'),_0x9734da)[_0x38af('0x17')](function(_0x3e7155){if(_0x3e7155[_0x38af('0x10')])throw new Error(util[_0x38af('0x18')](_0x38af('0x19'),_0x2a1538));return _0x34a986(_0x3e7155[_0x38af('0x1a')]);})['catch'](function(_0x567ea6){_0x5cbc73(_0x567ea6);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3e0aff,_0x5c3bd0){return amiClient[_0x38af('0x14')]('VoiceQueuesChannels',{})[_0x38af('0x17')](function(_0x1297eb){if(_0x1297eb[_0x38af('0x10')])throw new Error(_0x38af('0x1b'));return _0x3e0aff(_0x1297eb[_0x38af('0x1a')]);})[_0x38af('0x1c')](function(_0x70ce43){_0x5c3bd0(_0x70ce43);});});}function initializeQueues(_0x325629,_0x4d3a95,_0x53618a,_0x1ef08b){var _0x3ab7e0=['loggedIn','available','waiting','talking',_0x38af('0x1d')];if(_0x53618a===_0x38af('0x13')&&_0x1ef08b==='outbound'){_0x3ab7e0['push']('pTalking',_0x38af('0x1e'),_0x38af('0x1f'),_0x38af('0x20'),'dialMethod',_0x38af('0x21'),_0x38af('0x22'),'startProgressive',_0x38af('0x23'),_0x38af('0x24'),_0x38af('0x25'),_0x38af('0x26'),_0x38af('0x27'),_0x38af('0x28'),'dialPredictiveIntervalMinThreshold',_0x38af('0x29'),_0x38af('0x2a'),'predictiveIntervalAnsweredCalls',_0x38af('0x2b'),_0x38af('0x2c'),'predictiveIntervalAvgHoldtime',_0x38af('0x2d'));}return _0x325629[_0x38af('0x2e')](function(_0x361f0a){var _0x51bb20=_0x361f0a['get']({'plain':!![]});_0x51bb20[_0x38af('0x2f')]=[];_0x51bb20[_0x38af('0x1d')]=0x0;_0x51bb20[_0x38af('0x30')]=0x0;_0x51bb20[_0x38af('0x31')]=0x0;_0x51bb20[_0x38af('0x32')]=0x0;_0x51bb20[_0x38af('0x33')]=0x0;if(_0x53618a==='voice'){_0x51bb20['talking']=0x0;_0x51bb20[_0x38af('0x34')]=0x0;if(_0x1ef08b===_0x38af('0x35')){_0x51bb20['pTalking']=0x0;_0x51bb20[_0x38af('0x1e')]=0x0;}}var _0x5c3470=_[_0x38af('0x36')](_0x4d3a95,['id',_0x51bb20['id']]);if(_0x5c3470)_[_0x38af('0x37')](_0x51bb20,_[_0x38af('0x38')](_0x5c3470,_0x3ab7e0));return _0x51bb20;});}function updateAgentVoiceStatus(_0x2b1450,_0x113a03,_0x57a710){var _0x479fc6=_[_0x38af('0x39')](_0x57a710,[_0x38af('0x3a'),_0x113a03[_0x38af('0x12')]]);if(_0x479fc6['length']===0x0)return _0x2b1450['busy']=!![];if(_[_0x38af('0x3b')](_0x479fc6,['connectedlinenum',_0x2b1450[_0x38af('0x3c')][_0x38af('0x3d')]()]))return _0x2b1450[_0x38af('0x3e')]=!![];if(!_0x2b1450[_0x38af('0x3e')])return _0x2b1450['busy']=!![];}function getVoiceQueueAgents(_0x24ec7a,_0x181b7b,_0x139137,_0x1dffca){var _0x19d26a=_[_0x38af('0x36')](_0x181b7b,['id',_0x24ec7a['id']]);if(!_0x19d26a)return _0x24ec7a;return _0x19d26a[_0x38af('0x3f')]({'raw':!![]})[_0x38af('0x17')](function(_0x36c287){for(var _0x4cd624=0x0;_0x4cd624<_0x36c287[_0x38af('0x40')];_0x4cd624++){var _0x114ae2=_[_0x38af('0x36')](_0x139137,['id',_0x36c287[_0x4cd624]['UserId']]);if(!_0x114ae2){_0x114ae2={'id':_0x36c287[_0x4cd624][_0x38af('0x41')],'name':_0x36c287[_0x4cd624][_0x38af('0x41')],'accountcode':'','online':![]};}var _0x44a771={'id':_0x114ae2['id'],'name':_0x114ae2[_0x38af('0x12')],'internal':_0x114ae2[_0x38af('0x42')],'online':Boolean(_0x114ae2['online']),'paused':Boolean(_0x36c287[_0x4cd624][_0x38af('0x1d')])};if(_0x114ae2[_0x38af('0x43')]===_0x38af('0x3e'))updateAgentVoiceStatus(_0x44a771,_0x24ec7a,_0x1dffca);if(_0x44a771[_0x38af('0x44')])_0x24ec7a[_0x38af('0x30')]++;if(_0x44a771['busy'])_0x24ec7a[_0x38af('0x34')]++;if(_0x44a771[_0x38af('0x1d')]&&!_0x44a771[_0x38af('0x34')]&&!_0x44a771[_0x38af('0x3e')])_0x24ec7a['paused']++;_0x24ec7a[_0x38af('0x2f')][_0x38af('0x45')](_0x44a771);}return _0x24ec7a;});}function getQueueAgents(_0x10d440,_0x26a0d1,_0x359a46){var _0x57e72b='User'+_[_0x38af('0x15')](_0x359a46)+_0x38af('0x46');var _0x5a03be=_0x359a46+_0x38af('0x47');return db[_0x57e72b][_0x38af('0x48')]({'where':{[_['startCase'](_0x359a46)+'QueueId']:_0x10d440['id']},'raw':!![]})[_0x38af('0x17')](function(_0x32f56d){for(var _0x529286=0x0;_0x529286<_0x32f56d[_0x38af('0x40')];_0x529286++){var _0x26a2e9=_[_0x38af('0x36')](_0x26a0d1,['id',_0x32f56d[_0x529286]['UserId']]);if(!_0x26a2e9){_0x26a2e9={'id':_0x32f56d[_0x529286]['UserId'],'name':_0x32f56d[_0x529286]['UserId'],'online':![],['pauseField']:![]};}var _0x14616c={'id':_0x26a2e9['id'],'name':_0x26a2e9[_0x38af('0x12')],'online':Boolean(_0x26a2e9[_0x38af('0x44')]),'paused':Boolean(_0x26a2e9[_0x5a03be])};if(_0x14616c[_0x38af('0x44')])_0x10d440['loggedInDb']++;_0x10d440[_0x38af('0x2f')][_0x38af('0x45')](_0x14616c);}return _0x10d440;});}function validateChannel(_0x2c47f3){var _0x31784f=utils['getChannels']();if(!_[_0x38af('0x49')](_0x31784f,_0x2c47f3[_0x38af('0x4a')]()))throw new Error(_0x38af('0x4b'));return _0x2c47f3[_0x38af('0x4a')]();}exports[_0x38af('0x4c')]=function(_0x5d4b99,_0x4e086f){var _0x3e7766={'count':0x0,'rows':[]};var _0x2feb5e={};var _0x5f0e26;var _0x24d7e4;var _0xa7454c;var _0x3d9f23;var _0x5935a1=utils[_0x38af('0x4d')]();var _0x1bd8ad=_0x5d4b99[_0x38af('0x4e')]['globalQueueFilter'];var _0x5146b5=_0x5d4b99[_0x38af('0x4e')][_0x38af('0x4f')];var _0x24b62e=_0x5d4b99[_0x38af('0x4e')]['pauseTypeFilter'];var _0x1a42f9=_0x5146b5===_0x38af('0x50')||_0x5146b5===_0x38af('0x51')?!![]:![];var _0x20d5e2=[];var _0x5475e6;Promise[_0x38af('0x52')]()[_0x38af('0x17')](function(){if(_0x5d4b99['query'][_0x38af('0x53')]){_0x5f0e26=validateChannel(_0x5d4b99[_0x38af('0x4e')]['channel']);}if(!_0x5d4b99[_0x38af('0x4e')][_0x38af('0x54')]||!_0x5d4b99[_0x38af('0x4e')][_0x38af('0x54')][_0x38af('0x49')]('globalStatus')){_0x5d4b99[_0x38af('0x4e')]['sort']=rta['validateSortParameter'](_0x5d4b99[_0x38af('0x4e')][_0x38af('0x54')]);return;}var _0x523c14=rta['getUpdatedSortOptions'](_0x5d4b99[_0x38af('0x4e')]['sort']);_0x5d4b99[_0x38af('0x4e')][_0x38af('0x54')]=_0x523c14['fields'][_0x38af('0x55')](',');_0x24d7e4=_0x523c14[_0x38af('0x56')];})[_0x38af('0x17')](function(){if(!_0x1bd8ad){return[];}return rta['getAgentIdsByQueues'](_0x1bd8ad,_0x5f0e26);})[_0x38af('0x17')](function(_0x271d90){_0x20d5e2=_0x271d90;return rta[_0x38af('0x57')]();})[_0x38af('0x17')](function(_0x34ce43){_0x3d9f23=_0x34ce43[_0x38af('0x58')];if((!_0x5146b5||_0x1a42f9)&&!_0x24d7e4){return _0x20d5e2;}if(_0x24d7e4&&!_0x5146b5){return rta[_0x38af('0x59')](_0x3d9f23,_0x20d5e2,_0x24d7e4);}else{return rta[_0x38af('0x5a')](_0x3d9f23,_0x20d5e2,_0x5146b5);}})[_0x38af('0x17')](function(_0x3e26e7){_0x20d5e2=_0x3e26e7;var _0x574900=![];if(_0x20d5e2[_0x38af('0x40')]===0x0){if(_0x1bd8ad||_0x5146b5){_0x574900=!![];}if(_0x1a42f9){_0x574900=![];}}if(_0x574900){return _0x3e7766;}var _0x5c1828=_[_0x38af('0x2e')](db[_0x38af('0x5b')][_0x38af('0x5c')],function(_0x576f5f){return{'name':_0x576f5f[_0x38af('0x5d')],'type':_0x576f5f['type']['key']};});_0x5d4b99[_0x38af('0x4e')][_0x38af('0x5e')]='agent';_0x5d4b99[_0x38af('0x4e')][_0x38af('0x44')]=!![];_0x2feb5e=qs[_0x38af('0x5f')](_0x5c1828,_0x5d4b99);_0x2feb5e['raw']=!![];var _0x3ccddc=[];if(_0x20d5e2['length']>0x0){_0x3ccddc[_0x38af('0x45')]({'id':{'$in':_0x20d5e2}});if(_0x24d7e4&&!_0x5146b5){_0x5475e6=[db['sequelize'][_0x38af('0x60')](_0x38af('0x61')+_0x20d5e2+')')];_0x2feb5e[_0x38af('0x56')]=_0x5475e6;}}if(_0x1a42f9){_0x5935a1['forEach'](function(_0x566c2a){var _0x51f95b=!![];if(_0x5146b5===_0x38af('0x51')&&_0x5f0e26!==_0x566c2a){_0x51f95b=![];}_0x3ccddc[_0x38af('0x45')]({[_0x566c2a+_0x38af('0x47')]:_0x51f95b});});if(_0x24b62e){_0x3ccddc[_0x38af('0x45')]({'pauseType':_0x24b62e});}}else if(_0x5146b5){_0x5935a1[_0x38af('0x62')](function(_0x5a414b){_0x3ccddc[_0x38af('0x45')]({[_0x5a414b+_0x38af('0x47')]:![]});});}_0x2feb5e['where']=_['merge'](_0x2feb5e[_0x38af('0x63')],{'$and':_0x3ccddc});if(_0x5d4b99['user'][_0x38af('0x5e')]===_0x38af('0x64')){var _0x1e8d89={'params':{'id':_0x5d4b99[_0x38af('0x64')]['userProfileId']},'query':{'section':_0x38af('0x65'),'role':'agent','online':!![],'raw':!![],'ids':_0x20d5e2,'customSorting':_0x5475e6}};if(_0x1a42f9){_0x1e8d89[_0x38af('0x4e')]['extraQueryConditions']=_0x3ccddc;}_0x1e8d89['query']=Object[_0x38af('0x66')](_0x1e8d89[_0x38af('0x4e')],_0x5d4b99[_0x38af('0x4e')]);delete _0x1e8d89[_0x38af('0x4e')]['id'];return db[_0x38af('0x67')][_0x38af('0x68')](_0x1e8d89);}return db['User'][_0x38af('0x69')](_0x2feb5e);})[_0x38af('0x17')](function(_0x19e6f3){_0x3e7766['count']=_0x19e6f3[_0x38af('0xa')];_0xa7454c=_0x19e6f3[_0x38af('0x58')];return _0xa7454c[_0x38af('0x2e')](function(_0x8e28d7){var _0x5b5549=_[_0x38af('0x36')](_0x3d9f23,['id',_0x8e28d7['id']]);if(_0x5b5549){var _0x20b558=rta[_0x38af('0x6a')](_0x5b5549);_[_0x38af('0x37')](_0x8e28d7,_0x20b558);}_0x8e28d7['globalStatus']=rta[_0x38af('0x6b')](_0x8e28d7);if(_0x8e28d7[_0x38af('0x6c')][_0x38af('0x49')]('pause')){_0x5935a1[_0x38af('0x62')](function(_0x560859){if(_0x8e28d7[_0x560859+'Pause']){_0x8e28d7[_0x560859+_0x38af('0x6d')]=_0x38af('0x50');}});}return _0x8e28d7;});})[_0x38af('0x17')](function(_0x503424){if(!_0x24d7e4||_0x5475e6){return _0x503424;}return rta[_0x38af('0x6e')](_0x503424,_0x24d7e4);})[_0x38af('0x17')](function(_0x4e335b){_0x3e7766[_0x38af('0x58')]=_0x4e335b;return _0x3e7766;})[_0x38af('0x17')](respondWithFilteredResult(_0x4e086f,_0x2feb5e))[_0x38af('0x1c')](handleError(_0x4e086f,null));};exports[_0x38af('0x6f')]=function(_0x30eb45,_0x58a248){var _0x3e9e8b={'count':0x0,'rows':[]},_0x3f7a69={},_0x273fcc,_0x284801,_0x240083,_0x249589,_0x55416d;Promise[_0x38af('0x52')]()[_0x38af('0x17')](function(){if(_0x30eb45[_0x38af('0x4e')][_0x38af('0x53')])_0x273fcc=validateChannel(_0x30eb45['query'][_0x38af('0x53')]);var _0x349974=_[_0x38af('0x15')](_0x273fcc)+_0x38af('0x46');var _0x3ebec0=_[_0x38af('0x2e')](db[_0x349974][_0x38af('0x5c')],function(_0x962791){return{'name':_0x962791[_0x38af('0x5d')],'type':_0x962791[_0x38af('0x70')]['key']};});_0x3f7a69=qs[_0x38af('0x5f')](_0x3ebec0,_0x30eb45);if(_0x30eb45[_0x38af('0x64')][_0x38af('0x5e')]==='user'){var _0x4fbd24={'params':{'id':_0x30eb45[_0x38af('0x64')][_0x38af('0x71')]},'query':{'section':_0x273fcc===_0x38af('0x13')&&_0x30eb45['query']['type']==='outbound'?_0x38af('0x72'):_[_0x38af('0x15')](_0x273fcc)+_0x38af('0x16'),'type':_0x30eb45['query'][_0x38af('0x70')],'nolimit':!![],'sort':_0x38af('0x12'),'filter':_0x30eb45[_0x38af('0x4e')][_0x38af('0x39')]}};return db[_0x38af('0x67')][_0x38af('0x68')](_0x4fbd24);}return db[_0x349974][_0x38af('0x69')](_0x3f7a69);})[_0x38af('0x17')](function(_0x2f1145){_0x3e9e8b[_0x38af('0xa')]=_0x2f1145[_0x38af('0xa')];_0x284801=_0x2f1145['rows'];return getRealtimeQueues(_0x30eb45,_0x273fcc);})[_0x38af('0x17')](function(_0x468cfe){_0x249589=_0x468cfe[_0x38af('0x58')];return rta[_0x38af('0x57')]();})[_0x38af('0x17')](function(_0x2fef14){_0x240083=_0x2fef14[_0x38af('0x58')];if(_0x273fcc!=_0x38af('0x13'))return;return getRealtimeVoiceQueueChannels();})[_0x38af('0x17')](function(_0x448cda){_0x55416d=_0x448cda?_0x448cda[_0x38af('0x58')]:[];return initializeQueues(_0x284801,_0x249589,_0x273fcc,_0x30eb45['query'][_0x38af('0x70')]);})[_0x38af('0x17')](function(_0x1ef814){var _0x4d491f=_0x1ef814[_0x38af('0x2e')](function(_0x5b995d){if(_0x273fcc===_0x38af('0x13'))return getVoiceQueueAgents(_0x5b995d,_0x284801,_0x240083,_0x55416d);else return getQueueAgents(_0x5b995d,_0x240083,_0x273fcc);});return Promise['all'](_0x4d491f);})[_0x38af('0x17')](function(_0x1bdb6b){_0x3e9e8b['rows']=_0x1bdb6b;return _0x3e9e8b;})['then'](respondWithFilteredResult(_0x58a248,_0x3f7a69))[_0x38af('0x1c')](handleError(_0x58a248,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 852b54a..58d1178 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(_0x3b1de6,_0x251184){var _0x350ded=function(_0x364273){while(--_0x364273){_0x3b1de6['push'](_0x3b1de6['shift']());}};_0x350ded(++_0x251184);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xcb91[_0x38c652];return _0x218a37;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x21cc3f,_0x4ac3e5){var _0x1a311c=function(_0x23a048){while(--_0x23a048){_0x21cc3f['push'](_0x21cc3f['shift']());}};_0x1a311c(++_0x4ac3e5);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index be3cd40..14082c2 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 _0x565f=['exports','INTEGER','STRING','DATE'];(function(_0xce9195,_0x1963e1){var _0x530fe6=function(_0x1b8055){while(--_0x1b8055){_0xce9195['push'](_0xce9195['shift']());}};_0x530fe6(++_0x1963e1);}(_0x565f,0x68));var _0xf565=function(_0x3aabb9,_0x5e984f){_0x3aabb9=_0x3aabb9-0x0;var _0x3a2501=_0x565f[_0x3aabb9];return _0x3a2501;};'use strict';var Sequelize=require('sequelize');module[_0xf565('0x0')]={'state':{'type':Sequelize[_0xf565('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf565('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xf565('0x2')]},'starttime':{'type':Sequelize[_0xf565('0x3')]},'responsetime':{'type':Sequelize[_0xf565('0x3')]},'ringtime':{'type':Sequelize[_0xf565('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf565('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd1f9=['DATE','INTEGER','STRING'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0xd1f9,0x88));var _0x9d1f=function(_0x7aaac8,_0x3a4233){_0x7aaac8=_0x7aaac8-0x0;var _0x4a8013=_0xd1f9[_0x7aaac8];return _0x4a8013;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x9d1f('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x9d1f('0x1')]},'scheduledat':{'type':Sequelize[_0x9d1f('0x2')]},'uniqueid':{'type':Sequelize[_0x9d1f('0x1')]},'starttime':{'type':Sequelize[_0x9d1f('0x2')]},'responsetime':{'type':Sequelize[_0x9d1f('0x2')]},'ringtime':{'type':Sequelize[_0x9d1f('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9d1f('0x1')]},'campaigntype':{'type':Sequelize[_0x9d1f('0x1')]},'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 c4d46f8..5b7edd4 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 _0xf8c6=['exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x4b6c6e,_0x3e1796){var _0x413ab0=function(_0x5a46ba){while(--_0x5a46ba){_0x4b6c6e['push'](_0x4b6c6e['shift']());}};_0x413ab0(++_0x3e1796);}(_0xf8c6,0xa3));var _0x6f8c=function(_0x2e191a,_0x3f6a04){_0x2e191a=_0x2e191a-0x0;var _0x3b0e20=_0xf8c6[_0x2e191a];return _0x3b0e20;};'use strict';var _=require(_0x6f8c('0x0'));var util=require(_0x6f8c('0x1'));var logger=require(_0x6f8c('0x2'))('api');var moment=require(_0x6f8c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f8c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f8c('0x5'));var config=require(_0x6f8c('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0x6f8c('0x7')]=function(_0xa2002d,_0x49b94d){return _0xa2002d['define'](_0x6f8c('0x8'),attributes,{'tableName':_0x6f8c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x304e=['report_agent_preview','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1c0108,_0xc325c5){var _0x5b1498=function(_0x48371e){while(--_0x48371e){_0x1c0108['push'](_0x1c0108['shift']());}};_0x5b1498(++_0xc325c5);}(_0x304e,0x177));var _0xe304=function(_0xeeb4d1,_0x511591){_0xeeb4d1=_0xeeb4d1-0x0;var _0x8f0b7e=_0x304e[_0xeeb4d1];return _0x8f0b7e;};'use strict';var _=require(_0xe304('0x0'));var util=require(_0xe304('0x1'));var logger=require('../../config/logger')(_0xe304('0x2'));var moment=require(_0xe304('0x3'));var BPromise=require(_0xe304('0x4'));var rp=require(_0xe304('0x5'));var fs=require('fs');var path=require(_0xe304('0x6'));var rimraf=require(_0xe304('0x7'));var config=require(_0xe304('0x8'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x3a96b1,_0x590a96){return _0x3a96b1[_0xe304('0x9')]('ReportAgentPreview',attributes,{'tableName':_0xe304('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index a16b657..cbe18d1 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 _0x0531=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x352a93,_0x388566){var _0x1987d1=function(_0x1e4c93){while(--_0x1e4c93){_0x352a93['push'](_0x352a93['shift']());}};_0x1987d1(++_0x388566);}(_0x0531,0xea));var _0x1053=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0x0531[_0x28e74e];return _0xb45ac1;};'use strict';var _=require('lodash');var util=require(_0x1053('0x0'));var moment=require(_0x1053('0x1'));var BPromise=require(_0x1053('0x2'));var rs=require(_0x1053('0x3'));var fs=require('fs');var Redis=require(_0x1053('0x4'));var db=require(_0x1053('0x5'))['db'];var utils=require(_0x1053('0x6'));var logger=require(_0x1053('0x7'))(_0x1053('0x8'));var config=require(_0x1053('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1053('0xa')][_0x1053('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d0a78,_0x51c261,_0x308800){return new BPromise(function(_0x108d2e,_0x2ec94b){return client[_0x1053('0xc')](_0x2d0a78,_0x308800)[_0x1053('0xd')](function(_0x48752d){logger[_0x1053('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x51c261,_0x1053('0xf'));logger[_0x1053('0x10')](_0x1053('0x11'),_0x51c261,_0x1053('0xf'),JSON[_0x1053('0x12')](_0x48752d));if(_0x48752d['error']){if(_0x48752d[_0x1053('0x13')][_0x1053('0x14')]===0x1f4){logger['error'](_0x1053('0x15'),_0x51c261,_0x48752d[_0x1053('0x13')][_0x1053('0x16')]);return _0x2ec94b(_0x48752d[_0x1053('0x13')][_0x1053('0x16')]);}logger[_0x1053('0x13')](_0x1053('0x15'),_0x51c261,_0x48752d[_0x1053('0x13')][_0x1053('0x16')]);return _0x108d2e(_0x48752d[_0x1053('0x13')][_0x1053('0x16')]);}else{logger[_0x1053('0xe')](_0x1053('0x15'),_0x51c261,_0x1053('0xf'));_0x108d2e(_0x48752d[_0x1053('0x17')][_0x1053('0x16')]);}})['catch'](function(_0x15ebe1){logger[_0x1053('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x51c261,_0x15ebe1);_0x2ec94b(_0x15ebe1);});});}exports[_0x1053('0x18')]=function(_0xbd20f0){var _0x1475af=this;return new Promise(function(_0x46a59,_0x9805bd){return db['ReportAgentPreview'][_0x1053('0x19')](_0xbd20f0[_0x1053('0x1a')],{'raw':_0xbd20f0[_0x1053('0x1b')]?_0xbd20f0[_0x1053('0x1b')][_0x1053('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x55b4c1){logger['info'](_0x1053('0x18'),_0xbd20f0);logger[_0x1053('0x10')](_0x1053('0x18'),_0xbd20f0,JSON[_0x1053('0x12')](_0x55b4c1));_0x46a59(_0x55b4c1);})[_0x1053('0x1d')](function(_0x2e0231){logger[_0x1053('0x13')](_0x1053('0x18'),_0x2e0231[_0x1053('0x16')],_0xbd20f0);_0x9805bd(_0x1475af[_0x1053('0x13')](0x1f4,_0x2e0231[_0x1053('0x16')]));});});}; \ No newline at end of file +var _0x0dbe=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x40f571,_0x4810b0){var _0x33b499=function(_0x8c7044){while(--_0x8c7044){_0x40f571['push'](_0x40f571['shift']());}};_0x33b499(++_0x4810b0);}(_0x0dbe,0x138));var _0xe0db=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x0dbe[_0x133277];return _0x5b4a22;};'use strict';var _=require(_0xe0db('0x0'));var util=require(_0xe0db('0x1'));var moment=require(_0xe0db('0x2'));var BPromise=require('bluebird');var rs=require(_0xe0db('0x3'));var fs=require('fs');var Redis=require(_0xe0db('0x4'));var db=require(_0xe0db('0x5'))['db'];var utils=require(_0xe0db('0x6'));var logger=require(_0xe0db('0x7'))(_0xe0db('0x8'));var config=require(_0xe0db('0x9'));var jayson=require(_0xe0db('0xa'));var client=jayson[_0xe0db('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40de1c,_0x1c8dfb,_0x19f53f){return new BPromise(function(_0x497e70,_0x5630b1){return client[_0xe0db('0xc')](_0x40de1c,_0x19f53f)[_0xe0db('0xd')](function(_0x150dae){logger[_0xe0db('0xe')](_0xe0db('0xf'),_0x1c8dfb,_0xe0db('0x10'));logger[_0xe0db('0x11')](_0xe0db('0x12'),_0x1c8dfb,_0xe0db('0x10'),JSON[_0xe0db('0x13')](_0x150dae));if(_0x150dae[_0xe0db('0x14')]){if(_0x150dae[_0xe0db('0x14')][_0xe0db('0x15')]===0x1f4){logger[_0xe0db('0x14')](_0xe0db('0xf'),_0x1c8dfb,_0x150dae['error']['message']);return _0x5630b1(_0x150dae[_0xe0db('0x14')][_0xe0db('0x16')]);}logger[_0xe0db('0x14')](_0xe0db('0xf'),_0x1c8dfb,_0x150dae[_0xe0db('0x14')][_0xe0db('0x16')]);return _0x497e70(_0x150dae[_0xe0db('0x14')][_0xe0db('0x16')]);}else{logger[_0xe0db('0xe')](_0xe0db('0xf'),_0x1c8dfb,_0xe0db('0x10'));_0x497e70(_0x150dae['result'][_0xe0db('0x16')]);}})['catch'](function(_0x868e3b){logger[_0xe0db('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x1c8dfb,_0x868e3b);_0x5630b1(_0x868e3b);});});}exports['CreateReportAgentPreview']=function(_0x1703eb){var _0xc46499=this;return new Promise(function(_0x384962,_0x4270e9){return db[_0xe0db('0x17')][_0xe0db('0x18')](_0x1703eb[_0xe0db('0x19')],{'raw':_0x1703eb[_0xe0db('0x1a')]?_0x1703eb[_0xe0db('0x1a')][_0xe0db('0x1b')]===undefined?!![]:![]:!![]})[_0xe0db('0xd')](function(_0x565f4a){logger[_0xe0db('0xe')]('CreateReportAgentPreview',_0x1703eb);logger[_0xe0db('0x11')](_0xe0db('0x1c'),_0x1703eb,JSON[_0xe0db('0x13')](_0x565f4a));_0x384962(_0x565f4a);})[_0xe0db('0x1d')](function(_0x52a9f6){logger['error']('CreateReportAgentPreview',_0x52a9f6[_0xe0db('0x16')],_0x1703eb);_0x4270e9(_0xc46499[_0xe0db('0x14')](0x1f4,_0x52a9f6[_0xe0db('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index cae4974..a9cb1cd 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 _0x7b20=['voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','queueNotify','fax','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','showSmsQueues','showWhatsappQueues','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview'];(function(_0x4b8c55,_0x21484a){var _0x37998b=function(_0x122825){while(--_0x122825){_0x4b8c55['push'](_0x4b8c55['shift']());}};_0x37998b(++_0x21484a);}(_0x7b20,0x1ad));var _0x07b2=function(_0x1a2524,_0xd6a75b){_0x1a2524=_0x1a2524-0x0;var _0x459496=_0x7b20[_0x1a2524];return _0x459496;};'use strict';var multer=require(_0x07b2('0x0'));var util=require(_0x07b2('0x1'));var path=require(_0x07b2('0x2'));var express=require(_0x07b2('0x3'));var router=express[_0x07b2('0x4')]();var auth=require(_0x07b2('0x5'));var controller=require(_0x07b2('0x6'));router[_0x07b2('0x7')](_0x07b2('0x8'),auth[_0x07b2('0x9')](),controller['voiceChannels']);router[_0x07b2('0x7')](_0x07b2('0xa'),auth['isAuthenticated'](),controller[_0x07b2('0xb')]);router['get'](_0x07b2('0xc'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x07b2('0x7')](_0x07b2('0xd'),auth['isAuthenticated'](),controller[_0x07b2('0xe')]);router[_0x07b2('0x7')](_0x07b2('0xf'),auth['isAuthenticated'](),controller['chatQueues']);router['get']('/mail/queues',auth[_0x07b2('0x9')](),controller[_0x07b2('0x10')]);router[_0x07b2('0x7')](_0x07b2('0x11'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x12')]);router[_0x07b2('0x7')](_0x07b2('0x13'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x14')]);router['get'](_0x07b2('0x15'),auth[_0x07b2('0x9')](),controller['smsQueues']);router['get'](_0x07b2('0x16'),auth[_0x07b2('0x9')](),controller['whatsappQueues']);router[_0x07b2('0x7')](_0x07b2('0x17'),auth['isAuthenticated'](),controller[_0x07b2('0x18')]);router[_0x07b2('0x7')](_0x07b2('0x19'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x1a')]);router[_0x07b2('0x7')]('/voice/queues/channels',auth[_0x07b2('0x9')](),controller[_0x07b2('0x1b')]);router['get'](_0x07b2('0x1c'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x1d')]);router['get'](_0x07b2('0x1e'),auth['isAuthenticated'](),controller[_0x07b2('0x1f')]);router[_0x07b2('0x7')](_0x07b2('0x20'),auth['isAuthenticated'](),controller[_0x07b2('0x21')]);router[_0x07b2('0x7')]('/voice/queues/:id',auth[_0x07b2('0x9')](),controller['showVoiceQueues']);router['put'](_0x07b2('0x22'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x23')]);router[_0x07b2('0x7')](_0x07b2('0x24'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x25')]);router[_0x07b2('0x7')]('/outbound/channels',auth[_0x07b2('0x9')](),controller[_0x07b2('0x26')]);router['get'](_0x07b2('0x27'),auth['isAuthenticated'](),controller[_0x07b2('0x28')]);router['put'](_0x07b2('0x29'),auth[_0x07b2('0x9')](),controller['agentCapacity']);router[_0x07b2('0x7')]('/telephones',auth[_0x07b2('0x9')](),controller[_0x07b2('0x2a')]);router[_0x07b2('0x7')](_0x07b2('0x2b'),auth['isAuthenticated'](),controller[_0x07b2('0x2c')]);router[_0x07b2('0x7')](_0x07b2('0x2d'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x2e')]);router['get'](_0x07b2('0x2f'),auth[_0x07b2('0x9')](),controller['faxAccounts']);router[_0x07b2('0x7')]('/chat/queues/waitinginteractions',auth[_0x07b2('0x9')](),controller['chatQueuesWaitingInteractions']);router['get'](_0x07b2('0x30'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x31')]);router['get'](_0x07b2('0x32'),auth['isAuthenticated'](),controller[_0x07b2('0x33')]);router['get'](_0x07b2('0x34'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x35')]);router[_0x07b2('0x7')]('/sms/queues/waitinginteractions',auth[_0x07b2('0x9')](),controller[_0x07b2('0x36')]);router[_0x07b2('0x7')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x07b2('0x37')]);router[_0x07b2('0x7')](_0x07b2('0x38'),auth[_0x07b2('0x9')](),controller['faxQueuesWaitingInteractions']);router[_0x07b2('0x39')]('/mail/queues/:id/notify',auth[_0x07b2('0x9')](),controller['queueNotify'](_0x07b2('0x3a')));router[_0x07b2('0x7')](_0x07b2('0x3b'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x3c')]);router[_0x07b2('0x39')](_0x07b2('0x3d'),auth['isAuthenticated'](),controller['queueNotify']('chat'));router['get'](_0x07b2('0x3e'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x3f')]);router[_0x07b2('0x39')](_0x07b2('0x40'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x41')](_0x07b2('0x42')));router[_0x07b2('0x7')]('/fax/queues/:id',auth[_0x07b2('0x9')](),controller[_0x07b2('0x43')]);router[_0x07b2('0x39')]('/openchannel/queues/:id/notify',auth[_0x07b2('0x9')](),controller[_0x07b2('0x41')](_0x07b2('0x44')));router['get'](_0x07b2('0x45'),auth[_0x07b2('0x9')](),controller[_0x07b2('0x46')]);router[_0x07b2('0x39')]('/sms/queues/:id/notify',auth[_0x07b2('0x9')](),controller[_0x07b2('0x41')](_0x07b2('0x47')));router['post'](_0x07b2('0x48'),auth[_0x07b2('0x9')](),controller['queueNotify']('whatsapp'));router[_0x07b2('0x7')]('/sms/queues/:id',auth[_0x07b2('0x9')](),controller[_0x07b2('0x49')]);router[_0x07b2('0x7')]('/whatsapp/queues/:id',auth[_0x07b2('0x9')](),controller[_0x07b2('0x4a')]);router[_0x07b2('0x39')]('/agents/:id/notify',auth[_0x07b2('0x9')](),controller['agentNotify']);module[_0x07b2('0x4b')]=router; \ No newline at end of file +var _0xd6fc=['telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','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','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones'];(function(_0x21fdce,_0x3b4c0e){var _0xcdf7d6=function(_0x4f74b5){while(--_0x4f74b5){_0x21fdce['push'](_0x21fdce['shift']());}};_0xcdf7d6(++_0x3b4c0e);}(_0xd6fc,0xcd));var _0xcd6f=function(_0x159bd8,_0x3c2874){_0x159bd8=_0x159bd8-0x0;var _0x1f6a40=_0xd6fc[_0x159bd8];return _0x1f6a40;};'use strict';var multer=require(_0xcd6f('0x0'));var util=require(_0xcd6f('0x1'));var path=require(_0xcd6f('0x2'));var express=require(_0xcd6f('0x3'));var router=express[_0xcd6f('0x4')]();var auth=require(_0xcd6f('0x5'));var controller=require('./rpc.controller');router[_0xcd6f('0x6')](_0xcd6f('0x7'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x9')]);router[_0xcd6f('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0xcd6f('0xa')]);router[_0xcd6f('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0xcd6f('0xb')]);router['get']('/voice/queues',auth[_0xcd6f('0x8')](),controller[_0xcd6f('0xc')]);router[_0xcd6f('0x6')](_0xcd6f('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router[_0xcd6f('0x6')](_0xcd6f('0xe'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0xf')]);router[_0xcd6f('0x6')](_0xcd6f('0x10'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x11')]);router[_0xcd6f('0x6')](_0xcd6f('0x12'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x13')]);router[_0xcd6f('0x6')]('/sms/queues',auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x14')]);router[_0xcd6f('0x6')](_0xcd6f('0x15'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x16')]);router[_0xcd6f('0x6')](_0xcd6f('0x17'),auth['isAuthenticated'](),controller[_0xcd6f('0x18')]);router[_0xcd6f('0x6')](_0xcd6f('0x19'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x1a')]);router[_0xcd6f('0x6')](_0xcd6f('0x1b'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x1c')]);router[_0xcd6f('0x6')](_0xcd6f('0x1d'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x1e')]);router['get'](_0xcd6f('0x1f'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xcd6f('0x6')](_0xcd6f('0x20'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xcd6f('0x6')](_0xcd6f('0x21'),auth['isAuthenticated'](),controller[_0xcd6f('0x22')]);router[_0xcd6f('0x23')]('/voice/queues/:id',auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0xcd6f('0x6')](_0xcd6f('0x24'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x25')]);router['get'](_0xcd6f('0x26'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x27')]);router['get'](_0xcd6f('0x28'),auth['isAuthenticated'](),controller[_0xcd6f('0x29')]);router['put'](_0xcd6f('0x2a'),auth[_0xcd6f('0x8')](),controller['agentCapacity']);router[_0xcd6f('0x6')](_0xcd6f('0x2b'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x2c')]);router[_0xcd6f('0x6')](_0xcd6f('0x2d'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x2e')]);router[_0xcd6f('0x6')](_0xcd6f('0x2f'),auth[_0xcd6f('0x8')](),controller['campaigns']);router[_0xcd6f('0x6')](_0xcd6f('0x30'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0xcd6f('0x6')](_0xcd6f('0x31'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x32')]);router[_0xcd6f('0x6')]('/mail/queues/waitinginteractions',auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x33')]);router[_0xcd6f('0x6')](_0xcd6f('0x34'),auth[_0xcd6f('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0xcd6f('0x6')](_0xcd6f('0x35'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xcd6f('0x6')](_0xcd6f('0x36'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x37')]);router[_0xcd6f('0x6')](_0xcd6f('0x38'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x39')]);router[_0xcd6f('0x6')](_0xcd6f('0x3a'),auth['isAuthenticated'](),controller[_0xcd6f('0x3b')]);router[_0xcd6f('0x3c')]('/mail/queues/:id/notify',auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x3d')](_0xcd6f('0x3e')));router['get'](_0xcd6f('0x3f'),auth['isAuthenticated'](),controller[_0xcd6f('0x40')]);router['post']('/chat/queues/:id/notify',auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x3d')](_0xcd6f('0x41')));router['get'](_0xcd6f('0x42'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x43')]);router[_0xcd6f('0x3c')](_0xcd6f('0x44'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x3d')](_0xcd6f('0x45')));router[_0xcd6f('0x6')](_0xcd6f('0x46'),auth['isAuthenticated'](),controller[_0xcd6f('0x47')]);router[_0xcd6f('0x3c')]('/openchannel/queues/:id/notify',auth[_0xcd6f('0x8')](),controller['queueNotify'](_0xcd6f('0x48')));router[_0xcd6f('0x6')](_0xcd6f('0x49'),auth['isAuthenticated'](),controller[_0xcd6f('0x4a')]);router[_0xcd6f('0x3c')](_0xcd6f('0x4b'),auth['isAuthenticated'](),controller[_0xcd6f('0x3d')](_0xcd6f('0x4c')));router[_0xcd6f('0x3c')]('/whatsapp/queues/:id/notify',auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x3d')](_0xcd6f('0x4d')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router[_0xcd6f('0x6')](_0xcd6f('0x4e'),auth[_0xcd6f('0x8')](),controller[_0xcd6f('0x4f')]);router[_0xcd6f('0x3c')](_0xcd6f('0x50'),auth['isAuthenticated'](),controller[_0xcd6f('0x51')]);module[_0xcd6f('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 b2996ab..f9f5221 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 _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x3eb9d9,_0x43543c){var _0x234fc5=function(_0x577148){while(--_0x577148){_0x3eb9d9['push'](_0x3eb9d9['shift']());}};_0x234fc5(++_0x43543c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0x5fc3[_0x5e7514];return _0x12f472;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));}; \ No newline at end of file +var _0xb4c7=['query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','user','interaction','MemberReport','findAll','INTERACTION','length','updateAttributes','findOrCreate','format','SIP/%s','interface','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','messageId','queue','InteractionId','Start','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels'];(function(_0x15435c,_0x5134ae){var _0x2e4a4f=function(_0x3de12a){while(--_0x3de12a){_0x15435c['push'](_0x15435c['shift']());}};_0x2e4a4f(++_0x5134ae);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x34feda,_0x21e921){_0x34feda=_0x34feda-0x0;var _0x3b928c=_0xb4c7[_0x34feda];return _0x3b928c;};'use strict';var BPromise=require(_0x7b4c('0x0'));var moment=require(_0x7b4c('0x1'));var _=require(_0x7b4c('0x2'));var util=require(_0x7b4c('0x3'));var db=require(_0x7b4c('0x4'))['db'];var logger=require('../../config/logger')(_0x7b4c('0x5'));var jayson=require(_0x7b4c('0x6'));var amiClient=jayson[_0x7b4c('0x7')][_0x7b4c('0x8')]({'port':0x232a});var mailClient=jayson[_0x7b4c('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x7b4c('0x7')][_0x7b4c('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){var _0x433aa2=_0x2d7b7e?_0x2d7b7e:amiClient;return _0x433aa2[_0x7b4c('0x9')](_0x2dd5c7,_0x4bf85d)[_0x7b4c('0xa')](function(_0x237e28){if(_0x237e28[_0x7b4c('0xb')]){if(_0x237e28[_0x7b4c('0xb')][_0x7b4c('0xc')]===0x1f4){return _0x570daa(_0x237e28[_0x7b4c('0xb')][_0x7b4c('0xd')]);}return _0x21687f(_0x237e28[_0x7b4c('0xb')]['message']);}else{_0x21687f(_0x237e28['result']);}})[_0x7b4c('0xe')](function(_0x18342b){_0x570daa(_0x18342b);});});}function respondWithResult(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xc8;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0xf')](_0x1722ad)[_0x7b4c('0x10')](_0x3e1558);}return _0x38656b[_0x7b4c('0x11')](0x194);};}function handleError(_0x25b90b,_0x387488){_0x387488=_0x387488||0x1f4;return function(_0x593a19){logger[_0x7b4c('0xb')](_0x593a19[_0x7b4c('0x12')]);if(_0x593a19[_0x7b4c('0x13')]){delete _0x593a19[_0x7b4c('0x13')];}_0x25b90b[_0x7b4c('0xf')](_0x387488)[_0x7b4c('0x14')](_0x593a19);};}function findById(_0x1642e1){return function(_0x22c409){if(!_['isNil'](_0x1642e1)&&!_[_0x7b4c('0x15')](_0x22c409)&&!_[_0x7b4c('0x15')](_0x22c409[_0x7b4c('0x16')])){return _[_0x7b4c('0x17')](_0x22c409['rows'],function(_0x3ce10c){return _0x3ce10c['id']==_0x1642e1;});}return null;};}exports[_0x7b4c('0x18')]=function(_0x32110e,_0x380b79){return respondWithRpcPromise(_0x7b4c('0x19'),_0x32110e[_0x7b4c('0x1a')])[_0x7b4c('0xa')](respondWithResult(_0x380b79,null))[_0x7b4c('0xe')](handleError(_0x380b79,null));};exports[_0x7b4c('0x1b')]=function(_0x55e3df,_0x1f06ec){return respondWithRpcPromise(_0x7b4c('0x1c'),_[_0x7b4c('0x1d')](_0x55e3df[_0x7b4c('0x1a')],_0x55e3df[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x1f06ec,null))[_0x7b4c('0xe')](handleError(_0x1f06ec,null));};exports[_0x7b4c('0x1f')]=function(_0x2ab9e1,_0x2c267c){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x7b4c('0x1d')](_0x2ab9e1[_0x7b4c('0x1a')],_0x2ab9e1[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x2c267c,null))[_0x7b4c('0xe')](handleError(_0x2c267c,null));};exports[_0x7b4c('0x20')]=function(_0x37c059,_0x459eb4){return respondWithRpcPromise(_0x7b4c('0x21'),_0x37c059[_0x7b4c('0x1a')])[_0x7b4c('0xa')](respondWithResult(_0x459eb4,null))[_0x7b4c('0xe')](handleError(_0x459eb4,null));};exports[_0x7b4c('0x22')]=function(_0x501f75,_0x27f361){return respondWithRpcPromise(_0x7b4c('0x21'),_0x501f75[_0x7b4c('0x1a')])[_0x7b4c('0xa')](findById(_0x501f75[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x27f361,null))[_0x7b4c('0xe')](handleError(_0x27f361,null));};exports[_0x7b4c('0x23')]=function(_0x3e4a46,_0x9a799b){return respondWithRpcPromise(_0x7b4c('0x24'),_[_0x7b4c('0x1d')](_0x3e4a46[_0x7b4c('0x25')],_0x3e4a46[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x9a799b,null))[_0x7b4c('0xe')](handleError(_0x9a799b,null));};exports[_0x7b4c('0x26')]=function(_0xce5781,_0x9d3d31){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0xce5781['query'],_0xce5781[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x9d3d31,null))[_0x7b4c('0xe')](handleError(_0x9d3d31,null));};exports[_0x7b4c('0x27')]=function(_0x498391,_0x6e66e3){return respondWithRpcPromise(_0x7b4c('0x28'),_0x498391['query'])[_0x7b4c('0xa')](respondWithResult(_0x6e66e3,null))['catch'](handleError(_0x6e66e3,null));};exports[_0x7b4c('0x29')]=function(_0x3b9149,_0x159001){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x7b4c('0x1d')](_0x3b9149[_0x7b4c('0x1a')],_0x3b9149['params']))[_0x7b4c('0xa')](respondWithResult(_0x159001,null))[_0x7b4c('0xe')](handleError(_0x159001,null));};exports[_0x7b4c('0x2a')]=function(_0x2e0835,_0x56ff38){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x7b4c('0x1d')](_0x2e0835[_0x7b4c('0x1a')],_0x2e0835['params']))[_0x7b4c('0xa')](respondWithResult(_0x56ff38,null))['catch'](handleError(_0x56ff38,null));};exports['voiceQueuesChannelRedirect']=function(_0x11ca38,_0x16ae89){return respondWithRpcPromise(_0x7b4c('0x2b'),_[_0x7b4c('0x1d')](_0x11ca38['query'],_0x11ca38[_0x7b4c('0x1e')]))[_0x7b4c('0xa')](respondWithResult(_0x16ae89,null))[_0x7b4c('0xe')](handleError(_0x16ae89,null));};exports[_0x7b4c('0x2c')]=function(_0x346e0c,_0xddd16){return respondWithRpcPromise(_0x7b4c('0x2d'),_0x346e0c['query'])['then'](respondWithResult(_0xddd16,null))[_0x7b4c('0xe')](handleError(_0xddd16,null));};exports[_0x7b4c('0x2e')]=function(_0x31ef1e,_0x123a3a){return respondWithRpcPromise(_0x7b4c('0x2f'),_0x31ef1e['query'])[_0x7b4c('0xa')](respondWithResult(_0x123a3a,null))[_0x7b4c('0xe')](handleError(_0x123a3a,null));};exports[_0x7b4c('0x30')]=function(_0x26346a,_0x22f71b){var _0x25659d;return respondWithRpcPromise(_0x7b4c('0x31'),_0x26346a[_0x7b4c('0x1a')])[_0x7b4c('0xa')](function(_0x54cd10){_0x25659d=_0x54cd10;return respondWithRpcPromise(_0x7b4c('0x31'),_0x26346a['query'],routingClient);})[_0x7b4c('0xa')](function(_0x4dc71f){return _[_0x7b4c('0x1d')]({},_0x4dc71f,_0x25659d);})[_0x7b4c('0xa')](respondWithResult(_0x22f71b,null))['catch'](handleError(_0x22f71b,null));};exports['agentCapacity']=function(_0x354578,_0x4314b6){if(_0x354578[_0x7b4c('0x25')]&&_0x354578[_0x7b4c('0x25')]['interaction']&&_0x354578[_0x7b4c('0x32')]&&_0x354578[_0x7b4c('0x32')][_0x7b4c('0x13')]){for(var _0x5d4ed8 in _0x354578[_0x7b4c('0x25')]['interaction']){if(_0x354578['body'][_0x7b4c('0x33')]['hasOwnProperty'](_0x5d4ed8)){db[_0x7b4c('0x34')][_0x7b4c('0x35')]({'where':{'channel':_0x5d4ed8,'membername':_0x354578[_0x7b4c('0x32')][_0x7b4c('0x13')],'type':_0x7b4c('0x36'),'exitAt':null,'uniqueid':_0x354578[_0x7b4c('0x25')][_0x7b4c('0x33')][_0x5d4ed8]&&_0x354578[_0x7b4c('0x25')][_0x7b4c('0x33')][_0x5d4ed8]['length']?{'$notIn':_0x354578[_0x7b4c('0x25')]['interaction'][_0x5d4ed8]}:{'$ne':null}}})['then'](function(_0x23372c){var _0x1f1653=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x255cca=0x0,_0x2ce694=_0x23372c[_0x7b4c('0x37')];_0x255cca<_0x2ce694;_0x255cca+=0x1){_0x23372c[_0x255cca][_0x7b4c('0x38')]({'exitAt':_0x1f1653});}});for(var _0x8ebf9b=0x0;_0x8ebf9b<_0x354578[_0x7b4c('0x25')][_0x7b4c('0x33')][_0x5d4ed8][_0x7b4c('0x37')];_0x8ebf9b+=0x1){db['MemberReport'][_0x7b4c('0x39')]({'where':{'channel':_0x5d4ed8,'membername':_0x354578[_0x7b4c('0x32')][_0x7b4c('0x13')],'type':_0x7b4c('0x36'),'uniqueid':_0x354578[_0x7b4c('0x25')][_0x7b4c('0x33')][_0x5d4ed8][_0x8ebf9b],'exitAt':null},'defaults':{'channel':_0x5d4ed8,'membername':_0x354578[_0x7b4c('0x32')][_0x7b4c('0x13')],'interface':_[_0x7b4c('0x15')](_0x354578['user']['interface'])?util[_0x7b4c('0x3a')](_0x7b4c('0x3b'),_0x354578[_0x7b4c('0x32')]['name']):_0x354578[_0x7b4c('0x32')][_0x7b4c('0x3c')],'type':'INTERACTION','enterAt':moment()[_0x7b4c('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x7b4c('0x3d'),'internal':_0x354578['user'][_0x7b4c('0x3e')],'uniqueid':_0x354578['body'][_0x7b4c('0x33')][_0x5d4ed8][_0x8ebf9b]}});}}}}return respondWithRpcPromise(_0x7b4c('0x3f'),{'id':_0x354578['params']['id'],'capacity':_0x354578['body'][_0x7b4c('0x40')]},routingClient)[_0x7b4c('0xa')](respondWithResult(_0x4314b6,null))[_0x7b4c('0xe')](handleError(_0x4314b6,null));};exports['telephones']=function(_0x56233b,_0x2fc5b5){return respondWithRpcPromise(_0x7b4c('0x41'),_0x56233b['query'])['then'](respondWithResult(_0x2fc5b5,null))[_0x7b4c('0xe')](handleError(_0x2fc5b5,null));};exports[_0x7b4c('0x42')]=function(_0x166fd1,_0x4b2207){return respondWithRpcPromise(_0x7b4c('0x43'),_0x166fd1[_0x7b4c('0x1a')])['then'](respondWithResult(_0x4b2207,null))['catch'](handleError(_0x4b2207,null));};exports[_0x7b4c('0x44')]=function(_0x4d8491,_0x59db20){return respondWithRpcPromise(_0x7b4c('0x45'),_0x4d8491['query'])['then'](respondWithResult(_0x59db20,null))[_0x7b4c('0xe')](handleError(_0x59db20,null));};exports[_0x7b4c('0x46')]=function(_0xde9f5,_0x17af17){return respondWithRpcPromise('ChatQueues',_0xde9f5['query'],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x17af17,null))[_0x7b4c('0xe')](handleError(_0x17af17,null));};exports[_0x7b4c('0x47')]=function(_0x59b358,_0x255262){return respondWithRpcPromise(_0x7b4c('0x48'),_0x59b358[_0x7b4c('0x1a')],routingClient)['then'](findById(_0x59b358[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x255262,null))['catch'](handleError(_0x255262,null));};exports[_0x7b4c('0x49')]=function(_0x186e7d,_0x30de26){return respondWithRpcPromise(_0x7b4c('0x4a'),_0x186e7d[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x30de26,null))[_0x7b4c('0xe')](handleError(_0x30de26,null));};exports['showMailQueues']=function(_0x4443d0,_0x2dc79a){return respondWithRpcPromise('MailQueues',_0x4443d0[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](findById(_0x4443d0[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x2dc79a,null))['catch'](handleError(_0x2dc79a,null));};exports[_0x7b4c('0x4b')]=function(_0x4e84a3,_0x542b85){return respondWithRpcPromise(_0x7b4c('0x4c'),_0x4e84a3[_0x7b4c('0x1a')],mailClient)[_0x7b4c('0xa')](respondWithResult(_0x542b85,null))[_0x7b4c('0xe')](handleError(_0x542b85,null));};exports[_0x7b4c('0x4d')]=function(_0x5b24f6,_0x4fcc9d){return respondWithRpcPromise(_0x7b4c('0x4e'),_0x5b24f6[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x4fcc9d,null))['catch'](handleError(_0x4fcc9d,null));};exports[_0x7b4c('0x4f')]=function(_0xc4dae0,_0x36fc5d){return respondWithRpcPromise('OpenchannelQueues',_0xc4dae0[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](findById(_0xc4dae0[_0x7b4c('0x1e')]['id']))['then'](respondWithResult(_0x36fc5d,null))[_0x7b4c('0xe')](handleError(_0x36fc5d,null));};exports[_0x7b4c('0x50')]=function(_0x4ac03e,_0x1c64d5){return respondWithRpcPromise('SmsQueues',_0x4ac03e[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x1c64d5,null))[_0x7b4c('0xe')](handleError(_0x1c64d5,null));};exports['showSmsQueues']=function(_0x5af2af,_0x237921){return respondWithRpcPromise(_0x7b4c('0x51'),_0x5af2af[_0x7b4c('0x1a')],routingClient)['then'](findById(_0x5af2af[_0x7b4c('0x1e')]['id']))['then'](respondWithResult(_0x237921,null))[_0x7b4c('0xe')](handleError(_0x237921,null));};exports[_0x7b4c('0x52')]=function(_0x1315bd,_0x5f3ed5){return respondWithRpcPromise(_0x7b4c('0x53'),_0x1315bd['query'],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x5f3ed5,null))[_0x7b4c('0xe')](handleError(_0x5f3ed5,null));};exports['showWhatsappQueues']=function(_0x7a38e,_0x13a882){return respondWithRpcPromise(_0x7b4c('0x53'),_0x7a38e[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](findById(_0x7a38e[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x13a882,null))[_0x7b4c('0xe')](handleError(_0x13a882,null));};exports['faxQueues']=function(_0x10d5b3,_0x2dc9a4){return respondWithRpcPromise(_0x7b4c('0x54'),_0x10d5b3[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x2dc9a4,null))[_0x7b4c('0xe')](handleError(_0x2dc9a4,null));};exports[_0x7b4c('0x55')]=function(_0x2a5f6e,_0x34fce4){return respondWithRpcPromise(_0x7b4c('0x54'),_0x2a5f6e[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](findById(_0x2a5f6e[_0x7b4c('0x1e')]['id']))[_0x7b4c('0xa')](respondWithResult(_0x34fce4,null))[_0x7b4c('0xe')](handleError(_0x34fce4,null));};exports[_0x7b4c('0x56')]=function(_0x168aa1,_0x36c7d9){return respondWithRpcPromise(_0x7b4c('0x57'),_0x168aa1[_0x7b4c('0x1a')])['then'](respondWithResult(_0x36c7d9,null))['catch'](handleError(_0x36c7d9,null));};exports[_0x7b4c('0x58')]=function(_0x15033e,_0x50069b){return respondWithRpcPromise(_0x7b4c('0x59'),_0x15033e[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x50069b,null))[_0x7b4c('0xe')](handleError(_0x50069b,null));};exports[_0x7b4c('0x5a')]=function(_0x15df66,_0x22a254){return respondWithRpcPromise(_0x7b4c('0x5b'),_0x15df66[_0x7b4c('0x1a')],routingClient)['then'](respondWithResult(_0x22a254,null))[_0x7b4c('0xe')](handleError(_0x22a254,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x35067f,_0x5477e3){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x35067f[_0x7b4c('0x1a')],routingClient)['then'](respondWithResult(_0x5477e3,null))['catch'](handleError(_0x5477e3,null));};exports[_0x7b4c('0x5c')]=function(_0x2d17ed,_0x328948){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x2d17ed[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](function(_0x10e789){if(_0x2d17ed[_0x7b4c('0x1a')][_0x7b4c('0x5d')]!==undefined){var _0x2837aa=_(_0x10e789[_0x7b4c('0x16')])[_0x7b4c('0x5e')]([_0x2d17ed[_0x7b4c('0x1a')][_0x7b4c('0x5d')],_0x2d17ed[_0x7b4c('0x1e')]['id']])[_0x7b4c('0x5f')](_0x7b4c('0x60'))[_0x7b4c('0x61')]()['value']();return _0x10e789[_0x7b4c('0x16')][_0x7b4c('0x5e')](function(_0x35e94a){return _0x2837aa[_0x7b4c('0x62')](_0x35e94a['queue_id'])>-0x1;});}else{return _0x10e789[_0x7b4c('0x16')][_0x7b4c('0x5e')](function(_0x149d53){return _0x149d53[_0x7b4c('0x60')]===parseInt(_0x2d17ed[_0x7b4c('0x1e')]['id']);});}})[_0x7b4c('0xa')](respondWithResult(_0x328948,null))[_0x7b4c('0xe')](handleError(_0x328948,null));};exports['smsQueuesWaitingInteractions']=function(_0x11c809,_0x108c99){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x11c809['query'],routingClient)['then'](respondWithResult(_0x108c99,null))[_0x7b4c('0xe')](handleError(_0x108c99,null));};exports[_0x7b4c('0x63')]=function(_0x24d4f9,_0x19804d){return respondWithRpcPromise(_0x7b4c('0x64'),_0x24d4f9[_0x7b4c('0x1a')],routingClient)[_0x7b4c('0xa')](respondWithResult(_0x19804d,null))[_0x7b4c('0xe')](handleError(_0x19804d,null));};exports[_0x7b4c('0x65')]=function(_0x2bc889,_0x83e8bb){return respondWithRpcPromise(_0x7b4c('0x66'),_0x2bc889[_0x7b4c('0x1a')],routingClient)['then'](respondWithResult(_0x83e8bb,null))[_0x7b4c('0xe')](handleError(_0x83e8bb,null));};exports[_0x7b4c('0x67')]=function(_0x2afaa0){return function(_0x5dc6e6,_0x39c01d){var _0x392656,_0x1faa6f;var _0x3999bf=_[_0x7b4c('0x68')](_0x2afaa0);var _0x57f1a0=_0x2afaa0===_0x7b4c('0x69')?_0x7b4c('0x6a'):_0x7b4c('0x6b');return db[_0x3999bf+_0x7b4c('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x5dc6e6[_0x7b4c('0x1e')]['id']}})[_0x7b4c('0xa')](function(_0xdfa0bc){if(_['isNil'](_0xdfa0bc)){throw new Error(_0x3999bf+_0x7b4c('0x6d'));}_0x392656=_0xdfa0bc;return db[_0x3999bf+_0x7b4c('0x6e')][_0x7b4c('0x6f')]({'where':{'id':_0x5dc6e6[_0x7b4c('0x25')]['messageId']},'include':[{'model':db[_0x3999bf+_0x7b4c('0x70')],'as':_0x7b4c('0x70')},{'model':db[_0x3999bf+_0x57f1a0],'as':_0x7b4c('0x6b')}]});})[_0x7b4c('0xa')](function(_0x50c382){if(_[_0x7b4c('0x15')](_0x50c382)){throw new Error(_0x3999bf+'\x20Message\x20not\x20found');}_0x1faa6f=_0x50c382;return _0x50c382[_0x7b4c('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x24690a={'uniqueid':_0x2afaa0+'.'+_0x1faa6f['id']+'.'+_0x1faa6f[_0x7b4c('0x70')]['id'],'FromUserId':_0x5dc6e6[_0x7b4c('0x32')]['id'],'type':'queue'};_0x24690a[_0x3999bf+_0x7b4c('0x72')]=_0x1faa6f['id'];_0x24690a[_0x3999bf+'InteractionId']=_0x1faa6f[_0x7b4c('0x70')]['id'];_0x24690a[_0x7b4c('0x73')+_0x3999bf+_0x57f1a0+'Id']=_0x1faa6f['Account']['id'];_0x24690a['To'+_0x3999bf+_0x7b4c('0x74')]=_0x392656['id'];return db[_0x3999bf+_0x7b4c('0x75')][_0x7b4c('0x76')](_0x24690a);})[_0x7b4c('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x2afaa0,'interaction':_0x1faa6f[_0x7b4c('0x70')],'message':_0x1faa6f,'account':_0x1faa6f[_0x7b4c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x392656[_0x7b4c('0x13')]+','+(_0x1faa6f[_0x7b4c('0x6b')][_0x7b4c('0x77')]||0x12c),'interval':_0x7b4c('0x78')}]},routingClient);})[_0x7b4c('0xa')](respondWithResult(_0x39c01d,null))[_0x7b4c('0xe')](handleError(_0x39c01d,null));};};exports[_0x7b4c('0x79')]=function(_0x4e9781,_0x5ec399){var _0xdb202,_0x433d74;if(_[_0x7b4c('0x15')](_0x4e9781[_0x7b4c('0x25')][_0x7b4c('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x228b2b=_0x4e9781[_0x7b4c('0x25')][_0x7b4c('0x7a')];var _0x331db1=_['capitalize'](_0x228b2b);var _0x56ba6f=_0x228b2b===_0x7b4c('0x69')?_0x7b4c('0x6a'):_0x7b4c('0x6b');return db[_0x7b4c('0x7b')][_0x7b4c('0x6f')]({'raw':!![],'where':{'id':_0x4e9781['params']['id'],'role':_0x7b4c('0x3d')}})[_0x7b4c('0xa')](function(_0x450eca){if(_[_0x7b4c('0x15')](_0x450eca)){throw new Error('Agent\x20not\x20found');}_0xdb202=_0x450eca;return db[_0x331db1+'Message']['findOne']({'where':{'id':_0x4e9781[_0x7b4c('0x25')][_0x7b4c('0x7c')]},'include':[{'model':db[_0x331db1+_0x7b4c('0x70')],'as':'Interaction'},{'model':db[_0x331db1+_0x56ba6f],'as':_0x7b4c('0x6b')}]});})['then'](function(_0x530030){if(_[_0x7b4c('0x15')](_0x530030)){throw new Error(_0x331db1+'\x20Message\x20not\x20found');}_0x433d74=_0x530030;return _0x530030[_0x7b4c('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7b4c('0xa')](function(){var _0x5e444a={'uniqueid':_0x228b2b+'.'+_0x433d74['id']+'.'+_0x433d74['Interaction']['id'],'FromUserId':_0x4e9781[_0x7b4c('0x32')]['id'],'type':_0x7b4c('0x7d'),'ToUserId':_0xdb202['id']};_0x5e444a[_0x331db1+_0x7b4c('0x72')]=_0x433d74['id'];_0x5e444a[_0x331db1+_0x7b4c('0x7e')]=_0x433d74['Interaction']['id'];_0x5e444a['From'+_0x331db1+_0x56ba6f+'Id']=_0x433d74[_0x7b4c('0x6b')]['id'];return db[_0x331db1+_0x7b4c('0x75')][_0x7b4c('0x76')](_0x5e444a);})[_0x7b4c('0xa')](function(){return respondWithRpcPromise(_0x7b4c('0x7f'),{'channel':_0x228b2b,'interaction':_0x433d74[_0x7b4c('0x70')],'message':_0x433d74,'account':_0x433d74[_0x7b4c('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0xdb202[_0x7b4c('0x13')]+','+(_0x433d74[_0x7b4c('0x6b')][_0x7b4c('0x80')]||0x12c),'interval':_0x7b4c('0x78')}]},routingClient);})[_0x7b4c('0xa')](respondWithResult(_0x5ec399,null))[_0x7b4c('0xe')](handleError(_0x5ec399,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 00c0fc2..037e0f7 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 _0xb425=['/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','index','isAuthenticated','show','/:id/run','run','create','update','delete'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xb425,0xea));var _0x5b42=function(_0x25ccb6,_0x429ba4){_0x25ccb6=_0x25ccb6-0x0;var _0x3c8292=_0xb425[_0x25ccb6];return _0x3c8292;};'use strict';var multer=require(_0x5b42('0x0'));var util=require(_0x5b42('0x1'));var path=require(_0x5b42('0x2'));var timeout=require('connect-timeout');var express=require(_0x5b42('0x3'));var router=express[_0x5b42('0x4')]();var fs_extra=require(_0x5b42('0x5'));var auth=require(_0x5b42('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5b42('0x7'));var controller=require(_0x5b42('0x8'));router[_0x5b42('0x9')]('/',auth['isAuthenticated'](),controller[_0x5b42('0xa')]);router['get']('/:id',auth[_0x5b42('0xb')](),controller[_0x5b42('0xc')]);router[_0x5b42('0x9')](_0x5b42('0xd'),auth['isAuthenticated'](),controller[_0x5b42('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5b42('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5b42('0x10')]);router[_0x5b42('0x11')](_0x5b42('0x12'),auth[_0x5b42('0xb')](),controller[_0x5b42('0x13')]);module[_0x5b42('0x14')]=router; \ No newline at end of file +var _0x6364=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','create','delete','destroy','multer'];(function(_0x503077,_0xc351b){var _0x5cc824=function(_0x417e85){while(--_0x417e85){_0x503077['push'](_0x503077['shift']());}};_0x5cc824(++_0xc351b);}(_0x6364,0x92));var _0x4636=function(_0xbb7811,_0x2ba0a9){_0xbb7811=_0xbb7811-0x0;var _0x3a9001=_0x6364[_0xbb7811];return _0x3a9001;};'use strict';var multer=require(_0x4636('0x0'));var util=require(_0x4636('0x1'));var path=require(_0x4636('0x2'));var timeout=require(_0x4636('0x3'));var express=require(_0x4636('0x4'));var router=express[_0x4636('0x5')]();var fs_extra=require(_0x4636('0x6'));var auth=require(_0x4636('0x7'));var interaction=require(_0x4636('0x8'));var config=require(_0x4636('0x9'));var controller=require(_0x4636('0xa'));router[_0x4636('0xb')]('/',auth[_0x4636('0xc')](),controller[_0x4636('0xd')]);router[_0x4636('0xb')](_0x4636('0xe'),auth[_0x4636('0xc')](),controller[_0x4636('0xf')]);router[_0x4636('0xb')](_0x4636('0x10'),auth[_0x4636('0xc')](),controller['run']);router[_0x4636('0x11')]('/',auth[_0x4636('0xc')](),controller[_0x4636('0x12')]);router['put'](_0x4636('0xe'),auth[_0x4636('0xc')](),controller['update']);router[_0x4636('0x13')](_0x4636('0xe'),auth[_0x4636('0xc')](),controller[_0x4636('0x14')]);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 07c4842..a7bc5b2 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 _0x9a6a=['years','quarters','weeks','days','hours','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM'];(function(_0xc3999c,_0x4db921){var _0x256213=function(_0x8f6565){while(--_0x8f6565){_0xc3999c['push'](_0xc3999c['shift']());}};_0x256213(++_0x4db921);}(_0x9a6a,0x107));var _0xa9a6=function(_0x1e5212,_0xa5f3a7){_0x1e5212=_0x1e5212-0x0;var _0x49af31=_0x9a6a[_0x1e5212];return _0x49af31;};'use strict';var Sequelize=require(_0xa9a6('0x0'));module[_0xa9a6('0x1')]={'name':{'type':Sequelize[_0xa9a6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa9a6('0x2')]},'active':{'type':Sequelize[_0xa9a6('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xa9a6('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xa9a6('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa9a6('0x6')](_0xa9a6('0x7'),_0xa9a6('0x8'),'months',_0xa9a6('0x9'),_0xa9a6('0xa'),_0xa9a6('0xb'),'minutes'),'allowNull':![],'defaultValue':_0xa9a6('0xa')},'output':{'type':Sequelize[_0xa9a6('0x6')](_0xa9a6('0xc'),_0xa9a6('0xd'),_0xa9a6('0xe')),'allowNull':![],'defaultValue':_0xa9a6('0xc')},'type':{'type':Sequelize['ENUM'](_0xa9a6('0xf'),_0xa9a6('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xa9a6('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xa9a6('0x2')]},'cc':{'type':Sequelize[_0xa9a6('0x11')]},'bcc':{'type':Sequelize[_0xa9a6('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xa9a6('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2c0d=['TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','months','weeks','days','hours','minutes','csv','xlsx','custom','default'];(function(_0xe183da,_0x26b480){var _0x14f5f2=function(_0x2c3691){while(--_0x2c3691){_0xe183da['push'](_0xe183da['shift']());}};_0x14f5f2(++_0x26b480);}(_0x2c0d,0x100));var _0xd2c0=function(_0x4bcd02,_0x1f3d1a){_0x4bcd02=_0x4bcd02-0x0;var _0x56f988=_0x2c0d[_0x4bcd02];return _0x56f988;};'use strict';var Sequelize=require(_0xd2c0('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2c0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd2c0('0x1')]},'active':{'type':Sequelize[_0xd2c0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd2c0('0x1')],'allowNull':![],'defaultValue':_0xd2c0('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xd2c0('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd2c0('0x5')](_0xd2c0('0x6'),'quarters',_0xd2c0('0x7'),_0xd2c0('0x8'),_0xd2c0('0x9'),_0xd2c0('0xa'),_0xd2c0('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0xd2c0('0xc'),'pdf',_0xd2c0('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0xd2c0('0xe'),_0xd2c0('0xf')),'allowNull':![],'defaultValue':_0xd2c0('0xe')},'sendMail':{'type':Sequelize[_0xd2c0('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xd2c0('0x10')]},'bcc':{'type':Sequelize[_0xd2c0('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xd2c0('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index f91be9e..45c5f94 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 _0x5167=['findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Scheduler','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','zip-dir','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','update','then','destroy','get','UserProfileResource','stack','send','map','Schedule','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x4f6f04,_0x59c6ba){var _0x606b2c=function(_0x35da06){while(--_0x35da06){_0x4f6f04['push'](_0x4f6f04['shift']());}};_0x606b2c(++_0x59c6ba);}(_0x5167,0xf5));var _0x7516=function(_0x260a74,_0x559c14){_0x260a74=_0x260a74-0x0;var _0x17b46b=_0x5167[_0x260a74];return _0x17b46b;};'use strict';var emlformat=require(_0x7516('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7516('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7516('0x2'));var util=require(_0x7516('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x7516('0x4'));var ejs=require(_0x7516('0x5'));var fs=require('fs');var fs_extra=require(_0x7516('0x6'));var _=require('lodash');var squel=require(_0x7516('0x7'));var crypto=require('crypto');var jsforce=require(_0x7516('0x8'));var deskjs=require(_0x7516('0x9'));var toCsv=require(_0x7516('0x4'));var querystring=require('querystring');var Papa=require(_0x7516('0xa'));var Redis=require('ioredis');var authService=require(_0x7516('0xb'));var qs=require(_0x7516('0xc'));var as=require(_0x7516('0xd'));var hardwareService=require(_0x7516('0xe'));var logger=require(_0x7516('0xf'))('api');var utils=require(_0x7516('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x7516('0x11'));var db=require(_0x7516('0x12'))['db'];function respondWithStatusCode(_0x590c1b,_0xf68526){_0xf68526=_0xf68526||0xcc;return function(_0x44defb){if(_0x44defb){return _0x590c1b[_0x7516('0x13')](_0xf68526);}return _0x590c1b['status'](_0xf68526)[_0x7516('0x14')]();};}function respondWithResult(_0x40dab4,_0x360568){_0x360568=_0x360568||0xc8;return function(_0x277c40){if(_0x277c40){return _0x40dab4[_0x7516('0x15')](_0x360568)[_0x7516('0x16')](_0x277c40);}};}function respondWithFilteredResult(_0x4a9c1d,_0x316614){return function(_0x35f1fc){if(_0x35f1fc){var _0x1a0e4e=typeof _0x316614['offset']===_0x7516('0x17')&&typeof _0x316614['limit']===_0x7516('0x17');var _0xc59390=_0x35f1fc[_0x7516('0x18')];var _0x1eb28c=_0x1a0e4e?0x0:_0x316614[_0x7516('0x19')];var _0x4c70d8=_0x1a0e4e?_0x35f1fc[_0x7516('0x18')]:_0x316614[_0x7516('0x19')]+_0x316614[_0x7516('0x1a')];var _0x17f943;if(_0x4c70d8>=_0xc59390){_0x4c70d8=_0xc59390;_0x17f943=0xc8;}else{_0x17f943=0xce;}_0x4a9c1d[_0x7516('0x15')](_0x17f943);return _0x4a9c1d['set'](_0x7516('0x1b'),_0x1eb28c+'-'+_0x4c70d8+'/'+_0xc59390)[_0x7516('0x16')](_0x35f1fc);}return null;};}function patchUpdates(_0xfb2eff){return function(_0x2f01b4){try{jsonpatch[_0x7516('0x1c')](_0x2f01b4,_0xfb2eff,!![]);}catch(_0x77fbb4){return BPromise['reject'](_0x77fbb4);}return _0x2f01b4['save']();};}function saveUpdates(_0x51bc5a,_0x52741a){return function(_0x2eca06){if(_0x2eca06){return _0x2eca06[_0x7516('0x1d')](_0x51bc5a)[_0x7516('0x1e')](function(_0x451b6c){return _0x451b6c;});}return null;};}function removeEntity(_0x8fcd51,_0x4a91d){return function(_0x5407cb){if(_0x5407cb){return _0x5407cb[_0x7516('0x1f')]()[_0x7516('0x1e')](function(){var _0x3835ea=_0x5407cb[_0x7516('0x20')]({'plain':!![]});var _0x541cf9='Scheduler';return db[_0x7516('0x21')][_0x7516('0x1f')]({'where':{'type':_0x541cf9,'resourceId':_0x3835ea['id']}})[_0x7516('0x1e')](function(){return _0x5407cb;});})['then'](function(){_0x8fcd51[_0x7516('0x15')](0xcc)[_0x7516('0x14')]();});}};}function handleEntityNotFound(_0xc79bb2,_0x543327){return function(_0x41edf7){if(!_0x41edf7){_0xc79bb2[_0x7516('0x13')](0x194);}return _0x41edf7;};}function handleError(_0x29ef30,_0x35e9c2){_0x35e9c2=_0x35e9c2||0x1f4;return function(_0x540166){logger['error'](_0x540166[_0x7516('0x22')]);if(_0x540166['name']){delete _0x540166['name'];}_0x29ef30[_0x7516('0x15')](_0x35e9c2)[_0x7516('0x23')](_0x540166);};}exports['index']=function(_0x1b581f,_0x135c16){var _0x575647={},_0xd87dfe={},_0x537fbe={'count':0x0,'rows':[]};var _0x563b9d=_[_0x7516('0x24')](db[_0x7516('0x25')][_0x7516('0x26')],function(_0x2441eb){return{'name':_0x2441eb[_0x7516('0x27')],'type':_0x2441eb[_0x7516('0x28')][_0x7516('0x29')]};});_0xd87dfe[_0x7516('0x2a')]=_[_0x7516('0x24')](_0x563b9d,_0x7516('0x2b'));_0xd87dfe['query']=_[_0x7516('0x2c')](_0x1b581f[_0x7516('0x2d')]);_0xd87dfe[_0x7516('0x2e')]=_['intersection'](_0xd87dfe[_0x7516('0x2a')],_0xd87dfe[_0x7516('0x2d')]);_0x575647['attributes']=_[_0x7516('0x2f')](_0xd87dfe['model'],qs[_0x7516('0x30')](_0x1b581f['query'][_0x7516('0x30')]));_0x575647[_0x7516('0x31')]=_0x575647[_0x7516('0x31')][_0x7516('0x32')]?_0x575647[_0x7516('0x31')]:_0xd87dfe[_0x7516('0x2a')];if(!_0x1b581f[_0x7516('0x2d')]['hasOwnProperty'](_0x7516('0x33'))){_0x575647[_0x7516('0x1a')]=qs[_0x7516('0x1a')](_0x1b581f[_0x7516('0x2d')][_0x7516('0x1a')]);_0x575647[_0x7516('0x19')]=qs[_0x7516('0x19')](_0x1b581f[_0x7516('0x2d')][_0x7516('0x19')]);}_0x575647['order']=qs['sort'](_0x1b581f['query']['sort']);_0x575647[_0x7516('0x34')]=qs[_0x7516('0x2e')](_['pick'](_0x1b581f[_0x7516('0x2d')],_0xd87dfe[_0x7516('0x2e')]),_0x563b9d);if(_0x1b581f['query'][_0x7516('0x35')]){_0x575647['where']=_[_0x7516('0x36')](_0x575647[_0x7516('0x34')],{'$or':_[_0x7516('0x24')](_0x563b9d,function(_0x2595f8){if(_0x2595f8[_0x7516('0x28')]!==_0x7516('0x37')){var _0x3664f7={};_0x3664f7[_0x2595f8[_0x7516('0x2b')]]={'$like':'%'+_0x1b581f[_0x7516('0x2d')]['filter']+'%'};return _0x3664f7;}})});}_0x575647=_['merge']({},_0x575647,_0x1b581f[_0x7516('0x38')]);var _0x2b640b={'where':_0x575647[_0x7516('0x34')]};return db[_0x7516('0x25')][_0x7516('0x18')](_0x2b640b)[_0x7516('0x1e')](function(_0x1b7fa7){_0x537fbe[_0x7516('0x18')]=_0x1b7fa7;if(_0x1b581f[_0x7516('0x2d')][_0x7516('0x39')]){_0x575647[_0x7516('0x3a')]=[{'all':!![]}];}return db[_0x7516('0x25')][_0x7516('0x3b')](_0x575647);})[_0x7516('0x1e')](function(_0x38c264){_0x537fbe[_0x7516('0x3c')]=_0x38c264;return _0x537fbe;})[_0x7516('0x1e')](respondWithFilteredResult(_0x135c16,_0x575647))[_0x7516('0x3d')](handleError(_0x135c16,null));};exports['show']=function(_0x6934b,_0x33eea7){var _0x24f761={'raw':![],'where':{'id':_0x6934b['params']['id']}},_0x143ecd={};_0x143ecd[_0x7516('0x2a')]=_[_0x7516('0x2c')](db[_0x7516('0x25')]['rawAttributes']);_0x143ecd[_0x7516('0x2d')]=_[_0x7516('0x2c')](_0x6934b['query']);_0x143ecd['filters']=_[_0x7516('0x2f')](_0x143ecd['model'],_0x143ecd[_0x7516('0x2d')]);_0x24f761['attributes']=_['intersection'](_0x143ecd[_0x7516('0x2a')],qs[_0x7516('0x30')](_0x6934b[_0x7516('0x2d')][_0x7516('0x30')]));_0x24f761['attributes']=_0x24f761[_0x7516('0x31')]['length']?_0x24f761['attributes']:_0x143ecd[_0x7516('0x2a')];if(_0x6934b[_0x7516('0x2d')][_0x7516('0x39')]){_0x24f761['include']=[{'all':!![]}];}_0x24f761=_[_0x7516('0x36')]({},_0x24f761,_0x6934b['options']);return db['Schedule'][_0x7516('0x3e')](_0x24f761)[_0x7516('0x1e')](handleEntityNotFound(_0x33eea7,null))['then'](respondWithResult(_0x33eea7,null))[_0x7516('0x3d')](handleError(_0x33eea7,null));};exports[_0x7516('0x3f')]=function(_0x591062,_0x9077ef){return db[_0x7516('0x25')][_0x7516('0x3f')](_0x591062[_0x7516('0x40')],{})[_0x7516('0x1e')](function(_0x3b7394){var _0xabc0f5=_0x591062['user'][_0x7516('0x20')]({'plain':!![]});if(!_0xabc0f5)throw new Error(_0x7516('0x41'));if(_0xabc0f5['role']===_0x7516('0x42')){var _0x43fe95=_0x3b7394[_0x7516('0x20')]({'plain':!![]});var _0x5d5d63=_0x7516('0x43');return db[_0x7516('0x44')]['find']({'where':{'name':_0x5d5d63,'userProfileId':_0xabc0f5[_0x7516('0x45')]},'raw':!![]})['then'](function(_0x517281){if(_0x517281&&_0x517281[_0x7516('0x46')]===0x0){return db[_0x7516('0x21')][_0x7516('0x3f')]({'name':_0x43fe95[_0x7516('0x2b')],'resourceId':_0x43fe95['id'],'type':_0x517281['name'],'sectionId':_0x517281['id']},{})[_0x7516('0x1e')](function(){return _0x3b7394;});}else{return _0x3b7394;}})[_0x7516('0x3d')](function(_0x514fc5){logger[_0x7516('0x47')](_0x7516('0x48'),_0x514fc5);throw _0x514fc5;});}return _0x3b7394;})[_0x7516('0x1e')](respondWithResult(_0x9077ef,0xc9))[_0x7516('0x3d')](handleError(_0x9077ef,null));};exports[_0x7516('0x1d')]=function(_0x50f2e8,_0x5b54e3){if(_0x50f2e8[_0x7516('0x40')]['id']){delete _0x50f2e8['body']['id'];}return db[_0x7516('0x25')][_0x7516('0x3e')]({'where':{'id':_0x50f2e8[_0x7516('0x49')]['id']}})[_0x7516('0x1e')](handleEntityNotFound(_0x5b54e3,null))['then'](saveUpdates(_0x50f2e8[_0x7516('0x40')],null))[_0x7516('0x1e')](respondWithResult(_0x5b54e3,null))[_0x7516('0x3d')](handleError(_0x5b54e3,null));};exports[_0x7516('0x1f')]=function(_0x32a38c,_0x7b8c4f){return db[_0x7516('0x25')][_0x7516('0x3e')]({'where':{'id':_0x32a38c['params']['id']}})['then'](handleEntityNotFound(_0x7b8c4f,null))['then'](removeEntity(_0x7b8c4f,null))[_0x7516('0x3d')](handleError(_0x7b8c4f,null));};exports[_0x7516('0x4a')]=function(_0x1f8820,_0x94eca5,_0x204d6b){var _0x31cd0f=require(_0x7516('0x4b'));return db['Schedule'][_0x7516('0x3e')]({'where':{'id':_0x1f8820['params']['id']},'raw':!![]})[_0x7516('0x1e')](handleEntityNotFound(_0x94eca5,null))[_0x7516('0x1e')](function(){_0x31cd0f[_0x7516('0x4a')](_0x1f8820[_0x7516('0x49')]['id']);})[_0x7516('0x1e')](respondWithStatusCode(_0x94eca5,null))[_0x7516('0x3d')](handleError(_0x94eca5,null));}; \ No newline at end of file +var _0x226e=['filter','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','Scheduler','UserProfileResource','error','name','send','index','map','Schedule','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick'];(function(_0xecf4ff,_0x2cb924){var _0x5cec56=function(_0x1e6835){while(--_0x1e6835){_0xecf4ff['push'](_0xecf4ff['shift']());}};_0x5cec56(++_0x2cb924);}(_0x226e,0x154));var _0xe226=function(_0x1de2da,_0x189272){_0x1de2da=_0x1de2da-0x0;var _0x43f877=_0x226e[_0x1de2da];return _0x43f877;};'use strict';var emlformat=require(_0xe226('0x0'));var rimraf=require(_0xe226('0x1'));var zipdir=require(_0xe226('0x2'));var jsonpatch=require(_0xe226('0x3'));var rp=require(_0xe226('0x4'));var moment=require(_0xe226('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe226('0x6'));var util=require(_0xe226('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe226('0x8'));var fs=require('fs');var fs_extra=require(_0xe226('0x9'));var _=require(_0xe226('0xa'));var squel=require(_0xe226('0xb'));var crypto=require(_0xe226('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe226('0xd'));var toCsv=require(_0xe226('0xe'));var querystring=require(_0xe226('0xf'));var Papa=require(_0xe226('0x10'));var Redis=require(_0xe226('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe226('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe226('0x13'));var logger=require('../../config/logger')(_0xe226('0x14'));var utils=require('../../config/utils');var config=require(_0xe226('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe226('0x16'))['db'];function respondWithStatusCode(_0x5114dd,_0x4e6aab){_0x4e6aab=_0x4e6aab||0xcc;return function(_0x440a02){if(_0x440a02){return _0x5114dd[_0xe226('0x17')](_0x4e6aab);}return _0x5114dd[_0xe226('0x18')](_0x4e6aab)[_0xe226('0x19')]();};}function respondWithResult(_0x861faf,_0x2ac5bd){_0x2ac5bd=_0x2ac5bd||0xc8;return function(_0x2e6015){if(_0x2e6015){return _0x861faf['status'](_0x2ac5bd)[_0xe226('0x1a')](_0x2e6015);}};}function respondWithFilteredResult(_0x34bf3a,_0x130d8a){return function(_0x521c49){if(_0x521c49){var _0x357c90=typeof _0x130d8a[_0xe226('0x1b')]===_0xe226('0x1c')&&typeof _0x130d8a[_0xe226('0x1d')]===_0xe226('0x1c');var _0x319d86=_0x521c49[_0xe226('0x1e')];var _0x12acf0=_0x357c90?0x0:_0x130d8a['offset'];var _0x1fa252=_0x357c90?_0x521c49[_0xe226('0x1e')]:_0x130d8a['offset']+_0x130d8a[_0xe226('0x1d')];var _0x5c80ac;if(_0x1fa252>=_0x319d86){_0x1fa252=_0x319d86;_0x5c80ac=0xc8;}else{_0x5c80ac=0xce;}_0x34bf3a['status'](_0x5c80ac);return _0x34bf3a[_0xe226('0x1f')](_0xe226('0x20'),_0x12acf0+'-'+_0x1fa252+'/'+_0x319d86)[_0xe226('0x1a')](_0x521c49);}return null;};}function patchUpdates(_0x556a11){return function(_0x36ef20){try{jsonpatch['apply'](_0x36ef20,_0x556a11,!![]);}catch(_0x29e134){return BPromise[_0xe226('0x21')](_0x29e134);}return _0x36ef20[_0xe226('0x22')]();};}function saveUpdates(_0x1da382,_0x2f7367){return function(_0xb44d91){if(_0xb44d91){return _0xb44d91['update'](_0x1da382)[_0xe226('0x23')](function(_0x149bf7){return _0x149bf7;});}return null;};}function removeEntity(_0x3ae698,_0x453af2){return function(_0x34d374){if(_0x34d374){return _0x34d374[_0xe226('0x24')]()[_0xe226('0x23')](function(){var _0x2117c6=_0x34d374['get']({'plain':!![]});var _0x41be85=_0xe226('0x25');return db[_0xe226('0x26')][_0xe226('0x24')]({'where':{'type':_0x41be85,'resourceId':_0x2117c6['id']}})['then'](function(){return _0x34d374;});})['then'](function(){_0x3ae698[_0xe226('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x246d11,_0xca0a9f){return function(_0x464a2a){if(!_0x464a2a){_0x246d11[_0xe226('0x17')](0x194);}return _0x464a2a;};}function handleError(_0x217ca3,_0x2b3411){_0x2b3411=_0x2b3411||0x1f4;return function(_0x2ce707){logger[_0xe226('0x27')](_0x2ce707['stack']);if(_0x2ce707['name']){delete _0x2ce707[_0xe226('0x28')];}_0x217ca3[_0xe226('0x18')](_0x2b3411)[_0xe226('0x29')](_0x2ce707);};}exports[_0xe226('0x2a')]=function(_0x30e29e,_0x12acf1){var _0x54ac45={},_0x30e78f={},_0x366be={'count':0x0,'rows':[]};var _0x8e21f5=_[_0xe226('0x2b')](db[_0xe226('0x2c')]['rawAttributes'],function(_0x4eef70){return{'name':_0x4eef70[_0xe226('0x2d')],'type':_0x4eef70[_0xe226('0x2e')][_0xe226('0x2f')]};});_0x30e78f[_0xe226('0x30')]=_[_0xe226('0x2b')](_0x8e21f5,_0xe226('0x28'));_0x30e78f[_0xe226('0x31')]=_[_0xe226('0x32')](_0x30e29e[_0xe226('0x31')]);_0x30e78f[_0xe226('0x33')]=_[_0xe226('0x34')](_0x30e78f[_0xe226('0x30')],_0x30e78f['query']);_0x54ac45[_0xe226('0x35')]=_['intersection'](_0x30e78f[_0xe226('0x30')],qs[_0xe226('0x36')](_0x30e29e[_0xe226('0x31')][_0xe226('0x36')]));_0x54ac45[_0xe226('0x35')]=_0x54ac45[_0xe226('0x35')][_0xe226('0x37')]?_0x54ac45[_0xe226('0x35')]:_0x30e78f[_0xe226('0x30')];if(!_0x30e29e[_0xe226('0x31')]['hasOwnProperty']('nolimit')){_0x54ac45[_0xe226('0x1d')]=qs[_0xe226('0x1d')](_0x30e29e['query'][_0xe226('0x1d')]);_0x54ac45[_0xe226('0x1b')]=qs[_0xe226('0x1b')](_0x30e29e['query'][_0xe226('0x1b')]);}_0x54ac45[_0xe226('0x38')]=qs[_0xe226('0x39')](_0x30e29e['query']['sort']);_0x54ac45[_0xe226('0x3a')]=qs[_0xe226('0x33')](_[_0xe226('0x3b')](_0x30e29e[_0xe226('0x31')],_0x30e78f[_0xe226('0x33')]),_0x8e21f5);if(_0x30e29e[_0xe226('0x31')][_0xe226('0x3c')]){_0x54ac45[_0xe226('0x3a')]=_['merge'](_0x54ac45[_0xe226('0x3a')],{'$or':_['map'](_0x8e21f5,function(_0x14932c){if(_0x14932c[_0xe226('0x2e')]!=='VIRTUAL'){var _0x5eaa62={};_0x5eaa62[_0x14932c[_0xe226('0x28')]]={'$like':'%'+_0x30e29e[_0xe226('0x31')]['filter']+'%'};return _0x5eaa62;}})});}_0x54ac45=_[_0xe226('0x3d')]({},_0x54ac45,_0x30e29e[_0xe226('0x3e')]);var _0x4dee84={'where':_0x54ac45[_0xe226('0x3a')]};return db[_0xe226('0x2c')][_0xe226('0x1e')](_0x4dee84)['then'](function(_0x575991){_0x366be[_0xe226('0x1e')]=_0x575991;if(_0x30e29e[_0xe226('0x31')][_0xe226('0x3f')]){_0x54ac45['include']=[{'all':!![]}];}return db[_0xe226('0x2c')][_0xe226('0x40')](_0x54ac45);})[_0xe226('0x23')](function(_0x25b1ac){_0x366be[_0xe226('0x41')]=_0x25b1ac;return _0x366be;})[_0xe226('0x23')](respondWithFilteredResult(_0x12acf1,_0x54ac45))[_0xe226('0x42')](handleError(_0x12acf1,null));};exports[_0xe226('0x43')]=function(_0x47787b,_0x2e756a){var _0x10fac9={'raw':![],'where':{'id':_0x47787b['params']['id']}},_0x1caa66={};_0x1caa66[_0xe226('0x30')]=_[_0xe226('0x32')](db[_0xe226('0x2c')]['rawAttributes']);_0x1caa66[_0xe226('0x31')]=_[_0xe226('0x32')](_0x47787b[_0xe226('0x31')]);_0x1caa66[_0xe226('0x33')]=_[_0xe226('0x34')](_0x1caa66['model'],_0x1caa66[_0xe226('0x31')]);_0x10fac9[_0xe226('0x35')]=_[_0xe226('0x34')](_0x1caa66['model'],qs[_0xe226('0x36')](_0x47787b['query']['fields']));_0x10fac9[_0xe226('0x35')]=_0x10fac9[_0xe226('0x35')][_0xe226('0x37')]?_0x10fac9['attributes']:_0x1caa66[_0xe226('0x30')];if(_0x47787b[_0xe226('0x31')][_0xe226('0x3f')]){_0x10fac9[_0xe226('0x44')]=[{'all':!![]}];}_0x10fac9=_[_0xe226('0x3d')]({},_0x10fac9,_0x47787b[_0xe226('0x3e')]);return db['Schedule'][_0xe226('0x45')](_0x10fac9)['then'](handleEntityNotFound(_0x2e756a,null))['then'](respondWithResult(_0x2e756a,null))[_0xe226('0x42')](handleError(_0x2e756a,null));};exports['create']=function(_0x4a338a,_0x57b4c1){return db[_0xe226('0x2c')][_0xe226('0x46')](_0x4a338a[_0xe226('0x47')],{})['then'](function(_0x69b75b){var _0x5bde85=_0x4a338a[_0xe226('0x48')][_0xe226('0x49')]({'plain':!![]});if(!_0x5bde85)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bde85['role']===_0xe226('0x48')){var _0xa1b413=_0x69b75b['get']({'plain':!![]});var _0x40e50f=_0xe226('0x25');return db[_0xe226('0x4a')][_0xe226('0x45')]({'where':{'name':_0x40e50f,'userProfileId':_0x5bde85['userProfileId']},'raw':!![]})[_0xe226('0x23')](function(_0x1c43c9){if(_0x1c43c9&&_0x1c43c9[_0xe226('0x4b')]===0x0){return db[_0xe226('0x26')]['create']({'name':_0xa1b413['name'],'resourceId':_0xa1b413['id'],'type':_0x1c43c9[_0xe226('0x28')],'sectionId':_0x1c43c9['id']},{})[_0xe226('0x23')](function(){return _0x69b75b;});}else{return _0x69b75b;}})[_0xe226('0x42')](function(_0x38df33){logger['error'](_0xe226('0x4c'),_0x38df33);throw _0x38df33;});}return _0x69b75b;})[_0xe226('0x23')](respondWithResult(_0x57b4c1,0xc9))[_0xe226('0x42')](handleError(_0x57b4c1,null));};exports['update']=function(_0x59f67b,_0x14733f){if(_0x59f67b[_0xe226('0x47')]['id']){delete _0x59f67b[_0xe226('0x47')]['id'];}return db[_0xe226('0x2c')][_0xe226('0x45')]({'where':{'id':_0x59f67b[_0xe226('0x4d')]['id']}})['then'](handleEntityNotFound(_0x14733f,null))[_0xe226('0x23')](saveUpdates(_0x59f67b[_0xe226('0x47')],null))[_0xe226('0x23')](respondWithResult(_0x14733f,null))['catch'](handleError(_0x14733f,null));};exports[_0xe226('0x24')]=function(_0x20485f,_0x433320){return db['Schedule'][_0xe226('0x45')]({'where':{'id':_0x20485f[_0xe226('0x4d')]['id']}})[_0xe226('0x23')](handleEntityNotFound(_0x433320,null))[_0xe226('0x23')](removeEntity(_0x433320,null))[_0xe226('0x42')](handleError(_0x433320,null));};exports[_0xe226('0x4e')]=function(_0x1d43c6,_0x3de3ec,_0x15a569){var _0x33c03d=require(_0xe226('0x4f'));return db[_0xe226('0x2c')]['find']({'where':{'id':_0x1d43c6[_0xe226('0x4d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3de3ec,null))[_0xe226('0x23')](function(){_0x33c03d[_0xe226('0x4e')](_0x1d43c6[_0xe226('0x4d')]['id']);})[_0xe226('0x23')](respondWithStatusCode(_0x3de3ec,null))['catch'](handleError(_0x3de3ec,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index cd71638..db2a3c1 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 _0x8899=['Schedule','tools_schedules','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x4b4ec5,_0x4e180a){var _0x3dee9a=function(_0x207ac6){while(--_0x207ac6){_0x4b4ec5['push'](_0x4b4ec5['shift']());}};_0x3dee9a(++_0x4e180a);}(_0x8899,0x115));var _0x9889=function(_0x5408df,_0x41630c){_0x5408df=_0x5408df-0x0;var _0x482959=_0x8899[_0x5408df];return _0x482959;};'use strict';var _=require(_0x9889('0x0'));var util=require('util');var logger=require(_0x9889('0x1'))('api');var moment=require(_0x9889('0x2'));var BPromise=require(_0x9889('0x3'));var rp=require(_0x9889('0x4'));var fs=require('fs');var path=require(_0x9889('0x5'));var rimraf=require('rimraf');var config=require(_0x9889('0x6'));var attributes=require('./schedule.attributes');module[_0x9889('0x7')]=function(_0x15fb08,_0x515025){return _0x15fb08[_0x9889('0x8')](_0x9889('0x9'),attributes,{'tableName':_0x9889('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5815=['./schedule.attributes','exports','tools_schedules','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3604bc,_0x33ed46){var _0x29cf6c=function(_0x525355){while(--_0x525355){_0x3604bc['push'](_0x3604bc['shift']());}};_0x29cf6c(++_0x33ed46);}(_0x5815,0x150));var _0x5581=function(_0x43db86,_0x34184b){_0x43db86=_0x43db86-0x0;var _0x27bda2=_0x5815[_0x43db86];return _0x27bda2;};'use strict';var _=require('lodash');var util=require(_0x5581('0x0'));var logger=require(_0x5581('0x1'))('api');var moment=require(_0x5581('0x2'));var BPromise=require(_0x5581('0x3'));var rp=require(_0x5581('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5581('0x5'));var config=require('../../config/environment');var attributes=require(_0x5581('0x6'));module[_0x5581('0x7')]=function(_0x573042,_0x1f7eb9){return _0x573042['define']('Schedule',attributes,{'tableName':_0x5581('0x8'),'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 77b995c..c980efa 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 _0xef67=['jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2b6b56,_0xce8600){var _0x171d60=function(_0x3d3162){while(--_0x3d3162){_0x2b6b56['push'](_0x2b6b56['shift']());}};_0x171d60(++_0xce8600);}(_0xef67,0x150));var _0x7ef6=function(_0x239eaf,_0x1968b4){_0x239eaf=_0x239eaf-0x0;var _0x8863f7=_0xef67[_0x239eaf];return _0x8863f7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7ef6('0x0'));var BPromise=require(_0x7ef6('0x1'));var rs=require(_0x7ef6('0x2'));var fs=require('fs');var Redis=require(_0x7ef6('0x3'));var db=require(_0x7ef6('0x4'))['db'];var utils=require(_0x7ef6('0x5'));var logger=require(_0x7ef6('0x6'))(_0x7ef6('0x7'));var config=require(_0x7ef6('0x8'));var jayson=require(_0x7ef6('0x9'));var client=jayson[_0x7ef6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f8892,_0xb92472,_0xb0c202){return new BPromise(function(_0x153867,_0x4a9b71){return client[_0x7ef6('0xb')](_0x2f8892,_0xb0c202)[_0x7ef6('0xc')](function(_0xa68853){logger[_0x7ef6('0xd')](_0x7ef6('0xe'),_0xb92472,_0x7ef6('0xf'));logger[_0x7ef6('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0xb92472,_0x7ef6('0xf'),JSON[_0x7ef6('0x11')](_0xa68853));if(_0xa68853['error']){if(_0xa68853[_0x7ef6('0x12')][_0x7ef6('0x13')]===0x1f4){logger[_0x7ef6('0x12')](_0x7ef6('0xe'),_0xb92472,_0xa68853['error']['message']);return _0x4a9b71(_0xa68853['error'][_0x7ef6('0x14')]);}logger[_0x7ef6('0x12')](_0x7ef6('0xe'),_0xb92472,_0xa68853['error'][_0x7ef6('0x14')]);return _0x153867(_0xa68853[_0x7ef6('0x12')]['message']);}else{logger[_0x7ef6('0xd')](_0x7ef6('0xe'),_0xb92472,'request\x20sent');_0x153867(_0xa68853[_0x7ef6('0x15')][_0x7ef6('0x14')]);}})[_0x7ef6('0x16')](function(_0x4af514){logger[_0x7ef6('0x12')](_0x7ef6('0xe'),_0xb92472,_0x4af514);_0x4a9b71(_0x4af514);});});} \ No newline at end of file +var _0xb915=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x47e306,_0x4521e5){var _0x50d98b=function(_0x199068){while(--_0x199068){_0x47e306['push'](_0x47e306['shift']());}};_0x50d98b(++_0x4521e5);}(_0xb915,0x1af));var _0x5b91=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xb915[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x5b91('0x0'));var util=require(_0x5b91('0x1'));var moment=require(_0x5b91('0x2'));var BPromise=require(_0x5b91('0x3'));var rs=require(_0x5b91('0x4'));var fs=require('fs');var Redis=require(_0x5b91('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b91('0x6'));var logger=require('../../config/logger')(_0x5b91('0x7'));var config=require(_0x5b91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b91('0x9')][_0x5b91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x125197,_0x306ec8,_0x3f1517){return new BPromise(function(_0x8524e2,_0x8fa4da){return client[_0x5b91('0xb')](_0x125197,_0x3f1517)[_0x5b91('0xc')](function(_0x56924b){logger[_0x5b91('0xd')](_0x5b91('0xe'),_0x306ec8,'request\x20sent');logger[_0x5b91('0xf')](_0x5b91('0x10'),_0x306ec8,_0x5b91('0x11'),JSON[_0x5b91('0x12')](_0x56924b));if(_0x56924b[_0x5b91('0x13')]){if(_0x56924b[_0x5b91('0x13')][_0x5b91('0x14')]===0x1f4){logger['error'](_0x5b91('0xe'),_0x306ec8,_0x56924b[_0x5b91('0x13')][_0x5b91('0x15')]);return _0x8fa4da(_0x56924b[_0x5b91('0x13')][_0x5b91('0x15')]);}logger[_0x5b91('0x13')]('Schedule,\x20%s,\x20%s',_0x306ec8,_0x56924b['error'][_0x5b91('0x15')]);return _0x8524e2(_0x56924b[_0x5b91('0x13')][_0x5b91('0x15')]);}else{logger[_0x5b91('0xd')]('Schedule,\x20%s,\x20%s',_0x306ec8,'request\x20sent');_0x8524e2(_0x56924b[_0x5b91('0x16')][_0x5b91('0x15')]);}})['catch'](function(_0x18a69e){logger[_0x5b91('0x13')](_0x5b91('0xe'),_0x306ec8,_0x18a69e);_0x8fa4da(_0x18a69e);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 1e52159..eba10c5 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 _0x9661=['/:id','show','/:id/download','download','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe','describe'];(function(_0x2a5af4,_0x320d59){var _0x53f644=function(_0x3f2e7b){while(--_0x3f2e7b){_0x2a5af4['push'](_0x2a5af4['shift']());}};_0x53f644(++_0x320d59);}(_0x9661,0xdb));var _0x1966=function(_0x37c516,_0x2fe54a){_0x37c516=_0x37c516-0x0;var _0x1413ac=_0x9661[_0x37c516];return _0x1413ac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1966('0x0'));var timeout=require(_0x1966('0x1'));var express=require(_0x1966('0x2'));var router=express[_0x1966('0x3')]();var fs_extra=require(_0x1966('0x4'));var auth=require(_0x1966('0x5'));var interaction=require(_0x1966('0x6'));var config=require('../../config/environment');var controller=require(_0x1966('0x7'));router[_0x1966('0x8')]('/',auth[_0x1966('0x9')](),controller['index']);router[_0x1966('0x8')](_0x1966('0xa'),auth['isAuthenticated'](),controller[_0x1966('0xb')]);router[_0x1966('0x8')](_0x1966('0xc'),auth[_0x1966('0x9')](),controller[_0x1966('0xd')]);router['get'](_0x1966('0xe'),auth[_0x1966('0x9')](),controller[_0x1966('0xf')]);router[_0x1966('0x10')]('/',auth[_0x1966('0x9')](),controller[_0x1966('0x11')]);router[_0x1966('0x12')](_0x1966('0xc'),auth[_0x1966('0x9')](),controller['update']);router['delete'](_0x1966('0xc'),auth[_0x1966('0x9')](),controller[_0x1966('0x13')]);module[_0x1966('0x14')]=router; \ No newline at end of file +var _0x2113=['./screenRecording.controller','isAuthenticated','get','/describe','describe','/:id','show','download','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x44a210,_0x17928c){var _0x5f1f4e=function(_0x46969){while(--_0x46969){_0x44a210['push'](_0x44a210['shift']());}};_0x5f1f4e(++_0x17928c);}(_0x2113,0xca));var _0x3211=function(_0x266300,_0x353043){_0x266300=_0x266300-0x0;var _0x4fc468=_0x2113[_0x266300];return _0x4fc468;};'use strict';var multer=require('multer');var util=require(_0x3211('0x0'));var path=require('path');var timeout=require(_0x3211('0x1'));var express=require(_0x3211('0x2'));var router=express[_0x3211('0x3')]();var fs_extra=require(_0x3211('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3211('0x5'));var config=require(_0x3211('0x6'));var controller=require(_0x3211('0x7'));router['get']('/',auth[_0x3211('0x8')](),controller['index']);router[_0x3211('0x9')](_0x3211('0xa'),auth[_0x3211('0x8')](),controller[_0x3211('0xb')]);router[_0x3211('0x9')](_0x3211('0xc'),auth[_0x3211('0x8')](),controller[_0x3211('0xd')]);router['get']('/:id/download',auth[_0x3211('0x8')](),controller[_0x3211('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3211('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3211('0x10')](_0x3211('0xc'),auth[_0x3211('0x8')](),controller[_0x3211('0x11')]);module[_0x3211('0x12')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index b786708..7893650 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 _0xf0f1=['setDataValue','INTEGER','startedAt','subtract','closedAt','duration','MM-DD-YYYY\x20HH:mm','toString','DATE','format','createdAt','updatedAt','moment','path','../../config/environment','getDataValue','extname','value','STRING','replace'];(function(_0x4279b6,_0x6dbf0d){var _0x5a5fe6=function(_0x4a418f){while(--_0x4a418f){_0x4279b6['push'](_0x4279b6['shift']());}};_0x5a5fe6(++_0x6dbf0d);}(_0xf0f1,0x110));var _0x1f0f=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0xf0f1[_0x4defd6];return _0x4c9276;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1f0f('0x0'));var path=require(_0x1f0f('0x1'));var config=require(_0x1f0f('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1f0f('0x3')]('value')?path[_0x1f0f('0x4')](this['getDataValue'](_0x1f0f('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x1f0f('0x6')]},'channel':{'type':Sequelize[_0x1f0f('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x145125){var _0x31266f=_0x145125[_0x1f0f('0x7')](/\\/g,'/');this[_0x1f0f('0x8')](_0x1f0f('0x5'),_0x31266f);}},'rating':{'type':Sequelize[_0x1f0f('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1f0f('0x9')],'set':function(_0x4ed5fb){this['setDataValue'](_0x1f0f('0xa'),moment()[_0x1f0f('0xb')](_0x4ed5fb,'ms'));this['setDataValue'](_0x1f0f('0xc'),moment());this[_0x1f0f('0x8')](_0x1f0f('0xd'),_0x4ed5fb);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x1f0f('0xa')))['format'](_0x1f0f('0xe'))[_0x1f0f('0xf')]();}},'closedAt':{'type':Sequelize[_0x1f0f('0x10')],'get':function(){return moment(this[_0x1f0f('0x3')](_0x1f0f('0xc')))[_0x1f0f('0x11')](_0x1f0f('0xe'))[_0x1f0f('0xf')]();}},'createdAt':{'type':Sequelize[_0x1f0f('0x10')],'get':function(){return moment(this[_0x1f0f('0x3')](_0x1f0f('0x12')))[_0x1f0f('0x11')](_0x1f0f('0xe'))[_0x1f0f('0xf')]();}},'updatedAt':{'type':Sequelize[_0x1f0f('0x10')],'get':function(){return moment(this['getDataValue'](_0x1f0f('0x13')))[_0x1f0f('0x11')](_0x1f0f('0xe'))[_0x1f0f('0xf')]();}}}; \ No newline at end of file +var _0xab75=['startedAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','moment','path','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration'];(function(_0x51cabf,_0x2828db){var _0x517538=function(_0x24a966){while(--_0x24a966){_0x51cabf['push'](_0x51cabf['shift']());}};_0x517538(++_0x2828db);}(_0xab75,0x11f));var _0x5ab7=function(_0x2c9eed,_0x3159ee){_0x2c9eed=_0x2c9eed-0x0;var _0x4eb3b4=_0xab75[_0x2c9eed];return _0x4eb3b4;};'use strict';var Sequelize=require(_0x5ab7('0x0'));var moment=require(_0x5ab7('0x1'));var path=require(_0x5ab7('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x5ab7('0x3')],'get':function(){return this[_0x5ab7('0x4')](_0x5ab7('0x5'))?path['extname'](this[_0x5ab7('0x4')](_0x5ab7('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x5ab7('0x6')]},'channel':{'type':Sequelize[_0x5ab7('0x6')]},'value':{'type':Sequelize[_0x5ab7('0x6')],'set':function(_0x32b338){var _0x229f83=_0x32b338[_0x5ab7('0x7')](/\\/g,'/');this[_0x5ab7('0x8')](_0x5ab7('0x5'),_0x229f83);}},'rating':{'type':Sequelize[_0x5ab7('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x216796){this[_0x5ab7('0x8')]('startedAt',moment()[_0x5ab7('0xa')](_0x216796,'ms'));this[_0x5ab7('0x8')](_0x5ab7('0xb'),moment());this[_0x5ab7('0x8')](_0x5ab7('0xc'),_0x216796);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x5ab7('0xd')))[_0x5ab7('0xe')](_0x5ab7('0xf'))[_0x5ab7('0x10')]();}},'closedAt':{'type':Sequelize[_0x5ab7('0x11')],'get':function(){return moment(this[_0x5ab7('0x4')](_0x5ab7('0xb')))[_0x5ab7('0xe')](_0x5ab7('0xf'))[_0x5ab7('0x10')]();}},'createdAt':{'type':Sequelize[_0x5ab7('0x11')],'get':function(){return moment(this['getDataValue'](_0x5ab7('0x12')))[_0x5ab7('0xe')](_0x5ab7('0xf'))[_0x5ab7('0x10')]();}},'updatedAt':{'type':Sequelize[_0x5ab7('0x11')],'get':function(){return moment(this[_0x5ab7('0x4')](_0x5ab7('0x13')))[_0x5ab7('0xe')](_0x5ab7('0xf'))[_0x5ab7('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index a240841..5f3a9eb 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 _0x7fbe=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','format','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','find','catch','create','body','duration','createdAt','closedAt','params','describe','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3ccd99,_0x337b62){var _0x153cb3=function(_0x3c0aca){while(--_0x3c0aca){_0x3ccd99['push'](_0x3ccd99['shift']());}};_0x153cb3(++_0x337b62);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x30b2c6,_0x1eafe8){_0x30b2c6=_0x30b2c6-0x0;var _0x42052d=_0x7fbe[_0x30b2c6];return _0x42052d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['differenceBy'](_[_0xe7fb('0x2c')](_0x219554,'name'),[_0xe7fb('0x32')]);_0xd3fffe[_0xe7fb('0x33')]=_[_0xe7fb('0x34')](_0x4fd290[_0xe7fb('0x33')]);_0xd3fffe['filters']=_[_0xe7fb('0x35')](_0xd3fffe[_0xe7fb('0x36')],_0xd3fffe[_0xe7fb('0x33')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xd3fffe['model'],qs[_0xe7fb('0x38')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x39')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x36')];if(!_0x4fd290[_0xe7fb('0x33')]['hasOwnProperty'](_0xe7fb('0x3a'))){_0x251807[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x4fd290['query'][_0xe7fb('0x20')]);_0x251807[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x3c')]);_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x4fd290[_0xe7fb('0x33')],_0xd3fffe[_0xe7fb('0x3e')]),_0x219554);if(_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x251807[_0xe7fb('0x3d')]=_[_0xe7fb('0x41')](_0x251807[_0xe7fb('0x3d')],{'$or':_['map'](_0x219554,function(_0x261ec5){if(_0x261ec5[_0xe7fb('0x30')]!==_0xe7fb('0x42')){var _0x444f98={};_0x444f98[_0x261ec5['name']]={'$like':'%'+_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x444f98;}})});}_0x251807=_[_0xe7fb('0x41')]({},_0x251807,_0x4fd290[_0xe7fb('0x43')]);var _0x49fe9d={'where':_0x251807[_0xe7fb('0x3d')]};return db[_0xe7fb('0x2d')][_0xe7fb('0x21')](_0x49fe9d)[_0xe7fb('0x26')](function(_0x468d16){_0x5f265f[_0xe7fb('0x21')]=_0x468d16;if(_0x4fd290['query'][_0xe7fb('0x44')]){_0x251807[_0xe7fb('0x45')]=[{'all':!![]}];}return db[_0xe7fb('0x2d')]['findAll'](_0x251807);})[_0xe7fb('0x26')](function(_0x3a8c52){_0x5f265f['rows']=_0x3a8c52;return _0x5f265f;})['then'](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5e0153,_0x900d67){var _0x957ca3={'raw':![],'where':{'id':_0x5e0153['params']['id']}},_0xed62e9={};_0xed62e9[_0xe7fb('0x36')]=_['keys'](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')]);_0xed62e9['query']=_[_0xe7fb('0x34')](_0x5e0153[_0xe7fb('0x33')]);_0xed62e9[_0xe7fb('0x3e')]=_[_0xe7fb('0x35')](_0xed62e9['model'],_0xed62e9[_0xe7fb('0x33')]);_0x957ca3[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xed62e9['model'],qs[_0xe7fb('0x38')](_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x957ca3[_0xe7fb('0x37')]=_0x957ca3[_0xe7fb('0x37')]['length']?_0x957ca3[_0xe7fb('0x37')]:_0xed62e9['model'];if(_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x44')]){_0x957ca3[_0xe7fb('0x45')]=[{'all':!![]}];}_0x957ca3=_[_0xe7fb('0x41')]({},_0x957ca3,_0x5e0153[_0xe7fb('0x43')]);return db['ScreenRecording'][_0xe7fb('0x46')](_0x957ca3)['then'](handleEntityNotFound(_0x900d67,null))['then'](respondWithResult(_0x900d67,null))[_0xe7fb('0x47')](handleError(_0x900d67,null));};exports[_0xe7fb('0x48')]=function(_0x16327f,_0x589555){return db[_0xe7fb('0x2d')][_0xe7fb('0x48')](_0x16327f['body'],{})['then'](respondWithResult(_0x589555,0xc9))[_0xe7fb('0x47')](handleError(_0x589555,null));};exports[_0xe7fb('0x25')]=function(_0x1cbf34,_0x3dd6bf){if(_0x1cbf34[_0xe7fb('0x49')]['id']){delete _0x1cbf34[_0xe7fb('0x49')]['id'];}delete _0x1cbf34[_0xe7fb('0x49')][_0xe7fb('0x4a')];delete _0x1cbf34['body'][_0xe7fb('0x4b')];delete _0x1cbf34['body'][_0xe7fb('0x4c')];delete _0x1cbf34[_0xe7fb('0x49')]['value'];return db[_0xe7fb('0x2d')]['find']({'where':{'id':_0x1cbf34[_0xe7fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3dd6bf,null))[_0xe7fb('0x26')](saveUpdates(_0x1cbf34['body'],null))[_0xe7fb('0x26')](respondWithResult(_0x3dd6bf,null))['catch'](handleError(_0x3dd6bf,null));};exports[_0xe7fb('0x4e')]=function(_0x1b6442,_0x41fcfb){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x41fcfb,null))[_0xe7fb('0x47')](handleError(_0x41fcfb,null));};exports['download']=function(_0x5d20dc,_0x20aa55,_0x4948a7){var _0x4f4240=require('../../components/encryptor');var _0x50b8df=![];var _0x539252={};if(_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]&&_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]==='uniqueid'){_0x539252[_0xe7fb('0x4f')]=_0x5d20dc[_0xe7fb('0x4d')]['id'];}else{_0x539252['id']=_0x5d20dc[_0xe7fb('0x4d')]['id'];}return db['ScreenRecording']['find']({'where':_0x539252,'attributes':['id',_0xe7fb('0x50')],'raw':!![]})[_0xe7fb('0x26')](handleEntityNotFound(_0x20aa55,null))[_0xe7fb('0x26')](function(_0x4f4ba3){if(_0x4f4ba3){var _0x27f860=path[_0xe7fb('0x51')](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x4f4ba3['value']);var _0x4b35f9=util[_0xe7fb('0x32')](_0xe7fb('0x54'),_0x27f860);if(fs[_0xe7fb('0x55')](_0x4b35f9)){_0x50b8df=!![];return _0x4f4240[_0xe7fb('0x56')](_0x4b35f9,_0x27f860,config[_0xe7fb('0x57')]['recording'])[_0xe7fb('0x26')](function(){return _0x4f4ba3;});}return _0x4f4ba3;}})[_0xe7fb('0x26')](function(_0x23755b){if(_0x23755b){var _0x590d7a=path['join'](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x23755b[_0xe7fb('0x50')]);if(!fs[_0xe7fb('0x55')](_0x590d7a)){throw new db[(_0xe7fb('0x58'))][(_0xe7fb('0x59'))]('ScreenRecording\x20not\x20found');}if(_0x23755b[_0xe7fb('0x5a')]){return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,_0x23755b[_0xe7fb('0x5a')]+path[_0xe7fb('0x5c')](_0x590d7a),function(){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}else{return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,function(_0x554092){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}}})['catch'](function(_0x1eda1d){if(_0x1eda1d[_0xe7fb('0x5e')]===_0xe7fb('0x5f')){_0x20aa55[_0xe7fb('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x20aa55,null);}});};exports[_0xe7fb('0x60')]=function(_0x11e15a,_0x25aeb2){return db[_0xe7fb('0x2d')][_0xe7fb('0x46')]({'where':{'id':_0x11e15a['params']['id']}})[_0xe7fb('0x26')](function(_0x58d4ec){if(_[_0xe7fb('0x61')](_0x58d4ec)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58d4ec;})['then'](function(_0xc13fac){var _0x203da3=path[_0xe7fb('0x51')](config['root'],_0xe7fb('0x53'),_0xc13fac[_0xe7fb('0x50')]);logger[_0xe7fb('0x62')](_0xe7fb('0x63'),_0x203da3);if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')]('File:\x20\x22'+_0x203da3+_0xe7fb('0x64'));fs[_0xe7fb('0x65')](_0x203da3);}_0x203da3=_0x203da3+'.cypher';if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')](_0xe7fb('0x66')+_0x203da3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7fb('0x65')](_0x203da3);}return _0xc13fac;})[_0xe7fb('0x26')](function(_0x2c558a){if(!_0x2c558a)throw new InternalError();return _0x2c558a[_0xe7fb('0x60')]();})[_0xe7fb('0x26')](function(){_0x25aeb2[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();})[_0xe7fb('0x47')](handleError(_0x25aeb2,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(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x46ed[_0x1cc8fe];return _0x230054;};'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 c0c8667..10df445 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 _0x0499=['rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x0499,0x1ab));var _0x9049=function(_0x434c97,_0x1c65ac){_0x434c97=_0x434c97-0x0;var _0x5638f3=_0x0499[_0x434c97];return _0x5638f3;};'use strict';var _=require(_0x9049('0x0'));var util=require(_0x9049('0x1'));var logger=require(_0x9049('0x2'))('api');var moment=require(_0x9049('0x3'));var BPromise=require(_0x9049('0x4'));var rp=require(_0x9049('0x5'));var fs=require('fs');var path=require(_0x9049('0x6'));var rimraf=require(_0x9049('0x7'));var config=require('../../config/environment');var attributes=require(_0x9049('0x8'));module[_0x9049('0x9')]=function(_0x3e392e,_0x219d72){return _0x3e392e[_0x9049('0xa')](_0x9049('0xb'),attributes,{'tableName':_0x9049('0xc'),'paranoid':![],'indexes':[{'name':_0x9049('0xd'),'fields':[_0x9049('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad0a=['rimraf','../../config/environment','./screenRecording.attributes','define','screen_recordings','interactionid','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x902278,_0x144072){var _0x537e87=function(_0x2a30bf){while(--_0x2a30bf){_0x902278['push'](_0x902278['shift']());}};_0x537e87(++_0x144072);}(_0xad0a,0x16e));var _0xaad0=function(_0x30ae46,_0x2ad2b6){_0x30ae46=_0x30ae46-0x0;var _0x5367c0=_0xad0a[_0x30ae46];return _0x5367c0;};'use strict';var _=require(_0xaad0('0x0'));var util=require('util');var logger=require(_0xaad0('0x1'))('api');var moment=require(_0xaad0('0x2'));var BPromise=require(_0xaad0('0x3'));var rp=require(_0xaad0('0x4'));var fs=require('fs');var path=require(_0xaad0('0x5'));var rimraf=require(_0xaad0('0x6'));var config=require(_0xaad0('0x7'));var attributes=require(_0xaad0('0x8'));module['exports']=function(_0x312abc,_0x21028b){return _0x312abc[_0xaad0('0x9')]('ScreenRecording',attributes,{'tableName':_0xaad0('0xa'),'paranoid':![],'indexes':[{'name':_0xaad0('0xb'),'fields':[_0xaad0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 48669e9..5370b5d 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 _0x1b97=['ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x12a4fa,_0x4b927e){var _0x5baea6=function(_0x2d9237){while(--_0x2d9237){_0x12a4fa['push'](_0x12a4fa['shift']());}};_0x5baea6(++_0x4b927e);}(_0x1b97,0x1ab));var _0x71b9=function(_0x1eb2dd,_0xd23766){_0x1eb2dd=_0x1eb2dd-0x0;var _0x7f3134=_0x1b97[_0x1eb2dd];return _0x7f3134;};'use strict';var _=require('lodash');var util=require(_0x71b9('0x0'));var moment=require(_0x71b9('0x1'));var BPromise=require(_0x71b9('0x2'));var rs=require(_0x71b9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71b9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x71b9('0x5'))(_0x71b9('0x6'));var config=require(_0x71b9('0x7'));var jayson=require(_0x71b9('0x8'));var client=jayson[_0x71b9('0x9')][_0x71b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3807d8,_0x4b33a1,_0x1bd5cf){return new BPromise(function(_0x309dc5,_0xc77d58){return client['request'](_0x3807d8,_0x1bd5cf)[_0x71b9('0xb')](function(_0x55fdfc){logger[_0x71b9('0xc')](_0x71b9('0xd'),_0x4b33a1,_0x71b9('0xe'));logger[_0x71b9('0xf')](_0x71b9('0x10'),_0x4b33a1,_0x71b9('0xe'),JSON['stringify'](_0x55fdfc));if(_0x55fdfc[_0x71b9('0x11')]){if(_0x55fdfc[_0x71b9('0x11')][_0x71b9('0x12')]===0x1f4){logger['error'](_0x71b9('0xd'),_0x4b33a1,_0x55fdfc[_0x71b9('0x11')][_0x71b9('0x13')]);return _0xc77d58(_0x55fdfc[_0x71b9('0x11')][_0x71b9('0x13')]);}logger[_0x71b9('0x11')](_0x71b9('0xd'),_0x4b33a1,_0x55fdfc[_0x71b9('0x11')][_0x71b9('0x13')]);return _0x309dc5(_0x55fdfc[_0x71b9('0x11')][_0x71b9('0x13')]);}else{logger[_0x71b9('0xc')](_0x71b9('0xd'),_0x4b33a1,'request\x20sent');_0x309dc5(_0x55fdfc[_0x71b9('0x14')]['message']);}})[_0x71b9('0x15')](function(_0x479e10){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4b33a1,_0x479e10);_0xc77d58(_0x479e10);});});} \ No newline at end of file +var _0x9866=['result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x51ad56,_0x1e55af){var _0x775ff7=function(_0x275317){while(--_0x275317){_0x51ad56['push'](_0x51ad56['shift']());}};_0x775ff7(++_0x1e55af);}(_0x9866,0x157));var _0x6986=function(_0x1897e3,_0x420d0b){_0x1897e3=_0x1897e3-0x0;var _0x439fea=_0x9866[_0x1897e3];return _0x439fea;};'use strict';var _=require(_0x6986('0x0'));var util=require(_0x6986('0x1'));var moment=require('moment');var BPromise=require(_0x6986('0x2'));var rs=require(_0x6986('0x3'));var fs=require('fs');var Redis=require(_0x6986('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6986('0x5'));var logger=require(_0x6986('0x6'))(_0x6986('0x7'));var config=require('../../config/environment');var jayson=require(_0x6986('0x8'));var client=jayson[_0x6986('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5602b8,_0x311b5c,_0x238d5e){return new BPromise(function(_0x28c6cf,_0xe6095c){return client['request'](_0x5602b8,_0x238d5e)[_0x6986('0xa')](function(_0x8bc741){logger[_0x6986('0xb')](_0x6986('0xc'),_0x311b5c,_0x6986('0xd'));logger[_0x6986('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x311b5c,_0x6986('0xd'),JSON['stringify'](_0x8bc741));if(_0x8bc741[_0x6986('0xf')]){if(_0x8bc741[_0x6986('0xf')][_0x6986('0x10')]===0x1f4){logger[_0x6986('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x311b5c,_0x8bc741[_0x6986('0xf')][_0x6986('0x11')]);return _0xe6095c(_0x8bc741[_0x6986('0xf')][_0x6986('0x11')]);}logger[_0x6986('0xf')](_0x6986('0xc'),_0x311b5c,_0x8bc741[_0x6986('0xf')]['message']);return _0x28c6cf(_0x8bc741[_0x6986('0xf')][_0x6986('0x11')]);}else{logger[_0x6986('0xb')](_0x6986('0xc'),_0x311b5c,'request\x20sent');_0x28c6cf(_0x8bc741[_0x6986('0x12')][_0x6986('0x11')]);}})['catch'](function(_0xc41463){logger[_0x6986('0xf')](_0x6986('0xc'),_0x311b5c,_0xc41463);_0xe6095c(_0xc41463);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 58f34e8..a089526 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 _0xd674=['preferred','/:id/preferred','addPreferred','/:id/favicon','addFavicon','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','getFavicon','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','diskStorage','join','logologin','addLogoLogin'];(function(_0xfebe2c,_0x5c050f){var _0x3f5e66=function(_0x1fac8b){while(--_0x1fac8b){_0xfebe2c['push'](_0xfebe2c['shift']());}};_0x3f5e66(++_0x5c050f);}(_0xd674,0x13b));var _0x4d67=function(_0x99163b,_0x453d0a){_0x99163b=_0x99163b-0x0;var _0x89ff63=_0xd674[_0x99163b];return _0x89ff63;};'use strict';var multer=require(_0x4d67('0x0'));var util=require(_0x4d67('0x1'));var path=require(_0x4d67('0x2'));var timeout=require(_0x4d67('0x3'));var express=require(_0x4d67('0x4'));var router=express[_0x4d67('0x5')]();var fs_extra=require(_0x4d67('0x6'));var auth=require(_0x4d67('0x7'));var interaction=require(_0x4d67('0x8'));var config=require(_0x4d67('0x9'));var controller=require('./setting.controller');router[_0x4d67('0xa')]('/',auth[_0x4d67('0xb')](),controller[_0x4d67('0xc')]);router[_0x4d67('0xa')]('/now',controller[_0x4d67('0xd')]);router[_0x4d67('0xa')](_0x4d67('0xe'),controller[_0x4d67('0xf')]);router['get'](_0x4d67('0x10'),controller[_0x4d67('0x11')]);router[_0x4d67('0xa')](_0x4d67('0x12'),controller['getLogoLogin']);router[_0x4d67('0xa')](_0x4d67('0x13'),controller[_0x4d67('0x14')]);router['get']('/:id/preferred',controller['getPreferred']);router[_0x4d67('0xa')]('/:id/favicon',controller[_0x4d67('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x411203,_0xd36510,_0x1f1498){_0x1f1498(null,path['join'](config[_0x4d67('0x16')],_0x4d67('0x17')));},'filename':function(_0x19b2ac,_0x537c91,_0x16984d){_0x16984d(null,util[_0x4d67('0x18')](_0x4d67('0x19'),_0x4d67('0x1a'),path[_0x4d67('0x1b')](_0x537c91[_0x4d67('0x1c')])));}})});router[_0x4d67('0x1d')]('/:id/logo',upload[_0x4d67('0x1e')](_0x4d67('0x1f')),controller[_0x4d67('0x20')]);var upload=multer({'storage':multer[_0x4d67('0x21')]({'destination':function(_0x1bd885,_0x2865c4,_0x31e3bb){_0x31e3bb(null,path[_0x4d67('0x22')](config[_0x4d67('0x16')],_0x4d67('0x17')));},'filename':function(_0x5b9b33,_0xc1a24f,_0x4a5451){_0x4a5451(null,util[_0x4d67('0x18')]('%s%s',_0x4d67('0x23'),path[_0x4d67('0x1b')](_0xc1a24f[_0x4d67('0x1c')])));}})});router[_0x4d67('0x1d')](_0x4d67('0x12'),upload['single']('file'),controller[_0x4d67('0x24')]);var upload=multer({'storage':multer[_0x4d67('0x21')]({'destination':function(_0x498ebe,_0x5de24e,_0x25cc61){_0x25cc61(null,path[_0x4d67('0x22')](config[_0x4d67('0x16')],_0x4d67('0x17')));},'filename':function(_0x316de1,_0xfc9063,_0x4c0148){_0x4c0148(null,util[_0x4d67('0x18')]('%s%s',_0x4d67('0x25'),path['extname'](_0xfc9063[_0x4d67('0x1c')])));}})});router[_0x4d67('0x1d')](_0x4d67('0x26'),upload[_0x4d67('0x1e')]('file'),controller[_0x4d67('0x27')]);var upload=multer({'storage':multer[_0x4d67('0x21')]({'destination':function(_0x2cc99a,_0x91d37e,_0x25d691){_0x25d691(null,path[_0x4d67('0x22')](config[_0x4d67('0x16')],'server/files/images/logos/'));},'filename':function(_0xe372ae,_0x2b50a6,_0x24ff95){_0x24ff95(null,util[_0x4d67('0x18')](_0x4d67('0x19'),'favicon',path[_0x4d67('0x1b')](_0x2b50a6[_0x4d67('0x1c')])));}})});router[_0x4d67('0x1d')](_0x4d67('0x28'),upload[_0x4d67('0x1e')](_0x4d67('0x1f')),controller[_0x4d67('0x29')]);router[_0x4d67('0x2a')]('/:id',auth[_0x4d67('0xb')](),controller['update']);module[_0x4d67('0x2b')]=router; \ No newline at end of file +var _0x9c84=['join','/:id/logo_login','addLogoLogin','preferred','originalname','post','/:id/preferred','addPreferred','favicon','addFavicon','put','/:id','isAuthenticated','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','/now','getDate','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','single','file','addLogo'];(function(_0x16e5c7,_0x16240a){var _0x3734a3=function(_0x4f02b8){while(--_0x4f02b8){_0x16e5c7['push'](_0x16e5c7['shift']());}};_0x3734a3(++_0x16240a);}(_0x9c84,0x192));var _0x49c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9c84[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x49c8('0x0'));var path=require('path');var timeout=require(_0x49c8('0x1'));var express=require(_0x49c8('0x2'));var router=express[_0x49c8('0x3')]();var fs_extra=require(_0x49c8('0x4'));var auth=require(_0x49c8('0x5'));var interaction=require(_0x49c8('0x6'));var config=require(_0x49c8('0x7'));var controller=require(_0x49c8('0x8'));router[_0x49c8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x49c8('0x9')](_0x49c8('0xa'),controller[_0x49c8('0xb')]);router[_0x49c8('0x9')]('/:id',controller[_0x49c8('0xc')]);router[_0x49c8('0x9')](_0x49c8('0xd'),controller[_0x49c8('0xe')]);router['get']('/:id/logo_login',controller[_0x49c8('0xf')]);router[_0x49c8('0x9')](_0x49c8('0x10'),controller[_0x49c8('0x11')]);router[_0x49c8('0x9')]('/:id/preferred',controller['getPreferred']);router[_0x49c8('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x49c8('0x12')]({'destination':function(_0x583fc7,_0x4c92a7,_0x2f1f37){_0x2f1f37(null,path['join'](config[_0x49c8('0x13')],_0x49c8('0x14')));},'filename':function(_0x421e53,_0x3443cc,_0x21223f){_0x21223f(null,util[_0x49c8('0x15')](_0x49c8('0x16'),_0x49c8('0x17'),path[_0x49c8('0x18')](_0x3443cc['originalname'])));}})});router['post'](_0x49c8('0xd'),upload[_0x49c8('0x19')](_0x49c8('0x1a')),controller[_0x49c8('0x1b')]);var upload=multer({'storage':multer[_0x49c8('0x12')]({'destination':function(_0x118e7b,_0x476240,_0x12aaff){_0x12aaff(null,path[_0x49c8('0x1c')](config[_0x49c8('0x13')],_0x49c8('0x14')));},'filename':function(_0x3fa5e1,_0x574699,_0x28cbbd){_0x28cbbd(null,util[_0x49c8('0x15')](_0x49c8('0x16'),'logologin',path[_0x49c8('0x18')](_0x574699['originalname'])));}})});router['post'](_0x49c8('0x1d'),upload[_0x49c8('0x19')](_0x49c8('0x1a')),controller[_0x49c8('0x1e')]);var upload=multer({'storage':multer[_0x49c8('0x12')]({'destination':function(_0x1e709e,_0xba7d6d,_0x32198c){_0x32198c(null,path[_0x49c8('0x1c')](config[_0x49c8('0x13')],'server/files/images/logos/'));},'filename':function(_0xfbecf,_0x4b08e2,_0x248f72){_0x248f72(null,util[_0x49c8('0x15')](_0x49c8('0x16'),_0x49c8('0x1f'),path[_0x49c8('0x18')](_0x4b08e2[_0x49c8('0x20')])));}})});router[_0x49c8('0x21')](_0x49c8('0x22'),upload[_0x49c8('0x19')]('file'),controller[_0x49c8('0x23')]);var upload=multer({'storage':multer[_0x49c8('0x12')]({'destination':function(_0x1cf5d1,_0x27edc0,_0x57331f){_0x57331f(null,path['join'](config['root'],_0x49c8('0x14')));},'filename':function(_0x41771c,_0x18c4c5,_0x163aa5){_0x163aa5(null,util[_0x49c8('0x15')](_0x49c8('0x16'),_0x49c8('0x24'),path['extname'](_0x18c4c5[_0x49c8('0x20')])));}})});router['post']('/:id/favicon',upload['single'](_0x49c8('0x1a')),controller[_0x49c8('0x25')]);router[_0x49c8('0x26')](_0x49c8('0x27'),auth[_0x49c8('0x28')](),controller[_0x49c8('0x29')]);module[_0x49c8('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index c0236af..0646759 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(_0x4a4116,_0x43679a){var _0x565b9a=function(_0x52201f){while(--_0x52201f){_0x4a4116['push'](_0x4a4116['shift']());}};_0x565b9a(++_0x43679a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x426bfb,_0x290927){var _0x1e8a8f=function(_0x1651c3){while(--_0x1651c3){_0x426bfb['push'](_0x426bfb['shift']());}};_0x1e8a8f(++_0x290927);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 91ff846..197f197 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 _0x0a09=['fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','Setting','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','include','findAll','rows','show','params','keys','includeAll','options','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','toLower','default_logo.svg','default','upperFirst','custom','root','Sequelize','\x20not\x20found','download','getLogoLogin','favicon','default_loginLogo.svg','ValidationError','gdpr','getPreferred','defaultPreferred','default_preferred.png','addFavicon','server/files/images/logos','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0x0a09,0x1ed));var _0x90a0=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x0a09[_0x51ed62];return _0x34aee3;};'use strict';var emlformat=require(_0x90a0('0x0'));var rimraf=require(_0x90a0('0x1'));var zipdir=require(_0x90a0('0x2'));var jsonpatch=require(_0x90a0('0x3'));var rp=require(_0x90a0('0x4'));var moment=require(_0x90a0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x90a0('0x6'));var util=require('util');var path=require(_0x90a0('0x7'));var sox=require(_0x90a0('0x8'));var csv=require('to-csv');var ejs=require(_0x90a0('0x9'));var fs=require('fs');var fs_extra=require(_0x90a0('0xa'));var _=require(_0x90a0('0xb'));var squel=require(_0x90a0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90a0('0xd'));var toCsv=require(_0x90a0('0xe'));var querystring=require(_0x90a0('0xf'));var Papa=require(_0x90a0('0x10'));var Redis=require(_0x90a0('0x11'));var authService=require(_0x90a0('0x12'));var qs=require(_0x90a0('0x13'));var as=require(_0x90a0('0x14'));var hardwareService=require(_0x90a0('0x15'));var logger=require('../../config/logger')(_0x90a0('0x16'));var utils=require(_0x90a0('0x17'));var config=require(_0x90a0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x90a0('0x19'))['db'];var jayson=require(_0x90a0('0x1a'));var client=jayson[_0x90a0('0x1b')][_0x90a0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3206f2,_0x1fbb08,_0x5b4741,_0xe05726){return new BPromise(function(_0x26313a,_0x4d5a08){var _0xa990e5=_0xe05726||client;return _0xa990e5['request'](_0x3206f2,_0x5b4741)['then'](function(_0x2406f4){logger[_0x90a0('0x1d')](_0x90a0('0x1e'),_0x1fbb08,_0x90a0('0x1f'));logger['debug'](_0x90a0('0x20'),_0x1fbb08,_0x90a0('0x1f'),JSON[_0x90a0('0x21')](_0x2406f4));if(_0x2406f4['error']){if(_0x2406f4[_0x90a0('0x22')][_0x90a0('0x23')]===0x1f4){logger['error'](_0x90a0('0x1e'),_0x1fbb08,_0x2406f4[_0x90a0('0x22')][_0x90a0('0x24')]);return _0x4d5a08(_0x2406f4[_0x90a0('0x22')][_0x90a0('0x24')]);}logger['error'](_0x90a0('0x1e'),_0x1fbb08,_0x2406f4[_0x90a0('0x22')][_0x90a0('0x24')]);return _0x26313a(_0x2406f4['error'][_0x90a0('0x24')]);}else{logger[_0x90a0('0x1d')](_0x90a0('0x1e'),_0x1fbb08,_0x90a0('0x1f'));_0x26313a(_0x2406f4[_0x90a0('0x25')][_0x90a0('0x24')]);}})[_0x90a0('0x26')](function(_0x4f596d){logger[_0x90a0('0x22')](_0x90a0('0x1e'),_0x1fbb08,_0x4f596d);_0x4d5a08(_0x4f596d);});});}function respondWithStatusCode(_0x68e765,_0x3106eb){_0x3106eb=_0x3106eb||0xcc;return function(_0x470c2e){if(_0x470c2e){return _0x68e765[_0x90a0('0x27')](_0x3106eb);}return _0x68e765[_0x90a0('0x28')](_0x3106eb)['end']();};}function respondWithResult(_0x44fe1c,_0x179f6a){_0x179f6a=_0x179f6a||0xc8;return function(_0xae3380){if(_0xae3380){return _0x44fe1c[_0x90a0('0x28')](_0x179f6a)[_0x90a0('0x29')](_0xae3380);}};}function respondWithFilteredResult(_0x4d7b42,_0x9cba6){return function(_0x2d2d66){if(_0x2d2d66){var _0x56b563=typeof _0x9cba6[_0x90a0('0x2a')]===_0x90a0('0x2b')&&typeof _0x9cba6[_0x90a0('0x2c')]==='undefined';var _0x31d132=_0x2d2d66['count'];var _0x451917=_0x56b563?0x0:_0x9cba6[_0x90a0('0x2a')];var _0x375b13=_0x56b563?_0x2d2d66['count']:_0x9cba6[_0x90a0('0x2a')]+_0x9cba6['limit'];var _0x5f39be;if(_0x375b13>=_0x31d132){_0x375b13=_0x31d132;_0x5f39be=0xc8;}else{_0x5f39be=0xce;}_0x4d7b42[_0x90a0('0x28')](_0x5f39be);return _0x4d7b42[_0x90a0('0x2d')](_0x90a0('0x2e'),_0x451917+'-'+_0x375b13+'/'+_0x31d132)[_0x90a0('0x29')](_0x2d2d66);}return null;};}function patchUpdates(_0x1bd861){return function(_0x419406){try{jsonpatch[_0x90a0('0x2f')](_0x419406,_0x1bd861,!![]);}catch(_0x3a37dc){return BPromise['reject'](_0x3a37dc);}return _0x419406[_0x90a0('0x30')]();};}function saveUpdates(_0x2918b3,_0x318c6e){return function(_0x5ee1bf){if(_0x5ee1bf){return _0x5ee1bf[_0x90a0('0x31')](_0x2918b3)[_0x90a0('0x32')](function(_0x207da6){return _0x207da6;});}return null;};}function removeEntity(_0x2d3627,_0x1a2790){return function(_0xf732fc){if(_0xf732fc){return _0xf732fc[_0x90a0('0x33')]()[_0x90a0('0x32')](function(){_0x2d3627[_0x90a0('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45735e,_0x463c74){return function(_0xe445a4){if(!_0xe445a4){_0x45735e['sendStatus'](0x194);}return _0xe445a4;};}function handleError(_0x4af771,_0x2ad654){_0x2ad654=_0x2ad654||0x1f4;return function(_0x4374aa){logger[_0x90a0('0x22')](_0x4374aa[_0x90a0('0x34')]);if(_0x4374aa[_0x90a0('0x35')]){delete _0x4374aa[_0x90a0('0x35')];}_0x4af771[_0x90a0('0x28')](_0x2ad654)['send'](_0x4374aa);};}exports[_0x90a0('0x36')]=function(_0x7139f1,_0x189a63){var _0x23424f={},_0x5162ec={},_0x9e0a5f={'count':0x0,'rows':[]};var _0x546f31=_['map'](db[_0x90a0('0x37')][_0x90a0('0x38')],function(_0x310e4a){return{'name':_0x310e4a['fieldName'],'type':_0x310e4a[_0x90a0('0x39')]['key']};});_0x5162ec[_0x90a0('0x3a')]=_[_0x90a0('0x3b')](_0x546f31,'name');_0x5162ec[_0x90a0('0x3c')]=_['keys'](_0x7139f1[_0x90a0('0x3c')]);_0x5162ec[_0x90a0('0x3d')]=_[_0x90a0('0x3e')](_0x5162ec['model'],_0x5162ec['query']);_0x23424f[_0x90a0('0x3f')]=_[_0x90a0('0x3e')](_0x5162ec['model'],qs[_0x90a0('0x40')](_0x7139f1[_0x90a0('0x3c')][_0x90a0('0x40')]));_0x23424f[_0x90a0('0x3f')]=_0x23424f[_0x90a0('0x3f')][_0x90a0('0x41')]?_0x23424f[_0x90a0('0x3f')]:_0x5162ec[_0x90a0('0x3a')];if(!_0x7139f1[_0x90a0('0x3c')][_0x90a0('0x42')](_0x90a0('0x43'))){_0x23424f[_0x90a0('0x2c')]=qs[_0x90a0('0x2c')](_0x7139f1['query'][_0x90a0('0x2c')]);_0x23424f[_0x90a0('0x2a')]=qs[_0x90a0('0x2a')](_0x7139f1['query']['offset']);}_0x23424f[_0x90a0('0x44')]=qs['sort'](_0x7139f1[_0x90a0('0x3c')]['sort']);_0x23424f[_0x90a0('0x45')]=qs[_0x90a0('0x3d')](_[_0x90a0('0x46')](_0x7139f1[_0x90a0('0x3c')],_0x5162ec[_0x90a0('0x3d')]),_0x546f31);if(_0x7139f1[_0x90a0('0x3c')]['filter']){_0x23424f[_0x90a0('0x45')]=_[_0x90a0('0x47')](_0x23424f['where'],{'$or':_[_0x90a0('0x3b')](_0x546f31,function(_0x16babf){if(_0x16babf[_0x90a0('0x39')]!==_0x90a0('0x48')){var _0x4d48f1={};_0x4d48f1[_0x16babf[_0x90a0('0x35')]]={'$like':'%'+_0x7139f1[_0x90a0('0x3c')][_0x90a0('0x49')]+'%'};return _0x4d48f1;}})});}_0x23424f=_[_0x90a0('0x47')]({},_0x23424f,_0x7139f1['options']);var _0x33da59={'where':_0x23424f['where']};return db[_0x90a0('0x37')]['count'](_0x33da59)[_0x90a0('0x32')](function(_0x3b337a){_0x9e0a5f['count']=_0x3b337a;if(_0x7139f1[_0x90a0('0x3c')]['includeAll']){_0x23424f[_0x90a0('0x4a')]=[{'all':!![]}];}return db[_0x90a0('0x37')][_0x90a0('0x4b')](_0x23424f);})[_0x90a0('0x32')](function(_0x6f58e8){_0x9e0a5f[_0x90a0('0x4c')]=_0x6f58e8;return _0x9e0a5f;})['then'](respondWithFilteredResult(_0x189a63,_0x23424f))[_0x90a0('0x26')](handleError(_0x189a63,null));};exports[_0x90a0('0x4d')]=function(_0x506578,_0x2bb87a){var _0x4aaf2f={'raw':![],'where':{'id':_0x506578[_0x90a0('0x4e')]['id']}},_0x3469a4={};_0x3469a4[_0x90a0('0x3a')]=_[_0x90a0('0x4f')](db[_0x90a0('0x37')][_0x90a0('0x38')]);_0x3469a4[_0x90a0('0x3c')]=_[_0x90a0('0x4f')](_0x506578[_0x90a0('0x3c')]);_0x3469a4[_0x90a0('0x3d')]=_[_0x90a0('0x3e')](_0x3469a4[_0x90a0('0x3a')],_0x3469a4[_0x90a0('0x3c')]);_0x4aaf2f[_0x90a0('0x3f')]=_['intersection'](_0x3469a4[_0x90a0('0x3a')],qs[_0x90a0('0x40')](_0x506578[_0x90a0('0x3c')][_0x90a0('0x40')]));_0x4aaf2f[_0x90a0('0x3f')]=_0x4aaf2f[_0x90a0('0x3f')][_0x90a0('0x41')]?_0x4aaf2f[_0x90a0('0x3f')]:_0x3469a4[_0x90a0('0x3a')];if(_0x506578['query'][_0x90a0('0x50')]){_0x4aaf2f['include']=[{'all':!![]}];}_0x4aaf2f=_[_0x90a0('0x47')]({},_0x4aaf2f,_0x506578[_0x90a0('0x51')]);return db[_0x90a0('0x37')][_0x90a0('0x52')](_0x4aaf2f)[_0x90a0('0x32')](handleEntityNotFound(_0x2bb87a,null))[_0x90a0('0x32')](respondWithResult(_0x2bb87a,null))['catch'](handleError(_0x2bb87a,null));};exports[_0x90a0('0x31')]=function(_0x5b6c84,_0x425442){if(_0x5b6c84[_0x90a0('0x53')]['id']){delete _0x5b6c84['body']['id'];}return db[_0x90a0('0x37')][_0x90a0('0x52')]({'where':{'id':_0x5b6c84['params']['id']}})[_0x90a0('0x32')](handleEntityNotFound(_0x425442,null))[_0x90a0('0x32')](saveUpdates(_0x5b6c84[_0x90a0('0x53')],null))[_0x90a0('0x32')](respondWithResult(_0x425442,null))[_0x90a0('0x26')](handleError(_0x425442,null));};exports[_0x90a0('0x54')]=function(_0x4dce0d,_0x71a728,_0x211631){if(_0x4dce0d[_0x90a0('0x55')]&&_0x4dce0d[_0x90a0('0x55')][_0x90a0('0x56')]){_0x4dce0d[_0x90a0('0x53')][_0x90a0('0x57')]=_0x4dce0d[_0x90a0('0x55')][_0x90a0('0x56')];}return db[_0x90a0('0x37')][_0x90a0('0x52')]({'where':{'id':_0x4dce0d[_0x90a0('0x4e')]['id']}})[_0x90a0('0x32')](handleEntityNotFound(_0x71a728,null))['then'](saveUpdates(_0x4dce0d[_0x90a0('0x53')],null))['then'](respondWithResult(_0x71a728,null))[_0x90a0('0x26')](handleError(_0x71a728,null));};exports[_0x90a0('0x58')]=function(_0x531061,_0x516606,_0x2d20ed){if(_0x531061['file']&&_0x531061['file'][_0x90a0('0x56')]){_0x531061[_0x90a0('0x53')][_0x90a0('0x59')]=_0x531061[_0x90a0('0x55')][_0x90a0('0x56')];}return db['Setting'][_0x90a0('0x52')]({'where':{'id':_0x531061[_0x90a0('0x4e')]['id']}})[_0x90a0('0x32')](handleEntityNotFound(_0x516606,null))[_0x90a0('0x32')](saveUpdates(_0x531061[_0x90a0('0x53')],null))['then'](respondWithResult(_0x516606,null))[_0x90a0('0x26')](handleError(_0x516606,null));};var utilLicense=require(_0x90a0('0x5a'));exports[_0x90a0('0x5b')]=function(_0x49cbd6,_0x425e5f,_0x34b962){var _0x1d4c9b='server/files/images/logos';var _0x4a6d21={'custom':![]};return utilLicense[_0x90a0('0x5c')]()['then'](function(_0x1c7410){if(_0x1c7410){_0x4a6d21=_0x1c7410;}return db['Setting'][_0x90a0('0x52')]({'where':{'id':_0x49cbd6[_0x90a0('0x4e')]['id']},'attributes':[_0x90a0('0x57'),_0x90a0('0x59'),_0x90a0('0x5d'),'favicon',_0x90a0('0x5e'),_0x90a0('0x5f'),'defaultPreferred',_0x90a0('0x60')],'raw':!![]});})[_0x90a0('0x32')](handleEntityNotFound(_0x425e5f,null))[_0x90a0('0x32')](function(_0x115024){if(_0x115024){var _0x3513ad=_0x115024['logo']&&fs[_0x90a0('0x61')](path[_0x90a0('0x62')](config['root'],_0x1d4c9b,_[_0x90a0('0x63')](_0x115024[_0x90a0('0x57')])))?path[_0x90a0('0x62')](config['root'],_0x1d4c9b,_[_0x90a0('0x63')](_0x115024[_0x90a0('0x57')])):path[_0x90a0('0x62')](config['root'],_0x1d4c9b,_[_0x90a0('0x63')](_0x90a0('0x64')));var _0x3dd327=_0x90a0('0x65')+_[_0x90a0('0x66')](_0x90a0('0x57'));if(_0x115024[_0x3dd327]||!_0x4a6d21[_0x90a0('0x67')]){_0x3513ad=path[_0x90a0('0x62')](config[_0x90a0('0x68')],_0x1d4c9b,_['toLower'](_0x90a0('0x64')));}if(!fs[_0x90a0('0x61')](_0x3513ad)){throw new db[(_0x90a0('0x69'))]['ValidationError'](_[_0x90a0('0x66')](_0x90a0('0x57'))+_0x90a0('0x6a'));}return _0x425e5f[_0x90a0('0x6b')](_0x3513ad);}})[_0x90a0('0x26')](handleError(_0x425e5f,null));};var utilLicense=require(_0x90a0('0x5a'));exports[_0x90a0('0x6c')]=function(_0x373e77,_0x467ed8,_0x4817af){var _0x42f6f7='server/files/images/logos';var _0x1c6313={'custom':![]};return utilLicense['getLicense']()[_0x90a0('0x32')](function(_0x23b78f){if(_0x23b78f){_0x1c6313=_0x23b78f;}return db[_0x90a0('0x37')]['find']({'where':{'id':_0x373e77['params']['id']},'attributes':[_0x90a0('0x57'),'loginLogo',_0x90a0('0x5d'),_0x90a0('0x6d'),'defaultLogo',_0x90a0('0x5f'),'defaultPreferred',_0x90a0('0x60')],'raw':!![]});})[_0x90a0('0x32')](handleEntityNotFound(_0x467ed8,null))[_0x90a0('0x32')](function(_0x3b55cf){if(_0x3b55cf){var _0x48e294=_0x3b55cf[_0x90a0('0x59')]&&fs[_0x90a0('0x61')](path['join'](config[_0x90a0('0x68')],_0x42f6f7,_[_0x90a0('0x63')](_0x3b55cf[_0x90a0('0x59')])))?path['join'](config[_0x90a0('0x68')],_0x42f6f7,_[_0x90a0('0x63')](_0x3b55cf[_0x90a0('0x59')])):path[_0x90a0('0x62')](config[_0x90a0('0x68')],_0x42f6f7,_[_0x90a0('0x63')](_0x90a0('0x6e')));var _0x12c81e='default'+_[_0x90a0('0x66')](_0x90a0('0x59'));if(_0x3b55cf[_0x12c81e]||!_0x1c6313[_0x90a0('0x67')]){_0x48e294=path[_0x90a0('0x62')](config['root'],_0x42f6f7,_[_0x90a0('0x63')](_0x90a0('0x6e')));}if(!fs[_0x90a0('0x61')](_0x48e294)){throw new db['Sequelize'][(_0x90a0('0x6f'))](_['upperFirst'](_0x90a0('0x59'))+_0x90a0('0x6a'));}return _0x467ed8[_0x90a0('0x6b')](_0x48e294);}})[_0x90a0('0x26')](handleError(_0x467ed8,null));};exports[_0x90a0('0x70')]=function(_0xc11fa5,_0x51862f){return db[_0x90a0('0x37')][_0x90a0('0x52')]({'where':{'id':_0xc11fa5['params']['id']},'attributes':['securePassword']})[_0x90a0('0x32')](respondWithResult(_0x51862f,null))[_0x90a0('0x26')](handleError(_0x51862f,null));};exports['addPreferred']=function(_0x1e85d1,_0x559d8e,_0x4e948c){if(_0x1e85d1[_0x90a0('0x55')]&&_0x1e85d1[_0x90a0('0x55')][_0x90a0('0x56')]){_0x1e85d1[_0x90a0('0x53')][_0x90a0('0x5d')]=_0x1e85d1[_0x90a0('0x55')][_0x90a0('0x56')];}return db[_0x90a0('0x37')]['find']({'where':{'id':_0x1e85d1[_0x90a0('0x4e')]['id']}})[_0x90a0('0x32')](handleEntityNotFound(_0x559d8e,null))[_0x90a0('0x32')](saveUpdates(_0x1e85d1[_0x90a0('0x53')],null))['then'](respondWithResult(_0x559d8e,null))[_0x90a0('0x26')](handleError(_0x559d8e,null));};var utilLicense=require(_0x90a0('0x5a'));exports[_0x90a0('0x71')]=function(_0x43342d,_0x312eac,_0x24e99a){var _0x4f702c='server/files/images/logos';var _0x3f5788={'custom':![]};return utilLicense['getLicense']()[_0x90a0('0x32')](function(_0x31c03e){if(_0x31c03e){_0x3f5788=_0x31c03e;}return db[_0x90a0('0x37')]['find']({'where':{'id':_0x43342d[_0x90a0('0x4e')]['id']},'attributes':[_0x90a0('0x57'),_0x90a0('0x59'),_0x90a0('0x5d'),'favicon',_0x90a0('0x5e'),_0x90a0('0x5f'),_0x90a0('0x72'),_0x90a0('0x60')],'raw':!![]});})[_0x90a0('0x32')](handleEntityNotFound(_0x312eac,null))[_0x90a0('0x32')](function(_0x2f85eb){if(_0x2f85eb){var _0x1157bb=_0x2f85eb[_0x90a0('0x5d')]&&fs[_0x90a0('0x61')](path[_0x90a0('0x62')](config[_0x90a0('0x68')],_0x4f702c,_['toLower'](_0x2f85eb[_0x90a0('0x5d')])))?path['join'](config[_0x90a0('0x68')],_0x4f702c,_[_0x90a0('0x63')](_0x2f85eb[_0x90a0('0x5d')])):path[_0x90a0('0x62')](config[_0x90a0('0x68')],_0x4f702c,_['toLower'](_0x90a0('0x73')));var _0x3515b6=_0x90a0('0x65')+_[_0x90a0('0x66')](_0x90a0('0x5d'));if(_0x2f85eb[_0x3515b6]||!_0x3f5788['custom']||!_0x3f5788[_0x90a0('0x5d')]){_0x1157bb=path[_0x90a0('0x62')](config[_0x90a0('0x68')],_0x4f702c,_[_0x90a0('0x63')](_0x90a0('0x73')));}if(!fs['existsSync'](_0x1157bb)){throw new db['Sequelize'][(_0x90a0('0x6f'))](_['upperFirst'](_0x90a0('0x5d'))+'\x20not\x20found');}return _0x312eac['download'](_0x1157bb);}})[_0x90a0('0x26')](handleError(_0x312eac,null));};exports[_0x90a0('0x74')]=function(_0x20f9b5,_0x483d7f,_0x35c645){if(_0x20f9b5[_0x90a0('0x55')]&&_0x20f9b5[_0x90a0('0x55')]['filename']){_0x20f9b5[_0x90a0('0x53')]['favicon']=_0x20f9b5['file'][_0x90a0('0x56')];}return db['Setting'][_0x90a0('0x52')]({'where':{'id':_0x20f9b5[_0x90a0('0x4e')]['id']}})[_0x90a0('0x32')](handleEntityNotFound(_0x483d7f,null))[_0x90a0('0x32')](saveUpdates(_0x20f9b5[_0x90a0('0x53')],null))[_0x90a0('0x32')](respondWithResult(_0x483d7f,null))[_0x90a0('0x26')](handleError(_0x483d7f,null));};var utilLicense=require(_0x90a0('0x5a'));exports['getFavicon']=function(_0x15f76e,_0x155105,_0x509ff2){var _0x222c04=_0x90a0('0x75');var _0x477b72={'custom':![]};return utilLicense[_0x90a0('0x5c')]()[_0x90a0('0x32')](function(_0x51c70e){if(_0x51c70e){_0x477b72=_0x51c70e;}return db[_0x90a0('0x37')][_0x90a0('0x52')]({'where':{'id':_0x15f76e[_0x90a0('0x4e')]['id']},'attributes':[_0x90a0('0x57'),'loginLogo',_0x90a0('0x5d'),_0x90a0('0x6d'),_0x90a0('0x5e'),_0x90a0('0x5f'),_0x90a0('0x72'),_0x90a0('0x60')],'raw':!![]});})[_0x90a0('0x32')](handleEntityNotFound(_0x155105,null))[_0x90a0('0x32')](function(_0x35abbb){if(_0x35abbb){var _0x56e30b=_0x35abbb[_0x90a0('0x6d')]&&fs[_0x90a0('0x61')](path[_0x90a0('0x62')](config[_0x90a0('0x68')],_0x222c04,_[_0x90a0('0x63')](_0x35abbb[_0x90a0('0x6d')])))?path[_0x90a0('0x62')](config[_0x90a0('0x68')],_0x222c04,_[_0x90a0('0x63')](_0x35abbb[_0x90a0('0x6d')])):path[_0x90a0('0x62')](config[_0x90a0('0x68')],_0x222c04,_['toLower'](_0x90a0('0x76')));var _0x3b90c6=_0x90a0('0x65')+_[_0x90a0('0x66')](_0x90a0('0x6d'));if(_0x35abbb[_0x3b90c6]||!_0x477b72[_0x90a0('0x67')]){_0x56e30b=path[_0x90a0('0x62')](config['root'],_0x222c04,_[_0x90a0('0x63')](_0x90a0('0x76')));}if(!fs[_0x90a0('0x61')](_0x56e30b)){throw new db[(_0x90a0('0x69'))][(_0x90a0('0x6f'))](_['upperFirst'](_0x90a0('0x6d'))+_0x90a0('0x6a'));}return _0x155105[_0x90a0('0x6b')](_0x56e30b);}})['catch'](handleError(_0x155105,null));};exports['getDate']=function(_0x3ee9ac,_0x122b21){var _0x238ba8={'offset':moment()[_0x90a0('0x77')]()};_0x238ba8[_0x90a0('0x78')]=moment()[_0x90a0('0x77')](_0x238ba8[_0x90a0('0x2a')])[_0x90a0('0x79')](_0x90a0('0x7a'));return _0x122b21['status'](0xc8)[_0x90a0('0x7b')](_0x238ba8);}; \ No newline at end of file +var _0x643b=['jayson/promise','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','name','send','index','map','Setting','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','body','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','download','defaultLogo','defaultLoginLogo','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x12bc19,_0x422526){var _0x377fca=function(_0x304c5e){while(--_0x304c5e){_0x12bc19['push'](_0x12bc19['shift']());}};_0x377fca(++_0x422526);}(_0x643b,0xdc));var _0xb643=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x643b[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xb643('0x0'));var rimraf=require(_0xb643('0x1'));var zipdir=require(_0xb643('0x2'));var jsonpatch=require(_0xb643('0x3'));var rp=require(_0xb643('0x4'));var moment=require(_0xb643('0x5'));var BPromise=require(_0xb643('0x6'));var Mustache=require(_0xb643('0x7'));var util=require('util');var path=require(_0xb643('0x8'));var sox=require('sox');var csv=require(_0xb643('0x9'));var ejs=require(_0xb643('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb643('0xb'));var squel=require(_0xb643('0xc'));var crypto=require('crypto');var jsforce=require(_0xb643('0xd'));var deskjs=require(_0xb643('0xe'));var toCsv=require(_0xb643('0x9'));var querystring=require(_0xb643('0xf'));var Papa=require(_0xb643('0x10'));var Redis=require(_0xb643('0x11'));var authService=require(_0xb643('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb643('0x13'));var hardwareService=require(_0xb643('0x14'));var logger=require(_0xb643('0x15'))(_0xb643('0x16'));var utils=require(_0xb643('0x17'));var config=require(_0xb643('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb643('0x19'))['db'];var jayson=require(_0xb643('0x1a'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd723,_0x22136b,_0x1e0541,_0x1f44f7){return new BPromise(function(_0xc90caf,_0x467efe){var _0x30257a=_0x1f44f7||client;return _0x30257a[_0xb643('0x1b')](_0x1bd723,_0x1e0541)[_0xb643('0x1c')](function(_0x5086a5){logger[_0xb643('0x1d')](_0xb643('0x1e'),_0x22136b,_0xb643('0x1f'));logger[_0xb643('0x20')](_0xb643('0x21'),_0x22136b,'request\x20sent',JSON[_0xb643('0x22')](_0x5086a5));if(_0x5086a5[_0xb643('0x23')]){if(_0x5086a5[_0xb643('0x23')][_0xb643('0x24')]===0x1f4){logger[_0xb643('0x23')](_0xb643('0x1e'),_0x22136b,_0x5086a5[_0xb643('0x23')][_0xb643('0x25')]);return _0x467efe(_0x5086a5[_0xb643('0x23')][_0xb643('0x25')]);}logger[_0xb643('0x23')](_0xb643('0x1e'),_0x22136b,_0x5086a5[_0xb643('0x23')][_0xb643('0x25')]);return _0xc90caf(_0x5086a5[_0xb643('0x23')][_0xb643('0x25')]);}else{logger[_0xb643('0x1d')](_0xb643('0x1e'),_0x22136b,_0xb643('0x1f'));_0xc90caf(_0x5086a5['result'][_0xb643('0x25')]);}})['catch'](function(_0x1613d1){logger['error']('Setting,\x20%s,\x20%s',_0x22136b,_0x1613d1);_0x467efe(_0x1613d1);});});}function respondWithStatusCode(_0x3f6f6e,_0x1b55f3){_0x1b55f3=_0x1b55f3||0xcc;return function(_0x462df7){if(_0x462df7){return _0x3f6f6e[_0xb643('0x26')](_0x1b55f3);}return _0x3f6f6e[_0xb643('0x27')](_0x1b55f3)[_0xb643('0x28')]();};}function respondWithResult(_0x1338b9,_0x497ae0){_0x497ae0=_0x497ae0||0xc8;return function(_0xddb43b){if(_0xddb43b){return _0x1338b9['status'](_0x497ae0)[_0xb643('0x29')](_0xddb43b);}};}function respondWithFilteredResult(_0x23fb29,_0x52cc58){return function(_0x213219){if(_0x213219){var _0x3d975f=typeof _0x52cc58[_0xb643('0x2a')]===_0xb643('0x2b')&&typeof _0x52cc58[_0xb643('0x2c')]===_0xb643('0x2b');var _0x63e5a=_0x213219[_0xb643('0x2d')];var _0xa1fd69=_0x3d975f?0x0:_0x52cc58[_0xb643('0x2a')];var _0x194810=_0x3d975f?_0x213219[_0xb643('0x2d')]:_0x52cc58[_0xb643('0x2a')]+_0x52cc58[_0xb643('0x2c')];var _0x2d2abe;if(_0x194810>=_0x63e5a){_0x194810=_0x63e5a;_0x2d2abe=0xc8;}else{_0x2d2abe=0xce;}_0x23fb29['status'](_0x2d2abe);return _0x23fb29[_0xb643('0x2e')](_0xb643('0x2f'),_0xa1fd69+'-'+_0x194810+'/'+_0x63e5a)[_0xb643('0x29')](_0x213219);}return null;};}function patchUpdates(_0x3c47e9){return function(_0x4f851a){try{jsonpatch[_0xb643('0x30')](_0x4f851a,_0x3c47e9,!![]);}catch(_0x3fb564){return BPromise[_0xb643('0x31')](_0x3fb564);}return _0x4f851a['save']();};}function saveUpdates(_0x2fc3e1,_0x8ff7e9){return function(_0x46f50d){if(_0x46f50d){return _0x46f50d[_0xb643('0x32')](_0x2fc3e1)['then'](function(_0x23611a){return _0x23611a;});}return null;};}function removeEntity(_0x3663c0,_0x4e71f8){return function(_0x2d2de4){if(_0x2d2de4){return _0x2d2de4['destroy']()['then'](function(){_0x3663c0['status'](0xcc)[_0xb643('0x28')]();});}};}function handleEntityNotFound(_0x644b2,_0x48519f){return function(_0x5a2292){if(!_0x5a2292){_0x644b2[_0xb643('0x26')](0x194);}return _0x5a2292;};}function handleError(_0x9bf675,_0x55b194){_0x55b194=_0x55b194||0x1f4;return function(_0x177929){logger[_0xb643('0x23')](_0x177929['stack']);if(_0x177929[_0xb643('0x33')]){delete _0x177929[_0xb643('0x33')];}_0x9bf675[_0xb643('0x27')](_0x55b194)[_0xb643('0x34')](_0x177929);};}exports[_0xb643('0x35')]=function(_0x5c200e,_0x2ee6ba){var _0x5ff140={},_0x2fa693={},_0x643f50={'count':0x0,'rows':[]};var _0x4d3683=_[_0xb643('0x36')](db[_0xb643('0x37')][_0xb643('0x38')],function(_0x14d37b){return{'name':_0x14d37b['fieldName'],'type':_0x14d37b['type'][_0xb643('0x39')]};});_0x2fa693[_0xb643('0x3a')]=_[_0xb643('0x36')](_0x4d3683,_0xb643('0x33'));_0x2fa693[_0xb643('0x3b')]=_[_0xb643('0x3c')](_0x5c200e['query']);_0x2fa693[_0xb643('0x3d')]=_[_0xb643('0x3e')](_0x2fa693[_0xb643('0x3a')],_0x2fa693[_0xb643('0x3b')]);_0x5ff140[_0xb643('0x3f')]=_[_0xb643('0x3e')](_0x2fa693['model'],qs['fields'](_0x5c200e[_0xb643('0x3b')]['fields']));_0x5ff140['attributes']=_0x5ff140[_0xb643('0x3f')][_0xb643('0x40')]?_0x5ff140['attributes']:_0x2fa693[_0xb643('0x3a')];if(!_0x5c200e[_0xb643('0x3b')][_0xb643('0x41')](_0xb643('0x42'))){_0x5ff140[_0xb643('0x2c')]=qs['limit'](_0x5c200e['query'][_0xb643('0x2c')]);_0x5ff140[_0xb643('0x2a')]=qs[_0xb643('0x2a')](_0x5c200e[_0xb643('0x3b')]['offset']);}_0x5ff140[_0xb643('0x43')]=qs[_0xb643('0x44')](_0x5c200e[_0xb643('0x3b')]['sort']);_0x5ff140[_0xb643('0x45')]=qs[_0xb643('0x3d')](_[_0xb643('0x46')](_0x5c200e['query'],_0x2fa693['filters']),_0x4d3683);if(_0x5c200e[_0xb643('0x3b')][_0xb643('0x47')]){_0x5ff140['where']=_[_0xb643('0x48')](_0x5ff140[_0xb643('0x45')],{'$or':_['map'](_0x4d3683,function(_0xf643ae){if(_0xf643ae['type']!=='VIRTUAL'){var _0x31cbe4={};_0x31cbe4[_0xf643ae[_0xb643('0x33')]]={'$like':'%'+_0x5c200e['query'][_0xb643('0x47')]+'%'};return _0x31cbe4;}})});}_0x5ff140=_['merge']({},_0x5ff140,_0x5c200e[_0xb643('0x49')]);var _0x46cd57={'where':_0x5ff140['where']};return db[_0xb643('0x37')]['count'](_0x46cd57)[_0xb643('0x1c')](function(_0x2528e4){_0x643f50['count']=_0x2528e4;if(_0x5c200e[_0xb643('0x3b')][_0xb643('0x4a')]){_0x5ff140[_0xb643('0x4b')]=[{'all':!![]}];}return db[_0xb643('0x37')][_0xb643('0x4c')](_0x5ff140);})[_0xb643('0x1c')](function(_0x51bc62){_0x643f50[_0xb643('0x4d')]=_0x51bc62;return _0x643f50;})[_0xb643('0x1c')](respondWithFilteredResult(_0x2ee6ba,_0x5ff140))[_0xb643('0x4e')](handleError(_0x2ee6ba,null));};exports[_0xb643('0x4f')]=function(_0x2a93ee,_0x44bc59){var _0x4ba9fd={'raw':![],'where':{'id':_0x2a93ee[_0xb643('0x50')]['id']}},_0x4a42b8={};_0x4a42b8[_0xb643('0x3a')]=_[_0xb643('0x3c')](db['Setting']['rawAttributes']);_0x4a42b8[_0xb643('0x3b')]=_[_0xb643('0x3c')](_0x2a93ee['query']);_0x4a42b8['filters']=_[_0xb643('0x3e')](_0x4a42b8['model'],_0x4a42b8[_0xb643('0x3b')]);_0x4ba9fd['attributes']=_[_0xb643('0x3e')](_0x4a42b8[_0xb643('0x3a')],qs[_0xb643('0x51')](_0x2a93ee['query'][_0xb643('0x51')]));_0x4ba9fd[_0xb643('0x3f')]=_0x4ba9fd['attributes'][_0xb643('0x40')]?_0x4ba9fd[_0xb643('0x3f')]:_0x4a42b8[_0xb643('0x3a')];if(_0x2a93ee['query'][_0xb643('0x4a')]){_0x4ba9fd['include']=[{'all':!![]}];}_0x4ba9fd=_['merge']({},_0x4ba9fd,_0x2a93ee[_0xb643('0x49')]);return db[_0xb643('0x37')][_0xb643('0x52')](_0x4ba9fd)[_0xb643('0x1c')](handleEntityNotFound(_0x44bc59,null))[_0xb643('0x1c')](respondWithResult(_0x44bc59,null))[_0xb643('0x4e')](handleError(_0x44bc59,null));};exports['update']=function(_0x445cd0,_0x22b78c){if(_0x445cd0[_0xb643('0x53')]['id']){delete _0x445cd0[_0xb643('0x53')]['id'];}return db[_0xb643('0x37')][_0xb643('0x52')]({'where':{'id':_0x445cd0[_0xb643('0x50')]['id']}})[_0xb643('0x1c')](handleEntityNotFound(_0x22b78c,null))['then'](saveUpdates(_0x445cd0[_0xb643('0x53')],null))['then'](respondWithResult(_0x22b78c,null))[_0xb643('0x4e')](handleError(_0x22b78c,null));};exports['addLogo']=function(_0x279d85,_0x3947fd,_0x5f2476){if(_0x279d85[_0xb643('0x54')]&&_0x279d85[_0xb643('0x54')]['filename']){_0x279d85[_0xb643('0x53')]['logo']=_0x279d85[_0xb643('0x54')][_0xb643('0x55')];}return db[_0xb643('0x37')][_0xb643('0x52')]({'where':{'id':_0x279d85[_0xb643('0x50')]['id']}})[_0xb643('0x1c')](handleEntityNotFound(_0x3947fd,null))[_0xb643('0x1c')](saveUpdates(_0x279d85[_0xb643('0x53')],null))[_0xb643('0x1c')](respondWithResult(_0x3947fd,null))['catch'](handleError(_0x3947fd,null));};exports[_0xb643('0x56')]=function(_0xf0c2be,_0x31e32a,_0x5e023c){if(_0xf0c2be[_0xb643('0x54')]&&_0xf0c2be['file'][_0xb643('0x55')]){_0xf0c2be[_0xb643('0x53')][_0xb643('0x57')]=_0xf0c2be['file'][_0xb643('0x55')];}return db[_0xb643('0x37')][_0xb643('0x52')]({'where':{'id':_0xf0c2be[_0xb643('0x50')]['id']}})[_0xb643('0x1c')](handleEntityNotFound(_0x31e32a,null))[_0xb643('0x1c')](saveUpdates(_0xf0c2be['body'],null))[_0xb643('0x1c')](respondWithResult(_0x31e32a,null))[_0xb643('0x4e')](handleError(_0x31e32a,null));};var utilLicense=require(_0xb643('0x58'));exports[_0xb643('0x59')]=function(_0x3291fb,_0x3abe43,_0x5241af){var _0x52241c=_0xb643('0x5a');var _0x1cb3cd={'custom':![]};return utilLicense[_0xb643('0x5b')]()[_0xb643('0x1c')](function(_0x415a4a){if(_0x415a4a){_0x1cb3cd=_0x415a4a;}return db[_0xb643('0x37')][_0xb643('0x52')]({'where':{'id':_0x3291fb[_0xb643('0x50')]['id']},'attributes':[_0xb643('0x5c'),'loginLogo',_0xb643('0x5d'),_0xb643('0x5e'),'defaultLogo','defaultLoginLogo',_0xb643('0x5f'),_0xb643('0x60')],'raw':!![]});})[_0xb643('0x1c')](handleEntityNotFound(_0x3abe43,null))[_0xb643('0x1c')](function(_0x1f087f){if(_0x1f087f){var _0x314b7f=_0x1f087f[_0xb643('0x5c')]&&fs[_0xb643('0x61')](path[_0xb643('0x62')](config['root'],_0x52241c,_[_0xb643('0x63')](_0x1f087f[_0xb643('0x5c')])))?path[_0xb643('0x62')](config[_0xb643('0x64')],_0x52241c,_[_0xb643('0x63')](_0x1f087f[_0xb643('0x5c')])):path['join'](config[_0xb643('0x64')],_0x52241c,_[_0xb643('0x63')](_0xb643('0x65')));var _0x334658=_0xb643('0x66')+_[_0xb643('0x67')](_0xb643('0x5c'));if(_0x1f087f[_0x334658]||!_0x1cb3cd[_0xb643('0x68')]){_0x314b7f=path[_0xb643('0x62')](config['root'],_0x52241c,_[_0xb643('0x63')](_0xb643('0x65')));}if(!fs['existsSync'](_0x314b7f)){throw new db[(_0xb643('0x69'))]['ValidationError'](_['upperFirst'](_0xb643('0x5c'))+'\x20not\x20found');}return _0x3abe43[_0xb643('0x6a')](_0x314b7f);}})[_0xb643('0x4e')](handleError(_0x3abe43,null));};var utilLicense=require(_0xb643('0x58'));exports['getLogoLogin']=function(_0x5503d0,_0x410319,_0x15fde2){var _0x56a405=_0xb643('0x5a');var _0x31dcdb={'custom':![]};return utilLicense[_0xb643('0x5b')]()[_0xb643('0x1c')](function(_0x376e75){if(_0x376e75){_0x31dcdb=_0x376e75;}return db['Setting'][_0xb643('0x52')]({'where':{'id':_0x5503d0['params']['id']},'attributes':[_0xb643('0x5c'),_0xb643('0x57'),'preferred',_0xb643('0x5e'),_0xb643('0x6b'),_0xb643('0x6c'),_0xb643('0x5f'),_0xb643('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x410319,null))[_0xb643('0x1c')](function(_0x5594c1){if(_0x5594c1){var _0x5d4e69=_0x5594c1[_0xb643('0x57')]&&fs['existsSync'](path[_0xb643('0x62')](config[_0xb643('0x64')],_0x56a405,_['toLower'](_0x5594c1[_0xb643('0x57')])))?path['join'](config[_0xb643('0x64')],_0x56a405,_['toLower'](_0x5594c1[_0xb643('0x57')])):path[_0xb643('0x62')](config[_0xb643('0x64')],_0x56a405,_['toLower'](_0xb643('0x6d')));var _0x5446ef='default'+_['upperFirst'](_0xb643('0x57'));if(_0x5594c1[_0x5446ef]||!_0x31dcdb[_0xb643('0x68')]){_0x5d4e69=path[_0xb643('0x62')](config['root'],_0x56a405,_['toLower'](_0xb643('0x6d')));}if(!fs[_0xb643('0x61')](_0x5d4e69)){throw new db[(_0xb643('0x69'))][(_0xb643('0x6e'))](_[_0xb643('0x67')](_0xb643('0x57'))+_0xb643('0x6f'));}return _0x410319['download'](_0x5d4e69);}})[_0xb643('0x4e')](handleError(_0x410319,null));};exports[_0xb643('0x70')]=function(_0x33ac79,_0x297ae5){return db[_0xb643('0x37')][_0xb643('0x52')]({'where':{'id':_0x33ac79['params']['id']},'attributes':[_0xb643('0x71')]})[_0xb643('0x1c')](respondWithResult(_0x297ae5,null))['catch'](handleError(_0x297ae5,null));};exports[_0xb643('0x72')]=function(_0x3af94f,_0x1c672d,_0xcba0fa){if(_0x3af94f[_0xb643('0x54')]&&_0x3af94f['file'][_0xb643('0x55')]){_0x3af94f[_0xb643('0x53')][_0xb643('0x5d')]=_0x3af94f[_0xb643('0x54')][_0xb643('0x55')];}return db[_0xb643('0x37')]['find']({'where':{'id':_0x3af94f[_0xb643('0x50')]['id']}})[_0xb643('0x1c')](handleEntityNotFound(_0x1c672d,null))[_0xb643('0x1c')](saveUpdates(_0x3af94f['body'],null))[_0xb643('0x1c')](respondWithResult(_0x1c672d,null))[_0xb643('0x4e')](handleError(_0x1c672d,null));};var utilLicense=require(_0xb643('0x58'));exports[_0xb643('0x73')]=function(_0x3adca6,_0x576bd0,_0x112981){var _0x43edc9=_0xb643('0x5a');var _0x69ebce={'custom':![]};return utilLicense[_0xb643('0x5b')]()[_0xb643('0x1c')](function(_0x2b846d){if(_0x2b846d){_0x69ebce=_0x2b846d;}return db[_0xb643('0x37')][_0xb643('0x52')]({'where':{'id':_0x3adca6[_0xb643('0x50')]['id']},'attributes':['logo',_0xb643('0x57'),_0xb643('0x5d'),'favicon',_0xb643('0x6b'),_0xb643('0x6c'),_0xb643('0x5f'),_0xb643('0x60')],'raw':!![]});})[_0xb643('0x1c')](handleEntityNotFound(_0x576bd0,null))['then'](function(_0x2701d6){if(_0x2701d6){var _0x5d61dc=_0x2701d6[_0xb643('0x5d')]&&fs[_0xb643('0x61')](path[_0xb643('0x62')](config[_0xb643('0x64')],_0x43edc9,_['toLower'](_0x2701d6[_0xb643('0x5d')])))?path[_0xb643('0x62')](config[_0xb643('0x64')],_0x43edc9,_[_0xb643('0x63')](_0x2701d6[_0xb643('0x5d')])):path[_0xb643('0x62')](config['root'],_0x43edc9,_[_0xb643('0x63')](_0xb643('0x74')));var _0x3011ec=_0xb643('0x66')+_[_0xb643('0x67')](_0xb643('0x5d'));if(_0x2701d6[_0x3011ec]||!_0x69ebce[_0xb643('0x68')]||!_0x69ebce[_0xb643('0x5d')]){_0x5d61dc=path[_0xb643('0x62')](config[_0xb643('0x64')],_0x43edc9,_[_0xb643('0x63')](_0xb643('0x74')));}if(!fs['existsSync'](_0x5d61dc)){throw new db['Sequelize'][(_0xb643('0x6e'))](_['upperFirst']('preferred')+_0xb643('0x6f'));}return _0x576bd0[_0xb643('0x6a')](_0x5d61dc);}})['catch'](handleError(_0x576bd0,null));};exports[_0xb643('0x75')]=function(_0x334d74,_0x2cbc6e,_0x406fa7){if(_0x334d74[_0xb643('0x54')]&&_0x334d74[_0xb643('0x54')][_0xb643('0x55')]){_0x334d74['body'][_0xb643('0x5e')]=_0x334d74[_0xb643('0x54')]['filename'];}return db[_0xb643('0x37')][_0xb643('0x52')]({'where':{'id':_0x334d74[_0xb643('0x50')]['id']}})[_0xb643('0x1c')](handleEntityNotFound(_0x2cbc6e,null))[_0xb643('0x1c')](saveUpdates(_0x334d74[_0xb643('0x53')],null))[_0xb643('0x1c')](respondWithResult(_0x2cbc6e,null))[_0xb643('0x4e')](handleError(_0x2cbc6e,null));};var utilLicense=require('../../config/license/util');exports[_0xb643('0x76')]=function(_0x350310,_0x4d67e9,_0x2edf7a){var _0x5a6f75='server/files/images/logos';var _0x1dcd46={'custom':![]};return utilLicense[_0xb643('0x5b')]()[_0xb643('0x1c')](function(_0x161dd8){if(_0x161dd8){_0x1dcd46=_0x161dd8;}return db[_0xb643('0x37')][_0xb643('0x52')]({'where':{'id':_0x350310[_0xb643('0x50')]['id']},'attributes':['logo',_0xb643('0x57'),'preferred',_0xb643('0x5e'),_0xb643('0x6b'),_0xb643('0x6c'),_0xb643('0x5f'),_0xb643('0x60')],'raw':!![]});})[_0xb643('0x1c')](handleEntityNotFound(_0x4d67e9,null))['then'](function(_0x2180d1){if(_0x2180d1){var _0x588de5=_0x2180d1[_0xb643('0x5e')]&&fs[_0xb643('0x61')](path[_0xb643('0x62')](config[_0xb643('0x64')],_0x5a6f75,_['toLower'](_0x2180d1[_0xb643('0x5e')])))?path['join'](config[_0xb643('0x64')],_0x5a6f75,_[_0xb643('0x63')](_0x2180d1[_0xb643('0x5e')])):path[_0xb643('0x62')](config['root'],_0x5a6f75,_['toLower']('default_favicon.ico'));var _0x5ba105='default'+_[_0xb643('0x67')](_0xb643('0x5e'));if(_0x2180d1[_0x5ba105]||!_0x1dcd46[_0xb643('0x68')]){_0x588de5=path[_0xb643('0x62')](config[_0xb643('0x64')],_0x5a6f75,_['toLower'](_0xb643('0x77')));}if(!fs['existsSync'](_0x588de5)){throw new db[(_0xb643('0x69'))]['ValidationError'](_['upperFirst'](_0xb643('0x5e'))+'\x20not\x20found');}return _0x4d67e9[_0xb643('0x6a')](_0x588de5);}})[_0xb643('0x4e')](handleError(_0x4d67e9,null));};exports['getDate']=function(_0x40db1e,_0x264297){var _0x5dd28f={'offset':moment()[_0xb643('0x78')]()};_0x5dd28f['now']=moment()[_0xb643('0x78')](_0x5dd28f[_0xb643('0x2a')])[_0xb643('0x79')](_0xb643('0x7a'));return _0x264297[_0xb643('0x27')](0xc8)[_0xb643('0x34')](_0x5dd28f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 5087066..8e236c6 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33c1b1,_0x2355fb){var _0x2c2037=function(_0x1200fd){while(--_0x1200fd){_0x33c1b1['push'](_0x33c1b1['shift']());}};_0x2c2037(++_0x2355fb);}(_0x7217,0x19e));var _0x7721=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7217[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index f1ae505..a2d6342 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 _0x61e8=['request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','options','raw','where','attributes','include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s'];(function(_0x42f270,_0x452dec){var _0x57bc5b=function(_0x258159){while(--_0x258159){_0x42f270['push'](_0x42f270['shift']());}};_0x57bc5b(++_0x452dec);}(_0x61e8,0x185));var _0x861e=function(_0x4afb5b,_0x9b06e2){_0x4afb5b=_0x4afb5b-0x0;var _0x40c9bc=_0x61e8[_0x4afb5b];return _0x40c9bc;};'use strict';var _=require(_0x861e('0x0'));var util=require(_0x861e('0x1'));var moment=require('moment');var BPromise=require(_0x861e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x861e('0x3'));var db=require(_0x861e('0x4'))['db'];var utils=require(_0x861e('0x5'));var logger=require(_0x861e('0x6'))('rpc');var config=require(_0x861e('0x7'));var jayson=require(_0x861e('0x8'));var client=jayson[_0x861e('0x9')][_0x861e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58c550,_0x412c1d,_0x4532fc){return new BPromise(function(_0x183424,_0x10b466){return client['request'](_0x58c550,_0x4532fc)[_0x861e('0xb')](function(_0xfbbcc9){logger[_0x861e('0xc')](_0x861e('0xd'),_0x412c1d,_0x861e('0xe'));logger[_0x861e('0xf')](_0x861e('0x10'),_0x412c1d,_0x861e('0xe'),JSON[_0x861e('0x11')](_0xfbbcc9));if(_0xfbbcc9['error']){if(_0xfbbcc9[_0x861e('0x12')][_0x861e('0x13')]===0x1f4){logger[_0x861e('0x12')]('Setting,\x20%s,\x20%s',_0x412c1d,_0xfbbcc9[_0x861e('0x12')][_0x861e('0x14')]);return _0x10b466(_0xfbbcc9[_0x861e('0x12')][_0x861e('0x14')]);}logger[_0x861e('0x12')](_0x861e('0xd'),_0x412c1d,_0xfbbcc9[_0x861e('0x12')][_0x861e('0x14')]);return _0x183424(_0xfbbcc9[_0x861e('0x12')][_0x861e('0x14')]);}else{logger[_0x861e('0xc')](_0x861e('0xd'),_0x412c1d,_0x861e('0xe'));_0x183424(_0xfbbcc9['result'][_0x861e('0x14')]);}})[_0x861e('0x15')](function(_0x4e4545){logger[_0x861e('0x12')](_0x861e('0xd'),_0x412c1d,_0x4e4545);_0x10b466(_0x4e4545);});});}exports[_0x861e('0x16')]=function(_0x490bd9){var _0x4bda40=this;return new Promise(function(_0x3b91ce,_0x78853b){return db[_0x861e('0x17')]['find']({'raw':_0x490bd9[_0x861e('0x18')]?_0x490bd9['options'][_0x861e('0x19')]===undefined?!![]:![]:!![],'where':_0x490bd9[_0x861e('0x18')]?_0x490bd9['options'][_0x861e('0x1a')]||null:null,'attributes':_0x490bd9['options']?_0x490bd9[_0x861e('0x18')][_0x861e('0x1b')]||null:null,'include':_0x490bd9['options']?_0x490bd9[_0x861e('0x18')][_0x861e('0x1c')]?_[_0x861e('0x1d')](_0x490bd9['options']['include'],function(_0x39f1b4){return{'model':db[_0x39f1b4['model']],'as':_0x39f1b4['as'],'attributes':_0x39f1b4[_0x861e('0x1b')],'include':_0x39f1b4[_0x861e('0x1c')]?_['map'](_0x39f1b4['include'],function(_0x332043){return{'model':db[_0x332043[_0x861e('0x1e')]],'as':_0x332043['as'],'attributes':_0x332043[_0x861e('0x1b')],'include':_0x332043[_0x861e('0x1c')]?_['map'](_0x332043[_0x861e('0x1c')],function(_0x58a664){return{'model':db[_0x58a664[_0x861e('0x1e')]],'as':_0x58a664['as'],'attributes':_0x58a664[_0x861e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x861e('0xb')](function(_0x12d2f0){logger[_0x861e('0xc')](_0x861e('0x16'),_0x490bd9);logger[_0x861e('0xf')](_0x861e('0x16'),_0x490bd9,JSON['stringify'](_0x12d2f0));_0x3b91ce(_0x12d2f0);})['catch'](function(_0xb72b01){logger[_0x861e('0x12')]('ShowSetting',_0xb72b01[_0x861e('0x14')],_0x490bd9);_0x78853b(_0x4bda40[_0x861e('0x12')](0x1f4,_0xb72b01[_0x861e('0x14')]));});});}; \ No newline at end of file +var _0x5707=['info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','find','options','raw','attributes','include','model','map','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x34eb69,_0x1f466b){var _0x58eb15=function(_0x2882a8){while(--_0x2882a8){_0x34eb69['push'](_0x34eb69['shift']());}};_0x58eb15(++_0x1f466b);}(_0x5707,0x1b3));var _0x7570=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x5707[_0x1af1e1];return _0x5f3450;};'use strict';var _=require(_0x7570('0x0'));var util=require(_0x7570('0x1'));var moment=require(_0x7570('0x2'));var BPromise=require('bluebird');var rs=require(_0x7570('0x3'));var fs=require('fs');var Redis=require(_0x7570('0x4'));var db=require(_0x7570('0x5'))['db'];var utils=require(_0x7570('0x6'));var logger=require(_0x7570('0x7'))(_0x7570('0x8'));var config=require('../../config/environment');var jayson=require(_0x7570('0x9'));var client=jayson[_0x7570('0xa')][_0x7570('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x476064,_0x526359,_0x5aa4c2){return new BPromise(function(_0x4a9135,_0x16be8a){return client['request'](_0x476064,_0x5aa4c2)[_0x7570('0xc')](function(_0x39e952){logger[_0x7570('0xd')](_0x7570('0xe'),_0x526359,_0x7570('0xf'));logger[_0x7570('0x10')](_0x7570('0x11'),_0x526359,_0x7570('0xf'),JSON[_0x7570('0x12')](_0x39e952));if(_0x39e952['error']){if(_0x39e952[_0x7570('0x13')][_0x7570('0x14')]===0x1f4){logger[_0x7570('0x13')](_0x7570('0xe'),_0x526359,_0x39e952['error'][_0x7570('0x15')]);return _0x16be8a(_0x39e952[_0x7570('0x13')]['message']);}logger[_0x7570('0x13')](_0x7570('0xe'),_0x526359,_0x39e952[_0x7570('0x13')][_0x7570('0x15')]);return _0x4a9135(_0x39e952[_0x7570('0x13')][_0x7570('0x15')]);}else{logger['info'](_0x7570('0xe'),_0x526359,_0x7570('0xf'));_0x4a9135(_0x39e952[_0x7570('0x16')][_0x7570('0x15')]);}})[_0x7570('0x17')](function(_0x4e8e79){logger['error'](_0x7570('0xe'),_0x526359,_0x4e8e79);_0x16be8a(_0x4e8e79);});});}exports[_0x7570('0x18')]=function(_0x3af4e0){var _0x373a69=this;return new Promise(function(_0x50f0f3,_0x468fd0){return db['Setting'][_0x7570('0x19')]({'raw':_0x3af4e0[_0x7570('0x1a')]?_0x3af4e0['options'][_0x7570('0x1b')]===undefined?!![]:![]:!![],'where':_0x3af4e0[_0x7570('0x1a')]?_0x3af4e0[_0x7570('0x1a')]['where']||null:null,'attributes':_0x3af4e0[_0x7570('0x1a')]?_0x3af4e0[_0x7570('0x1a')][_0x7570('0x1c')]||null:null,'include':_0x3af4e0[_0x7570('0x1a')]?_0x3af4e0[_0x7570('0x1a')][_0x7570('0x1d')]?_['map'](_0x3af4e0['options'][_0x7570('0x1d')],function(_0x31a2b6){return{'model':db[_0x31a2b6[_0x7570('0x1e')]],'as':_0x31a2b6['as'],'attributes':_0x31a2b6['attributes'],'include':_0x31a2b6[_0x7570('0x1d')]?_[_0x7570('0x1f')](_0x31a2b6[_0x7570('0x1d')],function(_0x204547){return{'model':db[_0x204547[_0x7570('0x1e')]],'as':_0x204547['as'],'attributes':_0x204547[_0x7570('0x1c')],'include':_0x204547[_0x7570('0x1d')]?_[_0x7570('0x1f')](_0x204547[_0x7570('0x1d')],function(_0x5b6f71){return{'model':db[_0x5b6f71[_0x7570('0x1e')]],'as':_0x5b6f71['as'],'attributes':_0x5b6f71[_0x7570('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7570('0xc')](function(_0x32d03f){logger[_0x7570('0xd')](_0x7570('0x18'),_0x3af4e0);logger[_0x7570('0x10')](_0x7570('0x18'),_0x3af4e0,JSON['stringify'](_0x32d03f));_0x50f0f3(_0x32d03f);})[_0x7570('0x17')](function(_0x2d1c52){logger[_0x7570('0x13')](_0x7570('0x18'),_0x2d1c52['message'],_0x3af4e0);_0x468fd0(_0x373a69[_0x7570('0x13')](0x1f4,_0x2d1c52[_0x7570('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index b820174..9f3bb97 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 _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x4f7418,_0x1755cc){var _0x4afe7e=function(_0x5ae646){while(--_0x5ae646){_0x4f7418['push'](_0x4f7418['shift']());}};_0x4afe7e(++_0x1755cc);}(_0x814b,0x1a2));var _0xb814=function(_0x1282a0,_0x58b2f9){_0x1282a0=_0x1282a0-0x0;var _0x18af0c=_0x814b[_0x1282a0];return _0x18af0c;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x1d2574,_0x3b079b){var _0x5e0c5b=function(_0x33c734){while(--_0x33c734){_0x1d2574['push'](_0x1d2574['shift']());}};_0x5e0c5b(++_0x3b079b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index eb41320..5f2d94c 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 _0x4be4=['generate','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','ENUM','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name'];(function(_0x246b17,_0x17f237){var _0x3cd550=function(_0x372d0a){while(--_0x372d0a){_0x246b17['push'](_0x246b17['shift']());}};_0x3cd550(++_0x17f237);}(_0x4be4,0xf9));var _0x44be=function(_0x3f761d,_0x5d907d){_0x3f761d=_0x3f761d-0x0;var _0x49d6e3=_0x4be4[_0x3f761d];return _0x49d6e3;};'use strict';var Sequelize=require(_0x44be('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x44be('0x1')],'unique':_0x44be('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x44be('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x44be('0x3')]();}},'phone':{'type':Sequelize[_0x44be('0x1')]},'type':{'type':Sequelize['ENUM'](_0x44be('0x4'),_0x44be('0x5'),_0x44be('0x6'),_0x44be('0x7'),_0x44be('0x8'),_0x44be('0x9'),'bandwidth',_0x44be('0xa'),_0x44be('0xb'),_0x44be('0xc'))},'accountSid':{'type':Sequelize[_0x44be('0x1')]},'authId':{'type':Sequelize[_0x44be('0x1')]},'authToken':{'type':Sequelize[_0x44be('0x1')]},'smsMethod':{'type':Sequelize[_0x44be('0xd')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x44be('0x1')]},'apiKey':{'type':Sequelize[_0x44be('0x1')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x44be('0x1')]},'senderString':{'type':Sequelize[_0x44be('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x44be('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x44be('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x44be('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x44be('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x44be('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x44be('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x44be('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x44be('0x10')],'defaultValue':![],'comment':_0x44be('0x11'),'set':function(_0x5573c9){if(!_0x5573c9)this[_0x44be('0x12')](_0x44be('0x13'),null);this['setDataValue'](_0x44be('0x14'),_0x5573c9);}}}; \ No newline at end of file +var _0x24d2=['csc','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth'];(function(_0x5b329b,_0x193b68){var _0xab178b=function(_0x34755a){while(--_0x34755a){_0x5b329b['push'](_0x5b329b['shift']());}};_0xab178b(++_0x193b68);}(_0x24d2,0x7e));var _0x224d=function(_0x14d2cc,_0x426814){_0x14d2cc=_0x14d2cc-0x0;var _0x3446f8=_0x24d2[_0x14d2cc];return _0x3446f8;};'use strict';var Sequelize=require(_0x224d('0x0'));var rs=require('randomstring');module[_0x224d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x224d('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x224d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x224d('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x224d('0x3')]},'type':{'type':Sequelize[_0x224d('0x4')](_0x224d('0x5'),_0x224d('0x6'),_0x224d('0x7'),_0x224d('0x8'),_0x224d('0x9'),_0x224d('0xa'),_0x224d('0xb'),_0x224d('0xc'),_0x224d('0xd'),_0x224d('0xe'))},'accountSid':{'type':Sequelize[_0x224d('0x3')]},'authId':{'type':Sequelize[_0x224d('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x224d('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x224d('0x3')]},'applicationId':{'type':Sequelize[_0x224d('0x3')]},'accountId':{'type':Sequelize[_0x224d('0x3')]},'senderString':{'type':Sequelize[_0x224d('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x224d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x224d('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x224d('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x224d('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x224d('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x224d('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x224d('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x224d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x224d('0x11')],'comment':_0x224d('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x224d('0x10')],'defaultValue':![],'comment':_0x224d('0x13'),'set':function(_0x56c24e){if(!_0x56c24e)this[_0x224d('0x14')](_0x224d('0x15'),null);this[_0x224d('0x14')](_0x224d('0x16'),_0x56c24e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 33f6043..90533cc 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 _0x4105=['includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','orderBy','Applications','priority','asc','account','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','sender','text','connectel','from','clicksend','messageId','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','SmsInteraction','interaction','applications','push','close','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','user','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','redif','SmsAccount,\x20%s,\x20%s,\x20%s','message-delivered','intelepeer','DELIVRD','statusGet','message-id','state','addAgents','omit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x1f4497,_0x57f619){var _0x11eac4=function(_0x2d50df){while(--_0x2d50df){_0x1f4497['push'](_0x1f4497['shift']());}};_0x11eac4(++_0x57f619);}(_0x4105,0x92));var _0x5410=function(_0x38359e,_0x37191b){_0x38359e=_0x38359e-0x0;var _0x623335=_0x4105[_0x38359e];return _0x623335;};'use strict';var emlformat=require(_0x5410('0x0'));var rimraf=require(_0x5410('0x1'));var zipdir=require(_0x5410('0x2'));var jsonpatch=require(_0x5410('0x3'));var rp=require('request-promise');var moment=require(_0x5410('0x4'));var BPromise=require(_0x5410('0x5'));var Mustache=require('mustache');var util=require(_0x5410('0x6'));var path=require(_0x5410('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5410('0x8'));var fs=require('fs');var fs_extra=require(_0x5410('0x9'));var _=require(_0x5410('0xa'));var squel=require(_0x5410('0xb'));var crypto=require(_0x5410('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5410('0xd'));var toCsv=require(_0x5410('0xe'));var querystring=require(_0x5410('0xf'));var Papa=require(_0x5410('0x10'));var Redis=require(_0x5410('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5410('0x12'));var as=require(_0x5410('0x13'));var hardwareService=require(_0x5410('0x14'));var logger=require(_0x5410('0x15'))(_0x5410('0x16'));var utils=require(_0x5410('0x17'));var config=require(_0x5410('0x18'));var licenseUtil=require(_0x5410('0x19'));var db=require(_0x5410('0x1a'))['db'];config[_0x5410('0x1b')]=_[_0x5410('0x1c')](config[_0x5410('0x1b')],{'host':_0x5410('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5410('0x1b')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x5410('0x1e'));var client=jayson[_0x5410('0x1f')][_0x5410('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x1caf7c,_0x1f70a6,_0x131484,_0x3f6a07){return new BPromise(function(_0x3acb85,_0x6667e8){var _0x49ff81=_0x3f6a07||client;return _0x49ff81[_0x5410('0x21')](_0x1caf7c,_0x131484)[_0x5410('0x22')](function(_0x394164){logger[_0x5410('0x23')](_0x5410('0x24'),_0x1f70a6,_0x5410('0x25'));logger[_0x5410('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1f70a6,'request\x20sent',JSON['stringify'](_0x394164));if(_0x394164[_0x5410('0x27')]){if(_0x394164[_0x5410('0x27')]['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x1f70a6,_0x394164[_0x5410('0x27')][_0x5410('0x28')]);return _0x6667e8(_0x394164['error'][_0x5410('0x28')]);}logger[_0x5410('0x27')]('SmsAccount,\x20%s,\x20%s',_0x1f70a6,_0x394164['error'][_0x5410('0x28')]);return _0x3acb85(_0x394164[_0x5410('0x27')][_0x5410('0x28')]);}else{logger[_0x5410('0x23')](_0x5410('0x24'),_0x1f70a6,_0x5410('0x25'));_0x3acb85(_0x394164['result'][_0x5410('0x28')]);}})[_0x5410('0x29')](function(_0x40a78f){logger[_0x5410('0x27')](_0x5410('0x24'),_0x1f70a6,_0x40a78f);_0x6667e8(_0x40a78f);});});}function respondWithStatusCode(_0x3e1dea,_0x2f36da){_0x2f36da=_0x2f36da||0xcc;return function(_0x565dd9){if(_0x565dd9){return _0x3e1dea[_0x5410('0x2a')](_0x2f36da);}return _0x3e1dea[_0x5410('0x2b')](_0x2f36da)['end']();};}function respondWithResult(_0x89d67f,_0x3349bd){_0x3349bd=_0x3349bd||0xc8;return function(_0x21bbf7){if(_0x21bbf7){return _0x89d67f[_0x5410('0x2b')](_0x3349bd)[_0x5410('0x2c')](_0x21bbf7);}};}function respondWithFilteredResult(_0x177b44,_0x38cffd){return function(_0x25531a){if(_0x25531a){var _0x41a5de=typeof _0x38cffd[_0x5410('0x2d')]===_0x5410('0x2e')&&typeof _0x38cffd[_0x5410('0x2f')]===_0x5410('0x2e');var _0x3228aa=_0x25531a[_0x5410('0x30')];var _0x5698bf=_0x41a5de?0x0:_0x38cffd['offset'];var _0x40cf65=_0x41a5de?_0x25531a[_0x5410('0x30')]:_0x38cffd[_0x5410('0x2d')]+_0x38cffd[_0x5410('0x2f')];var _0x2ae9be;if(_0x40cf65>=_0x3228aa){_0x40cf65=_0x3228aa;_0x2ae9be=0xc8;}else{_0x2ae9be=0xce;}_0x177b44[_0x5410('0x2b')](_0x2ae9be);return _0x177b44[_0x5410('0x31')](_0x5410('0x32'),_0x5698bf+'-'+_0x40cf65+'/'+_0x3228aa)[_0x5410('0x2c')](_0x25531a);}return null;};}function patchUpdates(_0xef4f20){return function(_0x214d87){try{jsonpatch['apply'](_0x214d87,_0xef4f20,!![]);}catch(_0x6f7350){return BPromise['reject'](_0x6f7350);}return _0x214d87[_0x5410('0x33')]();};}function saveUpdates(_0x5aca76,_0x2d8f81){return function(_0x42e093){if(_0x42e093){return _0x42e093[_0x5410('0x34')](_0x5aca76)['then'](function(_0x3cd956){return _0x3cd956;});}return null;};}function removeEntity(_0x574c3a,_0x1dd54b){return function(_0xe33cf4){if(_0xe33cf4){return _0xe33cf4[_0x5410('0x35')]()[_0x5410('0x22')](function(){var _0x1ba1dd=_0xe33cf4[_0x5410('0x36')]({'plain':!![]});var _0x34d0df=_0x5410('0x37');return db[_0x5410('0x38')][_0x5410('0x35')]({'where':{'type':_0x34d0df,'resourceId':_0x1ba1dd['id']}})[_0x5410('0x22')](function(){return _0xe33cf4;});})[_0x5410('0x22')](function(){_0x574c3a[_0x5410('0x2b')](0xcc)[_0x5410('0x39')]();});}};}function handleEntityNotFound(_0x3ab666,_0x4da9ee){return function(_0x4427c0){if(!_0x4427c0){_0x3ab666[_0x5410('0x2a')](0x194);}return _0x4427c0;};}function handleError(_0x29ea34,_0xf90860){_0xf90860=_0xf90860||0x1f4;return function(_0x93a741){logger[_0x5410('0x27')](_0x93a741[_0x5410('0x3a')]);if(_0x93a741[_0x5410('0x3b')]){delete _0x93a741[_0x5410('0x3b')];}_0x29ea34[_0x5410('0x2b')](_0xf90860)[_0x5410('0x3c')](_0x93a741);};}exports['index']=function(_0x102dda,_0x36ba82){var _0x5bcad4={'include':[{'model':db[_0x5410('0x3d')],'as':_0x5410('0x3e')}]},_0x22b681={},_0x5582bd={'count':0x0,'rows':[]};var _0x25821a=_[_0x5410('0x3f')](db[_0x5410('0x40')][_0x5410('0x41')],function(_0x59ac7e){return{'name':_0x59ac7e[_0x5410('0x42')],'type':_0x59ac7e['type'][_0x5410('0x43')]};});_0x22b681['model']=_[_0x5410('0x3f')](_0x25821a,_0x5410('0x3b'));_0x22b681[_0x5410('0x44')]=_[_0x5410('0x45')](_0x102dda[_0x5410('0x44')]);_0x22b681[_0x5410('0x46')]=_[_0x5410('0x47')](_0x22b681[_0x5410('0x48')],_0x22b681[_0x5410('0x44')]);_0x5bcad4[_0x5410('0x49')]=_[_0x5410('0x47')](_0x22b681[_0x5410('0x48')],qs[_0x5410('0x4a')](_0x102dda[_0x5410('0x44')][_0x5410('0x4a')]));_0x5bcad4['attributes']=_0x5bcad4[_0x5410('0x49')][_0x5410('0x4b')]?_0x5bcad4[_0x5410('0x49')]:_0x22b681['model'];if(!_0x102dda['query'][_0x5410('0x4c')](_0x5410('0x4d'))){_0x5bcad4[_0x5410('0x2f')]=qs[_0x5410('0x2f')](_0x102dda['query'][_0x5410('0x2f')]);_0x5bcad4[_0x5410('0x2d')]=qs[_0x5410('0x2d')](_0x102dda['query'][_0x5410('0x2d')]);}_0x5bcad4[_0x5410('0x4e')]=qs[_0x5410('0x4f')](_0x102dda['query']['sort']);_0x5bcad4[_0x5410('0x50')]=qs['filters'](_[_0x5410('0x51')](_0x102dda['query'],_0x22b681[_0x5410('0x46')]),_0x25821a);if(_0x102dda[_0x5410('0x44')][_0x5410('0x52')]){_0x5bcad4[_0x5410('0x50')]=_[_0x5410('0x53')](_0x5bcad4[_0x5410('0x50')],{'$or':_[_0x5410('0x3f')](_0x25821a,function(_0x1cd809){if(_0x1cd809[_0x5410('0x54')]!==_0x5410('0x55')){var _0x3aa104={};_0x3aa104[_0x1cd809[_0x5410('0x3b')]]={'$like':'%'+_0x102dda[_0x5410('0x44')][_0x5410('0x52')]+'%'};return _0x3aa104;}})});}_0x5bcad4=_[_0x5410('0x53')]({},_0x5bcad4,_0x102dda[_0x5410('0x56')]);var _0x4f382f={'where':_0x5bcad4[_0x5410('0x50')]};return db[_0x5410('0x40')][_0x5410('0x30')](_0x4f382f)['then'](function(_0x3f0ba4){_0x5582bd[_0x5410('0x30')]=_0x3f0ba4;if(_0x102dda[_0x5410('0x44')][_0x5410('0x57')]){_0x5bcad4[_0x5410('0x58')]=[{'all':!![]}];}return db['SmsAccount'][_0x5410('0x59')](_0x5bcad4);})[_0x5410('0x22')](function(_0x304d78){_0x5582bd[_0x5410('0x5a')]=_0x304d78;return _0x5582bd;})[_0x5410('0x22')](respondWithFilteredResult(_0x36ba82,_0x5bcad4))['catch'](handleError(_0x36ba82,null));};exports[_0x5410('0x5b')]=function(_0x37f88b,_0x1e615c){var _0x275e17={'raw':![],'where':{'id':_0x37f88b[_0x5410('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x5410('0x3e')}]},_0x53dc61={};_0x53dc61[_0x5410('0x48')]=_[_0x5410('0x45')](db[_0x5410('0x40')][_0x5410('0x41')]);_0x53dc61[_0x5410('0x44')]=_[_0x5410('0x45')](_0x37f88b['query']);_0x53dc61['filters']=_[_0x5410('0x47')](_0x53dc61[_0x5410('0x48')],_0x53dc61[_0x5410('0x44')]);_0x275e17[_0x5410('0x49')]=_[_0x5410('0x47')](_0x53dc61[_0x5410('0x48')],qs[_0x5410('0x4a')](_0x37f88b[_0x5410('0x44')]['fields']));_0x275e17['attributes']=_0x275e17['attributes']['length']?_0x275e17[_0x5410('0x49')]:_0x53dc61[_0x5410('0x48')];if(_0x37f88b[_0x5410('0x44')][_0x5410('0x57')]){_0x275e17['include']=[{'all':!![]}];}_0x275e17=_[_0x5410('0x53')]({},_0x275e17,_0x37f88b[_0x5410('0x56')]);return db[_0x5410('0x40')][_0x5410('0x5d')](_0x275e17)['then'](handleEntityNotFound(_0x1e615c,null))[_0x5410('0x22')](respondWithResult(_0x1e615c,null))[_0x5410('0x29')](handleError(_0x1e615c,null));};exports[_0x5410('0x5e')]=function(_0x3b9b61,_0x462a88){return db[_0x5410('0x40')][_0x5410('0x5e')](_0x3b9b61[_0x5410('0x5f')],{})[_0x5410('0x22')](function(_0x2004c0){var _0x520434=_0x3b9b61['user']['get']({'plain':!![]});if(!_0x520434)throw new Error(_0x5410('0x60'));if(_0x520434[_0x5410('0x61')]==='user'){var _0x48fe4d=_0x2004c0['get']({'plain':!![]});var _0x552d8f='SmsAccounts';return db[_0x5410('0x62')][_0x5410('0x5d')]({'where':{'name':_0x552d8f,'userProfileId':_0x520434[_0x5410('0x63')]},'raw':!![]})[_0x5410('0x22')](function(_0x5a74ef){if(_0x5a74ef&&_0x5a74ef[_0x5410('0x64')]===0x0){return db[_0x5410('0x38')][_0x5410('0x5e')]({'name':_0x48fe4d[_0x5410('0x3b')],'resourceId':_0x48fe4d['id'],'type':_0x5a74ef['name'],'sectionId':_0x5a74ef['id']},{})[_0x5410('0x22')](function(){return _0x2004c0;});}else{return _0x2004c0;}})[_0x5410('0x29')](function(_0x367ba8){logger[_0x5410('0x27')](_0x5410('0x65'),_0x367ba8);throw _0x367ba8;});}return _0x2004c0;})[_0x5410('0x22')](respondWithResult(_0x462a88,0xc9))[_0x5410('0x29')](handleError(_0x462a88,null));};exports['update']=function(_0x1d64d1,_0x174ec1){if(_0x1d64d1[_0x5410('0x5f')]['id']){delete _0x1d64d1[_0x5410('0x5f')]['id'];}return db[_0x5410('0x40')][_0x5410('0x5d')]({'where':{'id':_0x1d64d1[_0x5410('0x5c')]['id']},'include':[{'model':db[_0x5410('0x3d')],'as':_0x5410('0x3e')}]})[_0x5410('0x22')](handleEntityNotFound(_0x174ec1,null))[_0x5410('0x22')](saveUpdates(_0x1d64d1[_0x5410('0x5f')],null))[_0x5410('0x22')](respondWithResult(_0x174ec1,null))[_0x5410('0x29')](handleError(_0x174ec1,null));};exports[_0x5410('0x35')]=function(_0x5574b5,_0x516599){return db[_0x5410('0x40')][_0x5410('0x5d')]({'where':{'id':_0x5574b5[_0x5410('0x5c')]['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x516599,null))[_0x5410('0x22')](removeEntity(_0x516599,null))['catch'](handleError(_0x516599,null));};exports[_0x5410('0x66')]=function(_0x1ad956,_0x2323b4){return db[_0x5410('0x40')]['describe']()[_0x5410('0x22')](respondWithResult(_0x2323b4,null))[_0x5410('0x29')](handleError(_0x2323b4,null));};exports['addDisposition']=function(_0x20fc11,_0x2fc43b,_0x412b42){if(_0x20fc11[_0x5410('0x5f')]['id']){delete _0x20fc11[_0x5410('0x5f')]['id'];}return db['SmsAccount'][_0x5410('0x5d')]({'where':{'id':_0x20fc11[_0x5410('0x5c')]['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x2fc43b,null))['then'](function(_0x556749){if(_0x556749){_0x20fc11[_0x5410('0x5f')][_0x5410('0x67')]=_0x556749['id'];return db[_0x5410('0x68')][_0x5410('0x5e')](_0x20fc11[_0x5410('0x5f')]);}})[_0x5410('0x22')](respondWithResult(_0x2fc43b,null))['catch'](handleError(_0x2fc43b,null));};exports['getDispositions']=function(_0x6a553b,_0x12abd9,_0xbeb7d9){var _0x25e74f={'raw':![],'where':{}};var _0x34bd9d={};var _0x175e5f={'count':0x0,'rows':[]};return db[_0x5410('0x40')][_0x5410('0x69')]({'where':{'id':_0x6a553b[_0x5410('0x5c')]['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x12abd9,null))[_0x5410('0x22')](function(_0x4b108f){if(_0x4b108f){_0x34bd9d[_0x5410('0x48')]=_['keys'](db[_0x5410('0x68')][_0x5410('0x41')]);_0x34bd9d[_0x5410('0x44')]=_['keys'](_0x6a553b[_0x5410('0x44')]);_0x34bd9d[_0x5410('0x46')]=_['intersection'](_0x34bd9d[_0x5410('0x48')],_0x34bd9d[_0x5410('0x44')]);_0x25e74f[_0x5410('0x49')]=_[_0x5410('0x47')](_0x34bd9d[_0x5410('0x48')],qs[_0x5410('0x4a')](_0x6a553b[_0x5410('0x44')][_0x5410('0x4a')]));_0x25e74f[_0x5410('0x49')]=_0x25e74f[_0x5410('0x49')][_0x5410('0x4b')]?_0x25e74f[_0x5410('0x49')]:_0x34bd9d['model'];if(!_0x6a553b[_0x5410('0x44')][_0x5410('0x4c')](_0x5410('0x4d'))){_0x25e74f[_0x5410('0x2f')]=qs[_0x5410('0x2f')](_0x6a553b[_0x5410('0x44')][_0x5410('0x2f')]);_0x25e74f['offset']=qs[_0x5410('0x2d')](_0x6a553b[_0x5410('0x44')][_0x5410('0x2d')]);}_0x25e74f[_0x5410('0x4e')]=qs[_0x5410('0x4f')](_0x6a553b[_0x5410('0x44')][_0x5410('0x4f')]);_0x25e74f[_0x5410('0x50')]=qs[_0x5410('0x46')](_[_0x5410('0x51')](_0x6a553b[_0x5410('0x44')],_0x34bd9d['filters']));_0x25e74f[_0x5410('0x50')][_0x5410('0x67')]=_0x4b108f['id'];if(_0x6a553b['query'][_0x5410('0x52')]){_0x25e74f['where']=_[_0x5410('0x53')](_0x25e74f[_0x5410('0x50')],{'$or':_['map'](_0x25e74f['attributes'],function(_0x5abb1f){var _0x6e950={};_0x6e950[_0x5abb1f]={'$like':'%'+_0x6a553b[_0x5410('0x44')][_0x5410('0x52')]+'%'};return _0x6e950;})});}_0x25e74f=_[_0x5410('0x53')]({},_0x25e74f,_0x6a553b[_0x5410('0x56')]);return db[_0x5410('0x68')][_0x5410('0x30')]({'where':_0x25e74f['where']})['then'](function(_0x2c06fb){_0x175e5f['count']=_0x2c06fb;if(_0x6a553b[_0x5410('0x44')]['includeAll']){_0x25e74f['include']=[{'all':!![]}];}return db['Disposition'][_0x5410('0x59')](_0x25e74f);})[_0x5410('0x22')](function(_0x36d5de){_0x175e5f[_0x5410('0x5a')]=_0x36d5de;return _0x175e5f;});}})[_0x5410('0x22')](respondWithFilteredResult(_0x12abd9,_0x25e74f))['catch'](handleError(_0x12abd9,null));};exports[_0x5410('0x6a')]=function(_0x4d60d9,_0xec1d52,_0x2842b0){return db['SmsAccount']['find']({'where':{'id':_0x4d60d9[_0x5410('0x5c')]['id']}})[_0x5410('0x22')](handleEntityNotFound(_0xec1d52,null))[_0x5410('0x22')](function(_0xed4a69){if(_0xed4a69){return _0xed4a69[_0x5410('0x6a')](_0x4d60d9[_0x5410('0x44')][_0x5410('0x6b')]);}})[_0x5410('0x22')](respondWithStatusCode(_0xec1d52,null))[_0x5410('0x29')](handleError(_0xec1d52,null));};exports[_0x5410('0x6c')]=function(_0x21deef,_0x40a608,_0x7ad92a){if(_0x21deef[_0x5410('0x5f')]['id']){delete _0x21deef[_0x5410('0x5f')]['id'];}return db['SmsAccount'][_0x5410('0x5d')]({'where':{'id':_0x21deef['params']['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x40a608,null))[_0x5410('0x22')](function(_0x2fb8f7){if(_0x2fb8f7){_0x21deef[_0x5410('0x5f')]['SmsAccountId']=_0x2fb8f7['id'];return db[_0x5410('0x6d')][_0x5410('0x5e')](_0x21deef[_0x5410('0x5f')]);}})[_0x5410('0x22')](respondWithResult(_0x40a608,null))[_0x5410('0x29')](handleError(_0x40a608,null));};exports[_0x5410('0x6e')]=function(_0x13c34b,_0x55b9d8,_0x182ea7){var _0x27a0a9={'raw':![],'where':{}};var _0x2a5bd5={};var _0x2a0892={'count':0x0,'rows':[]};return db[_0x5410('0x40')]['findOne']({'where':{'id':_0x13c34b[_0x5410('0x5c')]['id']}})['then'](handleEntityNotFound(_0x55b9d8,null))[_0x5410('0x22')](function(_0x56e538){if(_0x56e538){_0x2a5bd5['model']=_[_0x5410('0x45')](db[_0x5410('0x6d')][_0x5410('0x41')]);_0x2a5bd5[_0x5410('0x44')]=_[_0x5410('0x45')](_0x13c34b['query']);_0x2a5bd5[_0x5410('0x46')]=_['intersection'](_0x2a5bd5[_0x5410('0x48')],_0x2a5bd5[_0x5410('0x44')]);_0x27a0a9[_0x5410('0x49')]=_['intersection'](_0x2a5bd5[_0x5410('0x48')],qs[_0x5410('0x4a')](_0x13c34b[_0x5410('0x44')][_0x5410('0x4a')]));_0x27a0a9['attributes']=_0x27a0a9[_0x5410('0x49')][_0x5410('0x4b')]?_0x27a0a9[_0x5410('0x49')]:_0x2a5bd5['model'];if(!_0x13c34b[_0x5410('0x44')][_0x5410('0x4c')](_0x5410('0x4d'))){_0x27a0a9[_0x5410('0x2f')]=qs[_0x5410('0x2f')](_0x13c34b[_0x5410('0x44')][_0x5410('0x2f')]);_0x27a0a9[_0x5410('0x2d')]=qs[_0x5410('0x2d')](_0x13c34b[_0x5410('0x44')][_0x5410('0x2d')]);}_0x27a0a9['order']=qs['sort'](_0x13c34b['query'][_0x5410('0x4f')]);_0x27a0a9[_0x5410('0x50')]=qs[_0x5410('0x46')](_[_0x5410('0x51')](_0x13c34b[_0x5410('0x44')],_0x2a5bd5[_0x5410('0x46')]));_0x27a0a9[_0x5410('0x50')][_0x5410('0x67')]=_0x56e538['id'];if(_0x13c34b[_0x5410('0x44')]['filter']){_0x27a0a9[_0x5410('0x50')]=_[_0x5410('0x53')](_0x27a0a9['where'],{'$or':_[_0x5410('0x3f')](_0x27a0a9[_0x5410('0x49')],function(_0x53daf3){var _0xc14986={};_0xc14986[_0x53daf3]={'$like':'%'+_0x13c34b[_0x5410('0x44')][_0x5410('0x52')]+'%'};return _0xc14986;})});}_0x27a0a9=_[_0x5410('0x53')]({},_0x27a0a9,_0x13c34b[_0x5410('0x56')]);return db[_0x5410('0x6d')]['count']({'where':_0x27a0a9[_0x5410('0x50')]})['then'](function(_0x368af5){_0x2a0892['count']=_0x368af5;if(_0x13c34b[_0x5410('0x44')][_0x5410('0x57')]){_0x27a0a9[_0x5410('0x58')]=[{'all':!![]}];}return db[_0x5410('0x6d')][_0x5410('0x59')](_0x27a0a9);})['then'](function(_0x4bc074){_0x2a0892[_0x5410('0x5a')]=_0x4bc074;return _0x2a0892;});}})['then'](respondWithFilteredResult(_0x55b9d8,_0x27a0a9))[_0x5410('0x29')](handleError(_0x55b9d8,null));};exports[_0x5410('0x6f')]=function(_0x64f29a,_0x1f3953,_0x1b289d){return db[_0x5410('0x40')][_0x5410('0x5d')]({'where':{'id':_0x64f29a['params']['id']}})['then'](handleEntityNotFound(_0x1f3953,null))[_0x5410('0x22')](function(_0x3ecb40){if(_0x3ecb40){return _0x3ecb40[_0x5410('0x6f')](_0x64f29a[_0x5410('0x44')][_0x5410('0x6b')]);}})[_0x5410('0x22')](respondWithStatusCode(_0x1f3953,null))[_0x5410('0x29')](handleError(_0x1f3953,null));};exports[_0x5410('0x70')]=function(_0x5ca20b,_0x589217,_0x13e321){var _0xbc7e9b={'channel':_0x5410('0x71')};var _0x3b4517=[];var _0x447093=[];var _0x2b5d7f={};return db[_0x5410('0x40')][_0x5410('0x5d')]({'where':{'id':_0x5ca20b[_0x5410('0x5c')]['id']},'include':[{'model':db[_0x5410('0x72')],'as':'Applications'}]})[_0x5410('0x22')](handleEntityNotFound(_0x589217,null))[_0x5410('0x22')](function(_0x3e6041){_0xbc7e9b['account']=_0x3e6041;_0xbc7e9b['applications']=_[_0x5410('0x73')](_0x3e6041[_0x5410('0x74')],[_0x5410('0x75')],[_0x5410('0x76')]);if(_0xbc7e9b[_0x5410('0x77')][_0x5410('0x74')]){delete _0xbc7e9b['account'][_0x5410('0x74')];}return db[_0x5410('0x78')]['describe']();})[_0x5410('0x22')](function(_0xea072){if(!_0xea072){throw new db['Sequelize'][(_0x5410('0x79'))](_0x5410('0x7a'));}_0x3b4517=_[_0x5410('0x7b')](_['keys'](_0xea072),[_0x5410('0x7c'),_0x5410('0x7d')]);_0x447093=_[_0x5410('0x7b')](_[_0x5410('0x45')](_0xea072),['createdAt',_0x5410('0x7d'),_0x5410('0x7e'),_0x5410('0x7f')]);_0xbc7e9b[_0x5410('0x5f')]={'mapKey':_0x5410('0x80')};if(_0xbc7e9b[_0x5410('0x77')][_0x5410('0x54')]){switch(_0xbc7e9b[_0x5410('0x77')][_0x5410('0x54')]){case _0x5410('0x81'):_0xbc7e9b[_0x5410('0x5f')]['from']=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x82')];_0xbc7e9b['body']['body']=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x83')];_0xbc7e9b[_0x5410('0x5f')]['messageId']=_0x5ca20b['body']['MessageSid'];break;case'skebby':_0xbc7e9b[_0x5410('0x5f')]['from']='+'+_0x5ca20b['body'][_0x5410('0x84')];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x5f')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x85')];break;case _0x5410('0x86'):_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')]=_0x5ca20b['body']['from'];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x5f')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x28')];break;case _0x5410('0x88'):_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')]=_0x5ca20b[_0x5410('0x5f')]['from'];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x5f')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x5f')];_0xbc7e9b['body'][_0x5410('0x89')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x8a')];break;case _0x5410('0x8b'):_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')]=_0x5ca20b['body'][_0x5410('0x82')];_0xbc7e9b[_0x5410('0x5f')]['body']=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x8c')];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x89')]=_0x5ca20b['body']['MessageUUID'];break;case _0x5410('0x8d'):_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')]='+'+_0x5ca20b['body'][_0x5410('0x8e')][0x0]['from'];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x5f')]=_0x5ca20b['body'][_0x5410('0x8e')][0x0]['text'];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x89')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x8e')][0x0][_0x5410('0x89')];break;case _0x5410('0x8f'):_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')]=_0x5ca20b['body'][_0x5410('0x90')];_0xbc7e9b['body'][_0x5410('0x5f')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x91')][_0x5410('0x28')];break;case _0x5410('0x92'):_0xbc7e9b['body'][_0x5410('0x87')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x93')];_0xbc7e9b['body']['body']=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x85')];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x89')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x94')];break;case'bandwidth':_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x89')]=_0x5ca20b[_0x5410('0x5f')][0x0][_0x5410('0x28')]['id'];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')]=_0x5ca20b[_0x5410('0x5f')][0x0][_0x5410('0x28')][_0x5410('0x87')];_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x5f')]=_0x5ca20b[_0x5410('0x5f')][0x0]['message'][_0x5410('0x85')];break;case'intelepeer':_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')]=_0x5ca20b[_0x5410('0x5f')][_0x5410('0x87')];_0xbc7e9b['body'][_0x5410('0x5f')]=_0x5ca20b['body'][_0x5410('0x28')];_0xbc7e9b['body'][_0x5410('0x89')]=_0x5ca20b['body'][_0x5410('0x95')];break;}}if(_0xbc7e9b[_0x5410('0x5f')]['id']){delete _0xbc7e9b[_0x5410('0x5f')]['id'];}if(_[_0x5410('0x96')](_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')])){throw new db['Sequelize'][(_0x5410('0x79'))](_0x5410('0x97'));}if(_[_0x5410('0x96')](_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x5f')])||_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x5f')]===''){throw new db[(_0x5410('0x98'))][(_0x5410('0x79'))](_0x5410('0x99'));}if(_[_0x5410('0x96')](_0xbc7e9b['body'][_0x5410('0x9a')])){throw new db['Sequelize']['ValidationError'](_0x5410('0x9b')+_0x447093);}if(!_[_0x5410('0x9c')](_0x447093,_0xbc7e9b[_0x5410('0x5f')]['mapKey'])){throw new db[(_0x5410('0x98'))][(_0x5410('0x79'))](_0x5410('0x9d')+_0x447093);}_0x2b5d7f[_0xbc7e9b['body'][_0x5410('0x9a')]]=_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')];return db[_0x5410('0x9e')][_0x5410('0x5d')]({'where':{'id':_0xbc7e9b[_0x5410('0x77')]['ListId']},'include':[{'model':db[_0x5410('0x78')],'as':_0x5410('0x9f'),'where':_0x2b5d7f,'limit':0x1,'order':[['updatedAt',_0x5410('0xa0')]]}]});})['then'](handleEntityNotFound(_0x589217,null))[_0x5410('0x22')](function(_0x297205){if(_0x297205){_0xbc7e9b['list']=_['omit'](_0x297205,['Contacts']);if(_0x297205[_0x5410('0x9f')][_0x5410('0x4b')]){return _0x297205['Contacts'][0x0];}var _0x56cabd=_[_0x5410('0x1c')](_0xbc7e9b[_0x5410('0x5f')],{'firstName':_0xbc7e9b['body'][_0x5410('0x87')],'ListId':_0x297205['id']});_0x56cabd[_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x9a')]]=_0xbc7e9b[_0x5410('0x5f')]['from'];return db[_0x5410('0x78')][_0x5410('0x5e')](_0x56cabd,{'fields':_0x3b4517,'raw':!![]});}})['then'](handleEntityNotFound(_0x589217,null))[_0x5410('0x22')](function(_0x6b96a9){if(_0x6b96a9){_0xbc7e9b[_0x5410('0xa1')]=_0x6b96a9;var _0x117a51={'ContactId':_0x6b96a9['id'],'phone':_0xbc7e9b[_0x5410('0x5f')]['from'],'SmsAccountId':_0x5ca20b[_0x5410('0x5c')]['id']};var _0x438d4e={'ContactId':_0x6b96a9['id'],'SmsAccountId':_0x5ca20b['params']['id'],'closed':![]};return db[_0x5410('0xa2')]['find']({'where':_0x438d4e})['then'](function(_0x342234){if(_0x342234){return[_0x342234,![]];}return db[_0x5410('0xa2')]['create'](_0x117a51)['then'](function(_0xad9def){return[_0xad9def,!![]];});});}})['spread'](function(_0x5b67a0,_0xedb3f6){_0xbc7e9b['interaction']=_0x5b67a0['get']({'plain':!![]});_0xbc7e9b[_0x5410('0xa3')]['created']=![];if(_0xedb3f6){if(_0xbc7e9b['account']['autoclose']){_0xbc7e9b[_0x5410('0xa4')][_0x5410('0xa5')]({'id':0x0,'priority':_0xbc7e9b[_0x5410('0xa4')][_0x5410('0x4b')]+0x1,'app':_0x5410('0xa6'),'appdata':'unmanaged','interval':_0x5410('0xa7')});}_0xbc7e9b['interaction'][_0x5410('0xa8')]=!![];}return db[_0x5410('0xa9')]['create']({'phone':_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x87')],'messageId':_0xbc7e9b[_0x5410('0x5f')][_0x5410('0x89')],'body':_0xbc7e9b[_0x5410('0x5f')]['body'],'SmsAccountId':_0x5ca20b[_0x5410('0x5c')]['id'],'SmsInteractionId':_0x5b67a0['id'],'direction':'in','ContactId':_0x5b67a0[_0x5410('0xaa')],'AttachmentId':_0xbc7e9b[_0x5410('0x5f')][_0x5410('0xab')]});})['then'](function(_0x3c1b07){_0xbc7e9b[_0x5410('0x28')]=_0x3c1b07;if(_0xbc7e9b[_0x5410('0xa3')][_0x5410('0xac')]){return db[_0x5410('0xad')][_0x5410('0x5d')]({'attributes':['id',_0x5410('0x3b')],'where':{'id':_0xbc7e9b[_0x5410('0xa3')][_0x5410('0xac')]}})[_0x5410('0x22')](function(_0x1f6347){if(_0x1f6347){_0xbc7e9b[_0x5410('0xa4')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5410('0xae'),'appdata':_0x1f6347[_0x5410('0x3b')]+','+(_0xbc7e9b['account'][_0x5410('0xaf')]||0xa),'interval':_0x5410('0xa7')});}return respondWithRpcPromise(_0x5410('0xb0'),_0x5410('0xb1'),_0xbc7e9b);});}return respondWithRpcPromise(_0x5410('0xb0'),'startRouting',_0xbc7e9b);})[_0x5410('0x22')](function(_0x37ebb4){if(_0x37ebb4){var _0x374946=0xc8;var _0x5ecc31=_0x5410('0xb2');logger[_0x5410('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5ecc31,_0x374946,'entity\x20found');logger[_0x5410('0x26')](_0x5410('0xb3'),_0x5ecc31,_0x374946,_0x5410('0xb4'),JSON[_0x5410('0xb5')](_0x37ebb4));if(_0xbc7e9b[_0x5410('0x77')][_0x5410('0x54')]==='twilio'){return _0x589217['status'](_0x374946)[_0x5410('0x31')](_0x5410('0xb6'),_0x5410('0xb7'))['send'](_0x5410('0xb8'));}else{return _0x589217[_0x5410('0x2b')](_0x374946)['json'](_0x37ebb4);}}})[_0x5410('0x29')](handleError(_0x589217,null));};exports[_0x5410('0xb9')]=function(_0x35ca26,_0x108c22){var _0x5a3719=_0x35ca26['params']['id'];var _0x72d094=_0x35ca26['body'];var _0x357da3=0xc8;var _0xe4009a=null;return db[_0x5410('0xba')][_0x5410('0xbb')]({'isolationLevel':db[_0x5410('0xba')][_0x5410('0xbc')][_0x5410('0xbd')]['READ_COMMITTED']},function(_0x5495e8){return db[_0x5410('0x40')]['findOne']({'where':{'id':_0x5a3719},'transaction':_0x5495e8})[_0x5410('0x22')](function(_0x45d4e6){if(_0x45d4e6){return db[_0x5410('0x72')][_0x5410('0x35')]({'where':{'SmsAccountId':_0x5a3719},'transaction':_0x5495e8})[_0x5410('0x22')](function(){var _0x3f6b27=_[_0x5410('0x3f')](_0x72d094,function(_0x2fc55a){_0x2fc55a['SmsAccountId']=_0x5a3719;return _0x2fc55a;});return db[_0x5410('0x72')]['bulkCreate'](_0x3f6b27,{'transaction':_0x5495e8});});}else{_0x357da3=0x194;_0xe4009a=[];}});})[_0x5410('0x22')](function(){if(_0x357da3!==0x194){return db[_0x5410('0x72')][_0x5410('0xbe')]({'where':{'SmsAccountId':_0x5a3719},'order':_0x5410('0x75')})[_0x5410('0x22')](function(_0x1571ca){_0xe4009a=_0x1571ca;});}})[_0x5410('0x29')](function(_0x5577c7){_0x357da3=0x1f4;logger[_0x5410('0x27')](_0x5577c7[_0x5410('0x3a')]);if(_0x5577c7[_0x5410('0x3b')]){delete _0x5577c7[_0x5410('0x3b')];}_0xe4009a=_0x5577c7;})[_0x5410('0xbf')](function(){if(_0xe4009a===null){_0x108c22['sendStatus'](_0x357da3);}else{if(_0x357da3===0x1f4){_0x108c22[_0x5410('0x2b')](_0x357da3)[_0x5410('0x3c')](_0xe4009a);}else{_0x108c22['status'](_0x357da3)['json'](_0xe4009a);}}});};exports[_0x5410('0xc0')]=function(_0x134977,_0x49eef0,_0x493ca4){var _0x1ecb8d={};var _0x38b191={};var _0x2db862;var _0x4249fc;return db[_0x5410('0x40')][_0x5410('0x69')]({'where':{'id':_0x134977['params']['id']}})['then'](handleEntityNotFound(_0x49eef0,null))[_0x5410('0x22')](function(_0x133b6d){if(_0x133b6d){_0x2db862=_0x133b6d;_0x38b191[_0x5410('0x48')]=_[_0x5410('0x45')](db[_0x5410('0x72')]['rawAttributes']);_0x38b191[_0x5410('0x44')]=_[_0x5410('0x45')](_0x134977[_0x5410('0x44')]);_0x38b191[_0x5410('0x46')]=_['intersection'](_0x38b191[_0x5410('0x48')],_0x38b191[_0x5410('0x44')]);_0x1ecb8d[_0x5410('0x49')]=_['intersection'](_0x38b191[_0x5410('0x48')],qs['fields'](_0x134977[_0x5410('0x44')][_0x5410('0x4a')]));_0x1ecb8d['attributes']=_0x1ecb8d[_0x5410('0x49')][_0x5410('0x4b')]?_0x1ecb8d[_0x5410('0x49')]:_0x38b191['model'];_0x1ecb8d[_0x5410('0x4e')]=qs['sort'](_0x134977[_0x5410('0x44')]['sort']);_0x1ecb8d['where']=qs[_0x5410('0x46')](_[_0x5410('0x51')](_0x134977['query'],_0x38b191['filters']));if(_0x134977[_0x5410('0x44')][_0x5410('0x52')]){_0x1ecb8d['where']=_[_0x5410('0x53')](_0x1ecb8d['where'],{'$or':_[_0x5410('0x3f')](_0x1ecb8d[_0x5410('0x49')],function(_0x72141d){var _0x285e1e={};_0x285e1e[_0x72141d]={'$like':'%'+_0x134977[_0x5410('0x44')][_0x5410('0x52')]+'%'};return _0x285e1e;})});}_0x1ecb8d=_['merge']({},_0x1ecb8d,_0x134977['options']);return _0x2db862['getApplications'](_0x1ecb8d);}})[_0x5410('0x22')](function(_0x5abe68){if(_0x5abe68){_0x4249fc=_0x5abe68[_0x5410('0x4b')];if(!_0x134977[_0x5410('0x44')][_0x5410('0x4c')](_0x5410('0x4d'))){_0x1ecb8d[_0x5410('0x2f')]=qs['limit'](_0x134977['query'][_0x5410('0x2f')]);_0x1ecb8d[_0x5410('0x2d')]=qs[_0x5410('0x2d')](_0x134977[_0x5410('0x44')][_0x5410('0x2d')]);}return _0x2db862[_0x5410('0xc0')](_0x1ecb8d);}})[_0x5410('0x22')](function(_0x30c165){if(_0x30c165){return _0x30c165?{'count':_0x4249fc,'rows':_0x30c165}:null;}})[_0x5410('0x22')](respondWithResult(_0x49eef0,null))['catch'](handleError(_0x49eef0,null));};exports[_0x5410('0xc1')]=function(_0x22fd6c,_0x10aaaf,_0xddf0d4){var _0x5aeb6a={'raw':![],'where':{}};var _0x1fbb43={};var _0x28e752={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5410('0x69')]({'where':{'id':_0x22fd6c[_0x5410('0x5c')]['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x10aaaf,null))[_0x5410('0x22')](function(_0x29544e){if(_0x29544e){_0x1fbb43[_0x5410('0x48')]=_['keys'](db[_0x5410('0xa2')][_0x5410('0x41')]);_0x1fbb43[_0x5410('0x44')]=_[_0x5410('0x45')](_0x22fd6c[_0x5410('0x44')]);_0x1fbb43[_0x5410('0x46')]=_['intersection'](_0x1fbb43[_0x5410('0x48')],_0x1fbb43[_0x5410('0x44')]);_0x5aeb6a[_0x5410('0x49')]=_['intersection'](_0x1fbb43[_0x5410('0x48')],qs[_0x5410('0x4a')](_0x22fd6c[_0x5410('0x44')][_0x5410('0x4a')]));_0x5aeb6a['attributes']=_0x5aeb6a[_0x5410('0x49')][_0x5410('0x4b')]?_0x5aeb6a[_0x5410('0x49')]:_0x1fbb43[_0x5410('0x48')];if(!_0x22fd6c[_0x5410('0x44')][_0x5410('0x4c')](_0x5410('0x4d'))){_0x5aeb6a[_0x5410('0x2f')]=qs[_0x5410('0x2f')](_0x22fd6c[_0x5410('0x44')][_0x5410('0x2f')]);_0x5aeb6a['offset']=qs[_0x5410('0x2d')](_0x22fd6c['query']['offset']);}_0x5aeb6a[_0x5410('0x4e')]=qs['sort'](_0x22fd6c[_0x5410('0x44')][_0x5410('0x4f')]);_0x5aeb6a[_0x5410('0x50')]=qs[_0x5410('0x46')](_['pick'](_0x22fd6c[_0x5410('0x44')],_0x1fbb43[_0x5410('0x46')]));_0x5aeb6a[_0x5410('0x50')][_0x5410('0x67')]=_0x29544e['id'];if(_0x22fd6c[_0x5410('0x44')][_0x5410('0x52')]){_0x5aeb6a[_0x5410('0x50')]=_[_0x5410('0x53')](_0x5aeb6a['where'],{'$or':_[_0x5410('0x3f')](_0x5aeb6a[_0x5410('0x49')],function(_0x364eac){var _0xd2eebe={};_0xd2eebe[_0x364eac]={'$like':'%'+_0x22fd6c[_0x5410('0x44')]['filter']+'%'};return _0xd2eebe;})});}_0x5aeb6a=_[_0x5410('0x53')]({},_0x5aeb6a,_0x22fd6c[_0x5410('0x56')]);return db['SmsInteraction'][_0x5410('0x30')]({'where':_0x5aeb6a['where']})[_0x5410('0x22')](function(_0xe27d7c){_0x28e752[_0x5410('0x30')]=_0xe27d7c;if(_0x22fd6c[_0x5410('0x44')][_0x5410('0x57')]){_0x5aeb6a[_0x5410('0x58')]=[{'model':db[_0x5410('0x78')],'as':_0x5410('0xc2'),'required':![]},{'model':db['User'],'as':_0x5410('0xc3'),'attributes':[_0x5410('0x3b'),_0x5410('0xc4'),_0x5410('0xc5')],'required':![]},{'model':db[_0x5410('0xc6')],'as':_0x5410('0xc7'),'attributes':['id',_0x5410('0x3b'),_0x5410('0xc8')],'where':_0x22fd6c[_0x5410('0x44')][_0x5410('0xc9')]?{'id':_0x22fd6c[_0x5410('0x44')][_0x5410('0xc9')]}:undefined,'required':_0x22fd6c['query'][_0x5410('0xc9')]?!![]:![]}];}return db['SmsInteraction'][_0x5410('0x59')](_0x5aeb6a);})[_0x5410('0x22')](function(_0x137dce){_0x28e752[_0x5410('0x5a')]=_0x137dce;return _0x28e752;});}})[_0x5410('0x22')](respondWithFilteredResult(_0x10aaaf,_0x5aeb6a))['catch'](handleError(_0x10aaaf,null));};exports['send']=function(_0xb8b89c,_0x2a8812,_0x64156e){var _0x3c0bb2,_0x3fa0cf,_0x157c20;if(_['isNil'](_0xb8b89c['body'][_0x5410('0x5f')])||_0xb8b89c['body'][_0x5410('0x5f')]===''){throw new db['Sequelize'][(_0x5410('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5410('0x96')](_0xb8b89c[_0x5410('0x5f')]['to'])){throw new db[(_0x5410('0x98'))]['ValidationError'](_0x5410('0xca'));}_0x3c0bb2=_0xb8b89c['body']['to'];return db[_0x5410('0x40')][_0x5410('0x5d')]({'where':{'id':_0xb8b89c['params']['id']},'include':[{'model':db[_0x5410('0x9e')],'as':_0x5410('0xcb'),'include':[{'model':db[_0x5410('0x78')],'as':_0x5410('0x9f'),'where':{'mobile':_0x3c0bb2},'limit':0x1,'order':[[_0x5410('0x7d'),_0x5410('0xa0')]]}]}]})[_0x5410('0x22')](handleEntityNotFound(_0x2a8812,null))[_0x5410('0x22')](function(_0x36221f){if(_0x36221f&&_0x36221f[_0x5410('0xcb')]){_0x3fa0cf=_0x36221f[_0x5410('0x36')]({'plain':!![]});if(_0x3fa0cf[_0x5410('0xcb')]&&_0x3fa0cf[_0x5410('0xcb')][_0x5410('0x9f')]['length']){return _0x3fa0cf[_0x5410('0xcb')][_0x5410('0x9f')][0x0];}return db[_0x5410('0x78')]['create'](_['defaults'](_0xb8b89c[_0x5410('0x5f')],{'firstName':_0x3c0bb2,'mobile':_0x3c0bb2,'phone':_0x3c0bb2,'ListId':_0x3fa0cf['ListId']}));}})['then'](handleEntityNotFound(_0x2a8812,null))['then'](function(_0x4911be){if(_0x4911be){_0x157c20=_0x4911be;return db[_0x5410('0xa2')][_0x5410('0x5d')]({'where':{'ContactId':_0x157c20['id'],'closed':![],'SmsAccountId':_0x3fa0cf['id']}})[_0x5410('0x22')](function(_0x1b9439){if(_0x1b9439){return[_0x1b9439,![]];}return db['SmsInteraction'][_0x5410('0x5e')]({'UserId':_0xb8b89c[_0x5410('0xcc')]['id'],'ContactId':_0x157c20['id'],'SmsAccountId':_0x3fa0cf['id'],'phone':_0x3c0bb2,'firstMsgDirection':'out','Messages':[_[_0x5410('0x53')](_0xb8b89c['body'],{'read':![],'body':_0xb8b89c[_0x5410('0x5f')][_0x5410('0x5f')],'phone':_0x3c0bb2,'SmsAccountId':_0x3fa0cf['id'],'UserId':_0xb8b89c[_0x5410('0xcc')]['id'],'ContactId':_0x157c20['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x5410('0xcd')}]})[_0x5410('0x22')](function(_0x3572d1){return[_0x3572d1,!![]];});});}})[_0x5410('0xce')](function(_0x3f1b08,_0x467ae6){if(_0x467ae6){return _0x3f1b08;}return db['SmsMessage'][_0x5410('0x5e')](_[_0x5410('0x53')](_0xb8b89c[_0x5410('0x5f')],{'read':![],'body':_0xb8b89c['body'][_0x5410('0x5f')],'phone':_0x3c0bb2,'SmsAccountId':_0x3fa0cf['id'],'SmsInteractionId':_0x3f1b08['id'],'UserId':_0xb8b89c[_0x5410('0xcc')]['id'],'ContactId':_0x157c20['id']}))['then'](function(_0xd6e0e7){_0x3f1b08['dataValues'][_0x5410('0xcd')]=[];_0x3f1b08[_0x5410('0xcf')]['Messages'][_0x5410('0xa5')](_0xd6e0e7[_0x5410('0xcf')]);return _0x3f1b08;});})[_0x5410('0x22')](respondWithResult(_0x2a8812,null))[_0x5410('0x29')](handleError(_0x2a8812,null));};exports[_0x5410('0x2b')]=function(_0x54b8f1,_0x2908cf,_0x59077f){if(_0x54b8f1[_0x5410('0x5f')]['id']){delete _0x54b8f1[_0x5410('0x5f')]['id'];}var _0x12217b,_0x3d3437,_0x24b0b0;return db[_0x5410('0x40')]['find']({'where':{'id':_0x54b8f1['params']['id']}})['then'](handleEntityNotFound(_0x2908cf,null))[_0x5410('0x22')](function(_0x277a69){if(_0x277a69){_0x24b0b0=_0x277a69;logger[_0x5410('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5410('0x2b'),_0x5410('0xd0'),_0x277a69[_0x5410('0x54')],util[_0x5410('0xd1')](_0x54b8f1['body'],{'showHidden':![],'depth':null}));switch(_0x277a69[_0x5410('0x54')]){case _0x5410('0xd2'):if(_0x54b8f1[_0x5410('0x5f')]['skebby_dispatch_id']&&_0x54b8f1[_0x5410('0x5f')][_0x5410('0x2b')]){_0x3d3437=_0x54b8f1[_0x5410('0x5f')][_0x5410('0x2b')];return db[_0x5410('0xa9')][_0x5410('0x5d')]({'where':{'messageId':_0x54b8f1['body']['skebby_dispatch_id']}});}break;case _0x5410('0x86'):if(_0x54b8f1[_0x5410('0x5f')][_0x5410('0xd3')]&&_0x54b8f1[_0x5410('0x5f')]['statusInt']){_0x3d3437=_0x54b8f1[_0x5410('0x5f')][_0x5410('0xd4')];return db[_0x5410('0xa9')][_0x5410('0x5d')]({'where':{'messageId':_0x54b8f1['body'][_0x5410('0xd3')]}});}break;case _0x5410('0x88'):if(_0x54b8f1[_0x5410('0x5f')]['message_id']&&_0x54b8f1[_0x5410('0x5f')][_0x5410('0xd5')]){_0x3d3437=_0x54b8f1['body']['status_code'];return db['SmsMessage'][_0x5410('0x5d')]({'where':{'messageId':_0x54b8f1['body']['message_id']}});}break;case'infobip':var _0x43fa5d=_0x54b8f1[_0x5410('0x5f')]['results'][0x0];if(_0x43fa5d[_0x5410('0x89')]&&_0x43fa5d[_0x5410('0x2b')][_0x5410('0xd6')]===_0x5410('0xd7')){_0x3d3437=_0x43fa5d[_0x5410('0x2b')]['groupName'];return db[_0x5410('0xa9')][_0x5410('0x5d')]({'where':{'messageId':_0x43fa5d[_0x5410('0x89')]}});}break;case _0x5410('0x92'):if(_0x54b8f1[_0x5410('0x5f')][_0x5410('0x89')]&&_0x54b8f1[_0x5410('0x5f')][_0x5410('0x2b')]){_0x3d3437=_0x54b8f1['body'][_0x5410('0x2b')];return db['SmsMessage'][_0x5410('0x5d')]({'where':{'messageId':_0x54b8f1[_0x5410('0x5f')]['messageId']}});}break;case _0x5410('0xd8'):if(_0x54b8f1[_0x5410('0x5f')][0x0][_0x5410('0x28')]['id']){_0x3d3437=_0x54b8f1[_0x5410('0x5f')][0x0]['type'];return db['SmsMessage'][_0x5410('0x5d')]({'where':{'messageId':_0x54b8f1['body'][0x0][_0x5410('0x28')]['id']}});}break;case'intelepeer':if(_0x54b8f1[_0x5410('0x5f')][_0x5410('0xd9')]&&_0x54b8f1[_0x5410('0x5f')][_0x5410('0x2b')]){_0x3d3437=_0x54b8f1[_0x5410('0x5f')]['status'];return db['SmsMessage'][_0x5410('0x5d')]({'where':{'messageId':_0x54b8f1[_0x5410('0x5f')]['redif']}});}break;}}})[_0x5410('0x22')](handleEntityNotFound(_0x2908cf,null))[_0x5410('0x22')](function(_0x5f1075){if(_0x5f1075){_0x12217b=_0x5f1075;switch(_0x24b0b0[_0x5410('0x54')]){case _0x5410('0xd2'):if(_0x3d3437===_0x5410('0xd7')){return _0x12217b['update']({'read':!![]});}else{logger[_0x5410('0x27')](_0x5410('0xda'),_0x5410('0x2b'),'skebby',util[_0x5410('0xd1')](_0x54b8f1[_0x5410('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x5410('0x86'):if(_0x3d3437==='1'){return _0x12217b[_0x5410('0x34')]({'read':!![]});}else{logger[_0x5410('0x27')](_0x5410('0xda'),_0x5410('0x2b'),'skebby',util[_0x5410('0xd1')](_0x54b8f1[_0x5410('0x5f')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x54b8f1[_0x5410('0x5f')]['error_code']&&_0x3d3437>=0xc8&&_0x3d3437<=0xce){return _0x12217b[_0x5410('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5410('0x2b'),'clicksend',util[_0x5410('0xd1')](_0x54b8f1[_0x5410('0x5f')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2f1dda=_0x54b8f1[_0x5410('0x5f')][_0x5410('0x8e')][0x0];if(_0x2f1dda[_0x5410('0x2b')]['groupName']===_0x5410('0xd7')){return _0x12217b['update']({'read':!![]});}else{logger[_0x5410('0x27')](_0x5410('0xda'),_0x5410('0x2b'),_0x5410('0x8d'),util[_0x5410('0xd1')](_0x54b8f1[_0x5410('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x5410('0x92'):if(_0x3d3437=='DELIVERED_TO_GATEWAY'||_0x3d3437=='RECEIVED_BY_RECIPIENT'){return _0x12217b[_0x5410('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5410('0x92'),util[_0x5410('0xd1')](_0x54b8f1[_0x5410('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x5410('0xd8'):if(_0x3d3437==_0x5410('0xdb')){return _0x12217b['update']({'read':!![]});}else{logger[_0x5410('0x27')](_0x5410('0xda'),'status',_0x5410('0xd8'),util[_0x5410('0xd1')](_0x54b8f1[_0x5410('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x5410('0xdc'):if(_0x3d3437===_0x5410('0xdd')||_0x3d3437==='ACCEPTD'){return _0x12217b[_0x5410('0x34')]({'read':!![]});}else{logger[_0x5410('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','intelepeer',util['inspect'](_0x54b8f1[_0x5410('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x12217b;}})[_0x5410('0x22')](respondWithResult(_0x2908cf,null))[_0x5410('0x29')](handleError(_0x2908cf,null));};exports[_0x5410('0xde')]=function(_0x51c781,_0x39a7b5,_0x56eb24){var _0xa51e5d,_0x28b4b9,_0x38a186;return db[_0x5410('0x40')][_0x5410('0x5d')]({'where':{'id':_0x51c781['params']['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x39a7b5,null))[_0x5410('0x22')](function(_0x413888){if(_0x413888){_0x38a186=_0x413888;logger[_0x5410('0x26')](_0x5410('0xda'),'status','received\x20delivery\x20report\x20from',_0x413888[_0x5410('0x54')],util['inspect'](_0x51c781[_0x5410('0x44')],{'showHidden':![],'depth':null}));switch(_0x413888['type']){case'csc':if(_0x51c781[_0x5410('0x44')][_0x5410('0xdf')]&&_0x51c781[_0x5410('0x44')][_0x5410('0xe0')]){_0x28b4b9=_0x51c781[_0x5410('0x44')][_0x5410('0xe0')];return db['SmsMessage'][_0x5410('0x5d')]({'where':{'messageId':_0x51c781[_0x5410('0x44')][_0x5410('0xdf')]}});}break;}}})[_0x5410('0x22')](handleEntityNotFound(_0x39a7b5,null))[_0x5410('0x22')](function(_0x30d779){if(_0x30d779){_0xa51e5d=_0x30d779;switch(_0x38a186[_0x5410('0x54')]){case'csc':if(_0x28b4b9==='2'||_0x28b4b9==='6'){return _0xa51e5d[_0x5410('0x34')]({'read':!![]});}else{logger[_0x5410('0x27')](_0x5410('0xda'),_0x5410('0x2b'),_0x5410('0x8f'),util[_0x5410('0xd1')](_0x51c781['query'],{'showHidden':![],'depth':null}));};break;}return _0xa51e5d;}})[_0x5410('0x22')](respondWithResult(_0x39a7b5,null))[_0x5410('0x29')](handleError(_0x39a7b5,null));};exports[_0x5410('0xe1')]=function(_0x41d8e3,_0x2964ae,_0x581787){return db[_0x5410('0x40')]['find']({'where':{'id':_0x41d8e3[_0x5410('0x5c')]['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x2964ae,null))[_0x5410('0x22')](function(_0x4c4576){if(_0x4c4576){return _0x4c4576[_0x5410('0xe1')](_0x41d8e3[_0x5410('0x5f')][_0x5410('0x6b')],_[_0x5410('0xe2')](_0x41d8e3[_0x5410('0x5f')],['ids','id'])||{})[_0x5410('0xce')](function(_0x5ef473){for(var _0x1ac164=0x0;_0x1ac164<_0x41d8e3[_0x5410('0x5f')][_0x5410('0x6b')]['length'];_0x1ac164+=0x1){socket['emit'](_0x5410('0xe3'),{'UserId':Number(_0x41d8e3['body'][_0x5410('0x6b')][_0x1ac164]),'SmsAccountId':Number(_0x41d8e3['params']['id'])});}return _0x5ef473;});}})[_0x5410('0x22')](respondWithResult(_0x2964ae,null))[_0x5410('0x29')](handleError(_0x2964ae,null));};exports[_0x5410('0xe4')]=function(_0x509802,_0x2b44dc,_0x3d5374){return db['SmsAccount'][_0x5410('0x5d')]({'where':{'id':_0x509802[_0x5410('0x5c')]['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x2b44dc,null))[_0x5410('0x22')](function(_0x612792){if(_0x612792){return _0x612792[_0x5410('0xe4')](_0x509802[_0x5410('0x44')][_0x5410('0x6b')])['then'](function(){if(_[_0x5410('0xe5')](_0x509802['query']['ids'])){for(var _0x2668c7=0x0;_0x2668c7<_0x509802[_0x5410('0x44')][_0x5410('0x6b')]['length'];_0x2668c7+=0x1){socket['emit'](_0x5410('0xe6'),{'UserId':Number(_0x509802[_0x5410('0x44')][_0x5410('0x6b')][_0x2668c7]),'SmsAccountId':Number(_0x509802[_0x5410('0x5c')]['id'])});}}else{socket[_0x5410('0xe7')](_0x5410('0xe6'),{'UserId':Number(_0x509802['query'][_0x5410('0x6b')]),'SmsAccountId':Number(_0x509802[_0x5410('0x5c')]['id'])});}});}})[_0x5410('0x22')](respondWithStatusCode(_0x2b44dc,null))[_0x5410('0x29')](handleError(_0x2b44dc,null));};exports[_0x5410('0xe8')]=function(_0x1d89bb,_0x32d654,_0x5bb14a){var _0x274f30={};var _0x3a0514={};var _0x3094a6;var _0x49a4e1;return db[_0x5410('0x40')][_0x5410('0x69')]({'where':{'id':_0x1d89bb['params']['id']}})[_0x5410('0x22')](handleEntityNotFound(_0x32d654,null))[_0x5410('0x22')](function(_0x4320f9){if(_0x4320f9){_0x3094a6=_0x4320f9;_0x3a0514[_0x5410('0x48')]=_[_0x5410('0x45')](db['User']['rawAttributes']);_0x3a0514[_0x5410('0x44')]=_[_0x5410('0x45')](_0x1d89bb[_0x5410('0x44')]);_0x3a0514[_0x5410('0x46')]=_[_0x5410('0x47')](_0x3a0514[_0x5410('0x48')],_0x3a0514[_0x5410('0x44')]);_0x274f30['attributes']=_['intersection'](_0x3a0514[_0x5410('0x48')],qs[_0x5410('0x4a')](_0x1d89bb[_0x5410('0x44')]['fields']));_0x274f30['attributes']=_0x274f30['attributes'][_0x5410('0x4b')]?_0x274f30[_0x5410('0x49')]:_0x3a0514[_0x5410('0x48')];_0x274f30[_0x5410('0x4e')]=qs[_0x5410('0x4f')](_0x1d89bb[_0x5410('0x44')][_0x5410('0x4f')]);_0x274f30[_0x5410('0x50')]=qs[_0x5410('0x46')](_[_0x5410('0x51')](_0x1d89bb[_0x5410('0x44')],_0x3a0514[_0x5410('0x46')]));if(_0x1d89bb['query'][_0x5410('0x52')]){_0x274f30[_0x5410('0x50')]=_['merge'](_0x274f30['where'],{'$or':_[_0x5410('0x3f')](_0x274f30[_0x5410('0x49')],function(_0x29cf28){var _0x4165b4={};_0x4165b4[_0x29cf28]={'$like':'%'+_0x1d89bb['query'][_0x5410('0x52')]+'%'};return _0x4165b4;})});}_0x274f30=_[_0x5410('0x53')]({},_0x274f30,_0x1d89bb['options']);return _0x3094a6['getAgents'](_0x274f30);}})['then'](function(_0x1bd2f0){if(_0x1bd2f0){_0x49a4e1=_0x1bd2f0[_0x5410('0x4b')];if(!_0x1d89bb[_0x5410('0x44')]['hasOwnProperty'](_0x5410('0x4d'))){_0x274f30[_0x5410('0x2f')]=qs[_0x5410('0x2f')](_0x1d89bb[_0x5410('0x44')][_0x5410('0x2f')]);_0x274f30[_0x5410('0x2d')]=qs[_0x5410('0x2d')](_0x1d89bb[_0x5410('0x44')][_0x5410('0x2d')]);}return _0x3094a6[_0x5410('0xe8')](_0x274f30);}})['then'](function(_0x35a2a4){if(_0x35a2a4){return _0x35a2a4?{'count':_0x49a4e1,'rows':_0x35a2a4}:null;}})['then'](respondWithResult(_0x32d654,null))[_0x5410('0x29')](handleError(_0x32d654,null));}; \ No newline at end of file +var _0xecc3=['Contact','Tag','Tags','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','intelepeer','redif','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','SmsAccount','includeAll','findAll','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','findOne','pick','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','createdAt','difference','updatedAt','CompanyId','mobile','twilio','From','Body','messageId','skebby','text','connectel','from','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','list','omit','defaults','contact','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','SmsInteraction'];(function(_0x2b9cd1,_0x48c0ae){var _0x3b0423=function(_0x4f1f01){while(--_0x4f1f01){_0x2b9cd1['push'](_0x2b9cd1['shift']());}};_0x3b0423(++_0x48c0ae);}(_0xecc3,0x1ee));var _0x3ecc=function(_0x4a94b5,_0x1e9652){_0x4a94b5=_0x4a94b5-0x0;var _0x306fe2=_0xecc3[_0x4a94b5];return _0x306fe2;};'use strict';var emlformat=require(_0x3ecc('0x0'));var rimraf=require(_0x3ecc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ecc('0x2'));var rp=require(_0x3ecc('0x3'));var moment=require(_0x3ecc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ecc('0x5'));var util=require(_0x3ecc('0x6'));var path=require(_0x3ecc('0x7'));var sox=require(_0x3ecc('0x8'));var csv=require(_0x3ecc('0x9'));var ejs=require(_0x3ecc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ecc('0xb'));var squel=require(_0x3ecc('0xc'));var crypto=require(_0x3ecc('0xd'));var jsforce=require(_0x3ecc('0xe'));var deskjs=require(_0x3ecc('0xf'));var toCsv=require(_0x3ecc('0x9'));var querystring=require(_0x3ecc('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ecc('0x11'));var authService=require(_0x3ecc('0x12'));var qs=require(_0x3ecc('0x13'));var as=require(_0x3ecc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ecc('0x15'))(_0x3ecc('0x16'));var utils=require(_0x3ecc('0x17'));var config=require(_0x3ecc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ecc('0x19'))['db'];config[_0x3ecc('0x1a')]=_['defaults'](config[_0x3ecc('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ecc('0x1b'))(new Redis(config['redis']));require(_0x3ecc('0x1c'))[_0x3ecc('0x1d')](socket);var jayson=require(_0x3ecc('0x1e'));var client=jayson[_0x3ecc('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x480814,_0x283a04,_0x4c10fb,_0x12953e){return new BPromise(function(_0x28276f,_0x80f845){var _0x2ee7bd=_0x12953e||client;return _0x2ee7bd[_0x3ecc('0x20')](_0x480814,_0x4c10fb)[_0x3ecc('0x21')](function(_0x66dd02){logger[_0x3ecc('0x22')](_0x3ecc('0x23'),_0x283a04,'request\x20sent');logger[_0x3ecc('0x24')](_0x3ecc('0x25'),_0x283a04,'request\x20sent',JSON[_0x3ecc('0x26')](_0x66dd02));if(_0x66dd02['error']){if(_0x66dd02['error'][_0x3ecc('0x27')]===0x1f4){logger[_0x3ecc('0x28')](_0x3ecc('0x23'),_0x283a04,_0x66dd02['error'][_0x3ecc('0x29')]);return _0x80f845(_0x66dd02[_0x3ecc('0x28')][_0x3ecc('0x29')]);}logger[_0x3ecc('0x28')]('SmsAccount,\x20%s,\x20%s',_0x283a04,_0x66dd02[_0x3ecc('0x28')][_0x3ecc('0x29')]);return _0x28276f(_0x66dd02[_0x3ecc('0x28')][_0x3ecc('0x29')]);}else{logger[_0x3ecc('0x22')](_0x3ecc('0x23'),_0x283a04,_0x3ecc('0x2a'));_0x28276f(_0x66dd02[_0x3ecc('0x2b')][_0x3ecc('0x29')]);}})[_0x3ecc('0x2c')](function(_0x226a14){logger[_0x3ecc('0x28')](_0x3ecc('0x23'),_0x283a04,_0x226a14);_0x80f845(_0x226a14);});});}function respondWithStatusCode(_0x204194,_0x4ed8cb){_0x4ed8cb=_0x4ed8cb||0xcc;return function(_0x4ab6ec){if(_0x4ab6ec){return _0x204194['sendStatus'](_0x4ed8cb);}return _0x204194[_0x3ecc('0x2d')](_0x4ed8cb)[_0x3ecc('0x2e')]();};}function respondWithResult(_0x542a83,_0x5b2ac0){_0x5b2ac0=_0x5b2ac0||0xc8;return function(_0x22e399){if(_0x22e399){return _0x542a83[_0x3ecc('0x2d')](_0x5b2ac0)[_0x3ecc('0x2f')](_0x22e399);}};}function respondWithFilteredResult(_0x4fe22c,_0x38d87f){return function(_0x5a7664){if(_0x5a7664){var _0x2a1deb=typeof _0x38d87f[_0x3ecc('0x30')]===_0x3ecc('0x31')&&typeof _0x38d87f[_0x3ecc('0x32')]===_0x3ecc('0x31');var _0x5bfcdc=_0x5a7664['count'];var _0x2b6060=_0x2a1deb?0x0:_0x38d87f[_0x3ecc('0x30')];var _0x52d860=_0x2a1deb?_0x5a7664[_0x3ecc('0x33')]:_0x38d87f[_0x3ecc('0x30')]+_0x38d87f[_0x3ecc('0x32')];var _0x954fe;if(_0x52d860>=_0x5bfcdc){_0x52d860=_0x5bfcdc;_0x954fe=0xc8;}else{_0x954fe=0xce;}_0x4fe22c[_0x3ecc('0x2d')](_0x954fe);return _0x4fe22c[_0x3ecc('0x34')](_0x3ecc('0x35'),_0x2b6060+'-'+_0x52d860+'/'+_0x5bfcdc)['json'](_0x5a7664);}return null;};}function patchUpdates(_0x53620e){return function(_0x3314b1){try{jsonpatch[_0x3ecc('0x36')](_0x3314b1,_0x53620e,!![]);}catch(_0x579f8d){return BPromise[_0x3ecc('0x37')](_0x579f8d);}return _0x3314b1['save']();};}function saveUpdates(_0x464a2b,_0x5288d1){return function(_0xf2f01b){if(_0xf2f01b){return _0xf2f01b[_0x3ecc('0x38')](_0x464a2b)[_0x3ecc('0x21')](function(_0xa13c47){return _0xa13c47;});}return null;};}function removeEntity(_0x177957,_0x5059bd){return function(_0x3babd4){if(_0x3babd4){return _0x3babd4[_0x3ecc('0x39')]()[_0x3ecc('0x21')](function(){var _0x9faa65=_0x3babd4[_0x3ecc('0x3a')]({'plain':!![]});var _0x2a965e='SmsAccounts';return db[_0x3ecc('0x3b')]['destroy']({'where':{'type':_0x2a965e,'resourceId':_0x9faa65['id']}})['then'](function(){return _0x3babd4;});})[_0x3ecc('0x21')](function(){_0x177957[_0x3ecc('0x2d')](0xcc)[_0x3ecc('0x2e')]();});}};}function handleEntityNotFound(_0x115e4c,_0x327018){return function(_0x4ead1f){if(!_0x4ead1f){_0x115e4c[_0x3ecc('0x3c')](0x194);}return _0x4ead1f;};}function handleError(_0xeff04d,_0x4062ea){_0x4062ea=_0x4062ea||0x1f4;return function(_0x91b449){logger[_0x3ecc('0x28')](_0x91b449[_0x3ecc('0x3d')]);if(_0x91b449['name']){delete _0x91b449[_0x3ecc('0x3e')];}_0xeff04d['status'](_0x4062ea)[_0x3ecc('0x3f')](_0x91b449);};}exports[_0x3ecc('0x40')]=function(_0x4e33a8,_0x3fa5ca){var _0xa88265={'include':[{'model':db[_0x3ecc('0x41')],'as':_0x3ecc('0x42')}]},_0x36d09f={},_0x15d8a8={'count':0x0,'rows':[]};var _0x3ba3e8=_[_0x3ecc('0x43')](db['SmsAccount'][_0x3ecc('0x44')],function(_0x2cb8f5){return{'name':_0x2cb8f5[_0x3ecc('0x45')],'type':_0x2cb8f5['type']['key']};});_0x36d09f[_0x3ecc('0x46')]=_[_0x3ecc('0x43')](_0x3ba3e8,'name');_0x36d09f[_0x3ecc('0x47')]=_[_0x3ecc('0x48')](_0x4e33a8[_0x3ecc('0x47')]);_0x36d09f[_0x3ecc('0x49')]=_[_0x3ecc('0x4a')](_0x36d09f[_0x3ecc('0x46')],_0x36d09f[_0x3ecc('0x47')]);_0xa88265[_0x3ecc('0x4b')]=_[_0x3ecc('0x4a')](_0x36d09f[_0x3ecc('0x46')],qs[_0x3ecc('0x4c')](_0x4e33a8['query']['fields']));_0xa88265[_0x3ecc('0x4b')]=_0xa88265[_0x3ecc('0x4b')][_0x3ecc('0x4d')]?_0xa88265[_0x3ecc('0x4b')]:_0x36d09f['model'];if(!_0x4e33a8[_0x3ecc('0x47')][_0x3ecc('0x4e')](_0x3ecc('0x4f'))){_0xa88265['limit']=qs['limit'](_0x4e33a8[_0x3ecc('0x47')][_0x3ecc('0x32')]);_0xa88265['offset']=qs[_0x3ecc('0x30')](_0x4e33a8['query'][_0x3ecc('0x30')]);}_0xa88265[_0x3ecc('0x50')]=qs[_0x3ecc('0x51')](_0x4e33a8['query']['sort']);_0xa88265['where']=qs[_0x3ecc('0x49')](_['pick'](_0x4e33a8[_0x3ecc('0x47')],_0x36d09f[_0x3ecc('0x49')]),_0x3ba3e8);if(_0x4e33a8[_0x3ecc('0x47')][_0x3ecc('0x52')]){_0xa88265[_0x3ecc('0x53')]=_[_0x3ecc('0x54')](_0xa88265[_0x3ecc('0x53')],{'$or':_['map'](_0x3ba3e8,function(_0x10987d){if(_0x10987d[_0x3ecc('0x55')]!==_0x3ecc('0x56')){var _0x95f359={};_0x95f359[_0x10987d[_0x3ecc('0x3e')]]={'$like':'%'+_0x4e33a8['query'][_0x3ecc('0x52')]+'%'};return _0x95f359;}})});}_0xa88265=_[_0x3ecc('0x54')]({},_0xa88265,_0x4e33a8[_0x3ecc('0x57')]);var _0x461937={'where':_0xa88265['where']};return db[_0x3ecc('0x58')][_0x3ecc('0x33')](_0x461937)['then'](function(_0x4da72b){_0x15d8a8[_0x3ecc('0x33')]=_0x4da72b;if(_0x4e33a8['query'][_0x3ecc('0x59')]){_0xa88265['include']=[{'all':!![]}];}return db[_0x3ecc('0x58')][_0x3ecc('0x5a')](_0xa88265);})[_0x3ecc('0x21')](function(_0x3c2e58){_0x15d8a8['rows']=_0x3c2e58;return _0x15d8a8;})[_0x3ecc('0x21')](respondWithFilteredResult(_0x3fa5ca,_0xa88265))[_0x3ecc('0x2c')](handleError(_0x3fa5ca,null));};exports['show']=function(_0x29abce,_0x32d32b){var _0x3cf418={'raw':![],'where':{'id':_0x29abce[_0x3ecc('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3006f3={};_0x3006f3[_0x3ecc('0x46')]=_[_0x3ecc('0x48')](db[_0x3ecc('0x58')][_0x3ecc('0x44')]);_0x3006f3['query']=_[_0x3ecc('0x48')](_0x29abce['query']);_0x3006f3[_0x3ecc('0x49')]=_['intersection'](_0x3006f3[_0x3ecc('0x46')],_0x3006f3['query']);_0x3cf418['attributes']=_['intersection'](_0x3006f3[_0x3ecc('0x46')],qs['fields'](_0x29abce[_0x3ecc('0x47')]['fields']));_0x3cf418[_0x3ecc('0x4b')]=_0x3cf418[_0x3ecc('0x4b')][_0x3ecc('0x4d')]?_0x3cf418[_0x3ecc('0x4b')]:_0x3006f3['model'];if(_0x29abce[_0x3ecc('0x47')][_0x3ecc('0x59')]){_0x3cf418[_0x3ecc('0x5c')]=[{'all':!![]}];}_0x3cf418=_[_0x3ecc('0x54')]({},_0x3cf418,_0x29abce[_0x3ecc('0x57')]);return db['SmsAccount'][_0x3ecc('0x5d')](_0x3cf418)[_0x3ecc('0x21')](handleEntityNotFound(_0x32d32b,null))[_0x3ecc('0x21')](respondWithResult(_0x32d32b,null))[_0x3ecc('0x2c')](handleError(_0x32d32b,null));};exports['create']=function(_0x1881cb,_0x1f40d3){return db[_0x3ecc('0x58')][_0x3ecc('0x5e')](_0x1881cb[_0x3ecc('0x5f')],{})[_0x3ecc('0x21')](function(_0x5d842e){var _0x18a9c5=_0x1881cb[_0x3ecc('0x60')][_0x3ecc('0x3a')]({'plain':!![]});if(!_0x18a9c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18a9c5[_0x3ecc('0x61')]===_0x3ecc('0x60')){var _0x4641d7=_0x5d842e['get']({'plain':!![]});var _0x9ec1d0='SmsAccounts';return db[_0x3ecc('0x62')]['find']({'where':{'name':_0x9ec1d0,'userProfileId':_0x18a9c5[_0x3ecc('0x63')]},'raw':!![]})[_0x3ecc('0x21')](function(_0x556eac){if(_0x556eac&&_0x556eac[_0x3ecc('0x64')]===0x0){return db[_0x3ecc('0x3b')][_0x3ecc('0x5e')]({'name':_0x4641d7['name'],'resourceId':_0x4641d7['id'],'type':_0x556eac[_0x3ecc('0x3e')],'sectionId':_0x556eac['id']},{})['then'](function(){return _0x5d842e;});}else{return _0x5d842e;}})[_0x3ecc('0x2c')](function(_0x52720e){logger['error'](_0x3ecc('0x65'),_0x52720e);throw _0x52720e;});}return _0x5d842e;})[_0x3ecc('0x21')](respondWithResult(_0x1f40d3,0xc9))['catch'](handleError(_0x1f40d3,null));};exports[_0x3ecc('0x38')]=function(_0x5e5505,_0xe977be){if(_0x5e5505[_0x3ecc('0x5f')]['id']){delete _0x5e5505[_0x3ecc('0x5f')]['id'];}return db[_0x3ecc('0x58')][_0x3ecc('0x5d')]({'where':{'id':_0x5e5505[_0x3ecc('0x5b')]['id']},'include':[{'model':db[_0x3ecc('0x41')],'as':_0x3ecc('0x42')}]})[_0x3ecc('0x21')](handleEntityNotFound(_0xe977be,null))[_0x3ecc('0x21')](saveUpdates(_0x5e5505[_0x3ecc('0x5f')],null))[_0x3ecc('0x21')](respondWithResult(_0xe977be,null))['catch'](handleError(_0xe977be,null));};exports[_0x3ecc('0x39')]=function(_0xeb170c,_0x316642){return db[_0x3ecc('0x58')][_0x3ecc('0x5d')]({'where':{'id':_0xeb170c[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x316642,null))[_0x3ecc('0x21')](removeEntity(_0x316642,null))['catch'](handleError(_0x316642,null));};exports[_0x3ecc('0x66')]=function(_0x2c7f8f,_0x28586c){return db[_0x3ecc('0x58')][_0x3ecc('0x66')]()[_0x3ecc('0x21')](respondWithResult(_0x28586c,null))[_0x3ecc('0x2c')](handleError(_0x28586c,null));};exports[_0x3ecc('0x67')]=function(_0x56e5a4,_0x4ced10,_0x4ee5bc){if(_0x56e5a4[_0x3ecc('0x5f')]['id']){delete _0x56e5a4[_0x3ecc('0x5f')]['id'];}return db[_0x3ecc('0x58')][_0x3ecc('0x5d')]({'where':{'id':_0x56e5a4[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x4ced10,null))[_0x3ecc('0x21')](function(_0x40b553){if(_0x40b553){_0x56e5a4[_0x3ecc('0x5f')][_0x3ecc('0x68')]=_0x40b553['id'];return db['Disposition'][_0x3ecc('0x5e')](_0x56e5a4[_0x3ecc('0x5f')]);}})[_0x3ecc('0x21')](respondWithResult(_0x4ced10,null))['catch'](handleError(_0x4ced10,null));};exports[_0x3ecc('0x69')]=function(_0x378676,_0x37e3ff,_0x5612bc){var _0x33b436={'raw':![],'where':{}};var _0x243ddd={};var _0x4d01f2={'count':0x0,'rows':[]};return db[_0x3ecc('0x58')][_0x3ecc('0x6a')]({'where':{'id':_0x378676[_0x3ecc('0x5b')]['id']}})['then'](handleEntityNotFound(_0x37e3ff,null))[_0x3ecc('0x21')](function(_0xb5ff1e){if(_0xb5ff1e){_0x243ddd['model']=_[_0x3ecc('0x48')](db['Disposition'][_0x3ecc('0x44')]);_0x243ddd[_0x3ecc('0x47')]=_[_0x3ecc('0x48')](_0x378676['query']);_0x243ddd['filters']=_[_0x3ecc('0x4a')](_0x243ddd[_0x3ecc('0x46')],_0x243ddd['query']);_0x33b436[_0x3ecc('0x4b')]=_[_0x3ecc('0x4a')](_0x243ddd[_0x3ecc('0x46')],qs[_0x3ecc('0x4c')](_0x378676[_0x3ecc('0x47')][_0x3ecc('0x4c')]));_0x33b436[_0x3ecc('0x4b')]=_0x33b436['attributes'][_0x3ecc('0x4d')]?_0x33b436[_0x3ecc('0x4b')]:_0x243ddd[_0x3ecc('0x46')];if(!_0x378676[_0x3ecc('0x47')]['hasOwnProperty'](_0x3ecc('0x4f'))){_0x33b436['limit']=qs[_0x3ecc('0x32')](_0x378676['query'][_0x3ecc('0x32')]);_0x33b436['offset']=qs[_0x3ecc('0x30')](_0x378676[_0x3ecc('0x47')]['offset']);}_0x33b436[_0x3ecc('0x50')]=qs[_0x3ecc('0x51')](_0x378676[_0x3ecc('0x47')][_0x3ecc('0x51')]);_0x33b436[_0x3ecc('0x53')]=qs['filters'](_[_0x3ecc('0x6b')](_0x378676['query'],_0x243ddd['filters']));_0x33b436['where']['SmsAccountId']=_0xb5ff1e['id'];if(_0x378676[_0x3ecc('0x47')][_0x3ecc('0x52')]){_0x33b436[_0x3ecc('0x53')]=_[_0x3ecc('0x54')](_0x33b436[_0x3ecc('0x53')],{'$or':_['map'](_0x33b436[_0x3ecc('0x4b')],function(_0x18923d){var _0x2af34f={};_0x2af34f[_0x18923d]={'$like':'%'+_0x378676['query'][_0x3ecc('0x52')]+'%'};return _0x2af34f;})});}_0x33b436=_[_0x3ecc('0x54')]({},_0x33b436,_0x378676['options']);return db['Disposition'][_0x3ecc('0x33')]({'where':_0x33b436[_0x3ecc('0x53')]})[_0x3ecc('0x21')](function(_0x200ef6){_0x4d01f2[_0x3ecc('0x33')]=_0x200ef6;if(_0x378676[_0x3ecc('0x47')][_0x3ecc('0x59')]){_0x33b436['include']=[{'all':!![]}];}return db['Disposition'][_0x3ecc('0x5a')](_0x33b436);})[_0x3ecc('0x21')](function(_0x50d0f3){_0x4d01f2[_0x3ecc('0x6c')]=_0x50d0f3;return _0x4d01f2;});}})[_0x3ecc('0x21')](respondWithFilteredResult(_0x37e3ff,_0x33b436))[_0x3ecc('0x2c')](handleError(_0x37e3ff,null));};exports['removeDispositions']=function(_0x1074d2,_0x555216,_0xcaf220){return db[_0x3ecc('0x58')][_0x3ecc('0x5d')]({'where':{'id':_0x1074d2[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x555216,null))[_0x3ecc('0x21')](function(_0x25bd0f){if(_0x25bd0f){return _0x25bd0f[_0x3ecc('0x6d')](_0x1074d2[_0x3ecc('0x47')][_0x3ecc('0x6e')]);}})['then'](respondWithStatusCode(_0x555216,null))[_0x3ecc('0x2c')](handleError(_0x555216,null));};exports['addAnswer']=function(_0x2c114e,_0x3e34a2,_0x4a3c47){if(_0x2c114e[_0x3ecc('0x5f')]['id']){delete _0x2c114e[_0x3ecc('0x5f')]['id'];}return db[_0x3ecc('0x58')]['find']({'where':{'id':_0x2c114e['params']['id']}})['then'](handleEntityNotFound(_0x3e34a2,null))['then'](function(_0x3d4ca9){if(_0x3d4ca9){_0x2c114e[_0x3ecc('0x5f')]['SmsAccountId']=_0x3d4ca9['id'];return db[_0x3ecc('0x6f')][_0x3ecc('0x5e')](_0x2c114e['body']);}})[_0x3ecc('0x21')](respondWithResult(_0x3e34a2,null))[_0x3ecc('0x2c')](handleError(_0x3e34a2,null));};exports[_0x3ecc('0x70')]=function(_0x5d5c41,_0x163695,_0x3770c5){var _0x68d4c6={'raw':![],'where':{}};var _0x51e33={};var _0x480566={'count':0x0,'rows':[]};return db[_0x3ecc('0x58')]['findOne']({'where':{'id':_0x5d5c41['params']['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x163695,null))[_0x3ecc('0x21')](function(_0x382a44){if(_0x382a44){_0x51e33['model']=_[_0x3ecc('0x48')](db['CannedAnswer']['rawAttributes']);_0x51e33[_0x3ecc('0x47')]=_[_0x3ecc('0x48')](_0x5d5c41[_0x3ecc('0x47')]);_0x51e33[_0x3ecc('0x49')]=_[_0x3ecc('0x4a')](_0x51e33['model'],_0x51e33[_0x3ecc('0x47')]);_0x68d4c6[_0x3ecc('0x4b')]=_[_0x3ecc('0x4a')](_0x51e33[_0x3ecc('0x46')],qs[_0x3ecc('0x4c')](_0x5d5c41[_0x3ecc('0x47')][_0x3ecc('0x4c')]));_0x68d4c6['attributes']=_0x68d4c6[_0x3ecc('0x4b')]['length']?_0x68d4c6['attributes']:_0x51e33[_0x3ecc('0x46')];if(!_0x5d5c41[_0x3ecc('0x47')][_0x3ecc('0x4e')]('nolimit')){_0x68d4c6[_0x3ecc('0x32')]=qs[_0x3ecc('0x32')](_0x5d5c41[_0x3ecc('0x47')][_0x3ecc('0x32')]);_0x68d4c6[_0x3ecc('0x30')]=qs[_0x3ecc('0x30')](_0x5d5c41['query'][_0x3ecc('0x30')]);}_0x68d4c6[_0x3ecc('0x50')]=qs[_0x3ecc('0x51')](_0x5d5c41[_0x3ecc('0x47')][_0x3ecc('0x51')]);_0x68d4c6[_0x3ecc('0x53')]=qs['filters'](_['pick'](_0x5d5c41[_0x3ecc('0x47')],_0x51e33[_0x3ecc('0x49')]));_0x68d4c6[_0x3ecc('0x53')]['SmsAccountId']=_0x382a44['id'];if(_0x5d5c41[_0x3ecc('0x47')][_0x3ecc('0x52')]){_0x68d4c6[_0x3ecc('0x53')]=_[_0x3ecc('0x54')](_0x68d4c6[_0x3ecc('0x53')],{'$or':_[_0x3ecc('0x43')](_0x68d4c6[_0x3ecc('0x4b')],function(_0x467b30){var _0x3e09d2={};_0x3e09d2[_0x467b30]={'$like':'%'+_0x5d5c41[_0x3ecc('0x47')]['filter']+'%'};return _0x3e09d2;})});}_0x68d4c6=_[_0x3ecc('0x54')]({},_0x68d4c6,_0x5d5c41[_0x3ecc('0x57')]);return db['CannedAnswer'][_0x3ecc('0x33')]({'where':_0x68d4c6[_0x3ecc('0x53')]})[_0x3ecc('0x21')](function(_0x53282b){_0x480566[_0x3ecc('0x33')]=_0x53282b;if(_0x5d5c41['query'][_0x3ecc('0x59')]){_0x68d4c6[_0x3ecc('0x5c')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x68d4c6);})['then'](function(_0x5c1141){_0x480566['rows']=_0x5c1141;return _0x480566;});}})[_0x3ecc('0x21')](respondWithFilteredResult(_0x163695,_0x68d4c6))[_0x3ecc('0x2c')](handleError(_0x163695,null));};exports[_0x3ecc('0x71')]=function(_0x747935,_0x82e8e7,_0x1a5560){return db[_0x3ecc('0x58')]['find']({'where':{'id':_0x747935[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x82e8e7,null))['then'](function(_0x48f39c){if(_0x48f39c){return _0x48f39c[_0x3ecc('0x71')](_0x747935['query'][_0x3ecc('0x6e')]);}})[_0x3ecc('0x21')](respondWithStatusCode(_0x82e8e7,null))[_0x3ecc('0x2c')](handleError(_0x82e8e7,null));};exports[_0x3ecc('0x72')]=function(_0x102c9b,_0x53b93d,_0x2a79a8){var _0x3bb523={'channel':_0x3ecc('0x73')};var _0xab952=[];var _0x2d431c=[];var _0x1383b0={};return db[_0x3ecc('0x58')][_0x3ecc('0x5d')]({'where':{'id':_0x102c9b[_0x3ecc('0x5b')]['id']},'include':[{'model':db[_0x3ecc('0x74')],'as':_0x3ecc('0x75')}]})[_0x3ecc('0x21')](handleEntityNotFound(_0x53b93d,null))[_0x3ecc('0x21')](function(_0x2f43cf){_0x3bb523['account']=_0x2f43cf;_0x3bb523[_0x3ecc('0x76')]=_[_0x3ecc('0x77')](_0x2f43cf[_0x3ecc('0x75')],['priority'],[_0x3ecc('0x78')]);if(_0x3bb523[_0x3ecc('0x79')][_0x3ecc('0x75')]){delete _0x3bb523[_0x3ecc('0x79')][_0x3ecc('0x75')];}return db[_0x3ecc('0x7a')][_0x3ecc('0x66')]();})[_0x3ecc('0x21')](function(_0x266987){if(!_0x266987){throw new db[(_0x3ecc('0x7b'))][(_0x3ecc('0x7c'))]('no\x20available\x20attributes');}_0xab952=_['difference'](_[_0x3ecc('0x48')](_0x266987),[_0x3ecc('0x7d'),'updatedAt']);_0x2d431c=_[_0x3ecc('0x7e')](_[_0x3ecc('0x48')](_0x266987),[_0x3ecc('0x7d'),_0x3ecc('0x7f'),_0x3ecc('0x80'),'ListId']);_0x3bb523[_0x3ecc('0x5f')]={'mapKey':_0x3ecc('0x81')};if(_0x3bb523[_0x3ecc('0x79')][_0x3ecc('0x55')]){switch(_0x3bb523[_0x3ecc('0x79')][_0x3ecc('0x55')]){case _0x3ecc('0x82'):_0x3bb523[_0x3ecc('0x5f')]['from']=_0x102c9b['body'][_0x3ecc('0x83')];_0x3bb523[_0x3ecc('0x5f')]['body']=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x84')];_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x85')]=_0x102c9b[_0x3ecc('0x5f')]['MessageSid'];break;case _0x3ecc('0x86'):_0x3bb523[_0x3ecc('0x5f')]['from']='+'+_0x102c9b[_0x3ecc('0x5f')]['sender'];_0x3bb523[_0x3ecc('0x5f')]['body']=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x87')];break;case _0x3ecc('0x88'):_0x3bb523['body']['from']=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x89')];_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x5f')]=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x29')];break;case _0x3ecc('0x8a'):_0x3bb523[_0x3ecc('0x5f')]['from']=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x89')];_0x3bb523[_0x3ecc('0x5f')]['body']=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x5f')];_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x85')]=_0x102c9b['body'][_0x3ecc('0x8b')];break;case _0x3ecc('0x8c'):_0x3bb523['body'][_0x3ecc('0x89')]=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x83')];_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x5f')]=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x8d')];_0x3bb523[_0x3ecc('0x5f')]['messageId']=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x8e')];break;case _0x3ecc('0x8f'):_0x3bb523['body'][_0x3ecc('0x89')]='+'+_0x102c9b['body']['results'][0x0]['from'];_0x3bb523['body'][_0x3ecc('0x5f')]=_0x102c9b['body'][_0x3ecc('0x90')][0x0][_0x3ecc('0x87')];_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x85')]=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x90')][0x0][_0x3ecc('0x85')];break;case _0x3ecc('0x91'):_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x89')]=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x92')];_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x5f')]=_0x102c9b['body']['segmentedMessage'][_0x3ecc('0x29')];break;case _0x3ecc('0x93'):_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x89')]=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x94')];_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x5f')]=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x87')];_0x3bb523['body'][_0x3ecc('0x85')]=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x95')];break;case _0x3ecc('0x96'):_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x85')]=_0x102c9b[_0x3ecc('0x5f')][0x0]['message']['id'];_0x3bb523[_0x3ecc('0x5f')]['from']=_0x102c9b[_0x3ecc('0x5f')][0x0][_0x3ecc('0x29')][_0x3ecc('0x89')];_0x3bb523[_0x3ecc('0x5f')]['body']=_0x102c9b[_0x3ecc('0x5f')][0x0][_0x3ecc('0x29')]['text'];break;case'intelepeer':_0x3bb523['body'][_0x3ecc('0x89')]=_0x102c9b[_0x3ecc('0x5f')]['from'];_0x3bb523[_0x3ecc('0x5f')]['body']=_0x102c9b[_0x3ecc('0x5f')][_0x3ecc('0x29')];_0x3bb523['body'][_0x3ecc('0x85')]=_0x102c9b[_0x3ecc('0x5f')]['refid'];break;}}if(_0x3bb523[_0x3ecc('0x5f')]['id']){delete _0x3bb523[_0x3ecc('0x5f')]['id'];}if(_['isNil'](_0x3bb523['body'][_0x3ecc('0x89')])){throw new db['Sequelize'][(_0x3ecc('0x7c'))](_0x3ecc('0x97'));}if(_['isNil'](_0x3bb523[_0x3ecc('0x5f')]['body'])||_0x3bb523['body']['body']===''){throw new db['Sequelize'][(_0x3ecc('0x7c'))](_0x3ecc('0x98'));}if(_[_0x3ecc('0x99')](_0x3bb523['body'][_0x3ecc('0x9a')])){throw new db['Sequelize'][(_0x3ecc('0x7c'))](_0x3ecc('0x9b')+_0x2d431c);}if(!_[_0x3ecc('0x9c')](_0x2d431c,_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x9a')])){throw new db[(_0x3ecc('0x7b'))]['ValidationError'](_0x3ecc('0x9d')+_0x2d431c);}_0x1383b0[_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x9a')]]=_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x89')];return db[_0x3ecc('0x9e')][_0x3ecc('0x5d')]({'where':{'id':_0x3bb523[_0x3ecc('0x79')][_0x3ecc('0x9f')]},'include':[{'model':db[_0x3ecc('0x7a')],'as':_0x3ecc('0xa0'),'where':_0x1383b0,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x3ecc('0x21')](handleEntityNotFound(_0x53b93d,null))['then'](function(_0x3ee9cd){if(_0x3ee9cd){_0x3bb523[_0x3ecc('0xa1')]=_[_0x3ecc('0xa2')](_0x3ee9cd,[_0x3ecc('0xa0')]);if(_0x3ee9cd[_0x3ecc('0xa0')][_0x3ecc('0x4d')]){return _0x3ee9cd['Contacts'][0x0];}var _0x3b17fd=_[_0x3ecc('0xa3')](_0x3bb523[_0x3ecc('0x5f')],{'firstName':_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x89')],'ListId':_0x3ee9cd['id']});_0x3b17fd[_0x3bb523['body'][_0x3ecc('0x9a')]]=_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x89')];return db[_0x3ecc('0x7a')]['create'](_0x3b17fd,{'fields':_0xab952,'raw':!![]});}})[_0x3ecc('0x21')](handleEntityNotFound(_0x53b93d,null))[_0x3ecc('0x21')](function(_0x182159){if(_0x182159){_0x3bb523[_0x3ecc('0xa4')]=_0x182159;var _0x220e7a={'ContactId':_0x182159['id'],'phone':_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x89')],'SmsAccountId':_0x102c9b['params']['id']};var _0x292762={'ContactId':_0x182159['id'],'SmsAccountId':_0x102c9b[_0x3ecc('0x5b')]['id'],'closed':![]};return db['SmsInteraction'][_0x3ecc('0x5d')]({'where':_0x292762})['then'](function(_0x3e1eb0){if(_0x3e1eb0){return[_0x3e1eb0,![]];}return db['SmsInteraction'][_0x3ecc('0x5e')](_0x220e7a)[_0x3ecc('0x21')](function(_0x4ebf61){return[_0x4ebf61,!![]];});});}})[_0x3ecc('0xa5')](function(_0x343e2b,_0x5c2ad1){_0x3bb523[_0x3ecc('0xa6')]=_0x343e2b[_0x3ecc('0x3a')]({'plain':!![]});_0x3bb523[_0x3ecc('0xa6')][_0x3ecc('0xa7')]=![];if(_0x5c2ad1){if(_0x3bb523[_0x3ecc('0x79')][_0x3ecc('0xa8')]){_0x3bb523[_0x3ecc('0x76')][_0x3ecc('0xa9')]({'id':0x0,'priority':_0x3bb523[_0x3ecc('0x76')][_0x3ecc('0x4d')]+0x1,'app':_0x3ecc('0xaa'),'appdata':_0x3ecc('0xab'),'interval':_0x3ecc('0xac')});}_0x3bb523[_0x3ecc('0xa6')]['created']=!![];}return db[_0x3ecc('0xad')]['create']({'phone':_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0x89')],'messageId':_0x3bb523[_0x3ecc('0x5f')]['messageId'],'body':_0x3bb523['body'][_0x3ecc('0x5f')],'SmsAccountId':_0x102c9b['params']['id'],'SmsInteractionId':_0x343e2b['id'],'direction':'in','ContactId':_0x343e2b[_0x3ecc('0xae')],'AttachmentId':_0x3bb523[_0x3ecc('0x5f')][_0x3ecc('0xaf')]});})[_0x3ecc('0x21')](function(_0x47f508){_0x3bb523[_0x3ecc('0x29')]=_0x47f508;if(_0x3bb523[_0x3ecc('0xa6')]['UserId']){return db[_0x3ecc('0xb0')][_0x3ecc('0x5d')]({'attributes':['id','name'],'where':{'id':_0x3bb523[_0x3ecc('0xa6')]['UserId']}})[_0x3ecc('0x21')](function(_0x93f771){if(_0x93f771){_0x3bb523['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x3ecc('0xb1'),'appdata':_0x93f771[_0x3ecc('0x3e')]+','+(_0x3bb523[_0x3ecc('0x79')][_0x3ecc('0xb2')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3ecc('0xb3'),_0x3ecc('0xb4'),_0x3bb523);});}return respondWithRpcPromise(_0x3ecc('0xb3'),'startRouting',_0x3bb523);})['then'](function(_0x2c69f2){if(_0x2c69f2){var _0x3b6727=0xc8;var _0x3b13ab='receiveMessage';logger[_0x3ecc('0x22')](_0x3ecc('0x25'),_0x3b13ab,_0x3b6727,_0x3ecc('0xb5'));logger[_0x3ecc('0x24')](_0x3ecc('0xb6'),_0x3b13ab,_0x3b6727,_0x3ecc('0xb5'),JSON[_0x3ecc('0x26')](_0x2c69f2));if(_0x3bb523['account'][_0x3ecc('0x55')]===_0x3ecc('0x82')){return _0x53b93d[_0x3ecc('0x2d')](_0x3b6727)[_0x3ecc('0x34')](_0x3ecc('0xb7'),_0x3ecc('0xb8'))[_0x3ecc('0x3f')]('\x0a');}else{return _0x53b93d['status'](_0x3b6727)[_0x3ecc('0x2f')](_0x2c69f2);}}})['catch'](handleError(_0x53b93d,null));};exports[_0x3ecc('0xb9')]=function(_0x1db634,_0x17abf8){var _0x5d789c=_0x1db634[_0x3ecc('0x5b')]['id'];var _0x2fe3a5=_0x1db634[_0x3ecc('0x5f')];var _0x45c2f7=0xc8;var _0x7c4abc=null;return db[_0x3ecc('0xba')][_0x3ecc('0xbb')]({'isolationLevel':db[_0x3ecc('0xba')][_0x3ecc('0xbc')][_0x3ecc('0xbd')]['READ_COMMITTED']},function(_0x30ee32){return db[_0x3ecc('0x58')][_0x3ecc('0x6a')]({'where':{'id':_0x5d789c},'transaction':_0x30ee32})['then'](function(_0x412213){if(_0x412213){return db[_0x3ecc('0x74')][_0x3ecc('0x39')]({'where':{'SmsAccountId':_0x5d789c},'transaction':_0x30ee32})[_0x3ecc('0x21')](function(){var _0x5d42cf=_[_0x3ecc('0x43')](_0x2fe3a5,function(_0x28b724){_0x28b724[_0x3ecc('0x68')]=_0x5d789c;return _0x28b724;});return db[_0x3ecc('0x74')][_0x3ecc('0xbe')](_0x5d42cf,{'transaction':_0x30ee32});});}else{_0x45c2f7=0x194;_0x7c4abc=[];}});})[_0x3ecc('0x21')](function(){if(_0x45c2f7!==0x194){return db[_0x3ecc('0x74')][_0x3ecc('0xbf')]({'where':{'SmsAccountId':_0x5d789c},'order':'priority'})[_0x3ecc('0x21')](function(_0x56b110){_0x7c4abc=_0x56b110;});}})[_0x3ecc('0x2c')](function(_0x5a3149){_0x45c2f7=0x1f4;logger[_0x3ecc('0x28')](_0x5a3149['stack']);if(_0x5a3149['name']){delete _0x5a3149[_0x3ecc('0x3e')];}_0x7c4abc=_0x5a3149;})[_0x3ecc('0xc0')](function(){if(_0x7c4abc===null){_0x17abf8[_0x3ecc('0x3c')](_0x45c2f7);}else{if(_0x45c2f7===0x1f4){_0x17abf8['status'](_0x45c2f7)[_0x3ecc('0x3f')](_0x7c4abc);}else{_0x17abf8['status'](_0x45c2f7)[_0x3ecc('0x2f')](_0x7c4abc);}}});};exports[_0x3ecc('0xc1')]=function(_0x375fcf,_0x5d228d,_0x2a268e){var _0x17868a={};var _0x2973b5={};var _0x4043c1;var _0x26014e;return db['SmsAccount'][_0x3ecc('0x6a')]({'where':{'id':_0x375fcf[_0x3ecc('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5d228d,null))[_0x3ecc('0x21')](function(_0x1cf82b){if(_0x1cf82b){_0x4043c1=_0x1cf82b;_0x2973b5[_0x3ecc('0x46')]=_[_0x3ecc('0x48')](db['SmsApplication'][_0x3ecc('0x44')]);_0x2973b5[_0x3ecc('0x47')]=_[_0x3ecc('0x48')](_0x375fcf[_0x3ecc('0x47')]);_0x2973b5['filters']=_[_0x3ecc('0x4a')](_0x2973b5[_0x3ecc('0x46')],_0x2973b5[_0x3ecc('0x47')]);_0x17868a[_0x3ecc('0x4b')]=_['intersection'](_0x2973b5[_0x3ecc('0x46')],qs[_0x3ecc('0x4c')](_0x375fcf[_0x3ecc('0x47')][_0x3ecc('0x4c')]));_0x17868a[_0x3ecc('0x4b')]=_0x17868a['attributes'][_0x3ecc('0x4d')]?_0x17868a[_0x3ecc('0x4b')]:_0x2973b5[_0x3ecc('0x46')];_0x17868a['order']=qs['sort'](_0x375fcf[_0x3ecc('0x47')]['sort']);_0x17868a[_0x3ecc('0x53')]=qs[_0x3ecc('0x49')](_[_0x3ecc('0x6b')](_0x375fcf['query'],_0x2973b5[_0x3ecc('0x49')]));if(_0x375fcf[_0x3ecc('0x47')]['filter']){_0x17868a[_0x3ecc('0x53')]=_[_0x3ecc('0x54')](_0x17868a['where'],{'$or':_[_0x3ecc('0x43')](_0x17868a[_0x3ecc('0x4b')],function(_0x1c6697){var _0xb9085a={};_0xb9085a[_0x1c6697]={'$like':'%'+_0x375fcf[_0x3ecc('0x47')][_0x3ecc('0x52')]+'%'};return _0xb9085a;})});}_0x17868a=_[_0x3ecc('0x54')]({},_0x17868a,_0x375fcf['options']);return _0x4043c1[_0x3ecc('0xc1')](_0x17868a);}})[_0x3ecc('0x21')](function(_0x173704){if(_0x173704){_0x26014e=_0x173704['length'];if(!_0x375fcf[_0x3ecc('0x47')][_0x3ecc('0x4e')](_0x3ecc('0x4f'))){_0x17868a[_0x3ecc('0x32')]=qs[_0x3ecc('0x32')](_0x375fcf['query']['limit']);_0x17868a[_0x3ecc('0x30')]=qs[_0x3ecc('0x30')](_0x375fcf[_0x3ecc('0x47')][_0x3ecc('0x30')]);}return _0x4043c1[_0x3ecc('0xc1')](_0x17868a);}})[_0x3ecc('0x21')](function(_0x6ea58b){if(_0x6ea58b){return _0x6ea58b?{'count':_0x26014e,'rows':_0x6ea58b}:null;}})['then'](respondWithResult(_0x5d228d,null))[_0x3ecc('0x2c')](handleError(_0x5d228d,null));};exports[_0x3ecc('0xc2')]=function(_0x972ef,_0x325905,_0x5aae86){var _0x1ed431={'raw':![],'where':{}};var _0x1d9e65={};var _0x335c4f={'count':0x0,'rows':[]};return db[_0x3ecc('0x58')][_0x3ecc('0x6a')]({'where':{'id':_0x972ef[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x325905,null))[_0x3ecc('0x21')](function(_0x5be433){if(_0x5be433){_0x1d9e65[_0x3ecc('0x46')]=_[_0x3ecc('0x48')](db[_0x3ecc('0xc3')][_0x3ecc('0x44')]);_0x1d9e65[_0x3ecc('0x47')]=_[_0x3ecc('0x48')](_0x972ef['query']);_0x1d9e65[_0x3ecc('0x49')]=_[_0x3ecc('0x4a')](_0x1d9e65['model'],_0x1d9e65[_0x3ecc('0x47')]);_0x1ed431[_0x3ecc('0x4b')]=_[_0x3ecc('0x4a')](_0x1d9e65[_0x3ecc('0x46')],qs[_0x3ecc('0x4c')](_0x972ef[_0x3ecc('0x47')][_0x3ecc('0x4c')]));_0x1ed431[_0x3ecc('0x4b')]=_0x1ed431['attributes'][_0x3ecc('0x4d')]?_0x1ed431[_0x3ecc('0x4b')]:_0x1d9e65[_0x3ecc('0x46')];if(!_0x972ef['query'][_0x3ecc('0x4e')]('nolimit')){_0x1ed431['limit']=qs['limit'](_0x972ef['query'][_0x3ecc('0x32')]);_0x1ed431[_0x3ecc('0x30')]=qs[_0x3ecc('0x30')](_0x972ef[_0x3ecc('0x47')][_0x3ecc('0x30')]);}_0x1ed431[_0x3ecc('0x50')]=qs[_0x3ecc('0x51')](_0x972ef['query'][_0x3ecc('0x51')]);_0x1ed431[_0x3ecc('0x53')]=qs[_0x3ecc('0x49')](_[_0x3ecc('0x6b')](_0x972ef[_0x3ecc('0x47')],_0x1d9e65['filters']));_0x1ed431[_0x3ecc('0x53')][_0x3ecc('0x68')]=_0x5be433['id'];if(_0x972ef[_0x3ecc('0x47')][_0x3ecc('0x52')]){_0x1ed431[_0x3ecc('0x53')]=_[_0x3ecc('0x54')](_0x1ed431['where'],{'$or':_['map'](_0x1ed431[_0x3ecc('0x4b')],function(_0x3728e5){var _0x17eaa7={};_0x17eaa7[_0x3728e5]={'$like':'%'+_0x972ef['query'][_0x3ecc('0x52')]+'%'};return _0x17eaa7;})});}_0x1ed431=_[_0x3ecc('0x54')]({},_0x1ed431,_0x972ef[_0x3ecc('0x57')]);return db['SmsInteraction']['count']({'where':_0x1ed431[_0x3ecc('0x53')]})[_0x3ecc('0x21')](function(_0x3b9993){_0x335c4f[_0x3ecc('0x33')]=_0x3b9993;if(_0x972ef[_0x3ecc('0x47')][_0x3ecc('0x59')]){_0x1ed431[_0x3ecc('0x5c')]=[{'model':db[_0x3ecc('0x7a')],'as':_0x3ecc('0xc4'),'required':![]},{'model':db[_0x3ecc('0xb0')],'as':'Owner','attributes':[_0x3ecc('0x3e'),'fullname','internal'],'required':![]},{'model':db[_0x3ecc('0xc5')],'as':_0x3ecc('0xc6'),'attributes':['id',_0x3ecc('0x3e'),'color'],'where':_0x972ef[_0x3ecc('0x47')]['tag']?{'id':_0x972ef[_0x3ecc('0x47')]['tag']}:undefined,'required':_0x972ef[_0x3ecc('0x47')][_0x3ecc('0xc7')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x1ed431);})[_0x3ecc('0x21')](function(_0x46804b){_0x335c4f[_0x3ecc('0x6c')]=_0x46804b;return _0x335c4f;});}})[_0x3ecc('0x21')](respondWithFilteredResult(_0x325905,_0x1ed431))[_0x3ecc('0x2c')](handleError(_0x325905,null));};exports[_0x3ecc('0x3f')]=function(_0x275002,_0x4d9737,_0x442693){var _0x42a2c1,_0x31d920,_0x52c1c5;if(_['isNil'](_0x275002['body'][_0x3ecc('0x5f')])||_0x275002[_0x3ecc('0x5f')][_0x3ecc('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0x3ecc('0x98'));}if(_[_0x3ecc('0x99')](_0x275002['body']['to'])){throw new db[(_0x3ecc('0x7b'))][(_0x3ecc('0x7c'))](_0x3ecc('0xc8'));}_0x42a2c1=_0x275002[_0x3ecc('0x5f')]['to'];return db[_0x3ecc('0x58')][_0x3ecc('0x5d')]({'where':{'id':_0x275002[_0x3ecc('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x3ecc('0xc9'),'include':[{'model':db[_0x3ecc('0x7a')],'as':_0x3ecc('0xa0'),'where':{'mobile':_0x42a2c1},'limit':0x1,'order':[[_0x3ecc('0x7f'),_0x3ecc('0xca')]]}]}]})[_0x3ecc('0x21')](handleEntityNotFound(_0x4d9737,null))[_0x3ecc('0x21')](function(_0x38bb6d){if(_0x38bb6d&&_0x38bb6d[_0x3ecc('0xc9')]){_0x31d920=_0x38bb6d['get']({'plain':!![]});if(_0x31d920[_0x3ecc('0xc9')]&&_0x31d920[_0x3ecc('0xc9')][_0x3ecc('0xa0')][_0x3ecc('0x4d')]){return _0x31d920[_0x3ecc('0xc9')][_0x3ecc('0xa0')][0x0];}return db['CmContact'][_0x3ecc('0x5e')](_[_0x3ecc('0xa3')](_0x275002[_0x3ecc('0x5f')],{'firstName':_0x42a2c1,'mobile':_0x42a2c1,'phone':_0x42a2c1,'ListId':_0x31d920[_0x3ecc('0x9f')]}));}})[_0x3ecc('0x21')](handleEntityNotFound(_0x4d9737,null))['then'](function(_0x270e63){if(_0x270e63){_0x52c1c5=_0x270e63;return db[_0x3ecc('0xc3')]['find']({'where':{'ContactId':_0x52c1c5['id'],'closed':![],'SmsAccountId':_0x31d920['id']}})[_0x3ecc('0x21')](function(_0x44869a){if(_0x44869a){return[_0x44869a,![]];}return db[_0x3ecc('0xc3')][_0x3ecc('0x5e')]({'UserId':_0x275002['user']['id'],'ContactId':_0x52c1c5['id'],'SmsAccountId':_0x31d920['id'],'phone':_0x42a2c1,'firstMsgDirection':_0x3ecc('0xcb'),'Messages':[_[_0x3ecc('0x54')](_0x275002[_0x3ecc('0x5f')],{'read':![],'body':_0x275002[_0x3ecc('0x5f')]['body'],'phone':_0x42a2c1,'SmsAccountId':_0x31d920['id'],'UserId':_0x275002[_0x3ecc('0x60')]['id'],'ContactId':_0x52c1c5['id']})]},{'include':[{'model':db[_0x3ecc('0xad')],'as':_0x3ecc('0xcc')}]})['then'](function(_0x46ae40){return[_0x46ae40,!![]];});});}})[_0x3ecc('0xa5')](function(_0x11ff27,_0x52f0ea){if(_0x52f0ea){return _0x11ff27;}return db[_0x3ecc('0xad')][_0x3ecc('0x5e')](_['merge'](_0x275002[_0x3ecc('0x5f')],{'read':![],'body':_0x275002[_0x3ecc('0x5f')]['body'],'phone':_0x42a2c1,'SmsAccountId':_0x31d920['id'],'SmsInteractionId':_0x11ff27['id'],'UserId':_0x275002[_0x3ecc('0x60')]['id'],'ContactId':_0x52c1c5['id']}))['then'](function(_0x144ab1){_0x11ff27[_0x3ecc('0xcd')][_0x3ecc('0xcc')]=[];_0x11ff27[_0x3ecc('0xcd')][_0x3ecc('0xcc')][_0x3ecc('0xa9')](_0x144ab1[_0x3ecc('0xcd')]);return _0x11ff27;});})[_0x3ecc('0x21')](respondWithResult(_0x4d9737,null))[_0x3ecc('0x2c')](handleError(_0x4d9737,null));};exports[_0x3ecc('0x2d')]=function(_0x544e51,_0x2129dd,_0xed8dc4){if(_0x544e51[_0x3ecc('0x5f')]['id']){delete _0x544e51[_0x3ecc('0x5f')]['id'];}var _0x168c3d,_0x43679b,_0x3817e0;return db[_0x3ecc('0x58')][_0x3ecc('0x5d')]({'where':{'id':_0x544e51[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x2129dd,null))[_0x3ecc('0x21')](function(_0x2d69f0){if(_0x2d69f0){_0x3817e0=_0x2d69f0;logger[_0x3ecc('0x24')](_0x3ecc('0x25'),_0x3ecc('0x2d'),_0x3ecc('0xce'),_0x2d69f0[_0x3ecc('0x55')],util[_0x3ecc('0xcf')](_0x544e51[_0x3ecc('0x5f')],{'showHidden':![],'depth':null}));switch(_0x2d69f0['type']){case _0x3ecc('0x86'):if(_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0xd0')]&&_0x544e51[_0x3ecc('0x5f')]['status']){_0x43679b=_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0x2d')];return db['SmsMessage'][_0x3ecc('0x5d')]({'where':{'messageId':_0x544e51['body'][_0x3ecc('0xd0')]}});}break;case'connectel':if(_0x544e51['body'][_0x3ecc('0xd1')]&&_0x544e51['body']['statusInt']){_0x43679b=_0x544e51['body'][_0x3ecc('0xd2')];return db[_0x3ecc('0xad')][_0x3ecc('0x5d')]({'where':{'messageId':_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0xd1')]}});}break;case _0x3ecc('0x8a'):if(_0x544e51[_0x3ecc('0x5f')]['message_id']&&_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0xd3')]){_0x43679b=_0x544e51['body'][_0x3ecc('0xd3')];return db[_0x3ecc('0xad')]['find']({'where':{'messageId':_0x544e51['body']['message_id']}});}break;case _0x3ecc('0x8f'):var _0x404148=_0x544e51['body'][_0x3ecc('0x90')][0x0];if(_0x404148[_0x3ecc('0x85')]&&_0x404148[_0x3ecc('0x2d')][_0x3ecc('0xd4')]==='DELIVERED'){_0x43679b=_0x404148[_0x3ecc('0x2d')]['groupName'];return db[_0x3ecc('0xad')]['find']({'where':{'messageId':_0x404148[_0x3ecc('0x85')]}});}break;case _0x3ecc('0x93'):if(_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0x85')]&&_0x544e51['body'][_0x3ecc('0x2d')]){_0x43679b=_0x544e51[_0x3ecc('0x5f')]['status'];return db[_0x3ecc('0xad')][_0x3ecc('0x5d')]({'where':{'messageId':_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0x85')]}});}break;case _0x3ecc('0x96'):if(_0x544e51[_0x3ecc('0x5f')][0x0][_0x3ecc('0x29')]['id']){_0x43679b=_0x544e51['body'][0x0][_0x3ecc('0x55')];return db[_0x3ecc('0xad')][_0x3ecc('0x5d')]({'where':{'messageId':_0x544e51[_0x3ecc('0x5f')][0x0][_0x3ecc('0x29')]['id']}});}break;case _0x3ecc('0xd5'):if(_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0xd6')]&&_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0x2d')]){_0x43679b=_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0x2d')];return db['SmsMessage'][_0x3ecc('0x5d')]({'where':{'messageId':_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0xd6')]}});}break;}}})[_0x3ecc('0x21')](handleEntityNotFound(_0x2129dd,null))[_0x3ecc('0x21')](function(_0xd7a7b0){if(_0xd7a7b0){_0x168c3d=_0xd7a7b0;switch(_0x3817e0['type']){case'skebby':if(_0x43679b==='DELIVERED'){return _0x168c3d[_0x3ecc('0x38')]({'read':!![]});}else{logger[_0x3ecc('0x28')](_0x3ecc('0x25'),_0x3ecc('0x2d'),_0x3ecc('0x86'),util[_0x3ecc('0xcf')](_0x544e51['body'],{'showHidden':![],'depth':null}));}break;case _0x3ecc('0x88'):if(_0x43679b==='1'){return _0x168c3d[_0x3ecc('0x38')]({'read':!![]});}else{logger[_0x3ecc('0x28')](_0x3ecc('0x25'),'status',_0x3ecc('0x86'),util[_0x3ecc('0xcf')](_0x544e51[_0x3ecc('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x3ecc('0x8a'):if(!_0x544e51[_0x3ecc('0x5f')]['error_code']&&_0x43679b>=0xc8&&_0x43679b<=0xce){return _0x168c3d[_0x3ecc('0x38')]({'read':!![]});}else{logger[_0x3ecc('0x28')](_0x3ecc('0x25'),'status',_0x3ecc('0x8a'),util[_0x3ecc('0xcf')](_0x544e51['body'],{'showHidden':![],'depth':null}));}break;case _0x3ecc('0x8f'):var _0x118b73=_0x544e51[_0x3ecc('0x5f')][_0x3ecc('0x90')][0x0];if(_0x118b73['status']['groupName']===_0x3ecc('0xd7')){return _0x168c3d[_0x3ecc('0x38')]({'read':!![]});}else{logger[_0x3ecc('0x28')](_0x3ecc('0x25'),_0x3ecc('0x2d'),_0x3ecc('0x8f'),util[_0x3ecc('0xcf')](_0x544e51[_0x3ecc('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x3ecc('0x93'):if(_0x43679b==_0x3ecc('0xd8')||_0x43679b==_0x3ecc('0xd9')){return _0x168c3d[_0x3ecc('0x38')]({'read':!![]});}else{logger[_0x3ecc('0x28')](_0x3ecc('0x25'),_0x3ecc('0x2d'),_0x3ecc('0x93'),util[_0x3ecc('0xcf')](_0x544e51[_0x3ecc('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x3ecc('0x96'):if(_0x43679b==_0x3ecc('0xda')){return _0x168c3d[_0x3ecc('0x38')]({'read':!![]});}else{logger['error'](_0x3ecc('0x25'),'status',_0x3ecc('0x96'),util['inspect'](_0x544e51['body'],{'showHidden':![],'depth':null}));}break;case _0x3ecc('0xd5'):if(_0x43679b===_0x3ecc('0xdb')||_0x43679b===_0x3ecc('0xdc')){return _0x168c3d[_0x3ecc('0x38')]({'read':!![]});}else{logger[_0x3ecc('0x28')](_0x3ecc('0x25'),_0x3ecc('0x2d'),_0x3ecc('0xd5'),util[_0x3ecc('0xcf')](_0x544e51[_0x3ecc('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x168c3d;}})[_0x3ecc('0x21')](respondWithResult(_0x2129dd,null))[_0x3ecc('0x2c')](handleError(_0x2129dd,null));};exports[_0x3ecc('0xdd')]=function(_0x20553e,_0x2ac1e1,_0x42f7d1){var _0x206fd1,_0x12fb09,_0x1371fa;return db['SmsAccount'][_0x3ecc('0x5d')]({'where':{'id':_0x20553e[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x2ac1e1,null))[_0x3ecc('0x21')](function(_0x35350d){if(_0x35350d){_0x1371fa=_0x35350d;logger[_0x3ecc('0x24')](_0x3ecc('0x25'),_0x3ecc('0x2d'),'received\x20delivery\x20report\x20from',_0x35350d[_0x3ecc('0x55')],util[_0x3ecc('0xcf')](_0x20553e[_0x3ecc('0x47')],{'showHidden':![],'depth':null}));switch(_0x35350d[_0x3ecc('0x55')]){case _0x3ecc('0x91'):if(_0x20553e[_0x3ecc('0x47')][_0x3ecc('0xde')]&&_0x20553e[_0x3ecc('0x47')][_0x3ecc('0xdf')]){_0x12fb09=_0x20553e[_0x3ecc('0x47')][_0x3ecc('0xdf')];return db[_0x3ecc('0xad')]['find']({'where':{'messageId':_0x20553e[_0x3ecc('0x47')][_0x3ecc('0xde')]}});}break;}}})[_0x3ecc('0x21')](handleEntityNotFound(_0x2ac1e1,null))[_0x3ecc('0x21')](function(_0x79442f){if(_0x79442f){_0x206fd1=_0x79442f;switch(_0x1371fa['type']){case'csc':if(_0x12fb09==='2'||_0x12fb09==='6'){return _0x206fd1['update']({'read':!![]});}else{logger[_0x3ecc('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x3ecc('0x91'),util[_0x3ecc('0xcf')](_0x20553e[_0x3ecc('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x206fd1;}})[_0x3ecc('0x21')](respondWithResult(_0x2ac1e1,null))[_0x3ecc('0x2c')](handleError(_0x2ac1e1,null));};exports[_0x3ecc('0xe0')]=function(_0x2df3b7,_0xbe55ee,_0x34d138){return db[_0x3ecc('0x58')]['find']({'where':{'id':_0x2df3b7[_0x3ecc('0x5b')]['id']}})['then'](handleEntityNotFound(_0xbe55ee,null))[_0x3ecc('0x21')](function(_0x25313e){if(_0x25313e){return _0x25313e[_0x3ecc('0xe0')](_0x2df3b7[_0x3ecc('0x5f')]['ids'],_[_0x3ecc('0xa2')](_0x2df3b7[_0x3ecc('0x5f')],[_0x3ecc('0x6e'),'id'])||{})[_0x3ecc('0xa5')](function(_0x56a014){for(var _0xb67b08=0x0;_0xb67b08<_0x2df3b7[_0x3ecc('0x5f')][_0x3ecc('0x6e')]['length'];_0xb67b08+=0x1){socket[_0x3ecc('0xe1')](_0x3ecc('0xe2'),{'UserId':Number(_0x2df3b7[_0x3ecc('0x5f')][_0x3ecc('0x6e')][_0xb67b08]),'SmsAccountId':Number(_0x2df3b7[_0x3ecc('0x5b')]['id'])});}return _0x56a014;});}})[_0x3ecc('0x21')](respondWithResult(_0xbe55ee,null))[_0x3ecc('0x2c')](handleError(_0xbe55ee,null));};exports['removeAgents']=function(_0x1a8a17,_0x54c70d,_0x38b063){return db[_0x3ecc('0x58')][_0x3ecc('0x5d')]({'where':{'id':_0x1a8a17[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x54c70d,null))[_0x3ecc('0x21')](function(_0x63e6c2){if(_0x63e6c2){return _0x63e6c2['removeAgents'](_0x1a8a17[_0x3ecc('0x47')][_0x3ecc('0x6e')])[_0x3ecc('0x21')](function(){if(_[_0x3ecc('0xe3')](_0x1a8a17['query']['ids'])){for(var _0x224b6a=0x0;_0x224b6a<_0x1a8a17[_0x3ecc('0x47')][_0x3ecc('0x6e')][_0x3ecc('0x4d')];_0x224b6a+=0x1){socket[_0x3ecc('0xe1')](_0x3ecc('0xe4'),{'UserId':Number(_0x1a8a17['query'][_0x3ecc('0x6e')][_0x224b6a]),'SmsAccountId':Number(_0x1a8a17['params']['id'])});}}else{socket[_0x3ecc('0xe1')](_0x3ecc('0xe4'),{'UserId':Number(_0x1a8a17['query'][_0x3ecc('0x6e')]),'SmsAccountId':Number(_0x1a8a17[_0x3ecc('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x54c70d,null))[_0x3ecc('0x2c')](handleError(_0x54c70d,null));};exports[_0x3ecc('0xe5')]=function(_0x32c65e,_0x355448,_0x46fd99){var _0x3b8102={};var _0x14ae91={};var _0x4552bf;var _0x473454;return db[_0x3ecc('0x58')][_0x3ecc('0x6a')]({'where':{'id':_0x32c65e[_0x3ecc('0x5b')]['id']}})[_0x3ecc('0x21')](handleEntityNotFound(_0x355448,null))[_0x3ecc('0x21')](function(_0x535b11){if(_0x535b11){_0x4552bf=_0x535b11;_0x14ae91['model']=_['keys'](db[_0x3ecc('0xb0')][_0x3ecc('0x44')]);_0x14ae91[_0x3ecc('0x47')]=_[_0x3ecc('0x48')](_0x32c65e[_0x3ecc('0x47')]);_0x14ae91[_0x3ecc('0x49')]=_['intersection'](_0x14ae91[_0x3ecc('0x46')],_0x14ae91['query']);_0x3b8102[_0x3ecc('0x4b')]=_[_0x3ecc('0x4a')](_0x14ae91[_0x3ecc('0x46')],qs[_0x3ecc('0x4c')](_0x32c65e[_0x3ecc('0x47')][_0x3ecc('0x4c')]));_0x3b8102[_0x3ecc('0x4b')]=_0x3b8102[_0x3ecc('0x4b')][_0x3ecc('0x4d')]?_0x3b8102[_0x3ecc('0x4b')]:_0x14ae91[_0x3ecc('0x46')];_0x3b8102[_0x3ecc('0x50')]=qs['sort'](_0x32c65e[_0x3ecc('0x47')][_0x3ecc('0x51')]);_0x3b8102['where']=qs[_0x3ecc('0x49')](_[_0x3ecc('0x6b')](_0x32c65e[_0x3ecc('0x47')],_0x14ae91[_0x3ecc('0x49')]));if(_0x32c65e[_0x3ecc('0x47')]['filter']){_0x3b8102[_0x3ecc('0x53')]=_[_0x3ecc('0x54')](_0x3b8102[_0x3ecc('0x53')],{'$or':_['map'](_0x3b8102['attributes'],function(_0x3fbe3c){var _0x2cb2aa={};_0x2cb2aa[_0x3fbe3c]={'$like':'%'+_0x32c65e[_0x3ecc('0x47')][_0x3ecc('0x52')]+'%'};return _0x2cb2aa;})});}_0x3b8102=_[_0x3ecc('0x54')]({},_0x3b8102,_0x32c65e[_0x3ecc('0x57')]);return _0x4552bf['getAgents'](_0x3b8102);}})[_0x3ecc('0x21')](function(_0x144a7a){if(_0x144a7a){_0x473454=_0x144a7a[_0x3ecc('0x4d')];if(!_0x32c65e['query'][_0x3ecc('0x4e')](_0x3ecc('0x4f'))){_0x3b8102[_0x3ecc('0x32')]=qs[_0x3ecc('0x32')](_0x32c65e[_0x3ecc('0x47')][_0x3ecc('0x32')]);_0x3b8102[_0x3ecc('0x30')]=qs[_0x3ecc('0x30')](_0x32c65e['query'][_0x3ecc('0x30')]);}return _0x4552bf[_0x3ecc('0xe5')](_0x3b8102);}})['then'](function(_0x4d1133){if(_0x4d1133){return _0x4d1133?{'count':_0x473454,'rows':_0x4d1133}:null;}})[_0x3ecc('0x21')](respondWithResult(_0x355448,null))[_0x3ecc('0x2c')](handleError(_0x355448,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 727fd7e..25391b5 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 _0x7e86=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7e86,0xfa));var _0x67e8=function(_0x5047e6,_0x2b5e8b){_0x5047e6=_0x5047e6-0x0;var _0x2324bb=_0x7e86[_0x5047e6];return _0x2324bb;};'use strict';var EventEmitter=require(_0x67e8('0x0'));var SmsAccount=require(_0x67e8('0x1'))['db'][_0x67e8('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x67e8('0x3')](0x0);var events={'afterCreate':_0x67e8('0x4'),'afterUpdate':_0x67e8('0x5'),'afterDestroy':_0x67e8('0x6')};function emitEvent(_0x26adbf){return function(_0x516dad,_0x2e2b46,_0x16e989){SmsAccountEvents[_0x67e8('0x7')](_0x26adbf+':'+_0x516dad['id'],_0x516dad);SmsAccountEvents[_0x67e8('0x7')](_0x26adbf,_0x516dad);_0x16e989(null);};}for(var e in events){if(events[_0x67e8('0x8')](e)){var event=events[e];SmsAccount[_0x67e8('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x9118=['hook','events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x9118,0x1b1));var _0x8911=function(_0x234b74,_0x22f84d){_0x234b74=_0x234b74-0x0;var _0x174f67=_0x9118[_0x234b74];return _0x174f67;};'use strict';var EventEmitter=require(_0x8911('0x0'));var SmsAccount=require(_0x8911('0x1'))['db'][_0x8911('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x8911('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8911('0x4'),'afterDestroy':_0x8911('0x5')};function emitEvent(_0xea5e0a){return function(_0x3c0bd7,_0x721431,_0x718d8f){SmsAccountEvents[_0x8911('0x6')](_0xea5e0a+':'+_0x3c0bd7['id'],_0x3c0bd7);SmsAccountEvents[_0x8911('0x6')](_0xea5e0a,_0x3c0bd7);_0x718d8f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x8911('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 20e92cb..d4b9fcf 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 _0x36fa=['SmsAccount','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x211988,_0x4c397e){var _0x37c2af=function(_0x437945){while(--_0x437945){_0x211988['push'](_0x211988['shift']());}};_0x37c2af(++_0x4c397e);}(_0x36fa,0x9d));var _0xa36f=function(_0x1b4f5f,_0x13f5bb){_0x1b4f5f=_0x1b4f5f-0x0;var _0xf57caa=_0x36fa[_0x1b4f5f];return _0xf57caa;};'use strict';var _=require(_0xa36f('0x0'));var util=require(_0xa36f('0x1'));var logger=require(_0xa36f('0x2'))(_0xa36f('0x3'));var moment=require('moment');var BPromise=require(_0xa36f('0x4'));var rp=require(_0xa36f('0x5'));var fs=require('fs');var path=require(_0xa36f('0x6'));var rimraf=require('rimraf');var config=require(_0xa36f('0x7'));var attributes=require(_0xa36f('0x8'));module[_0xa36f('0x9')]=function(_0x5b9b9a,_0x2db6d5){return _0x5b9b9a[_0xa36f('0xa')](_0xa36f('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08a5=['../../config/logger','api','moment','request-promise','path','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash'];(function(_0x2b182e,_0x1ce70c){var _0x57f308=function(_0x218e35){while(--_0x218e35){_0x2b182e['push'](_0x2b182e['shift']());}};_0x57f308(++_0x1ce70c);}(_0x08a5,0x196));var _0x508a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x508a('0x0'));var util=require('util');var logger=require(_0x508a('0x1'))(_0x508a('0x2'));var moment=require(_0x508a('0x3'));var BPromise=require('bluebird');var rp=require(_0x508a('0x4'));var fs=require('fs');var path=require(_0x508a('0x5'));var rimraf=require('rimraf');var config=require(_0x508a('0x6'));var attributes=require(_0x508a('0x7'));module['exports']=function(_0x4272de,_0x3400cd){return _0x4272de[_0x508a('0x8')](_0x508a('0x9'),attributes,{'tableName':_0x508a('0xa'),'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 5a16cef..7bbfa59 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 _0x3824=['localhost','register','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','find','options','raw','map','include','model','attributes','ShowSmsAccount','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x494253,_0x3a9248){var _0x175227=function(_0x5d9ec6){while(--_0x5d9ec6){_0x494253['push'](_0x494253['shift']());}};_0x175227(++_0x3a9248);}(_0x3824,0x1ea));var _0x4382=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0x3824[_0x594ece];return _0x471bc4;};'use strict';var _=require(_0x4382('0x0'));var util=require(_0x4382('0x1'));var moment=require(_0x4382('0x2'));var BPromise=require(_0x4382('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4382('0x4'));var db=require(_0x4382('0x5'))['db'];var utils=require(_0x4382('0x6'));var logger=require(_0x4382('0x7'))(_0x4382('0x8'));var config=require('../../config/environment');var jayson=require(_0x4382('0x9'));var client=jayson[_0x4382('0xa')][_0x4382('0xb')]({'port':0x232a});config[_0x4382('0xc')]=_[_0x4382('0xd')](config[_0x4382('0xc')],{'host':_0x4382('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4382('0xc')]));require('./smsAccount.socket')[_0x4382('0xf')](socket);function respondWithRpcPromise(_0x8ab40c,_0xc4ee96,_0x458acf){return new BPromise(function(_0x2da9b0,_0x395085){return client['request'](_0x8ab40c,_0x458acf)[_0x4382('0x10')](function(_0x39f673){logger[_0x4382('0x11')]('SmsAccount,\x20%s,\x20%s',_0xc4ee96,_0x4382('0x12'));logger[_0x4382('0x13')](_0x4382('0x14'),_0xc4ee96,_0x4382('0x12'),JSON['stringify'](_0x39f673));if(_0x39f673[_0x4382('0x15')]){if(_0x39f673['error'][_0x4382('0x16')]===0x1f4){logger[_0x4382('0x15')](_0x4382('0x17'),_0xc4ee96,_0x39f673[_0x4382('0x15')][_0x4382('0x18')]);return _0x395085(_0x39f673[_0x4382('0x15')][_0x4382('0x18')]);}logger[_0x4382('0x15')](_0x4382('0x17'),_0xc4ee96,_0x39f673[_0x4382('0x15')]['message']);return _0x2da9b0(_0x39f673[_0x4382('0x15')][_0x4382('0x18')]);}else{logger[_0x4382('0x11')](_0x4382('0x17'),_0xc4ee96,_0x4382('0x12'));_0x2da9b0(_0x39f673[_0x4382('0x19')][_0x4382('0x18')]);}})[_0x4382('0x1a')](function(_0x1d3549){logger[_0x4382('0x15')](_0x4382('0x17'),_0xc4ee96,_0x1d3549);_0x395085(_0x1d3549);});});}exports['ShowSmsAccount']=function(_0x4540fa){var _0x3fe05b=this;return new Promise(function(_0x1bb33a,_0x52e1a1){return db['SmsAccount'][_0x4382('0x1b')]({'raw':_0x4540fa[_0x4382('0x1c')]?_0x4540fa[_0x4382('0x1c')][_0x4382('0x1d')]===undefined?!![]:![]:!![],'where':_0x4540fa[_0x4382('0x1c')]?_0x4540fa[_0x4382('0x1c')]['where']||null:null,'attributes':_0x4540fa[_0x4382('0x1c')]?_0x4540fa[_0x4382('0x1c')]['attributes']||null:null,'include':_0x4540fa['options']?_0x4540fa[_0x4382('0x1c')]['include']?_[_0x4382('0x1e')](_0x4540fa['options'][_0x4382('0x1f')],function(_0x11e125){return{'model':db[_0x11e125[_0x4382('0x20')]],'as':_0x11e125['as'],'attributes':_0x11e125[_0x4382('0x21')],'include':_0x11e125[_0x4382('0x1f')]?_[_0x4382('0x1e')](_0x11e125['include'],function(_0x4034fa){return{'model':db[_0x4034fa[_0x4382('0x20')]],'as':_0x4034fa['as'],'attributes':_0x4034fa[_0x4382('0x21')],'include':_0x4034fa[_0x4382('0x1f')]?_['map'](_0x4034fa[_0x4382('0x1f')],function(_0x3b5b1d){return{'model':db[_0x3b5b1d[_0x4382('0x20')]],'as':_0x3b5b1d['as'],'attributes':_0x3b5b1d[_0x4382('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c3730){logger[_0x4382('0x11')](_0x4382('0x22'),_0x4540fa);logger[_0x4382('0x13')]('ShowSmsAccount',_0x4540fa,JSON[_0x4382('0x23')](_0x4c3730));_0x1bb33a(_0x4c3730);})[_0x4382('0x1a')](function(_0x19f172){logger[_0x4382('0x15')](_0x4382('0x22'),_0x19f172['message'],_0x4540fa);_0x52e1a1(_0x3fe05b[_0x4382('0x15')](0x1f4,_0x19f172[_0x4382('0x18')]));});});}; \ No newline at end of file +var _0x2a47=['SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSmsAccount','find','options','raw','attributes','include','map','model','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46b951,_0x39770d){var _0x197f82=function(_0x1a7ade){while(--_0x1a7ade){_0x46b951['push'](_0x46b951['shift']());}};_0x197f82(++_0x39770d);}(_0x2a47,0xbd));var _0x72a4=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x2a47[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x72a4('0x0'));var util=require(_0x72a4('0x1'));var moment=require(_0x72a4('0x2'));var BPromise=require(_0x72a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x72a4('0x4'));var logger=require(_0x72a4('0x5'))(_0x72a4('0x6'));var config=require(_0x72a4('0x7'));var jayson=require(_0x72a4('0x8'));var client=jayson[_0x72a4('0x9')][_0x72a4('0xa')]({'port':0x232a});config[_0x72a4('0xb')]=_['defaults'](config['redis'],{'host':_0x72a4('0xc'),'port':0x18eb});var socket=require(_0x72a4('0xd'))(new Redis(config[_0x72a4('0xb')]));require(_0x72a4('0xe'))['register'](socket);function respondWithRpcPromise(_0x2278df,_0x2094eb,_0x24b0f5){return new BPromise(function(_0x34ae32,_0x495c74){return client[_0x72a4('0xf')](_0x2278df,_0x24b0f5)[_0x72a4('0x10')](function(_0x39dfb8){logger[_0x72a4('0x11')](_0x72a4('0x12'),_0x2094eb,_0x72a4('0x13'));logger[_0x72a4('0x14')](_0x72a4('0x15'),_0x2094eb,'request\x20sent',JSON[_0x72a4('0x16')](_0x39dfb8));if(_0x39dfb8[_0x72a4('0x17')]){if(_0x39dfb8[_0x72a4('0x17')][_0x72a4('0x18')]===0x1f4){logger['error'](_0x72a4('0x12'),_0x2094eb,_0x39dfb8[_0x72a4('0x17')]['message']);return _0x495c74(_0x39dfb8[_0x72a4('0x17')][_0x72a4('0x19')]);}logger[_0x72a4('0x17')](_0x72a4('0x12'),_0x2094eb,_0x39dfb8['error'][_0x72a4('0x19')]);return _0x34ae32(_0x39dfb8['error'][_0x72a4('0x19')]);}else{logger['info'](_0x72a4('0x12'),_0x2094eb,_0x72a4('0x13'));_0x34ae32(_0x39dfb8['result'][_0x72a4('0x19')]);}})['catch'](function(_0x22aebc){logger[_0x72a4('0x17')](_0x72a4('0x12'),_0x2094eb,_0x22aebc);_0x495c74(_0x22aebc);});});}exports[_0x72a4('0x1a')]=function(_0x2b4e3b){var _0x319658=this;return new Promise(function(_0x35babf,_0x5340b1){return db['SmsAccount'][_0x72a4('0x1b')]({'raw':_0x2b4e3b[_0x72a4('0x1c')]?_0x2b4e3b[_0x72a4('0x1c')][_0x72a4('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b4e3b['options']?_0x2b4e3b[_0x72a4('0x1c')]['where']||null:null,'attributes':_0x2b4e3b[_0x72a4('0x1c')]?_0x2b4e3b['options'][_0x72a4('0x1e')]||null:null,'include':_0x2b4e3b[_0x72a4('0x1c')]?_0x2b4e3b[_0x72a4('0x1c')][_0x72a4('0x1f')]?_[_0x72a4('0x20')](_0x2b4e3b[_0x72a4('0x1c')][_0x72a4('0x1f')],function(_0x2bee82){return{'model':db[_0x2bee82['model']],'as':_0x2bee82['as'],'attributes':_0x2bee82[_0x72a4('0x1e')],'include':_0x2bee82[_0x72a4('0x1f')]?_['map'](_0x2bee82[_0x72a4('0x1f')],function(_0x102557){return{'model':db[_0x102557['model']],'as':_0x102557['as'],'attributes':_0x102557[_0x72a4('0x1e')],'include':_0x102557[_0x72a4('0x1f')]?_[_0x72a4('0x20')](_0x102557['include'],function(_0x35d4e2){return{'model':db[_0x35d4e2[_0x72a4('0x21')]],'as':_0x35d4e2['as'],'attributes':_0x35d4e2[_0x72a4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x72a4('0x10')](function(_0x34fdc0){logger['info']('ShowSmsAccount',_0x2b4e3b);logger[_0x72a4('0x14')](_0x72a4('0x1a'),_0x2b4e3b,JSON[_0x72a4('0x16')](_0x34fdc0));_0x35babf(_0x34fdc0);})[_0x72a4('0x22')](function(_0x1bc153){logger[_0x72a4('0x17')]('ShowSmsAccount',_0x1bc153[_0x72a4('0x19')],_0x2b4e3b);_0x5340b1(_0x319658[_0x72a4('0x17')](0x1f4,_0x1bc153['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d9bd727..c0bfa08 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(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 a80cab1..e204dd9 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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x322a36,_0x50341f){var _0x391d32=function(_0x46343b){while(--_0x46343b){_0x322a36['push'](_0x322a36['shift']());}};_0x391d32(++_0x50341f);}(_0x008c,0x188));var _0xc008=function(_0x596565,_0x1258ad){_0x596565=_0x596565-0x0;var _0x474b1b=_0x008c[_0x596565];return _0x474b1b;};'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('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x45aa21,_0x32870b){var _0x40a5e1=function(_0x24787d){while(--_0x24787d){_0x45aa21['push'](_0x45aa21['shift']());}};_0x40a5e1(++_0x32870b);}(_0x3e74,0x175));var _0x43e7=function(_0x3eaa6b,_0x2f9b38){_0x3eaa6b=_0x3eaa6b-0x0;var _0x276ea3=_0x3e74[_0x3eaa6b];return _0x276ea3;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 80a3926..d56fba2 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 _0xa0fd=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x130d46,_0x3a3337){var _0x4d5d07=function(_0x2906c0){while(--_0x2906c0){_0x130d46['push'](_0x130d46['shift']());}};_0x4d5d07(++_0x3a3337);}(_0xa0fd,0x18a));var _0xda0f=function(_0x56b68e,_0x3ae03f){_0x56b68e=_0x56b68e-0x0;var _0x123fa8=_0xa0fd[_0x56b68e];return _0x123fa8;};'use strict';var Sequelize=require(_0xda0f('0x0'));module[_0xda0f('0x1')]={'priority':{'type':Sequelize[_0xda0f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xda0f('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xda0f('0x4')]()},'description':{'type':Sequelize[_0xda0f('0x3')]},'interval':{'type':Sequelize[_0xda0f('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x612c=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x360317,_0x36cd09){var _0x112bd9=function(_0x3c0c46){while(--_0x3c0c46){_0x360317['push'](_0x360317['shift']());}};_0x112bd9(++_0x36cd09);}(_0x612c,0x10c));var _0xc612=function(_0x5a568a,_0x2c7af4){_0x5a568a=_0x5a568a-0x0;var _0x143c69=_0x612c[_0x5a568a];return _0x143c69;};'use strict';var Sequelize=require(_0xc612('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc612('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc612('0x2')],'allowNull':![],'defaultValue':_0xc612('0x3')},'appdata':{'type':Sequelize[_0xc612('0x4')]()},'description':{'type':Sequelize[_0xc612('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc612('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index f77d92d..aaa3919 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 _0xcc35=['filter','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','SmsApplication','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x710f25,_0x5f3fcd){var _0x156399=function(_0x192475){while(--_0x192475){_0x710f25['push'](_0x710f25['shift']());}};_0x156399(++_0x5f3fcd);}(_0xcc35,0x1d1));var _0x5cc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc35[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5cc3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5cc3('0x1'));var rp=require(_0x5cc3('0x2'));var moment=require('moment');var BPromise=require(_0x5cc3('0x3'));var Mustache=require(_0x5cc3('0x4'));var util=require(_0x5cc3('0x5'));var path=require(_0x5cc3('0x6'));var sox=require('sox');var csv=require(_0x5cc3('0x7'));var ejs=require(_0x5cc3('0x8'));var fs=require('fs');var fs_extra=require(_0x5cc3('0x9'));var _=require('lodash');var squel=require(_0x5cc3('0xa'));var crypto=require(_0x5cc3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5cc3('0xc'));var toCsv=require(_0x5cc3('0x7'));var querystring=require(_0x5cc3('0xd'));var Papa=require('papaparse');var Redis=require(_0x5cc3('0xe'));var authService=require(_0x5cc3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5cc3('0x10'));var hardwareService=require(_0x5cc3('0x11'));var logger=require(_0x5cc3('0x12'))(_0x5cc3('0x13'));var utils=require(_0x5cc3('0x14'));var config=require(_0x5cc3('0x15'));var licenseUtil=require(_0x5cc3('0x16'));var db=require(_0x5cc3('0x17'))['db'];function respondWithStatusCode(_0x578608,_0x4a0518){_0x4a0518=_0x4a0518||0xcc;return function(_0x575938){if(_0x575938){return _0x578608[_0x5cc3('0x18')](_0x4a0518);}return _0x578608['status'](_0x4a0518)[_0x5cc3('0x19')]();};}function respondWithResult(_0x3a4654,_0x5957e3){_0x5957e3=_0x5957e3||0xc8;return function(_0x528ddd){if(_0x528ddd){return _0x3a4654[_0x5cc3('0x1a')](_0x5957e3)[_0x5cc3('0x1b')](_0x528ddd);}};}function respondWithFilteredResult(_0x150b32,_0x35e074){return function(_0x58429e){if(_0x58429e){var _0x3daafb=typeof _0x35e074[_0x5cc3('0x1c')]===_0x5cc3('0x1d')&&typeof _0x35e074[_0x5cc3('0x1e')]===_0x5cc3('0x1d');var _0x496bdb=_0x58429e['count'];var _0x3cdf0b=_0x3daafb?0x0:_0x35e074[_0x5cc3('0x1c')];var _0x45161e=_0x3daafb?_0x58429e['count']:_0x35e074[_0x5cc3('0x1c')]+_0x35e074[_0x5cc3('0x1e')];var _0x366049;if(_0x45161e>=_0x496bdb){_0x45161e=_0x496bdb;_0x366049=0xc8;}else{_0x366049=0xce;}_0x150b32[_0x5cc3('0x1a')](_0x366049);return _0x150b32[_0x5cc3('0x1f')](_0x5cc3('0x20'),_0x3cdf0b+'-'+_0x45161e+'/'+_0x496bdb)[_0x5cc3('0x1b')](_0x58429e);}return null;};}function patchUpdates(_0x21b720){return function(_0x55dd80){try{jsonpatch['apply'](_0x55dd80,_0x21b720,!![]);}catch(_0x7746c8){return BPromise[_0x5cc3('0x21')](_0x7746c8);}return _0x55dd80['save']();};}function saveUpdates(_0x2ac223,_0x3eedc9){return function(_0x4eadcd){if(_0x4eadcd){return _0x4eadcd[_0x5cc3('0x22')](_0x2ac223)[_0x5cc3('0x23')](function(_0x1aff1e){return _0x1aff1e;});}return null;};}function removeEntity(_0x4316c5,_0x56d1a7){return function(_0xedba74){if(_0xedba74){return _0xedba74[_0x5cc3('0x24')]()[_0x5cc3('0x23')](function(){_0x4316c5[_0x5cc3('0x1a')](0xcc)[_0x5cc3('0x19')]();});}};}function handleEntityNotFound(_0x561d0e,_0x353bdb){return function(_0x4f9b64){if(!_0x4f9b64){_0x561d0e[_0x5cc3('0x18')](0x194);}return _0x4f9b64;};}function handleError(_0xc02813,_0x535e44){_0x535e44=_0x535e44||0x1f4;return function(_0x5da1dd){logger[_0x5cc3('0x25')](_0x5da1dd[_0x5cc3('0x26')]);if(_0x5da1dd[_0x5cc3('0x27')]){delete _0x5da1dd[_0x5cc3('0x27')];}_0xc02813['status'](_0x535e44)[_0x5cc3('0x28')](_0x5da1dd);};}exports[_0x5cc3('0x29')]=function(_0x5f22f2,_0x2e2881){var _0x2b6752={},_0x1cfb00={},_0x2a878e={'count':0x0,'rows':[]};var _0x1042b1=_['map'](db[_0x5cc3('0x2a')][_0x5cc3('0x2b')],function(_0x50ecec){return{'name':_0x50ecec['fieldName'],'type':_0x50ecec['type'][_0x5cc3('0x2c')]};});_0x1cfb00[_0x5cc3('0x2d')]=_[_0x5cc3('0x2e')](_0x1042b1,_0x5cc3('0x27'));_0x1cfb00[_0x5cc3('0x2f')]=_[_0x5cc3('0x30')](_0x5f22f2[_0x5cc3('0x2f')]);_0x1cfb00[_0x5cc3('0x31')]=_[_0x5cc3('0x32')](_0x1cfb00[_0x5cc3('0x2d')],_0x1cfb00[_0x5cc3('0x2f')]);_0x2b6752[_0x5cc3('0x33')]=_[_0x5cc3('0x32')](_0x1cfb00['model'],qs['fields'](_0x5f22f2[_0x5cc3('0x2f')][_0x5cc3('0x34')]));_0x2b6752[_0x5cc3('0x33')]=_0x2b6752[_0x5cc3('0x33')][_0x5cc3('0x35')]?_0x2b6752[_0x5cc3('0x33')]:_0x1cfb00['model'];if(!_0x5f22f2[_0x5cc3('0x2f')][_0x5cc3('0x36')](_0x5cc3('0x37'))){_0x2b6752['limit']=qs[_0x5cc3('0x1e')](_0x5f22f2[_0x5cc3('0x2f')][_0x5cc3('0x1e')]);_0x2b6752['offset']=qs[_0x5cc3('0x1c')](_0x5f22f2[_0x5cc3('0x2f')]['offset']);}_0x2b6752[_0x5cc3('0x38')]=qs['sort'](_0x5f22f2[_0x5cc3('0x2f')][_0x5cc3('0x39')]);_0x2b6752[_0x5cc3('0x3a')]=qs[_0x5cc3('0x31')](_[_0x5cc3('0x3b')](_0x5f22f2[_0x5cc3('0x2f')],_0x1cfb00[_0x5cc3('0x31')]),_0x1042b1);if(_0x5f22f2[_0x5cc3('0x2f')][_0x5cc3('0x3c')]){_0x2b6752[_0x5cc3('0x3a')]=_['merge'](_0x2b6752[_0x5cc3('0x3a')],{'$or':_[_0x5cc3('0x2e')](_0x1042b1,function(_0x4982cc){if(_0x4982cc['type']!==_0x5cc3('0x3d')){var _0x4b7600={};_0x4b7600[_0x4982cc[_0x5cc3('0x27')]]={'$like':'%'+_0x5f22f2[_0x5cc3('0x2f')]['filter']+'%'};return _0x4b7600;}})});}_0x2b6752=_['merge']({},_0x2b6752,_0x5f22f2[_0x5cc3('0x3e')]);var _0x47ce68={'where':_0x2b6752[_0x5cc3('0x3a')]};return db['SmsApplication'][_0x5cc3('0x3f')](_0x47ce68)['then'](function(_0x29849b){_0x2a878e['count']=_0x29849b;if(_0x5f22f2['query'][_0x5cc3('0x40')]){_0x2b6752[_0x5cc3('0x41')]=[{'all':!![]}];}return db['SmsApplication'][_0x5cc3('0x42')](_0x2b6752);})[_0x5cc3('0x23')](function(_0x5eb8c9){_0x2a878e[_0x5cc3('0x43')]=_0x5eb8c9;return _0x2a878e;})[_0x5cc3('0x23')](respondWithFilteredResult(_0x2e2881,_0x2b6752))[_0x5cc3('0x44')](handleError(_0x2e2881,null));};exports[_0x5cc3('0x45')]=function(_0x4f0d88,_0x58af9c){var _0x385e48={'raw':!![],'where':{'id':_0x4f0d88[_0x5cc3('0x46')]['id']}},_0x6bf803={};_0x6bf803[_0x5cc3('0x2d')]=_['keys'](db['SmsApplication'][_0x5cc3('0x2b')]);_0x6bf803['query']=_[_0x5cc3('0x30')](_0x4f0d88[_0x5cc3('0x2f')]);_0x6bf803[_0x5cc3('0x31')]=_[_0x5cc3('0x32')](_0x6bf803[_0x5cc3('0x2d')],_0x6bf803[_0x5cc3('0x2f')]);_0x385e48[_0x5cc3('0x33')]=_[_0x5cc3('0x32')](_0x6bf803['model'],qs[_0x5cc3('0x34')](_0x4f0d88['query'][_0x5cc3('0x34')]));_0x385e48[_0x5cc3('0x33')]=_0x385e48[_0x5cc3('0x33')][_0x5cc3('0x35')]?_0x385e48[_0x5cc3('0x33')]:_0x6bf803[_0x5cc3('0x2d')];if(_0x4f0d88[_0x5cc3('0x2f')]['includeAll']){_0x385e48['include']=[{'all':!![]}];}_0x385e48=_[_0x5cc3('0x47')]({},_0x385e48,_0x4f0d88['options']);return db[_0x5cc3('0x2a')][_0x5cc3('0x48')](_0x385e48)['then'](handleEntityNotFound(_0x58af9c,null))[_0x5cc3('0x23')](respondWithResult(_0x58af9c,null))[_0x5cc3('0x44')](handleError(_0x58af9c,null));};exports['create']=function(_0x42b3a9,_0x4719a7){return db[_0x5cc3('0x2a')][_0x5cc3('0x49')](_0x42b3a9[_0x5cc3('0x4a')],{})[_0x5cc3('0x23')](respondWithResult(_0x4719a7,0xc9))[_0x5cc3('0x44')](handleError(_0x4719a7,null));};exports[_0x5cc3('0x22')]=function(_0x4647e1,_0x1cbd7f){if(_0x4647e1[_0x5cc3('0x4a')]['id']){delete _0x4647e1[_0x5cc3('0x4a')]['id'];}return db[_0x5cc3('0x2a')][_0x5cc3('0x48')]({'where':{'id':_0x4647e1[_0x5cc3('0x46')]['id']}})[_0x5cc3('0x23')](handleEntityNotFound(_0x1cbd7f,null))[_0x5cc3('0x23')](saveUpdates(_0x4647e1['body'],null))[_0x5cc3('0x23')](respondWithResult(_0x1cbd7f,null))[_0x5cc3('0x44')](handleError(_0x1cbd7f,null));};exports[_0x5cc3('0x24')]=function(_0x2fe1cd,_0x284e1f){return db[_0x5cc3('0x2a')]['find']({'where':{'id':_0x2fe1cd['params']['id']}})['then'](handleEntityNotFound(_0x284e1f,null))[_0x5cc3('0x23')](removeEntity(_0x284e1f,null))[_0x5cc3('0x44')](handleError(_0x284e1f,null));}; \ No newline at end of file +var _0xd1ca=['key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','fields','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SmsApplication','fieldName'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xd1ca,0x147));var _0xad1c=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xd1ca[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad1c('0x0'));var zipdir=require(_0xad1c('0x1'));var jsonpatch=require(_0xad1c('0x2'));var rp=require(_0xad1c('0x3'));var moment=require('moment');var BPromise=require(_0xad1c('0x4'));var Mustache=require(_0xad1c('0x5'));var util=require(_0xad1c('0x6'));var path=require(_0xad1c('0x7'));var sox=require(_0xad1c('0x8'));var csv=require(_0xad1c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad1c('0xa'));var _=require(_0xad1c('0xb'));var squel=require(_0xad1c('0xc'));var crypto=require(_0xad1c('0xd'));var jsforce=require(_0xad1c('0xe'));var deskjs=require(_0xad1c('0xf'));var toCsv=require(_0xad1c('0x9'));var querystring=require('querystring');var Papa=require(_0xad1c('0x10'));var Redis=require(_0xad1c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xad1c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad1c('0x13'));var logger=require(_0xad1c('0x14'))(_0xad1c('0x15'));var utils=require(_0xad1c('0x16'));var config=require(_0xad1c('0x17'));var licenseUtil=require(_0xad1c('0x18'));var db=require(_0xad1c('0x19'))['db'];function respondWithStatusCode(_0x571bc2,_0x1b711a){_0x1b711a=_0x1b711a||0xcc;return function(_0x4556ec){if(_0x4556ec){return _0x571bc2[_0xad1c('0x1a')](_0x1b711a);}return _0x571bc2[_0xad1c('0x1b')](_0x1b711a)[_0xad1c('0x1c')]();};}function respondWithResult(_0x446ae8,_0x3f4030){_0x3f4030=_0x3f4030||0xc8;return function(_0x23c51d){if(_0x23c51d){return _0x446ae8['status'](_0x3f4030)[_0xad1c('0x1d')](_0x23c51d);}};}function respondWithFilteredResult(_0x4a0cba,_0x56fc9a){return function(_0x53823d){if(_0x53823d){var _0xb01587=typeof _0x56fc9a[_0xad1c('0x1e')]===_0xad1c('0x1f')&&typeof _0x56fc9a[_0xad1c('0x20')]===_0xad1c('0x1f');var _0x2ac7c1=_0x53823d[_0xad1c('0x21')];var _0x7e3752=_0xb01587?0x0:_0x56fc9a['offset'];var _0x513f5c=_0xb01587?_0x53823d['count']:_0x56fc9a['offset']+_0x56fc9a[_0xad1c('0x20')];var _0x443e64;if(_0x513f5c>=_0x2ac7c1){_0x513f5c=_0x2ac7c1;_0x443e64=0xc8;}else{_0x443e64=0xce;}_0x4a0cba['status'](_0x443e64);return _0x4a0cba[_0xad1c('0x22')](_0xad1c('0x23'),_0x7e3752+'-'+_0x513f5c+'/'+_0x2ac7c1)[_0xad1c('0x1d')](_0x53823d);}return null;};}function patchUpdates(_0x5793cb){return function(_0x2826d1){try{jsonpatch[_0xad1c('0x24')](_0x2826d1,_0x5793cb,!![]);}catch(_0x54a583){return BPromise['reject'](_0x54a583);}return _0x2826d1[_0xad1c('0x25')]();};}function saveUpdates(_0x458dad,_0xe64d5d){return function(_0xd41e04){if(_0xd41e04){return _0xd41e04[_0xad1c('0x26')](_0x458dad)[_0xad1c('0x27')](function(_0x5e7c71){return _0x5e7c71;});}return null;};}function removeEntity(_0x3511c8,_0x5be22d){return function(_0x4fc73f){if(_0x4fc73f){return _0x4fc73f[_0xad1c('0x28')]()['then'](function(){_0x3511c8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53af5e,_0x2f51f5){return function(_0x3c6613){if(!_0x3c6613){_0x53af5e[_0xad1c('0x1a')](0x194);}return _0x3c6613;};}function handleError(_0x5d26a1,_0x115ead){_0x115ead=_0x115ead||0x1f4;return function(_0x281a1c){logger[_0xad1c('0x29')](_0x281a1c[_0xad1c('0x2a')]);if(_0x281a1c[_0xad1c('0x2b')]){delete _0x281a1c[_0xad1c('0x2b')];}_0x5d26a1[_0xad1c('0x1b')](_0x115ead)['send'](_0x281a1c);};}exports[_0xad1c('0x2c')]=function(_0x4b9d4a,_0x47bf41){var _0x5bb830={},_0x238102={},_0x47ba76={'count':0x0,'rows':[]};var _0x3cdf1a=_[_0xad1c('0x2d')](db[_0xad1c('0x2e')]['rawAttributes'],function(_0x5165f4){return{'name':_0x5165f4[_0xad1c('0x2f')],'type':_0x5165f4['type'][_0xad1c('0x30')]};});_0x238102[_0xad1c('0x31')]=_[_0xad1c('0x2d')](_0x3cdf1a,_0xad1c('0x2b'));_0x238102[_0xad1c('0x32')]=_[_0xad1c('0x33')](_0x4b9d4a[_0xad1c('0x32')]);_0x238102[_0xad1c('0x34')]=_[_0xad1c('0x35')](_0x238102[_0xad1c('0x31')],_0x238102[_0xad1c('0x32')]);_0x5bb830[_0xad1c('0x36')]=_[_0xad1c('0x35')](_0x238102['model'],qs['fields'](_0x4b9d4a['query']['fields']));_0x5bb830[_0xad1c('0x36')]=_0x5bb830[_0xad1c('0x36')]['length']?_0x5bb830['attributes']:_0x238102['model'];if(!_0x4b9d4a[_0xad1c('0x32')][_0xad1c('0x37')](_0xad1c('0x38'))){_0x5bb830['limit']=qs['limit'](_0x4b9d4a[_0xad1c('0x32')][_0xad1c('0x20')]);_0x5bb830[_0xad1c('0x1e')]=qs[_0xad1c('0x1e')](_0x4b9d4a[_0xad1c('0x32')][_0xad1c('0x1e')]);}_0x5bb830['order']=qs[_0xad1c('0x39')](_0x4b9d4a[_0xad1c('0x32')]['sort']);_0x5bb830[_0xad1c('0x3a')]=qs[_0xad1c('0x34')](_[_0xad1c('0x3b')](_0x4b9d4a[_0xad1c('0x32')],_0x238102[_0xad1c('0x34')]),_0x3cdf1a);if(_0x4b9d4a['query'][_0xad1c('0x3c')]){_0x5bb830[_0xad1c('0x3a')]=_[_0xad1c('0x3d')](_0x5bb830[_0xad1c('0x3a')],{'$or':_[_0xad1c('0x2d')](_0x3cdf1a,function(_0x30fd76){if(_0x30fd76[_0xad1c('0x3e')]!==_0xad1c('0x3f')){var _0x1c1669={};_0x1c1669[_0x30fd76[_0xad1c('0x2b')]]={'$like':'%'+_0x4b9d4a['query'][_0xad1c('0x3c')]+'%'};return _0x1c1669;}})});}_0x5bb830=_['merge']({},_0x5bb830,_0x4b9d4a['options']);var _0x449c17={'where':_0x5bb830['where']};return db['SmsApplication']['count'](_0x449c17)[_0xad1c('0x27')](function(_0x4f962c){_0x47ba76[_0xad1c('0x21')]=_0x4f962c;if(_0x4b9d4a[_0xad1c('0x32')][_0xad1c('0x40')]){_0x5bb830[_0xad1c('0x41')]=[{'all':!![]}];}return db[_0xad1c('0x2e')]['findAll'](_0x5bb830);})[_0xad1c('0x27')](function(_0x199452){_0x47ba76[_0xad1c('0x42')]=_0x199452;return _0x47ba76;})[_0xad1c('0x27')](respondWithFilteredResult(_0x47bf41,_0x5bb830))[_0xad1c('0x43')](handleError(_0x47bf41,null));};exports[_0xad1c('0x44')]=function(_0x33f0db,_0x170a9b){var _0x51be0a={'raw':!![],'where':{'id':_0x33f0db[_0xad1c('0x45')]['id']}},_0x619513={};_0x619513[_0xad1c('0x31')]=_[_0xad1c('0x33')](db[_0xad1c('0x2e')]['rawAttributes']);_0x619513[_0xad1c('0x32')]=_['keys'](_0x33f0db[_0xad1c('0x32')]);_0x619513[_0xad1c('0x34')]=_[_0xad1c('0x35')](_0x619513[_0xad1c('0x31')],_0x619513[_0xad1c('0x32')]);_0x51be0a[_0xad1c('0x36')]=_[_0xad1c('0x35')](_0x619513[_0xad1c('0x31')],qs['fields'](_0x33f0db[_0xad1c('0x32')][_0xad1c('0x46')]));_0x51be0a[_0xad1c('0x36')]=_0x51be0a[_0xad1c('0x36')][_0xad1c('0x47')]?_0x51be0a['attributes']:_0x619513[_0xad1c('0x31')];if(_0x33f0db[_0xad1c('0x32')][_0xad1c('0x40')]){_0x51be0a[_0xad1c('0x41')]=[{'all':!![]}];}_0x51be0a=_[_0xad1c('0x3d')]({},_0x51be0a,_0x33f0db['options']);return db['SmsApplication'][_0xad1c('0x48')](_0x51be0a)[_0xad1c('0x27')](handleEntityNotFound(_0x170a9b,null))[_0xad1c('0x27')](respondWithResult(_0x170a9b,null))['catch'](handleError(_0x170a9b,null));};exports[_0xad1c('0x49')]=function(_0x5756be,_0x42baf8){return db['SmsApplication'][_0xad1c('0x49')](_0x5756be[_0xad1c('0x4a')],{})['then'](respondWithResult(_0x42baf8,0xc9))[_0xad1c('0x43')](handleError(_0x42baf8,null));};exports['update']=function(_0x9b6360,_0x5837d5){if(_0x9b6360[_0xad1c('0x4a')]['id']){delete _0x9b6360[_0xad1c('0x4a')]['id'];}return db['SmsApplication'][_0xad1c('0x48')]({'where':{'id':_0x9b6360[_0xad1c('0x45')]['id']}})[_0xad1c('0x27')](handleEntityNotFound(_0x5837d5,null))[_0xad1c('0x27')](saveUpdates(_0x9b6360['body'],null))[_0xad1c('0x27')](respondWithResult(_0x5837d5,null))[_0xad1c('0x43')](handleError(_0x5837d5,null));};exports[_0xad1c('0x28')]=function(_0x3c313e,_0x41e194){return db[_0xad1c('0x2e')][_0xad1c('0x48')]({'where':{'id':_0x3c313e['params']['id']}})['then'](handleEntityNotFound(_0x41e194,null))[_0xad1c('0x27')](removeEntity(_0x41e194,null))[_0xad1c('0x43')](handleError(_0x41e194,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 2de8717..e79baca 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 _0x8f13=['define','SmsApplication','sms_applications','utf8mb4','lodash','api','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x56cde4,_0x2f5d8c){var _0x2d54b6=function(_0x1aac24){while(--_0x1aac24){_0x56cde4['push'](_0x56cde4['shift']());}};_0x2d54b6(++_0x2f5d8c);}(_0x8f13,0xac));var _0x38f1=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x8f13[_0x246f0c];return _0x30fe50;};'use strict';var _=require(_0x38f1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x38f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x38f1('0x2'));var fs=require('fs');var path=require(_0x38f1('0x3'));var rimraf=require(_0x38f1('0x4'));var config=require(_0x38f1('0x5'));var attributes=require(_0x38f1('0x6'));module[_0x38f1('0x7')]=function(_0x4d8527,_0x529e83){return _0x4d8527[_0x38f1('0x8')](_0x38f1('0x9'),attributes,{'tableName':_0x38f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x38f1('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0c75=['api','moment','request-promise','path','./smsApplication.attributes','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa7f22a,_0x4bb5bf){var _0x497132=function(_0x8163de){while(--_0x8163de){_0xa7f22a['push'](_0xa7f22a['shift']());}};_0x497132(++_0x4bb5bf);}(_0x0c75,0x132));var _0x50c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c75[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x50c7('0x0'));var util=require(_0x50c7('0x1'));var logger=require('../../config/logger')(_0x50c7('0x2'));var moment=require(_0x50c7('0x3'));var BPromise=require('bluebird');var rp=require(_0x50c7('0x4'));var fs=require('fs');var path=require(_0x50c7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x50c7('0x6'));module['exports']=function(_0x52d184,_0x1e8264){return _0x52d184[_0x50c7('0x7')]('SmsApplication',attributes,{'tableName':_0x50c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x50c7('0x9'),'collate':_0x50c7('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 01c781d..36ab2bf 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 _0x80cd=['client','http','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x159b72,_0x183756){var _0x4fa7b7=function(_0x43e36b){while(--_0x43e36b){_0x159b72['push'](_0x159b72['shift']());}};_0x4fa7b7(++_0x183756);}(_0x80cd,0x146));var _0xd80c=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x80cd[_0x56f7e2];return _0x36240b;};'use strict';var _=require('lodash');var util=require(_0xd80c('0x0'));var moment=require(_0xd80c('0x1'));var BPromise=require(_0xd80c('0x2'));var rs=require(_0xd80c('0x3'));var fs=require('fs');var Redis=require(_0xd80c('0x4'));var db=require(_0xd80c('0x5'))['db'];var utils=require(_0xd80c('0x6'));var logger=require(_0xd80c('0x7'))('rpc');var config=require(_0xd80c('0x8'));var jayson=require(_0xd80c('0x9'));var client=jayson[_0xd80c('0xa')][_0xd80c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x508e19,_0x343595,_0x20cd74){return new BPromise(function(_0x2dc89b,_0x3aa004){return client['request'](_0x508e19,_0x20cd74)[_0xd80c('0xc')](function(_0x588160){logger['info'](_0xd80c('0xd'),_0x343595,'request\x20sent');logger[_0xd80c('0xe')](_0xd80c('0xf'),_0x343595,_0xd80c('0x10'),JSON[_0xd80c('0x11')](_0x588160));if(_0x588160[_0xd80c('0x12')]){if(_0x588160[_0xd80c('0x12')][_0xd80c('0x13')]===0x1f4){logger['error'](_0xd80c('0xd'),_0x343595,_0x588160[_0xd80c('0x12')][_0xd80c('0x14')]);return _0x3aa004(_0x588160[_0xd80c('0x12')][_0xd80c('0x14')]);}logger[_0xd80c('0x12')](_0xd80c('0xd'),_0x343595,_0x588160[_0xd80c('0x12')][_0xd80c('0x14')]);return _0x2dc89b(_0x588160['error'][_0xd80c('0x14')]);}else{logger[_0xd80c('0x15')](_0xd80c('0xd'),_0x343595,_0xd80c('0x10'));_0x2dc89b(_0x588160[_0xd80c('0x16')]['message']);}})[_0xd80c('0x17')](function(_0xec332d){logger[_0xd80c('0x12')](_0xd80c('0xd'),_0x343595,_0xec332d);_0x3aa004(_0xec332d);});});} \ No newline at end of file +var _0xdf5d=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4e198a,_0x5a6bad){var _0xb84bfe=function(_0x58d2b2){while(--_0x58d2b2){_0x4e198a['push'](_0x4e198a['shift']());}};_0xb84bfe(++_0x5a6bad);}(_0xdf5d,0x126));var _0xddf5=function(_0x36efa8,_0x59e89d){_0x36efa8=_0x36efa8-0x0;var _0x8e4aea=_0xdf5d[_0x36efa8];return _0x8e4aea;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var moment=require(_0xddf5('0x2'));var BPromise=require(_0xddf5('0x3'));var rs=require(_0xddf5('0x4'));var fs=require('fs');var Redis=require(_0xddf5('0x5'));var db=require(_0xddf5('0x6'))['db'];var utils=require(_0xddf5('0x7'));var logger=require('../../config/logger')(_0xddf5('0x8'));var config=require(_0xddf5('0x9'));var jayson=require(_0xddf5('0xa'));var client=jayson[_0xddf5('0xb')][_0xddf5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x228fd4,_0xf3a209,_0xa029d2){return new BPromise(function(_0x3a1e13,_0x3df89){return client[_0xddf5('0xd')](_0x228fd4,_0xa029d2)[_0xddf5('0xe')](function(_0x36b306){logger[_0xddf5('0xf')](_0xddf5('0x10'),_0xf3a209,_0xddf5('0x11'));logger['debug'](_0xddf5('0x12'),_0xf3a209,_0xddf5('0x11'),JSON[_0xddf5('0x13')](_0x36b306));if(_0x36b306[_0xddf5('0x14')]){if(_0x36b306[_0xddf5('0x14')][_0xddf5('0x15')]===0x1f4){logger[_0xddf5('0x14')](_0xddf5('0x10'),_0xf3a209,_0x36b306['error']['message']);return _0x3df89(_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);}logger[_0xddf5('0x14')](_0xddf5('0x10'),_0xf3a209,_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);return _0x3a1e13(_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);}else{logger['info'](_0xddf5('0x10'),_0xf3a209,_0xddf5('0x11'));_0x3a1e13(_0x36b306[_0xddf5('0x17')][_0xddf5('0x16')]);}})[_0xddf5('0x18')](function(_0x5ef952){logger[_0xddf5('0x14')]('SmsApplication,\x20%s,\x20%s',_0xf3a209,_0x5ef952);_0x3df89(_0x5ef952);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index bc69f2e..34ff1f2 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 _0xf7b4=['/describe','describe','/:id','show','getMessages','/:id/download','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index'];(function(_0x3268ac,_0x274506){var _0x431056=function(_0x5824a5){while(--_0x5824a5){_0x3268ac['push'](_0x3268ac['shift']());}};_0x431056(++_0x274506);}(_0xf7b4,0x152));var _0x4f7b=function(_0x74ea5d,_0x31c038){_0x74ea5d=_0x74ea5d-0x0;var _0x13b3c1=_0xf7b4[_0x74ea5d];return _0x13b3c1;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/messages',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0x7')](_0x4f7b('0xf'),auth[_0x4f7b('0x8')](),controller['download']);router[_0x4f7b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f7b('0x10')](_0x4f7b('0x11'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['post'](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x16')),controller[_0x4f7b('0x17')]);router[_0x4f7b('0x18')](_0x4f7b('0xc'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x19')),controller['update']);router[_0x4f7b('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),'smsinteraction:destroy'),controller[_0x4f7b('0x1b')]);router[_0x4f7b('0x1a')](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),controller['removeTags']);module[_0x4f7b('0x1c')]=router; \ No newline at end of file +var _0xd8b0=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x131661,_0xce0636){var _0x433195=function(_0x5f544e){while(--_0x5f544e){_0x131661['push'](_0x131661['shift']());}};_0x433195(++_0xce0636);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/download',auth[_0x0d8b('0x7')](),controller['download']);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0xf')](_0x0d8b('0x12'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x15')),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x17')),controller['update']);router[_0x0d8b('0x18')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x19')),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x18')]('/:id/tags',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x1b')]);module[_0x0d8b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 5329b2b..53b1d1f 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 _0x4819=['out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x41515f,_0x2f0f7b){var _0x35f098=function(_0x268ace){while(--_0x268ace){_0x41515f['push'](_0x41515f['shift']());}};_0x35f098(++_0x2f0f7b);}(_0x4819,0xcd));var _0x9481=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x4819[_0x39f34f];return _0x59fee1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9481('0x0'));module[_0x9481('0x1')]={'closed':{'type':Sequelize[_0x9481('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9481('0x3')]},'disposition':{'type':Sequelize[_0x9481('0x4')]},'secondDisposition':{'type':Sequelize[_0x9481('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9481('0x4')]},'note':{'type':Sequelize[_0x9481('0x4')]},'phone':{'type':Sequelize[_0x9481('0x4')]},'read1stAt':{'type':Sequelize[_0x9481('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9481('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9481('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9481('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x815b=['exports','BOOLEAN','DATE','STRING','ENUM','sequelize','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x815b,0xb4));var _0xb815=function(_0x5b7610,_0x488763){_0x5b7610=_0x5b7610-0x0;var _0x211466=_0x815b[_0x5b7610];return _0x211466;};'use strict';var Sequelize=require(_0xb815('0x0'));var moment=require(_0xb815('0x1'));module[_0xb815('0x2')]={'closed':{'type':Sequelize[_0xb815('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb815('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb815('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb815('0x5')]},'read1stAt':{'type':Sequelize[_0xb815('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb815('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb815('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xb815('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb815('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index b760e6f..9b30490 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 _0x065c=['end','offset','undefined','limit','count','status','set','json','then','destroy','error','stack','send','map','fieldName','type','key','sms','query','user','catch','show','params','SmsInteraction','rawAttributes','keys','filters','model','attributes','intersection','fields','length','includeAll','include','merge','create','body','find','describe','SmsMessage','addMessage','omit','getMessages','findOne','hasOwnProperty','sort','where','pick','SmsInteractionId','filter','$gte','options','findAll','rows','addTags','setTags','ids','color','emit','smsInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Messages','direction','secret','SmsAccount','Account','name','Owner','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','createdAt','out','System','Contact','firstName','lastName','read','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','sendStatus'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x065c,0xde));var _0xc065=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x065c[_0x15ec4e];return _0xb5e5dd;};'use strict';var rimraf=require(_0xc065('0x0'));var zipdir=require(_0xc065('0x1'));var moment=require(_0xc065('0x2'));var BPromise=require('bluebird');var util=require(_0xc065('0x3'));var path=require(_0xc065('0x4'));var ejs=require(_0xc065('0x5'));var fs=require('fs');var _=require(_0xc065('0x6'));var Redis=require('ioredis');var interaction=require(_0xc065('0x7'));var qs=require(_0xc065('0x8'));var pdf=require(_0xc065('0x9'));var logger=require(_0xc065('0xa'))(_0xc065('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc065('0xc')]=_[_0xc065('0xd')](config[_0xc065('0xc')],{'host':_0xc065('0xe'),'port':0x18eb});var socket=require(_0xc065('0xf'))(new Redis(config[_0xc065('0xc')]));require('./smsInteraction.socket')[_0xc065('0x10')](socket);function respondWithStatusCode(_0x48ec54,_0xd9fa42){_0xd9fa42=_0xd9fa42||0xcc;return function(_0x541115){if(_0x541115){return _0x48ec54[_0xc065('0x11')](_0xd9fa42);}return _0x48ec54['status'](_0xd9fa42)[_0xc065('0x12')]();};}function respondWithResult(_0x5e465a,_0xa3efcb){_0xa3efcb=_0xa3efcb||0xc8;return function(_0x412a8c){if(_0x412a8c){return _0x5e465a['status'](_0xa3efcb)['json'](_0x412a8c);}};}function respondWithFilteredResult(_0x40e6f4,_0x2622f9){return function(_0x1a5e69){if(_0x1a5e69){var _0x39a23a=typeof _0x2622f9[_0xc065('0x13')]===_0xc065('0x14')&&typeof _0x2622f9[_0xc065('0x15')]===_0xc065('0x14');var _0x1f195e=_0x1a5e69[_0xc065('0x16')];var _0x3a8596=_0x39a23a?0x0:_0x2622f9['offset'];var _0x2ca69a=_0x39a23a?_0x1a5e69['count']:_0x2622f9[_0xc065('0x13')]+_0x2622f9[_0xc065('0x15')];var _0x198d37;if(_0x2ca69a>=_0x1f195e){_0x2ca69a=_0x1f195e;_0x198d37=0xc8;}else{_0x198d37=0xce;}_0x40e6f4[_0xc065('0x17')](_0x198d37);return _0x40e6f4[_0xc065('0x18')]('Content-Range',_0x3a8596+'-'+_0x2ca69a+'/'+_0x1f195e)[_0xc065('0x19')](_0x1a5e69);}return null;};}function saveUpdates(_0x1b32a6){return function(_0xa526f2){if(_0xa526f2){return _0xa526f2['update'](_0x1b32a6)[_0xc065('0x1a')](function(_0x44c226){return _0x44c226;});}return null;};}function removeEntity(_0x521b68){return function(_0xc9b725){if(_0xc9b725){return _0xc9b725[_0xc065('0x1b')]()['then'](function(){_0x521b68[_0xc065('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd077d0){return function(_0x3a8c6a){if(!_0x3a8c6a){_0xd077d0[_0xc065('0x11')](0x194);}return _0x3a8c6a;};}function handleError(_0x2a63ad,_0x188727){_0x188727=_0x188727||0x1f4;return function(_0x25edac){logger[_0xc065('0x1c')](_0x25edac[_0xc065('0x1d')]);if(_0x25edac['name']){delete _0x25edac['name'];}_0x2a63ad[_0xc065('0x17')](_0x188727)[_0xc065('0x1e')](_0x25edac);};}exports['index']=function(_0x4d7e9c,_0x2dda35){var _0x1fdee3={};var _0x41972c=_[_0xc065('0x1f')](db['SmsInteraction']['rawAttributes'],function(_0x407d60){return{'name':_0x407d60[_0xc065('0x20')],'type':_0x407d60[_0xc065('0x21')][_0xc065('0x22')]};});_0x1fdee3=qs['getOptions'](_0x41972c,_0x4d7e9c);return interaction['findAll'](_0xc065('0x23'),_0x4d7e9c[_0xc065('0x24')],_0x4d7e9c[_0xc065('0x25')],_0x1fdee3,_0x41972c)[_0xc065('0x1a')](respondWithFilteredResult(_0x2dda35,_0x1fdee3))[_0xc065('0x26')](handleError(_0x2dda35,null));};exports[_0xc065('0x27')]=function(_0x155fb0,_0x5a2b36){var _0xdf565={'raw':![],'where':{'id':_0x155fb0[_0xc065('0x28')]['id']}},_0x24dac0={};_0x24dac0['model']=_['keys'](db[_0xc065('0x29')][_0xc065('0x2a')]);_0x24dac0[_0xc065('0x24')]=_[_0xc065('0x2b')](_0x155fb0[_0xc065('0x24')]);_0x24dac0[_0xc065('0x2c')]=_['intersection'](_0x24dac0[_0xc065('0x2d')],_0x24dac0['query']);_0xdf565[_0xc065('0x2e')]=_[_0xc065('0x2f')](_0x24dac0[_0xc065('0x2d')],qs[_0xc065('0x30')](_0x155fb0[_0xc065('0x24')]['fields']));_0xdf565[_0xc065('0x2e')]=_0xdf565['attributes'][_0xc065('0x31')]?_0xdf565['attributes']:_0x24dac0['model'];if(_0x155fb0[_0xc065('0x24')][_0xc065('0x32')]){_0xdf565[_0xc065('0x33')]=[{'all':!![]}];}_0xdf565=_[_0xc065('0x34')]({},_0xdf565,_0x155fb0['options']);return db['SmsInteraction']['find'](_0xdf565)[_0xc065('0x1a')](handleEntityNotFound(_0x5a2b36,null))['then'](respondWithResult(_0x5a2b36,null))[_0xc065('0x26')](handleError(_0x5a2b36,null));};exports[_0xc065('0x35')]=function(_0x1b612c,_0x12e7cc){return db['SmsInteraction']['create'](_0x1b612c[_0xc065('0x36')],{})[_0xc065('0x1a')](respondWithResult(_0x12e7cc,0xc9))['catch'](handleError(_0x12e7cc,null));};exports['update']=function(_0x59ce37,_0x304ffc){if(_0x59ce37[_0xc065('0x36')]['id']){delete _0x59ce37['body']['id'];}return db[_0xc065('0x29')][_0xc065('0x37')]({'where':{'id':_0x59ce37['params']['id']}})[_0xc065('0x1a')](handleEntityNotFound(_0x304ffc,null))[_0xc065('0x1a')](saveUpdates(_0x59ce37[_0xc065('0x36')],null))['then'](respondWithResult(_0x304ffc,null))['catch'](handleError(_0x304ffc,null));};exports[_0xc065('0x1b')]=function(_0x203f00,_0x34aec5){return db[_0xc065('0x29')][_0xc065('0x37')]({'where':{'id':_0x203f00[_0xc065('0x28')]['id']}})[_0xc065('0x1a')](handleEntityNotFound(_0x34aec5,null))[_0xc065('0x1a')](removeEntity(_0x34aec5,null))[_0xc065('0x26')](handleError(_0x34aec5,null));};exports[_0xc065('0x38')]=function(_0x2cadbf,_0x554134){return db[_0xc065('0x29')][_0xc065('0x38')]()[_0xc065('0x1a')](respondWithResult(_0x554134,null))[_0xc065('0x26')](handleError(_0x554134,null));};exports['addMessage']=function(_0x453fab,_0x380555){return db[_0xc065('0x39')][_0xc065('0x37')]({'where':{'id':_0x453fab[_0xc065('0x28')]['id']}})[_0xc065('0x1a')](handleEntityNotFound(_0x380555,null))[_0xc065('0x1a')](function(_0x316bd1){if(_0x316bd1){return _0x316bd1[_0xc065('0x3a')](_0x453fab[_0xc065('0x36')]['ids'],_[_0xc065('0x3b')](_0x453fab['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x380555,null))[_0xc065('0x26')](handleError(_0x380555,null));};exports[_0xc065('0x3c')]=function(_0x148881,_0x363676){var _0x3014cd={'raw':![],'where':{}};var _0x2313e1={};var _0x1cadae={'count':0x0,'rows':[]};return db[_0xc065('0x29')][_0xc065('0x3d')]({'where':{'id':_0x148881['params']['id']}})[_0xc065('0x1a')](handleEntityNotFound(_0x363676,null))[_0xc065('0x1a')](function(_0x161860){if(_0x161860){_0x2313e1[_0xc065('0x2d')]=_[_0xc065('0x2b')](db[_0xc065('0x39')][_0xc065('0x2a')]);_0x2313e1[_0xc065('0x24')]=_[_0xc065('0x2b')](_0x148881['query']);_0x2313e1['filters']=_['intersection'](_0x2313e1['model'],_0x2313e1[_0xc065('0x24')]);_0x3014cd['attributes']=_['intersection'](_0x2313e1[_0xc065('0x2d')],qs[_0xc065('0x30')](_0x148881[_0xc065('0x24')][_0xc065('0x30')]));_0x3014cd[_0xc065('0x2e')]=_0x3014cd[_0xc065('0x2e')][_0xc065('0x31')]?_0x3014cd[_0xc065('0x2e')]:_0x2313e1['model'];if(!_0x148881[_0xc065('0x24')][_0xc065('0x3e')]('nolimit')){_0x3014cd[_0xc065('0x15')]=qs[_0xc065('0x15')](_0x148881[_0xc065('0x24')][_0xc065('0x15')]);_0x3014cd[_0xc065('0x13')]=qs[_0xc065('0x13')](_0x148881['query'][_0xc065('0x13')]);}_0x3014cd['order']=qs[_0xc065('0x3f')](_0x148881[_0xc065('0x24')][_0xc065('0x3f')]);_0x3014cd[_0xc065('0x40')]=qs[_0xc065('0x2c')](_[_0xc065('0x41')](_0x148881[_0xc065('0x24')],_0x2313e1[_0xc065('0x2c')]));_0x3014cd[_0xc065('0x40')][_0xc065('0x42')]=_0x161860['id'];if(_0x148881[_0xc065('0x24')][_0xc065('0x43')]){_0x3014cd[_0xc065('0x40')]=_[_0xc065('0x34')](_0x3014cd['where'],{'$or':_[_0xc065('0x1f')](_0x3014cd['attributes'],function(_0x49a376){var _0x2aaa2f={};_0x2aaa2f[_0x49a376]={'$like':'%'+_0x148881['query'][_0xc065('0x43')]+'%'};return _0x2aaa2f;})});}if(_0x148881[_0xc065('0x24')][_0xc065('0x44')]){var _0x3c4c72=_0x148881[_0xc065('0x24')][_0xc065('0x44')]['split'](',');var _0x29f055={};_0x29f055[_0x3c4c72[0x0]]={'$gte':moment(_0x3c4c72[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3014cd[_0xc065('0x40')]=_[_0xc065('0x34')](_0x3014cd[_0xc065('0x40')],_0x29f055);}_0x3014cd=_[_0xc065('0x34')]({},_0x3014cd,_0x148881[_0xc065('0x45')]);return db['SmsMessage']['count']({'where':_0x3014cd[_0xc065('0x40')]})[_0xc065('0x1a')](function(_0x1e811d){_0x1cadae[_0xc065('0x16')]=_0x1e811d;if(_0x148881[_0xc065('0x24')][_0xc065('0x32')]){_0x3014cd['include']=[{'all':!![]}];}return db[_0xc065('0x39')][_0xc065('0x46')](_0x3014cd);})['then'](function(_0x8c5867){_0x1cadae[_0xc065('0x47')]=_0x8c5867;return _0x1cadae;});}})[_0xc065('0x1a')](respondWithFilteredResult(_0x363676,_0x3014cd))[_0xc065('0x26')](handleError(_0x363676,null));};exports[_0xc065('0x48')]=function(_0x5d126d,_0x7d5b7){return db[_0xc065('0x29')][_0xc065('0x37')]({'where':{'id':_0x5d126d['params']['id']}})[_0xc065('0x1a')](handleEntityNotFound(_0x7d5b7,null))['then'](function(_0x14a41f){if(_0x14a41f){return _0x14a41f[_0xc065('0x49')](_0x5d126d[_0xc065('0x36')][_0xc065('0x4a')],_[_0xc065('0x3b')](_0x5d126d['body'],[_0xc065('0x4a'),'id'])||{})['spread'](function(){return db['Tag'][_0xc065('0x46')]({'attributes':['id','name',_0xc065('0x4b')],'where':{'id':_0x5d126d[_0xc065('0x36')]['ids']}});})[_0xc065('0x1a')](function(_0x346333){socket[_0xc065('0x4c')](_0xc065('0x4d'),{'id':Number(_0x5d126d[_0xc065('0x28')]['id']),'tags':_0x346333||[]});return{'id':Number(_0x5d126d['params']['id']),'tags':_0x346333||[]};});}})[_0xc065('0x1a')](respondWithResult(_0x7d5b7,null))['catch'](handleError(_0x7d5b7,null));};exports[_0xc065('0x4e')]=function(_0x2d5c16,_0x11c787){return db[_0xc065('0x29')][_0xc065('0x37')]({'where':{'id':_0x2d5c16[_0xc065('0x28')]['id']}})[_0xc065('0x1a')](handleEntityNotFound(_0x11c787,null))[_0xc065('0x1a')](function(_0x28e5e0){if(_0x28e5e0){return _0x28e5e0[_0xc065('0x4e')](_0x2d5c16[_0xc065('0x24')][_0xc065('0x4a')]);}})['then'](respondWithStatusCode(_0x11c787,null))['catch'](handleError(_0x11c787,null));};exports[_0xc065('0x4f')]=function(_0x3321d1,_0x1acdd0){var _0x318ef8=moment()['unix']()[_0xc065('0x50')]();var _0x4de909=path[_0xc065('0x51')](config[_0xc065('0x52')],_0xc065('0x53'),_0xc065('0x54'),_0xc065('0x55'));var _0x224d8c=path[_0xc065('0x51')](_0x4de909,_0x318ef8);var _0x360c61=util[_0xc065('0x56')](_0xc065('0x57'),_0x3321d1[_0xc065('0x28')]['id'],_0x318ef8);var _0xc7ef8b=path['join'](_0x4de909,_0x360c61);var _0x10ed63=[];_0x10ed63[_0xc065('0x58')]({'model':db[_0xc065('0x59')],'as':'User','attributes':['id',_0xc065('0x5a')],'raw':!![]});_0x10ed63[_0xc065('0x58')]({'model':db[_0xc065('0x5b')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});var _0x4f68dc=[{'model':db[_0xc065('0x39')],'as':_0xc065('0x5c'),'attributes':['id',_0xc065('0x36'),'createdAt',_0xc065('0x5d'),_0xc065('0x5e'),'read'],'include':_0x10ed63}];_0x4f68dc[_0xc065('0x58')]({'model':db[_0xc065('0x5f')],'as':_0xc065('0x60'),'attributes':['id',_0xc065('0x61')]});_0x4f68dc['push']({'model':db[_0xc065('0x59')],'as':_0xc065('0x62'),'attributes':['id',_0xc065('0x5a')]});return db[_0xc065('0x29')][_0xc065('0x37')]({'where':{'id':_0x3321d1[_0xc065('0x28')]['id']},'include':_0x4f68dc})[_0xc065('0x1a')](handleEntityNotFound(_0x1acdd0,null))['then'](function(_0x10f01e){if(_0x10f01e){var _0x4cf083=_0x10f01e['get']({'plain':!![]});fs[_0xc065('0x63')](_0x224d8c);var _0x29a34a={'channel':_0xc065('0x64'),'account':_0x4cf083['Account']['name'],'agent':_0x4cf083[_0xc065('0x62')]?_0x4cf083[_0xc065('0x62')]['fullname']:_0xc065('0x65'),'createdAt':moment(_0x4cf083['createdAt'])[_0xc065('0x56')](_0xc065('0x66'))['toString'](),'closedAt':_0x4cf083[_0xc065('0x67')]?moment(_0x4cf083[_0xc065('0x68')])['format'](_0xc065('0x66'))['toString']():'','disposition':_0x4cf083['disposition'],'messages':_(_0x4cf083['Messages'])['filter']({'secret':![]})[_0xc065('0x1f')](function(_0x18ecf2){return{'date':moment(_0x18ecf2[_0xc065('0x69')])[_0xc065('0x56')](_0xc065('0x66'))['toString'](),'sender':_0x18ecf2[_0xc065('0x5d')]===_0xc065('0x6a')?_0x18ecf2[_0xc065('0x59')]?_0x18ecf2['User']['fullname']:_0xc065('0x6b'):_0x18ecf2[_0xc065('0x6c')][_0xc065('0x6d')]+(_0x18ecf2[_0xc065('0x6c')][_0xc065('0x6e')]?'\x20'+_0x18ecf2['Contact'][_0xc065('0x6e')]:''),'body':_0x18ecf2[_0xc065('0x36')],'direction':_0x18ecf2[_0xc065('0x5d')]===_0xc065('0x6a')?'A':'C','secret':_0x18ecf2['secret'],'read':_0x18ecf2[_0xc065('0x6f')]};})[_0xc065('0x70')]()};return ejs[_0xc065('0x71')](path[_0xc065('0x51')](config[_0xc065('0x52')],_0xc065('0x53'),_0xc065('0x72'),'downloadInteraction.ejs'),{'interaction':_0x29a34a})[_0xc065('0x1a')](function(_0x5360d9){var _0x17677c=path[_0xc065('0x51')](_0x224d8c,_0xc065('0x73')+_0x4cf083['id']+'-'+_0x318ef8+_0xc065('0x74'));var _0x400676={'path':_0x17677c,'channel':_0xc065('0x64'),'interactionId':_0x4cf083['id']};return pdf[_0xc065('0x75')](_0x5360d9,_0x400676);})[_0xc065('0x1a')](function(){return new BPromise(function(_0x436310,_0x5933e0){zipdir(_0x224d8c,{'saveTo':_0xc7ef8b},function(_0x4ef8b9,_0x38e8ac){if(_0x4ef8b9)return _0x5933e0(_0x4ef8b9);return _0x436310(_0x38e8ac);});})[_0xc065('0x1a')](function(){return new BPromise(function(_0x44c638,_0x4f0888){rimraf(_0x224d8c,function(_0xe5c125){if(_0xe5c125)_0x4f0888(_0xe5c125);return _0x44c638();});});})[_0xc065('0x1a')](function(){return _0x1acdd0['download'](_0xc7ef8b,_0x360c61,function(_0x557d7f){if(_0x557d7f){console[_0xc065('0x76')](_0xc065('0x77'),_0x557d7f);}else{fs['unlinkSync'](_0xc7ef8b);}});});});}else{return _0x1acdd0[_0xc065('0x11')](0xc8);}})[_0xc065('0x26')](handleError(_0x1acdd0,null));}; \ No newline at end of file +var _0xa759=['SmsInteraction','filters','intersection','attributes','fields','length','includeAll','include','options','create','body','find','describe','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','pick','where','SmsInteractionId','filter','merge','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','Tag','color','smsInteractionTags:save','download','root','server','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','createdAt','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','closedAt','toString','disposition','direction','out','Contact','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','../../components/interaction/service','../../components/export/pdf','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','undefined','offset','count','limit','Content-Range','json','update','then','destroy','end','error','stack','name','rawAttributes','fieldName','type','getOptions','query','catch','params','model','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa759,0xb5));var _0x9a75=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0xa759[_0x51ed62];return _0x34aee3;};'use strict';var rimraf=require(_0x9a75('0x0'));var zipdir=require(_0x9a75('0x1'));var moment=require(_0x9a75('0x2'));var BPromise=require(_0x9a75('0x3'));var util=require(_0x9a75('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x9a75('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x9a75('0x6'));var logger=require('../../config/logger')(_0x9a75('0x7'));var config=require('../../config/environment');var db=require(_0x9a75('0x8'))['db'];config[_0x9a75('0x9')]=_[_0x9a75('0xa')](config['redis'],{'host':_0x9a75('0xb'),'port':0x18eb});var socket=require(_0x9a75('0xc'))(new Redis(config[_0x9a75('0x9')]));require(_0x9a75('0xd'))[_0x9a75('0xe')](socket);function respondWithStatusCode(_0x47d6e5,_0x254ff1){_0x254ff1=_0x254ff1||0xcc;return function(_0x25781f){if(_0x25781f){return _0x47d6e5[_0x9a75('0xf')](_0x254ff1);}return _0x47d6e5[_0x9a75('0x10')](_0x254ff1)['end']();};}function respondWithResult(_0x7c312a,_0x2ee69f){_0x2ee69f=_0x2ee69f||0xc8;return function(_0x583873){if(_0x583873){return _0x7c312a[_0x9a75('0x10')](_0x2ee69f)['json'](_0x583873);}};}function respondWithFilteredResult(_0x69a4fa,_0x218675){return function(_0x53cae9){if(_0x53cae9){var _0x44593d=typeof _0x218675['offset']===_0x9a75('0x11')&&typeof _0x218675['limit']===_0x9a75('0x11');var _0x3ca830=_0x53cae9['count'];var _0x44b65e=_0x44593d?0x0:_0x218675[_0x9a75('0x12')];var _0x26d221=_0x44593d?_0x53cae9[_0x9a75('0x13')]:_0x218675[_0x9a75('0x12')]+_0x218675[_0x9a75('0x14')];var _0x1ece61;if(_0x26d221>=_0x3ca830){_0x26d221=_0x3ca830;_0x1ece61=0xc8;}else{_0x1ece61=0xce;}_0x69a4fa['status'](_0x1ece61);return _0x69a4fa['set'](_0x9a75('0x15'),_0x44b65e+'-'+_0x26d221+'/'+_0x3ca830)[_0x9a75('0x16')](_0x53cae9);}return null;};}function saveUpdates(_0x3683e9){return function(_0x37963d){if(_0x37963d){return _0x37963d[_0x9a75('0x17')](_0x3683e9)[_0x9a75('0x18')](function(_0x44d26f){return _0x44d26f;});}return null;};}function removeEntity(_0x4d0c7c){return function(_0x2f4f16){if(_0x2f4f16){return _0x2f4f16[_0x9a75('0x19')]()['then'](function(){_0x4d0c7c[_0x9a75('0x10')](0xcc)[_0x9a75('0x1a')]();});}};}function handleEntityNotFound(_0x4ab36a){return function(_0x5ebf56){if(!_0x5ebf56){_0x4ab36a['sendStatus'](0x194);}return _0x5ebf56;};}function handleError(_0x556524,_0xc0123e){_0xc0123e=_0xc0123e||0x1f4;return function(_0x2198b4){logger[_0x9a75('0x1b')](_0x2198b4[_0x9a75('0x1c')]);if(_0x2198b4[_0x9a75('0x1d')]){delete _0x2198b4[_0x9a75('0x1d')];}_0x556524[_0x9a75('0x10')](_0xc0123e)['send'](_0x2198b4);};}exports['index']=function(_0x47f4f9,_0x278eaa){var _0x10163c={};var _0x3466f0=_['map'](db['SmsInteraction'][_0x9a75('0x1e')],function(_0x24447e){return{'name':_0x24447e[_0x9a75('0x1f')],'type':_0x24447e[_0x9a75('0x20')]['key']};});_0x10163c=qs[_0x9a75('0x21')](_0x3466f0,_0x47f4f9);return interaction['findAll']('sms',_0x47f4f9[_0x9a75('0x22')],_0x47f4f9['user'],_0x10163c,_0x3466f0)['then'](respondWithFilteredResult(_0x278eaa,_0x10163c))[_0x9a75('0x23')](handleError(_0x278eaa,null));};exports['show']=function(_0xf87397,_0x4a129e){var _0x5c16d7={'raw':![],'where':{'id':_0xf87397[_0x9a75('0x24')]['id']}},_0x289c7d={};_0x289c7d[_0x9a75('0x25')]=_[_0x9a75('0x26')](db[_0x9a75('0x27')]['rawAttributes']);_0x289c7d[_0x9a75('0x22')]=_[_0x9a75('0x26')](_0xf87397[_0x9a75('0x22')]);_0x289c7d[_0x9a75('0x28')]=_[_0x9a75('0x29')](_0x289c7d['model'],_0x289c7d[_0x9a75('0x22')]);_0x5c16d7[_0x9a75('0x2a')]=_[_0x9a75('0x29')](_0x289c7d[_0x9a75('0x25')],qs[_0x9a75('0x2b')](_0xf87397[_0x9a75('0x22')]['fields']));_0x5c16d7['attributes']=_0x5c16d7[_0x9a75('0x2a')][_0x9a75('0x2c')]?_0x5c16d7['attributes']:_0x289c7d[_0x9a75('0x25')];if(_0xf87397[_0x9a75('0x22')][_0x9a75('0x2d')]){_0x5c16d7[_0x9a75('0x2e')]=[{'all':!![]}];}_0x5c16d7=_['merge']({},_0x5c16d7,_0xf87397[_0x9a75('0x2f')]);return db['SmsInteraction']['find'](_0x5c16d7)[_0x9a75('0x18')](handleEntityNotFound(_0x4a129e,null))[_0x9a75('0x18')](respondWithResult(_0x4a129e,null))[_0x9a75('0x23')](handleError(_0x4a129e,null));};exports[_0x9a75('0x30')]=function(_0x1e3c05,_0x22f474){return db[_0x9a75('0x27')]['create'](_0x1e3c05[_0x9a75('0x31')],{})[_0x9a75('0x18')](respondWithResult(_0x22f474,0xc9))[_0x9a75('0x23')](handleError(_0x22f474,null));};exports[_0x9a75('0x17')]=function(_0x30c8e1,_0xf0b829){if(_0x30c8e1[_0x9a75('0x31')]['id']){delete _0x30c8e1[_0x9a75('0x31')]['id'];}return db[_0x9a75('0x27')][_0x9a75('0x32')]({'where':{'id':_0x30c8e1['params']['id']}})[_0x9a75('0x18')](handleEntityNotFound(_0xf0b829,null))[_0x9a75('0x18')](saveUpdates(_0x30c8e1[_0x9a75('0x31')],null))[_0x9a75('0x18')](respondWithResult(_0xf0b829,null))['catch'](handleError(_0xf0b829,null));};exports[_0x9a75('0x19')]=function(_0xbbb7bd,_0x1730b8){return db['SmsInteraction']['find']({'where':{'id':_0xbbb7bd[_0x9a75('0x24')]['id']}})[_0x9a75('0x18')](handleEntityNotFound(_0x1730b8,null))[_0x9a75('0x18')](removeEntity(_0x1730b8,null))[_0x9a75('0x23')](handleError(_0x1730b8,null));};exports[_0x9a75('0x33')]=function(_0x4ae269,_0x313522){return db[_0x9a75('0x27')]['describe']()[_0x9a75('0x18')](respondWithResult(_0x313522,null))[_0x9a75('0x23')](handleError(_0x313522,null));};exports['addMessage']=function(_0x23881e,_0x13a247){return db[_0x9a75('0x34')][_0x9a75('0x32')]({'where':{'id':_0x23881e['params']['id']}})[_0x9a75('0x18')](handleEntityNotFound(_0x13a247,null))[_0x9a75('0x18')](function(_0xd140f1){if(_0xd140f1){return _0xd140f1['addMessage'](_0x23881e[_0x9a75('0x31')][_0x9a75('0x35')],_[_0x9a75('0x36')](_0x23881e['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x13a247,null))[_0x9a75('0x23')](handleError(_0x13a247,null));};exports[_0x9a75('0x37')]=function(_0x22a38e,_0x3b27ca){var _0x461b88={'raw':![],'where':{}};var _0x4ef3b4={};var _0x19ce50={'count':0x0,'rows':[]};return db[_0x9a75('0x27')][_0x9a75('0x38')]({'where':{'id':_0x22a38e['params']['id']}})[_0x9a75('0x18')](handleEntityNotFound(_0x3b27ca,null))[_0x9a75('0x18')](function(_0x29ce31){if(_0x29ce31){_0x4ef3b4[_0x9a75('0x25')]=_[_0x9a75('0x26')](db[_0x9a75('0x34')][_0x9a75('0x1e')]);_0x4ef3b4[_0x9a75('0x22')]=_[_0x9a75('0x26')](_0x22a38e['query']);_0x4ef3b4[_0x9a75('0x28')]=_[_0x9a75('0x29')](_0x4ef3b4['model'],_0x4ef3b4[_0x9a75('0x22')]);_0x461b88[_0x9a75('0x2a')]=_[_0x9a75('0x29')](_0x4ef3b4[_0x9a75('0x25')],qs['fields'](_0x22a38e[_0x9a75('0x22')][_0x9a75('0x2b')]));_0x461b88['attributes']=_0x461b88[_0x9a75('0x2a')]['length']?_0x461b88[_0x9a75('0x2a')]:_0x4ef3b4[_0x9a75('0x25')];if(!_0x22a38e[_0x9a75('0x22')][_0x9a75('0x39')](_0x9a75('0x3a'))){_0x461b88[_0x9a75('0x14')]=qs['limit'](_0x22a38e[_0x9a75('0x22')][_0x9a75('0x14')]);_0x461b88[_0x9a75('0x12')]=qs[_0x9a75('0x12')](_0x22a38e[_0x9a75('0x22')][_0x9a75('0x12')]);}_0x461b88['order']=qs['sort'](_0x22a38e['query'][_0x9a75('0x3b')]);_0x461b88['where']=qs[_0x9a75('0x28')](_[_0x9a75('0x3c')](_0x22a38e[_0x9a75('0x22')],_0x4ef3b4[_0x9a75('0x28')]));_0x461b88[_0x9a75('0x3d')][_0x9a75('0x3e')]=_0x29ce31['id'];if(_0x22a38e['query'][_0x9a75('0x3f')]){_0x461b88[_0x9a75('0x3d')]=_[_0x9a75('0x40')](_0x461b88[_0x9a75('0x3d')],{'$or':_[_0x9a75('0x41')](_0x461b88['attributes'],function(_0x1a02ab){var _0x1a1290={};_0x1a1290[_0x1a02ab]={'$like':'%'+_0x22a38e['query'][_0x9a75('0x3f')]+'%'};return _0x1a1290;})});}if(_0x22a38e[_0x9a75('0x22')][_0x9a75('0x42')]){var _0xb2efe9=_0x22a38e[_0x9a75('0x22')]['$gte'][_0x9a75('0x43')](',');var _0x322290={};_0x322290[_0xb2efe9[0x0]]={'$gte':moment(_0xb2efe9[0x1])[_0x9a75('0x44')](_0x9a75('0x45'))};_0x461b88[_0x9a75('0x3d')]=_['merge'](_0x461b88['where'],_0x322290);}_0x461b88=_[_0x9a75('0x40')]({},_0x461b88,_0x22a38e['options']);return db[_0x9a75('0x34')]['count']({'where':_0x461b88[_0x9a75('0x3d')]})['then'](function(_0x2e954c){_0x19ce50[_0x9a75('0x13')]=_0x2e954c;if(_0x22a38e[_0x9a75('0x22')][_0x9a75('0x2d')]){_0x461b88[_0x9a75('0x2e')]=[{'all':!![]}];}return db[_0x9a75('0x34')][_0x9a75('0x46')](_0x461b88);})['then'](function(_0x492ec0){_0x19ce50['rows']=_0x492ec0;return _0x19ce50;});}})[_0x9a75('0x18')](respondWithFilteredResult(_0x3b27ca,_0x461b88))[_0x9a75('0x23')](handleError(_0x3b27ca,null));};exports['addTags']=function(_0x2d37a9,_0x1bb053){return db[_0x9a75('0x27')][_0x9a75('0x32')]({'where':{'id':_0x2d37a9[_0x9a75('0x24')]['id']}})[_0x9a75('0x18')](handleEntityNotFound(_0x1bb053,null))[_0x9a75('0x18')](function(_0x5796a5){if(_0x5796a5){return _0x5796a5['setTags'](_0x2d37a9[_0x9a75('0x31')][_0x9a75('0x35')],_[_0x9a75('0x36')](_0x2d37a9['body'],[_0x9a75('0x35'),'id'])||{})[_0x9a75('0x47')](function(){return db[_0x9a75('0x48')]['findAll']({'attributes':['id','name',_0x9a75('0x49')],'where':{'id':_0x2d37a9[_0x9a75('0x31')][_0x9a75('0x35')]}});})[_0x9a75('0x18')](function(_0x40f5a0){socket['emit'](_0x9a75('0x4a'),{'id':Number(_0x2d37a9[_0x9a75('0x24')]['id']),'tags':_0x40f5a0||[]});return{'id':Number(_0x2d37a9[_0x9a75('0x24')]['id']),'tags':_0x40f5a0||[]};});}})[_0x9a75('0x18')](respondWithResult(_0x1bb053,null))[_0x9a75('0x23')](handleError(_0x1bb053,null));};exports['removeTags']=function(_0x2dbdfe,_0x1247b7){return db[_0x9a75('0x27')][_0x9a75('0x32')]({'where':{'id':_0x2dbdfe[_0x9a75('0x24')]['id']}})[_0x9a75('0x18')](handleEntityNotFound(_0x1247b7,null))['then'](function(_0x3a3c14){if(_0x3a3c14){return _0x3a3c14['removeTags'](_0x2dbdfe[_0x9a75('0x22')][_0x9a75('0x35')]);}})[_0x9a75('0x18')](respondWithStatusCode(_0x1247b7,null))[_0x9a75('0x23')](handleError(_0x1247b7,null));};exports[_0x9a75('0x4b')]=function(_0x22f9a4,_0x268479){var _0x1afee0=moment()['unix']()['toString']();var _0x18e707=path['join'](config[_0x9a75('0x4c')],_0x9a75('0x4d'),'files',_0x9a75('0x4e'));var _0x478cad=path[_0x9a75('0x4f')](_0x18e707,_0x1afee0);var _0x468fb6=util[_0x9a75('0x44')](_0x9a75('0x50'),_0x22f9a4[_0x9a75('0x24')]['id'],_0x1afee0);var _0x15339c=path[_0x9a75('0x4f')](_0x18e707,_0x468fb6);var _0xc0f979=[];_0xc0f979[_0x9a75('0x51')]({'model':db[_0x9a75('0x52')],'as':'User','attributes':['id',_0x9a75('0x53')],'raw':!![]});_0xc0f979[_0x9a75('0x51')]({'model':db[_0x9a75('0x54')],'as':'Contact','attributes':['id',_0x9a75('0x55'),_0x9a75('0x56')],'raw':!![]});var _0x5e095a=[{'model':db[_0x9a75('0x34')],'as':'Messages','attributes':['id',_0x9a75('0x31'),_0x9a75('0x57'),'direction',_0x9a75('0x58'),_0x9a75('0x59')],'include':_0xc0f979}];_0x5e095a[_0x9a75('0x51')]({'model':db[_0x9a75('0x5a')],'as':_0x9a75('0x5b'),'attributes':['id',_0x9a75('0x1d')]});_0x5e095a[_0x9a75('0x51')]({'model':db['User'],'as':_0x9a75('0x5c'),'attributes':['id',_0x9a75('0x53')]});return db['SmsInteraction']['find']({'where':{'id':_0x22f9a4['params']['id']},'include':_0x5e095a})[_0x9a75('0x18')](handleEntityNotFound(_0x268479,null))[_0x9a75('0x18')](function(_0xfd455a){if(_0xfd455a){var _0x343eaa=_0xfd455a[_0x9a75('0x5d')]({'plain':!![]});fs[_0x9a75('0x5e')](_0x478cad);var _0x1bd228={'channel':_0x9a75('0x5f'),'account':_0x343eaa[_0x9a75('0x5b')]['name'],'agent':_0x343eaa[_0x9a75('0x5c')]?_0x343eaa['Owner'][_0x9a75('0x53')]:'N.A.','createdAt':moment(_0x343eaa[_0x9a75('0x57')])[_0x9a75('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x343eaa['closed']?moment(_0x343eaa[_0x9a75('0x60')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x9a75('0x61')]():'','disposition':_0x343eaa[_0x9a75('0x62')],'messages':_(_0x343eaa['Messages'])[_0x9a75('0x3f')]({'secret':![]})[_0x9a75('0x41')](function(_0x1174c2){return{'date':moment(_0x1174c2[_0x9a75('0x57')])[_0x9a75('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x1174c2[_0x9a75('0x63')]===_0x9a75('0x64')?_0x1174c2[_0x9a75('0x52')]?_0x1174c2['User'][_0x9a75('0x53')]:'System':_0x1174c2[_0x9a75('0x65')][_0x9a75('0x55')]+(_0x1174c2[_0x9a75('0x65')]['lastName']?'\x20'+_0x1174c2['Contact'][_0x9a75('0x56')]:''),'body':_0x1174c2[_0x9a75('0x31')],'direction':_0x1174c2[_0x9a75('0x63')]===_0x9a75('0x64')?'A':'C','secret':_0x1174c2[_0x9a75('0x58')],'read':_0x1174c2[_0x9a75('0x59')]};})[_0x9a75('0x66')]()};return ejs[_0x9a75('0x67')](path['join'](config[_0x9a75('0x4c')],'server','views',_0x9a75('0x68')),{'interaction':_0x1bd228})[_0x9a75('0x18')](function(_0x361e05){var _0x1403c8=path[_0x9a75('0x4f')](_0x478cad,'transcript-'+_0x343eaa['id']+'-'+_0x1afee0+_0x9a75('0x69'));var _0x3ee538={'path':_0x1403c8,'channel':_0x9a75('0x5f'),'interactionId':_0x343eaa['id']};return pdf[_0x9a75('0x6a')](_0x361e05,_0x3ee538);})[_0x9a75('0x18')](function(){return new BPromise(function(_0x525831,_0x595e59){zipdir(_0x478cad,{'saveTo':_0x15339c},function(_0x9ac7f7,_0x55305f){if(_0x9ac7f7)return _0x595e59(_0x9ac7f7);return _0x525831(_0x55305f);});})[_0x9a75('0x18')](function(){return new BPromise(function(_0x5c62db,_0xe62b36){rimraf(_0x478cad,function(_0x59ce01){if(_0x59ce01)_0xe62b36(_0x59ce01);return _0x5c62db();});});})['then'](function(){return _0x268479[_0x9a75('0x4b')](_0x15339c,_0x468fb6,function(_0x50353f){if(_0x50353f){console[_0x9a75('0x6b')](_0x9a75('0x6c'),_0x50353f);}else{fs[_0x9a75('0x6d')](_0x15339c);}});});});}else{return _0x268479['sendStatus'](0xc8);}})[_0x9a75('0x23')](handleError(_0x268479,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index bf64524..45adc95 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 _0x958a=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users'];(function(_0xfa0d38,_0x29146c){var _0x497972=function(_0x46e627){while(--_0x46e627){_0xfa0d38['push'](_0xfa0d38['shift']());}};_0x497972(++_0x29146c);}(_0x958a,0x128));var _0xa958=function(_0x483a29,_0x35cdcd){_0x483a29=_0x483a29-0x0;var _0xf63691=_0x958a[_0x483a29];return _0xf63691;};'use strict';var EventEmitter=require(_0xa958('0x0'));var SmsInteraction=require(_0xa958('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xa958('0x1'))['db'][_0xa958('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa958('0x3')](0x0);var events={'afterCreate':_0xa958('0x4'),'afterUpdate':_0xa958('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3424b0){return function(_0x578481,_0x2024b8,_0x9b7d9e){_0x578481[_0xa958('0x6')]({'attributes':['id'],'raw':!![]})[_0xa958('0x7')](function(_0x3ca01f){_0x578481[_0xa958('0x8')](_0xa958('0x9'),_0x3ca01f['map'](function(_0x514b4f){return{'id':_0x514b4f['id']};}));return SmsMessage[_0xa958('0xa')]({'where':{'SmsInteractionId':_0x578481['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa958('0x7')](function(_0x11f090){_0x578481[_0xa958('0x8')](_0xa958('0xb'),_0x11f090[_0xa958('0xc')]);SmsInteractionEvents[_0xa958('0xd')](_0x3424b0+':'+_0x578481['id'],_0x578481);SmsInteractionEvents[_0xa958('0xd')](_0x3424b0,_0x578481);_0x9b7d9e(null);})[_0xa958('0xe')](_0x9b7d9e(null));};}for(var e in events){if(events[_0xa958('0xf')](e)){var event=events[e];SmsInteraction[_0xa958('0x10')](e,emitEvent(event));}}module[_0xa958('0x11')]=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(_0x71bb9e,_0x4a109b){var _0x3c0a4f=function(_0x51415b){while(--_0x51415b){_0x71bb9e['push'](_0x71bb9e['shift']());}};_0x3c0a4f(++_0x4a109b);}(_0x4888,0x198));var _0x8488=function(_0x5d0725,_0x1ae8ad){_0x5d0725=_0x5d0725-0x0;var _0x157c30=_0x4888[_0x5d0725];return _0x157c30;};'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 9579480..1773c8b 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 _0x5620=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x631e63,_0x334a4a){var _0x30d1ea=function(_0x519ccc){while(--_0x519ccc){_0x631e63['push'](_0x631e63['shift']());}};_0x30d1ea(++_0x334a4a);}(_0x5620,0xee));var _0x0562=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0x5620[_0x312abc];return _0x314298;};'use strict';var _=require(_0x0562('0x0'));var util=require(_0x0562('0x1'));var logger=require(_0x0562('0x2'))(_0x0562('0x3'));var moment=require(_0x0562('0x4'));var BPromise=require('bluebird');var rp=require(_0x0562('0x5'));var fs=require('fs');var path=require(_0x0562('0x6'));var rimraf=require(_0x0562('0x7'));var config=require(_0x0562('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x0562('0x9')]=function(_0x5b3ac3,_0x67f9cf){return _0x5b3ac3[_0x0562('0xa')](_0x0562('0xb'),attributes,{'tableName':_0x0562('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49852f,_0x1222bf,_0xbfab94){if(_0x49852f[_0x0562('0xd')](_0x0562('0xe'))){_0x49852f[_0x0562('0xf')]=moment()[_0x0562('0x10')](_0x0562('0x11'));}_0xbfab94(null,_0x49852f);}}});}; \ No newline at end of file +var _0x8bcb=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','./smsInteraction.attributes','exports','define','sms_interactions'];(function(_0x312216,_0x3d0839){var _0x1d2cf4=function(_0x52e34d){while(--_0x52e34d){_0x312216['push'](_0x312216['shift']());}};_0x1d2cf4(++_0x3d0839);}(_0x8bcb,0x95));var _0xb8bc=function(_0x352f85,_0x3382bf){_0x352f85=_0x352f85-0x0;var _0x2f2f6d=_0x8bcb[_0x352f85];return _0x2f2f6d;};'use strict';var _=require(_0xb8bc('0x0'));var util=require(_0xb8bc('0x1'));var logger=require(_0xb8bc('0x2'))(_0xb8bc('0x3'));var moment=require('moment');var BPromise=require(_0xb8bc('0x4'));var rp=require(_0xb8bc('0x5'));var fs=require('fs');var path=require(_0xb8bc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb8bc('0x7'));module[_0xb8bc('0x8')]=function(_0x503b67,_0xc6c882){return _0x503b67[_0xb8bc('0x9')]('SmsInteraction',attributes,{'tableName':_0xb8bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27f976,_0x93bc21,_0x43d337){if(_0x27f976[_0xb8bc('0xb')](_0xb8bc('0xc'))){_0x27f976[_0xb8bc('0xd')]=moment()[_0xb8bc('0xe')](_0xb8bc('0xf'));}_0x43d337(null,_0x27f976);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 81559e4..43e3fd1 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 _0xeccf=['defaults','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','SmsInteraction','body','options','where','attributes','UpdateSmsInteraction','stringify','AddTagsToSmsInteraction','find','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xeccf,0xfe));var _0xfecc=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0xeccf[_0x2298f0];return _0x39b136;};'use strict';var _=require(_0xfecc('0x0'));var util=require('util');var moment=require(_0xfecc('0x1'));var BPromise=require(_0xfecc('0x2'));var rs=require(_0xfecc('0x3'));var fs=require('fs');var Redis=require(_0xfecc('0x4'));var db=require(_0xfecc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfecc('0x6'));var config=require(_0xfecc('0x7'));var jayson=require(_0xfecc('0x8'));var client=jayson[_0xfecc('0x9')][_0xfecc('0xa')]({'port':0x232a});config[_0xfecc('0xb')]=_[_0xfecc('0xc')](config[_0xfecc('0xb')],{'host':_0xfecc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfecc('0xb')]));require(_0xfecc('0xe'))['register'](socket);function respondWithRpcPromise(_0x457ba0,_0x1a8c22,_0x5f0ad8){return new BPromise(function(_0x5ef217,_0x282be6){return client[_0xfecc('0xf')](_0x457ba0,_0x5f0ad8)[_0xfecc('0x10')](function(_0x4e5229){logger[_0xfecc('0x11')](_0xfecc('0x12'),_0x1a8c22,'request\x20sent');logger[_0xfecc('0x13')](_0xfecc('0x14'),_0x1a8c22,'request\x20sent',JSON['stringify'](_0x4e5229));if(_0x4e5229[_0xfecc('0x15')]){if(_0x4e5229[_0xfecc('0x15')][_0xfecc('0x16')]===0x1f4){logger[_0xfecc('0x15')](_0xfecc('0x12'),_0x1a8c22,_0x4e5229[_0xfecc('0x15')]['message']);return _0x282be6(_0x4e5229[_0xfecc('0x15')][_0xfecc('0x17')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x1a8c22,_0x4e5229[_0xfecc('0x15')][_0xfecc('0x17')]);return _0x5ef217(_0x4e5229[_0xfecc('0x15')][_0xfecc('0x17')]);}else{logger[_0xfecc('0x11')](_0xfecc('0x12'),_0x1a8c22,_0xfecc('0x18'));_0x5ef217(_0x4e5229[_0xfecc('0x19')]['message']);}})[_0xfecc('0x1a')](function(_0x2699d1){logger[_0xfecc('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x1a8c22,_0x2699d1);_0x282be6(_0x2699d1);});});}exports['UpdateSmsInteraction']=function(_0x25699){var _0x5803f1=this;return new Promise(function(_0x4a03df,_0x1973db){return db[_0xfecc('0x1b')]['update'](_0x25699[_0xfecc('0x1c')],{'raw':_0x25699[_0xfecc('0x1d')]?_0x25699[_0xfecc('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25699[_0xfecc('0x1d')]?_0x25699[_0xfecc('0x1d')][_0xfecc('0x1e')]||null:null,'attributes':_0x25699[_0xfecc('0x1d')]?_0x25699['options'][_0xfecc('0x1f')]||null:null,'limit':_0x25699[_0xfecc('0x1d')]?_0x25699[_0xfecc('0x1d')]['limit']||null:null})['then'](function(_0x761731){logger[_0xfecc('0x11')](_0xfecc('0x20'),_0x25699);logger['debug'](_0xfecc('0x20'),_0x25699,JSON[_0xfecc('0x21')](_0x761731));_0x4a03df(_0x761731);})[_0xfecc('0x1a')](function(_0x15c0bd){logger[_0xfecc('0x15')](_0xfecc('0x20'),_0x15c0bd['message'],_0x25699);_0x1973db(_0x5803f1[_0xfecc('0x15')](0x1f4,_0x15c0bd['message']));});});};exports[_0xfecc('0x22')]=function(_0x2ff6b7){return new Promise(function(_0xd154e5,_0x43d973){return db[_0xfecc('0x1b')][_0xfecc('0x23')]({'where':_0x2ff6b7[_0xfecc('0x1d')]?_0x2ff6b7[_0xfecc('0x1d')][_0xfecc('0x1e')]||null:null})[_0xfecc('0x10')](function(_0x201539){if(_0x201539){return _0x201539['addTags'](_0x2ff6b7[_0xfecc('0x1c')]['ids'],_['omit'](_0x2ff6b7[_0xfecc('0x1c')],[_0xfecc('0x24'),'id'])||{});}})['spread'](function(_0x4da980){logger[_0xfecc('0x11')](_0xfecc('0x25'),_0x2ff6b7);logger[_0xfecc('0x13')](_0xfecc('0x25'),_0x2ff6b7,JSON[_0xfecc('0x21')](_0x4da980));_0xd154e5(_0x4da980);})[_0xfecc('0x1a')](function(_0x2b4144){logger[_0xfecc('0x15')](_0xfecc('0x25'),_0x2b4144[_0xfecc('0x17')],_0x2ff6b7);_0x43d973(_this[_0xfecc('0x15')](0x1f4,_0x2b4144[_0xfecc('0x17')]));});});}; \ No newline at end of file +var _0xf08c=['attributes','limit','then','stringify','AddTagsToSmsInteraction','find','where','addTags','omit','body','ids','spread','AddTags','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsInteraction.socket','request','info','SmsInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','UpdateSmsInteraction','SmsInteraction','update','options','raw'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0xf08c,0xb6));var _0xcf08=function(_0x3845c7,_0x450db5){_0x3845c7=_0x3845c7-0x0;var _0x5a7de3=_0xf08c[_0x3845c7];return _0x5a7de3;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var moment=require('moment');var BPromise=require(_0xcf08('0x2'));var rs=require(_0xcf08('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf08('0x4'))['db'];var utils=require(_0xcf08('0x5'));var logger=require('../../config/logger')(_0xcf08('0x6'));var config=require(_0xcf08('0x7'));var jayson=require(_0xcf08('0x8'));var client=jayson[_0xcf08('0x9')][_0xcf08('0xa')]({'port':0x232a});config[_0xcf08('0xb')]=_['defaults'](config[_0xcf08('0xb')],{'host':_0xcf08('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf08('0xb')]));require(_0xcf08('0xd'))['register'](socket);function respondWithRpcPromise(_0x2fc301,_0x3653ad,_0x1357bc){return new BPromise(function(_0x3c3754,_0x4a7a45){return client[_0xcf08('0xe')](_0x2fc301,_0x1357bc)['then'](function(_0x5cce41){logger[_0xcf08('0xf')](_0xcf08('0x10'),_0x3653ad,'request\x20sent');logger[_0xcf08('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3653ad,_0xcf08('0x12'),JSON['stringify'](_0x5cce41));if(_0x5cce41['error']){if(_0x5cce41[_0xcf08('0x13')][_0xcf08('0x14')]===0x1f4){logger[_0xcf08('0x13')](_0xcf08('0x10'),_0x3653ad,_0x5cce41[_0xcf08('0x13')]['message']);return _0x4a7a45(_0x5cce41['error'][_0xcf08('0x15')]);}logger[_0xcf08('0x13')](_0xcf08('0x10'),_0x3653ad,_0x5cce41[_0xcf08('0x13')][_0xcf08('0x15')]);return _0x3c3754(_0x5cce41[_0xcf08('0x13')][_0xcf08('0x15')]);}else{logger[_0xcf08('0xf')](_0xcf08('0x10'),_0x3653ad,_0xcf08('0x12'));_0x3c3754(_0x5cce41[_0xcf08('0x16')][_0xcf08('0x15')]);}})['catch'](function(_0x3d3cf1){logger[_0xcf08('0x13')](_0xcf08('0x10'),_0x3653ad,_0x3d3cf1);_0x4a7a45(_0x3d3cf1);});});}exports[_0xcf08('0x17')]=function(_0x162f6f){var _0x1984c8=this;return new Promise(function(_0xd6cb1e,_0x28befc){return db[_0xcf08('0x18')][_0xcf08('0x19')](_0x162f6f['body'],{'raw':_0x162f6f['options']?_0x162f6f[_0xcf08('0x1a')][_0xcf08('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x162f6f['options']?_0x162f6f['options']['where']||null:null,'attributes':_0x162f6f[_0xcf08('0x1a')]?_0x162f6f[_0xcf08('0x1a')][_0xcf08('0x1c')]||null:null,'limit':_0x162f6f[_0xcf08('0x1a')]?_0x162f6f[_0xcf08('0x1a')][_0xcf08('0x1d')]||null:null})[_0xcf08('0x1e')](function(_0x4a68d8){logger[_0xcf08('0xf')]('UpdateSmsInteraction',_0x162f6f);logger[_0xcf08('0x11')](_0xcf08('0x17'),_0x162f6f,JSON[_0xcf08('0x1f')](_0x4a68d8));_0xd6cb1e(_0x4a68d8);})['catch'](function(_0x2d1d93){logger[_0xcf08('0x13')](_0xcf08('0x17'),_0x2d1d93[_0xcf08('0x15')],_0x162f6f);_0x28befc(_0x1984c8[_0xcf08('0x13')](0x1f4,_0x2d1d93['message']));});});};exports[_0xcf08('0x20')]=function(_0x2fb0be){return new Promise(function(_0x4c880c,_0x24c6db){return db[_0xcf08('0x18')][_0xcf08('0x21')]({'where':_0x2fb0be['options']?_0x2fb0be[_0xcf08('0x1a')][_0xcf08('0x22')]||null:null})[_0xcf08('0x1e')](function(_0x460697){if(_0x460697){return _0x460697[_0xcf08('0x23')](_0x2fb0be['body']['ids'],_[_0xcf08('0x24')](_0x2fb0be[_0xcf08('0x25')],[_0xcf08('0x26'),'id'])||{});}})[_0xcf08('0x27')](function(_0xd43a19){logger[_0xcf08('0xf')](_0xcf08('0x28'),_0x2fb0be);logger[_0xcf08('0x11')](_0xcf08('0x28'),_0x2fb0be,JSON[_0xcf08('0x1f')](_0xd43a19));_0x4c880c(_0xd43a19);})[_0xcf08('0x29')](function(_0x69f46c){logger['error'](_0xcf08('0x28'),_0x69f46c[_0xcf08('0x15')],_0x2fb0be);_0x24c6db(_this[_0xcf08('0x13')](0x1f4,_0x69f46c['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 3db5f7c..67c07ab 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 _0xfadc=['save','remove','update','emit','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfadc,0xb7));var _0xcfad=function(_0x103c7b,_0xef999c){_0x103c7b=_0x103c7b-0x0;var _0x5af486=_0xfadc[_0x103c7b];return _0x5af486;};'use strict';var SmsInteractionEvents=require(_0xcfad('0x0'));var events=[_0xcfad('0x1'),_0xcfad('0x2'),_0xcfad('0x3')];function createListener(_0x185912,_0x31454e){return function(_0x5d62dd){_0x31454e[_0xcfad('0x4')](_0x185912,_0x5d62dd);};}function removeListener(_0x320444,_0x6b75c4){return function(){SmsInteractionEvents[_0xcfad('0x5')](_0x320444,_0x6b75c4);};}exports['register']=function(_0x4d2d8b){for(var _0x3e586c=0x0,_0x1da68e=events[_0xcfad('0x6')];_0x3e586c<_0x1da68e;_0x3e586c++){var _0x22fc57=events[_0x3e586c];var _0x1baefa=createListener(_0xcfad('0x7')+_0x22fc57,_0x4d2d8b);SmsInteractionEvents['on'](_0x22fc57,_0x1baefa);}}; \ No newline at end of file +var _0xa8ba=['./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x367a3d,_0x452717){var _0x460539=function(_0x1e8beb){while(--_0x1e8beb){_0x367a3d['push'](_0x367a3d['shift']());}};_0x460539(++_0x452717);}(_0xa8ba,0xf5));var _0xaa8b=function(_0x52b3c5,_0x13d82d){_0x52b3c5=_0x52b3c5-0x0;var _0x1cd43f=_0xa8ba[_0x52b3c5];return _0x1cd43f;};'use strict';var SmsInteractionEvents=require(_0xaa8b('0x0'));var events=[_0xaa8b('0x1'),_0xaa8b('0x2'),_0xaa8b('0x3')];function createListener(_0x59535c,_0x1ee5c7){return function(_0x4e2d81){_0x1ee5c7[_0xaa8b('0x4')](_0x59535c,_0x4e2d81);};}function removeListener(_0x29e9e1,_0x4480c6){return function(){SmsInteractionEvents[_0xaa8b('0x5')](_0x29e9e1,_0x4480c6);};}exports[_0xaa8b('0x6')]=function(_0x16410a){for(var _0x4cd6ab=0x0,_0x564b4a=events['length'];_0x4cd6ab<_0x564b4a;_0x4cd6ab++){var _0x1ff531=events[_0x4cd6ab];var _0x32f3b5=createListener('smsInteraction:'+_0x1ff531,_0x16410a);SmsInteractionEvents['on'](_0x1ff531,_0x32f3b5);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 41070ae..5f47dc6 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 _0xeaef=['/:id','show','post','smsmessage:create','/:id/status','update','/:id/accept','put','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x38a73d,_0x24cd19){var _0x23d335=function(_0x1fef0f){while(--_0x1fef0f){_0x38a73d['push'](_0x38a73d['shift']());}};_0x23d335(++_0x24cd19);}(_0xeaef,0xfb));var _0xfeae=function(_0x10c2a9,_0x1014e0){_0x10c2a9=_0x10c2a9-0x0;var _0x2b1187=_0xeaef[_0x10c2a9];return _0x2b1187;};'use strict';var multer=require(_0xfeae('0x0'));var util=require(_0xfeae('0x1'));var path=require(_0xfeae('0x2'));var timeout=require(_0xfeae('0x3'));var express=require(_0xfeae('0x4'));var router=express[_0xfeae('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfeae('0x6'));var interaction=require(_0xfeae('0x7'));var config=require(_0xfeae('0x8'));var controller=require('./smsMessage.controller');router[_0xfeae('0x9')]('/',auth[_0xfeae('0xa')](),controller[_0xfeae('0xb')]);router[_0xfeae('0x9')](_0xfeae('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfeae('0xd'),auth[_0xfeae('0xa')](),controller[_0xfeae('0xe')]);router[_0xfeae('0xf')]('/',auth['isAuthenticated'](),interaction['tracked']('sms',_0xfeae('0x10')),controller['create']);router['post'](_0xfeae('0x11'),controller['status']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfeae('0x12')]);router['put'](_0xfeae('0x13'),auth['isAuthenticated'](),controller['accept']);router[_0xfeae('0x14')](_0xfeae('0x15'),auth[_0xfeae('0xa')](),controller['reject']);router[_0xfeae('0x16')](_0xfeae('0xd'),auth[_0xfeae('0xa')](),controller[_0xfeae('0x17')]);module['exports']=router; \ No newline at end of file +var _0x77f1=['destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','tracked','smsmessage:create','create','post','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x5158e6,_0x1361b4){var _0x5f2328=function(_0x1539c6){while(--_0x1539c6){_0x5158e6['push'](_0x5158e6['shift']());}};_0x5f2328(++_0x1361b4);}(_0x77f1,0x1dd));var _0x177f=function(_0x31fd1a,_0x1b25dc){_0x31fd1a=_0x31fd1a-0x0;var _0x59af15=_0x77f1[_0x31fd1a];return _0x59af15;};'use strict';var multer=require('multer');var util=require(_0x177f('0x0'));var path=require(_0x177f('0x1'));var timeout=require(_0x177f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x177f('0x3'));var interaction=require(_0x177f('0x4'));var config=require('../../config/environment');var controller=require(_0x177f('0x5'));router[_0x177f('0x6')]('/',auth[_0x177f('0x7')](),controller[_0x177f('0x8')]);router[_0x177f('0x6')]('/describe',auth[_0x177f('0x7')](),controller[_0x177f('0x9')]);router['get'](_0x177f('0xa'),auth['isAuthenticated'](),controller[_0x177f('0xb')]);router['post']('/',auth[_0x177f('0x7')](),interaction[_0x177f('0xc')]('sms',_0x177f('0xd')),controller[_0x177f('0xe')]);router[_0x177f('0xf')](_0x177f('0x10'),controller[_0x177f('0x11')]);router[_0x177f('0x12')](_0x177f('0xa'),auth[_0x177f('0x7')](),controller['update']);router[_0x177f('0x12')](_0x177f('0x13'),auth[_0x177f('0x7')](),controller[_0x177f('0x14')]);router['put'](_0x177f('0x15'),auth[_0x177f('0x7')](),controller[_0x177f('0x16')]);router['delete']('/:id',auth[_0x177f('0x7')](),controller[_0x177f('0x17')]);module[_0x177f('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index c473a4b..fbc00fd 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 _0xb70a=['out','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x2fe58d,_0x36c8da){var _0x2d7de1=function(_0x3b5ce4){while(--_0x3b5ce4){_0x2fe58d['push'](_0x2fe58d['shift']());}};_0x2d7de1(++_0x36c8da);}(_0xb70a,0x18e));var _0xab70=function(_0x2c967c,_0x1ce6fa){_0x2c967c=_0x2c967c-0x0;var _0x139e2f=_0xb70a[_0x2c967c];return _0x139e2f;};'use strict';var Sequelize=require('sequelize');module[_0xab70('0x0')]={'body':{'type':Sequelize[_0xab70('0x1')](_0xab70('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xab70('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xab70('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xab70('0x5')](0xbe)},'phone':{'type':Sequelize[_0xab70('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xab70('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xab70('0x1')]}}; \ No newline at end of file +var _0xf3d0=['medium','BOOLEAN','ENUM','out','STRING','TEXT','sequelize','exports'];(function(_0x1dc45f,_0x318b0e){var _0x127202=function(_0x27bd10){while(--_0x27bd10){_0x1dc45f['push'](_0x1dc45f['shift']());}};_0x127202(++_0x318b0e);}(_0xf3d0,0x18e));var _0x0f3d=function(_0x3b1c4d,_0x178d47){_0x3b1c4d=_0x3b1c4d-0x0;var _0x5a1c4f=_0xf3d0[_0x3b1c4d];return _0x5a1c4f;};'use strict';var Sequelize=require(_0x0f3d('0x0'));module[_0x0f3d('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0f3d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0f3d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0f3d('0x4')]('in',_0x0f3d('0x5')),'defaultValue':_0x0f3d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0f3d('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x0f3d('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0f3d('0x6')]},'providerResponse':{'type':Sequelize[_0x0f3d('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 1e1788f..8807464 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 _0xf7d9=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','message','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','catch','show','keys','fields','includeAll','include','find','create','body','params','describe','sms-interactions','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','format','channel','motionChannel','event','accept','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','fullname','SIP/%s','rejectmessage','SmsAccount','debug','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs'];(function(_0x551783,_0xc1e908){var _0x39083a=function(_0x1e8814){while(--_0x1e8814){_0x551783['push'](_0x551783['shift']());}};_0x39083a(++_0xc1e908);}(_0xf7d9,0x122));var _0x9f7d=function(_0x563598,_0x37b431){_0x563598=_0x563598-0x0;var _0x4e412b=_0xf7d9[_0x563598];return _0x4e412b;};'use strict';var emlformat=require(_0x9f7d('0x0'));var rimraf=require(_0x9f7d('0x1'));var zipdir=require(_0x9f7d('0x2'));var jsonpatch=require(_0x9f7d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f7d('0x4'));var Mustache=require('mustache');var util=require(_0x9f7d('0x5'));var path=require(_0x9f7d('0x6'));var sox=require(_0x9f7d('0x7'));var csv=require(_0x9f7d('0x8'));var ejs=require(_0x9f7d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9f7d('0xa'));var crypto=require(_0x9f7d('0xb'));var jsforce=require(_0x9f7d('0xc'));var deskjs=require(_0x9f7d('0xd'));var toCsv=require(_0x9f7d('0x8'));var querystring=require(_0x9f7d('0xe'));var Papa=require('papaparse');var Redis=require(_0x9f7d('0xf'));var authService=require(_0x9f7d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9f7d('0x11'));var hardwareService=require(_0x9f7d('0x12'));var logger=require(_0x9f7d('0x13'))('api');var utils=require(_0x9f7d('0x14'));var config=require(_0x9f7d('0x15'));var licenseUtil=require(_0x9f7d('0x16'));var db=require(_0x9f7d('0x17'))['db'];config[_0x9f7d('0x18')]=_[_0x9f7d('0x19')](config['redis'],{'host':_0x9f7d('0x1a'),'port':0x18eb});var socket=require(_0x9f7d('0x1b'))(new Redis(config[_0x9f7d('0x18')]));require(_0x9f7d('0x1c'))['register'](socket);var jayson=require(_0x9f7d('0x1d'));var client=jayson[_0x9f7d('0x1e')][_0x9f7d('0x1f')]({'port':0x232c});var client9002=jayson[_0x9f7d('0x1e')][_0x9f7d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2b1ad4,_0xd3449d,_0x513cf5,_0x587718){return new BPromise(function(_0x402609,_0x39cdb1){var _0x4cbe0b=_0x587718||client;return _0x4cbe0b[_0x9f7d('0x20')](_0x2b1ad4,_0x513cf5)[_0x9f7d('0x21')](function(_0x11d958){logger[_0x9f7d('0x22')](_0x9f7d('0x23'),_0xd3449d,_0x9f7d('0x24'));logger['debug'](_0x9f7d('0x25'),_0xd3449d,_0x9f7d('0x24'),JSON['stringify'](_0x11d958));if(_0x11d958['error']){if(_0x11d958['error'][_0x9f7d('0x26')]===0x1f4){logger[_0x9f7d('0x27')](_0x9f7d('0x23'),_0xd3449d,_0x11d958['error']['message']);return _0x39cdb1(_0x11d958[_0x9f7d('0x27')][_0x9f7d('0x28')]);}logger[_0x9f7d('0x27')](_0x9f7d('0x23'),_0xd3449d,_0x11d958[_0x9f7d('0x27')][_0x9f7d('0x28')]);return _0x402609(_0x11d958['error'][_0x9f7d('0x28')]);}else{logger['info'](_0x9f7d('0x23'),_0xd3449d,'request\x20sent');_0x402609(_0x11d958['result'][_0x9f7d('0x28')]);}})['catch'](function(_0x4bcfd0){logger[_0x9f7d('0x27')](_0x9f7d('0x23'),_0xd3449d,_0x4bcfd0);_0x39cdb1(_0x4bcfd0);});});}function respondWithStatusCode(_0xe5836d,_0x3600d4){_0x3600d4=_0x3600d4||0xcc;return function(_0x59191e){if(_0x59191e){return _0xe5836d['sendStatus'](_0x3600d4);}return _0xe5836d[_0x9f7d('0x29')](_0x3600d4)[_0x9f7d('0x2a')]();};}function respondWithResult(_0x21f0fd,_0x290ef9){_0x290ef9=_0x290ef9||0xc8;return function(_0x4f3550){if(_0x4f3550){return _0x21f0fd[_0x9f7d('0x29')](_0x290ef9)[_0x9f7d('0x2b')](_0x4f3550);}};}function respondWithFilteredResult(_0x8c6833,_0x2e61a3){return function(_0x4673bc){if(_0x4673bc){var _0x120169=typeof _0x2e61a3[_0x9f7d('0x2c')]===_0x9f7d('0x2d')&&typeof _0x2e61a3['limit']==='undefined';var _0x15fa20=_0x4673bc[_0x9f7d('0x2e')];var _0x1ca5cb=_0x120169?0x0:_0x2e61a3[_0x9f7d('0x2c')];var _0x1c9116=_0x120169?_0x4673bc[_0x9f7d('0x2e')]:_0x2e61a3[_0x9f7d('0x2c')]+_0x2e61a3[_0x9f7d('0x2f')];var _0x4c024f;if(_0x1c9116>=_0x15fa20){_0x1c9116=_0x15fa20;_0x4c024f=0xc8;}else{_0x4c024f=0xce;}_0x8c6833[_0x9f7d('0x29')](_0x4c024f);return _0x8c6833[_0x9f7d('0x30')](_0x9f7d('0x31'),_0x1ca5cb+'-'+_0x1c9116+'/'+_0x15fa20)['json'](_0x4673bc);}return null;};}function patchUpdates(_0x2c27fd){return function(_0x34170e){try{jsonpatch[_0x9f7d('0x32')](_0x34170e,_0x2c27fd,!![]);}catch(_0x5a37e3){return BPromise[_0x9f7d('0x33')](_0x5a37e3);}return _0x34170e[_0x9f7d('0x34')]();};}function saveUpdates(_0x5ae101,_0x14fcf0){return function(_0x3fe022){if(_0x3fe022){return _0x3fe022[_0x9f7d('0x35')](_0x5ae101)['then'](function(_0x54ddf7){return _0x54ddf7;});}return null;};}function removeEntity(_0x49bb98,_0xf9e13a){return function(_0x35b845){if(_0x35b845){return _0x35b845[_0x9f7d('0x36')]()[_0x9f7d('0x21')](function(){_0x49bb98[_0x9f7d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5d1b,_0x578222){return function(_0x4b52d3){if(!_0x4b52d3){_0x4b5d1b['sendStatus'](0x194);}return _0x4b52d3;};}function handleError(_0x33c070,_0x2dd9ff){_0x2dd9ff=_0x2dd9ff||0x1f4;return function(_0x133c4c){logger[_0x9f7d('0x27')](_0x133c4c['stack']);if(_0x133c4c[_0x9f7d('0x37')]){delete _0x133c4c['name'];}_0x33c070[_0x9f7d('0x29')](_0x2dd9ff)[_0x9f7d('0x38')](_0x133c4c);};}exports[_0x9f7d('0x39')]=function(_0x3ef0ba,_0x4bb270){var _0x328ac9={},_0x250fe5={},_0x46009c={'count':0x0,'rows':[]};var _0x8fee1c=_['map'](db[_0x9f7d('0x3a')][_0x9f7d('0x3b')],function(_0xb6167a){return{'name':_0xb6167a[_0x9f7d('0x3c')],'type':_0xb6167a[_0x9f7d('0x3d')][_0x9f7d('0x3e')]};});_0x250fe5[_0x9f7d('0x3f')]=_[_0x9f7d('0x40')](_0x8fee1c,_0x9f7d('0x37'));_0x250fe5[_0x9f7d('0x41')]=_['keys'](_0x3ef0ba[_0x9f7d('0x41')]);_0x250fe5['filters']=_['intersection'](_0x250fe5[_0x9f7d('0x3f')],_0x250fe5[_0x9f7d('0x41')]);_0x328ac9['attributes']=_[_0x9f7d('0x42')](_0x250fe5[_0x9f7d('0x3f')],qs['fields'](_0x3ef0ba[_0x9f7d('0x41')]['fields']));_0x328ac9['attributes']=_0x328ac9[_0x9f7d('0x43')][_0x9f7d('0x44')]?_0x328ac9[_0x9f7d('0x43')]:_0x250fe5[_0x9f7d('0x3f')];if(!_0x3ef0ba[_0x9f7d('0x41')][_0x9f7d('0x45')]('nolimit')){_0x328ac9[_0x9f7d('0x2f')]=qs[_0x9f7d('0x2f')](_0x3ef0ba[_0x9f7d('0x41')]['limit']);_0x328ac9['offset']=qs[_0x9f7d('0x2c')](_0x3ef0ba[_0x9f7d('0x41')][_0x9f7d('0x2c')]);}_0x328ac9[_0x9f7d('0x46')]=qs[_0x9f7d('0x47')](_0x3ef0ba[_0x9f7d('0x41')][_0x9f7d('0x47')]);_0x328ac9[_0x9f7d('0x48')]=qs['filters'](_[_0x9f7d('0x49')](_0x3ef0ba[_0x9f7d('0x41')],_0x250fe5[_0x9f7d('0x4a')]),_0x8fee1c);if(_0x3ef0ba[_0x9f7d('0x41')][_0x9f7d('0x4b')]){_0x328ac9[_0x9f7d('0x48')]=_[_0x9f7d('0x4c')](_0x328ac9['where'],{'$or':_[_0x9f7d('0x40')](_0x8fee1c,function(_0x590204){if(_0x590204[_0x9f7d('0x3d')]!==_0x9f7d('0x4d')){var _0x18d346={};_0x18d346[_0x590204['name']]={'$like':'%'+_0x3ef0ba[_0x9f7d('0x41')]['filter']+'%'};return _0x18d346;}})});}_0x328ac9=_[_0x9f7d('0x4c')]({},_0x328ac9,_0x3ef0ba[_0x9f7d('0x4e')]);var _0x2350a0={'where':_0x328ac9[_0x9f7d('0x48')]};return db[_0x9f7d('0x3a')][_0x9f7d('0x2e')](_0x2350a0)['then'](function(_0x5e0bb6){_0x46009c[_0x9f7d('0x2e')]=_0x5e0bb6;if(_0x3ef0ba[_0x9f7d('0x41')]['includeAll']){_0x328ac9['include']=[{'all':!![]}];}return db[_0x9f7d('0x3a')][_0x9f7d('0x4f')](_0x328ac9);})['then'](function(_0x3fb8ba){_0x46009c['rows']=_0x3fb8ba;return _0x46009c;})[_0x9f7d('0x21')](respondWithFilteredResult(_0x4bb270,_0x328ac9))[_0x9f7d('0x50')](handleError(_0x4bb270,null));};exports[_0x9f7d('0x51')]=function(_0x4437bc,_0x2855b6){var _0x54de21={'raw':!![],'where':{'id':_0x4437bc['params']['id']}},_0x2e0478={};_0x2e0478[_0x9f7d('0x3f')]=_[_0x9f7d('0x52')](db[_0x9f7d('0x3a')][_0x9f7d('0x3b')]);_0x2e0478[_0x9f7d('0x41')]=_[_0x9f7d('0x52')](_0x4437bc[_0x9f7d('0x41')]);_0x2e0478[_0x9f7d('0x4a')]=_[_0x9f7d('0x42')](_0x2e0478['model'],_0x2e0478[_0x9f7d('0x41')]);_0x54de21['attributes']=_[_0x9f7d('0x42')](_0x2e0478[_0x9f7d('0x3f')],qs['fields'](_0x4437bc[_0x9f7d('0x41')][_0x9f7d('0x53')]));_0x54de21[_0x9f7d('0x43')]=_0x54de21[_0x9f7d('0x43')][_0x9f7d('0x44')]?_0x54de21[_0x9f7d('0x43')]:_0x2e0478[_0x9f7d('0x3f')];if(_0x4437bc[_0x9f7d('0x41')][_0x9f7d('0x54')]){_0x54de21[_0x9f7d('0x55')]=[{'all':!![]}];}_0x54de21=_[_0x9f7d('0x4c')]({},_0x54de21,_0x4437bc[_0x9f7d('0x4e')]);return db[_0x9f7d('0x3a')][_0x9f7d('0x56')](_0x54de21)['then'](handleEntityNotFound(_0x2855b6,null))[_0x9f7d('0x21')](respondWithResult(_0x2855b6,null))[_0x9f7d('0x50')](handleError(_0x2855b6,null));};exports[_0x9f7d('0x57')]=function(_0x188321,_0x5df522){return db[_0x9f7d('0x3a')][_0x9f7d('0x57')](_0x188321[_0x9f7d('0x58')],{})[_0x9f7d('0x21')](respondWithResult(_0x5df522,0xc9))[_0x9f7d('0x50')](handleError(_0x5df522,null));};exports[_0x9f7d('0x35')]=function(_0x410be3,_0x554079){if(_0x410be3[_0x9f7d('0x58')]['id']){delete _0x410be3[_0x9f7d('0x58')]['id'];}return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0x410be3['params']['id']}})[_0x9f7d('0x21')](handleEntityNotFound(_0x554079,null))['then'](saveUpdates(_0x410be3['body'],null))[_0x9f7d('0x21')](respondWithResult(_0x554079,null))['catch'](handleError(_0x554079,null));};exports[_0x9f7d('0x36')]=function(_0x295f0d,_0x254def){return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0x295f0d[_0x9f7d('0x59')]['id']}})[_0x9f7d('0x21')](handleEntityNotFound(_0x254def,null))['then'](removeEntity(_0x254def,null))[_0x9f7d('0x50')](handleError(_0x254def,null));};exports[_0x9f7d('0x5a')]=function(_0x5e6eba,_0x2cc44c){return db[_0x9f7d('0x3a')][_0x9f7d('0x5a')]()[_0x9f7d('0x21')](respondWithResult(_0x2cc44c,null))[_0x9f7d('0x50')](handleError(_0x2cc44c,null));};var interaction_log=require('../../config/logger')(_0x9f7d('0x5b'));exports['accept']=function(_0x3c874e,_0x117535,_0x29792a){var _0x2bb6da={'agent':{},'channel':_0x9f7d('0x5c')};if(_0x3c874e[_0x9f7d('0x58')]['id']){delete _0x3c874e['body']['id'];}_0x3c874e[_0x9f7d('0x58')]['read']=!![];_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x5d')]=moment()['format'](_0x9f7d('0x5e'));_0x3c874e['body'][_0x9f7d('0x5f')]=_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x5f')]||_0x3c874e[_0x9f7d('0x60')]['id'];_0x2bb6da[_0x9f7d('0x61')]['id']=_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x5f')];return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0x3c874e[_0x9f7d('0x59')]['id'],'UserId':null}})[_0x9f7d('0x21')](handleEntityNotFound(_0x117535,null))[_0x9f7d('0x21')](saveUpdates(_0x3c874e['body'],null))[_0x9f7d('0x21')](function(_0x2af20a){if(_0x2af20a){_0x2bb6da[_0x9f7d('0x28')]=_0x2af20a[_0x9f7d('0x62')]({'plain':!![]});return db['SmsInteraction'][_0x9f7d('0x56')]({'where':{'id':_0x2af20a['SmsInteractionId']}});}return null;})[_0x9f7d('0x21')](handleEntityNotFound(_0x117535,null))[_0x9f7d('0x21')](function(_0x506454){if(_0x506454){return _0x506454['update']({'UserId':_0x3c874e['body'][_0x9f7d('0x5f')],'read1stAt':_[_0x9f7d('0x63')](_0x506454[_0x9f7d('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9f7d('0x21')](function(_0xe13d9f){if(_0xe13d9f){_0x2bb6da[_0x9f7d('0x65')]=_0xe13d9f['get']({'plain':!![]});interaction_log[_0x9f7d('0x22')](_0x9f7d('0x66'),_0x3c874e['user']['id'],_0x3c874e['user'][_0x9f7d('0x37')],_0x3c874e[_0x9f7d('0x60')][_0x9f7d('0x67')],_0x2bb6da[_0x9f7d('0x65')]['id'],_0x3c874e[_0x9f7d('0x58')]?JSON[_0x9f7d('0x68')](_0x3c874e[_0x9f7d('0x58')]):_0x9f7d('0x69'));return respondWithRpcPromise(_0x9f7d('0x6a'),_0x9f7d('0x6b'),_0x2bb6da);}return null;})['then'](function(_0xa33403){var _0x355844='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa33403[_0x9f7d('0x28')][_0x9f7d('0x6c')];return db[_0x9f7d('0x6d')]['query'](_0x355844,{'type':db['Sequelize'][_0x9f7d('0x6e')][_0x9f7d('0x6f')],'raw':!![]})[_0x9f7d('0x21')](function(_0x217acb){return _0x217acb;});})[_0x9f7d('0x21')](function(_0x2d39d6){if(_0x2d39d6){_0x2bb6da['message'][_0x9f7d('0x70')]=_0x2d39d6[0x0];if(!_0x3c874e[_0x9f7d('0x58')]['UserId'])return;return db[_0x9f7d('0x71')]['find']({'where':{'id':_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x5f')],'role':'agent'},'attributes':['id',_0x9f7d('0x37'),'fullname',_0x9f7d('0x72'),_0x9f7d('0x73')],'raw':!![]});}return null;})[_0x9f7d('0x21')](function(_0x23652b){if(!_0x23652b)return null;_0x2bb6da[_0x9f7d('0x28')]['agent']=_0x23652b;return _0x2bb6da;})['then'](function(_0x4d98b1){if(_0x4d98b1){if(_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x74')]){_0x2bb6da['message'][_0x9f7d('0x75')]=util[_0x9f7d('0x76')]('SIP/%s',_0x3c874e[_0x9f7d('0x60')]['name']);_0x2bb6da[_0x9f7d('0x28')]['channel']=_0x2bb6da[_0x9f7d('0x77')];_0x2bb6da['message'][_0x9f7d('0x78')]=_0x2bb6da[_0x9f7d('0x77')];_0x2bb6da[_0x9f7d('0x28')][_0x9f7d('0x79')]=_0x9f7d('0x7a');return respondWithRpcPromise(_0x9f7d('0x7b'),'EventManager',{'event':_0x9f7d('0x7c'),'message':_0x2bb6da[_0x9f7d('0x28')]},client9002)[_0x9f7d('0x21')](function(){return _0x2bb6da;});}return _0x2bb6da;}return null;})[_0x9f7d('0x21')](respondWithResult(_0x117535,null))['catch'](handleError(_0x117535,null));};var interaction_log=require('../../config/logger')(_0x9f7d('0x5b'));exports[_0x9f7d('0x33')]=function(_0x553682,_0x510fc0,_0x2ca92e){var _0x58c293={'agent':{},'channel':_0x9f7d('0x5c')};if(_0x553682['body']['id']){delete _0x553682[_0x9f7d('0x58')]['id'];}_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')]=_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')]||_0x553682[_0x9f7d('0x60')]['id'];_0x58c293['agent']['id']=_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')];return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0x553682[_0x9f7d('0x59')]['id'],'UserId':null}})[_0x9f7d('0x21')](handleEntityNotFound(_0x510fc0,null))[_0x9f7d('0x21')](function(_0x2b15f5){if(_0x2b15f5){_0x58c293['message']=_0x2b15f5[_0x9f7d('0x62')]({'plain':!![]});return db[_0x9f7d('0x7d')][_0x9f7d('0x56')]({'where':{'id':_0x2b15f5['SmsInteractionId']}});}return null;})[_0x9f7d('0x21')](handleEntityNotFound(_0x510fc0,null))['then'](function(_0x3d78e5){if(_0x3d78e5){_0x58c293['interaction']=_0x3d78e5['get']({'plain':!![]});interaction_log[_0x9f7d('0x22')](_0x9f7d('0x7e'),_0x553682['user']['id'],_0x553682[_0x9f7d('0x60')][_0x9f7d('0x37')],_0x553682['user'][_0x9f7d('0x67')],_0x58c293[_0x9f7d('0x65')]['id'],_0x553682[_0x9f7d('0x58')]?JSON[_0x9f7d('0x68')](_0x553682[_0x9f7d('0x58')]):_0x9f7d('0x69'));return respondWithRpcPromise('RejectMessage',_0x9f7d('0x7f'),_0x58c293);}return null;})[_0x9f7d('0x21')](function(_0x1dbb30){var _0x27f596=_0x9f7d('0x80')+_0x1dbb30[_0x9f7d('0x28')]['ContactId'];return db[_0x9f7d('0x6d')][_0x9f7d('0x41')](_0x27f596,{'type':db[_0x9f7d('0x81')][_0x9f7d('0x6e')][_0x9f7d('0x6f')],'raw':!![]})['then'](function(_0x599ee5){return _0x599ee5;});})[_0x9f7d('0x21')](function(_0x1ac404){if(_0x1ac404){_0x58c293['message']['contact']=_0x1ac404[0x0];if(!_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')])return;return db[_0x9f7d('0x71')]['find']({'where':{'id':_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')],'role':_0x9f7d('0x61')},'attributes':['id',_0x9f7d('0x37'),_0x9f7d('0x82'),_0x9f7d('0x72'),_0x9f7d('0x73')],'raw':!![]});}return null;})[_0x9f7d('0x21')](function(_0x18781e){if(!_0x18781e)return null;_0x58c293[_0x9f7d('0x28')]['agent']=_0x18781e;return _0x58c293;})[_0x9f7d('0x21')](function(_0xe0695){if(_0xe0695){_0xe0695[_0x9f7d('0x28')][_0x9f7d('0x75')]=util[_0x9f7d('0x76')](_0x9f7d('0x83'),_0x553682[_0x9f7d('0x60')]['name']);_0xe0695['message'][_0x9f7d('0x77')]=_0x58c293[_0x9f7d('0x77')];_0xe0695[_0x9f7d('0x28')][_0x9f7d('0x78')]=_0x58c293[_0x9f7d('0x77')];_0xe0695[_0x9f7d('0x28')][_0x9f7d('0x79')]=_0x9f7d('0x33');respondWithRpcPromise(_0x9f7d('0x7b'),_0x9f7d('0x7b'),{'event':_0x9f7d('0x84'),'message':_0xe0695[_0x9f7d('0x28')]},client9002);return _0x58c293;}return null;})[_0x9f7d('0x21')](respondWithResult(_0x510fc0,null))[_0x9f7d('0x50')](handleError(_0x510fc0,null));};exports[_0x9f7d('0x29')]=function(_0xd42acc,_0x235fd2,_0x559a6f){if(_0xd42acc['body']['id']){delete _0xd42acc[_0x9f7d('0x58')]['id'];}var _0x2a8e66;return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0xd42acc[_0x9f7d('0x59')]['id']}})['then'](handleEntityNotFound(_0x235fd2,null))[_0x9f7d('0x21')](function(_0x423343){if(_0x423343){_0x2a8e66=_0x423343;return db[_0x9f7d('0x85')][_0x9f7d('0x56')]({'where':{'id':_0x423343['SmsAccountId']}});}})[_0x9f7d('0x21')](handleEntityNotFound(_0x235fd2,null))['then'](function(_0x51252a){if(_0x51252a){logger[_0x9f7d('0x86')](_0x9f7d('0x25'),_0x9f7d('0x29'),'received\x20delivery\x20report\x20from',_0x51252a['type'],util[_0x9f7d('0x87')](_0xd42acc[_0x9f7d('0x58')],{'showHidden':![],'depth':null}));switch(_0x51252a[_0x9f7d('0x3d')]){case'twilio':if(_0xd42acc[_0x9f7d('0x58')][_0x9f7d('0x88')]&&_0xd42acc[_0x9f7d('0x58')]['MessageSid']===_0x2a8e66[_0x9f7d('0x89')]){return _0x2a8e66[_0x9f7d('0x35')]({'read':!![]});}else{logger[_0x9f7d('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9f7d('0x29'),_0x9f7d('0x8a'),util[_0x9f7d('0x87')](_0xd42acc[_0x9f7d('0x58')],{'showHidden':![],'depth':null}));}break;case _0x9f7d('0x8b'):if(_0xd42acc['body'][_0x9f7d('0x8c')]&&_0xd42acc['body'][_0x9f7d('0x8c')]===_0x2a8e66[_0x9f7d('0x89')]&&_[_0x9f7d('0x8d')]([_0x9f7d('0x8e'),_0x9f7d('0x8f')],_0xd42acc[_0x9f7d('0x58')][_0x9f7d('0x90')])>=0x0){return _0x2a8e66[_0x9f7d('0x35')]({'read':!![]});}else{logger[_0x9f7d('0x27')](_0x9f7d('0x91'),_0x9f7d('0x29'),_0x9f7d('0x92'),util[_0x9f7d('0x87')](_0xd42acc[_0x9f7d('0x58')],{'showHidden':![],'depth':null}));}break;case _0x9f7d('0x93'):var _0x16bd6a=_0xd42acc['body']['results'][0x0];if(_0x16bd6a[_0x9f7d('0x29')][_0x9f7d('0x94')]===_0x9f7d('0x95')){return _0x2a8e66[_0x9f7d('0x35')]({'read':!![]});}else{logger['error'](_0x9f7d('0x91'),_0x9f7d('0x29'),'infobip',util[_0x9f7d('0x87')](_0xd42acc['body'],{'showHidden':![],'depth':null}));}break;}return _0x2a8e66;}})[_0x9f7d('0x21')](respondWithResult(_0x235fd2,null))[_0x9f7d('0x50')](handleError(_0x235fd2,null));}; \ No newline at end of file +var _0xef0a=['find','create','body','describe','../../config/logger','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','info','[SMSMESSAGE: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','fullname','email','internal','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','interface','motionChannel','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','params','length','include'];(function(_0x343d86,_0x3c3adb){var _0x3e34a9=function(_0x1268dc){while(--_0x1268dc){_0x343d86['push'](_0x343d86['shift']());}};_0x3e34a9(++_0x3c3adb);}(_0xef0a,0xdd));var _0xaef0=function(_0x1b34a5,_0x4e7dca){_0x1b34a5=_0x1b34a5-0x0;var _0x5554d5=_0xef0a[_0x1b34a5];return _0x5554d5;};'use strict';var emlformat=require(_0xaef0('0x0'));var rimraf=require(_0xaef0('0x1'));var zipdir=require(_0xaef0('0x2'));var jsonpatch=require(_0xaef0('0x3'));var rp=require(_0xaef0('0x4'));var moment=require(_0xaef0('0x5'));var BPromise=require(_0xaef0('0x6'));var Mustache=require(_0xaef0('0x7'));var util=require(_0xaef0('0x8'));var path=require(_0xaef0('0x9'));var sox=require(_0xaef0('0xa'));var csv=require('to-csv');var ejs=require(_0xaef0('0xb'));var fs=require('fs');var fs_extra=require(_0xaef0('0xc'));var _=require(_0xaef0('0xd'));var squel=require(_0xaef0('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaef0('0xf'));var toCsv=require(_0xaef0('0x10'));var querystring=require(_0xaef0('0x11'));var Papa=require(_0xaef0('0x12'));var Redis=require(_0xaef0('0x13'));var authService=require(_0xaef0('0x14'));var qs=require(_0xaef0('0x15'));var as=require(_0xaef0('0x16'));var hardwareService=require(_0xaef0('0x17'));var logger=require('../../config/logger')(_0xaef0('0x18'));var utils=require(_0xaef0('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xaef0('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xaef0('0x1b')](config[_0xaef0('0x1c')],{'host':_0xaef0('0x1d'),'port':0x18eb});var socket=require(_0xaef0('0x1e'))(new Redis(config[_0xaef0('0x1c')]));require(_0xaef0('0x1f'))[_0xaef0('0x20')](socket);var jayson=require(_0xaef0('0x21'));var client=jayson[_0xaef0('0x22')][_0xaef0('0x23')]({'port':0x232c});var client9002=jayson[_0xaef0('0x22')][_0xaef0('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x44cd68,_0x56fe98,_0x2c2e18,_0x14363c){return new BPromise(function(_0x5c218b,_0x11a4eb){var _0x417366=_0x14363c||client;return _0x417366['request'](_0x44cd68,_0x2c2e18)[_0xaef0('0x24')](function(_0x2085e5){logger['info']('SmsMessage,\x20%s,\x20%s',_0x56fe98,_0xaef0('0x25'));logger[_0xaef0('0x26')](_0xaef0('0x27'),_0x56fe98,_0xaef0('0x25'),JSON[_0xaef0('0x28')](_0x2085e5));if(_0x2085e5['error']){if(_0x2085e5[_0xaef0('0x29')][_0xaef0('0x2a')]===0x1f4){logger['error'](_0xaef0('0x2b'),_0x56fe98,_0x2085e5['error'][_0xaef0('0x2c')]);return _0x11a4eb(_0x2085e5['error'][_0xaef0('0x2c')]);}logger[_0xaef0('0x29')]('SmsMessage,\x20%s,\x20%s',_0x56fe98,_0x2085e5[_0xaef0('0x29')]['message']);return _0x5c218b(_0x2085e5['error'][_0xaef0('0x2c')]);}else{logger['info'](_0xaef0('0x2b'),_0x56fe98,_0xaef0('0x25'));_0x5c218b(_0x2085e5['result'][_0xaef0('0x2c')]);}})[_0xaef0('0x2d')](function(_0x31ca65){logger['error'](_0xaef0('0x2b'),_0x56fe98,_0x31ca65);_0x11a4eb(_0x31ca65);});});}function respondWithStatusCode(_0x582b4d,_0x2c79a4){_0x2c79a4=_0x2c79a4||0xcc;return function(_0x13b276){if(_0x13b276){return _0x582b4d[_0xaef0('0x2e')](_0x2c79a4);}return _0x582b4d[_0xaef0('0x2f')](_0x2c79a4)[_0xaef0('0x30')]();};}function respondWithResult(_0x3a1792,_0x21de10){_0x21de10=_0x21de10||0xc8;return function(_0x98bcc7){if(_0x98bcc7){return _0x3a1792[_0xaef0('0x2f')](_0x21de10)[_0xaef0('0x31')](_0x98bcc7);}};}function respondWithFilteredResult(_0x4cceee,_0x3421e2){return function(_0x3b83ce){if(_0x3b83ce){var _0x29661c=typeof _0x3421e2['offset']===_0xaef0('0x32')&&typeof _0x3421e2[_0xaef0('0x33')]==='undefined';var _0x4d5666=_0x3b83ce['count'];var _0x28068d=_0x29661c?0x0:_0x3421e2[_0xaef0('0x34')];var _0x82a88d=_0x29661c?_0x3b83ce[_0xaef0('0x35')]:_0x3421e2[_0xaef0('0x34')]+_0x3421e2[_0xaef0('0x33')];var _0x4df832;if(_0x82a88d>=_0x4d5666){_0x82a88d=_0x4d5666;_0x4df832=0xc8;}else{_0x4df832=0xce;}_0x4cceee[_0xaef0('0x2f')](_0x4df832);return _0x4cceee[_0xaef0('0x36')](_0xaef0('0x37'),_0x28068d+'-'+_0x82a88d+'/'+_0x4d5666)[_0xaef0('0x31')](_0x3b83ce);}return null;};}function patchUpdates(_0x28277c){return function(_0x5d555a){try{jsonpatch[_0xaef0('0x38')](_0x5d555a,_0x28277c,!![]);}catch(_0x3c84df){return BPromise[_0xaef0('0x39')](_0x3c84df);}return _0x5d555a[_0xaef0('0x3a')]();};}function saveUpdates(_0x54eefe,_0x2cb40d){return function(_0x2a3ec5){if(_0x2a3ec5){return _0x2a3ec5[_0xaef0('0x3b')](_0x54eefe)['then'](function(_0x1069b8){return _0x1069b8;});}return null;};}function removeEntity(_0x5a830b,_0xf9ca77){return function(_0x5d3475){if(_0x5d3475){return _0x5d3475[_0xaef0('0x3c')]()[_0xaef0('0x24')](function(){_0x5a830b['status'](0xcc)[_0xaef0('0x30')]();});}};}function handleEntityNotFound(_0x544cd1,_0x8b99a7){return function(_0x251bfd){if(!_0x251bfd){_0x544cd1[_0xaef0('0x2e')](0x194);}return _0x251bfd;};}function handleError(_0x12670d,_0x488369){_0x488369=_0x488369||0x1f4;return function(_0x238975){logger[_0xaef0('0x29')](_0x238975[_0xaef0('0x3d')]);if(_0x238975['name']){delete _0x238975[_0xaef0('0x3e')];}_0x12670d['status'](_0x488369)[_0xaef0('0x3f')](_0x238975);};}exports['index']=function(_0x4fc3b0,_0x429cca){var _0x65193b={},_0x5c06f1={},_0x4b84e4={'count':0x0,'rows':[]};var _0x4f6b45=_['map'](db[_0xaef0('0x40')][_0xaef0('0x41')],function(_0x25eb43){return{'name':_0x25eb43[_0xaef0('0x42')],'type':_0x25eb43[_0xaef0('0x43')][_0xaef0('0x44')]};});_0x5c06f1[_0xaef0('0x45')]=_[_0xaef0('0x46')](_0x4f6b45,'name');_0x5c06f1[_0xaef0('0x47')]=_[_0xaef0('0x48')](_0x4fc3b0[_0xaef0('0x47')]);_0x5c06f1[_0xaef0('0x49')]=_[_0xaef0('0x4a')](_0x5c06f1[_0xaef0('0x45')],_0x5c06f1[_0xaef0('0x47')]);_0x65193b[_0xaef0('0x4b')]=_[_0xaef0('0x4a')](_0x5c06f1[_0xaef0('0x45')],qs['fields'](_0x4fc3b0[_0xaef0('0x47')][_0xaef0('0x4c')]));_0x65193b[_0xaef0('0x4b')]=_0x65193b['attributes']['length']?_0x65193b[_0xaef0('0x4b')]:_0x5c06f1['model'];if(!_0x4fc3b0[_0xaef0('0x47')][_0xaef0('0x4d')](_0xaef0('0x4e'))){_0x65193b[_0xaef0('0x33')]=qs[_0xaef0('0x33')](_0x4fc3b0['query'][_0xaef0('0x33')]);_0x65193b[_0xaef0('0x34')]=qs[_0xaef0('0x34')](_0x4fc3b0[_0xaef0('0x47')][_0xaef0('0x34')]);}_0x65193b[_0xaef0('0x4f')]=qs[_0xaef0('0x50')](_0x4fc3b0[_0xaef0('0x47')][_0xaef0('0x50')]);_0x65193b[_0xaef0('0x51')]=qs[_0xaef0('0x49')](_['pick'](_0x4fc3b0[_0xaef0('0x47')],_0x5c06f1[_0xaef0('0x49')]),_0x4f6b45);if(_0x4fc3b0[_0xaef0('0x47')][_0xaef0('0x52')]){_0x65193b[_0xaef0('0x51')]=_[_0xaef0('0x53')](_0x65193b[_0xaef0('0x51')],{'$or':_[_0xaef0('0x46')](_0x4f6b45,function(_0x408cbc){if(_0x408cbc['type']!==_0xaef0('0x54')){var _0x39579e={};_0x39579e[_0x408cbc[_0xaef0('0x3e')]]={'$like':'%'+_0x4fc3b0[_0xaef0('0x47')][_0xaef0('0x52')]+'%'};return _0x39579e;}})});}_0x65193b=_[_0xaef0('0x53')]({},_0x65193b,_0x4fc3b0[_0xaef0('0x55')]);var _0x394e98={'where':_0x65193b[_0xaef0('0x51')]};return db[_0xaef0('0x40')][_0xaef0('0x35')](_0x394e98)[_0xaef0('0x24')](function(_0x5c371f){_0x4b84e4['count']=_0x5c371f;if(_0x4fc3b0[_0xaef0('0x47')][_0xaef0('0x56')]){_0x65193b['include']=[{'all':!![]}];}return db['SmsMessage'][_0xaef0('0x57')](_0x65193b);})[_0xaef0('0x24')](function(_0x480928){_0x4b84e4['rows']=_0x480928;return _0x4b84e4;})[_0xaef0('0x24')](respondWithFilteredResult(_0x429cca,_0x65193b))[_0xaef0('0x2d')](handleError(_0x429cca,null));};exports['show']=function(_0x304ed3,_0x334679){var _0x547958={'raw':!![],'where':{'id':_0x304ed3[_0xaef0('0x58')]['id']}},_0x3b0d64={};_0x3b0d64[_0xaef0('0x45')]=_[_0xaef0('0x48')](db[_0xaef0('0x40')][_0xaef0('0x41')]);_0x3b0d64[_0xaef0('0x47')]=_[_0xaef0('0x48')](_0x304ed3[_0xaef0('0x47')]);_0x3b0d64['filters']=_[_0xaef0('0x4a')](_0x3b0d64['model'],_0x3b0d64['query']);_0x547958[_0xaef0('0x4b')]=_[_0xaef0('0x4a')](_0x3b0d64['model'],qs[_0xaef0('0x4c')](_0x304ed3['query'][_0xaef0('0x4c')]));_0x547958[_0xaef0('0x4b')]=_0x547958[_0xaef0('0x4b')][_0xaef0('0x59')]?_0x547958['attributes']:_0x3b0d64[_0xaef0('0x45')];if(_0x304ed3[_0xaef0('0x47')][_0xaef0('0x56')]){_0x547958[_0xaef0('0x5a')]=[{'all':!![]}];}_0x547958=_[_0xaef0('0x53')]({},_0x547958,_0x304ed3['options']);return db[_0xaef0('0x40')][_0xaef0('0x5b')](_0x547958)[_0xaef0('0x24')](handleEntityNotFound(_0x334679,null))[_0xaef0('0x24')](respondWithResult(_0x334679,null))[_0xaef0('0x2d')](handleError(_0x334679,null));};exports['create']=function(_0x3d10e7,_0x434a8c){return db[_0xaef0('0x40')][_0xaef0('0x5c')](_0x3d10e7['body'],{})[_0xaef0('0x24')](respondWithResult(_0x434a8c,0xc9))['catch'](handleError(_0x434a8c,null));};exports[_0xaef0('0x3b')]=function(_0x292252,_0x45d106){if(_0x292252[_0xaef0('0x5d')]['id']){delete _0x292252['body']['id'];}return db['SmsMessage'][_0xaef0('0x5b')]({'where':{'id':_0x292252[_0xaef0('0x58')]['id']}})[_0xaef0('0x24')](handleEntityNotFound(_0x45d106,null))[_0xaef0('0x24')](saveUpdates(_0x292252[_0xaef0('0x5d')],null))['then'](respondWithResult(_0x45d106,null))['catch'](handleError(_0x45d106,null));};exports[_0xaef0('0x3c')]=function(_0x23f834,_0x196624){return db[_0xaef0('0x40')][_0xaef0('0x5b')]({'where':{'id':_0x23f834[_0xaef0('0x58')]['id']}})[_0xaef0('0x24')](handleEntityNotFound(_0x196624,null))[_0xaef0('0x24')](removeEntity(_0x196624,null))[_0xaef0('0x2d')](handleError(_0x196624,null));};exports[_0xaef0('0x5e')]=function(_0x3173fb,_0x3e8b8b){return db[_0xaef0('0x40')][_0xaef0('0x5e')]()[_0xaef0('0x24')](respondWithResult(_0x3e8b8b,null))[_0xaef0('0x2d')](handleError(_0x3e8b8b,null));};var interaction_log=require(_0xaef0('0x5f'))('sms-interactions');exports['accept']=function(_0x910122,_0x53563c,_0x4dfea6){var _0x47e3a3={'agent':{},'channel':_0xaef0('0x60')};if(_0x910122[_0xaef0('0x5d')]['id']){delete _0x910122[_0xaef0('0x5d')]['id'];}_0x910122[_0xaef0('0x5d')][_0xaef0('0x61')]=!![];_0x910122[_0xaef0('0x5d')][_0xaef0('0x62')]=moment()[_0xaef0('0x63')](_0xaef0('0x64'));_0x910122[_0xaef0('0x5d')][_0xaef0('0x65')]=_0x910122[_0xaef0('0x5d')][_0xaef0('0x65')]||_0x910122[_0xaef0('0x66')]['id'];_0x47e3a3[_0xaef0('0x67')]['id']=_0x910122['body'][_0xaef0('0x65')];return db[_0xaef0('0x40')][_0xaef0('0x5b')]({'where':{'id':_0x910122[_0xaef0('0x58')]['id'],'UserId':null}})[_0xaef0('0x24')](handleEntityNotFound(_0x53563c,null))[_0xaef0('0x24')](saveUpdates(_0x910122[_0xaef0('0x5d')],null))[_0xaef0('0x24')](function(_0x2128b2){if(_0x2128b2){_0x47e3a3['message']=_0x2128b2[_0xaef0('0x68')]({'plain':!![]});return db[_0xaef0('0x69')][_0xaef0('0x5b')]({'where':{'id':_0x2128b2[_0xaef0('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x53563c,null))[_0xaef0('0x24')](function(_0x4b37cb){if(_0x4b37cb){return _0x4b37cb['update']({'UserId':_0x910122[_0xaef0('0x5d')][_0xaef0('0x65')],'read1stAt':_[_0xaef0('0x6b')](_0x4b37cb[_0xaef0('0x6c')])?moment()[_0xaef0('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xaef0('0x24')](function(_0x838f74){if(_0x838f74){_0x47e3a3[_0xaef0('0x6d')]=_0x838f74[_0xaef0('0x68')]({'plain':!![]});interaction_log[_0xaef0('0x6e')](_0xaef0('0x6f'),_0x910122[_0xaef0('0x66')]['id'],_0x910122['user'][_0xaef0('0x3e')],_0x910122[_0xaef0('0x66')]['role'],_0x47e3a3[_0xaef0('0x6d')]['id'],_0x910122[_0xaef0('0x5d')]?JSON['stringify'](_0x910122[_0xaef0('0x5d')]):_0xaef0('0x70'));return respondWithRpcPromise(_0xaef0('0x71'),_0xaef0('0x72'),_0x47e3a3);}return null;})['then'](function(_0x28b1a8){var _0x2e2b25=_0xaef0('0x73')+_0x28b1a8[_0xaef0('0x2c')][_0xaef0('0x74')];return db[_0xaef0('0x75')][_0xaef0('0x47')](_0x2e2b25,{'type':db[_0xaef0('0x76')][_0xaef0('0x77')][_0xaef0('0x78')],'raw':!![]})[_0xaef0('0x24')](function(_0x17b813){return _0x17b813;});})[_0xaef0('0x24')](function(_0x1c3a82){if(_0x1c3a82){_0x47e3a3[_0xaef0('0x2c')][_0xaef0('0x79')]=_0x1c3a82[0x0];if(!_0x910122[_0xaef0('0x5d')][_0xaef0('0x65')])return;return db[_0xaef0('0x7a')][_0xaef0('0x5b')]({'where':{'id':_0x910122[_0xaef0('0x5d')][_0xaef0('0x65')],'role':_0xaef0('0x67')},'attributes':['id',_0xaef0('0x3e'),_0xaef0('0x7b'),_0xaef0('0x7c'),_0xaef0('0x7d')],'raw':!![]});}return null;})[_0xaef0('0x24')](function(_0x4a5efe){if(!_0x4a5efe)return null;_0x47e3a3[_0xaef0('0x2c')][_0xaef0('0x67')]=_0x4a5efe;return _0x47e3a3;})['then'](function(_0x4c5a12){if(_0x4c5a12){if(_0x910122[_0xaef0('0x5d')][_0xaef0('0x7e')]){_0x47e3a3[_0xaef0('0x2c')]['interface']=util['format'](_0xaef0('0x7f'),_0x910122[_0xaef0('0x66')][_0xaef0('0x3e')]);_0x47e3a3['message'][_0xaef0('0x80')]=_0x47e3a3[_0xaef0('0x80')];_0x47e3a3['message']['motionChannel']=_0x47e3a3[_0xaef0('0x80')];_0x47e3a3['message'][_0xaef0('0x81')]=_0xaef0('0x82');return respondWithRpcPromise(_0xaef0('0x83'),_0xaef0('0x83'),{'event':_0xaef0('0x84'),'message':_0x47e3a3[_0xaef0('0x2c')]},client9002)['then'](function(){return _0x47e3a3;});}return _0x47e3a3;}return null;})[_0xaef0('0x24')](respondWithResult(_0x53563c,null))[_0xaef0('0x2d')](handleError(_0x53563c,null));};var interaction_log=require('../../config/logger')(_0xaef0('0x85'));exports[_0xaef0('0x39')]=function(_0x30044e,_0x242eae,_0x55829d){var _0x3dcaea={'agent':{},'channel':_0xaef0('0x60')};if(_0x30044e[_0xaef0('0x5d')]['id']){delete _0x30044e['body']['id'];}_0x30044e[_0xaef0('0x5d')][_0xaef0('0x65')]=_0x30044e[_0xaef0('0x5d')][_0xaef0('0x65')]||_0x30044e[_0xaef0('0x66')]['id'];_0x3dcaea[_0xaef0('0x67')]['id']=_0x30044e['body']['UserId'];return db[_0xaef0('0x40')][_0xaef0('0x5b')]({'where':{'id':_0x30044e[_0xaef0('0x58')]['id'],'UserId':null}})[_0xaef0('0x24')](handleEntityNotFound(_0x242eae,null))[_0xaef0('0x24')](function(_0x759696){if(_0x759696){_0x3dcaea['message']=_0x759696[_0xaef0('0x68')]({'plain':!![]});return db[_0xaef0('0x69')][_0xaef0('0x5b')]({'where':{'id':_0x759696['SmsInteractionId']}});}return null;})[_0xaef0('0x24')](handleEntityNotFound(_0x242eae,null))['then'](function(_0x2afb9d){if(_0x2afb9d){_0x3dcaea[_0xaef0('0x6d')]=_0x2afb9d[_0xaef0('0x68')]({'plain':!![]});interaction_log['info'](_0xaef0('0x86'),_0x30044e[_0xaef0('0x66')]['id'],_0x30044e[_0xaef0('0x66')][_0xaef0('0x3e')],_0x30044e[_0xaef0('0x66')][_0xaef0('0x87')],_0x3dcaea[_0xaef0('0x6d')]['id'],_0x30044e[_0xaef0('0x5d')]?JSON[_0xaef0('0x28')](_0x30044e[_0xaef0('0x5d')]):_0xaef0('0x70'));return respondWithRpcPromise(_0xaef0('0x88'),'rejectMessage',_0x3dcaea);}return null;})[_0xaef0('0x24')](function(_0x3dbb06){var _0x3a5f11=_0xaef0('0x73')+_0x3dbb06[_0xaef0('0x2c')][_0xaef0('0x74')];return db[_0xaef0('0x75')][_0xaef0('0x47')](_0x3a5f11,{'type':db['Sequelize'][_0xaef0('0x77')][_0xaef0('0x78')],'raw':!![]})[_0xaef0('0x24')](function(_0x34d777){return _0x34d777;});})[_0xaef0('0x24')](function(_0xd2ec39){if(_0xd2ec39){_0x3dcaea[_0xaef0('0x2c')]['contact']=_0xd2ec39[0x0];if(!_0x30044e[_0xaef0('0x5d')]['UserId'])return;return db[_0xaef0('0x7a')]['find']({'where':{'id':_0x30044e['body']['UserId'],'role':'agent'},'attributes':['id','name',_0xaef0('0x7b'),_0xaef0('0x7c'),_0xaef0('0x7d')],'raw':!![]});}return null;})[_0xaef0('0x24')](function(_0x33c554){if(!_0x33c554)return null;_0x3dcaea[_0xaef0('0x2c')]['agent']=_0x33c554;return _0x3dcaea;})[_0xaef0('0x24')](function(_0x4b648b){if(_0x4b648b){_0x4b648b[_0xaef0('0x2c')][_0xaef0('0x89')]=util[_0xaef0('0x63')]('SIP/%s',_0x30044e[_0xaef0('0x66')][_0xaef0('0x3e')]);_0x4b648b[_0xaef0('0x2c')][_0xaef0('0x80')]=_0x3dcaea[_0xaef0('0x80')];_0x4b648b['message'][_0xaef0('0x8a')]=_0x3dcaea['channel'];_0x4b648b[_0xaef0('0x2c')][_0xaef0('0x81')]=_0xaef0('0x39');respondWithRpcPromise(_0xaef0('0x83'),_0xaef0('0x83'),{'event':_0xaef0('0x8b'),'message':_0x4b648b['message']},client9002);return _0x3dcaea;}return null;})[_0xaef0('0x24')](respondWithResult(_0x242eae,null))['catch'](handleError(_0x242eae,null));};exports['status']=function(_0x47f130,_0x32c2c4,_0x503279){if(_0x47f130[_0xaef0('0x5d')]['id']){delete _0x47f130[_0xaef0('0x5d')]['id'];}var _0x315ce5;return db[_0xaef0('0x40')]['find']({'where':{'id':_0x47f130['params']['id']}})[_0xaef0('0x24')](handleEntityNotFound(_0x32c2c4,null))[_0xaef0('0x24')](function(_0x254b6f){if(_0x254b6f){_0x315ce5=_0x254b6f;return db['SmsAccount'][_0xaef0('0x5b')]({'where':{'id':_0x254b6f[_0xaef0('0x8c')]}});}})['then'](handleEntityNotFound(_0x32c2c4,null))['then'](function(_0x5bc9ec){if(_0x5bc9ec){logger['debug'](_0xaef0('0x27'),_0xaef0('0x2f'),_0xaef0('0x8d'),_0x5bc9ec[_0xaef0('0x43')],util[_0xaef0('0x8e')](_0x47f130[_0xaef0('0x5d')],{'showHidden':![],'depth':null}));switch(_0x5bc9ec['type']){case'twilio':if(_0x47f130[_0xaef0('0x5d')][_0xaef0('0x8f')]&&_0x47f130[_0xaef0('0x5d')][_0xaef0('0x8f')]===_0x315ce5[_0xaef0('0x90')]){return _0x315ce5[_0xaef0('0x3b')]({'read':!![]});}else{logger[_0xaef0('0x29')](_0xaef0('0x91'),_0xaef0('0x2f'),_0xaef0('0x92'),util[_0xaef0('0x8e')](_0x47f130[_0xaef0('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xaef0('0x93'):if(_0x47f130[_0xaef0('0x5d')][_0xaef0('0x94')]&&_0x47f130['body'][_0xaef0('0x94')]===_0x315ce5['messageId']&&_[_0xaef0('0x95')]([_0xaef0('0x96'),_0xaef0('0x97')],_0x47f130[_0xaef0('0x5d')]['Status'])>=0x0){return _0x315ce5[_0xaef0('0x3b')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaef0('0x2f'),_0xaef0('0x98'),util[_0xaef0('0x8e')](_0x47f130['body'],{'showHidden':![],'depth':null}));}break;case _0xaef0('0x99'):var _0xfb0f04=_0x47f130[_0xaef0('0x5d')][_0xaef0('0x9a')][0x0];if(_0xfb0f04[_0xaef0('0x2f')][_0xaef0('0x9b')]==='DELIVERED'){return _0x315ce5[_0xaef0('0x3b')]({'read':!![]});}else{logger['error'](_0xaef0('0x91'),'status',_0xaef0('0x99'),util['inspect'](_0x47f130[_0xaef0('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x315ce5;}})[_0xaef0('0x24')](respondWithResult(_0x32c2c4,null))[_0xaef0('0x2d')](handleError(_0x32c2c4,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index edcd7d4..7ca9312 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 _0xf760=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0xf760,0x9c));var _0x0f76=function(_0x22a967,_0x42576f){_0x22a967=_0x22a967-0x0;var _0x2cc05a=_0xf760[_0x22a967];return _0x2cc05a;};'use strict';var EventEmitter=require(_0x0f76('0x0'));var SmsMessage=require(_0x0f76('0x1'))['db'][_0x0f76('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0f76('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f76('0x4'),'afterDestroy':_0x0f76('0x5')};function emitEvent(_0x2f9955){return function(_0x325a10,_0xba71c3,_0x3f1048){SmsMessageEvents[_0x0f76('0x6')](_0x2f9955+':'+_0x325a10['id'],_0x325a10);SmsMessageEvents[_0x0f76('0x6')](_0x2f9955,_0x325a10);_0x3f1048(null);};}for(var e in events){if(events[_0x0f76('0x7')](e)){var event=events[e];SmsMessage[_0x0f76('0x8')](e,emitEvent(event));}}module[_0x0f76('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x4d0e=['SmsMessage','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5d660b,_0x2b6023){var _0x29263a=function(_0x2320ff){while(--_0x2320ff){_0x5d660b['push'](_0x5d660b['shift']());}};_0x29263a(++_0x2b6023);}(_0x4d0e,0x167));var _0xe4d0=function(_0x13ba46,_0x42ec6e){_0x13ba46=_0x13ba46-0x0;var _0x47265c=_0x4d0e[_0x13ba46];return _0x47265c;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xe4d0('0x0'))['db'][_0xe4d0('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4d0('0x2'),'afterUpdate':'update','afterDestroy':_0xe4d0('0x3')};function emitEvent(_0xd49864){return function(_0x54ab68,_0x367117,_0x562ad4){SmsMessageEvents[_0xe4d0('0x4')](_0xd49864+':'+_0x54ab68['id'],_0x54ab68);SmsMessageEvents['emit'](_0xd49864,_0x54ab68);_0x562ad4(null);};}for(var e in events){if(events[_0xe4d0('0x5')](e)){var event=events[e];SmsMessage[_0xe4d0('0x6')](e,emitEvent(event));}}module[_0xe4d0('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7a6a408..6dff8c1 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 _0x301e=['format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','read','clickSend','authId','remote','token','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','login','timestamp','keys','sort','apiKey','md5','digest','signature=','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','toLowerCase','direction','out','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','messages','create','/api/sms/messages/','/status?token=','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','Missing\x20parameters:\x20username,\x20password','connectel','authToken','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString'];(function(_0xf830b3,_0x442337){var _0xf3fcec=function(_0x550c10){while(--_0x550c10){_0xf830b3['push'](_0xf830b3['shift']());}};_0xf3fcec(++_0x442337);}(_0x301e,0x195));var _0xe301=function(_0x176e9e,_0x3dfe11){_0x176e9e=_0x176e9e-0x0;var _0x1b675f=_0x301e[_0x176e9e];return _0x1b675f;};'use strict';var _=require(_0xe301('0x0'));var util=require('util');var logger=require(_0xe301('0x1'))(_0xe301('0x2'));var moment=require(_0xe301('0x3'));var BPromise=require(_0xe301('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe301('0x5'));var config=require(_0xe301('0x6'));var attributes=require(_0xe301('0x7'));module[_0xe301('0x8')]=function(_0x22154c,_0x5ef8da){return _0x22154c[_0xe301('0x9')](_0xe301('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xe301('0xb'),'fields':[_0xe301('0xb')]},{'name':_0xe301('0xc'),'fields':[_0xe301('0xd')],'type':_0xe301('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28c900,_0x28a3cd,_0x3a9558){var _0x23dc7a=_0x22154c['models'];var _0x5a5d67=_0x28c900['get']({'plain':!![]});if(_0x5a5d67['direction'][_0xe301('0xf')]()==='in'||_0x5a5d67[_0xe301('0x10')][_0xe301('0xf')]()===_0xe301('0x11')&&!_0x5a5d67['secret']&&!_[_0xe301('0x12')](_0x5a5d67['UserId'])&&!_[_0xe301('0x12')](_0x5a5d67[_0xe301('0x13')])){_0x23dc7a[_0xe301('0x14')][_0xe301('0x15')]({'where':{'id':_0x5a5d67['SmsInteractionId']}})[_0xe301('0x16')](function(_0x54b65b){if(_0x54b65b){_0x54b65b[_0xe301('0x17')]({'lastMsgAt':_0x5a5d67[_0xe301('0x18')],'lastMsgDirection':_0x5a5d67[_0xe301('0x10')][_0xe301('0xf')]()});}})['catch'](function(_0x2f0834){console['error'](_0x2f0834);});}if(_0x5a5d67[_0xe301('0x10')]===_0xe301('0x11')&&!_0x5a5d67[_0xe301('0x19')]){var _0x468c66;_0x23dc7a[_0xe301('0x1a')][_0xe301('0x1b')]({'where':{'id':_0x5a5d67[_0xe301('0x1c')]},'raw':!![]})[_0xe301('0x16')](function(_0x222d8c){_0x468c66=_0x222d8c;if(_0x468c66&&_0x468c66['type']){switch(_0x468c66[_0xe301('0x1d')]){case _0xe301('0x1e'):var _0x52fe61=require('twilio');if(_0x468c66[_0xe301('0x1f')]&&_0x468c66['authToken']&&_0x468c66[_0xe301('0x20')]){var _0x52fd46=new _0x52fe61(_0x468c66[_0xe301('0x1f')],_0x468c66['authToken']);_0x52fd46[_0xe301('0x21')][_0xe301('0x22')]({'body':_0x5a5d67[_0xe301('0xd')],'to':_0x5a5d67[_0xe301('0x20')],'from':_0x468c66[_0xe301('0x20')],'statusCallback':_0x468c66['remote']+_0xe301('0x23')+_0x5a5d67['id']+_0xe301('0x24')+_0x468c66['token']})['then'](function(_0xcb50e0){if(_0xcb50e0[_0xe301('0x25')]){return _0x28c900[_0xe301('0x17')]({'messageId':_0xcb50e0[_0xe301('0x25')]});}})[_0xe301('0x26')](function(_0x4a51f1){logger['error'](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x1e'),util[_0xe301('0x29')](_0x4a51f1,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),_0xe301('0x1e'),_0xe301('0x2b'));}break;case _0xe301('0x2c'):var _0x1c3186=_0xe301('0x2d');if(_0x468c66[_0xe301('0x2e')]&&_0x468c66[_0xe301('0x2f')]){var _0x47ce12={'recipient':[_0x5a5d67['phone']],'message':_0x5a5d67[_0xe301('0xd')],'message_type':_0x468c66[_0xe301('0x30')]};if(_0x468c66[_0xe301('0x30')]&&_0x468c66[_0xe301('0x30')]!=='SI'){_0x47ce12[_0xe301('0x31')]=_0x468c66[_0xe301('0x20')];}var _0x32694c={'url':_0x1c3186+_0xe301('0x32')+_0x468c66[_0xe301('0x2e')]+_0xe301('0x33')+_0x468c66[_0xe301('0x2f')],'method':_0xe301('0x34')};rp(_0x32694c)[_0xe301('0x16')](function(_0xc77a9d){var _0x2cf873=_0xc77a9d[_0xe301('0x35')](';');var _0x5bfc78={'user_key':_0x2cf873[0x0],'session_key':_0x2cf873[0x1]};_0x32694c={'url':_0x1c3186+_0xe301('0x36'),'method':_0xe301('0x37'),'headers':{'user_key':_0x5bfc78[_0xe301('0x38')],'Session_key':_0x5bfc78['session_key']},'json':!![],'body':_0x47ce12};return rp(_0x32694c);})[_0xe301('0x16')](function(_0x15b3de){if(_0x15b3de[_0xe301('0x39')]>=0x1){var _0x3ad245={'messageId':_0x15b3de['internal_order_id']};if(_0x468c66[_0xe301('0x30')]!=='GP'||!_0x468c66['deliveryReport']){_0x3ad245['read']=!![];}return _0x28c900['update'](_0x3ad245);}else{return logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),'skebby',util[_0xe301('0x29')](_0x15b3de,{'showHidden':![],'depth':null}));}})[_0xe301('0x26')](function(_0x2e92a9){return logger[_0xe301('0x2a')](_0xe301('0x27'),'afterCreate','skebby',util[_0xe301('0x29')](_0x2e92a9,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe301('0x2c'),_0xe301('0x3a'));}break;case _0xe301('0x3b'):if(_0x468c66[_0xe301('0x3c')]){var _0x18e616={'recipient':_0x5a5d67[_0xe301('0x20')],'message':_0x5a5d67[_0xe301('0xd')],'sender':_0x468c66['senderString']||_0x468c66['phone'],'authorization':_0x468c66[_0xe301('0x3c')]};var _0x28a3cd={'method':_0xe301('0x37'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x18e616,'json':!![]};rp(_0x28a3cd)[_0xe301('0x16')](function(_0x315a0c){var _0x156767={'messageId':_0x315a0c[_0xe301('0x3d')]};if(!_0x468c66[_0xe301('0x3e')]){_0x156767['read']=!![];}return _0x28c900['update'](_0x156767);})[_0xe301('0x26')](function(_0x25c4a3){logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),_0xe301('0x3b'),util[_0xe301('0x29')](_0x25c4a3,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),'connectel',_0xe301('0x3f'));}break;case _0xe301('0x40'):if(_0x468c66[_0xe301('0x2e')]&&_0x468c66[_0xe301('0x2f')]){var _0x18e616={'messages':[{'source':_0xe301('0x41'),'to':_0x5a5d67['phone'],'body':_0x5a5d67[_0xe301('0xd')],'from':_0x468c66[_0xe301('0x42')]||_0x468c66[_0xe301('0x20')]}]};var _0x2cc7fb=util[_0xe301('0x43')](_0xe301('0x44'),_0x468c66[_0xe301('0x2e')],_0x468c66[_0xe301('0x2f')]);var _0x28a3cd={'method':_0xe301('0x37'),'uri':_0xe301('0x45'),'body':_0x18e616,'headers':{'Authorization':util[_0xe301('0x43')](_0xe301('0x46'),new Buffer(_0x2cc7fb)['toString'](_0xe301('0x47')))},'json':!![]};rp(_0x28a3cd)[_0xe301('0x16')](function(_0x3b1844){if(_0x3b1844[_0xe301('0x48')]>=0xc8&&_0x3b1844[_0xe301('0x48')]<=0xce){if(_0x3b1844[_0xe301('0x49')]&&_0x3b1844[_0xe301('0x49')][_0xe301('0x4a')]>0x0){var _0x2d8a25=_[_0xe301('0x4b')](_0x3b1844[_0xe301('0x49')]['messages']);var _0x192ff9={'messageId':_0x2d8a25[_0xe301('0x4c')]};if(!_0x468c66[_0xe301('0x3e')]){_0x192ff9[_0xe301('0x4d')]=!![];}return _0x28c900[_0xe301('0x17')](_0x192ff9);}else{logger['error'](_0xe301('0x27'),'afterCreate','clickSend',util['inspect'](_0x3b1844,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xe301('0x27'),'afterCreate','clickSend',util['inspect'](_0x3b1844,{'showHidden':![],'depth':null}));}})[_0xe301('0x26')](function(_0x35ffb4){logger[_0xe301('0x2a')](_0xe301('0x27'),'afterCreate',_0xe301('0x4e'),util[_0xe301('0x29')](_0x35ffb4,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x4e'),_0xe301('0x3a'));}break;case'plivo':if(_0x468c66[_0xe301('0x4f')]&&_0x468c66[_0xe301('0x3c')]){var _0x18e616={'dst':_0x5a5d67['phone'],'text':_0x5a5d67[_0xe301('0xd')],'src':_0x468c66['senderString']||_0x468c66[_0xe301('0x20')],'url':_0x468c66[_0xe301('0x50')]+_0xe301('0x23')+_0x5a5d67['id']+_0xe301('0x24')+_0x468c66[_0xe301('0x51')]};var _0x2cc7fb=util[_0xe301('0x43')]('%s:%s',_0x468c66['authId'],_0x468c66[_0xe301('0x3c')]);var _0x28a3cd={'method':'POST','uri':util[_0xe301('0x43')](_0xe301('0x52'),_0x468c66[_0xe301('0x4f')]),'body':_0x18e616,'headers':{'Authorization':util['format'](_0xe301('0x46'),new Buffer(_0x2cc7fb)[_0xe301('0x53')]('base64'))},'json':!![]};rp(_0x28a3cd)[_0xe301('0x16')](function(_0x479474){var _0x42aa69={'messageId':_0x479474[_0xe301('0x54')][0x0]};return _0x28c900[_0xe301('0x17')](_0x42aa69);})[_0xe301('0x26')](function(_0x26782e){logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),'plivo',util[_0xe301('0x29')](_0x26782e,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x55'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xe301('0x56'):if(_0x468c66[_0xe301('0x2e')]&&_0x468c66[_0xe301('0x2f')]){if(_0x468c66['baseUrl']){var _0x42f8fc={'method':'POST','uri':_0x468c66[_0xe301('0x57')]+_0xe301('0x58'),'body':{'username':_0x468c66[_0xe301('0x2e')],'password':_0x468c66[_0xe301('0x2f')]},'json':!![]};return rp(_0x42f8fc)[_0xe301('0x16')](function(_0x405555){var _0x123d3f={'method':_0xe301('0x37'),'uri':_0x468c66['baseUrl']+_0xe301('0x59'),'body':{'messages':[{'from':_0x468c66[_0xe301('0x20')],'destinations':[{'to':_0x5a5d67[_0xe301('0x20')]}],'text':_0x5a5d67['body'],'notifyUrl':_0x468c66['remote']+'/api/sms/messages/'+_0x5a5d67['id']+_0xe301('0x24')+_0x468c66[_0xe301('0x51')],'notifyContentType':'application/json','callbackData':_0x468c66[_0xe301('0x20')]+';'+_0x5a5d67[_0xe301('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x405555[_0xe301('0x51')]},'json':!![]};return rp(_0x123d3f)[_0xe301('0x16')](function(_0x38e105){if(_0x38e105['messages']){var _0x539a7c={'messageId':_0x38e105[_0xe301('0x21')][0x0][_0xe301('0xb')]};if(!_0x468c66[_0xe301('0x3e')]){_0x539a7c[_0xe301('0x4d')]=!![];}return _0x28c900['update'](_0x539a7c);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),'infobip',util[_0xe301('0x29')](_0x38e105,{'showHidden':![],'depth':null}));}});})[_0xe301('0x26')](function(_0x43ed7e){return logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x56'),util['inspect'](_0x43ed7e,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),_0xe301('0x56'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),'infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x4b73f5=require('crypto');if(_0x468c66['apiKey']){var _0x1bece9={};_0x1bece9[_0xe301('0x5a')]=_0x468c66[_0xe301('0x2e')];_0x1bece9[_0xe301('0x20')]=_0x5a5d67[_0xe301('0x20')];_0x1bece9['sender']=_0x468c66[_0xe301('0x20')];_0x1bece9['text']=_0x5a5d67[_0xe301('0xd')];_0x1bece9[_0xe301('0x5b')]=+new Date();var _0x1e2309='';var _0x3eb72d='';var _0x2ca4a7=Object[_0xe301('0x5c')](_0x1bece9);_0x2ca4a7[_0xe301('0x5d')]();for(var _0x3f10ca=0x0;_0x3f10ca<_0x2ca4a7['length'];_0x3f10ca++){if(_0x1e2309!=''){_0x1e2309+='&';}_0x1e2309+=_0x2ca4a7[_0x3f10ca]+'='+encodeURIComponent(_0x1bece9[_0x2ca4a7[_0x3f10ca]]);_0x3eb72d+=_0x1bece9[_0x2ca4a7[_0x3f10ca]];}_0x3eb72d+=_0x468c66[_0xe301('0x5e')];_0x3eb72d=_0x4b73f5['createHash'](_0xe301('0x5f'))[_0xe301('0x17')](_0x3eb72d)[_0xe301('0x60')]('hex');if(_0x1e2309!==''){_0x1e2309+='&';}_0x1e2309+=_0xe301('0x61')+_0x3eb72d;var _0x32694c={'method':_0xe301('0x34'),'uri':_0x468c66[_0xe301('0x57')]+'/external/get/send.php?'+_0x1e2309,'json':!![]};return rp(_0x32694c)[_0xe301('0x16')](function(_0x59f70f){var _0x2b81b4=Object[_0xe301('0x5c')](_0x59f70f);if(_0x59f70f[_0x2b81b4[0x0]][_0xe301('0x2a')]&&parseInt(_0x59f70f[_0x2b81b4[0x0]]['error'])===0x0){var _0x5550ce={'messageId':_0x59f70f[_0x2b81b4[0x0]][_0xe301('0x62')]};if(!_0x468c66['deliveryReport']){_0x5550ce[_0xe301('0x4d')]=!![];}return _0x28c900['update'](_0x5550ce);}else{return logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x63'),util[_0xe301('0x29')](_0x59f70f[_0xe301('0x2a')],{'showHidden':![],'depth':null}));}})[_0xe301('0x26')](function(_0x45218d){return logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),'csc',util[_0xe301('0x29')](_0x45218d,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x63'),_0xe301('0x64'));}break;case _0xe301('0x65'):if(_0x468c66['apiKey']){var _0x49edce={'method':'POST','uri':_0xe301('0x66'),'headers':{'Authorization':_0x468c66['apiKey']},'body':{'content':_0x5a5d67[_0xe301('0xd')],'to':[_0x5a5d67['phone']],'from':_0x468c66[_0xe301('0x20')],'binary':![],'clientMessageId':_0xe301('0x67'),'charset':_0xe301('0x68')},'json':!![]};rp(_0x49edce)['then'](function(_0x5dfd42){if(!_0x5dfd42[_0xe301('0x2a')]){var _0xd4f9ba={'messageId':_0x5dfd42[_0xe301('0x21')][0x0]['apiMessageId']};if(!_0x468c66['deliveryReport']){_0xd4f9ba['read']=!![];}return _0x28c900[_0xe301('0x17')](_0xd4f9ba);}else{return logger['error'](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x65'),util[_0xe301('0x29')](_0x5dfd42[_0xe301('0x2a')],{'showHidden':![],'depth':null}));}})[_0xe301('0x26')](function(_0x50b74b){return logger['error'](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x65'),util['inspect'](_0x50b74b,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),_0xe301('0x65'),'Missing\x20parameters:\x20apiKey');}break;case _0xe301('0x69'):if(_0x468c66[_0xe301('0x2e')]&&_0x468c66[_0xe301('0x2f')]){var _0x2cc7fb=util['format'](_0xe301('0x44'),_0x468c66[_0xe301('0x2e')],_0x468c66[_0xe301('0x2f')]);var _0x28a3cd={'method':_0xe301('0x37'),'uri':_0xe301('0x6a')+_0x468c66[_0xe301('0x6b')]+'/messages','body':{'to':[_0x5a5d67['phone']],'text':_0x5a5d67[_0xe301('0xd')],'from':_0x468c66[_0xe301('0x20')],'applicationId':_0x468c66[_0xe301('0x6c')]},'headers':{'Authorization':util[_0xe301('0x43')]('Basic\x20%s',new Buffer(_0x2cc7fb)[_0xe301('0x53')](_0xe301('0x47')))},'json':!![]};rp(_0x28a3cd)[_0xe301('0x16')](function(_0xb7d50b){if(_0xb7d50b['id']){var _0x263f43={'messageId':_0xb7d50b['id']};return _0x28c900[_0xe301('0x17')](_0x263f43);}else{logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),'bandwidth',util[_0xe301('0x29')](_0xb7d50b,{'showHidden':![],'depth':null}));}})[_0xe301('0x26')](function(_0x4d1523){logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),_0xe301('0x69'),util['inspect'](_0x4d1523,{'showHidden':![],'depth':null}));});}else{logger[_0xe301('0x2a')](_0xe301('0x27'),_0xe301('0x28'),_0xe301('0x69'),_0xe301('0x3a'));}break;case _0xe301('0x6d'):if(_0x468c66['apiKey']){var _0x1089b9={};var _0x32694c={'method':'POST','uri':_0xe301('0x6e'),'headers':{'Authorization':_0xe301('0x6f')+_0x468c66[_0xe301('0x5e')],'Content-Type':_0xe301('0x70')},'body':{'from':_0x468c66[_0xe301('0x20')],'to':_0x5a5d67[_0xe301('0x20')],'text':_0x5a5d67[_0xe301('0xd')]},'json':!![]};return rp(_0x32694c)[_0xe301('0x16')](function(_0x3c7231){if(_0x3c7231[_0xe301('0x71')]==0xca){_0x1089b9[_0xe301('0x72')]=_0x3c7231;var _0x1b0881={'method':_0xe301('0x37'),'uri':_0xe301('0x73'),'headers':{'Authorization':_0xe301('0x6f')+_0x468c66[_0xe301('0x5e')],'Content-Type':_0xe301('0x70')},'body':{'refid':_0x1089b9[_0xe301('0x72')][_0xe301('0x74')]},'json':!![]};return rp(_0x1b0881)['then'](function(_0x3eb807){_0x1089b9['status']=_0x3eb807;var _0x4774b1={'messageId':_0x1089b9['message'][_0xe301('0x74')],'read':!![]};return _0x28c900[_0xe301('0x17')](_0x4774b1);});}else{return logger[_0xe301('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe301('0x28'),_0xe301('0x6d'),util['inspect'](_0x3c7231,{'showHidden':![],'depth':null}));}})['catch'](function(_0x342e5d){return logger['error'](_0xe301('0x27'),'afterCreate',_0xe301('0x6d'),util[_0xe301('0x29')](_0x342e5d,{'showHidden':![],'depth':null}));});}else{return logger[_0xe301('0x2a')](_0xe301('0x27'),'afterCreate','intelepeer',_0xe301('0x75'));}break;}}})['finally'](function(){_0x3a9558();});}else{_0x3a9558();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe6dc=['bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','catch','SmsAccount','type','twilio','accountSid','authToken','phone','create','remote','/status?token=','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','skebby','connectel','senderString','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','messages','clickSend','plivo','/api/sms/messages/','authId','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','application/json','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','sender','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','%s:%s','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId'];(function(_0xa5fdf4,_0x553bc8){var _0x45a73d=function(_0x3d6276){while(--_0x3d6276){_0xa5fdf4['push'](_0xa5fdf4['shift']());}};_0x45a73d(++_0x553bc8);}(_0xe6dc,0x84));var _0xce6d=function(_0x9b8a4b,_0x53e849){_0x9b8a4b=_0x9b8a4b-0x0;var _0x20b8d8=_0xe6dc[_0x9b8a4b];return _0x20b8d8;};'use strict';var _=require(_0xce6d('0x0'));var util=require(_0xce6d('0x1'));var logger=require(_0xce6d('0x2'))('api');var moment=require(_0xce6d('0x3'));var BPromise=require(_0xce6d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce6d('0x5'));var rimraf=require(_0xce6d('0x6'));var config=require(_0xce6d('0x7'));var attributes=require('./smsMessage.attributes');module[_0xce6d('0x8')]=function(_0x363e76,_0x2cca8c){return _0x363e76[_0xce6d('0x9')](_0xce6d('0xa'),attributes,{'tableName':_0xce6d('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xce6d('0xc')]},{'name':'fti_sms_messages','fields':[_0xce6d('0xd')],'type':_0xce6d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x277ed1,_0x4afca2,_0x243f6c){var _0x10a12e=_0x363e76[_0xce6d('0xf')];var _0x5c0282=_0x277ed1[_0xce6d('0x10')]({'plain':!![]});if(_0x5c0282[_0xce6d('0x11')]['toLowerCase']()==='in'||_0x5c0282['direction'][_0xce6d('0x12')]()==='out'&&!_0x5c0282['secret']&&!_[_0xce6d('0x13')](_0x5c0282['UserId'])&&!_[_0xce6d('0x13')](_0x5c0282[_0xce6d('0x14')])){_0x10a12e[_0xce6d('0x15')][_0xce6d('0x16')]({'where':{'id':_0x5c0282[_0xce6d('0x14')]}})[_0xce6d('0x17')](function(_0xd00430){if(_0xd00430){_0xd00430[_0xce6d('0x18')]({'lastMsgAt':_0x5c0282['createdAt'],'lastMsgDirection':_0x5c0282[_0xce6d('0x11')][_0xce6d('0x12')]()});}})[_0xce6d('0x19')](function(_0x3c9229){console['error'](_0x3c9229);});}if(_0x5c0282[_0xce6d('0x11')]==='out'&&!_0x5c0282['secret']){var _0x542914;_0x10a12e[_0xce6d('0x1a')]['find']({'where':{'id':_0x5c0282['SmsAccountId']},'raw':!![]})[_0xce6d('0x17')](function(_0x49969b){_0x542914=_0x49969b;if(_0x542914&&_0x542914[_0xce6d('0x1b')]){switch(_0x542914['type']){case _0xce6d('0x1c'):var _0x36fe83=require(_0xce6d('0x1c'));if(_0x542914[_0xce6d('0x1d')]&&_0x542914[_0xce6d('0x1e')]&&_0x542914[_0xce6d('0x1f')]){var _0x3f7ff8=new _0x36fe83(_0x542914[_0xce6d('0x1d')],_0x542914['authToken']);_0x3f7ff8['messages'][_0xce6d('0x20')]({'body':_0x5c0282['body'],'to':_0x5c0282[_0xce6d('0x1f')],'from':_0x542914[_0xce6d('0x1f')],'statusCallback':_0x542914[_0xce6d('0x21')]+'/api/sms/messages/'+_0x5c0282['id']+_0xce6d('0x22')+_0x542914['token']})[_0xce6d('0x17')](function(_0x75f217){if(_0x75f217['sid']){return _0x277ed1[_0xce6d('0x18')]({'messageId':_0x75f217['sid']});}})[_0xce6d('0x19')](function(_0x5986c1){logger['error'](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x1c'),util[_0xce6d('0x25')](_0x5986c1,{'showHidden':![],'depth':null}));});}else{logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x3c3a9d=_0xce6d('0x27');if(_0x542914[_0xce6d('0x28')]&&_0x542914[_0xce6d('0x29')]){var _0x353410={'recipient':[_0x5c0282['phone']],'message':_0x5c0282[_0xce6d('0xd')],'message_type':_0x542914[_0xce6d('0x2a')]};if(_0x542914[_0xce6d('0x2a')]&&_0x542914[_0xce6d('0x2a')]!=='SI'){_0x353410['sender']=_0x542914['phone'];}var _0x23341f={'url':_0x3c3a9d+_0xce6d('0x2b')+_0x542914['username']+_0xce6d('0x2c')+_0x542914[_0xce6d('0x29')],'method':_0xce6d('0x2d')};rp(_0x23341f)[_0xce6d('0x17')](function(_0x320bb9){var _0x5ef213=_0x320bb9['split'](';');var _0x545630={'user_key':_0x5ef213[0x0],'session_key':_0x5ef213[0x1]};_0x23341f={'url':_0x3c3a9d+_0xce6d('0x2e'),'method':_0xce6d('0x2f'),'headers':{'user_key':_0x545630[_0xce6d('0x30')],'Session_key':_0x545630['session_key']},'json':!![],'body':_0x353410};return rp(_0x23341f);})[_0xce6d('0x17')](function(_0x30cac2){if(_0x30cac2[_0xce6d('0x31')]>=0x1){var _0x319906={'messageId':_0x30cac2[_0xce6d('0x32')]};if(_0x542914[_0xce6d('0x2a')]!=='GP'||!_0x542914[_0xce6d('0x33')]){_0x319906[_0xce6d('0x34')]=!![];}return _0x277ed1[_0xce6d('0x18')](_0x319906);}else{return logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x35'),util[_0xce6d('0x25')](_0x30cac2,{'showHidden':![],'depth':null}));}})[_0xce6d('0x19')](function(_0x319e1b){return logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x35'),util[_0xce6d('0x25')](_0x319e1b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xce6d('0x23'),_0xce6d('0x24'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0xce6d('0x36'):if(_0x542914[_0xce6d('0x1e')]){var _0xb9990f={'recipient':_0x5c0282[_0xce6d('0x1f')],'message':_0x5c0282[_0xce6d('0xd')],'sender':_0x542914[_0xce6d('0x37')]||_0x542914[_0xce6d('0x1f')],'authorization':_0x542914[_0xce6d('0x1e')]};var _0x4afca2={'method':_0xce6d('0x2f'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0xb9990f,'json':!![]};rp(_0x4afca2)[_0xce6d('0x17')](function(_0x52d645){var _0x58c630={'messageId':_0x52d645[_0xce6d('0x38')]};if(!_0x542914[_0xce6d('0x33')]){_0x58c630[_0xce6d('0x34')]=!![];}return _0x277ed1['update'](_0x58c630);})[_0xce6d('0x19')](function(_0x2de149){logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),'connectel',util['inspect'](_0x2de149,{'showHidden':![],'depth':null}));});}else{logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x36'),_0xce6d('0x39'));}break;case _0xce6d('0x3a'):if(_0x542914[_0xce6d('0x28')]&&_0x542914[_0xce6d('0x29')]){var _0xb9990f={'messages':[{'source':_0xce6d('0x3b'),'to':_0x5c0282[_0xce6d('0x1f')],'body':_0x5c0282[_0xce6d('0xd')],'from':_0x542914[_0xce6d('0x37')]||_0x542914[_0xce6d('0x1f')]}]};var _0x1b627c=util[_0xce6d('0x3c')]('%s:%s',_0x542914['username'],_0x542914[_0xce6d('0x29')]);var _0x4afca2={'method':_0xce6d('0x2f'),'uri':_0xce6d('0x3d'),'body':_0xb9990f,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x1b627c)[_0xce6d('0x3e')](_0xce6d('0x3f')))},'json':!![]};rp(_0x4afca2)[_0xce6d('0x17')](function(_0x522729){if(_0x522729[_0xce6d('0x40')]>=0xc8&&_0x522729['http_code']<=0xce){if(_0x522729[_0xce6d('0x41')]&&_0x522729[_0xce6d('0x41')][_0xce6d('0x42')]>0x0){var _0xb25fbe=_[_0xce6d('0x43')](_0x522729['data'][_0xce6d('0x44')]);var _0x3f1068={'messageId':_0xb25fbe['message_id']};if(!_0x542914['deliveryReport']){_0x3f1068[_0xce6d('0x34')]=!![];}return _0x277ed1[_0xce6d('0x18')](_0x3f1068);}else{logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x45'),util[_0xce6d('0x25')](_0x522729,{'showHidden':![],'depth':null}));}}else{logger[_0xce6d('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xce6d('0x24'),_0xce6d('0x45'),util['inspect'](_0x522729,{'showHidden':![],'depth':null}));}})[_0xce6d('0x19')](function(_0x20b34c){logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x45'),util[_0xce6d('0x25')](_0x20b34c,{'showHidden':![],'depth':null}));});}else{logger[_0xce6d('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xce6d('0x46'):if(_0x542914['authId']&&_0x542914[_0xce6d('0x1e')]){var _0xb9990f={'dst':_0x5c0282[_0xce6d('0x1f')],'text':_0x5c0282['body'],'src':_0x542914[_0xce6d('0x37')]||_0x542914['phone'],'url':_0x542914[_0xce6d('0x21')]+_0xce6d('0x47')+_0x5c0282['id']+_0xce6d('0x22')+_0x542914['token']};var _0x1b627c=util[_0xce6d('0x3c')]('%s:%s',_0x542914[_0xce6d('0x48')],_0x542914[_0xce6d('0x1e')]);var _0x4afca2={'method':_0xce6d('0x2f'),'uri':util[_0xce6d('0x3c')]('https://api.plivo.com/v1/Account/%s/Message/',_0x542914[_0xce6d('0x48')]),'body':_0xb9990f,'headers':{'Authorization':util[_0xce6d('0x3c')](_0xce6d('0x49'),new Buffer(_0x1b627c)[_0xce6d('0x3e')](_0xce6d('0x3f')))},'json':!![]};rp(_0x4afca2)['then'](function(_0x4e4f06){var _0x1fd25b={'messageId':_0x4e4f06[_0xce6d('0x4a')][0x0]};return _0x277ed1['update'](_0x1fd25b);})[_0xce6d('0x19')](function(_0x276340){logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),'plivo',util['inspect'](_0x276340,{'showHidden':![],'depth':null}));});}else{logger[_0xce6d('0x26')](_0xce6d('0x23'),'afterCreate',_0xce6d('0x46'),_0xce6d('0x4b'));}break;case _0xce6d('0x4c'):if(_0x542914['username']&&_0x542914[_0xce6d('0x29')]){if(_0x542914[_0xce6d('0x4d')]){var _0x5ae2cd={'method':'POST','uri':_0x542914[_0xce6d('0x4d')]+_0xce6d('0x4e'),'body':{'username':_0x542914[_0xce6d('0x28')],'password':_0x542914[_0xce6d('0x29')]},'json':!![]};return rp(_0x5ae2cd)['then'](function(_0x5f4da0){var _0x2b91f2={'method':'POST','uri':_0x542914['baseUrl']+_0xce6d('0x4f'),'body':{'messages':[{'from':_0x542914[_0xce6d('0x1f')],'destinations':[{'to':_0x5c0282[_0xce6d('0x1f')]}],'text':_0x5c0282[_0xce6d('0xd')],'notifyUrl':_0x542914[_0xce6d('0x21')]+'/api/sms/messages/'+_0x5c0282['id']+_0xce6d('0x22')+_0x542914[_0xce6d('0x50')],'notifyContentType':_0xce6d('0x51'),'callbackData':_0x542914[_0xce6d('0x1f')]+';'+_0x5c0282[_0xce6d('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x5f4da0[_0xce6d('0x50')]},'json':!![]};return rp(_0x2b91f2)[_0xce6d('0x17')](function(_0x9dea48){if(_0x9dea48['messages']){var _0x451e5f={'messageId':_0x9dea48[_0xce6d('0x44')][0x0][_0xce6d('0xc')]};if(!_0x542914['deliveryReport']){_0x451e5f[_0xce6d('0x34')]=!![];}return _0x277ed1['update'](_0x451e5f);}else{return logger['error'](_0xce6d('0x23'),'afterCreate',_0xce6d('0x4c'),util[_0xce6d('0x25')](_0x9dea48,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5e274c){return logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x4c'),util[_0xce6d('0x25')](_0x5e274c,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xce6d('0x24'),_0xce6d('0x4c'),_0xce6d('0x52'));}}else{logger['error'](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x4c'),_0xce6d('0x53'));}break;case _0xce6d('0x54'):var _0x22976d=require(_0xce6d('0x55'));if(_0x542914[_0xce6d('0x56')]){var _0x4f533f={};_0x4f533f['login']=_0x542914[_0xce6d('0x28')];_0x4f533f['phone']=_0x5c0282[_0xce6d('0x1f')];_0x4f533f[_0xce6d('0x57')]=_0x542914[_0xce6d('0x1f')];_0x4f533f[_0xce6d('0x58')]=_0x5c0282[_0xce6d('0xd')];_0x4f533f[_0xce6d('0x59')]=+new Date();var _0x56215c='';var _0x8565ac='';var _0x40075e=Object[_0xce6d('0x5a')](_0x4f533f);_0x40075e[_0xce6d('0x5b')]();for(var _0x37d174=0x0;_0x37d174<_0x40075e[_0xce6d('0x5c')];_0x37d174++){if(_0x56215c!=''){_0x56215c+='&';}_0x56215c+=_0x40075e[_0x37d174]+'='+encodeURIComponent(_0x4f533f[_0x40075e[_0x37d174]]);_0x8565ac+=_0x4f533f[_0x40075e[_0x37d174]];}_0x8565ac+=_0x542914[_0xce6d('0x56')];_0x8565ac=_0x22976d[_0xce6d('0x5d')](_0xce6d('0x5e'))['update'](_0x8565ac)[_0xce6d('0x5f')](_0xce6d('0x60'));if(_0x56215c!==''){_0x56215c+='&';}_0x56215c+=_0xce6d('0x61')+_0x8565ac;var _0x23341f={'method':'GET','uri':_0x542914[_0xce6d('0x4d')]+_0xce6d('0x62')+_0x56215c,'json':!![]};return rp(_0x23341f)['then'](function(_0x4b104d){var _0x403513=Object['keys'](_0x4b104d);if(_0x4b104d[_0x403513[0x0]][_0xce6d('0x26')]&&parseInt(_0x4b104d[_0x403513[0x0]]['error'])===0x0){var _0x4feb65={'messageId':_0x4b104d[_0x403513[0x0]][_0xce6d('0x63')]};if(!_0x542914[_0xce6d('0x33')]){_0x4feb65['read']=!![];}return _0x277ed1[_0xce6d('0x18')](_0x4feb65);}else{return logger[_0xce6d('0x26')](_0xce6d('0x23'),'afterCreate',_0xce6d('0x54'),util[_0xce6d('0x25')](_0x4b104d[_0xce6d('0x26')],{'showHidden':![],'depth':null}));}})[_0xce6d('0x19')](function(_0x20b09e){return logger[_0xce6d('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xce6d('0x54'),util[_0xce6d('0x25')](_0x20b09e,{'showHidden':![],'depth':null}));});}else{logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),'csc',_0xce6d('0x64'));}break;case _0xce6d('0x65'):if(_0x542914[_0xce6d('0x56')]){var _0x30408f={'method':_0xce6d('0x2f'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x542914[_0xce6d('0x56')]},'body':{'content':_0x5c0282[_0xce6d('0xd')],'to':[_0x5c0282['phone']],'from':_0x542914['phone'],'binary':![],'clientMessageId':_0xce6d('0x66'),'charset':_0xce6d('0x67')},'json':!![]};rp(_0x30408f)['then'](function(_0x48b0fa){if(!_0x48b0fa[_0xce6d('0x26')]){var _0x4587f6={'messageId':_0x48b0fa[_0xce6d('0x44')][0x0]['apiMessageId']};if(!_0x542914[_0xce6d('0x33')]){_0x4587f6['read']=!![];}return _0x277ed1[_0xce6d('0x18')](_0x4587f6);}else{return logger['error'](_0xce6d('0x23'),_0xce6d('0x24'),'clickatell',util[_0xce6d('0x25')](_0x48b0fa['error'],{'showHidden':![],'depth':null}));}})[_0xce6d('0x19')](function(_0x3c9be0){return logger[_0xce6d('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xce6d('0x24'),_0xce6d('0x65'),util['inspect'](_0x3c9be0,{'showHidden':![],'depth':null}));});}else{logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x65'),_0xce6d('0x64'));}break;case'bandwidth':if(_0x542914['username']&&_0x542914[_0xce6d('0x29')]){var _0x1b627c=util[_0xce6d('0x3c')](_0xce6d('0x68'),_0x542914[_0xce6d('0x28')],_0x542914[_0xce6d('0x29')]);var _0x4afca2={'method':_0xce6d('0x2f'),'uri':_0xce6d('0x69')+_0x542914['accountId']+_0xce6d('0x6a'),'body':{'to':[_0x5c0282[_0xce6d('0x1f')]],'text':_0x5c0282[_0xce6d('0xd')],'from':_0x542914[_0xce6d('0x1f')],'applicationId':_0x542914[_0xce6d('0x6b')]},'headers':{'Authorization':util[_0xce6d('0x3c')]('Basic\x20%s',new Buffer(_0x1b627c)[_0xce6d('0x3e')](_0xce6d('0x3f')))},'json':!![]};rp(_0x4afca2)[_0xce6d('0x17')](function(_0x31e71c){if(_0x31e71c['id']){var _0x44c9e={'messageId':_0x31e71c['id']};return _0x277ed1[_0xce6d('0x18')](_0x44c9e);}else{logger['error'](_0xce6d('0x23'),_0xce6d('0x24'),'bandwidth',util[_0xce6d('0x25')](_0x31e71c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x54151b){logger['error'](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x6c'),util[_0xce6d('0x25')](_0x54151b,{'showHidden':![],'depth':null}));});}else{logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xce6d('0x6d'):if(_0x542914[_0xce6d('0x56')]){var _0x5c0c45={};var _0x23341f={'method':_0xce6d('0x2f'),'uri':_0xce6d('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x542914[_0xce6d('0x56')],'Content-Type':_0xce6d('0x51')},'body':{'from':_0x542914['phone'],'to':_0x5c0282['phone'],'text':_0x5c0282[_0xce6d('0xd')]},'json':!![]};return rp(_0x23341f)[_0xce6d('0x17')](function(_0x507dcb){if(_0x507dcb[_0xce6d('0x6f')]==0xca){_0x5c0c45[_0xce6d('0x70')]=_0x507dcb;var _0x945809={'method':_0xce6d('0x2f'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xce6d('0x71')+_0x542914['apiKey'],'Content-Type':_0xce6d('0x51')},'body':{'refid':_0x5c0c45['message'][_0xce6d('0x72')]},'json':!![]};return rp(_0x945809)[_0xce6d('0x17')](function(_0xd3f5dc){_0x5c0c45[_0xce6d('0x73')]=_0xd3f5dc;var _0x55891={'messageId':_0x5c0c45[_0xce6d('0x70')][_0xce6d('0x72')],'read':!![]};return _0x277ed1[_0xce6d('0x18')](_0x55891);});}else{return logger['error'](_0xce6d('0x23'),_0xce6d('0x24'),'intelepeer',util[_0xce6d('0x25')](_0x507dcb,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5d938d){return logger[_0xce6d('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xce6d('0x6d'),util[_0xce6d('0x25')](_0x5d938d,{'showHidden':![],'depth':null}));});}else{return logger[_0xce6d('0x26')](_0xce6d('0x23'),_0xce6d('0x24'),_0xce6d('0x6d'),_0xce6d('0x74'));}break;}}})[_0xce6d('0x75')](function(){_0x243f6c();});}else{_0x243f6c();}}},'charset':_0xce6d('0x76'),'collate':_0xce6d('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 8e89ded..98be016 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 _0x7d65=['options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7d65,0x134));var _0x57d6=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7d65[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x57d6('0x0'));var util=require(_0x57d6('0x1'));var moment=require('moment');var BPromise=require(_0x57d6('0x2'));var rs=require(_0x57d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57d6('0x4'))['db'];var utils=require(_0x57d6('0x5'));var logger=require(_0x57d6('0x6'))(_0x57d6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d6('0x8')][_0x57d6('0x9')]({'port':0x232a});config['redis']=_[_0x57d6('0xa')](config['redis'],{'host':_0x57d6('0xb'),'port':0x18eb});var socket=require(_0x57d6('0xc'))(new Redis(config[_0x57d6('0xd')]));require(_0x57d6('0xe'))['register'](socket);function respondWithRpcPromise(_0x54c792,_0x45398f,_0x170c59){return new BPromise(function(_0x18348c,_0x2536ab){return client[_0x57d6('0xf')](_0x54c792,_0x170c59)[_0x57d6('0x10')](function(_0x48fee0){logger[_0x57d6('0x11')](_0x57d6('0x12'),_0x45398f,_0x57d6('0x13'));logger[_0x57d6('0x14')](_0x57d6('0x15'),_0x45398f,_0x57d6('0x13'),JSON[_0x57d6('0x16')](_0x48fee0));if(_0x48fee0[_0x57d6('0x17')]){if(_0x48fee0[_0x57d6('0x17')][_0x57d6('0x18')]===0x1f4){logger['error'](_0x57d6('0x12'),_0x45398f,_0x48fee0[_0x57d6('0x17')]['message']);return _0x2536ab(_0x48fee0[_0x57d6('0x17')][_0x57d6('0x19')]);}logger[_0x57d6('0x17')](_0x57d6('0x12'),_0x45398f,_0x48fee0[_0x57d6('0x17')][_0x57d6('0x19')]);return _0x18348c(_0x48fee0['error'][_0x57d6('0x19')]);}else{logger[_0x57d6('0x11')](_0x57d6('0x12'),_0x45398f,_0x57d6('0x13'));_0x18348c(_0x48fee0[_0x57d6('0x1a')]['message']);}})[_0x57d6('0x1b')](function(_0x1356ee){logger[_0x57d6('0x17')](_0x57d6('0x12'),_0x45398f,_0x1356ee);_0x2536ab(_0x1356ee);});});}exports[_0x57d6('0x1c')]=function(_0x12538a){var _0x21eddf=this;return new Promise(function(_0x391a46,_0x353e69){return db[_0x57d6('0x1d')][_0x57d6('0x1e')](_0x12538a[_0x57d6('0x1f')],{'raw':_0x12538a[_0x57d6('0x20')]?_0x12538a[_0x57d6('0x20')][_0x57d6('0x21')]===undefined?!![]:![]:!![]})[_0x57d6('0x10')](function(_0x30a237){logger[_0x57d6('0x11')](_0x57d6('0x1c'),_0x12538a);logger[_0x57d6('0x14')](_0x57d6('0x1c'),_0x12538a,JSON[_0x57d6('0x16')](_0x30a237));_0x391a46(_0x30a237);})[_0x57d6('0x1b')](function(_0x41fa2c){logger[_0x57d6('0x17')]('CreateSmsMessage',_0x41fa2c[_0x57d6('0x19')],_0x12538a);_0x353e69(_0x21eddf['error'](0x1f4,_0x41fa2c['message']));});});}; \ No newline at end of file +var _0x522b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsMessage','SmsMessage','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1b4569,_0x195ed5){var _0x3eb5ec=function(_0x5e90cb){while(--_0x5e90cb){_0x1b4569['push'](_0x1b4569['shift']());}};_0x3eb5ec(++_0x195ed5);}(_0x522b,0x101));var _0xb522=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x522b[_0x96f74c];return _0x379222;};'use strict';var _=require(_0xb522('0x0'));var util=require(_0xb522('0x1'));var moment=require(_0xb522('0x2'));var BPromise=require(_0xb522('0x3'));var rs=require(_0xb522('0x4'));var fs=require('fs');var Redis=require(_0xb522('0x5'));var db=require(_0xb522('0x6'))['db'];var utils=require(_0xb522('0x7'));var logger=require(_0xb522('0x8'))('rpc');var config=require(_0xb522('0x9'));var jayson=require(_0xb522('0xa'));var client=jayson[_0xb522('0xb')][_0xb522('0xc')]({'port':0x232a});config[_0xb522('0xd')]=_[_0xb522('0xe')](config[_0xb522('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xb522('0xf'))(new Redis(config[_0xb522('0xd')]));require('./smsMessage.socket')[_0xb522('0x10')](socket);function respondWithRpcPromise(_0x44b2b7,_0x12b83f,_0x2aa38f){return new BPromise(function(_0x31554e,_0x183c15){return client[_0xb522('0x11')](_0x44b2b7,_0x2aa38f)[_0xb522('0x12')](function(_0x438ee1){logger[_0xb522('0x13')](_0xb522('0x14'),_0x12b83f,_0xb522('0x15'));logger[_0xb522('0x16')](_0xb522('0x17'),_0x12b83f,_0xb522('0x15'),JSON[_0xb522('0x18')](_0x438ee1));if(_0x438ee1[_0xb522('0x19')]){if(_0x438ee1[_0xb522('0x19')][_0xb522('0x1a')]===0x1f4){logger[_0xb522('0x19')](_0xb522('0x14'),_0x12b83f,_0x438ee1[_0xb522('0x19')]['message']);return _0x183c15(_0x438ee1[_0xb522('0x19')]['message']);}logger['error'](_0xb522('0x14'),_0x12b83f,_0x438ee1[_0xb522('0x19')][_0xb522('0x1b')]);return _0x31554e(_0x438ee1[_0xb522('0x19')][_0xb522('0x1b')]);}else{logger[_0xb522('0x13')](_0xb522('0x14'),_0x12b83f,_0xb522('0x15'));_0x31554e(_0x438ee1['result'][_0xb522('0x1b')]);}})[_0xb522('0x1c')](function(_0x2b55db){logger[_0xb522('0x19')](_0xb522('0x14'),_0x12b83f,_0x2b55db);_0x183c15(_0x2b55db);});});}exports[_0xb522('0x1d')]=function(_0x2a4982){var _0x3749b4=this;return new Promise(function(_0x23d79c,_0x4cc153){return db[_0xb522('0x1e')]['create'](_0x2a4982['body'],{'raw':_0x2a4982['options']?_0x2a4982[_0xb522('0x1f')][_0xb522('0x20')]===undefined?!![]:![]:!![]})[_0xb522('0x12')](function(_0x40a7f1){logger[_0xb522('0x13')](_0xb522('0x1d'),_0x2a4982);logger[_0xb522('0x16')](_0xb522('0x1d'),_0x2a4982,JSON['stringify'](_0x40a7f1));_0x23d79c(_0x40a7f1);})[_0xb522('0x1c')](function(_0x5e7ea2){logger['error'](_0xb522('0x1d'),_0x5e7ea2[_0xb522('0x1b')],_0x2a4982);_0x4cc153(_0x3749b4[_0xb522('0x19')](0x1f4,_0x5e7ea2[_0xb522('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 745037b..0211683 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 _0x36fc=['length','update','emit','register'];(function(_0x22cb10,_0x20db4f){var _0x38a6f8=function(_0xdb4b16){while(--_0xdb4b16){_0x22cb10['push'](_0x22cb10['shift']());}};_0x38a6f8(++_0x20db4f);}(_0x36fc,0x79));var _0xc36f=function(_0x59fd58,_0x133d14){_0x59fd58=_0x59fd58-0x0;var _0x1d0391=_0x36fc[_0x59fd58];return _0x1d0391;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove',_0xc36f('0x0')];function createListener(_0x3484df,_0x11cbe8){return function(_0x504c09){_0x11cbe8[_0xc36f('0x1')](_0x3484df,_0x504c09);};}function removeListener(_0x122d66,_0x1c1f72){return function(){SmsMessageEvents['removeListener'](_0x122d66,_0x1c1f72);};}exports[_0xc36f('0x2')]=function(_0x2c6b9d){for(var _0x356912=0x0,_0x59ab49=events[_0xc36f('0x3')];_0x356912<_0x59ab49;_0x356912++){var _0x4cb203=events[_0x356912];var _0x2586f7=createListener('smsMessage:'+_0x4cb203,_0x2c6b9d);SmsMessageEvents['on'](_0x4cb203,_0x2586f7);}}; \ No newline at end of file +var _0xed05=['./smsMessage.events','save','remove','update','emit','removeListener','register','length','smsMessage:'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xed05,0x13b));var _0x5ed0=function(_0x149af9,_0x1658ac){_0x149af9=_0x149af9-0x0;var _0x35b296=_0xed05[_0x149af9];return _0x35b296;};'use strict';var SmsMessageEvents=require(_0x5ed0('0x0'));var events=[_0x5ed0('0x1'),_0x5ed0('0x2'),_0x5ed0('0x3')];function createListener(_0x378e6b,_0x2148e6){return function(_0x323560){_0x2148e6[_0x5ed0('0x4')](_0x378e6b,_0x323560);};}function removeListener(_0x1005ac,_0x420184){return function(){SmsMessageEvents[_0x5ed0('0x5')](_0x1005ac,_0x420184);};}exports[_0x5ed0('0x6')]=function(_0x21d527){for(var _0x19ccca=0x0,_0x15f293=events[_0x5ed0('0x7')];_0x19ccca<_0x15f293;_0x19ccca++){var _0x1ae41c=events[_0x19ccca];var _0x5b5954=createListener(_0x5ed0('0x8')+_0x1ae41c,_0x21d527);SmsMessageEvents['on'](_0x1ae41c,_0x5b5954);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 98dcde8..68f4783 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 _0x2ef1=['getAgents','post','create','addTeams','addAgents','put','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/members','/:id/teams','/:id/users'];(function(_0x277f61,_0x3e133b){var _0x5e6527=function(_0x195975){while(--_0x195975){_0x277f61['push'](_0x277f61['shift']());}};_0x5e6527(++_0x3e133b);}(_0x2ef1,0x81));var _0x12ef=function(_0x36d3ad,_0x5870e2){_0x36d3ad=_0x36d3ad-0x0;var _0x5db737=_0x2ef1[_0x36d3ad];return _0x5db737;};'use strict';var multer=require(_0x12ef('0x0'));var util=require(_0x12ef('0x1'));var path=require(_0x12ef('0x2'));var timeout=require(_0x12ef('0x3'));var express=require('express');var router=express[_0x12ef('0x4')]();var fs_extra=require(_0x12ef('0x5'));var auth=require(_0x12ef('0x6'));var interaction=require(_0x12ef('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x12ef('0x8')]('/',auth[_0x12ef('0x9')](),controller[_0x12ef('0xa')]);router[_0x12ef('0x8')]('/describe',auth[_0x12ef('0x9')](),controller['describe']);router['get'](_0x12ef('0xb'),auth[_0x12ef('0x9')](),controller['show']);router[_0x12ef('0x8')](_0x12ef('0xc'),auth[_0x12ef('0x9')](),controller['getMembers']);router[_0x12ef('0x8')](_0x12ef('0xd'),auth['isAuthenticated'](),controller['getTeams']);router[_0x12ef('0x8')](_0x12ef('0xe'),auth['isAuthenticated'](),controller[_0x12ef('0xf')]);router[_0x12ef('0x10')]('/',auth[_0x12ef('0x9')](),controller[_0x12ef('0x11')]);router['post'](_0x12ef('0xd'),auth['isAuthenticated'](),controller[_0x12ef('0x12')]);router['post'](_0x12ef('0xe'),auth['isAuthenticated'](),controller[_0x12ef('0x13')]);router[_0x12ef('0x14')](_0x12ef('0xb'),auth[_0x12ef('0x9')](),controller['update']);router[_0x12ef('0x15')](_0x12ef('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x12ef('0x15')](_0x12ef('0xd'),auth[_0x12ef('0x9')](),controller['removeTeams']);router[_0x12ef('0x15')]('/:id/users',auth[_0x12ef('0x9')](),controller[_0x12ef('0x16')]);module[_0x12ef('0x17')]=router; \ No newline at end of file +var _0x3ee1=['../../components/interaction/service','../../config/environment','./smsQueue.controller','index','get','/describe','isAuthenticated','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','delete','/:id','removeTeams','exports','multer','util','express','fs-extra'];(function(_0x4ead7a,_0x55d106){var _0x1143e0=function(_0x33fa0e){while(--_0x33fa0e){_0x4ead7a['push'](_0x4ead7a['shift']());}};_0x1143e0(++_0x55d106);}(_0x3ee1,0x92));var _0x13ee=function(_0x278568,_0x22b2f8){_0x278568=_0x278568-0x0;var _0x4733db=_0x3ee1[_0x278568];return _0x4733db;};'use strict';var multer=require(_0x13ee('0x0'));var util=require(_0x13ee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x13ee('0x2'));var router=express['Router']();var fs_extra=require(_0x13ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x13ee('0x4'));var config=require(_0x13ee('0x5'));var controller=require(_0x13ee('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x13ee('0x7')]);router[_0x13ee('0x8')](_0x13ee('0x9'),auth[_0x13ee('0xa')](),controller[_0x13ee('0xb')]);router[_0x13ee('0x8')]('/:id',auth[_0x13ee('0xa')](),controller[_0x13ee('0xc')]);router[_0x13ee('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x13ee('0xd')]);router['get'](_0x13ee('0xe'),auth['isAuthenticated'](),controller[_0x13ee('0xf')]);router['get'](_0x13ee('0x10'),auth[_0x13ee('0xa')](),controller[_0x13ee('0x11')]);router['post']('/',auth[_0x13ee('0xa')](),controller[_0x13ee('0x12')]);router[_0x13ee('0x13')](_0x13ee('0xe'),auth[_0x13ee('0xa')](),controller['addTeams']);router[_0x13ee('0x13')](_0x13ee('0x10'),auth[_0x13ee('0xa')](),controller[_0x13ee('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x13ee('0x15')](_0x13ee('0x16'),auth[_0x13ee('0xa')](),controller['destroy']);router[_0x13ee('0x15')]('/:id/teams',auth[_0x13ee('0xa')](),controller[_0x13ee('0x17')]);router[_0x13ee('0x15')](_0x13ee('0x10'),auth[_0x13ee('0xa')](),controller['removeAgents']);module[_0x13ee('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 77c60d9..35f634a 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 _0xaa47=['beepall','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x43656e,_0x2c0bf5){var _0x4fc65f=function(_0x1c785f){while(--_0x1c785f){_0x43656e['push'](_0x43656e['shift']());}};_0x4fc65f(++_0x2c0bf5);}(_0xaa47,0x127));var _0x7aa4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xaa47[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x7aa4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7aa4('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7aa4('0x2')]},'timeout':{'type':Sequelize[_0x7aa4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7aa4('0x4')](_0x7aa4('0x5'),_0x7aa4('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xd19b=['beepall','roundrobin','sequelize','exports','STRING','ENUM','rrmemory'];(function(_0x2b9f2b,_0x5e4c07){var _0x5a4651=function(_0xa36f6f){while(--_0xa36f6f){_0x2b9f2b['push'](_0x2b9f2b['shift']());}};_0x5a4651(++_0x5e4c07);}(_0xd19b,0x1d7));var _0xbd19=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd19b[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xbd19('0x0'));module[_0xbd19('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbd19('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbd19('0x3')](_0xbd19('0x4'),_0xbd19('0x5'),_0xbd19('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 3f0330a..2342e75 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 _0x9092=['union','compact','value','ids','removeAgents','forEach','emit','addAgents','spread','userSmsQueue:save','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./smsQueue.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','SmsQueues','sendStatus','error','stack','name','index','map','SmsQueue','fieldName','type','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','find','params','describe','getMembers','findOne','length','order','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','smsPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes'];(function(_0x327ed4,_0x9603eb){var _0x3f0a3a=function(_0x565806){while(--_0x565806){_0x327ed4['push'](_0x327ed4['shift']());}};_0x3f0a3a(++_0x9603eb);}(_0x9092,0x95));var _0x2909=function(_0x3d0b57,_0x4288e2){_0x3d0b57=_0x3d0b57-0x0;var _0xd6325d=_0x9092[_0x3d0b57];return _0xd6325d;};'use strict';var emlformat=require(_0x2909('0x0'));var rimraf=require(_0x2909('0x1'));var zipdir=require(_0x2909('0x2'));var jsonpatch=require(_0x2909('0x3'));var rp=require(_0x2909('0x4'));var moment=require('moment');var BPromise=require(_0x2909('0x5'));var Mustache=require(_0x2909('0x6'));var util=require(_0x2909('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2909('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2909('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2909('0xa'));var jsforce=require(_0x2909('0xb'));var deskjs=require(_0x2909('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2909('0xd'));var Papa=require(_0x2909('0xe'));var Redis=require('ioredis');var authService=require(_0x2909('0xf'));var qs=require(_0x2909('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2909('0x11'));var logger=require('../../config/logger')(_0x2909('0x12'));var utils=require(_0x2909('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2909('0x14'));var db=require(_0x2909('0x15'))['db'];config[_0x2909('0x16')]=_[_0x2909('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2909('0x18'))[_0x2909('0x19')](socket);function respondWithStatusCode(_0x50e5c0,_0x308742){_0x308742=_0x308742||0xcc;return function(_0x22ca7a){if(_0x22ca7a){return _0x50e5c0['sendStatus'](_0x308742);}return _0x50e5c0['status'](_0x308742)[_0x2909('0x1a')]();};}function respondWithResult(_0x38b447,_0x381838){_0x381838=_0x381838||0xc8;return function(_0x486238){if(_0x486238){return _0x38b447[_0x2909('0x1b')](_0x381838)[_0x2909('0x1c')](_0x486238);}};}function respondWithFilteredResult(_0x5e84cd,_0x218049){return function(_0x27dba6){if(_0x27dba6){var _0x4ecaa8=typeof _0x218049[_0x2909('0x1d')]===_0x2909('0x1e')&&typeof _0x218049[_0x2909('0x1f')]==='undefined';var _0xd09e6d=_0x27dba6[_0x2909('0x20')];var _0x30f746=_0x4ecaa8?0x0:_0x218049[_0x2909('0x1d')];var _0x42280d=_0x4ecaa8?_0x27dba6[_0x2909('0x20')]:_0x218049['offset']+_0x218049[_0x2909('0x1f')];var _0x565446;if(_0x42280d>=_0xd09e6d){_0x42280d=_0xd09e6d;_0x565446=0xc8;}else{_0x565446=0xce;}_0x5e84cd[_0x2909('0x1b')](_0x565446);return _0x5e84cd[_0x2909('0x21')](_0x2909('0x22'),_0x30f746+'-'+_0x42280d+'/'+_0xd09e6d)[_0x2909('0x1c')](_0x27dba6);}return null;};}function patchUpdates(_0x53ac5e){return function(_0x507eb4){try{jsonpatch['apply'](_0x507eb4,_0x53ac5e,!![]);}catch(_0x44b62f){return BPromise['reject'](_0x44b62f);}return _0x507eb4[_0x2909('0x23')]();};}function saveUpdates(_0x29c1ea,_0xd68b16){return function(_0x392a22){if(_0x392a22){return _0x392a22[_0x2909('0x24')](_0x29c1ea)['then'](function(_0x634877){return _0x634877;});}return null;};}function removeEntity(_0x15de97,_0x58795b){return function(_0x1eba64){if(_0x1eba64){return _0x1eba64[_0x2909('0x25')]()[_0x2909('0x26')](function(){var _0x3c9284=_0x1eba64['get']({'plain':!![]});var _0x1d9b40=_0x2909('0x27');return db['UserProfileResource'][_0x2909('0x25')]({'where':{'type':_0x1d9b40,'resourceId':_0x3c9284['id']}})['then'](function(){return _0x1eba64;});})['then'](function(){_0x15de97[_0x2909('0x1b')](0xcc)[_0x2909('0x1a')]();});}};}function handleEntityNotFound(_0x1279fd,_0x4f2b1c){return function(_0x3866d5){if(!_0x3866d5){_0x1279fd[_0x2909('0x28')](0x194);}return _0x3866d5;};}function handleError(_0x1926c6,_0x4da810){_0x4da810=_0x4da810||0x1f4;return function(_0x41f5e7){logger[_0x2909('0x29')](_0x41f5e7[_0x2909('0x2a')]);if(_0x41f5e7[_0x2909('0x2b')]){delete _0x41f5e7[_0x2909('0x2b')];}_0x1926c6[_0x2909('0x1b')](_0x4da810)['send'](_0x41f5e7);};}exports[_0x2909('0x2c')]=function(_0xe3b642,_0x1d06a0){var _0x13029a={},_0x5efc5c={},_0x276bfa={'count':0x0,'rows':[]};var _0x208de5=_[_0x2909('0x2d')](db[_0x2909('0x2e')]['rawAttributes'],function(_0x8898bf){return{'name':_0x8898bf[_0x2909('0x2f')],'type':_0x8898bf[_0x2909('0x30')]['key']};});_0x5efc5c['model']=_[_0x2909('0x2d')](_0x208de5,'name');_0x5efc5c['query']=_[_0x2909('0x31')](_0xe3b642[_0x2909('0x32')]);_0x5efc5c[_0x2909('0x33')]=_[_0x2909('0x34')](_0x5efc5c[_0x2909('0x35')],_0x5efc5c[_0x2909('0x32')]);_0x13029a['attributes']=_[_0x2909('0x34')](_0x5efc5c[_0x2909('0x35')],qs['fields'](_0xe3b642[_0x2909('0x32')][_0x2909('0x36')]));_0x13029a['attributes']=_0x13029a[_0x2909('0x37')]['length']?_0x13029a[_0x2909('0x37')]:_0x5efc5c[_0x2909('0x35')];if(!_0xe3b642[_0x2909('0x32')][_0x2909('0x38')](_0x2909('0x39'))){_0x13029a[_0x2909('0x1f')]=qs[_0x2909('0x1f')](_0xe3b642[_0x2909('0x32')][_0x2909('0x1f')]);_0x13029a[_0x2909('0x1d')]=qs[_0x2909('0x1d')](_0xe3b642['query']['offset']);}_0x13029a['order']=qs[_0x2909('0x3a')](_0xe3b642['query'][_0x2909('0x3a')]);_0x13029a[_0x2909('0x3b')]=qs[_0x2909('0x33')](_[_0x2909('0x3c')](_0xe3b642[_0x2909('0x32')],_0x5efc5c[_0x2909('0x33')]),_0x208de5);if(_0xe3b642[_0x2909('0x32')][_0x2909('0x3d')]){_0x13029a['where']=_[_0x2909('0x3e')](_0x13029a[_0x2909('0x3b')],{'$or':_['map'](_0x208de5,function(_0x4a1924){if(_0x4a1924['type']!==_0x2909('0x3f')){var _0x597654={};_0x597654[_0x4a1924[_0x2909('0x2b')]]={'$like':'%'+_0xe3b642[_0x2909('0x32')][_0x2909('0x3d')]+'%'};return _0x597654;}})});}_0x13029a=_['merge']({},_0x13029a,_0xe3b642[_0x2909('0x40')]);var _0x49a980={'where':_0x13029a['where']};return db['SmsQueue'][_0x2909('0x20')](_0x49a980)[_0x2909('0x26')](function(_0x460f7d){_0x276bfa['count']=_0x460f7d;if(_0xe3b642[_0x2909('0x32')][_0x2909('0x41')]){_0x13029a[_0x2909('0x42')]=[{'all':!![]}];}return db[_0x2909('0x2e')][_0x2909('0x43')](_0x13029a);})[_0x2909('0x26')](function(_0x36e8d8){_0x276bfa[_0x2909('0x44')]=_0x36e8d8;return _0x276bfa;})[_0x2909('0x26')](respondWithFilteredResult(_0x1d06a0,_0x13029a))[_0x2909('0x45')](handleError(_0x1d06a0,null));};exports[_0x2909('0x46')]=function(_0x5a1fbe,_0x247988){var _0x378dd2={'raw':!![],'where':{'id':_0x5a1fbe['params']['id']}},_0x2909a9={};_0x2909a9[_0x2909('0x35')]=_['keys'](db[_0x2909('0x2e')][_0x2909('0x47')]);_0x2909a9[_0x2909('0x32')]=_['keys'](_0x5a1fbe[_0x2909('0x32')]);_0x2909a9['filters']=_[_0x2909('0x34')](_0x2909a9['model'],_0x2909a9[_0x2909('0x32')]);_0x378dd2[_0x2909('0x37')]=_['intersection'](_0x2909a9[_0x2909('0x35')],qs[_0x2909('0x36')](_0x5a1fbe[_0x2909('0x32')][_0x2909('0x36')]));_0x378dd2[_0x2909('0x37')]=_0x378dd2[_0x2909('0x37')]['length']?_0x378dd2['attributes']:_0x2909a9[_0x2909('0x35')];if(_0x5a1fbe['query'][_0x2909('0x41')]){_0x378dd2[_0x2909('0x42')]=[{'all':!![]}];}_0x378dd2=_['merge']({},_0x378dd2,_0x5a1fbe[_0x2909('0x40')]);return db[_0x2909('0x2e')]['find'](_0x378dd2)[_0x2909('0x26')](handleEntityNotFound(_0x247988,null))[_0x2909('0x26')](respondWithResult(_0x247988,null))['catch'](handleError(_0x247988,null));};exports[_0x2909('0x48')]=function(_0x38e758,_0x1d80d4){return db['SmsQueue'][_0x2909('0x48')](_0x38e758[_0x2909('0x49')],{})[_0x2909('0x26')](function(_0x234fe9){var _0x5e9ee2=_0x38e758[_0x2909('0x4a')][_0x2909('0x4b')]({'plain':!![]});if(!_0x5e9ee2)throw new Error(_0x2909('0x4c'));if(_0x5e9ee2[_0x2909('0x4d')]===_0x2909('0x4a')){var _0x370a85=_0x234fe9[_0x2909('0x4b')]({'plain':!![]});var _0x394aa3=_0x2909('0x27');return db[_0x2909('0x4e')]['find']({'where':{'name':_0x394aa3,'userProfileId':_0x5e9ee2[_0x2909('0x4f')]},'raw':!![]})[_0x2909('0x26')](function(_0x4ee42a){if(_0x4ee42a&&_0x4ee42a[_0x2909('0x50')]===0x0){return db[_0x2909('0x51')][_0x2909('0x48')]({'name':_0x370a85[_0x2909('0x2b')],'resourceId':_0x370a85['id'],'type':_0x4ee42a[_0x2909('0x2b')],'sectionId':_0x4ee42a['id']},{})[_0x2909('0x26')](function(){return _0x234fe9;});}else{return _0x234fe9;}})['catch'](function(_0x13eba9){logger[_0x2909('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13eba9);throw _0x13eba9;});}return _0x234fe9;})['then'](respondWithResult(_0x1d80d4,0xc9))['catch'](handleError(_0x1d80d4,null));};exports['update']=function(_0x5cd038,_0x42b178){if(_0x5cd038[_0x2909('0x49')]['id']){delete _0x5cd038[_0x2909('0x49')]['id'];}return db[_0x2909('0x2e')][_0x2909('0x52')]({'where':{'id':_0x5cd038[_0x2909('0x53')]['id']}})['then'](handleEntityNotFound(_0x42b178,null))[_0x2909('0x26')](saveUpdates(_0x5cd038[_0x2909('0x49')],null))[_0x2909('0x26')](respondWithResult(_0x42b178,null))[_0x2909('0x45')](handleError(_0x42b178,null));};exports[_0x2909('0x25')]=function(_0x40857b,_0x2d51bb){return db['SmsQueue']['find']({'where':{'id':_0x40857b[_0x2909('0x53')]['id']}})[_0x2909('0x26')](handleEntityNotFound(_0x2d51bb,null))['then'](removeEntity(_0x2d51bb,null))[_0x2909('0x45')](handleError(_0x2d51bb,null));};exports[_0x2909('0x54')]=function(_0x1cfd4e,_0x58185e){return db[_0x2909('0x2e')][_0x2909('0x54')]()[_0x2909('0x26')](respondWithResult(_0x58185e,null))['catch'](handleError(_0x58185e,null));};exports[_0x2909('0x55')]=function(_0x2e14e6,_0x1b60d2,_0x4c227d){var _0xd2a399={'raw':!![],'where':{}},_0x589b32={},_0x180db2;return db[_0x2909('0x2e')][_0x2909('0x56')]({'where':{'id':_0x2e14e6[_0x2909('0x53')]['id']}})[_0x2909('0x26')](handleEntityNotFound(_0x1b60d2,null))[_0x2909('0x26')](function(_0x374062){if(_0x374062){_0x180db2=_0x374062[_0x2909('0x4b')]({'plain':!![]});_0x589b32[_0x2909('0x35')]=_[_0x2909('0x31')](db['UserSmsQueue'][_0x2909('0x47')]);_0x589b32[_0x2909('0x32')]=_[_0x2909('0x31')](_0x2e14e6[_0x2909('0x32')]);_0x589b32[_0x2909('0x33')]=_[_0x2909('0x34')](_0x589b32['model'],_0x589b32[_0x2909('0x32')]);_0xd2a399[_0x2909('0x37')]=_[_0x2909('0x34')](_0x589b32[_0x2909('0x35')],qs[_0x2909('0x36')](_0x2e14e6['query']['fields']));_0xd2a399[_0x2909('0x37')]=_0xd2a399[_0x2909('0x37')][_0x2909('0x57')]?_0xd2a399[_0x2909('0x37')]:_0x589b32[_0x2909('0x35')];if(!_0x2e14e6[_0x2909('0x32')][_0x2909('0x38')](_0x2909('0x39'))){_0xd2a399[_0x2909('0x1f')]=qs[_0x2909('0x1f')](_0x2e14e6[_0x2909('0x32')]['limit']);_0xd2a399[_0x2909('0x1d')]=qs['offset'](_0x2e14e6[_0x2909('0x32')][_0x2909('0x1d')]);}_0xd2a399[_0x2909('0x58')]=qs['sort'](_0x2e14e6[_0x2909('0x32')][_0x2909('0x3a')]);_0xd2a399[_0x2909('0x3b')]=qs[_0x2909('0x33')](_['pick'](_0x2e14e6[_0x2909('0x32')],_0x589b32[_0x2909('0x33')]));_0xd2a399[_0x2909('0x3b')][_0x2909('0x59')]=_0x374062['id'];if(_0x2e14e6[_0x2909('0x32')]['filter']){_0xd2a399['where']=_['merge'](_0xd2a399['where'],{'$or':_[_0x2909('0x2d')](_0xd2a399[_0x2909('0x37')],function(_0x4176b2){var _0x45e907={};_0x45e907[_0x4176b2]={'$like':'%'+_0x2e14e6[_0x2909('0x32')]['filter']+'%'};return _0x45e907;})});}_0xd2a399=_[_0x2909('0x3e')]({},_0xd2a399,_0x2e14e6[_0x2909('0x40')]);return db[_0x2909('0x5a')]['findAll'](_0xd2a399);}})[_0x2909('0x26')](function(_0x540e79){if(_0x540e79){return db[_0x2909('0x5b')][_0x2909('0x5c')]({'where':{'id':_[_0x2909('0x2d')](_0x540e79,_0x2909('0x5d')),'role':'agent'},'attributes':['id',_0x2909('0x2b'),_0x2909('0x5e'),'updatedAt',_0x2909('0x5f')]});}})[_0x2909('0x26')](function(_0x481d41){if(_0x481d41){return{'count':_0x481d41[_0x2909('0x20')],'rows':_[_0x2909('0x2d')](_0x481d41[_0x2909('0x44')],function(_0x6a23af){return{'membername':_0x6a23af[_0x2909('0x2b')],'UserId':_0x6a23af['id'],'queue_name':_0x180db2[_0x2909('0x2b')],'SmsQueueId':_0x180db2['id'],'interface':util['format'](_0x2909('0x60'),_0x2909('0x61'),_0x6a23af[_0x2909('0x2b')]),'penalty':0x0,'paused':_0x6a23af[_0x2909('0x5e')],'createdAt':_0x6a23af[_0x2909('0x5f')],'updatedAt':_0x6a23af[_0x2909('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1b60d2,_0xd2a399))[_0x2909('0x45')](handleError(_0x1b60d2,null));};exports[_0x2909('0x63')]=function(_0xa15c95,_0x4d69b2,_0x320535){var _0x15e456={};var _0x5d5ddd={};var _0x9b9dd4;var _0x4343b1;return db[_0x2909('0x2e')][_0x2909('0x56')]({'where':{'id':_0xa15c95[_0x2909('0x53')]['id']}})[_0x2909('0x26')](handleEntityNotFound(_0x4d69b2,null))['then'](function(_0x1ba93d){if(_0x1ba93d){_0x9b9dd4=_0x1ba93d;_0x5d5ddd[_0x2909('0x35')]=_[_0x2909('0x31')](db[_0x2909('0x64')][_0x2909('0x47')]);_0x5d5ddd['query']=_[_0x2909('0x31')](_0xa15c95[_0x2909('0x32')]);_0x5d5ddd[_0x2909('0x33')]=_['intersection'](_0x5d5ddd[_0x2909('0x35')],_0x5d5ddd['query']);_0x15e456[_0x2909('0x37')]=_[_0x2909('0x34')](_0x5d5ddd['model'],qs[_0x2909('0x36')](_0xa15c95[_0x2909('0x32')][_0x2909('0x36')]));_0x15e456[_0x2909('0x37')]=_0x15e456[_0x2909('0x37')][_0x2909('0x57')]?_0x15e456['attributes']:_0x5d5ddd[_0x2909('0x35')];_0x15e456[_0x2909('0x58')]=qs[_0x2909('0x3a')](_0xa15c95[_0x2909('0x32')][_0x2909('0x3a')]);_0x15e456['where']=qs[_0x2909('0x33')](_[_0x2909('0x3c')](_0xa15c95[_0x2909('0x32')],_0x5d5ddd[_0x2909('0x33')]));if(_0xa15c95['query'][_0x2909('0x3d')]){_0x15e456[_0x2909('0x3b')]=_[_0x2909('0x3e')](_0x15e456[_0x2909('0x3b')],{'$or':_['map'](_0x15e456['attributes'],function(_0x580675){var _0x7e26a6={};_0x7e26a6[_0x580675]={'$like':'%'+_0xa15c95['query'][_0x2909('0x3d')]+'%'};return _0x7e26a6;})});}_0x15e456=_[_0x2909('0x3e')]({},_0x15e456,_0xa15c95[_0x2909('0x40')]);return _0x9b9dd4[_0x2909('0x63')](_0x15e456);}})[_0x2909('0x26')](function(_0x416cd6){if(_0x416cd6){_0x4343b1=_0x416cd6[_0x2909('0x57')];if(!_0xa15c95[_0x2909('0x32')][_0x2909('0x38')](_0x2909('0x39'))){_0x15e456[_0x2909('0x1f')]=qs[_0x2909('0x1f')](_0xa15c95['query'][_0x2909('0x1f')]);_0x15e456[_0x2909('0x1d')]=qs[_0x2909('0x1d')](_0xa15c95[_0x2909('0x32')][_0x2909('0x1d')]);}return _0x9b9dd4[_0x2909('0x63')](_0x15e456);}})['then'](function(_0x4a9017){if(_0x4a9017){return _0x4a9017?{'count':_0x4343b1,'rows':_0x4a9017}:null;}})['then'](respondWithResult(_0x4d69b2,null))[_0x2909('0x45')](handleError(_0x4d69b2,null));};exports['addTeams']=function(_0x2d68a0,_0x14f3c3,_0x7c781f){var _0xc049dc=_0x2d68a0['body']['ids'];return db[_0x2909('0x64')][_0x2909('0x43')]({'where':{'id':_0xc049dc},'attributes':['id'],'include':[{'model':db[_0x2909('0x5b')],'as':_0x2909('0x65'),'attributes':['id',_0x2909('0x2b'),'online',_0x2909('0x66'),'interface'],'raw':!![]}]})[_0x2909('0x26')](function(_0x1a55ae){if(_0x1a55ae){var _0x80841f=_[_0x2909('0x67')](_0x1a55ae,function(_0x186782){var _0x3616ba=_0x186782[_0x2909('0x4b')]({'plain':!![]});return _0x3616ba[_0x2909('0x65')];});return db['SmsQueue'][_0x2909('0x52')]({'where':{'id':_0x2d68a0[_0x2909('0x53')]['id']}})[_0x2909('0x26')](function(_0x393bb8){return db[_0x2909('0x68')][_0x2909('0x69')](function(_0xb769a2){return _0x393bb8[_0x2909('0x6a')](_0xc049dc,{'transaction':_0xb769a2})[_0x2909('0x26')](function(){return BPromise[_0x2909('0x6b')](_0x80841f,function(_0x579916){return db[_0x2909('0x5a')][_0x2909('0x6c')]({'where':{'UserId':_0x579916['id'],'SmsQueueId':_0x2d68a0[_0x2909('0x53')]['id']},'transaction':_0xb769a2});});})['then'](function(){_0x80841f['forEach'](function(_0x3359d9){socket['emit']('userSmsQueue:save',{'UserId':_0x3359d9['id'],'SmsQueueId':_0x393bb8['id']});});});});});}})['then'](respondWithStatusCode(_0x14f3c3,null))['catch'](handleError(_0x14f3c3,null));};exports[_0x2909('0x6d')]=function(_0x2591ab,_0x3a03e1,_0x6ba3aa){return db['Team'][_0x2909('0x43')]({'where':{'id':_0x2591ab[_0x2909('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2909('0x5b')],'as':_0x2909('0x65'),'attributes':['id'],'raw':!![]}]})[_0x2909('0x26')](handleEntityNotFound(_0x3a03e1,null))['then'](function(_0x5e14f4){var _0x21112b=_[_0x2909('0x2d')](_0x5e14f4,'id');var _0x3edb66=[];var _0x44e8ed=[];var _0x1b55c7=squel[_0x2909('0x6e')]();_0x1b55c7[_0x2909('0x6f')](_0x2909('0x70'))['from']('team_has_sms_queues','tq')[_0x2909('0x71')](_0x2909('0x72'),'ut',_0x2909('0x73'))[_0x2909('0x3b')](_0x2909('0x74'),_0x2591ab[_0x2909('0x53')]['id']);for(var _0x5f1525=0x0;_0x5f1525<_0x5e14f4[_0x2909('0x57')];_0x5f1525+=0x1){let _0x2dffc0=_0x5e14f4[_0x5f1525];for(var _0x58536c=0x0;_0x58536c<_0x2dffc0[_0x2909('0x65')][_0x2909('0x57')];_0x58536c+=0x1){let _0x4756ae=_0x2dffc0[_0x2909('0x65')][_0x58536c];var _0x3ceaff=_0x1b55c7[_0x2909('0x75')]();_0x3ceaff[_0x2909('0x3b')]('ut.UserId\x20=\x20?',_0x4756ae['id']);_0x44e8ed[_0x2909('0x76')](db[_0x2909('0x68')][_0x2909('0x32')](_0x3ceaff[_0x2909('0x77')](),{'type':db[_0x2909('0x68')][_0x2909('0x78')][_0x2909('0x79')]})['then'](function(_0x1e4275){if(_0x1e4275[_0x2909('0x57')]===0x1){return _0x4756ae['id'];}else{var _0x183b04=_[_0x2909('0x7a')](_[_0x2909('0x2d')](_0x1e4275,_0x2909('0x7b')),function(_0x382845){return _[_0x2909('0x7c')](_0x21112b,_0x382845);});if(_0x183b04){return _0x4756ae['id'];}}}));}}return BPromise['all'](_0x44e8ed)[_0x2909('0x26')](function(_0x57aae1){_0x3edb66=_(_0x3edb66)[_0x2909('0x7d')](_0x57aae1)[_0x2909('0x7e')]()[_0x2909('0x7f')]();return db[_0x2909('0x2e')][_0x2909('0x52')]({'where':{'id':_0x2591ab[_0x2909('0x53')]['id']}})['then'](function(_0x2296f4){return db[_0x2909('0x68')][_0x2909('0x69')](function(_0x15ac9a){return _0x2296f4[_0x2909('0x6d')](_0x2591ab[_0x2909('0x32')][_0x2909('0x80')],{'transaction':_0x15ac9a})['then'](function(){if(!_['isEmpty'](_0x3edb66)){return _0x2296f4[_0x2909('0x81')](_0x3edb66,{'transaction':_0x15ac9a});}})[_0x2909('0x26')](function(){_0x3edb66[_0x2909('0x82')](function(_0x4314ce){socket[_0x2909('0x83')]('userSmsQueue:remove',{'UserId':_0x4314ce,'SmsQueueId':_0x2296f4['id']});});});});});});})[_0x2909('0x26')](respondWithStatusCode(_0x3a03e1,null))[_0x2909('0x45')](handleError(_0x3a03e1,null));};exports[_0x2909('0x84')]=function(_0x1d1885,_0x429004,_0x3ded52){return db[_0x2909('0x2e')][_0x2909('0x52')]({'where':{'id':_0x1d1885[_0x2909('0x53')]['id']}})[_0x2909('0x26')](handleEntityNotFound(_0x429004,null))[_0x2909('0x26')](function(_0x3b1d1c){if(_0x3b1d1c){return _0x3b1d1c[_0x2909('0x84')](_0x1d1885[_0x2909('0x49')]['ids'],_['omit'](_0x1d1885['body'],[_0x2909('0x80'),'id'])||{})[_0x2909('0x85')](function(_0x295285){for(var _0x8eb768=0x0;_0x8eb768<_0x1d1885[_0x2909('0x49')]['ids'][_0x2909('0x57')];_0x8eb768+=0x1){socket[_0x2909('0x83')](_0x2909('0x86'),{'UserId':Number(_0x1d1885[_0x2909('0x49')][_0x2909('0x80')][_0x8eb768]),'SmsQueueId':Number(_0x1d1885['params']['id'])});}return _0x295285;});}})['then'](respondWithResult(_0x429004,null))['catch'](handleError(_0x429004,null));};exports[_0x2909('0x81')]=function(_0x184d3f,_0x203cae,_0x6e09df){return db[_0x2909('0x2e')]['find']({'where':{'id':_0x184d3f['params']['id']}})[_0x2909('0x26')](handleEntityNotFound(_0x203cae,null))[_0x2909('0x26')](function(_0x52e22b){if(_0x52e22b){return _0x52e22b['removeAgents'](_0x184d3f['query'][_0x2909('0x80')])[_0x2909('0x26')](function(){if(_['isArray'](_0x184d3f[_0x2909('0x32')][_0x2909('0x80')])){for(var _0x2a6c43=0x0;_0x2a6c43<_0x184d3f['query']['ids'][_0x2909('0x57')];_0x2a6c43+=0x1){socket['emit'](_0x2909('0x87'),{'UserId':Number(_0x184d3f[_0x2909('0x32')][_0x2909('0x80')][_0x2a6c43]),'SmsQueueId':Number(_0x184d3f[_0x2909('0x53')]['id'])});}}else{socket['emit'](_0x2909('0x87'),{'UserId':Number(_0x184d3f['query'][_0x2909('0x80')]),'SmsQueueId':Number(_0x184d3f[_0x2909('0x53')]['id'])});}});}})[_0x2909('0x26')](respondWithStatusCode(_0x203cae,null))[_0x2909('0x45')](handleError(_0x203cae,null));};exports[_0x2909('0x88')]=function(_0x5216a6,_0x46207f,_0x48b4cd){var _0x2d319e={};var _0x420190={};var _0x65a4ed;var _0x59348f;return db['SmsQueue'][_0x2909('0x56')]({'where':{'id':_0x5216a6[_0x2909('0x53')]['id']}})[_0x2909('0x26')](handleEntityNotFound(_0x46207f,null))[_0x2909('0x26')](function(_0x1ba2d0){if(_0x1ba2d0){_0x65a4ed=_0x1ba2d0;_0x420190[_0x2909('0x35')]=_[_0x2909('0x31')](db['User'][_0x2909('0x47')]);_0x420190['query']=_[_0x2909('0x31')](_0x5216a6[_0x2909('0x32')]);_0x420190['filters']=_[_0x2909('0x34')](_0x420190[_0x2909('0x35')],_0x420190[_0x2909('0x32')]);_0x2d319e[_0x2909('0x37')]=_[_0x2909('0x34')](_0x420190[_0x2909('0x35')],qs[_0x2909('0x36')](_0x5216a6[_0x2909('0x32')]['fields']));_0x2d319e[_0x2909('0x37')]=_0x2d319e[_0x2909('0x37')][_0x2909('0x57')]?_0x2d319e[_0x2909('0x37')]:_0x420190[_0x2909('0x35')];_0x2d319e[_0x2909('0x58')]=qs[_0x2909('0x3a')](_0x5216a6[_0x2909('0x32')][_0x2909('0x3a')]);_0x2d319e[_0x2909('0x3b')]=qs[_0x2909('0x33')](_[_0x2909('0x3c')](_0x5216a6[_0x2909('0x32')],_0x420190[_0x2909('0x33')]));if(_0x5216a6[_0x2909('0x32')][_0x2909('0x3d')]){_0x2d319e[_0x2909('0x3b')]=_[_0x2909('0x3e')](_0x2d319e[_0x2909('0x3b')],{'$or':_[_0x2909('0x2d')](_0x2d319e[_0x2909('0x37')],function(_0x482eb2){var _0x554e71={};_0x554e71[_0x482eb2]={'$like':'%'+_0x5216a6[_0x2909('0x32')][_0x2909('0x3d')]+'%'};return _0x554e71;})});}_0x2d319e=_[_0x2909('0x3e')]({},_0x2d319e,_0x5216a6[_0x2909('0x40')]);return _0x65a4ed[_0x2909('0x88')](_0x2d319e);}})[_0x2909('0x26')](function(_0x27e2f4){if(_0x27e2f4){_0x59348f=_0x27e2f4[_0x2909('0x57')];if(!_0x5216a6[_0x2909('0x32')]['hasOwnProperty'](_0x2909('0x39'))){_0x2d319e['limit']=qs[_0x2909('0x1f')](_0x5216a6[_0x2909('0x32')]['limit']);_0x2d319e['offset']=qs['offset'](_0x5216a6[_0x2909('0x32')]['offset']);}return _0x65a4ed[_0x2909('0x88')](_0x2d319e);}})[_0x2909('0x26')](function(_0x4031e9){if(_0x4031e9){return _0x4031e9?{'count':_0x59348f,'rows':_0x4031e9}:null;}})[_0x2909('0x26')](respondWithResult(_0x46207f,null))[_0x2909('0x45')](handleError(_0x46207f,null));}; \ No newline at end of file +var _0x74ae=['options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','User','findAndCountAll','updatedAt','createdAt','%s/%s','SIP','smsPause','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','isEmpty','removeAgents','userSmsQueue:remove','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsQueue.socket','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','SmsQueue','rows','show','params'];(function(_0x43a59f,_0x510d29){var _0x1ee9a0=function(_0x6e3823){while(--_0x6e3823){_0x43a59f['push'](_0x43a59f['shift']());}};_0x1ee9a0(++_0x510d29);}(_0x74ae,0xc5));var _0xe74a=function(_0x229008,_0x41acde){_0x229008=_0x229008-0x0;var _0x53a0b7=_0x74ae[_0x229008];return _0x53a0b7;};'use strict';var emlformat=require(_0xe74a('0x0'));var rimraf=require(_0xe74a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe74a('0x2'));var rp=require(_0xe74a('0x3'));var moment=require('moment');var BPromise=require(_0xe74a('0x4'));var Mustache=require(_0xe74a('0x5'));var util=require(_0xe74a('0x6'));var path=require(_0xe74a('0x7'));var sox=require(_0xe74a('0x8'));var csv=require(_0xe74a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe74a('0xa'));var _=require(_0xe74a('0xb'));var squel=require(_0xe74a('0xc'));var crypto=require(_0xe74a('0xd'));var jsforce=require(_0xe74a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe74a('0x9'));var querystring=require(_0xe74a('0xf'));var Papa=require('papaparse');var Redis=require(_0xe74a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe74a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe74a('0x12'));var logger=require('../../config/logger')(_0xe74a('0x13'));var utils=require('../../config/utils');var config=require(_0xe74a('0x14'));var licenseUtil=require(_0xe74a('0x15'));var db=require(_0xe74a('0x16'))['db'];config['redis']=_['defaults'](config[_0xe74a('0x17')],{'host':_0xe74a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe74a('0x19'))['register'](socket);function respondWithStatusCode(_0x4ee3a2,_0xb17ffa){_0xb17ffa=_0xb17ffa||0xcc;return function(_0x496c36){if(_0x496c36){return _0x4ee3a2['sendStatus'](_0xb17ffa);}return _0x4ee3a2[_0xe74a('0x1a')](_0xb17ffa)['end']();};}function respondWithResult(_0x2fe47a,_0x4959e3){_0x4959e3=_0x4959e3||0xc8;return function(_0x4388e4){if(_0x4388e4){return _0x2fe47a[_0xe74a('0x1a')](_0x4959e3)[_0xe74a('0x1b')](_0x4388e4);}};}function respondWithFilteredResult(_0x257281,_0x279326){return function(_0x1ba9f){if(_0x1ba9f){var _0x103221=typeof _0x279326[_0xe74a('0x1c')]===_0xe74a('0x1d')&&typeof _0x279326[_0xe74a('0x1e')]===_0xe74a('0x1d');var _0x200c33=_0x1ba9f[_0xe74a('0x1f')];var _0x3c48ad=_0x103221?0x0:_0x279326[_0xe74a('0x1c')];var _0x1a97fd=_0x103221?_0x1ba9f[_0xe74a('0x1f')]:_0x279326[_0xe74a('0x1c')]+_0x279326[_0xe74a('0x1e')];var _0x2455ec;if(_0x1a97fd>=_0x200c33){_0x1a97fd=_0x200c33;_0x2455ec=0xc8;}else{_0x2455ec=0xce;}_0x257281[_0xe74a('0x1a')](_0x2455ec);return _0x257281[_0xe74a('0x20')](_0xe74a('0x21'),_0x3c48ad+'-'+_0x1a97fd+'/'+_0x200c33)[_0xe74a('0x1b')](_0x1ba9f);}return null;};}function patchUpdates(_0x5eec8d){return function(_0x13c2e2){try{jsonpatch[_0xe74a('0x22')](_0x13c2e2,_0x5eec8d,!![]);}catch(_0x4be78a){return BPromise[_0xe74a('0x23')](_0x4be78a);}return _0x13c2e2[_0xe74a('0x24')]();};}function saveUpdates(_0x37126b,_0x319a2c){return function(_0x5356e6){if(_0x5356e6){return _0x5356e6[_0xe74a('0x25')](_0x37126b)[_0xe74a('0x26')](function(_0x2c997c){return _0x2c997c;});}return null;};}function removeEntity(_0x34e739,_0x7432d1){return function(_0xad6146){if(_0xad6146){return _0xad6146[_0xe74a('0x27')]()[_0xe74a('0x26')](function(){var _0x3124b9=_0xad6146[_0xe74a('0x28')]({'plain':!![]});var _0x4b7df1=_0xe74a('0x29');return db[_0xe74a('0x2a')][_0xe74a('0x27')]({'where':{'type':_0x4b7df1,'resourceId':_0x3124b9['id']}})['then'](function(){return _0xad6146;});})['then'](function(){_0x34e739[_0xe74a('0x1a')](0xcc)[_0xe74a('0x2b')]();});}};}function handleEntityNotFound(_0x2f6533,_0x4fa228){return function(_0x39b069){if(!_0x39b069){_0x2f6533[_0xe74a('0x2c')](0x194);}return _0x39b069;};}function handleError(_0x176249,_0x4f5ba8){_0x4f5ba8=_0x4f5ba8||0x1f4;return function(_0x417a14){logger[_0xe74a('0x2d')](_0x417a14[_0xe74a('0x2e')]);if(_0x417a14[_0xe74a('0x2f')]){delete _0x417a14['name'];}_0x176249['status'](_0x4f5ba8)[_0xe74a('0x30')](_0x417a14);};}exports['index']=function(_0x247195,_0x31e3f3){var _0x470bc6={},_0x4be3f6={},_0x294ff5={'count':0x0,'rows':[]};var _0x4f64e9=_[_0xe74a('0x31')](db['SmsQueue'][_0xe74a('0x32')],function(_0x471e73){return{'name':_0x471e73[_0xe74a('0x33')],'type':_0x471e73[_0xe74a('0x34')][_0xe74a('0x35')]};});_0x4be3f6[_0xe74a('0x36')]=_[_0xe74a('0x31')](_0x4f64e9,_0xe74a('0x2f'));_0x4be3f6[_0xe74a('0x37')]=_[_0xe74a('0x38')](_0x247195[_0xe74a('0x37')]);_0x4be3f6[_0xe74a('0x39')]=_[_0xe74a('0x3a')](_0x4be3f6[_0xe74a('0x36')],_0x4be3f6['query']);_0x470bc6[_0xe74a('0x3b')]=_[_0xe74a('0x3a')](_0x4be3f6['model'],qs[_0xe74a('0x3c')](_0x247195[_0xe74a('0x37')]['fields']));_0x470bc6[_0xe74a('0x3b')]=_0x470bc6['attributes'][_0xe74a('0x3d')]?_0x470bc6[_0xe74a('0x3b')]:_0x4be3f6[_0xe74a('0x36')];if(!_0x247195[_0xe74a('0x37')]['hasOwnProperty'](_0xe74a('0x3e'))){_0x470bc6[_0xe74a('0x1e')]=qs[_0xe74a('0x1e')](_0x247195[_0xe74a('0x37')][_0xe74a('0x1e')]);_0x470bc6[_0xe74a('0x1c')]=qs[_0xe74a('0x1c')](_0x247195[_0xe74a('0x37')][_0xe74a('0x1c')]);}_0x470bc6[_0xe74a('0x3f')]=qs[_0xe74a('0x40')](_0x247195[_0xe74a('0x37')]['sort']);_0x470bc6[_0xe74a('0x41')]=qs[_0xe74a('0x39')](_[_0xe74a('0x42')](_0x247195['query'],_0x4be3f6[_0xe74a('0x39')]),_0x4f64e9);if(_0x247195['query'][_0xe74a('0x43')]){_0x470bc6[_0xe74a('0x41')]=_[_0xe74a('0x44')](_0x470bc6[_0xe74a('0x41')],{'$or':_['map'](_0x4f64e9,function(_0x272e90){if(_0x272e90['type']!=='VIRTUAL'){var _0x59633c={};_0x59633c[_0x272e90[_0xe74a('0x2f')]]={'$like':'%'+_0x247195[_0xe74a('0x37')][_0xe74a('0x43')]+'%'};return _0x59633c;}})});}_0x470bc6=_[_0xe74a('0x44')]({},_0x470bc6,_0x247195['options']);var _0x270246={'where':_0x470bc6[_0xe74a('0x41')]};return db['SmsQueue'][_0xe74a('0x1f')](_0x270246)[_0xe74a('0x26')](function(_0x579778){_0x294ff5[_0xe74a('0x1f')]=_0x579778;if(_0x247195[_0xe74a('0x37')][_0xe74a('0x45')]){_0x470bc6[_0xe74a('0x46')]=[{'all':!![]}];}return db[_0xe74a('0x47')]['findAll'](_0x470bc6);})[_0xe74a('0x26')](function(_0x538f67){_0x294ff5[_0xe74a('0x48')]=_0x538f67;return _0x294ff5;})[_0xe74a('0x26')](respondWithFilteredResult(_0x31e3f3,_0x470bc6))['catch'](handleError(_0x31e3f3,null));};exports[_0xe74a('0x49')]=function(_0x38b1d3,_0x5d7385){var _0x10b3ea={'raw':!![],'where':{'id':_0x38b1d3[_0xe74a('0x4a')]['id']}},_0x35bc3={};_0x35bc3[_0xe74a('0x36')]=_[_0xe74a('0x38')](db['SmsQueue'][_0xe74a('0x32')]);_0x35bc3[_0xe74a('0x37')]=_[_0xe74a('0x38')](_0x38b1d3[_0xe74a('0x37')]);_0x35bc3['filters']=_[_0xe74a('0x3a')](_0x35bc3[_0xe74a('0x36')],_0x35bc3['query']);_0x10b3ea[_0xe74a('0x3b')]=_['intersection'](_0x35bc3[_0xe74a('0x36')],qs['fields'](_0x38b1d3[_0xe74a('0x37')][_0xe74a('0x3c')]));_0x10b3ea[_0xe74a('0x3b')]=_0x10b3ea[_0xe74a('0x3b')]['length']?_0x10b3ea['attributes']:_0x35bc3[_0xe74a('0x36')];if(_0x38b1d3[_0xe74a('0x37')]['includeAll']){_0x10b3ea[_0xe74a('0x46')]=[{'all':!![]}];}_0x10b3ea=_[_0xe74a('0x44')]({},_0x10b3ea,_0x38b1d3[_0xe74a('0x4b')]);return db[_0xe74a('0x47')][_0xe74a('0x4c')](_0x10b3ea)['then'](handleEntityNotFound(_0x5d7385,null))[_0xe74a('0x26')](respondWithResult(_0x5d7385,null))['catch'](handleError(_0x5d7385,null));};exports[_0xe74a('0x4d')]=function(_0x37ea82,_0x5d5fdc){return db[_0xe74a('0x47')][_0xe74a('0x4d')](_0x37ea82[_0xe74a('0x4e')],{})[_0xe74a('0x26')](function(_0x44c6b2){var _0x5ef185=_0x37ea82[_0xe74a('0x4f')][_0xe74a('0x28')]({'plain':!![]});if(!_0x5ef185)throw new Error(_0xe74a('0x50'));if(_0x5ef185[_0xe74a('0x51')]===_0xe74a('0x4f')){var _0x2dff99=_0x44c6b2['get']({'plain':!![]});var _0x504a7f=_0xe74a('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x504a7f,'userProfileId':_0x5ef185[_0xe74a('0x52')]},'raw':!![]})[_0xe74a('0x26')](function(_0x1f4381){if(_0x1f4381&&_0x1f4381[_0xe74a('0x53')]===0x0){return db['UserProfileResource'][_0xe74a('0x4d')]({'name':_0x2dff99[_0xe74a('0x2f')],'resourceId':_0x2dff99['id'],'type':_0x1f4381[_0xe74a('0x2f')],'sectionId':_0x1f4381['id']},{})[_0xe74a('0x26')](function(){return _0x44c6b2;});}else{return _0x44c6b2;}})['catch'](function(_0x18c822){logger[_0xe74a('0x2d')](_0xe74a('0x54'),_0x18c822);throw _0x18c822;});}return _0x44c6b2;})[_0xe74a('0x26')](respondWithResult(_0x5d5fdc,0xc9))[_0xe74a('0x55')](handleError(_0x5d5fdc,null));};exports[_0xe74a('0x25')]=function(_0x3e42e3,_0x35a9bf){if(_0x3e42e3[_0xe74a('0x4e')]['id']){delete _0x3e42e3['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x3e42e3[_0xe74a('0x4a')]['id']}})[_0xe74a('0x26')](handleEntityNotFound(_0x35a9bf,null))[_0xe74a('0x26')](saveUpdates(_0x3e42e3[_0xe74a('0x4e')],null))[_0xe74a('0x26')](respondWithResult(_0x35a9bf,null))[_0xe74a('0x55')](handleError(_0x35a9bf,null));};exports['destroy']=function(_0x158a76,_0x3a7326){return db[_0xe74a('0x47')]['find']({'where':{'id':_0x158a76['params']['id']}})[_0xe74a('0x26')](handleEntityNotFound(_0x3a7326,null))[_0xe74a('0x26')](removeEntity(_0x3a7326,null))[_0xe74a('0x55')](handleError(_0x3a7326,null));};exports[_0xe74a('0x56')]=function(_0x20216b,_0x998af0){return db[_0xe74a('0x47')][_0xe74a('0x56')]()[_0xe74a('0x26')](respondWithResult(_0x998af0,null))['catch'](handleError(_0x998af0,null));};exports[_0xe74a('0x57')]=function(_0x1c51cb,_0x2e43a2,_0x1334d6){var _0x3aa489={'raw':!![],'where':{}},_0x539b6e={},_0x4b0a41;return db[_0xe74a('0x47')][_0xe74a('0x58')]({'where':{'id':_0x1c51cb[_0xe74a('0x4a')]['id']}})[_0xe74a('0x26')](handleEntityNotFound(_0x2e43a2,null))[_0xe74a('0x26')](function(_0x42dbdf){if(_0x42dbdf){_0x4b0a41=_0x42dbdf['get']({'plain':!![]});_0x539b6e[_0xe74a('0x36')]=_[_0xe74a('0x38')](db[_0xe74a('0x59')][_0xe74a('0x32')]);_0x539b6e[_0xe74a('0x37')]=_['keys'](_0x1c51cb[_0xe74a('0x37')]);_0x539b6e[_0xe74a('0x39')]=_[_0xe74a('0x3a')](_0x539b6e[_0xe74a('0x36')],_0x539b6e[_0xe74a('0x37')]);_0x3aa489[_0xe74a('0x3b')]=_[_0xe74a('0x3a')](_0x539b6e[_0xe74a('0x36')],qs['fields'](_0x1c51cb[_0xe74a('0x37')][_0xe74a('0x3c')]));_0x3aa489[_0xe74a('0x3b')]=_0x3aa489[_0xe74a('0x3b')][_0xe74a('0x3d')]?_0x3aa489['attributes']:_0x539b6e['model'];if(!_0x1c51cb[_0xe74a('0x37')][_0xe74a('0x5a')](_0xe74a('0x3e'))){_0x3aa489['limit']=qs['limit'](_0x1c51cb[_0xe74a('0x37')][_0xe74a('0x1e')]);_0x3aa489[_0xe74a('0x1c')]=qs[_0xe74a('0x1c')](_0x1c51cb[_0xe74a('0x37')]['offset']);}_0x3aa489['order']=qs[_0xe74a('0x40')](_0x1c51cb[_0xe74a('0x37')]['sort']);_0x3aa489[_0xe74a('0x41')]=qs['filters'](_[_0xe74a('0x42')](_0x1c51cb[_0xe74a('0x37')],_0x539b6e['filters']));_0x3aa489[_0xe74a('0x41')][_0xe74a('0x5b')]=_0x42dbdf['id'];if(_0x1c51cb['query'][_0xe74a('0x43')]){_0x3aa489['where']=_[_0xe74a('0x44')](_0x3aa489[_0xe74a('0x41')],{'$or':_['map'](_0x3aa489[_0xe74a('0x3b')],function(_0x2cc122){var _0x338ae6={};_0x338ae6[_0x2cc122]={'$like':'%'+_0x1c51cb[_0xe74a('0x37')][_0xe74a('0x43')]+'%'};return _0x338ae6;})});}_0x3aa489=_[_0xe74a('0x44')]({},_0x3aa489,_0x1c51cb['options']);return db[_0xe74a('0x59')]['findAll'](_0x3aa489);}})[_0xe74a('0x26')](function(_0x5c3c9e){if(_0x5c3c9e){return db[_0xe74a('0x5c')][_0xe74a('0x5d')]({'where':{'id':_[_0xe74a('0x31')](_0x5c3c9e,'UserId'),'role':'agent'},'attributes':['id',_0xe74a('0x2f'),'smsPause',_0xe74a('0x5e'),_0xe74a('0x5f')]});}})[_0xe74a('0x26')](function(_0x5af1a7){if(_0x5af1a7){return{'count':_0x5af1a7[_0xe74a('0x1f')],'rows':_[_0xe74a('0x31')](_0x5af1a7[_0xe74a('0x48')],function(_0x5a2076){return{'membername':_0x5a2076['name'],'UserId':_0x5a2076['id'],'queue_name':_0x4b0a41[_0xe74a('0x2f')],'SmsQueueId':_0x4b0a41['id'],'interface':util['format'](_0xe74a('0x60'),_0xe74a('0x61'),_0x5a2076[_0xe74a('0x2f')]),'penalty':0x0,'paused':_0x5a2076[_0xe74a('0x62')],'createdAt':_0x5a2076[_0xe74a('0x5f')],'updatedAt':_0x5a2076[_0xe74a('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe74a('0x26')](respondWithFilteredResult(_0x2e43a2,_0x3aa489))[_0xe74a('0x55')](handleError(_0x2e43a2,null));};exports[_0xe74a('0x63')]=function(_0x59960d,_0x5de682,_0x43b1d7){var _0x48b0e6={};var _0x4f1c6c={};var _0x194a94;var _0x1f6539;return db[_0xe74a('0x47')][_0xe74a('0x58')]({'where':{'id':_0x59960d[_0xe74a('0x4a')]['id']}})[_0xe74a('0x26')](handleEntityNotFound(_0x5de682,null))['then'](function(_0x186634){if(_0x186634){_0x194a94=_0x186634;_0x4f1c6c[_0xe74a('0x36')]=_['keys'](db[_0xe74a('0x64')][_0xe74a('0x32')]);_0x4f1c6c['query']=_[_0xe74a('0x38')](_0x59960d[_0xe74a('0x37')]);_0x4f1c6c[_0xe74a('0x39')]=_[_0xe74a('0x3a')](_0x4f1c6c['model'],_0x4f1c6c[_0xe74a('0x37')]);_0x48b0e6['attributes']=_[_0xe74a('0x3a')](_0x4f1c6c[_0xe74a('0x36')],qs['fields'](_0x59960d['query'][_0xe74a('0x3c')]));_0x48b0e6[_0xe74a('0x3b')]=_0x48b0e6[_0xe74a('0x3b')][_0xe74a('0x3d')]?_0x48b0e6[_0xe74a('0x3b')]:_0x4f1c6c[_0xe74a('0x36')];_0x48b0e6[_0xe74a('0x3f')]=qs[_0xe74a('0x40')](_0x59960d[_0xe74a('0x37')][_0xe74a('0x40')]);_0x48b0e6[_0xe74a('0x41')]=qs['filters'](_[_0xe74a('0x42')](_0x59960d[_0xe74a('0x37')],_0x4f1c6c[_0xe74a('0x39')]));if(_0x59960d[_0xe74a('0x37')][_0xe74a('0x43')]){_0x48b0e6[_0xe74a('0x41')]=_[_0xe74a('0x44')](_0x48b0e6['where'],{'$or':_['map'](_0x48b0e6[_0xe74a('0x3b')],function(_0x417f54){var _0x10164b={};_0x10164b[_0x417f54]={'$like':'%'+_0x59960d[_0xe74a('0x37')]['filter']+'%'};return _0x10164b;})});}_0x48b0e6=_[_0xe74a('0x44')]({},_0x48b0e6,_0x59960d[_0xe74a('0x4b')]);return _0x194a94[_0xe74a('0x63')](_0x48b0e6);}})[_0xe74a('0x26')](function(_0x323ed3){if(_0x323ed3){_0x1f6539=_0x323ed3[_0xe74a('0x3d')];if(!_0x59960d['query'][_0xe74a('0x5a')]('nolimit')){_0x48b0e6[_0xe74a('0x1e')]=qs[_0xe74a('0x1e')](_0x59960d[_0xe74a('0x37')][_0xe74a('0x1e')]);_0x48b0e6[_0xe74a('0x1c')]=qs[_0xe74a('0x1c')](_0x59960d[_0xe74a('0x37')][_0xe74a('0x1c')]);}return _0x194a94[_0xe74a('0x63')](_0x48b0e6);}})[_0xe74a('0x26')](function(_0x128ef8){if(_0x128ef8){return _0x128ef8?{'count':_0x1f6539,'rows':_0x128ef8}:null;}})[_0xe74a('0x26')](respondWithResult(_0x5de682,null))[_0xe74a('0x55')](handleError(_0x5de682,null));};exports[_0xe74a('0x65')]=function(_0x5d85ec,_0x4f9791,_0x377e8f){var _0x5391d6=_0x5d85ec[_0xe74a('0x4e')][_0xe74a('0x66')];return db[_0xe74a('0x64')][_0xe74a('0x67')]({'where':{'id':_0x5391d6},'attributes':['id'],'include':[{'model':db[_0xe74a('0x5c')],'as':_0xe74a('0x68'),'attributes':['id',_0xe74a('0x2f'),_0xe74a('0x69'),_0xe74a('0x6a'),_0xe74a('0x6b')],'raw':!![]}]})[_0xe74a('0x26')](function(_0x563ad5){if(_0x563ad5){var _0x51ff2c=_[_0xe74a('0x6c')](_0x563ad5,function(_0x30ee36){var _0x594e90=_0x30ee36[_0xe74a('0x28')]({'plain':!![]});return _0x594e90[_0xe74a('0x68')];});return db[_0xe74a('0x47')]['find']({'where':{'id':_0x5d85ec[_0xe74a('0x4a')]['id']}})[_0xe74a('0x26')](function(_0xd7fa68){return db[_0xe74a('0x6d')]['transaction'](function(_0xbf5473){return _0xd7fa68[_0xe74a('0x65')](_0x5391d6,{'transaction':_0xbf5473})[_0xe74a('0x26')](function(){return BPromise[_0xe74a('0x6e')](_0x51ff2c,function(_0x21fc43){return db[_0xe74a('0x59')][_0xe74a('0x6f')]({'where':{'UserId':_0x21fc43['id'],'SmsQueueId':_0x5d85ec[_0xe74a('0x4a')]['id']},'transaction':_0xbf5473});});})['then'](function(){_0x51ff2c['forEach'](function(_0x3df871){socket[_0xe74a('0x70')]('userSmsQueue:save',{'UserId':_0x3df871['id'],'SmsQueueId':_0xd7fa68['id']});});});});});}})[_0xe74a('0x26')](respondWithStatusCode(_0x4f9791,null))[_0xe74a('0x55')](handleError(_0x4f9791,null));};exports[_0xe74a('0x71')]=function(_0x1f0268,_0x1c0409,_0x3a9f0c){return db['Team'][_0xe74a('0x67')]({'where':{'id':_0x1f0268['query'][_0xe74a('0x66')]},'attributes':['id'],'include':[{'model':db[_0xe74a('0x5c')],'as':_0xe74a('0x68'),'attributes':['id'],'raw':!![]}]})[_0xe74a('0x26')](handleEntityNotFound(_0x1c0409,null))[_0xe74a('0x26')](function(_0x2870a4){var _0x418ac5=_[_0xe74a('0x31')](_0x2870a4,'id');var _0x46bc14=[];var _0x16c5b3=[];var _0x544024=squel[_0xe74a('0x72')]();_0x544024[_0xe74a('0x73')](_0xe74a('0x74'))[_0xe74a('0x75')](_0xe74a('0x76'),'tq')[_0xe74a('0x77')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe74a('0x41')](_0xe74a('0x78'),_0x1f0268[_0xe74a('0x4a')]['id']);for(var _0xc11d4=0x0;_0xc11d4<_0x2870a4['length'];_0xc11d4+=0x1){let _0x2f4a49=_0x2870a4[_0xc11d4];for(var _0x44c2f2=0x0;_0x44c2f2<_0x2f4a49[_0xe74a('0x68')]['length'];_0x44c2f2+=0x1){let _0x475740=_0x2f4a49[_0xe74a('0x68')][_0x44c2f2];var _0x259298=_0x544024['clone']();_0x259298[_0xe74a('0x41')]('ut.UserId\x20=\x20?',_0x475740['id']);_0x16c5b3[_0xe74a('0x79')](db[_0xe74a('0x6d')]['query'](_0x259298[_0xe74a('0x7a')](),{'type':db[_0xe74a('0x6d')][_0xe74a('0x7b')][_0xe74a('0x7c')]})[_0xe74a('0x26')](function(_0x28caca){if(_0x28caca['length']===0x1){return _0x475740['id'];}else{var _0x4be89=_['every'](_[_0xe74a('0x31')](_0x28caca,_0xe74a('0x7d')),function(_0x5b7c7c){return _[_0xe74a('0x7e')](_0x418ac5,_0x5b7c7c);});if(_0x4be89){return _0x475740['id'];}}}));}}return BPromise[_0xe74a('0x7f')](_0x16c5b3)[_0xe74a('0x26')](function(_0x13edf7){_0x46bc14=_(_0x46bc14)[_0xe74a('0x80')](_0x13edf7)['compact']()[_0xe74a('0x81')]();return db[_0xe74a('0x47')][_0xe74a('0x4c')]({'where':{'id':_0x1f0268[_0xe74a('0x4a')]['id']}})[_0xe74a('0x26')](function(_0x9782b5){return db[_0xe74a('0x6d')]['transaction'](function(_0x4924dd){return _0x9782b5[_0xe74a('0x71')](_0x1f0268[_0xe74a('0x37')]['ids'],{'transaction':_0x4924dd})[_0xe74a('0x26')](function(){if(!_[_0xe74a('0x82')](_0x46bc14)){return _0x9782b5[_0xe74a('0x83')](_0x46bc14,{'transaction':_0x4924dd});}})[_0xe74a('0x26')](function(){_0x46bc14['forEach'](function(_0x519d02){socket[_0xe74a('0x70')](_0xe74a('0x84'),{'UserId':_0x519d02,'SmsQueueId':_0x9782b5['id']});});});});});});})['then'](respondWithStatusCode(_0x1c0409,null))[_0xe74a('0x55')](handleError(_0x1c0409,null));};exports['addAgents']=function(_0x1db242,_0x13a981,_0x2c1133){return db[_0xe74a('0x47')][_0xe74a('0x4c')]({'where':{'id':_0x1db242[_0xe74a('0x4a')]['id']}})[_0xe74a('0x26')](handleEntityNotFound(_0x13a981,null))[_0xe74a('0x26')](function(_0x44c065){if(_0x44c065){return _0x44c065['addAgents'](_0x1db242[_0xe74a('0x4e')][_0xe74a('0x66')],_['omit'](_0x1db242['body'],[_0xe74a('0x66'),'id'])||{})[_0xe74a('0x85')](function(_0x1c9b21){for(var _0x5e094a=0x0;_0x5e094a<_0x1db242[_0xe74a('0x4e')][_0xe74a('0x66')][_0xe74a('0x3d')];_0x5e094a+=0x1){socket[_0xe74a('0x70')]('userSmsQueue:save',{'UserId':Number(_0x1db242[_0xe74a('0x4e')][_0xe74a('0x66')][_0x5e094a]),'SmsQueueId':Number(_0x1db242[_0xe74a('0x4a')]['id'])});}return _0x1c9b21;});}})[_0xe74a('0x26')](respondWithResult(_0x13a981,null))[_0xe74a('0x55')](handleError(_0x13a981,null));};exports['removeAgents']=function(_0x1a23da,_0x30dcbb,_0x34014e){return db[_0xe74a('0x47')][_0xe74a('0x4c')]({'where':{'id':_0x1a23da[_0xe74a('0x4a')]['id']}})[_0xe74a('0x26')](handleEntityNotFound(_0x30dcbb,null))[_0xe74a('0x26')](function(_0x37ae1a){if(_0x37ae1a){return _0x37ae1a['removeAgents'](_0x1a23da[_0xe74a('0x37')][_0xe74a('0x66')])['then'](function(){if(_[_0xe74a('0x86')](_0x1a23da[_0xe74a('0x37')][_0xe74a('0x66')])){for(var _0x35a0ff=0x0;_0x35a0ff<_0x1a23da[_0xe74a('0x37')][_0xe74a('0x66')][_0xe74a('0x3d')];_0x35a0ff+=0x1){socket[_0xe74a('0x70')](_0xe74a('0x84'),{'UserId':Number(_0x1a23da[_0xe74a('0x37')]['ids'][_0x35a0ff]),'SmsQueueId':Number(_0x1a23da[_0xe74a('0x4a')]['id'])});}}else{socket[_0xe74a('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x1a23da[_0xe74a('0x37')][_0xe74a('0x66')]),'SmsQueueId':Number(_0x1a23da[_0xe74a('0x4a')]['id'])});}});}})[_0xe74a('0x26')](respondWithStatusCode(_0x30dcbb,null))[_0xe74a('0x55')](handleError(_0x30dcbb,null));};exports[_0xe74a('0x87')]=function(_0x5b74b7,_0x37b194,_0x3996c6){var _0x17db89={};var _0x56c8a5={};var _0x181b1b;var _0x1d22dc;return db[_0xe74a('0x47')]['findOne']({'where':{'id':_0x5b74b7['params']['id']}})[_0xe74a('0x26')](handleEntityNotFound(_0x37b194,null))[_0xe74a('0x26')](function(_0x4eb8a2){if(_0x4eb8a2){_0x181b1b=_0x4eb8a2;_0x56c8a5[_0xe74a('0x36')]=_[_0xe74a('0x38')](db[_0xe74a('0x5c')][_0xe74a('0x32')]);_0x56c8a5[_0xe74a('0x37')]=_['keys'](_0x5b74b7[_0xe74a('0x37')]);_0x56c8a5['filters']=_['intersection'](_0x56c8a5[_0xe74a('0x36')],_0x56c8a5[_0xe74a('0x37')]);_0x17db89[_0xe74a('0x3b')]=_[_0xe74a('0x3a')](_0x56c8a5['model'],qs[_0xe74a('0x3c')](_0x5b74b7[_0xe74a('0x37')][_0xe74a('0x3c')]));_0x17db89[_0xe74a('0x3b')]=_0x17db89[_0xe74a('0x3b')][_0xe74a('0x3d')]?_0x17db89['attributes']:_0x56c8a5[_0xe74a('0x36')];_0x17db89['order']=qs['sort'](_0x5b74b7[_0xe74a('0x37')][_0xe74a('0x40')]);_0x17db89[_0xe74a('0x41')]=qs['filters'](_[_0xe74a('0x42')](_0x5b74b7[_0xe74a('0x37')],_0x56c8a5[_0xe74a('0x39')]));if(_0x5b74b7[_0xe74a('0x37')][_0xe74a('0x43')]){_0x17db89[_0xe74a('0x41')]=_[_0xe74a('0x44')](_0x17db89[_0xe74a('0x41')],{'$or':_['map'](_0x17db89[_0xe74a('0x3b')],function(_0x5cd88e){var _0xf601c={};_0xf601c[_0x5cd88e]={'$like':'%'+_0x5b74b7['query'][_0xe74a('0x43')]+'%'};return _0xf601c;})});}_0x17db89=_['merge']({},_0x17db89,_0x5b74b7[_0xe74a('0x4b')]);return _0x181b1b[_0xe74a('0x87')](_0x17db89);}})['then'](function(_0x353196){if(_0x353196){_0x1d22dc=_0x353196[_0xe74a('0x3d')];if(!_0x5b74b7[_0xe74a('0x37')][_0xe74a('0x5a')](_0xe74a('0x3e'))){_0x17db89[_0xe74a('0x1e')]=qs[_0xe74a('0x1e')](_0x5b74b7[_0xe74a('0x37')]['limit']);_0x17db89[_0xe74a('0x1c')]=qs[_0xe74a('0x1c')](_0x5b74b7['query'][_0xe74a('0x1c')]);}return _0x181b1b[_0xe74a('0x87')](_0x17db89);}})[_0xe74a('0x26')](function(_0x384aca){if(_0x384aca){return _0x384aca?{'count':_0x1d22dc,'rows':_0x384aca}:null;}})[_0xe74a('0x26')](respondWithResult(_0x37b194,null))[_0xe74a('0x55')](handleError(_0x37b194,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index e48c20d..3638bb0 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 _0xbcae=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x56c813,_0x3a14d1){var _0x2cae96=function(_0x20c099){while(--_0x20c099){_0x56c813['push'](_0x56c813['shift']());}};_0x2cae96(++_0x3a14d1);}(_0xbcae,0x176));var _0xebca=function(_0x33cded,_0x20b274){_0x33cded=_0x33cded-0x0;var _0x470dd0=_0xbcae[_0x33cded];return _0x470dd0;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xebca('0x0'))['db'][_0xebca('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xebca('0x2')](0x0);var events={'afterCreate':_0xebca('0x3'),'afterUpdate':'update','afterDestroy':_0xebca('0x4')};function emitEvent(_0x51190c){return function(_0x4db527,_0x2a313d,_0x3a0f92){SmsQueueEvents[_0xebca('0x5')](_0x51190c+':'+_0x4db527['id'],_0x4db527);SmsQueueEvents[_0xebca('0x5')](_0x51190c,_0x4db527);_0x3a0f92(null);};}for(var e in events){if(events[_0xebca('0x6')](e)){var event=events[e];SmsQueue[_0xebca('0x7')](e,emitEvent(event));}}module[_0xebca('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x206a=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x206a,0x1a3));var _0xa206=function(_0x4c7c4a,_0x520920){_0x4c7c4a=_0x4c7c4a-0x0;var _0x4d78ae=_0x206a[_0x4c7c4a];return _0x4d78ae;};'use strict';var EventEmitter=require(_0xa206('0x0'));var SmsQueue=require(_0xa206('0x1'))['db'][_0xa206('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa206('0x3')](0x0);var events={'afterCreate':_0xa206('0x4'),'afterUpdate':_0xa206('0x5'),'afterDestroy':_0xa206('0x6')};function emitEvent(_0x4a371e){return function(_0x155770,_0x346ccf,_0x2d1ec0){SmsQueueEvents[_0xa206('0x7')](_0x4a371e+':'+_0x155770['id'],_0x155770);SmsQueueEvents[_0xa206('0x7')](_0x4a371e,_0x155770);_0x2d1ec0(null);};}for(var e in events){if(events[_0xa206('0x8')](e)){var event=events[e];SmsQueue[_0xa206('0x9')](e,emitEvent(event));}}module[_0xa206('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 891279f..fc3fd5b 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 _0x26fc=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','SmsQueue','sms_queues','lodash','util'];(function(_0x57a323,_0x2c507e){var _0x5aa675=function(_0x360f45){while(--_0x360f45){_0x57a323['push'](_0x57a323['shift']());}};_0x5aa675(++_0x2c507e);}(_0x26fc,0x6a));var _0xc26f=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x26fc[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xc26f('0x0'));var util=require(_0xc26f('0x1'));var logger=require(_0xc26f('0x2'))(_0xc26f('0x3'));var moment=require('moment');var BPromise=require(_0xc26f('0x4'));var rp=require(_0xc26f('0x5'));var fs=require('fs');var path=require(_0xc26f('0x6'));var rimraf=require(_0xc26f('0x7'));var config=require(_0xc26f('0x8'));var attributes=require(_0xc26f('0x9'));module['exports']=function(_0x3654d1,_0x457149){return _0x3654d1['define'](_0xc26f('0xa'),attributes,{'tableName':_0xc26f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x771a=['sms_queues','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0xac8190,_0xbff203){var _0x204882=function(_0x211e45){while(--_0x211e45){_0xac8190['push'](_0xac8190['shift']());}};_0x204882(++_0xbff203);}(_0x771a,0x191));var _0xa771=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x771a[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0xa771('0x0'));var util=require('util');var logger=require(_0xa771('0x1'))('api');var moment=require(_0xa771('0x2'));var BPromise=require(_0xa771('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa771('0x4'));var config=require(_0xa771('0x5'));var attributes=require(_0xa771('0x6'));module[_0xa771('0x7')]=function(_0x478402,_0x2b2312){return _0x478402[_0xa771('0x8')]('SmsQueue',attributes,{'tableName':_0xa771('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index b854f35..4cd7b80 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 _0x1a0f=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','map','include','model','find','ShowSmsQueue','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2c9237,_0x6f0f9b){var _0x2426ec=function(_0x5ac2de){while(--_0x5ac2de){_0x2c9237['push'](_0x2c9237['shift']());}};_0x2426ec(++_0x6f0f9b);}(_0x1a0f,0x18f));var _0xf1a0=function(_0xc144be,_0x385142){_0xc144be=_0xc144be-0x0;var _0x4ffd89=_0x1a0f[_0xc144be];return _0x4ffd89;};'use strict';var _=require(_0xf1a0('0x0'));var util=require(_0xf1a0('0x1'));var moment=require('moment');var BPromise=require(_0xf1a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf1a0('0x3'));var db=require(_0xf1a0('0x4'))['db'];var utils=require(_0xf1a0('0x5'));var logger=require('../../config/logger')(_0xf1a0('0x6'));var config=require(_0xf1a0('0x7'));var jayson=require(_0xf1a0('0x8'));var client=jayson[_0xf1a0('0x9')]['http']({'port':0x232a});config[_0xf1a0('0xa')]=_[_0xf1a0('0xb')](config['redis'],{'host':_0xf1a0('0xc'),'port':0x18eb});var socket=require(_0xf1a0('0xd'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xf1a0('0xe')](socket);function respondWithRpcPromise(_0x515c0b,_0x3575b7,_0x4b64cf){return new BPromise(function(_0x9e14d5,_0x2b434e){return client['request'](_0x515c0b,_0x4b64cf)[_0xf1a0('0xf')](function(_0x495551){logger[_0xf1a0('0x10')]('SmsQueue,\x20%s,\x20%s',_0x3575b7,_0xf1a0('0x11'));logger[_0xf1a0('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3575b7,_0xf1a0('0x11'),JSON[_0xf1a0('0x13')](_0x495551));if(_0x495551[_0xf1a0('0x14')]){if(_0x495551[_0xf1a0('0x14')][_0xf1a0('0x15')]===0x1f4){logger[_0xf1a0('0x14')](_0xf1a0('0x16'),_0x3575b7,_0x495551[_0xf1a0('0x14')]['message']);return _0x2b434e(_0x495551[_0xf1a0('0x14')]['message']);}logger[_0xf1a0('0x14')](_0xf1a0('0x16'),_0x3575b7,_0x495551['error'][_0xf1a0('0x17')]);return _0x9e14d5(_0x495551[_0xf1a0('0x14')][_0xf1a0('0x17')]);}else{logger[_0xf1a0('0x10')]('SmsQueue,\x20%s,\x20%s',_0x3575b7,_0xf1a0('0x11'));_0x9e14d5(_0x495551[_0xf1a0('0x18')][_0xf1a0('0x17')]);}})[_0xf1a0('0x19')](function(_0x57d345){logger[_0xf1a0('0x14')](_0xf1a0('0x16'),_0x3575b7,_0x57d345);_0x2b434e(_0x57d345);});});}exports[_0xf1a0('0x1a')]=function(_0x16668b){var _0x2bc784=this;return new Promise(function(_0x579c65,_0x4b7985){return db[_0xf1a0('0x1b')]['findAll']({'raw':_0x16668b['options']?_0x16668b[_0xf1a0('0x1c')][_0xf1a0('0x1d')]===undefined?!![]:![]:!![],'where':_0x16668b[_0xf1a0('0x1c')]?_0x16668b[_0xf1a0('0x1c')][_0xf1a0('0x1e')]||null:null,'attributes':_0x16668b[_0xf1a0('0x1c')]?_0x16668b[_0xf1a0('0x1c')][_0xf1a0('0x1f')]||null:null,'limit':_0x16668b[_0xf1a0('0x1c')]?_0x16668b[_0xf1a0('0x1c')]['limit']||null:null,'include':_0x16668b[_0xf1a0('0x1c')]?_0x16668b[_0xf1a0('0x1c')]['include']?_[_0xf1a0('0x20')](_0x16668b[_0xf1a0('0x1c')][_0xf1a0('0x21')],function(_0x3a7512){return{'model':db[_0x3a7512[_0xf1a0('0x22')]],'as':_0x3a7512['as'],'attributes':_0x3a7512[_0xf1a0('0x1f')],'include':_0x3a7512[_0xf1a0('0x21')]?_['map'](_0x3a7512[_0xf1a0('0x21')],function(_0x450936){return{'model':db[_0x450936[_0xf1a0('0x22')]],'as':_0x450936['as'],'attributes':_0x450936[_0xf1a0('0x1f')],'include':_0x450936[_0xf1a0('0x21')]?_['map'](_0x450936[_0xf1a0('0x21')],function(_0x3aec49){return{'model':db[_0x3aec49[_0xf1a0('0x22')]],'as':_0x3aec49['as'],'attributes':_0x3aec49['attributes']};}):[]};}):[]};}):[]:[]})[_0xf1a0('0xf')](function(_0x58d3c8){logger[_0xf1a0('0x10')](_0xf1a0('0x1a'),_0x16668b);logger['debug'](_0xf1a0('0x1a'),_0x16668b,JSON['stringify'](_0x58d3c8));_0x579c65(_0x58d3c8);})[_0xf1a0('0x19')](function(_0x5c6612){logger['error']('GetSmsQueue',_0x5c6612[_0xf1a0('0x17')],_0x16668b);_0x4b7985(_0x2bc784[_0xf1a0('0x14')](0x1f4,_0x5c6612[_0xf1a0('0x17')]));});});};exports['ShowSmsQueue']=function(_0x1c65e8){var _0x42f3b0=this;return new Promise(function(_0x243858,_0x5844b9){return db['SmsQueue'][_0xf1a0('0x23')]({'raw':_0x1c65e8[_0xf1a0('0x1c')]?_0x1c65e8['options'][_0xf1a0('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c65e8['options']?_0x1c65e8[_0xf1a0('0x1c')][_0xf1a0('0x1e')]||null:null,'attributes':_0x1c65e8['options']?_0x1c65e8[_0xf1a0('0x1c')]['attributes']||null:null,'include':_0x1c65e8[_0xf1a0('0x1c')]?_0x1c65e8[_0xf1a0('0x1c')]['include']?_['map'](_0x1c65e8[_0xf1a0('0x1c')][_0xf1a0('0x21')],function(_0x4cb377){return{'model':db[_0x4cb377['model']],'as':_0x4cb377['as'],'attributes':_0x4cb377[_0xf1a0('0x1f')],'include':_0x4cb377[_0xf1a0('0x21')]?_['map'](_0x4cb377[_0xf1a0('0x21')],function(_0x1ea9c7){return{'model':db[_0x1ea9c7[_0xf1a0('0x22')]],'as':_0x1ea9c7['as'],'attributes':_0x1ea9c7[_0xf1a0('0x1f')],'include':_0x1ea9c7[_0xf1a0('0x21')]?_[_0xf1a0('0x20')](_0x1ea9c7[_0xf1a0('0x21')],function(_0x14b60b){return{'model':db[_0x14b60b[_0xf1a0('0x22')]],'as':_0x14b60b['as'],'attributes':_0x14b60b[_0xf1a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf1a0('0xf')](function(_0x1ddd02){logger[_0xf1a0('0x10')](_0xf1a0('0x24'),_0x1c65e8);logger[_0xf1a0('0x12')](_0xf1a0('0x24'),_0x1c65e8,JSON[_0xf1a0('0x13')](_0x1ddd02));_0x243858(_0x1ddd02);})[_0xf1a0('0x19')](function(_0x3ea837){logger[_0xf1a0('0x14')](_0xf1a0('0x24'),_0x3ea837[_0xf1a0('0x17')],_0x1c65e8);_0x5844b9(_0x42f3b0[_0xf1a0('0x14')](0x1f4,_0x3ea837['message']));});});}; \ No newline at end of file +var _0x395a=['message','info','request\x20sent','result','SmsQueue','findAll','options','where','limit','map','include','model','attributes','GetSmsQueue','catch','ShowSmsQueue','find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x395a,0x66));var _0xa395=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x395a[_0x5ce15c];return _0x36e4f5;};'use strict';var _=require('lodash');var util=require(_0xa395('0x0'));var moment=require(_0xa395('0x1'));var BPromise=require('bluebird');var rs=require(_0xa395('0x2'));var fs=require('fs');var Redis=require(_0xa395('0x3'));var db=require(_0xa395('0x4'))['db'];var utils=require(_0xa395('0x5'));var logger=require(_0xa395('0x6'))('rpc');var config=require(_0xa395('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa395('0x8')][_0xa395('0x9')]({'port':0x232a});config[_0xa395('0xa')]=_[_0xa395('0xb')](config['redis'],{'host':_0xa395('0xc'),'port':0x18eb});var socket=require(_0xa395('0xd'))(new Redis(config[_0xa395('0xa')]));require(_0xa395('0xe'))[_0xa395('0xf')](socket);function respondWithRpcPromise(_0x58a283,_0x3969e9,_0x5027fa){return new BPromise(function(_0x5f27c3,_0x49d594){return client[_0xa395('0x10')](_0x58a283,_0x5027fa)[_0xa395('0x11')](function(_0x1dd6c1){logger['info']('SmsQueue,\x20%s,\x20%s',_0x3969e9,'request\x20sent');logger[_0xa395('0x12')](_0xa395('0x13'),_0x3969e9,'request\x20sent',JSON[_0xa395('0x14')](_0x1dd6c1));if(_0x1dd6c1[_0xa395('0x15')]){if(_0x1dd6c1[_0xa395('0x15')][_0xa395('0x16')]===0x1f4){logger['error'](_0xa395('0x17'),_0x3969e9,_0x1dd6c1['error'][_0xa395('0x18')]);return _0x49d594(_0x1dd6c1[_0xa395('0x15')][_0xa395('0x18')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x3969e9,_0x1dd6c1[_0xa395('0x15')][_0xa395('0x18')]);return _0x5f27c3(_0x1dd6c1[_0xa395('0x15')][_0xa395('0x18')]);}else{logger[_0xa395('0x19')]('SmsQueue,\x20%s,\x20%s',_0x3969e9,_0xa395('0x1a'));_0x5f27c3(_0x1dd6c1[_0xa395('0x1b')][_0xa395('0x18')]);}})['catch'](function(_0x4f1797){logger['error'](_0xa395('0x17'),_0x3969e9,_0x4f1797);_0x49d594(_0x4f1797);});});}exports['GetSmsQueue']=function(_0x275912){var _0x4f3ec7=this;return new Promise(function(_0x213ef4,_0x263f91){return db[_0xa395('0x1c')][_0xa395('0x1d')]({'raw':_0x275912['options']?_0x275912[_0xa395('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x275912[_0xa395('0x1e')]?_0x275912['options'][_0xa395('0x1f')]||null:null,'attributes':_0x275912[_0xa395('0x1e')]?_0x275912[_0xa395('0x1e')]['attributes']||null:null,'limit':_0x275912[_0xa395('0x1e')]?_0x275912['options'][_0xa395('0x20')]||null:null,'include':_0x275912[_0xa395('0x1e')]?_0x275912[_0xa395('0x1e')]['include']?_[_0xa395('0x21')](_0x275912[_0xa395('0x1e')][_0xa395('0x22')],function(_0x3ae043){return{'model':db[_0x3ae043[_0xa395('0x23')]],'as':_0x3ae043['as'],'attributes':_0x3ae043[_0xa395('0x24')],'include':_0x3ae043[_0xa395('0x22')]?_[_0xa395('0x21')](_0x3ae043[_0xa395('0x22')],function(_0x4b88d6){return{'model':db[_0x4b88d6[_0xa395('0x23')]],'as':_0x4b88d6['as'],'attributes':_0x4b88d6[_0xa395('0x24')],'include':_0x4b88d6['include']?_[_0xa395('0x21')](_0x4b88d6['include'],function(_0x809189){return{'model':db[_0x809189['model']],'as':_0x809189['as'],'attributes':_0x809189[_0xa395('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa395('0x11')](function(_0x593d26){logger[_0xa395('0x19')](_0xa395('0x25'),_0x275912);logger[_0xa395('0x12')](_0xa395('0x25'),_0x275912,JSON[_0xa395('0x14')](_0x593d26));_0x213ef4(_0x593d26);})[_0xa395('0x26')](function(_0x10e060){logger['error']('GetSmsQueue',_0x10e060['message'],_0x275912);_0x263f91(_0x4f3ec7[_0xa395('0x15')](0x1f4,_0x10e060[_0xa395('0x18')]));});});};exports[_0xa395('0x27')]=function(_0x16d94e){var _0x47caf7=this;return new Promise(function(_0x3f1cc6,_0x5ef58c){return db[_0xa395('0x1c')][_0xa395('0x28')]({'raw':_0x16d94e[_0xa395('0x1e')]?_0x16d94e['options'][_0xa395('0x29')]===undefined?!![]:![]:!![],'where':_0x16d94e['options']?_0x16d94e[_0xa395('0x1e')]['where']||null:null,'attributes':_0x16d94e['options']?_0x16d94e[_0xa395('0x1e')][_0xa395('0x24')]||null:null,'include':_0x16d94e[_0xa395('0x1e')]?_0x16d94e[_0xa395('0x1e')][_0xa395('0x22')]?_[_0xa395('0x21')](_0x16d94e['options'][_0xa395('0x22')],function(_0x31fca9){return{'model':db[_0x31fca9[_0xa395('0x23')]],'as':_0x31fca9['as'],'attributes':_0x31fca9[_0xa395('0x24')],'include':_0x31fca9[_0xa395('0x22')]?_[_0xa395('0x21')](_0x31fca9[_0xa395('0x22')],function(_0x46c612){return{'model':db[_0x46c612['model']],'as':_0x46c612['as'],'attributes':_0x46c612['attributes'],'include':_0x46c612[_0xa395('0x22')]?_[_0xa395('0x21')](_0x46c612[_0xa395('0x22')],function(_0x1598cf){return{'model':db[_0x1598cf[_0xa395('0x23')]],'as':_0x1598cf['as'],'attributes':_0x1598cf[_0xa395('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c03a8){logger[_0xa395('0x19')](_0xa395('0x27'),_0x16d94e);logger[_0xa395('0x12')]('ShowSmsQueue',_0x16d94e,JSON['stringify'](_0x4c03a8));_0x3f1cc6(_0x4c03a8);})[_0xa395('0x26')](function(_0x2c4cd7){logger[_0xa395('0x15')](_0xa395('0x27'),_0x2c4cd7[_0xa395('0x18')],_0x16d94e);_0x5ef58c(_0x47caf7['error'](0x1f4,_0x2c4cd7[_0xa395('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index d2134b6..4e835af 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 _0x0a9f=['./smsQueue.events','remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0a9f,0x1e0));var _0xf0a9=function(_0x56092a,_0x291ce5){_0x56092a=_0x56092a-0x0;var _0x1c9558=_0x0a9f[_0x56092a];return _0x1c9558;};'use strict';var SmsQueueEvents=require(_0xf0a9('0x0'));var events=['save',_0xf0a9('0x1'),_0xf0a9('0x2')];function createListener(_0x49cedb,_0x5f1cd5){return function(_0x34259a){_0x5f1cd5[_0xf0a9('0x3')](_0x49cedb,_0x34259a);};}function removeListener(_0x5b3bc6,_0x4ec4f1){return function(){SmsQueueEvents[_0xf0a9('0x4')](_0x5b3bc6,_0x4ec4f1);};}exports[_0xf0a9('0x5')]=function(_0x55d983){for(var _0x2118fd=0x0,_0x58929f=events[_0xf0a9('0x6')];_0x2118fd<_0x58929f;_0x2118fd++){var _0xf1db86=events[_0x2118fd];var _0x28c7a6=createListener(_0xf0a9('0x7')+_0xf1db86,_0x55d983);SmsQueueEvents['on'](_0xf1db86,_0x28c7a6);}}; \ No newline at end of file +var _0x64f0=['removeListener','register','length','save','remove','update','emit'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x64f0,0x176));var _0x064f=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x64f0[_0x303c30];return _0x43161b;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x064f('0x0'),_0x064f('0x1'),_0x064f('0x2')];function createListener(_0x39bc82,_0x5ac2af){return function(_0x42c9d7){_0x5ac2af[_0x064f('0x3')](_0x39bc82,_0x42c9d7);};}function removeListener(_0x486608,_0x420548){return function(){SmsQueueEvents[_0x064f('0x4')](_0x486608,_0x420548);};}exports[_0x064f('0x5')]=function(_0x3ae6ef){for(var _0x406a90=0x0,_0x1256b6=events[_0x064f('0x6')];_0x406a90<_0x1256b6;_0x406a90++){var _0x211353=events[_0x406a90];var _0x5c7908=createListener('smsQueue:'+_0x211353,_0x3ae6ef);SmsQueueEvents['on'](_0x211353,_0x5c7908);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index da92270..06b2775 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 _0x809d=['get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5c4b8c,_0x1b76b7){var _0x3ff616=function(_0x48384b){while(--_0x48384b){_0x5c4b8c['push'](_0x5c4b8c['shift']());}};_0x3ff616(++_0x1b76b7);}(_0x809d,0xc1));var _0xd809=function(_0x253d2d,_0x55f1c3){_0x253d2d=_0x253d2d-0x0;var _0x35150f=_0x809d[_0x253d2d];return _0x35150f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd809('0x0'));var express=require(_0xd809('0x1'));var router=express[_0xd809('0x2')]();var fs_extra=require(_0xd809('0x3'));var auth=require(_0xd809('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0xd809('0x5')]('/',auth[_0xd809('0x6')](),controller[_0xd809('0x7')]);router[_0xd809('0x5')]('/describe',auth[_0xd809('0x6')](),controller[_0xd809('0x8')]);router['get'](_0xd809('0x9'),auth['isAuthenticated'](),controller[_0xd809('0xa')]);router[_0xd809('0xb')]('/',auth[_0xd809('0x6')](),controller[_0xd809('0xc')]);router[_0xd809('0xd')]('/:id',auth[_0xd809('0x6')](),controller[_0xd809('0xe')]);router[_0xd809('0xf')]('/:id',auth[_0xd809('0x6')](),controller[_0xd809('0x10')]);module[_0xd809('0x11')]=router; \ No newline at end of file +var _0xe626=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','post','create','update','destroy','exports','multer','util','path'];(function(_0x418387,_0x2c1e78){var _0x36a997=function(_0x3e15cc){while(--_0x3e15cc){_0x418387['push'](_0x418387['shift']());}};_0x36a997(++_0x2c1e78);}(_0xe626,0x9d));var _0x6e62=function(_0x203543,_0x178818){_0x203543=_0x203543-0x0;var _0x48e3c3=_0xe626[_0x203543];return _0x48e3c3;};'use strict';var multer=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var path=require(_0x6e62('0x2'));var timeout=require(_0x6e62('0x3'));var express=require('express');var router=express[_0x6e62('0x4')]();var fs_extra=require(_0x6e62('0x5'));var auth=require(_0x6e62('0x6'));var interaction=require(_0x6e62('0x7'));var config=require(_0x6e62('0x8'));var controller=require('./smsQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6e62('0x9')]);router[_0x6e62('0xa')]('/describe',auth[_0x6e62('0xb')](),controller[_0x6e62('0xc')]);router[_0x6e62('0xa')](_0x6e62('0xd'),auth['isAuthenticated'](),controller[_0x6e62('0xe')]);router[_0x6e62('0xf')]('/',auth['isAuthenticated'](),controller[_0x6e62('0x10')]);router['put'](_0x6e62('0xd'),auth['isAuthenticated'](),controller[_0x6e62('0x11')]);router['delete'](_0x6e62('0xd'),auth[_0x6e62('0xb')](),controller[_0x6e62('0x12')]);module[_0x6e62('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b9e6b9f..5c1d834 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 _0xd08a=['STRING','DATE','exports'];(function(_0x2c9d27,_0x28f56d){var _0x92a97c=function(_0x67380e){while(--_0x67380e){_0x2c9d27['push'](_0x2c9d27['shift']());}};_0x92a97c(++_0x28f56d);}(_0xd08a,0xf8));var _0xad08=function(_0x4930d8,_0x578a52){_0x4930d8=_0x4930d8-0x0;var _0x36c4a3=_0xd08a[_0x4930d8];return _0x36c4a3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xad08('0x0')]={'uniqueid':{'type':Sequelize[_0xad08('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xad08('0x1')]},'joinAt':{'type':Sequelize[_0xad08('0x2')]},'leaveAt':{'type':Sequelize[_0xad08('0x2')]},'acceptAt':{'type':Sequelize[_0xad08('0x2')]},'exitAt':{'type':Sequelize[_0xad08('0x2')]},'reason':{'type':Sequelize[_0xad08('0x1')]}}; \ No newline at end of file +var _0x71a6=['sequelize','exports','STRING','DATE','moment'];(function(_0x2493a8,_0x5a240d){var _0x2b06c9=function(_0x198d3c){while(--_0x198d3c){_0x2493a8['push'](_0x2493a8['shift']());}};_0x2b06c9(++_0x5a240d);}(_0x71a6,0x108));var _0x671a=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x71a6[_0x1e2321];return _0x1d346d;};'use strict';var moment=require(_0x671a('0x0'));var Sequelize=require(_0x671a('0x1'));module[_0x671a('0x2')]={'uniqueid':{'type':Sequelize[_0x671a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x671a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x671a('0x4')]},'acceptAt':{'type':Sequelize[_0x671a('0x4')]},'exitAt':{'type':Sequelize[_0x671a('0x4')]},'reason':{'type':Sequelize[_0x671a('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 269874d..708d63e 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 _0x9b86=['length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','error','name','send','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x18f82b,_0x3ea7a0){var _0x5d8128=function(_0x16a009){while(--_0x16a009){_0x18f82b['push'](_0x18f82b['shift']());}};_0x5d8128(++_0x3ea7a0);}(_0x9b86,0x18d));var _0x69b8=function(_0x230270,_0x3dd597){_0x230270=_0x230270-0x0;var _0x5ef7cd=_0x9b86[_0x230270];return _0x5ef7cd;};'use strict';var emlformat=require(_0x69b8('0x0'));var rimraf=require(_0x69b8('0x1'));var zipdir=require(_0x69b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69b8('0x3'));var moment=require(_0x69b8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x69b8('0x5'));var util=require(_0x69b8('0x6'));var path=require(_0x69b8('0x7'));var sox=require(_0x69b8('0x8'));var csv=require(_0x69b8('0x9'));var ejs=require(_0x69b8('0xa'));var fs=require('fs');var fs_extra=require(_0x69b8('0xb'));var _=require(_0x69b8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x69b8('0xd'));var deskjs=require(_0x69b8('0xe'));var toCsv=require(_0x69b8('0x9'));var querystring=require(_0x69b8('0xf'));var Papa=require('papaparse');var Redis=require(_0x69b8('0x10'));var authService=require(_0x69b8('0x11'));var qs=require(_0x69b8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69b8('0x13'));var logger=require(_0x69b8('0x14'))(_0x69b8('0x15'));var utils=require(_0x69b8('0x16'));var config=require(_0x69b8('0x17'));var licenseUtil=require(_0x69b8('0x18'));var db=require(_0x69b8('0x19'))['db'];function respondWithStatusCode(_0x5e0445,_0x3b7358){_0x3b7358=_0x3b7358||0xcc;return function(_0x5dcae6){if(_0x5dcae6){return _0x5e0445['sendStatus'](_0x3b7358);}return _0x5e0445[_0x69b8('0x1a')](_0x3b7358)[_0x69b8('0x1b')]();};}function respondWithResult(_0x349d43,_0x4c947b){_0x4c947b=_0x4c947b||0xc8;return function(_0xc0f2ba){if(_0xc0f2ba){return _0x349d43[_0x69b8('0x1a')](_0x4c947b)[_0x69b8('0x1c')](_0xc0f2ba);}};}function respondWithFilteredResult(_0x483b28,_0x268de8){return function(_0x45db47){if(_0x45db47){var _0x20a4a5=typeof _0x268de8['offset']===_0x69b8('0x1d')&&typeof _0x268de8[_0x69b8('0x1e')]===_0x69b8('0x1d');var _0x49c738=_0x45db47[_0x69b8('0x1f')];var _0x39cff8=_0x20a4a5?0x0:_0x268de8[_0x69b8('0x20')];var _0x4598c6=_0x20a4a5?_0x45db47[_0x69b8('0x1f')]:_0x268de8['offset']+_0x268de8['limit'];var _0x476163;if(_0x4598c6>=_0x49c738){_0x4598c6=_0x49c738;_0x476163=0xc8;}else{_0x476163=0xce;}_0x483b28[_0x69b8('0x1a')](_0x476163);return _0x483b28[_0x69b8('0x21')](_0x69b8('0x22'),_0x39cff8+'-'+_0x4598c6+'/'+_0x49c738)[_0x69b8('0x1c')](_0x45db47);}return null;};}function patchUpdates(_0x555230){return function(_0x2f893a){try{jsonpatch['apply'](_0x2f893a,_0x555230,!![]);}catch(_0x22e44e){return BPromise[_0x69b8('0x23')](_0x22e44e);}return _0x2f893a['save']();};}function saveUpdates(_0x598337,_0x544e7b){return function(_0x3833fa){if(_0x3833fa){return _0x3833fa[_0x69b8('0x24')](_0x598337)[_0x69b8('0x25')](function(_0x51270b){return _0x51270b;});}return null;};}function removeEntity(_0x304f70,_0x33f549){return function(_0x38ad37){if(_0x38ad37){return _0x38ad37['destroy']()[_0x69b8('0x25')](function(){_0x304f70[_0x69b8('0x1a')](0xcc)[_0x69b8('0x1b')]();});}};}function handleEntityNotFound(_0x1c4580,_0x188c52){return function(_0x1ac3ae){if(!_0x1ac3ae){_0x1c4580['sendStatus'](0x194);}return _0x1ac3ae;};}function handleError(_0x267635,_0x2ffe58){_0x2ffe58=_0x2ffe58||0x1f4;return function(_0x4767c8){logger[_0x69b8('0x26')](_0x4767c8['stack']);if(_0x4767c8[_0x69b8('0x27')]){delete _0x4767c8['name'];}_0x267635['status'](_0x2ffe58)[_0x69b8('0x28')](_0x4767c8);};}exports['index']=function(_0x28c0ad,_0x18f680){var _0x4d626e={},_0x5600e5={},_0x3337e2={'count':0x0,'rows':[]};var _0x1d2f4a=_[_0x69b8('0x29')](db[_0x69b8('0x2a')][_0x69b8('0x2b')],function(_0x4d8791){return{'name':_0x4d8791[_0x69b8('0x2c')],'type':_0x4d8791['type'][_0x69b8('0x2d')]};});_0x5600e5[_0x69b8('0x2e')]=_[_0x69b8('0x29')](_0x1d2f4a,_0x69b8('0x27'));_0x5600e5[_0x69b8('0x2f')]=_[_0x69b8('0x30')](_0x28c0ad[_0x69b8('0x2f')]);_0x5600e5[_0x69b8('0x31')]=_[_0x69b8('0x32')](_0x5600e5['model'],_0x5600e5[_0x69b8('0x2f')]);_0x4d626e[_0x69b8('0x33')]=_['intersection'](_0x5600e5[_0x69b8('0x2e')],qs[_0x69b8('0x34')](_0x28c0ad['query'][_0x69b8('0x34')]));_0x4d626e['attributes']=_0x4d626e[_0x69b8('0x33')][_0x69b8('0x35')]?_0x4d626e[_0x69b8('0x33')]:_0x5600e5['model'];if(!_0x28c0ad[_0x69b8('0x2f')][_0x69b8('0x36')](_0x69b8('0x37'))){_0x4d626e[_0x69b8('0x1e')]=qs[_0x69b8('0x1e')](_0x28c0ad['query'][_0x69b8('0x1e')]);_0x4d626e[_0x69b8('0x20')]=qs[_0x69b8('0x20')](_0x28c0ad['query'][_0x69b8('0x20')]);}_0x4d626e['order']=qs[_0x69b8('0x38')](_0x28c0ad[_0x69b8('0x2f')]['sort']);_0x4d626e[_0x69b8('0x39')]=qs['filters'](_[_0x69b8('0x3a')](_0x28c0ad[_0x69b8('0x2f')],_0x5600e5[_0x69b8('0x31')]),_0x1d2f4a);if(_0x28c0ad[_0x69b8('0x2f')]['filter']){_0x4d626e[_0x69b8('0x39')]=_[_0x69b8('0x3b')](_0x4d626e[_0x69b8('0x39')],{'$or':_[_0x69b8('0x29')](_0x1d2f4a,function(_0x31a2f9){if(_0x31a2f9[_0x69b8('0x3c')]!==_0x69b8('0x3d')){var _0x5c2cee={};_0x5c2cee[_0x31a2f9[_0x69b8('0x27')]]={'$like':'%'+_0x28c0ad[_0x69b8('0x2f')][_0x69b8('0x3e')]+'%'};return _0x5c2cee;}})});}_0x4d626e=_[_0x69b8('0x3b')]({},_0x4d626e,_0x28c0ad[_0x69b8('0x3f')]);var _0x50a7a4={'where':_0x4d626e['where']};return db[_0x69b8('0x2a')][_0x69b8('0x1f')](_0x50a7a4)[_0x69b8('0x25')](function(_0x3529e8){_0x3337e2[_0x69b8('0x1f')]=_0x3529e8;if(_0x28c0ad['query'][_0x69b8('0x40')]){_0x4d626e[_0x69b8('0x41')]=[{'all':!![]}];}return db[_0x69b8('0x2a')][_0x69b8('0x42')](_0x4d626e);})['then'](function(_0x5eb212){_0x3337e2[_0x69b8('0x43')]=_0x5eb212;return _0x3337e2;})['then'](respondWithFilteredResult(_0x18f680,_0x4d626e))[_0x69b8('0x44')](handleError(_0x18f680,null));};exports['show']=function(_0xffd0e7,_0x2a3600){var _0x5e8c98={'raw':!![],'where':{'id':_0xffd0e7[_0x69b8('0x45')]['id']}},_0xf3d2ba={};_0xf3d2ba['model']=_[_0x69b8('0x30')](db[_0x69b8('0x2a')]['rawAttributes']);_0xf3d2ba[_0x69b8('0x2f')]=_['keys'](_0xffd0e7[_0x69b8('0x2f')]);_0xf3d2ba[_0x69b8('0x31')]=_[_0x69b8('0x32')](_0xf3d2ba['model'],_0xf3d2ba[_0x69b8('0x2f')]);_0x5e8c98[_0x69b8('0x33')]=_['intersection'](_0xf3d2ba[_0x69b8('0x2e')],qs[_0x69b8('0x34')](_0xffd0e7['query'][_0x69b8('0x34')]));_0x5e8c98['attributes']=_0x5e8c98[_0x69b8('0x33')][_0x69b8('0x35')]?_0x5e8c98['attributes']:_0xf3d2ba[_0x69b8('0x2e')];if(_0xffd0e7[_0x69b8('0x2f')][_0x69b8('0x40')]){_0x5e8c98[_0x69b8('0x41')]=[{'all':!![]}];}_0x5e8c98=_[_0x69b8('0x3b')]({},_0x5e8c98,_0xffd0e7[_0x69b8('0x3f')]);return db[_0x69b8('0x2a')][_0x69b8('0x46')](_0x5e8c98)[_0x69b8('0x25')](handleEntityNotFound(_0x2a3600,null))[_0x69b8('0x25')](respondWithResult(_0x2a3600,null))[_0x69b8('0x44')](handleError(_0x2a3600,null));};exports['create']=function(_0x2e07e6,_0x1af451){return db[_0x69b8('0x2a')][_0x69b8('0x47')](_0x2e07e6['body'],{})[_0x69b8('0x25')](respondWithResult(_0x1af451,0xc9))[_0x69b8('0x44')](handleError(_0x1af451,null));};exports[_0x69b8('0x24')]=function(_0x1e96a6,_0x2568d9){if(_0x1e96a6[_0x69b8('0x48')]['id']){delete _0x1e96a6[_0x69b8('0x48')]['id'];}return db[_0x69b8('0x2a')]['find']({'where':{'id':_0x1e96a6[_0x69b8('0x45')]['id']}})[_0x69b8('0x25')](handleEntityNotFound(_0x2568d9,null))[_0x69b8('0x25')](saveUpdates(_0x1e96a6[_0x69b8('0x48')],null))['then'](respondWithResult(_0x2568d9,null))[_0x69b8('0x44')](handleError(_0x2568d9,null));};exports[_0x69b8('0x49')]=function(_0x2e5b39,_0x34e32c){return db[_0x69b8('0x2a')]['find']({'where':{'id':_0x2e5b39['params']['id']}})[_0x69b8('0x25')](handleEntityNotFound(_0x34e32c,null))['then'](removeEntity(_0x34e32c,null))['catch'](handleError(_0x34e32c,null));};exports[_0x69b8('0x4a')]=function(_0x3fc59e,_0x489955){return db[_0x69b8('0x2a')][_0x69b8('0x4a')]()[_0x69b8('0x25')](respondWithResult(_0x489955,null))[_0x69b8('0x44')](handleError(_0x489955,null));}; \ No newline at end of file +var _0x8976=['to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','SmsQueueReport','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','params','options','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x8976,0x8c));var _0x6897=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8976[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6897('0x0'));var rimraf=require(_0x6897('0x1'));var zipdir=require(_0x6897('0x2'));var jsonpatch=require(_0x6897('0x3'));var rp=require(_0x6897('0x4'));var moment=require(_0x6897('0x5'));var BPromise=require(_0x6897('0x6'));var Mustache=require(_0x6897('0x7'));var util=require(_0x6897('0x8'));var path=require('path');var sox=require(_0x6897('0x9'));var csv=require(_0x6897('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6897('0xb'));var _=require(_0x6897('0xc'));var squel=require('squel');var crypto=require(_0x6897('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6897('0xe'));var Papa=require(_0x6897('0xf'));var Redis=require(_0x6897('0x10'));var authService=require(_0x6897('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6897('0x12'));var hardwareService=require(_0x6897('0x13'));var logger=require(_0x6897('0x14'))(_0x6897('0x15'));var utils=require('../../config/utils');var config=require(_0x6897('0x16'));var licenseUtil=require(_0x6897('0x17'));var db=require(_0x6897('0x18'))['db'];function respondWithStatusCode(_0x47f6c5,_0x5c1a7b){_0x5c1a7b=_0x5c1a7b||0xcc;return function(_0x5ea5f2){if(_0x5ea5f2){return _0x47f6c5[_0x6897('0x19')](_0x5c1a7b);}return _0x47f6c5[_0x6897('0x1a')](_0x5c1a7b)['end']();};}function respondWithResult(_0x3068fa,_0x5ebf0f){_0x5ebf0f=_0x5ebf0f||0xc8;return function(_0x3e5703){if(_0x3e5703){return _0x3068fa[_0x6897('0x1a')](_0x5ebf0f)[_0x6897('0x1b')](_0x3e5703);}};}function respondWithFilteredResult(_0x1d485e,_0x5abef5){return function(_0x3d0df6){if(_0x3d0df6){var _0x327495=typeof _0x5abef5[_0x6897('0x1c')]===_0x6897('0x1d')&&typeof _0x5abef5[_0x6897('0x1e')]==='undefined';var _0x565291=_0x3d0df6[_0x6897('0x1f')];var _0x5b3e0f=_0x327495?0x0:_0x5abef5[_0x6897('0x1c')];var _0x341ea2=_0x327495?_0x3d0df6[_0x6897('0x1f')]:_0x5abef5[_0x6897('0x1c')]+_0x5abef5[_0x6897('0x1e')];var _0x35d962;if(_0x341ea2>=_0x565291){_0x341ea2=_0x565291;_0x35d962=0xc8;}else{_0x35d962=0xce;}_0x1d485e['status'](_0x35d962);return _0x1d485e[_0x6897('0x20')]('Content-Range',_0x5b3e0f+'-'+_0x341ea2+'/'+_0x565291)['json'](_0x3d0df6);}return null;};}function patchUpdates(_0xfce5d4){return function(_0x214432){try{jsonpatch[_0x6897('0x21')](_0x214432,_0xfce5d4,!![]);}catch(_0x501b98){return BPromise[_0x6897('0x22')](_0x501b98);}return _0x214432[_0x6897('0x23')]();};}function saveUpdates(_0x253442,_0x10f1af){return function(_0x50ac7c){if(_0x50ac7c){return _0x50ac7c['update'](_0x253442)[_0x6897('0x24')](function(_0x2fefc1){return _0x2fefc1;});}return null;};}function removeEntity(_0x236b00,_0x1568ed){return function(_0x322953){if(_0x322953){return _0x322953[_0x6897('0x25')]()[_0x6897('0x24')](function(){_0x236b00['status'](0xcc)[_0x6897('0x26')]();});}};}function handleEntityNotFound(_0x1b6dd1,_0x2e9d91){return function(_0x98e6f2){if(!_0x98e6f2){_0x1b6dd1['sendStatus'](0x194);}return _0x98e6f2;};}function handleError(_0x265ff4,_0x325cd7){_0x325cd7=_0x325cd7||0x1f4;return function(_0x112c7a){logger[_0x6897('0x27')](_0x112c7a[_0x6897('0x28')]);if(_0x112c7a[_0x6897('0x29')]){delete _0x112c7a[_0x6897('0x29')];}_0x265ff4[_0x6897('0x1a')](_0x325cd7)[_0x6897('0x2a')](_0x112c7a);};}exports[_0x6897('0x2b')]=function(_0x2ce20d,_0x4fd658){var _0x5ca849={},_0x59bae3={},_0x55e999={'count':0x0,'rows':[]};var _0x6a0786=_['map'](db[_0x6897('0x2c')]['rawAttributes'],function(_0x1dd53b){return{'name':_0x1dd53b[_0x6897('0x2d')],'type':_0x1dd53b[_0x6897('0x2e')][_0x6897('0x2f')]};});_0x59bae3['model']=_['map'](_0x6a0786,_0x6897('0x29'));_0x59bae3['query']=_[_0x6897('0x30')](_0x2ce20d[_0x6897('0x31')]);_0x59bae3[_0x6897('0x32')]=_[_0x6897('0x33')](_0x59bae3[_0x6897('0x34')],_0x59bae3['query']);_0x5ca849['attributes']=_['intersection'](_0x59bae3['model'],qs[_0x6897('0x35')](_0x2ce20d[_0x6897('0x31')][_0x6897('0x35')]));_0x5ca849[_0x6897('0x36')]=_0x5ca849[_0x6897('0x36')][_0x6897('0x37')]?_0x5ca849[_0x6897('0x36')]:_0x59bae3[_0x6897('0x34')];if(!_0x2ce20d[_0x6897('0x31')][_0x6897('0x38')]('nolimit')){_0x5ca849[_0x6897('0x1e')]=qs[_0x6897('0x1e')](_0x2ce20d[_0x6897('0x31')][_0x6897('0x1e')]);_0x5ca849[_0x6897('0x1c')]=qs[_0x6897('0x1c')](_0x2ce20d[_0x6897('0x31')]['offset']);}_0x5ca849[_0x6897('0x39')]=qs[_0x6897('0x3a')](_0x2ce20d[_0x6897('0x31')]['sort']);_0x5ca849[_0x6897('0x3b')]=qs[_0x6897('0x32')](_[_0x6897('0x3c')](_0x2ce20d[_0x6897('0x31')],_0x59bae3[_0x6897('0x32')]),_0x6a0786);if(_0x2ce20d[_0x6897('0x31')][_0x6897('0x3d')]){_0x5ca849[_0x6897('0x3b')]=_[_0x6897('0x3e')](_0x5ca849['where'],{'$or':_['map'](_0x6a0786,function(_0x2dbf66){if(_0x2dbf66[_0x6897('0x2e')]!==_0x6897('0x3f')){var _0x4220a8={};_0x4220a8[_0x2dbf66['name']]={'$like':'%'+_0x2ce20d[_0x6897('0x31')][_0x6897('0x3d')]+'%'};return _0x4220a8;}})});}_0x5ca849=_['merge']({},_0x5ca849,_0x2ce20d['options']);var _0x52600f={'where':_0x5ca849['where']};return db[_0x6897('0x2c')][_0x6897('0x1f')](_0x52600f)[_0x6897('0x24')](function(_0x4d0424){_0x55e999[_0x6897('0x1f')]=_0x4d0424;if(_0x2ce20d[_0x6897('0x31')][_0x6897('0x40')]){_0x5ca849[_0x6897('0x41')]=[{'all':!![]}];}return db[_0x6897('0x2c')][_0x6897('0x42')](_0x5ca849);})[_0x6897('0x24')](function(_0x19ad98){_0x55e999['rows']=_0x19ad98;return _0x55e999;})[_0x6897('0x24')](respondWithFilteredResult(_0x4fd658,_0x5ca849))['catch'](handleError(_0x4fd658,null));};exports['show']=function(_0x4ee42f,_0x9d6f6f){var _0x56913c={'raw':!![],'where':{'id':_0x4ee42f[_0x6897('0x43')]['id']}},_0x5c0396={};_0x5c0396[_0x6897('0x34')]=_['keys'](db[_0x6897('0x2c')]['rawAttributes']);_0x5c0396[_0x6897('0x31')]=_['keys'](_0x4ee42f[_0x6897('0x31')]);_0x5c0396[_0x6897('0x32')]=_['intersection'](_0x5c0396[_0x6897('0x34')],_0x5c0396['query']);_0x56913c['attributes']=_['intersection'](_0x5c0396[_0x6897('0x34')],qs[_0x6897('0x35')](_0x4ee42f[_0x6897('0x31')][_0x6897('0x35')]));_0x56913c[_0x6897('0x36')]=_0x56913c['attributes'][_0x6897('0x37')]?_0x56913c[_0x6897('0x36')]:_0x5c0396[_0x6897('0x34')];if(_0x4ee42f['query'][_0x6897('0x40')]){_0x56913c[_0x6897('0x41')]=[{'all':!![]}];}_0x56913c=_[_0x6897('0x3e')]({},_0x56913c,_0x4ee42f[_0x6897('0x44')]);return db[_0x6897('0x2c')]['find'](_0x56913c)[_0x6897('0x24')](handleEntityNotFound(_0x9d6f6f,null))[_0x6897('0x24')](respondWithResult(_0x9d6f6f,null))[_0x6897('0x45')](handleError(_0x9d6f6f,null));};exports[_0x6897('0x46')]=function(_0x1c50fa,_0x65e984){return db[_0x6897('0x2c')]['create'](_0x1c50fa[_0x6897('0x47')],{})['then'](respondWithResult(_0x65e984,0xc9))[_0x6897('0x45')](handleError(_0x65e984,null));};exports[_0x6897('0x48')]=function(_0xd5208a,_0x34445a){if(_0xd5208a['body']['id']){delete _0xd5208a[_0x6897('0x47')]['id'];}return db['SmsQueueReport'][_0x6897('0x49')]({'where':{'id':_0xd5208a[_0x6897('0x43')]['id']}})[_0x6897('0x24')](handleEntityNotFound(_0x34445a,null))[_0x6897('0x24')](saveUpdates(_0xd5208a[_0x6897('0x47')],null))[_0x6897('0x24')](respondWithResult(_0x34445a,null))[_0x6897('0x45')](handleError(_0x34445a,null));};exports[_0x6897('0x25')]=function(_0x2fc693,_0x1a37fd){return db['SmsQueueReport']['find']({'where':{'id':_0x2fc693['params']['id']}})[_0x6897('0x24')](handleEntityNotFound(_0x1a37fd,null))[_0x6897('0x24')](removeEntity(_0x1a37fd,null))[_0x6897('0x45')](handleError(_0x1a37fd,null));};exports[_0x6897('0x4a')]=function(_0x116a18,_0x2fd606){return db[_0x6897('0x2c')]['describe']()[_0x6897('0x24')](respondWithResult(_0x2fd606,null))[_0x6897('0x45')](handleError(_0x2fd606,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9e49679..5d94448 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x5c026c,_0xcd5950){var _0x386790=function(_0x569ed9){while(--_0x569ed9){_0x5c026c['push'](_0x5c026c['shift']());}};_0x386790(++_0xcd5950);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0xcb91[_0x51ec61];return _0x223200;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0xcc89a,_0x13e8bb){var _0x5b557a=function(_0x833bb5){while(--_0x833bb5){_0xcc89a['push'](_0xcc89a['shift']());}};_0x5b557a(++_0x13e8bb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb7e7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 321b4d9..b45dbaf 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 _0x1a6e=['../../config/environment','jayson/promise','client','http','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport','create','options','raw','then','UpdateSmsQueueReport','SmsQueueReport','body','where','attributes','limit','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x56d82d,_0x497e85){var _0x505ec6=function(_0x154450){while(--_0x154450){_0x56d82d['push'](_0x56d82d['shift']());}};_0x505ec6(++_0x497e85);}(_0x1a6e,0x1b9));var _0xe1a6=function(_0x5673c4,_0x5b672d){_0x5673c4=_0x5673c4-0x0;var _0x32b859=_0x1a6e[_0x5673c4];return _0x32b859;};'use strict';var _=require(_0xe1a6('0x0'));var util=require(_0xe1a6('0x1'));var moment=require('moment');var BPromise=require(_0xe1a6('0x2'));var rs=require(_0xe1a6('0x3'));var fs=require('fs');var Redis=require(_0xe1a6('0x4'));var db=require(_0xe1a6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe1a6('0x6'))('rpc');var config=require(_0xe1a6('0x7'));var jayson=require(_0xe1a6('0x8'));var client=jayson[_0xe1a6('0x9')][_0xe1a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e1f77,_0xe5b6db,_0x8a98c7){return new BPromise(function(_0x8b1956,_0x58021f){return client['request'](_0x4e1f77,_0x8a98c7)['then'](function(_0x5f0547){logger[_0xe1a6('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0xe5b6db,_0xe1a6('0xc'));logger['debug'](_0xe1a6('0xd'),_0xe5b6db,_0xe1a6('0xc'),JSON[_0xe1a6('0xe')](_0x5f0547));if(_0x5f0547[_0xe1a6('0xf')]){if(_0x5f0547[_0xe1a6('0xf')]['code']===0x1f4){logger[_0xe1a6('0xf')](_0xe1a6('0x10'),_0xe5b6db,_0x5f0547[_0xe1a6('0xf')][_0xe1a6('0x11')]);return _0x58021f(_0x5f0547[_0xe1a6('0xf')][_0xe1a6('0x11')]);}logger[_0xe1a6('0xf')](_0xe1a6('0x10'),_0xe5b6db,_0x5f0547[_0xe1a6('0xf')][_0xe1a6('0x11')]);return _0x8b1956(_0x5f0547[_0xe1a6('0xf')][_0xe1a6('0x11')]);}else{logger[_0xe1a6('0xb')](_0xe1a6('0x10'),_0xe5b6db,_0xe1a6('0xc'));_0x8b1956(_0x5f0547[_0xe1a6('0x12')][_0xe1a6('0x11')]);}})[_0xe1a6('0x13')](function(_0xd63781){logger[_0xe1a6('0xf')](_0xe1a6('0x10'),_0xe5b6db,_0xd63781);_0x58021f(_0xd63781);});});}exports[_0xe1a6('0x14')]=function(_0x534bd1){var _0x2aa19b=this;return new Promise(function(_0x479f5e,_0xd2f26b){return db['SmsQueueReport'][_0xe1a6('0x15')](_0x534bd1['body'],{'raw':_0x534bd1[_0xe1a6('0x16')]?_0x534bd1['options'][_0xe1a6('0x17')]===undefined?!![]:![]:!![]})[_0xe1a6('0x18')](function(_0x461856){logger[_0xe1a6('0xb')](_0xe1a6('0x14'),_0x534bd1);logger['debug']('CreateSmsQueueReport',_0x534bd1,JSON['stringify'](_0x461856));_0x479f5e(_0x461856);})[_0xe1a6('0x13')](function(_0x10c410){logger[_0xe1a6('0xf')](_0xe1a6('0x14'),_0x10c410[_0xe1a6('0x11')],_0x534bd1);_0xd2f26b(_0x2aa19b[_0xe1a6('0xf')](0x1f4,_0x10c410[_0xe1a6('0x11')]));});});};exports[_0xe1a6('0x19')]=function(_0x10b89e){var _0x2daa7c=this;return new Promise(function(_0x3dcc1d,_0x183eec){return db[_0xe1a6('0x1a')]['update'](_0x10b89e[_0xe1a6('0x1b')],{'raw':_0x10b89e[_0xe1a6('0x16')]?_0x10b89e['options'][_0xe1a6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10b89e[_0xe1a6('0x16')]?_0x10b89e[_0xe1a6('0x16')][_0xe1a6('0x1c')]||null:null,'attributes':_0x10b89e[_0xe1a6('0x16')]?_0x10b89e[_0xe1a6('0x16')][_0xe1a6('0x1d')]||null:null,'limit':_0x10b89e[_0xe1a6('0x16')]?_0x10b89e[_0xe1a6('0x16')][_0xe1a6('0x1e')]||null:null})[_0xe1a6('0x18')](function(_0x1978e0){logger[_0xe1a6('0xb')]('UpdateSmsQueueReport',_0x10b89e);logger[_0xe1a6('0x1f')](_0xe1a6('0x19'),_0x10b89e,JSON[_0xe1a6('0xe')](_0x1978e0));_0x3dcc1d(_0x1978e0);})[_0xe1a6('0x13')](function(_0x3e7a10){logger[_0xe1a6('0xf')](_0xe1a6('0x19'),_0x3e7a10[_0xe1a6('0x11')],_0x10b89e);_0x183eec(_0x2daa7c['error'](0x1f4,_0x3e7a10[_0xe1a6('0x11')]));});});}; \ No newline at end of file +var _0xa1bf=['body','options','raw','debug','UpdateSmsQueueReport','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create'];(function(_0x544d3b,_0x20b010){var _0x3c6d8f=function(_0x1840b7){while(--_0x1840b7){_0x544d3b['push'](_0x544d3b['shift']());}};_0x3c6d8f(++_0x20b010);}(_0xa1bf,0x193));var _0xfa1b=function(_0x9b4c19,_0x42a6d8){_0x9b4c19=_0x9b4c19-0x0;var _0x40c837=_0xa1bf[_0x9b4c19];return _0x40c837;};'use strict';var _=require(_0xfa1b('0x0'));var util=require('util');var moment=require(_0xfa1b('0x1'));var BPromise=require(_0xfa1b('0x2'));var rs=require(_0xfa1b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa1b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa1b('0x5'))(_0xfa1b('0x6'));var config=require(_0xfa1b('0x7'));var jayson=require(_0xfa1b('0x8'));var client=jayson[_0xfa1b('0x9')][_0xfa1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dd63d,_0x7fd6c7,_0x3201e2){return new BPromise(function(_0xf66813,_0x5af9cc){return client[_0xfa1b('0xb')](_0x5dd63d,_0x3201e2)[_0xfa1b('0xc')](function(_0x2a48ce){logger[_0xfa1b('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x7fd6c7,_0xfa1b('0xe'));logger['debug'](_0xfa1b('0xf'),_0x7fd6c7,_0xfa1b('0xe'),JSON[_0xfa1b('0x10')](_0x2a48ce));if(_0x2a48ce[_0xfa1b('0x11')]){if(_0x2a48ce[_0xfa1b('0x11')][_0xfa1b('0x12')]===0x1f4){logger['error'](_0xfa1b('0x13'),_0x7fd6c7,_0x2a48ce[_0xfa1b('0x11')][_0xfa1b('0x14')]);return _0x5af9cc(_0x2a48ce[_0xfa1b('0x11')][_0xfa1b('0x14')]);}logger[_0xfa1b('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x7fd6c7,_0x2a48ce[_0xfa1b('0x11')][_0xfa1b('0x14')]);return _0xf66813(_0x2a48ce['error'][_0xfa1b('0x14')]);}else{logger[_0xfa1b('0xd')](_0xfa1b('0x13'),_0x7fd6c7,'request\x20sent');_0xf66813(_0x2a48ce[_0xfa1b('0x15')][_0xfa1b('0x14')]);}})[_0xfa1b('0x16')](function(_0x42a2dd){logger[_0xfa1b('0x11')](_0xfa1b('0x13'),_0x7fd6c7,_0x42a2dd);_0x5af9cc(_0x42a2dd);});});}exports[_0xfa1b('0x17')]=function(_0x133381){var _0x638cfb=this;return new Promise(function(_0x1aeb3f,_0x5a18a6){return db[_0xfa1b('0x18')][_0xfa1b('0x19')](_0x133381[_0xfa1b('0x1a')],{'raw':_0x133381[_0xfa1b('0x1b')]?_0x133381[_0xfa1b('0x1b')][_0xfa1b('0x1c')]===undefined?!![]:![]:!![]})[_0xfa1b('0xc')](function(_0x4767c8){logger['info']('CreateSmsQueueReport',_0x133381);logger[_0xfa1b('0x1d')](_0xfa1b('0x17'),_0x133381,JSON[_0xfa1b('0x10')](_0x4767c8));_0x1aeb3f(_0x4767c8);})[_0xfa1b('0x16')](function(_0x175113){logger['error'](_0xfa1b('0x17'),_0x175113[_0xfa1b('0x14')],_0x133381);_0x5a18a6(_0x638cfb[_0xfa1b('0x11')](0x1f4,_0x175113[_0xfa1b('0x14')]));});});};exports[_0xfa1b('0x1e')]=function(_0x5b3de7){var _0x25aa2c=this;return new Promise(function(_0x326099,_0x3fcc7d){return db[_0xfa1b('0x18')]['update'](_0x5b3de7[_0xfa1b('0x1a')],{'raw':_0x5b3de7[_0xfa1b('0x1b')]?_0x5b3de7['options'][_0xfa1b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b3de7[_0xfa1b('0x1b')]?_0x5b3de7[_0xfa1b('0x1b')][_0xfa1b('0x1f')]||null:null,'attributes':_0x5b3de7[_0xfa1b('0x1b')]?_0x5b3de7[_0xfa1b('0x1b')][_0xfa1b('0x20')]||null:null,'limit':_0x5b3de7[_0xfa1b('0x1b')]?_0x5b3de7[_0xfa1b('0x1b')]['limit']||null:null})[_0xfa1b('0xc')](function(_0x31c13b){logger[_0xfa1b('0xd')](_0xfa1b('0x1e'),_0x5b3de7);logger[_0xfa1b('0x1d')](_0xfa1b('0x1e'),_0x5b3de7,JSON[_0xfa1b('0x10')](_0x31c13b));_0x326099(_0x31c13b);})[_0xfa1b('0x16')](function(_0x4e5fe4){logger[_0xfa1b('0x11')](_0xfa1b('0x1e'),_0x4e5fe4[_0xfa1b('0x14')],_0x5b3de7);_0x3fcc7d(_0x25aa2c[_0xfa1b('0x11')](0x1f4,_0x4e5fe4[_0xfa1b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 8c23ed6..dad1c16 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 _0xeec6=['isAuthenticated','index','/describe','describe','get','show','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xeec6,0x1c2));var _0x6eec=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0xeec6[_0x21b36c];return _0x236627;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6eec('0x11'),auth[_0x6eec('0xa')](),controller['update']);router['delete'](_0x6eec('0x11'),auth['isAuthenticated'](),controller[_0x6eec('0x12')]);module[_0x6eec('0x13')]=router; \ No newline at end of file +var _0x2123=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x292e8a,_0x464bf2){var _0x39d664=function(_0x104def){while(--_0x104def){_0x292e8a['push'](_0x292e8a['shift']());}};_0x39d664(++_0x464bf2);}(_0x2123,0x190));var _0x3212=function(_0x7abb35,_0x25b777){_0x7abb35=_0x7abb35-0x0;var _0x5435fe=_0x2123[_0x7abb35];return _0x5435fe;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),auth['isAuthenticated'](),controller[_0x3212('0xe')]);router['get'](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x11')]);router[_0x3212('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3212('0x13')](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x14')]);router[_0x3212('0x15')](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x16')]);module[_0x3212('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 0ab3c2d..fe8622f 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0x9bde,0xe1));var _0xe9bd=function(_0xb8c536,_0x4ec8f4){_0xb8c536=_0xb8c536-0x0;var _0x27e3da=_0x9bde[_0xb8c536];return _0x27e3da;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4369d1,_0x49710c){var _0x334f8a=function(_0x15bcb0){while(--_0x15bcb0){_0x4369d1['push'](_0x4369d1['shift']());}};_0x334f8a(++_0x49710c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xcb91[_0x2e50a2];return _0x47e5de;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 32dedaf..a90e6e0 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 _0x5324=['../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','map','SmsTransferReport','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','merge','findAll','rows','catch','includeAll','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x114f02,_0x2528e1){var _0xc0e8f4=function(_0x5f78d3){while(--_0x5f78d3){_0x114f02['push'](_0x114f02['shift']());}};_0xc0e8f4(++_0x2528e1);}(_0x5324,0x154));var _0x4532=function(_0x1964ce,_0x1bcaf1){_0x1964ce=_0x1964ce-0x0;var _0x27ee31=_0x5324[_0x1964ce];return _0x27ee31;};'use strict';var emlformat=require(_0x4532('0x0'));var rimraf=require(_0x4532('0x1'));var zipdir=require(_0x4532('0x2'));var jsonpatch=require(_0x4532('0x3'));var rp=require('request-promise');var moment=require(_0x4532('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4532('0x5'));var util=require(_0x4532('0x6'));var path=require(_0x4532('0x7'));var sox=require(_0x4532('0x8'));var csv=require(_0x4532('0x9'));var ejs=require(_0x4532('0xa'));var fs=require('fs');var fs_extra=require(_0x4532('0xb'));var _=require(_0x4532('0xc'));var squel=require('squel');var crypto=require(_0x4532('0xd'));var jsforce=require(_0x4532('0xe'));var deskjs=require(_0x4532('0xf'));var toCsv=require(_0x4532('0x9'));var querystring=require(_0x4532('0x10'));var Papa=require(_0x4532('0x11'));var Redis=require(_0x4532('0x12'));var authService=require(_0x4532('0x13'));var qs=require(_0x4532('0x14'));var as=require(_0x4532('0x15'));var hardwareService=require(_0x4532('0x16'));var logger=require(_0x4532('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4532('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4532('0x19'))['db'];function respondWithStatusCode(_0x2b0540,_0x26b91f){_0x26b91f=_0x26b91f||0xcc;return function(_0x3faaeb){if(_0x3faaeb){return _0x2b0540['sendStatus'](_0x26b91f);}return _0x2b0540[_0x4532('0x1a')](_0x26b91f)[_0x4532('0x1b')]();};}function respondWithResult(_0x39acf3,_0x2e0b21){_0x2e0b21=_0x2e0b21||0xc8;return function(_0x19eaf3){if(_0x19eaf3){return _0x39acf3['status'](_0x2e0b21)['json'](_0x19eaf3);}};}function respondWithFilteredResult(_0x52166a,_0x38cd2a){return function(_0x19ea01){if(_0x19ea01){var _0x2dedca=typeof _0x38cd2a[_0x4532('0x1c')]===_0x4532('0x1d')&&typeof _0x38cd2a[_0x4532('0x1e')]===_0x4532('0x1d');var _0x4036b6=_0x19ea01[_0x4532('0x1f')];var _0x4db2a1=_0x2dedca?0x0:_0x38cd2a[_0x4532('0x1c')];var _0x469c5a=_0x2dedca?_0x19ea01[_0x4532('0x1f')]:_0x38cd2a['offset']+_0x38cd2a[_0x4532('0x1e')];var _0x3734e3;if(_0x469c5a>=_0x4036b6){_0x469c5a=_0x4036b6;_0x3734e3=0xc8;}else{_0x3734e3=0xce;}_0x52166a['status'](_0x3734e3);return _0x52166a[_0x4532('0x20')](_0x4532('0x21'),_0x4db2a1+'-'+_0x469c5a+'/'+_0x4036b6)[_0x4532('0x22')](_0x19ea01);}return null;};}function patchUpdates(_0x41a7f7){return function(_0x3f677b){try{jsonpatch[_0x4532('0x23')](_0x3f677b,_0x41a7f7,!![]);}catch(_0x6a669f){return BPromise[_0x4532('0x24')](_0x6a669f);}return _0x3f677b['save']();};}function saveUpdates(_0x94b670,_0x46dc73){return function(_0x481c26){if(_0x481c26){return _0x481c26[_0x4532('0x25')](_0x94b670)[_0x4532('0x26')](function(_0x472d0d){return _0x472d0d;});}return null;};}function removeEntity(_0xed85b1,_0x4fd4bd){return function(_0xbf825a){if(_0xbf825a){return _0xbf825a['destroy']()[_0x4532('0x26')](function(){_0xed85b1[_0x4532('0x1a')](0xcc)[_0x4532('0x1b')]();});}};}function handleEntityNotFound(_0x12ee78,_0x40e42f){return function(_0x278b04){if(!_0x278b04){_0x12ee78[_0x4532('0x27')](0x194);}return _0x278b04;};}function handleError(_0x309865,_0x4a386a){_0x4a386a=_0x4a386a||0x1f4;return function(_0x4b804b){logger[_0x4532('0x28')](_0x4b804b[_0x4532('0x29')]);if(_0x4b804b[_0x4532('0x2a')]){delete _0x4b804b[_0x4532('0x2a')];}_0x309865[_0x4532('0x1a')](_0x4a386a)[_0x4532('0x2b')](_0x4b804b);};}exports['index']=function(_0x3de0ee,_0x239e85){var _0x11d163={},_0x16836c={},_0xd6feb9={'count':0x0,'rows':[]};var _0x485a3f=_[_0x4532('0x2c')](db[_0x4532('0x2d')][_0x4532('0x2e')],function(_0x523f96){return{'name':_0x523f96['fieldName'],'type':_0x523f96['type'][_0x4532('0x2f')]};});_0x16836c[_0x4532('0x30')]=_[_0x4532('0x2c')](_0x485a3f,_0x4532('0x2a'));_0x16836c[_0x4532('0x31')]=_[_0x4532('0x32')](_0x3de0ee[_0x4532('0x31')]);_0x16836c['filters']=_['intersection'](_0x16836c[_0x4532('0x30')],_0x16836c[_0x4532('0x31')]);_0x11d163['attributes']=_[_0x4532('0x33')](_0x16836c[_0x4532('0x30')],qs[_0x4532('0x34')](_0x3de0ee[_0x4532('0x31')][_0x4532('0x34')]));_0x11d163[_0x4532('0x35')]=_0x11d163[_0x4532('0x35')][_0x4532('0x36')]?_0x11d163['attributes']:_0x16836c['model'];if(!_0x3de0ee[_0x4532('0x31')][_0x4532('0x37')]('nolimit')){_0x11d163[_0x4532('0x1e')]=qs[_0x4532('0x1e')](_0x3de0ee[_0x4532('0x31')][_0x4532('0x1e')]);_0x11d163['offset']=qs[_0x4532('0x1c')](_0x3de0ee['query'][_0x4532('0x1c')]);}_0x11d163['order']=qs[_0x4532('0x38')](_0x3de0ee[_0x4532('0x31')][_0x4532('0x38')]);_0x11d163[_0x4532('0x39')]=qs[_0x4532('0x3a')](_[_0x4532('0x3b')](_0x3de0ee[_0x4532('0x31')],_0x16836c[_0x4532('0x3a')]),_0x485a3f);if(_0x3de0ee[_0x4532('0x31')][_0x4532('0x3c')]){_0x11d163[_0x4532('0x39')]=_['merge'](_0x11d163[_0x4532('0x39')],{'$or':_['map'](_0x485a3f,function(_0x493fc4){if(_0x493fc4[_0x4532('0x3d')]!=='VIRTUAL'){var _0x421033={};_0x421033[_0x493fc4[_0x4532('0x2a')]]={'$like':'%'+_0x3de0ee[_0x4532('0x31')][_0x4532('0x3c')]+'%'};return _0x421033;}})});}_0x11d163=_[_0x4532('0x3e')]({},_0x11d163,_0x3de0ee['options']);var _0x51e813={'where':_0x11d163[_0x4532('0x39')]};return db[_0x4532('0x2d')]['count'](_0x51e813)[_0x4532('0x26')](function(_0x4c50ee){_0xd6feb9[_0x4532('0x1f')]=_0x4c50ee;if(_0x3de0ee[_0x4532('0x31')]['includeAll']){_0x11d163['include']=[{'all':!![]}];}return db[_0x4532('0x2d')][_0x4532('0x3f')](_0x11d163);})[_0x4532('0x26')](function(_0x56f3d6){_0xd6feb9[_0x4532('0x40')]=_0x56f3d6;return _0xd6feb9;})[_0x4532('0x26')](respondWithFilteredResult(_0x239e85,_0x11d163))[_0x4532('0x41')](handleError(_0x239e85,null));};exports['show']=function(_0x5cca1a,_0x3d8398){var _0x5c401a={'raw':!![],'where':{'id':_0x5cca1a['params']['id']}},_0x2b39c8={};_0x2b39c8[_0x4532('0x30')]=_[_0x4532('0x32')](db[_0x4532('0x2d')][_0x4532('0x2e')]);_0x2b39c8['query']=_['keys'](_0x5cca1a[_0x4532('0x31')]);_0x2b39c8[_0x4532('0x3a')]=_[_0x4532('0x33')](_0x2b39c8[_0x4532('0x30')],_0x2b39c8['query']);_0x5c401a[_0x4532('0x35')]=_[_0x4532('0x33')](_0x2b39c8[_0x4532('0x30')],qs[_0x4532('0x34')](_0x5cca1a[_0x4532('0x31')]['fields']));_0x5c401a[_0x4532('0x35')]=_0x5c401a[_0x4532('0x35')][_0x4532('0x36')]?_0x5c401a[_0x4532('0x35')]:_0x2b39c8[_0x4532('0x30')];if(_0x5cca1a[_0x4532('0x31')][_0x4532('0x42')]){_0x5c401a['include']=[{'all':!![]}];}_0x5c401a=_[_0x4532('0x3e')]({},_0x5c401a,_0x5cca1a['options']);return db['SmsTransferReport'][_0x4532('0x43')](_0x5c401a)[_0x4532('0x26')](handleEntityNotFound(_0x3d8398,null))['then'](respondWithResult(_0x3d8398,null))['catch'](handleError(_0x3d8398,null));};exports[_0x4532('0x44')]=function(_0x4dfc6f,_0x1447d4){return db[_0x4532('0x2d')][_0x4532('0x44')](_0x4dfc6f[_0x4532('0x45')],{})[_0x4532('0x26')](respondWithResult(_0x1447d4,0xc9))['catch'](handleError(_0x1447d4,null));};exports[_0x4532('0x25')]=function(_0x388583,_0x31501d){if(_0x388583['body']['id']){delete _0x388583[_0x4532('0x45')]['id'];}return db['SmsTransferReport'][_0x4532('0x43')]({'where':{'id':_0x388583['params']['id']}})[_0x4532('0x26')](handleEntityNotFound(_0x31501d,null))[_0x4532('0x26')](saveUpdates(_0x388583[_0x4532('0x45')],null))[_0x4532('0x26')](respondWithResult(_0x31501d,null))[_0x4532('0x41')](handleError(_0x31501d,null));};exports[_0x4532('0x46')]=function(_0x237000,_0x4ac4d4){return db[_0x4532('0x2d')][_0x4532('0x43')]({'where':{'id':_0x237000[_0x4532('0x47')]['id']}})[_0x4532('0x26')](handleEntityNotFound(_0x4ac4d4,null))[_0x4532('0x26')](removeEntity(_0x4ac4d4,null))[_0x4532('0x41')](handleError(_0x4ac4d4,null));};exports['describe']=function(_0x2bf4fa,_0x37fa01){return db[_0x4532('0x2d')][_0x4532('0x48')]()[_0x4532('0x26')](respondWithResult(_0x37fa01,null))[_0x4532('0x41')](handleError(_0x37fa01,null));}; \ No newline at end of file +var _0xf20f=['destroy','stack','name','send','index','SmsTransferReport','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','length','include','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x5efb4d,_0x17b335){var _0xafb394=function(_0x3f146f){while(--_0x3f146f){_0x5efb4d['push'](_0x5efb4d['shift']());}};_0xafb394(++_0x17b335);}(_0xf20f,0x101));var _0xff20=function(_0x3ddcd4,_0x43719b){_0x3ddcd4=_0x3ddcd4-0x0;var _0x43d588=_0xf20f[_0x3ddcd4];return _0x43d588;};'use strict';var emlformat=require(_0xff20('0x0'));var rimraf=require(_0xff20('0x1'));var zipdir=require(_0xff20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff20('0x3'));var BPromise=require(_0xff20('0x4'));var Mustache=require(_0xff20('0x5'));var util=require(_0xff20('0x6'));var path=require(_0xff20('0x7'));var sox=require(_0xff20('0x8'));var csv=require('to-csv');var ejs=require(_0xff20('0x9'));var fs=require('fs');var fs_extra=require(_0xff20('0xa'));var _=require(_0xff20('0xb'));var squel=require(_0xff20('0xc'));var crypto=require(_0xff20('0xd'));var jsforce=require(_0xff20('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xff20('0xf'));var querystring=require('querystring');var Papa=require(_0xff20('0x10'));var Redis=require(_0xff20('0x11'));var authService=require(_0xff20('0x12'));var qs=require(_0xff20('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff20('0x14'));var logger=require(_0xff20('0x15'))(_0xff20('0x16'));var utils=require('../../config/utils');var config=require(_0xff20('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14c58d,_0x325d4a){_0x325d4a=_0x325d4a||0xcc;return function(_0x4f24eb){if(_0x4f24eb){return _0x14c58d[_0xff20('0x18')](_0x325d4a);}return _0x14c58d[_0xff20('0x19')](_0x325d4a)[_0xff20('0x1a')]();};}function respondWithResult(_0x3e588a,_0x4e18d3){_0x4e18d3=_0x4e18d3||0xc8;return function(_0x135098){if(_0x135098){return _0x3e588a[_0xff20('0x19')](_0x4e18d3)['json'](_0x135098);}};}function respondWithFilteredResult(_0x1b8ca8,_0x452ef0){return function(_0x51b5ce){if(_0x51b5ce){var _0x432e3a=typeof _0x452ef0[_0xff20('0x1b')]===_0xff20('0x1c')&&typeof _0x452ef0[_0xff20('0x1d')]==='undefined';var _0x214b78=_0x51b5ce[_0xff20('0x1e')];var _0x3ce785=_0x432e3a?0x0:_0x452ef0[_0xff20('0x1b')];var _0x142dbf=_0x432e3a?_0x51b5ce[_0xff20('0x1e')]:_0x452ef0['offset']+_0x452ef0[_0xff20('0x1d')];var _0x56f5db;if(_0x142dbf>=_0x214b78){_0x142dbf=_0x214b78;_0x56f5db=0xc8;}else{_0x56f5db=0xce;}_0x1b8ca8[_0xff20('0x19')](_0x56f5db);return _0x1b8ca8[_0xff20('0x1f')](_0xff20('0x20'),_0x3ce785+'-'+_0x142dbf+'/'+_0x214b78)[_0xff20('0x21')](_0x51b5ce);}return null;};}function patchUpdates(_0x235454){return function(_0x58db7b){try{jsonpatch[_0xff20('0x22')](_0x58db7b,_0x235454,!![]);}catch(_0x407d52){return BPromise[_0xff20('0x23')](_0x407d52);}return _0x58db7b[_0xff20('0x24')]();};}function saveUpdates(_0x4ed918,_0x7c8644){return function(_0x1dfbaa){if(_0x1dfbaa){return _0x1dfbaa[_0xff20('0x25')](_0x4ed918)[_0xff20('0x26')](function(_0x38cd48){return _0x38cd48;});}return null;};}function removeEntity(_0x52646b,_0x2db07d){return function(_0x51c641){if(_0x51c641){return _0x51c641[_0xff20('0x27')]()[_0xff20('0x26')](function(){_0x52646b[_0xff20('0x19')](0xcc)[_0xff20('0x1a')]();});}};}function handleEntityNotFound(_0x128fa3,_0x4c0bba){return function(_0x63c958){if(!_0x63c958){_0x128fa3[_0xff20('0x18')](0x194);}return _0x63c958;};}function handleError(_0x182ec7,_0x511a35){_0x511a35=_0x511a35||0x1f4;return function(_0x4090c1){logger['error'](_0x4090c1[_0xff20('0x28')]);if(_0x4090c1[_0xff20('0x29')]){delete _0x4090c1[_0xff20('0x29')];}_0x182ec7[_0xff20('0x19')](_0x511a35)[_0xff20('0x2a')](_0x4090c1);};}exports[_0xff20('0x2b')]=function(_0x3d99cf,_0x59596d){var _0x5b2823={},_0x1e7400={},_0x437d2b={'count':0x0,'rows':[]};var _0x1f1263=_['map'](db[_0xff20('0x2c')][_0xff20('0x2d')],function(_0xea8591){return{'name':_0xea8591['fieldName'],'type':_0xea8591[_0xff20('0x2e')][_0xff20('0x2f')]};});_0x1e7400[_0xff20('0x30')]=_[_0xff20('0x31')](_0x1f1263,_0xff20('0x29'));_0x1e7400[_0xff20('0x32')]=_[_0xff20('0x33')](_0x3d99cf[_0xff20('0x32')]);_0x1e7400['filters']=_[_0xff20('0x34')](_0x1e7400[_0xff20('0x30')],_0x1e7400[_0xff20('0x32')]);_0x5b2823['attributes']=_[_0xff20('0x34')](_0x1e7400[_0xff20('0x30')],qs[_0xff20('0x35')](_0x3d99cf[_0xff20('0x32')][_0xff20('0x35')]));_0x5b2823[_0xff20('0x36')]=_0x5b2823[_0xff20('0x36')]['length']?_0x5b2823[_0xff20('0x36')]:_0x1e7400[_0xff20('0x30')];if(!_0x3d99cf[_0xff20('0x32')]['hasOwnProperty'](_0xff20('0x37'))){_0x5b2823['limit']=qs[_0xff20('0x1d')](_0x3d99cf['query'][_0xff20('0x1d')]);_0x5b2823[_0xff20('0x1b')]=qs[_0xff20('0x1b')](_0x3d99cf[_0xff20('0x32')][_0xff20('0x1b')]);}_0x5b2823[_0xff20('0x38')]=qs['sort'](_0x3d99cf[_0xff20('0x32')]['sort']);_0x5b2823[_0xff20('0x39')]=qs['filters'](_[_0xff20('0x3a')](_0x3d99cf['query'],_0x1e7400[_0xff20('0x3b')]),_0x1f1263);if(_0x3d99cf[_0xff20('0x32')][_0xff20('0x3c')]){_0x5b2823['where']=_[_0xff20('0x3d')](_0x5b2823[_0xff20('0x39')],{'$or':_[_0xff20('0x31')](_0x1f1263,function(_0x58652a){if(_0x58652a[_0xff20('0x2e')]!==_0xff20('0x3e')){var _0x4c892b={};_0x4c892b[_0x58652a['name']]={'$like':'%'+_0x3d99cf[_0xff20('0x32')][_0xff20('0x3c')]+'%'};return _0x4c892b;}})});}_0x5b2823=_[_0xff20('0x3d')]({},_0x5b2823,_0x3d99cf[_0xff20('0x3f')]);var _0x14e737={'where':_0x5b2823[_0xff20('0x39')]};return db[_0xff20('0x2c')][_0xff20('0x1e')](_0x14e737)['then'](function(_0x4753ff){_0x437d2b['count']=_0x4753ff;if(_0x3d99cf['query'][_0xff20('0x40')]){_0x5b2823['include']=[{'all':!![]}];}return db[_0xff20('0x2c')][_0xff20('0x41')](_0x5b2823);})[_0xff20('0x26')](function(_0x43b4d6){_0x437d2b['rows']=_0x43b4d6;return _0x437d2b;})[_0xff20('0x26')](respondWithFilteredResult(_0x59596d,_0x5b2823))[_0xff20('0x42')](handleError(_0x59596d,null));};exports[_0xff20('0x43')]=function(_0x18fc84,_0x204f29){var _0x9a346={'raw':!![],'where':{'id':_0x18fc84['params']['id']}},_0x480cc0={};_0x480cc0[_0xff20('0x30')]=_['keys'](db[_0xff20('0x2c')][_0xff20('0x2d')]);_0x480cc0[_0xff20('0x32')]=_['keys'](_0x18fc84[_0xff20('0x32')]);_0x480cc0['filters']=_[_0xff20('0x34')](_0x480cc0[_0xff20('0x30')],_0x480cc0[_0xff20('0x32')]);_0x9a346[_0xff20('0x36')]=_[_0xff20('0x34')](_0x480cc0['model'],qs['fields'](_0x18fc84['query'][_0xff20('0x35')]));_0x9a346[_0xff20('0x36')]=_0x9a346[_0xff20('0x36')][_0xff20('0x44')]?_0x9a346[_0xff20('0x36')]:_0x480cc0[_0xff20('0x30')];if(_0x18fc84['query'][_0xff20('0x40')]){_0x9a346[_0xff20('0x45')]=[{'all':!![]}];}_0x9a346=_[_0xff20('0x3d')]({},_0x9a346,_0x18fc84[_0xff20('0x3f')]);return db['SmsTransferReport'][_0xff20('0x46')](_0x9a346)[_0xff20('0x26')](handleEntityNotFound(_0x204f29,null))[_0xff20('0x26')](respondWithResult(_0x204f29,null))[_0xff20('0x42')](handleError(_0x204f29,null));};exports[_0xff20('0x47')]=function(_0x555451,_0x271566){return db[_0xff20('0x2c')][_0xff20('0x47')](_0x555451[_0xff20('0x48')],{})[_0xff20('0x26')](respondWithResult(_0x271566,0xc9))['catch'](handleError(_0x271566,null));};exports[_0xff20('0x25')]=function(_0xbcddc,_0x29a74a){if(_0xbcddc['body']['id']){delete _0xbcddc[_0xff20('0x48')]['id'];}return db['SmsTransferReport'][_0xff20('0x46')]({'where':{'id':_0xbcddc[_0xff20('0x49')]['id']}})[_0xff20('0x26')](handleEntityNotFound(_0x29a74a,null))['then'](saveUpdates(_0xbcddc['body'],null))['then'](respondWithResult(_0x29a74a,null))[_0xff20('0x42')](handleError(_0x29a74a,null));};exports[_0xff20('0x27')]=function(_0x4b36b7,_0x717634){return db[_0xff20('0x2c')]['find']({'where':{'id':_0x4b36b7['params']['id']}})[_0xff20('0x26')](handleEntityNotFound(_0x717634,null))[_0xff20('0x26')](removeEntity(_0x717634,null))[_0xff20('0x42')](handleError(_0x717634,null));};exports['describe']=function(_0xedaf94,_0x1ae934){return db[_0xff20('0x2c')]['describe']()[_0xff20('0x26')](respondWithResult(_0x1ae934,null))[_0xff20('0x42')](handleError(_0x1ae934,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 0dbb5ce..b24db36 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 _0x0f17=['exports','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f17,0x8b));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var util=require(_0x70f1('0x1'));var logger=require(_0x70f1('0x2'))(_0x70f1('0x3'));var moment=require(_0x70f1('0x4'));var BPromise=require(_0x70f1('0x5'));var rp=require(_0x70f1('0x6'));var fs=require('fs');var path=require(_0x70f1('0x7'));var rimraf=require(_0x70f1('0x8'));var config=require(_0x70f1('0x9'));var attributes=require(_0x70f1('0xa'));module[_0x70f1('0xb')]=function(_0x16a576,_0x880fc){return _0x16a576[_0x70f1('0xc')](_0x70f1('0xd'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x70f1('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa215=['api','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xa215,0x142));var _0x5a21=function(_0x239904,_0x4b11e2){_0x239904=_0x239904-0x0;var _0x259609=_0xa215[_0x239904];return _0x259609;};'use strict';var _=require(_0x5a21('0x0'));var util=require('util');var logger=require(_0x5a21('0x1'))(_0x5a21('0x2'));var moment=require('moment');var BPromise=require(_0x5a21('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a21('0x4'));var rimraf=require(_0x5a21('0x5'));var config=require(_0x5a21('0x6'));var attributes=require(_0x5a21('0x7'));module['exports']=function(_0x47807c,_0x3e0792){return _0x47807c[_0x5a21('0x8')](_0x5a21('0x9'),attributes,{'tableName':_0x5a21('0xa'),'paranoid':![],'indexes':[{'name':_0x5a21('0xb'),'fields':[_0x5a21('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 41b05c4..899d922 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 _0x032e=['code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x13b10e,_0x12c702){var _0x2b94a8=function(_0x451393){while(--_0x451393){_0x13b10e['push'](_0x13b10e['shift']());}};_0x2b94a8(++_0x12c702);}(_0x032e,0x124));var _0xe032=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x032e[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37432f,_0x1576c8,_0x3289b0){return new BPromise(function(_0xd84027,_0xaf3907){return client[_0xe032('0xb')](_0x37432f,_0x3289b0)[_0xe032('0xc')](function(_0x2d8a14){logger[_0xe032('0xd')](_0xe032('0xe'),_0x1576c8,'request\x20sent');logger[_0xe032('0xf')](_0xe032('0x10'),_0x1576c8,_0xe032('0x11'),JSON[_0xe032('0x12')](_0x2d8a14));if(_0x2d8a14[_0xe032('0x13')]){if(_0x2d8a14[_0xe032('0x13')][_0xe032('0x14')]===0x1f4){logger['error'](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xaf3907(_0x2d8a14[_0xe032('0x13')]['message']);}logger[_0xe032('0x13')](_0xe032('0xe'),_0x1576c8,_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);return _0xd84027(_0x2d8a14[_0xe032('0x13')][_0xe032('0x15')]);}else{logger[_0xe032('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x1576c8,_0xe032('0x11'));_0xd84027(_0x2d8a14[_0xe032('0x16')][_0xe032('0x15')]);}})[_0xe032('0x17')](function(_0x1938c4){logger[_0xe032('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x1576c8,_0x1938c4);_0xaf3907(_0x1938c4);});});} \ No newline at end of file +var _0x861c=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x291cd0,_0x7f35cf){var _0x50f28a=function(_0x1e0d07){while(--_0x1e0d07){_0x291cd0['push'](_0x291cd0['shift']());}};_0x50f28a(++_0x7f35cf);}(_0x861c,0xdb));var _0xc861=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x861c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var moment=require(_0xc861('0x2'));var BPromise=require(_0xc861('0x3'));var rs=require(_0xc861('0x4'));var fs=require('fs');var Redis=require(_0xc861('0x5'));var db=require(_0xc861('0x6'))['db'];var utils=require(_0xc861('0x7'));var logger=require(_0xc861('0x8'))(_0xc861('0x9'));var config=require(_0xc861('0xa'));var jayson=require(_0xc861('0xb'));var client=jayson['client'][_0xc861('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xad001d,_0x1990b6,_0x36cb1f){return new BPromise(function(_0xb32e33,_0x293406){return client[_0xc861('0xd')](_0xad001d,_0x36cb1f)[_0xc861('0xe')](function(_0x241c77){logger[_0xc861('0xf')](_0xc861('0x10'),_0x1990b6,_0xc861('0x11'));logger[_0xc861('0x12')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x1990b6,_0xc861('0x11'),JSON[_0xc861('0x13')](_0x241c77));if(_0x241c77[_0xc861('0x14')]){if(_0x241c77[_0xc861('0x14')]['code']===0x1f4){logger[_0xc861('0x14')](_0xc861('0x10'),_0x1990b6,_0x241c77[_0xc861('0x14')][_0xc861('0x15')]);return _0x293406(_0x241c77['error']['message']);}logger[_0xc861('0x14')](_0xc861('0x10'),_0x1990b6,_0x241c77['error'][_0xc861('0x15')]);return _0xb32e33(_0x241c77[_0xc861('0x14')]['message']);}else{logger[_0xc861('0xf')](_0xc861('0x10'),_0x1990b6,_0xc861('0x11'));_0xb32e33(_0x241c77[_0xc861('0x16')][_0xc861('0x15')]);}})[_0xc861('0x17')](function(_0x5d6040){logger['error'](_0xc861('0x10'),_0x1990b6,_0x5d6040);_0x293406(_0x5d6040);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 108430d..1663375 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 _0x70d1=['./sound.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','create','put','update','delete','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0x70d1,0x107));var _0x170d=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x70d1[_0x2cc0b3];return _0x1667ef;};'use strict';var multer=require(_0x170d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x170d('0x1'));var express=require(_0x170d('0x2'));var router=express[_0x170d('0x3')]();var fs_extra=require(_0x170d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x170d('0x5'));var config=require(_0x170d('0x6'));var controller=require(_0x170d('0x7'));router['get']('/',auth[_0x170d('0x8')](),controller[_0x170d('0x9')]);router[_0x170d('0xa')](_0x170d('0xb'),auth[_0x170d('0x8')](),controller[_0x170d('0xc')]);router[_0x170d('0xa')]('/:id/download',auth[_0x170d('0x8')](),controller[_0x170d('0xd')]);var upload=multer({'storage':multer[_0x170d('0xe')]({'destination':function(_0x182565,_0x358981,_0x365cda){_0x365cda(null,path[_0x170d('0xf')](config[_0x170d('0x10')],'server/files/sounds/original/'));},'filename':function(_0x52d1de,_0x46ffb8,_0x571190){_0x46ffb8['originalname']=_0x46ffb8[_0x170d('0x11')][_0x170d('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x571190(null,util[_0x170d('0x13')](_0x170d('0x14'),path[_0x170d('0x15')](_0x46ffb8['originalname'],path[_0x170d('0x16')](_0x46ffb8[_0x170d('0x11')])),Date[_0x170d('0x17')](),path[_0x170d('0x16')](_0x46ffb8[_0x170d('0x11')])));}})});router[_0x170d('0x18')]('/',upload[_0x170d('0x19')]('file'),controller[_0x170d('0x1a')]);router[_0x170d('0x1b')](_0x170d('0xb'),auth[_0x170d('0x8')](),controller[_0x170d('0x1c')]);router['delete'](_0x170d('0xb'),auth[_0x170d('0x8')](),controller[_0x170d('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x1f90=['extname','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename'];(function(_0x21e1ba,_0x4006b7){var _0x5d019b=function(_0x1282ee){while(--_0x1282ee){_0x21e1ba['push'](_0x21e1ba['shift']());}};_0x5d019b(++_0x4006b7);}(_0x1f90,0x1e3));var _0x01f9=function(_0x1003da,_0x4865e1){_0x1003da=_0x1003da-0x0;var _0x1bd15f=_0x1f90[_0x1003da];return _0x1bd15f;};'use strict';var multer=require(_0x01f9('0x0'));var util=require(_0x01f9('0x1'));var path=require(_0x01f9('0x2'));var timeout=require(_0x01f9('0x3'));var express=require(_0x01f9('0x4'));var router=express['Router']();var fs_extra=require(_0x01f9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x01f9('0x6'));var config=require(_0x01f9('0x7'));var controller=require(_0x01f9('0x8'));router[_0x01f9('0x9')]('/',auth[_0x01f9('0xa')](),controller[_0x01f9('0xb')]);router[_0x01f9('0x9')](_0x01f9('0xc'),auth[_0x01f9('0xa')](),controller['show']);router[_0x01f9('0x9')]('/:id/download',auth[_0x01f9('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x01f9('0xd')]({'destination':function(_0x374e71,_0x43412a,_0x3d29c7){_0x3d29c7(null,path[_0x01f9('0xe')](config[_0x01f9('0xf')],_0x01f9('0x10')));},'filename':function(_0x13fe3b,_0x55e6a1,_0x1935cd){_0x55e6a1[_0x01f9('0x11')]=_0x55e6a1[_0x01f9('0x11')][_0x01f9('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1935cd(null,util[_0x01f9('0x13')]('%s-%s%s',path[_0x01f9('0x14')](_0x55e6a1[_0x01f9('0x11')],path[_0x01f9('0x15')](_0x55e6a1['originalname'])),Date['now'](),path[_0x01f9('0x15')](_0x55e6a1[_0x01f9('0x11')])));}})});router['post']('/',upload['single'](_0x01f9('0x16')),controller[_0x01f9('0x17')]);router[_0x01f9('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x01f9('0x19')]);router['delete']('/:id',auth[_0x01f9('0xa')](),controller[_0x01f9('0x1a')]);module[_0x01f9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 457e9f5..3bdefd7 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 _0xf54c=['INTEGER','sequelize','exports','STRING','name','FLOAT','BIGINT'];(function(_0x4ebd67,_0x103d20){var _0x5094ac=function(_0x2cb213){while(--_0x2cb213){_0x4ebd67['push'](_0x4ebd67['shift']());}};_0x5094ac(++_0x103d20);}(_0xf54c,0x182));var _0xcf54=function(_0x58d190,_0x26b4ec){_0x58d190=_0x58d190-0x0;var _0x3cb6f3=_0xf54c[_0x58d190];return _0x3cb6f3;};'use strict';var Sequelize=require(_0xcf54('0x0'));module[_0xcf54('0x1')]={'name':{'type':Sequelize[_0xcf54('0x2')],'unique':_0xcf54('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xcf54('0x2')]},'display_name':{'type':Sequelize[_0xcf54('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xcf54('0x2')]},'original_format':{'type':Sequelize[_0xcf54('0x2')]},'original_duration':{'type':Sequelize[_0xcf54('0x4')]},'original_sampleCount':{'type':Sequelize[_0xcf54('0x5')]},'original_channelCount':{'type':Sequelize[_0xcf54('0x6')]},'original_bitRate':{'type':Sequelize[_0xcf54('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xcf54('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xcf54('0x6')]},'converted_bitRate':{'type':Sequelize[_0xcf54('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xcf54('0x6')]}}; \ No newline at end of file +var _0x71c6=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x58f445,_0xa6140b){var _0x29b46c=function(_0x169e60){while(--_0x169e60){_0x58f445['push'](_0x58f445['shift']());}};_0x29b46c(++_0xa6140b);}(_0x71c6,0x1c5));var _0x671c=function(_0x5a40b1,_0x1b0589){_0x5a40b1=_0x5a40b1-0x0;var _0x42c19f=_0x71c6[_0x5a40b1];return _0x42c19f;};'use strict';var Sequelize=require(_0x671c('0x0'));module[_0x671c('0x1')]={'name':{'type':Sequelize[_0x671c('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x671c('0x2')]},'display_name':{'type':Sequelize[_0x671c('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x671c('0x2')]},'original_format':{'type':Sequelize[_0x671c('0x2')]},'original_duration':{'type':Sequelize[_0x671c('0x3')]},'original_sampleCount':{'type':Sequelize[_0x671c('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x671c('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x671c('0x2')]},'converted_duration':{'type':Sequelize[_0x671c('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x671c('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x671c('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x671c('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 9bf11d6..e9e8fd1 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 _0xb757=['file','extname','basename','filename','originalname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','send','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','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','limit','count','offset','set','apply','save','update','then','destroy','get','Sounds','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','Sound','includeAll','findAll','rows','catch','params','include','merge','find','save_name','existsSync','join','root','Sequelize','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','converted_format','create'];(function(_0x145afa,_0x5adafa){var _0x518fb8=function(_0x4eef9a){while(--_0x4eef9a){_0x145afa['push'](_0x145afa['shift']());}};_0x518fb8(++_0x5adafa);}(_0xb757,0x1b1));var _0x7b75=function(_0x58e8d1,_0x318c76){_0x58e8d1=_0x58e8d1-0x0;var _0x1f4c78=_0xb757[_0x58e8d1];return _0x1f4c78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b75('0x0'));var zipdir=require(_0x7b75('0x1'));var jsonpatch=require(_0x7b75('0x2'));var rp=require(_0x7b75('0x3'));var moment=require(_0x7b75('0x4'));var BPromise=require(_0x7b75('0x5'));var Mustache=require(_0x7b75('0x6'));var util=require(_0x7b75('0x7'));var path=require(_0x7b75('0x8'));var sox=require(_0x7b75('0x9'));var csv=require('to-csv');var ejs=require(_0x7b75('0xa'));var fs=require('fs');var fs_extra=require(_0x7b75('0xb'));var _=require(_0x7b75('0xc'));var squel=require('squel');var crypto=require(_0x7b75('0xd'));var jsforce=require(_0x7b75('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7b75('0xf'));var Papa=require('papaparse');var Redis=require(_0x7b75('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7b75('0x11'));var as=require(_0x7b75('0x12'));var hardwareService=require(_0x7b75('0x13'));var logger=require(_0x7b75('0x14'))(_0x7b75('0x15'));var utils=require(_0x7b75('0x16'));var config=require(_0x7b75('0x17'));var licenseUtil=require(_0x7b75('0x18'));var db=require(_0x7b75('0x19'))['db'];function respondWithStatusCode(_0x52196f,_0x24aa63){_0x24aa63=_0x24aa63||0xcc;return function(_0x53034d){if(_0x53034d){return _0x52196f[_0x7b75('0x1a')](_0x24aa63);}return _0x52196f[_0x7b75('0x1b')](_0x24aa63)[_0x7b75('0x1c')]();};}function respondWithResult(_0x303d7c,_0x5de39a){_0x5de39a=_0x5de39a||0xc8;return function(_0x273043){if(_0x273043){return _0x303d7c[_0x7b75('0x1b')](_0x5de39a)[_0x7b75('0x1d')](_0x273043);}};}function respondWithFilteredResult(_0x409579,_0x36a68d){return function(_0x403725){if(_0x403725){var _0x5182c0=typeof _0x36a68d['offset']===_0x7b75('0x1e')&&typeof _0x36a68d[_0x7b75('0x1f')]===_0x7b75('0x1e');var _0x51e2b6=_0x403725[_0x7b75('0x20')];var _0x59ccd0=_0x5182c0?0x0:_0x36a68d['offset'];var _0x1966c2=_0x5182c0?_0x403725[_0x7b75('0x20')]:_0x36a68d[_0x7b75('0x21')]+_0x36a68d[_0x7b75('0x1f')];var _0x30e796;if(_0x1966c2>=_0x51e2b6){_0x1966c2=_0x51e2b6;_0x30e796=0xc8;}else{_0x30e796=0xce;}_0x409579[_0x7b75('0x1b')](_0x30e796);return _0x409579[_0x7b75('0x22')]('Content-Range',_0x59ccd0+'-'+_0x1966c2+'/'+_0x51e2b6)[_0x7b75('0x1d')](_0x403725);}return null;};}function patchUpdates(_0x12bf40){return function(_0x432045){try{jsonpatch[_0x7b75('0x23')](_0x432045,_0x12bf40,!![]);}catch(_0x2899ca){return BPromise['reject'](_0x2899ca);}return _0x432045[_0x7b75('0x24')]();};}function saveUpdates(_0x8edf31,_0x3021de){return function(_0x1026f4){if(_0x1026f4){return _0x1026f4[_0x7b75('0x25')](_0x8edf31)[_0x7b75('0x26')](function(_0x576839){return _0x576839;});}return null;};}function removeEntity(_0x1eda4f,_0x230859){return function(_0x4b7efa){if(_0x4b7efa){return _0x4b7efa[_0x7b75('0x27')]()[_0x7b75('0x26')](function(){var _0x540fc6=_0x4b7efa[_0x7b75('0x28')]({'plain':!![]});var _0x2d44a2=_0x7b75('0x29');return db['UserProfileResource'][_0x7b75('0x27')]({'where':{'type':_0x2d44a2,'resourceId':_0x540fc6['id']}})[_0x7b75('0x26')](function(){return _0x4b7efa;});})[_0x7b75('0x26')](function(){_0x1eda4f[_0x7b75('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25908d,_0x1e5e26){return function(_0x435e7d){if(!_0x435e7d){_0x25908d[_0x7b75('0x1a')](0x194);}return _0x435e7d;};}function handleError(_0x67ee75,_0x23eef8){_0x23eef8=_0x23eef8||0x1f4;return function(_0x5c948d){logger[_0x7b75('0x2a')](_0x5c948d[_0x7b75('0x2b')]);if(_0x5c948d[_0x7b75('0x2c')]){delete _0x5c948d[_0x7b75('0x2c')];}_0x67ee75[_0x7b75('0x1b')](_0x23eef8)['send'](_0x5c948d);};}exports['index']=function(_0x4dfb67,_0x1cf06b){var _0x405ac3={},_0x14b8eb={},_0x185acb={'count':0x0,'rows':[]};var _0x2c38af=_[_0x7b75('0x2d')](db['Sound'][_0x7b75('0x2e')],function(_0x402905){return{'name':_0x402905[_0x7b75('0x2f')],'type':_0x402905[_0x7b75('0x30')][_0x7b75('0x31')]};});_0x14b8eb['model']=_['map'](_0x2c38af,_0x7b75('0x2c'));_0x14b8eb[_0x7b75('0x32')]=_[_0x7b75('0x33')](_0x4dfb67[_0x7b75('0x32')]);_0x14b8eb[_0x7b75('0x34')]=_['intersection'](_0x14b8eb[_0x7b75('0x35')],_0x14b8eb[_0x7b75('0x32')]);_0x405ac3[_0x7b75('0x36')]=_[_0x7b75('0x37')](_0x14b8eb[_0x7b75('0x35')],qs['fields'](_0x4dfb67[_0x7b75('0x32')][_0x7b75('0x38')]));_0x405ac3['attributes']=_0x405ac3['attributes'][_0x7b75('0x39')]?_0x405ac3['attributes']:_0x14b8eb[_0x7b75('0x35')];if(!_0x4dfb67[_0x7b75('0x32')][_0x7b75('0x3a')](_0x7b75('0x3b'))){_0x405ac3[_0x7b75('0x1f')]=qs[_0x7b75('0x1f')](_0x4dfb67[_0x7b75('0x32')][_0x7b75('0x1f')]);_0x405ac3[_0x7b75('0x21')]=qs[_0x7b75('0x21')](_0x4dfb67[_0x7b75('0x32')][_0x7b75('0x21')]);}_0x405ac3[_0x7b75('0x3c')]=qs[_0x7b75('0x3d')](_0x4dfb67[_0x7b75('0x32')][_0x7b75('0x3d')]);_0x405ac3['where']=qs[_0x7b75('0x34')](_[_0x7b75('0x3e')](_0x4dfb67[_0x7b75('0x32')],_0x14b8eb['filters']),_0x2c38af);if(_0x4dfb67[_0x7b75('0x32')][_0x7b75('0x3f')]){_0x405ac3[_0x7b75('0x40')]=_['merge'](_0x405ac3[_0x7b75('0x40')],{'$or':_[_0x7b75('0x2d')](_0x2c38af,function(_0x1e1774){if(_0x1e1774[_0x7b75('0x30')]!==_0x7b75('0x41')){var _0xcbd511={};_0xcbd511[_0x1e1774[_0x7b75('0x2c')]]={'$like':'%'+_0x4dfb67[_0x7b75('0x32')][_0x7b75('0x3f')]+'%'};return _0xcbd511;}})});}_0x405ac3=_['merge']({},_0x405ac3,_0x4dfb67[_0x7b75('0x42')]);var _0x1d4451={'where':_0x405ac3['where']};return db[_0x7b75('0x43')]['count'](_0x1d4451)[_0x7b75('0x26')](function(_0x2a4aa1){_0x185acb['count']=_0x2a4aa1;if(_0x4dfb67[_0x7b75('0x32')][_0x7b75('0x44')]){_0x405ac3['include']=[{'all':!![]}];}return db[_0x7b75('0x43')][_0x7b75('0x45')](_0x405ac3);})[_0x7b75('0x26')](function(_0x2720cc){_0x185acb[_0x7b75('0x46')]=_0x2720cc;return _0x185acb;})[_0x7b75('0x26')](respondWithFilteredResult(_0x1cf06b,_0x405ac3))[_0x7b75('0x47')](handleError(_0x1cf06b,null));};exports['show']=function(_0x338ce8,_0x9099f5){var _0x5adf5a={'raw':!![],'where':{'id':_0x338ce8[_0x7b75('0x48')]['id']}},_0x483cf7={};_0x483cf7[_0x7b75('0x35')]=_[_0x7b75('0x33')](db['Sound']['rawAttributes']);_0x483cf7[_0x7b75('0x32')]=_['keys'](_0x338ce8[_0x7b75('0x32')]);_0x483cf7[_0x7b75('0x34')]=_[_0x7b75('0x37')](_0x483cf7[_0x7b75('0x35')],_0x483cf7[_0x7b75('0x32')]);_0x5adf5a[_0x7b75('0x36')]=_['intersection'](_0x483cf7[_0x7b75('0x35')],qs[_0x7b75('0x38')](_0x338ce8[_0x7b75('0x32')][_0x7b75('0x38')]));_0x5adf5a['attributes']=_0x5adf5a['attributes'][_0x7b75('0x39')]?_0x5adf5a['attributes']:_0x483cf7[_0x7b75('0x35')];if(_0x338ce8[_0x7b75('0x32')][_0x7b75('0x44')]){_0x5adf5a[_0x7b75('0x49')]=[{'all':!![]}];}_0x5adf5a=_[_0x7b75('0x4a')]({},_0x5adf5a,_0x338ce8[_0x7b75('0x42')]);return db[_0x7b75('0x43')]['find'](_0x5adf5a)[_0x7b75('0x26')](handleEntityNotFound(_0x9099f5,null))[_0x7b75('0x26')](respondWithResult(_0x9099f5,null))[_0x7b75('0x47')](handleError(_0x9099f5,null));};exports['download']=function(_0x1999cb,_0x25573f,_0x4aeef2){return db[_0x7b75('0x43')][_0x7b75('0x4b')]({'where':{'id':_0x1999cb[_0x7b75('0x48')]['id']},'attributes':['name',_0x7b75('0x4c'),'converted_format'],'raw':!![]})[_0x7b75('0x26')](handleEntityNotFound(_0x25573f,null))[_0x7b75('0x26')](function(_0x2a7e8b){if(_0x2a7e8b){if(!fs[_0x7b75('0x4d')](path[_0x7b75('0x4e')](config[_0x7b75('0x4f')],'server/files/sounds/converted',_0x2a7e8b[_0x7b75('0x4c')]+'.'+_0x2a7e8b['converted_format']))){throw new db[(_0x7b75('0x50'))]['ValidationError'](_0x7b75('0x51'));}return _0x25573f['download'](path[_0x7b75('0x4e')](config['root'],_0x7b75('0x52'),util[_0x7b75('0x53')](_0x7b75('0x54'),_0x2a7e8b['save_name'],_0x2a7e8b[_0x7b75('0x55')])),util[_0x7b75('0x53')](_0x7b75('0x54'),_0x2a7e8b['name'],_0x2a7e8b[_0x7b75('0x55')]));}return null;})[_0x7b75('0x47')](handleError(_0x25573f,null));};exports[_0x7b75('0x56')]=function(_0x172e1b,_0x3c1aa1,_0x6867e5){var _0x1774b1={'name':path['basename'](_0x172e1b[_0x7b75('0x57')]['originalname'],path[_0x7b75('0x58')](_0x172e1b[_0x7b75('0x57')]['originalname'])),'save_name':path[_0x7b75('0x59')](_0x172e1b[_0x7b75('0x57')][_0x7b75('0x5a')],path[_0x7b75('0x58')](_0x172e1b[_0x7b75('0x57')][_0x7b75('0x5a')])),'original_format':path[_0x7b75('0x58')](_0x172e1b[_0x7b75('0x57')][_0x7b75('0x5b')])[_0x7b75('0x5c')](0x1),'converted_format':_0x7b75('0x5d')};var _0xdbda33=path[_0x7b75('0x4e')](config[_0x7b75('0x4f')],_0x7b75('0x5e'),_0x172e1b[_0x7b75('0x57')]['filename']);var _0x2408ad=path[_0x7b75('0x4e')](config['root'],_0x7b75('0x52'),util['format']('%s.%s',path[_0x7b75('0x59')](_0x172e1b[_0x7b75('0x57')][_0x7b75('0x5a')],path[_0x7b75('0x58')](_0x172e1b[_0x7b75('0x57')][_0x7b75('0x5a')])),_0x1774b1['converted_format']));logger[_0x7b75('0x5f')](_0x7b75('0x60'),_0xdbda33);logger[_0x7b75('0x5f')](_0x7b75('0x61'),_0x2408ad);try{fs[_0x7b75('0x62')](_0xdbda33,parseInt('0777',0x8));var _0x20b7e4=sox[_0x7b75('0x63')](_0xdbda33,_0x2408ad,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x20b7e4['on'](_0x7b75('0x2a'),function(_0x4704e6){fs['unlinkSync'](_0xdbda33);_0x3c1aa1[_0x7b75('0x1b')](0x1f4)[_0x7b75('0x64')](_0x4704e6);});_0x20b7e4['on'](_0x7b75('0x65'),function(_0x151d21){_0x1774b1[_0x7b75('0x66')]=isNaN(_0x151d21[_0x7b75('0x67')])?null:_0x151d21['duration']*0x3e8;_0x1774b1[_0x7b75('0x68')]=isNaN(_0x151d21[_0x7b75('0x69')])?null:_0x151d21['sampleCount'];_0x1774b1['original_channelCount']=isNaN(_0x151d21[_0x7b75('0x6a')])?null:_0x151d21[_0x7b75('0x6a')];_0x1774b1[_0x7b75('0x6b')]=isNaN(_0x151d21[_0x7b75('0x6c')])?null:_0x151d21[_0x7b75('0x6c')];_0x1774b1[_0x7b75('0x6d')]=isNaN(_0x151d21['sampleRate'])?null:_0x151d21[_0x7b75('0x6e')];});_0x20b7e4['on'](_0x7b75('0x6f'),function(_0x8ff51e){_0x1774b1[_0x7b75('0x70')]=isNaN(_0x8ff51e[_0x7b75('0x67')])?null:_0x8ff51e[_0x7b75('0x67')]*0x3e8;_0x1774b1[_0x7b75('0x71')]=isNaN(_0x8ff51e[_0x7b75('0x69')])?null:_0x8ff51e[_0x7b75('0x69')];_0x1774b1[_0x7b75('0x72')]=isNaN(_0x8ff51e[_0x7b75('0x6a')])?null:_0x8ff51e[_0x7b75('0x6a')];_0x1774b1[_0x7b75('0x73')]=isNaN(_0x8ff51e[_0x7b75('0x6c')])?null:_0x8ff51e[_0x7b75('0x6c')];_0x1774b1[_0x7b75('0x74')]=isNaN(_0x8ff51e[_0x7b75('0x6e')])?null:_0x8ff51e[_0x7b75('0x6e')];});_0x20b7e4['on'](_0x7b75('0x1c'),function(){fs[_0x7b75('0x62')](_0x2408ad,parseInt(_0x7b75('0x75'),0x8));return db[_0x7b75('0x43')]['create'](_0x1774b1)['then'](function(_0x35b926){var _0x7a8907={'role':_0x172e1b[_0x7b75('0x76')]['role'],'userProfileId':_0x172e1b[_0x7b75('0x76')][_0x7b75('0x77')]};if(!_0x7a8907)throw new Error(_0x7b75('0x78'));if(_0x7a8907[_0x7b75('0x79')]===_0x7b75('0x7a')){var _0x34f83b=_0x35b926[_0x7b75('0x28')]({'plain':!![]});return db[_0x7b75('0x7b')][_0x7b75('0x4b')]({'where':{'name':_0x7b75('0x29'),'userProfileId':_0x7a8907[_0x7b75('0x77')]},'raw':!![]})[_0x7b75('0x26')](function(_0x204427){if(_0x204427&&_0x204427[_0x7b75('0x7c')]===0x0){return db[_0x7b75('0x7d')][_0x7b75('0x56')]({'name':_0x34f83b[_0x7b75('0x2c')],'resourceId':_0x34f83b['id'],'type':_0x204427[_0x7b75('0x2c')],'sectionId':_0x204427['id']},{})['then'](function(){return _0x35b926;});}else{return _0x35b926;}})[_0x7b75('0x47')](function(_0x56cc40){logger['error'](_0x7b75('0x7e'),_0x56cc40);throw _0x56cc40;});}return _0x35b926;})[_0x7b75('0x26')](respondWithResult(_0x3c1aa1,null))[_0x7b75('0x47')](handleError(_0x3c1aa1,null));});_0x20b7e4[_0x7b75('0x7f')]();}catch(_0x4646c7){_0x3c1aa1['status'](0x1f4)[_0x7b75('0x64')](_0x4646c7);}};exports[_0x7b75('0x25')]=function(_0x582569,_0x5120ed,_0x1ecc8e){return db[_0x7b75('0x43')][_0x7b75('0x4b')]({'where':{'id':_0x582569['params']['id']}})[_0x7b75('0x26')](handleEntityNotFound(_0x5120ed,null))['then'](saveUpdates(_[_0x7b75('0x3e')](_0x582569[_0x7b75('0x76')],[_0x7b75('0x2c'),_0x7b75('0x80')]),null))['then'](respondWithResult(_0x5120ed,null))[_0x7b75('0x47')](handleError(_0x5120ed,null));};exports[_0x7b75('0x81')]=function(_0x3d904f,_0x5c3727,_0x16cc08){return db[_0x7b75('0x43')]['find']({'where':{'id':_0x3d904f[_0x7b75('0x48')]['id']}})[_0x7b75('0x26')](function(_0x4a7800){if(_0x4a7800){return _0x4a7800['destroy']();}})[_0x7b75('0x26')](function(_0x1b1b04){var _0x514319=path[_0x7b75('0x4e')](config['root'],_0x7b75('0x5e'),util[_0x7b75('0x53')](_0x7b75('0x54'),_0x1b1b04[_0x7b75('0x4c')],_0x1b1b04['original_format']));var _0xaf5ea2=path[_0x7b75('0x4e')](config[_0x7b75('0x4f')],_0x7b75('0x52'),util[_0x7b75('0x53')](_0x7b75('0x54'),_0x1b1b04[_0x7b75('0x4c')],_0x1b1b04[_0x7b75('0x55')]));fs['unlinkSync'](_0x514319);fs['unlinkSync'](_0xaf5ea2);return _0x1b1b04;})['then'](function(_0x4a6495){if(_0x4a6495){return _0x5c3727[_0x7b75('0x1b')](0xcc)[_0x7b75('0x1c')]();}})[_0x7b75('0x26')](handleEntityNotFound(_0x5c3727,null))[_0x7b75('0x47')](handleError(_0x5c3727,null));}; \ No newline at end of file +var _0xaf59=['name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','Sound','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','basename','file','originalname','filename','extname','wav','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','converted_duration','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','get','Sounds','UserProfileResource','error','stack'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0xaf59,0x1bc));var _0x9af5=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0xaf59[_0x3e0dc4];return _0x586111;};'use strict';var emlformat=require(_0x9af5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9af5('0x1'));var jsonpatch=require(_0x9af5('0x2'));var rp=require(_0x9af5('0x3'));var moment=require(_0x9af5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9af5('0x5'));var util=require(_0x9af5('0x6'));var path=require(_0x9af5('0x7'));var sox=require(_0x9af5('0x8'));var csv=require(_0x9af5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9af5('0xa'));var _=require(_0x9af5('0xb'));var squel=require(_0x9af5('0xc'));var crypto=require(_0x9af5('0xd'));var jsforce=require(_0x9af5('0xe'));var deskjs=require(_0x9af5('0xf'));var toCsv=require(_0x9af5('0x9'));var querystring=require('querystring');var Papa=require(_0x9af5('0x10'));var Redis=require(_0x9af5('0x11'));var authService=require(_0x9af5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9af5('0x13'));var hardwareService=require(_0x9af5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9af5('0x15'));var config=require(_0x9af5('0x16'));var licenseUtil=require(_0x9af5('0x17'));var db=require(_0x9af5('0x18'))['db'];function respondWithStatusCode(_0x2786c9,_0x306b93){_0x306b93=_0x306b93||0xcc;return function(_0x123d75){if(_0x123d75){return _0x2786c9[_0x9af5('0x19')](_0x306b93);}return _0x2786c9[_0x9af5('0x1a')](_0x306b93)[_0x9af5('0x1b')]();};}function respondWithResult(_0x4dc0eb,_0x28fe79){_0x28fe79=_0x28fe79||0xc8;return function(_0x22ac78){if(_0x22ac78){return _0x4dc0eb['status'](_0x28fe79)[_0x9af5('0x1c')](_0x22ac78);}};}function respondWithFilteredResult(_0x4f011b,_0x53aaba){return function(_0x11fd24){if(_0x11fd24){var _0x5af696=typeof _0x53aaba[_0x9af5('0x1d')]===_0x9af5('0x1e')&&typeof _0x53aaba['limit']==='undefined';var _0x31029b=_0x11fd24[_0x9af5('0x1f')];var _0x2f0f64=_0x5af696?0x0:_0x53aaba[_0x9af5('0x1d')];var _0x32aa3c=_0x5af696?_0x11fd24['count']:_0x53aaba['offset']+_0x53aaba[_0x9af5('0x20')];var _0x6d2eca;if(_0x32aa3c>=_0x31029b){_0x32aa3c=_0x31029b;_0x6d2eca=0xc8;}else{_0x6d2eca=0xce;}_0x4f011b[_0x9af5('0x1a')](_0x6d2eca);return _0x4f011b['set'](_0x9af5('0x21'),_0x2f0f64+'-'+_0x32aa3c+'/'+_0x31029b)[_0x9af5('0x1c')](_0x11fd24);}return null;};}function patchUpdates(_0x66bf50){return function(_0xb2cf9b){try{jsonpatch[_0x9af5('0x22')](_0xb2cf9b,_0x66bf50,!![]);}catch(_0x4e8046){return BPromise['reject'](_0x4e8046);}return _0xb2cf9b[_0x9af5('0x23')]();};}function saveUpdates(_0x269fba,_0x572b48){return function(_0x36f3ac){if(_0x36f3ac){return _0x36f3ac[_0x9af5('0x24')](_0x269fba)['then'](function(_0x5af291){return _0x5af291;});}return null;};}function removeEntity(_0x1a9415,_0x1c910e){return function(_0x455412){if(_0x455412){return _0x455412[_0x9af5('0x25')]()[_0x9af5('0x26')](function(){var _0x4168ef=_0x455412[_0x9af5('0x27')]({'plain':!![]});var _0x1467a6=_0x9af5('0x28');return db[_0x9af5('0x29')][_0x9af5('0x25')]({'where':{'type':_0x1467a6,'resourceId':_0x4168ef['id']}})['then'](function(){return _0x455412;});})['then'](function(){_0x1a9415[_0x9af5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5564c1,_0x2a1831){return function(_0x52716d){if(!_0x52716d){_0x5564c1[_0x9af5('0x19')](0x194);}return _0x52716d;};}function handleError(_0xe26e34,_0x4e472c){_0x4e472c=_0x4e472c||0x1f4;return function(_0x532b1){logger[_0x9af5('0x2a')](_0x532b1[_0x9af5('0x2b')]);if(_0x532b1['name']){delete _0x532b1[_0x9af5('0x2c')];}_0xe26e34['status'](_0x4e472c)[_0x9af5('0x2d')](_0x532b1);};}exports['index']=function(_0x390de2,_0x2b1439){var _0x38e523={},_0x15c25c={},_0x137df5={'count':0x0,'rows':[]};var _0x5b245a=_['map'](db['Sound'][_0x9af5('0x2e')],function(_0xcf30cd){return{'name':_0xcf30cd[_0x9af5('0x2f')],'type':_0xcf30cd[_0x9af5('0x30')][_0x9af5('0x31')]};});_0x15c25c[_0x9af5('0x32')]=_[_0x9af5('0x33')](_0x5b245a,_0x9af5('0x2c'));_0x15c25c[_0x9af5('0x34')]=_[_0x9af5('0x35')](_0x390de2[_0x9af5('0x34')]);_0x15c25c[_0x9af5('0x36')]=_[_0x9af5('0x37')](_0x15c25c[_0x9af5('0x32')],_0x15c25c[_0x9af5('0x34')]);_0x38e523[_0x9af5('0x38')]=_['intersection'](_0x15c25c[_0x9af5('0x32')],qs['fields'](_0x390de2[_0x9af5('0x34')][_0x9af5('0x39')]));_0x38e523[_0x9af5('0x38')]=_0x38e523[_0x9af5('0x38')][_0x9af5('0x3a')]?_0x38e523[_0x9af5('0x38')]:_0x15c25c[_0x9af5('0x32')];if(!_0x390de2[_0x9af5('0x34')][_0x9af5('0x3b')](_0x9af5('0x3c'))){_0x38e523[_0x9af5('0x20')]=qs[_0x9af5('0x20')](_0x390de2['query']['limit']);_0x38e523[_0x9af5('0x1d')]=qs[_0x9af5('0x1d')](_0x390de2[_0x9af5('0x34')][_0x9af5('0x1d')]);}_0x38e523[_0x9af5('0x3d')]=qs[_0x9af5('0x3e')](_0x390de2[_0x9af5('0x34')][_0x9af5('0x3e')]);_0x38e523[_0x9af5('0x3f')]=qs['filters'](_[_0x9af5('0x40')](_0x390de2[_0x9af5('0x34')],_0x15c25c[_0x9af5('0x36')]),_0x5b245a);if(_0x390de2[_0x9af5('0x34')][_0x9af5('0x41')]){_0x38e523[_0x9af5('0x3f')]=_[_0x9af5('0x42')](_0x38e523[_0x9af5('0x3f')],{'$or':_[_0x9af5('0x33')](_0x5b245a,function(_0x6ffbfb){if(_0x6ffbfb[_0x9af5('0x30')]!==_0x9af5('0x43')){var _0x31dda3={};_0x31dda3[_0x6ffbfb['name']]={'$like':'%'+_0x390de2[_0x9af5('0x34')][_0x9af5('0x41')]+'%'};return _0x31dda3;}})});}_0x38e523=_['merge']({},_0x38e523,_0x390de2[_0x9af5('0x44')]);var _0x217e99={'where':_0x38e523['where']};return db['Sound'][_0x9af5('0x1f')](_0x217e99)[_0x9af5('0x26')](function(_0x4d1894){_0x137df5[_0x9af5('0x1f')]=_0x4d1894;if(_0x390de2[_0x9af5('0x34')][_0x9af5('0x45')]){_0x38e523[_0x9af5('0x46')]=[{'all':!![]}];}return db['Sound'][_0x9af5('0x47')](_0x38e523);})[_0x9af5('0x26')](function(_0x4fd4de){_0x137df5['rows']=_0x4fd4de;return _0x137df5;})[_0x9af5('0x26')](respondWithFilteredResult(_0x2b1439,_0x38e523))[_0x9af5('0x48')](handleError(_0x2b1439,null));};exports['show']=function(_0xf0193e,_0x1a42d0){var _0x5dbae1={'raw':!![],'where':{'id':_0xf0193e[_0x9af5('0x49')]['id']}},_0x5bda8a={};_0x5bda8a[_0x9af5('0x32')]=_[_0x9af5('0x35')](db[_0x9af5('0x4a')][_0x9af5('0x2e')]);_0x5bda8a[_0x9af5('0x34')]=_[_0x9af5('0x35')](_0xf0193e[_0x9af5('0x34')]);_0x5bda8a['filters']=_[_0x9af5('0x37')](_0x5bda8a[_0x9af5('0x32')],_0x5bda8a[_0x9af5('0x34')]);_0x5dbae1['attributes']=_[_0x9af5('0x37')](_0x5bda8a['model'],qs[_0x9af5('0x39')](_0xf0193e[_0x9af5('0x34')][_0x9af5('0x39')]));_0x5dbae1[_0x9af5('0x38')]=_0x5dbae1[_0x9af5('0x38')][_0x9af5('0x3a')]?_0x5dbae1[_0x9af5('0x38')]:_0x5bda8a['model'];if(_0xf0193e[_0x9af5('0x34')]['includeAll']){_0x5dbae1['include']=[{'all':!![]}];}_0x5dbae1=_[_0x9af5('0x42')]({},_0x5dbae1,_0xf0193e['options']);return db[_0x9af5('0x4a')]['find'](_0x5dbae1)[_0x9af5('0x26')](handleEntityNotFound(_0x1a42d0,null))[_0x9af5('0x26')](respondWithResult(_0x1a42d0,null))[_0x9af5('0x48')](handleError(_0x1a42d0,null));};exports[_0x9af5('0x4b')]=function(_0x833696,_0x138d9d,_0x3bf0b7){return db[_0x9af5('0x4a')]['find']({'where':{'id':_0x833696[_0x9af5('0x49')]['id']},'attributes':[_0x9af5('0x2c'),_0x9af5('0x4c'),_0x9af5('0x4d')],'raw':!![]})[_0x9af5('0x26')](handleEntityNotFound(_0x138d9d,null))[_0x9af5('0x26')](function(_0x6c974){if(_0x6c974){if(!fs[_0x9af5('0x4e')](path[_0x9af5('0x4f')](config[_0x9af5('0x50')],_0x9af5('0x51'),_0x6c974[_0x9af5('0x4c')]+'.'+_0x6c974[_0x9af5('0x4d')]))){throw new db[(_0x9af5('0x52'))][(_0x9af5('0x53'))](_0x9af5('0x54'));}return _0x138d9d[_0x9af5('0x4b')](path[_0x9af5('0x4f')](config[_0x9af5('0x50')],_0x9af5('0x51'),util[_0x9af5('0x55')]('%s.%s',_0x6c974[_0x9af5('0x4c')],_0x6c974[_0x9af5('0x4d')])),util[_0x9af5('0x55')]('%s.%s',_0x6c974[_0x9af5('0x2c')],_0x6c974[_0x9af5('0x4d')]));}return null;})[_0x9af5('0x48')](handleError(_0x138d9d,null));};exports['create']=function(_0x171644,_0x222fbb,_0x160bca){var _0x26bf0d={'name':path[_0x9af5('0x56')](_0x171644[_0x9af5('0x57')][_0x9af5('0x58')],path['extname'](_0x171644[_0x9af5('0x57')][_0x9af5('0x58')])),'save_name':path[_0x9af5('0x56')](_0x171644[_0x9af5('0x57')][_0x9af5('0x59')],path[_0x9af5('0x5a')](_0x171644['file'][_0x9af5('0x59')])),'original_format':path[_0x9af5('0x5a')](_0x171644[_0x9af5('0x57')]['originalname'])['substring'](0x1),'converted_format':_0x9af5('0x5b')};var _0x2d0450=path['join'](config[_0x9af5('0x50')],_0x9af5('0x5c'),_0x171644[_0x9af5('0x57')][_0x9af5('0x59')]);var _0x41e5ac=path[_0x9af5('0x4f')](config[_0x9af5('0x50')],'server/files/sounds/converted',util[_0x9af5('0x55')](_0x9af5('0x5d'),path['basename'](_0x171644[_0x9af5('0x57')][_0x9af5('0x59')],path[_0x9af5('0x5a')](_0x171644[_0x9af5('0x57')][_0x9af5('0x59')])),_0x26bf0d[_0x9af5('0x4d')]));logger[_0x9af5('0x5e')](_0x9af5('0x5f'),_0x2d0450);logger[_0x9af5('0x5e')](_0x9af5('0x60'),_0x41e5ac);try{fs[_0x9af5('0x61')](_0x2d0450,parseInt(_0x9af5('0x62'),0x8));var _0x5f48bb=sox['transcode'](_0x2d0450,_0x41e5ac,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5f48bb['on'](_0x9af5('0x2a'),function(_0x5e3532){fs[_0x9af5('0x63')](_0x2d0450);_0x222fbb[_0x9af5('0x1a')](0x1f4)['send'](_0x5e3532);});_0x5f48bb['on'](_0x9af5('0x64'),function(_0x4557c6){_0x26bf0d[_0x9af5('0x65')]=isNaN(_0x4557c6[_0x9af5('0x66')])?null:_0x4557c6[_0x9af5('0x66')]*0x3e8;_0x26bf0d[_0x9af5('0x67')]=isNaN(_0x4557c6[_0x9af5('0x68')])?null:_0x4557c6[_0x9af5('0x68')];_0x26bf0d[_0x9af5('0x69')]=isNaN(_0x4557c6['channelCount'])?null:_0x4557c6[_0x9af5('0x6a')];_0x26bf0d['original_bitRate']=isNaN(_0x4557c6[_0x9af5('0x6b')])?null:_0x4557c6[_0x9af5('0x6b')];_0x26bf0d['original_sampleRate']=isNaN(_0x4557c6[_0x9af5('0x6c')])?null:_0x4557c6[_0x9af5('0x6c')];});_0x5f48bb['on']('dest',function(_0x5cd734){_0x26bf0d[_0x9af5('0x6d')]=isNaN(_0x5cd734[_0x9af5('0x66')])?null:_0x5cd734['duration']*0x3e8;_0x26bf0d['converted_sampleCount']=isNaN(_0x5cd734[_0x9af5('0x68')])?null:_0x5cd734[_0x9af5('0x68')];_0x26bf0d['converted_channelCount']=isNaN(_0x5cd734[_0x9af5('0x6a')])?null:_0x5cd734['channelCount'];_0x26bf0d['converted_bitRate']=isNaN(_0x5cd734[_0x9af5('0x6b')])?null:_0x5cd734[_0x9af5('0x6b')];_0x26bf0d['converted_sampleRate']=isNaN(_0x5cd734[_0x9af5('0x6c')])?null:_0x5cd734['sampleRate'];});_0x5f48bb['on']('end',function(){fs[_0x9af5('0x61')](_0x41e5ac,parseInt(_0x9af5('0x62'),0x8));return db[_0x9af5('0x4a')][_0x9af5('0x6e')](_0x26bf0d)[_0x9af5('0x26')](function(_0x409744){var _0x304a5e={'role':_0x171644['body'][_0x9af5('0x6f')],'userProfileId':_0x171644[_0x9af5('0x70')][_0x9af5('0x71')]};if(!_0x304a5e)throw new Error(_0x9af5('0x72'));if(_0x304a5e['role']===_0x9af5('0x73')){var _0x4436b4=_0x409744[_0x9af5('0x27')]({'plain':!![]});return db[_0x9af5('0x74')]['find']({'where':{'name':_0x9af5('0x28'),'userProfileId':_0x304a5e[_0x9af5('0x71')]},'raw':!![]})['then'](function(_0xc4e63b){if(_0xc4e63b&&_0xc4e63b[_0x9af5('0x75')]===0x0){return db[_0x9af5('0x29')][_0x9af5('0x6e')]({'name':_0x4436b4[_0x9af5('0x2c')],'resourceId':_0x4436b4['id'],'type':_0xc4e63b[_0x9af5('0x2c')],'sectionId':_0xc4e63b['id']},{})[_0x9af5('0x26')](function(){return _0x409744;});}else{return _0x409744;}})[_0x9af5('0x48')](function(_0x210096){logger['error'](_0x9af5('0x76'),_0x210096);throw _0x210096;});}return _0x409744;})['then'](respondWithResult(_0x222fbb,null))[_0x9af5('0x48')](handleError(_0x222fbb,null));});_0x5f48bb[_0x9af5('0x77')]();}catch(_0xd4533b){_0x222fbb['status'](0x1f4)[_0x9af5('0x2d')](_0xd4533b);}};exports[_0x9af5('0x24')]=function(_0x358b6d,_0x2238f6,_0xcaebcf){return db['Sound']['find']({'where':{'id':_0x358b6d[_0x9af5('0x49')]['id']}})['then'](handleEntityNotFound(_0x2238f6,null))[_0x9af5('0x26')](saveUpdates(_[_0x9af5('0x40')](_0x358b6d[_0x9af5('0x70')],[_0x9af5('0x2c'),_0x9af5('0x78')]),null))[_0x9af5('0x26')](respondWithResult(_0x2238f6,null))[_0x9af5('0x48')](handleError(_0x2238f6,null));};exports[_0x9af5('0x79')]=function(_0x15a3e1,_0x1843c2,_0x574966){return db[_0x9af5('0x4a')]['find']({'where':{'id':_0x15a3e1[_0x9af5('0x49')]['id']}})[_0x9af5('0x26')](function(_0xecc574){if(_0xecc574){return _0xecc574['destroy']();}})['then'](function(_0x42d163){var _0x4c7baf=path[_0x9af5('0x4f')](config[_0x9af5('0x50')],_0x9af5('0x5c'),util[_0x9af5('0x55')](_0x9af5('0x5d'),_0x42d163['save_name'],_0x42d163['original_format']));var _0x47d3e5=path[_0x9af5('0x4f')](config['root'],_0x9af5('0x51'),util[_0x9af5('0x55')](_0x9af5('0x5d'),_0x42d163[_0x9af5('0x4c')],_0x42d163[_0x9af5('0x4d')]));fs[_0x9af5('0x63')](_0x4c7baf);fs[_0x9af5('0x63')](_0x47d3e5);return _0x42d163;})[_0x9af5('0x26')](function(_0x10cf2e){if(_0x10cf2e){return _0x1843c2[_0x9af5('0x1a')](0xcc)[_0x9af5('0x1b')]();}})[_0x9af5('0x26')](handleEntityNotFound(_0x1843c2,null))['catch'](handleError(_0x1843c2,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 417e9bd..d66391c 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 _0x690b=['bluebird','path','rimraf','../../config/environment','./sound.attributes','exports','Sound','lodash','util','../../config/logger','api'];(function(_0x2d4ab1,_0xd0fc03){var _0x2b4fe0=function(_0x23e912){while(--_0x23e912){_0x2d4ab1['push'](_0x2d4ab1['shift']());}};_0x2b4fe0(++_0xd0fc03);}(_0x690b,0x1d5));var _0xb690=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0x690b[_0x2002b3];return _0x2756f0;};'use strict';var _=require(_0xb690('0x0'));var util=require(_0xb690('0x1'));var logger=require(_0xb690('0x2'))(_0xb690('0x3'));var moment=require('moment');var BPromise=require(_0xb690('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb690('0x5'));var rimraf=require(_0xb690('0x6'));var config=require(_0xb690('0x7'));var attributes=require(_0xb690('0x8'));module[_0xb690('0x9')]=function(_0x30f4cb,_0x369664){return _0x30f4cb['define'](_0xb690('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2244=['../../config/logger','request-promise','path','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util'];(function(_0x1d5cbb,_0x425e7f){var _0x1da5d5=function(_0x462f8d){while(--_0x462f8d){_0x1d5cbb['push'](_0x1d5cbb['shift']());}};_0x1da5d5(++_0x425e7f);}(_0x2244,0x103));var _0x4224=function(_0x13b7f4,_0x4bf686){_0x13b7f4=_0x13b7f4-0x0;var _0x519ce4=_0x2244[_0x13b7f4];return _0x519ce4;};'use strict';var _=require('lodash');var util=require(_0x4224('0x0'));var logger=require(_0x4224('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4224('0x2'));var fs=require('fs');var path=require(_0x4224('0x3'));var rimraf=require('rimraf');var config=require(_0x4224('0x4'));var attributes=require(_0x4224('0x5'));module[_0x4224('0x6')]=function(_0x2f1603,_0x433cfe){return _0x2f1603[_0x4224('0x7')](_0x4224('0x8'),attributes,{'tableName':_0x4224('0x9'),'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 46fc934..33f824a 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 _0x3287=['catch','ShowSound','Sound','find','options','raw','where','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0x3287,0x6e));var _0x7328=function(_0x766d52,_0xa7040b){_0x766d52=_0x766d52-0x0;var _0x2584d4=_0x3287[_0x766d52];return _0x2584d4;};'use strict';var _=require(_0x7328('0x0'));var util=require('util');var moment=require(_0x7328('0x1'));var BPromise=require(_0x7328('0x2'));var rs=require(_0x7328('0x3'));var fs=require('fs');var Redis=require(_0x7328('0x4'));var db=require(_0x7328('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7328('0x6'))(_0x7328('0x7'));var config=require(_0x7328('0x8'));var jayson=require(_0x7328('0x9'));var client=jayson[_0x7328('0xa')][_0x7328('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5e58,_0x3be5c4,_0x474bf2){return new BPromise(function(_0x1877bb,_0x1e212a){return client['request'](_0x1d5e58,_0x474bf2)[_0x7328('0xc')](function(_0x112b29){logger[_0x7328('0xd')](_0x7328('0xe'),_0x3be5c4,_0x7328('0xf'));logger[_0x7328('0x10')](_0x7328('0x11'),_0x3be5c4,_0x7328('0xf'),JSON[_0x7328('0x12')](_0x112b29));if(_0x112b29[_0x7328('0x13')]){if(_0x112b29[_0x7328('0x13')][_0x7328('0x14')]===0x1f4){logger[_0x7328('0x13')]('Sound,\x20%s,\x20%s',_0x3be5c4,_0x112b29[_0x7328('0x13')][_0x7328('0x15')]);return _0x1e212a(_0x112b29[_0x7328('0x13')][_0x7328('0x15')]);}logger[_0x7328('0x13')](_0x7328('0xe'),_0x3be5c4,_0x112b29[_0x7328('0x13')]['message']);return _0x1877bb(_0x112b29[_0x7328('0x13')][_0x7328('0x15')]);}else{logger[_0x7328('0xd')]('Sound,\x20%s,\x20%s',_0x3be5c4,_0x7328('0xf'));_0x1877bb(_0x112b29['result'][_0x7328('0x15')]);}})[_0x7328('0x16')](function(_0x49ca9d){logger[_0x7328('0x13')]('Sound,\x20%s,\x20%s',_0x3be5c4,_0x49ca9d);_0x1e212a(_0x49ca9d);});});}exports[_0x7328('0x17')]=function(_0x1dbe49){var _0x5741b9=this;return new Promise(function(_0x1b6f97,_0x104c0b){return db[_0x7328('0x18')][_0x7328('0x19')]({'raw':_0x1dbe49['options']?_0x1dbe49[_0x7328('0x1a')][_0x7328('0x1b')]===undefined?!![]:![]:!![],'where':_0x1dbe49['options']?_0x1dbe49[_0x7328('0x1a')][_0x7328('0x1c')]||null:null,'attributes':_0x1dbe49[_0x7328('0x1a')]?_0x1dbe49[_0x7328('0x1a')]['attributes']||null:null,'include':_0x1dbe49[_0x7328('0x1a')]?_0x1dbe49[_0x7328('0x1a')][_0x7328('0x1d')]?_[_0x7328('0x1e')](_0x1dbe49[_0x7328('0x1a')][_0x7328('0x1d')],function(_0x27d321){return{'model':db[_0x27d321[_0x7328('0x1f')]],'as':_0x27d321['as'],'attributes':_0x27d321[_0x7328('0x20')],'include':_0x27d321[_0x7328('0x1d')]?_[_0x7328('0x1e')](_0x27d321[_0x7328('0x1d')],function(_0x3b60d5){return{'model':db[_0x3b60d5[_0x7328('0x1f')]],'as':_0x3b60d5['as'],'attributes':_0x3b60d5[_0x7328('0x20')],'include':_0x3b60d5['include']?_['map'](_0x3b60d5[_0x7328('0x1d')],function(_0x46612a){return{'model':db[_0x46612a[_0x7328('0x1f')]],'as':_0x46612a['as'],'attributes':_0x46612a[_0x7328('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7328('0xc')](function(_0x45f047){logger[_0x7328('0xd')](_0x7328('0x17'),_0x1dbe49);logger[_0x7328('0x10')](_0x7328('0x17'),_0x1dbe49,JSON['stringify'](_0x45f047));_0x1b6f97(_0x45f047);})[_0x7328('0x16')](function(_0x1347d4){logger[_0x7328('0x13')](_0x7328('0x17'),_0x1347d4['message'],_0x1dbe49);_0x104c0b(_0x5741b9[_0x7328('0x13')](0x1f4,_0x1347d4[_0x7328('0x15')]));});});}; \ No newline at end of file +var _0x0868=['options','raw','where','attributes','include','map','model','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','find'];(function(_0x3ddb4e,_0x5d9ecf){var _0x16202e=function(_0x505a25){while(--_0x505a25){_0x3ddb4e['push'](_0x3ddb4e['shift']());}};_0x16202e(++_0x5d9ecf);}(_0x0868,0x1c8));var _0x8086=function(_0x5e0dce,_0x361d49){_0x5e0dce=_0x5e0dce-0x0;var _0x3d83ed=_0x0868[_0x5e0dce];return _0x3d83ed;};'use strict';var _=require(_0x8086('0x0'));var util=require('util');var moment=require(_0x8086('0x1'));var BPromise=require('bluebird');var rs=require(_0x8086('0x2'));var fs=require('fs');var Redis=require(_0x8086('0x3'));var db=require(_0x8086('0x4'))['db'];var utils=require(_0x8086('0x5'));var logger=require(_0x8086('0x6'))(_0x8086('0x7'));var config=require('../../config/environment');var jayson=require(_0x8086('0x8'));var client=jayson[_0x8086('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b0a21,_0x37fef5,_0x5719b8){return new BPromise(function(_0x4d547b,_0x18a540){return client[_0x8086('0xa')](_0x4b0a21,_0x5719b8)[_0x8086('0xb')](function(_0x42e7a0){logger[_0x8086('0xc')](_0x8086('0xd'),_0x37fef5,_0x8086('0xe'));logger[_0x8086('0xf')](_0x8086('0x10'),_0x37fef5,'request\x20sent',JSON['stringify'](_0x42e7a0));if(_0x42e7a0[_0x8086('0x11')]){if(_0x42e7a0['error'][_0x8086('0x12')]===0x1f4){logger[_0x8086('0x11')]('Sound,\x20%s,\x20%s',_0x37fef5,_0x42e7a0[_0x8086('0x11')]['message']);return _0x18a540(_0x42e7a0[_0x8086('0x11')][_0x8086('0x13')]);}logger[_0x8086('0x11')](_0x8086('0xd'),_0x37fef5,_0x42e7a0['error'][_0x8086('0x13')]);return _0x4d547b(_0x42e7a0[_0x8086('0x11')][_0x8086('0x13')]);}else{logger[_0x8086('0xc')](_0x8086('0xd'),_0x37fef5,'request\x20sent');_0x4d547b(_0x42e7a0[_0x8086('0x14')][_0x8086('0x13')]);}})[_0x8086('0x15')](function(_0x532b93){logger[_0x8086('0x11')]('Sound,\x20%s,\x20%s',_0x37fef5,_0x532b93);_0x18a540(_0x532b93);});});}exports[_0x8086('0x16')]=function(_0x3cb815){var _0x4eeb88=this;return new Promise(function(_0x43a708,_0x209676){return db['Sound'][_0x8086('0x17')]({'raw':_0x3cb815['options']?_0x3cb815[_0x8086('0x18')][_0x8086('0x19')]===undefined?!![]:![]:!![],'where':_0x3cb815[_0x8086('0x18')]?_0x3cb815[_0x8086('0x18')][_0x8086('0x1a')]||null:null,'attributes':_0x3cb815[_0x8086('0x18')]?_0x3cb815['options'][_0x8086('0x1b')]||null:null,'include':_0x3cb815['options']?_0x3cb815['options'][_0x8086('0x1c')]?_[_0x8086('0x1d')](_0x3cb815[_0x8086('0x18')][_0x8086('0x1c')],function(_0xa48d3c){return{'model':db[_0xa48d3c['model']],'as':_0xa48d3c['as'],'attributes':_0xa48d3c[_0x8086('0x1b')],'include':_0xa48d3c[_0x8086('0x1c')]?_[_0x8086('0x1d')](_0xa48d3c[_0x8086('0x1c')],function(_0x16c859){return{'model':db[_0x16c859[_0x8086('0x1e')]],'as':_0x16c859['as'],'attributes':_0x16c859[_0x8086('0x1b')],'include':_0x16c859[_0x8086('0x1c')]?_[_0x8086('0x1d')](_0x16c859[_0x8086('0x1c')],function(_0x197845){return{'model':db[_0x197845[_0x8086('0x1e')]],'as':_0x197845['as'],'attributes':_0x197845[_0x8086('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8086('0xb')](function(_0x1b8f9f){logger['info'](_0x8086('0x16'),_0x3cb815);logger[_0x8086('0xf')]('ShowSound',_0x3cb815,JSON[_0x8086('0x1f')](_0x1b8f9f));_0x43a708(_0x1b8f9f);})[_0x8086('0x15')](function(_0x4fd00a){logger[_0x8086('0x11')](_0x8086('0x16'),_0x4fd00a[_0x8086('0x13')],_0x3cb815);_0x209676(_0x4eeb88['error'](0x1f4,_0x4fd00a[_0x8086('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 4debc07..8dbd743 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(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0x4fc2,0x111));var _0x24fc=function(_0x378a07,_0x26dbbe){_0x378a07=_0x378a07-0x0;var _0x1013e7=_0x4fc2[_0x378a07];return _0x1013e7;};'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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0xc89c5f,_0x8032a7){var _0x2d1ab1=function(_0x5489fe){while(--_0x5489fe){_0xc89c5f['push'](_0xc89c5f['shift']());}};_0x2d1ab1(++_0x8032a7);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4e6cbb,_0x3450f0){_0x4e6cbb=_0x4e6cbb-0x0;var _0x15ced4=_0x5eb8[_0x4e6cbb];return _0x15ced4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 069dd10..f50b4c5 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 _0x47a1=['TEXT','medium','ENUM','out','STRING'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0x47a1,0xa4));var _0x147a=function(_0x2b8e6c,_0x48ec22){_0x2b8e6c=_0x2b8e6c-0x0;var _0x21c65a=_0x47a1[_0x2b8e6c];return _0x21c65a;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x147a('0x0')]},'body':{'type':Sequelize[_0x147a('0x1')](_0x147a('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x147a('0x3')]('in',_0x147a('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x147a('0x1')]}}; \ No newline at end of file +var _0xdf8f=['exports','STRING','medium','ENUM','out','sequelize'];(function(_0x95edb8,_0x60f103){var _0x39022c=function(_0x324d43){while(--_0x324d43){_0x95edb8['push'](_0x95edb8['shift']());}};_0x39022c(++_0x60f103);}(_0xdf8f,0x16d));var _0xfdf8=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xdf8f[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xfdf8('0x0'));module[_0xfdf8('0x1')]={'uniqueid':{'type':Sequelize[_0xfdf8('0x2')]},'body':{'type':Sequelize['TEXT'](_0xfdf8('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xfdf8('0x4')]('in',_0xfdf8('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xfdf8('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 51912d7..2beb6bb 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 _0x866a=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','index','map','SquareMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x5ddc90,_0x1a9989){var _0x1f2b57=function(_0x208bb8){while(--_0x208bb8){_0x5ddc90['push'](_0x5ddc90['shift']());}};_0x1f2b57(++_0x1a9989);}(_0x866a,0x156));var _0xa866=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0x866a[_0x34b87f];return _0x449805;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa866('0x0'));var zipdir=require(_0xa866('0x1'));var jsonpatch=require(_0xa866('0x2'));var rp=require(_0xa866('0x3'));var moment=require(_0xa866('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa866('0x5'));var util=require(_0xa866('0x6'));var path=require(_0xa866('0x7'));var sox=require('sox');var csv=require(_0xa866('0x8'));var ejs=require(_0xa866('0x9'));var fs=require('fs');var fs_extra=require(_0xa866('0xa'));var _=require(_0xa866('0xb'));var squel=require(_0xa866('0xc'));var crypto=require(_0xa866('0xd'));var jsforce=require(_0xa866('0xe'));var deskjs=require(_0xa866('0xf'));var toCsv=require(_0xa866('0x8'));var querystring=require(_0xa866('0x10'));var Papa=require('papaparse');var Redis=require(_0xa866('0x11'));var authService=require(_0xa866('0x12'));var qs=require(_0xa866('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa866('0x14'));var logger=require(_0xa866('0x15'))(_0xa866('0x16'));var utils=require(_0xa866('0x17'));var config=require(_0xa866('0x18'));var licenseUtil=require(_0xa866('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xda40fb,_0xcf9adb){_0xcf9adb=_0xcf9adb||0xcc;return function(_0x82a87d){if(_0x82a87d){return _0xda40fb[_0xa866('0x1a')](_0xcf9adb);}return _0xda40fb['status'](_0xcf9adb)[_0xa866('0x1b')]();};}function respondWithResult(_0x54d726,_0x30a560){_0x30a560=_0x30a560||0xc8;return function(_0x5ad0a2){if(_0x5ad0a2){return _0x54d726[_0xa866('0x1c')](_0x30a560)[_0xa866('0x1d')](_0x5ad0a2);}};}function respondWithFilteredResult(_0x1b0ea6,_0x5d4fd1){return function(_0x251095){if(_0x251095){var _0x1afbe4=typeof _0x5d4fd1[_0xa866('0x1e')]===_0xa866('0x1f')&&typeof _0x5d4fd1[_0xa866('0x20')]===_0xa866('0x1f');var _0x34ca55=_0x251095[_0xa866('0x21')];var _0x440de5=_0x1afbe4?0x0:_0x5d4fd1['offset'];var _0x2aca7b=_0x1afbe4?_0x251095[_0xa866('0x21')]:_0x5d4fd1[_0xa866('0x1e')]+_0x5d4fd1[_0xa866('0x20')];var _0x1bd7c0;if(_0x2aca7b>=_0x34ca55){_0x2aca7b=_0x34ca55;_0x1bd7c0=0xc8;}else{_0x1bd7c0=0xce;}_0x1b0ea6[_0xa866('0x1c')](_0x1bd7c0);return _0x1b0ea6[_0xa866('0x22')]('Content-Range',_0x440de5+'-'+_0x2aca7b+'/'+_0x34ca55)[_0xa866('0x1d')](_0x251095);}return null;};}function patchUpdates(_0x48ae31){return function(_0x5d105c){try{jsonpatch[_0xa866('0x23')](_0x5d105c,_0x48ae31,!![]);}catch(_0x5075da){return BPromise[_0xa866('0x24')](_0x5075da);}return _0x5d105c[_0xa866('0x25')]();};}function saveUpdates(_0x22de43,_0x597b3b){return function(_0x5d9af5){if(_0x5d9af5){return _0x5d9af5[_0xa866('0x26')](_0x22de43)[_0xa866('0x27')](function(_0x48b66c){return _0x48b66c;});}return null;};}function removeEntity(_0x2a6940,_0x31ed99){return function(_0x118f1b){if(_0x118f1b){return _0x118f1b[_0xa866('0x28')]()['then'](function(){_0x2a6940[_0xa866('0x1c')](0xcc)[_0xa866('0x1b')]();});}};}function handleEntityNotFound(_0x35a83d,_0x4689d1){return function(_0x395d3a){if(!_0x395d3a){_0x35a83d[_0xa866('0x1a')](0x194);}return _0x395d3a;};}function handleError(_0x4ed77e,_0x34620d){_0x34620d=_0x34620d||0x1f4;return function(_0x16c9f7){logger['error'](_0x16c9f7['stack']);if(_0x16c9f7[_0xa866('0x29')]){delete _0x16c9f7[_0xa866('0x29')];}_0x4ed77e['status'](_0x34620d)['send'](_0x16c9f7);};}exports[_0xa866('0x2a')]=function(_0x1e27ed,_0x47f42b){var _0xe83620={},_0x36e73b={},_0x122eb0={'count':0x0,'rows':[]};var _0x55090c=_[_0xa866('0x2b')](db[_0xa866('0x2c')][_0xa866('0x2d')],function(_0x408015){return{'name':_0x408015[_0xa866('0x2e')],'type':_0x408015['type']['key']};});_0x36e73b[_0xa866('0x2f')]=_[_0xa866('0x2b')](_0x55090c,_0xa866('0x29'));_0x36e73b[_0xa866('0x30')]=_[_0xa866('0x31')](_0x1e27ed['query']);_0x36e73b[_0xa866('0x32')]=_[_0xa866('0x33')](_0x36e73b['model'],_0x36e73b[_0xa866('0x30')]);_0xe83620[_0xa866('0x34')]=_['intersection'](_0x36e73b[_0xa866('0x2f')],qs[_0xa866('0x35')](_0x1e27ed[_0xa866('0x30')][_0xa866('0x35')]));_0xe83620[_0xa866('0x34')]=_0xe83620[_0xa866('0x34')][_0xa866('0x36')]?_0xe83620[_0xa866('0x34')]:_0x36e73b[_0xa866('0x2f')];if(!_0x1e27ed[_0xa866('0x30')]['hasOwnProperty']('nolimit')){_0xe83620[_0xa866('0x20')]=qs[_0xa866('0x20')](_0x1e27ed[_0xa866('0x30')][_0xa866('0x20')]);_0xe83620[_0xa866('0x1e')]=qs['offset'](_0x1e27ed[_0xa866('0x30')][_0xa866('0x1e')]);}_0xe83620[_0xa866('0x37')]=qs[_0xa866('0x38')](_0x1e27ed['query'][_0xa866('0x38')]);_0xe83620[_0xa866('0x39')]=qs[_0xa866('0x32')](_['pick'](_0x1e27ed[_0xa866('0x30')],_0x36e73b[_0xa866('0x32')]),_0x55090c);if(_0x1e27ed[_0xa866('0x30')][_0xa866('0x3a')]){_0xe83620['where']=_[_0xa866('0x3b')](_0xe83620['where'],{'$or':_[_0xa866('0x2b')](_0x55090c,function(_0x5ccfaa){if(_0x5ccfaa[_0xa866('0x3c')]!==_0xa866('0x3d')){var _0x44a0d7={};_0x44a0d7[_0x5ccfaa[_0xa866('0x29')]]={'$like':'%'+_0x1e27ed[_0xa866('0x30')][_0xa866('0x3a')]+'%'};return _0x44a0d7;}})});}_0xe83620=_['merge']({},_0xe83620,_0x1e27ed[_0xa866('0x3e')]);var _0x4b0e70={'where':_0xe83620[_0xa866('0x39')]};return db[_0xa866('0x2c')][_0xa866('0x21')](_0x4b0e70)[_0xa866('0x27')](function(_0xe206bf){_0x122eb0[_0xa866('0x21')]=_0xe206bf;if(_0x1e27ed[_0xa866('0x30')]['includeAll']){_0xe83620[_0xa866('0x3f')]=[{'all':!![]}];}return db[_0xa866('0x2c')][_0xa866('0x40')](_0xe83620);})['then'](function(_0x2a7735){_0x122eb0['rows']=_0x2a7735;return _0x122eb0;})[_0xa866('0x27')](respondWithFilteredResult(_0x47f42b,_0xe83620))[_0xa866('0x41')](handleError(_0x47f42b,null));};exports[_0xa866('0x42')]=function(_0x5f248f,_0x5453e0){var _0x14b85f={'raw':!![],'where':{'id':_0x5f248f[_0xa866('0x43')]['id']}},_0x688523={};_0x688523[_0xa866('0x2f')]=_['keys'](db[_0xa866('0x2c')][_0xa866('0x2d')]);_0x688523[_0xa866('0x30')]=_[_0xa866('0x31')](_0x5f248f[_0xa866('0x30')]);_0x688523[_0xa866('0x32')]=_['intersection'](_0x688523[_0xa866('0x2f')],_0x688523[_0xa866('0x30')]);_0x14b85f[_0xa866('0x34')]=_[_0xa866('0x33')](_0x688523[_0xa866('0x2f')],qs[_0xa866('0x35')](_0x5f248f['query'][_0xa866('0x35')]));_0x14b85f[_0xa866('0x34')]=_0x14b85f[_0xa866('0x34')][_0xa866('0x36')]?_0x14b85f[_0xa866('0x34')]:_0x688523[_0xa866('0x2f')];if(_0x5f248f['query'][_0xa866('0x44')]){_0x14b85f[_0xa866('0x3f')]=[{'all':!![]}];}_0x14b85f=_[_0xa866('0x3b')]({},_0x14b85f,_0x5f248f[_0xa866('0x3e')]);return db[_0xa866('0x2c')][_0xa866('0x45')](_0x14b85f)[_0xa866('0x27')](handleEntityNotFound(_0x5453e0,null))['then'](respondWithResult(_0x5453e0,null))[_0xa866('0x41')](handleError(_0x5453e0,null));};exports[_0xa866('0x46')]=function(_0x5b890e,_0x76af1d){return db[_0xa866('0x2c')][_0xa866('0x46')](_0x5b890e[_0xa866('0x47')],{})[_0xa866('0x27')](respondWithResult(_0x76af1d,0xc9))[_0xa866('0x41')](handleError(_0x76af1d,null));};exports[_0xa866('0x26')]=function(_0x4ac15b,_0x4b3e14){if(_0x4ac15b[_0xa866('0x47')]['id']){delete _0x4ac15b['body']['id'];}return db['SquareMessage']['find']({'where':{'id':_0x4ac15b[_0xa866('0x43')]['id']}})[_0xa866('0x27')](handleEntityNotFound(_0x4b3e14,null))[_0xa866('0x27')](saveUpdates(_0x4ac15b[_0xa866('0x47')],null))['then'](respondWithResult(_0x4b3e14,null))[_0xa866('0x41')](handleError(_0x4b3e14,null));};exports[_0xa866('0x28')]=function(_0x1d0782,_0x3e32fe){return db[_0xa866('0x2c')]['find']({'where':{'id':_0x1d0782[_0xa866('0x43')]['id']}})[_0xa866('0x27')](handleEntityNotFound(_0x3e32fe,null))[_0xa866('0x27')](removeEntity(_0x3e32fe,null))[_0xa866('0x41')](handleError(_0x3e32fe,null));}; \ No newline at end of file +var _0x8eba=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x6aa02c,_0x1157f0){var _0x506310=function(_0x5b5188){while(--_0x5b5188){_0x6aa02c['push'](_0x6aa02c['shift']());}};_0x506310(++_0x1157f0);}(_0x8eba,0xc3));var _0xa8eb=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x8eba[_0x946518];return _0x909b69;};'use strict';var emlformat=require(_0xa8eb('0x0'));var rimraf=require(_0xa8eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa8eb('0x2'));var BPromise=require(_0xa8eb('0x3'));var Mustache=require(_0xa8eb('0x4'));var util=require(_0xa8eb('0x5'));var path=require('path');var sox=require(_0xa8eb('0x6'));var csv=require(_0xa8eb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8eb('0x8'));var _=require('lodash');var squel=require(_0xa8eb('0x9'));var crypto=require(_0xa8eb('0xa'));var jsforce=require(_0xa8eb('0xb'));var deskjs=require(_0xa8eb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa8eb('0xd'));var Papa=require(_0xa8eb('0xe'));var Redis=require('ioredis');var authService=require(_0xa8eb('0xf'));var qs=require(_0xa8eb('0x10'));var as=require(_0xa8eb('0x11'));var hardwareService=require(_0xa8eb('0x12'));var logger=require('../../config/logger')(_0xa8eb('0x13'));var utils=require('../../config/utils');var config=require(_0xa8eb('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa8eb('0x15'))['db'];function respondWithStatusCode(_0x47149c,_0x5b21fc){_0x5b21fc=_0x5b21fc||0xcc;return function(_0x2c7cff){if(_0x2c7cff){return _0x47149c['sendStatus'](_0x5b21fc);}return _0x47149c[_0xa8eb('0x16')](_0x5b21fc)[_0xa8eb('0x17')]();};}function respondWithResult(_0xa38acb,_0x1a014a){_0x1a014a=_0x1a014a||0xc8;return function(_0x557bb0){if(_0x557bb0){return _0xa38acb[_0xa8eb('0x16')](_0x1a014a)['json'](_0x557bb0);}};}function respondWithFilteredResult(_0x2b2d65,_0x401cd5){return function(_0x40ec36){if(_0x40ec36){var _0x102a81=typeof _0x401cd5['offset']===_0xa8eb('0x18')&&typeof _0x401cd5[_0xa8eb('0x19')]===_0xa8eb('0x18');var _0x249527=_0x40ec36[_0xa8eb('0x1a')];var _0x57a6c6=_0x102a81?0x0:_0x401cd5[_0xa8eb('0x1b')];var _0x1cb4f1=_0x102a81?_0x40ec36[_0xa8eb('0x1a')]:_0x401cd5[_0xa8eb('0x1b')]+_0x401cd5[_0xa8eb('0x19')];var _0x27bf23;if(_0x1cb4f1>=_0x249527){_0x1cb4f1=_0x249527;_0x27bf23=0xc8;}else{_0x27bf23=0xce;}_0x2b2d65[_0xa8eb('0x16')](_0x27bf23);return _0x2b2d65[_0xa8eb('0x1c')]('Content-Range',_0x57a6c6+'-'+_0x1cb4f1+'/'+_0x249527)['json'](_0x40ec36);}return null;};}function patchUpdates(_0x4fe96c){return function(_0x1f6d6d){try{jsonpatch[_0xa8eb('0x1d')](_0x1f6d6d,_0x4fe96c,!![]);}catch(_0x153e53){return BPromise['reject'](_0x153e53);}return _0x1f6d6d[_0xa8eb('0x1e')]();};}function saveUpdates(_0x1025ef,_0x449f76){return function(_0x453b69){if(_0x453b69){return _0x453b69[_0xa8eb('0x1f')](_0x1025ef)[_0xa8eb('0x20')](function(_0x3f583a){return _0x3f583a;});}return null;};}function removeEntity(_0x32e9ce,_0x4557fc){return function(_0x387d49){if(_0x387d49){return _0x387d49[_0xa8eb('0x21')]()[_0xa8eb('0x20')](function(){_0x32e9ce[_0xa8eb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15b149,_0x1760ec){return function(_0x130a51){if(!_0x130a51){_0x15b149[_0xa8eb('0x22')](0x194);}return _0x130a51;};}function handleError(_0xd42347,_0x4aa445){_0x4aa445=_0x4aa445||0x1f4;return function(_0x261248){logger[_0xa8eb('0x23')](_0x261248[_0xa8eb('0x24')]);if(_0x261248[_0xa8eb('0x25')]){delete _0x261248[_0xa8eb('0x25')];}_0xd42347['status'](_0x4aa445)['send'](_0x261248);};}exports[_0xa8eb('0x26')]=function(_0x3cfcf0,_0x167f29){var _0x186eb5={},_0x418200={},_0x492cc2={'count':0x0,'rows':[]};var _0x204a1b=_[_0xa8eb('0x27')](db[_0xa8eb('0x28')][_0xa8eb('0x29')],function(_0x262304){return{'name':_0x262304[_0xa8eb('0x2a')],'type':_0x262304[_0xa8eb('0x2b')]['key']};});_0x418200[_0xa8eb('0x2c')]=_['map'](_0x204a1b,_0xa8eb('0x25'));_0x418200[_0xa8eb('0x2d')]=_['keys'](_0x3cfcf0[_0xa8eb('0x2d')]);_0x418200['filters']=_[_0xa8eb('0x2e')](_0x418200[_0xa8eb('0x2c')],_0x418200[_0xa8eb('0x2d')]);_0x186eb5[_0xa8eb('0x2f')]=_['intersection'](_0x418200[_0xa8eb('0x2c')],qs[_0xa8eb('0x30')](_0x3cfcf0[_0xa8eb('0x2d')][_0xa8eb('0x30')]));_0x186eb5[_0xa8eb('0x2f')]=_0x186eb5[_0xa8eb('0x2f')]['length']?_0x186eb5[_0xa8eb('0x2f')]:_0x418200['model'];if(!_0x3cfcf0['query']['hasOwnProperty'](_0xa8eb('0x31'))){_0x186eb5[_0xa8eb('0x19')]=qs[_0xa8eb('0x19')](_0x3cfcf0[_0xa8eb('0x2d')][_0xa8eb('0x19')]);_0x186eb5['offset']=qs['offset'](_0x3cfcf0[_0xa8eb('0x2d')][_0xa8eb('0x1b')]);}_0x186eb5[_0xa8eb('0x32')]=qs[_0xa8eb('0x33')](_0x3cfcf0[_0xa8eb('0x2d')]['sort']);_0x186eb5[_0xa8eb('0x34')]=qs['filters'](_[_0xa8eb('0x35')](_0x3cfcf0['query'],_0x418200[_0xa8eb('0x36')]),_0x204a1b);if(_0x3cfcf0[_0xa8eb('0x2d')][_0xa8eb('0x37')]){_0x186eb5[_0xa8eb('0x34')]=_['merge'](_0x186eb5[_0xa8eb('0x34')],{'$or':_['map'](_0x204a1b,function(_0x171a35){if(_0x171a35[_0xa8eb('0x2b')]!==_0xa8eb('0x38')){var _0x1a0e50={};_0x1a0e50[_0x171a35['name']]={'$like':'%'+_0x3cfcf0[_0xa8eb('0x2d')][_0xa8eb('0x37')]+'%'};return _0x1a0e50;}})});}_0x186eb5=_['merge']({},_0x186eb5,_0x3cfcf0[_0xa8eb('0x39')]);var _0x4d8b6c={'where':_0x186eb5[_0xa8eb('0x34')]};return db[_0xa8eb('0x28')][_0xa8eb('0x1a')](_0x4d8b6c)['then'](function(_0x1241bb){_0x492cc2['count']=_0x1241bb;if(_0x3cfcf0['query'][_0xa8eb('0x3a')]){_0x186eb5[_0xa8eb('0x3b')]=[{'all':!![]}];}return db['SquareMessage'][_0xa8eb('0x3c')](_0x186eb5);})[_0xa8eb('0x20')](function(_0x2dcedc){_0x492cc2[_0xa8eb('0x3d')]=_0x2dcedc;return _0x492cc2;})[_0xa8eb('0x20')](respondWithFilteredResult(_0x167f29,_0x186eb5))[_0xa8eb('0x3e')](handleError(_0x167f29,null));};exports[_0xa8eb('0x3f')]=function(_0x21c3e7,_0x27bdbe){var _0x4613d3={'raw':!![],'where':{'id':_0x21c3e7['params']['id']}},_0x5bcf53={};_0x5bcf53[_0xa8eb('0x2c')]=_[_0xa8eb('0x40')](db[_0xa8eb('0x28')][_0xa8eb('0x29')]);_0x5bcf53[_0xa8eb('0x2d')]=_[_0xa8eb('0x40')](_0x21c3e7[_0xa8eb('0x2d')]);_0x5bcf53[_0xa8eb('0x36')]=_['intersection'](_0x5bcf53['model'],_0x5bcf53[_0xa8eb('0x2d')]);_0x4613d3[_0xa8eb('0x2f')]=_[_0xa8eb('0x2e')](_0x5bcf53['model'],qs[_0xa8eb('0x30')](_0x21c3e7[_0xa8eb('0x2d')][_0xa8eb('0x30')]));_0x4613d3[_0xa8eb('0x2f')]=_0x4613d3[_0xa8eb('0x2f')][_0xa8eb('0x41')]?_0x4613d3[_0xa8eb('0x2f')]:_0x5bcf53[_0xa8eb('0x2c')];if(_0x21c3e7[_0xa8eb('0x2d')]['includeAll']){_0x4613d3[_0xa8eb('0x3b')]=[{'all':!![]}];}_0x4613d3=_['merge']({},_0x4613d3,_0x21c3e7[_0xa8eb('0x39')]);return db[_0xa8eb('0x28')][_0xa8eb('0x42')](_0x4613d3)['then'](handleEntityNotFound(_0x27bdbe,null))[_0xa8eb('0x20')](respondWithResult(_0x27bdbe,null))[_0xa8eb('0x3e')](handleError(_0x27bdbe,null));};exports[_0xa8eb('0x43')]=function(_0x3101b6,_0x2716a7){return db[_0xa8eb('0x28')][_0xa8eb('0x43')](_0x3101b6[_0xa8eb('0x44')],{})[_0xa8eb('0x20')](respondWithResult(_0x2716a7,0xc9))['catch'](handleError(_0x2716a7,null));};exports['update']=function(_0x273fd0,_0x3c2aff){if(_0x273fd0[_0xa8eb('0x44')]['id']){delete _0x273fd0[_0xa8eb('0x44')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x273fd0['params']['id']}})[_0xa8eb('0x20')](handleEntityNotFound(_0x3c2aff,null))['then'](saveUpdates(_0x273fd0[_0xa8eb('0x44')],null))[_0xa8eb('0x20')](respondWithResult(_0x3c2aff,null))[_0xa8eb('0x3e')](handleError(_0x3c2aff,null));};exports[_0xa8eb('0x21')]=function(_0x31b4f7,_0x7e0af2){return db[_0xa8eb('0x28')][_0xa8eb('0x42')]({'where':{'id':_0x31b4f7[_0xa8eb('0x45')]['id']}})[_0xa8eb('0x20')](handleEntityNotFound(_0x7e0af2,null))[_0xa8eb('0x20')](removeEntity(_0x7e0af2,null))[_0xa8eb('0x3e')](handleError(_0x7e0af2,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 8ce93d4..72c0449 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 _0x0670=['../../config/environment','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x0670,0xe9));var _0x0067=function(_0x3d2d6f,_0x368872){_0x3d2d6f=_0x3d2d6f-0x0;var _0x5c0022=_0x0670[_0x3d2d6f];return _0x5c0022;};'use strict';var _=require(_0x0067('0x0'));var util=require('util');var logger=require(_0x0067('0x1'))(_0x0067('0x2'));var moment=require(_0x0067('0x3'));var BPromise=require(_0x0067('0x4'));var rp=require(_0x0067('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0067('0x6'));var config=require(_0x0067('0x7'));var attributes=require('./squareMessage.attributes');module[_0x0067('0x8')]=function(_0x54220f,_0x2b5a13){return _0x54220f[_0x0067('0x9')](_0x0067('0xa'),attributes,{'tableName':_0x0067('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82a2=['api','moment','bluebird','request-promise','path','rimraf','exports','square_messages','lodash','util','../../config/logger'];(function(_0x21417b,_0x49805b){var _0xb08fcc=function(_0x1b4e7a){while(--_0x1b4e7a){_0x21417b['push'](_0x21417b['shift']());}};_0xb08fcc(++_0x49805b);}(_0x82a2,0x76));var _0x282a=function(_0x1aa4a2,_0x84b745){_0x1aa4a2=_0x1aa4a2-0x0;var _0x2a53ba=_0x82a2[_0x1aa4a2];return _0x2a53ba;};'use strict';var _=require(_0x282a('0x0'));var util=require(_0x282a('0x1'));var logger=require(_0x282a('0x2'))(_0x282a('0x3'));var moment=require(_0x282a('0x4'));var BPromise=require(_0x282a('0x5'));var rp=require(_0x282a('0x6'));var fs=require('fs');var path=require(_0x282a('0x7'));var rimraf=require(_0x282a('0x8'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x282a('0x9')]=function(_0x1eccc9,_0x567e73){return _0x1eccc9['define']('SquareMessage',attributes,{'tableName':_0x282a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 3376c61..d40b1c4 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 _0xca63=['result','catch','CreateSquareMessage','SquareMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1cab4d,_0xbf64c0){var _0x31ddc7=function(_0x4b3a18){while(--_0x4b3a18){_0x1cab4d['push'](_0x1cab4d['shift']());}};_0x31ddc7(++_0xbf64c0);}(_0xca63,0x93));var _0x3ca6=function(_0xf9609,_0x3513c6){_0xf9609=_0xf9609-0x0;var _0x411a97=_0xca63[_0xf9609];return _0x411a97;};'use strict';var _=require(_0x3ca6('0x0'));var util=require(_0x3ca6('0x1'));var moment=require(_0x3ca6('0x2'));var BPromise=require(_0x3ca6('0x3'));var rs=require(_0x3ca6('0x4'));var fs=require('fs');var Redis=require(_0x3ca6('0x5'));var db=require(_0x3ca6('0x6'))['db'];var utils=require(_0x3ca6('0x7'));var logger=require('../../config/logger')(_0x3ca6('0x8'));var config=require(_0x3ca6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3ca6('0xa')][_0x3ca6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x187912,_0x54b04d,_0x10ba63){return new BPromise(function(_0x3ae1a3,_0x41ced0){return client['request'](_0x187912,_0x10ba63)[_0x3ca6('0xc')](function(_0x318bac){logger[_0x3ca6('0xd')](_0x3ca6('0xe'),_0x54b04d,_0x3ca6('0xf'));logger[_0x3ca6('0x10')](_0x3ca6('0x11'),_0x54b04d,_0x3ca6('0xf'),JSON[_0x3ca6('0x12')](_0x318bac));if(_0x318bac[_0x3ca6('0x13')]){if(_0x318bac[_0x3ca6('0x13')]['code']===0x1f4){logger[_0x3ca6('0x13')](_0x3ca6('0xe'),_0x54b04d,_0x318bac[_0x3ca6('0x13')][_0x3ca6('0x14')]);return _0x41ced0(_0x318bac['error']['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x54b04d,_0x318bac[_0x3ca6('0x13')][_0x3ca6('0x14')]);return _0x3ae1a3(_0x318bac['error'][_0x3ca6('0x14')]);}else{logger['info'](_0x3ca6('0xe'),_0x54b04d,'request\x20sent');_0x3ae1a3(_0x318bac[_0x3ca6('0x15')][_0x3ca6('0x14')]);}})[_0x3ca6('0x16')](function(_0x5f22f8){logger[_0x3ca6('0x13')](_0x3ca6('0xe'),_0x54b04d,_0x5f22f8);_0x41ced0(_0x5f22f8);});});}exports[_0x3ca6('0x17')]=function(_0xb9af0d){var _0x662b1e=this;return new Promise(function(_0x53b74d,_0x501719){return db[_0x3ca6('0x18')][_0x3ca6('0x19')](_0xb9af0d[_0x3ca6('0x1a')],{'raw':_0xb9af0d[_0x3ca6('0x1b')]?_0xb9af0d[_0x3ca6('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3ca6('0xc')](function(_0x3ace8b){logger[_0x3ca6('0xd')]('CreateSquareMessage',_0xb9af0d);logger['debug']('CreateSquareMessage',_0xb9af0d,JSON[_0x3ca6('0x12')](_0x3ace8b));_0x53b74d(_0x3ace8b);})[_0x3ca6('0x16')](function(_0x5e8c15){logger[_0x3ca6('0x13')](_0x3ca6('0x17'),_0x5e8c15[_0x3ca6('0x14')],_0xb9af0d);_0x501719(_0x662b1e[_0x3ca6('0x13')](0x1f4,_0x5e8c15[_0x3ca6('0x14')]));});});}; \ No newline at end of file +var _0xdf7c=['result','catch','CreateSquareMessage','SquareMessage','options','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xd02923,_0x7d3515){var _0x10ff2f=function(_0x4da910){while(--_0x4da910){_0xd02923['push'](_0xd02923['shift']());}};_0x10ff2f(++_0x7d3515);}(_0xdf7c,0x14a));var _0xcdf7=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xdf7c[_0x533e4e];return _0x1f14bb;};'use strict';var _=require(_0xcdf7('0x0'));var util=require(_0xcdf7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcdf7('0x2'));var fs=require('fs');var Redis=require(_0xcdf7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdf7('0x4'));var logger=require(_0xcdf7('0x5'))(_0xcdf7('0x6'));var config=require(_0xcdf7('0x7'));var jayson=require(_0xcdf7('0x8'));var client=jayson[_0xcdf7('0x9')][_0xcdf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ba18e,_0x2aaf57,_0x133954){return new BPromise(function(_0x11bc26,_0x559a96){return client[_0xcdf7('0xb')](_0x2ba18e,_0x133954)[_0xcdf7('0xc')](function(_0x1e709e){logger[_0xcdf7('0xd')](_0xcdf7('0xe'),_0x2aaf57,_0xcdf7('0xf'));logger[_0xcdf7('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2aaf57,_0xcdf7('0xf'),JSON[_0xcdf7('0x11')](_0x1e709e));if(_0x1e709e['error']){if(_0x1e709e[_0xcdf7('0x12')][_0xcdf7('0x13')]===0x1f4){logger[_0xcdf7('0x12')]('SquareMessage,\x20%s,\x20%s',_0x2aaf57,_0x1e709e[_0xcdf7('0x12')][_0xcdf7('0x14')]);return _0x559a96(_0x1e709e[_0xcdf7('0x12')][_0xcdf7('0x14')]);}logger[_0xcdf7('0x12')](_0xcdf7('0xe'),_0x2aaf57,_0x1e709e[_0xcdf7('0x12')]['message']);return _0x11bc26(_0x1e709e[_0xcdf7('0x12')][_0xcdf7('0x14')]);}else{logger[_0xcdf7('0xd')]('SquareMessage,\x20%s,\x20%s',_0x2aaf57,_0xcdf7('0xf'));_0x11bc26(_0x1e709e[_0xcdf7('0x15')]['message']);}})[_0xcdf7('0x16')](function(_0x26200a){logger[_0xcdf7('0x12')](_0xcdf7('0xe'),_0x2aaf57,_0x26200a);_0x559a96(_0x26200a);});});}exports[_0xcdf7('0x17')]=function(_0x55e920){var _0x4b79ee=this;return new Promise(function(_0x11ebf8,_0xd3c25){return db[_0xcdf7('0x18')]['create'](_0x55e920['body'],{'raw':_0x55e920[_0xcdf7('0x19')]?_0x55e920['options'][_0xcdf7('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x99a3fe){logger[_0xcdf7('0xd')]('CreateSquareMessage',_0x55e920);logger['debug'](_0xcdf7('0x17'),_0x55e920,JSON[_0xcdf7('0x11')](_0x99a3fe));_0x11ebf8(_0x99a3fe);})['catch'](function(_0x5c8eec){logger[_0xcdf7('0x12')](_0xcdf7('0x17'),_0x5c8eec[_0xcdf7('0x14')],_0x55e920);_0xd3c25(_0x4b79ee[_0xcdf7('0x12')](0x1f4,_0x5c8eec['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 5bdbb5f..c548dc3 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 _0xeb95=['isAuthenticated','index','/:id','show','/:id/test','15s','test','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2b0875,_0x21ff12){var _0xedb8d7=function(_0x33ebf6){while(--_0x33ebf6){_0x2b0875['push'](_0x2b0875['shift']());}};_0xedb8d7(++_0x21ff12);}(_0xeb95,0x186));var _0x5eb9=function(_0x4e1048,_0x46094f){_0x4e1048=_0x4e1048-0x0;var _0x3bca4e=_0xeb95[_0x4e1048];return _0x3bca4e;};'use strict';var multer=require(_0x5eb9('0x0'));var util=require('util');var path=require(_0x5eb9('0x1'));var timeout=require(_0x5eb9('0x2'));var express=require(_0x5eb9('0x3'));var router=express[_0x5eb9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5eb9('0x5'));var interaction=require(_0x5eb9('0x6'));var config=require(_0x5eb9('0x7'));var controller=require('./squareOdbc.controller');router[_0x5eb9('0x8')]('/',auth[_0x5eb9('0x9')](),controller[_0x5eb9('0xa')]);router[_0x5eb9('0x8')](_0x5eb9('0xb'),auth[_0x5eb9('0x9')](),controller[_0x5eb9('0xc')]);router[_0x5eb9('0x8')](_0x5eb9('0xd'),auth['isAuthenticated'](),timeout(_0x5eb9('0xe')),controller[_0x5eb9('0xf')]);router[_0x5eb9('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5eb9('0x11')](_0x5eb9('0xb'),auth[_0x5eb9('0x9')](),controller[_0x5eb9('0x12')]);router[_0x5eb9('0x13')](_0x5eb9('0xb'),auth[_0x5eb9('0x9')](),controller['destroy']);module[_0x5eb9('0x14')]=router; \ No newline at end of file +var _0xf75c=['fs-extra','isAuthenticated','index','get','/:id','/:id/test','test','post','create','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x5d5da4,_0x372480){var _0x191231=function(_0xca1dc6){while(--_0xca1dc6){_0x5d5da4['push'](_0x5d5da4['shift']());}};_0x191231(++_0x372480);}(_0xf75c,0x8e));var _0xcf75=function(_0x42e9c3,_0x4f1c46){_0x42e9c3=_0x42e9c3-0x0;var _0x1a41d2=_0xf75c[_0x42e9c3];return _0x1a41d2;};'use strict';var multer=require('multer');var util=require(_0xcf75('0x0'));var path=require('path');var timeout=require(_0xcf75('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcf75('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router['get']('/',auth[_0xcf75('0x3')](),controller[_0xcf75('0x4')]);router[_0xcf75('0x5')](_0xcf75('0x6'),auth[_0xcf75('0x3')](),controller['show']);router['get'](_0xcf75('0x7'),auth[_0xcf75('0x3')](),timeout('15s'),controller[_0xcf75('0x8')]);router[_0xcf75('0x9')]('/',auth[_0xcf75('0x3')](),controller[_0xcf75('0xa')]);router[_0xcf75('0xb')](_0xcf75('0x6'),auth[_0xcf75('0x3')](),controller[_0xcf75('0xc')]);router[_0xcf75('0xd')](_0xcf75('0x6'),auth['isAuthenticated'](),controller[_0xcf75('0xe')]);module[_0xcf75('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 0269ae9..eecb7de 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 _0x5b94=['name','sequelize','exports','STRING'];(function(_0xef8d0,_0x1ef7c9){var _0x13e9f1=function(_0x4072ea){while(--_0x4072ea){_0xef8d0['push'](_0xef8d0['shift']());}};_0x13e9f1(++_0x1ef7c9);}(_0x5b94,0x16d));var _0x45b9=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x5b94[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0x45b9('0x0'));module[_0x45b9('0x1')]={'name':{'type':Sequelize[_0x45b9('0x2')],'unique':_0x45b9('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x45b9('0x2')]},'description':{'type':Sequelize[_0x45b9('0x2')]}}; \ No newline at end of file +var _0xedbb=['STRING','exports','name'];(function(_0xc63e0b,_0x5a086e){var _0x28b3b2=function(_0x454de3){while(--_0x454de3){_0xc63e0b['push'](_0xc63e0b['shift']());}};_0x28b3b2(++_0x5a086e);}(_0xedbb,0x14b));var _0xbedb=function(_0x567ed9,_0x1b79b2){_0x567ed9=_0x567ed9-0x0;var _0x1aedcc=_0xedbb[_0x567ed9];return _0x1aedcc;};'use strict';var Sequelize=require('sequelize');module[_0xbedb('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xbedb('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xbedb('0x2')]},'description':{'type':Sequelize[_0xbedb('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index cc93025..ee6d73e 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 _0xa509=['offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','rows','catch','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','closeSync','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0xa509,0x138));var _0x9a50=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa509[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a50('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a50('0x1'));var rp=require(_0x9a50('0x2'));var moment=require('moment');var BPromise=require(_0x9a50('0x3'));var Mustache=require('mustache');var util=require(_0x9a50('0x4'));var path=require(_0x9a50('0x5'));var sox=require(_0x9a50('0x6'));var csv=require(_0x9a50('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a50('0x8'));var _=require('lodash');var squel=require(_0x9a50('0x9'));var crypto=require(_0x9a50('0xa'));var jsforce=require(_0x9a50('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9a50('0x7'));var querystring=require('querystring');var Papa=require(_0x9a50('0xc'));var Redis=require(_0x9a50('0xd'));var authService=require(_0x9a50('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9a50('0xf'));var hardwareService=require(_0x9a50('0x10'));var logger=require(_0x9a50('0x11'))('api');var utils=require(_0x9a50('0x12'));var config=require(_0x9a50('0x13'));var licenseUtil=require(_0x9a50('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f809b,_0x38d415){_0x38d415=_0x38d415||0xcc;return function(_0x44c3e4){if(_0x44c3e4){return _0x2f809b[_0x9a50('0x15')](_0x38d415);}return _0x2f809b[_0x9a50('0x16')](_0x38d415)['end']();};}function respondWithResult(_0x396222,_0x12d98e){_0x12d98e=_0x12d98e||0xc8;return function(_0x1150c5){if(_0x1150c5){return _0x396222[_0x9a50('0x16')](_0x12d98e)[_0x9a50('0x17')](_0x1150c5);}};}function respondWithFilteredResult(_0x4c2654,_0x555f4f){return function(_0x9b31fd){if(_0x9b31fd){var _0x115477=typeof _0x555f4f[_0x9a50('0x18')]===_0x9a50('0x19')&&typeof _0x555f4f[_0x9a50('0x1a')]===_0x9a50('0x19');var _0x40cd7a=_0x9b31fd[_0x9a50('0x1b')];var _0xd91b5e=_0x115477?0x0:_0x555f4f[_0x9a50('0x18')];var _0x4521eb=_0x115477?_0x9b31fd['count']:_0x555f4f[_0x9a50('0x18')]+_0x555f4f[_0x9a50('0x1a')];var _0x291050;if(_0x4521eb>=_0x40cd7a){_0x4521eb=_0x40cd7a;_0x291050=0xc8;}else{_0x291050=0xce;}_0x4c2654[_0x9a50('0x16')](_0x291050);return _0x4c2654[_0x9a50('0x1c')]('Content-Range',_0xd91b5e+'-'+_0x4521eb+'/'+_0x40cd7a)[_0x9a50('0x17')](_0x9b31fd);}return null;};}function patchUpdates(_0x29daa6){return function(_0x219a14){try{jsonpatch[_0x9a50('0x1d')](_0x219a14,_0x29daa6,!![]);}catch(_0x3b2ae7){return BPromise[_0x9a50('0x1e')](_0x3b2ae7);}return _0x219a14[_0x9a50('0x1f')]();};}function saveUpdates(_0x1f8202,_0x1e0442){return function(_0x39b6d3){if(_0x39b6d3){return _0x39b6d3[_0x9a50('0x20')](_0x1f8202)[_0x9a50('0x21')](function(_0x111529){return _0x111529;});}return null;};}function removeEntity(_0x580553,_0x3dbebd){return function(_0x30b0a5){if(_0x30b0a5){return _0x30b0a5[_0x9a50('0x22')]()[_0x9a50('0x21')](function(){var _0xb363e9=_0x30b0a5[_0x9a50('0x23')]({'plain':!![]});var _0x3b91c0=_0x9a50('0x24');return db[_0x9a50('0x25')][_0x9a50('0x22')]({'where':{'type':_0x3b91c0,'resourceId':_0xb363e9['id']}})[_0x9a50('0x21')](function(){return _0x30b0a5;});})[_0x9a50('0x21')](function(){_0x580553[_0x9a50('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7af9f6,_0x462c1d){return function(_0x459646){if(!_0x459646){_0x7af9f6[_0x9a50('0x15')](0x194);}return _0x459646;};}function handleError(_0x586576,_0xdcb1d5){_0xdcb1d5=_0xdcb1d5||0x1f4;return function(_0x78e26e){logger[_0x9a50('0x26')](_0x78e26e[_0x9a50('0x27')]);if(_0x78e26e[_0x9a50('0x28')]){delete _0x78e26e[_0x9a50('0x28')];}_0x586576[_0x9a50('0x16')](_0xdcb1d5)[_0x9a50('0x29')](_0x78e26e);};}exports[_0x9a50('0x2a')]=function(_0x27b9a6,_0x4dadcb){var _0x2626b5={},_0x5c088d={},_0x23d74f={'count':0x0,'rows':[]};var _0x426753=_[_0x9a50('0x2b')](db[_0x9a50('0x2c')][_0x9a50('0x2d')],function(_0x48ba1b){return{'name':_0x48ba1b[_0x9a50('0x2e')],'type':_0x48ba1b[_0x9a50('0x2f')][_0x9a50('0x30')]};});_0x5c088d[_0x9a50('0x31')]=_[_0x9a50('0x2b')](_0x426753,_0x9a50('0x28'));_0x5c088d['query']=_[_0x9a50('0x32')](_0x27b9a6[_0x9a50('0x33')]);_0x5c088d[_0x9a50('0x34')]=_[_0x9a50('0x35')](_0x5c088d[_0x9a50('0x31')],_0x5c088d[_0x9a50('0x33')]);_0x2626b5['attributes']=_['intersection'](_0x5c088d[_0x9a50('0x31')],qs[_0x9a50('0x36')](_0x27b9a6[_0x9a50('0x33')]['fields']));_0x2626b5['attributes']=_0x2626b5['attributes'][_0x9a50('0x37')]?_0x2626b5[_0x9a50('0x38')]:_0x5c088d[_0x9a50('0x31')];if(!_0x27b9a6['query'][_0x9a50('0x39')](_0x9a50('0x3a'))){_0x2626b5[_0x9a50('0x1a')]=qs[_0x9a50('0x1a')](_0x27b9a6[_0x9a50('0x33')]['limit']);_0x2626b5[_0x9a50('0x18')]=qs[_0x9a50('0x18')](_0x27b9a6[_0x9a50('0x33')][_0x9a50('0x18')]);}_0x2626b5['order']=qs[_0x9a50('0x3b')](_0x27b9a6[_0x9a50('0x33')]['sort']);_0x2626b5[_0x9a50('0x3c')]=qs[_0x9a50('0x34')](_[_0x9a50('0x3d')](_0x27b9a6[_0x9a50('0x33')],_0x5c088d[_0x9a50('0x34')]),_0x426753);if(_0x27b9a6['query']['filter']){_0x2626b5['where']=_['merge'](_0x2626b5[_0x9a50('0x3c')],{'$or':_['map'](_0x426753,function(_0xee3906){if(_0xee3906[_0x9a50('0x2f')]!==_0x9a50('0x3e')){var _0x427919={};_0x427919[_0xee3906[_0x9a50('0x28')]]={'$like':'%'+_0x27b9a6['query'][_0x9a50('0x3f')]+'%'};return _0x427919;}})});}_0x2626b5=_[_0x9a50('0x40')]({},_0x2626b5,_0x27b9a6['options']);var _0x574ce0={'where':_0x2626b5['where']};return db['SquareOdbc'][_0x9a50('0x1b')](_0x574ce0)[_0x9a50('0x21')](function(_0x701931){_0x23d74f[_0x9a50('0x1b')]=_0x701931;if(_0x27b9a6[_0x9a50('0x33')][_0x9a50('0x41')]){_0x2626b5[_0x9a50('0x42')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x2626b5);})['then'](function(_0x4afd8a){_0x23d74f[_0x9a50('0x43')]=_0x4afd8a;return _0x23d74f;})[_0x9a50('0x21')](respondWithFilteredResult(_0x4dadcb,_0x2626b5))[_0x9a50('0x44')](handleError(_0x4dadcb,null));};exports['show']=function(_0x55af16,_0x38fd41){var _0x12fd29={'raw':!![],'where':{'id':_0x55af16[_0x9a50('0x45')]['id']}},_0x3e6212={};_0x3e6212[_0x9a50('0x31')]=_[_0x9a50('0x32')](db[_0x9a50('0x2c')][_0x9a50('0x2d')]);_0x3e6212['query']=_[_0x9a50('0x32')](_0x55af16[_0x9a50('0x33')]);_0x3e6212[_0x9a50('0x34')]=_[_0x9a50('0x35')](_0x3e6212[_0x9a50('0x31')],_0x3e6212[_0x9a50('0x33')]);_0x12fd29[_0x9a50('0x38')]=_['intersection'](_0x3e6212[_0x9a50('0x31')],qs[_0x9a50('0x36')](_0x55af16['query'][_0x9a50('0x36')]));_0x12fd29['attributes']=_0x12fd29[_0x9a50('0x38')][_0x9a50('0x37')]?_0x12fd29['attributes']:_0x3e6212[_0x9a50('0x31')];if(_0x55af16[_0x9a50('0x33')]['includeAll']){_0x12fd29[_0x9a50('0x42')]=[{'all':!![]}];}_0x12fd29=_[_0x9a50('0x40')]({},_0x12fd29,_0x55af16[_0x9a50('0x46')]);return db[_0x9a50('0x2c')][_0x9a50('0x47')](_0x12fd29)[_0x9a50('0x21')](handleEntityNotFound(_0x38fd41,null))[_0x9a50('0x21')](respondWithResult(_0x38fd41,null))[_0x9a50('0x44')](handleError(_0x38fd41,null));};exports[_0x9a50('0x48')]=function(_0x478d5e,_0x3ce4c4){return db['SquareOdbc'][_0x9a50('0x48')](_0x478d5e['body'],{})[_0x9a50('0x21')](function(_0x4b35ea){var _0x355138=_0x478d5e[_0x9a50('0x49')][_0x9a50('0x23')]({'plain':!![]});if(!_0x355138)throw new Error(_0x9a50('0x4a'));if(_0x355138[_0x9a50('0x4b')]==='user'){var _0x217c59=_0x4b35ea[_0x9a50('0x23')]({'plain':!![]});var _0x4ecbe0='ODBC';return db[_0x9a50('0x4c')][_0x9a50('0x47')]({'where':{'name':_0x4ecbe0,'userProfileId':_0x355138['userProfileId']},'raw':!![]})[_0x9a50('0x21')](function(_0x57e139){if(_0x57e139&&_0x57e139[_0x9a50('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x217c59['name'],'resourceId':_0x217c59['id'],'type':_0x57e139['name'],'sectionId':_0x57e139['id']},{})[_0x9a50('0x21')](function(){return _0x4b35ea;});}else{return _0x4b35ea;}})['catch'](function(_0x73a7a0){logger['error'](_0x9a50('0x4e'),_0x73a7a0);throw _0x73a7a0;});}return _0x4b35ea;})[_0x9a50('0x21')](respondWithResult(_0x3ce4c4,0xc9))[_0x9a50('0x44')](handleError(_0x3ce4c4,null));};exports['update']=function(_0x10115f,_0x1c4a5e){if(_0x10115f[_0x9a50('0x4f')]['id']){delete _0x10115f['body']['id'];}return db[_0x9a50('0x2c')][_0x9a50('0x47')]({'where':{'id':_0x10115f[_0x9a50('0x45')]['id']}})[_0x9a50('0x21')](handleEntityNotFound(_0x1c4a5e,null))[_0x9a50('0x21')](saveUpdates(_0x10115f[_0x9a50('0x4f')],null))[_0x9a50('0x21')](respondWithResult(_0x1c4a5e,null))[_0x9a50('0x44')](handleError(_0x1c4a5e,null));};exports[_0x9a50('0x22')]=function(_0x59ecca,_0x2d3992){return db[_0x9a50('0x2c')][_0x9a50('0x47')]({'where':{'id':_0x59ecca[_0x9a50('0x45')]['id']}})[_0x9a50('0x21')](handleEntityNotFound(_0x2d3992,null))[_0x9a50('0x21')](removeEntity(_0x2d3992,null))[_0x9a50('0x44')](handleError(_0x2d3992,null));};exports[_0x9a50('0x50')]=function(_0x387acb,_0x2a9528,_0x31367d){var _0x2c0cf0;return db[_0x9a50('0x2c')][_0x9a50('0x47')]({'where':{'id':_0x387acb['params']['id']},'attributes':['id',_0x9a50('0x51')]})[_0x9a50('0x21')](handleEntityNotFound(_0x2a9528,null))[_0x9a50('0x21')](function(_0x481029){if(_0x481029){var _0x3fc9ff=require(_0x9a50('0x52'))();_0x3fc9ff['openSync'](_0x481029['dsn']);_0x3fc9ff[_0x9a50('0x53')]();return _0x481029;}})[_0x9a50('0x21')](respondWithResult(_0x2a9528,null))[_0x9a50('0x44')](handleError(_0x2a9528,null));}; \ No newline at end of file +var _0xbb20=['send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','dsn','rimraf','zip-dir','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','save','update','then','get','ODBC','destroy','stack','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb20,0xc8));var _0x0bb2=function(_0x34f499,_0xd8ff6e){_0x34f499=_0x34f499-0x0;var _0x2be65b=_0xbb20[_0x34f499];return _0x2be65b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bb2('0x0'));var zipdir=require(_0x0bb2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0bb2('0x2'));var path=require(_0x0bb2('0x3'));var sox=require(_0x0bb2('0x4'));var csv=require(_0x0bb2('0x5'));var ejs=require(_0x0bb2('0x6'));var fs=require('fs');var fs_extra=require(_0x0bb2('0x7'));var _=require(_0x0bb2('0x8'));var squel=require(_0x0bb2('0x9'));var crypto=require(_0x0bb2('0xa'));var jsforce=require(_0x0bb2('0xb'));var deskjs=require(_0x0bb2('0xc'));var toCsv=require(_0x0bb2('0x5'));var querystring=require(_0x0bb2('0xd'));var Papa=require(_0x0bb2('0xe'));var Redis=require('ioredis');var authService=require(_0x0bb2('0xf'));var qs=require(_0x0bb2('0x10'));var as=require(_0x0bb2('0x11'));var hardwareService=require(_0x0bb2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0bb2('0x13'));var config=require(_0x0bb2('0x14'));var licenseUtil=require(_0x0bb2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a6743,_0x5858ee){_0x5858ee=_0x5858ee||0xcc;return function(_0x525d62){if(_0x525d62){return _0x3a6743[_0x0bb2('0x16')](_0x5858ee);}return _0x3a6743[_0x0bb2('0x17')](_0x5858ee)[_0x0bb2('0x18')]();};}function respondWithResult(_0x433d11,_0x23adc4){_0x23adc4=_0x23adc4||0xc8;return function(_0xf19877){if(_0xf19877){return _0x433d11[_0x0bb2('0x17')](_0x23adc4)['json'](_0xf19877);}};}function respondWithFilteredResult(_0x2a1fe1,_0x3d2400){return function(_0x1722fd){if(_0x1722fd){var _0x2b614f=typeof _0x3d2400['offset']==='undefined'&&typeof _0x3d2400[_0x0bb2('0x19')]==='undefined';var _0x37b6b2=_0x1722fd[_0x0bb2('0x1a')];var _0x3295c8=_0x2b614f?0x0:_0x3d2400['offset'];var _0x42205e=_0x2b614f?_0x1722fd[_0x0bb2('0x1a')]:_0x3d2400[_0x0bb2('0x1b')]+_0x3d2400[_0x0bb2('0x19')];var _0x44cb70;if(_0x42205e>=_0x37b6b2){_0x42205e=_0x37b6b2;_0x44cb70=0xc8;}else{_0x44cb70=0xce;}_0x2a1fe1['status'](_0x44cb70);return _0x2a1fe1[_0x0bb2('0x1c')](_0x0bb2('0x1d'),_0x3295c8+'-'+_0x42205e+'/'+_0x37b6b2)[_0x0bb2('0x1e')](_0x1722fd);}return null;};}function patchUpdates(_0x1bc889){return function(_0x381278){try{jsonpatch[_0x0bb2('0x1f')](_0x381278,_0x1bc889,!![]);}catch(_0x5f21c9){return BPromise['reject'](_0x5f21c9);}return _0x381278[_0x0bb2('0x20')]();};}function saveUpdates(_0x2d7999,_0x2838e4){return function(_0x2a05c5){if(_0x2a05c5){return _0x2a05c5[_0x0bb2('0x21')](_0x2d7999)[_0x0bb2('0x22')](function(_0x196b53){return _0x196b53;});}return null;};}function removeEntity(_0x4a8273,_0x3917be){return function(_0x192423){if(_0x192423){return _0x192423['destroy']()[_0x0bb2('0x22')](function(){var _0x1fe78c=_0x192423[_0x0bb2('0x23')]({'plain':!![]});var _0x416d3e=_0x0bb2('0x24');return db['UserProfileResource'][_0x0bb2('0x25')]({'where':{'type':_0x416d3e,'resourceId':_0x1fe78c['id']}})[_0x0bb2('0x22')](function(){return _0x192423;});})[_0x0bb2('0x22')](function(){_0x4a8273[_0x0bb2('0x17')](0xcc)[_0x0bb2('0x18')]();});}};}function handleEntityNotFound(_0x433887,_0x787f29){return function(_0x3e19f3){if(!_0x3e19f3){_0x433887[_0x0bb2('0x16')](0x194);}return _0x3e19f3;};}function handleError(_0x32c13d,_0x226eb0){_0x226eb0=_0x226eb0||0x1f4;return function(_0xb67fa3){logger['error'](_0xb67fa3[_0x0bb2('0x26')]);if(_0xb67fa3[_0x0bb2('0x27')]){delete _0xb67fa3[_0x0bb2('0x27')];}_0x32c13d['status'](_0x226eb0)[_0x0bb2('0x28')](_0xb67fa3);};}exports[_0x0bb2('0x29')]=function(_0x36b2f8,_0xff285d){var _0x203ea8={},_0x399ed1={},_0x55c271={'count':0x0,'rows':[]};var _0x4d4b15=_[_0x0bb2('0x2a')](db[_0x0bb2('0x2b')][_0x0bb2('0x2c')],function(_0x2517ab){return{'name':_0x2517ab[_0x0bb2('0x2d')],'type':_0x2517ab['type'][_0x0bb2('0x2e')]};});_0x399ed1[_0x0bb2('0x2f')]=_[_0x0bb2('0x2a')](_0x4d4b15,_0x0bb2('0x27'));_0x399ed1[_0x0bb2('0x30')]=_['keys'](_0x36b2f8['query']);_0x399ed1[_0x0bb2('0x31')]=_[_0x0bb2('0x32')](_0x399ed1[_0x0bb2('0x2f')],_0x399ed1[_0x0bb2('0x30')]);_0x203ea8[_0x0bb2('0x33')]=_[_0x0bb2('0x32')](_0x399ed1['model'],qs[_0x0bb2('0x34')](_0x36b2f8['query'][_0x0bb2('0x34')]));_0x203ea8['attributes']=_0x203ea8['attributes'][_0x0bb2('0x35')]?_0x203ea8[_0x0bb2('0x33')]:_0x399ed1['model'];if(!_0x36b2f8[_0x0bb2('0x30')][_0x0bb2('0x36')]('nolimit')){_0x203ea8['limit']=qs[_0x0bb2('0x19')](_0x36b2f8[_0x0bb2('0x30')][_0x0bb2('0x19')]);_0x203ea8[_0x0bb2('0x1b')]=qs[_0x0bb2('0x1b')](_0x36b2f8[_0x0bb2('0x30')][_0x0bb2('0x1b')]);}_0x203ea8[_0x0bb2('0x37')]=qs[_0x0bb2('0x38')](_0x36b2f8[_0x0bb2('0x30')][_0x0bb2('0x38')]);_0x203ea8[_0x0bb2('0x39')]=qs[_0x0bb2('0x31')](_[_0x0bb2('0x3a')](_0x36b2f8[_0x0bb2('0x30')],_0x399ed1[_0x0bb2('0x31')]),_0x4d4b15);if(_0x36b2f8[_0x0bb2('0x30')][_0x0bb2('0x3b')]){_0x203ea8[_0x0bb2('0x39')]=_[_0x0bb2('0x3c')](_0x203ea8[_0x0bb2('0x39')],{'$or':_[_0x0bb2('0x2a')](_0x4d4b15,function(_0x354adc){if(_0x354adc['type']!=='VIRTUAL'){var _0x2520c5={};_0x2520c5[_0x354adc['name']]={'$like':'%'+_0x36b2f8[_0x0bb2('0x30')]['filter']+'%'};return _0x2520c5;}})});}_0x203ea8=_['merge']({},_0x203ea8,_0x36b2f8[_0x0bb2('0x3d')]);var _0xc16925={'where':_0x203ea8[_0x0bb2('0x39')]};return db['SquareOdbc'][_0x0bb2('0x1a')](_0xc16925)[_0x0bb2('0x22')](function(_0x292840){_0x55c271[_0x0bb2('0x1a')]=_0x292840;if(_0x36b2f8[_0x0bb2('0x30')][_0x0bb2('0x3e')]){_0x203ea8['include']=[{'all':!![]}];}return db[_0x0bb2('0x2b')][_0x0bb2('0x3f')](_0x203ea8);})[_0x0bb2('0x22')](function(_0x188c4c){_0x55c271['rows']=_0x188c4c;return _0x55c271;})['then'](respondWithFilteredResult(_0xff285d,_0x203ea8))[_0x0bb2('0x40')](handleError(_0xff285d,null));};exports[_0x0bb2('0x41')]=function(_0x336ce4,_0x257f73){var _0x1b04d7={'raw':!![],'where':{'id':_0x336ce4[_0x0bb2('0x42')]['id']}},_0x9d437d={};_0x9d437d[_0x0bb2('0x2f')]=_[_0x0bb2('0x43')](db['SquareOdbc']['rawAttributes']);_0x9d437d[_0x0bb2('0x30')]=_[_0x0bb2('0x43')](_0x336ce4[_0x0bb2('0x30')]);_0x9d437d[_0x0bb2('0x31')]=_['intersection'](_0x9d437d['model'],_0x9d437d[_0x0bb2('0x30')]);_0x1b04d7[_0x0bb2('0x33')]=_[_0x0bb2('0x32')](_0x9d437d[_0x0bb2('0x2f')],qs[_0x0bb2('0x34')](_0x336ce4[_0x0bb2('0x30')]['fields']));_0x1b04d7[_0x0bb2('0x33')]=_0x1b04d7[_0x0bb2('0x33')][_0x0bb2('0x35')]?_0x1b04d7[_0x0bb2('0x33')]:_0x9d437d[_0x0bb2('0x2f')];if(_0x336ce4[_0x0bb2('0x30')][_0x0bb2('0x3e')]){_0x1b04d7[_0x0bb2('0x44')]=[{'all':!![]}];}_0x1b04d7=_[_0x0bb2('0x3c')]({},_0x1b04d7,_0x336ce4[_0x0bb2('0x3d')]);return db['SquareOdbc']['find'](_0x1b04d7)[_0x0bb2('0x22')](handleEntityNotFound(_0x257f73,null))['then'](respondWithResult(_0x257f73,null))[_0x0bb2('0x40')](handleError(_0x257f73,null));};exports[_0x0bb2('0x45')]=function(_0x4ffeda,_0x400cf9){return db[_0x0bb2('0x2b')]['create'](_0x4ffeda[_0x0bb2('0x46')],{})[_0x0bb2('0x22')](function(_0x127d8c){var _0x22a44d=_0x4ffeda[_0x0bb2('0x47')][_0x0bb2('0x23')]({'plain':!![]});if(!_0x22a44d)throw new Error(_0x0bb2('0x48'));if(_0x22a44d[_0x0bb2('0x49')]===_0x0bb2('0x47')){var _0xa041ec=_0x127d8c['get']({'plain':!![]});var _0x540ac0=_0x0bb2('0x24');return db[_0x0bb2('0x4a')]['find']({'where':{'name':_0x540ac0,'userProfileId':_0x22a44d['userProfileId']},'raw':!![]})[_0x0bb2('0x22')](function(_0x144493){if(_0x144493&&_0x144493[_0x0bb2('0x4b')]===0x0){return db['UserProfileResource'][_0x0bb2('0x45')]({'name':_0xa041ec[_0x0bb2('0x27')],'resourceId':_0xa041ec['id'],'type':_0x144493[_0x0bb2('0x27')],'sectionId':_0x144493['id']},{})[_0x0bb2('0x22')](function(){return _0x127d8c;});}else{return _0x127d8c;}})['catch'](function(_0x448bf2){logger[_0x0bb2('0x4c')](_0x0bb2('0x4d'),_0x448bf2);throw _0x448bf2;});}return _0x127d8c;})[_0x0bb2('0x22')](respondWithResult(_0x400cf9,0xc9))[_0x0bb2('0x40')](handleError(_0x400cf9,null));};exports[_0x0bb2('0x21')]=function(_0x385ebe,_0xb208f3){if(_0x385ebe[_0x0bb2('0x46')]['id']){delete _0x385ebe['body']['id'];}return db[_0x0bb2('0x2b')][_0x0bb2('0x4e')]({'where':{'id':_0x385ebe[_0x0bb2('0x42')]['id']}})[_0x0bb2('0x22')](handleEntityNotFound(_0xb208f3,null))[_0x0bb2('0x22')](saveUpdates(_0x385ebe[_0x0bb2('0x46')],null))[_0x0bb2('0x22')](respondWithResult(_0xb208f3,null))[_0x0bb2('0x40')](handleError(_0xb208f3,null));};exports[_0x0bb2('0x25')]=function(_0x260b55,_0x15aa6a){return db[_0x0bb2('0x2b')][_0x0bb2('0x4e')]({'where':{'id':_0x260b55['params']['id']}})[_0x0bb2('0x22')](handleEntityNotFound(_0x15aa6a,null))[_0x0bb2('0x22')](removeEntity(_0x15aa6a,null))[_0x0bb2('0x40')](handleError(_0x15aa6a,null));};exports['test']=function(_0x10c8d0,_0x150ea1,_0xb7b8b4){var _0x5e9faa;return db[_0x0bb2('0x2b')][_0x0bb2('0x4e')]({'where':{'id':_0x10c8d0[_0x0bb2('0x42')]['id']},'attributes':['id',_0x0bb2('0x4f')]})['then'](handleEntityNotFound(_0x150ea1,null))[_0x0bb2('0x22')](function(_0x545264){if(_0x545264){var _0x12b947=require('odbc')();_0x12b947['openSync'](_0x545264[_0x0bb2('0x4f')]);_0x12b947['closeSync']();return _0x545264;}})['then'](respondWithResult(_0x150ea1,null))[_0x0bb2('0x40')](handleError(_0x150ea1,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 0f1ab3a..f502843 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 _0x3a5b=['path','rimraf','./squareOdbc.attributes','define','square_odbc','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x3a5b,0x12e));var _0xb3a5=function(_0xca78f1,_0x2c90c8){_0xca78f1=_0xca78f1-0x0;var _0xda435e=_0x3a5b[_0xca78f1];return _0xda435e;};'use strict';var _=require(_0xb3a5('0x0'));var util=require(_0xb3a5('0x1'));var logger=require('../../config/logger')(_0xb3a5('0x2'));var moment=require(_0xb3a5('0x3'));var BPromise=require(_0xb3a5('0x4'));var rp=require(_0xb3a5('0x5'));var fs=require('fs');var path=require(_0xb3a5('0x6'));var rimraf=require(_0xb3a5('0x7'));var config=require('../../config/environment');var attributes=require(_0xb3a5('0x8'));module['exports']=function(_0x258ea4,_0x201270){return _0x258ea4[_0xb3a5('0x9')]('SquareOdbc',attributes,{'tableName':_0xb3a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97d3=['moment','request-promise','path','../../config/environment','exports','define','square_odbc','lodash','util','api'];(function(_0x1f0e57,_0x3121ac){var _0x5cebab=function(_0x364987){while(--_0x364987){_0x1f0e57['push'](_0x1f0e57['shift']());}};_0x5cebab(++_0x3121ac);}(_0x97d3,0x197));var _0x397d=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x97d3[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x397d('0x0'));var util=require(_0x397d('0x1'));var logger=require('../../config/logger')(_0x397d('0x2'));var moment=require(_0x397d('0x3'));var BPromise=require('bluebird');var rp=require(_0x397d('0x4'));var fs=require('fs');var path=require(_0x397d('0x5'));var rimraf=require('rimraf');var config=require(_0x397d('0x6'));var attributes=require('./squareOdbc.attributes');module[_0x397d('0x7')]=function(_0x4e28e6,_0xc70375){return _0x4e28e6[_0x397d('0x8')]('SquareOdbc',attributes,{'tableName':_0x397d('0x9'),'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 054d58f..b26633d 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 _0x085c=['request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','info','ShowSquareOdbc','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','SquareOdbc,\x20%s,\x20%s'];(function(_0x213635,_0x63eb28){var _0x370ec2=function(_0x1b255d){while(--_0x1b255d){_0x213635['push'](_0x213635['shift']());}};_0x370ec2(++_0x63eb28);}(_0x085c,0x8f));var _0xc085=function(_0x42946c,_0x577d97){_0x42946c=_0x42946c-0x0;var _0x5d7687=_0x085c[_0x42946c];return _0x5d7687;};'use strict';var _=require(_0xc085('0x0'));var util=require(_0xc085('0x1'));var moment=require('moment');var BPromise=require(_0xc085('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc085('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc085('0x4'));var logger=require(_0xc085('0x5'))(_0xc085('0x6'));var config=require(_0xc085('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc085('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x325c31,_0x5bb444,_0x1dfb10){return new BPromise(function(_0x3727b8,_0x722a0a){return client[_0xc085('0x9')](_0x325c31,_0x1dfb10)[_0xc085('0xa')](function(_0x40b820){logger['info'](_0xc085('0xb'),_0x5bb444,_0xc085('0xc'));logger['debug'](_0xc085('0xd'),_0x5bb444,'request\x20sent',JSON[_0xc085('0xe')](_0x40b820));if(_0x40b820[_0xc085('0xf')]){if(_0x40b820['error'][_0xc085('0x10')]===0x1f4){logger[_0xc085('0xf')](_0xc085('0xb'),_0x5bb444,_0x40b820['error'][_0xc085('0x11')]);return _0x722a0a(_0x40b820[_0xc085('0xf')][_0xc085('0x11')]);}logger[_0xc085('0xf')](_0xc085('0xb'),_0x5bb444,_0x40b820['error'][_0xc085('0x11')]);return _0x3727b8(_0x40b820['error'][_0xc085('0x11')]);}else{logger['info'](_0xc085('0xb'),_0x5bb444,_0xc085('0xc'));_0x3727b8(_0x40b820[_0xc085('0x12')][_0xc085('0x11')]);}})[_0xc085('0x13')](function(_0x14494f){logger[_0xc085('0xf')](_0xc085('0xb'),_0x5bb444,_0x14494f);_0x722a0a(_0x14494f);});});}exports['ShowSquareOdbc']=function(_0x579570){var _0xda34df=this;return new Promise(function(_0x2c5186,_0x20a93e){return db[_0xc085('0x14')][_0xc085('0x15')]({'raw':_0x579570[_0xc085('0x16')]?_0x579570[_0xc085('0x16')][_0xc085('0x17')]===undefined?!![]:![]:!![],'where':_0x579570['options']?_0x579570[_0xc085('0x16')][_0xc085('0x18')]||null:null,'attributes':_0x579570[_0xc085('0x16')]?_0x579570['options'][_0xc085('0x19')]||null:null,'include':_0x579570[_0xc085('0x16')]?_0x579570['options'][_0xc085('0x1a')]?_[_0xc085('0x1b')](_0x579570[_0xc085('0x16')][_0xc085('0x1a')],function(_0xa07043){return{'model':db[_0xa07043[_0xc085('0x1c')]],'as':_0xa07043['as'],'attributes':_0xa07043['attributes'],'include':_0xa07043[_0xc085('0x1a')]?_[_0xc085('0x1b')](_0xa07043[_0xc085('0x1a')],function(_0x303cd0){return{'model':db[_0x303cd0[_0xc085('0x1c')]],'as':_0x303cd0['as'],'attributes':_0x303cd0[_0xc085('0x19')],'include':_0x303cd0[_0xc085('0x1a')]?_[_0xc085('0x1b')](_0x303cd0[_0xc085('0x1a')],function(_0x181232){return{'model':db[_0x181232[_0xc085('0x1c')]],'as':_0x181232['as'],'attributes':_0x181232[_0xc085('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc085('0xa')](function(_0xd174c0){logger[_0xc085('0x1d')](_0xc085('0x1e'),_0x579570);logger['debug'](_0xc085('0x1e'),_0x579570,JSON[_0xc085('0xe')](_0xd174c0));_0x2c5186(_0xd174c0);})[_0xc085('0x13')](function(_0x6392d1){logger[_0xc085('0xf')](_0xc085('0x1e'),_0x6392d1['message'],_0x579570);_0x20a93e(_0xda34df['error'](0x1f4,_0x6392d1[_0xc085('0x11')]));});});}; \ No newline at end of file +var _0x8503=['debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','include','map','model','then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x5d7023,_0x293ec7){var _0x4cc12f=function(_0x1fda5e){while(--_0x1fda5e){_0x5d7023['push'](_0x5d7023['shift']());}};_0x4cc12f(++_0x293ec7);}(_0x8503,0x19e));var _0x3850=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8503[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x3850('0x0'));var util=require(_0x3850('0x1'));var moment=require('moment');var BPromise=require(_0x3850('0x2'));var rs=require(_0x3850('0x3'));var fs=require('fs');var Redis=require(_0x3850('0x4'));var db=require(_0x3850('0x5'))['db'];var utils=require(_0x3850('0x6'));var logger=require(_0x3850('0x7'))(_0x3850('0x8'));var config=require('../../config/environment');var jayson=require(_0x3850('0x9'));var client=jayson['client'][_0x3850('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb1ea54,_0x23b4bc,_0x2f8d0a){return new BPromise(function(_0xeb09e4,_0x43c086){return client[_0x3850('0xb')](_0xb1ea54,_0x2f8d0a)['then'](function(_0x2165e0){logger[_0x3850('0xc')](_0x3850('0xd'),_0x23b4bc,_0x3850('0xe'));logger[_0x3850('0xf')](_0x3850('0x10'),_0x23b4bc,_0x3850('0xe'),JSON[_0x3850('0x11')](_0x2165e0));if(_0x2165e0['error']){if(_0x2165e0['error'][_0x3850('0x12')]===0x1f4){logger[_0x3850('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x23b4bc,_0x2165e0[_0x3850('0x13')][_0x3850('0x14')]);return _0x43c086(_0x2165e0[_0x3850('0x13')][_0x3850('0x14')]);}logger[_0x3850('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x23b4bc,_0x2165e0['error'][_0x3850('0x14')]);return _0xeb09e4(_0x2165e0[_0x3850('0x13')][_0x3850('0x14')]);}else{logger[_0x3850('0xc')](_0x3850('0xd'),_0x23b4bc,_0x3850('0xe'));_0xeb09e4(_0x2165e0[_0x3850('0x15')][_0x3850('0x14')]);}})['catch'](function(_0x63bf8){logger['error'](_0x3850('0xd'),_0x23b4bc,_0x63bf8);_0x43c086(_0x63bf8);});});}exports[_0x3850('0x16')]=function(_0x2defa4){var _0x4b9a28=this;return new Promise(function(_0x426da1,_0x252192){return db[_0x3850('0x17')][_0x3850('0x18')]({'raw':_0x2defa4['options']?_0x2defa4[_0x3850('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2defa4['options']?_0x2defa4[_0x3850('0x19')][_0x3850('0x1a')]||null:null,'attributes':_0x2defa4[_0x3850('0x19')]?_0x2defa4[_0x3850('0x19')][_0x3850('0x1b')]||null:null,'include':_0x2defa4['options']?_0x2defa4['options'][_0x3850('0x1c')]?_[_0x3850('0x1d')](_0x2defa4[_0x3850('0x19')][_0x3850('0x1c')],function(_0x304e3b){return{'model':db[_0x304e3b['model']],'as':_0x304e3b['as'],'attributes':_0x304e3b[_0x3850('0x1b')],'include':_0x304e3b[_0x3850('0x1c')]?_['map'](_0x304e3b[_0x3850('0x1c')],function(_0x3cebf0){return{'model':db[_0x3cebf0[_0x3850('0x1e')]],'as':_0x3cebf0['as'],'attributes':_0x3cebf0['attributes'],'include':_0x3cebf0[_0x3850('0x1c')]?_[_0x3850('0x1d')](_0x3cebf0[_0x3850('0x1c')],function(_0x55d372){return{'model':db[_0x55d372['model']],'as':_0x55d372['as'],'attributes':_0x55d372['attributes']};}):[]};}):[]};}):[]:[]})[_0x3850('0x1f')](function(_0x150b77){logger[_0x3850('0xc')]('ShowSquareOdbc',_0x2defa4);logger[_0x3850('0xf')](_0x3850('0x16'),_0x2defa4,JSON[_0x3850('0x11')](_0x150b77));_0x426da1(_0x150b77);})[_0x3850('0x20')](function(_0x4b1c8f){logger['error']('ShowSquareOdbc',_0x4b1c8f['message'],_0x2defa4);_0x252192(_0x4b9a28['error'](0x1f4,_0x4b1c8f[_0x3850('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 48ce814..1f0a80c 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 _0x3aee=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','getUsers','post','/:id/users','addUsers','put','removeUsers'];(function(_0x455d02,_0x4d36ad){var _0x33d193=function(_0x3fb8d3){while(--_0x3fb8d3){_0x455d02['push'](_0x455d02['shift']());}};_0x33d193(++_0x4d36ad);}(_0x3aee,0x131));var _0xe3ae=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x3aee[_0x492af5];return _0x59f529;};'use strict';var multer=require(_0xe3ae('0x0'));var util=require(_0xe3ae('0x1'));var path=require('path');var timeout=require(_0xe3ae('0x2'));var express=require(_0xe3ae('0x3'));var router=express[_0xe3ae('0x4')]();var fs_extra=require(_0xe3ae('0x5'));var auth=require(_0xe3ae('0x6'));var interaction=require(_0xe3ae('0x7'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xe3ae('0x8')]('/',auth[_0xe3ae('0x9')](),controller[_0xe3ae('0xa')]);router[_0xe3ae('0x8')](_0xe3ae('0xb'),auth[_0xe3ae('0x9')](),controller['show']);router[_0xe3ae('0x8')]('/:id/users',auth[_0xe3ae('0x9')](),controller[_0xe3ae('0xc')]);router[_0xe3ae('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xe3ae('0xe'),auth[_0xe3ae('0x9')](),controller[_0xe3ae('0xf')]);router[_0xe3ae('0x10')](_0xe3ae('0xb'),auth[_0xe3ae('0x9')](),controller['update']);router['delete'](_0xe3ae('0xb'),auth[_0xe3ae('0x9')](),controller['destroy']);router['delete'](_0xe3ae('0xe'),auth['isAuthenticated'](),controller[_0xe3ae('0x11')]);module[_0xe3ae('0x12')]=router; \ No newline at end of file +var _0xb4f4=['removeUsers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','getUsers','create','post','addUsers','/:id','update','delete','destroy'];(function(_0x5d732b,_0x1a60c2){var _0x3538c7=function(_0x2804fd){while(--_0x2804fd){_0x5d732b['push'](_0x5d732b['shift']());}};_0x3538c7(++_0x1a60c2);}(_0xb4f4,0xda));var _0x4b4f=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xb4f4[_0x2db12b];return _0x20990b;};'use strict';var multer=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var path=require('path');var timeout=require(_0x4b4f('0x2'));var express=require(_0x4b4f('0x3'));var router=express[_0x4b4f('0x4')]();var fs_extra=require(_0x4b4f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4b4f('0x6'));var config=require(_0x4b4f('0x7'));var controller=require(_0x4b4f('0x8'));router[_0x4b4f('0x9')]('/',auth[_0x4b4f('0xa')](),controller[_0x4b4f('0xb')]);router[_0x4b4f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4b4f('0xc')]);router[_0x4b4f('0x9')](_0x4b4f('0xd'),auth[_0x4b4f('0xa')](),controller[_0x4b4f('0xe')]);router['post']('/',auth[_0x4b4f('0xa')](),controller[_0x4b4f('0xf')]);router[_0x4b4f('0x10')]('/:id/users',auth[_0x4b4f('0xa')](),controller[_0x4b4f('0x11')]);router['put'](_0x4b4f('0x12'),auth[_0x4b4f('0xa')](),controller[_0x4b4f('0x13')]);router[_0x4b4f('0x14')](_0x4b4f('0x12'),auth[_0x4b4f('0xa')](),controller[_0x4b4f('0x15')]);router[_0x4b4f('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x4b4f('0x16')]);module[_0x4b4f('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 07d9ecf..539cae4 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 _0x889e=['name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','DATE','sequelize','exports'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x889e,0x77));var _0xe889=function(_0x430567,_0x5324c3){_0x430567=_0x430567-0x0;var _0x32d18e=_0x889e[_0x430567];return _0x32d18e;};'use strict';var Sequelize=require(_0xe889('0x0'));module[_0xe889('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe889('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xe889('0x3')]},'preproduction':{'type':Sequelize[_0xe889('0x4')](_0xe889('0x5')),'get':function(){if(this[_0xe889('0x6')](_0xe889('0x7'))){return this['getDataValue'](_0xe889('0x7'))[_0xe889('0x8')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xe889('0x5')),'get':function(){if(this[_0xe889('0x6')]('production')){return this['getDataValue']('production')[_0xe889('0x8')](_0xe889('0x9'));}}},'savedAt':{'type':Sequelize[_0xe889('0xa')]},'publishedAt':{'type':Sequelize[_0xe889('0xa')]}}; \ No newline at end of file +var _0x01db=['TEXT','long','getDataValue','preproduction','toString','utf8','BLOB','production','DATE','sequelize','name','STRING'];(function(_0x4e1128,_0x3983be){var _0x82da18=function(_0xe598e4){while(--_0xe598e4){_0x4e1128['push'](_0x4e1128['shift']());}};_0x82da18(++_0x3983be);}(_0x01db,0x171));var _0xb01d=function(_0x14312f,_0xae6852){_0x14312f=_0x14312f-0x0;var _0x75273=_0x01db[_0x14312f];return _0x75273;};'use strict';var Sequelize=require(_0xb01d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb01d('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xb01d('0x2')]},'notes':{'type':Sequelize[_0xb01d('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0xb01d('0x4')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0xb01d('0x5')](_0xb01d('0x6'))[_0xb01d('0x7')](_0xb01d('0x8'));}}},'production':{'type':Sequelize[_0xb01d('0x9')](_0xb01d('0x4')),'get':function(){if(this[_0xb01d('0x5')](_0xb01d('0xa'))){return this['getDataValue']('production')[_0xb01d('0x7')](_0xb01d('0x8'));}}},'savedAt':{'type':Sequelize[_0xb01d('0xb')]},'publishedAt':{'type':Sequelize[_0xb01d('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index e5fdb1a..9ba13fb 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 _0x187d=['register','sendStatus','status','json','offset','limit','undefined','count','set','update','destroy','then','get','SquareProjects','UserProfileResource','publish','agi','stringify','error','name','send','map','SquareProject','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','production','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','User','order','getUsers','hasOwnProperty','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./squareProject.socket'];(function(_0x240293,_0x48cffc){var _0x1fc514=function(_0x2b3b03){while(--_0x2b3b03){_0x240293['push'](_0x240293['shift']());}};_0x1fc514(++_0x48cffc);}(_0x187d,0x93));var _0xd187=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x187d[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0xd187('0x0'));var Redis=require('ioredis');var qs=require(_0xd187('0x1'));var logger=require(_0xd187('0x2'))(_0xd187('0x3'));var config=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];config[_0xd187('0x6')]=_['defaults'](config[_0xd187('0x6')],{'host':_0xd187('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd187('0x6')]));require(_0xd187('0x8'))[_0xd187('0x9')](socket);function respondWithStatusCode(_0x1d3fe4,_0x28ce2f){_0x28ce2f=_0x28ce2f||0xcc;return function(_0x2d6992){if(_0x2d6992){return _0x1d3fe4[_0xd187('0xa')](_0x28ce2f);}return _0x1d3fe4[_0xd187('0xb')](_0x28ce2f)['end']();};}function respondWithResult(_0x342539,_0x42848b){_0x42848b=_0x42848b||0xc8;return function(_0x4039f6){if(_0x4039f6){return _0x342539[_0xd187('0xb')](_0x42848b)[_0xd187('0xc')](_0x4039f6);}};}function respondWithFilteredResult(_0x2a61a4,_0x59c194){return function(_0x10d467){if(_0x10d467){var _0x412ccf=typeof _0x59c194[_0xd187('0xd')]==='undefined'&&typeof _0x59c194[_0xd187('0xe')]===_0xd187('0xf');var _0x32ba07=_0x10d467['count'];var _0x33e3d5=_0x412ccf?0x0:_0x59c194[_0xd187('0xd')];var _0x37870e=_0x412ccf?_0x10d467[_0xd187('0x10')]:_0x59c194['offset']+_0x59c194[_0xd187('0xe')];var _0x2050d5;if(_0x37870e>=_0x32ba07){_0x37870e=_0x32ba07;_0x2050d5=0xc8;}else{_0x2050d5=0xce;}_0x2a61a4[_0xd187('0xb')](_0x2050d5);return _0x2a61a4[_0xd187('0x11')]('Content-Range',_0x33e3d5+'-'+_0x37870e+'/'+_0x32ba07)[_0xd187('0xc')](_0x10d467);}return null;};}function saveUpdates(_0x52a208){return function(_0x5cf218){if(_0x5cf218){return _0x5cf218[_0xd187('0x12')](_0x52a208)['then'](function(_0x4ec155){return _0x4ec155;});}return null;};}function removeEntity(_0x207b36){return function(_0x2b3290){if(_0x2b3290){return _0x2b3290[_0xd187('0x13')]()[_0xd187('0x14')](function(){var _0x21df74=_0x2b3290[_0xd187('0x15')]({'plain':!![]});var _0x12b388=_0xd187('0x16');return db[_0xd187('0x17')][_0xd187('0x13')]({'where':{'type':_0x12b388,'resourceId':_0x21df74['id']}})[_0xd187('0x14')](function(){return _0x2b3290;});})[_0xd187('0x14')](function(){var _0x207978=new Redis(config['redis']);_0x207978[_0xd187('0x18')](_0xd187('0x19'),JSON[_0xd187('0x1a')]({'id':_0x2b3290['id'],'deleted':!![]}));})['then'](function(){_0x207b36['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x435d94){return function(_0x33741d){if(!_0x33741d){_0x435d94[_0xd187('0xa')](0x194);}return _0x33741d;};}function handleError(_0x4f62c8,_0x2c07c8){_0x2c07c8=_0x2c07c8||0x1f4;return function(_0x57186b){logger[_0xd187('0x1b')](_0x57186b['stack']);if(_0x57186b[_0xd187('0x1c')]){delete _0x57186b['name'];}_0x4f62c8['status'](_0x2c07c8)[_0xd187('0x1d')](_0x57186b);};}exports['index']=function(_0x12da33,_0x598aa4){var _0x4ace17={},_0x4eac6a={},_0x848ddd={'count':0x0,'rows':[]};var _0xeff822=_[_0xd187('0x1e')](db[_0xd187('0x1f')]['rawAttributes'],function(_0x2a20ed){return{'name':_0x2a20ed[_0xd187('0x20')],'type':_0x2a20ed['type'][_0xd187('0x21')]};});_0x4eac6a[_0xd187('0x22')]=_[_0xd187('0x1e')](_0xeff822,'name');_0x4eac6a[_0xd187('0x23')]=_['keys'](_0x12da33[_0xd187('0x23')]);_0x4eac6a[_0xd187('0x24')]=_[_0xd187('0x25')](_0x4eac6a[_0xd187('0x22')],_0x4eac6a['query']);_0x4ace17[_0xd187('0x26')]=_[_0xd187('0x25')](_0x4eac6a['model'],qs['fields'](_0x12da33[_0xd187('0x23')][_0xd187('0x27')]));_0x4ace17[_0xd187('0x26')]=_0x4ace17[_0xd187('0x26')][_0xd187('0x28')]?_0x4ace17[_0xd187('0x26')]:_0x4eac6a[_0xd187('0x22')];if(!_0x12da33[_0xd187('0x23')]['hasOwnProperty'](_0xd187('0x29'))){_0x4ace17[_0xd187('0xe')]=qs[_0xd187('0xe')](_0x12da33['query'][_0xd187('0xe')]);_0x4ace17['offset']=qs[_0xd187('0xd')](_0x12da33[_0xd187('0x23')][_0xd187('0xd')]);}_0x4ace17['order']=qs['sort'](_0x12da33[_0xd187('0x23')][_0xd187('0x2a')]);_0x4ace17['where']=qs[_0xd187('0x24')](_[_0xd187('0x2b')](_0x12da33[_0xd187('0x23')],_0x4eac6a['filters']),_0xeff822);if(_0x12da33['query'][_0xd187('0x2c')]){_0x4ace17[_0xd187('0x2d')]=_['merge'](_0x4ace17['where'],{'$or':_['map'](_0xeff822,function(_0x31d7f4){if(_0x31d7f4['type']!==_0xd187('0x2e')){var _0x35c381={};_0x35c381[_0x31d7f4['name']]={'$like':'%'+_0x12da33[_0xd187('0x23')]['filter']+'%'};return _0x35c381;}})});}_0x4ace17=_[_0xd187('0x2f')]({},_0x4ace17,_0x12da33[_0xd187('0x30')]);var _0x4af59f={'where':_0x4ace17[_0xd187('0x2d')]};return db[_0xd187('0x1f')]['count'](_0x4af59f)[_0xd187('0x14')](function(_0x5ec6cd){_0x848ddd['count']=_0x5ec6cd;if(_0x12da33[_0xd187('0x23')][_0xd187('0x31')]){_0x4ace17[_0xd187('0x32')]=[{'all':!![]}];}return db[_0xd187('0x1f')][_0xd187('0x33')](_0x4ace17);})['then'](function(_0x8860c){_0x848ddd[_0xd187('0x34')]=_0x8860c;return _0x848ddd;})[_0xd187('0x14')](respondWithFilteredResult(_0x598aa4,_0x4ace17))['catch'](handleError(_0x598aa4,null));};exports['show']=function(_0x538c05,_0x595195){var _0x21bb3c={'raw':![],'where':{'id':_0x538c05[_0xd187('0x35')]['id']}},_0x41bcbc={};_0x41bcbc[_0xd187('0x22')]=_[_0xd187('0x36')](db[_0xd187('0x1f')][_0xd187('0x37')]);_0x41bcbc[_0xd187('0x23')]=_['keys'](_0x538c05[_0xd187('0x23')]);_0x41bcbc[_0xd187('0x24')]=_[_0xd187('0x25')](_0x41bcbc['model'],_0x41bcbc[_0xd187('0x23')]);_0x21bb3c['attributes']=_[_0xd187('0x25')](_0x41bcbc[_0xd187('0x22')],qs[_0xd187('0x27')](_0x538c05[_0xd187('0x23')][_0xd187('0x27')]));_0x21bb3c['attributes']=_0x21bb3c[_0xd187('0x26')][_0xd187('0x28')]?_0x21bb3c[_0xd187('0x26')]:_0x41bcbc[_0xd187('0x22')];if(_0x538c05['query'][_0xd187('0x31')]){_0x21bb3c[_0xd187('0x32')]=[{'all':!![]}];}_0x21bb3c=_['merge']({},_0x21bb3c,_0x538c05[_0xd187('0x30')]);return db[_0xd187('0x1f')]['find'](_0x21bb3c)['then'](handleEntityNotFound(_0x595195,null))[_0xd187('0x14')](respondWithResult(_0x595195,null))[_0xd187('0x38')](handleError(_0x595195,null));};exports['create']=function(_0x4c9c5f,_0x4f616d){return db[_0xd187('0x1f')][_0xd187('0x39')](_0x4c9c5f[_0xd187('0x3a')],{})[_0xd187('0x14')](function(_0x321b86){var _0x60062b=_0x4c9c5f[_0xd187('0x3b')]['get']({'plain':!![]});if(!_0x60062b)throw new Error(_0xd187('0x3c'));if(_0x60062b[_0xd187('0x3d')]===_0xd187('0x3b')){var _0x3ce4a1=_0x321b86[_0xd187('0x15')]({'plain':!![]});var _0x2dc84f=_0xd187('0x16');return db[_0xd187('0x3e')]['find']({'where':{'name':_0x2dc84f,'userProfileId':_0x60062b[_0xd187('0x3f')]},'raw':!![]})[_0xd187('0x14')](function(_0x4523c8){if(_0x4523c8&&_0x4523c8[_0xd187('0x40')]===0x0){return db[_0xd187('0x17')]['create']({'name':_0x3ce4a1[_0xd187('0x1c')],'resourceId':_0x3ce4a1['id'],'type':_0x4523c8[_0xd187('0x1c')],'sectionId':_0x4523c8['id']},{})['then'](function(){return _0x321b86;});}else{return _0x321b86;}})[_0xd187('0x38')](function(_0xd9635d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd9635d);throw _0xd9635d;});}return _0x321b86;})['then'](respondWithResult(_0x4f616d,0xc9))['catch'](handleError(_0x4f616d,null));};exports[_0xd187('0x12')]=function(_0x22f432,_0x12d448){if(_0x22f432[_0xd187('0x3a')]['id']){delete _0x22f432[_0xd187('0x3a')]['id'];}return db[_0xd187('0x1f')][_0xd187('0x41')]({'where':{'id':_0x22f432['params']['id']}})[_0xd187('0x14')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x14')](saveUpdates(_0x22f432[_0xd187('0x3a')],null))[_0xd187('0x14')](function(_0x499d72){if(!_0x499d72)return;var _0x9b6006=_0x499d72['get']({'plain':!![]});return _0x9b6006;})['then'](function(_0x3dc987){var _0x560e46=new Redis(config[_0xd187('0x6')]);_0x560e46[_0xd187('0x18')](_0xd187('0x19'),JSON[_0xd187('0x1a')](_[_0xd187('0x2b')](_0x3dc987,['id',_0xd187('0x1c'),_0xd187('0x42')])));return _0x3dc987;})[_0xd187('0x14')](respondWithResult(_0x12d448,null))[_0xd187('0x38')](handleError(_0x12d448,null));};exports['destroy']=function(_0x247583,_0x298a34){return db['SquareProject'][_0xd187('0x41')]({'where':{'id':_0x247583[_0xd187('0x35')]['id']}})[_0xd187('0x14')](handleEntityNotFound(_0x298a34,null))['then'](removeEntity(_0x298a34,null))[_0xd187('0x38')](handleError(_0x298a34,null));};exports[_0xd187('0x43')]=function(_0x50073d,_0x457da1){return db[_0xd187('0x1f')]['find']({'where':{'id':_0x50073d[_0xd187('0x35')]['id']}})['then'](handleEntityNotFound(_0x457da1,null))[_0xd187('0x14')](function(_0x43f1c0){if(_0x43f1c0){return _0x43f1c0[_0xd187('0x43')](_0x50073d[_0xd187('0x3a')][_0xd187('0x44')],_[_0xd187('0x45')](_0x50073d[_0xd187('0x3a')],['ids','id'])||{});}})[_0xd187('0x14')](respondWithResult(_0x457da1,null))[_0xd187('0x38')](handleError(_0x457da1,null));};exports[_0xd187('0x46')]=function(_0x56b36b,_0x374e30){return db[_0xd187('0x1f')][_0xd187('0x41')]({'where':{'id':_0x56b36b[_0xd187('0x35')]['id']}})[_0xd187('0x14')](handleEntityNotFound(_0x374e30,null))[_0xd187('0x14')](function(_0x10ebf4){if(_0x10ebf4){return _0x10ebf4[_0xd187('0x46')](_0x56b36b[_0xd187('0x23')][_0xd187('0x44')])[_0xd187('0x14')](function(){if(_[_0xd187('0x47')](_0x56b36b[_0xd187('0x23')][_0xd187('0x44')])){for(var _0x39934c=0x0;_0x39934c<_0x56b36b[_0xd187('0x23')][_0xd187('0x44')][_0xd187('0x28')];_0x39934c+=0x1){socket[_0xd187('0x48')](_0xd187('0x49'),{'UserId':Number(_0x56b36b['query'][_0xd187('0x44')][_0x39934c]),'SquareProjectId':Number(_0x56b36b['params']['id'])});}}else{socket[_0xd187('0x48')](_0xd187('0x49'),{'UserId':Number(_0x56b36b[_0xd187('0x23')][_0xd187('0x44')]),'SquareProjectId':Number(_0x56b36b['params']['id'])});}});}})[_0xd187('0x14')](respondWithStatusCode(_0x374e30,null))[_0xd187('0x38')](handleError(_0x374e30,null));};exports['getUsers']=function(_0x509815,_0x3613ee){var _0x2c2a62={};var _0x2870ad={};var _0x45e0fe;var _0x550bc0;return db[_0xd187('0x1f')]['findOne']({'where':{'id':_0x509815[_0xd187('0x35')]['id']}})[_0xd187('0x14')](handleEntityNotFound(_0x3613ee,null))[_0xd187('0x14')](function(_0x312852){if(_0x312852){_0x45e0fe=_0x312852;_0x2870ad['model']=_[_0xd187('0x36')](db[_0xd187('0x4a')][_0xd187('0x37')]);_0x2870ad[_0xd187('0x23')]=_[_0xd187('0x36')](_0x509815['query']);_0x2870ad['filters']=_[_0xd187('0x25')](_0x2870ad[_0xd187('0x22')],_0x2870ad[_0xd187('0x23')]);_0x2c2a62[_0xd187('0x26')]=_[_0xd187('0x25')](_0x2870ad[_0xd187('0x22')],qs[_0xd187('0x27')](_0x509815[_0xd187('0x23')][_0xd187('0x27')]));_0x2c2a62[_0xd187('0x26')]=_0x2c2a62[_0xd187('0x26')][_0xd187('0x28')]?_0x2c2a62['attributes']:_0x2870ad[_0xd187('0x22')];_0x2c2a62[_0xd187('0x4b')]=qs['sort'](_0x509815[_0xd187('0x23')][_0xd187('0x2a')]);_0x2c2a62['where']=qs['filters'](_[_0xd187('0x2b')](_0x509815[_0xd187('0x23')],_0x2870ad[_0xd187('0x24')]));if(_0x509815[_0xd187('0x23')]['filter']){_0x2c2a62[_0xd187('0x2d')]=_[_0xd187('0x2f')](_0x2c2a62['where'],{'$or':_['map'](_0x2c2a62[_0xd187('0x26')],function(_0x59ef7e){var _0x33c168={};_0x33c168[_0x59ef7e]={'$like':'%'+_0x509815[_0xd187('0x23')]['filter']+'%'};return _0x33c168;})});}_0x2c2a62=_[_0xd187('0x2f')]({},_0x2c2a62,_0x509815['options']);return _0x45e0fe[_0xd187('0x4c')](_0x2c2a62);}})['then'](function(_0x534d03){if(_0x534d03){_0x550bc0=_0x534d03['length'];if(!_0x509815[_0xd187('0x23')][_0xd187('0x4d')](_0xd187('0x29'))){_0x2c2a62[_0xd187('0xe')]=qs[_0xd187('0xe')](_0x509815[_0xd187('0x23')][_0xd187('0xe')]);_0x2c2a62[_0xd187('0xd')]=qs['offset'](_0x509815[_0xd187('0x23')][_0xd187('0xd')]);}return _0x45e0fe[_0xd187('0x4c')](_0x2c2a62);}})['then'](function(_0x130d70){if(_0x130d70){return _0x130d70?{'count':_0x550bc0,'rows':_0x130d70}:null;}})[_0xd187('0x14')](respondWithResult(_0x3613ee,null))[_0xd187('0x38')](handleError(_0x3613ee,null));}; \ No newline at end of file +var _0x66fa=['nolimit','limit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./squareProject.socket','register','sendStatus','end','undefined','count','status','set','Content-Range','json','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x66fa,0x117));var _0xa66f=function(_0x10b34e,_0x19c8b7){_0x10b34e=_0x10b34e-0x0;var _0x334b95=_0x66fa[_0x10b34e];return _0x334b95;};'use strict';var _=require(_0xa66f('0x0'));var Redis=require(_0xa66f('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xa66f('0x2'))(_0xa66f('0x3'));var config=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];config[_0xa66f('0x6')]=_[_0xa66f('0x7')](config[_0xa66f('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa66f('0x6')]));require(_0xa66f('0x8'))[_0xa66f('0x9')](socket);function respondWithStatusCode(_0x1d02fc,_0x38b58b){_0x38b58b=_0x38b58b||0xcc;return function(_0x5096bf){if(_0x5096bf){return _0x1d02fc[_0xa66f('0xa')](_0x38b58b);}return _0x1d02fc['status'](_0x38b58b)[_0xa66f('0xb')]();};}function respondWithResult(_0x597c7c,_0x101e10){_0x101e10=_0x101e10||0xc8;return function(_0x53ca76){if(_0x53ca76){return _0x597c7c['status'](_0x101e10)['json'](_0x53ca76);}};}function respondWithFilteredResult(_0x1e1997,_0x825868){return function(_0x4979c6){if(_0x4979c6){var _0x14d31e=typeof _0x825868['offset']===_0xa66f('0xc')&&typeof _0x825868['limit']===_0xa66f('0xc');var _0x14af70=_0x4979c6[_0xa66f('0xd')];var _0x4ebd7b=_0x14d31e?0x0:_0x825868['offset'];var _0x215ffa=_0x14d31e?_0x4979c6['count']:_0x825868['offset']+_0x825868['limit'];var _0x3ac0ac;if(_0x215ffa>=_0x14af70){_0x215ffa=_0x14af70;_0x3ac0ac=0xc8;}else{_0x3ac0ac=0xce;}_0x1e1997[_0xa66f('0xe')](_0x3ac0ac);return _0x1e1997[_0xa66f('0xf')](_0xa66f('0x10'),_0x4ebd7b+'-'+_0x215ffa+'/'+_0x14af70)[_0xa66f('0x11')](_0x4979c6);}return null;};}function saveUpdates(_0x567d4f){return function(_0x5510dc){if(_0x5510dc){return _0x5510dc[_0xa66f('0x12')](_0x567d4f)[_0xa66f('0x13')](function(_0x295acf){return _0x295acf;});}return null;};}function removeEntity(_0x403f4d){return function(_0x5c67f5){if(_0x5c67f5){return _0x5c67f5[_0xa66f('0x14')]()['then'](function(){var _0x4a28d4=_0x5c67f5[_0xa66f('0x15')]({'plain':!![]});var _0x413e80=_0xa66f('0x16');return db[_0xa66f('0x17')][_0xa66f('0x14')]({'where':{'type':_0x413e80,'resourceId':_0x4a28d4['id']}})[_0xa66f('0x13')](function(){return _0x5c67f5;});})[_0xa66f('0x13')](function(){var _0x150291=new Redis(config[_0xa66f('0x6')]);_0x150291[_0xa66f('0x18')](_0xa66f('0x19'),JSON[_0xa66f('0x1a')]({'id':_0x5c67f5['id'],'deleted':!![]}));})[_0xa66f('0x13')](function(){_0x403f4d[_0xa66f('0xe')](0xcc)[_0xa66f('0xb')]();});}};}function handleEntityNotFound(_0x5cd613){return function(_0x27f570){if(!_0x27f570){_0x5cd613[_0xa66f('0xa')](0x194);}return _0x27f570;};}function handleError(_0x40ee00,_0x37ee13){_0x37ee13=_0x37ee13||0x1f4;return function(_0x5cbd82){logger[_0xa66f('0x1b')](_0x5cbd82[_0xa66f('0x1c')]);if(_0x5cbd82[_0xa66f('0x1d')]){delete _0x5cbd82[_0xa66f('0x1d')];}_0x40ee00['status'](_0x37ee13)['send'](_0x5cbd82);};}exports[_0xa66f('0x1e')]=function(_0x598942,_0x3a3e4f){var _0xc661f2={},_0x384164={},_0x57da7f={'count':0x0,'rows':[]};var _0x4683c7=_[_0xa66f('0x1f')](db[_0xa66f('0x20')][_0xa66f('0x21')],function(_0x17c103){return{'name':_0x17c103[_0xa66f('0x22')],'type':_0x17c103[_0xa66f('0x23')][_0xa66f('0x24')]};});_0x384164[_0xa66f('0x25')]=_[_0xa66f('0x1f')](_0x4683c7,_0xa66f('0x1d'));_0x384164[_0xa66f('0x26')]=_[_0xa66f('0x27')](_0x598942[_0xa66f('0x26')]);_0x384164['filters']=_['intersection'](_0x384164[_0xa66f('0x25')],_0x384164[_0xa66f('0x26')]);_0xc661f2['attributes']=_[_0xa66f('0x28')](_0x384164[_0xa66f('0x25')],qs['fields'](_0x598942[_0xa66f('0x26')][_0xa66f('0x29')]));_0xc661f2[_0xa66f('0x2a')]=_0xc661f2[_0xa66f('0x2a')][_0xa66f('0x2b')]?_0xc661f2['attributes']:_0x384164[_0xa66f('0x25')];if(!_0x598942['query'][_0xa66f('0x2c')](_0xa66f('0x2d'))){_0xc661f2[_0xa66f('0x2e')]=qs['limit'](_0x598942[_0xa66f('0x26')][_0xa66f('0x2e')]);_0xc661f2['offset']=qs[_0xa66f('0x2f')](_0x598942[_0xa66f('0x26')][_0xa66f('0x2f')]);}_0xc661f2[_0xa66f('0x30')]=qs[_0xa66f('0x31')](_0x598942[_0xa66f('0x26')][_0xa66f('0x31')]);_0xc661f2[_0xa66f('0x32')]=qs[_0xa66f('0x33')](_[_0xa66f('0x34')](_0x598942['query'],_0x384164[_0xa66f('0x33')]),_0x4683c7);if(_0x598942['query'][_0xa66f('0x35')]){_0xc661f2[_0xa66f('0x32')]=_[_0xa66f('0x36')](_0xc661f2[_0xa66f('0x32')],{'$or':_[_0xa66f('0x1f')](_0x4683c7,function(_0x201432){if(_0x201432[_0xa66f('0x23')]!==_0xa66f('0x37')){var _0x54d740={};_0x54d740[_0x201432[_0xa66f('0x1d')]]={'$like':'%'+_0x598942['query'][_0xa66f('0x35')]+'%'};return _0x54d740;}})});}_0xc661f2=_[_0xa66f('0x36')]({},_0xc661f2,_0x598942[_0xa66f('0x38')]);var _0x47b21a={'where':_0xc661f2['where']};return db[_0xa66f('0x20')][_0xa66f('0xd')](_0x47b21a)[_0xa66f('0x13')](function(_0x1f5a5f){_0x57da7f[_0xa66f('0xd')]=_0x1f5a5f;if(_0x598942['query']['includeAll']){_0xc661f2['include']=[{'all':!![]}];}return db[_0xa66f('0x20')]['findAll'](_0xc661f2);})['then'](function(_0x5bf856){_0x57da7f[_0xa66f('0x39')]=_0x5bf856;return _0x57da7f;})['then'](respondWithFilteredResult(_0x3a3e4f,_0xc661f2))[_0xa66f('0x3a')](handleError(_0x3a3e4f,null));};exports[_0xa66f('0x3b')]=function(_0x23a546,_0x1647a0){var _0xd65c5d={'raw':![],'where':{'id':_0x23a546[_0xa66f('0x3c')]['id']}},_0x360e61={};_0x360e61[_0xa66f('0x25')]=_[_0xa66f('0x27')](db[_0xa66f('0x20')][_0xa66f('0x21')]);_0x360e61[_0xa66f('0x26')]=_[_0xa66f('0x27')](_0x23a546[_0xa66f('0x26')]);_0x360e61['filters']=_[_0xa66f('0x28')](_0x360e61[_0xa66f('0x25')],_0x360e61['query']);_0xd65c5d[_0xa66f('0x2a')]=_['intersection'](_0x360e61[_0xa66f('0x25')],qs[_0xa66f('0x29')](_0x23a546['query'][_0xa66f('0x29')]));_0xd65c5d[_0xa66f('0x2a')]=_0xd65c5d[_0xa66f('0x2a')]['length']?_0xd65c5d[_0xa66f('0x2a')]:_0x360e61['model'];if(_0x23a546[_0xa66f('0x26')][_0xa66f('0x3d')]){_0xd65c5d[_0xa66f('0x3e')]=[{'all':!![]}];}_0xd65c5d=_[_0xa66f('0x36')]({},_0xd65c5d,_0x23a546[_0xa66f('0x38')]);return db[_0xa66f('0x20')][_0xa66f('0x3f')](_0xd65c5d)['then'](handleEntityNotFound(_0x1647a0,null))[_0xa66f('0x13')](respondWithResult(_0x1647a0,null))[_0xa66f('0x3a')](handleError(_0x1647a0,null));};exports[_0xa66f('0x40')]=function(_0x19ed53,_0x374e53){return db['SquareProject']['create'](_0x19ed53[_0xa66f('0x41')],{})[_0xa66f('0x13')](function(_0x3e441e){var _0x46d421=_0x19ed53[_0xa66f('0x42')][_0xa66f('0x15')]({'plain':!![]});if(!_0x46d421)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46d421[_0xa66f('0x43')]===_0xa66f('0x42')){var _0x3f9cdd=_0x3e441e['get']({'plain':!![]});var _0x57c8a0=_0xa66f('0x16');return db[_0xa66f('0x44')][_0xa66f('0x3f')]({'where':{'name':_0x57c8a0,'userProfileId':_0x46d421['userProfileId']},'raw':!![]})['then'](function(_0x52054e){if(_0x52054e&&_0x52054e[_0xa66f('0x45')]===0x0){return db[_0xa66f('0x17')][_0xa66f('0x40')]({'name':_0x3f9cdd[_0xa66f('0x1d')],'resourceId':_0x3f9cdd['id'],'type':_0x52054e[_0xa66f('0x1d')],'sectionId':_0x52054e['id']},{})[_0xa66f('0x13')](function(){return _0x3e441e;});}else{return _0x3e441e;}})[_0xa66f('0x3a')](function(_0x15de06){logger['error'](_0xa66f('0x46'),_0x15de06);throw _0x15de06;});}return _0x3e441e;})[_0xa66f('0x13')](respondWithResult(_0x374e53,0xc9))[_0xa66f('0x3a')](handleError(_0x374e53,null));};exports[_0xa66f('0x12')]=function(_0x11597b,_0x33cdc7){if(_0x11597b['body']['id']){delete _0x11597b[_0xa66f('0x41')]['id'];}return db[_0xa66f('0x20')][_0xa66f('0x3f')]({'where':{'id':_0x11597b[_0xa66f('0x3c')]['id']}})[_0xa66f('0x13')](handleEntityNotFound(_0x33cdc7,null))['then'](saveUpdates(_0x11597b[_0xa66f('0x41')],null))['then'](function(_0x292648){if(!_0x292648)return;var _0x5dc2b8=_0x292648['get']({'plain':!![]});return _0x5dc2b8;})[_0xa66f('0x13')](function(_0x31233b){var _0x12271d=new Redis(config[_0xa66f('0x6')]);_0x12271d[_0xa66f('0x18')](_0xa66f('0x19'),JSON['stringify'](_[_0xa66f('0x34')](_0x31233b,['id',_0xa66f('0x1d'),_0xa66f('0x47')])));return _0x31233b;})[_0xa66f('0x13')](respondWithResult(_0x33cdc7,null))['catch'](handleError(_0x33cdc7,null));};exports[_0xa66f('0x14')]=function(_0x55dd8c,_0x8247aa){return db[_0xa66f('0x20')][_0xa66f('0x3f')]({'where':{'id':_0x55dd8c[_0xa66f('0x3c')]['id']}})[_0xa66f('0x13')](handleEntityNotFound(_0x8247aa,null))[_0xa66f('0x13')](removeEntity(_0x8247aa,null))[_0xa66f('0x3a')](handleError(_0x8247aa,null));};exports['addUsers']=function(_0x2ab3c8,_0x34025c){return db[_0xa66f('0x20')][_0xa66f('0x3f')]({'where':{'id':_0x2ab3c8[_0xa66f('0x3c')]['id']}})[_0xa66f('0x13')](handleEntityNotFound(_0x34025c,null))[_0xa66f('0x13')](function(_0x323145){if(_0x323145){return _0x323145[_0xa66f('0x48')](_0x2ab3c8['body']['ids'],_[_0xa66f('0x49')](_0x2ab3c8[_0xa66f('0x41')],[_0xa66f('0x4a'),'id'])||{});}})[_0xa66f('0x13')](respondWithResult(_0x34025c,null))[_0xa66f('0x3a')](handleError(_0x34025c,null));};exports[_0xa66f('0x4b')]=function(_0x8bea2b,_0x4b10cf){return db[_0xa66f('0x20')][_0xa66f('0x3f')]({'where':{'id':_0x8bea2b[_0xa66f('0x3c')]['id']}})[_0xa66f('0x13')](handleEntityNotFound(_0x4b10cf,null))['then'](function(_0x29f216){if(_0x29f216){return _0x29f216[_0xa66f('0x4b')](_0x8bea2b[_0xa66f('0x26')][_0xa66f('0x4a')])[_0xa66f('0x13')](function(){if(_[_0xa66f('0x4c')](_0x8bea2b['query']['ids'])){for(var _0x15fea8=0x0;_0x15fea8<_0x8bea2b[_0xa66f('0x26')][_0xa66f('0x4a')]['length'];_0x15fea8+=0x1){socket[_0xa66f('0x4d')](_0xa66f('0x4e'),{'UserId':Number(_0x8bea2b[_0xa66f('0x26')][_0xa66f('0x4a')][_0x15fea8]),'SquareProjectId':Number(_0x8bea2b[_0xa66f('0x3c')]['id'])});}}else{socket[_0xa66f('0x4d')](_0xa66f('0x4e'),{'UserId':Number(_0x8bea2b[_0xa66f('0x26')][_0xa66f('0x4a')]),'SquareProjectId':Number(_0x8bea2b['params']['id'])});}});}})[_0xa66f('0x13')](respondWithStatusCode(_0x4b10cf,null))[_0xa66f('0x3a')](handleError(_0x4b10cf,null));};exports[_0xa66f('0x4f')]=function(_0x172c42,_0x4565f5){var _0x148ad1={};var _0x41ffa7={};var _0x3b38ad;var _0x588060;return db['SquareProject'][_0xa66f('0x50')]({'where':{'id':_0x172c42[_0xa66f('0x3c')]['id']}})[_0xa66f('0x13')](handleEntityNotFound(_0x4565f5,null))[_0xa66f('0x13')](function(_0x3b6644){if(_0x3b6644){_0x3b38ad=_0x3b6644;_0x41ffa7['model']=_[_0xa66f('0x27')](db['User'][_0xa66f('0x21')]);_0x41ffa7[_0xa66f('0x26')]=_[_0xa66f('0x27')](_0x172c42[_0xa66f('0x26')]);_0x41ffa7['filters']=_[_0xa66f('0x28')](_0x41ffa7[_0xa66f('0x25')],_0x41ffa7[_0xa66f('0x26')]);_0x148ad1[_0xa66f('0x2a')]=_[_0xa66f('0x28')](_0x41ffa7[_0xa66f('0x25')],qs[_0xa66f('0x29')](_0x172c42[_0xa66f('0x26')][_0xa66f('0x29')]));_0x148ad1[_0xa66f('0x2a')]=_0x148ad1[_0xa66f('0x2a')][_0xa66f('0x2b')]?_0x148ad1['attributes']:_0x41ffa7[_0xa66f('0x25')];_0x148ad1[_0xa66f('0x30')]=qs[_0xa66f('0x31')](_0x172c42[_0xa66f('0x26')][_0xa66f('0x31')]);_0x148ad1[_0xa66f('0x32')]=qs[_0xa66f('0x33')](_[_0xa66f('0x34')](_0x172c42['query'],_0x41ffa7[_0xa66f('0x33')]));if(_0x172c42[_0xa66f('0x26')][_0xa66f('0x35')]){_0x148ad1[_0xa66f('0x32')]=_[_0xa66f('0x36')](_0x148ad1[_0xa66f('0x32')],{'$or':_[_0xa66f('0x1f')](_0x148ad1[_0xa66f('0x2a')],function(_0x4b5785){var _0x4c882e={};_0x4c882e[_0x4b5785]={'$like':'%'+_0x172c42[_0xa66f('0x26')][_0xa66f('0x35')]+'%'};return _0x4c882e;})});}_0x148ad1=_[_0xa66f('0x36')]({},_0x148ad1,_0x172c42['options']);return _0x3b38ad['getUsers'](_0x148ad1);}})[_0xa66f('0x13')](function(_0x421290){if(_0x421290){_0x588060=_0x421290[_0xa66f('0x2b')];if(!_0x172c42[_0xa66f('0x26')]['hasOwnProperty'](_0xa66f('0x2d'))){_0x148ad1[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x172c42[_0xa66f('0x26')][_0xa66f('0x2e')]);_0x148ad1[_0xa66f('0x2f')]=qs[_0xa66f('0x2f')](_0x172c42[_0xa66f('0x26')]['offset']);}return _0x3b38ad[_0xa66f('0x4f')](_0x148ad1);}})[_0xa66f('0x13')](function(_0x5c6c40){if(_0x5c6c40){return _0x5c6c40?{'count':_0x588060,'rows':_0x5c6c40}:null;}})['then'](respondWithResult(_0x4565f5,null))[_0xa66f('0x3a')](handleError(_0x4565f5,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 81473be..e06dae5 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 _0xab0a=['hasOwnProperty','exports','../../mysqldb','SquareProject','save','remove','emit'];(function(_0x452306,_0x353e0d){var _0x109a63=function(_0x13686b){while(--_0x13686b){_0x452306['push'](_0x452306['shift']());}};_0x109a63(++_0x353e0d);}(_0xab0a,0xaa));var _0xaab0=function(_0x120faf,_0x30b111){_0x120faf=_0x120faf-0x0;var _0x1ef814=_0xab0a[_0x120faf];return _0x1ef814;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xaab0('0x0'))['db'][_0xaab0('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaab0('0x2'),'afterUpdate':'update','afterDestroy':_0xaab0('0x3')};function emitEvent(_0x92c1c7){return function(_0xc1f4f5,_0x4498c3,_0x4eea4d){SquareProjectEvents[_0xaab0('0x4')](_0x92c1c7+':'+_0xc1f4f5['id'],_0xc1f4f5);SquareProjectEvents['emit'](_0x92c1c7,_0xc1f4f5);_0x4eea4d(null);};}for(var e in events){if(events[_0xaab0('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xaab0('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x4e15=['SquareProject','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x33fb67,_0x424b08){var _0x3a8585=function(_0x23b59e){while(--_0x23b59e){_0x33fb67['push'](_0x33fb67['shift']());}};_0x3a8585(++_0x424b08);}(_0x4e15,0x73));var _0x54e1=function(_0x142386,_0x1e6fc1){_0x142386=_0x142386-0x0;var _0x469bb5=_0x4e15[_0x142386];return _0x469bb5;};'use strict';var EventEmitter=require(_0x54e1('0x0'));var SquareProject=require(_0x54e1('0x1'))['db'][_0x54e1('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54e1('0x3'),'afterUpdate':_0x54e1('0x4'),'afterDestroy':_0x54e1('0x5')};function emitEvent(_0x5f3377){return function(_0x5bff89,_0x2628f2,_0x8ab4da){SquareProjectEvents[_0x54e1('0x6')](_0x5f3377+':'+_0x5bff89['id'],_0x5bff89);SquareProjectEvents[_0x54e1('0x6')](_0x5f3377,_0x5bff89);_0x8ab4da(null);};}for(var e in events){if(events[_0x54e1('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x54e1('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 855f75b..2193465 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 _0xac3c=['util','api','moment','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xac3c,0x1c7));var _0xcac3=function(_0x4dd977,_0x5ab8d3){_0x4dd977=_0x4dd977-0x0;var _0x45212d=_0xac3c[_0x4dd977];return _0x45212d;};'use strict';var _=require(_0xcac3('0x0'));var util=require(_0xcac3('0x1'));var logger=require('../../config/logger')(_0xcac3('0x2'));var moment=require(_0xcac3('0x3'));var BPromise=require('bluebird');var rp=require(_0xcac3('0x4'));var fs=require('fs');var path=require(_0xcac3('0x5'));var rimraf=require(_0xcac3('0x6'));var config=require('../../config/environment');var attributes=require(_0xcac3('0x7'));module[_0xcac3('0x8')]=function(_0x1bda42,_0x31e0a0){return _0x1bda42[_0xcac3('0x9')](_0xcac3('0xa'),attributes,{'tableName':_0xcac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe5d27f,_0x55a81c,_0x347d9d){if(_0xe5d27f[_0xcac3('0xc')](_0xcac3('0xd'))){_0xe5d27f[_0xcac3('0xe')]=moment()[_0xcac3('0xf')](_0xcac3('0x10'));}if(_0xe5d27f[_0xcac3('0xc')](_0xcac3('0x11'))){_0xe5d27f[_0xcac3('0x12')]=moment()[_0xcac3('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x347d9d(null,_0xe5d27f);}}});}; \ No newline at end of file +var _0x3670=['define','SquareProject','changed','YYYY-MM-DD\x20HH:mm:ss','production','format','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports'];(function(_0x2f8877,_0x452537){var _0x2591a3=function(_0x5202da){while(--_0x5202da){_0x2f8877['push'](_0x2f8877['shift']());}};_0x2591a3(++_0x452537);}(_0x3670,0x11e));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0367('0x0'))('api');var moment=require('moment');var BPromise=require(_0x0367('0x1'));var rp=require(_0x0367('0x2'));var fs=require('fs');var path=require(_0x0367('0x3'));var rimraf=require(_0x0367('0x4'));var config=require(_0x0367('0x5'));var attributes=require(_0x0367('0x6'));module[_0x0367('0x7')]=function(_0x34a8cf,_0x8ca34d){return _0x34a8cf[_0x0367('0x8')](_0x0367('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4db419,_0x3e01e3,_0x5338b7){if(_0x4db419[_0x0367('0xa')]('preproduction')){_0x4db419['savedAt']=moment()['format'](_0x0367('0xb'));}if(_0x4db419['changed'](_0x0367('0xc'))){_0x4db419['publishedAt']=moment()[_0x0367('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5338b7(null,_0x4db419);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 3b19cc8..c5d136b 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 _0xa023=['register','GetSquareProjects','SquareProject','findAll','options','where','attributes','limit','include','map','model','debug','stringify','catch','error','message','ShowSquareProject','find','info','ioredis','../../mysqldb','rpc','redis','localhost','socket.io-emitter'];(function(_0x28739d,_0x8c3437){var _0x4c950e=function(_0x1da5f2){while(--_0x1da5f2){_0x28739d['push'](_0x28739d['shift']());}};_0x4c950e(++_0x8c3437);}(_0xa023,0x171));var _0x3a02=function(_0x2cf942,_0x1803be){_0x2cf942=_0x2cf942-0x0;var _0x2b43b0=_0xa023[_0x2cf942];return _0x2b43b0;};'use strict';var _=require('lodash');var Redis=require(_0x3a02('0x0'));var db=require(_0x3a02('0x1'))['db'];var logger=require('../../config/logger')(_0x3a02('0x2'));var config=require('../../config/environment');config[_0x3a02('0x3')]=_['defaults'](config[_0x3a02('0x3')],{'host':_0x3a02('0x4'),'port':0x18eb});var socket=require(_0x3a02('0x5'))(new Redis(config[_0x3a02('0x3')]));require('./squareProject.socket')[_0x3a02('0x6')](socket);exports[_0x3a02('0x7')]=function(_0x3abfa6){var _0x2f9cc4=this;return new Promise(function(_0x2f3f4f,_0x508a1b){return db[_0x3a02('0x8')][_0x3a02('0x9')]({'raw':_0x3abfa6[_0x3a02('0xa')]?_0x3abfa6[_0x3a02('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x3abfa6[_0x3a02('0xa')]?_0x3abfa6[_0x3a02('0xa')][_0x3a02('0xb')]||null:null,'attributes':_0x3abfa6[_0x3a02('0xa')]?_0x3abfa6[_0x3a02('0xa')][_0x3a02('0xc')]||null:null,'limit':_0x3abfa6[_0x3a02('0xa')]?_0x3abfa6[_0x3a02('0xa')][_0x3a02('0xd')]||null:null,'include':_0x3abfa6[_0x3a02('0xa')]?_0x3abfa6[_0x3a02('0xa')][_0x3a02('0xe')]?_[_0x3a02('0xf')](_0x3abfa6[_0x3a02('0xa')][_0x3a02('0xe')],function(_0x541620){return{'model':db[_0x541620[_0x3a02('0x10')]],'as':_0x541620['as'],'attributes':_0x541620[_0x3a02('0xc')],'include':_0x541620[_0x3a02('0xe')]?_['map'](_0x541620[_0x3a02('0xe')],function(_0x5297f6){return{'model':db[_0x5297f6[_0x3a02('0x10')]],'as':_0x5297f6['as'],'attributes':_0x5297f6['attributes'],'include':_0x5297f6[_0x3a02('0xe')]?_[_0x3a02('0xf')](_0x5297f6[_0x3a02('0xe')],function(_0xcf82f2){return{'model':db[_0xcf82f2[_0x3a02('0x10')]],'as':_0xcf82f2['as'],'attributes':_0xcf82f2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22bd9c){logger['info'](_0x3a02('0x7'),_0x3abfa6);logger[_0x3a02('0x11')](_0x3a02('0x7'),_0x3abfa6,JSON[_0x3a02('0x12')](_0x22bd9c));_0x2f3f4f(_0x22bd9c);})[_0x3a02('0x13')](function(_0x501348){logger[_0x3a02('0x14')](_0x3a02('0x7'),_0x501348[_0x3a02('0x15')],_0x3abfa6);_0x508a1b(_0x2f9cc4[_0x3a02('0x14')](0x1f4,_0x501348[_0x3a02('0x15')]));});});};exports[_0x3a02('0x16')]=function(_0x43143b){var _0x25c897=this;return new Promise(function(_0x317f86,_0x38a2d9){return db[_0x3a02('0x8')][_0x3a02('0x17')]({'raw':_0x43143b['options']?_0x43143b[_0x3a02('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x43143b[_0x3a02('0xa')]?_0x43143b['options'][_0x3a02('0xb')]||null:null,'attributes':_0x43143b[_0x3a02('0xa')]?_0x43143b[_0x3a02('0xa')][_0x3a02('0xc')]||null:null,'include':_0x43143b[_0x3a02('0xa')]?_0x43143b['options'][_0x3a02('0xe')]?_[_0x3a02('0xf')](_0x43143b[_0x3a02('0xa')]['include'],function(_0x2d7eb9){return{'model':db[_0x2d7eb9[_0x3a02('0x10')]],'as':_0x2d7eb9['as'],'attributes':_0x2d7eb9[_0x3a02('0xc')],'include':_0x2d7eb9[_0x3a02('0xe')]?_[_0x3a02('0xf')](_0x2d7eb9[_0x3a02('0xe')],function(_0x121d0a){return{'model':db[_0x121d0a[_0x3a02('0x10')]],'as':_0x121d0a['as'],'attributes':_0x121d0a[_0x3a02('0xc')],'include':_0x121d0a[_0x3a02('0xe')]?_[_0x3a02('0xf')](_0x121d0a[_0x3a02('0xe')],function(_0x17b614){return{'model':db[_0x17b614['model']],'as':_0x17b614['as'],'attributes':_0x17b614[_0x3a02('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x381187){logger[_0x3a02('0x18')](_0x3a02('0x16'),_0x43143b);logger[_0x3a02('0x11')]('ShowSquareProject',_0x43143b,JSON['stringify'](_0x381187));_0x317f86(_0x381187);})[_0x3a02('0x13')](function(_0x591807){logger[_0x3a02('0x14')](_0x3a02('0x16'),_0x591807[_0x3a02('0x15')],_0x43143b);_0x38a2d9(_0x25c897[_0x3a02('0x14')](0x1f4,_0x591807[_0x3a02('0x15')]));});});}; \ No newline at end of file +var _0x36a6=['defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','raw','options','where','attributes','limit','include','map','info','debug','stringify','catch','error','message','ShowSquareProject','model','then','../../mysqldb','../../config/logger','rpc','../../config/environment','redis'];(function(_0x547f6a,_0x3e6313){var _0x59d999=function(_0xf52ca7){while(--_0xf52ca7){_0x547f6a['push'](_0x547f6a['shift']());}};_0x59d999(++_0x3e6313);}(_0x36a6,0x11d));var _0x636a=function(_0x4f9528,_0x3194e8){_0x4f9528=_0x4f9528-0x0;var _0x1fa65c=_0x36a6[_0x4f9528];return _0x1fa65c;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require(_0x636a('0x0'))['db'];var logger=require(_0x636a('0x1'))(_0x636a('0x2'));var config=require(_0x636a('0x3'));config[_0x636a('0x4')]=_[_0x636a('0x5')](config['redis'],{'host':_0x636a('0x6'),'port':0x18eb});var socket=require(_0x636a('0x7'))(new Redis(config[_0x636a('0x4')]));require(_0x636a('0x8'))[_0x636a('0x9')](socket);exports[_0x636a('0xa')]=function(_0x149746){var _0x4c7b91=this;return new Promise(function(_0xc9bac3,_0x2a8b67){return db[_0x636a('0xb')][_0x636a('0xc')]({'raw':_0x149746['options']?_0x149746['options'][_0x636a('0xd')]===undefined?!![]:![]:!![],'where':_0x149746['options']?_0x149746[_0x636a('0xe')][_0x636a('0xf')]||null:null,'attributes':_0x149746[_0x636a('0xe')]?_0x149746['options'][_0x636a('0x10')]||null:null,'limit':_0x149746[_0x636a('0xe')]?_0x149746[_0x636a('0xe')][_0x636a('0x11')]||null:null,'include':_0x149746['options']?_0x149746['options']['include']?_['map'](_0x149746[_0x636a('0xe')][_0x636a('0x12')],function(_0x33e910){return{'model':db[_0x33e910['model']],'as':_0x33e910['as'],'attributes':_0x33e910[_0x636a('0x10')],'include':_0x33e910['include']?_['map'](_0x33e910[_0x636a('0x12')],function(_0x5cf735){return{'model':db[_0x5cf735['model']],'as':_0x5cf735['as'],'attributes':_0x5cf735[_0x636a('0x10')],'include':_0x5cf735['include']?_[_0x636a('0x13')](_0x5cf735[_0x636a('0x12')],function(_0x2458d4){return{'model':db[_0x2458d4['model']],'as':_0x2458d4['as'],'attributes':_0x2458d4[_0x636a('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x873116){logger[_0x636a('0x14')](_0x636a('0xa'),_0x149746);logger[_0x636a('0x15')](_0x636a('0xa'),_0x149746,JSON[_0x636a('0x16')](_0x873116));_0xc9bac3(_0x873116);})[_0x636a('0x17')](function(_0xf5aeb2){logger[_0x636a('0x18')](_0x636a('0xa'),_0xf5aeb2[_0x636a('0x19')],_0x149746);_0x2a8b67(_0x4c7b91[_0x636a('0x18')](0x1f4,_0xf5aeb2[_0x636a('0x19')]));});});};exports[_0x636a('0x1a')]=function(_0x24d8ef){var _0x1ee0b9=this;return new Promise(function(_0x39c66a,_0x1d6b78){return db['SquareProject']['find']({'raw':_0x24d8ef[_0x636a('0xe')]?_0x24d8ef[_0x636a('0xe')][_0x636a('0xd')]===undefined?!![]:![]:!![],'where':_0x24d8ef[_0x636a('0xe')]?_0x24d8ef['options'][_0x636a('0xf')]||null:null,'attributes':_0x24d8ef['options']?_0x24d8ef[_0x636a('0xe')][_0x636a('0x10')]||null:null,'include':_0x24d8ef[_0x636a('0xe')]?_0x24d8ef[_0x636a('0xe')][_0x636a('0x12')]?_[_0x636a('0x13')](_0x24d8ef['options']['include'],function(_0x2c5b20){return{'model':db[_0x2c5b20[_0x636a('0x1b')]],'as':_0x2c5b20['as'],'attributes':_0x2c5b20[_0x636a('0x10')],'include':_0x2c5b20['include']?_[_0x636a('0x13')](_0x2c5b20[_0x636a('0x12')],function(_0x5b721c){return{'model':db[_0x5b721c['model']],'as':_0x5b721c['as'],'attributes':_0x5b721c[_0x636a('0x10')],'include':_0x5b721c[_0x636a('0x12')]?_[_0x636a('0x13')](_0x5b721c[_0x636a('0x12')],function(_0xfc7c08){return{'model':db[_0xfc7c08[_0x636a('0x1b')]],'as':_0xfc7c08['as'],'attributes':_0xfc7c08[_0x636a('0x10')]};}):[]};}):[]};}):[]:[]})[_0x636a('0x1c')](function(_0x5a5afc){logger[_0x636a('0x14')]('ShowSquareProject',_0x24d8ef);logger[_0x636a('0x15')](_0x636a('0x1a'),_0x24d8ef,JSON[_0x636a('0x16')](_0x5a5afc));_0x39c66a(_0x5a5afc);})[_0x636a('0x17')](function(_0x19d69d){logger[_0x636a('0x18')](_0x636a('0x1a'),_0x19d69d[_0x636a('0x19')],_0x24d8ef);_0x1d6b78(_0x1ee0b9[_0x636a('0x18')](0x1f4,_0x19d69d[_0x636a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 4d37fbb..c427278 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 _0xaf78=['save','remove','update','length','squareProject:','./squareProject.events'];(function(_0x164467,_0x5df59a){var _0x56529f=function(_0x4ced8f){while(--_0x4ced8f){_0x164467['push'](_0x164467['shift']());}};_0x56529f(++_0x5df59a);}(_0xaf78,0x1bb));var _0x8af7=function(_0x2872df,_0x526d8d){_0x2872df=_0x2872df-0x0;var _0x5ee477=_0xaf78[_0x2872df];return _0x5ee477;};'use strict';var SquareProjectEvents=require(_0x8af7('0x0'));var events=[_0x8af7('0x1'),_0x8af7('0x2'),_0x8af7('0x3')];function createListener(_0x3f0028,_0x295f2d){return function(_0x1f500c){_0x295f2d['emit'](_0x3f0028,_0x1f500c);};}function removeListener(_0x1256a0,_0x4103d2){return function(){SquareProjectEvents['removeListener'](_0x1256a0,_0x4103d2);};}exports['register']=function(_0x2f0c7f){for(var _0x124948=0x0,_0x35fc0d=events[_0x8af7('0x4')];_0x124948<_0x35fc0d;_0x124948++){var _0x57cb34=events[_0x124948];var _0x2b709f=createListener(_0x8af7('0x5')+_0x57cb34,_0x2f0c7f);SquareProjectEvents['on'](_0x57cb34,_0x2b709f);}}; \ No newline at end of file +var _0x5c51=['length','squareProject:','./squareProject.events','save','emit','register'];(function(_0xd1659f,_0x14e21f){var _0x5d4cc3=function(_0x5dc997){while(--_0x5dc997){_0xd1659f['push'](_0xd1659f['shift']());}};_0x5d4cc3(++_0x14e21f);}(_0x5c51,0xce));var _0x15c5=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x5c51[_0x438fe1];return _0x3c8e1b;};'use strict';var SquareProjectEvents=require(_0x15c5('0x0'));var events=[_0x15c5('0x1'),'remove','update'];function createListener(_0x18ea42,_0x22ee93){return function(_0xa9de56){_0x22ee93[_0x15c5('0x2')](_0x18ea42,_0xa9de56);};}function removeListener(_0x3acc32,_0x5557cd){return function(){SquareProjectEvents['removeListener'](_0x3acc32,_0x5557cd);};}exports[_0x15c5('0x3')]=function(_0x1cb137){for(var _0x339639=0x0,_0x8a3791=events[_0x15c5('0x4')];_0x339639<_0x8a3791;_0x339639++){var _0x345178=events[_0x339639];var _0x22ae35=createListener(_0x15c5('0x5')+_0x345178,_0x1cb137);SquareProjectEvents['on'](_0x345178,_0x22ae35);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index ecc3cab..25a23d6 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x174141,_0x350f90){var _0x1e44fb=function(_0x4e02ba){while(--_0x4e02ba){_0x174141['push'](_0x174141['shift']());}};_0x1e44fb(++_0x350f90);}(_0x53ec,0x192));var _0xc53e=function(_0x42f270,_0x452dec){_0x42f270=_0x42f270-0x0;var _0x57bc5b=_0x53ec[_0x42f270];return _0x57bc5b;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x0295,0x1f0));var _0x5029=function(_0x12fcbd,_0x884804){_0x12fcbd=_0x12fcbd-0x0;var _0x28ec2a=_0x0295[_0x12fcbd];return _0x28ec2a;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0x7')]('/:id/download',auth[_0x5029('0x8')](),controller['download']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 31d7d80..9b16ccc 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 _0x6f47=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue'];(function(_0x15414a,_0x2af515){var _0x40f549=function(_0x48a694){while(--_0x48a694){_0x15414a['push'](_0x15414a['shift']());}};_0x40f549(++_0x2af515);}(_0x6f47,0xc7));var _0x76f4=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x6f47[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'uniqueid':{'type':Sequelize[_0x76f4('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76f4('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x76f4('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76f4('0x1')]},'dnid':{'type':Sequelize[_0x76f4('0x1')]},'projectName':{'type':Sequelize[_0x76f4('0x1')]},'saveName':{'type':Sequelize[_0x76f4('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x76f4('0x1')]},'format':{'type':Sequelize[_0x76f4('0x2')],'get':function(){var _0x2176a7='';var _0x497f99=this[_0x76f4('0x3')](_0x76f4('0x4'));if(_0x497f99){_0x2176a7=_0x497f99[_0x76f4('0x5')](_0x497f99[_0x76f4('0x6')]('.'));}return _0x2176a7;}}}; \ No newline at end of file +var _0x33c5=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','exports'];(function(_0x3926ba,_0x237901){var _0x18756e=function(_0x5ca849){while(--_0x5ca849){_0x3926ba['push'](_0x3926ba['shift']());}};_0x18756e(++_0x237901);}(_0x33c5,0xe6));var _0x533c=function(_0x43d106,_0x96a475){_0x43d106=_0x43d106-0x0;var _0x2160bc=_0x33c5[_0x43d106];return _0x2160bc;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'uniqueid':{'type':Sequelize[_0x533c('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x533c('0x1')]},'context':{'type':Sequelize[_0x533c('0x1')]},'extension':{'type':Sequelize[_0x533c('0x1')]},'priority':{'type':Sequelize[_0x533c('0x1')]},'accountcode':{'type':Sequelize[_0x533c('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x533c('0x1')]},'saveName':{'type':Sequelize[_0x533c('0x1')]},'filename':{'type':Sequelize[_0x533c('0x1')]},'savePath':{'type':Sequelize[_0x533c('0x1')]},'format':{'type':Sequelize[_0x533c('0x2')],'get':function(){var _0x1699d5='';var _0x3a009b=this[_0x533c('0x3')](_0x533c('0x4'));if(_0x3a009b){_0x1699d5=_0x3a009b[_0x533c('0x5')](_0x3a009b[_0x533c('0x6')]('.'));}return _0x1699d5;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 41bcb23..fa0ea8f 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 _0xcf4f=['send','index','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','show','params','fields','find','create','body','catch','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','download','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','name'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0xcf4f,0x98));var _0xfcf4=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xcf4f[_0x47a349];return _0x18ab75;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcf4('0x0'));var zipdir=require(_0xfcf4('0x1'));var jsonpatch=require(_0xfcf4('0x2'));var rp=require(_0xfcf4('0x3'));var moment=require(_0xfcf4('0x4'));var BPromise=require(_0xfcf4('0x5'));var Mustache=require(_0xfcf4('0x6'));var util=require(_0xfcf4('0x7'));var path=require(_0xfcf4('0x8'));var sox=require(_0xfcf4('0x9'));var csv=require('to-csv');var ejs=require(_0xfcf4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcf4('0xb'));var squel=require(_0xfcf4('0xc'));var crypto=require(_0xfcf4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfcf4('0xe'));var querystring=require(_0xfcf4('0xf'));var Papa=require(_0xfcf4('0x10'));var Redis=require(_0xfcf4('0x11'));var authService=require(_0xfcf4('0x12'));var qs=require(_0xfcf4('0x13'));var as=require(_0xfcf4('0x14'));var hardwareService=require(_0xfcf4('0x15'));var logger=require(_0xfcf4('0x16'))('api');var utils=require(_0xfcf4('0x17'));var config=require(_0xfcf4('0x18'));var licenseUtil=require(_0xfcf4('0x19'));var db=require(_0xfcf4('0x1a'))['db'];function respondWithStatusCode(_0x2bcbbc,_0x138be2){_0x138be2=_0x138be2||0xcc;return function(_0x408773){if(_0x408773){return _0x2bcbbc[_0xfcf4('0x1b')](_0x138be2);}return _0x2bcbbc[_0xfcf4('0x1c')](_0x138be2)['end']();};}function respondWithResult(_0x598dd5,_0x165b1){_0x165b1=_0x165b1||0xc8;return function(_0x3c9281){if(_0x3c9281){return _0x598dd5[_0xfcf4('0x1c')](_0x165b1)[_0xfcf4('0x1d')](_0x3c9281);}};}function respondWithFilteredResult(_0x20c1ce,_0x17a0c3){return function(_0x4ab7f7){if(_0x4ab7f7){var _0x43ab0e=typeof _0x17a0c3[_0xfcf4('0x1e')]===_0xfcf4('0x1f')&&typeof _0x17a0c3[_0xfcf4('0x20')]===_0xfcf4('0x1f');var _0x83f8d9=_0x4ab7f7['count'];var _0x1bd9ec=_0x43ab0e?0x0:_0x17a0c3[_0xfcf4('0x1e')];var _0xbc74d6=_0x43ab0e?_0x4ab7f7[_0xfcf4('0x21')]:_0x17a0c3[_0xfcf4('0x1e')]+_0x17a0c3[_0xfcf4('0x20')];var _0x49ea6f;if(_0xbc74d6>=_0x83f8d9){_0xbc74d6=_0x83f8d9;_0x49ea6f=0xc8;}else{_0x49ea6f=0xce;}_0x20c1ce[_0xfcf4('0x1c')](_0x49ea6f);return _0x20c1ce[_0xfcf4('0x22')]('Content-Range',_0x1bd9ec+'-'+_0xbc74d6+'/'+_0x83f8d9)['json'](_0x4ab7f7);}return null;};}function patchUpdates(_0xbe0a6e){return function(_0x4146af){try{jsonpatch[_0xfcf4('0x23')](_0x4146af,_0xbe0a6e,!![]);}catch(_0x302aa8){return BPromise[_0xfcf4('0x24')](_0x302aa8);}return _0x4146af[_0xfcf4('0x25')]();};}function saveUpdates(_0x4ba66d,_0x4f0216){return function(_0x5ba426){if(_0x5ba426){return _0x5ba426[_0xfcf4('0x26')](_0x4ba66d)['then'](function(_0x4a19aa){return _0x4a19aa;});}return null;};}function removeEntity(_0x5ebfd4,_0x10d242){return function(_0x1c3e97){if(_0x1c3e97){return _0x1c3e97['destroy']()[_0xfcf4('0x27')](function(){_0x5ebfd4[_0xfcf4('0x1c')](0xcc)[_0xfcf4('0x28')]();});}};}function handleEntityNotFound(_0x24904d,_0x593101){return function(_0x478685){if(!_0x478685){_0x24904d[_0xfcf4('0x1b')](0x194);}return _0x478685;};}function handleError(_0x49e166,_0x38b429){_0x38b429=_0x38b429||0x1f4;return function(_0x4193ff){logger['error'](_0x4193ff['stack']);if(_0x4193ff[_0xfcf4('0x29')]){delete _0x4193ff[_0xfcf4('0x29')];}_0x49e166[_0xfcf4('0x1c')](_0x38b429)[_0xfcf4('0x2a')](_0x4193ff);};}exports[_0xfcf4('0x2b')]=function(_0x54d424,_0x513571){var _0x2fe450={},_0x1d9871={},_0x5dbf09={'count':0x0,'rows':[]};var _0x34f56b=_['map'](db[_0xfcf4('0x2c')][_0xfcf4('0x2d')],function(_0x56f047){return{'name':_0x56f047[_0xfcf4('0x2e')],'type':_0x56f047[_0xfcf4('0x2f')][_0xfcf4('0x30')]};});_0x1d9871[_0xfcf4('0x31')]=_['map'](_0x34f56b,_0xfcf4('0x29'));_0x1d9871[_0xfcf4('0x32')]=_[_0xfcf4('0x33')](_0x54d424[_0xfcf4('0x32')]);_0x1d9871['filters']=_[_0xfcf4('0x34')](_0x1d9871[_0xfcf4('0x31')],_0x1d9871[_0xfcf4('0x32')]);_0x2fe450[_0xfcf4('0x35')]=_['intersection'](_0x1d9871[_0xfcf4('0x31')],qs['fields'](_0x54d424[_0xfcf4('0x32')]['fields']));_0x2fe450[_0xfcf4('0x35')]=_0x2fe450[_0xfcf4('0x35')][_0xfcf4('0x36')]?_0x2fe450[_0xfcf4('0x35')]:_0x1d9871[_0xfcf4('0x31')];if(!_0x54d424[_0xfcf4('0x32')][_0xfcf4('0x37')](_0xfcf4('0x38'))){_0x2fe450[_0xfcf4('0x20')]=qs[_0xfcf4('0x20')](_0x54d424[_0xfcf4('0x32')][_0xfcf4('0x20')]);_0x2fe450[_0xfcf4('0x1e')]=qs['offset'](_0x54d424['query'][_0xfcf4('0x1e')]);}_0x2fe450[_0xfcf4('0x39')]=qs['sort'](_0x54d424[_0xfcf4('0x32')][_0xfcf4('0x3a')]);_0x2fe450[_0xfcf4('0x3b')]=qs[_0xfcf4('0x3c')](_['pick'](_0x54d424[_0xfcf4('0x32')],_0x1d9871['filters']),_0x34f56b);if(_0x54d424[_0xfcf4('0x32')][_0xfcf4('0x3d')]){_0x2fe450[_0xfcf4('0x3b')]=_['merge'](_0x2fe450[_0xfcf4('0x3b')],{'$or':_[_0xfcf4('0x3e')](_0x34f56b,function(_0x4cd630){if(_0x4cd630[_0xfcf4('0x2f')]!==_0xfcf4('0x3f')){var _0x5345ad={};_0x5345ad[_0x4cd630[_0xfcf4('0x29')]]={'$like':'%'+_0x54d424[_0xfcf4('0x32')][_0xfcf4('0x3d')]+'%'};return _0x5345ad;}})});}_0x2fe450=_[_0xfcf4('0x40')]({},_0x2fe450,_0x54d424[_0xfcf4('0x41')]);var _0x4f77f1={'where':_0x2fe450[_0xfcf4('0x3b')]};return db[_0xfcf4('0x2c')][_0xfcf4('0x21')](_0x4f77f1)['then'](function(_0x221de5){_0x5dbf09[_0xfcf4('0x21')]=_0x221de5;if(_0x54d424['query'][_0xfcf4('0x42')]){_0x2fe450[_0xfcf4('0x43')]=[{'all':!![]}];}return db[_0xfcf4('0x2c')][_0xfcf4('0x44')](_0x2fe450);})[_0xfcf4('0x27')](function(_0x347bb4){_0x5dbf09['rows']=_0x347bb4;return _0x5dbf09;})[_0xfcf4('0x27')](respondWithFilteredResult(_0x513571,_0x2fe450))['catch'](handleError(_0x513571,null));};exports[_0xfcf4('0x45')]=function(_0x2583d6,_0x32b070){var _0x5c1433={'raw':!![],'where':{'id':_0x2583d6[_0xfcf4('0x46')]['id']}},_0x13b301={};_0x13b301[_0xfcf4('0x31')]=_[_0xfcf4('0x33')](db['SquareRecording'][_0xfcf4('0x2d')]);_0x13b301['query']=_[_0xfcf4('0x33')](_0x2583d6['query']);_0x13b301[_0xfcf4('0x3c')]=_[_0xfcf4('0x34')](_0x13b301['model'],_0x13b301['query']);_0x5c1433[_0xfcf4('0x35')]=_[_0xfcf4('0x34')](_0x13b301[_0xfcf4('0x31')],qs['fields'](_0x2583d6[_0xfcf4('0x32')][_0xfcf4('0x47')]));_0x5c1433[_0xfcf4('0x35')]=_0x5c1433[_0xfcf4('0x35')]['length']?_0x5c1433[_0xfcf4('0x35')]:_0x13b301[_0xfcf4('0x31')];if(_0x2583d6['query'][_0xfcf4('0x42')]){_0x5c1433[_0xfcf4('0x43')]=[{'all':!![]}];}_0x5c1433=_[_0xfcf4('0x40')]({},_0x5c1433,_0x2583d6[_0xfcf4('0x41')]);return db['SquareRecording'][_0xfcf4('0x48')](_0x5c1433)[_0xfcf4('0x27')](handleEntityNotFound(_0x32b070,null))[_0xfcf4('0x27')](respondWithResult(_0x32b070,null))['catch'](handleError(_0x32b070,null));};exports[_0xfcf4('0x49')]=function(_0x2143e9,_0x42d747){return db[_0xfcf4('0x2c')]['create'](_0x2143e9[_0xfcf4('0x4a')],{})[_0xfcf4('0x27')](respondWithResult(_0x42d747,0xc9))[_0xfcf4('0x4b')](handleError(_0x42d747,null));};exports['update']=function(_0xd7cb67,_0x1a7838){if(_0xd7cb67[_0xfcf4('0x4a')]['id']){delete _0xd7cb67[_0xfcf4('0x4a')]['id'];}return db[_0xfcf4('0x2c')][_0xfcf4('0x48')]({'where':{'id':_0xd7cb67[_0xfcf4('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a7838,null))[_0xfcf4('0x27')](saveUpdates(_0xd7cb67[_0xfcf4('0x4a')],null))['then'](respondWithResult(_0x1a7838,null))[_0xfcf4('0x4b')](handleError(_0x1a7838,null));};exports['download']=function(_0x45b971,_0x75b383,_0x34a53a){var _0x35bf70=require(_0xfcf4('0x4c'));var _0x569823=![];var _0x2433bb={};if(_0x45b971[_0xfcf4('0x32')][_0xfcf4('0x2f')]&&_0x45b971[_0xfcf4('0x32')][_0xfcf4('0x2f')]==='uniqueid'){_0x2433bb[_0xfcf4('0x4d')]=_0x45b971[_0xfcf4('0x46')]['id'];}else{_0x2433bb['id']=_0x45b971[_0xfcf4('0x46')]['id'];}return db[_0xfcf4('0x2c')][_0xfcf4('0x48')]({'where':_0x2433bb,'attributes':['id','savePath',_0xfcf4('0x4e')],'raw':!![]})[_0xfcf4('0x27')](handleEntityNotFound(_0x75b383,null))[_0xfcf4('0x27')](function(_0x5294b0){if(_0x5294b0){var _0x45cca8=_0x5294b0[_0xfcf4('0x4f')];var _0x3af059=util[_0xfcf4('0x50')](_0xfcf4('0x51'),_0x45cca8);if(fs[_0xfcf4('0x52')](_0x3af059)){_0x569823=!![];return _0x35bf70[_0xfcf4('0x53')](_0x3af059,_0x45cca8,config[_0xfcf4('0x54')]['recording'])[_0xfcf4('0x27')](function(){return _0x5294b0;});}return _0x5294b0;}})[_0xfcf4('0x27')](function(_0x530bdd){if(_0x530bdd){var _0xf3bedd=_0x530bdd['savePath'];if(!fs[_0xfcf4('0x52')](_0xf3bedd)){throw new db[(_0xfcf4('0x55'))][(_0xfcf4('0x56'))](_0xfcf4('0x57'));}if(_0x530bdd[_0xfcf4('0x4e')]){return _0x75b383['download'](_0xf3bedd,_0x530bdd['filename']+path[_0xfcf4('0x58')](_0xf3bedd),function(){if(_0x569823){fs['unlink'](_0xf3bedd);}});}else{return _0x75b383[_0xfcf4('0x59')](_0xf3bedd,function(_0x136cbe){if(_0x569823){fs['unlink'](_0xf3bedd);}});}}})[_0xfcf4('0x4b')](function(_0x11bd67){if(_0x11bd67['message']==='SquareRecording\x20not\x20found'){_0x75b383[_0xfcf4('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x75b383,null);}});};exports['destroy']=function(_0x396b51,_0x3099d0){return db[_0xfcf4('0x2c')][_0xfcf4('0x48')]({'where':{'id':_0x396b51[_0xfcf4('0x46')]['id']}})[_0xfcf4('0x27')](function(_0x13ebbf){if(_[_0xfcf4('0x5a')](_0x13ebbf)){throw new ReferenceError(_0xfcf4('0x5b'));}return _0x13ebbf;})[_0xfcf4('0x27')](function(_0x3055fb){var _0x2283d9=_0x3055fb[_0xfcf4('0x4f')];logger[_0xfcf4('0x5c')](_0xfcf4('0x5d'),_0x2283d9);if(!_[_0xfcf4('0x5a')](_0x3055fb['savePath'])&&fs['existsSync'](_0x2283d9)){logger[_0xfcf4('0x5c')](_0xfcf4('0x5e')+_0x2283d9+_0xfcf4('0x5f'));fs[_0xfcf4('0x60')](_0x2283d9);}_0x2283d9=_0x2283d9+'.cypher';if(!_['isNil'](_0x3055fb['savePath'])&&fs[_0xfcf4('0x52')](_0x2283d9)){logger[_0xfcf4('0x5c')](_0xfcf4('0x5e')+_0x2283d9+_0xfcf4('0x5f'));fs[_0xfcf4('0x60')](_0x2283d9);}return _0x3055fb;})[_0xfcf4('0x27')](function(_0x361495){if(!_0x361495)throw new InternalError();return _0x361495['destroy']();})['then'](function(){_0x3099d0[_0xfcf4('0x1c')](0xcc)[_0xfcf4('0x28')]();})[_0xfcf4('0x4b')](handleError(_0x3099d0,null));}; \ No newline at end of file +var _0x9cda=['unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','SquareRecording','findAll','rows','catch','show','params','find','create','body','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','ValidationError','SquareRecording\x20not\x20found','download','filename','extname'];(function(_0x2d6ac1,_0xcfd894){var _0xcb0953=function(_0x138a94){while(--_0x138a94){_0x2d6ac1['push'](_0x2d6ac1['shift']());}};_0xcb0953(++_0xcfd894);}(_0x9cda,0x18b));var _0xa9cd=function(_0x138355,_0x529904){_0x138355=_0x138355-0x0;var _0x477aa7=_0x9cda[_0x138355];return _0x477aa7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9cd('0x0'));var zipdir=require(_0xa9cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9cd('0x2'));var BPromise=require(_0xa9cd('0x3'));var Mustache=require(_0xa9cd('0x4'));var util=require('util');var path=require(_0xa9cd('0x5'));var sox=require('sox');var csv=require(_0xa9cd('0x6'));var ejs=require(_0xa9cd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa9cd('0x8'));var jsforce=require(_0xa9cd('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xa9cd('0x6'));var querystring=require(_0xa9cd('0xa'));var Papa=require(_0xa9cd('0xb'));var Redis=require(_0xa9cd('0xc'));var authService=require(_0xa9cd('0xd'));var qs=require(_0xa9cd('0xe'));var as=require(_0xa9cd('0xf'));var hardwareService=require(_0xa9cd('0x10'));var logger=require('../../config/logger')(_0xa9cd('0x11'));var utils=require('../../config/utils');var config=require(_0xa9cd('0x12'));var licenseUtil=require(_0xa9cd('0x13'));var db=require(_0xa9cd('0x14'))['db'];function respondWithStatusCode(_0x151e04,_0x30f78e){_0x30f78e=_0x30f78e||0xcc;return function(_0x331253){if(_0x331253){return _0x151e04[_0xa9cd('0x15')](_0x30f78e);}return _0x151e04[_0xa9cd('0x16')](_0x30f78e)[_0xa9cd('0x17')]();};}function respondWithResult(_0x46b5c5,_0x2ee2e2){_0x2ee2e2=_0x2ee2e2||0xc8;return function(_0x5859bf){if(_0x5859bf){return _0x46b5c5[_0xa9cd('0x16')](_0x2ee2e2)[_0xa9cd('0x18')](_0x5859bf);}};}function respondWithFilteredResult(_0x1be25f,_0x2512dd){return function(_0x1b57f9){if(_0x1b57f9){var _0x57c8af=typeof _0x2512dd[_0xa9cd('0x19')]===_0xa9cd('0x1a')&&typeof _0x2512dd['limit']===_0xa9cd('0x1a');var _0x423607=_0x1b57f9['count'];var _0x21c411=_0x57c8af?0x0:_0x2512dd['offset'];var _0xc3cfa=_0x57c8af?_0x1b57f9[_0xa9cd('0x1b')]:_0x2512dd[_0xa9cd('0x19')]+_0x2512dd[_0xa9cd('0x1c')];var _0x2ae3f4;if(_0xc3cfa>=_0x423607){_0xc3cfa=_0x423607;_0x2ae3f4=0xc8;}else{_0x2ae3f4=0xce;}_0x1be25f[_0xa9cd('0x16')](_0x2ae3f4);return _0x1be25f['set'](_0xa9cd('0x1d'),_0x21c411+'-'+_0xc3cfa+'/'+_0x423607)[_0xa9cd('0x18')](_0x1b57f9);}return null;};}function patchUpdates(_0x493624){return function(_0x512541){try{jsonpatch['apply'](_0x512541,_0x493624,!![]);}catch(_0x1327f1){return BPromise[_0xa9cd('0x1e')](_0x1327f1);}return _0x512541[_0xa9cd('0x1f')]();};}function saveUpdates(_0x2f0291,_0xc00247){return function(_0x3654b7){if(_0x3654b7){return _0x3654b7[_0xa9cd('0x20')](_0x2f0291)[_0xa9cd('0x21')](function(_0x745bbb){return _0x745bbb;});}return null;};}function removeEntity(_0x21efe9,_0x1261dd){return function(_0x223e4c){if(_0x223e4c){return _0x223e4c[_0xa9cd('0x22')]()['then'](function(){_0x21efe9[_0xa9cd('0x16')](0xcc)[_0xa9cd('0x17')]();});}};}function handleEntityNotFound(_0x4d191f,_0x449f5f){return function(_0x557908){if(!_0x557908){_0x4d191f[_0xa9cd('0x15')](0x194);}return _0x557908;};}function handleError(_0x19dc57,_0x3ffd1d){_0x3ffd1d=_0x3ffd1d||0x1f4;return function(_0x41ead3){logger['error'](_0x41ead3['stack']);if(_0x41ead3[_0xa9cd('0x23')]){delete _0x41ead3['name'];}_0x19dc57[_0xa9cd('0x16')](_0x3ffd1d)[_0xa9cd('0x24')](_0x41ead3);};}exports[_0xa9cd('0x25')]=function(_0x350eeb,_0x2d5292){var _0x3465e9={},_0x2e8755={},_0x112d6d={'count':0x0,'rows':[]};var _0x4bce4f=_[_0xa9cd('0x26')](db['SquareRecording'][_0xa9cd('0x27')],function(_0x72844e){return{'name':_0x72844e[_0xa9cd('0x28')],'type':_0x72844e[_0xa9cd('0x29')][_0xa9cd('0x2a')]};});_0x2e8755['model']=_[_0xa9cd('0x26')](_0x4bce4f,_0xa9cd('0x23'));_0x2e8755[_0xa9cd('0x2b')]=_[_0xa9cd('0x2c')](_0x350eeb[_0xa9cd('0x2b')]);_0x2e8755[_0xa9cd('0x2d')]=_[_0xa9cd('0x2e')](_0x2e8755['model'],_0x2e8755['query']);_0x3465e9[_0xa9cd('0x2f')]=_[_0xa9cd('0x2e')](_0x2e8755[_0xa9cd('0x30')],qs[_0xa9cd('0x31')](_0x350eeb['query'][_0xa9cd('0x31')]));_0x3465e9[_0xa9cd('0x2f')]=_0x3465e9[_0xa9cd('0x2f')][_0xa9cd('0x32')]?_0x3465e9['attributes']:_0x2e8755['model'];if(!_0x350eeb[_0xa9cd('0x2b')][_0xa9cd('0x33')](_0xa9cd('0x34'))){_0x3465e9[_0xa9cd('0x1c')]=qs[_0xa9cd('0x1c')](_0x350eeb[_0xa9cd('0x2b')][_0xa9cd('0x1c')]);_0x3465e9[_0xa9cd('0x19')]=qs['offset'](_0x350eeb[_0xa9cd('0x2b')][_0xa9cd('0x19')]);}_0x3465e9[_0xa9cd('0x35')]=qs[_0xa9cd('0x36')](_0x350eeb[_0xa9cd('0x2b')]['sort']);_0x3465e9[_0xa9cd('0x37')]=qs[_0xa9cd('0x2d')](_[_0xa9cd('0x38')](_0x350eeb[_0xa9cd('0x2b')],_0x2e8755[_0xa9cd('0x2d')]),_0x4bce4f);if(_0x350eeb[_0xa9cd('0x2b')]['filter']){_0x3465e9[_0xa9cd('0x37')]=_[_0xa9cd('0x39')](_0x3465e9[_0xa9cd('0x37')],{'$or':_[_0xa9cd('0x26')](_0x4bce4f,function(_0x503dec){if(_0x503dec['type']!==_0xa9cd('0x3a')){var _0x3842a7={};_0x3842a7[_0x503dec[_0xa9cd('0x23')]]={'$like':'%'+_0x350eeb[_0xa9cd('0x2b')][_0xa9cd('0x3b')]+'%'};return _0x3842a7;}})});}_0x3465e9=_[_0xa9cd('0x39')]({},_0x3465e9,_0x350eeb[_0xa9cd('0x3c')]);var _0x58feb1={'where':_0x3465e9[_0xa9cd('0x37')]};return db['SquareRecording'][_0xa9cd('0x1b')](_0x58feb1)[_0xa9cd('0x21')](function(_0x1250a6){_0x112d6d[_0xa9cd('0x1b')]=_0x1250a6;if(_0x350eeb[_0xa9cd('0x2b')][_0xa9cd('0x3d')]){_0x3465e9[_0xa9cd('0x3e')]=[{'all':!![]}];}return db[_0xa9cd('0x3f')][_0xa9cd('0x40')](_0x3465e9);})[_0xa9cd('0x21')](function(_0x54e629){_0x112d6d[_0xa9cd('0x41')]=_0x54e629;return _0x112d6d;})[_0xa9cd('0x21')](respondWithFilteredResult(_0x2d5292,_0x3465e9))[_0xa9cd('0x42')](handleError(_0x2d5292,null));};exports[_0xa9cd('0x43')]=function(_0x36ce4e,_0x5cf2bb){var _0x35a915={'raw':!![],'where':{'id':_0x36ce4e[_0xa9cd('0x44')]['id']}},_0x5c7e07={};_0x5c7e07[_0xa9cd('0x30')]=_[_0xa9cd('0x2c')](db['SquareRecording'][_0xa9cd('0x27')]);_0x5c7e07[_0xa9cd('0x2b')]=_[_0xa9cd('0x2c')](_0x36ce4e[_0xa9cd('0x2b')]);_0x5c7e07[_0xa9cd('0x2d')]=_[_0xa9cd('0x2e')](_0x5c7e07[_0xa9cd('0x30')],_0x5c7e07['query']);_0x35a915[_0xa9cd('0x2f')]=_[_0xa9cd('0x2e')](_0x5c7e07[_0xa9cd('0x30')],qs['fields'](_0x36ce4e[_0xa9cd('0x2b')]['fields']));_0x35a915['attributes']=_0x35a915[_0xa9cd('0x2f')][_0xa9cd('0x32')]?_0x35a915[_0xa9cd('0x2f')]:_0x5c7e07[_0xa9cd('0x30')];if(_0x36ce4e['query'][_0xa9cd('0x3d')]){_0x35a915['include']=[{'all':!![]}];}_0x35a915=_[_0xa9cd('0x39')]({},_0x35a915,_0x36ce4e[_0xa9cd('0x3c')]);return db[_0xa9cd('0x3f')][_0xa9cd('0x45')](_0x35a915)['then'](handleEntityNotFound(_0x5cf2bb,null))['then'](respondWithResult(_0x5cf2bb,null))[_0xa9cd('0x42')](handleError(_0x5cf2bb,null));};exports['create']=function(_0x4cff13,_0x5c92f7){return db[_0xa9cd('0x3f')][_0xa9cd('0x46')](_0x4cff13['body'],{})[_0xa9cd('0x21')](respondWithResult(_0x5c92f7,0xc9))[_0xa9cd('0x42')](handleError(_0x5c92f7,null));};exports[_0xa9cd('0x20')]=function(_0x282f36,_0x1ef077){if(_0x282f36[_0xa9cd('0x47')]['id']){delete _0x282f36[_0xa9cd('0x47')]['id'];}return db[_0xa9cd('0x3f')][_0xa9cd('0x45')]({'where':{'id':_0x282f36[_0xa9cd('0x44')]['id']}})[_0xa9cd('0x21')](handleEntityNotFound(_0x1ef077,null))[_0xa9cd('0x21')](saveUpdates(_0x282f36['body'],null))[_0xa9cd('0x21')](respondWithResult(_0x1ef077,null))[_0xa9cd('0x42')](handleError(_0x1ef077,null));};exports['download']=function(_0x30dd3a,_0x28b06a,_0x1f005a){var _0x41d75f=require(_0xa9cd('0x48'));var _0x7a5d3a=![];var _0x268d4b={};if(_0x30dd3a['query'][_0xa9cd('0x29')]&&_0x30dd3a[_0xa9cd('0x2b')][_0xa9cd('0x29')]==='uniqueid'){_0x268d4b[_0xa9cd('0x49')]=_0x30dd3a[_0xa9cd('0x44')]['id'];}else{_0x268d4b['id']=_0x30dd3a[_0xa9cd('0x44')]['id'];}return db[_0xa9cd('0x3f')][_0xa9cd('0x45')]({'where':_0x268d4b,'attributes':['id','savePath','filename'],'raw':!![]})['then'](handleEntityNotFound(_0x28b06a,null))['then'](function(_0x6d277f){if(_0x6d277f){var _0x2bfe48=_0x6d277f[_0xa9cd('0x4a')];var _0x467b43=util[_0xa9cd('0x4b')](_0xa9cd('0x4c'),_0x2bfe48);if(fs[_0xa9cd('0x4d')](_0x467b43)){_0x7a5d3a=!![];return _0x41d75f['decryptFile'](_0x467b43,_0x2bfe48,config[_0xa9cd('0x4e')][_0xa9cd('0x4f')])[_0xa9cd('0x21')](function(){return _0x6d277f;});}return _0x6d277f;}})[_0xa9cd('0x21')](function(_0x29a071){if(_0x29a071){var _0x30edf0=_0x29a071[_0xa9cd('0x4a')];if(!fs['existsSync'](_0x30edf0)){throw new db['Sequelize'][(_0xa9cd('0x50'))](_0xa9cd('0x51'));}if(_0x29a071['filename']){return _0x28b06a[_0xa9cd('0x52')](_0x30edf0,_0x29a071[_0xa9cd('0x53')]+path[_0xa9cd('0x54')](_0x30edf0),function(){if(_0x7a5d3a){fs[_0xa9cd('0x55')](_0x30edf0);}});}else{return _0x28b06a[_0xa9cd('0x52')](_0x30edf0,function(_0x1a24df){if(_0x7a5d3a){fs[_0xa9cd('0x55')](_0x30edf0);}});}}})[_0xa9cd('0x42')](function(_0x1e920a){if(_0x1e920a[_0xa9cd('0x56')]===_0xa9cd('0x51')){_0x28b06a[_0xa9cd('0x16')](0x194)['send'](_0xa9cd('0x57'));}else{return handleError(_0x28b06a,null);}});};exports[_0xa9cd('0x22')]=function(_0x59a201,_0x21598b){return db[_0xa9cd('0x3f')][_0xa9cd('0x45')]({'where':{'id':_0x59a201[_0xa9cd('0x44')]['id']}})['then'](function(_0x3aa422){if(_['isNil'](_0x3aa422)){throw new ReferenceError(_0xa9cd('0x58'));}return _0x3aa422;})[_0xa9cd('0x21')](function(_0x5149c0){var _0x416ad2=_0x5149c0[_0xa9cd('0x4a')];logger[_0xa9cd('0x59')](_0xa9cd('0x5a'),_0x416ad2);if(!_[_0xa9cd('0x5b')](_0x5149c0[_0xa9cd('0x4a')])&&fs[_0xa9cd('0x4d')](_0x416ad2)){logger[_0xa9cd('0x59')](_0xa9cd('0x5c')+_0x416ad2+_0xa9cd('0x5d'));fs[_0xa9cd('0x5e')](_0x416ad2);}_0x416ad2=_0x416ad2+_0xa9cd('0x5f');if(!_[_0xa9cd('0x5b')](_0x5149c0['savePath'])&&fs[_0xa9cd('0x4d')](_0x416ad2)){logger[_0xa9cd('0x59')]('File:\x20\x22'+_0x416ad2+_0xa9cd('0x5d'));fs[_0xa9cd('0x5e')](_0x416ad2);}return _0x5149c0;})[_0xa9cd('0x21')](function(_0x2e9297){if(!_0x2e9297)throw new InternalError();return _0x2e9297[_0xa9cd('0x22')]();})[_0xa9cd('0x21')](function(){_0x21598b['status'](0xcc)['end']();})[_0xa9cd('0x42')](handleError(_0x21598b,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 31b18ce..bffa788 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 _0x958a=['bluebird','request-promise','path','../../config/environment','exports','define','SquareRecording','square_recordings','lodash','util','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x958a,0x128));var _0xa958=function(_0x481cff,_0x24e3c7){_0x481cff=_0x481cff-0x0;var _0x1b3123=_0x958a[_0x481cff];return _0x1b3123;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var logger=require('../../config/logger')(_0xa958('0x2'));var moment=require(_0xa958('0x3'));var BPromise=require(_0xa958('0x4'));var rp=require(_0xa958('0x5'));var fs=require('fs');var path=require(_0xa958('0x6'));var rimraf=require('rimraf');var config=require(_0xa958('0x7'));var attributes=require('./squareRecording.attributes');module[_0xa958('0x8')]=function(_0x9b7d9e,_0x2692d6){return _0x9b7d9e[_0xa958('0x9')](_0xa958('0xa'),attributes,{'tableName':_0xa958('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x195f=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','lodash','util','api','moment','request-promise'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x195f,0x113));var _0xf195=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x195f[_0x30182f];return _0x5207db;};'use strict';var _=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var logger=require('../../config/logger')(_0xf195('0x2'));var moment=require(_0xf195('0x3'));var BPromise=require('bluebird');var rp=require(_0xf195('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf195('0x5'));var config=require(_0xf195('0x6'));var attributes=require(_0xf195('0x7'));module[_0xf195('0x8')]=function(_0x2c45fd,_0x7aeadd){return _0x2c45fd[_0xf195('0x9')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index f135b8f..a619d31 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 _0x9299=['raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','body','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9299,0x1dd));var _0x9929=function(_0x2c0610,_0x64bafb){_0x2c0610=_0x2c0610-0x0;var _0x1d7cda=_0x9299[_0x2c0610];return _0x1d7cda;};'use strict';var _=require(_0x9929('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9929('0x1'));var rs=require(_0x9929('0x2'));var fs=require('fs');var Redis=require(_0x9929('0x3'));var db=require(_0x9929('0x4'))['db'];var utils=require(_0x9929('0x5'));var logger=require(_0x9929('0x6'))(_0x9929('0x7'));var config=require(_0x9929('0x8'));var jayson=require(_0x9929('0x9'));var client=jayson[_0x9929('0xa')][_0x9929('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12b4e2,_0x130e40,_0x31a930){return new BPromise(function(_0x55e70e,_0x1261ee){return client[_0x9929('0xc')](_0x12b4e2,_0x31a930)[_0x9929('0xd')](function(_0x216625){logger[_0x9929('0xe')]('SquareRecording,\x20%s,\x20%s',_0x130e40,_0x9929('0xf'));logger[_0x9929('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x130e40,_0x9929('0xf'),JSON[_0x9929('0x11')](_0x216625));if(_0x216625[_0x9929('0x12')]){if(_0x216625[_0x9929('0x12')][_0x9929('0x13')]===0x1f4){logger[_0x9929('0x12')](_0x9929('0x14'),_0x130e40,_0x216625[_0x9929('0x12')][_0x9929('0x15')]);return _0x1261ee(_0x216625[_0x9929('0x12')][_0x9929('0x15')]);}logger[_0x9929('0x12')](_0x9929('0x14'),_0x130e40,_0x216625['error']['message']);return _0x55e70e(_0x216625[_0x9929('0x12')][_0x9929('0x15')]);}else{logger[_0x9929('0xe')](_0x9929('0x14'),_0x130e40,_0x9929('0xf'));_0x55e70e(_0x216625[_0x9929('0x16')][_0x9929('0x15')]);}})[_0x9929('0x17')](function(_0x584838){logger[_0x9929('0x12')](_0x9929('0x14'),_0x130e40,_0x584838);_0x1261ee(_0x584838);});});}exports[_0x9929('0x18')]=function(_0x114998){var _0xc973ca=this;return new Promise(function(_0x2c34c3,_0x45d992){return db['SquareRecording']['create'](_0x114998[_0x9929('0x19')],{'raw':_0x114998[_0x9929('0x1a')]?_0x114998['options'][_0x9929('0x1b')]===undefined?!![]:![]:!![]})[_0x9929('0xd')](function(_0x48be31){logger[_0x9929('0xe')](_0x9929('0x18'),_0x114998);logger[_0x9929('0x10')](_0x9929('0x18'),_0x114998,JSON[_0x9929('0x11')](_0x48be31));_0x2c34c3(_0x48be31);})['catch'](function(_0xe75a27){logger[_0x9929('0x12')](_0x9929('0x18'),_0xe75a27[_0x9929('0x15')],_0x114998);_0x45d992(_0xc973ca[_0x9929('0x12')](0x1f4,_0xe75a27[_0x9929('0x15')]));});});}; \ No newline at end of file +var _0x033f=['rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','body','options','then','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x033f,0x172));var _0xf033=function(_0xb72cc8,_0x3b7aa3){_0xb72cc8=_0xb72cc8-0x0;var _0x75cfb3=_0x033f[_0xb72cc8];return _0x75cfb3;};'use strict';var _=require(_0xf033('0x0'));var util=require(_0xf033('0x1'));var moment=require('moment');var BPromise=require(_0xf033('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf033('0x3'));var db=require(_0xf033('0x4'))['db'];var utils=require(_0xf033('0x5'));var logger=require(_0xf033('0x6'))(_0xf033('0x7'));var config=require(_0xf033('0x8'));var jayson=require(_0xf033('0x9'));var client=jayson[_0xf033('0xa')][_0xf033('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cf258,_0x4f5d20,_0x32b9d3){return new BPromise(function(_0xf815e1,_0x486018){return client[_0xf033('0xc')](_0x4cf258,_0x32b9d3)['then'](function(_0x573db9){logger[_0xf033('0xd')](_0xf033('0xe'),_0x4f5d20,_0xf033('0xf'));logger['debug'](_0xf033('0x10'),_0x4f5d20,_0xf033('0xf'),JSON[_0xf033('0x11')](_0x573db9));if(_0x573db9[_0xf033('0x12')]){if(_0x573db9[_0xf033('0x12')][_0xf033('0x13')]===0x1f4){logger[_0xf033('0x12')](_0xf033('0xe'),_0x4f5d20,_0x573db9[_0xf033('0x12')]['message']);return _0x486018(_0x573db9[_0xf033('0x12')][_0xf033('0x14')]);}logger['error'](_0xf033('0xe'),_0x4f5d20,_0x573db9['error']['message']);return _0xf815e1(_0x573db9['error']['message']);}else{logger['info'](_0xf033('0xe'),_0x4f5d20,_0xf033('0xf'));_0xf815e1(_0x573db9[_0xf033('0x15')][_0xf033('0x14')]);}})[_0xf033('0x16')](function(_0x415579){logger[_0xf033('0x12')]('SquareRecording,\x20%s,\x20%s',_0x4f5d20,_0x415579);_0x486018(_0x415579);});});}exports[_0xf033('0x17')]=function(_0x4ed04b){var _0x55091d=this;return new Promise(function(_0x27c6a0,_0x5f3274){return db[_0xf033('0x18')]['create'](_0x4ed04b[_0xf033('0x19')],{'raw':_0x4ed04b['options']?_0x4ed04b[_0xf033('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xf033('0x1b')](function(_0x277c16){logger[_0xf033('0xd')](_0xf033('0x17'),_0x4ed04b);logger[_0xf033('0x1c')](_0xf033('0x17'),_0x4ed04b,JSON[_0xf033('0x11')](_0x277c16));_0x27c6a0(_0x277c16);})[_0xf033('0x16')](function(_0x262a2b){logger['error'](_0xf033('0x17'),_0x262a2b['message'],_0x4ed04b);_0x5f3274(_0x55091d[_0xf033('0x12')](0x1f4,_0x262a2b[_0xf033('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 29df4c3..fc41464 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 _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(_0x16d4b6,_0x527555){var _0xeeaf29=function(_0x272d27){while(--_0x272d27){_0x16d4b6['push'](_0x16d4b6['shift']());}};_0xeeaf29(++_0x527555);}(_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('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4ea515,_0x8efc09){var _0xb791cd=function(_0x3f8cc6){while(--_0x3f8cc6){_0x4ea515['push'](_0x4ea515['shift']());}};_0xb791cd(++_0x8efc09);}(_0xb10b,0x12a));var _0xbb10=function(_0x11e90b,_0x3ec29a){_0x11e90b=_0x11e90b-0x0;var _0x31452e=_0xb10b[_0x11e90b];return _0x31452e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 0cca335..2bf4369 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 _0xa179=['STRING','DATE','BOOLEAN'];(function(_0x4a23bb,_0x3aa84f){var _0x144eae=function(_0x47e8da){while(--_0x47e8da){_0x4a23bb['push'](_0x4a23bb['shift']());}};_0x144eae(++_0x3aa84f);}(_0xa179,0x14a));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0x9a17('0x0')]},'network_script':{'type':Sequelize[_0x9a17('0x0')]},'request':{'type':Sequelize[_0x9a17('0x0')]},'channel':{'type':Sequelize[_0x9a17('0x0')]},'language':{'type':Sequelize[_0x9a17('0x0')]},'type':{'type':Sequelize[_0x9a17('0x0')]},'uniqueid':{'type':Sequelize[_0x9a17('0x0')]},'version':{'type':Sequelize[_0x9a17('0x0')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9a17('0x0')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x9a17('0x0')]},'callington':{'type':Sequelize[_0x9a17('0x0')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x9a17('0x0')]},'context':{'type':Sequelize[_0x9a17('0x0')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9a17('0x0')]},'enhanced':{'type':Sequelize[_0x9a17('0x0')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x9a17('0x0')]},'joinAt':{'type':Sequelize[_0x9a17('0x1')]},'leaveAt':{'type':Sequelize[_0x9a17('0x1')]},'bot':{'type':Sequelize[_0x9a17('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xdc69=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x44458e,_0x91862c){var _0x68756c=function(_0x5b8765){while(--_0x5b8765){_0x44458e['push'](_0x44458e['shift']());}};_0x68756c(++_0x91862c);}(_0xdc69,0x19a));var _0x9dc6=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0xdc69[_0xd8aad0];return _0x570860;};'use strict';var Sequelize=require(_0x9dc6('0x0'));module[_0x9dc6('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x9dc6('0x2')]},'request':{'type':Sequelize[_0x9dc6('0x2')]},'channel':{'type':Sequelize[_0x9dc6('0x2')]},'language':{'type':Sequelize[_0x9dc6('0x2')]},'type':{'type':Sequelize[_0x9dc6('0x2')]},'uniqueid':{'type':Sequelize[_0x9dc6('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9dc6('0x2')]},'calleridname':{'type':Sequelize[_0x9dc6('0x2')]},'callingpres':{'type':Sequelize[_0x9dc6('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x9dc6('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x9dc6('0x2')]},'context':{'type':Sequelize[_0x9dc6('0x2')]},'extension':{'type':Sequelize[_0x9dc6('0x2')]},'priority':{'type':Sequelize[_0x9dc6('0x2')]},'enhanced':{'type':Sequelize[_0x9dc6('0x2')]},'accountcode':{'type':Sequelize[_0x9dc6('0x2')]},'threadid':{'type':Sequelize[_0x9dc6('0x2')]},'project_name':{'type':Sequelize[_0x9dc6('0x2')]},'joinAt':{'type':Sequelize[_0x9dc6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x9dc6('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 1812bbe..e1edb0e 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 _0x6e98=['body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','then','destroy','error','stack','name','send','map','SquareReport','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','params','keys','model','find','create'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x6e98,0x123));var _0x86e9=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0x6e98[_0x2fa1c6];return _0x5f3257;};'use strict';var emlformat=require(_0x86e9('0x0'));var rimraf=require(_0x86e9('0x1'));var zipdir=require(_0x86e9('0x2'));var jsonpatch=require(_0x86e9('0x3'));var rp=require(_0x86e9('0x4'));var moment=require(_0x86e9('0x5'));var BPromise=require(_0x86e9('0x6'));var Mustache=require(_0x86e9('0x7'));var util=require('util');var path=require(_0x86e9('0x8'));var sox=require('sox');var csv=require(_0x86e9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86e9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86e9('0xb'));var deskjs=require(_0x86e9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x86e9('0xd'));var Papa=require('papaparse');var Redis=require(_0x86e9('0xe'));var authService=require(_0x86e9('0xf'));var qs=require(_0x86e9('0x10'));var as=require(_0x86e9('0x11'));var hardwareService=require(_0x86e9('0x12'));var logger=require('../../config/logger')(_0x86e9('0x13'));var utils=require(_0x86e9('0x14'));var config=require(_0x86e9('0x15'));var licenseUtil=require(_0x86e9('0x16'));var db=require(_0x86e9('0x17'))['db'];function respondWithStatusCode(_0xe7b05b,_0x1e4ddd){_0x1e4ddd=_0x1e4ddd||0xcc;return function(_0xeab269){if(_0xeab269){return _0xe7b05b[_0x86e9('0x18')](_0x1e4ddd);}return _0xe7b05b[_0x86e9('0x19')](_0x1e4ddd)[_0x86e9('0x1a')]();};}function respondWithResult(_0x322fd8,_0x2b70c7){_0x2b70c7=_0x2b70c7||0xc8;return function(_0x238b0e){if(_0x238b0e){return _0x322fd8[_0x86e9('0x19')](_0x2b70c7)[_0x86e9('0x1b')](_0x238b0e);}};}function respondWithFilteredResult(_0x549c25,_0x441230){return function(_0x46532e){if(_0x46532e){var _0xf210ba=typeof _0x441230[_0x86e9('0x1c')]===_0x86e9('0x1d')&&typeof _0x441230['limit']==='undefined';var _0x3ce396=_0x46532e[_0x86e9('0x1e')];var _0x371d17=_0xf210ba?0x0:_0x441230[_0x86e9('0x1c')];var _0x10131a=_0xf210ba?_0x46532e[_0x86e9('0x1e')]:_0x441230['offset']+_0x441230[_0x86e9('0x1f')];var _0xcd57c1;if(_0x10131a>=_0x3ce396){_0x10131a=_0x3ce396;_0xcd57c1=0xc8;}else{_0xcd57c1=0xce;}_0x549c25[_0x86e9('0x19')](_0xcd57c1);return _0x549c25['set'](_0x86e9('0x20'),_0x371d17+'-'+_0x10131a+'/'+_0x3ce396)[_0x86e9('0x1b')](_0x46532e);}return null;};}function patchUpdates(_0x1af6a8){return function(_0x23f910){try{jsonpatch[_0x86e9('0x21')](_0x23f910,_0x1af6a8,!![]);}catch(_0x15aa07){return BPromise['reject'](_0x15aa07);}return _0x23f910['save']();};}function saveUpdates(_0x3045da,_0x1ad820){return function(_0x53f022){if(_0x53f022){return _0x53f022['update'](_0x3045da)[_0x86e9('0x22')](function(_0x3b670b){return _0x3b670b;});}return null;};}function removeEntity(_0x45f0a9,_0x54b36b){return function(_0x485beb){if(_0x485beb){return _0x485beb[_0x86e9('0x23')]()[_0x86e9('0x22')](function(){_0x45f0a9['status'](0xcc)[_0x86e9('0x1a')]();});}};}function handleEntityNotFound(_0x4558c7,_0x2e626a){return function(_0x5b4e17){if(!_0x5b4e17){_0x4558c7[_0x86e9('0x18')](0x194);}return _0x5b4e17;};}function handleError(_0x45b731,_0x3a519d){_0x3a519d=_0x3a519d||0x1f4;return function(_0x35fa8b){logger[_0x86e9('0x24')](_0x35fa8b[_0x86e9('0x25')]);if(_0x35fa8b[_0x86e9('0x26')]){delete _0x35fa8b[_0x86e9('0x26')];}_0x45b731['status'](_0x3a519d)[_0x86e9('0x27')](_0x35fa8b);};}exports['index']=function(_0x53b2b7,_0x10847f){var _0x282da5={},_0x4dedc3={},_0x3adf07={'count':0x0,'rows':[]};var _0x175337=_[_0x86e9('0x28')](db[_0x86e9('0x29')][_0x86e9('0x2a')],function(_0x42db82){return{'name':_0x42db82[_0x86e9('0x2b')],'type':_0x42db82[_0x86e9('0x2c')][_0x86e9('0x2d')]};});_0x4dedc3['model']=_[_0x86e9('0x28')](_0x175337,_0x86e9('0x26'));_0x4dedc3['query']=_['keys'](_0x53b2b7[_0x86e9('0x2e')]);_0x4dedc3[_0x86e9('0x2f')]=_['intersection'](_0x4dedc3['model'],_0x4dedc3[_0x86e9('0x2e')]);_0x282da5[_0x86e9('0x30')]=_[_0x86e9('0x31')](_0x4dedc3['model'],qs['fields'](_0x53b2b7['query'][_0x86e9('0x32')]));_0x282da5[_0x86e9('0x30')]=_0x282da5[_0x86e9('0x30')][_0x86e9('0x33')]?_0x282da5[_0x86e9('0x30')]:_0x4dedc3['model'];if(!_0x53b2b7['query'][_0x86e9('0x34')](_0x86e9('0x35'))){_0x282da5[_0x86e9('0x1f')]=qs['limit'](_0x53b2b7['query'][_0x86e9('0x1f')]);_0x282da5[_0x86e9('0x1c')]=qs[_0x86e9('0x1c')](_0x53b2b7[_0x86e9('0x2e')][_0x86e9('0x1c')]);}_0x282da5['order']=qs[_0x86e9('0x36')](_0x53b2b7['query'][_0x86e9('0x36')]);_0x282da5['where']=qs[_0x86e9('0x2f')](_[_0x86e9('0x37')](_0x53b2b7[_0x86e9('0x2e')],_0x4dedc3[_0x86e9('0x2f')]),_0x175337);if(_0x53b2b7[_0x86e9('0x2e')][_0x86e9('0x38')]){_0x282da5[_0x86e9('0x39')]=_['merge'](_0x282da5[_0x86e9('0x39')],{'$or':_[_0x86e9('0x28')](_0x175337,function(_0x3ce499){if(_0x3ce499[_0x86e9('0x2c')]!=='VIRTUAL'){var _0x48706e={};_0x48706e[_0x3ce499[_0x86e9('0x26')]]={'$like':'%'+_0x53b2b7['query']['filter']+'%'};return _0x48706e;}})});}_0x282da5=_[_0x86e9('0x3a')]({},_0x282da5,_0x53b2b7[_0x86e9('0x3b')]);var _0x3fd793={'where':_0x282da5[_0x86e9('0x39')]};return db['SquareReport'][_0x86e9('0x1e')](_0x3fd793)[_0x86e9('0x22')](function(_0x3b56bd){_0x3adf07['count']=_0x3b56bd;if(_0x53b2b7[_0x86e9('0x2e')][_0x86e9('0x3c')]){_0x282da5[_0x86e9('0x3d')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x282da5);})[_0x86e9('0x22')](function(_0x416075){_0x3adf07[_0x86e9('0x3e')]=_0x416075;return _0x3adf07;})[_0x86e9('0x22')](respondWithFilteredResult(_0x10847f,_0x282da5))[_0x86e9('0x3f')](handleError(_0x10847f,null));};exports['show']=function(_0x43aa93,_0x5d928e){var _0x5c273b={'raw':!![],'where':{'id':_0x43aa93[_0x86e9('0x40')]['id']}},_0x570f83={};_0x570f83['model']=_[_0x86e9('0x41')](db[_0x86e9('0x29')][_0x86e9('0x2a')]);_0x570f83[_0x86e9('0x2e')]=_[_0x86e9('0x41')](_0x43aa93[_0x86e9('0x2e')]);_0x570f83[_0x86e9('0x2f')]=_['intersection'](_0x570f83['model'],_0x570f83[_0x86e9('0x2e')]);_0x5c273b[_0x86e9('0x30')]=_[_0x86e9('0x31')](_0x570f83['model'],qs[_0x86e9('0x32')](_0x43aa93[_0x86e9('0x2e')][_0x86e9('0x32')]));_0x5c273b[_0x86e9('0x30')]=_0x5c273b['attributes'][_0x86e9('0x33')]?_0x5c273b['attributes']:_0x570f83[_0x86e9('0x42')];if(_0x43aa93['query']['includeAll']){_0x5c273b[_0x86e9('0x3d')]=[{'all':!![]}];}_0x5c273b=_[_0x86e9('0x3a')]({},_0x5c273b,_0x43aa93[_0x86e9('0x3b')]);return db[_0x86e9('0x29')][_0x86e9('0x43')](_0x5c273b)['then'](handleEntityNotFound(_0x5d928e,null))[_0x86e9('0x22')](respondWithResult(_0x5d928e,null))[_0x86e9('0x3f')](handleError(_0x5d928e,null));};exports['create']=function(_0x4508c2,_0x97566b){return db['SquareReport'][_0x86e9('0x44')](_0x4508c2[_0x86e9('0x45')],{})['then'](respondWithResult(_0x97566b,0xc9))[_0x86e9('0x3f')](handleError(_0x97566b,null));};exports[_0x86e9('0x46')]=function(_0x511193,_0x59d9de){if(_0x511193['body']['id']){delete _0x511193[_0x86e9('0x45')]['id'];}return db['SquareReport'][_0x86e9('0x43')]({'where':{'id':_0x511193[_0x86e9('0x40')]['id']}})[_0x86e9('0x22')](handleEntityNotFound(_0x59d9de,null))['then'](saveUpdates(_0x511193[_0x86e9('0x45')],null))[_0x86e9('0x22')](respondWithResult(_0x59d9de,null))['catch'](handleError(_0x59d9de,null));};exports[_0x86e9('0x23')]=function(_0x10f821,_0x3cfd88){return db[_0x86e9('0x29')]['find']({'where':{'id':_0x10f821[_0x86e9('0x40')]['id']}})['then'](handleEntityNotFound(_0x3cfd88,null))['then'](removeEntity(_0x3cfd88,null))[_0x86e9('0x3f')](handleError(_0x3cfd88,null));};exports[_0x86e9('0x47')]=function(_0x204529,_0x2b7ed9){return db['SquareReport'][_0x86e9('0x47')]()[_0x86e9('0x22')](respondWithResult(_0x2b7ed9,null))[_0x86e9('0x3f')](handleError(_0x2b7ed9,null));}; \ No newline at end of file +var _0x555e=['set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','SquareReport','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset'];(function(_0x5111c6,_0x2a5eca){var _0x517c0d=function(_0x2d9d42){while(--_0x2d9d42){_0x5111c6['push'](_0x5111c6['shift']());}};_0x517c0d(++_0x2a5eca);}(_0x555e,0x1ec));var _0xe555=function(_0x4499c9,_0x461a13){_0x4499c9=_0x4499c9-0x0;var _0x3023ad=_0x555e[_0x4499c9];return _0x3023ad;};'use strict';var emlformat=require(_0xe555('0x0'));var rimraf=require(_0xe555('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe555('0x2'));var rp=require('request-promise');var moment=require(_0xe555('0x3'));var BPromise=require(_0xe555('0x4'));var Mustache=require(_0xe555('0x5'));var util=require(_0xe555('0x6'));var path=require(_0xe555('0x7'));var sox=require(_0xe555('0x8'));var csv=require(_0xe555('0x9'));var ejs=require(_0xe555('0xa'));var fs=require('fs');var fs_extra=require(_0xe555('0xb'));var _=require(_0xe555('0xc'));var squel=require(_0xe555('0xd'));var crypto=require(_0xe555('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe555('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe555('0x10'));var Papa=require('papaparse');var Redis=require(_0xe555('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe555('0x12'));var hardwareService=require(_0xe555('0x13'));var logger=require(_0xe555('0x14'))(_0xe555('0x15'));var utils=require(_0xe555('0x16'));var config=require(_0xe555('0x17'));var licenseUtil=require(_0xe555('0x18'));var db=require(_0xe555('0x19'))['db'];function respondWithStatusCode(_0x346514,_0x3ea5f8){_0x3ea5f8=_0x3ea5f8||0xcc;return function(_0xfa1c48){if(_0xfa1c48){return _0x346514[_0xe555('0x1a')](_0x3ea5f8);}return _0x346514['status'](_0x3ea5f8)['end']();};}function respondWithResult(_0x6a354a,_0x2b6d17){_0x2b6d17=_0x2b6d17||0xc8;return function(_0x2bbcf9){if(_0x2bbcf9){return _0x6a354a[_0xe555('0x1b')](_0x2b6d17)[_0xe555('0x1c')](_0x2bbcf9);}};}function respondWithFilteredResult(_0x1839eb,_0x1772a2){return function(_0x3b392c){if(_0x3b392c){var _0x362504=typeof _0x1772a2['offset']===_0xe555('0x1d')&&typeof _0x1772a2[_0xe555('0x1e')]===_0xe555('0x1d');var _0xb217f1=_0x3b392c[_0xe555('0x1f')];var _0x5be5e9=_0x362504?0x0:_0x1772a2['offset'];var _0x209cc7=_0x362504?_0x3b392c[_0xe555('0x1f')]:_0x1772a2[_0xe555('0x20')]+_0x1772a2[_0xe555('0x1e')];var _0x56e639;if(_0x209cc7>=_0xb217f1){_0x209cc7=_0xb217f1;_0x56e639=0xc8;}else{_0x56e639=0xce;}_0x1839eb[_0xe555('0x1b')](_0x56e639);return _0x1839eb[_0xe555('0x21')](_0xe555('0x22'),_0x5be5e9+'-'+_0x209cc7+'/'+_0xb217f1)[_0xe555('0x1c')](_0x3b392c);}return null;};}function patchUpdates(_0x2ea1e3){return function(_0xc2e722){try{jsonpatch[_0xe555('0x23')](_0xc2e722,_0x2ea1e3,!![]);}catch(_0x3ddb86){return BPromise[_0xe555('0x24')](_0x3ddb86);}return _0xc2e722['save']();};}function saveUpdates(_0x112539,_0x2eeb27){return function(_0x567f93){if(_0x567f93){return _0x567f93['update'](_0x112539)[_0xe555('0x25')](function(_0x578ecc){return _0x578ecc;});}return null;};}function removeEntity(_0x87a557,_0x302211){return function(_0x1293e7){if(_0x1293e7){return _0x1293e7[_0xe555('0x26')]()['then'](function(){_0x87a557['status'](0xcc)[_0xe555('0x27')]();});}};}function handleEntityNotFound(_0x596680,_0x54fe4f){return function(_0x1dbc44){if(!_0x1dbc44){_0x596680[_0xe555('0x1a')](0x194);}return _0x1dbc44;};}function handleError(_0x545012,_0x43017b){_0x43017b=_0x43017b||0x1f4;return function(_0x9db03e){logger[_0xe555('0x28')](_0x9db03e[_0xe555('0x29')]);if(_0x9db03e['name']){delete _0x9db03e[_0xe555('0x2a')];}_0x545012[_0xe555('0x1b')](_0x43017b)[_0xe555('0x2b')](_0x9db03e);};}exports['index']=function(_0xd00f8f,_0x5b6c70){var _0x2950fa={},_0x3f684e={},_0x235ceb={'count':0x0,'rows':[]};var _0x52300c=_['map'](db[_0xe555('0x2c')][_0xe555('0x2d')],function(_0x214610){return{'name':_0x214610['fieldName'],'type':_0x214610['type'][_0xe555('0x2e')]};});_0x3f684e[_0xe555('0x2f')]=_[_0xe555('0x30')](_0x52300c,_0xe555('0x2a'));_0x3f684e[_0xe555('0x31')]=_[_0xe555('0x32')](_0xd00f8f['query']);_0x3f684e[_0xe555('0x33')]=_['intersection'](_0x3f684e['model'],_0x3f684e[_0xe555('0x31')]);_0x2950fa[_0xe555('0x34')]=_[_0xe555('0x35')](_0x3f684e[_0xe555('0x2f')],qs[_0xe555('0x36')](_0xd00f8f['query'][_0xe555('0x36')]));_0x2950fa[_0xe555('0x34')]=_0x2950fa[_0xe555('0x34')][_0xe555('0x37')]?_0x2950fa['attributes']:_0x3f684e[_0xe555('0x2f')];if(!_0xd00f8f[_0xe555('0x31')][_0xe555('0x38')]('nolimit')){_0x2950fa['limit']=qs[_0xe555('0x1e')](_0xd00f8f[_0xe555('0x31')][_0xe555('0x1e')]);_0x2950fa[_0xe555('0x20')]=qs['offset'](_0xd00f8f[_0xe555('0x31')][_0xe555('0x20')]);}_0x2950fa['order']=qs[_0xe555('0x39')](_0xd00f8f[_0xe555('0x31')][_0xe555('0x39')]);_0x2950fa[_0xe555('0x3a')]=qs[_0xe555('0x33')](_[_0xe555('0x3b')](_0xd00f8f[_0xe555('0x31')],_0x3f684e[_0xe555('0x33')]),_0x52300c);if(_0xd00f8f[_0xe555('0x31')][_0xe555('0x3c')]){_0x2950fa[_0xe555('0x3a')]=_[_0xe555('0x3d')](_0x2950fa[_0xe555('0x3a')],{'$or':_['map'](_0x52300c,function(_0x196c91){if(_0x196c91['type']!=='VIRTUAL'){var _0x3a0a38={};_0x3a0a38[_0x196c91[_0xe555('0x2a')]]={'$like':'%'+_0xd00f8f[_0xe555('0x31')]['filter']+'%'};return _0x3a0a38;}})});}_0x2950fa=_['merge']({},_0x2950fa,_0xd00f8f['options']);var _0x756a3a={'where':_0x2950fa[_0xe555('0x3a')]};return db['SquareReport'][_0xe555('0x1f')](_0x756a3a)[_0xe555('0x25')](function(_0xe0f818){_0x235ceb[_0xe555('0x1f')]=_0xe0f818;if(_0xd00f8f['query'][_0xe555('0x3e')]){_0x2950fa[_0xe555('0x3f')]=[{'all':!![]}];}return db[_0xe555('0x2c')][_0xe555('0x40')](_0x2950fa);})[_0xe555('0x25')](function(_0x5f96bd){_0x235ceb[_0xe555('0x41')]=_0x5f96bd;return _0x235ceb;})[_0xe555('0x25')](respondWithFilteredResult(_0x5b6c70,_0x2950fa))[_0xe555('0x42')](handleError(_0x5b6c70,null));};exports[_0xe555('0x43')]=function(_0x43e3e6,_0x2db41d){var _0x460f4f={'raw':!![],'where':{'id':_0x43e3e6[_0xe555('0x44')]['id']}},_0x24bf09={};_0x24bf09[_0xe555('0x2f')]=_['keys'](db['SquareReport'][_0xe555('0x2d')]);_0x24bf09['query']=_[_0xe555('0x32')](_0x43e3e6['query']);_0x24bf09['filters']=_[_0xe555('0x35')](_0x24bf09[_0xe555('0x2f')],_0x24bf09[_0xe555('0x31')]);_0x460f4f[_0xe555('0x34')]=_['intersection'](_0x24bf09[_0xe555('0x2f')],qs['fields'](_0x43e3e6[_0xe555('0x31')]['fields']));_0x460f4f['attributes']=_0x460f4f[_0xe555('0x34')]['length']?_0x460f4f[_0xe555('0x34')]:_0x24bf09[_0xe555('0x2f')];if(_0x43e3e6['query']['includeAll']){_0x460f4f[_0xe555('0x3f')]=[{'all':!![]}];}_0x460f4f=_[_0xe555('0x3d')]({},_0x460f4f,_0x43e3e6[_0xe555('0x45')]);return db[_0xe555('0x2c')][_0xe555('0x46')](_0x460f4f)[_0xe555('0x25')](handleEntityNotFound(_0x2db41d,null))[_0xe555('0x25')](respondWithResult(_0x2db41d,null))[_0xe555('0x42')](handleError(_0x2db41d,null));};exports[_0xe555('0x47')]=function(_0x448d9f,_0x157a04){return db[_0xe555('0x2c')][_0xe555('0x47')](_0x448d9f[_0xe555('0x48')],{})['then'](respondWithResult(_0x157a04,0xc9))['catch'](handleError(_0x157a04,null));};exports[_0xe555('0x49')]=function(_0xdd40c0,_0x1a2b0e){if(_0xdd40c0['body']['id']){delete _0xdd40c0[_0xe555('0x48')]['id'];}return db[_0xe555('0x2c')][_0xe555('0x46')]({'where':{'id':_0xdd40c0[_0xe555('0x44')]['id']}})[_0xe555('0x25')](handleEntityNotFound(_0x1a2b0e,null))[_0xe555('0x25')](saveUpdates(_0xdd40c0['body'],null))[_0xe555('0x25')](respondWithResult(_0x1a2b0e,null))[_0xe555('0x42')](handleError(_0x1a2b0e,null));};exports[_0xe555('0x26')]=function(_0x3d16bb,_0x14247f){return db['SquareReport'][_0xe555('0x46')]({'where':{'id':_0x3d16bb[_0xe555('0x44')]['id']}})[_0xe555('0x25')](handleEntityNotFound(_0x14247f,null))[_0xe555('0x25')](removeEntity(_0x14247f,null))[_0xe555('0x42')](handleError(_0x14247f,null));};exports[_0xe555('0x4a')]=function(_0xb84dc6,_0x31b4a5){return db[_0xe555('0x2c')][_0xe555('0x4a')]()['then'](respondWithResult(_0x31b4a5,null))[_0xe555('0x42')](handleError(_0x31b4a5,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 2d01ca7..95624cb 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 _0x3549=['path','rimraf','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3549,0x1ad));var _0x9354=function(_0x187d75,_0x207d8d){_0x187d75=_0x187d75-0x0;var _0x10aa50=_0x3549[_0x187d75];return _0x10aa50;};'use strict';var _=require(_0x9354('0x0'));var util=require(_0x9354('0x1'));var logger=require(_0x9354('0x2'))('api');var moment=require(_0x9354('0x3'));var BPromise=require(_0x9354('0x4'));var rp=require(_0x9354('0x5'));var fs=require('fs');var path=require(_0x9354('0x6'));var rimraf=require(_0x9354('0x7'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x9354('0x8')]=function(_0xb3f3e2,_0x121216){return _0xb3f3e2[_0x9354('0x9')](_0x9354('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x9354('0xb'),'fields':[_0x9354('0xc'),_0x9354('0xd')]},{'name':_0x9354('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5131=['uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square'];(function(_0x49684b,_0x464608){var _0x4b5692=function(_0x4d9ab0){while(--_0x4d9ab0){_0x49684b['push'](_0x49684b['shift']());}};_0x4b5692(++_0x464608);}(_0x5131,0x112));var _0x1513=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5131[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x1513('0x0'));var logger=require(_0x1513('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1513('0x2'));var rp=require(_0x1513('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1513('0x4'));var config=require(_0x1513('0x5'));var attributes=require(_0x1513('0x6'));module[_0x1513('0x7')]=function(_0x3270b6,_0x3a032b){return _0x3270b6[_0x1513('0x8')](_0x1513('0x9'),attributes,{'tableName':_0x1513('0xa'),'paranoid':![],'indexes':[{'name':_0x1513('0xb'),'fields':[_0x1513('0xc'),_0x1513('0xd')]},{'name':_0x1513('0xe'),'fields':[_0x1513('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 9d49eed..955a77e 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 _0xdbab=['info','result','catch','CreateSquareReport','SquareReport','create','options','raw','update','body','where','limit','UpdateSquareReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x5a913b,_0x23c63d){var _0x5b53a8=function(_0x1d3440){while(--_0x1d3440){_0x5a913b['push'](_0x5a913b['shift']());}};_0x5b53a8(++_0x23c63d);}(_0xdbab,0x1cd));var _0xbdba=function(_0x49c341,_0x5b9570){_0x49c341=_0x49c341-0x0;var _0x1c106d=_0xdbab[_0x49c341];return _0x1c106d;};'use strict';var _=require('lodash');var util=require(_0xbdba('0x0'));var moment=require(_0xbdba('0x1'));var BPromise=require('bluebird');var rs=require(_0xbdba('0x2'));var fs=require('fs');var Redis=require(_0xbdba('0x3'));var db=require(_0xbdba('0x4'))['db'];var utils=require(_0xbdba('0x5'));var logger=require(_0xbdba('0x6'))(_0xbdba('0x7'));var config=require(_0xbdba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbdba('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x629d68,_0x2e293c,_0x5dd33a){return new BPromise(function(_0x2baa7a,_0x2e88e1){return client['request'](_0x629d68,_0x5dd33a)[_0xbdba('0xa')](function(_0x33a3db){logger['info'](_0xbdba('0xb'),_0x2e293c,'request\x20sent');logger[_0xbdba('0xc')](_0xbdba('0xd'),_0x2e293c,_0xbdba('0xe'),JSON[_0xbdba('0xf')](_0x33a3db));if(_0x33a3db['error']){if(_0x33a3db['error'][_0xbdba('0x10')]===0x1f4){logger[_0xbdba('0x11')](_0xbdba('0xb'),_0x2e293c,_0x33a3db[_0xbdba('0x11')][_0xbdba('0x12')]);return _0x2e88e1(_0x33a3db[_0xbdba('0x11')][_0xbdba('0x12')]);}logger[_0xbdba('0x11')](_0xbdba('0xb'),_0x2e293c,_0x33a3db[_0xbdba('0x11')]['message']);return _0x2baa7a(_0x33a3db[_0xbdba('0x11')][_0xbdba('0x12')]);}else{logger[_0xbdba('0x13')]('SquareReport,\x20%s,\x20%s',_0x2e293c,_0xbdba('0xe'));_0x2baa7a(_0x33a3db[_0xbdba('0x14')][_0xbdba('0x12')]);}})[_0xbdba('0x15')](function(_0x1c6331){logger[_0xbdba('0x11')](_0xbdba('0xb'),_0x2e293c,_0x1c6331);_0x2e88e1(_0x1c6331);});});}exports[_0xbdba('0x16')]=function(_0x22bb92){var _0xaa80af=this;return new Promise(function(_0xf5fa3f,_0x4019e3){return db[_0xbdba('0x17')][_0xbdba('0x18')](_0x22bb92['body'],{'raw':_0x22bb92[_0xbdba('0x19')]?_0x22bb92[_0xbdba('0x19')][_0xbdba('0x1a')]===undefined?!![]:![]:!![]})[_0xbdba('0xa')](function(_0x487c5a){logger['info']('CreateSquareReport',_0x22bb92);logger[_0xbdba('0xc')](_0xbdba('0x16'),_0x22bb92,JSON[_0xbdba('0xf')](_0x487c5a));_0xf5fa3f(_0x487c5a);})['catch'](function(_0x4022c2){logger[_0xbdba('0x11')](_0xbdba('0x16'),_0x4022c2[_0xbdba('0x12')],_0x22bb92);_0x4019e3(_0xaa80af[_0xbdba('0x11')](0x1f4,_0x4022c2[_0xbdba('0x12')]));});});};exports['UpdateSquareReport']=function(_0x4f6fd7){var _0x356c2c=this;return new Promise(function(_0x2a2cf6,_0x560afa){return db[_0xbdba('0x17')][_0xbdba('0x1b')](_0x4f6fd7[_0xbdba('0x1c')],{'raw':_0x4f6fd7[_0xbdba('0x19')]?_0x4f6fd7[_0xbdba('0x19')][_0xbdba('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6fd7[_0xbdba('0x19')]?_0x4f6fd7['options'][_0xbdba('0x1d')]||null:null,'attributes':_0x4f6fd7[_0xbdba('0x19')]?_0x4f6fd7[_0xbdba('0x19')]['attributes']||null:null,'limit':_0x4f6fd7['options']?_0x4f6fd7[_0xbdba('0x19')][_0xbdba('0x1e')]||null:null})[_0xbdba('0xa')](function(_0x188124){logger[_0xbdba('0x13')]('UpdateSquareReport',_0x4f6fd7);logger['debug'](_0xbdba('0x1f'),_0x4f6fd7,JSON[_0xbdba('0xf')](_0x188124));_0x2a2cf6(_0x188124);})[_0xbdba('0x15')](function(_0x185d61){logger[_0xbdba('0x11')](_0xbdba('0x1f'),_0x185d61[_0xbdba('0x12')],_0x4f6fd7);_0x560afa(_0x356c2c['error'](0x1f4,_0x185d61['message']));});});}; \ No newline at end of file +var _0xda77=['UpdateSquareReport','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareReport','SquareReport','body','options','raw','then','update','where','attributes','limit'];(function(_0x48888d,_0x5e2cea){var _0x46eb03=function(_0x1d7867){while(--_0x1d7867){_0x48888d['push'](_0x48888d['shift']());}};_0x46eb03(++_0x5e2cea);}(_0xda77,0x81));var _0x7da7=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xda77[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require('lodash');var util=require(_0x7da7('0x0'));var moment=require(_0x7da7('0x1'));var BPromise=require(_0x7da7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7da7('0x3'))['db'];var utils=require(_0x7da7('0x4'));var logger=require(_0x7da7('0x5'))(_0x7da7('0x6'));var config=require(_0x7da7('0x7'));var jayson=require(_0x7da7('0x8'));var client=jayson[_0x7da7('0x9')][_0x7da7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c656d,_0x5cab90,_0x5dc27d){return new BPromise(function(_0x4d646e,_0x3f7df9){return client[_0x7da7('0xb')](_0x1c656d,_0x5dc27d)['then'](function(_0xfe5907){logger[_0x7da7('0xc')](_0x7da7('0xd'),_0x5cab90,_0x7da7('0xe'));logger[_0x7da7('0xf')](_0x7da7('0x10'),_0x5cab90,_0x7da7('0xe'),JSON[_0x7da7('0x11')](_0xfe5907));if(_0xfe5907[_0x7da7('0x12')]){if(_0xfe5907[_0x7da7('0x12')]['code']===0x1f4){logger[_0x7da7('0x12')](_0x7da7('0xd'),_0x5cab90,_0xfe5907[_0x7da7('0x12')][_0x7da7('0x13')]);return _0x3f7df9(_0xfe5907['error']['message']);}logger[_0x7da7('0x12')](_0x7da7('0xd'),_0x5cab90,_0xfe5907[_0x7da7('0x12')][_0x7da7('0x13')]);return _0x4d646e(_0xfe5907[_0x7da7('0x12')][_0x7da7('0x13')]);}else{logger[_0x7da7('0xc')](_0x7da7('0xd'),_0x5cab90,'request\x20sent');_0x4d646e(_0xfe5907['result']['message']);}})[_0x7da7('0x14')](function(_0x3caccc){logger[_0x7da7('0x12')](_0x7da7('0xd'),_0x5cab90,_0x3caccc);_0x3f7df9(_0x3caccc);});});}exports[_0x7da7('0x15')]=function(_0x482235){var _0x192660=this;return new Promise(function(_0x2ed739,_0x2cf82e){return db[_0x7da7('0x16')]['create'](_0x482235[_0x7da7('0x17')],{'raw':_0x482235['options']?_0x482235[_0x7da7('0x18')][_0x7da7('0x19')]===undefined?!![]:![]:!![]})[_0x7da7('0x1a')](function(_0x3e8cc1){logger[_0x7da7('0xc')](_0x7da7('0x15'),_0x482235);logger[_0x7da7('0xf')](_0x7da7('0x15'),_0x482235,JSON[_0x7da7('0x11')](_0x3e8cc1));_0x2ed739(_0x3e8cc1);})[_0x7da7('0x14')](function(_0x2bd150){logger[_0x7da7('0x12')](_0x7da7('0x15'),_0x2bd150[_0x7da7('0x13')],_0x482235);_0x2cf82e(_0x192660[_0x7da7('0x12')](0x1f4,_0x2bd150[_0x7da7('0x13')]));});});};exports['UpdateSquareReport']=function(_0x3bcff4){var _0x34c363=this;return new Promise(function(_0x12c461,_0x3ef300){return db['SquareReport'][_0x7da7('0x1b')](_0x3bcff4[_0x7da7('0x17')],{'raw':_0x3bcff4[_0x7da7('0x18')]?_0x3bcff4[_0x7da7('0x18')][_0x7da7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bcff4[_0x7da7('0x18')]?_0x3bcff4[_0x7da7('0x18')][_0x7da7('0x1c')]||null:null,'attributes':_0x3bcff4['options']?_0x3bcff4['options'][_0x7da7('0x1d')]||null:null,'limit':_0x3bcff4[_0x7da7('0x18')]?_0x3bcff4[_0x7da7('0x18')][_0x7da7('0x1e')]||null:null})['then'](function(_0xba5f1c){logger[_0x7da7('0xc')]('UpdateSquareReport',_0x3bcff4);logger[_0x7da7('0xf')](_0x7da7('0x1f'),_0x3bcff4,JSON[_0x7da7('0x11')](_0xba5f1c));_0x12c461(_0xba5f1c);})['catch'](function(_0x2bb4d9){logger[_0x7da7('0x12')](_0x7da7('0x1f'),_0x2bb4d9[_0x7da7('0x13')],_0x3bcff4);_0x3ef300(_0x34c363[_0x7da7('0x12')](0x1f4,_0x2bb4d9[_0x7da7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9fb5223..f982257 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 _0x3ce4=['./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','multer','path','Router','../../components/interaction/service','../../config/environment'];(function(_0x337317,_0x39517f){var _0x54c2fc=function(_0x2c06c0){while(--_0x2c06c0){_0x337317['push'](_0x337317['shift']());}};_0x54c2fc(++_0x39517f);}(_0x3ce4,0x1cb));var _0x43ce=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x3ce4[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0x43ce('0x0'));var util=require('util');var path=require(_0x43ce('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x43ce('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x43ce('0x3'));var config=require(_0x43ce('0x4'));var controller=require(_0x43ce('0x5'));router[_0x43ce('0x6')]('/',auth[_0x43ce('0x7')](),controller[_0x43ce('0x8')]);router[_0x43ce('0x6')](_0x43ce('0x9'),auth[_0x43ce('0x7')](),controller[_0x43ce('0xa')]);router[_0x43ce('0x6')](_0x43ce('0xb'),auth[_0x43ce('0x7')](),controller['show']);router[_0x43ce('0xc')]('/',auth[_0x43ce('0x7')](),controller[_0x43ce('0xd')]);router[_0x43ce('0xe')](_0x43ce('0xb'),auth[_0x43ce('0x7')](),controller['update']);router[_0x43ce('0xf')](_0x43ce('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x78ad=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareReportDetail.controller','get','index','/describe','describe','/:id','show','post','isAuthenticated'];(function(_0x5e9817,_0xa29439){var _0x25b437=function(_0x46851b){while(--_0x46851b){_0x5e9817['push'](_0x5e9817['shift']());}};_0x25b437(++_0xa29439);}(_0x78ad,0xb8));var _0xd78a=function(_0x21d33e,_0x2520ec){_0x21d33e=_0x21d33e-0x0;var _0x270851=_0x78ad[_0x21d33e];return _0x270851;};'use strict';var multer=require(_0xd78a('0x0'));var util=require(_0xd78a('0x1'));var path=require(_0xd78a('0x2'));var timeout=require(_0xd78a('0x3'));var express=require(_0xd78a('0x4'));var router=express[_0xd78a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd78a('0x6'));var controller=require(_0xd78a('0x7'));router[_0xd78a('0x8')]('/',auth['isAuthenticated'](),controller[_0xd78a('0x9')]);router[_0xd78a('0x8')](_0xd78a('0xa'),auth['isAuthenticated'](),controller[_0xd78a('0xb')]);router['get'](_0xd78a('0xc'),auth['isAuthenticated'](),controller[_0xd78a('0xd')]);router[_0xd78a('0xe')]('/',auth[_0xd78a('0xf')](),controller['create']);router[_0xd78a('0x10')](_0xd78a('0xc'),auth[_0xd78a('0xf')](),controller[_0xd78a('0x11')]);router[_0xd78a('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd78a('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 42e571c..2c5b429 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 _0xebc2=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xebc2,0x81));var _0x2ebc=function(_0x4f4e81,_0x425b38){_0x4f4e81=_0x4f4e81-0x0;var _0x51ea39=_0xebc2[_0x4f4e81];return _0x51ea39;};'use strict';var Sequelize=require(_0x2ebc('0x0'));module[_0x2ebc('0x1')]={'uniqueid':{'type':Sequelize[_0x2ebc('0x2')]},'node':{'type':Sequelize[_0x2ebc('0x2')]},'application':{'type':Sequelize[_0x2ebc('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x2ebc('0x2')]},'callerid':{'type':Sequelize[_0x2ebc('0x2')]}}; \ No newline at end of file +var _0x478a=['STRING','TEXT','sequelize'];(function(_0x5955dc,_0x13b0dd){var _0x2c7537=function(_0x2562bd){while(--_0x2562bd){_0x5955dc['push'](_0x5955dc['shift']());}};_0x2c7537(++_0x13b0dd);}(_0x478a,0x14c));var _0xa478=function(_0x2cb9f2,_0x4fcff1){_0x2cb9f2=_0x2cb9f2-0x0;var _0x243c83=_0x478a[_0x2cb9f2];return _0x243c83;};'use strict';var Sequelize=require(_0xa478('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa478('0x1')]},'node':{'type':Sequelize[_0xa478('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa478('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa478('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 8838938..bb54d33 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 _0xfbac=['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','status','end','json','offset','undefined','count','limit','apply','reject','update','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','SquareDetailsReport','findAll','then','rows','show','params','options','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','squel','jsforce'];(function(_0x57f077,_0x217601){var _0x17488a=function(_0x249cd8){while(--_0x249cd8){_0x57f077['push'](_0x57f077['shift']());}};_0x17488a(++_0x217601);}(_0xfbac,0x167));var _0xcfba=function(_0x4f7ca1,_0x58a63e){_0x4f7ca1=_0x4f7ca1-0x0;var _0x49e371=_0xfbac[_0x4f7ca1];return _0x49e371;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfba('0x0'));var zipdir=require(_0xcfba('0x1'));var jsonpatch=require(_0xcfba('0x2'));var rp=require(_0xcfba('0x3'));var moment=require(_0xcfba('0x4'));var BPromise=require(_0xcfba('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcfba('0x6'));var sox=require(_0xcfba('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfba('0x8'));var _=require('lodash');var squel=require(_0xcfba('0x9'));var crypto=require('crypto');var jsforce=require(_0xcfba('0xa'));var deskjs=require(_0xcfba('0xb'));var toCsv=require('to-csv');var querystring=require(_0xcfba('0xc'));var Papa=require(_0xcfba('0xd'));var Redis=require(_0xcfba('0xe'));var authService=require(_0xcfba('0xf'));var qs=require(_0xcfba('0x10'));var as=require(_0xcfba('0x11'));var hardwareService=require(_0xcfba('0x12'));var logger=require(_0xcfba('0x13'))(_0xcfba('0x14'));var utils=require(_0xcfba('0x15'));var config=require(_0xcfba('0x16'));var licenseUtil=require(_0xcfba('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48d6f1,_0x1f590b){_0x1f590b=_0x1f590b||0xcc;return function(_0x24168c){if(_0x24168c){return _0x48d6f1['sendStatus'](_0x1f590b);}return _0x48d6f1[_0xcfba('0x18')](_0x1f590b)[_0xcfba('0x19')]();};}function respondWithResult(_0x335bfd,_0x226e89){_0x226e89=_0x226e89||0xc8;return function(_0x2333ee){if(_0x2333ee){return _0x335bfd[_0xcfba('0x18')](_0x226e89)[_0xcfba('0x1a')](_0x2333ee);}};}function respondWithFilteredResult(_0xa0508d,_0x2f497b){return function(_0x18d1d6){if(_0x18d1d6){var _0x231192=typeof _0x2f497b[_0xcfba('0x1b')]===_0xcfba('0x1c')&&typeof _0x2f497b['limit']===_0xcfba('0x1c');var _0x1d7be2=_0x18d1d6[_0xcfba('0x1d')];var _0x30c319=_0x231192?0x0:_0x2f497b[_0xcfba('0x1b')];var _0x778955=_0x231192?_0x18d1d6[_0xcfba('0x1d')]:_0x2f497b['offset']+_0x2f497b[_0xcfba('0x1e')];var _0x35c1e4;if(_0x778955>=_0x1d7be2){_0x778955=_0x1d7be2;_0x35c1e4=0xc8;}else{_0x35c1e4=0xce;}_0xa0508d[_0xcfba('0x18')](_0x35c1e4);return _0xa0508d['set']('Content-Range',_0x30c319+'-'+_0x778955+'/'+_0x1d7be2)[_0xcfba('0x1a')](_0x18d1d6);}return null;};}function patchUpdates(_0x43b745){return function(_0x40a0df){try{jsonpatch[_0xcfba('0x1f')](_0x40a0df,_0x43b745,!![]);}catch(_0x358610){return BPromise[_0xcfba('0x20')](_0x358610);}return _0x40a0df['save']();};}function saveUpdates(_0x1d4d83,_0x5d4c92){return function(_0x286d20){if(_0x286d20){return _0x286d20[_0xcfba('0x21')](_0x1d4d83)['then'](function(_0x25e9ea){return _0x25e9ea;});}return null;};}function removeEntity(_0x42cf58,_0x14850f){return function(_0x3fb061){if(_0x3fb061){return _0x3fb061['destroy']()['then'](function(){_0x42cf58[_0xcfba('0x18')](0xcc)[_0xcfba('0x19')]();});}};}function handleEntityNotFound(_0x200a77,_0x4c9098){return function(_0x1f01a7){if(!_0x1f01a7){_0x200a77['sendStatus'](0x194);}return _0x1f01a7;};}function handleError(_0x3eb614,_0x5e79c7){_0x5e79c7=_0x5e79c7||0x1f4;return function(_0x4ee825){logger[_0xcfba('0x22')](_0x4ee825[_0xcfba('0x23')]);if(_0x4ee825['name']){delete _0x4ee825[_0xcfba('0x24')];}_0x3eb614[_0xcfba('0x18')](_0x5e79c7)[_0xcfba('0x25')](_0x4ee825);};}exports[_0xcfba('0x26')]=function(_0xae6518,_0x1c3343){var _0x2ee85c={},_0x4585ec={},_0x5c77c4={'count':0x0,'rows':[]};var _0x7c7d76=_['map'](db['SquareDetailsReport'][_0xcfba('0x27')],function(_0x4ecd3c){return{'name':_0x4ecd3c[_0xcfba('0x28')],'type':_0x4ecd3c['type'][_0xcfba('0x29')]};});_0x4585ec[_0xcfba('0x2a')]=_[_0xcfba('0x2b')](_0x7c7d76,_0xcfba('0x24'));_0x4585ec[_0xcfba('0x2c')]=_[_0xcfba('0x2d')](_0xae6518[_0xcfba('0x2c')]);_0x4585ec[_0xcfba('0x2e')]=_['intersection'](_0x4585ec['model'],_0x4585ec['query']);_0x2ee85c[_0xcfba('0x2f')]=_[_0xcfba('0x30')](_0x4585ec['model'],qs[_0xcfba('0x31')](_0xae6518['query'][_0xcfba('0x31')]));_0x2ee85c[_0xcfba('0x2f')]=_0x2ee85c[_0xcfba('0x2f')][_0xcfba('0x32')]?_0x2ee85c[_0xcfba('0x2f')]:_0x4585ec[_0xcfba('0x2a')];if(!_0xae6518[_0xcfba('0x2c')][_0xcfba('0x33')]('nolimit')){_0x2ee85c[_0xcfba('0x1e')]=qs[_0xcfba('0x1e')](_0xae6518[_0xcfba('0x2c')][_0xcfba('0x1e')]);_0x2ee85c[_0xcfba('0x1b')]=qs[_0xcfba('0x1b')](_0xae6518[_0xcfba('0x2c')]['offset']);}_0x2ee85c[_0xcfba('0x34')]=qs[_0xcfba('0x35')](_0xae6518[_0xcfba('0x2c')][_0xcfba('0x35')]);_0x2ee85c[_0xcfba('0x36')]=qs['filters'](_['pick'](_0xae6518[_0xcfba('0x2c')],_0x4585ec[_0xcfba('0x2e')]),_0x7c7d76);if(_0xae6518[_0xcfba('0x2c')][_0xcfba('0x37')]){_0x2ee85c['where']=_[_0xcfba('0x38')](_0x2ee85c[_0xcfba('0x36')],{'$or':_['map'](_0x7c7d76,function(_0x4c1f90){if(_0x4c1f90[_0xcfba('0x39')]!==_0xcfba('0x3a')){var _0x335f28={};_0x335f28[_0x4c1f90[_0xcfba('0x24')]]={'$like':'%'+_0xae6518[_0xcfba('0x2c')][_0xcfba('0x37')]+'%'};return _0x335f28;}})});}_0x2ee85c=_[_0xcfba('0x38')]({},_0x2ee85c,_0xae6518['options']);var _0x36fb80={'where':_0x2ee85c[_0xcfba('0x36')]};return db['SquareDetailsReport'][_0xcfba('0x1d')](_0x36fb80)['then'](function(_0x3572f7){_0x5c77c4['count']=_0x3572f7;if(_0xae6518[_0xcfba('0x2c')][_0xcfba('0x3b')]){_0x2ee85c[_0xcfba('0x3c')]=[{'all':!![]}];}return db[_0xcfba('0x3d')][_0xcfba('0x3e')](_0x2ee85c);})[_0xcfba('0x3f')](function(_0x54f5f8){_0x5c77c4[_0xcfba('0x40')]=_0x54f5f8;return _0x5c77c4;})['then'](respondWithFilteredResult(_0x1c3343,_0x2ee85c))['catch'](handleError(_0x1c3343,null));};exports[_0xcfba('0x41')]=function(_0x1498f3,_0x1279a9){var _0x237015={'raw':!![],'where':{'id':_0x1498f3[_0xcfba('0x42')]['id']}},_0x3b4466={};_0x3b4466['model']=_['keys'](db['SquareDetailsReport'][_0xcfba('0x27')]);_0x3b4466[_0xcfba('0x2c')]=_[_0xcfba('0x2d')](_0x1498f3[_0xcfba('0x2c')]);_0x3b4466[_0xcfba('0x2e')]=_[_0xcfba('0x30')](_0x3b4466[_0xcfba('0x2a')],_0x3b4466[_0xcfba('0x2c')]);_0x237015[_0xcfba('0x2f')]=_['intersection'](_0x3b4466[_0xcfba('0x2a')],qs[_0xcfba('0x31')](_0x1498f3[_0xcfba('0x2c')][_0xcfba('0x31')]));_0x237015[_0xcfba('0x2f')]=_0x237015[_0xcfba('0x2f')][_0xcfba('0x32')]?_0x237015['attributes']:_0x3b4466[_0xcfba('0x2a')];if(_0x1498f3[_0xcfba('0x2c')][_0xcfba('0x3b')]){_0x237015[_0xcfba('0x3c')]=[{'all':!![]}];}_0x237015=_['merge']({},_0x237015,_0x1498f3[_0xcfba('0x43')]);return db[_0xcfba('0x3d')][_0xcfba('0x44')](_0x237015)[_0xcfba('0x3f')](handleEntityNotFound(_0x1279a9,null))[_0xcfba('0x3f')](respondWithResult(_0x1279a9,null))[_0xcfba('0x45')](handleError(_0x1279a9,null));};exports[_0xcfba('0x46')]=function(_0x4b5e81,_0x4a48e0){return db[_0xcfba('0x3d')][_0xcfba('0x46')](_0x4b5e81[_0xcfba('0x47')],{})[_0xcfba('0x3f')](respondWithResult(_0x4a48e0,0xc9))[_0xcfba('0x45')](handleError(_0x4a48e0,null));};exports[_0xcfba('0x21')]=function(_0x53bd26,_0x57ff92){if(_0x53bd26['body']['id']){delete _0x53bd26[_0xcfba('0x47')]['id'];}return db['SquareDetailsReport'][_0xcfba('0x44')]({'where':{'id':_0x53bd26[_0xcfba('0x42')]['id']}})[_0xcfba('0x3f')](handleEntityNotFound(_0x57ff92,null))[_0xcfba('0x3f')](saveUpdates(_0x53bd26['body'],null))['then'](respondWithResult(_0x57ff92,null))[_0xcfba('0x45')](handleError(_0x57ff92,null));};exports[_0xcfba('0x48')]=function(_0x17c932,_0x3a88b6){return db[_0xcfba('0x3d')][_0xcfba('0x44')]({'where':{'id':_0x17c932[_0xcfba('0x42')]['id']}})[_0xcfba('0x3f')](handleEntityNotFound(_0x3a88b6,null))['then'](removeEntity(_0x3a88b6,null))['catch'](handleError(_0x3a88b6,null));};exports[_0xcfba('0x49')]=function(_0x2c88e6,_0x358477){return db[_0xcfba('0x3d')][_0xcfba('0x49')]()[_0xcfba('0x3f')](respondWithResult(_0x358477,null))[_0xcfba('0x45')](handleError(_0x358477,null));}; \ No newline at end of file +var _0xb355=['mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SquareDetailsReport','then','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0xf607,_0x57d675){var _0x1380b7=function(_0x575e33){while(--_0x575e33){_0xf607['push'](_0xf607['shift']());}};_0x1380b7(++_0x57d675);}(_0xb355,0x13a));var _0x5b35=function(_0x5040d7,_0x148422){_0x5040d7=_0x5040d7-0x0;var _0x460509=_0xb355[_0x5040d7];return _0x460509;};'use strict';var emlformat=require(_0x5b35('0x0'));var rimraf=require(_0x5b35('0x1'));var zipdir=require(_0x5b35('0x2'));var jsonpatch=require(_0x5b35('0x3'));var rp=require('request-promise');var moment=require(_0x5b35('0x4'));var BPromise=require(_0x5b35('0x5'));var Mustache=require(_0x5b35('0x6'));var util=require(_0x5b35('0x7'));var path=require('path');var sox=require(_0x5b35('0x8'));var csv=require('to-csv');var ejs=require(_0x5b35('0x9'));var fs=require('fs');var fs_extra=require(_0x5b35('0xa'));var _=require(_0x5b35('0xb'));var squel=require(_0x5b35('0xc'));var crypto=require('crypto');var jsforce=require(_0x5b35('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5b35('0xe'));var querystring=require(_0x5b35('0xf'));var Papa=require(_0x5b35('0x10'));var Redis=require(_0x5b35('0x11'));var authService=require(_0x5b35('0x12'));var qs=require(_0x5b35('0x13'));var as=require(_0x5b35('0x14'));var hardwareService=require(_0x5b35('0x15'));var logger=require(_0x5b35('0x16'))('api');var utils=require(_0x5b35('0x17'));var config=require(_0x5b35('0x18'));var licenseUtil=require(_0x5b35('0x19'));var db=require(_0x5b35('0x1a'))['db'];function respondWithStatusCode(_0x1039e3,_0xe582ae){_0xe582ae=_0xe582ae||0xcc;return function(_0x4332c4){if(_0x4332c4){return _0x1039e3[_0x5b35('0x1b')](_0xe582ae);}return _0x1039e3['status'](_0xe582ae)[_0x5b35('0x1c')]();};}function respondWithResult(_0xaf1fcf,_0x5949cf){_0x5949cf=_0x5949cf||0xc8;return function(_0x517e10){if(_0x517e10){return _0xaf1fcf[_0x5b35('0x1d')](_0x5949cf)['json'](_0x517e10);}};}function respondWithFilteredResult(_0x3976b1,_0x58328e){return function(_0x2e1b6e){if(_0x2e1b6e){var _0x253cbf=typeof _0x58328e[_0x5b35('0x1e')]===_0x5b35('0x1f')&&typeof _0x58328e[_0x5b35('0x20')]===_0x5b35('0x1f');var _0xf8151=_0x2e1b6e[_0x5b35('0x21')];var _0x1dbd11=_0x253cbf?0x0:_0x58328e[_0x5b35('0x1e')];var _0x41273e=_0x253cbf?_0x2e1b6e['count']:_0x58328e[_0x5b35('0x1e')]+_0x58328e['limit'];var _0x266cec;if(_0x41273e>=_0xf8151){_0x41273e=_0xf8151;_0x266cec=0xc8;}else{_0x266cec=0xce;}_0x3976b1['status'](_0x266cec);return _0x3976b1[_0x5b35('0x22')](_0x5b35('0x23'),_0x1dbd11+'-'+_0x41273e+'/'+_0xf8151)[_0x5b35('0x24')](_0x2e1b6e);}return null;};}function patchUpdates(_0x1c1f3c){return function(_0x31450b){try{jsonpatch[_0x5b35('0x25')](_0x31450b,_0x1c1f3c,!![]);}catch(_0x2dad6f){return BPromise[_0x5b35('0x26')](_0x2dad6f);}return _0x31450b[_0x5b35('0x27')]();};}function saveUpdates(_0x7f9fd2,_0x30a0cb){return function(_0x23977e){if(_0x23977e){return _0x23977e[_0x5b35('0x28')](_0x7f9fd2)['then'](function(_0x20009c){return _0x20009c;});}return null;};}function removeEntity(_0x35ea86,_0x164880){return function(_0x2f8f8d){if(_0x2f8f8d){return _0x2f8f8d[_0x5b35('0x29')]()['then'](function(){_0x35ea86[_0x5b35('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9a09,_0x48cf8f){return function(_0x5237fd){if(!_0x5237fd){_0x1f9a09[_0x5b35('0x1b')](0x194);}return _0x5237fd;};}function handleError(_0x257df0,_0x195e86){_0x195e86=_0x195e86||0x1f4;return function(_0x9145de){logger['error'](_0x9145de[_0x5b35('0x2a')]);if(_0x9145de['name']){delete _0x9145de[_0x5b35('0x2b')];}_0x257df0[_0x5b35('0x1d')](_0x195e86)['send'](_0x9145de);};}exports[_0x5b35('0x2c')]=function(_0x348e6a,_0x12ea23){var _0x501b8b={},_0x381687={},_0x134b75={'count':0x0,'rows':[]};var _0x4733a8=_[_0x5b35('0x2d')](db['SquareDetailsReport'][_0x5b35('0x2e')],function(_0x15e6da){return{'name':_0x15e6da[_0x5b35('0x2f')],'type':_0x15e6da[_0x5b35('0x30')]['key']};});_0x381687[_0x5b35('0x31')]=_['map'](_0x4733a8,'name');_0x381687[_0x5b35('0x32')]=_[_0x5b35('0x33')](_0x348e6a['query']);_0x381687[_0x5b35('0x34')]=_[_0x5b35('0x35')](_0x381687[_0x5b35('0x31')],_0x381687[_0x5b35('0x32')]);_0x501b8b[_0x5b35('0x36')]=_[_0x5b35('0x35')](_0x381687['model'],qs[_0x5b35('0x37')](_0x348e6a[_0x5b35('0x32')][_0x5b35('0x37')]));_0x501b8b[_0x5b35('0x36')]=_0x501b8b['attributes'][_0x5b35('0x38')]?_0x501b8b[_0x5b35('0x36')]:_0x381687[_0x5b35('0x31')];if(!_0x348e6a['query'][_0x5b35('0x39')](_0x5b35('0x3a'))){_0x501b8b[_0x5b35('0x20')]=qs[_0x5b35('0x20')](_0x348e6a['query'][_0x5b35('0x20')]);_0x501b8b['offset']=qs[_0x5b35('0x1e')](_0x348e6a[_0x5b35('0x32')]['offset']);}_0x501b8b[_0x5b35('0x3b')]=qs[_0x5b35('0x3c')](_0x348e6a[_0x5b35('0x32')][_0x5b35('0x3c')]);_0x501b8b[_0x5b35('0x3d')]=qs[_0x5b35('0x34')](_[_0x5b35('0x3e')](_0x348e6a[_0x5b35('0x32')],_0x381687[_0x5b35('0x34')]),_0x4733a8);if(_0x348e6a[_0x5b35('0x32')][_0x5b35('0x3f')]){_0x501b8b[_0x5b35('0x3d')]=_[_0x5b35('0x40')](_0x501b8b[_0x5b35('0x3d')],{'$or':_['map'](_0x4733a8,function(_0x1d2d33){if(_0x1d2d33[_0x5b35('0x30')]!==_0x5b35('0x41')){var _0x5e35f2={};_0x5e35f2[_0x1d2d33[_0x5b35('0x2b')]]={'$like':'%'+_0x348e6a[_0x5b35('0x32')]['filter']+'%'};return _0x5e35f2;}})});}_0x501b8b=_['merge']({},_0x501b8b,_0x348e6a['options']);var _0x4bccf2={'where':_0x501b8b[_0x5b35('0x3d')]};return db[_0x5b35('0x42')][_0x5b35('0x21')](_0x4bccf2)[_0x5b35('0x43')](function(_0x42764e){_0x134b75[_0x5b35('0x21')]=_0x42764e;if(_0x348e6a['query'][_0x5b35('0x44')]){_0x501b8b[_0x5b35('0x45')]=[{'all':!![]}];}return db[_0x5b35('0x42')][_0x5b35('0x46')](_0x501b8b);})['then'](function(_0x3ba8c1){_0x134b75[_0x5b35('0x47')]=_0x3ba8c1;return _0x134b75;})['then'](respondWithFilteredResult(_0x12ea23,_0x501b8b))[_0x5b35('0x48')](handleError(_0x12ea23,null));};exports[_0x5b35('0x49')]=function(_0x286fb5,_0x37fc55){var _0x38a1cc={'raw':!![],'where':{'id':_0x286fb5[_0x5b35('0x4a')]['id']}},_0x6b066d={};_0x6b066d[_0x5b35('0x31')]=_['keys'](db[_0x5b35('0x42')]['rawAttributes']);_0x6b066d[_0x5b35('0x32')]=_[_0x5b35('0x33')](_0x286fb5[_0x5b35('0x32')]);_0x6b066d[_0x5b35('0x34')]=_[_0x5b35('0x35')](_0x6b066d[_0x5b35('0x31')],_0x6b066d[_0x5b35('0x32')]);_0x38a1cc[_0x5b35('0x36')]=_[_0x5b35('0x35')](_0x6b066d[_0x5b35('0x31')],qs[_0x5b35('0x37')](_0x286fb5[_0x5b35('0x32')][_0x5b35('0x37')]));_0x38a1cc['attributes']=_0x38a1cc['attributes']['length']?_0x38a1cc['attributes']:_0x6b066d['model'];if(_0x286fb5[_0x5b35('0x32')]['includeAll']){_0x38a1cc[_0x5b35('0x45')]=[{'all':!![]}];}_0x38a1cc=_['merge']({},_0x38a1cc,_0x286fb5[_0x5b35('0x4b')]);return db['SquareDetailsReport'][_0x5b35('0x4c')](_0x38a1cc)[_0x5b35('0x43')](handleEntityNotFound(_0x37fc55,null))[_0x5b35('0x43')](respondWithResult(_0x37fc55,null))[_0x5b35('0x48')](handleError(_0x37fc55,null));};exports[_0x5b35('0x4d')]=function(_0x358fe4,_0x365a2e){return db[_0x5b35('0x42')]['create'](_0x358fe4[_0x5b35('0x4e')],{})['then'](respondWithResult(_0x365a2e,0xc9))[_0x5b35('0x48')](handleError(_0x365a2e,null));};exports[_0x5b35('0x28')]=function(_0x39d21e,_0x150c72){if(_0x39d21e[_0x5b35('0x4e')]['id']){delete _0x39d21e[_0x5b35('0x4e')]['id'];}return db[_0x5b35('0x42')][_0x5b35('0x4c')]({'where':{'id':_0x39d21e[_0x5b35('0x4a')]['id']}})['then'](handleEntityNotFound(_0x150c72,null))[_0x5b35('0x43')](saveUpdates(_0x39d21e[_0x5b35('0x4e')],null))['then'](respondWithResult(_0x150c72,null))[_0x5b35('0x48')](handleError(_0x150c72,null));};exports['destroy']=function(_0x2f9664,_0x524f1c){return db[_0x5b35('0x42')][_0x5b35('0x4c')]({'where':{'id':_0x2f9664[_0x5b35('0x4a')]['id']}})[_0x5b35('0x43')](handleEntityNotFound(_0x524f1c,null))[_0x5b35('0x43')](removeEntity(_0x524f1c,null))[_0x5b35('0x48')](handleError(_0x524f1c,null));};exports[_0x5b35('0x4f')]=function(_0x34db2b,_0x41feef){return db[_0x5b35('0x42')][_0x5b35('0x4f')]()['then'](respondWithResult(_0x41feef,null))[_0x5b35('0x48')](handleError(_0x41feef,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c24215c..4ed0b6e 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 _0x6ff9=['api','bluebird','path','rimraf','exports','define','SquareDetailsReport','report_square_details'];(function(_0xd41151,_0x3fabb4){var _0x2e1398=function(_0x46438f){while(--_0x46438f){_0xd41151['push'](_0xd41151['shift']());}};_0x2e1398(++_0x3fabb4);}(_0x6ff9,0x118));var _0x96ff=function(_0x30b58,_0x48df3b){_0x30b58=_0x30b58-0x0;var _0x9d210d=_0x6ff9[_0x30b58];return _0x9d210d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x96ff('0x0'));var moment=require('moment');var BPromise=require(_0x96ff('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96ff('0x2'));var rimraf=require(_0x96ff('0x3'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x96ff('0x4')]=function(_0x1024c1,_0x3da4ee){return _0x1024c1[_0x96ff('0x5')](_0x96ff('0x6'),attributes,{'tableName':_0x96ff('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7a8=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','../../config/logger','api','moment','bluebird'];(function(_0x11fb3f,_0x500f21){var _0x4d45bf=function(_0x40ca7a){while(--_0x40ca7a){_0x11fb3f['push'](_0x11fb3f['shift']());}};_0x4d45bf(++_0x500f21);}(_0xc7a8,0x1e8));var _0x8c7a=function(_0x48efb4,_0x1b4117){_0x48efb4=_0x48efb4-0x0;var _0x4f0e9d=_0xc7a8[_0x48efb4];return _0x4f0e9d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c7a('0x0'))(_0x8c7a('0x1'));var moment=require(_0x8c7a('0x2'));var BPromise=require(_0x8c7a('0x3'));var rp=require(_0x8c7a('0x4'));var fs=require('fs');var path=require(_0x8c7a('0x5'));var rimraf=require(_0x8c7a('0x6'));var config=require(_0x8c7a('0x7'));var attributes=require(_0x8c7a('0x8'));module[_0x8c7a('0x9')]=function(_0x355c35,_0x3e9c98){return _0x355c35[_0x8c7a('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x8c7a('0xb'),'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 dce32e9..d7100b6 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 _0xb03e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','then','util','moment'];(function(_0x1b19cb,_0x469e52){var _0x1d1a0b=function(_0x28c4df){while(--_0x28c4df){_0x1b19cb['push'](_0x1b19cb['shift']());}};_0x1d1a0b(++_0x469e52);}(_0xb03e,0x1eb));var _0xeb03=function(_0x333eae,_0x4ddb6d){_0x333eae=_0x333eae-0x0;var _0x49ce44=_0xb03e[_0x333eae];return _0x49ce44;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));var BPromise=require(_0xeb03('0x2'));var rs=require(_0xeb03('0x3'));var fs=require('fs');var Redis=require(_0xeb03('0x4'));var db=require(_0xeb03('0x5'))['db'];var utils=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var jayson=require(_0xeb03('0xa'));var client=jayson[_0xeb03('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b58a2,_0x3d3322,_0x3a6e31){return new BPromise(function(_0x246c6e,_0x3f2c74){return client[_0xeb03('0xc')](_0x3b58a2,_0x3a6e31)['then'](function(_0x403b77){logger[_0xeb03('0xd')](_0xeb03('0xe'),_0x3d3322,'request\x20sent');logger[_0xeb03('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3d3322,_0xeb03('0x10'),JSON[_0xeb03('0x11')](_0x403b77));if(_0x403b77[_0xeb03('0x12')]){if(_0x403b77[_0xeb03('0x12')][_0xeb03('0x13')]===0x1f4){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x3f2c74(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}logger[_0xeb03('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x246c6e(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}else{logger['info'](_0xeb03('0xe'),_0x3d3322,_0xeb03('0x10'));_0x246c6e(_0x403b77[_0xeb03('0x15')]['message']);}})[_0xeb03('0x16')](function(_0x46dd1b){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x46dd1b);_0x3f2c74(_0x46dd1b);});});}exports[_0xeb03('0x17')]=function(_0x1b4cbd){var _0x167a33=this;return new Promise(function(_0x8d6725,_0x177f9c){return db[_0xeb03('0x18')][_0xeb03('0x19')](_0x1b4cbd[_0xeb03('0x1a')],{'raw':_0x1b4cbd[_0xeb03('0x1b')]?_0x1b4cbd[_0xeb03('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xeb03('0x1c')](function(_0x3855dd){logger[_0xeb03('0xd')](_0xeb03('0x17'),_0x1b4cbd);logger[_0xeb03('0xf')](_0xeb03('0x17'),_0x1b4cbd,JSON[_0xeb03('0x11')](_0x3855dd));_0x8d6725(_0x3855dd);})[_0xeb03('0x16')](function(_0x3c3d09){logger['error'](_0xeb03('0x17'),_0x3c3d09[_0xeb03('0x14')],_0x1b4cbd);_0x177f9c(_0x167a33[_0xeb03('0x12')](0x1f4,_0x3c3d09[_0xeb03('0x14')]));});});}; \ No newline at end of file +var _0x4213=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','then','debug','lodash'];(function(_0xb20ec1,_0x49dc85){var _0x53cd29=function(_0x1d1ff0){while(--_0x1d1ff0){_0xb20ec1['push'](_0xb20ec1['shift']());}};_0x53cd29(++_0x49dc85);}(_0x4213,0x77));var _0x3421=function(_0x3700c3,_0x40135f){_0x3700c3=_0x3700c3-0x0;var _0x5cc817=_0x4213[_0x3700c3];return _0x5cc817;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));var BPromise=require(_0x3421('0x3'));var rs=require(_0x3421('0x4'));var fs=require('fs');var Redis=require(_0x3421('0x5'));var db=require(_0x3421('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3421('0x7'))('rpc');var config=require(_0x3421('0x8'));var jayson=require(_0x3421('0x9'));var client=jayson[_0x3421('0xa')][_0x3421('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5469d8,_0x50e464,_0x1b152f){return new BPromise(function(_0x130625,_0x1cf6a0){return client[_0x3421('0xc')](_0x5469d8,_0x1b152f)['then'](function(_0x1f20cf){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x50e464,_0x3421('0xd'));logger['debug'](_0x3421('0xe'),_0x50e464,_0x3421('0xd'),JSON[_0x3421('0xf')](_0x1f20cf));if(_0x1f20cf[_0x3421('0x10')]){if(_0x1f20cf[_0x3421('0x10')][_0x3421('0x11')]===0x1f4){logger[_0x3421('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x50e464,_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);return _0x1cf6a0(_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);}logger[_0x3421('0x10')](_0x3421('0x13'),_0x50e464,_0x1f20cf[_0x3421('0x10')]['message']);return _0x130625(_0x1f20cf[_0x3421('0x10')]['message']);}else{logger[_0x3421('0x14')](_0x3421('0x13'),_0x50e464,'request\x20sent');_0x130625(_0x1f20cf[_0x3421('0x15')]['message']);}})[_0x3421('0x16')](function(_0x23694b){logger['error'](_0x3421('0x13'),_0x50e464,_0x23694b);_0x1cf6a0(_0x23694b);});});}exports[_0x3421('0x17')]=function(_0x130d3c){var _0x104cc5=this;return new Promise(function(_0x18acc1,_0x200fdd){return db[_0x3421('0x18')][_0x3421('0x19')](_0x130d3c[_0x3421('0x1a')],{'raw':_0x130d3c[_0x3421('0x1b')]?_0x130d3c[_0x3421('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3421('0x1c')](function(_0x4b59a5){logger['info']('CreateSquareDetailsReport',_0x130d3c);logger[_0x3421('0x1d')](_0x3421('0x17'),_0x130d3c,JSON[_0x3421('0xf')](_0x4b59a5));_0x18acc1(_0x4b59a5);})[_0x3421('0x16')](function(_0x132e8e){logger[_0x3421('0x10')](_0x3421('0x17'),_0x132e8e[_0x3421('0x12')],_0x130d3c);_0x200fdd(_0x104cc5[_0x3421('0x10')](0x1f4,_0x132e8e[_0x3421('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3c752f9..b919b8b 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 _0x88a3=['killProcess','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x5dbc2b,_0x542434){var _0x55a3ac=function(_0x43174f){while(--_0x43174f){_0x5dbc2b['push'](_0x5dbc2b['shift']());}};_0x55a3ac(++_0x542434);}(_0x88a3,0x169));var _0x388a=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0x88a3[_0x3ab353];return _0x1e2285;};'use strict';var express=require(_0x388a('0x0'));var router=express[_0x388a('0x1')]();var auth=require(_0x388a('0x2'));var controller=require(_0x388a('0x3'));router[_0x388a('0x4')]('/',auth[_0x388a('0x5')](),controller[_0x388a('0x6')]);router[_0x388a('0x4')](_0x388a('0x7'),auth[_0x388a('0x5')](),controller[_0x388a('0x8')]);module['exports']=router; \ No newline at end of file +var _0x2d19=['killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','/process/:pid/kill','isAuthenticated'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2d19,0x146));var _0x92d1=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x2d19[_0x1a36a5];return _0x746243;};'use strict';var express=require(_0x92d1('0x0'));var router=express[_0x92d1('0x1')]();var auth=require(_0x92d1('0x2'));var controller=require(_0x92d1('0x3'));router[_0x92d1('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x92d1('0x4')](_0x92d1('0x5'),auth[_0x92d1('0x6')](),controller[_0x92d1('0x7')]);module[_0x92d1('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 4b54e37..0933288 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 _0x6a04=['api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','getAllData','json','catch','status','killProcess','format','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x6a04,0x182));var _0x46a0=function(_0x22d7f5,_0x4335b9){_0x22d7f5=_0x22d7f5-0x0;var _0xf4369f=_0x6a04[_0x22d7f5];return _0xf4369f;};'use strict';var info=require(_0x46a0('0x0'));var exec=require(_0x46a0('0x1'))[_0x46a0('0x2')];var logger=require(_0x46a0('0x3'))(_0x46a0('0x4'));var util=require('util');var BPromise=require(_0x46a0('0x5'));var _=require(_0x46a0('0x6'));function handleError(_0x503d04,_0x1b2961,_0x8db5d5){_0x1b2961=_0x1b2961||0x1f4;return function(_0x54d7d3){logger[_0x46a0('0x7')](_0x46a0('0x8'),_0x8db5d5,_0x1b2961,util[_0x46a0('0x9')](_0x54d7d3,{'showHidden':![],'depth':null}));delete _0x54d7d3[_0x46a0('0xa')];_0x503d04['status'](_0x1b2961)[_0x46a0('0xb')](_0x54d7d3);};}exports['index']=function(_0x13576d,_0x3cb443){return info[_0x46a0('0xc')]()['then'](function(_0x328071){return _0x3cb443['status'](0xc8)[_0x46a0('0xd')](_0x328071);})[_0x46a0('0xe')](function(_0x65e935){return _0x3cb443[_0x46a0('0xf')](0x1f4)[_0x46a0('0xd')](_0x65e935);});};exports[_0x46a0('0x10')]=function(_0x2f0ba8,_0x43963d){var _0x1e2acd=['components/import/cm'];return new BPromise(function(_0x10b4a1,_0x3e5bca){return exec(util[_0x46a0('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x2f0ba8['params'][_0x46a0('0x12')]),function(_0x4e5d3b,_0x778c94,_0x17e5f8){if(_0x4e5d3b){return _0x3e5bca(_0x4e5d3b);}return _0x10b4a1(_0x778c94);});})['then'](function(_0x196ca0){var _0x8fbd2e=![];var _0x1d1ba3=_0x196ca0['split'](/\n/);for(var _0x461bd7=0x0,_0x110edf=_0x1e2acd[_0x46a0('0x13')];_0x461bd7<_0x110edf,_0x8fbd2e===![];_0x461bd7+=0x1){if(_0x196ca0[_0x46a0('0x14')](_0x1e2acd[_0x461bd7])>=0x0){_0x8fbd2e=!![];}}if(!_0x8fbd2e){throw new Error(util[_0x46a0('0x11')](_0x46a0('0x15'),_0x2f0ba8['params']['pid']));}process[_0x46a0('0x16')](_0x2f0ba8[_0x46a0('0x17')]['pid'],_0x46a0('0x18'));return _0x43963d['status'](0xc8)[_0x46a0('0xd')]({'message':util[_0x46a0('0x11')](_0x46a0('0x19'),_0x2f0ba8[_0x46a0('0x17')][_0x46a0('0x12')])});})[_0x46a0('0xe')](handleError(_0x43963d,null,_0x46a0('0x10')));}; \ No newline at end of file +var _0x6146=['systeminformation','exec','../../config/logger','api','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x6146,0x134));var _0x6614=function(_0xab411,_0x5726cc){_0xab411=_0xab411-0x0;var _0x5a34c2=_0x6146[_0xab411];return _0x5a34c2;};'use strict';var info=require(_0x6614('0x0'));var exec=require('child_process')[_0x6614('0x1')];var logger=require(_0x6614('0x2'))(_0x6614('0x3'));var util=require('util');var BPromise=require(_0x6614('0x4'));var _=require('lodash');function handleError(_0x1f9861,_0x3d1fe4,_0x4a78d7){_0x3d1fe4=_0x3d1fe4||0x1f4;return function(_0x39bb34){logger['error'](_0x6614('0x5'),_0x4a78d7,_0x3d1fe4,util['inspect'](_0x39bb34,{'showHidden':![],'depth':null}));delete _0x39bb34['name'];_0x1f9861[_0x6614('0x6')](_0x3d1fe4)[_0x6614('0x7')](_0x39bb34);};}exports[_0x6614('0x8')]=function(_0x3dc600,_0x313eb4){return info['getAllData']()[_0x6614('0x9')](function(_0x213a29){return _0x313eb4['status'](0xc8)[_0x6614('0xa')](_0x213a29);})[_0x6614('0xb')](function(_0x3564f1){return _0x313eb4['status'](0x1f4)[_0x6614('0xa')](_0x3564f1);});};exports[_0x6614('0xc')]=function(_0x18a493,_0x8555f6){var _0x42b462=[_0x6614('0xd')];return new BPromise(function(_0x13dabd,_0x3b2634){return exec(util[_0x6614('0xe')](_0x6614('0xf'),_0x18a493[_0x6614('0x10')]['pid']),function(_0x13e739,_0x4fc632,_0x3b5fa5){if(_0x13e739){return _0x3b2634(_0x13e739);}return _0x13dabd(_0x4fc632);});})['then'](function(_0x305b97){var _0xc57e25=![];var _0x55d871=_0x305b97['split'](/\n/);for(var _0xf33fb1=0x0,_0x1d353a=_0x42b462[_0x6614('0x11')];_0xf33fb1<_0x1d353a,_0xc57e25===![];_0xf33fb1+=0x1){if(_0x305b97[_0x6614('0x12')](_0x42b462[_0xf33fb1])>=0x0){_0xc57e25=!![];}}if(!_0xc57e25){throw new Error(util[_0x6614('0xe')](_0x6614('0x13'),_0x18a493[_0x6614('0x10')][_0x6614('0x14')]));}process['kill'](_0x18a493[_0x6614('0x10')][_0x6614('0x14')],_0x6614('0x15'));return _0x8555f6[_0x6614('0x6')](0xc8)[_0x6614('0xa')]({'message':util[_0x6614('0xe')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x18a493['params'][_0x6614('0x14')])});})[_0x6614('0xb')](handleError(_0x8555f6,null,_0x6614('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 512c2fb..6eb16f0 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 _0xf9a8=['fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','index','get','show','isAuthenticated','create','put','/:id','destroy','exports','multer','connect-timeout','Router'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0xf9a8,0x1bd));var _0x8f9a=function(_0x34723f,_0x448df1){_0x34723f=_0x34723f-0x0;var _0x13a781=_0xf9a8[_0x34723f];return _0x13a781;};'use strict';var multer=require(_0x8f9a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8f9a('0x1'));var express=require('express');var router=express[_0x8f9a('0x2')]();var fs_extra=require(_0x8f9a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8f9a('0x4'));var config=require(_0x8f9a('0x5'));var controller=require(_0x8f9a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8f9a('0x7')]);router[_0x8f9a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8f9a('0x9')]);router['post']('/',auth[_0x8f9a('0xa')](),controller[_0x8f9a('0xb')]);router[_0x8f9a('0xc')](_0x8f9a('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8f9a('0xa')](),controller[_0x8f9a('0xe')]);module[_0x8f9a('0xf')]=router; \ No newline at end of file +var _0xd058=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x51bb4d,_0xbe6d0a){var _0xf4ddc2=function(_0x2d3e9d){while(--_0x2d3e9d){_0x51bb4d['push'](_0x51bb4d['shift']());}};_0xf4ddc2(++_0xbe6d0a);}(_0xd058,0xe7));var _0x8d05=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0xd058[_0x3cb152];return _0x4f54c3;};'use strict';var multer=require('multer');var util=require(_0x8d05('0x0'));var path=require(_0x8d05('0x1'));var timeout=require(_0x8d05('0x2'));var express=require(_0x8d05('0x3'));var router=express[_0x8d05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8d05('0x5'));var interaction=require(_0x8d05('0x6'));var config=require(_0x8d05('0x7'));var controller=require(_0x8d05('0x8'));router[_0x8d05('0x9')]('/',auth[_0x8d05('0xa')](),controller[_0x8d05('0xb')]);router['get'](_0x8d05('0xc'),auth[_0x8d05('0xa')](),controller[_0x8d05('0xd')]);router[_0x8d05('0xe')]('/',auth[_0x8d05('0xa')](),controller[_0x8d05('0xf')]);router[_0x8d05('0x10')](_0x8d05('0xc'),auth[_0x8d05('0xa')](),controller[_0x8d05('0x11')]);router[_0x8d05('0x12')]('/:id',auth[_0x8d05('0xa')](),controller[_0x8d05('0x13')]);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 c48a59f..d4f38a8 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 _0x00ea=['STRING','#0091EA','exports'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0x00ea,0x19d));var _0xa00e=function(_0x592515,_0x5dc869){_0x592515=_0x592515-0x0;var _0x44b2f3=_0x00ea[_0x592515];return _0x44b2f3;};'use strict';var Sequelize=require('sequelize');module[_0xa00e('0x0')]={'name':{'type':Sequelize[_0xa00e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa00e('0x1')],'defaultValue':_0xa00e('0x2')},'description':{'type':Sequelize[_0xa00e('0x1')]}}; \ No newline at end of file +var _0x1cc3=['name','#0091EA','STRING','sequelize','exports'];(function(_0x355e11,_0x4a6e8c){var _0x5a7f87=function(_0x37bbb2){while(--_0x37bbb2){_0x355e11['push'](_0x355e11['shift']());}};_0x5a7f87(++_0x4a6e8c);}(_0x1cc3,0x11b));var _0x31cc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1cc3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x31cc('0x0'));module[_0x31cc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x31cc('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x31cc('0x3')},'description':{'type':Sequelize[_0x31cc('0x4')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index c15efee..d90af35 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 _0x2750=['sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','then','get','Tags','UserProfileResource','error','stack','name','send','map','Tag','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x693163,_0x5da28a){var _0x14cfab=function(_0x2f6c27){while(--_0x2f6c27){_0x693163['push'](_0x693163['shift']());}};_0x14cfab(++_0x5da28a);}(_0x2750,0x13b));var _0x0275=function(_0xa312e6,_0x5d84e0){_0xa312e6=_0xa312e6-0x0;var _0x17fa30=_0x2750[_0xa312e6];return _0x17fa30;};'use strict';var emlformat=require(_0x0275('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0275('0x1'));var jsonpatch=require(_0x0275('0x2'));var rp=require(_0x0275('0x3'));var moment=require(_0x0275('0x4'));var BPromise=require(_0x0275('0x5'));var Mustache=require(_0x0275('0x6'));var util=require(_0x0275('0x7'));var path=require(_0x0275('0x8'));var sox=require(_0x0275('0x9'));var csv=require(_0x0275('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0275('0xb'));var _=require(_0x0275('0xc'));var squel=require(_0x0275('0xd'));var crypto=require(_0x0275('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0275('0xf'));var toCsv=require(_0x0275('0xa'));var querystring=require(_0x0275('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0275('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0275('0x12'));var hardwareService=require(_0x0275('0x13'));var logger=require(_0x0275('0x14'))(_0x0275('0x15'));var utils=require(_0x0275('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0275('0x17'));var db=require(_0x0275('0x18'))['db'];function respondWithStatusCode(_0x1f128d,_0x4c6ee0){_0x4c6ee0=_0x4c6ee0||0xcc;return function(_0x55ffd6){if(_0x55ffd6){return _0x1f128d[_0x0275('0x19')](_0x4c6ee0);}return _0x1f128d[_0x0275('0x1a')](_0x4c6ee0)[_0x0275('0x1b')]();};}function respondWithResult(_0x46a729,_0x28827b){_0x28827b=_0x28827b||0xc8;return function(_0x36921c){if(_0x36921c){return _0x46a729['status'](_0x28827b)[_0x0275('0x1c')](_0x36921c);}};}function respondWithFilteredResult(_0x3030c0,_0x4aa412){return function(_0x6344fc){if(_0x6344fc){var _0xaae367=typeof _0x4aa412['offset']===_0x0275('0x1d')&&typeof _0x4aa412[_0x0275('0x1e')]==='undefined';var _0x5e7466=_0x6344fc['count'];var _0x591d27=_0xaae367?0x0:_0x4aa412['offset'];var _0x566ad6=_0xaae367?_0x6344fc[_0x0275('0x1f')]:_0x4aa412[_0x0275('0x20')]+_0x4aa412['limit'];var _0x7075c9;if(_0x566ad6>=_0x5e7466){_0x566ad6=_0x5e7466;_0x7075c9=0xc8;}else{_0x7075c9=0xce;}_0x3030c0[_0x0275('0x1a')](_0x7075c9);return _0x3030c0[_0x0275('0x21')]('Content-Range',_0x591d27+'-'+_0x566ad6+'/'+_0x5e7466)[_0x0275('0x1c')](_0x6344fc);}return null;};}function patchUpdates(_0x402f0d){return function(_0x575786){try{jsonpatch['apply'](_0x575786,_0x402f0d,!![]);}catch(_0x31ba9e){return BPromise[_0x0275('0x22')](_0x31ba9e);}return _0x575786[_0x0275('0x23')]();};}function saveUpdates(_0x592a53,_0xf3b68e){return function(_0x5ab9e7){if(_0x5ab9e7){return _0x5ab9e7[_0x0275('0x24')](_0x592a53)['then'](function(_0x26f2c2){return _0x26f2c2;});}return null;};}function removeEntity(_0xfa0081,_0x594321){return function(_0x140a18){if(_0x140a18){return _0x140a18[_0x0275('0x25')]()[_0x0275('0x26')](function(){var _0x52946b=_0x140a18[_0x0275('0x27')]({'plain':!![]});var _0x44bbf8=_0x0275('0x28');return db[_0x0275('0x29')][_0x0275('0x25')]({'where':{'type':_0x44bbf8,'resourceId':_0x52946b['id']}})[_0x0275('0x26')](function(){return _0x140a18;});})['then'](function(){_0xfa0081[_0x0275('0x1a')](0xcc)[_0x0275('0x1b')]();});}};}function handleEntityNotFound(_0x1d24b2,_0x275dac){return function(_0x4689a3){if(!_0x4689a3){_0x1d24b2['sendStatus'](0x194);}return _0x4689a3;};}function handleError(_0x1ffd57,_0xd59d69){_0xd59d69=_0xd59d69||0x1f4;return function(_0x3246ea){logger[_0x0275('0x2a')](_0x3246ea[_0x0275('0x2b')]);if(_0x3246ea['name']){delete _0x3246ea[_0x0275('0x2c')];}_0x1ffd57[_0x0275('0x1a')](_0xd59d69)[_0x0275('0x2d')](_0x3246ea);};}exports['index']=function(_0x5e2e22,_0x3cb2d7){var _0x299190={},_0x5dc2bc={},_0x7eff96={'count':0x0,'rows':[]};var _0x155a50=_[_0x0275('0x2e')](db[_0x0275('0x2f')]['rawAttributes'],function(_0x24c762){return{'name':_0x24c762[_0x0275('0x30')],'type':_0x24c762[_0x0275('0x31')][_0x0275('0x32')]};});_0x5dc2bc['model']=_[_0x0275('0x2e')](_0x155a50,'name');_0x5dc2bc[_0x0275('0x33')]=_['keys'](_0x5e2e22[_0x0275('0x33')]);_0x5dc2bc[_0x0275('0x34')]=_['intersection'](_0x5dc2bc[_0x0275('0x35')],_0x5dc2bc[_0x0275('0x33')]);_0x299190[_0x0275('0x36')]=_[_0x0275('0x37')](_0x5dc2bc['model'],qs[_0x0275('0x38')](_0x5e2e22[_0x0275('0x33')][_0x0275('0x38')]));_0x299190[_0x0275('0x36')]=_0x299190[_0x0275('0x36')]['length']?_0x299190[_0x0275('0x36')]:_0x5dc2bc[_0x0275('0x35')];if(!_0x5e2e22[_0x0275('0x33')][_0x0275('0x39')](_0x0275('0x3a'))){_0x299190[_0x0275('0x1e')]=qs[_0x0275('0x1e')](_0x5e2e22[_0x0275('0x33')][_0x0275('0x1e')]);_0x299190[_0x0275('0x20')]=qs[_0x0275('0x20')](_0x5e2e22['query'][_0x0275('0x20')]);}_0x299190[_0x0275('0x3b')]=qs[_0x0275('0x3c')](_0x5e2e22[_0x0275('0x33')][_0x0275('0x3c')]);_0x299190[_0x0275('0x3d')]=qs[_0x0275('0x34')](_[_0x0275('0x3e')](_0x5e2e22[_0x0275('0x33')],_0x5dc2bc[_0x0275('0x34')]),_0x155a50);if(_0x5e2e22[_0x0275('0x33')][_0x0275('0x3f')]){_0x299190[_0x0275('0x3d')]=_[_0x0275('0x40')](_0x299190['where'],{'$or':_[_0x0275('0x2e')](_0x155a50,function(_0x1cc40d){if(_0x1cc40d['type']!==_0x0275('0x41')){var _0x76b8fa={};_0x76b8fa[_0x1cc40d[_0x0275('0x2c')]]={'$like':'%'+_0x5e2e22[_0x0275('0x33')][_0x0275('0x3f')]+'%'};return _0x76b8fa;}})});}_0x299190=_[_0x0275('0x40')]({},_0x299190,_0x5e2e22[_0x0275('0x42')]);var _0x5e57b5={'where':_0x299190[_0x0275('0x3d')]};return db[_0x0275('0x2f')][_0x0275('0x1f')](_0x5e57b5)[_0x0275('0x26')](function(_0x4f888c){_0x7eff96[_0x0275('0x1f')]=_0x4f888c;if(_0x5e2e22[_0x0275('0x33')][_0x0275('0x43')]){_0x299190[_0x0275('0x44')]=[{'all':!![]}];}return db['Tag'][_0x0275('0x45')](_0x299190);})['then'](function(_0x261e66){_0x7eff96[_0x0275('0x46')]=_0x261e66;return _0x7eff96;})[_0x0275('0x26')](respondWithFilteredResult(_0x3cb2d7,_0x299190))[_0x0275('0x47')](handleError(_0x3cb2d7,null));};exports['show']=function(_0x13c651,_0x3d1bfc){var _0x59839d={'raw':!![],'where':{'id':_0x13c651[_0x0275('0x48')]['id']}},_0x1e143e={};_0x1e143e[_0x0275('0x35')]=_['keys'](db[_0x0275('0x2f')][_0x0275('0x49')]);_0x1e143e['query']=_[_0x0275('0x4a')](_0x13c651[_0x0275('0x33')]);_0x1e143e[_0x0275('0x34')]=_[_0x0275('0x37')](_0x1e143e[_0x0275('0x35')],_0x1e143e[_0x0275('0x33')]);_0x59839d[_0x0275('0x36')]=_[_0x0275('0x37')](_0x1e143e[_0x0275('0x35')],qs[_0x0275('0x38')](_0x13c651[_0x0275('0x33')]['fields']));_0x59839d[_0x0275('0x36')]=_0x59839d[_0x0275('0x36')][_0x0275('0x4b')]?_0x59839d[_0x0275('0x36')]:_0x1e143e[_0x0275('0x35')];if(_0x13c651[_0x0275('0x33')][_0x0275('0x43')]){_0x59839d[_0x0275('0x44')]=[{'all':!![]}];}_0x59839d=_[_0x0275('0x40')]({},_0x59839d,_0x13c651[_0x0275('0x42')]);return db[_0x0275('0x2f')]['find'](_0x59839d)['then'](handleEntityNotFound(_0x3d1bfc,null))[_0x0275('0x26')](respondWithResult(_0x3d1bfc,null))[_0x0275('0x47')](handleError(_0x3d1bfc,null));};exports[_0x0275('0x4c')]=function(_0x3bd019,_0x310c6b){return db['Tag'][_0x0275('0x4c')](_0x3bd019['body'],{})[_0x0275('0x26')](function(_0x17dde0){var _0x27a469=_0x3bd019[_0x0275('0x4d')]['get']({'plain':!![]});if(!_0x27a469)throw new Error(_0x0275('0x4e'));if(_0x27a469['role']==='user'){var _0x515860=_0x17dde0[_0x0275('0x27')]({'plain':!![]});var _0x4e36fc=_0x0275('0x28');return db[_0x0275('0x4f')][_0x0275('0x50')]({'where':{'name':_0x4e36fc,'userProfileId':_0x27a469[_0x0275('0x51')]},'raw':!![]})[_0x0275('0x26')](function(_0x11794b){if(_0x11794b&&_0x11794b[_0x0275('0x52')]===0x0){return db['UserProfileResource'][_0x0275('0x4c')]({'name':_0x515860['name'],'resourceId':_0x515860['id'],'type':_0x11794b[_0x0275('0x2c')],'sectionId':_0x11794b['id']},{})[_0x0275('0x26')](function(){return _0x17dde0;});}else{return _0x17dde0;}})[_0x0275('0x47')](function(_0x1686d9){logger[_0x0275('0x2a')](_0x0275('0x53'),_0x1686d9);throw _0x1686d9;});}return _0x17dde0;})[_0x0275('0x26')](respondWithResult(_0x310c6b,0xc9))[_0x0275('0x47')](handleError(_0x310c6b,null));};exports[_0x0275('0x24')]=function(_0x3673ad,_0x545333){if(_0x3673ad['body']['id']){delete _0x3673ad[_0x0275('0x54')]['id'];}return db['Tag']['find']({'where':{'id':_0x3673ad[_0x0275('0x48')]['id']}})[_0x0275('0x26')](handleEntityNotFound(_0x545333,null))[_0x0275('0x26')](saveUpdates(_0x3673ad[_0x0275('0x54')],null))[_0x0275('0x26')](respondWithResult(_0x545333,null))[_0x0275('0x47')](handleError(_0x545333,null));};exports['destroy']=function(_0x104232,_0x163ce2){return db[_0x0275('0x2f')][_0x0275('0x50')]({'where':{'id':_0x104232[_0x0275('0x48')]['id']}})[_0x0275('0x26')](handleEntityNotFound(_0x163ce2,null))['then'](removeEntity(_0x163ce2,null))[_0x0275('0x47')](handleError(_0x163ce2,null));}; \ No newline at end of file +var _0xb07f=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','Tag','findAll','rows','catch','show','params','keys','length','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb07f,0x109));var _0xfb07=function(_0x44403d,_0x253dda){_0x44403d=_0x44403d-0x0;var _0x354c27=_0xb07f[_0x44403d];return _0x354c27;};'use strict';var emlformat=require(_0xfb07('0x0'));var rimraf=require(_0xfb07('0x1'));var zipdir=require(_0xfb07('0x2'));var jsonpatch=require(_0xfb07('0x3'));var rp=require(_0xfb07('0x4'));var moment=require(_0xfb07('0x5'));var BPromise=require(_0xfb07('0x6'));var Mustache=require(_0xfb07('0x7'));var util=require(_0xfb07('0x8'));var path=require(_0xfb07('0x9'));var sox=require(_0xfb07('0xa'));var csv=require('to-csv');var ejs=require(_0xfb07('0xb'));var fs=require('fs');var fs_extra=require(_0xfb07('0xc'));var _=require(_0xfb07('0xd'));var squel=require(_0xfb07('0xe'));var crypto=require(_0xfb07('0xf'));var jsforce=require(_0xfb07('0x10'));var deskjs=require(_0xfb07('0x11'));var toCsv=require(_0xfb07('0x12'));var querystring=require(_0xfb07('0x13'));var Papa=require(_0xfb07('0x14'));var Redis=require(_0xfb07('0x15'));var authService=require(_0xfb07('0x16'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb07('0x17'))(_0xfb07('0x18'));var utils=require('../../config/utils');var config=require(_0xfb07('0x19'));var licenseUtil=require(_0xfb07('0x1a'));var db=require(_0xfb07('0x1b'))['db'];function respondWithStatusCode(_0x13275d,_0x2ad2cf){_0x2ad2cf=_0x2ad2cf||0xcc;return function(_0x35fd11){if(_0x35fd11){return _0x13275d[_0xfb07('0x1c')](_0x2ad2cf);}return _0x13275d['status'](_0x2ad2cf)[_0xfb07('0x1d')]();};}function respondWithResult(_0x40bf71,_0x3c69db){_0x3c69db=_0x3c69db||0xc8;return function(_0x2c35e4){if(_0x2c35e4){return _0x40bf71[_0xfb07('0x1e')](_0x3c69db)[_0xfb07('0x1f')](_0x2c35e4);}};}function respondWithFilteredResult(_0x29cbae,_0x228e2a){return function(_0x2363d6){if(_0x2363d6){var _0x6a14e0=typeof _0x228e2a[_0xfb07('0x20')]===_0xfb07('0x21')&&typeof _0x228e2a[_0xfb07('0x22')]===_0xfb07('0x21');var _0x4ebcc3=_0x2363d6['count'];var _0x3e747e=_0x6a14e0?0x0:_0x228e2a[_0xfb07('0x20')];var _0x197f12=_0x6a14e0?_0x2363d6['count']:_0x228e2a[_0xfb07('0x20')]+_0x228e2a[_0xfb07('0x22')];var _0x527c4e;if(_0x197f12>=_0x4ebcc3){_0x197f12=_0x4ebcc3;_0x527c4e=0xc8;}else{_0x527c4e=0xce;}_0x29cbae['status'](_0x527c4e);return _0x29cbae[_0xfb07('0x23')](_0xfb07('0x24'),_0x3e747e+'-'+_0x197f12+'/'+_0x4ebcc3)[_0xfb07('0x1f')](_0x2363d6);}return null;};}function patchUpdates(_0x2c6c44){return function(_0x388995){try{jsonpatch[_0xfb07('0x25')](_0x388995,_0x2c6c44,!![]);}catch(_0x15e153){return BPromise[_0xfb07('0x26')](_0x15e153);}return _0x388995[_0xfb07('0x27')]();};}function saveUpdates(_0x578bb2,_0x45806a){return function(_0x56d0c4){if(_0x56d0c4){return _0x56d0c4[_0xfb07('0x28')](_0x578bb2)[_0xfb07('0x29')](function(_0x428c85){return _0x428c85;});}return null;};}function removeEntity(_0x301c1a,_0xb2063a){return function(_0x508d3b){if(_0x508d3b){return _0x508d3b[_0xfb07('0x2a')]()[_0xfb07('0x29')](function(){var _0x10835a=_0x508d3b[_0xfb07('0x2b')]({'plain':!![]});var _0x3b14fa=_0xfb07('0x2c');return db['UserProfileResource'][_0xfb07('0x2a')]({'where':{'type':_0x3b14fa,'resourceId':_0x10835a['id']}})[_0xfb07('0x29')](function(){return _0x508d3b;});})['then'](function(){_0x301c1a[_0xfb07('0x1e')](0xcc)[_0xfb07('0x1d')]();});}};}function handleEntityNotFound(_0xe813a7,_0x149ac0){return function(_0x46927a){if(!_0x46927a){_0xe813a7[_0xfb07('0x1c')](0x194);}return _0x46927a;};}function handleError(_0x20f01a,_0x24ff99){_0x24ff99=_0x24ff99||0x1f4;return function(_0x95f1d){logger[_0xfb07('0x2d')](_0x95f1d[_0xfb07('0x2e')]);if(_0x95f1d['name']){delete _0x95f1d[_0xfb07('0x2f')];}_0x20f01a[_0xfb07('0x1e')](_0x24ff99)[_0xfb07('0x30')](_0x95f1d);};}exports[_0xfb07('0x31')]=function(_0x5dd4c9,_0x46d57e){var _0xd5290c={},_0x4ce9a4={},_0x36da2a={'count':0x0,'rows':[]};var _0x5dc353=_[_0xfb07('0x32')](db['Tag'][_0xfb07('0x33')],function(_0x4a8d4c){return{'name':_0x4a8d4c[_0xfb07('0x34')],'type':_0x4a8d4c[_0xfb07('0x35')][_0xfb07('0x36')]};});_0x4ce9a4[_0xfb07('0x37')]=_[_0xfb07('0x32')](_0x5dc353,_0xfb07('0x2f'));_0x4ce9a4['query']=_['keys'](_0x5dd4c9[_0xfb07('0x38')]);_0x4ce9a4[_0xfb07('0x39')]=_[_0xfb07('0x3a')](_0x4ce9a4[_0xfb07('0x37')],_0x4ce9a4['query']);_0xd5290c['attributes']=_[_0xfb07('0x3a')](_0x4ce9a4[_0xfb07('0x37')],qs[_0xfb07('0x3b')](_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x3b')]));_0xd5290c[_0xfb07('0x3c')]=_0xd5290c['attributes']['length']?_0xd5290c['attributes']:_0x4ce9a4[_0xfb07('0x37')];if(!_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x3d')](_0xfb07('0x3e'))){_0xd5290c['limit']=qs['limit'](_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x22')]);_0xd5290c['offset']=qs['offset'](_0x5dd4c9['query'][_0xfb07('0x20')]);}_0xd5290c[_0xfb07('0x3f')]=qs['sort'](_0x5dd4c9['query'][_0xfb07('0x40')]);_0xd5290c[_0xfb07('0x41')]=qs[_0xfb07('0x39')](_[_0xfb07('0x42')](_0x5dd4c9[_0xfb07('0x38')],_0x4ce9a4['filters']),_0x5dc353);if(_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x43')]){_0xd5290c[_0xfb07('0x41')]=_[_0xfb07('0x44')](_0xd5290c['where'],{'$or':_['map'](_0x5dc353,function(_0x2d40cb){if(_0x2d40cb[_0xfb07('0x35')]!==_0xfb07('0x45')){var _0xc5df59={};_0xc5df59[_0x2d40cb[_0xfb07('0x2f')]]={'$like':'%'+_0x5dd4c9[_0xfb07('0x38')][_0xfb07('0x43')]+'%'};return _0xc5df59;}})});}_0xd5290c=_['merge']({},_0xd5290c,_0x5dd4c9['options']);var _0x44dafb={'where':_0xd5290c[_0xfb07('0x41')]};return db['Tag']['count'](_0x44dafb)[_0xfb07('0x29')](function(_0x20d682){_0x36da2a[_0xfb07('0x46')]=_0x20d682;if(_0x5dd4c9['query']['includeAll']){_0xd5290c[_0xfb07('0x47')]=[{'all':!![]}];}return db[_0xfb07('0x48')][_0xfb07('0x49')](_0xd5290c);})[_0xfb07('0x29')](function(_0xb87b68){_0x36da2a[_0xfb07('0x4a')]=_0xb87b68;return _0x36da2a;})[_0xfb07('0x29')](respondWithFilteredResult(_0x46d57e,_0xd5290c))[_0xfb07('0x4b')](handleError(_0x46d57e,null));};exports[_0xfb07('0x4c')]=function(_0x492f1b,_0x41df3f){var _0x12c588={'raw':!![],'where':{'id':_0x492f1b[_0xfb07('0x4d')]['id']}},_0x3d6372={};_0x3d6372[_0xfb07('0x37')]=_[_0xfb07('0x4e')](db[_0xfb07('0x48')][_0xfb07('0x33')]);_0x3d6372[_0xfb07('0x38')]=_[_0xfb07('0x4e')](_0x492f1b['query']);_0x3d6372['filters']=_[_0xfb07('0x3a')](_0x3d6372[_0xfb07('0x37')],_0x3d6372['query']);_0x12c588[_0xfb07('0x3c')]=_[_0xfb07('0x3a')](_0x3d6372[_0xfb07('0x37')],qs[_0xfb07('0x3b')](_0x492f1b[_0xfb07('0x38')]['fields']));_0x12c588['attributes']=_0x12c588[_0xfb07('0x3c')][_0xfb07('0x4f')]?_0x12c588[_0xfb07('0x3c')]:_0x3d6372[_0xfb07('0x37')];if(_0x492f1b[_0xfb07('0x38')][_0xfb07('0x50')]){_0x12c588[_0xfb07('0x47')]=[{'all':!![]}];}_0x12c588=_[_0xfb07('0x44')]({},_0x12c588,_0x492f1b[_0xfb07('0x51')]);return db[_0xfb07('0x48')]['find'](_0x12c588)['then'](handleEntityNotFound(_0x41df3f,null))['then'](respondWithResult(_0x41df3f,null))[_0xfb07('0x4b')](handleError(_0x41df3f,null));};exports['create']=function(_0x2397f8,_0x31cca8){return db[_0xfb07('0x48')][_0xfb07('0x52')](_0x2397f8[_0xfb07('0x53')],{})[_0xfb07('0x29')](function(_0x4d464e){var _0x3b2cce=_0x2397f8[_0xfb07('0x54')][_0xfb07('0x2b')]({'plain':!![]});if(!_0x3b2cce)throw new Error(_0xfb07('0x55'));if(_0x3b2cce[_0xfb07('0x56')]==='user'){var _0x3cfb89=_0x4d464e[_0xfb07('0x2b')]({'plain':!![]});var _0x40fa4a=_0xfb07('0x2c');return db[_0xfb07('0x57')]['find']({'where':{'name':_0x40fa4a,'userProfileId':_0x3b2cce[_0xfb07('0x58')]},'raw':!![]})[_0xfb07('0x29')](function(_0x38b30e){if(_0x38b30e&&_0x38b30e[_0xfb07('0x59')]===0x0){return db[_0xfb07('0x5a')]['create']({'name':_0x3cfb89[_0xfb07('0x2f')],'resourceId':_0x3cfb89['id'],'type':_0x38b30e[_0xfb07('0x2f')],'sectionId':_0x38b30e['id']},{})[_0xfb07('0x29')](function(){return _0x4d464e;});}else{return _0x4d464e;}})[_0xfb07('0x4b')](function(_0x4e597d){logger[_0xfb07('0x2d')](_0xfb07('0x5b'),_0x4e597d);throw _0x4e597d;});}return _0x4d464e;})[_0xfb07('0x29')](respondWithResult(_0x31cca8,0xc9))[_0xfb07('0x4b')](handleError(_0x31cca8,null));};exports[_0xfb07('0x28')]=function(_0x165628,_0x353b33){if(_0x165628[_0xfb07('0x53')]['id']){delete _0x165628[_0xfb07('0x53')]['id'];}return db[_0xfb07('0x48')]['find']({'where':{'id':_0x165628[_0xfb07('0x4d')]['id']}})['then'](handleEntityNotFound(_0x353b33,null))[_0xfb07('0x29')](saveUpdates(_0x165628[_0xfb07('0x53')],null))[_0xfb07('0x29')](respondWithResult(_0x353b33,null))[_0xfb07('0x4b')](handleError(_0x353b33,null));};exports[_0xfb07('0x2a')]=function(_0x7746bb,_0x1c76af){return db['Tag']['find']({'where':{'id':_0x7746bb['params']['id']}})[_0xfb07('0x29')](handleEntityNotFound(_0x1c76af,null))[_0xfb07('0x29')](removeEntity(_0x1c76af,null))[_0xfb07('0x4b')](handleError(_0x1c76af,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ba307dc..0060d8c 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 _0x4040=['./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4040,0x1bf));var _0x0404=function(_0xcc2b26,_0x55eaa1){_0xcc2b26=_0xcc2b26-0x0;var _0xcfbf7c=_0x4040[_0xcc2b26];return _0xcfbf7c;};'use strict';var _=require(_0x0404('0x0'));var util=require(_0x0404('0x1'));var logger=require(_0x0404('0x2'))(_0x0404('0x3'));var moment=require(_0x0404('0x4'));var BPromise=require(_0x0404('0x5'));var rp=require(_0x0404('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0404('0x7'));var attributes=require(_0x0404('0x8'));module[_0x0404('0x9')]=function(_0x2f90cf,_0x3ea71e){return _0x2f90cf[_0x0404('0xa')](_0x0404('0xb'),attributes,{'tableName':_0x0404('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b8c=['rimraf','../../config/environment','define','Tag','tools_tags','lodash','util','api','request-promise','path'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x2b8c,0x9b));var _0xc2b8=function(_0x21435f,_0x708b35){_0x21435f=_0x21435f-0x0;var _0x497ba3=_0x2b8c[_0x21435f];return _0x497ba3;};'use strict';var _=require(_0xc2b8('0x0'));var util=require(_0xc2b8('0x1'));var logger=require('../../config/logger')(_0xc2b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc2b8('0x3'));var fs=require('fs');var path=require(_0xc2b8('0x4'));var rimraf=require(_0xc2b8('0x5'));var config=require(_0xc2b8('0x6'));var attributes=require('./tag.attributes');module['exports']=function(_0xb16320,_0x313951){return _0xb16320[_0xc2b8('0x7')](_0xc2b8('0x8'),attributes,{'tableName':_0xc2b8('0x9'),'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 bfcd7d1..7adc8c1 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 _0x7bae=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7bae,0x13b));var _0xe7ba=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x7bae[_0x397cfb];return _0x15fed9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){return client[_0xe7ba('0xa')](_0x3c5e59,_0x34fb18)[_0xe7ba('0xb')](function(_0x588f08){logger[_0xe7ba('0xc')](_0xe7ba('0xd'),_0x10b307,_0xe7ba('0xe'));logger[_0xe7ba('0xf')](_0xe7ba('0x10'),_0x10b307,_0xe7ba('0xe'),JSON[_0xe7ba('0x11')](_0x588f08));if(_0x588f08[_0xe7ba('0x12')]){if(_0x588f08[_0xe7ba('0x12')]['code']===0x1f4){logger[_0xe7ba('0x12')]('Tag,\x20%s,\x20%s',_0x10b307,_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);return _0x27b1d5(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}logger[_0xe7ba('0x12')](_0xe7ba('0xd'),_0x10b307,_0x588f08['error']['message']);return _0x160565(_0x588f08[_0xe7ba('0x12')][_0xe7ba('0x13')]);}else{logger[_0xe7ba('0xc')]('Tag,\x20%s,\x20%s',_0x10b307,_0xe7ba('0xe'));_0x160565(_0x588f08['result']['message']);}})['catch'](function(_0x393f75){logger['error'](_0xe7ba('0xd'),_0x10b307,_0x393f75);_0x27b1d5(_0x393f75);});});} \ No newline at end of file +var _0x524a=['request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x524a,0xf5));var _0xa524=function(_0x10d19c,_0x32e7d8){_0x10d19c=_0x10d19c-0x0;var _0x15e2a2=_0x524a[_0x10d19c];return _0x15e2a2;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var moment=require(_0xa524('0x2'));var BPromise=require(_0xa524('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa524('0x4'));var db=require(_0xa524('0x5'))['db'];var utils=require(_0xa524('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa524('0x7'));var jayson=require(_0xa524('0x8'));var client=jayson[_0xa524('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460738,_0x56bd0e,_0x3a2dd6){return new BPromise(function(_0x11aa98,_0x56849e){return client[_0xa524('0xa')](_0x460738,_0x3a2dd6)[_0xa524('0xb')](function(_0x228ffe){logger[_0xa524('0xc')](_0xa524('0xd'),_0x56bd0e,'request\x20sent');logger[_0xa524('0xe')](_0xa524('0xf'),_0x56bd0e,'request\x20sent',JSON['stringify'](_0x228ffe));if(_0x228ffe[_0xa524('0x10')]){if(_0x228ffe[_0xa524('0x10')][_0xa524('0x11')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x56bd0e,_0x228ffe[_0xa524('0x10')]['message']);return _0x56849e(_0x228ffe[_0xa524('0x10')]['message']);}logger[_0xa524('0x10')]('Tag,\x20%s,\x20%s',_0x56bd0e,_0x228ffe[_0xa524('0x10')][_0xa524('0x12')]);return _0x11aa98(_0x228ffe['error'][_0xa524('0x12')]);}else{logger[_0xa524('0xc')](_0xa524('0xd'),_0x56bd0e,_0xa524('0x13'));_0x11aa98(_0x228ffe[_0xa524('0x14')][_0xa524('0x12')]);}})[_0xa524('0x15')](function(_0x4fc42f){logger[_0xa524('0x10')](_0xa524('0xd'),_0x56bd0e,_0x4fc42f);_0x56849e(_0x4fc42f);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 576f054..50f71bd 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 eda7a11..77c164a 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 _0xd8b0=['exports','sequelize'];(function(_0xf2a0a1,_0x2e4c9a){var _0x4ceba8=function(_0x53dae2){while(--_0x53dae2){_0xf2a0a1['push'](_0xf2a0a1['shift']());}};_0x4ceba8(++_0x2e4c9a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x339391,_0x36e9fe){var _0x409e16=function(_0x406706){while(--_0x406706){_0x339391['push'](_0x339391['shift']());}};_0x409e16(++_0x36e9fe);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 0aba895..2d32933 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 _0x96a0=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','rows','catch','params','length','include','find','create','user','get','Teams','UserProfileSection','autoAssociation','body','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','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','VoicePrefixId','end','findOne','isValidChannel','channel','ValidationError','capitalize','toLowerCase','Queue','pick','Queues','addQueues','Unknown\x20channel','add','ids','removeQueues','remove','isArray','Voice','Mail','Sms','Openchannel','Whatsapp','through','QueueId','penalty','findOrCreate','emit','Queue:save','User','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','TeamVoiceQueue','all','addAgents','spread','removeAgents','Chat','Fax','UserVoicePrefix','getAgents','filter','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','map','Team','rawAttributes'];(function(_0x53329f,_0x41ebb7){var _0x575498=function(_0x617527){while(--_0x617527){_0x53329f['push'](_0x53329f['shift']());}};_0x575498(++_0x41ebb7);}(_0x96a0,0x103));var _0x096a=function(_0x1a70c7,_0x51d9db){_0x1a70c7=_0x1a70c7-0x0;var _0x578ac3=_0x96a0[_0x1a70c7];return _0x578ac3;};'use strict';var emlformat=require(_0x096a('0x0'));var rimraf=require(_0x096a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x096a('0x2'));var rp=require(_0x096a('0x3'));var moment=require(_0x096a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x096a('0x5'));var util=require(_0x096a('0x6'));var path=require(_0x096a('0x7'));var sox=require('sox');var csv=require(_0x096a('0x8'));var ejs=require(_0x096a('0x9'));var fs=require('fs');var fs_extra=require(_0x096a('0xa'));var _=require(_0x096a('0xb'));var squel=require(_0x096a('0xc'));var crypto=require('crypto');var jsforce=require(_0x096a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x096a('0x8'));var querystring=require(_0x096a('0xe'));var Papa=require(_0x096a('0xf'));var Redis=require(_0x096a('0x10'));var authService=require(_0x096a('0x11'));var qs=require(_0x096a('0x12'));var as=require(_0x096a('0x13'));var hardwareService=require(_0x096a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x096a('0x15'));var config=require(_0x096a('0x16'));var licenseUtil=require(_0x096a('0x17'));var db=require(_0x096a('0x18'))['db'];config['redis']=_[_0x096a('0x19')](config['redis'],{'host':_0x096a('0x1a'),'port':0x18eb});var socket=require(_0x096a('0x1b'))(new Redis(config[_0x096a('0x1c')]));require('./team.socket')[_0x096a('0x1d')](socket);function respondWithStatusCode(_0x3ab720,_0x179db0){_0x179db0=_0x179db0||0xcc;return function(_0x39c1fd){if(_0x39c1fd){return _0x3ab720[_0x096a('0x1e')](_0x179db0);}return _0x3ab720[_0x096a('0x1f')](_0x179db0)['end']();};}function respondWithResult(_0x4be4ba,_0x3955f9){_0x3955f9=_0x3955f9||0xc8;return function(_0xde2ef9){if(_0xde2ef9){return _0x4be4ba[_0x096a('0x1f')](_0x3955f9)[_0x096a('0x20')](_0xde2ef9);}};}function respondWithFilteredResult(_0x73db44,_0x581a36){return function(_0x376f79){if(_0x376f79){var _0x5676bd=typeof _0x581a36[_0x096a('0x21')]===_0x096a('0x22')&&typeof _0x581a36['limit']===_0x096a('0x22');var _0x51274d=_0x376f79['count'];var _0x2c9621=_0x5676bd?0x0:_0x581a36[_0x096a('0x21')];var _0x3a2340=_0x5676bd?_0x376f79[_0x096a('0x23')]:_0x581a36[_0x096a('0x21')]+_0x581a36[_0x096a('0x24')];var _0x5bcf59;if(_0x3a2340>=_0x51274d){_0x3a2340=_0x51274d;_0x5bcf59=0xc8;}else{_0x5bcf59=0xce;}_0x73db44[_0x096a('0x1f')](_0x5bcf59);return _0x73db44[_0x096a('0x25')](_0x096a('0x26'),_0x2c9621+'-'+_0x3a2340+'/'+_0x51274d)['json'](_0x376f79);}return null;};}function patchUpdates(_0x111f18){return function(_0x24cf95){try{jsonpatch[_0x096a('0x27')](_0x24cf95,_0x111f18,!![]);}catch(_0x41ae04){return BPromise[_0x096a('0x28')](_0x41ae04);}return _0x24cf95['save']();};}function saveUpdates(_0x12f098,_0xf82578){return function(_0x992645){if(_0x992645){return _0x992645[_0x096a('0x29')](_0x12f098)[_0x096a('0x2a')](function(_0x29ae75){return _0x29ae75;});}return null;};}function handleEntityNotFound(_0x548ede,_0xb6d1f7){return function(_0xe622c0){if(!_0xe622c0){_0x548ede[_0x096a('0x1e')](0x194);}return _0xe622c0;};}function handleError(_0x167dd9,_0x1665d4){_0x1665d4=_0x1665d4||0x1f4;return function(_0x20a106){logger[_0x096a('0x2b')](_0x20a106[_0x096a('0x2c')]);if(_0x20a106[_0x096a('0x2d')]){delete _0x20a106[_0x096a('0x2d')];}_0x167dd9[_0x096a('0x1f')](_0x1665d4)['send'](_0x20a106);};}exports['index']=function(_0x319e5f,_0x501e8a){var _0x39fd43={},_0x561058={},_0x528880={'count':0x0,'rows':[]};var _0x499bd9=_[_0x096a('0x2e')](db[_0x096a('0x2f')][_0x096a('0x30')],function(_0x226d78){return{'name':_0x226d78[_0x096a('0x31')],'type':_0x226d78[_0x096a('0x32')][_0x096a('0x33')]};});_0x561058[_0x096a('0x34')]=_[_0x096a('0x2e')](_0x499bd9,_0x096a('0x2d'));_0x561058[_0x096a('0x35')]=_[_0x096a('0x36')](_0x319e5f[_0x096a('0x35')]);_0x561058[_0x096a('0x37')]=_[_0x096a('0x38')](_0x561058['model'],_0x561058[_0x096a('0x35')]);_0x39fd43[_0x096a('0x39')]=_[_0x096a('0x38')](_0x561058['model'],qs[_0x096a('0x3a')](_0x319e5f[_0x096a('0x35')]['fields']));_0x39fd43[_0x096a('0x39')]=_0x39fd43[_0x096a('0x39')]['length']?_0x39fd43['attributes']:_0x561058['model'];if(!_0x319e5f['query'][_0x096a('0x3b')]('nolimit')){_0x39fd43[_0x096a('0x24')]=qs['limit'](_0x319e5f[_0x096a('0x35')][_0x096a('0x24')]);_0x39fd43[_0x096a('0x21')]=qs['offset'](_0x319e5f['query'][_0x096a('0x21')]);}_0x39fd43[_0x096a('0x3c')]=qs[_0x096a('0x3d')](_0x319e5f['query']['sort']);_0x39fd43['where']=qs[_0x096a('0x37')](_['pick'](_0x319e5f['query'],_0x561058['filters']),_0x499bd9);if(_0x319e5f[_0x096a('0x35')]['filter']){_0x39fd43[_0x096a('0x3e')]=_[_0x096a('0x3f')](_0x39fd43['where'],{'$or':_[_0x096a('0x2e')](_0x499bd9,function(_0xdcd458){if(_0xdcd458[_0x096a('0x32')]!==_0x096a('0x40')){var _0x6d6ecb={};_0x6d6ecb[_0xdcd458['name']]={'$like':'%'+_0x319e5f[_0x096a('0x35')]['filter']+'%'};return _0x6d6ecb;}})});}_0x39fd43=_[_0x096a('0x3f')]({},_0x39fd43,_0x319e5f[_0x096a('0x41')]);var _0x469f73={'where':_0x39fd43[_0x096a('0x3e')]};return db['Team'][_0x096a('0x23')](_0x469f73)['then'](function(_0x3907c8){_0x528880[_0x096a('0x23')]=_0x3907c8;if(_0x319e5f[_0x096a('0x35')][_0x096a('0x42')]){_0x39fd43['include']=[{'all':!![]}];}return db[_0x096a('0x2f')]['findAll'](_0x39fd43);})[_0x096a('0x2a')](function(_0x263eb3){_0x528880[_0x096a('0x43')]=_0x263eb3;return _0x528880;})[_0x096a('0x2a')](respondWithFilteredResult(_0x501e8a,_0x39fd43))[_0x096a('0x44')](handleError(_0x501e8a,null));};exports['show']=function(_0x40f00b,_0x38f956){var _0x2030df={'raw':![],'where':{'id':_0x40f00b[_0x096a('0x45')]['id']}},_0xc4801c={};_0xc4801c['model']=_['keys'](db[_0x096a('0x2f')][_0x096a('0x30')]);_0xc4801c[_0x096a('0x35')]=_['keys'](_0x40f00b[_0x096a('0x35')]);_0xc4801c['filters']=_[_0x096a('0x38')](_0xc4801c[_0x096a('0x34')],_0xc4801c['query']);_0x2030df[_0x096a('0x39')]=_[_0x096a('0x38')](_0xc4801c[_0x096a('0x34')],qs[_0x096a('0x3a')](_0x40f00b[_0x096a('0x35')][_0x096a('0x3a')]));_0x2030df[_0x096a('0x39')]=_0x2030df[_0x096a('0x39')][_0x096a('0x46')]?_0x2030df['attributes']:_0xc4801c[_0x096a('0x34')];if(_0x40f00b[_0x096a('0x35')][_0x096a('0x42')]){_0x2030df[_0x096a('0x47')]=[{'all':!![]}];}_0x2030df=_[_0x096a('0x3f')]({},_0x2030df,_0x40f00b[_0x096a('0x41')]);return db['Team'][_0x096a('0x48')](_0x2030df)[_0x096a('0x2a')](handleEntityNotFound(_0x38f956,null))[_0x096a('0x2a')](respondWithResult(_0x38f956,null))[_0x096a('0x44')](handleError(_0x38f956,null));};exports['create']=function(_0x183350,_0x56f450){return db[_0x096a('0x2f')][_0x096a('0x49')](_0x183350['body'],{})[_0x096a('0x2a')](function(_0x430a32){var _0xe2efb4=_0x183350[_0x096a('0x4a')]['get']({'plain':!![]});if(!_0xe2efb4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe2efb4['role']==='user'){var _0x1c10e8=_0x430a32[_0x096a('0x4b')]({'plain':!![]});var _0x135466=_0x096a('0x4c');return db[_0x096a('0x4d')][_0x096a('0x48')]({'where':{'name':_0x135466,'userProfileId':_0xe2efb4['userProfileId']},'raw':!![]})[_0x096a('0x2a')](function(_0x161eba){if(_0x161eba&&_0x161eba[_0x096a('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c10e8[_0x096a('0x2d')],'resourceId':_0x1c10e8['id'],'type':_0x161eba[_0x096a('0x2d')],'sectionId':_0x161eba['id']},{})[_0x096a('0x2a')](function(){return _0x430a32;});}else{return _0x430a32;}})[_0x096a('0x44')](function(_0x575f0b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x575f0b);throw _0x575f0b;});}return _0x430a32;})[_0x096a('0x2a')](respondWithResult(_0x56f450,0xc9))[_0x096a('0x44')](handleError(_0x56f450,null));};exports[_0x096a('0x29')]=function(_0x4f2770,_0x16a788){if(_0x4f2770[_0x096a('0x4f')]['id']){delete _0x4f2770['body']['id'];}return db[_0x096a('0x2f')][_0x096a('0x48')]({'where':{'id':_0x4f2770['params']['id']}})[_0x096a('0x2a')](handleEntityNotFound(_0x16a788,null))[_0x096a('0x2a')](saveUpdates(_0x4f2770[_0x096a('0x4f')],null))['then'](respondWithResult(_0x16a788,null))[_0x096a('0x44')](handleError(_0x16a788,null));};exports['destroy']=function(_0x4c4f20,_0x1fa127){var _0x10647f=_0x4c4f20['params']['id'];var _0x416f3b=[];return db[_0x096a('0x50')][_0x096a('0x51')](function(_0x417dda){var _0xbf48b1=_0x096a('0x52')+_0x10647f;return db[_0x096a('0x50')][_0x096a('0x35')](_0xbf48b1,{'type':db['Sequelize'][_0x096a('0x53')][_0x096a('0x54')],'raw':!![],'transaction':_0x417dda})[_0x096a('0x2a')](function(_0x3e80f4){_0x416f3b=_['map'](_0x3e80f4,function(_0x10cc63){return Number(_0x10cc63[_0x096a('0x55')]);});})[_0x096a('0x2a')](function(){var _0x4ff313=_0x096a('0x56')+_0x10647f;return db['sequelize'][_0x096a('0x35')](_0x4ff313,{'type':db['Sequelize']['QueryTypes'][_0x096a('0x54')],'raw':!![],'transaction':_0x417dda});})['then'](function(_0x29162b){var _0x1811f8=_[_0x096a('0x2e')](_0x29162b,function(_0x3a5818){return Number(_0x3a5818[_0x096a('0x57')]);});return db[_0x096a('0x58')][_0x096a('0x59')]({'where':{'UserId':{'$in':_0x416f3b},'VoiceQueueId':{'$in':_0x1811f8}},'transaction':_0x417dda});})['then'](function(){var _0x160706=_0x096a('0x5a')+_0x10647f;return db['sequelize'][_0x096a('0x35')](_0x160706,{'type':db[_0x096a('0x5b')][_0x096a('0x53')][_0x096a('0x54')],'raw':!![],'transaction':_0x417dda});})[_0x096a('0x2a')](function(_0x305f1f){var _0x50bb1d=_[_0x096a('0x2e')](_0x305f1f,function(_0x4c48d5){return Number(_0x4c48d5['MailQueueId']);});return db[_0x096a('0x5c')][_0x096a('0x59')]({'where':{'UserId':{'$in':_0x416f3b},'MailQueueId':{'$in':_0x50bb1d}},'transaction':_0x417dda});})[_0x096a('0x2a')](function(){var _0x473929=_0x096a('0x5d')+_0x10647f;return db['sequelize'][_0x096a('0x35')](_0x473929,{'type':db[_0x096a('0x5b')][_0x096a('0x53')][_0x096a('0x54')],'raw':!![],'transaction':_0x417dda});})[_0x096a('0x2a')](function(_0x3a27d7){var _0x19fed8=_[_0x096a('0x2e')](_0x3a27d7,function(_0x8e9bda){return Number(_0x8e9bda[_0x096a('0x5e')]);});return db['UserSmsQueue'][_0x096a('0x59')]({'where':{'UserId':{'$in':_0x416f3b},'SmsQueueId':{'$in':_0x19fed8}},'transaction':_0x417dda});})[_0x096a('0x2a')](function(){var _0x3fd260=_0x096a('0x5f')+_0x10647f;return db['sequelize'][_0x096a('0x35')](_0x3fd260,{'type':db[_0x096a('0x5b')][_0x096a('0x53')][_0x096a('0x54')],'raw':!![],'transaction':_0x417dda});})[_0x096a('0x2a')](function(_0x1b3ad4){var _0xc1e33d=_[_0x096a('0x2e')](_0x1b3ad4,function(_0x2ba0ed){return Number(_0x2ba0ed['ChatQueueId']);});return db[_0x096a('0x60')]['destroy']({'where':{'UserId':{'$in':_0x416f3b},'ChatQueueId':{'$in':_0xc1e33d}},'transaction':_0x417dda});})[_0x096a('0x2a')](function(){var _0x24fec8='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x10647f;return db[_0x096a('0x50')][_0x096a('0x35')](_0x24fec8,{'type':db[_0x096a('0x5b')][_0x096a('0x53')]['SELECT'],'raw':!![],'transaction':_0x417dda});})['then'](function(_0x1bdfa6){var _0x31ad24=_['map'](_0x1bdfa6,function(_0x3fed42){return Number(_0x3fed42['FaxQueueId']);});return db[_0x096a('0x61')][_0x096a('0x59')]({'where':{'UserId':{'$in':_0x416f3b},'FaxQueueId':{'$in':_0x31ad24}},'transaction':_0x417dda});})[_0x096a('0x2a')](function(){var _0x36c06d=_0x096a('0x62')+_0x10647f;return db[_0x096a('0x50')][_0x096a('0x35')](_0x36c06d,{'type':db['Sequelize'][_0x096a('0x53')][_0x096a('0x54')],'raw':!![],'transaction':_0x417dda});})[_0x096a('0x2a')](function(_0x1df463){var _0x3c5f83=_[_0x096a('0x2e')](_0x1df463,function(_0x2750db){return Number(_0x2750db[_0x096a('0x63')]);});return db[_0x096a('0x64')]['destroy']({'where':{'UserId':{'$in':_0x416f3b},'OpenchannelQueueId':{'$in':_0x3c5f83}},'transaction':_0x417dda});})[_0x096a('0x2a')](function(){var _0x48176d=_0x096a('0x65')+_0x10647f;return db[_0x096a('0x50')][_0x096a('0x35')](_0x48176d,{'type':db[_0x096a('0x5b')][_0x096a('0x53')]['SELECT'],'raw':!![],'transaction':_0x417dda});})[_0x096a('0x2a')](function(_0x11a13d){var _0x45242a=_[_0x096a('0x2e')](_0x11a13d,function(_0xa5d2f){return Number(_0xa5d2f[_0x096a('0x66')]);});return db[_0x096a('0x67')][_0x096a('0x59')]({'where':{'UserId':{'$in':_0x416f3b},'WhatsappQueueId':{'$in':_0x45242a}},'transaction':_0x417dda});})[_0x096a('0x2a')](function(){return db[_0x096a('0x68')][_0x096a('0x48')]({'where':{'TeamId':_0x10647f}});})['then'](function(_0x39ce84){if(_0x39ce84===null){return;}return db['UserVoicePrefix'][_0x096a('0x59')]({'where':{'UserId':{'$in':_0x416f3b},'VoicePrefixId':_0x39ce84[_0x096a('0x69')]},'transaction':_0x417dda});})[_0x096a('0x2a')](function(){return db[_0x096a('0x2f')][_0x096a('0x59')]({'where':{'id':_0x10647f},'cascade':!![],'transaction':_0x417dda});})[_0x096a('0x2a')](function(_0x3ca103){if(_0x3ca103===0x0){_0x1fa127[_0x096a('0x1e')](0x194);}else{return db['UserProfileResource'][_0x096a('0x59')]({'where':{'type':'Teams','resourceId':_0x10647f},'cascade':!![],'transaction':_0x417dda})[_0x096a('0x2a')](function(){_0x1fa127[_0x096a('0x1f')](0xcc)[_0x096a('0x6a')]();});}})[_0x096a('0x44')](function(_0x4a42ff){_0x1fa127['status'](0x1f4)['send'](_0x4a42ff);});});};exports['getQueues']=function(_0x5ddca1,_0x1a3f54,_0x3582ce){return db['Team'][_0x096a('0x6b')]({'where':{'id':_0x5ddca1[_0x096a('0x45')]['id']}})[_0x096a('0x2a')](handleEntityNotFound(_0x1a3f54,null))['then'](function(_0x25198f){if(!_0x5ddca1[_0x096a('0x35')]['channel']||!utils[_0x096a('0x6c')](_0x5ddca1['query'][_0x096a('0x6d')])){throw new db[(_0x096a('0x5b'))][(_0x096a('0x6e'))]('Unknown\x20channel');}var _0x29193a={};var _0x388c36={};_0x388c36[_0x096a('0x34')]=_[_0x096a('0x36')](db[_[_0x096a('0x6f')](_0x5ddca1['query']['channel'][_0x096a('0x70')]())+_0x096a('0x71')]['rawAttributes']);_0x388c36[_0x096a('0x35')]=_[_0x096a('0x36')](_0x5ddca1[_0x096a('0x35')]);_0x388c36[_0x096a('0x37')]=_[_0x096a('0x38')](_0x388c36[_0x096a('0x34')],_0x388c36[_0x096a('0x35')]);_0x29193a[_0x096a('0x39')]=_['intersection'](_0x388c36[_0x096a('0x34')],qs[_0x096a('0x3a')](_0x5ddca1[_0x096a('0x35')]['fields']));_0x29193a[_0x096a('0x39')]=_0x29193a[_0x096a('0x39')][_0x096a('0x46')]?_0x29193a[_0x096a('0x39')]:_0x388c36[_0x096a('0x34')];_0x29193a[_0x096a('0x24')]=qs['limit'](_0x5ddca1['query'][_0x096a('0x24')]);_0x29193a[_0x096a('0x21')]=qs['offset'](_0x5ddca1[_0x096a('0x35')]['offset']);_0x29193a[_0x096a('0x3c')]=qs[_0x096a('0x3d')](_0x5ddca1[_0x096a('0x35')][_0x096a('0x3d')]);_0x29193a['where']=qs[_0x096a('0x37')](_[_0x096a('0x72')](_0x5ddca1['query'],_0x388c36[_0x096a('0x37')]));_0x29193a=_[_0x096a('0x3f')]({},_0x29193a,_0x5ddca1['options']);return _0x25198f[_0x096a('0x4b')+_[_0x096a('0x6f')](_0x5ddca1['query']['channel'][_0x096a('0x70')]())+_0x096a('0x73')](_0x29193a);})[_0x096a('0x2a')](respondWithResult(_0x1a3f54,null))[_0x096a('0x44')](handleError(_0x1a3f54,null));};exports[_0x096a('0x74')]=function(_0x238a1a,_0x15ff9f,_0x1030f7){return db[_0x096a('0x2f')][_0x096a('0x6b')]({'where':{'id':_0x238a1a['params']['id']}})['then'](function(_0x1ca22c){if(_0x1ca22c){if(!_0x238a1a[_0x096a('0x4f')][_0x096a('0x6d')]||!utils['isValidChannel'](_0x238a1a[_0x096a('0x4f')]['channel'])){throw new db[(_0x096a('0x5b'))][(_0x096a('0x6e'))](_0x096a('0x75'));}return _0x1ca22c[_0x096a('0x76')+_[_0x096a('0x6f')](_0x238a1a[_0x096a('0x4f')][_0x096a('0x6d')]['toLowerCase']())+_0x096a('0x73')](_0x238a1a['body'][_0x096a('0x77')]);}return null;})[_0x096a('0x2a')](handleEntityNotFound(_0x15ff9f,null))['then'](respondWithStatusCode(_0x15ff9f,null))[_0x096a('0x44')](handleError(_0x15ff9f,null));};exports[_0x096a('0x78')]=function(_0x5be136,_0x265868,_0xcc5170){return db['Team'][_0x096a('0x6b')]({'where':{'id':_0x5be136[_0x096a('0x45')]['id']}})[_0x096a('0x2a')](function(_0x14c017){if(_0x14c017){if(!_0x5be136[_0x096a('0x35')]['channel']||!utils[_0x096a('0x6c')](_0x5be136[_0x096a('0x35')][_0x096a('0x6d')])){throw new db['Sequelize'][(_0x096a('0x6e'))]('Unknown\x20channel');}return _0x14c017[_0x096a('0x79')+_[_0x096a('0x6f')](_0x5be136[_0x096a('0x35')][_0x096a('0x6d')][_0x096a('0x70')]())+_0x096a('0x73')](_0x5be136[_0x096a('0x35')][_0x096a('0x77')]);}return null;})['then'](handleEntityNotFound(_0x265868,null))[_0x096a('0x2a')](respondWithStatusCode(_0x265868,null))[_0x096a('0x44')](handleError(_0x265868,null));};exports['addAgents']=function(_0x3743cc,_0x5905d0){var _0x558a34=_[_0x096a('0x7a')](_0x3743cc[_0x096a('0x4f')][_0x096a('0x77')])?_0x3743cc[_0x096a('0x4f')]['ids']:[_0x3743cc['body']['ids']];var _0x2efb3c=_0x3743cc[_0x096a('0x45')]['id'];return db[_0x096a('0x2f')][_0x096a('0x48')]({'where':{'id':_0x2efb3c}})[_0x096a('0x2a')](handleEntityNotFound(_0x5905d0,null))['then'](function(_0x15d42d){if(_0x15d42d){var _0x5dbdcd=[_0x096a('0x7b'),'Chat',_0x096a('0x7c'),_0x096a('0x7d'),'Fax',_0x096a('0x7e'),_0x096a('0x7f')];return db[_0x096a('0x50')][_0x096a('0x51')](function(_0x52eee3){var _0x3802a1=_[_0x096a('0x2e')](_0x5dbdcd,function(_0x2e7694){var _0x42f5a7={'attributes':['id',_0x096a('0x2d')]};if(_0x2e7694==='Voice'){_0x42f5a7[_0x096a('0x80')]={'attributes':['penalty']};}return _0x15d42d[_0x096a('0x4b')+_0x2e7694+'Queues'](_0x42f5a7)[_0x096a('0x2a')](function(_0xd2399a){var _0x304844=_[_0x096a('0x2e')](_0xd2399a,function(_0x4f873c){var _0x1b0890=_[_0x096a('0x2e')](_0x558a34,function(_0x16dbbc){var _0x2b6cd8={'where':{'UserId':_0x16dbbc,[_0x2e7694+_0x096a('0x81')]:_0x4f873c['id']},'transaction':_0x52eee3};if(_0x2e7694===_0x096a('0x7b')){_0x2b6cd8[_0x096a('0x19')]={'penalty':_0x4f873c['TeamVoiceQueue'][_0x096a('0x82')]};}return db['User'+_0x2e7694+_0x096a('0x71')][_0x096a('0x83')](_0x2b6cd8)[_0x096a('0x2a')](function(){socket[_0x096a('0x84')]('user'+_0x2e7694+_0x096a('0x85'),{'UserId':_0x16dbbc,[_0x2e7694+_0x096a('0x81')]:_0x4f873c['id']});if(_0x2e7694!==_0x096a('0x7b')){return;}return db[_0x096a('0x86')][_0x096a('0x87')]({'where':{'id':_0x558a34,'online':0x1},'attributes':['id',_0x096a('0x2d'),_0x096a('0x88'),_0x096a('0x89'),_0x096a('0x8a')],'raw':!![]})[_0x096a('0x2a')](function(_0x3d7282){var _0x390138=_[_0x096a('0x2e')](_0x3d7282,function(_0x47800a){return db[_0x096a('0x8b')][_0x096a('0x8c')]({'membername':_0x47800a['name'],'UserId':_0x47800a['id'],'queue_name':_0x4f873c[_0x096a('0x2d')],'VoiceQueueId':_0x4f873c['id'],'interface':_[_0x096a('0x8d')](_0x47800a[_0x096a('0x8a')])?util['format'](_0x096a('0x8e'),_0x47800a['name']):_0x47800a[_0x096a('0x8a')],'paused':_0x47800a[_0x096a('0x89')]||![],'penalty':_0x4f873c[_0x096a('0x8f')][_0x096a('0x82')]},{'transaction':_0x52eee3});});return Promise[_0x096a('0x90')](_0x390138);});});});return Promise[_0x096a('0x90')](_0x1b0890);});return Promise['all'](_0x304844);})[_0x096a('0x2a')](function(){return db[_0x096a('0x68')]['findOne']({'where':{'teamId':_0x2efb3c}})[_0x096a('0x2a')](function(_0x45497e){if(_0x45497e){var _0x112781=_[_0x096a('0x2e')](_0x558a34,function(_0x531f56){db['UserVoicePrefix'][_0x096a('0x8c')]({'UserId':_0x531f56,'VoicePrefixId':_0x45497e[_0x096a('0x69')]});});return Promise['all'](_0x112781);}});});});return Promise[_0x096a('0x90')](_0x3802a1)[_0x096a('0x2a')](function(){return _0x15d42d[_0x096a('0x91')](_0x558a34,{'transaction':_0x52eee3})[_0x096a('0x92')](function(_0x27ae84){return _0x27ae84;});});});}})[_0x096a('0x2a')](respondWithResult(_0x5905d0,null))[_0x096a('0x44')](handleError(_0x5905d0,null));};exports[_0x096a('0x93')]=function(_0x4562c3,_0x35b150){var _0x4a6dce=_['isArray'](_0x4562c3['query'][_0x096a('0x77')])?_0x4562c3['query']['ids']:[_0x4562c3[_0x096a('0x35')][_0x096a('0x77')]];var _0x25ba90=_0x4562c3['params']['id'];return db[_0x096a('0x2f')][_0x096a('0x48')]({'where':{'id':_0x25ba90}})[_0x096a('0x2a')](handleEntityNotFound(_0x35b150,null))[_0x096a('0x2a')](function(_0x3cb696){if(_0x3cb696){var _0x3b074f=['Voice',_0x096a('0x94'),'Mail',_0x096a('0x7d'),_0x096a('0x95'),'Openchannel',_0x096a('0x7f')];return db[_0x096a('0x50')][_0x096a('0x51')](function(_0x43f961){var _0x5316aa=_[_0x096a('0x2e')](_0x3b074f,function(_0x3f39cf){var _0x411607={'attributes':['id','name']};return _0x3cb696[_0x096a('0x4b')+_0x3f39cf+_0x096a('0x73')](_0x411607)[_0x096a('0x2a')](function(_0x4470c9){var _0x21a87d=_[_0x096a('0x2e')](_0x4470c9,function(_0x364532){return _0x364532[_0x096a('0x93')](_0x4a6dce,{'transaction':_0x43f961})[_0x096a('0x2a')](function(){var _0x4716a6=_['map'](_0x4a6dce,function(_0x143a97){socket[_0x096a('0x84')](_0x096a('0x4a')+_0x3f39cf+'Queue:remove',{'UserId':Number(_0x143a97),[_0x3f39cf+_0x096a('0x81')]:_0x364532['id']});if(_0x3f39cf!=='Voice'){return;}return db[_0x096a('0x8b')][_0x096a('0x59')]({'where':{'VoiceQueueId':_0x364532['id'],'UserId':_0x143a97},'transaction':_0x43f961});});return Promise[_0x096a('0x90')](_0x4716a6);});});return Promise[_0x096a('0x90')](_0x21a87d);});});return Promise[_0x096a('0x90')](_0x5316aa)[_0x096a('0x2a')](function(){return _0x3cb696[_0x096a('0x93')](_0x4a6dce,{'transaction':_0x43f961});})['then'](function(){return db[_0x096a('0x68')][_0x096a('0x6b')]({'where':{'teamId':_0x25ba90}})[_0x096a('0x2a')](function(_0x591180){if(_0x591180){var _0x20e7f3=_[_0x096a('0x2e')](_0x4a6dce,function(_0x197957){db[_0x096a('0x96')][_0x096a('0x59')]({'where':{'UserId':_0x197957,'VoicePrefixId':_0x591180[_0x096a('0x69')]}});});return Promise[_0x096a('0x90')](_0x20e7f3);}});});});}})[_0x096a('0x2a')](respondWithStatusCode(_0x35b150,null))[_0x096a('0x44')](handleError(_0x35b150,null));};exports[_0x096a('0x97')]=function(_0x85f24f,_0x26d8f4,_0x2df752){var _0x3655e8={};var _0x319832={};var _0x227ed3;var _0x12ad3e;return db[_0x096a('0x2f')]['findOne']({'where':{'id':_0x85f24f['params']['id']}})[_0x096a('0x2a')](handleEntityNotFound(_0x26d8f4,null))['then'](function(_0xdb6c94){if(_0xdb6c94){_0x227ed3=_0xdb6c94;_0x319832[_0x096a('0x34')]=_[_0x096a('0x36')](db[_0x096a('0x86')]['rawAttributes']);_0x319832[_0x096a('0x35')]=_[_0x096a('0x36')](_0x85f24f[_0x096a('0x35')]);_0x319832[_0x096a('0x37')]=_[_0x096a('0x38')](_0x319832[_0x096a('0x34')],_0x319832[_0x096a('0x35')]);_0x3655e8[_0x096a('0x39')]=_[_0x096a('0x38')](_0x319832[_0x096a('0x34')],qs[_0x096a('0x3a')](_0x85f24f[_0x096a('0x35')][_0x096a('0x3a')]));_0x3655e8[_0x096a('0x39')]=_0x3655e8[_0x096a('0x39')]['length']?_0x3655e8['attributes']:_0x319832[_0x096a('0x34')];_0x3655e8['order']=qs['sort'](_0x85f24f[_0x096a('0x35')][_0x096a('0x3d')]);_0x3655e8[_0x096a('0x3e')]=qs[_0x096a('0x37')](_[_0x096a('0x72')](_0x85f24f[_0x096a('0x35')],_0x319832[_0x096a('0x37')]));if(_0x85f24f['query'][_0x096a('0x98')]){_0x3655e8['where']=_['merge'](_0x3655e8['where'],{'$or':_[_0x096a('0x2e')](_0x3655e8['attributes'],function(_0x3dc1c9){var _0x1827ea={};_0x1827ea[_0x3dc1c9]={'$like':'%'+_0x85f24f['query'][_0x096a('0x98')]+'%'};return _0x1827ea;})});}_0x3655e8=_[_0x096a('0x3f')]({},_0x3655e8,_0x85f24f['options']);return _0x227ed3[_0x096a('0x97')](_0x3655e8);}})[_0x096a('0x2a')](function(_0x10b0cd){if(_0x10b0cd){_0x12ad3e=_0x10b0cd[_0x096a('0x46')];if(!_0x85f24f[_0x096a('0x35')][_0x096a('0x3b')](_0x096a('0x99'))){_0x3655e8['limit']=qs[_0x096a('0x24')](_0x85f24f[_0x096a('0x35')][_0x096a('0x24')]);_0x3655e8[_0x096a('0x21')]=qs[_0x096a('0x21')](_0x85f24f[_0x096a('0x35')]['offset']);}return _0x227ed3[_0x096a('0x97')](_0x3655e8);}})[_0x096a('0x2a')](function(_0xf91110){if(_0xf91110){return _0xf91110?{'count':_0x12ad3e,'rows':_0xf91110}:null;}})[_0x096a('0x2a')](respondWithResult(_0x26d8f4,null))['catch'](handleError(_0x26d8f4,null));}; \ No newline at end of file +var _0x4a19=['Content-Range','reject','save','then','sendStatus','error','stack','name','map','Team','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','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','WhatsappQueueId','UserVoicePrefix','send','getQueues','findOne','params','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','Queues','addQueues','add','capitalize','ids','removeQueues','remove','addAgents','Voice','Mail','Fax','Openchannel','Whatsapp','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','voicePause','interface','UserVoiceQueueRt','upsert','all','TeamVoicePrefix','removeAgents','isArray','Chat','Sms','VoicePrefixId','getAgents','hasOwnProperty','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','end','json','undefined','limit','count','offset'];(function(_0x2fdcb6,_0x6ec036){var _0xb64b81=function(_0x5c3518){while(--_0x5c3518){_0x2fdcb6['push'](_0x2fdcb6['shift']());}};_0xb64b81(++_0x6ec036);}(_0x4a19,0x73));var _0x94a1=function(_0x4c5a28,_0x3ec281){_0x4c5a28=_0x4c5a28-0x0;var _0x1a6a7b=_0x4a19[_0x4c5a28];return _0x1a6a7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94a1('0x0'));var zipdir=require(_0x94a1('0x1'));var jsonpatch=require(_0x94a1('0x2'));var rp=require(_0x94a1('0x3'));var moment=require(_0x94a1('0x4'));var BPromise=require(_0x94a1('0x5'));var Mustache=require(_0x94a1('0x6'));var util=require('util');var path=require(_0x94a1('0x7'));var sox=require('sox');var csv=require(_0x94a1('0x8'));var ejs=require(_0x94a1('0x9'));var fs=require('fs');var fs_extra=require(_0x94a1('0xa'));var _=require(_0x94a1('0xb'));var squel=require(_0x94a1('0xc'));var crypto=require(_0x94a1('0xd'));var jsforce=require(_0x94a1('0xe'));var deskjs=require(_0x94a1('0xf'));var toCsv=require(_0x94a1('0x8'));var querystring=require('querystring');var Papa=require(_0x94a1('0x10'));var Redis=require(_0x94a1('0x11'));var authService=require(_0x94a1('0x12'));var qs=require(_0x94a1('0x13'));var as=require(_0x94a1('0x14'));var hardwareService=require(_0x94a1('0x15'));var logger=require(_0x94a1('0x16'))('api');var utils=require(_0x94a1('0x17'));var config=require(_0x94a1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x94a1('0x19'))['db'];config['redis']=_[_0x94a1('0x1a')](config['redis'],{'host':_0x94a1('0x1b'),'port':0x18eb});var socket=require(_0x94a1('0x1c'))(new Redis(config[_0x94a1('0x1d')]));require('./team.socket')[_0x94a1('0x1e')](socket);function respondWithStatusCode(_0x1b4d9e,_0xbca8ce){_0xbca8ce=_0xbca8ce||0xcc;return function(_0xb9e3cc){if(_0xb9e3cc){return _0x1b4d9e['sendStatus'](_0xbca8ce);}return _0x1b4d9e[_0x94a1('0x1f')](_0xbca8ce)[_0x94a1('0x20')]();};}function respondWithResult(_0x5eb247,_0x18eeb7){_0x18eeb7=_0x18eeb7||0xc8;return function(_0x1cea43){if(_0x1cea43){return _0x5eb247[_0x94a1('0x1f')](_0x18eeb7)[_0x94a1('0x21')](_0x1cea43);}};}function respondWithFilteredResult(_0xda7e38,_0x6d07c5){return function(_0x23183d){if(_0x23183d){var _0x5499d2=typeof _0x6d07c5['offset']===_0x94a1('0x22')&&typeof _0x6d07c5[_0x94a1('0x23')]===_0x94a1('0x22');var _0x28fa84=_0x23183d['count'];var _0x3e7b0c=_0x5499d2?0x0:_0x6d07c5['offset'];var _0x153aca=_0x5499d2?_0x23183d[_0x94a1('0x24')]:_0x6d07c5[_0x94a1('0x25')]+_0x6d07c5[_0x94a1('0x23')];var _0x958e4d;if(_0x153aca>=_0x28fa84){_0x153aca=_0x28fa84;_0x958e4d=0xc8;}else{_0x958e4d=0xce;}_0xda7e38[_0x94a1('0x1f')](_0x958e4d);return _0xda7e38['set'](_0x94a1('0x26'),_0x3e7b0c+'-'+_0x153aca+'/'+_0x28fa84)[_0x94a1('0x21')](_0x23183d);}return null;};}function patchUpdates(_0x4d2d64){return function(_0x50de45){try{jsonpatch['apply'](_0x50de45,_0x4d2d64,!![]);}catch(_0x25e25d){return BPromise[_0x94a1('0x27')](_0x25e25d);}return _0x50de45[_0x94a1('0x28')]();};}function saveUpdates(_0x588d1e,_0x4f38a7){return function(_0x4e9383){if(_0x4e9383){return _0x4e9383['update'](_0x588d1e)[_0x94a1('0x29')](function(_0x316283){return _0x316283;});}return null;};}function handleEntityNotFound(_0x5b4a3b,_0x4a33bb){return function(_0x48c757){if(!_0x48c757){_0x5b4a3b[_0x94a1('0x2a')](0x194);}return _0x48c757;};}function handleError(_0x3e487b,_0x13a9cc){_0x13a9cc=_0x13a9cc||0x1f4;return function(_0x3f9352){logger[_0x94a1('0x2b')](_0x3f9352[_0x94a1('0x2c')]);if(_0x3f9352[_0x94a1('0x2d')]){delete _0x3f9352[_0x94a1('0x2d')];}_0x3e487b[_0x94a1('0x1f')](_0x13a9cc)['send'](_0x3f9352);};}exports['index']=function(_0x3dfb61,_0x3e1137){var _0x7ab18c={},_0x4280a3={},_0x3f6fb5={'count':0x0,'rows':[]};var _0x2530d0=_[_0x94a1('0x2e')](db[_0x94a1('0x2f')]['rawAttributes'],function(_0x411209){return{'name':_0x411209[_0x94a1('0x30')],'type':_0x411209[_0x94a1('0x31')][_0x94a1('0x32')]};});_0x4280a3[_0x94a1('0x33')]=_[_0x94a1('0x2e')](_0x2530d0,'name');_0x4280a3[_0x94a1('0x34')]=_[_0x94a1('0x35')](_0x3dfb61['query']);_0x4280a3[_0x94a1('0x36')]=_[_0x94a1('0x37')](_0x4280a3['model'],_0x4280a3[_0x94a1('0x34')]);_0x7ab18c[_0x94a1('0x38')]=_[_0x94a1('0x37')](_0x4280a3[_0x94a1('0x33')],qs[_0x94a1('0x39')](_0x3dfb61[_0x94a1('0x34')][_0x94a1('0x39')]));_0x7ab18c[_0x94a1('0x38')]=_0x7ab18c[_0x94a1('0x38')][_0x94a1('0x3a')]?_0x7ab18c[_0x94a1('0x38')]:_0x4280a3[_0x94a1('0x33')];if(!_0x3dfb61[_0x94a1('0x34')]['hasOwnProperty']('nolimit')){_0x7ab18c[_0x94a1('0x23')]=qs[_0x94a1('0x23')](_0x3dfb61[_0x94a1('0x34')][_0x94a1('0x23')]);_0x7ab18c['offset']=qs[_0x94a1('0x25')](_0x3dfb61[_0x94a1('0x34')][_0x94a1('0x25')]);}_0x7ab18c[_0x94a1('0x3b')]=qs[_0x94a1('0x3c')](_0x3dfb61[_0x94a1('0x34')][_0x94a1('0x3c')]);_0x7ab18c['where']=qs[_0x94a1('0x36')](_[_0x94a1('0x3d')](_0x3dfb61['query'],_0x4280a3[_0x94a1('0x36')]),_0x2530d0);if(_0x3dfb61['query'][_0x94a1('0x3e')]){_0x7ab18c[_0x94a1('0x3f')]=_[_0x94a1('0x40')](_0x7ab18c[_0x94a1('0x3f')],{'$or':_[_0x94a1('0x2e')](_0x2530d0,function(_0x5e9192){if(_0x5e9192[_0x94a1('0x31')]!==_0x94a1('0x41')){var _0x52e981={};_0x52e981[_0x5e9192['name']]={'$like':'%'+_0x3dfb61[_0x94a1('0x34')][_0x94a1('0x3e')]+'%'};return _0x52e981;}})});}_0x7ab18c=_['merge']({},_0x7ab18c,_0x3dfb61[_0x94a1('0x42')]);var _0x5d0294={'where':_0x7ab18c[_0x94a1('0x3f')]};return db[_0x94a1('0x2f')][_0x94a1('0x24')](_0x5d0294)[_0x94a1('0x29')](function(_0x5aafbc){_0x3f6fb5[_0x94a1('0x24')]=_0x5aafbc;if(_0x3dfb61[_0x94a1('0x34')][_0x94a1('0x43')]){_0x7ab18c[_0x94a1('0x44')]=[{'all':!![]}];}return db[_0x94a1('0x2f')][_0x94a1('0x45')](_0x7ab18c);})['then'](function(_0x383109){_0x3f6fb5['rows']=_0x383109;return _0x3f6fb5;})[_0x94a1('0x29')](respondWithFilteredResult(_0x3e1137,_0x7ab18c))[_0x94a1('0x46')](handleError(_0x3e1137,null));};exports['show']=function(_0x1f28c9,_0x3e0ded){var _0x45d33e={'raw':![],'where':{'id':_0x1f28c9['params']['id']}},_0x437d45={};_0x437d45['model']=_[_0x94a1('0x35')](db['Team'][_0x94a1('0x47')]);_0x437d45[_0x94a1('0x34')]=_[_0x94a1('0x35')](_0x1f28c9['query']);_0x437d45[_0x94a1('0x36')]=_['intersection'](_0x437d45[_0x94a1('0x33')],_0x437d45[_0x94a1('0x34')]);_0x45d33e['attributes']=_[_0x94a1('0x37')](_0x437d45['model'],qs[_0x94a1('0x39')](_0x1f28c9[_0x94a1('0x34')][_0x94a1('0x39')]));_0x45d33e[_0x94a1('0x38')]=_0x45d33e['attributes']['length']?_0x45d33e[_0x94a1('0x38')]:_0x437d45[_0x94a1('0x33')];if(_0x1f28c9['query'][_0x94a1('0x43')]){_0x45d33e['include']=[{'all':!![]}];}_0x45d33e=_[_0x94a1('0x40')]({},_0x45d33e,_0x1f28c9[_0x94a1('0x42')]);return db['Team'][_0x94a1('0x48')](_0x45d33e)[_0x94a1('0x29')](handleEntityNotFound(_0x3e0ded,null))[_0x94a1('0x29')](respondWithResult(_0x3e0ded,null))['catch'](handleError(_0x3e0ded,null));};exports[_0x94a1('0x49')]=function(_0x205920,_0x2c923e){return db[_0x94a1('0x2f')]['create'](_0x205920[_0x94a1('0x4a')],{})[_0x94a1('0x29')](function(_0x2661bc){var _0x4c32fd=_0x205920[_0x94a1('0x4b')][_0x94a1('0x4c')]({'plain':!![]});if(!_0x4c32fd)throw new Error(_0x94a1('0x4d'));if(_0x4c32fd[_0x94a1('0x4e')]==='user'){var _0x233413=_0x2661bc[_0x94a1('0x4c')]({'plain':!![]});var _0x4addd8=_0x94a1('0x4f');return db[_0x94a1('0x50')][_0x94a1('0x48')]({'where':{'name':_0x4addd8,'userProfileId':_0x4c32fd[_0x94a1('0x51')]},'raw':!![]})[_0x94a1('0x29')](function(_0x5143ac){if(_0x5143ac&&_0x5143ac['autoAssociation']===0x0){return db[_0x94a1('0x52')][_0x94a1('0x49')]({'name':_0x233413[_0x94a1('0x2d')],'resourceId':_0x233413['id'],'type':_0x5143ac[_0x94a1('0x2d')],'sectionId':_0x5143ac['id']},{})[_0x94a1('0x29')](function(){return _0x2661bc;});}else{return _0x2661bc;}})[_0x94a1('0x46')](function(_0x55c891){logger[_0x94a1('0x2b')](_0x94a1('0x53'),_0x55c891);throw _0x55c891;});}return _0x2661bc;})[_0x94a1('0x29')](respondWithResult(_0x2c923e,0xc9))[_0x94a1('0x46')](handleError(_0x2c923e,null));};exports[_0x94a1('0x54')]=function(_0x58da36,_0x9b26d){if(_0x58da36[_0x94a1('0x4a')]['id']){delete _0x58da36[_0x94a1('0x4a')]['id'];}return db[_0x94a1('0x2f')][_0x94a1('0x48')]({'where':{'id':_0x58da36['params']['id']}})[_0x94a1('0x29')](handleEntityNotFound(_0x9b26d,null))[_0x94a1('0x29')](saveUpdates(_0x58da36[_0x94a1('0x4a')],null))[_0x94a1('0x29')](respondWithResult(_0x9b26d,null))[_0x94a1('0x46')](handleError(_0x9b26d,null));};exports[_0x94a1('0x55')]=function(_0x5715db,_0x3dc82b){var _0x557b6e=_0x5715db['params']['id'];var _0xb47a2d=[];return db[_0x94a1('0x56')]['transaction'](function(_0x448beb){var _0xaea4dd=_0x94a1('0x57')+_0x557b6e;return db[_0x94a1('0x56')][_0x94a1('0x34')](_0xaea4dd,{'type':db[_0x94a1('0x58')][_0x94a1('0x59')][_0x94a1('0x5a')],'raw':!![],'transaction':_0x448beb})[_0x94a1('0x29')](function(_0x6058a4){_0xb47a2d=_[_0x94a1('0x2e')](_0x6058a4,function(_0x47ecc9){return Number(_0x47ecc9[_0x94a1('0x5b')]);});})[_0x94a1('0x29')](function(){var _0x3efe1c='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x557b6e;return db[_0x94a1('0x56')][_0x94a1('0x34')](_0x3efe1c,{'type':db[_0x94a1('0x58')][_0x94a1('0x59')]['SELECT'],'raw':!![],'transaction':_0x448beb});})[_0x94a1('0x29')](function(_0x58ed57){var _0x59544f=_[_0x94a1('0x2e')](_0x58ed57,function(_0xc10783){return Number(_0xc10783[_0x94a1('0x5c')]);});return db[_0x94a1('0x5d')]['destroy']({'where':{'UserId':{'$in':_0xb47a2d},'VoiceQueueId':{'$in':_0x59544f}},'transaction':_0x448beb});})[_0x94a1('0x29')](function(){var _0x283de7=_0x94a1('0x5e')+_0x557b6e;return db[_0x94a1('0x56')][_0x94a1('0x34')](_0x283de7,{'type':db['Sequelize'][_0x94a1('0x59')][_0x94a1('0x5a')],'raw':!![],'transaction':_0x448beb});})[_0x94a1('0x29')](function(_0x2816b9){var _0x452ad6=_[_0x94a1('0x2e')](_0x2816b9,function(_0xf517e1){return Number(_0xf517e1['MailQueueId']);});return db[_0x94a1('0x5f')][_0x94a1('0x55')]({'where':{'UserId':{'$in':_0xb47a2d},'MailQueueId':{'$in':_0x452ad6}},'transaction':_0x448beb});})[_0x94a1('0x29')](function(){var _0x241548='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x557b6e;return db[_0x94a1('0x56')][_0x94a1('0x34')](_0x241548,{'type':db[_0x94a1('0x58')][_0x94a1('0x59')][_0x94a1('0x5a')],'raw':!![],'transaction':_0x448beb});})['then'](function(_0x16c1e6){var _0x41a41e=_[_0x94a1('0x2e')](_0x16c1e6,function(_0x26dfca){return Number(_0x26dfca[_0x94a1('0x60')]);});return db[_0x94a1('0x61')][_0x94a1('0x55')]({'where':{'UserId':{'$in':_0xb47a2d},'SmsQueueId':{'$in':_0x41a41e}},'transaction':_0x448beb});})[_0x94a1('0x29')](function(){var _0xeb85b2=_0x94a1('0x62')+_0x557b6e;return db[_0x94a1('0x56')][_0x94a1('0x34')](_0xeb85b2,{'type':db[_0x94a1('0x58')][_0x94a1('0x59')]['SELECT'],'raw':!![],'transaction':_0x448beb});})[_0x94a1('0x29')](function(_0x56e0e7){var _0x2d3fe5=_['map'](_0x56e0e7,function(_0x43db40){return Number(_0x43db40[_0x94a1('0x63')]);});return db[_0x94a1('0x64')][_0x94a1('0x55')]({'where':{'UserId':{'$in':_0xb47a2d},'ChatQueueId':{'$in':_0x2d3fe5}},'transaction':_0x448beb});})[_0x94a1('0x29')](function(){var _0xcc353d=_0x94a1('0x65')+_0x557b6e;return db['sequelize'][_0x94a1('0x34')](_0xcc353d,{'type':db[_0x94a1('0x58')][_0x94a1('0x59')]['SELECT'],'raw':!![],'transaction':_0x448beb});})['then'](function(_0x27b09f){var _0xd754ab=_[_0x94a1('0x2e')](_0x27b09f,function(_0xb5116d){return Number(_0xb5116d['FaxQueueId']);});return db[_0x94a1('0x66')][_0x94a1('0x55')]({'where':{'UserId':{'$in':_0xb47a2d},'FaxQueueId':{'$in':_0xd754ab}},'transaction':_0x448beb});})['then'](function(){var _0x379b8b=_0x94a1('0x67')+_0x557b6e;return db[_0x94a1('0x56')]['query'](_0x379b8b,{'type':db[_0x94a1('0x58')][_0x94a1('0x59')][_0x94a1('0x5a')],'raw':!![],'transaction':_0x448beb});})['then'](function(_0x1e8d47){var _0x32c98a=_[_0x94a1('0x2e')](_0x1e8d47,function(_0x3cc152){return Number(_0x3cc152[_0x94a1('0x68')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0xb47a2d},'OpenchannelQueueId':{'$in':_0x32c98a}},'transaction':_0x448beb});})['then'](function(){var _0x291562='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x557b6e;return db[_0x94a1('0x56')][_0x94a1('0x34')](_0x291562,{'type':db['Sequelize'][_0x94a1('0x59')][_0x94a1('0x5a')],'raw':!![],'transaction':_0x448beb});})['then'](function(_0x1169f3){var _0x22648d=_['map'](_0x1169f3,function(_0x5ca804){return Number(_0x5ca804[_0x94a1('0x69')]);});return db['UserWhatsappQueue'][_0x94a1('0x55')]({'where':{'UserId':{'$in':_0xb47a2d},'WhatsappQueueId':{'$in':_0x22648d}},'transaction':_0x448beb});})[_0x94a1('0x29')](function(){return db['TeamVoicePrefix'][_0x94a1('0x48')]({'where':{'TeamId':_0x557b6e}});})[_0x94a1('0x29')](function(_0x58d49e){if(_0x58d49e===null){return;}return db[_0x94a1('0x6a')][_0x94a1('0x55')]({'where':{'UserId':{'$in':_0xb47a2d},'VoicePrefixId':_0x58d49e['VoicePrefixId']},'transaction':_0x448beb});})['then'](function(){return db[_0x94a1('0x2f')][_0x94a1('0x55')]({'where':{'id':_0x557b6e},'cascade':!![],'transaction':_0x448beb});})[_0x94a1('0x29')](function(_0x33d863){if(_0x33d863===0x0){_0x3dc82b[_0x94a1('0x2a')](0x194);}else{return db['UserProfileResource'][_0x94a1('0x55')]({'where':{'type':_0x94a1('0x4f'),'resourceId':_0x557b6e},'cascade':!![],'transaction':_0x448beb})['then'](function(){_0x3dc82b[_0x94a1('0x1f')](0xcc)[_0x94a1('0x20')]();});}})[_0x94a1('0x46')](function(_0x2305a4){_0x3dc82b[_0x94a1('0x1f')](0x1f4)[_0x94a1('0x6b')](_0x2305a4);});});};exports[_0x94a1('0x6c')]=function(_0x44eb72,_0x2a30b8,_0x5b12f5){return db[_0x94a1('0x2f')][_0x94a1('0x6d')]({'where':{'id':_0x44eb72[_0x94a1('0x6e')]['id']}})[_0x94a1('0x29')](handleEntityNotFound(_0x2a30b8,null))[_0x94a1('0x29')](function(_0x362c2e){if(!_0x44eb72[_0x94a1('0x34')][_0x94a1('0x6f')]||!utils[_0x94a1('0x70')](_0x44eb72[_0x94a1('0x34')][_0x94a1('0x6f')])){throw new db[(_0x94a1('0x58'))][(_0x94a1('0x71'))](_0x94a1('0x72'));}var _0x5f3e74={};var _0x36ba99={};_0x36ba99[_0x94a1('0x33')]=_['keys'](db[_['capitalize'](_0x44eb72[_0x94a1('0x34')][_0x94a1('0x6f')][_0x94a1('0x73')]())+_0x94a1('0x74')]['rawAttributes']);_0x36ba99['query']=_['keys'](_0x44eb72[_0x94a1('0x34')]);_0x36ba99[_0x94a1('0x36')]=_[_0x94a1('0x37')](_0x36ba99[_0x94a1('0x33')],_0x36ba99[_0x94a1('0x34')]);_0x5f3e74[_0x94a1('0x38')]=_['intersection'](_0x36ba99['model'],qs[_0x94a1('0x39')](_0x44eb72['query'][_0x94a1('0x39')]));_0x5f3e74[_0x94a1('0x38')]=_0x5f3e74['attributes'][_0x94a1('0x3a')]?_0x5f3e74[_0x94a1('0x38')]:_0x36ba99['model'];_0x5f3e74[_0x94a1('0x23')]=qs[_0x94a1('0x23')](_0x44eb72['query'][_0x94a1('0x23')]);_0x5f3e74[_0x94a1('0x25')]=qs[_0x94a1('0x25')](_0x44eb72[_0x94a1('0x34')][_0x94a1('0x25')]);_0x5f3e74[_0x94a1('0x3b')]=qs[_0x94a1('0x3c')](_0x44eb72[_0x94a1('0x34')][_0x94a1('0x3c')]);_0x5f3e74[_0x94a1('0x3f')]=qs[_0x94a1('0x36')](_[_0x94a1('0x3d')](_0x44eb72[_0x94a1('0x34')],_0x36ba99[_0x94a1('0x36')]));_0x5f3e74=_[_0x94a1('0x40')]({},_0x5f3e74,_0x44eb72[_0x94a1('0x42')]);return _0x362c2e[_0x94a1('0x4c')+_['capitalize'](_0x44eb72[_0x94a1('0x34')]['channel']['toLowerCase']())+_0x94a1('0x75')](_0x5f3e74);})[_0x94a1('0x29')](respondWithResult(_0x2a30b8,null))[_0x94a1('0x46')](handleError(_0x2a30b8,null));};exports[_0x94a1('0x76')]=function(_0x1c28aa,_0x4ae556,_0x526b7d){return db[_0x94a1('0x2f')][_0x94a1('0x6d')]({'where':{'id':_0x1c28aa[_0x94a1('0x6e')]['id']}})['then'](function(_0x283586){if(_0x283586){if(!_0x1c28aa['body'][_0x94a1('0x6f')]||!utils[_0x94a1('0x70')](_0x1c28aa[_0x94a1('0x4a')][_0x94a1('0x6f')])){throw new db[(_0x94a1('0x58'))][(_0x94a1('0x71'))](_0x94a1('0x72'));}return _0x283586[_0x94a1('0x77')+_[_0x94a1('0x78')](_0x1c28aa['body'][_0x94a1('0x6f')][_0x94a1('0x73')]())+_0x94a1('0x75')](_0x1c28aa[_0x94a1('0x4a')][_0x94a1('0x79')]);}return null;})[_0x94a1('0x29')](handleEntityNotFound(_0x4ae556,null))[_0x94a1('0x29')](respondWithStatusCode(_0x4ae556,null))[_0x94a1('0x46')](handleError(_0x4ae556,null));};exports[_0x94a1('0x7a')]=function(_0x5c78ec,_0xefa9c7,_0x402dbd){return db['Team'][_0x94a1('0x6d')]({'where':{'id':_0x5c78ec['params']['id']}})[_0x94a1('0x29')](function(_0x369570){if(_0x369570){if(!_0x5c78ec[_0x94a1('0x34')][_0x94a1('0x6f')]||!utils['isValidChannel'](_0x5c78ec[_0x94a1('0x34')][_0x94a1('0x6f')])){throw new db[(_0x94a1('0x58'))][(_0x94a1('0x71'))](_0x94a1('0x72'));}return _0x369570[_0x94a1('0x7b')+_['capitalize'](_0x5c78ec[_0x94a1('0x34')]['channel'][_0x94a1('0x73')]())+'Queues'](_0x5c78ec['query'][_0x94a1('0x79')]);}return null;})[_0x94a1('0x29')](handleEntityNotFound(_0xefa9c7,null))['then'](respondWithStatusCode(_0xefa9c7,null))[_0x94a1('0x46')](handleError(_0xefa9c7,null));};exports[_0x94a1('0x7c')]=function(_0x403f8c,_0x4a15b3){var _0x5a60c5=_['isArray'](_0x403f8c[_0x94a1('0x4a')][_0x94a1('0x79')])?_0x403f8c[_0x94a1('0x4a')][_0x94a1('0x79')]:[_0x403f8c[_0x94a1('0x4a')][_0x94a1('0x79')]];var _0x1db47c=_0x403f8c[_0x94a1('0x6e')]['id'];return db[_0x94a1('0x2f')][_0x94a1('0x48')]({'where':{'id':_0x1db47c}})[_0x94a1('0x29')](handleEntityNotFound(_0x4a15b3,null))[_0x94a1('0x29')](function(_0x51c90d){if(_0x51c90d){var _0x369fb7=[_0x94a1('0x7d'),'Chat',_0x94a1('0x7e'),'Sms',_0x94a1('0x7f'),_0x94a1('0x80'),_0x94a1('0x81')];return db['sequelize'][_0x94a1('0x82')](function(_0x184035){var _0x37e665=_['map'](_0x369fb7,function(_0x536046){var _0x82f4b0={'attributes':['id',_0x94a1('0x2d')]};if(_0x536046===_0x94a1('0x7d')){_0x82f4b0[_0x94a1('0x83')]={'attributes':['penalty']};}return _0x51c90d[_0x94a1('0x4c')+_0x536046+_0x94a1('0x75')](_0x82f4b0)[_0x94a1('0x29')](function(_0x39f97c){var _0x4c8361=_[_0x94a1('0x2e')](_0x39f97c,function(_0x9c2655){var _0x2bcd1e=_[_0x94a1('0x2e')](_0x5a60c5,function(_0x4cc825){var _0x4d9666={'where':{'UserId':_0x4cc825,[_0x536046+_0x94a1('0x84')]:_0x9c2655['id']},'transaction':_0x184035};if(_0x536046===_0x94a1('0x7d')){_0x4d9666[_0x94a1('0x1a')]={'penalty':_0x9c2655[_0x94a1('0x85')][_0x94a1('0x86')]};}return db[_0x94a1('0x87')+_0x536046+_0x94a1('0x74')][_0x94a1('0x88')](_0x4d9666)[_0x94a1('0x29')](function(){socket[_0x94a1('0x89')]('user'+_0x536046+_0x94a1('0x8a'),{'UserId':_0x4cc825,[_0x536046+_0x94a1('0x84')]:_0x9c2655['id']});if(_0x536046!==_0x94a1('0x7d')){return;}return db[_0x94a1('0x87')][_0x94a1('0x45')]({'where':{'id':_0x5a60c5,'online':0x1},'attributes':['id',_0x94a1('0x2d'),'online',_0x94a1('0x8b'),_0x94a1('0x8c')],'raw':!![]})[_0x94a1('0x29')](function(_0x5bc7b3){var _0x264cf8=_['map'](_0x5bc7b3,function(_0x361498){return db[_0x94a1('0x8d')][_0x94a1('0x8e')]({'membername':_0x361498['name'],'UserId':_0x361498['id'],'queue_name':_0x9c2655[_0x94a1('0x2d')],'VoiceQueueId':_0x9c2655['id'],'interface':_['isNil'](_0x361498[_0x94a1('0x8c')])?util['format']('SIP/%s',_0x361498['name']):_0x361498[_0x94a1('0x8c')],'paused':_0x361498['voicePause']||![],'penalty':_0x9c2655[_0x94a1('0x85')][_0x94a1('0x86')]},{'transaction':_0x184035});});return Promise[_0x94a1('0x8f')](_0x264cf8);});});});return Promise[_0x94a1('0x8f')](_0x2bcd1e);});return Promise[_0x94a1('0x8f')](_0x4c8361);})['then'](function(){return db[_0x94a1('0x90')][_0x94a1('0x6d')]({'where':{'teamId':_0x1db47c}})[_0x94a1('0x29')](function(_0x3a2001){if(_0x3a2001){var _0x589b81=_[_0x94a1('0x2e')](_0x5a60c5,function(_0x2ae74d){db['UserVoicePrefix']['upsert']({'UserId':_0x2ae74d,'VoicePrefixId':_0x3a2001['VoicePrefixId']});});return Promise[_0x94a1('0x8f')](_0x589b81);}});});});return Promise['all'](_0x37e665)[_0x94a1('0x29')](function(){return _0x51c90d[_0x94a1('0x7c')](_0x5a60c5,{'transaction':_0x184035})['spread'](function(_0x46bc91){return _0x46bc91;});});});}})[_0x94a1('0x29')](respondWithResult(_0x4a15b3,null))[_0x94a1('0x46')](handleError(_0x4a15b3,null));};exports[_0x94a1('0x91')]=function(_0x3c4355,_0x2afd1b){var _0x50b566=_[_0x94a1('0x92')](_0x3c4355[_0x94a1('0x34')]['ids'])?_0x3c4355[_0x94a1('0x34')][_0x94a1('0x79')]:[_0x3c4355[_0x94a1('0x34')]['ids']];var _0x494438=_0x3c4355[_0x94a1('0x6e')]['id'];return db[_0x94a1('0x2f')][_0x94a1('0x48')]({'where':{'id':_0x494438}})['then'](handleEntityNotFound(_0x2afd1b,null))[_0x94a1('0x29')](function(_0x45a3c6){if(_0x45a3c6){var _0x36fa43=[_0x94a1('0x7d'),_0x94a1('0x93'),_0x94a1('0x7e'),_0x94a1('0x94'),_0x94a1('0x7f'),_0x94a1('0x80'),'Whatsapp'];return db[_0x94a1('0x56')][_0x94a1('0x82')](function(_0xf05846){var _0xebb606=_['map'](_0x36fa43,function(_0xf53803){var _0x20f907={'attributes':['id','name']};return _0x45a3c6[_0x94a1('0x4c')+_0xf53803+_0x94a1('0x75')](_0x20f907)[_0x94a1('0x29')](function(_0x23828b){var _0x107a1e=_[_0x94a1('0x2e')](_0x23828b,function(_0x43d745){return _0x43d745['removeAgents'](_0x50b566,{'transaction':_0xf05846})[_0x94a1('0x29')](function(){var _0x1b257a=_[_0x94a1('0x2e')](_0x50b566,function(_0x758960){socket[_0x94a1('0x89')](_0x94a1('0x4b')+_0xf53803+'Queue:remove',{'UserId':Number(_0x758960),[_0xf53803+_0x94a1('0x84')]:_0x43d745['id']});if(_0xf53803!==_0x94a1('0x7d')){return;}return db[_0x94a1('0x8d')][_0x94a1('0x55')]({'where':{'VoiceQueueId':_0x43d745['id'],'UserId':_0x758960},'transaction':_0xf05846});});return Promise[_0x94a1('0x8f')](_0x1b257a);});});return Promise[_0x94a1('0x8f')](_0x107a1e);});});return Promise[_0x94a1('0x8f')](_0xebb606)[_0x94a1('0x29')](function(){return _0x45a3c6[_0x94a1('0x91')](_0x50b566,{'transaction':_0xf05846});})['then'](function(){return db[_0x94a1('0x90')]['findOne']({'where':{'teamId':_0x494438}})[_0x94a1('0x29')](function(_0x310462){if(_0x310462){var _0x3a3f1c=_[_0x94a1('0x2e')](_0x50b566,function(_0xe8e64b){db['UserVoicePrefix'][_0x94a1('0x55')]({'where':{'UserId':_0xe8e64b,'VoicePrefixId':_0x310462[_0x94a1('0x95')]}});});return Promise['all'](_0x3a3f1c);}});});});}})[_0x94a1('0x29')](respondWithStatusCode(_0x2afd1b,null))['catch'](handleError(_0x2afd1b,null));};exports['getAgents']=function(_0x124e37,_0x5bd254,_0x15c186){var _0x339ef0={};var _0x5a4e76={};var _0x472130;var _0x5173bd;return db[_0x94a1('0x2f')][_0x94a1('0x6d')]({'where':{'id':_0x124e37[_0x94a1('0x6e')]['id']}})[_0x94a1('0x29')](handleEntityNotFound(_0x5bd254,null))[_0x94a1('0x29')](function(_0x4db4a2){if(_0x4db4a2){_0x472130=_0x4db4a2;_0x5a4e76['model']=_[_0x94a1('0x35')](db[_0x94a1('0x87')][_0x94a1('0x47')]);_0x5a4e76['query']=_[_0x94a1('0x35')](_0x124e37[_0x94a1('0x34')]);_0x5a4e76['filters']=_[_0x94a1('0x37')](_0x5a4e76[_0x94a1('0x33')],_0x5a4e76[_0x94a1('0x34')]);_0x339ef0['attributes']=_[_0x94a1('0x37')](_0x5a4e76[_0x94a1('0x33')],qs[_0x94a1('0x39')](_0x124e37[_0x94a1('0x34')][_0x94a1('0x39')]));_0x339ef0[_0x94a1('0x38')]=_0x339ef0[_0x94a1('0x38')][_0x94a1('0x3a')]?_0x339ef0['attributes']:_0x5a4e76[_0x94a1('0x33')];_0x339ef0['order']=qs['sort'](_0x124e37[_0x94a1('0x34')][_0x94a1('0x3c')]);_0x339ef0[_0x94a1('0x3f')]=qs[_0x94a1('0x36')](_[_0x94a1('0x3d')](_0x124e37[_0x94a1('0x34')],_0x5a4e76[_0x94a1('0x36')]));if(_0x124e37['query']['filter']){_0x339ef0[_0x94a1('0x3f')]=_[_0x94a1('0x40')](_0x339ef0[_0x94a1('0x3f')],{'$or':_[_0x94a1('0x2e')](_0x339ef0[_0x94a1('0x38')],function(_0x24d47a){var _0xc48a91={};_0xc48a91[_0x24d47a]={'$like':'%'+_0x124e37['query']['filter']+'%'};return _0xc48a91;})});}_0x339ef0=_['merge']({},_0x339ef0,_0x124e37[_0x94a1('0x42')]);return _0x472130[_0x94a1('0x96')](_0x339ef0);}})['then'](function(_0x5281b6){if(_0x5281b6){_0x5173bd=_0x5281b6[_0x94a1('0x3a')];if(!_0x124e37[_0x94a1('0x34')][_0x94a1('0x97')](_0x94a1('0x98'))){_0x339ef0[_0x94a1('0x23')]=qs[_0x94a1('0x23')](_0x124e37[_0x94a1('0x34')][_0x94a1('0x23')]);_0x339ef0[_0x94a1('0x25')]=qs['offset'](_0x124e37[_0x94a1('0x34')]['offset']);}return _0x472130[_0x94a1('0x96')](_0x339ef0);}})[_0x94a1('0x29')](function(_0x5c9cae){if(_0x5c9cae){return _0x5c9cae?{'count':_0x5173bd,'rows':_0x5c9cae}:null;}})[_0x94a1('0x29')](respondWithResult(_0x5bd254,null))[_0x94a1('0x46')](handleError(_0x5bd254,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index c8bc8b7..99765dc 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 _0xa302=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0xa302,0x97));var _0x2a30=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xa302[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require(_0x2a30('0x0'));var Team=require(_0x2a30('0x1'))['db'][_0x2a30('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x2a30('0x3')](0x0);var events={'afterCreate':_0x2a30('0x4'),'afterUpdate':_0x2a30('0x5'),'afterDestroy':_0x2a30('0x6')};function emitEvent(_0x198f7b){return function(_0x2628ec,_0x4dabc5,_0x230500){TeamEvents[_0x2a30('0x7')](_0x198f7b+':'+_0x2628ec['id'],_0x2628ec);TeamEvents[_0x2a30('0x7')](_0x198f7b,_0x2628ec);_0x230500(null);};}for(var e in events){if(events[_0x2a30('0x8')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x2a30('0x9')]=TeamEvents; \ No newline at end of file +var _0x0a0e=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x236616,_0x14c9b8){var _0x530f3a=function(_0x4de5de){while(--_0x4de5de){_0x236616['push'](_0x236616['shift']());}};_0x530f3a(++_0x14c9b8);}(_0x0a0e,0x1e4));var _0xe0a0=function(_0x3a4b6c,_0x3b8490){_0x3a4b6c=_0x3a4b6c-0x0;var _0x59b956=_0x0a0e[_0x3a4b6c];return _0x59b956;};'use strict';var EventEmitter=require(_0xe0a0('0x0'));var Team=require(_0xe0a0('0x1'))['db'][_0xe0a0('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe0a0('0x3')](0x0);var events={'afterCreate':_0xe0a0('0x4'),'afterUpdate':_0xe0a0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3488e4){return function(_0x4867b2,_0x15319d,_0x1684b3){TeamEvents[_0xe0a0('0x6')](_0x3488e4+':'+_0x4867b2['id'],_0x4867b2);TeamEvents[_0xe0a0('0x6')](_0x3488e4,_0x4867b2);_0x1684b3(null);};}for(var e in events){if(events[_0xe0a0('0x7')](e)){var event=events[e];Team[_0xe0a0('0x8')](e,emitEvent(event));}}module[_0xe0a0('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0fcc67c..72527c2 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 _0xf596=['channel','exports','define','Team','Chat','Mail','Openchannel','Sms','Voice','all','catch','lodash','get','Queues','then','map'];(function(_0x66aa87,_0x1e6fdf){var _0x560be0=function(_0x892e6c){while(--_0x892e6c){_0x66aa87['push'](_0x66aa87['shift']());}};_0x560be0(++_0x1e6fdf);}(_0xf596,0xab));var _0x6f59=function(_0x44deb8,_0x44d04a){_0x44deb8=_0x44deb8-0x0;var _0x4a49fc=_0xf596[_0x44deb8];return _0x4a49fc;};'use strict';var _=require(_0x6f59('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x4a018c,_0x48cf75){var _0x326cd2=_0x6f59('0x1')+_0x48cf75+_0x6f59('0x2');return _0x4a018c[_0x326cd2]()[_0x6f59('0x3')](function(_0x58e489){return _[_0x6f59('0x4')](_0x58e489,function(_0x317be9){_0x317be9['setDataValue'](_0x6f59('0x5'),_0x48cf75);return _0x317be9;});})['catch'](function(_0x940ba3){throw _0x940ba3;});}module[_0x6f59('0x6')]=function(_0x39ef37){return _0x39ef37[_0x6f59('0x7')](_0x6f59('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x53e89f=this;var _0x530123=[_0x6f59('0x9'),'Fax',_0x6f59('0xa'),_0x6f59('0xb'),_0x6f59('0xc'),_0x6f59('0xd'),'Whatsapp'];return Promise['resolve']()[_0x6f59('0x3')](function(){var _0x5bca50=_[_0x6f59('0x4')](_0x530123,function(_0x39b112){return getQueuesByChannel(_0x53e89f,_0x39b112);});return Promise[_0x6f59('0xe')](_0x5bca50);})[_0x6f59('0xf')](function(_0x3b6fe9){throw _0x3b6fe9;});}}});}; \ No newline at end of file +var _0x9126=['./team.attributes','get','then','map','setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Openchannel','Sms','Whatsapp'];(function(_0xd0e0f4,_0x54494c){var _0x1700fa=function(_0x373ff5){while(--_0x373ff5){_0xd0e0f4['push'](_0xd0e0f4['shift']());}};_0x1700fa(++_0x54494c);}(_0x9126,0xf0));var _0x6912=function(_0x193f37,_0x466b27){_0x193f37=_0x193f37-0x0;var _0x8b8e7=_0x9126[_0x193f37];return _0x8b8e7;};'use strict';var _=require('lodash');var attributes=require(_0x6912('0x0'));function getQueuesByChannel(_0x30eb4c,_0x3f7468){var _0x168cf5=_0x6912('0x1')+_0x3f7468+'Queues';return _0x30eb4c[_0x168cf5]()[_0x6912('0x2')](function(_0x4dcdd5){return _[_0x6912('0x3')](_0x4dcdd5,function(_0x5c408e){_0x5c408e[_0x6912('0x4')](_0x6912('0x5'),_0x3f7468);return _0x5c408e;});})[_0x6912('0x6')](function(_0x24d084){throw _0x24d084;});}module[_0x6912('0x7')]=function(_0x75166c){return _0x75166c[_0x6912('0x8')](_0x6912('0x9'),attributes,{'tableName':_0x6912('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3d57af=this;var _0x3ed914=[_0x6912('0xb'),_0x6912('0xc'),'Mail',_0x6912('0xd'),_0x6912('0xe'),'Voice',_0x6912('0xf')];return Promise['resolve']()[_0x6912('0x2')](function(){var _0x12630f=_[_0x6912('0x3')](_0x3ed914,function(_0x3f213f){return getQueuesByChannel(_0x3d57af,_0x3f213f);});return Promise['all'](_0x12630f);})[_0x6912('0x6')](function(_0x4fb978){throw _0x4fb978;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 7b33fcf..0e2acc8 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 _0xc445=['register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./team.socket'];(function(_0x16ffe2,_0x2f73ed){var _0x4193e5=function(_0x5f0de3){while(--_0x5f0de3){_0x16ffe2['push'](_0x16ffe2['shift']());}};_0x4193e5(++_0x2f73ed);}(_0xc445,0xb4));var _0x5c44=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0xc445[_0x33593e];return _0x53db1a;};'use strict';var _=require(_0x5c44('0x0'));var util=require('util');var moment=require(_0x5c44('0x1'));var BPromise=require(_0x5c44('0x2'));var rs=require(_0x5c44('0x3'));var fs=require('fs');var Redis=require(_0x5c44('0x4'));var db=require(_0x5c44('0x5'))['db'];var utils=require(_0x5c44('0x6'));var logger=require(_0x5c44('0x7'))(_0x5c44('0x8'));var config=require(_0x5c44('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5c44('0xa')]['http']({'port':0x232a});config['redis']=_[_0x5c44('0xb')](config[_0x5c44('0xc')],{'host':_0x5c44('0xd'),'port':0x18eb});var socket=require(_0x5c44('0xe'))(new Redis(config[_0x5c44('0xc')]));require(_0x5c44('0xf'))[_0x5c44('0x10')](socket);function respondWithRpcPromise(_0x1e99ca,_0x5be3d8,_0x1548d2){return new BPromise(function(_0x14b9d6,_0x3c8d7d){return client[_0x5c44('0x11')](_0x1e99ca,_0x1548d2)[_0x5c44('0x12')](function(_0x284fb1){logger[_0x5c44('0x13')](_0x5c44('0x14'),_0x5be3d8,_0x5c44('0x15'));logger[_0x5c44('0x16')](_0x5c44('0x17'),_0x5be3d8,_0x5c44('0x15'),JSON['stringify'](_0x284fb1));if(_0x284fb1[_0x5c44('0x18')]){if(_0x284fb1[_0x5c44('0x18')][_0x5c44('0x19')]===0x1f4){logger[_0x5c44('0x18')](_0x5c44('0x14'),_0x5be3d8,_0x284fb1[_0x5c44('0x18')][_0x5c44('0x1a')]);return _0x3c8d7d(_0x284fb1[_0x5c44('0x18')]['message']);}logger[_0x5c44('0x18')]('Team,\x20%s,\x20%s',_0x5be3d8,_0x284fb1[_0x5c44('0x18')][_0x5c44('0x1a')]);return _0x14b9d6(_0x284fb1[_0x5c44('0x18')][_0x5c44('0x1a')]);}else{logger[_0x5c44('0x13')](_0x5c44('0x14'),_0x5be3d8,_0x5c44('0x15'));_0x14b9d6(_0x284fb1['result'][_0x5c44('0x1a')]);}})[_0x5c44('0x1b')](function(_0xe6566a){logger[_0x5c44('0x18')]('Team,\x20%s,\x20%s',_0x5be3d8,_0xe6566a);_0x3c8d7d(_0xe6566a);});});} \ No newline at end of file +var _0x2ec2=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','then','info','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','Team,\x20%s,\x20%s','message','result','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0x2ec2,0x84));var _0x22ec=function(_0x4eb662,_0x540e40){_0x4eb662=_0x4eb662-0x0;var _0x2d7889=_0x2ec2[_0x4eb662];return _0x2d7889;};'use strict';var _=require(_0x22ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x22ec('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22ec('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x22ec('0x3'))(_0x22ec('0x4'));var config=require(_0x22ec('0x5'));var jayson=require(_0x22ec('0x6'));var client=jayson[_0x22ec('0x7')][_0x22ec('0x8')]({'port':0x232a});config['redis']=_[_0x22ec('0x9')](config[_0x22ec('0xa')],{'host':_0x22ec('0xb'),'port':0x18eb});var socket=require(_0x22ec('0xc'))(new Redis(config['redis']));require(_0x22ec('0xd'))[_0x22ec('0xe')](socket);function respondWithRpcPromise(_0x8b0fb6,_0x553458,_0x39e1fc){return new BPromise(function(_0x404359,_0x3e8d53){return client['request'](_0x8b0fb6,_0x39e1fc)[_0x22ec('0xf')](function(_0x1e5113){logger[_0x22ec('0x10')]('Team,\x20%s,\x20%s',_0x553458,_0x22ec('0x11'));logger['debug'](_0x22ec('0x12'),_0x553458,_0x22ec('0x11'),JSON['stringify'](_0x1e5113));if(_0x1e5113[_0x22ec('0x13')]){if(_0x1e5113[_0x22ec('0x13')]['code']===0x1f4){logger[_0x22ec('0x13')](_0x22ec('0x14'),_0x553458,_0x1e5113['error'][_0x22ec('0x15')]);return _0x3e8d53(_0x1e5113[_0x22ec('0x13')][_0x22ec('0x15')]);}logger['error'](_0x22ec('0x14'),_0x553458,_0x1e5113['error']['message']);return _0x404359(_0x1e5113[_0x22ec('0x13')]['message']);}else{logger[_0x22ec('0x10')](_0x22ec('0x14'),_0x553458,_0x22ec('0x11'));_0x404359(_0x1e5113[_0x22ec('0x16')]['message']);}})['catch'](function(_0x506099){logger[_0x22ec('0x13')](_0x22ec('0x14'),_0x553458,_0x506099);_0x3e8d53(_0x506099);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 5799c76..0f07a1c 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 _0xd110=['./team.events','save','remove','emit','removeListener','register','length','team:'];(function(_0x3e1e1b,_0x560c1e){var _0x3f78a4=function(_0x52669e){while(--_0x52669e){_0x3e1e1b['push'](_0x3e1e1b['shift']());}};_0x3f78a4(++_0x560c1e);}(_0xd110,0x1e8));var _0x0d11=function(_0x4d1a03,_0x190496){_0x4d1a03=_0x4d1a03-0x0;var _0x267572=_0xd110[_0x4d1a03];return _0x267572;};'use strict';var TeamEvents=require(_0x0d11('0x0'));var events=[_0x0d11('0x1'),_0x0d11('0x2'),'update'];function createListener(_0x172081,_0x2ef498){return function(_0x2db155){_0x2ef498[_0x0d11('0x3')](_0x172081,_0x2db155);};}function removeListener(_0x24058d,_0x2e5aa0){return function(){TeamEvents[_0x0d11('0x4')](_0x24058d,_0x2e5aa0);};}exports[_0x0d11('0x5')]=function(_0x578537){for(var _0xf61dad=0x0,_0x5a889c=events[_0x0d11('0x6')];_0xf61dad<_0x5a889c;_0xf61dad++){var _0x4f3f3f=events[_0xf61dad];var _0x47a493=createListener(_0x0d11('0x7')+_0x4f3f3f,_0x578537);TeamEvents['on'](_0x4f3f3f,_0x47a493);}}; \ No newline at end of file +var _0xfc5a=['removeListener','length','team:','./team.events','save','update','emit'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xfc5a,0x153));var _0xafc5=function(_0x4fc435,_0x45eddf){_0x4fc435=_0x4fc435-0x0;var _0x3c5db1=_0xfc5a[_0x4fc435];return _0x3c5db1;};'use strict';var TeamEvents=require(_0xafc5('0x0'));var events=[_0xafc5('0x1'),'remove',_0xafc5('0x2')];function createListener(_0x556cb0,_0x3da550){return function(_0x162dd3){_0x3da550[_0xafc5('0x3')](_0x556cb0,_0x162dd3);};}function removeListener(_0x2b3a61,_0x463d8e){return function(){TeamEvents[_0xafc5('0x4')](_0x2b3a61,_0x463d8e);};}exports['register']=function(_0x2ae1b2){for(var _0x8c1c67=0x0,_0x175658=events[_0xafc5('0x5')];_0x8c1c67<_0x175658;_0x8c1c67++){var _0x1fbe37=events[_0x8c1c67];var _0x1b2651=createListener(_0xafc5('0x6')+_0x1fbe37,_0x2ae1b2);TeamEvents['on'](_0x1fbe37,_0x1b2651);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 0bc4158..97ffae0 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 _0xc2e8=['sequelize','exports'];(function(_0x276510,_0x2bdd98){var _0x5a7a16=function(_0x412b96){while(--_0x412b96){_0x276510['push'](_0x276510['shift']());}};_0x5a7a16(++_0x2bdd98);}(_0xc2e8,0x70));var _0x8c2e=function(_0x53b199,_0x38ff21){_0x53b199=_0x53b199-0x0;var _0x1ba42d=_0xc2e8[_0x53b199];return _0x1ba42d;};'use strict';var Sequelize=require(_0x8c2e('0x0'));module[_0x8c2e('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5f6a=['sequelize','INTEGER'];(function(_0x50e0b9,_0x32738e){var _0x8305d9=function(_0x5b1f61){while(--_0x5b1f61){_0x50e0b9['push'](_0x50e0b9['shift']());}};_0x8305d9(++_0x32738e);}(_0x5f6a,0xc4));var _0xa5f6=function(_0xee6ce6,_0x56f2a5){_0xee6ce6=_0xee6ce6-0x0;var _0x17d668=_0x5f6a[_0xee6ce6];return _0x17d668;};'use strict';var Sequelize=require(_0xa5f6('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xa5f6('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index f0fd4e4..b88a56f 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 _0x7d5a=['bluebird','request-promise','../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x461480,_0x3fad6f){var _0x58777c=function(_0x290a8a){while(--_0x290a8a){_0x461480['push'](_0x461480['shift']());}};_0x58777c(++_0x3fad6f);}(_0x7d5a,0x17b));var _0xa7d5=function(_0x3e30ac,_0x4d5693){_0x3e30ac=_0x3e30ac-0x0;var _0x2cd606=_0x7d5a[_0x3e30ac];return _0x2cd606;};'use strict';var _=require(_0xa7d5('0x0'));var util=require(_0xa7d5('0x1'));var logger=require(_0xa7d5('0x2'))(_0xa7d5('0x3'));var moment=require(_0xa7d5('0x4'));var BPromise=require(_0xa7d5('0x5'));var rp=require(_0xa7d5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa7d5('0x7'));var attributes=require(_0xa7d5('0x8'));module[_0xa7d5('0x9')]=function(_0x284432,_0x1e6722){return _0x284432[_0xa7d5('0xa')]('TeamVoicePrefix',attributes,{'tableName':_0xa7d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb78e=['TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','define'];(function(_0x37ef08,_0x5330c4){var _0x29b027=function(_0x53d1ab){while(--_0x53d1ab){_0x37ef08['push'](_0x37ef08['shift']());}};_0x29b027(++_0x5330c4);}(_0xb78e,0x1c9));var _0xeb78=function(_0x5aed76,_0x22c450){_0x5aed76=_0x5aed76-0x0;var _0x26b84c=_0xb78e[_0x5aed76];return _0x26b84c;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index c4768fd..ea702dd 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index e2151f6..9006424 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 _0x5a05=['sequelize','exports','INTEGER'];(function(_0xf1d43f,_0x518918){var _0x6f64df=function(_0x2d39cf){while(--_0x2d39cf){_0xf1d43f['push'](_0xf1d43f['shift']());}};_0x6f64df(++_0x518918);}(_0x5a05,0x93));var _0x55a0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5a05[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x55a0('0x0'));module[_0x55a0('0x1')]={'penalty':{'type':Sequelize[_0x55a0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 0002bba..9725c99 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 _0xb332=['define','lodash','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x4fc1af,_0x14dba3){var _0x267f0b=function(_0x554601){while(--_0x554601){_0x4fc1af['push'](_0x4fc1af['shift']());}};_0x267f0b(++_0x14dba3);}(_0xb332,0xd9));var _0x2b33=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0xb332[_0x13524d];return _0x9918b4;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var moment=require('moment');var BPromise=require(_0x2b33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b33('0x4'));var rimraf=require('rimraf');var config=require(_0x2b33('0x5'));var attributes=require('./teamVoiceQueue.attributes');module[_0x2b33('0x6')]=function(_0x22d66,_0x478214){return _0x22d66[_0x2b33('0x7')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27c9=['TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x9b6743,_0x478162){var _0x16c682=function(_0x1866b9){while(--_0x1866b9){_0x9b6743['push'](_0x9b6743['shift']());}};_0x16c682(++_0x478162);}(_0x27c9,0x1af));var _0x927c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x27c9[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x927c('0x0'));var util=require(_0x927c('0x1'));var logger=require(_0x927c('0x2'))(_0x927c('0x3'));var moment=require('moment');var BPromise=require(_0x927c('0x4'));var rp=require(_0x927c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x927c('0x6'));var config=require(_0x927c('0x7'));var attributes=require(_0x927c('0x8'));module[_0x927c('0x9')]=function(_0x338730,_0x5b09de){return _0x338730[_0x927c('0xa')](_0x927c('0xb'),attributes,{'tableName':_0x927c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 59af285..adf73f3 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 _0x35a9=['util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x25fb0c,_0x256af7){var _0x2075aa=function(_0xf56e53){while(--_0xf56e53){_0x25fb0c['push'](_0x25fb0c['shift']());}};_0x2075aa(++_0x256af7);}(_0x35a9,0x73));var _0x935a=function(_0x21106e,_0x38a4a9){_0x21106e=_0x21106e-0x0;var _0x344fc4=_0x35a9[_0x21106e];return _0x344fc4;};'use strict';var _=require('lodash');var util=require(_0x935a('0x0'));var moment=require(_0x935a('0x1'));var BPromise=require(_0x935a('0x2'));var rs=require(_0x935a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x935a('0x4'));var logger=require('../../config/logger')(_0x935a('0x5'));var config=require(_0x935a('0x6'));var jayson=require(_0x935a('0x7'));var client=jayson[_0x935a('0x8')][_0x935a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca82cf,_0xa3490c,_0x16a5c2){return new BPromise(function(_0x534830,_0x78e624){return client[_0x935a('0xa')](_0xca82cf,_0x16a5c2)[_0x935a('0xb')](function(_0x1d82bb){logger[_0x935a('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0xa3490c,_0x935a('0xd'));logger[_0x935a('0xe')](_0x935a('0xf'),_0xa3490c,'request\x20sent',JSON[_0x935a('0x10')](_0x1d82bb));if(_0x1d82bb['error']){if(_0x1d82bb['error'][_0x935a('0x11')]===0x1f4){logger[_0x935a('0x12')](_0x935a('0x13'),_0xa3490c,_0x1d82bb[_0x935a('0x12')][_0x935a('0x14')]);return _0x78e624(_0x1d82bb[_0x935a('0x12')][_0x935a('0x14')]);}logger[_0x935a('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0xa3490c,_0x1d82bb[_0x935a('0x12')][_0x935a('0x14')]);return _0x534830(_0x1d82bb[_0x935a('0x12')][_0x935a('0x14')]);}else{logger[_0x935a('0xc')](_0x935a('0x13'),_0xa3490c,_0x935a('0xd'));_0x534830(_0x1d82bb[_0x935a('0x15')][_0x935a('0x14')]);}})[_0x935a('0x16')](function(_0x4dbf52){logger[_0x935a('0x12')](_0x935a('0x13'),_0xa3490c,_0x4dbf52);_0x78e624(_0x4dbf52);});});} \ No newline at end of file +var _0xba6c=['request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0xe31165,_0x23cebf){var _0x3cd681=function(_0x5cfe54){while(--_0x5cfe54){_0xe31165['push'](_0xe31165['shift']());}};_0x3cd681(++_0x23cebf);}(_0xba6c,0x113));var _0xcba6=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0xba6c[_0x5e4b85];return _0x5cd3cb;};'use strict';var _=require(_0xcba6('0x0'));var util=require('util');var moment=require(_0xcba6('0x1'));var BPromise=require(_0xcba6('0x2'));var rs=require(_0xcba6('0x3'));var fs=require('fs');var Redis=require(_0xcba6('0x4'));var db=require(_0xcba6('0x5'))['db'];var utils=require(_0xcba6('0x6'));var logger=require(_0xcba6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcba6('0x8'));var client=jayson[_0xcba6('0x9')][_0xcba6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x137300,_0x3302a4,_0x95c2f1){return new BPromise(function(_0x308366,_0x503869){return client[_0xcba6('0xb')](_0x137300,_0x95c2f1)[_0xcba6('0xc')](function(_0x391375){logger['info'](_0xcba6('0xd'),_0x3302a4,_0xcba6('0xe'));logger[_0xcba6('0xf')](_0xcba6('0x10'),_0x3302a4,'request\x20sent',JSON[_0xcba6('0x11')](_0x391375));if(_0x391375['error']){if(_0x391375[_0xcba6('0x12')][_0xcba6('0x13')]===0x1f4){logger['error'](_0xcba6('0xd'),_0x3302a4,_0x391375['error'][_0xcba6('0x14')]);return _0x503869(_0x391375['error']['message']);}logger['error'](_0xcba6('0xd'),_0x3302a4,_0x391375[_0xcba6('0x12')][_0xcba6('0x14')]);return _0x308366(_0x391375[_0xcba6('0x12')][_0xcba6('0x14')]);}else{logger['info'](_0xcba6('0xd'),_0x3302a4,'request\x20sent');_0x308366(_0x391375[_0xcba6('0x15')][_0xcba6('0x14')]);}})['catch'](function(_0xd80373){logger[_0xcba6('0x12')](_0xcba6('0xd'),_0x3302a4,_0xd80373);_0x503869(_0xd80373);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 6604710..d38a26e 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(_0x2906bc,_0x1d2d95){var _0x356e00=function(_0x59ec0c){while(--_0x59ec0c){_0x2906bc['push'](_0x2906bc['shift']());}};_0x356e00(++_0x1d2d95);}(_0xf417,0x8f));var _0x7f41=function(_0x4f1676,_0x37289e){_0x4f1676=_0x4f1676-0x0;var _0x25d0a1=_0xf417[_0x4f1676];return _0x25d0a1;};'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 _0x6ab9=['get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./template.controller'];(function(_0x2125e7,_0x3f643e){var _0x3b8fdd=function(_0x1ddba7){while(--_0x1ddba7){_0x2125e7['push'](_0x2125e7['shift']());}};_0x3b8fdd(++_0x3f643e);}(_0x6ab9,0x19a));var _0x96ab=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x6ab9[_0x556bb1];return _0x45455f;};'use strict';var multer=require(_0x96ab('0x0'));var util=require(_0x96ab('0x1'));var path=require('path');var timeout=require(_0x96ab('0x2'));var express=require(_0x96ab('0x3'));var router=express[_0x96ab('0x4')]();var fs_extra=require(_0x96ab('0x5'));var auth=require(_0x96ab('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x96ab('0x7'));router[_0x96ab('0x8')]('/',auth[_0x96ab('0x9')](),controller['index']);router[_0x96ab('0x8')](_0x96ab('0xa'),auth['isAuthenticated'](),controller[_0x96ab('0xb')]);router[_0x96ab('0xc')]('/',auth[_0x96ab('0x9')](),controller[_0x96ab('0xd')]);router[_0x96ab('0xe')](_0x96ab('0xa'),auth[_0x96ab('0x9')](),controller[_0x96ab('0xf')]);router[_0x96ab('0x10')](_0x96ab('0xa'),auth[_0x96ab('0x9')](),controller[_0x96ab('0x11')]);module[_0x96ab('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 95b51a2..89c124c 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 _0x1419=['exports','STRING','TEXT','sequelize'];(function(_0x266e89,_0x9816fe){var _0x21b197=function(_0x259904){while(--_0x259904){_0x266e89['push'](_0x266e89['shift']());}};_0x21b197(++_0x9816fe);}(_0x1419,0x83));var _0x9141=function(_0x2d8cd6,_0xdc75a4){_0x2d8cd6=_0x2d8cd6-0x0;var _0x1cc34f=_0x1419[_0x2d8cd6];return _0x1cc34f;};'use strict';var Sequelize=require(_0x9141('0x0'));module[_0x9141('0x1')]={'name':{'type':Sequelize[_0x9141('0x2')]},'description':{'type':Sequelize[_0x9141('0x2')]},'html':{'type':Sequelize[_0x9141('0x3')]}}; \ No newline at end of file +var _0x21a7=['exports','STRING','TEXT'];(function(_0x55e53a,_0x3afcee){var _0x6caf23=function(_0x236670){while(--_0x236670){_0x55e53a['push'](_0x55e53a['shift']());}};_0x6caf23(++_0x3afcee);}(_0x21a7,0x69));var _0x721a=function(_0x170b06,_0x556326){_0x170b06=_0x170b06-0x0;var _0x4bfc00=_0x21a7[_0x170b06];return _0x4bfc00;};'use strict';var Sequelize=require('sequelize');module[_0x721a('0x0')]={'name':{'type':Sequelize[_0x721a('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x721a('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 68cdfd7..631e2b1 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 _0x284a=['sort','pick','filter','where','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','role','user','Templates','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','Template','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x12f59c,_0x13d956){var _0x2db43e=function(_0x1743fb){while(--_0x1743fb){_0x12f59c['push'](_0x12f59c['shift']());}};_0x2db43e(++_0x13d956);}(_0x284a,0xb5));var _0xa284=function(_0x2af0d9,_0x45ffa4){_0x2af0d9=_0x2af0d9-0x0;var _0x7e7b2f=_0x284a[_0x2af0d9];return _0x7e7b2f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa284('0x0'));var rp=require(_0xa284('0x1'));var moment=require('moment');var BPromise=require(_0xa284('0x2'));var Mustache=require(_0xa284('0x3'));var util=require('util');var path=require(_0xa284('0x4'));var sox=require(_0xa284('0x5'));var csv=require(_0xa284('0x6'));var ejs=require(_0xa284('0x7'));var fs=require('fs');var fs_extra=require(_0xa284('0x8'));var _=require(_0xa284('0x9'));var squel=require(_0xa284('0xa'));var crypto=require(_0xa284('0xb'));var jsforce=require(_0xa284('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa284('0x6'));var querystring=require(_0xa284('0xd'));var Papa=require(_0xa284('0xe'));var Redis=require(_0xa284('0xf'));var authService=require(_0xa284('0x10'));var qs=require(_0xa284('0x11'));var as=require(_0xa284('0x12'));var hardwareService=require(_0xa284('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa284('0x14'));var db=require(_0xa284('0x15'))['db'];function respondWithStatusCode(_0x230ea9,_0x57a6d2){_0x57a6d2=_0x57a6d2||0xcc;return function(_0x579ae1){if(_0x579ae1){return _0x230ea9[_0xa284('0x16')](_0x57a6d2);}return _0x230ea9[_0xa284('0x17')](_0x57a6d2)[_0xa284('0x18')]();};}function respondWithResult(_0x285909,_0x110364){_0x110364=_0x110364||0xc8;return function(_0x1c94af){if(_0x1c94af){return _0x285909[_0xa284('0x17')](_0x110364)[_0xa284('0x19')](_0x1c94af);}};}function respondWithFilteredResult(_0xe0a9a4,_0x18bd17){return function(_0xf81e4a){if(_0xf81e4a){var _0x50cff5=typeof _0x18bd17['offset']==='undefined'&&typeof _0x18bd17['limit']===_0xa284('0x1a');var _0x1b6c2f=_0xf81e4a['count'];var _0x4ca7d6=_0x50cff5?0x0:_0x18bd17[_0xa284('0x1b')];var _0x490222=_0x50cff5?_0xf81e4a['count']:_0x18bd17[_0xa284('0x1b')]+_0x18bd17[_0xa284('0x1c')];var _0x5e1619;if(_0x490222>=_0x1b6c2f){_0x490222=_0x1b6c2f;_0x5e1619=0xc8;}else{_0x5e1619=0xce;}_0xe0a9a4[_0xa284('0x17')](_0x5e1619);return _0xe0a9a4[_0xa284('0x1d')](_0xa284('0x1e'),_0x4ca7d6+'-'+_0x490222+'/'+_0x1b6c2f)['json'](_0xf81e4a);}return null;};}function patchUpdates(_0x367cc6){return function(_0x5112d0){try{jsonpatch[_0xa284('0x1f')](_0x5112d0,_0x367cc6,!![]);}catch(_0x1b83b9){return BPromise[_0xa284('0x20')](_0x1b83b9);}return _0x5112d0[_0xa284('0x21')]();};}function saveUpdates(_0x6db161,_0x2a9200){return function(_0x385be9){if(_0x385be9){return _0x385be9['update'](_0x6db161)[_0xa284('0x22')](function(_0x347222){return _0x347222;});}return null;};}function removeEntity(_0x48b7ce,_0x1b1de7){return function(_0x29857e){if(_0x29857e){return _0x29857e[_0xa284('0x23')]()[_0xa284('0x22')](function(){var _0x64f8e8=_0x29857e['get']({'plain':!![]});var _0x526f94='Templates';return db['UserProfileResource'][_0xa284('0x23')]({'where':{'type':_0x526f94,'resourceId':_0x64f8e8['id']}})[_0xa284('0x22')](function(){return _0x29857e;});})[_0xa284('0x22')](function(){_0x48b7ce[_0xa284('0x17')](0xcc)[_0xa284('0x18')]();});}};}function handleEntityNotFound(_0x4689f9,_0x5c9a5b){return function(_0x4c251b){if(!_0x4c251b){_0x4689f9[_0xa284('0x16')](0x194);}return _0x4c251b;};}function handleError(_0x217f64,_0x239c75){_0x239c75=_0x239c75||0x1f4;return function(_0x26b1f1){logger['error'](_0x26b1f1[_0xa284('0x24')]);if(_0x26b1f1[_0xa284('0x25')]){delete _0x26b1f1[_0xa284('0x25')];}_0x217f64[_0xa284('0x17')](_0x239c75)['send'](_0x26b1f1);};}exports[_0xa284('0x26')]=function(_0x20178c,_0x5abfe4){var _0x3fac92={},_0x4f21d6={},_0x5a8389={'count':0x0,'rows':[]};var _0x523e01=_[_0xa284('0x27')](db[_0xa284('0x28')][_0xa284('0x29')],function(_0xa19a16){return{'name':_0xa19a16[_0xa284('0x2a')],'type':_0xa19a16[_0xa284('0x2b')][_0xa284('0x2c')]};});_0x4f21d6[_0xa284('0x2d')]=_[_0xa284('0x27')](_0x523e01,_0xa284('0x25'));_0x4f21d6['query']=_[_0xa284('0x2e')](_0x20178c[_0xa284('0x2f')]);_0x4f21d6[_0xa284('0x30')]=_[_0xa284('0x31')](_0x4f21d6['model'],_0x4f21d6[_0xa284('0x2f')]);_0x3fac92[_0xa284('0x32')]=_[_0xa284('0x31')](_0x4f21d6[_0xa284('0x2d')],qs[_0xa284('0x33')](_0x20178c[_0xa284('0x2f')][_0xa284('0x33')]));_0x3fac92[_0xa284('0x32')]=_0x3fac92['attributes'][_0xa284('0x34')]?_0x3fac92[_0xa284('0x32')]:_0x4f21d6[_0xa284('0x2d')];if(!_0x20178c['query'][_0xa284('0x35')](_0xa284('0x36'))){_0x3fac92[_0xa284('0x1c')]=qs['limit'](_0x20178c['query'][_0xa284('0x1c')]);_0x3fac92[_0xa284('0x1b')]=qs['offset'](_0x20178c[_0xa284('0x2f')][_0xa284('0x1b')]);}_0x3fac92[_0xa284('0x37')]=qs[_0xa284('0x38')](_0x20178c[_0xa284('0x2f')][_0xa284('0x38')]);_0x3fac92['where']=qs[_0xa284('0x30')](_[_0xa284('0x39')](_0x20178c[_0xa284('0x2f')],_0x4f21d6[_0xa284('0x30')]),_0x523e01);if(_0x20178c[_0xa284('0x2f')][_0xa284('0x3a')]){_0x3fac92[_0xa284('0x3b')]=_[_0xa284('0x3c')](_0x3fac92['where'],{'$or':_[_0xa284('0x27')](_0x523e01,function(_0x42fb03){if(_0x42fb03[_0xa284('0x2b')]!=='VIRTUAL'){var _0x1aa500={};_0x1aa500[_0x42fb03['name']]={'$like':'%'+_0x20178c[_0xa284('0x2f')][_0xa284('0x3a')]+'%'};return _0x1aa500;}})});}_0x3fac92=_['merge']({},_0x3fac92,_0x20178c[_0xa284('0x3d')]);var _0x1a07ea={'where':_0x3fac92['where']};return db[_0xa284('0x28')][_0xa284('0x3e')](_0x1a07ea)[_0xa284('0x22')](function(_0x1bbe65){_0x5a8389[_0xa284('0x3e')]=_0x1bbe65;if(_0x20178c[_0xa284('0x2f')][_0xa284('0x3f')]){_0x3fac92[_0xa284('0x40')]=[{'all':!![]}];}return db['Template'][_0xa284('0x41')](_0x3fac92);})[_0xa284('0x22')](function(_0x311554){_0x5a8389[_0xa284('0x42')]=_0x311554;return _0x5a8389;})[_0xa284('0x22')](respondWithFilteredResult(_0x5abfe4,_0x3fac92))[_0xa284('0x43')](handleError(_0x5abfe4,null));};exports['show']=function(_0x280d22,_0x3ac75e){var _0x2a2c88={'raw':!![],'where':{'id':_0x280d22[_0xa284('0x44')]['id']}},_0x426b49={};_0x426b49[_0xa284('0x2d')]=_[_0xa284('0x2e')](db[_0xa284('0x28')]['rawAttributes']);_0x426b49['query']=_['keys'](_0x280d22['query']);_0x426b49['filters']=_[_0xa284('0x31')](_0x426b49[_0xa284('0x2d')],_0x426b49['query']);_0x2a2c88[_0xa284('0x32')]=_['intersection'](_0x426b49[_0xa284('0x2d')],qs[_0xa284('0x33')](_0x280d22[_0xa284('0x2f')][_0xa284('0x33')]));_0x2a2c88[_0xa284('0x32')]=_0x2a2c88[_0xa284('0x32')][_0xa284('0x34')]?_0x2a2c88['attributes']:_0x426b49[_0xa284('0x2d')];if(_0x280d22[_0xa284('0x2f')][_0xa284('0x3f')]){_0x2a2c88[_0xa284('0x40')]=[{'all':!![]}];}_0x2a2c88=_[_0xa284('0x3c')]({},_0x2a2c88,_0x280d22[_0xa284('0x3d')]);return db[_0xa284('0x28')][_0xa284('0x45')](_0x2a2c88)['then'](handleEntityNotFound(_0x3ac75e,null))[_0xa284('0x22')](respondWithResult(_0x3ac75e,null))[_0xa284('0x43')](handleError(_0x3ac75e,null));};exports[_0xa284('0x46')]=function(_0x4d373b,_0x9d900d){return db['Template'][_0xa284('0x46')](_0x4d373b['body'],{})[_0xa284('0x22')](function(_0x4573af){var _0x494bfb=_0x4d373b['user']['get']({'plain':!![]});if(!_0x494bfb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x494bfb[_0xa284('0x47')]===_0xa284('0x48')){var _0x1c6830=_0x4573af['get']({'plain':!![]});var _0x3ffc7b=_0xa284('0x49');return db[_0xa284('0x4a')][_0xa284('0x45')]({'where':{'name':_0x3ffc7b,'userProfileId':_0x494bfb[_0xa284('0x4b')]},'raw':!![]})['then'](function(_0x2894fd){if(_0x2894fd&&_0x2894fd['autoAssociation']===0x0){return db['UserProfileResource'][_0xa284('0x46')]({'name':_0x1c6830[_0xa284('0x25')],'resourceId':_0x1c6830['id'],'type':_0x2894fd[_0xa284('0x25')],'sectionId':_0x2894fd['id']},{})[_0xa284('0x22')](function(){return _0x4573af;});}else{return _0x4573af;}})['catch'](function(_0x427b7e){logger['error'](_0xa284('0x4c'),_0x427b7e);throw _0x427b7e;});}return _0x4573af;})[_0xa284('0x22')](respondWithResult(_0x9d900d,0xc9))[_0xa284('0x43')](handleError(_0x9d900d,null));};exports[_0xa284('0x4d')]=function(_0x1d133f,_0x661e99){if(_0x1d133f[_0xa284('0x4e')]['id']){delete _0x1d133f['body']['id'];}return db['Template'][_0xa284('0x45')]({'where':{'id':_0x1d133f[_0xa284('0x44')]['id']}})[_0xa284('0x22')](handleEntityNotFound(_0x661e99,null))[_0xa284('0x22')](saveUpdates(_0x1d133f[_0xa284('0x4e')],null))['then'](respondWithResult(_0x661e99,null))[_0xa284('0x43')](handleError(_0x661e99,null));};exports[_0xa284('0x23')]=function(_0xbfe840,_0x98c30e){return db[_0xa284('0x28')][_0xa284('0x45')]({'where':{'id':_0xbfe840['params']['id']}})[_0xa284('0x22')](handleEntityNotFound(_0x98c30e,null))[_0xa284('0x22')](removeEntity(_0x98c30e,null))[_0xa284('0x43')](handleError(_0x98c30e,null));}; \ No newline at end of file +var _0x91e0=['model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Template','includeAll','include','findAll','catch','show','params','create','body','user','UserProfileSection','userProfileId','autoAssociation','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','Templates','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type'];(function(_0x2352b0,_0x409541){var _0x304aa1=function(_0x33c52f){while(--_0x33c52f){_0x2352b0['push'](_0x2352b0['shift']());}};_0x304aa1(++_0x409541);}(_0x91e0,0xc1));var _0x091e=function(_0x3921f,_0x403b23){_0x3921f=_0x3921f-0x0;var _0x1aada5=_0x91e0[_0x3921f];return _0x1aada5;};'use strict';var emlformat=require(_0x091e('0x0'));var rimraf=require(_0x091e('0x1'));var zipdir=require(_0x091e('0x2'));var jsonpatch=require(_0x091e('0x3'));var rp=require(_0x091e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x091e('0x5'));var util=require(_0x091e('0x6'));var path=require(_0x091e('0x7'));var sox=require(_0x091e('0x8'));var csv=require(_0x091e('0x9'));var ejs=require(_0x091e('0xa'));var fs=require('fs');var fs_extra=require(_0x091e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x091e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x091e('0xd'));var Papa=require('papaparse');var Redis=require(_0x091e('0xe'));var authService=require(_0x091e('0xf'));var qs=require(_0x091e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x091e('0x11'))(_0x091e('0x12'));var utils=require('../../config/utils');var config=require(_0x091e('0x13'));var licenseUtil=require(_0x091e('0x14'));var db=require(_0x091e('0x15'))['db'];function respondWithStatusCode(_0x36334d,_0x231773){_0x231773=_0x231773||0xcc;return function(_0x20ea3e){if(_0x20ea3e){return _0x36334d[_0x091e('0x16')](_0x231773);}return _0x36334d[_0x091e('0x17')](_0x231773)[_0x091e('0x18')]();};}function respondWithResult(_0x4ad96d,_0x2a1a70){_0x2a1a70=_0x2a1a70||0xc8;return function(_0x1587f3){if(_0x1587f3){return _0x4ad96d[_0x091e('0x17')](_0x2a1a70)[_0x091e('0x19')](_0x1587f3);}};}function respondWithFilteredResult(_0x2731b0,_0x4a62c0){return function(_0x45a5d6){if(_0x45a5d6){var _0x22eb57=typeof _0x4a62c0[_0x091e('0x1a')]==='undefined'&&typeof _0x4a62c0[_0x091e('0x1b')]===_0x091e('0x1c');var _0x5d020e=_0x45a5d6[_0x091e('0x1d')];var _0x14abf0=_0x22eb57?0x0:_0x4a62c0[_0x091e('0x1a')];var _0x2695c4=_0x22eb57?_0x45a5d6['count']:_0x4a62c0[_0x091e('0x1a')]+_0x4a62c0['limit'];var _0x56fc06;if(_0x2695c4>=_0x5d020e){_0x2695c4=_0x5d020e;_0x56fc06=0xc8;}else{_0x56fc06=0xce;}_0x2731b0[_0x091e('0x17')](_0x56fc06);return _0x2731b0[_0x091e('0x1e')](_0x091e('0x1f'),_0x14abf0+'-'+_0x2695c4+'/'+_0x5d020e)[_0x091e('0x19')](_0x45a5d6);}return null;};}function patchUpdates(_0x43b75b){return function(_0xa1161b){try{jsonpatch[_0x091e('0x20')](_0xa1161b,_0x43b75b,!![]);}catch(_0xc36c09){return BPromise[_0x091e('0x21')](_0xc36c09);}return _0xa1161b[_0x091e('0x22')]();};}function saveUpdates(_0x36764b,_0x71fe73){return function(_0x1bc424){if(_0x1bc424){return _0x1bc424['update'](_0x36764b)[_0x091e('0x23')](function(_0x2bfef9){return _0x2bfef9;});}return null;};}function removeEntity(_0x31b620,_0x23c001){return function(_0x1870be){if(_0x1870be){return _0x1870be[_0x091e('0x24')]()[_0x091e('0x23')](function(){var _0x3ccb8a=_0x1870be[_0x091e('0x25')]({'plain':!![]});var _0x32537a=_0x091e('0x26');return db[_0x091e('0x27')][_0x091e('0x24')]({'where':{'type':_0x32537a,'resourceId':_0x3ccb8a['id']}})[_0x091e('0x23')](function(){return _0x1870be;});})['then'](function(){_0x31b620[_0x091e('0x17')](0xcc)[_0x091e('0x18')]();});}};}function handleEntityNotFound(_0x280b0e,_0x412d88){return function(_0x19e841){if(!_0x19e841){_0x280b0e[_0x091e('0x16')](0x194);}return _0x19e841;};}function handleError(_0x52d990,_0x4e31b6){_0x4e31b6=_0x4e31b6||0x1f4;return function(_0x4654a3){logger[_0x091e('0x28')](_0x4654a3['stack']);if(_0x4654a3[_0x091e('0x29')]){delete _0x4654a3[_0x091e('0x29')];}_0x52d990[_0x091e('0x17')](_0x4e31b6)[_0x091e('0x2a')](_0x4654a3);};}exports[_0x091e('0x2b')]=function(_0x540cbc,_0x3a8afb){var _0x2dcb3b={},_0x256c15={},_0x45e20a={'count':0x0,'rows':[]};var _0x32a13f=_['map'](db['Template'][_0x091e('0x2c')],function(_0x192a5f){return{'name':_0x192a5f[_0x091e('0x2d')],'type':_0x192a5f[_0x091e('0x2e')]['key']};});_0x256c15[_0x091e('0x2f')]=_[_0x091e('0x30')](_0x32a13f,_0x091e('0x29'));_0x256c15['query']=_[_0x091e('0x31')](_0x540cbc['query']);_0x256c15[_0x091e('0x32')]=_[_0x091e('0x33')](_0x256c15[_0x091e('0x2f')],_0x256c15[_0x091e('0x34')]);_0x2dcb3b[_0x091e('0x35')]=_[_0x091e('0x33')](_0x256c15[_0x091e('0x2f')],qs[_0x091e('0x36')](_0x540cbc[_0x091e('0x34')][_0x091e('0x36')]));_0x2dcb3b[_0x091e('0x35')]=_0x2dcb3b[_0x091e('0x35')][_0x091e('0x37')]?_0x2dcb3b[_0x091e('0x35')]:_0x256c15[_0x091e('0x2f')];if(!_0x540cbc[_0x091e('0x34')][_0x091e('0x38')](_0x091e('0x39'))){_0x2dcb3b[_0x091e('0x1b')]=qs[_0x091e('0x1b')](_0x540cbc[_0x091e('0x34')]['limit']);_0x2dcb3b[_0x091e('0x1a')]=qs[_0x091e('0x1a')](_0x540cbc[_0x091e('0x34')][_0x091e('0x1a')]);}_0x2dcb3b[_0x091e('0x3a')]=qs[_0x091e('0x3b')](_0x540cbc['query']['sort']);_0x2dcb3b[_0x091e('0x3c')]=qs[_0x091e('0x32')](_[_0x091e('0x3d')](_0x540cbc[_0x091e('0x34')],_0x256c15[_0x091e('0x32')]),_0x32a13f);if(_0x540cbc[_0x091e('0x34')][_0x091e('0x3e')]){_0x2dcb3b['where']=_[_0x091e('0x3f')](_0x2dcb3b[_0x091e('0x3c')],{'$or':_['map'](_0x32a13f,function(_0xff80c3){if(_0xff80c3['type']!==_0x091e('0x40')){var _0x1e069a={};_0x1e069a[_0xff80c3['name']]={'$like':'%'+_0x540cbc['query'][_0x091e('0x3e')]+'%'};return _0x1e069a;}})});}_0x2dcb3b=_[_0x091e('0x3f')]({},_0x2dcb3b,_0x540cbc[_0x091e('0x41')]);var _0x585991={'where':_0x2dcb3b['where']};return db[_0x091e('0x42')][_0x091e('0x1d')](_0x585991)[_0x091e('0x23')](function(_0x4f1cc5){_0x45e20a['count']=_0x4f1cc5;if(_0x540cbc['query'][_0x091e('0x43')]){_0x2dcb3b[_0x091e('0x44')]=[{'all':!![]}];}return db[_0x091e('0x42')][_0x091e('0x45')](_0x2dcb3b);})[_0x091e('0x23')](function(_0x202445){_0x45e20a['rows']=_0x202445;return _0x45e20a;})[_0x091e('0x23')](respondWithFilteredResult(_0x3a8afb,_0x2dcb3b))[_0x091e('0x46')](handleError(_0x3a8afb,null));};exports[_0x091e('0x47')]=function(_0x215dd4,_0x1809e0){var _0x4a7f91={'raw':!![],'where':{'id':_0x215dd4[_0x091e('0x48')]['id']}},_0x465727={};_0x465727[_0x091e('0x2f')]=_[_0x091e('0x31')](db[_0x091e('0x42')]['rawAttributes']);_0x465727[_0x091e('0x34')]=_['keys'](_0x215dd4[_0x091e('0x34')]);_0x465727[_0x091e('0x32')]=_[_0x091e('0x33')](_0x465727[_0x091e('0x2f')],_0x465727[_0x091e('0x34')]);_0x4a7f91[_0x091e('0x35')]=_[_0x091e('0x33')](_0x465727['model'],qs[_0x091e('0x36')](_0x215dd4['query'][_0x091e('0x36')]));_0x4a7f91[_0x091e('0x35')]=_0x4a7f91[_0x091e('0x35')][_0x091e('0x37')]?_0x4a7f91[_0x091e('0x35')]:_0x465727[_0x091e('0x2f')];if(_0x215dd4[_0x091e('0x34')][_0x091e('0x43')]){_0x4a7f91[_0x091e('0x44')]=[{'all':!![]}];}_0x4a7f91=_[_0x091e('0x3f')]({},_0x4a7f91,_0x215dd4['options']);return db['Template']['find'](_0x4a7f91)[_0x091e('0x23')](handleEntityNotFound(_0x1809e0,null))[_0x091e('0x23')](respondWithResult(_0x1809e0,null))['catch'](handleError(_0x1809e0,null));};exports['create']=function(_0x1ff26f,_0x5a4d57){return db[_0x091e('0x42')][_0x091e('0x49')](_0x1ff26f[_0x091e('0x4a')],{})[_0x091e('0x23')](function(_0x207f84){var _0x1b88d4=_0x1ff26f[_0x091e('0x4b')][_0x091e('0x25')]({'plain':!![]});if(!_0x1b88d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b88d4['role']===_0x091e('0x4b')){var _0x4c2d71=_0x207f84['get']({'plain':!![]});var _0x24ecdc=_0x091e('0x26');return db[_0x091e('0x4c')]['find']({'where':{'name':_0x24ecdc,'userProfileId':_0x1b88d4[_0x091e('0x4d')]},'raw':!![]})['then'](function(_0x180681){if(_0x180681&&_0x180681[_0x091e('0x4e')]===0x0){return db[_0x091e('0x27')][_0x091e('0x49')]({'name':_0x4c2d71[_0x091e('0x29')],'resourceId':_0x4c2d71['id'],'type':_0x180681[_0x091e('0x29')],'sectionId':_0x180681['id']},{})[_0x091e('0x23')](function(){return _0x207f84;});}else{return _0x207f84;}})[_0x091e('0x46')](function(_0x399f00){logger[_0x091e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x399f00);throw _0x399f00;});}return _0x207f84;})[_0x091e('0x23')](respondWithResult(_0x5a4d57,0xc9))[_0x091e('0x46')](handleError(_0x5a4d57,null));};exports['update']=function(_0x2325a7,_0x1335ef){if(_0x2325a7['body']['id']){delete _0x2325a7[_0x091e('0x4a')]['id'];}return db['Template'][_0x091e('0x4f')]({'where':{'id':_0x2325a7[_0x091e('0x48')]['id']}})[_0x091e('0x23')](handleEntityNotFound(_0x1335ef,null))['then'](saveUpdates(_0x2325a7[_0x091e('0x4a')],null))[_0x091e('0x23')](respondWithResult(_0x1335ef,null))[_0x091e('0x46')](handleError(_0x1335ef,null));};exports[_0x091e('0x24')]=function(_0x38ad73,_0x4bcbc5){return db[_0x091e('0x42')][_0x091e('0x4f')]({'where':{'id':_0x38ad73['params']['id']}})[_0x091e('0x23')](handleEntityNotFound(_0x4bcbc5,null))['then'](removeEntity(_0x4bcbc5,null))[_0x091e('0x46')](handleError(_0x4bcbc5,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 829c9ff..e6b4cdd 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 _0x3e51=['exports','define','Template','tools_templates','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0x3e51,0x180));var _0x13e5=function(_0x434ca8,_0x137097){_0x434ca8=_0x434ca8-0x0;var _0x3e5ba0=_0x3e51[_0x434ca8];return _0x3e5ba0;};'use strict';var _=require('lodash');var util=require(_0x13e5('0x0'));var logger=require(_0x13e5('0x1'))(_0x13e5('0x2'));var moment=require('moment');var BPromise=require(_0x13e5('0x3'));var rp=require(_0x13e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x13e5('0x5'));var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x13e5('0x6')]=function(_0x19b2d0,_0x1d2eb0){return _0x19b2d0[_0x13e5('0x7')](_0x13e5('0x8'),attributes,{'tableName':_0x13e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4265=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','../../config/logger'];(function(_0x2ab76b,_0x176579){var _0x201126=function(_0x11d8c8){while(--_0x11d8c8){_0x2ab76b['push'](_0x2ab76b['shift']());}};_0x201126(++_0x176579);}(_0x4265,0x1d2));var _0x5426=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x4265[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x5426('0x0'));var util=require('util');var logger=require(_0x5426('0x1'))(_0x5426('0x2'));var moment=require(_0x5426('0x3'));var BPromise=require(_0x5426('0x4'));var rp=require(_0x5426('0x5'));var fs=require('fs');var path=require(_0x5426('0x6'));var rimraf=require(_0x5426('0x7'));var config=require(_0x5426('0x8'));var attributes=require(_0x5426('0x9'));module[_0x5426('0xa')]=function(_0x217b59,_0x8fc9d4){return _0x217b59[_0x5426('0xb')]('Template',attributes,{'tableName':_0x5426('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index f3c815f..7e32a40 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 _0x9fd3=['stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','map','include','model','debug'];(function(_0x1a170c,_0x4c6725){var _0x2affc8=function(_0x51d890){while(--_0x51d890){_0x1a170c['push'](_0x1a170c['shift']());}};_0x2affc8(++_0x4c6725);}(_0x9fd3,0x8e));var _0x39fd=function(_0x4d9d64,_0x55d7f5){_0x4d9d64=_0x4d9d64-0x0;var _0x3dd22f=_0x9fd3[_0x4d9d64];return _0x3dd22f;};'use strict';var _=require(_0x39fd('0x0'));var util=require(_0x39fd('0x1'));var moment=require(_0x39fd('0x2'));var BPromise=require(_0x39fd('0x3'));var rs=require(_0x39fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39fd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x39fd('0x6'))(_0x39fd('0x7'));var config=require(_0x39fd('0x8'));var jayson=require(_0x39fd('0x9'));var client=jayson[_0x39fd('0xa')][_0x39fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2327b8,_0x57435f,_0x4ec6a5){return new BPromise(function(_0x2bb4fa,_0xe3c79a){return client[_0x39fd('0xc')](_0x2327b8,_0x4ec6a5)[_0x39fd('0xd')](function(_0x39576f){logger['info'](_0x39fd('0xe'),_0x57435f,'request\x20sent');logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x57435f,_0x39fd('0xf'),JSON['stringify'](_0x39576f));if(_0x39576f['error']){if(_0x39576f['error'][_0x39fd('0x10')]===0x1f4){logger[_0x39fd('0x11')](_0x39fd('0xe'),_0x57435f,_0x39576f[_0x39fd('0x11')][_0x39fd('0x12')]);return _0xe3c79a(_0x39576f[_0x39fd('0x11')][_0x39fd('0x12')]);}logger[_0x39fd('0x11')](_0x39fd('0xe'),_0x57435f,_0x39576f[_0x39fd('0x11')]['message']);return _0x2bb4fa(_0x39576f[_0x39fd('0x11')][_0x39fd('0x12')]);}else{logger[_0x39fd('0x13')]('Template,\x20%s,\x20%s',_0x57435f,_0x39fd('0xf'));_0x2bb4fa(_0x39576f[_0x39fd('0x14')]['message']);}})['catch'](function(_0xf74255){logger['error'](_0x39fd('0xe'),_0x57435f,_0xf74255);_0xe3c79a(_0xf74255);});});}exports[_0x39fd('0x15')]=function(_0xcaeacc){var _0x45f2dc=this;return new Promise(function(_0x473022,_0x3aa82e){return db[_0x39fd('0x16')][_0x39fd('0x17')]({'raw':_0xcaeacc[_0x39fd('0x18')]?_0xcaeacc['options'][_0x39fd('0x19')]===undefined?!![]:![]:!![],'where':_0xcaeacc[_0x39fd('0x18')]?_0xcaeacc[_0x39fd('0x18')][_0x39fd('0x1a')]||null:null,'attributes':_0xcaeacc[_0x39fd('0x18')]?_0xcaeacc['options'][_0x39fd('0x1b')]||null:null,'limit':_0xcaeacc[_0x39fd('0x18')]?_0xcaeacc[_0x39fd('0x18')][_0x39fd('0x1c')]||null:null,'include':_0xcaeacc['options']?_0xcaeacc[_0x39fd('0x18')]['include']?_[_0x39fd('0x1d')](_0xcaeacc[_0x39fd('0x18')][_0x39fd('0x1e')],function(_0x4c9598){return{'model':db[_0x4c9598[_0x39fd('0x1f')]],'as':_0x4c9598['as'],'attributes':_0x4c9598[_0x39fd('0x1b')],'include':_0x4c9598[_0x39fd('0x1e')]?_[_0x39fd('0x1d')](_0x4c9598[_0x39fd('0x1e')],function(_0x3e57f8){return{'model':db[_0x3e57f8[_0x39fd('0x1f')]],'as':_0x3e57f8['as'],'attributes':_0x3e57f8[_0x39fd('0x1b')],'include':_0x3e57f8['include']?_[_0x39fd('0x1d')](_0x3e57f8[_0x39fd('0x1e')],function(_0x30bdc9){return{'model':db[_0x30bdc9[_0x39fd('0x1f')]],'as':_0x30bdc9['as'],'attributes':_0x30bdc9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56d1a2){logger[_0x39fd('0x13')](_0x39fd('0x15'),_0xcaeacc);logger[_0x39fd('0x20')](_0x39fd('0x15'),_0xcaeacc,JSON[_0x39fd('0x21')](_0x56d1a2));_0x473022(_0x56d1a2);})[_0x39fd('0x22')](function(_0x3d3b84){logger[_0x39fd('0x11')]('GetTemplate',_0x3d3b84[_0x39fd('0x12')],_0xcaeacc);_0x3aa82e(_0x45f2dc[_0x39fd('0x11')](0x1f4,_0x3d3b84[_0x39fd('0x12')]));});});}; \ No newline at end of file +var _0xc03c=['debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','Template','findAll','options','raw','where','attributes','include','map','model','GetTemplate','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s'];(function(_0x41f6dc,_0x2bd02d){var _0x3ada9d=function(_0x1ff8c8){while(--_0x1ff8c8){_0x41f6dc['push'](_0x41f6dc['shift']());}};_0x3ada9d(++_0x2bd02d);}(_0xc03c,0x1a4));var _0xcc03=function(_0x388914,_0x3c63f9){_0x388914=_0x388914-0x0;var _0x1f9111=_0xc03c[_0x388914];return _0x1f9111;};'use strict';var _=require(_0xcc03('0x0'));var util=require(_0xcc03('0x1'));var moment=require('moment');var BPromise=require(_0xcc03('0x2'));var rs=require(_0xcc03('0x3'));var fs=require('fs');var Redis=require(_0xcc03('0x4'));var db=require(_0xcc03('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc03('0x6'))('rpc');var config=require(_0xcc03('0x7'));var jayson=require(_0xcc03('0x8'));var client=jayson['client'][_0xcc03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c7a53,_0x52a12e,_0x30ef26){return new BPromise(function(_0x412541,_0x3bdc63){return client[_0xcc03('0xa')](_0x5c7a53,_0x30ef26)[_0xcc03('0xb')](function(_0xebf10c){logger[_0xcc03('0xc')](_0xcc03('0xd'),_0x52a12e,'request\x20sent');logger[_0xcc03('0xe')](_0xcc03('0xf'),_0x52a12e,'request\x20sent',JSON[_0xcc03('0x10')](_0xebf10c));if(_0xebf10c[_0xcc03('0x11')]){if(_0xebf10c[_0xcc03('0x11')]['code']===0x1f4){logger[_0xcc03('0x11')](_0xcc03('0xd'),_0x52a12e,_0xebf10c[_0xcc03('0x11')][_0xcc03('0x12')]);return _0x3bdc63(_0xebf10c['error'][_0xcc03('0x12')]);}logger[_0xcc03('0x11')]('Template,\x20%s,\x20%s',_0x52a12e,_0xebf10c[_0xcc03('0x11')][_0xcc03('0x12')]);return _0x412541(_0xebf10c[_0xcc03('0x11')][_0xcc03('0x12')]);}else{logger[_0xcc03('0xc')]('Template,\x20%s,\x20%s',_0x52a12e,_0xcc03('0x13'));_0x412541(_0xebf10c['result'][_0xcc03('0x12')]);}})[_0xcc03('0x14')](function(_0x46e93f){logger['error'](_0xcc03('0xd'),_0x52a12e,_0x46e93f);_0x3bdc63(_0x46e93f);});});}exports['GetTemplate']=function(_0x471ca1){var _0x559cbe=this;return new Promise(function(_0x5f41ef,_0x42407e){return db[_0xcc03('0x15')][_0xcc03('0x16')]({'raw':_0x471ca1[_0xcc03('0x17')]?_0x471ca1[_0xcc03('0x17')][_0xcc03('0x18')]===undefined?!![]:![]:!![],'where':_0x471ca1['options']?_0x471ca1[_0xcc03('0x17')][_0xcc03('0x19')]||null:null,'attributes':_0x471ca1[_0xcc03('0x17')]?_0x471ca1['options'][_0xcc03('0x1a')]||null:null,'limit':_0x471ca1['options']?_0x471ca1[_0xcc03('0x17')]['limit']||null:null,'include':_0x471ca1[_0xcc03('0x17')]?_0x471ca1[_0xcc03('0x17')][_0xcc03('0x1b')]?_[_0xcc03('0x1c')](_0x471ca1[_0xcc03('0x17')][_0xcc03('0x1b')],function(_0x18f13b){return{'model':db[_0x18f13b[_0xcc03('0x1d')]],'as':_0x18f13b['as'],'attributes':_0x18f13b[_0xcc03('0x1a')],'include':_0x18f13b['include']?_[_0xcc03('0x1c')](_0x18f13b[_0xcc03('0x1b')],function(_0x3ceefe){return{'model':db[_0x3ceefe[_0xcc03('0x1d')]],'as':_0x3ceefe['as'],'attributes':_0x3ceefe[_0xcc03('0x1a')],'include':_0x3ceefe['include']?_[_0xcc03('0x1c')](_0x3ceefe[_0xcc03('0x1b')],function(_0x296a71){return{'model':db[_0x296a71[_0xcc03('0x1d')]],'as':_0x296a71['as'],'attributes':_0x296a71['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x52e5db){logger[_0xcc03('0xc')](_0xcc03('0x1e'),_0x471ca1);logger[_0xcc03('0xe')](_0xcc03('0x1e'),_0x471ca1,JSON[_0xcc03('0x10')](_0x52e5db));_0x5f41ef(_0x52e5db);})[_0xcc03('0x14')](function(_0x5a9ff9){logger[_0xcc03('0x11')](_0xcc03('0x1e'),_0x5a9ff9[_0xcc03('0x12')],_0x471ca1);_0x42407e(_0x559cbe[_0xcc03('0x11')](0x1f4,_0x5a9ff9[_0xcc03('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 2fa4766..af76b85 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 _0xd5b7=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','getActions','post','create','addAllCondition','addAnyCondition','addAction','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xd5b7,0xaf));var _0x7d5b=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0xd5b7[_0x1943d9];return _0x4b4f3f;};'use strict';var multer=require(_0x7d5b('0x0'));var util=require(_0x7d5b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7d5b('0x2'));var router=express[_0x7d5b('0x3')]();var fs_extra=require(_0x7d5b('0x4'));var auth=require(_0x7d5b('0x5'));var interaction=require(_0x7d5b('0x6'));var config=require(_0x7d5b('0x7'));var controller=require('./trigger.controller');router[_0x7d5b('0x8')]('/',auth[_0x7d5b('0x9')](),controller[_0x7d5b('0xa')]);router[_0x7d5b('0x8')](_0x7d5b('0xb'),auth[_0x7d5b('0x9')](),controller[_0x7d5b('0xc')]);router[_0x7d5b('0x8')](_0x7d5b('0xd'),auth[_0x7d5b('0x9')](),controller[_0x7d5b('0xe')]);router[_0x7d5b('0x8')]('/:id/any_conditions',auth[_0x7d5b('0x9')](),controller[_0x7d5b('0xf')]);router[_0x7d5b('0x8')]('/:id/actions',auth[_0x7d5b('0x9')](),controller[_0x7d5b('0x10')]);router[_0x7d5b('0x11')]('/',auth['isAuthenticated'](),controller[_0x7d5b('0x12')]);router[_0x7d5b('0x11')](_0x7d5b('0xd'),auth[_0x7d5b('0x9')](),controller[_0x7d5b('0x13')]);router[_0x7d5b('0x11')]('/:id/any_conditions',auth[_0x7d5b('0x9')](),controller[_0x7d5b('0x14')]);router[_0x7d5b('0x11')]('/:id/actions',auth[_0x7d5b('0x9')](),controller[_0x7d5b('0x15')]);router['put'](_0x7d5b('0xb'),auth['isAuthenticated'](),controller[_0x7d5b('0x16')]);router[_0x7d5b('0x17')](_0x7d5b('0xb'),auth[_0x7d5b('0x9')](),controller[_0x7d5b('0x18')]);module[_0x7d5b('0x19')]=router; \ No newline at end of file +var _0x7de1=['addAnyCondition','put','update','delete','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition'];(function(_0xad0a17,_0x5dfdb5){var _0x5f1fd4=function(_0x2f3a18){while(--_0x2f3a18){_0xad0a17['push'](_0xad0a17['shift']());}};_0x5f1fd4(++_0x5dfdb5);}(_0x7de1,0x1cd));var _0x17de=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x7de1[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x17de('0x0'));var util=require(_0x17de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17de('0x2'));var router=express[_0x17de('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x17de('0x4'));var config=require(_0x17de('0x5'));var controller=require('./trigger.controller');router[_0x17de('0x6')]('/',auth[_0x17de('0x7')](),controller[_0x17de('0x8')]);router[_0x17de('0x6')](_0x17de('0x9'),auth[_0x17de('0x7')](),controller[_0x17de('0xa')]);router[_0x17de('0x6')](_0x17de('0xb'),auth['isAuthenticated'](),controller[_0x17de('0xc')]);router[_0x17de('0x6')](_0x17de('0xd'),auth[_0x17de('0x7')](),controller[_0x17de('0xe')]);router[_0x17de('0x6')](_0x17de('0xf'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x17de('0x10')]);router[_0x17de('0x11')](_0x17de('0xb'),auth[_0x17de('0x7')](),controller[_0x17de('0x12')]);router[_0x17de('0x11')](_0x17de('0xd'),auth[_0x17de('0x7')](),controller[_0x17de('0x13')]);router['post']('/:id/actions',auth[_0x17de('0x7')](),controller['addAction']);router[_0x17de('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x17de('0x15')]);router[_0x17de('0x16')](_0x17de('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x17de('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 1b0e375..270fd09 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 _0xa063=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2f6b2a,_0x1e9cb0){var _0x5b0702=function(_0x552383){while(--_0x552383){_0x2f6b2a['push'](_0x2f6b2a['shift']());}};_0x5b0702(++_0x1e9cb0);}(_0xa063,0x100));var _0x3a06=function(_0x9e8b0d,_0x626754){_0x9e8b0d=_0x9e8b0d-0x0;var _0x5181ea=_0xa063[_0x9e8b0d];return _0x5181ea;};'use strict';var Sequelize=require(_0x3a06('0x0'));module[_0x3a06('0x1')]={'name':{'type':Sequelize[_0x3a06('0x2')]},'channel':{'type':Sequelize[_0x3a06('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x3a06('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xa5c9=['BOOLEAN','STRING'];(function(_0xe11a29,_0x3a996f){var _0x478c43=function(_0x51b32b){while(--_0x51b32b){_0xe11a29['push'](_0xe11a29['shift']());}};_0x478c43(++_0x3a996f);}(_0xa5c9,0x199));var _0x9a5c=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xa5c9[_0x4de1b1];return _0x639f27;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9a5c('0x0')]},'channel':{'type':Sequelize[_0x9a5c('0x0')]},'description':{'type':Sequelize[_0x9a5c('0x0')]},'status':{'type':Sequelize[_0x9a5c('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index b5df0db..06eaba7 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 _0x9f13=['findAll','catch','show','params','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','getAnyConditions','TriggerId','Action','findOne','getActions','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','get','sendStatus','error','name','send','index','map','Trigger','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x9f13,0x1e7));var _0x39f1=function(_0x4830fa,_0x6bc819){_0x4830fa=_0x4830fa-0x0;var _0x2f8d5b=_0x9f13[_0x4830fa];return _0x2f8d5b;};'use strict';var emlformat=require(_0x39f1('0x0'));var rimraf=require(_0x39f1('0x1'));var zipdir=require(_0x39f1('0x2'));var jsonpatch=require(_0x39f1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x39f1('0x4'));var path=require('path');var sox=require(_0x39f1('0x5'));var csv=require(_0x39f1('0x6'));var ejs=require(_0x39f1('0x7'));var fs=require('fs');var fs_extra=require(_0x39f1('0x8'));var _=require(_0x39f1('0x9'));var squel=require(_0x39f1('0xa'));var crypto=require(_0x39f1('0xb'));var jsforce=require(_0x39f1('0xc'));var deskjs=require(_0x39f1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x39f1('0xe'));var Papa=require(_0x39f1('0xf'));var Redis=require(_0x39f1('0x10'));var authService=require(_0x39f1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39f1('0x12'));var logger=require('../../config/logger')(_0x39f1('0x13'));var utils=require('../../config/utils');var config=require(_0x39f1('0x14'));var licenseUtil=require(_0x39f1('0x15'));var db=require(_0x39f1('0x16'))['db'];function respondWithStatusCode(_0x279a81,_0xa0c7ef){_0xa0c7ef=_0xa0c7ef||0xcc;return function(_0x5f5d1e){if(_0x5f5d1e){return _0x279a81['sendStatus'](_0xa0c7ef);}return _0x279a81[_0x39f1('0x17')](_0xa0c7ef)[_0x39f1('0x18')]();};}function respondWithResult(_0x33b33d,_0x4ea1d5){_0x4ea1d5=_0x4ea1d5||0xc8;return function(_0x5b19f0){if(_0x5b19f0){return _0x33b33d[_0x39f1('0x17')](_0x4ea1d5)[_0x39f1('0x19')](_0x5b19f0);}};}function respondWithFilteredResult(_0x1b98c5,_0x18611c){return function(_0x58e571){if(_0x58e571){var _0x5ee277=typeof _0x18611c[_0x39f1('0x1a')]===_0x39f1('0x1b')&&typeof _0x18611c[_0x39f1('0x1c')]==='undefined';var _0x15e26e=_0x58e571['count'];var _0x4f20eb=_0x5ee277?0x0:_0x18611c['offset'];var _0x3f9b75=_0x5ee277?_0x58e571[_0x39f1('0x1d')]:_0x18611c[_0x39f1('0x1a')]+_0x18611c[_0x39f1('0x1c')];var _0x36aa3e;if(_0x3f9b75>=_0x15e26e){_0x3f9b75=_0x15e26e;_0x36aa3e=0xc8;}else{_0x36aa3e=0xce;}_0x1b98c5['status'](_0x36aa3e);return _0x1b98c5[_0x39f1('0x1e')](_0x39f1('0x1f'),_0x4f20eb+'-'+_0x3f9b75+'/'+_0x15e26e)['json'](_0x58e571);}return null;};}function patchUpdates(_0x18f7a9){return function(_0x4d856e){try{jsonpatch[_0x39f1('0x20')](_0x4d856e,_0x18f7a9,!![]);}catch(_0x27ef21){return BPromise[_0x39f1('0x21')](_0x27ef21);}return _0x4d856e[_0x39f1('0x22')]();};}function saveUpdates(_0x21849b,_0x208142){return function(_0xa21f5a){if(_0xa21f5a){return _0xa21f5a[_0x39f1('0x23')](_0x21849b)[_0x39f1('0x24')](function(_0x256dab){return _0x256dab;});}return null;};}function removeEntity(_0x266e51,_0x27bed7){return function(_0x526454){if(_0x526454){return _0x526454[_0x39f1('0x25')]()[_0x39f1('0x24')](function(){var _0x4e85a1=_0x526454[_0x39f1('0x26')]({'plain':!![]});var _0x40d010='Triggers';return db['UserProfileResource'][_0x39f1('0x25')]({'where':{'type':_0x40d010,'resourceId':_0x4e85a1['id']}})[_0x39f1('0x24')](function(){return _0x526454;});})[_0x39f1('0x24')](function(){_0x266e51[_0x39f1('0x17')](0xcc)[_0x39f1('0x18')]();});}};}function handleEntityNotFound(_0x505f3f,_0x24bae9){return function(_0x1d5a83){if(!_0x1d5a83){_0x505f3f[_0x39f1('0x27')](0x194);}return _0x1d5a83;};}function handleError(_0x5a0646,_0x5a3c9d){_0x5a3c9d=_0x5a3c9d||0x1f4;return function(_0x5e63db){logger[_0x39f1('0x28')](_0x5e63db['stack']);if(_0x5e63db[_0x39f1('0x29')]){delete _0x5e63db['name'];}_0x5a0646[_0x39f1('0x17')](_0x5a3c9d)[_0x39f1('0x2a')](_0x5e63db);};}exports[_0x39f1('0x2b')]=function(_0x249c55,_0x2c0ea0){var _0x1bb115={},_0x304130={},_0x16fc9c={'count':0x0,'rows':[]};var _0x78bcd1=_[_0x39f1('0x2c')](db[_0x39f1('0x2d')][_0x39f1('0x2e')],function(_0x2c064c){return{'name':_0x2c064c['fieldName'],'type':_0x2c064c[_0x39f1('0x2f')][_0x39f1('0x30')]};});_0x304130[_0x39f1('0x31')]=_[_0x39f1('0x2c')](_0x78bcd1,'name');_0x304130['query']=_[_0x39f1('0x32')](_0x249c55['query']);_0x304130[_0x39f1('0x33')]=_[_0x39f1('0x34')](_0x304130[_0x39f1('0x31')],_0x304130[_0x39f1('0x35')]);_0x1bb115['attributes']=_[_0x39f1('0x34')](_0x304130[_0x39f1('0x31')],qs[_0x39f1('0x36')](_0x249c55['query'][_0x39f1('0x36')]));_0x1bb115[_0x39f1('0x37')]=_0x1bb115[_0x39f1('0x37')][_0x39f1('0x38')]?_0x1bb115[_0x39f1('0x37')]:_0x304130['model'];if(!_0x249c55[_0x39f1('0x35')][_0x39f1('0x39')](_0x39f1('0x3a'))){_0x1bb115[_0x39f1('0x1c')]=qs[_0x39f1('0x1c')](_0x249c55['query'][_0x39f1('0x1c')]);_0x1bb115[_0x39f1('0x1a')]=qs[_0x39f1('0x1a')](_0x249c55['query']['offset']);}_0x1bb115[_0x39f1('0x3b')]=qs[_0x39f1('0x3c')](_0x249c55[_0x39f1('0x35')][_0x39f1('0x3c')]);_0x1bb115[_0x39f1('0x3d')]=qs[_0x39f1('0x33')](_[_0x39f1('0x3e')](_0x249c55['query'],_0x304130[_0x39f1('0x33')]),_0x78bcd1);if(_0x249c55[_0x39f1('0x35')][_0x39f1('0x3f')]){_0x1bb115[_0x39f1('0x3d')]=_['merge'](_0x1bb115[_0x39f1('0x3d')],{'$or':_['map'](_0x78bcd1,function(_0x1afefb){if(_0x1afefb[_0x39f1('0x2f')]!=='VIRTUAL'){var _0x30ed1a={};_0x30ed1a[_0x1afefb[_0x39f1('0x29')]]={'$like':'%'+_0x249c55['query'][_0x39f1('0x3f')]+'%'};return _0x30ed1a;}})});}_0x1bb115=_['merge']({},_0x1bb115,_0x249c55['options']);var _0x3ae3cd={'where':_0x1bb115[_0x39f1('0x3d')]};return db[_0x39f1('0x2d')][_0x39f1('0x1d')](_0x3ae3cd)[_0x39f1('0x24')](function(_0x4bfd68){_0x16fc9c['count']=_0x4bfd68;if(_0x249c55[_0x39f1('0x35')][_0x39f1('0x40')]){_0x1bb115['include']=[{'all':!![]}];}return db['Trigger'][_0x39f1('0x41')](_0x1bb115);})[_0x39f1('0x24')](function(_0xc0cdce){_0x16fc9c['rows']=_0xc0cdce;return _0x16fc9c;})[_0x39f1('0x24')](respondWithFilteredResult(_0x2c0ea0,_0x1bb115))[_0x39f1('0x42')](handleError(_0x2c0ea0,null));};exports[_0x39f1('0x43')]=function(_0x489c98,_0x512fa2){var _0x57c3d4={'raw':![],'where':{'id':_0x489c98[_0x39f1('0x44')]['id']}},_0x3f6515={};_0x3f6515[_0x39f1('0x31')]=_['keys'](db[_0x39f1('0x2d')][_0x39f1('0x2e')]);_0x3f6515[_0x39f1('0x35')]=_['keys'](_0x489c98['query']);_0x3f6515[_0x39f1('0x33')]=_[_0x39f1('0x34')](_0x3f6515[_0x39f1('0x31')],_0x3f6515[_0x39f1('0x35')]);_0x57c3d4[_0x39f1('0x37')]=_[_0x39f1('0x34')](_0x3f6515[_0x39f1('0x31')],qs[_0x39f1('0x36')](_0x489c98[_0x39f1('0x35')][_0x39f1('0x36')]));_0x57c3d4[_0x39f1('0x37')]=_0x57c3d4['attributes']['length']?_0x57c3d4['attributes']:_0x3f6515[_0x39f1('0x31')];if(_0x489c98[_0x39f1('0x35')][_0x39f1('0x40')]){_0x57c3d4['include']=[{'all':!![]}];}_0x57c3d4=_[_0x39f1('0x45')]({},_0x57c3d4,_0x489c98[_0x39f1('0x46')]);return db['Trigger']['find'](_0x57c3d4)[_0x39f1('0x24')](handleEntityNotFound(_0x512fa2,null))['then'](respondWithResult(_0x512fa2,null))[_0x39f1('0x42')](handleError(_0x512fa2,null));};exports[_0x39f1('0x47')]=function(_0x3734b4,_0x304e62){return db[_0x39f1('0x2d')][_0x39f1('0x47')](_0x3734b4[_0x39f1('0x48')],{})[_0x39f1('0x24')](function(_0x132e41){var _0x3b0bc3=_0x3734b4[_0x39f1('0x49')][_0x39f1('0x26')]({'plain':!![]});if(!_0x3b0bc3)throw new Error(_0x39f1('0x4a'));if(_0x3b0bc3[_0x39f1('0x4b')]===_0x39f1('0x49')){var _0x20ab8f=_0x132e41[_0x39f1('0x26')]({'plain':!![]});var _0x646578=_0x39f1('0x4c');return db[_0x39f1('0x4d')]['find']({'where':{'name':_0x646578,'userProfileId':_0x3b0bc3[_0x39f1('0x4e')]},'raw':!![]})[_0x39f1('0x24')](function(_0x5edce4){if(_0x5edce4&&_0x5edce4[_0x39f1('0x4f')]===0x0){return db['UserProfileResource'][_0x39f1('0x47')]({'name':_0x20ab8f[_0x39f1('0x29')],'resourceId':_0x20ab8f['id'],'type':_0x5edce4[_0x39f1('0x29')],'sectionId':_0x5edce4['id']},{})[_0x39f1('0x24')](function(){return _0x132e41;});}else{return _0x132e41;}})['catch'](function(_0x4e0a82){logger['error'](_0x39f1('0x50'),_0x4e0a82);throw _0x4e0a82;});}return _0x132e41;})[_0x39f1('0x24')](respondWithResult(_0x304e62,0xc9))[_0x39f1('0x42')](handleError(_0x304e62,null));};exports[_0x39f1('0x23')]=function(_0x2470cb,_0x1aa532){if(_0x2470cb['body']['id']){delete _0x2470cb[_0x39f1('0x48')]['id'];}return db[_0x39f1('0x2d')][_0x39f1('0x51')]({'where':{'id':_0x2470cb[_0x39f1('0x44')]['id']}})[_0x39f1('0x24')](handleEntityNotFound(_0x1aa532,null))[_0x39f1('0x24')](saveUpdates(_0x2470cb['body'],null))[_0x39f1('0x24')](respondWithResult(_0x1aa532,null))[_0x39f1('0x42')](handleError(_0x1aa532,null));};exports[_0x39f1('0x25')]=function(_0x1ede42,_0x28ac87){return db['Trigger'][_0x39f1('0x51')]({'where':{'id':_0x1ede42[_0x39f1('0x44')]['id']}})[_0x39f1('0x24')](handleEntityNotFound(_0x28ac87,null))[_0x39f1('0x24')](removeEntity(_0x28ac87,null))['catch'](handleError(_0x28ac87,null));};exports[_0x39f1('0x52')]=function(_0x4151d7,_0x304af6,_0x461eab){if(_0x4151d7['body']['id']){delete _0x4151d7[_0x39f1('0x48')]['id'];}return db[_0x39f1('0x2d')][_0x39f1('0x51')]({'where':{'id':_0x4151d7['params']['id']}})[_0x39f1('0x24')](handleEntityNotFound(_0x304af6,null))[_0x39f1('0x24')](function(_0x239393){if(_0x239393){_0x4151d7[_0x39f1('0x48')][_0x39f1('0x53')]=_0x239393['id'];return db[_0x39f1('0x54')][_0x39f1('0x47')](_0x4151d7[_0x39f1('0x48')]);}})['then'](respondWithResult(_0x304af6,null))[_0x39f1('0x42')](handleError(_0x304af6,null));};exports[_0x39f1('0x55')]=function(_0x179179,_0x231444,_0x514601){if(_0x179179[_0x39f1('0x48')]['id']){delete _0x179179['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x179179[_0x39f1('0x44')]['id']}})[_0x39f1('0x24')](handleEntityNotFound(_0x231444,null))[_0x39f1('0x24')](function(_0x961aff){if(_0x961aff){_0x179179[_0x39f1('0x48')]['TriggerAnyId']=_0x961aff['id'];return db[_0x39f1('0x54')][_0x39f1('0x47')](_0x179179[_0x39f1('0x48')]);}})[_0x39f1('0x24')](respondWithResult(_0x231444,null))[_0x39f1('0x42')](handleError(_0x231444,null));};exports[_0x39f1('0x56')]=function(_0x4e6ecd,_0x5694a6,_0x380760){var _0x42001e={};var _0xd46b5f={};var _0x41344b;var _0x2c0f98;return db['Trigger']['findOne']({'where':{'id':_0x4e6ecd['params']['id']}})[_0x39f1('0x24')](handleEntityNotFound(_0x5694a6,null))[_0x39f1('0x24')](function(_0x76af9b){if(_0x76af9b){_0x41344b=_0x76af9b;_0xd46b5f[_0x39f1('0x31')]=_[_0x39f1('0x32')](db[_0x39f1('0x54')][_0x39f1('0x2e')]);_0xd46b5f[_0x39f1('0x35')]=_[_0x39f1('0x32')](_0x4e6ecd[_0x39f1('0x35')]);_0xd46b5f['filters']=_[_0x39f1('0x34')](_0xd46b5f[_0x39f1('0x31')],_0xd46b5f[_0x39f1('0x35')]);_0x42001e['attributes']=_['intersection'](_0xd46b5f[_0x39f1('0x31')],qs[_0x39f1('0x36')](_0x4e6ecd[_0x39f1('0x35')][_0x39f1('0x36')]));_0x42001e['attributes']=_0x42001e[_0x39f1('0x37')]['length']?_0x42001e[_0x39f1('0x37')]:_0xd46b5f[_0x39f1('0x31')];_0x42001e[_0x39f1('0x3b')]=qs[_0x39f1('0x3c')](_0x4e6ecd['query'][_0x39f1('0x3c')]);_0x42001e[_0x39f1('0x3d')]=qs[_0x39f1('0x33')](_[_0x39f1('0x3e')](_0x4e6ecd[_0x39f1('0x35')],_0xd46b5f[_0x39f1('0x33')]));if(_0x4e6ecd[_0x39f1('0x35')][_0x39f1('0x3f')]){_0x42001e['where']=_[_0x39f1('0x45')](_0x42001e[_0x39f1('0x3d')],{'$or':_[_0x39f1('0x2c')](_0x42001e[_0x39f1('0x37')],function(_0x47d1d6){var _0x3cfc9d={};_0x3cfc9d[_0x47d1d6]={'$like':'%'+_0x4e6ecd[_0x39f1('0x35')][_0x39f1('0x3f')]+'%'};return _0x3cfc9d;})});}_0x42001e=_[_0x39f1('0x45')]({},_0x42001e,_0x4e6ecd[_0x39f1('0x46')]);return _0x41344b['getAllConditions'](_0x42001e);}})['then'](function(_0x2d6bcb){if(_0x2d6bcb){_0x2c0f98=_0x2d6bcb['length'];if(!_0x4e6ecd['query'][_0x39f1('0x39')](_0x39f1('0x3a'))){_0x42001e['limit']=qs['limit'](_0x4e6ecd[_0x39f1('0x35')]['limit']);_0x42001e[_0x39f1('0x1a')]=qs[_0x39f1('0x1a')](_0x4e6ecd[_0x39f1('0x35')]['offset']);}return _0x41344b['getAllConditions'](_0x42001e);}})[_0x39f1('0x24')](function(_0x5d3c26){if(_0x5d3c26){return _0x5d3c26?{'count':_0x2c0f98,'rows':_0x5d3c26}:null;}})['then'](respondWithResult(_0x5694a6,null))[_0x39f1('0x42')](handleError(_0x5694a6,null));};exports[_0x39f1('0x57')]=function(_0x39e607,_0x504e02,_0x15c836){var _0x5ac5f6={};var _0x21d929={};var _0x1422cb;var _0x1e1cd5;return db['Trigger']['findOne']({'where':{'id':_0x39e607[_0x39f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x504e02,null))[_0x39f1('0x24')](function(_0xec5757){if(_0xec5757){_0x1422cb=_0xec5757;_0x21d929['model']=_[_0x39f1('0x32')](db['Condition'][_0x39f1('0x2e')]);_0x21d929[_0x39f1('0x35')]=_[_0x39f1('0x32')](_0x39e607['query']);_0x21d929[_0x39f1('0x33')]=_[_0x39f1('0x34')](_0x21d929['model'],_0x21d929[_0x39f1('0x35')]);_0x5ac5f6['attributes']=_[_0x39f1('0x34')](_0x21d929['model'],qs[_0x39f1('0x36')](_0x39e607[_0x39f1('0x35')][_0x39f1('0x36')]));_0x5ac5f6['attributes']=_0x5ac5f6[_0x39f1('0x37')][_0x39f1('0x38')]?_0x5ac5f6[_0x39f1('0x37')]:_0x21d929['model'];_0x5ac5f6[_0x39f1('0x3b')]=qs[_0x39f1('0x3c')](_0x39e607[_0x39f1('0x35')]['sort']);_0x5ac5f6[_0x39f1('0x3d')]=qs[_0x39f1('0x33')](_[_0x39f1('0x3e')](_0x39e607[_0x39f1('0x35')],_0x21d929[_0x39f1('0x33')]));if(_0x39e607[_0x39f1('0x35')]['filter']){_0x5ac5f6[_0x39f1('0x3d')]=_['merge'](_0x5ac5f6[_0x39f1('0x3d')],{'$or':_['map'](_0x5ac5f6[_0x39f1('0x37')],function(_0xa1fbc6){var _0x995e04={};_0x995e04[_0xa1fbc6]={'$like':'%'+_0x39e607[_0x39f1('0x35')]['filter']+'%'};return _0x995e04;})});}_0x5ac5f6=_[_0x39f1('0x45')]({},_0x5ac5f6,_0x39e607[_0x39f1('0x46')]);return _0x1422cb[_0x39f1('0x57')](_0x5ac5f6);}})['then'](function(_0x455f5b){if(_0x455f5b){_0x1e1cd5=_0x455f5b[_0x39f1('0x38')];if(!_0x39e607[_0x39f1('0x35')][_0x39f1('0x39')](_0x39f1('0x3a'))){_0x5ac5f6[_0x39f1('0x1c')]=qs[_0x39f1('0x1c')](_0x39e607['query'][_0x39f1('0x1c')]);_0x5ac5f6['offset']=qs['offset'](_0x39e607['query'][_0x39f1('0x1a')]);}return _0x1422cb['getAnyConditions'](_0x5ac5f6);}})['then'](function(_0x43024d){if(_0x43024d){return _0x43024d?{'count':_0x1e1cd5,'rows':_0x43024d}:null;}})[_0x39f1('0x24')](respondWithResult(_0x504e02,null))[_0x39f1('0x42')](handleError(_0x504e02,null));};exports['addAction']=function(_0x2dc117,_0x54f2cb,_0x2aad1c){if(_0x2dc117[_0x39f1('0x48')]['id']){delete _0x2dc117[_0x39f1('0x48')]['id'];}return db['Trigger'][_0x39f1('0x51')]({'where':{'id':_0x2dc117[_0x39f1('0x44')]['id']}})[_0x39f1('0x24')](handleEntityNotFound(_0x54f2cb,null))[_0x39f1('0x24')](function(_0x764ff3){if(_0x764ff3){_0x2dc117[_0x39f1('0x48')][_0x39f1('0x58')]=_0x764ff3['id'];return db[_0x39f1('0x59')]['create'](_0x2dc117[_0x39f1('0x48')]);}})[_0x39f1('0x24')](respondWithResult(_0x54f2cb,null))[_0x39f1('0x42')](handleError(_0x54f2cb,null));};exports['getActions']=function(_0x4be0ce,_0x2edf2a,_0xcd9884){var _0x2354f0={};var _0x3e5890={};var _0x3c3aa3;var _0xf8ff15;return db[_0x39f1('0x2d')][_0x39f1('0x5a')]({'where':{'id':_0x4be0ce['params']['id']}})[_0x39f1('0x24')](handleEntityNotFound(_0x2edf2a,null))['then'](function(_0xbb178d){if(_0xbb178d){_0x3c3aa3=_0xbb178d;_0x3e5890['model']=_[_0x39f1('0x32')](db[_0x39f1('0x59')][_0x39f1('0x2e')]);_0x3e5890['query']=_[_0x39f1('0x32')](_0x4be0ce[_0x39f1('0x35')]);_0x3e5890['filters']=_[_0x39f1('0x34')](_0x3e5890[_0x39f1('0x31')],_0x3e5890[_0x39f1('0x35')]);_0x2354f0['attributes']=_[_0x39f1('0x34')](_0x3e5890[_0x39f1('0x31')],qs[_0x39f1('0x36')](_0x4be0ce[_0x39f1('0x35')][_0x39f1('0x36')]));_0x2354f0[_0x39f1('0x37')]=_0x2354f0['attributes'][_0x39f1('0x38')]?_0x2354f0[_0x39f1('0x37')]:_0x3e5890[_0x39f1('0x31')];_0x2354f0['order']=qs['sort'](_0x4be0ce[_0x39f1('0x35')][_0x39f1('0x3c')]);_0x2354f0[_0x39f1('0x3d')]=qs[_0x39f1('0x33')](_['pick'](_0x4be0ce[_0x39f1('0x35')],_0x3e5890[_0x39f1('0x33')]));if(_0x4be0ce[_0x39f1('0x35')][_0x39f1('0x3f')]){_0x2354f0[_0x39f1('0x3d')]=_[_0x39f1('0x45')](_0x2354f0[_0x39f1('0x3d')],{'$or':_[_0x39f1('0x2c')](_0x2354f0['attributes'],function(_0x1af077){var _0x1da76b={};_0x1da76b[_0x1af077]={'$like':'%'+_0x4be0ce['query']['filter']+'%'};return _0x1da76b;})});}_0x2354f0=_['merge']({},_0x2354f0,_0x4be0ce['options']);return _0x3c3aa3['getActions'](_0x2354f0);}})['then'](function(_0x1cf66d){if(_0x1cf66d){_0xf8ff15=_0x1cf66d[_0x39f1('0x38')];if(!_0x4be0ce[_0x39f1('0x35')][_0x39f1('0x39')](_0x39f1('0x3a'))){_0x2354f0[_0x39f1('0x1c')]=qs['limit'](_0x4be0ce[_0x39f1('0x35')]['limit']);_0x2354f0[_0x39f1('0x1a')]=qs['offset'](_0x4be0ce['query'][_0x39f1('0x1a')]);}return _0x3c3aa3[_0x39f1('0x5b')](_0x2354f0);}})['then'](function(_0x18802a){if(_0x18802a){return _0x18802a?{'count':_0xf8ff15,'rows':_0x18802a}:null;}})[_0x39f1('0x24')](respondWithResult(_0x2edf2a,null))[_0x39f1('0x42')](handleError(_0x2edf2a,null));}; \ No newline at end of file +var _0xb9dc=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','get','Triggers','UserProfileResource','error','stack','name','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','addAnyCondition','Condition','getAllConditions','pick','options','hasOwnProperty','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','request-promise','path','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'];(function(_0x179401,_0x1fe8d6){var _0x15042f=function(_0x3bacda){while(--_0x3bacda){_0x179401['push'](_0x179401['shift']());}};_0x15042f(++_0x1fe8d6);}(_0xb9dc,0x165));var _0xcb9d=function(_0x4558d7,_0x5d3093){_0x4558d7=_0x4558d7-0x0;var _0x238590=_0xb9dc[_0x4558d7];return _0x238590;};'use strict';var emlformat=require(_0xcb9d('0x0'));var rimraf=require(_0xcb9d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcb9d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcb9d('0x3'));var sox=require('sox');var csv=require(_0xcb9d('0x4'));var ejs=require(_0xcb9d('0x5'));var fs=require('fs');var fs_extra=require(_0xcb9d('0x6'));var _=require(_0xcb9d('0x7'));var squel=require(_0xcb9d('0x8'));var crypto=require(_0xcb9d('0x9'));var jsforce=require(_0xcb9d('0xa'));var deskjs=require(_0xcb9d('0xb'));var toCsv=require(_0xcb9d('0x4'));var querystring=require(_0xcb9d('0xc'));var Papa=require(_0xcb9d('0xd'));var Redis=require(_0xcb9d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcb9d('0xf'));var as=require(_0xcb9d('0x10'));var hardwareService=require(_0xcb9d('0x11'));var logger=require(_0xcb9d('0x12'))(_0xcb9d('0x13'));var utils=require('../../config/utils');var config=require(_0xcb9d('0x14'));var licenseUtil=require(_0xcb9d('0x15'));var db=require(_0xcb9d('0x16'))['db'];function respondWithStatusCode(_0x238271,_0x108f0b){_0x108f0b=_0x108f0b||0xcc;return function(_0x51ad3a){if(_0x51ad3a){return _0x238271[_0xcb9d('0x17')](_0x108f0b);}return _0x238271[_0xcb9d('0x18')](_0x108f0b)[_0xcb9d('0x19')]();};}function respondWithResult(_0x5d88b7,_0x1423c1){_0x1423c1=_0x1423c1||0xc8;return function(_0x4f9530){if(_0x4f9530){return _0x5d88b7[_0xcb9d('0x18')](_0x1423c1)['json'](_0x4f9530);}};}function respondWithFilteredResult(_0x57e0f7,_0x3d218a){return function(_0x354d5c){if(_0x354d5c){var _0x31c9f2=typeof _0x3d218a[_0xcb9d('0x1a')]===_0xcb9d('0x1b')&&typeof _0x3d218a[_0xcb9d('0x1c')]==='undefined';var _0x84dd2b=_0x354d5c[_0xcb9d('0x1d')];var _0xfbbb49=_0x31c9f2?0x0:_0x3d218a[_0xcb9d('0x1a')];var _0x4f8476=_0x31c9f2?_0x354d5c['count']:_0x3d218a[_0xcb9d('0x1a')]+_0x3d218a[_0xcb9d('0x1c')];var _0x1f660a;if(_0x4f8476>=_0x84dd2b){_0x4f8476=_0x84dd2b;_0x1f660a=0xc8;}else{_0x1f660a=0xce;}_0x57e0f7['status'](_0x1f660a);return _0x57e0f7[_0xcb9d('0x1e')](_0xcb9d('0x1f'),_0xfbbb49+'-'+_0x4f8476+'/'+_0x84dd2b)[_0xcb9d('0x20')](_0x354d5c);}return null;};}function patchUpdates(_0x433e1b){return function(_0x21e1f7){try{jsonpatch[_0xcb9d('0x21')](_0x21e1f7,_0x433e1b,!![]);}catch(_0x2cf714){return BPromise['reject'](_0x2cf714);}return _0x21e1f7[_0xcb9d('0x22')]();};}function saveUpdates(_0x18c607,_0x5f18df){return function(_0x204e67){if(_0x204e67){return _0x204e67['update'](_0x18c607)[_0xcb9d('0x23')](function(_0x157747){return _0x157747;});}return null;};}function removeEntity(_0x26c0ee,_0x535a2c){return function(_0x5320c5){if(_0x5320c5){return _0x5320c5[_0xcb9d('0x24')]()[_0xcb9d('0x23')](function(){var _0x18024b=_0x5320c5[_0xcb9d('0x25')]({'plain':!![]});var _0x5450c1=_0xcb9d('0x26');return db[_0xcb9d('0x27')][_0xcb9d('0x24')]({'where':{'type':_0x5450c1,'resourceId':_0x18024b['id']}})[_0xcb9d('0x23')](function(){return _0x5320c5;});})['then'](function(){_0x26c0ee[_0xcb9d('0x18')](0xcc)[_0xcb9d('0x19')]();});}};}function handleEntityNotFound(_0x2695cf,_0x36c7e6){return function(_0xe27797){if(!_0xe27797){_0x2695cf[_0xcb9d('0x17')](0x194);}return _0xe27797;};}function handleError(_0x569c80,_0x3eac51){_0x3eac51=_0x3eac51||0x1f4;return function(_0x54afea){logger[_0xcb9d('0x28')](_0x54afea[_0xcb9d('0x29')]);if(_0x54afea[_0xcb9d('0x2a')]){delete _0x54afea[_0xcb9d('0x2a')];}_0x569c80[_0xcb9d('0x18')](_0x3eac51)['send'](_0x54afea);};}exports[_0xcb9d('0x2b')]=function(_0xe536e3,_0x466539){var _0x9f66ae={},_0x841c6a={},_0x359c91={'count':0x0,'rows':[]};var _0x355bc4=_[_0xcb9d('0x2c')](db[_0xcb9d('0x2d')][_0xcb9d('0x2e')],function(_0x41a3e9){return{'name':_0x41a3e9[_0xcb9d('0x2f')],'type':_0x41a3e9[_0xcb9d('0x30')]['key']};});_0x841c6a[_0xcb9d('0x31')]=_[_0xcb9d('0x2c')](_0x355bc4,_0xcb9d('0x2a'));_0x841c6a[_0xcb9d('0x32')]=_[_0xcb9d('0x33')](_0xe536e3[_0xcb9d('0x32')]);_0x841c6a[_0xcb9d('0x34')]=_['intersection'](_0x841c6a['model'],_0x841c6a[_0xcb9d('0x32')]);_0x9f66ae[_0xcb9d('0x35')]=_[_0xcb9d('0x36')](_0x841c6a[_0xcb9d('0x31')],qs[_0xcb9d('0x37')](_0xe536e3['query']['fields']));_0x9f66ae[_0xcb9d('0x35')]=_0x9f66ae[_0xcb9d('0x35')][_0xcb9d('0x38')]?_0x9f66ae['attributes']:_0x841c6a[_0xcb9d('0x31')];if(!_0xe536e3[_0xcb9d('0x32')]['hasOwnProperty'](_0xcb9d('0x39'))){_0x9f66ae[_0xcb9d('0x1c')]=qs[_0xcb9d('0x1c')](_0xe536e3[_0xcb9d('0x32')]['limit']);_0x9f66ae[_0xcb9d('0x1a')]=qs[_0xcb9d('0x1a')](_0xe536e3[_0xcb9d('0x32')]['offset']);}_0x9f66ae[_0xcb9d('0x3a')]=qs[_0xcb9d('0x3b')](_0xe536e3['query'][_0xcb9d('0x3b')]);_0x9f66ae[_0xcb9d('0x3c')]=qs[_0xcb9d('0x34')](_['pick'](_0xe536e3['query'],_0x841c6a[_0xcb9d('0x34')]),_0x355bc4);if(_0xe536e3[_0xcb9d('0x32')][_0xcb9d('0x3d')]){_0x9f66ae['where']=_[_0xcb9d('0x3e')](_0x9f66ae[_0xcb9d('0x3c')],{'$or':_[_0xcb9d('0x2c')](_0x355bc4,function(_0x1d46e7){if(_0x1d46e7[_0xcb9d('0x30')]!==_0xcb9d('0x3f')){var _0x425d9d={};_0x425d9d[_0x1d46e7['name']]={'$like':'%'+_0xe536e3[_0xcb9d('0x32')][_0xcb9d('0x3d')]+'%'};return _0x425d9d;}})});}_0x9f66ae=_[_0xcb9d('0x3e')]({},_0x9f66ae,_0xe536e3['options']);var _0x43655b={'where':_0x9f66ae[_0xcb9d('0x3c')]};return db['Trigger']['count'](_0x43655b)['then'](function(_0x261d0f){_0x359c91[_0xcb9d('0x1d')]=_0x261d0f;if(_0xe536e3[_0xcb9d('0x32')][_0xcb9d('0x40')]){_0x9f66ae[_0xcb9d('0x41')]=[{'all':!![]}];}return db[_0xcb9d('0x2d')]['findAll'](_0x9f66ae);})[_0xcb9d('0x23')](function(_0x856943){_0x359c91[_0xcb9d('0x42')]=_0x856943;return _0x359c91;})[_0xcb9d('0x23')](respondWithFilteredResult(_0x466539,_0x9f66ae))[_0xcb9d('0x43')](handleError(_0x466539,null));};exports[_0xcb9d('0x44')]=function(_0x3c8610,_0x4418c2){var _0xc61859={'raw':![],'where':{'id':_0x3c8610[_0xcb9d('0x45')]['id']}},_0x2263fb={};_0x2263fb[_0xcb9d('0x31')]=_['keys'](db[_0xcb9d('0x2d')]['rawAttributes']);_0x2263fb[_0xcb9d('0x32')]=_[_0xcb9d('0x33')](_0x3c8610[_0xcb9d('0x32')]);_0x2263fb[_0xcb9d('0x34')]=_[_0xcb9d('0x36')](_0x2263fb[_0xcb9d('0x31')],_0x2263fb['query']);_0xc61859[_0xcb9d('0x35')]=_[_0xcb9d('0x36')](_0x2263fb['model'],qs['fields'](_0x3c8610[_0xcb9d('0x32')][_0xcb9d('0x37')]));_0xc61859[_0xcb9d('0x35')]=_0xc61859[_0xcb9d('0x35')][_0xcb9d('0x38')]?_0xc61859[_0xcb9d('0x35')]:_0x2263fb[_0xcb9d('0x31')];if(_0x3c8610[_0xcb9d('0x32')]['includeAll']){_0xc61859['include']=[{'all':!![]}];}_0xc61859=_[_0xcb9d('0x3e')]({},_0xc61859,_0x3c8610['options']);return db['Trigger']['find'](_0xc61859)['then'](handleEntityNotFound(_0x4418c2,null))['then'](respondWithResult(_0x4418c2,null))[_0xcb9d('0x43')](handleError(_0x4418c2,null));};exports['create']=function(_0x2eef55,_0x5d720b){return db[_0xcb9d('0x2d')]['create'](_0x2eef55['body'],{})[_0xcb9d('0x23')](function(_0x44cd38){var _0x3cce45=_0x2eef55[_0xcb9d('0x46')][_0xcb9d('0x25')]({'plain':!![]});if(!_0x3cce45)throw new Error(_0xcb9d('0x47'));if(_0x3cce45[_0xcb9d('0x48')]===_0xcb9d('0x46')){var _0x4012aa=_0x44cd38[_0xcb9d('0x25')]({'plain':!![]});var _0x2f428b=_0xcb9d('0x26');return db[_0xcb9d('0x49')][_0xcb9d('0x4a')]({'where':{'name':_0x2f428b,'userProfileId':_0x3cce45[_0xcb9d('0x4b')]},'raw':!![]})[_0xcb9d('0x23')](function(_0xd1e784){if(_0xd1e784&&_0xd1e784[_0xcb9d('0x4c')]===0x0){return db[_0xcb9d('0x27')][_0xcb9d('0x4d')]({'name':_0x4012aa[_0xcb9d('0x2a')],'resourceId':_0x4012aa['id'],'type':_0xd1e784[_0xcb9d('0x2a')],'sectionId':_0xd1e784['id']},{})[_0xcb9d('0x23')](function(){return _0x44cd38;});}else{return _0x44cd38;}})[_0xcb9d('0x43')](function(_0x517342){logger['error'](_0xcb9d('0x4e'),_0x517342);throw _0x517342;});}return _0x44cd38;})[_0xcb9d('0x23')](respondWithResult(_0x5d720b,0xc9))[_0xcb9d('0x43')](handleError(_0x5d720b,null));};exports['update']=function(_0x188e70,_0x3a3710){if(_0x188e70[_0xcb9d('0x4f')]['id']){delete _0x188e70['body']['id'];}return db[_0xcb9d('0x2d')][_0xcb9d('0x4a')]({'where':{'id':_0x188e70[_0xcb9d('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a3710,null))[_0xcb9d('0x23')](saveUpdates(_0x188e70[_0xcb9d('0x4f')],null))[_0xcb9d('0x23')](respondWithResult(_0x3a3710,null))[_0xcb9d('0x43')](handleError(_0x3a3710,null));};exports[_0xcb9d('0x24')]=function(_0x35b5a4,_0x583010){return db[_0xcb9d('0x2d')]['find']({'where':{'id':_0x35b5a4[_0xcb9d('0x45')]['id']}})[_0xcb9d('0x23')](handleEntityNotFound(_0x583010,null))[_0xcb9d('0x23')](removeEntity(_0x583010,null))[_0xcb9d('0x43')](handleError(_0x583010,null));};exports[_0xcb9d('0x50')]=function(_0x3ed5de,_0x92e4f9,_0x498994){if(_0x3ed5de[_0xcb9d('0x4f')]['id']){delete _0x3ed5de['body']['id'];}return db['Trigger'][_0xcb9d('0x4a')]({'where':{'id':_0x3ed5de['params']['id']}})['then'](handleEntityNotFound(_0x92e4f9,null))[_0xcb9d('0x23')](function(_0x2feaac){if(_0x2feaac){_0x3ed5de[_0xcb9d('0x4f')][_0xcb9d('0x51')]=_0x2feaac['id'];return db['Condition'][_0xcb9d('0x4d')](_0x3ed5de['body']);}})['then'](respondWithResult(_0x92e4f9,null))[_0xcb9d('0x43')](handleError(_0x92e4f9,null));};exports[_0xcb9d('0x52')]=function(_0x1d82f1,_0xd44dac,_0x29fac0){if(_0x1d82f1[_0xcb9d('0x4f')]['id']){delete _0x1d82f1[_0xcb9d('0x4f')]['id'];}return db[_0xcb9d('0x2d')]['find']({'where':{'id':_0x1d82f1[_0xcb9d('0x45')]['id']}})[_0xcb9d('0x23')](handleEntityNotFound(_0xd44dac,null))[_0xcb9d('0x23')](function(_0x229864){if(_0x229864){_0x1d82f1['body']['TriggerAnyId']=_0x229864['id'];return db[_0xcb9d('0x53')][_0xcb9d('0x4d')](_0x1d82f1[_0xcb9d('0x4f')]);}})[_0xcb9d('0x23')](respondWithResult(_0xd44dac,null))[_0xcb9d('0x43')](handleError(_0xd44dac,null));};exports[_0xcb9d('0x54')]=function(_0x4aeee4,_0x404dce,_0x302b4d){var _0x3e91e1={};var _0xd8ceac={};var _0x3182d3;var _0x58ae1d;return db[_0xcb9d('0x2d')]['findOne']({'where':{'id':_0x4aeee4[_0xcb9d('0x45')]['id']}})['then'](handleEntityNotFound(_0x404dce,null))[_0xcb9d('0x23')](function(_0x42bd62){if(_0x42bd62){_0x3182d3=_0x42bd62;_0xd8ceac['model']=_[_0xcb9d('0x33')](db[_0xcb9d('0x53')][_0xcb9d('0x2e')]);_0xd8ceac[_0xcb9d('0x32')]=_[_0xcb9d('0x33')](_0x4aeee4[_0xcb9d('0x32')]);_0xd8ceac[_0xcb9d('0x34')]=_[_0xcb9d('0x36')](_0xd8ceac['model'],_0xd8ceac[_0xcb9d('0x32')]);_0x3e91e1[_0xcb9d('0x35')]=_[_0xcb9d('0x36')](_0xd8ceac['model'],qs[_0xcb9d('0x37')](_0x4aeee4[_0xcb9d('0x32')]['fields']));_0x3e91e1[_0xcb9d('0x35')]=_0x3e91e1['attributes'][_0xcb9d('0x38')]?_0x3e91e1[_0xcb9d('0x35')]:_0xd8ceac[_0xcb9d('0x31')];_0x3e91e1[_0xcb9d('0x3a')]=qs['sort'](_0x4aeee4[_0xcb9d('0x32')][_0xcb9d('0x3b')]);_0x3e91e1[_0xcb9d('0x3c')]=qs[_0xcb9d('0x34')](_[_0xcb9d('0x55')](_0x4aeee4['query'],_0xd8ceac[_0xcb9d('0x34')]));if(_0x4aeee4['query'][_0xcb9d('0x3d')]){_0x3e91e1[_0xcb9d('0x3c')]=_[_0xcb9d('0x3e')](_0x3e91e1[_0xcb9d('0x3c')],{'$or':_['map'](_0x3e91e1[_0xcb9d('0x35')],function(_0x4ec86b){var _0x498235={};_0x498235[_0x4ec86b]={'$like':'%'+_0x4aeee4['query']['filter']+'%'};return _0x498235;})});}_0x3e91e1=_[_0xcb9d('0x3e')]({},_0x3e91e1,_0x4aeee4[_0xcb9d('0x56')]);return _0x3182d3[_0xcb9d('0x54')](_0x3e91e1);}})[_0xcb9d('0x23')](function(_0x5e51c1){if(_0x5e51c1){_0x58ae1d=_0x5e51c1[_0xcb9d('0x38')];if(!_0x4aeee4[_0xcb9d('0x32')][_0xcb9d('0x57')]('nolimit')){_0x3e91e1[_0xcb9d('0x1c')]=qs[_0xcb9d('0x1c')](_0x4aeee4[_0xcb9d('0x32')][_0xcb9d('0x1c')]);_0x3e91e1[_0xcb9d('0x1a')]=qs['offset'](_0x4aeee4[_0xcb9d('0x32')][_0xcb9d('0x1a')]);}return _0x3182d3[_0xcb9d('0x54')](_0x3e91e1);}})[_0xcb9d('0x23')](function(_0x153f59){if(_0x153f59){return _0x153f59?{'count':_0x58ae1d,'rows':_0x153f59}:null;}})['then'](respondWithResult(_0x404dce,null))[_0xcb9d('0x43')](handleError(_0x404dce,null));};exports[_0xcb9d('0x58')]=function(_0xde01da,_0x87abd7,_0xece168){var _0x3443eb={};var _0x1d7c9a={};var _0xbb31af;var _0x8919a9;return db[_0xcb9d('0x2d')][_0xcb9d('0x59')]({'where':{'id':_0xde01da[_0xcb9d('0x45')]['id']}})[_0xcb9d('0x23')](handleEntityNotFound(_0x87abd7,null))['then'](function(_0x575144){if(_0x575144){_0xbb31af=_0x575144;_0x1d7c9a[_0xcb9d('0x31')]=_['keys'](db[_0xcb9d('0x53')][_0xcb9d('0x2e')]);_0x1d7c9a[_0xcb9d('0x32')]=_[_0xcb9d('0x33')](_0xde01da['query']);_0x1d7c9a[_0xcb9d('0x34')]=_[_0xcb9d('0x36')](_0x1d7c9a[_0xcb9d('0x31')],_0x1d7c9a[_0xcb9d('0x32')]);_0x3443eb['attributes']=_[_0xcb9d('0x36')](_0x1d7c9a[_0xcb9d('0x31')],qs[_0xcb9d('0x37')](_0xde01da[_0xcb9d('0x32')][_0xcb9d('0x37')]));_0x3443eb[_0xcb9d('0x35')]=_0x3443eb['attributes'][_0xcb9d('0x38')]?_0x3443eb[_0xcb9d('0x35')]:_0x1d7c9a[_0xcb9d('0x31')];_0x3443eb[_0xcb9d('0x3a')]=qs['sort'](_0xde01da[_0xcb9d('0x32')][_0xcb9d('0x3b')]);_0x3443eb[_0xcb9d('0x3c')]=qs['filters'](_[_0xcb9d('0x55')](_0xde01da[_0xcb9d('0x32')],_0x1d7c9a[_0xcb9d('0x34')]));if(_0xde01da['query'][_0xcb9d('0x3d')]){_0x3443eb['where']=_[_0xcb9d('0x3e')](_0x3443eb['where'],{'$or':_[_0xcb9d('0x2c')](_0x3443eb[_0xcb9d('0x35')],function(_0x2b52a3){var _0x13e6ab={};_0x13e6ab[_0x2b52a3]={'$like':'%'+_0xde01da[_0xcb9d('0x32')][_0xcb9d('0x3d')]+'%'};return _0x13e6ab;})});}_0x3443eb=_['merge']({},_0x3443eb,_0xde01da['options']);return _0xbb31af[_0xcb9d('0x58')](_0x3443eb);}})[_0xcb9d('0x23')](function(_0x58b861){if(_0x58b861){_0x8919a9=_0x58b861[_0xcb9d('0x38')];if(!_0xde01da[_0xcb9d('0x32')][_0xcb9d('0x57')](_0xcb9d('0x39'))){_0x3443eb[_0xcb9d('0x1c')]=qs[_0xcb9d('0x1c')](_0xde01da[_0xcb9d('0x32')]['limit']);_0x3443eb['offset']=qs[_0xcb9d('0x1a')](_0xde01da[_0xcb9d('0x32')][_0xcb9d('0x1a')]);}return _0xbb31af['getAnyConditions'](_0x3443eb);}})[_0xcb9d('0x23')](function(_0x2a937c){if(_0x2a937c){return _0x2a937c?{'count':_0x8919a9,'rows':_0x2a937c}:null;}})[_0xcb9d('0x23')](respondWithResult(_0x87abd7,null))[_0xcb9d('0x43')](handleError(_0x87abd7,null));};exports[_0xcb9d('0x5a')]=function(_0x4dc25f,_0x25ce22,_0x2f4268){if(_0x4dc25f[_0xcb9d('0x4f')]['id']){delete _0x4dc25f[_0xcb9d('0x4f')]['id'];}return db[_0xcb9d('0x2d')]['find']({'where':{'id':_0x4dc25f[_0xcb9d('0x45')]['id']}})[_0xcb9d('0x23')](handleEntityNotFound(_0x25ce22,null))[_0xcb9d('0x23')](function(_0x1c9c0e){if(_0x1c9c0e){_0x4dc25f[_0xcb9d('0x4f')][_0xcb9d('0x5b')]=_0x1c9c0e['id'];return db[_0xcb9d('0x5c')][_0xcb9d('0x4d')](_0x4dc25f[_0xcb9d('0x4f')]);}})[_0xcb9d('0x23')](respondWithResult(_0x25ce22,null))['catch'](handleError(_0x25ce22,null));};exports[_0xcb9d('0x5d')]=function(_0x43fc74,_0x2c1d52,_0x6962b9){var _0x43666c={};var _0x43d80e={};var _0x1c014d;var _0x32113d;return db[_0xcb9d('0x2d')]['findOne']({'where':{'id':_0x43fc74['params']['id']}})['then'](handleEntityNotFound(_0x2c1d52,null))[_0xcb9d('0x23')](function(_0x5e2dbf){if(_0x5e2dbf){_0x1c014d=_0x5e2dbf;_0x43d80e[_0xcb9d('0x31')]=_[_0xcb9d('0x33')](db[_0xcb9d('0x5c')][_0xcb9d('0x2e')]);_0x43d80e[_0xcb9d('0x32')]=_['keys'](_0x43fc74[_0xcb9d('0x32')]);_0x43d80e['filters']=_[_0xcb9d('0x36')](_0x43d80e[_0xcb9d('0x31')],_0x43d80e['query']);_0x43666c[_0xcb9d('0x35')]=_[_0xcb9d('0x36')](_0x43d80e[_0xcb9d('0x31')],qs[_0xcb9d('0x37')](_0x43fc74[_0xcb9d('0x32')][_0xcb9d('0x37')]));_0x43666c[_0xcb9d('0x35')]=_0x43666c['attributes'][_0xcb9d('0x38')]?_0x43666c[_0xcb9d('0x35')]:_0x43d80e[_0xcb9d('0x31')];_0x43666c[_0xcb9d('0x3a')]=qs[_0xcb9d('0x3b')](_0x43fc74[_0xcb9d('0x32')][_0xcb9d('0x3b')]);_0x43666c[_0xcb9d('0x3c')]=qs[_0xcb9d('0x34')](_['pick'](_0x43fc74['query'],_0x43d80e[_0xcb9d('0x34')]));if(_0x43fc74[_0xcb9d('0x32')][_0xcb9d('0x3d')]){_0x43666c['where']=_[_0xcb9d('0x3e')](_0x43666c[_0xcb9d('0x3c')],{'$or':_['map'](_0x43666c[_0xcb9d('0x35')],function(_0x2d2cab){var _0x1dc9a4={};_0x1dc9a4[_0x2d2cab]={'$like':'%'+_0x43fc74['query']['filter']+'%'};return _0x1dc9a4;})});}_0x43666c=_[_0xcb9d('0x3e')]({},_0x43666c,_0x43fc74[_0xcb9d('0x56')]);return _0x1c014d[_0xcb9d('0x5d')](_0x43666c);}})[_0xcb9d('0x23')](function(_0x1fe953){if(_0x1fe953){_0x32113d=_0x1fe953[_0xcb9d('0x38')];if(!_0x43fc74['query'][_0xcb9d('0x57')](_0xcb9d('0x39'))){_0x43666c[_0xcb9d('0x1c')]=qs[_0xcb9d('0x1c')](_0x43fc74[_0xcb9d('0x32')][_0xcb9d('0x1c')]);_0x43666c[_0xcb9d('0x1a')]=qs[_0xcb9d('0x1a')](_0x43fc74[_0xcb9d('0x32')][_0xcb9d('0x1a')]);}return _0x1c014d[_0xcb9d('0x5d')](_0x43666c);}})['then'](function(_0x1c5239){if(_0x1c5239){return _0x1c5239?{'count':_0x32113d,'rows':_0x1c5239}:null;}})['then'](respondWithResult(_0x2c1d52,null))['catch'](handleError(_0x2c1d52,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index e1acdc9..d7ea81a 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 _0xa991=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash'];(function(_0x49f584,_0x426fee){var _0x5b8269=function(_0x30fa95){while(--_0x30fa95){_0x49f584['push'](_0x49f584['shift']());}};_0x5b8269(++_0x426fee);}(_0xa991,0x143));var _0x1a99=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xa991[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x1a99('0x0'));var util=require('util');var logger=require(_0x1a99('0x1'))(_0x1a99('0x2'));var moment=require(_0x1a99('0x3'));var BPromise=require(_0x1a99('0x4'));var rp=require(_0x1a99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a99('0x6'));var config=require(_0x1a99('0x7'));var attributes=require(_0x1a99('0x8'));module[_0x1a99('0x9')]=function(_0x22990b,_0xabf36a){return _0x22990b[_0x1a99('0xa')]('Trigger',attributes,{'tableName':_0x1a99('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./trigger.attributes','define','Trigger','tools_triggers','lodash'];(function(_0x55b2b9,_0x1a6ae0){var _0x234061=function(_0x3a0066){while(--_0x3a0066){_0x55b2b9['push'](_0x55b2b9['shift']());}};_0x234061(++_0x1a6ae0);}(_0xda55,0x6d));var _0x5da5=function(_0x16f7cf,_0x227024){_0x16f7cf=_0x16f7cf-0x0;var _0x4b75db=_0xda55[_0x16f7cf];return _0x4b75db;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 680d42c..e245adf 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 _0x64ff=['GetTrigger','findAll','options','raw','attributes','limit','include','model','map','ShowTrigger','Trigger','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x21880b,_0xc9222f){var _0x41a6c0=function(_0x57c7aa){while(--_0x57c7aa){_0x21880b['push'](_0x21880b['shift']());}};_0x41a6c0(++_0xc9222f);}(_0x64ff,0x11c));var _0xf64f=function(_0x11cb3c,_0x7b7133){_0x11cb3c=_0x11cb3c-0x0;var _0x56875a=_0x64ff[_0x11cb3c];return _0x56875a;};'use strict';var _=require(_0xf64f('0x0'));var util=require(_0xf64f('0x1'));var moment=require(_0xf64f('0x2'));var BPromise=require(_0xf64f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf64f('0x4'));var db=require(_0xf64f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf64f('0x6'))(_0xf64f('0x7'));var config=require(_0xf64f('0x8'));var jayson=require(_0xf64f('0x9'));var client=jayson[_0xf64f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa55aa6,_0x2d3d6b,_0x19efca){return new BPromise(function(_0x5df525,_0x2e1bd2){return client['request'](_0xa55aa6,_0x19efca)[_0xf64f('0xb')](function(_0x48c80e){logger[_0xf64f('0xc')](_0xf64f('0xd'),_0x2d3d6b,_0xf64f('0xe'));logger[_0xf64f('0xf')](_0xf64f('0x10'),_0x2d3d6b,_0xf64f('0xe'),JSON['stringify'](_0x48c80e));if(_0x48c80e[_0xf64f('0x11')]){if(_0x48c80e['error'][_0xf64f('0x12')]===0x1f4){logger[_0xf64f('0x11')](_0xf64f('0xd'),_0x2d3d6b,_0x48c80e[_0xf64f('0x11')][_0xf64f('0x13')]);return _0x2e1bd2(_0x48c80e[_0xf64f('0x11')]['message']);}logger['error'](_0xf64f('0xd'),_0x2d3d6b,_0x48c80e[_0xf64f('0x11')][_0xf64f('0x13')]);return _0x5df525(_0x48c80e[_0xf64f('0x11')][_0xf64f('0x13')]);}else{logger[_0xf64f('0xc')](_0xf64f('0xd'),_0x2d3d6b,_0xf64f('0xe'));_0x5df525(_0x48c80e[_0xf64f('0x14')]['message']);}})[_0xf64f('0x15')](function(_0x151f38){logger[_0xf64f('0x11')](_0xf64f('0xd'),_0x2d3d6b,_0x151f38);_0x2e1bd2(_0x151f38);});});}exports[_0xf64f('0x16')]=function(_0x3322a6){var _0x553b6e=this;return new Promise(function(_0x33333e,_0x1a32ce){return db['Trigger'][_0xf64f('0x17')]({'raw':_0x3322a6[_0xf64f('0x18')]?_0x3322a6[_0xf64f('0x18')][_0xf64f('0x19')]===undefined?!![]:![]:!![],'where':_0x3322a6[_0xf64f('0x18')]?_0x3322a6[_0xf64f('0x18')]['where']||null:null,'attributes':_0x3322a6[_0xf64f('0x18')]?_0x3322a6['options'][_0xf64f('0x1a')]||null:null,'limit':_0x3322a6[_0xf64f('0x18')]?_0x3322a6[_0xf64f('0x18')][_0xf64f('0x1b')]||null:null,'include':_0x3322a6[_0xf64f('0x18')]?_0x3322a6[_0xf64f('0x18')][_0xf64f('0x1c')]?_['map'](_0x3322a6[_0xf64f('0x18')][_0xf64f('0x1c')],function(_0x3082bc){return{'model':db[_0x3082bc[_0xf64f('0x1d')]],'as':_0x3082bc['as'],'attributes':_0x3082bc[_0xf64f('0x1a')],'include':_0x3082bc[_0xf64f('0x1c')]?_[_0xf64f('0x1e')](_0x3082bc[_0xf64f('0x1c')],function(_0x3a3750){return{'model':db[_0x3a3750[_0xf64f('0x1d')]],'as':_0x3a3750['as'],'attributes':_0x3a3750[_0xf64f('0x1a')],'include':_0x3a3750[_0xf64f('0x1c')]?_['map'](_0x3a3750[_0xf64f('0x1c')],function(_0x133fe7){return{'model':db[_0x133fe7[_0xf64f('0x1d')]],'as':_0x133fe7['as'],'attributes':_0x133fe7['attributes']};}):[]};}):[]};}):[]:[]})[_0xf64f('0xb')](function(_0x316c8f){logger[_0xf64f('0xc')](_0xf64f('0x16'),_0x3322a6);logger[_0xf64f('0xf')](_0xf64f('0x16'),_0x3322a6,JSON['stringify'](_0x316c8f));_0x33333e(_0x316c8f);})[_0xf64f('0x15')](function(_0x10af14){logger[_0xf64f('0x11')](_0xf64f('0x16'),_0x10af14[_0xf64f('0x13')],_0x3322a6);_0x1a32ce(_0x553b6e['error'](0x1f4,_0x10af14['message']));});});};exports[_0xf64f('0x1f')]=function(_0x5742d0){var _0x44c409=this;return new Promise(function(_0x175555,_0x487e13){return db[_0xf64f('0x20')]['find']({'raw':_0x5742d0['options']?_0x5742d0[_0xf64f('0x18')][_0xf64f('0x19')]===undefined?!![]:![]:!![],'where':_0x5742d0[_0xf64f('0x18')]?_0x5742d0[_0xf64f('0x18')][_0xf64f('0x21')]||null:null,'attributes':_0x5742d0[_0xf64f('0x18')]?_0x5742d0[_0xf64f('0x18')][_0xf64f('0x1a')]||null:null,'include':_0x5742d0[_0xf64f('0x18')]?_0x5742d0[_0xf64f('0x18')][_0xf64f('0x1c')]?_[_0xf64f('0x1e')](_0x5742d0['options'][_0xf64f('0x1c')],function(_0x32a15f){return{'model':db[_0x32a15f[_0xf64f('0x1d')]],'as':_0x32a15f['as'],'attributes':_0x32a15f[_0xf64f('0x1a')],'include':_0x32a15f[_0xf64f('0x1c')]?_['map'](_0x32a15f[_0xf64f('0x1c')],function(_0xc7ca21){return{'model':db[_0xc7ca21[_0xf64f('0x1d')]],'as':_0xc7ca21['as'],'attributes':_0xc7ca21['attributes'],'include':_0xc7ca21[_0xf64f('0x1c')]?_[_0xf64f('0x1e')](_0xc7ca21[_0xf64f('0x1c')],function(_0x458914){return{'model':db[_0x458914[_0xf64f('0x1d')]],'as':_0x458914['as'],'attributes':_0x458914[_0xf64f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf64f('0xb')](function(_0x1c6442){logger[_0xf64f('0xc')](_0xf64f('0x1f'),_0x5742d0);logger['debug'](_0xf64f('0x1f'),_0x5742d0,JSON['stringify'](_0x1c6442));_0x175555(_0x1c6442);})[_0xf64f('0x15')](function(_0xd71eb7){logger[_0xf64f('0x11')](_0xf64f('0x1f'),_0xd71eb7[_0xf64f('0x13')],_0x5742d0);_0x487e13(_0x44c409[_0xf64f('0x11')](0x1f4,_0xd71eb7[_0xf64f('0x13')]));});});}; \ No newline at end of file +var _0x2d22=['request\x20sent','result','catch','options','raw','limit','include','map','model','attributes','then','GetTrigger','stringify','ShowTrigger','Trigger','find','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x2d22,0x119));var _0x22d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d22[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x22d2('0x0'));var util=require(_0x22d2('0x1'));var moment=require(_0x22d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x22d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22d2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x22d2('0x5'))(_0x22d2('0x6'));var config=require(_0x22d2('0x7'));var jayson=require(_0x22d2('0x8'));var client=jayson[_0x22d2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x598614,_0xf0b695,_0x32c68d){return new BPromise(function(_0x2f5668,_0x39c36f){return client[_0x22d2('0xa')](_0x598614,_0x32c68d)['then'](function(_0x2382da){logger[_0x22d2('0xb')](_0x22d2('0xc'),_0xf0b695,'request\x20sent');logger['debug'](_0x22d2('0xd'),_0xf0b695,'request\x20sent',JSON['stringify'](_0x2382da));if(_0x2382da[_0x22d2('0xe')]){if(_0x2382da['error']['code']===0x1f4){logger[_0x22d2('0xe')](_0x22d2('0xc'),_0xf0b695,_0x2382da[_0x22d2('0xe')][_0x22d2('0xf')]);return _0x39c36f(_0x2382da[_0x22d2('0xe')][_0x22d2('0xf')]);}logger[_0x22d2('0xe')](_0x22d2('0xc'),_0xf0b695,_0x2382da[_0x22d2('0xe')][_0x22d2('0xf')]);return _0x2f5668(_0x2382da[_0x22d2('0xe')][_0x22d2('0xf')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0xf0b695,_0x22d2('0x10'));_0x2f5668(_0x2382da[_0x22d2('0x11')]['message']);}})[_0x22d2('0x12')](function(_0x18456d){logger[_0x22d2('0xe')]('Trigger,\x20%s,\x20%s',_0xf0b695,_0x18456d);_0x39c36f(_0x18456d);});});}exports['GetTrigger']=function(_0x8da801){var _0x7faca9=this;return new Promise(function(_0x3086a3,_0x16e5eb){return db['Trigger']['findAll']({'raw':_0x8da801[_0x22d2('0x13')]?_0x8da801[_0x22d2('0x13')][_0x22d2('0x14')]===undefined?!![]:![]:!![],'where':_0x8da801[_0x22d2('0x13')]?_0x8da801[_0x22d2('0x13')]['where']||null:null,'attributes':_0x8da801[_0x22d2('0x13')]?_0x8da801[_0x22d2('0x13')]['attributes']||null:null,'limit':_0x8da801[_0x22d2('0x13')]?_0x8da801[_0x22d2('0x13')][_0x22d2('0x15')]||null:null,'include':_0x8da801[_0x22d2('0x13')]?_0x8da801[_0x22d2('0x13')][_0x22d2('0x16')]?_[_0x22d2('0x17')](_0x8da801['options'][_0x22d2('0x16')],function(_0x58e4ef){return{'model':db[_0x58e4ef[_0x22d2('0x18')]],'as':_0x58e4ef['as'],'attributes':_0x58e4ef[_0x22d2('0x19')],'include':_0x58e4ef[_0x22d2('0x16')]?_[_0x22d2('0x17')](_0x58e4ef['include'],function(_0x4c11e2){return{'model':db[_0x4c11e2['model']],'as':_0x4c11e2['as'],'attributes':_0x4c11e2[_0x22d2('0x19')],'include':_0x4c11e2[_0x22d2('0x16')]?_[_0x22d2('0x17')](_0x4c11e2['include'],function(_0xc7679e){return{'model':db[_0xc7679e['model']],'as':_0xc7679e['as'],'attributes':_0xc7679e['attributes']};}):[]};}):[]};}):[]:[]})[_0x22d2('0x1a')](function(_0x6e05a0){logger[_0x22d2('0xb')](_0x22d2('0x1b'),_0x8da801);logger['debug'](_0x22d2('0x1b'),_0x8da801,JSON[_0x22d2('0x1c')](_0x6e05a0));_0x3086a3(_0x6e05a0);})[_0x22d2('0x12')](function(_0x5e7398){logger[_0x22d2('0xe')](_0x22d2('0x1b'),_0x5e7398[_0x22d2('0xf')],_0x8da801);_0x16e5eb(_0x7faca9[_0x22d2('0xe')](0x1f4,_0x5e7398['message']));});});};exports[_0x22d2('0x1d')]=function(_0xaa03f6){var _0xb33dab=this;return new Promise(function(_0x4be52f,_0x3758c5){return db[_0x22d2('0x1e')][_0x22d2('0x1f')]({'raw':_0xaa03f6[_0x22d2('0x13')]?_0xaa03f6[_0x22d2('0x13')][_0x22d2('0x14')]===undefined?!![]:![]:!![],'where':_0xaa03f6[_0x22d2('0x13')]?_0xaa03f6[_0x22d2('0x13')]['where']||null:null,'attributes':_0xaa03f6[_0x22d2('0x13')]?_0xaa03f6[_0x22d2('0x13')][_0x22d2('0x19')]||null:null,'include':_0xaa03f6['options']?_0xaa03f6[_0x22d2('0x13')][_0x22d2('0x16')]?_[_0x22d2('0x17')](_0xaa03f6[_0x22d2('0x13')][_0x22d2('0x16')],function(_0x3db157){return{'model':db[_0x3db157[_0x22d2('0x18')]],'as':_0x3db157['as'],'attributes':_0x3db157['attributes'],'include':_0x3db157[_0x22d2('0x16')]?_[_0x22d2('0x17')](_0x3db157['include'],function(_0x4484a7){return{'model':db[_0x4484a7[_0x22d2('0x18')]],'as':_0x4484a7['as'],'attributes':_0x4484a7[_0x22d2('0x19')],'include':_0x4484a7[_0x22d2('0x16')]?_['map'](_0x4484a7['include'],function(_0x5a6992){return{'model':db[_0x5a6992['model']],'as':_0x5a6992['as'],'attributes':_0x5a6992[_0x22d2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x22d2('0x1a')](function(_0x5392bd){logger[_0x22d2('0xb')](_0x22d2('0x1d'),_0xaa03f6);logger[_0x22d2('0x20')]('ShowTrigger',_0xaa03f6,JSON[_0x22d2('0x1c')](_0x5392bd));_0x4be52f(_0x5392bd);})[_0x22d2('0x12')](function(_0x1288bd){logger[_0x22d2('0xe')](_0x22d2('0x1d'),_0x1288bd[_0x22d2('0xf')],_0xaa03f6);_0x3758c5(_0xb33dab[_0x22d2('0xe')](0x1f4,_0x1288bd[_0x22d2('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 594e707..30fae0f 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 _0x54a2=['get','isAuthenticated','index','/:id','show','/:id/clone','clone','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ff501,_0xb754fe){var _0x3330c4=function(_0x4e40e2){while(--_0x4e40e2){_0x1ff501['push'](_0x1ff501['shift']());}};_0x3330c4(++_0xb754fe);}(_0x54a2,0x198));var _0x254a=function(_0x5c9f56,_0x42c9ad){_0x5c9f56=_0x5c9f56-0x0;var _0x2a726b=_0x54a2[_0x5c9f56];return _0x2a726b;};'use strict';var multer=require(_0x254a('0x0'));var util=require(_0x254a('0x1'));var path=require(_0x254a('0x2'));var timeout=require(_0x254a('0x3'));var express=require(_0x254a('0x4'));var router=express[_0x254a('0x5')]();var fs_extra=require(_0x254a('0x6'));var auth=require(_0x254a('0x7'));var interaction=require(_0x254a('0x8'));var config=require(_0x254a('0x9'));var controller=require('./trunk.controller');router[_0x254a('0xa')]('/',auth[_0x254a('0xb')](),controller[_0x254a('0xc')]);router[_0x254a('0xa')](_0x254a('0xd'),auth['isAuthenticated'](),controller[_0x254a('0xe')]);router['post'](_0x254a('0xf'),auth[_0x254a('0xb')](),controller[_0x254a('0x10')]);router[_0x254a('0x11')]('/',auth[_0x254a('0xb')](),controller['create']);router[_0x254a('0x12')](_0x254a('0xd'),auth[_0x254a('0xb')](),controller[_0x254a('0x13')]);router[_0x254a('0x14')](_0x254a('0xd'),auth[_0x254a('0xb')](),controller[_0x254a('0x15')]);module['exports']=router; \ No newline at end of file +var _0x23dd=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','clone','create','put','update','delete','destroy','multer','path'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x23dd,0x1f2));var _0xd23d=function(_0x3296d6,_0x430e9d){_0x3296d6=_0x3296d6-0x0;var _0x30e99b=_0x23dd[_0x3296d6];return _0x30e99b;};'use strict';var multer=require(_0xd23d('0x0'));var util=require('util');var path=require(_0xd23d('0x1'));var timeout=require(_0xd23d('0x2'));var express=require('express');var router=express[_0xd23d('0x3')]();var fs_extra=require(_0xd23d('0x4'));var auth=require(_0xd23d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd23d('0x6'));var controller=require(_0xd23d('0x7'));router[_0xd23d('0x8')]('/',auth[_0xd23d('0x9')](),controller[_0xd23d('0xa')]);router[_0xd23d('0x8')](_0xd23d('0xb'),auth[_0xd23d('0x9')](),controller['show']);router[_0xd23d('0xc')](_0xd23d('0xd'),auth[_0xd23d('0x9')](),controller[_0xd23d('0xe')]);router[_0xd23d('0xc')]('/',auth[_0xd23d('0x9')](),controller[_0xd23d('0xf')]);router[_0xd23d('0x10')]('/:id',auth[_0xd23d('0x9')](),controller[_0xd23d('0x11')]);router[_0xd23d('0x12')](_0xd23d('0xb'),auth[_0xd23d('0x9')](),controller[_0xd23d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 0f56722..37ab527 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 _0x7c34=['auto','nonat','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','refuse','originate','uac','uas','certificate','active','passive','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband'];(function(_0x67c648,_0x23eb4b){var _0x4779c8=function(_0x4e9cda){while(--_0x4e9cda){_0x67c648['push'](_0x67c648['shift']());}};_0x4779c8(++_0x23eb4b);}(_0x7c34,0x1d4));var _0x47c3=function(_0x31a69d,_0x25358a){_0x31a69d=_0x31a69d-0x0;var _0x43a219=_0x7c34[_0x31a69d];return _0x43a219;};'use strict';var Sequelize=require(_0x47c3('0x0'));module[_0x47c3('0x1')]={'name':{'type':Sequelize[_0x47c3('0x2')],'allowNull':![],'unique':_0x47c3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x5'),_0x47c3('0x6'),'peer'),'allowNull':![],'defaultValue':_0x47c3('0x5')},'context':{'type':Sequelize[_0x47c3('0x2')],'allowNull':![],'defaultValue':_0x47c3('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x47c3('0x8'),_0x47c3('0x9'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0x47c3('0xa'),_0x47c3('0xb'),_0x47c3('0xc'))},'deny':{'type':Sequelize[_0x47c3('0x2')]},'permit':{'type':Sequelize[_0x47c3('0x2')]},'secret':{'type':Sequelize[_0x47c3('0x2')]},'md5secret':{'type':Sequelize[_0x47c3('0x2')]},'remotesecret':{'type':Sequelize[_0x47c3('0x2')]},'transport':{'type':Sequelize[_0x47c3('0x2')],'defaultValue':'udp','set':function(_0x19771a){this[_0x47c3('0xd')]('transport',_0x19771a?_0x19771a[_0x47c3('0xe')](','):null);},'get':function(){return this[_0x47c3('0xf')]('transport')?this[_0x47c3('0xf')]('transport')[_0x47c3('0x10')](','):null;},'comment':_0x47c3('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0x47c3('0x12'),_0x47c3('0x13'),_0x47c3('0x14'),_0x47c3('0x15'),_0x47c3('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x47c3('0x17'),'update',_0x47c3('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x47c3('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x47c3('0x2')]},'directmediadeny':{'type':Sequelize[_0x47c3('0x2')]},'nat':{'type':Sequelize[_0x47c3('0x2')],'defaultValue':_0x47c3('0x19'),'set':function(_0x2731d6){this[_0x47c3('0xd')](_0x47c3('0x1a'),_0x2731d6?_0x2731d6[_0x47c3('0xe')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x47c3('0xf')](_0x47c3('0x1a'))[_0x47c3('0x10')](','):null;},'comment':_0x47c3('0x1b')},'callgroup':{'type':Sequelize[_0x47c3('0x2')]},'namedcallgroup':{'type':Sequelize[_0x47c3('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x47c3('0x2')]},'language':{'type':Sequelize[_0x47c3('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x47c3('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x47c3('0x1c')},'allow':{'type':Sequelize[_0x47c3('0x2')],'allowNull':![],'defaultValue':_0x47c3('0x1d'),'set':function(_0x887f43){this[_0x47c3('0xd')]('allow',_0x887f43?_0x887f43[_0x47c3('0xe')](';'):_0x47c3('0x1d'));},'get':function(){return this['getDataValue'](_0x47c3('0x1e'))?this['getDataValue'](_0x47c3('0x1e'))[_0x47c3('0x10')](';'):null;},'comment':_0x47c3('0x1f')},'autoframing':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'insecure':{'type':Sequelize[_0x47c3('0x2')],'defaultValue':'port,invite','set':function(_0x185a1c){this[_0x47c3('0xd')](_0x47c3('0x21'),_0x185a1c?_0x185a1c[_0x47c3('0xe')](','):null);},'get':function(){return this[_0x47c3('0xf')](_0x47c3('0x21'))?this[_0x47c3('0xf')](_0x47c3('0x21'))['split'](','):null;},'comment':_0x47c3('0x22')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no',_0x47c3('0x23'))},'promiscredir':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'useclientcode':{'type':Sequelize[_0x47c3('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0x47c3('0x24')](0xb)},'setvar':{'type':Sequelize[_0x47c3('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x47c3('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x47c3('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'allowtransfer':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x47c3('0x20'),'no')},'subscribecontext':{'type':Sequelize[_0x47c3('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no',_0x47c3('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x47c3('0x4')]('accept',_0x47c3('0x26'),_0x47c3('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x47c3('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x28'),_0x47c3('0x29')),'defaultValue':_0x47c3('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x47c3('0x2')]},'regexten':{'type':Sequelize[_0x47c3('0x2')]},'fromdomain':{'type':Sequelize[_0x47c3('0x2')]},'fromuser':{'type':Sequelize[_0x47c3('0x2')]},'port':{'type':Sequelize[_0x47c3('0x24')](0x5)},'qualify':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no'),'defaultValue':_0x47c3('0x20')},'keepalive':{'type':Sequelize[_0x47c3('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x47c3('0x2')]},'rtptimeout':{'type':Sequelize[_0x47c3('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x47c3('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x47c3('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x47c3('0x2')]},'callbackextension':{'type':Sequelize[_0x47c3('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x47c3('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x47c3('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x47c3('0x2')]},'contactacl':{'type':Sequelize[_0x47c3('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x47c3('0x2')]},'maxforwards':{'type':Sequelize[_0x47c3('0x24')](0xb)},'encryption':{'type':Sequelize[_0x47c3('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'force_avp':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'icesupport':{'type':Sequelize[_0x47c3('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x47c3('0x2a'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x47c3('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x47c3('0x2')]},'dtlscapath':{'type':Sequelize[_0x47c3('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x47c3('0x2b'),_0x47c3('0x2c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x47c3('0x2')]},'usereqphone':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x47c3('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x47c3('0x20'),'no')},'vmexten':{'type':Sequelize[_0x47c3('0x2')]},'mohinterpret':{'type':Sequelize[_0x47c3('0x2')]},'mohsuggest':{'type':Sequelize[_0x47c3('0x2')]},'parkinglot':{'type':Sequelize[_0x47c3('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x47c3('0x2')],'defaultValue':_0x47c3('0x2d')},'canreinvite':{'type':Sequelize[_0x47c3('0x4')](_0x47c3('0x20'),'no',_0x47c3('0x17'),_0x47c3('0x2e'),_0x47c3('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x47c3('0x2')]},'active':{'type':Sequelize[_0x47c3('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x47c3('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xc4eb=['PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','always','accept','refuse','originate','uas','fingerprint','active','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','user','peer','friend','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED'];(function(_0x2730f4,_0x288b29){var _0x4bfbb7=function(_0x1b4128){while(--_0x1b4128){_0x2730f4['push'](_0x2730f4['shift']());}};_0x4bfbb7(++_0x288b29);}(_0xc4eb,0x90));var _0xbc4e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc4eb[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xbc4e('0x0'));module[_0xbc4e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbc4e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbc4e('0x3')]('friend',_0xbc4e('0x4'),_0xbc4e('0x5')),'allowNull':![],'defaultValue':_0xbc4e('0x6')},'context':{'type':Sequelize[_0xbc4e('0x7')],'allowNull':![],'defaultValue':_0xbc4e('0x8')},'callingpres':{'type':Sequelize[_0xbc4e('0x3')]('ALLOWED_NOT_SCREENED',_0xbc4e('0x9'),'ALLOWED_FAILED_SCREEN',_0xbc4e('0xa'),_0xbc4e('0xb'),_0xbc4e('0xc'),'PROHIB_FAILED_SCREEN',_0xbc4e('0xd'))},'deny':{'type':Sequelize[_0xbc4e('0x7')]},'permit':{'type':Sequelize[_0xbc4e('0x7')]},'secret':{'type':Sequelize[_0xbc4e('0x7')]},'md5secret':{'type':Sequelize[_0xbc4e('0x7')]},'remotesecret':{'type':Sequelize[_0xbc4e('0x7')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0xe'),'set':function(_0x526881){this[_0xbc4e('0xf')](_0xbc4e('0x10'),_0x526881?_0x526881[_0xbc4e('0x11')](','):null);},'get':function(){return this[_0xbc4e('0x12')](_0xbc4e('0x10'))?this[_0xbc4e('0x12')](_0xbc4e('0x10'))[_0xbc4e('0x13')](','):null;},'comment':_0xbc4e('0x14')},'dtmfmode':{'type':Sequelize['ENUM'](_0xbc4e('0x15'),_0xbc4e('0x16'),_0xbc4e('0x17'),_0xbc4e('0x18'),_0xbc4e('0x19')),'defaultValue':_0xbc4e('0x15')},'directmedia':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no','nonat',_0xbc4e('0x1b'),_0xbc4e('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbc4e('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbc4e('0x7')]},'directmediadeny':{'type':Sequelize[_0xbc4e('0x7')]},'nat':{'type':Sequelize[_0xbc4e('0x7')],'defaultValue':_0xbc4e('0x1d'),'set':function(_0xe1180c){this[_0xbc4e('0xf')](_0xbc4e('0x1e'),_0xe1180c?_0xe1180c[_0xbc4e('0x11')](','):null);},'get':function(){return this[_0xbc4e('0x12')](_0xbc4e('0x1e'))?this[_0xbc4e('0x12')](_0xbc4e('0x1e'))['split'](','):null;},'comment':_0xbc4e('0x1f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xbc4e('0x7')]},'pickupgroup':{'type':Sequelize[_0xbc4e('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xbc4e('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x20')},'allow':{'type':Sequelize[_0xbc4e('0x7')],'allowNull':![],'defaultValue':_0xbc4e('0x21'),'set':function(_0x37a6e2){this[_0xbc4e('0xf')](_0xbc4e('0x22'),_0x37a6e2?_0x37a6e2[_0xbc4e('0x11')](';'):_0xbc4e('0x21'));},'get':function(){return this[_0xbc4e('0x12')](_0xbc4e('0x22'))?this[_0xbc4e('0x12')]('allow')[_0xbc4e('0x13')](';'):null;},'comment':_0xbc4e('0x23')},'autoframing':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x24'),'set':function(_0x4c9a3b){this['setDataValue'](_0xbc4e('0x25'),_0x4c9a3b?_0x4c9a3b[_0xbc4e('0x11')](','):null);},'get':function(){return this[_0xbc4e('0x12')]('insecure')?this[_0xbc4e('0x12')]('insecure')[_0xbc4e('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no',_0xbc4e('0x26'))},'promiscredir':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbc4e('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'setvar':{'type':Sequelize[_0xbc4e('0x7')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbc4e('0x7')]},'callcounter':{'type':Sequelize[_0xbc4e('0x3')]('yes','no'),'defaultValue':_0xbc4e('0x1a')},'busylevel':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xbc4e('0x7')]},'template':{'type':Sequelize[_0xbc4e('0x7')]},'videosupport':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no',_0xbc4e('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbc4e('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xbc4e('0x7')]},'session_timers':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x29'),_0xbc4e('0x2a'),_0xbc4e('0x2b'))},'session_expires':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0xbc4e('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xbc4e('0x7')]},'port':{'type':Sequelize[_0xbc4e('0x27')](0x5)},'qualify':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no'),'defaultValue':_0xbc4e('0x1a')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xbc4e('0x7')]},'rtptimeout':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbc4e('0x7')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0xbc4e('0x7')]},'contactdeny':{'type':Sequelize[_0xbc4e('0x7')]},'contactacl':{'type':Sequelize[_0xbc4e('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0xbc4e('0x7')]},'use_q850_reason':{'type':Sequelize[_0xbc4e('0x7')]},'maxforwards':{'type':Sequelize[_0xbc4e('0x27')](0xb)},'encryption':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xbc4e('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no',_0xbc4e('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xbc4e('0x7')]},'dtlscipher':{'type':Sequelize[_0xbc4e('0x7')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x2e'),'passive',_0xbc4e('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xbc4e('0x7')]},'call_limit':{'type':Sequelize[_0xbc4e('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xbc4e('0x7')]},'mohinterpret':{'type':Sequelize[_0xbc4e('0x7')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xbc4e('0x7')]},'description':{'type':Sequelize[_0xbc4e('0x7')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbc4e('0x30')},'canreinvite':{'type':Sequelize[_0xbc4e('0x3')](_0xbc4e('0x1a'),'no',_0xbc4e('0x31'),_0xbc4e('0x1b'),_0xbc4e('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbc4e('0x7')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xbc4e('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbc4e('0x7')],'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 e4134be..ef622a6 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 _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','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','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x39e15a,_0x3ee3f0){var _0x3fb42a=function(_0x4049d3){while(--_0x4049d3){_0x39e15a['push'](_0x39e15a['shift']());}};_0x3fb42a(++_0x3ee3f0);}(_0x54ef,0x112));var _0xf54e=function(_0x3a5c02,_0x1ed70e){_0x3a5c02=_0x3a5c02-0x0;var _0x5e5f7b=_0x54ef[_0x3a5c02];return _0x5e5f7b;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file +var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x41a5e3,_0x1ee36c){var _0x329576=function(_0x208679){while(--_0x208679){_0x41a5e3['push'](_0x41a5e3['shift']());}};_0x329576(++_0x1ee36c);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x112374,_0xfbb2a0){_0x112374=_0x112374-0x0;var _0x321cc4=_0xd6d6[_0x112374];return _0x321cc4;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 203ced0..661bf4f 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 _0x784e=['request-promise','path','rimraf','../../config/environment','Trunk','tools_trunks','../../config/logger','api','bluebird'];(function(_0x745da0,_0x539ffb){var _0x3a4a7b=function(_0xdee75e){while(--_0xdee75e){_0x745da0['push'](_0x745da0['shift']());}};_0x3a4a7b(++_0x539ffb);}(_0x784e,0x165));var _0xe784=function(_0x25ef81,_0x5dc440){_0x25ef81=_0x25ef81-0x0;var _0x13fbd7=_0x784e[_0x25ef81];return _0x13fbd7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe784('0x0'))(_0xe784('0x1'));var moment=require('moment');var BPromise=require(_0xe784('0x2'));var rp=require(_0xe784('0x3'));var fs=require('fs');var path=require(_0xe784('0x4'));var rimraf=require(_0xe784('0x5'));var config=require(_0xe784('0x6'));var attributes=require('./trunk.attributes');module['exports']=function(_0x1ad2d9,_0x489cb4){return _0x1ad2d9['define'](_0xe784('0x7'),attributes,{'tableName':_0xe784('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01a7=['api','bluebird','request-promise','path','Trunk','tools_trunks','lodash','../../config/logger'];(function(_0x3f07e1,_0x2e04c8){var _0x14c34e=function(_0x5a03eb){while(--_0x5a03eb){_0x3f07e1['push'](_0x3f07e1['shift']());}};_0x14c34e(++_0x2e04c8);}(_0x01a7,0x106));var _0x701a=function(_0x8a30cf,_0x40f19b){_0x8a30cf=_0x8a30cf-0x0;var _0x20f439=_0x01a7[_0x8a30cf];return _0x20f439;};'use strict';var _=require(_0x701a('0x0'));var util=require('util');var logger=require(_0x701a('0x1'))(_0x701a('0x2'));var moment=require('moment');var BPromise=require(_0x701a('0x3'));var rp=require(_0x701a('0x4'));var fs=require('fs');var path=require(_0x701a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./trunk.attributes');module['exports']=function(_0x1db406,_0x3c8119){return _0x1db406['define'](_0x701a('0x6'),attributes,{'tableName':_0x701a('0x7'),'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 eb09f7c..da6f7b8 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 _0x3bf9=['info','result','catch','findAll','options','attributes','model','include','map','GetTrunk','Trunk','find','raw','where','ShowTrunk','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message'];(function(_0x49c6d9,_0x507b6e){var _0x51d408=function(_0x1cd740){while(--_0x1cd740){_0x49c6d9['push'](_0x49c6d9['shift']());}};_0x51d408(++_0x507b6e);}(_0x3bf9,0xcf));var _0x93bf=function(_0x48cbfa,_0x80864){_0x48cbfa=_0x48cbfa-0x0;var _0x1cea43=_0x3bf9[_0x48cbfa];return _0x1cea43;};'use strict';var _=require(_0x93bf('0x0'));var util=require(_0x93bf('0x1'));var moment=require(_0x93bf('0x2'));var BPromise=require(_0x93bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93bf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x93bf('0x5'))(_0x93bf('0x6'));var config=require(_0x93bf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x93bf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x307bce,_0x469e81,_0x4065e8){return new BPromise(function(_0x4ed738,_0x1cc481){return client['request'](_0x307bce,_0x4065e8)[_0x93bf('0x9')](function(_0x1d0e58){logger['info']('Trunk,\x20%s,\x20%s',_0x469e81,_0x93bf('0xa'));logger[_0x93bf('0xb')](_0x93bf('0xc'),_0x469e81,_0x93bf('0xa'),JSON[_0x93bf('0xd')](_0x1d0e58));if(_0x1d0e58[_0x93bf('0xe')]){if(_0x1d0e58['error']['code']===0x1f4){logger[_0x93bf('0xe')](_0x93bf('0xf'),_0x469e81,_0x1d0e58['error']['message']);return _0x1cc481(_0x1d0e58[_0x93bf('0xe')][_0x93bf('0x10')]);}logger[_0x93bf('0xe')](_0x93bf('0xf'),_0x469e81,_0x1d0e58[_0x93bf('0xe')][_0x93bf('0x10')]);return _0x4ed738(_0x1d0e58[_0x93bf('0xe')][_0x93bf('0x10')]);}else{logger[_0x93bf('0x11')](_0x93bf('0xf'),_0x469e81,'request\x20sent');_0x4ed738(_0x1d0e58[_0x93bf('0x12')]['message']);}})[_0x93bf('0x13')](function(_0x2ad8a1){logger[_0x93bf('0xe')](_0x93bf('0xf'),_0x469e81,_0x2ad8a1);_0x1cc481(_0x2ad8a1);});});}exports['GetTrunk']=function(_0x82a3ef){var _0x5c6f9b=this;return new Promise(function(_0x5f198c,_0x2f3cef){return db['Trunk'][_0x93bf('0x14')]({'raw':_0x82a3ef[_0x93bf('0x15')]?_0x82a3ef['options']['raw']===undefined?!![]:![]:!![],'where':_0x82a3ef['options']?_0x82a3ef[_0x93bf('0x15')]['where']||null:null,'attributes':_0x82a3ef[_0x93bf('0x15')]?_0x82a3ef[_0x93bf('0x15')][_0x93bf('0x16')]||null:null,'limit':_0x82a3ef[_0x93bf('0x15')]?_0x82a3ef['options']['limit']||null:null,'include':_0x82a3ef['options']?_0x82a3ef[_0x93bf('0x15')]['include']?_['map'](_0x82a3ef[_0x93bf('0x15')]['include'],function(_0x507b21){return{'model':db[_0x507b21[_0x93bf('0x17')]],'as':_0x507b21['as'],'attributes':_0x507b21[_0x93bf('0x16')],'include':_0x507b21[_0x93bf('0x18')]?_[_0x93bf('0x19')](_0x507b21['include'],function(_0x30f002){return{'model':db[_0x30f002[_0x93bf('0x17')]],'as':_0x30f002['as'],'attributes':_0x30f002['attributes'],'include':_0x30f002[_0x93bf('0x18')]?_[_0x93bf('0x19')](_0x30f002[_0x93bf('0x18')],function(_0x18be4e){return{'model':db[_0x18be4e[_0x93bf('0x17')]],'as':_0x18be4e['as'],'attributes':_0x18be4e[_0x93bf('0x16')]};}):[]};}):[]};}):[]:[]})[_0x93bf('0x9')](function(_0x213e7a){logger[_0x93bf('0x11')](_0x93bf('0x1a'),_0x82a3ef);logger[_0x93bf('0xb')](_0x93bf('0x1a'),_0x82a3ef,JSON[_0x93bf('0xd')](_0x213e7a));_0x5f198c(_0x213e7a);})['catch'](function(_0x106c65){logger[_0x93bf('0xe')]('GetTrunk',_0x106c65[_0x93bf('0x10')],_0x82a3ef);_0x2f3cef(_0x5c6f9b[_0x93bf('0xe')](0x1f4,_0x106c65['message']));});});};exports['ShowTrunk']=function(_0x579c6c){var _0x255bef=this;return new Promise(function(_0x4ca2c9,_0x1b76a7){return db[_0x93bf('0x1b')][_0x93bf('0x1c')]({'raw':_0x579c6c[_0x93bf('0x15')]?_0x579c6c['options'][_0x93bf('0x1d')]===undefined?!![]:![]:!![],'where':_0x579c6c['options']?_0x579c6c['options'][_0x93bf('0x1e')]||null:null,'attributes':_0x579c6c[_0x93bf('0x15')]?_0x579c6c['options'][_0x93bf('0x16')]||null:null,'include':_0x579c6c[_0x93bf('0x15')]?_0x579c6c[_0x93bf('0x15')][_0x93bf('0x18')]?_[_0x93bf('0x19')](_0x579c6c[_0x93bf('0x15')][_0x93bf('0x18')],function(_0x29be55){return{'model':db[_0x29be55[_0x93bf('0x17')]],'as':_0x29be55['as'],'attributes':_0x29be55[_0x93bf('0x16')],'include':_0x29be55[_0x93bf('0x18')]?_['map'](_0x29be55[_0x93bf('0x18')],function(_0x58cacc){return{'model':db[_0x58cacc[_0x93bf('0x17')]],'as':_0x58cacc['as'],'attributes':_0x58cacc['attributes'],'include':_0x58cacc[_0x93bf('0x18')]?_[_0x93bf('0x19')](_0x58cacc[_0x93bf('0x18')],function(_0x1a2d47){return{'model':db[_0x1a2d47['model']],'as':_0x1a2d47['as'],'attributes':_0x1a2d47[_0x93bf('0x16')]};}):[]};}):[]};}):[]:[]})[_0x93bf('0x9')](function(_0x56292a){logger[_0x93bf('0x11')](_0x93bf('0x1f'),_0x579c6c);logger[_0x93bf('0xb')](_0x93bf('0x1f'),_0x579c6c,JSON[_0x93bf('0xd')](_0x56292a));_0x4ca2c9(_0x56292a);})[_0x93bf('0x13')](function(_0x44e571){logger['error'](_0x93bf('0x1f'),_0x44e571[_0x93bf('0x10')],_0x579c6c);_0x1b76a7(_0x255bef[_0x93bf('0xe')](0x1f4,_0x44e571[_0x93bf('0x10')]));});});}; \ No newline at end of file +var _0x5d6d=['error','code','message','result','catch','Trunk','findAll','options','raw','where','attributes','limit','model','map','include','GetTrunk','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xe019a5,_0x6681a9){var _0x2277cc=function(_0x4578a0){while(--_0x4578a0){_0xe019a5['push'](_0xe019a5['shift']());}};_0x2277cc(++_0x6681a9);}(_0x5d6d,0xef));var _0xd5d6=function(_0x4e6d2d,_0x37446c){_0x4e6d2d=_0x4e6d2d-0x0;var _0x2822e7=_0x5d6d[_0x4e6d2d];return _0x2822e7;};'use strict';var _=require(_0xd5d6('0x0'));var util=require(_0xd5d6('0x1'));var moment=require(_0xd5d6('0x2'));var BPromise=require(_0xd5d6('0x3'));var rs=require(_0xd5d6('0x4'));var fs=require('fs');var Redis=require(_0xd5d6('0x5'));var db=require(_0xd5d6('0x6'))['db'];var utils=require(_0xd5d6('0x7'));var logger=require(_0xd5d6('0x8'))('rpc');var config=require(_0xd5d6('0x9'));var jayson=require(_0xd5d6('0xa'));var client=jayson[_0xd5d6('0xb')][_0xd5d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x259066,_0x504086,_0x15d4d7){return new BPromise(function(_0x2e1e71,_0x25ca8a){return client['request'](_0x259066,_0x15d4d7)[_0xd5d6('0xd')](function(_0x30c1c8){logger[_0xd5d6('0xe')](_0xd5d6('0xf'),_0x504086,'request\x20sent');logger[_0xd5d6('0x10')](_0xd5d6('0x11'),_0x504086,_0xd5d6('0x12'),JSON[_0xd5d6('0x13')](_0x30c1c8));if(_0x30c1c8[_0xd5d6('0x14')]){if(_0x30c1c8[_0xd5d6('0x14')][_0xd5d6('0x15')]===0x1f4){logger[_0xd5d6('0x14')](_0xd5d6('0xf'),_0x504086,_0x30c1c8[_0xd5d6('0x14')][_0xd5d6('0x16')]);return _0x25ca8a(_0x30c1c8[_0xd5d6('0x14')]['message']);}logger[_0xd5d6('0x14')](_0xd5d6('0xf'),_0x504086,_0x30c1c8[_0xd5d6('0x14')][_0xd5d6('0x16')]);return _0x2e1e71(_0x30c1c8['error'][_0xd5d6('0x16')]);}else{logger[_0xd5d6('0xe')](_0xd5d6('0xf'),_0x504086,_0xd5d6('0x12'));_0x2e1e71(_0x30c1c8[_0xd5d6('0x17')][_0xd5d6('0x16')]);}})[_0xd5d6('0x18')](function(_0x341523){logger['error'](_0xd5d6('0xf'),_0x504086,_0x341523);_0x25ca8a(_0x341523);});});}exports['GetTrunk']=function(_0x56ac42){var _0x5729f1=this;return new Promise(function(_0x108682,_0x920a58){return db[_0xd5d6('0x19')][_0xd5d6('0x1a')]({'raw':_0x56ac42['options']?_0x56ac42[_0xd5d6('0x1b')][_0xd5d6('0x1c')]===undefined?!![]:![]:!![],'where':_0x56ac42['options']?_0x56ac42[_0xd5d6('0x1b')][_0xd5d6('0x1d')]||null:null,'attributes':_0x56ac42[_0xd5d6('0x1b')]?_0x56ac42[_0xd5d6('0x1b')][_0xd5d6('0x1e')]||null:null,'limit':_0x56ac42[_0xd5d6('0x1b')]?_0x56ac42[_0xd5d6('0x1b')][_0xd5d6('0x1f')]||null:null,'include':_0x56ac42['options']?_0x56ac42[_0xd5d6('0x1b')]['include']?_['map'](_0x56ac42[_0xd5d6('0x1b')]['include'],function(_0xfaa6a7){return{'model':db[_0xfaa6a7[_0xd5d6('0x20')]],'as':_0xfaa6a7['as'],'attributes':_0xfaa6a7['attributes'],'include':_0xfaa6a7['include']?_['map'](_0xfaa6a7['include'],function(_0x4bd1f9){return{'model':db[_0x4bd1f9[_0xd5d6('0x20')]],'as':_0x4bd1f9['as'],'attributes':_0x4bd1f9[_0xd5d6('0x1e')],'include':_0x4bd1f9['include']?_[_0xd5d6('0x21')](_0x4bd1f9[_0xd5d6('0x22')],function(_0xdb3f41){return{'model':db[_0xdb3f41['model']],'as':_0xdb3f41['as'],'attributes':_0xdb3f41[_0xd5d6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd5d6('0xd')](function(_0x4f12df){logger[_0xd5d6('0xe')]('GetTrunk',_0x56ac42);logger[_0xd5d6('0x10')](_0xd5d6('0x23'),_0x56ac42,JSON[_0xd5d6('0x13')](_0x4f12df));_0x108682(_0x4f12df);})[_0xd5d6('0x18')](function(_0x2c5b62){logger[_0xd5d6('0x14')](_0xd5d6('0x23'),_0x2c5b62['message'],_0x56ac42);_0x920a58(_0x5729f1[_0xd5d6('0x14')](0x1f4,_0x2c5b62['message']));});});};exports[_0xd5d6('0x24')]=function(_0x373957){var _0x17ace0=this;return new Promise(function(_0x4a06f6,_0x3cc63d){return db[_0xd5d6('0x19')]['find']({'raw':_0x373957[_0xd5d6('0x1b')]?_0x373957[_0xd5d6('0x1b')][_0xd5d6('0x1c')]===undefined?!![]:![]:!![],'where':_0x373957[_0xd5d6('0x1b')]?_0x373957['options'][_0xd5d6('0x1d')]||null:null,'attributes':_0x373957['options']?_0x373957[_0xd5d6('0x1b')][_0xd5d6('0x1e')]||null:null,'include':_0x373957[_0xd5d6('0x1b')]?_0x373957['options']['include']?_['map'](_0x373957['options']['include'],function(_0xe214b5){return{'model':db[_0xe214b5['model']],'as':_0xe214b5['as'],'attributes':_0xe214b5[_0xd5d6('0x1e')],'include':_0xe214b5['include']?_['map'](_0xe214b5[_0xd5d6('0x22')],function(_0x52c017){return{'model':db[_0x52c017[_0xd5d6('0x20')]],'as':_0x52c017['as'],'attributes':_0x52c017[_0xd5d6('0x1e')],'include':_0x52c017['include']?_['map'](_0x52c017[_0xd5d6('0x22')],function(_0x14fe8b){return{'model':db[_0x14fe8b[_0xd5d6('0x20')]],'as':_0x14fe8b['as'],'attributes':_0x14fe8b[_0xd5d6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd5d6('0xd')](function(_0x3dcaaa){logger[_0xd5d6('0xe')]('ShowTrunk',_0x373957);logger[_0xd5d6('0x10')](_0xd5d6('0x24'),_0x373957,JSON[_0xd5d6('0x13')](_0x3dcaaa));_0x4a06f6(_0x3dcaaa);})[_0xd5d6('0x18')](function(_0x48884d){logger['error'](_0xd5d6('0x24'),_0x48884d[_0xd5d6('0x16')],_0x373957);_0x3cc63d(_0x17ace0[_0xd5d6('0x14')](0x1f4,_0x48884d[_0xd5d6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 0ea713b..074bd95 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 _0x57ee=['exports','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x57ee,0xfd));var _0xe57e=function(_0x1de8a8,_0x3225be){_0x1de8a8=_0x1de8a8-0x0;var _0x5b816f=_0x57ee[_0x1de8a8];return _0x5b816f;};'use strict';var express=require(_0xe57e('0x0'));var router=express[_0xe57e('0x1')]();var auth=require(_0xe57e('0x2'));var controller=require(_0xe57e('0x3'));router[_0xe57e('0x4')](_0xe57e('0x5'),auth[_0xe57e('0x6')](),controller[_0xe57e('0x7')]);module[_0xe57e('0x8')]=router; \ No newline at end of file +var _0x9e01=['./user-setting.controller','put','/:id','isAuthenticated','update','exports','express','Router','../../components/auth/service'];(function(_0x3bad53,_0x29f417){var _0x5c6e13=function(_0x11c9ac){while(--_0x11c9ac){_0x3bad53['push'](_0x3bad53['shift']());}};_0x5c6e13(++_0x29f417);}(_0x9e01,0x1da));var _0x19e0=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9e01[_0x2be8c2];return _0x97f531;};'use strict';var express=require(_0x19e0('0x0'));var router=express[_0x19e0('0x1')]();var auth=require(_0x19e0('0x2'));var controller=require(_0x19e0('0x3'));router[_0x19e0('0x4')](_0x19e0('0x5'),auth[_0x19e0('0x6')](),controller[_0x19e0('0x7')]);module[_0x19e0('0x8')]=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 b59f5d8..0bb503e 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 _0x0693=['debug','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error','warning'];(function(_0x27fcd1,_0x4256fa){var _0x505780=function(_0xb40bb){while(--_0xb40bb){_0x27fcd1['push'](_0x27fcd1['shift']());}};_0x505780(++_0x4256fa);}(_0x0693,0x194));var _0x3069=function(_0x4767a6,_0x1acecf){_0x4767a6=_0x4767a6-0x0;var _0xd04111=_0x0693[_0x4767a6];return _0xd04111;};'use strict';var Sequelize=require(_0x3069('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x3069('0x1'),_0x3069('0x2'),'info',_0x3069('0x3')];module[_0x3069('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x3069('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3069('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x3069('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x3069('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3069('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x3069('0x9')],'unique':_0x3069('0xa')}}; \ No newline at end of file +var _0x946c=['error','warning','debug','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','sequelize'];(function(_0x74603c,_0x45dbf8){var _0x259c68=function(_0x4a12ca){while(--_0x4a12ca){_0x74603c['push'](_0x74603c['shift']());}};_0x259c68(++_0x45dbf8);}(_0x946c,0x1b7));var _0xc946=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x946c[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0xc946('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xc946('0x1'),_0xc946('0x2'),'info',_0xc946('0x3')];module[_0xc946('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xc946('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xc946('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xc946('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xc946('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xc946('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xc946('0x9')],'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 acc07fe..34efaea 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 _0x3d9c=['send','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','then','catch','lodash','../../config/logger','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults','status','update','sendStatus','stack','name'];(function(_0x1b2329,_0x504314){var _0x51d1e2=function(_0xedcc29){while(--_0xedcc29){_0x1b2329['push'](_0x1b2329['shift']());}};_0x51d1e2(++_0x504314);}(_0x3d9c,0x134));var _0xc3d9=function(_0x359567,_0x99f73f){_0x359567=_0x359567-0x0;var _0x5292f4=_0x3d9c[_0x359567];return _0x5292f4;};'use strict';var _=require(_0xc3d9('0x0'));var Redis=require('ioredis');var logger=require(_0xc3d9('0x1'))(_0xc3d9('0x2'));var config=require(_0xc3d9('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0xc3d9('0x4'))(new Redis(config[_0xc3d9('0x5')]));require(_0xc3d9('0x6'))[_0xc3d9('0x7')](socket);config[_0xc3d9('0x5')]=_[_0xc3d9('0x8')](config[_0xc3d9('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x375380,_0x46704e){_0x46704e=_0x46704e||0xc8;return function(_0x4ecff0){if(_0x4ecff0){return _0x375380[_0xc3d9('0x9')](_0x46704e)['json'](_0x4ecff0);}};}function saveUpdates(_0x3eff61){return function(_0x431cf3){if(_0x431cf3){return _0x431cf3[_0xc3d9('0xa')](_0x3eff61)['then'](function(_0x74edfd){return _0x74edfd;});}return null;};}function handleEntityNotFound(_0x98063a){return function(_0x5050b7){if(!_0x5050b7){_0x98063a[_0xc3d9('0xb')](0x194);}return _0x5050b7;};}function handleError(_0x36fdda,_0x1f5ae4){_0x1f5ae4=_0x1f5ae4||0x1f4;return function(_0x101d49){logger['error'](_0x101d49[_0xc3d9('0xc')]);if(_0x101d49['name']){delete _0x101d49[_0xc3d9('0xd')];}_0x36fdda[_0xc3d9('0x9')](_0x1f5ae4)[_0xc3d9('0xe')](_0x101d49);};}exports['update']=function(_0x994c11,_0x25f79a){if(_0x994c11['user']['role']!==_0xc3d9('0xf'))throw new Error('Unauthorized');if(isNaN(Number(_0x994c11[_0xc3d9('0x10')]['id'])))throw new Error(_0xc3d9('0x11'));return db[_0xc3d9('0x12')][_0xc3d9('0x13')]({'where':{'id':_0x994c11['params']['id']}})['then'](handleEntityNotFound(_0x25f79a,null))['then'](saveUpdates(_0x994c11[_0xc3d9('0x14')],null))[_0xc3d9('0x15')](respondWithResult(_0x25f79a,null))[_0xc3d9('0x16')](handleError(_0x25f79a,null));}; \ No newline at end of file +var _0x04d0=['sendStatus','stack','name','send','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','catch','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','register','defaults','redis','status','update'];(function(_0x5c73a8,_0x3fd675){var _0x1bbb0c=function(_0x1ba884){while(--_0x1ba884){_0x5c73a8['push'](_0x5c73a8['shift']());}};_0x1bbb0c(++_0x3fd675);}(_0x04d0,0x10a));var _0x004d=function(_0x25a8ff,_0x59f740){_0x25a8ff=_0x25a8ff-0x0;var _0x2e8477=_0x04d0[_0x25a8ff];return _0x2e8477;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x004d('0x0'))(_0x004d('0x1'));var config=require(_0x004d('0x2'));var db=require(_0x004d('0x3'))['db'];var socket=require(_0x004d('0x4'))(new Redis(config['redis']));require('./user-setting.socket')[_0x004d('0x5')](socket);config['redis']=_[_0x004d('0x6')](config[_0x004d('0x7')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x36e8bd,_0x2da158){_0x2da158=_0x2da158||0xc8;return function(_0x4d0ae4){if(_0x4d0ae4){return _0x36e8bd[_0x004d('0x8')](_0x2da158)['json'](_0x4d0ae4);}};}function saveUpdates(_0xd5ba0c){return function(_0x30ea29){if(_0x30ea29){return _0x30ea29[_0x004d('0x9')](_0xd5ba0c)['then'](function(_0x230f6c){return _0x230f6c;});}return null;};}function handleEntityNotFound(_0x21949b){return function(_0x582cc0){if(!_0x582cc0){_0x21949b[_0x004d('0xa')](0x194);}return _0x582cc0;};}function handleError(_0x5be506,_0x2ffdd2){_0x2ffdd2=_0x2ffdd2||0x1f4;return function(_0xd09c35){logger['error'](_0xd09c35[_0x004d('0xb')]);if(_0xd09c35['name']){delete _0xd09c35[_0x004d('0xc')];}_0x5be506[_0x004d('0x8')](_0x2ffdd2)[_0x004d('0xd')](_0xd09c35);};}exports[_0x004d('0x9')]=function(_0x20308e,_0x25417a){if(_0x20308e[_0x004d('0xe')][_0x004d('0xf')]!=='admin')throw new Error(_0x004d('0x10'));if(isNaN(Number(_0x20308e[_0x004d('0x11')]['id'])))throw new Error(_0x004d('0x12'));return db[_0x004d('0x13')][_0x004d('0x14')]({'where':{'id':_0x20308e[_0x004d('0x11')]['id']}})[_0x004d('0x15')](handleEntityNotFound(_0x25417a,null))[_0x004d('0x15')](saveUpdates(_0x20308e['body'],null))[_0x004d('0x15')](respondWithResult(_0x25417a,null))[_0x004d('0x16')](handleError(_0x25417a,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 16e16e3..0744664 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 _0xb2bc=['hook','exports','../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0xb2bc,0x13d));var _0xcb2b=function(_0x39d6a8,_0xc9c91a){_0x39d6a8=_0x39d6a8-0x0;var _0x93f3db=_0xb2bc[_0x39d6a8];return _0x93f3db;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xcb2b('0x0'))['db'][_0xcb2b('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xcb2b('0x2')](0x0);var events={'afterCreate':_0xcb2b('0x3'),'afterUpdate':_0xcb2b('0x4'),'afterDestroy':_0xcb2b('0x5')};function emitEvent(_0x378805){return function(_0x4ae941,_0x4d739d,_0x8330cb){UserSettingEvents[_0xcb2b('0x6')](_0x378805+':'+_0x4ae941['id'],_0x4ae941);UserSettingEvents[_0xcb2b('0x6')](_0x378805,_0x4ae941);_0x8330cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xcb2b('0x7')](e,emitEvent(event));}}module[_0xcb2b('0x8')]=UserSettingEvents; \ No newline at end of file +var _0xde4e=['hasOwnProperty','exports','events','../../mysqldb','UserSetting','setMaxListeners','update','remove'];(function(_0x38f104,_0x333d43){var _0x58999e=function(_0x513d2a){while(--_0x513d2a){_0x38f104['push'](_0x38f104['shift']());}};_0x58999e(++_0x333d43);}(_0xde4e,0x13a));var _0xede4=function(_0x294002,_0x6c1f9a){_0x294002=_0x294002-0x0;var _0x1ea45e=_0xde4e[_0x294002];return _0x1ea45e;};'use strict';var EventEmitter=require(_0xede4('0x0'));var UserSetting=require(_0xede4('0x1'))['db'][_0xede4('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xede4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xede4('0x4'),'afterDestroy':_0xede4('0x5')};function emitEvent(_0x46138d){return function(_0x175142,_0x14e5b9,_0xcbfec4){UserSettingEvents['emit'](_0x46138d+':'+_0x175142['id'],_0x175142);UserSettingEvents['emit'](_0x46138d,_0x175142);_0xcbfec4(null);};}for(var e in events){if(events[_0xede4('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xede4('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 f71d08f..22ef4b8 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 _0x0cfa=['exports','define','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x40bf44,_0x5d72af){_0x40bf44=_0x40bf44-0x0;var _0x128d56=_0x0cfa[_0x40bf44];return _0x128d56;};'use strict';var attributes=require(_0xa0cf('0x0'));module[_0xa0cf('0x1')]=function(_0x336e19){return _0x336e19[_0xa0cf('0x2')]('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d8758){if(!_0x4d8758[_0xa0cf('0x3')])_0x4d8758['clientSideLoggingEnabledSince']=null;else if(_0x4d8758[_0xa0cf('0x4')]===null)_0x4d8758[_0xa0cf('0x4')]=new Date();}}});}; \ No newline at end of file +var _0xf3aa=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','user_settings'];(function(_0x367336,_0x18c229){var _0x3423a7=function(_0xa8fa05){while(--_0xa8fa05){_0x367336['push'](_0x367336['shift']());}};_0x3423a7(++_0x18c229);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x3f92c2,_0x371fe1){_0x3f92c2=_0x3f92c2-0x0;var _0x1e964b=_0xf3aa[_0x3f92c2];return _0x1e964b;};'use strict';var attributes=require(_0xaf3a('0x0'));module[_0xaf3a('0x1')]=function(_0xdccb17){return _0xdccb17[_0xaf3a('0x2')]('UserSetting',attributes,{'tableName':_0xaf3a('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4db988){if(!_0x4db988['clientSideLoggingEnabled'])_0x4db988[_0xaf3a('0x4')]=null;else if(_0x4db988[_0xaf3a('0x4')]===null)_0x4db988[_0xaf3a('0x4')]=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 36b88e3..3d53d75 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 _0x713c=['emit','user-setting:update','register','length','user-setting:','./user-setting.events','save','remove'];(function(_0x1bab2e,_0x207e80){var _0x583387=function(_0x5ba634){while(--_0x5ba634){_0x1bab2e['push'](_0x1bab2e['shift']());}};_0x583387(++_0x207e80);}(_0x713c,0x195));var _0xc713=function(_0x5338a9,_0x2ba53e){_0x5338a9=_0x5338a9-0x0;var _0x3c2f3c=_0x713c[_0x5338a9];return _0x3c2f3c;};'use strict';var UserSettingEvents=require(_0xc713('0x0'));var events=[_0xc713('0x1'),_0xc713('0x2'),'update'];function createListener(_0x3884da,_0xc8d616){return function(_0x30eb15){_0xc8d616[_0xc713('0x3')](_0x3884da,_0x30eb15);if(_0x3884da===_0xc713('0x4')){_0xc8d616[_0xc713('0x3')]('user-setting:update:user-'+_0x30eb15['UserId'],_0x30eb15);}};}exports[_0xc713('0x5')]=function(_0x20310b){for(var _0x2f4c80=0x0,_0x1113bc=events[_0xc713('0x6')];_0x2f4c80<_0x1113bc;_0x2f4c80++){var _0x2dd06d=events[_0x2f4c80];var _0x3c8271=createListener(_0xc713('0x7')+_0x2dd06d,_0x20310b);UserSettingEvents['on'](_0x2dd06d,_0x3c8271);}}; \ No newline at end of file +var _0xc128=['remove','emit','user-setting:update','user-setting:update:user-','UserId','register','user-setting:','./user-setting.events','save'];(function(_0x1f2b50,_0x20b570){var _0x5675c1=function(_0x1745df){while(--_0x1745df){_0x1f2b50['push'](_0x1f2b50['shift']());}};_0x5675c1(++_0x20b570);}(_0xc128,0x1a5));var _0x8c12=function(_0xc7c476,_0x3dc129){_0xc7c476=_0xc7c476-0x0;var _0x46d0a0=_0xc128[_0xc7c476];return _0x46d0a0;};'use strict';var UserSettingEvents=require(_0x8c12('0x0'));var events=[_0x8c12('0x1'),_0x8c12('0x2'),'update'];function createListener(_0xb26354,_0x204406){return function(_0x2bbdbe){_0x204406[_0x8c12('0x3')](_0xb26354,_0x2bbdbe);if(_0xb26354===_0x8c12('0x4')){_0x204406[_0x8c12('0x3')](_0x8c12('0x5')+_0x2bbdbe[_0x8c12('0x6')],_0x2bbdbe);}};}exports[_0x8c12('0x7')]=function(_0x15a37b){for(var _0x38b1e8=0x0,_0x293951=events['length'];_0x38b1e8<_0x293951;_0x38b1e8++){var _0x94ee96=events[_0x38b1e8];var _0x1ee0bd=createListener(_0x8c12('0x8')+_0x94ee96,_0x15a37b);UserSettingEvents['on'](_0x94ee96,_0x1ee0bd);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 2bfe0c6..9130115 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 _0xe08e=['/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','getTeams','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','post','create','/create_many','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addSquareProjects','createApiKey','put','update','changePassword','delete','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','/:id','show','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions'];(function(_0x2afbbc,_0x55324e){var _0x290ebd=function(_0xfae13a){while(--_0xfae13a){_0x2afbbc['push'](_0x2afbbc['shift']());}};_0x290ebd(++_0x55324e);}(_0xe08e,0x12e));var _0xee08=function(_0x503a0c,_0xbc78c5){_0x503a0c=_0x503a0c-0x0;var _0x3b2e83=_0xe08e[_0x503a0c];return _0x3b2e83;};'use strict';var multer=require(_0xee08('0x0'));var util=require(_0xee08('0x1'));var path=require(_0xee08('0x2'));var timeout=require(_0xee08('0x3'));var express=require(_0xee08('0x4'));var router=express[_0xee08('0x5')]();var fs_extra=require(_0xee08('0x6'));var auth=require(_0xee08('0x7'));var interaction=require(_0xee08('0x8'));var config=require('../../config/environment');var controller=require(_0xee08('0x9'));router[_0xee08('0xa')]('/',auth[_0xee08('0xb')](),controller[_0xee08('0xc')]);router['get'](_0xee08('0xd'),auth[_0xee08('0xb')](),controller[_0xee08('0xe')]);router[_0xee08('0xa')]('/whoami',auth['isAuthenticated'](),controller[_0xee08('0xf')]);router['get'](_0xee08('0x10'),auth[_0xee08('0xb')](),controller['getPresence']);router[_0xee08('0xa')](_0xee08('0x11'),auth[_0xee08('0xb')](),controller[_0xee08('0x12')]);router[_0xee08('0xa')]('/:id/avatar',controller['getAvatar']);router[_0xee08('0xa')](_0xee08('0x13'),auth[_0xee08('0xb')](),controller[_0xee08('0x14')]);router[_0xee08('0xa')](_0xee08('0x15'),auth[_0xee08('0xb')](),controller['getContacts']);router[_0xee08('0xa')](_0xee08('0x16'),auth[_0xee08('0xb')](),controller[_0xee08('0x17')]);router[_0xee08('0xa')](_0xee08('0x18'),auth[_0xee08('0xb')](),controller['getVoiceQueuesRt']);router[_0xee08('0xa')](_0xee08('0x19'),auth[_0xee08('0xb')](),controller[_0xee08('0x1a')]);router[_0xee08('0xa')](_0xee08('0x1b'),auth[_0xee08('0xb')](),controller[_0xee08('0x1c')]);router['get'](_0xee08('0x1d'),auth[_0xee08('0xb')](),controller[_0xee08('0x1e')]);router[_0xee08('0xa')]('/:id/chat/interactions',auth[_0xee08('0xb')](),controller[_0xee08('0x1f')]);router['get'](_0xee08('0x20'),auth['isAuthenticated'](),controller[_0xee08('0x21')]);router[_0xee08('0xa')](_0xee08('0x22'),auth[_0xee08('0xb')](),controller[_0xee08('0x23')]);router[_0xee08('0xa')](_0xee08('0x24'),auth[_0xee08('0xb')](),controller['getSmsInteractions']);router[_0xee08('0xa')](_0xee08('0x25'),auth[_0xee08('0xb')](),controller['getFaxInteractions']);router[_0xee08('0xa')](_0xee08('0x26'),auth[_0xee08('0xb')](),controller['getWhatsappInteractions']);router['get'](_0xee08('0x27'),auth[_0xee08('0xb')](),controller[_0xee08('0x28')]);router[_0xee08('0xa')]('/:id/lists',auth[_0xee08('0xb')](),controller[_0xee08('0x29')]);router['get'](_0xee08('0x2a'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0xee08('0x2b'),auth[_0xee08('0xb')](),controller[_0xee08('0x2c')]);router[_0xee08('0xa')](_0xee08('0x2d'),auth[_0xee08('0xb')](),controller[_0xee08('0x2e')]);router[_0xee08('0xa')](_0xee08('0x2f'),auth[_0xee08('0xb')](),controller[_0xee08('0x30')]);router[_0xee08('0xa')](_0xee08('0x31'),auth['isAuthenticated'](),controller[_0xee08('0x32')]);router[_0xee08('0xa')](_0xee08('0x33'),auth[_0xee08('0xb')](),controller['getSmsAccounts']);router[_0xee08('0xa')]('/:id/chat_websites',auth[_0xee08('0xb')](),controller[_0xee08('0x34')]);router[_0xee08('0xa')](_0xee08('0x35'),auth[_0xee08('0xb')](),controller['getWhatsappAccounts']);router[_0xee08('0xa')](_0xee08('0x36'),auth[_0xee08('0xb')](),controller[_0xee08('0x37')]);router[_0xee08('0xa')]('/:id/scheduled_calls',auth[_0xee08('0xb')](),controller[_0xee08('0x38')]);router[_0xee08('0xa')](_0xee08('0x39'),auth['isAuthenticated'](),controller['getApiKey']);router['post'](_0xee08('0x15'),auth[_0xee08('0xb')](),controller['addContacts']);router[_0xee08('0x3a')]('/',auth['isAuthenticated'](),controller[_0xee08('0x3b')]);router[_0xee08('0x3a')](_0xee08('0x3c'),auth[_0xee08('0xb')](),controller['bulkCreate']);router['post'](_0xee08('0x16'),auth['isAuthenticated'](),controller[_0xee08('0x3d')]);var upload=multer({'storage':multer[_0xee08('0x3e')]({'destination':function(_0x5c3591,_0x16d5f1,_0x4b4cda){_0x4b4cda(null,path['join'](config[_0xee08('0x3f')],_0xee08('0x40')));},'filename':function(_0x402dfa,_0x2684d7,_0x21f3fc){_0x21f3fc(null,util[_0xee08('0x41')](_0xee08('0x42'),Date[_0xee08('0x43')](),_0x2684d7[_0xee08('0x44')]));}})});router['post'](_0xee08('0x45'),upload['single'](_0xee08('0x46')),controller['addAvatar']);router[_0xee08('0x3a')](_0xee08('0x47'),auth[_0xee08('0xb')](),controller[_0xee08('0x48')]);router[_0xee08('0x3a')](_0xee08('0x49'),auth[_0xee08('0xb')](),controller[_0xee08('0x4a')]);router[_0xee08('0x3a')](_0xee08('0x4b'),auth[_0xee08('0xb')](),controller[_0xee08('0x4c')]);router[_0xee08('0x3a')]('/:id/unpause',auth[_0xee08('0xb')](),controller[_0xee08('0x4d')]);router[_0xee08('0x3a')]('/:id/teams',auth[_0xee08('0xb')](),controller[_0xee08('0x4e')]);router[_0xee08('0x3a')]('/:id/chat_interactions',auth[_0xee08('0xb')](),controller[_0xee08('0x4f')]);router[_0xee08('0x3a')](_0xee08('0x50'),auth[_0xee08('0xb')](),controller[_0xee08('0x51')]);router[_0xee08('0x3a')](_0xee08('0x52'),auth[_0xee08('0xb')](),controller['addFaxInteractions']);router[_0xee08('0x3a')](_0xee08('0x53'),auth[_0xee08('0xb')](),controller[_0xee08('0x54')]);router[_0xee08('0x3a')](_0xee08('0x55'),auth[_0xee08('0xb')](),controller[_0xee08('0x56')]);router[_0xee08('0x3a')](_0xee08('0x57'),auth[_0xee08('0xb')](),controller['addWhatsappInteractions']);router[_0xee08('0x3a')](_0xee08('0x2d'),auth[_0xee08('0xb')](),controller[_0xee08('0x58')]);router['post'](_0xee08('0x2f'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0xee08('0x3a')](_0xee08('0x31'),auth[_0xee08('0xb')](),controller[_0xee08('0x59')]);router[_0xee08('0x3a')](_0xee08('0x33'),auth[_0xee08('0xb')](),controller[_0xee08('0x5a')]);router['post'](_0xee08('0x5b'),auth[_0xee08('0xb')](),controller[_0xee08('0x5c')]);router[_0xee08('0x3a')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['addWhatsappAccounts']);router['post'](_0xee08('0x36'),auth[_0xee08('0xb')](),controller[_0xee08('0x5d')]);router[_0xee08('0x3a')]('/:id/api_key',auth[_0xee08('0xb')](),controller[_0xee08('0x5e')]);router[_0xee08('0x5f')](_0xee08('0x11'),auth[_0xee08('0xb')](),controller[_0xee08('0x60')]);router[_0xee08('0x5f')]('/:id/password',auth['isAuthenticated'](),controller[_0xee08('0x61')]);router['delete'](_0xee08('0x16'),auth['isAuthenticated'](),controller['removeQueues']);router[_0xee08('0x62')]('/:id/teams',auth[_0xee08('0xb')](),controller['removeTeams']);router['delete']('/:id',auth[_0xee08('0xb')](),controller['destroy']);router[_0xee08('0x62')](_0xee08('0x63'),auth[_0xee08('0xb')](),controller[_0xee08('0x64')]);router['delete'](_0xee08('0x50'),auth[_0xee08('0xb')](),controller['removeMailInteractions']);router[_0xee08('0x62')]('/:id/fax_interactions',auth[_0xee08('0xb')](),controller[_0xee08('0x65')]);router[_0xee08('0x62')](_0xee08('0x53'),auth[_0xee08('0xb')](),controller[_0xee08('0x66')]);router['delete'](_0xee08('0x55'),auth[_0xee08('0xb')](),controller['removeOpenchannelInteractions']);router[_0xee08('0x62')](_0xee08('0x57'),auth['isAuthenticated'](),controller[_0xee08('0x67')]);router['delete'](_0xee08('0x2d'),auth[_0xee08('0xb')](),controller[_0xee08('0x68')]);router[_0xee08('0x62')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xee08('0x69')]);router[_0xee08('0x62')](_0xee08('0x31'),auth[_0xee08('0xb')](),controller['removeOpenchannelAccounts']);router[_0xee08('0x62')](_0xee08('0x33'),auth[_0xee08('0xb')](),controller[_0xee08('0x6a')]);router[_0xee08('0x62')](_0xee08('0x5b'),auth[_0xee08('0xb')](),controller[_0xee08('0x6b')]);router['delete'](_0xee08('0x35'),auth['isAuthenticated'](),controller[_0xee08('0x6c')]);router[_0xee08('0x62')](_0xee08('0x36'),auth[_0xee08('0xb')](),controller[_0xee08('0x6d')]);router['delete'](_0xee08('0x39'),auth[_0xee08('0xb')](),controller[_0xee08('0x6e')]);module[_0xee08('0x6f')]=router; \ No newline at end of file +var _0x7a94=['getScreenRecordings','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','update','put','changePassword','removeQueues','removeTeams','delete','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings'];(function(_0xf0ccb,_0x5887e2){var _0x48744d=function(_0x3e686c){while(--_0x3e686c){_0xf0ccb['push'](_0xf0ccb['shift']());}};_0x48744d(++_0x5887e2);}(_0x7a94,0x187));var _0x47a9=function(_0x3154ae,_0x2150e3){_0x3154ae=_0x3154ae-0x0;var _0x45edf9=_0x7a94[_0x3154ae];return _0x45edf9;};'use strict';var multer=require('multer');var util=require(_0x47a9('0x0'));var path=require('path');var timeout=require(_0x47a9('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x47a9('0x2'));var auth=require(_0x47a9('0x3'));var interaction=require(_0x47a9('0x4'));var config=require(_0x47a9('0x5'));var controller=require(_0x47a9('0x6'));router['get']('/',auth[_0x47a9('0x7')](),controller[_0x47a9('0x8')]);router[_0x47a9('0x9')]('/describe',auth[_0x47a9('0x7')](),controller['describe']);router[_0x47a9('0x9')]('/whoami',auth[_0x47a9('0x7')](),controller[_0x47a9('0xa')]);router[_0x47a9('0x9')](_0x47a9('0xb'),auth[_0x47a9('0x7')](),controller['getPresence']);router[_0x47a9('0x9')](_0x47a9('0xc'),auth[_0x47a9('0x7')](),controller[_0x47a9('0xd')]);router[_0x47a9('0x9')](_0x47a9('0xe'),controller[_0x47a9('0xf')]);router[_0x47a9('0x9')](_0x47a9('0x10'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x11')]);router['get'](_0x47a9('0x12'),auth[_0x47a9('0x7')](),controller['getContacts']);router[_0x47a9('0x9')](_0x47a9('0x13'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x14')]);router[_0x47a9('0x9')]('/:id/queues_rt',auth[_0x47a9('0x7')](),controller['getVoiceQueuesRt']);router[_0x47a9('0x9')](_0x47a9('0x15'),auth['isAuthenticated'](),controller['getGroups']);router[_0x47a9('0x9')](_0x47a9('0x16'),auth['isAuthenticated'](),controller[_0x47a9('0x17')]);router[_0x47a9('0x9')](_0x47a9('0x18'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x19')]);router['get']('/:id/chat/interactions',auth[_0x47a9('0x7')](),controller['getChatInteractions']);router[_0x47a9('0x9')](_0x47a9('0x1a'),auth[_0x47a9('0x7')](),controller['getOpenchannelInteractions']);router[_0x47a9('0x9')](_0x47a9('0x1b'),auth[_0x47a9('0x7')](),controller['getMailInteractions']);router['get'](_0x47a9('0x1c'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x1d')]);router['get'](_0x47a9('0x1e'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x1f')]);router[_0x47a9('0x9')]('/:id/whatsapp/interactions',auth[_0x47a9('0x7')](),controller[_0x47a9('0x20')]);router[_0x47a9('0x9')](_0x47a9('0x21'),auth['isAuthenticated'](),controller[_0x47a9('0x22')]);router[_0x47a9('0x9')](_0x47a9('0x23'),auth[_0x47a9('0x7')](),controller['getLists']);router[_0x47a9('0x9')](_0x47a9('0x24'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x25')]);router[_0x47a9('0x9')](_0x47a9('0x26'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x47a9('0x9')]('/:id/fax_accounts',auth[_0x47a9('0x7')](),controller['getFaxAccounts']);router[_0x47a9('0x9')](_0x47a9('0x27'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0x47a9('0x9')](_0x47a9('0x28'),auth['isAuthenticated'](),controller[_0x47a9('0x29')]);router[_0x47a9('0x9')](_0x47a9('0x2a'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x2b')]);router[_0x47a9('0x9')](_0x47a9('0x2c'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x2d')]);router[_0x47a9('0x9')]('/:id/whatsapp_accounts',auth[_0x47a9('0x7')](),controller['getWhatsappAccounts']);router[_0x47a9('0x9')](_0x47a9('0x2e'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x2f')]);router[_0x47a9('0x9')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0x47a9('0x9')](_0x47a9('0x30'),auth['isAuthenticated'](),controller[_0x47a9('0x31')]);router[_0x47a9('0x32')](_0x47a9('0x12'),auth[_0x47a9('0x7')](),controller['addContacts']);router[_0x47a9('0x32')]('/',auth[_0x47a9('0x7')](),controller['create']);router[_0x47a9('0x32')]('/create_many',auth[_0x47a9('0x7')](),controller[_0x47a9('0x33')]);router['post']('/:id/queues',auth[_0x47a9('0x7')](),controller[_0x47a9('0x34')]);var upload=multer({'storage':multer[_0x47a9('0x35')]({'destination':function(_0x58254c,_0x7319b8,_0x564b68){_0x564b68(null,path[_0x47a9('0x36')](config['root'],_0x47a9('0x37')));},'filename':function(_0x408787,_0x563827,_0x24d525){_0x24d525(null,util[_0x47a9('0x38')](_0x47a9('0x39'),Date[_0x47a9('0x3a')](),_0x563827[_0x47a9('0x3b')]));}})});router[_0x47a9('0x32')](_0x47a9('0xe'),upload[_0x47a9('0x3c')](_0x47a9('0x3d')),controller['addAvatar']);router[_0x47a9('0x32')](_0x47a9('0x3e'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x3f')]);router[_0x47a9('0x32')](_0x47a9('0x40'),auth[_0x47a9('0x7')](),controller['logout']);router[_0x47a9('0x32')]('/:id/pause',auth['isAuthenticated'](),controller[_0x47a9('0x41')]);router[_0x47a9('0x32')](_0x47a9('0x42'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x43')]);router[_0x47a9('0x32')]('/:id/teams',auth[_0x47a9('0x7')](),controller[_0x47a9('0x44')]);router[_0x47a9('0x32')](_0x47a9('0x45'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x46')]);router[_0x47a9('0x32')](_0x47a9('0x47'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x48')]);router[_0x47a9('0x32')](_0x47a9('0x49'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x4a')]);router[_0x47a9('0x32')](_0x47a9('0x4b'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x47a9('0x32')](_0x47a9('0x4c'),auth[_0x47a9('0x7')](),controller['addOpenchannelInteractions']);router[_0x47a9('0x32')]('/:id/whatsapp_interactions',auth[_0x47a9('0x7')](),controller[_0x47a9('0x4d')]);router[_0x47a9('0x32')](_0x47a9('0x4e'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x4f')]);router[_0x47a9('0x32')](_0x47a9('0x27'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x50')]);router[_0x47a9('0x32')]('/:id/openchannel_accounts',auth[_0x47a9('0x7')](),controller[_0x47a9('0x51')]);router[_0x47a9('0x32')](_0x47a9('0x2a'),auth['isAuthenticated'](),controller[_0x47a9('0x52')]);router[_0x47a9('0x32')](_0x47a9('0x2c'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x53')]);router[_0x47a9('0x32')](_0x47a9('0x54'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x55')]);router['post'](_0x47a9('0x2e'),auth['isAuthenticated'](),controller[_0x47a9('0x56')]);router[_0x47a9('0x32')]('/:id/api_key',auth[_0x47a9('0x7')](),controller[_0x47a9('0x57')]);router['put'](_0x47a9('0xc'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x58')]);router[_0x47a9('0x59')]('/:id/password',auth[_0x47a9('0x7')](),controller[_0x47a9('0x5a')]);router['delete']('/:id/queues',auth[_0x47a9('0x7')](),controller[_0x47a9('0x5b')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x47a9('0x5c')]);router[_0x47a9('0x5d')](_0x47a9('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x47a9('0x5d')](_0x47a9('0x45'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x5e')]);router[_0x47a9('0x5d')](_0x47a9('0x47'),auth['isAuthenticated'](),controller[_0x47a9('0x5f')]);router['delete'](_0x47a9('0x49'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x60')]);router[_0x47a9('0x5d')](_0x47a9('0x4b'),auth[_0x47a9('0x7')](),controller['removeSmsInteractions']);router[_0x47a9('0x5d')](_0x47a9('0x4c'),auth[_0x47a9('0x7')](),controller['removeOpenchannelInteractions']);router[_0x47a9('0x5d')](_0x47a9('0x61'),auth[_0x47a9('0x7')](),controller['removeWhatsappInteractions']);router[_0x47a9('0x5d')]('/:id/fax_accounts',auth[_0x47a9('0x7')](),controller[_0x47a9('0x62')]);router[_0x47a9('0x5d')](_0x47a9('0x27'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x63')]);router[_0x47a9('0x5d')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x47a9('0x64')]);router[_0x47a9('0x5d')](_0x47a9('0x2c'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x65')]);router[_0x47a9('0x5d')](_0x47a9('0x54'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x66')]);router[_0x47a9('0x5d')](_0x47a9('0x2e'),auth[_0x47a9('0x7')](),controller[_0x47a9('0x67')]);router[_0x47a9('0x5d')](_0x47a9('0x30'),auth[_0x47a9('0x7')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 50c4bbe..47a915e 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 _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x17485b,_0x26a84b){var _0x2532d3=function(_0x5a6629){while(--_0x5a6629){_0x17485b['push'](_0x17485b['shift']());}};_0x2532d3(++_0x26a84b);}(_0xe706,0xa3));var _0x6e70=function(_0x1702b8,_0x28c7da){_0x1702b8=_0x1702b8-0x0;var _0x50028a=_0xe706[_0x1702b8];return _0x50028a;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0}}; \ No newline at end of file +var _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x145c3f,_0x274836){var _0x5dffa0=function(_0x1c2350){while(--_0x1c2350){_0x145c3f['push'](_0x145c3f['shift']());}};_0x5dffa0(++_0x274836);}(_0xedd9,0xfc));var _0x9edd=function(_0xe3c426,_0xb072c0){_0xe3c426=_0xe3c426-0x0;var _0x410294=_0xedd9[_0xe3c426];return _0x410294;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'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 735a09d..258e8ff 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 _0x225f=['squel','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../errors/api','APINotFoundError','handleError','./user.socket','defaults','redis','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','update','destroy','admin','Users','Agents','Telephones','filter','ignore','map','value','includes','role','name','UserProfileResource','end','stack','send','index','User','rawAttributes','key','salt','getOptions','where','include','query','userSetting','true','UserSetting','attributes','findAll','rows','length','push','chat','sms','dataValues','fax','mail','openchannel','whatsapp','show','params','model','password','filters','intersection','fields','includeAll','merge','options','openTabs','all','body','find','describe','addContacts','ids','omit','internal','Setting','securePassword','max','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','SELECT','from','voicemail','fullname','email','agent','permissions','101','102','113','110','105','106','107','109','111','114','115','create','Unauthorized','user','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','telephone','isEmpty','compact','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','penalty','spread','toLowerCase','QueueId','emit','Queue:save','voice','VoiceQueue','get','format','UserVoiceQueueRt','upsert','removeQueues','channel','remove','isArray','addAvatar','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','WHATSAPP','concat','getContacts','keys','CmContact','order','sort','hasOwnProperty','List','Tag','Tags','tag','nolimit','Queue','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','LOGININPAUSE','isMiddleware','resolve','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','whatsappPause','pauseType','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','transaction','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','removeAgent','Queue:remove','CmList','getLists','getVoiceQueues','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','CmHopper','$or','$gt','$gte','$lte','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$contains','$contained','firstName','lastName','phone','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','inbound','flatten','lower','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','ringing','voiceStatus','busy','slice','QueryTypes','select','field','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','moment','util','path','lodash'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x225f,0x18f));var _0xf225=function(_0x314323,_0x45e00c){_0x314323=_0x314323-0x0;var _0xf8a43d=_0x225f[_0x314323];return _0xf8a43d;};'use strict';var moment=require(_0xf225('0x0'));var util=require(_0xf225('0x1'));var path=require(_0xf225('0x2'));var fs=require('fs');var _=require(_0xf225('0x3'));var squel=require(_0xf225('0x4'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require(_0xf225('0x5'));var qs=require(_0xf225('0x6'));var logger=require(_0xf225('0x7'))(_0xf225('0x8'));var utils=require('../../config/utils');var config=require(_0xf225('0x9'));var licenseUtil=require(_0xf225('0xa'));var APIBadRequestError=require(_0xf225('0xb'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0xf225('0xc')];var APIHandleError=require(_0xf225('0xb'))[_0xf225('0xd')];var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf225('0xe'))['register'](socket);config['redis']=_[_0xf225('0xf')](config[_0xf225('0x10')],{'host':_0xf225('0x11'),'port':0x18eb});var amiClient=jayson[_0xf225('0x12')][_0xf225('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x3c4c46,_0x16b2af,_0x5a0052,_0x3029ec){return new Promise(function(_0x256de6,_0x2ec6e7){var _0x1ad15a=_0x3029ec||amiClient;return _0x1ad15a[_0xf225('0x14')](_0x3c4c46,_0x5a0052)[_0xf225('0x15')](function(_0x202e7d){logger[_0xf225('0x16')](_0xf225('0x17'),_0x16b2af,_0xf225('0x18'));logger['debug'](_0xf225('0x19'),_0x16b2af,_0xf225('0x18'),JSON[_0xf225('0x1a')](_0x202e7d));if(_0x202e7d[_0xf225('0x1b')]){if(_0x202e7d[_0xf225('0x1b')][_0xf225('0x1c')]===0x1f4){logger[_0xf225('0x1b')](_0xf225('0x17'),_0x16b2af,_0x202e7d[_0xf225('0x1b')][_0xf225('0x1d')]);return _0x2ec6e7(_0x202e7d[_0xf225('0x1b')][_0xf225('0x1d')]);}logger['error'](_0xf225('0x17'),_0x16b2af,_0x202e7d[_0xf225('0x1b')][_0xf225('0x1d')]);return _0x256de6(_0x202e7d[_0xf225('0x1b')][_0xf225('0x1d')]);}else{logger[_0xf225('0x16')]('User,\x20%s,\x20%s',_0x16b2af,_0xf225('0x18'));_0x256de6(_0x202e7d[_0xf225('0x1e')]['message']);}})[_0xf225('0x1f')](function(_0x27f026){logger[_0xf225('0x1b')](_0xf225('0x17'),_0x16b2af,_0x27f026);_0x2ec6e7(_0x27f026);});});}function respondWithStatusCode(_0x2b9082,_0x3e6d78){_0x3e6d78=_0x3e6d78||0xcc;return function(_0xfa5c37){if(_0xfa5c37){return _0x2b9082[_0xf225('0x20')](_0x3e6d78);}return _0x2b9082[_0xf225('0x21')](_0x3e6d78)['end']();};}function respondWithResult(_0x47bcaf,_0x159fa9){_0x159fa9=_0x159fa9||0xc8;return function(_0x2b9836){if(_0x2b9836){return _0x47bcaf[_0xf225('0x21')](_0x159fa9)[_0xf225('0x22')](_0x2b9836);}};}function respondWithFilteredResult(_0x1ef365,_0x11847e){return function(_0x4c2179){if(_0x4c2179){var _0x21a119=typeof _0x11847e[_0xf225('0x23')]==='undefined'&&typeof _0x11847e['limit']===_0xf225('0x24');var _0x13c33d=_0x4c2179[_0xf225('0x25')];var _0x154969=_0x21a119?0x0:_0x11847e[_0xf225('0x23')];var _0x2dc88b=_0x21a119?_0x4c2179[_0xf225('0x25')]:_0x11847e['offset']+_0x11847e[_0xf225('0x26')];var _0x5da36d;if(_0x2dc88b>=_0x13c33d){_0x2dc88b=_0x13c33d;_0x5da36d=0xc8;}else{_0x5da36d=0xce;}_0x1ef365['status'](_0x5da36d);return _0x1ef365[_0xf225('0x27')]('Content-Range',_0x154969+'-'+_0x2dc88b+'/'+_0x13c33d)[_0xf225('0x22')](_0x4c2179);}return null;};}function saveUpdates(_0x3a96fa){return function(_0x359416){if(_0x359416){return _0x359416[_0xf225('0x28')](_0x3a96fa)['then'](function(_0x23900f){socket['emit']('userNotification:recalc:'+_0x23900f['id'],{});return _0x23900f;});}return null;};}function removeEntity(_0x2585aa){return function(_0x300f25){if(_0x300f25){return _0x300f25[_0xf225('0x29')]()[_0xf225('0x15')](function(){var _0x951ecd=_0x300f25['get']({'plain':!![]});if(_0x951ecd['role']===_0xf225('0x2a'))return;var _0x36ef6d=[{'name':_0xf225('0x2b'),'value':'user','ignore':!![]},{'name':_0xf225('0x2c'),'value':'agent','ignore':![]},{'name':_0xf225('0x2d'),'value':'telephone','ignore':![]}];var _0x305725=_(_0x36ef6d)[_0xf225('0x2e')](_0xf225('0x2f'))[_0xf225('0x30')](_0xf225('0x31'))[_0xf225('0x31')]();if(_[_0xf225('0x32')](_0x305725,_0x951ecd[_0xf225('0x33')])){return;}var _0x1ec394=_['find'](_0x36ef6d,[_0xf225('0x31'),_0x951ecd['role']])[_0xf225('0x34')];return db[_0xf225('0x35')][_0xf225('0x29')]({'where':{'type':_0x1ec394,'resourceId':_0x951ecd['id']}})[_0xf225('0x15')](function(){return _0x300f25;});})[_0xf225('0x15')](function(){_0x2585aa['status'](0xcc)[_0xf225('0x36')]();});}};}function handleEntityNotFound(_0x4a732f){return function(_0x5a2a13){if(!_0x5a2a13){_0x4a732f[_0xf225('0x20')](0x194);}return _0x5a2a13;};}function handleError(_0x33ac34,_0x487158){_0x487158=_0x487158||0x1f4;return function(_0x33e0fa){logger['error'](_0x33e0fa[_0xf225('0x37')]);if(_0x33e0fa[_0xf225('0x34')]){delete _0x33e0fa[_0xf225('0x34')];}_0x33ac34['status'](_0x487158)[_0xf225('0x38')](_0x33e0fa);};}exports[_0xf225('0x39')]=function(_0x2cee21,_0x4f33a5){var _0x139701={},_0x3466fa={'count':0x0,'rows':[]};var _0xa3c334=_(db[_0xf225('0x3a')][_0xf225('0x3b')])[_0xf225('0x30')](function(_0x3c2402){return{'name':_0x3c2402['fieldName'],'type':_0x3c2402['type'][_0xf225('0x3c')]};})[_0xf225('0x2e')](function(_0x26812a){return!_[_0xf225('0x32')](['password',_0xf225('0x3d')],_0x26812a[_0xf225('0x34')]);})[_0xf225('0x31')]();_0x139701=qs[_0xf225('0x3e')](_0xa3c334,_0x2cee21);var _0x3cb8f8={'where':_0x139701[_0xf225('0x3f')]};return db[_0xf225('0x3a')]['count'](_0x3cb8f8)[_0xf225('0x15')](function(_0x2c74a3){_0x3466fa['count']=_0x2c74a3;if(_0x2cee21['query']['includeAll']){_0x139701[_0xf225('0x40')]=[{'all':!![]}];}if(_0x2cee21[_0xf225('0x41')][_0xf225('0x42')]===_0xf225('0x43')){_0x139701[_0xf225('0x40')]=[{'model':db[_0xf225('0x44')],'as':_0xf225('0x42')}];}if(!_[_0xf225('0x32')](_0x139701[_0xf225('0x45')],'id')){_0x139701[_0xf225('0x45')]['push']('id');}return db[_0xf225('0x3a')][_0xf225('0x46')](_0x139701);})[_0xf225('0x15')](function(_0x58eecc){_0x3466fa[_0xf225('0x47')]=_0x58eecc;if(_0x2cee21[_0xf225('0x41')]['openTabs']==='true'){var _0xe29447=[];for(var _0x461d48=0x0;_0x461d48<_0x3466fa[_0xf225('0x47')][_0xf225('0x48')];_0x461d48++){_0xe29447[_0xf225('0x49')](get_open_tabs(_0xf225('0x4a'),_0x3466fa['rows'][_0x461d48]['dataValues']));_0xe29447[_0xf225('0x49')](get_open_tabs(_0xf225('0x4b'),_0x3466fa[_0xf225('0x47')][_0x461d48][_0xf225('0x4c')]));_0xe29447[_0xf225('0x49')](get_open_tabs(_0xf225('0x4d'),_0x3466fa['rows'][_0x461d48][_0xf225('0x4c')]));_0xe29447[_0xf225('0x49')](get_open_tabs(_0xf225('0x4e'),_0x3466fa['rows'][_0x461d48]['dataValues']));_0xe29447[_0xf225('0x49')](get_open_tabs(_0xf225('0x4f'),_0x3466fa[_0xf225('0x47')][_0x461d48][_0xf225('0x4c')]));_0xe29447['push'](get_open_tabs(_0xf225('0x50'),_0x3466fa['rows'][_0x461d48][_0xf225('0x4c')]));}return Promise['all'](_0xe29447)[_0xf225('0x15')](function(){return _0x3466fa;});}else{return _0x3466fa;}})[_0xf225('0x15')](respondWithFilteredResult(_0x4f33a5,_0x139701))['catch'](handleError(_0x4f33a5,null));};exports[_0xf225('0x51')]=function(_0x182456,_0x5f3878){var _0x298add={'raw':![],'where':{'id':_0x182456[_0xf225('0x52')]['id']}},_0x37baae={};_0x37baae[_0xf225('0x53')]=_['differenceBy'](_['keys'](db['User'][_0xf225('0x3b')]),[_0xf225('0x54'),_0xf225('0x3d')]);_0x37baae[_0xf225('0x41')]=_['keys'](_0x182456[_0xf225('0x41')]);_0x37baae[_0xf225('0x55')]=_[_0xf225('0x56')](_0x37baae['model'],_0x37baae[_0xf225('0x41')]);_0x298add[_0xf225('0x45')]=_[_0xf225('0x56')](_0x37baae[_0xf225('0x53')],qs[_0xf225('0x57')](_0x182456['query']['fields']));_0x298add[_0xf225('0x45')]=_0x298add['attributes'][_0xf225('0x48')]?_0x298add[_0xf225('0x45')]:_0x37baae[_0xf225('0x53')];if(_0x182456[_0xf225('0x41')][_0xf225('0x58')]){_0x298add[_0xf225('0x40')]=[{'all':!![]}];}if(_0x182456[_0xf225('0x41')][_0xf225('0x42')]===_0xf225('0x43')){_0x298add[_0xf225('0x40')]=[{'model':db[_0xf225('0x44')],'as':_0xf225('0x42')}];}_0x298add=_[_0xf225('0x59')]({},_0x298add,_0x182456[_0xf225('0x5a')]);if(!_[_0xf225('0x32')](_0x298add[_0xf225('0x45')],'id')){_0x298add[_0xf225('0x45')][_0xf225('0x49')]('id');}return db['User']['find'](_0x298add)[_0xf225('0x15')](handleEntityNotFound(_0x5f3878,null))[_0xf225('0x15')](function(_0x5073df){var _0x4779a5=[];values=_0x5073df;if(_0x182456['query'][_0xf225('0x5b')]==='true'){_0x4779a5['push'](get_open_tabs(_0xf225('0x4a'),_0x5073df[_0xf225('0x4c')]));_0x4779a5['push'](get_open_tabs(_0xf225('0x4b'),_0x5073df['dataValues']));_0x4779a5[_0xf225('0x49')](get_open_tabs('openchannel',_0x5073df['dataValues']));_0x4779a5[_0xf225('0x49')](get_open_tabs(_0xf225('0x50'),_0x5073df[_0xf225('0x4c')]));_0x4779a5['push'](get_open_tabs('fax',_0x5073df[_0xf225('0x4c')]));_0x4779a5[_0xf225('0x49')](get_open_tabs('mail',_0x5073df[_0xf225('0x4c')]));return Promise[_0xf225('0x5c')](_0x4779a5);}else{return values;}})['then'](function(){return values;})[_0xf225('0x15')](respondWithResult(_0x5f3878,null))[_0xf225('0x1f')](handleError(_0x5f3878,null));};exports[_0xf225('0x28')]=function(_0x464286,_0x413fdc){if(_0x464286[_0xf225('0x5d')]['id']){delete _0x464286['body']['id'];}delete _0x464286[_0xf225('0x5d')][_0xf225('0x33')];return db[_0xf225('0x3a')][_0xf225('0x5e')]({'where':{'id':_0x464286['params']['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x413fdc,null))[_0xf225('0x15')](saveUpdates(_0x464286[_0xf225('0x5d')],null))['then'](respondWithResult(_0x413fdc,null))[_0xf225('0x1f')](handleError(_0x413fdc,null));};exports[_0xf225('0x5f')]=function(_0x47c4b9,_0xadfb10){return db[_0xf225('0x3a')]['describe']()[_0xf225('0x15')](respondWithResult(_0xadfb10,null))[_0xf225('0x1f')](handleError(_0xadfb10,null));};exports[_0xf225('0x60')]=function(_0x13fb86,_0x368f81){return db[_0xf225('0x3a')][_0xf225('0x5e')]({'where':{'id':_0x13fb86[_0xf225('0x52')]['id']}})['then'](handleEntityNotFound(_0x368f81,null))[_0xf225('0x15')](function(_0x12fd6d){if(_0x12fd6d){return _0x12fd6d['addContacts'](_0x13fb86['body'][_0xf225('0x61')],_[_0xf225('0x62')](_0x13fb86[_0xf225('0x5d')],['ids','id'])||{});}})[_0xf225('0x15')](respondWithResult(_0x368f81,null))[_0xf225('0x1f')](handleError(_0x368f81,null));};function validateUser(_0x240986){return new Promise(function(_0x5da278,_0x22ebdc){if(_0x240986[_0xf225('0x63')])return _0x5da278(_0x240986);return db[_0xf225('0x64')]['findById'](0x1)[_0xf225('0x15')](function(_0x27f812){if(_0x27f812[_0xf225('0x65')])authService['validatePasswordPattern'](_0x240986[_0xf225('0x54')]);db[_0xf225('0x3a')][_0xf225('0x66')](_0xf225('0x63'))[_0xf225('0x15')](function(_0x110e18){if(_[_0xf225('0x67')](_0x110e18)){_0x240986['internal']=_0x27f812['min_internal']||0x1;return;}if(_[_0xf225('0x67')](_0x27f812['min_internal'])||_0x27f812[_0xf225('0x68')]===_0x110e18){_0x240986['internal']=_0x110e18+0x1;return;}if(_0x27f812[_0xf225('0x68')]>_0x110e18){_0x240986['internal']=_0x27f812[_0xf225('0x68')];return;}return db['sequelize'][_0xf225('0x41')](_0xf225('0x69'),{'type':db[_0xf225('0x6a')]['QueryTypes'][_0xf225('0x6b')]})[_0xf225('0x15')](function(_0x17aee5){if(_0x17aee5&&_0x17aee5[_0xf225('0x48')]){for(var _0xe44bb6=0x0,_0x443ed6=_0x17aee5[_0xf225('0x48')];_0xe44bb6<_0x443ed6&&_['isNil'](_0x240986[_0xf225('0x63')]);_0xe44bb6++){if(_0x27f812[_0xf225('0x68')]<=_0x17aee5[_0xe44bb6][_0xf225('0x6c')]){_0x240986[_0xf225('0x63')]=_0x17aee5[_0xe44bb6][_0xf225('0x6c')];}else if(_0x27f812['min_internal']>_0x17aee5[_0xe44bb6][_0xf225('0x6c')]&&_0x27f812['min_internal']<=_0x17aee5[_0xe44bb6]['to']){_0x240986[_0xf225('0x63')]=_0x27f812[_0xf225('0x68')];}}}if(_[_0xf225('0x67')](_0x240986[_0xf225('0x63')])){_0x240986['internal']=_0x110e18+0x1;}return _0x5da278(_0x240986);});});})[_0xf225('0x1f')](function(_0x1f83fc){_0x22ebdc(_0x1f83fc);});});}function updateUser(_0x7e62ca){return new Promise(function(_0x11762f,_0x22cf88){try{if(_0x7e62ca[_0xf225('0x6d')]){_0x7e62ca['mailbox']=_0x7e62ca[_0xf225('0x63')];_0x7e62ca['VoiceMail']={'mailbox':_0x7e62ca[_0xf225('0x63')],'password':_0x7e62ca[_0xf225('0x54')],'fullname':_0x7e62ca[_0xf225('0x6e')],'email':_0x7e62ca[_0xf225('0x6f')]};}if(_0x7e62ca['role']===_0xf225('0x70')){if(!_0x7e62ca[_0xf225('0x71')])_0x7e62ca[_0xf225('0x71')]=[_0xf225('0x72'),_0xf225('0x73'),'103',_0xf225('0x74'),_0xf225('0x75'),'104',_0xf225('0x76'),_0xf225('0x77'),_0xf225('0x78'),'108',_0xf225('0x79'),'100',_0xf225('0x7a'),_0xf225('0x7b'),_0xf225('0x7c')];}_0x11762f(_0x7e62ca);}catch(_0x1efc0d){_0x22cf88(_0x1efc0d);}});}exports[_0xf225('0x7d')]=function(_0x20763c,_0x36005d){if(_0x20763c['user'][_0xf225('0x33')]===_0xf225('0x70'))throw new Error(_0xf225('0x7e'));if(_0x20763c[_0xf225('0x5d')][_0xf225('0x33')]===_0xf225('0x7f')&&_0x20763c[_0xf225('0x7f')][_0xf225('0x33')]!==_0xf225('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x20763c['body'][_0xf225('0x33')]===_0xf225('0x2a')&&_0x20763c[_0xf225('0x7f')][_0xf225('0x33')]!==_0xf225('0x2a')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xf225('0x80')]([_0x20763c[_0xf225('0x5d')]])['then'](function(){return validateUser(_0x20763c[_0xf225('0x5d')]);})['then'](function(_0x1defb1){return updateUser(_0x1defb1)[_0xf225('0x15')](function(_0x4d3053){if(_0x4d3053['role']===_0xf225('0x2a')){_0x4d3053[_0xf225('0x81')]=_0x20763c[_0xf225('0x7f')][_0xf225('0x81')];delete _0x4d3053[_0xf225('0x82')];}return _0x4d3053;});})[_0xf225('0x15')](function(_0x24d602){return db[_0xf225('0x3a')][_0xf225('0x7d')](_0x24d602,{'include':[{'model':db[_0xf225('0x83')],'as':_0xf225('0x83')}]});})[_0xf225('0x15')](function(_0x201af1){if(_0x20763c[_0xf225('0x5d')][_0xf225('0x33')]===_0xf225('0x7f'))return _0x201af1;if(_0x20763c['user']['role']!==_0xf225('0x7f'))return _0x201af1;return db[_0xf225('0x84')][_0xf225('0x5e')]({'where':{'name':_0x201af1[_0xf225('0x33')]===_0xf225('0x70')?_0xf225('0x2c'):_0xf225('0x2d'),'userProfileId':_0x20763c[_0xf225('0x7f')][_0xf225('0x82')]},'raw':!![]})[_0xf225('0x15')](function(_0x2b1471){if(!_0x2b1471||_0x2b1471[_0xf225('0x85')]!=0x0)return _0x201af1;return db[_0xf225('0x35')][_0xf225('0x7d')]({'name':_0x201af1[_0xf225('0x34')],'resourceId':_0x201af1['id'],'type':_0x2b1471[_0xf225('0x34')],'sectionId':_0x2b1471['id']},{})[_0xf225('0x15')](function(){return _0x201af1;});})[_0xf225('0x1f')](function(_0x4418e1){logger['error'](_0xf225('0x86'),_0x4418e1);throw _0x4418e1;});})[_0xf225('0x15')](respondWithResult(_0x36005d,0xc9))[_0xf225('0x1f')](handleError(_0x36005d,null));};exports[_0xf225('0x87')]=function(_0x22f5fe,_0x50c8a9){var _0x3846ea=_0x22f5fe[_0xf225('0x5d')];var _0x504805=[];if(_0x22f5fe[_0xf225('0x7f')][_0xf225('0x33')]==='agent')throw new Error(_0xf225('0x7e'));if(_[_0xf225('0x88')](_0x3846ea,['role',_0xf225('0x7f')])&&_0x22f5fe['user'][_0xf225('0x33')]!=='admin'){throw new Error(_0xf225('0x89'));}if(_[_0xf225('0x88')](_0x3846ea,['role',_0xf225('0x2a')])&&_0x22f5fe[_0xf225('0x7f')][_0xf225('0x33')]!==_0xf225('0x2a')){throw new Error(_0xf225('0x8a'));}return licenseUtil[_0xf225('0x80')](_0x3846ea)[_0xf225('0x15')](function(){return validateUser(_0x3846ea[0x0]);})['then'](function(){for(var _0x482819=0x1;_0x482819<_0x3846ea['length'];_0x482819++){var _0x589fb9=_0x3846ea[_0x482819-0x1][_0xf225('0x63')];if(!_0x3846ea[_0x482819][_0xf225('0x63')])_0x3846ea[_0x482819][_0xf225('0x63')]=_0x589fb9+0x1;_0x504805[_0xf225('0x49')](validateUser(_0x3846ea[_0x482819]));}return Promise[_0xf225('0x5c')](_0x504805);})[_0xf225('0x15')](function(){_0x504805=[];for(var _0x368318=0x0;_0x368318<_0x3846ea[_0xf225('0x48')];_0x368318++){_0x504805[_0xf225('0x49')](updateUser(_0x3846ea[_0x368318]));}return Promise['all'](_0x504805);})[_0xf225('0x15')](function(){_0x504805=_0x3846ea[_0xf225('0x30')](function(_0x4b306d){return db[_0xf225('0x3a')]['create'](_0x4b306d,{'include':[{'model':db[_0xf225('0x83')],'as':_0xf225('0x83')}]})[_0xf225('0x15')](function(_0x27de84){_0x4b306d['id']=_0x27de84['id'];return _0x4b306d;});});return Promise[_0xf225('0x5c')](_0x504805);})[_0xf225('0x15')](function(_0x5610fe){if(_0x22f5fe['body'][_0xf225('0x33')]===_0xf225('0x7f'))return _0x5610fe;if(_0x22f5fe[_0xf225('0x7f')][_0xf225('0x33')]!==_0xf225('0x7f'))return _0x5610fe;var _0xc6db3f=_[_0xf225('0x88')](_0x5610fe,function(_0x1cd5d5){return _0x1cd5d5['role']===_0xf225('0x70')||_0x1cd5d5[_0xf225('0x33')]===_0xf225('0x8b');});if(!_0xc6db3f)return _0x5610fe;return db[_0xf225('0x84')][_0xf225('0x46')]({'where':{'name':{'$or':[_0xf225('0x2c'),_0xf225('0x2d')]},'userProfileId':_0x22f5fe[_0xf225('0x7f')][_0xf225('0x82')]},'raw':!![]})[_0xf225('0x15')](function(_0x2dfe5d){if(_[_0xf225('0x8c')](_0x2dfe5d)||!_['some'](_0x2dfe5d,[_0xf225('0x85'),0x0]))return _0x5610fe;_0x504805=[];var _0xfe78b7=_(_0x2dfe5d)['map'](function(_0x164b08){if(_0x164b08[_0xf225('0x85')]===0x1)return;return _0x164b08[_0xf225('0x34')]===_0xf225('0x2c')?_0xf225('0x70'):_0xf225('0x8b');})[_0xf225('0x8d')]()[_0xf225('0x31')]();for(var _0xb9fbe9=0x0;_0xb9fbe9<_0x5610fe[_0xf225('0x48')];_0xb9fbe9++){if(!_[_0xf225('0x32')](_0xfe78b7,_0x5610fe[_0xb9fbe9][_0xf225('0x33')]))return;var _0x1de821=_0x5610fe[_0xb9fbe9][_0xf225('0x33')]===_0xf225('0x70')?_0xf225('0x2c'):'Telephones';_0x504805[_0xf225('0x49')](db[_0xf225('0x35')][_0xf225('0x7d')]({'name':_0x5610fe[_0xb9fbe9][_0xf225('0x34')],'resourceId':_0x5610fe[_0xb9fbe9]['id'],'type':_0x1de821,'sectionId':_[_0xf225('0x5e')](_0x2dfe5d,['name',_0x1de821])['id']},{}));}return Promise[_0xf225('0x5c')](_0x504805);});})[_0xf225('0x15')](respondWithResult(_0x50c8a9,0xc9))[_0xf225('0x1f')](handleError(_0x50c8a9,null));};exports['changePassword']=function(_0x1b9020,_0x328ad2){if(_0x1b9020[_0xf225('0x5d')]['id']){delete _0x1b9020[_0xf225('0x5d')]['id'];}return db[_0xf225('0x3a')]['find']({'where':{'id':_0x1b9020[_0xf225('0x52')]['id']}})[_0xf225('0x15')](function(_0x427fc2){if(!_0x427fc2)return null;if(_0x427fc2['id']===_0x1b9020['user']['id']){if(!_0x1b9020[_0xf225('0x5d')][_0xf225('0x8e')]||!_0x1b9020[_0xf225('0x5d')][_0xf225('0x8f')]){throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))](_0xf225('0x92'));}if(!_0x427fc2['authenticate'](_0x1b9020[_0xf225('0x5d')][_0xf225('0x8e')])){throw new db['Sequelize'][(_0xf225('0x91'))](_0xf225('0x93'));}if(_0x1b9020[_0xf225('0x5d')][_0xf225('0x8e')]===_0x1b9020[_0xf225('0x5d')][_0xf225('0x8f')]){throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))](_0xf225('0x94'));}}else if(_0x1b9020['user'][_0xf225('0x33')]===_0xf225('0x2a')){if(!_0x1b9020[_0xf225('0x5d')][_0xf225('0x8f')]){throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))](_0xf225('0x95'));}}else if(_0x1b9020['user'][_0xf225('0x33')]===_0xf225('0x7f')){if(!_0x1b9020['body'][_0xf225('0x8f')]){throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x427fc2[_0xf225('0x33')]!==_0xf225('0x70')){throw new db['Sequelize'][(_0xf225('0x91'))](_0xf225('0x7e'));}}else{throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))](_0xf225('0x7e'));}return _0x427fc2;})[_0xf225('0x15')](handleEntityNotFound(_0x328ad2,null))[_0xf225('0x15')](function(_0x172486){return db['Setting'][_0xf225('0x96')]({'attributes':['id',_0xf225('0x65'),_0xf225('0x97'),_0xf225('0x98')]})[_0xf225('0x15')](function(_0x30a49b){if(_0x30a49b[_0xf225('0x65')])authService[_0xf225('0x99')](_0x1b9020[_0xf225('0x5d')][_0xf225('0x8f')]);if(!_0x30a49b[_0xf225('0x97')]||!_0x172486[_0xf225('0x9a')])return _0x172486;authService[_0xf225('0x9b')](_0x1b9020['body']['newPassword'],_0x172486[_0xf225('0x9a')],_0x30a49b['passwordHistoryLimit']);return _0x172486;})['then'](saveUpdates({'password':_0x1b9020[_0xf225('0x5d')]['newPassword'],'passwordResetAt':_0x1b9020[_0xf225('0x7f')]['id']==_0x1b9020[_0xf225('0x52')]['id']?moment():null,'previousPasswords':authService[_0xf225('0x9c')](_0x1b9020['body'][_0xf225('0x8f')],_0x172486[_0xf225('0x9a')])},null));})[_0xf225('0x15')](respondWithResult(_0x328ad2,null))[_0xf225('0x1f')](handleError(_0x328ad2,null));};exports['addQueues']=function(_0x39d67c,_0x12c90d){var _0x143f37=_0x39d67c[_0xf225('0x5d')]['channel'];return db['User'][_0xf225('0x5e')]({'where':{'id':_0x39d67c[_0xf225('0x52')]['id']},'attributes':['id',_0xf225('0x34'),_0xf225('0x33'),_0xf225('0x9d'),_0xf225('0x9e'),_0xf225('0x9f'),_0xf225('0xa0')]})[_0xf225('0x15')](handleEntityNotFound(_0x12c90d,null))[_0xf225('0x15')](function(_0x1b202b){if(_0x1b202b){if(!utils[_0xf225('0xa1')](_0x143f37)){throw new db['Sequelize'][(_0xf225('0x91'))](_0xf225('0xa2'));}return _0x1b202b[_0xf225('0xa3')+_[_0xf225('0xa4')](_0x143f37['toLowerCase']())+_0xf225('0xa5')](_0x39d67c[_0xf225('0x5d')]['ids'],{'penalty':_0x39d67c['body'][_0xf225('0xa6')]||0x0})[_0xf225('0xa7')](function(_0xdb2110){for(var _0x3d5183=0x0;_0x3d5183<_0x39d67c[_0xf225('0x5d')]['ids'][_0xf225('0x48')];_0x3d5183+=0x1){var _0x5f35e3={'UserId':Number(_0x39d67c[_0xf225('0x52')]['id'])};_0x5f35e3[_['capitalize'](_0x143f37[_0xf225('0xa8')]())+_0xf225('0xa9')]=Number(_0x39d67c['body'][_0xf225('0x61')][_0x3d5183]);socket[_0xf225('0xaa')](_0xf225('0x7f')+_[_0xf225('0xa4')](_0x143f37[_0xf225('0xa8')]())+_0xf225('0xab'),_0x5f35e3);}return _0xdb2110;})[_0xf225('0x15')](function(){if(_0x143f37===_0xf225('0xac')){return db[_0xf225('0xad')][_0xf225('0x46')]({'where':{'id':_0x39d67c['body']['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x3be85b){var _0x530dd8=_0x1b202b[_0xf225('0xae')]({'plain':!![]});var _0x56a4ea=[];if(_0x143f37==='voice'&&_0x530dd8[_0xf225('0x33')]==='agent'&&_0x530dd8[_0xf225('0x9d')]){for(let _0x3fcec6=0x0;_0x3fcec6<_0x3be85b['length'];_0x3fcec6+=0x1){_0x56a4ea[_0xf225('0x49')]({'membername':_0x530dd8[_0xf225('0x34')],'UserId':_0x530dd8['id'],'queue_name':_0x3be85b[_0x3fcec6][_0xf225('0x34')],'VoiceQueueId':_0x3be85b[_0x3fcec6]['id'],'interface':_[_0xf225('0x67')](_0x530dd8['interface'])?util[_0xf225('0xaf')]('SIP/%s',_0x530dd8['name']):_0x530dd8[_0xf225('0xa0')],'paused':_0x530dd8[_0xf225('0x9f')]||![],'penalty':_0x39d67c[_0xf225('0x5d')][_0xf225('0xa6')]||0x0});}return Promise['all'](_0x56a4ea[_0xf225('0x30')](function(_0x1eccd3){return db[_0xf225('0xb0')][_0xf225('0xb1')](_0x1eccd3);}));}return _0x1b202b;});}})[_0xf225('0x15')](respondWithStatusCode(_0x12c90d,null))[_0xf225('0x1f')](handleError(_0x12c90d,null));};exports[_0xf225('0xb2')]=function(_0x74fec3,_0x1b08ca){var _0x123e3f,_0x33e5a5;return db[_0xf225('0x3a')][_0xf225('0x5e')]({'where':{'id':_0x74fec3[_0xf225('0x52')]['id']},'attributes':['id','name',_0xf225('0x33')]})[_0xf225('0x15')](handleEntityNotFound(_0x1b08ca,null))[_0xf225('0x15')](function(_0x5b44a8){if(_0x5b44a8){_0x123e3f=_0x5b44a8;if(!_0x74fec3[_0xf225('0x41')]['channel']||!utils[_0xf225('0xa1')](_0x74fec3[_0xf225('0x41')][_0xf225('0xb3')])){throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))](_0xf225('0xa2'));}return _0x5b44a8[_0xf225('0xb4')+_['capitalize'](_0x74fec3[_0xf225('0x41')][_0xf225('0xb3')]['toLowerCase']())+_0xf225('0xa5')](_0x74fec3[_0xf225('0x41')][_0xf225('0x61')]);}})[_0xf225('0x15')](function(_0x93256d){if(_[_0xf225('0xb5')](_0x74fec3[_0xf225('0x41')][_0xf225('0x61')])){for(var _0x124884=0x0;_0x124884<_0x74fec3[_0xf225('0x41')][_0xf225('0x61')][_0xf225('0x48')];_0x124884+=0x1){_0x33e5a5={'UserId':Number(_0x74fec3[_0xf225('0x52')]['id'])};_0x33e5a5[_[_0xf225('0xa4')](_0x74fec3[_0xf225('0x41')][_0xf225('0xb3')]['toLowerCase']())+'QueueId']=Number(_0x74fec3[_0xf225('0x41')][_0xf225('0x61')][_0x124884]);socket[_0xf225('0xaa')](_0xf225('0x7f')+_[_0xf225('0xa4')](_0x74fec3[_0xf225('0x41')][_0xf225('0xb3')][_0xf225('0xa8')]())+'Queue:remove',_0x33e5a5);}}else{_0x33e5a5={'UserId':Number(_0x74fec3['params']['id'])};_0x33e5a5[_[_0xf225('0xa4')](_0x74fec3[_0xf225('0x41')]['channel'][_0xf225('0xa8')]())+_0xf225('0xa9')]=Number(_0x74fec3[_0xf225('0x41')][_0xf225('0x61')]);socket['emit'](_0xf225('0x7f')+_[_0xf225('0xa4')](_0x74fec3[_0xf225('0x41')]['channel'][_0xf225('0xa8')]())+'Queue:remove',_0x33e5a5);}return _0x93256d;})[_0xf225('0x15')](function(){if(_0x74fec3[_0xf225('0x41')][_0xf225('0xb3')]===_0xf225('0xac')){return db[_0xf225('0xb0')]['destroy']({'where':{'UserId':_0x74fec3[_0xf225('0x52')]['id'],'VoiceQueueId':_0x74fec3[_0xf225('0x41')][_0xf225('0x61')]},'individualHooks':!![]})['then'](function(){return _0x123e3f;});}return _0x123e3f;})[_0xf225('0x15')](respondWithStatusCode(_0x1b08ca,null))[_0xf225('0x1f')](handleError(_0x1b08ca,null));};exports[_0xf225('0xb6')]=function(_0x42c0ef,_0x29c737){_0x42c0ef[_0xf225('0x5d')][_0xf225('0xb7')]=_0x42c0ef[_0xf225('0xb8')][_0xf225('0xb9')];return db[_0xf225('0x3a')]['find']({'where':{'id':_0x42c0ef[_0xf225('0x52')]['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x29c737,null))[_0xf225('0x15')](saveUpdates(_0x42c0ef[_0xf225('0x5d')],null))[_0xf225('0x15')](respondWithResult(_0x29c737,null))[_0xf225('0x1f')](handleError(_0x29c737,null));};exports[_0xf225('0xba')]=function(_0x100f85,_0x15fd48){var _0x3b812b=path['join'](config[_0xf225('0xbb')],_0xf225('0xbc'));return db['User'][_0xf225('0x5e')]({'where':{'id':_0x100f85[_0xf225('0x52')]['id']},'attributes':['id',_0xf225('0xb7')],'raw':!![]})[_0xf225('0x15')](handleEntityNotFound(_0x15fd48,null))['then'](function(_0x356e46){if(_0x356e46){if(_[_0xf225('0x67')](_0x356e46[_0xf225('0xb7')])){return _0x15fd48[_0xf225('0xbd')](_0x3b812b);}else{if(!fs[_0xf225('0xbe')](path[_0xf225('0xbf')](config[_0xf225('0xbb')],_0xf225('0xc0'),_0x356e46[_0xf225('0xb7')]))){return _0x15fd48[_0xf225('0xbd')](_0x3b812b);}return _0x15fd48[_0xf225('0xbd')](path[_0xf225('0xbf')](config[_0xf225('0xbb')],_0xf225('0xc0'),_0x356e46[_0xf225('0xb7')]));}}})[_0xf225('0x1f')](handleError(_0x15fd48,null));};exports[_0xf225('0xc1')]=function(_0x355d90,_0x38517a){return db[_0xf225('0x3a')][_0xf225('0x5e')]({'where':{'id':_0x355d90[_0xf225('0x52')]['id']},'attributes':['id']})[_0xf225('0x15')](handleEntityNotFound(_0x38517a,null))[_0xf225('0x15')](function(_0x4534f3){var _0x196917=[];values=_0x4534f3[_0xf225('0x4c')];_0x196917[_0xf225('0x49')](get_open_tabs(_0xf225('0x4a'),_0x4534f3['dataValues']));_0x196917['push'](get_open_tabs('sms',_0x4534f3[_0xf225('0x4c')]));_0x196917[_0xf225('0x49')](get_open_tabs(_0xf225('0x4f'),_0x4534f3[_0xf225('0x4c')]));_0x196917[_0xf225('0x49')](get_open_tabs('whatsapp',_0x4534f3[_0xf225('0x4c')]));_0x196917['push'](get_open_tabs('fax',_0x4534f3['dataValues']));_0x196917[_0xf225('0x49')](get_open_tabs(_0xf225('0x4e'),_0x4534f3[_0xf225('0x4c')]));return Promise[_0xf225('0x5c')](_0x196917);})['then'](function(_0x15c6a8){if(_0x15c6a8){var _0x43c43f=_['map'](values[_0xf225('0xc2')],function(_0x582cd0){return{'channel':_0xf225('0xc3'),'id':_0x582cd0['id'],'createdAt':_0x582cd0['createdAt']};});var _0x87320e=_[_0xf225('0x30')](values[_0xf225('0xc4')],function(_0x2e3e7e){return{'channel':'FAX','id':_0x2e3e7e['id'],'createdAt':_0x2e3e7e[_0xf225('0xc5')]};});var _0x284d21=_[_0xf225('0x30')](values[_0xf225('0xc6')],function(_0x25a7df){return{'channel':_0xf225('0xc7'),'id':_0x25a7df['id'],'createdAt':_0x25a7df[_0xf225('0xc5')]};});var _0x5c3881=_[_0xf225('0x30')](values[_0xf225('0xc8')],function(_0x1ef6ff){return{'channel':_0xf225('0xc9'),'id':_0x1ef6ff['id'],'createdAt':_0x1ef6ff[_0xf225('0xc5')]};});var _0x2511dd=_['map'](values['SmsOpenTabs'],function(_0x4ebe8a){return{'channel':'SMS','id':_0x4ebe8a['id'],'createdAt':_0x4ebe8a[_0xf225('0xc5')]};});var _0x360042=_[_0xf225('0x30')](values['WhatsappOpenTabs'],function(_0x5c1386){return{'channel':_0xf225('0xca'),'id':_0x5c1386['id'],'createdAt':_0x5c1386[_0xf225('0xc5')]};});var _0x30403e=_[_0xf225('0xcb')](_0x43c43f,_0x87320e,_0x284d21,_0x5c3881,_0x2511dd,_0x360042);var _0xb1571a={'count':_0x30403e[_0xf225('0x48')],'rows':_0x30403e};return _0xb1571a;}else return null;})['then'](respondWithResult(_0x38517a,null))[_0xf225('0x1f')](handleError(_0x38517a,null));};exports[_0xf225('0xcc')]=function(_0x3bba87,_0x4e380a){var _0x5148cc={};var _0x437d2e={};var _0x1ebedc;var _0xe1e9a9;return db[_0xf225('0x3a')]['findOne']({'where':{'id':_0x3bba87[_0xf225('0x52')]['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x4e380a,null))[_0xf225('0x15')](function(_0x5ab647){if(_0x5ab647){_0x1ebedc=_0x5ab647;_0x437d2e[_0xf225('0x53')]=_[_0xf225('0xcd')](db[_0xf225('0xce')][_0xf225('0x3b')]);_0x437d2e['query']=_[_0xf225('0xcd')](_0x3bba87['query']);_0x437d2e[_0xf225('0x55')]=_[_0xf225('0x56')](_0x437d2e[_0xf225('0x53')],_0x437d2e[_0xf225('0x41')]);_0x5148cc['attributes']=_[_0xf225('0x56')](_0x437d2e[_0xf225('0x53')],qs[_0xf225('0x57')](_0x3bba87[_0xf225('0x41')][_0xf225('0x57')]));_0x5148cc[_0xf225('0x45')]=_0x5148cc[_0xf225('0x45')][_0xf225('0x48')]?_0x5148cc[_0xf225('0x45')]:_0x437d2e[_0xf225('0x53')];_0x5148cc[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x3bba87[_0xf225('0x41')]['sort']);_0x5148cc['where']=qs[_0xf225('0x55')](_['pick'](_0x3bba87[_0xf225('0x41')],_0x437d2e[_0xf225('0x55')]));if(_0x3bba87[_0xf225('0x41')][_0xf225('0x2e')]){_0x5148cc[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x5148cc[_0xf225('0x3f')],{'$or':_[_0xf225('0x30')](_0x5148cc[_0xf225('0x45')],function(_0x35be77){var _0x1993b1={};_0x1993b1[_0x35be77]={'$like':'%'+_0x3bba87[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x1993b1;})});}_0x5148cc=_['merge']({},_0x5148cc,_0x3bba87['options']);return _0x1ebedc['getContacts'](_0x5148cc);}})[_0xf225('0x15')](function(_0x7364d3){if(_0x7364d3){_0xe1e9a9=_0x7364d3[_0xf225('0x48')];if(_0x3bba87[_0xf225('0x41')][_0xf225('0xd1')](_0xf225('0x58'))){_0x5148cc[_0xf225('0x40')]=[{'model':db['CmList'],'as':_0xf225('0xd2'),'required':![]},{'model':db[_0xf225('0xd3')],'as':_0xf225('0xd4'),'attributes':['id',_0xf225('0x34'),'color'],'where':_0x3bba87['query'][_0xf225('0xd5')]?{'id':_0x3bba87['query'][_0xf225('0xd5')]}:undefined,'required':_0x3bba87['query'][_0xf225('0xd5')]?!![]:![]}];}if(!_0x3bba87[_0xf225('0x41')][_0xf225('0xd1')](_0xf225('0xd6'))){_0x5148cc[_0xf225('0x26')]=qs[_0xf225('0x26')](_0x3bba87[_0xf225('0x41')][_0xf225('0x26')]);_0x5148cc['offset']=qs[_0xf225('0x23')](_0x3bba87[_0xf225('0x41')][_0xf225('0x23')]);}return _0x1ebedc[_0xf225('0xcc')](_0x5148cc);}})[_0xf225('0x15')](function(_0x295f26){if(_0x295f26){return _0x295f26?{'count':_0xe1e9a9,'rows':_0x295f26}:null;}})[_0xf225('0x15')](respondWithResult(_0x4e380a,null))[_0xf225('0x1f')](handleError(_0x4e380a,null));};exports['getQueues']=function(_0x492f51,_0x49e784){var _0x2ffa0f;var _0x2c1298={};var _0x2ba63d;return db['User'][_0xf225('0x96')]({'where':{'id':_0x492f51[_0xf225('0x52')]['id']},'attributes':['id','name',_0xf225('0x33')]})['then'](handleEntityNotFound(_0x49e784,null))[_0xf225('0x15')](function(_0x1c5a43){if(!utils[_0xf225('0xa1')](_0x492f51['query'][_0xf225('0xb3')])){throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))](_0xf225('0xa2'));}_0x2ffa0f=_0x1c5a43;var _0x29482b={};_0x29482b[_0xf225('0x53')]=_[_0xf225('0xcd')](db[_[_0xf225('0xa4')](_0x492f51[_0xf225('0x41')][_0xf225('0xb3')])+_0xf225('0xd7')][_0xf225('0x3b')]);_0x29482b[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x492f51[_0xf225('0x41')]);_0x29482b[_0xf225('0x55')]=_[_0xf225('0x56')](_0x29482b[_0xf225('0x53')],_0x29482b[_0xf225('0x41')]);_0x2c1298[_0xf225('0x45')]=_['intersection'](_0x29482b[_0xf225('0x53')],qs['fields'](_0x492f51[_0xf225('0x41')][_0xf225('0x57')]));_0x2c1298[_0xf225('0x45')]=_0x2c1298['attributes'][_0xf225('0x48')]?_0x2c1298['attributes']:_0x29482b[_0xf225('0x53')];_0x2c1298[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x492f51[_0xf225('0x41')][_0xf225('0xd0')]);_0x2c1298[_0xf225('0x3f')]=qs[_0xf225('0x55')](_[_0xf225('0xd8')](_0x492f51[_0xf225('0x41')],_0x29482b[_0xf225('0x55')]));if(_0x492f51[_0xf225('0x41')][_0xf225('0x2e')]){_0x2c1298[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x2c1298[_0xf225('0x3f')],{'$or':_['map'](_0x2c1298[_0xf225('0x45')],function(_0x108f42){var _0x50ca87={};_0x50ca87[_0x108f42]={'$like':'%'+_0x492f51['query'][_0xf225('0x2e')]+'%'};return _0x50ca87;})});}_0x2c1298=_[_0xf225('0x59')]({},_0x2c1298,_0x492f51[_0xf225('0x5a')]);switch(_0x2ffa0f['role']){case'admin':return db[_[_0xf225('0xa4')](_0x492f51[_0xf225('0x41')][_0xf225('0xb3')])+_0xf225('0xd7')][_0xf225('0x46')](_0x2c1298);case _0xf225('0x7f'):case _0xf225('0x70'):return _0x2ffa0f[_0xf225('0xae')+_['capitalize'](_0x492f51[_0xf225('0x41')][_0xf225('0xb3')])+_0xf225('0xa5')](_0x2c1298);default:throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))](_0xf225('0xd9'));}})[_0xf225('0x15')](function(_0x240b19){_0x2ba63d=_0x240b19[_0xf225('0x48')];if(!_0x492f51[_0xf225('0x41')][_0xf225('0xd1')]('nolimit')){_0x2c1298[_0xf225('0x26')]=qs[_0xf225('0x26')](_0x492f51[_0xf225('0x41')]['limit']);_0x2c1298[_0xf225('0x23')]=qs[_0xf225('0x23')](_0x492f51[_0xf225('0x41')][_0xf225('0x23')]);}switch(_0x2ffa0f[_0xf225('0x33')]){case'admin':return db[_[_0xf225('0xa4')](_0x492f51[_0xf225('0x41')][_0xf225('0xb3')])+'Queue'][_0xf225('0x46')](_0x2c1298);case _0xf225('0x7f'):case _0xf225('0x70'):return _0x2ffa0f[_0xf225('0xae')+_['capitalize'](_0x492f51[_0xf225('0x41')][_0xf225('0xb3')])+_0xf225('0xa5')](_0x2c1298);}})[_0xf225('0x15')](function(_0x23769e){return{'count':_0x2ba63d,'rows':_0x23769e};})[_0xf225('0x15')](respondWithResult(_0x49e784,null))[_0xf225('0x1f')](handleError(_0x49e784,null));};exports[_0xf225('0xda')]=function(_0x383d3f,_0x152e56){var _0x5f2475={};var _0x2d8bbe={};var _0x3729e2;var _0x1d896f;return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x383d3f[_0xf225('0x52')]['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x152e56,null))[_0xf225('0x15')](function(_0x4899d5){if(_0x4899d5){_0x3729e2=_0x4899d5;_0x2d8bbe[_0xf225('0x53')]=_[_0xf225('0xcd')](db[_0xf225('0xb0')][_0xf225('0x3b')]);_0x2d8bbe['query']=_['keys'](_0x383d3f[_0xf225('0x41')]);_0x2d8bbe[_0xf225('0x55')]=_['intersection'](_0x2d8bbe[_0xf225('0x53')],_0x2d8bbe[_0xf225('0x41')]);_0x5f2475['attributes']=_[_0xf225('0x56')](_0x2d8bbe[_0xf225('0x53')],qs[_0xf225('0x57')](_0x383d3f[_0xf225('0x41')][_0xf225('0x57')]));_0x5f2475[_0xf225('0x45')]=_0x5f2475[_0xf225('0x45')][_0xf225('0x48')]?_0x5f2475[_0xf225('0x45')]:_0x2d8bbe[_0xf225('0x53')];_0x5f2475[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x383d3f['query'][_0xf225('0xd0')]);_0x5f2475[_0xf225('0x3f')]=qs[_0xf225('0x55')](_['pick'](_0x383d3f[_0xf225('0x41')],_0x2d8bbe[_0xf225('0x55')]));if(_0x383d3f[_0xf225('0x41')][_0xf225('0x2e')]){_0x5f2475[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x5f2475['where'],{'$or':_[_0xf225('0x30')](_0x5f2475[_0xf225('0x45')],function(_0x3c1d08){var _0x170b04={};_0x170b04[_0x3c1d08]={'$like':'%'+_0x383d3f['query']['filter']+'%'};return _0x170b04;})});}_0x5f2475=_[_0xf225('0x59')]({},_0x5f2475,_0x383d3f[_0xf225('0x5a')]);return _0x3729e2[_0xf225('0xda')](_0x5f2475);}})[_0xf225('0x15')](function(_0x53f5f1){if(_0x53f5f1){_0x1d896f=_0x53f5f1['length'];if(!_0x383d3f['query'][_0xf225('0xd1')](_0xf225('0xd6'))){_0x5f2475[_0xf225('0x26')]=qs['limit'](_0x383d3f['query']['limit']);_0x5f2475['offset']=qs['offset'](_0x383d3f[_0xf225('0x41')][_0xf225('0x23')]);}return _0x3729e2[_0xf225('0xda')](_0x5f2475);}})[_0xf225('0x15')](function(_0x248ced){if(_0x248ced){return _0x248ced?{'count':_0x1d896f,'rows':_0x248ced}:null;}})[_0xf225('0x15')](respondWithResult(_0x152e56,null))[_0xf225('0x1f')](handleError(_0x152e56,null));};exports[_0xf225('0xdb')]=function(_0x3d27ec,_0x4422f6){var _0x85c95e={};var _0x5bd62e={};var _0x28f804;var _0x38adc6;return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x3d27ec['params']['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x4422f6,null))['then'](function(_0x58ebe3){if(_0x58ebe3){_0x28f804=_0x58ebe3;_0x5bd62e[_0xf225('0x53')]=_[_0xf225('0xcd')](db[_0xf225('0xdc')]['rawAttributes']);_0x5bd62e[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x3d27ec[_0xf225('0x41')]);_0x5bd62e['filters']=_[_0xf225('0x56')](_0x5bd62e['model'],_0x5bd62e['query']);_0x85c95e['attributes']=_[_0xf225('0x56')](_0x5bd62e[_0xf225('0x53')],qs[_0xf225('0x57')](_0x3d27ec[_0xf225('0x41')]['fields']));_0x85c95e['attributes']=_0x85c95e[_0xf225('0x45')][_0xf225('0x48')]?_0x85c95e[_0xf225('0x45')]:_0x5bd62e['model'];_0x85c95e[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x3d27ec[_0xf225('0x41')][_0xf225('0xd0')]);_0x85c95e[_0xf225('0x3f')]=qs[_0xf225('0x55')](_[_0xf225('0xd8')](_0x3d27ec[_0xf225('0x41')],_0x5bd62e[_0xf225('0x55')]));if(_0x3d27ec['query'][_0xf225('0x2e')]){_0x85c95e['where']=_[_0xf225('0x59')](_0x85c95e[_0xf225('0x3f')],{'$or':_[_0xf225('0x30')](_0x85c95e['attributes'],function(_0x56f20b){var _0x2b7329={};_0x2b7329[_0x56f20b]={'$like':'%'+_0x3d27ec[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x2b7329;})});}_0x85c95e=_[_0xf225('0x59')]({},_0x85c95e,_0x3d27ec['options']);return _0x28f804['getGroups'](_0x85c95e);}})[_0xf225('0x15')](function(_0x5270f5){if(_0x5270f5){_0x38adc6=_0x5270f5[_0xf225('0x48')];if(!_0x3d27ec['query'][_0xf225('0xd1')](_0xf225('0xd6'))){_0x85c95e[_0xf225('0x26')]=qs['limit'](_0x3d27ec[_0xf225('0x41')][_0xf225('0x26')]);_0x85c95e[_0xf225('0x23')]=qs['offset'](_0x3d27ec[_0xf225('0x41')][_0xf225('0x23')]);}return _0x28f804[_0xf225('0xdb')](_0x85c95e);}})[_0xf225('0x15')](function(_0x2f0e2f){if(_0x2f0e2f){return _0x2f0e2f?{'count':_0x38adc6,'rows':_0x2f0e2f}:null;}})[_0xf225('0x15')](respondWithResult(_0x4422f6,null))[_0xf225('0x1f')](handleError(_0x4422f6,null));};exports[_0xf225('0xdd')]=function(_0x26d4b4,_0x59ba97){var _0x2d0b07={'raw':!![],'where':{}};var _0x24a839={};var _0x28d6de={'count':0x0,'rows':[]};return db['User'][_0xf225('0x96')]({'where':{'id':_0x26d4b4['params']['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x59ba97,null))[_0xf225('0x15')](function(_0x37d271){if(_0x37d271){_0x24a839['model']=_[_0xf225('0xcd')](db[_0xf225('0xde')][_0xf225('0x3b')]);_0x24a839[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x26d4b4['query']);_0x24a839[_0xf225('0x55')]=_['intersection'](_0x24a839[_0xf225('0x53')],_0x24a839[_0xf225('0x41')]);_0x2d0b07[_0xf225('0x45')]=_[_0xf225('0x56')](_0x24a839[_0xf225('0x53')],qs[_0xf225('0x57')](_0x26d4b4[_0xf225('0x41')][_0xf225('0x57')]));_0x2d0b07[_0xf225('0x45')]=_0x2d0b07[_0xf225('0x45')]['length']?_0x2d0b07[_0xf225('0x45')]:_0x24a839['model'];if(!_0x26d4b4[_0xf225('0x41')][_0xf225('0xd1')](_0xf225('0xd6'))){_0x2d0b07[_0xf225('0x26')]=qs[_0xf225('0x26')](_0x26d4b4[_0xf225('0x41')][_0xf225('0x26')]);_0x2d0b07[_0xf225('0x23')]=qs[_0xf225('0x23')](_0x26d4b4['query'][_0xf225('0x23')]);}_0x2d0b07[_0xf225('0xcf')]=qs['sort'](_0x26d4b4['query'][_0xf225('0xd0')]);_0x2d0b07['where']=qs[_0xf225('0x55')](_['pick'](_0x26d4b4[_0xf225('0x41')],_0x24a839[_0xf225('0x55')]));_0x2d0b07[_0xf225('0x3f')][_0xf225('0xdf')]=_0x37d271['id'];if(_0x26d4b4[_0xf225('0x41')]['filter']){_0x2d0b07[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x2d0b07[_0xf225('0x3f')],{'$or':_['map'](_0x2d0b07[_0xf225('0x45')],function(_0x2ba49c){var _0x25a65e={};_0x25a65e[_0x2ba49c]={'$like':'%'+_0x26d4b4[_0xf225('0x41')]['filter']+'%'};return _0x25a65e;})});}_0x2d0b07=_[_0xf225('0x59')]({},_0x2d0b07,_0x26d4b4[_0xf225('0x5a')]);return db['VoiceRecording'][_0xf225('0x25')]({'where':_0x2d0b07[_0xf225('0x3f')]})['then'](function(_0x516734){_0x28d6de[_0xf225('0x25')]=_0x516734;if(_0x26d4b4[_0xf225('0x41')][_0xf225('0x58')]){_0x2d0b07['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xf225('0x46')](_0x2d0b07);})[_0xf225('0x15')](function(_0x281eb9){_0x28d6de[_0xf225('0x47')]=_0x281eb9;return _0x28d6de;});}})[_0xf225('0x15')](respondWithFilteredResult(_0x59ba97,_0x2d0b07))[_0xf225('0x1f')](handleError(_0x59ba97,null));};exports[_0xf225('0xe0')]=function(_0x29e926,_0x5e1c82){var _0x265728={'raw':!![],'where':{}};var _0x92469d={};var _0x468aff={'count':0x0,'rows':[]};return db[_0xf225('0x3a')]['findOne']({'where':{'id':_0x29e926[_0xf225('0x52')]['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x5e1c82,null))[_0xf225('0x15')](function(_0x3a6a4c){if(_0x3a6a4c){_0x92469d[_0xf225('0x53')]=_[_0xf225('0xcd')](db['ScreenRecording'][_0xf225('0x3b')]);_0x92469d[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x29e926[_0xf225('0x41')]);_0x92469d[_0xf225('0x55')]=_[_0xf225('0x56')](_0x92469d[_0xf225('0x53')],_0x92469d['query']);_0x265728[_0xf225('0x45')]=_[_0xf225('0x56')](_0x92469d[_0xf225('0x53')],qs[_0xf225('0x57')](_0x29e926[_0xf225('0x41')][_0xf225('0x57')]));_0x265728['attributes']=_0x265728[_0xf225('0x45')]['length']?_0x265728[_0xf225('0x45')]:_0x92469d[_0xf225('0x53')];if(!_0x29e926['query'][_0xf225('0xd1')]('nolimit')){_0x265728[_0xf225('0x26')]=qs[_0xf225('0x26')](_0x29e926[_0xf225('0x41')][_0xf225('0x26')]);_0x265728[_0xf225('0x23')]=qs[_0xf225('0x23')](_0x29e926['query']['offset']);}_0x265728[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x29e926['query'][_0xf225('0xd0')]);_0x265728[_0xf225('0x3f')]=qs[_0xf225('0x55')](_[_0xf225('0xd8')](_0x29e926[_0xf225('0x41')],_0x92469d[_0xf225('0x55')]));_0x265728[_0xf225('0x3f')][_0xf225('0xdf')]=_0x3a6a4c['id'];if(_0x29e926[_0xf225('0x41')][_0xf225('0x2e')]){_0x265728[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x265728[_0xf225('0x3f')],{'$or':_[_0xf225('0x30')](_0x265728[_0xf225('0x45')],function(_0x3da22d){var _0x294f14={};_0x294f14[_0x3da22d]={'$like':'%'+_0x29e926[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x294f14;})});}_0x265728=_[_0xf225('0x59')]({},_0x265728,_0x29e926['options']);return db[_0xf225('0xe1')][_0xf225('0x25')]({'where':_0x265728[_0xf225('0x3f')]})[_0xf225('0x15')](function(_0xb82b14){_0x468aff[_0xf225('0x25')]=_0xb82b14;if(_0x29e926[_0xf225('0x41')][_0xf225('0x58')]){_0x265728['include']=[{'all':!![]}];}return db[_0xf225('0xe1')][_0xf225('0x46')](_0x265728);})[_0xf225('0x15')](function(_0x9cff20){_0x468aff[_0xf225('0x47')]=_0x9cff20;return _0x468aff;});}})['then'](respondWithFilteredResult(_0x5e1c82,_0x265728))['catch'](handleError(_0x5e1c82,null));};exports[_0xf225('0xe2')]=function(_0x4ee00,_0x53493c){var _0x13a12c={};var _0x16b103={};var _0x3d8ec2;var _0x185ab8;return db['User'][_0xf225('0x96')]({'where':{'id':_0x4ee00[_0xf225('0x52')]['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x53493c,null))[_0xf225('0x15')](function(_0x8afec2){if(_0x8afec2){_0x3d8ec2=_0x8afec2;_0x16b103['model']=_['keys'](db[_0xf225('0xe3')]['rawAttributes']);_0x16b103[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x4ee00[_0xf225('0x41')]);_0x16b103[_0xf225('0x55')]=_[_0xf225('0x56')](_0x16b103['model'],_0x16b103[_0xf225('0x41')]);_0x13a12c['attributes']=_[_0xf225('0x56')](_0x16b103[_0xf225('0x53')],qs[_0xf225('0x57')](_0x4ee00[_0xf225('0x41')]['fields']));_0x13a12c[_0xf225('0x45')]=_0x13a12c[_0xf225('0x45')]['length']?_0x13a12c[_0xf225('0x45')]:_0x16b103[_0xf225('0x53')];_0x13a12c['order']=qs['sort'](_0x4ee00['query']['sort']);_0x13a12c['where']=qs[_0xf225('0x55')](_[_0xf225('0xd8')](_0x4ee00[_0xf225('0x41')],_0x16b103[_0xf225('0x55')]));if(_0x4ee00[_0xf225('0x41')][_0xf225('0x2e')]){_0x13a12c[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x13a12c[_0xf225('0x3f')],{'$or':_['map'](_0x13a12c[_0xf225('0x45')],function(_0x2623ab){var _0x2a3e41={};_0x2a3e41[_0x2623ab]={'$like':'%'+_0x4ee00['query'][_0xf225('0x2e')]+'%'};return _0x2a3e41;})});}_0x13a12c=_[_0xf225('0x59')]({},_0x13a12c,_0x4ee00[_0xf225('0x5a')]);return _0x3d8ec2['getChatInteractions'](_0x13a12c);}})[_0xf225('0x15')](function(_0x1329f9){if(_0x1329f9){_0x185ab8=_0x1329f9[_0xf225('0x48')];if(!_0x4ee00[_0xf225('0x41')]['hasOwnProperty']('nolimit')){_0x13a12c[_0xf225('0x26')]=qs[_0xf225('0x26')](_0x4ee00[_0xf225('0x41')][_0xf225('0x26')]);_0x13a12c[_0xf225('0x23')]=qs[_0xf225('0x23')](_0x4ee00[_0xf225('0x41')][_0xf225('0x23')]);}return _0x3d8ec2['getChatInteractions'](_0x13a12c);}})[_0xf225('0x15')](function(_0x2d3469){if(_0x2d3469){return _0x2d3469?{'count':_0x185ab8,'rows':_0x2d3469}:null;}})[_0xf225('0x15')](respondWithResult(_0x53493c,null))['catch'](handleError(_0x53493c,null));};exports[_0xf225('0xe4')]=function(_0x102aa8,_0x427b08){var _0x5604b7={};var _0x4102fb={};var _0x5c0b3a;var _0x4442fa;return db['User']['findOne']({'where':{'id':_0x102aa8['params']['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x427b08,null))['then'](function(_0x126baf){if(_0x126baf){_0x5c0b3a=_0x126baf;_0x4102fb['model']=_[_0xf225('0xcd')](db['OpenchannelInteraction'][_0xf225('0x3b')]);_0x4102fb['query']=_[_0xf225('0xcd')](_0x102aa8[_0xf225('0x41')]);_0x4102fb[_0xf225('0x55')]=_['intersection'](_0x4102fb[_0xf225('0x53')],_0x4102fb[_0xf225('0x41')]);_0x5604b7[_0xf225('0x45')]=_['intersection'](_0x4102fb['model'],qs[_0xf225('0x57')](_0x102aa8['query'][_0xf225('0x57')]));_0x5604b7[_0xf225('0x45')]=_0x5604b7[_0xf225('0x45')][_0xf225('0x48')]?_0x5604b7[_0xf225('0x45')]:_0x4102fb[_0xf225('0x53')];_0x5604b7[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x102aa8[_0xf225('0x41')][_0xf225('0xd0')]);_0x5604b7['where']=qs['filters'](_['pick'](_0x102aa8[_0xf225('0x41')],_0x4102fb[_0xf225('0x55')]));if(_0x102aa8[_0xf225('0x41')][_0xf225('0x2e')]){_0x5604b7[_0xf225('0x3f')]=_['merge'](_0x5604b7[_0xf225('0x3f')],{'$or':_[_0xf225('0x30')](_0x5604b7[_0xf225('0x45')],function(_0x4d63b5){var _0x401e4d={};_0x401e4d[_0x4d63b5]={'$like':'%'+_0x102aa8[_0xf225('0x41')]['filter']+'%'};return _0x401e4d;})});}_0x5604b7=_['merge']({},_0x5604b7,_0x102aa8[_0xf225('0x5a')]);return _0x5c0b3a[_0xf225('0xe4')](_0x5604b7);}})[_0xf225('0x15')](function(_0x4ff1bd){if(_0x4ff1bd){_0x4442fa=_0x4ff1bd['length'];if(!_0x102aa8['query']['hasOwnProperty']('nolimit')){_0x5604b7[_0xf225('0x26')]=qs['limit'](_0x102aa8[_0xf225('0x41')]['limit']);_0x5604b7['offset']=qs['offset'](_0x102aa8[_0xf225('0x41')][_0xf225('0x23')]);}return _0x5c0b3a['getOpenchannelInteractions'](_0x5604b7);}})['then'](function(_0x101c81){if(_0x101c81){return _0x101c81?{'count':_0x4442fa,'rows':_0x101c81}:null;}})[_0xf225('0x15')](respondWithResult(_0x427b08,null))[_0xf225('0x1f')](handleError(_0x427b08,null));};exports[_0xf225('0xe5')]=function(_0x523e27,_0x4d7d34){var _0x5d5248={'raw':!![],'where':{}};var _0x1d5ed5={};var _0x4ff6e0={'count':0x0,'rows':[]};return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x523e27[_0xf225('0x52')]['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x4d7d34,null))[_0xf225('0x15')](function(_0x3d987c){if(_0x3d987c){_0x1d5ed5['model']=_['keys'](db[_0xf225('0xe6')][_0xf225('0x3b')]);_0x1d5ed5[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x523e27[_0xf225('0x41')]);_0x1d5ed5[_0xf225('0x55')]=_[_0xf225('0x56')](_0x1d5ed5['model'],_0x1d5ed5[_0xf225('0x41')]);_0x5d5248['attributes']=_[_0xf225('0x56')](_0x1d5ed5[_0xf225('0x53')],qs[_0xf225('0x57')](_0x523e27['query'][_0xf225('0x57')]));_0x5d5248[_0xf225('0x45')]=_0x5d5248[_0xf225('0x45')][_0xf225('0x48')]?_0x5d5248[_0xf225('0x45')]:_0x1d5ed5[_0xf225('0x53')];if(!_0x523e27['query']['hasOwnProperty']('nolimit')){_0x5d5248[_0xf225('0x26')]=qs[_0xf225('0x26')](_0x523e27[_0xf225('0x41')][_0xf225('0x26')]);_0x5d5248[_0xf225('0x23')]=qs[_0xf225('0x23')](_0x523e27['query'][_0xf225('0x23')]);}_0x5d5248[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x523e27[_0xf225('0x41')]['sort']);_0x5d5248[_0xf225('0x3f')]=qs[_0xf225('0x55')](_['pick'](_0x523e27[_0xf225('0x41')],_0x1d5ed5[_0xf225('0x55')]));_0x5d5248['where']['UserId']=_0x3d987c['id'];if(_0x523e27['query'][_0xf225('0x2e')]){_0x5d5248['where']=_[_0xf225('0x59')](_0x5d5248[_0xf225('0x3f')],{'$or':_[_0xf225('0x30')](_0x5d5248['attributes'],function(_0x7da2b1){var _0x4cc10f={};_0x4cc10f[_0x7da2b1]={'$like':'%'+_0x523e27[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x4cc10f;})});}_0x5d5248=_[_0xf225('0x59')]({},_0x5d5248,_0x523e27[_0xf225('0x5a')]);return db[_0xf225('0xe6')]['count']({'where':_0x5d5248[_0xf225('0x3f')]})[_0xf225('0x15')](function(_0x402f18){_0x4ff6e0[_0xf225('0x25')]=_0x402f18;if(_0x523e27[_0xf225('0x41')][_0xf225('0x58')]){_0x5d5248[_0xf225('0x40')]=[{'all':!![]}];}return db[_0xf225('0xe6')][_0xf225('0x46')](_0x5d5248);})[_0xf225('0x15')](function(_0x4e8478){_0x4ff6e0[_0xf225('0x47')]=_0x4e8478;return _0x4ff6e0;});}})[_0xf225('0x15')](respondWithFilteredResult(_0x4d7d34,_0x5d5248))[_0xf225('0x1f')](handleError(_0x4d7d34,null));};exports[_0xf225('0xe7')]=function(_0x5be154,_0x582528){var _0x42c35d={};var _0x47c6f8={};var _0x3cf38c;var _0x578a9e;return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x5be154[_0xf225('0x52')]['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x582528,null))[_0xf225('0x15')](function(_0xfe3c5b){if(_0xfe3c5b){_0x3cf38c=_0xfe3c5b;_0x47c6f8[_0xf225('0x53')]=_['keys'](db[_0xf225('0xe8')]['rawAttributes']);_0x47c6f8['query']=_[_0xf225('0xcd')](_0x5be154[_0xf225('0x41')]);_0x47c6f8[_0xf225('0x55')]=_[_0xf225('0x56')](_0x47c6f8[_0xf225('0x53')],_0x47c6f8['query']);_0x42c35d[_0xf225('0x45')]=_[_0xf225('0x56')](_0x47c6f8[_0xf225('0x53')],qs['fields'](_0x5be154[_0xf225('0x41')]['fields']));_0x42c35d[_0xf225('0x45')]=_0x42c35d[_0xf225('0x45')][_0xf225('0x48')]?_0x42c35d['attributes']:_0x47c6f8['model'];_0x42c35d['order']=qs[_0xf225('0xd0')](_0x5be154['query'][_0xf225('0xd0')]);_0x42c35d['where']=qs['filters'](_[_0xf225('0xd8')](_0x5be154[_0xf225('0x41')],_0x47c6f8[_0xf225('0x55')]));if(_0x5be154[_0xf225('0x41')]['filter']){_0x42c35d[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x42c35d[_0xf225('0x3f')],{'$or':_[_0xf225('0x30')](_0x42c35d[_0xf225('0x45')],function(_0x153c01){var _0x4a473c={};_0x4a473c[_0x153c01]={'$like':'%'+_0x5be154[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x4a473c;})});}_0x42c35d=_[_0xf225('0x59')]({},_0x42c35d,_0x5be154[_0xf225('0x5a')]);return _0x3cf38c[_0xf225('0xe7')](_0x42c35d);}})[_0xf225('0x15')](function(_0x4fc801){if(_0x4fc801){_0x578a9e=_0x4fc801['length'];if(!_0x5be154['query']['hasOwnProperty'](_0xf225('0xd6'))){_0x42c35d[_0xf225('0x26')]=qs[_0xf225('0x26')](_0x5be154[_0xf225('0x41')][_0xf225('0x26')]);_0x42c35d[_0xf225('0x23')]=qs[_0xf225('0x23')](_0x5be154['query'][_0xf225('0x23')]);}return _0x3cf38c['getSmsInteractions'](_0x42c35d);}})[_0xf225('0x15')](function(_0x53a045){if(_0x53a045){return _0x53a045?{'count':_0x578a9e,'rows':_0x53a045}:null;}})[_0xf225('0x15')](respondWithResult(_0x582528,null))[_0xf225('0x1f')](handleError(_0x582528,null));};exports[_0xf225('0xe9')]=function(_0x4c20a7,_0x21013c){var _0x3b196e={};var _0x45d7ad={};var _0x587816;var _0xb691a5;return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x4c20a7['params']['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x21013c,null))[_0xf225('0x15')](function(_0x2413e3){if(_0x2413e3){_0x587816=_0x2413e3;_0x45d7ad[_0xf225('0x53')]=_[_0xf225('0xcd')](db[_0xf225('0xea')][_0xf225('0x3b')]);_0x45d7ad[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x4c20a7['query']);_0x45d7ad[_0xf225('0x55')]=_[_0xf225('0x56')](_0x45d7ad[_0xf225('0x53')],_0x45d7ad[_0xf225('0x41')]);_0x3b196e[_0xf225('0x45')]=_[_0xf225('0x56')](_0x45d7ad['model'],qs[_0xf225('0x57')](_0x4c20a7['query'][_0xf225('0x57')]));_0x3b196e[_0xf225('0x45')]=_0x3b196e[_0xf225('0x45')][_0xf225('0x48')]?_0x3b196e[_0xf225('0x45')]:_0x45d7ad[_0xf225('0x53')];_0x3b196e[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x4c20a7[_0xf225('0x41')][_0xf225('0xd0')]);_0x3b196e[_0xf225('0x3f')]=qs[_0xf225('0x55')](_[_0xf225('0xd8')](_0x4c20a7[_0xf225('0x41')],_0x45d7ad[_0xf225('0x55')]));if(_0x4c20a7['query']['filter']){_0x3b196e[_0xf225('0x3f')]=_['merge'](_0x3b196e['where'],{'$or':_[_0xf225('0x30')](_0x3b196e[_0xf225('0x45')],function(_0x389163){var _0x20ae84={};_0x20ae84[_0x389163]={'$like':'%'+_0x4c20a7['query'][_0xf225('0x2e')]+'%'};return _0x20ae84;})});}_0x3b196e=_['merge']({},_0x3b196e,_0x4c20a7[_0xf225('0x5a')]);return _0x587816[_0xf225('0xe9')](_0x3b196e);}})[_0xf225('0x15')](function(_0x2462a6){if(_0x2462a6){_0xb691a5=_0x2462a6['length'];if(!_0x4c20a7[_0xf225('0x41')][_0xf225('0xd1')](_0xf225('0xd6'))){_0x3b196e['limit']=qs[_0xf225('0x26')](_0x4c20a7[_0xf225('0x41')]['limit']);_0x3b196e['offset']=qs['offset'](_0x4c20a7[_0xf225('0x41')]['offset']);}return _0x587816[_0xf225('0xe9')](_0x3b196e);}})[_0xf225('0x15')](function(_0x1e00fd){if(_0x1e00fd){return _0x1e00fd?{'count':_0xb691a5,'rows':_0x1e00fd}:null;}})['then'](respondWithResult(_0x21013c,null))[_0xf225('0x1f')](handleError(_0x21013c,null));};exports['getWhatsappInteractions']=function(_0x42d64d,_0x522a6b){var _0x229cc3={};var _0x37eec5={};var _0x5c5596;var _0x20419d;return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x42d64d[_0xf225('0x52')]['id']}})['then'](handleEntityNotFound(_0x522a6b,null))[_0xf225('0x15')](function(_0x59c4fe){if(_0x59c4fe){_0x5c5596=_0x59c4fe;_0x37eec5[_0xf225('0x53')]=_['keys'](db[_0xf225('0xeb')]['rawAttributes']);_0x37eec5[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x42d64d[_0xf225('0x41')]);_0x37eec5[_0xf225('0x55')]=_[_0xf225('0x56')](_0x37eec5[_0xf225('0x53')],_0x37eec5[_0xf225('0x41')]);_0x229cc3['attributes']=_[_0xf225('0x56')](_0x37eec5['model'],qs['fields'](_0x42d64d[_0xf225('0x41')][_0xf225('0x57')]));_0x229cc3[_0xf225('0x45')]=_0x229cc3[_0xf225('0x45')][_0xf225('0x48')]?_0x229cc3[_0xf225('0x45')]:_0x37eec5[_0xf225('0x53')];_0x229cc3[_0xf225('0xcf')]=qs['sort'](_0x42d64d[_0xf225('0x41')][_0xf225('0xd0')]);_0x229cc3['where']=qs[_0xf225('0x55')](_[_0xf225('0xd8')](_0x42d64d[_0xf225('0x41')],_0x37eec5[_0xf225('0x55')]));if(_0x42d64d[_0xf225('0x41')][_0xf225('0x2e')]){_0x229cc3[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x229cc3['where'],{'$or':_['map'](_0x229cc3['attributes'],function(_0x141c57){var _0x355717={};_0x355717[_0x141c57]={'$like':'%'+_0x42d64d[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x355717;})});}_0x229cc3=_[_0xf225('0x59')]({},_0x229cc3,_0x42d64d['options']);return _0x5c5596[_0xf225('0xec')](_0x229cc3);}})[_0xf225('0x15')](function(_0xe28d67){if(_0xe28d67){_0x20419d=_0xe28d67[_0xf225('0x48')];if(!_0x42d64d[_0xf225('0x41')][_0xf225('0xd1')]('nolimit')){_0x229cc3['limit']=qs['limit'](_0x42d64d['query'][_0xf225('0x26')]);_0x229cc3[_0xf225('0x23')]=qs['offset'](_0x42d64d['query'][_0xf225('0x23')]);}return _0x5c5596[_0xf225('0xec')](_0x229cc3);}})[_0xf225('0x15')](function(_0x1129ea){if(_0x1129ea){return _0x1129ea?{'count':_0x20419d,'rows':_0x1129ea}:null;}})[_0xf225('0x15')](respondWithResult(_0x522a6b,null))[_0xf225('0x1f')](handleError(_0x522a6b,null));};exports[_0xf225('0xed')]=function(_0x3bfc93,_0x203673,_0x275b0c){var _0x51b2e8;var _0x2b7383;var _0x4132fc;var _0x6a2980=!_[_0xf225('0x67')](_0x3bfc93['params']['id'])?_0x3bfc93[_0xf225('0x52')]['id']:!_[_0xf225('0x67')](_0x3bfc93['user']['id'])?_0x3bfc93[_0xf225('0x7f')]['id']:null;return db[_0xf225('0x3a')][_0xf225('0x5e')]({'where':{'id':_0x6a2980,'role':{'$or':[_0xf225('0x2a'),_0xf225('0x7f'),'agent']}},'attributes':['id',_0xf225('0x34'),'phone',_0xf225('0xee'),_0xf225('0x33'),_0xf225('0x63'),_0xf225('0x9e')]})[_0xf225('0x15')](function(_0x325a39){if(_0x325a39){if(_0x325a39[_0xf225('0x33')]===_0xf225('0x70')){_0x51b2e8=_0x325a39;if(_0x3bfc93[_0xf225('0x5d')][_0xf225('0xa0')]){_0x4132fc=util[_0xf225('0xaf')](_0xf225('0xef'),_0x51b2e8[_0x3bfc93['body'][_0xf225('0xa0')]]);}else if(_0x3bfc93[_0xf225('0x5d')]['intrf']){_0x4132fc=util['format'](_0xf225('0xf0'),_0x3bfc93[_0xf225('0x5d')]['intrf']);}else{_0x4132fc=util[_0xf225('0xaf')]('SIP/%s',_0x51b2e8[_0xf225('0x34')]);}socket['to'](util[_0xf225('0xaf')](_0xf225('0xf1'),_0x51b2e8[_0xf225('0x34')]))['emit'](_0xf225('0xf2'),{'user':{'id':_0x51b2e8['id'],'name':_0x51b2e8[_0xf225('0x34')]},'ip':_0x3bfc93[_0xf225('0xf3')][_0xf225('0xf4')]||_0x3bfc93[_0xf225('0xf5')][_0xf225('0xf6')]||_0x3bfc93[_0xf225('0xf7')][_0xf225('0xf6')]||_0x3bfc93[_0xf225('0xf5')]['socket'][_0xf225('0xf6')]});return db['UserVoiceQueueRt'][_0xf225('0x29')]({'where':{'membername':_0x51b2e8[_0xf225('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0xf225('0x90'))][(_0xf225('0x91'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xf225('0x15')](function(){if(_0x51b2e8){return _0x51b2e8['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x283438){if(_0x51b2e8){if(_0x283438){_0x2b7383=_0x283438;if(_0x2b7383[_0xf225('0x48')]){var _0x4221ad=_0x2b7383[_0xf225('0x30')](function(_0xed62d4){var _0x2ac70a={'membername':_0x51b2e8['name'],'UserId':_0x51b2e8['id'],'queue_name':_0xed62d4[_0xf225('0x34')],'VoiceQueueId':_0xed62d4['id'],'interface':_0x4132fc,'paused':_0x51b2e8[_0xf225('0x9e')]||![],'penalty':_0xed62d4[_0xf225('0xf8')]||0x0};return db[_0xf225('0xb0')][_0xf225('0xb1')](_0x2ac70a);});return Promise[_0xf225('0x5c')](_0x4221ad);}}}})['then'](function(){if(_0x51b2e8){return db[_0xf225('0xf9')][_0xf225('0x46')]({'where':{'membername':_0x51b2e8['name'],'exitAt':null}});}})['then'](function(_0x158344){if(_0x51b2e8){var _0x38608c=[];_0x158344[_0xf225('0xfa')](function(_0x30d0dc){_0x38608c['push'](_0x30d0dc[_0xf225('0x28')]({'exitAt':moment()['format'](_0xf225('0xfb'))}));});return Promise[_0xf225('0x5c')](_0x38608c);}})[_0xf225('0x15')](function(){if(_0x51b2e8){var _0x58aefe=[];var _0x3e8ce1=[];var _0x1a9e62=utils[_0xf225('0xfc')]();var _0x17d3d5={'membername':_0x51b2e8['name'],'interface':_0x4132fc,'enterAt':moment()[_0xf225('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x51b2e8['role'],'internal':_0x51b2e8[_0xf225('0x63')]};_0x1a9e62['forEach'](function(_0x4b72ae){_0x58aefe['push'](_[_0xf225('0x59')]({'channel':_0x4b72ae,'type':_0xf225('0xfd'),'data1':_0x3bfc93['body']['device'],'data2':_0x4132fc},_0x17d3d5));if(_0x51b2e8[_0xf225('0x9e')]){_0x3e8ce1[_0xf225('0x49')](_[_0xf225('0x59')]({'channel':_0x4b72ae,'type':'PAUSE','data1':_0xf225('0xfe')},_0x17d3d5));}});return db['MemberReport'][_0xf225('0x87')](_0x58aefe[_0xf225('0xcb')](_0x3e8ce1),{'individualHooks':!![]});}})[_0xf225('0x15')](function(){if(_0x51b2e8){return _0x51b2e8[_0xf225('0x28')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x51b2e8[_0xf225('0x9e')]||![],'mailPause':_0x51b2e8[_0xf225('0x9e')]||![],'chatPause':_0x51b2e8[_0xf225('0x9e')]||![],'faxPause':_0x51b2e8['loginInPause']||![],'smsPause':_0x51b2e8[_0xf225('0x9e')]||![],'openchannelPause':_0x51b2e8[_0xf225('0x9e')]||![],'whatsappPause':_0x51b2e8[_0xf225('0x9e')]||![],'pauseType':_0x51b2e8[_0xf225('0x9e')]?_0xf225('0xfe'):null,'interface':_0x4132fc,'lastPauseAt':moment()[_0xf225('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x22d918){if(_0x3bfc93[_0xf225('0xff')]){return _0x275b0c();}else{return Promise[_0xf225('0x100')](_0x22d918)['then'](respondWithResult(_0x203673,null));}})[_0xf225('0x1f')](handleError(_0x203673,null));};exports['logout']=function(_0x1eb7ba,_0x120dcd){var _0x12e7d0;return db[_0xf225('0x3a')]['find']({'where':{'id':_0x1eb7ba[_0xf225('0x52')]['id'],'role':_0xf225('0x70')},'attributes':['id',_0xf225('0x34'),_0xf225('0x33')]})[_0xf225('0x15')](handleEntityNotFound(_0x120dcd,null))[_0xf225('0x15')](function(_0x4aed0c){if(_0x4aed0c){_0x12e7d0=_0x4aed0c;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x12e7d0[_0xf225('0x34')]},'individualHooks':!![]});}})[_0xf225('0x15')](function(){return db[_0xf225('0xf9')][_0xf225('0x46')]({'where':{'membername':_0x12e7d0[_0xf225('0x34')],'exitAt':null}});})[_0xf225('0x15')](function(_0x43040e){var _0x1331ab=[];_0x43040e[_0xf225('0xfa')](function(_0x44d912){_0x1331ab[_0xf225('0x49')](_0x44d912[_0xf225('0x28')]({'exitAt':moment()[_0xf225('0xaf')](_0xf225('0xfb'))}));});return Promise[_0xf225('0x5c')](_0x1331ab);})[_0xf225('0x15')](function(){return _0x12e7d0[_0xf225('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xf225('0x15')](respondWithResult(_0x120dcd,null))[_0xf225('0x1f')](handleError(_0x120dcd,null));};exports[_0xf225('0x101')]=function(_0x43adae,_0x37c5ab){var _0x89d904;return db['UserVoiceQueueRt'][_0xf225('0x28')]({'paused':0x1},{'where':{'UserId':_0x43adae['params']['id']},'individualHooks':!![]})[_0xf225('0x15')](function(){return db[_0xf225('0x3a')][_0xf225('0x5e')]({'where':{'id':_0x43adae['params']['id'],'role':_0xf225('0x70')},'attributes':['id','name',_0xf225('0x33'),_0xf225('0x63'),_0xf225('0xa0'),'online']});})[_0xf225('0x15')](handleEntityNotFound(_0x37c5ab,null))[_0xf225('0x15')](function(_0x2da3c6){if(_0x2da3c6){_0x89d904=_0x2da3c6;return respondWithRpcPromise(_0xf225('0x102'),_0xf225('0x101'),{'id':_0x89d904['id'],'name':_0x89d904[_0xf225('0x34')],'pause':!![]});}})[_0xf225('0x15')](function(){if(_0x89d904){return db[_0xf225('0xf9')][_0xf225('0x46')]({'where':{'membername':_0x89d904['name'],'type':'PAUSE','exitAt':null}});}})[_0xf225('0x15')](function(_0xfc304e){if(_0xfc304e['length']){var _0x3e0688=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x376bd3=0x0,_0x36f3dc=_0xfc304e[_0xf225('0x48')];_0x376bd3<_0x36f3dc;_0x376bd3++){_0xfc304e[_0x376bd3][_0xf225('0x103')]({'exitAt':_0x3e0688});}}})[_0xf225('0x15')](function(){var _0x442ee4=[];var _0x1f0ad6=utils[_0xf225('0xfc')]();_0x1f0ad6[_0xf225('0xfa')](function(_0xff5c6e){_0x442ee4[_0xf225('0x49')]({'channel':_0xff5c6e,'membername':_0x89d904[_0xf225('0x34')],'interface':_[_0xf225('0x67')](_0x89d904['interface'])?util[_0xf225('0xaf')](_0xf225('0xf0'),_0x89d904[_0xf225('0x34')]):_0x89d904[_0xf225('0xa0')],'type':'PAUSE','enterAt':moment()[_0xf225('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x43adae[_0xf225('0x5d')][_0xf225('0x104')]||_0xf225('0x105'),'role':_0x89d904['role'],'internal':_0x89d904[_0xf225('0x63')]});});return db[_0xf225('0xf9')][_0xf225('0x87')](_0x442ee4,{'individualHooks':!![]});})[_0xf225('0x15')](function(){return _0x89d904[_0xf225('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x43adae['body']['type']||_0xf225('0x105'),'lastPauseAt':moment()[_0xf225('0xaf')](_0xf225('0xfb'))});})['then'](respondWithResult(_0x37c5ab,null))[_0xf225('0x1f')](handleError(_0x37c5ab,null));};exports[_0xf225('0x106')]=function(_0x3f361e,_0x2577cb){if(_0x3f361e[_0xf225('0x5d')][_0xf225('0xb3')]&&!utils[_0xf225('0xa1')](_0x3f361e[_0xf225('0x5d')][_0xf225('0xb3')])){throw new APIBadRequestError(util['format'](_0xf225('0x107'),_0x3f361e[_0xf225('0x5d')][_0xf225('0xb3')]));}return db[_0xf225('0x3a')]['find']({'where':{'id':_0x3f361e['params']['id']},'attributes':['id',_0xf225('0x34'),_0xf225('0x33'),_0xf225('0x63'),_0xf225('0xa0'),'online',_0xf225('0x9f'),_0xf225('0x108'),_0xf225('0x109'),_0xf225('0x10a'),_0xf225('0x10b'),'smsPause',_0xf225('0x10c'),_0xf225('0x10d'),'lastPauseAt']})[_0xf225('0x15')](function(_0x167e64){if(!_0x167e64){throw new APINotFoundError(util[_0xf225('0xaf')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3f361e[_0xf225('0x52')]['id']));}return _0x167e64['unpause'](_0x3f361e[_0xf225('0x5d')][_0xf225('0xb3')]);})[_0xf225('0x15')](respondWithResult(_0x2577cb,null))[_0xf225('0x1f')](APIHandleError(_0x2577cb));};exports[_0xf225('0x10e')]=function(_0x5d900b,_0x18dd02){var _0x4d79d4={};var _0x32d290={};var _0x52ff93;var _0x2a5737;return db[_0xf225('0x3a')]['findOne']({'where':{'id':_0x5d900b[_0xf225('0x52')]['id']}})['then'](handleEntityNotFound(_0x18dd02,null))[_0xf225('0x15')](function(_0x5d596d){if(_0x5d596d){_0x52ff93=_0x5d596d;_0x32d290[_0xf225('0x53')]=_[_0xf225('0xcd')](db[_0xf225('0x10f')][_0xf225('0x3b')]);_0x32d290[_0xf225('0x41')]=_[_0xf225('0xcd')](_0x5d900b['query']);_0x32d290[_0xf225('0x55')]=_['intersection'](_0x32d290[_0xf225('0x53')],_0x32d290[_0xf225('0x41')]);_0x4d79d4[_0xf225('0x45')]=_[_0xf225('0x56')](_0x32d290[_0xf225('0x53')],qs[_0xf225('0x57')](_0x5d900b[_0xf225('0x41')][_0xf225('0x57')]));_0x4d79d4['attributes']=_0x4d79d4[_0xf225('0x45')][_0xf225('0x48')]?_0x4d79d4[_0xf225('0x45')]:_0x32d290['model'];_0x4d79d4[_0xf225('0xcf')]=qs[_0xf225('0xd0')](_0x5d900b[_0xf225('0x41')][_0xf225('0xd0')]);_0x4d79d4[_0xf225('0x3f')]=qs['filters'](_[_0xf225('0xd8')](_0x5d900b['query'],_0x32d290['filters']));if(_0x5d900b[_0xf225('0x41')][_0xf225('0x2e')]){_0x4d79d4['where']=_[_0xf225('0x59')](_0x4d79d4[_0xf225('0x3f')],{'$or':_[_0xf225('0x30')](_0x4d79d4['attributes'],function(_0x1da6da){var _0x117ae3={};_0x117ae3[_0x1da6da]={'$like':'%'+_0x5d900b[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x117ae3;})});}_0x4d79d4=_['merge']({},_0x4d79d4,_0x5d900b[_0xf225('0x5a')]);return _0x52ff93['getTeams'](_0x4d79d4);}})['then'](function(_0x4c4582){if(_0x4c4582){_0x2a5737=_0x4c4582[_0xf225('0x48')];if(!_0x5d900b[_0xf225('0x41')]['hasOwnProperty'](_0xf225('0xd6'))){_0x4d79d4['limit']=qs[_0xf225('0x26')](_0x5d900b[_0xf225('0x41')][_0xf225('0x26')]);_0x4d79d4[_0xf225('0x23')]=qs[_0xf225('0x23')](_0x5d900b[_0xf225('0x41')][_0xf225('0x23')]);}return _0x52ff93['getTeams'](_0x4d79d4);}})[_0xf225('0x15')](function(_0x4190e8){if(_0x4190e8){return _0x4190e8?{'count':_0x2a5737,'rows':_0x4190e8}:null;}})[_0xf225('0x15')](respondWithResult(_0x18dd02,null))[_0xf225('0x1f')](handleError(_0x18dd02,null));};exports[_0xf225('0x110')]=function(_0x11a712,_0x261a44){var _0x22642f=_0x11a712['params']['id'];var _0x1364f9=_0x11a712[_0xf225('0x5d')]?_0x11a712[_0xf225('0x5d')][_0xf225('0x61')]:null;var _0x49d9ea=[];return Promise[_0xf225('0x100')]()[_0xf225('0x15')](function(){if(!_0x1364f9)throw new APIBadRequestError(_0xf225('0x111'));})[_0xf225('0x15')](function(){return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x22642f}});})[_0xf225('0x15')](function(_0x6f6d9a){if(!_0x6f6d9a)throw new APINotFoundError(util[_0xf225('0xaf')](_0xf225('0x112'),_0x11a712[_0xf225('0x52')]['id']));return db[_0xf225('0x6a')][_0xf225('0x113')](function(_0x91090){return _0x6f6d9a[_0xf225('0x110')](_0x1364f9,{'transaction':_0x91090})[_0xf225('0x15')](function(){return db[_0xf225('0x10f')][_0xf225('0x46')]({'where':{'id':{'$in':_0x1364f9}}});})['then'](function(_0x1aa686){var _0x142130=_[_0xf225('0x30')](_0x1aa686,function(_0x2506b4){return _0x2506b4['getAssociatedQueues']();});return Promise[_0xf225('0x5c')](_0x142130);})[_0xf225('0x15')](function(_0x27b181){_0x49d9ea=_[_0xf225('0x114')](_0x27b181);var _0x3aaabc=_['map'](_0x49d9ea,function(_0x1c74ed){return _0x1c74ed[_0xf225('0x115')](_0x6f6d9a['id'],{'transaction':_0x91090});});return Promise[_0xf225('0x5c')](_0x3aaabc);})[_0xf225('0x15')](function(){if(!_0x6f6d9a[_0xf225('0x9d')])return;var _0x23fb6c=_['filter'](_0x49d9ea,function(_0x24ed14){return _0x24ed14[_0xf225('0x116')](_0xf225('0xb3'))===_0xf225('0x117');});var _0x147b61=_[_0xf225('0x30')](_0x23fb6c,function(_0xb82574){return db[_0xf225('0xb0')][_0xf225('0xb1')]({'membername':_0x6f6d9a[_0xf225('0x34')],'UserId':_0x6f6d9a['id'],'queue_name':_0xb82574[_0xf225('0x34')],'VoiceQueueId':_0xb82574['id'],'interface':_[_0xf225('0x67')](_0x6f6d9a['interface'])?util[_0xf225('0xaf')](_0xf225('0xf0'),_0x6f6d9a[_0xf225('0x34')]):_0x6f6d9a[_0xf225('0xa0')],'paused':_0x6f6d9a[_0xf225('0x9f')]||![],'penalty':_0x6f6d9a[_0xf225('0xa6')]},{'transaction':_0x91090});});return Promise[_0xf225('0x5c')](_0x147b61);})[_0xf225('0x15')](function(){return db[_0xf225('0x118')][_0xf225('0x46')]({'where':{'teamId':{'$in':_0x1364f9}}});})[_0xf225('0x15')](function(_0x286a28){var _0x5799c0=_['map'](_0x286a28,function(_0x512228){return db[_0xf225('0x119')]['create']({'UserId':_0x6f6d9a['id'],'VoicePrefixId':_0x512228[_0xf225('0x11a')]},{'transaction':_0x91090});});return Promise[_0xf225('0x5c')](_0x5799c0);});});})[_0xf225('0x15')](function(){for(var _0x2bda82=0x0;_0x2bda82<_0x49d9ea[_0xf225('0x48')];_0x2bda82++){var _0x274fa6=_0x49d9ea[_0x2bda82]['getDataValue'](_0xf225('0xb3'));var _0x196496=_0x274fa6+'QueueId';socket[_0xf225('0xaa')](_0xf225('0x7f')+_0x274fa6+_0xf225('0xab'),{'UserId':_0x22642f,['queueField']:_0x49d9ea[_0x2bda82]['id']});}})[_0xf225('0x15')](respondWithStatusCode(_0x261a44,null))[_0xf225('0x1f')](APIHandleError(_0x261a44));};exports['removeTeams']=function(_0x33388d,_0x4a99fa){var _0x22c0c8=_0x33388d[_0xf225('0x52')]['id'];var _0x3f2115=null;if(_0x33388d[_0xf225('0x41')][_0xf225('0x61')]){_0x3f2115=_['isArray'](_0x33388d[_0xf225('0x41')][_0xf225('0x61')])?_0x33388d[_0xf225('0x41')][_0xf225('0x61')]:[_0x33388d[_0xf225('0x41')]['ids']];}var _0x2a682b=[];return Promise[_0xf225('0x100')]()['then'](function(){if(!_0x3f2115)throw new APIBadRequestError(_0xf225('0x11b'));})[_0xf225('0x15')](function(){return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x22c0c8}});})[_0xf225('0x15')](function(_0x19b9b4){if(!_0x19b9b4)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x33388d[_0xf225('0x52')]['id']));return db['sequelize'][_0xf225('0x113')](function(_0x20df35){return _0x19b9b4[_0xf225('0x11c')](_0x3f2115,{'transaction':_0x20df35})[_0xf225('0x15')](function(){return db['Team'][_0xf225('0x46')]({'where':{'id':{'$in':_0x3f2115}}});})[_0xf225('0x15')](function(_0x16a6bd){var _0x4b6d8a=_[_0xf225('0x30')](_0x16a6bd,function(_0x38bc2c){return _0x38bc2c['getAssociatedQueues']();});return Promise[_0xf225('0x5c')](_0x4b6d8a);})[_0xf225('0x15')](function(_0xa8289b){_0x2a682b=_[_0xf225('0x114')](_0xa8289b);var _0x141b9f=_[_0xf225('0x30')](_0x2a682b,function(_0x266aaf){return _0x266aaf[_0xf225('0x11d')](_0x19b9b4['id'],{'transaction':_0x20df35});});return Promise[_0xf225('0x5c')](_0x141b9f);})[_0xf225('0x15')](function(){if(!_0x19b9b4[_0xf225('0x9d')])return;var _0x5e50a5=_[_0xf225('0x2e')](_0x2a682b,function(_0x3ff979){return _0x3ff979['getDataValue']('channel')===_0xf225('0x117');});var _0x228824=_[_0xf225('0x30')](_0x5e50a5,function(_0x1b830a){return db[_0xf225('0xb0')][_0xf225('0x29')]({'where':{'VoiceQueueId':_0x1b830a['id'],'UserId':_0x19b9b4['id']},'transaction':_0x20df35});});return Promise[_0xf225('0x5c')](_0x228824);})[_0xf225('0x15')](function(){return db[_0xf225('0x118')][_0xf225('0x46')]({'where':{'teamId':{'$in':_0x3f2115}}});})['then'](function(_0x27ed9f){var _0x528575=_[_0xf225('0x30')](_0x27ed9f,function(_0x3a5cfa){return db['UserVoicePrefix'][_0xf225('0x29')]({'where':{'UserId':_0x19b9b4['id'],'VoicePrefixId':_0x3a5cfa[_0xf225('0x11a')]}},{'transaction':_0x20df35});});return Promise[_0xf225('0x5c')](_0x528575);});});})['then'](function(){for(var _0x55ea99=0x0;_0x55ea99<_0x2a682b[_0xf225('0x48')];_0x55ea99++){var _0x36e2d1=_0x2a682b[_0x55ea99][_0xf225('0x116')](_0xf225('0xb3'));var _0x2546f0=_0x36e2d1+_0xf225('0xa9');socket[_0xf225('0xaa')](_0xf225('0x7f')+_0x36e2d1+_0xf225('0x11e'),{'UserId':_0x22c0c8,['queueField']:_0x2a682b[_0x55ea99]['id']});}})[_0xf225('0x15')](respondWithStatusCode(_0x4a99fa,null))[_0xf225('0x1f')](APIHandleError(_0x4a99fa));};exports['getLists']=function(_0x24bf87,_0xd7cfdd){var _0x21217a={};var _0x552eab={};var _0x22651b;var _0x2b2f92;return db['User'][_0xf225('0x96')]({'where':{'id':_0x24bf87[_0xf225('0x52')]['id']}})['then'](handleEntityNotFound(_0xd7cfdd,null))[_0xf225('0x15')](function(_0x3a2022){if(_0x3a2022){_0x22651b=_0x3a2022;_0x552eab[_0xf225('0x53')]=_[_0xf225('0xcd')](db[_0xf225('0x11f')][_0xf225('0x3b')]);_0x552eab['query']=_[_0xf225('0xcd')](_0x24bf87[_0xf225('0x41')]);_0x552eab[_0xf225('0x55')]=_[_0xf225('0x56')](_0x552eab[_0xf225('0x53')],_0x552eab['query']);_0x21217a['attributes']=_[_0xf225('0x56')](_0x552eab[_0xf225('0x53')],qs[_0xf225('0x57')](_0x24bf87[_0xf225('0x41')][_0xf225('0x57')]));_0x21217a[_0xf225('0x45')]=_0x21217a[_0xf225('0x45')][_0xf225('0x48')]?_0x21217a[_0xf225('0x45')]:_0x552eab[_0xf225('0x53')];_0x21217a['order']=qs[_0xf225('0xd0')](_0x24bf87[_0xf225('0x41')]['sort']);_0x21217a[_0xf225('0x3f')]=qs[_0xf225('0x55')](_[_0xf225('0xd8')](_0x24bf87[_0xf225('0x41')],_0x552eab['filters']));if(_0x24bf87[_0xf225('0x41')][_0xf225('0x2e')]){_0x21217a[_0xf225('0x3f')]=_['merge'](_0x21217a[_0xf225('0x3f')],{'$or':_[_0xf225('0x30')](_0x21217a[_0xf225('0x45')],function(_0x1c6b2b){var _0x5069c7={};_0x5069c7[_0x1c6b2b]={'$like':'%'+_0x24bf87[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x5069c7;})});}_0x21217a=_[_0xf225('0x59')]({},_0x21217a,_0x24bf87[_0xf225('0x5a')]);return _0x22651b[_0xf225('0x120')](_0x21217a);}})[_0xf225('0x15')](function(_0x4b860c){if(_0x4b860c){_0x2b2f92=_0x4b860c[_0xf225('0x48')];if(!_0x24bf87[_0xf225('0x41')][_0xf225('0xd1')](_0xf225('0xd6'))){_0x21217a[_0xf225('0x26')]=qs[_0xf225('0x26')](_0x24bf87[_0xf225('0x41')][_0xf225('0x26')]);_0x21217a[_0xf225('0x23')]=qs['offset'](_0x24bf87[_0xf225('0x41')]['offset']);}return _0x22651b['getLists'](_0x21217a);}})[_0xf225('0x15')](function(_0x33f49d){if(_0x33f49d){return _0x33f49d?{'count':_0x2b2f92,'rows':_0x33f49d}:null;}})[_0xf225('0x15')](respondWithResult(_0xd7cfdd,null))[_0xf225('0x1f')](handleError(_0xd7cfdd,null));};exports['getAgents']=function(_0x5f30ca,_0x463de2){var _0x4764ef={};var _0x34adf6={};var _0x960030;return db[_0xf225('0x3a')][_0xf225('0x96')]({'where':{'id':_0x5f30ca[_0xf225('0x52')]['id']}})[_0xf225('0x15')](handleEntityNotFound(_0x463de2,null))[_0xf225('0x15')](function(_0x1795d6){if(_0x1795d6){_0x960030=_0x1795d6;_0x34adf6[_0xf225('0x53')]=_[_0xf225('0xcd')](db[_0xf225('0x3a')][_0xf225('0x3b')]);_0x34adf6['query']=_['keys'](_0x5f30ca[_0xf225('0x41')]);_0x34adf6[_0xf225('0x55')]=_[_0xf225('0x56')](_0x34adf6[_0xf225('0x53')],_0x34adf6['query']);_0x4764ef[_0xf225('0x45')]=_['intersection'](_0x34adf6['model'],qs['fields'](_0x5f30ca[_0xf225('0x41')][_0xf225('0x57')]));_0x4764ef[_0xf225('0x45')]=_0x4764ef['attributes'][_0xf225('0x48')]?_0x4764ef['attributes']:_0x34adf6[_0xf225('0x53')];_0x4764ef[_0xf225('0xcf')]=qs['sort'](_0x5f30ca['query'][_0xf225('0xd0')]);_0x4764ef['where']=qs['filters'](_[_0xf225('0xd8')](_0x5f30ca[_0xf225('0x41')],_0x34adf6[_0xf225('0x55')]));if(_0x5f30ca[_0xf225('0x41')]['filter']){_0x4764ef[_0xf225('0x3f')]=_[_0xf225('0x59')](_0x4764ef[_0xf225('0x3f')],{'$or':_['map'](_0x4764ef[_0xf225('0x45')],function(_0xec18e6){var _0x262527={};_0x262527[_0xec18e6]={'$like':'%'+_0x5f30ca[_0xf225('0x41')][_0xf225('0x2e')]+'%'};return _0x262527;})});}_0x4764ef[_0xf225('0x53')]=db[_0xf225('0x3a')];_0x4764ef['as']=_0xf225('0x2c');_0x4764ef=_[_0xf225('0x59')]({},_0x4764ef,_0x5f30ca[_0xf225('0x5a')]);return _0x960030[_0xf225('0x121')]({'include':[_0x4764ef]});}})[_0xf225('0x15')](function(_0x38881d){if(_0x38881d){var _0x54c9c1={},_0x1bdb9f=[];for(var _0x2e93ef=0x0;_0x2e93ef<_0x38881d['length'];_0x2e93ef+=0x1){for(var _0x74934c=0x0,_0x36d5a1;_0x74934c<_0x38881d[_0x2e93ef][_0xf225('0x2c')][_0xf225('0x48')];_0x74934c+=0x1){_0x36d5a1=_0x38881d[_0x2e93ef][_0xf225('0x2c')][_0x74934c][_0xf225('0xae')]({'plain':!![]});_0x54c9c1[_0x36d5a1['id']]=_0x36d5a1;}}_0x54c9c1=_['values'](_0x54c9c1);for(var _0x29e31d=qs['offset'](_0x5f30ca[_0xf225('0x41')][_0xf225('0x23')]);_0x29e31d<_0x54c9c1['length']&&_0x1bdb9f['length']=_0x5c90f2){_0x335ac8=_0x5c90f2;_0x281500=0xc8;}else{_0x281500=0xce;}_0x4dbb7f[_0x7739('0x21')](_0x281500);return _0x4dbb7f[_0x7739('0x27')]('Content-Range',_0x5bf4f6+'-'+_0x335ac8+'/'+_0x5c90f2)[_0x7739('0x28')](_0x3af5a5);}return null;};}function saveUpdates(_0x559262){return function(_0x2ca850){if(_0x2ca850){return _0x2ca850[_0x7739('0x29')](_0x559262)[_0x7739('0x2a')](function(_0x37633a){socket[_0x7739('0x2b')]('userNotification:recalc:'+_0x37633a['id'],{});return _0x37633a;});}return null;};}function removeEntity(_0x3c2369){return function(_0x496669){if(_0x496669){return _0x496669[_0x7739('0x2c')]()[_0x7739('0x2a')](function(){var _0x3e21a7=_0x496669[_0x7739('0x2d')]({'plain':!![]});if(_0x3e21a7[_0x7739('0x2e')]===_0x7739('0x2f'))return;var _0x4d6e00=[{'name':_0x7739('0x30'),'value':_0x7739('0x31'),'ignore':!![]},{'name':_0x7739('0x32'),'value':'agent','ignore':![]},{'name':_0x7739('0x33'),'value':_0x7739('0x34'),'ignore':![]}];var _0xede803=_(_0x4d6e00)['filter']('ignore')[_0x7739('0x35')]('value')[_0x7739('0x36')]();if(_['includes'](_0xede803,_0x3e21a7[_0x7739('0x2e')])){return;}var _0x1c540e=_['find'](_0x4d6e00,[_0x7739('0x36'),_0x3e21a7[_0x7739('0x2e')]])['name'];return db[_0x7739('0x37')]['destroy']({'where':{'type':_0x1c540e,'resourceId':_0x3e21a7['id']}})[_0x7739('0x2a')](function(){return _0x496669;});})[_0x7739('0x2a')](function(){_0x3c2369[_0x7739('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x75259a){return function(_0x1f898e){if(!_0x1f898e){_0x75259a[_0x7739('0x20')](0x194);}return _0x1f898e;};}function handleError(_0x5aefd9,_0x358f87){_0x358f87=_0x358f87||0x1f4;return function(_0x18f275){logger[_0x7739('0x1b')](_0x18f275['stack']);if(_0x18f275[_0x7739('0x38')]){delete _0x18f275['name'];}_0x5aefd9[_0x7739('0x21')](_0x358f87)[_0x7739('0x39')](_0x18f275);};}exports['index']=function(_0x16c24f,_0xcb787){var _0x5676a6={},_0x15b488={'count':0x0,'rows':[]};var _0x507d0e=_(db[_0x7739('0x3a')]['rawAttributes'])[_0x7739('0x35')](function(_0x30ec5d){return{'name':_0x30ec5d[_0x7739('0x3b')],'type':_0x30ec5d[_0x7739('0x3c')]['key']};})[_0x7739('0x3d')](function(_0x3d60af){return!_[_0x7739('0x3e')]([_0x7739('0x3f'),_0x7739('0x40')],_0x3d60af[_0x7739('0x38')]);})['value']();_0x5676a6=qs[_0x7739('0x41')](_0x507d0e,_0x16c24f);var _0x261c9e={'where':_0x5676a6['where']};return db[_0x7739('0x3a')][_0x7739('0x26')](_0x261c9e)[_0x7739('0x2a')](function(_0x12984b){_0x15b488[_0x7739('0x26')]=_0x12984b;if(_0x16c24f[_0x7739('0x42')]['includeAll']){_0x5676a6['include']=[{'all':!![]}];}if(_0x16c24f[_0x7739('0x42')][_0x7739('0x43')]===_0x7739('0x44')){_0x5676a6[_0x7739('0x45')]=[{'model':db[_0x7739('0x46')],'as':'userSetting'}];}if(!_[_0x7739('0x3e')](_0x5676a6[_0x7739('0x47')],'id')){_0x5676a6[_0x7739('0x47')][_0x7739('0x48')]('id');}return db[_0x7739('0x3a')]['findAll'](_0x5676a6);})[_0x7739('0x2a')](function(_0x622bd8){_0x15b488[_0x7739('0x49')]=_0x622bd8;if(_0x16c24f[_0x7739('0x42')][_0x7739('0x4a')]===_0x7739('0x44')){var _0x6d4ce7=[];for(var _0x2d86e5=0x0;_0x2d86e5<_0x15b488['rows'][_0x7739('0x4b')];_0x2d86e5++){_0x6d4ce7[_0x7739('0x48')](get_open_tabs(_0x7739('0x4c'),_0x15b488[_0x7739('0x49')][_0x2d86e5]['dataValues']));_0x6d4ce7[_0x7739('0x48')](get_open_tabs('sms',_0x15b488[_0x7739('0x49')][_0x2d86e5][_0x7739('0x4d')]));_0x6d4ce7['push'](get_open_tabs(_0x7739('0x4e'),_0x15b488[_0x7739('0x49')][_0x2d86e5][_0x7739('0x4d')]));_0x6d4ce7[_0x7739('0x48')](get_open_tabs('mail',_0x15b488[_0x7739('0x49')][_0x2d86e5][_0x7739('0x4d')]));_0x6d4ce7['push'](get_open_tabs(_0x7739('0x4f'),_0x15b488['rows'][_0x2d86e5]['dataValues']));_0x6d4ce7[_0x7739('0x48')](get_open_tabs(_0x7739('0x50'),_0x15b488[_0x7739('0x49')][_0x2d86e5][_0x7739('0x4d')]));}return Promise[_0x7739('0x51')](_0x6d4ce7)[_0x7739('0x2a')](function(){return _0x15b488;});}else{return _0x15b488;}})[_0x7739('0x2a')](respondWithFilteredResult(_0xcb787,_0x5676a6))['catch'](handleError(_0xcb787,null));};exports[_0x7739('0x52')]=function(_0x4b4b32,_0x56498f){var _0x1f5521={'raw':![],'where':{'id':_0x4b4b32[_0x7739('0x53')]['id']}},_0x1288e8={};_0x1288e8[_0x7739('0x54')]=_[_0x7739('0x55')](_['keys'](db[_0x7739('0x3a')][_0x7739('0x56')]),[_0x7739('0x3f'),_0x7739('0x40')]);_0x1288e8[_0x7739('0x42')]=_['keys'](_0x4b4b32[_0x7739('0x42')]);_0x1288e8[_0x7739('0x57')]=_[_0x7739('0x58')](_0x1288e8['model'],_0x1288e8['query']);_0x1f5521['attributes']=_[_0x7739('0x58')](_0x1288e8[_0x7739('0x54')],qs[_0x7739('0x59')](_0x4b4b32['query'][_0x7739('0x59')]));_0x1f5521[_0x7739('0x47')]=_0x1f5521[_0x7739('0x47')][_0x7739('0x4b')]?_0x1f5521[_0x7739('0x47')]:_0x1288e8['model'];if(_0x4b4b32[_0x7739('0x42')][_0x7739('0x5a')]){_0x1f5521[_0x7739('0x45')]=[{'all':!![]}];}if(_0x4b4b32['query'][_0x7739('0x43')]===_0x7739('0x44')){_0x1f5521[_0x7739('0x45')]=[{'model':db[_0x7739('0x46')],'as':_0x7739('0x43')}];}_0x1f5521=_[_0x7739('0x5b')]({},_0x1f5521,_0x4b4b32[_0x7739('0x5c')]);if(!_['includes'](_0x1f5521[_0x7739('0x47')],'id')){_0x1f5521['attributes'][_0x7739('0x48')]('id');}return db['User'][_0x7739('0x5d')](_0x1f5521)['then'](handleEntityNotFound(_0x56498f,null))[_0x7739('0x2a')](function(_0xdf4168){var _0x14252a=[];values=_0xdf4168;if(_0x4b4b32[_0x7739('0x42')]['openTabs']===_0x7739('0x44')){_0x14252a[_0x7739('0x48')](get_open_tabs(_0x7739('0x4c'),_0xdf4168[_0x7739('0x4d')]));_0x14252a['push'](get_open_tabs(_0x7739('0x5e'),_0xdf4168[_0x7739('0x4d')]));_0x14252a['push'](get_open_tabs(_0x7739('0x4f'),_0xdf4168[_0x7739('0x4d')]));_0x14252a[_0x7739('0x48')](get_open_tabs(_0x7739('0x50'),_0xdf4168[_0x7739('0x4d')]));_0x14252a[_0x7739('0x48')](get_open_tabs(_0x7739('0x4e'),_0xdf4168[_0x7739('0x4d')]));_0x14252a[_0x7739('0x48')](get_open_tabs(_0x7739('0x5f'),_0xdf4168[_0x7739('0x4d')]));return Promise['all'](_0x14252a);}else{return values;}})[_0x7739('0x2a')](function(){return values;})[_0x7739('0x2a')](respondWithResult(_0x56498f,null))[_0x7739('0x1f')](handleError(_0x56498f,null));};exports['update']=function(_0x1428cd,_0x5531d9){if(_0x1428cd[_0x7739('0x60')]['id']){delete _0x1428cd['body']['id'];}delete _0x1428cd[_0x7739('0x60')][_0x7739('0x2e')];return db['User'][_0x7739('0x5d')]({'where':{'id':_0x1428cd[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x5531d9,null))[_0x7739('0x2a')](saveUpdates(_0x1428cd[_0x7739('0x60')],null))['then'](respondWithResult(_0x5531d9,null))[_0x7739('0x1f')](handleError(_0x5531d9,null));};exports[_0x7739('0x61')]=function(_0x394e47,_0x3910f8){return db[_0x7739('0x3a')][_0x7739('0x61')]()['then'](respondWithResult(_0x3910f8,null))['catch'](handleError(_0x3910f8,null));};exports[_0x7739('0x62')]=function(_0x4bf960,_0xc75037){return db[_0x7739('0x3a')][_0x7739('0x5d')]({'where':{'id':_0x4bf960[_0x7739('0x53')]['id']}})['then'](handleEntityNotFound(_0xc75037,null))[_0x7739('0x2a')](function(_0x64bc1a){if(_0x64bc1a){return _0x64bc1a[_0x7739('0x62')](_0x4bf960[_0x7739('0x60')]['ids'],_[_0x7739('0x63')](_0x4bf960[_0x7739('0x60')],['ids','id'])||{});}})[_0x7739('0x2a')](respondWithResult(_0xc75037,null))[_0x7739('0x1f')](handleError(_0xc75037,null));};function validateUser(_0x5861b1){return new Promise(function(_0x2d459b,_0x1d51f2){if(_0x5861b1[_0x7739('0x64')])return _0x2d459b(_0x5861b1);return db[_0x7739('0x65')][_0x7739('0x66')](0x1)[_0x7739('0x2a')](function(_0x522dfd){if(_0x522dfd[_0x7739('0x67')])authService[_0x7739('0x68')](_0x5861b1[_0x7739('0x3f')]);db[_0x7739('0x3a')][_0x7739('0x69')](_0x7739('0x64'))[_0x7739('0x2a')](function(_0x4b447f){if(_[_0x7739('0x6a')](_0x4b447f)){_0x5861b1['internal']=_0x522dfd[_0x7739('0x6b')]||0x1;return;}if(_[_0x7739('0x6a')](_0x522dfd[_0x7739('0x6b')])||_0x522dfd[_0x7739('0x6b')]===_0x4b447f){_0x5861b1[_0x7739('0x64')]=_0x4b447f+0x1;return;}if(_0x522dfd[_0x7739('0x6b')]>_0x4b447f){_0x5861b1['internal']=_0x522dfd[_0x7739('0x6b')];return;}return db['sequelize'][_0x7739('0x42')](_0x7739('0x6c'),{'type':db['sequelize'][_0x7739('0x6d')]['SELECT']})[_0x7739('0x2a')](function(_0x74afd3){if(_0x74afd3&&_0x74afd3[_0x7739('0x4b')]){for(var _0x19250c=0x0,_0x3a7f2a=_0x74afd3[_0x7739('0x4b')];_0x19250c<_0x3a7f2a&&_[_0x7739('0x6a')](_0x5861b1[_0x7739('0x64')]);_0x19250c++){if(_0x522dfd[_0x7739('0x6b')]<=_0x74afd3[_0x19250c][_0x7739('0x6e')]){_0x5861b1[_0x7739('0x64')]=_0x74afd3[_0x19250c][_0x7739('0x6e')];}else if(_0x522dfd[_0x7739('0x6b')]>_0x74afd3[_0x19250c][_0x7739('0x6e')]&&_0x522dfd[_0x7739('0x6b')]<=_0x74afd3[_0x19250c]['to']){_0x5861b1[_0x7739('0x64')]=_0x522dfd[_0x7739('0x6b')];}}}if(_[_0x7739('0x6a')](_0x5861b1[_0x7739('0x64')])){_0x5861b1[_0x7739('0x64')]=_0x4b447f+0x1;}return _0x2d459b(_0x5861b1);});});})['catch'](function(_0x57522a){_0x1d51f2(_0x57522a);});});}function updateUser(_0x5e7b2f){return new Promise(function(_0x206430,_0x203232){try{if(_0x5e7b2f[_0x7739('0x6f')]){_0x5e7b2f[_0x7739('0x70')]=_0x5e7b2f[_0x7739('0x64')];_0x5e7b2f[_0x7739('0x71')]={'mailbox':_0x5e7b2f['internal'],'password':_0x5e7b2f['password'],'fullname':_0x5e7b2f['fullname'],'email':_0x5e7b2f[_0x7739('0x72')]};}if(_0x5e7b2f[_0x7739('0x2e')]===_0x7739('0x73')){if(!_0x5e7b2f[_0x7739('0x74')])_0x5e7b2f['permissions']=[_0x7739('0x75'),_0x7739('0x76'),'103','113',_0x7739('0x77'),_0x7739('0x78'),_0x7739('0x79'),'106',_0x7739('0x7a'),_0x7739('0x7b'),_0x7739('0x7c'),_0x7739('0x7d'),_0x7739('0x7e'),_0x7739('0x7f'),_0x7739('0x80')];}_0x206430(_0x5e7b2f);}catch(_0xc70e5f){_0x203232(_0xc70e5f);}});}exports['create']=function(_0x243137,_0x5052f8){if(_0x243137[_0x7739('0x31')][_0x7739('0x2e')]===_0x7739('0x73'))throw new Error(_0x7739('0x81'));if(_0x243137[_0x7739('0x60')][_0x7739('0x2e')]===_0x7739('0x31')&&_0x243137[_0x7739('0x31')][_0x7739('0x2e')]!==_0x7739('0x2f')){throw new Error(_0x7739('0x82'));}if(_0x243137[_0x7739('0x60')]['role']===_0x7739('0x2f')&&_0x243137[_0x7739('0x31')][_0x7739('0x2e')]!==_0x7739('0x2f')){throw new Error(_0x7739('0x83'));}return licenseUtil['checkUserLimits']([_0x243137['body']])[_0x7739('0x2a')](function(){return validateUser(_0x243137['body']);})[_0x7739('0x2a')](function(_0x2f970a){return updateUser(_0x2f970a)[_0x7739('0x2a')](function(_0x183807){if(_0x183807[_0x7739('0x2e')]===_0x7739('0x2f')){_0x183807[_0x7739('0x84')]=_0x243137[_0x7739('0x31')][_0x7739('0x84')];delete _0x183807[_0x7739('0x85')];}return _0x183807;});})[_0x7739('0x2a')](function(_0x56a92a){return db['User']['create'](_0x56a92a,{'include':[{'model':db[_0x7739('0x71')],'as':_0x7739('0x71')}]});})['then'](function(_0x4303d7){if(_0x243137[_0x7739('0x60')]['role']==='user')return _0x4303d7;if(_0x243137[_0x7739('0x31')][_0x7739('0x2e')]!=='user')return _0x4303d7;return db[_0x7739('0x86')]['find']({'where':{'name':_0x4303d7[_0x7739('0x2e')]==='agent'?_0x7739('0x32'):_0x7739('0x33'),'userProfileId':_0x243137['user'][_0x7739('0x85')]},'raw':!![]})['then'](function(_0x4216cb){if(!_0x4216cb||_0x4216cb[_0x7739('0x87')]!=0x0)return _0x4303d7;return db[_0x7739('0x37')][_0x7739('0x88')]({'name':_0x4303d7[_0x7739('0x38')],'resourceId':_0x4303d7['id'],'type':_0x4216cb[_0x7739('0x38')],'sectionId':_0x4216cb['id']},{})[_0x7739('0x2a')](function(){return _0x4303d7;});})[_0x7739('0x1f')](function(_0x1bb50a){logger['error'](_0x7739('0x89'),_0x1bb50a);throw _0x1bb50a;});})[_0x7739('0x2a')](respondWithResult(_0x5052f8,0xc9))[_0x7739('0x1f')](handleError(_0x5052f8,null));};exports['bulkCreate']=function(_0x2886f1,_0x4282f5){var _0x191fe9=_0x2886f1[_0x7739('0x60')];var _0x283fba=[];if(_0x2886f1['user']['role']===_0x7739('0x73'))throw new Error(_0x7739('0x81'));if(_['some'](_0x191fe9,[_0x7739('0x2e'),_0x7739('0x31')])&&_0x2886f1[_0x7739('0x31')]['role']!=='admin'){throw new Error(_0x7739('0x82'));}if(_[_0x7739('0x8a')](_0x191fe9,[_0x7739('0x2e'),_0x7739('0x2f')])&&_0x2886f1[_0x7739('0x31')][_0x7739('0x2e')]!==_0x7739('0x2f')){throw new Error(_0x7739('0x8b'));}return licenseUtil[_0x7739('0x8c')](_0x191fe9)[_0x7739('0x2a')](function(){return validateUser(_0x191fe9[0x0]);})[_0x7739('0x2a')](function(){for(var _0x3857ba=0x1;_0x3857ba<_0x191fe9['length'];_0x3857ba++){var _0x333103=_0x191fe9[_0x3857ba-0x1][_0x7739('0x64')];if(!_0x191fe9[_0x3857ba]['internal'])_0x191fe9[_0x3857ba][_0x7739('0x64')]=_0x333103+0x1;_0x283fba[_0x7739('0x48')](validateUser(_0x191fe9[_0x3857ba]));}return Promise[_0x7739('0x51')](_0x283fba);})[_0x7739('0x2a')](function(){_0x283fba=[];for(var _0x1229ca=0x0;_0x1229ca<_0x191fe9[_0x7739('0x4b')];_0x1229ca++){_0x283fba[_0x7739('0x48')](updateUser(_0x191fe9[_0x1229ca]));}return Promise[_0x7739('0x51')](_0x283fba);})['then'](function(){_0x283fba=_0x191fe9['map'](function(_0x5f0627){return db[_0x7739('0x3a')][_0x7739('0x88')](_0x5f0627,{'include':[{'model':db[_0x7739('0x71')],'as':_0x7739('0x71')}]})[_0x7739('0x2a')](function(_0x102d4e){_0x5f0627['id']=_0x102d4e['id'];return _0x5f0627;});});return Promise[_0x7739('0x51')](_0x283fba);})[_0x7739('0x2a')](function(_0x47efcd){if(_0x2886f1[_0x7739('0x60')][_0x7739('0x2e')]===_0x7739('0x31'))return _0x47efcd;if(_0x2886f1[_0x7739('0x31')]['role']!==_0x7739('0x31'))return _0x47efcd;var _0x56df7e=_['some'](_0x47efcd,function(_0x1a3aae){return _0x1a3aae[_0x7739('0x2e')]==='agent'||_0x1a3aae[_0x7739('0x2e')]===_0x7739('0x34');});if(!_0x56df7e)return _0x47efcd;return db[_0x7739('0x86')][_0x7739('0x8d')]({'where':{'name':{'$or':[_0x7739('0x32'),_0x7739('0x33')]},'userProfileId':_0x2886f1[_0x7739('0x31')][_0x7739('0x85')]},'raw':!![]})[_0x7739('0x2a')](function(_0x153dbe){if(_[_0x7739('0x8e')](_0x153dbe)||!_[_0x7739('0x8a')](_0x153dbe,['autoAssociation',0x0]))return _0x47efcd;_0x283fba=[];var _0x516217=_(_0x153dbe)[_0x7739('0x35')](function(_0x5731c8){if(_0x5731c8['autoAssociation']===0x1)return;return _0x5731c8[_0x7739('0x38')]===_0x7739('0x32')?_0x7739('0x73'):_0x7739('0x34');})['compact']()['value']();for(var _0x195ac7=0x0;_0x195ac7<_0x47efcd[_0x7739('0x4b')];_0x195ac7++){if(!_[_0x7739('0x3e')](_0x516217,_0x47efcd[_0x195ac7]['role']))return;var _0x10d2b7=_0x47efcd[_0x195ac7][_0x7739('0x2e')]===_0x7739('0x73')?'Agents':_0x7739('0x33');_0x283fba[_0x7739('0x48')](db[_0x7739('0x37')][_0x7739('0x88')]({'name':_0x47efcd[_0x195ac7][_0x7739('0x38')],'resourceId':_0x47efcd[_0x195ac7]['id'],'type':_0x10d2b7,'sectionId':_[_0x7739('0x5d')](_0x153dbe,[_0x7739('0x38'),_0x10d2b7])['id']},{}));}return Promise[_0x7739('0x51')](_0x283fba);});})[_0x7739('0x2a')](respondWithResult(_0x4282f5,0xc9))[_0x7739('0x1f')](handleError(_0x4282f5,null));};exports[_0x7739('0x8f')]=function(_0x360d2c,_0x5609cc){if(_0x360d2c['body']['id']){delete _0x360d2c[_0x7739('0x60')]['id'];}return db[_0x7739('0x3a')][_0x7739('0x5d')]({'where':{'id':_0x360d2c[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](function(_0x3743e7){if(!_0x3743e7)return null;if(_0x3743e7['id']===_0x360d2c[_0x7739('0x31')]['id']){if(!_0x360d2c[_0x7739('0x60')][_0x7739('0x90')]||!_0x360d2c[_0x7739('0x60')][_0x7739('0x91')]){throw new db[(_0x7739('0x92'))]['ValidationError'](_0x7739('0x93'));}if(!_0x3743e7[_0x7739('0x94')](_0x360d2c[_0x7739('0x60')][_0x7739('0x90')])){throw new db[(_0x7739('0x92'))][(_0x7739('0x95'))](_0x7739('0x96'));}if(_0x360d2c[_0x7739('0x60')]['oldPassword']===_0x360d2c[_0x7739('0x60')]['newPassword']){throw new db[(_0x7739('0x92'))][(_0x7739('0x95'))](_0x7739('0x97'));}}else if(_0x360d2c[_0x7739('0x31')][_0x7739('0x2e')]==='admin'){if(!_0x360d2c[_0x7739('0x60')][_0x7739('0x91')]){throw new db['Sequelize'][(_0x7739('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x360d2c[_0x7739('0x31')][_0x7739('0x2e')]===_0x7739('0x31')){if(!_0x360d2c['body'][_0x7739('0x91')]){throw new db[(_0x7739('0x92'))][(_0x7739('0x95'))](_0x7739('0x98'));}if(_0x3743e7['role']!==_0x7739('0x73')){throw new db[(_0x7739('0x92'))][(_0x7739('0x95'))](_0x7739('0x81'));}}else{throw new db[(_0x7739('0x92'))]['ValidationError'](_0x7739('0x81'));}return _0x3743e7;})[_0x7739('0x2a')](handleEntityNotFound(_0x5609cc,null))[_0x7739('0x2a')](function(_0x3bb22b){return db[_0x7739('0x65')][_0x7739('0x99')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x7739('0x2a')](function(_0x34fc21){if(_0x34fc21[_0x7739('0x67')])authService[_0x7739('0x68')](_0x360d2c['body'][_0x7739('0x91')]);if(!_0x34fc21[_0x7739('0x9a')]||!_0x3bb22b[_0x7739('0x9b')])return _0x3bb22b;authService[_0x7739('0x9c')](_0x360d2c[_0x7739('0x60')][_0x7739('0x91')],_0x3bb22b[_0x7739('0x9b')],_0x34fc21['passwordHistoryLimit']);return _0x3bb22b;})[_0x7739('0x2a')](saveUpdates({'password':_0x360d2c['body']['newPassword'],'passwordResetAt':_0x360d2c[_0x7739('0x31')]['id']==_0x360d2c[_0x7739('0x53')]['id']?moment():null,'previousPasswords':authService[_0x7739('0x9d')](_0x360d2c['body'][_0x7739('0x91')],_0x3bb22b[_0x7739('0x9b')])},null));})[_0x7739('0x2a')](respondWithResult(_0x5609cc,null))[_0x7739('0x1f')](handleError(_0x5609cc,null));};exports['addQueues']=function(_0x125c73,_0x4d5367){var _0x10db75=_0x125c73[_0x7739('0x60')]['channel'];return db['User'][_0x7739('0x5d')]({'where':{'id':_0x125c73['params']['id']},'attributes':['id','name',_0x7739('0x2e'),_0x7739('0x9e'),_0x7739('0x9f'),'voicePause',_0x7739('0xa0')]})[_0x7739('0x2a')](handleEntityNotFound(_0x4d5367,null))['then'](function(_0x3a4a1a){if(_0x3a4a1a){if(!utils[_0x7739('0xa1')](_0x10db75)){throw new db[(_0x7739('0x92'))][(_0x7739('0x95'))]('Unknown\x20channel');}return _0x3a4a1a['add'+_[_0x7739('0xa2')](_0x10db75[_0x7739('0xa3')]())+_0x7739('0xa4')](_0x125c73[_0x7739('0x60')][_0x7739('0xa5')],{'penalty':_0x125c73[_0x7739('0x60')][_0x7739('0xa6')]||0x0})[_0x7739('0xa7')](function(_0x27b831){for(var _0x15c9ad=0x0;_0x15c9ad<_0x125c73['body'][_0x7739('0xa5')][_0x7739('0x4b')];_0x15c9ad+=0x1){var _0x32a699={'UserId':Number(_0x125c73['params']['id'])};_0x32a699[_[_0x7739('0xa2')](_0x10db75[_0x7739('0xa3')]())+_0x7739('0xa8')]=Number(_0x125c73[_0x7739('0x60')][_0x7739('0xa5')][_0x15c9ad]);socket[_0x7739('0x2b')]('user'+_[_0x7739('0xa2')](_0x10db75['toLowerCase']())+_0x7739('0xa9'),_0x32a699);}return _0x27b831;})[_0x7739('0x2a')](function(){if(_0x10db75===_0x7739('0xaa')){return db[_0x7739('0xab')][_0x7739('0x8d')]({'where':{'id':_0x125c73['body'][_0x7739('0xa5')]||[]},'raw':!![],'attributes':['id',_0x7739('0x38')]});}})[_0x7739('0x2a')](function(_0x4b78c9){var _0x3e919c=_0x3a4a1a[_0x7739('0x2d')]({'plain':!![]});var _0x2a003d=[];if(_0x10db75===_0x7739('0xaa')&&_0x3e919c['role']===_0x7739('0x73')&&_0x3e919c[_0x7739('0x9e')]){for(let _0x297db7=0x0;_0x297db7<_0x4b78c9['length'];_0x297db7+=0x1){_0x2a003d[_0x7739('0x48')]({'membername':_0x3e919c[_0x7739('0x38')],'UserId':_0x3e919c['id'],'queue_name':_0x4b78c9[_0x297db7][_0x7739('0x38')],'VoiceQueueId':_0x4b78c9[_0x297db7]['id'],'interface':_[_0x7739('0x6a')](_0x3e919c[_0x7739('0xa0')])?util[_0x7739('0xac')]('SIP/%s',_0x3e919c[_0x7739('0x38')]):_0x3e919c[_0x7739('0xa0')],'paused':_0x3e919c['voicePause']||![],'penalty':_0x125c73['body'][_0x7739('0xa6')]||0x0});}return Promise[_0x7739('0x51')](_0x2a003d['map'](function(_0x17183f){return db[_0x7739('0xad')][_0x7739('0xae')](_0x17183f);}));}return _0x3a4a1a;});}})['then'](respondWithStatusCode(_0x4d5367,null))[_0x7739('0x1f')](handleError(_0x4d5367,null));};exports[_0x7739('0xaf')]=function(_0xf8a9ef,_0x24b690){var _0x6aaa71,_0xb6e90a;return db[_0x7739('0x3a')][_0x7739('0x5d')]({'where':{'id':_0xf8a9ef['params']['id']},'attributes':['id',_0x7739('0x38'),_0x7739('0x2e')]})[_0x7739('0x2a')](handleEntityNotFound(_0x24b690,null))[_0x7739('0x2a')](function(_0x3c67){if(_0x3c67){_0x6aaa71=_0x3c67;if(!_0xf8a9ef[_0x7739('0x42')][_0x7739('0xb0')]||!utils[_0x7739('0xa1')](_0xf8a9ef['query'][_0x7739('0xb0')])){throw new db[(_0x7739('0x92'))][(_0x7739('0x95'))](_0x7739('0xb1'));}return _0x3c67[_0x7739('0xb2')+_[_0x7739('0xa2')](_0xf8a9ef[_0x7739('0x42')][_0x7739('0xb0')][_0x7739('0xa3')]())+'Queues'](_0xf8a9ef[_0x7739('0x42')][_0x7739('0xa5')]);}})[_0x7739('0x2a')](function(_0x5bfd5d){if(_[_0x7739('0xb3')](_0xf8a9ef[_0x7739('0x42')][_0x7739('0xa5')])){for(var _0x49d9a7=0x0;_0x49d9a7<_0xf8a9ef[_0x7739('0x42')]['ids'][_0x7739('0x4b')];_0x49d9a7+=0x1){_0xb6e90a={'UserId':Number(_0xf8a9ef[_0x7739('0x53')]['id'])};_0xb6e90a[_[_0x7739('0xa2')](_0xf8a9ef[_0x7739('0x42')][_0x7739('0xb0')][_0x7739('0xa3')]())+_0x7739('0xa8')]=Number(_0xf8a9ef[_0x7739('0x42')]['ids'][_0x49d9a7]);socket['emit']('user'+_[_0x7739('0xa2')](_0xf8a9ef[_0x7739('0x42')][_0x7739('0xb0')][_0x7739('0xa3')]())+_0x7739('0xb4'),_0xb6e90a);}}else{_0xb6e90a={'UserId':Number(_0xf8a9ef[_0x7739('0x53')]['id'])};_0xb6e90a[_[_0x7739('0xa2')](_0xf8a9ef[_0x7739('0x42')]['channel'][_0x7739('0xa3')]())+'QueueId']=Number(_0xf8a9ef['query'][_0x7739('0xa5')]);socket[_0x7739('0x2b')](_0x7739('0x31')+_[_0x7739('0xa2')](_0xf8a9ef[_0x7739('0x42')][_0x7739('0xb0')]['toLowerCase']())+_0x7739('0xb4'),_0xb6e90a);}return _0x5bfd5d;})[_0x7739('0x2a')](function(){if(_0xf8a9ef[_0x7739('0x42')]['channel']===_0x7739('0xaa')){return db[_0x7739('0xad')]['destroy']({'where':{'UserId':_0xf8a9ef['params']['id'],'VoiceQueueId':_0xf8a9ef['query']['ids']},'individualHooks':!![]})['then'](function(){return _0x6aaa71;});}return _0x6aaa71;})[_0x7739('0x2a')](respondWithStatusCode(_0x24b690,null))[_0x7739('0x1f')](handleError(_0x24b690,null));};exports[_0x7739('0xb5')]=function(_0x31a725,_0x569eaa){_0x31a725[_0x7739('0x60')][_0x7739('0xb6')]=_0x31a725[_0x7739('0xb7')][_0x7739('0xb8')];return db[_0x7739('0x3a')][_0x7739('0x5d')]({'where':{'id':_0x31a725[_0x7739('0x53')]['id']}})['then'](handleEntityNotFound(_0x569eaa,null))[_0x7739('0x2a')](saveUpdates(_0x31a725[_0x7739('0x60')],null))[_0x7739('0x2a')](respondWithResult(_0x569eaa,null))[_0x7739('0x1f')](handleError(_0x569eaa,null));};exports[_0x7739('0xb9')]=function(_0xd22859,_0x553cd9){var _0xeadbff=path[_0x7739('0xba')](config[_0x7739('0xbb')],_0x7739('0xbc'));return db[_0x7739('0x3a')][_0x7739('0x5d')]({'where':{'id':_0xd22859[_0x7739('0x53')]['id']},'attributes':['id',_0x7739('0xb6')],'raw':!![]})['then'](handleEntityNotFound(_0x553cd9,null))[_0x7739('0x2a')](function(_0x1dd50e){if(_0x1dd50e){if(_[_0x7739('0x6a')](_0x1dd50e[_0x7739('0xb6')])){return _0x553cd9[_0x7739('0xbd')](_0xeadbff);}else{if(!fs[_0x7739('0xbe')](path[_0x7739('0xba')](config[_0x7739('0xbb')],_0x7739('0xbf'),_0x1dd50e[_0x7739('0xb6')]))){return _0x553cd9['download'](_0xeadbff);}return _0x553cd9[_0x7739('0xbd')](path[_0x7739('0xba')](config['root'],'server/files/images/',_0x1dd50e[_0x7739('0xb6')]));}}})[_0x7739('0x1f')](handleError(_0x553cd9,null));};exports['getOpenTabs']=function(_0x307d75,_0x382dd8){return db['User']['find']({'where':{'id':_0x307d75['params']['id']},'attributes':['id']})[_0x7739('0x2a')](handleEntityNotFound(_0x382dd8,null))[_0x7739('0x2a')](function(_0x46b34d){var _0x3e6ba4=[];values=_0x46b34d[_0x7739('0x4d')];_0x3e6ba4['push'](get_open_tabs(_0x7739('0x4c'),_0x46b34d[_0x7739('0x4d')]));_0x3e6ba4['push'](get_open_tabs(_0x7739('0x5e'),_0x46b34d[_0x7739('0x4d')]));_0x3e6ba4['push'](get_open_tabs(_0x7739('0x4f'),_0x46b34d[_0x7739('0x4d')]));_0x3e6ba4[_0x7739('0x48')](get_open_tabs('whatsapp',_0x46b34d[_0x7739('0x4d')]));_0x3e6ba4[_0x7739('0x48')](get_open_tabs('fax',_0x46b34d[_0x7739('0x4d')]));_0x3e6ba4[_0x7739('0x48')](get_open_tabs(_0x7739('0x5f'),_0x46b34d['dataValues']));return Promise[_0x7739('0x51')](_0x3e6ba4);})[_0x7739('0x2a')](function(_0x35104b){if(_0x35104b){var _0x2ccd93=_[_0x7739('0x35')](values[_0x7739('0xc0')],function(_0x10a768){return{'channel':'CHAT','id':_0x10a768['id'],'createdAt':_0x10a768[_0x7739('0xc1')]};});var _0x20c386=_[_0x7739('0x35')](values[_0x7739('0xc2')],function(_0x43d273){return{'channel':_0x7739('0xc3'),'id':_0x43d273['id'],'createdAt':_0x43d273[_0x7739('0xc1')]};});var _0x3cc130=_[_0x7739('0x35')](values[_0x7739('0xc4')],function(_0x4611a6){return{'channel':_0x7739('0xc5'),'id':_0x4611a6['id'],'createdAt':_0x4611a6['createdAt']};});var _0x3b1787=_[_0x7739('0x35')](values[_0x7739('0xc6')],function(_0x2ccc96){return{'channel':_0x7739('0xc7'),'id':_0x2ccc96['id'],'createdAt':_0x2ccc96['createdAt']};});var _0x49d72d=_['map'](values[_0x7739('0xc8')],function(_0x3405b7){return{'channel':_0x7739('0xc9'),'id':_0x3405b7['id'],'createdAt':_0x3405b7[_0x7739('0xc1')]};});var _0x24e6cf=_[_0x7739('0x35')](values['WhatsappOpenTabs'],function(_0x1c1d1e){return{'channel':_0x7739('0xca'),'id':_0x1c1d1e['id'],'createdAt':_0x1c1d1e[_0x7739('0xc1')]};});var _0x2f9f64=_[_0x7739('0xcb')](_0x2ccd93,_0x20c386,_0x3cc130,_0x3b1787,_0x49d72d,_0x24e6cf);var _0x5d82bc={'count':_0x2f9f64[_0x7739('0x4b')],'rows':_0x2f9f64};return _0x5d82bc;}else return null;})[_0x7739('0x2a')](respondWithResult(_0x382dd8,null))[_0x7739('0x1f')](handleError(_0x382dd8,null));};exports['getContacts']=function(_0x4a5e64,_0x4352a5){var _0x4565b0={};var _0x30a1d7={};var _0x1ccc62;var _0x390210;return db['User'][_0x7739('0x99')]({'where':{'id':_0x4a5e64[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x4352a5,null))[_0x7739('0x2a')](function(_0x6430b6){if(_0x6430b6){_0x1ccc62=_0x6430b6;_0x30a1d7['model']=_[_0x7739('0xcc')](db[_0x7739('0xcd')][_0x7739('0x56')]);_0x30a1d7[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x4a5e64['query']);_0x30a1d7['filters']=_['intersection'](_0x30a1d7[_0x7739('0x54')],_0x30a1d7[_0x7739('0x42')]);_0x4565b0[_0x7739('0x47')]=_[_0x7739('0x58')](_0x30a1d7[_0x7739('0x54')],qs[_0x7739('0x59')](_0x4a5e64['query'][_0x7739('0x59')]));_0x4565b0[_0x7739('0x47')]=_0x4565b0[_0x7739('0x47')][_0x7739('0x4b')]?_0x4565b0[_0x7739('0x47')]:_0x30a1d7[_0x7739('0x54')];_0x4565b0[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0x4a5e64['query'][_0x7739('0xcf')]);_0x4565b0['where']=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0x4a5e64[_0x7739('0x42')],_0x30a1d7['filters']));if(_0x4a5e64[_0x7739('0x42')][_0x7739('0x3d')]){_0x4565b0[_0x7739('0xd1')]=_[_0x7739('0x5b')](_0x4565b0[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x4565b0[_0x7739('0x47')],function(_0x5be3c1){var _0x147194={};_0x147194[_0x5be3c1]={'$like':'%'+_0x4a5e64[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x147194;})});}_0x4565b0=_['merge']({},_0x4565b0,_0x4a5e64[_0x7739('0x5c')]);return _0x1ccc62[_0x7739('0xd2')](_0x4565b0);}})[_0x7739('0x2a')](function(_0x1bc680){if(_0x1bc680){_0x390210=_0x1bc680['length'];if(_0x4a5e64[_0x7739('0x42')][_0x7739('0xd3')](_0x7739('0x5a'))){_0x4565b0[_0x7739('0x45')]=[{'model':db[_0x7739('0xd4')],'as':_0x7739('0xd5'),'required':![]},{'model':db[_0x7739('0xd6')],'as':_0x7739('0xd7'),'attributes':['id',_0x7739('0x38'),'color'],'where':_0x4a5e64['query'][_0x7739('0xd8')]?{'id':_0x4a5e64['query'][_0x7739('0xd8')]}:undefined,'required':_0x4a5e64[_0x7739('0x42')][_0x7739('0xd8')]?!![]:![]}];}if(!_0x4a5e64[_0x7739('0x42')][_0x7739('0xd3')](_0x7739('0xd9'))){_0x4565b0[_0x7739('0x24')]=qs['limit'](_0x4a5e64[_0x7739('0x42')][_0x7739('0x24')]);_0x4565b0[_0x7739('0x23')]=qs[_0x7739('0x23')](_0x4a5e64[_0x7739('0x42')][_0x7739('0x23')]);}return _0x1ccc62[_0x7739('0xd2')](_0x4565b0);}})['then'](function(_0x263efb){if(_0x263efb){return _0x263efb?{'count':_0x390210,'rows':_0x263efb}:null;}})[_0x7739('0x2a')](respondWithResult(_0x4352a5,null))['catch'](handleError(_0x4352a5,null));};exports[_0x7739('0xda')]=function(_0x22ccd7,_0xc24efe){var _0x1110da;var _0x1566b8={};var _0x578435;return db['User'][_0x7739('0x99')]({'where':{'id':_0x22ccd7[_0x7739('0x53')]['id']},'attributes':['id',_0x7739('0x38'),_0x7739('0x2e')]})[_0x7739('0x2a')](handleEntityNotFound(_0xc24efe,null))[_0x7739('0x2a')](function(_0x27259d){if(!utils['isValidChannel'](_0x22ccd7[_0x7739('0x42')][_0x7739('0xb0')])){throw new db['Sequelize'][(_0x7739('0x95'))](_0x7739('0xb1'));}_0x1110da=_0x27259d;var _0x501ef5={};_0x501ef5['model']=_[_0x7739('0xcc')](db[_[_0x7739('0xa2')](_0x22ccd7[_0x7739('0x42')][_0x7739('0xb0')])+_0x7739('0xdb')][_0x7739('0x56')]);_0x501ef5[_0x7739('0x42')]=_['keys'](_0x22ccd7['query']);_0x501ef5[_0x7739('0x57')]=_[_0x7739('0x58')](_0x501ef5['model'],_0x501ef5[_0x7739('0x42')]);_0x1566b8[_0x7739('0x47')]=_[_0x7739('0x58')](_0x501ef5['model'],qs[_0x7739('0x59')](_0x22ccd7['query'][_0x7739('0x59')]));_0x1566b8['attributes']=_0x1566b8[_0x7739('0x47')]['length']?_0x1566b8[_0x7739('0x47')]:_0x501ef5['model'];_0x1566b8[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0x22ccd7[_0x7739('0x42')]['sort']);_0x1566b8[_0x7739('0xd1')]=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0x22ccd7['query'],_0x501ef5[_0x7739('0x57')]));if(_0x22ccd7[_0x7739('0x42')][_0x7739('0x3d')]){_0x1566b8[_0x7739('0xd1')]=_[_0x7739('0x5b')](_0x1566b8[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x1566b8[_0x7739('0x47')],function(_0x2a006f){var _0x5865f9={};_0x5865f9[_0x2a006f]={'$like':'%'+_0x22ccd7[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x5865f9;})});}_0x1566b8=_['merge']({},_0x1566b8,_0x22ccd7['options']);switch(_0x1110da[_0x7739('0x2e')]){case _0x7739('0x2f'):return db[_[_0x7739('0xa2')](_0x22ccd7[_0x7739('0x42')][_0x7739('0xb0')])+_0x7739('0xdb')][_0x7739('0x8d')](_0x1566b8);case _0x7739('0x31'):case _0x7739('0x73'):return _0x1110da[_0x7739('0x2d')+_[_0x7739('0xa2')](_0x22ccd7[_0x7739('0x42')]['channel'])+_0x7739('0xa4')](_0x1566b8);default:throw new db['Sequelize'][(_0x7739('0x95'))]('Unknown\x20role');}})[_0x7739('0x2a')](function(_0x6bd1e3){_0x578435=_0x6bd1e3[_0x7739('0x4b')];if(!_0x22ccd7['query']['hasOwnProperty']('nolimit')){_0x1566b8[_0x7739('0x24')]=qs['limit'](_0x22ccd7[_0x7739('0x42')]['limit']);_0x1566b8[_0x7739('0x23')]=qs['offset'](_0x22ccd7[_0x7739('0x42')][_0x7739('0x23')]);}switch(_0x1110da['role']){case'admin':return db[_[_0x7739('0xa2')](_0x22ccd7[_0x7739('0x42')][_0x7739('0xb0')])+_0x7739('0xdb')]['findAll'](_0x1566b8);case'user':case _0x7739('0x73'):return _0x1110da['get'+_['capitalize'](_0x22ccd7['query'][_0x7739('0xb0')])+_0x7739('0xa4')](_0x1566b8);}})[_0x7739('0x2a')](function(_0x459236){return{'count':_0x578435,'rows':_0x459236};})[_0x7739('0x2a')](respondWithResult(_0xc24efe,null))[_0x7739('0x1f')](handleError(_0xc24efe,null));};exports[_0x7739('0xdc')]=function(_0x28eca7,_0x1f1d3){var _0xaa491d={};var _0x41e931={};var _0x28aa02;var _0x225eef;return db['User'][_0x7739('0x99')]({'where':{'id':_0x28eca7[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x1f1d3,null))[_0x7739('0x2a')](function(_0x4ef1db){if(_0x4ef1db){_0x28aa02=_0x4ef1db;_0x41e931[_0x7739('0x54')]=_[_0x7739('0xcc')](db[_0x7739('0xad')][_0x7739('0x56')]);_0x41e931[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x28eca7['query']);_0x41e931[_0x7739('0x57')]=_[_0x7739('0x58')](_0x41e931[_0x7739('0x54')],_0x41e931[_0x7739('0x42')]);_0xaa491d[_0x7739('0x47')]=_[_0x7739('0x58')](_0x41e931[_0x7739('0x54')],qs[_0x7739('0x59')](_0x28eca7[_0x7739('0x42')]['fields']));_0xaa491d[_0x7739('0x47')]=_0xaa491d[_0x7739('0x47')]['length']?_0xaa491d[_0x7739('0x47')]:_0x41e931['model'];_0xaa491d[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0x28eca7[_0x7739('0x42')][_0x7739('0xcf')]);_0xaa491d[_0x7739('0xd1')]=qs[_0x7739('0x57')](_['pick'](_0x28eca7[_0x7739('0x42')],_0x41e931['filters']));if(_0x28eca7[_0x7739('0x42')][_0x7739('0x3d')]){_0xaa491d[_0x7739('0xd1')]=_[_0x7739('0x5b')](_0xaa491d[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0xaa491d[_0x7739('0x47')],function(_0x29c2bf){var _0x185760={};_0x185760[_0x29c2bf]={'$like':'%'+_0x28eca7['query']['filter']+'%'};return _0x185760;})});}_0xaa491d=_[_0x7739('0x5b')]({},_0xaa491d,_0x28eca7[_0x7739('0x5c')]);return _0x28aa02[_0x7739('0xdc')](_0xaa491d);}})[_0x7739('0x2a')](function(_0x52efac){if(_0x52efac){_0x225eef=_0x52efac[_0x7739('0x4b')];if(!_0x28eca7['query'][_0x7739('0xd3')](_0x7739('0xd9'))){_0xaa491d[_0x7739('0x24')]=qs[_0x7739('0x24')](_0x28eca7[_0x7739('0x42')][_0x7739('0x24')]);_0xaa491d['offset']=qs[_0x7739('0x23')](_0x28eca7[_0x7739('0x42')][_0x7739('0x23')]);}return _0x28aa02[_0x7739('0xdc')](_0xaa491d);}})[_0x7739('0x2a')](function(_0x5ce78b){if(_0x5ce78b){return _0x5ce78b?{'count':_0x225eef,'rows':_0x5ce78b}:null;}})[_0x7739('0x2a')](respondWithResult(_0x1f1d3,null))[_0x7739('0x1f')](handleError(_0x1f1d3,null));};exports[_0x7739('0xdd')]=function(_0x2d05fb,_0x4afa46){var _0x1da41f={};var _0x289ea5={};var _0x497c;var _0x57778b;return db['User'][_0x7739('0x99')]({'where':{'id':_0x2d05fb['params']['id']}})['then'](handleEntityNotFound(_0x4afa46,null))[_0x7739('0x2a')](function(_0xfd0570){if(_0xfd0570){_0x497c=_0xfd0570;_0x289ea5[_0x7739('0x54')]=_[_0x7739('0xcc')](db[_0x7739('0xde')][_0x7739('0x56')]);_0x289ea5[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x2d05fb[_0x7739('0x42')]);_0x289ea5[_0x7739('0x57')]=_[_0x7739('0x58')](_0x289ea5['model'],_0x289ea5['query']);_0x1da41f['attributes']=_[_0x7739('0x58')](_0x289ea5[_0x7739('0x54')],qs['fields'](_0x2d05fb[_0x7739('0x42')]['fields']));_0x1da41f[_0x7739('0x47')]=_0x1da41f['attributes']['length']?_0x1da41f[_0x7739('0x47')]:_0x289ea5[_0x7739('0x54')];_0x1da41f[_0x7739('0xce')]=qs['sort'](_0x2d05fb['query'][_0x7739('0xcf')]);_0x1da41f['where']=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0x2d05fb[_0x7739('0x42')],_0x289ea5['filters']));if(_0x2d05fb[_0x7739('0x42')][_0x7739('0x3d')]){_0x1da41f['where']=_[_0x7739('0x5b')](_0x1da41f['where'],{'$or':_['map'](_0x1da41f[_0x7739('0x47')],function(_0x17ae6e){var _0xd4d3e5={};_0xd4d3e5[_0x17ae6e]={'$like':'%'+_0x2d05fb[_0x7739('0x42')]['filter']+'%'};return _0xd4d3e5;})});}_0x1da41f=_[_0x7739('0x5b')]({},_0x1da41f,_0x2d05fb[_0x7739('0x5c')]);return _0x497c['getGroups'](_0x1da41f);}})[_0x7739('0x2a')](function(_0x46dc1f){if(_0x46dc1f){_0x57778b=_0x46dc1f['length'];if(!_0x2d05fb[_0x7739('0x42')][_0x7739('0xd3')](_0x7739('0xd9'))){_0x1da41f[_0x7739('0x24')]=qs[_0x7739('0x24')](_0x2d05fb[_0x7739('0x42')][_0x7739('0x24')]);_0x1da41f[_0x7739('0x23')]=qs['offset'](_0x2d05fb[_0x7739('0x42')]['offset']);}return _0x497c[_0x7739('0xdd')](_0x1da41f);}})[_0x7739('0x2a')](function(_0x288786){if(_0x288786){return _0x288786?{'count':_0x57778b,'rows':_0x288786}:null;}})['then'](respondWithResult(_0x4afa46,null))[_0x7739('0x1f')](handleError(_0x4afa46,null));};exports['getRecordings']=function(_0x20283f,_0x340b93){var _0x4c6e8b={'raw':!![],'where':{}};var _0x1eb439={};var _0x2eb140={'count':0x0,'rows':[]};return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x20283f[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x340b93,null))[_0x7739('0x2a')](function(_0x1b2cce){if(_0x1b2cce){_0x1eb439[_0x7739('0x54')]=_[_0x7739('0xcc')](db[_0x7739('0xdf')][_0x7739('0x56')]);_0x1eb439[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x20283f[_0x7739('0x42')]);_0x1eb439[_0x7739('0x57')]=_['intersection'](_0x1eb439[_0x7739('0x54')],_0x1eb439[_0x7739('0x42')]);_0x4c6e8b['attributes']=_[_0x7739('0x58')](_0x1eb439[_0x7739('0x54')],qs[_0x7739('0x59')](_0x20283f[_0x7739('0x42')][_0x7739('0x59')]));_0x4c6e8b['attributes']=_0x4c6e8b[_0x7739('0x47')][_0x7739('0x4b')]?_0x4c6e8b[_0x7739('0x47')]:_0x1eb439['model'];if(!_0x20283f['query'][_0x7739('0xd3')](_0x7739('0xd9'))){_0x4c6e8b['limit']=qs[_0x7739('0x24')](_0x20283f[_0x7739('0x42')][_0x7739('0x24')]);_0x4c6e8b[_0x7739('0x23')]=qs[_0x7739('0x23')](_0x20283f[_0x7739('0x42')]['offset']);}_0x4c6e8b['order']=qs[_0x7739('0xcf')](_0x20283f['query'][_0x7739('0xcf')]);_0x4c6e8b[_0x7739('0xd1')]=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0x20283f['query'],_0x1eb439['filters']));_0x4c6e8b[_0x7739('0xd1')][_0x7739('0xe0')]=_0x1b2cce['id'];if(_0x20283f[_0x7739('0x42')]['filter']){_0x4c6e8b[_0x7739('0xd1')]=_[_0x7739('0x5b')](_0x4c6e8b[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x4c6e8b[_0x7739('0x47')],function(_0x268ee2){var _0x3094a9={};_0x3094a9[_0x268ee2]={'$like':'%'+_0x20283f[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x3094a9;})});}_0x4c6e8b=_[_0x7739('0x5b')]({},_0x4c6e8b,_0x20283f[_0x7739('0x5c')]);return db[_0x7739('0xdf')][_0x7739('0x26')]({'where':_0x4c6e8b[_0x7739('0xd1')]})['then'](function(_0x68ef0a){_0x2eb140[_0x7739('0x26')]=_0x68ef0a;if(_0x20283f[_0x7739('0x42')][_0x7739('0x5a')]){_0x4c6e8b[_0x7739('0x45')]=[{'all':!![]}];}return db['VoiceRecording'][_0x7739('0x8d')](_0x4c6e8b);})['then'](function(_0x17a2bc){_0x2eb140[_0x7739('0x49')]=_0x17a2bc;return _0x2eb140;});}})[_0x7739('0x2a')](respondWithFilteredResult(_0x340b93,_0x4c6e8b))[_0x7739('0x1f')](handleError(_0x340b93,null));};exports[_0x7739('0xe1')]=function(_0x3b11c3,_0x20acec){var _0x230284={'raw':!![],'where':{}};var _0x194840={};var _0x3f0e8b={'count':0x0,'rows':[]};return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x3b11c3[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x20acec,null))['then'](function(_0x3dc113){if(_0x3dc113){_0x194840[_0x7739('0x54')]=_[_0x7739('0xcc')](db['ScreenRecording'][_0x7739('0x56')]);_0x194840[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x3b11c3[_0x7739('0x42')]);_0x194840[_0x7739('0x57')]=_[_0x7739('0x58')](_0x194840[_0x7739('0x54')],_0x194840[_0x7739('0x42')]);_0x230284[_0x7739('0x47')]=_[_0x7739('0x58')](_0x194840[_0x7739('0x54')],qs[_0x7739('0x59')](_0x3b11c3['query'][_0x7739('0x59')]));_0x230284[_0x7739('0x47')]=_0x230284[_0x7739('0x47')][_0x7739('0x4b')]?_0x230284[_0x7739('0x47')]:_0x194840['model'];if(!_0x3b11c3['query'][_0x7739('0xd3')](_0x7739('0xd9'))){_0x230284[_0x7739('0x24')]=qs['limit'](_0x3b11c3[_0x7739('0x42')][_0x7739('0x24')]);_0x230284[_0x7739('0x23')]=qs[_0x7739('0x23')](_0x3b11c3[_0x7739('0x42')][_0x7739('0x23')]);}_0x230284['order']=qs['sort'](_0x3b11c3[_0x7739('0x42')]['sort']);_0x230284[_0x7739('0xd1')]=qs[_0x7739('0x57')](_['pick'](_0x3b11c3[_0x7739('0x42')],_0x194840[_0x7739('0x57')]));_0x230284[_0x7739('0xd1')][_0x7739('0xe0')]=_0x3dc113['id'];if(_0x3b11c3[_0x7739('0x42')][_0x7739('0x3d')]){_0x230284['where']=_[_0x7739('0x5b')](_0x230284[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x230284[_0x7739('0x47')],function(_0xf0e7d){var _0x55fcd1={};_0x55fcd1[_0xf0e7d]={'$like':'%'+_0x3b11c3[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x55fcd1;})});}_0x230284=_['merge']({},_0x230284,_0x3b11c3['options']);return db[_0x7739('0xe2')][_0x7739('0x26')]({'where':_0x230284[_0x7739('0xd1')]})[_0x7739('0x2a')](function(_0x348d2e){_0x3f0e8b[_0x7739('0x26')]=_0x348d2e;if(_0x3b11c3[_0x7739('0x42')][_0x7739('0x5a')]){_0x230284[_0x7739('0x45')]=[{'all':!![]}];}return db[_0x7739('0xe2')][_0x7739('0x8d')](_0x230284);})[_0x7739('0x2a')](function(_0x2cc764){_0x3f0e8b[_0x7739('0x49')]=_0x2cc764;return _0x3f0e8b;});}})[_0x7739('0x2a')](respondWithFilteredResult(_0x20acec,_0x230284))[_0x7739('0x1f')](handleError(_0x20acec,null));};exports[_0x7739('0xe3')]=function(_0x5787fc,_0x5b299c){var _0x5ba8cc={};var _0x570003={};var _0x2150d7;var _0x48e2e0;return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x5787fc['params']['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x5b299c,null))[_0x7739('0x2a')](function(_0x5eef81){if(_0x5eef81){_0x2150d7=_0x5eef81;_0x570003[_0x7739('0x54')]=_[_0x7739('0xcc')](db[_0x7739('0xe4')][_0x7739('0x56')]);_0x570003[_0x7739('0x42')]=_['keys'](_0x5787fc['query']);_0x570003[_0x7739('0x57')]=_['intersection'](_0x570003[_0x7739('0x54')],_0x570003[_0x7739('0x42')]);_0x5ba8cc[_0x7739('0x47')]=_[_0x7739('0x58')](_0x570003[_0x7739('0x54')],qs[_0x7739('0x59')](_0x5787fc['query'][_0x7739('0x59')]));_0x5ba8cc[_0x7739('0x47')]=_0x5ba8cc[_0x7739('0x47')][_0x7739('0x4b')]?_0x5ba8cc[_0x7739('0x47')]:_0x570003[_0x7739('0x54')];_0x5ba8cc[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0x5787fc[_0x7739('0x42')]['sort']);_0x5ba8cc[_0x7739('0xd1')]=qs['filters'](_[_0x7739('0xd0')](_0x5787fc['query'],_0x570003[_0x7739('0x57')]));if(_0x5787fc[_0x7739('0x42')][_0x7739('0x3d')]){_0x5ba8cc['where']=_[_0x7739('0x5b')](_0x5ba8cc['where'],{'$or':_[_0x7739('0x35')](_0x5ba8cc[_0x7739('0x47')],function(_0xed45f2){var _0x340433={};_0x340433[_0xed45f2]={'$like':'%'+_0x5787fc[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x340433;})});}_0x5ba8cc=_[_0x7739('0x5b')]({},_0x5ba8cc,_0x5787fc[_0x7739('0x5c')]);return _0x2150d7[_0x7739('0xe3')](_0x5ba8cc);}})[_0x7739('0x2a')](function(_0x4d0bfd){if(_0x4d0bfd){_0x48e2e0=_0x4d0bfd['length'];if(!_0x5787fc[_0x7739('0x42')][_0x7739('0xd3')](_0x7739('0xd9'))){_0x5ba8cc['limit']=qs[_0x7739('0x24')](_0x5787fc[_0x7739('0x42')]['limit']);_0x5ba8cc[_0x7739('0x23')]=qs[_0x7739('0x23')](_0x5787fc['query']['offset']);}return _0x2150d7[_0x7739('0xe3')](_0x5ba8cc);}})[_0x7739('0x2a')](function(_0x391771){if(_0x391771){return _0x391771?{'count':_0x48e2e0,'rows':_0x391771}:null;}})[_0x7739('0x2a')](respondWithResult(_0x5b299c,null))['catch'](handleError(_0x5b299c,null));};exports['getOpenchannelInteractions']=function(_0x4b22c4,_0x11e175){var _0x5daab3={};var _0x36583f={};var _0x5809dc;var _0x5635ec;return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x4b22c4['params']['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x11e175,null))[_0x7739('0x2a')](function(_0x117b51){if(_0x117b51){_0x5809dc=_0x117b51;_0x36583f[_0x7739('0x54')]=_[_0x7739('0xcc')](db[_0x7739('0xe5')][_0x7739('0x56')]);_0x36583f[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x4b22c4[_0x7739('0x42')]);_0x36583f['filters']=_[_0x7739('0x58')](_0x36583f['model'],_0x36583f[_0x7739('0x42')]);_0x5daab3[_0x7739('0x47')]=_[_0x7739('0x58')](_0x36583f['model'],qs['fields'](_0x4b22c4['query']['fields']));_0x5daab3[_0x7739('0x47')]=_0x5daab3[_0x7739('0x47')][_0x7739('0x4b')]?_0x5daab3[_0x7739('0x47')]:_0x36583f[_0x7739('0x54')];_0x5daab3[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0x4b22c4[_0x7739('0x42')][_0x7739('0xcf')]);_0x5daab3[_0x7739('0xd1')]=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0x4b22c4[_0x7739('0x42')],_0x36583f['filters']));if(_0x4b22c4[_0x7739('0x42')][_0x7739('0x3d')]){_0x5daab3[_0x7739('0xd1')]=_['merge'](_0x5daab3[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x5daab3[_0x7739('0x47')],function(_0x1ef266){var _0x12f952={};_0x12f952[_0x1ef266]={'$like':'%'+_0x4b22c4[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x12f952;})});}_0x5daab3=_[_0x7739('0x5b')]({},_0x5daab3,_0x4b22c4[_0x7739('0x5c')]);return _0x5809dc[_0x7739('0xe6')](_0x5daab3);}})[_0x7739('0x2a')](function(_0x11ecd1){if(_0x11ecd1){_0x5635ec=_0x11ecd1[_0x7739('0x4b')];if(!_0x4b22c4['query'][_0x7739('0xd3')](_0x7739('0xd9'))){_0x5daab3['limit']=qs[_0x7739('0x24')](_0x4b22c4[_0x7739('0x42')]['limit']);_0x5daab3[_0x7739('0x23')]=qs[_0x7739('0x23')](_0x4b22c4[_0x7739('0x42')][_0x7739('0x23')]);}return _0x5809dc[_0x7739('0xe6')](_0x5daab3);}})[_0x7739('0x2a')](function(_0x54579a){if(_0x54579a){return _0x54579a?{'count':_0x5635ec,'rows':_0x54579a}:null;}})[_0x7739('0x2a')](respondWithResult(_0x11e175,null))[_0x7739('0x1f')](handleError(_0x11e175,null));};exports['getMailInteractions']=function(_0xe0f473,_0x1e7fd8){var _0x166c2a={'raw':!![],'where':{}};var _0x20afdd={};var _0x1d4c90={'count':0x0,'rows':[]};return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0xe0f473[_0x7739('0x53')]['id']}})['then'](handleEntityNotFound(_0x1e7fd8,null))['then'](function(_0x2c74cd){if(_0x2c74cd){_0x20afdd[_0x7739('0x54')]=_[_0x7739('0xcc')](db['MailInteraction'][_0x7739('0x56')]);_0x20afdd[_0x7739('0x42')]=_[_0x7739('0xcc')](_0xe0f473['query']);_0x20afdd['filters']=_[_0x7739('0x58')](_0x20afdd['model'],_0x20afdd[_0x7739('0x42')]);_0x166c2a[_0x7739('0x47')]=_[_0x7739('0x58')](_0x20afdd['model'],qs['fields'](_0xe0f473[_0x7739('0x42')][_0x7739('0x59')]));_0x166c2a[_0x7739('0x47')]=_0x166c2a[_0x7739('0x47')]['length']?_0x166c2a[_0x7739('0x47')]:_0x20afdd['model'];if(!_0xe0f473[_0x7739('0x42')][_0x7739('0xd3')](_0x7739('0xd9'))){_0x166c2a[_0x7739('0x24')]=qs['limit'](_0xe0f473['query']['limit']);_0x166c2a['offset']=qs[_0x7739('0x23')](_0xe0f473[_0x7739('0x42')][_0x7739('0x23')]);}_0x166c2a[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0xe0f473['query'][_0x7739('0xcf')]);_0x166c2a[_0x7739('0xd1')]=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0xe0f473['query'],_0x20afdd['filters']));_0x166c2a['where']['UserId']=_0x2c74cd['id'];if(_0xe0f473[_0x7739('0x42')][_0x7739('0x3d')]){_0x166c2a['where']=_[_0x7739('0x5b')](_0x166c2a[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x166c2a[_0x7739('0x47')],function(_0x20b504){var _0x2ae770={};_0x2ae770[_0x20b504]={'$like':'%'+_0xe0f473[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x2ae770;})});}_0x166c2a=_[_0x7739('0x5b')]({},_0x166c2a,_0xe0f473[_0x7739('0x5c')]);return db[_0x7739('0xe7')][_0x7739('0x26')]({'where':_0x166c2a[_0x7739('0xd1')]})[_0x7739('0x2a')](function(_0x45f375){_0x1d4c90[_0x7739('0x26')]=_0x45f375;if(_0xe0f473['query'][_0x7739('0x5a')]){_0x166c2a[_0x7739('0x45')]=[{'all':!![]}];}return db[_0x7739('0xe7')][_0x7739('0x8d')](_0x166c2a);})['then'](function(_0x44c0aa){_0x1d4c90['rows']=_0x44c0aa;return _0x1d4c90;});}})[_0x7739('0x2a')](respondWithFilteredResult(_0x1e7fd8,_0x166c2a))[_0x7739('0x1f')](handleError(_0x1e7fd8,null));};exports[_0x7739('0xe8')]=function(_0x1d7ab4,_0x479397){var _0x111757={};var _0xdef514={};var _0x4553ce;var _0x5228cd;return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x1d7ab4[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x479397,null))[_0x7739('0x2a')](function(_0x4f4432){if(_0x4f4432){_0x4553ce=_0x4f4432;_0xdef514[_0x7739('0x54')]=_[_0x7739('0xcc')](db[_0x7739('0xe9')]['rawAttributes']);_0xdef514[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x1d7ab4['query']);_0xdef514[_0x7739('0x57')]=_[_0x7739('0x58')](_0xdef514[_0x7739('0x54')],_0xdef514[_0x7739('0x42')]);_0x111757[_0x7739('0x47')]=_[_0x7739('0x58')](_0xdef514[_0x7739('0x54')],qs['fields'](_0x1d7ab4[_0x7739('0x42')][_0x7739('0x59')]));_0x111757[_0x7739('0x47')]=_0x111757[_0x7739('0x47')][_0x7739('0x4b')]?_0x111757[_0x7739('0x47')]:_0xdef514[_0x7739('0x54')];_0x111757[_0x7739('0xce')]=qs['sort'](_0x1d7ab4[_0x7739('0x42')][_0x7739('0xcf')]);_0x111757[_0x7739('0xd1')]=qs['filters'](_[_0x7739('0xd0')](_0x1d7ab4['query'],_0xdef514[_0x7739('0x57')]));if(_0x1d7ab4['query'][_0x7739('0x3d')]){_0x111757[_0x7739('0xd1')]=_[_0x7739('0x5b')](_0x111757[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x111757[_0x7739('0x47')],function(_0x212fc){var _0x43669c={};_0x43669c[_0x212fc]={'$like':'%'+_0x1d7ab4['query']['filter']+'%'};return _0x43669c;})});}_0x111757=_[_0x7739('0x5b')]({},_0x111757,_0x1d7ab4[_0x7739('0x5c')]);return _0x4553ce['getSmsInteractions'](_0x111757);}})[_0x7739('0x2a')](function(_0x12f613){if(_0x12f613){_0x5228cd=_0x12f613[_0x7739('0x4b')];if(!_0x1d7ab4[_0x7739('0x42')][_0x7739('0xd3')](_0x7739('0xd9'))){_0x111757[_0x7739('0x24')]=qs[_0x7739('0x24')](_0x1d7ab4[_0x7739('0x42')]['limit']);_0x111757[_0x7739('0x23')]=qs[_0x7739('0x23')](_0x1d7ab4['query']['offset']);}return _0x4553ce[_0x7739('0xe8')](_0x111757);}})[_0x7739('0x2a')](function(_0x1b09c4){if(_0x1b09c4){return _0x1b09c4?{'count':_0x5228cd,'rows':_0x1b09c4}:null;}})[_0x7739('0x2a')](respondWithResult(_0x479397,null))['catch'](handleError(_0x479397,null));};exports[_0x7739('0xea')]=function(_0xb804e5,_0x50dbf7){var _0x41b1fe={};var _0x1ca908={};var _0x9258f3;var _0x4dd630;return db['User']['findOne']({'where':{'id':_0xb804e5[_0x7739('0x53')]['id']}})['then'](handleEntityNotFound(_0x50dbf7,null))[_0x7739('0x2a')](function(_0xbe7da7){if(_0xbe7da7){_0x9258f3=_0xbe7da7;_0x1ca908[_0x7739('0x54')]=_[_0x7739('0xcc')](db['FaxInteraction'][_0x7739('0x56')]);_0x1ca908[_0x7739('0x42')]=_['keys'](_0xb804e5[_0x7739('0x42')]);_0x1ca908[_0x7739('0x57')]=_[_0x7739('0x58')](_0x1ca908[_0x7739('0x54')],_0x1ca908[_0x7739('0x42')]);_0x41b1fe['attributes']=_[_0x7739('0x58')](_0x1ca908[_0x7739('0x54')],qs[_0x7739('0x59')](_0xb804e5[_0x7739('0x42')]['fields']));_0x41b1fe[_0x7739('0x47')]=_0x41b1fe[_0x7739('0x47')][_0x7739('0x4b')]?_0x41b1fe['attributes']:_0x1ca908[_0x7739('0x54')];_0x41b1fe[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0xb804e5[_0x7739('0x42')][_0x7739('0xcf')]);_0x41b1fe[_0x7739('0xd1')]=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0xb804e5[_0x7739('0x42')],_0x1ca908[_0x7739('0x57')]));if(_0xb804e5[_0x7739('0x42')][_0x7739('0x3d')]){_0x41b1fe[_0x7739('0xd1')]=_[_0x7739('0x5b')](_0x41b1fe[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x41b1fe[_0x7739('0x47')],function(_0x22bb60){var _0x1bb65a={};_0x1bb65a[_0x22bb60]={'$like':'%'+_0xb804e5[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x1bb65a;})});}_0x41b1fe=_[_0x7739('0x5b')]({},_0x41b1fe,_0xb804e5['options']);return _0x9258f3[_0x7739('0xea')](_0x41b1fe);}})[_0x7739('0x2a')](function(_0x366fb0){if(_0x366fb0){_0x4dd630=_0x366fb0[_0x7739('0x4b')];if(!_0xb804e5[_0x7739('0x42')][_0x7739('0xd3')]('nolimit')){_0x41b1fe[_0x7739('0x24')]=qs['limit'](_0xb804e5[_0x7739('0x42')][_0x7739('0x24')]);_0x41b1fe[_0x7739('0x23')]=qs[_0x7739('0x23')](_0xb804e5[_0x7739('0x42')][_0x7739('0x23')]);}return _0x9258f3['getFaxInteractions'](_0x41b1fe);}})[_0x7739('0x2a')](function(_0x2d87e8){if(_0x2d87e8){return _0x2d87e8?{'count':_0x4dd630,'rows':_0x2d87e8}:null;}})[_0x7739('0x2a')](respondWithResult(_0x50dbf7,null))['catch'](handleError(_0x50dbf7,null));};exports['getWhatsappInteractions']=function(_0x24a4f8,_0x5a523d){var _0x4ee038={};var _0x2af16c={};var _0x457988;var _0x3caddf;return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x24a4f8[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x5a523d,null))[_0x7739('0x2a')](function(_0x42227d){if(_0x42227d){_0x457988=_0x42227d;_0x2af16c[_0x7739('0x54')]=_[_0x7739('0xcc')](db[_0x7739('0xeb')][_0x7739('0x56')]);_0x2af16c[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x24a4f8[_0x7739('0x42')]);_0x2af16c[_0x7739('0x57')]=_[_0x7739('0x58')](_0x2af16c['model'],_0x2af16c[_0x7739('0x42')]);_0x4ee038[_0x7739('0x47')]=_[_0x7739('0x58')](_0x2af16c[_0x7739('0x54')],qs['fields'](_0x24a4f8[_0x7739('0x42')][_0x7739('0x59')]));_0x4ee038['attributes']=_0x4ee038[_0x7739('0x47')]['length']?_0x4ee038[_0x7739('0x47')]:_0x2af16c[_0x7739('0x54')];_0x4ee038['order']=qs[_0x7739('0xcf')](_0x24a4f8['query'][_0x7739('0xcf')]);_0x4ee038[_0x7739('0xd1')]=qs[_0x7739('0x57')](_['pick'](_0x24a4f8[_0x7739('0x42')],_0x2af16c[_0x7739('0x57')]));if(_0x24a4f8[_0x7739('0x42')]['filter']){_0x4ee038['where']=_[_0x7739('0x5b')](_0x4ee038['where'],{'$or':_['map'](_0x4ee038[_0x7739('0x47')],function(_0x4448a0){var _0x7d2b58={};_0x7d2b58[_0x4448a0]={'$like':'%'+_0x24a4f8[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x7d2b58;})});}_0x4ee038=_['merge']({},_0x4ee038,_0x24a4f8[_0x7739('0x5c')]);return _0x457988[_0x7739('0xec')](_0x4ee038);}})[_0x7739('0x2a')](function(_0x1e312f){if(_0x1e312f){_0x3caddf=_0x1e312f[_0x7739('0x4b')];if(!_0x24a4f8[_0x7739('0x42')][_0x7739('0xd3')]('nolimit')){_0x4ee038[_0x7739('0x24')]=qs[_0x7739('0x24')](_0x24a4f8['query'][_0x7739('0x24')]);_0x4ee038[_0x7739('0x23')]=qs[_0x7739('0x23')](_0x24a4f8[_0x7739('0x42')][_0x7739('0x23')]);}return _0x457988[_0x7739('0xec')](_0x4ee038);}})['then'](function(_0x6ae6e9){if(_0x6ae6e9){return _0x6ae6e9?{'count':_0x3caddf,'rows':_0x6ae6e9}:null;}})[_0x7739('0x2a')](respondWithResult(_0x5a523d,null))[_0x7739('0x1f')](handleError(_0x5a523d,null));};exports[_0x7739('0xed')]=function(_0x5dde8d,_0x3849ef,_0x1928a6){var _0x1b45c0;var _0x2ae8ef;var _0x13c452;var _0x2eca31=!_[_0x7739('0x6a')](_0x5dde8d[_0x7739('0x53')]['id'])?_0x5dde8d[_0x7739('0x53')]['id']:!_[_0x7739('0x6a')](_0x5dde8d['user']['id'])?_0x5dde8d[_0x7739('0x31')]['id']:null;return db['User'][_0x7739('0x5d')]({'where':{'id':_0x2eca31,'role':{'$or':[_0x7739('0x2f'),'user',_0x7739('0x73')]}},'attributes':['id',_0x7739('0x38'),_0x7739('0xee'),_0x7739('0xef'),_0x7739('0x2e'),_0x7739('0x64'),_0x7739('0x9f')]})[_0x7739('0x2a')](function(_0x2aa3d2){if(_0x2aa3d2){if(_0x2aa3d2[_0x7739('0x2e')]==='agent'){_0x1b45c0=_0x2aa3d2;if(_0x5dde8d[_0x7739('0x60')]['interface']){_0x13c452=util[_0x7739('0xac')](_0x7739('0xf0'),_0x1b45c0[_0x5dde8d[_0x7739('0x60')][_0x7739('0xa0')]]);}else if(_0x5dde8d[_0x7739('0x60')][_0x7739('0xf1')]){_0x13c452=util[_0x7739('0xac')](_0x7739('0xf2'),_0x5dde8d[_0x7739('0x60')]['intrf']);}else{_0x13c452=util[_0x7739('0xac')]('SIP/%s',_0x1b45c0[_0x7739('0x38')]);}socket['to'](util[_0x7739('0xac')](_0x7739('0xf3'),_0x1b45c0['name']))['emit']('user:forcelogout',{'user':{'id':_0x1b45c0['id'],'name':_0x1b45c0[_0x7739('0x38')]},'ip':_0x5dde8d[_0x7739('0xf4')][_0x7739('0xf5')]||_0x5dde8d[_0x7739('0xf6')][_0x7739('0xf7')]||_0x5dde8d[_0x7739('0xf8')][_0x7739('0xf7')]||_0x5dde8d[_0x7739('0xf6')][_0x7739('0xf8')]['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x1b45c0['name']},'individualHooks':!![]});}}else{throw new db[(_0x7739('0x92'))][(_0x7739('0x95'))](_0x7739('0xf9'));}})['then'](function(){if(_0x1b45c0){return _0x1b45c0['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x4028f7){if(_0x1b45c0){if(_0x4028f7){_0x2ae8ef=_0x4028f7;if(_0x2ae8ef[_0x7739('0x4b')]){var _0x5d9019=_0x2ae8ef[_0x7739('0x35')](function(_0x3c7d80){var _0x1656d5={'membername':_0x1b45c0[_0x7739('0x38')],'UserId':_0x1b45c0['id'],'queue_name':_0x3c7d80['name'],'VoiceQueueId':_0x3c7d80['id'],'interface':_0x13c452,'paused':_0x1b45c0[_0x7739('0x9f')]||![],'penalty':_0x3c7d80[_0x7739('0xfa')]||0x0};return db[_0x7739('0xad')][_0x7739('0xae')](_0x1656d5);});return Promise[_0x7739('0x51')](_0x5d9019);}}}})[_0x7739('0x2a')](function(){if(_0x1b45c0){return db[_0x7739('0xfb')][_0x7739('0x8d')]({'where':{'membername':_0x1b45c0[_0x7739('0x38')],'exitAt':null}});}})[_0x7739('0x2a')](function(_0x29aa07){if(_0x1b45c0){var _0x2a7017=[];_0x29aa07[_0x7739('0xfc')](function(_0x4c8db0){_0x2a7017[_0x7739('0x48')](_0x4c8db0[_0x7739('0x29')]({'exitAt':moment()[_0x7739('0xac')](_0x7739('0xfd'))}));});return Promise['all'](_0x2a7017);}})['then'](function(){if(_0x1b45c0){var _0x17a921=[];var _0x29922b=[];var _0x10021d=utils[_0x7739('0xfe')]();var _0x1a5aef={'membername':_0x1b45c0[_0x7739('0x38')],'interface':_0x13c452,'enterAt':moment()[_0x7739('0xac')](_0x7739('0xfd')),'role':_0x1b45c0[_0x7739('0x2e')],'internal':_0x1b45c0[_0x7739('0x64')]};_0x10021d[_0x7739('0xfc')](function(_0x5dd398){_0x17a921[_0x7739('0x48')](_[_0x7739('0x5b')]({'channel':_0x5dd398,'type':'LOGIN','data1':_0x5dde8d[_0x7739('0x60')]['device'],'data2':_0x13c452},_0x1a5aef));if(_0x1b45c0[_0x7739('0x9f')]){_0x29922b[_0x7739('0x48')](_[_0x7739('0x5b')]({'channel':_0x5dd398,'type':_0x7739('0xff'),'data1':_0x7739('0x100')},_0x1a5aef));}});return db[_0x7739('0xfb')]['bulkCreate'](_0x17a921[_0x7739('0xcb')](_0x29922b),{'individualHooks':!![]});}})[_0x7739('0x2a')](function(){if(_0x1b45c0){return _0x1b45c0[_0x7739('0x29')]({'online':!![],'lastLoginAt':moment()[_0x7739('0xac')](_0x7739('0xfd')),'voicePause':_0x1b45c0[_0x7739('0x9f')]||![],'mailPause':_0x1b45c0['loginInPause']||![],'chatPause':_0x1b45c0['loginInPause']||![],'faxPause':_0x1b45c0[_0x7739('0x9f')]||![],'smsPause':_0x1b45c0[_0x7739('0x9f')]||![],'openchannelPause':_0x1b45c0['loginInPause']||![],'whatsappPause':_0x1b45c0[_0x7739('0x9f')]||![],'pauseType':_0x1b45c0['loginInPause']?_0x7739('0x100'):null,'interface':_0x13c452,'lastPauseAt':moment()[_0x7739('0xac')](_0x7739('0xfd'))});}})[_0x7739('0x2a')](function(_0x581ac8){if(_0x5dde8d[_0x7739('0x101')]){return _0x1928a6();}else{return Promise[_0x7739('0x102')](_0x581ac8)[_0x7739('0x2a')](respondWithResult(_0x3849ef,null));}})[_0x7739('0x1f')](handleError(_0x3849ef,null));};exports['logout']=function(_0x46b805,_0xe6b7a9){var _0x29fb8a;return db[_0x7739('0x3a')][_0x7739('0x5d')]({'where':{'id':_0x46b805[_0x7739('0x53')]['id'],'role':_0x7739('0x73')},'attributes':['id',_0x7739('0x38'),_0x7739('0x2e')]})[_0x7739('0x2a')](handleEntityNotFound(_0xe6b7a9,null))[_0x7739('0x2a')](function(_0x318e91){if(_0x318e91){_0x29fb8a=_0x318e91;return db['UserVoiceQueueRt'][_0x7739('0x2c')]({'where':{'membername':_0x29fb8a[_0x7739('0x38')]},'individualHooks':!![]});}})[_0x7739('0x2a')](function(){return db[_0x7739('0xfb')]['findAll']({'where':{'membername':_0x29fb8a[_0x7739('0x38')],'exitAt':null}});})[_0x7739('0x2a')](function(_0x566dd9){var _0x261b9c=[];_0x566dd9['forEach'](function(_0x27f734){_0x261b9c[_0x7739('0x48')](_0x27f734['update']({'exitAt':moment()[_0x7739('0xac')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x261b9c);})[_0x7739('0x2a')](function(){return _0x29fb8a['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x7739('0x2a')](respondWithResult(_0xe6b7a9,null))[_0x7739('0x1f')](handleError(_0xe6b7a9,null));};exports['pause']=function(_0x2fda92,_0x43ff56){var _0x49ad9f;return db[_0x7739('0xad')]['update']({'paused':0x1},{'where':{'UserId':_0x2fda92[_0x7739('0x53')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x7739('0x3a')][_0x7739('0x5d')]({'where':{'id':_0x2fda92[_0x7739('0x53')]['id'],'role':_0x7739('0x73')},'attributes':['id',_0x7739('0x38'),_0x7739('0x2e'),'internal',_0x7739('0xa0'),_0x7739('0x9e')]});})['then'](handleEntityNotFound(_0x43ff56,null))['then'](function(_0x2923d2){if(_0x2923d2){_0x49ad9f=_0x2923d2;return respondWithRpcPromise(_0x7739('0x103'),_0x7739('0x104'),{'id':_0x49ad9f['id'],'name':_0x49ad9f[_0x7739('0x38')],'pause':!![]});}})[_0x7739('0x2a')](function(){if(_0x49ad9f){return db[_0x7739('0xfb')][_0x7739('0x8d')]({'where':{'membername':_0x49ad9f[_0x7739('0x38')],'type':'PAUSE','exitAt':null}});}})[_0x7739('0x2a')](function(_0x36bcc4){if(_0x36bcc4[_0x7739('0x4b')]){var _0x34b6f4=moment()['format'](_0x7739('0xfd'));for(var _0x535459=0x0,_0x5f0641=_0x36bcc4[_0x7739('0x4b')];_0x535459<_0x5f0641;_0x535459++){_0x36bcc4[_0x535459]['updateAttributes']({'exitAt':_0x34b6f4});}}})['then'](function(){var _0x171e84=[];var _0x5e5a9f=utils[_0x7739('0xfe')]();_0x5e5a9f[_0x7739('0xfc')](function(_0x3065af){_0x171e84[_0x7739('0x48')]({'channel':_0x3065af,'membername':_0x49ad9f['name'],'interface':_[_0x7739('0x6a')](_0x49ad9f['interface'])?util['format']('SIP/%s',_0x49ad9f[_0x7739('0x38')]):_0x49ad9f[_0x7739('0xa0')],'type':_0x7739('0xff'),'enterAt':moment()[_0x7739('0xac')](_0x7739('0xfd')),'data1':_0x2fda92[_0x7739('0x60')][_0x7739('0x3c')]||_0x7739('0x105'),'role':_0x49ad9f['role'],'internal':_0x49ad9f['internal']});});return db[_0x7739('0xfb')][_0x7739('0x106')](_0x171e84,{'individualHooks':!![]});})[_0x7739('0x2a')](function(){return _0x49ad9f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2fda92[_0x7739('0x60')][_0x7739('0x3c')]||_0x7739('0x105'),'lastPauseAt':moment()['format'](_0x7739('0xfd'))});})[_0x7739('0x2a')](respondWithResult(_0x43ff56,null))[_0x7739('0x1f')](handleError(_0x43ff56,null));};exports[_0x7739('0x107')]=function(_0x58d6f8,_0x445cee){if(_0x58d6f8[_0x7739('0x60')][_0x7739('0xb0')]&&!utils[_0x7739('0xa1')](_0x58d6f8[_0x7739('0x60')]['channel'])){throw new APIBadRequestError(util[_0x7739('0xac')](_0x7739('0x108'),_0x58d6f8[_0x7739('0x60')][_0x7739('0xb0')]));}return db[_0x7739('0x3a')][_0x7739('0x5d')]({'where':{'id':_0x58d6f8[_0x7739('0x53')]['id']},'attributes':['id','name','role','internal',_0x7739('0xa0'),_0x7739('0x9e'),_0x7739('0x109'),'mailPause',_0x7739('0x10a'),_0x7739('0x10b'),_0x7739('0x10c'),_0x7739('0x10d'),_0x7739('0x10e'),'pauseType',_0x7739('0x10f')]})['then'](function(_0x3f8243){if(!_0x3f8243){throw new APINotFoundError(util[_0x7739('0xac')](_0x7739('0x110'),_0x58d6f8['params']['id']));}return _0x3f8243[_0x7739('0x107')](_0x58d6f8[_0x7739('0x60')][_0x7739('0xb0')]);})[_0x7739('0x2a')](respondWithResult(_0x445cee,null))[_0x7739('0x1f')](APIHandleError(_0x445cee));};exports[_0x7739('0x111')]=function(_0x2c0547,_0x43a283){var _0x442dfd={};var _0x3bdf6d={};var _0x4d2694;var _0x43e269;return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x2c0547[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x43a283,null))[_0x7739('0x2a')](function(_0x39f180){if(_0x39f180){_0x4d2694=_0x39f180;_0x3bdf6d[_0x7739('0x54')]=_['keys'](db['Team'][_0x7739('0x56')]);_0x3bdf6d[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x2c0547[_0x7739('0x42')]);_0x3bdf6d[_0x7739('0x57')]=_['intersection'](_0x3bdf6d[_0x7739('0x54')],_0x3bdf6d[_0x7739('0x42')]);_0x442dfd[_0x7739('0x47')]=_['intersection'](_0x3bdf6d[_0x7739('0x54')],qs[_0x7739('0x59')](_0x2c0547[_0x7739('0x42')][_0x7739('0x59')]));_0x442dfd[_0x7739('0x47')]=_0x442dfd[_0x7739('0x47')]['length']?_0x442dfd['attributes']:_0x3bdf6d['model'];_0x442dfd['order']=qs[_0x7739('0xcf')](_0x2c0547[_0x7739('0x42')][_0x7739('0xcf')]);_0x442dfd[_0x7739('0xd1')]=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0x2c0547['query'],_0x3bdf6d[_0x7739('0x57')]));if(_0x2c0547[_0x7739('0x42')][_0x7739('0x3d')]){_0x442dfd[_0x7739('0xd1')]=_['merge'](_0x442dfd['where'],{'$or':_[_0x7739('0x35')](_0x442dfd[_0x7739('0x47')],function(_0x2c0058){var _0x2b3de9={};_0x2b3de9[_0x2c0058]={'$like':'%'+_0x2c0547['query'][_0x7739('0x3d')]+'%'};return _0x2b3de9;})});}_0x442dfd=_[_0x7739('0x5b')]({},_0x442dfd,_0x2c0547[_0x7739('0x5c')]);return _0x4d2694['getTeams'](_0x442dfd);}})[_0x7739('0x2a')](function(_0xe911eb){if(_0xe911eb){_0x43e269=_0xe911eb[_0x7739('0x4b')];if(!_0x2c0547['query'][_0x7739('0xd3')]('nolimit')){_0x442dfd[_0x7739('0x24')]=qs[_0x7739('0x24')](_0x2c0547[_0x7739('0x42')][_0x7739('0x24')]);_0x442dfd[_0x7739('0x23')]=qs['offset'](_0x2c0547[_0x7739('0x42')][_0x7739('0x23')]);}return _0x4d2694[_0x7739('0x111')](_0x442dfd);}})[_0x7739('0x2a')](function(_0x539077){if(_0x539077){return _0x539077?{'count':_0x43e269,'rows':_0x539077}:null;}})['then'](respondWithResult(_0x43a283,null))[_0x7739('0x1f')](handleError(_0x43a283,null));};exports[_0x7739('0x112')]=function(_0x349f55,_0x41f14e){var _0x52f13b=_0x349f55[_0x7739('0x53')]['id'];var _0x4076f2=_0x349f55[_0x7739('0x60')]?_0x349f55[_0x7739('0x60')][_0x7739('0xa5')]:null;var _0x578c30=[];return Promise[_0x7739('0x102')]()[_0x7739('0x2a')](function(){if(!_0x4076f2)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x7739('0x2a')](function(){return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x52f13b}});})[_0x7739('0x2a')](function(_0xbe8049){if(!_0xbe8049)throw new APINotFoundError(util[_0x7739('0xac')]('User\x20with\x20id\x20%s\x20not\x20found',_0x349f55[_0x7739('0x53')]['id']));return db[_0x7739('0x113')]['transaction'](function(_0x5c7d7e){return _0xbe8049[_0x7739('0x112')](_0x4076f2,{'transaction':_0x5c7d7e})[_0x7739('0x2a')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x4076f2}}});})['then'](function(_0x2e2fae){var _0x2a4b44=_[_0x7739('0x35')](_0x2e2fae,function(_0x149230){return _0x149230[_0x7739('0x114')]();});return Promise[_0x7739('0x51')](_0x2a4b44);})[_0x7739('0x2a')](function(_0x133ab4){_0x578c30=_['flattenDeep'](_0x133ab4);var _0x1a316a=_[_0x7739('0x35')](_0x578c30,function(_0x1d40c8){return _0x1d40c8[_0x7739('0x115')](_0xbe8049['id'],{'transaction':_0x5c7d7e});});return Promise['all'](_0x1a316a);})[_0x7739('0x2a')](function(){if(!_0xbe8049['online'])return;var _0x4a7a8c=_[_0x7739('0x3d')](_0x578c30,function(_0x223313){return _0x223313[_0x7739('0x116')]('channel')===_0x7739('0x117');});var _0x2b7ec0=_[_0x7739('0x35')](_0x4a7a8c,function(_0x4e5e29){return db['UserVoiceQueueRt'][_0x7739('0xae')]({'membername':_0xbe8049[_0x7739('0x38')],'UserId':_0xbe8049['id'],'queue_name':_0x4e5e29[_0x7739('0x38')],'VoiceQueueId':_0x4e5e29['id'],'interface':_['isNil'](_0xbe8049[_0x7739('0xa0')])?util[_0x7739('0xac')]('SIP/%s',_0xbe8049['name']):_0xbe8049[_0x7739('0xa0')],'paused':_0xbe8049[_0x7739('0x109')]||![],'penalty':_0xbe8049[_0x7739('0xa6')]},{'transaction':_0x5c7d7e});});return Promise[_0x7739('0x51')](_0x2b7ec0);})[_0x7739('0x2a')](function(){return db[_0x7739('0x118')][_0x7739('0x8d')]({'where':{'teamId':{'$in':_0x4076f2}}});})[_0x7739('0x2a')](function(_0x47103f){var _0x28bd15=_['map'](_0x47103f,function(_0x2a9e16){return db[_0x7739('0x119')]['create']({'UserId':_0xbe8049['id'],'VoicePrefixId':_0x2a9e16[_0x7739('0x11a')]},{'transaction':_0x5c7d7e});});return Promise['all'](_0x28bd15);});});})[_0x7739('0x2a')](function(){for(var _0x7d7367=0x0;_0x7d7367<_0x578c30[_0x7739('0x4b')];_0x7d7367++){var _0x45f259=_0x578c30[_0x7d7367][_0x7739('0x116')](_0x7739('0xb0'));var _0x32e52c=_0x45f259+_0x7739('0xa8');socket[_0x7739('0x2b')](_0x7739('0x31')+_0x45f259+'Queue:save',{'UserId':_0x52f13b,['queueField']:_0x578c30[_0x7d7367]['id']});}})[_0x7739('0x2a')](respondWithStatusCode(_0x41f14e,null))[_0x7739('0x1f')](APIHandleError(_0x41f14e));};exports[_0x7739('0x11b')]=function(_0x21349c,_0x366043){var _0x146799=_0x21349c['params']['id'];var _0xe514dd=null;if(_0x21349c[_0x7739('0x42')][_0x7739('0xa5')]){_0xe514dd=_[_0x7739('0xb3')](_0x21349c['query'][_0x7739('0xa5')])?_0x21349c[_0x7739('0x42')]['ids']:[_0x21349c['query'][_0x7739('0xa5')]];}var _0x4a76b9=[];return Promise[_0x7739('0x102')]()['then'](function(){if(!_0xe514dd)throw new APIBadRequestError(_0x7739('0x11c'));})['then'](function(){return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x146799}});})[_0x7739('0x2a')](function(_0x3f9ad4){if(!_0x3f9ad4)throw new APINotFoundError(util[_0x7739('0xac')](_0x7739('0x110'),_0x21349c[_0x7739('0x53')]['id']));return db[_0x7739('0x113')][_0x7739('0x11d')](function(_0x31fceb){return _0x3f9ad4[_0x7739('0x11b')](_0xe514dd,{'transaction':_0x31fceb})[_0x7739('0x2a')](function(){return db[_0x7739('0x11e')]['findAll']({'where':{'id':{'$in':_0xe514dd}}});})[_0x7739('0x2a')](function(_0x24c7c2){var _0x27f1b4=_[_0x7739('0x35')](_0x24c7c2,function(_0x49205b){return _0x49205b['getAssociatedQueues']();});return Promise[_0x7739('0x51')](_0x27f1b4);})[_0x7739('0x2a')](function(_0x424727){_0x4a76b9=_[_0x7739('0x11f')](_0x424727);var _0x5ae216=_[_0x7739('0x35')](_0x4a76b9,function(_0x4c9ca2){return _0x4c9ca2[_0x7739('0x120')](_0x3f9ad4['id'],{'transaction':_0x31fceb});});return Promise[_0x7739('0x51')](_0x5ae216);})[_0x7739('0x2a')](function(){if(!_0x3f9ad4[_0x7739('0x9e')])return;var _0x3d29a2=_[_0x7739('0x3d')](_0x4a76b9,function(_0xa569d7){return _0xa569d7['getDataValue'](_0x7739('0xb0'))===_0x7739('0x117');});var _0x57b6b7=_['map'](_0x3d29a2,function(_0x4de6d0){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4de6d0['id'],'UserId':_0x3f9ad4['id']},'transaction':_0x31fceb});});return Promise['all'](_0x57b6b7);})[_0x7739('0x2a')](function(){return db[_0x7739('0x118')]['findAll']({'where':{'teamId':{'$in':_0xe514dd}}});})[_0x7739('0x2a')](function(_0x475ad0){var _0x21592e=_[_0x7739('0x35')](_0x475ad0,function(_0x560523){return db[_0x7739('0x119')][_0x7739('0x2c')]({'where':{'UserId':_0x3f9ad4['id'],'VoicePrefixId':_0x560523[_0x7739('0x11a')]}},{'transaction':_0x31fceb});});return Promise[_0x7739('0x51')](_0x21592e);});});})[_0x7739('0x2a')](function(){for(var _0xa6575=0x0;_0xa6575<_0x4a76b9[_0x7739('0x4b')];_0xa6575++){var _0x509988=_0x4a76b9[_0xa6575][_0x7739('0x116')](_0x7739('0xb0'));var _0x18ff22=_0x509988+'QueueId';socket[_0x7739('0x2b')]('user'+_0x509988+_0x7739('0xb4'),{'UserId':_0x146799,['queueField']:_0x4a76b9[_0xa6575]['id']});}})[_0x7739('0x2a')](respondWithStatusCode(_0x366043,null))[_0x7739('0x1f')](APIHandleError(_0x366043));};exports['getLists']=function(_0x197a7a,_0x54d5d4){var _0x129600={};var _0x317e53={};var _0x2c9b17;var _0x3b90a;return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x197a7a['params']['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x54d5d4,null))[_0x7739('0x2a')](function(_0x4408ad){if(_0x4408ad){_0x2c9b17=_0x4408ad;_0x317e53[_0x7739('0x54')]=_[_0x7739('0xcc')](db[_0x7739('0xd4')][_0x7739('0x56')]);_0x317e53[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x197a7a[_0x7739('0x42')]);_0x317e53[_0x7739('0x57')]=_[_0x7739('0x58')](_0x317e53[_0x7739('0x54')],_0x317e53['query']);_0x129600['attributes']=_[_0x7739('0x58')](_0x317e53[_0x7739('0x54')],qs[_0x7739('0x59')](_0x197a7a['query'][_0x7739('0x59')]));_0x129600['attributes']=_0x129600[_0x7739('0x47')][_0x7739('0x4b')]?_0x129600[_0x7739('0x47')]:_0x317e53['model'];_0x129600[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0x197a7a[_0x7739('0x42')][_0x7739('0xcf')]);_0x129600[_0x7739('0xd1')]=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0x197a7a[_0x7739('0x42')],_0x317e53[_0x7739('0x57')]));if(_0x197a7a[_0x7739('0x42')][_0x7739('0x3d')]){_0x129600[_0x7739('0xd1')]=_[_0x7739('0x5b')](_0x129600['where'],{'$or':_[_0x7739('0x35')](_0x129600[_0x7739('0x47')],function(_0x126e7f){var _0x2e1793={};_0x2e1793[_0x126e7f]={'$like':'%'+_0x197a7a[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x2e1793;})});}_0x129600=_['merge']({},_0x129600,_0x197a7a[_0x7739('0x5c')]);return _0x2c9b17[_0x7739('0x121')](_0x129600);}})[_0x7739('0x2a')](function(_0x5834a6){if(_0x5834a6){_0x3b90a=_0x5834a6[_0x7739('0x4b')];if(!_0x197a7a['query'][_0x7739('0xd3')]('nolimit')){_0x129600['limit']=qs[_0x7739('0x24')](_0x197a7a[_0x7739('0x42')][_0x7739('0x24')]);_0x129600[_0x7739('0x23')]=qs[_0x7739('0x23')](_0x197a7a[_0x7739('0x42')][_0x7739('0x23')]);}return _0x2c9b17[_0x7739('0x121')](_0x129600);}})['then'](function(_0x5066fa){if(_0x5066fa){return _0x5066fa?{'count':_0x3b90a,'rows':_0x5066fa}:null;}})[_0x7739('0x2a')](respondWithResult(_0x54d5d4,null))[_0x7739('0x1f')](handleError(_0x54d5d4,null));};exports[_0x7739('0x122')]=function(_0x6a87d4,_0x1c93a5){var _0x17cfd8={};var _0x4cdcd3={};var _0x1e60e5;return db[_0x7739('0x3a')][_0x7739('0x99')]({'where':{'id':_0x6a87d4[_0x7739('0x53')]['id']}})[_0x7739('0x2a')](handleEntityNotFound(_0x1c93a5,null))[_0x7739('0x2a')](function(_0x2ae41e){if(_0x2ae41e){_0x1e60e5=_0x2ae41e;_0x4cdcd3[_0x7739('0x54')]=_[_0x7739('0xcc')](db['User']['rawAttributes']);_0x4cdcd3[_0x7739('0x42')]=_[_0x7739('0xcc')](_0x6a87d4['query']);_0x4cdcd3['filters']=_[_0x7739('0x58')](_0x4cdcd3[_0x7739('0x54')],_0x4cdcd3[_0x7739('0x42')]);_0x17cfd8[_0x7739('0x47')]=_[_0x7739('0x58')](_0x4cdcd3[_0x7739('0x54')],qs[_0x7739('0x59')](_0x6a87d4[_0x7739('0x42')][_0x7739('0x59')]));_0x17cfd8[_0x7739('0x47')]=_0x17cfd8[_0x7739('0x47')][_0x7739('0x4b')]?_0x17cfd8['attributes']:_0x4cdcd3[_0x7739('0x54')];_0x17cfd8[_0x7739('0xce')]=qs[_0x7739('0xcf')](_0x6a87d4[_0x7739('0x42')][_0x7739('0xcf')]);_0x17cfd8[_0x7739('0xd1')]=qs[_0x7739('0x57')](_[_0x7739('0xd0')](_0x6a87d4[_0x7739('0x42')],_0x4cdcd3[_0x7739('0x57')]));if(_0x6a87d4[_0x7739('0x42')][_0x7739('0x3d')]){_0x17cfd8[_0x7739('0xd1')]=_[_0x7739('0x5b')](_0x17cfd8[_0x7739('0xd1')],{'$or':_[_0x7739('0x35')](_0x17cfd8[_0x7739('0x47')],function(_0x3dcbaa){var _0x5d624f={};_0x5d624f[_0x3dcbaa]={'$like':'%'+_0x6a87d4[_0x7739('0x42')][_0x7739('0x3d')]+'%'};return _0x5d624f;})});}_0x17cfd8[_0x7739('0x54')]=db['User'];_0x17cfd8['as']='Agents';_0x17cfd8=_[_0x7739('0x5b')]({},_0x17cfd8,_0x6a87d4[_0x7739('0x5c')]);return _0x1e60e5[_0x7739('0x123')]({'include':[_0x17cfd8]});}})['then'](function(_0x2a28ef){if(_0x2a28ef){var _0x5cf504={},_0x4ecce6=[];for(var _0x440fcf=0x0;_0x440fcf<_0x2a28ef['length'];_0x440fcf+=0x1){for(var _0x405e94=0x0,_0x275847;_0x405e94<_0x2a28ef[_0x440fcf][_0x7739('0x32')][_0x7739('0x4b')];_0x405e94+=0x1){_0x275847=_0x2a28ef[_0x440fcf]['Agents'][_0x405e94]['get']({'plain':!![]});_0x5cf504[_0x275847['id']]=_0x275847;}}_0x5cf504=_['values'](_0x5cf504);for(var _0x540752=qs['offset'](_0x6a87d4[_0x7739('0x42')][_0x7739('0x23')]);_0x540752<_0x5cf504[_0x7739('0x4b')]&&_0x4ecce6[_0x7739('0x4b')]=_0x458e2b['agents']){throw new Error(_0xbf30('0x47'));}})['then'](function(){if(_0x19293d){return db['UserVoiceQueueRt'][_0xbf30('0x3d')]({'where':{'membername':_0x19293d[_0xbf30('0x1f')]},'individualHooks':!![]});}})[_0xbf30('0x1b')](function(){if(_0x19293d){return _0x19293d[_0xbf30('0x48')]({'raw':!![]});}})[_0xbf30('0x1b')](function(_0x5ba6b8){if(_0x19293d){if(_0x5ba6b8){var _0x526ce7=[];_0x9fbb94=_0x5ba6b8;if(_0x9fbb94[_0xbf30('0x24')]){for(var _0x2a5305=0x0;_0x2a5305<_0x9fbb94[_0xbf30('0x24')];_0x2a5305++){_0x526ce7[_0xbf30('0x27')](db[_0xbf30('0x21')][_0xbf30('0x49')]({'membername':_0x19293d[_0xbf30('0x1f')],'UserId':_0x19293d['id'],'queue_name':_0x9fbb94[_0x2a5305][_0xbf30('0x1f')],'VoiceQueueId':_0x9fbb94[_0x2a5305]['id'],'interface':_0x4aa0f2,'paused':_0x19293d[_0xbf30('0x40')]||![],'penalty':_0x9fbb94[_0x2a5305][_0xbf30('0x4a')]||0x0}));}return BPromise['all'](_0x526ce7);}}}})[_0xbf30('0x1b')](function(){if(_0x19293d){return db[_0xbf30('0x23')]['findAll']({'where':{'membername':_0x19293d[_0xbf30('0x1f')],'exitAt':null}});}})[_0xbf30('0x1b')](function(_0x474cb1){if(_0x19293d){if(_0x474cb1&&_0x474cb1[_0xbf30('0x24')]){var _0x499826=[];_0x474cb1[_0xbf30('0x4b')](function(_0x54047a){_0x499826[_0xbf30('0x27')](_0x54047a[_0xbf30('0x22')]({'exitAt':moment()[_0xbf30('0x25')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xbf30('0x4c')](_0x499826);}}})[_0xbf30('0x1b')](function(){if(_0x19293d){var _0x48ff21=[];var _0x2ff29c=[];var _0x12b9ce=utils[_0xbf30('0x4d')]();var _0x4b64ef={'membername':_0x19293d[_0xbf30('0x1f')],'interface':_0x4aa0f2,'enterAt':moment()['format'](_0xbf30('0x26')),'role':_0x19293d['role'],'internal':_0x19293d[_0xbf30('0x20')]};_0x12b9ce[_0xbf30('0x4b')](function(_0x402a60){_0x48ff21[_0xbf30('0x27')](_[_0xbf30('0x4e')]({'channel':_0x402a60,'type':'LOGIN','data1':'callysquare','data2':_0x4aa0f2},_0x4b64ef));if(_0x19293d['loginInPause']){_0x2ff29c['push'](_[_0xbf30('0x4e')]({'channel':_0x402a60,'type':'PAUSE','data1':_0xbf30('0x4f')},_0x4b64ef));}});return db[_0xbf30('0x23')][_0xbf30('0x50')](_0x48ff21[_0xbf30('0x51')](_0x2ff29c),{'individualHooks':!![]});}})[_0xbf30('0x1b')](function(){if(_0x19293d){return _0x19293d[_0xbf30('0x22')]({'online':!![],'lastLoginAt':moment()[_0xbf30('0x25')](_0xbf30('0x26')),'voicePause':_0x19293d[_0xbf30('0x40')]||![],'mailPause':_0x19293d[_0xbf30('0x40')]||![],'chatPause':_0x19293d[_0xbf30('0x40')]||![],'faxPause':_0x19293d[_0xbf30('0x40')]||![],'smsPause':_0x19293d[_0xbf30('0x40')]||![],'openchannelPause':_0x19293d['loginInPause']||![],'pauseType':_0x19293d[_0xbf30('0x40')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xbf30('0x25')](_0xbf30('0x26')),'interface':_0x4aa0f2});}})['then'](function(_0x3ce651){_0x5561f5(_0x3ce651);})[_0xbf30('0x17')](function(_0x956fb3){_0x5422bb(_0x123885['error'](0x1f4,_0x956fb3[_0xbf30('0x19')]));});});}; \ No newline at end of file +var _0x3cdd=['whatsappPause','pauseType','lastPauseAt','params','unpause','system','findOne','all','LoginUser','phone','SIP/%s','count','agent','../../config/license/util','getLicense','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','forEach','getChannels','merge','LOGIN','callysquare','loginInPause','LOGININPAUSE','bulkCreate','concat','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','defaults','localhost','socket.io-emitter','redis','./user.socket','register','GetUser','User','findAll','options','raw','where','attributes','include','model','map','then','catch','message','error','ShowUser','find','info','debug','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','push','isNil','PAUSE','body','type','DEFAULT\x20PAUSE','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','chatPause','smsPause'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x3cdd,0x1c5));var _0xd3cd=function(_0x2ec012,_0x267e02){_0x2ec012=_0x2ec012-0x0;var _0x41f767=_0x3cdd[_0x2ec012];return _0x41f767;};'use strict';var _=require('lodash');var util=require(_0xd3cd('0x0'));var moment=require(_0xd3cd('0x1'));var BPromise=require(_0xd3cd('0x2'));var Redis=require(_0xd3cd('0x3'));var db=require(_0xd3cd('0x4'))['db'];var utils=require(_0xd3cd('0x5'));var logger=require('../../config/logger')(_0xd3cd('0x6'));var config=require('../../config/environment');config['redis']=_[_0xd3cd('0x7')](config['redis'],{'host':_0xd3cd('0x8'),'port':0x18eb});var socket=require(_0xd3cd('0x9'))(new Redis(config[_0xd3cd('0xa')]));require(_0xd3cd('0xb'))[_0xd3cd('0xc')](socket);exports[_0xd3cd('0xd')]=function(_0x5be125){var _0x3db7af=this;return new Promise(function(_0x18c914,_0x438547){return db[_0xd3cd('0xe')][_0xd3cd('0xf')]({'raw':_0x5be125[_0xd3cd('0x10')]?_0x5be125[_0xd3cd('0x10')][_0xd3cd('0x11')]===undefined?!![]:![]:!![],'where':_0x5be125[_0xd3cd('0x10')]?_0x5be125['options'][_0xd3cd('0x12')]||null:null,'attributes':_0x5be125[_0xd3cd('0x10')]?_0x5be125[_0xd3cd('0x10')][_0xd3cd('0x13')]||null:null,'limit':_0x5be125[_0xd3cd('0x10')]?_0x5be125['options']['limit']||null:null,'include':_0x5be125[_0xd3cd('0x10')]?_0x5be125['options'][_0xd3cd('0x14')]?_['map'](_0x5be125[_0xd3cd('0x10')][_0xd3cd('0x14')],function(_0x3a2dd7){return{'model':db[_0x3a2dd7[_0xd3cd('0x15')]],'as':_0x3a2dd7['as'],'attributes':_0x3a2dd7['attributes'],'include':_0x3a2dd7['include']?_[_0xd3cd('0x16')](_0x3a2dd7[_0xd3cd('0x14')],function(_0x409687){return{'model':db[_0x409687['model']],'as':_0x409687['as'],'attributes':_0x409687[_0xd3cd('0x13')],'include':_0x409687[_0xd3cd('0x14')]?_['map'](_0x409687[_0xd3cd('0x14')],function(_0x446026){return{'model':db[_0x446026[_0xd3cd('0x15')]],'as':_0x446026['as'],'attributes':_0x446026[_0xd3cd('0x13')]};}):[]};}):[]};}):[]:[]})[_0xd3cd('0x17')](function(_0x26b69a){logger['info'](_0xd3cd('0xd'),_0x5be125);logger['debug'](_0xd3cd('0xd'),_0x5be125,JSON['stringify'](_0x26b69a));_0x18c914(_0x26b69a);})[_0xd3cd('0x18')](function(_0x41e842){logger['error'](_0xd3cd('0xd'),_0x41e842[_0xd3cd('0x19')],_0x5be125);_0x438547(_0x3db7af[_0xd3cd('0x1a')](0x1f4,_0x41e842[_0xd3cd('0x19')]));});});};exports[_0xd3cd('0x1b')]=function(_0x28bf97){var _0x47451a=this;return new Promise(function(_0x381195,_0x447b5d){return db[_0xd3cd('0xe')][_0xd3cd('0x1c')]({'raw':_0x28bf97[_0xd3cd('0x10')]?_0x28bf97[_0xd3cd('0x10')]['raw']===undefined?!![]:![]:!![],'where':_0x28bf97[_0xd3cd('0x10')]?_0x28bf97[_0xd3cd('0x10')][_0xd3cd('0x12')]||null:null,'attributes':_0x28bf97['options']?_0x28bf97[_0xd3cd('0x10')][_0xd3cd('0x13')]||null:null,'include':_0x28bf97[_0xd3cd('0x10')]?_0x28bf97[_0xd3cd('0x10')][_0xd3cd('0x14')]?_['map'](_0x28bf97['options'][_0xd3cd('0x14')],function(_0x1bbf47){return{'model':db[_0x1bbf47[_0xd3cd('0x15')]],'as':_0x1bbf47['as'],'attributes':_0x1bbf47[_0xd3cd('0x13')],'include':_0x1bbf47[_0xd3cd('0x14')]?_[_0xd3cd('0x16')](_0x1bbf47['include'],function(_0x432b8e){return{'model':db[_0x432b8e[_0xd3cd('0x15')]],'as':_0x432b8e['as'],'attributes':_0x432b8e[_0xd3cd('0x13')],'include':_0x432b8e[_0xd3cd('0x14')]?_[_0xd3cd('0x16')](_0x432b8e[_0xd3cd('0x14')],function(_0x57223b){return{'model':db[_0x57223b[_0xd3cd('0x15')]],'as':_0x57223b['as'],'attributes':_0x57223b[_0xd3cd('0x13')]};}):[]};}):[]};}):[]:[]})[_0xd3cd('0x17')](function(_0x27b2b2){logger[_0xd3cd('0x1d')](_0xd3cd('0x1b'),_0x28bf97);logger[_0xd3cd('0x1e')](_0xd3cd('0x1b'),_0x28bf97,JSON['stringify'](_0x27b2b2));_0x381195(_0x27b2b2);})['catch'](function(_0xafe8e4){logger[_0xd3cd('0x1a')](_0xd3cd('0x1b'),_0xafe8e4[_0xd3cd('0x19')],_0x28bf97);_0x447b5d(_0x47451a[_0xd3cd('0x1a')](0x1f4,_0xafe8e4['message']));});});};exports[_0xd3cd('0x1f')]=function(_0x1de9ad){var _0x1ac760=this;return new Promise(function(_0x12a733,_0x3191c5){var _0x1c3e4a;return db['User']['find']({'where':_0x1de9ad['options'][_0xd3cd('0x12')]||{},'attributes':['id',_0xd3cd('0x20'),_0xd3cd('0x21'),_0xd3cd('0x22'),_0xd3cd('0x23')]})[_0xd3cd('0x17')](function(_0x1eec5d){if(_0x1eec5d){_0x1c3e4a=_0x1eec5d;return db[_0xd3cd('0x24')][_0xd3cd('0x25')]({'paused':0x1},{'where':{'UserId':_0x1c3e4a['id']},'individualHooks':!![]});}})[_0xd3cd('0x17')](function(){if(_0x1c3e4a){return db[_0xd3cd('0x26')]['findAll']({'where':{'membername':_0x1c3e4a[_0xd3cd('0x20')],'type':'PAUSE','exitAt':null}});}})[_0xd3cd('0x17')](function(_0x2696bd){if(_0x1c3e4a){if(_0x2696bd&&_0x2696bd[_0xd3cd('0x27')]){var _0x54365e=moment()[_0xd3cd('0x28')](_0xd3cd('0x29'));for(var _0x516c1b=0x0,_0x3d97ac=_0x2696bd[_0xd3cd('0x27')];_0x516c1b<_0x3d97ac;_0x516c1b++){_0x2696bd[_0x516c1b]['updateAttributes']({'exitAt':_0x54365e});}}}})[_0xd3cd('0x17')](function(){if(_0x1c3e4a){var _0x4969dd=[];var _0xe3e445=utils['getChannels']();_0xe3e445['forEach'](function(_0x5e0584){_0x4969dd[_0xd3cd('0x2a')]({'channel':_0x5e0584,'membername':_0x1c3e4a[_0xd3cd('0x20')],'interface':_[_0xd3cd('0x2b')](_0x1c3e4a[_0xd3cd('0x23')])?util['format']('SIP/%s',_0x1c3e4a[_0xd3cd('0x20')]):_0x1c3e4a[_0xd3cd('0x23')],'type':_0xd3cd('0x2c'),'enterAt':moment()[_0xd3cd('0x28')](_0xd3cd('0x29')),'data1':_0x1de9ad[_0xd3cd('0x2d')][_0xd3cd('0x2e')]||'DEFAULT\x20PAUSE','role':_0x1c3e4a[_0xd3cd('0x21')],'internal':_0x1c3e4a[_0xd3cd('0x22')],'uniqueid':_0x1de9ad['body']['uniqueid']||null});});return db[_0xd3cd('0x26')]['bulkCreate'](_0x4969dd,{'individualHooks':!![]});}})[_0xd3cd('0x17')](function(){if(_0x1c3e4a){return _0x1c3e4a[_0xd3cd('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x1de9ad['body']['type']||_0xd3cd('0x2f'),'lastPauseAt':moment()[_0xd3cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x52bf66){_0x12a733(_0x52bf66);})['catch'](function(_0x424b83){_0x3191c5(_0x1ac760[_0xd3cd('0x1a')](0x1f4,_0x424b83[_0xd3cd('0x19')]));});});};exports[_0xd3cd('0x30')]=function(_0x500bc1){var _0x492943=this;return new Promise(function(_0x3273b4,_0x2cd107){if(_0x500bc1['body'][_0xd3cd('0x31')]&&!utils[_0xd3cd('0x32')](_0x500bc1[_0xd3cd('0x2d')]['channel'])){throw new Error(util[_0xd3cd('0x28')](_0xd3cd('0x33'),_0x500bc1[_0xd3cd('0x2d')][_0xd3cd('0x31')]));}return db[_0xd3cd('0xe')]['findOne']({'where':_0x500bc1[_0xd3cd('0x10')]['where']||{},'attributes':['id',_0xd3cd('0x20'),_0xd3cd('0x21'),_0xd3cd('0x22'),'interface',_0xd3cd('0x34'),_0xd3cd('0x35'),_0xd3cd('0x36'),_0xd3cd('0x37'),'faxPause','openchannelPause',_0xd3cd('0x38'),_0xd3cd('0x39'),_0xd3cd('0x3a'),_0xd3cd('0x3b')]})[_0xd3cd('0x17')](function(_0x182590){if(!_0x182590){throw new Error(util[_0xd3cd('0x28')]('User\x20with\x20id\x20%s\x20not\x20found',_0x500bc1[_0xd3cd('0x3c')]['id']));}return _0x182590[_0xd3cd('0x3d')](_0x500bc1['body']['channel'],_0xd3cd('0x3e'));})[_0xd3cd('0x17')](function(_0x1ad72f){_0x3273b4(_0x1ad72f);})[_0xd3cd('0x18')](function(_0x1018bf){_0x2cd107(_0x492943[_0xd3cd('0x1a')](0x1f4,_0x1018bf[_0xd3cd('0x19')]));});});};exports['LogoutUser']=function(_0x29ac77){var _0x1e6067=this;return new Promise(function(_0x37429f,_0x147f76){var _0x515dd5;return db['User'][_0xd3cd('0x3f')]({'where':_0x29ac77[_0xd3cd('0x10')][_0xd3cd('0x12')]||{},'attributes':['id','name']})['then'](function(_0x8cfa0d){if(_0x8cfa0d){_0x515dd5=_0x8cfa0d;return db[_0xd3cd('0x24')]['destroy']({'where':{'membername':_0x515dd5[_0xd3cd('0x20')]},'individualHooks':!![]});}})[_0xd3cd('0x17')](function(){if(_0x515dd5){return db[_0xd3cd('0x26')]['findAll']({'where':{'membername':_0x515dd5[_0xd3cd('0x20')],'exitAt':null}});}})[_0xd3cd('0x17')](function(_0x2d1388){if(_0x515dd5){if(_0x2d1388&&_0x2d1388[_0xd3cd('0x27')]){var _0x3da05a=[];_0x2d1388['forEach'](function(_0x26ffdb){_0x3da05a['push'](_0x26ffdb[_0xd3cd('0x25')]({'exitAt':moment()[_0xd3cd('0x28')](_0xd3cd('0x29'))}));});return BPromise[_0xd3cd('0x40')](_0x3da05a);}}})[_0xd3cd('0x17')](function(){if(_0x515dd5){return _0x515dd5[_0xd3cd('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x126997){_0x37429f(_0x126997);})[_0xd3cd('0x18')](function(_0x49e5e4){_0x147f76(_0x1e6067['error'](0x1f4,_0x49e5e4[_0xd3cd('0x19')]));});});};exports[_0xd3cd('0x41')]=function(_0x4de535){var _0x2c69a8=this;return new Promise(function(_0xb9a8ba,_0x444ab7){var _0x3d2654;var _0x4c78c1;var _0x4e3d23;var _0x43c667;return db[_0xd3cd('0xe')][_0xd3cd('0x3f')]({'where':_0x4de535[_0xd3cd('0x10')]['where']||{},'attributes':['id',_0xd3cd('0x20'),_0xd3cd('0x21'),'mobile',_0xd3cd('0x42'),_0xd3cd('0x22'),'loginInPause','interface']})['then'](function(_0x4b9989){if(_0x4b9989){_0x3d2654=_0x4b9989;_0x43c667=_0x4de535[_0xd3cd('0x2d')][_0xd3cd('0x23')]?_0x4de535[_0xd3cd('0x2d')][_0xd3cd('0x23')]:util[_0xd3cd('0x28')](_0xd3cd('0x43'),_0x3d2654[_0xd3cd('0x20')]);return db[_0xd3cd('0xe')][_0xd3cd('0x44')]({'where':{'role':_0xd3cd('0x45'),'online':!![],'id':{'$ne':_0x3d2654['id']}}});}})[_0xd3cd('0x17')](function(_0x10e8b4){if(_0x10e8b4){_0x4e3d23=_0x10e8b4;return require(_0xd3cd('0x46'))[_0xd3cd('0x47')]();}})[_0xd3cd('0x17')](function(_0x439d8d){if(_0x439d8d&&_0x439d8d['agents']&&_0x4e3d23>=_0x439d8d['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xd3cd('0x17')](function(){if(_0x3d2654){return db[_0xd3cd('0x24')][_0xd3cd('0x48')]({'where':{'membername':_0x3d2654[_0xd3cd('0x20')]},'individualHooks':!![]});}})[_0xd3cd('0x17')](function(){if(_0x3d2654){return _0x3d2654[_0xd3cd('0x49')]({'raw':!![]});}})[_0xd3cd('0x17')](function(_0x136568){if(_0x3d2654){if(_0x136568){var _0x49718e=[];_0x4c78c1=_0x136568;if(_0x4c78c1[_0xd3cd('0x27')]){for(var _0x32c5ca=0x0;_0x32c5ca<_0x4c78c1[_0xd3cd('0x27')];_0x32c5ca++){_0x49718e[_0xd3cd('0x2a')](db[_0xd3cd('0x24')][_0xd3cd('0x4a')]({'membername':_0x3d2654[_0xd3cd('0x20')],'UserId':_0x3d2654['id'],'queue_name':_0x4c78c1[_0x32c5ca]['name'],'VoiceQueueId':_0x4c78c1[_0x32c5ca]['id'],'interface':_0x43c667,'paused':_0x3d2654['loginInPause']||![],'penalty':_0x4c78c1[_0x32c5ca][_0xd3cd('0x4b')]||0x0}));}return BPromise[_0xd3cd('0x40')](_0x49718e);}}}})['then'](function(){if(_0x3d2654){return db[_0xd3cd('0x26')]['findAll']({'where':{'membername':_0x3d2654[_0xd3cd('0x20')],'exitAt':null}});}})[_0xd3cd('0x17')](function(_0x54035c){if(_0x3d2654){if(_0x54035c&&_0x54035c['length']){var _0x57979d=[];_0x54035c[_0xd3cd('0x4c')](function(_0x38ac15){_0x57979d['push'](_0x38ac15[_0xd3cd('0x25')]({'exitAt':moment()[_0xd3cd('0x28')](_0xd3cd('0x29'))}));});return BPromise[_0xd3cd('0x40')](_0x57979d);}}})['then'](function(){if(_0x3d2654){var _0x2b3949=[];var _0xa155d7=[];var _0x192034=utils[_0xd3cd('0x4d')]();var _0x288c4f={'membername':_0x3d2654[_0xd3cd('0x20')],'interface':_0x43c667,'enterAt':moment()[_0xd3cd('0x28')](_0xd3cd('0x29')),'role':_0x3d2654[_0xd3cd('0x21')],'internal':_0x3d2654['internal']};_0x192034[_0xd3cd('0x4c')](function(_0x541a14){_0x2b3949[_0xd3cd('0x2a')](_[_0xd3cd('0x4e')]({'channel':_0x541a14,'type':_0xd3cd('0x4f'),'data1':_0xd3cd('0x50'),'data2':_0x43c667},_0x288c4f));if(_0x3d2654[_0xd3cd('0x51')]){_0xa155d7[_0xd3cd('0x2a')](_[_0xd3cd('0x4e')]({'channel':_0x541a14,'type':'PAUSE','data1':_0xd3cd('0x52')},_0x288c4f));}});return db[_0xd3cd('0x26')][_0xd3cd('0x53')](_0x2b3949[_0xd3cd('0x54')](_0xa155d7),{'individualHooks':!![]});}})[_0xd3cd('0x17')](function(){if(_0x3d2654){return _0x3d2654[_0xd3cd('0x25')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3d2654[_0xd3cd('0x51')]||![],'mailPause':_0x3d2654[_0xd3cd('0x51')]||![],'chatPause':_0x3d2654[_0xd3cd('0x51')]||![],'faxPause':_0x3d2654[_0xd3cd('0x51')]||![],'smsPause':_0x3d2654['loginInPause']||![],'openchannelPause':_0x3d2654['loginInPause']||![],'pauseType':_0x3d2654[_0xd3cd('0x51')]?_0xd3cd('0x52'):null,'lastPauseAt':moment()[_0xd3cd('0x28')](_0xd3cd('0x29')),'interface':_0x43c667});}})[_0xd3cd('0x17')](function(_0x27f45f){_0xb9a8ba(_0x27f45f);})[_0xd3cd('0x18')](function(_0x51b83a){_0x444ab7(_0x2c69a8[_0xd3cd('0x1a')](0x1f4,_0x51b83a[_0xd3cd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index e94b177..a4adb32 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 _0xc4f8=['remove','update','emit','register','length','user:','./user.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc4f8,0x172));var _0x8c4f=function(_0x3810fd,_0x4e95a9){_0x3810fd=_0x3810fd-0x0;var _0x141a81=_0xc4f8[_0x3810fd];return _0x141a81;};'use strict';var UserEvents=require(_0x8c4f('0x0'));var events=['save',_0x8c4f('0x1'),_0x8c4f('0x2')];function createListener(_0x3f97c7,_0x201d3d){return function(_0x406947){_0x201d3d[_0x8c4f('0x3')](_0x3f97c7,_0x406947);};}function removeListener(_0xea073b,_0x4151d1){return function(){UserEvents['removeListener'](_0xea073b,_0x4151d1);};}exports[_0x8c4f('0x4')]=function(_0x17218b){for(var _0x1f0baf=0x0,_0x32dd1d=events[_0x8c4f('0x5')];_0x1f0baf<_0x32dd1d;_0x1f0baf++){var _0x6b40ef=events[_0x1f0baf];var _0x1a0cb1=createListener(_0x8c4f('0x6')+_0x6b40ef,_0x17218b);UserEvents['on'](_0x6b40ef,_0x1a0cb1);}}; \ No newline at end of file +var _0x5e18=['save','update','emit','removeListener','register','length','user:','./user.events'];(function(_0x2b0e3d,_0x159f07){var _0x370d29=function(_0x3ecbb7){while(--_0x3ecbb7){_0x2b0e3d['push'](_0x2b0e3d['shift']());}};_0x370d29(++_0x159f07);}(_0x5e18,0x1d7));var _0x85e1=function(_0x20ca70,_0x4f8102){_0x20ca70=_0x20ca70-0x0;var _0x5368cd=_0x5e18[_0x20ca70];return _0x5368cd;};'use strict';var UserEvents=require(_0x85e1('0x0'));var events=[_0x85e1('0x1'),'remove',_0x85e1('0x2')];function createListener(_0x6a75f,_0x7aeadd){return function(_0x161c28){_0x7aeadd[_0x85e1('0x3')](_0x6a75f,_0x161c28);};}function removeListener(_0x30e5f0,_0x3f47d3){return function(){UserEvents[_0x85e1('0x4')](_0x30e5f0,_0x3f47d3);};}exports[_0x85e1('0x5')]=function(_0x2a1b4b){for(var _0x5a3068=0x0,_0x1f0319=events[_0x85e1('0x6')];_0x5a3068<_0x1f0319;_0x5a3068++){var _0x30821d=events[_0x5a3068];var _0x38bb41=createListener(_0x85e1('0x7')+_0x30821d,_0x2a1b4b);UserEvents['on'](_0x30821d,_0x38bb41);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index abf54ec..6bb5e0d 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x58fdfd,_0x46f063){var _0x3a4613=function(_0x4b6a77){while(--_0x4b6a77){_0x58fdfd['push'](_0x58fdfd['shift']());}};_0x3a4613(++_0x46f063);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1989e2,_0x5a3b47){var _0x218d38=function(_0x572af8){while(--_0x572af8){_0x1989e2['push'](_0x1989e2['shift']());}};_0x218d38(++_0x5a3b47);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index c6ad7bd..80836f3 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 _0xf6ab=['INTEGER'];(function(_0x502e97,_0x497572){var _0x1875b9=function(_0xe7e058){while(--_0xe7e058){_0x502e97['push'](_0x502e97['shift']());}};_0x1875b9(++_0x497572);}(_0xf6ab,0xfe));var _0xbf6a=function(_0x4b63f4,_0xe55d36){_0x4b63f4=_0x4b63f4-0x0;var _0x5907ed=_0xf6ab[_0x4b63f4];return _0x5907ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xbf6a('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4b9c=['sequelize'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x4b9c,0x1c6));var _0xc4b9=function(_0x128483,_0xb7270){_0x128483=_0x128483-0x0;var _0x41fb20=_0x4b9c[_0x128483];return _0x41fb20;};'use strict';var Sequelize=require(_0xc4b9('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 2c58c4f..309c53e 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 _0xdeef=['UserChatQueue','user_has_chat_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0xdeef,0x1ec));var _0xfdee=function(_0x55ec67,_0x1c90d5){_0x55ec67=_0x55ec67-0x0;var _0x1350f6=_0xdeef[_0x55ec67];return _0x1350f6;};'use strict';var _=require(_0xfdee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfdee('0x1'));var moment=require(_0xfdee('0x2'));var BPromise=require(_0xfdee('0x3'));var rp=require(_0xfdee('0x4'));var fs=require('fs');var path=require(_0xfdee('0x5'));var rimraf=require(_0xfdee('0x6'));var config=require(_0xfdee('0x7'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x4248fc,_0x63bc0c){return _0x4248fc['define'](_0xfdee('0x8'),attributes,{'tableName':_0xfdee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c20=['../../config/logger','api','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util'];(function(_0x27f985,_0x7c6d4d){var _0x26c3be=function(_0x1f732d){while(--_0x1f732d){_0x27f985['push'](_0x27f985['shift']());}};_0x26c3be(++_0x7c6d4d);}(_0x9c20,0x133));var _0x09c2=function(_0x1413c4,_0x47f820){_0x1413c4=_0x1413c4-0x0;var _0x1edec3=_0x9c20[_0x1413c4];return _0x1edec3;};'use strict';var _=require('lodash');var util=require(_0x09c2('0x0'));var logger=require(_0x09c2('0x1'))(_0x09c2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x09c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09c2('0x4'));var config=require(_0x09c2('0x5'));var attributes=require(_0x09c2('0x6'));module[_0x09c2('0x7')]=function(_0x523531,_0x33ab0a){return _0x523531[_0x09c2('0x8')](_0x09c2('0x9'),attributes,{'tableName':_0x09c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 4436027..25bdc81 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 _0xe99e=['error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','UserChatQueue,\x20%s,\x20%s','debug','stringify'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0xe99e,0xb6));var _0xee99=function(_0x214c5c,_0x56fd32){_0x214c5c=_0x214c5c-0x0;var _0x15b4c0=_0xe99e[_0x214c5c];return _0x15b4c0;};'use strict';var _=require(_0xee99('0x0'));var util=require(_0xee99('0x1'));var moment=require('moment');var BPromise=require(_0xee99('0x2'));var rs=require(_0xee99('0x3'));var fs=require('fs');var Redis=require(_0xee99('0x4'));var db=require(_0xee99('0x5'))['db'];var utils=require(_0xee99('0x6'));var logger=require(_0xee99('0x7'))('rpc');var config=require(_0xee99('0x8'));var jayson=require(_0xee99('0x9'));var client=jayson[_0xee99('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4771ce,_0x245d98,_0x30d67f){return new BPromise(function(_0x48f377,_0xc5764b){return client[_0xee99('0xb')](_0x4771ce,_0x30d67f)['then'](function(_0x1e214b){logger[_0xee99('0xc')](_0xee99('0xd'),_0x245d98,'request\x20sent');logger[_0xee99('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x245d98,'request\x20sent',JSON[_0xee99('0xf')](_0x1e214b));if(_0x1e214b['error']){if(_0x1e214b[_0xee99('0x10')][_0xee99('0x11')]===0x1f4){logger[_0xee99('0x10')](_0xee99('0xd'),_0x245d98,_0x1e214b[_0xee99('0x10')][_0xee99('0x12')]);return _0xc5764b(_0x1e214b[_0xee99('0x10')][_0xee99('0x12')]);}logger[_0xee99('0x10')](_0xee99('0xd'),_0x245d98,_0x1e214b[_0xee99('0x10')][_0xee99('0x12')]);return _0x48f377(_0x1e214b['error'][_0xee99('0x12')]);}else{logger[_0xee99('0xc')](_0xee99('0xd'),_0x245d98,_0xee99('0x13'));_0x48f377(_0x1e214b[_0xee99('0x14')][_0xee99('0x12')]);}})[_0xee99('0x15')](function(_0x48daff){logger[_0xee99('0x10')](_0xee99('0xd'),_0x245d98,_0x48daff);_0xc5764b(_0x48daff);});});} \ No newline at end of file +var _0x2dd9=['jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x70504d,_0x34e810){var _0x47e29b=function(_0x119dfe){while(--_0x119dfe){_0x70504d['push'](_0x70504d['shift']());}};_0x47e29b(++_0x34e810);}(_0x2dd9,0x74));var _0x92dd=function(_0x2f345f,_0x1ee95c){_0x2f345f=_0x2f345f-0x0;var _0x5a37b0=_0x2dd9[_0x2f345f];return _0x5a37b0;};'use strict';var _=require(_0x92dd('0x0'));var util=require(_0x92dd('0x1'));var moment=require('moment');var BPromise=require(_0x92dd('0x2'));var rs=require(_0x92dd('0x3'));var fs=require('fs');var Redis=require(_0x92dd('0x4'));var db=require(_0x92dd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92dd('0x6'))(_0x92dd('0x7'));var config=require(_0x92dd('0x8'));var jayson=require(_0x92dd('0x9'));var client=jayson[_0x92dd('0xa')][_0x92dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29bf74,_0x44fd59,_0x202c6a){return new BPromise(function(_0x7b690c,_0x81625b){return client[_0x92dd('0xc')](_0x29bf74,_0x202c6a)[_0x92dd('0xd')](function(_0x1568fa){logger[_0x92dd('0xe')](_0x92dd('0xf'),_0x44fd59,_0x92dd('0x10'));logger[_0x92dd('0x11')](_0x92dd('0x12'),_0x44fd59,_0x92dd('0x10'),JSON[_0x92dd('0x13')](_0x1568fa));if(_0x1568fa[_0x92dd('0x14')]){if(_0x1568fa[_0x92dd('0x14')][_0x92dd('0x15')]===0x1f4){logger[_0x92dd('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x44fd59,_0x1568fa[_0x92dd('0x14')][_0x92dd('0x16')]);return _0x81625b(_0x1568fa[_0x92dd('0x14')][_0x92dd('0x16')]);}logger[_0x92dd('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x44fd59,_0x1568fa['error'][_0x92dd('0x16')]);return _0x7b690c(_0x1568fa[_0x92dd('0x14')][_0x92dd('0x16')]);}else{logger[_0x92dd('0xe')](_0x92dd('0xf'),_0x44fd59,_0x92dd('0x10'));_0x7b690c(_0x1568fa[_0x92dd('0x17')][_0x92dd('0x16')]);}})[_0x92dd('0x18')](function(_0xc1b3ca){logger[_0x92dd('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x44fd59,_0xc1b3ca);_0x81625b(_0xc1b3ca);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 798e807..7eb1918 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3786f2,_0x2eec8c){var _0x56f7bf=function(_0x1979f2){while(--_0x1979f2){_0x3786f2['push'](_0x3786f2['shift']());}};_0x56f7bf(++_0x2eec8c);}(_0xedd9,0xfc));var _0x9edd=function(_0x37cd0c,_0x3a94ce){_0x37cd0c=_0x37cd0c-0x0;var _0x4cdce7=_0xedd9[_0x37cd0c];return _0x4cdce7;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x44e7b9,_0xf7f5cc){var _0x1de7ac=function(_0x307551){while(--_0x307551){_0x44e7b9['push'](_0x44e7b9['shift']());}};_0x1de7ac(++_0xf7f5cc);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 096934b..1496151 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 _0x7ae0=['sequelize','exports','INTEGER'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7ae0,0x1a4));var _0x07ae=function(_0x1ddea0,_0x2d5231){_0x1ddea0=_0x1ddea0-0x0;var _0x2daa0c=_0x7ae0[_0x1ddea0];return _0x2daa0c;};'use strict';var Sequelize=require(_0x07ae('0x0'));module[_0x07ae('0x1')]={'penalty':{'type':Sequelize[_0x07ae('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x07ae('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf14e=['INTEGER','exports'];(function(_0x678ee5,_0x5b07a3){var _0x2796b8=function(_0x2eba17){while(--_0x2eba17){_0x678ee5['push'](_0x678ee5['shift']());}};_0x2796b8(++_0x5b07a3);}(_0xf14e,0x13d));var _0xef14=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf14e[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');module[_0xef14('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xef14('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a8e7e91..e2cfe4c 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 _0x967d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x44e11a,_0x2e5a6f){var _0x2061bf=function(_0x4756de){while(--_0x4756de){_0x44e11a['push'](_0x44e11a['shift']());}};_0x2061bf(++_0x2e5a6f);}(_0x967d,0x194));var _0xd967=function(_0x1ebc2a,_0x599735){_0x1ebc2a=_0x1ebc2a-0x0;var _0x33b647=_0x967d[_0x1ebc2a];return _0x33b647;};'use strict';var _=require(_0xd967('0x0'));var util=require(_0xd967('0x1'));var logger=require(_0xd967('0x2'))(_0xd967('0x3'));var moment=require(_0xd967('0x4'));var BPromise=require(_0xd967('0x5'));var rp=require(_0xd967('0x6'));var fs=require('fs');var path=require(_0xd967('0x7'));var rimraf=require(_0xd967('0x8'));var config=require(_0xd967('0x9'));var attributes=require(_0xd967('0xa'));module[_0xd967('0xb')]=function(_0x204478,_0x228b47){return _0x204478[_0xd967('0xc')](_0xd967('0xd'),attributes,{'tableName':_0xd967('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c12=['lodash','api','bluebird','request-promise','rimraf','./userFaxQueue.attributes','user_has_fax_queues'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x3c12,0xb6));var _0x23c1=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x3c12[_0x12ca5f];return _0xfc3ae9;};'use strict';var _=require(_0x23c1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x23c1('0x1'));var moment=require('moment');var BPromise=require(_0x23c1('0x2'));var rp=require(_0x23c1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23c1('0x4'));var config=require('../../config/environment');var attributes=require(_0x23c1('0x5'));module['exports']=function(_0x84be1a,_0x62cd7c){return _0x84be1a['define']('UserFaxQueue',attributes,{'tableName':_0x23c1('0x6'),'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 747d0d1..a23c0a5 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 _0x0ca5=['request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x3b594b,_0x5835c3){var _0x1ea5f8=function(_0x191b3e){while(--_0x191b3e){_0x3b594b['push'](_0x3b594b['shift']());}};_0x1ea5f8(++_0x5835c3);}(_0x0ca5,0x1aa));var _0x50ca=function(_0x35f64d,_0x39977f){_0x35f64d=_0x35f64d-0x0;var _0x594c05=_0x0ca5[_0x35f64d];return _0x594c05;};'use strict';var _=require(_0x50ca('0x0'));var util=require(_0x50ca('0x1'));var moment=require(_0x50ca('0x2'));var BPromise=require(_0x50ca('0x3'));var rs=require(_0x50ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50ca('0x5'))['db'];var utils=require(_0x50ca('0x6'));var logger=require(_0x50ca('0x7'))('rpc');var config=require(_0x50ca('0x8'));var jayson=require(_0x50ca('0x9'));var client=jayson['client'][_0x50ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46c1d6,_0x2d14ed,_0x5a0fef){return new BPromise(function(_0x441e33,_0x3b5b5a){return client[_0x50ca('0xb')](_0x46c1d6,_0x5a0fef)[_0x50ca('0xc')](function(_0x5dd0d8){logger[_0x50ca('0xd')](_0x50ca('0xe'),_0x2d14ed,'request\x20sent');logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2d14ed,_0x50ca('0xf'),JSON['stringify'](_0x5dd0d8));if(_0x5dd0d8[_0x50ca('0x10')]){if(_0x5dd0d8[_0x50ca('0x10')][_0x50ca('0x11')]===0x1f4){logger[_0x50ca('0x10')](_0x50ca('0xe'),_0x2d14ed,_0x5dd0d8[_0x50ca('0x10')][_0x50ca('0x12')]);return _0x3b5b5a(_0x5dd0d8['error']['message']);}logger[_0x50ca('0x10')](_0x50ca('0xe'),_0x2d14ed,_0x5dd0d8[_0x50ca('0x10')][_0x50ca('0x12')]);return _0x441e33(_0x5dd0d8[_0x50ca('0x10')][_0x50ca('0x12')]);}else{logger['info'](_0x50ca('0xe'),_0x2d14ed,_0x50ca('0xf'));_0x441e33(_0x5dd0d8[_0x50ca('0x13')]['message']);}})[_0x50ca('0x14')](function(_0x3afcbb){logger[_0x50ca('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x2d14ed,_0x3afcbb);_0x3b5b5a(_0x3afcbb);});});} \ No newline at end of file +var _0x1c31=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1c31,0xcc));var _0x11c3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1c31[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x11c3('0x0'));var moment=require(_0x11c3('0x1'));var BPromise=require(_0x11c3('0x2'));var rs=require(_0x11c3('0x3'));var fs=require('fs');var Redis=require(_0x11c3('0x4'));var db=require(_0x11c3('0x5'))['db'];var utils=require(_0x11c3('0x6'));var logger=require('../../config/logger')(_0x11c3('0x7'));var config=require('../../config/environment');var jayson=require(_0x11c3('0x8'));var client=jayson[_0x11c3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56f2ad,_0x17df02,_0x4b7d1f){return new BPromise(function(_0x431a1c,_0x39f9da){return client['request'](_0x56f2ad,_0x4b7d1f)['then'](function(_0x385d32){logger[_0x11c3('0xa')](_0x11c3('0xb'),_0x17df02,_0x11c3('0xc'));logger['debug'](_0x11c3('0xd'),_0x17df02,_0x11c3('0xc'),JSON[_0x11c3('0xe')](_0x385d32));if(_0x385d32[_0x11c3('0xf')]){if(_0x385d32[_0x11c3('0xf')][_0x11c3('0x10')]===0x1f4){logger['error'](_0x11c3('0xb'),_0x17df02,_0x385d32[_0x11c3('0xf')][_0x11c3('0x11')]);return _0x39f9da(_0x385d32[_0x11c3('0xf')][_0x11c3('0x11')]);}logger[_0x11c3('0xf')](_0x11c3('0xb'),_0x17df02,_0x385d32['error'][_0x11c3('0x11')]);return _0x431a1c(_0x385d32[_0x11c3('0xf')]['message']);}else{logger['info'](_0x11c3('0xb'),_0x17df02,_0x11c3('0xc'));_0x431a1c(_0x385d32[_0x11c3('0x12')][_0x11c3('0x11')]);}})[_0x11c3('0x13')](function(_0x5ad985){logger[_0x11c3('0xf')](_0x11c3('0xb'),_0x17df02,_0x5ad985);_0x39f9da(_0x5ad985);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 593fbfa..6bdbca9 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1c8efa,_0x4d45a5){var _0x74c893=function(_0x4d9669){while(--_0x4d9669){_0x1c8efa['push'](_0x1c8efa['shift']());}};_0x74c893(++_0x4d45a5);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xeb2c9e,_0x5adc2b){var _0x2124e7=function(_0x3d6431){while(--_0x3d6431){_0xeb2c9e['push'](_0xeb2c9e['shift']());}};_0x2124e7(++_0x5adc2b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xcb91[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index f2138ac..c985c0e 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 _0x17c4=['sequelize','exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x17c4,0x102));var _0x417c=function(_0x7a9beb,_0x4fc7a4){_0x7a9beb=_0x7a9beb-0x0;var _0x43533e=_0x17c4[_0x7a9beb];return _0x43533e;};'use strict';var Sequelize=require(_0x417c('0x0'));module[_0x417c('0x1')]={'penalty':{'type':Sequelize[_0x417c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd7be=['sequelize','INTEGER'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xd7be,0x128));var _0xed7b=function(_0x19eb1c,_0x33ba03){_0x19eb1c=_0x19eb1c-0x0;var _0x58d2db=_0xd7be[_0x19eb1c];return _0x58d2db;};'use strict';var Sequelize=require(_0xed7b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xed7b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 0fd95da..6f25c82 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 _0x52d5=['path','rimraf','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3a7077,_0x1f9d15){var _0x3ad27d=function(_0x3e2ece){while(--_0x3e2ece){_0x3a7077['push'](_0x3a7077['shift']());}};_0x3ad27d(++_0x1f9d15);}(_0x52d5,0x77));var _0x552d=function(_0x1a5c03,_0x415f40){_0x1a5c03=_0x1a5c03-0x0;var _0x1b7456=_0x52d5[_0x1a5c03];return _0x1b7456;};'use strict';var _=require(_0x552d('0x0'));var util=require(_0x552d('0x1'));var logger=require(_0x552d('0x2'))(_0x552d('0x3'));var moment=require(_0x552d('0x4'));var BPromise=require(_0x552d('0x5'));var rp=require(_0x552d('0x6'));var fs=require('fs');var path=require(_0x552d('0x7'));var rimraf=require(_0x552d('0x8'));var config=require(_0x552d('0x9'));var attributes=require('./userMailQueue.attributes');module[_0x552d('0xa')]=function(_0x5bd472,_0x2ac02d){return _0x5bd472[_0x552d('0xb')](_0x552d('0xc'),attributes,{'tableName':_0x552d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b3f=['user_has_mail_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','UserMailQueue'];(function(_0x2270a5,_0x4329db){var _0xe5d473=function(_0x5691f1){while(--_0x5691f1){_0x2270a5['push'](_0x2270a5['shift']());}};_0xe5d473(++_0x4329db);}(_0x7b3f,0x15d));var _0xf7b3=function(_0x258d98,_0x5beadf){_0x258d98=_0x258d98-0x0;var _0x1d53f9=_0x7b3f[_0x258d98];return _0x1d53f9;};'use strict';var _=require(_0xf7b3('0x0'));var util=require('util');var logger=require(_0xf7b3('0x1'))(_0xf7b3('0x2'));var moment=require(_0xf7b3('0x3'));var BPromise=require(_0xf7b3('0x4'));var rp=require(_0xf7b3('0x5'));var fs=require('fs');var path=require(_0xf7b3('0x6'));var rimraf=require('rimraf');var config=require(_0xf7b3('0x7'));var attributes=require('./userMailQueue.attributes');module[_0xf7b3('0x8')]=function(_0x5a8f81,_0x45a3d0){return _0x5a8f81[_0xf7b3('0x9')](_0xf7b3('0xa'),attributes,{'tableName':_0xf7b3('0xb'),'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 0042864..9fa89c3 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 _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(_0x3c9b97,_0x4a097a){var _0x21a281=function(_0x2f1c3d){while(--_0x2f1c3d){_0x3c9b97['push'](_0x3c9b97['shift']());}};_0x21a281(++_0x4a097a);}(_0x4b84,0x1cc));var _0x44b8=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x4b84[_0x9b3efc];return _0x200f05;};'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 +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1f3f4a,_0xca7e15){_0x1f3f4a=_0x1f3f4a-0x0;var _0x3f971f=_0x1cb9[_0x1f3f4a];return _0x3f971f;};'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')]('UserMailQueue,\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/userNotification/index.js b/server/api/userNotification/index.js index f13c95a..cda625f 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 _0x6ec4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express'];(function(_0x4e3838,_0x987d69){var _0x5631c6=function(_0x3913e9){while(--_0x3913e9){_0x4e3838['push'](_0x4e3838['shift']());}};_0x5631c6(++_0x987d69);}(_0x6ec4,0x82));var _0x46ec=function(_0x4486ee,_0x85b039){_0x4486ee=_0x4486ee-0x0;var _0x2713cb=_0x6ec4[_0x4486ee];return _0x2713cb;};'use strict';var multer=require(_0x46ec('0x0'));var util=require(_0x46ec('0x1'));var path=require(_0x46ec('0x2'));var timeout=require(_0x46ec('0x3'));var express=require(_0x46ec('0x4'));var router=express[_0x46ec('0x5')]();var fs_extra=require(_0x46ec('0x6'));var auth=require(_0x46ec('0x7'));var interaction=require(_0x46ec('0x8'));var config=require(_0x46ec('0x9'));var controller=require(_0x46ec('0xa'));router[_0x46ec('0xb')]('/',auth[_0x46ec('0xc')](),controller[_0x46ec('0xd')]);module[_0x46ec('0xe')]=router; \ No newline at end of file +var _0xaded=['exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification'];(function(_0x5bb331,_0x469ea0){var _0x209174=function(_0x3a8083){while(--_0x3a8083){_0x5bb331['push'](_0x5bb331['shift']());}};_0x209174(++_0x469ea0);}(_0xaded,0x1f0));var _0xdade=function(_0x5585c7,_0x1e2b34){_0x5585c7=_0x5585c7-0x0;var _0x395a87=_0xaded[_0x5585c7];return _0x395a87;};'use strict';var multer=require(_0xdade('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdade('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdade('0x2'));var auth=require(_0xdade('0x3'));var interaction=require(_0xdade('0x4'));var config=require(_0xdade('0x5'));var controller=require(_0xdade('0x6'));router[_0xdade('0x7')]('/',auth[_0xdade('0x8')](),controller[_0xdade('0x9')]);module[_0xdade('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 1e0ce56..25d2c83 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 _0x795f=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x208128,_0x9e2557){var _0x213a02=function(_0x29fc57){while(--_0x29fc57){_0x208128['push'](_0x208128['shift']());}};_0x213a02(++_0x9e2557);}(_0x795f,0x113));var _0xf795=function(_0xee051,_0x38b2a0){_0xee051=_0xee051-0x0;var _0x43abf5=_0x795f[_0xee051];return _0x43abf5;};'use strict';var Sequelize=require(_0xf795('0x0'));module[_0xf795('0x1')]={'body':{'type':Sequelize[_0xf795('0x2')]},'senderName':{'type':Sequelize[_0xf795('0x3')]},'recipientsId':{'type':Sequelize[_0xf795('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xf795('0x4')]}}; \ No newline at end of file +var _0x7c6e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2076dc,_0x427549){var _0x438388=function(_0xd75db3){while(--_0xd75db3){_0x2076dc['push'](_0x2076dc['shift']());}};_0x438388(++_0x427549);}(_0x7c6e,0x1ec));var _0xe7c6=function(_0x18e416,_0x2660c7){_0x18e416=_0x18e416-0x0;var _0x16f8af=_0x7c6e[_0x18e416];return _0x16f8af;};'use strict';var Sequelize=require(_0xe7c6('0x0'));module[_0xe7c6('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xe7c6('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xe7c6('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index a2310ba..64e9b16 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 _0x6925=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','UserNotification','create','recipient','emit','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','ids','replace','queue','Queue','forEach','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./userNotification.socket','register','sendStatus','end','status'];(function(_0x1929ea,_0x57f35f){var _0x3794b5=function(_0x4f3995){while(--_0x4f3995){_0x1929ea['push'](_0x1929ea['shift']());}};_0x3794b5(++_0x57f35f);}(_0x6925,0x1cb));var _0x5692=function(_0x1f2393,_0x358f01){_0x1f2393=_0x1f2393-0x0;var _0xe3db81=_0x6925[_0x1f2393];return _0xe3db81;};'use strict';var emlformat=require(_0x5692('0x0'));var rimraf=require(_0x5692('0x1'));var zipdir=require(_0x5692('0x2'));var jsonpatch=require(_0x5692('0x3'));var rp=require(_0x5692('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5692('0x5'));var util=require('util');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(_0x5692('0x6'));var squel=require(_0x5692('0x7'));var crypto=require(_0x5692('0x8'));var jsforce=require(_0x5692('0x9'));var deskjs=require(_0x5692('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5692('0xb'));var Papa=require('papaparse');var Redis=require(_0x5692('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5692('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5692('0xe'))(_0x5692('0xf'));var utils=require(_0x5692('0x10'));var config=require(_0x5692('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x5692('0x12'))['db'];config[_0x5692('0x13')]=_[_0x5692('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5692('0x13')]));require(_0x5692('0x15'))[_0x5692('0x16')](socket);function respondWithStatusCode(_0x1926a4,_0x58cecf){_0x58cecf=_0x58cecf||0xcc;return function(_0xf1db9){if(_0xf1db9){return _0x1926a4[_0x5692('0x17')](_0x58cecf);}return _0x1926a4['status'](_0x58cecf)[_0x5692('0x18')]();};}function respondWithResult(_0x19b633,_0x1d8862){_0x1d8862=_0x1d8862||0xc8;return function(_0x4d02a5){if(_0x4d02a5){return _0x19b633[_0x5692('0x19')](_0x1d8862)[_0x5692('0x1a')](_0x4d02a5);}};}function respondWithFilteredResult(_0x363b76,_0x551bc3){return function(_0xbfba){if(_0xbfba){var _0xf67063=typeof _0x551bc3[_0x5692('0x1b')]===_0x5692('0x1c')&&typeof _0x551bc3[_0x5692('0x1d')]===_0x5692('0x1c');var _0x3acc13=_0xbfba['count'];var _0x3d5a07=_0xf67063?0x0:_0x551bc3[_0x5692('0x1b')];var _0x45fd96=_0xf67063?_0xbfba[_0x5692('0x1e')]:_0x551bc3[_0x5692('0x1b')]+_0x551bc3[_0x5692('0x1d')];var _0x1699de;if(_0x45fd96>=_0x3acc13){_0x45fd96=_0x3acc13;_0x1699de=0xc8;}else{_0x1699de=0xce;}_0x363b76[_0x5692('0x19')](_0x1699de);return _0x363b76[_0x5692('0x1f')](_0x5692('0x20'),_0x3d5a07+'-'+_0x45fd96+'/'+_0x3acc13)[_0x5692('0x1a')](_0xbfba);}return null;};}function patchUpdates(_0xa357d){return function(_0x54a3a7){try{jsonpatch[_0x5692('0x21')](_0x54a3a7,_0xa357d,!![]);}catch(_0x4d716e){return BPromise[_0x5692('0x22')](_0x4d716e);}return _0x54a3a7[_0x5692('0x23')]();};}function saveUpdates(_0x12acd7,_0x5848db){return function(_0x4008b2){if(_0x4008b2){return _0x4008b2['update'](_0x12acd7)['then'](function(_0x58bf86){return _0x58bf86;});}return null;};}function removeEntity(_0x49c408,_0x3804cd){return function(_0x5481c3){if(_0x5481c3){return _0x5481c3[_0x5692('0x24')]()[_0x5692('0x25')](function(){_0x49c408['status'](0xcc)[_0x5692('0x18')]();});}};}function handleEntityNotFound(_0x2319ec,_0x3fc77b){return function(_0x22b9b5){if(!_0x22b9b5){_0x2319ec['sendStatus'](0x194);}return _0x22b9b5;};}function handleError(_0xdbe18b,_0xbab92f){_0xbab92f=_0xbab92f||0x1f4;return function(_0x4b34ee){logger[_0x5692('0x26')](_0x4b34ee[_0x5692('0x27')]);if(_0x4b34ee['name']){delete _0x4b34ee[_0x5692('0x28')];}_0xdbe18b[_0x5692('0x19')](_0xbab92f)[_0x5692('0x29')](_0x4b34ee);};}exports[_0x5692('0x2a')]=function(_0x32ad71,_0x356f93,_0x49ba17){if(!_0x32ad71['body'][_0x5692('0x2b')](_0x5692('0x2c'))&&!_0x32ad71[_0x5692('0x2d')][_0x5692('0x2b')](_0x5692('0x2e'))){throw new db[(_0x5692('0x2f'))][(_0x5692('0x30'))](_0x5692('0x31'));}else{if(_0x32ad71[_0x5692('0x2d')][_0x5692('0x2b')](_0x5692('0x2e'))&&!_0x32ad71[_0x5692('0x2d')][_0x5692('0x2b')](_0x5692('0x32'))){throw new db['Sequelize'][(_0x5692('0x30'))](_0x5692('0x33'));}if(!_0x32ad71[_0x5692('0x2d')][_0x5692('0x2b')]('recipients')){throw new db['Sequelize'][(_0x5692('0x30'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x531bef=JSON[_0x5692('0x34')](_0x32ad71[_0x5692('0x2d')][_0x5692('0x35')]);}catch(_0x231117){logger[_0x5692('0x26')](_0x231117);throw new db[(_0x5692('0x2f'))]['ValidationError'](_0x5692('0x36'));}var _0x5237a7=[_0x5692('0x37'),_0x5692('0x38'),_0x5692('0x39'),_0x5692('0x3a'),_0x5692('0x3b'),'voicequeue',_0x5692('0x3c'),_0x5692('0x3d'),_0x5692('0x3e')];if(_[_0x5692('0x3f')](_0x531bef,function(_0xf7627e){return!_[_0x5692('0x40')](_0x5237a7,_0xf7627e[_0x5692('0x41')][_0x5692('0x42')]());})){throw new db[(_0x5692('0x2f'))][(_0x5692('0x30'))](_0x5692('0x43'));}}}var _0x1a9efa={};_0x1a9efa['senderName']=_0x32ad71[_0x5692('0x2d')][_0x5692('0x2b')]('senderName')?_0x32ad71[_0x5692('0x2d')][_0x5692('0x44')]:_0x32ad71['user'][_0x5692('0x45')];_0x1a9efa[_0x5692('0x46')]=_['isEmpty'](_0x32ad71[_0x5692('0x2d')][_0x5692('0x46')])?null:_0x32ad71['body'][_0x5692('0x46')];_0x1a9efa['beep']=_0x32ad71[_0x5692('0x2d')][_0x5692('0x47')]||![];_0x1a9efa[_0x5692('0x48')]=_0x32ad71[_0x5692('0x3e')]['id'];return getContent(_0x32ad71['body'])[_0x5692('0x25')](function(_0x4bbeac){_0x1a9efa[_0x5692('0x2d')]=_0x4bbeac;return getRecipients(_0x531bef);})[_0x5692('0x25')](function(_0x38093b){_0x1a9efa[_0x5692('0x49')]=_[_0x5692('0x4a')](_0x38093b)[_0x5692('0x4b')](',');return db['sequelize']['transaction'](function(_0x519081){return db[_0x5692('0x4c')][_0x5692('0x4d')](_0x1a9efa,{'raw':!![],'transaction':_0x519081})[_0x5692('0x25')](function(_0xe068eb){var _0x7ac265={'sender':_0x1a9efa[_0x5692('0x44')],'description':_0x1a9efa[_0x5692('0x46')],'content':_0x1a9efa[_0x5692('0x2d')],'beep':_0x1a9efa['beep']};_0x38093b['forEach'](function(_0x7ee460){_0x7ac265[_0x5692('0x4e')]=_0x7ee460;socket[_0x5692('0x4f')](_0x5692('0x50'),_0x7ac265);});return _0xe068eb;});});})['then'](respondWithResult(_0x356f93,0xc9))[_0x5692('0x51')](handleError(_0x356f93,null));};function getContent(_0x241f38){return new BPromise(function(_0x4733e2,_0x48f98e){if(_0x241f38['text']){_0x4733e2(_0x241f38[_0x5692('0x2c')]);return;}return db['Template']['findOne']({'attributes':[_0x5692('0x52')],'where':{'id':_0x241f38[_0x5692('0x2e')]},'raw':!![]})[_0x5692('0x25')](function(_0x45c745){if(!_0x45c745)throw new db['Sequelize'][(_0x5692('0x30'))](_0x5692('0x53'));var _0x5d0ac8=Mustache['render'](_0x45c745[_0x5692('0x52')],_0x241f38[_0x5692('0x32')]);_0x4733e2(_0x5d0ac8);})[_0x5692('0x51')](function(_0x51e9d7){_0x48f98e(_0x51e9d7);});});}function getRecipients(_0x11e5aa){return new BPromise(function(_0x34b36,_0x3a7fe3){var _0x11d6b9=[];var _0x140f72=[];_0x11e5aa['forEach'](function(_0x3fef65){var _0x3a756a=_[_0x5692('0x54')](_0x3fef65[_0x5692('0x41')][_0x5692('0x42')]());if(_0x3a756a===_0x5692('0x55')){_0x11d6b9=_[_0x5692('0x56')](_0x11d6b9,_0x3fef65[_0x5692('0x57')]);}else{if(_[_0x5692('0x40')](_0x3a756a,'queue'))_0x3a756a=_0x3a756a[_0x5692('0x58')](_0x5692('0x59'),_0x5692('0x5a'));_0x3fef65[_0x5692('0x57')][_0x5692('0x5b')](function(_0x5297a6){_0x140f72['push'](getAgents(_0x3a756a,_0x5297a6));});}});return BPromise[_0x5692('0x5c')](_0x140f72)['then'](function(_0x27d314){_0x11d6b9=_[_0x5692('0x56')](_0x11d6b9,_[_0x5692('0x5d')](_0x27d314));_0x34b36(_0x11d6b9);})[_0x5692('0x51')](function(_0x1e3732){_0x3a7fe3(_0x1e3732);});});}function getAgents(_0x39d4f0,_0x348251){return new BPromise(function(_0x2fc8a0,_0x45cfbf){return db[_0x39d4f0][_0x5692('0x5e')]({'where':{'id':_0x348251}})[_0x5692('0x25')](function(_0x2480e0){return _0x2480e0[_0x5692('0x5f')]({'attributes':['id'],'raw':!![]})[_0x5692('0x25')](function(_0x321a30){var _0x2ae2fa=_[_0x5692('0x60')](_0x321a30,'id');_0x2fc8a0(_0x2ae2fa);});})[_0x5692('0x51')](function(_0x50109a){_0x45cfbf(_0x50109a);});});} \ No newline at end of file +var _0xaf66=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','smsqueue','voicequeue','team','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','beep','user','recipientsId','sortBy','join','sequelize','transaction','create','recipientsDescription','recipient','emit','userNotification:send','catch','findOne','render','html','view','forEach','startCase','includes','queue','replace','ids','all','union','flatten','getAgents','map','rimraf','zip-dir'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0xaf66,0x182));var _0x6af6=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0xaf66[_0x35d8af];return _0x1d08b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6af6('0x0'));var zipdir=require(_0x6af6('0x1'));var jsonpatch=require(_0x6af6('0x2'));var rp=require(_0x6af6('0x3'));var moment=require(_0x6af6('0x4'));var BPromise=require(_0x6af6('0x5'));var Mustache=require(_0x6af6('0x6'));var util=require(_0x6af6('0x7'));var path=require(_0x6af6('0x8'));var sox=require(_0x6af6('0x9'));var csv=require(_0x6af6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6af6('0xb'));var _=require('lodash');var squel=require(_0x6af6('0xc'));var crypto=require(_0x6af6('0xd'));var jsforce=require(_0x6af6('0xe'));var deskjs=require(_0x6af6('0xf'));var toCsv=require(_0x6af6('0xa'));var querystring=require('querystring');var Papa=require(_0x6af6('0x10'));var Redis=require(_0x6af6('0x11'));var authService=require(_0x6af6('0x12'));var qs=require(_0x6af6('0x13'));var as=require(_0x6af6('0x14'));var hardwareService=require(_0x6af6('0x15'));var logger=require('../../config/logger')(_0x6af6('0x16'));var utils=require(_0x6af6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6af6('0x18'));var db=require(_0x6af6('0x19'))['db'];config[_0x6af6('0x1a')]=_['defaults'](config['redis'],{'host':_0x6af6('0x1b'),'port':0x18eb});var socket=require(_0x6af6('0x1c'))(new Redis(config[_0x6af6('0x1a')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x17f534,_0x7976fd){_0x7976fd=_0x7976fd||0xcc;return function(_0x3413b8){if(_0x3413b8){return _0x17f534[_0x6af6('0x1d')](_0x7976fd);}return _0x17f534[_0x6af6('0x1e')](_0x7976fd)['end']();};}function respondWithResult(_0x19cdfa,_0x13d3c3){_0x13d3c3=_0x13d3c3||0xc8;return function(_0x14ffac){if(_0x14ffac){return _0x19cdfa['status'](_0x13d3c3)[_0x6af6('0x1f')](_0x14ffac);}};}function respondWithFilteredResult(_0x31583c,_0x312e18){return function(_0x1789d9){if(_0x1789d9){var _0x1db3c6=typeof _0x312e18[_0x6af6('0x20')]===_0x6af6('0x21')&&typeof _0x312e18[_0x6af6('0x22')]===_0x6af6('0x21');var _0x35df90=_0x1789d9[_0x6af6('0x23')];var _0x1f2558=_0x1db3c6?0x0:_0x312e18[_0x6af6('0x20')];var _0xf0bfd2=_0x1db3c6?_0x1789d9[_0x6af6('0x23')]:_0x312e18[_0x6af6('0x20')]+_0x312e18[_0x6af6('0x22')];var _0x2265c6;if(_0xf0bfd2>=_0x35df90){_0xf0bfd2=_0x35df90;_0x2265c6=0xc8;}else{_0x2265c6=0xce;}_0x31583c[_0x6af6('0x1e')](_0x2265c6);return _0x31583c[_0x6af6('0x24')](_0x6af6('0x25'),_0x1f2558+'-'+_0xf0bfd2+'/'+_0x35df90)['json'](_0x1789d9);}return null;};}function patchUpdates(_0x5845fc){return function(_0x493d6a){try{jsonpatch[_0x6af6('0x26')](_0x493d6a,_0x5845fc,!![]);}catch(_0x28c08a){return BPromise[_0x6af6('0x27')](_0x28c08a);}return _0x493d6a[_0x6af6('0x28')]();};}function saveUpdates(_0xff2cc3,_0x281e95){return function(_0x48a3fe){if(_0x48a3fe){return _0x48a3fe[_0x6af6('0x29')](_0xff2cc3)[_0x6af6('0x2a')](function(_0x46e959){return _0x46e959;});}return null;};}function removeEntity(_0x473120,_0x3eafb1){return function(_0x12565f){if(_0x12565f){return _0x12565f['destroy']()[_0x6af6('0x2a')](function(){_0x473120[_0x6af6('0x1e')](0xcc)[_0x6af6('0x2b')]();});}};}function handleEntityNotFound(_0x468a46,_0x5960da){return function(_0x1d6b57){if(!_0x1d6b57){_0x468a46[_0x6af6('0x1d')](0x194);}return _0x1d6b57;};}function handleError(_0x349c16,_0x41f7fd){_0x41f7fd=_0x41f7fd||0x1f4;return function(_0x9bed43){logger[_0x6af6('0x2c')](_0x9bed43[_0x6af6('0x2d')]);if(_0x9bed43[_0x6af6('0x2e')]){delete _0x9bed43[_0x6af6('0x2e')];}_0x349c16[_0x6af6('0x1e')](_0x41f7fd)['send'](_0x9bed43);};}exports[_0x6af6('0x2f')]=function(_0x336cee,_0x3f9103,_0x11c82e){if(!_0x336cee[_0x6af6('0x30')][_0x6af6('0x31')](_0x6af6('0x32'))&&!_0x336cee[_0x6af6('0x30')]['hasOwnProperty'](_0x6af6('0x33'))){throw new db[(_0x6af6('0x34'))]['ValidationError'](_0x6af6('0x35'));}else{if(_0x336cee[_0x6af6('0x30')][_0x6af6('0x31')](_0x6af6('0x33'))&&!_0x336cee[_0x6af6('0x30')][_0x6af6('0x31')]('view')){throw new db[(_0x6af6('0x34'))][(_0x6af6('0x36'))](_0x6af6('0x37'));}if(!_0x336cee[_0x6af6('0x30')][_0x6af6('0x31')](_0x6af6('0x38'))){throw new db[(_0x6af6('0x34'))][(_0x6af6('0x36'))](_0x6af6('0x39'));}else{try{var _0x465744=JSON[_0x6af6('0x3a')](_0x336cee[_0x6af6('0x30')][_0x6af6('0x38')]);}catch(_0x2b0323){logger['error'](_0x2b0323);throw new db[(_0x6af6('0x34'))]['ValidationError'](_0x6af6('0x3b'));}var _0x1de4c2=[_0x6af6('0x3c'),_0x6af6('0x3d'),'mailqueue','openchannelqueue',_0x6af6('0x3e'),_0x6af6('0x3f'),'whatsappqueue',_0x6af6('0x40'),'user'];if(_['some'](_0x465744,function(_0x382567){return!_['includes'](_0x1de4c2,_0x382567[_0x6af6('0x41')][_0x6af6('0x42')]());})){throw new db[(_0x6af6('0x34'))][(_0x6af6('0x36'))](_0x6af6('0x43'));}}}var _0x5caf9c={};_0x5caf9c[_0x6af6('0x44')]=_0x336cee['body'][_0x6af6('0x31')](_0x6af6('0x44'))?_0x336cee[_0x6af6('0x30')]['senderName']:_0x336cee['user']['fullname'];_0x5caf9c['recipientsDescription']=_['isEmpty'](_0x336cee[_0x6af6('0x30')]['recipientsDescription'])?null:_0x336cee['body']['recipientsDescription'];_0x5caf9c[_0x6af6('0x45')]=_0x336cee['body'][_0x6af6('0x45')]||![];_0x5caf9c['SenderId']=_0x336cee[_0x6af6('0x46')]['id'];return getContent(_0x336cee[_0x6af6('0x30')])['then'](function(_0x3adbf4){_0x5caf9c[_0x6af6('0x30')]=_0x3adbf4;return getRecipients(_0x465744);})[_0x6af6('0x2a')](function(_0x5a09bc){_0x5caf9c[_0x6af6('0x47')]=_[_0x6af6('0x48')](_0x5a09bc)[_0x6af6('0x49')](',');return db[_0x6af6('0x4a')][_0x6af6('0x4b')](function(_0x476b31){return db['UserNotification'][_0x6af6('0x4c')](_0x5caf9c,{'raw':!![],'transaction':_0x476b31})[_0x6af6('0x2a')](function(_0xae16da){var _0x9d4d3={'sender':_0x5caf9c[_0x6af6('0x44')],'description':_0x5caf9c[_0x6af6('0x4d')],'content':_0x5caf9c[_0x6af6('0x30')],'beep':_0x5caf9c[_0x6af6('0x45')]};_0x5a09bc['forEach'](function(_0x9d08d){_0x9d4d3[_0x6af6('0x4e')]=_0x9d08d;socket[_0x6af6('0x4f')](_0x6af6('0x50'),_0x9d4d3);});return _0xae16da;});});})[_0x6af6('0x2a')](respondWithResult(_0x3f9103,0xc9))[_0x6af6('0x51')](handleError(_0x3f9103,null));};function getContent(_0xd287e7){return new BPromise(function(_0x174a27,_0x3af4b1){if(_0xd287e7['text']){_0x174a27(_0xd287e7[_0x6af6('0x32')]);return;}return db['Template'][_0x6af6('0x52')]({'attributes':['html'],'where':{'id':_0xd287e7[_0x6af6('0x33')]},'raw':!![]})[_0x6af6('0x2a')](function(_0x5ceb4d){if(!_0x5ceb4d)throw new db[(_0x6af6('0x34'))][(_0x6af6('0x36'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x3600a9=Mustache[_0x6af6('0x53')](_0x5ceb4d[_0x6af6('0x54')],_0xd287e7[_0x6af6('0x55')]);_0x174a27(_0x3600a9);})[_0x6af6('0x51')](function(_0x4fd5aa){_0x3af4b1(_0x4fd5aa);});});}function getRecipients(_0x5926db){return new BPromise(function(_0x5ee26c,_0x18f979){var _0x12ea3a=[];var _0x49ebf9=[];_0x5926db[_0x6af6('0x56')](function(_0xb59ab6){var _0x2fafb8=_[_0x6af6('0x57')](_0xb59ab6[_0x6af6('0x41')]['toLowerCase']());if(_0x2fafb8==='User'){_0x12ea3a=_['union'](_0x12ea3a,_0xb59ab6['ids']);}else{if(_[_0x6af6('0x58')](_0x2fafb8,_0x6af6('0x59')))_0x2fafb8=_0x2fafb8[_0x6af6('0x5a')]('queue','Queue');_0xb59ab6[_0x6af6('0x5b')][_0x6af6('0x56')](function(_0x3f0c5d){_0x49ebf9['push'](getAgents(_0x2fafb8,_0x3f0c5d));});}});return BPromise[_0x6af6('0x5c')](_0x49ebf9)[_0x6af6('0x2a')](function(_0xfd8ec4){_0x12ea3a=_[_0x6af6('0x5d')](_0x12ea3a,_[_0x6af6('0x5e')](_0xfd8ec4));_0x5ee26c(_0x12ea3a);})['catch'](function(_0x1fc609){_0x18f979(_0x1fc609);});});}function getAgents(_0x2b5d0d,_0x44e0df){return new BPromise(function(_0x4d0ed4,_0x359d44){return db[_0x2b5d0d]['findOne']({'where':{'id':_0x44e0df}})[_0x6af6('0x2a')](function(_0x52a23b){return _0x52a23b[_0x6af6('0x5f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x51f28a){var _0x15a518=_[_0x6af6('0x60')](_0x51f28a,'id');_0x4d0ed4(_0x15a518);});})[_0x6af6('0x51')](function(_0x26f367){_0x359d44(_0x26f367);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index d8235cf..4d18716 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 _0xf042=['emit','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3e6ecc,_0xa84c95){var _0x1b8284=function(_0x25c889){while(--_0x25c889){_0x3e6ecc['push'](_0x3e6ecc['shift']());}};_0x1b8284(++_0xa84c95);}(_0xf042,0x7a));var _0x2f04=function(_0x409045,_0x56abcd){_0x409045=_0x409045-0x0;var _0x38f74c=_0xf042[_0x409045];return _0x38f74c;};'use strict';var EventEmitter=require(_0x2f04('0x0'));var UserNotification=require(_0x2f04('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x2f04('0x2')](0x0);var events={'afterCreate':_0x2f04('0x3'),'afterUpdate':_0x2f04('0x4'),'afterDestroy':_0x2f04('0x5')};function emitEvent(_0x128d25){return function(_0x5aaadc,_0x59878d,_0x56df0a){UserNotificationEvents[_0x2f04('0x6')](_0x128d25+':'+_0x5aaadc['id'],_0x5aaadc);UserNotificationEvents['emit'](_0x128d25,_0x5aaadc);_0x56df0a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x2f04('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xcce8=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x780d52,_0x35e6a1){var _0x10e7f6=function(_0x2ec7d6){while(--_0x2ec7d6){_0x780d52['push'](_0x780d52['shift']());}};_0x10e7f6(++_0x35e6a1);}(_0xcce8,0xde));var _0x8cce=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xcce8[_0x18cd5b];return _0x5eaa52;};'use strict';var EventEmitter=require(_0x8cce('0x0'));var UserNotification=require(_0x8cce('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8cce('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8cce('0x3'),'afterDestroy':_0x8cce('0x4')};function emitEvent(_0x127e11){return function(_0x3f37a9,_0x1607aa,_0x46f2aa){UserNotificationEvents[_0x8cce('0x5')](_0x127e11+':'+_0x3f37a9['id'],_0x3f37a9);UserNotificationEvents[_0x8cce('0x5')](_0x127e11,_0x3f37a9);_0x46f2aa(null);};}for(var e in events){if(events[_0x8cce('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x8cce('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 c723104..280bb8e 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 _0xafd9=['rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x3ae25c,_0x313619){var _0x14ae07=function(_0x1b9eb1){while(--_0x1b9eb1){_0x3ae25c['push'](_0x3ae25c['shift']());}};_0x14ae07(++_0x313619);}(_0xafd9,0x162));var _0x9afd=function(_0x2e0271,_0x160cec){_0x2e0271=_0x2e0271-0x0;var _0x20e8b9=_0xafd9[_0x2e0271];return _0x20e8b9;};'use strict';var _=require(_0x9afd('0x0'));var util=require('util');var logger=require(_0x9afd('0x1'))(_0x9afd('0x2'));var moment=require(_0x9afd('0x3'));var BPromise=require(_0x9afd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9afd('0x5'));var rimraf=require(_0x9afd('0x6'));var config=require(_0x9afd('0x7'));var attributes=require(_0x9afd('0x8'));module[_0x9afd('0x9')]=function(_0x168cf3,_0x35fff1){return _0x168cf3[_0x9afd('0xa')](_0x9afd('0xb'),attributes,{'tableName':_0x9afd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9afd('0xd'),'collate':_0x9afd('0xe')});}; \ No newline at end of file +var _0x6f47=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x2688d5,_0x45db72){var _0x372637=function(_0x51c20d){while(--_0x51c20d){_0x2688d5['push'](_0x2688d5['shift']());}};_0x372637(++_0x45db72);}(_0x6f47,0x12a));var _0x76f4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6f47[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require('../../config/logger')(_0x76f4('0x1'));var moment=require(_0x76f4('0x2'));var BPromise=require(_0x76f4('0x3'));var rp=require(_0x76f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var attributes=require(_0x76f4('0x7'));module[_0x76f4('0x8')]=function(_0x38b59c,_0x257e45){return _0x38b59c['define'](_0x76f4('0x9'),attributes,{'tableName':_0x76f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x76f4('0xb'),'collate':_0x76f4('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index ff4c180..bad935b 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 _0xeaf6=['debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','UserNotification,\x20%s,\x20%s','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','register','info','request\x20sent'];(function(_0x131e30,_0x2d44ab){var _0x1fcd8b=function(_0x574c9a){while(--_0x574c9a){_0x131e30['push'](_0x131e30['shift']());}};_0x1fcd8b(++_0x2d44ab);}(_0xeaf6,0x7a));var _0x6eaf=function(_0x5bac50,_0x540d00){_0x5bac50=_0x5bac50-0x0;var _0x28afd5=_0xeaf6[_0x5bac50];return _0x28afd5;};'use strict';var _=require(_0x6eaf('0x0'));var util=require('util');var moment=require(_0x6eaf('0x1'));var BPromise=require('bluebird');var rs=require(_0x6eaf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6eaf('0x3'))['db'];var utils=require(_0x6eaf('0x4'));var logger=require(_0x6eaf('0x5'))(_0x6eaf('0x6'));var config=require('../../config/environment');var jayson=require(_0x6eaf('0x7'));var client=jayson[_0x6eaf('0x8')][_0x6eaf('0x9')]({'port':0x232a});config['redis']=_[_0x6eaf('0xa')](config[_0x6eaf('0xb')],{'host':_0x6eaf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0x6eaf('0xd')](socket);function respondWithRpcPromise(_0x36b7b7,_0x159f8c,_0x2324c8){return new BPromise(function(_0x321eb4,_0x1bf65e){return client['request'](_0x36b7b7,_0x2324c8)['then'](function(_0x744d34){logger[_0x6eaf('0xe')]('UserNotification,\x20%s,\x20%s',_0x159f8c,_0x6eaf('0xf'));logger[_0x6eaf('0x10')](_0x6eaf('0x11'),_0x159f8c,_0x6eaf('0xf'),JSON[_0x6eaf('0x12')](_0x744d34));if(_0x744d34['error']){if(_0x744d34[_0x6eaf('0x13')]['code']===0x1f4){logger[_0x6eaf('0x13')](_0x6eaf('0x14'),_0x159f8c,_0x744d34[_0x6eaf('0x13')]['message']);return _0x1bf65e(_0x744d34['error'][_0x6eaf('0x15')]);}logger[_0x6eaf('0x13')]('UserNotification,\x20%s,\x20%s',_0x159f8c,_0x744d34[_0x6eaf('0x13')][_0x6eaf('0x15')]);return _0x321eb4(_0x744d34['error'][_0x6eaf('0x15')]);}else{logger['info'](_0x6eaf('0x14'),_0x159f8c,_0x6eaf('0xf'));_0x321eb4(_0x744d34[_0x6eaf('0x16')]['message']);}})['catch'](function(_0xe0ec75){logger[_0x6eaf('0x13')]('UserNotification,\x20%s,\x20%s',_0x159f8c,_0xe0ec75);_0x1bf65e(_0xe0ec75);});});} \ No newline at end of file +var _0xc594=['request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s'];(function(_0x124734,_0x36f002){var _0x1acaa=function(_0x54b8f5){while(--_0x54b8f5){_0x124734['push'](_0x124734['shift']());}};_0x1acaa(++_0x36f002);}(_0xc594,0x13e));var _0x4c59=function(_0x181c38,_0x5bd25b){_0x181c38=_0x181c38-0x0;var _0x4714be=_0xc594[_0x181c38];return _0x4714be;};'use strict';var _=require(_0x4c59('0x0'));var util=require(_0x4c59('0x1'));var moment=require(_0x4c59('0x2'));var BPromise=require(_0x4c59('0x3'));var rs=require(_0x4c59('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4c59('0x5'))(_0x4c59('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c59('0x7'));var client=jayson[_0x4c59('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x4c59('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c59('0xa'))(new Redis(config[_0x4c59('0x9')]));require(_0x4c59('0xb'))[_0x4c59('0xc')](socket);function respondWithRpcPromise(_0x2846d4,_0x2d7715,_0x127932){return new BPromise(function(_0x3b94fd,_0x3147fd){return client[_0x4c59('0xd')](_0x2846d4,_0x127932)[_0x4c59('0xe')](function(_0x3d3401){logger['info'](_0x4c59('0xf'),_0x2d7715,'request\x20sent');logger[_0x4c59('0x10')](_0x4c59('0x11'),_0x2d7715,_0x4c59('0x12'),JSON[_0x4c59('0x13')](_0x3d3401));if(_0x3d3401['error']){if(_0x3d3401[_0x4c59('0x14')][_0x4c59('0x15')]===0x1f4){logger['error'](_0x4c59('0xf'),_0x2d7715,_0x3d3401[_0x4c59('0x14')][_0x4c59('0x16')]);return _0x3147fd(_0x3d3401[_0x4c59('0x14')][_0x4c59('0x16')]);}logger['error'](_0x4c59('0xf'),_0x2d7715,_0x3d3401['error'][_0x4c59('0x16')]);return _0x3b94fd(_0x3d3401[_0x4c59('0x14')][_0x4c59('0x16')]);}else{logger[_0x4c59('0x17')](_0x4c59('0xf'),_0x2d7715,_0x4c59('0x12'));_0x3b94fd(_0x3d3401['result'][_0x4c59('0x16')]);}})['catch'](function(_0x29b5b9){logger[_0x4c59('0x14')](_0x4c59('0xf'),_0x2d7715,_0x29b5b9);_0x3147fd(_0x29b5b9);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index ee7ef06..18ce6c7 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 _0x1b0b=['userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x9ca932,_0x34c99e){var _0x4eb514=function(_0x8c44f5){while(--_0x8c44f5){_0x9ca932['push'](_0x9ca932['shift']());}};_0x4eb514(++_0x34c99e);}(_0x1b0b,0x139));var _0xb1b0=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x1b0b[_0x1e4360];return _0x31e6b4;};'use strict';var UserNotificationEvents=require(_0xb1b0('0x0'));var events=[_0xb1b0('0x1'),_0xb1b0('0x2'),_0xb1b0('0x3')];function createListener(_0x2f5710,_0x24487c){return function(_0x1a5b96){_0x24487c[_0xb1b0('0x4')](_0x2f5710,_0x1a5b96);};}function removeListener(_0x48b839,_0x404526){return function(){UserNotificationEvents[_0xb1b0('0x5')](_0x48b839,_0x404526);};}exports[_0xb1b0('0x6')]=function(_0x3d08c3){for(var _0x3b32f0=0x0,_0x2bc714=events['length'];_0x3b32f0<_0x2bc714;_0x3b32f0++){var _0x2e62cf=events[_0x3b32f0];var _0x560306=createListener(_0xb1b0('0x7')+_0x2e62cf,_0x3d08c3);UserNotificationEvents['on'](_0x2e62cf,_0x560306);}}; \ No newline at end of file +var _0xe5a4=['removeListener','register','length','userNotification:','./userNotification.events','save','remove','update'];(function(_0x298fb2,_0x59514e){var _0x364710=function(_0x46a5bc){while(--_0x46a5bc){_0x298fb2['push'](_0x298fb2['shift']());}};_0x364710(++_0x59514e);}(_0xe5a4,0x18c));var _0x4e5a=function(_0x2bc5f6,_0x459b0e){_0x2bc5f6=_0x2bc5f6-0x0;var _0x22963c=_0xe5a4[_0x2bc5f6];return _0x22963c;};'use strict';var UserNotificationEvents=require(_0x4e5a('0x0'));var events=[_0x4e5a('0x1'),_0x4e5a('0x2'),_0x4e5a('0x3')];function createListener(_0x207159,_0x309067){return function(_0x5b753b){_0x309067['emit'](_0x207159,_0x5b753b);};}function removeListener(_0x1c264d,_0x59df7b){return function(){UserNotificationEvents[_0x4e5a('0x4')](_0x1c264d,_0x59df7b);};}exports[_0x4e5a('0x5')]=function(_0x34f3ef){for(var _0x3b5e56=0x0,_0x1485ec=events[_0x4e5a('0x6')];_0x3b5e56<_0x1485ec;_0x3b5e56++){var _0x272ca5=events[_0x3b5e56];var _0x547983=createListener(_0x4e5a('0x7')+_0x272ca5,_0x34f3ef);UserNotificationEvents['on'](_0x272ca5,_0x547983);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 2de06de..01887a8 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x26c19d,_0x3f7b9b){var _0x37d676=function(_0x4d091e){while(--_0x4d091e){_0x26c19d['push'](_0x26c19d['shift']());}};_0x37d676(++_0x3f7b9b);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x85047b,_0x5aef26){var _0x56b415=function(_0x688e38){while(--_0x688e38){_0x85047b['push'](_0x85047b['shift']());}};_0x56b415(++_0x5aef26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 7495d26..f23874e 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 _0xef4a=['INTEGER','exports'];(function(_0x419ff5,_0x24a760){var _0x53c4e3=function(_0x3ea788){while(--_0x3ea788){_0x419ff5['push'](_0x419ff5['shift']());}};_0x53c4e3(++_0x24a760);}(_0xef4a,0x89));var _0xaef4=function(_0x554ae4,_0x127ecb){_0x554ae4=_0x554ae4-0x0;var _0x1a5085=_0xef4a[_0x554ae4];return _0x1a5085;};'use strict';var Sequelize=require('sequelize');module[_0xaef4('0x0')]={'penalty':{'type':Sequelize[_0xaef4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe10b=['sequelize','exports','INTEGER'];(function(_0x28f98a,_0x1b7d3e){var _0x344b15=function(_0x55292d){while(--_0x55292d){_0x28f98a['push'](_0x28f98a['shift']());}};_0x344b15(++_0x1b7d3e);}(_0xe10b,0x1b0));var _0xbe10=function(_0x2f6042,_0x2c7496){_0x2f6042=_0x2f6042-0x0;var _0x30ca11=_0xe10b[_0x2f6042];return _0x30ca11;};'use strict';var Sequelize=require(_0xbe10('0x0'));module[_0xbe10('0x1')]={'penalty':{'type':Sequelize[_0xbe10('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index f2b83ba..64f0d71 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 _0xd1d9=['request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x499550,_0x4feb8e){var _0x53ce7e=function(_0x30e63e){while(--_0x30e63e){_0x499550['push'](_0x499550['shift']());}};_0x53ce7e(++_0x4feb8e);}(_0xd1d9,0xbd));var _0x9d1d=function(_0x5bae5f,_0x3dee66){_0x5bae5f=_0x5bae5f-0x0;var _0x1742e1=_0xd1d9[_0x5bae5f];return _0x1742e1;};'use strict';var _=require(_0x9d1d('0x0'));var util=require(_0x9d1d('0x1'));var logger=require(_0x9d1d('0x2'))(_0x9d1d('0x3'));var moment=require(_0x9d1d('0x4'));var BPromise=require(_0x9d1d('0x5'));var rp=require(_0x9d1d('0x6'));var fs=require('fs');var path=require(_0x9d1d('0x7'));var rimraf=require(_0x9d1d('0x8'));var config=require(_0x9d1d('0x9'));var attributes=require(_0x9d1d('0xa'));module[_0x9d1d('0xb')]=function(_0x3dc6a9,_0x38b4d9){return _0x3dc6a9[_0x9d1d('0xc')](_0x9d1d('0xd'),attributes,{'tableName':_0x9d1d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3089=['exports','define','UserOpenchannelQueue','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x3089,0xea));var _0x9308=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3089[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9308('0x0'))('api');var moment=require(_0x9308('0x1'));var BPromise=require(_0x9308('0x2'));var rp=require(_0x9308('0x3'));var fs=require('fs');var path=require(_0x9308('0x4'));var rimraf=require(_0x9308('0x5'));var config=require(_0x9308('0x6'));var attributes=require(_0x9308('0x7'));module[_0x9308('0x8')]=function(_0x596bce,_0x1cd39c){return _0x596bce[_0x9308('0x9')](_0x9308('0xa'),attributes,{'tableName':'user_has_openchannel_queues','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 3b1fbed..aae4e36 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 _0x0c00=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x0c00,0xa1));var _0x00c0=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0c00[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x00c0('0x0'));var util=require(_0x00c0('0x1'));var moment=require(_0x00c0('0x2'));var BPromise=require(_0x00c0('0x3'));var rs=require(_0x00c0('0x4'));var fs=require('fs');var Redis=require(_0x00c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x00c0('0x6'));var logger=require(_0x00c0('0x7'))(_0x00c0('0x8'));var config=require(_0x00c0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x00c0('0xa')][_0x00c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9ed6fa,_0x9885bb,_0x528c9e){return new BPromise(function(_0x5d0579,_0x4b096d){return client[_0x00c0('0xc')](_0x9ed6fa,_0x528c9e)[_0x00c0('0xd')](function(_0x3cd44b){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x9885bb,_0x00c0('0xe'));logger[_0x00c0('0xf')](_0x00c0('0x10'),_0x9885bb,_0x00c0('0xe'),JSON[_0x00c0('0x11')](_0x3cd44b));if(_0x3cd44b[_0x00c0('0x12')]){if(_0x3cd44b[_0x00c0('0x12')]['code']===0x1f4){logger[_0x00c0('0x12')](_0x00c0('0x13'),_0x9885bb,_0x3cd44b['error'][_0x00c0('0x14')]);return _0x4b096d(_0x3cd44b[_0x00c0('0x12')]['message']);}logger[_0x00c0('0x12')](_0x00c0('0x13'),_0x9885bb,_0x3cd44b[_0x00c0('0x12')][_0x00c0('0x14')]);return _0x5d0579(_0x3cd44b[_0x00c0('0x12')][_0x00c0('0x14')]);}else{logger[_0x00c0('0x15')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x9885bb,_0x00c0('0xe'));_0x5d0579(_0x3cd44b[_0x00c0('0x16')][_0x00c0('0x14')]);}})[_0x00c0('0x17')](function(_0x4e8a40){logger[_0x00c0('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x9885bb,_0x4e8a40);_0x4b096d(_0x4e8a40);});});} \ No newline at end of file +var _0x0fee=['../../config/environment','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2b7655,_0x59042b){var _0x387501=function(_0x4f8b71){while(--_0x4f8b71){_0x2b7655['push'](_0x2b7655['shift']());}};_0x387501(++_0x59042b);}(_0x0fee,0x1c4));var _0xe0fe=function(_0x154c84,_0x4bf36b){_0x154c84=_0x154c84-0x0;var _0x38c5bc=_0x0fee[_0x154c84];return _0x38c5bc;};'use strict';var _=require(_0xe0fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe0fe('0x1'));var rs=require(_0xe0fe('0x2'));var fs=require('fs');var Redis=require(_0xe0fe('0x3'));var db=require(_0xe0fe('0x4'))['db'];var utils=require(_0xe0fe('0x5'));var logger=require(_0xe0fe('0x6'))('rpc');var config=require(_0xe0fe('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x372fac,_0x4a145a,_0x50cb44){return new BPromise(function(_0xc9141f,_0x165c99){return client[_0xe0fe('0x8')](_0x372fac,_0x50cb44)[_0xe0fe('0x9')](function(_0x169949){logger[_0xe0fe('0xa')](_0xe0fe('0xb'),_0x4a145a,_0xe0fe('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4a145a,_0xe0fe('0xc'),JSON[_0xe0fe('0xd')](_0x169949));if(_0x169949[_0xe0fe('0xe')]){if(_0x169949[_0xe0fe('0xe')][_0xe0fe('0xf')]===0x1f4){logger[_0xe0fe('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4a145a,_0x169949[_0xe0fe('0xe')][_0xe0fe('0x10')]);return _0x165c99(_0x169949[_0xe0fe('0xe')][_0xe0fe('0x10')]);}logger[_0xe0fe('0xe')](_0xe0fe('0xb'),_0x4a145a,_0x169949[_0xe0fe('0xe')][_0xe0fe('0x10')]);return _0xc9141f(_0x169949[_0xe0fe('0xe')][_0xe0fe('0x10')]);}else{logger[_0xe0fe('0xa')](_0xe0fe('0xb'),_0x4a145a,_0xe0fe('0xc'));_0xc9141f(_0x169949['result'][_0xe0fe('0x10')]);}})['catch'](function(_0xaa6e6d){logger[_0xe0fe('0xe')](_0xe0fe('0xb'),_0x4a145a,_0xaa6e6d);_0x165c99(_0xaa6e6d);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index f0b1e17..8939c4c 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 _0x8506=['get','isAuthenticated','index','/describe','describe','show','/:id/sections','/:id/resources','getResources','post','create','clone','put','/:id','update','delete','destroy','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x580934,_0x37e773){var _0x4c8c8b=function(_0x58ace5){while(--_0x58ace5){_0x580934['push'](_0x580934['shift']());}};_0x4c8c8b(++_0x37e773);}(_0x8506,0x13f));var _0x6850=function(_0x39b8e0,_0x4a7c2a){_0x39b8e0=_0x39b8e0-0x0;var _0x3cb20a=_0x8506[_0x39b8e0];return _0x3cb20a;};'use strict';var multer=require(_0x6850('0x0'));var util=require(_0x6850('0x1'));var path=require(_0x6850('0x2'));var timeout=require(_0x6850('0x3'));var express=require(_0x6850('0x4'));var router=express[_0x6850('0x5')]();var fs_extra=require(_0x6850('0x6'));var auth=require(_0x6850('0x7'));var interaction=require(_0x6850('0x8'));var config=require(_0x6850('0x9'));var controller=require(_0x6850('0xa'));router[_0x6850('0xb')]('/',auth[_0x6850('0xc')](),controller[_0x6850('0xd')]);router[_0x6850('0xb')](_0x6850('0xe'),auth[_0x6850('0xc')](),controller[_0x6850('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6850('0x10')]);router[_0x6850('0xb')](_0x6850('0x11'),auth[_0x6850('0xc')](),controller['getSections']);router[_0x6850('0xb')](_0x6850('0x12'),auth[_0x6850('0xc')](),controller[_0x6850('0x13')]);router[_0x6850('0x14')]('/',auth[_0x6850('0xc')](),controller[_0x6850('0x15')]);router['post']('/:id/clone',auth[_0x6850('0xc')](),controller[_0x6850('0x16')]);router[_0x6850('0x14')]('/:id/sections',auth['isAuthenticated'](),controller['addSections']);router[_0x6850('0x14')](_0x6850('0x12'),auth[_0x6850('0xc')](),controller['addResources']);router[_0x6850('0x17')](_0x6850('0x18'),auth[_0x6850('0xc')](),controller[_0x6850('0x19')]);router[_0x6850('0x1a')]('/:id',auth[_0x6850('0xc')](),controller[_0x6850('0x1b')]);router['delete'](_0x6850('0x11'),auth[_0x6850('0xc')](),controller['removeSections']);router['delete'](_0x6850('0x12'),auth[_0x6850('0xc')](),controller[_0x6850('0x1c')]);module[_0x6850('0x1d')]=router; \ No newline at end of file +var _0x8225=['addResources','put','update','delete','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','getSections','/:id/resources','getResources','post','create','/:id/clone','clone'];(function(_0x174fbc,_0x14e199){var _0x2b5937=function(_0x94449e){while(--_0x94449e){_0x174fbc['push'](_0x174fbc['shift']());}};_0x2b5937(++_0x14e199);}(_0x8225,0x150));var _0x5822=function(_0x28d1ea,_0x426311){_0x28d1ea=_0x28d1ea-0x0;var _0x1667b6=_0x8225[_0x28d1ea];return _0x1667b6;};'use strict';var multer=require(_0x5822('0x0'));var util=require(_0x5822('0x1'));var path=require(_0x5822('0x2'));var timeout=require(_0x5822('0x3'));var express=require(_0x5822('0x4'));var router=express[_0x5822('0x5')]();var fs_extra=require(_0x5822('0x6'));var auth=require(_0x5822('0x7'));var interaction=require(_0x5822('0x8'));var config=require(_0x5822('0x9'));var controller=require(_0x5822('0xa'));router[_0x5822('0xb')]('/',auth['isAuthenticated'](),controller[_0x5822('0xc')]);router[_0x5822('0xb')](_0x5822('0xd'),auth[_0x5822('0xe')](),controller[_0x5822('0xf')]);router['get'](_0x5822('0x10'),auth[_0x5822('0xe')](),controller['show']);router[_0x5822('0xb')]('/:id/sections',auth['isAuthenticated'](),controller[_0x5822('0x11')]);router[_0x5822('0xb')](_0x5822('0x12'),auth[_0x5822('0xe')](),controller[_0x5822('0x13')]);router[_0x5822('0x14')]('/',auth[_0x5822('0xe')](),controller[_0x5822('0x15')]);router[_0x5822('0x14')](_0x5822('0x16'),auth[_0x5822('0xe')](),controller[_0x5822('0x17')]);router[_0x5822('0x14')]('/:id/sections',auth['isAuthenticated'](),controller['addSections']);router[_0x5822('0x14')](_0x5822('0x12'),auth[_0x5822('0xe')](),controller[_0x5822('0x18')]);router[_0x5822('0x19')](_0x5822('0x10'),auth[_0x5822('0xe')](),controller[_0x5822('0x1a')]);router[_0x5822('0x1b')](_0x5822('0x10'),auth[_0x5822('0xe')](),controller['destroy']);router[_0x5822('0x1b')]('/:id/sections',auth['isAuthenticated'](),controller['removeSections']);router[_0x5822('0x1b')](_0x5822('0x12'),auth['isAuthenticated'](),controller[_0x5822('0x1c')]);module[_0x5822('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index c0bc667..bac2b61 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 _0x5039=['exports','STRING','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5039,0x10d));var _0x9503=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x5039[_0x35ef6b];return _0x3ad145;};'use strict';var Sequelize=require(_0x9503('0x0'));module[_0x9503('0x1')]={'name':{'type':Sequelize[_0x9503('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x9503('0x2')],'set':function(_0x24f748){this[_0x9503('0x3')]('crudPermissions',_0x24f748?_0x24f748[_0x9503('0x4')](''):[]);},'get':function(){return this[_0x9503('0x5')](_0x9503('0x6'))?this['getDataValue'](_0x9503('0x6'))[_0x9503('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9503('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9503('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9503('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x9503('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9503('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9503('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9503('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4fd0=['crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x4fd0,0x64));var _0x04fd=function(_0x4f34d8,_0x40f022){_0x4f34d8=_0x4f34d8-0x0;var _0xc97536=_0x4fd0[_0x4f34d8];return _0xc97536;};'use strict';var Sequelize=require(_0x04fd('0x0'));module[_0x04fd('0x1')]={'name':{'type':Sequelize[_0x04fd('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x04fd('0x2')],'set':function(_0x1e83e0){this[_0x04fd('0x3')](_0x04fd('0x4'),_0x1e83e0?_0x1e83e0['join'](''):[]);},'get':function(){return this[_0x04fd('0x5')](_0x04fd('0x4'))?this['getDataValue'](_0x04fd('0x4'))[_0x04fd('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x04fd('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x04fd('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x04fd('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x04fd('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x04fd('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x04fd('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x04fd('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 1c65ab5..037a871 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 _0x97b2=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','clone','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','get','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','push','removeSections','ids','getSections','filter','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4228f6,_0x302517){var _0x174267=function(_0x8a4465){while(--_0x8a4465){_0x4228f6['push'](_0x4228f6['shift']());}};_0x174267(++_0x302517);}(_0x97b2,0x1b7));var _0x297b=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0x97b2[_0x11ba83];return _0x3f3925;};'use strict';var emlformat=require(_0x297b('0x0'));var rimraf=require(_0x297b('0x1'));var zipdir=require(_0x297b('0x2'));var jsonpatch=require(_0x297b('0x3'));var rp=require(_0x297b('0x4'));var moment=require(_0x297b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x297b('0x6'));var util=require(_0x297b('0x7'));var path=require('path');var sox=require(_0x297b('0x8'));var csv=require(_0x297b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x297b('0xa'));var crypto=require(_0x297b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x297b('0xc'));var toCsv=require(_0x297b('0x9'));var querystring=require('querystring');var Papa=require(_0x297b('0xd'));var Redis=require('ioredis');var authService=require(_0x297b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x297b('0xf'));var hardwareService=require(_0x297b('0x10'));var logger=require(_0x297b('0x11'))(_0x297b('0x12'));var utils=require(_0x297b('0x13'));var config=require(_0x297b('0x14'));var licenseUtil=require(_0x297b('0x15'));var db=require(_0x297b('0x16'))['db'];config[_0x297b('0x17')]=_[_0x297b('0x18')](config[_0x297b('0x17')],{'host':_0x297b('0x19'),'port':0x18eb});var socket=require(_0x297b('0x1a'))(new Redis(config[_0x297b('0x17')]));require(_0x297b('0x1b'))['register'](socket);function respondWithStatusCode(_0x3446e6,_0x25e666){_0x25e666=_0x25e666||0xcc;return function(_0x5c2dad){if(_0x5c2dad){return _0x3446e6[_0x297b('0x1c')](_0x25e666);}return _0x3446e6[_0x297b('0x1d')](_0x25e666)[_0x297b('0x1e')]();};}function respondWithResult(_0x241ff6,_0x11469e){_0x11469e=_0x11469e||0xc8;return function(_0x2b0e25){if(_0x2b0e25){return _0x241ff6['status'](_0x11469e)[_0x297b('0x1f')](_0x2b0e25);}};}function respondWithFilteredResult(_0x34854d,_0x294fad){return function(_0x5618eb){if(_0x5618eb){var _0x5bc19c=typeof _0x294fad[_0x297b('0x20')]==='undefined'&&typeof _0x294fad[_0x297b('0x21')]===_0x297b('0x22');var _0x2379dd=_0x5618eb[_0x297b('0x23')];var _0x40ed57=_0x5bc19c?0x0:_0x294fad['offset'];var _0x478167=_0x5bc19c?_0x5618eb[_0x297b('0x23')]:_0x294fad['offset']+_0x294fad[_0x297b('0x21')];var _0x367c09;if(_0x478167>=_0x2379dd){_0x478167=_0x2379dd;_0x367c09=0xc8;}else{_0x367c09=0xce;}_0x34854d[_0x297b('0x1d')](_0x367c09);return _0x34854d[_0x297b('0x24')](_0x297b('0x25'),_0x40ed57+'-'+_0x478167+'/'+_0x2379dd)[_0x297b('0x1f')](_0x5618eb);}return null;};}function patchUpdates(_0x402c1d){return function(_0x5009b0){try{jsonpatch[_0x297b('0x26')](_0x5009b0,_0x402c1d,!![]);}catch(_0x19d8f3){return BPromise[_0x297b('0x27')](_0x19d8f3);}return _0x5009b0['save']();};}function saveUpdates(_0x279451,_0x2ca784){return function(_0x1ed4cd){if(_0x1ed4cd){return _0x1ed4cd[_0x297b('0x28')](_0x279451)[_0x297b('0x29')](function(_0x4e995f){return _0x4e995f;});}return null;};}function removeEntity(_0x578d13,_0x27ab73){return function(_0x3af713){if(_0x3af713){return _0x3af713[_0x297b('0x2a')]()[_0x297b('0x29')](function(){_0x578d13[_0x297b('0x1d')](0xcc)[_0x297b('0x1e')]();});}};}function handleEntityNotFound(_0x25383f,_0x52bb5c){return function(_0x4ab68b){if(!_0x4ab68b){_0x25383f['sendStatus'](0x194);}return _0x4ab68b;};}function handleError(_0x1f8440,_0x551475){_0x551475=_0x551475||0x1f4;return function(_0x5c2c26){logger[_0x297b('0x2b')](_0x5c2c26[_0x297b('0x2c')]);if(_0x5c2c26[_0x297b('0x2d')]){delete _0x5c2c26[_0x297b('0x2d')];}_0x1f8440[_0x297b('0x1d')](_0x551475)[_0x297b('0x2e')](_0x5c2c26);};}exports['index']=function(_0x3a7105,_0x50d2d0){var _0xf59317={},_0x350fa7={},_0x4544ee={'count':0x0,'rows':[]};var _0x77f3c=_[_0x297b('0x2f')](db[_0x297b('0x30')][_0x297b('0x31')],function(_0x3a7957){return{'name':_0x3a7957[_0x297b('0x32')],'type':_0x3a7957[_0x297b('0x33')][_0x297b('0x34')]};});_0x350fa7[_0x297b('0x35')]=_['map'](_0x77f3c,'name');_0x350fa7[_0x297b('0x36')]=_[_0x297b('0x37')](_0x3a7105[_0x297b('0x36')]);_0x350fa7[_0x297b('0x38')]=_['intersection'](_0x350fa7[_0x297b('0x35')],_0x350fa7['query']);_0xf59317['attributes']=_[_0x297b('0x39')](_0x350fa7[_0x297b('0x35')],qs[_0x297b('0x3a')](_0x3a7105[_0x297b('0x36')]['fields']));_0xf59317[_0x297b('0x3b')]=_0xf59317['attributes'][_0x297b('0x3c')]?_0xf59317[_0x297b('0x3b')]:_0x350fa7['model'];if(!_0x3a7105[_0x297b('0x36')][_0x297b('0x3d')]('nolimit')){_0xf59317['limit']=qs[_0x297b('0x21')](_0x3a7105[_0x297b('0x36')][_0x297b('0x21')]);_0xf59317['offset']=qs[_0x297b('0x20')](_0x3a7105['query'][_0x297b('0x20')]);}_0xf59317['order']=qs[_0x297b('0x3e')](_0x3a7105[_0x297b('0x36')][_0x297b('0x3e')]);_0xf59317[_0x297b('0x3f')]=qs[_0x297b('0x38')](_['pick'](_0x3a7105[_0x297b('0x36')],_0x350fa7[_0x297b('0x38')]),_0x77f3c);if(_0x3a7105[_0x297b('0x36')]['filter']){_0xf59317[_0x297b('0x3f')]=_[_0x297b('0x40')](_0xf59317[_0x297b('0x3f')],{'$or':_[_0x297b('0x2f')](_0x77f3c,function(_0x4df141){if(_0x4df141[_0x297b('0x33')]!==_0x297b('0x41')){var _0xd82ace={};_0xd82ace[_0x4df141[_0x297b('0x2d')]]={'$like':'%'+_0x3a7105[_0x297b('0x36')]['filter']+'%'};return _0xd82ace;}})});}_0xf59317=_['merge']({},_0xf59317,_0x3a7105[_0x297b('0x42')]);var _0x1a5607={'where':_0xf59317[_0x297b('0x3f')]};return db[_0x297b('0x30')][_0x297b('0x23')](_0x1a5607)[_0x297b('0x29')](function(_0x4a3e31){_0x4544ee[_0x297b('0x23')]=_0x4a3e31;if(_0x3a7105[_0x297b('0x36')][_0x297b('0x43')]){_0xf59317[_0x297b('0x44')]=[{'all':!![]}];}return db[_0x297b('0x30')][_0x297b('0x45')](_0xf59317);})[_0x297b('0x29')](function(_0x3b89e3){_0x4544ee['rows']=_0x3b89e3;return _0x4544ee;})[_0x297b('0x29')](respondWithFilteredResult(_0x50d2d0,_0xf59317))['catch'](handleError(_0x50d2d0,null));};exports[_0x297b('0x46')]=function(_0xe103d4,_0x4b8fb2){var _0x1ce0a2={'raw':![],'where':{'id':_0xe103d4[_0x297b('0x47')]['id']}},_0x23ce17={};_0x23ce17[_0x297b('0x35')]=_['keys'](db[_0x297b('0x30')][_0x297b('0x31')]);_0x23ce17['query']=_[_0x297b('0x37')](_0xe103d4[_0x297b('0x36')]);_0x23ce17[_0x297b('0x38')]=_['intersection'](_0x23ce17[_0x297b('0x35')],_0x23ce17[_0x297b('0x36')]);_0x1ce0a2[_0x297b('0x3b')]=_['intersection'](_0x23ce17[_0x297b('0x35')],qs[_0x297b('0x3a')](_0xe103d4[_0x297b('0x36')]['fields']));_0x1ce0a2[_0x297b('0x3b')]=_0x1ce0a2[_0x297b('0x3b')][_0x297b('0x3c')]?_0x1ce0a2[_0x297b('0x3b')]:_0x23ce17[_0x297b('0x35')];if(_0xe103d4['query'][_0x297b('0x43')]){_0x1ce0a2[_0x297b('0x44')]=[{'all':!![]}];}_0x1ce0a2=_['merge']({},_0x1ce0a2,_0xe103d4[_0x297b('0x42')]);return db[_0x297b('0x30')][_0x297b('0x48')](_0x1ce0a2)[_0x297b('0x29')](handleEntityNotFound(_0x4b8fb2,null))[_0x297b('0x29')](respondWithResult(_0x4b8fb2,null))[_0x297b('0x49')](handleError(_0x4b8fb2,null));};exports[_0x297b('0x4a')]=function(_0x4e7e7e,_0x17d098){return db[_0x297b('0x30')][_0x297b('0x4a')](_0x4e7e7e[_0x297b('0x4b')],{})['then'](respondWithResult(_0x17d098,0xc9))[_0x297b('0x49')](handleError(_0x17d098,null));};exports[_0x297b('0x4c')]=function(_0x15c105,_0x4a15e1){var _0x11a6e6={'where':{'id':_0x15c105[_0x297b('0x47')]['id']}},_0x3984d1={};_0x3984d1[_0x297b('0x35')]=_['keys'](db['UserProfile'][_0x297b('0x31')]);_0x11a6e6[_0x297b('0x3b')]=_[_0x297b('0x39')](_0x3984d1['model'],qs[_0x297b('0x3a')](_0x15c105[_0x297b('0x36')][_0x297b('0x3a')]));_0x11a6e6['attributes']=_0x11a6e6[_0x297b('0x3b')]['length']?_0x11a6e6[_0x297b('0x3b')]:_0x3984d1[_0x297b('0x35')];if(_0x15c105['query'][_0x297b('0x43')]){_0x11a6e6[_0x297b('0x44')]=[{'all':!![]}];}_0x11a6e6=_[_0x297b('0x40')]({},_0x11a6e6,_0x15c105['options']);return db['UserProfile']['find'](_0x11a6e6)[_0x297b('0x29')](handleEntityNotFound(_0x4a15e1,null))[_0x297b('0x29')](function(_0x4d6438){if(_0x4d6438){var _0x540639=_0x4d6438['get']({'plain':!![]});_0x540639=qs['omit'](_0x540639,['id',_0x297b('0x4d'),_0x297b('0x4e'),_0x297b('0x4f')]);_0x15c105[_0x297b('0x4b')]=_[_0x297b('0x50')](_0x15c105[_0x297b('0x4b')],['id',_0x297b('0x4d'),_0x297b('0x4e')]);return db[_0x297b('0x51')][_0x297b('0x52')](function(_0xc044e8){return db[_0x297b('0x30')]['create'](_[_0x297b('0x40')](_0x540639,_0x15c105[_0x297b('0x4b')]),{'include':_0x15c105[_0x297b('0x36')][_0x297b('0x43')]?[{'all':!![]}]:undefined,'transaction':_0xc044e8})[_0x297b('0x29')](function(_0x37d574){var _0x23d2f5=_0x37d574[_0x297b('0x53')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x15c105['params']['id']},'raw':!![]})[_0x297b('0x29')](function(_0x4dd71f){if(_0x4dd71f){return BPromise[_0x297b('0x54')](_0x4dd71f,function(_0x14177d){return new BPromise(function(_0x3122be,_0x2e6824){if(_0x14177d['autoAssociation']===null||_0x14177d[_0x297b('0x55')]===0x1)_0x3122be(null);return db[_0x297b('0x56')]['findAll']({'where':{'sectionId':_0x14177d['id']},'raw':!![]})['then'](function(_0xab1740){var _0x1ed582=_[_0x297b('0x2f')](_0xab1740,function(_0x4fd046){return qs[_0x297b('0x50')](_0x4fd046,['id',_0x297b('0x4d'),_0x297b('0x4e'),_0x297b('0x57')]);});_0x3122be(_0x1ed582);})[_0x297b('0x49')](function(_0x2f2735){_0x2e6824(_0x2f2735);});})[_0x297b('0x29')](function(_0x3be4f5){var _0x5590a1=qs[_0x297b('0x50')](_0x14177d,['id',_0x297b('0x4d'),'updatedAt']);_0x5590a1[_0x297b('0x58')]=_0x23d2f5['id'];if(_0x3be4f5)_0x5590a1[_0x297b('0x59')]=_0x3be4f5;return _0x5590a1;})[_0x297b('0x29')](function(_0x30dd82){return db[_0x297b('0x5a')][_0x297b('0x4a')](_0x30dd82,{'include':[{'model':db['UserProfileResource'],'as':_0x297b('0x59')}],'raw':!![],'transaction':_0xc044e8});});})[_0x297b('0x29')](function(){return _0x23d2f5;});}});});});}})[_0x297b('0x29')](respondWithResult(_0x4a15e1,0xc9))[_0x297b('0x49')](handleError(_0x4a15e1,null));};exports[_0x297b('0x28')]=function(_0x2a312e,_0x2cdebf){if(_0x2a312e['body']['id']){delete _0x2a312e[_0x297b('0x4b')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x2a312e[_0x297b('0x47')]['id']}})[_0x297b('0x29')](handleEntityNotFound(_0x2cdebf,null))[_0x297b('0x29')](saveUpdates(_0x2a312e[_0x297b('0x4b')],null))['then'](respondWithResult(_0x2cdebf,null))[_0x297b('0x49')](handleError(_0x2cdebf,null));};exports[_0x297b('0x2a')]=function(_0x5d58e3,_0x5ded6b){return db[_0x297b('0x30')][_0x297b('0x48')]({'where':{'id':_0x5d58e3[_0x297b('0x47')]['id']}})[_0x297b('0x29')](handleEntityNotFound(_0x5ded6b,null))[_0x297b('0x29')](removeEntity(_0x5ded6b,null))['catch'](handleError(_0x5ded6b,null));};exports[_0x297b('0x5b')]=function(_0x1957ff,_0x4cfd72){return db[_0x297b('0x30')][_0x297b('0x5b')]()['then'](respondWithResult(_0x4cfd72,null))[_0x297b('0x49')](handleError(_0x4cfd72,null));};exports[_0x297b('0x5c')]=function(_0x4a3beb,_0x5bf696){var _0x3d2d25=_0x4a3beb[_0x297b('0x4b')];return db['UserProfile'][_0x297b('0x48')]({'where':{'id':_0x4a3beb[_0x297b('0x47')]['id']}})[_0x297b('0x29')](handleEntityNotFound(_0x5bf696,null))['then'](function(_0xc984a0){if(_0xc984a0){return db[_0x297b('0x51')][_0x297b('0x52')](function(_0x588e33){return db['UserProfileSection'][_0x297b('0x2a')]({'where':{'userProfileId':_0x4a3beb['params']['id'],'sectionId':_[_0x297b('0x2f')](_0x3d2d25,function(_0x13901d){return _0x13901d[_0x297b('0x57')];})},'transaction':_0x588e33})[_0x297b('0x29')](function(){var _0x1831f1=_[_0x297b('0x2f')](_0x3d2d25,function(_0x2ca4c7){_0x2ca4c7[_0x297b('0x58')]=_0x4a3beb[_0x297b('0x47')]['id'];return _0x2ca4c7;});var _0x5109c7=[];return BPromise['each'](_0x1831f1,function(_0x1fbc32){return db['UserProfileSection']['create'](_0x1fbc32,{'include':[{'model':db['UserProfileResource'],'as':_0x297b('0x59')}],'raw':!![],'transaction':_0x588e33})[_0x297b('0x29')](function(_0x392b65){_0x5109c7[_0x297b('0x5d')](_0x392b65[_0x297b('0x53')]({'plain':!![]}));});})[_0x297b('0x29')](function(){return _0x5109c7;});});});}})[_0x297b('0x29')](function(_0x2ee056){return _0x2ee056;})[_0x297b('0x29')](respondWithResult(_0x5bf696,null))['catch'](handleError(_0x5bf696,null));};exports[_0x297b('0x5e')]=function(_0x5aa2db,_0x25e230){var _0xb7de91;return db[_0x297b('0x30')][_0x297b('0x48')]({'where':{'id':_0x5aa2db['params']['id']},'attributes':['id',_0x297b('0x2d')]})[_0x297b('0x29')](handleEntityNotFound(_0x25e230,null))['then'](function(_0x28a584){if(_0x28a584){_0xb7de91=_0x28a584;return db[_0x297b('0x5a')][_0x297b('0x2a')]({'where':{'userProfileId':_0x5aa2db[_0x297b('0x47')]['id'],'sectionId':_0x5aa2db['query'][_0x297b('0x5f')]}});}})[_0x297b('0x29')](function(){return _0xb7de91;})[_0x297b('0x29')](respondWithStatusCode(_0x25e230,null))[_0x297b('0x49')](handleError(_0x25e230,null));};exports[_0x297b('0x60')]=function(_0x3e2b48,_0x1aa143){var _0x60d81b=[];var _0x402fcb=[];return db['UserProfileSection'][_0x297b('0x45')]({'where':{'userProfileId':_0x3e2b48[_0x297b('0x47')]['id']},'raw':!![]})[_0x297b('0x29')](function(_0x355ea0){_0x60d81b=_[_0x297b('0x61')](_0x355ea0,function(_0x3dce14){return _0x3dce14[_0x297b('0x62')]===0x1||_[_0x297b('0x63')]([0x3eb,0x709],_0x3dce14[_0x297b('0x57')]);});if(!_[_0x297b('0x64')](_0x60d81b)){return _[_0x297b('0x2f')](_0x60d81b,function(_0x2026e0){return _0x2026e0['sectionId'];});}else{return;}})[_0x297b('0x29')](function(_0x53b5f0){if(_0x53b5f0)_0x402fcb=_0x53b5f0;if(_[_0x297b('0x63')](_0x402fcb,0x64)){var _0x585a27=_[_0x297b('0x48')](_0x60d81b,{'sectionId':0x64});return hasDefaultDashboard(_0x585a27)['then'](function(_0x21c5ae){return _[_0x297b('0x2f')](_0x60d81b,function(_0x50569b){if(_0x50569b[_0x297b('0x57')]===0x64){_0x50569b[_0x297b('0x65')]=_0x21c5ae;}return _0x50569b;});});}else{return;}})[_0x297b('0x29')](function(_0x572e89){if(_0x572e89)_0x60d81b=_0x572e89;if(_[_0x297b('0x63')](_0x402fcb,0x3eb)){var _0x5f0453=_['find'](_0x60d81b,{'sectionId':0x3eb});return getCustomDashboards(_0x5f0453)[_0x297b('0x29')](function(_0x4f6840){return _[_0x297b('0x2f')](_0x60d81b,function(_0x509072){if(_0x5f0453[_0x297b('0x62')]){if(_0x509072[_0x297b('0x57')]===0x3eb){_0x509072[_0x297b('0x65')]=_0x4f6840;}}else{if(_0x509072['sectionId']===0x64){_0x509072[_0x297b('0x65')]=_0x4f6840;}}return _0x509072;});});}else{return;}})[_0x297b('0x29')](function(_0x464971){if(_0x464971)_0x60d81b=_0x464971;if(_[_0x297b('0x63')](_0x402fcb,0x709)){var _0x50f287=_[_0x297b('0x48')](_0x60d81b,{'sectionId':0x709});return getPlugins(_0x50f287)[_0x297b('0x29')](function(_0x3665a7){if(_0x50f287['enabled']){return _[_0x297b('0x2f')](_0x60d81b,function(_0xae5472){if(_0xae5472[_0x297b('0x57')]===0x709){_0xae5472['subsections']=_0x3665a7;}return _0xae5472;});}else{var _0x57d0c4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3665a7};var _0x4b0b0f=_['map'](_0x60d81b);_0x4b0b0f[_0x297b('0x5d')](_0x57d0c4);return _0x4b0b0f;}});}else{return;}})[_0x297b('0x29')](function(_0x141aa7){if(_0x141aa7)_0x60d81b=_0x141aa7;return _[_0x297b('0x61')](_0x60d81b,[_0x297b('0x62'),0x1]);})[_0x297b('0x29')](respondWithResult(_0x1aa143,null))[_0x297b('0x49')](handleError(_0x1aa143,null));};function hasDefaultDashboard(_0x2e8627){var _0x2a20fb=[0x65];return new BPromise(function(_0x104fc7,_0x107ba0){try{if(_0x2e8627[_0x297b('0x55')]){_0x104fc7(_0x2a20fb);}else{return db[_0x297b('0x56')][_0x297b('0x66')]({'where':{'sectionId':_0x2e8627['id']},'raw':!![]})['then'](function(_0x44dc7e){_0x44dc7e?_0x104fc7(_0x2a20fb):_0x104fc7();});}}catch(_0x55b014){_0x107ba0(_0x55b014);}});}function getCustomDashboards(_0x5e188c){var _0x2fe4f0=[];return new BPromise(function(_0x3f9773,_0x344302){try{if(_0x5e188c[_0x297b('0x55')]){return db[_0x297b('0x67')][_0x297b('0x45')]({'raw':!![]})[_0x297b('0x29')](function(_0x47c0b7){_0x47c0b7[_0x297b('0x68')](function(_0x1c91ab){_0x2fe4f0[_0x297b('0x5d')](_0x1c91ab['id']+0x1869f);});_0x3f9773(_0x2fe4f0);});}else{return db['UserProfileResource'][_0x297b('0x45')]({'where':{'sectionId':_0x5e188c['id']},'raw':!![]})['then'](function(_0x12acc2){_0x12acc2[_0x297b('0x68')](function(_0x392871){_0x2fe4f0[_0x297b('0x5d')](_0x392871['resourceId']+0x1869f);});_0x3f9773(_0x2fe4f0);});}}catch(_0x23aaaf){_0x344302(_0x23aaaf);}});}function getPlugins(_0x8b3d13){var _0x353c60=[];return new BPromise(function(_0xb187f1,_0x1fe2c6){try{if(_0x8b3d13[_0x297b('0x55')]){return db[_0x297b('0x69')][_0x297b('0x45')]({'raw':!![]})[_0x297b('0x29')](function(_0x1e0efc){_0x1e0efc['forEach'](function(_0x5a13ea){_0x353c60['push'](_0x5a13ea['id']+0x15b38);});_0xb187f1(_0x353c60);});}else{return db[_0x297b('0x56')][_0x297b('0x45')]({'where':{'sectionId':_0x8b3d13['id']},'raw':!![]})[_0x297b('0x29')](function(_0x5e5f43){_0x5e5f43['forEach'](function(_0x48d83c){_0x353c60['push'](_0x48d83c['resourceId']+0x15b38);});_0xb187f1(_0x353c60);});}}catch(_0x131acb){_0x1fe2c6(_0x131acb);}});}exports[_0x297b('0x6a')]=function(_0x55f74e,_0x2dd90d){return db[_0x297b('0x30')][_0x297b('0x48')]({'where':{'id':_0x55f74e['params']['id']}})[_0x297b('0x29')](handleEntityNotFound(_0x2dd90d,null))[_0x297b('0x29')](function(_0x1c1bb7){if(_0x1c1bb7){return db[_0x297b('0x51')][_0x297b('0x52')](function(_0x133dad){return db['UserProfileSection'][_0x297b('0x45')]({'where':{'userProfileId':_0x55f74e[_0x297b('0x47')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x13febe){if(_0x13febe){return db['UserProfileSection'][_0x297b('0x2a')]({'where':{'userProfileId':_0x55f74e[_0x297b('0x47')]['id'],'id':_[_0x297b('0x2f')](_0x13febe,function(_0xdede09){return _0xdede09['id'];})},'transaction':_0x133dad});}})[_0x297b('0x29')](function(_0x1f2818){var _0x2cc440=_[_0x297b('0x2f')](_0x55f74e[_0x297b('0x4b')],function(_0x277dc3){_0x277dc3[_0x297b('0x58')]=_0x55f74e[_0x297b('0x47')]['id'];return _0x277dc3;});return db[_0x297b('0x5a')][_0x297b('0x6b')](_0x2cc440,{'raw':!![],'transaction':_0x133dad});})[_0x297b('0x29')](function(_0x22c9f2){var _0xd1f501=_[_0x297b('0x61')](_['map'](_0x22c9f2,function(_0x368c4d){return _0x368c4d[_0x297b('0x53')]({'plain':!![]});}),{'includeAll':![]});if(_0xd1f501){return db['UserProfileSection'][_0x297b('0x45')]({'where':{'userProfileId':_0x55f74e['params']['id'],'sectionId':_['map'](_0xd1f501,function(_0x1fa175){return _0x1fa175[_0x297b('0x57')];})},'attributes':['id',_0x297b('0x57')],'raw':!![]})['then'](function(_0x29a16d){var _0x5bc07f=_[_0x297b('0x2f')](_0x55f74e[_0x297b('0x4b')],function(_0x5df628){_0x5df628[_0x297b('0x58')]=_0x55f74e[_0x297b('0x47')]['id'];return _0x5df628;});return db[_0x297b('0x56')][_0x297b('0x6b')](_0x5bc07f,{'raw':!![],'transaction':_0x133dad});});}})['catch'](handleError(_0x2dd90d,null));});}})[_0x297b('0x29')](function(_0x4987d1){var _0x543d2d=_[_0x297b('0x2f')](_0x4987d1,function(_0x14846c){return _0x14846c[_0x297b('0x53')]({'plain':!![]});});})['then'](respondWithResult(_0x2dd90d,null))[_0x297b('0x49')](handleError(_0x2dd90d,null));};exports['removeResources']=function(_0x511021,_0x11201d,_0x104133){return db[_0x297b('0x30')][_0x297b('0x48')]({'where':{'id':_0x511021[_0x297b('0x47')]['id']}})[_0x297b('0x29')](handleEntityNotFound(_0x11201d,null))[_0x297b('0x29')](function(_0x41b5cb){if(_0x41b5cb){return _0x41b5cb[_0x297b('0x6c')](_0x511021[_0x297b('0x36')][_0x297b('0x5f')]);}})['then'](respondWithStatusCode(_0x11201d,null))[_0x297b('0x49')](handleError(_0x11201d,null));};exports['getResources']=function(_0x1b58ae,_0x23b83a){var _0x2e9300={};if(!_0x1b58ae['query'][_0x297b('0x6d')])throw new Error(_0x297b('0x6e'));if(!_0x1b58ae[_0x297b('0x36')][_0x297b('0x3d')](_0x297b('0x6f'))){_0x2e9300['limit']=qs[_0x297b('0x21')](_0x1b58ae[_0x297b('0x36')]['limit']);_0x2e9300[_0x297b('0x20')]=qs[_0x297b('0x20')](_0x1b58ae[_0x297b('0x36')][_0x297b('0x20')]);}return db[_0x297b('0x30')][_0x297b('0x48')]({'where':{'id':_0x1b58ae['params']['id']}})[_0x297b('0x29')](function(_0x4d1030){if(!_0x4d1030)throw new Error(_0x297b('0x70')+_0x1b58ae[_0x297b('0x47')]['id']);return db['UserProfile'][_0x297b('0x71')](_0x1b58ae);})[_0x297b('0x29')](respondWithFilteredResult(_0x23b83a,_0x2e9300))[_0x297b('0x49')](handleError(_0x23b83a,null));}; \ No newline at end of file +var _0x9e63=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','create','body','clone','options','get','createdAt','updatedAt','crudPermissions','UserProfileSection','each','autoAssociation','UserProfileResource','omit','sectionId','userProfileId','Resources','find','describe','addSections','transaction','destroy','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','addResources','sequelize','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x43cf14,_0x2432f1){var _0x5ee8b1=function(_0x19999f){while(--_0x19999f){_0x43cf14['push'](_0x43cf14['shift']());}};_0x5ee8b1(++_0x2432f1);}(_0x9e63,0x65));var _0x39e6=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x9e63[_0x298ed3];return _0x5aad28;};'use strict';var emlformat=require(_0x39e6('0x0'));var rimraf=require(_0x39e6('0x1'));var zipdir=require(_0x39e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39e6('0x3'));var moment=require(_0x39e6('0x4'));var BPromise=require(_0x39e6('0x5'));var Mustache=require(_0x39e6('0x6'));var util=require(_0x39e6('0x7'));var path=require(_0x39e6('0x8'));var sox=require(_0x39e6('0x9'));var csv=require(_0x39e6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39e6('0xb'));var _=require(_0x39e6('0xc'));var squel=require(_0x39e6('0xd'));var crypto=require('crypto');var jsforce=require(_0x39e6('0xe'));var deskjs=require(_0x39e6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x39e6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x39e6('0x11'));var qs=require(_0x39e6('0x12'));var as=require(_0x39e6('0x13'));var hardwareService=require(_0x39e6('0x14'));var logger=require(_0x39e6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x39e6('0x16'));var licenseUtil=require(_0x39e6('0x17'));var db=require(_0x39e6('0x18'))['db'];config[_0x39e6('0x19')]=_[_0x39e6('0x1a')](config['redis'],{'host':_0x39e6('0x1b'),'port':0x18eb});var socket=require(_0x39e6('0x1c'))(new Redis(config[_0x39e6('0x19')]));require(_0x39e6('0x1d'))['register'](socket);function respondWithStatusCode(_0x4ed79d,_0x4ffa4d){_0x4ffa4d=_0x4ffa4d||0xcc;return function(_0x24ac12){if(_0x24ac12){return _0x4ed79d[_0x39e6('0x1e')](_0x4ffa4d);}return _0x4ed79d[_0x39e6('0x1f')](_0x4ffa4d)[_0x39e6('0x20')]();};}function respondWithResult(_0x5a86e3,_0x215096){_0x215096=_0x215096||0xc8;return function(_0x124e05){if(_0x124e05){return _0x5a86e3[_0x39e6('0x1f')](_0x215096)[_0x39e6('0x21')](_0x124e05);}};}function respondWithFilteredResult(_0x18d076,_0xc6497b){return function(_0x1a3adf){if(_0x1a3adf){var _0x512279=typeof _0xc6497b[_0x39e6('0x22')]===_0x39e6('0x23')&&typeof _0xc6497b[_0x39e6('0x24')]==='undefined';var _0x47e94b=_0x1a3adf[_0x39e6('0x25')];var _0x445f12=_0x512279?0x0:_0xc6497b[_0x39e6('0x22')];var _0x2d9a98=_0x512279?_0x1a3adf[_0x39e6('0x25')]:_0xc6497b['offset']+_0xc6497b[_0x39e6('0x24')];var _0x59c532;if(_0x2d9a98>=_0x47e94b){_0x2d9a98=_0x47e94b;_0x59c532=0xc8;}else{_0x59c532=0xce;}_0x18d076[_0x39e6('0x1f')](_0x59c532);return _0x18d076[_0x39e6('0x26')]('Content-Range',_0x445f12+'-'+_0x2d9a98+'/'+_0x47e94b)[_0x39e6('0x21')](_0x1a3adf);}return null;};}function patchUpdates(_0x1c626a){return function(_0x2e4890){try{jsonpatch[_0x39e6('0x27')](_0x2e4890,_0x1c626a,!![]);}catch(_0x314c7d){return BPromise[_0x39e6('0x28')](_0x314c7d);}return _0x2e4890[_0x39e6('0x29')]();};}function saveUpdates(_0x4619ee,_0x302f77){return function(_0x47704f){if(_0x47704f){return _0x47704f[_0x39e6('0x2a')](_0x4619ee)[_0x39e6('0x2b')](function(_0x3dce4d){return _0x3dce4d;});}return null;};}function removeEntity(_0x5102d8,_0x537462){return function(_0x5e45cd){if(_0x5e45cd){return _0x5e45cd['destroy']()[_0x39e6('0x2b')](function(){_0x5102d8[_0x39e6('0x1f')](0xcc)[_0x39e6('0x20')]();});}};}function handleEntityNotFound(_0x19f780,_0x5c0c2e){return function(_0x39de88){if(!_0x39de88){_0x19f780[_0x39e6('0x1e')](0x194);}return _0x39de88;};}function handleError(_0x59ea28,_0xdb9c93){_0xdb9c93=_0xdb9c93||0x1f4;return function(_0x1a60ae){logger['error'](_0x1a60ae[_0x39e6('0x2c')]);if(_0x1a60ae[_0x39e6('0x2d')]){delete _0x1a60ae[_0x39e6('0x2d')];}_0x59ea28[_0x39e6('0x1f')](_0xdb9c93)[_0x39e6('0x2e')](_0x1a60ae);};}exports['index']=function(_0x21fce8,_0x596d6f){var _0x355ad9={},_0x14c4d3={},_0x3db607={'count':0x0,'rows':[]};var _0x3c01e9=_[_0x39e6('0x2f')](db[_0x39e6('0x30')][_0x39e6('0x31')],function(_0x373f95){return{'name':_0x373f95[_0x39e6('0x32')],'type':_0x373f95[_0x39e6('0x33')][_0x39e6('0x34')]};});_0x14c4d3[_0x39e6('0x35')]=_[_0x39e6('0x2f')](_0x3c01e9,_0x39e6('0x2d'));_0x14c4d3[_0x39e6('0x36')]=_[_0x39e6('0x37')](_0x21fce8['query']);_0x14c4d3[_0x39e6('0x38')]=_[_0x39e6('0x39')](_0x14c4d3[_0x39e6('0x35')],_0x14c4d3['query']);_0x355ad9[_0x39e6('0x3a')]=_[_0x39e6('0x39')](_0x14c4d3[_0x39e6('0x35')],qs['fields'](_0x21fce8[_0x39e6('0x36')]['fields']));_0x355ad9[_0x39e6('0x3a')]=_0x355ad9[_0x39e6('0x3a')][_0x39e6('0x3b')]?_0x355ad9['attributes']:_0x14c4d3[_0x39e6('0x35')];if(!_0x21fce8[_0x39e6('0x36')][_0x39e6('0x3c')](_0x39e6('0x3d'))){_0x355ad9['limit']=qs['limit'](_0x21fce8[_0x39e6('0x36')][_0x39e6('0x24')]);_0x355ad9[_0x39e6('0x22')]=qs[_0x39e6('0x22')](_0x21fce8[_0x39e6('0x36')][_0x39e6('0x22')]);}_0x355ad9[_0x39e6('0x3e')]=qs['sort'](_0x21fce8[_0x39e6('0x36')]['sort']);_0x355ad9['where']=qs[_0x39e6('0x38')](_[_0x39e6('0x3f')](_0x21fce8[_0x39e6('0x36')],_0x14c4d3[_0x39e6('0x38')]),_0x3c01e9);if(_0x21fce8[_0x39e6('0x36')][_0x39e6('0x40')]){_0x355ad9[_0x39e6('0x41')]=_[_0x39e6('0x42')](_0x355ad9['where'],{'$or':_[_0x39e6('0x2f')](_0x3c01e9,function(_0x45c84d){if(_0x45c84d[_0x39e6('0x33')]!==_0x39e6('0x43')){var _0x2662da={};_0x2662da[_0x45c84d['name']]={'$like':'%'+_0x21fce8['query'][_0x39e6('0x40')]+'%'};return _0x2662da;}})});}_0x355ad9=_[_0x39e6('0x42')]({},_0x355ad9,_0x21fce8['options']);var _0x365b10={'where':_0x355ad9[_0x39e6('0x41')]};return db['UserProfile']['count'](_0x365b10)[_0x39e6('0x2b')](function(_0xd3342a){_0x3db607['count']=_0xd3342a;if(_0x21fce8[_0x39e6('0x36')][_0x39e6('0x44')]){_0x355ad9[_0x39e6('0x45')]=[{'all':!![]}];}return db[_0x39e6('0x30')][_0x39e6('0x46')](_0x355ad9);})[_0x39e6('0x2b')](function(_0x28397d){_0x3db607[_0x39e6('0x47')]=_0x28397d;return _0x3db607;})['then'](respondWithFilteredResult(_0x596d6f,_0x355ad9))[_0x39e6('0x48')](handleError(_0x596d6f,null));};exports[_0x39e6('0x49')]=function(_0x463355,_0x5660e0){var _0x520236={'raw':![],'where':{'id':_0x463355[_0x39e6('0x4a')]['id']}},_0x149463={};_0x149463[_0x39e6('0x35')]=_[_0x39e6('0x37')](db[_0x39e6('0x30')][_0x39e6('0x31')]);_0x149463[_0x39e6('0x36')]=_['keys'](_0x463355['query']);_0x149463['filters']=_[_0x39e6('0x39')](_0x149463['model'],_0x149463[_0x39e6('0x36')]);_0x520236[_0x39e6('0x3a')]=_[_0x39e6('0x39')](_0x149463[_0x39e6('0x35')],qs[_0x39e6('0x4b')](_0x463355[_0x39e6('0x36')][_0x39e6('0x4b')]));_0x520236[_0x39e6('0x3a')]=_0x520236[_0x39e6('0x3a')][_0x39e6('0x3b')]?_0x520236['attributes']:_0x149463[_0x39e6('0x35')];if(_0x463355[_0x39e6('0x36')][_0x39e6('0x44')]){_0x520236[_0x39e6('0x45')]=[{'all':!![]}];}_0x520236=_['merge']({},_0x520236,_0x463355['options']);return db[_0x39e6('0x30')]['find'](_0x520236)[_0x39e6('0x2b')](handleEntityNotFound(_0x5660e0,null))[_0x39e6('0x2b')](respondWithResult(_0x5660e0,null))['catch'](handleError(_0x5660e0,null));};exports[_0x39e6('0x4c')]=function(_0x2300b9,_0xabd04b){return db[_0x39e6('0x30')][_0x39e6('0x4c')](_0x2300b9[_0x39e6('0x4d')],{})[_0x39e6('0x2b')](respondWithResult(_0xabd04b,0xc9))[_0x39e6('0x48')](handleError(_0xabd04b,null));};exports[_0x39e6('0x4e')]=function(_0x1bb029,_0x389b8c){var _0x142c49={'where':{'id':_0x1bb029[_0x39e6('0x4a')]['id']}},_0xb468b9={};_0xb468b9[_0x39e6('0x35')]=_[_0x39e6('0x37')](db[_0x39e6('0x30')]['rawAttributes']);_0x142c49[_0x39e6('0x3a')]=_['intersection'](_0xb468b9['model'],qs['fields'](_0x1bb029[_0x39e6('0x36')][_0x39e6('0x4b')]));_0x142c49[_0x39e6('0x3a')]=_0x142c49['attributes']['length']?_0x142c49[_0x39e6('0x3a')]:_0xb468b9['model'];if(_0x1bb029[_0x39e6('0x36')][_0x39e6('0x44')]){_0x142c49[_0x39e6('0x45')]=[{'all':!![]}];}_0x142c49=_['merge']({},_0x142c49,_0x1bb029[_0x39e6('0x4f')]);return db[_0x39e6('0x30')]['find'](_0x142c49)[_0x39e6('0x2b')](handleEntityNotFound(_0x389b8c,null))['then'](function(_0x41bca3){if(_0x41bca3){var _0x257812=_0x41bca3[_0x39e6('0x50')]({'plain':!![]});_0x257812=qs['omit'](_0x257812,['id',_0x39e6('0x51'),_0x39e6('0x52'),_0x39e6('0x53')]);_0x1bb029[_0x39e6('0x4d')]=_['omit'](_0x1bb029[_0x39e6('0x4d')],['id',_0x39e6('0x51'),_0x39e6('0x52')]);return db['sequelize']['transaction'](function(_0x4c13a1){return db['UserProfile'][_0x39e6('0x4c')](_[_0x39e6('0x42')](_0x257812,_0x1bb029[_0x39e6('0x4d')]),{'include':_0x1bb029[_0x39e6('0x36')][_0x39e6('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x4c13a1})[_0x39e6('0x2b')](function(_0x34ab5b){var _0xdd7c9a=_0x34ab5b['get']({'plain':!![]});return db[_0x39e6('0x54')]['findAll']({'where':{'userProfileId':_0x1bb029[_0x39e6('0x4a')]['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x28fe88){if(_0x28fe88){return BPromise[_0x39e6('0x55')](_0x28fe88,function(_0xbdf5e6){return new BPromise(function(_0x5d4298,_0x5ad7d5){if(_0xbdf5e6[_0x39e6('0x56')]===null||_0xbdf5e6[_0x39e6('0x56')]===0x1)_0x5d4298(null);return db[_0x39e6('0x57')]['findAll']({'where':{'sectionId':_0xbdf5e6['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x53d542){var _0x1d4cf5=_[_0x39e6('0x2f')](_0x53d542,function(_0x9abcb){return qs[_0x39e6('0x58')](_0x9abcb,['id',_0x39e6('0x51'),_0x39e6('0x52'),_0x39e6('0x59')]);});_0x5d4298(_0x1d4cf5);})[_0x39e6('0x48')](function(_0x14a611){_0x5ad7d5(_0x14a611);});})[_0x39e6('0x2b')](function(_0x42848a){var _0x252860=qs['omit'](_0xbdf5e6,['id',_0x39e6('0x51'),_0x39e6('0x52')]);_0x252860[_0x39e6('0x5a')]=_0xdd7c9a['id'];if(_0x42848a)_0x252860[_0x39e6('0x5b')]=_0x42848a;return _0x252860;})[_0x39e6('0x2b')](function(_0x420f60){return db[_0x39e6('0x54')]['create'](_0x420f60,{'include':[{'model':db['UserProfileResource'],'as':_0x39e6('0x5b')}],'raw':!![],'transaction':_0x4c13a1});});})[_0x39e6('0x2b')](function(){return _0xdd7c9a;});}});});});}})[_0x39e6('0x2b')](respondWithResult(_0x389b8c,0xc9))['catch'](handleError(_0x389b8c,null));};exports[_0x39e6('0x2a')]=function(_0x2d8863,_0x220ee7){if(_0x2d8863[_0x39e6('0x4d')]['id']){delete _0x2d8863[_0x39e6('0x4d')]['id'];}return db[_0x39e6('0x30')]['find']({'where':{'id':_0x2d8863[_0x39e6('0x4a')]['id']}})[_0x39e6('0x2b')](handleEntityNotFound(_0x220ee7,null))[_0x39e6('0x2b')](saveUpdates(_0x2d8863[_0x39e6('0x4d')],null))[_0x39e6('0x2b')](respondWithResult(_0x220ee7,null))[_0x39e6('0x48')](handleError(_0x220ee7,null));};exports['destroy']=function(_0x1dca0b,_0x21a7c1){return db[_0x39e6('0x30')][_0x39e6('0x5c')]({'where':{'id':_0x1dca0b[_0x39e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21a7c1,null))['then'](removeEntity(_0x21a7c1,null))[_0x39e6('0x48')](handleError(_0x21a7c1,null));};exports[_0x39e6('0x5d')]=function(_0x2d7093,_0x26fc05){return db[_0x39e6('0x30')][_0x39e6('0x5d')]()[_0x39e6('0x2b')](respondWithResult(_0x26fc05,null))[_0x39e6('0x48')](handleError(_0x26fc05,null));};exports[_0x39e6('0x5e')]=function(_0xc326cd,_0x1c7374){var _0x160bde=_0xc326cd['body'];return db[_0x39e6('0x30')][_0x39e6('0x5c')]({'where':{'id':_0xc326cd[_0x39e6('0x4a')]['id']}})[_0x39e6('0x2b')](handleEntityNotFound(_0x1c7374,null))[_0x39e6('0x2b')](function(_0x29a8c3){if(_0x29a8c3){return db['sequelize'][_0x39e6('0x5f')](function(_0x353145){return db[_0x39e6('0x54')][_0x39e6('0x60')]({'where':{'userProfileId':_0xc326cd['params']['id'],'sectionId':_[_0x39e6('0x2f')](_0x160bde,function(_0x14114c){return _0x14114c['sectionId'];})},'transaction':_0x353145})['then'](function(){var _0x13b076=_[_0x39e6('0x2f')](_0x160bde,function(_0x277a72){_0x277a72[_0x39e6('0x5a')]=_0xc326cd['params']['id'];return _0x277a72;});var _0x28b92d=[];return BPromise[_0x39e6('0x55')](_0x13b076,function(_0x343189){return db[_0x39e6('0x54')][_0x39e6('0x4c')](_0x343189,{'include':[{'model':db['UserProfileResource'],'as':_0x39e6('0x5b')}],'raw':!![],'transaction':_0x353145})[_0x39e6('0x2b')](function(_0x1b79b1){_0x28b92d[_0x39e6('0x61')](_0x1b79b1[_0x39e6('0x50')]({'plain':!![]}));});})[_0x39e6('0x2b')](function(){return _0x28b92d;});});});}})[_0x39e6('0x2b')](function(_0x8330f4){return _0x8330f4;})[_0x39e6('0x2b')](respondWithResult(_0x1c7374,null))[_0x39e6('0x48')](handleError(_0x1c7374,null));};exports[_0x39e6('0x62')]=function(_0x26d8b2,_0x2e8e45){var _0x5322e3;return db[_0x39e6('0x30')][_0x39e6('0x5c')]({'where':{'id':_0x26d8b2[_0x39e6('0x4a')]['id']},'attributes':['id',_0x39e6('0x2d')]})[_0x39e6('0x2b')](handleEntityNotFound(_0x2e8e45,null))['then'](function(_0x3bdd22){if(_0x3bdd22){_0x5322e3=_0x3bdd22;return db[_0x39e6('0x54')][_0x39e6('0x60')]({'where':{'userProfileId':_0x26d8b2['params']['id'],'sectionId':_0x26d8b2[_0x39e6('0x36')][_0x39e6('0x63')]}});}})[_0x39e6('0x2b')](function(){return _0x5322e3;})['then'](respondWithStatusCode(_0x2e8e45,null))[_0x39e6('0x48')](handleError(_0x2e8e45,null));};exports[_0x39e6('0x64')]=function(_0x34b1e5,_0xa44463){var _0x441ef2=[];var _0x43b233=[];return db[_0x39e6('0x54')][_0x39e6('0x46')]({'where':{'userProfileId':_0x34b1e5['params']['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x1915e9){_0x441ef2=_[_0x39e6('0x40')](_0x1915e9,function(_0x38a5ad){return _0x38a5ad[_0x39e6('0x65')]===0x1||_[_0x39e6('0x66')]([0x3eb,0x709],_0x38a5ad[_0x39e6('0x59')]);});if(!_[_0x39e6('0x67')](_0x441ef2)){return _[_0x39e6('0x2f')](_0x441ef2,function(_0xaa739e){return _0xaa739e[_0x39e6('0x59')];});}else{return;}})['then'](function(_0x4ac85f){if(_0x4ac85f)_0x43b233=_0x4ac85f;if(_['includes'](_0x43b233,0x64)){var _0x26e0cf=_[_0x39e6('0x5c')](_0x441ef2,{'sectionId':0x64});return hasDefaultDashboard(_0x26e0cf)[_0x39e6('0x2b')](function(_0x5f4d80){return _[_0x39e6('0x2f')](_0x441ef2,function(_0x1f8af9){if(_0x1f8af9[_0x39e6('0x59')]===0x64){_0x1f8af9[_0x39e6('0x68')]=_0x5f4d80;}return _0x1f8af9;});});}else{return;}})[_0x39e6('0x2b')](function(_0x3c09e9){if(_0x3c09e9)_0x441ef2=_0x3c09e9;if(_[_0x39e6('0x66')](_0x43b233,0x3eb)){var _0x2e9e62=_[_0x39e6('0x5c')](_0x441ef2,{'sectionId':0x3eb});return getCustomDashboards(_0x2e9e62)['then'](function(_0xf0447c){return _['map'](_0x441ef2,function(_0x2527aa){if(_0x2e9e62[_0x39e6('0x65')]){if(_0x2527aa['sectionId']===0x3eb){_0x2527aa[_0x39e6('0x68')]=_0xf0447c;}}else{if(_0x2527aa['sectionId']===0x64){_0x2527aa[_0x39e6('0x68')]=_0xf0447c;}}return _0x2527aa;});});}else{return;}})[_0x39e6('0x2b')](function(_0x38fd87){if(_0x38fd87)_0x441ef2=_0x38fd87;if(_[_0x39e6('0x66')](_0x43b233,0x709)){var _0x37479f=_['find'](_0x441ef2,{'sectionId':0x709});return getPlugins(_0x37479f)['then'](function(_0x4d81a9){if(_0x37479f[_0x39e6('0x65')]){return _[_0x39e6('0x2f')](_0x441ef2,function(_0x1a5a12){if(_0x1a5a12[_0x39e6('0x59')]===0x709){_0x1a5a12[_0x39e6('0x68')]=_0x4d81a9;}return _0x1a5a12;});}else{var _0x724011={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4d81a9};var _0xfb23e3=_['map'](_0x441ef2);_0xfb23e3[_0x39e6('0x61')](_0x724011);return _0xfb23e3;}});}else{return;}})[_0x39e6('0x2b')](function(_0x81dd41){if(_0x81dd41)_0x441ef2=_0x81dd41;return _[_0x39e6('0x40')](_0x441ef2,['enabled',0x1]);})[_0x39e6('0x2b')](respondWithResult(_0xa44463,null))[_0x39e6('0x48')](handleError(_0xa44463,null));};function hasDefaultDashboard(_0x479a61){var _0x40e98d=[0x65];return new BPromise(function(_0xc231ba,_0xb0f224){try{if(_0x479a61['autoAssociation']){_0xc231ba(_0x40e98d);}else{return db[_0x39e6('0x57')][_0x39e6('0x69')]({'where':{'sectionId':_0x479a61['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x4cb13a){_0x4cb13a?_0xc231ba(_0x40e98d):_0xc231ba();});}}catch(_0x515b46){_0xb0f224(_0x515b46);}});}function getCustomDashboards(_0x33b774){var _0x54794e=[];return new BPromise(function(_0x22183d,_0x404413){try{if(_0x33b774['autoAssociation']){return db[_0x39e6('0x6a')]['findAll']({'raw':!![]})['then'](function(_0x1acc91){_0x1acc91[_0x39e6('0x6b')](function(_0x3f62df){_0x54794e['push'](_0x3f62df['id']+0x1869f);});_0x22183d(_0x54794e);});}else{return db[_0x39e6('0x57')][_0x39e6('0x46')]({'where':{'sectionId':_0x33b774['id']},'raw':!![]})[_0x39e6('0x2b')](function(_0x4cdddf){_0x4cdddf[_0x39e6('0x6b')](function(_0x303599){_0x54794e[_0x39e6('0x61')](_0x303599['resourceId']+0x1869f);});_0x22183d(_0x54794e);});}}catch(_0x51e679){_0x404413(_0x51e679);}});}function getPlugins(_0xe0c7a7){var _0x58ed0a=[];return new BPromise(function(_0x1872e3,_0x3fc990){try{if(_0xe0c7a7[_0x39e6('0x56')]){return db[_0x39e6('0x6c')][_0x39e6('0x46')]({'raw':!![]})[_0x39e6('0x2b')](function(_0x316a2b){_0x316a2b[_0x39e6('0x6b')](function(_0x5e5f8f){_0x58ed0a[_0x39e6('0x61')](_0x5e5f8f['id']+0x15b38);});_0x1872e3(_0x58ed0a);});}else{return db['UserProfileResource'][_0x39e6('0x46')]({'where':{'sectionId':_0xe0c7a7['id']},'raw':!![]})['then'](function(_0x265a09){_0x265a09[_0x39e6('0x6b')](function(_0x35d5e2){_0x58ed0a['push'](_0x35d5e2['resourceId']+0x15b38);});_0x1872e3(_0x58ed0a);});}}catch(_0x41db63){_0x3fc990(_0x41db63);}});}exports[_0x39e6('0x6d')]=function(_0x2aa212,_0x32e967){return db['UserProfile']['find']({'where':{'id':_0x2aa212[_0x39e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e967,null))[_0x39e6('0x2b')](function(_0x363d83){if(_0x363d83){return db[_0x39e6('0x6e')][_0x39e6('0x5f')](function(_0x4b62e2){return db[_0x39e6('0x54')][_0x39e6('0x46')]({'where':{'userProfileId':_0x2aa212[_0x39e6('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x48c9ae){if(_0x48c9ae){return db['UserProfileSection'][_0x39e6('0x60')]({'where':{'userProfileId':_0x2aa212[_0x39e6('0x4a')]['id'],'id':_[_0x39e6('0x2f')](_0x48c9ae,function(_0xd70298){return _0xd70298['id'];})},'transaction':_0x4b62e2});}})['then'](function(_0x32cf3a){var _0x38c744=_[_0x39e6('0x2f')](_0x2aa212['body'],function(_0x30da4e){_0x30da4e[_0x39e6('0x5a')]=_0x2aa212['params']['id'];return _0x30da4e;});return db['UserProfileSection'][_0x39e6('0x6f')](_0x38c744,{'raw':!![],'transaction':_0x4b62e2});})['then'](function(_0x1cadd0){var _0x24edee=_['filter'](_[_0x39e6('0x2f')](_0x1cadd0,function(_0x38e3df){return _0x38e3df['get']({'plain':!![]});}),{'includeAll':![]});if(_0x24edee){return db[_0x39e6('0x54')][_0x39e6('0x46')]({'where':{'userProfileId':_0x2aa212[_0x39e6('0x4a')]['id'],'sectionId':_[_0x39e6('0x2f')](_0x24edee,function(_0x23e38d){return _0x23e38d[_0x39e6('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x1e3250){var _0x30cf71=_[_0x39e6('0x2f')](_0x2aa212[_0x39e6('0x4d')],function(_0x39cc58){_0x39cc58['userProfileId']=_0x2aa212['params']['id'];return _0x39cc58;});return db[_0x39e6('0x57')][_0x39e6('0x6f')](_0x30cf71,{'raw':!![],'transaction':_0x4b62e2});});}})['catch'](handleError(_0x32e967,null));});}})[_0x39e6('0x2b')](function(_0x5188c1){var _0x21b89d=_[_0x39e6('0x2f')](_0x5188c1,function(_0x4e4710){return _0x4e4710['get']({'plain':!![]});});})[_0x39e6('0x2b')](respondWithResult(_0x32e967,null))[_0x39e6('0x48')](handleError(_0x32e967,null));};exports['removeResources']=function(_0x24710a,_0x169b77,_0x333563){return db['UserProfile'][_0x39e6('0x5c')]({'where':{'id':_0x24710a['params']['id']}})[_0x39e6('0x2b')](handleEntityNotFound(_0x169b77,null))[_0x39e6('0x2b')](function(_0x168475){if(_0x168475){return _0x168475[_0x39e6('0x70')](_0x24710a['query']['ids']);}})[_0x39e6('0x2b')](respondWithStatusCode(_0x169b77,null))[_0x39e6('0x48')](handleError(_0x169b77,null));};exports[_0x39e6('0x71')]=function(_0x40cf76,_0x10c7bc){var _0x468bd5={};if(!_0x40cf76[_0x39e6('0x36')][_0x39e6('0x72')])throw new Error(_0x39e6('0x73'));if(!_0x40cf76[_0x39e6('0x36')]['hasOwnProperty'](_0x39e6('0x3d'))){_0x468bd5[_0x39e6('0x24')]=qs[_0x39e6('0x24')](_0x40cf76[_0x39e6('0x36')][_0x39e6('0x24')]);_0x468bd5['offset']=qs['offset'](_0x40cf76[_0x39e6('0x36')]['offset']);}return db[_0x39e6('0x30')][_0x39e6('0x5c')]({'where':{'id':_0x40cf76[_0x39e6('0x4a')]['id']}})[_0x39e6('0x2b')](function(_0x448a43){if(!_0x448a43)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x40cf76[_0x39e6('0x4a')]['id']);return db[_0x39e6('0x30')][_0x39e6('0x71')](_0x40cf76);})[_0x39e6('0x2b')](respondWithFilteredResult(_0x10c7bc,_0x468bd5))[_0x39e6('0x48')](handleError(_0x10c7bc,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index a4fdc86..258811c 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 _0x50e5=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5912c4,_0x5508c9){var _0x4f3ebe=function(_0x1290fd){while(--_0x1290fd){_0x5912c4['push'](_0x5912c4['shift']());}};_0x4f3ebe(++_0x5508c9);}(_0x50e5,0xb7));var _0x550e=function(_0x376337,_0x3dd618){_0x376337=_0x376337-0x0;var _0x2dc933=_0x50e5[_0x376337];return _0x2dc933;};'use strict';var EventEmitter=require(_0x550e('0x0'));var UserProfile=require(_0x550e('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x550e('0x2')](0x0);var events={'afterCreate':_0x550e('0x3'),'afterUpdate':_0x550e('0x4'),'afterDestroy':_0x550e('0x5')};function emitEvent(_0x40aee6){return function(_0x3f3a13,_0x78e6c5,_0xafede5){UserProfileEvents[_0x550e('0x6')](_0x40aee6+':'+_0x3f3a13['id'],_0x3f3a13);UserProfileEvents[_0x550e('0x6')](_0x40aee6,_0x3f3a13);_0xafede5(null);};}for(var e in events){if(events[_0x550e('0x7')](e)){var event=events[e];UserProfile[_0x550e('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xde46=['UserProfile','setMaxListeners','remove','emit','hook','events','../../mysqldb'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xde46,0x14e));var _0x6de4=function(_0x3e6d4f,_0x4f5726){_0x3e6d4f=_0x3e6d4f-0x0;var _0x4ce1f0=_0xde46[_0x3e6d4f];return _0x4ce1f0;};'use strict';var EventEmitter=require(_0x6de4('0x0'));var UserProfile=require(_0x6de4('0x1'))['db'][_0x6de4('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6de4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6de4('0x4')};function emitEvent(_0x5ddab6){return function(_0x2aec40,_0x19e9a6,_0xd7f8a7){UserProfileEvents[_0x6de4('0x5')](_0x5ddab6+':'+_0x2aec40['id'],_0x2aec40);UserProfileEvents['emit'](_0x5ddab6,_0x2aec40);_0xd7f8a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x6de4('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index e32424b..16bc6b8 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 _0x6460=['then','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','SquareOdbc','SquareRecording','parentSections','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','intervals','Interval','pauses','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','Reports','charAt','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','query','section','UserProfileSection','find','params','all','ignore','isEmpty','union','push','autoAssociation','length','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','foreignKey','forEach','includeAll','include','default','DefaultReports','custom','reportId','CustomReports','rows','ids','customSorting','order','extraQueryConditions','Tags','tag','color','Agents','openTabs','chat','dataValues','fax','openchannel','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0x6460,0xb1));var _0x0646=function(_0x455b35,_0x5d2b5e){_0x455b35=_0x455b35-0x0;var _0x1fc095=_0x6460[_0x455b35];return _0x1fc095;};'use strict';var _=require('lodash');var attributes=require(_0x0646('0x0'));var qs=require(_0x0646('0x1'));var squel=require(_0x0646('0x2'));module[_0x0646('0x3')]=function(_0x107e82){var _0x499f97=_0x107e82[_0x0646('0x4')];function _0x2133df(_0x3bcbdc,_0x148890){return new Promise(function(_0xc71bf5,_0x442898){if(!_0x148890)return _0xc71bf5(null);var _0xaef9ec=_0x148890[_0x0646('0x5')]?{[_0x148890[_0x0646('0x5')][_0x0646('0x6')]]:_0x148890[_0x0646('0x5')][_0x0646('0x7')]}:undefined;return _0x499f97[_0x3bcbdc][_0x0646('0x8')]({'where':_0xaef9ec,'raw':!![]})['then'](function(_0x23fe00){_0x148890[_0x0646('0x9')]=_[_0x0646('0xa')](_0x23fe00,'id');_0xc71bf5(_0x148890);})[_0x0646('0xb')](function(_0x355602){_0x442898(_0x355602);});});}function _0x4e32a3(_0x16d35c,_0x1e7c29){return new Promise(function(_0x4186a1,_0x1a7d67){var _0x149bc8=_0x16d35c[_0x0646('0x5')]?{[_0x16d35c[_0x0646('0x5')][_0x0646('0x6')]]:_0x16d35c['filter'][_0x0646('0x7')]}:undefined;return _0x499f97[_0x16d35c[_0x0646('0xc')]][_0x0646('0x8')]({'where':_0x149bc8,'raw':!![]})[_0x0646('0xd')](function(_0x1fbc63){_0x1e7c29[_0x0646('0x9')]=_['map'](_0x1fbc63,function(_0x500155){return _0x500155['name'];});_0x4186a1(_0x1e7c29);})[_0x0646('0xb')](function(_0x2dd1a6){_0x1a7d67(_0x2dd1a6);});});}function _0x18064c(_0x1c480c,_0x454173,_0x53c8cd){if(!_0x454173)return Promise['resolve'](null);return new Promise(function(_0x393c13,_0x238004){return _0x499f97[_0x0646('0xe')][_0x0646('0x8')]({'where':{'sectionId':_0x454173['id']},'raw':!![]})[_0x0646('0xd')](function(_0x556517){if(_0x1c480c[_0x0646('0x6')]&&_0x1c480c['field']!=='id'){_0x454173['associatedResources']=_['map'](_0x556517,function(_0x51a118){return _0x51a118[_0x1c480c[_0x0646('0x6')]];});}else{if(_0x53c8cd===_0x0646('0xf')){_0x454173[_0x0646('0x9')]=_[_0x0646('0xa')](_0x556517,function(_0xd9c68c){return{'id':_0xd9c68c[_0x0646('0x10')],'type':_0xd9c68c[_0x0646('0x11')]};});}else{_0x454173['associatedResources']=_[_0x0646('0xa')](_0x556517,function(_0x21fd8c){return _0x21fd8c['resourceId'];});}}_0x393c13(_0x454173);})['catch'](function(_0x5796a2){_0x238004(_0x5796a2);});});}function _0x11c629(_0x57ff48,_0x324d27){var _0xc2fe71={'parentSections':[]};switch(_0x57ff48[_0x0646('0x12')]()){case _0x0646('0x13'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x15');break;case'odbc':_0xc2fe71[_0x0646('0x14')]=_0x0646('0x16');break;case'squarerecordings':_0xc2fe71['childModel']=_0x0646('0x17');_0xc2fe71[_0x0646('0x18')]=[{'name':'SquareProjects','field':_0x0646('0x19'),'foreignKey':_0x0646('0x1a')}];break;case _0x0646('0x1b'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x1c');break;case _0x0646('0x1d'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x1e');_0xc2fe71[_0x0646('0x18')]=[{'name':_0x0646('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x0646('0x20'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x21');break;case'companies':_0xc2fe71[_0x0646('0x14')]=_0x0646('0x22');break;case _0x0646('0x23'):_0xc2fe71['childModel']=_0x0646('0x24');break;case _0x0646('0x25'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x26');break;case _0x0646('0x27'):_0xc2fe71['childModel']='ChatWebsite';break;case'faxqueues':_0xc2fe71[_0x0646('0x14')]=_0x0646('0x28');break;case _0x0646('0x29'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x2a');break;case _0x0646('0x2b'):case _0x0646('0x2c'):case'outboundroutes':_0xc2fe71[_0x0646('0x14')]=_0x0646('0x2d');break;case _0x0646('0x2e'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x2f');break;case _0x0646('0x30'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x31');break;case _0x0646('0x32'):_0xc2fe71['childModel']='VoiceRecording';_0xc2fe71[_0x0646('0x18')]=[{'name':'Agents','field':_0x0646('0x19'),'foreignKey':_0x0646('0x33'),'model':_0x0646('0x34'),'filter':{'field':_0x0646('0x35'),'value':[_0x0646('0x36')]}},{'name':_0x0646('0x37'),'field':_0x0646('0x19'),'foreignKey':'membername','model':_0x0646('0x34'),'filter':{'field':_0x0646('0x35'),'value':[_0x0646('0x38')]}},{'name':_0x0646('0x39'),'field':_0x0646('0x19'),'foreignKey':_0x0646('0x3a'),'model':'VoiceQueue','filter':{'field':_0x0646('0x11'),'value':[_0x0646('0x3b')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x0646('0x3a'),'model':'VoiceQueue','filter':{'field':_0x0646('0x11'),'value':[_0x0646('0x3c')]}}];break;case _0x0646('0x3d'):_0xc2fe71['childModel']=_0x0646('0x3e');break;case _0x0646('0x3f'):_0xc2fe71['childModel']=_0x0646('0x40');break;case _0x0646('0x41'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x42');break;case _0x0646('0x43'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x44');break;case'mailqueues':_0xc2fe71['childModel']=_0x0646('0x45');break;case _0x0646('0x46'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x47');break;case _0x0646('0x48'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x49');break;case'openchannelqueues':_0xc2fe71['childModel']=_0x0646('0x4a');break;case _0x0646('0x4b'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x4c');break;case _0x0646('0x4d'):_0xc2fe71['childModel']='SmsQueue';break;case _0x0646('0x4e'):_0xc2fe71['childModel']=_0x0646('0x4f');break;case'whatsappqueues':_0xc2fe71[_0x0646('0x14')]=_0x0646('0x50');break;case _0x0646('0x51'):_0xc2fe71[_0x0646('0x14')]='WhatsappAccount';break;case _0x0646('0x52'):_0xc2fe71['childModel']=_0x0646('0x53');break;case _0x0646('0x54'):case _0x0646('0x55'):_0xc2fe71[_0x0646('0x14')]='VoiceQueue';if(_0x324d27){_0xc2fe71[_0x0646('0x18')]=[{'name':'VoiceQueues'},{'name':_0x0646('0x56')}];}break;case _0x0646('0x57'):case _0x0646('0x58'):case'telephones':_0xc2fe71[_0x0646('0x14')]=_0x0646('0x34');if(_0x324d27){_0xc2fe71[_0x0646('0x18')]=[{'name':_0x0646('0x59'),'filter':{'field':_0x0646('0x35'),'value':[_0x0646('0x5a'),_0x0646('0x5b')]},'ignore':!![]},{'name':'Agents'},{'name':_0x0646('0x37')}];}break;case _0x0646('0x5c'):_0xc2fe71[_0x0646('0x14')]='ZendeskAccount';break;case _0x0646('0x5d'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x5e');break;case _0x0646('0x5f'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x60');break;case _0x0646('0x61'):_0xc2fe71['childModel']=_0x0646('0x62');break;case _0x0646('0x63'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x64');break;case _0x0646('0x65'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x66');break;case _0x0646('0x67'):_0xc2fe71['childModel']=_0x0646('0x34');break;case _0x0646('0x68'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x69');break;case _0x0646('0x6a'):_0xc2fe71['childModel']='Disposition';break;case _0x0646('0x6b'):_0xc2fe71[_0x0646('0x14')]='Dashboard';break;case _0x0646('0x6c'):_0xc2fe71['childModel']=_0x0646('0x6d');break;case _0x0646('0x6e'):_0xc2fe71[_0x0646('0x14')]='Pause';break;case'scheduler':_0xc2fe71['childModel']=_0x0646('0x6f');break;case _0x0646('0x70'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x71');break;case _0x0646('0x72'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x73');break;case _0x0646('0x74'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x75');break;case _0x0646('0x76'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x77');break;case _0x0646('0x78'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x79');break;case _0x0646('0x7a'):_0xc2fe71[_0x0646('0x14')]=_0x0646('0x7b');break;case'plugins':_0xc2fe71[_0x0646('0x14')]=_0x0646('0x7c');break;case'extractedreports':_0xc2fe71[_0x0646('0x14')]=_0x0646('0xf');_0xc2fe71[_0x0646('0x18')]=[{'name':_0x0646('0x7d'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0xc2fe71[_0x0646('0x14')]='AnalyticMetric';break;}return _0xc2fe71;}function _0x5545bc(_0x3b63ad,_0x5bc97e){var _0x1ab338=_0x3b63ad[_0x0646('0x7e')](0x0)['toUpperCase']()+_0x3b63ad['slice'](0x1);var _0x3335f0={'type':_0x499f97['Sequelize'][_0x0646('0x7f')]['SELECT'],'raw':!![]};return new Promise(function(_0x29ea04,_0x7fc3ed){var _0x1d6b3d=squel[_0x0646('0x80')]()['field'](_0x0646('0x81')+_0x1ab338+_0x0646('0x82'),'id')['field'](_0x0646('0x83'))[_0x0646('0x84')]('user_has_'+_0x3b63ad+_0x0646('0x85'),'ui')[_0x0646('0x86')](_0x0646('0x87'),_0x5bc97e['id']);return _0x499f97[_0x0646('0x88')]['query'](_0x1d6b3d[_0x0646('0x89')](),_0x3335f0)[_0x0646('0xd')](function(_0x5c7f2c){_0x5bc97e[_0x1ab338+_0x0646('0x8a')]=_0x5c7f2c;_0x29ea04(_0x5c7f2c);})[_0x0646('0xb')](function(_0x1987d6){_0x7fc3ed(_0x1987d6);});});}return _0x107e82[_0x0646('0x8b')](_0x0646('0x8c'),attributes,{'tableName':_0x0646('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xc86994){var _0x2fd9fd={'raw':_0xc86994[_0x0646('0x8e')]['raw'],'where':{}};var _0x68df70={};var _0x48f6f9={'count':0x0,'rows':[]};var _0x41c335=_0xc86994[_0x0646('0x8e')][_0x0646('0x8f')];var _0x1c7409=_0xc86994['query']['mergeResources']||![];var _0x115338=_0x11c629(_0x41c335,_0x1c7409);if(!_0x115338[_0x0646('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x41c335+'\x27');var _0x1e3c31=[{'name':_0x41c335}];if(!_['isEmpty'](_0x115338[_0x0646('0x18')]))_0x1e3c31=_0x115338[_0x0646('0x18')];var _0x59f22a=[];for(var _0x3e3477=0x0;_0x3e3477<_0x1e3c31['length'];_0x3e3477++){_0x59f22a['push'](_0x499f97[_0x0646('0x90')][_0x0646('0x91')]({'where':{'userProfileId':_0xc86994[_0x0646('0x92')]['id'],'name':_0x1e3c31[_0x3e3477][_0x0646('0x19')]},'raw':!![]}));}return Promise[_0x0646('0x93')](_0x59f22a)['then'](function(_0x10ec6d){var _0xcac5a9=_[_0x0646('0x5')](_0x10ec6d,function(_0x547904){return _0x547904?_0x547904:undefined;});var _0x4d8dbd=_[_0x0646('0x5')](_0x1e3c31,[_0x0646('0x94'),!![]]);var _0x3016b1=_[_0x0646('0x95')](_0xcac5a9)&&_[_0x0646('0x95')](_0x4d8dbd)?null:_[_0x0646('0x96')](_0x4d8dbd,_0xcac5a9);if(!_0x3016b1)return null;var _0x3ebf4f=[];for(var _0x307af8=0x0;_0x307af8<_0x3016b1['length'];_0x307af8++){var _0x2ee427=_['find'](_0x1e3c31,function(_0x5afde7){return _0x3016b1[_0x307af8]?_0x5afde7[_0x0646('0x19')]===_0x3016b1[_0x307af8][_0x0646('0x19')]:null;});if(_0x2ee427){if(_0x3016b1[_0x307af8]['ignore']){_0x3ebf4f[_0x0646('0x97')](_0x2133df(_0x115338[_0x0646('0x14')],_0x3016b1[_0x307af8]));}else{if(!_0x3016b1[_0x307af8][_0x0646('0x98')]){_0x3ebf4f[_0x0646('0x97')](_0x18064c(_0x2ee427,_0x3016b1[_0x307af8],_0x115338[_0x0646('0x14')]));}else{if(_0x2ee427[_0x0646('0xc')]){_0x3ebf4f[_0x0646('0x97')](_0x4e32a3(_0x2ee427,_0x3016b1[_0x307af8]));}}}}}return Promise['all'](_0x3ebf4f);})[_0x0646('0xd')](function(_0x24e50c){var _0x12f9ce=_0x24e50c;var _0x1fe834=null;if(_0x12f9ce){_0x1fe834=_0x12f9ce[_0x0646('0x99')]===0x1?_0x12f9ce[0x0]:null;}if(!_0x1fe834&&!_0x12f9ce)return _0x48f6f9;var _0x47ec3c=_0x499f97[_0x115338[_0x0646('0x14')]][_0x0646('0x9a')];_0x68df70[_0x0646('0xc')]=_['keys'](_0x47ec3c);_0x68df70['query']=_[_0x0646('0x9b')](_0xc86994[_0x0646('0x8e')]);_0x68df70[_0x0646('0x9c')]=_[_0x0646('0x9d')](_0x68df70[_0x0646('0xc')],_0x68df70[_0x0646('0x8e')]);_0x2fd9fd['attributes']=_['intersection'](_0x68df70['model'],qs[_0x0646('0x9e')](_0xc86994[_0x0646('0x8e')][_0x0646('0x9e')]));_0x2fd9fd[_0x0646('0x9f')]=_0x2fd9fd[_0x0646('0x9f')][_0x0646('0x99')]?_0x2fd9fd[_0x0646('0x9f')]:_0x68df70['model'];if(!_0xc86994[_0x0646('0x8e')][_0x0646('0xa0')](_0x0646('0xa1'))){_0x2fd9fd[_0x0646('0xa2')]=qs[_0x0646('0xa2')](_0xc86994[_0x0646('0x8e')][_0x0646('0xa2')]);_0x2fd9fd['offset']=qs[_0x0646('0xa3')](_0xc86994[_0x0646('0x8e')][_0x0646('0xa3')]);}_0x2fd9fd['order']=qs[_0x0646('0xa4')](_0xc86994[_0x0646('0x8e')][_0x0646('0xa4')]);_0x2fd9fd[_0x0646('0x86')]=qs[_0x0646('0x9c')](_[_0x0646('0xa5')](_0xc86994[_0x0646('0x8e')],_0x68df70[_0x0646('0x9c')]));if(_0xc86994['query']['filter']){_0x2fd9fd[_0x0646('0x86')]=_[_0x0646('0xa6')](_0x2fd9fd[_0x0646('0x86')],{'$or':_[_0x0646('0xa')](_0x47ec3c,function(_0x1d836c){if(_0x1d836c[_0x0646('0x11')]['key']!=='VIRTUAL'){var _0x4d1a0d={};_0x4d1a0d[_0x1d836c['field']]={'$like':'%'+_0xc86994[_0x0646('0x8e')][_0x0646('0x5')]+'%'};return _0x4d1a0d;}})});}var _0x2c2950=[];var _0x117325=null;var _0xa26a17={};if(_0x1fe834){_0x117325=_[_0x0646('0x91')](_0x1e3c31,[_0x0646('0x19'),_0x1fe834[_0x0646('0x19')]]);if(_0x117325[_0x0646('0x6')]){_0xa26a17={};if(_0x115338['childModel']===_0x0646('0xf')){_0xa26a17[_0x117325['foreignKey']]=_[_0x0646('0xa')](_0x1fe834['associatedResources'],'id');}else{_0xa26a17[_0x117325[_0x0646('0xa7')]]=_0x1fe834[_0x0646('0x9')];}_0x2c2950[_0x0646('0x97')](_0xa26a17);}else{_0x2fd9fd[_0x0646('0x86')]['id']=_0x1fe834[_0x0646('0x9')];}}else{for(var _0x20190a=0x0;_0x20190a<_0x12f9ce[_0x0646('0x99')];_0x20190a++){_0x117325=_[_0x0646('0x91')](_0x1e3c31,['name',_0x12f9ce[_0x20190a][_0x0646('0x19')]]);if(_0x117325[_0x0646('0x6')]){_0xa26a17={};_0xa26a17[_0x117325[_0x0646('0xa7')]]=_0x12f9ce[_0x20190a][_0x0646('0x9')];_0x2c2950[_0x0646('0x97')](_0xa26a17);}else{if(!_0x2fd9fd['where']['id'])_0x2fd9fd[_0x0646('0x86')]['id']=[];_0x12f9ce[_0x20190a]['associatedResources'][_0x0646('0xa8')](function(_0x2636f1){_0x2fd9fd[_0x0646('0x86')]['id'][_0x0646('0x97')](_0x2636f1);});}}}if(!_[_0x0646('0x95')](_0x2c2950)){_0x2fd9fd[_0x0646('0x86')]=_['merge'](_0x2fd9fd['where'],{'$and':{'$or':_0x2c2950}});}_0x2fd9fd=_[_0x0646('0xa6')]({},_0x2fd9fd,_0xc86994['options']);if(_0x1fe834&&!_0x1fe834['autoAssociation']&&_0x115338[_0x0646('0x14')]===_0x0646('0xf')){if(_0xc86994[_0x0646('0x8e')][_0x0646('0xa9')]){_0x2fd9fd[_0x0646('0xaa')]=[{'all':!![]}];}return _0x499f97[_0x115338[_0x0646('0x14')]][_0x0646('0x8')](_0x2fd9fd)['then'](function(_0x135b0e){var _0x42a087=[];_0x135b0e[_0x0646('0xa8')](function(_0x45badf){var _0x1976d8;switch(_0x45badf['reportType']){case _0x0646('0xab'):_0x1976d8=_[_0x0646('0x91')](_0x1fe834[_0x0646('0x9')],function(_0x50ff0f){return _0x50ff0f['id']===_0x45badf['reportId']&&_0x50ff0f['type']===_0x0646('0xac');});break;case _0x0646('0xad'):_0x1976d8=_[_0x0646('0x91')](_0x1fe834[_0x0646('0x9')],function(_0x135e1a){return _0x135e1a['id']===_0x45badf[_0x0646('0xae')]&&_0x135e1a[_0x0646('0x11')]===_0x0646('0xaf');});break;}if(_0x1976d8)_0x42a087['push'](_0x45badf);});_0x48f6f9['count']=_0x42a087[_0x0646('0x99')];_0x48f6f9[_0x0646('0xb0')]=_0x42a087;return _0x48f6f9;});}else{if(!_[_0x0646('0x95')](_0xc86994['query'][_0x0646('0xb1')])){_0x2fd9fd[_0x0646('0x86')]['id']=_0x2fd9fd['where']['id']?_['intersection'](_0x2fd9fd['where']['id'],_0xc86994[_0x0646('0x8e')][_0x0646('0xb1')]):_0xc86994[_0x0646('0x8e')]['ids'];if(_0xc86994[_0x0646('0x8e')][_0x0646('0xb2')]){_0x2fd9fd[_0x0646('0xb3')]=_0xc86994[_0x0646('0x8e')]['customSorting'];}}if(_0xc86994[_0x0646('0x8e')]['extraQueryConditions']){_0x2fd9fd[_0x0646('0x86')]=_[_0x0646('0xa6')](_0x2fd9fd[_0x0646('0x86')],{'$and':_0xc86994[_0x0646('0x8e')][_0x0646('0xb4')]});}return _0x499f97[_0x115338['childModel']]['count']({'where':_0x2fd9fd['where']})[_0x0646('0xd')](function(_0x984e71){_0x48f6f9['count']=_0x984e71;if(_0xc86994[_0x0646('0x8e')][_0x0646('0xa9')]){if(_0x115338[_0x0646('0x14')]===_0x0646('0x1e')){_0x2fd9fd[_0x0646('0xaa')]=[{'model':_0x499f97[_0x0646('0x73')],'as':_0x0646('0xb5'),'attributes':['id',_0x0646('0x19'),'color'],'required':_0xc86994[_0x0646('0x8e')][_0x0646('0xb6')]?!![]:![]},{'model':_0x499f97[_0x0646('0x73')],'as':'ThroughTags','attributes':['id',_0x0646('0x19'),_0x0646('0xb7')],'through':_0xc86994[_0x0646('0x8e')][_0x0646('0xb6')]?{'attributes':[],'where':{'TagId':_0xc86994['query'][_0x0646('0xb6')]||undefined}}:{},'required':_0xc86994[_0x0646('0x8e')]['tag']?!![]:![]}];}else{_0x2fd9fd[_0x0646('0xaa')]=[{'all':!![]}];}}return _0x499f97[_0x115338[_0x0646('0x14')]][_0x0646('0x8')](_0x2fd9fd);})[_0x0646('0xd')](function(_0x4bca21){_0x48f6f9[_0x0646('0xb0')]=_0x4bca21;if(_0x41c335===_0x0646('0xb8')&&_0xc86994['query'][_0x0646('0xb9')]==='true'){var _0x3d810f=[];for(var _0x1e9195=0x0;_0x1e9195<_0x48f6f9[_0x0646('0xb0')][_0x0646('0x99')];_0x1e9195++){_0x3d810f[_0x0646('0x97')](_0x5545bc(_0x0646('0xba'),_0x48f6f9[_0x0646('0xb0')][_0x1e9195][_0x0646('0xbb')]));_0x3d810f[_0x0646('0x97')](_0x5545bc('sms',_0x48f6f9['rows'][_0x1e9195][_0x0646('0xbb')]));_0x3d810f[_0x0646('0x97')](_0x5545bc(_0x0646('0xbc'),_0x48f6f9[_0x0646('0xb0')][_0x1e9195][_0x0646('0xbb')]));_0x3d810f[_0x0646('0x97')](_0x5545bc('mail',_0x48f6f9[_0x0646('0xb0')][_0x1e9195][_0x0646('0xbb')]));_0x3d810f['push'](_0x5545bc(_0x0646('0xbd'),_0x48f6f9[_0x0646('0xb0')][_0x1e9195][_0x0646('0xbb')]));_0x3d810f['push'](_0x5545bc('whatsapp',_0x48f6f9['rows'][_0x1e9195][_0x0646('0xbb')]));}return Promise[_0x0646('0x93')](_0x3d810f)[_0x0646('0xd')](function(){return _0x48f6f9;});}return _0x48f6f9;});}});}}});}; \ No newline at end of file +var _0x6b3e=['VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','voicequeues','users','agents','telephones','Agents','zendeskaccounts','ZendeskAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','sounds','Sound','tags','Tag','templates','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','union','autoAssociation','all','rawAttributes','model','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','foreignKey','merge','includeAll','include','forEach','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','tag','openTabs','true','chat','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','SquareProject','odbc','childModel','SquareOdbc','parentSections','SquareProjects','projectName','Lists','ListId','lists','companies','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','type','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b3e,0x134));var _0xe6b3=function(_0x398158,_0x58f1fb){_0x398158=_0x398158-0x0;var _0x2d1530=_0x6b3e[_0x398158];return _0x2d1530;};'use strict';var _=require(_0xe6b3('0x0'));var attributes=require(_0xe6b3('0x1'));var qs=require(_0xe6b3('0x2'));var squel=require('squel');module[_0xe6b3('0x3')]=function(_0x11b975){var _0x580a57=_0x11b975[_0xe6b3('0x4')];function _0xf6d325(_0x487968,_0x792890){return new Promise(function(_0x17c75e,_0x39994b){if(!_0x792890)return _0x17c75e(null);var _0x53f811=_0x792890[_0xe6b3('0x5')]?{[_0x792890[_0xe6b3('0x5')][_0xe6b3('0x6')]]:_0x792890[_0xe6b3('0x5')][_0xe6b3('0x7')]}:undefined;return _0x580a57[_0x487968][_0xe6b3('0x8')]({'where':_0x53f811,'raw':!![]})[_0xe6b3('0x9')](function(_0x5afe12){_0x792890[_0xe6b3('0xa')]=_[_0xe6b3('0xb')](_0x5afe12,'id');_0x17c75e(_0x792890);})[_0xe6b3('0xc')](function(_0x4ea65a){_0x39994b(_0x4ea65a);});});}function _0x22f055(_0x4eff0c,_0x430501){return new Promise(function(_0xe3a3b8,_0x1d8f9d){var _0x5c6949=_0x4eff0c['filter']?{[_0x4eff0c['filter'][_0xe6b3('0x6')]]:_0x4eff0c[_0xe6b3('0x5')]['value']}:undefined;return _0x580a57[_0x4eff0c['model']][_0xe6b3('0x8')]({'where':_0x5c6949,'raw':!![]})[_0xe6b3('0x9')](function(_0x3ba6e2){_0x430501[_0xe6b3('0xa')]=_[_0xe6b3('0xb')](_0x3ba6e2,function(_0x206447){return _0x206447[_0xe6b3('0xd')];});_0xe3a3b8(_0x430501);})[_0xe6b3('0xc')](function(_0x36fcbb){_0x1d8f9d(_0x36fcbb);});});}function _0xc9f015(_0x3bf3e8,_0x463130,_0x2bb491){if(!_0x463130)return Promise[_0xe6b3('0xe')](null);return new Promise(function(_0x20fdee,_0x4174d6){return _0x580a57[_0xe6b3('0xf')][_0xe6b3('0x8')]({'where':{'sectionId':_0x463130['id']},'raw':!![]})[_0xe6b3('0x9')](function(_0x4d7e28){if(_0x3bf3e8['field']&&_0x3bf3e8[_0xe6b3('0x6')]!=='id'){_0x463130['associatedResources']=_['map'](_0x4d7e28,function(_0x20f6c6){return _0x20f6c6[_0x3bf3e8[_0xe6b3('0x6')]];});}else{if(_0x2bb491===_0xe6b3('0x10')){_0x463130[_0xe6b3('0xa')]=_[_0xe6b3('0xb')](_0x4d7e28,function(_0x4db243){return{'id':_0x4db243[_0xe6b3('0x11')],'type':_0x4db243['type']};});}else{_0x463130[_0xe6b3('0xa')]=_[_0xe6b3('0xb')](_0x4d7e28,function(_0x542a05){return _0x542a05[_0xe6b3('0x11')];});}}_0x20fdee(_0x463130);})['catch'](function(_0x2e7a8f){_0x4174d6(_0x2e7a8f);});});}function _0x574bae(_0x43208a,_0x2b8ae5){var _0x2e3a22={'parentSections':[]};switch(_0x43208a['toLowerCase']()){case _0xe6b3('0x12'):_0x2e3a22['childModel']=_0xe6b3('0x13');break;case _0xe6b3('0x14'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x16');break;case'squarerecordings':_0x2e3a22[_0xe6b3('0x15')]='SquareRecording';_0x2e3a22[_0xe6b3('0x17')]=[{'name':_0xe6b3('0x18'),'field':_0xe6b3('0xd'),'foreignKey':_0xe6b3('0x19')}];break;case'projects':_0x2e3a22[_0xe6b3('0x15')]='JscriptyProject';break;case'contacts':_0x2e3a22['childModel']='CmContact';_0x2e3a22[_0xe6b3('0x17')]=[{'name':_0xe6b3('0x1a'),'field':'id','foreignKey':_0xe6b3('0x1b')}];break;case _0xe6b3('0x1c'):_0x2e3a22[_0xe6b3('0x15')]='CmList';break;case _0xe6b3('0x1d'):_0x2e3a22[_0xe6b3('0x15')]='CmCompany';break;case'globalcustomfields':_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x1e');break;case _0xe6b3('0x1f'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x20');break;case _0xe6b3('0x21'):_0x2e3a22['childModel']='ChatWebsite';break;case _0xe6b3('0x22'):_0x2e3a22[_0xe6b3('0x15')]='FaxQueue';break;case _0xe6b3('0x23'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x24');break;case _0xe6b3('0x25'):case _0xe6b3('0x26'):case _0xe6b3('0x27'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x28');break;case'contexts':_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x29');break;case _0xe6b3('0x2a'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x2b');break;case _0xe6b3('0x2c'):_0x2e3a22['childModel']=_0xe6b3('0x2d');_0x2e3a22['parentSections']=[{'name':'Agents','field':_0xe6b3('0xd'),'foreignKey':'membername','model':_0xe6b3('0x2e'),'filter':{'field':_0xe6b3('0x2f'),'value':[_0xe6b3('0x30')]}},{'name':_0xe6b3('0x31'),'field':_0xe6b3('0xd'),'foreignKey':'membername','model':_0xe6b3('0x2e'),'filter':{'field':'role','value':[_0xe6b3('0x32')]}},{'name':_0xe6b3('0x33'),'field':_0xe6b3('0xd'),'foreignKey':'queue','model':_0xe6b3('0x34'),'filter':{'field':_0xe6b3('0x35'),'value':[_0xe6b3('0x36')]}},{'name':_0xe6b3('0x37'),'field':_0xe6b3('0xd'),'foreignKey':_0xe6b3('0x38'),'model':_0xe6b3('0x34'),'filter':{'field':_0xe6b3('0x35'),'value':[_0xe6b3('0x39')]}}];break;case _0xe6b3('0x3a'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x3b');break;case'chanspies':_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x3c');break;case _0xe6b3('0x3d'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x3e');break;case _0xe6b3('0x3f'):_0x2e3a22['childModel']=_0xe6b3('0x40');break;case'mailqueues':_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x41');break;case _0xe6b3('0x42'):_0x2e3a22['childModel']=_0xe6b3('0x43');break;case _0xe6b3('0x44'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x45');break;case _0xe6b3('0x46'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x47');break;case _0xe6b3('0x48'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x49');break;case _0xe6b3('0x4a'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x4b');break;case _0xe6b3('0x4c'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x4d');break;case _0xe6b3('0x4e'):_0x2e3a22['childModel']='WhatsappQueue';break;case _0xe6b3('0x4f'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x50');break;case'teams':_0x2e3a22[_0xe6b3('0x15')]='Team';break;case _0xe6b3('0x51'):case'queuecampaigns':_0x2e3a22['childModel']=_0xe6b3('0x34');if(_0x2b8ae5){_0x2e3a22[_0xe6b3('0x17')]=[{'name':_0xe6b3('0x33')},{'name':_0xe6b3('0x37')}];}break;case _0xe6b3('0x52'):case _0xe6b3('0x53'):case _0xe6b3('0x54'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x2e');if(_0x2b8ae5){_0x2e3a22[_0xe6b3('0x17')]=[{'name':'Users','filter':{'field':_0xe6b3('0x2f'),'value':['admin','user']},'ignore':!![]},{'name':_0xe6b3('0x55')},{'name':_0xe6b3('0x31')}];}break;case _0xe6b3('0x56'):_0x2e3a22['childModel']=_0xe6b3('0x57');break;case'salesforceaccounts':_0x2e3a22['childModel']='SalesforceAccount';break;case'freshdeskaccounts':_0x2e3a22['childModel']=_0xe6b3('0x58');break;case _0xe6b3('0x59'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x5a');break;case _0xe6b3('0x5b'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x5c');break;case _0xe6b3('0x5d'):_0x2e3a22['childModel']=_0xe6b3('0x5e');break;case _0xe6b3('0x5f'):_0x2e3a22[_0xe6b3('0x15')]='User';break;case _0xe6b3('0x60'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x61');break;case _0xe6b3('0x62'):_0x2e3a22['childModel']=_0xe6b3('0x63');break;case _0xe6b3('0x64'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x65');break;case _0xe6b3('0x66'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x67');break;case _0xe6b3('0x68'):_0x2e3a22['childModel']=_0xe6b3('0x69');break;case'scheduler':_0x2e3a22['childModel']='Schedule';break;case _0xe6b3('0x6a'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x6b');break;case _0xe6b3('0x6c'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x6d');break;case _0xe6b3('0x6e'):_0x2e3a22['childModel']='Template';break;case'triggers':_0x2e3a22['childModel']=_0xe6b3('0x6f');break;case'trunks':_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x70');break;case _0xe6b3('0x71'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x72');break;case _0xe6b3('0x73'):_0x2e3a22[_0xe6b3('0x15')]='Plugin';break;case _0xe6b3('0x74'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x10');_0x2e3a22[_0xe6b3('0x17')]=[{'name':_0xe6b3('0x75'),'field':'id','foreignKey':'reportId'}];break;case _0xe6b3('0x76'):_0x2e3a22[_0xe6b3('0x15')]=_0xe6b3('0x77');break;}return _0x2e3a22;}function _0x5283f1(_0x33c2ed,_0x317255){var _0x4b4158=_0x33c2ed['charAt'](0x0)[_0xe6b3('0x78')]()+_0x33c2ed[_0xe6b3('0x79')](0x1);var _0x4b4770={'type':_0x580a57[_0xe6b3('0x7a')][_0xe6b3('0x7b')][_0xe6b3('0x7c')],'raw':!![]};return new Promise(function(_0x415ca4,_0x2e9aae){var _0x336064=squel['select']()[_0xe6b3('0x6')](_0xe6b3('0x7d')+_0x4b4158+'InteractionId','id')['field']('ui.createdAt')['from'](_0xe6b3('0x7e')+_0x33c2ed+_0xe6b3('0x7f'),'ui')[_0xe6b3('0x80')](_0xe6b3('0x81'),_0x317255['id']);return _0x580a57[_0xe6b3('0x82')][_0xe6b3('0x83')](_0x336064['toString'](),_0x4b4770)[_0xe6b3('0x9')](function(_0x27a473){_0x317255[_0x4b4158+_0xe6b3('0x84')]=_0x27a473;_0x415ca4(_0x27a473);})[_0xe6b3('0xc')](function(_0x32eb45){_0x2e9aae(_0x32eb45);});});}return _0x11b975[_0xe6b3('0x85')]('UserProfile',attributes,{'tableName':_0xe6b3('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x311c5c){var _0x2b635a={'raw':_0x311c5c[_0xe6b3('0x83')]['raw'],'where':{}};var _0x35d021={};var _0x1ac300={'count':0x0,'rows':[]};var _0x546c77=_0x311c5c[_0xe6b3('0x83')]['section'];var _0x122547=_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0x87')]||![];var _0x35de2e=_0x574bae(_0x546c77,_0x122547);if(!_0x35de2e[_0xe6b3('0x15')])throw new Error(_0xe6b3('0x88')+_0x546c77+'\x27');var _0x46d17d=[{'name':_0x546c77}];if(!_[_0xe6b3('0x89')](_0x35de2e['parentSections']))_0x46d17d=_0x35de2e['parentSections'];var _0x2316eb=[];for(var _0x305266=0x0;_0x305266<_0x46d17d[_0xe6b3('0x8a')];_0x305266++){_0x2316eb[_0xe6b3('0x8b')](_0x580a57[_0xe6b3('0x8c')][_0xe6b3('0x8d')]({'where':{'userProfileId':_0x311c5c[_0xe6b3('0x8e')]['id'],'name':_0x46d17d[_0x305266][_0xe6b3('0xd')]},'raw':!![]}));}return Promise['all'](_0x2316eb)[_0xe6b3('0x9')](function(_0x2685ce){var _0xbd0d8=_['filter'](_0x2685ce,function(_0x113964){return _0x113964?_0x113964:undefined;});var _0x5eaac1=_[_0xe6b3('0x5')](_0x46d17d,[_0xe6b3('0x8f'),!![]]);var _0x1e3112=_[_0xe6b3('0x89')](_0xbd0d8)&&_['isEmpty'](_0x5eaac1)?null:_[_0xe6b3('0x90')](_0x5eaac1,_0xbd0d8);if(!_0x1e3112)return null;var _0x2fb2e6=[];for(var _0x59de82=0x0;_0x59de82<_0x1e3112[_0xe6b3('0x8a')];_0x59de82++){var _0x35c93d=_['find'](_0x46d17d,function(_0xbdca06){return _0x1e3112[_0x59de82]?_0xbdca06[_0xe6b3('0xd')]===_0x1e3112[_0x59de82]['name']:null;});if(_0x35c93d){if(_0x1e3112[_0x59de82]['ignore']){_0x2fb2e6[_0xe6b3('0x8b')](_0xf6d325(_0x35de2e[_0xe6b3('0x15')],_0x1e3112[_0x59de82]));}else{if(!_0x1e3112[_0x59de82][_0xe6b3('0x91')]){_0x2fb2e6[_0xe6b3('0x8b')](_0xc9f015(_0x35c93d,_0x1e3112[_0x59de82],_0x35de2e['childModel']));}else{if(_0x35c93d['model']){_0x2fb2e6['push'](_0x22f055(_0x35c93d,_0x1e3112[_0x59de82]));}}}}}return Promise[_0xe6b3('0x92')](_0x2fb2e6);})[_0xe6b3('0x9')](function(_0x1d7581){var _0x384406=_0x1d7581;var _0x57673a=null;if(_0x384406){_0x57673a=_0x384406[_0xe6b3('0x8a')]===0x1?_0x384406[0x0]:null;}if(!_0x57673a&&!_0x384406)return _0x1ac300;var _0x4d69ed=_0x580a57[_0x35de2e[_0xe6b3('0x15')]][_0xe6b3('0x93')];_0x35d021[_0xe6b3('0x94')]=_[_0xe6b3('0x95')](_0x4d69ed);_0x35d021[_0xe6b3('0x83')]=_[_0xe6b3('0x95')](_0x311c5c[_0xe6b3('0x83')]);_0x35d021[_0xe6b3('0x96')]=_['intersection'](_0x35d021['model'],_0x35d021['query']);_0x2b635a[_0xe6b3('0x97')]=_['intersection'](_0x35d021['model'],qs[_0xe6b3('0x98')](_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0x98')]));_0x2b635a[_0xe6b3('0x97')]=_0x2b635a[_0xe6b3('0x97')][_0xe6b3('0x8a')]?_0x2b635a[_0xe6b3('0x97')]:_0x35d021['model'];if(!_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0x99')](_0xe6b3('0x9a'))){_0x2b635a[_0xe6b3('0x9b')]=qs['limit'](_0x311c5c[_0xe6b3('0x83')]['limit']);_0x2b635a[_0xe6b3('0x9c')]=qs[_0xe6b3('0x9c')](_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0x9c')]);}_0x2b635a[_0xe6b3('0x9d')]=qs['sort'](_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0x9e')]);_0x2b635a['where']=qs[_0xe6b3('0x96')](_[_0xe6b3('0x9f')](_0x311c5c[_0xe6b3('0x83')],_0x35d021[_0xe6b3('0x96')]));if(_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0x5')]){_0x2b635a[_0xe6b3('0x80')]=_['merge'](_0x2b635a[_0xe6b3('0x80')],{'$or':_[_0xe6b3('0xb')](_0x4d69ed,function(_0x11f14c){if(_0x11f14c['type']['key']!=='VIRTUAL'){var _0x4d1e9e={};_0x4d1e9e[_0x11f14c['field']]={'$like':'%'+_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0x5')]+'%'};return _0x4d1e9e;}})});}var _0x3ca602=[];var _0x19419a=null;var _0x1afae8={};if(_0x57673a){_0x19419a=_[_0xe6b3('0x8d')](_0x46d17d,[_0xe6b3('0xd'),_0x57673a['name']]);if(_0x19419a['field']){_0x1afae8={};if(_0x35de2e['childModel']===_0xe6b3('0x10')){_0x1afae8[_0x19419a[_0xe6b3('0xa0')]]=_[_0xe6b3('0xb')](_0x57673a[_0xe6b3('0xa')],'id');}else{_0x1afae8[_0x19419a[_0xe6b3('0xa0')]]=_0x57673a[_0xe6b3('0xa')];}_0x3ca602[_0xe6b3('0x8b')](_0x1afae8);}else{_0x2b635a[_0xe6b3('0x80')]['id']=_0x57673a[_0xe6b3('0xa')];}}else{for(var _0x169b11=0x0;_0x169b11<_0x384406['length'];_0x169b11++){_0x19419a=_['find'](_0x46d17d,[_0xe6b3('0xd'),_0x384406[_0x169b11][_0xe6b3('0xd')]]);if(_0x19419a[_0xe6b3('0x6')]){_0x1afae8={};_0x1afae8[_0x19419a[_0xe6b3('0xa0')]]=_0x384406[_0x169b11]['associatedResources'];_0x3ca602[_0xe6b3('0x8b')](_0x1afae8);}else{if(!_0x2b635a[_0xe6b3('0x80')]['id'])_0x2b635a[_0xe6b3('0x80')]['id']=[];_0x384406[_0x169b11][_0xe6b3('0xa')]['forEach'](function(_0x4f5fce){_0x2b635a[_0xe6b3('0x80')]['id'][_0xe6b3('0x8b')](_0x4f5fce);});}}}if(!_[_0xe6b3('0x89')](_0x3ca602)){_0x2b635a['where']=_['merge'](_0x2b635a[_0xe6b3('0x80')],{'$and':{'$or':_0x3ca602}});}_0x2b635a=_[_0xe6b3('0xa1')]({},_0x2b635a,_0x311c5c['options']);if(_0x57673a&&!_0x57673a[_0xe6b3('0x91')]&&_0x35de2e[_0xe6b3('0x15')]===_0xe6b3('0x10')){if(_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0xa2')]){_0x2b635a[_0xe6b3('0xa3')]=[{'all':!![]}];}return _0x580a57[_0x35de2e['childModel']][_0xe6b3('0x8')](_0x2b635a)['then'](function(_0x170b9b){var _0x20562b=[];_0x170b9b[_0xe6b3('0xa4')](function(_0x248ba3){var _0xd72da0;switch(_0x248ba3[_0xe6b3('0xa5')]){case _0xe6b3('0xa6'):_0xd72da0=_['find'](_0x57673a[_0xe6b3('0xa')],function(_0xa815e){return _0xa815e['id']===_0x248ba3[_0xe6b3('0xa7')]&&_0xa815e['type']===_0xe6b3('0xa8');});break;case _0xe6b3('0xa9'):_0xd72da0=_['find'](_0x57673a['associatedResources'],function(_0x14e7da){return _0x14e7da['id']===_0x248ba3[_0xe6b3('0xa7')]&&_0x14e7da[_0xe6b3('0x35')]===_0xe6b3('0xaa');});break;}if(_0xd72da0)_0x20562b[_0xe6b3('0x8b')](_0x248ba3);});_0x1ac300[_0xe6b3('0xab')]=_0x20562b['length'];_0x1ac300[_0xe6b3('0xac')]=_0x20562b;return _0x1ac300;});}else{if(!_[_0xe6b3('0x89')](_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0xad')])){_0x2b635a['where']['id']=_0x2b635a['where']['id']?_['intersection'](_0x2b635a[_0xe6b3('0x80')]['id'],_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0xad')]):_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0xad')];if(_0x311c5c['query'][_0xe6b3('0xae')]){_0x2b635a[_0xe6b3('0x9d')]=_0x311c5c[_0xe6b3('0x83')]['customSorting'];}}if(_0x311c5c[_0xe6b3('0x83')][_0xe6b3('0xaf')]){_0x2b635a[_0xe6b3('0x80')]=_[_0xe6b3('0xa1')](_0x2b635a[_0xe6b3('0x80')],{'$and':_0x311c5c['query']['extraQueryConditions']});}return _0x580a57[_0x35de2e[_0xe6b3('0x15')]][_0xe6b3('0xab')]({'where':_0x2b635a[_0xe6b3('0x80')]})['then'](function(_0x57ef1e){_0x1ac300['count']=_0x57ef1e;if(_0x311c5c['query'][_0xe6b3('0xa2')]){if(_0x35de2e[_0xe6b3('0x15')]==='CmContact'){_0x2b635a[_0xe6b3('0xa3')]=[{'model':_0x580a57[_0xe6b3('0x6d')],'as':_0xe6b3('0xb0'),'attributes':['id',_0xe6b3('0xd'),'color'],'required':_0x311c5c[_0xe6b3('0x83')]['tag']?!![]:![]},{'model':_0x580a57[_0xe6b3('0x6d')],'as':'ThroughTags','attributes':['id',_0xe6b3('0xd'),'color'],'through':_0x311c5c['query'][_0xe6b3('0xb1')]?{'attributes':[],'where':{'TagId':_0x311c5c['query'][_0xe6b3('0xb1')]||undefined}}:{},'required':_0x311c5c['query'][_0xe6b3('0xb1')]?!![]:![]}];}else{_0x2b635a[_0xe6b3('0xa3')]=[{'all':!![]}];}}return _0x580a57[_0x35de2e[_0xe6b3('0x15')]][_0xe6b3('0x8')](_0x2b635a);})[_0xe6b3('0x9')](function(_0x363c8b){_0x1ac300[_0xe6b3('0xac')]=_0x363c8b;if(_0x546c77==='Agents'&&_0x311c5c['query'][_0xe6b3('0xb2')]===_0xe6b3('0xb3')){var _0x14719d=[];for(var _0x1a5120=0x0;_0x1a5120<_0x1ac300[_0xe6b3('0xac')][_0xe6b3('0x8a')];_0x1a5120++){_0x14719d[_0xe6b3('0x8b')](_0x5283f1(_0xe6b3('0xb4'),_0x1ac300[_0xe6b3('0xac')][_0x1a5120][_0xe6b3('0xb5')]));_0x14719d['push'](_0x5283f1('sms',_0x1ac300['rows'][_0x1a5120][_0xe6b3('0xb5')]));_0x14719d[_0xe6b3('0x8b')](_0x5283f1(_0xe6b3('0xb6'),_0x1ac300[_0xe6b3('0xac')][_0x1a5120]['dataValues']));_0x14719d[_0xe6b3('0x8b')](_0x5283f1('mail',_0x1ac300['rows'][_0x1a5120][_0xe6b3('0xb5')]));_0x14719d['push'](_0x5283f1(_0xe6b3('0xb7'),_0x1ac300[_0xe6b3('0xac')][_0x1a5120][_0xe6b3('0xb5')]));_0x14719d[_0xe6b3('0x8b')](_0x5283f1(_0xe6b3('0xb8'),_0x1ac300['rows'][_0x1a5120][_0xe6b3('0xb5')]));}return Promise[_0xe6b3('0x92')](_0x14719d)[_0xe6b3('0x9')](function(){return _0x1ac300;});}return _0x1ac300;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index f70dc4c..3d504a0 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 _0x195f=['redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x327dac,_0x230179){var _0xef78e5=function(_0x4e7963){while(--_0x4e7963){_0x327dac['push'](_0x327dac['shift']());}};_0xef78e5(++_0x230179);}(_0x195f,0x113));var _0xf195=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x195f[_0x33154d];return _0x3b2f03;};'use strict';var _=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var moment=require('moment');var BPromise=require(_0xf195('0x2'));var rs=require(_0xf195('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf195('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf195('0x5'))(_0xf195('0x6'));var config=require(_0xf195('0x7'));var jayson=require(_0xf195('0x8'));var client=jayson[_0xf195('0x9')][_0xf195('0xa')]({'port':0x232a});config[_0xf195('0xb')]=_['defaults'](config['redis'],{'host':_0xf195('0xc'),'port':0x18eb});var socket=require(_0xf195('0xd'))(new Redis(config[_0xf195('0xb')]));require(_0xf195('0xe'))[_0xf195('0xf')](socket);function respondWithRpcPromise(_0x2edce1,_0x426577,_0x4bce90){return new BPromise(function(_0x172dba,_0x384680){return client[_0xf195('0x10')](_0x2edce1,_0x4bce90)['then'](function(_0x3c9305){logger[_0xf195('0x11')](_0xf195('0x12'),_0x426577,_0xf195('0x13'));logger['debug'](_0xf195('0x14'),_0x426577,_0xf195('0x13'),JSON['stringify'](_0x3c9305));if(_0x3c9305[_0xf195('0x15')]){if(_0x3c9305['error'][_0xf195('0x16')]===0x1f4){logger[_0xf195('0x15')](_0xf195('0x12'),_0x426577,_0x3c9305[_0xf195('0x15')][_0xf195('0x17')]);return _0x384680(_0x3c9305[_0xf195('0x15')][_0xf195('0x17')]);}logger[_0xf195('0x15')]('UserProfile,\x20%s,\x20%s',_0x426577,_0x3c9305['error'][_0xf195('0x17')]);return _0x172dba(_0x3c9305[_0xf195('0x15')][_0xf195('0x17')]);}else{logger[_0xf195('0x11')]('UserProfile,\x20%s,\x20%s',_0x426577,_0xf195('0x13'));_0x172dba(_0x3c9305[_0xf195('0x18')]['message']);}})[_0xf195('0x19')](function(_0x2c6bfd){logger['error'](_0xf195('0x12'),_0x426577,_0x2c6bfd);_0x384680(_0x2c6bfd);});});} \ No newline at end of file +var _0xf811=['http','defaults','redis','localhost','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3cce61,_0x5ade25){var _0x1111dc=function(_0x3cad33){while(--_0x3cad33){_0x3cce61['push'](_0x3cce61['shift']());}};_0x1111dc(++_0x5ade25);}(_0xf811,0x6f));var _0x1f81=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xf811[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var moment=require(_0x1f81('0x2'));var BPromise=require(_0x1f81('0x3'));var rs=require(_0x1f81('0x4'));var fs=require('fs');var Redis=require(_0x1f81('0x5'));var db=require(_0x1f81('0x6'))['db'];var utils=require(_0x1f81('0x7'));var logger=require(_0x1f81('0x8'))(_0x1f81('0x9'));var config=require(_0x1f81('0xa'));var jayson=require(_0x1f81('0xb'));var client=jayson[_0x1f81('0xc')][_0x1f81('0xd')]({'port':0x232a});config['redis']=_[_0x1f81('0xe')](config[_0x1f81('0xf')],{'host':_0x1f81('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f81('0xf')]));require(_0x1f81('0x11'))['register'](socket);function respondWithRpcPromise(_0x2ce4d7,_0x56b05d,_0x1978e5){return new BPromise(function(_0xf59298,_0x12859d){return client[_0x1f81('0x12')](_0x2ce4d7,_0x1978e5)[_0x1f81('0x13')](function(_0x36ccd8){logger[_0x1f81('0x14')](_0x1f81('0x15'),_0x56b05d,_0x1f81('0x16'));logger[_0x1f81('0x17')](_0x1f81('0x18'),_0x56b05d,_0x1f81('0x16'),JSON[_0x1f81('0x19')](_0x36ccd8));if(_0x36ccd8[_0x1f81('0x1a')]){if(_0x36ccd8[_0x1f81('0x1a')][_0x1f81('0x1b')]===0x1f4){logger['error'](_0x1f81('0x15'),_0x56b05d,_0x36ccd8[_0x1f81('0x1a')]['message']);return _0x12859d(_0x36ccd8['error'][_0x1f81('0x1c')]);}logger[_0x1f81('0x1a')]('UserProfile,\x20%s,\x20%s',_0x56b05d,_0x36ccd8[_0x1f81('0x1a')][_0x1f81('0x1c')]);return _0xf59298(_0x36ccd8[_0x1f81('0x1a')][_0x1f81('0x1c')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x56b05d,_0x1f81('0x16'));_0xf59298(_0x36ccd8[_0x1f81('0x1d')]['message']);}})[_0x1f81('0x1e')](function(_0x5310fb){logger[_0x1f81('0x1a')](_0x1f81('0x15'),_0x56b05d,_0x5310fb);_0x12859d(_0x5310fb);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 57a6673..05b2d0d 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 _0x2126=['./userProfile.events','save','remove','update','removeListener','register','length','userProfile:'];(function(_0x365db2,_0x269d6d){var _0x2c4550=function(_0x1d679f){while(--_0x1d679f){_0x365db2['push'](_0x365db2['shift']());}};_0x2c4550(++_0x269d6d);}(_0x2126,0x1d8));var _0x6212=function(_0x2b7ef5,_0x1dad9c){_0x2b7ef5=_0x2b7ef5-0x0;var _0x1fac58=_0x2126[_0x2b7ef5];return _0x1fac58;};'use strict';var UserProfileEvents=require(_0x6212('0x0'));var events=[_0x6212('0x1'),_0x6212('0x2'),_0x6212('0x3')];function createListener(_0x4f1358,_0x13eef2){return function(_0x26b3eb){_0x13eef2['emit'](_0x4f1358,_0x26b3eb);};}function removeListener(_0x379637,_0x594f05){return function(){UserProfileEvents[_0x6212('0x4')](_0x379637,_0x594f05);};}exports[_0x6212('0x5')]=function(_0x1e0952){for(var _0x2ef4f8=0x0,_0x178375=events[_0x6212('0x6')];_0x2ef4f8<_0x178375;_0x2ef4f8++){var _0x5840c3=events[_0x2ef4f8];var _0x39a2b0=createListener(_0x6212('0x7')+_0x5840c3,_0x1e0952);UserProfileEvents['on'](_0x5840c3,_0x39a2b0);}}; \ No newline at end of file +var _0x2c71=['remove','removeListener','register','length','save'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x2c71,0xea));var _0x12c7=function(_0x41c88c,_0x381f8d){_0x41c88c=_0x41c88c-0x0;var _0x2c97ea=_0x2c71[_0x41c88c];return _0x2c97ea;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x12c7('0x0'),_0x12c7('0x1'),'update'];function createListener(_0x5c928d,_0x5015d4){return function(_0x478187){_0x5015d4['emit'](_0x5c928d,_0x478187);};}function removeListener(_0x20d9bd,_0x4d284d){return function(){UserProfileEvents[_0x12c7('0x2')](_0x20d9bd,_0x4d284d);};}exports[_0x12c7('0x3')]=function(_0x3455b4){for(var _0x14f3a6=0x0,_0x202083=events[_0x12c7('0x4')];_0x14f3a6<_0x202083;_0x14f3a6++){var _0x5fca46=events[_0x14f3a6];var _0x3bb2f7=createListener('userProfile:'+_0x5fca46,_0x3455b4);UserProfileEvents['on'](_0x5fca46,_0x3bb2f7);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 494f9a1..e5779c9 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 _0x925d=['Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','exports','multer','path','connect-timeout','express'];(function(_0x2707e6,_0x5b6eb1){var _0x2ca35e=function(_0x1b334f){while(--_0x1b334f){_0x2707e6['push'](_0x2707e6['shift']());}};_0x2ca35e(++_0x5b6eb1);}(_0x925d,0x94));var _0xd925=function(_0x309ac6,_0x46aca){_0x309ac6=_0x309ac6-0x0;var _0x3c0903=_0x925d[_0x309ac6];return _0x3c0903;};'use strict';var multer=require(_0xd925('0x0'));var util=require('util');var path=require(_0xd925('0x1'));var timeout=require(_0xd925('0x2'));var express=require(_0xd925('0x3'));var router=express[_0xd925('0x4')]();var fs_extra=require(_0xd925('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd925('0x6'));var config=require('../../config/environment');var controller=require(_0xd925('0x7'));router[_0xd925('0x8')]('/',auth[_0xd925('0x9')](),controller[_0xd925('0xa')]);router[_0xd925('0x8')](_0xd925('0xb'),auth[_0xd925('0x9')](),controller[_0xd925('0xc')]);router[_0xd925('0x8')]('/:id',auth[_0xd925('0x9')](),controller['show']);router[_0xd925('0xd')]('/',auth[_0xd925('0x9')](),controller[_0xd925('0xe')]);router[_0xd925('0xf')](_0xd925('0x10'),auth['isAuthenticated'](),controller[_0xd925('0x11')]);router['delete'](_0xd925('0x10'),auth[_0xd925('0x9')](),controller['destroy']);module[_0xd925('0x12')]=router; \ No newline at end of file +var _0x43ef=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','post','create','/:id','update','delete','destroy'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0x43ef,0x98));var _0xf43e=function(_0x251efd,_0x3ecbcd){_0x251efd=_0x251efd-0x0;var _0x3a0898=_0x43ef[_0x251efd];return _0x3a0898;};'use strict';var multer=require(_0xf43e('0x0'));var util=require(_0xf43e('0x1'));var path=require(_0xf43e('0x2'));var timeout=require(_0xf43e('0x3'));var express=require('express');var router=express[_0xf43e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf43e('0x5'));var interaction=require(_0xf43e('0x6'));var config=require(_0xf43e('0x7'));var controller=require(_0xf43e('0x8'));router[_0xf43e('0x9')]('/',auth[_0xf43e('0xa')](),controller[_0xf43e('0xb')]);router[_0xf43e('0x9')](_0xf43e('0xc'),auth[_0xf43e('0xa')](),controller['describe']);router[_0xf43e('0x9')]('/:id',auth[_0xf43e('0xa')](),controller['show']);router[_0xf43e('0xd')]('/',auth[_0xf43e('0xa')](),controller[_0xf43e('0xe')]);router['put'](_0xf43e('0xf'),auth['isAuthenticated'](),controller[_0xf43e('0x10')]);router[_0xf43e('0x11')](_0xf43e('0xf'),auth['isAuthenticated'](),controller[_0xf43e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 678a912..17dd27f 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 _0x6b36=['STRING','INTEGER','exports'];(function(_0xcd9250,_0x3ba643){var _0x6e9141=function(_0x340126){while(--_0x340126){_0xcd9250['push'](_0xcd9250['shift']());}};_0x6e9141(++_0x3ba643);}(_0x6b36,0x1ca));var _0x66b3=function(_0x32b59b,_0xcd508c){_0x32b59b=_0x32b59b-0x0;var _0x3a58dc=_0x6b36[_0x32b59b];return _0x3a58dc;};'use strict';var Sequelize=require('sequelize');module[_0x66b3('0x0')]={'name':{'type':Sequelize[_0x66b3('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x66b3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x66b3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x83b4=['exports','STRING'];(function(_0x2469ec,_0x7173a3){var _0x564009=function(_0xa22aed){while(--_0xa22aed){_0x2469ec['push'](_0x2469ec['shift']());}};_0x564009(++_0x7173a3);}(_0x83b4,0x160));var _0x483b=function(_0x1a8681,_0x23e0f0){_0x1a8681=_0x1a8681-0x0;var _0x10e29b=_0x83b4[_0x1a8681];return _0x10e29b;};'use strict';var Sequelize=require('sequelize');module[_0x483b('0x0')]={'name':{'type':Sequelize[_0x483b('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3e506d2..19599a8 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 _0xadb5=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','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','UserProfileResource','fieldName','type','key','model','query','keys'];(function(_0x526cfe,_0x3dcc88){var _0x59c246=function(_0x3116ca){while(--_0x3116ca){_0x526cfe['push'](_0x526cfe['shift']());}};_0x59c246(++_0x3dcc88);}(_0xadb5,0xad));var _0x5adb=function(_0xb30d07,_0x36d157){_0xb30d07=_0xb30d07-0x0;var _0x3aeadb=_0xadb5[_0xb30d07];return _0x3aeadb;};'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['UserProfileResource']['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')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['UserProfileResource'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['UserProfileResource'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};exports['describe']=function(_0x36b847,_0x3a5703){return db[_0x5adb('0x2a')][_0x5adb('0x49')]()['then'](respondWithResult(_0x3a5703,null))[_0x5adb('0x42')](handleError(_0x3a5703,null));}; \ No newline at end of file +var _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','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','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x687b,0x14a));var _0xb687=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0x687b[_0x8bb4c1];return _0x67a6e1;};'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['UserProfileResource'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 1a7e974..a6bc815 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 _0x4c00=['request-promise','rimraf','../../config/environment','exports','define','user_profile_has_resources','compositeIndex','sectionId','lodash','util','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4c00,0x119));var _0x04c0=function(_0x40a73a,_0x4d3623){_0x40a73a=_0x40a73a-0x0;var _0x46e6cb=_0x4c00[_0x40a73a];return _0x46e6cb;};'use strict';var _=require(_0x04c0('0x0'));var util=require(_0x04c0('0x1'));var logger=require('../../config/logger')(_0x04c0('0x2'));var moment=require(_0x04c0('0x3'));var BPromise=require(_0x04c0('0x4'));var rp=require(_0x04c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04c0('0x6'));var config=require(_0x04c0('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x04c0('0x8')]=function(_0x2a1317,_0x5b5f5b){return _0x2a1317[_0x04c0('0x9')]('UserProfileResource',attributes,{'tableName':_0x04c0('0xa'),'paranoid':![],'indexes':[{'name':_0x04c0('0xb'),'fields':['resourceId',_0x04c0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c92=['UserProfileResource','user_profile_has_resources','resourceId','lodash','util','api','moment','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x3cb3cf,_0x317862){var _0x1652ff=function(_0x1b6a69){while(--_0x1b6a69){_0x3cb3cf['push'](_0x3cb3cf['shift']());}};_0x1652ff(++_0x317862);}(_0x5c92,0x1bf));var _0x25c9=function(_0x2dcb33,_0x3c58c8){_0x2dcb33=_0x2dcb33-0x0;var _0x53324c=_0x5c92[_0x2dcb33];return _0x53324c;};'use strict';var _=require(_0x25c9('0x0'));var util=require(_0x25c9('0x1'));var logger=require('../../config/logger')(_0x25c9('0x2'));var moment=require(_0x25c9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x25c9('0x4'));var rimraf=require(_0x25c9('0x5'));var config=require(_0x25c9('0x6'));var attributes=require(_0x25c9('0x7'));module[_0x25c9('0x8')]=function(_0x5cb56b,_0x4505dc){return _0x5cb56b['define'](_0x25c9('0x9'),attributes,{'tableName':_0x25c9('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x25c9('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 472d3df..4e8f046 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 _0xf7cb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3da898,_0x2fc4a1){var _0x13b13f=function(_0x4e8a40){while(--_0x4e8a40){_0x3da898['push'](_0x3da898['shift']());}};_0x13b13f(++_0x2fc4a1);}(_0xf7cb,0x1dc));var _0xbf7c=function(_0x4e0f54,_0x2595e3){_0x4e0f54=_0x4e0f54-0x0;var _0x5379f7=_0xf7cb[_0x4e0f54];return _0x5379f7;};'use strict';var _=require(_0xbf7c('0x0'));var util=require(_0xbf7c('0x1'));var moment=require(_0xbf7c('0x2'));var BPromise=require(_0xbf7c('0x3'));var rs=require(_0xbf7c('0x4'));var fs=require('fs');var Redis=require(_0xbf7c('0x5'));var db=require(_0xbf7c('0x6'))['db'];var utils=require(_0xbf7c('0x7'));var logger=require(_0xbf7c('0x8'))(_0xbf7c('0x9'));var config=require(_0xbf7c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbf7c('0xb')][_0xbf7c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe6590b,_0x3376f5,_0x52c56f){return new BPromise(function(_0x5b1ad7,_0x5548da){return client[_0xbf7c('0xd')](_0xe6590b,_0x52c56f)[_0xbf7c('0xe')](function(_0x364ad2){logger[_0xbf7c('0xf')](_0xbf7c('0x10'),_0x3376f5,_0xbf7c('0x11'));logger[_0xbf7c('0x12')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3376f5,_0xbf7c('0x11'),JSON['stringify'](_0x364ad2));if(_0x364ad2['error']){if(_0x364ad2['error'][_0xbf7c('0x13')]===0x1f4){logger[_0xbf7c('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x3376f5,_0x364ad2['error'][_0xbf7c('0x15')]);return _0x5548da(_0x364ad2[_0xbf7c('0x14')]['message']);}logger['error'](_0xbf7c('0x10'),_0x3376f5,_0x364ad2[_0xbf7c('0x14')]['message']);return _0x5b1ad7(_0x364ad2[_0xbf7c('0x14')][_0xbf7c('0x15')]);}else{logger[_0xbf7c('0xf')](_0xbf7c('0x10'),_0x3376f5,_0xbf7c('0x11'));_0x5b1ad7(_0x364ad2[_0xbf7c('0x16')]['message']);}})[_0xbf7c('0x17')](function(_0x1d6f22){logger[_0xbf7c('0x14')](_0xbf7c('0x10'),_0x3376f5,_0x1d6f22);_0x5548da(_0x1d6f22);});});} \ No newline at end of file +var _0x138f=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0xc8069a,_0x2968fc){var _0x16bc69=function(_0x4e8a44){while(--_0x4e8a44){_0xc8069a['push'](_0xc8069a['shift']());}};_0x16bc69(++_0x2968fc);}(_0x138f,0x64));var _0xf138=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x138f[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0xf138('0x0'));var util=require('util');var moment=require(_0xf138('0x1'));var BPromise=require(_0xf138('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf138('0x3'))['db'];var utils=require(_0xf138('0x4'));var logger=require(_0xf138('0x5'))(_0xf138('0x6'));var config=require(_0xf138('0x7'));var jayson=require(_0xf138('0x8'));var client=jayson['client'][_0xf138('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33d63e,_0x413671,_0x16e4f5){return new BPromise(function(_0x8af169,_0x9e7527){return client['request'](_0x33d63e,_0x16e4f5)[_0xf138('0xa')](function(_0x53abb3){logger[_0xf138('0xb')](_0xf138('0xc'),_0x413671,'request\x20sent');logger[_0xf138('0xd')](_0xf138('0xe'),_0x413671,_0xf138('0xf'),JSON[_0xf138('0x10')](_0x53abb3));if(_0x53abb3[_0xf138('0x11')]){if(_0x53abb3[_0xf138('0x11')]['code']===0x1f4){logger['error'](_0xf138('0xc'),_0x413671,_0x53abb3['error'][_0xf138('0x12')]);return _0x9e7527(_0x53abb3[_0xf138('0x11')][_0xf138('0x12')]);}logger[_0xf138('0x11')](_0xf138('0xc'),_0x413671,_0x53abb3['error'][_0xf138('0x12')]);return _0x8af169(_0x53abb3[_0xf138('0x11')][_0xf138('0x12')]);}else{logger[_0xf138('0xb')](_0xf138('0xc'),_0x413671,_0xf138('0xf'));_0x8af169(_0x53abb3[_0xf138('0x13')][_0xf138('0x12')]);}})[_0xf138('0x14')](function(_0x5c491e){logger[_0xf138('0x11')](_0xf138('0xc'),_0x413671,_0x5c491e);_0x9e7527(_0x5c491e);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index fed18fd..945f938 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 _0x2ce3=['../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b9876,_0x293130){var _0x58538b=function(_0x54912d){while(--_0x54912d){_0x5b9876['push'](_0x5b9876['shift']());}};_0x58538b(++_0x293130);}(_0x2ce3,0x142));var _0x32ce=function(_0x5ce55b,_0x2b73ff){_0x5ce55b=_0x5ce55b-0x0;var _0x37a5fc=_0x2ce3[_0x5ce55b];return _0x37a5fc;};'use strict';var multer=require(_0x32ce('0x0'));var util=require(_0x32ce('0x1'));var path=require('path');var timeout=require(_0x32ce('0x2'));var express=require(_0x32ce('0x3'));var router=express[_0x32ce('0x4')]();var fs_extra=require(_0x32ce('0x5'));var auth=require(_0x32ce('0x6'));var interaction=require(_0x32ce('0x7'));var config=require(_0x32ce('0x8'));var controller=require(_0x32ce('0x9'));router[_0x32ce('0xa')]('/',auth[_0x32ce('0xb')](),controller[_0x32ce('0xc')]);router[_0x32ce('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x32ce('0xd')]);router[_0x32ce('0xa')](_0x32ce('0xe'),auth[_0x32ce('0xb')](),controller[_0x32ce('0xf')]);router['post']('/',auth[_0x32ce('0xb')](),controller[_0x32ce('0x10')]);router[_0x32ce('0x11')](_0x32ce('0xe'),auth[_0x32ce('0xb')](),controller[_0x32ce('0x12')]);router[_0x32ce('0x13')](_0x32ce('0xe'),auth[_0x32ce('0xb')](),controller[_0x32ce('0x14')]);module[_0x32ce('0x15')]=router; \ No newline at end of file +var _0xb647=['isAuthenticated','index','/describe','describe','/:id','create','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x3441dd,_0x148129){var _0x23ff3f=function(_0x3dbc04){while(--_0x3dbc04){_0x3441dd['push'](_0x3441dd['shift']());}};_0x23ff3f(++_0x148129);}(_0xb647,0x1ef));var _0x7b64=function(_0xae123b,_0x5c768b){_0xae123b=_0xae123b-0x0;var _0x3fc542=_0xb647[_0xae123b];return _0x3fc542;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b64('0x3')]();var fs_extra=require(_0x7b64('0x4'));var auth=require(_0x7b64('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b64('0x6'));var controller=require(_0x7b64('0x7'));router[_0x7b64('0x8')]('/',auth[_0x7b64('0x9')](),controller[_0x7b64('0xa')]);router[_0x7b64('0x8')](_0x7b64('0xb'),auth['isAuthenticated'](),controller[_0x7b64('0xc')]);router[_0x7b64('0x8')](_0x7b64('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7b64('0x9')](),controller[_0x7b64('0xe')]);router['put'](_0x7b64('0xd'),auth['isAuthenticated'](),controller[_0x7b64('0xf')]);router['delete'](_0x7b64('0xd'),auth[_0x7b64('0x9')](),controller[_0x7b64('0x10')]);module[_0x7b64('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index ad49082..1d49da7 100644 --- a/server/api/userProfileSection/userProfileSection.attributes.js +++ b/server/api/userProfileSection/userProfileSection.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4cf8=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x2b737e,_0xa2a644){var _0x1c9f81=function(_0x5d2e10){while(--_0x5d2e10){_0x2b737e['push'](_0x2b737e['shift']());}};_0x1c9f81(++_0xa2a644);}(_0x4cf8,0x1e1));var _0x84cf=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0x4cf8[_0xd02def];return _0x2e8374;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'name':{'type':Sequelize[_0x84cf('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x84cf('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x84cf('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x84cf('0x2')],'set':function(_0x3bbbc3){this[_0x84cf('0x5')](_0x84cf('0x6'),_0x3bbbc3?_0x3bbbc3[_0x84cf('0x7')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x84cf('0x8')]('crudPermissions')[_0x84cf('0x9')](''):[];}}}; \ No newline at end of file +var _0x2032=['split','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x579445,_0x4c6368){var _0x3c493d=function(_0x50568a){while(--_0x50568a){_0x579445['push'](_0x579445['shift']());}};_0x3c493d(++_0x4c6368);}(_0x2032,0xd9));var _0x2203=function(_0x1c9a8b,_0x3f21ac){_0x1c9a8b=_0x1c9a8b-0x0;var _0x4a2a0a=_0x2032[_0x1c9a8b];return _0x4a2a0a;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2203('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2203('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x46c49a){this[_0x2203('0x3')](_0x2203('0x4'),_0x46c49a?_0x46c49a[_0x2203('0x5')](''):[]);},'get':function(){return this[_0x2203('0x6')](_0x2203('0x4'))?this[_0x2203('0x6')](_0x2203('0x4'))[_0x2203('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 067e0b1..021822f 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 _0x7524=['limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x53cd97,_0x20e74c){var _0x630b8=function(_0x401a49){while(--_0x401a49){_0x53cd97['push'](_0x53cd97['shift']());}};_0x630b8(++_0x20e74c);}(_0x7524,0x1a1));var _0x4752=function(_0x384fa7,_0x359d36){_0x384fa7=_0x384fa7-0x0;var _0x3fbd13=_0x7524[_0x384fa7];return _0x3fbd13;};'use strict';var emlformat=require(_0x4752('0x0'));var rimraf=require(_0x4752('0x1'));var zipdir=require(_0x4752('0x2'));var jsonpatch=require(_0x4752('0x3'));var rp=require(_0x4752('0x4'));var moment=require(_0x4752('0x5'));var BPromise=require(_0x4752('0x6'));var Mustache=require(_0x4752('0x7'));var util=require(_0x4752('0x8'));var path=require(_0x4752('0x9'));var sox=require('sox');var csv=require(_0x4752('0xa'));var ejs=require(_0x4752('0xb'));var fs=require('fs');var fs_extra=require(_0x4752('0xc'));var _=require('lodash');var squel=require(_0x4752('0xd'));var crypto=require(_0x4752('0xe'));var jsforce=require(_0x4752('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4752('0xa'));var querystring=require(_0x4752('0x10'));var Papa=require(_0x4752('0x11'));var Redis=require(_0x4752('0x12'));var authService=require(_0x4752('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4752('0x14'));var hardwareService=require(_0x4752('0x15'));var logger=require(_0x4752('0x16'))(_0x4752('0x17'));var utils=require(_0x4752('0x18'));var config=require(_0x4752('0x19'));var licenseUtil=require(_0x4752('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b408,_0x18c876){_0x18c876=_0x18c876||0xcc;return function(_0x54314e){if(_0x54314e){return _0x53b408[_0x4752('0x1b')](_0x18c876);}return _0x53b408[_0x4752('0x1c')](_0x18c876)[_0x4752('0x1d')]();};}function respondWithResult(_0x2d1220,_0x281ba1){_0x281ba1=_0x281ba1||0xc8;return function(_0x3e74c8){if(_0x3e74c8){return _0x2d1220[_0x4752('0x1c')](_0x281ba1)[_0x4752('0x1e')](_0x3e74c8);}};}function respondWithFilteredResult(_0x3e7cbb,_0x1693da){return function(_0x13fc06){if(_0x13fc06){var _0x59b2df=typeof _0x1693da[_0x4752('0x1f')]===_0x4752('0x20')&&typeof _0x1693da[_0x4752('0x21')]===_0x4752('0x20');var _0x458e98=_0x13fc06[_0x4752('0x22')];var _0x18a20b=_0x59b2df?0x0:_0x1693da[_0x4752('0x1f')];var _0x29bffd=_0x59b2df?_0x13fc06[_0x4752('0x22')]:_0x1693da[_0x4752('0x1f')]+_0x1693da[_0x4752('0x21')];var _0x1366f4;if(_0x29bffd>=_0x458e98){_0x29bffd=_0x458e98;_0x1366f4=0xc8;}else{_0x1366f4=0xce;}_0x3e7cbb[_0x4752('0x1c')](_0x1366f4);return _0x3e7cbb['set']('Content-Range',_0x18a20b+'-'+_0x29bffd+'/'+_0x458e98)[_0x4752('0x1e')](_0x13fc06);}return null;};}function patchUpdates(_0x1dff6c){return function(_0x3b31f9){try{jsonpatch[_0x4752('0x23')](_0x3b31f9,_0x1dff6c,!![]);}catch(_0x443729){return BPromise[_0x4752('0x24')](_0x443729);}return _0x3b31f9['save']();};}function saveUpdates(_0x2858bb,_0x2d8c79){return function(_0x54a4fe){if(_0x54a4fe){return _0x54a4fe[_0x4752('0x25')](_0x2858bb)[_0x4752('0x26')](function(_0x1fe964){return _0x1fe964;});}return null;};}function removeEntity(_0x30e5bf,_0x21dec5){return function(_0x5b2a4b){if(_0x5b2a4b){return _0x5b2a4b[_0x4752('0x27')]()[_0x4752('0x26')](function(){_0x30e5bf['status'](0xcc)[_0x4752('0x1d')]();});}};}function handleEntityNotFound(_0x2a0d0c,_0xf45719){return function(_0x334c1){if(!_0x334c1){_0x2a0d0c['sendStatus'](0x194);}return _0x334c1;};}function handleError(_0x44de53,_0x3b91aa){_0x3b91aa=_0x3b91aa||0x1f4;return function(_0x21b259){logger[_0x4752('0x28')](_0x21b259[_0x4752('0x29')]);if(_0x21b259[_0x4752('0x2a')]){delete _0x21b259['name'];}_0x44de53['status'](_0x3b91aa)[_0x4752('0x2b')](_0x21b259);};}exports[_0x4752('0x2c')]=function(_0x304f1c,_0x2c71a9){var _0xe1ca6={},_0x18fe11={},_0x323396={'count':0x0,'rows':[]};var _0x10485e=_['map'](db[_0x4752('0x2d')][_0x4752('0x2e')],function(_0x2923a3){return{'name':_0x2923a3[_0x4752('0x2f')],'type':_0x2923a3[_0x4752('0x30')][_0x4752('0x31')]};});_0x18fe11[_0x4752('0x32')]=_['map'](_0x10485e,_0x4752('0x2a'));_0x18fe11['query']=_[_0x4752('0x33')](_0x304f1c[_0x4752('0x34')]);_0x18fe11[_0x4752('0x35')]=_['intersection'](_0x18fe11[_0x4752('0x32')],_0x18fe11[_0x4752('0x34')]);_0xe1ca6[_0x4752('0x36')]=_[_0x4752('0x37')](_0x18fe11[_0x4752('0x32')],qs['fields'](_0x304f1c['query']['fields']));_0xe1ca6[_0x4752('0x36')]=_0xe1ca6[_0x4752('0x36')][_0x4752('0x38')]?_0xe1ca6[_0x4752('0x36')]:_0x18fe11['model'];if(!_0x304f1c['query']['hasOwnProperty'](_0x4752('0x39'))){_0xe1ca6[_0x4752('0x21')]=qs[_0x4752('0x21')](_0x304f1c['query']['limit']);_0xe1ca6[_0x4752('0x1f')]=qs[_0x4752('0x1f')](_0x304f1c[_0x4752('0x34')][_0x4752('0x1f')]);}_0xe1ca6['order']=qs[_0x4752('0x3a')](_0x304f1c['query']['sort']);_0xe1ca6[_0x4752('0x3b')]=qs[_0x4752('0x35')](_[_0x4752('0x3c')](_0x304f1c[_0x4752('0x34')],_0x18fe11[_0x4752('0x35')]),_0x10485e);if(_0x304f1c['query'][_0x4752('0x3d')]){_0xe1ca6['where']=_[_0x4752('0x3e')](_0xe1ca6[_0x4752('0x3b')],{'$or':_[_0x4752('0x3f')](_0x10485e,function(_0x194cd8){if(_0x194cd8['type']!==_0x4752('0x40')){var _0x234e30={};_0x234e30[_0x194cd8[_0x4752('0x2a')]]={'$like':'%'+_0x304f1c[_0x4752('0x34')][_0x4752('0x3d')]+'%'};return _0x234e30;}})});}_0xe1ca6=_[_0x4752('0x3e')]({},_0xe1ca6,_0x304f1c[_0x4752('0x41')]);var _0x200c99={'where':_0xe1ca6[_0x4752('0x3b')]};return db['UserProfileSection']['count'](_0x200c99)[_0x4752('0x26')](function(_0x3542d5){_0x323396[_0x4752('0x22')]=_0x3542d5;if(_0x304f1c[_0x4752('0x34')][_0x4752('0x42')]){_0xe1ca6['include']=[{'all':!![]}];}return db[_0x4752('0x2d')]['findAll'](_0xe1ca6);})[_0x4752('0x26')](function(_0x43c7be){_0x323396['rows']=_0x43c7be;return _0x323396;})['then'](respondWithFilteredResult(_0x2c71a9,_0xe1ca6))[_0x4752('0x43')](handleError(_0x2c71a9,null));};exports[_0x4752('0x44')]=function(_0x186bb4,_0x3869ce){var _0x360b7b={'raw':![],'where':{'id':_0x186bb4[_0x4752('0x45')]['id']}},_0x3b6e83={};_0x3b6e83[_0x4752('0x32')]=_[_0x4752('0x33')](db[_0x4752('0x2d')][_0x4752('0x2e')]);_0x3b6e83[_0x4752('0x34')]=_[_0x4752('0x33')](_0x186bb4[_0x4752('0x34')]);_0x3b6e83[_0x4752('0x35')]=_[_0x4752('0x37')](_0x3b6e83[_0x4752('0x32')],_0x3b6e83[_0x4752('0x34')]);_0x360b7b['attributes']=_[_0x4752('0x37')](_0x3b6e83[_0x4752('0x32')],qs[_0x4752('0x46')](_0x186bb4[_0x4752('0x34')]['fields']));_0x360b7b['attributes']=_0x360b7b[_0x4752('0x36')][_0x4752('0x38')]?_0x360b7b[_0x4752('0x36')]:_0x3b6e83[_0x4752('0x32')];if(_0x186bb4[_0x4752('0x34')][_0x4752('0x42')]){_0x360b7b['include']=[{'all':!![]}];}_0x360b7b=_['merge']({},_0x360b7b,_0x186bb4[_0x4752('0x41')]);return db['UserProfileSection'][_0x4752('0x47')](_0x360b7b)[_0x4752('0x26')](handleEntityNotFound(_0x3869ce,null))[_0x4752('0x26')](respondWithResult(_0x3869ce,null))[_0x4752('0x43')](handleError(_0x3869ce,null));};exports['create']=function(_0x13fc6e,_0x1abcc6){return db[_0x4752('0x2d')][_0x4752('0x48')](_0x13fc6e[_0x4752('0x49')],{})[_0x4752('0x26')](respondWithResult(_0x1abcc6,0xc9))[_0x4752('0x43')](handleError(_0x1abcc6,null));};exports[_0x4752('0x25')]=function(_0x3fb0b1,_0x1b755f){if(_0x3fb0b1[_0x4752('0x49')]['id']){delete _0x3fb0b1[_0x4752('0x49')]['id'];}return db[_0x4752('0x2d')][_0x4752('0x47')]({'where':{'id':_0x3fb0b1[_0x4752('0x45')]['id']}})[_0x4752('0x26')](handleEntityNotFound(_0x1b755f,null))[_0x4752('0x26')](saveUpdates(_0x3fb0b1[_0x4752('0x49')],null))[_0x4752('0x26')](respondWithResult(_0x1b755f,null))[_0x4752('0x43')](handleError(_0x1b755f,null));};exports[_0x4752('0x27')]=function(_0x5a80a0,_0x14edbd){return db[_0x4752('0x2d')][_0x4752('0x47')]({'where':{'id':_0x5a80a0[_0x4752('0x45')]['id']}})[_0x4752('0x26')](handleEntityNotFound(_0x14edbd,null))['then'](removeEntity(_0x14edbd,null))[_0x4752('0x43')](handleError(_0x14edbd,null));};exports[_0x4752('0x4a')]=function(_0x29e3b4,_0x4ef361){return db[_0x4752('0x2d')][_0x4752('0x4a')]()['then'](respondWithResult(_0x4ef361,null))[_0x4752('0x43')](handleError(_0x4ef361,null));}; \ No newline at end of file +var _0x1950=['save','update','then','end','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','UserProfileSection','include','findAll','rows','catch','show','includeAll','create','body','find','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject'];(function(_0x10eb6b,_0x3fe155){var _0x3a3ab1=function(_0x467f24){while(--_0x467f24){_0x10eb6b['push'](_0x10eb6b['shift']());}};_0x3a3ab1(++_0x3fe155);}(_0x1950,0x76));var _0x0195=function(_0x4e634a,_0x412048){_0x4e634a=_0x4e634a-0x0;var _0x146869=_0x1950[_0x4e634a];return _0x146869;};'use strict';var emlformat=require(_0x0195('0x0'));var rimraf=require(_0x0195('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0195('0x2'));var rp=require(_0x0195('0x3'));var moment=require(_0x0195('0x4'));var BPromise=require(_0x0195('0x5'));var Mustache=require(_0x0195('0x6'));var util=require(_0x0195('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0195('0x8'));var fs=require('fs');var fs_extra=require(_0x0195('0x9'));var _=require(_0x0195('0xa'));var squel=require(_0x0195('0xb'));var crypto=require('crypto');var jsforce=require(_0x0195('0xc'));var deskjs=require(_0x0195('0xd'));var toCsv=require(_0x0195('0xe'));var querystring=require(_0x0195('0xf'));var Papa=require(_0x0195('0x10'));var Redis=require('ioredis');var authService=require(_0x0195('0x11'));var qs=require(_0x0195('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0195('0x13'));var logger=require(_0x0195('0x14'))(_0x0195('0x15'));var utils=require(_0x0195('0x16'));var config=require(_0x0195('0x17'));var licenseUtil=require(_0x0195('0x18'));var db=require(_0x0195('0x19'))['db'];function respondWithStatusCode(_0x521594,_0x5b4223){_0x5b4223=_0x5b4223||0xcc;return function(_0x49b54f){if(_0x49b54f){return _0x521594[_0x0195('0x1a')](_0x5b4223);}return _0x521594[_0x0195('0x1b')](_0x5b4223)['end']();};}function respondWithResult(_0x51a238,_0x59118a){_0x59118a=_0x59118a||0xc8;return function(_0x13496f){if(_0x13496f){return _0x51a238[_0x0195('0x1b')](_0x59118a)[_0x0195('0x1c')](_0x13496f);}};}function respondWithFilteredResult(_0x5514f6,_0x19dc87){return function(_0x475b83){if(_0x475b83){var _0x4e0be2=typeof _0x19dc87[_0x0195('0x1d')]===_0x0195('0x1e')&&typeof _0x19dc87['limit']==='undefined';var _0x2ba25d=_0x475b83[_0x0195('0x1f')];var _0xaa0a6c=_0x4e0be2?0x0:_0x19dc87[_0x0195('0x1d')];var _0x528bf4=_0x4e0be2?_0x475b83['count']:_0x19dc87[_0x0195('0x1d')]+_0x19dc87[_0x0195('0x20')];var _0x3c8a35;if(_0x528bf4>=_0x2ba25d){_0x528bf4=_0x2ba25d;_0x3c8a35=0xc8;}else{_0x3c8a35=0xce;}_0x5514f6[_0x0195('0x1b')](_0x3c8a35);return _0x5514f6['set'](_0x0195('0x21'),_0xaa0a6c+'-'+_0x528bf4+'/'+_0x2ba25d)[_0x0195('0x1c')](_0x475b83);}return null;};}function patchUpdates(_0x4fbca2){return function(_0x101869){try{jsonpatch[_0x0195('0x22')](_0x101869,_0x4fbca2,!![]);}catch(_0x45a992){return BPromise[_0x0195('0x23')](_0x45a992);}return _0x101869[_0x0195('0x24')]();};}function saveUpdates(_0x9a70c3,_0x1caa55){return function(_0x272d39){if(_0x272d39){return _0x272d39[_0x0195('0x25')](_0x9a70c3)['then'](function(_0x3ba0be){return _0x3ba0be;});}return null;};}function removeEntity(_0x5a53b8,_0x50a89c){return function(_0x315d52){if(_0x315d52){return _0x315d52['destroy']()[_0x0195('0x26')](function(){_0x5a53b8[_0x0195('0x1b')](0xcc)[_0x0195('0x27')]();});}};}function handleEntityNotFound(_0x497f1d,_0xb1094){return function(_0x2ffd3d){if(!_0x2ffd3d){_0x497f1d['sendStatus'](0x194);}return _0x2ffd3d;};}function handleError(_0x5d29a2,_0x5cb18c){_0x5cb18c=_0x5cb18c||0x1f4;return function(_0x474df8){logger['error'](_0x474df8['stack']);if(_0x474df8[_0x0195('0x28')]){delete _0x474df8[_0x0195('0x28')];}_0x5d29a2[_0x0195('0x1b')](_0x5cb18c)[_0x0195('0x29')](_0x474df8);};}exports['index']=function(_0x170533,_0x1a8644){var _0x253e64={},_0x42835c={},_0x3e8a0b={'count':0x0,'rows':[]};var _0x20a685=_[_0x0195('0x2a')](db['UserProfileSection'][_0x0195('0x2b')],function(_0x177851){return{'name':_0x177851[_0x0195('0x2c')],'type':_0x177851[_0x0195('0x2d')][_0x0195('0x2e')]};});_0x42835c[_0x0195('0x2f')]=_[_0x0195('0x2a')](_0x20a685,'name');_0x42835c[_0x0195('0x30')]=_[_0x0195('0x31')](_0x170533['query']);_0x42835c[_0x0195('0x32')]=_[_0x0195('0x33')](_0x42835c[_0x0195('0x2f')],_0x42835c[_0x0195('0x30')]);_0x253e64[_0x0195('0x34')]=_[_0x0195('0x33')](_0x42835c[_0x0195('0x2f')],qs[_0x0195('0x35')](_0x170533[_0x0195('0x30')][_0x0195('0x35')]));_0x253e64[_0x0195('0x34')]=_0x253e64[_0x0195('0x34')][_0x0195('0x36')]?_0x253e64['attributes']:_0x42835c[_0x0195('0x2f')];if(!_0x170533[_0x0195('0x30')]['hasOwnProperty'](_0x0195('0x37'))){_0x253e64['limit']=qs[_0x0195('0x20')](_0x170533[_0x0195('0x30')]['limit']);_0x253e64[_0x0195('0x1d')]=qs[_0x0195('0x1d')](_0x170533[_0x0195('0x30')][_0x0195('0x1d')]);}_0x253e64[_0x0195('0x38')]=qs[_0x0195('0x39')](_0x170533[_0x0195('0x30')]['sort']);_0x253e64[_0x0195('0x3a')]=qs['filters'](_[_0x0195('0x3b')](_0x170533[_0x0195('0x30')],_0x42835c[_0x0195('0x32')]),_0x20a685);if(_0x170533[_0x0195('0x30')][_0x0195('0x3c')]){_0x253e64['where']=_['merge'](_0x253e64[_0x0195('0x3a')],{'$or':_[_0x0195('0x2a')](_0x20a685,function(_0x3ae14b){if(_0x3ae14b['type']!==_0x0195('0x3d')){var _0x542011={};_0x542011[_0x3ae14b['name']]={'$like':'%'+_0x170533[_0x0195('0x30')][_0x0195('0x3c')]+'%'};return _0x542011;}})});}_0x253e64=_[_0x0195('0x3e')]({},_0x253e64,_0x170533[_0x0195('0x3f')]);var _0x295e86={'where':_0x253e64[_0x0195('0x3a')]};return db[_0x0195('0x40')][_0x0195('0x1f')](_0x295e86)[_0x0195('0x26')](function(_0x518cea){_0x3e8a0b[_0x0195('0x1f')]=_0x518cea;if(_0x170533['query']['includeAll']){_0x253e64[_0x0195('0x41')]=[{'all':!![]}];}return db[_0x0195('0x40')][_0x0195('0x42')](_0x253e64);})[_0x0195('0x26')](function(_0x17892c){_0x3e8a0b[_0x0195('0x43')]=_0x17892c;return _0x3e8a0b;})['then'](respondWithFilteredResult(_0x1a8644,_0x253e64))[_0x0195('0x44')](handleError(_0x1a8644,null));};exports[_0x0195('0x45')]=function(_0x505960,_0x142a14){var _0x235b43={'raw':![],'where':{'id':_0x505960['params']['id']}},_0x1b3bef={};_0x1b3bef[_0x0195('0x2f')]=_['keys'](db[_0x0195('0x40')][_0x0195('0x2b')]);_0x1b3bef[_0x0195('0x30')]=_['keys'](_0x505960[_0x0195('0x30')]);_0x1b3bef[_0x0195('0x32')]=_['intersection'](_0x1b3bef[_0x0195('0x2f')],_0x1b3bef[_0x0195('0x30')]);_0x235b43[_0x0195('0x34')]=_['intersection'](_0x1b3bef['model'],qs[_0x0195('0x35')](_0x505960[_0x0195('0x30')][_0x0195('0x35')]));_0x235b43['attributes']=_0x235b43[_0x0195('0x34')][_0x0195('0x36')]?_0x235b43[_0x0195('0x34')]:_0x1b3bef['model'];if(_0x505960['query'][_0x0195('0x46')]){_0x235b43[_0x0195('0x41')]=[{'all':!![]}];}_0x235b43=_[_0x0195('0x3e')]({},_0x235b43,_0x505960['options']);return db[_0x0195('0x40')]['find'](_0x235b43)[_0x0195('0x26')](handleEntityNotFound(_0x142a14,null))[_0x0195('0x26')](respondWithResult(_0x142a14,null))['catch'](handleError(_0x142a14,null));};exports[_0x0195('0x47')]=function(_0x49bdec,_0x34d422){return db['UserProfileSection'][_0x0195('0x47')](_0x49bdec[_0x0195('0x48')],{})[_0x0195('0x26')](respondWithResult(_0x34d422,0xc9))[_0x0195('0x44')](handleError(_0x34d422,null));};exports[_0x0195('0x25')]=function(_0x20f686,_0x56c047){if(_0x20f686[_0x0195('0x48')]['id']){delete _0x20f686[_0x0195('0x48')]['id'];}return db['UserProfileSection'][_0x0195('0x49')]({'where':{'id':_0x20f686[_0x0195('0x4a')]['id']}})[_0x0195('0x26')](handleEntityNotFound(_0x56c047,null))[_0x0195('0x26')](saveUpdates(_0x20f686['body'],null))['then'](respondWithResult(_0x56c047,null))[_0x0195('0x44')](handleError(_0x56c047,null));};exports[_0x0195('0x4b')]=function(_0x276695,_0x4ff8ff){return db[_0x0195('0x40')][_0x0195('0x49')]({'where':{'id':_0x276695[_0x0195('0x4a')]['id']}})[_0x0195('0x26')](handleEntityNotFound(_0x4ff8ff,null))[_0x0195('0x26')](removeEntity(_0x4ff8ff,null))[_0x0195('0x44')](handleError(_0x4ff8ff,null));};exports[_0x0195('0x4c')]=function(_0x3404f2,_0x47933c){return db['UserProfileSection'][_0x0195('0x4c')]()[_0x0195('0x26')](respondWithResult(_0x47933c,null))['catch'](handleError(_0x47933c,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index cdfb4e7..162e38c 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 _0xc04d=['UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','define'];(function(_0x537141,_0x329e95){var _0x217552=function(_0x53220f){while(--_0x53220f){_0x537141['push'](_0x537141['shift']());}};_0x217552(++_0x329e95);}(_0xc04d,0x15d));var _0xdc04=function(_0x58c8fd,_0x2d395e){_0x58c8fd=_0x58c8fd-0x0;var _0x548eef=_0xc04d[_0x58c8fd];return _0x548eef;};'use strict';var _=require(_0xdc04('0x0'));var util=require('util');var logger=require(_0xdc04('0x1'))(_0xdc04('0x2'));var moment=require(_0xdc04('0x3'));var BPromise=require(_0xdc04('0x4'));var rp=require(_0xdc04('0x5'));var fs=require('fs');var path=require(_0xdc04('0x6'));var rimraf=require(_0xdc04('0x7'));var config=require(_0xdc04('0x8'));var attributes=require(_0xdc04('0x9'));module['exports']=function(_0x4fd065,_0x35312a){return _0x4fd065[_0xdc04('0xa')](_0xdc04('0xb'),attributes,{'tableName':_0xdc04('0xc'),'paranoid':![],'indexes':[{'name':_0xdc04('0xd'),'fields':['sectionId',_0xdc04('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c71=['api','bluebird','request-promise','path','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger'];(function(_0x517c5f,_0x2d4aa1){var _0x3206b9=function(_0x160535){while(--_0x160535){_0x517c5f['push'](_0x517c5f['shift']());}};_0x3206b9(++_0x2d4aa1);}(_0x7c71,0x177));var _0x17c7=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x7c71[_0x5c2a2b];return _0x19921f;};'use strict';var _=require(_0x17c7('0x0'));var util=require(_0x17c7('0x1'));var logger=require(_0x17c7('0x2'))(_0x17c7('0x3'));var moment=require('moment');var BPromise=require(_0x17c7('0x4'));var rp=require(_0x17c7('0x5'));var fs=require('fs');var path=require(_0x17c7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x17c7('0x7'));module[_0x17c7('0x8')]=function(_0x26b276,_0x3e98d9){return _0x26b276[_0x17c7('0x9')](_0x17c7('0xa'),attributes,{'tableName':_0x17c7('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x17c7('0xc'),_0x17c7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index daef7ca..d219c00 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 _0xcb2c=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','bluebird','randomstring'];(function(_0x37ca49,_0x26277b){var _0x5347d9=function(_0x5edfc2){while(--_0x5edfc2){_0x37ca49['push'](_0x37ca49['shift']());}};_0x5347d9(++_0x26277b);}(_0xcb2c,0x1c9));var _0xccb2=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xcb2c[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require('lodash');var util=require(_0xccb2('0x0'));var moment=require('moment');var BPromise=require(_0xccb2('0x1'));var rs=require(_0xccb2('0x2'));var fs=require('fs');var Redis=require(_0xccb2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xccb2('0x4'));var logger=require(_0xccb2('0x5'))(_0xccb2('0x6'));var config=require('../../config/environment');var jayson=require(_0xccb2('0x7'));var client=jayson[_0xccb2('0x8')][_0xccb2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c5876,_0x42c186,_0x25a727){return new BPromise(function(_0x22138d,_0xd69b8f){return client[_0xccb2('0xa')](_0x1c5876,_0x25a727)[_0xccb2('0xb')](function(_0x1d5369){logger[_0xccb2('0xc')](_0xccb2('0xd'),_0x42c186,'request\x20sent');logger[_0xccb2('0xe')](_0xccb2('0xf'),_0x42c186,_0xccb2('0x10'),JSON['stringify'](_0x1d5369));if(_0x1d5369[_0xccb2('0x11')]){if(_0x1d5369[_0xccb2('0x11')][_0xccb2('0x12')]===0x1f4){logger[_0xccb2('0x11')](_0xccb2('0xd'),_0x42c186,_0x1d5369[_0xccb2('0x11')]['message']);return _0xd69b8f(_0x1d5369[_0xccb2('0x11')][_0xccb2('0x13')]);}logger[_0xccb2('0x11')](_0xccb2('0xd'),_0x42c186,_0x1d5369['error']['message']);return _0x22138d(_0x1d5369[_0xccb2('0x11')]['message']);}else{logger[_0xccb2('0xc')](_0xccb2('0xd'),_0x42c186,_0xccb2('0x10'));_0x22138d(_0x1d5369['result'][_0xccb2('0x13')]);}})['catch'](function(_0x576ce6){logger[_0xccb2('0x11')](_0xccb2('0xd'),_0x42c186,_0x576ce6);_0xd69b8f(_0x576ce6);});});} \ No newline at end of file +var _0x0361=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x461b7e,_0x3c79f3){var _0x2b0074=function(_0x550471){while(--_0x550471){_0x461b7e['push'](_0x461b7e['shift']());}};_0x2b0074(++_0x3c79f3);}(_0x0361,0x91));var _0x1036=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0361[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x1036('0x0'));var moment=require(_0x1036('0x1'));var BPromise=require(_0x1036('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1036('0x3'))['db'];var utils=require(_0x1036('0x4'));var logger=require(_0x1036('0x5'))(_0x1036('0x6'));var config=require('../../config/environment');var jayson=require(_0x1036('0x7'));var client=jayson[_0x1036('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40747b,_0x234d2e,_0x39f32d){return new BPromise(function(_0x1d5d6d,_0x403c0b){return client[_0x1036('0x9')](_0x40747b,_0x39f32d)['then'](function(_0x5169d7){logger[_0x1036('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x234d2e,_0x1036('0xb'));logger[_0x1036('0xc')](_0x1036('0xd'),_0x234d2e,_0x1036('0xb'),JSON[_0x1036('0xe')](_0x5169d7));if(_0x5169d7[_0x1036('0xf')]){if(_0x5169d7[_0x1036('0xf')][_0x1036('0x10')]===0x1f4){logger[_0x1036('0xf')](_0x1036('0x11'),_0x234d2e,_0x5169d7[_0x1036('0xf')]['message']);return _0x403c0b(_0x5169d7[_0x1036('0xf')]['message']);}logger[_0x1036('0xf')](_0x1036('0x11'),_0x234d2e,_0x5169d7[_0x1036('0xf')][_0x1036('0x12')]);return _0x1d5d6d(_0x5169d7[_0x1036('0xf')]['message']);}else{logger[_0x1036('0xa')](_0x1036('0x11'),_0x234d2e,_0x1036('0xb'));_0x1d5d6d(_0x5169d7[_0x1036('0x13')][_0x1036('0x12')]);}})[_0x1036('0x14')](function(_0x4be73c){logger[_0x1036('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x234d2e,_0x4be73c);_0x403c0b(_0x4be73c);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c9bbddc..1bb11a8 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3993ca,_0x596e51){var _0x108504=function(_0x2a8970){while(--_0x2a8970){_0x3993ca['push'](_0x3993ca['shift']());}};_0x108504(++_0x596e51);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2e7e1f,_0x355c53){var _0x45b938=function(_0x1de58a){while(--_0x1de58a){_0x2e7e1f['push'](_0x2e7e1f['shift']());}};_0x45b938(++_0x355c53);}(_0xe706,0xa3));var _0x6e70=function(_0x2067c1,_0x4ad413){_0x2067c1=_0x2067c1-0x0;var _0x4c2968=_0xe706[_0x2067c1];return _0x4c2968;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 4c0a3f6..2cce4d0 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 _0x15ad=['exports','INTEGER'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x15ad,0x1ac));var _0xd15a=function(_0x1ec57f,_0x2cc62c){_0x1ec57f=_0x1ec57f-0x0;var _0x4f7ad4=_0x15ad[_0x1ec57f];return _0x4f7ad4;};'use strict';var Sequelize=require('sequelize');module[_0xd15a('0x0')]={'penalty':{'type':Sequelize[_0xd15a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x160c=['sequelize','exports'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x160c,0xde));var _0xc160=function(_0x3c91e9,_0x52170f){_0x3c91e9=_0x3c91e9-0x0;var _0x151e25=_0x160c[_0x3c91e9];return _0x151e25;};'use strict';var Sequelize=require(_0xc160('0x0'));module[_0xc160('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index a95f887..65815ff 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 _0x187d=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes'];(function(_0x4951b7,_0x440fcf){var _0x3ecc2a=function(_0x21b266){while(--_0x21b266){_0x4951b7['push'](_0x4951b7['shift']());}};_0x3ecc2a(++_0x440fcf);}(_0x187d,0x93));var _0xd187=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x187d[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cad=['UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x1dbdca,_0x5a4d8a){var _0x173bc0=function(_0x5f127b){while(--_0x5f127b){_0x1dbdca['push'](_0x1dbdca['shift']());}};_0x173bc0(++_0x5a4d8a);}(_0x8cad,0xfe));var _0xd8ca=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x8cad[_0x576170];return _0x397c70;};'use strict';var _=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var logger=require(_0xd8ca('0x2'))(_0xd8ca('0x3'));var moment=require(_0xd8ca('0x4'));var BPromise=require(_0xd8ca('0x5'));var rp=require(_0xd8ca('0x6'));var fs=require('fs');var path=require(_0xd8ca('0x7'));var rimraf=require(_0xd8ca('0x8'));var config=require(_0xd8ca('0x9'));var attributes=require(_0xd8ca('0xa'));module[_0xd8ca('0xb')]=function(_0x14c73e,_0x6d5070){return _0x14c73e['define'](_0xd8ca('0xc'),attributes,{'tableName':_0xd8ca('0xd'),'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 8fd195f..e0b9adf 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 _0x1a5d=['debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x5ba8fc,_0x3120dd){var _0x974890=function(_0x4ec53d){while(--_0x4ec53d){_0x5ba8fc['push'](_0x5ba8fc['shift']());}};_0x974890(++_0x3120dd);}(_0x1a5d,0x150));var _0xd1a5=function(_0x37afc7,_0x497dde){_0x37afc7=_0x37afc7-0x0;var _0x5f30d0=_0x1a5d[_0x37afc7];return _0x5f30d0;};'use strict';var _=require(_0xd1a5('0x0'));var util=require(_0xd1a5('0x1'));var moment=require(_0xd1a5('0x2'));var BPromise=require(_0xd1a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1a5('0x4'));var db=require(_0xd1a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd1a5('0x6'))(_0xd1a5('0x7'));var config=require(_0xd1a5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd1a5('0x9')][_0xd1a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46675a,_0x50c1e2,_0x5ed0db){return new BPromise(function(_0x59fd16,_0x450dcc){return client[_0xd1a5('0xb')](_0x46675a,_0x5ed0db)[_0xd1a5('0xc')](function(_0x4f961d){logger[_0xd1a5('0xd')](_0xd1a5('0xe'),_0x50c1e2,_0xd1a5('0xf'));logger[_0xd1a5('0x10')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x50c1e2,_0xd1a5('0xf'),JSON['stringify'](_0x4f961d));if(_0x4f961d[_0xd1a5('0x11')]){if(_0x4f961d[_0xd1a5('0x11')][_0xd1a5('0x12')]===0x1f4){logger[_0xd1a5('0x11')](_0xd1a5('0xe'),_0x50c1e2,_0x4f961d['error'][_0xd1a5('0x13')]);return _0x450dcc(_0x4f961d[_0xd1a5('0x11')]['message']);}logger[_0xd1a5('0x11')](_0xd1a5('0xe'),_0x50c1e2,_0x4f961d[_0xd1a5('0x11')][_0xd1a5('0x13')]);return _0x59fd16(_0x4f961d[_0xd1a5('0x11')][_0xd1a5('0x13')]);}else{logger[_0xd1a5('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x50c1e2,_0xd1a5('0xf'));_0x59fd16(_0x4f961d[_0xd1a5('0x14')][_0xd1a5('0x13')]);}})[_0xd1a5('0x15')](function(_0x1eee61){logger[_0xd1a5('0x11')](_0xd1a5('0xe'),_0x50c1e2,_0x1eee61);_0x450dcc(_0x1eee61);});});} \ No newline at end of file +var _0xc166=['catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x45e156,_0x184b24){var _0xe9b092=function(_0x455785){while(--_0x455785){_0x45e156['push'](_0x45e156['shift']());}};_0xe9b092(++_0x184b24);}(_0xc166,0x151));var _0x6c16=function(_0x4b1220,_0x15c4e1){_0x4b1220=_0x4b1220-0x0;var _0x2b86f1=_0xc166[_0x4b1220];return _0x2b86f1;};'use strict';var _=require(_0x6c16('0x0'));var util=require(_0x6c16('0x1'));var moment=require(_0x6c16('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c16('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c16('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6c16('0x5'));var config=require(_0x6c16('0x6'));var jayson=require(_0x6c16('0x7'));var client=jayson['client'][_0x6c16('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3507c2,_0x131e70,_0xb01934){return new BPromise(function(_0x243340,_0x401935){return client[_0x6c16('0x9')](_0x3507c2,_0xb01934)[_0x6c16('0xa')](function(_0x5bf438){logger[_0x6c16('0xb')](_0x6c16('0xc'),_0x131e70,_0x6c16('0xd'));logger['debug'](_0x6c16('0xe'),_0x131e70,_0x6c16('0xd'),JSON[_0x6c16('0xf')](_0x5bf438));if(_0x5bf438[_0x6c16('0x10')]){if(_0x5bf438[_0x6c16('0x10')][_0x6c16('0x11')]===0x1f4){logger[_0x6c16('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x131e70,_0x5bf438[_0x6c16('0x10')][_0x6c16('0x12')]);return _0x401935(_0x5bf438['error'][_0x6c16('0x12')]);}logger[_0x6c16('0x10')](_0x6c16('0xc'),_0x131e70,_0x5bf438['error']['message']);return _0x243340(_0x5bf438[_0x6c16('0x10')][_0x6c16('0x12')]);}else{logger['info'](_0x6c16('0xc'),_0x131e70,_0x6c16('0xd'));_0x243340(_0x5bf438[_0x6c16('0x13')][_0x6c16('0x12')]);}})[_0x6c16('0x14')](function(_0x5a4416){logger[_0x6c16('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x131e70,_0x5a4416);_0x401935(_0x5a4416);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index b4384dc..368add2 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 _0x7fac=['INTEGER','sequelize','exports'];(function(_0x38f737,_0x54f685){var _0x7afda3=function(_0x1ac1d7){while(--_0x1ac1d7){_0x38f737['push'](_0x38f737['shift']());}};_0x7afda3(++_0x54f685);}(_0x7fac,0x1b1));var _0xc7fa=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0x7fac[_0xcd5a3d];return _0xd43207;};'use strict';var Sequelize=require(_0xc7fa('0x0'));module[_0xc7fa('0x1')]={'UserId':{'type':Sequelize[_0xc7fa('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xc7fa('0x2')]}}; \ No newline at end of file +var _0x45a9=['INTEGER','sequelize','exports'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x45a9,0x1b7));var _0x945a=function(_0x3cc701,_0x331736){_0x3cc701=_0x3cc701-0x0;var _0x3e35e5=_0x45a9[_0x3cc701];return _0x3e35e5;};'use strict';var Sequelize=require(_0x945a('0x0'));module[_0x945a('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x945a('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 6ce6f54..a6b7fc9 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(_0x5d6d98,_0x965013){var _0x5287f8=function(_0x373a61){while(--_0x373a61){_0x5d6d98['push'](_0x5d6d98['shift']());}};_0x5287f8(++_0x965013);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x210c7b,_0x598019){var _0x5bd24b=function(_0x4c5c2f){while(--_0x4c5c2f){_0x210c7b['push'](_0x210c7b['shift']());}};_0x5bd24b(++_0x598019);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 e65f507..ca8d855 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4590f9,_0x27ed6a){var _0x194cd7=function(_0x5b3221){while(--_0x5b3221){_0x4590f9['push'](_0x4590f9['shift']());}};_0x194cd7(++_0x27ed6a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4d5894,_0xa75f96){var _0x5338c4=function(_0x11c2e3){while(--_0x11c2e3){_0x4d5894['push'](_0x4d5894['shift']());}};_0x5338c4(++_0xa75f96);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 8dfadab..29e5638 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 _0xf00a=['sequelize','exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf00a,0x114));var _0xaf00=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xf00a[_0x3fa37f];return _0x5a01d5;};'use strict';var Sequelize=require(_0xaf00('0x0'));module[_0xaf00('0x1')]={'penalty':{'type':Sequelize[_0xaf00('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x77f7=['sequelize','exports'];(function(_0x8e911f,_0x556e11){var _0x532a1c=function(_0x3e8839){while(--_0x3e8839){_0x8e911f['push'](_0x8e911f['shift']());}};_0x532a1c(++_0x556e11);}(_0x77f7,0xb4));var _0x777f=function(_0x411ce8,_0x140b1f){_0x411ce8=_0x411ce8-0x0;var _0x3b7d28=_0x77f7[_0x411ce8];return _0x3b7d28;};'use strict';var Sequelize=require(_0x777f('0x0'));module[_0x777f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index c248acc..11583a0 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 _0xe83e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xe83e,0x8d));var _0xee83=function(_0x1d3b4b,_0x442cec){_0x1d3b4b=_0x1d3b4b-0x0;var _0xe8e86d=_0xe83e[_0x1d3b4b];return _0xe8e86d;};'use strict';var _=require(_0xee83('0x0'));var util=require('util');var logger=require(_0xee83('0x1'))(_0xee83('0x2'));var moment=require(_0xee83('0x3'));var BPromise=require(_0xee83('0x4'));var rp=require(_0xee83('0x5'));var fs=require('fs');var path=require(_0xee83('0x6'));var rimraf=require(_0xee83('0x7'));var config=require(_0xee83('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0xee83('0x9')]=function(_0x4458db,_0x5a0618){return _0x4458db[_0xee83('0xa')](_0xee83('0xb'),attributes,{'tableName':_0xee83('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb9d=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api','moment','request-promise'];(function(_0x3513a0,_0x3bdc88){var _0x2bdeb9=function(_0x37f06d){while(--_0x37f06d){_0x3513a0['push'](_0x3513a0['shift']());}};_0x2bdeb9(++_0x3bdc88);}(_0xeb9d,0x7f));var _0xdeb9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeb9d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdeb9('0x0'));var util=require('util');var logger=require(_0xdeb9('0x1'))(_0xdeb9('0x2'));var moment=require(_0xdeb9('0x3'));var BPromise=require('bluebird');var rp=require(_0xdeb9('0x4'));var fs=require('fs');var path=require(_0xdeb9('0x5'));var rimraf=require(_0xdeb9('0x6'));var config=require(_0xdeb9('0x7'));var attributes=require(_0xdeb9('0x8'));module['exports']=function(_0x14b08e,_0x4941b9){return _0x14b08e[_0xdeb9('0x9')](_0xdeb9('0xa'),attributes,{'tableName':_0xdeb9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index ff98454..0c9fb14 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 _0x528e=['catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1a06cc,_0x2b52ed){var _0x2ac4f4=function(_0x225c17){while(--_0x225c17){_0x1a06cc['push'](_0x1a06cc['shift']());}};_0x2ac4f4(++_0x2b52ed);}(_0x528e,0x157));var _0xe528=function(_0x5ee8f8,_0x27f1df){_0x5ee8f8=_0x5ee8f8-0x0;var _0x18b40f=_0x528e[_0x5ee8f8];return _0x18b40f;};'use strict';var _=require(_0xe528('0x0'));var util=require(_0xe528('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe528('0x2'))['db'];var utils=require(_0xe528('0x3'));var logger=require(_0xe528('0x4'))('rpc');var config=require(_0xe528('0x5'));var jayson=require(_0xe528('0x6'));var client=jayson[_0xe528('0x7')][_0xe528('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x331d1e,_0x27a49b,_0x3c4d62){return new BPromise(function(_0x21913e,_0x4e0525){return client['request'](_0x331d1e,_0x3c4d62)['then'](function(_0xc050ff){logger[_0xe528('0x9')](_0xe528('0xa'),_0x27a49b,_0xe528('0xb'));logger[_0xe528('0xc')](_0xe528('0xd'),_0x27a49b,_0xe528('0xb'),JSON['stringify'](_0xc050ff));if(_0xc050ff['error']){if(_0xc050ff[_0xe528('0xe')][_0xe528('0xf')]===0x1f4){logger[_0xe528('0xe')](_0xe528('0xa'),_0x27a49b,_0xc050ff[_0xe528('0xe')][_0xe528('0x10')]);return _0x4e0525(_0xc050ff[_0xe528('0xe')][_0xe528('0x10')]);}logger[_0xe528('0xe')](_0xe528('0xa'),_0x27a49b,_0xc050ff['error']['message']);return _0x21913e(_0xc050ff[_0xe528('0xe')][_0xe528('0x10')]);}else{logger[_0xe528('0x9')](_0xe528('0xa'),_0x27a49b,_0xe528('0xb'));_0x21913e(_0xc050ff['result'][_0xe528('0x10')]);}})[_0xe528('0x11')](function(_0x52494b){logger[_0xe528('0xe')](_0xe528('0xa'),_0x27a49b,_0x52494b);_0x4e0525(_0x52494b);});});} \ No newline at end of file +var _0x12a7=['client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x12a7,0x75));var _0x712a=function(_0x294a62,_0x373ab0){_0x294a62=_0x294a62-0x0;var _0x3aa24e=_0x12a7[_0x294a62];return _0x3aa24e;};'use strict';var _=require(_0x712a('0x0'));var util=require(_0x712a('0x1'));var moment=require('moment');var BPromise=require(_0x712a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x712a('0x3'));var db=require(_0x712a('0x4'))['db'];var utils=require(_0x712a('0x5'));var logger=require(_0x712a('0x6'))(_0x712a('0x7'));var config=require(_0x712a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x712a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x465db2,_0x1e8327,_0x2196cb){return new BPromise(function(_0xcde68b,_0x395748){return client[_0x712a('0xa')](_0x465db2,_0x2196cb)[_0x712a('0xb')](function(_0x572bb9){logger[_0x712a('0xc')](_0x712a('0xd'),_0x1e8327,_0x712a('0xe'));logger[_0x712a('0xf')](_0x712a('0x10'),_0x1e8327,_0x712a('0xe'),JSON[_0x712a('0x11')](_0x572bb9));if(_0x572bb9[_0x712a('0x12')]){if(_0x572bb9[_0x712a('0x12')][_0x712a('0x13')]===0x1f4){logger[_0x712a('0x12')](_0x712a('0xd'),_0x1e8327,_0x572bb9[_0x712a('0x12')][_0x712a('0x14')]);return _0x395748(_0x572bb9['error'][_0x712a('0x14')]);}logger[_0x712a('0x12')](_0x712a('0xd'),_0x1e8327,_0x572bb9[_0x712a('0x12')][_0x712a('0x14')]);return _0xcde68b(_0x572bb9[_0x712a('0x12')]['message']);}else{logger[_0x712a('0xc')](_0x712a('0xd'),_0x1e8327,'request\x20sent');_0xcde68b(_0x572bb9['result'][_0x712a('0x14')]);}})['catch'](function(_0x2a5135){logger[_0x712a('0x12')](_0x712a('0xd'),_0x1e8327,_0x2a5135);_0x395748(_0x2a5135);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 17704f3..d02957c 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1882b6,_0x964b52){var _0xd52540=function(_0x47e276){while(--_0x47e276){_0x1882b6['push'](_0x1882b6['shift']());}};_0xd52540(++_0x964b52);}(_0x70e0,0x17b));var _0x070e=function(_0x58b387,_0x50139a){_0x58b387=_0x58b387-0x0;var _0x55f040=_0x70e0[_0x58b387];return _0x55f040;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xa2477f,_0x259c2c){var _0x36adb0=function(_0x1053f5){while(--_0x1053f5){_0xa2477f['push'](_0xa2477f['shift']());}};_0x36adb0(++_0x259c2c);}(_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 ebd865c..f35626b 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 _0x3daa=['INTEGER','Required\x20by\x20Asterisk','STRING','sequelize','exports'];(function(_0x22c18f,_0x39ba61){var _0x1cf12a=function(_0x1ae09a){while(--_0x1ae09a){_0x22c18f['push'](_0x22c18f['shift']());}};_0x1cf12a(++_0x39ba61);}(_0x3daa,0x1f2));var _0xa3da=function(_0x3221c3,_0x3e4ae7){_0x3221c3=_0x3221c3-0x0;var _0x5aef20=_0x3daa[_0x3221c3];return _0x5aef20;};'use strict';var Sequelize=require(_0xa3da('0x0'));module[_0xa3da('0x1')]={'uniqueid':{'type':Sequelize[_0xa3da('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa3da('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xa3da('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa3da('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xa3da('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xa3da('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa3da('0x3')},'paused':{'type':Sequelize[_0xa3da('0x2')](0xb),'defaultValue':0x0,'comment':_0xa3da('0x3')}}; \ No newline at end of file +var _0x7eab=['Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0x3559c4,_0x47580b){var _0x124053=function(_0x2edf1){while(--_0x2edf1){_0x3559c4['push'](_0x3559c4['shift']());}};_0x124053(++_0x47580b);}(_0x7eab,0x1d7));var _0xb7ea=function(_0x24cd14,_0xeedd80){_0x24cd14=_0x24cd14-0x0;var _0x94e846=_0x7eab[_0x24cd14];return _0x94e846;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb7ea('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb7ea('0x1')},'membername':{'type':Sequelize[_0xb7ea('0x2')],'allowNull':![],'comment':_0xb7ea('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb7ea('0x2')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xb7ea('0x0')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb7ea('0x3'),'comment':_0xb7ea('0x1')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xb7ea('0x1')},'paused':{'type':Sequelize[_0xb7ea('0x0')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index e81d25d..63d678c 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 _0x51fe=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x209745,_0x123092){var _0x1e533a=function(_0x5b3ffe){while(--_0x5b3ffe){_0x209745['push'](_0x209745['shift']());}};_0x1e533a(++_0x123092);}(_0x51fe,0x123));var _0xe51f=function(_0x2e9e18,_0x3ee6d9){_0x2e9e18=_0x2e9e18-0x0;var _0x3ad6aa=_0x51fe[_0x2e9e18];return _0x3ad6aa;};'use strict';var EventEmitter=require(_0xe51f('0x0'));var UserVoiceQueueRt=require(_0xe51f('0x1'))['db'][_0xe51f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe51f('0x3')](0x0);var events={'afterCreate':_0xe51f('0x4'),'afterUpdate':_0xe51f('0x5'),'afterDestroy':_0xe51f('0x6')};function emitEvent(_0x2e28e8){return function(_0x567bdf,_0x3311ce,_0x158824){UserVoiceQueueRtEvents[_0xe51f('0x7')](_0x2e28e8+':'+_0x567bdf['id'],_0x567bdf);UserVoiceQueueRtEvents['emit'](_0x2e28e8,_0x567bdf);_0x158824(null);};}for(var e in events){if(events[_0xe51f('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xe51f('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xaed7=['remove','emit','hook','events','../../mysqldb','UserVoiceQueueRt','save','update'];(function(_0x5b1980,_0x18db8c){var _0x223b68=function(_0x1c9b92){while(--_0x1c9b92){_0x5b1980['push'](_0x5b1980['shift']());}};_0x223b68(++_0x18db8c);}(_0xaed7,0x93));var _0x7aed=function(_0x3095b6,_0x426d15){_0x3095b6=_0x3095b6-0x0;var _0x4d8e90=_0xaed7[_0x3095b6];return _0x4d8e90;};'use strict';var EventEmitter=require(_0x7aed('0x0'));var UserVoiceQueueRt=require(_0x7aed('0x1'))['db'][_0x7aed('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7aed('0x3'),'afterUpdate':_0x7aed('0x4'),'afterDestroy':_0x7aed('0x5')};function emitEvent(_0x5d4aea){return function(_0x455927,_0x15d713,_0x168e62){UserVoiceQueueRtEvents[_0x7aed('0x6')](_0x5d4aea+':'+_0x455927['id'],_0x455927);UserVoiceQueueRtEvents[_0x7aed('0x6')](_0x5d4aea,_0x455927);_0x168e62(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x7aed('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 20d1b00..6af6ec6 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 _0x5936=['moment','bluebird','request-promise','./userVoiceQueueRt.attributes','exports','define','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5936,0x106));var _0x6593=function(_0x3d5e4a,_0x1be990){_0x3d5e4a=_0x3d5e4a-0x0;var _0x164d87=_0x5936[_0x3d5e4a];return _0x164d87;};'use strict';var _=require(_0x6593('0x0'));var util=require(_0x6593('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6593('0x2'));var BPromise=require(_0x6593('0x3'));var rp=require(_0x6593('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6593('0x5'));module[_0x6593('0x6')]=function(_0x1bf4f0,_0x3e11c6){return _0x1bf4f0[_0x6593('0x7')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf45a=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define'];(function(_0x174b1a,_0x3bffbc){var _0x2e6ade=function(_0x1bb86c){while(--_0x1bb86c){_0x174b1a['push'](_0x174b1a['shift']());}};_0x2e6ade(++_0x3bffbc);}(_0xf45a,0x10a));var _0xaf45=function(_0x414e4f,_0x164e10){_0x414e4f=_0x414e4f-0x0;var _0x556793=_0xf45a[_0x414e4f];return _0x556793;};'use strict';var _=require(_0xaf45('0x0'));var util=require('util');var logger=require(_0xaf45('0x1'))(_0xaf45('0x2'));var moment=require(_0xaf45('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf45('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf45('0x5'));var config=require(_0xaf45('0x6'));var attributes=require(_0xaf45('0x7'));module['exports']=function(_0x5937f3,_0x230be7){return _0x5937f3[_0xaf45('0x8')](_0xaf45('0x9'),attributes,{'tableName':_0xaf45('0xa'),'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 6ae5e2e..40a0f2a 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 _0xbd4a=['code','message','result','catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xbd4a,0x87));var _0xabd4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbd4a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xabd4('0x0'));var util=require(_0xabd4('0x1'));var moment=require(_0xabd4('0x2'));var BPromise=require(_0xabd4('0x3'));var rs=require(_0xabd4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabd4('0x5'))['db'];var utils=require(_0xabd4('0x6'));var logger=require(_0xabd4('0x7'))('rpc');var config=require(_0xabd4('0x8'));var jayson=require(_0xabd4('0x9'));var client=jayson[_0xabd4('0xa')]['http']({'port':0x232a});config[_0xabd4('0xb')]=_[_0xabd4('0xc')](config[_0xabd4('0xb')],{'host':_0xabd4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xabd4('0xe'))[_0xabd4('0xf')](socket);function respondWithRpcPromise(_0x51d4a4,_0x5a8a39,_0x292edb){return new BPromise(function(_0x412ed3,_0x2cfc54){return client[_0xabd4('0x10')](_0x51d4a4,_0x292edb)[_0xabd4('0x11')](function(_0x4239ff){logger[_0xabd4('0x12')](_0xabd4('0x13'),_0x5a8a39,_0xabd4('0x14'));logger[_0xabd4('0x15')](_0xabd4('0x16'),_0x5a8a39,_0xabd4('0x14'),JSON[_0xabd4('0x17')](_0x4239ff));if(_0x4239ff['error']){if(_0x4239ff[_0xabd4('0x18')][_0xabd4('0x19')]===0x1f4){logger[_0xabd4('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5a8a39,_0x4239ff[_0xabd4('0x18')][_0xabd4('0x1a')]);return _0x2cfc54(_0x4239ff[_0xabd4('0x18')][_0xabd4('0x1a')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5a8a39,_0x4239ff[_0xabd4('0x18')][_0xabd4('0x1a')]);return _0x412ed3(_0x4239ff['error']['message']);}else{logger[_0xabd4('0x12')](_0xabd4('0x13'),_0x5a8a39,_0xabd4('0x14'));_0x412ed3(_0x4239ff[_0xabd4('0x1b')][_0xabd4('0x1a')]);}})[_0xabd4('0x1c')](function(_0x4eb401){logger[_0xabd4('0x18')](_0xabd4('0x13'),_0x5a8a39,_0x4eb401);_0x2cfc54(_0x4eb401);});});}exports['GetVoiceQueueRtPauses']=function(_0x182ac9){var _0x5ee862=this;return new Promise(function(_0x44ef87,_0x4bccb3){return db[_0xabd4('0x1d')][_0xabd4('0x1e')]({'raw':_0x182ac9[_0xabd4('0x1f')]?_0x182ac9[_0xabd4('0x1f')][_0xabd4('0x20')]===undefined?!![]:![]:!![],'where':_0x182ac9['options']?_0x182ac9[_0xabd4('0x1f')][_0xabd4('0x21')]||null:null,'attributes':[[db[_0xabd4('0x22')]['fn'](_0xabd4('0x23'),db[_0xabd4('0x22')]['fn']('IF',db[_0xabd4('0x22')][_0xabd4('0x24')](_0xabd4('0x25')))),_0xabd4('0x26')]]})[_0xabd4('0x11')](function(_0x3e10e3){logger[_0xabd4('0x12')]('GetVoiceQueueRtPauses',_0x182ac9);logger[_0xabd4('0x15')](_0xabd4('0x27'),_0x182ac9,JSON[_0xabd4('0x17')](_0x3e10e3));_0x44ef87(_0x3e10e3);})[_0xabd4('0x1c')](function(_0x4037ac){logger['error'](_0xabd4('0x27'),_0x4037ac[_0xabd4('0x1a')],_0x182ac9);_0x4bccb3(_0x5ee862[_0xabd4('0x18')](0x1f4,_0x4037ac['message']));});});}; \ No newline at end of file +var _0x48a0=['sequelize','literal','`paused`\x20=\x201,\x201,\x20null','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x48a0,0xee));var _0x048a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x48a0[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x048a('0x0'));var util=require(_0x048a('0x1'));var moment=require(_0x048a('0x2'));var BPromise=require(_0x048a('0x3'));var rs=require(_0x048a('0x4'));var fs=require('fs');var Redis=require(_0x048a('0x5'));var db=require(_0x048a('0x6'))['db'];var utils=require(_0x048a('0x7'));var logger=require(_0x048a('0x8'))(_0x048a('0x9'));var config=require(_0x048a('0xa'));var jayson=require(_0x048a('0xb'));var client=jayson[_0x048a('0xc')][_0x048a('0xd')]({'port':0x232a});config[_0x048a('0xe')]=_[_0x048a('0xf')](config[_0x048a('0xe')],{'host':_0x048a('0x10'),'port':0x18eb});var socket=require(_0x048a('0x11'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x048a('0x12')](socket);function respondWithRpcPromise(_0x4c05d6,_0x2f7caf,_0x93783c){return new BPromise(function(_0x2a9bb8,_0x2f9e7f){return client[_0x048a('0x13')](_0x4c05d6,_0x93783c)[_0x048a('0x14')](function(_0x560d73){logger[_0x048a('0x15')](_0x048a('0x16'),_0x2f7caf,_0x048a('0x17'));logger['debug'](_0x048a('0x18'),_0x2f7caf,_0x048a('0x17'),JSON[_0x048a('0x19')](_0x560d73));if(_0x560d73['error']){if(_0x560d73['error']['code']===0x1f4){logger[_0x048a('0x1a')](_0x048a('0x16'),_0x2f7caf,_0x560d73['error'][_0x048a('0x1b')]);return _0x2f9e7f(_0x560d73[_0x048a('0x1a')][_0x048a('0x1b')]);}logger[_0x048a('0x1a')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2f7caf,_0x560d73[_0x048a('0x1a')][_0x048a('0x1b')]);return _0x2a9bb8(_0x560d73[_0x048a('0x1a')][_0x048a('0x1b')]);}else{logger[_0x048a('0x15')](_0x048a('0x16'),_0x2f7caf,_0x048a('0x17'));_0x2a9bb8(_0x560d73[_0x048a('0x1c')][_0x048a('0x1b')]);}})[_0x048a('0x1d')](function(_0x420b99){logger[_0x048a('0x1a')](_0x048a('0x16'),_0x2f7caf,_0x420b99);_0x2f9e7f(_0x420b99);});});}exports[_0x048a('0x1e')]=function(_0x5b8d97){var _0x156978=this;return new Promise(function(_0x365818,_0x4c098c){return db['UserVoiceQueueRt'][_0x048a('0x1f')]({'raw':_0x5b8d97[_0x048a('0x20')]?_0x5b8d97[_0x048a('0x20')][_0x048a('0x21')]===undefined?!![]:![]:!![],'where':_0x5b8d97[_0x048a('0x20')]?_0x5b8d97[_0x048a('0x20')][_0x048a('0x22')]||null:null,'attributes':[[db[_0x048a('0x23')]['fn']('COUNT',db[_0x048a('0x23')]['fn']('IF',db[_0x048a('0x23')][_0x048a('0x24')](_0x048a('0x25')))),'outboundQueuePauses']]})['then'](function(_0x19481c){logger[_0x048a('0x15')](_0x048a('0x1e'),_0x5b8d97);logger[_0x048a('0x26')](_0x048a('0x1e'),_0x5b8d97,JSON[_0x048a('0x19')](_0x19481c));_0x365818(_0x19481c);})[_0x048a('0x1d')](function(_0x379ecd){logger['error'](_0x048a('0x1e'),_0x379ecd[_0x048a('0x1b')],_0x5b8d97);_0x4c098c(_0x156978[_0x048a('0x1a')](0x1f4,_0x379ecd[_0x048a('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8df5fa3..202a205 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 _0x6f72=['remove','update','register','length','save'];(function(_0x26108a,_0x2c5729){var _0x564559=function(_0x4ae827){while(--_0x4ae827){_0x26108a['push'](_0x26108a['shift']());}};_0x564559(++_0x2c5729);}(_0x6f72,0xae));var _0x26f7=function(_0x3298d2,_0x2a073b){_0x3298d2=_0x3298d2-0x0;var _0x2881c4=_0x6f72[_0x3298d2];return _0x2881c4;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x26f7('0x0'),_0x26f7('0x1'),_0x26f7('0x2')];function createListener(_0x5d8f55,_0x26ed0f){return function(_0x34e1f6){_0x26ed0f['emit'](_0x5d8f55,_0x34e1f6);};}function removeListener(_0x4e19f5,_0x10b953){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4e19f5,_0x10b953);};}exports[_0x26f7('0x3')]=function(_0x50719f){for(var _0x29465a=0x0,_0x529e3f=events[_0x26f7('0x4')];_0x29465a<_0x529e3f;_0x29465a++){var _0x21de0c=events[_0x29465a];var _0x4db9d0=createListener('userVoiceQueueRt:'+_0x21de0c,_0x50719f);UserVoiceQueueRtEvents['on'](_0x21de0c,_0x4db9d0);}}; \ No newline at end of file +var _0x9c50=['update','register','length','userVoiceQueueRt:'];(function(_0x378e46,_0x17fd9b){var _0x75666a=function(_0x14e263){while(--_0x14e263){_0x378e46['push'](_0x378e46['shift']());}};_0x75666a(++_0x17fd9b);}(_0x9c50,0xec));var _0x09c5=function(_0x12ab74,_0x49e1fb){_0x12ab74=_0x12ab74-0x0;var _0x4066d1=_0x9c50[_0x12ab74];return _0x4066d1;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove',_0x09c5('0x0')];function createListener(_0x5ec6dd,_0xec826c){return function(_0x493887){_0xec826c['emit'](_0x5ec6dd,_0x493887);};}function removeListener(_0x23513c,_0x1e2992){return function(){UserVoiceQueueRtEvents['removeListener'](_0x23513c,_0x1e2992);};}exports[_0x09c5('0x1')]=function(_0x58a451){for(var _0x8987f6=0x0,_0x2830e5=events[_0x09c5('0x2')];_0x8987f6<_0x2830e5;_0x8987f6++){var _0x51ff47=events[_0x8987f6];var _0x27d297=createListener(_0x09c5('0x3')+_0x51ff47,_0x58a451);UserVoiceQueueRtEvents['on'](_0x51ff47,_0x27d297);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 04f7be0..bff7867 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x42235f,_0x5dabfd){var _0x3f5fab=function(_0x358fd7){while(--_0x358fd7){_0x42235f['push'](_0x42235f['shift']());}};_0x3f5fab(++_0x5dabfd);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x47892d,_0xbe1378){var _0x381ec9=function(_0x176af3){while(--_0x176af3){_0x47892d['push'](_0x47892d['shift']());}};_0x381ec9(++_0xbe1378);}(_0x70e0,0x17b));var _0x070e=function(_0x1f13cd,_0x3b7018){_0x1f13cd=_0x1f13cd-0x0;var _0x5ce4d8=_0x70e0[_0x1f13cd];return _0x5ce4d8;};'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 7f3cf21..fec13d0 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 _0x0686=['sequelize','exports','INTEGER'];(function(_0x47d7c7,_0x1e150a){var _0x6527b=function(_0x5608aa){while(--_0x5608aa){_0x47d7c7['push'](_0x47d7c7['shift']());}};_0x6527b(++_0x1e150a);}(_0x0686,0x123));var _0x6068=function(_0x124bf0,_0x59f4b3){_0x124bf0=_0x124bf0-0x0;var _0xc0ad98=_0x0686[_0x124bf0];return _0xc0ad98;};'use strict';var Sequelize=require(_0x6068('0x0'));module[_0x6068('0x1')]={'penalty':{'type':Sequelize[_0x6068('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcddd=['sequelize','exports','INTEGER'];(function(_0x565a87,_0x2a5c73){var _0x4b08c0=function(_0x2b9356){while(--_0x2b9356){_0x565a87['push'](_0x565a87['shift']());}};_0x4b08c0(++_0x2a5c73);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x2f9f61,_0x25ec8c){_0x2f9f61=_0x2f9f61-0x0;var _0x8d9e60=_0xcddd[_0x2f9f61];return _0x8d9e60;};'use strict';var Sequelize=require(_0xdcdd('0x0'));module[_0xdcdd('0x1')]={'penalty':{'type':Sequelize[_0xdcdd('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 8977d49..12415ec 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 _0x7734=['rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16bdbd,_0x11302c){var _0x7f5668=function(_0x2ab02f){while(--_0x2ab02f){_0x16bdbd['push'](_0x16bdbd['shift']());}};_0x7f5668(++_0x11302c);}(_0x7734,0x18d));var _0x4773=function(_0x5cd35a,_0x34b63b){_0x5cd35a=_0x5cd35a-0x0;var _0x12e0b2=_0x7734[_0x5cd35a];return _0x12e0b2;};'use strict';var _=require(_0x4773('0x0'));var util=require('util');var logger=require(_0x4773('0x1'))(_0x4773('0x2'));var moment=require(_0x4773('0x3'));var BPromise=require(_0x4773('0x4'));var rp=require(_0x4773('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4773('0x6'));var config=require(_0x4773('0x7'));var attributes=require(_0x4773('0x8'));module[_0x4773('0x9')]=function(_0x3ea501,_0x19d208){return _0x3ea501[_0x4773('0xa')](_0x4773('0xb'),attributes,{'tableName':_0x4773('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5b0=['bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','moment'];(function(_0x5ed8f5,_0x55ae6e){var _0x14aad0=function(_0x122990){while(--_0x122990){_0x5ed8f5['push'](_0x5ed8f5['shift']());}};_0x14aad0(++_0x55ae6e);}(_0xc5b0,0xa6));var _0x0c5b=function(_0x15f22f,_0x15dde5){_0x15f22f=_0x15f22f-0x0;var _0x5434ea=_0xc5b0[_0x15f22f];return _0x5434ea;};'use strict';var _=require('lodash');var util=require(_0x0c5b('0x0'));var logger=require(_0x0c5b('0x1'))('api');var moment=require(_0x0c5b('0x2'));var BPromise=require(_0x0c5b('0x3'));var rp=require(_0x0c5b('0x4'));var fs=require('fs');var path=require(_0x0c5b('0x5'));var rimraf=require(_0x0c5b('0x6'));var config=require(_0x0c5b('0x7'));var attributes=require(_0x0c5b('0x8'));module[_0x0c5b('0x9')]=function(_0x280104,_0x59d886){return _0x280104[_0x0c5b('0xa')](_0x0c5b('0xb'),attributes,{'tableName':_0x0c5b('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 00fd842..c4e9172 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 _0x50f8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird'];(function(_0x8aad61,_0x40a56a){var _0x46c0aa=function(_0x35ab83){while(--_0x35ab83){_0x8aad61['push'](_0x8aad61['shift']());}};_0x46c0aa(++_0x40a56a);}(_0x50f8,0x14d));var _0x850f=function(_0x2e428c,_0x15b012){_0x2e428c=_0x2e428c-0x0;var _0x281170=_0x50f8[_0x2e428c];return _0x281170;};'use strict';var _=require(_0x850f('0x0'));var util=require('util');var moment=require(_0x850f('0x1'));var BPromise=require(_0x850f('0x2'));var rs=require(_0x850f('0x3'));var fs=require('fs');var Redis=require(_0x850f('0x4'));var db=require(_0x850f('0x5'))['db'];var utils=require(_0x850f('0x6'));var logger=require(_0x850f('0x7'))(_0x850f('0x8'));var config=require(_0x850f('0x9'));var jayson=require(_0x850f('0xa'));var client=jayson[_0x850f('0xb')][_0x850f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3364ac,_0x594870,_0x5a737c){return new BPromise(function(_0x14e036,_0x1ee179){return client[_0x850f('0xd')](_0x3364ac,_0x5a737c)[_0x850f('0xe')](function(_0x576e1b){logger[_0x850f('0xf')](_0x850f('0x10'),_0x594870,_0x850f('0x11'));logger[_0x850f('0x12')](_0x850f('0x13'),_0x594870,_0x850f('0x11'),JSON[_0x850f('0x14')](_0x576e1b));if(_0x576e1b[_0x850f('0x15')]){if(_0x576e1b[_0x850f('0x15')]['code']===0x1f4){logger['error'](_0x850f('0x10'),_0x594870,_0x576e1b[_0x850f('0x15')][_0x850f('0x16')]);return _0x1ee179(_0x576e1b[_0x850f('0x15')]['message']);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x594870,_0x576e1b[_0x850f('0x15')][_0x850f('0x16')]);return _0x14e036(_0x576e1b[_0x850f('0x15')][_0x850f('0x16')]);}else{logger['info'](_0x850f('0x10'),_0x594870,_0x850f('0x11'));_0x14e036(_0x576e1b['result'][_0x850f('0x16')]);}})[_0x850f('0x17')](function(_0x2f802c){logger[_0x850f('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x594870,_0x2f802c);_0x1ee179(_0x2f802c);});});} \ No newline at end of file +var _0x7cb1=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x14a208,_0x1e263d){var _0x44295a=function(_0x2810e9){while(--_0x2810e9){_0x14a208['push'](_0x14a208['shift']());}};_0x44295a(++_0x1e263d);}(_0x7cb1,0x11e));var _0x17cb=function(_0x33eec7,_0x103189){_0x33eec7=_0x33eec7-0x0;var _0x72c492=_0x7cb1[_0x33eec7];return _0x72c492;};'use strict';var _=require(_0x17cb('0x0'));var util=require('util');var moment=require(_0x17cb('0x1'));var BPromise=require('bluebird');var rs=require(_0x17cb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x17cb('0x3'));var logger=require(_0x17cb('0x4'))(_0x17cb('0x5'));var config=require('../../config/environment');var jayson=require(_0x17cb('0x6'));var client=jayson['client'][_0x17cb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ffecc,_0x15f1e2,_0x4d26b5){return new BPromise(function(_0x378a13,_0x4dd481){return client[_0x17cb('0x8')](_0x3ffecc,_0x4d26b5)[_0x17cb('0x9')](function(_0xd00d64){logger[_0x17cb('0xa')](_0x17cb('0xb'),_0x15f1e2,_0x17cb('0xc'));logger[_0x17cb('0xd')](_0x17cb('0xe'),_0x15f1e2,_0x17cb('0xc'),JSON[_0x17cb('0xf')](_0xd00d64));if(_0xd00d64[_0x17cb('0x10')]){if(_0xd00d64['error'][_0x17cb('0x11')]===0x1f4){logger[_0x17cb('0x10')](_0x17cb('0xb'),_0x15f1e2,_0xd00d64[_0x17cb('0x10')][_0x17cb('0x12')]);return _0x4dd481(_0xd00d64[_0x17cb('0x10')]['message']);}logger[_0x17cb('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x15f1e2,_0xd00d64[_0x17cb('0x10')][_0x17cb('0x12')]);return _0x378a13(_0xd00d64['error'][_0x17cb('0x12')]);}else{logger[_0x17cb('0xa')](_0x17cb('0xb'),_0x15f1e2,'request\x20sent');_0x378a13(_0xd00d64[_0x17cb('0x13')]['message']);}})[_0x17cb('0x14')](function(_0x419d65){logger[_0x17cb('0x10')](_0x17cb('0xb'),_0x15f1e2,_0x419d65);_0x4dd481(_0x419d65);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 5687c6c..8e8249f 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 _0xdecb=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','util','path'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0xdecb,0xe2));var _0xbdec=function(_0x19ad63,_0x2c1ca3){_0x19ad63=_0x19ad63-0x0;var _0x4a663e=_0xdecb[_0x19ad63];return _0x4a663e;};'use strict';var multer=require('multer');var util=require(_0xbdec('0x0'));var path=require(_0xbdec('0x1'));var timeout=require(_0xbdec('0x2'));var express=require('express');var router=express[_0xbdec('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbdec('0x4'));var interaction=require(_0xbdec('0x5'));var config=require(_0xbdec('0x6'));var controller=require(_0xbdec('0x7'));router[_0xbdec('0x8')]('/',auth[_0xbdec('0x9')](),controller[_0xbdec('0xa')]);router['get'](_0xbdec('0xb'),auth[_0xbdec('0x9')](),controller[_0xbdec('0xc')]);router[_0xbdec('0xd')]('/',auth[_0xbdec('0x9')](),controller[_0xbdec('0xe')]);router[_0xbdec('0xf')](_0xbdec('0xb'),auth['isAuthenticated'](),controller[_0xbdec('0x10')]);router[_0xbdec('0x11')](_0xbdec('0xb'),auth[_0xbdec('0x9')](),controller['destroy']);module[_0xbdec('0x12')]=router; \ No newline at end of file +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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6fb8,0x104));var _0x86fb=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0x6fb8[_0x57cbfb];return _0x4cb933;};'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 diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 29592dd..7e244bd 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 _0x06bf=['name','sequelize','exports','STRING'];(function(_0x333e98,_0x4c35e9){var _0x3e00ae=function(_0x4298b9){while(--_0x4298b9){_0x333e98['push'](_0x333e98['shift']());}};_0x3e00ae(++_0x4c35e9);}(_0x06bf,0x105));var _0xf06b=function(_0x14f54a,_0x42536b){_0x14f54a=_0x14f54a-0x0;var _0x122b3a=_0x06bf[_0x14f54a];return _0x122b3a;};'use strict';var Sequelize=require(_0xf06b('0x0'));module[_0xf06b('0x1')]={'name':{'type':Sequelize[_0xf06b('0x2')],'unique':_0xf06b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf06b('0x2')]}}; \ No newline at end of file +var _0x5fb2=['STRING','sequelize'];(function(_0x43a1ef,_0x4e2295){var _0x534e68=function(_0x27d5bf){while(--_0x27d5bf){_0x43a1ef['push'](_0x43a1ef['shift']());}};_0x534e68(++_0x4e2295);}(_0x5fb2,0xad));var _0x25fb=function(_0x1c673a,_0x4eaa6e){_0x1c673a=_0x1c673a-0x0;var _0xca51=_0x5fb2[_0x1c673a];return _0xca51;};'use strict';var Sequelize=require(_0x25fb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x25fb('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 984f13d..e49e944 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 _0x2661=['reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','Variable','includeAll','catch','show','params','rawAttributes','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2661,0x161));var _0x1266=function(_0x120b94,_0x4f9ca4){_0x120b94=_0x120b94-0x0;var _0x465559=_0x2661[_0x120b94];return _0x465559;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1266('0x0'));var zipdir=require(_0x1266('0x1'));var jsonpatch=require(_0x1266('0x2'));var rp=require(_0x1266('0x3'));var moment=require(_0x1266('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1266('0x5'));var util=require('util');var path=require(_0x1266('0x6'));var sox=require(_0x1266('0x7'));var csv=require(_0x1266('0x8'));var ejs=require(_0x1266('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1266('0xa'));var squel=require(_0x1266('0xb'));var crypto=require('crypto');var jsforce=require(_0x1266('0xc'));var deskjs=require(_0x1266('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1266('0xe'));var Papa=require(_0x1266('0xf'));var Redis=require(_0x1266('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1266('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1266('0x12'));var logger=require('../../config/logger')(_0x1266('0x13'));var utils=require(_0x1266('0x14'));var config=require(_0x1266('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e6686,_0xadca5c){_0xadca5c=_0xadca5c||0xcc;return function(_0x486012){if(_0x486012){return _0x3e6686[_0x1266('0x16')](_0xadca5c);}return _0x3e6686['status'](_0xadca5c)[_0x1266('0x17')]();};}function respondWithResult(_0x40c454,_0x45e871){_0x45e871=_0x45e871||0xc8;return function(_0x4928b5){if(_0x4928b5){return _0x40c454[_0x1266('0x18')](_0x45e871)[_0x1266('0x19')](_0x4928b5);}};}function respondWithFilteredResult(_0x591fb1,_0x15c669){return function(_0x590072){if(_0x590072){var _0x1a7de6=typeof _0x15c669['offset']===_0x1266('0x1a')&&typeof _0x15c669[_0x1266('0x1b')]===_0x1266('0x1a');var _0x464d34=_0x590072[_0x1266('0x1c')];var _0x203413=_0x1a7de6?0x0:_0x15c669[_0x1266('0x1d')];var _0x37e5e7=_0x1a7de6?_0x590072[_0x1266('0x1c')]:_0x15c669[_0x1266('0x1d')]+_0x15c669[_0x1266('0x1b')];var _0x494929;if(_0x37e5e7>=_0x464d34){_0x37e5e7=_0x464d34;_0x494929=0xc8;}else{_0x494929=0xce;}_0x591fb1[_0x1266('0x18')](_0x494929);return _0x591fb1[_0x1266('0x1e')](_0x1266('0x1f'),_0x203413+'-'+_0x37e5e7+'/'+_0x464d34)[_0x1266('0x19')](_0x590072);}return null;};}function patchUpdates(_0x355c46){return function(_0x12e1a4){try{jsonpatch['apply'](_0x12e1a4,_0x355c46,!![]);}catch(_0xa7caac){return BPromise[_0x1266('0x20')](_0xa7caac);}return _0x12e1a4[_0x1266('0x21')]();};}function saveUpdates(_0x26d0d4,_0x39ad5b){return function(_0x28063c){if(_0x28063c){return _0x28063c[_0x1266('0x22')](_0x26d0d4)[_0x1266('0x23')](function(_0xed3f8){return _0xed3f8;});}return null;};}function removeEntity(_0x34e4ca,_0x1dfe4b){return function(_0x2baf7e){if(_0x2baf7e){return _0x2baf7e[_0x1266('0x24')]()['then'](function(){var _0x1b0fb5=_0x2baf7e[_0x1266('0x25')]({'plain':!![]});var _0x37df6b='Variables';return db[_0x1266('0x26')][_0x1266('0x24')]({'where':{'type':_0x37df6b,'resourceId':_0x1b0fb5['id']}})[_0x1266('0x23')](function(){return _0x2baf7e;});})[_0x1266('0x23')](function(){_0x34e4ca[_0x1266('0x18')](0xcc)[_0x1266('0x17')]();});}};}function handleEntityNotFound(_0x5299ae,_0x417d8c){return function(_0x340deb){if(!_0x340deb){_0x5299ae[_0x1266('0x16')](0x194);}return _0x340deb;};}function handleError(_0x470bdd,_0xda6bba){_0xda6bba=_0xda6bba||0x1f4;return function(_0x15b603){logger[_0x1266('0x27')](_0x15b603[_0x1266('0x28')]);if(_0x15b603['name']){delete _0x15b603[_0x1266('0x29')];}_0x470bdd[_0x1266('0x18')](_0xda6bba)[_0x1266('0x2a')](_0x15b603);};}exports['index']=function(_0x50033d,_0xe50f2a){var _0x3ddf9f={},_0x27638d={},_0x49ce68={'count':0x0,'rows':[]};var _0x15d0cb=_[_0x1266('0x2b')](db['Variable']['rawAttributes'],function(_0x2434ab){return{'name':_0x2434ab[_0x1266('0x2c')],'type':_0x2434ab[_0x1266('0x2d')][_0x1266('0x2e')]};});_0x27638d[_0x1266('0x2f')]=_[_0x1266('0x2b')](_0x15d0cb,'name');_0x27638d['query']=_[_0x1266('0x30')](_0x50033d[_0x1266('0x31')]);_0x27638d[_0x1266('0x32')]=_['intersection'](_0x27638d[_0x1266('0x2f')],_0x27638d['query']);_0x3ddf9f[_0x1266('0x33')]=_['intersection'](_0x27638d['model'],qs[_0x1266('0x34')](_0x50033d[_0x1266('0x31')][_0x1266('0x34')]));_0x3ddf9f[_0x1266('0x33')]=_0x3ddf9f[_0x1266('0x33')]['length']?_0x3ddf9f[_0x1266('0x33')]:_0x27638d['model'];if(!_0x50033d[_0x1266('0x31')]['hasOwnProperty'](_0x1266('0x35'))){_0x3ddf9f[_0x1266('0x1b')]=qs[_0x1266('0x1b')](_0x50033d[_0x1266('0x31')][_0x1266('0x1b')]);_0x3ddf9f['offset']=qs[_0x1266('0x1d')](_0x50033d[_0x1266('0x31')][_0x1266('0x1d')]);}_0x3ddf9f['order']=qs[_0x1266('0x36')](_0x50033d[_0x1266('0x31')][_0x1266('0x36')]);_0x3ddf9f[_0x1266('0x37')]=qs[_0x1266('0x32')](_['pick'](_0x50033d[_0x1266('0x31')],_0x27638d['filters']),_0x15d0cb);if(_0x50033d[_0x1266('0x31')][_0x1266('0x38')]){_0x3ddf9f['where']=_[_0x1266('0x39')](_0x3ddf9f[_0x1266('0x37')],{'$or':_['map'](_0x15d0cb,function(_0x5657a9){if(_0x5657a9[_0x1266('0x2d')]!==_0x1266('0x3a')){var _0x329d1d={};_0x329d1d[_0x5657a9[_0x1266('0x29')]]={'$like':'%'+_0x50033d[_0x1266('0x31')]['filter']+'%'};return _0x329d1d;}})});}_0x3ddf9f=_[_0x1266('0x39')]({},_0x3ddf9f,_0x50033d['options']);var _0x5f2bfe={'where':_0x3ddf9f[_0x1266('0x37')]};return db[_0x1266('0x3b')][_0x1266('0x1c')](_0x5f2bfe)['then'](function(_0x2501a6){_0x49ce68['count']=_0x2501a6;if(_0x50033d[_0x1266('0x31')][_0x1266('0x3c')]){_0x3ddf9f['include']=[{'all':!![]}];}return db[_0x1266('0x3b')]['findAll'](_0x3ddf9f);})[_0x1266('0x23')](function(_0x29e8f8){_0x49ce68['rows']=_0x29e8f8;return _0x49ce68;})[_0x1266('0x23')](respondWithFilteredResult(_0xe50f2a,_0x3ddf9f))[_0x1266('0x3d')](handleError(_0xe50f2a,null));};exports[_0x1266('0x3e')]=function(_0x506098,_0x4aa032){var _0x20807e={'raw':!![],'where':{'id':_0x506098[_0x1266('0x3f')]['id']}},_0x1d6fd9={};_0x1d6fd9[_0x1266('0x2f')]=_[_0x1266('0x30')](db[_0x1266('0x3b')][_0x1266('0x40')]);_0x1d6fd9[_0x1266('0x31')]=_[_0x1266('0x30')](_0x506098[_0x1266('0x31')]);_0x1d6fd9['filters']=_[_0x1266('0x41')](_0x1d6fd9[_0x1266('0x2f')],_0x1d6fd9[_0x1266('0x31')]);_0x20807e[_0x1266('0x33')]=_[_0x1266('0x41')](_0x1d6fd9[_0x1266('0x2f')],qs['fields'](_0x506098[_0x1266('0x31')][_0x1266('0x34')]));_0x20807e[_0x1266('0x33')]=_0x20807e[_0x1266('0x33')]['length']?_0x20807e['attributes']:_0x1d6fd9[_0x1266('0x2f')];if(_0x506098[_0x1266('0x31')]['includeAll']){_0x20807e[_0x1266('0x42')]=[{'all':!![]}];}_0x20807e=_['merge']({},_0x20807e,_0x506098['options']);return db[_0x1266('0x3b')][_0x1266('0x43')](_0x20807e)['then'](handleEntityNotFound(_0x4aa032,null))[_0x1266('0x23')](respondWithResult(_0x4aa032,null))['catch'](handleError(_0x4aa032,null));};exports[_0x1266('0x44')]=function(_0x4cb212,_0x326bac){return db[_0x1266('0x3b')][_0x1266('0x44')](_0x4cb212[_0x1266('0x45')],{})[_0x1266('0x23')](function(_0x2d5414){var _0x4792f0=_0x4cb212[_0x1266('0x46')][_0x1266('0x25')]({'plain':!![]});if(!_0x4792f0)throw new Error(_0x1266('0x47'));if(_0x4792f0['role']==='user'){var _0xe32b7=_0x2d5414[_0x1266('0x25')]({'plain':!![]});var _0x19c8cf=_0x1266('0x48');return db[_0x1266('0x49')][_0x1266('0x43')]({'where':{'name':_0x19c8cf,'userProfileId':_0x4792f0[_0x1266('0x4a')]},'raw':!![]})[_0x1266('0x23')](function(_0x8847b5){if(_0x8847b5&&_0x8847b5[_0x1266('0x4b')]===0x0){return db[_0x1266('0x26')][_0x1266('0x44')]({'name':_0xe32b7[_0x1266('0x29')],'resourceId':_0xe32b7['id'],'type':_0x8847b5[_0x1266('0x29')],'sectionId':_0x8847b5['id']},{})['then'](function(){return _0x2d5414;});}else{return _0x2d5414;}})[_0x1266('0x3d')](function(_0x227c9e){logger[_0x1266('0x27')](_0x1266('0x4c'),_0x227c9e);throw _0x227c9e;});}return _0x2d5414;})[_0x1266('0x23')](respondWithResult(_0x326bac,0xc9))[_0x1266('0x3d')](handleError(_0x326bac,null));};exports[_0x1266('0x22')]=function(_0x43f587,_0x12bb89){if(_0x43f587[_0x1266('0x45')]['id']){delete _0x43f587[_0x1266('0x45')]['id'];}return db[_0x1266('0x3b')][_0x1266('0x43')]({'where':{'id':_0x43f587[_0x1266('0x3f')]['id']}})['then'](handleEntityNotFound(_0x12bb89,null))['then'](saveUpdates(_0x43f587[_0x1266('0x45')],null))[_0x1266('0x23')](respondWithResult(_0x12bb89,null))[_0x1266('0x3d')](handleError(_0x12bb89,null));};exports[_0x1266('0x24')]=function(_0x3b5daa,_0x2da7cc){return db['Variable']['find']({'where':{'id':_0x3b5daa['params']['id']}})[_0x1266('0x23')](handleEntityNotFound(_0x2da7cc,null))[_0x1266('0x23')](removeEntity(_0x2da7cc,null))[_0x1266('0x3d')](handleError(_0x2da7cc,null));}; \ No newline at end of file +var _0x2a27=['intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','rows','catch','length','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','update','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','error','stack','name','index','map','Variable','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x2bab5e,_0x3aabdd){var _0x2a398=function(_0x436a44){while(--_0x436a44){_0x2bab5e['push'](_0x2bab5e['shift']());}};_0x2a398(++_0x3aabdd);}(_0x2a27,0x1e9));var _0x72a2=function(_0x26fc45,_0x4986ca){_0x26fc45=_0x26fc45-0x0;var _0x2e1bdf=_0x2a27[_0x26fc45];return _0x2e1bdf;};'use strict';var emlformat=require(_0x72a2('0x0'));var rimraf=require(_0x72a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72a2('0x2'));var rp=require(_0x72a2('0x3'));var moment=require(_0x72a2('0x4'));var BPromise=require(_0x72a2('0x5'));var Mustache=require('mustache');var util=require(_0x72a2('0x6'));var path=require(_0x72a2('0x7'));var sox=require(_0x72a2('0x8'));var csv=require(_0x72a2('0x9'));var ejs=require(_0x72a2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72a2('0xb'));var squel=require(_0x72a2('0xc'));var crypto=require(_0x72a2('0xd'));var jsforce=require(_0x72a2('0xe'));var deskjs=require(_0x72a2('0xf'));var toCsv=require(_0x72a2('0x9'));var querystring=require(_0x72a2('0x10'));var Papa=require(_0x72a2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x72a2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a2('0x13'));var logger=require('../../config/logger')(_0x72a2('0x14'));var utils=require(_0x72a2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x72a2('0x16'))['db'];function respondWithStatusCode(_0x5b8c5f,_0x4be3aa){_0x4be3aa=_0x4be3aa||0xcc;return function(_0x495b3a){if(_0x495b3a){return _0x5b8c5f[_0x72a2('0x17')](_0x4be3aa);}return _0x5b8c5f[_0x72a2('0x18')](_0x4be3aa)['end']();};}function respondWithResult(_0x202396,_0x421545){_0x421545=_0x421545||0xc8;return function(_0x198e74){if(_0x198e74){return _0x202396['status'](_0x421545)[_0x72a2('0x19')](_0x198e74);}};}function respondWithFilteredResult(_0x1ff8d8,_0x348e9a){return function(_0x6ef8fe){if(_0x6ef8fe){var _0x448b58=typeof _0x348e9a[_0x72a2('0x1a')]===_0x72a2('0x1b')&&typeof _0x348e9a['limit']===_0x72a2('0x1b');var _0x5e68aa=_0x6ef8fe[_0x72a2('0x1c')];var _0x12e3e7=_0x448b58?0x0:_0x348e9a[_0x72a2('0x1a')];var _0x49fc73=_0x448b58?_0x6ef8fe[_0x72a2('0x1c')]:_0x348e9a['offset']+_0x348e9a[_0x72a2('0x1d')];var _0xbcff17;if(_0x49fc73>=_0x5e68aa){_0x49fc73=_0x5e68aa;_0xbcff17=0xc8;}else{_0xbcff17=0xce;}_0x1ff8d8[_0x72a2('0x18')](_0xbcff17);return _0x1ff8d8[_0x72a2('0x1e')](_0x72a2('0x1f'),_0x12e3e7+'-'+_0x49fc73+'/'+_0x5e68aa)[_0x72a2('0x19')](_0x6ef8fe);}return null;};}function patchUpdates(_0x5dc20f){return function(_0x465716){try{jsonpatch[_0x72a2('0x20')](_0x465716,_0x5dc20f,!![]);}catch(_0x1e5f56){return BPromise[_0x72a2('0x21')](_0x1e5f56);}return _0x465716['save']();};}function saveUpdates(_0x11ec0a,_0x443a6a){return function(_0x1a1c85){if(_0x1a1c85){return _0x1a1c85['update'](_0x11ec0a)[_0x72a2('0x22')](function(_0x53c426){return _0x53c426;});}return null;};}function removeEntity(_0x27cf94,_0x50e50c){return function(_0x122b47){if(_0x122b47){return _0x122b47[_0x72a2('0x23')]()['then'](function(){var _0x33dd0e=_0x122b47[_0x72a2('0x24')]({'plain':!![]});var _0x184121='Variables';return db['UserProfileResource'][_0x72a2('0x23')]({'where':{'type':_0x184121,'resourceId':_0x33dd0e['id']}})[_0x72a2('0x22')](function(){return _0x122b47;});})[_0x72a2('0x22')](function(){_0x27cf94[_0x72a2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33a337,_0x23b45c){return function(_0x3c7ce7){if(!_0x3c7ce7){_0x33a337[_0x72a2('0x17')](0x194);}return _0x3c7ce7;};}function handleError(_0x3f721d,_0x2b75b9){_0x2b75b9=_0x2b75b9||0x1f4;return function(_0x4ae3e1){logger[_0x72a2('0x25')](_0x4ae3e1[_0x72a2('0x26')]);if(_0x4ae3e1['name']){delete _0x4ae3e1[_0x72a2('0x27')];}_0x3f721d[_0x72a2('0x18')](_0x2b75b9)['send'](_0x4ae3e1);};}exports[_0x72a2('0x28')]=function(_0x557739,_0x3f8cfb){var _0x1bd9e0={},_0x12d4ec={},_0xce5064={'count':0x0,'rows':[]};var _0x51f1bb=_[_0x72a2('0x29')](db[_0x72a2('0x2a')][_0x72a2('0x2b')],function(_0x1b7ef3){return{'name':_0x1b7ef3[_0x72a2('0x2c')],'type':_0x1b7ef3[_0x72a2('0x2d')][_0x72a2('0x2e')]};});_0x12d4ec['model']=_[_0x72a2('0x29')](_0x51f1bb,'name');_0x12d4ec[_0x72a2('0x2f')]=_[_0x72a2('0x30')](_0x557739[_0x72a2('0x2f')]);_0x12d4ec[_0x72a2('0x31')]=_[_0x72a2('0x32')](_0x12d4ec[_0x72a2('0x33')],_0x12d4ec['query']);_0x1bd9e0[_0x72a2('0x34')]=_[_0x72a2('0x32')](_0x12d4ec[_0x72a2('0x33')],qs[_0x72a2('0x35')](_0x557739['query'][_0x72a2('0x35')]));_0x1bd9e0[_0x72a2('0x34')]=_0x1bd9e0['attributes']['length']?_0x1bd9e0[_0x72a2('0x34')]:_0x12d4ec[_0x72a2('0x33')];if(!_0x557739[_0x72a2('0x2f')][_0x72a2('0x36')]('nolimit')){_0x1bd9e0[_0x72a2('0x1d')]=qs[_0x72a2('0x1d')](_0x557739[_0x72a2('0x2f')]['limit']);_0x1bd9e0['offset']=qs['offset'](_0x557739[_0x72a2('0x2f')][_0x72a2('0x1a')]);}_0x1bd9e0[_0x72a2('0x37')]=qs[_0x72a2('0x38')](_0x557739['query'][_0x72a2('0x38')]);_0x1bd9e0['where']=qs[_0x72a2('0x31')](_[_0x72a2('0x39')](_0x557739[_0x72a2('0x2f')],_0x12d4ec[_0x72a2('0x31')]),_0x51f1bb);if(_0x557739[_0x72a2('0x2f')][_0x72a2('0x3a')]){_0x1bd9e0['where']=_[_0x72a2('0x3b')](_0x1bd9e0['where'],{'$or':_[_0x72a2('0x29')](_0x51f1bb,function(_0x11e741){if(_0x11e741['type']!==_0x72a2('0x3c')){var _0x324898={};_0x324898[_0x11e741['name']]={'$like':'%'+_0x557739[_0x72a2('0x2f')][_0x72a2('0x3a')]+'%'};return _0x324898;}})});}_0x1bd9e0=_[_0x72a2('0x3b')]({},_0x1bd9e0,_0x557739[_0x72a2('0x3d')]);var _0x2976ca={'where':_0x1bd9e0['where']};return db[_0x72a2('0x2a')][_0x72a2('0x1c')](_0x2976ca)['then'](function(_0x5d596b){_0xce5064['count']=_0x5d596b;if(_0x557739[_0x72a2('0x2f')]['includeAll']){_0x1bd9e0['include']=[{'all':!![]}];}return db[_0x72a2('0x2a')]['findAll'](_0x1bd9e0);})[_0x72a2('0x22')](function(_0x5dbdb8){_0xce5064[_0x72a2('0x3e')]=_0x5dbdb8;return _0xce5064;})[_0x72a2('0x22')](respondWithFilteredResult(_0x3f8cfb,_0x1bd9e0))[_0x72a2('0x3f')](handleError(_0x3f8cfb,null));};exports['show']=function(_0x3ff42f,_0x43b2e8){var _0x2a3ce0={'raw':!![],'where':{'id':_0x3ff42f['params']['id']}},_0x5016b6={};_0x5016b6[_0x72a2('0x33')]=_[_0x72a2('0x30')](db[_0x72a2('0x2a')][_0x72a2('0x2b')]);_0x5016b6[_0x72a2('0x2f')]=_['keys'](_0x3ff42f[_0x72a2('0x2f')]);_0x5016b6[_0x72a2('0x31')]=_['intersection'](_0x5016b6[_0x72a2('0x33')],_0x5016b6['query']);_0x2a3ce0['attributes']=_[_0x72a2('0x32')](_0x5016b6[_0x72a2('0x33')],qs['fields'](_0x3ff42f[_0x72a2('0x2f')]['fields']));_0x2a3ce0[_0x72a2('0x34')]=_0x2a3ce0['attributes'][_0x72a2('0x40')]?_0x2a3ce0['attributes']:_0x5016b6[_0x72a2('0x33')];if(_0x3ff42f[_0x72a2('0x2f')][_0x72a2('0x41')]){_0x2a3ce0['include']=[{'all':!![]}];}_0x2a3ce0=_[_0x72a2('0x3b')]({},_0x2a3ce0,_0x3ff42f['options']);return db[_0x72a2('0x2a')][_0x72a2('0x42')](_0x2a3ce0)[_0x72a2('0x22')](handleEntityNotFound(_0x43b2e8,null))[_0x72a2('0x22')](respondWithResult(_0x43b2e8,null))[_0x72a2('0x3f')](handleError(_0x43b2e8,null));};exports[_0x72a2('0x43')]=function(_0x233237,_0x5c14de){return db[_0x72a2('0x2a')][_0x72a2('0x43')](_0x233237['body'],{})[_0x72a2('0x22')](function(_0x44a438){var _0x2fe744=_0x233237['user'][_0x72a2('0x24')]({'plain':!![]});if(!_0x2fe744)throw new Error(_0x72a2('0x44'));if(_0x2fe744[_0x72a2('0x45')]===_0x72a2('0x46')){var _0x48ebbf=_0x44a438[_0x72a2('0x24')]({'plain':!![]});var _0x2573b6='Variables';return db[_0x72a2('0x47')][_0x72a2('0x42')]({'where':{'name':_0x2573b6,'userProfileId':_0x2fe744['userProfileId']},'raw':!![]})['then'](function(_0x3f48b3){if(_0x3f48b3&&_0x3f48b3[_0x72a2('0x48')]===0x0){return db[_0x72a2('0x49')][_0x72a2('0x43')]({'name':_0x48ebbf[_0x72a2('0x27')],'resourceId':_0x48ebbf['id'],'type':_0x3f48b3['name'],'sectionId':_0x3f48b3['id']},{})['then'](function(){return _0x44a438;});}else{return _0x44a438;}})['catch'](function(_0x879127){logger[_0x72a2('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x879127);throw _0x879127;});}return _0x44a438;})[_0x72a2('0x22')](respondWithResult(_0x5c14de,0xc9))[_0x72a2('0x3f')](handleError(_0x5c14de,null));};exports[_0x72a2('0x4a')]=function(_0x49f109,_0x7833d6){if(_0x49f109[_0x72a2('0x4b')]['id']){delete _0x49f109['body']['id'];}return db['Variable'][_0x72a2('0x42')]({'where':{'id':_0x49f109[_0x72a2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x7833d6,null))[_0x72a2('0x22')](saveUpdates(_0x49f109[_0x72a2('0x4b')],null))[_0x72a2('0x22')](respondWithResult(_0x7833d6,null))['catch'](handleError(_0x7833d6,null));};exports['destroy']=function(_0x58170a,_0x5bb300){return db[_0x72a2('0x2a')][_0x72a2('0x42')]({'where':{'id':_0x58170a['params']['id']}})[_0x72a2('0x22')](handleEntityNotFound(_0x5bb300,null))[_0x72a2('0x22')](removeEntity(_0x5bb300,null))['catch'](handleError(_0x5bb300,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index d1fab1d..9ec614d 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 _0xed5c=['./variable.attributes','tools_variables','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x18a696,_0x264e3f){var _0x4fa7e3=function(_0x4844e3){while(--_0x4844e3){_0x18a696['push'](_0x18a696['shift']());}};_0x4fa7e3(++_0x264e3f);}(_0xed5c,0x119));var _0xced5=function(_0x2c3d53,_0x445f2e){_0x2c3d53=_0x2c3d53-0x0;var _0x9a5923=_0xed5c[_0x2c3d53];return _0x9a5923;};'use strict';var _=require(_0xced5('0x0'));var util=require(_0xced5('0x1'));var logger=require('../../config/logger')(_0xced5('0x2'));var moment=require(_0xced5('0x3'));var BPromise=require(_0xced5('0x4'));var rp=require(_0xced5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xced5('0x6'));var config=require('../../config/environment');var attributes=require(_0xced5('0x7'));module['exports']=function(_0x181300,_0x5d7767){return _0x181300['define']('Variable',attributes,{'tableName':_0xced5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd495=['path','rimraf','../../config/environment','./variable.attributes','define','Variable','lodash','util','api','bluebird','request-promise'];(function(_0x316b3e,_0x47b154){var _0x45ba95=function(_0x5e68c4){while(--_0x5e68c4){_0x316b3e['push'](_0x316b3e['shift']());}};_0x45ba95(++_0x47b154);}(_0xd495,0x1ea));var _0x5d49=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xd495[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x5d49('0x0'));var util=require(_0x5d49('0x1'));var logger=require('../../config/logger')(_0x5d49('0x2'));var moment=require('moment');var BPromise=require(_0x5d49('0x3'));var rp=require(_0x5d49('0x4'));var fs=require('fs');var path=require(_0x5d49('0x5'));var rimraf=require(_0x5d49('0x6'));var config=require(_0x5d49('0x7'));var attributes=require(_0x5d49('0x8'));module['exports']=function(_0x5b796a,_0x43e438){return _0x5b796a[_0x5d49('0x9')](_0x5d49('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 2e4398b..a4e2068 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 _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x4ef5ba,_0x6ff6df){var _0x1d0fce=function(_0x548722){while(--_0x548722){_0x4ef5ba['push'](_0x4ef5ba['shift']());}};_0x1d0fce(++_0x6ff6df);}(_0x7217,0x19e));var _0x7721=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x7217[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x1e0d9a,_0x214450){var _0x36cbe0=function(_0x4003b4){while(--_0x4003b4){_0x1e0d9a['push'](_0x1e0d9a['shift']());}};_0x36cbe0(++_0x214450);}(_0x55ca,0x126));var _0xa55c=function(_0x1466ba,_0x4cd93e){_0x1466ba=_0x1466ba-0x0;var _0x56a71b=_0x55ca[_0x1466ba];return _0x56a71b;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 7c56d9b..c2fbf81 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 _0x0c11=['migrations','exports','express','Router','get','index','isAuthenticated','canUpdate','fetch','/pull','pull','/restart','/migrations'];(function(_0x3050a5,_0x139466){var _0x284278=function(_0x14c2cc){while(--_0x14c2cc){_0x3050a5['push'](_0x3050a5['shift']());}};_0x284278(++_0x139466);}(_0x0c11,0x17b));var _0x10c1=function(_0x271537,_0x8b7b3b){_0x271537=_0x271537-0x0;var _0x19dc22=_0x0c11[_0x271537];return _0x19dc22;};'use strict';var express=require(_0x10c1('0x0'));var router=express[_0x10c1('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x10c1('0x2')]('/',controller[_0x10c1('0x3')]);router[_0x10c1('0x2')]('/fetch',auth[_0x10c1('0x4')](),auth[_0x10c1('0x5')](),controller[_0x10c1('0x6')]);router[_0x10c1('0x2')]('/reset',auth[_0x10c1('0x4')](),auth[_0x10c1('0x5')](),controller['reset']);router['get'](_0x10c1('0x7'),auth[_0x10c1('0x4')](),auth[_0x10c1('0x5')](),controller[_0x10c1('0x8')]);router[_0x10c1('0x2')](_0x10c1('0x9'),auth[_0x10c1('0x4')](),controller['restart']);router[_0x10c1('0x2')](_0x10c1('0xa'),controller[_0x10c1('0xb')]);module[_0x10c1('0xc')]=router; \ No newline at end of file +var _0xf6e6=['pull','/restart','restart','/migrations','exports','../../components/auth/service','get','index','/fetch','canUpdate','reset','/pull','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf6e6,0x1a5));var _0x6f6e=function(_0x2398c3,_0x408f7f){_0x2398c3=_0x2398c3-0x0;var _0x5bbe33=_0xf6e6[_0x2398c3];return _0x5bbe33;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x6f6e('0x0'));var controller=require('./version.controller');router[_0x6f6e('0x1')]('/',controller[_0x6f6e('0x2')]);router[_0x6f6e('0x1')](_0x6f6e('0x3'),auth['isAuthenticated'](),auth[_0x6f6e('0x4')](),controller['fetch']);router[_0x6f6e('0x1')]('/reset',auth['isAuthenticated'](),auth[_0x6f6e('0x4')](),controller[_0x6f6e('0x5')]);router['get'](_0x6f6e('0x6'),auth[_0x6f6e('0x7')](),auth[_0x6f6e('0x4')](),controller[_0x6f6e('0x8')]);router[_0x6f6e('0x1')](_0x6f6e('0x9'),auth[_0x6f6e('0x7')](),controller[_0x6f6e('0xa')]);router['get'](_0x6f6e('0xb'),controller['migrations']);module[_0x6f6e('0xc')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index afef23b..3895b61 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 _0x2ac3=['index','query','latest','fetch','exports','2.0.0','json','status','origin','master','error','info','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','server','length','replace','.js','push','sort','Migration','sequelize','constructor','join','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root'];(function(_0x51d71a,_0x596fda){var _0xff01f1=function(_0x30480f){while(--_0x30480f){_0x51d71a['push'](_0x51d71a['shift']());}};_0xff01f1(++_0x596fda);}(_0x2ac3,0x1ae));var _0x32ac=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2ac3[_0x2c91e9];return _0x13f0ff;};'use strict';var Umzug=require(_0x32ac('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x32ac('0x1'))(module,_0x32ac('0x2'));var compareVersions=require(_0x32ac('0x3'));var exec=require(_0x32ac('0x4'))['exec'];var db=require(_0x32ac('0x5'))['db'];var config=require(_0x32ac('0x6'));var pm2=require(_0x32ac('0x7'));var logger=require('../../config/logger')(_0x32ac('0x8'));var git=require(_0x32ac('0x9'))(config[_0x32ac('0xa')]);exports[_0x32ac('0xb')]=function(_0x7dd224,_0x2f2586){var _0x1fc063={'current':module['exports'][_0x32ac('0x2')],'phonebar':0x2};if(_0x7dd224[_0x32ac('0xc')]&&_0x7dd224[_0x32ac('0xc')][_0x32ac('0xd')]){return git[_0x32ac('0xe')]()['tags'](function(_0x2ab2b3,_0x42d396){_0x1fc063[_0x32ac('0xd')]=(_0x2ab2b3?module[_0x32ac('0xf')]['version']:_0x42d396[_0x32ac('0xd')])||_0x32ac('0x10');return _0x2f2586['status'](0xc8)[_0x32ac('0x11')](_0x1fc063);});}else{return _0x2f2586[_0x32ac('0x12')](0xc8)[_0x32ac('0x11')](_0x1fc063);}};exports[_0x32ac('0xe')]=function(_0x230121,_0xce16b3){return git[_0x32ac('0xe')]([_0x32ac('0x13'),_0x32ac('0x14')],function(_0xabe90){if(_0xabe90){logger[_0x32ac('0x15')](_0xabe90);return _0xce16b3['status'](0x1f4)['json'](_0xabe90);}logger[_0x32ac('0x16')](_0x32ac('0x17'));return _0xce16b3[_0x32ac('0x12')](0xc8)[_0x32ac('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x1870f9,_0x283638){return git[_0x32ac('0x18')](['--hard',_0x32ac('0x19')],function(_0x91887f){if(_0x91887f){logger['error'](_0x91887f);return _0x283638[_0x32ac('0x12')](0x1f4)[_0x32ac('0x11')](_0x91887f);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x283638[_0x32ac('0x12')](0xc8)[_0x32ac('0x11')]({'output':_0x32ac('0x1a')});});};exports[_0x32ac('0x1b')]=function(_0x23958f,_0x3ef259){exec('npm\x20install\x20--production',function(_0x4b8e5c,_0x272c9,_0x2cfb5c){logger[_0x32ac('0x16')](_0x272c9);logger[_0x32ac('0x16')](_0x2cfb5c);if(_0x4b8e5c){logger[_0x32ac('0x15')](_0x4b8e5c);return _0x3ef259['status'](0x1f4)[_0x32ac('0x11')](_0x4b8e5c);}return _0x3ef259['status'](0xc8)[_0x32ac('0x11')]({'output':_0x272c9});});};exports['restart']=function(_0x3717d9,_0x5ad424){return pm2[_0x32ac('0x1c')]('motion2')[_0x32ac('0x1d')](function(_0x1bca30){logger[_0x32ac('0x16')](_0x32ac('0x1e'),_0x1bca30);return _0x5ad424['status'](0xc8)[_0x32ac('0x11')]({'output':_0x32ac('0x1f')});})['catch'](function(_0x41d82b){logger[_0x32ac('0x15')](_0x41d82b);return _0x5ad424[_0x32ac('0x12')](0x1f4)[_0x32ac('0x11')](_0x41d82b);});};exports[_0x32ac('0x20')]=function(_0x5179a9,_0xf8cce1){var _0x21fd84=fs['readdirSync'](path['join'](config['root'],_0x32ac('0x21'),_0x32ac('0x20')));var _0x54b3b8=[];for(var _0x3b84ba=0x0;_0x3b84ba<_0x21fd84[_0x32ac('0x22')];_0x3b84ba++){var _0x45a7d0=_0x21fd84[_0x3b84ba][_0x32ac('0x23')](_0x32ac('0x24'),'');if(compareVersions(module['exports']['version'],_0x45a7d0)===-0x1){_0x54b3b8[_0x32ac('0x25')](_0x45a7d0);}}if(_0x54b3b8[_0x32ac('0x22')]){var _0x3c23c6=_0x54b3b8[_0x32ac('0x26')](compareVersions);var _0x188e4a=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x32ac('0x27')],'modelName':_0x32ac('0x27'),'columnName':_0x32ac('0x2')},'migrations':{'params':[db[_0x32ac('0x28')]['getQueryInterface'](),db[_0x32ac('0x28')][_0x32ac('0x29')],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[_0x32ac('0x2a')](config[_0x32ac('0xa')],'server',_0x32ac('0x20')),'pattern':/\.js$/}});_0x188e4a['up']({'migrations':_['map'](_0x3c23c6,function(_0x3d4f70){return _0x3d4f70+_0x32ac('0x24');})})[_0x32ac('0x1d')](function(){return _0xf8cce1['status'](0xc8)[_0x32ac('0x11')]({'output':_0x32ac('0x2b')+module[_0x32ac('0xf')]['version']+_0x32ac('0x2c')+_[_0x32ac('0x2d')](_0x3c23c6),'migrations':_[_0x32ac('0x2a')](_0x3c23c6)});})[_0x32ac('0x2e')](function(_0x2ba10e){if(_0x2ba10e instanceof db['sequelize'][_0x32ac('0x2f')]){return _0xf8cce1[_0x32ac('0x12')](0xc8)['json']({'output':_0x32ac('0x30')});}else{return _0xf8cce1[_0x32ac('0x12')](0x1f4)[_0x32ac('0x11')](_0x2ba10e);}});}else{return _0xf8cce1[_0x32ac('0x12')](0xc8)['json']({'output':_0x32ac('0x30')});}}; \ No newline at end of file +var _0xe467=['git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','info','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','../../mysqldb','../../config/pm2','../../config/logger','update','root','index','query','latest','fetch','tags','exports','2.0.0','status','json','error'];(function(_0x43d701,_0x4bb2e9){var _0x2ec4c6=function(_0x4d9765){while(--_0x4d9765){_0x43d701['push'](_0x43d701['shift']());}};_0x2ec4c6(++_0x4bb2e9);}(_0xe467,0xbb));var _0x7e46=function(_0x1a3917,_0x4f02ea){_0x1a3917=_0x1a3917-0x0;var _0x49172a=_0xe467[_0x1a3917];return _0x49172a;};'use strict';var Umzug=require(_0x7e46('0x0'));var path=require(_0x7e46('0x1'));var fs=require('fs');var _=require(_0x7e46('0x2'));var pkginfo=require(_0x7e46('0x3'))(module,_0x7e46('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x7e46('0x5'))['exec'];var db=require(_0x7e46('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x7e46('0x7'));var logger=require(_0x7e46('0x8'))(_0x7e46('0x9'));var git=require('simple-git')(config[_0x7e46('0xa')]);exports[_0x7e46('0xb')]=function(_0x9d48fe,_0x24a6ca){var _0x50db0d={'current':module['exports'][_0x7e46('0x4')],'phonebar':0x2};if(_0x9d48fe[_0x7e46('0xc')]&&_0x9d48fe[_0x7e46('0xc')][_0x7e46('0xd')]){return git[_0x7e46('0xe')]()[_0x7e46('0xf')](function(_0x5ee0bf,_0x2de8db){_0x50db0d[_0x7e46('0xd')]=(_0x5ee0bf?module[_0x7e46('0x10')][_0x7e46('0x4')]:_0x2de8db[_0x7e46('0xd')])||_0x7e46('0x11');return _0x24a6ca[_0x7e46('0x12')](0xc8)[_0x7e46('0x13')](_0x50db0d);});}else{return _0x24a6ca['status'](0xc8)[_0x7e46('0x13')](_0x50db0d);}};exports[_0x7e46('0xe')]=function(_0x1e9be2,_0x56af97){return git[_0x7e46('0xe')](['origin','master'],function(_0x159c01){if(_0x159c01){logger[_0x7e46('0x14')](_0x159c01);return _0x56af97[_0x7e46('0x12')](0x1f4)[_0x7e46('0x13')](_0x159c01);}logger['info'](_0x7e46('0x15'));return _0x56af97[_0x7e46('0x12')](0xc8)[_0x7e46('0x13')]({'output':_0x7e46('0x16')});});};exports[_0x7e46('0x17')]=function(_0x2ea10d,_0x5d8276){return git['reset']([_0x7e46('0x18'),'FETCH_HEAD'],function(_0x314d56){if(_0x314d56){logger[_0x7e46('0x14')](_0x314d56);return _0x5d8276['status'](0x1f4)[_0x7e46('0x13')](_0x314d56);}logger[_0x7e46('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5d8276['status'](0xc8)[_0x7e46('0x13')]({'output':_0x7e46('0x1a')});});};exports[_0x7e46('0x1b')]=function(_0x88f480,_0x234de7){exec(_0x7e46('0x1c'),function(_0x11d6bf,_0x5948ae,_0xaae5aa){logger['info'](_0x5948ae);logger['info'](_0xaae5aa);if(_0x11d6bf){logger[_0x7e46('0x14')](_0x11d6bf);return _0x234de7['status'](0x1f4)[_0x7e46('0x13')](_0x11d6bf);}return _0x234de7[_0x7e46('0x12')](0xc8)['json']({'output':_0x5948ae});});};exports[_0x7e46('0x1d')]=function(_0x24e24e,_0x25a84a){return pm2[_0x7e46('0x1d')](_0x7e46('0x1e'))['then'](function(_0xd37743){logger[_0x7e46('0x19')]('pm2\x20restart\x20motion\x20%s',_0xd37743);return _0x25a84a['status'](0xc8)['json']({'output':_0x7e46('0x1f')});})[_0x7e46('0x20')](function(_0x397c26){logger['error'](_0x397c26);return _0x25a84a[_0x7e46('0x12')](0x1f4)['json'](_0x397c26);});};exports['migrations']=function(_0xddc9f4,_0x55334f){var _0x48e01c=fs[_0x7e46('0x21')](path[_0x7e46('0x22')](config[_0x7e46('0xa')],_0x7e46('0x23'),_0x7e46('0x24')));var _0x47161f=[];for(var _0x53295f=0x0;_0x53295f<_0x48e01c[_0x7e46('0x25')];_0x53295f++){var _0x3b8768=_0x48e01c[_0x53295f][_0x7e46('0x26')](_0x7e46('0x27'),'');if(compareVersions(module['exports'][_0x7e46('0x4')],_0x3b8768)===-0x1){_0x47161f[_0x7e46('0x28')](_0x3b8768);}}if(_0x47161f[_0x7e46('0x25')]){var _0x3061d0=_0x47161f[_0x7e46('0x29')](compareVersions);var _0x375947=new Umzug({'storage':_0x7e46('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':_0x7e46('0x2b'),'columnName':_0x7e46('0x4')},'migrations':{'params':[db[_0x7e46('0x2a')][_0x7e46('0x2c')](),db['sequelize'][_0x7e46('0x2d')],function(){throw new Error(_0x7e46('0x2e'));}],'path':path[_0x7e46('0x22')](config[_0x7e46('0xa')],_0x7e46('0x23'),_0x7e46('0x24')),'pattern':/\.js$/}});_0x375947['up']({'migrations':_[_0x7e46('0x2f')](_0x3061d0,function(_0x579f7a){return _0x579f7a+_0x7e46('0x27');})})[_0x7e46('0x30')](function(){return _0x55334f['status'](0xc8)[_0x7e46('0x13')]({'output':_0x7e46('0x31')+module[_0x7e46('0x10')]['version']+'\x20to\x20'+_[_0x7e46('0x32')](_0x3061d0),'migrations':_[_0x7e46('0x22')](_0x3061d0)});})[_0x7e46('0x20')](function(_0x289155){if(_0x289155 instanceof db[_0x7e46('0x2a')]['UniqueConstraintError']){return _0x55334f[_0x7e46('0x12')](0xc8)[_0x7e46('0x13')]({'output':_0x7e46('0x33')});}else{return _0x55334f['status'](0x1f4)[_0x7e46('0x13')](_0x289155);}});}else{return _0x55334f[_0x7e46('0x12')](0xc8)[_0x7e46('0x13')]({'output':_0x7e46('0x33')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 839bc48..ab3a90a 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 _0xdaff=['get','index','/describe','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','connect-timeout','express','Router','../../config/environment','./voiceAgentReport.controller'];(function(_0x2bc077,_0x7c29da){var _0x3f571a=function(_0x567e39){while(--_0x567e39){_0x2bc077['push'](_0x2bc077['shift']());}};_0x3f571a(++_0x7c29da);}(_0xdaff,0xa5));var _0xfdaf=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdaff[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfdaf('0x0'));var express=require(_0xfdaf('0x1'));var router=express[_0xfdaf('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfdaf('0x3'));var controller=require(_0xfdaf('0x4'));router[_0xfdaf('0x5')]('/',auth['isAuthenticated'](),controller[_0xfdaf('0x6')]);router[_0xfdaf('0x5')](_0xfdaf('0x7'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfdaf('0x8'),auth[_0xfdaf('0x9')](),controller[_0xfdaf('0xa')]);router[_0xfdaf('0xb')]('/',auth[_0xfdaf('0x9')](),controller[_0xfdaf('0xc')]);router[_0xfdaf('0xd')](_0xfdaf('0x8'),auth['isAuthenticated'](),controller[_0xfdaf('0xe')]);router['delete'](_0xfdaf('0x8'),auth['isAuthenticated'](),controller[_0xfdaf('0xf')]);module[_0xfdaf('0x10')]=router; \ No newline at end of file +var _0x9fc4=['util','connect-timeout','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x9fc4,0xba));var _0x49fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fc4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x49fc('0x0'));var util=require(_0x49fc('0x1'));var path=require('path');var timeout=require(_0x49fc('0x2'));var express=require('express');var router=express[_0x49fc('0x3')]();var fs_extra=require(_0x49fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x49fc('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x49fc('0x6')]('/',auth[_0x49fc('0x7')](),controller['index']);router[_0x49fc('0x6')]('/describe',auth[_0x49fc('0x7')](),controller[_0x49fc('0x8')]);router[_0x49fc('0x6')](_0x49fc('0x9'),auth[_0x49fc('0x7')](),controller[_0x49fc('0xa')]);router['post']('/',auth[_0x49fc('0x7')](),controller[_0x49fc('0xb')]);router[_0x49fc('0xc')](_0x49fc('0x9'),auth['isAuthenticated'](),controller[_0x49fc('0xd')]);router[_0x49fc('0xe')](_0x49fc('0x9'),auth['isAuthenticated'](),controller[_0x49fc('0xf')]);module[_0x49fc('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 064f6b6..56bf55c 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 _0xd0e4=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x43cd9f,_0x57d758){var _0x5cf244=function(_0xb0bd94){while(--_0xb0bd94){_0x43cd9f['push'](_0x43cd9f['shift']());}};_0x5cf244(++_0x57d758);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0xc34e78,_0x19638f){_0xc34e78=_0xc34e78-0x0;var _0x205de5=_0xd0e4[_0xc34e78];return _0x205de5;};'use strict';var Sequelize=require(_0x4d0e('0x0'));module[_0x4d0e('0x1')]={'type':{'type':Sequelize[_0x4d0e('0x2')]},'uniqueid':{'type':Sequelize[_0x4d0e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4d0e('0x2')]},'interface':{'type':Sequelize[_0x4d0e('0x2')]},'membername':{'type':Sequelize[_0x4d0e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4d0e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4d0e('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4d0e('0x4')]},'agentcomplete':{'type':Sequelize[_0x4d0e('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4d0e('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4d0e('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4d0e('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4d0e('0x2')]},'channelstate':{'type':Sequelize[_0x4d0e('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4d0e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4d0e('0x2')]},'language':{'type':Sequelize[_0x4d0e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4d0e('0x2')]},'priority':{'type':Sequelize[_0x4d0e('0x2')]},'destchannel':{'type':Sequelize[_0x4d0e('0x2')]},'destchannelstate':{'type':Sequelize[_0x4d0e('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4d0e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4d0e('0x2')]},'destcalleridname':{'type':Sequelize[_0x4d0e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x4d0e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4d0e('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4d0e('0x2')]},'destcontext':{'type':Sequelize[_0x4d0e('0x2')]},'destexten':{'type':Sequelize[_0x4d0e('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4d0e('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x4d0e('0x2')]},'transfer':{'type':Sequelize[_0x4d0e('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4d0e('0x2')],'comment':_0x4d0e('0x6')},'transferexten':{'type':Sequelize[_0x4d0e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4d0e('0x2')]},'agententerreason':{'type':Sequelize[_0x4d0e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x68a5=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1500e6,_0x3886cf){var _0x30ea8a=function(_0x1098c1){while(--_0x1098c1){_0x1500e6['push'](_0x1500e6['shift']());}};_0x30ea8a(++_0x3886cf);}(_0x68a5,0xfc));var _0x568a=function(_0x2713a1,_0x3cc8de){_0x2713a1=_0x2713a1-0x0;var _0x5bd7a5=_0x68a5[_0x2713a1];return _0x5bd7a5;};'use strict';var Sequelize=require(_0x568a('0x0'));module['exports']={'type':{'type':Sequelize[_0x568a('0x1')]},'uniqueid':{'type':Sequelize[_0x568a('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x568a('0x1')]},'queue':{'type':Sequelize[_0x568a('0x1')]},'interface':{'type':Sequelize[_0x568a('0x1')]},'membername':{'type':Sequelize[_0x568a('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x568a('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x568a('0x2')]},'agentdumpAt':{'type':Sequelize[_0x568a('0x2')]},'holdtime':{'type':Sequelize[_0x568a('0x3')]},'agentcomplete':{'type':Sequelize[_0x568a('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x568a('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x568a('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x568a('0x3')]},'reason':{'type':Sequelize[_0x568a('0x1')]},'lastevent':{'type':Sequelize[_0x568a('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x568a('0x1')]},'connectedlinenum':{'type':Sequelize[_0x568a('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x568a('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x568a('0x1')]},'exten':{'type':Sequelize[_0x568a('0x1')]},'priority':{'type':Sequelize[_0x568a('0x1')]},'destchannel':{'type':Sequelize[_0x568a('0x1')]},'destchannelstate':{'type':Sequelize[_0x568a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x568a('0x1')]},'destcalleridnum':{'type':Sequelize[_0x568a('0x1')]},'destcalleridname':{'type':Sequelize[_0x568a('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x568a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x568a('0x1')]},'destlanguage':{'type':Sequelize[_0x568a('0x1')]},'destaccountcode':{'type':Sequelize[_0x568a('0x1')]},'destcontext':{'type':Sequelize[_0x568a('0x1')]},'destexten':{'type':Sequelize[_0x568a('0x1')]},'destpriority':{'type':Sequelize[_0x568a('0x1')]},'destuniqueid':{'type':Sequelize[_0x568a('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x568a('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x568a('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x568a('0x5')},'transferexten':{'type':Sequelize[_0x568a('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x568a('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index f63d2b9..c194093 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 a4715ac..c94724c 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 _0x1dcc=['path','rimraf','../../config/environment','define','report_agent','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x5d0820,_0x469505){_0x5d0820=_0x5d0820-0x0;var _0x39d722=_0x1dcc[_0x5d0820];return _0x39d722;};'use strict';var _=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var logger=require(_0xc1dc('0x2'))(_0xc1dc('0x3'));var moment=require('moment');var BPromise=require(_0xc1dc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1dc('0x5'));var rimraf=require(_0xc1dc('0x6'));var config=require(_0xc1dc('0x7'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x1e57ba,_0x381ab6){return _0x1e57ba[_0xc1dc('0x8')]('VoiceAgentReport',attributes,{'tableName':_0xc1dc('0x9'),'paranoid':![],'indexes':[{'fields':[_0xc1dc('0xa'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2975=['moment','bluebird','request-promise','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','util','../../config/logger','api'];(function(_0x1c189b,_0x3efdda){var _0x540701=function(_0x5c6b52){while(--_0x5c6b52){_0x1c189b['push'](_0x1c189b['shift']());}};_0x540701(++_0x3efdda);}(_0x2975,0x1c5));var _0x5297=function(_0x57ee10,_0x99fdef){_0x57ee10=_0x57ee10-0x0;var _0x20a2b6=_0x2975[_0x57ee10];return _0x20a2b6;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var logger=require(_0x5297('0x1'))(_0x5297('0x2'));var moment=require(_0x5297('0x3'));var BPromise=require(_0x5297('0x4'));var rp=require(_0x5297('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5297('0x6'));module[_0x5297('0x7')]=function(_0x11a43d,_0x3da9c6){return _0x11a43d[_0x5297('0x8')](_0x5297('0x9'),attributes,{'tableName':_0x5297('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x5297('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 5626f03..3ca078e 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 _0x1242=['catch','CreateVoiceAgentReport','create','body','options','raw','where','attributes','UpdateVoiceAgentReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0x1242,0x1ad));var _0x2124=function(_0x189d77,_0x16f056){_0x189d77=_0x189d77-0x0;var _0x4794b9=_0x1242[_0x189d77];return _0x4794b9;};'use strict';var _=require(_0x2124('0x0'));var util=require(_0x2124('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2124('0x2'));var fs=require('fs');var Redis=require(_0x2124('0x3'));var db=require(_0x2124('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2124('0x5'))(_0x2124('0x6'));var config=require('../../config/environment');var jayson=require(_0x2124('0x7'));var client=jayson[_0x2124('0x8')][_0x2124('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52eaf2,_0x11113a,_0x1ce99f){return new BPromise(function(_0x580bb7,_0x7ad2ce){return client[_0x2124('0xa')](_0x52eaf2,_0x1ce99f)[_0x2124('0xb')](function(_0x2b9de4){logger[_0x2124('0xc')](_0x2124('0xd'),_0x11113a,_0x2124('0xe'));logger[_0x2124('0xf')](_0x2124('0x10'),_0x11113a,_0x2124('0xe'),JSON[_0x2124('0x11')](_0x2b9de4));if(_0x2b9de4[_0x2124('0x12')]){if(_0x2b9de4['error']['code']===0x1f4){logger[_0x2124('0x12')](_0x2124('0xd'),_0x11113a,_0x2b9de4[_0x2124('0x12')][_0x2124('0x13')]);return _0x7ad2ce(_0x2b9de4[_0x2124('0x12')][_0x2124('0x13')]);}logger['error'](_0x2124('0xd'),_0x11113a,_0x2b9de4[_0x2124('0x12')][_0x2124('0x13')]);return _0x580bb7(_0x2b9de4[_0x2124('0x12')][_0x2124('0x13')]);}else{logger[_0x2124('0xc')](_0x2124('0xd'),_0x11113a,_0x2124('0xe'));_0x580bb7(_0x2b9de4[_0x2124('0x14')][_0x2124('0x13')]);}})[_0x2124('0x15')](function(_0x35e207){logger[_0x2124('0x12')](_0x2124('0xd'),_0x11113a,_0x35e207);_0x7ad2ce(_0x35e207);});});}exports[_0x2124('0x16')]=function(_0x792820){var _0x305f90=this;return new Promise(function(_0x2e358e,_0x6bfbd){return db['VoiceAgentReport'][_0x2124('0x17')](_0x792820[_0x2124('0x18')],{'raw':_0x792820[_0x2124('0x19')]?_0x792820[_0x2124('0x19')][_0x2124('0x1a')]===undefined?!![]:![]:!![]})[_0x2124('0xb')](function(_0x4ddd2c){logger[_0x2124('0xc')]('CreateVoiceAgentReport',_0x792820);logger[_0x2124('0xf')](_0x2124('0x16'),_0x792820,JSON[_0x2124('0x11')](_0x4ddd2c));_0x2e358e(_0x4ddd2c);})[_0x2124('0x15')](function(_0x4b3718){logger[_0x2124('0x12')](_0x2124('0x16'),_0x4b3718[_0x2124('0x13')],_0x792820);_0x6bfbd(_0x305f90['error'](0x1f4,_0x4b3718['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x5ccb45){var _0x3c32ed=this;return new Promise(function(_0x2cb147,_0x5ecf0f){return db['VoiceAgentReport']['update'](_0x5ccb45[_0x2124('0x18')],{'raw':_0x5ccb45[_0x2124('0x19')]?_0x5ccb45[_0x2124('0x19')][_0x2124('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ccb45[_0x2124('0x19')]?_0x5ccb45[_0x2124('0x19')][_0x2124('0x1b')]||null:null,'attributes':_0x5ccb45['options']?_0x5ccb45[_0x2124('0x19')][_0x2124('0x1c')]||null:null,'limit':_0x5ccb45[_0x2124('0x19')]?_0x5ccb45[_0x2124('0x19')]['limit']||null:null})[_0x2124('0xb')](function(_0xecc483){logger['info'](_0x2124('0x1d'),_0x5ccb45);logger[_0x2124('0xf')](_0x2124('0x1d'),_0x5ccb45,JSON[_0x2124('0x11')](_0xecc483));_0x2cb147(_0xecc483);})[_0x2124('0x15')](function(_0xc73845){logger[_0x2124('0x12')]('UpdateVoiceAgentReport',_0xc73845['message'],_0x5ccb45);_0x5ecf0f(_0x3c32ed[_0x2124('0x12')](0x1f4,_0xc73845[_0x2124('0x13')]));});});}; \ No newline at end of file +var _0xf76d=['error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x26ba02,_0x105fb2){var _0x1fe287=function(_0x42f917){while(--_0x42f917){_0x26ba02['push'](_0x26ba02['shift']());}};_0x1fe287(++_0x105fb2);}(_0xf76d,0x19c));var _0xdf76=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0xf76d[_0x2dea58];return _0x2b23c2;};'use strict';var _=require('lodash');var util=require(_0xdf76('0x0'));var moment=require(_0xdf76('0x1'));var BPromise=require(_0xdf76('0x2'));var rs=require(_0xdf76('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf76('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf76('0x5'))('rpc');var config=require(_0xdf76('0x6'));var jayson=require(_0xdf76('0x7'));var client=jayson['client'][_0xdf76('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3da840,_0x5320df,_0x4bebca){return new BPromise(function(_0x25635f,_0x23464a){return client[_0xdf76('0x9')](_0x3da840,_0x4bebca)[_0xdf76('0xa')](function(_0x11abd4){logger[_0xdf76('0xb')](_0xdf76('0xc'),_0x5320df,_0xdf76('0xd'));logger[_0xdf76('0xe')](_0xdf76('0xf'),_0x5320df,_0xdf76('0xd'),JSON[_0xdf76('0x10')](_0x11abd4));if(_0x11abd4[_0xdf76('0x11')]){if(_0x11abd4['error'][_0xdf76('0x12')]===0x1f4){logger[_0xdf76('0x11')](_0xdf76('0xc'),_0x5320df,_0x11abd4[_0xdf76('0x11')][_0xdf76('0x13')]);return _0x23464a(_0x11abd4['error']['message']);}logger['error'](_0xdf76('0xc'),_0x5320df,_0x11abd4[_0xdf76('0x11')][_0xdf76('0x13')]);return _0x25635f(_0x11abd4[_0xdf76('0x11')][_0xdf76('0x13')]);}else{logger[_0xdf76('0xb')](_0xdf76('0xc'),_0x5320df,'request\x20sent');_0x25635f(_0x11abd4[_0xdf76('0x14')]['message']);}})[_0xdf76('0x15')](function(_0x1b6a73){logger[_0xdf76('0x11')](_0xdf76('0xc'),_0x5320df,_0x1b6a73);_0x23464a(_0x1b6a73);});});}exports[_0xdf76('0x16')]=function(_0x14a88c){var _0x2d5984=this;return new Promise(function(_0x2e71a5,_0x51d42e){return db[_0xdf76('0x17')][_0xdf76('0x18')](_0x14a88c[_0xdf76('0x19')],{'raw':_0x14a88c[_0xdf76('0x1a')]?_0x14a88c['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0xb9a887){logger[_0xdf76('0xb')](_0xdf76('0x16'),_0x14a88c);logger['debug'](_0xdf76('0x16'),_0x14a88c,JSON[_0xdf76('0x10')](_0xb9a887));_0x2e71a5(_0xb9a887);})[_0xdf76('0x15')](function(_0x98acc6){logger[_0xdf76('0x11')](_0xdf76('0x16'),_0x98acc6[_0xdf76('0x13')],_0x14a88c);_0x51d42e(_0x2d5984[_0xdf76('0x11')](0x1f4,_0x98acc6['message']));});});};exports[_0xdf76('0x1b')]=function(_0x257f6f){var _0x536634=this;return new Promise(function(_0x5da5b9,_0x4dec3e){return db[_0xdf76('0x17')][_0xdf76('0x1c')](_0x257f6f[_0xdf76('0x19')],{'raw':_0x257f6f[_0xdf76('0x1a')]?_0x257f6f[_0xdf76('0x1a')][_0xdf76('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x257f6f['options']?_0x257f6f['options'][_0xdf76('0x1e')]||null:null,'attributes':_0x257f6f[_0xdf76('0x1a')]?_0x257f6f[_0xdf76('0x1a')][_0xdf76('0x1f')]||null:null,'limit':_0x257f6f[_0xdf76('0x1a')]?_0x257f6f[_0xdf76('0x1a')][_0xdf76('0x20')]||null:null})[_0xdf76('0xa')](function(_0x378e39){logger[_0xdf76('0xb')]('UpdateVoiceAgentReport',_0x257f6f);logger[_0xdf76('0xe')](_0xdf76('0x1b'),_0x257f6f,JSON[_0xdf76('0x10')](_0x378e39));_0x5da5b9(_0x378e39);})[_0xdf76('0x15')](function(_0x4796f9){logger[_0xdf76('0x11')](_0xdf76('0x1b'),_0x4796f9[_0xdf76('0x13')],_0x257f6f);_0x4dec3e(_0x536634[_0xdf76('0x11')](0x1f4,_0x4796f9[_0xdf76('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 7cc37cd..f4c13f7 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 _0x0c02=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','show','post','delete','destroy','util','path','express','Router'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x20c0('0x0'));var path=require(_0x20c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x20c0('0x2'));var router=express[_0x20c0('0x3')]();var fs_extra=require(_0x20c0('0x4'));var auth=require(_0x20c0('0x5'));var interaction=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var controller=require(_0x20c0('0x8'));router[_0x20c0('0x9')]('/',auth[_0x20c0('0xa')](),controller[_0x20c0('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x20c0('0x9')](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0xd')]);router[_0x20c0('0xe')]('/',auth[_0x20c0('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x20c0('0xf')](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5075=['get','isAuthenticated','describe','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','index'];(function(_0x41f888,_0x4a2006){var _0x3e35d0=function(_0x1c2a2a){while(--_0x1c2a2a){_0x41f888['push'](_0x41f888['shift']());}};_0x3e35d0(++_0x4a2006);}(_0x5075,0x73));var _0x5507=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x5075[_0x3daa8c];return _0x2b1bd7;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5507('0xa')]);router[_0x5507('0xb')]('/describe',auth[_0x5507('0xc')](),controller[_0x5507('0xd')]);router[_0x5507('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')]('/',auth[_0x5507('0xc')](),controller[_0x5507('0x10')]);router['put'](_0x5507('0x11'),auth[_0x5507('0xc')](),controller['update']);router[_0x5507('0x12')](_0x5507('0x11'),auth['isAuthenticated'](),controller[_0x5507('0x13')]);module[_0x5507('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 83579e5..0c23e0e 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 _0x2ec8=['DATE','INTEGER','sequelize','exports','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT'];(function(_0x21dcc8,_0x39361d){var _0x29640a=function(_0x5a2869){while(--_0x5a2869){_0x21dcc8['push'](_0x21dcc8['shift']());}};_0x29640a(++_0x39361d);}(_0x2ec8,0x6e));var _0x82ec=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2ec8[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x82ec('0x0'));module[_0x82ec('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x82ec('0x2'),_0x82ec('0x3'),_0x82ec('0x4'),_0x82ec('0x5'),_0x82ec('0x6'),_0x82ec('0x7'))},'tag':{'type':Sequelize[_0x82ec('0x8')]},'accountcode':{'type':Sequelize[_0x82ec('0x8')]},'source':{'type':Sequelize[_0x82ec('0x8')]},'destination':{'type':Sequelize[_0x82ec('0x8')]},'destinationcontext':{'type':Sequelize[_0x82ec('0x8')]},'callerid':{'type':Sequelize[_0x82ec('0x8')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x82ec('0x8')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x82ec('0x9')]},'starttime':{'type':Sequelize[_0x82ec('0xa')]},'systemanswertime':{'type':Sequelize[_0x82ec('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x82ec('0xa')]},'duration':{'type':Sequelize[_0x82ec('0xb')]},'billableseconds':{'type':Sequelize[_0x82ec('0xb')]},'mohtime':{'type':Sequelize[_0x82ec('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x82ec('0x8')]},'amaflags':{'type':Sequelize[_0x82ec('0x8')]},'userfield':{'type':Sequelize[_0x82ec('0x8')]},'userDisposition':{'type':Sequelize[_0x82ec('0x8')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x82ec('0x8')]},'note':{'type':Sequelize[_0x82ec('0x8')]},'prefix':{'type':Sequelize[_0x82ec('0x8')]},'routeid':{'type':Sequelize[_0x82ec('0xb')]},'sipcallid':{'type':Sequelize[_0x82ec('0x8')]}}; \ No newline at end of file +var _0x299e=['STRING','ENUM','outbound','inbound-fax','TEXT','DATE','INTEGER','exports'];(function(_0x58b30b,_0x13d8bc){var _0x5dcd1c=function(_0x26f982){while(--_0x26f982){_0x58b30b['push'](_0x58b30b['shift']());}};_0x5dcd1c(++_0x13d8bc);}(_0x299e,0x1e7));var _0xe299=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x299e[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require('sequelize');module[_0xe299('0x0')]={'uniqueid':{'type':Sequelize[_0xe299('0x1')]},'type':{'type':Sequelize[_0xe299('0x2')]('inbound','internal',_0xe299('0x3'),_0xe299('0x4'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0xe299('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xe299('0x1')]},'destination':{'type':Sequelize[_0xe299('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe299('0x1')]},'channel':{'type':Sequelize[_0xe299('0x1')]},'destinationchannel':{'type':Sequelize[_0xe299('0x1')]},'lastapplication':{'type':Sequelize[_0xe299('0x1')]},'lastdata':{'type':Sequelize[_0xe299('0x5')]},'starttime':{'type':Sequelize[_0xe299('0x6')]},'systemanswertime':{'type':Sequelize[_0xe299('0x6')]},'answertime':{'type':Sequelize[_0xe299('0x6')]},'endtime':{'type':Sequelize[_0xe299('0x6')]},'duration':{'type':Sequelize[_0xe299('0x7')]},'billableseconds':{'type':Sequelize[_0xe299('0x7')]},'mohtime':{'type':Sequelize[_0xe299('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xe299('0x1')]},'userfield':{'type':Sequelize[_0xe299('0x1')]},'userDisposition':{'type':Sequelize[_0xe299('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xe299('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xe299('0x1')]},'note':{'type':Sequelize[_0xe299('0x1')]},'prefix':{'type':Sequelize[_0xe299('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 0340d66..60c5c3d 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x55d070,_0x2823bb){var _0x1b6971=function(_0xcf56cf){while(--_0xcf56cf){_0x55d070['push'](_0x55d070['shift']());}};_0x1b6971(++_0x2823bb);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12877b,_0x8650cf){_0x12877b=_0x12877b-0x0;var _0x3549ff=_0x0b0e[_0x12877b];return _0x3549ff;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x4afc4e,_0x40d88e){_0x4afc4e=_0x4afc4e-0x0;var _0x590a50=_0x2032[_0x4afc4e];return _0x590a50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 8a1d2e8..c30771a 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 _0xb821=['report_call','uniqueid','util','../../config/logger','bluebird','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x32df8b,_0x252171){var _0x229e54=function(_0xa383f3){while(--_0xa383f3){_0x32df8b['push'](_0x32df8b['shift']());}};_0x229e54(++_0x252171);}(_0xb821,0xa7));var _0x1b82=function(_0x5edc06,_0x8abf9f){_0x5edc06=_0x5edc06-0x0;var _0x15ba4a=_0xb821[_0x5edc06];return _0x15ba4a;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1b82('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda6d=['exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./voiceCallReport.attributes'];(function(_0x2be13a,_0x580f9e){var _0x5ef970=function(_0x33797b){while(--_0x33797b){_0x2be13a['push'](_0x2be13a['shift']());}};_0x5ef970(++_0x580f9e);}(_0xda6d,0x1e6));var _0xdda6=function(_0x7fd148,_0x3ffe1c){_0x7fd148=_0x7fd148-0x0;var _0x574f17=_0xda6d[_0x7fd148];return _0x574f17;};'use strict';var _=require(_0xdda6('0x0'));var util=require(_0xdda6('0x1'));var logger=require(_0xdda6('0x2'))(_0xdda6('0x3'));var moment=require(_0xdda6('0x4'));var BPromise=require(_0xdda6('0x5'));var rp=require(_0xdda6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdda6('0x7'));module[_0xdda6('0x8')]=function(_0x5b759b,_0xe8a6c5){return _0x5b759b[_0xdda6('0x9')](_0xdda6('0xa'),attributes,{'tableName':_0xdda6('0xb'),'paranoid':![],'indexes':[{'fields':[_0xdda6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index dccd45f..1075a6b 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 _0xa702=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','include','map','model','attributes','debug','CreateVoiceCallReport','body','UpdateVoiceCallReport','update','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c8a16,_0x5d35d6){var _0x4145d2=function(_0x146563){while(--_0x146563){_0x2c8a16['push'](_0x2c8a16['shift']());}};_0x4145d2(++_0x5d35d6);}(_0xa702,0x97));var _0x2a70=function(_0x270548,_0x21756b){_0x270548=_0x270548-0x0;var _0x481c43=_0xa702[_0x270548];return _0x481c43;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2a70('0x0'));var BPromise=require(_0x2a70('0x1'));var rs=require(_0x2a70('0x2'));var fs=require('fs');var Redis=require(_0x2a70('0x3'));var db=require(_0x2a70('0x4'))['db'];var utils=require(_0x2a70('0x5'));var logger=require(_0x2a70('0x6'))(_0x2a70('0x7'));var config=require(_0x2a70('0x8'));var jayson=require(_0x2a70('0x9'));var client=jayson[_0x2a70('0xa')][_0x2a70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12c144,_0x4c54ee,_0x5809ea){return new BPromise(function(_0x3fcf82,_0x3b235c){return client[_0x2a70('0xc')](_0x12c144,_0x5809ea)[_0x2a70('0xd')](function(_0x4f7d88){logger['info'](_0x2a70('0xe'),_0x4c54ee,_0x2a70('0xf'));logger['debug'](_0x2a70('0x10'),_0x4c54ee,'request\x20sent',JSON[_0x2a70('0x11')](_0x4f7d88));if(_0x4f7d88[_0x2a70('0x12')]){if(_0x4f7d88[_0x2a70('0x12')][_0x2a70('0x13')]===0x1f4){logger['error'](_0x2a70('0xe'),_0x4c54ee,_0x4f7d88['error'][_0x2a70('0x14')]);return _0x3b235c(_0x4f7d88[_0x2a70('0x12')]['message']);}logger[_0x2a70('0x12')](_0x2a70('0xe'),_0x4c54ee,_0x4f7d88['error']['message']);return _0x3fcf82(_0x4f7d88[_0x2a70('0x12')][_0x2a70('0x14')]);}else{logger[_0x2a70('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x4c54ee,_0x2a70('0xf'));_0x3fcf82(_0x4f7d88['result'][_0x2a70('0x14')]);}})[_0x2a70('0x16')](function(_0x140d7e){logger[_0x2a70('0x12')](_0x2a70('0xe'),_0x4c54ee,_0x140d7e);_0x3b235c(_0x140d7e);});});}exports[_0x2a70('0x17')]=function(_0x5341be){var _0x1fa5de=this;return new Promise(function(_0x5d14f9,_0x3379d9){return db[_0x2a70('0x18')][_0x2a70('0x19')]({'raw':_0x5341be[_0x2a70('0x1a')]?_0x5341be[_0x2a70('0x1a')][_0x2a70('0x1b')]===undefined?!![]:![]:!![],'where':_0x5341be[_0x2a70('0x1a')]?_0x5341be['options'][_0x2a70('0x1c')]||null:null,'attributes':_0x5341be['options']?_0x5341be[_0x2a70('0x1a')]['attributes']||null:null,'limit':_0x5341be['options']?_0x5341be[_0x2a70('0x1a')][_0x2a70('0x1d')]||null:null,'include':_0x5341be[_0x2a70('0x1a')]?_0x5341be['options'][_0x2a70('0x1e')]?_[_0x2a70('0x1f')](_0x5341be['options']['include'],function(_0x18ef2f){return{'model':db[_0x18ef2f['model']],'as':_0x18ef2f['as'],'attributes':_0x18ef2f['attributes'],'include':_0x18ef2f[_0x2a70('0x1e')]?_['map'](_0x18ef2f[_0x2a70('0x1e')],function(_0x473145){return{'model':db[_0x473145[_0x2a70('0x20')]],'as':_0x473145['as'],'attributes':_0x473145['attributes'],'include':_0x473145[_0x2a70('0x1e')]?_[_0x2a70('0x1f')](_0x473145[_0x2a70('0x1e')],function(_0x4d492b){return{'model':db[_0x4d492b[_0x2a70('0x20')]],'as':_0x4d492b['as'],'attributes':_0x4d492b[_0x2a70('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36fe27){logger[_0x2a70('0x15')]('GetVoiceCallReport',_0x5341be);logger[_0x2a70('0x22')](_0x2a70('0x17'),_0x5341be,JSON['stringify'](_0x36fe27));_0x5d14f9(_0x36fe27);})['catch'](function(_0x27592d){logger['error'](_0x2a70('0x17'),_0x27592d['message'],_0x5341be);_0x3379d9(_0x1fa5de[_0x2a70('0x12')](0x1f4,_0x27592d[_0x2a70('0x14')]));});});};exports[_0x2a70('0x23')]=function(_0x4c74dc){var _0x304e42=this;return new Promise(function(_0x53733b,_0x120588){return db[_0x2a70('0x18')]['create'](_0x4c74dc[_0x2a70('0x24')],{'raw':_0x4c74dc[_0x2a70('0x1a')]?_0x4c74dc[_0x2a70('0x1a')][_0x2a70('0x1b')]===undefined?!![]:![]:!![]})[_0x2a70('0xd')](function(_0x306dbe){logger['info'](_0x2a70('0x23'),_0x4c74dc);logger[_0x2a70('0x22')](_0x2a70('0x23'),_0x4c74dc,JSON[_0x2a70('0x11')](_0x306dbe));_0x53733b(_0x306dbe);})[_0x2a70('0x16')](function(_0x2d7053){logger[_0x2a70('0x12')]('CreateVoiceCallReport',_0x2d7053[_0x2a70('0x14')],_0x4c74dc);_0x120588(_0x304e42[_0x2a70('0x12')](0x1f4,_0x2d7053[_0x2a70('0x14')]));});});};exports[_0x2a70('0x25')]=function(_0x4063d2){var _0x343149=this;return new Promise(function(_0x451d8b,_0x2d56ca){return db[_0x2a70('0x18')][_0x2a70('0x26')](_0x4063d2[_0x2a70('0x24')],{'raw':_0x4063d2['options']?_0x4063d2['options'][_0x2a70('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4063d2[_0x2a70('0x1a')]?_0x4063d2[_0x2a70('0x1a')][_0x2a70('0x1c')]||null:null,'attributes':_0x4063d2[_0x2a70('0x1a')]?_0x4063d2[_0x2a70('0x1a')][_0x2a70('0x21')]||null:null,'limit':_0x4063d2[_0x2a70('0x1a')]?_0x4063d2[_0x2a70('0x1a')][_0x2a70('0x1d')]||null:null})['then'](function(_0x22a640){logger['info'](_0x2a70('0x25'),_0x4063d2);logger[_0x2a70('0x22')](_0x2a70('0x25'),_0x4063d2,JSON[_0x2a70('0x11')](_0x22a640));_0x451d8b(_0x22a640);})[_0x2a70('0x16')](function(_0x19bbbd){logger['error'](_0x2a70('0x25'),_0x19bbbd[_0x2a70('0x14')],_0x4063d2);_0x2d56ca(_0x343149[_0x2a70('0x12')](0x1f4,_0x19bbbd[_0x2a70('0x14')]));});});}; \ No newline at end of file +var _0xb9c5=['body','UpdateVoiceCallReport','update','lodash','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','map','include','model','stringify','CreateVoiceCallReport'];(function(_0x25423b,_0x1e70e8){var _0x483028=function(_0x8eef7a){while(--_0x8eef7a){_0x25423b['push'](_0x25423b['shift']());}};_0x483028(++_0x1e70e8);}(_0xb9c5,0x69));var _0x5b9c=function(_0x21084b,_0x8342f){_0x21084b=_0x21084b-0x0;var _0x326b0b=_0xb9c5[_0x21084b];return _0x326b0b;};'use strict';var _=require(_0x5b9c('0x0'));var util=require('util');var moment=require(_0x5b9c('0x1'));var BPromise=require(_0x5b9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b9c('0x3'));var db=require(_0x5b9c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5b9c('0x5'));var client=jayson[_0x5b9c('0x6')][_0x5b9c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x212214,_0x24091a,_0x472aa5){return new BPromise(function(_0x3b28f8,_0x270734){return client[_0x5b9c('0x8')](_0x212214,_0x472aa5)[_0x5b9c('0x9')](function(_0x31eecf){logger[_0x5b9c('0xa')](_0x5b9c('0xb'),_0x24091a,_0x5b9c('0xc'));logger[_0x5b9c('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x24091a,_0x5b9c('0xc'),JSON['stringify'](_0x31eecf));if(_0x31eecf['error']){if(_0x31eecf[_0x5b9c('0xe')][_0x5b9c('0xf')]===0x1f4){logger[_0x5b9c('0xe')](_0x5b9c('0xb'),_0x24091a,_0x31eecf[_0x5b9c('0xe')][_0x5b9c('0x10')]);return _0x270734(_0x31eecf[_0x5b9c('0xe')][_0x5b9c('0x10')]);}logger[_0x5b9c('0xe')](_0x5b9c('0xb'),_0x24091a,_0x31eecf[_0x5b9c('0xe')][_0x5b9c('0x10')]);return _0x3b28f8(_0x31eecf['error']['message']);}else{logger[_0x5b9c('0xa')](_0x5b9c('0xb'),_0x24091a,_0x5b9c('0xc'));_0x3b28f8(_0x31eecf[_0x5b9c('0x11')][_0x5b9c('0x10')]);}})[_0x5b9c('0x12')](function(_0x4dc157){logger[_0x5b9c('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x24091a,_0x4dc157);_0x270734(_0x4dc157);});});}exports[_0x5b9c('0x13')]=function(_0x4f8c97){var _0x15f86c=this;return new Promise(function(_0x313a06,_0x1aab91){return db[_0x5b9c('0x14')][_0x5b9c('0x15')]({'raw':_0x4f8c97[_0x5b9c('0x16')]?_0x4f8c97[_0x5b9c('0x16')][_0x5b9c('0x17')]===undefined?!![]:![]:!![],'where':_0x4f8c97['options']?_0x4f8c97['options'][_0x5b9c('0x18')]||null:null,'attributes':_0x4f8c97['options']?_0x4f8c97['options'][_0x5b9c('0x19')]||null:null,'limit':_0x4f8c97[_0x5b9c('0x16')]?_0x4f8c97['options']['limit']||null:null,'include':_0x4f8c97[_0x5b9c('0x16')]?_0x4f8c97[_0x5b9c('0x16')]['include']?_[_0x5b9c('0x1a')](_0x4f8c97[_0x5b9c('0x16')][_0x5b9c('0x1b')],function(_0x10110b){return{'model':db[_0x10110b['model']],'as':_0x10110b['as'],'attributes':_0x10110b[_0x5b9c('0x19')],'include':_0x10110b['include']?_['map'](_0x10110b[_0x5b9c('0x1b')],function(_0x88c4df){return{'model':db[_0x88c4df[_0x5b9c('0x1c')]],'as':_0x88c4df['as'],'attributes':_0x88c4df[_0x5b9c('0x19')],'include':_0x88c4df[_0x5b9c('0x1b')]?_['map'](_0x88c4df['include'],function(_0x36d153){return{'model':db[_0x36d153[_0x5b9c('0x1c')]],'as':_0x36d153['as'],'attributes':_0x36d153[_0x5b9c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x417016){logger[_0x5b9c('0xa')](_0x5b9c('0x13'),_0x4f8c97);logger[_0x5b9c('0xd')](_0x5b9c('0x13'),_0x4f8c97,JSON[_0x5b9c('0x1d')](_0x417016));_0x313a06(_0x417016);})[_0x5b9c('0x12')](function(_0x5a2549){logger[_0x5b9c('0xe')](_0x5b9c('0x13'),_0x5a2549[_0x5b9c('0x10')],_0x4f8c97);_0x1aab91(_0x15f86c[_0x5b9c('0xe')](0x1f4,_0x5a2549[_0x5b9c('0x10')]));});});};exports[_0x5b9c('0x1e')]=function(_0x5a8cb7){var _0x1b01a6=this;return new Promise(function(_0x3e8c82,_0x50fa38){return db[_0x5b9c('0x14')]['create'](_0x5a8cb7[_0x5b9c('0x1f')],{'raw':_0x5a8cb7[_0x5b9c('0x16')]?_0x5a8cb7[_0x5b9c('0x16')][_0x5b9c('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x323f25){logger['info'](_0x5b9c('0x1e'),_0x5a8cb7);logger['debug'](_0x5b9c('0x1e'),_0x5a8cb7,JSON[_0x5b9c('0x1d')](_0x323f25));_0x3e8c82(_0x323f25);})[_0x5b9c('0x12')](function(_0xc5dc88){logger[_0x5b9c('0xe')]('CreateVoiceCallReport',_0xc5dc88[_0x5b9c('0x10')],_0x5a8cb7);_0x50fa38(_0x1b01a6[_0x5b9c('0xe')](0x1f4,_0xc5dc88['message']));});});};exports[_0x5b9c('0x20')]=function(_0xf37623){var _0x49abff=this;return new Promise(function(_0x35ecba,_0x278b55){return db['VoiceCallReport'][_0x5b9c('0x21')](_0xf37623[_0x5b9c('0x1f')],{'raw':_0xf37623[_0x5b9c('0x16')]?_0xf37623[_0x5b9c('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf37623[_0x5b9c('0x16')]?_0xf37623[_0x5b9c('0x16')][_0x5b9c('0x18')]||null:null,'attributes':_0xf37623['options']?_0xf37623[_0x5b9c('0x16')][_0x5b9c('0x19')]||null:null,'limit':_0xf37623['options']?_0xf37623[_0x5b9c('0x16')]['limit']||null:null})['then'](function(_0x4909ae){logger['info'](_0x5b9c('0x20'),_0xf37623);logger[_0x5b9c('0xd')]('UpdateVoiceCallReport',_0xf37623,JSON[_0x5b9c('0x1d')](_0x4909ae));_0x35ecba(_0x4909ae);})[_0x5b9c('0x12')](function(_0x7d17df){logger[_0x5b9c('0xe')](_0x5b9c('0x20'),_0x7d17df['message'],_0xf37623);_0x278b55(_0x49abff[_0x5b9c('0xe')](0x1f4,_0x7d17df['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 799c9fb..c0bcd9f 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 _0xa39e=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id'];(function(_0x4ee5c7,_0x5379f1){var _0x677a8c=function(_0x33619a){while(--_0x33619a){_0x4ee5c7['push'](_0x4ee5c7['shift']());}};_0x677a8c(++_0x5379f1);}(_0xa39e,0x1be));var _0xea39=function(_0x30e804,_0x8d453b){_0x30e804=_0x30e804-0x0;var _0x529374=_0xa39e[_0x30e804];return _0x529374;};'use strict';var multer=require('multer');var util=require(_0xea39('0x0'));var path=require(_0xea39('0x1'));var timeout=require('connect-timeout');var express=require(_0xea39('0x2'));var router=express[_0xea39('0x3')]();var fs_extra=require(_0xea39('0x4'));var auth=require(_0xea39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea39('0x6'));var controller=require('./voiceChanSpy.controller');router[_0xea39('0x7')]('/',auth['isAuthenticated'](),controller[_0xea39('0x8')]);router[_0xea39('0x7')](_0xea39('0x9'),auth[_0xea39('0xa')](),controller[_0xea39('0xb')]);router[_0xea39('0xc')]('/',auth[_0xea39('0xa')](),controller[_0xea39('0xd')]);router[_0xea39('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xea39('0xf')]);router[_0xea39('0x10')](_0xea39('0x9'),auth[_0xea39('0xa')](),controller[_0xea39('0x11')]);module[_0xea39('0x12')]=router; \ No newline at end of file +var _0xb995=['get','isAuthenticated','/:id','show','create','update','delete','util','path','connect-timeout','fs-extra','../../config/environment','./voiceChanSpy.controller'];(function(_0x361d16,_0x40b1f1){var _0x4c99c1=function(_0x4d30fd){while(--_0x4d30fd){_0x361d16['push'](_0x361d16['shift']());}};_0x4c99c1(++_0x40b1f1);}(_0xb995,0xe4));var _0x5b99=function(_0x57c2e1,_0x131046){_0x57c2e1=_0x57c2e1-0x0;var _0x26a025=_0xb995[_0x57c2e1];return _0x26a025;};'use strict';var multer=require('multer');var util=require(_0x5b99('0x0'));var path=require(_0x5b99('0x1'));var timeout=require(_0x5b99('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5b99('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b99('0x4'));var controller=require(_0x5b99('0x5'));router[_0x5b99('0x6')]('/',auth[_0x5b99('0x7')](),controller['index']);router['get'](_0x5b99('0x8'),auth[_0x5b99('0x7')](),controller[_0x5b99('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5b99('0xa')]);router['put'](_0x5b99('0x8'),auth[_0x5b99('0x7')](),controller[_0x5b99('0xb')]);router[_0x5b99('0xc')](_0x5b99('0x8'),auth[_0x5b99('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ac35501..58154b9 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 _0x2a16=['name','options','join','getDataValue','split','BOOLEAN','exports','STRING'];(function(_0x2b65df,_0x2c029c){var _0xd6c56=function(_0x5652f3){while(--_0x5652f3){_0x2b65df['push'](_0x2b65df['shift']());}};_0xd6c56(++_0x2c029c);}(_0x2a16,0x1be));var _0x62a1=function(_0x23b5d3,_0x224d3e){_0x23b5d3=_0x23b5d3-0x0;var _0x440a6d=_0x2a16[_0x23b5d3];return _0x440a6d;};'use strict';var Sequelize=require('sequelize');module[_0x62a1('0x0')]={'name':{'type':Sequelize[_0x62a1('0x1')]},'prefix':{'type':Sequelize[_0x62a1('0x1')],'unique':_0x62a1('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x62a1('0x1')],'set':function(_0x10da90){this['setDataValue'](_0x62a1('0x3'),_0x10da90?_0x10da90[_0x62a1('0x4')](''):[]);},'get':function(){return this[_0x62a1('0x5')]('options')?this[_0x62a1('0x5')]('options')[_0x62a1('0x6')](''):[];}},'auth':{'type':Sequelize[_0x62a1('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x62a1('0x1')]},'record':{'type':Sequelize[_0x62a1('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x62a1('0x1')]},'description':{'type':Sequelize[_0x62a1('0x1')]}}; \ No newline at end of file +var _0x0dc5=['options','getDataValue','split','BOOLEAN','sequelize','exports','name','STRING','setDataValue'];(function(_0x5cfee2,_0x5b5c37){var _0x89e5cd=function(_0x36934c){while(--_0x36934c){_0x5cfee2['push'](_0x5cfee2['shift']());}};_0x89e5cd(++_0x5b5c37);}(_0x0dc5,0x82));var _0x50dc=function(_0x22ed14,_0x587408){_0x22ed14=_0x22ed14-0x0;var _0xd19ba0=_0x0dc5[_0x22ed14];return _0xd19ba0;};'use strict';var Sequelize=require(_0x50dc('0x0'));module[_0x50dc('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x50dc('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x50dc('0x3')],'set':function(_0x38453b){this[_0x50dc('0x4')](_0x50dc('0x5'),_0x38453b?_0x38453b['join'](''):[]);},'get':function(){return this[_0x50dc('0x6')]('options')?this[_0x50dc('0x6')](_0x50dc('0x5'))[_0x50dc('0x7')](''):[];}},'auth':{'type':Sequelize[_0x50dc('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x50dc('0x3')]},'record':{'type':Sequelize[_0x50dc('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x50dc('0x3')]},'description':{'type':Sequelize[_0x50dc('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 33bfb46..bfbb7db 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 _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','ChanSpies','UserProfileResource','error','stack','name','send','map','key','keys','query','filters','intersection','model','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','options','VoiceChanSpy','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(_0x5a2109,_0x2bf6f7){var _0x31961b=function(_0x46138f){while(--_0x46138f){_0x5a2109['push'](_0x5a2109['shift']());}};_0x31961b(++_0x2bf6f7);}(_0xf290,0xde));var _0x0f29=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0xf290[_0xb301d4];return _0x3b5bde;};'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['VoiceChanSpy']['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['VoiceChanSpy']['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['VoiceChanSpy']['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['VoiceChanSpy'][_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 +var _0xa1e8=['findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','reject','save','update','then','get','ChanSpies','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceChanSpy','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x527039,_0x508e83){_0x527039=_0x527039-0x0;var _0x114445=_0xa1e8[_0x527039];return _0x114445;};'use strict';var emlformat=require(_0x8a1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a1e('0x1'));var jsonpatch=require(_0x8a1e('0x2'));var rp=require(_0x8a1e('0x3'));var moment=require('moment');var BPromise=require(_0x8a1e('0x4'));var Mustache=require('mustache');var util=require(_0x8a1e('0x5'));var path=require(_0x8a1e('0x6'));var sox=require(_0x8a1e('0x7'));var csv=require(_0x8a1e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a1e('0x9'));var _=require(_0x8a1e('0xa'));var squel=require(_0x8a1e('0xb'));var crypto=require(_0x8a1e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8a1e('0xd'));var toCsv=require(_0x8a1e('0x8'));var querystring=require(_0x8a1e('0xe'));var Papa=require('papaparse');var Redis=require(_0x8a1e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8a1e('0x10'));var as=require(_0x8a1e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8a1e('0x12'));var utils=require(_0x8a1e('0x13'));var config=require(_0x8a1e('0x14'));var licenseUtil=require(_0x8a1e('0x15'));var db=require(_0x8a1e('0x16'))['db'];function respondWithStatusCode(_0x8aebf4,_0x22a562){_0x22a562=_0x22a562||0xcc;return function(_0x4d8829){if(_0x4d8829){return _0x8aebf4[_0x8a1e('0x17')](_0x22a562);}return _0x8aebf4[_0x8a1e('0x18')](_0x22a562)[_0x8a1e('0x19')]();};}function respondWithResult(_0x50f242,_0x39eeec){_0x39eeec=_0x39eeec||0xc8;return function(_0x1ef391){if(_0x1ef391){return _0x50f242[_0x8a1e('0x18')](_0x39eeec)['json'](_0x1ef391);}};}function respondWithFilteredResult(_0x3b3c83,_0x472fc8){return function(_0x162a63){if(_0x162a63){var _0x4a31d0=typeof _0x472fc8['offset']==='undefined'&&typeof _0x472fc8[_0x8a1e('0x1a')]===_0x8a1e('0x1b');var _0x54d0fd=_0x162a63[_0x8a1e('0x1c')];var _0x27ff23=_0x4a31d0?0x0:_0x472fc8[_0x8a1e('0x1d')];var _0x362bb8=_0x4a31d0?_0x162a63[_0x8a1e('0x1c')]:_0x472fc8[_0x8a1e('0x1d')]+_0x472fc8['limit'];var _0x9946ad;if(_0x362bb8>=_0x54d0fd){_0x362bb8=_0x54d0fd;_0x9946ad=0xc8;}else{_0x9946ad=0xce;}_0x3b3c83[_0x8a1e('0x18')](_0x9946ad);return _0x3b3c83['set'](_0x8a1e('0x1e'),_0x27ff23+'-'+_0x362bb8+'/'+_0x54d0fd)[_0x8a1e('0x1f')](_0x162a63);}return null;};}function patchUpdates(_0x2208a5){return function(_0x27c3cd){try{jsonpatch['apply'](_0x27c3cd,_0x2208a5,!![]);}catch(_0x50d479){return BPromise[_0x8a1e('0x20')](_0x50d479);}return _0x27c3cd[_0x8a1e('0x21')]();};}function saveUpdates(_0x2b2334,_0x1f5c7b){return function(_0x6adaed){if(_0x6adaed){return _0x6adaed[_0x8a1e('0x22')](_0x2b2334)[_0x8a1e('0x23')](function(_0x31924e){return _0x31924e;});}return null;};}function removeEntity(_0x399361,_0x71f051){return function(_0x80dd6a){if(_0x80dd6a){return _0x80dd6a['destroy']()[_0x8a1e('0x23')](function(){var _0x2e0798=_0x80dd6a[_0x8a1e('0x24')]({'plain':!![]});var _0x59de36=_0x8a1e('0x25');return db[_0x8a1e('0x26')][_0x8a1e('0x27')]({'where':{'type':_0x59de36,'resourceId':_0x2e0798['id']}})[_0x8a1e('0x23')](function(){return _0x80dd6a;});})['then'](function(){_0x399361[_0x8a1e('0x18')](0xcc)[_0x8a1e('0x19')]();});}};}function handleEntityNotFound(_0x21786d,_0x2eddb5){return function(_0x4107f5){if(!_0x4107f5){_0x21786d[_0x8a1e('0x17')](0x194);}return _0x4107f5;};}function handleError(_0x4c7f91,_0x2b5210){_0x2b5210=_0x2b5210||0x1f4;return function(_0x1289ac){logger[_0x8a1e('0x28')](_0x1289ac[_0x8a1e('0x29')]);if(_0x1289ac[_0x8a1e('0x2a')]){delete _0x1289ac['name'];}_0x4c7f91['status'](_0x2b5210)[_0x8a1e('0x2b')](_0x1289ac);};}exports[_0x8a1e('0x2c')]=function(_0x5bd37c,_0xf39c6d){var _0x1e8b4c={},_0x1a7585={},_0x3725a8={'count':0x0,'rows':[]};var _0x11791f=_[_0x8a1e('0x2d')](db[_0x8a1e('0x2e')]['rawAttributes'],function(_0x176445){return{'name':_0x176445[_0x8a1e('0x2f')],'type':_0x176445['type']['key']};});_0x1a7585['model']=_['map'](_0x11791f,_0x8a1e('0x2a'));_0x1a7585[_0x8a1e('0x30')]=_[_0x8a1e('0x31')](_0x5bd37c['query']);_0x1a7585[_0x8a1e('0x32')]=_[_0x8a1e('0x33')](_0x1a7585[_0x8a1e('0x34')],_0x1a7585[_0x8a1e('0x30')]);_0x1e8b4c['attributes']=_['intersection'](_0x1a7585[_0x8a1e('0x34')],qs['fields'](_0x5bd37c[_0x8a1e('0x30')][_0x8a1e('0x35')]));_0x1e8b4c[_0x8a1e('0x36')]=_0x1e8b4c[_0x8a1e('0x36')][_0x8a1e('0x37')]?_0x1e8b4c[_0x8a1e('0x36')]:_0x1a7585[_0x8a1e('0x34')];if(!_0x5bd37c['query'][_0x8a1e('0x38')](_0x8a1e('0x39'))){_0x1e8b4c['limit']=qs[_0x8a1e('0x1a')](_0x5bd37c[_0x8a1e('0x30')][_0x8a1e('0x1a')]);_0x1e8b4c[_0x8a1e('0x1d')]=qs[_0x8a1e('0x1d')](_0x5bd37c[_0x8a1e('0x30')]['offset']);}_0x1e8b4c['order']=qs[_0x8a1e('0x3a')](_0x5bd37c[_0x8a1e('0x30')]['sort']);_0x1e8b4c['where']=qs[_0x8a1e('0x32')](_[_0x8a1e('0x3b')](_0x5bd37c['query'],_0x1a7585['filters']),_0x11791f);if(_0x5bd37c['query']['filter']){_0x1e8b4c[_0x8a1e('0x3c')]=_[_0x8a1e('0x3d')](_0x1e8b4c[_0x8a1e('0x3c')],{'$or':_[_0x8a1e('0x2d')](_0x11791f,function(_0x4690ed){if(_0x4690ed['type']!==_0x8a1e('0x3e')){var _0x420162={};_0x420162[_0x4690ed[_0x8a1e('0x2a')]]={'$like':'%'+_0x5bd37c[_0x8a1e('0x30')][_0x8a1e('0x3f')]+'%'};return _0x420162;}})});}_0x1e8b4c=_[_0x8a1e('0x3d')]({},_0x1e8b4c,_0x5bd37c[_0x8a1e('0x40')]);var _0xd8dab4={'where':_0x1e8b4c[_0x8a1e('0x3c')]};return db[_0x8a1e('0x2e')][_0x8a1e('0x1c')](_0xd8dab4)[_0x8a1e('0x23')](function(_0x40a71f){_0x3725a8[_0x8a1e('0x1c')]=_0x40a71f;if(_0x5bd37c['query'][_0x8a1e('0x41')]){_0x1e8b4c[_0x8a1e('0x42')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x8a1e('0x43')](_0x1e8b4c);})[_0x8a1e('0x23')](function(_0xf2a702){_0x3725a8[_0x8a1e('0x44')]=_0xf2a702;return _0x3725a8;})['then'](respondWithFilteredResult(_0xf39c6d,_0x1e8b4c))[_0x8a1e('0x45')](handleError(_0xf39c6d,null));};exports[_0x8a1e('0x46')]=function(_0x5196d5,_0x299225){var _0x2e0d42={'raw':![],'where':{'id':_0x5196d5[_0x8a1e('0x47')]['id']}},_0x5b110a={};_0x5b110a[_0x8a1e('0x34')]=_[_0x8a1e('0x31')](db[_0x8a1e('0x2e')][_0x8a1e('0x48')]);_0x5b110a[_0x8a1e('0x30')]=_[_0x8a1e('0x31')](_0x5196d5[_0x8a1e('0x30')]);_0x5b110a[_0x8a1e('0x32')]=_[_0x8a1e('0x33')](_0x5b110a['model'],_0x5b110a[_0x8a1e('0x30')]);_0x2e0d42['attributes']=_['intersection'](_0x5b110a[_0x8a1e('0x34')],qs[_0x8a1e('0x35')](_0x5196d5[_0x8a1e('0x30')][_0x8a1e('0x35')]));_0x2e0d42['attributes']=_0x2e0d42['attributes']['length']?_0x2e0d42[_0x8a1e('0x36')]:_0x5b110a[_0x8a1e('0x34')];if(_0x5196d5[_0x8a1e('0x30')][_0x8a1e('0x41')]){_0x2e0d42[_0x8a1e('0x42')]=[{'all':!![]}];}_0x2e0d42=_[_0x8a1e('0x3d')]({},_0x2e0d42,_0x5196d5['options']);return db[_0x8a1e('0x2e')][_0x8a1e('0x49')](_0x2e0d42)['then'](handleEntityNotFound(_0x299225,null))[_0x8a1e('0x23')](respondWithResult(_0x299225,null))[_0x8a1e('0x45')](handleError(_0x299225,null));};exports['create']=function(_0x49cb8e,_0x5b1ec0){return db[_0x8a1e('0x2e')][_0x8a1e('0x4a')](_0x49cb8e[_0x8a1e('0x4b')],{})[_0x8a1e('0x23')](function(_0x491345){var _0x4a7c8e=_0x49cb8e[_0x8a1e('0x4c')][_0x8a1e('0x24')]({'plain':!![]});if(!_0x4a7c8e)throw new Error(_0x8a1e('0x4d'));if(_0x4a7c8e[_0x8a1e('0x4e')]==='user'){var _0x251ff2=_0x491345[_0x8a1e('0x24')]({'plain':!![]});var _0x30db70=_0x8a1e('0x25');return db[_0x8a1e('0x4f')][_0x8a1e('0x49')]({'where':{'name':_0x30db70,'userProfileId':_0x4a7c8e[_0x8a1e('0x50')]},'raw':!![]})['then'](function(_0x9487b1){if(_0x9487b1&&_0x9487b1[_0x8a1e('0x51')]===0x0){return db[_0x8a1e('0x26')]['create']({'name':_0x251ff2['name'],'resourceId':_0x251ff2['id'],'type':_0x9487b1[_0x8a1e('0x2a')],'sectionId':_0x9487b1['id']},{})['then'](function(){return _0x491345;});}else{return _0x491345;}})[_0x8a1e('0x45')](function(_0x901565){logger[_0x8a1e('0x28')](_0x8a1e('0x52'),_0x901565);throw _0x901565;});}return _0x491345;})[_0x8a1e('0x23')](respondWithResult(_0x5b1ec0,0xc9))[_0x8a1e('0x45')](handleError(_0x5b1ec0,null));};exports[_0x8a1e('0x22')]=function(_0x1bb398,_0x1620ab){if(_0x1bb398[_0x8a1e('0x4b')]['id']){delete _0x1bb398[_0x8a1e('0x4b')]['id'];}return db['VoiceChanSpy'][_0x8a1e('0x49')]({'where':{'id':_0x1bb398['params']['id']}})[_0x8a1e('0x23')](handleEntityNotFound(_0x1620ab,null))['then'](saveUpdates(_0x1bb398[_0x8a1e('0x4b')],null))[_0x8a1e('0x23')](respondWithResult(_0x1620ab,null))[_0x8a1e('0x45')](handleError(_0x1620ab,null));};exports[_0x8a1e('0x27')]=function(_0x3d3890,_0x34c085){return db[_0x8a1e('0x2e')][_0x8a1e('0x49')]({'where':{'id':_0x3d3890[_0x8a1e('0x47')]['id']}})[_0x8a1e('0x23')](handleEntityNotFound(_0x34c085,null))[_0x8a1e('0x23')](removeEntity(_0x34c085,null))[_0x8a1e('0x45')](handleError(_0x34c085,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 0289170..8d833eb 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 _0x2a81=['Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','CDR(type)=%s','chanspy','${UNIQUEID}.%s,a','recordingFormat'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0x2a81,0xa2));var _0x12a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a81[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x12a8('0x0'));var BPromise=require(_0x12a8('0x1'));var attributes=require(_0x12a8('0x2'));var getUserApplications=function(_0x413e65,_0x31a279,_0x377329){var _0x5ee424=0x1;var _0x3e5425=[];var _0x473df7={'context':_0x31a279['context']||_0x12a8('0x3'),'exten':util[_0x12a8('0x4')](_0x12a8('0x5'),_0x413e65[_0x12a8('0x6')],_0x377329),'type':_0x12a8('0x7'),'isApp':![],'ChanSpyId':_0x413e65['id'],'UserId':_0x31a279['id']};_0x3e5425[_0x12a8('0x8')](_['merge']({'app':'Set','appdata':util[_0x12a8('0x4')](_0x12a8('0x9'),_0x12a8('0xa')),'priority':_0x5ee424++},_0x473df7));if(_0x413e65['record']){_0x3e5425[_0x12a8('0x8')](_['merge']({'app':'MixMonitor','appdata':util[_0x12a8('0x4')](_0x12a8('0xb'),_0x413e65[_0x12a8('0xc')]),'priority':_0x5ee424++},_0x473df7));}if(_0x413e65['auth']){_0x3e5425[_0x12a8('0x8')](_['merge']({'app':_0x12a8('0xd'),'appdata':_0x413e65[_0x12a8('0xe')],'priority':_0x5ee424++},_0x473df7));}_0x3e5425[_0x12a8('0x8')](_['merge']({'app':'ChanSpy','appdata':util[_0x12a8('0x4')](_0x12a8('0xf'),_0x31a279[_0x12a8('0x10')],_0x413e65[_0x12a8('0x11')]?_0x413e65['options'][_0x12a8('0x12')](''):''),'priority':_0x5ee424++},_0x473df7));if(_0x413e65['record']){_0x3e5425['push'](_['merge']({'app':_0x12a8('0x13'),'priority':_0x5ee424++},_0x473df7));}return _0x3e5425;};var getChanSpyApplications=function(_0x327659,_0x1f3e2e){var _0x3ee62f=[];for(var _0x1963be=0x0,_0x284ec9=0x1;_0x1963be<_0x1f3e2e[_0x12a8('0x14')];_0x1963be++,_0x284ec9=0x1){_0x3ee62f=_0x3ee62f[_0x12a8('0x15')](getUserApplications(_0x327659,_0x1f3e2e[_0x1963be],_0x1f3e2e[_0x1963be]['internal']));if(_0x1f3e2e[_0x1963be][_0x12a8('0x16')]!=_0x1f3e2e[_0x1963be][_0x12a8('0x10')]){_0x3ee62f=_0x3ee62f[_0x12a8('0x15')](getUserApplications(_0x327659,_0x1f3e2e[_0x1963be],_0x1f3e2e[_0x1963be][_0x12a8('0x10')]));}}return _0x3ee62f;};var getChanSpyPromise=function(_0x59792b,_0x27ae0f){return new BPromise(function(_0x373b79,_0xb6a694){return _0x59792b['User'][_0x12a8('0x17')]({'attributes':['id','name',_0x12a8('0x16')],'where':{'role':_0x12a8('0x18'),'chanspy':!![]},'raw':!![]})[_0x12a8('0x19')](function(_0x35cc57){if(_0x35cc57){return _0x373b79(getChanSpyApplications(_0x27ae0f,_0x35cc57));}return _0x373b79([]);})[_0x12a8('0x1a')](function(_0xe3f3b2){_0xb6a694(_0xe3f3b2);});});};module[_0x12a8('0x1b')]=function(_0x308a2d,_0x594792){var _0xec4652=_0x308a2d[_0x12a8('0x1c')];return _0x308a2d[_0x12a8('0x1d')](_0x12a8('0x1e'),attributes,{'tableName':_0x12a8('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x357dfc,_0x554c32,_0xabd790){return getChanSpyPromise(_0xec4652,_0x357dfc)[_0x12a8('0x19')](function(_0xf90406){if(_0xf90406&&_0xf90406['length']){return _0xec4652[_0x12a8('0x20')][_0x12a8('0x21')](_0xf90406);}})[_0x12a8('0x19')](function(){_0xabd790();})['catch'](function(_0x116b97){_0xabd790(_0x116b97);});},'afterUpdate':function(_0x1c9eb1,_0x27770f,_0x217dac){return _0xec4652['VoiceExtension'][_0x12a8('0x22')]({'where':{'ChanSpyId':_0x1c9eb1['id']}})[_0x12a8('0x19')](function(){return getChanSpyPromise(_0xec4652,_0x1c9eb1);})[_0x12a8('0x19')](function(_0x1f2929){if(_0x1f2929&&_0x1f2929[_0x12a8('0x14')]){return _0xec4652[_0x12a8('0x20')][_0x12a8('0x21')](_0x1f2929);}})['then'](function(){_0x217dac();})['catch'](function(_0x58debc){_0x217dac(_0x58debc);});},'afterDestroy':function(_0x32bde0,_0x3cb473,_0x2bc72e){return _0xec4652['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x32bde0['id']}})[_0x12a8('0x19')](function(){_0x2bc72e();})[_0x12a8('0x1a')](function(_0x4a24b3){_0x2bc72e(_0x4a24b3);});}}});}; \ No newline at end of file +var _0x3ad8=['length','internal','name','User','findAll','agent','exports','models','VoiceChanSpy','voice_chanspy','then','bulkCreate','catch','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0x3ad8,0xed));var _0x83ad=function(_0x34c949,_0x465372){_0x34c949=_0x34c949-0x0;var _0x40d29d=_0x3ad8[_0x34c949];return _0x40d29d;};'use strict';var _=require(_0x83ad('0x0'));var util=require(_0x83ad('0x1'));var BPromise=require(_0x83ad('0x2'));var attributes=require(_0x83ad('0x3'));var getUserApplications=function(_0x4a804b,_0x5e6547,_0x1ee85c){var _0x183a26=0x1;var _0x268eef=[];var _0x598897={'context':_0x5e6547[_0x83ad('0x4')]||'from-sip','exten':util[_0x83ad('0x5')](_0x83ad('0x6'),_0x4a804b['prefix'],_0x1ee85c),'type':'system','isApp':![],'ChanSpyId':_0x4a804b['id'],'UserId':_0x5e6547['id']};_0x268eef[_0x83ad('0x7')](_[_0x83ad('0x8')]({'app':_0x83ad('0x9'),'appdata':util[_0x83ad('0x5')](_0x83ad('0xa'),_0x83ad('0xb')),'priority':_0x183a26++},_0x598897));if(_0x4a804b[_0x83ad('0xc')]){_0x268eef[_0x83ad('0x7')](_[_0x83ad('0x8')]({'app':_0x83ad('0xd'),'appdata':util[_0x83ad('0x5')](_0x83ad('0xe'),_0x4a804b['recordingFormat']),'priority':_0x183a26++},_0x598897));}if(_0x4a804b[_0x83ad('0xf')]){_0x268eef[_0x83ad('0x7')](_[_0x83ad('0x8')]({'app':_0x83ad('0x10'),'appdata':_0x4a804b['password'],'priority':_0x183a26++},_0x598897));}_0x268eef[_0x83ad('0x7')](_['merge']({'app':_0x83ad('0x11'),'appdata':util[_0x83ad('0x5')](_0x83ad('0x12'),_0x5e6547['name'],_0x4a804b[_0x83ad('0x13')]?_0x4a804b[_0x83ad('0x13')][_0x83ad('0x14')](''):''),'priority':_0x183a26++},_0x598897));if(_0x4a804b['record']){_0x268eef['push'](_[_0x83ad('0x8')]({'app':_0x83ad('0x15'),'priority':_0x183a26++},_0x598897));}return _0x268eef;};var getChanSpyApplications=function(_0x2597a8,_0x5603e4){var _0x48d791=[];for(var _0x2a4917=0x0,_0x539f2a=0x1;_0x2a4917<_0x5603e4[_0x83ad('0x16')];_0x2a4917++,_0x539f2a=0x1){_0x48d791=_0x48d791['concat'](getUserApplications(_0x2597a8,_0x5603e4[_0x2a4917],_0x5603e4[_0x2a4917][_0x83ad('0x17')]));if(_0x5603e4[_0x2a4917][_0x83ad('0x17')]!=_0x5603e4[_0x2a4917][_0x83ad('0x18')]){_0x48d791=_0x48d791['concat'](getUserApplications(_0x2597a8,_0x5603e4[_0x2a4917],_0x5603e4[_0x2a4917][_0x83ad('0x18')]));}}return _0x48d791;};var getChanSpyPromise=function(_0x393b64,_0xfc41ff){return new BPromise(function(_0x42b07f,_0x7597d){return _0x393b64[_0x83ad('0x19')][_0x83ad('0x1a')]({'attributes':['id',_0x83ad('0x18'),_0x83ad('0x17')],'where':{'role':_0x83ad('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x1eb1eb){if(_0x1eb1eb){return _0x42b07f(getChanSpyApplications(_0xfc41ff,_0x1eb1eb));}return _0x42b07f([]);})['catch'](function(_0x302adb){_0x7597d(_0x302adb);});});};module[_0x83ad('0x1c')]=function(_0xab93f,_0x144ecb){var _0x3ee586=_0xab93f[_0x83ad('0x1d')];return _0xab93f['define'](_0x83ad('0x1e'),attributes,{'tableName':_0x83ad('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x39b0b8,_0x16948e,_0x549e47){return getChanSpyPromise(_0x3ee586,_0x39b0b8)[_0x83ad('0x20')](function(_0x1b48be){if(_0x1b48be&&_0x1b48be['length']){return _0x3ee586['VoiceExtension'][_0x83ad('0x21')](_0x1b48be);}})[_0x83ad('0x20')](function(){_0x549e47();})[_0x83ad('0x22')](function(_0x1fc917){_0x549e47(_0x1fc917);});},'afterUpdate':function(_0x139773,_0x51e62c,_0x3a2e5a){return _0x3ee586[_0x83ad('0x23')][_0x83ad('0x24')]({'where':{'ChanSpyId':_0x139773['id']}})[_0x83ad('0x20')](function(){return getChanSpyPromise(_0x3ee586,_0x139773);})[_0x83ad('0x20')](function(_0x2cb9d0){if(_0x2cb9d0&&_0x2cb9d0[_0x83ad('0x16')]){return _0x3ee586[_0x83ad('0x23')][_0x83ad('0x21')](_0x2cb9d0);}})[_0x83ad('0x20')](function(){_0x3a2e5a();})[_0x83ad('0x22')](function(_0x2c2418){_0x3a2e5a(_0x2c2418);});},'afterDestroy':function(_0x3fd065,_0x514dcc,_0x567e46){return _0x3ee586['VoiceExtension'][_0x83ad('0x24')]({'where':{'ChanSpyId':_0x3fd065['id']}})[_0x83ad('0x20')](function(){_0x567e46();})['catch'](function(_0x5c789a){_0x567e46(_0x5c789a);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 95752c5..3dba3ff 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 _0x44a3=['http','request','then','info','request\x20sent','debug','error','code','message','VoiceChanSpy,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x3501ec,_0x524d20){var _0x5a1d8c=function(_0x4a4818){while(--_0x4a4818){_0x3501ec['push'](_0x3501ec['shift']());}};_0x5a1d8c(++_0x524d20);}(_0x44a3,0x1a9));var _0x344a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x44a3[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504bd1,_0x553d97,_0x55ddca){return new BPromise(function(_0x484661,_0x475dab){return client[_0x344a('0xd')](_0x504bd1,_0x55ddca)[_0x344a('0xe')](function(_0x233ca1){logger[_0x344a('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'));logger[_0x344a('0x11')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'),JSON['stringify'](_0x233ca1));if(_0x233ca1[_0x344a('0x12')]){if(_0x233ca1['error'][_0x344a('0x13')]===0x1f4){logger[_0x344a('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x553d97,_0x233ca1['error'][_0x344a('0x14')]);return _0x475dab(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}logger[_0x344a('0x12')](_0x344a('0x15'),_0x553d97,_0x233ca1[_0x344a('0x12')]['message']);return _0x484661(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}else{logger[_0x344a('0xf')](_0x344a('0x15'),_0x553d97,'request\x20sent');_0x484661(_0x233ca1['result'][_0x344a('0x14')]);}})[_0x344a('0x16')](function(_0x36227e){logger[_0x344a('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x553d97,_0x36227e);_0x475dab(_0x36227e);});});} \ No newline at end of file +var _0xd64b=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1c8f74,_0x4c39be){var _0x5b4ad8=function(_0x4893d9){while(--_0x4893d9){_0x1c8f74['push'](_0x1c8f74['shift']());}};_0x5b4ad8(++_0x4c39be);}(_0xd64b,0xc1));var _0xbd64=function(_0x129b6b,_0x4faf08){_0x129b6b=_0x129b6b-0x0;var _0x24d8df=_0xd64b[_0x129b6b];return _0x24d8df;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index eaf26b1..8446d14 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 _0xf7d6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x45b89e,_0x426d42){var _0x1fdb9a=function(_0xd62d53){while(--_0xd62d53){_0x45b89e['push'](_0x45b89e['shift']());}};_0x1fdb9a(++_0x426d42);}(_0xf7d6,0x73));var _0x6f7d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf7d6[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x6f7d('0x0'));var util=require(_0x6f7d('0x1'));var path=require(_0x6f7d('0x2'));var timeout=require(_0x6f7d('0x3'));var express=require('express');var router=express[_0x6f7d('0x4')]();var fs_extra=require(_0x6f7d('0x5'));var auth=require(_0x6f7d('0x6'));var interaction=require(_0x6f7d('0x7'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x6f7d('0x8')]('/',auth[_0x6f7d('0x9')](),controller[_0x6f7d('0xa')]);router[_0x6f7d('0x8')](_0x6f7d('0xb'),auth[_0x6f7d('0x9')](),controller['show']);router[_0x6f7d('0xc')]('/',auth[_0x6f7d('0x9')](),controller['create']);router['put'](_0x6f7d('0xb'),auth[_0x6f7d('0x9')](),controller[_0x6f7d('0xd')]);router[_0x6f7d('0xe')]('/:id',auth[_0x6f7d('0x9')](),controller[_0x6f7d('0xf')]);module[_0x6f7d('0x10')]=router; \ No newline at end of file +var _0xa1ea=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x5438cb,_0x55a73){var _0x4474fb=function(_0x22b5f5){while(--_0x22b5f5){_0x5438cb['push'](_0x5438cb['shift']());}};_0x4474fb(++_0x55a73);}(_0xa1ea,0xd9));var _0xaa1e=function(_0x1fc45b,_0x19c244){_0x1fc45b=_0x1fc45b-0x0;var _0xd73450=_0xa1ea[_0x1fc45b];return _0xd73450;};'use strict';var multer=require(_0xaa1e('0x0'));var util=require(_0xaa1e('0x1'));var path=require(_0xaa1e('0x2'));var timeout=require(_0xaa1e('0x3'));var express=require(_0xaa1e('0x4'));var router=express[_0xaa1e('0x5')]();var fs_extra=require(_0xaa1e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaa1e('0x7'));var config=require(_0xaa1e('0x8'));var controller=require(_0xaa1e('0x9'));router[_0xaa1e('0xa')]('/',auth[_0xaa1e('0xb')](),controller['index']);router[_0xaa1e('0xa')]('/:id',auth[_0xaa1e('0xb')](),controller[_0xaa1e('0xc')]);router[_0xaa1e('0xd')]('/',auth[_0xaa1e('0xb')](),controller[_0xaa1e('0xe')]);router[_0xaa1e('0xf')](_0xaa1e('0x10'),auth[_0xaa1e('0xb')](),controller[_0xaa1e('0x11')]);router[_0xaa1e('0x12')]('/:id',auth[_0xaa1e('0xb')](),controller[_0xaa1e('0x13')]);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 8515d0f..d344277 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 _0x5cfd=['exports','STRING','name','BOOLEAN'];(function(_0x5a93f0,_0x172b1b){var _0x53844d=function(_0x19ba69){while(--_0x19ba69){_0x5a93f0['push'](_0x5a93f0['shift']());}};_0x53844d(++_0x172b1b);}(_0x5cfd,0x170));var _0xd5cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd5cf('0x0')]={'name':{'type':Sequelize[_0xd5cf('0x1')],'unique':_0xd5cf('0x2')},'description':{'type':Sequelize[_0xd5cf('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd5cf('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2110=['name','BOOLEAN','STRING'];(function(_0x11eec5,_0x49c834){var _0x184378=function(_0x21d8b6){while(--_0x21d8b6){_0x11eec5['push'](_0x11eec5['shift']());}};_0x184378(++_0x49c834);}(_0x2110,0x1be));var _0x0211=function(_0x4d27cd,_0x46c5d0){_0x4d27cd=_0x4d27cd-0x0;var _0x596dc6=_0x2110[_0x4d27cd];return _0x596dc6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0211('0x0')],'unique':_0x0211('0x1')},'description':{'type':Sequelize[_0x0211('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0211('0x2')],'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 2bb9405..3bded49 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 _0x37a7=['body','readFileSync','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','server/files/templates/context.ejs','findAll','root','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','count','reject','save','update','then','get','Contexts','UserProfileResource','destroy','stack','name','send','VoiceContext','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','options','includeAll','include','rows','rawAttributes','create'];(function(_0x37df6f,_0x51d002){var _0x87e89b=function(_0x4c6db8){while(--_0x4c6db8){_0x37df6f['push'](_0x37df6f['shift']());}};_0x87e89b(++_0x51d002);}(_0x37a7,0x19b));var _0x737a=function(_0x2b5f4e,_0x56194d){_0x2b5f4e=_0x2b5f4e-0x0;var _0x53ca53=_0x37a7[_0x2b5f4e];return _0x53ca53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x737a('0x0'));var zipdir=require(_0x737a('0x1'));var jsonpatch=require(_0x737a('0x2'));var rp=require(_0x737a('0x3'));var moment=require(_0x737a('0x4'));var BPromise=require(_0x737a('0x5'));var Mustache=require('mustache');var util=require(_0x737a('0x6'));var path=require('path');var sox=require(_0x737a('0x7'));var csv=require(_0x737a('0x8'));var ejs=require(_0x737a('0x9'));var fs=require('fs');var fs_extra=require(_0x737a('0xa'));var _=require(_0x737a('0xb'));var squel=require(_0x737a('0xc'));var crypto=require('crypto');var jsforce=require(_0x737a('0xd'));var deskjs=require(_0x737a('0xe'));var toCsv=require(_0x737a('0x8'));var querystring=require('querystring');var Papa=require(_0x737a('0xf'));var Redis=require(_0x737a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x737a('0x11'))(_0x737a('0x12'));var utils=require(_0x737a('0x13'));var config=require(_0x737a('0x14'));var licenseUtil=require(_0x737a('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x737a('0x16'));var client=jayson[_0x737a('0x17')][_0x737a('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1fb783,_0x30cb88,_0x2e4632,_0x1c9a9a){return new BPromise(function(_0x51501f,_0x13d957){var _0x37dcd5=_0x1c9a9a||client;return _0x37dcd5[_0x737a('0x19')](_0x1fb783,_0x2e4632)['then'](function(_0x1d904e){logger[_0x737a('0x1a')](_0x737a('0x1b'),_0x30cb88,_0x737a('0x1c'));logger[_0x737a('0x1d')](_0x737a('0x1e'),_0x30cb88,_0x737a('0x1c'),JSON[_0x737a('0x1f')](_0x1d904e));if(_0x1d904e[_0x737a('0x20')]){if(_0x1d904e[_0x737a('0x20')][_0x737a('0x21')]===0x1f4){logger[_0x737a('0x20')]('VoiceContext,\x20%s,\x20%s',_0x30cb88,_0x1d904e[_0x737a('0x20')][_0x737a('0x22')]);return _0x13d957(_0x1d904e['error']['message']);}logger[_0x737a('0x20')]('VoiceContext,\x20%s,\x20%s',_0x30cb88,_0x1d904e[_0x737a('0x20')][_0x737a('0x22')]);return _0x51501f(_0x1d904e[_0x737a('0x20')][_0x737a('0x22')]);}else{logger[_0x737a('0x1a')](_0x737a('0x1b'),_0x30cb88,'request\x20sent');_0x51501f(_0x1d904e[_0x737a('0x23')][_0x737a('0x22')]);}})[_0x737a('0x24')](function(_0x214f11){logger[_0x737a('0x20')](_0x737a('0x1b'),_0x30cb88,_0x214f11);_0x13d957(_0x214f11);});});}function respondWithStatusCode(_0xee0406,_0x594256){_0x594256=_0x594256||0xcc;return function(_0x12b2fb){if(_0x12b2fb){return _0xee0406['sendStatus'](_0x594256);}return _0xee0406[_0x737a('0x25')](_0x594256)['end']();};}function respondWithResult(_0x197b43,_0x14e536){_0x14e536=_0x14e536||0xc8;return function(_0x1721c8){if(_0x1721c8){return _0x197b43['status'](_0x14e536)[_0x737a('0x26')](_0x1721c8);}};}function respondWithFilteredResult(_0x2daf8d,_0x1bef26){return function(_0x4ca1b4){if(_0x4ca1b4){var _0x216366=typeof _0x1bef26[_0x737a('0x27')]==='undefined'&&typeof _0x1bef26['limit']==='undefined';var _0x2e4e61=_0x4ca1b4[_0x737a('0x28')];var _0x2a67f7=_0x216366?0x0:_0x1bef26['offset'];var _0x337282=_0x216366?_0x4ca1b4[_0x737a('0x28')]:_0x1bef26[_0x737a('0x27')]+_0x1bef26['limit'];var _0x424121;if(_0x337282>=_0x2e4e61){_0x337282=_0x2e4e61;_0x424121=0xc8;}else{_0x424121=0xce;}_0x2daf8d[_0x737a('0x25')](_0x424121);return _0x2daf8d['set']('Content-Range',_0x2a67f7+'-'+_0x337282+'/'+_0x2e4e61)[_0x737a('0x26')](_0x4ca1b4);}return null;};}function patchUpdates(_0x1b8281){return function(_0x58dea1){try{jsonpatch['apply'](_0x58dea1,_0x1b8281,!![]);}catch(_0x308269){return BPromise[_0x737a('0x29')](_0x308269);}return _0x58dea1[_0x737a('0x2a')]();};}function saveUpdates(_0x129f25,_0x468495){return function(_0xe8540f){if(_0xe8540f){return _0xe8540f[_0x737a('0x2b')](_0x129f25)[_0x737a('0x2c')](function(_0xbc4c2){return _0xbc4c2;});}return null;};}function removeEntity(_0x40ee41,_0x292d27){return function(_0x2adf6c){if(_0x2adf6c){return _0x2adf6c['destroy']()['then'](function(){var _0x3d2ff5=_0x2adf6c[_0x737a('0x2d')]({'plain':!![]});var _0x58a932=_0x737a('0x2e');return db[_0x737a('0x2f')][_0x737a('0x30')]({'where':{'type':_0x58a932,'resourceId':_0x3d2ff5['id']}})['then'](function(){return _0x2adf6c;});})[_0x737a('0x2c')](function(){_0x40ee41[_0x737a('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1f26,_0x490963){return function(_0x866eba){if(!_0x866eba){_0x4e1f26['sendStatus'](0x194);}return _0x866eba;};}function handleError(_0x44f67b,_0x17bf2b){_0x17bf2b=_0x17bf2b||0x1f4;return function(_0x461f14){logger['error'](_0x461f14[_0x737a('0x31')]);if(_0x461f14[_0x737a('0x32')]){delete _0x461f14[_0x737a('0x32')];}_0x44f67b['status'](_0x17bf2b)[_0x737a('0x33')](_0x461f14);};}exports['index']=function(_0x4850ec,_0x3492dd){var _0x3013dd={},_0x58e53b={},_0x22c19e={'count':0x0,'rows':[]};var _0x44ff44=_['map'](db[_0x737a('0x34')]['rawAttributes'],function(_0x31b846){return{'name':_0x31b846[_0x737a('0x35')],'type':_0x31b846['type'][_0x737a('0x36')]};});_0x58e53b[_0x737a('0x37')]=_[_0x737a('0x38')](_0x44ff44,_0x737a('0x32'));_0x58e53b[_0x737a('0x39')]=_[_0x737a('0x3a')](_0x4850ec['query']);_0x58e53b[_0x737a('0x3b')]=_['intersection'](_0x58e53b[_0x737a('0x37')],_0x58e53b['query']);_0x3013dd[_0x737a('0x3c')]=_[_0x737a('0x3d')](_0x58e53b[_0x737a('0x37')],qs[_0x737a('0x3e')](_0x4850ec[_0x737a('0x39')][_0x737a('0x3e')]));_0x3013dd[_0x737a('0x3c')]=_0x3013dd[_0x737a('0x3c')][_0x737a('0x3f')]?_0x3013dd[_0x737a('0x3c')]:_0x58e53b[_0x737a('0x37')];if(!_0x4850ec[_0x737a('0x39')][_0x737a('0x40')](_0x737a('0x41'))){_0x3013dd[_0x737a('0x42')]=qs['limit'](_0x4850ec[_0x737a('0x39')][_0x737a('0x42')]);_0x3013dd[_0x737a('0x27')]=qs[_0x737a('0x27')](_0x4850ec[_0x737a('0x39')][_0x737a('0x27')]);}_0x3013dd[_0x737a('0x43')]=qs[_0x737a('0x44')](_0x4850ec[_0x737a('0x39')][_0x737a('0x44')]);_0x3013dd[_0x737a('0x45')]=qs['filters'](_['pick'](_0x4850ec[_0x737a('0x39')],_0x58e53b[_0x737a('0x3b')]),_0x44ff44);if(_0x4850ec[_0x737a('0x39')][_0x737a('0x46')]){_0x3013dd[_0x737a('0x45')]=_[_0x737a('0x47')](_0x3013dd['where'],{'$or':_['map'](_0x44ff44,function(_0x25e875){if(_0x25e875[_0x737a('0x48')]!=='VIRTUAL'){var _0x2037c1={};_0x2037c1[_0x25e875[_0x737a('0x32')]]={'$like':'%'+_0x4850ec[_0x737a('0x39')][_0x737a('0x46')]+'%'};return _0x2037c1;}})});}_0x3013dd=_['merge']({},_0x3013dd,_0x4850ec[_0x737a('0x49')]);var _0x392cfb={'where':_0x3013dd[_0x737a('0x45')]};return db[_0x737a('0x34')][_0x737a('0x28')](_0x392cfb)[_0x737a('0x2c')](function(_0x1e1954){_0x22c19e[_0x737a('0x28')]=_0x1e1954;if(_0x4850ec[_0x737a('0x39')][_0x737a('0x4a')]){_0x3013dd[_0x737a('0x4b')]=[{'all':!![]}];}return db[_0x737a('0x34')]['findAll'](_0x3013dd);})[_0x737a('0x2c')](function(_0x15c990){_0x22c19e[_0x737a('0x4c')]=_0x15c990;return _0x22c19e;})[_0x737a('0x2c')](respondWithFilteredResult(_0x3492dd,_0x3013dd))['catch'](handleError(_0x3492dd,null));};exports['show']=function(_0x1d7e7a,_0x40bac2){var _0x5e3f70={'raw':![],'where':{'id':_0x1d7e7a['params']['id']}},_0x1060a0={};_0x1060a0[_0x737a('0x37')]=_[_0x737a('0x3a')](db[_0x737a('0x34')][_0x737a('0x4d')]);_0x1060a0[_0x737a('0x39')]=_['keys'](_0x1d7e7a[_0x737a('0x39')]);_0x1060a0[_0x737a('0x3b')]=_['intersection'](_0x1060a0['model'],_0x1060a0[_0x737a('0x39')]);_0x5e3f70[_0x737a('0x3c')]=_[_0x737a('0x3d')](_0x1060a0[_0x737a('0x37')],qs[_0x737a('0x3e')](_0x1d7e7a[_0x737a('0x39')][_0x737a('0x3e')]));_0x5e3f70[_0x737a('0x3c')]=_0x5e3f70[_0x737a('0x3c')]['length']?_0x5e3f70[_0x737a('0x3c')]:_0x1060a0[_0x737a('0x37')];if(_0x1d7e7a[_0x737a('0x39')]['includeAll']){_0x5e3f70[_0x737a('0x4b')]=[{'all':!![]}];}_0x5e3f70=_[_0x737a('0x47')]({},_0x5e3f70,_0x1d7e7a[_0x737a('0x49')]);return db[_0x737a('0x34')]['find'](_0x5e3f70)[_0x737a('0x2c')](handleEntityNotFound(_0x40bac2,null))[_0x737a('0x2c')](respondWithResult(_0x40bac2,null))[_0x737a('0x24')](handleError(_0x40bac2,null));};exports[_0x737a('0x4e')]=function(_0x4e0e5b,_0x4e4339,_0x74bf68){var _0x783c17;return db[_0x737a('0x34')]['create'](_0x4e0e5b[_0x737a('0x4f')],{'raw':!![]})[_0x737a('0x2c')](function(_0xb08181){_0x783c17=_0xb08181;return db[_0x737a('0x34')]['findAll']({'raw':!![]});})[_0x737a('0x2c')](function(_0x590a72){var _0x4e4a53=fs[_0x737a('0x50')](path['join'](config['root'],'server/files/templates/context.ejs'),_0x737a('0x51'));var _0x22bf9c=ejs[_0x737a('0x52')](_0x4e4a53,{'contexts':_0x590a72||[]});fs[_0x737a('0x53')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x22bf9c);})[_0x737a('0x2c')](function(){return respondWithRpcPromise(_0x737a('0x54'),'create',{'module':_0x737a('0x55')});})['then'](function(){var _0x43e471=_0x4e0e5b[_0x737a('0x56')]['get']({'plain':!![]});if(!_0x43e471)throw new Error(_0x737a('0x57'));if(_0x43e471[_0x737a('0x58')]==='user'){var _0x422a49=_0x783c17['get']({'plain':!![]});return db[_0x737a('0x59')][_0x737a('0x5a')]({'where':{'name':_0x737a('0x2e'),'userProfileId':_0x43e471['userProfileId']},'raw':!![]})[_0x737a('0x2c')](function(_0x3e1a4b){if(_0x3e1a4b&&_0x3e1a4b['autoAssociation']===0x0){return db[_0x737a('0x2f')][_0x737a('0x4e')]({'name':_0x422a49[_0x737a('0x32')],'resourceId':_0x422a49['id'],'type':_0x3e1a4b[_0x737a('0x32')],'sectionId':_0x3e1a4b['id']},{})[_0x737a('0x2c')](function(){return _0x783c17;});}else{return _0x783c17;}})[_0x737a('0x24')](function(_0x6aa9a2){logger['error'](_0x737a('0x5b'),_0x6aa9a2);throw _0x6aa9a2;});}return _0x783c17;})[_0x737a('0x2c')](respondWithResult(_0x4e4339,0xc9))['catch'](handleError(_0x4e4339,null));};exports[_0x737a('0x2b')]=function(_0x3e4181,_0x2604c4,_0x45373d){var _0x3cb450;return db[_0x737a('0x34')][_0x737a('0x5a')]({'where':{'id':_0x3e4181[_0x737a('0x5c')]['id']}})[_0x737a('0x2c')](handleEntityNotFound(_0x2604c4,null))[_0x737a('0x2c')](saveUpdates(_0x3e4181['body'],null))[_0x737a('0x2c')](function(_0xf5a1cb){if(_0xf5a1cb){_0x3cb450=_0xf5a1cb;return db['VoiceContext']['findAll']({'raw':!![]});}})['then'](function(_0xadcbf){var _0xbbba8c=fs[_0x737a('0x50')](path[_0x737a('0x5d')](config['root'],_0x737a('0x5e')),_0x737a('0x51'));var _0x3cc379=ejs[_0x737a('0x52')](_0xbbba8c,{'contexts':_0xadcbf||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3cc379);})[_0x737a('0x2c')](function(){return respondWithRpcPromise(_0x737a('0x54'),_0x737a('0x2b'),{'module':_0x737a('0x55')});})[_0x737a('0x2c')](function(){return _0x3cb450;})[_0x737a('0x2c')](respondWithResult(_0x2604c4,null))[_0x737a('0x24')](handleError(_0x2604c4,null));};exports[_0x737a('0x30')]=function(_0x5c12c5,_0x41bb3d,_0x53a01d){var _0x13f88c;return db[_0x737a('0x34')][_0x737a('0x5a')]({'where':{'id':_0x5c12c5[_0x737a('0x5c')]['id']}})[_0x737a('0x2c')](handleEntityNotFound(_0x41bb3d,null))[_0x737a('0x2c')](removeEntity(_0x41bb3d,null))['then'](function(){return db['VoiceContext'][_0x737a('0x5f')]({'raw':!![]});})['then'](function(_0x477db3){var _0x4492e7=fs[_0x737a('0x50')](path[_0x737a('0x5d')](config[_0x737a('0x60')],_0x737a('0x5e')),_0x737a('0x51'));var _0x1a46ce=ejs[_0x737a('0x52')](_0x4492e7,{'contexts':_0x477db3});fs[_0x737a('0x53')](_0x737a('0x61'),_0x1a46ce);return respondWithRpcPromise('Reload',_0x737a('0x30'),{'module':_0x737a('0x55')});})['catch'](handleError(_0x41bb3d,null));}; \ No newline at end of file +var _0x223e=['root','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','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','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','readFileSync'];(function(_0x333f55,_0x21a0fe){var _0x3c277d=function(_0x33ee26){while(--_0x33ee26){_0x333f55['push'](_0x333f55['shift']());}};_0x3c277d(++_0x21a0fe);}(_0x223e,0x196));var _0xe223=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x223e[_0x2cc0b3];return _0x1667ef;};'use strict';var emlformat=require(_0xe223('0x0'));var rimraf=require(_0xe223('0x1'));var zipdir=require(_0xe223('0x2'));var jsonpatch=require(_0xe223('0x3'));var rp=require(_0xe223('0x4'));var moment=require('moment');var BPromise=require(_0xe223('0x5'));var Mustache=require('mustache');var util=require(_0xe223('0x6'));var path=require('path');var sox=require(_0xe223('0x7'));var csv=require(_0xe223('0x8'));var ejs=require(_0xe223('0x9'));var fs=require('fs');var fs_extra=require(_0xe223('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe223('0xb'));var deskjs=require(_0xe223('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe223('0xd'));var Papa=require('papaparse');var Redis=require(_0xe223('0xe'));var authService=require(_0xe223('0xf'));var qs=require(_0xe223('0x10'));var as=require(_0xe223('0x11'));var hardwareService=require(_0xe223('0x12'));var logger=require(_0xe223('0x13'))(_0xe223('0x14'));var utils=require(_0xe223('0x15'));var config=require(_0xe223('0x16'));var licenseUtil=require(_0xe223('0x17'));var db=require(_0xe223('0x18'))['db'];var jayson=require(_0xe223('0x19'));var client=jayson['client'][_0xe223('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x366d62,_0x33f1de,_0x3d4085,_0x2e32e2){return new BPromise(function(_0x34c5cd,_0x252b20){var _0x5a533a=_0x2e32e2||client;return _0x5a533a['request'](_0x366d62,_0x3d4085)[_0xe223('0x1b')](function(_0x17956e){logger[_0xe223('0x1c')](_0xe223('0x1d'),_0x33f1de,_0xe223('0x1e'));logger[_0xe223('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x33f1de,_0xe223('0x1e'),JSON['stringify'](_0x17956e));if(_0x17956e[_0xe223('0x20')]){if(_0x17956e[_0xe223('0x20')][_0xe223('0x21')]===0x1f4){logger[_0xe223('0x20')](_0xe223('0x1d'),_0x33f1de,_0x17956e[_0xe223('0x20')]['message']);return _0x252b20(_0x17956e[_0xe223('0x20')][_0xe223('0x22')]);}logger[_0xe223('0x20')](_0xe223('0x1d'),_0x33f1de,_0x17956e[_0xe223('0x20')][_0xe223('0x22')]);return _0x34c5cd(_0x17956e[_0xe223('0x20')][_0xe223('0x22')]);}else{logger[_0xe223('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x33f1de,_0xe223('0x1e'));_0x34c5cd(_0x17956e[_0xe223('0x23')][_0xe223('0x22')]);}})[_0xe223('0x24')](function(_0x26a666){logger[_0xe223('0x20')](_0xe223('0x1d'),_0x33f1de,_0x26a666);_0x252b20(_0x26a666);});});}function respondWithStatusCode(_0xbd49b1,_0x1bdd9f){_0x1bdd9f=_0x1bdd9f||0xcc;return function(_0x2b201e){if(_0x2b201e){return _0xbd49b1['sendStatus'](_0x1bdd9f);}return _0xbd49b1[_0xe223('0x25')](_0x1bdd9f)[_0xe223('0x26')]();};}function respondWithResult(_0x35261c,_0x187b86){_0x187b86=_0x187b86||0xc8;return function(_0x509618){if(_0x509618){return _0x35261c[_0xe223('0x25')](_0x187b86)[_0xe223('0x27')](_0x509618);}};}function respondWithFilteredResult(_0x54fca6,_0x14d87e){return function(_0x9ad0b7){if(_0x9ad0b7){var _0x3750ed=typeof _0x14d87e[_0xe223('0x28')]===_0xe223('0x29')&&typeof _0x14d87e[_0xe223('0x2a')]===_0xe223('0x29');var _0xa365bb=_0x9ad0b7[_0xe223('0x2b')];var _0x5178b4=_0x3750ed?0x0:_0x14d87e[_0xe223('0x28')];var _0x18cf70=_0x3750ed?_0x9ad0b7[_0xe223('0x2b')]:_0x14d87e[_0xe223('0x28')]+_0x14d87e[_0xe223('0x2a')];var _0x37b4b7;if(_0x18cf70>=_0xa365bb){_0x18cf70=_0xa365bb;_0x37b4b7=0xc8;}else{_0x37b4b7=0xce;}_0x54fca6[_0xe223('0x25')](_0x37b4b7);return _0x54fca6['set']('Content-Range',_0x5178b4+'-'+_0x18cf70+'/'+_0xa365bb)[_0xe223('0x27')](_0x9ad0b7);}return null;};}function patchUpdates(_0xa5e3b2){return function(_0x236ba0){try{jsonpatch[_0xe223('0x2c')](_0x236ba0,_0xa5e3b2,!![]);}catch(_0x2b403f){return BPromise[_0xe223('0x2d')](_0x2b403f);}return _0x236ba0[_0xe223('0x2e')]();};}function saveUpdates(_0x4049f2,_0x35572b){return function(_0x3abfde){if(_0x3abfde){return _0x3abfde[_0xe223('0x2f')](_0x4049f2)[_0xe223('0x1b')](function(_0x26459b){return _0x26459b;});}return null;};}function removeEntity(_0x2cd068,_0x593286){return function(_0x5194a8){if(_0x5194a8){return _0x5194a8[_0xe223('0x30')]()[_0xe223('0x1b')](function(){var _0x88bf20=_0x5194a8[_0xe223('0x31')]({'plain':!![]});var _0x1f8f25=_0xe223('0x32');return db[_0xe223('0x33')]['destroy']({'where':{'type':_0x1f8f25,'resourceId':_0x88bf20['id']}})[_0xe223('0x1b')](function(){return _0x5194a8;});})[_0xe223('0x1b')](function(){_0x2cd068[_0xe223('0x25')](0xcc)[_0xe223('0x26')]();});}};}function handleEntityNotFound(_0x2945a8,_0x90335a){return function(_0x111d15){if(!_0x111d15){_0x2945a8[_0xe223('0x34')](0x194);}return _0x111d15;};}function handleError(_0x19785a,_0x42c526){_0x42c526=_0x42c526||0x1f4;return function(_0x4b8623){logger[_0xe223('0x20')](_0x4b8623[_0xe223('0x35')]);if(_0x4b8623[_0xe223('0x36')]){delete _0x4b8623['name'];}_0x19785a[_0xe223('0x25')](_0x42c526)[_0xe223('0x37')](_0x4b8623);};}exports[_0xe223('0x38')]=function(_0x4d94e8,_0x35b2a1){var _0x3daf85={},_0x38d38b={},_0x4eda92={'count':0x0,'rows':[]};var _0x7fc99b=_['map'](db[_0xe223('0x39')][_0xe223('0x3a')],function(_0x105c4f){return{'name':_0x105c4f[_0xe223('0x3b')],'type':_0x105c4f[_0xe223('0x3c')]['key']};});_0x38d38b[_0xe223('0x3d')]=_[_0xe223('0x3e')](_0x7fc99b,_0xe223('0x36'));_0x38d38b[_0xe223('0x3f')]=_[_0xe223('0x40')](_0x4d94e8[_0xe223('0x3f')]);_0x38d38b[_0xe223('0x41')]=_[_0xe223('0x42')](_0x38d38b['model'],_0x38d38b['query']);_0x3daf85[_0xe223('0x43')]=_[_0xe223('0x42')](_0x38d38b[_0xe223('0x3d')],qs[_0xe223('0x44')](_0x4d94e8['query'][_0xe223('0x44')]));_0x3daf85[_0xe223('0x43')]=_0x3daf85[_0xe223('0x43')][_0xe223('0x45')]?_0x3daf85[_0xe223('0x43')]:_0x38d38b[_0xe223('0x3d')];if(!_0x4d94e8[_0xe223('0x3f')][_0xe223('0x46')]('nolimit')){_0x3daf85['limit']=qs[_0xe223('0x2a')](_0x4d94e8[_0xe223('0x3f')][_0xe223('0x2a')]);_0x3daf85[_0xe223('0x28')]=qs[_0xe223('0x28')](_0x4d94e8[_0xe223('0x3f')]['offset']);}_0x3daf85[_0xe223('0x47')]=qs[_0xe223('0x48')](_0x4d94e8['query'][_0xe223('0x48')]);_0x3daf85['where']=qs[_0xe223('0x41')](_['pick'](_0x4d94e8['query'],_0x38d38b['filters']),_0x7fc99b);if(_0x4d94e8['query'][_0xe223('0x49')]){_0x3daf85[_0xe223('0x4a')]=_[_0xe223('0x4b')](_0x3daf85['where'],{'$or':_[_0xe223('0x3e')](_0x7fc99b,function(_0x2f5beb){if(_0x2f5beb['type']!==_0xe223('0x4c')){var _0x133272={};_0x133272[_0x2f5beb['name']]={'$like':'%'+_0x4d94e8['query']['filter']+'%'};return _0x133272;}})});}_0x3daf85=_[_0xe223('0x4b')]({},_0x3daf85,_0x4d94e8[_0xe223('0x4d')]);var _0x1da6c2={'where':_0x3daf85[_0xe223('0x4a')]};return db['VoiceContext']['count'](_0x1da6c2)[_0xe223('0x1b')](function(_0x42e288){_0x4eda92['count']=_0x42e288;if(_0x4d94e8['query'][_0xe223('0x4e')]){_0x3daf85[_0xe223('0x4f')]=[{'all':!![]}];}return db[_0xe223('0x39')][_0xe223('0x50')](_0x3daf85);})['then'](function(_0xbc91ad){_0x4eda92[_0xe223('0x51')]=_0xbc91ad;return _0x4eda92;})['then'](respondWithFilteredResult(_0x35b2a1,_0x3daf85))[_0xe223('0x24')](handleError(_0x35b2a1,null));};exports['show']=function(_0x5731b7,_0x4f257c){var _0x4eee80={'raw':![],'where':{'id':_0x5731b7[_0xe223('0x52')]['id']}},_0x19952b={};_0x19952b[_0xe223('0x3d')]=_[_0xe223('0x40')](db['VoiceContext'][_0xe223('0x3a')]);_0x19952b[_0xe223('0x3f')]=_[_0xe223('0x40')](_0x5731b7[_0xe223('0x3f')]);_0x19952b[_0xe223('0x41')]=_['intersection'](_0x19952b[_0xe223('0x3d')],_0x19952b['query']);_0x4eee80['attributes']=_[_0xe223('0x42')](_0x19952b[_0xe223('0x3d')],qs['fields'](_0x5731b7[_0xe223('0x3f')]['fields']));_0x4eee80[_0xe223('0x43')]=_0x4eee80[_0xe223('0x43')]['length']?_0x4eee80[_0xe223('0x43')]:_0x19952b[_0xe223('0x3d')];if(_0x5731b7[_0xe223('0x3f')][_0xe223('0x4e')]){_0x4eee80[_0xe223('0x4f')]=[{'all':!![]}];}_0x4eee80=_[_0xe223('0x4b')]({},_0x4eee80,_0x5731b7['options']);return db[_0xe223('0x39')][_0xe223('0x53')](_0x4eee80)[_0xe223('0x1b')](handleEntityNotFound(_0x4f257c,null))['then'](respondWithResult(_0x4f257c,null))[_0xe223('0x24')](handleError(_0x4f257c,null));};exports['create']=function(_0x5be24b,_0x241da2,_0x5dea0f){var _0x4bd2e3;return db[_0xe223('0x39')][_0xe223('0x54')](_0x5be24b[_0xe223('0x55')],{'raw':!![]})['then'](function(_0x1cc69d){_0x4bd2e3=_0x1cc69d;return db[_0xe223('0x39')][_0xe223('0x50')]({'raw':!![]});})[_0xe223('0x1b')](function(_0x3599e9){var _0x45519a=fs['readFileSync'](path[_0xe223('0x56')](config['root'],_0xe223('0x57')),_0xe223('0x58'));var _0x4f7c9f=ejs[_0xe223('0x59')](_0x45519a,{'contexts':_0x3599e9||[]});fs['writeFileSync'](_0xe223('0x5a'),_0x4f7c9f);})[_0xe223('0x1b')](function(){return respondWithRpcPromise(_0xe223('0x5b'),_0xe223('0x54'),{'module':_0xe223('0x5c')});})[_0xe223('0x1b')](function(){var _0x4a800e=_0x5be24b[_0xe223('0x5d')][_0xe223('0x31')]({'plain':!![]});if(!_0x4a800e)throw new Error(_0xe223('0x5e'));if(_0x4a800e[_0xe223('0x5f')]===_0xe223('0x5d')){var _0x208024=_0x4bd2e3[_0xe223('0x31')]({'plain':!![]});return db[_0xe223('0x60')][_0xe223('0x53')]({'where':{'name':_0xe223('0x32'),'userProfileId':_0x4a800e['userProfileId']},'raw':!![]})[_0xe223('0x1b')](function(_0x3b951c){if(_0x3b951c&&_0x3b951c[_0xe223('0x61')]===0x0){return db[_0xe223('0x33')][_0xe223('0x54')]({'name':_0x208024[_0xe223('0x36')],'resourceId':_0x208024['id'],'type':_0x3b951c[_0xe223('0x36')],'sectionId':_0x3b951c['id']},{})[_0xe223('0x1b')](function(){return _0x4bd2e3;});}else{return _0x4bd2e3;}})[_0xe223('0x24')](function(_0x1f28c4){logger[_0xe223('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f28c4);throw _0x1f28c4;});}return _0x4bd2e3;})[_0xe223('0x1b')](respondWithResult(_0x241da2,0xc9))[_0xe223('0x24')](handleError(_0x241da2,null));};exports[_0xe223('0x2f')]=function(_0x1b9124,_0x41e81c,_0x21de33){var _0x167c3b;return db['VoiceContext'][_0xe223('0x53')]({'where':{'id':_0x1b9124[_0xe223('0x52')]['id']}})[_0xe223('0x1b')](handleEntityNotFound(_0x41e81c,null))[_0xe223('0x1b')](saveUpdates(_0x1b9124[_0xe223('0x55')],null))['then'](function(_0x49d464){if(_0x49d464){_0x167c3b=_0x49d464;return db['VoiceContext'][_0xe223('0x50')]({'raw':!![]});}})[_0xe223('0x1b')](function(_0x46bd71){var _0x43cdb3=fs[_0xe223('0x62')](path[_0xe223('0x56')](config[_0xe223('0x63')],_0xe223('0x57')),_0xe223('0x58'));var _0xaf35df=ejs[_0xe223('0x59')](_0x43cdb3,{'contexts':_0x46bd71||[]});fs[_0xe223('0x64')](_0xe223('0x5a'),_0xaf35df);})[_0xe223('0x1b')](function(){return respondWithRpcPromise('Reload',_0xe223('0x2f'),{'module':_0xe223('0x5c')});})[_0xe223('0x1b')](function(){return _0x167c3b;})[_0xe223('0x1b')](respondWithResult(_0x41e81c,null))[_0xe223('0x24')](handleError(_0x41e81c,null));};exports[_0xe223('0x30')]=function(_0x4ab30c,_0x1ce455,_0x70e0cd){var _0x31e986;return db[_0xe223('0x39')]['find']({'where':{'id':_0x4ab30c[_0xe223('0x52')]['id']}})[_0xe223('0x1b')](handleEntityNotFound(_0x1ce455,null))[_0xe223('0x1b')](removeEntity(_0x1ce455,null))[_0xe223('0x1b')](function(){return db[_0xe223('0x39')][_0xe223('0x50')]({'raw':!![]});})[_0xe223('0x1b')](function(_0x39d399){var _0x174729=fs[_0xe223('0x62')](path[_0xe223('0x56')](config[_0xe223('0x63')],_0xe223('0x57')),'utf8');var _0x129d15=ejs['render'](_0x174729,{'contexts':_0x39d399});fs[_0xe223('0x64')](_0xe223('0x5a'),_0x129d15);return respondWithRpcPromise(_0xe223('0x5b'),_0xe223('0x30'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1ce455,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index aa8016d..a160c2d 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 _0xc102=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceContext.attributes','exports','define','VoiceContext','lodash'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xc102,0x77));var _0x2c10=function(_0x4fd504,_0x19775b){_0x4fd504=_0x4fd504-0x0;var _0x1e6977=_0xc102[_0x4fd504];return _0x1e6977;};'use strict';var _=require(_0x2c10('0x0'));var util=require(_0x2c10('0x1'));var logger=require(_0x2c10('0x2'))(_0x2c10('0x3'));var moment=require(_0x2c10('0x4'));var BPromise=require(_0x2c10('0x5'));var rp=require(_0x2c10('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c10('0x7'));var config=require('../../config/environment');var attributes=require(_0x2c10('0x8'));module[_0x2c10('0x9')]=function(_0x35d33f,_0x59e5d5){return _0x35d33f[_0x2c10('0xa')](_0x2c10('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1775=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts'];(function(_0x1d84ca,_0x5a8f65){var _0x5da690=function(_0x5d0340){while(--_0x5d0340){_0x1d84ca['push'](_0x1d84ca['shift']());}};_0x5da690(++_0x5a8f65);}(_0x1775,0xfa));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5177('0x0'));var util=require('util');var logger=require(_0x5177('0x1'))('api');var moment=require(_0x5177('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5177('0x3'));var rimraf=require(_0x5177('0x4'));var config=require(_0x5177('0x5'));var attributes=require(_0x5177('0x6'));module['exports']=function(_0x1c0e66,_0x75bb82){return _0x1c0e66[_0x5177('0x7')](_0x5177('0x8'),attributes,{'tableName':_0x5177('0x9'),'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 5d98c06..f19e660 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 _0x2868=['message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x10a467,_0x4f75be){var _0x39bcbb=function(_0x1359ec){while(--_0x1359ec){_0x10a467['push'](_0x10a467['shift']());}};_0x39bcbb(++_0x4f75be);}(_0x2868,0x191));var _0x8286=function(_0x587a94,_0x4fdf1e){_0x587a94=_0x587a94-0x0;var _0x56b3c3=_0x2868[_0x587a94];return _0x56b3c3;};'use strict';var _=require(_0x8286('0x0'));var util=require('util');var moment=require(_0x8286('0x1'));var BPromise=require(_0x8286('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8286('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8286('0x4'));var logger=require('../../config/logger')(_0x8286('0x5'));var config=require(_0x8286('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8286('0x7')][_0x8286('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c9b6c,_0x118d0e,_0x5be220){return new BPromise(function(_0x267cf4,_0x2310b1){return client[_0x8286('0x9')](_0x2c9b6c,_0x5be220)[_0x8286('0xa')](function(_0x71c096){logger[_0x8286('0xb')](_0x8286('0xc'),_0x118d0e,'request\x20sent');logger[_0x8286('0xd')](_0x8286('0xe'),_0x118d0e,_0x8286('0xf'),JSON[_0x8286('0x10')](_0x71c096));if(_0x71c096[_0x8286('0x11')]){if(_0x71c096[_0x8286('0x11')][_0x8286('0x12')]===0x1f4){logger[_0x8286('0x11')](_0x8286('0xc'),_0x118d0e,_0x71c096['error'][_0x8286('0x13')]);return _0x2310b1(_0x71c096[_0x8286('0x11')][_0x8286('0x13')]);}logger[_0x8286('0x11')](_0x8286('0xc'),_0x118d0e,_0x71c096[_0x8286('0x11')]['message']);return _0x267cf4(_0x71c096['error'][_0x8286('0x13')]);}else{logger[_0x8286('0xb')](_0x8286('0xc'),_0x118d0e,'request\x20sent');_0x267cf4(_0x71c096['result'][_0x8286('0x13')]);}})[_0x8286('0x14')](function(_0x202a6e){logger[_0x8286('0x11')](_0x8286('0xc'),_0x118d0e,_0x202a6e);_0x2310b1(_0x202a6e);});});} \ No newline at end of file +var _0x62ba=['jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4f829c,_0x4186bd){var _0x255f7c=function(_0x98254a){while(--_0x98254a){_0x4f829c['push'](_0x4f829c['shift']());}};_0x255f7c(++_0x4186bd);}(_0x62ba,0x1cd));var _0xa62b=function(_0x443f0b,_0x264807){_0x443f0b=_0x443f0b-0x0;var _0x5bc435=_0x62ba[_0x443f0b];return _0x5bc435;};'use strict';var _=require(_0xa62b('0x0'));var util=require('util');var moment=require(_0xa62b('0x1'));var BPromise=require(_0xa62b('0x2'));var rs=require(_0xa62b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa62b('0x4'));var logger=require(_0xa62b('0x5'))('rpc');var config=require(_0xa62b('0x6'));var jayson=require(_0xa62b('0x7'));var client=jayson[_0xa62b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x152244,_0xfaffb6,_0x8aadd3){return new BPromise(function(_0x1c400b,_0x43fe74){return client[_0xa62b('0x9')](_0x152244,_0x8aadd3)[_0xa62b('0xa')](function(_0x52999a){logger[_0xa62b('0xb')](_0xa62b('0xc'),_0xfaffb6,_0xa62b('0xd'));logger[_0xa62b('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xfaffb6,_0xa62b('0xd'),JSON['stringify'](_0x52999a));if(_0x52999a[_0xa62b('0xf')]){if(_0x52999a[_0xa62b('0xf')][_0xa62b('0x10')]===0x1f4){logger['error'](_0xa62b('0xc'),_0xfaffb6,_0x52999a['error'][_0xa62b('0x11')]);return _0x43fe74(_0x52999a['error'][_0xa62b('0x11')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0xfaffb6,_0x52999a[_0xa62b('0xf')]['message']);return _0x1c400b(_0x52999a[_0xa62b('0xf')][_0xa62b('0x11')]);}else{logger['info'](_0xa62b('0xc'),_0xfaffb6,'request\x20sent');_0x1c400b(_0x52999a['result'][_0xa62b('0x11')]);}})['catch'](function(_0x4b1e2d){logger[_0xa62b('0xf')](_0xa62b('0xc'),_0xfaffb6,_0x4b1e2d);_0x43fe74(_0x4b1e2d);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 522fcd7..4c1658a 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 _0xe3c9=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','/describe','get','/:id','show','post','create','update','destroy','util','connect-timeout','express'];(function(_0x3075b6,_0x1890ee){var _0xc01c0=function(_0x47302c){while(--_0x47302c){_0x3075b6['push'](_0x3075b6['shift']());}};_0xc01c0(++_0x1890ee);}(_0xe3c9,0x1ad));var _0x9e3c=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xe3c9[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require('multer');var util=require(_0x9e3c('0x0'));var path=require('path');var timeout=require(_0x9e3c('0x1'));var express=require(_0x9e3c('0x2'));var router=express[_0x9e3c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9e3c('0x4'));var interaction=require(_0x9e3c('0x5'));var config=require(_0x9e3c('0x6'));var controller=require(_0x9e3c('0x7'));router['get']('/',auth[_0x9e3c('0x8')](),controller[_0x9e3c('0x9')]);router['get'](_0x9e3c('0xa'),auth[_0x9e3c('0x8')](),controller['describe']);router[_0x9e3c('0xb')](_0x9e3c('0xc'),auth['isAuthenticated'](),controller[_0x9e3c('0xd')]);router[_0x9e3c('0xe')]('/',auth['isAuthenticated'](),controller[_0x9e3c('0xf')]);router['put']('/:id',auth[_0x9e3c('0x8')](),controller[_0x9e3c('0x10')]);router['delete'](_0x9e3c('0xc'),auth[_0x9e3c('0x8')](),controller[_0x9e3c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x833b=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','util'];(function(_0x4930ab,_0x276fa5){var _0x24958=function(_0x27d34b){while(--_0x27d34b){_0x4930ab['push'](_0x4930ab['shift']());}};_0x24958(++_0x276fa5);}(_0x833b,0x131));var _0xb833=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x833b[_0x22b68a];return _0x1ac67a;};'use strict';var multer=require('multer');var util=require(_0xb833('0x0'));var path=require('path');var timeout=require(_0xb833('0x1'));var express=require('express');var router=express[_0xb833('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb833('0x3'));var interaction=require(_0xb833('0x4'));var config=require(_0xb833('0x5'));var controller=require(_0xb833('0x6'));router[_0xb833('0x7')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x9')]);router['get'](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0xb')]);router[_0xb833('0x7')](_0xb833('0xc'),auth[_0xb833('0x8')](),controller[_0xb833('0xd')]);router['post']('/',auth[_0xb833('0x8')](),controller['create']);router[_0xb833('0xe')](_0xb833('0xc'),auth[_0xb833('0x8')](),controller[_0xb833('0xf')]);router['delete']('/:id',auth[_0xb833('0x8')](),controller[_0xb833('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index b0ac3fb..ef05000 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(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x54ef,0x112));var _0xf54e=function(_0x4aa5ae,_0x37b8f0){_0x4aa5ae=_0x4aa5ae-0x0;var _0x22a0a6=_0x54ef[_0x4aa5ae];return _0x22a0a6;};'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 _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x481ec4,_0x3444a6){var _0x286126=function(_0x16ac5c){while(--_0x16ac5c){_0x481ec4['push'](_0x481ec4['shift']());}};_0x286126(++_0x3444a6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x141543,_0x149f05){_0x141543=_0x141543-0x0;var _0x56462c=_0x8d0e[_0x141543];return _0x56462c;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index e3943e7..0103556 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 _0x54fd=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','VoiceDialReport','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','destroy','describe','rimraf','fast-json-patch','moment','bluebird','util','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x54fd,0xd2));var _0xd54f=function(_0x2647b4,_0x573222){_0x2647b4=_0x2647b4-0x0;var _0x37fd2e=_0x54fd[_0x2647b4];return _0x37fd2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd54f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd54f('0x1'));var rp=require('request-promise');var moment=require(_0xd54f('0x2'));var BPromise=require(_0xd54f('0x3'));var Mustache=require('mustache');var util=require(_0xd54f('0x4'));var path=require(_0xd54f('0x5'));var sox=require(_0xd54f('0x6'));var csv=require(_0xd54f('0x7'));var ejs=require(_0xd54f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd54f('0x9'));var squel=require(_0xd54f('0xa'));var crypto=require(_0xd54f('0xb'));var jsforce=require(_0xd54f('0xc'));var deskjs=require(_0xd54f('0xd'));var toCsv=require(_0xd54f('0x7'));var querystring=require('querystring');var Papa=require(_0xd54f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd54f('0xf'));var hardwareService=require(_0xd54f('0x10'));var logger=require(_0xd54f('0x11'))(_0xd54f('0x12'));var utils=require('../../config/utils');var config=require(_0xd54f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d6daa,_0x14a05c){_0x14a05c=_0x14a05c||0xcc;return function(_0x2dff59){if(_0x2dff59){return _0x3d6daa['sendStatus'](_0x14a05c);}return _0x3d6daa['status'](_0x14a05c)[_0xd54f('0x14')]();};}function respondWithResult(_0x1bd14f,_0x2086dd){_0x2086dd=_0x2086dd||0xc8;return function(_0x9c77a2){if(_0x9c77a2){return _0x1bd14f[_0xd54f('0x15')](_0x2086dd)[_0xd54f('0x16')](_0x9c77a2);}};}function respondWithFilteredResult(_0x33b1ea,_0x4fc28e){return function(_0x1f59dd){if(_0x1f59dd){var _0x6e6bdc=typeof _0x4fc28e[_0xd54f('0x17')]==='undefined'&&typeof _0x4fc28e[_0xd54f('0x18')]===_0xd54f('0x19');var _0x3536b4=_0x1f59dd['count'];var _0x4499d6=_0x6e6bdc?0x0:_0x4fc28e[_0xd54f('0x17')];var _0x188f32=_0x6e6bdc?_0x1f59dd[_0xd54f('0x1a')]:_0x4fc28e[_0xd54f('0x17')]+_0x4fc28e[_0xd54f('0x18')];var _0x231f56;if(_0x188f32>=_0x3536b4){_0x188f32=_0x3536b4;_0x231f56=0xc8;}else{_0x231f56=0xce;}_0x33b1ea[_0xd54f('0x15')](_0x231f56);return _0x33b1ea[_0xd54f('0x1b')](_0xd54f('0x1c'),_0x4499d6+'-'+_0x188f32+'/'+_0x3536b4)[_0xd54f('0x16')](_0x1f59dd);}return null;};}function patchUpdates(_0x290cc1){return function(_0x101cc0){try{jsonpatch[_0xd54f('0x1d')](_0x101cc0,_0x290cc1,!![]);}catch(_0x3f7e55){return BPromise[_0xd54f('0x1e')](_0x3f7e55);}return _0x101cc0['save']();};}function saveUpdates(_0x21bdd4,_0x15e50f){return function(_0x49f9f7){if(_0x49f9f7){return _0x49f9f7[_0xd54f('0x1f')](_0x21bdd4)[_0xd54f('0x20')](function(_0x51f822){return _0x51f822;});}return null;};}function removeEntity(_0x53abcb,_0x2449bb){return function(_0x4b9310){if(_0x4b9310){return _0x4b9310['destroy']()[_0xd54f('0x20')](function(){_0x53abcb[_0xd54f('0x15')](0xcc)[_0xd54f('0x14')]();});}};}function handleEntityNotFound(_0x4cf99a,_0x4eadf6){return function(_0x11489b){if(!_0x11489b){_0x4cf99a[_0xd54f('0x21')](0x194);}return _0x11489b;};}function handleError(_0x4bbbb2,_0x51a8d6){_0x51a8d6=_0x51a8d6||0x1f4;return function(_0x43569c){logger[_0xd54f('0x22')](_0x43569c[_0xd54f('0x23')]);if(_0x43569c['name']){delete _0x43569c[_0xd54f('0x24')];}_0x4bbbb2['status'](_0x51a8d6)[_0xd54f('0x25')](_0x43569c);};}exports[_0xd54f('0x26')]=function(_0x1dfc2f,_0x2c50ff){var _0x3e3b46={},_0x41d20c={},_0xe98b65={'count':0x0,'rows':[]};var _0x1ed350=_[_0xd54f('0x27')](db[_0xd54f('0x28')]['rawAttributes'],function(_0x7d6fae){return{'name':_0x7d6fae[_0xd54f('0x29')],'type':_0x7d6fae[_0xd54f('0x2a')]['key']};});_0x41d20c[_0xd54f('0x2b')]=_['map'](_0x1ed350,'name');_0x41d20c[_0xd54f('0x2c')]=_[_0xd54f('0x2d')](_0x1dfc2f[_0xd54f('0x2c')]);_0x41d20c['filters']=_[_0xd54f('0x2e')](_0x41d20c[_0xd54f('0x2b')],_0x41d20c[_0xd54f('0x2c')]);_0x3e3b46[_0xd54f('0x2f')]=_[_0xd54f('0x2e')](_0x41d20c[_0xd54f('0x2b')],qs[_0xd54f('0x30')](_0x1dfc2f[_0xd54f('0x2c')]['fields']));_0x3e3b46['attributes']=_0x3e3b46[_0xd54f('0x2f')]['length']?_0x3e3b46['attributes']:_0x41d20c['model'];if(!_0x1dfc2f[_0xd54f('0x2c')][_0xd54f('0x31')](_0xd54f('0x32'))){_0x3e3b46[_0xd54f('0x18')]=qs[_0xd54f('0x18')](_0x1dfc2f['query'][_0xd54f('0x18')]);_0x3e3b46[_0xd54f('0x17')]=qs['offset'](_0x1dfc2f['query'][_0xd54f('0x17')]);}_0x3e3b46[_0xd54f('0x33')]=qs[_0xd54f('0x34')](_0x1dfc2f['query']['sort']);_0x3e3b46[_0xd54f('0x35')]=qs['filters'](_['pick'](_0x1dfc2f[_0xd54f('0x2c')],_0x41d20c[_0xd54f('0x36')]),_0x1ed350);if(_0x1dfc2f[_0xd54f('0x2c')][_0xd54f('0x37')]){_0x3e3b46['where']=_[_0xd54f('0x38')](_0x3e3b46[_0xd54f('0x35')],{'$or':_[_0xd54f('0x27')](_0x1ed350,function(_0xd6385){if(_0xd6385['type']!=='VIRTUAL'){var _0x40176a={};_0x40176a[_0xd6385['name']]={'$like':'%'+_0x1dfc2f['query'][_0xd54f('0x37')]+'%'};return _0x40176a;}})});}_0x3e3b46=_['merge']({},_0x3e3b46,_0x1dfc2f[_0xd54f('0x39')]);var _0x466b8c={'where':_0x3e3b46['where']};return db[_0xd54f('0x28')][_0xd54f('0x1a')](_0x466b8c)['then'](function(_0x23e132){_0xe98b65['count']=_0x23e132;if(_0x1dfc2f['query']['includeAll']){_0x3e3b46[_0xd54f('0x3a')]=[{'all':!![]}];}return db[_0xd54f('0x28')][_0xd54f('0x3b')](_0x3e3b46);})[_0xd54f('0x20')](function(_0x235f6a){_0xe98b65[_0xd54f('0x3c')]=_0x235f6a;return _0xe98b65;})[_0xd54f('0x20')](respondWithFilteredResult(_0x2c50ff,_0x3e3b46))[_0xd54f('0x3d')](handleError(_0x2c50ff,null));};exports[_0xd54f('0x3e')]=function(_0x182f85,_0x2366d1){var _0x11d10f={'raw':!![],'where':{'id':_0x182f85[_0xd54f('0x3f')]['id']}},_0x39b612={};_0x39b612['model']=_[_0xd54f('0x2d')](db[_0xd54f('0x28')][_0xd54f('0x40')]);_0x39b612[_0xd54f('0x2c')]=_[_0xd54f('0x2d')](_0x182f85[_0xd54f('0x2c')]);_0x39b612[_0xd54f('0x36')]=_[_0xd54f('0x2e')](_0x39b612[_0xd54f('0x2b')],_0x39b612[_0xd54f('0x2c')]);_0x11d10f[_0xd54f('0x2f')]=_['intersection'](_0x39b612[_0xd54f('0x2b')],qs['fields'](_0x182f85[_0xd54f('0x2c')][_0xd54f('0x30')]));_0x11d10f[_0xd54f('0x2f')]=_0x11d10f[_0xd54f('0x2f')][_0xd54f('0x41')]?_0x11d10f[_0xd54f('0x2f')]:_0x39b612[_0xd54f('0x2b')];if(_0x182f85[_0xd54f('0x2c')][_0xd54f('0x42')]){_0x11d10f[_0xd54f('0x3a')]=[{'all':!![]}];}_0x11d10f=_['merge']({},_0x11d10f,_0x182f85[_0xd54f('0x39')]);return db[_0xd54f('0x28')][_0xd54f('0x43')](_0x11d10f)[_0xd54f('0x20')](handleEntityNotFound(_0x2366d1,null))[_0xd54f('0x20')](respondWithResult(_0x2366d1,null))[_0xd54f('0x3d')](handleError(_0x2366d1,null));};exports[_0xd54f('0x44')]=function(_0x2fc5f7,_0x1f8df0){return db[_0xd54f('0x28')][_0xd54f('0x44')](_0x2fc5f7[_0xd54f('0x45')],{})[_0xd54f('0x20')](respondWithResult(_0x1f8df0,0xc9))[_0xd54f('0x3d')](handleError(_0x1f8df0,null));};exports[_0xd54f('0x1f')]=function(_0x376f4e,_0x1da54d){if(_0x376f4e[_0xd54f('0x45')]['id']){delete _0x376f4e[_0xd54f('0x45')]['id'];}return db[_0xd54f('0x28')][_0xd54f('0x43')]({'where':{'id':_0x376f4e[_0xd54f('0x3f')]['id']}})[_0xd54f('0x20')](handleEntityNotFound(_0x1da54d,null))[_0xd54f('0x20')](saveUpdates(_0x376f4e[_0xd54f('0x45')],null))['then'](respondWithResult(_0x1da54d,null))['catch'](handleError(_0x1da54d,null));};exports[_0xd54f('0x46')]=function(_0x582b40,_0x4d056e){return db[_0xd54f('0x28')][_0xd54f('0x43')]({'where':{'id':_0x582b40[_0xd54f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4d056e,null))[_0xd54f('0x20')](removeEntity(_0x4d056e,null))[_0xd54f('0x3d')](handleError(_0x4d056e,null));};exports['describe']=function(_0xf9000a,_0xb47c1b){return db[_0xd54f('0x28')][_0xd54f('0x47')]()[_0xd54f('0x20')](respondWithResult(_0xb47c1b,null))[_0xd54f('0x3d')](handleError(_0xb47c1b,null));}; \ No newline at end of file +var _0x1f33=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','save','update','destroy','then','error','stack','send','VoiceDialReport','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','length','create','body','find','describe','eml-format','zip-dir'];(function(_0x21b0ef,_0x2bec64){var _0x135500=function(_0x4d155){while(--_0x4d155){_0x21b0ef['push'](_0x21b0ef['shift']());}};_0x135500(++_0x2bec64);}(_0x1f33,0x1a8));var _0x31f3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1f33[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x31f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31f3('0x1'));var jsonpatch=require(_0x31f3('0x2'));var rp=require(_0x31f3('0x3'));var moment=require(_0x31f3('0x4'));var BPromise=require(_0x31f3('0x5'));var Mustache=require(_0x31f3('0x6'));var util=require(_0x31f3('0x7'));var path=require(_0x31f3('0x8'));var sox=require('sox');var csv=require(_0x31f3('0x9'));var ejs=require(_0x31f3('0xa'));var fs=require('fs');var fs_extra=require(_0x31f3('0xb'));var _=require('lodash');var squel=require(_0x31f3('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x31f3('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x31f3('0xe'));var authService=require(_0x31f3('0xf'));var qs=require(_0x31f3('0x10'));var as=require(_0x31f3('0x11'));var hardwareService=require(_0x31f3('0x12'));var logger=require(_0x31f3('0x13'))(_0x31f3('0x14'));var utils=require(_0x31f3('0x15'));var config=require(_0x31f3('0x16'));var licenseUtil=require(_0x31f3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f1956,_0x225252){_0x225252=_0x225252||0xcc;return function(_0x46107b){if(_0x46107b){return _0x1f1956[_0x31f3('0x18')](_0x225252);}return _0x1f1956[_0x31f3('0x19')](_0x225252)[_0x31f3('0x1a')]();};}function respondWithResult(_0xfe3366,_0x481a6d){_0x481a6d=_0x481a6d||0xc8;return function(_0x1c14d0){if(_0x1c14d0){return _0xfe3366[_0x31f3('0x19')](_0x481a6d)['json'](_0x1c14d0);}};}function respondWithFilteredResult(_0x25ef4c,_0x3c0537){return function(_0xa78e77){if(_0xa78e77){var _0x592d11=typeof _0x3c0537[_0x31f3('0x1b')]===_0x31f3('0x1c')&&typeof _0x3c0537[_0x31f3('0x1d')]===_0x31f3('0x1c');var _0x4c9187=_0xa78e77[_0x31f3('0x1e')];var _0x59d2b5=_0x592d11?0x0:_0x3c0537[_0x31f3('0x1b')];var _0x5bbe40=_0x592d11?_0xa78e77[_0x31f3('0x1e')]:_0x3c0537['offset']+_0x3c0537[_0x31f3('0x1d')];var _0x358103;if(_0x5bbe40>=_0x4c9187){_0x5bbe40=_0x4c9187;_0x358103=0xc8;}else{_0x358103=0xce;}_0x25ef4c[_0x31f3('0x19')](_0x358103);return _0x25ef4c['set'](_0x31f3('0x1f'),_0x59d2b5+'-'+_0x5bbe40+'/'+_0x4c9187)[_0x31f3('0x20')](_0xa78e77);}return null;};}function patchUpdates(_0x365b03){return function(_0x305700){try{jsonpatch['apply'](_0x305700,_0x365b03,!![]);}catch(_0x5c7a55){return BPromise['reject'](_0x5c7a55);}return _0x305700[_0x31f3('0x21')]();};}function saveUpdates(_0x1c43bb,_0x49d5b1){return function(_0x2a28ff){if(_0x2a28ff){return _0x2a28ff[_0x31f3('0x22')](_0x1c43bb)['then'](function(_0x20a998){return _0x20a998;});}return null;};}function removeEntity(_0x941f96,_0x33abf3){return function(_0x362aec){if(_0x362aec){return _0x362aec[_0x31f3('0x23')]()[_0x31f3('0x24')](function(){_0x941f96[_0x31f3('0x19')](0xcc)[_0x31f3('0x1a')]();});}};}function handleEntityNotFound(_0x3e13d6,_0x3450a0){return function(_0x5b6e47){if(!_0x5b6e47){_0x3e13d6['sendStatus'](0x194);}return _0x5b6e47;};}function handleError(_0xe474d2,_0x3a02a2){_0x3a02a2=_0x3a02a2||0x1f4;return function(_0x1892d5){logger[_0x31f3('0x25')](_0x1892d5[_0x31f3('0x26')]);if(_0x1892d5['name']){delete _0x1892d5['name'];}_0xe474d2['status'](_0x3a02a2)[_0x31f3('0x27')](_0x1892d5);};}exports['index']=function(_0xfe1bae,_0x16dfcf){var _0x5b51c5={},_0x353815={},_0x2b08cf={'count':0x0,'rows':[]};var _0x30e9c8=_['map'](db[_0x31f3('0x28')][_0x31f3('0x29')],function(_0x602d31){return{'name':_0x602d31[_0x31f3('0x2a')],'type':_0x602d31[_0x31f3('0x2b')]['key']};});_0x353815[_0x31f3('0x2c')]=_[_0x31f3('0x2d')](_0x30e9c8,_0x31f3('0x2e'));_0x353815[_0x31f3('0x2f')]=_[_0x31f3('0x30')](_0xfe1bae[_0x31f3('0x2f')]);_0x353815['filters']=_[_0x31f3('0x31')](_0x353815[_0x31f3('0x2c')],_0x353815[_0x31f3('0x2f')]);_0x5b51c5['attributes']=_[_0x31f3('0x31')](_0x353815[_0x31f3('0x2c')],qs[_0x31f3('0x32')](_0xfe1bae[_0x31f3('0x2f')]['fields']));_0x5b51c5[_0x31f3('0x33')]=_0x5b51c5[_0x31f3('0x33')]['length']?_0x5b51c5[_0x31f3('0x33')]:_0x353815[_0x31f3('0x2c')];if(!_0xfe1bae[_0x31f3('0x2f')][_0x31f3('0x34')](_0x31f3('0x35'))){_0x5b51c5[_0x31f3('0x1d')]=qs[_0x31f3('0x1d')](_0xfe1bae['query'][_0x31f3('0x1d')]);_0x5b51c5[_0x31f3('0x1b')]=qs[_0x31f3('0x1b')](_0xfe1bae[_0x31f3('0x2f')][_0x31f3('0x1b')]);}_0x5b51c5['order']=qs['sort'](_0xfe1bae[_0x31f3('0x2f')]['sort']);_0x5b51c5[_0x31f3('0x36')]=qs[_0x31f3('0x37')](_[_0x31f3('0x38')](_0xfe1bae[_0x31f3('0x2f')],_0x353815[_0x31f3('0x37')]),_0x30e9c8);if(_0xfe1bae[_0x31f3('0x2f')][_0x31f3('0x39')]){_0x5b51c5[_0x31f3('0x36')]=_['merge'](_0x5b51c5[_0x31f3('0x36')],{'$or':_['map'](_0x30e9c8,function(_0x52b7c3){if(_0x52b7c3[_0x31f3('0x2b')]!=='VIRTUAL'){var _0x190323={};_0x190323[_0x52b7c3[_0x31f3('0x2e')]]={'$like':'%'+_0xfe1bae['query']['filter']+'%'};return _0x190323;}})});}_0x5b51c5=_[_0x31f3('0x3a')]({},_0x5b51c5,_0xfe1bae[_0x31f3('0x3b')]);var _0x57972f={'where':_0x5b51c5[_0x31f3('0x36')]};return db[_0x31f3('0x28')]['count'](_0x57972f)[_0x31f3('0x24')](function(_0x5400d5){_0x2b08cf[_0x31f3('0x1e')]=_0x5400d5;if(_0xfe1bae['query'][_0x31f3('0x3c')]){_0x5b51c5[_0x31f3('0x3d')]=[{'all':!![]}];}return db[_0x31f3('0x28')]['findAll'](_0x5b51c5);})[_0x31f3('0x24')](function(_0x6833dd){_0x2b08cf[_0x31f3('0x3e')]=_0x6833dd;return _0x2b08cf;})['then'](respondWithFilteredResult(_0x16dfcf,_0x5b51c5))[_0x31f3('0x3f')](handleError(_0x16dfcf,null));};exports[_0x31f3('0x40')]=function(_0x1c3dc9,_0x3a5c4b){var _0x58ff57={'raw':!![],'where':{'id':_0x1c3dc9[_0x31f3('0x41')]['id']}},_0x3949b6={};_0x3949b6[_0x31f3('0x2c')]=_[_0x31f3('0x30')](db['VoiceDialReport'][_0x31f3('0x29')]);_0x3949b6[_0x31f3('0x2f')]=_['keys'](_0x1c3dc9[_0x31f3('0x2f')]);_0x3949b6[_0x31f3('0x37')]=_[_0x31f3('0x31')](_0x3949b6['model'],_0x3949b6[_0x31f3('0x2f')]);_0x58ff57[_0x31f3('0x33')]=_[_0x31f3('0x31')](_0x3949b6['model'],qs[_0x31f3('0x32')](_0x1c3dc9['query'][_0x31f3('0x32')]));_0x58ff57[_0x31f3('0x33')]=_0x58ff57[_0x31f3('0x33')][_0x31f3('0x42')]?_0x58ff57['attributes']:_0x3949b6[_0x31f3('0x2c')];if(_0x1c3dc9[_0x31f3('0x2f')][_0x31f3('0x3c')]){_0x58ff57['include']=[{'all':!![]}];}_0x58ff57=_[_0x31f3('0x3a')]({},_0x58ff57,_0x1c3dc9['options']);return db[_0x31f3('0x28')]['find'](_0x58ff57)[_0x31f3('0x24')](handleEntityNotFound(_0x3a5c4b,null))[_0x31f3('0x24')](respondWithResult(_0x3a5c4b,null))[_0x31f3('0x3f')](handleError(_0x3a5c4b,null));};exports['create']=function(_0x280bb8,_0x597495){return db[_0x31f3('0x28')][_0x31f3('0x43')](_0x280bb8[_0x31f3('0x44')],{})['then'](respondWithResult(_0x597495,0xc9))[_0x31f3('0x3f')](handleError(_0x597495,null));};exports[_0x31f3('0x22')]=function(_0x1900ca,_0x382f06){if(_0x1900ca[_0x31f3('0x44')]['id']){delete _0x1900ca['body']['id'];}return db[_0x31f3('0x28')][_0x31f3('0x45')]({'where':{'id':_0x1900ca[_0x31f3('0x41')]['id']}})[_0x31f3('0x24')](handleEntityNotFound(_0x382f06,null))[_0x31f3('0x24')](saveUpdates(_0x1900ca[_0x31f3('0x44')],null))[_0x31f3('0x24')](respondWithResult(_0x382f06,null))[_0x31f3('0x3f')](handleError(_0x382f06,null));};exports['destroy']=function(_0x347f85,_0x51b692){return db[_0x31f3('0x28')][_0x31f3('0x45')]({'where':{'id':_0x347f85[_0x31f3('0x41')]['id']}})['then'](handleEntityNotFound(_0x51b692,null))[_0x31f3('0x24')](removeEntity(_0x51b692,null))[_0x31f3('0x3f')](handleError(_0x51b692,null));};exports[_0x31f3('0x46')]=function(_0x16c3ac,_0x112b92){return db['VoiceDialReport']['describe']()[_0x31f3('0x24')](respondWithResult(_0x112b92,null))[_0x31f3('0x3f')](handleError(_0x112b92,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 51d2570..57e58da 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 _0xea5a=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','lodash'];(function(_0x177c14,_0x2649d6){var _0x2d64e8=function(_0x1be083){while(--_0x1be083){_0x177c14['push'](_0x177c14['shift']());}};_0x2d64e8(++_0x2649d6);}(_0xea5a,0x8b));var _0xaea5=function(_0x3b59d5,_0x1e23f2){_0x3b59d5=_0x3b59d5-0x0;var _0x30cc91=_0xea5a[_0x3b59d5];return _0x30cc91;};'use strict';var _=require(_0xaea5('0x0'));var util=require(_0xaea5('0x1'));var logger=require(_0xaea5('0x2'))('api');var moment=require(_0xaea5('0x3'));var BPromise=require(_0xaea5('0x4'));var rp=require(_0xaea5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaea5('0x6'));var attributes=require(_0xaea5('0x7'));module['exports']=function(_0x3544d9,_0x41f649){return _0x3544d9[_0xaea5('0x8')](_0xaea5('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbf07=['define','report_dial','lodash','util','../../config/logger','api','bluebird','request-promise','./voiceDialReport.attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbf07,0x77));var _0x7bf0=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0xbf07[_0x171fdc];return _0x3782ea;};'use strict';var _=require(_0x7bf0('0x0'));var util=require(_0x7bf0('0x1'));var logger=require(_0x7bf0('0x2'))(_0x7bf0('0x3'));var moment=require('moment');var BPromise=require(_0x7bf0('0x4'));var rp=require(_0x7bf0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7bf0('0x6'));module['exports']=function(_0x5d2b76,_0x4a925d){return _0x5d2b76[_0x7bf0('0x7')]('VoiceDialReport',attributes,{'tableName':_0x7bf0('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index da58176..f3b7a0c 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 _0xadd9=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options','raw','then','UpdateVoiceDialReport','body','where','attributes','limit','util','moment','bluebird','randomstring'];(function(_0x23307f,_0x438068){var _0x205548=function(_0x66faff){while(--_0x66faff){_0x23307f['push'](_0x23307f['shift']());}};_0x205548(++_0x438068);}(_0xadd9,0x84));var _0x9add=function(_0x54fe80,_0x135111){_0x54fe80=_0x54fe80-0x0;var _0x4b12ad=_0xadd9[_0x54fe80];return _0x4b12ad;};'use strict';var _=require('lodash');var util=require(_0x9add('0x0'));var moment=require(_0x9add('0x1'));var BPromise=require(_0x9add('0x2'));var rs=require(_0x9add('0x3'));var fs=require('fs');var Redis=require(_0x9add('0x4'));var db=require(_0x9add('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9add('0x6'))(_0x9add('0x7'));var config=require(_0x9add('0x8'));var jayson=require(_0x9add('0x9'));var client=jayson[_0x9add('0xa')][_0x9add('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4498c0,_0x3a59df,_0x16f94e){return new BPromise(function(_0x3606e0,_0x10b2c3){return client[_0x9add('0xc')](_0x4498c0,_0x16f94e)['then'](function(_0x19da03){logger[_0x9add('0xd')](_0x9add('0xe'),_0x3a59df,_0x9add('0xf'));logger[_0x9add('0x10')](_0x9add('0x11'),_0x3a59df,'request\x20sent',JSON[_0x9add('0x12')](_0x19da03));if(_0x19da03[_0x9add('0x13')]){if(_0x19da03['error'][_0x9add('0x14')]===0x1f4){logger[_0x9add('0x13')](_0x9add('0xe'),_0x3a59df,_0x19da03[_0x9add('0x13')]['message']);return _0x10b2c3(_0x19da03[_0x9add('0x13')][_0x9add('0x15')]);}logger['error'](_0x9add('0xe'),_0x3a59df,_0x19da03[_0x9add('0x13')]['message']);return _0x3606e0(_0x19da03[_0x9add('0x13')][_0x9add('0x15')]);}else{logger[_0x9add('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x3a59df,'request\x20sent');_0x3606e0(_0x19da03[_0x9add('0x16')][_0x9add('0x15')]);}})[_0x9add('0x17')](function(_0x10adb5){logger[_0x9add('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x3a59df,_0x10adb5);_0x10b2c3(_0x10adb5);});});}exports[_0x9add('0x18')]=function(_0x7d4174){var _0x3ce794=this;return new Promise(function(_0x570009,_0x48b3bc){return db[_0x9add('0x19')]['create'](_0x7d4174['body'],{'raw':_0x7d4174['options']?_0x7d4174[_0x9add('0x1a')][_0x9add('0x1b')]===undefined?!![]:![]:!![]})[_0x9add('0x1c')](function(_0x21c0ec){logger[_0x9add('0xd')]('CreateVoiceDialReport',_0x7d4174);logger[_0x9add('0x10')]('CreateVoiceDialReport',_0x7d4174,JSON[_0x9add('0x12')](_0x21c0ec));_0x570009(_0x21c0ec);})[_0x9add('0x17')](function(_0x39cbc0){logger[_0x9add('0x13')]('CreateVoiceDialReport',_0x39cbc0[_0x9add('0x15')],_0x7d4174);_0x48b3bc(_0x3ce794[_0x9add('0x13')](0x1f4,_0x39cbc0[_0x9add('0x15')]));});});};exports[_0x9add('0x1d')]=function(_0x391b23){var _0x486121=this;return new Promise(function(_0x309c36,_0x430c8d){return db['VoiceDialReport']['update'](_0x391b23[_0x9add('0x1e')],{'raw':_0x391b23[_0x9add('0x1a')]?_0x391b23[_0x9add('0x1a')][_0x9add('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x391b23['options']?_0x391b23['options'][_0x9add('0x1f')]||null:null,'attributes':_0x391b23['options']?_0x391b23[_0x9add('0x1a')][_0x9add('0x20')]||null:null,'limit':_0x391b23[_0x9add('0x1a')]?_0x391b23['options'][_0x9add('0x21')]||null:null})['then'](function(_0x151910){logger[_0x9add('0xd')]('UpdateVoiceDialReport',_0x391b23);logger[_0x9add('0x10')](_0x9add('0x1d'),_0x391b23,JSON[_0x9add('0x12')](_0x151910));_0x309c36(_0x151910);})[_0x9add('0x17')](function(_0x256ee1){logger[_0x9add('0x13')](_0x9add('0x1d'),_0x256ee1['message'],_0x391b23);_0x430c8d(_0x486121[_0x9add('0x13')](0x1f4,_0x256ee1[_0x9add('0x15')]));});});}; \ No newline at end of file +var _0x4ec2=['VoiceDialReport','create','options','raw','stringify','UpdateVoiceDialReport','update','body','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport'];(function(_0x2c10fb,_0x380e1b){var _0x23e4c0=function(_0x4fdea5){while(--_0x4fdea5){_0x2c10fb['push'](_0x2c10fb['shift']());}};_0x23e4c0(++_0x380e1b);}(_0x4ec2,0x74));var _0x24ec=function(_0x27159a,_0x10926b){_0x27159a=_0x27159a-0x0;var _0x495744=_0x4ec2[_0x27159a];return _0x495744;};'use strict';var _=require(_0x24ec('0x0'));var util=require(_0x24ec('0x1'));var moment=require(_0x24ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x24ec('0x3'));var fs=require('fs');var Redis=require(_0x24ec('0x4'));var db=require(_0x24ec('0x5'))['db'];var utils=require(_0x24ec('0x6'));var logger=require('../../config/logger')(_0x24ec('0x7'));var config=require(_0x24ec('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24ec('0x9')][_0x24ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x580505,_0x1a5078,_0x5ae182){return new BPromise(function(_0x5efdfe,_0x3f0f54){return client[_0x24ec('0xb')](_0x580505,_0x5ae182)[_0x24ec('0xc')](function(_0x2e3d92){logger[_0x24ec('0xd')](_0x24ec('0xe'),_0x1a5078,_0x24ec('0xf'));logger[_0x24ec('0x10')](_0x24ec('0x11'),_0x1a5078,'request\x20sent',JSON['stringify'](_0x2e3d92));if(_0x2e3d92['error']){if(_0x2e3d92[_0x24ec('0x12')][_0x24ec('0x13')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x1a5078,_0x2e3d92['error'][_0x24ec('0x14')]);return _0x3f0f54(_0x2e3d92['error']['message']);}logger[_0x24ec('0x12')](_0x24ec('0xe'),_0x1a5078,_0x2e3d92['error'][_0x24ec('0x14')]);return _0x5efdfe(_0x2e3d92[_0x24ec('0x12')][_0x24ec('0x14')]);}else{logger[_0x24ec('0xd')](_0x24ec('0xe'),_0x1a5078,_0x24ec('0xf'));_0x5efdfe(_0x2e3d92[_0x24ec('0x15')][_0x24ec('0x14')]);}})[_0x24ec('0x16')](function(_0x43a38e){logger[_0x24ec('0x12')](_0x24ec('0xe'),_0x1a5078,_0x43a38e);_0x3f0f54(_0x43a38e);});});}exports[_0x24ec('0x17')]=function(_0x656210){var _0x15ee49=this;return new Promise(function(_0x50e7ae,_0x403979){return db[_0x24ec('0x18')][_0x24ec('0x19')](_0x656210['body'],{'raw':_0x656210[_0x24ec('0x1a')]?_0x656210[_0x24ec('0x1a')][_0x24ec('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x46a490){logger['info'](_0x24ec('0x17'),_0x656210);logger['debug']('CreateVoiceDialReport',_0x656210,JSON[_0x24ec('0x1c')](_0x46a490));_0x50e7ae(_0x46a490);})[_0x24ec('0x16')](function(_0x19deb8){logger[_0x24ec('0x12')](_0x24ec('0x17'),_0x19deb8[_0x24ec('0x14')],_0x656210);_0x403979(_0x15ee49[_0x24ec('0x12')](0x1f4,_0x19deb8[_0x24ec('0x14')]));});});};exports[_0x24ec('0x1d')]=function(_0x5b697d){var _0x1e479f=this;return new Promise(function(_0x31e594,_0x42e09c){return db[_0x24ec('0x18')][_0x24ec('0x1e')](_0x5b697d[_0x24ec('0x1f')],{'raw':_0x5b697d[_0x24ec('0x1a')]?_0x5b697d['options'][_0x24ec('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b697d['options']?_0x5b697d[_0x24ec('0x1a')][_0x24ec('0x20')]||null:null,'attributes':_0x5b697d['options']?_0x5b697d['options'][_0x24ec('0x21')]||null:null,'limit':_0x5b697d[_0x24ec('0x1a')]?_0x5b697d[_0x24ec('0x1a')][_0x24ec('0x22')]||null:null})[_0x24ec('0xc')](function(_0x3bd296){logger[_0x24ec('0xd')](_0x24ec('0x1d'),_0x5b697d);logger[_0x24ec('0x10')](_0x24ec('0x1d'),_0x5b697d,JSON['stringify'](_0x3bd296));_0x31e594(_0x3bd296);})['catch'](function(_0x5948d2){logger[_0x24ec('0x12')](_0x24ec('0x1d'),_0x5948d2[_0x24ec('0x14')],_0x5b697d);_0x42e09c(_0x1e479f[_0x24ec('0x12')](0x1f4,_0x5948d2[_0x24ec('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 2f23aab..42b1921 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 _0x52d3=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id','post','create','/:id/applications','addApplications','update','delete','destroy','exports','multer','util','path'];(function(_0x14faa6,_0xccadc8){var _0x3ca44a=function(_0x414bb4){while(--_0x414bb4){_0x14faa6['push'](_0x14faa6['shift']());}};_0x3ca44a(++_0xccadc8);}(_0x52d3,0x1c9));var _0x352d=function(_0x3b429c,_0x128cc6){_0x3b429c=_0x3b429c-0x0;var _0x3897a0=_0x52d3[_0x3b429c];return _0x3897a0;};'use strict';var multer=require(_0x352d('0x0'));var util=require(_0x352d('0x1'));var path=require(_0x352d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x352d('0x3')]();var fs_extra=require(_0x352d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x352d('0x5'));var config=require(_0x352d('0x6'));var controller=require(_0x352d('0x7'));router['get']('/',auth[_0x352d('0x8')](),controller[_0x352d('0x9')]);router[_0x352d('0xa')](_0x352d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x352d('0xc')]('/',auth[_0x352d('0x8')](),controller[_0x352d('0xd')]);router[_0x352d('0xc')](_0x352d('0xe'),auth[_0x352d('0x8')](),controller[_0x352d('0xf')]);router['put'](_0x352d('0xb'),auth['isAuthenticated'](),controller[_0x352d('0x10')]);router[_0x352d('0x11')](_0x352d('0xb'),auth[_0x352d('0x8')](),controller[_0x352d('0x12')]);module[_0x352d('0x13')]=router; \ No newline at end of file +var _0x3047=['get','/:id','show','post','/:id/applications','addApplications','put','update','delete','multer','path','express','../../components/interaction/service','./voiceExtension.controller','isAuthenticated'];(function(_0x18fa4a,_0xb406e0){var _0x2a207f=function(_0x283ff2){while(--_0x283ff2){_0x18fa4a['push'](_0x18fa4a['shift']());}};_0x2a207f(++_0xb406e0);}(_0x3047,0x108));var _0x7304=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3047[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7304('0x0'));var util=require('util');var path=require(_0x7304('0x1'));var timeout=require('connect-timeout');var express=require(_0x7304('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7304('0x3'));var config=require('../../config/environment');var controller=require(_0x7304('0x4'));router['get']('/',auth[_0x7304('0x5')](),controller['index']);router[_0x7304('0x6')](_0x7304('0x7'),auth[_0x7304('0x5')](),controller[_0x7304('0x8')]);router['post']('/',auth[_0x7304('0x5')](),controller['create']);router[_0x7304('0x9')](_0x7304('0xa'),auth[_0x7304('0x5')](),controller[_0x7304('0xb')]);router[_0x7304('0xc')](_0x7304('0x7'),auth['isAuthenticated'](),controller[_0x7304('0xd')]);router[_0x7304('0xe')](_0x7304('0x7'),auth['isAuthenticated'](),controller['destroy']);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 3924fb7..58bcccf 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 _0x7a82=['exten','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','getDataValue'];(function(_0x2a0e80,_0x379250){var _0x5a3500=function(_0x59248f){while(--_0x59248f){_0x2a0e80['push'](_0x2a0e80['shift']());}};_0x5a3500(++_0x379250);}(_0x7a82,0xe2));var _0x27a8=function(_0x44b4d6,_0xb42807){_0x44b4d6=_0x44b4d6-0x0;var _0xaa952e=_0x7a82[_0x44b4d6];return _0xaa952e;};'use strict';var Sequelize=require('sequelize');module[_0x27a8('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x27a8('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x27a8('0x2')],'allowNull':![],'unique':_0x27a8('0x1')},'priority':{'type':Sequelize[_0x27a8('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x27a8('0x1')},'tag':{'type':Sequelize[_0x27a8('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x27a8('0x3')},'appdata':{'type':Sequelize[_0x27a8('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x27a8('0x4')](_0x27a8('0x5'),_0x27a8('0x6'),'internal',_0x27a8('0x7'),_0x27a8('0x8'),'system',_0x27a8('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x27a8('0x2')]},'interval':{'type':Sequelize[_0x27a8('0x2')],'allowNull':![],'defaultValue':_0x27a8('0xa')},'IntervalId':{'type':Sequelize[_0x27a8('0xb')]},'isApp':{'type':Sequelize[_0x27a8('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x27a8('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x27a8('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x27a8('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x27a8('0xb')]},'recordingFormat':{'type':Sequelize[_0x27a8('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x27a8('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x30a417){return this[_0x27a8('0xd')](_0x27a8('0xe'));}},'alias':{'type':Sequelize[_0x27a8('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2414=['inbound','internal','outbound-fax','system','any','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM'];(function(_0x452da3,_0x588f43){var _0x54911d=function(_0x29bbe7){while(--_0x29bbe7){_0x452da3['push'](_0x452da3['shift']());}};_0x54911d(++_0x588f43);}(_0x2414,0x8a));var _0x4241=function(_0x21fb3d,_0x3c789d){_0x21fb3d=_0x21fb3d-0x0;var _0x574509=_0x2414[_0x21fb3d];return _0x574509;};'use strict';var Sequelize=require(_0x4241('0x0'));module[_0x4241('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4241('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4241('0x3')],'allowNull':![],'unique':_0x4241('0x2')},'priority':{'type':Sequelize[_0x4241('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x4241('0x2')},'tag':{'type':Sequelize[_0x4241('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4241('0x4')},'appdata':{'type':Sequelize[_0x4241('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4241('0x5')](_0x4241('0x6'),'outbound',_0x4241('0x7'),'inbound-fax',_0x4241('0x8'),_0x4241('0x9'),_0x4241('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x4241('0x3')]},'interval':{'type':Sequelize[_0x4241('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x4241('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4241('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x4241('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4241('0xb')]},'recordingFormat':{'type':Sequelize[_0x4241('0x3')],'defaultValue':_0x4241('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2547bb){return this[_0x4241('0xe')](_0x4241('0xf'));}},'alias':{'type':Sequelize[_0x4241('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 8f2e72e..3299103 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 _0xe20c=['cutdigits','mandatoryDisposition','alias','transaction','sequelize','Transaction','ISOLATION_LEVELS','findOne','destroy','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','type','value','UserProfileResource','then','error','name','send','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','startsWith','exten','concat','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe20c,0x177));var _0xce20=function(_0x3786a7,_0x289a6c){_0x3786a7=_0x3786a7-0x0;var _0xd0339=_0xe20c[_0x3786a7];return _0xd0339;};'use strict';var _=require(_0xce20('0x0'));var Redis=require(_0xce20('0x1'));var qs=require(_0xce20('0x2'));var logger=require(_0xce20('0x3'))('api');var config=require('../../config/environment');var db=require(_0xce20('0x4'))['db'];config[_0xce20('0x5')]=_['defaults'](config[_0xce20('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xce20('0x5')]));require('./voiceExtension.socket')[_0xce20('0x6')](socket);function respondWithStatusCode(_0x24ec86,_0x286280){_0x286280=_0x286280||0xcc;return function(_0x43ebd4){if(_0x43ebd4){return _0x24ec86[_0xce20('0x7')](_0x286280);}return _0x24ec86[_0xce20('0x8')](_0x286280)[_0xce20('0x9')]();};}function respondWithResult(_0x34a632,_0x3df1c5){_0x3df1c5=_0x3df1c5||0xc8;return function(_0x2fba8e){if(_0x2fba8e){return _0x34a632[_0xce20('0x8')](_0x3df1c5)[_0xce20('0xa')](_0x2fba8e);}};}function respondWithFilteredResult(_0x5ac240,_0x283b4d){return function(_0x5f14e5){if(_0x5f14e5){var _0x1c31db=typeof _0x283b4d[_0xce20('0xb')]===_0xce20('0xc')&&typeof _0x283b4d[_0xce20('0xd')]==='undefined';var _0x276853=_0x5f14e5['count'];var _0x5be18a=_0x1c31db?0x0:_0x283b4d[_0xce20('0xb')];var _0x311427=_0x1c31db?_0x5f14e5[_0xce20('0xe')]:_0x283b4d[_0xce20('0xb')]+_0x283b4d[_0xce20('0xd')];var _0x407b79;if(_0x311427>=_0x276853){_0x311427=_0x276853;_0x407b79=0xc8;}else{_0x407b79=0xce;}_0x5ac240[_0xce20('0x8')](_0x407b79);return _0x5ac240[_0xce20('0xf')](_0xce20('0x10'),_0x5be18a+'-'+_0x311427+'/'+_0x276853)[_0xce20('0xa')](_0x5f14e5);}return null;};}function removeEntity(_0x3d6b22){return function(_0x6fbc33){if(_0x6fbc33){return _0x6fbc33['destroy']()['then'](function(){var _0xef7d9b=_0x6fbc33['get']({'plain':!![]});var _0x4500b9=[{'name':_0xce20('0x11'),'value':'inbound','ignore':![]},{'name':_0xce20('0x12'),'value':_0xce20('0x13'),'ignore':![]},{'name':_0xce20('0x14'),'value':_0xce20('0x15'),'ignore':![]}];var _0x4a5cb2=_(_0x4500b9)['filter'](_0xce20('0x16'))[_0xce20('0x17')]('value')['value']();if(_['includes'](_0x4a5cb2,_0xef7d9b[_0xce20('0x18')])){return;}var _0x5d82e8=_['find'](_0x4500b9,[_0xce20('0x19'),_0xef7d9b[_0xce20('0x18')]])['name'];return db[_0xce20('0x1a')]['destroy']({'where':{'type':_0x5d82e8,'resourceId':_0xef7d9b['id']}})['then'](function(){return _0x6fbc33;});})[_0xce20('0x1b')](function(){_0x3d6b22['status'](0xcc)[_0xce20('0x9')]();});}};}function handleEntityNotFound(_0x565cd0){return function(_0x51055e){if(!_0x51055e){_0x565cd0[_0xce20('0x7')](0x194);}return _0x51055e;};}function handleError(_0x374673,_0x370b9f){_0x370b9f=_0x370b9f||0x1f4;return function(_0x2008bf){logger[_0xce20('0x1c')](_0x2008bf['stack']);if(_0x2008bf[_0xce20('0x1d')]){delete _0x2008bf[_0xce20('0x1d')];}_0x374673['status'](_0x370b9f)[_0xce20('0x1e')](_0x2008bf);};}exports[_0xce20('0x1f')]=function(_0x39dc79,_0x56b288){var _0x46a9f9={},_0x418b2a={},_0x25106d={'count':0x0,'rows':[]};var _0x3d4181=_['map'](db[_0xce20('0x20')][_0xce20('0x21')],function(_0x1efa9d){return{'name':_0x1efa9d[_0xce20('0x22')],'type':_0x1efa9d[_0xce20('0x18')][_0xce20('0x23')]};});_0x418b2a['model']=_[_0xce20('0x17')](_0x3d4181,_0xce20('0x1d'));_0x418b2a[_0xce20('0x24')]=_[_0xce20('0x25')](_0x39dc79[_0xce20('0x24')]);_0x418b2a[_0xce20('0x26')]=_['intersection'](_0x418b2a[_0xce20('0x27')],_0x418b2a[_0xce20('0x24')]);_0x46a9f9[_0xce20('0x28')]=_[_0xce20('0x29')](_0x418b2a['model'],qs[_0xce20('0x2a')](_0x39dc79[_0xce20('0x24')][_0xce20('0x2a')]));_0x46a9f9[_0xce20('0x28')]=_0x46a9f9['attributes'][_0xce20('0x2b')]?_0x46a9f9['attributes']:_0x418b2a[_0xce20('0x27')];if(!_0x39dc79[_0xce20('0x24')][_0xce20('0x2c')](_0xce20('0x2d'))){_0x46a9f9['limit']=qs['limit'](_0x39dc79[_0xce20('0x24')]['limit']);_0x46a9f9[_0xce20('0xb')]=qs['offset'](_0x39dc79[_0xce20('0x24')][_0xce20('0xb')]);}_0x46a9f9[_0xce20('0x2e')]=qs['sort'](_0x39dc79[_0xce20('0x24')][_0xce20('0x2f')]);_0x46a9f9['where']=qs['filters'](_[_0xce20('0x30')](_0x39dc79[_0xce20('0x24')],_0x418b2a[_0xce20('0x26')]),_0x3d4181);if(_0x39dc79['query'][_0xce20('0x31')]){_0x46a9f9[_0xce20('0x32')]=_[_0xce20('0x33')](_0x46a9f9[_0xce20('0x32')],{'$or':_['map'](_0x3d4181,function(_0x15887e){if(_0x15887e[_0xce20('0x18')]!==_0xce20('0x34')){var _0x5d445e={};_0x5d445e[_0x15887e[_0xce20('0x1d')]]={'$like':'%'+_0x39dc79['query'][_0xce20('0x31')]+'%'};return _0x5d445e;}})});}_0x46a9f9=_[_0xce20('0x33')]({},_0x46a9f9,_0x39dc79[_0xce20('0x35')]);var _0x2cdc52={'where':_0x46a9f9['where']};return db[_0xce20('0x20')][_0xce20('0xe')](_0x2cdc52)['then'](function(_0xab03c9){_0x25106d[_0xce20('0xe')]=_0xab03c9;if(_0x39dc79[_0xce20('0x24')][_0xce20('0x36')]){_0x46a9f9[_0xce20('0x37')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x46a9f9);})[_0xce20('0x1b')](function(_0x133f9c){_0x25106d[_0xce20('0x38')]=_0x133f9c;return _0x25106d;})['then'](respondWithFilteredResult(_0x56b288,_0x46a9f9))[_0xce20('0x39')](handleError(_0x56b288,null));};exports[_0xce20('0x3a')]=function(_0xc59cc3,_0x21a0c0){var _0x2407d0={'raw':![],'where':{'id':_0xc59cc3[_0xce20('0x3b')]['id']}},_0x23252e={};_0x23252e['model']=_[_0xce20('0x25')](db[_0xce20('0x20')][_0xce20('0x21')]);_0x23252e[_0xce20('0x24')]=_[_0xce20('0x25')](_0xc59cc3['query']);_0x23252e[_0xce20('0x26')]=_[_0xce20('0x29')](_0x23252e[_0xce20('0x27')],_0x23252e[_0xce20('0x24')]);_0x2407d0[_0xce20('0x28')]=_[_0xce20('0x29')](_0x23252e[_0xce20('0x27')],qs[_0xce20('0x2a')](_0xc59cc3[_0xce20('0x24')][_0xce20('0x2a')]));_0x2407d0['attributes']=_0x2407d0[_0xce20('0x28')]['length']?_0x2407d0[_0xce20('0x28')]:_0x23252e[_0xce20('0x27')];if(_0xc59cc3['query'][_0xce20('0x36')]){_0x2407d0[_0xce20('0x37')]=[{'all':!![]}];}_0x2407d0=_[_0xce20('0x33')]({},_0x2407d0,_0xc59cc3[_0xce20('0x35')]);return db[_0xce20('0x20')][_0xce20('0x3c')](_0x2407d0)[_0xce20('0x1b')](handleEntityNotFound(_0x21a0c0,null))[_0xce20('0x1b')](respondWithResult(_0x21a0c0,null))[_0xce20('0x39')](handleError(_0x21a0c0,null));};exports['destroy']=function(_0x39e26a,_0x515428){return db[_0xce20('0x20')][_0xce20('0x3c')]({'where':{'id':_0x39e26a[_0xce20('0x3b')]['id']}})[_0xce20('0x1b')](handleEntityNotFound(_0x515428,null))[_0xce20('0x1b')](removeEntity(_0x515428,null))[_0xce20('0x39')](handleError(_0x515428,null));};exports[_0xce20('0x3d')]=function(_0x361ea4,_0x2d01a9){if(_0x361ea4[_0xce20('0x3e')][_0xce20('0x18')]===_0xce20('0x13')&&!_[_0xce20('0x3f')](_0x361ea4[_0xce20('0x3e')][_0xce20('0x40')],'_')){_0x361ea4['body']['exten']='_'[_0xce20('0x41')](_0x361ea4[_0xce20('0x3e')][_0xce20('0x40')]);}return db[_0xce20('0x20')][_0xce20('0x3d')](_0x361ea4[_0xce20('0x3e')],{'raw':![]})[_0xce20('0x1b')](function(_0x2e8674){var _0x2284e2=_0x361ea4[_0xce20('0x42')][_0xce20('0x43')]({'plain':!![]});if(!_0x2284e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2284e2[_0xce20('0x44')]===_0xce20('0x42')){var _0x2481e1=_0x2e8674['get']({'plain':!![]});var _0x1c6729=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xce20('0x12'),'value':_0xce20('0x13')},{'name':'InternalRoutes','value':'internal'}];var _0xd2a0fd=_[_0xce20('0x3c')](_0x1c6729,[_0xce20('0x19'),_0x2481e1['type']])[_0xce20('0x1d')];return db[_0xce20('0x45')]['find']({'where':{'name':_0xd2a0fd,'userProfileId':_0x2284e2[_0xce20('0x46')]},'raw':!![]})[_0xce20('0x1b')](function(_0x219345){if(_0x219345&&_0x219345['autoAssociation']===0x0){return db[_0xce20('0x1a')]['create']({'name':_0x2481e1['name'],'resourceId':_0x2481e1['id'],'type':_0x219345[_0xce20('0x1d')],'sectionId':_0x219345['id']},{})[_0xce20('0x1b')](function(){return _0x2e8674;});}else{return _0x2e8674;}})['catch'](function(_0x55bfde){logger[_0xce20('0x1c')](_0xce20('0x47'),_0x55bfde);throw _0x55bfde;});}return _0x2e8674;})[_0xce20('0x1b')](respondWithResult(_0x2d01a9,0xc9))[_0xce20('0x39')](handleError(_0x2d01a9,null));};exports[_0xce20('0x48')]=function(_0x46af75,_0x5e4c42){if(_0x46af75[_0xce20('0x3e')]['id']){delete _0x46af75[_0xce20('0x3e')]['id'];}return db[_0xce20('0x20')][_0xce20('0x3c')]({'where':{'id':_0x46af75[_0xce20('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5e4c42,null))[_0xce20('0x1b')](function(_0x5d2d95){if(_0x5d2d95){return db['VoiceExtension'][_0xce20('0x48')](_['pick'](_0x46af75[_0xce20('0x3e')],[_0xce20('0x40'),_0xce20('0x49'),'description',_0xce20('0x4a'),_0xce20('0x4b'),_0xce20('0x4c'),_0xce20('0x4d')]),{'where':{'context':_0x5d2d95[_0xce20('0x49')],'exten':_0x5d2d95[_0xce20('0x40')]},'individualHooks':!![]})[_0xce20('0x1b')](function(_0x1810dd){return _0x1810dd;});}return null;})[_0xce20('0x1b')](respondWithStatusCode(_0x5e4c42,null))[_0xce20('0x39')](handleError(_0x5e4c42,null));};exports['addApplications']=function(_0xfb7e3d,_0x3bca63){var _0x44b675=_0xfb7e3d[_0xce20('0x3b')]['id'];var _0x3fa5fe=_0xfb7e3d['body'];var _0x9a106b=0xc8;var _0x4f39d3=null;return db['sequelize'][_0xce20('0x4e')]({'isolationLevel':db[_0xce20('0x4f')][_0xce20('0x50')][_0xce20('0x51')]['READ_COMMITTED']},function(_0x1186b1){return db[_0xce20('0x20')][_0xce20('0x52')]({'where':{'id':_0x44b675},'transaction':_0x1186b1})[_0xce20('0x1b')](function(_0x15a0d7){if(_0x15a0d7){return db['VoiceExtension'][_0xce20('0x53')]({'where':{'VoiceExtensionId':_0x44b675},'transaction':_0x1186b1})[_0xce20('0x1b')](function(){var _0x1857f9=_[_0xce20('0x17')](_0x3fa5fe,function(_0x33a8fa){_0x33a8fa['VoiceExtensionId']=_0x44b675;_0x33a8fa[_0xce20('0x54')]=!![];return _0x33a8fa;});return _0x15a0d7[_0xce20('0x55')](_0x1857f9);})['then'](function(_0x27c89e){return db[_0xce20('0x20')][_0xce20('0x56')](_0x27c89e,{'transaction':_0x1186b1});});}else{_0x9a106b=0x194;_0x4f39d3=[];}});})[_0xce20('0x1b')](function(){if(_0x9a106b!==0x194){return db[_0xce20('0x20')][_0xce20('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x44b675},'order':_0xce20('0x58')})[_0xce20('0x1b')](function(_0x4ab5c6){_0x4f39d3=_0x4ab5c6;});}})[_0xce20('0x39')](function(_0x3b2983){_0x9a106b=0x1f4;logger[_0xce20('0x1c')](_0x3b2983[_0xce20('0x59')]);if(_0x3b2983[_0xce20('0x1d')]){delete _0x3b2983['name'];}_0x4f39d3=_0x3b2983;})['finally'](function(){if(_0x4f39d3===null){_0x3bca63['sendStatus'](_0x9a106b);}else{if(_0x9a106b===0x1f4){_0x3bca63[_0xce20('0x8')](_0x9a106b)['send'](_0x4f39d3);}else{_0x3bca63['status'](_0x9a106b)[_0xce20('0xa')](_0x4f39d3);}}});}; \ No newline at end of file +var _0xb46a=['sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','then','InboundRoutes','inbound','OutboundRoutes','outbound','ignore','map','value','includes','type','UserProfileResource','destroy','error','stack','name','send','index','VoiceExtension','rawAttributes','key','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','model','length','find','startsWith','body','exten','create','user','get','role','InternalRoutes','internal','UserProfileSection','userProfileId','autoAssociation','update','context','description','recordingFormat','cutdigits','alias','sequelize','Transaction','findOne','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x1e7730,_0x4809c7){var _0x3778b4=function(_0x40c762){while(--_0x40c762){_0x1e7730['push'](_0x1e7730['shift']());}};_0x3778b4(++_0x4809c7);}(_0xb46a,0x1c4));var _0xab46=function(_0x2f1557,_0x5e9776){_0x2f1557=_0x2f1557-0x0;var _0x115894=_0xb46a[_0x2f1557];return _0x115894;};'use strict';var _=require(_0xab46('0x0'));var Redis=require(_0xab46('0x1'));var qs=require(_0xab46('0x2'));var logger=require(_0xab46('0x3'))(_0xab46('0x4'));var config=require(_0xab46('0x5'));var db=require(_0xab46('0x6'))['db'];config[_0xab46('0x7')]=_[_0xab46('0x8')](config['redis'],{'host':_0xab46('0x9'),'port':0x18eb});var socket=require(_0xab46('0xa'))(new Redis(config[_0xab46('0x7')]));require(_0xab46('0xb'))[_0xab46('0xc')](socket);function respondWithStatusCode(_0x2a391e,_0x35d7c3){_0x35d7c3=_0x35d7c3||0xcc;return function(_0x18844f){if(_0x18844f){return _0x2a391e[_0xab46('0xd')](_0x35d7c3);}return _0x2a391e['status'](_0x35d7c3)[_0xab46('0xe')]();};}function respondWithResult(_0x167ada,_0x50e3a1){_0x50e3a1=_0x50e3a1||0xc8;return function(_0x14c2e5){if(_0x14c2e5){return _0x167ada[_0xab46('0xf')](_0x50e3a1)[_0xab46('0x10')](_0x14c2e5);}};}function respondWithFilteredResult(_0x5ebcb6,_0x2f00eb){return function(_0x38f8be){if(_0x38f8be){var _0x3d09bd=typeof _0x2f00eb['offset']===_0xab46('0x11')&&typeof _0x2f00eb[_0xab46('0x12')]==='undefined';var _0x50d08d=_0x38f8be[_0xab46('0x13')];var _0x17d739=_0x3d09bd?0x0:_0x2f00eb[_0xab46('0x14')];var _0x29066a=_0x3d09bd?_0x38f8be['count']:_0x2f00eb[_0xab46('0x14')]+_0x2f00eb[_0xab46('0x12')];var _0x13eee9;if(_0x29066a>=_0x50d08d){_0x29066a=_0x50d08d;_0x13eee9=0xc8;}else{_0x13eee9=0xce;}_0x5ebcb6[_0xab46('0xf')](_0x13eee9);return _0x5ebcb6['set'](_0xab46('0x15'),_0x17d739+'-'+_0x29066a+'/'+_0x50d08d)[_0xab46('0x10')](_0x38f8be);}return null;};}function removeEntity(_0x52e8fc){return function(_0x41d5f0){if(_0x41d5f0){return _0x41d5f0['destroy']()[_0xab46('0x16')](function(){var _0x2bdcc0=_0x41d5f0['get']({'plain':!![]});var _0x266150=[{'name':_0xab46('0x17'),'value':_0xab46('0x18'),'ignore':![]},{'name':_0xab46('0x19'),'value':_0xab46('0x1a'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x26a7f2=_(_0x266150)['filter'](_0xab46('0x1b'))[_0xab46('0x1c')](_0xab46('0x1d'))[_0xab46('0x1d')]();if(_[_0xab46('0x1e')](_0x26a7f2,_0x2bdcc0[_0xab46('0x1f')])){return;}var _0x27dd82=_['find'](_0x266150,[_0xab46('0x1d'),_0x2bdcc0[_0xab46('0x1f')]])['name'];return db[_0xab46('0x20')][_0xab46('0x21')]({'where':{'type':_0x27dd82,'resourceId':_0x2bdcc0['id']}})[_0xab46('0x16')](function(){return _0x41d5f0;});})[_0xab46('0x16')](function(){_0x52e8fc[_0xab46('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x462558){return function(_0x4e059f){if(!_0x4e059f){_0x462558[_0xab46('0xd')](0x194);}return _0x4e059f;};}function handleError(_0x3241db,_0x1cf549){_0x1cf549=_0x1cf549||0x1f4;return function(_0x400352){logger[_0xab46('0x22')](_0x400352[_0xab46('0x23')]);if(_0x400352[_0xab46('0x24')]){delete _0x400352[_0xab46('0x24')];}_0x3241db[_0xab46('0xf')](_0x1cf549)[_0xab46('0x25')](_0x400352);};}exports[_0xab46('0x26')]=function(_0x1acf99,_0x33b752){var _0x5d3ef2={},_0x1aa2d0={},_0x361a1a={'count':0x0,'rows':[]};var _0x176249=_[_0xab46('0x1c')](db[_0xab46('0x27')][_0xab46('0x28')],function(_0xb2d181){return{'name':_0xb2d181['fieldName'],'type':_0xb2d181[_0xab46('0x1f')][_0xab46('0x29')]};});_0x1aa2d0['model']=_[_0xab46('0x1c')](_0x176249,_0xab46('0x24'));_0x1aa2d0[_0xab46('0x2a')]=_[_0xab46('0x2b')](_0x1acf99[_0xab46('0x2a')]);_0x1aa2d0[_0xab46('0x2c')]=_['intersection'](_0x1aa2d0['model'],_0x1aa2d0[_0xab46('0x2a')]);_0x5d3ef2[_0xab46('0x2d')]=_[_0xab46('0x2e')](_0x1aa2d0['model'],qs[_0xab46('0x2f')](_0x1acf99['query']['fields']));_0x5d3ef2[_0xab46('0x2d')]=_0x5d3ef2[_0xab46('0x2d')]['length']?_0x5d3ef2[_0xab46('0x2d')]:_0x1aa2d0['model'];if(!_0x1acf99[_0xab46('0x2a')][_0xab46('0x30')](_0xab46('0x31'))){_0x5d3ef2[_0xab46('0x12')]=qs['limit'](_0x1acf99[_0xab46('0x2a')][_0xab46('0x12')]);_0x5d3ef2[_0xab46('0x14')]=qs['offset'](_0x1acf99['query'][_0xab46('0x14')]);}_0x5d3ef2[_0xab46('0x32')]=qs[_0xab46('0x33')](_0x1acf99[_0xab46('0x2a')][_0xab46('0x33')]);_0x5d3ef2[_0xab46('0x34')]=qs[_0xab46('0x2c')](_[_0xab46('0x35')](_0x1acf99[_0xab46('0x2a')],_0x1aa2d0[_0xab46('0x2c')]),_0x176249);if(_0x1acf99[_0xab46('0x2a')][_0xab46('0x36')]){_0x5d3ef2[_0xab46('0x34')]=_[_0xab46('0x37')](_0x5d3ef2[_0xab46('0x34')],{'$or':_['map'](_0x176249,function(_0x94f580){if(_0x94f580['type']!==_0xab46('0x38')){var _0x1b8aa7={};_0x1b8aa7[_0x94f580[_0xab46('0x24')]]={'$like':'%'+_0x1acf99[_0xab46('0x2a')][_0xab46('0x36')]+'%'};return _0x1b8aa7;}})});}_0x5d3ef2=_['merge']({},_0x5d3ef2,_0x1acf99[_0xab46('0x39')]);var _0x649f21={'where':_0x5d3ef2[_0xab46('0x34')]};return db[_0xab46('0x27')][_0xab46('0x13')](_0x649f21)[_0xab46('0x16')](function(_0x3258e7){_0x361a1a[_0xab46('0x13')]=_0x3258e7;if(_0x1acf99['query'][_0xab46('0x3a')]){_0x5d3ef2[_0xab46('0x3b')]=[{'all':!![]}];}return db['VoiceExtension'][_0xab46('0x3c')](_0x5d3ef2);})[_0xab46('0x16')](function(_0x50feb1){_0x361a1a[_0xab46('0x3d')]=_0x50feb1;return _0x361a1a;})['then'](respondWithFilteredResult(_0x33b752,_0x5d3ef2))[_0xab46('0x3e')](handleError(_0x33b752,null));};exports[_0xab46('0x3f')]=function(_0x31f577,_0x5c56da){var _0x3087cd={'raw':![],'where':{'id':_0x31f577[_0xab46('0x40')]['id']}},_0x530924={};_0x530924[_0xab46('0x41')]=_[_0xab46('0x2b')](db[_0xab46('0x27')][_0xab46('0x28')]);_0x530924['query']=_[_0xab46('0x2b')](_0x31f577[_0xab46('0x2a')]);_0x530924[_0xab46('0x2c')]=_[_0xab46('0x2e')](_0x530924[_0xab46('0x41')],_0x530924[_0xab46('0x2a')]);_0x3087cd[_0xab46('0x2d')]=_[_0xab46('0x2e')](_0x530924[_0xab46('0x41')],qs['fields'](_0x31f577[_0xab46('0x2a')][_0xab46('0x2f')]));_0x3087cd[_0xab46('0x2d')]=_0x3087cd[_0xab46('0x2d')][_0xab46('0x42')]?_0x3087cd['attributes']:_0x530924[_0xab46('0x41')];if(_0x31f577[_0xab46('0x2a')]['includeAll']){_0x3087cd[_0xab46('0x3b')]=[{'all':!![]}];}_0x3087cd=_[_0xab46('0x37')]({},_0x3087cd,_0x31f577['options']);return db[_0xab46('0x27')][_0xab46('0x43')](_0x3087cd)[_0xab46('0x16')](handleEntityNotFound(_0x5c56da,null))['then'](respondWithResult(_0x5c56da,null))[_0xab46('0x3e')](handleError(_0x5c56da,null));};exports[_0xab46('0x21')]=function(_0x5870b4,_0x196e62){return db['VoiceExtension'][_0xab46('0x43')]({'where':{'id':_0x5870b4[_0xab46('0x40')]['id']}})['then'](handleEntityNotFound(_0x196e62,null))[_0xab46('0x16')](removeEntity(_0x196e62,null))[_0xab46('0x3e')](handleError(_0x196e62,null));};exports['create']=function(_0x4755fe,_0x3633b0){if(_0x4755fe['body'][_0xab46('0x1f')]===_0xab46('0x1a')&&!_[_0xab46('0x44')](_0x4755fe[_0xab46('0x45')]['exten'],'_')){_0x4755fe[_0xab46('0x45')][_0xab46('0x46')]='_'['concat'](_0x4755fe[_0xab46('0x45')][_0xab46('0x46')]);}return db[_0xab46('0x27')][_0xab46('0x47')](_0x4755fe[_0xab46('0x45')],{'raw':![]})[_0xab46('0x16')](function(_0x33b5bd){var _0x4bcb07=_0x4755fe[_0xab46('0x48')][_0xab46('0x49')]({'plain':!![]});if(!_0x4bcb07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bcb07[_0xab46('0x4a')]===_0xab46('0x48')){var _0x283e69=_0x33b5bd['get']({'plain':!![]});var _0x34aedf=[{'name':_0xab46('0x17'),'value':_0xab46('0x18')},{'name':_0xab46('0x19'),'value':'outbound'},{'name':_0xab46('0x4b'),'value':_0xab46('0x4c')}];var _0xc6fb1d=_[_0xab46('0x43')](_0x34aedf,['value',_0x283e69[_0xab46('0x1f')]])['name'];return db[_0xab46('0x4d')]['find']({'where':{'name':_0xc6fb1d,'userProfileId':_0x4bcb07[_0xab46('0x4e')]},'raw':!![]})[_0xab46('0x16')](function(_0x4fefe2){if(_0x4fefe2&&_0x4fefe2[_0xab46('0x4f')]===0x0){return db[_0xab46('0x20')]['create']({'name':_0x283e69['name'],'resourceId':_0x283e69['id'],'type':_0x4fefe2[_0xab46('0x24')],'sectionId':_0x4fefe2['id']},{})[_0xab46('0x16')](function(){return _0x33b5bd;});}else{return _0x33b5bd;}})['catch'](function(_0x22ff7c){logger[_0xab46('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22ff7c);throw _0x22ff7c;});}return _0x33b5bd;})[_0xab46('0x16')](respondWithResult(_0x3633b0,0xc9))['catch'](handleError(_0x3633b0,null));};exports[_0xab46('0x50')]=function(_0x9f2a88,_0x799dc){if(_0x9f2a88[_0xab46('0x45')]['id']){delete _0x9f2a88[_0xab46('0x45')]['id'];}return db[_0xab46('0x27')][_0xab46('0x43')]({'where':{'id':_0x9f2a88[_0xab46('0x40')]['id']}})[_0xab46('0x16')](handleEntityNotFound(_0x799dc,null))[_0xab46('0x16')](function(_0x5672e5){if(_0x5672e5){return db[_0xab46('0x27')][_0xab46('0x50')](_[_0xab46('0x35')](_0x9f2a88[_0xab46('0x45')],[_0xab46('0x46'),_0xab46('0x51'),_0xab46('0x52'),_0xab46('0x53'),_0xab46('0x54'),'mandatoryDisposition',_0xab46('0x55')]),{'where':{'context':_0x5672e5[_0xab46('0x51')],'exten':_0x5672e5[_0xab46('0x46')]},'individualHooks':!![]})[_0xab46('0x16')](function(_0x5bc231){return _0x5bc231;});}return null;})['then'](respondWithStatusCode(_0x799dc,null))['catch'](handleError(_0x799dc,null));};exports['addApplications']=function(_0x499229,_0x400fd4){var _0x2a8377=_0x499229[_0xab46('0x40')]['id'];var _0x4641f3=_0x499229[_0xab46('0x45')];var _0x5265da=0xc8;var _0x155105=null;return db[_0xab46('0x56')]['transaction']({'isolationLevel':db[_0xab46('0x56')][_0xab46('0x57')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x44b35f){return db[_0xab46('0x27')][_0xab46('0x58')]({'where':{'id':_0x2a8377},'transaction':_0x44b35f})[_0xab46('0x16')](function(_0x1134b1){if(_0x1134b1){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x2a8377},'transaction':_0x44b35f})[_0xab46('0x16')](function(){var _0x4d5709=_[_0xab46('0x1c')](_0x4641f3,function(_0x57dd65){_0x57dd65[_0xab46('0x59')]=_0x2a8377;_0x57dd65['isApp']=!![];return _0x57dd65;});return _0x1134b1['createRouting'](_0x4d5709);})[_0xab46('0x16')](function(_0x5226bb){return db[_0xab46('0x27')][_0xab46('0x5a')](_0x5226bb,{'transaction':_0x44b35f});});}else{_0x5265da=0x194;_0x155105=[];}});})['then'](function(){if(_0x5265da!==0x194){return db[_0xab46('0x27')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x2a8377},'order':_0xab46('0x5b')})['then'](function(_0x191487){_0x155105=_0x191487;});}})[_0xab46('0x3e')](function(_0xaf7166){_0x5265da=0x1f4;logger[_0xab46('0x22')](_0xaf7166[_0xab46('0x23')]);if(_0xaf7166[_0xab46('0x24')]){delete _0xaf7166[_0xab46('0x24')];}_0x155105=_0xaf7166;})[_0xab46('0x5c')](function(){if(_0x155105===null){_0x400fd4['sendStatus'](_0x5265da);}else{if(_0x5265da===0x1f4){_0x400fd4[_0xab46('0xf')](_0x5265da)['send'](_0x155105);}else{_0x400fd4['status'](_0x5265da)['json'](_0x155105);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 00964b1..65b8685 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 _0xb098=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5c1f52,_0x1b53b9){var _0x3e5859=function(_0x3d7de1){while(--_0x3d7de1){_0x5c1f52['push'](_0x5c1f52['shift']());}};_0x3e5859(++_0x1b53b9);}(_0xb098,0x8a));var _0x8b09=function(_0x919a3d,_0xf7ae27){_0x919a3d=_0x919a3d-0x0;var _0x1007d7=_0xb098[_0x919a3d];return _0x1007d7;};'use strict';var EventEmitter=require(_0x8b09('0x0'));var VoiceExtension=require(_0x8b09('0x1'))['db'][_0x8b09('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8b09('0x3')](0x0);var events={'afterCreate':_0x8b09('0x4'),'afterUpdate':_0x8b09('0x5'),'afterDestroy':_0x8b09('0x6')};function emitEvent(_0x49857f){return function(_0x41c83f,_0x1b1122,_0xa9bed8){VoiceExtensionEvents[_0x8b09('0x7')](_0x49857f+':'+_0x41c83f['id'],_0x41c83f);VoiceExtensionEvents[_0x8b09('0x7')](_0x49857f,_0x41c83f);_0xa9bed8(null);};}for(var e in events){if(events[_0x8b09('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x8b09('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x2348=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x344677,_0x553bde){var _0x231cf4=function(_0x5635fc){while(--_0x5635fc){_0x344677['push'](_0x344677['shift']());}};_0x231cf4(++_0x553bde);}(_0x2348,0x100));var _0x8234=function(_0x2b6c01,_0x4a1d39){_0x2b6c01=_0x2b6c01-0x0;var _0x4c051e=_0x2348[_0x2b6c01];return _0x4c051e;};'use strict';var EventEmitter=require(_0x8234('0x0'));var VoiceExtension=require(_0x8234('0x1'))['db'][_0x8234('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8234('0x3')](0x0);var events={'afterCreate':_0x8234('0x4'),'afterUpdate':_0x8234('0x5'),'afterDestroy':_0x8234('0x6')};function emitEvent(_0x216fd9){return function(_0x4ec8b6,_0x59bf8c,_0x15ed23){VoiceExtensionEvents[_0x8234('0x7')](_0x216fd9+':'+_0x4ec8b6['id'],_0x4ec8b6);VoiceExtensionEvents[_0x8234('0x7')](_0x216fd9,_0x4ec8b6);_0x15ed23(null);};}for(var e in events){if(events[_0x8234('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x8234('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 26f327e..a0d9797 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 _0x4a3f=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','name','param','SIP','phone','join','U(xcally-mixmonitor-context)','replace','findAll','interval','IntervalId','then','length','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','define','VoiceExtension','voice_extensions','get','Hangup','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none'];(function(_0x24220b,_0x125060){var _0xecae43=function(_0x1b2d93){while(--_0x1b2d93){_0x24220b['push'](_0x24220b['shift']());}};_0xecae43(++_0x125060);}(_0x4a3f,0x1b0));var _0xf4a3=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0x4a3f[_0x42e25e];return _0x1ed3a6;};'use strict';var _=require('lodash');var attributes=require(_0xf4a3('0x0'));module[_0xf4a3('0x1')]=function(_0x2a3b16){var _0x37f9c9=_0x2a3b16[_0xf4a3('0x2')];function _0x32c209(_0x29ddc3){var _0x216780=0x2;var _0x435184=[{'type':_0x29ddc3['type'],'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x4')+_0x29ddc3[_0xf4a3('0x5')],'context':_0x29ddc3[_0xf4a3('0x6')],'exten':_0x29ddc3['exten'],'priority':_0x216780++,'VoiceExtensionId':_0x29ddc3['id']},{'type':_0x29ddc3['type'],'app':_0x29ddc3[_0xf4a3('0x7')]?_0xf4a3('0x3'):_0xf4a3('0x8'),'appdata':_0x29ddc3[_0xf4a3('0x7')]?_0xf4a3('0x9')+_0x29ddc3[_0xf4a3('0x7')]:_0xf4a3('0xa'),'context':_0x29ddc3[_0xf4a3('0x6')],'exten':_0x29ddc3[_0xf4a3('0xb')],'priority':_0x216780++,'VoiceExtensionId':_0x29ddc3['id']}];if(_0x29ddc3['type']===_0xf4a3('0xc')){_0x435184[_0xf4a3('0xd')]({'type':_0xf4a3('0xc'),'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0xe')+_0x29ddc3['id'],'context':_0x29ddc3['context'],'exten':_0x29ddc3[_0xf4a3('0xb')],'priority':_0x216780++,'VoiceExtensionId':_0x29ddc3['id']});}_0x435184[_0xf4a3('0xd')]({'type':_0x29ddc3[_0xf4a3('0x5')],'app':_0xf4a3('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x29ddc3[_0xf4a3('0x6')],'exten':_0x29ddc3[_0xf4a3('0xb')],'priority':_0x216780++,'VoiceExtensionId':_0x29ddc3['id']},{'type':_0x29ddc3['type'],'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0xf'),'context':_0x29ddc3[_0xf4a3('0x6')],'exten':_0x29ddc3[_0xf4a3('0xb')],'priority':_0x216780++,'VoiceExtensionId':_0x29ddc3['id']},{'type':_0x29ddc3[_0xf4a3('0x5')],'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x10'),'context':_0x29ddc3[_0xf4a3('0x6')],'exten':_0x29ddc3['exten'],'priority':_0x216780++,'VoiceExtensionId':_0x29ddc3['id']});return _0x435184;}function _0x4ec4a9(_0x499a86){var _0x5ea5b3=0x2;var _0x1b28dc=[{'type':'outbound','app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x11'),'context':_0x499a86[_0xf4a3('0x6')],'exten':_0x499a86['exten'],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':_0xf4a3('0x12'),'app':_0x499a86['alias']?'Set':_0xf4a3('0x8'),'appdata':_0x499a86[_0xf4a3('0x7')]?_0xf4a3('0x9')+_0x499a86[_0xf4a3('0x7')]:_0xf4a3('0xa'),'context':_0x499a86['context'],'exten':_0x499a86['exten'],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':'outbound','app':_0xf4a3('0x3'),'appdata':'CDR(destination)='+(_0x499a86['cutdigits']?_0xf4a3('0x13')+_0x499a86[_0xf4a3('0x14')]+'}':_0xf4a3('0x15')),'context':_0x499a86[_0xf4a3('0x6')],'exten':_0x499a86[_0xf4a3('0xb')],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':'outbound','app':'Set','appdata':_0xf4a3('0xe')+_0x499a86['id'],'context':_0x499a86['context'],'exten':_0x499a86[_0xf4a3('0xb')],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':_0xf4a3('0x12'),'app':_0xf4a3('0x16'),'appdata':_0xf4a3('0x17')+(_0x5ea5b3+0x2)+_0xf4a3('0x18')+(_0x5ea5b3+0x1)+')','context':_0x499a86['context'],'exten':_0x499a86['exten'],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':'outbound','app':'Set','appdata':_0x499a86[_0xf4a3('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x499a86[_0xf4a3('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x499a86[_0xf4a3('0x6')],'exten':_0x499a86['exten'],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':_0xf4a3('0x12'),'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x19'),'context':_0x499a86[_0xf4a3('0x6')],'exten':_0x499a86[_0xf4a3('0xb')],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':_0xf4a3('0x12'),'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0xf'),'context':_0x499a86['context'],'exten':_0x499a86[_0xf4a3('0xb')],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':'outbound','app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x10'),'context':_0x499a86[_0xf4a3('0x6')],'exten':_0x499a86[_0xf4a3('0xb')],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':_0xf4a3('0x12'),'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x1a')+_0x499a86['id'],'context':_0x499a86[_0xf4a3('0x6')],'exten':_0x499a86[_0xf4a3('0xb')],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']}];if(_0x499a86[_0xf4a3('0x1b')](_0xf4a3('0x1c'))&&_0x499a86[_0xf4a3('0x1c')]!==_0xf4a3('0x1d')){_0x1b28dc['push']({'type':_0xf4a3('0x12'),'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x1e'),'context':_0x499a86['context'],'exten':_0x499a86['exten'],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']},{'type':_0xf4a3('0x12'),'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x1f')+_0x499a86[_0xf4a3('0x1c')]||_0xf4a3('0x20'),'context':_0x499a86[_0xf4a3('0x6')],'exten':_0x499a86[_0xf4a3('0xb')],'priority':_0x5ea5b3++,'VoiceExtensionId':_0x499a86['id']});}return _0x1b28dc;}function _0x36b15b(_0x34f078,_0x54ec98){var _0x1cbd45=[{'name':_0xf4a3('0x21'),'param':0x0},{'name':_0xf4a3('0x22'),'param':0x1},{'name':_0xf4a3('0x23'),'param':0x2},{'name':'url','param':0x3}];var _0x45cf7f={};var _0x3cd7d3=_0x54ec98[_0xf4a3('0x24')](',');var _0x2a854d=[];for(var _0x8a5ed7=0x0;_0x8a5ed7<_0x1cbd45['length'];_0x8a5ed7++){switch(_0x1cbd45[_0x8a5ed7][_0xf4a3('0x25')]){case _0xf4a3('0x21'):_0x45cf7f[_0xf4a3('0x21')]=_0x3cd7d3[_0x1cbd45[_0x8a5ed7][_0xf4a3('0x26')]]['split']('/')[0x1];_0x45cf7f['phone']=_0x3cd7d3[_0x1cbd45[_0x8a5ed7][_0xf4a3('0x26')]][_0xf4a3('0x24')]('/')[0x2];_0x45cf7f['prefix']=_0x45cf7f['phone']?_0x45cf7f['phone']['split']('$')[0x0]:undefined;_0x45cf7f['phone']=_0x34f078[_0xf4a3('0x14')]?(_0x45cf7f['prefix']||'')+_0xf4a3('0x13')+_0x34f078[_0xf4a3('0x14')]+'}':(_0x45cf7f['prefix']||'')+_0xf4a3('0x15');_0x2a854d[_0x1cbd45[_0x8a5ed7]['param']]=[_0xf4a3('0x27'),_0x45cf7f[_0xf4a3('0x21')],_0x45cf7f[_0xf4a3('0x28')]][_0xf4a3('0x29')]('/');break;case _0xf4a3('0x23'):_0x45cf7f[_0xf4a3('0x23')]=_0x3cd7d3[_0x1cbd45[_0x8a5ed7]['param']];if(_0x34f078[_0xf4a3('0x1c')]!==_0xf4a3('0x1d')){if(_0x45cf7f[_0xf4a3('0x23')]['indexOf'](_0xf4a3('0x2a'))<0x0){_0x45cf7f[_0xf4a3('0x23')]+='U(xcally-mixmonitor-context)';}}else{_0x45cf7f[_0xf4a3('0x23')]=_0x45cf7f['options'][_0xf4a3('0x2b')](_0xf4a3('0x2a'),'');}_0x2a854d[_0x1cbd45[_0x8a5ed7][_0xf4a3('0x26')]]=_0x45cf7f[_0xf4a3('0x23')];break;default:_0x2a854d[_0x1cbd45[_0x8a5ed7][_0xf4a3('0x26')]]=_0x3cd7d3[_0x1cbd45[_0x8a5ed7][_0xf4a3('0x26')]];}}return _0x2a854d[_0xf4a3('0x29')](',');}function _0x1619b2(_0x54274f,_0x4aa7f4,_0x35b54e){return new Promise(function(_0x41b81b,_0x5cfb0c){var _0xa53c3c=[];if(_['isEmpty'](_0x4aa7f4))return _0x41b81b(_0xa53c3c);_0x37f9c9['Interval'][_0xf4a3('0x2c')]({'attributes':['id',_0xf4a3('0x2d'),_0xf4a3('0x2e')],'raw':!![]})[_0xf4a3('0x2f')](function(_0x27e62c){for(var _0x580593=0x0,_0x39c754=0x0;_0x580593<_0x4aa7f4[_0xf4a3('0x30')];_0x580593++,_0x39c754=0x0){var _0x1fb95c=_0x4aa7f4[_0x580593];var _0x5001f4=[];var _0x2d1de6=[];delete _0x1fb95c['id'];if(_0x1fb95c[_0xf4a3('0x2d')]!=='*,*,*,*'){_0x1fb95c[_0xf4a3('0x31')]=[_0x1fb95c[_0xf4a3('0x2d')]];}else{_0x1fb95c[_0xf4a3('0x31')]=_0x1fb95c[_0xf4a3('0x2e')]?_[_0xf4a3('0x32')](_[_0xf4a3('0x33')](_0x27e62c,{'IntervalId':_0x1fb95c[_0xf4a3('0x2e')]}),'interval'):[];}_0x1fb95c[_0xf4a3('0x6')]=_0x54274f['context'];_0x1fb95c[_0xf4a3('0xb')]=_0x54274f[_0xf4a3('0xb')];if(_0x1fb95c[_0xf4a3('0x5')])_0x1fb95c[_0xf4a3('0x5')]=_0x1fb95c[_0xf4a3('0x5')][_0xf4a3('0x34')]();if(_0x54274f[_0xf4a3('0x5')]===_0xf4a3('0x12')){if(_0x1fb95c[_0xf4a3('0x1b')]('tag')&&_0x1fb95c[_0xf4a3('0x35')]&&_0x1fb95c['tag']!=='--'){_0x5001f4[_0xf4a3('0xd')]({'type':_0x1fb95c['type']['toLowerCase'](),'app':_0xf4a3('0x3'),'appdata':'CDR(tag)='+_0x1fb95c['tag'],'context':_0x54274f[_0xf4a3('0x6')],'exten':_0x54274f[_0xf4a3('0xb')],'priority':_0x1fb95c[_0xf4a3('0x31')][_0xf4a3('0x30')]+_0x35b54e+_0x39c754++,'VoiceExtensionId':_0x54274f['id']});}_0x5001f4[_0xf4a3('0xd')]({'type':_0x1fb95c[_0xf4a3('0x5')][_0xf4a3('0x34')](),'app':_0xf4a3('0x16'),'appdata':_0xf4a3('0x36')+(_0x1fb95c[_0xf4a3('0x37')]?'Set(CALLERID(all)='+_0x1fb95c[_0xf4a3('0x37')]+')':_0xf4a3('0x38')),'context':_0x54274f[_0xf4a3('0x6')],'exten':_0x54274f['exten'],'priority':_0x1fb95c[_0xf4a3('0x31')][_0xf4a3('0x30')]+_0x35b54e+_0x39c754++,'VoiceExtensionId':_0x54274f['id']});}else{if(_0x1fb95c[_0xf4a3('0x1b')](_0xf4a3('0x39'))){if([_0xf4a3('0x3a'),'playback']['includes'](_0x1fb95c[_0xf4a3('0x3b')][_0xf4a3('0x34')]())&&_0x1fb95c[_0xf4a3('0x3c')]!==_0xf4a3('0x3d')){if(_0x1fb95c[_0xf4a3('0x39')]){_0x5001f4[_0xf4a3('0xd')]({'type':_0x1fb95c['type'][_0xf4a3('0x34')](),'app':_0xf4a3('0x16'),'appdata':_0xf4a3('0x3e'),'context':_0x54274f[_0xf4a3('0x6')],'exten':_0x54274f[_0xf4a3('0xb')],'priority':_0x1fb95c[_0xf4a3('0x31')][_0xf4a3('0x30')]+_0x35b54e+_0x39c754++,'VoiceExtensionId':_0x54274f['id']});_0x5001f4[_0xf4a3('0xd')]({'type':_0x1fb95c[_0xf4a3('0x5')][_0xf4a3('0x34')](),'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x3f'),'context':_0x54274f[_0xf4a3('0x6')],'exten':_0x54274f['exten'],'priority':_0x1fb95c[_0xf4a3('0x31')][_0xf4a3('0x30')]+_0x35b54e+_0x39c754++,'VoiceExtensionId':_0x54274f['id']});}else{_0x5001f4['push']({'type':_0x1fb95c[_0xf4a3('0x5')][_0xf4a3('0x34')](),'app':_0xf4a3('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x54274f[_0xf4a3('0x6')],'exten':_0x54274f[_0xf4a3('0xb')],'priority':_0x1fb95c['intervals'][_0xf4a3('0x30')]+_0x35b54e+_0x39c754++,'VoiceExtensionId':_0x54274f['id']});_0x5001f4[_0xf4a3('0xd')]({'type':_0x1fb95c[_0xf4a3('0x5')][_0xf4a3('0x34')](),'app':_0xf4a3('0x3'),'appdata':_0xf4a3('0x40'),'context':_0x54274f['context'],'exten':_0x54274f['exten'],'priority':_0x1fb95c[_0xf4a3('0x31')]['length']+_0x35b54e+_0x39c754++,'VoiceExtensionId':_0x54274f['id']});}}}}for(var _0xf2db4c=0x0;_0xf2db4c<_0x1fb95c[_0xf4a3('0x31')][_0xf4a3('0x30')];_0xf2db4c++){var _0x22ee35=_0x35b54e+_0x1fb95c[_0xf4a3('0x31')][_0xf4a3('0x30')];var _0x39ec3b=_0xf2db4c===_0x1fb95c[_0xf4a3('0x31')][_0xf4a3('0x30')]-0x1?_0x35b54e+_0x5001f4[_0xf4a3('0x30')]+_0x2d1de6[_0xf4a3('0x30')]+0x2:_0x35b54e+_0xf2db4c+0x1;_0x5001f4[_0xf4a3('0x41')](_0xf2db4c,0x0,{'type':_0x54274f['type'],'app':_0xf4a3('0x42'),'appdata':_0x1fb95c[_0xf4a3('0x31')][_0xf2db4c]+'?'+_0x54274f[_0xf4a3('0x6')]+_0xf4a3('0x43')+_0x22ee35+':'+_0x54274f[_0xf4a3('0x6')]+_0xf4a3('0x43')+_0x39ec3b,'exten':_0x54274f['exten'],'context':_0x54274f[_0xf4a3('0x6')],'priority':_0x35b54e+_0xf2db4c,'VoiceExtensionId':_0x54274f['id']});}if(_0x1fb95c[_0xf4a3('0x3c')]==='outboundDial')_0x1fb95c[_0xf4a3('0x44')]=_0x36b15b(_0x54274f,_0x1fb95c[_0xf4a3('0x44')]);_0x1fb95c[_0xf4a3('0x45')]=_0x5001f4[_0xf4a3('0x30')]?_[_0xf4a3('0x46')](_0x5001f4)[_0xf4a3('0x45')]+0x1:_0x35b54e;_0xa53c3c=_[_0xf4a3('0x47')](_0xa53c3c,_0x5001f4,[_0x1fb95c],_0x2d1de6);_0x35b54e=_[_0xf4a3('0x46')](_0xa53c3c)[_0xf4a3('0x45')]+0x1;}return _0x41b81b(_0xa53c3c);})['catch'](function(_0x2e4019){_0x5cfb0c(_0x2e4019);});});}return _0x2a3b16[_0xf4a3('0x48')](_0xf4a3('0x49'),attributes,{'tableName':_0xf4a3('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x106eb8){var _0x5d9b34=this[_0xf4a3('0x4b')]({'plain':!![]});var _0xcee447=_0x5d9b34['type']===_0xf4a3('0x12')?_0x4ec4a9(_0x5d9b34):_0x32c209(_0x5d9b34);return _0x1619b2(_0x5d9b34,_0x106eb8,_['last'](_0xcee447)[_0xf4a3('0x45')]+0x1)['then'](function(_0x4b052d){var _0x9a800d=_[_0xf4a3('0x47')](_0xcee447,_0x4b052d);_0x9a800d[_0xf4a3('0xd')]({'type':_0x5d9b34['type'],'app':_0xf4a3('0x4c'),'exten':_0x5d9b34['exten'],'context':_0x5d9b34[_0xf4a3('0x6')],'priority':_[_0xf4a3('0x46')](_0x9a800d)[_0xf4a3('0x45')]+0x1,'VoiceExtensionId':_0x5d9b34['id']});return _0x9a800d;});}}});}; \ No newline at end of file +var _0x6b71=['outbound','${EXTEN:','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','timeout','url','length','name','trunk','param','split','phone','prefix','options','none','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','queue','playback','includes','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','priority','last','concat','catch','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','type','Set','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x2a91ac,_0x645ec3){var _0x487f00=function(_0xfa2cc2){while(--_0xfa2cc2){_0x2a91ac['push'](_0x2a91ac['shift']());}};_0x487f00(++_0x645ec3);}(_0x6b71,0x12c));var _0x16b7=function(_0x584e52,_0x5443dc){_0x584e52=_0x584e52-0x0;var _0x5cf710=_0x6b71[_0x584e52];return _0x5cf710;};'use strict';var _=require(_0x16b7('0x0'));var attributes=require(_0x16b7('0x1'));module['exports']=function(_0x349f1e){var _0x4729d8=_0x349f1e['models'];function _0x3158d6(_0x7dd5fe){var _0x212683=0x2;var _0x3b15dd=[{'type':_0x7dd5fe[_0x16b7('0x2')],'app':_0x16b7('0x3'),'appdata':'CDR(type)='+_0x7dd5fe['type'],'context':_0x7dd5fe[_0x16b7('0x4')],'exten':_0x7dd5fe['exten'],'priority':_0x212683++,'VoiceExtensionId':_0x7dd5fe['id']},{'type':_0x7dd5fe[_0x16b7('0x2')],'app':_0x7dd5fe[_0x16b7('0x5')]?_0x16b7('0x3'):_0x16b7('0x6'),'appdata':_0x7dd5fe['alias']?_0x16b7('0x7')+_0x7dd5fe['alias']:_0x16b7('0x8'),'context':_0x7dd5fe['context'],'exten':_0x7dd5fe[_0x16b7('0x9')],'priority':_0x212683++,'VoiceExtensionId':_0x7dd5fe['id']}];if(_0x7dd5fe['type']==='inbound'){_0x3b15dd[_0x16b7('0xa')]({'type':_0x16b7('0xb'),'app':'Set','appdata':_0x16b7('0xc')+_0x7dd5fe['id'],'context':_0x7dd5fe[_0x16b7('0x4')],'exten':_0x7dd5fe[_0x16b7('0x9')],'priority':_0x212683++,'VoiceExtensionId':_0x7dd5fe['id']});}_0x3b15dd['push']({'type':_0x7dd5fe[_0x16b7('0x2')],'app':_0x16b7('0x3'),'appdata':_0x16b7('0xd'),'context':_0x7dd5fe[_0x16b7('0x4')],'exten':_0x7dd5fe[_0x16b7('0x9')],'priority':_0x212683++,'VoiceExtensionId':_0x7dd5fe['id']},{'type':_0x7dd5fe[_0x16b7('0x2')],'app':_0x16b7('0x3'),'appdata':_0x16b7('0xe'),'context':_0x7dd5fe[_0x16b7('0x4')],'exten':_0x7dd5fe['exten'],'priority':_0x212683++,'VoiceExtensionId':_0x7dd5fe['id']},{'type':_0x7dd5fe['type'],'app':_0x16b7('0x3'),'appdata':_0x16b7('0xf'),'context':_0x7dd5fe[_0x16b7('0x4')],'exten':_0x7dd5fe['exten'],'priority':_0x212683++,'VoiceExtensionId':_0x7dd5fe['id']});return _0x3b15dd;}function _0xf9c442(_0x1aeb47){var _0x27afcf=0x2;var _0x27a346=[{'type':_0x16b7('0x10'),'app':_0x16b7('0x3'),'appdata':'CDR(type)=outbound','context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':_0x16b7('0x10'),'app':_0x1aeb47[_0x16b7('0x5')]?'Set':'NoOp','appdata':_0x1aeb47[_0x16b7('0x5')]?_0x16b7('0x7')+_0x1aeb47[_0x16b7('0x5')]:_0x16b7('0x8'),'context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':'outbound','app':_0x16b7('0x3'),'appdata':'CDR(destination)='+(_0x1aeb47['cutdigits']?_0x16b7('0x11')+_0x1aeb47[_0x16b7('0x12')]+'}':_0x16b7('0x13')),'context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':'outbound','app':'Set','appdata':_0x16b7('0xc')+_0x1aeb47['id'],'context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':'outbound','app':_0x16b7('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x27afcf+0x2)+_0x16b7('0x15')+(_0x27afcf+0x1)+')','context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':'outbound','app':_0x16b7('0x3'),'appdata':_0x1aeb47['cutdigits']?_0x16b7('0x16')+_0x1aeb47['cutdigits']+'}':_0x16b7('0x17'),'context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':_0x16b7('0x10'),'app':_0x16b7('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':_0x16b7('0x10'),'app':_0x16b7('0x3'),'appdata':_0x16b7('0xe'),'context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':_0x16b7('0x10'),'app':_0x16b7('0x3'),'appdata':_0x16b7('0xf'),'context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':_0x16b7('0x10'),'app':_0x16b7('0x3'),'appdata':_0x16b7('0x18')+_0x1aeb47['id'],'context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']}];if(_0x1aeb47[_0x16b7('0x19')](_0x16b7('0x1a'))&&_0x1aeb47[_0x16b7('0x1a')]!=='none'){_0x27a346[_0x16b7('0xa')]({'type':'outbound','app':_0x16b7('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47['exten'],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']},{'type':_0x16b7('0x10'),'app':_0x16b7('0x3'),'appdata':_0x16b7('0x1b')+_0x1aeb47[_0x16b7('0x1a')]||'wav','context':_0x1aeb47[_0x16b7('0x4')],'exten':_0x1aeb47[_0x16b7('0x9')],'priority':_0x27afcf++,'VoiceExtensionId':_0x1aeb47['id']});}return _0x27a346;}function _0x5a83d5(_0x102f4d,_0x401563){var _0x1dfbed=[{'name':'trunk','param':0x0},{'name':_0x16b7('0x1c'),'param':0x1},{'name':'options','param':0x2},{'name':_0x16b7('0x1d'),'param':0x3}];var _0x17356d={};var _0xe91266=_0x401563['split'](',');var _0x38e7fe=[];for(var _0xc3062e=0x0;_0xc3062e<_0x1dfbed[_0x16b7('0x1e')];_0xc3062e++){switch(_0x1dfbed[_0xc3062e][_0x16b7('0x1f')]){case _0x16b7('0x20'):_0x17356d['trunk']=_0xe91266[_0x1dfbed[_0xc3062e][_0x16b7('0x21')]][_0x16b7('0x22')]('/')[0x1];_0x17356d[_0x16b7('0x23')]=_0xe91266[_0x1dfbed[_0xc3062e]['param']][_0x16b7('0x22')]('/')[0x2];_0x17356d[_0x16b7('0x24')]=_0x17356d[_0x16b7('0x23')]?_0x17356d[_0x16b7('0x23')]['split']('$')[0x0]:undefined;_0x17356d['phone']=_0x102f4d[_0x16b7('0x12')]?(_0x17356d[_0x16b7('0x24')]||'')+'${EXTEN:'+_0x102f4d[_0x16b7('0x12')]+'}':(_0x17356d[_0x16b7('0x24')]||'')+_0x16b7('0x13');_0x38e7fe[_0x1dfbed[_0xc3062e][_0x16b7('0x21')]]=['SIP',_0x17356d[_0x16b7('0x20')],_0x17356d[_0x16b7('0x23')]]['join']('/');break;case _0x16b7('0x25'):_0x17356d[_0x16b7('0x25')]=_0xe91266[_0x1dfbed[_0xc3062e][_0x16b7('0x21')]];if(_0x102f4d['recordingFormat']!==_0x16b7('0x26')){if(_0x17356d[_0x16b7('0x25')][_0x16b7('0x27')]('U(xcally-mixmonitor-context)')<0x0){_0x17356d['options']+=_0x16b7('0x28');}}else{_0x17356d[_0x16b7('0x25')]=_0x17356d[_0x16b7('0x25')][_0x16b7('0x29')](_0x16b7('0x28'),'');}_0x38e7fe[_0x1dfbed[_0xc3062e]['param']]=_0x17356d[_0x16b7('0x25')];break;default:_0x38e7fe[_0x1dfbed[_0xc3062e][_0x16b7('0x21')]]=_0xe91266[_0x1dfbed[_0xc3062e][_0x16b7('0x21')]];}}return _0x38e7fe[_0x16b7('0x2a')](',');}function _0x347806(_0xaae9d9,_0x2d7d2d,_0x1341c1){return new Promise(function(_0x394903,_0x1817fd){var _0x21d5de=[];if(_[_0x16b7('0x2b')](_0x2d7d2d))return _0x394903(_0x21d5de);_0x4729d8[_0x16b7('0x2c')][_0x16b7('0x2d')]({'attributes':['id',_0x16b7('0x2e'),_0x16b7('0x2f')],'raw':!![]})[_0x16b7('0x30')](function(_0x4aa322){for(var _0x16a764=0x0,_0x2d732c=0x0;_0x16a764<_0x2d7d2d[_0x16b7('0x1e')];_0x16a764++,_0x2d732c=0x0){var _0x524c72=_0x2d7d2d[_0x16a764];var _0x27a536=[];var _0x42154d=[];delete _0x524c72['id'];if(_0x524c72['interval']!==_0x16b7('0x31')){_0x524c72[_0x16b7('0x32')]=[_0x524c72[_0x16b7('0x2e')]];}else{_0x524c72[_0x16b7('0x32')]=_0x524c72['IntervalId']?_[_0x16b7('0x33')](_[_0x16b7('0x34')](_0x4aa322,{'IntervalId':_0x524c72['IntervalId']}),_0x16b7('0x2e')):[];}_0x524c72[_0x16b7('0x4')]=_0xaae9d9[_0x16b7('0x4')];_0x524c72[_0x16b7('0x9')]=_0xaae9d9[_0x16b7('0x9')];if(_0x524c72[_0x16b7('0x2')])_0x524c72[_0x16b7('0x2')]=_0x524c72['type']['toLowerCase']();if(_0xaae9d9[_0x16b7('0x2')]===_0x16b7('0x10')){if(_0x524c72[_0x16b7('0x19')]('tag')&&_0x524c72['tag']&&_0x524c72[_0x16b7('0x35')]!=='--'){_0x27a536[_0x16b7('0xa')]({'type':_0x524c72[_0x16b7('0x2')][_0x16b7('0x36')](),'app':_0x16b7('0x3'),'appdata':_0x16b7('0x37')+_0x524c72['tag'],'context':_0xaae9d9[_0x16b7('0x4')],'exten':_0xaae9d9[_0x16b7('0x9')],'priority':_0x524c72[_0x16b7('0x32')][_0x16b7('0x1e')]+_0x1341c1+_0x2d732c++,'VoiceExtensionId':_0xaae9d9['id']});}_0x27a536[_0x16b7('0xa')]({'type':_0x524c72['type']['toLowerCase'](),'app':_0x16b7('0x14'),'appdata':_0x16b7('0x38')+(_0x524c72[_0x16b7('0x39')]?_0x16b7('0x3a')+_0x524c72[_0x16b7('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0xaae9d9['context'],'exten':_0xaae9d9['exten'],'priority':_0x524c72[_0x16b7('0x32')]['length']+_0x1341c1+_0x2d732c++,'VoiceExtensionId':_0xaae9d9['id']});}else{if(_0x524c72[_0x16b7('0x19')]('answer')){if([_0x16b7('0x3b'),_0x16b7('0x3c')][_0x16b7('0x3d')](_0x524c72[_0x16b7('0x3e')][_0x16b7('0x36')]())&&_0x524c72[_0x16b7('0x3f')]!==_0x16b7('0x40')){if(_0x524c72[_0x16b7('0x41')]){_0x27a536['push']({'type':_0x524c72[_0x16b7('0x2')][_0x16b7('0x36')](),'app':_0x16b7('0x14'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xaae9d9[_0x16b7('0x4')],'exten':_0xaae9d9[_0x16b7('0x9')],'priority':_0x524c72[_0x16b7('0x32')][_0x16b7('0x1e')]+_0x1341c1+_0x2d732c++,'VoiceExtensionId':_0xaae9d9['id']});_0x27a536[_0x16b7('0xa')]({'type':_0x524c72['type'][_0x16b7('0x36')](),'app':'Set','appdata':_0x16b7('0x42'),'context':_0xaae9d9[_0x16b7('0x4')],'exten':_0xaae9d9[_0x16b7('0x9')],'priority':_0x524c72[_0x16b7('0x32')][_0x16b7('0x1e')]+_0x1341c1+_0x2d732c++,'VoiceExtensionId':_0xaae9d9['id']});}else{_0x27a536['push']({'type':_0x524c72[_0x16b7('0x2')][_0x16b7('0x36')](),'app':'ExecIf','appdata':_0x16b7('0x43'),'context':_0xaae9d9[_0x16b7('0x4')],'exten':_0xaae9d9[_0x16b7('0x9')],'priority':_0x524c72[_0x16b7('0x32')][_0x16b7('0x1e')]+_0x1341c1+_0x2d732c++,'VoiceExtensionId':_0xaae9d9['id']});_0x27a536[_0x16b7('0xa')]({'type':_0x524c72['type'][_0x16b7('0x36')](),'app':_0x16b7('0x3'),'appdata':_0x16b7('0x44'),'context':_0xaae9d9['context'],'exten':_0xaae9d9[_0x16b7('0x9')],'priority':_0x524c72[_0x16b7('0x32')][_0x16b7('0x1e')]+_0x1341c1+_0x2d732c++,'VoiceExtensionId':_0xaae9d9['id']});}}}}for(var _0x43d852=0x0;_0x43d852<_0x524c72[_0x16b7('0x32')][_0x16b7('0x1e')];_0x43d852++){var _0x2dbd2a=_0x1341c1+_0x524c72[_0x16b7('0x32')][_0x16b7('0x1e')];var _0x476abd=_0x43d852===_0x524c72[_0x16b7('0x32')][_0x16b7('0x1e')]-0x1?_0x1341c1+_0x27a536[_0x16b7('0x1e')]+_0x42154d[_0x16b7('0x1e')]+0x2:_0x1341c1+_0x43d852+0x1;_0x27a536[_0x16b7('0x45')](_0x43d852,0x0,{'type':_0xaae9d9['type'],'app':'GotoIfTime','appdata':_0x524c72['intervals'][_0x43d852]+'?'+_0xaae9d9[_0x16b7('0x4')]+_0x16b7('0x46')+_0x2dbd2a+':'+_0xaae9d9[_0x16b7('0x4')]+',${EXTEN},'+_0x476abd,'exten':_0xaae9d9['exten'],'context':_0xaae9d9['context'],'priority':_0x1341c1+_0x43d852,'VoiceExtensionId':_0xaae9d9['id']});}if(_0x524c72[_0x16b7('0x3f')]==='outboundDial')_0x524c72['appdata']=_0x5a83d5(_0xaae9d9,_0x524c72[_0x16b7('0x47')]);_0x524c72[_0x16b7('0x48')]=_0x27a536[_0x16b7('0x1e')]?_[_0x16b7('0x49')](_0x27a536)[_0x16b7('0x48')]+0x1:_0x1341c1;_0x21d5de=_[_0x16b7('0x4a')](_0x21d5de,_0x27a536,[_0x524c72],_0x42154d);_0x1341c1=_[_0x16b7('0x49')](_0x21d5de)[_0x16b7('0x48')]+0x1;}return _0x394903(_0x21d5de);})[_0x16b7('0x4b')](function(_0x40403a){_0x1817fd(_0x40403a);});});}return _0x349f1e['define'](_0x16b7('0x4c'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x35a1da){var _0x2da7f1=this[_0x16b7('0x4d')]({'plain':!![]});var _0x3b82ac=_0x2da7f1[_0x16b7('0x2')]==='outbound'?_0xf9c442(_0x2da7f1):_0x3158d6(_0x2da7f1);return _0x347806(_0x2da7f1,_0x35a1da,_[_0x16b7('0x49')](_0x3b82ac)[_0x16b7('0x48')]+0x1)['then'](function(_0x4dad47){var _0x569e92=_['concat'](_0x3b82ac,_0x4dad47);_0x569e92['push']({'type':_0x2da7f1[_0x16b7('0x2')],'app':_0x16b7('0x4e'),'exten':_0x2da7f1['exten'],'context':_0x2da7f1[_0x16b7('0x4')],'priority':_[_0x16b7('0x49')](_0x569e92)[_0x16b7('0x48')]+0x1,'VoiceExtensionId':_0x2da7f1['id']});return _0x569e92;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 812f356..90a1b71 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 _0x2e65=['code','message','result','catch','GetVoiceExtension','findAll','options','attributes','limit','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3911a0,_0x399077){var _0xf3dd14=function(_0x40561d){while(--_0x40561d){_0x3911a0['push'](_0x3911a0['shift']());}};_0xf3dd14(++_0x399077);}(_0x2e65,0x193));var _0x52e6=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x2e65[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var moment=require(_0x52e6('0x2'));var BPromise=require(_0x52e6('0x3'));var rs=require(_0x52e6('0x4'));var fs=require('fs');var Redis=require(_0x52e6('0x5'));var db=require(_0x52e6('0x6'))['db'];var utils=require(_0x52e6('0x7'));var logger=require('../../config/logger')(_0x52e6('0x8'));var config=require(_0x52e6('0x9'));var jayson=require(_0x52e6('0xa'));var client=jayson[_0x52e6('0xb')][_0x52e6('0xc')]({'port':0x232a});config[_0x52e6('0xd')]=_[_0x52e6('0xe')](config[_0x52e6('0xd')],{'host':_0x52e6('0xf'),'port':0x18eb});var socket=require(_0x52e6('0x10'))(new Redis(config['redis']));require(_0x52e6('0x11'))[_0x52e6('0x12')](socket);function respondWithRpcPromise(_0x556442,_0x330040,_0x543f78){return new BPromise(function(_0x52b3ee,_0x471d57){return client[_0x52e6('0x13')](_0x556442,_0x543f78)[_0x52e6('0x14')](function(_0x465542){logger[_0x52e6('0x15')](_0x52e6('0x16'),_0x330040,'request\x20sent');logger['debug'](_0x52e6('0x17'),_0x330040,_0x52e6('0x18'),JSON['stringify'](_0x465542));if(_0x465542[_0x52e6('0x19')]){if(_0x465542[_0x52e6('0x19')][_0x52e6('0x1a')]===0x1f4){logger[_0x52e6('0x19')](_0x52e6('0x16'),_0x330040,_0x465542[_0x52e6('0x19')][_0x52e6('0x1b')]);return _0x471d57(_0x465542[_0x52e6('0x19')][_0x52e6('0x1b')]);}logger[_0x52e6('0x19')](_0x52e6('0x16'),_0x330040,_0x465542[_0x52e6('0x19')][_0x52e6('0x1b')]);return _0x52b3ee(_0x465542[_0x52e6('0x19')]['message']);}else{logger[_0x52e6('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x330040,'request\x20sent');_0x52b3ee(_0x465542[_0x52e6('0x1c')][_0x52e6('0x1b')]);}})[_0x52e6('0x1d')](function(_0x538568){logger[_0x52e6('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x330040,_0x538568);_0x471d57(_0x538568);});});}exports[_0x52e6('0x1e')]=function(_0x2a07ea){var _0x3cf7f0=this;return new Promise(function(_0x59aaa2,_0xf2df3){return db['VoiceExtension'][_0x52e6('0x1f')]({'raw':_0x2a07ea[_0x52e6('0x20')]?_0x2a07ea[_0x52e6('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2a07ea[_0x52e6('0x20')]?_0x2a07ea[_0x52e6('0x20')]['where']||null:null,'attributes':_0x2a07ea['options']?_0x2a07ea['options'][_0x52e6('0x21')]||null:null,'limit':_0x2a07ea['options']?_0x2a07ea[_0x52e6('0x20')][_0x52e6('0x22')]||null:null,'include':_0x2a07ea[_0x52e6('0x20')]?_0x2a07ea[_0x52e6('0x20')][_0x52e6('0x23')]?_['map'](_0x2a07ea[_0x52e6('0x20')]['include'],function(_0x1119e5){return{'model':db[_0x1119e5[_0x52e6('0x24')]],'as':_0x1119e5['as'],'attributes':_0x1119e5[_0x52e6('0x21')],'include':_0x1119e5[_0x52e6('0x23')]?_[_0x52e6('0x25')](_0x1119e5[_0x52e6('0x23')],function(_0x408b8e){return{'model':db[_0x408b8e[_0x52e6('0x24')]],'as':_0x408b8e['as'],'attributes':_0x408b8e[_0x52e6('0x21')],'include':_0x408b8e[_0x52e6('0x23')]?_['map'](_0x408b8e[_0x52e6('0x23')],function(_0x255fcd){return{'model':db[_0x255fcd[_0x52e6('0x24')]],'as':_0x255fcd['as'],'attributes':_0x255fcd[_0x52e6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x52e6('0x14')](function(_0xa4817a){logger[_0x52e6('0x15')]('GetVoiceExtension',_0x2a07ea);logger['debug'](_0x52e6('0x1e'),_0x2a07ea,JSON[_0x52e6('0x26')](_0xa4817a));_0x59aaa2(_0xa4817a);})[_0x52e6('0x1d')](function(_0x1e2299){logger[_0x52e6('0x19')]('GetVoiceExtension',_0x1e2299['message'],_0x2a07ea);_0xf2df3(_0x3cf7f0[_0x52e6('0x19')](0x1f4,_0x1e2299[_0x52e6('0x1b')]));});});}; \ No newline at end of file +var _0x8ce1=['limit','include','model','map','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where'];(function(_0x2d6749,_0x4e45b6){var _0x51b479=function(_0x2e6e07){while(--_0x2e6e07){_0x2d6749['push'](_0x2d6749['shift']());}};_0x51b479(++_0x4e45b6);}(_0x8ce1,0x152));var _0x18ce=function(_0x50f5cb,_0x6db79b){_0x50f5cb=_0x50f5cb-0x0;var _0x50b749=_0x8ce1[_0x50f5cb];return _0x50b749;};'use strict';var _=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var moment=require(_0x18ce('0x2'));var BPromise=require(_0x18ce('0x3'));var rs=require(_0x18ce('0x4'));var fs=require('fs');var Redis=require(_0x18ce('0x5'));var db=require(_0x18ce('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x18ce('0x7'))(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var jayson=require(_0x18ce('0xa'));var client=jayson['client'][_0x18ce('0xb')]({'port':0x232a});config[_0x18ce('0xc')]=_['defaults'](config[_0x18ce('0xc')],{'host':_0x18ce('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x18ce('0xc')]));require('./voiceExtension.socket')[_0x18ce('0xe')](socket);function respondWithRpcPromise(_0x21e931,_0x3f43d6,_0x1596ec){return new BPromise(function(_0x42cbc6,_0x59b4f2){return client['request'](_0x21e931,_0x1596ec)[_0x18ce('0xf')](function(_0x48c5f4){logger['info'](_0x18ce('0x10'),_0x3f43d6,_0x18ce('0x11'));logger[_0x18ce('0x12')](_0x18ce('0x13'),_0x3f43d6,_0x18ce('0x11'),JSON[_0x18ce('0x14')](_0x48c5f4));if(_0x48c5f4['error']){if(_0x48c5f4[_0x18ce('0x15')][_0x18ce('0x16')]===0x1f4){logger[_0x18ce('0x15')](_0x18ce('0x10'),_0x3f43d6,_0x48c5f4[_0x18ce('0x15')][_0x18ce('0x17')]);return _0x59b4f2(_0x48c5f4[_0x18ce('0x15')]['message']);}logger[_0x18ce('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x3f43d6,_0x48c5f4['error']['message']);return _0x42cbc6(_0x48c5f4['error'][_0x18ce('0x17')]);}else{logger[_0x18ce('0x18')](_0x18ce('0x10'),_0x3f43d6,'request\x20sent');_0x42cbc6(_0x48c5f4[_0x18ce('0x19')][_0x18ce('0x17')]);}})[_0x18ce('0x1a')](function(_0x293979){logger['error'](_0x18ce('0x10'),_0x3f43d6,_0x293979);_0x59b4f2(_0x293979);});});}exports[_0x18ce('0x1b')]=function(_0x49615e){var _0x381699=this;return new Promise(function(_0x466c1a,_0x43ff5e){return db[_0x18ce('0x1c')]['findAll']({'raw':_0x49615e['options']?_0x49615e[_0x18ce('0x1d')][_0x18ce('0x1e')]===undefined?!![]:![]:!![],'where':_0x49615e[_0x18ce('0x1d')]?_0x49615e[_0x18ce('0x1d')][_0x18ce('0x1f')]||null:null,'attributes':_0x49615e[_0x18ce('0x1d')]?_0x49615e['options']['attributes']||null:null,'limit':_0x49615e['options']?_0x49615e[_0x18ce('0x1d')][_0x18ce('0x20')]||null:null,'include':_0x49615e[_0x18ce('0x1d')]?_0x49615e[_0x18ce('0x1d')][_0x18ce('0x21')]?_['map'](_0x49615e[_0x18ce('0x1d')][_0x18ce('0x21')],function(_0x1469cf){return{'model':db[_0x1469cf['model']],'as':_0x1469cf['as'],'attributes':_0x1469cf['attributes'],'include':_0x1469cf[_0x18ce('0x21')]?_['map'](_0x1469cf['include'],function(_0x5caa01){return{'model':db[_0x5caa01[_0x18ce('0x22')]],'as':_0x5caa01['as'],'attributes':_0x5caa01['attributes'],'include':_0x5caa01[_0x18ce('0x21')]?_[_0x18ce('0x23')](_0x5caa01[_0x18ce('0x21')],function(_0xd07835){return{'model':db[_0xd07835['model']],'as':_0xd07835['as'],'attributes':_0xd07835[_0x18ce('0x24')]};}):[]};}):[]};}):[]:[]})[_0x18ce('0xf')](function(_0x9bfe7c){logger[_0x18ce('0x18')](_0x18ce('0x1b'),_0x49615e);logger[_0x18ce('0x12')]('GetVoiceExtension',_0x49615e,JSON['stringify'](_0x9bfe7c));_0x466c1a(_0x9bfe7c);})['catch'](function(_0x43a92a){logger[_0x18ce('0x15')](_0x18ce('0x1b'),_0x43a92a[_0x18ce('0x17')],_0x49615e);_0x43ff5e(_0x381699[_0x18ce('0x15')](0x1f4,_0x43a92a[_0x18ce('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index ec7a50a..42d3136 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 _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x5a9621,_0x2c4106){var _0x2b87f0=function(_0x278f91){while(--_0x278f91){_0x5a9621['push'](_0x5a9621['shift']());}};_0x2b87f0(++_0x2c4106);}(_0x0295,0x1f0));var _0x5029=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0x0295[_0x499210];return _0x2e153d;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x1445ed,_0x338fbf){var _0xeb2b8e=function(_0x4c02fb){while(--_0x4c02fb){_0x1445ed['push'](_0x1445ed['shift']());}};_0xeb2b8e(++_0x338fbf);}(_0x53ec,0x192));var _0xc53e=function(_0x3360f3,_0x344f01){_0x3360f3=_0x3360f3-0x0;var _0x45e856=_0x53ec[_0x3360f3];return _0x45e856;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 2957c91..2650066 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 _0xd046=['get','show','getMessages','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMail.controller','index'];(function(_0x43832f,_0x319c43){var _0x234007=function(_0x10a2aa){while(--_0x10a2aa){_0x43832f['push'](_0x43832f['shift']());}};_0x234007(++_0x319c43);}(_0xd046,0x129));var _0x6d04=function(_0x14db16,_0x3af44f){_0x14db16=_0x14db16-0x0;var _0x5d3812=_0xd046[_0x14db16];return _0x5d3812;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['post']('/',auth[_0x6d04('0xa')](),controller['create']);router['put']('/:id',auth[_0x6d04('0xa')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')](_0x6d04('0xd'),auth['isAuthenticated'](),controller[_0x6d04('0xe')]);module[_0x6d04('0xf')]=router; \ No newline at end of file +var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','get','/:id','show','/:id/messages','getMessages','post','create','put'];(function(_0xf5d85b,_0x39631b){var _0x1608a4=function(_0x2bc329){while(--_0x2bc329){_0xf5d85b['push'](_0xf5d85b['shift']());}};_0x1608a4(++_0x39631b);}(_0x53ec,0x192));var _0xc53e=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0x53ec[_0x4551f6];return _0x581dc2;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 80ca915..a366c9f 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 _0x3f5f=['contest_mailbox','setDataValue','string','trim','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x3f5f,0xa6));var _0xf3f5=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0x3f5f[_0x33d4a2];return _0x2c793f;};'use strict';var Sequelize=require(_0xf3f5('0x0'));module[_0xf3f5('0x1')]={'customer_id':{'type':Sequelize[_0xf3f5('0x2')]},'context':{'type':Sequelize[_0xf3f5('0x2')],'defaultValue':_0xf3f5('0x3'),'unique':_0xf3f5('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xf3f5('0x2')]},'fullname':{'type':Sequelize[_0xf3f5('0x2')]},'email':{'type':Sequelize[_0xf3f5('0x2')],'validate':{'isEmail':!![]},'set':function(_0x579af6){this[_0xf3f5('0x5')]('email',typeof _0x579af6===_0xf3f5('0x6')&&_0x579af6[_0xf3f5('0x7')]()?_0x579af6['trim']():null);}},'pager':{'type':Sequelize[_0xf3f5('0x2')]},'tz':{'type':Sequelize[_0xf3f5('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf3f5('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xf3f5('0x9')](_0xf3f5('0x8'),'no'),'defaultValue':_0xf3f5('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0xf3f5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf3f5('0x9')](_0xf3f5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf3f5('0x9')](_0xf3f5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf3f5('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf3f5('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xf3f5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xf3f5('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xf3f5('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf3f5('0x9')](_0xf3f5('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf3f5('0x9')](_0xf3f5('0x8'),'no'),'defaultValue':_0xf3f5('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xf3f5('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf3f5('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf3f5('0xc')],'get':function(){return this[_0xf3f5('0xd')](_0xf3f5('0xe'))+_0xf3f5('0xf')+this['getDataValue'](_0xf3f5('0x10'));}}}; \ No newline at end of file +var _0x5606=['STRING','email','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','from-voicemail','contest_mailbox'];(function(_0x160c95,_0x8b7291){var _0x45dd63=function(_0x59f755){while(--_0x59f755){_0x160c95['push'](_0x160c95['shift']());}};_0x45dd63(++_0x8b7291);}(_0x5606,0x1bd));var _0x6560=function(_0x460a4c,_0x43e0f4){_0x460a4c=_0x460a4c-0x0;var _0x5af742=_0x5606[_0x460a4c];return _0x5af742;};'use strict';var Sequelize=require(_0x6560('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x6560('0x1'),'unique':_0x6560('0x2')},'mailbox':{'type':Sequelize[_0x6560('0x3')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x6560('0x3')]},'fullname':{'type':Sequelize[_0x6560('0x3')]},'email':{'type':Sequelize[_0x6560('0x3')],'validate':{'isEmail':!![]},'set':function(_0x5166a0){this['setDataValue'](_0x6560('0x4'),typeof _0x5166a0===_0x6560('0x5')&&_0x5166a0['trim']()?_0x5166a0[_0x6560('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x6560('0x3')],'defaultValue':_0x6560('0x7')},'attach':{'type':Sequelize[_0x6560('0x8')](_0x6560('0x9'),'no'),'defaultValue':_0x6560('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6560('0x8')](_0x6560('0x9'),'no'),'defaultValue':_0x6560('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x6560('0x3')]},'callback':{'type':Sequelize[_0x6560('0x3')]},'review':{'type':Sequelize[_0x6560('0x8')](_0x6560('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6560('0x8')](_0x6560('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6560('0x8')](_0x6560('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6560('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6560('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6560('0x8')](_0x6560('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6560('0x8')](_0x6560('0x9'),'no'),'defaultValue':_0x6560('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x6560('0x8')](_0x6560('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x6560('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x6560('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x6560('0x3')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x6560('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6560('0xc')](_0x6560('0xd'))+_0x6560('0xe')+this['getDataValue'](_0x6560('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 6a99f4a..73e2d41 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 _0x6e6c=['sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','length','find','create','user','UserProfileSection','autoAssociation','UserProfileResource','body','params','findOne','VoiceMailMessage','nolimit','mailbox','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order'];(function(_0x4412bd,_0x1d02df){var _0x2b56b8=function(_0x5d093c){while(--_0x5d093c){_0x4412bd['push'](_0x4412bd['shift']());}};_0x2b56b8(++_0x1d02df);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];function respondWithStatusCode(_0x525d60,_0x3a30ce){_0x3a30ce=_0x3a30ce||0xcc;return function(_0x314d0f){if(_0x314d0f){return _0x525d60[_0xc6e6('0x17')](_0x3a30ce);}return _0x525d60[_0xc6e6('0x18')](_0x3a30ce)['end']();};}function respondWithResult(_0x149ac6,_0x2bfe7d){_0x2bfe7d=_0x2bfe7d||0xc8;return function(_0x13be73){if(_0x13be73){return _0x149ac6[_0xc6e6('0x18')](_0x2bfe7d)[_0xc6e6('0x19')](_0x13be73);}};}function respondWithFilteredResult(_0x4cdf15,_0x413cf8){return function(_0x178b34){if(_0x178b34){var _0x569474=typeof _0x413cf8[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x413cf8[_0xc6e6('0x1c')]==='undefined';var _0x51fd7c=_0x178b34['count'];var _0x3a1ccc=_0x569474?0x0:_0x413cf8['offset'];var _0x46e58f=_0x569474?_0x178b34[_0xc6e6('0x1d')]:_0x413cf8[_0xc6e6('0x1a')]+_0x413cf8[_0xc6e6('0x1c')];var _0x19e1e4;if(_0x46e58f>=_0x51fd7c){_0x46e58f=_0x51fd7c;_0x19e1e4=0xc8;}else{_0x19e1e4=0xce;}_0x4cdf15[_0xc6e6('0x18')](_0x19e1e4);return _0x4cdf15[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x3a1ccc+'-'+_0x46e58f+'/'+_0x51fd7c)[_0xc6e6('0x19')](_0x178b34);}return null;};}function patchUpdates(_0x3d734d){return function(_0x4a36b6){try{jsonpatch[_0xc6e6('0x20')](_0x4a36b6,_0x3d734d,!![]);}catch(_0x4ad70e){return BPromise[_0xc6e6('0x21')](_0x4ad70e);}return _0x4a36b6[_0xc6e6('0x22')]();};}function saveUpdates(_0x2be6fc,_0x2f69f1){return function(_0x4f1d68){if(_0x4f1d68){return _0x4f1d68[_0xc6e6('0x23')](_0x2be6fc)[_0xc6e6('0x24')](function(_0x3a96df){return _0x3a96df;});}return null;};}function removeEntity(_0x36ebfa,_0x107561){return function(_0x4c35ae){if(_0x4c35ae){return _0x4c35ae[_0xc6e6('0x25')]()['then'](function(){var _0x266786=_0x4c35ae[_0xc6e6('0x26')]({'plain':!![]});var _0x2e5e0e=_0xc6e6('0x27');return db['UserProfileResource'][_0xc6e6('0x25')]({'where':{'type':_0x2e5e0e,'resourceId':_0x266786['id']}})['then'](function(){return _0x4c35ae;});})[_0xc6e6('0x24')](function(){_0x36ebfa['status'](0xcc)[_0xc6e6('0x28')]();});}};}function handleEntityNotFound(_0x16dcd9,_0x348888){return function(_0x41e7c2){if(!_0x41e7c2){_0x16dcd9[_0xc6e6('0x17')](0x194);}return _0x41e7c2;};}function handleError(_0x5e34f6,_0x346480){_0x346480=_0x346480||0x1f4;return function(_0x1501bd){logger[_0xc6e6('0x29')](_0x1501bd[_0xc6e6('0x2a')]);if(_0x1501bd['name']){delete _0x1501bd[_0xc6e6('0x2b')];}_0x5e34f6['status'](_0x346480)[_0xc6e6('0x2c')](_0x1501bd);};}exports[_0xc6e6('0x2d')]=function(_0x12c616,_0xc578b3){var _0xd3b63={},_0x402598={},_0x43ff9c={'count':0x0,'rows':[]};var _0x337442=_[_0xc6e6('0x2e')](db[_0xc6e6('0x2f')][_0xc6e6('0x30')],function(_0x214d6a){return{'name':_0x214d6a[_0xc6e6('0x31')],'type':_0x214d6a[_0xc6e6('0x32')][_0xc6e6('0x33')]};});_0x402598[_0xc6e6('0x34')]=_[_0xc6e6('0x2e')](_0x337442,'name');_0x402598[_0xc6e6('0x35')]=_[_0xc6e6('0x36')](_0x12c616['query']);_0x402598['filters']=_[_0xc6e6('0x37')](_0x402598[_0xc6e6('0x34')],_0x402598[_0xc6e6('0x35')]);_0xd3b63[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x402598[_0xc6e6('0x34')],qs['fields'](_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x39')]));_0xd3b63[_0xc6e6('0x38')]=_0xd3b63['attributes']['length']?_0xd3b63[_0xc6e6('0x38')]:_0x402598[_0xc6e6('0x34')];if(!_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x3a')]('nolimit')){_0xd3b63['limit']=qs[_0xc6e6('0x1c')](_0x12c616['query'][_0xc6e6('0x1c')]);_0xd3b63['offset']=qs[_0xc6e6('0x1a')](_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x1a')]);}_0xd3b63[_0xc6e6('0x3b')]=qs['sort'](_0x12c616['query'][_0xc6e6('0x3c')]);_0xd3b63[_0xc6e6('0x3d')]=qs[_0xc6e6('0x3e')](_[_0xc6e6('0x3f')](_0x12c616['query'],_0x402598['filters']),_0x337442);if(_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x40')]){_0xd3b63[_0xc6e6('0x3d')]=_[_0xc6e6('0x41')](_0xd3b63['where'],{'$or':_[_0xc6e6('0x2e')](_0x337442,function(_0x46c3ef){if(_0x46c3ef['type']!=='VIRTUAL'){var _0x2b01fd={};_0x2b01fd[_0x46c3ef['name']]={'$like':'%'+_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x40')]+'%'};return _0x2b01fd;}})});}_0xd3b63=_['merge']({},_0xd3b63,_0x12c616[_0xc6e6('0x42')]);var _0x50c96d={'where':_0xd3b63[_0xc6e6('0x3d')]};return db['VoiceMail'][_0xc6e6('0x1d')](_0x50c96d)[_0xc6e6('0x24')](function(_0x247076){_0x43ff9c[_0xc6e6('0x1d')]=_0x247076;if(_0x12c616[_0xc6e6('0x35')][_0xc6e6('0x43')]){_0xd3b63[_0xc6e6('0x44')]=[{'all':!![]}];}return db[_0xc6e6('0x2f')][_0xc6e6('0x45')](_0xd3b63);})['then'](function(_0x3e3da6){_0x43ff9c[_0xc6e6('0x46')]=_0x3e3da6;return _0x43ff9c;})[_0xc6e6('0x24')](respondWithFilteredResult(_0xc578b3,_0xd3b63))[_0xc6e6('0x47')](handleError(_0xc578b3,null));};exports['show']=function(_0xc5f4fb,_0x825640){var _0x3a46ee={'raw':!![],'where':{'id':_0xc5f4fb['params']['id']}},_0x2fa3c5={};_0x2fa3c5[_0xc6e6('0x34')]=_[_0xc6e6('0x36')](db[_0xc6e6('0x2f')][_0xc6e6('0x30')]);_0x2fa3c5[_0xc6e6('0x35')]=_['keys'](_0xc5f4fb[_0xc6e6('0x35')]);_0x2fa3c5['filters']=_[_0xc6e6('0x37')](_0x2fa3c5['model'],_0x2fa3c5[_0xc6e6('0x35')]);_0x3a46ee[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x2fa3c5[_0xc6e6('0x34')],qs[_0xc6e6('0x39')](_0xc5f4fb[_0xc6e6('0x35')][_0xc6e6('0x39')]));_0x3a46ee[_0xc6e6('0x38')]=_0x3a46ee['attributes'][_0xc6e6('0x48')]?_0x3a46ee[_0xc6e6('0x38')]:_0x2fa3c5[_0xc6e6('0x34')];if(_0xc5f4fb['query'][_0xc6e6('0x43')]){_0x3a46ee[_0xc6e6('0x44')]=[{'all':!![]}];}_0x3a46ee=_[_0xc6e6('0x41')]({},_0x3a46ee,_0xc5f4fb[_0xc6e6('0x42')]);return db[_0xc6e6('0x2f')][_0xc6e6('0x49')](_0x3a46ee)[_0xc6e6('0x24')](handleEntityNotFound(_0x825640,null))[_0xc6e6('0x24')](respondWithResult(_0x825640,null))[_0xc6e6('0x47')](handleError(_0x825640,null));};exports[_0xc6e6('0x4a')]=function(_0x3bfe85,_0x470167){return db[_0xc6e6('0x2f')][_0xc6e6('0x4a')](_0x3bfe85['body'],{})[_0xc6e6('0x24')](function(_0x5566df){var _0x2c48e7=_0x3bfe85[_0xc6e6('0x4b')]['get']({'plain':!![]});if(!_0x2c48e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c48e7['role']==='user'){var _0x531dca=_0x5566df[_0xc6e6('0x26')]({'plain':!![]});var _0x40bbe9=_0xc6e6('0x27');return db[_0xc6e6('0x4c')][_0xc6e6('0x49')]({'where':{'name':_0x40bbe9,'userProfileId':_0x2c48e7['userProfileId']},'raw':!![]})['then'](function(_0x335229){if(_0x335229&&_0x335229[_0xc6e6('0x4d')]===0x0){return db[_0xc6e6('0x4e')][_0xc6e6('0x4a')]({'name':_0x531dca['name'],'resourceId':_0x531dca['id'],'type':_0x335229[_0xc6e6('0x2b')],'sectionId':_0x335229['id']},{})[_0xc6e6('0x24')](function(){return _0x5566df;});}else{return _0x5566df;}})[_0xc6e6('0x47')](function(_0x286dcf){logger[_0xc6e6('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x286dcf);throw _0x286dcf;});}return _0x5566df;})[_0xc6e6('0x24')](respondWithResult(_0x470167,0xc9))[_0xc6e6('0x47')](handleError(_0x470167,null));};exports[_0xc6e6('0x23')]=function(_0x5113e3,_0x3df0db){if(_0x5113e3[_0xc6e6('0x4f')]['id']){delete _0x5113e3[_0xc6e6('0x4f')]['id'];}return db[_0xc6e6('0x2f')][_0xc6e6('0x49')]({'where':{'id':_0x5113e3['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3df0db,null))[_0xc6e6('0x24')](saveUpdates(_0x5113e3[_0xc6e6('0x4f')],null))[_0xc6e6('0x24')](respondWithResult(_0x3df0db,null))[_0xc6e6('0x47')](handleError(_0x3df0db,null));};exports['destroy']=function(_0x5a7391,_0x58b09b){return db[_0xc6e6('0x2f')][_0xc6e6('0x49')]({'where':{'id':_0x5a7391[_0xc6e6('0x50')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x58b09b,null))[_0xc6e6('0x24')](removeEntity(_0x58b09b,null))[_0xc6e6('0x47')](handleError(_0x58b09b,null));};exports['getMessages']=function(_0xcd3d5d,_0x50f52a,_0x26f0e0){return db[_0xc6e6('0x2f')][_0xc6e6('0x51')]({'where':{'id':_0xcd3d5d['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x50f52a,null))['then'](function(_0x3b6822){var _0x50ac31;var _0x4a3bb1={},_0x18e101={};_0x18e101['model']=_['keys'](db[_0xc6e6('0x52')][_0xc6e6('0x30')]);_0x18e101[_0xc6e6('0x35')]=_[_0xc6e6('0x36')](_0xcd3d5d[_0xc6e6('0x35')]);_0x18e101[_0xc6e6('0x3e')]=_[_0xc6e6('0x37')](_0x18e101[_0xc6e6('0x34')],_0x18e101['query']);_0x4a3bb1[_0xc6e6('0x38')]=_[_0xc6e6('0x37')](_0x18e101[_0xc6e6('0x34')],qs[_0xc6e6('0x39')](_0xcd3d5d['query'][_0xc6e6('0x39')]));_0x4a3bb1[_0xc6e6('0x38')]=_0x4a3bb1[_0xc6e6('0x38')]['length']?_0x4a3bb1['attributes']:_0x18e101[_0xc6e6('0x34')];if(!_0xcd3d5d['query']['hasOwnProperty'](_0xc6e6('0x53'))){_0x4a3bb1[_0xc6e6('0x1c')]=qs[_0xc6e6('0x1c')](_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x1c')]);_0x4a3bb1[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x1a')]);}_0x4a3bb1[_0xc6e6('0x3b')]=qs[_0xc6e6('0x3c')](_0xcd3d5d['query']['sort']);_0x4a3bb1[_0xc6e6('0x3d')]=qs['filters'](_['pick'](_0xcd3d5d[_0xc6e6('0x35')],_0x18e101[_0xc6e6('0x3e')]));if(_0xcd3d5d[_0xc6e6('0x35')]['filter']){_0x4a3bb1[_0xc6e6('0x3d')]=_[_0xc6e6('0x41')](_0x4a3bb1['where'],{'$or':_['map'](_0x4a3bb1[_0xc6e6('0x38')],function(_0x31329c){var _0x9d69b5={};_0x9d69b5[_0x31329c]={'$like':'%'+_0xcd3d5d[_0xc6e6('0x35')][_0xc6e6('0x40')]+'%'};return _0x9d69b5;})});}_0x4a3bb1[_0xc6e6('0x3d')]=_['merge'](_0x4a3bb1[_0xc6e6('0x3d')],{'mailboxuser':_0x3b6822[_0xc6e6('0x54')]});_0x4a3bb1=_[_0xc6e6('0x41')]({},_0x4a3bb1,_0xcd3d5d[_0xc6e6('0x42')]);return db[_0xc6e6('0x52')]['findAndCountAll'](_0x4a3bb1)[_0xc6e6('0x24')](respondWithFilteredResult(_0x50f52a,_0x4a3bb1));})[_0xc6e6('0x47')](handleError(_0x50f52a,null));}; \ No newline at end of file +var _0xe5b5=['stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','filter','where','merge','options','VoiceMail','includeAll','include','findAll','catch','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMessages','VoiceMailMessage','pick','mailbox','findAndCountAll','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/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0xe5b5[_0x5b64a1];return _0x4b6f55;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require(_0x5e5b('0xc'));var fs=require('fs');var fs_extra=require(_0x5e5b('0xd'));var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xb'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310f71,_0x18434e){_0x18434e=_0x18434e||0xcc;return function(_0x4559a0){if(_0x4559a0){return _0x310f71[_0x5e5b('0x1b')](_0x18434e);}return _0x310f71[_0x5e5b('0x1c')](_0x18434e)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x2e331d,_0x49edd0){_0x49edd0=_0x49edd0||0xc8;return function(_0x2b37fa){if(_0x2b37fa){return _0x2e331d[_0x5e5b('0x1c')](_0x49edd0)['json'](_0x2b37fa);}};}function respondWithFilteredResult(_0x227417,_0x578c14){return function(_0x4e9509){if(_0x4e9509){var _0x13a1cb=typeof _0x578c14[_0x5e5b('0x1e')]===_0x5e5b('0x1f')&&typeof _0x578c14['limit']===_0x5e5b('0x1f');var _0x4d490c=_0x4e9509[_0x5e5b('0x20')];var _0x45a091=_0x13a1cb?0x0:_0x578c14['offset'];var _0xe5aa6b=_0x13a1cb?_0x4e9509[_0x5e5b('0x20')]:_0x578c14[_0x5e5b('0x1e')]+_0x578c14['limit'];var _0x2bf0b7;if(_0xe5aa6b>=_0x4d490c){_0xe5aa6b=_0x4d490c;_0x2bf0b7=0xc8;}else{_0x2bf0b7=0xce;}_0x227417[_0x5e5b('0x1c')](_0x2bf0b7);return _0x227417['set'](_0x5e5b('0x21'),_0x45a091+'-'+_0xe5aa6b+'/'+_0x4d490c)[_0x5e5b('0x22')](_0x4e9509);}return null;};}function patchUpdates(_0x3c488e){return function(_0x2d8252){try{jsonpatch[_0x5e5b('0x23')](_0x2d8252,_0x3c488e,!![]);}catch(_0x33d61b){return BPromise[_0x5e5b('0x24')](_0x33d61b);}return _0x2d8252[_0x5e5b('0x25')]();};}function saveUpdates(_0x4a78e3,_0x512e46){return function(_0x256a00){if(_0x256a00){return _0x256a00[_0x5e5b('0x26')](_0x4a78e3)[_0x5e5b('0x27')](function(_0xe1c268){return _0xe1c268;});}return null;};}function removeEntity(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(_0x135c6c){return _0x135c6c[_0x5e5b('0x28')]()[_0x5e5b('0x27')](function(){var _0x26bc02=_0x135c6c[_0x5e5b('0x29')]({'plain':!![]});var _0x4da321=_0x5e5b('0x2a');return db[_0x5e5b('0x2b')][_0x5e5b('0x28')]({'where':{'type':_0x4da321,'resourceId':_0x26bc02['id']}})['then'](function(){return _0x135c6c;});})[_0x5e5b('0x27')](function(){_0x2e38ed[_0x5e5b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ff91,_0x21c74b){return function(_0x39ce16){if(!_0x39ce16){_0x13ff91[_0x5e5b('0x1b')](0x194);}return _0x39ce16;};}function handleError(_0x31af09,_0x250fbd){_0x250fbd=_0x250fbd||0x1f4;return function(_0x2cb695){logger[_0x5e5b('0x2c')](_0x2cb695[_0x5e5b('0x2d')]);if(_0x2cb695[_0x5e5b('0x2e')]){delete _0x2cb695[_0x5e5b('0x2e')];}_0x31af09[_0x5e5b('0x1c')](_0x250fbd)['send'](_0x2cb695);};}exports['index']=function(_0x365f6f,_0x289f54){var _0xb68419={},_0x3dcdab={},_0x12f1ee={'count':0x0,'rows':[]};var _0x4b9be8=_[_0x5e5b('0x2f')](db['VoiceMail'][_0x5e5b('0x30')],function(_0x384d8f){return{'name':_0x384d8f[_0x5e5b('0x31')],'type':_0x384d8f[_0x5e5b('0x32')]['key']};});_0x3dcdab[_0x5e5b('0x33')]=_[_0x5e5b('0x2f')](_0x4b9be8,'name');_0x3dcdab[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x365f6f[_0x5e5b('0x34')]);_0x3dcdab[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x3dcdab[_0x5e5b('0x33')],_0x3dcdab[_0x5e5b('0x34')]);_0xb68419[_0x5e5b('0x38')]=_['intersection'](_0x3dcdab[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x39')]));_0xb68419[_0x5e5b('0x38')]=_0xb68419[_0x5e5b('0x38')]['length']?_0xb68419['attributes']:_0x3dcdab[_0x5e5b('0x33')];if(!_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0xb68419[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0xb68419['offset']=qs[_0x5e5b('0x1e')](_0x365f6f[_0x5e5b('0x34')]['offset']);}_0xb68419['order']=qs[_0x5e5b('0x3c')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3c')]);_0xb68419['where']=qs[_0x5e5b('0x36')](_['pick'](_0x365f6f['query'],_0x3dcdab[_0x5e5b('0x36')]),_0x4b9be8);if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0xb68419[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0xb68419[_0x5e5b('0x3e')],{'$or':_[_0x5e5b('0x2f')](_0x4b9be8,function(_0x14ac35){if(_0x14ac35[_0x5e5b('0x32')]!=='VIRTUAL'){var _0x1f1907={};_0x1f1907[_0x14ac35[_0x5e5b('0x2e')]]={'$like':'%'+_0x365f6f['query'][_0x5e5b('0x3d')]+'%'};return _0x1f1907;}})});}_0xb68419=_['merge']({},_0xb68419,_0x365f6f[_0x5e5b('0x40')]);var _0x14b152={'where':_0xb68419[_0x5e5b('0x3e')]};return db[_0x5e5b('0x41')][_0x5e5b('0x20')](_0x14b152)[_0x5e5b('0x27')](function(_0x371550){_0x12f1ee[_0x5e5b('0x20')]=_0x371550;if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0xb68419[_0x5e5b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x5e5b('0x44')](_0xb68419);})[_0x5e5b('0x27')](function(_0x46fec9){_0x12f1ee['rows']=_0x46fec9;return _0x12f1ee;})[_0x5e5b('0x27')](respondWithFilteredResult(_0x289f54,_0xb68419))[_0x5e5b('0x45')](handleError(_0x289f54,null));};exports['show']=function(_0x6672d9,_0x44b7be){var _0x5d3135={'raw':!![],'where':{'id':_0x6672d9['params']['id']}},_0x257bb7={};_0x257bb7['model']=_['keys'](db[_0x5e5b('0x41')]['rawAttributes']);_0x257bb7[_0x5e5b('0x34')]=_['keys'](_0x6672d9[_0x5e5b('0x34')]);_0x257bb7[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x257bb7[_0x5e5b('0x33')],_0x257bb7[_0x5e5b('0x34')]);_0x5d3135[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x257bb7['model'],qs['fields'](_0x6672d9[_0x5e5b('0x34')]['fields']));_0x5d3135['attributes']=_0x5d3135['attributes'][_0x5e5b('0x46')]?_0x5d3135['attributes']:_0x257bb7[_0x5e5b('0x33')];if(_0x6672d9[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0x5d3135[_0x5e5b('0x43')]=[{'all':!![]}];}_0x5d3135=_[_0x5e5b('0x3f')]({},_0x5d3135,_0x6672d9[_0x5e5b('0x40')]);return db['VoiceMail'][_0x5e5b('0x47')](_0x5d3135)[_0x5e5b('0x27')](handleEntityNotFound(_0x44b7be,null))['then'](respondWithResult(_0x44b7be,null))[_0x5e5b('0x45')](handleError(_0x44b7be,null));};exports['create']=function(_0x41e4b3,_0x36d8fa){return db[_0x5e5b('0x41')][_0x5e5b('0x48')](_0x41e4b3['body'],{})[_0x5e5b('0x27')](function(_0x1c4efe){var _0x4f4ea3=_0x41e4b3[_0x5e5b('0x49')][_0x5e5b('0x29')]({'plain':!![]});if(!_0x4f4ea3)throw new Error(_0x5e5b('0x4a'));if(_0x4f4ea3[_0x5e5b('0x4b')]===_0x5e5b('0x49')){var _0x5ae8d0=_0x1c4efe['get']({'plain':!![]});var _0x690f8c=_0x5e5b('0x2a');return db['UserProfileSection'][_0x5e5b('0x47')]({'where':{'name':_0x690f8c,'userProfileId':_0x4f4ea3[_0x5e5b('0x4c')]},'raw':!![]})[_0x5e5b('0x27')](function(_0x5a9eae){if(_0x5a9eae&&_0x5a9eae[_0x5e5b('0x4d')]===0x0){return db[_0x5e5b('0x2b')][_0x5e5b('0x48')]({'name':_0x5ae8d0['name'],'resourceId':_0x5ae8d0['id'],'type':_0x5a9eae[_0x5e5b('0x2e')],'sectionId':_0x5a9eae['id']},{})[_0x5e5b('0x27')](function(){return _0x1c4efe;});}else{return _0x1c4efe;}})[_0x5e5b('0x45')](function(_0x4a4e0f){logger['error'](_0x5e5b('0x4e'),_0x4a4e0f);throw _0x4a4e0f;});}return _0x1c4efe;})['then'](respondWithResult(_0x36d8fa,0xc9))['catch'](handleError(_0x36d8fa,null));};exports[_0x5e5b('0x26')]=function(_0x13eee9,_0x4774ee){if(_0x13eee9['body']['id']){delete _0x13eee9[_0x5e5b('0x4f')]['id'];}return db[_0x5e5b('0x41')][_0x5e5b('0x47')]({'where':{'id':_0x13eee9[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x4774ee,null))[_0x5e5b('0x27')](saveUpdates(_0x13eee9['body'],null))['then'](respondWithResult(_0x4774ee,null))[_0x5e5b('0x45')](handleError(_0x4774ee,null));};exports[_0x5e5b('0x28')]=function(_0x1cc741,_0x357e55){return db['VoiceMail'][_0x5e5b('0x47')]({'where':{'id':_0x1cc741['params']['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x357e55,null))[_0x5e5b('0x27')](removeEntity(_0x357e55,null))[_0x5e5b('0x45')](handleError(_0x357e55,null));};exports[_0x5e5b('0x51')]=function(_0x2d17b0,_0x30b010,_0x275930){return db[_0x5e5b('0x41')]['findOne']({'where':{'id':_0x2d17b0[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x30b010,null))[_0x5e5b('0x27')](function(_0x1aea38){var _0x129026;var _0x5543eb={},_0x2ccee2={};_0x2ccee2[_0x5e5b('0x33')]=_[_0x5e5b('0x35')](db[_0x5e5b('0x52')][_0x5e5b('0x30')]);_0x2ccee2['query']=_[_0x5e5b('0x35')](_0x2d17b0['query']);_0x2ccee2[_0x5e5b('0x36')]=_['intersection'](_0x2ccee2[_0x5e5b('0x33')],_0x2ccee2[_0x5e5b('0x34')]);_0x5543eb[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x2ccee2[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x2d17b0['query'][_0x5e5b('0x39')]));_0x5543eb[_0x5e5b('0x38')]=_0x5543eb[_0x5e5b('0x38')][_0x5e5b('0x46')]?_0x5543eb['attributes']:_0x2ccee2['model'];if(!_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0x5543eb[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0x5543eb[_0x5e5b('0x1e')]=qs['offset'](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x1e')]);}_0x5543eb['order']=qs['sort'](_0x2d17b0['query'][_0x5e5b('0x3c')]);_0x5543eb[_0x5e5b('0x3e')]=qs[_0x5e5b('0x36')](_[_0x5e5b('0x53')](_0x2d17b0[_0x5e5b('0x34')],_0x2ccee2['filters']));if(_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0x5543eb['where']=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'$or':_['map'](_0x5543eb[_0x5e5b('0x38')],function(_0x4fa0db){var _0x454026={};_0x454026[_0x4fa0db]={'$like':'%'+_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]+'%'};return _0x454026;})});}_0x5543eb[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'mailboxuser':_0x1aea38[_0x5e5b('0x54')]});_0x5543eb=_[_0x5e5b('0x3f')]({},_0x5543eb,_0x2d17b0[_0x5e5b('0x40')]);return db[_0x5e5b('0x52')][_0x5e5b('0x55')](_0x5543eb)[_0x5e5b('0x27')](respondWithFilteredResult(_0x30b010,_0x5543eb));})[_0x5e5b('0x45')](handleError(_0x30b010,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 0630dc1..4e8d504 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 _0x8dda=['./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x41a559,_0x3e58f9){var _0x507b52=function(_0x1ca204){while(--_0x1ca204){_0x41a559['push'](_0x41a559['shift']());}};_0x507b52(++_0x3e58f9);}(_0x8dda,0x9e));var _0xa8dd=function(_0x1f42bc,_0x208463){_0x1f42bc=_0x1f42bc-0x0;var _0x23f159=_0x8dda[_0x1f42bc];return _0x23f159;};'use strict';var _=require(_0xa8dd('0x0'));var util=require(_0xa8dd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa8dd('0x2'));var BPromise=require(_0xa8dd('0x3'));var rp=require(_0xa8dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8dd('0x5'));var config=require(_0xa8dd('0x6'));var attributes=require(_0xa8dd('0x7'));module[_0xa8dd('0x8')]=function(_0x46bf40,_0xdb1c52){return _0x46bf40[_0xa8dd('0x9')](_0xa8dd('0xa'),attributes,{'tableName':_0xa8dd('0xb'),'paranoid':![],'indexes':[{'name':_0xa8dd('0xc'),'fields':[_0xa8dd('0xd'),_0xa8dd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7079=['api','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7079,0x93));var _0x9707=function(_0xb29cb9,_0x1d950f){_0xb29cb9=_0xb29cb9-0x0;var _0x4d4bd4=_0x7079[_0xb29cb9];return _0x4d4bd4;};'use strict';var _=require(_0x9707('0x0'));var util=require(_0x9707('0x1'));var logger=require(_0x9707('0x2'))(_0x9707('0x3'));var moment=require('moment');var BPromise=require(_0x9707('0x4'));var rp=require(_0x9707('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9707('0x6'));var config=require(_0x9707('0x7'));var attributes=require(_0x9707('0x8'));module[_0x9707('0x9')]=function(_0x1e4e9a,_0x447cec){return _0x1e4e9a[_0x9707('0xa')](_0x9707('0xb'),attributes,{'tableName':_0x9707('0xc'),'paranoid':![],'indexes':[{'name':_0x9707('0xd'),'fields':['mailbox',_0x9707('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 2f5be5b..a60b9ab 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 _0xca43=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','moment'];(function(_0x39985b,_0x18448a){var _0x4885d5=function(_0x1cd37c){while(--_0x1cd37c){_0x39985b['push'](_0x39985b['shift']());}};_0x4885d5(++_0x18448a);}(_0xca43,0x110));var _0x3ca4=function(_0x5d7ebd,_0x407907){_0x5d7ebd=_0x5d7ebd-0x0;var _0x18d101=_0xca43[_0x5d7ebd];return _0x18d101;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3ca4('0x0'));var BPromise=require(_0x3ca4('0x1'));var rs=require(_0x3ca4('0x2'));var fs=require('fs');var Redis=require(_0x3ca4('0x3'));var db=require(_0x3ca4('0x4'))['db'];var utils=require(_0x3ca4('0x5'));var logger=require(_0x3ca4('0x6'))('rpc');var config=require(_0x3ca4('0x7'));var jayson=require(_0x3ca4('0x8'));var client=jayson['client'][_0x3ca4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ef895,_0xb6071f,_0x56db6e){return new BPromise(function(_0x3c9b0e,_0x351866){return client[_0x3ca4('0xa')](_0x4ef895,_0x56db6e)[_0x3ca4('0xb')](function(_0x201653){logger[_0x3ca4('0xc')](_0x3ca4('0xd'),_0xb6071f,_0x3ca4('0xe'));logger[_0x3ca4('0xf')](_0x3ca4('0x10'),_0xb6071f,_0x3ca4('0xe'),JSON['stringify'](_0x201653));if(_0x201653[_0x3ca4('0x11')]){if(_0x201653[_0x3ca4('0x11')][_0x3ca4('0x12')]===0x1f4){logger[_0x3ca4('0x11')](_0x3ca4('0xd'),_0xb6071f,_0x201653[_0x3ca4('0x11')][_0x3ca4('0x13')]);return _0x351866(_0x201653['error'][_0x3ca4('0x13')]);}logger[_0x3ca4('0x11')](_0x3ca4('0xd'),_0xb6071f,_0x201653[_0x3ca4('0x11')][_0x3ca4('0x13')]);return _0x3c9b0e(_0x201653[_0x3ca4('0x11')][_0x3ca4('0x13')]);}else{logger[_0x3ca4('0xc')](_0x3ca4('0xd'),_0xb6071f,'request\x20sent');_0x3c9b0e(_0x201653[_0x3ca4('0x14')][_0x3ca4('0x13')]);}})['catch'](function(_0xc38014){logger[_0x3ca4('0x11')](_0x3ca4('0xd'),_0xb6071f,_0xc38014);_0x351866(_0xc38014);});});} \ No newline at end of file +var _0xfd5c=['result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x25cbac,_0x4745ce){var _0x11c434=function(_0x1e815c){while(--_0x1e815c){_0x25cbac['push'](_0x25cbac['shift']());}};_0x11c434(++_0x4745ce);}(_0xfd5c,0xf1));var _0xcfd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcfd5('0x0'));var util=require(_0xcfd5('0x1'));var moment=require(_0xcfd5('0x2'));var BPromise=require(_0xcfd5('0x3'));var rs=require(_0xcfd5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcfd5('0x5'))(_0xcfd5('0x6'));var config=require(_0xcfd5('0x7'));var jayson=require(_0xcfd5('0x8'));var client=jayson[_0xcfd5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e88f0,_0x345a19,_0x22fc9e){return new BPromise(function(_0x5033c3,_0x3ec60b){return client[_0xcfd5('0xa')](_0x1e88f0,_0x22fc9e)['then'](function(_0x37645a){logger[_0xcfd5('0xb')](_0xcfd5('0xc'),_0x345a19,_0xcfd5('0xd'));logger[_0xcfd5('0xe')](_0xcfd5('0xf'),_0x345a19,_0xcfd5('0xd'),JSON[_0xcfd5('0x10')](_0x37645a));if(_0x37645a[_0xcfd5('0x11')]){if(_0x37645a[_0xcfd5('0x11')]['code']===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x345a19,_0x37645a[_0xcfd5('0x11')][_0xcfd5('0x12')]);return _0x3ec60b(_0x37645a[_0xcfd5('0x11')][_0xcfd5('0x12')]);}logger[_0xcfd5('0x11')](_0xcfd5('0xc'),_0x345a19,_0x37645a[_0xcfd5('0x11')][_0xcfd5('0x12')]);return _0x5033c3(_0x37645a['error'][_0xcfd5('0x12')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x345a19,_0xcfd5('0xd'));_0x5033c3(_0x37645a[_0xcfd5('0x13')]['message']);}})['catch'](function(_0x15ffc3){logger[_0xcfd5('0x11')](_0xcfd5('0xc'),_0x345a19,_0x15ffc3);_0x3ec60b(_0x15ffc3);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 4358bff..16f4e78 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 _0x8f67=['index','show','/:id/download','create','update','/:id','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x5272a3,_0x19af84){var _0x4a53af=function(_0x2c5e10){while(--_0x2c5e10){_0x5272a3['push'](_0x5272a3['shift']());}};_0x4a53af(++_0x19af84);}(_0x8f67,0x1c7));var _0x78f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f67[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x78f6('0x0'));var util=require(_0x78f6('0x1'));var path=require(_0x78f6('0x2'));var timeout=require(_0x78f6('0x3'));var express=require(_0x78f6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x78f6('0x5'));var config=require('../../config/environment');var controller=require(_0x78f6('0x6'));router[_0x78f6('0x7')]('/',auth[_0x78f6('0x8')](),controller[_0x78f6('0x9')]);router[_0x78f6('0x7')]('/:id',auth[_0x78f6('0x8')](),controller[_0x78f6('0xa')]);router['get'](_0x78f6('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x78f6('0x8')](),controller[_0x78f6('0xc')]);router['put']('/:id',auth[_0x78f6('0x8')](),controller[_0x78f6('0xd')]);router['delete'](_0x78f6('0xe'),auth[_0x78f6('0x8')](),controller[_0x78f6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3c76=['get','isAuthenticated','index','show','download','post','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x1add32,_0x396d4f){var _0x5cd0f2=function(_0x5e3524){while(--_0x5e3524){_0x1add32['push'](_0x1add32['shift']());}};_0x5cd0f2(++_0x396d4f);}(_0x3c76,0xd2));var _0x63c7=function(_0x3454f9,_0x5d2f4c){_0x3454f9=_0x3454f9-0x0;var _0x541ee6=_0x3c76[_0x3454f9];return _0x541ee6;};'use strict';var multer=require('multer');var util=require(_0x63c7('0x0'));var path=require(_0x63c7('0x1'));var timeout=require(_0x63c7('0x2'));var express=require(_0x63c7('0x3'));var router=express[_0x63c7('0x4')]();var fs_extra=require(_0x63c7('0x5'));var auth=require(_0x63c7('0x6'));var interaction=require(_0x63c7('0x7'));var config=require(_0x63c7('0x8'));var controller=require(_0x63c7('0x9'));router[_0x63c7('0xa')]('/',auth[_0x63c7('0xb')](),controller[_0x63c7('0xc')]);router[_0x63c7('0xa')]('/:id',auth[_0x63c7('0xb')](),controller[_0x63c7('0xd')]);router['get']('/:id/download',auth[_0x63c7('0xb')](),controller[_0x63c7('0xe')]);router[_0x63c7('0xf')]('/',auth[_0x63c7('0xb')](),controller['create']);router['put'](_0x63c7('0x10'),auth[_0x63c7('0xb')](),controller[_0x63c7('0x11')]);router[_0x63c7('0x12')](_0x63c7('0x10'),auth[_0x63c7('0xb')](),controller['destroy']);module[_0x63c7('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index c3b870d..d4d1161 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 _0x6336=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','STRING','BLOB','TIMESTAMP'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6336,0x10a));var _0x6633=function(_0x1a7891,_0x3dce41){_0x1a7891=_0x1a7891-0x0;var _0x9d76aa=_0x6336[_0x1a7891];return _0x9d76aa;};'use strict';var Sequelize=require('sequelize');module[_0x6633('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xaa2661){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'context':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'duration':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'recording':{'type':Sequelize[_0x6633('0x2')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x6633('0x1')],'defaultValue':''},'stamp':{'type':_0x6633('0x3'),'defaultValue':Sequelize[_0x6633('0x4')](_0x6633('0x5'))}}; \ No newline at end of file +var _0xa2d6=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xa2d6,0x140));var _0x6a2d=function(_0x4febcd,_0x141f0c){_0x4febcd=_0x4febcd-0x0;var _0x253421=_0xa2d6[_0x4febcd];return _0x253421;};'use strict';var Sequelize=require(_0x6a2d('0x0'));module[_0x6a2d('0x1')]={'name':{'type':Sequelize[_0x6a2d('0x2')],'get':function(_0x1e4024){return this[_0x6a2d('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x6a2d('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6a2d('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x6a2d('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6a2d('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6a2d('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6a2d('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x6a2d('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6a2d('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6a2d('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x6a2d('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x6a2d('0x7'),'defaultValue':Sequelize[_0x6a2d('0x8')](_0x6a2d('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 87b0b10..30cb624 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 _0xc3a2=['filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','create','VoiceMailMessage','body','destroy','download','find','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','differenceBy'];(function(_0x60fb74,_0x19ce14){var _0x115828=function(_0x3f55a4){while(--_0x3f55a4){_0x60fb74['push'](_0x60fb74['shift']());}};_0x115828(++_0x19ce14);}(_0xc3a2,0x1e8));var _0x2c3a=function(_0xd088a7,_0x50ad87){_0xd088a7=_0xd088a7-0x0;var _0x49b6b2=_0xc3a2[_0xd088a7];return _0x49b6b2;};'use strict';var emlformat=require(_0x2c3a('0x0'));var rimraf=require(_0x2c3a('0x1'));var zipdir=require(_0x2c3a('0x2'));var jsonpatch=require(_0x2c3a('0x3'));var rp=require(_0x2c3a('0x4'));var moment=require(_0x2c3a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c3a('0x6'));var util=require(_0x2c3a('0x7'));var path=require(_0x2c3a('0x8'));var sox=require(_0x2c3a('0x9'));var csv=require(_0x2c3a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c3a('0xb'));var squel=require(_0x2c3a('0xc'));var crypto=require(_0x2c3a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2c3a('0xa'));var querystring=require(_0x2c3a('0xe'));var Papa=require(_0x2c3a('0xf'));var Redis=require(_0x2c3a('0x10'));var authService=require(_0x2c3a('0x11'));var qs=require(_0x2c3a('0x12'));var as=require(_0x2c3a('0x13'));var hardwareService=require(_0x2c3a('0x14'));var logger=require(_0x2c3a('0x15'))(_0x2c3a('0x16'));var utils=require(_0x2c3a('0x17'));var config=require(_0x2c3a('0x18'));var licenseUtil=require(_0x2c3a('0x19'));var db=require(_0x2c3a('0x1a'))['db'];function respondWithStatusCode(_0x5d214e,_0x4c0975){_0x4c0975=_0x4c0975||0xcc;return function(_0x35fe6e){if(_0x35fe6e){return _0x5d214e[_0x2c3a('0x1b')](_0x4c0975);}return _0x5d214e[_0x2c3a('0x1c')](_0x4c0975)['end']();};}function respondWithResult(_0x138dd9,_0x12f017){_0x12f017=_0x12f017||0xc8;return function(_0x20bfdb){if(_0x20bfdb){return _0x138dd9[_0x2c3a('0x1c')](_0x12f017)['json'](_0x20bfdb);}};}function respondWithFilteredResult(_0x23384e,_0x5b02aa){return function(_0x22d6ef){if(_0x22d6ef){var _0x48786b=typeof _0x5b02aa['offset']===_0x2c3a('0x1d')&&typeof _0x5b02aa[_0x2c3a('0x1e')]===_0x2c3a('0x1d');var _0x4e742e=_0x22d6ef['count'];var _0x1fa5fc=_0x48786b?0x0:_0x5b02aa[_0x2c3a('0x1f')];var _0x165af5=_0x48786b?_0x22d6ef[_0x2c3a('0x20')]:_0x5b02aa[_0x2c3a('0x1f')]+_0x5b02aa[_0x2c3a('0x1e')];var _0xf2adbe;if(_0x165af5>=_0x4e742e){_0x165af5=_0x4e742e;_0xf2adbe=0xc8;}else{_0xf2adbe=0xce;}_0x23384e[_0x2c3a('0x1c')](_0xf2adbe);return _0x23384e['set'](_0x2c3a('0x21'),_0x1fa5fc+'-'+_0x165af5+'/'+_0x4e742e)[_0x2c3a('0x22')](_0x22d6ef);}return null;};}function patchUpdates(_0x5352dd){return function(_0x153973){try{jsonpatch[_0x2c3a('0x23')](_0x153973,_0x5352dd,!![]);}catch(_0xd742ea){return BPromise[_0x2c3a('0x24')](_0xd742ea);}return _0x153973[_0x2c3a('0x25')]();};}function saveUpdates(_0x2ce527,_0x5a1b98){return function(_0x3f07af){if(_0x3f07af){return _0x3f07af[_0x2c3a('0x26')](_0x2ce527)[_0x2c3a('0x27')](function(_0x14e961){return _0x14e961;});}return null;};}function removeEntity(_0x520ce6,_0x2d2346){return function(_0x2f444a){if(_0x2f444a){return _0x2f444a['destroy']()[_0x2c3a('0x27')](function(){_0x520ce6[_0x2c3a('0x1c')](0xcc)[_0x2c3a('0x28')]();});}};}function handleEntityNotFound(_0x3144b9,_0x2526ff){return function(_0x4400b4){if(!_0x4400b4){_0x3144b9[_0x2c3a('0x1b')](0x194);}return _0x4400b4;};}function handleError(_0x450668,_0x208fb6){_0x208fb6=_0x208fb6||0x1f4;return function(_0x5b2f71){logger[_0x2c3a('0x29')](_0x5b2f71[_0x2c3a('0x2a')]);if(_0x5b2f71[_0x2c3a('0x2b')]){delete _0x5b2f71[_0x2c3a('0x2b')];}_0x450668[_0x2c3a('0x1c')](_0x208fb6)[_0x2c3a('0x2c')](_0x5b2f71);};}exports[_0x2c3a('0x2d')]=function(_0x34783f,_0x26c11f){var _0x1bd342={},_0x27a8cc={},_0x8a8d84={'count':0x0,'rows':[]};var _0x45382b=_[_0x2c3a('0x2e')](db['VoiceMailMessage'][_0x2c3a('0x2f')],function(_0x168149){return{'name':_0x168149[_0x2c3a('0x30')],'type':_0x168149[_0x2c3a('0x31')]['key']};});_0x27a8cc[_0x2c3a('0x32')]=_[_0x2c3a('0x33')](_[_0x2c3a('0x2e')](_0x45382b,_0x2c3a('0x2b')),[_0x2c3a('0x2b')]);_0x27a8cc['query']=_['keys'](_0x34783f['query']);_0x27a8cc[_0x2c3a('0x34')]=_[_0x2c3a('0x35')](_0x27a8cc[_0x2c3a('0x32')],_0x27a8cc[_0x2c3a('0x36')]);_0x1bd342[_0x2c3a('0x37')]=_[_0x2c3a('0x35')](_0x27a8cc[_0x2c3a('0x32')],qs['fields'](_0x34783f[_0x2c3a('0x36')][_0x2c3a('0x38')]));_0x1bd342[_0x2c3a('0x37')]=_0x1bd342['attributes'][_0x2c3a('0x39')]?_0x1bd342[_0x2c3a('0x37')]:_0x27a8cc[_0x2c3a('0x32')];if(!_0x34783f[_0x2c3a('0x36')][_0x2c3a('0x3a')](_0x2c3a('0x3b'))){_0x1bd342[_0x2c3a('0x1e')]=qs[_0x2c3a('0x1e')](_0x34783f['query'][_0x2c3a('0x1e')]);_0x1bd342[_0x2c3a('0x1f')]=qs[_0x2c3a('0x1f')](_0x34783f['query'][_0x2c3a('0x1f')]);}_0x1bd342[_0x2c3a('0x3c')]=qs[_0x2c3a('0x3d')](_0x34783f[_0x2c3a('0x36')][_0x2c3a('0x3d')]);_0x1bd342[_0x2c3a('0x3e')]=qs[_0x2c3a('0x34')](_[_0x2c3a('0x3f')](_0x34783f[_0x2c3a('0x36')],_0x27a8cc[_0x2c3a('0x34')]),_0x45382b);if(_0x34783f[_0x2c3a('0x36')]['filter']){_0x1bd342['where']=_[_0x2c3a('0x40')](_0x1bd342[_0x2c3a('0x3e')],{'$or':_[_0x2c3a('0x2e')](_0x45382b,function(_0x4eb3d0){if(_0x4eb3d0[_0x2c3a('0x31')]!==_0x2c3a('0x41')){var _0x4dc9cb={};_0x4dc9cb[_0x4eb3d0[_0x2c3a('0x2b')]]={'$like':'%'+_0x34783f[_0x2c3a('0x36')]['filter']+'%'};return _0x4dc9cb;}})});}_0x1bd342=_[_0x2c3a('0x40')]({},_0x1bd342,_0x34783f[_0x2c3a('0x42')]);var _0x5b8af6={'where':_0x1bd342['where']};return db['VoiceMailMessage'][_0x2c3a('0x20')](_0x5b8af6)[_0x2c3a('0x27')](function(_0x2eccf3){_0x8a8d84['count']=_0x2eccf3;if(_0x34783f['query'][_0x2c3a('0x43')]){_0x1bd342['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x2c3a('0x44')](_0x1bd342);})[_0x2c3a('0x27')](function(_0x3815eb){_0x8a8d84['rows']=_0x3815eb;return _0x8a8d84;})[_0x2c3a('0x27')](respondWithFilteredResult(_0x26c11f,_0x1bd342))[_0x2c3a('0x45')](handleError(_0x26c11f,null));};exports[_0x2c3a('0x46')]=function(_0x4de685,_0x1f431f){var _0x2b0ddb={'raw':!![],'where':{'id':_0x4de685[_0x2c3a('0x47')]['id']}},_0xcfed1a={};_0xcfed1a[_0x2c3a('0x32')]=_[_0x2c3a('0x48')](db['VoiceMailMessage'][_0x2c3a('0x2f')]);_0xcfed1a['query']=_[_0x2c3a('0x48')](_0x4de685[_0x2c3a('0x36')]);_0xcfed1a[_0x2c3a('0x34')]=_[_0x2c3a('0x35')](_0xcfed1a[_0x2c3a('0x32')],_0xcfed1a[_0x2c3a('0x36')]);_0x2b0ddb[_0x2c3a('0x37')]=_[_0x2c3a('0x35')](_0xcfed1a[_0x2c3a('0x32')],qs[_0x2c3a('0x38')](_0x4de685[_0x2c3a('0x36')][_0x2c3a('0x38')]));_0x2b0ddb[_0x2c3a('0x37')]=_0x2b0ddb['attributes'][_0x2c3a('0x39')]?_0x2b0ddb['attributes']:_0xcfed1a[_0x2c3a('0x32')];if(_0x4de685[_0x2c3a('0x36')]['includeAll']){_0x2b0ddb['include']=[{'all':!![]}];}_0x2b0ddb=_[_0x2c3a('0x40')]({},_0x2b0ddb,_0x4de685[_0x2c3a('0x42')]);return db['VoiceMailMessage']['find'](_0x2b0ddb)[_0x2c3a('0x27')](handleEntityNotFound(_0x1f431f,null))['then'](respondWithResult(_0x1f431f,null))[_0x2c3a('0x45')](handleError(_0x1f431f,null));};exports[_0x2c3a('0x49')]=function(_0x547b9b,_0x489f6e){return db[_0x2c3a('0x4a')][_0x2c3a('0x49')](_0x547b9b['body'],{})[_0x2c3a('0x27')](respondWithResult(_0x489f6e,0xc9))[_0x2c3a('0x45')](handleError(_0x489f6e,null));};exports[_0x2c3a('0x26')]=function(_0x6ee841,_0x2c66ae){if(_0x6ee841[_0x2c3a('0x4b')]['id']){delete _0x6ee841[_0x2c3a('0x4b')]['id'];}return db[_0x2c3a('0x4a')]['find']({'where':{'id':_0x6ee841[_0x2c3a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c66ae,null))[_0x2c3a('0x27')](saveUpdates(_0x6ee841[_0x2c3a('0x4b')],null))[_0x2c3a('0x27')](respondWithResult(_0x2c66ae,null))[_0x2c3a('0x45')](handleError(_0x2c66ae,null));};exports[_0x2c3a('0x4c')]=function(_0x552879,_0x1d9d5a){return db[_0x2c3a('0x4a')]['find']({'where':{'id':_0x552879[_0x2c3a('0x47')]['id']}})[_0x2c3a('0x27')](handleEntityNotFound(_0x1d9d5a,null))['then'](removeEntity(_0x1d9d5a,null))[_0x2c3a('0x45')](handleError(_0x1d9d5a,null));};exports[_0x2c3a('0x4d')]=function(_0x229774,_0x13c629,_0x505a4d){return db[_0x2c3a('0x4a')][_0x2c3a('0x4e')]({'where':{'id':_0x229774['params']['id']},'attributes':['id','recording',_0x2c3a('0x4f')]})[_0x2c3a('0x27')](handleEntityNotFound(_0x13c629,null))[_0x2c3a('0x27')](function(_0xd5ae7){if(_0xd5ae7){if(!_0xd5ae7[_0x2c3a('0x50')]){throw new db[(_0x2c3a('0x51'))][(_0x2c3a('0x52'))](_0x2c3a('0x53'));}var _0x390c08={'Content-Type':_0x2c3a('0x54'),'Content-Disposition':_0x2c3a('0x55')};if(_0xd5ae7[_0x2c3a('0x4f')]){_0x390c08[_0x2c3a('0x56')]=_0x2c3a('0x57')+_0xd5ae7[_0x2c3a('0x4f')]+_0x2c3a('0x58');}_0x13c629[_0x2c3a('0x59')](_0x390c08);return _0x13c629[_0x2c3a('0x2c')](new Buffer(_0xd5ae7['recording']));}})[_0x2c3a('0x45')](handleError(_0x13c629,null));}; \ No newline at end of file +var _0x038c=['stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','error'];(function(_0x4ef99f,_0x3cb2b3){var _0x27cd2c=function(_0x4c0f2c){while(--_0x4c0f2c){_0x4ef99f['push'](_0x4ef99f['shift']());}};_0x27cd2c(++_0x3cb2b3);}(_0x038c,0xe2));var _0xc038=function(_0xe4735e,_0x35ac93){_0xe4735e=_0xe4735e-0x0;var _0x44ddba=_0x038c[_0xe4735e];return _0x44ddba;};'use strict';var emlformat=require(_0xc038('0x0'));var rimraf=require(_0xc038('0x1'));var zipdir=require(_0xc038('0x2'));var jsonpatch=require(_0xc038('0x3'));var rp=require(_0xc038('0x4'));var moment=require(_0xc038('0x5'));var BPromise=require(_0xc038('0x6'));var Mustache=require(_0xc038('0x7'));var util=require(_0xc038('0x8'));var path=require(_0xc038('0x9'));var sox=require('sox');var csv=require(_0xc038('0xa'));var ejs=require(_0xc038('0xb'));var fs=require('fs');var fs_extra=require(_0xc038('0xc'));var _=require(_0xc038('0xd'));var squel=require(_0xc038('0xe'));var crypto=require(_0xc038('0xf'));var jsforce=require(_0xc038('0x10'));var deskjs=require(_0xc038('0x11'));var toCsv=require(_0xc038('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc038('0x12'));var authService=require(_0xc038('0x13'));var qs=require(_0xc038('0x14'));var as=require(_0xc038('0x15'));var hardwareService=require(_0xc038('0x16'));var logger=require(_0xc038('0x17'))('api');var utils=require(_0xc038('0x18'));var config=require(_0xc038('0x19'));var licenseUtil=require(_0xc038('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f5930,_0x5304e6){_0x5304e6=_0x5304e6||0xcc;return function(_0x5709f7){if(_0x5709f7){return _0x4f5930['sendStatus'](_0x5304e6);}return _0x4f5930[_0xc038('0x1b')](_0x5304e6)['end']();};}function respondWithResult(_0x5779e6,_0x378ece){_0x378ece=_0x378ece||0xc8;return function(_0x1fd2a0){if(_0x1fd2a0){return _0x5779e6[_0xc038('0x1b')](_0x378ece)[_0xc038('0x1c')](_0x1fd2a0);}};}function respondWithFilteredResult(_0x45160a,_0x2832d3){return function(_0x46691b){if(_0x46691b){var _0x367700=typeof _0x2832d3[_0xc038('0x1d')]===_0xc038('0x1e')&&typeof _0x2832d3[_0xc038('0x1f')]===_0xc038('0x1e');var _0x34a24b=_0x46691b[_0xc038('0x20')];var _0x260780=_0x367700?0x0:_0x2832d3[_0xc038('0x1d')];var _0x29c078=_0x367700?_0x46691b[_0xc038('0x20')]:_0x2832d3[_0xc038('0x1d')]+_0x2832d3[_0xc038('0x1f')];var _0x5dd647;if(_0x29c078>=_0x34a24b){_0x29c078=_0x34a24b;_0x5dd647=0xc8;}else{_0x5dd647=0xce;}_0x45160a[_0xc038('0x1b')](_0x5dd647);return _0x45160a[_0xc038('0x21')]('Content-Range',_0x260780+'-'+_0x29c078+'/'+_0x34a24b)[_0xc038('0x1c')](_0x46691b);}return null;};}function patchUpdates(_0x56bf7c){return function(_0x3e577f){try{jsonpatch[_0xc038('0x22')](_0x3e577f,_0x56bf7c,!![]);}catch(_0x2cacf0){return BPromise['reject'](_0x2cacf0);}return _0x3e577f[_0xc038('0x23')]();};}function saveUpdates(_0x1ca828,_0x21283b){return function(_0x1ba1ca){if(_0x1ba1ca){return _0x1ba1ca[_0xc038('0x24')](_0x1ca828)[_0xc038('0x25')](function(_0x3cb0f9){return _0x3cb0f9;});}return null;};}function removeEntity(_0x53594a,_0x4be654){return function(_0x2bc2a0){if(_0x2bc2a0){return _0x2bc2a0[_0xc038('0x26')]()[_0xc038('0x25')](function(){_0x53594a[_0xc038('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x545a86,_0x18e29a){return function(_0xba3e65){if(!_0xba3e65){_0x545a86[_0xc038('0x27')](0x194);}return _0xba3e65;};}function handleError(_0x1b5b83,_0x2609d9){_0x2609d9=_0x2609d9||0x1f4;return function(_0x4c7771){logger[_0xc038('0x28')](_0x4c7771[_0xc038('0x29')]);if(_0x4c7771[_0xc038('0x2a')]){delete _0x4c7771[_0xc038('0x2a')];}_0x1b5b83[_0xc038('0x1b')](_0x2609d9)[_0xc038('0x2b')](_0x4c7771);};}exports[_0xc038('0x2c')]=function(_0x3818b3,_0x19c12c){var _0x241ca4={},_0xea4854={},_0x32f244={'count':0x0,'rows':[]};var _0x29f1f7=_[_0xc038('0x2d')](db[_0xc038('0x2e')][_0xc038('0x2f')],function(_0x392985){return{'name':_0x392985[_0xc038('0x30')],'type':_0x392985[_0xc038('0x31')][_0xc038('0x32')]};});_0xea4854[_0xc038('0x33')]=_[_0xc038('0x34')](_[_0xc038('0x2d')](_0x29f1f7,_0xc038('0x2a')),[_0xc038('0x2a')]);_0xea4854[_0xc038('0x35')]=_[_0xc038('0x36')](_0x3818b3[_0xc038('0x35')]);_0xea4854[_0xc038('0x37')]=_['intersection'](_0xea4854[_0xc038('0x33')],_0xea4854[_0xc038('0x35')]);_0x241ca4[_0xc038('0x38')]=_[_0xc038('0x39')](_0xea4854[_0xc038('0x33')],qs[_0xc038('0x3a')](_0x3818b3[_0xc038('0x35')]['fields']));_0x241ca4['attributes']=_0x241ca4[_0xc038('0x38')][_0xc038('0x3b')]?_0x241ca4[_0xc038('0x38')]:_0xea4854[_0xc038('0x33')];if(!_0x3818b3['query'][_0xc038('0x3c')]('nolimit')){_0x241ca4[_0xc038('0x1f')]=qs[_0xc038('0x1f')](_0x3818b3[_0xc038('0x35')][_0xc038('0x1f')]);_0x241ca4['offset']=qs[_0xc038('0x1d')](_0x3818b3[_0xc038('0x35')]['offset']);}_0x241ca4[_0xc038('0x3d')]=qs[_0xc038('0x3e')](_0x3818b3[_0xc038('0x35')][_0xc038('0x3e')]);_0x241ca4[_0xc038('0x3f')]=qs[_0xc038('0x37')](_[_0xc038('0x40')](_0x3818b3[_0xc038('0x35')],_0xea4854[_0xc038('0x37')]),_0x29f1f7);if(_0x3818b3[_0xc038('0x35')][_0xc038('0x41')]){_0x241ca4[_0xc038('0x3f')]=_[_0xc038('0x42')](_0x241ca4[_0xc038('0x3f')],{'$or':_[_0xc038('0x2d')](_0x29f1f7,function(_0x4170dd){if(_0x4170dd[_0xc038('0x31')]!==_0xc038('0x43')){var _0x5956cb={};_0x5956cb[_0x4170dd[_0xc038('0x2a')]]={'$like':'%'+_0x3818b3[_0xc038('0x35')]['filter']+'%'};return _0x5956cb;}})});}_0x241ca4=_[_0xc038('0x42')]({},_0x241ca4,_0x3818b3[_0xc038('0x44')]);var _0x3f3996={'where':_0x241ca4['where']};return db[_0xc038('0x2e')]['count'](_0x3f3996)[_0xc038('0x25')](function(_0x37ade3){_0x32f244[_0xc038('0x20')]=_0x37ade3;if(_0x3818b3[_0xc038('0x35')][_0xc038('0x45')]){_0x241ca4[_0xc038('0x46')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xc038('0x47')](_0x241ca4);})[_0xc038('0x25')](function(_0x1ef072){_0x32f244[_0xc038('0x48')]=_0x1ef072;return _0x32f244;})[_0xc038('0x25')](respondWithFilteredResult(_0x19c12c,_0x241ca4))['catch'](handleError(_0x19c12c,null));};exports[_0xc038('0x49')]=function(_0x242fc7,_0x1bef90){var _0x20e766={'raw':!![],'where':{'id':_0x242fc7[_0xc038('0x4a')]['id']}},_0x591654={};_0x591654[_0xc038('0x33')]=_[_0xc038('0x36')](db[_0xc038('0x2e')]['rawAttributes']);_0x591654['query']=_[_0xc038('0x36')](_0x242fc7[_0xc038('0x35')]);_0x591654[_0xc038('0x37')]=_['intersection'](_0x591654['model'],_0x591654[_0xc038('0x35')]);_0x20e766[_0xc038('0x38')]=_['intersection'](_0x591654[_0xc038('0x33')],qs[_0xc038('0x3a')](_0x242fc7[_0xc038('0x35')][_0xc038('0x3a')]));_0x20e766[_0xc038('0x38')]=_0x20e766[_0xc038('0x38')][_0xc038('0x3b')]?_0x20e766['attributes']:_0x591654[_0xc038('0x33')];if(_0x242fc7[_0xc038('0x35')][_0xc038('0x45')]){_0x20e766[_0xc038('0x46')]=[{'all':!![]}];}_0x20e766=_[_0xc038('0x42')]({},_0x20e766,_0x242fc7[_0xc038('0x44')]);return db[_0xc038('0x2e')]['find'](_0x20e766)['then'](handleEntityNotFound(_0x1bef90,null))['then'](respondWithResult(_0x1bef90,null))[_0xc038('0x4b')](handleError(_0x1bef90,null));};exports['create']=function(_0x3e55ee,_0x384111){return db[_0xc038('0x2e')][_0xc038('0x4c')](_0x3e55ee['body'],{})['then'](respondWithResult(_0x384111,0xc9))[_0xc038('0x4b')](handleError(_0x384111,null));};exports['update']=function(_0x3306d3,_0xc6d64c){if(_0x3306d3[_0xc038('0x4d')]['id']){delete _0x3306d3[_0xc038('0x4d')]['id'];}return db[_0xc038('0x2e')][_0xc038('0x4e')]({'where':{'id':_0x3306d3[_0xc038('0x4a')]['id']}})['then'](handleEntityNotFound(_0xc6d64c,null))[_0xc038('0x25')](saveUpdates(_0x3306d3[_0xc038('0x4d')],null))[_0xc038('0x25')](respondWithResult(_0xc6d64c,null))[_0xc038('0x4b')](handleError(_0xc6d64c,null));};exports['destroy']=function(_0x3f6ca8,_0x4f47e8){return db[_0xc038('0x2e')]['find']({'where':{'id':_0x3f6ca8['params']['id']}})[_0xc038('0x25')](handleEntityNotFound(_0x4f47e8,null))['then'](removeEntity(_0x4f47e8,null))[_0xc038('0x4b')](handleError(_0x4f47e8,null));};exports[_0xc038('0x4f')]=function(_0x6817de,_0x2c2bc3,_0x50b5fe){return db['VoiceMailMessage']['find']({'where':{'id':_0x6817de[_0xc038('0x4a')]['id']},'attributes':['id','recording',_0xc038('0x50')]})[_0xc038('0x25')](handleEntityNotFound(_0x2c2bc3,null))['then'](function(_0x3f3958){if(_0x3f3958){if(!_0x3f3958[_0xc038('0x51')]){throw new db[(_0xc038('0x52'))][(_0xc038('0x53'))](_0xc038('0x54'));}var _0xde1fd5={'Content-Type':_0xc038('0x55'),'Content-Disposition':_0xc038('0x56')};if(_0x3f3958[_0xc038('0x50')]){_0xde1fd5['Content-Disposition']=_0xc038('0x57')+_0x3f3958[_0xc038('0x50')]+_0xc038('0x58');}_0x2c2bc3['set'](_0xde1fd5);return _0x2c2bc3['send'](new Buffer(_0x3f3958[_0xc038('0x51')]));}})[_0xc038('0x4b')](handleError(_0x2c2bc3,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index e894276..27e8937 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 _0xfe2e=['api','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','../../config/logger'];(function(_0x518b8f,_0x476de4){var _0x51cece=function(_0x13e53e){while(--_0x13e53e){_0x518b8f['push'](_0x518b8f['shift']());}};_0x51cece(++_0x476de4);}(_0xfe2e,0x11c));var _0xefe2=function(_0x12bf3e,_0x1851e9){_0x12bf3e=_0x12bf3e-0x0;var _0x37a29c=_0xfe2e[_0x12bf3e];return _0x37a29c;};'use strict';var _=require(_0xefe2('0x0'));var util=require('util');var logger=require(_0xefe2('0x1'))(_0xefe2('0x2'));var moment=require(_0xefe2('0x3'));var BPromise=require('bluebird');var rp=require(_0xefe2('0x4'));var fs=require('fs');var path=require(_0xefe2('0x5'));var rimraf=require(_0xefe2('0x6'));var config=require(_0xefe2('0x7'));var attributes=require(_0xefe2('0x8'));module[_0xefe2('0x9')]=function(_0x532db1,_0x74f333){return _0x532db1[_0xefe2('0xa')]('VoiceMailMessage',attributes,{'tableName':_0xefe2('0xb'),'paranoid':![],'indexes':[{'name':_0xefe2('0xc'),'fields':[_0xefe2('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7b0c=['../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7b0c,0x1e3));var _0xc7b0=function(_0x5d9df4,_0x495ddb){_0x5d9df4=_0x5d9df4-0x0;var _0x25ac9f=_0x7b0c[_0x5d9df4];return _0x25ac9f;};'use strict';var _=require(_0xc7b0('0x0'));var util=require(_0xc7b0('0x1'));var logger=require('../../config/logger')(_0xc7b0('0x2'));var moment=require(_0xc7b0('0x3'));var BPromise=require(_0xc7b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7b0('0x5'));var rimraf=require(_0xc7b0('0x6'));var config=require(_0xc7b0('0x7'));var attributes=require(_0xc7b0('0x8'));module[_0xc7b0('0x9')]=function(_0x5f3fe8,_0x38b1a6){return _0x5f3fe8[_0xc7b0('0xa')](_0xc7b0('0xb'),attributes,{'tableName':_0xc7b0('0xc'),'paranoid':![],'indexes':[{'name':_0xc7b0('0xd'),'fields':[_0xc7b0('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index fbb7b5f..29da44a 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 _0xe763=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','randomstring','ioredis'];(function(_0x2237be,_0x2ed5c1){var _0x3312ab=function(_0x448a62){while(--_0x448a62){_0x2237be['push'](_0x2237be['shift']());}};_0x3312ab(++_0x2ed5c1);}(_0xe763,0x7b));var _0x3e76=function(_0x5a16f7,_0x15e545){_0x5a16f7=_0x5a16f7-0x0;var _0x5cb364=_0xe763[_0x5a16f7];return _0x5cb364;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3e76('0x0'));var BPromise=require('bluebird');var rs=require(_0x3e76('0x1'));var fs=require('fs');var Redis=require(_0x3e76('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3e76('0x3'))(_0x3e76('0x4'));var config=require(_0x3e76('0x5'));var jayson=require(_0x3e76('0x6'));var client=jayson[_0x3e76('0x7')][_0x3e76('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf3fa7b,_0x100bd4,_0x520083){return new BPromise(function(_0x8d19e1,_0x1b257b){return client[_0x3e76('0x9')](_0xf3fa7b,_0x520083)[_0x3e76('0xa')](function(_0x465642){logger['info'](_0x3e76('0xb'),_0x100bd4,_0x3e76('0xc'));logger[_0x3e76('0xd')](_0x3e76('0xe'),_0x100bd4,_0x3e76('0xc'),JSON['stringify'](_0x465642));if(_0x465642[_0x3e76('0xf')]){if(_0x465642[_0x3e76('0xf')][_0x3e76('0x10')]===0x1f4){logger['error'](_0x3e76('0xb'),_0x100bd4,_0x465642[_0x3e76('0xf')][_0x3e76('0x11')]);return _0x1b257b(_0x465642[_0x3e76('0xf')]['message']);}logger[_0x3e76('0xf')](_0x3e76('0xb'),_0x100bd4,_0x465642[_0x3e76('0xf')][_0x3e76('0x11')]);return _0x8d19e1(_0x465642[_0x3e76('0xf')][_0x3e76('0x11')]);}else{logger[_0x3e76('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x100bd4,_0x3e76('0xc'));_0x8d19e1(_0x465642[_0x3e76('0x13')][_0x3e76('0x11')]);}})[_0x3e76('0x14')](function(_0x168ae7){logger[_0x3e76('0xf')](_0x3e76('0xb'),_0x100bd4,_0x168ae7);_0x1b257b(_0x168ae7);});});} \ No newline at end of file +var _0xd490=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x31ce09,_0x4d5390){var _0x386653=function(_0x9c6fdb){while(--_0x9c6fdb){_0x31ce09['push'](_0x31ce09['shift']());}};_0x386653(++_0x4d5390);}(_0xd490,0x64));var _0x0d49=function(_0x4d5bd3,_0x526906){_0x4d5bd3=_0x4d5bd3-0x0;var _0x4992d0=_0xd490[_0x4d5bd3];return _0x4992d0;};'use strict';var _=require(_0x0d49('0x0'));var util=require(_0x0d49('0x1'));var moment=require('moment');var BPromise=require(_0x0d49('0x2'));var rs=require(_0x0d49('0x3'));var fs=require('fs');var Redis=require(_0x0d49('0x4'));var db=require(_0x0d49('0x5'))['db'];var utils=require(_0x0d49('0x6'));var logger=require(_0x0d49('0x7'))('rpc');var config=require(_0x0d49('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0d49('0x9')][_0x0d49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cac82,_0x2d46b4,_0x248207){return new BPromise(function(_0x271625,_0x220b9b){return client['request'](_0x5cac82,_0x248207)[_0x0d49('0xb')](function(_0x17d011){logger[_0x0d49('0xc')](_0x0d49('0xd'),_0x2d46b4,_0x0d49('0xe'));logger[_0x0d49('0xf')](_0x0d49('0x10'),_0x2d46b4,_0x0d49('0xe'),JSON[_0x0d49('0x11')](_0x17d011));if(_0x17d011[_0x0d49('0x12')]){if(_0x17d011[_0x0d49('0x12')]['code']===0x1f4){logger[_0x0d49('0x12')](_0x0d49('0xd'),_0x2d46b4,_0x17d011[_0x0d49('0x12')][_0x0d49('0x13')]);return _0x220b9b(_0x17d011[_0x0d49('0x12')][_0x0d49('0x13')]);}logger[_0x0d49('0x12')](_0x0d49('0xd'),_0x2d46b4,_0x17d011['error']['message']);return _0x271625(_0x17d011[_0x0d49('0x12')][_0x0d49('0x13')]);}else{logger[_0x0d49('0xc')](_0x0d49('0xd'),_0x2d46b4,_0x0d49('0xe'));_0x271625(_0x17d011['result'][_0x0d49('0x13')]);}})[_0x0d49('0x14')](function(_0x42123d){logger[_0x0d49('0x12')](_0x0d49('0xd'),_0x2d46b4,_0x42123d);_0x220b9b(_0x42123d);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 51539e4..7389565 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 _0x003c=['delete','/:id/sounds/:id2','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id/sounds','getSounds','post','addSound','put','/:id','update'];(function(_0x21ea33,_0x12952b){var _0x2c366d=function(_0x40ab54){while(--_0x40ab54){_0x21ea33['push'](_0x21ea33['shift']());}};_0x2c366d(++_0x12952b);}(_0x003c,0x18f));var _0xc003=function(_0x1399ee,_0x4a59b2){_0x1399ee=_0x1399ee-0x0;var _0x50cfce=_0x003c[_0x1399ee];return _0x50cfce;};'use strict';var multer=require('multer');var util=require(_0xc003('0x0'));var path=require(_0xc003('0x1'));var timeout=require(_0xc003('0x2'));var express=require(_0xc003('0x3'));var router=express[_0xc003('0x4')]();var fs_extra=require(_0xc003('0x5'));var auth=require(_0xc003('0x6'));var interaction=require(_0xc003('0x7'));var config=require(_0xc003('0x8'));var controller=require(_0xc003('0x9'));router[_0xc003('0xa')]('/',auth[_0xc003('0xb')](),controller['index']);router[_0xc003('0xa')]('/:id',auth[_0xc003('0xb')](),controller['show']);router['get'](_0xc003('0xc'),auth[_0xc003('0xb')](),controller[_0xc003('0xd')]);router['post']('/',auth[_0xc003('0xb')](),controller['create']);router[_0xc003('0xe')](_0xc003('0xc'),auth[_0xc003('0xb')](),controller[_0xc003('0xf')]);router[_0xc003('0x10')](_0xc003('0x11'),auth[_0xc003('0xb')](),controller[_0xc003('0x12')]);router[_0xc003('0x13')](_0xc003('0x11'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xc003('0x14'),auth[_0xc003('0xb')](),controller['removeSound']);module[_0xc003('0x15')]=router; \ No newline at end of file +var _0x9575=['get','isAuthenticated','index','show','getSounds','create','post','/:id/sounds','put','/:id','update','delete','/:id/sounds/:id2','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x3ad8de,_0x2cb26a){var _0x1849c4=function(_0x23c41e){while(--_0x23c41e){_0x3ad8de['push'](_0x3ad8de['shift']());}};_0x1849c4(++_0x2cb26a);}(_0x9575,0x12e));var _0x5957=function(_0x28d992,_0x59deb5){_0x28d992=_0x28d992-0x0;var _0x2846dd=_0x9575[_0x28d992];return _0x2846dd;};'use strict';var multer=require(_0x5957('0x0'));var util=require('util');var path=require(_0x5957('0x1'));var timeout=require(_0x5957('0x2'));var express=require(_0x5957('0x3'));var router=express[_0x5957('0x4')]();var fs_extra=require(_0x5957('0x5'));var auth=require(_0x5957('0x6'));var interaction=require(_0x5957('0x7'));var config=require(_0x5957('0x8'));var controller=require(_0x5957('0x9'));router[_0x5957('0xa')]('/',auth[_0x5957('0xb')](),controller[_0x5957('0xc')]);router[_0x5957('0xa')]('/:id',auth[_0x5957('0xb')](),controller[_0x5957('0xd')]);router[_0x5957('0xa')]('/:id/sounds',auth[_0x5957('0xb')](),controller[_0x5957('0xe')]);router['post']('/',auth[_0x5957('0xb')](),controller[_0x5957('0xf')]);router[_0x5957('0x10')](_0x5957('0x11'),auth['isAuthenticated'](),controller['addSound']);router[_0x5957('0x12')](_0x5957('0x13'),auth[_0x5957('0xb')](),controller[_0x5957('0x14')]);router[_0x5957('0x15')](_0x5957('0x13'),auth[_0x5957('0xb')](),controller['destroy']);router[_0x5957('0x15')](_0x5957('0x16'),auth[_0x5957('0xb')](),controller['removeSound']);module[_0x5957('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 18fde88..0c9f89c 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 _0xba2d=['mp3nb','quietmp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom'];(function(_0xb58f58,_0x161652){var _0x5df477=function(_0xc751f8){while(--_0xc751f8){_0xb58f58['push'](_0xb58f58['shift']());}};_0x5df477(++_0x161652);}(_0xba2d,0x72));var _0xdba2=function(_0x18eee3,_0x2a9d6e){_0x18eee3=_0x18eee3-0x0;var _0xfdbb31=_0xba2d[_0x18eee3];return _0xfdbb31;};'use strict';var Sequelize=require(_0xdba2('0x0'));module[_0xdba2('0x1')]={'name':{'type':Sequelize[_0xdba2('0x2')],'allowNull':![],'unique':_0xdba2('0x3')},'mode':{'type':Sequelize[_0xdba2('0x4')](_0xdba2('0x5'),'files',_0xdba2('0x6'),'quietmp3nb',_0xdba2('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0xdba2('0x8')},'directory':{'type':Sequelize[_0xdba2('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xdba2('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xdba2('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xdba2('0x2')],'allowNull':!![],'defaultValue':_0xdba2('0x9')},'format':{'type':Sequelize[_0xdba2('0x2')],'allowNull':!![]},'stamp':{'type':_0xdba2('0xa')},'defaultEntry':{'type':Sequelize[_0xdba2('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xecea=['STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','BOOLEAN','exports'];(function(_0x5316e8,_0x3165c0){var _0x130ab0=function(_0x4cea1c){while(--_0x4cea1c){_0x5316e8['push'](_0x5316e8['shift']());}};_0x130ab0(++_0x3165c0);}(_0xecea,0x15e));var _0xaece=function(_0x3e8e8f,_0x3d4113){_0x3e8e8f=_0x3e8e8f-0x0;var _0x2eee7a=_0xecea[_0x3e8e8f];return _0x2eee7a;};'use strict';var Sequelize=require('sequelize');module[_0xaece('0x0')]={'name':{'type':Sequelize[_0xaece('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xaece('0x2')](_0xaece('0x3'),_0xaece('0x4'),_0xaece('0x5'),_0xaece('0x6'),_0xaece('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0xaece('0x4')},'directory':{'type':Sequelize[_0xaece('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xaece('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xaece('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xaece('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xaece('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index f36f359..44f3526 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 _0x9b1a=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','body','create','sequelize','directory','join','root','mode','files','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','transaction','Sound','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','server/files/moh','symlinkSync','removeSound','findOne','id2','createdAt','getSounds','pick','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','count','offset','Content-Range','json','reject','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','name','index','VoiceMusicOnHold','rawAttributes','fieldName','model','map','query','keys','filters'];(function(_0x36fe1e,_0x175199){var _0x3368ef=function(_0x74679f){while(--_0x74679f){_0x36fe1e['push'](_0x36fe1e['shift']());}};_0x3368ef(++_0x175199);}(_0x9b1a,0x124));var _0xa9b1=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x9b1a[_0x648163];return _0x199d4d;};'use strict';var emlformat=require(_0xa9b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9b1('0x1'));var jsonpatch=require(_0xa9b1('0x2'));var rp=require('request-promise');var moment=require(_0xa9b1('0x3'));var BPromise=require(_0xa9b1('0x4'));var Mustache=require(_0xa9b1('0x5'));var util=require(_0xa9b1('0x6'));var path=require(_0xa9b1('0x7'));var sox=require(_0xa9b1('0x8'));var csv=require(_0xa9b1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa9b1('0xa'));var crypto=require(_0xa9b1('0xb'));var jsforce=require(_0xa9b1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa9b1('0xd'));var Papa=require(_0xa9b1('0xe'));var Redis=require(_0xa9b1('0xf'));var authService=require(_0xa9b1('0x10'));var qs=require(_0xa9b1('0x11'));var as=require(_0xa9b1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9b1('0x13'))(_0xa9b1('0x14'));var utils=require(_0xa9b1('0x15'));var config=require(_0xa9b1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa9b1('0x17'))['db'];function respondWithStatusCode(_0xcd49ce,_0x593590){_0x593590=_0x593590||0xcc;return function(_0x3ede7e){if(_0x3ede7e){return _0xcd49ce['sendStatus'](_0x593590);}return _0xcd49ce[_0xa9b1('0x18')](_0x593590)[_0xa9b1('0x19')]();};}function respondWithResult(_0x4f655c,_0x80a031){_0x80a031=_0x80a031||0xc8;return function(_0x34b5b4){if(_0x34b5b4){return _0x4f655c[_0xa9b1('0x18')](_0x80a031)['json'](_0x34b5b4);}};}function respondWithFilteredResult(_0x4d1f7e,_0x553f12){return function(_0x353e96){if(_0x353e96){var _0x434607=typeof _0x553f12['offset']===_0xa9b1('0x1a')&&typeof _0x553f12[_0xa9b1('0x1b')]===_0xa9b1('0x1a');var _0x5b3365=_0x353e96[_0xa9b1('0x1c')];var _0xc5ef25=_0x434607?0x0:_0x553f12[_0xa9b1('0x1d')];var _0x1ab669=_0x434607?_0x353e96[_0xa9b1('0x1c')]:_0x553f12[_0xa9b1('0x1d')]+_0x553f12[_0xa9b1('0x1b')];var _0x23012a;if(_0x1ab669>=_0x5b3365){_0x1ab669=_0x5b3365;_0x23012a=0xc8;}else{_0x23012a=0xce;}_0x4d1f7e[_0xa9b1('0x18')](_0x23012a);return _0x4d1f7e['set'](_0xa9b1('0x1e'),_0xc5ef25+'-'+_0x1ab669+'/'+_0x5b3365)[_0xa9b1('0x1f')](_0x353e96);}return null;};}function patchUpdates(_0x4286fe){return function(_0x206e23){try{jsonpatch['apply'](_0x206e23,_0x4286fe,!![]);}catch(_0x235f5f){return BPromise[_0xa9b1('0x20')](_0x235f5f);}return _0x206e23['save']();};}function saveUpdates(_0x422c33,_0x2b2456){return function(_0x20b05c){if(_0x20b05c){return _0x20b05c[_0xa9b1('0x21')](_0x422c33)[_0xa9b1('0x22')](function(_0x4a0608){return _0x4a0608;});}return null;};}function removeEntity(_0x1cda53,_0xb34006){return function(_0x52e6ab){if(_0x52e6ab){return _0x52e6ab[_0xa9b1('0x23')]()[_0xa9b1('0x22')](function(){var _0x5577d9=_0x52e6ab[_0xa9b1('0x24')]({'plain':!![]});var _0x1e7188=_0xa9b1('0x25');return db[_0xa9b1('0x26')]['destroy']({'where':{'type':_0x1e7188,'resourceId':_0x5577d9['id']}})['then'](function(){return _0x52e6ab;});})[_0xa9b1('0x22')](function(){_0x1cda53[_0xa9b1('0x18')](0xcc)[_0xa9b1('0x19')]();});}};}function handleEntityNotFound(_0x496617,_0x1481ec){return function(_0x3559b6){if(!_0x3559b6){_0x496617[_0xa9b1('0x27')](0x194);}return _0x3559b6;};}function handleError(_0x3bd0f0,_0x3af453){_0x3af453=_0x3af453||0x1f4;return function(_0x249dd5){logger['error'](_0x249dd5['stack']);if(_0x249dd5[_0xa9b1('0x28')]){delete _0x249dd5[_0xa9b1('0x28')];}_0x3bd0f0['status'](_0x3af453)['send'](_0x249dd5);};}exports[_0xa9b1('0x29')]=function(_0x1b6f10,_0x2eca29){var _0x1e2f4d={},_0x4f9122={},_0x490ed0={'count':0x0,'rows':[]};var _0x2eba7b=_['map'](db[_0xa9b1('0x2a')][_0xa9b1('0x2b')],function(_0x293300){return{'name':_0x293300[_0xa9b1('0x2c')],'type':_0x293300['type']['key']};});_0x4f9122[_0xa9b1('0x2d')]=_[_0xa9b1('0x2e')](_0x2eba7b,'name');_0x4f9122[_0xa9b1('0x2f')]=_[_0xa9b1('0x30')](_0x1b6f10[_0xa9b1('0x2f')]);_0x4f9122[_0xa9b1('0x31')]=_[_0xa9b1('0x32')](_0x4f9122[_0xa9b1('0x2d')],_0x4f9122['query']);_0x1e2f4d[_0xa9b1('0x33')]=_[_0xa9b1('0x32')](_0x4f9122[_0xa9b1('0x2d')],qs[_0xa9b1('0x34')](_0x1b6f10[_0xa9b1('0x2f')]['fields']));_0x1e2f4d[_0xa9b1('0x33')]=_0x1e2f4d['attributes'][_0xa9b1('0x35')]?_0x1e2f4d['attributes']:_0x4f9122['model'];if(!_0x1b6f10[_0xa9b1('0x2f')][_0xa9b1('0x36')](_0xa9b1('0x37'))){_0x1e2f4d[_0xa9b1('0x1b')]=qs[_0xa9b1('0x1b')](_0x1b6f10['query']['limit']);_0x1e2f4d['offset']=qs[_0xa9b1('0x1d')](_0x1b6f10['query'][_0xa9b1('0x1d')]);}_0x1e2f4d[_0xa9b1('0x38')]=qs['sort'](_0x1b6f10['query'][_0xa9b1('0x39')]);delete _0x1b6f10[_0xa9b1('0x2f')]['sort'];_0x1e2f4d[_0xa9b1('0x3a')]=qs['filters'](_['pick'](_0x1b6f10[_0xa9b1('0x2f')],_0x4f9122['filters']),_0x2eba7b);if(_0x1b6f10['query'][_0xa9b1('0x3b')]){_0x1e2f4d[_0xa9b1('0x3a')]=_[_0xa9b1('0x3c')](_0x1e2f4d['where'],{'$or':_['map'](_0x2eba7b,function(_0x339773){if(_0x339773[_0xa9b1('0x3d')]!==_0xa9b1('0x3e')){var _0x352255={};_0x352255[_0x339773['name']]={'$like':'%'+_0x1b6f10[_0xa9b1('0x2f')][_0xa9b1('0x3b')]+'%'};return _0x352255;}})});}_0x1e2f4d=_[_0xa9b1('0x3c')]({},_0x1e2f4d,_0x1b6f10['options']);var _0x2c4185={'where':_0x1e2f4d[_0xa9b1('0x3a')]};return db[_0xa9b1('0x2a')][_0xa9b1('0x1c')](_0x2c4185)[_0xa9b1('0x22')](function(_0x59bb96){_0x490ed0[_0xa9b1('0x1c')]=_0x59bb96;if(_0x1b6f10[_0xa9b1('0x2f')][_0xa9b1('0x3f')]){_0x1e2f4d[_0xa9b1('0x40')]=[{'all':!![]}];}return db[_0xa9b1('0x2a')][_0xa9b1('0x41')](_0x1e2f4d);})[_0xa9b1('0x22')](function(_0xf8751c){_0x490ed0[_0xa9b1('0x42')]=_0xf8751c;return _0x490ed0;})[_0xa9b1('0x22')](respondWithFilteredResult(_0x2eca29,_0x1e2f4d))['catch'](handleError(_0x2eca29,null));};exports[_0xa9b1('0x43')]=function(_0x533992,_0x23cc83){var _0xf2a020={'raw':![],'where':{'id':_0x533992[_0xa9b1('0x44')]['id']}},_0x4141ee={};_0x4141ee[_0xa9b1('0x2d')]=_[_0xa9b1('0x30')](db['VoiceMusicOnHold'][_0xa9b1('0x2b')]);_0x4141ee[_0xa9b1('0x2f')]=_[_0xa9b1('0x30')](_0x533992[_0xa9b1('0x2f')]);_0x4141ee[_0xa9b1('0x31')]=_[_0xa9b1('0x32')](_0x4141ee[_0xa9b1('0x2d')],_0x4141ee['query']);_0xf2a020[_0xa9b1('0x33')]=_[_0xa9b1('0x32')](_0x4141ee[_0xa9b1('0x2d')],qs['fields'](_0x533992[_0xa9b1('0x2f')]['fields']));_0xf2a020['attributes']=_0xf2a020[_0xa9b1('0x33')]['length']?_0xf2a020[_0xa9b1('0x33')]:_0x4141ee[_0xa9b1('0x2d')];if(_0x533992[_0xa9b1('0x2f')][_0xa9b1('0x3f')]){_0xf2a020[_0xa9b1('0x40')]=[{'all':!![]}];}_0xf2a020=_['merge']({},_0xf2a020,_0x533992[_0xa9b1('0x45')]);return db['VoiceMusicOnHold']['find'](_0xf2a020)[_0xa9b1('0x22')](handleEntityNotFound(_0x23cc83,null))[_0xa9b1('0x22')](respondWithResult(_0x23cc83,null))[_0xa9b1('0x46')](handleError(_0x23cc83,null));};exports['update']=function(_0x32f7da,_0x4fa553){if(_0x32f7da['body']['id']){delete _0x32f7da[_0xa9b1('0x47')]['id'];}return db[_0xa9b1('0x2a')]['find']({'where':{'id':_0x32f7da[_0xa9b1('0x44')]['id']}})[_0xa9b1('0x22')](handleEntityNotFound(_0x4fa553,null))[_0xa9b1('0x22')](saveUpdates(_0x32f7da['body'],null))[_0xa9b1('0x22')](respondWithResult(_0x4fa553,null))[_0xa9b1('0x46')](handleError(_0x4fa553,null));};exports[_0xa9b1('0x48')]=function(_0x58ff07,_0xf1c206,_0x125703){return db[_0xa9b1('0x49')]['transaction'](function(_0xac3193){if(_0x58ff07[_0xa9b1('0x47')]['mode']==='files'){_0x58ff07[_0xa9b1('0x47')][_0xa9b1('0x4a')]=path[_0xa9b1('0x4b')](config[_0xa9b1('0x4c')],'server/files/moh',_0x58ff07[_0xa9b1('0x47')][_0xa9b1('0x28')]);}return db[_0xa9b1('0x2a')][_0xa9b1('0x48')](_0x58ff07[_0xa9b1('0x47')],{'transaction':_0xac3193})[_0xa9b1('0x22')](function(_0x142f2d){if(_0x58ff07['body'][_0xa9b1('0x4d')]===_0xa9b1('0x4e')){fs[_0xa9b1('0x4f')](_0x142f2d[_0xa9b1('0x4a')],parseInt(_0xa9b1('0x50'),0x8));}var _0x13535f=_0x58ff07[_0xa9b1('0x51')][_0xa9b1('0x24')]({'plain':!![]});if(!_0x13535f)throw new Error(_0xa9b1('0x52'));if(_0x13535f[_0xa9b1('0x53')]===_0xa9b1('0x51')){var _0x4e422a=_0x142f2d[_0xa9b1('0x24')]({'plain':!![]});return db[_0xa9b1('0x54')][_0xa9b1('0x55')]({'where':{'name':'MusicOnHolds','userProfileId':_0x13535f[_0xa9b1('0x56')]},'raw':!![]})[_0xa9b1('0x22')](function(_0x5ec4ed){if(_0x5ec4ed&&_0x5ec4ed[_0xa9b1('0x57')]===0x0){return db[_0xa9b1('0x26')][_0xa9b1('0x48')]({'name':_0x4e422a[_0xa9b1('0x28')],'resourceId':_0x4e422a['id'],'type':_0x5ec4ed[_0xa9b1('0x28')],'sectionId':_0x5ec4ed['id']},{})['then'](function(){return _0x142f2d;});}else{return _0x142f2d;}})['catch'](function(_0x595509){logger[_0xa9b1('0x58')](_0xa9b1('0x59'),_0x595509);});}return _0x142f2d;});})['then'](respondWithResult(_0xf1c206,0xc9))[_0xa9b1('0x46')](handleError(_0xf1c206,null));};exports['destroy']=function(_0x2b7a1a,_0x42b408,_0x229acf){var _0x670a29;return db['VoiceMusicOnHold'][_0xa9b1('0x55')]({'where':{'id':_0x2b7a1a[_0xa9b1('0x44')]['id']}})[_0xa9b1('0x22')](function(_0x2a8298){if(_0x2a8298){return db[_0xa9b1('0x49')]['transaction'](function(_0x29239c){return _0x2a8298[_0xa9b1('0x23')]({'transaction':_0x29239c,'raw':!![]})[_0xa9b1('0x22')](function(_0x333b25){if(_0x333b25[_0xa9b1('0x4a')]){fs[_0xa9b1('0x5a')](_0x333b25['directory'])[_0xa9b1('0x5b')](function(_0x67c7cc){fs[_0xa9b1('0x5c')](path[_0xa9b1('0x4b')](_0x333b25[_0xa9b1('0x4a')],_0x67c7cc));});fs[_0xa9b1('0x5d')](_0x333b25[_0xa9b1('0x4a')]);}return _0x333b25;});})['catch'](function(_0x48f242){throw new db[(_0xa9b1('0x5e'))][(_0xa9b1('0x5f'))](_0x48f242[_0xa9b1('0x60')]);});}})[_0xa9b1('0x22')](handleEntityNotFound(_0x42b408,null))['then'](removeEntity(_0x42b408,null))['catch'](handleError(_0x42b408,null));};exports[_0xa9b1('0x61')]=function(_0x3cab88,_0x733916,_0x207179){return db['sequelize'][_0xa9b1('0x62')](function(_0x98116d){var _0x22350c;return db[_0xa9b1('0x2a')]['find']({'where':{'id':_0x3cab88[_0xa9b1('0x44')]['id']}})[_0xa9b1('0x22')](function(_0x4ceb83){if(_0x4ceb83){_0x22350c=_0x4ceb83;return _0x4ceb83[_0xa9b1('0x61')](_0x3cab88[_0xa9b1('0x47')]['id'],{'transaction':_0x98116d});}})[_0xa9b1('0x22')](function(_0x4f3cf3){if(_0x4f3cf3){return db[_0xa9b1('0x63')]['findOne']({'where':{'id':_0x3cab88[_0xa9b1('0x47')]['id']},'attributes':['id','name',_0xa9b1('0x64'),_0xa9b1('0x65'),'createdAt'],'raw':!![]});}})[_0xa9b1('0x22')](function(_0x5e0ca2){if(_0x5e0ca2){var _0x3e7c2c=path[_0xa9b1('0x4b')](config[_0xa9b1('0x4c')],_0xa9b1('0x66'),util[_0xa9b1('0x67')](_0xa9b1('0x68'),path[_0xa9b1('0x69')](_0x5e0ca2[_0xa9b1('0x64')],path['extname'](_0x5e0ca2[_0xa9b1('0x64')])),_0x5e0ca2[_0xa9b1('0x65')]));var _0x528d78=path[_0xa9b1('0x4b')](config['root'],_0xa9b1('0x6a'),_0x22350c[_0xa9b1('0x28')],util[_0xa9b1('0x67')]('%s.%s',_0x5e0ca2[_0xa9b1('0x28')],_0x5e0ca2[_0xa9b1('0x65')]));fs[_0xa9b1('0x6b')](_0x3e7c2c,_0x528d78);return _0x5e0ca2;}})[_0xa9b1('0x46')](function(_0x50bdaa){throw new db['Sequelize'][(_0xa9b1('0x5f'))](_0x50bdaa[_0xa9b1('0x60')]);});})['then'](handleEntityNotFound(_0x733916,null))[_0xa9b1('0x22')](respondWithResult(_0x733916,0xc9))[_0xa9b1('0x46')](handleError(_0x733916,null));};exports[_0xa9b1('0x6c')]=function(_0x175a22,_0x983314,_0x57b570){return db[_0xa9b1('0x49')][_0xa9b1('0x62')](function(_0x3ba44d){var _0x34ebce;return db[_0xa9b1('0x2a')][_0xa9b1('0x6d')]({'where':{'id':_0x175a22[_0xa9b1('0x44')]['id']}})[_0xa9b1('0x22')](handleEntityNotFound(_0x983314,null))[_0xa9b1('0x22')](function(_0xd2ae08){if(_0xd2ae08){_0x34ebce=_0xd2ae08;return _0xd2ae08['removeSound'](_0x175a22[_0xa9b1('0x44')][_0xa9b1('0x6e')]);}})['then'](function(_0x1aa4fb){if(_0x1aa4fb){return db[_0xa9b1('0x63')][_0xa9b1('0x6d')]({'where':{'id':_0x175a22[_0xa9b1('0x44')][_0xa9b1('0x6e')]},'attributes':['id','name',_0xa9b1('0x64'),_0xa9b1('0x65'),_0xa9b1('0x6f')],'raw':!![]});}})['then'](function(_0x446227){if(_0x446227){fs[_0xa9b1('0x5c')](path[_0xa9b1('0x4b')](_0x34ebce[_0xa9b1('0x4a')],util[_0xa9b1('0x67')](_0xa9b1('0x68'),_0x446227[_0xa9b1('0x28')],_0x446227[_0xa9b1('0x65')])));return _0x446227;}})['catch'](function(_0x124d12){throw new db['Sequelize'][(_0xa9b1('0x5f'))](_0x124d12[_0xa9b1('0x60')]);});})[_0xa9b1('0x22')](handleEntityNotFound(_0x983314,null))[_0xa9b1('0x22')](respondWithStatusCode(_0x983314,0xcc))['catch'](handleError(_0x983314,null));};exports[_0xa9b1('0x70')]=function(_0x1711e6,_0x3d2bf1,_0x18acd0){var _0x49b944={};var _0x4f52aa={};var _0xfd7330;var _0x3bcb17;return db[_0xa9b1('0x2a')][_0xa9b1('0x6d')]({'where':{'id':_0x1711e6[_0xa9b1('0x44')]['id']}})[_0xa9b1('0x22')](handleEntityNotFound(_0x3d2bf1,null))[_0xa9b1('0x22')](function(_0x4f9279){if(_0x4f9279){_0xfd7330=_0x4f9279;_0x4f52aa[_0xa9b1('0x2d')]=_[_0xa9b1('0x30')](db[_0xa9b1('0x63')][_0xa9b1('0x2b')]);_0x4f52aa[_0xa9b1('0x2f')]=_[_0xa9b1('0x30')](_0x1711e6['query']);_0x4f52aa[_0xa9b1('0x31')]=_[_0xa9b1('0x32')](_0x4f52aa['model'],_0x4f52aa[_0xa9b1('0x2f')]);_0x49b944[_0xa9b1('0x33')]=_[_0xa9b1('0x32')](_0x4f52aa[_0xa9b1('0x2d')],qs[_0xa9b1('0x34')](_0x1711e6[_0xa9b1('0x2f')]['fields']));_0x49b944[_0xa9b1('0x33')]=_0x49b944[_0xa9b1('0x33')][_0xa9b1('0x35')]?_0x49b944[_0xa9b1('0x33')]:_0x4f52aa['model'];_0x49b944[_0xa9b1('0x38')]=qs['sort'](_0x1711e6['query'][_0xa9b1('0x39')]);_0x49b944[_0xa9b1('0x3a')]=qs['filters'](_[_0xa9b1('0x71')](_0x1711e6[_0xa9b1('0x2f')],_0x4f52aa[_0xa9b1('0x31')]));if(_0x1711e6['query'][_0xa9b1('0x3b')]){_0x49b944['where']=_[_0xa9b1('0x3c')](_0x49b944[_0xa9b1('0x3a')],{'$or':_[_0xa9b1('0x2e')](_0x49b944[_0xa9b1('0x33')],function(_0x2f2d31){var _0x4e8b3f={};_0x4e8b3f[_0x2f2d31]={'$like':'%'+_0x1711e6[_0xa9b1('0x2f')]['filter']+'%'};return _0x4e8b3f;})});}_0x49b944=_[_0xa9b1('0x3c')]({},_0x49b944,_0x1711e6[_0xa9b1('0x45')]);return _0xfd7330['getSounds'](_0x49b944);}})[_0xa9b1('0x22')](function(_0x470658){if(_0x470658){_0x3bcb17=_0x470658[_0xa9b1('0x35')];if(!_0x1711e6[_0xa9b1('0x2f')][_0xa9b1('0x36')]('nolimit')){_0x49b944[_0xa9b1('0x1b')]=qs['limit'](_0x1711e6[_0xa9b1('0x2f')][_0xa9b1('0x1b')]);_0x49b944['offset']=qs['offset'](_0x1711e6[_0xa9b1('0x2f')][_0xa9b1('0x1d')]);}return _0xfd7330[_0xa9b1('0x70')](_0x49b944);}})[_0xa9b1('0x22')](function(_0x57d01c){if(_0x57d01c){return _0x57d01c?{'count':_0x3bcb17,'rows':_0x57d01c}:null;}})[_0xa9b1('0x22')](respondWithResult(_0x3d2bf1,null))[_0xa9b1('0x46')](handleError(_0x3d2bf1,null));}; \ No newline at end of file +var _0xae03=['include','find','body','create','sequelize','transaction','directory','join','root','server/files/moh','files','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','basename','extname','converted_format','format','Sequelize','removeSound','id2','Sound','getSounds','intersection','options','eml-format','zip-dir','fast-json-patch','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','sendStatus','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','findAll','catch','show','params'];(function(_0x1f1008,_0x2c2cf7){var _0xc75ea7=function(_0x108087){while(--_0x108087){_0x1f1008['push'](_0x1f1008['shift']());}};_0xc75ea7(++_0x2c2cf7);}(_0xae03,0x1e2));var _0x3ae0=function(_0x11f96b,_0x45b541){_0x11f96b=_0x11f96b-0x0;var _0x329959=_0xae03[_0x11f96b];return _0x329959;};'use strict';var emlformat=require(_0x3ae0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ae0('0x1'));var jsonpatch=require(_0x3ae0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3ae0('0x3'));var util=require('util');var path=require(_0x3ae0('0x4'));var sox=require(_0x3ae0('0x5'));var csv=require('to-csv');var ejs=require(_0x3ae0('0x6'));var fs=require('fs');var fs_extra=require(_0x3ae0('0x7'));var _=require(_0x3ae0('0x8'));var squel=require(_0x3ae0('0x9'));var crypto=require(_0x3ae0('0xa'));var jsforce=require(_0x3ae0('0xb'));var deskjs=require(_0x3ae0('0xc'));var toCsv=require(_0x3ae0('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3ae0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3ae0('0xf'));var as=require(_0x3ae0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3ae0('0x11'));var utils=require(_0x3ae0('0x12'));var config=require(_0x3ae0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ae0('0x14'))['db'];function respondWithStatusCode(_0x462e61,_0x5b4cdf){_0x5b4cdf=_0x5b4cdf||0xcc;return function(_0x3ca87b){if(_0x3ca87b){return _0x462e61['sendStatus'](_0x5b4cdf);}return _0x462e61['status'](_0x5b4cdf)[_0x3ae0('0x15')]();};}function respondWithResult(_0x5f2c84,_0x4b4428){_0x4b4428=_0x4b4428||0xc8;return function(_0x1162c1){if(_0x1162c1){return _0x5f2c84[_0x3ae0('0x16')](_0x4b4428)[_0x3ae0('0x17')](_0x1162c1);}};}function respondWithFilteredResult(_0x1fdd88,_0x29d4b4){return function(_0x47e111){if(_0x47e111){var _0x5bd8ab=typeof _0x29d4b4[_0x3ae0('0x18')]===_0x3ae0('0x19')&&typeof _0x29d4b4[_0x3ae0('0x1a')]===_0x3ae0('0x19');var _0x5b6d00=_0x47e111[_0x3ae0('0x1b')];var _0x5562bc=_0x5bd8ab?0x0:_0x29d4b4['offset'];var _0x548831=_0x5bd8ab?_0x47e111[_0x3ae0('0x1b')]:_0x29d4b4['offset']+_0x29d4b4[_0x3ae0('0x1a')];var _0x1e33fe;if(_0x548831>=_0x5b6d00){_0x548831=_0x5b6d00;_0x1e33fe=0xc8;}else{_0x1e33fe=0xce;}_0x1fdd88[_0x3ae0('0x16')](_0x1e33fe);return _0x1fdd88[_0x3ae0('0x1c')](_0x3ae0('0x1d'),_0x5562bc+'-'+_0x548831+'/'+_0x5b6d00)['json'](_0x47e111);}return null;};}function patchUpdates(_0x2a8c54){return function(_0x1aa6e7){try{jsonpatch['apply'](_0x1aa6e7,_0x2a8c54,!![]);}catch(_0x70acf8){return BPromise[_0x3ae0('0x1e')](_0x70acf8);}return _0x1aa6e7[_0x3ae0('0x1f')]();};}function saveUpdates(_0x554126,_0x475a7f){return function(_0x1f8249){if(_0x1f8249){return _0x1f8249[_0x3ae0('0x20')](_0x554126)[_0x3ae0('0x21')](function(_0xd23a90){return _0xd23a90;});}return null;};}function removeEntity(_0x3e2fd6,_0x35463d){return function(_0x20ea4e){if(_0x20ea4e){return _0x20ea4e[_0x3ae0('0x22')]()[_0x3ae0('0x21')](function(){var _0x820208=_0x20ea4e[_0x3ae0('0x23')]({'plain':!![]});var _0x52616e=_0x3ae0('0x24');return db['UserProfileResource'][_0x3ae0('0x22')]({'where':{'type':_0x52616e,'resourceId':_0x820208['id']}})['then'](function(){return _0x20ea4e;});})[_0x3ae0('0x21')](function(){_0x3e2fd6[_0x3ae0('0x16')](0xcc)[_0x3ae0('0x15')]();});}};}function handleEntityNotFound(_0x2a5d03,_0x30310c){return function(_0xbbe984){if(!_0xbbe984){_0x2a5d03[_0x3ae0('0x25')](0x194);}return _0xbbe984;};}function handleError(_0x4f0c36,_0x52f87b){_0x52f87b=_0x52f87b||0x1f4;return function(_0x2d9789){logger[_0x3ae0('0x26')](_0x2d9789[_0x3ae0('0x27')]);if(_0x2d9789[_0x3ae0('0x28')]){delete _0x2d9789[_0x3ae0('0x28')];}_0x4f0c36[_0x3ae0('0x16')](_0x52f87b)[_0x3ae0('0x29')](_0x2d9789);};}exports[_0x3ae0('0x2a')]=function(_0xcac577,_0x257ebd){var _0x17e972={},_0x53c4b0={},_0x1c7078={'count':0x0,'rows':[]};var _0x41b026=_['map'](db[_0x3ae0('0x2b')][_0x3ae0('0x2c')],function(_0x371c68){return{'name':_0x371c68[_0x3ae0('0x2d')],'type':_0x371c68[_0x3ae0('0x2e')][_0x3ae0('0x2f')]};});_0x53c4b0[_0x3ae0('0x30')]=_[_0x3ae0('0x31')](_0x41b026,_0x3ae0('0x28'));_0x53c4b0[_0x3ae0('0x32')]=_[_0x3ae0('0x33')](_0xcac577[_0x3ae0('0x32')]);_0x53c4b0[_0x3ae0('0x34')]=_['intersection'](_0x53c4b0[_0x3ae0('0x30')],_0x53c4b0[_0x3ae0('0x32')]);_0x17e972[_0x3ae0('0x35')]=_['intersection'](_0x53c4b0[_0x3ae0('0x30')],qs[_0x3ae0('0x36')](_0xcac577['query']['fields']));_0x17e972[_0x3ae0('0x35')]=_0x17e972['attributes'][_0x3ae0('0x37')]?_0x17e972[_0x3ae0('0x35')]:_0x53c4b0[_0x3ae0('0x30')];if(!_0xcac577[_0x3ae0('0x32')][_0x3ae0('0x38')](_0x3ae0('0x39'))){_0x17e972['limit']=qs[_0x3ae0('0x1a')](_0xcac577[_0x3ae0('0x32')]['limit']);_0x17e972[_0x3ae0('0x18')]=qs[_0x3ae0('0x18')](_0xcac577[_0x3ae0('0x32')]['offset']);}_0x17e972[_0x3ae0('0x3a')]=qs['sort'](_0xcac577[_0x3ae0('0x32')][_0x3ae0('0x3b')]);delete _0xcac577['query']['sort'];_0x17e972[_0x3ae0('0x3c')]=qs[_0x3ae0('0x34')](_[_0x3ae0('0x3d')](_0xcac577[_0x3ae0('0x32')],_0x53c4b0[_0x3ae0('0x34')]),_0x41b026);if(_0xcac577['query']['filter']){_0x17e972[_0x3ae0('0x3c')]=_[_0x3ae0('0x3e')](_0x17e972[_0x3ae0('0x3c')],{'$or':_[_0x3ae0('0x31')](_0x41b026,function(_0x321829){if(_0x321829[_0x3ae0('0x2e')]!=='VIRTUAL'){var _0x4c737e={};_0x4c737e[_0x321829[_0x3ae0('0x28')]]={'$like':'%'+_0xcac577['query'][_0x3ae0('0x3f')]+'%'};return _0x4c737e;}})});}_0x17e972=_[_0x3ae0('0x3e')]({},_0x17e972,_0xcac577['options']);var _0x247548={'where':_0x17e972[_0x3ae0('0x3c')]};return db[_0x3ae0('0x2b')]['count'](_0x247548)[_0x3ae0('0x21')](function(_0x459a10){_0x1c7078[_0x3ae0('0x1b')]=_0x459a10;if(_0xcac577[_0x3ae0('0x32')]['includeAll']){_0x17e972['include']=[{'all':!![]}];}return db[_0x3ae0('0x2b')][_0x3ae0('0x40')](_0x17e972);})['then'](function(_0x5a7c14){_0x1c7078['rows']=_0x5a7c14;return _0x1c7078;})[_0x3ae0('0x21')](respondWithFilteredResult(_0x257ebd,_0x17e972))[_0x3ae0('0x41')](handleError(_0x257ebd,null));};exports[_0x3ae0('0x42')]=function(_0x27840c,_0x171884){var _0x9c505b={'raw':![],'where':{'id':_0x27840c[_0x3ae0('0x43')]['id']}},_0x185950={};_0x185950[_0x3ae0('0x30')]=_[_0x3ae0('0x33')](db['VoiceMusicOnHold']['rawAttributes']);_0x185950[_0x3ae0('0x32')]=_['keys'](_0x27840c[_0x3ae0('0x32')]);_0x185950['filters']=_['intersection'](_0x185950[_0x3ae0('0x30')],_0x185950['query']);_0x9c505b[_0x3ae0('0x35')]=_['intersection'](_0x185950[_0x3ae0('0x30')],qs['fields'](_0x27840c['query'][_0x3ae0('0x36')]));_0x9c505b[_0x3ae0('0x35')]=_0x9c505b[_0x3ae0('0x35')][_0x3ae0('0x37')]?_0x9c505b[_0x3ae0('0x35')]:_0x185950['model'];if(_0x27840c[_0x3ae0('0x32')]['includeAll']){_0x9c505b[_0x3ae0('0x44')]=[{'all':!![]}];}_0x9c505b=_[_0x3ae0('0x3e')]({},_0x9c505b,_0x27840c['options']);return db[_0x3ae0('0x2b')][_0x3ae0('0x45')](_0x9c505b)[_0x3ae0('0x21')](handleEntityNotFound(_0x171884,null))['then'](respondWithResult(_0x171884,null))[_0x3ae0('0x41')](handleError(_0x171884,null));};exports[_0x3ae0('0x20')]=function(_0x14084f,_0x3e6978){if(_0x14084f[_0x3ae0('0x46')]['id']){delete _0x14084f[_0x3ae0('0x46')]['id'];}return db[_0x3ae0('0x2b')][_0x3ae0('0x45')]({'where':{'id':_0x14084f[_0x3ae0('0x43')]['id']}})[_0x3ae0('0x21')](handleEntityNotFound(_0x3e6978,null))[_0x3ae0('0x21')](saveUpdates(_0x14084f[_0x3ae0('0x46')],null))['then'](respondWithResult(_0x3e6978,null))['catch'](handleError(_0x3e6978,null));};exports[_0x3ae0('0x47')]=function(_0x53060e,_0x179c63,_0xbc6e93){return db[_0x3ae0('0x48')][_0x3ae0('0x49')](function(_0x320599){if(_0x53060e['body']['mode']==='files'){_0x53060e[_0x3ae0('0x46')][_0x3ae0('0x4a')]=path[_0x3ae0('0x4b')](config[_0x3ae0('0x4c')],_0x3ae0('0x4d'),_0x53060e[_0x3ae0('0x46')][_0x3ae0('0x28')]);}return db[_0x3ae0('0x2b')][_0x3ae0('0x47')](_0x53060e['body'],{'transaction':_0x320599})[_0x3ae0('0x21')](function(_0x5da617){if(_0x53060e[_0x3ae0('0x46')]['mode']===_0x3ae0('0x4e')){fs[_0x3ae0('0x4f')](_0x5da617[_0x3ae0('0x4a')],parseInt(_0x3ae0('0x50'),0x8));}var _0x400431=_0x53060e['user'][_0x3ae0('0x23')]({'plain':!![]});if(!_0x400431)throw new Error(_0x3ae0('0x51'));if(_0x400431[_0x3ae0('0x52')]===_0x3ae0('0x53')){var _0x456b48=_0x5da617[_0x3ae0('0x23')]({'plain':!![]});return db[_0x3ae0('0x54')][_0x3ae0('0x45')]({'where':{'name':_0x3ae0('0x24'),'userProfileId':_0x400431[_0x3ae0('0x55')]},'raw':!![]})[_0x3ae0('0x21')](function(_0x247053){if(_0x247053&&_0x247053['autoAssociation']===0x0){return db['UserProfileResource'][_0x3ae0('0x47')]({'name':_0x456b48['name'],'resourceId':_0x456b48['id'],'type':_0x247053[_0x3ae0('0x28')],'sectionId':_0x247053['id']},{})[_0x3ae0('0x21')](function(){return _0x5da617;});}else{return _0x5da617;}})[_0x3ae0('0x41')](function(_0x337d21){logger[_0x3ae0('0x26')](_0x3ae0('0x56'),_0x337d21);});}return _0x5da617;});})[_0x3ae0('0x21')](respondWithResult(_0x179c63,0xc9))['catch'](handleError(_0x179c63,null));};exports[_0x3ae0('0x22')]=function(_0x388918,_0x38df37,_0x312cb1){var _0x529c37;return db['VoiceMusicOnHold'][_0x3ae0('0x45')]({'where':{'id':_0x388918[_0x3ae0('0x43')]['id']}})[_0x3ae0('0x21')](function(_0x4f5e45){if(_0x4f5e45){return db[_0x3ae0('0x48')][_0x3ae0('0x49')](function(_0x1dfebb){return _0x4f5e45[_0x3ae0('0x22')]({'transaction':_0x1dfebb,'raw':!![]})[_0x3ae0('0x21')](function(_0x2d3d0e){if(_0x2d3d0e['directory']){fs[_0x3ae0('0x57')](_0x2d3d0e[_0x3ae0('0x4a')])[_0x3ae0('0x58')](function(_0x4a6eb1){fs[_0x3ae0('0x59')](path[_0x3ae0('0x4b')](_0x2d3d0e[_0x3ae0('0x4a')],_0x4a6eb1));});fs[_0x3ae0('0x5a')](_0x2d3d0e['directory']);}return _0x2d3d0e;});})[_0x3ae0('0x41')](function(_0x141154){throw new db['Sequelize'][(_0x3ae0('0x5b'))](_0x141154[_0x3ae0('0x5c')]);});}})[_0x3ae0('0x21')](handleEntityNotFound(_0x38df37,null))['then'](removeEntity(_0x38df37,null))['catch'](handleError(_0x38df37,null));};exports['addSound']=function(_0x24b79b,_0x1f17ba,_0x5e5fcd){return db['sequelize'][_0x3ae0('0x49')](function(_0x13581a){var _0x4a8e80;return db['VoiceMusicOnHold'][_0x3ae0('0x45')]({'where':{'id':_0x24b79b[_0x3ae0('0x43')]['id']}})['then'](function(_0x116600){if(_0x116600){_0x4a8e80=_0x116600;return _0x116600[_0x3ae0('0x5d')](_0x24b79b[_0x3ae0('0x46')]['id'],{'transaction':_0x13581a});}})[_0x3ae0('0x21')](function(_0x3be256){if(_0x3be256){return db['Sound'][_0x3ae0('0x5e')]({'where':{'id':_0x24b79b['body']['id']},'attributes':['id',_0x3ae0('0x28'),_0x3ae0('0x5f'),'converted_format',_0x3ae0('0x60')],'raw':!![]});}})[_0x3ae0('0x21')](function(_0x48b093){if(_0x48b093){var _0xcf039a=path['join'](config[_0x3ae0('0x4c')],_0x3ae0('0x61'),util['format'](_0x3ae0('0x62'),path[_0x3ae0('0x63')](_0x48b093[_0x3ae0('0x5f')],path[_0x3ae0('0x64')](_0x48b093['save_name'])),_0x48b093[_0x3ae0('0x65')]));var _0x332df2=path['join'](config[_0x3ae0('0x4c')],_0x3ae0('0x4d'),_0x4a8e80[_0x3ae0('0x28')],util[_0x3ae0('0x66')]('%s.%s',_0x48b093['name'],_0x48b093[_0x3ae0('0x65')]));fs['symlinkSync'](_0xcf039a,_0x332df2);return _0x48b093;}})['catch'](function(_0x22039f){throw new db[(_0x3ae0('0x67'))][(_0x3ae0('0x5b'))](_0x22039f[_0x3ae0('0x5c')]);});})[_0x3ae0('0x21')](handleEntityNotFound(_0x1f17ba,null))['then'](respondWithResult(_0x1f17ba,0xc9))['catch'](handleError(_0x1f17ba,null));};exports[_0x3ae0('0x68')]=function(_0x480d5e,_0x22b817,_0x32f025){return db['sequelize'][_0x3ae0('0x49')](function(_0xa82d0d){var _0x12616f;return db[_0x3ae0('0x2b')]['findOne']({'where':{'id':_0x480d5e[_0x3ae0('0x43')]['id']}})[_0x3ae0('0x21')](handleEntityNotFound(_0x22b817,null))['then'](function(_0x59bb5a){if(_0x59bb5a){_0x12616f=_0x59bb5a;return _0x59bb5a[_0x3ae0('0x68')](_0x480d5e[_0x3ae0('0x43')][_0x3ae0('0x69')]);}})[_0x3ae0('0x21')](function(_0x11d3f1){if(_0x11d3f1){return db[_0x3ae0('0x6a')][_0x3ae0('0x5e')]({'where':{'id':_0x480d5e[_0x3ae0('0x43')][_0x3ae0('0x69')]},'attributes':['id','name',_0x3ae0('0x5f'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x3dc596){if(_0x3dc596){fs[_0x3ae0('0x59')](path['join'](_0x12616f[_0x3ae0('0x4a')],util[_0x3ae0('0x66')](_0x3ae0('0x62'),_0x3dc596[_0x3ae0('0x28')],_0x3dc596[_0x3ae0('0x65')])));return _0x3dc596;}})['catch'](function(_0x43bbe5){throw new db['Sequelize'][(_0x3ae0('0x5b'))](_0x43bbe5[_0x3ae0('0x5c')]);});})[_0x3ae0('0x21')](handleEntityNotFound(_0x22b817,null))[_0x3ae0('0x21')](respondWithStatusCode(_0x22b817,0xcc))['catch'](handleError(_0x22b817,null));};exports[_0x3ae0('0x6b')]=function(_0xc3d90d,_0x438636,_0x23340c){var _0x1507ba={};var _0x2657df={};var _0x286a0e;var _0x26c933;return db[_0x3ae0('0x2b')][_0x3ae0('0x5e')]({'where':{'id':_0xc3d90d['params']['id']}})['then'](handleEntityNotFound(_0x438636,null))[_0x3ae0('0x21')](function(_0x657320){if(_0x657320){_0x286a0e=_0x657320;_0x2657df[_0x3ae0('0x30')]=_['keys'](db[_0x3ae0('0x6a')][_0x3ae0('0x2c')]);_0x2657df[_0x3ae0('0x32')]=_[_0x3ae0('0x33')](_0xc3d90d['query']);_0x2657df[_0x3ae0('0x34')]=_['intersection'](_0x2657df[_0x3ae0('0x30')],_0x2657df[_0x3ae0('0x32')]);_0x1507ba['attributes']=_[_0x3ae0('0x6c')](_0x2657df[_0x3ae0('0x30')],qs[_0x3ae0('0x36')](_0xc3d90d[_0x3ae0('0x32')][_0x3ae0('0x36')]));_0x1507ba[_0x3ae0('0x35')]=_0x1507ba['attributes'][_0x3ae0('0x37')]?_0x1507ba[_0x3ae0('0x35')]:_0x2657df[_0x3ae0('0x30')];_0x1507ba['order']=qs['sort'](_0xc3d90d[_0x3ae0('0x32')]['sort']);_0x1507ba[_0x3ae0('0x3c')]=qs[_0x3ae0('0x34')](_[_0x3ae0('0x3d')](_0xc3d90d[_0x3ae0('0x32')],_0x2657df[_0x3ae0('0x34')]));if(_0xc3d90d[_0x3ae0('0x32')]['filter']){_0x1507ba[_0x3ae0('0x3c')]=_[_0x3ae0('0x3e')](_0x1507ba[_0x3ae0('0x3c')],{'$or':_[_0x3ae0('0x31')](_0x1507ba['attributes'],function(_0x23632e){var _0x41b97c={};_0x41b97c[_0x23632e]={'$like':'%'+_0xc3d90d[_0x3ae0('0x32')]['filter']+'%'};return _0x41b97c;})});}_0x1507ba=_[_0x3ae0('0x3e')]({},_0x1507ba,_0xc3d90d[_0x3ae0('0x6d')]);return _0x286a0e['getSounds'](_0x1507ba);}})[_0x3ae0('0x21')](function(_0x5a9727){if(_0x5a9727){_0x26c933=_0x5a9727['length'];if(!_0xc3d90d['query'][_0x3ae0('0x38')](_0x3ae0('0x39'))){_0x1507ba[_0x3ae0('0x1a')]=qs[_0x3ae0('0x1a')](_0xc3d90d[_0x3ae0('0x32')]['limit']);_0x1507ba[_0x3ae0('0x18')]=qs[_0x3ae0('0x18')](_0xc3d90d[_0x3ae0('0x32')]['offset']);}return _0x286a0e['getSounds'](_0x1507ba);}})[_0x3ae0('0x21')](function(_0x9ead95){if(_0x9ead95){return _0x9ead95?{'count':_0x26c933,'rows':_0x9ead95}:null;}})[_0x3ae0('0x21')](respondWithResult(_0x438636,null))[_0x3ae0('0x41')](handleError(_0x438636,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 0b8fc1a..91b2171 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 _0x6c68=['exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','moment','bluebird','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x1bc5cb,_0x4cffa7){var _0x2f5819=function(_0x2ef8f9){while(--_0x2ef8f9){_0x1bc5cb['push'](_0x1bc5cb['shift']());}};_0x2f5819(++_0x4cffa7);}(_0x6c68,0x16c));var _0x86c6=function(_0x54f10e,_0x328584){_0x54f10e=_0x54f10e-0x0;var _0x1cc01d=_0x6c68[_0x54f10e];return _0x1cc01d;};'use strict';var _=require(_0x86c6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x86c6('0x1'));var BPromise=require(_0x86c6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x86c6('0x3'));var config=require(_0x86c6('0x4'));var attributes=require(_0x86c6('0x5'));module[_0x86c6('0x6')]=function(_0x4e4068,_0x17ec69){return _0x4e4068[_0x86c6('0x7')](_0x86c6('0x8'),attributes,{'tableName':_0x86c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x576f=['voice_musiconhold','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x5367b5,_0x3bec4a){var _0x2f94ce=function(_0x23d364){while(--_0x23d364){_0x5367b5['push'](_0x5367b5['shift']());}};_0x2f94ce(++_0x3bec4a);}(_0x576f,0x90));var _0xf576=function(_0xa6db01,_0x377231){_0xa6db01=_0xa6db01-0x0;var _0x4d33a2=_0x576f[_0xa6db01];return _0x4d33a2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf576('0x0'))(_0xf576('0x1'));var moment=require(_0xf576('0x2'));var BPromise=require(_0xf576('0x3'));var rp=require(_0xf576('0x4'));var fs=require('fs');var path=require(_0xf576('0x5'));var rimraf=require(_0xf576('0x6'));var config=require(_0xf576('0x7'));var attributes=require(_0xf576('0x8'));module[_0xf576('0x9')]=function(_0x471641,_0x4d5f82){return _0x471641[_0xf576('0xa')](_0xf576('0xb'),attributes,{'tableName':_0xf576('0xc'),'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 3a3a35e..024c611 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x382eb2,_0x1c9d6b){var _0x4a3963=function(_0x2abc8c){while(--_0x2abc8c){_0x382eb2['push'](_0x382eb2['shift']());}};_0x4a3963(++_0x1c9d6b);}(_0x70e0,0x17b));var _0x070e=function(_0x39b40b,_0x426e59){_0x39b40b=_0x39b40b-0x0;var _0x267195=_0x70e0[_0x39b40b];return _0x267195;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x2922e3,_0x397f41){var _0x54ec7d=function(_0x255395){while(--_0x255395){_0x2922e3['push'](_0x2922e3['shift']());}};_0x54ec7d(++_0x397f41);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 973ac8d..aa8855c 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 _0xa459=['addAgents','addTeams','put','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','post','create','/:id/users'];(function(_0x35138b,_0x5417b3){var _0x19025c=function(_0x598f09){while(--_0x598f09){_0x35138b['push'](_0x35138b['shift']());}};_0x19025c(++_0x5417b3);}(_0xa459,0x1d8));var _0x9a45=function(_0xe0af37,_0x5b1ca8){_0xe0af37=_0xe0af37-0x0;var _0x546c30=_0xa459[_0xe0af37];return _0x546c30;};'use strict';var multer=require(_0x9a45('0x0'));var util=require(_0x9a45('0x1'));var path=require(_0x9a45('0x2'));var timeout=require(_0x9a45('0x3'));var express=require(_0x9a45('0x4'));var router=express[_0x9a45('0x5')]();var fs_extra=require(_0x9a45('0x6'));var auth=require(_0x9a45('0x7'));var interaction=require(_0x9a45('0x8'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x9a45('0x9')](),controller['index']);router[_0x9a45('0xa')](_0x9a45('0xb'),auth[_0x9a45('0x9')](),controller[_0x9a45('0xc')]);router[_0x9a45('0xa')](_0x9a45('0xd'),auth['isAuthenticated'](),controller[_0x9a45('0xe')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x9a45('0xf')]);router[_0x9a45('0xa')](_0x9a45('0x10'),auth['isAuthenticated'](),controller[_0x9a45('0x11')]);router[_0x9a45('0x12')]('/',auth[_0x9a45('0x9')](),controller[_0x9a45('0x13')]);router[_0x9a45('0x12')](_0x9a45('0x14'),auth[_0x9a45('0x9')](),controller[_0x9a45('0x15')]);router[_0x9a45('0x12')]('/:id/teams',auth[_0x9a45('0x9')](),controller[_0x9a45('0x16')]);router[_0x9a45('0x17')]('/:id',auth[_0x9a45('0x9')](),controller['update']);router[_0x9a45('0x18')]('/:id',auth[_0x9a45('0x9')](),controller[_0x9a45('0x19')]);router[_0x9a45('0x18')](_0x9a45('0x14'),auth[_0x9a45('0x9')](),controller[_0x9a45('0x1a')]);router['delete'](_0x9a45('0x10'),auth[_0x9a45('0x9')](),controller[_0x9a45('0x1b')]);module[_0x9a45('0x1c')]=router; \ No newline at end of file +var _0xf0db=['/:id/users','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show'];(function(_0x51057a,_0x2c8c27){var _0x3cbdaa=function(_0x168adf){while(--_0x168adf){_0x51057a['push'](_0x51057a['shift']());}};_0x3cbdaa(++_0x2c8c27);}(_0xf0db,0x12b));var _0xbf0d=function(_0x2b2b33,_0x56606f){_0x2b2b33=_0x2b2b33-0x0;var _0x229157=_0xf0db[_0x2b2b33];return _0x229157;};'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('./voicePrefix.controller');router[_0xbf0d('0x7')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x9')]);router[_0xbf0d('0x7')]('/describe',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['getAgents']);router[_0xbf0d('0x7')](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xf')]);router[_0xbf0d('0x10')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x11')]);router[_0xbf0d('0x10')]('/:id/users',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x12')]);router['post'](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x13')]);router[_0xbf0d('0x14')](_0xbf0d('0xb'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x15')]);router[_0xbf0d('0x16')](_0xbf0d('0xb'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x17')]);router[_0xbf0d('0x16')](_0xbf0d('0xd'),auth[_0xbf0d('0x8')](),controller['removeAgents']);router[_0xbf0d('0x16')](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x18')]);module[_0xbf0d('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 6373578..0643ce5 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 _0x6b97=['name','VIRTUAL','system-','sequelize','exports','STRING'];(function(_0x284bd6,_0x1e4280){var _0x4608f1=function(_0x4dfb88){while(--_0x4dfb88){_0x284bd6['push'](_0x284bd6['shift']());}};_0x4608f1(++_0x1e4280);}(_0x6b97,0x165));var _0x76b9=function(_0x39e379,_0x3543ea){_0x39e379=_0x39e379-0x0;var _0x10ed58=_0x6b97[_0x39e379];return _0x10ed58;};'use strict';var Sequelize=require(_0x76b9('0x0'));module[_0x76b9('0x1')]={'name':{'type':Sequelize[_0x76b9('0x2')],'allowNull':![],'unique':_0x76b9('0x3')},'prefix':{'type':Sequelize[_0x76b9('0x4')],'get':function(_0x493e31){return _0x76b9('0x5')+this['getDataValue'](_0x76b9('0x3'))+'-';}},'description':{'type':Sequelize[_0x76b9('0x2')]},'callerIdAll':{'type':Sequelize[_0x76b9('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xcbc2=['VIRTUAL','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xcbc2,0xc7));var _0x2cbc=function(_0x65c597,_0x39e7e0){_0x65c597=_0x65c597-0x0;var _0x1ec368=_0xcbc2[_0x65c597];return _0x1ec368;};'use strict';var Sequelize=require(_0x2cbc('0x0'));module[_0x2cbc('0x1')]={'name':{'type':Sequelize[_0x2cbc('0x2')],'allowNull':![],'unique':_0x2cbc('0x3')},'prefix':{'type':Sequelize[_0x2cbc('0x4')],'get':function(_0x107353){return'system-'+this[_0x2cbc('0x5')](_0x2cbc('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x2cbc('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x2cbc('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 9759e69..0ad6ee9 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 _0x5eb8=['from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','sort','where','pick','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','find','describe','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','VoicePrefixId','bulkCreate','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','sequelize','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','order','hasOwnProperty','nolimit','getTeams','addTeams','Team','User','online','voicePause','interface','flatMap','Agents','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','removeTeams','field','tq.TeamId'];(function(_0x29af35,_0x51b2cb){var _0x15defa=function(_0x129c58){while(--_0x129c58){_0x29af35['push'](_0x29af35['shift']());}};_0x15defa(++_0x51b2cb);}(_0x5eb8,0xb0));var _0x85eb=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0x5eb8[_0x52b7b9];return _0x5b5d30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];config[_0x85eb('0x19')]=_[_0x85eb('0x1a')](config[_0x85eb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0x19')]));require('./voicePrefix.socket')[_0x85eb('0x1b')](socket);function respondWithStatusCode(_0x23a82a,_0x600a7f){_0x600a7f=_0x600a7f||0xcc;return function(_0x1604ba){if(_0x1604ba){return _0x23a82a[_0x85eb('0x1c')](_0x600a7f);}return _0x23a82a['status'](_0x600a7f)[_0x85eb('0x1d')]();};}function respondWithResult(_0x59237b,_0x17140b){_0x17140b=_0x17140b||0xc8;return function(_0x10c2c9){if(_0x10c2c9){return _0x59237b[_0x85eb('0x1e')](_0x17140b)[_0x85eb('0x1f')](_0x10c2c9);}};}function respondWithFilteredResult(_0x5dbeda,_0x5c5cbb){return function(_0x50d2a8){if(_0x50d2a8){var _0xe198ca=typeof _0x5c5cbb[_0x85eb('0x20')]===_0x85eb('0x21')&&typeof _0x5c5cbb[_0x85eb('0x22')]===_0x85eb('0x21');var _0x34f875=_0x50d2a8['count'];var _0x24cf28=_0xe198ca?0x0:_0x5c5cbb[_0x85eb('0x20')];var _0xd9f06d=_0xe198ca?_0x50d2a8['count']:_0x5c5cbb['offset']+_0x5c5cbb['limit'];var _0x55b9e4;if(_0xd9f06d>=_0x34f875){_0xd9f06d=_0x34f875;_0x55b9e4=0xc8;}else{_0x55b9e4=0xce;}_0x5dbeda[_0x85eb('0x1e')](_0x55b9e4);return _0x5dbeda[_0x85eb('0x23')](_0x85eb('0x24'),_0x24cf28+'-'+_0xd9f06d+'/'+_0x34f875)[_0x85eb('0x1f')](_0x50d2a8);}return null;};}function patchUpdates(_0x465c74){return function(_0x3fc6da){try{jsonpatch['apply'](_0x3fc6da,_0x465c74,!![]);}catch(_0x5491d5){return BPromise['reject'](_0x5491d5);}return _0x3fc6da[_0x85eb('0x25')]();};}function saveUpdates(_0x1426c8,_0x3f7a4d){return function(_0x28b87d){if(_0x28b87d){return _0x28b87d[_0x85eb('0x26')](_0x1426c8)[_0x85eb('0x27')](function(_0x5dfc96){return _0x5dfc96;});}return null;};}function removeEntity(_0x39d3fe,_0x3453cd){return function(_0x4709ad){if(_0x4709ad){return _0x4709ad[_0x85eb('0x28')]()[_0x85eb('0x27')](function(){var _0x57a03c=_0x4709ad[_0x85eb('0x29')]({'plain':!![]});var _0x792d3a=_0x85eb('0x2a');return db[_0x85eb('0x2b')][_0x85eb('0x28')]({'where':{'type':_0x792d3a,'resourceId':_0x57a03c['id']}})[_0x85eb('0x27')](function(){return _0x4709ad;});})['then'](function(){_0x39d3fe['status'](0xcc)[_0x85eb('0x1d')]();});}};}function handleEntityNotFound(_0x585f2a,_0xa9b14f){return function(_0x5255eb){if(!_0x5255eb){_0x585f2a[_0x85eb('0x1c')](0x194);}return _0x5255eb;};}function handleError(_0x3570f7,_0x1ba904){_0x1ba904=_0x1ba904||0x1f4;return function(_0x1d9278){logger[_0x85eb('0x2c')](_0x1d9278[_0x85eb('0x2d')]);if(_0x1d9278[_0x85eb('0x2e')]){delete _0x1d9278['name'];}_0x3570f7[_0x85eb('0x1e')](_0x1ba904)[_0x85eb('0x2f')](_0x1d9278);};}exports['index']=function(_0x197898,_0x5af2de){var _0x5439aa={},_0x3c5ecc={},_0x3a533c={'count':0x0,'rows':[]};var _0x3e6f34=_[_0x85eb('0x30')](db[_0x85eb('0x31')][_0x85eb('0x32')],function(_0x39b574){return{'name':_0x39b574[_0x85eb('0x33')],'type':_0x39b574[_0x85eb('0x34')][_0x85eb('0x35')]};});_0x3c5ecc['model']=_[_0x85eb('0x30')](_0x3e6f34,_0x85eb('0x2e'));_0x3c5ecc['query']=_['keys'](_0x197898[_0x85eb('0x36')]);_0x3c5ecc[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x3c5ecc[_0x85eb('0x39')],_0x3c5ecc[_0x85eb('0x36')]);_0x5439aa[_0x85eb('0x3a')]=_[_0x85eb('0x38')](_0x3c5ecc[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x197898[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x5439aa[_0x85eb('0x3a')]=_0x5439aa[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0x5439aa['attributes']:_0x3c5ecc[_0x85eb('0x39')];if(!_0x197898[_0x85eb('0x36')]['hasOwnProperty']('nolimit')){_0x5439aa[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x197898['query'][_0x85eb('0x22')]);_0x5439aa['offset']=qs[_0x85eb('0x20')](_0x197898['query'][_0x85eb('0x20')]);}_0x5439aa['order']=qs[_0x85eb('0x3d')](_0x197898['query'][_0x85eb('0x3d')]);_0x5439aa[_0x85eb('0x3e')]=qs['filters'](_[_0x85eb('0x3f')](_0x197898['query'],_0x3c5ecc[_0x85eb('0x37')]),_0x3e6f34);if(_0x197898[_0x85eb('0x36')]['filter']){_0x5439aa[_0x85eb('0x3e')]=_['merge'](_0x5439aa['where'],{'$or':_[_0x85eb('0x30')](_0x3e6f34,function(_0x4edb2d){if(_0x4edb2d[_0x85eb('0x34')]!==_0x85eb('0x40')){var _0x5da012={};_0x5da012[_0x4edb2d['name']]={'$like':'%'+_0x197898[_0x85eb('0x36')][_0x85eb('0x41')]+'%'};return _0x5da012;}})});}_0x5439aa=_['merge']({},_0x5439aa,_0x197898['options']);var _0x2864e2={'where':_0x5439aa[_0x85eb('0x3e')]};return db[_0x85eb('0x31')][_0x85eb('0x42')](_0x2864e2)[_0x85eb('0x27')](function(_0x5b7411){_0x3a533c[_0x85eb('0x42')]=_0x5b7411;if(_0x197898[_0x85eb('0x36')][_0x85eb('0x43')]){_0x5439aa[_0x85eb('0x44')]=[{'all':!![]}];}return db[_0x85eb('0x31')][_0x85eb('0x45')](_0x5439aa);})[_0x85eb('0x27')](function(_0x3e11a8){_0x3a533c[_0x85eb('0x46')]=_0x3e11a8;return _0x3a533c;})['then'](respondWithFilteredResult(_0x5af2de,_0x5439aa))[_0x85eb('0x47')](handleError(_0x5af2de,null));};exports[_0x85eb('0x48')]=function(_0x5d90cc,_0x1b77b3){var _0x201aed={'raw':![],'where':{'id':_0x5d90cc[_0x85eb('0x49')]['id']}},_0x2dae5b={};_0x2dae5b[_0x85eb('0x39')]=_[_0x85eb('0x4a')](db['VoicePrefix'][_0x85eb('0x32')]);_0x2dae5b[_0x85eb('0x36')]=_[_0x85eb('0x4a')](_0x5d90cc[_0x85eb('0x36')]);_0x2dae5b[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x2dae5b[_0x85eb('0x39')],_0x2dae5b[_0x85eb('0x36')]);_0x201aed['attributes']=_[_0x85eb('0x38')](_0x2dae5b[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x5d90cc[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x201aed[_0x85eb('0x3a')]=_0x201aed[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0x201aed[_0x85eb('0x3a')]:_0x2dae5b[_0x85eb('0x39')];if(_0x5d90cc[_0x85eb('0x36')][_0x85eb('0x43')]){_0x201aed['include']=[{'all':!![]}];}_0x201aed=_[_0x85eb('0x4b')]({},_0x201aed,_0x5d90cc[_0x85eb('0x4c')]);return db[_0x85eb('0x31')]['find'](_0x201aed)[_0x85eb('0x27')](handleEntityNotFound(_0x1b77b3,null))[_0x85eb('0x27')](respondWithResult(_0x1b77b3,null))[_0x85eb('0x47')](handleError(_0x1b77b3,null));};exports[_0x85eb('0x28')]=function(_0xd3ff2b,_0x4a7506){return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0xd3ff2b[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a7506,null))[_0x85eb('0x27')](removeEntity(_0x4a7506,null))[_0x85eb('0x47')](handleError(_0x4a7506,null));};exports[_0x85eb('0x4e')]=function(_0x4c06ef,_0x56f510){return db[_0x85eb('0x31')]['describe']()['then'](respondWithResult(_0x56f510,null))[_0x85eb('0x47')](handleError(_0x56f510,null));};exports['create']=function(_0x39316d,_0xfb0ac){var _0x4e3d96;return db['sequelize'][_0x85eb('0x4f')](function(_0x249511){return db[_0x85eb('0x31')][_0x85eb('0x50')](_0x39316d[_0x85eb('0x51')],{'transaction':_0x249511})['then'](function(_0x1bb9f8){_0x4e3d96=_0x1bb9f8[_0x85eb('0x29')]({'plain':!![]});return db[_0x85eb('0x52')][_0x85eb('0x4d')]({'where':{'id':_0x4e3d96[_0x85eb('0x53')]},'raw':!![]})['then'](function(_0x140919){return createVoicePrefixExtensions(_0x4e3d96,_0x140919,_0x249511);});});})['then'](function(){var _0xd2e792=_0x39316d[_0x85eb('0x54')]['get']({'plain':!![]});if(!_0xd2e792)throw new Error(_0x85eb('0x55'));if(_0xd2e792[_0x85eb('0x56')]===_0x85eb('0x54')){var _0x26e04a=_0x4e3d96;return db[_0x85eb('0x57')][_0x85eb('0x4d')]({'where':{'name':'VoicePrefixes','userProfileId':_0xd2e792[_0x85eb('0x58')]},'raw':!![]})['then'](function(_0x311857){if(_0x311857&&_0x311857[_0x85eb('0x59')]===0x0){return db['UserProfileResource'][_0x85eb('0x50')]({'name':_0x26e04a[_0x85eb('0x2e')],'resourceId':_0x26e04a['id'],'type':_0x311857['name'],'sectionId':_0x311857['id']},{})[_0x85eb('0x27')](function(){return _0x4e3d96;});}else{return _0x4e3d96;}})['catch'](function(_0x452e7e){logger[_0x85eb('0x2c')](_0x85eb('0x5a'),_0x452e7e);throw _0x452e7e;});}return _0x4e3d96;})[_0x85eb('0x27')](respondWithResult(_0xfb0ac,null))[_0x85eb('0x47')](handleError(_0xfb0ac,null));};function Extension(_0x15d4a7,_0x5a729e,_0x2227ea,_0x76a9c6){this[_0x85eb('0x5b')]=_0x85eb('0x5c');this[_0x85eb('0x5d')]=_0x15d4a7;this[_0x85eb('0x5e')]=_0x2227ea;this[_0x85eb('0x34')]=_0x85eb('0x5f');this[_0x85eb('0x60')]=_0x85eb('0x61');this[_0x85eb('0x62')]=_0x5a729e;this['appdata']=_0x76a9c6;}function createVoicePrefixExtensions(_0x271842,_0x21b873,_0x46e5d3){return new BPromise(function(_0xdaf2fe,_0x4470b3){var _0x213b64=new Extension(formatPrefixName(_0x271842['prefix']),0x1,_0x85eb('0x63'),'Voice\x20Prefix');_0x213b64[_0x85eb('0x64')]=_0x271842['id'];return db[_0x85eb('0x52')][_0x85eb('0x50')](_0x213b64,{'transaction':_0x46e5d3})[_0x85eb('0x27')](function(_0x8f8a72){var _0x4f09dc=_0x8f8a72[_0x85eb('0x29')]({'plain':!![]});var _0x143d65=_[_0x85eb('0x30')](addVoicePrefixExtensions(_0x271842,_0x21b873),function(_0x2c40f8){_0x2c40f8[_0x85eb('0x53')]=_0x4f09dc['id'];_0x2c40f8[_0x85eb('0x64')]=_0x271842['id'];return _0x2c40f8;});return db[_0x85eb('0x52')][_0x85eb('0x65')](_0x143d65,{'transaction':_0x46e5d3})['then'](function(_0x3b896a){if(!_0x3b896a){return _0x4470b3('Extensions\x20creation\x20failed');}else{return _0xdaf2fe(_0x3b896a);}})[_0x85eb('0x47')](function(_0x3ff0f9){return _0x4470b3(_0x3ff0f9);});});;});};function addVoicePrefixExtensions(_0x2ac293,_0x41960f){var _0x259ee3=[];var _0x547ccb=formatPrefixName(_0x2ac293[_0x85eb('0x66')]);_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x2,_0x85eb('0x68'),_0x85eb('0x69')+_0x2ac293[_0x85eb('0x2e')]));if(_0x2ac293[_0x85eb('0x6a')]){_0x259ee3['push'](new Extension(_0x547ccb,0x3,'Set',_0x85eb('0x6b')+_0x2ac293['callerIdAll']));}else{_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x3,_0x85eb('0x63'),_0x85eb('0x6c')));}_0x259ee3[_0x85eb('0x67')](new Extension(_0x547ccb,0x4,_0x85eb('0x6d'),_0x41960f[_0x85eb('0x5b')]+','+'${EXTEN:'+(0x8+_0x2ac293[_0x85eb('0x2e')][_0x85eb('0x3c')])+'}'+','+0x1));return _0x259ee3;}function formatPrefixName(_0x3f30e4){var _0x2e65d5='_';for(var _0x52bbdf=0x0;_0x52bbdf<_0x3f30e4[_0x85eb('0x3c')];_0x52bbdf++){if(_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf)=='-'){_0x2e65d5+=_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf);}else{_0x2e65d5+='['+_0x3f30e4[_0x85eb('0x6e')](_0x52bbdf)+']';}}_0x2e65d5+='.';return _0x2e65d5;}exports['update']=function(_0x459317,_0x2e6734,_0x13a040){var _0x5fcd48=_0x459317[_0x85eb('0x51')];_0x5fcd48[_0x85eb('0x66')]=_0x85eb('0x6f')+_0x5fcd48[_0x85eb('0x2e')]+'-';return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x170a60){return db[_0x85eb('0x31')][_0x85eb('0x26')](_0x5fcd48,{'where':{'id':_0x5fcd48['id']},'transaction':_0x170a60})[_0x85eb('0x27')](function(){return db[_0x85eb('0x52')][_0x85eb('0x28')]({'where':{'VoicePrefixId':_0x5fcd48['id']},'transaction':_0x170a60})[_0x85eb('0x27')](function(){return db[_0x85eb('0x52')][_0x85eb('0x4d')]({'where':{'id':_0x5fcd48['VoiceExtensionId']},'raw':!![]})[_0x85eb('0x27')](function(_0x4dd31e){return createVoicePrefixExtensions(_0x5fcd48,_0x4dd31e,_0x170a60);});});});})[_0x85eb('0x27')](function(){return db[_0x85eb('0x31')][_0x85eb('0x71')](_0x5fcd48['id']);})[_0x85eb('0x27')](respondWithResult(_0x2e6734,null))[_0x85eb('0x47')](handleError(_0x2e6734,null));};exports[_0x85eb('0x72')]=function(_0x9f4f,_0x3076df,_0x2ca9f9){return db['VoicePrefix'][_0x85eb('0x4d')]({'where':{'id':_0x9f4f[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x3076df,null))[_0x85eb('0x27')](function(_0x440968){if(_0x440968){return _0x440968['addAgents'](_0x9f4f[_0x85eb('0x51')]['ids'],_[_0x85eb('0x73')](_0x9f4f[_0x85eb('0x51')],[_0x85eb('0x74'),'id'])||{})['spread'](function(_0x2daa64){for(var _0x2e358d=0x0;_0x2e358d<_0x9f4f[_0x85eb('0x51')]['ids']['length'];_0x2e358d+=0x1){socket[_0x85eb('0x75')](_0x85eb('0x76'),{'UserId':Number(_0x9f4f[_0x85eb('0x51')][_0x85eb('0x74')][_0x2e358d]),'VoicePrefixId':Number(_0x9f4f['params']['id'])});}return _0x2daa64;});}})[_0x85eb('0x27')](respondWithResult(_0x3076df,null))['catch'](handleError(_0x3076df,null));};exports[_0x85eb('0x77')]=function(_0xed99f7,_0x528d2e,_0x2fad3b){return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0xed99f7['params']['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x528d2e,null))['then'](function(_0x18049b){if(_0x18049b){return _0x18049b[_0x85eb('0x77')](_0xed99f7[_0x85eb('0x36')][_0x85eb('0x74')])[_0x85eb('0x27')](function(){if(_[_0x85eb('0x78')](_0xed99f7[_0x85eb('0x36')][_0x85eb('0x74')])){for(var _0x3a471d=0x0;_0x3a471d<_0xed99f7['query'][_0x85eb('0x74')][_0x85eb('0x3c')];_0x3a471d+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0xed99f7[_0x85eb('0x36')]['ids'][_0x3a471d]),'VoicePrefixId':Number(_0xed99f7[_0x85eb('0x49')]['id'])});}}else{socket['emit'](_0x85eb('0x79'),{'UserId':Number(_0xed99f7['query'][_0x85eb('0x74')]),'VoicePrefixId':Number(_0xed99f7[_0x85eb('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x528d2e,null))[_0x85eb('0x47')](handleError(_0x528d2e,null));};exports[_0x85eb('0x7a')]=function(_0x555236,_0x888c46,_0x3b327d){var _0xf076af={};var _0x16b378={};var _0x5dd40c;var _0x1d82a4;return db['VoicePrefix'][_0x85eb('0x7b')]({'where':{'id':_0x555236[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x888c46,null))['then'](function(_0x60e9b9){if(_0x60e9b9){_0x5dd40c=_0x60e9b9;_0x16b378[_0x85eb('0x39')]=_[_0x85eb('0x4a')](db['User'][_0x85eb('0x32')]);_0x16b378['query']=_[_0x85eb('0x4a')](_0x555236[_0x85eb('0x36')]);_0x16b378[_0x85eb('0x37')]=_['intersection'](_0x16b378['model'],_0x16b378['query']);_0xf076af[_0x85eb('0x3a')]=_[_0x85eb('0x38')](_0x16b378[_0x85eb('0x39')],qs['fields'](_0x555236[_0x85eb('0x36')][_0x85eb('0x3b')]));_0xf076af[_0x85eb('0x3a')]=_0xf076af[_0x85eb('0x3a')][_0x85eb('0x3c')]?_0xf076af['attributes']:_0x16b378['model'];_0xf076af[_0x85eb('0x7c')]=qs[_0x85eb('0x3d')](_0x555236['query'][_0x85eb('0x3d')]);_0xf076af[_0x85eb('0x3e')]=qs[_0x85eb('0x37')](_[_0x85eb('0x3f')](_0x555236[_0x85eb('0x36')],_0x16b378[_0x85eb('0x37')]));if(_0x555236[_0x85eb('0x36')][_0x85eb('0x41')]){_0xf076af[_0x85eb('0x3e')]=_[_0x85eb('0x4b')](_0xf076af[_0x85eb('0x3e')],{'$or':_[_0x85eb('0x30')](_0xf076af[_0x85eb('0x3a')],function(_0x171428){var _0x326b12={};_0x326b12[_0x171428]={'$like':'%'+_0x555236['query'][_0x85eb('0x41')]+'%'};return _0x326b12;})});}_0xf076af=_[_0x85eb('0x4b')]({},_0xf076af,_0x555236[_0x85eb('0x4c')]);return _0x5dd40c[_0x85eb('0x7a')](_0xf076af);}})[_0x85eb('0x27')](function(_0x23191c){if(_0x23191c){_0x1d82a4=_0x23191c[_0x85eb('0x3c')];if(!_0x555236[_0x85eb('0x36')][_0x85eb('0x7d')](_0x85eb('0x7e'))){_0xf076af['limit']=qs[_0x85eb('0x22')](_0x555236[_0x85eb('0x36')][_0x85eb('0x22')]);_0xf076af[_0x85eb('0x20')]=qs['offset'](_0x555236[_0x85eb('0x36')][_0x85eb('0x20')]);}return _0x5dd40c[_0x85eb('0x7a')](_0xf076af);}})[_0x85eb('0x27')](function(_0x362ba9){if(_0x362ba9){return _0x362ba9?{'count':_0x1d82a4,'rows':_0x362ba9}:null;}})[_0x85eb('0x27')](respondWithResult(_0x888c46,null))['catch'](handleError(_0x888c46,null));};exports[_0x85eb('0x7f')]=function(_0x36dbb1,_0x12c3be,_0x59fc6a){var _0x15802f={};var _0x278558={};var _0x2d0bfb;var _0x3b3b07;return db[_0x85eb('0x31')][_0x85eb('0x7b')]({'where':{'id':_0x36dbb1[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](handleEntityNotFound(_0x12c3be,null))['then'](function(_0x44af01){if(_0x44af01){_0x2d0bfb=_0x44af01;_0x278558[_0x85eb('0x39')]=_['keys'](db['Team'][_0x85eb('0x32')]);_0x278558['query']=_[_0x85eb('0x4a')](_0x36dbb1[_0x85eb('0x36')]);_0x278558[_0x85eb('0x37')]=_[_0x85eb('0x38')](_0x278558['model'],_0x278558['query']);_0x15802f[_0x85eb('0x3a')]=_['intersection'](_0x278558[_0x85eb('0x39')],qs[_0x85eb('0x3b')](_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x3b')]));_0x15802f['attributes']=_0x15802f['attributes'][_0x85eb('0x3c')]?_0x15802f[_0x85eb('0x3a')]:_0x278558[_0x85eb('0x39')];_0x15802f['order']=qs['sort'](_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x3d')]);_0x15802f[_0x85eb('0x3e')]=qs[_0x85eb('0x37')](_[_0x85eb('0x3f')](_0x36dbb1[_0x85eb('0x36')],_0x278558[_0x85eb('0x37')]));if(_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x41')]){_0x15802f[_0x85eb('0x3e')]=_[_0x85eb('0x4b')](_0x15802f['where'],{'$or':_[_0x85eb('0x30')](_0x15802f[_0x85eb('0x3a')],function(_0x483f5f){var _0x1fe3b6={};_0x1fe3b6[_0x483f5f]={'$like':'%'+_0x36dbb1[_0x85eb('0x36')][_0x85eb('0x41')]+'%'};return _0x1fe3b6;})});}_0x15802f=_[_0x85eb('0x4b')]({},_0x15802f,_0x36dbb1[_0x85eb('0x4c')]);return _0x2d0bfb[_0x85eb('0x7f')](_0x15802f);}})['then'](function(_0x4ba2d3){if(_0x4ba2d3){_0x3b3b07=_0x4ba2d3[_0x85eb('0x3c')];if(!_0x36dbb1['query'][_0x85eb('0x7d')]('nolimit')){_0x15802f[_0x85eb('0x22')]=qs[_0x85eb('0x22')](_0x36dbb1['query']['limit']);_0x15802f[_0x85eb('0x20')]=qs[_0x85eb('0x20')](_0x36dbb1['query'][_0x85eb('0x20')]);}return _0x2d0bfb[_0x85eb('0x7f')](_0x15802f);}})[_0x85eb('0x27')](function(_0x48ed21){if(_0x48ed21){return _0x48ed21?{'count':_0x3b3b07,'rows':_0x48ed21}:null;}})['then'](respondWithResult(_0x12c3be,null))[_0x85eb('0x47')](handleError(_0x12c3be,null));};exports[_0x85eb('0x80')]=function(_0x189733,_0x422d33,_0x1d695c){var _0x4c865d=_0x189733[_0x85eb('0x51')][_0x85eb('0x74')];var _0x3b84b7;return db[_0x85eb('0x81')]['findAll']({'where':{'id':_0x4c865d},'attributes':['id'],'include':[{'model':db[_0x85eb('0x82')],'as':'Agents','attributes':['id',_0x85eb('0x2e'),_0x85eb('0x83'),_0x85eb('0x84'),_0x85eb('0x85')],'raw':!![]}]})[_0x85eb('0x27')](function(_0x52e2b9){if(_0x52e2b9){_0x3b84b7=_0x52e2b9;var _0x34c380=_[_0x85eb('0x86')](_0x52e2b9,function(_0x3bf9b4){var _0x4d3be5=_0x3bf9b4[_0x85eb('0x29')]({'plain':!![]});return _0x4d3be5[_0x85eb('0x87')];});return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0x189733[_0x85eb('0x49')]['id']}})[_0x85eb('0x27')](function(_0x209800){return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x344711){return _0x209800[_0x85eb('0x80')](_0x4c865d,{'transaction':_0x344711})[_0x85eb('0x27')](function(){return BPromise[_0x85eb('0x88')](_0x3b84b7,function(_0xfe9f80){return db[_0x85eb('0x89')][_0x85eb('0x8a')]({'TeamId':_0xfe9f80['id'],'VoicePrefixId':_0x189733['params']['id']},{'transaction':_0x344711});});})[_0x85eb('0x27')](function(){return BPromise[_0x85eb('0x88')](_0x34c380,function(_0x1c13a9){return db[_0x85eb('0x8b')][_0x85eb('0x8c')]({'where':{'UserId':_0x1c13a9['id'],'VoicePrefixId':_0x189733[_0x85eb('0x49')]['id']},'transaction':_0x344711});});})[_0x85eb('0x27')](function(){_0x34c380['forEach'](function(_0x419f52){socket[_0x85eb('0x75')]('userVoicePrefix:save',{'UserId':_0x419f52['id'],'VoicePrefixId':_0x209800['id']});});});});});}})[_0x85eb('0x27')](respondWithStatusCode(_0x422d33,null))['catch'](handleError(_0x422d33,null));};exports[_0x85eb('0x8d')]=function(_0x29a5bd,_0x933d13,_0x41dcd3){return db[_0x85eb('0x81')][_0x85eb('0x45')]({'where':{'id':_0x29a5bd[_0x85eb('0x36')][_0x85eb('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x85eb('0x27')](handleEntityNotFound(_0x933d13,null))[_0x85eb('0x27')](function(_0x29df56){var _0x1b9d2f=_['map'](_0x29df56,'id');var _0x44de5f=[];var _0x2e2af5=[];var _0x3d2e7d=squel['select']();_0x3d2e7d[_0x85eb('0x8e')](_0x85eb('0x8f'))[_0x85eb('0x90')]('team_has_voice_prefixes','tq')[_0x85eb('0x91')](_0x85eb('0x92'),'ut',_0x85eb('0x93'))['where'](_0x85eb('0x94'),_0x29a5bd[_0x85eb('0x49')]['id']);for(var _0x404fef=0x0;_0x404fef<_0x29df56[_0x85eb('0x3c')];_0x404fef+=0x1){let _0x537ce5=_0x29df56[_0x404fef];for(var _0x1a2426=0x0;_0x1a2426<_0x537ce5[_0x85eb('0x87')][_0x85eb('0x3c')];_0x1a2426+=0x1){let _0x142a76=_0x537ce5['Agents'][_0x1a2426];var _0x3b4c70=_0x3d2e7d[_0x85eb('0x95')]();_0x3b4c70[_0x85eb('0x3e')](_0x85eb('0x96'),_0x142a76['id']);_0x2e2af5[_0x85eb('0x67')](db[_0x85eb('0x70')]['query'](_0x3b4c70['toString'](),{'type':db[_0x85eb('0x70')][_0x85eb('0x97')][_0x85eb('0x98')]})[_0x85eb('0x27')](function(_0x34e916){if(_0x34e916[_0x85eb('0x3c')]===0x1){return _0x142a76['id'];}else{var _0x37973e=_['every'](_[_0x85eb('0x30')](_0x34e916,_0x85eb('0x99')),function(_0x5af162){return _[_0x85eb('0x9a')](_0x1b9d2f,_0x5af162);});if(_0x37973e){return _0x142a76['id'];}}}));}}return BPromise[_0x85eb('0x9b')](_0x2e2af5)[_0x85eb('0x27')](function(_0x24726f){_0x44de5f=_(_0x44de5f)[_0x85eb('0x9c')](_0x24726f)[_0x85eb('0x9d')]()[_0x85eb('0x9e')]();return db[_0x85eb('0x31')][_0x85eb('0x4d')]({'where':{'id':_0x29a5bd['params']['id']}})['then'](function(_0x5ac026){return db[_0x85eb('0x70')][_0x85eb('0x4f')](function(_0x27fd58){return _0x5ac026[_0x85eb('0x8d')](_0x29a5bd[_0x85eb('0x36')][_0x85eb('0x74')],{'transaction':_0x27fd58})[_0x85eb('0x27')](function(){if(!_[_0x85eb('0x9f')](_0x44de5f)){return _0x5ac026[_0x85eb('0x77')](_0x44de5f,{'transaction':_0x27fd58});}})[_0x85eb('0x27')](function(){_0x44de5f['forEach'](function(_0xc37e2){socket[_0x85eb('0x75')](_0x85eb('0x79'),{'UserId':_0xc37e2,'VoicePrefixId':_0x5ac026['id']});});});});});});})[_0x85eb('0x27')](respondWithStatusCode(_0x933d13,null))[_0x85eb('0x47')](handleError(_0x933d13,null));}; \ No newline at end of file +var _0xab40=['PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','omit','body','ids','spread','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','findAll','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','userVoicePrefix:save','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','error','stack','name','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','rows','catch','params','length','find','describe','create','sequelize','transaction','get','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','description','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll'];(function(_0x266543,_0x580b73){var _0x4ae2af=function(_0x51deb9){while(--_0x51deb9){_0x266543['push'](_0x266543['shift']());}};_0x4ae2af(++_0x580b73);}(_0xab40,0xcd));var _0x0ab4=function(_0x3f45d4,_0x5ba1a2){_0x3f45d4=_0x3f45d4-0x0;var _0x2f6b2b=_0xab40[_0x3f45d4];return _0x2f6b2b;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];config[_0x0ab4('0x15')]=_[_0x0ab4('0x16')](config[_0x0ab4('0x15')],{'host':_0x0ab4('0x17'),'port':0x18eb});var socket=require(_0x0ab4('0x18'))(new Redis(config[_0x0ab4('0x15')]));require(_0x0ab4('0x19'))[_0x0ab4('0x1a')](socket);function respondWithStatusCode(_0x3cb1df,_0x2033c8){_0x2033c8=_0x2033c8||0xcc;return function(_0x216a17){if(_0x216a17){return _0x3cb1df[_0x0ab4('0x1b')](_0x2033c8);}return _0x3cb1df[_0x0ab4('0x1c')](_0x2033c8)[_0x0ab4('0x1d')]();};}function respondWithResult(_0x2a83a8,_0x2403db){_0x2403db=_0x2403db||0xc8;return function(_0x283b15){if(_0x283b15){return _0x2a83a8[_0x0ab4('0x1c')](_0x2403db)['json'](_0x283b15);}};}function respondWithFilteredResult(_0x5000d4,_0x49634f){return function(_0x17422f){if(_0x17422f){var _0x30d5df=typeof _0x49634f[_0x0ab4('0x1e')]==='undefined'&&typeof _0x49634f[_0x0ab4('0x1f')]===_0x0ab4('0x20');var _0x212ebd=_0x17422f[_0x0ab4('0x21')];var _0x4e7852=_0x30d5df?0x0:_0x49634f['offset'];var _0xdb0797=_0x30d5df?_0x17422f['count']:_0x49634f[_0x0ab4('0x1e')]+_0x49634f[_0x0ab4('0x1f')];var _0x5bb1d0;if(_0xdb0797>=_0x212ebd){_0xdb0797=_0x212ebd;_0x5bb1d0=0xc8;}else{_0x5bb1d0=0xce;}_0x5000d4[_0x0ab4('0x1c')](_0x5bb1d0);return _0x5000d4[_0x0ab4('0x22')](_0x0ab4('0x23'),_0x4e7852+'-'+_0xdb0797+'/'+_0x212ebd)[_0x0ab4('0x24')](_0x17422f);}return null;};}function patchUpdates(_0x12d06d){return function(_0x52d7d3){try{jsonpatch['apply'](_0x52d7d3,_0x12d06d,!![]);}catch(_0x24b929){return BPromise[_0x0ab4('0x25')](_0x24b929);}return _0x52d7d3[_0x0ab4('0x26')]();};}function saveUpdates(_0x13c882,_0x4e4b80){return function(_0x42d2dd){if(_0x42d2dd){return _0x42d2dd[_0x0ab4('0x27')](_0x13c882)[_0x0ab4('0x28')](function(_0x4ea9aa){return _0x4ea9aa;});}return null;};}function removeEntity(_0x4c5caf,_0x176ff1){return function(_0x1c132c){if(_0x1c132c){return _0x1c132c[_0x0ab4('0x29')]()['then'](function(){var _0x519b23=_0x1c132c['get']({'plain':!![]});var _0x19ecc6='VoicePrefixes';return db[_0x0ab4('0x2a')][_0x0ab4('0x29')]({'where':{'type':_0x19ecc6,'resourceId':_0x519b23['id']}})['then'](function(){return _0x1c132c;});})['then'](function(){_0x4c5caf['status'](0xcc)[_0x0ab4('0x1d')]();});}};}function handleEntityNotFound(_0x183bac,_0x1cfdad){return function(_0x3f61cb){if(!_0x3f61cb){_0x183bac[_0x0ab4('0x1b')](0x194);}return _0x3f61cb;};}function handleError(_0x588e0d,_0x5b55c1){_0x5b55c1=_0x5b55c1||0x1f4;return function(_0x580d56){logger[_0x0ab4('0x2b')](_0x580d56[_0x0ab4('0x2c')]);if(_0x580d56[_0x0ab4('0x2d')]){delete _0x580d56[_0x0ab4('0x2d')];}_0x588e0d[_0x0ab4('0x1c')](_0x5b55c1)['send'](_0x580d56);};}exports['index']=function(_0x285a29,_0xe6682){var _0x361f7c={},_0x4819be={},_0x48e430={'count':0x0,'rows':[]};var _0x1b19db=_['map'](db[_0x0ab4('0x2e')][_0x0ab4('0x2f')],function(_0x263e5a){return{'name':_0x263e5a[_0x0ab4('0x30')],'type':_0x263e5a[_0x0ab4('0x31')][_0x0ab4('0x32')]};});_0x4819be['model']=_[_0x0ab4('0x33')](_0x1b19db,_0x0ab4('0x2d'));_0x4819be[_0x0ab4('0x34')]=_[_0x0ab4('0x35')](_0x285a29['query']);_0x4819be['filters']=_[_0x0ab4('0x36')](_0x4819be[_0x0ab4('0x37')],_0x4819be[_0x0ab4('0x34')]);_0x361f7c['attributes']=_['intersection'](_0x4819be['model'],qs[_0x0ab4('0x38')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x361f7c['attributes']=_0x361f7c['attributes']['length']?_0x361f7c[_0x0ab4('0x39')]:_0x4819be[_0x0ab4('0x37')];if(!_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x361f7c[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x1f')]);_0x361f7c[_0x0ab4('0x1e')]=qs['offset'](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x1e')]);}_0x361f7c[_0x0ab4('0x3c')]=qs[_0x0ab4('0x3d')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x3d')]);_0x361f7c[_0x0ab4('0x3e')]=qs[_0x0ab4('0x3f')](_[_0x0ab4('0x40')](_0x285a29[_0x0ab4('0x34')],_0x4819be[_0x0ab4('0x3f')]),_0x1b19db);if(_0x285a29[_0x0ab4('0x34')]['filter']){_0x361f7c[_0x0ab4('0x3e')]=_[_0x0ab4('0x41')](_0x361f7c[_0x0ab4('0x3e')],{'$or':_[_0x0ab4('0x33')](_0x1b19db,function(_0x589b46){if(_0x589b46[_0x0ab4('0x31')]!=='VIRTUAL'){var _0x43e5ba={};_0x43e5ba[_0x589b46[_0x0ab4('0x2d')]]={'$like':'%'+_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x42')]+'%'};return _0x43e5ba;}})});}_0x361f7c=_[_0x0ab4('0x41')]({},_0x361f7c,_0x285a29[_0x0ab4('0x43')]);var _0x5815d1={'where':_0x361f7c[_0x0ab4('0x3e')]};return db[_0x0ab4('0x2e')][_0x0ab4('0x21')](_0x5815d1)['then'](function(_0x395e0b){_0x48e430[_0x0ab4('0x21')]=_0x395e0b;if(_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x44')]){_0x361f7c[_0x0ab4('0x45')]=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x361f7c);})['then'](function(_0x2f54dd){_0x48e430[_0x0ab4('0x46')]=_0x2f54dd;return _0x48e430;})['then'](respondWithFilteredResult(_0xe6682,_0x361f7c))[_0x0ab4('0x47')](handleError(_0xe6682,null));};exports['show']=function(_0x2d1d87,_0x562262){var _0x365be1={'raw':![],'where':{'id':_0x2d1d87[_0x0ab4('0x48')]['id']}},_0x300fd8={};_0x300fd8[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x2e')]['rawAttributes']);_0x300fd8[_0x0ab4('0x34')]=_[_0x0ab4('0x35')](_0x2d1d87[_0x0ab4('0x34')]);_0x300fd8[_0x0ab4('0x3f')]=_[_0x0ab4('0x36')](_0x300fd8[_0x0ab4('0x37')],_0x300fd8['query']);_0x365be1[_0x0ab4('0x39')]=_['intersection'](_0x300fd8[_0x0ab4('0x37')],qs[_0x0ab4('0x38')](_0x2d1d87[_0x0ab4('0x34')]['fields']));_0x365be1[_0x0ab4('0x39')]=_0x365be1[_0x0ab4('0x39')][_0x0ab4('0x49')]?_0x365be1[_0x0ab4('0x39')]:_0x300fd8[_0x0ab4('0x37')];if(_0x2d1d87[_0x0ab4('0x34')]['includeAll']){_0x365be1[_0x0ab4('0x45')]=[{'all':!![]}];}_0x365be1=_[_0x0ab4('0x41')]({},_0x365be1,_0x2d1d87[_0x0ab4('0x43')]);return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')](_0x365be1)[_0x0ab4('0x28')](handleEntityNotFound(_0x562262,null))[_0x0ab4('0x28')](respondWithResult(_0x562262,null))[_0x0ab4('0x47')](handleError(_0x562262,null));};exports[_0x0ab4('0x29')]=function(_0x24bb13,_0x1a9675){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x24bb13['params']['id']}})[_0x0ab4('0x28')](handleEntityNotFound(_0x1a9675,null))[_0x0ab4('0x28')](removeEntity(_0x1a9675,null))['catch'](handleError(_0x1a9675,null));};exports[_0x0ab4('0x4b')]=function(_0x48efa4,_0x53d66f){return db[_0x0ab4('0x2e')][_0x0ab4('0x4b')]()[_0x0ab4('0x28')](respondWithResult(_0x53d66f,null))['catch'](handleError(_0x53d66f,null));};exports[_0x0ab4('0x4c')]=function(_0xb3bd1e,_0xeddaa1){var _0xaed2d;return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0x1eea3b){return db['VoicePrefix'][_0x0ab4('0x4c')](_0xb3bd1e['body'],{'transaction':_0x1eea3b})[_0x0ab4('0x28')](function(_0x55c073){_0xaed2d=_0x55c073[_0x0ab4('0x4f')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0xaed2d[_0x0ab4('0x50')]},'raw':!![]})[_0x0ab4('0x28')](function(_0x433346){return createVoicePrefixExtensions(_0xaed2d,_0x433346,_0x1eea3b);});});})[_0x0ab4('0x28')](function(){var _0x4e2db5=_0xb3bd1e[_0x0ab4('0x51')][_0x0ab4('0x4f')]({'plain':!![]});if(!_0x4e2db5)throw new Error(_0x0ab4('0x52'));if(_0x4e2db5[_0x0ab4('0x53')]===_0x0ab4('0x51')){var _0x2354fa=_0xaed2d;return db[_0x0ab4('0x54')][_0x0ab4('0x4a')]({'where':{'name':_0x0ab4('0x55'),'userProfileId':_0x4e2db5[_0x0ab4('0x56')]},'raw':!![]})[_0x0ab4('0x28')](function(_0x355ba8){if(_0x355ba8&&_0x355ba8[_0x0ab4('0x57')]===0x0){return db[_0x0ab4('0x2a')][_0x0ab4('0x4c')]({'name':_0x2354fa[_0x0ab4('0x2d')],'resourceId':_0x2354fa['id'],'type':_0x355ba8[_0x0ab4('0x2d')],'sectionId':_0x355ba8['id']},{})[_0x0ab4('0x28')](function(){return _0xaed2d;});}else{return _0xaed2d;}})[_0x0ab4('0x47')](function(_0x59705f){logger[_0x0ab4('0x2b')](_0x0ab4('0x58'),_0x59705f);throw _0x59705f;});}return _0xaed2d;})[_0x0ab4('0x28')](respondWithResult(_0xeddaa1,null))[_0x0ab4('0x47')](handleError(_0xeddaa1,null));};function Extension(_0x32e38c,_0x3bcb90,_0x387619,_0x251e4d){this['context']=_0x0ab4('0x59');this[_0x0ab4('0x5a')]=_0x32e38c;this['app']=_0x387619;this['type']=_0x0ab4('0x5b');this[_0x0ab4('0x5c')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3bcb90;this[_0x0ab4('0x5d')]=_0x251e4d;}function createVoicePrefixExtensions(_0x5b4bbe,_0x597d26,_0x427b51){return new BPromise(function(_0x3cdedf,_0x12dccd){var _0x42cbcb=new Extension(formatPrefixName(_0x5b4bbe[_0x0ab4('0x5e')]),0x1,_0x0ab4('0x5f'),_0x0ab4('0x60'));_0x42cbcb['VoicePrefixId']=_0x5b4bbe['id'];return db[_0x0ab4('0x61')][_0x0ab4('0x4c')](_0x42cbcb,{'transaction':_0x427b51})[_0x0ab4('0x28')](function(_0x406df2){var _0x194733=_0x406df2[_0x0ab4('0x4f')]({'plain':!![]});var _0x4f1847=_[_0x0ab4('0x33')](addVoicePrefixExtensions(_0x5b4bbe,_0x597d26),function(_0x1b7925){_0x1b7925['VoiceExtensionId']=_0x194733['id'];_0x1b7925[_0x0ab4('0x62')]=_0x5b4bbe['id'];return _0x1b7925;});return db['VoiceExtension'][_0x0ab4('0x63')](_0x4f1847,{'transaction':_0x427b51})['then'](function(_0x268b23){if(!_0x268b23){return _0x12dccd(_0x0ab4('0x64'));}else{return _0x3cdedf(_0x268b23);}})[_0x0ab4('0x47')](function(_0x2e728f){return _0x12dccd(_0x2e728f);});});;});};function addVoicePrefixExtensions(_0x509611,_0x581547){var _0x10dd5b=[];var _0x4477ba=formatPrefixName(_0x509611['prefix']);_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x2,_0x0ab4('0x66'),_0x0ab4('0x67')+_0x509611['name']));if(_0x509611[_0x0ab4('0x68')]){_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x3,_0x0ab4('0x66'),_0x0ab4('0x69')+_0x509611[_0x0ab4('0x68')]));}else{_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x3,_0x0ab4('0x5f'),_0x0ab4('0x6a')));}_0x10dd5b['push'](new Extension(_0x4477ba,0x4,'goto',_0x581547[_0x0ab4('0x6b')]+','+_0x0ab4('0x6c')+(0x8+_0x509611[_0x0ab4('0x2d')][_0x0ab4('0x49')])+'}'+','+0x1));return _0x10dd5b;}function formatPrefixName(_0x58c611){var _0x417926='_';for(var _0x5256d4=0x0;_0x5256d4<_0x58c611[_0x0ab4('0x49')];_0x5256d4++){if(_0x58c611[_0x0ab4('0x6d')](_0x5256d4)=='-'){_0x417926+=_0x58c611[_0x0ab4('0x6d')](_0x5256d4);}else{_0x417926+='['+_0x58c611[_0x0ab4('0x6d')](_0x5256d4)+']';}}_0x417926+='.';return _0x417926;}exports[_0x0ab4('0x27')]=function(_0x41b65f,_0x46a008,_0xf42b98){var _0x29cf79=_0x41b65f['body'];_0x29cf79[_0x0ab4('0x5e')]='system-'+_0x29cf79[_0x0ab4('0x2d')]+'-';return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0x1481b2){return db[_0x0ab4('0x2e')][_0x0ab4('0x27')](_0x29cf79,{'where':{'id':_0x29cf79['id']},'transaction':_0x1481b2})[_0x0ab4('0x28')](function(){return db[_0x0ab4('0x61')][_0x0ab4('0x29')]({'where':{'VoicePrefixId':_0x29cf79['id']},'transaction':_0x1481b2})['then'](function(){return db[_0x0ab4('0x61')][_0x0ab4('0x4a')]({'where':{'id':_0x29cf79['VoiceExtensionId']},'raw':!![]})[_0x0ab4('0x28')](function(_0x2d4921){return createVoicePrefixExtensions(_0x29cf79,_0x2d4921,_0x1481b2);});});});})[_0x0ab4('0x28')](function(){return db['VoicePrefix'][_0x0ab4('0x6e')](_0x29cf79['id']);})[_0x0ab4('0x28')](respondWithResult(_0x46a008,null))[_0x0ab4('0x47')](handleError(_0x46a008,null));};exports[_0x0ab4('0x6f')]=function(_0x531a07,_0x5bf57e,_0x398b3e){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x531a07[_0x0ab4('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bf57e,null))[_0x0ab4('0x28')](function(_0xa0f095){if(_0xa0f095){return _0xa0f095[_0x0ab4('0x6f')](_0x531a07['body']['ids'],_[_0x0ab4('0x70')](_0x531a07[_0x0ab4('0x71')],[_0x0ab4('0x72'),'id'])||{})[_0x0ab4('0x73')](function(_0x46f69a){for(var _0x1c8965=0x0;_0x1c8965<_0x531a07[_0x0ab4('0x71')]['ids'][_0x0ab4('0x49')];_0x1c8965+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x531a07[_0x0ab4('0x71')]['ids'][_0x1c8965]),'VoicePrefixId':Number(_0x531a07[_0x0ab4('0x48')]['id'])});}return _0x46f69a;});}})[_0x0ab4('0x28')](respondWithResult(_0x5bf57e,null))[_0x0ab4('0x47')](handleError(_0x5bf57e,null));};exports[_0x0ab4('0x74')]=function(_0x1eec8e,_0x4bffd4,_0x586bd6){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x1eec8e['params']['id']}})['then'](handleEntityNotFound(_0x4bffd4,null))[_0x0ab4('0x28')](function(_0x3e3ded){if(_0x3e3ded){return _0x3e3ded['removeAgents'](_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')])[_0x0ab4('0x28')](function(){if(_['isArray'](_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')])){for(var _0x2033fc=0x0;_0x2033fc<_0x1eec8e[_0x0ab4('0x34')]['ids'][_0x0ab4('0x49')];_0x2033fc+=0x1){socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':Number(_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')][_0x2033fc]),'VoicePrefixId':Number(_0x1eec8e[_0x0ab4('0x48')]['id'])});}}else{socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':Number(_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')]),'VoicePrefixId':Number(_0x1eec8e['params']['id'])});}});}})[_0x0ab4('0x28')](respondWithStatusCode(_0x4bffd4,null))[_0x0ab4('0x47')](handleError(_0x4bffd4,null));};exports[_0x0ab4('0x77')]=function(_0x78c98e,_0xb803f2,_0x5adfaa){var _0x448fcb={};var _0x88676f={};var _0xd916e0;var _0x28a722;return db[_0x0ab4('0x2e')][_0x0ab4('0x78')]({'where':{'id':_0x78c98e[_0x0ab4('0x48')]['id']}})[_0x0ab4('0x28')](handleEntityNotFound(_0xb803f2,null))[_0x0ab4('0x28')](function(_0x23968d){if(_0x23968d){_0xd916e0=_0x23968d;_0x88676f[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x79')][_0x0ab4('0x2f')]);_0x88676f['query']=_[_0x0ab4('0x35')](_0x78c98e[_0x0ab4('0x34')]);_0x88676f[_0x0ab4('0x3f')]=_[_0x0ab4('0x36')](_0x88676f['model'],_0x88676f['query']);_0x448fcb[_0x0ab4('0x39')]=_[_0x0ab4('0x36')](_0x88676f['model'],qs[_0x0ab4('0x38')](_0x78c98e[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x448fcb[_0x0ab4('0x39')]=_0x448fcb[_0x0ab4('0x39')][_0x0ab4('0x49')]?_0x448fcb[_0x0ab4('0x39')]:_0x88676f['model'];_0x448fcb[_0x0ab4('0x3c')]=qs[_0x0ab4('0x3d')](_0x78c98e[_0x0ab4('0x34')][_0x0ab4('0x3d')]);_0x448fcb[_0x0ab4('0x3e')]=qs[_0x0ab4('0x3f')](_[_0x0ab4('0x40')](_0x78c98e[_0x0ab4('0x34')],_0x88676f[_0x0ab4('0x3f')]));if(_0x78c98e['query'][_0x0ab4('0x42')]){_0x448fcb['where']=_[_0x0ab4('0x41')](_0x448fcb[_0x0ab4('0x3e')],{'$or':_[_0x0ab4('0x33')](_0x448fcb[_0x0ab4('0x39')],function(_0x12ee59){var _0x76fa2={};_0x76fa2[_0x12ee59]={'$like':'%'+_0x78c98e['query']['filter']+'%'};return _0x76fa2;})});}_0x448fcb=_[_0x0ab4('0x41')]({},_0x448fcb,_0x78c98e[_0x0ab4('0x43')]);return _0xd916e0['getAgents'](_0x448fcb);}})['then'](function(_0x21f0a2){if(_0x21f0a2){_0x28a722=_0x21f0a2[_0x0ab4('0x49')];if(!_0x78c98e['query'][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x448fcb[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x78c98e['query'][_0x0ab4('0x1f')]);_0x448fcb['offset']=qs['offset'](_0x78c98e[_0x0ab4('0x34')]['offset']);}return _0xd916e0[_0x0ab4('0x77')](_0x448fcb);}})[_0x0ab4('0x28')](function(_0xb1cac2){if(_0xb1cac2){return _0xb1cac2?{'count':_0x28a722,'rows':_0xb1cac2}:null;}})['then'](respondWithResult(_0xb803f2,null))[_0x0ab4('0x47')](handleError(_0xb803f2,null));};exports[_0x0ab4('0x7a')]=function(_0x840fc2,_0x2282d7,_0x2bf00c){var _0x37a592={};var _0x171969={};var _0x51f02a;var _0x2a25d5;return db['VoicePrefix'][_0x0ab4('0x78')]({'where':{'id':_0x840fc2['params']['id']}})['then'](handleEntityNotFound(_0x2282d7,null))[_0x0ab4('0x28')](function(_0x7ae8b2){if(_0x7ae8b2){_0x51f02a=_0x7ae8b2;_0x171969[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x7b')]['rawAttributes']);_0x171969['query']=_[_0x0ab4('0x35')](_0x840fc2[_0x0ab4('0x34')]);_0x171969['filters']=_[_0x0ab4('0x36')](_0x171969['model'],_0x171969[_0x0ab4('0x34')]);_0x37a592[_0x0ab4('0x39')]=_['intersection'](_0x171969[_0x0ab4('0x37')],qs[_0x0ab4('0x38')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x37a592['attributes']=_0x37a592['attributes'][_0x0ab4('0x49')]?_0x37a592[_0x0ab4('0x39')]:_0x171969[_0x0ab4('0x37')];_0x37a592['order']=qs[_0x0ab4('0x3d')](_0x840fc2['query'][_0x0ab4('0x3d')]);_0x37a592[_0x0ab4('0x3e')]=qs['filters'](_['pick'](_0x840fc2['query'],_0x171969[_0x0ab4('0x3f')]));if(_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x42')]){_0x37a592[_0x0ab4('0x3e')]=_[_0x0ab4('0x41')](_0x37a592['where'],{'$or':_[_0x0ab4('0x33')](_0x37a592[_0x0ab4('0x39')],function(_0x5e43fe){var _0xde4e2c={};_0xde4e2c[_0x5e43fe]={'$like':'%'+_0x840fc2[_0x0ab4('0x34')]['filter']+'%'};return _0xde4e2c;})});}_0x37a592=_[_0x0ab4('0x41')]({},_0x37a592,_0x840fc2[_0x0ab4('0x43')]);return _0x51f02a['getTeams'](_0x37a592);}})[_0x0ab4('0x28')](function(_0x213828){if(_0x213828){_0x2a25d5=_0x213828[_0x0ab4('0x49')];if(!_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x37a592[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x1f')]);_0x37a592['offset']=qs[_0x0ab4('0x1e')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x1e')]);}return _0x51f02a[_0x0ab4('0x7a')](_0x37a592);}})[_0x0ab4('0x28')](function(_0x4a9e47){if(_0x4a9e47){return _0x4a9e47?{'count':_0x2a25d5,'rows':_0x4a9e47}:null;}})['then'](respondWithResult(_0x2282d7,null))[_0x0ab4('0x47')](handleError(_0x2282d7,null));};exports['addTeams']=function(_0x15e2f6,_0x3da0c1,_0x415e42){var _0x1effa7=_0x15e2f6['body'][_0x0ab4('0x72')];var _0x33c31a;return db[_0x0ab4('0x7b')][_0x0ab4('0x7c')]({'where':{'id':_0x1effa7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ab4('0x7d'),'attributes':['id',_0x0ab4('0x2d'),_0x0ab4('0x7e'),_0x0ab4('0x7f'),'interface'],'raw':!![]}]})['then'](function(_0x2c6284){if(_0x2c6284){_0x33c31a=_0x2c6284;var _0x272680=_[_0x0ab4('0x80')](_0x2c6284,function(_0x4e064a){var _0x29f715=_0x4e064a['get']({'plain':!![]});return _0x29f715[_0x0ab4('0x7d')];});return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x15e2f6['params']['id']}})['then'](function(_0x1d9644){return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0xa094f5){return _0x1d9644['addTeams'](_0x1effa7,{'transaction':_0xa094f5})[_0x0ab4('0x28')](function(){return BPromise[_0x0ab4('0x81')](_0x33c31a,function(_0x45d3fa){return db[_0x0ab4('0x82')][_0x0ab4('0x83')]({'TeamId':_0x45d3fa['id'],'VoicePrefixId':_0x15e2f6[_0x0ab4('0x48')]['id']},{'transaction':_0xa094f5});});})[_0x0ab4('0x28')](function(){return BPromise[_0x0ab4('0x81')](_0x272680,function(_0x1d74f9){return db[_0x0ab4('0x84')][_0x0ab4('0x85')]({'where':{'UserId':_0x1d74f9['id'],'VoicePrefixId':_0x15e2f6[_0x0ab4('0x48')]['id']},'transaction':_0xa094f5});});})[_0x0ab4('0x28')](function(){_0x272680['forEach'](function(_0x3984a2){socket[_0x0ab4('0x75')](_0x0ab4('0x86'),{'UserId':_0x3984a2['id'],'VoicePrefixId':_0x1d9644['id']});});});});});}})[_0x0ab4('0x28')](respondWithStatusCode(_0x3da0c1,null))[_0x0ab4('0x47')](handleError(_0x3da0c1,null));};exports[_0x0ab4('0x87')]=function(_0x2ad3a9,_0x29f866,_0x182dfa){return db[_0x0ab4('0x7b')][_0x0ab4('0x7c')]({'where':{'id':_0x2ad3a9['query'][_0x0ab4('0x72')]},'attributes':['id'],'include':[{'model':db[_0x0ab4('0x79')],'as':_0x0ab4('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x0ab4('0x28')](handleEntityNotFound(_0x29f866,null))[_0x0ab4('0x28')](function(_0x50b719){var _0x2fbbec=_['map'](_0x50b719,'id');var _0x4379f1=[];var _0x175a2a=[];var _0x332b1c=squel[_0x0ab4('0x88')]();_0x332b1c[_0x0ab4('0x89')]('tq.TeamId')[_0x0ab4('0x8a')](_0x0ab4('0x8b'),'tq')[_0x0ab4('0x8c')](_0x0ab4('0x8d'),'ut',_0x0ab4('0x8e'))['where'](_0x0ab4('0x8f'),_0x2ad3a9[_0x0ab4('0x48')]['id']);for(var _0x3acf39=0x0;_0x3acf39<_0x50b719[_0x0ab4('0x49')];_0x3acf39+=0x1){let _0x28bc17=_0x50b719[_0x3acf39];for(var _0x927d5=0x0;_0x927d5<_0x28bc17[_0x0ab4('0x7d')][_0x0ab4('0x49')];_0x927d5+=0x1){let _0x43fde8=_0x28bc17[_0x0ab4('0x7d')][_0x927d5];var _0x3791e6=_0x332b1c[_0x0ab4('0x90')]();_0x3791e6[_0x0ab4('0x3e')](_0x0ab4('0x91'),_0x43fde8['id']);_0x175a2a['push'](db['sequelize']['query'](_0x3791e6['toString'](),{'type':db[_0x0ab4('0x4d')][_0x0ab4('0x92')]['SELECT']})[_0x0ab4('0x28')](function(_0x19e3f9){if(_0x19e3f9['length']===0x1){return _0x43fde8['id'];}else{var _0x58e215=_[_0x0ab4('0x93')](_['map'](_0x19e3f9,_0x0ab4('0x94')),function(_0x22fb42){return _['includes'](_0x2fbbec,_0x22fb42);});if(_0x58e215){return _0x43fde8['id'];}}}));}}return BPromise[_0x0ab4('0x95')](_0x175a2a)[_0x0ab4('0x28')](function(_0x17fed9){_0x4379f1=_(_0x4379f1)[_0x0ab4('0x96')](_0x17fed9)[_0x0ab4('0x97')]()[_0x0ab4('0x98')]();return db['VoicePrefix'][_0x0ab4('0x4a')]({'where':{'id':_0x2ad3a9[_0x0ab4('0x48')]['id']}})[_0x0ab4('0x28')](function(_0x4148dd){return db[_0x0ab4('0x4d')]['transaction'](function(_0x1a8f36){return _0x4148dd[_0x0ab4('0x87')](_0x2ad3a9['query'][_0x0ab4('0x72')],{'transaction':_0x1a8f36})[_0x0ab4('0x28')](function(){if(!_[_0x0ab4('0x99')](_0x4379f1)){return _0x4148dd[_0x0ab4('0x74')](_0x4379f1,{'transaction':_0x1a8f36});}})[_0x0ab4('0x28')](function(){_0x4379f1[_0x0ab4('0x9a')](function(_0x4bc8ff){socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':_0x4bc8ff,'VoicePrefixId':_0x4148dd['id']});});});});});});})[_0x0ab4('0x28')](respondWithStatusCode(_0x29f866,null))[_0x0ab4('0x47')](handleError(_0x29f866,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 73d345a..eb48d21 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 _0x2db4=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','VoicePrefix','setMaxListeners','save'];(function(_0x50a19b,_0x80c4d0){var _0x19b42d=function(_0x15a23f){while(--_0x15a23f){_0x50a19b['push'](_0x50a19b['shift']());}};_0x19b42d(++_0x80c4d0);}(_0x2db4,0x188));var _0x42db=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2db4[_0xb0f7c3];return _0x28ea68;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x42db('0x0'))['db'][_0x42db('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x42db('0x2')](0x0);var events={'afterCreate':_0x42db('0x3'),'afterUpdate':_0x42db('0x4'),'afterDestroy':_0x42db('0x5')};function emitEvent(_0x32f456){return function(_0x3bd5d7,_0x205d3e,_0x1ba4ab){VoicePrefixEvents[_0x42db('0x6')](_0x32f456+':'+_0x3bd5d7['id'],_0x3bd5d7);VoicePrefixEvents[_0x42db('0x6')](_0x32f456,_0x3bd5d7);_0x1ba4ab(null);};}for(var e in events){if(events[_0x42db('0x7')](e)){var event=events[e];VoicePrefix[_0x42db('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x4ef4=['emit','exports','events','VoicePrefix','setMaxListeners','update'];(function(_0x4c978c,_0xbd7d69){var _0x48db9c=function(_0x4127c8){while(--_0x4127c8){_0x4c978c['push'](_0x4c978c['shift']());}};_0x48db9c(++_0xbd7d69);}(_0x4ef4,0x164));var _0x44ef=function(_0x3eb4bb,_0x3729af){_0x3eb4bb=_0x3eb4bb-0x0;var _0xae45d2=_0x4ef4[_0x3eb4bb];return _0xae45d2;};'use strict';var EventEmitter=require(_0x44ef('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x44ef('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x44ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x44ef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4d731f){return function(_0xa6cb3f,_0x4182ef,_0x5f3817){VoicePrefixEvents[_0x44ef('0x4')](_0x4d731f+':'+_0xa6cb3f['id'],_0xa6cb3f);VoicePrefixEvents['emit'](_0x4d731f,_0xa6cb3f);_0x5f3817(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x44ef('0x5')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 746ea25..79f0d32 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 _0x2566=['rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2566,0x93));var _0x6256=function(_0x414b65,_0x586acf){_0x414b65=_0x414b65-0x0;var _0x1405b8=_0x2566[_0x414b65];return _0x1405b8;};'use strict';var _=require(_0x6256('0x0'));var util=require(_0x6256('0x1'));var logger=require(_0x6256('0x2'))(_0x6256('0x3'));var moment=require(_0x6256('0x4'));var BPromise=require(_0x6256('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6256('0x6'));var rimraf=require(_0x6256('0x7'));var config=require(_0x6256('0x8'));var attributes=require(_0x6256('0x9'));module[_0x6256('0xa')]=function(_0x1bd58c,_0x43dbaa){return _0x1bd58c[_0x6256('0xb')](_0x6256('0xc'),attributes,{'tableName':_0x6256('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8a7=['rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa8a7,0x89));var _0x7a8a=function(_0x33638a,_0x4a7fdc){_0x33638a=_0x33638a-0x0;var _0x43758b=_0xa8a7[_0x33638a];return _0x43758b;};'use strict';var _=require(_0x7a8a('0x0'));var util=require(_0x7a8a('0x1'));var logger=require(_0x7a8a('0x2'))(_0x7a8a('0x3'));var moment=require(_0x7a8a('0x4'));var BPromise=require('bluebird');var rp=require(_0x7a8a('0x5'));var fs=require('fs');var path=require(_0x7a8a('0x6'));var rimraf=require(_0x7a8a('0x7'));var config=require('../../config/environment');var attributes=require(_0x7a8a('0x8'));module[_0x7a8a('0x9')]=function(_0x324f14,_0x161c48){return _0x324f14[_0x7a8a('0xa')](_0x7a8a('0xb'),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 0754e81..7a00b9f 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 _0xc9c3=['socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost'];(function(_0x542a0f,_0x1afd79){var _0x43f8fd=function(_0x169311){while(--_0x169311){_0x542a0f['push'](_0x542a0f['shift']());}};_0x43f8fd(++_0x1afd79);}(_0xc9c3,0x96));var _0x3c9c=function(_0x12f11e,_0x22c82f){_0x12f11e=_0x12f11e-0x0;var _0x4dc7e7=_0xc9c3[_0x12f11e];return _0x4dc7e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c9c('0x0'));var BPromise=require('bluebird');var rs=require(_0x3c9c('0x1'));var fs=require('fs');var Redis=require(_0x3c9c('0x2'));var db=require(_0x3c9c('0x3'))['db'];var utils=require(_0x3c9c('0x4'));var logger=require(_0x3c9c('0x5'))(_0x3c9c('0x6'));var config=require(_0x3c9c('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x3c9c('0x8')]=_[_0x3c9c('0x9')](config[_0x3c9c('0x8')],{'host':_0x3c9c('0xa'),'port':0x18eb});var socket=require(_0x3c9c('0xb'))(new Redis(config[_0x3c9c('0x8')]));require(_0x3c9c('0xc'))[_0x3c9c('0xd')](socket);function respondWithRpcPromise(_0x2be851,_0x28a59f,_0x50bdd1){return new BPromise(function(_0x20ed5c,_0xc45f8b){return client['request'](_0x2be851,_0x50bdd1)[_0x3c9c('0xe')](function(_0x4c6969){logger[_0x3c9c('0xf')](_0x3c9c('0x10'),_0x28a59f,_0x3c9c('0x11'));logger[_0x3c9c('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x28a59f,'request\x20sent',JSON['stringify'](_0x4c6969));if(_0x4c6969[_0x3c9c('0x13')]){if(_0x4c6969['error']['code']===0x1f4){logger['error'](_0x3c9c('0x10'),_0x28a59f,_0x4c6969['error'][_0x3c9c('0x14')]);return _0xc45f8b(_0x4c6969[_0x3c9c('0x13')][_0x3c9c('0x14')]);}logger[_0x3c9c('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x28a59f,_0x4c6969[_0x3c9c('0x13')]['message']);return _0x20ed5c(_0x4c6969['error']['message']);}else{logger[_0x3c9c('0xf')](_0x3c9c('0x10'),_0x28a59f,_0x3c9c('0x11'));_0x20ed5c(_0x4c6969[_0x3c9c('0x15')][_0x3c9c('0x14')]);}})[_0x3c9c('0x16')](function(_0x319f19){logger['error'](_0x3c9c('0x10'),_0x28a59f,_0x319f19);_0xc45f8b(_0x319f19);});});} \ No newline at end of file +var _0x341c=['defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x2429c2,_0x605d54){var _0x38beca=function(_0xa62d29){while(--_0xa62d29){_0x2429c2['push'](_0x2429c2['shift']());}};_0x38beca(++_0x605d54);}(_0x341c,0xcc));var _0xc341=function(_0x31ba1a,_0x4e88ce){_0x31ba1a=_0x31ba1a-0x0;var _0xf8402b=_0x341c[_0x31ba1a];return _0xf8402b;};'use strict';var _=require(_0xc341('0x0'));var util=require('util');var moment=require(_0xc341('0x1'));var BPromise=require('bluebird');var rs=require(_0xc341('0x2'));var fs=require('fs');var Redis=require(_0xc341('0x3'));var db=require(_0xc341('0x4'))['db'];var utils=require(_0xc341('0x5'));var logger=require(_0xc341('0x6'))(_0xc341('0x7'));var config=require(_0xc341('0x8'));var jayson=require(_0xc341('0x9'));var client=jayson['client'][_0xc341('0xa')]({'port':0x232a});config[_0xc341('0xb')]=_[_0xc341('0xc')](config[_0xc341('0xb')],{'host':_0xc341('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc341('0xb')]));require(_0xc341('0xe'))[_0xc341('0xf')](socket);function respondWithRpcPromise(_0x8d2f4c,_0x3d5d26,_0x10a48d){return new BPromise(function(_0x4c5087,_0x2d08da){return client[_0xc341('0x10')](_0x8d2f4c,_0x10a48d)[_0xc341('0x11')](function(_0xa0ae63){logger[_0xc341('0x12')](_0xc341('0x13'),_0x3d5d26,'request\x20sent');logger['debug'](_0xc341('0x14'),_0x3d5d26,_0xc341('0x15'),JSON[_0xc341('0x16')](_0xa0ae63));if(_0xa0ae63[_0xc341('0x17')]){if(_0xa0ae63[_0xc341('0x17')]['code']===0x1f4){logger[_0xc341('0x17')](_0xc341('0x13'),_0x3d5d26,_0xa0ae63[_0xc341('0x17')][_0xc341('0x18')]);return _0x2d08da(_0xa0ae63[_0xc341('0x17')][_0xc341('0x18')]);}logger[_0xc341('0x17')](_0xc341('0x13'),_0x3d5d26,_0xa0ae63[_0xc341('0x17')][_0xc341('0x18')]);return _0x4c5087(_0xa0ae63[_0xc341('0x17')]['message']);}else{logger['info'](_0xc341('0x13'),_0x3d5d26,_0xc341('0x15'));_0x4c5087(_0xa0ae63[_0xc341('0x19')][_0xc341('0x18')]);}})[_0xc341('0x1a')](function(_0x3555c1){logger[_0xc341('0x17')](_0xc341('0x13'),_0x3d5d26,_0x3555c1);_0x2d08da(_0x3555c1);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f92288a..5e49086 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 _0xf9bc=['save','remove','update','emit','removeListener','length','voicePrefix:'];(function(_0x255b99,_0x5e569c){var _0x1c49fd=function(_0x20470a){while(--_0x20470a){_0x255b99['push'](_0x255b99['shift']());}};_0x1c49fd(++_0x5e569c);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x4fa632,_0x1d3e5a){_0x4fa632=_0x4fa632-0x0;var _0x56f4c1=_0xf9bc[_0x4fa632];return _0x56f4c1;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xcf9b('0x0'),_0xcf9b('0x1'),_0xcf9b('0x2')];function createListener(_0x19ad1b,_0x2c385a){return function(_0x2dd51e){_0x2c385a[_0xcf9b('0x3')](_0x19ad1b,_0x2dd51e);};}function removeListener(_0x373f46,_0x6d522){return function(){VoicePrefixEvents[_0xcf9b('0x4')](_0x373f46,_0x6d522);};}exports['register']=function(_0x48a202){for(var _0x3595ac=0x0,_0x2ba407=events[_0xcf9b('0x5')];_0x3595ac<_0x2ba407;_0x3595ac++){var _0x2493f0=events[_0x3595ac];var _0x1ec363=createListener(_0xcf9b('0x6')+_0x2493f0,_0x48a202);VoicePrefixEvents['on'](_0x2493f0,_0x1ec363);}}; \ No newline at end of file +var _0x8482=['update','emit','removeListener','length','voicePrefix:','save','remove'];(function(_0x20e3f4,_0x3ec8ca){var _0x57f724=function(_0x3b16dd){while(--_0x3b16dd){_0x20e3f4['push'](_0x20e3f4['shift']());}};_0x57f724(++_0x3ec8ca);}(_0x8482,0x14e));var _0x2848=function(_0x2efcda,_0x256b83){_0x2efcda=_0x2efcda-0x0;var _0x2b8196=_0x8482[_0x2efcda];return _0x2b8196;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x2848('0x0'),_0x2848('0x1'),_0x2848('0x2')];function createListener(_0xecfb19,_0x3ac5ad){return function(_0x212891){_0x3ac5ad[_0x2848('0x3')](_0xecfb19,_0x212891);};}function removeListener(_0x4309c1,_0x467ee5){return function(){VoicePrefixEvents[_0x2848('0x4')](_0x4309c1,_0x467ee5);};}exports['register']=function(_0x1eb602){for(var _0x44e406=0x0,_0x503238=events[_0x2848('0x5')];_0x44e406<_0x503238;_0x44e406++){var _0x48c0f3=events[_0x44e406];var _0x53c865=createListener(_0x2848('0x6')+_0x48c0f3,_0x1eb602);VoicePrefixEvents['on'](_0x48c0f3,_0x53c865);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index dbf08ca..98e1e63 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(_0x3697c3,_0x1054f5){var _0x343cd1=function(_0x1b1797){while(--_0x1b1797){_0x3697c3['push'](_0x3697c3['shift']());}};_0x343cd1(++_0x1054f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 _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(_0x82ee38,_0x493cdc){var _0x2f483f=function(_0x585568){while(--_0x585568){_0x82ee38['push'](_0x82ee38['shift']());}};_0x2f483f(++_0x493cdc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index ee7814d..644d9a8 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 _0x51ff=['yes','all','periodic_announce','join','joinempty','leavewhenempty','split','BOOLEAN','acw','wrapuptime','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','ENUM','outbound','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','inbound','booked','roundrobin','progressive','power','INTEGER'];(function(_0xed5729,_0x4979b1){var _0x4607e4=function(_0x2d77e2){while(--_0x2d77e2){_0xed5729['push'](_0xed5729['shift']());}};_0x4607e4(++_0x4979b1);}(_0x51ff,0x127));var _0xf51f=function(_0x9f05d9,_0x2ff1ca){_0x9f05d9=_0x9f05d9-0x0;var _0x5028a1=_0x51ff[_0x9f05d9];return _0x5028a1;};'use strict';var Sequelize=require(_0xf51f('0x0'));module[_0xf51f('0x1')]={'name':{'type':Sequelize[_0xf51f('0x2')],'allowNull':![],'unique':_0xf51f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf51f('0x4')]('inbound',_0xf51f('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xf51f('0x4')]('rr','ringall',_0xf51f('0x6'),_0xf51f('0x7'),_0xf51f('0x8'),_0xf51f('0x9'),_0xf51f('0xa'),_0xf51f('0xb'),_0xf51f('0xc')),'allowNull':![],'defaultValue':_0xf51f('0xd'),'set':function(_0x34acda){this[_0xf51f('0xe')](_0xf51f('0xf'),_0x34acda?_0x34acda:_0xf51f('0x9'));},'get':function(){var _0x2b344f=this[_0xf51f('0x10')](_0xf51f('0x11'));var _0x3e2df6=this[_0xf51f('0x10')](_0xf51f('0x12'));var _0x3276d0=this[_0xf51f('0x10')]('strategy');if(_0x2b344f===_0xf51f('0x13')){return _0x3276d0;}if(_0x3e2df6===_0xf51f('0x14')&&_0x3276d0==='rrmemory'||_0x3e2df6===_0xf51f('0x14')&&_0x3276d0===_0xf51f('0x15')){return _0x3276d0;}if(_0x3e2df6===_0xf51f('0x16')||_0x3e2df6==='predictive'||_0x3e2df6===_0xf51f('0x17')){return _0x3276d0;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf51f('0x18')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf51f('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xf51f('0x2')]},'weight':{'type':Sequelize[_0xf51f('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x19'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x19'),'no',_0xf51f('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xf51f('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf51f('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf51f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf51f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xf51f('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf51f('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf51f('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xf51f('0x19'),'no'),'defaultValue':_0xf51f('0x19')},'announce_holdtime':{'type':Sequelize[_0xf51f('0x4')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xf51f('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0xf51f('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf51f('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf51f('0x2')]},'queue_youarenext':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xf51f('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xf51f('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2b261a){this[_0xf51f('0xe')](_0xf51f('0x1b'),_0x2b261a?_0x2b261a[_0xf51f('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0xf51f('0x1b'))?this[_0xf51f('0x10')](_0xf51f('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':_0xf51f('0x19'),'set':function(_0x5c0b0f){this[_0xf51f('0xe')](_0xf51f('0x1d'),_0x5c0b0f?_0x5c0b0f[_0xf51f('0x1c')](','):undefined);},'get':function(){return this[_0xf51f('0x10')](_0xf51f('0x1d'))?this['getDataValue']('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':'no','set':function(_0x1fde1b){this[_0xf51f('0xe')](_0xf51f('0x1e'),_0x1fde1b?_0x1fde1b[_0xf51f('0x1c')](','):undefined);},'get':function(){return this[_0xf51f('0x10')](_0xf51f('0x1e'))?this['getDataValue'](_0xf51f('0x1e'))[_0xf51f('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xf51f('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf51f('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xf51f('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf51f('0x2')]},'description':{'type':Sequelize[_0xf51f('0x2')]},'acw':{'type':Sequelize[_0xf51f('0x20')],'defaultValue':0x0,'set':function(_0x5d008c){this[_0xf51f('0xe')](_0xf51f('0x21'),_0x5d008c);if(_0x5d008c){if(this['getDataValue'](_0xf51f('0x22'))<0x2){this[_0xf51f('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x23'),'progressive',_0xf51f('0x17'),_0xf51f('0x24'),'booked'),'defaultValue':_0xf51f('0x16'),'comment':_0xf51f('0x25')},'dialLimitChannel':{'type':Sequelize[_0xf51f('0x18')](0x4)[_0xf51f('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf51f('0x27')},'dialLimitQueue':{'type':Sequelize[_0xf51f('0x18')](0x4)[_0xf51f('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf51f('0x28')},'dialPowerLevel':{'type':Sequelize[_0xf51f('0x29')](0x2)[_0xf51f('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xf51f('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x2b'),'dropRate'),'defaultValue':_0xf51f('0x2c'),'comment':_0xf51f('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xf51f('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf51f('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf51f('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf51f('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xf51f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf51f('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xf51f('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xf51f('0x18')](0x3)[_0xf51f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xf51f('0x2')],'comment':_0xf51f('0x31')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf51f('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf51f('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0xf51f('0x18')](0x3)[_0xf51f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf51f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf51f('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf51f('0x18')](0x3)[_0xf51f('0x26')],'defaultValue':0x3,'comment':_0xf51f('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf51f('0x18')](0x5)[_0xf51f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf51f('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf51f('0x18')](0x3)[_0xf51f('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf51f('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x37'),_0xf51f('0x38'),_0xf51f('0x39')),'defaultValue':_0xf51f('0x37')},'dialAMDActive':{'type':Sequelize[_0xf51f('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf51f('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf51f('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xf51f('0x18')](0x9)[_0xf51f('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf51f('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf51f('0x18')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf51f('0x18')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf51f('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xf51f('0x18')](0x9)[_0xf51f('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf51f('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf51f('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf51f('0x18')](0x9)[_0xf51f('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf51f('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf51f('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf51f('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xf51f('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xf51f('0x40')},'dialRecallInQueue':{'type':Sequelize[_0xf51f('0x20')],'defaultValue':0x0,'comment':_0xf51f('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf51f('0x4')](_0xf51f('0x42'),'ASC'),'defaultValue':_0xf51f('0x42')},'dialQueueProject2':{'type':Sequelize[_0xf51f('0x2')],'comment':_0xf51f('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf51f('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf51f('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf51f('0x18')](0x3)[_0xf51f('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf51f('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xf51f('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf51f('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf51f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf51f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf51f('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0xf51f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf51f('0x46')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf51f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf51f('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf51f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf51f('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf51f('0x18')](0x5)[_0xf51f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf51f('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0xf51f('0x18')](0x3)[_0xf51f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf51f('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf51f('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf51f('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf51f('0x18')](0x3)[_0xf51f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf51f('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf51f('0x18')](0x5)[_0xf51f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf51f('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf51f('0x18')],'allowNull':!![],'comment':_0xf51f('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0xf51f('0x20')],'defaultValue':![],'comment':_0xf51f('0x4f'),'set':function(_0x3b37b5){if(!_0x3b37b5)this[_0xf51f('0xe')]('mandatoryDispositionPauseId',null);this[_0xf51f('0xe')]('mandatoryDisposition',_0x3b37b5);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xf51f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xf51f('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xf51f('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xf51f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xf51f('0x20')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c77=['always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','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\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','name','ENUM','outbound','inbound','STRING','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','split','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','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','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*'];(function(_0x22a4ac,_0x1e67b){var _0x39c154=function(_0x2fbfff){while(--_0x2fbfff){_0x22a4ac['push'](_0x22a4ac['shift']());}};_0x39c154(++_0x1e67b);}(_0x6c77,0x1aa));var _0x76c7=function(_0x4bf83e,_0x429223){_0x4bf83e=_0x4bf83e-0x0;var _0x5647c9=_0x6c77[_0x4bf83e];return _0x5647c9;};'use strict';var Sequelize=require('sequelize');module[_0x76c7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x76c7('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x76c7('0x2')]('inbound',_0x76c7('0x3')),'allowNull':![],'defaultValue':_0x76c7('0x4')},'musiconhold':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':_0x76c7('0x6')},'announce':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x76c7('0x2')]('rr',_0x76c7('0x7'),'leastrecent',_0x76c7('0x8'),_0x76c7('0x9'),_0x76c7('0xa'),_0x76c7('0xb'),_0x76c7('0xc'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x57b5ae){this['setDataValue'](_0x76c7('0xd'),_0x57b5ae?_0x57b5ae:_0x76c7('0xa'));},'get':function(){var _0x447a40=this[_0x76c7('0xe')](_0x76c7('0xf'));var _0x5a5e12=this[_0x76c7('0xe')](_0x76c7('0x10'));var _0x5baebd=this['getDataValue'](_0x76c7('0xd'));if(_0x447a40==='inbound'){return _0x5baebd;}if(_0x5a5e12===_0x76c7('0x11')&&_0x5baebd==='rrmemory'||_0x5a5e12===_0x76c7('0x11')&&_0x5baebd===_0x76c7('0x12')){return _0x5baebd;}if(_0x5a5e12===_0x76c7('0x13')||_0x5a5e12===_0x76c7('0x14')||_0x5a5e12===_0x76c7('0x15')){return _0x5baebd;}return null;}},'servicelevel':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x76c7('0x16')](0xb)},'timeout':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x76c7('0x5')]},'weight':{'type':Sequelize[_0x76c7('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x76c7('0x17')},'autopause':{'type':Sequelize[_0x76c7('0x2')]('yes','no',_0x76c7('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x76c7('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x76c7('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x76c7('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x76c7('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x76c7('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x17'),'no'),'defaultValue':_0x76c7('0x17')},'announce_holdtime':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x17'),'no',_0x76c7('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x76c7('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x76c7('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x76c7('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x76c7('0x5')]},'queue_youarenext':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x76c7('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x76c7('0x5')]},'queue_quantity1':{'type':Sequelize[_0x76c7('0x5')]},'queue_quantity2':{'type':Sequelize[_0x76c7('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x76c7('0x5')]},'queue_less_than':{'type':Sequelize[_0x76c7('0x5')]},'periodic_announce':{'type':Sequelize[_0x76c7('0x1a')],'set':function(_0x509f0e){this[_0x76c7('0x1b')]('periodic_announce',_0x509f0e?_0x509f0e['join'](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x76c7('0xe')](_0x76c7('0x1c'))[_0x76c7('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':'yes','set':function(_0x591a94){this[_0x76c7('0x1b')]('joinempty',_0x591a94?_0x591a94[_0x76c7('0x1e')](','):undefined);},'get':function(){return this['getDataValue'](_0x76c7('0x1f'))?this[_0x76c7('0xe')]('joinempty')[_0x76c7('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x21e520){this[_0x76c7('0x1b')](_0x76c7('0x20'),_0x21e520?_0x21e520['join'](','):undefined);},'get':function(){return this[_0x76c7('0xe')](_0x76c7('0x20'))?this[_0x76c7('0xe')]('leavewhenempty')[_0x76c7('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x76c7('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x76c7('0x5')]},'description':{'type':Sequelize[_0x76c7('0x5')]},'acw':{'type':Sequelize[_0x76c7('0x21')],'defaultValue':0x0,'set':function(_0x2f7917){this['setDataValue'](_0x76c7('0x22'),_0x2f7917);if(_0x2f7917){if(this[_0x76c7('0xe')](_0x76c7('0x23'))<0x2){this[_0x76c7('0x1b')](_0x76c7('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x76c7('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x76c7('0x21')],'defaultValue':0x0,'comment':_0x76c7('0x24')},'dialMethod':{'type':Sequelize['ENUM'](_0x76c7('0x25'),'progressive',_0x76c7('0x15'),'predictive','booked'),'defaultValue':'progressive','comment':_0x76c7('0x26')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x76c7('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x76c7('0x28')},'dialLimitQueue':{'type':Sequelize[_0x76c7('0x16')](0x4)[_0x76c7('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x76c7('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x2a'),_0x76c7('0x2b')),'defaultValue':_0x76c7('0x2b'),'comment':_0x76c7('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x76c7('0x29')](0x2)[_0x76c7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x76c7('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x76c7('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x76c7('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x76c7('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x76c7('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x76c7('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x76c7('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x76c7('0x16')](0x3)[_0x76c7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x76c7('0x5')],'comment':_0x76c7('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x76c7('0x16')](0x3)[_0x76c7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x76c7('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x76c7('0x16')](0x5)[_0x76c7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x76c7('0x16')](0x3)[_0x76c7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x76c7('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x76c7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x76c7('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x76c7('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x76c7('0x16')](0x5)[_0x76c7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x76c7('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x76c7('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':_0x76c7('0x35')},'dialPrefix':{'type':Sequelize[_0x76c7('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x36'),_0x76c7('0x37'),_0x76c7('0x38')),'defaultValue':_0x76c7('0x36')},'dialAMDActive':{'type':Sequelize[_0x76c7('0x21')],'defaultValue':0x0,'comment':_0x76c7('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x76c7('0x16')](0x9)[_0x76c7('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x76c7('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x76c7('0x16')](0x9)[_0x76c7('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x76c7('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x76c7('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x76c7('0x16')](0x9)[_0x76c7('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x76c7('0x16')](0x9)[_0x76c7('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x76c7('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x76c7('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x76c7('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x76c7('0x16')](0x9)[_0x76c7('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x76c7('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x76c7('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x76c7('0x16')](0x9)[_0x76c7('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x76c7('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x76c7('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x76c7('0x40')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x76c7('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x76c7('0x2')](_0x76c7('0x42'),_0x76c7('0x43')),'defaultValue':_0x76c7('0x42')},'dialQueueProject2':{'type':Sequelize[_0x76c7('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x76c7('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x76c7('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x76c7('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x76c7('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x76c7('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x76c7('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x76c7('0x45')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x76c7('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x76c7('0x16')](0x5)[_0x76c7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x76c7('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x76c7('0x16')](0x3)[_0x76c7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x76c7('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x76c7('0x16')](0x5)[_0x76c7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x76c7('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x76c7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x76c7('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x76c7('0x16')](0x5)[_0x76c7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x76c7('0x16')](0x3)[_0x76c7('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x76c7('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x76c7('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x76c7('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x76c7('0x16')],'allowNull':!![],'comment':_0x76c7('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x76c7('0x21')],'defaultValue':![],'comment':_0x76c7('0x4e'),'set':function(_0x3467a0){if(!_0x3467a0)this[_0x76c7('0x1b')]('mandatoryDispositionPauseId',null);this[_0x76c7('0x1b')](_0x76c7('0x4f'),_0x3467a0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x76c7('0x16')](0x3)[_0x76c7('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x76c7('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x76c7('0x21')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 6e3e839..f51b67f 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 _0x2178=['fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_hopper','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','insert','cm_hopper_black','NOW()','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','get','VoiceQueues','inbound','outbound','filter','ignore','map','value','includes','type','find','name','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','include','findAll','catch','show','params','keys','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','pick','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','each','UserVoiceQueue','UserVoiceQueueRt','upsert','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always'];(function(_0x5e7177,_0x14cf76){var _0x667556=function(_0x256598){while(--_0x256598){_0x5e7177['push'](_0x5e7177['shift']());}};_0x667556(++_0x14cf76);}(_0x2178,0x1b0));var _0x8217=function(_0x5f1431,_0x49bea0){_0x5f1431=_0x5f1431-0x0;var _0x165500=_0x2178[_0x5f1431];return _0x165500;};'use strict';var emlformat=require(_0x8217('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8217('0x1'));var jsonpatch=require(_0x8217('0x2'));var rp=require(_0x8217('0x3'));var moment=require('moment');var BPromise=require(_0x8217('0x4'));var Mustache=require(_0x8217('0x5'));var util=require('util');var path=require(_0x8217('0x6'));var sox=require(_0x8217('0x7'));var csv=require(_0x8217('0x8'));var ejs=require(_0x8217('0x9'));var fs=require('fs');var fs_extra=require(_0x8217('0xa'));var _=require(_0x8217('0xb'));var squel=require(_0x8217('0xc'));var crypto=require(_0x8217('0xd'));var jsforce=require(_0x8217('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8217('0xf'));var Papa=require(_0x8217('0x10'));var Redis=require(_0x8217('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8217('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8217('0x13'))(_0x8217('0x14'));var utils=require(_0x8217('0x15'));var config=require(_0x8217('0x16'));var licenseUtil=require(_0x8217('0x17'));var db=require(_0x8217('0x18'))['db'];config[_0x8217('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8217('0x1a'))(new Redis(config[_0x8217('0x19')]));require(_0x8217('0x1b'))[_0x8217('0x1c')](socket);function respondWithStatusCode(_0x5081d3,_0x1c54e4){_0x1c54e4=_0x1c54e4||0xcc;return function(_0x308cc1){if(_0x308cc1){return _0x5081d3[_0x8217('0x1d')](_0x1c54e4);}return _0x5081d3['status'](_0x1c54e4)[_0x8217('0x1e')]();};}function respondWithResult(_0x3c0247,_0x90f972){_0x90f972=_0x90f972||0xc8;return function(_0x2bba07){if(_0x2bba07){return _0x3c0247[_0x8217('0x1f')](_0x90f972)[_0x8217('0x20')](_0x2bba07);}};}function respondWithFilteredResult(_0x3ccef1,_0x4f89b8){return function(_0x407924){if(_0x407924){var _0x373d65=typeof _0x4f89b8['offset']===_0x8217('0x21')&&typeof _0x4f89b8[_0x8217('0x22')]==='undefined';var _0x591516=_0x407924['count'];var _0x417105=_0x373d65?0x0:_0x4f89b8[_0x8217('0x23')];var _0x2ed079=_0x373d65?_0x407924[_0x8217('0x24')]:_0x4f89b8['offset']+_0x4f89b8[_0x8217('0x22')];var _0x29f4d7;if(_0x2ed079>=_0x591516){_0x2ed079=_0x591516;_0x29f4d7=0xc8;}else{_0x29f4d7=0xce;}_0x3ccef1[_0x8217('0x1f')](_0x29f4d7);return _0x3ccef1[_0x8217('0x25')](_0x8217('0x26'),_0x417105+'-'+_0x2ed079+'/'+_0x591516)[_0x8217('0x20')](_0x407924);}return null;};}function patchUpdates(_0x564edc){return function(_0x2551be){try{jsonpatch[_0x8217('0x27')](_0x2551be,_0x564edc,!![]);}catch(_0x4ed481){return BPromise[_0x8217('0x28')](_0x4ed481);}return _0x2551be[_0x8217('0x29')]();};}function saveUpdates(_0x2c2f00,_0x2b7ea8){return function(_0xa17447){if(_0xa17447){return _0xa17447[_0x8217('0x2a')](_0x2c2f00)['then'](function(_0x5087fb){return _0x5087fb;});}return null;};}function removeEntity(_0x3329d4,_0xbb940e){return function(_0x9d5a86){if(_0x9d5a86){return _0x9d5a86[_0x8217('0x2b')]()[_0x8217('0x2c')](function(){var _0x55a324=_0x9d5a86[_0x8217('0x2d')]({'plain':!![]});var _0x1eb568=[{'name':_0x8217('0x2e'),'value':_0x8217('0x2f'),'ignore':![]},{'name':'QueueCampaigns','value':_0x8217('0x30'),'ignore':![]}];var _0x48a818=_(_0x1eb568)[_0x8217('0x31')](_0x8217('0x32'))[_0x8217('0x33')](_0x8217('0x34'))['value']();if(_[_0x8217('0x35')](_0x48a818,_0x55a324[_0x8217('0x36')])){return;}var _0x13a19f=_[_0x8217('0x37')](_0x1eb568,[_0x8217('0x34'),_0x55a324[_0x8217('0x36')]])[_0x8217('0x38')];return db['UserProfileResource']['destroy']({'where':{'type':_0x13a19f,'resourceId':_0x55a324['id']}})[_0x8217('0x2c')](function(){return _0x9d5a86;});})[_0x8217('0x2c')](function(){_0x3329d4[_0x8217('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ef36,_0x14fa93){return function(_0x457b1a){if(!_0x457b1a){_0x25ef36[_0x8217('0x1d')](0x194);}return _0x457b1a;};}function handleError(_0x42ae12,_0x5f974d){_0x5f974d=_0x5f974d||0x1f4;return function(_0x1b0ba1){logger[_0x8217('0x39')](_0x1b0ba1[_0x8217('0x3a')]);if(_0x1b0ba1[_0x8217('0x38')]){delete _0x1b0ba1[_0x8217('0x38')];}_0x42ae12['status'](_0x5f974d)[_0x8217('0x3b')](_0x1b0ba1);};}exports[_0x8217('0x3c')]=function(_0x2be625,_0x3f829d){var _0x1c0e5f={},_0x2d304c={},_0x49b05c={'count':0x0,'rows':[]};var _0x2e178e=_[_0x8217('0x33')](db[_0x8217('0x3d')][_0x8217('0x3e')],function(_0x1203bc){return{'name':_0x1203bc[_0x8217('0x3f')],'type':_0x1203bc[_0x8217('0x36')][_0x8217('0x40')]};});_0x2d304c[_0x8217('0x41')]=_[_0x8217('0x33')](_0x2e178e,_0x8217('0x38'));_0x2d304c[_0x8217('0x42')]=_['keys'](_0x2be625[_0x8217('0x42')]);_0x2d304c[_0x8217('0x43')]=_[_0x8217('0x44')](_0x2d304c[_0x8217('0x41')],_0x2d304c[_0x8217('0x42')]);_0x1c0e5f[_0x8217('0x45')]=_[_0x8217('0x44')](_0x2d304c[_0x8217('0x41')],qs[_0x8217('0x46')](_0x2be625['query']['fields']));_0x1c0e5f['attributes']=_0x1c0e5f[_0x8217('0x45')]['length']?_0x1c0e5f['attributes']:_0x2d304c['model'];if(!_0x2be625[_0x8217('0x42')][_0x8217('0x47')](_0x8217('0x48'))){_0x1c0e5f[_0x8217('0x22')]=qs['limit'](_0x2be625[_0x8217('0x42')][_0x8217('0x22')]);_0x1c0e5f['offset']=qs[_0x8217('0x23')](_0x2be625['query'][_0x8217('0x23')]);}_0x1c0e5f[_0x8217('0x49')]=qs[_0x8217('0x4a')](_0x2be625[_0x8217('0x42')][_0x8217('0x4a')]);_0x1c0e5f['where']=qs[_0x8217('0x43')](_['pick'](_0x2be625[_0x8217('0x42')],_0x2d304c[_0x8217('0x43')]),_0x2e178e);if(_0x2be625[_0x8217('0x42')][_0x8217('0x31')]){_0x1c0e5f[_0x8217('0x4b')]=_[_0x8217('0x4c')](_0x1c0e5f[_0x8217('0x4b')],{'$or':_[_0x8217('0x33')](_0x2e178e,function(_0xb0cd90){if(_0xb0cd90[_0x8217('0x36')]!==_0x8217('0x4d')){var _0x1d9e95={};_0x1d9e95[_0xb0cd90[_0x8217('0x38')]]={'$like':'%'+_0x2be625[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x1d9e95;}})});}_0x1c0e5f=_[_0x8217('0x4c')]({},_0x1c0e5f,_0x2be625['options']);var _0x1392af={'where':_0x1c0e5f[_0x8217('0x4b')]};return db['VoiceQueue'][_0x8217('0x24')](_0x1392af)[_0x8217('0x2c')](function(_0x5784ee){_0x49b05c['count']=_0x5784ee;if(_0x2be625[_0x8217('0x42')]['includeAll']){_0x1c0e5f[_0x8217('0x4e')]=[{'all':!![]}];}return db[_0x8217('0x3d')][_0x8217('0x4f')](_0x1c0e5f);})['then'](function(_0x54b68f){_0x49b05c['rows']=_0x54b68f;return _0x49b05c;})[_0x8217('0x2c')](respondWithFilteredResult(_0x3f829d,_0x1c0e5f))[_0x8217('0x50')](handleError(_0x3f829d,null));};exports[_0x8217('0x51')]=function(_0x36f9da,_0xe740c0){var _0x3d13c1={'raw':![],'where':{'id':_0x36f9da[_0x8217('0x52')]['id']}},_0x13f822={};_0x13f822['model']=_['keys'](db[_0x8217('0x3d')][_0x8217('0x3e')]);_0x13f822[_0x8217('0x42')]=_[_0x8217('0x53')](_0x36f9da[_0x8217('0x42')]);_0x13f822[_0x8217('0x43')]=_['intersection'](_0x13f822[_0x8217('0x41')],_0x13f822[_0x8217('0x42')]);_0x3d13c1[_0x8217('0x45')]=_['intersection'](_0x13f822[_0x8217('0x41')],qs['fields'](_0x36f9da[_0x8217('0x42')]['fields']));_0x3d13c1[_0x8217('0x45')]=_0x3d13c1['attributes'][_0x8217('0x54')]?_0x3d13c1[_0x8217('0x45')]:_0x13f822[_0x8217('0x41')];if(_0x36f9da[_0x8217('0x42')]['includeAll']){_0x3d13c1[_0x8217('0x4e')]=[{'all':!![]}];}_0x3d13c1=_[_0x8217('0x4c')]({},_0x3d13c1,_0x36f9da[_0x8217('0x55')]);return db[_0x8217('0x3d')][_0x8217('0x37')](_0x3d13c1)[_0x8217('0x2c')](handleEntityNotFound(_0xe740c0,null))[_0x8217('0x2c')](respondWithResult(_0xe740c0,null))[_0x8217('0x50')](handleError(_0xe740c0,null));};exports['create']=function(_0x29d1eb,_0x25ef0d){return db[_0x8217('0x3d')][_0x8217('0x56')](_0x29d1eb[_0x8217('0x57')],{})[_0x8217('0x2c')](function(_0x26edf6){var _0x3ea385=_0x29d1eb[_0x8217('0x58')][_0x8217('0x2d')]({'plain':!![]});if(!_0x3ea385)throw new Error(_0x8217('0x59'));if(_0x3ea385[_0x8217('0x5a')]===_0x8217('0x58')){var _0x99692c=_0x26edf6[_0x8217('0x2d')]({'plain':!![]});var _0xc52109=[{'name':'VoiceQueues','value':_0x8217('0x2f')},{'name':_0x8217('0x5b'),'value':_0x8217('0x30')}];var _0x1ab509=_[_0x8217('0x37')](_0xc52109,[_0x8217('0x34'),_0x99692c[_0x8217('0x36')]])[_0x8217('0x38')];return db['UserProfileSection'][_0x8217('0x37')]({'where':{'name':_0x1ab509,'userProfileId':_0x3ea385[_0x8217('0x5c')]},'raw':!![]})[_0x8217('0x2c')](function(_0x2a577b){if(_0x2a577b&&_0x2a577b[_0x8217('0x5d')]===0x0){return db[_0x8217('0x5e')]['create']({'name':_0x99692c[_0x8217('0x38')],'resourceId':_0x99692c['id'],'type':_0x2a577b[_0x8217('0x38')],'sectionId':_0x2a577b['id']},{})[_0x8217('0x2c')](function(){return _0x26edf6;});}else{return _0x26edf6;}})[_0x8217('0x50')](function(_0xecfb94){logger['error'](_0x8217('0x5f'),_0xecfb94);throw _0xecfb94;});}return _0x26edf6;})[_0x8217('0x2c')](respondWithResult(_0x25ef0d,0xc9))[_0x8217('0x50')](handleError(_0x25ef0d,null));};exports[_0x8217('0x60')]=function(_0x332ebb,_0xfd5e68){var _0x2fb462={'where':{'id':_0x332ebb[_0x8217('0x52')]['id']}},_0xb8f962={};_0xb8f962['model']=_[_0x8217('0x53')](db[_0x8217('0x3d')][_0x8217('0x3e')]);_0x2fb462[_0x8217('0x45')]=_[_0x8217('0x44')](_0xb8f962[_0x8217('0x41')],qs[_0x8217('0x46')](_0x332ebb[_0x8217('0x42')]['fields']));_0x2fb462[_0x8217('0x45')]=_0x2fb462[_0x8217('0x45')][_0x8217('0x54')]?_0x2fb462[_0x8217('0x45')]:_0xb8f962[_0x8217('0x41')];if(_0x332ebb[_0x8217('0x42')][_0x8217('0x61')]){_0x2fb462[_0x8217('0x4e')]=[{'all':!![]}];}_0x2fb462=_[_0x8217('0x4c')]({},_0x2fb462,_0x332ebb[_0x8217('0x55')]);return db[_0x8217('0x3d')][_0x8217('0x37')](_0x2fb462)[_0x8217('0x2c')](handleEntityNotFound(_0xfd5e68,null))[_0x8217('0x2c')](function(_0x11f1a3){if(_0x11f1a3){var _0x5eb85c=_0x11f1a3[_0x8217('0x2d')]({'plain':!![]});_0x5eb85c=qs[_0x8217('0x62')](_0x5eb85c,['id',_0x8217('0x63'),_0x8217('0x64')]);_0x332ebb[_0x8217('0x57')]=_['omit'](_0x332ebb[_0x8217('0x57')],['id',_0x8217('0x63'),'updatedAt']);return db['VoiceQueue']['create'](_['merge'](_0x5eb85c,_0x332ebb['body']),{'include':_0x332ebb[_0x8217('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x8217('0x2c')](function(_0x5b63c7){var _0x26ed6e=_0x332ebb['user'][_0x8217('0x2d')]({'plain':!![]});if(!_0x26ed6e)throw new Error(_0x8217('0x59'));if(_0x26ed6e[_0x8217('0x5a')]===_0x8217('0x58')){var _0x1eed04=_0x5b63c7[_0x8217('0x2d')]({'plain':!![]});var _0x2b74bd=[{'name':_0x8217('0x2e'),'value':_0x8217('0x2f')},{'name':_0x8217('0x5b'),'value':_0x8217('0x30')}];var _0x555ad1=_['find'](_0x2b74bd,['value',_0x1eed04[_0x8217('0x36')]])[_0x8217('0x38')];return db[_0x8217('0x65')]['find']({'where':{'name':_0x555ad1,'userProfileId':_0x26ed6e['userProfileId']},'raw':!![]})[_0x8217('0x2c')](function(_0xb6b051){if(_0xb6b051&&_0xb6b051[_0x8217('0x5d')]===0x0){return db['UserProfileResource'][_0x8217('0x56')]({'name':_0x1eed04[_0x8217('0x38')],'resourceId':_0x1eed04['id'],'type':_0xb6b051[_0x8217('0x38')],'sectionId':_0xb6b051['id']},{})[_0x8217('0x2c')](function(){return _0x5b63c7;});}else{return _0x5b63c7;}})[_0x8217('0x50')](function(_0x2b85eb){logger['error'](_0x8217('0x5f'),_0x2b85eb);throw _0x2b85eb;});}return _0x5b63c7;});}})[_0x8217('0x2c')](respondWithResult(_0xfd5e68,0xc9))['catch'](handleError(_0xfd5e68,null));};exports[_0x8217('0x2a')]=function(_0x1f4e12,_0x2f7063){if(_0x1f4e12[_0x8217('0x57')]['id']){delete _0x1f4e12['body']['id'];}return db[_0x8217('0x3d')][_0x8217('0x37')]({'where':{'id':_0x1f4e12[_0x8217('0x52')]['id']}})['then'](handleEntityNotFound(_0x2f7063,null))[_0x8217('0x2c')](saveUpdates(_0x1f4e12['body'],null))[_0x8217('0x2c')](respondWithResult(_0x2f7063,null))[_0x8217('0x50')](handleError(_0x2f7063,null));};exports[_0x8217('0x2b')]=function(_0x872297,_0x336045){return db[_0x8217('0x3d')][_0x8217('0x37')]({'where':{'id':_0x872297[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x336045,null))['then'](removeEntity(_0x336045,null))[_0x8217('0x50')](handleError(_0x336045,null));};exports[_0x8217('0x66')]=function(_0x422d94,_0x42c236,_0xe6286a){var _0x39e5df={'raw':![],'where':{}};var _0x2aa75f={};var _0x24f9bd={'count':0x0,'rows':[]};return db[_0x8217('0x3d')][_0x8217('0x67')]({'where':{'id':_0x422d94[_0x8217('0x52')]['id']}})['then'](handleEntityNotFound(_0x42c236,null))[_0x8217('0x2c')](function(_0x1de6fb){if(_0x1de6fb){_0x2aa75f[_0x8217('0x41')]=_[_0x8217('0x53')](db['CmHopper'][_0x8217('0x3e')]);_0x2aa75f[_0x8217('0x42')]=_['keys'](_0x422d94['query']);_0x2aa75f[_0x8217('0x43')]=_['intersection'](_0x2aa75f['model'],_0x2aa75f[_0x8217('0x42')]);_0x39e5df[_0x8217('0x45')]=_[_0x8217('0x44')](_0x2aa75f['model'],qs[_0x8217('0x46')](_0x422d94[_0x8217('0x42')][_0x8217('0x46')]));_0x39e5df[_0x8217('0x45')]=_0x39e5df[_0x8217('0x45')][_0x8217('0x54')]?_0x39e5df[_0x8217('0x45')]:_0x2aa75f[_0x8217('0x41')];if(!_0x422d94[_0x8217('0x42')][_0x8217('0x47')](_0x8217('0x48'))){_0x39e5df['limit']=qs['limit'](_0x422d94['query'][_0x8217('0x22')]);_0x39e5df[_0x8217('0x23')]=qs[_0x8217('0x23')](_0x422d94[_0x8217('0x42')]['offset']);}_0x39e5df['order']=qs[_0x8217('0x4a')](_0x422d94[_0x8217('0x42')][_0x8217('0x4a')]);_0x39e5df[_0x8217('0x4b')]=qs[_0x8217('0x43')](_[_0x8217('0x68')](_0x422d94[_0x8217('0x42')],_0x2aa75f[_0x8217('0x43')]));_0x39e5df[_0x8217('0x4b')][_0x8217('0x69')]=_0x1de6fb['id'];if(_0x422d94['query'][_0x8217('0x31')]){_0x39e5df[_0x8217('0x4b')]=_[_0x8217('0x4c')](_0x39e5df[_0x8217('0x4b')],{'$or':_[_0x8217('0x33')](_0x39e5df[_0x8217('0x45')],function(_0x4fe3c4){var _0x1f0ff4={};_0x1f0ff4[_0x4fe3c4]={'$like':'%'+_0x422d94[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x1f0ff4;})});}_0x39e5df=_[_0x8217('0x4c')]({},_0x39e5df,_0x422d94[_0x8217('0x55')]);return db[_0x8217('0x6a')][_0x8217('0x24')]({'where':_0x39e5df[_0x8217('0x4b')]})[_0x8217('0x2c')](function(_0x43fa90){_0x24f9bd[_0x8217('0x24')]=_0x43fa90;if(_0x422d94[_0x8217('0x42')][_0x8217('0x61')]){_0x39e5df[_0x8217('0x4e')]=[{'all':!![]}];}return db[_0x8217('0x6a')][_0x8217('0x4f')](_0x39e5df);})[_0x8217('0x2c')](function(_0x514cb0){_0x24f9bd[_0x8217('0x6b')]=_0x514cb0;return _0x24f9bd;});}})['then'](respondWithFilteredResult(_0x42c236,_0x39e5df))[_0x8217('0x50')](handleError(_0x42c236,null));};exports[_0x8217('0x6c')]=function(_0x2581bc,_0x3493b7,_0x439da8){var _0x220d65={'raw':!![],'where':{}};var _0x4e2380={};var _0x5069c9={'count':0x0,'rows':[]};return db[_0x8217('0x3d')][_0x8217('0x67')]({'where':{'id':_0x2581bc['params']['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x3493b7,null))[_0x8217('0x2c')](function(_0x2924f7){if(_0x2924f7){_0x4e2380[_0x8217('0x41')]=_[_0x8217('0x53')](db[_0x8217('0x6d')][_0x8217('0x3e')]);_0x4e2380[_0x8217('0x42')]=_['keys'](_0x2581bc[_0x8217('0x42')]);_0x4e2380['filters']=_[_0x8217('0x44')](_0x4e2380['model'],_0x4e2380[_0x8217('0x42')]);_0x220d65[_0x8217('0x45')]=_[_0x8217('0x44')](_0x4e2380[_0x8217('0x41')],qs['fields'](_0x2581bc[_0x8217('0x42')][_0x8217('0x46')]));_0x220d65[_0x8217('0x45')]=_0x220d65[_0x8217('0x45')]['length']?_0x220d65[_0x8217('0x45')]:_0x4e2380[_0x8217('0x41')];if(!_0x2581bc[_0x8217('0x42')][_0x8217('0x47')]('nolimit')){_0x220d65['limit']=qs[_0x8217('0x22')](_0x2581bc['query']['limit']);_0x220d65[_0x8217('0x23')]=qs[_0x8217('0x23')](_0x2581bc[_0x8217('0x42')][_0x8217('0x23')]);}_0x220d65[_0x8217('0x49')]=qs[_0x8217('0x4a')](_0x2581bc[_0x8217('0x42')][_0x8217('0x4a')]);_0x220d65[_0x8217('0x4b')]=qs['filters'](_[_0x8217('0x68')](_0x2581bc[_0x8217('0x42')],_0x4e2380[_0x8217('0x43')]));_0x220d65['where'][_0x8217('0x69')]=_0x2924f7['id'];if(_0x2581bc[_0x8217('0x42')][_0x8217('0x31')]){_0x220d65[_0x8217('0x4b')]=_[_0x8217('0x4c')](_0x220d65[_0x8217('0x4b')],{'$or':_[_0x8217('0x33')](_0x220d65[_0x8217('0x45')],function(_0x31214d){var _0x51342e={};_0x51342e[_0x31214d]={'$like':'%'+_0x2581bc[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x51342e;})});}_0x220d65=_[_0x8217('0x4c')]({},_0x220d65,_0x2581bc[_0x8217('0x55')]);return db['CmHopperHistory'][_0x8217('0x24')]({'where':_0x220d65['where']})['then'](function(_0x52f4bb){_0x5069c9[_0x8217('0x24')]=_0x52f4bb;if(_0x2581bc[_0x8217('0x42')]['includeAll']){_0x220d65['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x8217('0x4f')](_0x220d65);})[_0x8217('0x2c')](function(_0x1489db){_0x5069c9['rows']=_0x1489db;return _0x5069c9;});}})[_0x8217('0x2c')](respondWithFilteredResult(_0x3493b7,_0x220d65))['catch'](handleError(_0x3493b7,null));};exports[_0x8217('0x6e')]=function(_0x5eb867,_0x3ff026,_0x419f51){var _0x42ec07={'raw':!![],'where':{}};var _0x41c0ac={};var _0x70d4b0={'count':0x0,'rows':[]};return db[_0x8217('0x3d')]['findOne']({'where':{'id':_0x5eb867[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x3ff026,null))[_0x8217('0x2c')](function(_0x170eb5){if(_0x170eb5){_0x41c0ac[_0x8217('0x41')]=_[_0x8217('0x53')](db['CmHopperFinal']['rawAttributes']);_0x41c0ac[_0x8217('0x42')]=_['keys'](_0x5eb867['query']);_0x41c0ac[_0x8217('0x43')]=_[_0x8217('0x44')](_0x41c0ac[_0x8217('0x41')],_0x41c0ac[_0x8217('0x42')]);_0x42ec07[_0x8217('0x45')]=_[_0x8217('0x44')](_0x41c0ac['model'],qs['fields'](_0x5eb867[_0x8217('0x42')][_0x8217('0x46')]));_0x42ec07[_0x8217('0x45')]=_0x42ec07[_0x8217('0x45')][_0x8217('0x54')]?_0x42ec07[_0x8217('0x45')]:_0x41c0ac[_0x8217('0x41')];if(!_0x5eb867[_0x8217('0x42')][_0x8217('0x47')]('nolimit')){_0x42ec07[_0x8217('0x22')]=qs[_0x8217('0x22')](_0x5eb867['query']['limit']);_0x42ec07[_0x8217('0x23')]=qs['offset'](_0x5eb867['query'][_0x8217('0x23')]);}_0x42ec07[_0x8217('0x49')]=qs[_0x8217('0x4a')](_0x5eb867[_0x8217('0x42')][_0x8217('0x4a')]);_0x42ec07[_0x8217('0x4b')]=qs[_0x8217('0x43')](_['pick'](_0x5eb867[_0x8217('0x42')],_0x41c0ac[_0x8217('0x43')]));_0x42ec07[_0x8217('0x4b')][_0x8217('0x69')]=_0x170eb5['id'];if(_0x5eb867['query']['filter']){_0x42ec07['where']=_[_0x8217('0x4c')](_0x42ec07[_0x8217('0x4b')],{'$or':_[_0x8217('0x33')](_0x42ec07['attributes'],function(_0x5ed5fa){var _0x1234b0={};_0x1234b0[_0x5ed5fa]={'$like':'%'+_0x5eb867[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x1234b0;})});}_0x42ec07=_['merge']({},_0x42ec07,_0x5eb867['options']);return db[_0x8217('0x6f')][_0x8217('0x24')]({'where':_0x42ec07[_0x8217('0x4b')]})[_0x8217('0x2c')](function(_0x1ad617){_0x70d4b0[_0x8217('0x24')]=_0x1ad617;if(_0x5eb867[_0x8217('0x42')][_0x8217('0x61')]){_0x42ec07[_0x8217('0x4e')]=[{'all':!![]}];}return db[_0x8217('0x6f')][_0x8217('0x4f')](_0x42ec07);})[_0x8217('0x2c')](function(_0x3f4660){_0x70d4b0[_0x8217('0x6b')]=_0x3f4660;return _0x70d4b0;});}})['then'](respondWithFilteredResult(_0x3ff026,_0x42ec07))['catch'](handleError(_0x3ff026,null));};exports[_0x8217('0x70')]=function(_0x42a8b8,_0x40033c,_0x1bec62){var _0x28cfb5={'raw':!![],'where':{}};var _0x424154={};var _0x470cf2={'count':0x0,'rows':[]};return db[_0x8217('0x3d')][_0x8217('0x67')]({'where':{'id':_0x42a8b8[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x40033c,null))['then'](function(_0x315876){if(_0x315876){_0x424154[_0x8217('0x41')]=_[_0x8217('0x53')](db[_0x8217('0x71')]['rawAttributes']);_0x424154[_0x8217('0x42')]=_[_0x8217('0x53')](_0x42a8b8[_0x8217('0x42')]);_0x424154[_0x8217('0x43')]=_[_0x8217('0x44')](_0x424154['model'],_0x424154['query']);_0x28cfb5[_0x8217('0x45')]=_[_0x8217('0x44')](_0x424154[_0x8217('0x41')],qs[_0x8217('0x46')](_0x42a8b8['query'][_0x8217('0x46')]));_0x28cfb5[_0x8217('0x45')]=_0x28cfb5[_0x8217('0x45')][_0x8217('0x54')]?_0x28cfb5['attributes']:_0x424154[_0x8217('0x41')];if(!_0x42a8b8[_0x8217('0x42')][_0x8217('0x47')](_0x8217('0x48'))){_0x28cfb5['limit']=qs[_0x8217('0x22')](_0x42a8b8[_0x8217('0x42')][_0x8217('0x22')]);_0x28cfb5[_0x8217('0x23')]=qs[_0x8217('0x23')](_0x42a8b8[_0x8217('0x42')]['offset']);}_0x28cfb5[_0x8217('0x49')]=qs['sort'](_0x42a8b8[_0x8217('0x42')][_0x8217('0x4a')]);_0x28cfb5[_0x8217('0x4b')]=qs[_0x8217('0x43')](_[_0x8217('0x68')](_0x42a8b8[_0x8217('0x42')],_0x424154[_0x8217('0x43')]));_0x28cfb5[_0x8217('0x4b')][_0x8217('0x69')]=_0x315876['id'];if(_0x42a8b8[_0x8217('0x42')]['filter']){_0x28cfb5[_0x8217('0x4b')]=_[_0x8217('0x4c')](_0x28cfb5[_0x8217('0x4b')],{'$or':_[_0x8217('0x33')](_0x28cfb5[_0x8217('0x45')],function(_0xa61fc6){var _0x5000ba={};_0x5000ba[_0xa61fc6]={'$like':'%'+_0x42a8b8[_0x8217('0x42')]['filter']+'%'};return _0x5000ba;})});}_0x28cfb5=_[_0x8217('0x4c')]({},_0x28cfb5,_0x42a8b8[_0x8217('0x55')]);return db[_0x8217('0x71')][_0x8217('0x24')]({'where':_0x28cfb5[_0x8217('0x4b')]})[_0x8217('0x2c')](function(_0x38cf7e){_0x470cf2['count']=_0x38cf7e;if(_0x42a8b8[_0x8217('0x42')][_0x8217('0x61')]){_0x28cfb5[_0x8217('0x4e')]=[{'all':!![]}];}return db[_0x8217('0x71')]['findAll'](_0x28cfb5);})[_0x8217('0x2c')](function(_0x41be85){_0x470cf2['rows']=_0x41be85;return _0x470cf2;});}})['then'](respondWithFilteredResult(_0x40033c,_0x28cfb5))[_0x8217('0x50')](handleError(_0x40033c,null));};exports[_0x8217('0x72')]=function(_0x4555c6,_0x5525d0,_0x284a4a){var _0x106fde={};var _0x58c03a={};var _0x22d6c7;var _0x55af92;return db['VoiceQueue']['findOne']({'where':{'id':_0x4555c6[_0x8217('0x52')]['id']}})['then'](handleEntityNotFound(_0x5525d0,null))[_0x8217('0x2c')](function(_0x4ae9d6){if(_0x4ae9d6){_0x22d6c7=_0x4ae9d6;_0x58c03a['model']=_[_0x8217('0x53')](db[_0x8217('0x73')]['rawAttributes']);_0x58c03a[_0x8217('0x42')]=_[_0x8217('0x53')](_0x4555c6[_0x8217('0x42')]);_0x58c03a[_0x8217('0x43')]=_[_0x8217('0x44')](_0x58c03a['model'],_0x58c03a[_0x8217('0x42')]);_0x106fde[_0x8217('0x45')]=_['intersection'](_0x58c03a['model'],qs['fields'](_0x4555c6[_0x8217('0x42')][_0x8217('0x46')]));_0x106fde[_0x8217('0x45')]=_0x106fde[_0x8217('0x45')][_0x8217('0x54')]?_0x106fde['attributes']:_0x58c03a['model'];_0x106fde[_0x8217('0x49')]=qs[_0x8217('0x4a')](_0x4555c6[_0x8217('0x42')][_0x8217('0x4a')]);_0x106fde[_0x8217('0x4b')]=qs[_0x8217('0x43')](_[_0x8217('0x68')](_0x4555c6['query'],_0x58c03a[_0x8217('0x43')]));if(_0x4555c6[_0x8217('0x42')]['filter']){_0x106fde[_0x8217('0x4b')]=_['merge'](_0x106fde['where'],{'$or':_[_0x8217('0x33')](_0x106fde['attributes'],function(_0x5a5f5e){var _0x112de6={};_0x112de6[_0x5a5f5e]={'$like':'%'+_0x4555c6[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x112de6;})});}_0x106fde=_[_0x8217('0x4c')]({},_0x106fde,_0x4555c6[_0x8217('0x55')]);return _0x22d6c7[_0x8217('0x72')](_0x106fde);}})[_0x8217('0x2c')](function(_0x3f8c10){if(_0x3f8c10){_0x55af92=_0x3f8c10[_0x8217('0x54')];if(!_0x4555c6[_0x8217('0x42')][_0x8217('0x47')](_0x8217('0x48'))){_0x106fde[_0x8217('0x22')]=qs['limit'](_0x4555c6[_0x8217('0x42')]['limit']);_0x106fde[_0x8217('0x23')]=qs[_0x8217('0x23')](_0x4555c6[_0x8217('0x42')][_0x8217('0x23')]);}return _0x22d6c7[_0x8217('0x72')](_0x106fde);}})[_0x8217('0x2c')](function(_0x7c35b2){if(_0x7c35b2){return _0x7c35b2?{'count':_0x55af92,'rows':_0x7c35b2}:null;}})[_0x8217('0x2c')](respondWithResult(_0x5525d0,null))[_0x8217('0x50')](handleError(_0x5525d0,null));};exports[_0x8217('0x74')]=function(_0x6ea6f3,_0x2eb67f,_0x446e3c){var _0x59cee4=_0x6ea6f3[_0x8217('0x57')][_0x8217('0x75')];var _0x539a06=_[_0x8217('0x33')](_0x59cee4,'id');return db[_0x8217('0x73')][_0x8217('0x4f')]({'where':{'id':_0x539a06},'attributes':['id'],'include':[{'model':db[_0x8217('0x76')],'as':_0x8217('0x77'),'attributes':['id',_0x8217('0x38'),_0x8217('0x78'),_0x8217('0x79'),_0x8217('0x7a')],'raw':!![]}]})[_0x8217('0x2c')](function(_0x55bcea){if(_0x55bcea){var _0x49fd96=_[_0x8217('0x7b')](_0x55bcea,function(_0x81ebf6){var _0x5630e7=_0x81ebf6[_0x8217('0x2d')]({'plain':!![]});_0x5630e7[_0x8217('0x77')][_0x8217('0x7c')](function(_0x558682){_0x558682[_0x8217('0x7d')]=_[_0x8217('0x37')](_0x59cee4,{'id':_0x5630e7['id']})[_0x8217('0x7d')];});return _0x5630e7[_0x8217('0x77')];});return db[_0x8217('0x3d')][_0x8217('0x37')]({'where':{'id':_0x6ea6f3[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](function(_0x359a14){return db['sequelize'][_0x8217('0x7e')](function(_0xe83e83){return _0x359a14[_0x8217('0x74')](_0x539a06,{'transaction':_0xe83e83})['then'](function(){return BPromise['each'](_0x59cee4,function(_0x54a9c1){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x54a9c1['id'],'VoiceQueueId':_0x6ea6f3['params']['id'],'penalty':_0x54a9c1[_0x8217('0x7d')]},{'transaction':_0xe83e83});});})['then'](function(){return BPromise[_0x8217('0x7f')](_0x49fd96,function(_0x39b988){return db[_0x8217('0x80')]['findOrCreate']({'where':{'UserId':_0x39b988['id'],'VoiceQueueId':_0x6ea6f3[_0x8217('0x52')]['id']},'defaults':{'penalty':_0x39b988[_0x8217('0x7d')]},'transaction':_0xe83e83});});})[_0x8217('0x2c')](function(){return BPromise[_0x8217('0x7f')](_[_0x8217('0x31')](_0x49fd96,{'online':!![]}),function(_0x376782){return db[_0x8217('0x81')][_0x8217('0x82')]({'membername':_0x376782[_0x8217('0x38')],'UserId':_0x376782['id'],'queue_name':_0x359a14[_0x8217('0x38')],'VoiceQueueId':_0x359a14['id'],'interface':_['isNil'](_0x376782[_0x8217('0x7a')])?util[_0x8217('0x83')](_0x8217('0x84'),_0x376782[_0x8217('0x38')]):_0x376782['interface'],'paused':_0x376782['voicePause']||![],'penalty':_0x376782[_0x8217('0x7d')]},{'transaction':_0xe83e83});});})[_0x8217('0x2c')](function(){_0x49fd96['forEach'](function(_0x218288){socket[_0x8217('0x85')](_0x8217('0x86'),{'UserId':_0x218288['id'],'VoiceQueueId':_0x359a14['id']});});});});});}})[_0x8217('0x2c')](respondWithStatusCode(_0x2eb67f,null))[_0x8217('0x50')](handleError(_0x2eb67f,null));};exports[_0x8217('0x87')]=function(_0x51f8d2,_0x1300b3,_0x564451){return db[_0x8217('0x73')][_0x8217('0x4f')]({'where':{'id':_0x51f8d2[_0x8217('0x42')][_0x8217('0x88')]},'attributes':['id'],'include':[{'model':db[_0x8217('0x76')],'as':_0x8217('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1300b3,null))[_0x8217('0x2c')](function(_0x2509ae){var _0x7a3267=_[_0x8217('0x33')](_0x2509ae,'id');var _0x2f2fed=[];var _0x1e6cee=[];var _0x501258=squel[_0x8217('0x89')]();_0x501258[_0x8217('0x8a')](_0x8217('0x8b'))[_0x8217('0x8c')]('team_has_voice_queues','tq')[_0x8217('0x8d')](_0x8217('0x8e'),'ut',_0x8217('0x8f'))[_0x8217('0x4b')](_0x8217('0x90'),_0x51f8d2['params']['id']);for(var _0x1c133a=0x0;_0x1c133a<_0x2509ae[_0x8217('0x54')];_0x1c133a+=0x1){let _0x5dfe95=_0x2509ae[_0x1c133a];for(var _0x142118=0x0;_0x142118<_0x5dfe95[_0x8217('0x77')][_0x8217('0x54')];_0x142118+=0x1){let _0x3a5105=_0x5dfe95[_0x8217('0x77')][_0x142118];var _0x59511c=_0x501258['clone']();_0x59511c[_0x8217('0x4b')](_0x8217('0x91'),_0x3a5105['id']);_0x1e6cee[_0x8217('0x92')](db[_0x8217('0x93')][_0x8217('0x42')](_0x59511c[_0x8217('0x94')](),{'type':db['sequelize'][_0x8217('0x95')]['SELECT']})['then'](function(_0x398980){if(_0x398980[_0x8217('0x54')]===0x1){return _0x3a5105['id'];}else{var _0x422735=_[_0x8217('0x96')](_['map'](_0x398980,_0x8217('0x97')),function(_0x158f7c){return _[_0x8217('0x35')](_0x7a3267,_0x158f7c);});if(_0x422735){return _0x3a5105['id'];}}}));}}return BPromise[_0x8217('0x98')](_0x1e6cee)[_0x8217('0x2c')](function(_0x3b05be){_0x2f2fed=_(_0x2f2fed)[_0x8217('0x99')](_0x3b05be)[_0x8217('0x9a')]()[_0x8217('0x34')]();return db[_0x8217('0x3d')][_0x8217('0x37')]({'where':{'id':_0x51f8d2[_0x8217('0x52')]['id']}})['then'](function(_0xa3f08f){return db[_0x8217('0x93')][_0x8217('0x7e')](function(_0xc43f50){return _0xa3f08f['removeTeams'](_0x51f8d2[_0x8217('0x42')][_0x8217('0x88')],{'transaction':_0xc43f50})[_0x8217('0x2c')](function(){if(!_[_0x8217('0x9b')](_0x2f2fed)){return _0xa3f08f['removeAgents'](_0x2f2fed,{'transaction':_0xc43f50})[_0x8217('0x2c')](function(){return db[_0x8217('0x81')][_0x8217('0x2b')]({'where':{'VoiceQueueId':_0x51f8d2[_0x8217('0x52')]['id'],'UserId':_0x2f2fed},'transaction':_0xc43f50});});}})[_0x8217('0x2c')](function(){_0x2f2fed['forEach'](function(_0x4e672b){socket[_0x8217('0x85')](_0x8217('0x9c'),{'UserId':_0x4e672b,'VoiceQueueId':_0xa3f08f['id']});});});});});});})[_0x8217('0x2c')](respondWithStatusCode(_0x1300b3,null))[_0x8217('0x50')](handleError(_0x1300b3,null));};exports[_0x8217('0x9d')]=function(_0x7f3d4b,_0x436de6,_0x132e5a){var _0x2aaad1,_0x54cbf5;return db[_0x8217('0x3d')][_0x8217('0x37')]({'where':{'id':_0x7f3d4b[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x436de6,null))['then'](function(_0x42a54e){if(_0x42a54e){_0x54cbf5=_0x42a54e;return _0x42a54e[_0x8217('0x9d')](_0x7f3d4b[_0x8217('0x57')]['ids'],_['omit'](_0x7f3d4b[_0x8217('0x57')],[_0x8217('0x88'),'id'])||{})['spread'](function(_0x4bd521){for(var _0x57d15d=0x0;_0x57d15d<_0x7f3d4b[_0x8217('0x57')][_0x8217('0x88')][_0x8217('0x54')];_0x57d15d+=0x1){socket['emit'](_0x8217('0x86'),{'UserId':Number(_0x7f3d4b[_0x8217('0x57')][_0x8217('0x88')][_0x57d15d]),'VoiceQueueId':Number(_0x7f3d4b[_0x8217('0x52')]['id'])});}return _0x4bd521;});}})[_0x8217('0x2c')](function(_0x1a212e){_0x2aaad1=_0x1a212e||[];if(_0x54cbf5){return db[_0x8217('0x76')][_0x8217('0x4f')]({'where':{'id':_0x7f3d4b[_0x8217('0x57')][_0x8217('0x88')]},'attributes':['id',_0x8217('0x38'),'online',_0x8217('0x79'),_0x8217('0x7a')],'raw':!![]});}})['then'](function(_0x223aa3){if(!_[_0x8217('0x9b')](_0x223aa3)){var _0x8560e2=[];for(var _0x2629db=0x0;_0x2629db<_0x223aa3[_0x8217('0x54')];_0x2629db++){if(_0x223aa3[_0x2629db]['online']){_0x8560e2[_0x8217('0x92')](db[_0x8217('0x81')][_0x8217('0x82')]({'membername':_0x223aa3[_0x2629db][_0x8217('0x38')],'UserId':_0x223aa3[_0x2629db]['id'],'queue_name':_0x54cbf5[_0x8217('0x38')],'VoiceQueueId':_0x54cbf5['id'],'interface':_['isNil'](_0x223aa3[_0x2629db][_0x8217('0x7a')])?util[_0x8217('0x83')](_0x8217('0x84'),_0x223aa3[_0x2629db][_0x8217('0x38')]):_0x223aa3[_0x2629db][_0x8217('0x7a')],'paused':_0x223aa3[_0x2629db][_0x8217('0x79')]||![],'penalty':_0x7f3d4b[_0x8217('0x57')]['penalty']||0x0}));}}return BPromise[_0x8217('0x98')](_0x8560e2);}})[_0x8217('0x2c')](function(){return _0x2aaad1;})[_0x8217('0x2c')](respondWithResult(_0x436de6,null))['catch'](handleError(_0x436de6,null));};exports[_0x8217('0x9e')]=function(_0x42dcb1,_0x26073b,_0x34a11d){return db['VoiceQueue'][_0x8217('0x37')]({'where':{'id':_0x42dcb1[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x26073b,null))['then'](function(_0x1b72ef){if(_0x1b72ef){return _0x1b72ef[_0x8217('0x9e')](_0x42dcb1[_0x8217('0x42')][_0x8217('0x88')])[_0x8217('0x2c')](function(){if(_[_0x8217('0x9f')](_0x42dcb1[_0x8217('0x42')][_0x8217('0x88')])){for(var _0x2a7eed=0x0;_0x2a7eed<_0x42dcb1[_0x8217('0x42')]['ids'][_0x8217('0x54')];_0x2a7eed+=0x1){socket[_0x8217('0x85')]('userVoiceQueue:remove',{'UserId':Number(_0x42dcb1[_0x8217('0x42')][_0x8217('0x88')][_0x2a7eed]),'VoiceQueueId':Number(_0x42dcb1['params']['id'])});}}else{socket[_0x8217('0x85')](_0x8217('0x9c'),{'UserId':Number(_0x42dcb1['query'][_0x8217('0x88')]),'VoiceQueueId':Number(_0x42dcb1[_0x8217('0x52')]['id'])});}});}})[_0x8217('0x2c')](function(_0xc52624){return db[_0x8217('0x81')][_0x8217('0x2b')]({'where':{'VoiceQueueId':_0x42dcb1[_0x8217('0x52')]['id'],'UserId':_0x42dcb1[_0x8217('0x42')][_0x8217('0x88')]}})['then'](function(){return _0xc52624;});})[_0x8217('0x2c')](respondWithStatusCode(_0x26073b,null))[_0x8217('0x50')](handleError(_0x26073b,null));};exports[_0x8217('0xa0')]=function(_0x2ea574,_0xec2e58,_0x44b358){var _0x52290a={};var _0xce6f0d={};var _0x2d880d;var _0x34ab35;return db[_0x8217('0x3d')][_0x8217('0x67')]({'where':{'id':_0x2ea574['params']['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0xec2e58,null))[_0x8217('0x2c')](function(_0x37f637){if(_0x37f637){_0x2d880d=_0x37f637;_0xce6f0d[_0x8217('0x41')]=_['keys'](db['User']['rawAttributes']);_0xce6f0d[_0x8217('0x42')]=_[_0x8217('0x53')](_0x2ea574[_0x8217('0x42')]);_0xce6f0d[_0x8217('0x43')]=_[_0x8217('0x44')](_0xce6f0d[_0x8217('0x41')],_0xce6f0d[_0x8217('0x42')]);_0x52290a[_0x8217('0x45')]=_[_0x8217('0x44')](_0xce6f0d['model'],qs[_0x8217('0x46')](_0x2ea574[_0x8217('0x42')][_0x8217('0x46')]));_0x52290a[_0x8217('0x45')]=_0x52290a[_0x8217('0x45')][_0x8217('0x54')]?_0x52290a['attributes']:_0xce6f0d[_0x8217('0x41')];_0x52290a[_0x8217('0x49')]=qs['sort'](_0x2ea574[_0x8217('0x42')][_0x8217('0x4a')]);_0x52290a[_0x8217('0x4b')]=qs[_0x8217('0x43')](_[_0x8217('0x68')](_0x2ea574[_0x8217('0x42')],_0xce6f0d[_0x8217('0x43')]));if(_0x2ea574['query'][_0x8217('0x31')]){_0x52290a[_0x8217('0x4b')]=_[_0x8217('0x4c')](_0x52290a[_0x8217('0x4b')],{'$or':_[_0x8217('0x33')](_0x52290a[_0x8217('0x45')],function(_0x1f11e6){var _0x29a42f={};_0x29a42f[_0x1f11e6]={'$like':'%'+_0x2ea574[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x29a42f;})});}_0x52290a=_[_0x8217('0x4c')]({},_0x52290a,_0x2ea574['options']);return _0x2d880d[_0x8217('0xa0')](_0x52290a);}})[_0x8217('0x2c')](function(_0x179c8b){if(_0x179c8b){_0x34ab35=_0x179c8b[_0x8217('0x54')];if(!_0x2ea574[_0x8217('0x42')][_0x8217('0x47')]('nolimit')){_0x52290a['limit']=qs['limit'](_0x2ea574[_0x8217('0x42')][_0x8217('0x22')]);_0x52290a[_0x8217('0x23')]=qs[_0x8217('0x23')](_0x2ea574[_0x8217('0x42')][_0x8217('0x23')]);}return _0x2d880d['getAgents'](_0x52290a);}})[_0x8217('0x2c')](function(_0x5902eb){if(_0x5902eb){return _0x5902eb?{'count':_0x34ab35,'rows':_0x5902eb}:null;}})[_0x8217('0x2c')](respondWithResult(_0xec2e58,null))['catch'](handleError(_0xec2e58,null));};exports[_0x8217('0xa1')]=function(_0x258f88,_0x3c2902,_0x33a017){var _0x413a36={};var _0x3af227={};var _0x57ccfe;var _0x3a420a;return db[_0x8217('0x3d')][_0x8217('0x67')]({'where':{'id':_0x258f88[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x3c2902,null))[_0x8217('0x2c')](function(_0x5cd69f){if(_0x5cd69f){_0x57ccfe=_0x5cd69f;_0x3af227[_0x8217('0x41')]=_[_0x8217('0x53')](db['UserVoiceQueueRt'][_0x8217('0x3e')]);_0x3af227[_0x8217('0x42')]=_['keys'](_0x258f88[_0x8217('0x42')]);_0x3af227[_0x8217('0x43')]=_[_0x8217('0x44')](_0x3af227['model'],_0x3af227['query']);_0x413a36[_0x8217('0x45')]=_[_0x8217('0x44')](_0x3af227[_0x8217('0x41')],qs[_0x8217('0x46')](_0x258f88[_0x8217('0x42')][_0x8217('0x46')]));_0x413a36[_0x8217('0x45')]=_0x413a36['attributes']['length']?_0x413a36[_0x8217('0x45')]:_0x3af227['model'];_0x413a36[_0x8217('0x49')]=qs[_0x8217('0x4a')](_0x258f88[_0x8217('0x42')]['sort']);_0x413a36['where']=qs[_0x8217('0x43')](_[_0x8217('0x68')](_0x258f88[_0x8217('0x42')],_0x3af227[_0x8217('0x43')]));if(_0x258f88[_0x8217('0x42')][_0x8217('0x31')]){_0x413a36[_0x8217('0x4b')]=_['merge'](_0x413a36[_0x8217('0x4b')],{'$or':_['map'](_0x413a36[_0x8217('0x45')],function(_0x2a31a2){var _0x3b971a={};_0x3b971a[_0x2a31a2]={'$like':'%'+_0x258f88[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x3b971a;})});}_0x413a36=_['merge']({},_0x413a36,_0x258f88[_0x8217('0x55')]);return _0x57ccfe[_0x8217('0xa1')](_0x413a36);}})[_0x8217('0x2c')](function(_0x59a28e){if(_0x59a28e){_0x3a420a=_0x59a28e[_0x8217('0x54')];if(!_0x258f88['query'][_0x8217('0x47')]('nolimit')){_0x413a36[_0x8217('0x22')]=qs[_0x8217('0x22')](_0x258f88[_0x8217('0x42')][_0x8217('0x22')]);_0x413a36[_0x8217('0x23')]=qs[_0x8217('0x23')](_0x258f88[_0x8217('0x42')][_0x8217('0x23')]);}return _0x57ccfe[_0x8217('0xa1')](_0x413a36);}})[_0x8217('0x2c')](function(_0x8b0e84){return _0x8b0e84?{'count':_0x3a420a,'rows':_0x8b0e84}:null;})[_0x8217('0x2c')](respondWithResult(_0x3c2902,null))[_0x8217('0x50')](handleError(_0x3c2902,null));};exports[_0x8217('0xa2')]=function(_0x49f63e,_0x188b62,_0x26f90c){var _0x24eb3d={};var _0x5eddcd={};var _0x2efb68;var _0x3af1d4;return db[_0x8217('0x3d')][_0x8217('0x67')]({'where':{'id':_0x49f63e[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x188b62,null))[_0x8217('0x2c')](function(_0x327e7a){if(_0x327e7a){_0x2efb68=_0x327e7a;_0x5eddcd['model']=_[_0x8217('0x53')](db[_0x8217('0xa3')]['rawAttributes']);_0x5eddcd[_0x8217('0x42')]=_[_0x8217('0x53')](_0x49f63e['query']);_0x5eddcd[_0x8217('0x43')]=_['intersection'](_0x5eddcd['model'],_0x5eddcd['query']);_0x24eb3d['attributes']=_['intersection'](_0x5eddcd['model'],qs[_0x8217('0x46')](_0x49f63e['query'][_0x8217('0x46')]));_0x24eb3d[_0x8217('0x45')]=_0x24eb3d[_0x8217('0x45')][_0x8217('0x54')]?_0x24eb3d[_0x8217('0x45')]:_0x5eddcd[_0x8217('0x41')];_0x24eb3d[_0x8217('0x49')]=qs[_0x8217('0x4a')](_0x49f63e[_0x8217('0x42')][_0x8217('0x4a')]);_0x24eb3d['where']=qs[_0x8217('0x43')](_['pick'](_0x49f63e[_0x8217('0x42')],_0x5eddcd['filters']));if(_0x49f63e[_0x8217('0x42')]['filter']){_0x24eb3d['where']=_[_0x8217('0x4c')](_0x24eb3d[_0x8217('0x4b')],{'$or':_[_0x8217('0x33')](_0x24eb3d[_0x8217('0x45')],function(_0x5cc8d9){var _0x2c9f99={};_0x2c9f99[_0x5cc8d9]={'$like':'%'+_0x49f63e[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x2c9f99;})});}_0x24eb3d=_[_0x8217('0x4c')]({},_0x24eb3d,_0x49f63e[_0x8217('0x55')]);return _0x2efb68[_0x8217('0xa2')](_0x24eb3d);}})[_0x8217('0x2c')](function(_0x140fdc){if(_0x140fdc){_0x3af1d4=_0x140fdc[_0x8217('0x54')];if(!_0x49f63e[_0x8217('0x42')]['hasOwnProperty'](_0x8217('0x48'))){_0x24eb3d[_0x8217('0x22')]=qs[_0x8217('0x22')](_0x49f63e[_0x8217('0x42')][_0x8217('0x22')]);_0x24eb3d[_0x8217('0x23')]=qs[_0x8217('0x23')](_0x49f63e[_0x8217('0x42')]['offset']);}return _0x2efb68[_0x8217('0xa2')](_0x24eb3d);}})[_0x8217('0x2c')](function(_0x336e3c){if(_0x336e3c){return _0x336e3c?{'count':_0x3af1d4,'rows':_0x336e3c}:null;}})['then'](respondWithResult(_0x188b62,null))['catch'](handleError(_0x188b62,null));};exports[_0x8217('0xa4')]=function(_0x43a79b,_0x260105,_0x5dbfe1){var _0x333c73=moment()[_0x8217('0x83')]('YYYY-MM-DD\x20HH:mm:ss');var _0x20e110,_0x2b5af1;return db[_0x8217('0x3d')][_0x8217('0x37')]({'where':{'id':_0x43a79b['params']['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x260105,null))[_0x8217('0x2c')](function(_0x5aa028){if(_0x5aa028){_0x2b5af1=_0x5aa028;return _0x5aa028[_0x8217('0xa4')](_0x43a79b[_0x8217('0x57')]['ids'],_[_0x8217('0x62')](_0x43a79b[_0x8217('0x57')],[_0x8217('0x88'),'id'])||{});}return null;})[_0x8217('0xa5')](function(_0x5c5bd5){var _0x5d1f8e;_0x20e110=_0x5c5bd5||[];var _0x3471a0=[];if(_0x5c5bd5){for(var _0x1d8a0f=0x0;_0x1d8a0f<_0x5c5bd5['length'];_0x1d8a0f+=0x1){var _0x1ea1ef=_0x5c5bd5[_0x1d8a0f][_0x8217('0x2d')]({'plain':!![]});_0x2b5af1['dialCheckDuplicateType']=_0x43a79b[_0x8217('0x57')]['dialCheckDuplicateType']?_0x43a79b[_0x8217('0x57')][_0x8217('0xa6')]:_0x2b5af1[_0x8217('0xa6')];switch(_0x2b5af1[_0x8217('0xa6')]){case _0x8217('0xa7'):_0x5d1f8e=squel['insert']()['into']('cm_hopper')[_0x8217('0xa8')]([_0x8217('0xa9'),_0x8217('0xaa'),_0x8217('0xab'),_0x8217('0xac'),_0x8217('0x69'),_0x8217('0x63'),_0x8217('0x64')],squel[_0x8217('0x89')]()[_0x8217('0x8a')](_0x8217('0xa9'),_0x8217('0xa9'))[_0x8217('0x8a')]('\x27'+_0x333c73+'\x27','scheduledAt')['field']('id',_0x8217('0xab'))['field'](_0x1ea1ef[_0x8217('0xad')]['toString'](),_0x8217('0xac'))[_0x8217('0x8a')](_0x43a79b[_0x8217('0x52')]['id']['toString'](),_0x8217('0x69'))['field']('\x27'+_0x333c73+'\x27',_0x8217('0x63'))['field']('\x27'+_0x333c73+'\x27',_0x8217('0x64'))['from'](_0x8217('0xae'))[_0x8217('0x4b')]('deletedAt\x20IS\x20NULL')[_0x8217('0x4b')](_0x8217('0xaf'),_0x1ea1ef[_0x8217('0xad')]['toString']())[_0x8217('0x4b')](_0x8217('0xb0'))[_0x8217('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x8217('0x8a')](_0x8217('0xb1'))['from'](_0x8217('0xb2'))[_0x8217('0x4b')](_0x8217('0x90'),_0x43a79b[_0x8217('0x52')]['id'][_0x8217('0x94')]()))['where'](_0x8217('0xb3'),squel[_0x8217('0x89')]()[_0x8217('0x8a')](_0x8217('0xb4'))[_0x8217('0x8c')]('cm_hopper')[_0x8217('0x4b')](_0x8217('0x90'),_0x43a79b[_0x8217('0x52')]['id'][_0x8217('0x94')]())))[_0x8217('0x94')]();break;case _0x8217('0xb5'):_0x5d1f8e=squel['insert']()[_0x8217('0xb6')](_0x8217('0xb7'))[_0x8217('0xa8')]([_0x8217('0xa9'),_0x8217('0xaa'),_0x8217('0xab'),_0x8217('0xac'),_0x8217('0x69'),'createdAt',_0x8217('0x64')],squel[_0x8217('0x89')]()[_0x8217('0x8a')]('phone','phone')[_0x8217('0x8a')]('\x27'+_0x333c73+'\x27','scheduledAt')[_0x8217('0x8a')]('id','ContactId')[_0x8217('0x8a')](_0x1ea1ef['CmListId'][_0x8217('0x94')](),_0x8217('0xac'))[_0x8217('0x8a')](_0x43a79b['params']['id'][_0x8217('0x94')](),_0x8217('0x69'))['field']('\x27'+_0x333c73+'\x27','createdAt')[_0x8217('0x8a')]('\x27'+_0x333c73+'\x27',_0x8217('0x64'))[_0x8217('0x8c')](_0x8217('0xae'))[_0x8217('0x4b')]('deletedAt\x20IS\x20NULL')[_0x8217('0x4b')](_0x8217('0xaf'),_0x1ea1ef[_0x8217('0xad')][_0x8217('0x94')]())[_0x8217('0x4b')](_0x8217('0xb0'))['where'](_0x8217('0xb3'),squel[_0x8217('0x89')]()[_0x8217('0x8a')](_0x8217('0xb4'))[_0x8217('0x8c')](_0x8217('0xb7'))[_0x8217('0x4b')]('VoiceQueueId\x20=\x20?',_0x43a79b[_0x8217('0x52')]['id'][_0x8217('0x94')]())))[_0x8217('0x94')]();break;default:_0x5d1f8e=squel['insert']()[_0x8217('0xb6')](_0x8217('0xb7'))[_0x8217('0xa8')]([_0x8217('0xa9'),_0x8217('0xaa'),'ContactId',_0x8217('0xac'),'VoiceQueueId',_0x8217('0x63'),_0x8217('0x64')],squel[_0x8217('0x89')]()['field'](_0x8217('0xa9'),_0x8217('0xa9'))[_0x8217('0x8a')]('\x27'+_0x333c73+'\x27',_0x8217('0xaa'))['field']('id','ContactId')[_0x8217('0x8a')](_0x1ea1ef[_0x8217('0xad')][_0x8217('0x94')](),'ListId')['field'](_0x43a79b[_0x8217('0x52')]['id'][_0x8217('0x94')](),_0x8217('0x69'))[_0x8217('0x8a')]('\x27'+_0x333c73+'\x27',_0x8217('0x63'))[_0x8217('0x8a')]('\x27'+_0x333c73+'\x27','updatedAt')[_0x8217('0x8c')](_0x8217('0xae'))['where'](_0x8217('0xb8'))[_0x8217('0x4b')](_0x8217('0xaf'),_0x1ea1ef['CmListId']['toString']())[_0x8217('0x4b')](_0x8217('0xb0')))[_0x8217('0x94')]();}_0x3471a0['push'](db[_0x8217('0x93')][_0x8217('0x42')](_0x5d1f8e));}return BPromise['all'](_0x3471a0);}})[_0x8217('0x2c')](function(){var _0x371693=[];var _0x546ead=squel['insert']()[_0x8217('0xb6')](_0x8217('0xb9'))[_0x8217('0xa8')]([_0x8217('0xba'),'phone','OrderBy','createdAt',_0x8217('0x64')],squel[_0x8217('0x89')]()[_0x8217('0x8a')]('h.id')[_0x8217('0x8a')](_0x8217('0xbb'))['field'](_0x8217('0xbc'))[_0x8217('0x8a')]('\x27'+_0x333c73+'\x27','createdAt')[_0x8217('0x8a')]('\x27'+_0x333c73+'\x27',_0x8217('0x64'))[_0x8217('0x8c')](_0x8217('0xbd'),'ci')[_0x8217('0x8d')](_0x8217('0xb7'),'h','h.ContactId=ci.CmContactId')[_0x8217('0x4b')](_0x8217('0xbe'),_0x333c73)[_0x8217('0x4b')](_0x8217('0xbf'),_0x8217('0xc0')))['toString']();_0x371693['push'](db[_0x8217('0x93')]['query'](_0x546ead));return BPromise[_0x8217('0x98')](_0x371693);})[_0x8217('0x2c')](function(){return _0x20e110;})[_0x8217('0x2c')](respondWithResult(_0x260105,null))['catch'](handleError(_0x260105,null));};exports[_0x8217('0xc1')]=function(_0xeb6a20,_0x33e024,_0x468e3e){return db[_0x8217('0x3d')][_0x8217('0x37')]({'where':{'id':_0xeb6a20[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x33e024,null))[_0x8217('0x2c')](function(_0x3be08c){if(_0x3be08c){return _0x3be08c[_0x8217('0xc1')](_0xeb6a20['query'][_0x8217('0x88')]);}})[_0x8217('0x2c')](function(_0x546441){if(_0x546441){return db[_0x8217('0x6a')][_0x8217('0x2b')]({'where':{'ListId':_0xeb6a20[_0x8217('0x42')][_0x8217('0x88')],'VoiceQueueId':_0xeb6a20[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](function(){return _0x546441;});}})[_0x8217('0x2c')](respondWithStatusCode(_0x33e024,null))['catch'](handleError(_0x33e024,null));};exports[_0x8217('0xc2')]=function(_0x40e01c,_0x46aea2,_0x416a75){var _0x298222={};var _0x5eac4f={};var _0x68dd75;var _0x4b3c52;return db['VoiceQueue'][_0x8217('0x67')]({'where':{'id':_0x40e01c[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x46aea2,null))['then'](function(_0x13ea2b){if(_0x13ea2b){_0x68dd75=_0x13ea2b;_0x5eac4f[_0x8217('0x41')]=_[_0x8217('0x53')](db[_0x8217('0xa3')]['rawAttributes']);_0x5eac4f[_0x8217('0x42')]=_[_0x8217('0x53')](_0x40e01c['query']);_0x5eac4f['filters']=_[_0x8217('0x44')](_0x5eac4f[_0x8217('0x41')],_0x5eac4f[_0x8217('0x42')]);_0x298222[_0x8217('0x45')]=_[_0x8217('0x44')](_0x5eac4f[_0x8217('0x41')],qs[_0x8217('0x46')](_0x40e01c[_0x8217('0x42')][_0x8217('0x46')]));_0x298222[_0x8217('0x45')]=_0x298222[_0x8217('0x45')][_0x8217('0x54')]?_0x298222['attributes']:_0x5eac4f[_0x8217('0x41')];_0x298222[_0x8217('0x49')]=qs[_0x8217('0x4a')](_0x40e01c[_0x8217('0x42')][_0x8217('0x4a')]);_0x298222[_0x8217('0x4b')]=qs['filters'](_['pick'](_0x40e01c[_0x8217('0x42')],_0x5eac4f[_0x8217('0x43')]));if(_0x40e01c['query'][_0x8217('0x31')]){_0x298222[_0x8217('0x4b')]=_[_0x8217('0x4c')](_0x298222[_0x8217('0x4b')],{'$or':_[_0x8217('0x33')](_0x298222['attributes'],function(_0x5ecb15){var _0x48c488={};_0x48c488[_0x5ecb15]={'$like':'%'+_0x40e01c[_0x8217('0x42')][_0x8217('0x31')]+'%'};return _0x48c488;})});}_0x298222=_[_0x8217('0x4c')]({},_0x298222,_0x40e01c[_0x8217('0x55')]);return _0x68dd75[_0x8217('0xc2')](_0x298222);}})['then'](function(_0x2ad95f){if(_0x2ad95f){_0x4b3c52=_0x2ad95f[_0x8217('0x54')];if(!_0x40e01c['query']['hasOwnProperty'](_0x8217('0x48'))){_0x298222['limit']=qs[_0x8217('0x22')](_0x40e01c[_0x8217('0x42')][_0x8217('0x22')]);_0x298222[_0x8217('0x23')]=qs[_0x8217('0x23')](_0x40e01c[_0x8217('0x42')][_0x8217('0x23')]);}return _0x68dd75[_0x8217('0xc2')](_0x298222);}})[_0x8217('0x2c')](function(_0xbe8b78){if(_0xbe8b78){return _0xbe8b78?{'count':_0x4b3c52,'rows':_0xbe8b78}:null;}})[_0x8217('0x2c')](respondWithResult(_0x46aea2,null))[_0x8217('0x50')](handleError(_0x46aea2,null));};exports[_0x8217('0xc3')]=function(_0x6a1a83,_0x43faee,_0x1babbe){var _0x2f3c42,_0x45e795;return db['VoiceQueue'][_0x8217('0x37')]({'where':{'id':_0x6a1a83[_0x8217('0x52')]['id']}})[_0x8217('0x2c')](handleEntityNotFound(_0x43faee,null))[_0x8217('0x2c')](function(_0x24c901){if(_0x24c901){_0x45e795=_0x24c901;return _0x24c901['addBlackLists'](_0x6a1a83[_0x8217('0x57')][_0x8217('0x88')],_['omit'](_0x6a1a83[_0x8217('0x57')],[_0x8217('0x88'),'id'])||{});}return null;})['spread'](function(_0x45676d){var _0x247f30;_0x2f3c42=_0x45676d||[];var _0x80cb83=[];if(_0x45676d){for(var _0x56d8ab=0x0;_0x56d8ab<_0x45676d[_0x8217('0x54')];_0x56d8ab+=0x1){var _0x3389d9=_0x45676d[_0x56d8ab][_0x8217('0x2d')]({'plain':!![]});_0x247f30=squel[_0x8217('0xc4')]()['into'](_0x8217('0xc5'))['fromQuery'](['phone','ContactId','ListId',_0x8217('0x69'),_0x8217('0x63'),_0x8217('0x64')],squel[_0x8217('0x89')]()[_0x8217('0x8a')](_0x8217('0xa9'),_0x8217('0xa9'))[_0x8217('0x8a')]('id','ContactId')[_0x8217('0x8a')](_0x3389d9[_0x8217('0xad')][_0x8217('0x94')](),_0x8217('0xac'))[_0x8217('0x8a')](_0x6a1a83[_0x8217('0x52')]['id']['toString'](),'VoiceQueueId')[_0x8217('0x8a')](_0x8217('0xc6'),_0x8217('0x63'))[_0x8217('0x8a')](_0x8217('0xc6'),'updatedAt')['from']('cm_contacts')[_0x8217('0x4b')]('deletedAt\x20IS\x20NULL')[_0x8217('0x4b')](_0x8217('0xaf'),_0x3389d9[_0x8217('0xad')][_0x8217('0x94')]())['where'](_0x8217('0xb0')))[_0x8217('0x94')]();_0x80cb83[_0x8217('0x92')](db[_0x8217('0x93')][_0x8217('0x42')](_0x247f30));}return BPromise[_0x8217('0x98')](_0x80cb83);}})[_0x8217('0x2c')](function(){return _0x2f3c42;})[_0x8217('0x2c')](respondWithResult(_0x43faee,null))[_0x8217('0x50')](handleError(_0x43faee,null));};exports[_0x8217('0xc7')]=function(_0x1947ce,_0x5cfb44,_0x52692d){return db[_0x8217('0x3d')][_0x8217('0x37')]({'where':{'id':_0x1947ce[_0x8217('0x52')]['id']}})['then'](handleEntityNotFound(_0x5cfb44,null))[_0x8217('0x2c')](function(_0x57f47a){if(_0x57f47a){return _0x57f47a[_0x8217('0xc7')](_0x1947ce['query'][_0x8217('0x88')]);}})['then'](function(_0x2392f8){if(_0x2392f8){return db[_0x8217('0x71')][_0x8217('0x2b')]({'where':{'ListId':_0x1947ce['query'][_0x8217('0x88')],'VoiceQueueId':_0x1947ce[_0x8217('0x52')]['id']}})['then'](function(){return _0x2392f8;});}})[_0x8217('0x2c')](respondWithStatusCode(_0x5cfb44,null))[_0x8217('0x50')](handleError(_0x5cfb44,null));}; \ No newline at end of file +var _0xcde7=['getHoppers','findOne','CmHopper','order','pick','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','penalty','isNil','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','format','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','push','CmHopperId','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','zip-dir','fast-json-patch','request-promise','mustache','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','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','get','inbound','QueueCampaigns','outbound','ignore','value','includes','type','find','UserProfileResource','error','stack','name','index','map','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','rows','catch','show','params','length','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt'];(function(_0x173fd1,_0x28db53){var _0x36a3d1=function(_0x2f72a4){while(--_0x2f72a4){_0x173fd1['push'](_0x173fd1['shift']());}};_0x36a3d1(++_0x28db53);}(_0xcde7,0x65));var _0x7cde=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xcde7[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7cde('0x0'));var jsonpatch=require(_0x7cde('0x1'));var rp=require(_0x7cde('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7cde('0x3'));var util=require('util');var path=require(_0x7cde('0x4'));var sox=require(_0x7cde('0x5'));var csv=require(_0x7cde('0x6'));var ejs=require(_0x7cde('0x7'));var fs=require('fs');var fs_extra=require(_0x7cde('0x8'));var _=require(_0x7cde('0x9'));var squel=require('squel');var crypto=require(_0x7cde('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7cde('0xb'));var toCsv=require(_0x7cde('0x6'));var querystring=require(_0x7cde('0xc'));var Papa=require(_0x7cde('0xd'));var Redis=require('ioredis');var authService=require(_0x7cde('0xe'));var qs=require(_0x7cde('0xf'));var as=require(_0x7cde('0x10'));var hardwareService=require(_0x7cde('0x11'));var logger=require(_0x7cde('0x12'))(_0x7cde('0x13'));var utils=require(_0x7cde('0x14'));var config=require(_0x7cde('0x15'));var licenseUtil=require(_0x7cde('0x16'));var db=require(_0x7cde('0x17'))['db'];config['redis']=_[_0x7cde('0x18')](config[_0x7cde('0x19')],{'host':_0x7cde('0x1a'),'port':0x18eb});var socket=require(_0x7cde('0x1b'))(new Redis(config[_0x7cde('0x19')]));require(_0x7cde('0x1c'))[_0x7cde('0x1d')](socket);function respondWithStatusCode(_0x2e86a0,_0x2db8a8){_0x2db8a8=_0x2db8a8||0xcc;return function(_0x5c1579){if(_0x5c1579){return _0x2e86a0[_0x7cde('0x1e')](_0x2db8a8);}return _0x2e86a0[_0x7cde('0x1f')](_0x2db8a8)[_0x7cde('0x20')]();};}function respondWithResult(_0x1bad92,_0x1b9ff1){_0x1b9ff1=_0x1b9ff1||0xc8;return function(_0x21a230){if(_0x21a230){return _0x1bad92[_0x7cde('0x1f')](_0x1b9ff1)[_0x7cde('0x21')](_0x21a230);}};}function respondWithFilteredResult(_0x2cfe03,_0x1d8924){return function(_0x87ebf0){if(_0x87ebf0){var _0x3f2e82=typeof _0x1d8924[_0x7cde('0x22')]==='undefined'&&typeof _0x1d8924[_0x7cde('0x23')]===_0x7cde('0x24');var _0xf257a5=_0x87ebf0['count'];var _0x248e95=_0x3f2e82?0x0:_0x1d8924[_0x7cde('0x22')];var _0x5dbf34=_0x3f2e82?_0x87ebf0[_0x7cde('0x25')]:_0x1d8924[_0x7cde('0x22')]+_0x1d8924[_0x7cde('0x23')];var _0x3bf3be;if(_0x5dbf34>=_0xf257a5){_0x5dbf34=_0xf257a5;_0x3bf3be=0xc8;}else{_0x3bf3be=0xce;}_0x2cfe03[_0x7cde('0x1f')](_0x3bf3be);return _0x2cfe03[_0x7cde('0x26')](_0x7cde('0x27'),_0x248e95+'-'+_0x5dbf34+'/'+_0xf257a5)[_0x7cde('0x21')](_0x87ebf0);}return null;};}function patchUpdates(_0x4ee923){return function(_0x10ba0d){try{jsonpatch['apply'](_0x10ba0d,_0x4ee923,!![]);}catch(_0x5735fe){return BPromise['reject'](_0x5735fe);}return _0x10ba0d[_0x7cde('0x28')]();};}function saveUpdates(_0x584ffc,_0xb28727){return function(_0x447a4e){if(_0x447a4e){return _0x447a4e[_0x7cde('0x29')](_0x584ffc)['then'](function(_0x4b25e3){return _0x4b25e3;});}return null;};}function removeEntity(_0x219296,_0x591cfa){return function(_0x44fc7e){if(_0x44fc7e){return _0x44fc7e[_0x7cde('0x2a')]()[_0x7cde('0x2b')](function(){var _0x4b28b2=_0x44fc7e[_0x7cde('0x2c')]({'plain':!![]});var _0x44d650=[{'name':'VoiceQueues','value':_0x7cde('0x2d'),'ignore':![]},{'name':_0x7cde('0x2e'),'value':_0x7cde('0x2f'),'ignore':![]}];var _0x2fbd85=_(_0x44d650)['filter'](_0x7cde('0x30'))['map']('value')[_0x7cde('0x31')]();if(_[_0x7cde('0x32')](_0x2fbd85,_0x4b28b2[_0x7cde('0x33')])){return;}var _0x360d31=_[_0x7cde('0x34')](_0x44d650,[_0x7cde('0x31'),_0x4b28b2['type']])['name'];return db[_0x7cde('0x35')][_0x7cde('0x2a')]({'where':{'type':_0x360d31,'resourceId':_0x4b28b2['id']}})[_0x7cde('0x2b')](function(){return _0x44fc7e;});})[_0x7cde('0x2b')](function(){_0x219296['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x816d25,_0x43ffa0){return function(_0x2caa17){if(!_0x2caa17){_0x816d25[_0x7cde('0x1e')](0x194);}return _0x2caa17;};}function handleError(_0x43b7af,_0x4b6566){_0x4b6566=_0x4b6566||0x1f4;return function(_0x5d0969){logger[_0x7cde('0x36')](_0x5d0969[_0x7cde('0x37')]);if(_0x5d0969[_0x7cde('0x38')]){delete _0x5d0969[_0x7cde('0x38')];}_0x43b7af[_0x7cde('0x1f')](_0x4b6566)['send'](_0x5d0969);};}exports[_0x7cde('0x39')]=function(_0x253c59,_0x446ef7){var _0x46b852={},_0xa0251d={},_0x50ac2b={'count':0x0,'rows':[]};var _0x19a6c2=_[_0x7cde('0x3a')](db[_0x7cde('0x3b')][_0x7cde('0x3c')],function(_0x44c35e){return{'name':_0x44c35e[_0x7cde('0x3d')],'type':_0x44c35e[_0x7cde('0x33')][_0x7cde('0x3e')]};});_0xa0251d[_0x7cde('0x3f')]=_[_0x7cde('0x3a')](_0x19a6c2,_0x7cde('0x38'));_0xa0251d[_0x7cde('0x40')]=_[_0x7cde('0x41')](_0x253c59['query']);_0xa0251d[_0x7cde('0x42')]=_[_0x7cde('0x43')](_0xa0251d[_0x7cde('0x3f')],_0xa0251d[_0x7cde('0x40')]);_0x46b852[_0x7cde('0x44')]=_[_0x7cde('0x43')](_0xa0251d[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x253c59[_0x7cde('0x40')][_0x7cde('0x45')]));_0x46b852[_0x7cde('0x44')]=_0x46b852[_0x7cde('0x44')]['length']?_0x46b852[_0x7cde('0x44')]:_0xa0251d[_0x7cde('0x3f')];if(!_0x253c59[_0x7cde('0x40')][_0x7cde('0x46')](_0x7cde('0x47'))){_0x46b852['limit']=qs[_0x7cde('0x23')](_0x253c59[_0x7cde('0x40')][_0x7cde('0x23')]);_0x46b852['offset']=qs['offset'](_0x253c59[_0x7cde('0x40')]['offset']);}_0x46b852['order']=qs[_0x7cde('0x48')](_0x253c59[_0x7cde('0x40')][_0x7cde('0x48')]);_0x46b852[_0x7cde('0x49')]=qs[_0x7cde('0x42')](_['pick'](_0x253c59['query'],_0xa0251d['filters']),_0x19a6c2);if(_0x253c59[_0x7cde('0x40')][_0x7cde('0x4a')]){_0x46b852[_0x7cde('0x49')]=_['merge'](_0x46b852[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x19a6c2,function(_0x29529d){if(_0x29529d[_0x7cde('0x33')]!==_0x7cde('0x4b')){var _0x516cde={};_0x516cde[_0x29529d[_0x7cde('0x38')]]={'$like':'%'+_0x253c59[_0x7cde('0x40')][_0x7cde('0x4a')]+'%'};return _0x516cde;}})});}_0x46b852=_[_0x7cde('0x4c')]({},_0x46b852,_0x253c59[_0x7cde('0x4d')]);var _0x18f505={'where':_0x46b852[_0x7cde('0x49')]};return db[_0x7cde('0x3b')]['count'](_0x18f505)[_0x7cde('0x2b')](function(_0x20f754){_0x50ac2b['count']=_0x20f754;if(_0x253c59[_0x7cde('0x40')]['includeAll']){_0x46b852['include']=[{'all':!![]}];}return db[_0x7cde('0x3b')]['findAll'](_0x46b852);})[_0x7cde('0x2b')](function(_0x43f02a){_0x50ac2b[_0x7cde('0x4e')]=_0x43f02a;return _0x50ac2b;})[_0x7cde('0x2b')](respondWithFilteredResult(_0x446ef7,_0x46b852))[_0x7cde('0x4f')](handleError(_0x446ef7,null));};exports[_0x7cde('0x50')]=function(_0x1c7484,_0x8dc8a1){var _0x57813d={'raw':![],'where':{'id':_0x1c7484[_0x7cde('0x51')]['id']}},_0x56e8a2={};_0x56e8a2[_0x7cde('0x3f')]=_['keys'](db[_0x7cde('0x3b')][_0x7cde('0x3c')]);_0x56e8a2[_0x7cde('0x40')]=_[_0x7cde('0x41')](_0x1c7484[_0x7cde('0x40')]);_0x56e8a2[_0x7cde('0x42')]=_['intersection'](_0x56e8a2[_0x7cde('0x3f')],_0x56e8a2[_0x7cde('0x40')]);_0x57813d['attributes']=_[_0x7cde('0x43')](_0x56e8a2[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x1c7484[_0x7cde('0x40')][_0x7cde('0x45')]));_0x57813d[_0x7cde('0x44')]=_0x57813d[_0x7cde('0x44')][_0x7cde('0x52')]?_0x57813d['attributes']:_0x56e8a2[_0x7cde('0x3f')];if(_0x1c7484['query'][_0x7cde('0x53')]){_0x57813d[_0x7cde('0x54')]=[{'all':!![]}];}_0x57813d=_[_0x7cde('0x4c')]({},_0x57813d,_0x1c7484[_0x7cde('0x4d')]);return db['VoiceQueue']['find'](_0x57813d)[_0x7cde('0x2b')](handleEntityNotFound(_0x8dc8a1,null))[_0x7cde('0x2b')](respondWithResult(_0x8dc8a1,null))[_0x7cde('0x4f')](handleError(_0x8dc8a1,null));};exports['create']=function(_0x11e0c0,_0x5026b6){return db[_0x7cde('0x3b')][_0x7cde('0x55')](_0x11e0c0[_0x7cde('0x56')],{})[_0x7cde('0x2b')](function(_0x83ba12){var _0x33a62d=_0x11e0c0[_0x7cde('0x57')][_0x7cde('0x2c')]({'plain':!![]});if(!_0x33a62d)throw new Error(_0x7cde('0x58'));if(_0x33a62d[_0x7cde('0x59')]===_0x7cde('0x57')){var _0x47947c=_0x83ba12['get']({'plain':!![]});var _0x3dd510=[{'name':_0x7cde('0x5a'),'value':_0x7cde('0x2d')},{'name':'QueueCampaigns','value':_0x7cde('0x2f')}];var _0x4a8cde=_['find'](_0x3dd510,[_0x7cde('0x31'),_0x47947c[_0x7cde('0x33')]])['name'];return db[_0x7cde('0x5b')][_0x7cde('0x34')]({'where':{'name':_0x4a8cde,'userProfileId':_0x33a62d[_0x7cde('0x5c')]},'raw':!![]})[_0x7cde('0x2b')](function(_0x173b75){if(_0x173b75&&_0x173b75[_0x7cde('0x5d')]===0x0){return db[_0x7cde('0x35')][_0x7cde('0x55')]({'name':_0x47947c[_0x7cde('0x38')],'resourceId':_0x47947c['id'],'type':_0x173b75['name'],'sectionId':_0x173b75['id']},{})['then'](function(){return _0x83ba12;});}else{return _0x83ba12;}})[_0x7cde('0x4f')](function(_0x4af35b){logger['error'](_0x7cde('0x5e'),_0x4af35b);throw _0x4af35b;});}return _0x83ba12;})['then'](respondWithResult(_0x5026b6,0xc9))[_0x7cde('0x4f')](handleError(_0x5026b6,null));};exports[_0x7cde('0x5f')]=function(_0x5229e4,_0x4029a0){var _0x59fd8e={'where':{'id':_0x5229e4[_0x7cde('0x51')]['id']}},_0x3e0725={};_0x3e0725['model']=_[_0x7cde('0x41')](db['VoiceQueue']['rawAttributes']);_0x59fd8e[_0x7cde('0x44')]=_['intersection'](_0x3e0725[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x5229e4[_0x7cde('0x40')]['fields']));_0x59fd8e[_0x7cde('0x44')]=_0x59fd8e[_0x7cde('0x44')][_0x7cde('0x52')]?_0x59fd8e[_0x7cde('0x44')]:_0x3e0725[_0x7cde('0x3f')];if(_0x5229e4[_0x7cde('0x40')][_0x7cde('0x53')]){_0x59fd8e[_0x7cde('0x54')]=[{'all':!![]}];}_0x59fd8e=_['merge']({},_0x59fd8e,_0x5229e4[_0x7cde('0x4d')]);return db[_0x7cde('0x3b')]['find'](_0x59fd8e)[_0x7cde('0x2b')](handleEntityNotFound(_0x4029a0,null))[_0x7cde('0x2b')](function(_0x13deb6){if(_0x13deb6){var _0x3f025d=_0x13deb6[_0x7cde('0x2c')]({'plain':!![]});_0x3f025d=qs[_0x7cde('0x60')](_0x3f025d,['id',_0x7cde('0x61'),_0x7cde('0x62')]);_0x5229e4['body']=_['omit'](_0x5229e4[_0x7cde('0x56')],['id',_0x7cde('0x61'),_0x7cde('0x62')]);return db[_0x7cde('0x3b')][_0x7cde('0x55')](_[_0x7cde('0x4c')](_0x3f025d,_0x5229e4['body']),{'include':_0x5229e4[_0x7cde('0x40')][_0x7cde('0x53')]?[{'all':!![]}]:undefined})[_0x7cde('0x2b')](function(_0x37bff8){var _0x37322c=_0x5229e4[_0x7cde('0x57')][_0x7cde('0x2c')]({'plain':!![]});if(!_0x37322c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37322c[_0x7cde('0x59')]==='user'){var _0x33ef15=_0x37bff8[_0x7cde('0x2c')]({'plain':!![]});var _0x1b70ad=[{'name':_0x7cde('0x5a'),'value':_0x7cde('0x2d')},{'name':_0x7cde('0x2e'),'value':_0x7cde('0x2f')}];var _0x299574=_[_0x7cde('0x34')](_0x1b70ad,[_0x7cde('0x31'),_0x33ef15[_0x7cde('0x33')]])['name'];return db['UserProfileSection'][_0x7cde('0x34')]({'where':{'name':_0x299574,'userProfileId':_0x37322c[_0x7cde('0x5c')]},'raw':!![]})[_0x7cde('0x2b')](function(_0x1b9bc7){if(_0x1b9bc7&&_0x1b9bc7[_0x7cde('0x5d')]===0x0){return db[_0x7cde('0x35')]['create']({'name':_0x33ef15[_0x7cde('0x38')],'resourceId':_0x33ef15['id'],'type':_0x1b9bc7['name'],'sectionId':_0x1b9bc7['id']},{})['then'](function(){return _0x37bff8;});}else{return _0x37bff8;}})[_0x7cde('0x4f')](function(_0x67e43b){logger['error'](_0x7cde('0x5e'),_0x67e43b);throw _0x67e43b;});}return _0x37bff8;});}})[_0x7cde('0x2b')](respondWithResult(_0x4029a0,0xc9))[_0x7cde('0x4f')](handleError(_0x4029a0,null));};exports[_0x7cde('0x29')]=function(_0x125382,_0x4e577d){if(_0x125382[_0x7cde('0x56')]['id']){delete _0x125382[_0x7cde('0x56')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x125382[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x4e577d,null))['then'](saveUpdates(_0x125382[_0x7cde('0x56')],null))[_0x7cde('0x2b')](respondWithResult(_0x4e577d,null))['catch'](handleError(_0x4e577d,null));};exports['destroy']=function(_0x68409a,_0xaf9221){return db[_0x7cde('0x3b')][_0x7cde('0x34')]({'where':{'id':_0x68409a[_0x7cde('0x51')]['id']}})['then'](handleEntityNotFound(_0xaf9221,null))[_0x7cde('0x2b')](removeEntity(_0xaf9221,null))[_0x7cde('0x4f')](handleError(_0xaf9221,null));};exports[_0x7cde('0x63')]=function(_0xde7753,_0x454bfe,_0x445775){var _0x2c89e8={'raw':![],'where':{}};var _0x178e7f={};var _0xc90300={'count':0x0,'rows':[]};return db[_0x7cde('0x3b')][_0x7cde('0x64')]({'where':{'id':_0xde7753['params']['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x454bfe,null))['then'](function(_0x12ff2f){if(_0x12ff2f){_0x178e7f[_0x7cde('0x3f')]=_[_0x7cde('0x41')](db[_0x7cde('0x65')][_0x7cde('0x3c')]);_0x178e7f[_0x7cde('0x40')]=_['keys'](_0xde7753[_0x7cde('0x40')]);_0x178e7f[_0x7cde('0x42')]=_['intersection'](_0x178e7f['model'],_0x178e7f['query']);_0x2c89e8['attributes']=_['intersection'](_0x178e7f['model'],qs[_0x7cde('0x45')](_0xde7753[_0x7cde('0x40')][_0x7cde('0x45')]));_0x2c89e8['attributes']=_0x2c89e8[_0x7cde('0x44')][_0x7cde('0x52')]?_0x2c89e8[_0x7cde('0x44')]:_0x178e7f[_0x7cde('0x3f')];if(!_0xde7753['query'][_0x7cde('0x46')]('nolimit')){_0x2c89e8[_0x7cde('0x23')]=qs[_0x7cde('0x23')](_0xde7753[_0x7cde('0x40')][_0x7cde('0x23')]);_0x2c89e8['offset']=qs[_0x7cde('0x22')](_0xde7753[_0x7cde('0x40')][_0x7cde('0x22')]);}_0x2c89e8[_0x7cde('0x66')]=qs[_0x7cde('0x48')](_0xde7753[_0x7cde('0x40')][_0x7cde('0x48')]);_0x2c89e8[_0x7cde('0x49')]=qs[_0x7cde('0x42')](_[_0x7cde('0x67')](_0xde7753[_0x7cde('0x40')],_0x178e7f[_0x7cde('0x42')]));_0x2c89e8[_0x7cde('0x49')][_0x7cde('0x68')]=_0x12ff2f['id'];if(_0xde7753['query'][_0x7cde('0x4a')]){_0x2c89e8['where']=_[_0x7cde('0x4c')](_0x2c89e8[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x2c89e8[_0x7cde('0x44')],function(_0x519dd1){var _0x538113={};_0x538113[_0x519dd1]={'$like':'%'+_0xde7753[_0x7cde('0x40')]['filter']+'%'};return _0x538113;})});}_0x2c89e8=_['merge']({},_0x2c89e8,_0xde7753[_0x7cde('0x4d')]);return db[_0x7cde('0x65')][_0x7cde('0x25')]({'where':_0x2c89e8[_0x7cde('0x49')]})[_0x7cde('0x2b')](function(_0x5ec31f){_0xc90300['count']=_0x5ec31f;if(_0xde7753[_0x7cde('0x40')][_0x7cde('0x53')]){_0x2c89e8[_0x7cde('0x54')]=[{'all':!![]}];}return db[_0x7cde('0x65')][_0x7cde('0x69')](_0x2c89e8);})[_0x7cde('0x2b')](function(_0x7d7e6c){_0xc90300[_0x7cde('0x4e')]=_0x7d7e6c;return _0xc90300;});}})['then'](respondWithFilteredResult(_0x454bfe,_0x2c89e8))['catch'](handleError(_0x454bfe,null));};exports[_0x7cde('0x6a')]=function(_0x188698,_0x4926c7,_0x2641c3){var _0x294970={'raw':!![],'where':{}};var _0x3360f5={};var _0x48b44e={'count':0x0,'rows':[]};return db[_0x7cde('0x3b')][_0x7cde('0x64')]({'where':{'id':_0x188698[_0x7cde('0x51')]['id']}})['then'](handleEntityNotFound(_0x4926c7,null))[_0x7cde('0x2b')](function(_0x2ebed9){if(_0x2ebed9){_0x3360f5[_0x7cde('0x3f')]=_[_0x7cde('0x41')](db['CmHopperHistory']['rawAttributes']);_0x3360f5['query']=_['keys'](_0x188698[_0x7cde('0x40')]);_0x3360f5[_0x7cde('0x42')]=_[_0x7cde('0x43')](_0x3360f5[_0x7cde('0x3f')],_0x3360f5[_0x7cde('0x40')]);_0x294970[_0x7cde('0x44')]=_[_0x7cde('0x43')](_0x3360f5[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x188698[_0x7cde('0x40')][_0x7cde('0x45')]));_0x294970[_0x7cde('0x44')]=_0x294970[_0x7cde('0x44')][_0x7cde('0x52')]?_0x294970[_0x7cde('0x44')]:_0x3360f5[_0x7cde('0x3f')];if(!_0x188698[_0x7cde('0x40')][_0x7cde('0x46')](_0x7cde('0x47'))){_0x294970['limit']=qs[_0x7cde('0x23')](_0x188698[_0x7cde('0x40')][_0x7cde('0x23')]);_0x294970[_0x7cde('0x22')]=qs[_0x7cde('0x22')](_0x188698[_0x7cde('0x40')][_0x7cde('0x22')]);}_0x294970[_0x7cde('0x66')]=qs[_0x7cde('0x48')](_0x188698[_0x7cde('0x40')][_0x7cde('0x48')]);_0x294970[_0x7cde('0x49')]=qs[_0x7cde('0x42')](_['pick'](_0x188698['query'],_0x3360f5[_0x7cde('0x42')]));_0x294970[_0x7cde('0x49')]['VoiceQueueId']=_0x2ebed9['id'];if(_0x188698['query']['filter']){_0x294970['where']=_[_0x7cde('0x4c')](_0x294970[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x294970[_0x7cde('0x44')],function(_0x48880b){var _0x4c988f={};_0x4c988f[_0x48880b]={'$like':'%'+_0x188698['query']['filter']+'%'};return _0x4c988f;})});}_0x294970=_[_0x7cde('0x4c')]({},_0x294970,_0x188698[_0x7cde('0x4d')]);return db[_0x7cde('0x6b')][_0x7cde('0x25')]({'where':_0x294970[_0x7cde('0x49')]})[_0x7cde('0x2b')](function(_0x2c60e4){_0x48b44e[_0x7cde('0x25')]=_0x2c60e4;if(_0x188698[_0x7cde('0x40')]['includeAll']){_0x294970['include']=[{'all':!![]}];}return db[_0x7cde('0x6b')][_0x7cde('0x69')](_0x294970);})[_0x7cde('0x2b')](function(_0xd72cb0){_0x48b44e['rows']=_0xd72cb0;return _0x48b44e;});}})[_0x7cde('0x2b')](respondWithFilteredResult(_0x4926c7,_0x294970))['catch'](handleError(_0x4926c7,null));};exports[_0x7cde('0x6c')]=function(_0x1040c1,_0x406679,_0xdde48d){var _0x3c1055={'raw':!![],'where':{}};var _0x37ef83={};var _0x5784d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x7cde('0x64')]({'where':{'id':_0x1040c1[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x406679,null))[_0x7cde('0x2b')](function(_0x2f8518){if(_0x2f8518){_0x37ef83['model']=_[_0x7cde('0x41')](db[_0x7cde('0x6d')][_0x7cde('0x3c')]);_0x37ef83[_0x7cde('0x40')]=_[_0x7cde('0x41')](_0x1040c1[_0x7cde('0x40')]);_0x37ef83[_0x7cde('0x42')]=_['intersection'](_0x37ef83[_0x7cde('0x3f')],_0x37ef83['query']);_0x3c1055['attributes']=_[_0x7cde('0x43')](_0x37ef83['model'],qs[_0x7cde('0x45')](_0x1040c1[_0x7cde('0x40')][_0x7cde('0x45')]));_0x3c1055[_0x7cde('0x44')]=_0x3c1055[_0x7cde('0x44')]['length']?_0x3c1055[_0x7cde('0x44')]:_0x37ef83[_0x7cde('0x3f')];if(!_0x1040c1[_0x7cde('0x40')]['hasOwnProperty'](_0x7cde('0x47'))){_0x3c1055['limit']=qs[_0x7cde('0x23')](_0x1040c1[_0x7cde('0x40')][_0x7cde('0x23')]);_0x3c1055[_0x7cde('0x22')]=qs['offset'](_0x1040c1['query'][_0x7cde('0x22')]);}_0x3c1055['order']=qs['sort'](_0x1040c1[_0x7cde('0x40')][_0x7cde('0x48')]);_0x3c1055[_0x7cde('0x49')]=qs[_0x7cde('0x42')](_[_0x7cde('0x67')](_0x1040c1[_0x7cde('0x40')],_0x37ef83['filters']));_0x3c1055[_0x7cde('0x49')][_0x7cde('0x68')]=_0x2f8518['id'];if(_0x1040c1[_0x7cde('0x40')]['filter']){_0x3c1055[_0x7cde('0x49')]=_[_0x7cde('0x4c')](_0x3c1055[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x3c1055['attributes'],function(_0x10888d){var _0x4e2689={};_0x4e2689[_0x10888d]={'$like':'%'+_0x1040c1['query'][_0x7cde('0x4a')]+'%'};return _0x4e2689;})});}_0x3c1055=_[_0x7cde('0x4c')]({},_0x3c1055,_0x1040c1['options']);return db[_0x7cde('0x6d')][_0x7cde('0x25')]({'where':_0x3c1055[_0x7cde('0x49')]})[_0x7cde('0x2b')](function(_0x3324fb){_0x5784d[_0x7cde('0x25')]=_0x3324fb;if(_0x1040c1[_0x7cde('0x40')][_0x7cde('0x53')]){_0x3c1055[_0x7cde('0x54')]=[{'all':!![]}];}return db[_0x7cde('0x6d')][_0x7cde('0x69')](_0x3c1055);})[_0x7cde('0x2b')](function(_0x5a7936){_0x5784d[_0x7cde('0x4e')]=_0x5a7936;return _0x5784d;});}})['then'](respondWithFilteredResult(_0x406679,_0x3c1055))[_0x7cde('0x4f')](handleError(_0x406679,null));};exports[_0x7cde('0x6e')]=function(_0x787095,_0x10efa3,_0x423d4d){var _0x1c0e41={'raw':!![],'where':{}};var _0x30cd43={};var _0x10ad8f={'count':0x0,'rows':[]};return db[_0x7cde('0x3b')][_0x7cde('0x64')]({'where':{'id':_0x787095[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x10efa3,null))['then'](function(_0x144d5e){if(_0x144d5e){_0x30cd43[_0x7cde('0x3f')]=_[_0x7cde('0x41')](db[_0x7cde('0x6f')][_0x7cde('0x3c')]);_0x30cd43[_0x7cde('0x40')]=_[_0x7cde('0x41')](_0x787095[_0x7cde('0x40')]);_0x30cd43[_0x7cde('0x42')]=_[_0x7cde('0x43')](_0x30cd43[_0x7cde('0x3f')],_0x30cd43['query']);_0x1c0e41[_0x7cde('0x44')]=_[_0x7cde('0x43')](_0x30cd43[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x787095['query'][_0x7cde('0x45')]));_0x1c0e41[_0x7cde('0x44')]=_0x1c0e41[_0x7cde('0x44')][_0x7cde('0x52')]?_0x1c0e41[_0x7cde('0x44')]:_0x30cd43[_0x7cde('0x3f')];if(!_0x787095[_0x7cde('0x40')][_0x7cde('0x46')](_0x7cde('0x47'))){_0x1c0e41[_0x7cde('0x23')]=qs[_0x7cde('0x23')](_0x787095[_0x7cde('0x40')][_0x7cde('0x23')]);_0x1c0e41[_0x7cde('0x22')]=qs['offset'](_0x787095[_0x7cde('0x40')][_0x7cde('0x22')]);}_0x1c0e41['order']=qs[_0x7cde('0x48')](_0x787095['query'][_0x7cde('0x48')]);_0x1c0e41[_0x7cde('0x49')]=qs['filters'](_['pick'](_0x787095[_0x7cde('0x40')],_0x30cd43[_0x7cde('0x42')]));_0x1c0e41['where'][_0x7cde('0x68')]=_0x144d5e['id'];if(_0x787095[_0x7cde('0x40')][_0x7cde('0x4a')]){_0x1c0e41[_0x7cde('0x49')]=_[_0x7cde('0x4c')](_0x1c0e41[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x1c0e41[_0x7cde('0x44')],function(_0x2efd28){var _0x27436a={};_0x27436a[_0x2efd28]={'$like':'%'+_0x787095['query']['filter']+'%'};return _0x27436a;})});}_0x1c0e41=_[_0x7cde('0x4c')]({},_0x1c0e41,_0x787095[_0x7cde('0x4d')]);return db[_0x7cde('0x6f')]['count']({'where':_0x1c0e41[_0x7cde('0x49')]})[_0x7cde('0x2b')](function(_0x16577b){_0x10ad8f[_0x7cde('0x25')]=_0x16577b;if(_0x787095[_0x7cde('0x40')][_0x7cde('0x53')]){_0x1c0e41['include']=[{'all':!![]}];}return db[_0x7cde('0x6f')][_0x7cde('0x69')](_0x1c0e41);})[_0x7cde('0x2b')](function(_0x32be2a){_0x10ad8f[_0x7cde('0x4e')]=_0x32be2a;return _0x10ad8f;});}})[_0x7cde('0x2b')](respondWithFilteredResult(_0x10efa3,_0x1c0e41))['catch'](handleError(_0x10efa3,null));};exports[_0x7cde('0x70')]=function(_0x5221f7,_0x379509,_0x354d2a){var _0x45aefa={};var _0x41fc01={};var _0x32afb8;var _0x3b56bb;return db['VoiceQueue'][_0x7cde('0x64')]({'where':{'id':_0x5221f7[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x379509,null))['then'](function(_0x4153c8){if(_0x4153c8){_0x32afb8=_0x4153c8;_0x41fc01[_0x7cde('0x3f')]=_[_0x7cde('0x41')](db[_0x7cde('0x71')][_0x7cde('0x3c')]);_0x41fc01[_0x7cde('0x40')]=_[_0x7cde('0x41')](_0x5221f7[_0x7cde('0x40')]);_0x41fc01[_0x7cde('0x42')]=_[_0x7cde('0x43')](_0x41fc01[_0x7cde('0x3f')],_0x41fc01[_0x7cde('0x40')]);_0x45aefa[_0x7cde('0x44')]=_[_0x7cde('0x43')](_0x41fc01[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x5221f7[_0x7cde('0x40')][_0x7cde('0x45')]));_0x45aefa[_0x7cde('0x44')]=_0x45aefa[_0x7cde('0x44')][_0x7cde('0x52')]?_0x45aefa[_0x7cde('0x44')]:_0x41fc01['model'];_0x45aefa[_0x7cde('0x66')]=qs['sort'](_0x5221f7['query'][_0x7cde('0x48')]);_0x45aefa[_0x7cde('0x49')]=qs['filters'](_[_0x7cde('0x67')](_0x5221f7[_0x7cde('0x40')],_0x41fc01[_0x7cde('0x42')]));if(_0x5221f7['query']['filter']){_0x45aefa['where']=_[_0x7cde('0x4c')](_0x45aefa[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x45aefa[_0x7cde('0x44')],function(_0xd3b683){var _0x3fced2={};_0x3fced2[_0xd3b683]={'$like':'%'+_0x5221f7[_0x7cde('0x40')]['filter']+'%'};return _0x3fced2;})});}_0x45aefa=_['merge']({},_0x45aefa,_0x5221f7[_0x7cde('0x4d')]);return _0x32afb8['getTeams'](_0x45aefa);}})[_0x7cde('0x2b')](function(_0x3bda7e){if(_0x3bda7e){_0x3b56bb=_0x3bda7e['length'];if(!_0x5221f7['query'][_0x7cde('0x46')](_0x7cde('0x47'))){_0x45aefa['limit']=qs[_0x7cde('0x23')](_0x5221f7['query']['limit']);_0x45aefa[_0x7cde('0x22')]=qs[_0x7cde('0x22')](_0x5221f7[_0x7cde('0x40')][_0x7cde('0x22')]);}return _0x32afb8[_0x7cde('0x70')](_0x45aefa);}})[_0x7cde('0x2b')](function(_0x264822){if(_0x264822){return _0x264822?{'count':_0x3b56bb,'rows':_0x264822}:null;}})[_0x7cde('0x2b')](respondWithResult(_0x379509,null))['catch'](handleError(_0x379509,null));};exports[_0x7cde('0x72')]=function(_0x38590d,_0x29c869,_0x3a7332){var _0xa46571=_0x38590d['body'][_0x7cde('0x73')];var _0x55ca55=_[_0x7cde('0x3a')](_0xa46571,'id');return db[_0x7cde('0x71')][_0x7cde('0x69')]({'where':{'id':_0x55ca55},'attributes':['id'],'include':[{'model':db[_0x7cde('0x74')],'as':_0x7cde('0x75'),'attributes':['id',_0x7cde('0x38'),_0x7cde('0x76'),_0x7cde('0x77'),_0x7cde('0x78')],'raw':!![]}]})[_0x7cde('0x2b')](function(_0x94f7a){if(_0x94f7a){var _0x5391d1=_[_0x7cde('0x79')](_0x94f7a,function(_0x7ef98c){var _0x217859=_0x7ef98c[_0x7cde('0x2c')]({'plain':!![]});_0x217859[_0x7cde('0x75')][_0x7cde('0x7a')](function(_0x5c0aa5){_0x5c0aa5['penalty']=_[_0x7cde('0x34')](_0xa46571,{'id':_0x217859['id']})['penalty'];});return _0x217859[_0x7cde('0x75')];});return db[_0x7cde('0x3b')][_0x7cde('0x34')]({'where':{'id':_0x38590d['params']['id']}})['then'](function(_0x119664){return db[_0x7cde('0x7b')][_0x7cde('0x7c')](function(_0x16b4c9){return _0x119664[_0x7cde('0x72')](_0x55ca55,{'transaction':_0x16b4c9})['then'](function(){return BPromise['each'](_0xa46571,function(_0x5954b8){return db[_0x7cde('0x7d')][_0x7cde('0x7e')]({'TeamId':_0x5954b8['id'],'VoiceQueueId':_0x38590d[_0x7cde('0x51')]['id'],'penalty':_0x5954b8['penalty']},{'transaction':_0x16b4c9});});})[_0x7cde('0x2b')](function(){return BPromise[_0x7cde('0x7f')](_0x5391d1,function(_0x198bf1){return db[_0x7cde('0x80')][_0x7cde('0x81')]({'where':{'UserId':_0x198bf1['id'],'VoiceQueueId':_0x38590d[_0x7cde('0x51')]['id']},'defaults':{'penalty':_0x198bf1[_0x7cde('0x82')]},'transaction':_0x16b4c9});});})[_0x7cde('0x2b')](function(){return BPromise[_0x7cde('0x7f')](_[_0x7cde('0x4a')](_0x5391d1,{'online':!![]}),function(_0x2fd598){return db['UserVoiceQueueRt'][_0x7cde('0x7e')]({'membername':_0x2fd598[_0x7cde('0x38')],'UserId':_0x2fd598['id'],'queue_name':_0x119664[_0x7cde('0x38')],'VoiceQueueId':_0x119664['id'],'interface':_[_0x7cde('0x83')](_0x2fd598[_0x7cde('0x78')])?util['format'](_0x7cde('0x84'),_0x2fd598[_0x7cde('0x38')]):_0x2fd598[_0x7cde('0x78')],'paused':_0x2fd598['voicePause']||![],'penalty':_0x2fd598[_0x7cde('0x82')]},{'transaction':_0x16b4c9});});})[_0x7cde('0x2b')](function(){_0x5391d1[_0x7cde('0x7a')](function(_0x5427fb){socket[_0x7cde('0x85')](_0x7cde('0x86'),{'UserId':_0x5427fb['id'],'VoiceQueueId':_0x119664['id']});});});});});}})[_0x7cde('0x2b')](respondWithStatusCode(_0x29c869,null))['catch'](handleError(_0x29c869,null));};exports[_0x7cde('0x87')]=function(_0x3b3034,_0x514668,_0x2d8527){return db['Team'][_0x7cde('0x69')]({'where':{'id':_0x3b3034[_0x7cde('0x40')][_0x7cde('0x88')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7cde('0x75'),'attributes':['id'],'raw':!![]}]})[_0x7cde('0x2b')](handleEntityNotFound(_0x514668,null))[_0x7cde('0x2b')](function(_0x304044){var _0x1d87a2=_[_0x7cde('0x3a')](_0x304044,'id');var _0x5d6165=[];var _0x78d649=[];var _0x11494d=squel[_0x7cde('0x89')]();_0x11494d[_0x7cde('0x8a')]('tq.TeamId')[_0x7cde('0x8b')]('team_has_voice_queues','tq')['join'](_0x7cde('0x8c'),'ut',_0x7cde('0x8d'))[_0x7cde('0x49')](_0x7cde('0x8e'),_0x3b3034[_0x7cde('0x51')]['id']);for(var _0x48dc14=0x0;_0x48dc14<_0x304044[_0x7cde('0x52')];_0x48dc14+=0x1){let _0x3f2c1d=_0x304044[_0x48dc14];for(var _0x19c598=0x0;_0x19c598<_0x3f2c1d[_0x7cde('0x75')][_0x7cde('0x52')];_0x19c598+=0x1){let _0x3c289b=_0x3f2c1d['Agents'][_0x19c598];var _0x2bb395=_0x11494d['clone']();_0x2bb395[_0x7cde('0x49')](_0x7cde('0x8f'),_0x3c289b['id']);_0x78d649['push'](db[_0x7cde('0x7b')][_0x7cde('0x40')](_0x2bb395['toString'](),{'type':db[_0x7cde('0x7b')]['QueryTypes'][_0x7cde('0x90')]})[_0x7cde('0x2b')](function(_0x2b28de){if(_0x2b28de['length']===0x1){return _0x3c289b['id'];}else{var _0x18956c=_[_0x7cde('0x91')](_[_0x7cde('0x3a')](_0x2b28de,_0x7cde('0x92')),function(_0x2bbaed){return _['includes'](_0x1d87a2,_0x2bbaed);});if(_0x18956c){return _0x3c289b['id'];}}}));}}return BPromise[_0x7cde('0x93')](_0x78d649)[_0x7cde('0x2b')](function(_0x4abc67){_0x5d6165=_(_0x5d6165)[_0x7cde('0x94')](_0x4abc67)[_0x7cde('0x95')]()['value']();return db[_0x7cde('0x3b')][_0x7cde('0x34')]({'where':{'id':_0x3b3034['params']['id']}})[_0x7cde('0x2b')](function(_0xe1643c){return db['sequelize'][_0x7cde('0x7c')](function(_0xd12a03){return _0xe1643c[_0x7cde('0x87')](_0x3b3034['query'][_0x7cde('0x88')],{'transaction':_0xd12a03})[_0x7cde('0x2b')](function(){if(!_[_0x7cde('0x96')](_0x5d6165)){return _0xe1643c[_0x7cde('0x97')](_0x5d6165,{'transaction':_0xd12a03})['then'](function(){return db[_0x7cde('0x98')][_0x7cde('0x2a')]({'where':{'VoiceQueueId':_0x3b3034[_0x7cde('0x51')]['id'],'UserId':_0x5d6165},'transaction':_0xd12a03});});}})[_0x7cde('0x2b')](function(){_0x5d6165['forEach'](function(_0x50faa2){socket[_0x7cde('0x85')](_0x7cde('0x99'),{'UserId':_0x50faa2,'VoiceQueueId':_0xe1643c['id']});});});});});});})[_0x7cde('0x2b')](respondWithStatusCode(_0x514668,null))[_0x7cde('0x4f')](handleError(_0x514668,null));};exports[_0x7cde('0x9a')]=function(_0x2a0f71,_0x4e1bce,_0x3011d7){var _0x1e183b,_0x4bcb71;return db[_0x7cde('0x3b')][_0x7cde('0x34')]({'where':{'id':_0x2a0f71[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x4e1bce,null))['then'](function(_0x4be093){if(_0x4be093){_0x4bcb71=_0x4be093;return _0x4be093['addAgents'](_0x2a0f71[_0x7cde('0x56')][_0x7cde('0x88')],_['omit'](_0x2a0f71[_0x7cde('0x56')],['ids','id'])||{})[_0x7cde('0x9b')](function(_0x500eca){for(var _0x23aa48=0x0;_0x23aa48<_0x2a0f71[_0x7cde('0x56')][_0x7cde('0x88')][_0x7cde('0x52')];_0x23aa48+=0x1){socket[_0x7cde('0x85')](_0x7cde('0x86'),{'UserId':Number(_0x2a0f71[_0x7cde('0x56')][_0x7cde('0x88')][_0x23aa48]),'VoiceQueueId':Number(_0x2a0f71[_0x7cde('0x51')]['id'])});}return _0x500eca;});}})[_0x7cde('0x2b')](function(_0x22e169){_0x1e183b=_0x22e169||[];if(_0x4bcb71){return db['User'][_0x7cde('0x69')]({'where':{'id':_0x2a0f71['body']['ids']},'attributes':['id',_0x7cde('0x38'),_0x7cde('0x76'),'voicePause','interface'],'raw':!![]});}})[_0x7cde('0x2b')](function(_0x16bbbf){if(!_['isEmpty'](_0x16bbbf)){var _0x2ddb42=[];for(var _0x355c44=0x0;_0x355c44<_0x16bbbf[_0x7cde('0x52')];_0x355c44++){if(_0x16bbbf[_0x355c44][_0x7cde('0x76')]){_0x2ddb42['push'](db[_0x7cde('0x98')][_0x7cde('0x7e')]({'membername':_0x16bbbf[_0x355c44]['name'],'UserId':_0x16bbbf[_0x355c44]['id'],'queue_name':_0x4bcb71[_0x7cde('0x38')],'VoiceQueueId':_0x4bcb71['id'],'interface':_[_0x7cde('0x83')](_0x16bbbf[_0x355c44]['interface'])?util[_0x7cde('0x9c')](_0x7cde('0x84'),_0x16bbbf[_0x355c44][_0x7cde('0x38')]):_0x16bbbf[_0x355c44][_0x7cde('0x78')],'paused':_0x16bbbf[_0x355c44]['voicePause']||![],'penalty':_0x2a0f71[_0x7cde('0x56')][_0x7cde('0x82')]||0x0}));}}return BPromise['all'](_0x2ddb42);}})['then'](function(){return _0x1e183b;})[_0x7cde('0x2b')](respondWithResult(_0x4e1bce,null))[_0x7cde('0x4f')](handleError(_0x4e1bce,null));};exports[_0x7cde('0x97')]=function(_0x20b560,_0x532c73,_0x322be8){return db[_0x7cde('0x3b')]['find']({'where':{'id':_0x20b560[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x532c73,null))[_0x7cde('0x2b')](function(_0x2b801f){if(_0x2b801f){return _0x2b801f[_0x7cde('0x97')](_0x20b560[_0x7cde('0x40')][_0x7cde('0x88')])['then'](function(){if(_[_0x7cde('0x9d')](_0x20b560[_0x7cde('0x40')]['ids'])){for(var _0x4a3f61=0x0;_0x4a3f61<_0x20b560[_0x7cde('0x40')][_0x7cde('0x88')]['length'];_0x4a3f61+=0x1){socket[_0x7cde('0x85')](_0x7cde('0x99'),{'UserId':Number(_0x20b560[_0x7cde('0x40')]['ids'][_0x4a3f61]),'VoiceQueueId':Number(_0x20b560[_0x7cde('0x51')]['id'])});}}else{socket[_0x7cde('0x85')](_0x7cde('0x99'),{'UserId':Number(_0x20b560[_0x7cde('0x40')][_0x7cde('0x88')]),'VoiceQueueId':Number(_0x20b560[_0x7cde('0x51')]['id'])});}});}})[_0x7cde('0x2b')](function(_0x316255){return db[_0x7cde('0x98')][_0x7cde('0x2a')]({'where':{'VoiceQueueId':_0x20b560[_0x7cde('0x51')]['id'],'UserId':_0x20b560[_0x7cde('0x40')]['ids']}})[_0x7cde('0x2b')](function(){return _0x316255;});})['then'](respondWithStatusCode(_0x532c73,null))['catch'](handleError(_0x532c73,null));};exports[_0x7cde('0x9e')]=function(_0x12dd3c,_0x47866a,_0x374a87){var _0x30e9bb={};var _0x53566d={};var _0x1443f3;var _0x2c05c3;return db[_0x7cde('0x3b')][_0x7cde('0x64')]({'where':{'id':_0x12dd3c[_0x7cde('0x51')]['id']}})['then'](handleEntityNotFound(_0x47866a,null))['then'](function(_0x45469b){if(_0x45469b){_0x1443f3=_0x45469b;_0x53566d[_0x7cde('0x3f')]=_[_0x7cde('0x41')](db[_0x7cde('0x74')]['rawAttributes']);_0x53566d[_0x7cde('0x40')]=_[_0x7cde('0x41')](_0x12dd3c[_0x7cde('0x40')]);_0x53566d[_0x7cde('0x42')]=_['intersection'](_0x53566d[_0x7cde('0x3f')],_0x53566d[_0x7cde('0x40')]);_0x30e9bb[_0x7cde('0x44')]=_['intersection'](_0x53566d['model'],qs[_0x7cde('0x45')](_0x12dd3c[_0x7cde('0x40')][_0x7cde('0x45')]));_0x30e9bb[_0x7cde('0x44')]=_0x30e9bb[_0x7cde('0x44')][_0x7cde('0x52')]?_0x30e9bb[_0x7cde('0x44')]:_0x53566d[_0x7cde('0x3f')];_0x30e9bb[_0x7cde('0x66')]=qs[_0x7cde('0x48')](_0x12dd3c[_0x7cde('0x40')][_0x7cde('0x48')]);_0x30e9bb[_0x7cde('0x49')]=qs[_0x7cde('0x42')](_[_0x7cde('0x67')](_0x12dd3c[_0x7cde('0x40')],_0x53566d['filters']));if(_0x12dd3c[_0x7cde('0x40')]['filter']){_0x30e9bb[_0x7cde('0x49')]=_[_0x7cde('0x4c')](_0x30e9bb[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x30e9bb[_0x7cde('0x44')],function(_0x533d74){var _0x16367c={};_0x16367c[_0x533d74]={'$like':'%'+_0x12dd3c['query'][_0x7cde('0x4a')]+'%'};return _0x16367c;})});}_0x30e9bb=_['merge']({},_0x30e9bb,_0x12dd3c[_0x7cde('0x4d')]);return _0x1443f3[_0x7cde('0x9e')](_0x30e9bb);}})[_0x7cde('0x2b')](function(_0x5d7bb9){if(_0x5d7bb9){_0x2c05c3=_0x5d7bb9[_0x7cde('0x52')];if(!_0x12dd3c['query'][_0x7cde('0x46')](_0x7cde('0x47'))){_0x30e9bb[_0x7cde('0x23')]=qs[_0x7cde('0x23')](_0x12dd3c[_0x7cde('0x40')][_0x7cde('0x23')]);_0x30e9bb[_0x7cde('0x22')]=qs['offset'](_0x12dd3c[_0x7cde('0x40')][_0x7cde('0x22')]);}return _0x1443f3[_0x7cde('0x9e')](_0x30e9bb);}})['then'](function(_0x1231cb){if(_0x1231cb){return _0x1231cb?{'count':_0x2c05c3,'rows':_0x1231cb}:null;}})['then'](respondWithResult(_0x47866a,null))[_0x7cde('0x4f')](handleError(_0x47866a,null));};exports[_0x7cde('0x9f')]=function(_0x31962c,_0x21dc4c,_0x440196){var _0x129d7d={};var _0x44fcca={};var _0x4bb30a;var _0x10ed95;return db[_0x7cde('0x3b')][_0x7cde('0x64')]({'where':{'id':_0x31962c[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x21dc4c,null))['then'](function(_0x4f4bbb){if(_0x4f4bbb){_0x4bb30a=_0x4f4bbb;_0x44fcca['model']=_[_0x7cde('0x41')](db['UserVoiceQueueRt']['rawAttributes']);_0x44fcca[_0x7cde('0x40')]=_['keys'](_0x31962c[_0x7cde('0x40')]);_0x44fcca[_0x7cde('0x42')]=_[_0x7cde('0x43')](_0x44fcca[_0x7cde('0x3f')],_0x44fcca[_0x7cde('0x40')]);_0x129d7d[_0x7cde('0x44')]=_[_0x7cde('0x43')](_0x44fcca[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x31962c['query'][_0x7cde('0x45')]));_0x129d7d[_0x7cde('0x44')]=_0x129d7d['attributes'][_0x7cde('0x52')]?_0x129d7d[_0x7cde('0x44')]:_0x44fcca['model'];_0x129d7d[_0x7cde('0x66')]=qs[_0x7cde('0x48')](_0x31962c[_0x7cde('0x40')]['sort']);_0x129d7d['where']=qs[_0x7cde('0x42')](_['pick'](_0x31962c[_0x7cde('0x40')],_0x44fcca[_0x7cde('0x42')]));if(_0x31962c[_0x7cde('0x40')][_0x7cde('0x4a')]){_0x129d7d[_0x7cde('0x49')]=_[_0x7cde('0x4c')](_0x129d7d[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x129d7d['attributes'],function(_0x5b5f5f){var _0x4499bb={};_0x4499bb[_0x5b5f5f]={'$like':'%'+_0x31962c[_0x7cde('0x40')]['filter']+'%'};return _0x4499bb;})});}_0x129d7d=_[_0x7cde('0x4c')]({},_0x129d7d,_0x31962c[_0x7cde('0x4d')]);return _0x4bb30a[_0x7cde('0x9f')](_0x129d7d);}})[_0x7cde('0x2b')](function(_0x538faf){if(_0x538faf){_0x10ed95=_0x538faf['length'];if(!_0x31962c[_0x7cde('0x40')][_0x7cde('0x46')](_0x7cde('0x47'))){_0x129d7d[_0x7cde('0x23')]=qs[_0x7cde('0x23')](_0x31962c['query'][_0x7cde('0x23')]);_0x129d7d[_0x7cde('0x22')]=qs[_0x7cde('0x22')](_0x31962c[_0x7cde('0x40')][_0x7cde('0x22')]);}return _0x4bb30a[_0x7cde('0x9f')](_0x129d7d);}})[_0x7cde('0x2b')](function(_0x30da1b){return _0x30da1b?{'count':_0x10ed95,'rows':_0x30da1b}:null;})[_0x7cde('0x2b')](respondWithResult(_0x21dc4c,null))[_0x7cde('0x4f')](handleError(_0x21dc4c,null));};exports[_0x7cde('0xa0')]=function(_0x1516f8,_0x45a572,_0x4038bb){var _0x74c739={};var _0x17a889={};var _0x400fd4;var _0x12ca05;return db[_0x7cde('0x3b')]['findOne']({'where':{'id':_0x1516f8[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x45a572,null))[_0x7cde('0x2b')](function(_0x2554a5){if(_0x2554a5){_0x400fd4=_0x2554a5;_0x17a889[_0x7cde('0x3f')]=_[_0x7cde('0x41')](db[_0x7cde('0xa1')][_0x7cde('0x3c')]);_0x17a889[_0x7cde('0x40')]=_[_0x7cde('0x41')](_0x1516f8[_0x7cde('0x40')]);_0x17a889[_0x7cde('0x42')]=_['intersection'](_0x17a889['model'],_0x17a889['query']);_0x74c739[_0x7cde('0x44')]=_[_0x7cde('0x43')](_0x17a889[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x1516f8[_0x7cde('0x40')][_0x7cde('0x45')]));_0x74c739[_0x7cde('0x44')]=_0x74c739[_0x7cde('0x44')]['length']?_0x74c739[_0x7cde('0x44')]:_0x17a889['model'];_0x74c739[_0x7cde('0x66')]=qs[_0x7cde('0x48')](_0x1516f8['query'][_0x7cde('0x48')]);_0x74c739[_0x7cde('0x49')]=qs[_0x7cde('0x42')](_['pick'](_0x1516f8['query'],_0x17a889[_0x7cde('0x42')]));if(_0x1516f8[_0x7cde('0x40')][_0x7cde('0x4a')]){_0x74c739[_0x7cde('0x49')]=_[_0x7cde('0x4c')](_0x74c739[_0x7cde('0x49')],{'$or':_[_0x7cde('0x3a')](_0x74c739['attributes'],function(_0x2b6e57){var _0x9d4e47={};_0x9d4e47[_0x2b6e57]={'$like':'%'+_0x1516f8[_0x7cde('0x40')]['filter']+'%'};return _0x9d4e47;})});}_0x74c739=_[_0x7cde('0x4c')]({},_0x74c739,_0x1516f8['options']);return _0x400fd4['getLists'](_0x74c739);}})['then'](function(_0x472462){if(_0x472462){_0x12ca05=_0x472462['length'];if(!_0x1516f8[_0x7cde('0x40')][_0x7cde('0x46')](_0x7cde('0x47'))){_0x74c739[_0x7cde('0x23')]=qs[_0x7cde('0x23')](_0x1516f8['query'][_0x7cde('0x23')]);_0x74c739[_0x7cde('0x22')]=qs[_0x7cde('0x22')](_0x1516f8[_0x7cde('0x40')]['offset']);}return _0x400fd4[_0x7cde('0xa0')](_0x74c739);}})[_0x7cde('0x2b')](function(_0x14d653){if(_0x14d653){return _0x14d653?{'count':_0x12ca05,'rows':_0x14d653}:null;}})[_0x7cde('0x2b')](respondWithResult(_0x45a572,null))[_0x7cde('0x4f')](handleError(_0x45a572,null));};exports[_0x7cde('0xa2')]=function(_0x49fc0d,_0x4a4ebb,_0x22dfaf){var _0x1bdcac=moment()[_0x7cde('0x9c')](_0x7cde('0xa3'));var _0xb5caba,_0x2845d6;return db[_0x7cde('0x3b')][_0x7cde('0x34')]({'where':{'id':_0x49fc0d['params']['id']}})['then'](handleEntityNotFound(_0x4a4ebb,null))[_0x7cde('0x2b')](function(_0x355a2b){if(_0x355a2b){_0x2845d6=_0x355a2b;return _0x355a2b[_0x7cde('0xa2')](_0x49fc0d['body']['ids'],_[_0x7cde('0x60')](_0x49fc0d[_0x7cde('0x56')],[_0x7cde('0x88'),'id'])||{});}return null;})[_0x7cde('0x9b')](function(_0x4ded0e){var _0x296a97;_0xb5caba=_0x4ded0e||[];var _0x153146=[];if(_0x4ded0e){for(var _0x5b52c6=0x0;_0x5b52c6<_0x4ded0e[_0x7cde('0x52')];_0x5b52c6+=0x1){var _0x5e6bee=_0x4ded0e[_0x5b52c6][_0x7cde('0x2c')]({'plain':!![]});_0x2845d6['dialCheckDuplicateType']=_0x49fc0d[_0x7cde('0x56')][_0x7cde('0xa4')]?_0x49fc0d[_0x7cde('0x56')][_0x7cde('0xa4')]:_0x2845d6[_0x7cde('0xa4')];switch(_0x2845d6[_0x7cde('0xa4')]){case _0x7cde('0xa5'):_0x296a97=squel[_0x7cde('0xa6')]()[_0x7cde('0xa7')](_0x7cde('0xa8'))[_0x7cde('0xa9')]([_0x7cde('0xaa'),_0x7cde('0xab'),_0x7cde('0xac'),_0x7cde('0xad'),'VoiceQueueId',_0x7cde('0x61'),_0x7cde('0x62')],squel[_0x7cde('0x89')]()['field'](_0x7cde('0xaa'),'phone')[_0x7cde('0x8a')]('\x27'+_0x1bdcac+'\x27',_0x7cde('0xab'))['field']('id',_0x7cde('0xac'))[_0x7cde('0x8a')](_0x5e6bee[_0x7cde('0xae')][_0x7cde('0xaf')](),_0x7cde('0xad'))['field'](_0x49fc0d[_0x7cde('0x51')]['id'][_0x7cde('0xaf')](),_0x7cde('0x68'))[_0x7cde('0x8a')]('\x27'+_0x1bdcac+'\x27',_0x7cde('0x61'))[_0x7cde('0x8a')]('\x27'+_0x1bdcac+'\x27',_0x7cde('0x62'))['from']('cm_contacts')['where'](_0x7cde('0xb0'))['where'](_0x7cde('0xb1'),_0x5e6bee['CmListId']['toString']())['where'](_0x7cde('0xb2'))[_0x7cde('0x49')](_0x7cde('0xb3'),squel[_0x7cde('0x89')]()['field'](_0x7cde('0xb4'))[_0x7cde('0x8b')](_0x7cde('0xb5'))[_0x7cde('0x49')](_0x7cde('0x8e'),_0x49fc0d[_0x7cde('0x51')]['id'][_0x7cde('0xaf')]()))[_0x7cde('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7cde('0x89')]()['field'](_0x7cde('0xb6'))[_0x7cde('0x8b')](_0x7cde('0xa8'))[_0x7cde('0x49')](_0x7cde('0x8e'),_0x49fc0d[_0x7cde('0x51')]['id'][_0x7cde('0xaf')]())))['toString']();break;case _0x7cde('0xb7'):_0x296a97=squel['insert']()['into']('cm_hopper')[_0x7cde('0xa9')]([_0x7cde('0xaa'),_0x7cde('0xab'),_0x7cde('0xac'),_0x7cde('0xad'),_0x7cde('0x68'),_0x7cde('0x61'),'updatedAt'],squel['select']()[_0x7cde('0x8a')](_0x7cde('0xaa'),_0x7cde('0xaa'))['field']('\x27'+_0x1bdcac+'\x27',_0x7cde('0xab'))[_0x7cde('0x8a')]('id',_0x7cde('0xac'))[_0x7cde('0x8a')](_0x5e6bee[_0x7cde('0xae')][_0x7cde('0xaf')](),_0x7cde('0xad'))['field'](_0x49fc0d[_0x7cde('0x51')]['id'][_0x7cde('0xaf')](),'VoiceQueueId')['field']('\x27'+_0x1bdcac+'\x27',_0x7cde('0x61'))[_0x7cde('0x8a')]('\x27'+_0x1bdcac+'\x27',_0x7cde('0x62'))[_0x7cde('0x8b')](_0x7cde('0xb8'))[_0x7cde('0x49')](_0x7cde('0xb0'))['where'](_0x7cde('0xb1'),_0x5e6bee[_0x7cde('0xae')][_0x7cde('0xaf')]())[_0x7cde('0x49')](_0x7cde('0xb2'))[_0x7cde('0x49')](_0x7cde('0xb3'),squel['select']()[_0x7cde('0x8a')](_0x7cde('0xb6'))[_0x7cde('0x8b')](_0x7cde('0xa8'))[_0x7cde('0x49')](_0x7cde('0x8e'),_0x49fc0d[_0x7cde('0x51')]['id'][_0x7cde('0xaf')]())))[_0x7cde('0xaf')]();break;default:_0x296a97=squel['insert']()[_0x7cde('0xa7')](_0x7cde('0xa8'))['fromQuery']([_0x7cde('0xaa'),_0x7cde('0xab'),_0x7cde('0xac'),'ListId',_0x7cde('0x68'),_0x7cde('0x61'),_0x7cde('0x62')],squel[_0x7cde('0x89')]()[_0x7cde('0x8a')]('phone',_0x7cde('0xaa'))['field']('\x27'+_0x1bdcac+'\x27',_0x7cde('0xab'))[_0x7cde('0x8a')]('id',_0x7cde('0xac'))[_0x7cde('0x8a')](_0x5e6bee[_0x7cde('0xae')][_0x7cde('0xaf')](),_0x7cde('0xad'))['field'](_0x49fc0d[_0x7cde('0x51')]['id'][_0x7cde('0xaf')](),_0x7cde('0x68'))[_0x7cde('0x8a')]('\x27'+_0x1bdcac+'\x27',_0x7cde('0x61'))['field']('\x27'+_0x1bdcac+'\x27','updatedAt')[_0x7cde('0x8b')](_0x7cde('0xb8'))['where']('deletedAt\x20IS\x20NULL')[_0x7cde('0x49')]('ListId\x20=\x20?',_0x5e6bee['CmListId']['toString']())[_0x7cde('0x49')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x153146[_0x7cde('0xb9')](db['sequelize'][_0x7cde('0x40')](_0x296a97));}return BPromise[_0x7cde('0x93')](_0x153146);}})['then'](function(){var _0x281048=[];var _0x1abaa4=squel[_0x7cde('0xa6')]()[_0x7cde('0xa7')]('cm_hopper_additional_phones')[_0x7cde('0xa9')]([_0x7cde('0xba'),_0x7cde('0xaa'),'OrderBy',_0x7cde('0x61'),_0x7cde('0x62')],squel[_0x7cde('0x89')]()[_0x7cde('0x8a')](_0x7cde('0xbb'))['field'](_0x7cde('0xbc'))['field'](_0x7cde('0xbd'))[_0x7cde('0x8a')]('\x27'+_0x1bdcac+'\x27','createdAt')[_0x7cde('0x8a')]('\x27'+_0x1bdcac+'\x27',_0x7cde('0x62'))[_0x7cde('0x8b')](_0x7cde('0xbe'),'ci')['join'](_0x7cde('0xa8'),'h','h.ContactId=ci.CmContactId')[_0x7cde('0x49')](_0x7cde('0xbf'),_0x1bdcac)['where'](_0x7cde('0xc0'),_0x7cde('0xc1')))['toString']();_0x281048['push'](db[_0x7cde('0x7b')][_0x7cde('0x40')](_0x1abaa4));return BPromise[_0x7cde('0x93')](_0x281048);})[_0x7cde('0x2b')](function(){return _0xb5caba;})[_0x7cde('0x2b')](respondWithResult(_0x4a4ebb,null))[_0x7cde('0x4f')](handleError(_0x4a4ebb,null));};exports[_0x7cde('0xc2')]=function(_0x598d5f,_0x36cf75,_0xabb601){return db[_0x7cde('0x3b')][_0x7cde('0x34')]({'where':{'id':_0x598d5f['params']['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x36cf75,null))[_0x7cde('0x2b')](function(_0x13d208){if(_0x13d208){return _0x13d208[_0x7cde('0xc2')](_0x598d5f['query']['ids']);}})[_0x7cde('0x2b')](function(_0x4e7308){if(_0x4e7308){return db[_0x7cde('0x65')][_0x7cde('0x2a')]({'where':{'ListId':_0x598d5f[_0x7cde('0x40')][_0x7cde('0x88')],'VoiceQueueId':_0x598d5f[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](function(){return _0x4e7308;});}})['then'](respondWithStatusCode(_0x36cf75,null))[_0x7cde('0x4f')](handleError(_0x36cf75,null));};exports[_0x7cde('0xc3')]=function(_0x2dfec4,_0xef9a28,_0x4673da){var _0xf24a68={};var _0x1e4ae5={};var _0x3bed3d;var _0x5041ff;return db[_0x7cde('0x3b')][_0x7cde('0x64')]({'where':{'id':_0x2dfec4[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0xef9a28,null))[_0x7cde('0x2b')](function(_0x528a5){if(_0x528a5){_0x3bed3d=_0x528a5;_0x1e4ae5[_0x7cde('0x3f')]=_['keys'](db[_0x7cde('0xa1')]['rawAttributes']);_0x1e4ae5[_0x7cde('0x40')]=_['keys'](_0x2dfec4[_0x7cde('0x40')]);_0x1e4ae5[_0x7cde('0x42')]=_[_0x7cde('0x43')](_0x1e4ae5[_0x7cde('0x3f')],_0x1e4ae5['query']);_0xf24a68[_0x7cde('0x44')]=_[_0x7cde('0x43')](_0x1e4ae5[_0x7cde('0x3f')],qs[_0x7cde('0x45')](_0x2dfec4[_0x7cde('0x40')][_0x7cde('0x45')]));_0xf24a68[_0x7cde('0x44')]=_0xf24a68[_0x7cde('0x44')][_0x7cde('0x52')]?_0xf24a68[_0x7cde('0x44')]:_0x1e4ae5[_0x7cde('0x3f')];_0xf24a68[_0x7cde('0x66')]=qs['sort'](_0x2dfec4[_0x7cde('0x40')][_0x7cde('0x48')]);_0xf24a68[_0x7cde('0x49')]=qs[_0x7cde('0x42')](_[_0x7cde('0x67')](_0x2dfec4[_0x7cde('0x40')],_0x1e4ae5['filters']));if(_0x2dfec4['query']['filter']){_0xf24a68[_0x7cde('0x49')]=_['merge'](_0xf24a68[_0x7cde('0x49')],{'$or':_['map'](_0xf24a68['attributes'],function(_0x2bd329){var _0x3d2db5={};_0x3d2db5[_0x2bd329]={'$like':'%'+_0x2dfec4['query']['filter']+'%'};return _0x3d2db5;})});}_0xf24a68=_[_0x7cde('0x4c')]({},_0xf24a68,_0x2dfec4[_0x7cde('0x4d')]);return _0x3bed3d[_0x7cde('0xc3')](_0xf24a68);}})[_0x7cde('0x2b')](function(_0x342ca4){if(_0x342ca4){_0x5041ff=_0x342ca4[_0x7cde('0x52')];if(!_0x2dfec4[_0x7cde('0x40')][_0x7cde('0x46')](_0x7cde('0x47'))){_0xf24a68[_0x7cde('0x23')]=qs[_0x7cde('0x23')](_0x2dfec4['query'][_0x7cde('0x23')]);_0xf24a68[_0x7cde('0x22')]=qs[_0x7cde('0x22')](_0x2dfec4[_0x7cde('0x40')][_0x7cde('0x22')]);}return _0x3bed3d['getBlackLists'](_0xf24a68);}})[_0x7cde('0x2b')](function(_0x1e0ed7){if(_0x1e0ed7){return _0x1e0ed7?{'count':_0x5041ff,'rows':_0x1e0ed7}:null;}})['then'](respondWithResult(_0xef9a28,null))[_0x7cde('0x4f')](handleError(_0xef9a28,null));};exports[_0x7cde('0xc4')]=function(_0x58e6c7,_0x12bb84,_0x52edc8){var _0x3ab618,_0x4fa982;return db[_0x7cde('0x3b')]['find']({'where':{'id':_0x58e6c7[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x12bb84,null))[_0x7cde('0x2b')](function(_0x205221){if(_0x205221){_0x4fa982=_0x205221;return _0x205221[_0x7cde('0xc4')](_0x58e6c7[_0x7cde('0x56')][_0x7cde('0x88')],_[_0x7cde('0x60')](_0x58e6c7['body'],['ids','id'])||{});}return null;})['spread'](function(_0x2661ec){var _0xf12ba6;_0x3ab618=_0x2661ec||[];var _0x2ba019=[];if(_0x2661ec){for(var _0x4dbe9e=0x0;_0x4dbe9e<_0x2661ec[_0x7cde('0x52')];_0x4dbe9e+=0x1){var _0x31ff60=_0x2661ec[_0x4dbe9e][_0x7cde('0x2c')]({'plain':!![]});_0xf12ba6=squel[_0x7cde('0xa6')]()['into'](_0x7cde('0xc5'))[_0x7cde('0xa9')]([_0x7cde('0xaa'),_0x7cde('0xac'),'ListId','VoiceQueueId',_0x7cde('0x61'),'updatedAt'],squel[_0x7cde('0x89')]()[_0x7cde('0x8a')](_0x7cde('0xaa'),_0x7cde('0xaa'))[_0x7cde('0x8a')]('id',_0x7cde('0xac'))[_0x7cde('0x8a')](_0x31ff60['CmListId'][_0x7cde('0xaf')](),_0x7cde('0xad'))['field'](_0x58e6c7[_0x7cde('0x51')]['id'][_0x7cde('0xaf')](),_0x7cde('0x68'))[_0x7cde('0x8a')](_0x7cde('0xc6'),_0x7cde('0x61'))[_0x7cde('0x8a')](_0x7cde('0xc6'),_0x7cde('0x62'))['from']('cm_contacts')[_0x7cde('0x49')](_0x7cde('0xb0'))[_0x7cde('0x49')](_0x7cde('0xb1'),_0x31ff60[_0x7cde('0xae')]['toString']())[_0x7cde('0x49')](_0x7cde('0xb2')))[_0x7cde('0xaf')]();_0x2ba019[_0x7cde('0xb9')](db[_0x7cde('0x7b')]['query'](_0xf12ba6));}return BPromise[_0x7cde('0x93')](_0x2ba019);}})[_0x7cde('0x2b')](function(){return _0x3ab618;})[_0x7cde('0x2b')](respondWithResult(_0x12bb84,null))[_0x7cde('0x4f')](handleError(_0x12bb84,null));};exports[_0x7cde('0xc7')]=function(_0x2c85e4,_0x2cb620,_0x194f54){return db[_0x7cde('0x3b')]['find']({'where':{'id':_0x2c85e4[_0x7cde('0x51')]['id']}})[_0x7cde('0x2b')](handleEntityNotFound(_0x2cb620,null))[_0x7cde('0x2b')](function(_0x5bf159){if(_0x5bf159){return _0x5bf159['removeBlackLists'](_0x2c85e4[_0x7cde('0x40')][_0x7cde('0x88')]);}})[_0x7cde('0x2b')](function(_0x30a4e0){if(_0x30a4e0){return db[_0x7cde('0x6f')]['destroy']({'where':{'ListId':_0x2c85e4[_0x7cde('0x40')]['ids'],'VoiceQueueId':_0x2c85e4[_0x7cde('0x51')]['id']}})['then'](function(){return _0x30a4e0;});}})[_0x7cde('0x2b')](respondWithStatusCode(_0x2cb620,null))[_0x7cde('0x4f')](handleError(_0x2cb620,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 8f59ff0..073e594 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 _0x883a=['hasOwnProperty','hook','exports','setMaxListeners','update','remove','emit'];(function(_0x5e29b1,_0x5da071){var _0x2e851d=function(_0x5c02b8){while(--_0x5c02b8){_0x5e29b1['push'](_0x5e29b1['shift']());}};_0x2e851d(++_0x5da071);}(_0x883a,0x106));var _0xa883=function(_0xa12bb3,_0x398380){_0xa12bb3=_0xa12bb3-0x0;var _0x184d28=_0x883a[_0xa12bb3];return _0x184d28;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa883('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa883('0x1'),'afterDestroy':_0xa883('0x2')};function emitEvent(_0x2d4051){return function(_0x7501a,_0x4d588a,_0x5e897f){VoiceQueueEvents[_0xa883('0x3')](_0x2d4051+':'+_0x7501a['id'],_0x7501a);VoiceQueueEvents[_0xa883('0x3')](_0x2d4051,_0x7501a);_0x5e897f(null);};}for(var e in events){if(events[_0xa883('0x4')](e)){var event=events[e];VoiceQueue[_0xa883('0x5')](e,emitEvent(event));}}module[_0xa883('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xcfd3=['hasOwnProperty','hook','exports','VoiceQueue','setMaxListeners','save','update','remove','emit'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xcfd3,0x186));var _0x3cfd=function(_0x5f3de3,_0x40f0f5){_0x5f3de3=_0x5f3de3-0x0;var _0x287e0d=_0xcfd3[_0x5f3de3];return _0x287e0d;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x3cfd('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3cfd('0x1')](0x0);var events={'afterCreate':_0x3cfd('0x2'),'afterUpdate':_0x3cfd('0x3'),'afterDestroy':_0x3cfd('0x4')};function emitEvent(_0x170c68){return function(_0x216176,_0x85caab,_0x55d762){VoiceQueueEvents[_0x3cfd('0x5')](_0x170c68+':'+_0x216176['id'],_0x216176);VoiceQueueEvents[_0x3cfd('0x5')](_0x170c68,_0x216176);_0x55d762(null);};}for(var e in events){if(events[_0x3cfd('0x6')](e)){var event=events[e];VoiceQueue[_0x3cfd('0x7')](e,emitEvent(event));}}module[_0x3cfd('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 37e3a92..4910ea8 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x2e9c95,_0x491dd6){var _0x244f23=function(_0x56d8ba){while(--_0x56d8ba){_0x2e9c95['push'](_0x2e9c95['shift']());}};_0x244f23(++_0x491dd6);}(_0x34e8,0x12c));var _0x834e=function(_0x45af4a,_0xdef908){_0x45af4a=_0x45af4a-0x0;var _0x5a824f=_0x34e8[_0x45af4a];return _0x5a824f;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('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(_0x3d39f8,_0x39013b){var _0x599a28=function(_0x35ceab){while(--_0x35ceab){_0x3d39f8['push'](_0x3d39f8['shift']());}};_0x599a28(++_0x39013b);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'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 2a8d454..40d0f01 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 _0xf015=['GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','model','attributes','map','ShowVoiceQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x27cabc,_0x18477a){var _0x3d93e2=function(_0x2e5d63){while(--_0x2e5d63){_0x27cabc['push'](_0x27cabc['shift']());}};_0x3d93e2(++_0x18477a);}(_0xf015,0x141));var _0x5f01=function(_0x24ded0,_0x54a1b7){_0x24ded0=_0x24ded0-0x0;var _0x2b16fa=_0xf015[_0x24ded0];return _0x2b16fa;};'use strict';var _=require(_0x5f01('0x0'));var util=require('util');var moment=require(_0x5f01('0x1'));var BPromise=require(_0x5f01('0x2'));var rs=require(_0x5f01('0x3'));var fs=require('fs');var Redis=require(_0x5f01('0x4'));var db=require(_0x5f01('0x5'))['db'];var utils=require(_0x5f01('0x6'));var logger=require(_0x5f01('0x7'))(_0x5f01('0x8'));var config=require(_0x5f01('0x9'));var jayson=require(_0x5f01('0xa'));var client=jayson[_0x5f01('0xb')][_0x5f01('0xc')]({'port':0x232a});config[_0x5f01('0xd')]=_[_0x5f01('0xe')](config[_0x5f01('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x5f01('0xf'))(new Redis(config[_0x5f01('0xd')]));require(_0x5f01('0x10'))[_0x5f01('0x11')](socket);function respondWithRpcPromise(_0x41bb4b,_0x45c0d6,_0x26c8db){return new BPromise(function(_0x2368c5,_0x4b008e){return client[_0x5f01('0x12')](_0x41bb4b,_0x26c8db)[_0x5f01('0x13')](function(_0x559fb6){logger[_0x5f01('0x14')](_0x5f01('0x15'),_0x45c0d6,_0x5f01('0x16'));logger[_0x5f01('0x17')](_0x5f01('0x18'),_0x45c0d6,_0x5f01('0x16'),JSON[_0x5f01('0x19')](_0x559fb6));if(_0x559fb6[_0x5f01('0x1a')]){if(_0x559fb6[_0x5f01('0x1a')][_0x5f01('0x1b')]===0x1f4){logger['error'](_0x5f01('0x15'),_0x45c0d6,_0x559fb6[_0x5f01('0x1a')][_0x5f01('0x1c')]);return _0x4b008e(_0x559fb6[_0x5f01('0x1a')][_0x5f01('0x1c')]);}logger[_0x5f01('0x1a')](_0x5f01('0x15'),_0x45c0d6,_0x559fb6[_0x5f01('0x1a')][_0x5f01('0x1c')]);return _0x2368c5(_0x559fb6[_0x5f01('0x1a')][_0x5f01('0x1c')]);}else{logger[_0x5f01('0x14')](_0x5f01('0x15'),_0x45c0d6,_0x5f01('0x16'));_0x2368c5(_0x559fb6[_0x5f01('0x1d')][_0x5f01('0x1c')]);}})[_0x5f01('0x1e')](function(_0x221446){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x45c0d6,_0x221446);_0x4b008e(_0x221446);});});}exports[_0x5f01('0x1f')]=function(_0x378aca){var _0x48d2ac=this;return new Promise(function(_0x2c7fc5,_0x278c14){return db[_0x5f01('0x20')][_0x5f01('0x21')]({'raw':_0x378aca['options']?_0x378aca[_0x5f01('0x22')][_0x5f01('0x23')]===undefined?!![]:![]:!![],'where':_0x378aca['options']?_0x378aca[_0x5f01('0x22')][_0x5f01('0x24')]||null:null,'attributes':_0x378aca[_0x5f01('0x22')]?_0x378aca['options']['attributes']||null:null,'limit':_0x378aca['options']?_0x378aca[_0x5f01('0x22')][_0x5f01('0x25')]||null:null,'include':_0x378aca[_0x5f01('0x22')]?_0x378aca[_0x5f01('0x22')]['include']?_['map'](_0x378aca[_0x5f01('0x22')][_0x5f01('0x26')],function(_0x5738a6){return{'model':db[_0x5738a6[_0x5f01('0x27')]],'as':_0x5738a6['as'],'attributes':_0x5738a6[_0x5f01('0x28')],'include':_0x5738a6[_0x5f01('0x26')]?_[_0x5f01('0x29')](_0x5738a6['include'],function(_0x138c0d){return{'model':db[_0x138c0d['model']],'as':_0x138c0d['as'],'attributes':_0x138c0d[_0x5f01('0x28')],'include':_0x138c0d[_0x5f01('0x26')]?_[_0x5f01('0x29')](_0x138c0d[_0x5f01('0x26')],function(_0x1cd794){return{'model':db[_0x1cd794['model']],'as':_0x1cd794['as'],'attributes':_0x1cd794[_0x5f01('0x28')]};}):[]};}):[]};}):[]:[]})[_0x5f01('0x13')](function(_0x47321c){logger[_0x5f01('0x14')](_0x5f01('0x1f'),_0x378aca);logger[_0x5f01('0x17')](_0x5f01('0x1f'),_0x378aca,JSON[_0x5f01('0x19')](_0x47321c));_0x2c7fc5(_0x47321c);})[_0x5f01('0x1e')](function(_0x375435){logger[_0x5f01('0x1a')](_0x5f01('0x1f'),_0x375435[_0x5f01('0x1c')],_0x378aca);_0x278c14(_0x48d2ac[_0x5f01('0x1a')](0x1f4,_0x375435['message']));});});};exports[_0x5f01('0x2a')]=function(_0x35a355){var _0x566d86=this;return new Promise(function(_0x3c02cc,_0x26198d){return db[_0x5f01('0x20')][_0x5f01('0x2b')]({'raw':_0x35a355[_0x5f01('0x22')]?_0x35a355[_0x5f01('0x22')][_0x5f01('0x23')]===undefined?!![]:![]:!![],'where':_0x35a355[_0x5f01('0x22')]?_0x35a355[_0x5f01('0x22')][_0x5f01('0x24')]||null:null,'attributes':_0x35a355[_0x5f01('0x22')]?_0x35a355[_0x5f01('0x22')][_0x5f01('0x28')]||null:null,'include':_0x35a355[_0x5f01('0x22')]?_0x35a355[_0x5f01('0x22')][_0x5f01('0x26')]?_[_0x5f01('0x29')](_0x35a355[_0x5f01('0x22')]['include'],function(_0x489de8){return{'model':db[_0x489de8['model']],'as':_0x489de8['as'],'attributes':_0x489de8[_0x5f01('0x28')],'include':_0x489de8['include']?_[_0x5f01('0x29')](_0x489de8[_0x5f01('0x26')],function(_0x5c549a){return{'model':db[_0x5c549a[_0x5f01('0x27')]],'as':_0x5c549a['as'],'attributes':_0x5c549a[_0x5f01('0x28')],'include':_0x5c549a[_0x5f01('0x26')]?_['map'](_0x5c549a[_0x5f01('0x26')],function(_0x955a4a){return{'model':db[_0x955a4a[_0x5f01('0x27')]],'as':_0x955a4a['as'],'attributes':_0x955a4a[_0x5f01('0x28')]};}):[]};}):[]};}):[]:[]})[_0x5f01('0x13')](function(_0x4ed8b0){logger[_0x5f01('0x14')](_0x5f01('0x2a'),_0x35a355);logger['debug'](_0x5f01('0x2a'),_0x35a355,JSON[_0x5f01('0x19')](_0x4ed8b0));_0x3c02cc(_0x4ed8b0);})[_0x5f01('0x1e')](function(_0x1994d2){logger['error'](_0x5f01('0x2a'),_0x1994d2[_0x5f01('0x1c')],_0x35a355);_0x26198d(_0x566d86[_0x5f01('0x1a')](0x1f4,_0x1994d2[_0x5f01('0x1c')]));});});}; \ No newline at end of file +var _0x4b37=['request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceQueue','options','raw','where','attributes','limit','include','map','model','VoiceQueue','find','ShowVoiceQueue','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','redis','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x314cec,_0x12fccf){var _0x3b2df9=function(_0x2319c9){while(--_0x2319c9){_0x314cec['push'](_0x314cec['shift']());}};_0x3b2df9(++_0x12fccf);}(_0x4b37,0x1af));var _0x74b3=function(_0x54febe,_0xeb01b){_0x54febe=_0x54febe-0x0;var _0x20f7bc=_0x4b37[_0x54febe];return _0x20f7bc;};'use strict';var _=require('lodash');var util=require(_0x74b3('0x0'));var moment=require('moment');var BPromise=require(_0x74b3('0x1'));var rs=require(_0x74b3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x74b3('0x3'));var logger=require(_0x74b3('0x4'))('rpc');var config=require(_0x74b3('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x74b3('0x6')]['http']({'port':0x232a});config[_0x74b3('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x74b3('0x8'))(new Redis(config[_0x74b3('0x7')]));require(_0x74b3('0x9'))[_0x74b3('0xa')](socket);function respondWithRpcPromise(_0xa676bb,_0x1b243d,_0x48d26b){return new BPromise(function(_0xa4693,_0xbd4028){return client[_0x74b3('0xb')](_0xa676bb,_0x48d26b)[_0x74b3('0xc')](function(_0x404715){logger[_0x74b3('0xd')](_0x74b3('0xe'),_0x1b243d,_0x74b3('0xf'));logger[_0x74b3('0x10')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x1b243d,_0x74b3('0xf'),JSON[_0x74b3('0x11')](_0x404715));if(_0x404715[_0x74b3('0x12')]){if(_0x404715[_0x74b3('0x12')][_0x74b3('0x13')]===0x1f4){logger[_0x74b3('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x1b243d,_0x404715[_0x74b3('0x12')][_0x74b3('0x14')]);return _0xbd4028(_0x404715['error'][_0x74b3('0x14')]);}logger[_0x74b3('0x12')](_0x74b3('0xe'),_0x1b243d,_0x404715['error'][_0x74b3('0x14')]);return _0xa4693(_0x404715[_0x74b3('0x12')][_0x74b3('0x14')]);}else{logger[_0x74b3('0xd')](_0x74b3('0xe'),_0x1b243d,'request\x20sent');_0xa4693(_0x404715['result']['message']);}})[_0x74b3('0x15')](function(_0x4e1e09){logger[_0x74b3('0x12')](_0x74b3('0xe'),_0x1b243d,_0x4e1e09);_0xbd4028(_0x4e1e09);});});}exports[_0x74b3('0x16')]=function(_0x4b5101){var _0x147320=this;return new Promise(function(_0x5d18d4,_0x4c9468){return db['VoiceQueue']['findAll']({'raw':_0x4b5101['options']?_0x4b5101[_0x74b3('0x17')][_0x74b3('0x18')]===undefined?!![]:![]:!![],'where':_0x4b5101[_0x74b3('0x17')]?_0x4b5101[_0x74b3('0x17')][_0x74b3('0x19')]||null:null,'attributes':_0x4b5101['options']?_0x4b5101[_0x74b3('0x17')][_0x74b3('0x1a')]||null:null,'limit':_0x4b5101[_0x74b3('0x17')]?_0x4b5101[_0x74b3('0x17')][_0x74b3('0x1b')]||null:null,'include':_0x4b5101[_0x74b3('0x17')]?_0x4b5101[_0x74b3('0x17')][_0x74b3('0x1c')]?_[_0x74b3('0x1d')](_0x4b5101[_0x74b3('0x17')][_0x74b3('0x1c')],function(_0x868dba){return{'model':db[_0x868dba['model']],'as':_0x868dba['as'],'attributes':_0x868dba[_0x74b3('0x1a')],'include':_0x868dba[_0x74b3('0x1c')]?_['map'](_0x868dba[_0x74b3('0x1c')],function(_0x4788da){return{'model':db[_0x4788da[_0x74b3('0x1e')]],'as':_0x4788da['as'],'attributes':_0x4788da[_0x74b3('0x1a')],'include':_0x4788da['include']?_['map'](_0x4788da[_0x74b3('0x1c')],function(_0x33e50d){return{'model':db[_0x33e50d[_0x74b3('0x1e')]],'as':_0x33e50d['as'],'attributes':_0x33e50d[_0x74b3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x74b3('0xc')](function(_0x4395d6){logger['info'](_0x74b3('0x16'),_0x4b5101);logger['debug'](_0x74b3('0x16'),_0x4b5101,JSON[_0x74b3('0x11')](_0x4395d6));_0x5d18d4(_0x4395d6);})['catch'](function(_0x648b81){logger[_0x74b3('0x12')]('GetVoiceQueue',_0x648b81['message'],_0x4b5101);_0x4c9468(_0x147320[_0x74b3('0x12')](0x1f4,_0x648b81['message']));});});};exports['ShowVoiceQueue']=function(_0x3ea216){var _0x21e909=this;return new Promise(function(_0x148a92,_0x56c6a5){return db[_0x74b3('0x1f')][_0x74b3('0x20')]({'raw':_0x3ea216[_0x74b3('0x17')]?_0x3ea216['options'][_0x74b3('0x18')]===undefined?!![]:![]:!![],'where':_0x3ea216[_0x74b3('0x17')]?_0x3ea216['options'][_0x74b3('0x19')]||null:null,'attributes':_0x3ea216[_0x74b3('0x17')]?_0x3ea216[_0x74b3('0x17')][_0x74b3('0x1a')]||null:null,'include':_0x3ea216[_0x74b3('0x17')]?_0x3ea216[_0x74b3('0x17')][_0x74b3('0x1c')]?_[_0x74b3('0x1d')](_0x3ea216['options'][_0x74b3('0x1c')],function(_0x3937b1){return{'model':db[_0x3937b1['model']],'as':_0x3937b1['as'],'attributes':_0x3937b1[_0x74b3('0x1a')],'include':_0x3937b1['include']?_[_0x74b3('0x1d')](_0x3937b1['include'],function(_0x3fadd8){return{'model':db[_0x3fadd8['model']],'as':_0x3fadd8['as'],'attributes':_0x3fadd8[_0x74b3('0x1a')],'include':_0x3fadd8['include']?_[_0x74b3('0x1d')](_0x3fadd8[_0x74b3('0x1c')],function(_0x40b072){return{'model':db[_0x40b072['model']],'as':_0x40b072['as'],'attributes':_0x40b072[_0x74b3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x74b3('0xc')](function(_0x408aad){logger['info'](_0x74b3('0x21'),_0x3ea216);logger['debug'](_0x74b3('0x21'),_0x3ea216,JSON[_0x74b3('0x11')](_0x408aad));_0x148a92(_0x408aad);})[_0x74b3('0x15')](function(_0x2588d4){logger[_0x74b3('0x12')](_0x74b3('0x21'),_0x2588d4[_0x74b3('0x14')],_0x3ea216);_0x56c6a5(_0x21e909[_0x74b3('0x12')](0x1f4,_0x2588d4[_0x74b3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index b153fe8..38a27b2 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 _0x84f4=['save','remove','update','emit','length','voiceQueue:'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x84f4,0x1f2));var _0x484f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84f4[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x484f('0x0'),_0x484f('0x1'),_0x484f('0x2')];function createListener(_0x2703b3,_0xf55da6){return function(_0x519233){_0xf55da6[_0x484f('0x3')](_0x2703b3,_0x519233);};}function removeListener(_0x2d9e30,_0xd752d3){return function(){VoiceQueueEvents['removeListener'](_0x2d9e30,_0xd752d3);};}exports['register']=function(_0x13ee32){for(var _0x331864=0x0,_0x4300df=events[_0x484f('0x4')];_0x331864<_0x4300df;_0x331864++){var _0x50deac=events[_0x331864];var _0x3facc4=createListener(_0x484f('0x5')+_0x50deac,_0x13ee32);VoiceQueueEvents['on'](_0x50deac,_0x3facc4);}}; \ No newline at end of file +var _0xa7ab=['save','update','emit','removeListener','voiceQueue:','./voiceQueue.events'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa7ab,0x83));var _0xba7a=function(_0xb7f7fd,_0x32b72d){_0xb7f7fd=_0xb7f7fd-0x0;var _0x9eb43d=_0xa7ab[_0xb7f7fd];return _0x9eb43d;};'use strict';var VoiceQueueEvents=require(_0xba7a('0x0'));var events=[_0xba7a('0x1'),'remove',_0xba7a('0x2')];function createListener(_0x219691,_0x14cb38){return function(_0x20b778){_0x14cb38[_0xba7a('0x3')](_0x219691,_0x20b778);};}function removeListener(_0x5492da,_0x1b9910){return function(){VoiceQueueEvents[_0xba7a('0x4')](_0x5492da,_0x1b9910);};}exports['register']=function(_0x5946bb){for(var _0x4405b4=0x0,_0x5a9d0b=events['length'];_0x4405b4<_0x5a9d0b;_0x4405b4++){var _0x5511c4=events[_0x4405b4];var _0x39bb74=createListener(_0xba7a('0x5')+_0x5511c4,_0x5946bb);VoiceQueueEvents['on'](_0x5511c4,_0x39bb74);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 1273c25..d94eeb5 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 _0x71f9=['path','connect-timeout','Router','../../components/auth/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x234869,_0x25ce29){var _0xdc5c37=function(_0x1bb15a){while(--_0x1bb15a){_0x234869['push'](_0x234869['shift']());}};_0xdc5c37(++_0x25ce29);}(_0x71f9,0xae));var _0x971f=function(_0xb5d72,_0x1840fc){_0xb5d72=_0xb5d72-0x0;var _0x5759c0=_0x71f9[_0xb5d72];return _0x5759c0;};'use strict';var multer=require(_0x971f('0x0'));var util=require(_0x971f('0x1'));var path=require(_0x971f('0x2'));var timeout=require(_0x971f('0x3'));var express=require('express');var router=express[_0x971f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x971f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x971f('0x6'));router[_0x971f('0x7')]('/',auth[_0x971f('0x8')](),controller[_0x971f('0x9')]);router[_0x971f('0x7')](_0x971f('0xa'),auth[_0x971f('0x8')](),controller[_0x971f('0xb')]);router[_0x971f('0x7')]('/index',auth[_0x971f('0x8')](),controller[_0x971f('0xc')]);router[_0x971f('0x7')](_0x971f('0xd'),auth['isAuthenticated'](),controller[_0x971f('0xe')]);router[_0x971f('0xf')]('/',auth[_0x971f('0x8')](),controller[_0x971f('0x10')]);router[_0x971f('0x11')]('/:id',auth[_0x971f('0x8')](),controller[_0x971f('0x12')]);router[_0x971f('0x13')](_0x971f('0xd'),auth[_0x971f('0x8')](),controller[_0x971f('0x14')]);module[_0x971f('0x15')]=router; \ No newline at end of file +var _0xc77e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5f49ab,_0x256d7c){var _0x1d5301=function(_0x485596){while(--_0x485596){_0x5f49ab['push'](_0x5f49ab['shift']());}};_0x1d5301(++_0x256d7c);}(_0xc77e,0x1c5));var _0xec77=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc77e[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xec77('0x0'));var util=require(_0xec77('0x1'));var path=require(_0xec77('0x2'));var timeout=require(_0xec77('0x3'));var express=require(_0xec77('0x4'));var router=express[_0xec77('0x5')]();var fs_extra=require(_0xec77('0x6'));var auth=require(_0xec77('0x7'));var interaction=require(_0xec77('0x8'));var config=require(_0xec77('0x9'));var controller=require('./voiceQueueReport.controller');router[_0xec77('0xa')]('/',auth[_0xec77('0xb')](),controller[_0xec77('0xc')]);router[_0xec77('0xa')]('/describe',auth[_0xec77('0xb')](),controller[_0xec77('0xd')]);router[_0xec77('0xa')](_0xec77('0xe'),auth[_0xec77('0xb')](),controller[_0xec77('0xf')]);router[_0xec77('0xa')](_0xec77('0x10'),auth[_0xec77('0xb')](),controller[_0xec77('0x11')]);router[_0xec77('0x12')]('/',auth[_0xec77('0xb')](),controller[_0xec77('0x13')]);router[_0xec77('0x14')]('/:id',auth[_0xec77('0xb')](),controller[_0xec77('0x15')]);router['delete'](_0xec77('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xec77('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index afb0849..5ea2c9f 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 _0x96a3=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x96a3,0x13c));var _0x396a=function(_0x329b98,_0x3a7a27){_0x329b98=_0x329b98-0x0;var _0x396553=_0x96a3[_0x329b98];return _0x396553;};'use strict';var Sequelize=require(_0x396a('0x0'));var moment=require('moment');module[_0x396a('0x1')]={'type':{'type':Sequelize[_0x396a('0x2')]},'uniqueid':{'type':Sequelize[_0x396a('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x396a('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x396a('0x3')],'set':function(_0x305a8f){var _0x10d643=moment(_0x305a8f);var _0x33631d=moment(this[_0x396a('0x4')](_0x396a('0x5')))[_0x396a('0x6')](_0x396a('0x7'));var _0x132f71=_0x10d643[_0x396a('0x8')](_0x33631d,_0x396a('0x9'));this['setDataValue'](_0x396a('0xa'),_0x305a8f);this[_0x396a('0xb')]('holdtime',_0x132f71||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x396a('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x396a('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x396a('0x3')]},'queuecallerexit':{'type':Sequelize[_0x396a('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x396a('0x2')],'comment':_0x396a('0xe')},'originalposition':{'type':Sequelize[_0x396a('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x396a('0x2')]},'connectedlinename':{'type':Sequelize[_0x396a('0x2')]},'accountcode':{'type':Sequelize[_0x396a('0x2')]},'context':{'type':Sequelize[_0x396a('0x2')]},'exten':{'type':Sequelize[_0x396a('0x2')]},'priority':{'type':Sequelize[_0x396a('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x396a('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x396a('0x2')]},'transfer':{'type':Sequelize[_0x396a('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x396a('0x2')],'comment':_0x396a('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x396a('0x2')]},'secondDisposition':{'type':Sequelize[_0x396a('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x396a('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4173=['STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','sequelize','moment'];(function(_0x2893c9,_0x5ef769){var _0x209700=function(_0x66af9a){while(--_0x66af9a){_0x2893c9['push'](_0x2893c9['shift']());}};_0x209700(++_0x5ef769);}(_0x4173,0x15c));var _0x3417=function(_0x511598,_0x50cf30){_0x511598=_0x511598-0x0;var _0x505848=_0x4173[_0x511598];return _0x505848;};'use strict';var Sequelize=require(_0x3417('0x0'));var moment=require(_0x3417('0x1'));module['exports']={'type':{'type':Sequelize[_0x3417('0x2')]},'uniqueid':{'type':Sequelize[_0x3417('0x2')]},'calleridnum':{'type':Sequelize[_0x3417('0x2')]},'calleridname':{'type':Sequelize[_0x3417('0x2')]},'queue':{'type':Sequelize[_0x3417('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3417('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3417('0x3')],'set':function(_0x566f29){var _0x5d911d=moment(_0x566f29);var _0x29a77a=moment(this[_0x3417('0x4')](_0x3417('0x5')))[_0x3417('0x6')](_0x3417('0x7'));var _0x5d2e53=_0x5d911d[_0x3417('0x8')](_0x29a77a,_0x3417('0x9'));this[_0x3417('0xa')]('queuecallerleaveAt',_0x566f29);this[_0x3417('0xa')](_0x3417('0xb'),_0x5d2e53||null);}},'position':{'type':Sequelize[_0x3417('0xc')]},'count':{'type':Sequelize[_0x3417('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x3417('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3417('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x3417('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3417('0x3')]},'queuecallerexit':{'type':Sequelize[_0x3417('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3417('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x3417('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x3417('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3417('0x2')]},'connectedlinename':{'type':Sequelize[_0x3417('0x2')]},'accountcode':{'type':Sequelize[_0x3417('0x2')]},'context':{'type':Sequelize[_0x3417('0x2')]},'exten':{'type':Sequelize[_0x3417('0x2')]},'priority':{'type':Sequelize[_0x3417('0x2')]},'holdtime':{'type':Sequelize[_0x3417('0xc')]},'mohtime':{'type':Sequelize[_0x3417('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3417('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3417('0x2')]},'transfer':{'type':Sequelize[_0x3417('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3417('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3417('0x2')]},'disposition':{'type':Sequelize[_0x3417('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3417('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x3417('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index fcf3220..4cb1a75 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 _0x76e8=['getVoiceQueuesReport','rawAttributes','keys','hasOwnProperty','rows','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','VoiceQueueReport','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','options','findAll','show','params','include','catch','create','body','find','describe'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x76e8,0xf2));var _0x876e=function(_0x5be306,_0x18ec4c){_0x5be306=_0x5be306-0x0;var _0x1f74f=_0x76e8[_0x5be306];return _0x1f74f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x876e('0x0'));var zipdir=require(_0x876e('0x1'));var jsonpatch=require(_0x876e('0x2'));var rp=require(_0x876e('0x3'));var moment=require(_0x876e('0x4'));var BPromise=require(_0x876e('0x5'));var Mustache=require('mustache');var util=require(_0x876e('0x6'));var path=require(_0x876e('0x7'));var sox=require(_0x876e('0x8'));var csv=require(_0x876e('0x9'));var ejs=require(_0x876e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x876e('0xb'));var squel=require(_0x876e('0xc'));var crypto=require(_0x876e('0xd'));var jsforce=require(_0x876e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x876e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x876e('0xf'));var authService=require(_0x876e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x876e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x876e('0x12'))('api');var utils=require(_0x876e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x876e('0x14'));var db=require(_0x876e('0x15'))['db'];config[_0x876e('0x16')]=_['defaults'](config[_0x876e('0x16')],{'host':_0x876e('0x17'),'port':0x18eb});var socket=require(_0x876e('0x18'))(new Redis(config['redis']));require(_0x876e('0x19'))[_0x876e('0x1a')](socket);function respondWithStatusCode(_0x2e6bc8,_0x1345ad){_0x1345ad=_0x1345ad||0xcc;return function(_0x31cbb4){if(_0x31cbb4){return _0x2e6bc8['sendStatus'](_0x1345ad);}return _0x2e6bc8[_0x876e('0x1b')](_0x1345ad)[_0x876e('0x1c')]();};}function respondWithResult(_0xab4645,_0x1054ce){_0x1054ce=_0x1054ce||0xc8;return function(_0xe3c891){if(_0xe3c891){return _0xab4645[_0x876e('0x1b')](_0x1054ce)[_0x876e('0x1d')](_0xe3c891);}};}function respondWithFilteredResult(_0x1aa25b,_0xebb3e0){return function(_0x564279){if(_0x564279){var _0x4bfbd8=typeof _0xebb3e0['offset']===_0x876e('0x1e')&&typeof _0xebb3e0[_0x876e('0x1f')]==='undefined';var _0x4db1f7=_0x564279[_0x876e('0x20')];var _0x4b2a7a=_0x4bfbd8?0x0:_0xebb3e0[_0x876e('0x21')];var _0x12aa3d=_0x4bfbd8?_0x564279[_0x876e('0x20')]:_0xebb3e0['offset']+_0xebb3e0[_0x876e('0x1f')];var _0x447b11;if(_0x12aa3d>=_0x4db1f7){_0x12aa3d=_0x4db1f7;_0x447b11=0xc8;}else{_0x447b11=0xce;}_0x1aa25b[_0x876e('0x1b')](_0x447b11);return _0x1aa25b[_0x876e('0x22')](_0x876e('0x23'),_0x4b2a7a+'-'+_0x12aa3d+'/'+_0x4db1f7)[_0x876e('0x1d')](_0x564279);}return null;};}function patchUpdates(_0x5a4062){return function(_0x27c3fe){try{jsonpatch[_0x876e('0x24')](_0x27c3fe,_0x5a4062,!![]);}catch(_0x1a28d7){return BPromise[_0x876e('0x25')](_0x1a28d7);}return _0x27c3fe[_0x876e('0x26')]();};}function saveUpdates(_0x97ae59,_0x4672f5){return function(_0x2aba1b){if(_0x2aba1b){return _0x2aba1b[_0x876e('0x27')](_0x97ae59)[_0x876e('0x28')](function(_0x3abb6a){return _0x3abb6a;});}return null;};}function removeEntity(_0x4d2b2c,_0x51d267){return function(_0x320a0a){if(_0x320a0a){return _0x320a0a[_0x876e('0x29')]()[_0x876e('0x28')](function(){_0x4d2b2c[_0x876e('0x1b')](0xcc)[_0x876e('0x1c')]();});}};}function handleEntityNotFound(_0x324169,_0x339431){return function(_0x1d58fd){if(!_0x1d58fd){_0x324169[_0x876e('0x2a')](0x194);}return _0x1d58fd;};}function handleError(_0x45f722,_0x24e526){_0x24e526=_0x24e526||0x1f4;return function(_0x3bef07){logger[_0x876e('0x2b')](_0x3bef07['stack']);if(_0x3bef07['name']){delete _0x3bef07[_0x876e('0x2c')];}_0x45f722[_0x876e('0x1b')](_0x24e526)['send'](_0x3bef07);};}exports[_0x876e('0x2d')]=function(_0xff9dd4,_0x54b6c8){var _0x216ed2={},_0x5d8623={},_0x24cabd={'count':0x0,'rows':[]};var _0x2d30f9=_[_0x876e('0x2e')](db[_0x876e('0x2f')]['rawAttributes'],function(_0x91a79){return{'name':_0x91a79['fieldName'],'type':_0x91a79['type'][_0x876e('0x30')]};});_0x5d8623['model']=_[_0x876e('0x2e')](_0x2d30f9,_0x876e('0x2c'));_0x5d8623['query']=_['keys'](_0xff9dd4[_0x876e('0x31')]);_0x5d8623['filters']=_[_0x876e('0x32')](_0x5d8623[_0x876e('0x33')],_0x5d8623[_0x876e('0x31')]);_0x216ed2[_0x876e('0x34')]=_[_0x876e('0x32')](_0x5d8623[_0x876e('0x33')],qs['fields'](_0xff9dd4[_0x876e('0x31')][_0x876e('0x35')]));_0x216ed2[_0x876e('0x34')]=_0x216ed2[_0x876e('0x34')][_0x876e('0x36')]?_0x216ed2[_0x876e('0x34')]:_0x5d8623['model'];if(!_0xff9dd4[_0x876e('0x31')]['hasOwnProperty'](_0x876e('0x37'))){_0x216ed2[_0x876e('0x1f')]=qs[_0x876e('0x1f')](_0xff9dd4[_0x876e('0x31')][_0x876e('0x1f')]);_0x216ed2['offset']=qs['offset'](_0xff9dd4[_0x876e('0x31')]['offset']);}_0x216ed2[_0x876e('0x38')]=qs[_0x876e('0x39')](_0xff9dd4[_0x876e('0x31')][_0x876e('0x39')]);_0x216ed2[_0x876e('0x3a')]=qs[_0x876e('0x3b')](_[_0x876e('0x3c')](_0xff9dd4[_0x876e('0x31')],_0x5d8623[_0x876e('0x3b')]),_0x2d30f9);if(_0xff9dd4[_0x876e('0x31')][_0x876e('0x3d')]){_0x216ed2[_0x876e('0x3a')]=_[_0x876e('0x3e')](_0x216ed2[_0x876e('0x3a')],{'$or':_[_0x876e('0x2e')](_0x2d30f9,function(_0x54f2da){if(_0x54f2da[_0x876e('0x3f')]!=='VIRTUAL'){var _0x340dbc={};_0x340dbc[_0x54f2da['name']]={'$like':'%'+_0xff9dd4['query'][_0x876e('0x3d')]+'%'};return _0x340dbc;}})});}_0x216ed2=_['merge']({},_0x216ed2,_0xff9dd4[_0x876e('0x40')]);var _0xf47150={'where':_0x216ed2[_0x876e('0x3a')]};return db[_0x876e('0x2f')][_0x876e('0x20')](_0xf47150)[_0x876e('0x28')](function(_0xf82e81){_0x24cabd[_0x876e('0x20')]=_0xf82e81;if(_0xff9dd4[_0x876e('0x31')]['includeAll']){_0x216ed2['include']=[{'all':!![]}];}return db[_0x876e('0x2f')][_0x876e('0x41')](_0x216ed2);})['then'](function(_0x3ff129){_0x24cabd['rows']=_0x3ff129;return _0x24cabd;})['then'](respondWithFilteredResult(_0x54b6c8,_0x216ed2))['catch'](handleError(_0x54b6c8,null));};exports[_0x876e('0x42')]=function(_0x526647,_0x3c7f14){var _0x37c8a4={'raw':![],'where':{'id':_0x526647[_0x876e('0x43')]['id']}},_0x22dac4={};_0x22dac4[_0x876e('0x33')]=_['keys'](db[_0x876e('0x2f')]['rawAttributes']);_0x22dac4[_0x876e('0x31')]=_['keys'](_0x526647[_0x876e('0x31')]);_0x22dac4['filters']=_['intersection'](_0x22dac4[_0x876e('0x33')],_0x22dac4[_0x876e('0x31')]);_0x37c8a4[_0x876e('0x34')]=_[_0x876e('0x32')](_0x22dac4[_0x876e('0x33')],qs['fields'](_0x526647[_0x876e('0x31')][_0x876e('0x35')]));_0x37c8a4[_0x876e('0x34')]=_0x37c8a4[_0x876e('0x34')][_0x876e('0x36')]?_0x37c8a4[_0x876e('0x34')]:_0x22dac4[_0x876e('0x33')];if(_0x526647['query']['includeAll']){_0x37c8a4[_0x876e('0x44')]=[{'all':!![]}];}_0x37c8a4=_[_0x876e('0x3e')]({},_0x37c8a4,_0x526647['options']);return db[_0x876e('0x2f')]['find'](_0x37c8a4)[_0x876e('0x28')](handleEntityNotFound(_0x3c7f14,null))[_0x876e('0x28')](respondWithResult(_0x3c7f14,null))[_0x876e('0x45')](handleError(_0x3c7f14,null));};exports[_0x876e('0x46')]=function(_0x4c3241,_0x3f695c){return db[_0x876e('0x2f')][_0x876e('0x46')](_0x4c3241[_0x876e('0x47')],{})[_0x876e('0x28')](respondWithResult(_0x3f695c,0xc9))['catch'](handleError(_0x3f695c,null));};exports[_0x876e('0x27')]=function(_0x3517d1,_0x8bd4a1){if(_0x3517d1[_0x876e('0x47')]['id']){delete _0x3517d1[_0x876e('0x47')]['id'];}return db[_0x876e('0x2f')][_0x876e('0x48')]({'where':{'id':_0x3517d1['params']['id']}})['then'](handleEntityNotFound(_0x8bd4a1,null))[_0x876e('0x28')](saveUpdates(_0x3517d1[_0x876e('0x47')],null))[_0x876e('0x28')](respondWithResult(_0x8bd4a1,null))['catch'](handleError(_0x8bd4a1,null));};exports[_0x876e('0x29')]=function(_0x319c05,_0x5ef832){return db['VoiceQueueReport']['find']({'where':{'id':_0x319c05[_0x876e('0x43')]['id']}})[_0x876e('0x28')](handleEntityNotFound(_0x5ef832,null))[_0x876e('0x28')](removeEntity(_0x5ef832,null))[_0x876e('0x45')](handleError(_0x5ef832,null));};exports[_0x876e('0x49')]=function(_0x68605c,_0x1dbc26){return db['VoiceQueueReport'][_0x876e('0x49')]()[_0x876e('0x28')](respondWithResult(_0x1dbc26,null))[_0x876e('0x45')](handleError(_0x1dbc26,null));};exports[_0x876e('0x4a')]=function(_0x2624f2,_0x58c903){var _0x4fba66={},_0x5beb44={},_0x2e016a={'count':0x0,'rows':[]};_0x5beb44[_0x876e('0x33')]=_['keys'](db['VoiceQueueReport'][_0x876e('0x4b')]);_0x5beb44[_0x876e('0x31')]=_[_0x876e('0x4c')](_0x2624f2[_0x876e('0x31')]);_0x5beb44[_0x876e('0x3b')]=_[_0x876e('0x32')](_0x5beb44[_0x876e('0x33')],_0x5beb44[_0x876e('0x31')]);_0x4fba66[_0x876e('0x34')]=_[_0x876e('0x32')](_0x5beb44[_0x876e('0x33')],qs[_0x876e('0x35')](_0x2624f2[_0x876e('0x31')][_0x876e('0x35')]));_0x4fba66[_0x876e('0x34')]=_0x4fba66[_0x876e('0x34')]['length']?_0x4fba66[_0x876e('0x34')]:_0x5beb44[_0x876e('0x33')];if(!_0x2624f2[_0x876e('0x31')][_0x876e('0x4d')](_0x876e('0x37'))){_0x4fba66[_0x876e('0x1f')]=qs[_0x876e('0x1f')](_0x2624f2[_0x876e('0x31')][_0x876e('0x1f')]);_0x4fba66[_0x876e('0x21')]=qs[_0x876e('0x21')](_0x2624f2[_0x876e('0x31')]['offset']);}_0x4fba66[_0x876e('0x38')]=qs[_0x876e('0x39')](_0x2624f2['query'][_0x876e('0x39')]);_0x4fba66['where']=qs['filters'](_[_0x876e('0x3c')](_0x2624f2[_0x876e('0x31')],_0x5beb44[_0x876e('0x3b')]));if(_0x2624f2[_0x876e('0x31')]['filter']){_0x4fba66[_0x876e('0x3a')]=_[_0x876e('0x3e')](_0x4fba66[_0x876e('0x3a')],{'$or':_[_0x876e('0x2e')](_0x4fba66['attributes'],function(_0x2ea0d2){var _0x326f23={};_0x326f23[_0x2ea0d2]={'$like':'%'+_0x2624f2[_0x876e('0x31')][_0x876e('0x3d')]+'%'};return _0x326f23;})});}_0x4fba66=_[_0x876e('0x3e')]({},_0x4fba66,_0x2624f2[_0x876e('0x40')]);var _0x442d71={'where':_0x4fba66[_0x876e('0x3a')]};return db[_0x876e('0x2f')][_0x876e('0x20')](_0x442d71)[_0x876e('0x28')](function(_0x2ab065){_0x2e016a[_0x876e('0x20')]=_0x2ab065;if(_0x2624f2[_0x876e('0x31')]['includeAll']){_0x4fba66[_0x876e('0x44')]=[{'all':!![]}];}return db[_0x876e('0x2f')][_0x876e('0x41')](_0x4fba66);})['then'](function(_0x2cb934){_0x2e016a[_0x876e('0x4e')]=_0x2cb934;return _0x2e016a;})[_0x876e('0x28')](respondWithFilteredResult(_0x58c903,_0x4fba66,_0x876e('0x4a')))['catch'](handleError(_0x58c903,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xd43a=['json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','name','index','VoiceQueueReport','rawAttributes','fieldName','type','key','keys','query','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','map','options','include','catch','params','intersection','model','includeAll','find','create','body','describe','getVoiceQueuesReport','nolimit','sort','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueueReport.socket','end','status'];(function(_0x1b1302,_0x558765){var _0x7c157f=function(_0x40d8e3){while(--_0x40d8e3){_0x1b1302['push'](_0x1b1302['shift']());}};_0x7c157f(++_0x558765);}(_0xd43a,0xd1));var _0xad43=function(_0x1e8f1d,_0x3f4840){_0x1e8f1d=_0x1e8f1d-0x0;var _0x11becd=_0xd43a[_0x1e8f1d];return _0x11becd;};'use strict';var emlformat=require(_0xad43('0x0'));var rimraf=require(_0xad43('0x1'));var zipdir=require(_0xad43('0x2'));var jsonpatch=require(_0xad43('0x3'));var rp=require(_0xad43('0x4'));var moment=require(_0xad43('0x5'));var BPromise=require(_0xad43('0x6'));var Mustache=require(_0xad43('0x7'));var util=require('util');var path=require(_0xad43('0x8'));var sox=require(_0xad43('0x9'));var csv=require(_0xad43('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad43('0xb'));var _=require(_0xad43('0xc'));var squel=require(_0xad43('0xd'));var crypto=require(_0xad43('0xe'));var jsforce=require(_0xad43('0xf'));var deskjs=require(_0xad43('0x10'));var toCsv=require(_0xad43('0xa'));var querystring=require(_0xad43('0x11'));var Papa=require('papaparse');var Redis=require(_0xad43('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xad43('0x13'));var hardwareService=require(_0xad43('0x14'));var logger=require(_0xad43('0x15'))('api');var utils=require(_0xad43('0x16'));var config=require(_0xad43('0x17'));var licenseUtil=require(_0xad43('0x18'));var db=require(_0xad43('0x19'))['db'];config['redis']=_['defaults'](config[_0xad43('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xad43('0x1b'))(new Redis(config[_0xad43('0x1a')]));require(_0xad43('0x1c'))['register'](socket);function respondWithStatusCode(_0x9dfd5d,_0x4442d0){_0x4442d0=_0x4442d0||0xcc;return function(_0x5c0abc){if(_0x5c0abc){return _0x9dfd5d['sendStatus'](_0x4442d0);}return _0x9dfd5d['status'](_0x4442d0)[_0xad43('0x1d')]();};}function respondWithResult(_0x35d038,_0x14d35f){_0x14d35f=_0x14d35f||0xc8;return function(_0x22870b){if(_0x22870b){return _0x35d038[_0xad43('0x1e')](_0x14d35f)[_0xad43('0x1f')](_0x22870b);}};}function respondWithFilteredResult(_0xcc8899,_0x76878){return function(_0x4fde15){if(_0x4fde15){var _0xd79f=typeof _0x76878['offset']===_0xad43('0x20')&&typeof _0x76878['limit']===_0xad43('0x20');var _0x4cc51c=_0x4fde15[_0xad43('0x21')];var _0x1c439c=_0xd79f?0x0:_0x76878[_0xad43('0x22')];var _0x136c0e=_0xd79f?_0x4fde15['count']:_0x76878[_0xad43('0x22')]+_0x76878[_0xad43('0x23')];var _0x218456;if(_0x136c0e>=_0x4cc51c){_0x136c0e=_0x4cc51c;_0x218456=0xc8;}else{_0x218456=0xce;}_0xcc8899['status'](_0x218456);return _0xcc8899[_0xad43('0x24')](_0xad43('0x25'),_0x1c439c+'-'+_0x136c0e+'/'+_0x4cc51c)['json'](_0x4fde15);}return null;};}function patchUpdates(_0x488d90){return function(_0x4b85e4){try{jsonpatch[_0xad43('0x26')](_0x4b85e4,_0x488d90,!![]);}catch(_0x621d5d){return BPromise[_0xad43('0x27')](_0x621d5d);}return _0x4b85e4[_0xad43('0x28')]();};}function saveUpdates(_0x4feb5e,_0x30abd3){return function(_0x15b3d0){if(_0x15b3d0){return _0x15b3d0[_0xad43('0x29')](_0x4feb5e)[_0xad43('0x2a')](function(_0x105aa1){return _0x105aa1;});}return null;};}function removeEntity(_0x1b5bc0,_0x3789ef){return function(_0x1e3c75){if(_0x1e3c75){return _0x1e3c75['destroy']()[_0xad43('0x2a')](function(){_0x1b5bc0['status'](0xcc)[_0xad43('0x1d')]();});}};}function handleEntityNotFound(_0x4a41fb,_0x1c6964){return function(_0x23b99b){if(!_0x23b99b){_0x4a41fb[_0xad43('0x2b')](0x194);}return _0x23b99b;};}function handleError(_0x23996f,_0x5a9c17){_0x5a9c17=_0x5a9c17||0x1f4;return function(_0x56f080){logger['error'](_0x56f080['stack']);if(_0x56f080[_0xad43('0x2c')]){delete _0x56f080[_0xad43('0x2c')];}_0x23996f[_0xad43('0x1e')](_0x5a9c17)['send'](_0x56f080);};}exports[_0xad43('0x2d')]=function(_0x233080,_0x222bf5){var _0x714c9c={},_0x3347d8={},_0x1c352f={'count':0x0,'rows':[]};var _0xdc5fb8=_['map'](db[_0xad43('0x2e')][_0xad43('0x2f')],function(_0x1e110c){return{'name':_0x1e110c[_0xad43('0x30')],'type':_0x1e110c[_0xad43('0x31')][_0xad43('0x32')]};});_0x3347d8['model']=_['map'](_0xdc5fb8,_0xad43('0x2c'));_0x3347d8['query']=_[_0xad43('0x33')](_0x233080[_0xad43('0x34')]);_0x3347d8['filters']=_['intersection'](_0x3347d8['model'],_0x3347d8[_0xad43('0x34')]);_0x714c9c[_0xad43('0x35')]=_['intersection'](_0x3347d8['model'],qs[_0xad43('0x36')](_0x233080[_0xad43('0x34')][_0xad43('0x36')]));_0x714c9c[_0xad43('0x35')]=_0x714c9c[_0xad43('0x35')][_0xad43('0x37')]?_0x714c9c['attributes']:_0x3347d8['model'];if(!_0x233080['query'][_0xad43('0x38')]('nolimit')){_0x714c9c['limit']=qs['limit'](_0x233080[_0xad43('0x34')][_0xad43('0x23')]);_0x714c9c[_0xad43('0x22')]=qs['offset'](_0x233080['query']['offset']);}_0x714c9c[_0xad43('0x39')]=qs['sort'](_0x233080[_0xad43('0x34')]['sort']);_0x714c9c[_0xad43('0x3a')]=qs[_0xad43('0x3b')](_[_0xad43('0x3c')](_0x233080[_0xad43('0x34')],_0x3347d8[_0xad43('0x3b')]),_0xdc5fb8);if(_0x233080[_0xad43('0x34')][_0xad43('0x3d')]){_0x714c9c[_0xad43('0x3a')]=_[_0xad43('0x3e')](_0x714c9c['where'],{'$or':_[_0xad43('0x3f')](_0xdc5fb8,function(_0x3dfc3c){if(_0x3dfc3c[_0xad43('0x31')]!=='VIRTUAL'){var _0x59a78c={};_0x59a78c[_0x3dfc3c['name']]={'$like':'%'+_0x233080[_0xad43('0x34')][_0xad43('0x3d')]+'%'};return _0x59a78c;}})});}_0x714c9c=_[_0xad43('0x3e')]({},_0x714c9c,_0x233080[_0xad43('0x40')]);var _0x2011ff={'where':_0x714c9c['where']};return db[_0xad43('0x2e')][_0xad43('0x21')](_0x2011ff)[_0xad43('0x2a')](function(_0x5a3036){_0x1c352f['count']=_0x5a3036;if(_0x233080[_0xad43('0x34')]['includeAll']){_0x714c9c[_0xad43('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x714c9c);})[_0xad43('0x2a')](function(_0x5c49fe){_0x1c352f['rows']=_0x5c49fe;return _0x1c352f;})[_0xad43('0x2a')](respondWithFilteredResult(_0x222bf5,_0x714c9c))[_0xad43('0x42')](handleError(_0x222bf5,null));};exports['show']=function(_0x12e5bf,_0x14c640){var _0x2fa4e6={'raw':![],'where':{'id':_0x12e5bf[_0xad43('0x43')]['id']}},_0x5ec74e={};_0x5ec74e['model']=_[_0xad43('0x33')](db[_0xad43('0x2e')][_0xad43('0x2f')]);_0x5ec74e[_0xad43('0x34')]=_['keys'](_0x12e5bf[_0xad43('0x34')]);_0x5ec74e[_0xad43('0x3b')]=_[_0xad43('0x44')](_0x5ec74e['model'],_0x5ec74e['query']);_0x2fa4e6['attributes']=_['intersection'](_0x5ec74e['model'],qs[_0xad43('0x36')](_0x12e5bf[_0xad43('0x34')][_0xad43('0x36')]));_0x2fa4e6[_0xad43('0x35')]=_0x2fa4e6[_0xad43('0x35')][_0xad43('0x37')]?_0x2fa4e6[_0xad43('0x35')]:_0x5ec74e[_0xad43('0x45')];if(_0x12e5bf[_0xad43('0x34')][_0xad43('0x46')]){_0x2fa4e6['include']=[{'all':!![]}];}_0x2fa4e6=_['merge']({},_0x2fa4e6,_0x12e5bf['options']);return db['VoiceQueueReport'][_0xad43('0x47')](_0x2fa4e6)[_0xad43('0x2a')](handleEntityNotFound(_0x14c640,null))[_0xad43('0x2a')](respondWithResult(_0x14c640,null))[_0xad43('0x42')](handleError(_0x14c640,null));};exports[_0xad43('0x48')]=function(_0x218955,_0x1cacda){return db[_0xad43('0x2e')][_0xad43('0x48')](_0x218955['body'],{})[_0xad43('0x2a')](respondWithResult(_0x1cacda,0xc9))[_0xad43('0x42')](handleError(_0x1cacda,null));};exports[_0xad43('0x29')]=function(_0x822350,_0x28194b){if(_0x822350[_0xad43('0x49')]['id']){delete _0x822350['body']['id'];}return db['VoiceQueueReport'][_0xad43('0x47')]({'where':{'id':_0x822350[_0xad43('0x43')]['id']}})[_0xad43('0x2a')](handleEntityNotFound(_0x28194b,null))[_0xad43('0x2a')](saveUpdates(_0x822350['body'],null))[_0xad43('0x2a')](respondWithResult(_0x28194b,null))[_0xad43('0x42')](handleError(_0x28194b,null));};exports['destroy']=function(_0x440f0c,_0x33acb6){return db[_0xad43('0x2e')][_0xad43('0x47')]({'where':{'id':_0x440f0c[_0xad43('0x43')]['id']}})[_0xad43('0x2a')](handleEntityNotFound(_0x33acb6,null))['then'](removeEntity(_0x33acb6,null))['catch'](handleError(_0x33acb6,null));};exports[_0xad43('0x4a')]=function(_0xf2cee9,_0x42f1de){return db[_0xad43('0x2e')]['describe']()['then'](respondWithResult(_0x42f1de,null))[_0xad43('0x42')](handleError(_0x42f1de,null));};exports[_0xad43('0x4b')]=function(_0x49f352,_0x175e09){var _0x2823d9={},_0x57928f={},_0x4be92f={'count':0x0,'rows':[]};_0x57928f[_0xad43('0x45')]=_['keys'](db[_0xad43('0x2e')][_0xad43('0x2f')]);_0x57928f['query']=_[_0xad43('0x33')](_0x49f352[_0xad43('0x34')]);_0x57928f[_0xad43('0x3b')]=_[_0xad43('0x44')](_0x57928f[_0xad43('0x45')],_0x57928f[_0xad43('0x34')]);_0x2823d9[_0xad43('0x35')]=_[_0xad43('0x44')](_0x57928f[_0xad43('0x45')],qs[_0xad43('0x36')](_0x49f352[_0xad43('0x34')]['fields']));_0x2823d9[_0xad43('0x35')]=_0x2823d9[_0xad43('0x35')][_0xad43('0x37')]?_0x2823d9[_0xad43('0x35')]:_0x57928f[_0xad43('0x45')];if(!_0x49f352[_0xad43('0x34')][_0xad43('0x38')](_0xad43('0x4c'))){_0x2823d9[_0xad43('0x23')]=qs[_0xad43('0x23')](_0x49f352[_0xad43('0x34')][_0xad43('0x23')]);_0x2823d9[_0xad43('0x22')]=qs['offset'](_0x49f352[_0xad43('0x34')][_0xad43('0x22')]);}_0x2823d9[_0xad43('0x39')]=qs[_0xad43('0x4d')](_0x49f352[_0xad43('0x34')][_0xad43('0x4d')]);_0x2823d9[_0xad43('0x3a')]=qs[_0xad43('0x3b')](_[_0xad43('0x3c')](_0x49f352[_0xad43('0x34')],_0x57928f[_0xad43('0x3b')]));if(_0x49f352['query']['filter']){_0x2823d9[_0xad43('0x3a')]=_[_0xad43('0x3e')](_0x2823d9[_0xad43('0x3a')],{'$or':_[_0xad43('0x3f')](_0x2823d9[_0xad43('0x35')],function(_0x141997){var _0x580c26={};_0x580c26[_0x141997]={'$like':'%'+_0x49f352[_0xad43('0x34')]['filter']+'%'};return _0x580c26;})});}_0x2823d9=_[_0xad43('0x3e')]({},_0x2823d9,_0x49f352[_0xad43('0x40')]);var _0x88eb2c={'where':_0x2823d9['where']};return db['VoiceQueueReport']['count'](_0x88eb2c)[_0xad43('0x2a')](function(_0x5f0063){_0x4be92f[_0xad43('0x21')]=_0x5f0063;if(_0x49f352['query'][_0xad43('0x46')]){_0x2823d9[_0xad43('0x41')]=[{'all':!![]}];}return db[_0xad43('0x2e')][_0xad43('0x4e')](_0x2823d9);})[_0xad43('0x2a')](function(_0x357a27){_0x4be92f[_0xad43('0x4f')]=_0x357a27;return _0x4be92f;})['then'](respondWithFilteredResult(_0x175e09,_0x2823d9,_0xad43('0x4b')))['catch'](handleError(_0x175e09,null,_0xad43('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 09cd171..9ae9e04 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 _0x54e4=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x54e4,0x175));var _0x454e=function(_0x11872f,_0x5278b7){_0x11872f=_0x11872f-0x0;var _0x1c8dca=_0x54e4[_0x11872f];return _0x1c8dca;};'use strict';var EventEmitter=require(_0x454e('0x0'));var VoiceQueueReport=require(_0x454e('0x1'))['db'][_0x454e('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x454e('0x3')](0x0);var events={'afterCreate':_0x454e('0x4'),'afterUpdate':'update','afterDestroy':_0x454e('0x5')};function emitEvent(_0x10ff5c){return function(_0x3adfbf,_0x7241b5,_0x4d5299){VoiceQueueReportEvents[_0x454e('0x6')](_0x10ff5c+':'+_0x3adfbf['id'],_0x3adfbf);VoiceQueueReportEvents[_0x454e('0x6')](_0x10ff5c,_0x3adfbf);_0x4d5299(null);};}for(var e in events){if(events[_0x454e('0x7')](e)){var event=events[e];VoiceQueueReport[_0x454e('0x8')](e,emitEvent(event));}}module[_0x454e('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x0235=['hasOwnProperty','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x3eb12f,_0x3045d0){var _0x2ae206=function(_0x2b93f7){while(--_0x2b93f7){_0x3eb12f['push'](_0x3eb12f['shift']());}};_0x2ae206(++_0x3045d0);}(_0x0235,0xd3));var _0x5023=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x0235[_0x30ae5e];return _0x1f2e93;};'use strict';var EventEmitter=require(_0x5023('0x0'));var VoiceQueueReport=require(_0x5023('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5023('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5023('0x3'),'afterDestroy':_0x5023('0x4')};function emitEvent(_0x2c14b3){return function(_0x1033e4,_0x31fb09,_0x3c6950){VoiceQueueReportEvents[_0x5023('0x5')](_0x2c14b3+':'+_0x1033e4['id'],_0x1033e4);VoiceQueueReportEvents[_0x5023('0x5')](_0x2c14b3,_0x1033e4);_0x3c6950(null);};}for(var e in events){if(events[_0x5023('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 6c1a84c..fb6b753 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 _0xab41=['calleridnum','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','VoiceQueueReport','report_queue','uniqueid'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xab41,0xd3));var _0x1ab4=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xab41[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x1ab4('0x0'));var util=require(_0x1ab4('0x1'));var logger=require(_0x1ab4('0x2'))(_0x1ab4('0x3'));var moment=require(_0x1ab4('0x4'));var BPromise=require('bluebird');var rp=require(_0x1ab4('0x5'));var fs=require('fs');var path=require(_0x1ab4('0x6'));var rimraf=require(_0x1ab4('0x7'));var config=require(_0x1ab4('0x8'));var attributes=require(_0x1ab4('0x9'));module['exports']=function(_0x4bbde8,_0x18aeca){return _0x4bbde8['define'](_0x1ab4('0xa'),attributes,{'tableName':_0x1ab4('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1ab4('0xc')]},{'fields':[_0x1ab4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabfc=['rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xe87d85,_0x1387d4){var _0x37cda6=function(_0x200371){while(--_0x200371){_0xe87d85['push'](_0xe87d85['shift']());}};_0x37cda6(++_0x1387d4);}(_0xabfc,0x1d9));var _0xcabf=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xabfc[_0x273dc5];return _0x46dae7;};'use strict';var _=require('lodash');var util=require(_0xcabf('0x0'));var logger=require(_0xcabf('0x1'))(_0xcabf('0x2'));var moment=require(_0xcabf('0x3'));var BPromise=require(_0xcabf('0x4'));var rp=require(_0xcabf('0x5'));var fs=require('fs');var path=require(_0xcabf('0x6'));var rimraf=require(_0xcabf('0x7'));var config=require(_0xcabf('0x8'));var attributes=require(_0xcabf('0x9'));module['exports']=function(_0x451712,_0x1f2327){return _0x451712[_0xcabf('0xa')](_0xcabf('0xb'),attributes,{'tableName':_0xcabf('0xc'),'paranoid':![],'indexes':[{'fields':[_0xcabf('0xd')]},{'fields':[_0xcabf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index ac99abb..115c5cb 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 _0x67df=['redis','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','VoiceQueueReport','findAll','options','raw','where','limit','include','map','attributes','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','localhost','socket.io-emitter'];(function(_0x41eb8c,_0xb39948){var _0x565e21=function(_0x1ee94c){while(--_0x1ee94c){_0x41eb8c['push'](_0x41eb8c['shift']());}};_0x565e21(++_0xb39948);}(_0x67df,0xeb));var _0xf67d=function(_0x21b221,_0x519dc0){_0x21b221=_0x21b221-0x0;var _0x40ac2a=_0x67df[_0x21b221];return _0x40ac2a;};'use strict';var _=require(_0xf67d('0x0'));var util=require(_0xf67d('0x1'));var moment=require(_0xf67d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf67d('0x3'));var fs=require('fs');var Redis=require(_0xf67d('0x4'));var db=require(_0xf67d('0x5'))['db'];var utils=require(_0xf67d('0x6'));var logger=require(_0xf67d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf67d('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xf67d('0x9'),'port':0x18eb});var socket=require(_0xf67d('0xa'))(new Redis(config[_0xf67d('0xb')]));require(_0xf67d('0xc'))[_0xf67d('0xd')](socket);function respondWithRpcPromise(_0x23391d,_0x3cdc90,_0x4463c9){return new BPromise(function(_0xbb2b65,_0x749acc){return client['request'](_0x23391d,_0x4463c9)[_0xf67d('0xe')](function(_0x505282){logger['info'](_0xf67d('0xf'),_0x3cdc90,'request\x20sent');logger[_0xf67d('0x10')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3cdc90,_0xf67d('0x11'),JSON[_0xf67d('0x12')](_0x505282));if(_0x505282[_0xf67d('0x13')]){if(_0x505282[_0xf67d('0x13')][_0xf67d('0x14')]===0x1f4){logger[_0xf67d('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x3cdc90,_0x505282[_0xf67d('0x13')][_0xf67d('0x15')]);return _0x749acc(_0x505282[_0xf67d('0x13')][_0xf67d('0x15')]);}logger[_0xf67d('0x13')](_0xf67d('0xf'),_0x3cdc90,_0x505282[_0xf67d('0x13')][_0xf67d('0x15')]);return _0xbb2b65(_0x505282['error'][_0xf67d('0x15')]);}else{logger[_0xf67d('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x3cdc90,_0xf67d('0x11'));_0xbb2b65(_0x505282[_0xf67d('0x17')]['message']);}})[_0xf67d('0x18')](function(_0x947d64){logger[_0xf67d('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x3cdc90,_0x947d64);_0x749acc(_0x947d64);});});}exports['GetVoiceQueueReport']=function(_0x33fe5e){var _0x1c1074=this;return new Promise(function(_0x4615d1,_0x20f8cd){return db[_0xf67d('0x19')][_0xf67d('0x1a')]({'raw':_0x33fe5e['options']?_0x33fe5e[_0xf67d('0x1b')][_0xf67d('0x1c')]===undefined?!![]:![]:!![],'where':_0x33fe5e[_0xf67d('0x1b')]?_0x33fe5e[_0xf67d('0x1b')][_0xf67d('0x1d')]||null:null,'attributes':_0x33fe5e[_0xf67d('0x1b')]?_0x33fe5e[_0xf67d('0x1b')]['attributes']||null:null,'limit':_0x33fe5e[_0xf67d('0x1b')]?_0x33fe5e[_0xf67d('0x1b')][_0xf67d('0x1e')]||null:null,'include':_0x33fe5e[_0xf67d('0x1b')]?_0x33fe5e[_0xf67d('0x1b')][_0xf67d('0x1f')]?_[_0xf67d('0x20')](_0x33fe5e[_0xf67d('0x1b')][_0xf67d('0x1f')],function(_0x53b925){return{'model':db[_0x53b925['model']],'as':_0x53b925['as'],'attributes':_0x53b925[_0xf67d('0x21')],'include':_0x53b925[_0xf67d('0x1f')]?_[_0xf67d('0x20')](_0x53b925['include'],function(_0x413ab0){return{'model':db[_0x413ab0[_0xf67d('0x22')]],'as':_0x413ab0['as'],'attributes':_0x413ab0[_0xf67d('0x21')],'include':_0x413ab0[_0xf67d('0x1f')]?_[_0xf67d('0x20')](_0x413ab0[_0xf67d('0x1f')],function(_0x3c5f04){return{'model':db[_0x3c5f04['model']],'as':_0x3c5f04['as'],'attributes':_0x3c5f04['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3df66f){logger['info'](_0xf67d('0x23'),_0x33fe5e);logger['debug'](_0xf67d('0x23'),_0x33fe5e,JSON['stringify'](_0x3df66f));_0x4615d1(_0x3df66f);})[_0xf67d('0x18')](function(_0x3a3560){logger[_0xf67d('0x13')]('GetVoiceQueueReport',_0x3a3560[_0xf67d('0x15')],_0x33fe5e);_0x20f8cd(_0x1c1074['error'](0x1f4,_0x3a3560[_0xf67d('0x15')]));});});};exports[_0xf67d('0x24')]=function(_0xaec5ce){var _0x967334=this;return new Promise(function(_0x425aae,_0x52c11b){return db['VoiceQueueReport'][_0xf67d('0x25')](_0xaec5ce[_0xf67d('0x26')],{'raw':_0xaec5ce[_0xf67d('0x1b')]?_0xaec5ce[_0xf67d('0x1b')][_0xf67d('0x1c')]===undefined?!![]:![]:!![]})[_0xf67d('0xe')](function(_0x41e60c){logger[_0xf67d('0x16')]('CreateVoiceQueueReport',_0xaec5ce);logger['debug']('CreateVoiceQueueReport',_0xaec5ce,JSON[_0xf67d('0x12')](_0x41e60c));_0x425aae(_0x41e60c);})[_0xf67d('0x18')](function(_0x5cae74){logger[_0xf67d('0x13')](_0xf67d('0x24'),_0x5cae74[_0xf67d('0x15')],_0xaec5ce);_0x52c11b(_0x967334[_0xf67d('0x13')](0x1f4,_0x5cae74[_0xf67d('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x56541e){var _0x249a14=this;return new Promise(function(_0x238b6b,_0x27a324){return db[_0xf67d('0x19')][_0xf67d('0x27')](_0x56541e['body'],{'raw':_0x56541e[_0xf67d('0x1b')]?_0x56541e[_0xf67d('0x1b')][_0xf67d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56541e['options']?_0x56541e[_0xf67d('0x1b')][_0xf67d('0x1d')]||null:null,'attributes':_0x56541e['options']?_0x56541e['options'][_0xf67d('0x21')]||null:null,'limit':_0x56541e[_0xf67d('0x1b')]?_0x56541e[_0xf67d('0x1b')]['limit']||null:null})[_0xf67d('0xe')](function(_0x240efe){logger[_0xf67d('0x16')](_0xf67d('0x28'),_0x56541e);logger[_0xf67d('0x10')]('UpdateVoiceQueueReport',_0x56541e,JSON[_0xf67d('0x12')](_0x240efe));_0x238b6b(_0x240efe);})[_0xf67d('0x18')](function(_0x10e84b){logger['error'](_0xf67d('0x28'),_0x10e84b['message'],_0x56541e);_0x27a324(_0x249a14[_0xf67d('0x13')](0x1f4,_0x10e84b[_0xf67d('0x15')]));});});}; \ No newline at end of file +var _0xe8d9=['message','result','catch','GetVoiceQueueReport','findAll','options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31e953,_0x3884d5){var _0xa71d03=function(_0x426cdc){while(--_0x426cdc){_0x31e953['push'](_0x31e953['shift']());}};_0xa71d03(++_0x3884d5);}(_0xe8d9,0xc4));var _0x9e8d=function(_0x2168c3,_0x875d8f){_0x2168c3=_0x2168c3-0x0;var _0x44b585=_0xe8d9[_0x2168c3];return _0x44b585;};'use strict';var _=require(_0x9e8d('0x0'));var util=require('util');var moment=require(_0x9e8d('0x1'));var BPromise=require(_0x9e8d('0x2'));var rs=require(_0x9e8d('0x3'));var fs=require('fs');var Redis=require(_0x9e8d('0x4'));var db=require(_0x9e8d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e8d('0x6'))(_0x9e8d('0x7'));var config=require(_0x9e8d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9e8d('0x9')]({'port':0x232a});config[_0x9e8d('0xa')]=_[_0x9e8d('0xb')](config['redis'],{'host':_0x9e8d('0xc'),'port':0x18eb});var socket=require(_0x9e8d('0xd'))(new Redis(config[_0x9e8d('0xa')]));require(_0x9e8d('0xe'))['register'](socket);function respondWithRpcPromise(_0x32d67b,_0x113463,_0x450281){return new BPromise(function(_0x3ced12,_0x3de2bb){return client[_0x9e8d('0xf')](_0x32d67b,_0x450281)[_0x9e8d('0x10')](function(_0x395a30){logger[_0x9e8d('0x11')](_0x9e8d('0x12'),_0x113463,_0x9e8d('0x13'));logger['debug'](_0x9e8d('0x14'),_0x113463,_0x9e8d('0x13'),JSON[_0x9e8d('0x15')](_0x395a30));if(_0x395a30['error']){if(_0x395a30[_0x9e8d('0x16')][_0x9e8d('0x17')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x113463,_0x395a30[_0x9e8d('0x16')]['message']);return _0x3de2bb(_0x395a30[_0x9e8d('0x16')][_0x9e8d('0x18')]);}logger['error'](_0x9e8d('0x12'),_0x113463,_0x395a30[_0x9e8d('0x16')][_0x9e8d('0x18')]);return _0x3ced12(_0x395a30[_0x9e8d('0x16')][_0x9e8d('0x18')]);}else{logger['info'](_0x9e8d('0x12'),_0x113463,_0x9e8d('0x13'));_0x3ced12(_0x395a30[_0x9e8d('0x19')][_0x9e8d('0x18')]);}})[_0x9e8d('0x1a')](function(_0x4798fb){logger[_0x9e8d('0x16')](_0x9e8d('0x12'),_0x113463,_0x4798fb);_0x3de2bb(_0x4798fb);});});}exports[_0x9e8d('0x1b')]=function(_0x5d9e3f){var _0x1047a6=this;return new Promise(function(_0x36b378,_0xe5a0c8){return db['VoiceQueueReport'][_0x9e8d('0x1c')]({'raw':_0x5d9e3f[_0x9e8d('0x1d')]?_0x5d9e3f['options']['raw']===undefined?!![]:![]:!![],'where':_0x5d9e3f['options']?_0x5d9e3f['options'][_0x9e8d('0x1e')]||null:null,'attributes':_0x5d9e3f[_0x9e8d('0x1d')]?_0x5d9e3f[_0x9e8d('0x1d')][_0x9e8d('0x1f')]||null:null,'limit':_0x5d9e3f[_0x9e8d('0x1d')]?_0x5d9e3f[_0x9e8d('0x1d')][_0x9e8d('0x20')]||null:null,'include':_0x5d9e3f[_0x9e8d('0x1d')]?_0x5d9e3f[_0x9e8d('0x1d')][_0x9e8d('0x21')]?_[_0x9e8d('0x22')](_0x5d9e3f[_0x9e8d('0x1d')][_0x9e8d('0x21')],function(_0x108eab){return{'model':db[_0x108eab[_0x9e8d('0x23')]],'as':_0x108eab['as'],'attributes':_0x108eab[_0x9e8d('0x1f')],'include':_0x108eab[_0x9e8d('0x21')]?_['map'](_0x108eab['include'],function(_0x5cd5f4){return{'model':db[_0x5cd5f4[_0x9e8d('0x23')]],'as':_0x5cd5f4['as'],'attributes':_0x5cd5f4[_0x9e8d('0x1f')],'include':_0x5cd5f4[_0x9e8d('0x21')]?_[_0x9e8d('0x22')](_0x5cd5f4['include'],function(_0x4a35d3){return{'model':db[_0x4a35d3[_0x9e8d('0x23')]],'as':_0x4a35d3['as'],'attributes':_0x4a35d3[_0x9e8d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x581da6){logger[_0x9e8d('0x11')](_0x9e8d('0x1b'),_0x5d9e3f);logger['debug'](_0x9e8d('0x1b'),_0x5d9e3f,JSON[_0x9e8d('0x15')](_0x581da6));_0x36b378(_0x581da6);})['catch'](function(_0x431fdf){logger['error'](_0x9e8d('0x1b'),_0x431fdf['message'],_0x5d9e3f);_0xe5a0c8(_0x1047a6[_0x9e8d('0x16')](0x1f4,_0x431fdf[_0x9e8d('0x18')]));});});};exports[_0x9e8d('0x24')]=function(_0x188634){var _0x47094c=this;return new Promise(function(_0x242a20,_0x1d58e0){return db[_0x9e8d('0x25')][_0x9e8d('0x26')](_0x188634[_0x9e8d('0x27')],{'raw':_0x188634[_0x9e8d('0x1d')]?_0x188634['options'][_0x9e8d('0x28')]===undefined?!![]:![]:!![]})['then'](function(_0x5152da){logger[_0x9e8d('0x11')](_0x9e8d('0x24'),_0x188634);logger['debug']('CreateVoiceQueueReport',_0x188634,JSON['stringify'](_0x5152da));_0x242a20(_0x5152da);})[_0x9e8d('0x1a')](function(_0x2a38c1){logger[_0x9e8d('0x16')]('CreateVoiceQueueReport',_0x2a38c1[_0x9e8d('0x18')],_0x188634);_0x1d58e0(_0x47094c[_0x9e8d('0x16')](0x1f4,_0x2a38c1[_0x9e8d('0x18')]));});});};exports[_0x9e8d('0x29')]=function(_0xcfe9f5){var _0x2f9aaa=this;return new Promise(function(_0x324e06,_0x1f0a6f){return db[_0x9e8d('0x25')][_0x9e8d('0x2a')](_0xcfe9f5['body'],{'raw':_0xcfe9f5['options']?_0xcfe9f5['options'][_0x9e8d('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcfe9f5[_0x9e8d('0x1d')]?_0xcfe9f5[_0x9e8d('0x1d')][_0x9e8d('0x1e')]||null:null,'attributes':_0xcfe9f5[_0x9e8d('0x1d')]?_0xcfe9f5[_0x9e8d('0x1d')]['attributes']||null:null,'limit':_0xcfe9f5[_0x9e8d('0x1d')]?_0xcfe9f5[_0x9e8d('0x1d')]['limit']||null:null})[_0x9e8d('0x10')](function(_0x3ff523){logger[_0x9e8d('0x11')](_0x9e8d('0x29'),_0xcfe9f5);logger[_0x9e8d('0x2b')](_0x9e8d('0x29'),_0xcfe9f5,JSON['stringify'](_0x3ff523));_0x324e06(_0x3ff523);})[_0x9e8d('0x1a')](function(_0x2af27c){logger[_0x9e8d('0x16')](_0x9e8d('0x29'),_0x2af27c[_0x9e8d('0x18')],_0xcfe9f5);_0x1f0a6f(_0x2f9aaa[_0x9e8d('0x16')](0x1f4,_0x2af27c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index fc092be..dd489b6 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 _0xc2d6=['emit','removeListener','voiceQueueReport:','save','remove','update'];(function(_0x4eaa8a,_0x4745a3){var _0x10f0e1=function(_0x4bdc65){while(--_0x4bdc65){_0x4eaa8a['push'](_0x4eaa8a['shift']());}};_0x10f0e1(++_0x4745a3);}(_0xc2d6,0x171));var _0x6c2d=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xc2d6[_0x2f3848];return _0x102668;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x6c2d('0x0'),_0x6c2d('0x1'),_0x6c2d('0x2')];function createListener(_0x36f034,_0x1d92f7){return function(_0x3b94d4){_0x1d92f7[_0x6c2d('0x3')](_0x36f034,_0x3b94d4);};}function removeListener(_0x304229,_0x47057e){return function(){VoiceQueueReportEvents[_0x6c2d('0x4')](_0x304229,_0x47057e);};}exports['register']=function(_0x1141f7){for(var _0x3cf33f=0x0,_0x33c7a9=events['length'];_0x3cf33f<_0x33c7a9;_0x3cf33f++){var _0x2595b5=events[_0x3cf33f];var _0x5f5134=createListener(_0x6c2d('0x5')+_0x2595b5,_0x1141f7);VoiceQueueReportEvents['on'](_0x2595b5,_0x5f5134);}}; \ No newline at end of file +var _0x20ad=['save','remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x1050ec,_0x600012){var _0x52bb4a=function(_0x5790fc){while(--_0x5790fc){_0x1050ec['push'](_0x1050ec['shift']());}};_0x52bb4a(++_0x600012);}(_0x20ad,0x13a));var _0xd20a=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x20ad[_0xa8883];return _0x479426;};'use strict';var VoiceQueueReportEvents=require(_0xd20a('0x0'));var events=[_0xd20a('0x1'),_0xd20a('0x2'),_0xd20a('0x3')];function createListener(_0x510c0e,_0x2de53e){return function(_0x3297dd){_0x2de53e[_0xd20a('0x4')](_0x510c0e,_0x3297dd);};}function removeListener(_0x274c14,_0x1d6f52){return function(){VoiceQueueReportEvents[_0xd20a('0x5')](_0x274c14,_0x1d6f52);};}exports[_0xd20a('0x6')]=function(_0x26be33){for(var _0x1c71e=0x0,_0x58f33b=events[_0xd20a('0x7')];_0x1c71e<_0x58f33b;_0x1c71e++){var _0xf47652=events[_0x1c71e];var _0x4c56a0=createListener(_0xd20a('0x8')+_0xf47652,_0x26be33);VoiceQueueReportEvents['on'](_0xf47652,_0x4c56a0);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 8db451e..8df6124 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 _0x27cf=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x27cf,0x1aa));var _0xf27c=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x27cf[_0x75f869];return _0x10af8b;};'use strict';var multer=require(_0xf27c('0x0'));var util=require(_0xf27c('0x1'));var path=require(_0xf27c('0x2'));var timeout=require(_0xf27c('0x3'));var express=require('express');var router=express[_0xf27c('0x4')]();var fs_extra=require(_0xf27c('0x5'));var auth=require(_0xf27c('0x6'));var interaction=require(_0xf27c('0x7'));var config=require(_0xf27c('0x8'));var controller=require('./voiceQueuesLog.controller');router[_0xf27c('0x9')]('/',auth[_0xf27c('0xa')](),controller['index']);router[_0xf27c('0x9')](_0xf27c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf27c('0xc')]('/',auth[_0xf27c('0xa')](),controller[_0xf27c('0xd')]);router[_0xf27c('0xe')]('/:id',auth[_0xf27c('0xa')](),controller[_0xf27c('0xf')]);router[_0xf27c('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf27c('0x11')]=router; \ No newline at end of file +var _0x44af=['./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','create','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44af,0xc5));var _0xf44a=function(_0x5b6744,_0x49c9c2){_0x5b6744=_0x5b6744-0x0;var _0x43d97a=_0x44af[_0x5b6744];return _0x43d97a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf44a('0x0'));var timeout=require(_0xf44a('0x1'));var express=require(_0xf44a('0x2'));var router=express[_0xf44a('0x3')]();var fs_extra=require(_0xf44a('0x4'));var auth=require(_0xf44a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf44a('0x6'));var controller=require(_0xf44a('0x7'));router[_0xf44a('0x8')]('/',auth[_0xf44a('0x9')](),controller[_0xf44a('0xa')]);router[_0xf44a('0x8')](_0xf44a('0xb'),auth[_0xf44a('0x9')](),controller[_0xf44a('0xc')]);router['post']('/',auth[_0xf44a('0x9')](),controller[_0xf44a('0xd')]);router[_0xf44a('0xe')](_0xf44a('0xb'),auth['isAuthenticated'](),controller[_0xf44a('0xf')]);router['delete']('/:id',auth[_0xf44a('0x9')](),controller['destroy']);module[_0xf44a('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 3cde73a..ba7dd3f 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 _0xdb9e=['DATE','sequelize','exports','STRING'];(function(_0x1f5ccb,_0x3ddbbf){var _0x12d007=function(_0x245095){while(--_0x245095){_0x1f5ccb['push'](_0x1f5ccb['shift']());}};_0x12d007(++_0x3ddbbf);}(_0xdb9e,0x119));var _0xedb9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xdb9e[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xedb9('0x0'));var moment=require('moment');module[_0xedb9('0x1')]={'time':{'type':Sequelize[_0xedb9('0x2')]},'callid':{'type':Sequelize[_0xedb9('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xedb9('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xedb9('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xedb9('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xedb9('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xedb9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xedb9('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xedb9('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xedb9('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x9fb1=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fb1,0xe6));var _0x19fb=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9fb1[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x19fb('0x0'));var moment=require(_0x19fb('0x1'));module[_0x19fb('0x2')]={'time':{'type':Sequelize[_0x19fb('0x3')]},'callid':{'type':Sequelize[_0x19fb('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x19fb('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x19fb('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x19fb('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x19fb('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x19fb('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x19fb('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x19fb('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x19fb('0x4')],'allowNull':![],'defaultValue':moment()[_0x19fb('0x5')](_0x19fb('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index fad6303..79189a8 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 _0x1591=['bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','Content-Range','apply','reject','update','then','destroy','error','stack','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x267145,_0x2014ad){var _0x3c3923=function(_0x58d9da){while(--_0x58d9da){_0x267145['push'](_0x267145['shift']());}};_0x3c3923(++_0x2014ad);}(_0x1591,0x1c3));var _0x1159=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x1591[_0x8e8ca7];return _0x561381;};'use strict';var emlformat=require(_0x1159('0x0'));var rimraf=require(_0x1159('0x1'));var zipdir=require(_0x1159('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1159('0x3'));var moment=require(_0x1159('0x4'));var BPromise=require(_0x1159('0x5'));var Mustache=require('mustache');var util=require(_0x1159('0x6'));var path=require(_0x1159('0x7'));var sox=require(_0x1159('0x8'));var csv=require(_0x1159('0x9'));var ejs=require(_0x1159('0xa'));var fs=require('fs');var fs_extra=require(_0x1159('0xb'));var _=require(_0x1159('0xc'));var squel=require(_0x1159('0xd'));var crypto=require(_0x1159('0xe'));var jsforce=require(_0x1159('0xf'));var deskjs=require(_0x1159('0x10'));var toCsv=require(_0x1159('0x9'));var querystring=require(_0x1159('0x11'));var Papa=require('papaparse');var Redis=require(_0x1159('0x12'));var authService=require(_0x1159('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1159('0x14'));var hardwareService=require(_0x1159('0x15'));var logger=require('../../config/logger')(_0x1159('0x16'));var utils=require(_0x1159('0x17'));var config=require(_0x1159('0x18'));var licenseUtil=require(_0x1159('0x19'));var db=require(_0x1159('0x1a'))['db'];function respondWithStatusCode(_0x27db2e,_0x3f288a){_0x3f288a=_0x3f288a||0xcc;return function(_0x4f0e5){if(_0x4f0e5){return _0x27db2e['sendStatus'](_0x3f288a);}return _0x27db2e['status'](_0x3f288a)[_0x1159('0x1b')]();};}function respondWithResult(_0x2d3e64,_0x3a4c46){_0x3a4c46=_0x3a4c46||0xc8;return function(_0x47ebc5){if(_0x47ebc5){return _0x2d3e64[_0x1159('0x1c')](_0x3a4c46)[_0x1159('0x1d')](_0x47ebc5);}};}function respondWithFilteredResult(_0xe589fa,_0xa5dc2a){return function(_0x5af829){if(_0x5af829){var _0x1f532c=typeof _0xa5dc2a[_0x1159('0x1e')]===_0x1159('0x1f')&&typeof _0xa5dc2a[_0x1159('0x20')]===_0x1159('0x1f');var _0x5b0cf0=_0x5af829['count'];var _0x39f669=_0x1f532c?0x0:_0xa5dc2a[_0x1159('0x1e')];var _0x73ab=_0x1f532c?_0x5af829['count']:_0xa5dc2a[_0x1159('0x1e')]+_0xa5dc2a[_0x1159('0x20')];var _0x4246e7;if(_0x73ab>=_0x5b0cf0){_0x73ab=_0x5b0cf0;_0x4246e7=0xc8;}else{_0x4246e7=0xce;}_0xe589fa[_0x1159('0x1c')](_0x4246e7);return _0xe589fa['set'](_0x1159('0x21'),_0x39f669+'-'+_0x73ab+'/'+_0x5b0cf0)['json'](_0x5af829);}return null;};}function patchUpdates(_0x7e8435){return function(_0x398159){try{jsonpatch[_0x1159('0x22')](_0x398159,_0x7e8435,!![]);}catch(_0x41616d){return BPromise[_0x1159('0x23')](_0x41616d);}return _0x398159['save']();};}function saveUpdates(_0x3ab8a8,_0x477bc6){return function(_0x31b883){if(_0x31b883){return _0x31b883[_0x1159('0x24')](_0x3ab8a8)[_0x1159('0x25')](function(_0x5c0454){return _0x5c0454;});}return null;};}function removeEntity(_0x12dcb6,_0x3cc94e){return function(_0x1bf129){if(_0x1bf129){return _0x1bf129[_0x1159('0x26')]()['then'](function(){_0x12dcb6[_0x1159('0x1c')](0xcc)[_0x1159('0x1b')]();});}};}function handleEntityNotFound(_0x5e2b22,_0x5de737){return function(_0x5dc516){if(!_0x5dc516){_0x5e2b22['sendStatus'](0x194);}return _0x5dc516;};}function handleError(_0x4243ba,_0x341fb5){_0x341fb5=_0x341fb5||0x1f4;return function(_0x15503d){logger[_0x1159('0x27')](_0x15503d[_0x1159('0x28')]);if(_0x15503d['name']){delete _0x15503d['name'];}_0x4243ba['status'](_0x341fb5)[_0x1159('0x29')](_0x15503d);};}exports['index']=function(_0x5afdf6,_0x5ba7c6){var _0x5dacbe={},_0x32fadb={},_0x204866={'count':0x0,'rows':[]};var _0x571e00=_[_0x1159('0x2a')](db[_0x1159('0x2b')][_0x1159('0x2c')],function(_0x190c18){return{'name':_0x190c18[_0x1159('0x2d')],'type':_0x190c18[_0x1159('0x2e')][_0x1159('0x2f')]};});_0x32fadb[_0x1159('0x30')]=_[_0x1159('0x2a')](_0x571e00,_0x1159('0x31'));_0x32fadb['query']=_[_0x1159('0x32')](_0x5afdf6[_0x1159('0x33')]);_0x32fadb[_0x1159('0x34')]=_[_0x1159('0x35')](_0x32fadb[_0x1159('0x30')],_0x32fadb['query']);_0x5dacbe[_0x1159('0x36')]=_['intersection'](_0x32fadb[_0x1159('0x30')],qs['fields'](_0x5afdf6[_0x1159('0x33')][_0x1159('0x37')]));_0x5dacbe[_0x1159('0x36')]=_0x5dacbe['attributes']['length']?_0x5dacbe[_0x1159('0x36')]:_0x32fadb[_0x1159('0x30')];if(!_0x5afdf6['query']['hasOwnProperty'](_0x1159('0x38'))){_0x5dacbe[_0x1159('0x20')]=qs[_0x1159('0x20')](_0x5afdf6[_0x1159('0x33')][_0x1159('0x20')]);_0x5dacbe[_0x1159('0x1e')]=qs[_0x1159('0x1e')](_0x5afdf6[_0x1159('0x33')][_0x1159('0x1e')]);}_0x5dacbe[_0x1159('0x39')]=qs[_0x1159('0x3a')](_0x5afdf6[_0x1159('0x33')]['sort']);_0x5dacbe[_0x1159('0x3b')]=qs['filters'](_[_0x1159('0x3c')](_0x5afdf6[_0x1159('0x33')],_0x32fadb[_0x1159('0x34')]),_0x571e00);if(_0x5afdf6[_0x1159('0x33')][_0x1159('0x3d')]){_0x5dacbe[_0x1159('0x3b')]=_[_0x1159('0x3e')](_0x5dacbe[_0x1159('0x3b')],{'$or':_[_0x1159('0x2a')](_0x571e00,function(_0x48e754){if(_0x48e754['type']!==_0x1159('0x3f')){var _0x403fdc={};_0x403fdc[_0x48e754[_0x1159('0x31')]]={'$like':'%'+_0x5afdf6[_0x1159('0x33')][_0x1159('0x3d')]+'%'};return _0x403fdc;}})});}_0x5dacbe=_[_0x1159('0x3e')]({},_0x5dacbe,_0x5afdf6[_0x1159('0x40')]);var _0x1b85b4={'where':_0x5dacbe['where']};return db['VoiceQueuesLog'][_0x1159('0x41')](_0x1b85b4)[_0x1159('0x25')](function(_0x2f8053){_0x204866[_0x1159('0x41')]=_0x2f8053;if(_0x5afdf6['query'][_0x1159('0x42')]){_0x5dacbe[_0x1159('0x43')]=[{'all':!![]}];}return db[_0x1159('0x2b')][_0x1159('0x44')](_0x5dacbe);})[_0x1159('0x25')](function(_0x4c1f71){_0x204866[_0x1159('0x45')]=_0x4c1f71;return _0x204866;})[_0x1159('0x25')](respondWithFilteredResult(_0x5ba7c6,_0x5dacbe))['catch'](handleError(_0x5ba7c6,null));};exports['show']=function(_0x35af39,_0x87572d){var _0x5daa87={'raw':!![],'where':{'id':_0x35af39[_0x1159('0x46')]['id']}},_0x4939bb={};_0x4939bb[_0x1159('0x30')]=_['keys'](db['VoiceQueuesLog'][_0x1159('0x2c')]);_0x4939bb['query']=_[_0x1159('0x32')](_0x35af39[_0x1159('0x33')]);_0x4939bb[_0x1159('0x34')]=_[_0x1159('0x35')](_0x4939bb[_0x1159('0x30')],_0x4939bb[_0x1159('0x33')]);_0x5daa87[_0x1159('0x36')]=_[_0x1159('0x35')](_0x4939bb[_0x1159('0x30')],qs['fields'](_0x35af39[_0x1159('0x33')][_0x1159('0x37')]));_0x5daa87['attributes']=_0x5daa87[_0x1159('0x36')][_0x1159('0x47')]?_0x5daa87[_0x1159('0x36')]:_0x4939bb['model'];if(_0x35af39[_0x1159('0x33')][_0x1159('0x42')]){_0x5daa87[_0x1159('0x43')]=[{'all':!![]}];}_0x5daa87=_[_0x1159('0x3e')]({},_0x5daa87,_0x35af39[_0x1159('0x40')]);return db[_0x1159('0x2b')][_0x1159('0x48')](_0x5daa87)['then'](handleEntityNotFound(_0x87572d,null))[_0x1159('0x25')](respondWithResult(_0x87572d,null))[_0x1159('0x49')](handleError(_0x87572d,null));};exports[_0x1159('0x4a')]=function(_0x23c298,_0x30aa21){return db[_0x1159('0x2b')][_0x1159('0x4a')](_0x23c298[_0x1159('0x4b')],{})[_0x1159('0x25')](respondWithResult(_0x30aa21,0xc9))[_0x1159('0x49')](handleError(_0x30aa21,null));};exports[_0x1159('0x24')]=function(_0x19ed38,_0x397c1b){if(_0x19ed38[_0x1159('0x4b')]['id']){delete _0x19ed38[_0x1159('0x4b')]['id'];}return db['VoiceQueuesLog'][_0x1159('0x48')]({'where':{'id':_0x19ed38[_0x1159('0x46')]['id']}})[_0x1159('0x25')](handleEntityNotFound(_0x397c1b,null))[_0x1159('0x25')](saveUpdates(_0x19ed38['body'],null))['then'](respondWithResult(_0x397c1b,null))[_0x1159('0x49')](handleError(_0x397c1b,null));};exports[_0x1159('0x26')]=function(_0x27662f,_0x16a1e3){return db[_0x1159('0x2b')][_0x1159('0x48')]({'where':{'id':_0x27662f[_0x1159('0x46')]['id']}})[_0x1159('0x25')](handleEntityNotFound(_0x16a1e3,null))[_0x1159('0x25')](removeEntity(_0x16a1e3,null))[_0x1159('0x49')](handleError(_0x16a1e3,null));}; \ No newline at end of file +var _0xc05f=['keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x10965b,_0x2a0f2a){var _0x134c8a=function(_0x4c3cd2){while(--_0x4c3cd2){_0x10965b['push'](_0x10965b['shift']());}};_0x134c8a(++_0x2a0f2a);}(_0xc05f,0x1d0));var _0xfc05=function(_0x30f6af,_0x1b2eb9){_0x30f6af=_0x30f6af-0x0;var _0x3372d0=_0xc05f[_0x30f6af];return _0x3372d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc05('0x0'));var zipdir=require(_0xfc05('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc05('0x2'));var moment=require(_0xfc05('0x3'));var BPromise=require(_0xfc05('0x4'));var Mustache=require('mustache');var util=require(_0xfc05('0x5'));var path=require('path');var sox=require(_0xfc05('0x6'));var csv=require(_0xfc05('0x7'));var ejs=require(_0xfc05('0x8'));var fs=require('fs');var fs_extra=require(_0xfc05('0x9'));var _=require('lodash');var squel=require(_0xfc05('0xa'));var crypto=require('crypto');var jsforce=require(_0xfc05('0xb'));var deskjs=require(_0xfc05('0xc'));var toCsv=require(_0xfc05('0x7'));var querystring=require(_0xfc05('0xd'));var Papa=require('papaparse');var Redis=require(_0xfc05('0xe'));var authService=require(_0xfc05('0xf'));var qs=require(_0xfc05('0x10'));var as=require(_0xfc05('0x11'));var hardwareService=require(_0xfc05('0x12'));var logger=require(_0xfc05('0x13'))(_0xfc05('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc05('0x15'));var db=require(_0xfc05('0x16'))['db'];function respondWithStatusCode(_0xc73eff,_0x43fce3){_0x43fce3=_0x43fce3||0xcc;return function(_0x2681f0){if(_0x2681f0){return _0xc73eff[_0xfc05('0x17')](_0x43fce3);}return _0xc73eff[_0xfc05('0x18')](_0x43fce3)[_0xfc05('0x19')]();};}function respondWithResult(_0x1efe67,_0x1688a4){_0x1688a4=_0x1688a4||0xc8;return function(_0x4433d1){if(_0x4433d1){return _0x1efe67[_0xfc05('0x18')](_0x1688a4)[_0xfc05('0x1a')](_0x4433d1);}};}function respondWithFilteredResult(_0xb11ce5,_0x55f34d){return function(_0x47a067){if(_0x47a067){var _0x6596de=typeof _0x55f34d['offset']===_0xfc05('0x1b')&&typeof _0x55f34d[_0xfc05('0x1c')]==='undefined';var _0x214d72=_0x47a067['count'];var _0x2a0f16=_0x6596de?0x0:_0x55f34d['offset'];var _0x47e400=_0x6596de?_0x47a067[_0xfc05('0x1d')]:_0x55f34d['offset']+_0x55f34d[_0xfc05('0x1c')];var _0x3794fa;if(_0x47e400>=_0x214d72){_0x47e400=_0x214d72;_0x3794fa=0xc8;}else{_0x3794fa=0xce;}_0xb11ce5[_0xfc05('0x18')](_0x3794fa);return _0xb11ce5['set'](_0xfc05('0x1e'),_0x2a0f16+'-'+_0x47e400+'/'+_0x214d72)[_0xfc05('0x1a')](_0x47a067);}return null;};}function patchUpdates(_0x268d62){return function(_0x21fae8){try{jsonpatch[_0xfc05('0x1f')](_0x21fae8,_0x268d62,!![]);}catch(_0x33eaf6){return BPromise[_0xfc05('0x20')](_0x33eaf6);}return _0x21fae8[_0xfc05('0x21')]();};}function saveUpdates(_0x1d1208,_0x3d7274){return function(_0x4c021b){if(_0x4c021b){return _0x4c021b[_0xfc05('0x22')](_0x1d1208)['then'](function(_0xc0423b){return _0xc0423b;});}return null;};}function removeEntity(_0x4ce86d,_0x18be5){return function(_0x556540){if(_0x556540){return _0x556540['destroy']()[_0xfc05('0x23')](function(){_0x4ce86d[_0xfc05('0x18')](0xcc)[_0xfc05('0x19')]();});}};}function handleEntityNotFound(_0x30058e,_0x5d2323){return function(_0x1a50b9){if(!_0x1a50b9){_0x30058e['sendStatus'](0x194);}return _0x1a50b9;};}function handleError(_0x9d705,_0x485af5){_0x485af5=_0x485af5||0x1f4;return function(_0x9dfcb5){logger[_0xfc05('0x24')](_0x9dfcb5[_0xfc05('0x25')]);if(_0x9dfcb5[_0xfc05('0x26')]){delete _0x9dfcb5[_0xfc05('0x26')];}_0x9d705[_0xfc05('0x18')](_0x485af5)[_0xfc05('0x27')](_0x9dfcb5);};}exports['index']=function(_0x62f931,_0x3a731f){var _0x394799={},_0x40ac38={},_0x733edf={'count':0x0,'rows':[]};var _0xad788=_[_0xfc05('0x28')](db['VoiceQueuesLog'][_0xfc05('0x29')],function(_0x122e1f){return{'name':_0x122e1f[_0xfc05('0x2a')],'type':_0x122e1f[_0xfc05('0x2b')][_0xfc05('0x2c')]};});_0x40ac38[_0xfc05('0x2d')]=_[_0xfc05('0x28')](_0xad788,_0xfc05('0x26'));_0x40ac38[_0xfc05('0x2e')]=_[_0xfc05('0x2f')](_0x62f931[_0xfc05('0x2e')]);_0x40ac38['filters']=_[_0xfc05('0x30')](_0x40ac38['model'],_0x40ac38[_0xfc05('0x2e')]);_0x394799['attributes']=_['intersection'](_0x40ac38['model'],qs[_0xfc05('0x31')](_0x62f931[_0xfc05('0x2e')][_0xfc05('0x31')]));_0x394799[_0xfc05('0x32')]=_0x394799[_0xfc05('0x32')][_0xfc05('0x33')]?_0x394799['attributes']:_0x40ac38[_0xfc05('0x2d')];if(!_0x62f931['query'][_0xfc05('0x34')](_0xfc05('0x35'))){_0x394799[_0xfc05('0x1c')]=qs[_0xfc05('0x1c')](_0x62f931[_0xfc05('0x2e')][_0xfc05('0x1c')]);_0x394799[_0xfc05('0x36')]=qs[_0xfc05('0x36')](_0x62f931[_0xfc05('0x2e')][_0xfc05('0x36')]);}_0x394799[_0xfc05('0x37')]=qs[_0xfc05('0x38')](_0x62f931['query'][_0xfc05('0x38')]);_0x394799[_0xfc05('0x39')]=qs[_0xfc05('0x3a')](_[_0xfc05('0x3b')](_0x62f931['query'],_0x40ac38[_0xfc05('0x3a')]),_0xad788);if(_0x62f931[_0xfc05('0x2e')][_0xfc05('0x3c')]){_0x394799['where']=_[_0xfc05('0x3d')](_0x394799[_0xfc05('0x39')],{'$or':_['map'](_0xad788,function(_0x14b79a){if(_0x14b79a[_0xfc05('0x2b')]!==_0xfc05('0x3e')){var _0x228f0b={};_0x228f0b[_0x14b79a[_0xfc05('0x26')]]={'$like':'%'+_0x62f931['query']['filter']+'%'};return _0x228f0b;}})});}_0x394799=_[_0xfc05('0x3d')]({},_0x394799,_0x62f931[_0xfc05('0x3f')]);var _0x472d75={'where':_0x394799[_0xfc05('0x39')]};return db[_0xfc05('0x40')][_0xfc05('0x1d')](_0x472d75)[_0xfc05('0x23')](function(_0x4c1277){_0x733edf['count']=_0x4c1277;if(_0x62f931['query']['includeAll']){_0x394799[_0xfc05('0x41')]=[{'all':!![]}];}return db[_0xfc05('0x40')][_0xfc05('0x42')](_0x394799);})[_0xfc05('0x23')](function(_0x1286d1){_0x733edf[_0xfc05('0x43')]=_0x1286d1;return _0x733edf;})[_0xfc05('0x23')](respondWithFilteredResult(_0x3a731f,_0x394799))[_0xfc05('0x44')](handleError(_0x3a731f,null));};exports['show']=function(_0x54cf27,_0x25ce31){var _0x4fe154={'raw':!![],'where':{'id':_0x54cf27[_0xfc05('0x45')]['id']}},_0x5b9153={};_0x5b9153['model']=_[_0xfc05('0x2f')](db[_0xfc05('0x40')][_0xfc05('0x29')]);_0x5b9153[_0xfc05('0x2e')]=_[_0xfc05('0x2f')](_0x54cf27['query']);_0x5b9153[_0xfc05('0x3a')]=_[_0xfc05('0x30')](_0x5b9153[_0xfc05('0x2d')],_0x5b9153[_0xfc05('0x2e')]);_0x4fe154[_0xfc05('0x32')]=_[_0xfc05('0x30')](_0x5b9153[_0xfc05('0x2d')],qs[_0xfc05('0x31')](_0x54cf27[_0xfc05('0x2e')][_0xfc05('0x31')]));_0x4fe154[_0xfc05('0x32')]=_0x4fe154[_0xfc05('0x32')][_0xfc05('0x33')]?_0x4fe154[_0xfc05('0x32')]:_0x5b9153[_0xfc05('0x2d')];if(_0x54cf27['query']['includeAll']){_0x4fe154[_0xfc05('0x41')]=[{'all':!![]}];}_0x4fe154=_['merge']({},_0x4fe154,_0x54cf27[_0xfc05('0x3f')]);return db['VoiceQueuesLog'][_0xfc05('0x46')](_0x4fe154)['then'](handleEntityNotFound(_0x25ce31,null))[_0xfc05('0x23')](respondWithResult(_0x25ce31,null))['catch'](handleError(_0x25ce31,null));};exports[_0xfc05('0x47')]=function(_0x42b7ac,_0x3b5444){return db[_0xfc05('0x40')]['create'](_0x42b7ac[_0xfc05('0x48')],{})[_0xfc05('0x23')](respondWithResult(_0x3b5444,0xc9))[_0xfc05('0x44')](handleError(_0x3b5444,null));};exports['update']=function(_0x27722e,_0x42a4de){if(_0x27722e[_0xfc05('0x48')]['id']){delete _0x27722e[_0xfc05('0x48')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x27722e[_0xfc05('0x45')]['id']}})[_0xfc05('0x23')](handleEntityNotFound(_0x42a4de,null))['then'](saveUpdates(_0x27722e['body'],null))[_0xfc05('0x23')](respondWithResult(_0x42a4de,null))[_0xfc05('0x44')](handleError(_0x42a4de,null));};exports['destroy']=function(_0x3f3934,_0x590b68){return db[_0xfc05('0x40')][_0xfc05('0x46')]({'where':{'id':_0x3f3934['params']['id']}})[_0xfc05('0x23')](handleEntityNotFound(_0x590b68,null))[_0xfc05('0x23')](removeEntity(_0x590b68,null))[_0xfc05('0x44')](handleError(_0x590b68,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index f513bfc..4335c50 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 _0x6ebb=['path','rimraf','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x54a6d4,_0x579d1c){var _0x234e89=function(_0x4fb93b){while(--_0x4fb93b){_0x54a6d4['push'](_0x54a6d4['shift']());}};_0x234e89(++_0x579d1c);}(_0x6ebb,0xcc));var _0xb6eb=function(_0xcb349,_0x50c714){_0xcb349=_0xcb349-0x0;var _0x6abf37=_0x6ebb[_0xcb349];return _0x6abf37;};'use strict';var _=require(_0xb6eb('0x0'));var util=require(_0xb6eb('0x1'));var logger=require(_0xb6eb('0x2'))('api');var moment=require(_0xb6eb('0x3'));var BPromise=require(_0xb6eb('0x4'));var rp=require(_0xb6eb('0x5'));var fs=require('fs');var path=require(_0xb6eb('0x6'));var rimraf=require(_0xb6eb('0x7'));var config=require('../../config/environment');var attributes=require(_0xb6eb('0x8'));module[_0xb6eb('0x9')]=function(_0x1fd5ea,_0x28f1d6){return _0x1fd5ea[_0xb6eb('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0xb6eb('0xb'),'paranoid':![],'indexes':[{'name':_0xb6eb('0xc'),'fields':['event',_0xb6eb('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4c35=['voice_queues_log','event_dtm','event','dtm','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog'];(function(_0x4a6476,_0x4ac25d){var _0x56daa4=function(_0x4b04b7){while(--_0x4b04b7){_0x4a6476['push'](_0x4a6476['shift']());}};_0x56daa4(++_0x4ac25d);}(_0x4c35,0x9a));var _0x54c3=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0x4c35[_0x2d8434];return _0x26b9e4;};'use strict';var _=require('lodash');var util=require(_0x54c3('0x0'));var logger=require(_0x54c3('0x1'))(_0x54c3('0x2'));var moment=require('moment');var BPromise=require(_0x54c3('0x3'));var rp=require(_0x54c3('0x4'));var fs=require('fs');var path=require(_0x54c3('0x5'));var rimraf=require(_0x54c3('0x6'));var config=require(_0x54c3('0x7'));var attributes=require(_0x54c3('0x8'));module[_0x54c3('0x9')]=function(_0x5c8e2f,_0x3a86e1){return _0x5c8e2f['define'](_0x54c3('0xa'),attributes,{'tableName':_0x54c3('0xb'),'paranoid':![],'indexes':[{'name':_0x54c3('0xc'),'fields':[_0x54c3('0xd'),_0x54c3('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index b6c70d8..5356e3c 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 _0x55ea=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x52420f,_0x5ef49c){var _0x4ec53c=function(_0x47c640){while(--_0x47c640){_0x52420f['push'](_0x52420f['shift']());}};_0x4ec53c(++_0x5ef49c);}(_0x55ea,0xc9));var _0xa55e=function(_0x5ce8ce,_0xad22fc){_0x5ce8ce=_0x5ce8ce-0x0;var _0x59497c=_0x55ea[_0x5ce8ce];return _0x59497c;};'use strict';var _=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var moment=require(_0xa55e('0x2'));var BPromise=require('bluebird');var rs=require(_0xa55e('0x3'));var fs=require('fs');var Redis=require(_0xa55e('0x4'));var db=require(_0xa55e('0x5'))['db'];var utils=require(_0xa55e('0x6'));var logger=require(_0xa55e('0x7'))('rpc');var config=require(_0xa55e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a009c,_0x38378e,_0x20f2ac){return new BPromise(function(_0x30b885,_0xca9526){return client[_0xa55e('0x9')](_0x5a009c,_0x20f2ac)[_0xa55e('0xa')](function(_0x32f6f7){logger[_0xa55e('0xb')](_0xa55e('0xc'),_0x38378e,'request\x20sent');logger['debug'](_0xa55e('0xd'),_0x38378e,_0xa55e('0xe'),JSON[_0xa55e('0xf')](_0x32f6f7));if(_0x32f6f7[_0xa55e('0x10')]){if(_0x32f6f7[_0xa55e('0x10')]['code']===0x1f4){logger[_0xa55e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x38378e,_0x32f6f7[_0xa55e('0x10')][_0xa55e('0x11')]);return _0xca9526(_0x32f6f7[_0xa55e('0x10')][_0xa55e('0x11')]);}logger[_0xa55e('0x10')](_0xa55e('0xc'),_0x38378e,_0x32f6f7[_0xa55e('0x10')][_0xa55e('0x11')]);return _0x30b885(_0x32f6f7[_0xa55e('0x10')]['message']);}else{logger[_0xa55e('0xb')](_0xa55e('0xc'),_0x38378e,_0xa55e('0xe'));_0x30b885(_0x32f6f7[_0xa55e('0x12')][_0xa55e('0x11')]);}})[_0xa55e('0x13')](function(_0x585d3a){logger[_0xa55e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x38378e,_0x585d3a);_0xca9526(_0x585d3a);});});} \ No newline at end of file +var _0xd8cc=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x858cf9,_0x95a863){var _0xc8d6c4=function(_0x1ad60d){while(--_0x1ad60d){_0x858cf9['push'](_0x858cf9['shift']());}};_0xc8d6c4(++_0x95a863);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x4e21ba,_0x18097f){_0x4e21ba=_0x4e21ba-0x0;var _0x55b94b=_0xd8cc[_0x4e21ba];return _0x55b94b;};'use strict';var _=require(_0xcd8c('0x0'));var util=require(_0xcd8c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd8c('0x2'));var fs=require('fs');var Redis=require(_0xcd8c('0x3'));var db=require(_0xcd8c('0x4'))['db'];var utils=require(_0xcd8c('0x5'));var logger=require('../../config/logger')(_0xcd8c('0x6'));var config=require(_0xcd8c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcd8c('0x8')][_0xcd8c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55c4ed,_0x16364b,_0x5814b4){return new BPromise(function(_0x4740bf,_0xe2d56b){return client['request'](_0x55c4ed,_0x5814b4)[_0xcd8c('0xa')](function(_0x30c7c7){logger[_0xcd8c('0xb')](_0xcd8c('0xc'),_0x16364b,'request\x20sent');logger[_0xcd8c('0xd')](_0xcd8c('0xe'),_0x16364b,_0xcd8c('0xf'),JSON[_0xcd8c('0x10')](_0x30c7c7));if(_0x30c7c7[_0xcd8c('0x11')]){if(_0x30c7c7[_0xcd8c('0x11')][_0xcd8c('0x12')]===0x1f4){logger[_0xcd8c('0x11')](_0xcd8c('0xc'),_0x16364b,_0x30c7c7['error'][_0xcd8c('0x13')]);return _0xe2d56b(_0x30c7c7['error'][_0xcd8c('0x13')]);}logger[_0xcd8c('0x11')](_0xcd8c('0xc'),_0x16364b,_0x30c7c7['error'][_0xcd8c('0x13')]);return _0x4740bf(_0x30c7c7[_0xcd8c('0x11')][_0xcd8c('0x13')]);}else{logger[_0xcd8c('0xb')](_0xcd8c('0xc'),_0x16364b,_0xcd8c('0xf'));_0x4740bf(_0x30c7c7[_0xcd8c('0x14')]['message']);}})[_0xcd8c('0x15')](function(_0x29e861){logger[_0xcd8c('0x11')](_0xcd8c('0xc'),_0x16364b,_0x29e861);_0xe2d56b(_0x29e861);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index c4d9240..1c9d7d1 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 _0xe086=['/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','/:id','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','download','downloads'];(function(_0x20778c,_0x9c81a0){var _0x32d193=function(_0x43ece6){while(--_0x43ece6){_0x20778c['push'](_0x20778c['shift']());}};_0x32d193(++_0x9c81a0);}(_0xe086,0xba));var _0x6e08=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe086[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6e08('0x0'));var timeout=require('connect-timeout');var express=require(_0x6e08('0x1'));var router=express[_0x6e08('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6e08('0x3'));var interaction=require(_0x6e08('0x4'));var config=require(_0x6e08('0x5'));var controller=require(_0x6e08('0x6'));router[_0x6e08('0x7')]('/',auth['isAuthenticated'](),controller[_0x6e08('0x8')]);router['get'](_0x6e08('0x9'),auth[_0x6e08('0xa')](),controller[_0x6e08('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth[_0x6e08('0xa')](),controller[_0x6e08('0xc')]);router[_0x6e08('0x7')]('/:id/downloads',controller[_0x6e08('0xd')]);router[_0x6e08('0x7')](_0x6e08('0xe'),auth[_0x6e08('0xa')](),controller[_0x6e08('0xf')]);router[_0x6e08('0x10')]('/',auth[_0x6e08('0xa')](),controller[_0x6e08('0x11')]);router[_0x6e08('0x10')](_0x6e08('0xe'),auth['isAuthenticated'](),controller[_0x6e08('0x12')]);router[_0x6e08('0x13')]('/:id',auth[_0x6e08('0xa')](),controller[_0x6e08('0x14')]);router[_0x6e08('0x15')](_0x6e08('0x16'),auth[_0x6e08('0xa')](),controller[_0x6e08('0x17')]);module[_0x6e08('0x18')]=router; \ No newline at end of file +var _0x3a79=['../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x3669ac,_0x3ed038){var _0xe6d479=function(_0xb6e709){while(--_0xb6e709){_0x3669ac['push'](_0x3669ac['shift']());}};_0xe6d479(++_0x3ed038);}(_0x3a79,0xb7));var _0x93a7=function(_0x27022d,_0x1b10d3){_0x27022d=_0x27022d-0x0;var _0x58cc77=_0x3a79[_0x27022d];return _0x58cc77;};'use strict';var multer=require(_0x93a7('0x0'));var util=require(_0x93a7('0x1'));var path=require('path');var timeout=require(_0x93a7('0x2'));var express=require(_0x93a7('0x3'));var router=express[_0x93a7('0x4')]();var fs_extra=require(_0x93a7('0x5'));var auth=require(_0x93a7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x93a7('0x7'));var controller=require(_0x93a7('0x8'));router[_0x93a7('0x9')]('/',auth[_0x93a7('0xa')](),controller[_0x93a7('0xb')]);router['get'](_0x93a7('0xc'),auth[_0x93a7('0xa')](),controller['describe']);router[_0x93a7('0x9')](_0x93a7('0xd'),auth['isAuthenticated'](),controller[_0x93a7('0xe')]);router[_0x93a7('0x9')]('/:id/download',auth[_0x93a7('0xa')](),controller[_0x93a7('0xf')]);router[_0x93a7('0x9')](_0x93a7('0x10'),controller[_0x93a7('0x11')]);router[_0x93a7('0x9')](_0x93a7('0x12'),auth[_0x93a7('0xa')](),controller[_0x93a7('0x13')]);router[_0x93a7('0x14')]('/',auth[_0x93a7('0xa')](),controller['create']);router[_0x93a7('0x14')]('/:id/transcribe',auth[_0x93a7('0xa')](),controller[_0x93a7('0x15')]);router[_0x93a7('0x16')](_0x93a7('0xd'),auth[_0x93a7('0xa')](),controller[_0x93a7('0x17')]);router[_0x93a7('0x18')](_0x93a7('0xd'),auth['isAuthenticated'](),controller[_0x93a7('0x19')]);module[_0x93a7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index cec422c..d46e7d7 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(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 d055a68..33392b6 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 _0xb439=['save','then','destroy','status','error','name','send','index','map','VoiceRecording','fieldName','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','update','describe','download','../../components/encryptor','value','existsSync','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','sequelize','MD5','col','token','uniqueid','push','$and','decryptFile','secrets','extname','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','transcribe','language','Transcribe\x20not\x20configured','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','fs-extra','lodash','squel','jsforce','to-csv','aws-sdk','uuid/v4','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x25a907,_0x14d0fb){var _0x2c2566=function(_0x5e74cb){while(--_0x5e74cb){_0x25a907['push'](_0x25a907['shift']());}};_0x2c2566(++_0x14d0fb);}(_0xb439,0x194));var _0x9b43=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb439[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x9b43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b43('0x1'));var jsonpatch=require(_0x9b43('0x2'));var rp=require(_0x9b43('0x3'));var moment=require('moment');var BPromise=require(_0x9b43('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9b43('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b43('0x6'));var _=require(_0x9b43('0x7'));var squel=require(_0x9b43('0x8'));var crypto=require('crypto');var jsforce=require(_0x9b43('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x9b43('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0x9b43('0xb'));var uuidv4=require(_0x9b43('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9b43('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b43('0xe'));var logger=require('../../config/logger')(_0x9b43('0xf'));var utils=require(_0x9b43('0x10'));var config=require(_0x9b43('0x11'));var licenseUtil=require(_0x9b43('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x524842,_0x49f9f8){_0x49f9f8=_0x49f9f8||0xcc;return function(_0x4a4dcb){if(_0x4a4dcb){return _0x524842[_0x9b43('0x13')](_0x49f9f8);}return _0x524842['status'](_0x49f9f8)[_0x9b43('0x14')]();};}function respondWithResult(_0x2eece7,_0x9f7f2d){_0x9f7f2d=_0x9f7f2d||0xc8;return function(_0x5a56a2){if(_0x5a56a2){return _0x2eece7['status'](_0x9f7f2d)[_0x9b43('0x15')](_0x5a56a2);}};}function respondWithFilteredResult(_0x1124ff,_0x50d207){return function(_0x3d9ae7){if(_0x3d9ae7){var _0x1082b8=typeof _0x50d207[_0x9b43('0x16')]===_0x9b43('0x17')&&typeof _0x50d207['limit']===_0x9b43('0x17');var _0x3d5de0=_0x3d9ae7[_0x9b43('0x18')];var _0x475f1a=_0x1082b8?0x0:_0x50d207[_0x9b43('0x16')];var _0x655979=_0x1082b8?_0x3d9ae7[_0x9b43('0x18')]:_0x50d207[_0x9b43('0x16')]+_0x50d207[_0x9b43('0x19')];var _0x2737ef;if(_0x655979>=_0x3d5de0){_0x655979=_0x3d5de0;_0x2737ef=0xc8;}else{_0x2737ef=0xce;}_0x1124ff['status'](_0x2737ef);return _0x1124ff[_0x9b43('0x1a')](_0x9b43('0x1b'),_0x475f1a+'-'+_0x655979+'/'+_0x3d5de0)[_0x9b43('0x15')](_0x3d9ae7);}return null;};}function patchUpdates(_0x56caf6){return function(_0x1ab644){try{jsonpatch['apply'](_0x1ab644,_0x56caf6,!![]);}catch(_0x526bf7){return BPromise['reject'](_0x526bf7);}return _0x1ab644[_0x9b43('0x1c')]();};}function saveUpdates(_0x279773,_0x490147){return function(_0x5b847b){if(_0x5b847b){return _0x5b847b['update'](_0x279773)[_0x9b43('0x1d')](function(_0x4e2926){return _0x4e2926;});}return null;};}function removeEntity(_0x8b70f2,_0x178266){return function(_0x1b625f){if(_0x1b625f){return _0x1b625f[_0x9b43('0x1e')]()[_0x9b43('0x1d')](function(){_0x8b70f2[_0x9b43('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fba5,_0x49d406){return function(_0x571540){if(!_0x571540){_0x56fba5['sendStatus'](0x194);}return _0x571540;};}function handleError(_0x2c4e66,_0x70de2d){_0x70de2d=_0x70de2d||0x1f4;return function(_0x28d1de){logger[_0x9b43('0x20')](_0x28d1de['stack']);if(_0x28d1de[_0x9b43('0x21')]){delete _0x28d1de[_0x9b43('0x21')];}_0x2c4e66['status'](_0x70de2d)[_0x9b43('0x22')](_0x28d1de);};}exports[_0x9b43('0x23')]=function(_0x3a4e93,_0x3a3a9e){var _0x57eb1b={},_0x410b44={},_0x44e976={'count':0x0,'rows':[]};var _0x4f8d5f=_[_0x9b43('0x24')](db[_0x9b43('0x25')]['rawAttributes'],function(_0x53e263){return{'name':_0x53e263[_0x9b43('0x26')],'type':_0x53e263['type']['key']};});_0x410b44[_0x9b43('0x27')]=_[_0x9b43('0x28')](_[_0x9b43('0x24')](_0x4f8d5f,_0x9b43('0x21')),[_0x9b43('0x29')]);_0x410b44[_0x9b43('0x2a')]=_[_0x9b43('0x2b')](_0x3a4e93[_0x9b43('0x2a')]);_0x410b44[_0x9b43('0x2c')]=_[_0x9b43('0x2d')](_0x410b44['model'],_0x410b44[_0x9b43('0x2a')]);_0x57eb1b['attributes']=_[_0x9b43('0x2d')](_0x410b44[_0x9b43('0x27')],qs[_0x9b43('0x2e')](_0x3a4e93[_0x9b43('0x2a')]['fields']));_0x57eb1b['attributes']=_0x57eb1b[_0x9b43('0x2f')]['length']?_0x57eb1b[_0x9b43('0x2f')]:_0x410b44['model'];if(!_0x3a4e93['query']['hasOwnProperty']('nolimit')){_0x57eb1b['limit']=qs[_0x9b43('0x19')](_0x3a4e93[_0x9b43('0x2a')][_0x9b43('0x19')]);_0x57eb1b['offset']=qs['offset'](_0x3a4e93[_0x9b43('0x2a')][_0x9b43('0x16')]);}_0x57eb1b[_0x9b43('0x30')]=qs[_0x9b43('0x31')](_0x3a4e93['query'][_0x9b43('0x31')]);_0x57eb1b[_0x9b43('0x32')]=qs[_0x9b43('0x2c')](_[_0x9b43('0x33')](_0x3a4e93[_0x9b43('0x2a')],_0x410b44['filters']),_0x4f8d5f);if(_0x3a4e93['query']['filter']){_0x57eb1b[_0x9b43('0x32')]=_['merge'](_0x57eb1b[_0x9b43('0x32')],{'$or':_[_0x9b43('0x24')](_0x4f8d5f,function(_0x1a9672){if(_0x1a9672[_0x9b43('0x34')]!==_0x9b43('0x35')){var _0x21f1a6={};_0x21f1a6[_0x1a9672[_0x9b43('0x21')]]={'$like':'%'+_0x3a4e93['query'][_0x9b43('0x36')]+'%'};return _0x21f1a6;}})});}_0x57eb1b=_[_0x9b43('0x37')]({},_0x57eb1b,_0x3a4e93[_0x9b43('0x38')]);var _0x475f16={'where':_0x57eb1b['where']};return db[_0x9b43('0x25')]['count'](_0x475f16)[_0x9b43('0x1d')](function(_0x5a2cc1){_0x44e976[_0x9b43('0x18')]=_0x5a2cc1;if(_0x3a4e93[_0x9b43('0x2a')][_0x9b43('0x39')]){_0x57eb1b[_0x9b43('0x3a')]=[{'all':!![]}];}return db['VoiceRecording'][_0x9b43('0x3b')](_0x57eb1b);})['then'](function(_0x1c8e2d){_0x44e976['rows']=_0x1c8e2d;return _0x44e976;})[_0x9b43('0x1d')](respondWithFilteredResult(_0x3a3a9e,_0x57eb1b))[_0x9b43('0x3c')](handleError(_0x3a3a9e,null));};exports[_0x9b43('0x3d')]=function(_0x20d926,_0x570a08){var _0x346fc6={'raw':![],'where':{'id':_0x20d926[_0x9b43('0x3e')]['id']}},_0x3b97df={};_0x3b97df[_0x9b43('0x27')]=_[_0x9b43('0x2b')](db[_0x9b43('0x25')][_0x9b43('0x3f')]);_0x3b97df[_0x9b43('0x2a')]=_[_0x9b43('0x2b')](_0x20d926[_0x9b43('0x2a')]);_0x3b97df['filters']=_[_0x9b43('0x2d')](_0x3b97df[_0x9b43('0x27')],_0x3b97df[_0x9b43('0x2a')]);_0x346fc6['attributes']=_['intersection'](_0x3b97df[_0x9b43('0x27')],qs[_0x9b43('0x2e')](_0x20d926[_0x9b43('0x2a')][_0x9b43('0x2e')]));_0x346fc6['attributes']=_0x346fc6[_0x9b43('0x2f')][_0x9b43('0x40')]?_0x346fc6['attributes']:_0x3b97df['model'];if(_0x20d926[_0x9b43('0x2a')][_0x9b43('0x39')]){_0x346fc6[_0x9b43('0x3a')]=[{'all':!![]}];}_0x346fc6=_['merge']({},_0x346fc6,_0x20d926[_0x9b43('0x38')]);return db[_0x9b43('0x25')][_0x9b43('0x41')](_0x346fc6)[_0x9b43('0x1d')](handleEntityNotFound(_0x570a08,null))[_0x9b43('0x1d')](respondWithResult(_0x570a08,null))['catch'](handleError(_0x570a08,null));};exports['create']=function(_0x471ef7,_0x4982f8){return db[_0x9b43('0x25')][_0x9b43('0x42')](_0x471ef7[_0x9b43('0x43')],{})[_0x9b43('0x1d')](respondWithResult(_0x4982f8,0xc9))[_0x9b43('0x3c')](handleError(_0x4982f8,null));};exports[_0x9b43('0x44')]=function(_0xe7946b,_0xc2956f){if(_0xe7946b[_0x9b43('0x43')]['id']){delete _0xe7946b['body']['id'];}return db[_0x9b43('0x25')][_0x9b43('0x41')]({'where':{'id':_0xe7946b['params']['id']}})['then'](handleEntityNotFound(_0xc2956f,null))[_0x9b43('0x1d')](saveUpdates(_0xe7946b[_0x9b43('0x43')],null))[_0x9b43('0x1d')](respondWithResult(_0xc2956f,null))['catch'](handleError(_0xc2956f,null));};exports['describe']=function(_0x55bb36,_0x3a1ef7){return db[_0x9b43('0x25')][_0x9b43('0x45')]()[_0x9b43('0x1d')](respondWithResult(_0x3a1ef7,null))[_0x9b43('0x3c')](handleError(_0x3a1ef7,null));};exports[_0x9b43('0x46')]=function(_0x4ad6fe,_0x461a8c,_0x47f5a8){var _0x178107=require(_0x9b43('0x47'));var _0x2a7c91=![];var _0xf86383={};if(_0x4ad6fe[_0x9b43('0x2a')]['type']&&_0x4ad6fe[_0x9b43('0x2a')][_0x9b43('0x34')]==='uniqueid'){_0xf86383['uniqueid']=_0x4ad6fe[_0x9b43('0x3e')]['id'];}else{_0xf86383['id']=_0x4ad6fe['params']['id'];}return db[_0x9b43('0x25')][_0x9b43('0x41')]({'where':_0xf86383,'attributes':['id',_0x9b43('0x48')],'raw':!![]})[_0x9b43('0x1d')](handleEntityNotFound(_0x461a8c,null))[_0x9b43('0x1d')](function(_0x11821b){if(_0x11821b){var _0x2ed2fd=_0x11821b[_0x9b43('0x48')];var _0x49f4a2=util[_0x9b43('0x29')]('%s.cypher',_0x2ed2fd);if(fs[_0x9b43('0x49')](_0x49f4a2)){_0x2a7c91=!![];return _0x178107['decryptFile'](_0x49f4a2,_0x2ed2fd,config['secrets'][_0x9b43('0x4a')])[_0x9b43('0x1d')](function(){return _0x11821b;});}return _0x11821b;}})['then'](function(_0x4415bf){if(_0x4415bf){var _0x1487d7=_0x4415bf['value'];if(!fs['existsSync'](_0x1487d7)){throw new db[(_0x9b43('0x4b'))][(_0x9b43('0x4c'))](_0x9b43('0x4d'));}if(_0x4415bf['filename']){return _0x461a8c[_0x9b43('0x46')](_0x1487d7,_0x4415bf[_0x9b43('0x4e')]+path['extname'](_0x1487d7),function(){if(_0x2a7c91){fs['unlink'](_0x1487d7);}});}else{return _0x461a8c[_0x9b43('0x46')](_0x1487d7,function(_0x42458d){if(_0x2a7c91){fs[_0x9b43('0x4f')](_0x1487d7);}});}}})['catch'](function(_0x3c5b1f){if(_0x3c5b1f['message']===_0x9b43('0x4d')){_0x461a8c[_0x9b43('0x1f')](0x194)['send'](_0x9b43('0x50'));}else{return handleError(_0x461a8c,null);}});};exports['downloads']=function(_0x4bb5de,_0x29bfa5,_0x1b5c75){var _0x32a73f=require('../../components/encryptor');var _0x47c0d8=![];var _0x33ea41={'$and':[db[_0x9b43('0x51')][_0x9b43('0x32')](db[_0x9b43('0x51')]['fn'](_0x9b43('0x52'),db[_0x9b43('0x51')][_0x9b43('0x53')]('uniqueid')),_0x4bb5de[_0x9b43('0x2a')][_0x9b43('0x54')])]};if(_0x4bb5de[_0x9b43('0x2a')][_0x9b43('0x34')]&&_0x4bb5de[_0x9b43('0x2a')][_0x9b43('0x34')]===_0x9b43('0x55')){_0x33ea41['$and'][_0x9b43('0x56')]({'uniqueid':_0x4bb5de[_0x9b43('0x3e')]['id']});}else{_0x33ea41[_0x9b43('0x57')][_0x9b43('0x56')]({'id':_0x4bb5de[_0x9b43('0x3e')]['id']});}return db['VoiceRecording'][_0x9b43('0x41')]({'where':_0x33ea41,'attributes':['id',_0x9b43('0x48')],'raw':!![]})[_0x9b43('0x1d')](handleEntityNotFound(_0x29bfa5,null))['then'](function(_0xb8d0d6){if(_0xb8d0d6){var _0x4a427a=util[_0x9b43('0x29')]('%s.cypher',_0xb8d0d6['value']);if(fs['existsSync'](_0x4a427a)){_0x47c0d8=!![];return _0x32a73f[_0x9b43('0x58')](_0x4a427a,_0xb8d0d6[_0x9b43('0x48')],config[_0x9b43('0x59')][_0x9b43('0x4a')])[_0x9b43('0x1d')](function(){return _0xb8d0d6;});}return _0xb8d0d6;}})[_0x9b43('0x1d')](function(_0x42d6ae){if(_0x42d6ae){if(!fs[_0x9b43('0x49')](_0x42d6ae['value'])){throw new db[(_0x9b43('0x4b'))][(_0x9b43('0x4c'))]('VoiceRecording\x20not\x20found');}if(_0x42d6ae[_0x9b43('0x4e')]){return _0x29bfa5[_0x9b43('0x46')](_0x42d6ae[_0x9b43('0x48')],_0x42d6ae[_0x9b43('0x4e')]+path[_0x9b43('0x5a')](_0x42d6ae[_0x9b43('0x48')]),function(){if(_0x47c0d8){fs[_0x9b43('0x4f')](_0x42d6ae[_0x9b43('0x48')]);}});}else{return _0x29bfa5[_0x9b43('0x46')](_0x42d6ae[_0x9b43('0x48')],function(_0x5954da){if(_0x47c0d8){fs[_0x9b43('0x4f')](_0x42d6ae[_0x9b43('0x48')]);}});}}})['catch'](handleError(_0x29bfa5,null));};exports[_0x9b43('0x1e')]=function(_0x4d5e91,_0x1a7c9b){return db[_0x9b43('0x25')][_0x9b43('0x41')]({'where':{'id':_0x4d5e91[_0x9b43('0x3e')]['id']}})[_0x9b43('0x1d')](function(_0x207314){if(_[_0x9b43('0x5b')](_0x207314)){throw new ReferenceError(_0x9b43('0x5c'));}return _0x207314;})[_0x9b43('0x1d')](function(_0x3b0b6c){var _0x1db98e=_0x3b0b6c[_0x9b43('0x48')];logger[_0x9b43('0x5d')]('cancellazione\x20fisica\x20documento\x20%s',_0x1db98e);if(!_[_0x9b43('0x5b')](_0x3b0b6c[_0x9b43('0x48')])&&fs[_0x9b43('0x49')](_0x1db98e)){logger[_0x9b43('0x5d')](_0x9b43('0x5e')+_0x1db98e+_0x9b43('0x5f'));fs[_0x9b43('0x60')](_0x1db98e);}_0x1db98e=_0x1db98e+'.cypher';if(!_[_0x9b43('0x5b')](_0x3b0b6c['value'])&&fs['existsSync'](_0x1db98e)){logger[_0x9b43('0x5d')](_0x9b43('0x5e')+_0x1db98e+_0x9b43('0x5f'));fs[_0x9b43('0x60')](_0x1db98e);}return _0x3b0b6c;})['then'](function(_0x2ddee7){if(!_0x2ddee7)throw new InternalError();return _0x2ddee7[_0x9b43('0x1e')]();})[_0x9b43('0x1d')](function(){_0x1a7c9b[_0x9b43('0x1f')](0xcc)['end']();})[_0x9b43('0x3c')](handleError(_0x1a7c9b,null));};function getBucketslist(_0x3abdd1,_0x7c784c,_0xb2dc26){return new Promise(function(_0x3f90a2,_0x3525e1){var _0x455035=new AWS['S3']({'accessKeyId':_0x7c784c,'secretAccessKey':_0x3abdd1,'region':_0xb2dc26});_0x455035[_0x9b43('0x61')]({},function(_0xbc5c87,_0x3d2164){if(_0xbc5c87){return _0x3525e1(_0xbc5c87);}else{return _0x3f90a2(_0x3d2164);}});});}function createBucket(_0x266460,_0x2593df,_0x52c0ba,_0x35951e){return new Promise(function(_0x24fdc8,_0x17bec3){var _0x565533=new AWS['S3']({'accessKeyId':_0x2593df,'secretAccessKey':_0x266460,'region':_0x52c0ba});_0x565533[_0x9b43('0x62')]({'Bucket':_0x35951e},function(_0x1e4eef,_0x517a06){if(_0x1e4eef){return _0x17bec3(_0x1e4eef);}else{return _0x24fdc8(_0x517a06);}});});}function uploadFile(_0x13bd9d,_0x562461,_0x4c8d6f,_0x15eb04,_0x4e5087,_0x19e962){return new Promise(function(_0x221b99,_0x435038){var _0x450ca1=new AWS['S3']({'accessKeyId':_0x562461,'secretAccessKey':_0x13bd9d,'region':_0x4c8d6f});_0x450ca1[_0x9b43('0x63')]({'Bucket':_0x15eb04,'Key':_0x4e5087,'Body':_0x19e962},function(_0x115dcf,_0x6e1320){if(_0x115dcf){return _0x435038(_0x115dcf);}else{return _0x221b99(_0x6e1320);}});});}function startTranscribe(_0x30d7b9,_0x446a20,_0x1f420e,_0x40beda,_0x514660,_0x2a0a23){return new Promise(function(_0xe6e65b,_0x8bda7f){var _0x192429=new AWS[(_0x9b43('0x64'))]({'accessKeyId':_0x446a20,'secretAccessKey':_0x30d7b9,'region':_0x1f420e});_0x192429[_0x9b43('0x65')]({'TranscriptionJobName':_0x40beda,'LanguageCode':_0x514660,'Media':{'MediaFileUri':_0x2a0a23}},function(_0x21a193,_0x33c428){if(_0x21a193){return _0x8bda7f(_0x21a193);}else{return _0xe6e65b(_0x33c428);}});});}function transcribe(_0x29a121,_0x344fc7,_0x4cfa44,_0x1e2a65,_0x4cc904,_0x4526f5,_0x94a153){return new Promise(function(_0x163440,_0x162ea8){var _0x3a0158={};logger[_0x9b43('0x5d')](util['format'](_0x9b43('0x66'),_0x29a121,_0x4cc904));return uploadFile(_0x344fc7,_0x4cfa44,_0x1e2a65,_0x4cc904,path[_0x9b43('0x67')](_0x4526f5),fs[_0x9b43('0x68')](_0x4526f5))[_0x9b43('0x1d')](function(_0x1165cc){logger[_0x9b43('0x5d')](util[_0x9b43('0x29')](_0x9b43('0x69'),_0x29a121,_0x4cc904,_0x1165cc['Location']));_0x3a0158[_0x9b43('0x6a')]=_0x1165cc[_0x9b43('0x6b')];_0x3a0158[_0x9b43('0x6c')]=_0x1165cc[_0x9b43('0x6d')];logger[_0x9b43('0x5d')](util[_0x9b43('0x29')](_0x9b43('0x6e'),_0x29a121));return startTranscribe(_0x344fc7,_0x4cfa44,_0x1e2a65,uuidv4(),_0x94a153,_0x1165cc['Location']);})[_0x9b43('0x1d')](function(_0x16a75e){logger[_0x9b43('0x5d')](util[_0x9b43('0x29')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x29a121,_0x16a75e['TranscriptionJob'][_0x9b43('0x6f')]));_0x3a0158[_0x9b43('0x70')]=_0x16a75e[_0x9b43('0x71')]['TranscriptionJobName'];_0x3a0158[_0x9b43('0x72')]=_0x16a75e[_0x9b43('0x71')]['TranscriptionJobStatus'];return _0x163440(_0x3a0158);})[_0x9b43('0x3c')](function(_0x932e3){return _0x162ea8(_0x932e3);});});}exports[_0x9b43('0x73')]=function(_0x1fdce7,_0x2c1789,_0x26aba0){var _0x525c11;var _0x2a5971;var _0x4bb48c;var _0x5b04e7=require(_0x9b43('0x47'));return db['VoiceRecording'][_0x9b43('0x74')]({'where':{'id':_0x1fdce7['params']['id']}})['then'](function(_0x16379c){if(_0x16379c){var _0x166612=util['format'](_0x9b43('0x75'),_0x16379c[_0x9b43('0x48')]);if(fs[_0x9b43('0x49')](_0x166612)){cypher=!![];return _0x5b04e7[_0x9b43('0x58')](_0x166612,_0x16379c[_0x9b43('0x48')],config[_0x9b43('0x59')][_0x9b43('0x4a')])[_0x9b43('0x1d')](function(){return _0x16379c;});}return _0x16379c;}})[_0x9b43('0x1d')](function(_0x15a762){if(!_0x15a762){throw new db[(_0x9b43('0x4b'))][(_0x9b43('0x4c'))](_0x9b43('0x76'));}_0x2a5971=_0x15a762;return db['Setting'][_0x9b43('0x74')]({'where':{'id':0x1}});})[_0x9b43('0x1d')](handleEntityNotFound(_0x2c1789,null))['then'](function(_0x2adda0){if(_0x2adda0){_0x525c11=_0x2adda0;if(!_0x525c11[_0x9b43('0x77')]||!_0x525c11['transcribeAccountId']||!_0x525c11['transcribeRegion']||!_0x525c11[_0x9b43('0x78')]||!_0x525c11[_0x9b43('0x6a')]){throw new db['Sequelize'][(_0x9b43('0x4c'))](_0x9b43('0x79'));}if(_0x1fdce7[_0x9b43('0x43')]['runSentiment']&&(!_0x525c11['sentiment']||!_0x525c11[_0x9b43('0x7a')]||!_0x525c11['sentimentRegion']||!_0x525c11[_0x9b43('0x78')]||!_0x525c11['bucket'])){throw new db['Sequelize']['ValidationError'](_0x9b43('0x7b'));}return db[_0x9b43('0x7c')]['findOne']({'where':{'id':_0x525c11[_0x9b43('0x7d')]}});}})[_0x9b43('0x1d')](function(_0x1a3ae2){if(!_0x1a3ae2){throw new db['Sequelize'][(_0x9b43('0x4c'))](_0x9b43('0x7e'));}if(!_0x1a3ae2[_0x9b43('0x7f')]||!_0x1a3ae2['data2']){throw new db[(_0x9b43('0x4b'))]['ValidationError'](_0x9b43('0x80'));}_0x4bb48c=_0x1a3ae2;return getBucketslist(_0x4bb48c[_0x9b43('0x7f')],_0x4bb48c[_0x9b43('0x81')],_0x525c11[_0x9b43('0x82')]);})[_0x9b43('0x1d')](function(_0x361248){if(_0x361248&&_0x361248[_0x9b43('0x83')]){var _0x3f4025=_[_0x9b43('0x41')](_0x361248[_0x9b43('0x83')],function(_0xa36916){return _0xa36916[_0x9b43('0x84')]===_0x525c11[_0x9b43('0x6a')];});if(!_0x3f4025){logger[_0x9b43('0x5d')](util['format'](_0x9b43('0x85'),_0x1fdce7[_0x9b43('0x3e')]['id'],_0x525c11[_0x9b43('0x6a')]));return createBucket(_0x4bb48c[_0x9b43('0x7f')],_0x4bb48c[_0x9b43('0x81')],_0x525c11['transcribeRegion'],_0x525c11[_0x9b43('0x6a')]);}logger[_0x9b43('0x5d')](util[_0x9b43('0x29')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x1fdce7['params']['id'],_0x525c11[_0x9b43('0x6a')]));return;}})[_0x9b43('0x1d')](function(_0x5de0cb){if(_0x2a5971[_0x9b43('0x72')]===_0x9b43('0x86')){return transcribe(_0x1fdce7[_0x9b43('0x3e')]['id'],_0x4bb48c['data1'],_0x4bb48c[_0x9b43('0x81')],_0x525c11[_0x9b43('0x82')],_0x525c11['bucket'],_0x2a5971[_0x9b43('0x48')],_0x525c11[_0x9b43('0x78')]);}else{logger[_0x9b43('0x5d')](util['format'](_0x9b43('0x87'),_0x1fdce7[_0x9b43('0x3e')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x9b43('0x1d')](function(_0x217e8c){if(_0x217e8c){_0x217e8c[_0x9b43('0x88')]=_0x1fdce7['body'][_0x9b43('0x89')];return _0x2a5971['updateAttributes'](_0x217e8c);}})[_0x9b43('0x1d')](respondWithResult(_0x2c1789,null))[_0x9b43('0x3c')](handleError(_0x2c1789,null));};function writeFile(_0x390e99,_0x3d11ac){return new Promise(function(_0x48bd12,_0x3c1847){fs['writeFile'](_0x3d11ac,_0x390e99,function(_0x442ebc,_0x14937f){if(_0x442ebc){return _0x3c1847(_0x442ebc);}else{return _0x48bd12(_0x14937f);}});});}exports[_0x9b43('0x8a')]=function(_0x326585,_0x447dbb,_0x1d3571){return db[_0x9b43('0x25')][_0x9b43('0x74')]({'where':{'id':_0x326585[_0x9b43('0x3e')]['id']}})[_0x9b43('0x1d')](handleEntityNotFound(_0x447dbb))[_0x9b43('0x1d')](function(_0x122dc3){if(_0x122dc3&&_0x122dc3['fileText']){var _0x251468=_0x122dc3[_0x9b43('0x8b')];var _0x227d77=config[_0x9b43('0x8c')]+_0x9b43('0x8d')+_0x122dc3['id']+_0x9b43('0x8e');if(fs[_0x9b43('0x49')](_0x227d77)){return _0x227d77;}return writeFile(_0x251468,_0x227d77)[_0x9b43('0x1d')](function(){return _0x227d77;});}else{throw new db[(_0x9b43('0x4b'))]['ValidationError'](_0x9b43('0x8f'));}})['then'](function(_0x2c46d7){return _0x447dbb[_0x9b43('0x46')](_0x2c46d7);})[_0x9b43('0x3c')](handleError(_0x447dbb));}; \ No newline at end of file +var _0x7958=['show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','recording','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','$and','push','%s.cypher','secrets','ValidationError','extname','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','createBucket','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','runTranscribe','Setting','findOne','transcribe','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x7958,0xe7));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8795('0x0'));var rimraf=require(_0x8795('0x1'));var zipdir=require(_0x8795('0x2'));var jsonpatch=require(_0x8795('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8795('0x4'));var util=require(_0x8795('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8795('0x6'));var ejs=require(_0x8795('0x7'));var fs=require('fs');var fs_extra=require(_0x8795('0x8'));var _=require(_0x8795('0x9'));var squel=require('squel');var crypto=require(_0x8795('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8795('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8795('0xc'));var Papa=require(_0x8795('0xd'));var AWS=require(_0x8795('0xe'));var uuidv4=require(_0x8795('0xf'));var Redis=require(_0x8795('0x10'));var authService=require(_0x8795('0x11'));var qs=require(_0x8795('0x12'));var as=require(_0x8795('0x13'));var hardwareService=require(_0x8795('0x14'));var logger=require(_0x8795('0x15'))(_0x8795('0x16'));var utils=require(_0x8795('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8795('0x18'));var db=require(_0x8795('0x19'))['db'];function respondWithStatusCode(_0x546f49,_0x169f67){_0x169f67=_0x169f67||0xcc;return function(_0x2c718f){if(_0x2c718f){return _0x546f49[_0x8795('0x1a')](_0x169f67);}return _0x546f49[_0x8795('0x1b')](_0x169f67)['end']();};}function respondWithResult(_0x4abb30,_0x22b23a){_0x22b23a=_0x22b23a||0xc8;return function(_0x2098cc){if(_0x2098cc){return _0x4abb30['status'](_0x22b23a)[_0x8795('0x1c')](_0x2098cc);}};}function respondWithFilteredResult(_0x508627,_0x2a9172){return function(_0x44fb03){if(_0x44fb03){var _0x25f7ce=typeof _0x2a9172[_0x8795('0x1d')]===_0x8795('0x1e')&&typeof _0x2a9172[_0x8795('0x1f')]==='undefined';var _0x4fa16e=_0x44fb03[_0x8795('0x20')];var _0x25bb4d=_0x25f7ce?0x0:_0x2a9172[_0x8795('0x1d')];var _0x591232=_0x25f7ce?_0x44fb03['count']:_0x2a9172['offset']+_0x2a9172[_0x8795('0x1f')];var _0x29aa9a;if(_0x591232>=_0x4fa16e){_0x591232=_0x4fa16e;_0x29aa9a=0xc8;}else{_0x29aa9a=0xce;}_0x508627[_0x8795('0x1b')](_0x29aa9a);return _0x508627[_0x8795('0x21')](_0x8795('0x22'),_0x25bb4d+'-'+_0x591232+'/'+_0x4fa16e)['json'](_0x44fb03);}return null;};}function patchUpdates(_0x40c006){return function(_0x210d48){try{jsonpatch['apply'](_0x210d48,_0x40c006,!![]);}catch(_0x4f5ecf){return BPromise['reject'](_0x4f5ecf);}return _0x210d48['save']();};}function saveUpdates(_0x19d662,_0x33acd4){return function(_0x2a2a54){if(_0x2a2a54){return _0x2a2a54[_0x8795('0x23')](_0x19d662)[_0x8795('0x24')](function(_0x223e53){return _0x223e53;});}return null;};}function removeEntity(_0x10c7d1,_0x45768b){return function(_0x3f6ae9){if(_0x3f6ae9){return _0x3f6ae9[_0x8795('0x25')]()['then'](function(){_0x10c7d1[_0x8795('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10531c,_0x393210){return function(_0xf013d1){if(!_0xf013d1){_0x10531c[_0x8795('0x1a')](0x194);}return _0xf013d1;};}function handleError(_0x4117dd,_0xcd202){_0xcd202=_0xcd202||0x1f4;return function(_0x1fa0fa){logger[_0x8795('0x26')](_0x1fa0fa[_0x8795('0x27')]);if(_0x1fa0fa[_0x8795('0x28')]){delete _0x1fa0fa[_0x8795('0x28')];}_0x4117dd[_0x8795('0x1b')](_0xcd202)[_0x8795('0x29')](_0x1fa0fa);};}exports['index']=function(_0x51a53c,_0x5cd06d){var _0x3cc0e8={},_0x44b62d={},_0x3152b7={'count':0x0,'rows':[]};var _0x441bdb=_[_0x8795('0x2a')](db[_0x8795('0x2b')][_0x8795('0x2c')],function(_0x10dc0e){return{'name':_0x10dc0e['fieldName'],'type':_0x10dc0e[_0x8795('0x2d')][_0x8795('0x2e')]};});_0x44b62d[_0x8795('0x2f')]=_[_0x8795('0x30')](_[_0x8795('0x2a')](_0x441bdb,_0x8795('0x28')),[_0x8795('0x31')]);_0x44b62d[_0x8795('0x32')]=_[_0x8795('0x33')](_0x51a53c[_0x8795('0x32')]);_0x44b62d['filters']=_[_0x8795('0x34')](_0x44b62d[_0x8795('0x2f')],_0x44b62d[_0x8795('0x32')]);_0x3cc0e8[_0x8795('0x35')]=_[_0x8795('0x34')](_0x44b62d[_0x8795('0x2f')],qs[_0x8795('0x36')](_0x51a53c[_0x8795('0x32')][_0x8795('0x36')]));_0x3cc0e8[_0x8795('0x35')]=_0x3cc0e8[_0x8795('0x35')][_0x8795('0x37')]?_0x3cc0e8[_0x8795('0x35')]:_0x44b62d[_0x8795('0x2f')];if(!_0x51a53c[_0x8795('0x32')][_0x8795('0x38')]('nolimit')){_0x3cc0e8['limit']=qs[_0x8795('0x1f')](_0x51a53c['query'][_0x8795('0x1f')]);_0x3cc0e8[_0x8795('0x1d')]=qs[_0x8795('0x1d')](_0x51a53c['query'][_0x8795('0x1d')]);}_0x3cc0e8['order']=qs[_0x8795('0x39')](_0x51a53c[_0x8795('0x32')][_0x8795('0x39')]);_0x3cc0e8[_0x8795('0x3a')]=qs[_0x8795('0x3b')](_[_0x8795('0x3c')](_0x51a53c['query'],_0x44b62d[_0x8795('0x3b')]),_0x441bdb);if(_0x51a53c[_0x8795('0x32')][_0x8795('0x3d')]){_0x3cc0e8[_0x8795('0x3a')]=_[_0x8795('0x3e')](_0x3cc0e8['where'],{'$or':_['map'](_0x441bdb,function(_0x7c7f22){if(_0x7c7f22[_0x8795('0x2d')]!==_0x8795('0x3f')){var _0x1b0747={};_0x1b0747[_0x7c7f22[_0x8795('0x28')]]={'$like':'%'+_0x51a53c['query']['filter']+'%'};return _0x1b0747;}})});}_0x3cc0e8=_[_0x8795('0x3e')]({},_0x3cc0e8,_0x51a53c['options']);var _0x5df034={'where':_0x3cc0e8[_0x8795('0x3a')]};return db['VoiceRecording'][_0x8795('0x20')](_0x5df034)[_0x8795('0x24')](function(_0x2b86be){_0x3152b7['count']=_0x2b86be;if(_0x51a53c[_0x8795('0x32')][_0x8795('0x40')]){_0x3cc0e8[_0x8795('0x41')]=[{'all':!![]}];}return db[_0x8795('0x2b')][_0x8795('0x42')](_0x3cc0e8);})[_0x8795('0x24')](function(_0x3c68ad){_0x3152b7[_0x8795('0x43')]=_0x3c68ad;return _0x3152b7;})['then'](respondWithFilteredResult(_0x5cd06d,_0x3cc0e8))[_0x8795('0x44')](handleError(_0x5cd06d,null));};exports[_0x8795('0x45')]=function(_0x3cb331,_0xc05908){var _0x1538f7={'raw':![],'where':{'id':_0x3cb331[_0x8795('0x46')]['id']}},_0x526f45={};_0x526f45[_0x8795('0x2f')]=_[_0x8795('0x33')](db[_0x8795('0x2b')][_0x8795('0x2c')]);_0x526f45[_0x8795('0x32')]=_[_0x8795('0x33')](_0x3cb331['query']);_0x526f45[_0x8795('0x3b')]=_['intersection'](_0x526f45[_0x8795('0x2f')],_0x526f45['query']);_0x1538f7[_0x8795('0x35')]=_[_0x8795('0x34')](_0x526f45[_0x8795('0x2f')],qs[_0x8795('0x36')](_0x3cb331[_0x8795('0x32')][_0x8795('0x36')]));_0x1538f7[_0x8795('0x35')]=_0x1538f7['attributes'][_0x8795('0x37')]?_0x1538f7['attributes']:_0x526f45[_0x8795('0x2f')];if(_0x3cb331[_0x8795('0x32')]['includeAll']){_0x1538f7[_0x8795('0x41')]=[{'all':!![]}];}_0x1538f7=_[_0x8795('0x3e')]({},_0x1538f7,_0x3cb331['options']);return db[_0x8795('0x2b')][_0x8795('0x47')](_0x1538f7)[_0x8795('0x24')](handleEntityNotFound(_0xc05908,null))[_0x8795('0x24')](respondWithResult(_0xc05908,null))['catch'](handleError(_0xc05908,null));};exports[_0x8795('0x48')]=function(_0x3d2f4c,_0x13b668){return db['VoiceRecording']['create'](_0x3d2f4c['body'],{})['then'](respondWithResult(_0x13b668,0xc9))[_0x8795('0x44')](handleError(_0x13b668,null));};exports[_0x8795('0x23')]=function(_0x130d95,_0x12ccad){if(_0x130d95[_0x8795('0x49')]['id']){delete _0x130d95['body']['id'];}return db[_0x8795('0x2b')][_0x8795('0x47')]({'where':{'id':_0x130d95['params']['id']}})['then'](handleEntityNotFound(_0x12ccad,null))[_0x8795('0x24')](saveUpdates(_0x130d95[_0x8795('0x49')],null))[_0x8795('0x24')](respondWithResult(_0x12ccad,null))[_0x8795('0x44')](handleError(_0x12ccad,null));};exports['describe']=function(_0x4a09ba,_0x583676){return db[_0x8795('0x2b')][_0x8795('0x4a')]()[_0x8795('0x24')](respondWithResult(_0x583676,null))[_0x8795('0x44')](handleError(_0x583676,null));};exports[_0x8795('0x4b')]=function(_0x24906d,_0xce0f19,_0x456ebd){var _0x5e57f9=require(_0x8795('0x4c'));var _0x54265a=![];var _0x1c59f2={};if(_0x24906d[_0x8795('0x32')][_0x8795('0x2d')]&&_0x24906d[_0x8795('0x32')][_0x8795('0x2d')]===_0x8795('0x4d')){_0x1c59f2[_0x8795('0x4d')]=_0x24906d['params']['id'];}else{_0x1c59f2['id']=_0x24906d['params']['id'];}return db[_0x8795('0x2b')]['find']({'where':_0x1c59f2,'attributes':['id',_0x8795('0x4e')],'raw':!![]})[_0x8795('0x24')](handleEntityNotFound(_0xce0f19,null))[_0x8795('0x24')](function(_0x29c270){if(_0x29c270){var _0x3c66b1=_0x29c270[_0x8795('0x4e')];var _0x552692=util[_0x8795('0x31')]('%s.cypher',_0x3c66b1);if(fs[_0x8795('0x4f')](_0x552692)){_0x54265a=!![];return _0x5e57f9[_0x8795('0x50')](_0x552692,_0x3c66b1,config['secrets'][_0x8795('0x51')])['then'](function(){return _0x29c270;});}return _0x29c270;}})[_0x8795('0x24')](function(_0x399a45){if(_0x399a45){var _0x5d9bd2=_0x399a45[_0x8795('0x4e')];if(!fs['existsSync'](_0x5d9bd2)){throw new db[(_0x8795('0x52'))]['ValidationError'](_0x8795('0x53'));}if(_0x399a45[_0x8795('0x54')]){return _0xce0f19['download'](_0x5d9bd2,_0x399a45[_0x8795('0x54')]+path['extname'](_0x5d9bd2),function(){if(_0x54265a){fs[_0x8795('0x55')](_0x5d9bd2);}});}else{return _0xce0f19[_0x8795('0x4b')](_0x5d9bd2,function(_0xc9bb5b){if(_0x54265a){fs[_0x8795('0x55')](_0x5d9bd2);}});}}})['catch'](function(_0x62cada){if(_0x62cada[_0x8795('0x56')]==='VoiceRecording\x20not\x20found'){_0xce0f19[_0x8795('0x1b')](0x194)[_0x8795('0x29')](_0x8795('0x57'));}else{return handleError(_0xce0f19,null);}});};exports[_0x8795('0x58')]=function(_0x417505,_0x1a035f,_0x2ee088){var _0x29e280=require(_0x8795('0x4c'));var _0x57df1e=![];var _0x5a31cd={'$and':[db[_0x8795('0x59')][_0x8795('0x3a')](db[_0x8795('0x59')]['fn'](_0x8795('0x5a'),db[_0x8795('0x59')]['col']('uniqueid')),_0x417505['query']['token'])]};if(_0x417505[_0x8795('0x32')]['type']&&_0x417505[_0x8795('0x32')][_0x8795('0x2d')]===_0x8795('0x4d')){_0x5a31cd[_0x8795('0x5b')]['push']({'uniqueid':_0x417505[_0x8795('0x46')]['id']});}else{_0x5a31cd[_0x8795('0x5b')][_0x8795('0x5c')]({'id':_0x417505[_0x8795('0x46')]['id']});}return db[_0x8795('0x2b')]['find']({'where':_0x5a31cd,'attributes':['id',_0x8795('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x1a035f,null))[_0x8795('0x24')](function(_0x42e1e6){if(_0x42e1e6){var _0x54a762=util['format'](_0x8795('0x5d'),_0x42e1e6['value']);if(fs['existsSync'](_0x54a762)){_0x57df1e=!![];return _0x29e280[_0x8795('0x50')](_0x54a762,_0x42e1e6[_0x8795('0x4e')],config[_0x8795('0x5e')]['recording'])['then'](function(){return _0x42e1e6;});}return _0x42e1e6;}})['then'](function(_0xa67d11){if(_0xa67d11){if(!fs['existsSync'](_0xa67d11[_0x8795('0x4e')])){throw new db[(_0x8795('0x52'))][(_0x8795('0x5f'))](_0x8795('0x53'));}if(_0xa67d11['filename']){return _0x1a035f['download'](_0xa67d11[_0x8795('0x4e')],_0xa67d11['filename']+path[_0x8795('0x60')](_0xa67d11[_0x8795('0x4e')]),function(){if(_0x57df1e){fs[_0x8795('0x55')](_0xa67d11['value']);}});}else{return _0x1a035f['download'](_0xa67d11[_0x8795('0x4e')],function(_0x495f3d){if(_0x57df1e){fs[_0x8795('0x55')](_0xa67d11[_0x8795('0x4e')]);}});}}})['catch'](handleError(_0x1a035f,null));};exports['destroy']=function(_0x312f4a,_0x21e0f7){return db['VoiceRecording'][_0x8795('0x47')]({'where':{'id':_0x312f4a['params']['id']}})['then'](function(_0x440aff){if(_[_0x8795('0x61')](_0x440aff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x440aff;})[_0x8795('0x24')](function(_0x3d0eb2){var _0x1917c8=_0x3d0eb2[_0x8795('0x4e')];logger['info'](_0x8795('0x62'),_0x1917c8);if(!_[_0x8795('0x61')](_0x3d0eb2[_0x8795('0x4e')])&&fs['existsSync'](_0x1917c8)){logger[_0x8795('0x63')](_0x8795('0x64')+_0x1917c8+_0x8795('0x65'));fs[_0x8795('0x66')](_0x1917c8);}_0x1917c8=_0x1917c8+_0x8795('0x67');if(!_[_0x8795('0x61')](_0x3d0eb2[_0x8795('0x4e')])&&fs[_0x8795('0x4f')](_0x1917c8)){logger[_0x8795('0x63')](_0x8795('0x64')+_0x1917c8+_0x8795('0x65'));fs['unlinkSync'](_0x1917c8);}return _0x3d0eb2;})[_0x8795('0x24')](function(_0x6e4f89){if(!_0x6e4f89)throw new InternalError();return _0x6e4f89[_0x8795('0x25')]();})[_0x8795('0x24')](function(){_0x21e0f7['status'](0xcc)[_0x8795('0x68')]();})[_0x8795('0x44')](handleError(_0x21e0f7,null));};function getBucketslist(_0x223413,_0x50135a,_0x28e893){return new Promise(function(_0x411a45,_0x2703aa){var _0x56f468=new AWS['S3']({'accessKeyId':_0x50135a,'secretAccessKey':_0x223413,'region':_0x28e893});_0x56f468['listBuckets']({},function(_0x13d56b,_0x386a2a){if(_0x13d56b){return _0x2703aa(_0x13d56b);}else{return _0x411a45(_0x386a2a);}});});}function createBucket(_0x10c0a1,_0x238115,_0x3f8157,_0x128821){return new Promise(function(_0x46ff19,_0x104911){var _0x588dd0=new AWS['S3']({'accessKeyId':_0x238115,'secretAccessKey':_0x10c0a1,'region':_0x3f8157});_0x588dd0[_0x8795('0x69')]({'Bucket':_0x128821},function(_0x14b54e,_0x1e4885){if(_0x14b54e){return _0x104911(_0x14b54e);}else{return _0x46ff19(_0x1e4885);}});});}function uploadFile(_0x25dc8a,_0x19591a,_0x471293,_0x21d12f,_0x4cfde5,_0x2b1fe0){return new Promise(function(_0x1eff46,_0x550fbf){var _0x183ee2=new AWS['S3']({'accessKeyId':_0x19591a,'secretAccessKey':_0x25dc8a,'region':_0x471293});_0x183ee2['upload']({'Bucket':_0x21d12f,'Key':_0x4cfde5,'Body':_0x2b1fe0},function(_0x31c011,_0x2b8da9){if(_0x31c011){return _0x550fbf(_0x31c011);}else{return _0x1eff46(_0x2b8da9);}});});}function startTranscribe(_0x21da8d,_0x5f17cb,_0x1eec41,_0x103407,_0x423d02,_0x2adfee){return new Promise(function(_0xe0fa0d,_0x59377b){var _0x564e9c=new AWS[(_0x8795('0x6a'))]({'accessKeyId':_0x5f17cb,'secretAccessKey':_0x21da8d,'region':_0x1eec41});_0x564e9c[_0x8795('0x6b')]({'TranscriptionJobName':_0x103407,'LanguageCode':_0x423d02,'Media':{'MediaFileUri':_0x2adfee}},function(_0x3ca2fc,_0x256ba0){if(_0x3ca2fc){return _0x59377b(_0x3ca2fc);}else{return _0xe0fa0d(_0x256ba0);}});});}function transcribe(_0x13e911,_0x26e576,_0x3370f8,_0x4d5734,_0x124873,_0x1f9009,_0x279617){return new Promise(function(_0x4452ac,_0x26beb){var _0x5785cf={};logger[_0x8795('0x63')](util[_0x8795('0x31')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x13e911,_0x124873));return uploadFile(_0x26e576,_0x3370f8,_0x4d5734,_0x124873,path[_0x8795('0x6c')](_0x1f9009),fs[_0x8795('0x6d')](_0x1f9009))[_0x8795('0x24')](function(_0x311785){logger[_0x8795('0x63')](util[_0x8795('0x31')](_0x8795('0x6e'),_0x13e911,_0x124873,_0x311785['Location']));_0x5785cf['bucket']=_0x311785[_0x8795('0x6f')];_0x5785cf[_0x8795('0x70')]=_0x311785[_0x8795('0x71')];logger[_0x8795('0x63')](util[_0x8795('0x31')](_0x8795('0x72'),_0x13e911));return startTranscribe(_0x26e576,_0x3370f8,_0x4d5734,uuidv4(),_0x279617,_0x311785[_0x8795('0x71')]);})[_0x8795('0x24')](function(_0x1ceb06){logger['info'](util[_0x8795('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x13e911,_0x1ceb06['TranscriptionJob'][_0x8795('0x73')]));_0x5785cf[_0x8795('0x74')]=_0x1ceb06[_0x8795('0x75')][_0x8795('0x73')];_0x5785cf[_0x8795('0x76')]=_0x1ceb06[_0x8795('0x75')]['TranscriptionJobStatus'];return _0x4452ac(_0x5785cf);})[_0x8795('0x44')](function(_0x5300a5){return _0x26beb(_0x5300a5);});});}exports[_0x8795('0x77')]=function(_0x424e8a,_0x55de6c,_0x22b685){var _0x408177;var _0x418469;var _0x426311;var _0x4ce73f=require(_0x8795('0x4c'));return db[_0x8795('0x2b')]['findOne']({'where':{'id':_0x424e8a['params']['id']}})[_0x8795('0x24')](function(_0x52cf57){if(_0x52cf57){var _0x465650=util[_0x8795('0x31')](_0x8795('0x5d'),_0x52cf57[_0x8795('0x4e')]);if(fs[_0x8795('0x4f')](_0x465650)){cypher=!![];return _0x4ce73f[_0x8795('0x50')](_0x465650,_0x52cf57['value'],config[_0x8795('0x5e')][_0x8795('0x51')])['then'](function(){return _0x52cf57;});}return _0x52cf57;}})[_0x8795('0x24')](function(_0x1257bc){if(!_0x1257bc){throw new db[(_0x8795('0x52'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x418469=_0x1257bc;return db[_0x8795('0x78')][_0x8795('0x79')]({'where':{'id':0x1}});})[_0x8795('0x24')](handleEntityNotFound(_0x55de6c,null))[_0x8795('0x24')](function(_0x17d8d4){if(_0x17d8d4){_0x408177=_0x17d8d4;if(!_0x408177[_0x8795('0x7a')]||!_0x408177['transcribeAccountId']||!_0x408177[_0x8795('0x7b')]||!_0x408177[_0x8795('0x7c')]||!_0x408177[_0x8795('0x7d')]){throw new db[(_0x8795('0x52'))][(_0x8795('0x5f'))](_0x8795('0x7e'));}if(_0x424e8a[_0x8795('0x49')][_0x8795('0x7f')]&&(!_0x408177[_0x8795('0x80')]||!_0x408177[_0x8795('0x81')]||!_0x408177['sentimentRegion']||!_0x408177[_0x8795('0x7c')]||!_0x408177[_0x8795('0x7d')])){throw new db['Sequelize'][(_0x8795('0x5f'))](_0x8795('0x82'));}return db[_0x8795('0x83')]['findOne']({'where':{'id':_0x408177[_0x8795('0x84')]}});}})[_0x8795('0x24')](function(_0x5a2b1b){if(!_0x5a2b1b){throw new db[(_0x8795('0x52'))][(_0x8795('0x5f'))](_0x8795('0x85'));}if(!_0x5a2b1b['data1']||!_0x5a2b1b[_0x8795('0x86')]){throw new db[(_0x8795('0x52'))]['ValidationError'](_0x8795('0x87'));}_0x426311=_0x5a2b1b;return getBucketslist(_0x426311[_0x8795('0x88')],_0x426311[_0x8795('0x86')],_0x408177[_0x8795('0x7b')]);})[_0x8795('0x24')](function(_0xfe097d){if(_0xfe097d&&_0xfe097d[_0x8795('0x89')]){var _0x597c7a=_['find'](_0xfe097d[_0x8795('0x89')],function(_0x1c93bf){return _0x1c93bf['Name']===_0x408177[_0x8795('0x7d')];});if(!_0x597c7a){logger[_0x8795('0x63')](util[_0x8795('0x31')](_0x8795('0x8a'),_0x424e8a[_0x8795('0x46')]['id'],_0x408177['bucket']));return createBucket(_0x426311[_0x8795('0x88')],_0x426311[_0x8795('0x86')],_0x408177[_0x8795('0x7b')],_0x408177['bucket']);}logger[_0x8795('0x63')](util[_0x8795('0x31')](_0x8795('0x8b'),_0x424e8a[_0x8795('0x46')]['id'],_0x408177[_0x8795('0x7d')]));return;}})[_0x8795('0x24')](function(_0x3ac69a){if(_0x418469[_0x8795('0x76')]==='NEW'){return transcribe(_0x424e8a['params']['id'],_0x426311[_0x8795('0x88')],_0x426311[_0x8795('0x86')],_0x408177['transcribeRegion'],_0x408177[_0x8795('0x7d')],_0x418469[_0x8795('0x4e')],_0x408177[_0x8795('0x7c')]);}else{logger[_0x8795('0x63')](util[_0x8795('0x31')](_0x8795('0x8c'),_0x424e8a[_0x8795('0x46')]['id']));return{'transcribeStatus':_0x8795('0x8d')};}})[_0x8795('0x24')](function(_0x2756f1){if(_0x2756f1){_0x2756f1['tempSentiment']=_0x424e8a['body']['runSentiment'];return _0x418469[_0x8795('0x8e')](_0x2756f1);}})['then'](respondWithResult(_0x55de6c,null))[_0x8795('0x44')](handleError(_0x55de6c,null));};function writeFile(_0x2672a5,_0x16aedb){return new Promise(function(_0x1305ff,_0x396978){fs[_0x8795('0x8f')](_0x16aedb,_0x2672a5,function(_0x585cb7,_0x3d27fa){if(_0x585cb7){return _0x396978(_0x585cb7);}else{return _0x1305ff(_0x3d27fa);}});});}exports[_0x8795('0x90')]=function(_0x41a5bf,_0x49455d,_0x3bba5b){return db[_0x8795('0x2b')][_0x8795('0x79')]({'where':{'id':_0x41a5bf[_0x8795('0x46')]['id']}})[_0x8795('0x24')](handleEntityNotFound(_0x49455d))[_0x8795('0x24')](function(_0x43ab62){if(_0x43ab62&&_0x43ab62[_0x8795('0x91')]){var _0x10a678=_0x43ab62['fileText'];var _0x59fd42=config[_0x8795('0x92')]+_0x8795('0x93')+_0x43ab62['id']+_0x8795('0x94');if(fs[_0x8795('0x4f')](_0x59fd42)){return _0x59fd42;}return writeFile(_0x10a678,_0x59fd42)['then'](function(){return _0x59fd42;});}else{throw new db['Sequelize'][(_0x8795('0x5f'))](_0x8795('0x95'));}})[_0x8795('0x24')](function(_0x3cc9c8){return _0x49455d[_0x8795('0x4b')](_0x3cc9c8);})[_0x8795('0x44')](handleError(_0x49455d));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index a45b836..681c18a 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 _0x1306=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0x7b9c30,_0x28315c){var _0x50b5a4=function(_0x4a756b){while(--_0x4a756b){_0x7b9c30['push'](_0x7b9c30['shift']());}};_0x50b5a4(++_0x28315c);}(_0x1306,0x17a));var _0x6130=function(_0x3a7ff2,_0xf59f3a){_0x3a7ff2=_0x3a7ff2-0x0;var _0x2e72ac=_0x1306[_0x3a7ff2];return _0x2e72ac;};'use strict';var attributes=require(_0x6130('0x0'));module[_0x6130('0x1')]=function(_0x1ddb7f,_0xa1da01){return _0x1ddb7f[_0x6130('0x2')](_0x6130('0x3'),attributes,{'tableName':_0x6130('0x4'),'paranoid':![],'indexes':[{'name':_0x6130('0x5'),'fields':[_0x6130('0x5')]},{'name':_0x6130('0x6'),'fields':[_0x6130('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4876=['VoiceRecording','uniqueid','transcribeStatus'];(function(_0x5e015c,_0x610eb8){var _0x196084=function(_0x43dd37){while(--_0x43dd37){_0x5e015c['push'](_0x5e015c['shift']());}};_0x196084(++_0x610eb8);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x153e7f,_0x51b8e9){return _0x153e7f['define'](_0x6487('0x0'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x6487('0x1'),'fields':[_0x6487('0x1')]},{'name':_0x6487('0x2'),'fields':[_0x6487('0x2')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index bbb0372..c4b17bd 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 _0xc1c6=['format','%s.cypher','value','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','update','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','VoiceRecording','create','existsSync'];(function(_0x232f6f,_0x1ecec2){var _0x2f1701=function(_0x16dbc6){while(--_0x16dbc6){_0x232f6f['push'](_0x232f6f['shift']());}};_0x2f1701(++_0x1ecec2);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x485346,_0x1dbc22){_0x485346=_0x485346-0x0;var _0x299353=_0xc1c6[_0x485346];return _0x299353;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}exports['UpdateVoiceRecording']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['VoiceRecording'][_0x6c1c('0x13')](_0x137770['body'],{'raw':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'limit':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null})[_0x6c1c('0x9')](function(_0x9c6c55){logger[_0x6c1c('0x11')](_0x6c1c('0x19'),_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x19'),_0x137770,JSON[_0x6c1c('0xe')](_0x9c6c55));_0x338dc2(_0x9c6c55);})[_0x6c1c('0x12')](function(_0x96046a){logger[_0x6c1c('0xf')](_0x6c1c('0x19'),_0x96046a[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x96046a[_0x6c1c('0x10')]));});});};exports[_0x6c1c('0x1a')]=function(_0x1b9d7d){var _0x2feaf4=this;return new Promise(function(_0x5f4568,_0x2595c3){var _0x4d73aa=require(_0x6c1c('0x1b'));var _0x4c23f8;return db[_0x6c1c('0x1c')]['findOne']({'attributes':['id',_0x6c1c('0x1d')],'where':{'id':0x1},'raw':!![]})[_0x6c1c('0x9')](function(_0x504348){_0x4c23f8=_0x504348;return db[_0x6c1c('0x1e')][_0x6c1c('0x1f')](_0x1b9d7d['body']);})[_0x6c1c('0x9')](function(_0x19a8f1){if(_0x4c23f8[_0x6c1c('0x1d')]&&fs[_0x6c1c('0x20')](_0x19a8f1['value'])){var _0x52c036=util[_0x6c1c('0x21')](_0x6c1c('0x22'),_0x19a8f1[_0x6c1c('0x23')]);return _0x4d73aa[_0x6c1c('0x24')](_0x19a8f1[_0x6c1c('0x23')],_0x52c036,config[_0x6c1c('0x25')]['recording'])[_0x6c1c('0x9')](function(){fs[_0x6c1c('0x26')](_0x19a8f1['value']);logger[_0x6c1c('0x11')](_0x6c1c('0x27'));return _0x19a8f1;});}return _0x19a8f1;})[_0x6c1c('0x9')](function(_0x15b6d2){logger['info'](_0x6c1c('0x1a'),_0x1b9d7d);logger[_0x6c1c('0xc')](_0x6c1c('0x1a'),_0x1b9d7d,JSON['stringify'](_0x15b6d2));_0x5f4568(_0x15b6d2);})[_0x6c1c('0x12')](function(_0x4e5767){logger[_0x6c1c('0xf')]('CreateVoiceRecording',_0x4e5767[_0x6c1c('0x10')],_0x1b9d7d);_0x2595c3(_0x2feaf4[_0x6c1c('0xf')](0x1f4,_0x4e5767[_0x6c1c('0x10')]));});});}; \ No newline at end of file +var _0xf61e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','update','body','options','raw','where','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird'];(function(_0x43dff4,_0x13fbc1){var _0x28c076=function(_0x5c0ff7){while(--_0x5c0ff7){_0x43dff4['push'](_0x43dff4['shift']());}};_0x28c076(++_0x13fbc1);}(_0xf61e,0x191));var _0xef61=function(_0x22d768,_0x1abe90){_0x22d768=_0x22d768-0x0;var _0x13a1c3=_0xf61e[_0x22d768];return _0x13a1c3;};'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['VoiceRecording'][_0xef61('0x18')](_0x22dc1b[_0xef61('0x19')],{'raw':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x1a')][_0xef61('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22dc1b[_0xef61('0x1a')]?_0x22dc1b[_0xef61('0x1a')][_0xef61('0x1c')]||null:null,'attributes':_0x22dc1b[_0xef61('0x1a')]?_0x22dc1b[_0xef61('0x1a')]['attributes']||null:null,'limit':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x1a')]['limit']||null:null})[_0xef61('0x1d')](function(_0x5ae7a2){logger['info'](_0xef61('0x17'),_0x22dc1b);logger['debug']('UpdateVoiceRecording',_0x22dc1b,JSON[_0xef61('0x12')](_0x5ae7a2));_0x28315a(_0x5ae7a2);})[_0xef61('0x16')](function(_0x3ceb14){logger[_0xef61('0x13')]('UpdateVoiceRecording',_0x3ceb14[_0xef61('0x15')],_0x22dc1b);_0xdd5e38(_0xfc36d6['error'](0x1f4,_0x3ceb14[_0xef61('0x15')]));});});};exports[_0xef61('0x1e')]=function(_0x2419a9){var _0xf4c7c9=this;return new Promise(function(_0x2155f1,_0x45ece2){var _0x258b5a=require(_0xef61('0x1f'));var _0x297df7;return db[_0xef61('0x20')][_0xef61('0x21')]({'attributes':['id',_0xef61('0x22')],'where':{'id':0x1},'raw':!![]})[_0xef61('0x1d')](function(_0x63edd4){_0x297df7=_0x63edd4;return db[_0xef61('0x23')][_0xef61('0x24')](_0x2419a9[_0xef61('0x19')]);})[_0xef61('0x1d')](function(_0x587e26){if(_0x297df7[_0xef61('0x22')]&&fs[_0xef61('0x25')](_0x587e26[_0xef61('0x26')])){var _0x4f35ad=util['format'](_0xef61('0x27'),_0x587e26[_0xef61('0x26')]);return _0x258b5a[_0xef61('0x28')](_0x587e26['value'],_0x4f35ad,config[_0xef61('0x29')][_0xef61('0x2a')])['then'](function(){fs[_0xef61('0x2b')](_0x587e26['value']);logger['info'](_0xef61('0x2c'));return _0x587e26;});}return _0x587e26;})['then'](function(_0x8ed629){logger['info'](_0xef61('0x1e'),_0x2419a9);logger[_0xef61('0x10')](_0xef61('0x1e'),_0x2419a9,JSON[_0xef61('0x12')](_0x8ed629));_0x2155f1(_0x8ed629);})[_0xef61('0x16')](function(_0x1bdcb9){logger[_0xef61('0x13')](_0xef61('0x1e'),_0x1bdcb9[_0xef61('0x15')],_0x2419a9);_0x45ece2(_0xf4c7c9[_0xef61('0x13')](0x1f4,_0x1bdcb9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 9255686..4240617 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 _0xaabd=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','multer','util','path'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xaabd,0x1cb));var _0xdaab=function(_0x555a41,_0x5d28aa){_0x555a41=_0x555a41-0x0;var _0x2cd42b=_0xaabd[_0x555a41];return _0x2cd42b;};'use strict';var multer=require(_0xdaab('0x0'));var util=require(_0xdaab('0x1'));var path=require(_0xdaab('0x2'));var timeout=require(_0xdaab('0x3'));var express=require(_0xdaab('0x4'));var router=express[_0xdaab('0x5')]();var fs_extra=require(_0xdaab('0x6'));var auth=require(_0xdaab('0x7'));var interaction=require(_0xdaab('0x8'));var config=require(_0xdaab('0x9'));var controller=require(_0xdaab('0xa'));router[_0xdaab('0xb')]('/',auth[_0xdaab('0xc')](),controller[_0xdaab('0xd')]);router['get'](_0xdaab('0xe'),auth['isAuthenticated'](),controller[_0xdaab('0xf')]);router['get'](_0xdaab('0x10'),auth['isAuthenticated'](),controller[_0xdaab('0x11')]);router[_0xdaab('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdaab('0x13')](_0xdaab('0x10'),auth[_0xdaab('0xc')](),controller['update']);router[_0xdaab('0x14')](_0xdaab('0x10'),auth[_0xdaab('0xc')](),controller[_0xdaab('0x15')]);module['exports']=router; \ No newline at end of file +var _0x6db4=['isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x6db4,0xc4));var _0x46db=function(_0x2fcb98,_0x2a13a0){_0x2fcb98=_0x2fcb98-0x0;var _0xbbce1e=_0x6db4[_0x2fcb98];return _0xbbce1e;};'use strict';var multer=require(_0x46db('0x0'));var util=require(_0x46db('0x1'));var path=require(_0x46db('0x2'));var timeout=require(_0x46db('0x3'));var express=require(_0x46db('0x4'));var router=express[_0x46db('0x5')]();var fs_extra=require(_0x46db('0x6'));var auth=require(_0x46db('0x7'));var interaction=require(_0x46db('0x8'));var config=require(_0x46db('0x9'));var controller=require(_0x46db('0xa'));router['get']('/',auth[_0x46db('0xb')](),controller[_0x46db('0xc')]);router[_0x46db('0xd')](_0x46db('0xe'),auth[_0x46db('0xb')](),controller['describe']);router[_0x46db('0xd')](_0x46db('0xf'),auth['isAuthenticated'](),controller[_0x46db('0x10')]);router[_0x46db('0x11')]('/',auth[_0x46db('0xb')](),controller[_0x46db('0x12')]);router[_0x46db('0x13')](_0x46db('0xf'),auth[_0x46db('0xb')](),controller[_0x46db('0x14')]);router[_0x46db('0x15')](_0x46db('0xf'),auth[_0x46db('0xb')](),controller[_0x46db('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 1ac8ea7..9ba0751 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 _0x6242=['STRING','ENUM','Yes','sequelize','moment','exports'];(function(_0x6fa73f,_0x3c25dc){var _0x36f21c=function(_0x392f4d){while(--_0x392f4d){_0x6fa73f['push'](_0x6fa73f['shift']());}};_0x36f21c(++_0x3c25dc);}(_0x6242,0x81));var _0x2624=function(_0x152e2f,_0x5799ae){_0x152e2f=_0x152e2f-0x0;var _0x9eff49=_0x6242[_0x152e2f];return _0x9eff49;};'use strict';var Sequelize=require(_0x2624('0x0'));var moment=require(_0x2624('0x1'));module[_0x2624('0x2')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize[_0x2624('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x2624('0x3')]},'transferercontext':{'type':Sequelize[_0x2624('0x3')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x2624('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x2624('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x2624('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2624('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x2624('0x3')]},'transfereecontext':{'type':Sequelize[_0x2624('0x3')]},'transfereeexten':{'type':Sequelize[_0x2624('0x3')]},'transfereelinkedid':{'type':Sequelize[_0x2624('0x3')]},'isexternal':{'type':Sequelize[_0x2624('0x4')](_0x2624('0x5'),'No')},'context':{'type':Sequelize[_0x2624('0x3')]},'extension':{'type':Sequelize[_0x2624('0x3')]}}; \ No newline at end of file +var _0x14a5=['STRING','Yes','sequelize','moment','exports'];(function(_0x37a81a,_0x1a314b){var _0x3158b7=function(_0x2dca1d){while(--_0x2dca1d){_0x37a81a['push'](_0x37a81a['shift']());}};_0x3158b7(++_0x1a314b);}(_0x14a5,0x179));var _0x514a=function(_0x2ac6cb,_0x2912c5){_0x2ac6cb=_0x2ac6cb-0x0;var _0x53e7cf=_0x14a5[_0x2ac6cb];return _0x53e7cf;};'use strict';var Sequelize=require(_0x514a('0x0'));var moment=require(_0x514a('0x1'));module[_0x514a('0x2')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize[_0x514a('0x3')]},'transfererchannel':{'type':Sequelize[_0x514a('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x514a('0x3')]},'transferercalleridname':{'type':Sequelize[_0x514a('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x514a('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x514a('0x3')]},'transferercontext':{'type':Sequelize[_0x514a('0x3')]},'transfererexten':{'type':Sequelize[_0x514a('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x514a('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x514a('0x3')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x514a('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x514a('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x514a('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x514a('0x4'),'No')},'context':{'type':Sequelize[_0x514a('0x3')]},'extension':{'type':Sequelize[_0x514a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index c99f03a..ba7469d 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 _0x8f73=['send','index','VoiceTransferReport','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','options','then','includeAll','findAll','rows','catch','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','undefined','limit','count','offset','Content-Range','json','save','update','destroy','end','stack','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8f73,0x1cd));var _0x38f7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8f73[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x38f7('0x0'));var rimraf=require(_0x38f7('0x1'));var zipdir=require(_0x38f7('0x2'));var jsonpatch=require(_0x38f7('0x3'));var rp=require(_0x38f7('0x4'));var moment=require(_0x38f7('0x5'));var BPromise=require(_0x38f7('0x6'));var Mustache=require(_0x38f7('0x7'));var util=require('util');var path=require(_0x38f7('0x8'));var sox=require(_0x38f7('0x9'));var csv=require(_0x38f7('0xa'));var ejs=require(_0x38f7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x38f7('0xc'));var crypto=require('crypto');var jsforce=require(_0x38f7('0xd'));var deskjs=require(_0x38f7('0xe'));var toCsv=require(_0x38f7('0xa'));var querystring=require(_0x38f7('0xf'));var Papa=require('papaparse');var Redis=require(_0x38f7('0x10'));var authService=require(_0x38f7('0x11'));var qs=require(_0x38f7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x38f7('0x13'));var utils=require(_0x38f7('0x14'));var config=require(_0x38f7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33db4c,_0x2fa34e){_0x2fa34e=_0x2fa34e||0xcc;return function(_0x5b1f34){if(_0x5b1f34){return _0x33db4c[_0x38f7('0x16')](_0x2fa34e);}return _0x33db4c[_0x38f7('0x17')](_0x2fa34e)['end']();};}function respondWithResult(_0xebfd4a,_0x2fd58c){_0x2fd58c=_0x2fd58c||0xc8;return function(_0x40c810){if(_0x40c810){return _0xebfd4a[_0x38f7('0x17')](_0x2fd58c)['json'](_0x40c810);}};}function respondWithFilteredResult(_0x17cef1,_0x468b0b){return function(_0x242c36){if(_0x242c36){var _0x5c4191=typeof _0x468b0b['offset']===_0x38f7('0x18')&&typeof _0x468b0b[_0x38f7('0x19')]==='undefined';var _0x4d9452=_0x242c36[_0x38f7('0x1a')];var _0x26e6a1=_0x5c4191?0x0:_0x468b0b[_0x38f7('0x1b')];var _0x1eb143=_0x5c4191?_0x242c36[_0x38f7('0x1a')]:_0x468b0b[_0x38f7('0x1b')]+_0x468b0b['limit'];var _0x5a1f7d;if(_0x1eb143>=_0x4d9452){_0x1eb143=_0x4d9452;_0x5a1f7d=0xc8;}else{_0x5a1f7d=0xce;}_0x17cef1['status'](_0x5a1f7d);return _0x17cef1['set'](_0x38f7('0x1c'),_0x26e6a1+'-'+_0x1eb143+'/'+_0x4d9452)[_0x38f7('0x1d')](_0x242c36);}return null;};}function patchUpdates(_0x30c243){return function(_0x58a8a4){try{jsonpatch['apply'](_0x58a8a4,_0x30c243,!![]);}catch(_0x4fb891){return BPromise['reject'](_0x4fb891);}return _0x58a8a4[_0x38f7('0x1e')]();};}function saveUpdates(_0x3df5e3,_0x508710){return function(_0x10ccea){if(_0x10ccea){return _0x10ccea[_0x38f7('0x1f')](_0x3df5e3)['then'](function(_0x383b3c){return _0x383b3c;});}return null;};}function removeEntity(_0x5034ed,_0x188c67){return function(_0x22d945){if(_0x22d945){return _0x22d945[_0x38f7('0x20')]()['then'](function(){_0x5034ed['status'](0xcc)[_0x38f7('0x21')]();});}};}function handleEntityNotFound(_0x380d31,_0x4c4927){return function(_0x434191){if(!_0x434191){_0x380d31['sendStatus'](0x194);}return _0x434191;};}function handleError(_0x251790,_0x88f58d){_0x88f58d=_0x88f58d||0x1f4;return function(_0x4d73c8){logger['error'](_0x4d73c8[_0x38f7('0x22')]);if(_0x4d73c8[_0x38f7('0x23')]){delete _0x4d73c8['name'];}_0x251790['status'](_0x88f58d)[_0x38f7('0x24')](_0x4d73c8);};}exports[_0x38f7('0x25')]=function(_0x362dd8,_0x358774){var _0x993ded={},_0x1a428a={},_0x24ce9f={'count':0x0,'rows':[]};var _0x507c55=_['map'](db[_0x38f7('0x26')][_0x38f7('0x27')],function(_0xff1161){return{'name':_0xff1161[_0x38f7('0x28')],'type':_0xff1161['type'][_0x38f7('0x29')]};});_0x1a428a[_0x38f7('0x2a')]=_[_0x38f7('0x2b')](_0x507c55,'name');_0x1a428a['query']=_[_0x38f7('0x2c')](_0x362dd8[_0x38f7('0x2d')]);_0x1a428a['filters']=_[_0x38f7('0x2e')](_0x1a428a[_0x38f7('0x2a')],_0x1a428a[_0x38f7('0x2d')]);_0x993ded[_0x38f7('0x2f')]=_['intersection'](_0x1a428a['model'],qs[_0x38f7('0x30')](_0x362dd8[_0x38f7('0x2d')][_0x38f7('0x30')]));_0x993ded[_0x38f7('0x2f')]=_0x993ded['attributes']['length']?_0x993ded[_0x38f7('0x2f')]:_0x1a428a['model'];if(!_0x362dd8['query'][_0x38f7('0x31')](_0x38f7('0x32'))){_0x993ded['limit']=qs[_0x38f7('0x19')](_0x362dd8[_0x38f7('0x2d')][_0x38f7('0x19')]);_0x993ded[_0x38f7('0x1b')]=qs[_0x38f7('0x1b')](_0x362dd8[_0x38f7('0x2d')]['offset']);}_0x993ded[_0x38f7('0x33')]=qs[_0x38f7('0x34')](_0x362dd8[_0x38f7('0x2d')][_0x38f7('0x34')]);_0x993ded[_0x38f7('0x35')]=qs[_0x38f7('0x36')](_[_0x38f7('0x37')](_0x362dd8[_0x38f7('0x2d')],_0x1a428a[_0x38f7('0x36')]),_0x507c55);if(_0x362dd8['query'][_0x38f7('0x38')]){_0x993ded[_0x38f7('0x35')]=_['merge'](_0x993ded[_0x38f7('0x35')],{'$or':_[_0x38f7('0x2b')](_0x507c55,function(_0x1cd66d){if(_0x1cd66d[_0x38f7('0x39')]!==_0x38f7('0x3a')){var _0x20dd2c={};_0x20dd2c[_0x1cd66d[_0x38f7('0x23')]]={'$like':'%'+_0x362dd8[_0x38f7('0x2d')][_0x38f7('0x38')]+'%'};return _0x20dd2c;}})});}_0x993ded=_['merge']({},_0x993ded,_0x362dd8[_0x38f7('0x3b')]);var _0x30b01e={'where':_0x993ded[_0x38f7('0x35')]};return db[_0x38f7('0x26')][_0x38f7('0x1a')](_0x30b01e)[_0x38f7('0x3c')](function(_0x18c794){_0x24ce9f['count']=_0x18c794;if(_0x362dd8['query'][_0x38f7('0x3d')]){_0x993ded['include']=[{'all':!![]}];}return db[_0x38f7('0x26')][_0x38f7('0x3e')](_0x993ded);})[_0x38f7('0x3c')](function(_0x2bdef8){_0x24ce9f[_0x38f7('0x3f')]=_0x2bdef8;return _0x24ce9f;})[_0x38f7('0x3c')](respondWithFilteredResult(_0x358774,_0x993ded))[_0x38f7('0x40')](handleError(_0x358774,null));};exports['show']=function(_0x4122f1,_0x1872d3){var _0x4e7c6d={'raw':!![],'where':{'id':_0x4122f1[_0x38f7('0x41')]['id']}},_0x2b09f7={};_0x2b09f7[_0x38f7('0x2a')]=_[_0x38f7('0x2c')](db[_0x38f7('0x26')][_0x38f7('0x27')]);_0x2b09f7[_0x38f7('0x2d')]=_[_0x38f7('0x2c')](_0x4122f1[_0x38f7('0x2d')]);_0x2b09f7['filters']=_[_0x38f7('0x2e')](_0x2b09f7[_0x38f7('0x2a')],_0x2b09f7[_0x38f7('0x2d')]);_0x4e7c6d['attributes']=_['intersection'](_0x2b09f7[_0x38f7('0x2a')],qs[_0x38f7('0x30')](_0x4122f1[_0x38f7('0x2d')][_0x38f7('0x30')]));_0x4e7c6d[_0x38f7('0x2f')]=_0x4e7c6d[_0x38f7('0x2f')]['length']?_0x4e7c6d['attributes']:_0x2b09f7[_0x38f7('0x2a')];if(_0x4122f1[_0x38f7('0x2d')][_0x38f7('0x3d')]){_0x4e7c6d['include']=[{'all':!![]}];}_0x4e7c6d=_[_0x38f7('0x42')]({},_0x4e7c6d,_0x4122f1[_0x38f7('0x3b')]);return db[_0x38f7('0x26')][_0x38f7('0x43')](_0x4e7c6d)[_0x38f7('0x3c')](handleEntityNotFound(_0x1872d3,null))[_0x38f7('0x3c')](respondWithResult(_0x1872d3,null))[_0x38f7('0x40')](handleError(_0x1872d3,null));};exports[_0x38f7('0x44')]=function(_0x1dc88e,_0x35a347){return db[_0x38f7('0x26')][_0x38f7('0x44')](_0x1dc88e[_0x38f7('0x45')],{})[_0x38f7('0x3c')](respondWithResult(_0x35a347,0xc9))[_0x38f7('0x40')](handleError(_0x35a347,null));};exports['update']=function(_0x4f1d17,_0xb23848){if(_0x4f1d17[_0x38f7('0x45')]['id']){delete _0x4f1d17[_0x38f7('0x45')]['id'];}return db[_0x38f7('0x26')][_0x38f7('0x43')]({'where':{'id':_0x4f1d17[_0x38f7('0x41')]['id']}})[_0x38f7('0x3c')](handleEntityNotFound(_0xb23848,null))[_0x38f7('0x3c')](saveUpdates(_0x4f1d17[_0x38f7('0x45')],null))['then'](respondWithResult(_0xb23848,null))[_0x38f7('0x40')](handleError(_0xb23848,null));};exports[_0x38f7('0x20')]=function(_0x4f66b4,_0x3322c2){return db[_0x38f7('0x26')][_0x38f7('0x43')]({'where':{'id':_0x4f66b4[_0x38f7('0x41')]['id']}})[_0x38f7('0x3c')](handleEntityNotFound(_0x3322c2,null))[_0x38f7('0x3c')](removeEntity(_0x3322c2,null))[_0x38f7('0x40')](handleError(_0x3322c2,null));};exports[_0x38f7('0x46')]=function(_0x49f6a6,_0x339fac){return db[_0x38f7('0x26')][_0x38f7('0x46')]()[_0x38f7('0x3c')](respondWithResult(_0x339fac,null))[_0x38f7('0x40')](handleError(_0x339fac,null));}; \ No newline at end of file +var _0x64d8=['merge','options','then','include','rows','catch','show','includeAll','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','sendStatus','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x20d93a,_0x422a10){var _0x4e5cec=function(_0x56089c){while(--_0x56089c){_0x20d93a['push'](_0x20d93a['shift']());}};_0x4e5cec(++_0x422a10);}(_0x64d8,0x1d0));var _0x864d=function(_0x540f0d,_0x2a093b){_0x540f0d=_0x540f0d-0x0;var _0x5d2fc3=_0x64d8[_0x540f0d];return _0x5d2fc3;};'use strict';var emlformat=require(_0x864d('0x0'));var rimraf=require(_0x864d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x864d('0x2'));var rp=require(_0x864d('0x3'));var moment=require(_0x864d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x864d('0x5'));var util=require(_0x864d('0x6'));var path=require(_0x864d('0x7'));var sox=require(_0x864d('0x8'));var csv=require(_0x864d('0x9'));var ejs=require(_0x864d('0xa'));var fs=require('fs');var fs_extra=require(_0x864d('0xb'));var _=require(_0x864d('0xc'));var squel=require(_0x864d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x864d('0xe'));var toCsv=require(_0x864d('0x9'));var querystring=require(_0x864d('0xf'));var Papa=require('papaparse');var Redis=require(_0x864d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x864d('0x11'));var as=require(_0x864d('0x12'));var hardwareService=require(_0x864d('0x13'));var logger=require(_0x864d('0x14'))(_0x864d('0x15'));var utils=require(_0x864d('0x16'));var config=require(_0x864d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x864d('0x18'))['db'];function respondWithStatusCode(_0x31faf1,_0x40ae08){_0x40ae08=_0x40ae08||0xcc;return function(_0xc7de7f){if(_0xc7de7f){return _0x31faf1['sendStatus'](_0x40ae08);}return _0x31faf1[_0x864d('0x19')](_0x40ae08)[_0x864d('0x1a')]();};}function respondWithResult(_0x3798ad,_0x5bec40){_0x5bec40=_0x5bec40||0xc8;return function(_0x1877cc){if(_0x1877cc){return _0x3798ad[_0x864d('0x19')](_0x5bec40)[_0x864d('0x1b')](_0x1877cc);}};}function respondWithFilteredResult(_0x648ac6,_0x2fe445){return function(_0xd398f9){if(_0xd398f9){var _0x27f66a=typeof _0x2fe445[_0x864d('0x1c')]===_0x864d('0x1d')&&typeof _0x2fe445[_0x864d('0x1e')]===_0x864d('0x1d');var _0x2c22bf=_0xd398f9[_0x864d('0x1f')];var _0x529431=_0x27f66a?0x0:_0x2fe445[_0x864d('0x1c')];var _0x271ddd=_0x27f66a?_0xd398f9[_0x864d('0x1f')]:_0x2fe445[_0x864d('0x1c')]+_0x2fe445['limit'];var _0x2569f3;if(_0x271ddd>=_0x2c22bf){_0x271ddd=_0x2c22bf;_0x2569f3=0xc8;}else{_0x2569f3=0xce;}_0x648ac6[_0x864d('0x19')](_0x2569f3);return _0x648ac6[_0x864d('0x20')](_0x864d('0x21'),_0x529431+'-'+_0x271ddd+'/'+_0x2c22bf)[_0x864d('0x1b')](_0xd398f9);}return null;};}function patchUpdates(_0x5147af){return function(_0xccc7d1){try{jsonpatch[_0x864d('0x22')](_0xccc7d1,_0x5147af,!![]);}catch(_0x3bfce7){return BPromise['reject'](_0x3bfce7);}return _0xccc7d1[_0x864d('0x23')]();};}function saveUpdates(_0x3af899,_0x38a8de){return function(_0x96217a){if(_0x96217a){return _0x96217a['update'](_0x3af899)['then'](function(_0x2ae65a){return _0x2ae65a;});}return null;};}function removeEntity(_0x29891d,_0x333723){return function(_0x3f7cc0){if(_0x3f7cc0){return _0x3f7cc0[_0x864d('0x24')]()['then'](function(){_0x29891d['status'](0xcc)[_0x864d('0x1a')]();});}};}function handleEntityNotFound(_0x49598f,_0x5e1c70){return function(_0x5362be){if(!_0x5362be){_0x49598f[_0x864d('0x25')](0x194);}return _0x5362be;};}function handleError(_0x5dab3c,_0x452d0f){_0x452d0f=_0x452d0f||0x1f4;return function(_0x1e5000){logger[_0x864d('0x26')](_0x1e5000[_0x864d('0x27')]);if(_0x1e5000[_0x864d('0x28')]){delete _0x1e5000[_0x864d('0x28')];}_0x5dab3c[_0x864d('0x19')](_0x452d0f)['send'](_0x1e5000);};}exports[_0x864d('0x29')]=function(_0x533e73,_0x220cd8){var _0x29a89c={},_0x13dc80={},_0x3271b9={'count':0x0,'rows':[]};var _0x23dad3=_[_0x864d('0x2a')](db[_0x864d('0x2b')][_0x864d('0x2c')],function(_0x21d1b8){return{'name':_0x21d1b8[_0x864d('0x2d')],'type':_0x21d1b8[_0x864d('0x2e')]['key']};});_0x13dc80['model']=_[_0x864d('0x2a')](_0x23dad3,'name');_0x13dc80[_0x864d('0x2f')]=_[_0x864d('0x30')](_0x533e73['query']);_0x13dc80[_0x864d('0x31')]=_[_0x864d('0x32')](_0x13dc80['model'],_0x13dc80[_0x864d('0x2f')]);_0x29a89c[_0x864d('0x33')]=_['intersection'](_0x13dc80['model'],qs[_0x864d('0x34')](_0x533e73['query'][_0x864d('0x34')]));_0x29a89c[_0x864d('0x33')]=_0x29a89c[_0x864d('0x33')][_0x864d('0x35')]?_0x29a89c[_0x864d('0x33')]:_0x13dc80[_0x864d('0x36')];if(!_0x533e73[_0x864d('0x2f')]['hasOwnProperty'](_0x864d('0x37'))){_0x29a89c['limit']=qs['limit'](_0x533e73[_0x864d('0x2f')]['limit']);_0x29a89c[_0x864d('0x1c')]=qs[_0x864d('0x1c')](_0x533e73[_0x864d('0x2f')][_0x864d('0x1c')]);}_0x29a89c[_0x864d('0x38')]=qs['sort'](_0x533e73[_0x864d('0x2f')][_0x864d('0x39')]);_0x29a89c[_0x864d('0x3a')]=qs[_0x864d('0x31')](_['pick'](_0x533e73[_0x864d('0x2f')],_0x13dc80[_0x864d('0x31')]),_0x23dad3);if(_0x533e73[_0x864d('0x2f')][_0x864d('0x3b')]){_0x29a89c[_0x864d('0x3a')]=_['merge'](_0x29a89c[_0x864d('0x3a')],{'$or':_[_0x864d('0x2a')](_0x23dad3,function(_0x7740b){if(_0x7740b[_0x864d('0x2e')]!==_0x864d('0x3c')){var _0x18d6f9={};_0x18d6f9[_0x7740b[_0x864d('0x28')]]={'$like':'%'+_0x533e73[_0x864d('0x2f')]['filter']+'%'};return _0x18d6f9;}})});}_0x29a89c=_[_0x864d('0x3d')]({},_0x29a89c,_0x533e73[_0x864d('0x3e')]);var _0x553a3a={'where':_0x29a89c[_0x864d('0x3a')]};return db[_0x864d('0x2b')]['count'](_0x553a3a)[_0x864d('0x3f')](function(_0x59c3e1){_0x3271b9[_0x864d('0x1f')]=_0x59c3e1;if(_0x533e73['query']['includeAll']){_0x29a89c[_0x864d('0x40')]=[{'all':!![]}];}return db[_0x864d('0x2b')]['findAll'](_0x29a89c);})['then'](function(_0x3f4411){_0x3271b9[_0x864d('0x41')]=_0x3f4411;return _0x3271b9;})[_0x864d('0x3f')](respondWithFilteredResult(_0x220cd8,_0x29a89c))[_0x864d('0x42')](handleError(_0x220cd8,null));};exports[_0x864d('0x43')]=function(_0x1baba6,_0x441678){var _0x9dfae6={'raw':!![],'where':{'id':_0x1baba6['params']['id']}},_0x5b9809={};_0x5b9809[_0x864d('0x36')]=_['keys'](db[_0x864d('0x2b')][_0x864d('0x2c')]);_0x5b9809[_0x864d('0x2f')]=_[_0x864d('0x30')](_0x1baba6[_0x864d('0x2f')]);_0x5b9809[_0x864d('0x31')]=_['intersection'](_0x5b9809[_0x864d('0x36')],_0x5b9809[_0x864d('0x2f')]);_0x9dfae6['attributes']=_[_0x864d('0x32')](_0x5b9809[_0x864d('0x36')],qs[_0x864d('0x34')](_0x1baba6[_0x864d('0x2f')][_0x864d('0x34')]));_0x9dfae6[_0x864d('0x33')]=_0x9dfae6[_0x864d('0x33')][_0x864d('0x35')]?_0x9dfae6['attributes']:_0x5b9809[_0x864d('0x36')];if(_0x1baba6[_0x864d('0x2f')][_0x864d('0x44')]){_0x9dfae6['include']=[{'all':!![]}];}_0x9dfae6=_[_0x864d('0x3d')]({},_0x9dfae6,_0x1baba6[_0x864d('0x3e')]);return db[_0x864d('0x2b')][_0x864d('0x45')](_0x9dfae6)[_0x864d('0x3f')](handleEntityNotFound(_0x441678,null))[_0x864d('0x3f')](respondWithResult(_0x441678,null))['catch'](handleError(_0x441678,null));};exports['create']=function(_0x44519d,_0x350d2d){return db[_0x864d('0x2b')][_0x864d('0x46')](_0x44519d[_0x864d('0x47')],{})[_0x864d('0x3f')](respondWithResult(_0x350d2d,0xc9))['catch'](handleError(_0x350d2d,null));};exports[_0x864d('0x48')]=function(_0x385b68,_0xecd088){if(_0x385b68[_0x864d('0x47')]['id']){delete _0x385b68[_0x864d('0x47')]['id'];}return db[_0x864d('0x2b')]['find']({'where':{'id':_0x385b68[_0x864d('0x49')]['id']}})[_0x864d('0x3f')](handleEntityNotFound(_0xecd088,null))['then'](saveUpdates(_0x385b68[_0x864d('0x47')],null))[_0x864d('0x3f')](respondWithResult(_0xecd088,null))['catch'](handleError(_0xecd088,null));};exports['destroy']=function(_0x590111,_0x534516){return db['VoiceTransferReport'][_0x864d('0x45')]({'where':{'id':_0x590111[_0x864d('0x49')]['id']}})[_0x864d('0x3f')](handleEntityNotFound(_0x534516,null))[_0x864d('0x3f')](removeEntity(_0x534516,null))[_0x864d('0x42')](handleError(_0x534516,null));};exports[_0x864d('0x4a')]=function(_0x2c8057,_0x2a39e5){return db[_0x864d('0x2b')][_0x864d('0x4a')]()[_0x864d('0x3f')](respondWithResult(_0x2a39e5,null))[_0x864d('0x42')](handleError(_0x2a39e5,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 6067101..85483fe 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 _0x4f94=['VoiceTransferReport','report_call_transfer','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x14253d,_0x3b77fc){var _0x44bcce=function(_0x429a02){while(--_0x429a02){_0x14253d['push'](_0x14253d['shift']());}};_0x44bcce(++_0x3b77fc);}(_0x4f94,0xda));var _0x44f9=function(_0x3d2425,_0x17f440){_0x3d2425=_0x3d2425-0x0;var _0x61a03b=_0x4f94[_0x3d2425];return _0x61a03b;};'use strict';var _=require(_0x44f9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x44f9('0x1'));var moment=require(_0x44f9('0x2'));var BPromise=require(_0x44f9('0x3'));var rp=require(_0x44f9('0x4'));var fs=require('fs');var path=require(_0x44f9('0x5'));var rimraf=require(_0x44f9('0x6'));var config=require(_0x44f9('0x7'));var attributes=require(_0x44f9('0x8'));module[_0x44f9('0x9')]=function(_0x5d9824,_0x3a7339){return _0x5d9824['define'](_0x44f9('0xa'),attributes,{'tableName':_0x44f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0897=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','path','rimraf','../../config/environment'];(function(_0x1206c7,_0x4fdcb1){var _0x4d8050=function(_0x2c6824){while(--_0x2c6824){_0x1206c7['push'](_0x1206c7['shift']());}};_0x4d8050(++_0x4fdcb1);}(_0x0897,0x72));var _0x7089=function(_0xc8f305,_0x3283b3){_0xc8f305=_0xc8f305-0x0;var _0x323031=_0x0897[_0xc8f305];return _0x323031;};'use strict';var _=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var logger=require(_0x7089('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7089('0x3'));var rimraf=require(_0x7089('0x4'));var config=require(_0x7089('0x5'));var attributes=require(_0x7089('0x6'));module[_0x7089('0x7')]=function(_0x12af25,_0x5d441c){return _0x12af25[_0x7089('0x8')](_0x7089('0x9'),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 292c1a9..eabf865 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 _0x90c3=['error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','then','CreateVoiceTransferReport','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x32565f,_0x24510b){var _0x23a966=function(_0x1006bc){while(--_0x1006bc){_0x32565f['push'](_0x32565f['shift']());}};_0x23a966(++_0x24510b);}(_0x90c3,0xc9));var _0x390c=function(_0x2ab8f2,_0x468ae3){_0x2ab8f2=_0x2ab8f2-0x0;var _0xdb0847=_0x90c3[_0x2ab8f2];return _0xdb0847;};'use strict';var _=require(_0x390c('0x0'));var util=require(_0x390c('0x1'));var moment=require('moment');var BPromise=require(_0x390c('0x2'));var rs=require(_0x390c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x390c('0x4'));var logger=require(_0x390c('0x5'))(_0x390c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x390c('0x7')][_0x390c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e554a,_0x1d6d34,_0x45450b){return new BPromise(function(_0xdb4fe9,_0x59474){return client[_0x390c('0x9')](_0x1e554a,_0x45450b)['then'](function(_0x405f3f){logger[_0x390c('0xa')](_0x390c('0xb'),_0x1d6d34,'request\x20sent');logger[_0x390c('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1d6d34,_0x390c('0xd'),JSON[_0x390c('0xe')](_0x405f3f));if(_0x405f3f[_0x390c('0xf')]){if(_0x405f3f[_0x390c('0xf')][_0x390c('0x10')]===0x1f4){logger[_0x390c('0xf')](_0x390c('0xb'),_0x1d6d34,_0x405f3f[_0x390c('0xf')][_0x390c('0x11')]);return _0x59474(_0x405f3f[_0x390c('0xf')][_0x390c('0x11')]);}logger['error'](_0x390c('0xb'),_0x1d6d34,_0x405f3f['error'][_0x390c('0x11')]);return _0xdb4fe9(_0x405f3f[_0x390c('0xf')][_0x390c('0x11')]);}else{logger[_0x390c('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x1d6d34,_0x390c('0xd'));_0xdb4fe9(_0x405f3f[_0x390c('0x12')]['message']);}})[_0x390c('0x13')](function(_0x2bb7d7){logger[_0x390c('0xf')](_0x390c('0xb'),_0x1d6d34,_0x2bb7d7);_0x59474(_0x2bb7d7);});});}exports['CreateVoiceTransferReport']=function(_0x293de8){var _0x195fd5=this;return new Promise(function(_0x20c155,_0x3754b1){return db[_0x390c('0x14')][_0x390c('0x15')](_0x293de8[_0x390c('0x16')],{'raw':_0x293de8[_0x390c('0x17')]?_0x293de8['options'][_0x390c('0x18')]===undefined?!![]:![]:!![]})[_0x390c('0x19')](function(_0xff5d48){logger['info']('CreateVoiceTransferReport',_0x293de8);logger[_0x390c('0xc')](_0x390c('0x1a'),_0x293de8,JSON[_0x390c('0xe')](_0xff5d48));_0x20c155(_0xff5d48);})[_0x390c('0x13')](function(_0x39fcea){logger[_0x390c('0xf')]('CreateVoiceTransferReport',_0x39fcea['message'],_0x293de8);_0x3754b1(_0x195fd5[_0x390c('0xf')](0x1f4,_0x39fcea[_0x390c('0x11')]));});});}; \ No newline at end of file +var _0xa77b=['result','catch','body','options','CreateVoiceTransferReport','stringify','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa77b,0x180));var _0xba77=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xa77b[_0x1e393b];return _0x3d0bfe;};'use strict';var _=require(_0xba77('0x0'));var util=require(_0xba77('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xba77('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba77('0x3'))['db'];var utils=require(_0xba77('0x4'));var logger=require(_0xba77('0x5'))(_0xba77('0x6'));var config=require(_0xba77('0x7'));var jayson=require(_0xba77('0x8'));var client=jayson[_0xba77('0x9')][_0xba77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dcd64,_0x2a8f01,_0x53272e){return new BPromise(function(_0x1fbefb,_0x57ed1f){return client[_0xba77('0xb')](_0x3dcd64,_0x53272e)[_0xba77('0xc')](function(_0x2c4cf2){logger[_0xba77('0xd')](_0xba77('0xe'),_0x2a8f01,'request\x20sent');logger[_0xba77('0xf')](_0xba77('0x10'),_0x2a8f01,'request\x20sent',JSON['stringify'](_0x2c4cf2));if(_0x2c4cf2[_0xba77('0x11')]){if(_0x2c4cf2[_0xba77('0x11')][_0xba77('0x12')]===0x1f4){logger[_0xba77('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2a8f01,_0x2c4cf2['error'][_0xba77('0x13')]);return _0x57ed1f(_0x2c4cf2[_0xba77('0x11')][_0xba77('0x13')]);}logger[_0xba77('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2a8f01,_0x2c4cf2[_0xba77('0x11')][_0xba77('0x13')]);return _0x1fbefb(_0x2c4cf2[_0xba77('0x11')][_0xba77('0x13')]);}else{logger[_0xba77('0xd')](_0xba77('0xe'),_0x2a8f01,_0xba77('0x14'));_0x1fbefb(_0x2c4cf2[_0xba77('0x15')][_0xba77('0x13')]);}})[_0xba77('0x16')](function(_0x277bcc){logger[_0xba77('0x11')](_0xba77('0xe'),_0x2a8f01,_0x277bcc);_0x57ed1f(_0x277bcc);});});}exports['CreateVoiceTransferReport']=function(_0x5269e0){var _0x42f075=this;return new Promise(function(_0x80a5b4,_0x327a36){return db['VoiceTransferReport']['create'](_0x5269e0[_0xba77('0x17')],{'raw':_0x5269e0[_0xba77('0x18')]?_0x5269e0['options']['raw']===undefined?!![]:![]:!![]})[_0xba77('0xc')](function(_0xf7719a){logger[_0xba77('0xd')](_0xba77('0x19'),_0x5269e0);logger[_0xba77('0xf')]('CreateVoiceTransferReport',_0x5269e0,JSON[_0xba77('0x1a')](_0xf7719a));_0x80a5b4(_0xf7719a);})[_0xba77('0x16')](function(_0x2b6bc0){logger[_0xba77('0x11')](_0xba77('0x19'),_0x2b6bc0[_0xba77('0x13')],_0x5269e0);_0x327a36(_0x42f075[_0xba77('0x11')](0x1f4,_0x2b6bc0['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 72555b5..9143d87 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 _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x2e0da3,_0x3492f3){var _0x1ec9f1=function(_0x5cd088){while(--_0x5cd088){_0x2e0da3['push'](_0x2e0da3['shift']());}};_0x1ec9f1(++_0x3492f3);}(_0xdace,0xc5));var _0xedac=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0xdace[_0x17b0d4];return _0x2d02c7;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file +var _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0xf3cd[_0x2742db];return _0x18659e;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 1ffffb8..9e8e28f 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 _0x61a5=['redis','defaults','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','send','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','status','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','ioredis'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0x61a5,0xf0));var _0x561a=function(_0x37b1d8,_0x614312){_0x37b1d8=_0x37b1d8-0x0;var _0x3739e7=_0x61a5[_0x37b1d8];return _0x3739e7;};'use strict';var path=require(_0x561a('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x561a('0x1'))['db'];var config=require(_0x561a('0x2'));var util=require(_0x561a('0x3'));var BPromise=require(_0x561a('0x4'));var jayson=require(_0x561a('0x5'));var amiClient=jayson['client'][_0x561a('0x6')]({'port':0x232a});var logger=require(_0x561a('0x7'))('webbarapi');var Redis=require(_0x561a('0x8'));config[_0x561a('0x9')]=_[_0x561a('0xa')](config[_0x561a('0x9')],{'host':_0x561a('0xb'),'port':0x18eb});var io=require(_0x561a('0xc'))(new Redis(config[_0x561a('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x561a('0xe'),'required':[!![],_0x561a('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x561a('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x561a('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x561a('0x10')]},'sessionId':{'type':_0x561a('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],_0x561a('0x10')]},'sessionId':{'type':_0x561a('0xe'),'required':[!![],_0x561a('0x11')]},'transferNumber':{'type':_0x561a('0xe'),'required':[!![],_0x561a('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],_0x561a('0x10')]},'sessionId':{'type':_0x561a('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x561a('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],_0x561a('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x561a('0xd'),'required':[!![],_0x561a('0x10')]}});function emit(_0x28ad8b,_0x3d91be,_0x14f141){logger[_0x561a('0x13')](_0x28ad8b,_0x3d91be,JSON[_0x561a('0x14')](_0x14f141));io['to'](_0x28ad8b)[_0x561a('0x15')](_0x3d91be,_0x14f141);}function handleError(_0x48df6a){return function(_0x43c5aa){console[_0x561a('0x16')]('handleError:',_0x43c5aa,_0x43c5aa instanceof RangeError);logger[_0x561a('0x17')](_0x43c5aa[_0x561a('0x18')]);if(_0x43c5aa instanceof RangeError){if(_0x43c5aa['name']){delete _0x43c5aa[_0x561a('0x19')];}_0x48df6a['status'](0x194)['send'](_0x43c5aa);}else{if(_0x43c5aa[_0x561a('0x19')]){delete _0x43c5aa[_0x561a('0x19')];}_0x48df6a['status'](0x1f4)[_0x561a('0x1a')](_0x43c5aa);}};}function checkError(){return function(_0x88b2b5){if(!_0x88b2b5){throw new RangeError(_0x561a('0x1b'));}return _0x88b2b5;};}function respondWithRpcPromise(_0x3cf6c8,_0x345941){return new BPromise(function(_0x1bb8df,_0x4f9c3a){var _0x3e5509=amiClient;return _0x3e5509[_0x561a('0x1c')](_0x3cf6c8,_0x345941)[_0x561a('0x1d')](function(_0x527207){if(_0x527207['error']){if(_0x527207[_0x561a('0x17')][_0x561a('0x1e')]===0x1f4){return _0x4f9c3a(_0x527207[_0x561a('0x17')][_0x561a('0x1f')]);}return _0x1bb8df(_0x527207[_0x561a('0x17')][_0x561a('0x1f')]);}else{_0x1bb8df(_0x527207[_0x561a('0x20')]);}})[_0x561a('0x21')](function(_0x5bf2fa){_0x4f9c3a(_0x5bf2fa);});});}function getAgent(_0x4c2752){return db[_0x561a('0x22')][_0x561a('0x23')]({'where':{'id':_0x4c2752,'role':_0x561a('0x24')}})[_0x561a('0x1d')](checkError());}function getAgentCheckSession(_0x5a0acd,_0x186862){return new BPromise(function(_0x3f0789,_0x44c851){var _0x23b489=respondWithRpcPromise(_0x561a('0x25'));var _0x47f93a=getAgent(_0x5a0acd);Promise[_0x561a('0x26')]([_0x23b489,_0x47f93a])[_0x561a('0x1d')](function(_0x4f0b23){var _0x401636=_0x4f0b23[0x0];var _0x276ae7=_0x4f0b23[0x1];var _0x58db23=_[_0x561a('0x27')](_0x401636['rows'],function(_0x54a47a){return _0x54a47a[_0x561a('0x28')]==_0x276ae7['id']&&_0x54a47a[_0x561a('0x29')]==_0x186862;});if(_0x58db23['length']==0x1){_0x3f0789(_0x276ae7);}else{_0x44c851(new RangeError(_0x561a('0x2a')+_0x186862+_0x561a('0x2b')));}});});}exports[_0x561a('0x2c')]=function(_0x278c7e,_0x169243){logger[_0x561a('0x13')](_0x561a('0x2d'),_0x278c7e[_0x561a('0x2e')]);var _0x506c2e=originateValidation[_0x561a('0x2f')](_0x278c7e[_0x561a('0x2e')]);if(_0x506c2e[_0x561a('0x30')]>0x0){return _0x169243[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x506c2e);}var _0x4ab97f=_0x278c7e[_0x561a('0x2e')][_0x561a('0x33')];var _0x2d0063=_0x278c7e[_0x561a('0x2e')]['callNumber'];var _0x9ea469=_0x278c7e[_0x561a('0x2e')][_0x561a('0x34')];var _0x48f470=_0x278c7e['body'][_0x561a('0x35')];return getAgent(_0x4ab97f)['then'](function(_0x5a45a4){logger['info'](_0x561a('0x36'),_0x5a45a4[_0x561a('0x19')]);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x5a45a4[_0x561a('0x19')]),_0x561a('0x39'),{'callNumber':_0x2d0063,'callerId':_0x9ea469,'callbackUrl':_0x48f470});return _0x169243['status'](0xc8)['json']({'error':![],'message':_0x561a('0x3a')});})[_0x561a('0x21')](handleError(_0x169243));};exports[_0x561a('0x3b')]=function(_0x4e7d95,_0x4d81f7){logger[_0x561a('0x13')](_0x561a('0x3c'),_0x4e7d95[_0x561a('0x2e')]);var _0x5865c7=hangupValidation[_0x561a('0x2f')](_0x4e7d95[_0x561a('0x2e')]);if(_0x5865c7[_0x561a('0x30')]>0x0){return _0x4d81f7[_0x561a('0x31')](0x190)['json'](_0x5865c7);}var _0xbd11c4=_0x4e7d95[_0x561a('0x2e')][_0x561a('0x33')];var _0x5c59dc=_0x4e7d95[_0x561a('0x2e')][_0x561a('0x29')];return getAgent(_0xbd11c4)[_0x561a('0x1d')](function(_0x16779d){logger[_0x561a('0x13')](_0x561a('0x36'),_0x16779d[_0x561a('0x19')]);emit(util['format'](_0x561a('0x38'),_0x16779d[_0x561a('0x19')]),_0x561a('0x3d'),{'sessionId':_0x5c59dc});return _0x4d81f7[_0x561a('0x31')](0xc8)[_0x561a('0x32')]({'error':![],'message':_0x561a('0x3e')});})['catch'](handleError(_0x4d81f7));};exports[_0x561a('0x3f')]=function(_0xd991f8,_0x3f0f44){logger[_0x561a('0x13')](_0x561a('0x40'),_0xd991f8[_0x561a('0x2e')]);var _0x293e11=answerValidation[_0x561a('0x2f')](_0xd991f8[_0x561a('0x2e')]);if(_0x293e11['length']>0x0){return _0x3f0f44[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x293e11);}var _0x5197b1=_0xd991f8[_0x561a('0x2e')]['userId'];var _0x141971=_0xd991f8[_0x561a('0x2e')][_0x561a('0x29')];return getAgent(_0x5197b1)[_0x561a('0x1d')](function(_0x93103b){logger['info'](_0x561a('0x36'),_0x93103b[_0x561a('0x19')]);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x93103b[_0x561a('0x19')]),_0x561a('0x41'),{'sessionId':_0x141971});return _0x3f0f44['status'](0xc8)['json']({'error':![],'message':_0x561a('0x42')});})['catch'](handleError(_0x3f0f44));};exports['hold']=function(_0x4d7a38,_0x5e9e37){logger['info'](_0x561a('0x43'),_0x4d7a38[_0x561a('0x2e')]);var _0x21858b=holdValidation['validate'](_0x4d7a38[_0x561a('0x2e')]);if(_0x21858b['length']>0x0){return _0x5e9e37['status'](0x190)[_0x561a('0x32')](_0x21858b);}var _0x13a2ad=_0x4d7a38[_0x561a('0x2e')]['userId'];var _0x3bfd1b=_0x4d7a38['body'][_0x561a('0x29')];return getAgent(_0x13a2ad)['then'](function(_0x1bd3df){logger[_0x561a('0x13')](_0x561a('0x36'),_0x1bd3df[_0x561a('0x19')]);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x1bd3df[_0x561a('0x19')]),_0x561a('0x44'),{'sessionId':_0x3bfd1b});return _0x5e9e37[_0x561a('0x31')](0xc8)['json']({'error':![],'message':_0x561a('0x45')});})[_0x561a('0x21')](handleError(_0x5e9e37));};exports[_0x561a('0x46')]=function(_0x48ed34,_0x14fe1b){logger[_0x561a('0x13')]('unhold\x20fired:',_0x48ed34[_0x561a('0x2e')]);var _0x99dc7f=unholdValidation[_0x561a('0x2f')](_0x48ed34['body']);if(_0x99dc7f[_0x561a('0x30')]>0x0){return _0x14fe1b[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x99dc7f);}var _0x2cd4e0=_0x48ed34[_0x561a('0x2e')][_0x561a('0x33')];var _0x3d9b63=_0x48ed34['body'][_0x561a('0x29')];return getAgent(_0x2cd4e0)[_0x561a('0x1d')](function(_0x2dc1a3){logger[_0x561a('0x13')](_0x561a('0x36'),_0x2dc1a3[_0x561a('0x19')]);emit(util[_0x561a('0x37')]('user:%s',_0x2dc1a3[_0x561a('0x19')]),_0x561a('0x47'),{'sessionId':_0x3d9b63});return _0x14fe1b[_0x561a('0x31')](0xc8)['json']({'error':![],'message':_0x561a('0x48')});})['catch'](handleError(_0x14fe1b));};exports[_0x561a('0x49')]=function(_0x3d03c5,_0x2e0351){logger[_0x561a('0x13')](_0x561a('0x4a'),_0x2e0351[_0x561a('0x2e')]);var _0x29d981=callsValidation['validate'](_0x3d03c5['body']);if(_0x29d981[_0x561a('0x30')]>0x0){return _0x2e0351[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x29d981);}var _0x2945c1=_0x3d03c5[_0x561a('0x2e')][_0x561a('0x33')];var _0x4d13c8=respondWithRpcPromise(_0x561a('0x25'));var _0x1b0ecf=getAgent(_0x2945c1);return Promise['all']([_0x4d13c8,_0x1b0ecf])[_0x561a('0x1d')](function(_0x574ee2){var _0x5194d5=_0x574ee2[0x0];var _0xc7447e=_0x574ee2[0x1];var _0x16daeb=_[_0x561a('0x27')](_0x5194d5[_0x561a('0x4b')],function(_0x4a714c){return _0x4a714c[_0x561a('0x28')]==_0xc7447e['id'];});return _0x2e0351['status'](0xc8)[_0x561a('0x32')]({'count':_0x16daeb[_0x561a('0x30')],'rows':_0x16daeb});})[_0x561a('0x21')](handleError(_0x2e0351));};exports['conference']=function(_0x4ec13c,_0x52074a){logger['info'](_0x561a('0x4c'),_0x4ec13c[_0x561a('0x2e')]);var _0x485b80=conferenceValidation[_0x561a('0x2f')](_0x4ec13c[_0x561a('0x2e')]);if(_0x485b80[_0x561a('0x30')]>0x0){return _0x52074a['status'](0x190)[_0x561a('0x32')](_0x485b80);}var _0xb046d8=_0x4ec13c[_0x561a('0x2e')][_0x561a('0x33')];return getAgent(_0xb046d8)[_0x561a('0x1d')](function(_0x849fe){logger[_0x561a('0x13')](_0x561a('0x36'),_0x849fe[_0x561a('0x19')]);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x849fe['name']),_0x561a('0x4d'));return _0x52074a[_0x561a('0x31')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x561a('0x21')](handleError(_0x52074a));};exports[_0x561a('0x4e')]=function(_0x565867,_0x40f22e){logger[_0x561a('0x13')](_0x561a('0x4f'),_0x565867[_0x561a('0x2e')]);var _0x30d2a7=transferValidation[_0x561a('0x2f')](_0x565867['body']);if(_0x30d2a7['length']>0x0){return _0x40f22e[_0x561a('0x31')](0x190)[_0x561a('0x32')](_0x30d2a7);}var _0x3c8b20=_0x565867[_0x561a('0x2e')][_0x561a('0x33')];var _0x1656b=_0x565867['body']['sessionId'];var _0x53a93a=_0x565867[_0x561a('0x2e')][_0x561a('0x50')];return getAgent(_0x3c8b20)[_0x561a('0x1d')](function(_0x57bffc){logger['info']('entityFound:',_0x57bffc['name']);emit(util[_0x561a('0x37')](_0x561a('0x38'),_0x57bffc['name']),_0x561a('0x51'),{'sessionId':_0x1656b,'transferNumber':_0x53a93a});return _0x40f22e['status'](0xc8)['json']({'error':![],'message':_0x561a('0x52')});})[_0x561a('0x21')](handleError(_0x40f22e));}; \ No newline at end of file +var _0x19ea=['format','user:%s','originate\x20executed!','catch','hangup','hangup\x20fired:','sessionId','entityFound:','webbar:hangup','json','hangup\x20executed!','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','../../config/environment','bluebird','jayson/promise','client','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','stringify','emit','log','error','name','send','status','NotFound','request','then','message','result','findOne','agent','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callerId','callbackUrl'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x19ea,0xfe));var _0xa19e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x19ea[_0x3c2a69];return _0x596bc8;};'use strict';var path=require(_0xa19e('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xa19e('0x1'));var util=require('util');var BPromise=require(_0xa19e('0x2'));var jayson=require(_0xa19e('0x3'));var amiClient=jayson[_0xa19e('0x4')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0xa19e('0x5'));var Redis=require(_0xa19e('0x6'));config[_0xa19e('0x7')]=_[_0xa19e('0x8')](config[_0xa19e('0x7')],{'host':_0xa19e('0x9'),'port':0x18eb});var io=require(_0xa19e('0xa'))(new Redis(config[_0xa19e('0x7')]));var Schema=require(_0xa19e('0xb'));var originateValidation=new Schema({'userId':{'type':_0xa19e('0xc'),'required':[!![],_0xa19e('0xd')]},'callNumber':{'type':'string','required':[!![],_0xa19e('0xe')]},'callerId':{'type':_0xa19e('0xf')},'callbackUrl':{'type':_0xa19e('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xa19e('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa19e('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa19e('0xc'),'required':[!![],_0xa19e('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa19e('0xc'),'required':[!![],_0xa19e('0xd')]},'sessionId':{'type':_0xa19e('0xf'),'required':[!![],_0xa19e('0x10')]},'transferNumber':{'type':_0xa19e('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xa19e('0xc'),'required':[!![],_0xa19e('0xd')]},'sessionId':{'type':_0xa19e('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa19e('0xc'),'required':[!![],_0xa19e('0xd')]},'sessionId':{'type':_0xa19e('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa19e('0xc'),'required':[!![],_0xa19e('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa19e('0xc'),'required':[!![],_0xa19e('0xd')]}});function emit(_0x2598f5,_0x48530c,_0x28fd37){logger[_0xa19e('0x11')](_0x2598f5,_0x48530c,JSON[_0xa19e('0x12')](_0x28fd37));io['to'](_0x2598f5)[_0xa19e('0x13')](_0x48530c,_0x28fd37);}function handleError(_0x3acfae){return function(_0x38e398){console[_0xa19e('0x14')]('handleError:',_0x38e398,_0x38e398 instanceof RangeError);logger[_0xa19e('0x15')](_0x38e398['stack']);if(_0x38e398 instanceof RangeError){if(_0x38e398[_0xa19e('0x16')]){delete _0x38e398['name'];}_0x3acfae['status'](0x194)[_0xa19e('0x17')](_0x38e398);}else{if(_0x38e398[_0xa19e('0x16')]){delete _0x38e398['name'];}_0x3acfae[_0xa19e('0x18')](0x1f4)[_0xa19e('0x17')](_0x38e398);}};}function checkError(){return function(_0x3c11d5){if(!_0x3c11d5){throw new RangeError(_0xa19e('0x19'));}return _0x3c11d5;};}function respondWithRpcPromise(_0x5869c8,_0x41ad6b){return new BPromise(function(_0x33b588,_0x105874){var _0x301f6d=amiClient;return _0x301f6d[_0xa19e('0x1a')](_0x5869c8,_0x41ad6b)[_0xa19e('0x1b')](function(_0x2a416e){if(_0x2a416e[_0xa19e('0x15')]){if(_0x2a416e[_0xa19e('0x15')]['code']===0x1f4){return _0x105874(_0x2a416e[_0xa19e('0x15')][_0xa19e('0x1c')]);}return _0x33b588(_0x2a416e['error'][_0xa19e('0x1c')]);}else{_0x33b588(_0x2a416e[_0xa19e('0x1d')]);}})['catch'](function(_0x20b05c){_0x105874(_0x20b05c);});});}function getAgent(_0x389f2f){return db['User'][_0xa19e('0x1e')]({'where':{'id':_0x389f2f,'role':_0xa19e('0x1f')}})[_0xa19e('0x1b')](checkError());}function getAgentCheckSession(_0x21c9ca,_0x2076c5){return new BPromise(function(_0x180407,_0x23c0cc){var _0x3f5ac6=respondWithRpcPromise(_0xa19e('0x20'));var _0x24dd51=getAgent(_0x21c9ca);Promise[_0xa19e('0x21')]([_0x3f5ac6,_0x24dd51])[_0xa19e('0x1b')](function(_0x1ce643){var _0x475a26=_0x1ce643[0x0];var _0xdf0b20=_0x1ce643[0x1];var _0x4613c3=_[_0xa19e('0x22')](_0x475a26[_0xa19e('0x23')],function(_0x3dcd74){return _0x3dcd74[_0xa19e('0x24')]==_0xdf0b20['id']&&_0x3dcd74['sessionId']==_0x2076c5;});if(_0x4613c3[_0xa19e('0x25')]==0x1){_0x180407(_0xdf0b20);}else{_0x23c0cc(new RangeError(_0xa19e('0x26')+_0x2076c5+_0xa19e('0x27')));}});});}exports[_0xa19e('0x28')]=function(_0x13d6c4,_0x355fd9){logger['info'](_0xa19e('0x29'),_0x13d6c4[_0xa19e('0x2a')]);var _0x543ae5=originateValidation[_0xa19e('0xb')](_0x13d6c4['body']);if(_0x543ae5['length']>0x0){return _0x355fd9[_0xa19e('0x18')](0x190)['json'](_0x543ae5);}var _0x5a42c9=_0x13d6c4['body'][_0xa19e('0x2b')];var _0x177e4b=_0x13d6c4[_0xa19e('0x2a')]['callNumber'];var _0x1ec065=_0x13d6c4[_0xa19e('0x2a')][_0xa19e('0x2c')];var _0x288a41=_0x13d6c4[_0xa19e('0x2a')][_0xa19e('0x2d')];return getAgent(_0x5a42c9)['then'](function(_0x3e1e62){logger[_0xa19e('0x11')]('entityFound:',_0x3e1e62[_0xa19e('0x16')]);emit(util[_0xa19e('0x2e')](_0xa19e('0x2f'),_0x3e1e62['name']),'webbar:originate',{'callNumber':_0x177e4b,'callerId':_0x1ec065,'callbackUrl':_0x288a41});return _0x355fd9[_0xa19e('0x18')](0xc8)['json']({'error':![],'message':_0xa19e('0x30')});})[_0xa19e('0x31')](handleError(_0x355fd9));};exports[_0xa19e('0x32')]=function(_0x18c54a,_0x4f7e80){logger[_0xa19e('0x11')](_0xa19e('0x33'),_0x18c54a['body']);var _0x438e5a=hangupValidation['validate'](_0x18c54a[_0xa19e('0x2a')]);if(_0x438e5a[_0xa19e('0x25')]>0x0){return _0x4f7e80[_0xa19e('0x18')](0x190)['json'](_0x438e5a);}var _0x45ee6f=_0x18c54a[_0xa19e('0x2a')][_0xa19e('0x2b')];var _0x4c3554=_0x18c54a[_0xa19e('0x2a')][_0xa19e('0x34')];return getAgent(_0x45ee6f)['then'](function(_0x561608){logger[_0xa19e('0x11')](_0xa19e('0x35'),_0x561608['name']);emit(util[_0xa19e('0x2e')](_0xa19e('0x2f'),_0x561608['name']),_0xa19e('0x36'),{'sessionId':_0x4c3554});return _0x4f7e80[_0xa19e('0x18')](0xc8)[_0xa19e('0x37')]({'error':![],'message':_0xa19e('0x38')});})[_0xa19e('0x31')](handleError(_0x4f7e80));};exports['answer']=function(_0x2acd9b,_0x26b0fd){logger[_0xa19e('0x11')](_0xa19e('0x39'),_0x2acd9b[_0xa19e('0x2a')]);var _0x51f0f4=answerValidation[_0xa19e('0xb')](_0x2acd9b['body']);if(_0x51f0f4[_0xa19e('0x25')]>0x0){return _0x26b0fd[_0xa19e('0x18')](0x190)['json'](_0x51f0f4);}var _0x8dfa7e=_0x2acd9b[_0xa19e('0x2a')]['userId'];var _0x41d7ae=_0x2acd9b['body'][_0xa19e('0x34')];return getAgent(_0x8dfa7e)[_0xa19e('0x1b')](function(_0x3572b2){logger[_0xa19e('0x11')](_0xa19e('0x35'),_0x3572b2[_0xa19e('0x16')]);emit(util[_0xa19e('0x2e')](_0xa19e('0x2f'),_0x3572b2['name']),_0xa19e('0x3a'),{'sessionId':_0x41d7ae});return _0x26b0fd[_0xa19e('0x18')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0xa19e('0x31')](handleError(_0x26b0fd));};exports[_0xa19e('0x3b')]=function(_0x3cbc3b,_0x5a865d){logger[_0xa19e('0x11')](_0xa19e('0x3c'),_0x3cbc3b['body']);var _0x1b7f8b=holdValidation[_0xa19e('0xb')](_0x3cbc3b[_0xa19e('0x2a')]);if(_0x1b7f8b['length']>0x0){return _0x5a865d[_0xa19e('0x18')](0x190)['json'](_0x1b7f8b);}var _0x349543=_0x3cbc3b[_0xa19e('0x2a')][_0xa19e('0x2b')];var _0x3c3b3a=_0x3cbc3b[_0xa19e('0x2a')]['sessionId'];return getAgent(_0x349543)[_0xa19e('0x1b')](function(_0x4c90fe){logger[_0xa19e('0x11')]('entityFound:',_0x4c90fe[_0xa19e('0x16')]);emit(util[_0xa19e('0x2e')](_0xa19e('0x2f'),_0x4c90fe[_0xa19e('0x16')]),'webbar:hold',{'sessionId':_0x3c3b3a});return _0x5a865d[_0xa19e('0x18')](0xc8)[_0xa19e('0x37')]({'error':![],'message':_0xa19e('0x3d')});})[_0xa19e('0x31')](handleError(_0x5a865d));};exports['unhold']=function(_0x454c9f,_0x5ae431){logger[_0xa19e('0x11')](_0xa19e('0x3e'),_0x454c9f[_0xa19e('0x2a')]);var _0x501dea=unholdValidation[_0xa19e('0xb')](_0x454c9f[_0xa19e('0x2a')]);if(_0x501dea['length']>0x0){return _0x5ae431[_0xa19e('0x18')](0x190)[_0xa19e('0x37')](_0x501dea);}var _0x33b6b0=_0x454c9f[_0xa19e('0x2a')]['userId'];var _0x51d10a=_0x454c9f[_0xa19e('0x2a')][_0xa19e('0x34')];return getAgent(_0x33b6b0)['then'](function(_0x18f219){logger[_0xa19e('0x11')]('entityFound:',_0x18f219[_0xa19e('0x16')]);emit(util[_0xa19e('0x2e')](_0xa19e('0x2f'),_0x18f219[_0xa19e('0x16')]),_0xa19e('0x3f'),{'sessionId':_0x51d10a});return _0x5ae431[_0xa19e('0x18')](0xc8)[_0xa19e('0x37')]({'error':![],'message':_0xa19e('0x40')});})[_0xa19e('0x31')](handleError(_0x5ae431));};exports[_0xa19e('0x41')]=function(_0x39eb06,_0x479b09){logger['info'](_0xa19e('0x42'),_0x479b09[_0xa19e('0x2a')]);var _0x17ac29=callsValidation['validate'](_0x39eb06['body']);if(_0x17ac29['length']>0x0){return _0x479b09[_0xa19e('0x18')](0x190)['json'](_0x17ac29);}var _0x3ce686=_0x39eb06[_0xa19e('0x2a')][_0xa19e('0x2b')];var _0xdf2b29=respondWithRpcPromise('VoiceChannels');var _0x966a23=getAgent(_0x3ce686);return Promise[_0xa19e('0x21')]([_0xdf2b29,_0x966a23])[_0xa19e('0x1b')](function(_0xfe4a4){var _0x2cc680=_0xfe4a4[0x0];var _0x12064e=_0xfe4a4[0x1];var _0x1eb008=_[_0xa19e('0x22')](_0x2cc680[_0xa19e('0x23')],function(_0x43ed0f){return _0x43ed0f[_0xa19e('0x24')]==_0x12064e['id'];});return _0x479b09[_0xa19e('0x18')](0xc8)[_0xa19e('0x37')]({'count':_0x1eb008[_0xa19e('0x25')],'rows':_0x1eb008});})[_0xa19e('0x31')](handleError(_0x479b09));};exports[_0xa19e('0x43')]=function(_0x45f7ee,_0x5ad478){logger[_0xa19e('0x11')](_0xa19e('0x44'),_0x45f7ee['body']);var _0x14483e=conferenceValidation['validate'](_0x45f7ee['body']);if(_0x14483e[_0xa19e('0x25')]>0x0){return _0x5ad478[_0xa19e('0x18')](0x190)[_0xa19e('0x37')](_0x14483e);}var _0x5d85f2=_0x45f7ee[_0xa19e('0x2a')]['userId'];return getAgent(_0x5d85f2)[_0xa19e('0x1b')](function(_0x5afd28){logger[_0xa19e('0x11')](_0xa19e('0x35'),_0x5afd28[_0xa19e('0x16')]);emit(util[_0xa19e('0x2e')](_0xa19e('0x2f'),_0x5afd28['name']),_0xa19e('0x45'));return _0x5ad478['status'](0xc8)[_0xa19e('0x37')]({'error':![],'message':_0xa19e('0x46')});})[_0xa19e('0x31')](handleError(_0x5ad478));};exports[_0xa19e('0x47')]=function(_0x1982b6,_0x2b625c){logger[_0xa19e('0x11')](_0xa19e('0x48'),_0x1982b6[_0xa19e('0x2a')]);var _0x3f6bf7=transferValidation[_0xa19e('0xb')](_0x1982b6[_0xa19e('0x2a')]);if(_0x3f6bf7['length']>0x0){return _0x2b625c[_0xa19e('0x18')](0x190)[_0xa19e('0x37')](_0x3f6bf7);}var _0x5ca466=_0x1982b6[_0xa19e('0x2a')]['userId'];var _0x1d991d=_0x1982b6['body'][_0xa19e('0x34')];var _0x45f260=_0x1982b6['body'][_0xa19e('0x49')];return getAgent(_0x5ca466)['then'](function(_0xbb6170){logger[_0xa19e('0x11')](_0xa19e('0x35'),_0xbb6170[_0xa19e('0x16')]);emit(util[_0xa19e('0x2e')](_0xa19e('0x2f'),_0xbb6170['name']),_0xa19e('0x4a'),{'sessionId':_0x1d991d,'transferNumber':_0x45f260});return _0x2b625c[_0xa19e('0x18')](0xc8)[_0xa19e('0x37')]({'error':![],'message':'transfer\x20executed!'});})[_0xa19e('0x31')](handleError(_0x2b625c));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index fd9bf57..4c46cea 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 _0x5f2f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','post','create','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x596cb7,_0x131fe5){_0x596cb7=_0x596cb7-0x0;var _0x4ba435=_0x5f2f[_0x596cb7];return _0x4ba435;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/canned_answers',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['get'](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);router[_0xf5f2('0x9')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller['getApplications']);router[_0xf5f2('0x16')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x16')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x18')]);router[_0xf5f2('0x16')](_0xf5f2('0x19'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x16')](_0xf5f2('0x13'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1b')]);router[_0xf5f2('0x16')](_0xf5f2('0x15'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x16')](_0xf5f2('0x1d'),controller[_0xf5f2('0x1e')]);router[_0xf5f2('0x16')]('/:id/send',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1f')]);router['put']('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x20')]);router['delete'](_0xf5f2('0xe'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x21')]);router[_0xf5f2('0x22')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x23')]);router[_0xf5f2('0x22')](_0xf5f2('0x19'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x24')]);router['delete']('/:id/users',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x25')]);module[_0xf5f2('0x26')]=router; \ No newline at end of file +var _0x2a07=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','/:id/send','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x5e915d,_0x351fb8){var _0xbd4970=function(_0x14d469){while(--_0x14d469){_0x5e915d['push'](_0x5e915d['shift']());}};_0xbd4970(++_0x351fb8);}(_0x2a07,0x74));var _0x72a0=function(_0x25300c,_0x8d65be){_0x25300c=_0x25300c-0x0;var _0x2dd3e4=_0x2a07[_0x25300c];return _0x2dd3e4;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['get'](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller['getDispositions']);router[_0x72a0('0xa')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x13')]);router[_0x72a0('0xa')]('/:id/users',auth[_0x72a0('0xb')](),controller[_0x72a0('0x14')]);router[_0x72a0('0xa')](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x16')]);router[_0x72a0('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x72a0('0x17')](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x18')]);router[_0x72a0('0x17')](_0x72a0('0x12'),auth['isAuthenticated'](),controller[_0x72a0('0x19')]);router[_0x72a0('0x17')](_0x72a0('0x1a'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1b')]);router['post'](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1c')]);router['post'](_0x72a0('0x1d'),controller[_0x72a0('0x1e')]);router[_0x72a0('0x17')](_0x72a0('0x1f'),auth['isAuthenticated'](),controller[_0x72a0('0x20')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x21')]);router['delete'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x22')]);router[_0x72a0('0x23')]('/:id/dispositions',auth[_0x72a0('0xb')](),controller[_0x72a0('0x24')]);router[_0x72a0('0x23')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x25')]);router['delete']('/:id/users',auth[_0x72a0('0xb')](),controller[_0x72a0('0x26')]);module[_0x72a0('0x27')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 7cac0eb..6d3cb7a 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 _0x2d6c=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x1d4119,_0xee2cd7){var _0x21a170=function(_0x52ccc5){while(--_0x52ccc5){_0x1d4119['push'](_0x1d4119['shift']());}};_0x21a170(++_0xee2cd7);}(_0x2d6c,0x85));var _0xc2d6=function(_0x15656d,_0x57a99a){_0x15656d=_0x15656d-0x0;var _0x10ec83=_0x2d6c[_0x15656d];return _0x10ec83;};'use strict';var Sequelize=require(_0xc2d6('0x0'));var rs=require(_0xc2d6('0x1'));module[_0xc2d6('0x2')]={'name':{'type':Sequelize[_0xc2d6('0x3')],'unique':_0xc2d6('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xc2d6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xc2d6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xc2d6('0x3')],'defaultValue':function(){return rs[_0xc2d6('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc2d6('0x6')](_0xc2d6('0x7'),_0xc2d6('0x8'))},'accountSid':{'type':Sequelize[_0xc2d6('0x3')]},'baseUrl':{'type':Sequelize[_0xc2d6('0x3')]},'authToken':{'type':Sequelize[_0xc2d6('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc2d6('0x9')],'defaultValue':function(){return _0xc2d6('0xa');}},'notificationSound':{'type':Sequelize[_0xc2d6('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xc2d6('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc2d6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc2d6('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc2d6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc2d6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc2d6('0xc')],'comment':_0xc2d6('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xc2d6('0xb')],'defaultValue':![],'comment':_0xc2d6('0xe'),'set':function(_0x5ab0b3){if(!_0x5ab0b3){this['setDataValue'](_0xc2d6('0xf'),null);}this[_0xc2d6('0x10')](_0xc2d6('0x11'),_0x5ab0b3);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7798=['mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x55ff21,_0x1540f0){var _0x4baf37=function(_0x51128b){while(--_0x51128b){_0x55ff21['push'](_0x55ff21['shift']());}};_0x4baf37(++_0x1540f0);}(_0x7798,0x6a));var _0x8779=function(_0x59d2a6,_0x4d921b){_0x59d2a6=_0x59d2a6-0x0;var _0x1c7670=_0x7798[_0x59d2a6];return _0x1c7670;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x8779('0x0'));module[_0x8779('0x1')]={'name':{'type':Sequelize[_0x8779('0x2')],'unique':_0x8779('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8779('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x8779('0x2')],'defaultValue':function(){return rs[_0x8779('0x4')]();}},'phone':{'type':Sequelize[_0x8779('0x2')]},'type':{'type':Sequelize[_0x8779('0x5')](_0x8779('0x6'),_0x8779('0x7'))},'accountSid':{'type':Sequelize[_0x8779('0x2')]},'baseUrl':{'type':Sequelize[_0x8779('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8779('0x8');}},'notificationSound':{'type':Sequelize[_0x8779('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8779('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8779('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8779('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8779('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8779('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8779('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8779('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8779('0x9')],'defaultValue':![],'comment':_0x8779('0xb'),'set':function(_0x2b6cf7){if(!_0x2b6cf7){this[_0x8779('0xc')](_0x8779('0xd'),null);}this[_0x8779('0xc')](_0x8779('0xe'),_0x2b6cf7);}},'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 8e01c28..36148ab 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 _0x1640=['findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','mobile','twilio','from','From','whatsapp:','Body','messageId','MessageSid','sinch','notifications','isNil','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','ListId','Contacts','DESC','list','contact','WhatsappInteraction','interaction','applications','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','get','WhatsappAccounts','UserProfileResource','destroy','end','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','includeAll','include','catch','show','merge','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','params','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','READ_COMMITTED','WhatsappApplication'];(function(_0x2096bc,_0x2246cb){var _0x5b522d=function(_0x17ef1f){while(--_0x17ef1f){_0x2096bc['push'](_0x2096bc['shift']());}};_0x5b522d(++_0x2246cb);}(_0x1640,0x109));var _0x0164=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x1640[_0x209941];return _0x1e8729;};'use strict';var emlformat=require(_0x0164('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0164('0x1'));var jsonpatch=require(_0x0164('0x2'));var rp=require(_0x0164('0x3'));var moment=require(_0x0164('0x4'));var BPromise=require(_0x0164('0x5'));var Mustache=require('mustache');var util=require(_0x0164('0x6'));var path=require('path');var sox=require(_0x0164('0x7'));var csv=require('to-csv');var ejs=require(_0x0164('0x8'));var fs=require('fs');var fs_extra=require(_0x0164('0x9'));var _=require('lodash');var squel=require(_0x0164('0xa'));var crypto=require(_0x0164('0xb'));var jsforce=require(_0x0164('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0164('0xd'));var querystring=require(_0x0164('0xe'));var Papa=require(_0x0164('0xf'));var Redis=require(_0x0164('0x10'));var authService=require(_0x0164('0x11'));var qs=require(_0x0164('0x12'));var as=require(_0x0164('0x13'));var hardwareService=require(_0x0164('0x14'));var logger=require(_0x0164('0x15'))('api');var utils=require(_0x0164('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0164('0x17'))['db'];config['redis']=_[_0x0164('0x18')](config[_0x0164('0x19')],{'host':_0x0164('0x1a'),'port':0x18eb});var socket=require(_0x0164('0x1b'))(new Redis(config[_0x0164('0x19')]));require(_0x0164('0x1c'))['register'](socket);var jayson=require(_0x0164('0x1d'));var client=jayson[_0x0164('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0x13960f,_0x37779b,_0xb60867,_0x4f8153){return new BPromise(function(_0x39ed90,_0x24d59c){var _0x540843=_0x4f8153||client;return _0x540843[_0x0164('0x1f')](_0x13960f,_0xb60867)[_0x0164('0x20')](function(_0xa337eb){logger[_0x0164('0x21')](_0x0164('0x22'),_0x37779b,'request\x20sent');logger[_0x0164('0x23')](_0x0164('0x24'),_0x37779b,'request\x20sent',JSON[_0x0164('0x25')](_0xa337eb));if(_0xa337eb[_0x0164('0x26')]){if(_0xa337eb[_0x0164('0x26')][_0x0164('0x27')]===0x1f4){logger['error'](_0x0164('0x22'),_0x37779b,_0xa337eb[_0x0164('0x26')][_0x0164('0x28')]);return _0x24d59c(_0xa337eb['error'][_0x0164('0x28')]);}logger['error'](_0x0164('0x22'),_0x37779b,_0xa337eb[_0x0164('0x26')]['message']);return _0x39ed90(_0xa337eb['error'][_0x0164('0x28')]);}else{logger[_0x0164('0x21')](_0x0164('0x22'),_0x37779b,_0x0164('0x29'));_0x39ed90(_0xa337eb[_0x0164('0x2a')][_0x0164('0x28')]);}})['catch'](function(_0x4c9846){logger[_0x0164('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x37779b,_0x4c9846);_0x24d59c(_0x4c9846);});});}function respondWithStatusCode(_0x4096cd,_0x220f51){_0x220f51=_0x220f51||0xcc;return function(_0x1ec61c){if(_0x1ec61c){return _0x4096cd[_0x0164('0x2b')](_0x220f51);}return _0x4096cd['status'](_0x220f51)['end']();};}function respondWithResult(_0x592a82,_0x355f51){_0x355f51=_0x355f51||0xc8;return function(_0x421cb7){if(_0x421cb7){return _0x592a82[_0x0164('0x2c')](_0x355f51)[_0x0164('0x2d')](_0x421cb7);}};}function respondWithFilteredResult(_0x564739,_0x284a02){return function(_0x3a8701){if(_0x3a8701){var _0x202db9=typeof _0x284a02[_0x0164('0x2e')]===_0x0164('0x2f')&&typeof _0x284a02[_0x0164('0x30')]===_0x0164('0x2f');var _0x4d9feb=_0x3a8701[_0x0164('0x31')];var _0x533ef3=_0x202db9?0x0:_0x284a02[_0x0164('0x2e')];var _0x244196=_0x202db9?_0x3a8701[_0x0164('0x31')]:_0x284a02[_0x0164('0x2e')]+_0x284a02[_0x0164('0x30')];var _0x5b4ceb;if(_0x244196>=_0x4d9feb){_0x244196=_0x4d9feb;_0x5b4ceb=0xc8;}else{_0x5b4ceb=0xce;}_0x564739['status'](_0x5b4ceb);return _0x564739[_0x0164('0x32')](_0x0164('0x33'),_0x533ef3+'-'+_0x244196+'/'+_0x4d9feb)[_0x0164('0x2d')](_0x3a8701);}return null;};}function patchUpdates(_0x3ce994){return function(_0x1ca9f1){try{jsonpatch['apply'](_0x1ca9f1,_0x3ce994,!![]);}catch(_0x2cf249){return BPromise['reject'](_0x2cf249);}return _0x1ca9f1[_0x0164('0x34')]();};}function saveUpdates(_0x4355d2,_0x2fb16a){return function(_0x1b46d8){if(_0x1b46d8){return _0x1b46d8['update'](_0x4355d2)[_0x0164('0x20')](function(_0x456bb1){return _0x456bb1;});}return null;};}function removeEntity(_0x1b2033,_0x34949d){return function(_0x2dd8e8){if(_0x2dd8e8){return _0x2dd8e8['destroy']()[_0x0164('0x20')](function(){var _0x5e43f8=_0x2dd8e8[_0x0164('0x35')]({'plain':!![]});var _0xbe9813=_0x0164('0x36');return db[_0x0164('0x37')][_0x0164('0x38')]({'where':{'type':_0xbe9813,'resourceId':_0x5e43f8['id']}})[_0x0164('0x20')](function(){return _0x2dd8e8;});})[_0x0164('0x20')](function(){_0x1b2033[_0x0164('0x2c')](0xcc)[_0x0164('0x39')]();});}};}function handleEntityNotFound(_0x4b9463,_0x155dd9){return function(_0x4872fc){if(!_0x4872fc){_0x4b9463[_0x0164('0x2b')](0x194);}return _0x4872fc;};}function handleError(_0x336b10,_0x37d615){_0x37d615=_0x37d615||0x1f4;return function(_0x3aef62){logger[_0x0164('0x26')](_0x3aef62[_0x0164('0x3a')]);if(_0x3aef62[_0x0164('0x3b')]){delete _0x3aef62[_0x0164('0x3b')];}_0x336b10[_0x0164('0x2c')](_0x37d615)['send'](_0x3aef62);};}exports[_0x0164('0x3c')]=function(_0x2111c0,_0x51b036){var _0x281075={'include':[{'model':db[_0x0164('0x3d')],'as':_0x0164('0x3e')}]},_0x17f598={},_0x14ffac={'count':0x0,'rows':[]};var _0x9ed2fa=_[_0x0164('0x3f')](db[_0x0164('0x40')][_0x0164('0x41')],function(_0x1314c3){return{'name':_0x1314c3['fieldName'],'type':_0x1314c3[_0x0164('0x42')][_0x0164('0x43')]};});_0x17f598[_0x0164('0x44')]=_[_0x0164('0x3f')](_0x9ed2fa,_0x0164('0x3b'));_0x17f598[_0x0164('0x45')]=_[_0x0164('0x46')](_0x2111c0[_0x0164('0x45')]);_0x17f598[_0x0164('0x47')]=_[_0x0164('0x48')](_0x17f598['model'],_0x17f598[_0x0164('0x45')]);_0x281075[_0x0164('0x49')]=_['intersection'](_0x17f598['model'],qs[_0x0164('0x4a')](_0x2111c0[_0x0164('0x45')][_0x0164('0x4a')]));_0x281075['attributes']=_0x281075['attributes'][_0x0164('0x4b')]?_0x281075[_0x0164('0x49')]:_0x17f598['model'];if(!_0x2111c0[_0x0164('0x45')][_0x0164('0x4c')](_0x0164('0x4d'))){_0x281075[_0x0164('0x30')]=qs['limit'](_0x2111c0[_0x0164('0x45')][_0x0164('0x30')]);_0x281075[_0x0164('0x2e')]=qs[_0x0164('0x2e')](_0x2111c0[_0x0164('0x45')][_0x0164('0x2e')]);}_0x281075[_0x0164('0x4e')]=qs[_0x0164('0x4f')](_0x2111c0[_0x0164('0x45')]['sort']);_0x281075['where']=qs['filters'](_[_0x0164('0x50')](_0x2111c0[_0x0164('0x45')],_0x17f598['filters']),_0x9ed2fa);if(_0x2111c0['query'][_0x0164('0x51')]){_0x281075[_0x0164('0x52')]=_['merge'](_0x281075['where'],{'$or':_[_0x0164('0x3f')](_0x9ed2fa,function(_0x390eaa){if(_0x390eaa[_0x0164('0x42')]!=='VIRTUAL'){var _0x46721f={};_0x46721f[_0x390eaa[_0x0164('0x3b')]]={'$like':'%'+_0x2111c0[_0x0164('0x45')][_0x0164('0x51')]+'%'};return _0x46721f;}})});}_0x281075=_['merge']({},_0x281075,_0x2111c0['options']);var _0x4f5244={'where':_0x281075[_0x0164('0x52')]};return db[_0x0164('0x40')][_0x0164('0x31')](_0x4f5244)[_0x0164('0x20')](function(_0x525c97){_0x14ffac['count']=_0x525c97;if(_0x2111c0['query'][_0x0164('0x53')]){_0x281075[_0x0164('0x54')]=[{'all':!![]}];}return db[_0x0164('0x40')]['findAll'](_0x281075);})[_0x0164('0x20')](function(_0x386ed9){_0x14ffac['rows']=_0x386ed9;return _0x14ffac;})['then'](respondWithFilteredResult(_0x51b036,_0x281075))[_0x0164('0x55')](handleError(_0x51b036,null));};exports[_0x0164('0x56')]=function(_0x537ae3,_0x33c673){var _0x3f1cb2={'raw':![],'where':{'id':_0x537ae3['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x10e470={};_0x10e470[_0x0164('0x44')]=_[_0x0164('0x46')](db[_0x0164('0x40')]['rawAttributes']);_0x10e470[_0x0164('0x45')]=_[_0x0164('0x46')](_0x537ae3['query']);_0x10e470[_0x0164('0x47')]=_['intersection'](_0x10e470['model'],_0x10e470[_0x0164('0x45')]);_0x3f1cb2[_0x0164('0x49')]=_['intersection'](_0x10e470['model'],qs[_0x0164('0x4a')](_0x537ae3[_0x0164('0x45')][_0x0164('0x4a')]));_0x3f1cb2['attributes']=_0x3f1cb2[_0x0164('0x49')][_0x0164('0x4b')]?_0x3f1cb2[_0x0164('0x49')]:_0x10e470[_0x0164('0x44')];if(_0x537ae3['query'][_0x0164('0x53')]){_0x3f1cb2['include']=[{'all':!![]}];}_0x3f1cb2=_[_0x0164('0x57')]({},_0x3f1cb2,_0x537ae3[_0x0164('0x58')]);return db[_0x0164('0x40')][_0x0164('0x59')](_0x3f1cb2)[_0x0164('0x20')](handleEntityNotFound(_0x33c673,null))['then'](respondWithResult(_0x33c673,null))[_0x0164('0x55')](handleError(_0x33c673,null));};exports['create']=function(_0x27cdc1,_0x6ac4df){return db['WhatsappAccount'][_0x0164('0x5a')](_0x27cdc1[_0x0164('0x5b')],{})[_0x0164('0x20')](function(_0x2599b0){var _0xc303e5=_0x27cdc1[_0x0164('0x5c')][_0x0164('0x35')]({'plain':!![]});if(!_0xc303e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc303e5[_0x0164('0x5d')]===_0x0164('0x5c')){var _0xf4f50c=_0x2599b0[_0x0164('0x35')]({'plain':!![]});var _0x22df67=_0x0164('0x36');return db[_0x0164('0x5e')][_0x0164('0x59')]({'where':{'name':_0x22df67,'userProfileId':_0xc303e5['userProfileId']},'raw':!![]})['then'](function(_0x190405){if(_0x190405&&_0x190405[_0x0164('0x5f')]===0x0){return db[_0x0164('0x37')]['create']({'name':_0xf4f50c[_0x0164('0x3b')],'resourceId':_0xf4f50c['id'],'type':_0x190405[_0x0164('0x3b')],'sectionId':_0x190405['id']},{})[_0x0164('0x20')](function(){return _0x2599b0;});}else{return _0x2599b0;}})[_0x0164('0x55')](function(_0x43008c){logger[_0x0164('0x26')](_0x0164('0x60'),_0x43008c);throw _0x43008c;});}return _0x2599b0;})[_0x0164('0x20')](respondWithResult(_0x6ac4df,0xc9))['catch'](handleError(_0x6ac4df,null));};exports[_0x0164('0x61')]=function(_0x3cb54a,_0x13e7e3){if(_0x3cb54a['body']['id']){delete _0x3cb54a['body']['id'];}return db[_0x0164('0x40')][_0x0164('0x59')]({'where':{'id':_0x3cb54a['params']['id']},'include':[{'model':db[_0x0164('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x0164('0x20')](handleEntityNotFound(_0x13e7e3,null))[_0x0164('0x20')](saveUpdates(_0x3cb54a[_0x0164('0x5b')],null))[_0x0164('0x20')](respondWithResult(_0x13e7e3,null))[_0x0164('0x55')](handleError(_0x13e7e3,null));};exports['destroy']=function(_0x304a8,_0x4fedd2){return db[_0x0164('0x40')]['find']({'where':{'id':_0x304a8['params']['id']}})[_0x0164('0x20')](handleEntityNotFound(_0x4fedd2,null))[_0x0164('0x20')](removeEntity(_0x4fedd2,null))[_0x0164('0x55')](handleError(_0x4fedd2,null));};exports[_0x0164('0x62')]=function(_0x387a61,_0x55234b){return db[_0x0164('0x40')][_0x0164('0x62')]()['then'](respondWithResult(_0x55234b,null))[_0x0164('0x55')](handleError(_0x55234b,null));};exports['addDisposition']=function(_0x279a5e,_0x5de3fe,_0x520826){if(_0x279a5e[_0x0164('0x5b')]['id']){delete _0x279a5e[_0x0164('0x5b')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x279a5e[_0x0164('0x63')]['id']}})['then'](handleEntityNotFound(_0x5de3fe,null))['then'](function(_0x30f4d1){if(_0x30f4d1){_0x279a5e['body'][_0x0164('0x64')]=_0x30f4d1['id'];return db[_0x0164('0x65')][_0x0164('0x5a')](_0x279a5e['body']);}})['then'](respondWithResult(_0x5de3fe,null))['catch'](handleError(_0x5de3fe,null));};exports[_0x0164('0x66')]=function(_0x26313b,_0x19fc54,_0x3ccaf9){var _0x415c11={'raw':![],'where':{}};var _0x26ca35={};var _0x1e0a17={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x0164('0x67')]({'where':{'id':_0x26313b[_0x0164('0x63')]['id']}})[_0x0164('0x20')](handleEntityNotFound(_0x19fc54,null))[_0x0164('0x20')](function(_0x99f097){if(_0x99f097){_0x26ca35[_0x0164('0x44')]=_['keys'](db[_0x0164('0x65')]['rawAttributes']);_0x26ca35['query']=_['keys'](_0x26313b['query']);_0x26ca35[_0x0164('0x47')]=_['intersection'](_0x26ca35[_0x0164('0x44')],_0x26ca35['query']);_0x415c11[_0x0164('0x49')]=_[_0x0164('0x48')](_0x26ca35['model'],qs['fields'](_0x26313b[_0x0164('0x45')][_0x0164('0x4a')]));_0x415c11['attributes']=_0x415c11['attributes'][_0x0164('0x4b')]?_0x415c11[_0x0164('0x49')]:_0x26ca35['model'];if(!_0x26313b[_0x0164('0x45')][_0x0164('0x4c')](_0x0164('0x4d'))){_0x415c11[_0x0164('0x30')]=qs[_0x0164('0x30')](_0x26313b[_0x0164('0x45')][_0x0164('0x30')]);_0x415c11['offset']=qs[_0x0164('0x2e')](_0x26313b['query'][_0x0164('0x2e')]);}_0x415c11[_0x0164('0x4e')]=qs['sort'](_0x26313b[_0x0164('0x45')][_0x0164('0x4f')]);_0x415c11['where']=qs[_0x0164('0x47')](_[_0x0164('0x50')](_0x26313b[_0x0164('0x45')],_0x26ca35['filters']));_0x415c11[_0x0164('0x52')][_0x0164('0x64')]=_0x99f097['id'];if(_0x26313b['query'][_0x0164('0x51')]){_0x415c11[_0x0164('0x52')]=_[_0x0164('0x57')](_0x415c11['where'],{'$or':_['map'](_0x415c11[_0x0164('0x49')],function(_0x3befc1){var _0x53f838={};_0x53f838[_0x3befc1]={'$like':'%'+_0x26313b[_0x0164('0x45')][_0x0164('0x51')]+'%'};return _0x53f838;})});}_0x415c11=_[_0x0164('0x57')]({},_0x415c11,_0x26313b[_0x0164('0x58')]);return db[_0x0164('0x65')][_0x0164('0x31')]({'where':_0x415c11[_0x0164('0x52')]})[_0x0164('0x20')](function(_0x1e5d86){_0x1e0a17['count']=_0x1e5d86;if(_0x26313b[_0x0164('0x45')]['includeAll']){_0x415c11[_0x0164('0x54')]=[{'all':!![]}];}return db[_0x0164('0x65')][_0x0164('0x68')](_0x415c11);})[_0x0164('0x20')](function(_0x5aa384){_0x1e0a17[_0x0164('0x69')]=_0x5aa384;return _0x1e0a17;});}})[_0x0164('0x20')](respondWithFilteredResult(_0x19fc54,_0x415c11))[_0x0164('0x55')](handleError(_0x19fc54,null));};exports[_0x0164('0x6a')]=function(_0x1c7306,_0x68833,_0x52f8d3){return db[_0x0164('0x40')]['find']({'where':{'id':_0x1c7306[_0x0164('0x63')]['id']}})[_0x0164('0x20')](handleEntityNotFound(_0x68833,null))['then'](function(_0x21ba20){if(_0x21ba20){return _0x21ba20[_0x0164('0x6a')](_0x1c7306['query']['ids']);}})['then'](respondWithStatusCode(_0x68833,null))[_0x0164('0x55')](handleError(_0x68833,null));};exports[_0x0164('0x6b')]=function(_0x4a3884,_0x22e138,_0x4c2554){if(_0x4a3884[_0x0164('0x5b')]['id']){delete _0x4a3884[_0x0164('0x5b')]['id'];}return db['WhatsappAccount'][_0x0164('0x59')]({'where':{'id':_0x4a3884['params']['id']}})[_0x0164('0x20')](handleEntityNotFound(_0x22e138,null))[_0x0164('0x20')](function(_0x311bc7){if(_0x311bc7){_0x4a3884[_0x0164('0x5b')][_0x0164('0x64')]=_0x311bc7['id'];return db[_0x0164('0x6c')][_0x0164('0x5a')](_0x4a3884[_0x0164('0x5b')]);}})[_0x0164('0x20')](respondWithResult(_0x22e138,null))[_0x0164('0x55')](handleError(_0x22e138,null));};exports[_0x0164('0x6d')]=function(_0x32b026,_0x5e69c4,_0x30be6a){var _0x5db563={'raw':![],'where':{}};var _0x10bf2e={};var _0x875aac={'count':0x0,'rows':[]};return db[_0x0164('0x40')][_0x0164('0x67')]({'where':{'id':_0x32b026[_0x0164('0x63')]['id']}})[_0x0164('0x20')](handleEntityNotFound(_0x5e69c4,null))[_0x0164('0x20')](function(_0x52300b){if(_0x52300b){_0x10bf2e[_0x0164('0x44')]=_[_0x0164('0x46')](db[_0x0164('0x6c')][_0x0164('0x41')]);_0x10bf2e[_0x0164('0x45')]=_[_0x0164('0x46')](_0x32b026[_0x0164('0x45')]);_0x10bf2e['filters']=_[_0x0164('0x48')](_0x10bf2e[_0x0164('0x44')],_0x10bf2e[_0x0164('0x45')]);_0x5db563[_0x0164('0x49')]=_[_0x0164('0x48')](_0x10bf2e['model'],qs['fields'](_0x32b026[_0x0164('0x45')][_0x0164('0x4a')]));_0x5db563['attributes']=_0x5db563[_0x0164('0x49')][_0x0164('0x4b')]?_0x5db563[_0x0164('0x49')]:_0x10bf2e[_0x0164('0x44')];if(!_0x32b026['query'][_0x0164('0x4c')](_0x0164('0x4d'))){_0x5db563[_0x0164('0x30')]=qs[_0x0164('0x30')](_0x32b026[_0x0164('0x45')]['limit']);_0x5db563[_0x0164('0x2e')]=qs[_0x0164('0x2e')](_0x32b026[_0x0164('0x45')][_0x0164('0x2e')]);}_0x5db563[_0x0164('0x4e')]=qs[_0x0164('0x4f')](_0x32b026[_0x0164('0x45')][_0x0164('0x4f')]);_0x5db563['where']=qs[_0x0164('0x47')](_[_0x0164('0x50')](_0x32b026[_0x0164('0x45')],_0x10bf2e[_0x0164('0x47')]));_0x5db563[_0x0164('0x52')][_0x0164('0x64')]=_0x52300b['id'];if(_0x32b026[_0x0164('0x45')][_0x0164('0x51')]){_0x5db563[_0x0164('0x52')]=_[_0x0164('0x57')](_0x5db563[_0x0164('0x52')],{'$or':_[_0x0164('0x3f')](_0x5db563['attributes'],function(_0x26e1fb){var _0x55ecde={};_0x55ecde[_0x26e1fb]={'$like':'%'+_0x32b026[_0x0164('0x45')][_0x0164('0x51')]+'%'};return _0x55ecde;})});}_0x5db563=_[_0x0164('0x57')]({},_0x5db563,_0x32b026[_0x0164('0x58')]);return db[_0x0164('0x6c')][_0x0164('0x31')]({'where':_0x5db563[_0x0164('0x52')]})[_0x0164('0x20')](function(_0x5e90ae){_0x875aac['count']=_0x5e90ae;if(_0x32b026[_0x0164('0x45')][_0x0164('0x53')]){_0x5db563[_0x0164('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0164('0x68')](_0x5db563);})[_0x0164('0x20')](function(_0x5de4c6){_0x875aac[_0x0164('0x69')]=_0x5de4c6;return _0x875aac;});}})['then'](respondWithFilteredResult(_0x5e69c4,_0x5db563))[_0x0164('0x55')](handleError(_0x5e69c4,null));};exports[_0x0164('0x6e')]=function(_0x37c2d3,_0x597dcc,_0x4ee110){return db['WhatsappAccount']['find']({'where':{'id':_0x37c2d3[_0x0164('0x63')]['id']}})[_0x0164('0x20')](handleEntityNotFound(_0x597dcc,null))[_0x0164('0x20')](function(_0x44e462){if(_0x44e462){return _0x44e462[_0x0164('0x6e')](_0x37c2d3[_0x0164('0x45')][_0x0164('0x6f')]);}})['then'](respondWithStatusCode(_0x597dcc,null))['catch'](handleError(_0x597dcc,null));};exports[_0x0164('0x70')]=function(_0xeff71e,_0x481dc8,_0x41da82){return db['WhatsappAccount'][_0x0164('0x59')]({'where':{'id':_0xeff71e['params']['id']}})[_0x0164('0x20')](handleEntityNotFound(_0x481dc8,null))[_0x0164('0x20')](function(_0xf3fe41){if(_0xf3fe41){return _0xf3fe41[_0x0164('0x70')](_0xeff71e[_0x0164('0x5b')]['ids'],_[_0x0164('0x71')](_0xeff71e['body'],['ids','id'])||{})[_0x0164('0x72')](function(_0x3f8c8d){for(var _0x444870=0x0;_0x444870<_0xeff71e[_0x0164('0x5b')][_0x0164('0x6f')][_0x0164('0x4b')];_0x444870+=0x1){socket[_0x0164('0x73')](_0x0164('0x74'),{'UserId':Number(_0xeff71e[_0x0164('0x5b')][_0x0164('0x6f')][_0x444870]),'WhatsappAccountId':Number(_0xeff71e['params']['id'])});}return _0x3f8c8d;});}})[_0x0164('0x20')](respondWithResult(_0x481dc8,null))[_0x0164('0x55')](handleError(_0x481dc8,null));};exports['removeAgents']=function(_0x465273,_0x3066ed,_0x57c278){return db['WhatsappAccount'][_0x0164('0x59')]({'where':{'id':_0x465273[_0x0164('0x63')]['id']}})['then'](handleEntityNotFound(_0x3066ed,null))[_0x0164('0x20')](function(_0x4fa2d2){if(_0x4fa2d2){return _0x4fa2d2[_0x0164('0x75')](_0x465273[_0x0164('0x45')][_0x0164('0x6f')])['then'](function(){if(_[_0x0164('0x76')](_0x465273[_0x0164('0x45')][_0x0164('0x6f')])){for(var _0x1b0254=0x0;_0x1b0254<_0x465273[_0x0164('0x45')]['ids'][_0x0164('0x4b')];_0x1b0254+=0x1){socket[_0x0164('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x465273['query'][_0x0164('0x6f')][_0x1b0254]),'WhatsappAccountId':Number(_0x465273['params']['id'])});}}else{socket[_0x0164('0x73')](_0x0164('0x77'),{'UserId':Number(_0x465273[_0x0164('0x45')]['ids']),'WhatsappAccountId':Number(_0x465273[_0x0164('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x3066ed,null))[_0x0164('0x55')](handleError(_0x3066ed,null));};exports[_0x0164('0x78')]=function(_0x40d587,_0x5af58e,_0x4a417a){var _0x4667d3={};var _0x298f1d={};var _0x264776;var _0x38ffc4;return db[_0x0164('0x40')][_0x0164('0x67')]({'where':{'id':_0x40d587['params']['id']}})['then'](handleEntityNotFound(_0x5af58e,null))[_0x0164('0x20')](function(_0x17e8eb){if(_0x17e8eb){_0x264776=_0x17e8eb;_0x298f1d[_0x0164('0x44')]=_['keys'](db[_0x0164('0x79')][_0x0164('0x41')]);_0x298f1d['query']=_[_0x0164('0x46')](_0x40d587[_0x0164('0x45')]);_0x298f1d['filters']=_['intersection'](_0x298f1d[_0x0164('0x44')],_0x298f1d['query']);_0x4667d3['attributes']=_['intersection'](_0x298f1d[_0x0164('0x44')],qs[_0x0164('0x4a')](_0x40d587[_0x0164('0x45')][_0x0164('0x4a')]));_0x4667d3['attributes']=_0x4667d3['attributes']['length']?_0x4667d3['attributes']:_0x298f1d[_0x0164('0x44')];_0x4667d3[_0x0164('0x4e')]=qs[_0x0164('0x4f')](_0x40d587[_0x0164('0x45')][_0x0164('0x4f')]);_0x4667d3[_0x0164('0x52')]=qs[_0x0164('0x47')](_[_0x0164('0x50')](_0x40d587[_0x0164('0x45')],_0x298f1d[_0x0164('0x47')]));if(_0x40d587[_0x0164('0x45')][_0x0164('0x51')]){_0x4667d3['where']=_['merge'](_0x4667d3[_0x0164('0x52')],{'$or':_[_0x0164('0x3f')](_0x4667d3[_0x0164('0x49')],function(_0xcad27a){var _0x252b2a={};_0x252b2a[_0xcad27a]={'$like':'%'+_0x40d587[_0x0164('0x45')]['filter']+'%'};return _0x252b2a;})});}_0x4667d3=_['merge']({},_0x4667d3,_0x40d587[_0x0164('0x58')]);return _0x264776['getAgents'](_0x4667d3);}})[_0x0164('0x20')](function(_0x1e0e3a){if(_0x1e0e3a){_0x38ffc4=_0x1e0e3a[_0x0164('0x4b')];if(!_0x40d587['query'][_0x0164('0x4c')](_0x0164('0x4d'))){_0x4667d3[_0x0164('0x30')]=qs[_0x0164('0x30')](_0x40d587[_0x0164('0x45')][_0x0164('0x30')]);_0x4667d3[_0x0164('0x2e')]=qs[_0x0164('0x2e')](_0x40d587[_0x0164('0x45')][_0x0164('0x2e')]);}return _0x264776[_0x0164('0x78')](_0x4667d3);}})[_0x0164('0x20')](function(_0x2511d3){if(_0x2511d3){return _0x2511d3?{'count':_0x38ffc4,'rows':_0x2511d3}:null;}})[_0x0164('0x20')](respondWithResult(_0x5af58e,null))[_0x0164('0x55')](handleError(_0x5af58e,null));};exports[_0x0164('0x7a')]=function(_0x67c8d2,_0x4a57ea){var _0x485c12=_0x67c8d2[_0x0164('0x63')]['id'];var _0x162ec0=_0x67c8d2[_0x0164('0x5b')];var _0x20c26a=0xc8;var _0xe069d9=null;return db[_0x0164('0x7b')][_0x0164('0x7c')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x0164('0x7d')]},function(_0x3bffed){return db['WhatsappAccount'][_0x0164('0x67')]({'where':{'id':_0x485c12},'transaction':_0x3bffed})[_0x0164('0x20')](function(_0x262963){if(_0x262963){return db[_0x0164('0x7e')][_0x0164('0x38')]({'where':{'WhatsappAccountId':_0x485c12},'transaction':_0x3bffed})[_0x0164('0x20')](function(){var _0x2712bc=_[_0x0164('0x3f')](_0x162ec0,function(_0x3d8f8b){_0x3d8f8b[_0x0164('0x64')]=_0x485c12;return _0x3d8f8b;});return db[_0x0164('0x7e')]['bulkCreate'](_0x2712bc,{'transaction':_0x3bffed});});}else{_0x20c26a=0x194;_0xe069d9=[];}});})[_0x0164('0x20')](function(){if(_0x20c26a!==0x194){return db[_0x0164('0x7e')][_0x0164('0x7f')]({'where':{'WhatsappAccountId':_0x485c12},'order':_0x0164('0x80')})['then'](function(_0x4c4fee){_0xe069d9=_0x4c4fee;});}})['catch'](function(_0x24a8a8){_0x20c26a=0x1f4;logger['error'](_0x24a8a8[_0x0164('0x3a')]);if(_0x24a8a8['name']){delete _0x24a8a8[_0x0164('0x3b')];}_0xe069d9=_0x24a8a8;})[_0x0164('0x81')](function(){if(_0xe069d9===null){_0x4a57ea[_0x0164('0x2b')](_0x20c26a);}else{if(_0x20c26a===0x1f4){_0x4a57ea[_0x0164('0x2c')](_0x20c26a)[_0x0164('0x82')](_0xe069d9);}else{_0x4a57ea[_0x0164('0x2c')](_0x20c26a)[_0x0164('0x2d')](_0xe069d9);}}});};exports[_0x0164('0x83')]=function(_0x186a98,_0xde2e,_0x3d1c92){var _0x39a71d={};var _0x2860b4={};var _0xc2a528;var _0xaaed5d;return db[_0x0164('0x40')][_0x0164('0x67')]({'where':{'id':_0x186a98['params']['id']}})[_0x0164('0x20')](handleEntityNotFound(_0xde2e,null))[_0x0164('0x20')](function(_0x3ace59){if(_0x3ace59){_0xc2a528=_0x3ace59;_0x2860b4[_0x0164('0x44')]=_['keys'](db[_0x0164('0x7e')][_0x0164('0x41')]);_0x2860b4[_0x0164('0x45')]=_['keys'](_0x186a98['query']);_0x2860b4['filters']=_[_0x0164('0x48')](_0x2860b4['model'],_0x2860b4['query']);_0x39a71d[_0x0164('0x49')]=_['intersection'](_0x2860b4[_0x0164('0x44')],qs[_0x0164('0x4a')](_0x186a98[_0x0164('0x45')][_0x0164('0x4a')]));_0x39a71d['attributes']=_0x39a71d['attributes'][_0x0164('0x4b')]?_0x39a71d[_0x0164('0x49')]:_0x2860b4[_0x0164('0x44')];_0x39a71d[_0x0164('0x4e')]=qs[_0x0164('0x4f')](_0x186a98[_0x0164('0x45')][_0x0164('0x4f')]);_0x39a71d[_0x0164('0x52')]=qs[_0x0164('0x47')](_[_0x0164('0x50')](_0x186a98[_0x0164('0x45')],_0x2860b4[_0x0164('0x47')]));if(_0x186a98['query'][_0x0164('0x51')]){_0x39a71d[_0x0164('0x52')]=_['merge'](_0x39a71d[_0x0164('0x52')],{'$or':_[_0x0164('0x3f')](_0x39a71d[_0x0164('0x49')],function(_0x1d1069){var _0x769ec0={};_0x769ec0[_0x1d1069]={'$like':'%'+_0x186a98['query'][_0x0164('0x51')]+'%'};return _0x769ec0;})});}_0x39a71d=_[_0x0164('0x57')]({},_0x39a71d,_0x186a98[_0x0164('0x58')]);return _0xc2a528[_0x0164('0x83')](_0x39a71d);}})[_0x0164('0x20')](function(_0x52ad7e){if(_0x52ad7e){_0xaaed5d=_0x52ad7e[_0x0164('0x4b')];if(!_0x186a98[_0x0164('0x45')][_0x0164('0x4c')]('nolimit')){_0x39a71d[_0x0164('0x30')]=qs[_0x0164('0x30')](_0x186a98[_0x0164('0x45')][_0x0164('0x30')]);_0x39a71d[_0x0164('0x2e')]=qs[_0x0164('0x2e')](_0x186a98['query']['offset']);}return _0xc2a528[_0x0164('0x83')](_0x39a71d);}})[_0x0164('0x20')](function(_0x5dd54c){if(_0x5dd54c){return _0x5dd54c?{'count':_0xaaed5d,'rows':_0x5dd54c}:null;}})[_0x0164('0x20')](respondWithResult(_0xde2e,null))['catch'](handleError(_0xde2e,null));};exports[_0x0164('0x84')]=function(_0x7840ff,_0x1de6d9,_0xf9124a){var _0x1311db={'channel':_0x0164('0x85')};var _0x2afafd=[];var _0x5eca2f=[];var _0x312ab4={};return db[_0x0164('0x40')][_0x0164('0x59')]({'where':{'id':_0x7840ff[_0x0164('0x63')]['id']},'include':[{'model':db[_0x0164('0x7e')],'as':_0x0164('0x86')}]})[_0x0164('0x20')](handleEntityNotFound(_0x1de6d9,null))['then'](function(_0x14be1d){_0x1311db[_0x0164('0x87')]=_0x14be1d;if(_0x1311db[_0x0164('0x87')]&&_0x1311db[_0x0164('0x87')][_0x0164('0x42')]==='sinch'&&_0x7840ff[_0x0164('0x5b')]['statuses']){if(_0x7840ff[_0x0164('0x5b')][_0x0164('0x88')][_0x0164('0x4b')]===0x0)return;if(_0x7840ff['body'][_0x0164('0x88')][0x0][_0x0164('0x89')]!==_0x0164('0x8a'))return;return db[_0x0164('0x8b')][_0x0164('0x61')]({'read':!![],'readAt':_0x7840ff[_0x0164('0x5b')][_0x0164('0x88')][0x0][_0x0164('0x8c')]},{'where':{'messageId':_0x7840ff[_0x0164('0x5b')][_0x0164('0x88')][0x0][_0x0164('0x8d')]},'individualHooks':!![]})['then'](function(_0x5a1c37){return _0x1de6d9[_0x0164('0x2c')](0xc8)[_0x0164('0x2d')](_0x5a1c37);});}_0x1311db['applications']=_['orderBy'](_0x14be1d[_0x0164('0x86')],['priority'],['asc']);if(_0x1311db[_0x0164('0x87')][_0x0164('0x86')]){delete _0x1311db[_0x0164('0x87')][_0x0164('0x86')];}return db[_0x0164('0x8e')]['describe']()['then'](function(_0x19ede3){if(!_0x19ede3){throw new db['Sequelize'][(_0x0164('0x8f'))](_0x0164('0x90'));}_0x2afafd=_[_0x0164('0x91')](_['keys'](_0x19ede3),['createdAt',_0x0164('0x92')]);_0x5eca2f=_[_0x0164('0x91')](_[_0x0164('0x46')](_0x19ede3),[_0x0164('0x93'),_0x0164('0x92'),_0x0164('0x94'),'ListId']);_0x1311db['body']={'mapKey':_0x0164('0x95')};if(_0x1311db[_0x0164('0x87')]&&_0x1311db[_0x0164('0x87')][_0x0164('0x42')]===_0x0164('0x96')){_0x1311db[_0x0164('0x5b')][_0x0164('0x97')]=_0x7840ff[_0x0164('0x5b')][_0x0164('0x98')]['replace'](_0x0164('0x99'),'');_0x1311db['body'][_0x0164('0x5b')]=_0x7840ff[_0x0164('0x5b')][_0x0164('0x9a')];_0x1311db[_0x0164('0x5b')][_0x0164('0x9b')]=_0x7840ff[_0x0164('0x5b')][_0x0164('0x9c')];}if(_0x1311db[_0x0164('0x87')]&&_0x1311db[_0x0164('0x87')]['type']===_0x0164('0x9d')){_0x1311db[_0x0164('0x5b')][_0x0164('0x97')]=_0x7840ff[_0x0164('0x5b')][_0x0164('0x9e')][0x0][_0x0164('0x97')];_0x1311db[_0x0164('0x5b')][_0x0164('0x5b')]=_0x7840ff[_0x0164('0x5b')][_0x0164('0x9e')][0x0][_0x0164('0x28')][_0x0164('0x5b')];_0x1311db[_0x0164('0x5b')][_0x0164('0x9b')]=_0x7840ff[_0x0164('0x5b')][_0x0164('0x9e')][0x0][_0x0164('0x8d')];}if(_0x1311db[_0x0164('0x5b')]['id']){delete _0x1311db[_0x0164('0x5b')]['id'];}if(_[_0x0164('0x9f')](_0x1311db[_0x0164('0x5b')][_0x0164('0x97')])){throw new db[(_0x0164('0xa0'))]['ValidationError'](_0x0164('0xa1'));}if(_[_0x0164('0x9f')](_0x1311db[_0x0164('0x5b')][_0x0164('0x5b')])||_0x1311db[_0x0164('0x5b')][_0x0164('0x5b')]===''){throw new db[(_0x0164('0xa0'))][(_0x0164('0x8f'))](_0x0164('0xa2'));}if(_[_0x0164('0x9f')](_0x1311db[_0x0164('0x5b')][_0x0164('0xa3')])){throw new db[(_0x0164('0xa0'))][(_0x0164('0x8f'))](_0x0164('0xa4')+_0x5eca2f);}if(!_[_0x0164('0xa5')](_0x5eca2f,_0x1311db['body'][_0x0164('0xa3')])){throw new db[(_0x0164('0xa0'))][(_0x0164('0x8f'))](_0x0164('0xa6')+_0x5eca2f);}_0x312ab4[_0x1311db['body'][_0x0164('0xa3')]]=_0x1311db[_0x0164('0x5b')][_0x0164('0x97')];return db[_0x0164('0xa7')][_0x0164('0x59')]({'where':{'id':_0x1311db['account'][_0x0164('0xa8')]},'include':[{'model':db[_0x0164('0x8e')],'as':_0x0164('0xa9'),'where':_0x312ab4,'limit':0x1,'order':[['updatedAt',_0x0164('0xaa')]]}]});})[_0x0164('0x20')](handleEntityNotFound(_0x1de6d9,null))['then'](function(_0x20806a){if(_0x20806a){_0x1311db[_0x0164('0xab')]=_['omit'](_0x20806a,[_0x0164('0xa9')]);if(_0x20806a[_0x0164('0xa9')]['length']){return _0x20806a['Contacts'][0x0];}var _0x5f1ea5=_[_0x0164('0x18')](_0x1311db[_0x0164('0x5b')],{'firstName':_0x1311db['body'][_0x0164('0x97')],'ListId':_0x20806a['id']});_0x5f1ea5[_0x1311db[_0x0164('0x5b')]['mapKey']]=_0x1311db[_0x0164('0x5b')][_0x0164('0x97')];return db['CmContact'][_0x0164('0x5a')](_0x5f1ea5,{'fields':_0x2afafd,'raw':!![]});}})['then'](handleEntityNotFound(_0x1de6d9,null))[_0x0164('0x20')](function(_0x5d395a){if(_0x5d395a){_0x1311db[_0x0164('0xac')]=_0x5d395a;var _0x138b85={'ContactId':_0x5d395a['id'],'phone':_0x1311db[_0x0164('0x5b')][_0x0164('0x97')],'WhatsappAccountId':_0x7840ff[_0x0164('0x63')]['id']};var _0x37b5aa={'ContactId':_0x5d395a['id'],'WhatsappAccountId':_0x7840ff[_0x0164('0x63')]['id'],'closed':![]};return db[_0x0164('0xad')]['find']({'where':_0x37b5aa})[_0x0164('0x20')](function(_0x32b5e3){if(_0x32b5e3){return[_0x32b5e3,![]];}return db[_0x0164('0xad')][_0x0164('0x5a')](_0x138b85)[_0x0164('0x20')](function(_0xf13c12){return[_0xf13c12,!![]];});});}})['spread'](function(_0x3ba59d,_0x20af9b){_0x1311db[_0x0164('0xae')]=_0x3ba59d[_0x0164('0x35')]({'plain':!![]});_0x1311db['interaction']['created']=![];if(_0x20af9b){if(_0x1311db[_0x0164('0x87')]['autoclose']){_0x1311db[_0x0164('0xaf')][_0x0164('0xb0')]({'id':0x0,'priority':_0x1311db[_0x0164('0xaf')][_0x0164('0x4b')]+0x1,'app':_0x0164('0xb1'),'appdata':_0x0164('0xb2'),'interval':_0x0164('0xb3')});}_0x1311db[_0x0164('0xae')][_0x0164('0xb4')]=!![];}return db[_0x0164('0x8b')]['create']({'phone':_0x1311db[_0x0164('0x5b')][_0x0164('0x97')],'messageId':_0x1311db[_0x0164('0x5b')][_0x0164('0x9b')],'body':_0x1311db[_0x0164('0x5b')][_0x0164('0x5b')],'WhatsappAccountId':_0x7840ff[_0x0164('0x63')]['id'],'WhatsappInteractionId':_0x3ba59d['id'],'direction':'in','ContactId':_0x3ba59d[_0x0164('0xb5')],'AttachmentId':_0x1311db['body'][_0x0164('0xb6')]});})['then'](function(_0x132669){_0x1311db['message']=_0x132669;if(_0x1311db[_0x0164('0xae')][_0x0164('0xb7')]){return db[_0x0164('0x79')]['find']({'attributes':['id',_0x0164('0x3b')],'where':{'id':_0x1311db[_0x0164('0xae')][_0x0164('0xb7')]}})['then'](function(_0x536426){if(_0x536426){_0x1311db[_0x0164('0xaf')][_0x0164('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x536426[_0x0164('0x3b')]+','+(_0x1311db[_0x0164('0x87')][_0x0164('0xb9')]||0xa),'interval':_0x0164('0xb3')});}return respondWithRpcPromise(_0x0164('0xba'),_0x0164('0xbb'),_0x1311db);});}return respondWithRpcPromise('Start','startRouting',_0x1311db);})[_0x0164('0x20')](function(_0x3c6eb9){if(_0x3c6eb9){var _0x48fb06=0xc8;var _0x31bc6f=_0x0164('0xbc');logger[_0x0164('0x21')](_0x0164('0x24'),_0x31bc6f,_0x48fb06,'entity\x20found');logger[_0x0164('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x31bc6f,_0x48fb06,'entity\x20found',JSON['stringify'](_0x3c6eb9));if(_0x1311db[_0x0164('0x87')][_0x0164('0x42')]==='twilio'){return _0x1de6d9[_0x0164('0x2c')](_0x48fb06)[_0x0164('0x32')](_0x0164('0xbd'),_0x0164('0xbe'))[_0x0164('0x82')](_0x0164('0xbf'));}else{return _0x1de6d9[_0x0164('0x2c')](_0x48fb06)['json'](_0x3c6eb9);}}});})[_0x0164('0x55')](handleError(_0x1de6d9,null));};exports['send']=function(_0x10346b,_0x20f385,_0x58ee02){var _0xa52319,_0x33c374,_0x2a4cc0;if(_[_0x0164('0x9f')](_0x10346b[_0x0164('0x5b')][_0x0164('0x5b')])||_0x10346b[_0x0164('0x5b')][_0x0164('0x5b')]===''){throw new db[(_0x0164('0xa0'))][(_0x0164('0x8f'))](_0x0164('0xa2'));}if(_[_0x0164('0x9f')](_0x10346b['body']['to'])){throw new db[(_0x0164('0xa0'))][(_0x0164('0x8f'))](_0x0164('0xc0'));}_0xa52319=_0x10346b[_0x0164('0x5b')]['to'];return db[_0x0164('0x40')][_0x0164('0x59')]({'where':{'id':_0x10346b[_0x0164('0x63')]['id']},'include':[{'model':db[_0x0164('0xa7')],'as':_0x0164('0xc1'),'include':[{'model':db[_0x0164('0x8e')],'as':_0x0164('0xa9'),'where':{'mobile':_0xa52319},'limit':0x1,'order':[[_0x0164('0x92'),_0x0164('0xaa')]]}]}]})[_0x0164('0x20')](handleEntityNotFound(_0x20f385,null))['then'](function(_0x29f4c9){if(_0x29f4c9&&_0x29f4c9[_0x0164('0xc1')]){_0x33c374=_0x29f4c9[_0x0164('0x35')]({'plain':!![]});if(_0x33c374[_0x0164('0xc1')]&&_0x33c374[_0x0164('0xc1')][_0x0164('0xa9')][_0x0164('0x4b')]){return _0x33c374[_0x0164('0xc1')][_0x0164('0xa9')][0x0];}return db[_0x0164('0x8e')][_0x0164('0x5a')](_['defaults'](_0x10346b[_0x0164('0x5b')],{'firstName':_0xa52319,'mobile':_0xa52319,'phone':_0xa52319,'ListId':_0x33c374['ListId']}));}})[_0x0164('0x20')](handleEntityNotFound(_0x20f385,null))[_0x0164('0x20')](function(_0xb63b98){if(_0xb63b98){_0x2a4cc0=_0xb63b98;return db[_0x0164('0xad')]['find']({'where':{'ContactId':_0x2a4cc0['id'],'closed':![],'WhatsappAccountId':_0x33c374['id']}})[_0x0164('0x20')](function(_0x5d1e66){if(_0x5d1e66){return[_0x5d1e66,![]];}return db['WhatsappInteraction'][_0x0164('0x5a')]({'UserId':_0x10346b[_0x0164('0x5c')]['id'],'ContactId':_0x2a4cc0['id'],'WhatsappAccountId':_0x33c374['id'],'phone':_0xa52319,'firstMsgDirection':'out','Messages':[_[_0x0164('0x57')](_0x10346b[_0x0164('0x5b')],{'read':![],'body':_0x10346b[_0x0164('0x5b')][_0x0164('0x5b')],'phone':_0xa52319,'WhatsappAccountId':_0x33c374['id'],'UserId':_0x10346b[_0x0164('0x5c')]['id'],'ContactId':_0x2a4cc0['id']})]},{'include':[{'model':db[_0x0164('0x8b')],'as':_0x0164('0xc2')}]})[_0x0164('0x20')](function(_0x1fe153){return[_0x1fe153,!![]];});});}})[_0x0164('0x72')](function(_0x20e632,_0x458790){if(_0x458790){return _0x20e632;}return db[_0x0164('0x8b')]['create'](_['merge'](_0x10346b[_0x0164('0x5b')],{'read':![],'body':_0x10346b[_0x0164('0x5b')][_0x0164('0x5b')],'phone':_0xa52319,'WhatsappAccountId':_0x33c374['id'],'WhatsappInteractionId':_0x20e632['id'],'UserId':_0x10346b[_0x0164('0x5c')]['id'],'ContactId':_0x2a4cc0['id']}))[_0x0164('0x20')](function(_0x22c4bc){_0x20e632['dataValues'][_0x0164('0xc2')]=[];_0x20e632[_0x0164('0xc3')]['Messages'][_0x0164('0xb0')](_0x22c4bc['dataValues']);return _0x20e632;});})[_0x0164('0x20')](respondWithResult(_0x20f385,null))[_0x0164('0x55')](handleError(_0x20f385,null));}; \ No newline at end of file +var _0xe330=['createdAt','updatedAt','ListId','mobile','from','replace','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','mapKey','CmList','DESC','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','UserId','unshift','waitForTheAssignedAgent','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','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','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','request','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','length','model','hasOwnProperty','order','where','filter','merge','VIRTUAL','WhatsappAccount','includeAll','findAll','rows','show','params','mandatoryDispositionPause','keys','fields','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappAccounts','userProfileId','autoAssociation','find','Pause','addDisposition','Disposition','getDispositions','findOne','nolimit','sort','pick','WhatsappAccountId','removeDispositions','ids','CannedAnswer','getAnswers','options','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0xe330,0xe5));var _0x0e33=function(_0x41094d,_0x4ca21d){_0x41094d=_0x41094d-0x0;var _0x503ee1=_0xe330[_0x41094d];return _0x503ee1;};'use strict';var emlformat=require(_0x0e33('0x0'));var rimraf=require(_0x0e33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e33('0x2'));var rp=require(_0x0e33('0x3'));var moment=require(_0x0e33('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e33('0x5'));var util=require(_0x0e33('0x6'));var path=require(_0x0e33('0x7'));var sox=require(_0x0e33('0x8'));var csv=require(_0x0e33('0x9'));var ejs=require(_0x0e33('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e33('0xb'));var squel=require(_0x0e33('0xc'));var crypto=require(_0x0e33('0xd'));var jsforce=require(_0x0e33('0xe'));var deskjs=require(_0x0e33('0xf'));var toCsv=require(_0x0e33('0x9'));var querystring=require(_0x0e33('0x10'));var Papa=require(_0x0e33('0x11'));var Redis=require(_0x0e33('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0e33('0x13'));var as=require(_0x0e33('0x14'));var hardwareService=require(_0x0e33('0x15'));var logger=require(_0x0e33('0x16'))('api');var utils=require(_0x0e33('0x17'));var config=require(_0x0e33('0x18'));var licenseUtil=require(_0x0e33('0x19'));var db=require(_0x0e33('0x1a'))['db'];config[_0x0e33('0x1b')]=_[_0x0e33('0x1c')](config[_0x0e33('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e33('0x1d'))(new Redis(config[_0x0e33('0x1b')]));require(_0x0e33('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x468546,_0x5793ab,_0x3b1ac6,_0x1163a2){return new BPromise(function(_0x68eb24,_0x3c9174){var _0x650ebc=_0x1163a2||client;return _0x650ebc[_0x0e33('0x1f')](_0x468546,_0x3b1ac6)['then'](function(_0x1b06c1){logger[_0x0e33('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x5793ab,_0x0e33('0x21'));logger[_0x0e33('0x22')](_0x0e33('0x23'),_0x5793ab,_0x0e33('0x21'),JSON[_0x0e33('0x24')](_0x1b06c1));if(_0x1b06c1[_0x0e33('0x25')]){if(_0x1b06c1[_0x0e33('0x25')][_0x0e33('0x26')]===0x1f4){logger[_0x0e33('0x25')](_0x0e33('0x27'),_0x5793ab,_0x1b06c1[_0x0e33('0x25')][_0x0e33('0x28')]);return _0x3c9174(_0x1b06c1[_0x0e33('0x25')][_0x0e33('0x28')]);}logger[_0x0e33('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x5793ab,_0x1b06c1[_0x0e33('0x25')][_0x0e33('0x28')]);return _0x68eb24(_0x1b06c1['error']['message']);}else{logger[_0x0e33('0x20')](_0x0e33('0x27'),_0x5793ab,_0x0e33('0x21'));_0x68eb24(_0x1b06c1[_0x0e33('0x29')][_0x0e33('0x28')]);}})[_0x0e33('0x2a')](function(_0x3b4ce1){logger[_0x0e33('0x25')](_0x0e33('0x27'),_0x5793ab,_0x3b4ce1);_0x3c9174(_0x3b4ce1);});});}function respondWithStatusCode(_0x38a1fb,_0x4e5fc4){_0x4e5fc4=_0x4e5fc4||0xcc;return function(_0x13514c){if(_0x13514c){return _0x38a1fb[_0x0e33('0x2b')](_0x4e5fc4);}return _0x38a1fb[_0x0e33('0x2c')](_0x4e5fc4)[_0x0e33('0x2d')]();};}function respondWithResult(_0x3ba3e7,_0x8a088){_0x8a088=_0x8a088||0xc8;return function(_0x5c7ec6){if(_0x5c7ec6){return _0x3ba3e7['status'](_0x8a088)[_0x0e33('0x2e')](_0x5c7ec6);}};}function respondWithFilteredResult(_0x5536c3,_0x506660){return function(_0x557e68){if(_0x557e68){var _0x5cf5db=typeof _0x506660[_0x0e33('0x2f')]==='undefined'&&typeof _0x506660[_0x0e33('0x30')]===_0x0e33('0x31');var _0x47b132=_0x557e68[_0x0e33('0x32')];var _0xfd7736=_0x5cf5db?0x0:_0x506660[_0x0e33('0x2f')];var _0x48a075=_0x5cf5db?_0x557e68[_0x0e33('0x32')]:_0x506660[_0x0e33('0x2f')]+_0x506660['limit'];var _0x5f1c7a;if(_0x48a075>=_0x47b132){_0x48a075=_0x47b132;_0x5f1c7a=0xc8;}else{_0x5f1c7a=0xce;}_0x5536c3[_0x0e33('0x2c')](_0x5f1c7a);return _0x5536c3[_0x0e33('0x33')](_0x0e33('0x34'),_0xfd7736+'-'+_0x48a075+'/'+_0x47b132)[_0x0e33('0x2e')](_0x557e68);}return null;};}function patchUpdates(_0x3814bb){return function(_0x396649){try{jsonpatch[_0x0e33('0x35')](_0x396649,_0x3814bb,!![]);}catch(_0x124b11){return BPromise[_0x0e33('0x36')](_0x124b11);}return _0x396649[_0x0e33('0x37')]();};}function saveUpdates(_0x9550b5,_0xbae2c3){return function(_0x5ceec4){if(_0x5ceec4){return _0x5ceec4[_0x0e33('0x38')](_0x9550b5)['then'](function(_0x4c70f9){return _0x4c70f9;});}return null;};}function removeEntity(_0x28af73,_0x256fbd){return function(_0x1e4fba){if(_0x1e4fba){return _0x1e4fba[_0x0e33('0x39')]()[_0x0e33('0x3a')](function(){var _0xff11f3=_0x1e4fba[_0x0e33('0x3b')]({'plain':!![]});var _0x4afbbb='WhatsappAccounts';return db[_0x0e33('0x3c')]['destroy']({'where':{'type':_0x4afbbb,'resourceId':_0xff11f3['id']}})[_0x0e33('0x3a')](function(){return _0x1e4fba;});})[_0x0e33('0x3a')](function(){_0x28af73[_0x0e33('0x2c')](0xcc)[_0x0e33('0x2d')]();});}};}function handleEntityNotFound(_0x56c77b,_0x1eeaea){return function(_0x3f8d59){if(!_0x3f8d59){_0x56c77b[_0x0e33('0x2b')](0x194);}return _0x3f8d59;};}function handleError(_0x1f48c7,_0x25f6d5){_0x25f6d5=_0x25f6d5||0x1f4;return function(_0x426779){logger[_0x0e33('0x25')](_0x426779[_0x0e33('0x3d')]);if(_0x426779[_0x0e33('0x3e')]){delete _0x426779[_0x0e33('0x3e')];}_0x1f48c7[_0x0e33('0x2c')](_0x25f6d5)[_0x0e33('0x3f')](_0x426779);};}exports[_0x0e33('0x40')]=function(_0x3c6118,_0x3d4976){var _0x2a1e96={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4129b5={},_0x5495f8={'count':0x0,'rows':[]};var _0x1a70b7=_[_0x0e33('0x41')](db['WhatsappAccount'][_0x0e33('0x42')],function(_0x1e5d45){return{'name':_0x1e5d45[_0x0e33('0x43')],'type':_0x1e5d45[_0x0e33('0x44')][_0x0e33('0x45')]};});_0x4129b5['model']=_[_0x0e33('0x41')](_0x1a70b7,_0x0e33('0x3e'));_0x4129b5['query']=_['keys'](_0x3c6118[_0x0e33('0x46')]);_0x4129b5[_0x0e33('0x47')]=_[_0x0e33('0x48')](_0x4129b5['model'],_0x4129b5['query']);_0x2a1e96['attributes']=_[_0x0e33('0x48')](_0x4129b5['model'],qs['fields'](_0x3c6118[_0x0e33('0x46')]['fields']));_0x2a1e96[_0x0e33('0x49')]=_0x2a1e96[_0x0e33('0x49')][_0x0e33('0x4a')]?_0x2a1e96[_0x0e33('0x49')]:_0x4129b5[_0x0e33('0x4b')];if(!_0x3c6118[_0x0e33('0x46')][_0x0e33('0x4c')]('nolimit')){_0x2a1e96[_0x0e33('0x30')]=qs[_0x0e33('0x30')](_0x3c6118[_0x0e33('0x46')][_0x0e33('0x30')]);_0x2a1e96['offset']=qs['offset'](_0x3c6118['query'][_0x0e33('0x2f')]);}_0x2a1e96[_0x0e33('0x4d')]=qs['sort'](_0x3c6118[_0x0e33('0x46')]['sort']);_0x2a1e96[_0x0e33('0x4e')]=qs[_0x0e33('0x47')](_['pick'](_0x3c6118[_0x0e33('0x46')],_0x4129b5[_0x0e33('0x47')]),_0x1a70b7);if(_0x3c6118['query'][_0x0e33('0x4f')]){_0x2a1e96['where']=_[_0x0e33('0x50')](_0x2a1e96[_0x0e33('0x4e')],{'$or':_[_0x0e33('0x41')](_0x1a70b7,function(_0x14377c){if(_0x14377c[_0x0e33('0x44')]!==_0x0e33('0x51')){var _0x4d979a={};_0x4d979a[_0x14377c['name']]={'$like':'%'+_0x3c6118['query'][_0x0e33('0x4f')]+'%'};return _0x4d979a;}})});}_0x2a1e96=_[_0x0e33('0x50')]({},_0x2a1e96,_0x3c6118['options']);var _0x1ef9cd={'where':_0x2a1e96['where']};return db[_0x0e33('0x52')][_0x0e33('0x32')](_0x1ef9cd)['then'](function(_0x27fb4d){_0x5495f8[_0x0e33('0x32')]=_0x27fb4d;if(_0x3c6118[_0x0e33('0x46')][_0x0e33('0x53')]){_0x2a1e96['include']=[{'all':!![]}];}return db[_0x0e33('0x52')][_0x0e33('0x54')](_0x2a1e96);})['then'](function(_0x268197){_0x5495f8[_0x0e33('0x55')]=_0x268197;return _0x5495f8;})[_0x0e33('0x3a')](respondWithFilteredResult(_0x3d4976,_0x2a1e96))[_0x0e33('0x2a')](handleError(_0x3d4976,null));};exports[_0x0e33('0x56')]=function(_0x294d61,_0x3e5ca7){var _0x20f49a={'raw':![],'where':{'id':_0x294d61[_0x0e33('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x0e33('0x58')}]},_0x28fb45={};_0x28fb45[_0x0e33('0x4b')]=_[_0x0e33('0x59')](db[_0x0e33('0x52')][_0x0e33('0x42')]);_0x28fb45[_0x0e33('0x46')]=_[_0x0e33('0x59')](_0x294d61[_0x0e33('0x46')]);_0x28fb45['filters']=_[_0x0e33('0x48')](_0x28fb45['model'],_0x28fb45['query']);_0x20f49a[_0x0e33('0x49')]=_[_0x0e33('0x48')](_0x28fb45[_0x0e33('0x4b')],qs['fields'](_0x294d61['query'][_0x0e33('0x5a')]));_0x20f49a[_0x0e33('0x49')]=_0x20f49a[_0x0e33('0x49')][_0x0e33('0x4a')]?_0x20f49a[_0x0e33('0x49')]:_0x28fb45['model'];if(_0x294d61[_0x0e33('0x46')]['includeAll']){_0x20f49a[_0x0e33('0x5b')]=[{'all':!![]}];}_0x20f49a=_['merge']({},_0x20f49a,_0x294d61['options']);return db[_0x0e33('0x52')]['find'](_0x20f49a)[_0x0e33('0x3a')](handleEntityNotFound(_0x3e5ca7,null))[_0x0e33('0x3a')](respondWithResult(_0x3e5ca7,null))[_0x0e33('0x2a')](handleError(_0x3e5ca7,null));};exports[_0x0e33('0x5c')]=function(_0x4c9fdc,_0x5ccca0){return db['WhatsappAccount'][_0x0e33('0x5c')](_0x4c9fdc[_0x0e33('0x5d')],{})[_0x0e33('0x3a')](function(_0x4bf088){var _0x16a8fb=_0x4c9fdc[_0x0e33('0x5e')]['get']({'plain':!![]});if(!_0x16a8fb)throw new Error(_0x0e33('0x5f'));if(_0x16a8fb['role']==='user'){var _0x57c94d=_0x4bf088[_0x0e33('0x3b')]({'plain':!![]});var _0x9e0763=_0x0e33('0x60');return db['UserProfileSection']['find']({'where':{'name':_0x9e0763,'userProfileId':_0x16a8fb[_0x0e33('0x61')]},'raw':!![]})['then'](function(_0x57a791){if(_0x57a791&&_0x57a791[_0x0e33('0x62')]===0x0){return db[_0x0e33('0x3c')][_0x0e33('0x5c')]({'name':_0x57c94d[_0x0e33('0x3e')],'resourceId':_0x57c94d['id'],'type':_0x57a791['name'],'sectionId':_0x57a791['id']},{})['then'](function(){return _0x4bf088;});}else{return _0x4bf088;}})[_0x0e33('0x2a')](function(_0x314abc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x314abc);throw _0x314abc;});}return _0x4bf088;})['then'](respondWithResult(_0x5ccca0,0xc9))[_0x0e33('0x2a')](handleError(_0x5ccca0,null));};exports[_0x0e33('0x38')]=function(_0x3bf803,_0x2c4924){if(_0x3bf803['body']['id']){delete _0x3bf803[_0x0e33('0x5d')]['id'];}return db[_0x0e33('0x52')][_0x0e33('0x63')]({'where':{'id':_0x3bf803[_0x0e33('0x57')]['id']},'include':[{'model':db[_0x0e33('0x64')],'as':_0x0e33('0x58')}]})[_0x0e33('0x3a')](handleEntityNotFound(_0x2c4924,null))[_0x0e33('0x3a')](saveUpdates(_0x3bf803[_0x0e33('0x5d')],null))['then'](respondWithResult(_0x2c4924,null))['catch'](handleError(_0x2c4924,null));};exports[_0x0e33('0x39')]=function(_0x2792a1,_0x1f6876){return db['WhatsappAccount']['find']({'where':{'id':_0x2792a1[_0x0e33('0x57')]['id']}})[_0x0e33('0x3a')](handleEntityNotFound(_0x1f6876,null))[_0x0e33('0x3a')](removeEntity(_0x1f6876,null))[_0x0e33('0x2a')](handleError(_0x1f6876,null));};exports['describe']=function(_0x5c45be,_0x211776){return db['WhatsappAccount']['describe']()[_0x0e33('0x3a')](respondWithResult(_0x211776,null))[_0x0e33('0x2a')](handleError(_0x211776,null));};exports[_0x0e33('0x65')]=function(_0x4f9c49,_0x173baa,_0x2088ed){if(_0x4f9c49['body']['id']){delete _0x4f9c49[_0x0e33('0x5d')]['id'];}return db[_0x0e33('0x52')]['find']({'where':{'id':_0x4f9c49[_0x0e33('0x57')]['id']}})[_0x0e33('0x3a')](handleEntityNotFound(_0x173baa,null))['then'](function(_0x5a7368){if(_0x5a7368){_0x4f9c49['body']['WhatsappAccountId']=_0x5a7368['id'];return db[_0x0e33('0x66')]['create'](_0x4f9c49[_0x0e33('0x5d')]);}})['then'](respondWithResult(_0x173baa,null))[_0x0e33('0x2a')](handleError(_0x173baa,null));};exports[_0x0e33('0x67')]=function(_0x34c3c3,_0x2afac4,_0x16c2e4){var _0x1f4911={'raw':![],'where':{}};var _0x35f426={};var _0x1f82de={'count':0x0,'rows':[]};return db[_0x0e33('0x52')][_0x0e33('0x68')]({'where':{'id':_0x34c3c3[_0x0e33('0x57')]['id']}})[_0x0e33('0x3a')](handleEntityNotFound(_0x2afac4,null))[_0x0e33('0x3a')](function(_0x2ea6a4){if(_0x2ea6a4){_0x35f426['model']=_[_0x0e33('0x59')](db['Disposition']['rawAttributes']);_0x35f426[_0x0e33('0x46')]=_[_0x0e33('0x59')](_0x34c3c3[_0x0e33('0x46')]);_0x35f426['filters']=_[_0x0e33('0x48')](_0x35f426['model'],_0x35f426['query']);_0x1f4911[_0x0e33('0x49')]=_['intersection'](_0x35f426[_0x0e33('0x4b')],qs[_0x0e33('0x5a')](_0x34c3c3[_0x0e33('0x46')][_0x0e33('0x5a')]));_0x1f4911['attributes']=_0x1f4911['attributes'][_0x0e33('0x4a')]?_0x1f4911['attributes']:_0x35f426[_0x0e33('0x4b')];if(!_0x34c3c3['query'][_0x0e33('0x4c')](_0x0e33('0x69'))){_0x1f4911[_0x0e33('0x30')]=qs['limit'](_0x34c3c3[_0x0e33('0x46')][_0x0e33('0x30')]);_0x1f4911[_0x0e33('0x2f')]=qs[_0x0e33('0x2f')](_0x34c3c3[_0x0e33('0x46')][_0x0e33('0x2f')]);}_0x1f4911[_0x0e33('0x4d')]=qs[_0x0e33('0x6a')](_0x34c3c3[_0x0e33('0x46')][_0x0e33('0x6a')]);_0x1f4911[_0x0e33('0x4e')]=qs[_0x0e33('0x47')](_[_0x0e33('0x6b')](_0x34c3c3[_0x0e33('0x46')],_0x35f426[_0x0e33('0x47')]));_0x1f4911[_0x0e33('0x4e')][_0x0e33('0x6c')]=_0x2ea6a4['id'];if(_0x34c3c3[_0x0e33('0x46')][_0x0e33('0x4f')]){_0x1f4911[_0x0e33('0x4e')]=_['merge'](_0x1f4911[_0x0e33('0x4e')],{'$or':_['map'](_0x1f4911[_0x0e33('0x49')],function(_0x3b8eae){var _0x4425cd={};_0x4425cd[_0x3b8eae]={'$like':'%'+_0x34c3c3[_0x0e33('0x46')][_0x0e33('0x4f')]+'%'};return _0x4425cd;})});}_0x1f4911=_['merge']({},_0x1f4911,_0x34c3c3['options']);return db['Disposition'][_0x0e33('0x32')]({'where':_0x1f4911['where']})[_0x0e33('0x3a')](function(_0x16c896){_0x1f82de[_0x0e33('0x32')]=_0x16c896;if(_0x34c3c3[_0x0e33('0x46')][_0x0e33('0x53')]){_0x1f4911[_0x0e33('0x5b')]=[{'all':!![]}];}return db[_0x0e33('0x66')][_0x0e33('0x54')](_0x1f4911);})[_0x0e33('0x3a')](function(_0x22260a){_0x1f82de[_0x0e33('0x55')]=_0x22260a;return _0x1f82de;});}})['then'](respondWithFilteredResult(_0x2afac4,_0x1f4911))[_0x0e33('0x2a')](handleError(_0x2afac4,null));};exports[_0x0e33('0x6d')]=function(_0x249c6f,_0xb0ba2e,_0x187899){return db[_0x0e33('0x52')][_0x0e33('0x63')]({'where':{'id':_0x249c6f['params']['id']}})['then'](handleEntityNotFound(_0xb0ba2e,null))['then'](function(_0x5141cd){if(_0x5141cd){return _0x5141cd[_0x0e33('0x6d')](_0x249c6f['query'][_0x0e33('0x6e')]);}})[_0x0e33('0x3a')](respondWithStatusCode(_0xb0ba2e,null))['catch'](handleError(_0xb0ba2e,null));};exports['addAnswer']=function(_0xaaa0f4,_0x25182a,_0x4d4227){if(_0xaaa0f4[_0x0e33('0x5d')]['id']){delete _0xaaa0f4[_0x0e33('0x5d')]['id'];}return db['WhatsappAccount'][_0x0e33('0x63')]({'where':{'id':_0xaaa0f4[_0x0e33('0x57')]['id']}})[_0x0e33('0x3a')](handleEntityNotFound(_0x25182a,null))[_0x0e33('0x3a')](function(_0x45cf23){if(_0x45cf23){_0xaaa0f4[_0x0e33('0x5d')][_0x0e33('0x6c')]=_0x45cf23['id'];return db[_0x0e33('0x6f')][_0x0e33('0x5c')](_0xaaa0f4['body']);}})[_0x0e33('0x3a')](respondWithResult(_0x25182a,null))['catch'](handleError(_0x25182a,null));};exports[_0x0e33('0x70')]=function(_0x1c9c87,_0x2ca216,_0x4d91ba){var _0x5529e5={'raw':![],'where':{}};var _0x499e7b={};var _0x2d4a27={'count':0x0,'rows':[]};return db[_0x0e33('0x52')][_0x0e33('0x68')]({'where':{'id':_0x1c9c87[_0x0e33('0x57')]['id']}})[_0x0e33('0x3a')](handleEntityNotFound(_0x2ca216,null))[_0x0e33('0x3a')](function(_0x52daf6){if(_0x52daf6){_0x499e7b[_0x0e33('0x4b')]=_['keys'](db['CannedAnswer'][_0x0e33('0x42')]);_0x499e7b[_0x0e33('0x46')]=_[_0x0e33('0x59')](_0x1c9c87[_0x0e33('0x46')]);_0x499e7b['filters']=_['intersection'](_0x499e7b[_0x0e33('0x4b')],_0x499e7b['query']);_0x5529e5[_0x0e33('0x49')]=_[_0x0e33('0x48')](_0x499e7b[_0x0e33('0x4b')],qs['fields'](_0x1c9c87['query'][_0x0e33('0x5a')]));_0x5529e5[_0x0e33('0x49')]=_0x5529e5[_0x0e33('0x49')][_0x0e33('0x4a')]?_0x5529e5[_0x0e33('0x49')]:_0x499e7b['model'];if(!_0x1c9c87[_0x0e33('0x46')][_0x0e33('0x4c')](_0x0e33('0x69'))){_0x5529e5[_0x0e33('0x30')]=qs[_0x0e33('0x30')](_0x1c9c87[_0x0e33('0x46')][_0x0e33('0x30')]);_0x5529e5['offset']=qs[_0x0e33('0x2f')](_0x1c9c87['query'][_0x0e33('0x2f')]);}_0x5529e5[_0x0e33('0x4d')]=qs['sort'](_0x1c9c87[_0x0e33('0x46')]['sort']);_0x5529e5[_0x0e33('0x4e')]=qs[_0x0e33('0x47')](_[_0x0e33('0x6b')](_0x1c9c87['query'],_0x499e7b['filters']));_0x5529e5[_0x0e33('0x4e')][_0x0e33('0x6c')]=_0x52daf6['id'];if(_0x1c9c87[_0x0e33('0x46')][_0x0e33('0x4f')]){_0x5529e5[_0x0e33('0x4e')]=_['merge'](_0x5529e5[_0x0e33('0x4e')],{'$or':_[_0x0e33('0x41')](_0x5529e5['attributes'],function(_0x30ae2f){var _0x3b7dee={};_0x3b7dee[_0x30ae2f]={'$like':'%'+_0x1c9c87[_0x0e33('0x46')]['filter']+'%'};return _0x3b7dee;})});}_0x5529e5=_[_0x0e33('0x50')]({},_0x5529e5,_0x1c9c87[_0x0e33('0x71')]);return db['CannedAnswer'][_0x0e33('0x32')]({'where':_0x5529e5[_0x0e33('0x4e')]})[_0x0e33('0x3a')](function(_0x1f94cf){_0x2d4a27[_0x0e33('0x32')]=_0x1f94cf;if(_0x1c9c87['query'][_0x0e33('0x53')]){_0x5529e5['include']=[{'all':!![]}];}return db[_0x0e33('0x6f')][_0x0e33('0x54')](_0x5529e5);})[_0x0e33('0x3a')](function(_0x16910c){_0x2d4a27['rows']=_0x16910c;return _0x2d4a27;});}})[_0x0e33('0x3a')](respondWithFilteredResult(_0x2ca216,_0x5529e5))['catch'](handleError(_0x2ca216,null));};exports[_0x0e33('0x72')]=function(_0xb6ccfd,_0xe5c483,_0x3232c0){return db['WhatsappAccount'][_0x0e33('0x63')]({'where':{'id':_0xb6ccfd[_0x0e33('0x57')]['id']}})['then'](handleEntityNotFound(_0xe5c483,null))['then'](function(_0x7e5815){if(_0x7e5815){return _0x7e5815[_0x0e33('0x72')](_0xb6ccfd[_0x0e33('0x46')][_0x0e33('0x6e')]);}})[_0x0e33('0x3a')](respondWithStatusCode(_0xe5c483,null))[_0x0e33('0x2a')](handleError(_0xe5c483,null));};exports[_0x0e33('0x73')]=function(_0xee44dc,_0x42e5e3,_0x420b8c){return db['WhatsappAccount']['find']({'where':{'id':_0xee44dc[_0x0e33('0x57')]['id']}})['then'](handleEntityNotFound(_0x42e5e3,null))[_0x0e33('0x3a')](function(_0x2f62c5){if(_0x2f62c5){return _0x2f62c5[_0x0e33('0x73')](_0xee44dc[_0x0e33('0x5d')][_0x0e33('0x6e')],_[_0x0e33('0x74')](_0xee44dc[_0x0e33('0x5d')],[_0x0e33('0x6e'),'id'])||{})[_0x0e33('0x75')](function(_0x12919b){for(var _0xba2f86=0x0;_0xba2f86<_0xee44dc[_0x0e33('0x5d')][_0x0e33('0x6e')]['length'];_0xba2f86+=0x1){socket[_0x0e33('0x76')](_0x0e33('0x77'),{'UserId':Number(_0xee44dc[_0x0e33('0x5d')][_0x0e33('0x6e')][_0xba2f86]),'WhatsappAccountId':Number(_0xee44dc[_0x0e33('0x57')]['id'])});}return _0x12919b;});}})[_0x0e33('0x3a')](respondWithResult(_0x42e5e3,null))[_0x0e33('0x2a')](handleError(_0x42e5e3,null));};exports[_0x0e33('0x78')]=function(_0x46a1f4,_0x50a131,_0x49b42c){return db['WhatsappAccount']['find']({'where':{'id':_0x46a1f4['params']['id']}})[_0x0e33('0x3a')](handleEntityNotFound(_0x50a131,null))['then'](function(_0x389d6c){if(_0x389d6c){return _0x389d6c['removeAgents'](_0x46a1f4[_0x0e33('0x46')][_0x0e33('0x6e')])[_0x0e33('0x3a')](function(){if(_[_0x0e33('0x79')](_0x46a1f4['query'][_0x0e33('0x6e')])){for(var _0xbfc940=0x0;_0xbfc940<_0x46a1f4[_0x0e33('0x46')][_0x0e33('0x6e')][_0x0e33('0x4a')];_0xbfc940+=0x1){socket[_0x0e33('0x76')](_0x0e33('0x7a'),{'UserId':Number(_0x46a1f4[_0x0e33('0x46')][_0x0e33('0x6e')][_0xbfc940]),'WhatsappAccountId':Number(_0x46a1f4['params']['id'])});}}else{socket['emit'](_0x0e33('0x7a'),{'UserId':Number(_0x46a1f4[_0x0e33('0x46')][_0x0e33('0x6e')]),'WhatsappAccountId':Number(_0x46a1f4[_0x0e33('0x57')]['id'])});}});}})[_0x0e33('0x3a')](respondWithStatusCode(_0x50a131,null))[_0x0e33('0x2a')](handleError(_0x50a131,null));};exports[_0x0e33('0x7b')]=function(_0x452349,_0x1222e6,_0xad12c5){var _0x1bc582={};var _0x13dd31={};var _0x468937;var _0x3e8fa5;return db['WhatsappAccount'][_0x0e33('0x68')]({'where':{'id':_0x452349[_0x0e33('0x57')]['id']}})[_0x0e33('0x3a')](handleEntityNotFound(_0x1222e6,null))[_0x0e33('0x3a')](function(_0x5561ce){if(_0x5561ce){_0x468937=_0x5561ce;_0x13dd31['model']=_['keys'](db[_0x0e33('0x7c')][_0x0e33('0x42')]);_0x13dd31[_0x0e33('0x46')]=_[_0x0e33('0x59')](_0x452349[_0x0e33('0x46')]);_0x13dd31[_0x0e33('0x47')]=_[_0x0e33('0x48')](_0x13dd31[_0x0e33('0x4b')],_0x13dd31[_0x0e33('0x46')]);_0x1bc582[_0x0e33('0x49')]=_[_0x0e33('0x48')](_0x13dd31[_0x0e33('0x4b')],qs['fields'](_0x452349[_0x0e33('0x46')]['fields']));_0x1bc582[_0x0e33('0x49')]=_0x1bc582['attributes'][_0x0e33('0x4a')]?_0x1bc582[_0x0e33('0x49')]:_0x13dd31[_0x0e33('0x4b')];_0x1bc582['order']=qs[_0x0e33('0x6a')](_0x452349['query'][_0x0e33('0x6a')]);_0x1bc582[_0x0e33('0x4e')]=qs[_0x0e33('0x47')](_[_0x0e33('0x6b')](_0x452349[_0x0e33('0x46')],_0x13dd31[_0x0e33('0x47')]));if(_0x452349[_0x0e33('0x46')][_0x0e33('0x4f')]){_0x1bc582[_0x0e33('0x4e')]=_[_0x0e33('0x50')](_0x1bc582['where'],{'$or':_[_0x0e33('0x41')](_0x1bc582['attributes'],function(_0x47e414){var _0x5c08c9={};_0x5c08c9[_0x47e414]={'$like':'%'+_0x452349[_0x0e33('0x46')][_0x0e33('0x4f')]+'%'};return _0x5c08c9;})});}_0x1bc582=_['merge']({},_0x1bc582,_0x452349[_0x0e33('0x71')]);return _0x468937[_0x0e33('0x7b')](_0x1bc582);}})[_0x0e33('0x3a')](function(_0x4443f9){if(_0x4443f9){_0x3e8fa5=_0x4443f9['length'];if(!_0x452349['query'][_0x0e33('0x4c')](_0x0e33('0x69'))){_0x1bc582[_0x0e33('0x30')]=qs[_0x0e33('0x30')](_0x452349['query'][_0x0e33('0x30')]);_0x1bc582['offset']=qs[_0x0e33('0x2f')](_0x452349[_0x0e33('0x46')][_0x0e33('0x2f')]);}return _0x468937[_0x0e33('0x7b')](_0x1bc582);}})[_0x0e33('0x3a')](function(_0x46addc){if(_0x46addc){return _0x46addc?{'count':_0x3e8fa5,'rows':_0x46addc}:null;}})[_0x0e33('0x3a')](respondWithResult(_0x1222e6,null))['catch'](handleError(_0x1222e6,null));};exports['addApplications']=function(_0x417c9b,_0x11e5de){var _0x4b3e69=_0x417c9b['params']['id'];var _0x2ccb23=_0x417c9b[_0x0e33('0x5d')];var _0x31fb95=0xc8;var _0x1d945b=null;return db[_0x0e33('0x7d')][_0x0e33('0x7e')]({'isolationLevel':db[_0x0e33('0x7d')]['Transaction'][_0x0e33('0x7f')][_0x0e33('0x80')]},function(_0x49313a){return db['WhatsappAccount'][_0x0e33('0x68')]({'where':{'id':_0x4b3e69},'transaction':_0x49313a})[_0x0e33('0x3a')](function(_0x182d54){if(_0x182d54){return db['WhatsappApplication'][_0x0e33('0x39')]({'where':{'WhatsappAccountId':_0x4b3e69},'transaction':_0x49313a})[_0x0e33('0x3a')](function(){var _0x5189cb=_[_0x0e33('0x41')](_0x2ccb23,function(_0x5d0f13){_0x5d0f13[_0x0e33('0x6c')]=_0x4b3e69;return _0x5d0f13;});return db['WhatsappApplication'][_0x0e33('0x81')](_0x5189cb,{'transaction':_0x49313a});});}else{_0x31fb95=0x194;_0x1d945b=[];}});})[_0x0e33('0x3a')](function(){if(_0x31fb95!==0x194){return db[_0x0e33('0x82')][_0x0e33('0x83')]({'where':{'WhatsappAccountId':_0x4b3e69},'order':_0x0e33('0x84')})[_0x0e33('0x3a')](function(_0x12a2b6){_0x1d945b=_0x12a2b6;});}})[_0x0e33('0x2a')](function(_0x1054c2){_0x31fb95=0x1f4;logger[_0x0e33('0x25')](_0x1054c2[_0x0e33('0x3d')]);if(_0x1054c2[_0x0e33('0x3e')]){delete _0x1054c2[_0x0e33('0x3e')];}_0x1d945b=_0x1054c2;})[_0x0e33('0x85')](function(){if(_0x1d945b===null){_0x11e5de[_0x0e33('0x2b')](_0x31fb95);}else{if(_0x31fb95===0x1f4){_0x11e5de[_0x0e33('0x2c')](_0x31fb95)['send'](_0x1d945b);}else{_0x11e5de[_0x0e33('0x2c')](_0x31fb95)['json'](_0x1d945b);}}});};exports['getApplications']=function(_0x4f00ff,_0x1dbbed,_0x189df9){var _0x1df74e={};var _0x2c17c2={};var _0x144f9c;var _0x47c519;return db[_0x0e33('0x52')][_0x0e33('0x68')]({'where':{'id':_0x4f00ff[_0x0e33('0x57')]['id']}})[_0x0e33('0x3a')](handleEntityNotFound(_0x1dbbed,null))[_0x0e33('0x3a')](function(_0xa403df){if(_0xa403df){_0x144f9c=_0xa403df;_0x2c17c2[_0x0e33('0x4b')]=_[_0x0e33('0x59')](db[_0x0e33('0x82')][_0x0e33('0x42')]);_0x2c17c2[_0x0e33('0x46')]=_[_0x0e33('0x59')](_0x4f00ff['query']);_0x2c17c2['filters']=_[_0x0e33('0x48')](_0x2c17c2[_0x0e33('0x4b')],_0x2c17c2[_0x0e33('0x46')]);_0x1df74e[_0x0e33('0x49')]=_[_0x0e33('0x48')](_0x2c17c2[_0x0e33('0x4b')],qs[_0x0e33('0x5a')](_0x4f00ff[_0x0e33('0x46')][_0x0e33('0x5a')]));_0x1df74e[_0x0e33('0x49')]=_0x1df74e['attributes'][_0x0e33('0x4a')]?_0x1df74e[_0x0e33('0x49')]:_0x2c17c2[_0x0e33('0x4b')];_0x1df74e[_0x0e33('0x4d')]=qs[_0x0e33('0x6a')](_0x4f00ff['query'][_0x0e33('0x6a')]);_0x1df74e['where']=qs[_0x0e33('0x47')](_[_0x0e33('0x6b')](_0x4f00ff[_0x0e33('0x46')],_0x2c17c2[_0x0e33('0x47')]));if(_0x4f00ff[_0x0e33('0x46')][_0x0e33('0x4f')]){_0x1df74e['where']=_[_0x0e33('0x50')](_0x1df74e[_0x0e33('0x4e')],{'$or':_[_0x0e33('0x41')](_0x1df74e[_0x0e33('0x49')],function(_0x69e85){var _0x6b62dd={};_0x6b62dd[_0x69e85]={'$like':'%'+_0x4f00ff[_0x0e33('0x46')][_0x0e33('0x4f')]+'%'};return _0x6b62dd;})});}_0x1df74e=_[_0x0e33('0x50')]({},_0x1df74e,_0x4f00ff['options']);return _0x144f9c[_0x0e33('0x86')](_0x1df74e);}})['then'](function(_0xff11c3){if(_0xff11c3){_0x47c519=_0xff11c3[_0x0e33('0x4a')];if(!_0x4f00ff[_0x0e33('0x46')][_0x0e33('0x4c')](_0x0e33('0x69'))){_0x1df74e[_0x0e33('0x30')]=qs[_0x0e33('0x30')](_0x4f00ff[_0x0e33('0x46')]['limit']);_0x1df74e[_0x0e33('0x2f')]=qs[_0x0e33('0x2f')](_0x4f00ff[_0x0e33('0x46')]['offset']);}return _0x144f9c[_0x0e33('0x86')](_0x1df74e);}})[_0x0e33('0x3a')](function(_0x4edf51){if(_0x4edf51){return _0x4edf51?{'count':_0x47c519,'rows':_0x4edf51}:null;}})['then'](respondWithResult(_0x1dbbed,null))[_0x0e33('0x2a')](handleError(_0x1dbbed,null));};exports[_0x0e33('0x87')]=function(_0x2700c3,_0x506693,_0x186fbc){var _0x37a857={'channel':_0x0e33('0x88')};var _0xfda6d1=[];var _0x54edcd=[];var _0xc31ef={};return db[_0x0e33('0x52')][_0x0e33('0x63')]({'where':{'id':_0x2700c3['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x0e33('0x89')}]})[_0x0e33('0x3a')](handleEntityNotFound(_0x506693,null))[_0x0e33('0x3a')](function(_0x403a56){_0x37a857[_0x0e33('0x8a')]=_0x403a56;if(_0x37a857['account']&&_0x37a857[_0x0e33('0x8a')][_0x0e33('0x44')]===_0x0e33('0x8b')&&_0x2700c3[_0x0e33('0x5d')][_0x0e33('0x8c')]){if(_0x2700c3[_0x0e33('0x5d')][_0x0e33('0x8c')][_0x0e33('0x4a')]===0x0)return;if(_0x2700c3[_0x0e33('0x5d')][_0x0e33('0x8c')][0x0][_0x0e33('0x8d')]!=='read')return;return db[_0x0e33('0x8e')]['update']({'read':!![],'readAt':_0x2700c3[_0x0e33('0x5d')][_0x0e33('0x8c')][0x0][_0x0e33('0x8f')]},{'where':{'messageId':_0x2700c3[_0x0e33('0x5d')][_0x0e33('0x8c')][0x0][_0x0e33('0x90')]},'individualHooks':!![]})[_0x0e33('0x3a')](function(_0xb0f4aa){return _0x506693[_0x0e33('0x2c')](0xc8)[_0x0e33('0x2e')](_0xb0f4aa);});}_0x37a857[_0x0e33('0x91')]=_[_0x0e33('0x92')](_0x403a56['Applications'],[_0x0e33('0x84')],['asc']);if(_0x37a857[_0x0e33('0x8a')][_0x0e33('0x89')]){delete _0x37a857[_0x0e33('0x8a')][_0x0e33('0x89')];}return db[_0x0e33('0x93')][_0x0e33('0x94')]()['then'](function(_0xd99074){if(!_0xd99074){throw new db[(_0x0e33('0x95'))][(_0x0e33('0x96'))](_0x0e33('0x97'));}_0xfda6d1=_[_0x0e33('0x98')](_[_0x0e33('0x59')](_0xd99074),[_0x0e33('0x99'),_0x0e33('0x9a')]);_0x54edcd=_[_0x0e33('0x98')](_[_0x0e33('0x59')](_0xd99074),[_0x0e33('0x99'),_0x0e33('0x9a'),'CompanyId',_0x0e33('0x9b')]);_0x37a857[_0x0e33('0x5d')]={'mapKey':_0x0e33('0x9c')};if(_0x37a857[_0x0e33('0x8a')]&&_0x37a857[_0x0e33('0x8a')]['type']==='twilio'){_0x37a857[_0x0e33('0x5d')][_0x0e33('0x9d')]=_0x2700c3[_0x0e33('0x5d')]['From'][_0x0e33('0x9e')]('whatsapp:','');_0x37a857[_0x0e33('0x5d')][_0x0e33('0x5d')]=_0x2700c3[_0x0e33('0x5d')][_0x0e33('0x9f')];_0x37a857[_0x0e33('0x5d')][_0x0e33('0xa0')]=_0x2700c3[_0x0e33('0x5d')][_0x0e33('0xa1')];}if(_0x37a857[_0x0e33('0x8a')]&&_0x37a857['account'][_0x0e33('0x44')]===_0x0e33('0x8b')){_0x37a857['body'][_0x0e33('0x9d')]=_0x2700c3[_0x0e33('0x5d')][_0x0e33('0xa2')][0x0][_0x0e33('0x9d')];_0x37a857[_0x0e33('0x5d')]['body']=_0x2700c3['body'][_0x0e33('0xa2')][0x0][_0x0e33('0x28')][_0x0e33('0x5d')];_0x37a857[_0x0e33('0x5d')]['messageId']=_0x2700c3[_0x0e33('0x5d')][_0x0e33('0xa2')][0x0]['message_id'];}if(_0x37a857[_0x0e33('0x5d')]['id']){delete _0x37a857[_0x0e33('0x5d')]['id'];}if(_[_0x0e33('0xa3')](_0x37a857[_0x0e33('0x5d')][_0x0e33('0x9d')])){throw new db[(_0x0e33('0x95'))][(_0x0e33('0x96'))](_0x0e33('0xa4'));}if(_[_0x0e33('0xa3')](_0x37a857[_0x0e33('0x5d')][_0x0e33('0x5d')])||_0x37a857[_0x0e33('0x5d')]['body']===''){throw new db['Sequelize'][(_0x0e33('0x96'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0e33('0xa3')](_0x37a857[_0x0e33('0x5d')][_0x0e33('0xa5')])){throw new db[(_0x0e33('0x95'))][(_0x0e33('0x96'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x54edcd);}if(!_['includes'](_0x54edcd,_0x37a857[_0x0e33('0x5d')][_0x0e33('0xa5')])){throw new db[(_0x0e33('0x95'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x54edcd);}_0xc31ef[_0x37a857['body'][_0x0e33('0xa5')]]=_0x37a857[_0x0e33('0x5d')][_0x0e33('0x9d')];return db[_0x0e33('0xa6')]['find']({'where':{'id':_0x37a857[_0x0e33('0x8a')][_0x0e33('0x9b')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0xc31ef,'limit':0x1,'order':[[_0x0e33('0x9a'),_0x0e33('0xa7')]]}]});})[_0x0e33('0x3a')](handleEntityNotFound(_0x506693,null))[_0x0e33('0x3a')](function(_0x270053){if(_0x270053){_0x37a857['list']=_[_0x0e33('0x74')](_0x270053,[_0x0e33('0xa8')]);if(_0x270053[_0x0e33('0xa8')][_0x0e33('0x4a')]){return _0x270053[_0x0e33('0xa8')][0x0];}var _0x1aef48=_['defaults'](_0x37a857[_0x0e33('0x5d')],{'firstName':_0x37a857[_0x0e33('0x5d')]['from'],'ListId':_0x270053['id']});_0x1aef48[_0x37a857[_0x0e33('0x5d')][_0x0e33('0xa5')]]=_0x37a857[_0x0e33('0x5d')][_0x0e33('0x9d')];return db[_0x0e33('0x93')][_0x0e33('0x5c')](_0x1aef48,{'fields':_0xfda6d1,'raw':!![]});}})['then'](handleEntityNotFound(_0x506693,null))[_0x0e33('0x3a')](function(_0x43b4c3){if(_0x43b4c3){_0x37a857[_0x0e33('0xa9')]=_0x43b4c3;var _0x40e3e3={'ContactId':_0x43b4c3['id'],'phone':_0x37a857['body'][_0x0e33('0x9d')],'WhatsappAccountId':_0x2700c3[_0x0e33('0x57')]['id']};var _0x316d40={'ContactId':_0x43b4c3['id'],'WhatsappAccountId':_0x2700c3[_0x0e33('0x57')]['id'],'closed':![]};return db[_0x0e33('0xaa')][_0x0e33('0x63')]({'where':_0x316d40})[_0x0e33('0x3a')](function(_0x7485af){if(_0x7485af){return[_0x7485af,![]];}return db['WhatsappInteraction'][_0x0e33('0x5c')](_0x40e3e3)['then'](function(_0x89bd57){return[_0x89bd57,!![]];});});}})[_0x0e33('0x75')](function(_0x5e0f62,_0x539918){_0x37a857[_0x0e33('0xab')]=_0x5e0f62[_0x0e33('0x3b')]({'plain':!![]});_0x37a857[_0x0e33('0xab')]['created']=![];if(_0x539918){if(_0x37a857['account'][_0x0e33('0xac')]){_0x37a857[_0x0e33('0x91')][_0x0e33('0xad')]({'id':0x0,'priority':_0x37a857[_0x0e33('0x91')][_0x0e33('0x4a')]+0x1,'app':_0x0e33('0xae'),'appdata':_0x0e33('0xaf'),'interval':_0x0e33('0xb0')});}_0x37a857[_0x0e33('0xab')][_0x0e33('0xb1')]=!![];}return db[_0x0e33('0x8e')]['create']({'phone':_0x37a857['body']['from'],'messageId':_0x37a857[_0x0e33('0x5d')][_0x0e33('0xa0')],'body':_0x37a857[_0x0e33('0x5d')][_0x0e33('0x5d')],'WhatsappAccountId':_0x2700c3[_0x0e33('0x57')]['id'],'WhatsappInteractionId':_0x5e0f62['id'],'direction':'in','ContactId':_0x5e0f62[_0x0e33('0xb2')],'AttachmentId':_0x37a857[_0x0e33('0x5d')]['AttachmentId']});})['then'](function(_0x1b5ebb){_0x37a857['message']=_0x1b5ebb;if(_0x37a857[_0x0e33('0xab')][_0x0e33('0xb3')]){return db[_0x0e33('0x7c')][_0x0e33('0x63')]({'attributes':['id',_0x0e33('0x3e')],'where':{'id':_0x37a857[_0x0e33('0xab')][_0x0e33('0xb3')]}})[_0x0e33('0x3a')](function(_0x2cd221){if(_0x2cd221){_0x37a857[_0x0e33('0x91')][_0x0e33('0xb4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2cd221[_0x0e33('0x3e')]+','+(_0x37a857['account'][_0x0e33('0xb5')]||0xa),'interval':_0x0e33('0xb0')});}return respondWithRpcPromise('Start',_0x0e33('0xb6'),_0x37a857);});}return respondWithRpcPromise('Start',_0x0e33('0xb6'),_0x37a857);})[_0x0e33('0x3a')](function(_0x29b64b){if(_0x29b64b){var _0x14e1c0=0xc8;var _0x4a3fc5='receiveMessage';logger['info'](_0x0e33('0x23'),_0x4a3fc5,_0x14e1c0,_0x0e33('0xb7'));logger[_0x0e33('0x22')](_0x0e33('0xb8'),_0x4a3fc5,_0x14e1c0,_0x0e33('0xb7'),JSON[_0x0e33('0x24')](_0x29b64b));if(_0x37a857[_0x0e33('0x8a')]['type']==='twilio'){return _0x506693[_0x0e33('0x2c')](_0x14e1c0)[_0x0e33('0x33')]('Content-Type',_0x0e33('0xb9'))[_0x0e33('0x3f')]('\x0a');}else{return _0x506693[_0x0e33('0x2c')](_0x14e1c0)[_0x0e33('0x2e')](_0x29b64b);}}});})[_0x0e33('0x2a')](handleError(_0x506693,null));};exports[_0x0e33('0x3f')]=function(_0x44a104,_0x1f6b9e,_0x17d47a){var _0x5e91b2,_0x2a58e9,_0x1007dd;if(_[_0x0e33('0xa3')](_0x44a104[_0x0e33('0x5d')]['body'])||_0x44a104['body'][_0x0e33('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0e33('0xa3')](_0x44a104[_0x0e33('0x5d')]['to'])){throw new db[(_0x0e33('0x95'))][(_0x0e33('0x96'))](_0x0e33('0xba'));}_0x5e91b2=_0x44a104[_0x0e33('0x5d')]['to'];return db[_0x0e33('0x52')]['find']({'where':{'id':_0x44a104['params']['id']},'include':[{'model':db[_0x0e33('0xa6')],'as':_0x0e33('0xbb'),'include':[{'model':db[_0x0e33('0x93')],'as':_0x0e33('0xa8'),'where':{'mobile':_0x5e91b2},'limit':0x1,'order':[[_0x0e33('0x9a'),_0x0e33('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x1f6b9e,null))[_0x0e33('0x3a')](function(_0x55fa89){if(_0x55fa89&&_0x55fa89[_0x0e33('0xbb')]){_0x2a58e9=_0x55fa89[_0x0e33('0x3b')]({'plain':!![]});if(_0x2a58e9[_0x0e33('0xbb')]&&_0x2a58e9[_0x0e33('0xbb')][_0x0e33('0xa8')][_0x0e33('0x4a')]){return _0x2a58e9['List'][_0x0e33('0xa8')][0x0];}return db['CmContact'][_0x0e33('0x5c')](_['defaults'](_0x44a104[_0x0e33('0x5d')],{'firstName':_0x5e91b2,'mobile':_0x5e91b2,'phone':_0x5e91b2,'ListId':_0x2a58e9['ListId']}));}})[_0x0e33('0x3a')](handleEntityNotFound(_0x1f6b9e,null))['then'](function(_0x227f71){if(_0x227f71){_0x1007dd=_0x227f71;return db['WhatsappInteraction']['find']({'where':{'ContactId':_0x1007dd['id'],'closed':![],'WhatsappAccountId':_0x2a58e9['id']}})[_0x0e33('0x3a')](function(_0x28b95e){if(_0x28b95e){return[_0x28b95e,![]];}return db[_0x0e33('0xaa')]['create']({'UserId':_0x44a104[_0x0e33('0x5e')]['id'],'ContactId':_0x1007dd['id'],'WhatsappAccountId':_0x2a58e9['id'],'phone':_0x5e91b2,'firstMsgDirection':_0x0e33('0xbc'),'Messages':[_[_0x0e33('0x50')](_0x44a104[_0x0e33('0x5d')],{'read':![],'body':_0x44a104[_0x0e33('0x5d')][_0x0e33('0x5d')],'phone':_0x5e91b2,'WhatsappAccountId':_0x2a58e9['id'],'UserId':_0x44a104[_0x0e33('0x5e')]['id'],'ContactId':_0x1007dd['id']})]},{'include':[{'model':db[_0x0e33('0x8e')],'as':_0x0e33('0xbd')}]})[_0x0e33('0x3a')](function(_0x205dbc){return[_0x205dbc,!![]];});});}})[_0x0e33('0x75')](function(_0x5637b7,_0x2020d8){if(_0x2020d8){return _0x5637b7;}return db[_0x0e33('0x8e')][_0x0e33('0x5c')](_[_0x0e33('0x50')](_0x44a104['body'],{'read':![],'body':_0x44a104[_0x0e33('0x5d')][_0x0e33('0x5d')],'phone':_0x5e91b2,'WhatsappAccountId':_0x2a58e9['id'],'WhatsappInteractionId':_0x5637b7['id'],'UserId':_0x44a104[_0x0e33('0x5e')]['id'],'ContactId':_0x1007dd['id']}))[_0x0e33('0x3a')](function(_0x301a00){_0x5637b7['dataValues'][_0x0e33('0xbd')]=[];_0x5637b7[_0x0e33('0xbe')][_0x0e33('0xbd')][_0x0e33('0xad')](_0x301a00[_0x0e33('0xbe')]);return _0x5637b7;});})[_0x0e33('0x3a')](respondWithResult(_0x1f6b9e,null))['catch'](handleError(_0x1f6b9e,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index fae82ef..e54330d 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 _0xf3ea=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3ea,0x69));var _0xaf3e=function(_0x5dae88,_0x5ac45d){_0x5dae88=_0x5dae88-0x0;var _0x52c7b7=_0xf3ea[_0x5dae88];return _0x52c7b7;};'use strict';var EventEmitter=require(_0xaf3e('0x0'));var WhatsappAccount=require(_0xaf3e('0x1'))['db'][_0xaf3e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf3e('0x3'),'afterUpdate':_0xaf3e('0x4'),'afterDestroy':_0xaf3e('0x5')};function emitEvent(_0x1c2683){return function(_0x31de80,_0x1229e7,_0xe0be21){WhatsappAccountEvents[_0xaf3e('0x6')](_0x1c2683+':'+_0x31de80['id'],_0x31de80);WhatsappAccountEvents[_0xaf3e('0x6')](_0x1c2683,_0x31de80);_0xe0be21(null);};}for(var e in events){if(events[_0xaf3e('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xaf3e('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd575=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x4c70cd,_0x640682){var _0x53cb27=function(_0x2c6d1d){while(--_0x2c6d1d){_0x4c70cd['push'](_0x4c70cd['shift']());}};_0x53cb27(++_0x640682);}(_0xd575,0x1bd));var _0x5d57=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0xd575[_0x5de1bc];return _0x19f4b8;};'use strict';var EventEmitter=require(_0x5d57('0x0'));var WhatsappAccount=require(_0x5d57('0x1'))['db'][_0x5d57('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5d57('0x3')](0x0);var events={'afterCreate':_0x5d57('0x4'),'afterUpdate':_0x5d57('0x5'),'afterDestroy':_0x5d57('0x6')};function emitEvent(_0x39d44a){return function(_0x5b9fbb,_0xbc18b2,_0x47456c){WhatsappAccountEvents[_0x5d57('0x7')](_0x39d44a+':'+_0x5b9fbb['id'],_0x5b9fbb);WhatsappAccountEvents[_0x5d57('0x7')](_0x39d44a,_0x5b9fbb);_0x47456c(null);};}for(var e in events){if(events[_0x5d57('0x8')](e)){var event=events[e];WhatsappAccount[_0x5d57('0x9')](e,emitEvent(event));}}module[_0x5d57('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 220cfe3..431b88f 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 _0xecd2=['./whatsappAccount.attributes','exports','define','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0xecd2,0x1bb));var _0x2ecd=function(_0x14e505,_0xf0660f){_0x14e505=_0x14e505-0x0;var _0x5d6bc5=_0xecd2[_0x14e505];return _0x5d6bc5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2ecd('0x0'))(_0x2ecd('0x1'));var moment=require(_0x2ecd('0x2'));var BPromise=require(_0x2ecd('0x3'));var rp=require(_0x2ecd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ecd('0x5'));var config=require(_0x2ecd('0x6'));var attributes=require(_0x2ecd('0x7'));module[_0x2ecd('0x8')]=function(_0x4aa2d2,_0x28ac2){return _0x4aa2d2[_0x2ecd('0x9')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fbd=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes'];(function(_0x2700ee,_0xbad4f9){var _0x3dedf0=function(_0x30184d){while(--_0x30184d){_0x2700ee['push'](_0x2700ee['shift']());}};_0x3dedf0(++_0xbad4f9);}(_0x0fbd,0xd4));var _0xd0fb=function(_0x3b52e5,_0x49f21d){_0x3b52e5=_0x3b52e5-0x0;var _0x279ed1=_0x0fbd[_0x3b52e5];return _0x279ed1;};'use strict';var _=require(_0xd0fb('0x0'));var util=require(_0xd0fb('0x1'));var logger=require('../../config/logger')(_0xd0fb('0x2'));var moment=require(_0xd0fb('0x3'));var BPromise=require(_0xd0fb('0x4'));var rp=require(_0xd0fb('0x5'));var fs=require('fs');var path=require(_0xd0fb('0x6'));var rimraf=require('rimraf');var config=require(_0xd0fb('0x7'));var attributes=require(_0xd0fb('0x8'));module[_0xd0fb('0x9')]=function(_0x276620,_0x550f09){return _0x276620[_0xd0fb('0xa')](_0xd0fb('0xb'),attributes,{'tableName':_0xd0fb('0xc'),'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 32ef082..d50b2c6 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 _0x8b25=['then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowWhatsappAccount','WhatsappAccount','options','where','attributes','include','map','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8b25,0x12b));var _0x58b2=function(_0x5170ff,_0x3eca45){_0x5170ff=_0x5170ff-0x0;var _0x18f7f1=_0x8b25[_0x5170ff];return _0x18f7f1;};'use strict';var _=require('lodash');var util=require(_0x58b2('0x0'));var moment=require(_0x58b2('0x1'));var BPromise=require('bluebird');var rs=require(_0x58b2('0x2'));var fs=require('fs');var Redis=require(_0x58b2('0x3'));var db=require(_0x58b2('0x4'))['db'];var utils=require(_0x58b2('0x5'));var logger=require(_0x58b2('0x6'))('rpc');var config=require(_0x58b2('0x7'));var jayson=require(_0x58b2('0x8'));var client=jayson['client'][_0x58b2('0x9')]({'port':0x232a});config['redis']=_[_0x58b2('0xa')](config['redis'],{'host':_0x58b2('0xb'),'port':0x18eb});var socket=require(_0x58b2('0xc'))(new Redis(config[_0x58b2('0xd')]));require(_0x58b2('0xe'))[_0x58b2('0xf')](socket);function respondWithRpcPromise(_0x596b28,_0x235700,_0x1da27f){return new BPromise(function(_0x186fc0,_0x1d77c2){return client['request'](_0x596b28,_0x1da27f)[_0x58b2('0x10')](function(_0xa60f49){logger['info'](_0x58b2('0x11'),_0x235700,_0x58b2('0x12'));logger[_0x58b2('0x13')](_0x58b2('0x14'),_0x235700,_0x58b2('0x12'),JSON[_0x58b2('0x15')](_0xa60f49));if(_0xa60f49[_0x58b2('0x16')]){if(_0xa60f49['error'][_0x58b2('0x17')]===0x1f4){logger[_0x58b2('0x16')](_0x58b2('0x11'),_0x235700,_0xa60f49[_0x58b2('0x16')][_0x58b2('0x18')]);return _0x1d77c2(_0xa60f49['error'][_0x58b2('0x18')]);}logger[_0x58b2('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x235700,_0xa60f49[_0x58b2('0x16')][_0x58b2('0x18')]);return _0x186fc0(_0xa60f49['error'][_0x58b2('0x18')]);}else{logger[_0x58b2('0x19')](_0x58b2('0x11'),_0x235700,_0x58b2('0x12'));_0x186fc0(_0xa60f49['result'][_0x58b2('0x18')]);}})[_0x58b2('0x1a')](function(_0x4d0e80){logger['error'](_0x58b2('0x11'),_0x235700,_0x4d0e80);_0x1d77c2(_0x4d0e80);});});}exports[_0x58b2('0x1b')]=function(_0x38cb5a){var _0x262d54=this;return new Promise(function(_0x78eab2,_0x4f44e7){return db[_0x58b2('0x1c')]['find']({'raw':_0x38cb5a[_0x58b2('0x1d')]?_0x38cb5a[_0x58b2('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x38cb5a['options']?_0x38cb5a[_0x58b2('0x1d')][_0x58b2('0x1e')]||null:null,'attributes':_0x38cb5a[_0x58b2('0x1d')]?_0x38cb5a['options'][_0x58b2('0x1f')]||null:null,'include':_0x38cb5a['options']?_0x38cb5a[_0x58b2('0x1d')][_0x58b2('0x20')]?_[_0x58b2('0x21')](_0x38cb5a[_0x58b2('0x1d')][_0x58b2('0x20')],function(_0x1eec60){return{'model':db[_0x1eec60[_0x58b2('0x22')]],'as':_0x1eec60['as'],'attributes':_0x1eec60['attributes'],'include':_0x1eec60[_0x58b2('0x20')]?_[_0x58b2('0x21')](_0x1eec60[_0x58b2('0x20')],function(_0x4654ce){return{'model':db[_0x4654ce['model']],'as':_0x4654ce['as'],'attributes':_0x4654ce[_0x58b2('0x1f')],'include':_0x4654ce[_0x58b2('0x20')]?_[_0x58b2('0x21')](_0x4654ce[_0x58b2('0x20')],function(_0x3db3c5){return{'model':db[_0x3db3c5[_0x58b2('0x22')]],'as':_0x3db3c5['as'],'attributes':_0x3db3c5[_0x58b2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x58b2('0x10')](function(_0x4cdb5c){logger[_0x58b2('0x19')](_0x58b2('0x1b'),_0x38cb5a);logger[_0x58b2('0x13')](_0x58b2('0x1b'),_0x38cb5a,JSON['stringify'](_0x4cdb5c));_0x78eab2(_0x4cdb5c);})[_0x58b2('0x1a')](function(_0x2ad338){logger[_0x58b2('0x16')](_0x58b2('0x1b'),_0x2ad338[_0x58b2('0x18')],_0x38cb5a);_0x4f44e7(_0x262d54[_0x58b2('0x16')](0x1f4,_0x2ad338[_0x58b2('0x18')]));});});}; \ No newline at end of file +var _0x4d59=['stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','map','attributes','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x4d59,0xca));var _0x94d5=function(_0x143c25,_0x5ab876){_0x143c25=_0x143c25-0x0;var _0x1d5c61=_0x4d59[_0x143c25];return _0x1d5c61;};'use strict';var _=require(_0x94d5('0x0'));var util=require('util');var moment=require(_0x94d5('0x1'));var BPromise=require(_0x94d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94d5('0x3'));var db=require(_0x94d5('0x4'))['db'];var utils=require(_0x94d5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x94d5('0x6'));var client=jayson[_0x94d5('0x7')][_0x94d5('0x8')]({'port':0x232a});config[_0x94d5('0x9')]=_[_0x94d5('0xa')](config[_0x94d5('0x9')],{'host':_0x94d5('0xb'),'port':0x18eb});var socket=require(_0x94d5('0xc'))(new Redis(config[_0x94d5('0x9')]));require('./whatsappAccount.socket')[_0x94d5('0xd')](socket);function respondWithRpcPromise(_0x3be6f9,_0x3ce059,_0x49e7a6){return new BPromise(function(_0x4b1b74,_0x2db66a){return client[_0x94d5('0xe')](_0x3be6f9,_0x49e7a6)[_0x94d5('0xf')](function(_0x39a231){logger[_0x94d5('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x3ce059,_0x94d5('0x11'));logger[_0x94d5('0x12')](_0x94d5('0x13'),_0x3ce059,'request\x20sent',JSON[_0x94d5('0x14')](_0x39a231));if(_0x39a231[_0x94d5('0x15')]){if(_0x39a231['error'][_0x94d5('0x16')]===0x1f4){logger[_0x94d5('0x15')](_0x94d5('0x17'),_0x3ce059,_0x39a231['error'][_0x94d5('0x18')]);return _0x2db66a(_0x39a231[_0x94d5('0x15')][_0x94d5('0x18')]);}logger['error'](_0x94d5('0x17'),_0x3ce059,_0x39a231[_0x94d5('0x15')][_0x94d5('0x18')]);return _0x4b1b74(_0x39a231[_0x94d5('0x15')]['message']);}else{logger[_0x94d5('0x10')](_0x94d5('0x17'),_0x3ce059,_0x94d5('0x11'));_0x4b1b74(_0x39a231[_0x94d5('0x19')][_0x94d5('0x18')]);}})[_0x94d5('0x1a')](function(_0x492049){logger[_0x94d5('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x3ce059,_0x492049);_0x2db66a(_0x492049);});});}exports[_0x94d5('0x1b')]=function(_0x267437){var _0x3f2fc8=this;return new Promise(function(_0x16fdcd,_0x50f6b9){return db[_0x94d5('0x1c')][_0x94d5('0x1d')]({'raw':_0x267437['options']?_0x267437[_0x94d5('0x1e')][_0x94d5('0x1f')]===undefined?!![]:![]:!![],'where':_0x267437[_0x94d5('0x1e')]?_0x267437['options'][_0x94d5('0x20')]||null:null,'attributes':_0x267437[_0x94d5('0x1e')]?_0x267437['options']['attributes']||null:null,'include':_0x267437[_0x94d5('0x1e')]?_0x267437[_0x94d5('0x1e')][_0x94d5('0x21')]?_[_0x94d5('0x22')](_0x267437[_0x94d5('0x1e')][_0x94d5('0x21')],function(_0x5f2282){return{'model':db[_0x5f2282['model']],'as':_0x5f2282['as'],'attributes':_0x5f2282[_0x94d5('0x23')],'include':_0x5f2282['include']?_[_0x94d5('0x22')](_0x5f2282[_0x94d5('0x21')],function(_0x45a85e){return{'model':db[_0x45a85e[_0x94d5('0x24')]],'as':_0x45a85e['as'],'attributes':_0x45a85e[_0x94d5('0x23')],'include':_0x45a85e[_0x94d5('0x21')]?_[_0x94d5('0x22')](_0x45a85e[_0x94d5('0x21')],function(_0x19b550){return{'model':db[_0x19b550[_0x94d5('0x24')]],'as':_0x19b550['as'],'attributes':_0x19b550['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51e88a){logger[_0x94d5('0x10')]('ShowWhatsappAccount',_0x267437);logger['debug'](_0x94d5('0x1b'),_0x267437,JSON[_0x94d5('0x14')](_0x51e88a));_0x16fdcd(_0x51e88a);})[_0x94d5('0x1a')](function(_0x411218){logger[_0x94d5('0x15')](_0x94d5('0x1b'),_0x411218[_0x94d5('0x18')],_0x267437);_0x50f6b9(_0x3f2fc8[_0x94d5('0x15')](0x1f4,_0x411218[_0x94d5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 4ca67ad..685342b 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 _0xb77f=['emit','register','save','remove','update'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xb77f,0x19c));var _0xfb77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb77f[_0x14add3];return _0x4a174f;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xfb77('0x0'),_0xfb77('0x1'),_0xfb77('0x2')];function createListener(_0x30a1c3,_0x47c80e){return function(_0x3470aa){_0x47c80e[_0xfb77('0x3')](_0x30a1c3,_0x3470aa);};}function removeListener(_0x52bdf0,_0x460c77){return function(){WhatsappAccountEvents['removeListener'](_0x52bdf0,_0x460c77);};}exports[_0xfb77('0x4')]=function(_0x5626db){for(var _0x5679fe=0x0,_0xaa131a=events['length'];_0x5679fe<_0xaa131a;_0x5679fe++){var _0x21af7f=events[_0x5679fe];var _0x464f8a=createListener('whatsappAccount:'+_0x21af7f,_0x5626db);WhatsappAccountEvents['on'](_0x21af7f,_0x464f8a);}}; \ No newline at end of file +var _0xb171=['register','length','./whatsappAccount.events','save','update'];(function(_0x661283,_0x3e5dd6){var _0x9a0ce2=function(_0x2b02bd){while(--_0x2b02bd){_0x661283['push'](_0x661283['shift']());}};_0x9a0ce2(++_0x3e5dd6);}(_0xb171,0x1d8));var _0x1b17=function(_0x539e88,_0x192880){_0x539e88=_0x539e88-0x0;var _0x3a7e29=_0xb171[_0x539e88];return _0x3a7e29;};'use strict';var WhatsappAccountEvents=require(_0x1b17('0x0'));var events=[_0x1b17('0x1'),'remove',_0x1b17('0x2')];function createListener(_0x5d98cf,_0x8f4737){return function(_0x4f93f2){_0x8f4737['emit'](_0x5d98cf,_0x4f93f2);};}function removeListener(_0x37bf5d,_0x1bae12){return function(){WhatsappAccountEvents['removeListener'](_0x37bf5d,_0x1bae12);};}exports[_0x1b17('0x3')]=function(_0x364220){for(var _0xcfa9fb=0x0,_0x1c9101=events[_0x1b17('0x4')];_0xcfa9fb<_0x1c9101;_0xcfa9fb++){var _0x4e30b0=events[_0xcfa9fb];var _0x271bad=createListener('whatsappAccount:'+_0x4e30b0,_0x364220);WhatsappAccountEvents['on'](_0x4e30b0,_0x271bad);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e802661..39544f8 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 _0x4e3b=['./whatsappApplication.controller','isAuthenticated','index','get','/:id','create','delete','exports','util','path','express','Router','fs-extra'];(function(_0x1fef2e,_0x38b3c2){var _0x51a4b5=function(_0x4b121d){while(--_0x4b121d){_0x1fef2e['push'](_0x1fef2e['shift']());}};_0x51a4b5(++_0x38b3c2);}(_0x4e3b,0x1c2));var _0xb4e3=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0x4e3b[_0x31172e];return _0x414ada;};'use strict';var multer=require('multer');var util=require(_0xb4e3('0x0'));var path=require(_0xb4e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xb4e3('0x2'));var router=express[_0xb4e3('0x3')]();var fs_extra=require(_0xb4e3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb4e3('0x5'));router['get']('/',auth[_0xb4e3('0x6')](),controller[_0xb4e3('0x7')]);router[_0xb4e3('0x8')](_0xb4e3('0x9'),auth[_0xb4e3('0x6')](),controller['show']);router['post']('/',auth[_0xb4e3('0x6')](),controller[_0xb4e3('0xa')]);router['put']('/:id',auth[_0xb4e3('0x6')](),controller['update']);router[_0xb4e3('0xb')](_0xb4e3('0x9'),auth[_0xb4e3('0x6')](),controller['destroy']);module[_0xb4e3('0xc')]=router; \ No newline at end of file +var _0xba24=['put','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','post'];(function(_0x3485f8,_0x1b66cf){var _0x1fbba7=function(_0x135b73){while(--_0x135b73){_0x3485f8['push'](_0x3485f8['shift']());}};_0x1fbba7(++_0x1b66cf);}(_0xba24,0x1b6));var _0x4ba2=function(_0x356515,_0x3295ca){_0x356515=_0x356515-0x0;var _0xb430f2=_0xba24[_0x356515];return _0xb430f2;};'use strict';var multer=require(_0x4ba2('0x0'));var util=require(_0x4ba2('0x1'));var path=require(_0x4ba2('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ba2('0x3'));var router=express['Router']();var fs_extra=require(_0x4ba2('0x4'));var auth=require(_0x4ba2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4ba2('0x6'));var controller=require(_0x4ba2('0x7'));router['get']('/',auth[_0x4ba2('0x8')](),controller[_0x4ba2('0x9')]);router[_0x4ba2('0xa')]('/:id',auth[_0x4ba2('0x8')](),controller['show']);router[_0x4ba2('0xb')]('/',auth[_0x4ba2('0x8')](),controller['create']);router[_0x4ba2('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4ba2('0xd')]);router[_0x4ba2('0xe')](_0x4ba2('0xf'),auth['isAuthenticated'](),controller[_0x4ba2('0x10')]);module[_0x4ba2('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 eb5eb8a..53843d3 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 _0xece9=['noop','TEXT','INTEGER','STRING'];(function(_0x5c98cc,_0x58190a){var _0x164644=function(_0x540bae){while(--_0x540bae){_0x5c98cc['push'](_0x5c98cc['shift']());}};_0x164644(++_0x58190a);}(_0xece9,0x10e));var _0x9ece=function(_0x327706,_0x589197){_0x327706=_0x327706-0x0;var _0x13f1b7=_0xece9[_0x327706];return _0x13f1b7;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9ece('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9ece('0x1')],'allowNull':![],'defaultValue':_0x9ece('0x2')},'appdata':{'type':Sequelize[_0x9ece('0x3')]()},'description':{'type':Sequelize[_0x9ece('0x1')]},'interval':{'type':Sequelize[_0x9ece('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3868=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x53f122,_0x2cdeca){var _0x59a134=function(_0x41468d){while(--_0x41468d){_0x53f122['push'](_0x53f122['shift']());}};_0x59a134(++_0x2cdeca);}(_0x3868,0x1cb));var _0x8386=function(_0x521856,_0x15d384){_0x521856=_0x521856-0x0;var _0x27dd73=_0x3868[_0x521856];return _0x27dd73;};'use strict';var Sequelize=require(_0x8386('0x0'));module[_0x8386('0x1')]={'priority':{'type':Sequelize[_0x8386('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8386('0x3')],'allowNull':![],'defaultValue':_0x8386('0x4')},'appdata':{'type':Sequelize[_0x8386('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8386('0x3')],'defaultValue':_0x8386('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 815858e..311c7f2 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 _0x8276=['WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','eml-format','rimraf','request-promise','moment','mustache','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','api','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x8276,0xa7));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x6827('0x0'));var rimraf=require(_0x6827('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6827('0x2'));var moment=require(_0x6827('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6827('0x4'));var util=require(_0x6827('0x5'));var path=require('path');var sox=require(_0x6827('0x6'));var csv=require(_0x6827('0x7'));var ejs=require(_0x6827('0x8'));var fs=require('fs');var fs_extra=require(_0x6827('0x9'));var _=require(_0x6827('0xa'));var squel=require(_0x6827('0xb'));var crypto=require(_0x6827('0xc'));var jsforce=require(_0x6827('0xd'));var deskjs=require(_0x6827('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6827('0xf'));var Papa=require(_0x6827('0x10'));var Redis=require(_0x6827('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6827('0x12'));var as=require(_0x6827('0x13'));var hardwareService=require(_0x6827('0x14'));var logger=require('../../config/logger')(_0x6827('0x15'));var utils=require(_0x6827('0x16'));var config=require(_0x6827('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5af483,_0x3fe85d){_0x3fe85d=_0x3fe85d||0xcc;return function(_0x3e035a){if(_0x3e035a){return _0x5af483[_0x6827('0x18')](_0x3fe85d);}return _0x5af483['status'](_0x3fe85d)[_0x6827('0x19')]();};}function respondWithResult(_0x4244e6,_0x587cd9){_0x587cd9=_0x587cd9||0xc8;return function(_0x55cb16){if(_0x55cb16){return _0x4244e6[_0x6827('0x1a')](_0x587cd9)[_0x6827('0x1b')](_0x55cb16);}};}function respondWithFilteredResult(_0x2b661c,_0x1eada3){return function(_0x1bac80){if(_0x1bac80){var _0x4b4aac=typeof _0x1eada3['offset']===_0x6827('0x1c')&&typeof _0x1eada3[_0x6827('0x1d')]==='undefined';var _0x50e3dc=_0x1bac80[_0x6827('0x1e')];var _0x4a9c42=_0x4b4aac?0x0:_0x1eada3[_0x6827('0x1f')];var _0x9cf7c0=_0x4b4aac?_0x1bac80[_0x6827('0x1e')]:_0x1eada3[_0x6827('0x1f')]+_0x1eada3[_0x6827('0x1d')];var _0xec247a;if(_0x9cf7c0>=_0x50e3dc){_0x9cf7c0=_0x50e3dc;_0xec247a=0xc8;}else{_0xec247a=0xce;}_0x2b661c['status'](_0xec247a);return _0x2b661c[_0x6827('0x20')](_0x6827('0x21'),_0x4a9c42+'-'+_0x9cf7c0+'/'+_0x50e3dc)['json'](_0x1bac80);}return null;};}function patchUpdates(_0x1933c0){return function(_0x127e5b){try{jsonpatch[_0x6827('0x22')](_0x127e5b,_0x1933c0,!![]);}catch(_0xb69316){return BPromise[_0x6827('0x23')](_0xb69316);}return _0x127e5b[_0x6827('0x24')]();};}function saveUpdates(_0x360168,_0x15f8b3){return function(_0x2d65d0){if(_0x2d65d0){return _0x2d65d0['update'](_0x360168)[_0x6827('0x25')](function(_0x4d83c7){return _0x4d83c7;});}return null;};}function removeEntity(_0x25e37e,_0x5c3a1f){return function(_0x162cdb){if(_0x162cdb){return _0x162cdb[_0x6827('0x26')]()[_0x6827('0x25')](function(){_0x25e37e[_0x6827('0x1a')](0xcc)[_0x6827('0x19')]();});}};}function handleEntityNotFound(_0x2007f0,_0x657390){return function(_0x532fd2){if(!_0x532fd2){_0x2007f0['sendStatus'](0x194);}return _0x532fd2;};}function handleError(_0x167a49,_0x3d940c){_0x3d940c=_0x3d940c||0x1f4;return function(_0x35f1fc){logger[_0x6827('0x27')](_0x35f1fc[_0x6827('0x28')]);if(_0x35f1fc[_0x6827('0x29')]){delete _0x35f1fc[_0x6827('0x29')];}_0x167a49[_0x6827('0x1a')](_0x3d940c)[_0x6827('0x2a')](_0x35f1fc);};}exports[_0x6827('0x2b')]=function(_0x547444,_0x6f9b98){var _0x56cab3={},_0x522281={},_0xaee4f7={'count':0x0,'rows':[]};var _0x2fd295=_[_0x6827('0x2c')](db['WhatsappApplication'][_0x6827('0x2d')],function(_0x179072){return{'name':_0x179072['fieldName'],'type':_0x179072['type'][_0x6827('0x2e')]};});_0x522281[_0x6827('0x2f')]=_[_0x6827('0x2c')](_0x2fd295,_0x6827('0x29'));_0x522281['query']=_[_0x6827('0x30')](_0x547444[_0x6827('0x31')]);_0x522281[_0x6827('0x32')]=_[_0x6827('0x33')](_0x522281['model'],_0x522281['query']);_0x56cab3[_0x6827('0x34')]=_[_0x6827('0x33')](_0x522281[_0x6827('0x2f')],qs['fields'](_0x547444[_0x6827('0x31')][_0x6827('0x35')]));_0x56cab3[_0x6827('0x34')]=_0x56cab3[_0x6827('0x34')]['length']?_0x56cab3['attributes']:_0x522281[_0x6827('0x2f')];if(!_0x547444[_0x6827('0x31')]['hasOwnProperty'](_0x6827('0x36'))){_0x56cab3['limit']=qs[_0x6827('0x1d')](_0x547444['query'][_0x6827('0x1d')]);_0x56cab3['offset']=qs['offset'](_0x547444['query'][_0x6827('0x1f')]);}_0x56cab3[_0x6827('0x37')]=qs[_0x6827('0x38')](_0x547444[_0x6827('0x31')][_0x6827('0x38')]);_0x56cab3['where']=qs[_0x6827('0x32')](_[_0x6827('0x39')](_0x547444['query'],_0x522281[_0x6827('0x32')]),_0x2fd295);if(_0x547444[_0x6827('0x31')][_0x6827('0x3a')]){_0x56cab3[_0x6827('0x3b')]=_[_0x6827('0x3c')](_0x56cab3[_0x6827('0x3b')],{'$or':_[_0x6827('0x2c')](_0x2fd295,function(_0x37ad39){if(_0x37ad39[_0x6827('0x3d')]!==_0x6827('0x3e')){var _0x2edcf8={};_0x2edcf8[_0x37ad39[_0x6827('0x29')]]={'$like':'%'+_0x547444[_0x6827('0x31')][_0x6827('0x3a')]+'%'};return _0x2edcf8;}})});}_0x56cab3=_[_0x6827('0x3c')]({},_0x56cab3,_0x547444[_0x6827('0x3f')]);var _0x24222d={'where':_0x56cab3[_0x6827('0x3b')]};return db[_0x6827('0x40')][_0x6827('0x1e')](_0x24222d)[_0x6827('0x25')](function(_0x1019bc){_0xaee4f7[_0x6827('0x1e')]=_0x1019bc;if(_0x547444[_0x6827('0x31')][_0x6827('0x41')]){_0x56cab3[_0x6827('0x42')]=[{'all':!![]}];}return db[_0x6827('0x40')][_0x6827('0x43')](_0x56cab3);})[_0x6827('0x25')](function(_0x9001a6){_0xaee4f7[_0x6827('0x44')]=_0x9001a6;return _0xaee4f7;})['then'](respondWithFilteredResult(_0x6f9b98,_0x56cab3))[_0x6827('0x45')](handleError(_0x6f9b98,null));};exports[_0x6827('0x46')]=function(_0x5cb13a,_0x41fd9e){var _0x96e3f5={'raw':!![],'where':{'id':_0x5cb13a[_0x6827('0x47')]['id']}},_0x4a53fa={};_0x4a53fa[_0x6827('0x2f')]=_['keys'](db[_0x6827('0x40')][_0x6827('0x2d')]);_0x4a53fa[_0x6827('0x31')]=_[_0x6827('0x30')](_0x5cb13a[_0x6827('0x31')]);_0x4a53fa[_0x6827('0x32')]=_[_0x6827('0x33')](_0x4a53fa[_0x6827('0x2f')],_0x4a53fa[_0x6827('0x31')]);_0x96e3f5['attributes']=_[_0x6827('0x33')](_0x4a53fa['model'],qs[_0x6827('0x35')](_0x5cb13a[_0x6827('0x31')]['fields']));_0x96e3f5[_0x6827('0x34')]=_0x96e3f5['attributes'][_0x6827('0x48')]?_0x96e3f5[_0x6827('0x34')]:_0x4a53fa[_0x6827('0x2f')];if(_0x5cb13a['query'][_0x6827('0x41')]){_0x96e3f5[_0x6827('0x42')]=[{'all':!![]}];}_0x96e3f5=_['merge']({},_0x96e3f5,_0x5cb13a[_0x6827('0x3f')]);return db['WhatsappApplication'][_0x6827('0x49')](_0x96e3f5)[_0x6827('0x25')](handleEntityNotFound(_0x41fd9e,null))[_0x6827('0x25')](respondWithResult(_0x41fd9e,null))[_0x6827('0x45')](handleError(_0x41fd9e,null));};exports[_0x6827('0x4a')]=function(_0x582a83,_0x18a9b9){return db[_0x6827('0x40')][_0x6827('0x4a')](_0x582a83[_0x6827('0x4b')],{})[_0x6827('0x25')](respondWithResult(_0x18a9b9,0xc9))['catch'](handleError(_0x18a9b9,null));};exports[_0x6827('0x4c')]=function(_0x50b909,_0x5c135c){if(_0x50b909[_0x6827('0x4b')]['id']){delete _0x50b909[_0x6827('0x4b')]['id'];}return db[_0x6827('0x40')][_0x6827('0x49')]({'where':{'id':_0x50b909['params']['id']}})[_0x6827('0x25')](handleEntityNotFound(_0x5c135c,null))['then'](saveUpdates(_0x50b909[_0x6827('0x4b')],null))[_0x6827('0x25')](respondWithResult(_0x5c135c,null))['catch'](handleError(_0x5c135c,null));};exports[_0x6827('0x26')]=function(_0x4fb0ea,_0x131141){return db[_0x6827('0x40')]['find']({'where':{'id':_0x4fb0ea['params']['id']}})[_0x6827('0x25')](handleEntityNotFound(_0x131141,null))[_0x6827('0x25')](removeEntity(_0x131141,null))[_0x6827('0x45')](handleError(_0x131141,null));}; \ No newline at end of file +var _0x2542=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x2542,0x169));var _0x2254=function(_0x22ec55,_0x382deb){_0x22ec55=_0x22ec55-0x0;var _0x179c23=_0x2542[_0x22ec55];return _0x179c23;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':!![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['WhatsappApplication'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 2667230..95df103 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 _0x54ef=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication'];(function(_0xb7fa6a,_0x468802){var _0x59ee23=function(_0x1666ca){while(--_0x1666ca){_0xb7fa6a['push'](_0xb7fa6a['shift']());}};_0x59ee23(++_0x468802);}(_0x54ef,0x112));var _0xf54e=function(_0x3d780f,_0x13d33b){_0x3d780f=_0x3d780f-0x0;var _0x4535ad=_0x54ef[_0x3d780f];return _0x4535ad;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf54e('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x615a=['path','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x20b74e,_0x243ae5){var _0x326c63=function(_0x1d7f6c){while(--_0x1d7f6c){_0x20b74e['push'](_0x20b74e['shift']());}};_0x326c63(++_0x243ae5);}(_0x615a,0x119));var _0xa615=function(_0x4d0ebd,_0x17ab0b){_0x4d0ebd=_0x4d0ebd-0x0;var _0x594e9c=_0x615a[_0x4d0ebd];return _0x594e9c;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var logger=require(_0xa615('0x1'))('api');var moment=require(_0xa615('0x2'));var BPromise=require(_0xa615('0x3'));var rp=require(_0xa615('0x4'));var fs=require('fs');var path=require(_0xa615('0x5'));var rimraf=require('rimraf');var config=require(_0xa615('0x6'));var attributes=require(_0xa615('0x7'));module['exports']=function(_0x320680,_0x5d04bd){return _0x320680[_0xa615('0x8')](_0xa615('0x9'),attributes,{'tableName':_0xa615('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa615('0xb'),'collate':_0xa615('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index df64f9b..f78e246 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s'];(function(_0x2690d3,_0x3c1cb5){var _0x3af6e=function(_0x220009){while(--_0x220009){_0x2690d3['push'](_0x2690d3['shift']());}};_0x3af6e(++_0x3c1cb5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x00bb[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x0a9a=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x4fdb0a,_0x47ddfd){var _0x57e3a2=function(_0x2c9ca6){while(--_0x2c9ca6){_0x4fdb0a['push'](_0x4fdb0a['shift']());}};_0x57e3a2(++_0x47ddfd);}(_0x0a9a,0x183));var _0xa0a9=function(_0x26f98e,_0x315543){_0x26f98e=_0x26f98e-0x0;var _0x124e5f=_0x0a9a[_0x26f98e];return _0x124e5f;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index a675f31..db705d5 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 _0x029b=['connect-timeout','express','fs-extra','../../components/auth/service','./whatsappInteraction.controller','get','isAuthenticated','index','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','delete','destroy','exports','multer','util'];(function(_0x1bb80c,_0x26d406){var _0x368f16=function(_0x4e37e5){while(--_0x4e37e5){_0x1bb80c['push'](_0x1bb80c['shift']());}};_0x368f16(++_0x26d406);}(_0x029b,0x66));var _0xb029=function(_0x4f5c44,_0x1a44ff){_0x4f5c44=_0x4f5c44-0x0;var _0x54e1c2=_0x029b[_0x4f5c44];return _0x54e1c2;};'use strict';var multer=require(_0xb029('0x0'));var util=require(_0xb029('0x1'));var path=require('path');var timeout=require(_0xb029('0x2'));var express=require(_0xb029('0x3'));var router=express['Router']();var fs_extra=require(_0xb029('0x4'));var auth=require(_0xb029('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb029('0x6'));router[_0xb029('0x7')]('/',auth[_0xb029('0x8')](),controller[_0xb029('0x9')]);router[_0xb029('0x7')]('/describe',auth[_0xb029('0x8')](),controller['describe']);router[_0xb029('0x7')]('/:id',auth[_0xb029('0x8')](),controller['show']);router[_0xb029('0x7')]('/:id/messages',auth[_0xb029('0x8')](),controller[_0xb029('0xa')]);router['get'](_0xb029('0xb'),auth[_0xb029('0x8')](),controller[_0xb029('0xc')]);router[_0xb029('0xd')]('/',auth[_0xb029('0x8')](),controller['create']);router[_0xb029('0xd')]('/:id/messages',auth[_0xb029('0x8')](),controller[_0xb029('0xe')]);router[_0xb029('0xd')](_0xb029('0xf'),auth['isAuthenticated'](),interaction[_0xb029('0x10')](_0xb029('0x11'),_0xb029('0x12')),controller['addTags']);router[_0xb029('0x13')](_0xb029('0x14'),auth[_0xb029('0x8')](),interaction[_0xb029('0x10')](_0xb029('0x11'),_0xb029('0x15')),controller[_0xb029('0x16')]);router[_0xb029('0x17')](_0xb029('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0xb029('0x11'),'whatsappinteraction:destroy'),controller[_0xb029('0x18')]);router[_0xb029('0x17')](_0xb029('0xf'),auth['isAuthenticated'](),controller['removeTags']);module[_0xb029('0x19')]=router; \ No newline at end of file +var _0x1115=['get','show','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe'];(function(_0x52e251,_0x3b6303){var _0x5eee63=function(_0xf1cd77){while(--_0xf1cd77){_0x52e251['push'](_0x52e251['shift']());}};_0x5eee63(++_0x3b6303);}(_0x1115,0x1b6));var _0x5111=function(_0x2a793e,_0x37682e){_0x2a793e=_0x2a793e-0x0;var _0x38d3f7=_0x1115[_0x2a793e];return _0x38d3f7;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['describe']);router[_0x5111('0xc')]('/:id',auth[_0x5111('0x9')](),controller[_0x5111('0xd')]);router['get']('/:id/messages',auth[_0x5111('0x9')](),controller['getMessages']);router[_0x5111('0xc')]('/:id/download',auth[_0x5111('0x9')](),controller[_0x5111('0xe')]);router[_0x5111('0xf')]('/',auth[_0x5111('0x9')](),controller[_0x5111('0x10')]);router[_0x5111('0xf')](_0x5111('0x11'),auth[_0x5111('0x9')](),controller[_0x5111('0x12')]);router[_0x5111('0xf')](_0x5111('0x13'),auth[_0x5111('0x9')](),interaction[_0x5111('0x14')](_0x5111('0x15'),_0x5111('0x16')),controller[_0x5111('0x17')]);router[_0x5111('0x18')](_0x5111('0x19'),auth['isAuthenticated'](),interaction[_0x5111('0x14')]('whatsapp','whatsappinteraction:update'),controller[_0x5111('0x1a')]);router[_0x5111('0x1b')](_0x5111('0x19'),auth['isAuthenticated'](),interaction[_0x5111('0x14')](_0x5111('0x15'),'whatsappinteraction:destroy'),controller[_0x5111('0x1c')]);router[_0x5111('0x1b')](_0x5111('0x13'),auth[_0x5111('0x9')](),controller['removeTags']);module[_0x5111('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index f88b79d..89d2c10 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 _0xfc76=['exports','BOOLEAN','DATE','STRING','out','ENUM','moment'];(function(_0x22288c,_0x4a1bdc){var _0x11a7a6=function(_0x488e0b){while(--_0x488e0b){_0x22288c['push'](_0x22288c['shift']());}};_0x11a7a6(++_0x4a1bdc);}(_0xfc76,0xb5));var _0x6fc7=function(_0x53cc9f,_0x2995e2){_0x53cc9f=_0x53cc9f-0x0;var _0x54be4f=_0xfc76[_0x53cc9f];return _0x54be4f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6fc7('0x0'));module[_0x6fc7('0x1')]={'closed':{'type':Sequelize[_0x6fc7('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6fc7('0x3')]},'disposition':{'type':Sequelize[_0x6fc7('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6fc7('0x4')]},'note':{'type':Sequelize[_0x6fc7('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6fc7('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6fc7('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6fc7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6fc7('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6fc7('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0738=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0x0738,0x6e));var _0x8073=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x0738[_0x15b380];return _0x232c5c;};'use strict';var Sequelize=require(_0x8073('0x0'));var moment=require('moment');module[_0x8073('0x1')]={'closed':{'type':Sequelize[_0x8073('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8073('0x3')]},'disposition':{'type':Sequelize[_0x8073('0x4')]},'secondDisposition':{'type':Sequelize[_0x8073('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8073('0x4')]},'note':{'type':Sequelize[_0x8073('0x4')]},'phone':{'type':Sequelize[_0x8073('0x4')]},'read1stAt':{'type':Sequelize[_0x8073('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8073('0x5')]('in',_0x8073('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8073('0x5')]('in',_0x8073('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8073('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 8f32787..f0cc870 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 _0x6703=['pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','status','end','json','offset','limit','undefined','count','Content-Range','then','sendStatus','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','create','body','find','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','map','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','findAll','color','whatsappInteractionTags:save','download','unix','toString','join','root','server','files','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Owner','get','mkdirSync','Account','N.A.','closedAt','basename','createReadStream'];(function(_0x7de2b5,_0x3c36e9){var _0x5de3c6=function(_0x2ffc61){while(--_0x2ffc61){_0x7de2b5['push'](_0x7de2b5['shift']());}};_0x5de3c6(++_0x3c36e9);}(_0x6703,0x102));var _0x3670=function(_0xccc0d4,_0x2f6bf7){_0xccc0d4=_0xccc0d4-0x0;var _0x27a653=_0x6703[_0xccc0d4];return _0x27a653;};'use strict';var rimraf=require(_0x3670('0x0'));var zipdir=require(_0x3670('0x1'));var moment=require('moment');var BPromise=require(_0x3670('0x2'));var util=require(_0x3670('0x3'));var path=require(_0x3670('0x4'));var ejs=require(_0x3670('0x5'));var fs=require('fs');var _=require(_0x3670('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x3670('0x7'));var pdf=require(_0x3670('0x8'));var logger=require(_0x3670('0x9'))(_0x3670('0xa'));var config=require('../../config/environment');var db=require(_0x3670('0xb'))['db'];config[_0x3670('0xc')]=_['defaults'](config[_0x3670('0xc')],{'host':_0x3670('0xd'),'port':0x18eb});var socket=require(_0x3670('0xe'))(new Redis(config['redis']));require(_0x3670('0xf'))['register'](socket);function respondWithStatusCode(_0x1b61b9,_0x323299){_0x323299=_0x323299||0xcc;return function(_0x32b7a2){if(_0x32b7a2){return _0x1b61b9['sendStatus'](_0x323299);}return _0x1b61b9[_0x3670('0x10')](_0x323299)[_0x3670('0x11')]();};}function respondWithResult(_0x22ce2e,_0x5b0202){_0x5b0202=_0x5b0202||0xc8;return function(_0x9ac596){if(_0x9ac596){return _0x22ce2e['status'](_0x5b0202)[_0x3670('0x12')](_0x9ac596);}};}function respondWithFilteredResult(_0x25ebd2,_0x16bbda){return function(_0x894c62){if(_0x894c62){var _0x5c9222=typeof _0x16bbda[_0x3670('0x13')]==='undefined'&&typeof _0x16bbda[_0x3670('0x14')]===_0x3670('0x15');var _0x3e037e=_0x894c62[_0x3670('0x16')];var _0x2c346e=_0x5c9222?0x0:_0x16bbda[_0x3670('0x13')];var _0x450c89=_0x5c9222?_0x894c62[_0x3670('0x16')]:_0x16bbda[_0x3670('0x13')]+_0x16bbda['limit'];var _0x53e20b;if(_0x450c89>=_0x3e037e){_0x450c89=_0x3e037e;_0x53e20b=0xc8;}else{_0x53e20b=0xce;}_0x25ebd2[_0x3670('0x10')](_0x53e20b);return _0x25ebd2['set'](_0x3670('0x17'),_0x2c346e+'-'+_0x450c89+'/'+_0x3e037e)[_0x3670('0x12')](_0x894c62);}return null;};}function saveUpdates(_0x4288fd){return function(_0x259866){if(_0x259866){return _0x259866['update'](_0x4288fd)[_0x3670('0x18')](function(_0x5a8d6b){return _0x5a8d6b;});}return null;};}function removeEntity(_0x5b2dfd){return function(_0x283319){if(_0x283319){return _0x283319['destroy']()[_0x3670('0x18')](function(){_0x5b2dfd[_0x3670('0x10')](0xcc)[_0x3670('0x11')]();});}};}function handleEntityNotFound(_0xafe0ad){return function(_0x5be406){if(!_0x5be406){_0xafe0ad[_0x3670('0x19')](0x194);}return _0x5be406;};}function handleError(_0x3f24e2,_0x3aaaf4){_0x3aaaf4=_0x3aaaf4||0x1f4;return function(_0x25cbdf){logger[_0x3670('0x1a')](_0x25cbdf[_0x3670('0x1b')]);if(_0x25cbdf[_0x3670('0x1c')]){delete _0x25cbdf['name'];}_0x3f24e2[_0x3670('0x10')](_0x3aaaf4)[_0x3670('0x1d')](_0x25cbdf);};}exports[_0x3670('0x1e')]=function(_0x3a8ec2,_0x49cea5){var _0x322386={};var _0x5247c0=_['map'](db[_0x3670('0x1f')][_0x3670('0x20')],function(_0x4af3d9){return{'name':_0x4af3d9[_0x3670('0x21')],'type':_0x4af3d9[_0x3670('0x22')]['key']};});_0x322386=qs[_0x3670('0x23')](_0x5247c0,_0x3a8ec2);return interaction['findAll'](_0x3670('0x24'),_0x3a8ec2[_0x3670('0x25')],_0x3a8ec2[_0x3670('0x26')],_0x322386,_0x5247c0)[_0x3670('0x18')](respondWithFilteredResult(_0x49cea5,_0x322386))[_0x3670('0x27')](handleError(_0x49cea5,null));};exports[_0x3670('0x28')]=function(_0x451deb,_0x5e388a){var _0x3a9c9a={'raw':![],'where':{'id':_0x451deb[_0x3670('0x29')]['id']}},_0x459860={};_0x459860[_0x3670('0x2a')]=_[_0x3670('0x2b')](db[_0x3670('0x1f')]['rawAttributes']);_0x459860[_0x3670('0x25')]=_[_0x3670('0x2b')](_0x451deb['query']);_0x459860[_0x3670('0x2c')]=_[_0x3670('0x2d')](_0x459860[_0x3670('0x2a')],_0x459860[_0x3670('0x25')]);_0x3a9c9a[_0x3670('0x2e')]=_[_0x3670('0x2d')](_0x459860[_0x3670('0x2a')],qs[_0x3670('0x2f')](_0x451deb[_0x3670('0x25')][_0x3670('0x2f')]));_0x3a9c9a['attributes']=_0x3a9c9a['attributes'][_0x3670('0x30')]?_0x3a9c9a[_0x3670('0x2e')]:_0x459860[_0x3670('0x2a')];if(_0x451deb['query']['includeAll']){_0x3a9c9a[_0x3670('0x31')]=[{'all':!![]}];}_0x3a9c9a=_[_0x3670('0x32')]({},_0x3a9c9a,_0x451deb[_0x3670('0x33')]);return db[_0x3670('0x1f')]['find'](_0x3a9c9a)[_0x3670('0x18')](handleEntityNotFound(_0x5e388a,null))[_0x3670('0x18')](respondWithResult(_0x5e388a,null))[_0x3670('0x27')](handleError(_0x5e388a,null));};exports[_0x3670('0x34')]=function(_0x2495e8,_0x491601){return db[_0x3670('0x1f')][_0x3670('0x34')](_0x2495e8[_0x3670('0x35')],{})[_0x3670('0x18')](respondWithResult(_0x491601,0xc9))[_0x3670('0x27')](handleError(_0x491601,null));};exports['update']=function(_0xdd0aa4,_0xdf3408){if(_0xdd0aa4[_0x3670('0x35')]['id']){delete _0xdd0aa4[_0x3670('0x35')]['id'];}return db[_0x3670('0x1f')][_0x3670('0x36')]({'where':{'id':_0xdd0aa4['params']['id']}})[_0x3670('0x18')](handleEntityNotFound(_0xdf3408,null))[_0x3670('0x18')](saveUpdates(_0xdd0aa4[_0x3670('0x35')],null))['then'](respondWithResult(_0xdf3408,null))[_0x3670('0x27')](handleError(_0xdf3408,null));};exports[_0x3670('0x37')]=function(_0x7fe5f4,_0x662382){return db['WhatsappInteraction'][_0x3670('0x36')]({'where':{'id':_0x7fe5f4[_0x3670('0x29')]['id']}})['then'](handleEntityNotFound(_0x662382,null))[_0x3670('0x18')](removeEntity(_0x662382,null))['catch'](handleError(_0x662382,null));};exports[_0x3670('0x38')]=function(_0x147501,_0x56eeee){return db['WhatsappInteraction'][_0x3670('0x38')]()[_0x3670('0x18')](respondWithResult(_0x56eeee,null))['catch'](handleError(_0x56eeee,null));};exports[_0x3670('0x39')]=function(_0xd261ef,_0x21326d){return db[_0x3670('0x3a')][_0x3670('0x36')]({'where':{'id':_0xd261ef[_0x3670('0x29')]['id']}})[_0x3670('0x18')](handleEntityNotFound(_0x21326d,null))[_0x3670('0x18')](function(_0x4b45dd){if(_0x4b45dd){return _0x4b45dd[_0x3670('0x39')](_0xd261ef[_0x3670('0x35')][_0x3670('0x3b')],_[_0x3670('0x3c')](_0xd261ef[_0x3670('0x35')],[_0x3670('0x3b'),'id'])||{});}})[_0x3670('0x18')](respondWithResult(_0x21326d,null))['catch'](handleError(_0x21326d,null));};exports[_0x3670('0x3d')]=function(_0x806447,_0x214420){var _0x9223e9={'raw':![],'where':{}};var _0x49557a={};var _0x8e634={'count':0x0,'rows':[]};return db[_0x3670('0x1f')][_0x3670('0x3e')]({'where':{'id':_0x806447['params']['id']}})['then'](handleEntityNotFound(_0x214420,null))[_0x3670('0x18')](function(_0x39934e){if(_0x39934e){_0x49557a[_0x3670('0x2a')]=_[_0x3670('0x2b')](db[_0x3670('0x3a')][_0x3670('0x20')]);_0x49557a[_0x3670('0x25')]=_[_0x3670('0x2b')](_0x806447['query']);_0x49557a['filters']=_[_0x3670('0x2d')](_0x49557a[_0x3670('0x2a')],_0x49557a[_0x3670('0x25')]);_0x9223e9[_0x3670('0x2e')]=_[_0x3670('0x2d')](_0x49557a['model'],qs[_0x3670('0x2f')](_0x806447[_0x3670('0x25')]['fields']));_0x9223e9[_0x3670('0x2e')]=_0x9223e9[_0x3670('0x2e')][_0x3670('0x30')]?_0x9223e9[_0x3670('0x2e')]:_0x49557a[_0x3670('0x2a')];if(!_0x806447['query'][_0x3670('0x3f')](_0x3670('0x40'))){_0x9223e9[_0x3670('0x14')]=qs[_0x3670('0x14')](_0x806447[_0x3670('0x25')]['limit']);_0x9223e9[_0x3670('0x13')]=qs[_0x3670('0x13')](_0x806447[_0x3670('0x25')][_0x3670('0x13')]);}_0x9223e9[_0x3670('0x41')]=qs[_0x3670('0x42')](_0x806447[_0x3670('0x25')][_0x3670('0x42')]);_0x9223e9[_0x3670('0x43')]=qs[_0x3670('0x2c')](_['pick'](_0x806447[_0x3670('0x25')],_0x49557a[_0x3670('0x2c')]));_0x9223e9['where'][_0x3670('0x44')]=_0x39934e['id'];if(_0x806447[_0x3670('0x25')][_0x3670('0x45')]){_0x9223e9[_0x3670('0x43')]=_['merge'](_0x9223e9['where'],{'$or':_[_0x3670('0x46')](_0x9223e9[_0x3670('0x2e')],function(_0x5a2186){var _0xc6da4={};_0xc6da4[_0x5a2186]={'$like':'%'+_0x806447[_0x3670('0x25')]['filter']+'%'};return _0xc6da4;})});}if(_0x806447[_0x3670('0x25')]['$gte']){var _0x34c757=_0x806447[_0x3670('0x25')]['$gte'][_0x3670('0x47')](',');var _0x3a6d2d={};_0x3a6d2d[_0x34c757[0x0]]={'$gte':moment(_0x34c757[0x1])[_0x3670('0x48')](_0x3670('0x49'))};_0x9223e9[_0x3670('0x43')]=_['merge'](_0x9223e9['where'],_0x3a6d2d);}_0x9223e9=_[_0x3670('0x32')]({},_0x9223e9,_0x806447[_0x3670('0x33')]);return db['WhatsappMessage'][_0x3670('0x16')]({'where':_0x9223e9[_0x3670('0x43')]})[_0x3670('0x18')](function(_0x323317){_0x8e634[_0x3670('0x16')]=_0x323317;if(_0x806447[_0x3670('0x25')][_0x3670('0x4a')]){_0x9223e9[_0x3670('0x31')]=[{'all':!![]}];}return db[_0x3670('0x3a')]['findAll'](_0x9223e9);})[_0x3670('0x18')](function(_0x5d66a8){_0x8e634[_0x3670('0x4b')]=_0x5d66a8;return _0x8e634;});}})['then'](respondWithFilteredResult(_0x214420,_0x9223e9))[_0x3670('0x27')](handleError(_0x214420,null));};exports[_0x3670('0x4c')]=function(_0x4de383,_0x113a79){return db[_0x3670('0x1f')][_0x3670('0x36')]({'where':{'id':_0x4de383[_0x3670('0x29')]['id']}})['then'](handleEntityNotFound(_0x113a79,null))[_0x3670('0x18')](function(_0x256ae1){if(_0x256ae1){return _0x256ae1[_0x3670('0x4d')](_0x4de383[_0x3670('0x35')]['ids'],_['omit'](_0x4de383[_0x3670('0x35')],[_0x3670('0x3b'),'id'])||{})[_0x3670('0x4e')](function(){return db[_0x3670('0x4f')][_0x3670('0x50')]({'attributes':['id','name',_0x3670('0x51')],'where':{'id':_0x4de383[_0x3670('0x35')][_0x3670('0x3b')]}});})[_0x3670('0x18')](function(_0xd97ece){socket['emit'](_0x3670('0x52'),{'id':Number(_0x4de383[_0x3670('0x29')]['id']),'tags':_0xd97ece||[]});return{'id':Number(_0x4de383[_0x3670('0x29')]['id']),'tags':_0xd97ece||[]};});}})[_0x3670('0x18')](respondWithResult(_0x113a79,null))[_0x3670('0x27')](handleError(_0x113a79,null));};exports['removeTags']=function(_0x5f2a5a,_0x322bdd){return db[_0x3670('0x1f')][_0x3670('0x36')]({'where':{'id':_0x5f2a5a['params']['id']}})[_0x3670('0x18')](handleEntityNotFound(_0x322bdd,null))[_0x3670('0x18')](function(_0x2fdc0c){if(_0x2fdc0c){return _0x2fdc0c['removeTags'](_0x5f2a5a[_0x3670('0x25')][_0x3670('0x3b')]);}})['then'](respondWithStatusCode(_0x322bdd,null))['catch'](handleError(_0x322bdd,null));};exports[_0x3670('0x53')]=function(_0x581f4f,_0x25e9cb){var _0x1c9d25=moment()[_0x3670('0x54')]()[_0x3670('0x55')]();var _0x5166e7=path[_0x3670('0x56')](config[_0x3670('0x57')],_0x3670('0x58'),_0x3670('0x59'),'tmp');var _0x4da319=path['join'](config[_0x3670('0x57')],_0x3670('0x58'),_0x3670('0x59'),'attachments');var _0x5e47ac=path[_0x3670('0x56')](_0x5166e7,_0x1c9d25);var _0x4d6efc=util[_0x3670('0x48')]('transcript-%d-%s.zip',_0x581f4f[_0x3670('0x29')]['id'],_0x1c9d25);var _0x491b32=path[_0x3670('0x56')](_0x5166e7,_0x4d6efc);var _0x14e50e=[];_0x14e50e[_0x3670('0x5a')]({'model':db['User'],'as':_0x3670('0x5b'),'attributes':['id',_0x3670('0x5c')],'raw':!![]});_0x14e50e[_0x3670('0x5a')]({'model':db['CmContact'],'as':_0x3670('0x5d'),'attributes':['id',_0x3670('0x5e'),_0x3670('0x5f')],'raw':!![]});if(_0x581f4f['query']['attachments']){_0x14e50e['push']({'model':db[_0x3670('0x60')],'as':_0x3670('0x60'),'raw':!![]});}var _0x44f100=[{'model':db[_0x3670('0x3a')],'as':_0x3670('0x61'),'attributes':['id','body',_0x3670('0x62'),_0x3670('0x63'),_0x3670('0x64'),_0x3670('0x65')],'include':_0x14e50e}];_0x44f100[_0x3670('0x5a')]({'model':db[_0x3670('0x66')],'as':'Account','attributes':['id','name']});_0x44f100[_0x3670('0x5a')]({'model':db[_0x3670('0x5b')],'as':_0x3670('0x67'),'attributes':['id',_0x3670('0x5c')]});return db[_0x3670('0x1f')][_0x3670('0x36')]({'where':{'id':_0x581f4f[_0x3670('0x29')]['id']},'include':_0x44f100})[_0x3670('0x18')](handleEntityNotFound(_0x25e9cb,null))[_0x3670('0x18')](function(_0x1cd7cd){if(_0x1cd7cd){var _0x48751f=_0x1cd7cd[_0x3670('0x68')]({'plain':!![]});fs[_0x3670('0x69')](_0x5e47ac);var _0x480225={'channel':'Whatsapp','account':_0x48751f[_0x3670('0x6a')][_0x3670('0x1c')],'agent':_0x48751f[_0x3670('0x67')]?_0x48751f[_0x3670('0x67')][_0x3670('0x5c')]:_0x3670('0x6b'),'createdAt':moment(_0x48751f[_0x3670('0x62')])[_0x3670('0x48')](_0x3670('0x49'))[_0x3670('0x55')](),'closedAt':_0x48751f['closed']?moment(_0x48751f[_0x3670('0x6c')])[_0x3670('0x48')](_0x3670('0x49'))[_0x3670('0x55')]():'','disposition':_0x48751f['disposition'],'messages':_(_0x48751f[_0x3670('0x61')])[_0x3670('0x45')]({'secret':![]})[_0x3670('0x46')](function(_0x2579cd){if(_0x2579cd[_0x3670('0x60')]){var _0x2db2cd=path[_0x3670('0x56')](_0x4da319,_0x2579cd['Attachment'][_0x3670('0x6d')]);if(fs['existsSync'](_0x2db2cd)){fs[_0x3670('0x6e')](_0x2db2cd)[_0x3670('0x6f')](fs[_0x3670('0x70')](path[_0x3670('0x56')](_0x5e47ac,_0x2579cd[_0x3670('0x60')]['basename'])));}}return{'date':moment(_0x2579cd['createdAt'])[_0x3670('0x48')](_0x3670('0x49'))[_0x3670('0x55')](),'sender':_0x2579cd[_0x3670('0x63')]===_0x3670('0x71')?_0x2579cd['User']?_0x2579cd['User'][_0x3670('0x5c')]:'System':_0x2579cd['Contact'][_0x3670('0x5e')]+(_0x2579cd['Contact'][_0x3670('0x5f')]?'\x20'+_0x2579cd[_0x3670('0x5d')][_0x3670('0x5f')]:''),'body':_0x2579cd[_0x3670('0x60')]?_0x2579cd[_0x3670('0x60')][_0x3670('0x6d')]:_0x2579cd[_0x3670('0x35')],'direction':_0x2579cd[_0x3670('0x63')]===_0x3670('0x71')?'A':'C','secret':_0x2579cd[_0x3670('0x64')],'read':_0x2579cd[_0x3670('0x65')],'attachment':_0x2579cd[_0x3670('0x60')]};})['value']()};return ejs[_0x3670('0x72')](path[_0x3670('0x56')](config[_0x3670('0x57')],_0x3670('0x58'),_0x3670('0x73'),_0x3670('0x74')),{'interaction':_0x480225})['then'](function(_0x47c473){var _0x86f6b=path[_0x3670('0x56')](_0x5e47ac,_0x3670('0x75')+_0x48751f['id']+'-'+_0x1c9d25+_0x3670('0x76'));var _0x28ca5e={'path':_0x86f6b,'channel':_0x3670('0x77'),'interactionId':_0x48751f['id']};return pdf[_0x3670('0x78')](_0x47c473,_0x28ca5e);})[_0x3670('0x18')](function(){return new BPromise(function(_0x3db7b1,_0x354e0d){zipdir(_0x5e47ac,{'saveTo':_0x491b32},function(_0x2b7a22,_0xbbd793){if(_0x2b7a22)return _0x354e0d(_0x2b7a22);return _0x3db7b1(_0xbbd793);});})[_0x3670('0x18')](function(){return new BPromise(function(_0x355383,_0x50b612){rimraf(_0x5e47ac,function(_0x32e861){if(_0x32e861)_0x50b612(_0x32e861);return _0x355383();});});})[_0x3670('0x18')](function(){return _0x25e9cb['download'](_0x491b32,_0x4d6efc,function(_0xa294e4){if(_0xa294e4){console[_0x3670('0x79')]('err',_0xa294e4);}else{fs[_0x3670('0x7a')](_0x491b32);}});});});}else{return _0x25e9cb[_0x3670('0x19')](0xc8);}})[_0x3670('0x27')](handleError(_0x25e9cb,null));}; \ No newline at end of file +var _0x1834=['user','catch','show','params','keys','WhatsappInteraction','query','filters','intersection','model','attributes','fields','includeAll','include','merge','options','find','create','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','map','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName','push','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','toString','closed','closedAt','disposition','basename','createReadStream','pipe','System','lastName','out','secret','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','name','send','index','rawAttributes','type','key','findAll'];(function(_0x2b7b7f,_0x25352e){var _0x3a3abb=function(_0x276941){while(--_0x276941){_0x2b7b7f['push'](_0x2b7b7f['shift']());}};_0x3a3abb(++_0x25352e);}(_0x1834,0x1c9));var _0x4183=function(_0x40cdfa,_0x1cf634){_0x40cdfa=_0x40cdfa-0x0;var _0x2c5e4d=_0x1834[_0x40cdfa];return _0x2c5e4d;};'use strict';var rimraf=require(_0x4183('0x0'));var zipdir=require(_0x4183('0x1'));var moment=require(_0x4183('0x2'));var BPromise=require(_0x4183('0x3'));var util=require(_0x4183('0x4'));var path=require(_0x4183('0x5'));var ejs=require(_0x4183('0x6'));var fs=require('fs');var _=require(_0x4183('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x4183('0x8'));var pdf=require(_0x4183('0x9'));var logger=require('../../config/logger')(_0x4183('0xa'));var config=require(_0x4183('0xb'));var db=require(_0x4183('0xc'))['db'];config[_0x4183('0xd')]=_[_0x4183('0xe')](config[_0x4183('0xd')],{'host':_0x4183('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4183('0xd')]));require(_0x4183('0x10'))[_0x4183('0x11')](socket);function respondWithStatusCode(_0x1dbcda,_0x18a24a){_0x18a24a=_0x18a24a||0xcc;return function(_0x50249b){if(_0x50249b){return _0x1dbcda[_0x4183('0x12')](_0x18a24a);}return _0x1dbcda[_0x4183('0x13')](_0x18a24a)[_0x4183('0x14')]();};}function respondWithResult(_0x2dbe02,_0x4f0732){_0x4f0732=_0x4f0732||0xc8;return function(_0x482583){if(_0x482583){return _0x2dbe02[_0x4183('0x13')](_0x4f0732)['json'](_0x482583);}};}function respondWithFilteredResult(_0x8cdbfe,_0x2053e3){return function(_0x4a2f9a){if(_0x4a2f9a){var _0x3e853c=typeof _0x2053e3[_0x4183('0x15')]==='undefined'&&typeof _0x2053e3['limit']===_0x4183('0x16');var _0x241e9e=_0x4a2f9a[_0x4183('0x17')];var _0x1e8946=_0x3e853c?0x0:_0x2053e3['offset'];var _0x3c5034=_0x3e853c?_0x4a2f9a['count']:_0x2053e3[_0x4183('0x15')]+_0x2053e3[_0x4183('0x18')];var _0x249e45;if(_0x3c5034>=_0x241e9e){_0x3c5034=_0x241e9e;_0x249e45=0xc8;}else{_0x249e45=0xce;}_0x8cdbfe[_0x4183('0x13')](_0x249e45);return _0x8cdbfe[_0x4183('0x19')](_0x4183('0x1a'),_0x1e8946+'-'+_0x3c5034+'/'+_0x241e9e)[_0x4183('0x1b')](_0x4a2f9a);}return null;};}function saveUpdates(_0x3f1ec1){return function(_0xb179a0){if(_0xb179a0){return _0xb179a0[_0x4183('0x1c')](_0x3f1ec1)[_0x4183('0x1d')](function(_0x58424d){return _0x58424d;});}return null;};}function removeEntity(_0xa5f172){return function(_0x16439e){if(_0x16439e){return _0x16439e[_0x4183('0x1e')]()[_0x4183('0x1d')](function(){_0xa5f172[_0x4183('0x13')](0xcc)[_0x4183('0x14')]();});}};}function handleEntityNotFound(_0x4497b8){return function(_0x327cf3){if(!_0x327cf3){_0x4497b8[_0x4183('0x12')](0x194);}return _0x327cf3;};}function handleError(_0x181d0b,_0x368f9e){_0x368f9e=_0x368f9e||0x1f4;return function(_0x59b9ca){logger[_0x4183('0x1f')](_0x59b9ca['stack']);if(_0x59b9ca[_0x4183('0x20')]){delete _0x59b9ca[_0x4183('0x20')];}_0x181d0b[_0x4183('0x13')](_0x368f9e)[_0x4183('0x21')](_0x59b9ca);};}exports[_0x4183('0x22')]=function(_0x1ac8bf,_0x31ec9d){var _0x4c3533={};var _0x3ade4e=_['map'](db['WhatsappInteraction'][_0x4183('0x23')],function(_0x337ec4){return{'name':_0x337ec4['fieldName'],'type':_0x337ec4[_0x4183('0x24')][_0x4183('0x25')]};});_0x4c3533=qs['getOptions'](_0x3ade4e,_0x1ac8bf);return interaction[_0x4183('0x26')]('whatsapp',_0x1ac8bf['query'],_0x1ac8bf[_0x4183('0x27')],_0x4c3533,_0x3ade4e)['then'](respondWithFilteredResult(_0x31ec9d,_0x4c3533))[_0x4183('0x28')](handleError(_0x31ec9d,null));};exports[_0x4183('0x29')]=function(_0x2489b7,_0x548c14){var _0x15fd63={'raw':![],'where':{'id':_0x2489b7[_0x4183('0x2a')]['id']}},_0x8f0461={};_0x8f0461['model']=_[_0x4183('0x2b')](db[_0x4183('0x2c')][_0x4183('0x23')]);_0x8f0461[_0x4183('0x2d')]=_[_0x4183('0x2b')](_0x2489b7['query']);_0x8f0461[_0x4183('0x2e')]=_[_0x4183('0x2f')](_0x8f0461[_0x4183('0x30')],_0x8f0461[_0x4183('0x2d')]);_0x15fd63[_0x4183('0x31')]=_[_0x4183('0x2f')](_0x8f0461[_0x4183('0x30')],qs['fields'](_0x2489b7[_0x4183('0x2d')][_0x4183('0x32')]));_0x15fd63[_0x4183('0x31')]=_0x15fd63['attributes']['length']?_0x15fd63['attributes']:_0x8f0461[_0x4183('0x30')];if(_0x2489b7[_0x4183('0x2d')][_0x4183('0x33')]){_0x15fd63[_0x4183('0x34')]=[{'all':!![]}];}_0x15fd63=_[_0x4183('0x35')]({},_0x15fd63,_0x2489b7[_0x4183('0x36')]);return db[_0x4183('0x2c')][_0x4183('0x37')](_0x15fd63)[_0x4183('0x1d')](handleEntityNotFound(_0x548c14,null))['then'](respondWithResult(_0x548c14,null))[_0x4183('0x28')](handleError(_0x548c14,null));};exports[_0x4183('0x38')]=function(_0x54ac18,_0x451560){return db['WhatsappInteraction']['create'](_0x54ac18[_0x4183('0x39')],{})['then'](respondWithResult(_0x451560,0xc9))[_0x4183('0x28')](handleError(_0x451560,null));};exports[_0x4183('0x1c')]=function(_0x448957,_0x273c8b){if(_0x448957[_0x4183('0x39')]['id']){delete _0x448957[_0x4183('0x39')]['id'];}return db[_0x4183('0x2c')][_0x4183('0x37')]({'where':{'id':_0x448957['params']['id']}})[_0x4183('0x1d')](handleEntityNotFound(_0x273c8b,null))[_0x4183('0x1d')](saveUpdates(_0x448957[_0x4183('0x39')],null))[_0x4183('0x1d')](respondWithResult(_0x273c8b,null))[_0x4183('0x28')](handleError(_0x273c8b,null));};exports['destroy']=function(_0x4ff6e9,_0x8243c3){return db['WhatsappInteraction'][_0x4183('0x37')]({'where':{'id':_0x4ff6e9[_0x4183('0x2a')]['id']}})[_0x4183('0x1d')](handleEntityNotFound(_0x8243c3,null))[_0x4183('0x1d')](removeEntity(_0x8243c3,null))[_0x4183('0x28')](handleError(_0x8243c3,null));};exports[_0x4183('0x3a')]=function(_0x5e5ab6,_0x403ac2){return db['WhatsappInteraction'][_0x4183('0x3a')]()[_0x4183('0x1d')](respondWithResult(_0x403ac2,null))[_0x4183('0x28')](handleError(_0x403ac2,null));};exports[_0x4183('0x3b')]=function(_0x5f3125,_0x82572e){return db[_0x4183('0x3c')][_0x4183('0x37')]({'where':{'id':_0x5f3125[_0x4183('0x2a')]['id']}})['then'](handleEntityNotFound(_0x82572e,null))[_0x4183('0x1d')](function(_0x229a3c){if(_0x229a3c){return _0x229a3c['addMessage'](_0x5f3125['body'][_0x4183('0x3d')],_[_0x4183('0x3e')](_0x5f3125[_0x4183('0x39')],[_0x4183('0x3d'),'id'])||{});}})[_0x4183('0x1d')](respondWithResult(_0x82572e,null))[_0x4183('0x28')](handleError(_0x82572e,null));};exports[_0x4183('0x3f')]=function(_0x1426fc,_0x3334dd){var _0x468132={'raw':![],'where':{}};var _0x289935={};var _0x3a738b={'count':0x0,'rows':[]};return db[_0x4183('0x2c')]['findOne']({'where':{'id':_0x1426fc['params']['id']}})[_0x4183('0x1d')](handleEntityNotFound(_0x3334dd,null))[_0x4183('0x1d')](function(_0x38ddc6){if(_0x38ddc6){_0x289935[_0x4183('0x30')]=_[_0x4183('0x2b')](db['WhatsappMessage'][_0x4183('0x23')]);_0x289935[_0x4183('0x2d')]=_[_0x4183('0x2b')](_0x1426fc[_0x4183('0x2d')]);_0x289935[_0x4183('0x2e')]=_['intersection'](_0x289935[_0x4183('0x30')],_0x289935[_0x4183('0x2d')]);_0x468132['attributes']=_[_0x4183('0x2f')](_0x289935[_0x4183('0x30')],qs[_0x4183('0x32')](_0x1426fc[_0x4183('0x2d')][_0x4183('0x32')]));_0x468132[_0x4183('0x31')]=_0x468132['attributes']['length']?_0x468132[_0x4183('0x31')]:_0x289935['model'];if(!_0x1426fc[_0x4183('0x2d')][_0x4183('0x40')](_0x4183('0x41'))){_0x468132[_0x4183('0x18')]=qs[_0x4183('0x18')](_0x1426fc[_0x4183('0x2d')][_0x4183('0x18')]);_0x468132['offset']=qs[_0x4183('0x15')](_0x1426fc[_0x4183('0x2d')][_0x4183('0x15')]);}_0x468132[_0x4183('0x42')]=qs[_0x4183('0x43')](_0x1426fc[_0x4183('0x2d')][_0x4183('0x43')]);_0x468132['where']=qs[_0x4183('0x2e')](_[_0x4183('0x44')](_0x1426fc[_0x4183('0x2d')],_0x289935[_0x4183('0x2e')]));_0x468132[_0x4183('0x45')]['WhatsappInteractionId']=_0x38ddc6['id'];if(_0x1426fc['query']['filter']){_0x468132[_0x4183('0x45')]=_[_0x4183('0x35')](_0x468132[_0x4183('0x45')],{'$or':_[_0x4183('0x46')](_0x468132['attributes'],function(_0x8e060a){var _0x925a09={};_0x925a09[_0x8e060a]={'$like':'%'+_0x1426fc[_0x4183('0x2d')][_0x4183('0x47')]+'%'};return _0x925a09;})});}if(_0x1426fc[_0x4183('0x2d')][_0x4183('0x48')]){var _0x187216=_0x1426fc[_0x4183('0x2d')][_0x4183('0x48')]['split'](',');var _0x58b056={};_0x58b056[_0x187216[0x0]]={'$gte':moment(_0x187216[0x1])[_0x4183('0x49')](_0x4183('0x4a'))};_0x468132['where']=_[_0x4183('0x35')](_0x468132[_0x4183('0x45')],_0x58b056);}_0x468132=_[_0x4183('0x35')]({},_0x468132,_0x1426fc[_0x4183('0x36')]);return db[_0x4183('0x3c')]['count']({'where':_0x468132[_0x4183('0x45')]})[_0x4183('0x1d')](function(_0x30804a){_0x3a738b[_0x4183('0x17')]=_0x30804a;if(_0x1426fc[_0x4183('0x2d')][_0x4183('0x33')]){_0x468132[_0x4183('0x34')]=[{'all':!![]}];}return db[_0x4183('0x3c')]['findAll'](_0x468132);})['then'](function(_0x1b1d3c){_0x3a738b[_0x4183('0x4b')]=_0x1b1d3c;return _0x3a738b;});}})[_0x4183('0x1d')](respondWithFilteredResult(_0x3334dd,_0x468132))[_0x4183('0x28')](handleError(_0x3334dd,null));};exports[_0x4183('0x4c')]=function(_0x2a95b1,_0x55d778){return db[_0x4183('0x2c')]['find']({'where':{'id':_0x2a95b1[_0x4183('0x2a')]['id']}})[_0x4183('0x1d')](handleEntityNotFound(_0x55d778,null))[_0x4183('0x1d')](function(_0x422cb5){if(_0x422cb5){return _0x422cb5[_0x4183('0x4d')](_0x2a95b1[_0x4183('0x39')][_0x4183('0x3d')],_[_0x4183('0x3e')](_0x2a95b1[_0x4183('0x39')],[_0x4183('0x3d'),'id'])||{})['spread'](function(){return db[_0x4183('0x4e')][_0x4183('0x26')]({'attributes':['id',_0x4183('0x20'),'color'],'where':{'id':_0x2a95b1[_0x4183('0x39')][_0x4183('0x3d')]}});})[_0x4183('0x1d')](function(_0x4f4756){socket['emit'](_0x4183('0x4f'),{'id':Number(_0x2a95b1[_0x4183('0x2a')]['id']),'tags':_0x4f4756||[]});return{'id':Number(_0x2a95b1['params']['id']),'tags':_0x4f4756||[]};});}})[_0x4183('0x1d')](respondWithResult(_0x55d778,null))['catch'](handleError(_0x55d778,null));};exports[_0x4183('0x50')]=function(_0x4a9d0d,_0x14e2d9){return db[_0x4183('0x2c')][_0x4183('0x37')]({'where':{'id':_0x4a9d0d[_0x4183('0x2a')]['id']}})['then'](handleEntityNotFound(_0x14e2d9,null))[_0x4183('0x1d')](function(_0x3b4dcf){if(_0x3b4dcf){return _0x3b4dcf[_0x4183('0x50')](_0x4a9d0d['query'][_0x4183('0x3d')]);}})[_0x4183('0x1d')](respondWithStatusCode(_0x14e2d9,null))[_0x4183('0x28')](handleError(_0x14e2d9,null));};exports[_0x4183('0x51')]=function(_0x3e5733,_0x593e04){var _0xdd4280=moment()[_0x4183('0x52')]()['toString']();var _0x81a2bb=path[_0x4183('0x53')](config[_0x4183('0x54')],_0x4183('0x55'),_0x4183('0x56'),_0x4183('0x57'));var _0x98cddc=path['join'](config[_0x4183('0x54')],_0x4183('0x55'),_0x4183('0x56'),'attachments');var _0x492f91=path['join'](_0x81a2bb,_0xdd4280);var _0x4a80c1=util[_0x4183('0x49')](_0x4183('0x58'),_0x3e5733[_0x4183('0x2a')]['id'],_0xdd4280);var _0x422018=path['join'](_0x81a2bb,_0x4a80c1);var _0x64bd2e=[];_0x64bd2e['push']({'model':db[_0x4183('0x59')],'as':_0x4183('0x59'),'attributes':['id',_0x4183('0x5a')],'raw':!![]});_0x64bd2e['push']({'model':db[_0x4183('0x5b')],'as':_0x4183('0x5c'),'attributes':['id',_0x4183('0x5d'),'lastName'],'raw':!![]});if(_0x3e5733[_0x4183('0x2d')]['attachments']){_0x64bd2e[_0x4183('0x5e')]({'model':db[_0x4183('0x5f')],'as':_0x4183('0x5f'),'raw':!![]});}var _0x264e3b=[{'model':db[_0x4183('0x3c')],'as':_0x4183('0x60'),'attributes':['id',_0x4183('0x39'),_0x4183('0x61'),_0x4183('0x62'),'secret',_0x4183('0x63')],'include':_0x64bd2e}];_0x264e3b[_0x4183('0x5e')]({'model':db[_0x4183('0x64')],'as':_0x4183('0x65'),'attributes':['id',_0x4183('0x20')]});_0x264e3b['push']({'model':db[_0x4183('0x59')],'as':_0x4183('0x66'),'attributes':['id',_0x4183('0x5a')]});return db['WhatsappInteraction'][_0x4183('0x37')]({'where':{'id':_0x3e5733['params']['id']},'include':_0x264e3b})['then'](handleEntityNotFound(_0x593e04,null))[_0x4183('0x1d')](function(_0x53c77d){if(_0x53c77d){var _0x431e82=_0x53c77d['get']({'plain':!![]});fs[_0x4183('0x67')](_0x492f91);var _0x2f83ef={'channel':_0x4183('0x68'),'account':_0x431e82[_0x4183('0x65')][_0x4183('0x20')],'agent':_0x431e82[_0x4183('0x66')]?_0x431e82[_0x4183('0x66')]['fullname']:_0x4183('0x69'),'createdAt':moment(_0x431e82[_0x4183('0x61')])['format'](_0x4183('0x4a'))[_0x4183('0x6a')](),'closedAt':_0x431e82[_0x4183('0x6b')]?moment(_0x431e82[_0x4183('0x6c')])[_0x4183('0x49')](_0x4183('0x4a'))[_0x4183('0x6a')]():'','disposition':_0x431e82[_0x4183('0x6d')],'messages':_(_0x431e82[_0x4183('0x60')])[_0x4183('0x47')]({'secret':![]})['map'](function(_0x36ed0e){if(_0x36ed0e[_0x4183('0x5f')]){var _0x42c955=path[_0x4183('0x53')](_0x98cddc,_0x36ed0e['Attachment'][_0x4183('0x6e')]);if(fs['existsSync'](_0x42c955)){fs[_0x4183('0x6f')](_0x42c955)[_0x4183('0x70')](fs['createWriteStream'](path['join'](_0x492f91,_0x36ed0e[_0x4183('0x5f')]['basename'])));}}return{'date':moment(_0x36ed0e[_0x4183('0x61')])['format'](_0x4183('0x4a'))[_0x4183('0x6a')](),'sender':_0x36ed0e[_0x4183('0x62')]==='out'?_0x36ed0e[_0x4183('0x59')]?_0x36ed0e[_0x4183('0x59')][_0x4183('0x5a')]:_0x4183('0x71'):_0x36ed0e['Contact']['firstName']+(_0x36ed0e['Contact'][_0x4183('0x72')]?'\x20'+_0x36ed0e[_0x4183('0x5c')][_0x4183('0x72')]:''),'body':_0x36ed0e['Attachment']?_0x36ed0e['Attachment'][_0x4183('0x6e')]:_0x36ed0e[_0x4183('0x39')],'direction':_0x36ed0e[_0x4183('0x62')]===_0x4183('0x73')?'A':'C','secret':_0x36ed0e[_0x4183('0x74')],'read':_0x36ed0e[_0x4183('0x63')],'attachment':_0x36ed0e[_0x4183('0x5f')]};})[_0x4183('0x75')]()};return ejs[_0x4183('0x76')](path['join'](config[_0x4183('0x54')],'server',_0x4183('0x77'),_0x4183('0x78')),{'interaction':_0x2f83ef})[_0x4183('0x1d')](function(_0x31452a){var _0x503f3b=path[_0x4183('0x53')](_0x492f91,'transcript-'+_0x431e82['id']+'-'+_0xdd4280+'.pdf');var _0x1cf291={'path':_0x503f3b,'channel':_0x4183('0x68'),'interactionId':_0x431e82['id']};return pdf[_0x4183('0x79')](_0x31452a,_0x1cf291);})[_0x4183('0x1d')](function(){return new BPromise(function(_0x59d4ec,_0x5726fe){zipdir(_0x492f91,{'saveTo':_0x422018},function(_0x407c81,_0x324c72){if(_0x407c81)return _0x5726fe(_0x407c81);return _0x59d4ec(_0x324c72);});})['then'](function(){return new BPromise(function(_0x112780,_0x59bf83){rimraf(_0x492f91,function(_0x2db512){if(_0x2db512)_0x59bf83(_0x2db512);return _0x112780();});});})[_0x4183('0x1d')](function(){return _0x593e04['download'](_0x422018,_0x4a80c1,function(_0x240c9e){if(_0x240c9e){console['log'](_0x4183('0x7a'),_0x240c9e);}else{fs[_0x4183('0x7b')](_0x422018);}});});});}else{return _0x593e04[_0x4183('0x12')](0xc8);}})[_0x4183('0x28')](handleError(_0x593e04,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index b7f8676..98b3c7b 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 _0x1bd1=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','then','setDataValue','Users','map','findAll'];(function(_0x407399,_0x3c5e62){var _0x25cb92=function(_0xa68abe){while(--_0xa68abe){_0x407399['push'](_0x407399['shift']());}};_0x25cb92(++_0x3c5e62);}(_0x1bd1,0x123));var _0x11bd=function(_0x4610da,_0x78197b){_0x4610da=_0x4610da-0x0;var _0x5e74de=_0x1bd1[_0x4610da];return _0x5e74de;};'use strict';var EventEmitter=require(_0x11bd('0x0'));var WhatsappInteraction=require(_0x11bd('0x1'))['db'][_0x11bd('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x11bd('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f41c3){return function(_0x31869a,_0x336fd5,_0x612ff3){_0x31869a['getUsers']({'attributes':['id'],'raw':!![]})[_0x11bd('0x4')](function(_0x1f813c){_0x31869a[_0x11bd('0x5')](_0x11bd('0x6'),_0x1f813c[_0x11bd('0x7')](function(_0x4e514c){return{'id':_0x4e514c['id']};}));return WhatsappMessage[_0x11bd('0x8')]({'where':{'WhatsappInteractionId':_0x31869a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4b3471){_0x31869a[_0x11bd('0x5')](_0x11bd('0x9'),_0x4b3471[_0x11bd('0xa')]);WhatsappInteractionEvents[_0x11bd('0xb')](_0x1f41c3+':'+_0x31869a['id'],_0x31869a);WhatsappInteractionEvents[_0x11bd('0xb')](_0x1f41c3,_0x31869a);_0x612ff3(null);})[_0x11bd('0xc')](_0x612ff3(null));};}for(var e in events){if(events[_0x11bd('0xd')](e)){var event=events[e];WhatsappInteraction[_0x11bd('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xeebe=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x489ae7,_0x51b46f){var _0x54d72b=function(_0x803a7e){while(--_0x803a7e){_0x489ae7['push'](_0x489ae7['shift']());}};_0x54d72b(++_0x51b46f);}(_0xeebe,0xff));var _0xeeeb=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xeebe[_0x2763f2];return _0x3ef471;};'use strict';var EventEmitter=require(_0xeeeb('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xeeeb('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0xeeeb('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xeeeb('0x3')](0x0);var events={'afterCreate':_0xeeeb('0x4'),'afterUpdate':_0xeeeb('0x5'),'afterDestroy':_0xeeeb('0x6')};function emitEvent(_0x33801b){return function(_0x24b63e,_0x1d5c27,_0x2b23eb){_0x24b63e[_0xeeeb('0x7')]({'attributes':['id'],'raw':!![]})[_0xeeeb('0x8')](function(_0x3083ab){_0x24b63e[_0xeeeb('0x9')](_0xeeeb('0xa'),_0x3083ab[_0xeeeb('0xb')](function(_0x263799){return{'id':_0x263799['id']};}));return WhatsappMessage[_0xeeeb('0xc')]({'where':{'WhatsappInteractionId':_0x24b63e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeeeb('0x8')](function(_0x4a1161){_0x24b63e['setDataValue'](_0xeeeb('0xd'),_0x4a1161[_0xeeeb('0xe')]);WhatsappInteractionEvents[_0xeeeb('0xf')](_0x33801b+':'+_0x24b63e['id'],_0x24b63e);WhatsappInteractionEvents['emit'](_0x33801b,_0x24b63e);_0x2b23eb(null);})[_0xeeeb('0x10')](_0x2b23eb(null));};}for(var e in events){if(events[_0xeeeb('0x11')](e)){var event=events[e];WhatsappInteraction[_0xeeeb('0x12')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 86fdd95..293d26b 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 _0xe3bb=['moment','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xe3bb,0x1bd));var _0xbe3b=function(_0x2ccbaf,_0x4a1c53){_0x2ccbaf=_0x2ccbaf-0x0;var _0x53a810=_0xe3bb[_0x2ccbaf];return _0x53a810;};'use strict';var _=require(_0xbe3b('0x0'));var util=require(_0xbe3b('0x1'));var logger=require('../../config/logger')(_0xbe3b('0x2'));var moment=require(_0xbe3b('0x3'));var BPromise=require(_0xbe3b('0x4'));var rp=require(_0xbe3b('0x5'));var fs=require('fs');var path=require(_0xbe3b('0x6'));var rimraf=require('rimraf');var config=require(_0xbe3b('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xbe3b('0x8')]=function(_0x25d2fa,_0x2d60b6){return _0x25d2fa[_0xbe3b('0x9')](_0xbe3b('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x290a6b,_0x4ce97d,_0x58aa22){if(_0x290a6b[_0xbe3b('0xb')](_0xbe3b('0xc'))){_0x290a6b['closedAt']=moment()['format'](_0xbe3b('0xd'));}_0x58aa22(null,_0x290a6b);}}});}; \ No newline at end of file +var _0x391e=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x391e,0x1cf));var _0xe391=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x391e[_0x403c20];return _0x2b271a;};'use strict';var _=require('lodash');var util=require(_0xe391('0x0'));var logger=require(_0xe391('0x1'))('api');var moment=require(_0xe391('0x2'));var BPromise=require(_0xe391('0x3'));var rp=require(_0xe391('0x4'));var fs=require('fs');var path=require(_0xe391('0x5'));var rimraf=require('rimraf');var config=require(_0xe391('0x6'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x829b25,_0x2282dc){return _0x829b25['define'](_0xe391('0x7'),attributes,{'tableName':_0xe391('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49b4eb,_0x3c6a0d,_0x330bcb){if(_0x49b4eb[_0xe391('0x9')](_0xe391('0xa'))){_0x49b4eb[_0xe391('0xb')]=moment()[_0xe391('0xc')](_0xe391('0xd'));}_0x330bcb(null,_0x49b4eb);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index e8c5276..7bae394 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 _0x5579=['ioredis','../../mysqldb','../../config/logger','rpc','http','redis','socket.io-emitter','register','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','then','stringify','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5579,0xb9));var _0x9557=function(_0xc20947,_0x27575b){_0xc20947=_0xc20947-0x0;var _0x169338=_0x5579[_0xc20947];return _0x169338;};'use strict';var _=require(_0x9557('0x0'));var util=require(_0x9557('0x1'));var moment=require(_0x9557('0x2'));var BPromise=require(_0x9557('0x3'));var rs=require(_0x9557('0x4'));var fs=require('fs');var Redis=require(_0x9557('0x5'));var db=require(_0x9557('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9557('0x7'))(_0x9557('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9557('0x9')]({'port':0x232a});config[_0x9557('0xa')]=_['defaults'](config[_0x9557('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9557('0xb'))(new Redis(config[_0x9557('0xa')]));require('./whatsappInteraction.socket')[_0x9557('0xc')](socket);function respondWithRpcPromise(_0xafa65c,_0x21a07b,_0xbc55a4){return new BPromise(function(_0x213246,_0x5be32e){return client['request'](_0xafa65c,_0xbc55a4)['then'](function(_0x2d205d){logger[_0x9557('0xd')](_0x9557('0xe'),_0x21a07b,'request\x20sent');logger[_0x9557('0xf')](_0x9557('0x10'),_0x21a07b,_0x9557('0x11'),JSON['stringify'](_0x2d205d));if(_0x2d205d[_0x9557('0x12')]){if(_0x2d205d['error'][_0x9557('0x13')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x21a07b,_0x2d205d['error']['message']);return _0x5be32e(_0x2d205d[_0x9557('0x12')]['message']);}logger[_0x9557('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x21a07b,_0x2d205d['error'][_0x9557('0x14')]);return _0x213246(_0x2d205d[_0x9557('0x12')]['message']);}else{logger['info'](_0x9557('0xe'),_0x21a07b,_0x9557('0x11'));_0x213246(_0x2d205d[_0x9557('0x15')]['message']);}})[_0x9557('0x16')](function(_0x3d6d76){logger[_0x9557('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x21a07b,_0x3d6d76);_0x5be32e(_0x3d6d76);});});}exports[_0x9557('0x17')]=function(_0x5b326b){var _0x3c5839=this;return new Promise(function(_0x1474cb,_0x247bad){return db[_0x9557('0x18')][_0x9557('0x19')](_0x5b326b[_0x9557('0x1a')],{'raw':_0x5b326b[_0x9557('0x1b')]?_0x5b326b[_0x9557('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b326b[_0x9557('0x1b')]?_0x5b326b[_0x9557('0x1b')][_0x9557('0x1c')]||null:null,'attributes':_0x5b326b['options']?_0x5b326b[_0x9557('0x1b')][_0x9557('0x1d')]||null:null,'limit':_0x5b326b[_0x9557('0x1b')]?_0x5b326b[_0x9557('0x1b')]['limit']||null:null})[_0x9557('0x1e')](function(_0x51eb3c){logger[_0x9557('0xd')]('UpdateWhatsappInteraction',_0x5b326b);logger['debug']('UpdateWhatsappInteraction',_0x5b326b,JSON[_0x9557('0x1f')](_0x51eb3c));_0x1474cb(_0x51eb3c);})['catch'](function(_0x1f7693){logger['error'](_0x9557('0x17'),_0x1f7693[_0x9557('0x14')],_0x5b326b);_0x247bad(_0x3c5839[_0x9557('0x12')](0x1f4,_0x1f7693[_0x9557('0x14')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x58e59f){return new Promise(function(_0x296736,_0x48c725){return db[_0x9557('0x18')][_0x9557('0x20')]({'where':_0x58e59f[_0x9557('0x1b')]?_0x58e59f[_0x9557('0x1b')]['where']||null:null})[_0x9557('0x1e')](function(_0x553d32){if(_0x553d32){return _0x553d32[_0x9557('0x21')](_0x58e59f[_0x9557('0x1a')][_0x9557('0x22')],_[_0x9557('0x23')](_0x58e59f[_0x9557('0x1a')],[_0x9557('0x22'),'id'])||{});}})[_0x9557('0x24')](function(_0x254325){logger[_0x9557('0xd')](_0x9557('0x25'),_0x58e59f);logger[_0x9557('0xf')](_0x9557('0x25'),_0x58e59f,JSON['stringify'](_0x254325));_0x296736(_0x254325);})[_0x9557('0x16')](function(_0x50ed1c){logger[_0x9557('0x12')]('AddTags',_0x50ed1c['message'],_0x58e59f);_0x48c725(_this[_0x9557('0x12')](0x1f4,_0x50ed1c[_0x9557('0x14')]));});});}; \ No newline at end of file +var _0xd45c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','stringify','WhatsappInteraction','find','addTags','ids','spread','AddTags'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0xd45c,0xc8));var _0xcd45=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd45c[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xcd45('0x0'));var moment=require(_0xcd45('0x1'));var BPromise=require(_0xcd45('0x2'));var rs=require(_0xcd45('0x3'));var fs=require('fs');var Redis=require(_0xcd45('0x4'));var db=require(_0xcd45('0x5'))['db'];var utils=require(_0xcd45('0x6'));var logger=require(_0xcd45('0x7'))(_0xcd45('0x8'));var config=require('../../config/environment');var jayson=require(_0xcd45('0x9'));var client=jayson[_0xcd45('0xa')][_0xcd45('0xb')]({'port':0x232a});config['redis']=_[_0xcd45('0xc')](config[_0xcd45('0xd')],{'host':_0xcd45('0xe'),'port':0x18eb});var socket=require(_0xcd45('0xf'))(new Redis(config[_0xcd45('0xd')]));require('./whatsappInteraction.socket')[_0xcd45('0x10')](socket);function respondWithRpcPromise(_0x1cacd2,_0x1b51d4,_0x192dd3){return new BPromise(function(_0x151047,_0x15ad21){return client['request'](_0x1cacd2,_0x192dd3)[_0xcd45('0x11')](function(_0x43a8e){logger[_0xcd45('0x12')](_0xcd45('0x13'),_0x1b51d4,_0xcd45('0x14'));logger[_0xcd45('0x15')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x1b51d4,'request\x20sent',JSON['stringify'](_0x43a8e));if(_0x43a8e[_0xcd45('0x16')]){if(_0x43a8e[_0xcd45('0x16')]['code']===0x1f4){logger[_0xcd45('0x16')](_0xcd45('0x13'),_0x1b51d4,_0x43a8e[_0xcd45('0x16')]['message']);return _0x15ad21(_0x43a8e[_0xcd45('0x16')]['message']);}logger[_0xcd45('0x16')](_0xcd45('0x13'),_0x1b51d4,_0x43a8e[_0xcd45('0x16')][_0xcd45('0x17')]);return _0x151047(_0x43a8e[_0xcd45('0x16')]['message']);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x1b51d4,'request\x20sent');_0x151047(_0x43a8e[_0xcd45('0x18')][_0xcd45('0x17')]);}})[_0xcd45('0x19')](function(_0x1b531f){logger[_0xcd45('0x16')](_0xcd45('0x13'),_0x1b51d4,_0x1b531f);_0x15ad21(_0x1b531f);});});}exports['UpdateWhatsappInteraction']=function(_0x1e8308){var _0x43f8c5=this;return new Promise(function(_0x410fd8,_0x1c900d){return db['WhatsappInteraction']['update'](_0x1e8308[_0xcd45('0x1a')],{'raw':_0x1e8308[_0xcd45('0x1b')]?_0x1e8308[_0xcd45('0x1b')][_0xcd45('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8308['options']?_0x1e8308['options'][_0xcd45('0x1d')]||null:null,'attributes':_0x1e8308[_0xcd45('0x1b')]?_0x1e8308[_0xcd45('0x1b')][_0xcd45('0x1e')]||null:null,'limit':_0x1e8308[_0xcd45('0x1b')]?_0x1e8308[_0xcd45('0x1b')][_0xcd45('0x1f')]||null:null})['then'](function(_0x4bd4e9){logger['info'](_0xcd45('0x20'),_0x1e8308);logger[_0xcd45('0x15')]('UpdateWhatsappInteraction',_0x1e8308,JSON[_0xcd45('0x21')](_0x4bd4e9));_0x410fd8(_0x4bd4e9);})[_0xcd45('0x19')](function(_0x10482e){logger[_0xcd45('0x16')](_0xcd45('0x20'),_0x10482e[_0xcd45('0x17')],_0x1e8308);_0x1c900d(_0x43f8c5['error'](0x1f4,_0x10482e[_0xcd45('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x9c23e5){return new Promise(function(_0xbada9d,_0x237f6c){return db[_0xcd45('0x22')][_0xcd45('0x23')]({'where':_0x9c23e5[_0xcd45('0x1b')]?_0x9c23e5['options'][_0xcd45('0x1d')]||null:null})[_0xcd45('0x11')](function(_0x5f0119){if(_0x5f0119){return _0x5f0119[_0xcd45('0x24')](_0x9c23e5[_0xcd45('0x1a')][_0xcd45('0x25')],_['omit'](_0x9c23e5[_0xcd45('0x1a')],[_0xcd45('0x25'),'id'])||{});}})[_0xcd45('0x26')](function(_0x48eddb){logger['info']('AddTags',_0x9c23e5);logger['debug'](_0xcd45('0x27'),_0x9c23e5,JSON[_0xcd45('0x21')](_0x48eddb));_0xbada9d(_0x48eddb);})[_0xcd45('0x19')](function(_0x41dd6a){logger['error'](_0xcd45('0x27'),_0x41dd6a[_0xcd45('0x17')],_0x9c23e5);_0x237f6c(_this[_0xcd45('0x16')](0x1f4,_0x41dd6a[_0xcd45('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ec8f69e..5840447 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 _0x490a=['remove','update','emit','removeListener','register','whatsappInteraction:','save'];(function(_0x2ddc4a,_0xdcf87){var _0x44bd44=function(_0x3e8b79){while(--_0x3e8b79){_0x2ddc4a['push'](_0x2ddc4a['shift']());}};_0x44bd44(++_0xdcf87);}(_0x490a,0x1bf));var _0xa490=function(_0x3e4e1f,_0x49b84e){_0x3e4e1f=_0x3e4e1f-0x0;var _0x6010a2=_0x490a[_0x3e4e1f];return _0x6010a2;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xa490('0x0'),_0xa490('0x1'),_0xa490('0x2')];function createListener(_0x476a7f,_0x55f677){return function(_0x28e283){_0x55f677[_0xa490('0x3')](_0x476a7f,_0x28e283);};}function removeListener(_0x70b434,_0x3ac070){return function(){WhatsappInteractionEvents[_0xa490('0x4')](_0x70b434,_0x3ac070);};}exports[_0xa490('0x5')]=function(_0x3a19eb){for(var _0x2dcec7=0x0,_0x1128c6=events['length'];_0x2dcec7<_0x1128c6;_0x2dcec7++){var _0x564e00=events[_0x2dcec7];var _0x1f96ce=createListener(_0xa490('0x6')+_0x564e00,_0x3a19eb);WhatsappInteractionEvents['on'](_0x564e00,_0x1f96ce);}}; \ No newline at end of file +var _0x712f=['length','save','remove','update','emit','register'];(function(_0x4258bd,_0xd25e80){var _0x1bc529=function(_0x302a82){while(--_0x302a82){_0x4258bd['push'](_0x4258bd['shift']());}};_0x1bc529(++_0xd25e80);}(_0x712f,0x151));var _0xf712=function(_0x481899,_0x1dd018){_0x481899=_0x481899-0x0;var _0x2bd7e5=_0x712f[_0x481899];return _0x2bd7e5;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xf712('0x0'),_0xf712('0x1'),_0xf712('0x2')];function createListener(_0x1f74e4,_0x25a915){return function(_0x4b52ad){_0x25a915[_0xf712('0x3')](_0x1f74e4,_0x4b52ad);};}function removeListener(_0x33b379,_0x4eeb63){return function(){WhatsappInteractionEvents['removeListener'](_0x33b379,_0x4eeb63);};}exports[_0xf712('0x4')]=function(_0x3c0189){for(var _0x23e87b=0x0,_0x544f80=events[_0xf712('0x5')];_0x23e87b<_0x544f80;_0x23e87b++){var _0x3fe95f=events[_0x23e87b];var _0x596d4f=createListener('whatsappInteraction:'+_0x3fe95f,_0x3c0189);WhatsappInteractionEvents['on'](_0x3fe95f,_0x596d4f);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d80ce8a..6ac65dd 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 _0xbcad=['create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked','whatsapp'];(function(_0x734080,_0x5715b6){var _0x4f957b=function(_0xa75ece){while(--_0xa75ece){_0x734080['push'](_0x734080['shift']());}};_0x4f957b(++_0x5715b6);}(_0xbcad,0x1cb));var _0xdbca=function(_0x3c14f6,_0x197a18){_0x3c14f6=_0x3c14f6-0x0;var _0x5edb2b=_0xbcad[_0x3c14f6];return _0x5edb2b;};'use strict';var multer=require(_0xdbca('0x0'));var util=require('util');var path=require(_0xdbca('0x1'));var timeout=require(_0xdbca('0x2'));var express=require(_0xdbca('0x3'));var router=express[_0xdbca('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdbca('0x5'));var config=require(_0xdbca('0x6'));var controller=require(_0xdbca('0x7'));router[_0xdbca('0x8')]('/',auth['isAuthenticated'](),controller[_0xdbca('0x9')]);router['get'](_0xdbca('0xa'),auth[_0xdbca('0xb')](),controller['describe']);router[_0xdbca('0x8')](_0xdbca('0xc'),auth[_0xdbca('0xb')](),controller[_0xdbca('0xd')]);router[_0xdbca('0xe')]('/',auth[_0xdbca('0xb')](),interaction[_0xdbca('0xf')](_0xdbca('0x10'),'whatsappmessage:create'),controller[_0xdbca('0x11')]);router[_0xdbca('0xe')](_0xdbca('0x12'),controller[_0xdbca('0x13')]);router[_0xdbca('0x14')]('/:id',auth[_0xdbca('0xb')](),controller[_0xdbca('0x15')]);router[_0xdbca('0x14')](_0xdbca('0x16'),auth[_0xdbca('0xb')](),controller['accept']);router[_0xdbca('0x14')](_0xdbca('0x17'),auth[_0xdbca('0xb')](),controller[_0xdbca('0x18')]);router[_0xdbca('0x19')](_0xdbca('0xc'),auth[_0xdbca('0xb')](),controller[_0xdbca('0x1a')]);module[_0xdbca('0x1b')]=router; \ No newline at end of file +var _0x832c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout'];(function(_0x2106e0,_0x57e335){var _0x22e4f0=function(_0x2b8ba8){while(--_0x2b8ba8){_0x2106e0['push'](_0x2106e0['shift']());}};_0x22e4f0(++_0x57e335);}(_0x832c,0x193));var _0xc832=function(_0x30802d,_0x133dad){_0x30802d=_0x30802d-0x0;var _0x448920=_0x832c[_0x30802d];return _0x448920;};'use strict';var multer=require('multer');var util=require(_0xc832('0x0'));var path=require(_0xc832('0x1'));var timeout=require(_0xc832('0x2'));var express=require(_0xc832('0x3'));var router=express[_0xc832('0x4')]();var fs_extra=require(_0xc832('0x5'));var auth=require(_0xc832('0x6'));var interaction=require(_0xc832('0x7'));var config=require(_0xc832('0x8'));var controller=require(_0xc832('0x9'));router[_0xc832('0xa')]('/',auth[_0xc832('0xb')](),controller['index']);router['get'](_0xc832('0xc'),auth[_0xc832('0xb')](),controller[_0xc832('0xd')]);router[_0xc832('0xa')](_0xc832('0xe'),auth['isAuthenticated'](),controller[_0xc832('0xf')]);router[_0xc832('0x10')]('/',auth[_0xc832('0xb')](),interaction[_0xc832('0x11')]('whatsapp',_0xc832('0x12')),controller['create']);router[_0xc832('0x10')](_0xc832('0x13'),controller[_0xc832('0x14')]);router[_0xc832('0x15')](_0xc832('0xe'),auth[_0xc832('0xb')](),controller[_0xc832('0x16')]);router['put'](_0xc832('0x17'),auth[_0xc832('0xb')](),controller[_0xc832('0x18')]);router[_0xc832('0x15')](_0xc832('0x19'),auth[_0xc832('0xb')](),controller[_0xc832('0x1a')]);router[_0xc832('0x1b')](_0xc832('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xc832('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 0217645..4262dfd 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 _0x31b9=['medium','BOOLEAN','ENUM','out','STRING','DATE','TEXT','sequelize','exports'];(function(_0x59d064,_0x3b191c){var _0x1d8f64=function(_0x5b8fe2){while(--_0x5b8fe2){_0x59d064['push'](_0x59d064['shift']());}};_0x1d8f64(++_0x3b191c);}(_0x31b9,0x7c));var _0x931b=function(_0x2a70cb,_0x9ca845){_0x2a70cb=_0x2a70cb-0x0;var _0x2d4cb6=_0x31b9[_0x2a70cb];return _0x2d4cb6;};'use strict';var Sequelize=require(_0x931b('0x0'));module[_0x931b('0x1')]={'body':{'type':Sequelize['TEXT'](_0x931b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x931b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x931b('0x4')]('in',_0x931b('0x5')),'defaultValue':_0x931b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x931b('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x931b('0x7')]},'secret':{'type':Sequelize[_0x931b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x931b('0x6')]},'providerResponse':{'type':Sequelize[_0x931b('0x8')]}}; \ No newline at end of file +var _0xa1db=['sequelize','exports','TEXT','medium','out','STRING','DATE','BOOLEAN'];(function(_0x2eade5,_0x5593b8){var _0x1e9966=function(_0x4c6612){while(--_0x4c6612){_0x2eade5['push'](_0x2eade5['shift']());}};_0x1e9966(++_0x5593b8);}(_0xa1db,0xb0));var _0xba1d=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0xa1db[_0xc14df7];return _0x34a445;};'use strict';var Sequelize=require(_0xba1d('0x0'));module[_0xba1d('0x1')]={'body':{'type':Sequelize[_0xba1d('0x2')](_0xba1d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xba1d('0x4')),'defaultValue':_0xba1d('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xba1d('0x5')]},'readAt':{'type':Sequelize[_0xba1d('0x6')]},'secret':{'type':Sequelize[_0xba1d('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xba1d('0x5')]},'providerResponse':{'type':Sequelize[_0xba1d('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 59a5f8e..f5cd9ba 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 _0x00f4=['rejectMessage','ContactId','sequelize','QueryTypes','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','destroy','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','name','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','role','null','RejectMessage'];(function(_0x139674,_0x1ca8d8){var _0x191caa=function(_0x10b31a){while(--_0x10b31a){_0x139674['push'](_0x139674['shift']());}};_0x191caa(++_0x1ca8d8);}(_0x00f4,0x12c));var _0x400f=function(_0x4d48f4,_0x2ce971){_0x4d48f4=_0x4d48f4-0x0;var _0x49ac77=_0x00f4[_0x4d48f4];return _0x49ac77;};'use strict';var emlformat=require(_0x400f('0x0'));var rimraf=require(_0x400f('0x1'));var zipdir=require(_0x400f('0x2'));var jsonpatch=require(_0x400f('0x3'));var rp=require(_0x400f('0x4'));var moment=require(_0x400f('0x5'));var BPromise=require(_0x400f('0x6'));var Mustache=require(_0x400f('0x7'));var util=require(_0x400f('0x8'));var path=require(_0x400f('0x9'));var sox=require(_0x400f('0xa'));var csv=require('to-csv');var ejs=require(_0x400f('0xb'));var fs=require('fs');var fs_extra=require(_0x400f('0xc'));var _=require(_0x400f('0xd'));var squel=require(_0x400f('0xe'));var crypto=require(_0x400f('0xf'));var jsforce=require(_0x400f('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x400f('0x11'));var Redis=require(_0x400f('0x12'));var authService=require(_0x400f('0x13'));var qs=require(_0x400f('0x14'));var as=require(_0x400f('0x15'));var hardwareService=require(_0x400f('0x16'));var logger=require(_0x400f('0x17'))(_0x400f('0x18'));var utils=require(_0x400f('0x19'));var config=require(_0x400f('0x1a'));var licenseUtil=require(_0x400f('0x1b'));var db=require(_0x400f('0x1c'))['db'];config[_0x400f('0x1d')]=_[_0x400f('0x1e')](config[_0x400f('0x1d')],{'host':_0x400f('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x400f('0x1d')]));require(_0x400f('0x20'))['register'](socket);var jayson=require(_0x400f('0x21'));var client=jayson[_0x400f('0x22')][_0x400f('0x23')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3633e6,_0x4ffce9,_0x40c8c9,_0x42ed05){return new BPromise(function(_0x16733d,_0x41f9fb){var _0x1b9bad=_0x42ed05||client;return _0x1b9bad[_0x400f('0x24')](_0x3633e6,_0x40c8c9)[_0x400f('0x25')](function(_0x3b3b10){logger[_0x400f('0x26')](_0x400f('0x27'),_0x4ffce9,_0x400f('0x28'));logger[_0x400f('0x29')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4ffce9,'request\x20sent',JSON[_0x400f('0x2a')](_0x3b3b10));if(_0x3b3b10[_0x400f('0x2b')]){if(_0x3b3b10[_0x400f('0x2b')]['code']===0x1f4){logger[_0x400f('0x2b')](_0x400f('0x27'),_0x4ffce9,_0x3b3b10[_0x400f('0x2b')]['message']);return _0x41f9fb(_0x3b3b10[_0x400f('0x2b')][_0x400f('0x2c')]);}logger['error'](_0x400f('0x27'),_0x4ffce9,_0x3b3b10[_0x400f('0x2b')][_0x400f('0x2c')]);return _0x16733d(_0x3b3b10[_0x400f('0x2b')][_0x400f('0x2c')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4ffce9,'request\x20sent');_0x16733d(_0x3b3b10[_0x400f('0x2d')][_0x400f('0x2c')]);}})[_0x400f('0x2e')](function(_0x585ce2){logger[_0x400f('0x2b')](_0x400f('0x27'),_0x4ffce9,_0x585ce2);_0x41f9fb(_0x585ce2);});});}function respondWithStatusCode(_0x4250b8,_0x30786d){_0x30786d=_0x30786d||0xcc;return function(_0xc42597){if(_0xc42597){return _0x4250b8[_0x400f('0x2f')](_0x30786d);}return _0x4250b8[_0x400f('0x30')](_0x30786d)[_0x400f('0x31')]();};}function respondWithResult(_0x41844b,_0x58c26a){_0x58c26a=_0x58c26a||0xc8;return function(_0x4ff61b){if(_0x4ff61b){return _0x41844b['status'](_0x58c26a)[_0x400f('0x32')](_0x4ff61b);}};}function respondWithFilteredResult(_0x238cab,_0x1be609){return function(_0x4adbb4){if(_0x4adbb4){var _0x2d85f4=typeof _0x1be609['offset']===_0x400f('0x33')&&typeof _0x1be609[_0x400f('0x34')]===_0x400f('0x33');var _0x1b8046=_0x4adbb4[_0x400f('0x35')];var _0x35440e=_0x2d85f4?0x0:_0x1be609[_0x400f('0x36')];var _0x3674fd=_0x2d85f4?_0x4adbb4[_0x400f('0x35')]:_0x1be609[_0x400f('0x36')]+_0x1be609[_0x400f('0x34')];var _0x295a0c;if(_0x3674fd>=_0x1b8046){_0x3674fd=_0x1b8046;_0x295a0c=0xc8;}else{_0x295a0c=0xce;}_0x238cab[_0x400f('0x30')](_0x295a0c);return _0x238cab[_0x400f('0x37')](_0x400f('0x38'),_0x35440e+'-'+_0x3674fd+'/'+_0x1b8046)[_0x400f('0x32')](_0x4adbb4);}return null;};}function patchUpdates(_0x54d40a){return function(_0x5f94c9){try{jsonpatch['apply'](_0x5f94c9,_0x54d40a,!![]);}catch(_0x148f21){return BPromise['reject'](_0x148f21);}return _0x5f94c9[_0x400f('0x39')]();};}function saveUpdates(_0xbac090,_0x1f0838){return function(_0x1a05ae){if(_0x1a05ae){return _0x1a05ae['update'](_0xbac090)[_0x400f('0x25')](function(_0x4cc066){return _0x4cc066;});}return null;};}function removeEntity(_0x5918cb,_0x488c85){return function(_0x5cd21c){if(_0x5cd21c){return _0x5cd21c[_0x400f('0x3a')]()[_0x400f('0x25')](function(){_0x5918cb[_0x400f('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x140646,_0x1d4f5d){return function(_0x12ac36){if(!_0x12ac36){_0x140646[_0x400f('0x2f')](0x194);}return _0x12ac36;};}function handleError(_0x2055dc,_0x4b6b82){_0x4b6b82=_0x4b6b82||0x1f4;return function(_0x3b5bcf){logger['error'](_0x3b5bcf['stack']);if(_0x3b5bcf['name']){delete _0x3b5bcf['name'];}_0x2055dc[_0x400f('0x30')](_0x4b6b82)[_0x400f('0x3b')](_0x3b5bcf);};}exports[_0x400f('0x3c')]=function(_0x215550,_0x51bedb){var _0x1cf324={},_0x217b60={},_0x22c8c3={'count':0x0,'rows':[]};var _0x20e331=_[_0x400f('0x3d')](db[_0x400f('0x3e')][_0x400f('0x3f')],function(_0x3bc3bf){return{'name':_0x3bc3bf[_0x400f('0x40')],'type':_0x3bc3bf[_0x400f('0x41')][_0x400f('0x42')]};});_0x217b60['model']=_[_0x400f('0x3d')](_0x20e331,_0x400f('0x43'));_0x217b60[_0x400f('0x44')]=_[_0x400f('0x45')](_0x215550[_0x400f('0x44')]);_0x217b60[_0x400f('0x46')]=_['intersection'](_0x217b60['model'],_0x217b60[_0x400f('0x44')]);_0x1cf324[_0x400f('0x47')]=_[_0x400f('0x48')](_0x217b60[_0x400f('0x49')],qs['fields'](_0x215550['query'][_0x400f('0x4a')]));_0x1cf324[_0x400f('0x47')]=_0x1cf324['attributes'][_0x400f('0x4b')]?_0x1cf324[_0x400f('0x47')]:_0x217b60['model'];if(!_0x215550['query'][_0x400f('0x4c')](_0x400f('0x4d'))){_0x1cf324[_0x400f('0x34')]=qs[_0x400f('0x34')](_0x215550['query'][_0x400f('0x34')]);_0x1cf324[_0x400f('0x36')]=qs[_0x400f('0x36')](_0x215550[_0x400f('0x44')][_0x400f('0x36')]);}_0x1cf324['order']=qs[_0x400f('0x4e')](_0x215550[_0x400f('0x44')][_0x400f('0x4e')]);_0x1cf324[_0x400f('0x4f')]=qs['filters'](_[_0x400f('0x50')](_0x215550['query'],_0x217b60[_0x400f('0x46')]),_0x20e331);if(_0x215550['query'][_0x400f('0x51')]){_0x1cf324[_0x400f('0x4f')]=_['merge'](_0x1cf324[_0x400f('0x4f')],{'$or':_[_0x400f('0x3d')](_0x20e331,function(_0xc5c5b5){if(_0xc5c5b5[_0x400f('0x41')]!=='VIRTUAL'){var _0x4776ad={};_0x4776ad[_0xc5c5b5[_0x400f('0x43')]]={'$like':'%'+_0x215550[_0x400f('0x44')][_0x400f('0x51')]+'%'};return _0x4776ad;}})});}_0x1cf324=_[_0x400f('0x52')]({},_0x1cf324,_0x215550[_0x400f('0x53')]);var _0x15e389={'where':_0x1cf324[_0x400f('0x4f')]};return db[_0x400f('0x3e')]['count'](_0x15e389)[_0x400f('0x25')](function(_0x4b49dc){_0x22c8c3[_0x400f('0x35')]=_0x4b49dc;if(_0x215550[_0x400f('0x44')][_0x400f('0x54')]){_0x1cf324[_0x400f('0x55')]=[{'all':!![]}];}return db[_0x400f('0x3e')][_0x400f('0x56')](_0x1cf324);})[_0x400f('0x25')](function(_0x2b6ed9){_0x22c8c3[_0x400f('0x57')]=_0x2b6ed9;return _0x22c8c3;})[_0x400f('0x25')](respondWithFilteredResult(_0x51bedb,_0x1cf324))[_0x400f('0x2e')](handleError(_0x51bedb,null));};exports['show']=function(_0xf8b680,_0x3f647a){var _0x5b7113={'raw':!![],'where':{'id':_0xf8b680[_0x400f('0x58')]['id']}},_0xec12c5={};_0xec12c5[_0x400f('0x49')]=_['keys'](db[_0x400f('0x3e')][_0x400f('0x3f')]);_0xec12c5['query']=_[_0x400f('0x45')](_0xf8b680[_0x400f('0x44')]);_0xec12c5['filters']=_['intersection'](_0xec12c5[_0x400f('0x49')],_0xec12c5[_0x400f('0x44')]);_0x5b7113[_0x400f('0x47')]=_['intersection'](_0xec12c5['model'],qs['fields'](_0xf8b680[_0x400f('0x44')]['fields']));_0x5b7113['attributes']=_0x5b7113[_0x400f('0x47')][_0x400f('0x4b')]?_0x5b7113[_0x400f('0x47')]:_0xec12c5[_0x400f('0x49')];if(_0xf8b680[_0x400f('0x44')][_0x400f('0x54')]){_0x5b7113[_0x400f('0x55')]=[{'all':!![]}];}_0x5b7113=_[_0x400f('0x52')]({},_0x5b7113,_0xf8b680[_0x400f('0x53')]);return db[_0x400f('0x3e')][_0x400f('0x59')](_0x5b7113)[_0x400f('0x25')](handleEntityNotFound(_0x3f647a,null))[_0x400f('0x25')](respondWithResult(_0x3f647a,null))['catch'](handleError(_0x3f647a,null));};exports[_0x400f('0x5a')]=function(_0x146b40,_0x102741){return db['WhatsappMessage'][_0x400f('0x5a')](_0x146b40[_0x400f('0x5b')],{})[_0x400f('0x25')](respondWithResult(_0x102741,0xc9))[_0x400f('0x2e')](handleError(_0x102741,null));};exports[_0x400f('0x5c')]=function(_0x147eb7,_0xbb45c9){if(_0x147eb7['body']['id']){delete _0x147eb7['body']['id'];}return db[_0x400f('0x3e')][_0x400f('0x59')]({'where':{'id':_0x147eb7[_0x400f('0x58')]['id']}})[_0x400f('0x25')](handleEntityNotFound(_0xbb45c9,null))[_0x400f('0x25')](saveUpdates(_0x147eb7['body'],null))['then'](respondWithResult(_0xbb45c9,null))[_0x400f('0x2e')](handleError(_0xbb45c9,null));};exports['destroy']=function(_0x8371c6,_0x3373ce){return db[_0x400f('0x3e')]['find']({'where':{'id':_0x8371c6[_0x400f('0x58')]['id']}})[_0x400f('0x25')](handleEntityNotFound(_0x3373ce,null))['then'](removeEntity(_0x3373ce,null))[_0x400f('0x2e')](handleError(_0x3373ce,null));};exports[_0x400f('0x5d')]=function(_0x5237c3,_0x269693){return db[_0x400f('0x3e')][_0x400f('0x5d')]()[_0x400f('0x25')](respondWithResult(_0x269693,null))[_0x400f('0x2e')](handleError(_0x269693,null));};var interaction_log=require('../../config/logger')(_0x400f('0x5e'));exports[_0x400f('0x5f')]=function(_0x467427,_0xb154b5,_0x479da3){var _0x77ed50={'agent':{},'channel':_0x400f('0x60')};if(_0x467427[_0x400f('0x5b')]['id']){delete _0x467427[_0x400f('0x5b')]['id'];}_0x467427[_0x400f('0x5b')][_0x400f('0x61')]=!![];_0x467427[_0x400f('0x5b')]['readAt']=moment()['format'](_0x400f('0x62'));_0x467427[_0x400f('0x5b')][_0x400f('0x63')]=_0x467427[_0x400f('0x5b')][_0x400f('0x63')]||_0x467427['user']['id'];_0x77ed50[_0x400f('0x64')]['id']=_0x467427['body'][_0x400f('0x63')];return db[_0x400f('0x3e')]['find']({'where':{'id':_0x467427[_0x400f('0x58')]['id'],'UserId':null}})[_0x400f('0x25')](handleEntityNotFound(_0xb154b5,null))['then'](saveUpdates(_0x467427['body'],null))[_0x400f('0x25')](function(_0xb1223b){if(_0xb1223b){_0x77ed50[_0x400f('0x2c')]=_0xb1223b[_0x400f('0x65')]({'plain':!![]});return db[_0x400f('0x66')]['find']({'where':{'id':_0xb1223b[_0x400f('0x67')]}});}return null;})[_0x400f('0x25')](handleEntityNotFound(_0xb154b5,null))[_0x400f('0x25')](function(_0x5d3d85){if(_0x5d3d85){return _0x5d3d85['update']({'UserId':_0x467427[_0x400f('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x5d3d85['read1stAt'])?moment()[_0x400f('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x400f('0x25')](function(_0x2752b3){if(_0x2752b3){_0x77ed50[_0x400f('0x69')]=_0x2752b3['get']({'plain':!![]});interaction_log['info'](_0x400f('0x6a'),_0x467427[_0x400f('0x6b')]['id'],_0x467427[_0x400f('0x6b')]['name'],_0x467427[_0x400f('0x6b')]['role'],_0x77ed50[_0x400f('0x69')]['id'],_0x467427[_0x400f('0x5b')]?JSON[_0x400f('0x2a')](_0x467427[_0x400f('0x5b')]):'null');return respondWithRpcPromise('AcceptMessage',_0x400f('0x6c'),_0x77ed50);}return null;})[_0x400f('0x25')](function(_0x574dac){var _0x2a20a7=_0x400f('0x6d')+_0x574dac[_0x400f('0x2c')]['ContactId'];return db['sequelize']['query'](_0x2a20a7,{'type':db[_0x400f('0x6e')]['QueryTypes'][_0x400f('0x6f')],'raw':!![]})[_0x400f('0x25')](function(_0x1b36ea){return _0x1b36ea;});})[_0x400f('0x25')](function(_0x80fad){if(_0x80fad){_0x77ed50['message'][_0x400f('0x70')]=_0x80fad[0x0];if(!_0x467427[_0x400f('0x5b')][_0x400f('0x63')])return;return db[_0x400f('0x71')][_0x400f('0x59')]({'where':{'id':_0x467427[_0x400f('0x5b')][_0x400f('0x63')],'role':_0x400f('0x64')},'attributes':['id','name',_0x400f('0x72'),_0x400f('0x73'),_0x400f('0x74')],'raw':!![]});}return null;})['then'](function(_0x4b36e5){if(!_0x4b36e5)return null;_0x77ed50[_0x400f('0x2c')][_0x400f('0x64')]=_0x4b36e5;return _0x77ed50;})[_0x400f('0x25')](function(_0x384170){if(_0x384170){if(_0x467427['body'][_0x400f('0x75')]){_0x77ed50[_0x400f('0x2c')][_0x400f('0x76')]=util[_0x400f('0x68')](_0x400f('0x77'),_0x467427[_0x400f('0x6b')][_0x400f('0x43')]);_0x77ed50[_0x400f('0x2c')][_0x400f('0x78')]=_0x77ed50[_0x400f('0x78')];_0x77ed50['message'][_0x400f('0x79')]=_0x77ed50[_0x400f('0x78')];_0x77ed50['message'][_0x400f('0x7a')]='accept';return respondWithRpcPromise(_0x400f('0x7b'),_0x400f('0x7b'),{'event':_0x400f('0x7c'),'message':_0x77ed50[_0x400f('0x2c')]},client9002)[_0x400f('0x25')](function(){return _0x77ed50;});}return _0x77ed50;}return null;})[_0x400f('0x25')](respondWithResult(_0xb154b5,null))[_0x400f('0x2e')](handleError(_0xb154b5,null));};var interaction_log=require(_0x400f('0x17'))(_0x400f('0x5e'));exports[_0x400f('0x7d')]=function(_0x1ca4ae,_0x5a515d,_0x41737f){var _0x39b8dd={'agent':{},'channel':_0x400f('0x60')};if(_0x1ca4ae[_0x400f('0x5b')]['id']){delete _0x1ca4ae[_0x400f('0x5b')]['id'];}_0x1ca4ae[_0x400f('0x5b')][_0x400f('0x63')]=_0x1ca4ae[_0x400f('0x5b')][_0x400f('0x63')]||_0x1ca4ae['user']['id'];_0x39b8dd[_0x400f('0x64')]['id']=_0x1ca4ae[_0x400f('0x5b')][_0x400f('0x63')];return db[_0x400f('0x3e')]['find']({'where':{'id':_0x1ca4ae[_0x400f('0x58')]['id'],'UserId':null}})[_0x400f('0x25')](handleEntityNotFound(_0x5a515d,null))[_0x400f('0x25')](function(_0x4dfadc){if(_0x4dfadc){_0x39b8dd[_0x400f('0x2c')]=_0x4dfadc['get']({'plain':!![]});return db[_0x400f('0x66')][_0x400f('0x59')]({'where':{'id':_0x4dfadc[_0x400f('0x67')]}});}return null;})[_0x400f('0x25')](handleEntityNotFound(_0x5a515d,null))['then'](function(_0x5bbdef){if(_0x5bbdef){_0x39b8dd[_0x400f('0x69')]=_0x5bbdef[_0x400f('0x65')]({'plain':!![]});interaction_log[_0x400f('0x26')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ca4ae['user']['id'],_0x1ca4ae[_0x400f('0x6b')][_0x400f('0x43')],_0x1ca4ae[_0x400f('0x6b')][_0x400f('0x7e')],_0x39b8dd[_0x400f('0x69')]['id'],_0x1ca4ae[_0x400f('0x5b')]?JSON['stringify'](_0x1ca4ae[_0x400f('0x5b')]):_0x400f('0x7f'));return respondWithRpcPromise(_0x400f('0x80'),_0x400f('0x81'),_0x39b8dd);}return null;})['then'](function(_0x5bc445){var _0x13acee=_0x400f('0x6d')+_0x5bc445[_0x400f('0x2c')][_0x400f('0x82')];return db[_0x400f('0x83')]['query'](_0x13acee,{'type':db[_0x400f('0x6e')][_0x400f('0x84')]['SELECT'],'raw':!![]})[_0x400f('0x25')](function(_0x3af871){return _0x3af871;});})[_0x400f('0x25')](function(_0x35e409){if(_0x35e409){_0x39b8dd[_0x400f('0x2c')][_0x400f('0x70')]=_0x35e409[0x0];if(!_0x1ca4ae[_0x400f('0x5b')][_0x400f('0x63')])return;return db[_0x400f('0x71')][_0x400f('0x59')]({'where':{'id':_0x1ca4ae['body'][_0x400f('0x63')],'role':'agent'},'attributes':['id',_0x400f('0x43'),_0x400f('0x72'),_0x400f('0x73'),_0x400f('0x74')],'raw':!![]});}return null;})['then'](function(_0x44d173){if(!_0x44d173)return null;_0x39b8dd[_0x400f('0x2c')][_0x400f('0x64')]=_0x44d173;return _0x39b8dd;})['then'](function(_0x25a6e5){if(_0x25a6e5){_0x25a6e5[_0x400f('0x2c')][_0x400f('0x76')]=util['format']('SIP/%s',_0x1ca4ae['user'][_0x400f('0x43')]);_0x25a6e5[_0x400f('0x2c')][_0x400f('0x78')]=_0x39b8dd[_0x400f('0x78')];_0x25a6e5[_0x400f('0x2c')]['motionChannel']=_0x39b8dd[_0x400f('0x78')];_0x25a6e5[_0x400f('0x2c')][_0x400f('0x7a')]=_0x400f('0x7d');respondWithRpcPromise(_0x400f('0x7b'),_0x400f('0x7b'),{'event':'rejectmessage','message':_0x25a6e5[_0x400f('0x2c')]},client9002);return _0x39b8dd;}return null;})[_0x400f('0x25')](respondWithResult(_0x5a515d,null))[_0x400f('0x2e')](handleError(_0x5a515d,null));};exports[_0x400f('0x30')]=function(_0x2bb16b,_0x526faa,_0x3d406b){if(_0x2bb16b[_0x400f('0x5b')]['id']){delete _0x2bb16b[_0x400f('0x5b')]['id'];}var _0x316671;return db['WhatsappMessage'][_0x400f('0x59')]({'where':{'id':_0x2bb16b[_0x400f('0x58')]['id']}})[_0x400f('0x25')](handleEntityNotFound(_0x526faa,null))['then'](function(_0x323785){if(_0x323785){_0x316671=_0x323785;return db[_0x400f('0x85')][_0x400f('0x59')]({'where':{'id':_0x323785[_0x400f('0x86')]}});}})[_0x400f('0x25')](handleEntityNotFound(_0x526faa,null))[_0x400f('0x25')](function(_0x47610c){if(_0x47610c){logger[_0x400f('0x29')](_0x400f('0x87'),_0x400f('0x30'),_0x400f('0x88'),_0x47610c[_0x400f('0x41')],util[_0x400f('0x89')](_0x2bb16b['body'],{'showHidden':![],'depth':null}));switch(_0x47610c[_0x400f('0x41')]){case _0x400f('0x8a'):if(_0x2bb16b[_0x400f('0x5b')]['MessageSid']&&_0x2bb16b[_0x400f('0x5b')][_0x400f('0x8b')]===_0x316671[_0x400f('0x8c')]&&_0x2bb16b[_0x400f('0x5b')][_0x400f('0x8d')]&&_0x2bb16b[_0x400f('0x5b')][_0x400f('0x8d')]==='read'){return _0x316671[_0x400f('0x5c')]({'read':!![]});}else{logger['error'](_0x400f('0x8e'),_0x400f('0x30'),_0x400f('0x8a'),util['inspect'](_0x2bb16b[_0x400f('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x316671;}})[_0x400f('0x25')](respondWithResult(_0x526faa,null))[_0x400f('0x2e')](handleError(_0x526faa,null));}; \ No newline at end of file +var _0x7a8e=['nolimit','order','sort','pick','filter','merge','where','WhatsappMessage','include','params','length','includeAll','find','create','body','describe','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','internal','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x2b83cf,_0xce40bf){var _0x13899d=function(_0xc4cb17){while(--_0xc4cb17){_0x2b83cf['push'](_0x2b83cf['shift']());}};_0x13899d(++_0xce40bf);}(_0x7a8e,0x1e9));var _0xe7a8=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0x7a8e[_0x124f88];return _0xed0e3b;};'use strict';var emlformat=require(_0xe7a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe7a8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a8('0x2'));var moment=require(_0xe7a8('0x3'));var BPromise=require(_0xe7a8('0x4'));var Mustache=require('mustache');var util=require(_0xe7a8('0x5'));var path=require(_0xe7a8('0x6'));var sox=require(_0xe7a8('0x7'));var csv=require(_0xe7a8('0x8'));var ejs=require(_0xe7a8('0x9'));var fs=require('fs');var fs_extra=require(_0xe7a8('0xa'));var _=require(_0xe7a8('0xb'));var squel=require(_0xe7a8('0xc'));var crypto=require(_0xe7a8('0xd'));var jsforce=require(_0xe7a8('0xe'));var deskjs=require(_0xe7a8('0xf'));var toCsv=require(_0xe7a8('0x8'));var querystring=require(_0xe7a8('0x10'));var Papa=require('papaparse');var Redis=require(_0xe7a8('0x11'));var authService=require(_0xe7a8('0x12'));var qs=require(_0xe7a8('0x13'));var as=require(_0xe7a8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7a8('0x15'))('api');var utils=require(_0xe7a8('0x16'));var config=require(_0xe7a8('0x17'));var licenseUtil=require(_0xe7a8('0x18'));var db=require(_0xe7a8('0x19'))['db'];config[_0xe7a8('0x1a')]=_[_0xe7a8('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe7a8('0x1a')]));require(_0xe7a8('0x1c'))[_0xe7a8('0x1d')](socket);var jayson=require(_0xe7a8('0x1e'));var client=jayson[_0xe7a8('0x1f')][_0xe7a8('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xe7a8('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x295ce4,_0x34499c,_0x3f3419,_0x7d096){return new BPromise(function(_0x5f5223,_0x324bca){var _0x3c3542=_0x7d096||client;return _0x3c3542[_0xe7a8('0x21')](_0x295ce4,_0x3f3419)[_0xe7a8('0x22')](function(_0x4a5d96){logger[_0xe7a8('0x23')](_0xe7a8('0x24'),_0x34499c,'request\x20sent');logger['debug'](_0xe7a8('0x25'),_0x34499c,_0xe7a8('0x26'),JSON[_0xe7a8('0x27')](_0x4a5d96));if(_0x4a5d96['error']){if(_0x4a5d96[_0xe7a8('0x28')][_0xe7a8('0x29')]===0x1f4){logger['error'](_0xe7a8('0x24'),_0x34499c,_0x4a5d96[_0xe7a8('0x28')]['message']);return _0x324bca(_0x4a5d96[_0xe7a8('0x28')][_0xe7a8('0x2a')]);}logger[_0xe7a8('0x28')](_0xe7a8('0x24'),_0x34499c,_0x4a5d96[_0xe7a8('0x28')][_0xe7a8('0x2a')]);return _0x5f5223(_0x4a5d96[_0xe7a8('0x28')][_0xe7a8('0x2a')]);}else{logger['info'](_0xe7a8('0x24'),_0x34499c,_0xe7a8('0x26'));_0x5f5223(_0x4a5d96[_0xe7a8('0x2b')][_0xe7a8('0x2a')]);}})[_0xe7a8('0x2c')](function(_0x283bb7){logger[_0xe7a8('0x28')](_0xe7a8('0x24'),_0x34499c,_0x283bb7);_0x324bca(_0x283bb7);});});}function respondWithStatusCode(_0x57bcc6,_0x1d6f09){_0x1d6f09=_0x1d6f09||0xcc;return function(_0x583967){if(_0x583967){return _0x57bcc6[_0xe7a8('0x2d')](_0x1d6f09);}return _0x57bcc6['status'](_0x1d6f09)['end']();};}function respondWithResult(_0x7a58a6,_0x36c79b){_0x36c79b=_0x36c79b||0xc8;return function(_0x4775f1){if(_0x4775f1){return _0x7a58a6[_0xe7a8('0x2e')](_0x36c79b)[_0xe7a8('0x2f')](_0x4775f1);}};}function respondWithFilteredResult(_0x4ed050,_0x17139f){return function(_0x4f2e7f){if(_0x4f2e7f){var _0x3236ad=typeof _0x17139f[_0xe7a8('0x30')]==='undefined'&&typeof _0x17139f[_0xe7a8('0x31')]===_0xe7a8('0x32');var _0x305cc0=_0x4f2e7f[_0xe7a8('0x33')];var _0x1792ef=_0x3236ad?0x0:_0x17139f[_0xe7a8('0x30')];var _0x246338=_0x3236ad?_0x4f2e7f['count']:_0x17139f['offset']+_0x17139f[_0xe7a8('0x31')];var _0x2fbb53;if(_0x246338>=_0x305cc0){_0x246338=_0x305cc0;_0x2fbb53=0xc8;}else{_0x2fbb53=0xce;}_0x4ed050['status'](_0x2fbb53);return _0x4ed050[_0xe7a8('0x34')](_0xe7a8('0x35'),_0x1792ef+'-'+_0x246338+'/'+_0x305cc0)[_0xe7a8('0x2f')](_0x4f2e7f);}return null;};}function patchUpdates(_0x262668){return function(_0x34f2e8){try{jsonpatch[_0xe7a8('0x36')](_0x34f2e8,_0x262668,!![]);}catch(_0x2f7151){return BPromise[_0xe7a8('0x37')](_0x2f7151);}return _0x34f2e8[_0xe7a8('0x38')]();};}function saveUpdates(_0x253031,_0x585daf){return function(_0x166473){if(_0x166473){return _0x166473[_0xe7a8('0x39')](_0x253031)[_0xe7a8('0x22')](function(_0x5568cd){return _0x5568cd;});}return null;};}function removeEntity(_0x49ac84,_0x201388){return function(_0x4aeab6){if(_0x4aeab6){return _0x4aeab6[_0xe7a8('0x3a')]()[_0xe7a8('0x22')](function(){_0x49ac84[_0xe7a8('0x2e')](0xcc)[_0xe7a8('0x3b')]();});}};}function handleEntityNotFound(_0x6617f8,_0x2231ea){return function(_0xe11235){if(!_0xe11235){_0x6617f8['sendStatus'](0x194);}return _0xe11235;};}function handleError(_0x13a065,_0x5e791f){_0x5e791f=_0x5e791f||0x1f4;return function(_0x562166){logger['error'](_0x562166[_0xe7a8('0x3c')]);if(_0x562166[_0xe7a8('0x3d')]){delete _0x562166['name'];}_0x13a065[_0xe7a8('0x2e')](_0x5e791f)[_0xe7a8('0x3e')](_0x562166);};}exports['index']=function(_0x4669bd,_0x4fd6de){var _0x4bb4f6={},_0x83d684={},_0x2c6549={'count':0x0,'rows':[]};var _0x3851e0=_[_0xe7a8('0x3f')](db['WhatsappMessage'][_0xe7a8('0x40')],function(_0x480d30){return{'name':_0x480d30['fieldName'],'type':_0x480d30[_0xe7a8('0x41')][_0xe7a8('0x42')]};});_0x83d684[_0xe7a8('0x43')]=_[_0xe7a8('0x3f')](_0x3851e0,'name');_0x83d684[_0xe7a8('0x44')]=_[_0xe7a8('0x45')](_0x4669bd['query']);_0x83d684[_0xe7a8('0x46')]=_[_0xe7a8('0x47')](_0x83d684[_0xe7a8('0x43')],_0x83d684[_0xe7a8('0x44')]);_0x4bb4f6[_0xe7a8('0x48')]=_['intersection'](_0x83d684[_0xe7a8('0x43')],qs[_0xe7a8('0x49')](_0x4669bd[_0xe7a8('0x44')][_0xe7a8('0x49')]));_0x4bb4f6[_0xe7a8('0x48')]=_0x4bb4f6[_0xe7a8('0x48')]['length']?_0x4bb4f6[_0xe7a8('0x48')]:_0x83d684[_0xe7a8('0x43')];if(!_0x4669bd[_0xe7a8('0x44')][_0xe7a8('0x4a')](_0xe7a8('0x4b'))){_0x4bb4f6[_0xe7a8('0x31')]=qs[_0xe7a8('0x31')](_0x4669bd[_0xe7a8('0x44')][_0xe7a8('0x31')]);_0x4bb4f6[_0xe7a8('0x30')]=qs[_0xe7a8('0x30')](_0x4669bd[_0xe7a8('0x44')]['offset']);}_0x4bb4f6[_0xe7a8('0x4c')]=qs[_0xe7a8('0x4d')](_0x4669bd[_0xe7a8('0x44')][_0xe7a8('0x4d')]);_0x4bb4f6['where']=qs[_0xe7a8('0x46')](_[_0xe7a8('0x4e')](_0x4669bd[_0xe7a8('0x44')],_0x83d684[_0xe7a8('0x46')]),_0x3851e0);if(_0x4669bd[_0xe7a8('0x44')][_0xe7a8('0x4f')]){_0x4bb4f6['where']=_[_0xe7a8('0x50')](_0x4bb4f6[_0xe7a8('0x51')],{'$or':_[_0xe7a8('0x3f')](_0x3851e0,function(_0x498388){if(_0x498388[_0xe7a8('0x41')]!=='VIRTUAL'){var _0x4b9315={};_0x4b9315[_0x498388[_0xe7a8('0x3d')]]={'$like':'%'+_0x4669bd[_0xe7a8('0x44')][_0xe7a8('0x4f')]+'%'};return _0x4b9315;}})});}_0x4bb4f6=_[_0xe7a8('0x50')]({},_0x4bb4f6,_0x4669bd['options']);var _0x23d1dc={'where':_0x4bb4f6[_0xe7a8('0x51')]};return db[_0xe7a8('0x52')][_0xe7a8('0x33')](_0x23d1dc)[_0xe7a8('0x22')](function(_0x506f8d){_0x2c6549[_0xe7a8('0x33')]=_0x506f8d;if(_0x4669bd[_0xe7a8('0x44')]['includeAll']){_0x4bb4f6[_0xe7a8('0x53')]=[{'all':!![]}];}return db[_0xe7a8('0x52')]['findAll'](_0x4bb4f6);})[_0xe7a8('0x22')](function(_0x5d33b5){_0x2c6549['rows']=_0x5d33b5;return _0x2c6549;})[_0xe7a8('0x22')](respondWithFilteredResult(_0x4fd6de,_0x4bb4f6))['catch'](handleError(_0x4fd6de,null));};exports['show']=function(_0x501940,_0x3fd2b7){var _0x1ca17a={'raw':!![],'where':{'id':_0x501940[_0xe7a8('0x54')]['id']}},_0x2f48ed={};_0x2f48ed[_0xe7a8('0x43')]=_[_0xe7a8('0x45')](db[_0xe7a8('0x52')][_0xe7a8('0x40')]);_0x2f48ed[_0xe7a8('0x44')]=_[_0xe7a8('0x45')](_0x501940[_0xe7a8('0x44')]);_0x2f48ed[_0xe7a8('0x46')]=_['intersection'](_0x2f48ed[_0xe7a8('0x43')],_0x2f48ed[_0xe7a8('0x44')]);_0x1ca17a['attributes']=_[_0xe7a8('0x47')](_0x2f48ed[_0xe7a8('0x43')],qs['fields'](_0x501940[_0xe7a8('0x44')][_0xe7a8('0x49')]));_0x1ca17a[_0xe7a8('0x48')]=_0x1ca17a['attributes'][_0xe7a8('0x55')]?_0x1ca17a[_0xe7a8('0x48')]:_0x2f48ed[_0xe7a8('0x43')];if(_0x501940[_0xe7a8('0x44')][_0xe7a8('0x56')]){_0x1ca17a[_0xe7a8('0x53')]=[{'all':!![]}];}_0x1ca17a=_['merge']({},_0x1ca17a,_0x501940['options']);return db[_0xe7a8('0x52')][_0xe7a8('0x57')](_0x1ca17a)[_0xe7a8('0x22')](handleEntityNotFound(_0x3fd2b7,null))[_0xe7a8('0x22')](respondWithResult(_0x3fd2b7,null))[_0xe7a8('0x2c')](handleError(_0x3fd2b7,null));};exports[_0xe7a8('0x58')]=function(_0x1bee69,_0x8ee074){return db[_0xe7a8('0x52')]['create'](_0x1bee69['body'],{})[_0xe7a8('0x22')](respondWithResult(_0x8ee074,0xc9))[_0xe7a8('0x2c')](handleError(_0x8ee074,null));};exports[_0xe7a8('0x39')]=function(_0x5c1ef8,_0x206636){if(_0x5c1ef8[_0xe7a8('0x59')]['id']){delete _0x5c1ef8[_0xe7a8('0x59')]['id'];}return db[_0xe7a8('0x52')][_0xe7a8('0x57')]({'where':{'id':_0x5c1ef8[_0xe7a8('0x54')]['id']}})[_0xe7a8('0x22')](handleEntityNotFound(_0x206636,null))[_0xe7a8('0x22')](saveUpdates(_0x5c1ef8[_0xe7a8('0x59')],null))[_0xe7a8('0x22')](respondWithResult(_0x206636,null))[_0xe7a8('0x2c')](handleError(_0x206636,null));};exports[_0xe7a8('0x3a')]=function(_0x87357a,_0x397a58){return db['WhatsappMessage']['find']({'where':{'id':_0x87357a[_0xe7a8('0x54')]['id']}})[_0xe7a8('0x22')](handleEntityNotFound(_0x397a58,null))[_0xe7a8('0x22')](removeEntity(_0x397a58,null))[_0xe7a8('0x2c')](handleError(_0x397a58,null));};exports[_0xe7a8('0x5a')]=function(_0x244345,_0x378010){return db[_0xe7a8('0x52')][_0xe7a8('0x5a')]()['then'](respondWithResult(_0x378010,null))['catch'](handleError(_0x378010,null));};var interaction_log=require(_0xe7a8('0x15'))('whatsapp-interactions');exports['accept']=function(_0x55d56a,_0x3f2ee0,_0x57c05d){var _0x9f7d17={'agent':{},'channel':_0xe7a8('0x5b')};if(_0x55d56a[_0xe7a8('0x59')]['id']){delete _0x55d56a[_0xe7a8('0x59')]['id'];}_0x55d56a[_0xe7a8('0x59')][_0xe7a8('0x5c')]=!![];_0x55d56a['body'][_0xe7a8('0x5d')]=moment()[_0xe7a8('0x5e')](_0xe7a8('0x5f'));_0x55d56a[_0xe7a8('0x59')][_0xe7a8('0x60')]=_0x55d56a[_0xe7a8('0x59')][_0xe7a8('0x60')]||_0x55d56a['user']['id'];_0x9f7d17[_0xe7a8('0x61')]['id']=_0x55d56a[_0xe7a8('0x59')][_0xe7a8('0x60')];return db[_0xe7a8('0x52')]['find']({'where':{'id':_0x55d56a[_0xe7a8('0x54')]['id'],'UserId':null}})[_0xe7a8('0x22')](handleEntityNotFound(_0x3f2ee0,null))[_0xe7a8('0x22')](saveUpdates(_0x55d56a[_0xe7a8('0x59')],null))[_0xe7a8('0x22')](function(_0x52f4eb){if(_0x52f4eb){_0x9f7d17['message']=_0x52f4eb[_0xe7a8('0x62')]({'plain':!![]});return db[_0xe7a8('0x63')][_0xe7a8('0x57')]({'where':{'id':_0x52f4eb[_0xe7a8('0x64')]}});}return null;})[_0xe7a8('0x22')](handleEntityNotFound(_0x3f2ee0,null))['then'](function(_0x24f858){if(_0x24f858){return _0x24f858[_0xe7a8('0x39')]({'UserId':_0x55d56a[_0xe7a8('0x59')]['UserId'],'read1stAt':_[_0xe7a8('0x65')](_0x24f858[_0xe7a8('0x66')])?moment()['format'](_0xe7a8('0x5f')):undefined});}return null;})[_0xe7a8('0x22')](function(_0x57a4dc){if(_0x57a4dc){_0x9f7d17[_0xe7a8('0x67')]=_0x57a4dc['get']({'plain':!![]});interaction_log['info'](_0xe7a8('0x68'),_0x55d56a['user']['id'],_0x55d56a[_0xe7a8('0x69')][_0xe7a8('0x3d')],_0x55d56a[_0xe7a8('0x69')][_0xe7a8('0x6a')],_0x9f7d17[_0xe7a8('0x67')]['id'],_0x55d56a[_0xe7a8('0x59')]?JSON[_0xe7a8('0x27')](_0x55d56a['body']):_0xe7a8('0x6b'));return respondWithRpcPromise(_0xe7a8('0x6c'),'acceptMessage',_0x9f7d17);}return null;})[_0xe7a8('0x22')](function(_0x438204){var _0x63d509=_0xe7a8('0x6d')+_0x438204[_0xe7a8('0x2a')]['ContactId'];return db[_0xe7a8('0x6e')][_0xe7a8('0x44')](_0x63d509,{'type':db[_0xe7a8('0x6f')]['QueryTypes'][_0xe7a8('0x70')],'raw':!![]})[_0xe7a8('0x22')](function(_0x531a8b){return _0x531a8b;});})[_0xe7a8('0x22')](function(_0x2f21b9){if(_0x2f21b9){_0x9f7d17[_0xe7a8('0x2a')][_0xe7a8('0x71')]=_0x2f21b9[0x0];if(!_0x55d56a[_0xe7a8('0x59')][_0xe7a8('0x60')])return;return db[_0xe7a8('0x72')][_0xe7a8('0x57')]({'where':{'id':_0x55d56a['body']['UserId'],'role':_0xe7a8('0x61')},'attributes':['id',_0xe7a8('0x3d'),_0xe7a8('0x73'),_0xe7a8('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5cbbad){if(!_0x5cbbad)return null;_0x9f7d17[_0xe7a8('0x2a')][_0xe7a8('0x61')]=_0x5cbbad;return _0x9f7d17;})[_0xe7a8('0x22')](function(_0x31b268){if(_0x31b268){if(_0x55d56a[_0xe7a8('0x59')][_0xe7a8('0x75')]){_0x9f7d17[_0xe7a8('0x2a')][_0xe7a8('0x76')]=util[_0xe7a8('0x5e')]('SIP/%s',_0x55d56a[_0xe7a8('0x69')][_0xe7a8('0x3d')]);_0x9f7d17['message'][_0xe7a8('0x77')]=_0x9f7d17['channel'];_0x9f7d17[_0xe7a8('0x2a')][_0xe7a8('0x78')]=_0x9f7d17[_0xe7a8('0x77')];_0x9f7d17['message'][_0xe7a8('0x79')]='accept';return respondWithRpcPromise('EventManager',_0xe7a8('0x7a'),{'event':_0xe7a8('0x7b'),'message':_0x9f7d17[_0xe7a8('0x2a')]},client9002)[_0xe7a8('0x22')](function(){return _0x9f7d17;});}return _0x9f7d17;}return null;})[_0xe7a8('0x22')](respondWithResult(_0x3f2ee0,null))[_0xe7a8('0x2c')](handleError(_0x3f2ee0,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xe7a8('0x37')]=function(_0x4e41e9,_0x468f27,_0x4b62b8){var _0x227e0e={'agent':{},'channel':_0xe7a8('0x5b')};if(_0x4e41e9[_0xe7a8('0x59')]['id']){delete _0x4e41e9['body']['id'];}_0x4e41e9[_0xe7a8('0x59')][_0xe7a8('0x60')]=_0x4e41e9[_0xe7a8('0x59')][_0xe7a8('0x60')]||_0x4e41e9['user']['id'];_0x227e0e[_0xe7a8('0x61')]['id']=_0x4e41e9[_0xe7a8('0x59')][_0xe7a8('0x60')];return db['WhatsappMessage'][_0xe7a8('0x57')]({'where':{'id':_0x4e41e9[_0xe7a8('0x54')]['id'],'UserId':null}})[_0xe7a8('0x22')](handleEntityNotFound(_0x468f27,null))[_0xe7a8('0x22')](function(_0x45fc6f){if(_0x45fc6f){_0x227e0e[_0xe7a8('0x2a')]=_0x45fc6f[_0xe7a8('0x62')]({'plain':!![]});return db[_0xe7a8('0x63')][_0xe7a8('0x57')]({'where':{'id':_0x45fc6f[_0xe7a8('0x64')]}});}return null;})[_0xe7a8('0x22')](handleEntityNotFound(_0x468f27,null))[_0xe7a8('0x22')](function(_0x5c7a96){if(_0x5c7a96){_0x227e0e[_0xe7a8('0x67')]=_0x5c7a96[_0xe7a8('0x62')]({'plain':!![]});interaction_log[_0xe7a8('0x23')](_0xe7a8('0x7c'),_0x4e41e9['user']['id'],_0x4e41e9[_0xe7a8('0x69')][_0xe7a8('0x3d')],_0x4e41e9['user'][_0xe7a8('0x6a')],_0x227e0e['interaction']['id'],_0x4e41e9['body']?JSON[_0xe7a8('0x27')](_0x4e41e9[_0xe7a8('0x59')]):_0xe7a8('0x6b'));return respondWithRpcPromise(_0xe7a8('0x7d'),_0xe7a8('0x7e'),_0x227e0e);}return null;})['then'](function(_0x4a331c){var _0x332f6a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a331c['message'][_0xe7a8('0x7f')];return db[_0xe7a8('0x6e')][_0xe7a8('0x44')](_0x332f6a,{'type':db[_0xe7a8('0x6f')][_0xe7a8('0x80')][_0xe7a8('0x70')],'raw':!![]})[_0xe7a8('0x22')](function(_0x548cc6){return _0x548cc6;});})[_0xe7a8('0x22')](function(_0x4a0070){if(_0x4a0070){_0x227e0e[_0xe7a8('0x2a')][_0xe7a8('0x71')]=_0x4a0070[0x0];if(!_0x4e41e9[_0xe7a8('0x59')][_0xe7a8('0x60')])return;return db[_0xe7a8('0x72')]['find']({'where':{'id':_0x4e41e9[_0xe7a8('0x59')][_0xe7a8('0x60')],'role':_0xe7a8('0x61')},'attributes':['id','name',_0xe7a8('0x73'),_0xe7a8('0x74'),_0xe7a8('0x81')],'raw':!![]});}return null;})['then'](function(_0x4588c2){if(!_0x4588c2)return null;_0x227e0e[_0xe7a8('0x2a')]['agent']=_0x4588c2;return _0x227e0e;})[_0xe7a8('0x22')](function(_0x471b2f){if(_0x471b2f){_0x471b2f['message'][_0xe7a8('0x76')]=util[_0xe7a8('0x5e')](_0xe7a8('0x82'),_0x4e41e9['user']['name']);_0x471b2f['message'][_0xe7a8('0x77')]=_0x227e0e[_0xe7a8('0x77')];_0x471b2f[_0xe7a8('0x2a')][_0xe7a8('0x78')]=_0x227e0e[_0xe7a8('0x77')];_0x471b2f['message'][_0xe7a8('0x79')]=_0xe7a8('0x37');respondWithRpcPromise(_0xe7a8('0x7a'),_0xe7a8('0x7a'),{'event':_0xe7a8('0x83'),'message':_0x471b2f['message']},client9002);return _0x227e0e;}return null;})['then'](respondWithResult(_0x468f27,null))['catch'](handleError(_0x468f27,null));};exports['status']=function(_0x488f41,_0x20a792,_0x9201c2){if(_0x488f41[_0xe7a8('0x59')]['id']){delete _0x488f41[_0xe7a8('0x59')]['id'];}var _0x1ff9af;return db['WhatsappMessage'][_0xe7a8('0x57')]({'where':{'id':_0x488f41[_0xe7a8('0x54')]['id']}})[_0xe7a8('0x22')](handleEntityNotFound(_0x20a792,null))['then'](function(_0x57dcf4){if(_0x57dcf4){_0x1ff9af=_0x57dcf4;return db[_0xe7a8('0x84')][_0xe7a8('0x57')]({'where':{'id':_0x57dcf4[_0xe7a8('0x85')]}});}})[_0xe7a8('0x22')](handleEntityNotFound(_0x20a792,null))[_0xe7a8('0x22')](function(_0x507c3b){if(_0x507c3b){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xe7a8('0x2e'),_0xe7a8('0x86'),_0x507c3b['type'],util[_0xe7a8('0x87')](_0x488f41[_0xe7a8('0x59')],{'showHidden':![],'depth':null}));switch(_0x507c3b['type']){case _0xe7a8('0x88'):if(_0x488f41[_0xe7a8('0x59')][_0xe7a8('0x89')]&&_0x488f41['body']['MessageSid']===_0x1ff9af[_0xe7a8('0x8a')]&&_0x488f41[_0xe7a8('0x59')]['MessageStatus']&&_0x488f41[_0xe7a8('0x59')][_0xe7a8('0x8b')]===_0xe7a8('0x5c')){return _0x1ff9af['update']({'read':!![]});}else{logger[_0xe7a8('0x28')](_0xe7a8('0x8c'),'status',_0xe7a8('0x88'),util[_0xe7a8('0x87')](_0x488f41[_0xe7a8('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1ff9af;}})['then'](respondWithResult(_0x20a792,null))[_0xe7a8('0x2c')](handleError(_0x20a792,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index a14a6dc..7d1db00 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 _0x7d98=['events','WhatsappMessage','setMaxListeners','save','update','hook','exports'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7d98,0xe7));var _0x87d9=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x7d98[_0x52096b];return _0x2b1cc7;};'use strict';var EventEmitter=require(_0x87d9('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x87d9('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x87d9('0x2')](0x0);var events={'afterCreate':_0x87d9('0x3'),'afterUpdate':_0x87d9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x417ed2){return function(_0x317ba8,_0x4b4f58,_0x127fa8){WhatsappMessageEvents['emit'](_0x417ed2+':'+_0x317ba8['id'],_0x317ba8);WhatsappMessageEvents['emit'](_0x417ed2,_0x317ba8);_0x127fa8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x87d9('0x5')](e,emitEvent(event));}}module[_0x87d9('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0xb9a7=['emit','hasOwnProperty','hook','exports','../../mysqldb','update'];(function(_0x521e41,_0x34e57f){var _0x25b247=function(_0x461ae9){while(--_0x461ae9){_0x521e41['push'](_0x521e41['shift']());}};_0x25b247(++_0x34e57f);}(_0xb9a7,0x112));var _0x7b9a=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xb9a7[_0x29d94e];return _0x106237;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x7b9a('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7b9a('0x1'),'afterDestroy':'remove'};function emitEvent(_0x1396ec){return function(_0x40ef7d,_0x37b25b,_0x24cae3){WhatsappMessageEvents[_0x7b9a('0x2')](_0x1396ec+':'+_0x40ef7d['id'],_0x40ef7d);WhatsappMessageEvents[_0x7b9a('0x2')](_0x1396ec,_0x40ef7d);_0x24cae3(null);};}for(var e in events){if(events[_0x7b9a('0x3')](e)){var event=events[e];WhatsappMessage[_0x7b9a('0x4')](e,emitEvent(event));}}module[_0x7b9a('0x5')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 8cd1176..d6296bc 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 _0xd1c5=['lodash','util','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','catch','error','out','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','body','POST','Bearer\x20','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci'];(function(_0xe24b3d,_0x5381f5){var _0x190e3a=function(_0x3114eb){while(--_0x3114eb){_0xe24b3d['push'](_0xe24b3d['shift']());}};_0x190e3a(++_0x5381f5);}(_0xd1c5,0x162));var _0x5d1c=function(_0x4785ea,_0x2efb67){_0x4785ea=_0x4785ea-0x0;var _0x27e079=_0xd1c5[_0x4785ea];return _0x27e079;};'use strict';var _=require(_0x5d1c('0x0'));var util=require(_0x5d1c('0x1'));var logger=require('../../config/logger')(_0x5d1c('0x2'));var moment=require(_0x5d1c('0x3'));var BPromise=require(_0x5d1c('0x4'));var rp=require(_0x5d1c('0x5'));var fetch=require(_0x5d1c('0x6'));var fs=require('fs');var path=require(_0x5d1c('0x7'));var rimraf=require(_0x5d1c('0x8'));var config=require(_0x5d1c('0x9'));var attributes=require(_0x5d1c('0xa'));module[_0x5d1c('0xb')]=function(_0x4a03a3,_0x12dac4){return _0x4a03a3['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x5d1c('0xc'),'fields':['body'],'type':_0x5d1c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2064b2,_0x4ff6b1,_0x4f1edd){var _0x1ae228=_0x4a03a3[_0x5d1c('0xe')];var _0x572232=_0x2064b2[_0x5d1c('0xf')]({'plain':!![]});if(_0x572232[_0x5d1c('0x10')][_0x5d1c('0x11')]()==='in'||_0x572232[_0x5d1c('0x10')][_0x5d1c('0x11')]()==='out'&&!_0x572232[_0x5d1c('0x12')]&&!_[_0x5d1c('0x13')](_0x572232['UserId'])){_0x1ae228[_0x5d1c('0x14')][_0x5d1c('0x15')]({'where':{'id':_0x572232[_0x5d1c('0x16')]}})['then'](function(_0x10f0de){if(_0x10f0de){_0x10f0de['update']({'lastMsgAt':_0x572232['createdAt'],'lastMsgDirection':_0x572232[_0x5d1c('0x10')][_0x5d1c('0x11')]()});}})[_0x5d1c('0x17')](function(_0x2f5b00){console[_0x5d1c('0x18')](_0x2f5b00);});}if(_0x572232[_0x5d1c('0x10')]===_0x5d1c('0x19')&&!_0x572232[_0x5d1c('0x12')]){var _0xa5c1a6;_0x1ae228[_0x5d1c('0x1a')][_0x5d1c('0x1b')]({'where':{'id':_0x572232[_0x5d1c('0x1c')]},'raw':!![]})[_0x5d1c('0x1d')](function(_0x29bccc){_0xa5c1a6=_0x29bccc;if(_0xa5c1a6&&_0xa5c1a6[_0x5d1c('0x1e')]){switch(_0xa5c1a6[_0x5d1c('0x1e')]){case'twilio':var _0x1a435e=require(_0x5d1c('0x1f'));if(_0xa5c1a6[_0x5d1c('0x20')]&&_0xa5c1a6[_0x5d1c('0x21')]&&_0xa5c1a6[_0x5d1c('0x22')]){var _0x1f5631=new _0x1a435e(_0xa5c1a6[_0x5d1c('0x20')],_0xa5c1a6['authToken']);_0x1f5631['messages'][_0x5d1c('0x23')]({'body':_0x572232['body'],'to':_0x5d1c('0x24')+_0x572232[_0x5d1c('0x22')],'from':_0x5d1c('0x24')+_0xa5c1a6[_0x5d1c('0x22')],'statusCallback':_0xa5c1a6[_0x5d1c('0x25')]+_0x5d1c('0x26')+_0x572232['id']+_0x5d1c('0x27')+_0xa5c1a6['token']})[_0x5d1c('0x1d')](function(_0x1abbde){if(_0x1abbde[_0x5d1c('0x28')]){return _0x2064b2[_0x5d1c('0x29')]({'messageId':_0x1abbde['sid']});}})[_0x5d1c('0x17')](function(_0x3eb998){logger['error'](_0x5d1c('0x2a'),'afterCreate',_0x5d1c('0x1f'),util[_0x5d1c('0x2b')](_0x3eb998,{'showHidden':![],'depth':null}));});}else{logger[_0x5d1c('0x18')](_0x5d1c('0x2a'),_0x5d1c('0x2c'),'twilio',_0x5d1c('0x2d'));}break;case _0x5d1c('0x2e'):var _0x340ca2=_0xa5c1a6['accountSid'];var _0x438f34=_0xa5c1a6['authToken'];var _0x300c27=_0xa5c1a6[_0x5d1c('0x2f')]+_0x5d1c('0x30')+_0x340ca2+_0x5d1c('0x31');var _0x5f585c={'to':[_0x572232[_0x5d1c('0x22')]],'message':{'type':_0x5d1c('0x32'),'text':_0x572232[_0x5d1c('0x33')]}};var _0x21622e={'method':_0x5d1c('0x34'),'uri':_0x300c27,'headers':{'Authorization':_0x5d1c('0x35')+_0x438f34,'Content-Type':'application/json'},'body':_0x5f585c,'json':!![]};rp(_0x21622e)[_0x5d1c('0x1d')](function(_0x5ccde2){if(_0x5ccde2[_0x5d1c('0x36')][0x0][_0x5d1c('0x37')]){return _0x2064b2[_0x5d1c('0x29')]({'messageId':_0x5ccde2['statuses'][0x0][_0x5d1c('0x37')]});}})[_0x5d1c('0x17')](function(_0x1df57c){logger['err'](_0x5d1c('0x38'),_0x1df57c);});break;}}})[_0x5d1c('0x39')](function(){_0x4f1edd();});}else{_0x4f1edd();}}},'charset':'utf8mb4','collate':_0x5d1c('0x3a')});}; \ No newline at end of file +var _0x931c=['update','WhatsappMessage,\x20%s','finally','lodash','util','../../config/logger','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','createdAt','catch','error','WhatsappAccount','type','twilio','accountSid','phone','authToken','create','body','whatsapp:','remote','/status?token=','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id'];(function(_0x2706dc,_0x1d54d6){var _0x1de4cb=function(_0xed03a5){while(--_0xed03a5){_0x2706dc['push'](_0x2706dc['shift']());}};_0x1de4cb(++_0x1d54d6);}(_0x931c,0x14d));var _0xc931=function(_0x5ddaec,_0x2e4716){_0x5ddaec=_0x5ddaec-0x0;var _0x21dd16=_0x931c[_0x5ddaec];return _0x21dd16;};'use strict';var _=require(_0xc931('0x0'));var util=require(_0xc931('0x1'));var logger=require(_0xc931('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc931('0x3'));var rp=require('request-promise');var fetch=require(_0xc931('0x4'));var fs=require('fs');var path=require(_0xc931('0x5'));var rimraf=require(_0xc931('0x6'));var config=require(_0xc931('0x7'));var attributes=require(_0xc931('0x8'));module[_0xc931('0x9')]=function(_0x448f89,_0x485217){return _0x448f89[_0xc931('0xa')]('WhatsappMessage',attributes,{'tableName':_0xc931('0xb'),'paranoid':![],'indexes':[{'name':_0xc931('0xc'),'fields':['messageId']},{'name':_0xc931('0xd'),'fields':['body'],'type':_0xc931('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2845a4,_0x248ec0,_0x3cefc4){var _0x5da4bf=_0x448f89['models'];var _0x186bf3=_0x2845a4[_0xc931('0xf')]({'plain':!![]});if(_0x186bf3[_0xc931('0x10')][_0xc931('0x11')]()==='in'||_0x186bf3[_0xc931('0x10')][_0xc931('0x11')]()===_0xc931('0x12')&&!_0x186bf3[_0xc931('0x13')]&&!_[_0xc931('0x14')](_0x186bf3[_0xc931('0x15')])){_0x5da4bf['WhatsappInteraction'][_0xc931('0x16')]({'where':{'id':_0x186bf3[_0xc931('0x17')]}})[_0xc931('0x18')](function(_0x4035e0){if(_0x4035e0){_0x4035e0['update']({'lastMsgAt':_0x186bf3[_0xc931('0x19')],'lastMsgDirection':_0x186bf3[_0xc931('0x10')][_0xc931('0x11')]()});}})[_0xc931('0x1a')](function(_0x169ee3){console[_0xc931('0x1b')](_0x169ee3);});}if(_0x186bf3[_0xc931('0x10')]==='out'&&!_0x186bf3[_0xc931('0x13')]){var _0x545ef8;_0x5da4bf[_0xc931('0x1c')]['find']({'where':{'id':_0x186bf3['WhatsappAccountId']},'raw':!![]})[_0xc931('0x18')](function(_0x52c20e){_0x545ef8=_0x52c20e;if(_0x545ef8&&_0x545ef8[_0xc931('0x1d')]){switch(_0x545ef8[_0xc931('0x1d')]){case _0xc931('0x1e'):var _0x16601a=require(_0xc931('0x1e'));if(_0x545ef8[_0xc931('0x1f')]&&_0x545ef8['authToken']&&_0x545ef8[_0xc931('0x20')]){var _0x35c32a=new _0x16601a(_0x545ef8['accountSid'],_0x545ef8[_0xc931('0x21')]);_0x35c32a['messages'][_0xc931('0x22')]({'body':_0x186bf3[_0xc931('0x23')],'to':'whatsapp:'+_0x186bf3[_0xc931('0x20')],'from':_0xc931('0x24')+_0x545ef8[_0xc931('0x20')],'statusCallback':_0x545ef8[_0xc931('0x25')]+'/api/whatsapp/messages/'+_0x186bf3['id']+_0xc931('0x26')+_0x545ef8['token']})[_0xc931('0x18')](function(_0x4a4c86){if(_0x4a4c86['sid']){return _0x2845a4['update']({'messageId':_0x4a4c86['sid']});}})[_0xc931('0x1a')](function(_0x356118){logger[_0xc931('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc931('0x27'),_0xc931('0x1e'),util[_0xc931('0x28')](_0x356118,{'showHidden':![],'depth':null}));});}else{logger[_0xc931('0x1b')](_0xc931('0x29'),_0xc931('0x27'),_0xc931('0x1e'),_0xc931('0x2a'));}break;case _0xc931('0x2b'):var _0x1c4335=_0x545ef8[_0xc931('0x1f')];var _0x348f14=_0x545ef8[_0xc931('0x21')];var _0x1fae2f=_0x545ef8[_0xc931('0x2c')]+_0xc931('0x2d')+_0x1c4335+_0xc931('0x2e');var _0x4f6441={'to':[_0x186bf3[_0xc931('0x20')]],'message':{'type':_0xc931('0x2f'),'text':_0x186bf3['body']}};var _0x344310={'method':'POST','uri':_0x1fae2f,'headers':{'Authorization':_0xc931('0x30')+_0x348f14,'Content-Type':_0xc931('0x31')},'body':_0x4f6441,'json':!![]};rp(_0x344310)[_0xc931('0x18')](function(_0x14b30b){if(_0x14b30b[_0xc931('0x32')][0x0][_0xc931('0x33')]){return _0x2845a4[_0xc931('0x34')]({'messageId':_0x14b30b['statuses'][0x0][_0xc931('0x33')]});}})[_0xc931('0x1a')](function(_0xa2c04b){logger['err'](_0xc931('0x35'),_0xa2c04b);});break;}}})[_0xc931('0x36')](function(){_0x3cefc4();});}else{_0x3cefc4();}}},'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 abe3489..4785743 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 _0x894e=['request\x20sent','result','catch','create','body','options','raw','CreateWhatsappMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x21347f,_0x45de4e){var _0x5810ef=function(_0xd95a3f){while(--_0xd95a3f){_0x21347f['push'](_0x21347f['shift']());}};_0x5810ef(++_0x45de4e);}(_0x894e,0x173));var _0xe894=function(_0x210200,_0x150b2e){_0x210200=_0x210200-0x0;var _0x52e0e5=_0x894e[_0x210200];return _0x52e0e5;};'use strict';var _=require('lodash');var util=require(_0xe894('0x0'));var moment=require('moment');var BPromise=require(_0xe894('0x1'));var rs=require(_0xe894('0x2'));var fs=require('fs');var Redis=require(_0xe894('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe894('0x4'));var logger=require(_0xe894('0x5'))(_0xe894('0x6'));var config=require(_0xe894('0x7'));var jayson=require(_0xe894('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xe894('0x9')]=_[_0xe894('0xa')](config[_0xe894('0x9')],{'host':_0xe894('0xb'),'port':0x18eb});var socket=require(_0xe894('0xc'))(new Redis(config[_0xe894('0x9')]));require(_0xe894('0xd'))[_0xe894('0xe')](socket);function respondWithRpcPromise(_0x380e86,_0x179d1e,_0x172824){return new BPromise(function(_0x374bd8,_0x4b4e57){return client[_0xe894('0xf')](_0x380e86,_0x172824)[_0xe894('0x10')](function(_0x2b6760){logger[_0xe894('0x11')](_0xe894('0x12'),_0x179d1e,'request\x20sent');logger[_0xe894('0x13')](_0xe894('0x14'),_0x179d1e,'request\x20sent',JSON[_0xe894('0x15')](_0x2b6760));if(_0x2b6760[_0xe894('0x16')]){if(_0x2b6760[_0xe894('0x16')][_0xe894('0x17')]===0x1f4){logger[_0xe894('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x179d1e,_0x2b6760[_0xe894('0x16')][_0xe894('0x18')]);return _0x4b4e57(_0x2b6760['error'][_0xe894('0x18')]);}logger[_0xe894('0x16')](_0xe894('0x12'),_0x179d1e,_0x2b6760[_0xe894('0x16')][_0xe894('0x18')]);return _0x374bd8(_0x2b6760[_0xe894('0x16')][_0xe894('0x18')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x179d1e,_0xe894('0x19'));_0x374bd8(_0x2b6760[_0xe894('0x1a')]['message']);}})[_0xe894('0x1b')](function(_0x380593){logger[_0xe894('0x16')](_0xe894('0x12'),_0x179d1e,_0x380593);_0x4b4e57(_0x380593);});});}exports['CreateWhatsappMessage']=function(_0xa50f00){var _0xbaeb68=this;return new Promise(function(_0x8b1e1,_0x36744f){return db['WhatsappMessage'][_0xe894('0x1c')](_0xa50f00[_0xe894('0x1d')],{'raw':_0xa50f00['options']?_0xa50f00[_0xe894('0x1e')][_0xe894('0x1f')]===undefined?!![]:![]:!![]})[_0xe894('0x10')](function(_0x1c9de3){logger[_0xe894('0x11')](_0xe894('0x20'),_0xa50f00);logger[_0xe894('0x13')](_0xe894('0x20'),_0xa50f00,JSON[_0xe894('0x15')](_0x1c9de3));_0x8b1e1(_0x1c9de3);})[_0xe894('0x1b')](function(_0x45f68a){logger[_0xe894('0x16')]('CreateWhatsappMessage',_0x45f68a[_0xe894('0x18')],_0xa50f00);_0x36744f(_0xbaeb68[_0xe894('0x16')](0x1f4,_0x45f68a['message']));});});}; \ No newline at end of file +var _0x7de7=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','socket.io-emitter','register','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateWhatsappMessage','options','raw','catch','lodash','util','moment'];(function(_0x44fd07,_0x570057){var _0x39b293=function(_0x25d7d4){while(--_0x25d7d4){_0x44fd07['push'](_0x44fd07['shift']());}};_0x39b293(++_0x570057);}(_0x7de7,0x1a1));var _0x77de=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x7de7[_0xb24fad];return _0x173226;};'use strict';var _=require(_0x77de('0x0'));var util=require(_0x77de('0x1'));var moment=require(_0x77de('0x2'));var BPromise=require(_0x77de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77de('0x4'));var db=require(_0x77de('0x5'))['db'];var utils=require(_0x77de('0x6'));var logger=require(_0x77de('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x77de('0x8'));var client=jayson['client'][_0x77de('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x77de('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x77de('0xb'))(new Redis(config[_0x77de('0xa')]));require('./whatsappMessage.socket')[_0x77de('0xc')](socket);function respondWithRpcPromise(_0x2575a7,_0x4a9fba,_0x25f5fd){return new BPromise(function(_0x2579c9,_0x184dd7){return client[_0x77de('0xd')](_0x2575a7,_0x25f5fd)['then'](function(_0x4db619){logger['info'](_0x77de('0xe'),_0x4a9fba,_0x77de('0xf'));logger[_0x77de('0x10')](_0x77de('0x11'),_0x4a9fba,_0x77de('0xf'),JSON[_0x77de('0x12')](_0x4db619));if(_0x4db619['error']){if(_0x4db619[_0x77de('0x13')][_0x77de('0x14')]===0x1f4){logger[_0x77de('0x13')](_0x77de('0xe'),_0x4a9fba,_0x4db619[_0x77de('0x13')][_0x77de('0x15')]);return _0x184dd7(_0x4db619['error'][_0x77de('0x15')]);}logger[_0x77de('0x13')](_0x77de('0xe'),_0x4a9fba,_0x4db619[_0x77de('0x13')][_0x77de('0x15')]);return _0x2579c9(_0x4db619[_0x77de('0x13')][_0x77de('0x15')]);}else{logger[_0x77de('0x16')](_0x77de('0xe'),_0x4a9fba,_0x77de('0xf'));_0x2579c9(_0x4db619[_0x77de('0x17')][_0x77de('0x15')]);}})['catch'](function(_0x29e863){logger[_0x77de('0x13')](_0x77de('0xe'),_0x4a9fba,_0x29e863);_0x184dd7(_0x29e863);});});}exports[_0x77de('0x18')]=function(_0x28ae1b){var _0x509c8a=this;return new Promise(function(_0x943099,_0xa76078){return db['WhatsappMessage']['create'](_0x28ae1b['body'],{'raw':_0x28ae1b[_0x77de('0x19')]?_0x28ae1b[_0x77de('0x19')][_0x77de('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5a8632){logger[_0x77de('0x16')]('CreateWhatsappMessage',_0x28ae1b);logger[_0x77de('0x10')](_0x77de('0x18'),_0x28ae1b,JSON[_0x77de('0x12')](_0x5a8632));_0x943099(_0x5a8632);})[_0x77de('0x1b')](function(_0x541e15){logger['error'](_0x77de('0x18'),_0x541e15[_0x77de('0x15')],_0x28ae1b);_0xa76078(_0x509c8a['error'](0x1f4,_0x541e15['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 685dd32..d0e4151 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 _0xa9b9=['./whatsappMessage.events','save','remove','update','emit','length','whatsappMessage:'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa9b9,0x15e));var _0x9a9b=function(_0x1a0303,_0x6508d3){_0x1a0303=_0x1a0303-0x0;var _0x4f9bee=_0xa9b9[_0x1a0303];return _0x4f9bee;};'use strict';var WhatsappMessageEvents=require(_0x9a9b('0x0'));var events=[_0x9a9b('0x1'),_0x9a9b('0x2'),_0x9a9b('0x3')];function createListener(_0x55bdfd,_0x325917){return function(_0x3de10a){_0x325917[_0x9a9b('0x4')](_0x55bdfd,_0x3de10a);};}function removeListener(_0x56fd61,_0x39cf6c){return function(){WhatsappMessageEvents['removeListener'](_0x56fd61,_0x39cf6c);};}exports['register']=function(_0x233ef4){for(var _0x2926b4=0x0,_0x477020=events[_0x9a9b('0x5')];_0x2926b4<_0x477020;_0x2926b4++){var _0x1de3c2=events[_0x2926b4];var _0xd1e867=createListener(_0x9a9b('0x6')+_0x1de3c2,_0x233ef4);WhatsappMessageEvents['on'](_0x1de3c2,_0xd1e867);}}; \ No newline at end of file +var _0xd8e0=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2cad63,_0x15a505){var _0x2ac69e=function(_0x5557d9){while(--_0x5557d9){_0x2cad63['push'](_0x2cad63['shift']());}};_0x2ac69e(++_0x15a505);}(_0xd8e0,0x184));var _0x0d8e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd8e0[_0x4565bf];return _0x5610ba;};'use strict';var WhatsappMessageEvents=require(_0x0d8e('0x0'));var events=[_0x0d8e('0x1'),_0x0d8e('0x2'),_0x0d8e('0x3')];function createListener(_0x329a3e,_0x50e631){return function(_0x26e8d8){_0x50e631[_0x0d8e('0x4')](_0x329a3e,_0x26e8d8);};}function removeListener(_0x2ce915,_0x4e0a5c){return function(){WhatsappMessageEvents[_0x0d8e('0x5')](_0x2ce915,_0x4e0a5c);};}exports[_0x0d8e('0x6')]=function(_0x1d505c){for(var _0x25c312=0x0,_0x12a2aa=events[_0x0d8e('0x7')];_0x25c312<_0x12a2aa;_0x25c312++){var _0x54cd86=events[_0x25c312];var _0x207e33=createListener(_0x0d8e('0x8')+_0x54cd86,_0x1d505c);WhatsappMessageEvents['on'](_0x54cd86,_0x207e33);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 443a707..0627d29 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 _0x30bf=['../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x207114,_0x25902e){var _0x14d3b4=function(_0x4f8fe3){while(--_0x4f8fe3){_0x207114['push'](_0x207114['shift']());}};_0x14d3b4(++_0x25902e);}(_0x30bf,0x1c5));var _0xf30b=function(_0x538aff,_0x52e38c){_0x538aff=_0x538aff-0x0;var _0x238570=_0x30bf[_0x538aff];return _0x238570;};'use strict';var multer=require(_0xf30b('0x0'));var util=require(_0xf30b('0x1'));var path=require(_0xf30b('0x2'));var timeout=require(_0xf30b('0x3'));var express=require(_0xf30b('0x4'));var router=express[_0xf30b('0x5')]();var fs_extra=require(_0xf30b('0x6'));var auth=require(_0xf30b('0x7'));var interaction=require(_0xf30b('0x8'));var config=require(_0xf30b('0x9'));var controller=require(_0xf30b('0xa'));router[_0xf30b('0xb')]('/',auth[_0xf30b('0xc')](),controller[_0xf30b('0xd')]);router[_0xf30b('0xb')](_0xf30b('0xe'),auth[_0xf30b('0xc')](),controller[_0xf30b('0xf')]);router['get'](_0xf30b('0x10'),auth[_0xf30b('0xc')](),controller[_0xf30b('0x11')]);router[_0xf30b('0xb')]('/:id/members',auth[_0xf30b('0xc')](),controller[_0xf30b('0x12')]);router[_0xf30b('0xb')](_0xf30b('0x13'),auth['isAuthenticated'](),controller[_0xf30b('0x14')]);router['get']('/:id/users',auth[_0xf30b('0xc')](),controller[_0xf30b('0x15')]);router[_0xf30b('0x16')]('/',auth['isAuthenticated'](),controller[_0xf30b('0x17')]);router[_0xf30b('0x16')]('/:id/teams',auth[_0xf30b('0xc')](),controller[_0xf30b('0x18')]);router[_0xf30b('0x16')](_0xf30b('0x19'),auth[_0xf30b('0xc')](),controller[_0xf30b('0x1a')]);router[_0xf30b('0x1b')]('/:id',auth[_0xf30b('0xc')](),controller[_0xf30b('0x1c')]);router[_0xf30b('0x1d')]('/:id',auth[_0xf30b('0xc')](),controller[_0xf30b('0x1e')]);router['delete'](_0xf30b('0x13'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0xf30b('0x19'),auth[_0xf30b('0xc')](),controller[_0xf30b('0x1f')]);module[_0xf30b('0x20')]=router; \ No newline at end of file +var _0xf1a5=['./whatsappQueue.controller','isAuthenticated','index','get','/describe','/:id/members','/:id/teams','getTeams','/:id/users','addAgents','update','delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xf1a5,0x184));var _0x5f1a=function(_0x16eee1,_0x407540){_0x16eee1=_0x16eee1-0x0;var _0x27e12d=_0xf1a5[_0x16eee1];return _0x27e12d;};'use strict';var multer=require('multer');var util=require(_0x5f1a('0x0'));var path=require(_0x5f1a('0x1'));var timeout=require(_0x5f1a('0x2'));var express=require(_0x5f1a('0x3'));var router=express[_0x5f1a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5f1a('0x5'));var interaction=require(_0x5f1a('0x6'));var config=require(_0x5f1a('0x7'));var controller=require(_0x5f1a('0x8'));router['get']('/',auth[_0x5f1a('0x9')](),controller[_0x5f1a('0xa')]);router[_0x5f1a('0xb')](_0x5f1a('0xc'),auth[_0x5f1a('0x9')](),controller['describe']);router['get']('/:id',auth[_0x5f1a('0x9')](),controller['show']);router[_0x5f1a('0xb')](_0x5f1a('0xd'),auth[_0x5f1a('0x9')](),controller['getMembers']);router[_0x5f1a('0xb')](_0x5f1a('0xe'),auth[_0x5f1a('0x9')](),controller[_0x5f1a('0xf')]);router[_0x5f1a('0xb')](_0x5f1a('0x10'),auth[_0x5f1a('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5f1a('0xe'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x5f1a('0x10'),auth[_0x5f1a('0x9')](),controller[_0x5f1a('0x11')]);router['put']('/:id',auth[_0x5f1a('0x9')](),controller[_0x5f1a('0x12')]);router[_0x5f1a('0x13')](_0x5f1a('0x14'),auth[_0x5f1a('0x9')](),controller['destroy']);router[_0x5f1a('0x13')](_0x5f1a('0xe'),auth[_0x5f1a('0x9')](),controller['removeTeams']);router[_0x5f1a('0x13')](_0x5f1a('0x10'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5f1a('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index a27f953..601fcb2 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 _0x1948=['name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0xb9ead4,_0x50b588){var _0x216e67=function(_0x34b107){while(--_0x34b107){_0xb9ead4['push'](_0xb9ead4['shift']());}};_0x216e67(++_0x50b588);}(_0x1948,0x145));var _0x8194=function(_0x37fcda,_0x28a521){_0x37fcda=_0x37fcda-0x0;var _0x4e4817=_0x1948[_0x37fcda];return _0x4e4817;};'use strict';var Sequelize=require(_0x8194('0x0'));module[_0x8194('0x1')]={'name':{'type':Sequelize[_0x8194('0x2')],'unique':_0x8194('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8194('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8194('0x5'),_0x8194('0x6'),_0x8194('0x7'))},'description':{'type':Sequelize[_0x8194('0x2')]}}; \ No newline at end of file +var _0x0884=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x38f068,_0x359614){var _0x225ad4=function(_0x2313a9){while(--_0x2313a9){_0x38f068['push'](_0x38f068['shift']());}};_0x225ad4(++_0x359614);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4088('0x0'));module[_0x4088('0x1')]={'name':{'type':Sequelize[_0x4088('0x2')],'unique':_0x4088('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4088('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4088('0x5')](_0x4088('0x6'),'beepall',_0x4088('0x7'))},'description':{'type':Sequelize[_0x4088('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index ea5970f..78e8b9d 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 _0x956c=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','include','rows','catch','fields','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserWhatsappQueue','order','findAll','User','findAndCountAll','UserId','whatsappPause','createdAt','format','%s/%s','updatedAt','getTeams','addTeams','Team','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x16f4cd,_0x1a889d){var _0x1b3184=function(_0xd38bf4){while(--_0xd38bf4){_0x16f4cd['push'](_0x16f4cd['shift']());}};_0x1b3184(++_0x1a889d);}(_0x956c,0x111));var _0xc956=function(_0x430586,_0x1dfd6b){_0x430586=_0x430586-0x0;var _0x383a53=_0x956c[_0x430586];return _0x383a53;};'use strict';var emlformat=require(_0xc956('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc956('0x1'));var jsonpatch=require(_0xc956('0x2'));var rp=require(_0xc956('0x3'));var moment=require(_0xc956('0x4'));var BPromise=require(_0xc956('0x5'));var Mustache=require(_0xc956('0x6'));var util=require(_0xc956('0x7'));var path=require(_0xc956('0x8'));var sox=require(_0xc956('0x9'));var csv=require(_0xc956('0xa'));var ejs=require(_0xc956('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc956('0xc'));var squel=require(_0xc956('0xd'));var crypto=require(_0xc956('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc956('0xf'));var toCsv=require(_0xc956('0xa'));var querystring=require(_0xc956('0x10'));var Papa=require(_0xc956('0x11'));var Redis=require('ioredis');var authService=require(_0xc956('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc956('0x13'));var hardwareService=require(_0xc956('0x14'));var logger=require(_0xc956('0x15'))(_0xc956('0x16'));var utils=require(_0xc956('0x17'));var config=require(_0xc956('0x18'));var licenseUtil=require(_0xc956('0x19'));var db=require(_0xc956('0x1a'))['db'];config[_0xc956('0x1b')]=_[_0xc956('0x1c')](config[_0xc956('0x1b')],{'host':_0xc956('0x1d'),'port':0x18eb});var socket=require(_0xc956('0x1e'))(new Redis(config[_0xc956('0x1b')]));require(_0xc956('0x1f'))[_0xc956('0x20')](socket);function respondWithStatusCode(_0x3bca67,_0x2ca809){_0x2ca809=_0x2ca809||0xcc;return function(_0x3687a9){if(_0x3687a9){return _0x3bca67[_0xc956('0x21')](_0x2ca809);}return _0x3bca67[_0xc956('0x22')](_0x2ca809)[_0xc956('0x23')]();};}function respondWithResult(_0x21e1df,_0x5d335d){_0x5d335d=_0x5d335d||0xc8;return function(_0x161ca4){if(_0x161ca4){return _0x21e1df['status'](_0x5d335d)[_0xc956('0x24')](_0x161ca4);}};}function respondWithFilteredResult(_0x2473f5,_0x28cf36){return function(_0x36751b){if(_0x36751b){var _0x3c007f=typeof _0x28cf36[_0xc956('0x25')]==='undefined'&&typeof _0x28cf36['limit']===_0xc956('0x26');var _0x3e9061=_0x36751b[_0xc956('0x27')];var _0x334bf8=_0x3c007f?0x0:_0x28cf36[_0xc956('0x25')];var _0x19811f=_0x3c007f?_0x36751b[_0xc956('0x27')]:_0x28cf36[_0xc956('0x25')]+_0x28cf36[_0xc956('0x28')];var _0x333968;if(_0x19811f>=_0x3e9061){_0x19811f=_0x3e9061;_0x333968=0xc8;}else{_0x333968=0xce;}_0x2473f5[_0xc956('0x22')](_0x333968);return _0x2473f5[_0xc956('0x29')]('Content-Range',_0x334bf8+'-'+_0x19811f+'/'+_0x3e9061)['json'](_0x36751b);}return null;};}function patchUpdates(_0x44e8c9){return function(_0x5b89c9){try{jsonpatch[_0xc956('0x2a')](_0x5b89c9,_0x44e8c9,!![]);}catch(_0x28b28c){return BPromise[_0xc956('0x2b')](_0x28b28c);}return _0x5b89c9[_0xc956('0x2c')]();};}function saveUpdates(_0x746d06,_0x5d4521){return function(_0x1c4336){if(_0x1c4336){return _0x1c4336['update'](_0x746d06)[_0xc956('0x2d')](function(_0x1d0c5b){return _0x1d0c5b;});}return null;};}function removeEntity(_0x2c9ca0,_0x101b4e){return function(_0x5f3231){if(_0x5f3231){return _0x5f3231['destroy']()[_0xc956('0x2d')](function(){var _0x236b61=_0x5f3231[_0xc956('0x2e')]({'plain':!![]});var _0x407b90=_0xc956('0x2f');return db[_0xc956('0x30')][_0xc956('0x31')]({'where':{'type':_0x407b90,'resourceId':_0x236b61['id']}})['then'](function(){return _0x5f3231;});})[_0xc956('0x2d')](function(){_0x2c9ca0[_0xc956('0x22')](0xcc)[_0xc956('0x23')]();});}};}function handleEntityNotFound(_0x330165,_0xdb252d){return function(_0x11f5c4){if(!_0x11f5c4){_0x330165[_0xc956('0x21')](0x194);}return _0x11f5c4;};}function handleError(_0x16ee11,_0x2a4608){_0x2a4608=_0x2a4608||0x1f4;return function(_0x31dc8f){logger[_0xc956('0x32')](_0x31dc8f[_0xc956('0x33')]);if(_0x31dc8f[_0xc956('0x34')]){delete _0x31dc8f[_0xc956('0x34')];}_0x16ee11[_0xc956('0x22')](_0x2a4608)[_0xc956('0x35')](_0x31dc8f);};}exports[_0xc956('0x36')]=function(_0xd6769f,_0x3b4c73){var _0x4c9d68={},_0x2cbbd5={},_0x446b7b={'count':0x0,'rows':[]};var _0x32fc16=_[_0xc956('0x37')](db[_0xc956('0x38')][_0xc956('0x39')],function(_0x3f23cc){return{'name':_0x3f23cc[_0xc956('0x3a')],'type':_0x3f23cc['type'][_0xc956('0x3b')]};});_0x2cbbd5[_0xc956('0x3c')]=_[_0xc956('0x37')](_0x32fc16,_0xc956('0x34'));_0x2cbbd5[_0xc956('0x3d')]=_[_0xc956('0x3e')](_0xd6769f[_0xc956('0x3d')]);_0x2cbbd5['filters']=_[_0xc956('0x3f')](_0x2cbbd5[_0xc956('0x3c')],_0x2cbbd5['query']);_0x4c9d68[_0xc956('0x40')]=_[_0xc956('0x3f')](_0x2cbbd5[_0xc956('0x3c')],qs['fields'](_0xd6769f[_0xc956('0x3d')]['fields']));_0x4c9d68[_0xc956('0x40')]=_0x4c9d68['attributes'][_0xc956('0x41')]?_0x4c9d68[_0xc956('0x40')]:_0x2cbbd5[_0xc956('0x3c')];if(!_0xd6769f[_0xc956('0x3d')][_0xc956('0x42')](_0xc956('0x43'))){_0x4c9d68[_0xc956('0x28')]=qs[_0xc956('0x28')](_0xd6769f[_0xc956('0x3d')][_0xc956('0x28')]);_0x4c9d68[_0xc956('0x25')]=qs[_0xc956('0x25')](_0xd6769f[_0xc956('0x3d')]['offset']);}_0x4c9d68['order']=qs[_0xc956('0x44')](_0xd6769f['query']['sort']);_0x4c9d68[_0xc956('0x45')]=qs['filters'](_[_0xc956('0x46')](_0xd6769f[_0xc956('0x3d')],_0x2cbbd5[_0xc956('0x47')]),_0x32fc16);if(_0xd6769f[_0xc956('0x3d')][_0xc956('0x48')]){_0x4c9d68[_0xc956('0x45')]=_['merge'](_0x4c9d68[_0xc956('0x45')],{'$or':_[_0xc956('0x37')](_0x32fc16,function(_0x47f9b6){if(_0x47f9b6[_0xc956('0x49')]!==_0xc956('0x4a')){var _0xec1fa2={};_0xec1fa2[_0x47f9b6[_0xc956('0x34')]]={'$like':'%'+_0xd6769f[_0xc956('0x3d')][_0xc956('0x48')]+'%'};return _0xec1fa2;}})});}_0x4c9d68=_[_0xc956('0x4b')]({},_0x4c9d68,_0xd6769f[_0xc956('0x4c')]);var _0x272612={'where':_0x4c9d68['where']};return db[_0xc956('0x38')][_0xc956('0x27')](_0x272612)['then'](function(_0x4aa067){_0x446b7b['count']=_0x4aa067;if(_0xd6769f[_0xc956('0x3d')]['includeAll']){_0x4c9d68[_0xc956('0x4d')]=[{'all':!![]}];}return db[_0xc956('0x38')]['findAll'](_0x4c9d68);})[_0xc956('0x2d')](function(_0x2860e3){_0x446b7b[_0xc956('0x4e')]=_0x2860e3;return _0x446b7b;})[_0xc956('0x2d')](respondWithFilteredResult(_0x3b4c73,_0x4c9d68))[_0xc956('0x4f')](handleError(_0x3b4c73,null));};exports['show']=function(_0x1dae2d,_0x2abd78){var _0x4a9186={'raw':!![],'where':{'id':_0x1dae2d['params']['id']}},_0x43ac86={};_0x43ac86['model']=_[_0xc956('0x3e')](db[_0xc956('0x38')][_0xc956('0x39')]);_0x43ac86['query']=_[_0xc956('0x3e')](_0x1dae2d[_0xc956('0x3d')]);_0x43ac86[_0xc956('0x47')]=_[_0xc956('0x3f')](_0x43ac86['model'],_0x43ac86[_0xc956('0x3d')]);_0x4a9186[_0xc956('0x40')]=_['intersection'](_0x43ac86['model'],qs['fields'](_0x1dae2d[_0xc956('0x3d')][_0xc956('0x50')]));_0x4a9186[_0xc956('0x40')]=_0x4a9186[_0xc956('0x40')]['length']?_0x4a9186[_0xc956('0x40')]:_0x43ac86[_0xc956('0x3c')];if(_0x1dae2d[_0xc956('0x3d')][_0xc956('0x51')]){_0x4a9186['include']=[{'all':!![]}];}_0x4a9186=_[_0xc956('0x4b')]({},_0x4a9186,_0x1dae2d[_0xc956('0x4c')]);return db[_0xc956('0x38')][_0xc956('0x52')](_0x4a9186)[_0xc956('0x2d')](handleEntityNotFound(_0x2abd78,null))['then'](respondWithResult(_0x2abd78,null))[_0xc956('0x4f')](handleError(_0x2abd78,null));};exports['create']=function(_0x33baef,_0x7c820c){return db[_0xc956('0x38')]['create'](_0x33baef[_0xc956('0x53')],{})[_0xc956('0x2d')](function(_0x4d4055){var _0x25ebe6=_0x33baef['user'][_0xc956('0x2e')]({'plain':!![]});if(!_0x25ebe6)throw new Error(_0xc956('0x54'));if(_0x25ebe6[_0xc956('0x55')]==='user'){var _0x3ab351=_0x4d4055[_0xc956('0x2e')]({'plain':!![]});var _0x3d1bcd='WhatsappQueues';return db[_0xc956('0x56')][_0xc956('0x52')]({'where':{'name':_0x3d1bcd,'userProfileId':_0x25ebe6[_0xc956('0x57')]},'raw':!![]})['then'](function(_0x300795){if(_0x300795&&_0x300795[_0xc956('0x58')]===0x0){return db[_0xc956('0x30')][_0xc956('0x59')]({'name':_0x3ab351[_0xc956('0x34')],'resourceId':_0x3ab351['id'],'type':_0x300795[_0xc956('0x34')],'sectionId':_0x300795['id']},{})[_0xc956('0x2d')](function(){return _0x4d4055;});}else{return _0x4d4055;}})[_0xc956('0x4f')](function(_0x341033){logger[_0xc956('0x32')](_0xc956('0x5a'),_0x341033);throw _0x341033;});}return _0x4d4055;})[_0xc956('0x2d')](respondWithResult(_0x7c820c,0xc9))['catch'](handleError(_0x7c820c,null));};exports[_0xc956('0x5b')]=function(_0x5e3186,_0xb6a765){if(_0x5e3186[_0xc956('0x53')]['id']){delete _0x5e3186[_0xc956('0x53')]['id'];}return db[_0xc956('0x38')][_0xc956('0x52')]({'where':{'id':_0x5e3186[_0xc956('0x5c')]['id']}})[_0xc956('0x2d')](handleEntityNotFound(_0xb6a765,null))['then'](saveUpdates(_0x5e3186[_0xc956('0x53')],null))[_0xc956('0x2d')](respondWithResult(_0xb6a765,null))[_0xc956('0x4f')](handleError(_0xb6a765,null));};exports[_0xc956('0x31')]=function(_0x3185e5,_0x323b77){return db[_0xc956('0x38')]['find']({'where':{'id':_0x3185e5[_0xc956('0x5c')]['id']}})[_0xc956('0x2d')](handleEntityNotFound(_0x323b77,null))[_0xc956('0x2d')](removeEntity(_0x323b77,null))[_0xc956('0x4f')](handleError(_0x323b77,null));};exports[_0xc956('0x5d')]=function(_0x3d6626,_0x3fe60d){return db[_0xc956('0x38')][_0xc956('0x5d')]()[_0xc956('0x2d')](respondWithResult(_0x3fe60d,null))[_0xc956('0x4f')](handleError(_0x3fe60d,null));};exports['getMembers']=function(_0x42c9cd,_0x1032d2,_0x34bb70){var _0x2457eb={'raw':!![],'where':{}},_0x3d53d8={},_0xdc8901;return db[_0xc956('0x38')][_0xc956('0x5e')]({'where':{'id':_0x42c9cd[_0xc956('0x5c')]['id']}})[_0xc956('0x2d')](handleEntityNotFound(_0x1032d2,null))[_0xc956('0x2d')](function(_0x140337){if(_0x140337){_0xdc8901=_0x140337['get']({'plain':!![]});_0x3d53d8[_0xc956('0x3c')]=_[_0xc956('0x3e')](db[_0xc956('0x5f')][_0xc956('0x39')]);_0x3d53d8[_0xc956('0x3d')]=_[_0xc956('0x3e')](_0x42c9cd['query']);_0x3d53d8[_0xc956('0x47')]=_['intersection'](_0x3d53d8[_0xc956('0x3c')],_0x3d53d8[_0xc956('0x3d')]);_0x2457eb[_0xc956('0x40')]=_[_0xc956('0x3f')](_0x3d53d8[_0xc956('0x3c')],qs['fields'](_0x42c9cd['query'][_0xc956('0x50')]));_0x2457eb['attributes']=_0x2457eb[_0xc956('0x40')][_0xc956('0x41')]?_0x2457eb['attributes']:_0x3d53d8[_0xc956('0x3c')];if(!_0x42c9cd['query'][_0xc956('0x42')](_0xc956('0x43'))){_0x2457eb[_0xc956('0x28')]=qs[_0xc956('0x28')](_0x42c9cd[_0xc956('0x3d')][_0xc956('0x28')]);_0x2457eb[_0xc956('0x25')]=qs['offset'](_0x42c9cd[_0xc956('0x3d')][_0xc956('0x25')]);}_0x2457eb[_0xc956('0x60')]=qs[_0xc956('0x44')](_0x42c9cd[_0xc956('0x3d')][_0xc956('0x44')]);_0x2457eb[_0xc956('0x45')]=qs[_0xc956('0x47')](_[_0xc956('0x46')](_0x42c9cd[_0xc956('0x3d')],_0x3d53d8[_0xc956('0x47')]));_0x2457eb['where']['WhatsappQueueId']=_0x140337['id'];if(_0x42c9cd[_0xc956('0x3d')][_0xc956('0x48')]){_0x2457eb[_0xc956('0x45')]=_[_0xc956('0x4b')](_0x2457eb['where'],{'$or':_[_0xc956('0x37')](_0x2457eb[_0xc956('0x40')],function(_0x370638){var _0x232639={};_0x232639[_0x370638]={'$like':'%'+_0x42c9cd[_0xc956('0x3d')][_0xc956('0x48')]+'%'};return _0x232639;})});}_0x2457eb=_[_0xc956('0x4b')]({},_0x2457eb,_0x42c9cd[_0xc956('0x4c')]);return db[_0xc956('0x5f')][_0xc956('0x61')](_0x2457eb);}})['then'](function(_0xfdf8a4){if(_0xfdf8a4){return db[_0xc956('0x62')][_0xc956('0x63')]({'where':{'id':_[_0xc956('0x37')](_0xfdf8a4,_0xc956('0x64')),'role':'agent'},'attributes':['id','name',_0xc956('0x65'),'updatedAt',_0xc956('0x66')]});}})['then'](function(_0x868ef7){if(_0x868ef7){return{'count':_0x868ef7['count'],'rows':_[_0xc956('0x37')](_0x868ef7[_0xc956('0x4e')],function(_0x1fcc11){return{'membername':_0x1fcc11[_0xc956('0x34')],'UserId':_0x1fcc11['id'],'queue_name':_0xdc8901[_0xc956('0x34')],'WhatsappQueueId':_0xdc8901['id'],'interface':util[_0xc956('0x67')](_0xc956('0x68'),'SIP',_0x1fcc11[_0xc956('0x34')]),'penalty':0x0,'paused':_0x1fcc11[_0xc956('0x65')],'createdAt':_0x1fcc11[_0xc956('0x66')],'updatedAt':_0x1fcc11[_0xc956('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc956('0x2d')](respondWithFilteredResult(_0x1032d2,_0x2457eb))[_0xc956('0x4f')](handleError(_0x1032d2,null));};exports[_0xc956('0x6a')]=function(_0x40f3b6,_0x20d2e7,_0x23283b){var _0x50b471={};var _0x202fd6={};var _0x513f0f;var _0xdf6f11;return db['WhatsappQueue'][_0xc956('0x5e')]({'where':{'id':_0x40f3b6[_0xc956('0x5c')]['id']}})[_0xc956('0x2d')](handleEntityNotFound(_0x20d2e7,null))['then'](function(_0x1dea10){if(_0x1dea10){_0x513f0f=_0x1dea10;_0x202fd6[_0xc956('0x3c')]=_['keys'](db['Team'][_0xc956('0x39')]);_0x202fd6[_0xc956('0x3d')]=_[_0xc956('0x3e')](_0x40f3b6[_0xc956('0x3d')]);_0x202fd6[_0xc956('0x47')]=_[_0xc956('0x3f')](_0x202fd6['model'],_0x202fd6['query']);_0x50b471['attributes']=_[_0xc956('0x3f')](_0x202fd6['model'],qs[_0xc956('0x50')](_0x40f3b6['query']['fields']));_0x50b471[_0xc956('0x40')]=_0x50b471[_0xc956('0x40')]['length']?_0x50b471[_0xc956('0x40')]:_0x202fd6[_0xc956('0x3c')];_0x50b471['order']=qs[_0xc956('0x44')](_0x40f3b6[_0xc956('0x3d')][_0xc956('0x44')]);_0x50b471[_0xc956('0x45')]=qs[_0xc956('0x47')](_['pick'](_0x40f3b6[_0xc956('0x3d')],_0x202fd6[_0xc956('0x47')]));if(_0x40f3b6['query']['filter']){_0x50b471[_0xc956('0x45')]=_[_0xc956('0x4b')](_0x50b471[_0xc956('0x45')],{'$or':_[_0xc956('0x37')](_0x50b471['attributes'],function(_0x55598c){var _0x3d8a8e={};_0x3d8a8e[_0x55598c]={'$like':'%'+_0x40f3b6[_0xc956('0x3d')]['filter']+'%'};return _0x3d8a8e;})});}_0x50b471=_[_0xc956('0x4b')]({},_0x50b471,_0x40f3b6['options']);return _0x513f0f[_0xc956('0x6a')](_0x50b471);}})['then'](function(_0x56261b){if(_0x56261b){_0xdf6f11=_0x56261b[_0xc956('0x41')];if(!_0x40f3b6[_0xc956('0x3d')][_0xc956('0x42')]('nolimit')){_0x50b471[_0xc956('0x28')]=qs[_0xc956('0x28')](_0x40f3b6[_0xc956('0x3d')][_0xc956('0x28')]);_0x50b471[_0xc956('0x25')]=qs[_0xc956('0x25')](_0x40f3b6['query'][_0xc956('0x25')]);}return _0x513f0f[_0xc956('0x6a')](_0x50b471);}})[_0xc956('0x2d')](function(_0x472dbb){if(_0x472dbb){return _0x472dbb?{'count':_0xdf6f11,'rows':_0x472dbb}:null;}})['then'](respondWithResult(_0x20d2e7,null))[_0xc956('0x4f')](handleError(_0x20d2e7,null));};exports[_0xc956('0x6b')]=function(_0x256126,_0x2f89bf,_0x3b1c5f){var _0x18da59=_0x256126[_0xc956('0x53')]['ids'];return db[_0xc956('0x6c')][_0xc956('0x61')]({'where':{'id':_0x18da59},'attributes':['id'],'include':[{'model':db[_0xc956('0x62')],'as':_0xc956('0x6d'),'attributes':['id',_0xc956('0x34'),'online','voicePause',_0xc956('0x6e')],'raw':!![]}]})[_0xc956('0x2d')](function(_0x1089e7){if(_0x1089e7){var _0x56b9f7=_[_0xc956('0x6f')](_0x1089e7,function(_0xda06cf){var _0x204813=_0xda06cf[_0xc956('0x2e')]({'plain':!![]});return _0x204813[_0xc956('0x6d')];});return db[_0xc956('0x38')][_0xc956('0x52')]({'where':{'id':_0x256126[_0xc956('0x5c')]['id']}})['then'](function(_0x1e781b){return db[_0xc956('0x70')][_0xc956('0x71')](function(_0x582098){return _0x1e781b['addTeams'](_0x18da59,{'transaction':_0x582098})[_0xc956('0x2d')](function(){return BPromise[_0xc956('0x72')](_0x56b9f7,function(_0x4c1d93){return db['UserWhatsappQueue'][_0xc956('0x73')]({'where':{'UserId':_0x4c1d93['id'],'WhatsappQueueId':_0x256126[_0xc956('0x5c')]['id']},'transaction':_0x582098});});})[_0xc956('0x2d')](function(){_0x56b9f7[_0xc956('0x74')](function(_0x5b98aa){socket[_0xc956('0x75')](_0xc956('0x76'),{'UserId':_0x5b98aa['id'],'WhatsappQueueId':_0x1e781b['id']});});});});});}})['then'](respondWithStatusCode(_0x2f89bf,null))[_0xc956('0x4f')](handleError(_0x2f89bf,null));};exports[_0xc956('0x77')]=function(_0x322bf8,_0x5f4230,_0x49e003){return db[_0xc956('0x6c')][_0xc956('0x61')]({'where':{'id':_0x322bf8['query'][_0xc956('0x78')]},'attributes':['id'],'include':[{'model':db[_0xc956('0x62')],'as':_0xc956('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xc956('0x2d')](handleEntityNotFound(_0x5f4230,null))['then'](function(_0x1a935f){var _0x4447db=_['map'](_0x1a935f,'id');var _0x3312eb=[];var _0x30338b=[];var _0x35c181=squel[_0xc956('0x79')]();_0x35c181['field']('tq.TeamId')[_0xc956('0x7a')]('team_has_whatsapp_queues','tq')[_0xc956('0x7b')](_0xc956('0x7c'),'ut',_0xc956('0x7d'))['where'](_0xc956('0x7e'),_0x322bf8[_0xc956('0x5c')]['id']);for(var _0x4dad21=0x0;_0x4dad21<_0x1a935f['length'];_0x4dad21+=0x1){let _0x27b539=_0x1a935f[_0x4dad21];for(var _0x354312=0x0;_0x354312<_0x27b539[_0xc956('0x6d')][_0xc956('0x41')];_0x354312+=0x1){let _0x40ad53=_0x27b539[_0xc956('0x6d')][_0x354312];var _0x2e5cee=_0x35c181['clone']();_0x2e5cee[_0xc956('0x45')](_0xc956('0x7f'),_0x40ad53['id']);_0x30338b[_0xc956('0x80')](db[_0xc956('0x70')]['query'](_0x2e5cee[_0xc956('0x81')](),{'type':db[_0xc956('0x70')][_0xc956('0x82')][_0xc956('0x83')]})['then'](function(_0xe64a29){if(_0xe64a29[_0xc956('0x41')]===0x1){return _0x40ad53['id'];}else{var _0x435654=_[_0xc956('0x84')](_[_0xc956('0x37')](_0xe64a29,_0xc956('0x85')),function(_0x39f055){return _[_0xc956('0x86')](_0x4447db,_0x39f055);});if(_0x435654){return _0x40ad53['id'];}}}));}}return BPromise[_0xc956('0x87')](_0x30338b)[_0xc956('0x2d')](function(_0x11dd70){_0x3312eb=_(_0x3312eb)[_0xc956('0x88')](_0x11dd70)['compact']()[_0xc956('0x89')]();return db[_0xc956('0x38')][_0xc956('0x52')]({'where':{'id':_0x322bf8[_0xc956('0x5c')]['id']}})[_0xc956('0x2d')](function(_0x5ba14e){return db[_0xc956('0x70')]['transaction'](function(_0xc9bd21){return _0x5ba14e[_0xc956('0x77')](_0x322bf8[_0xc956('0x3d')][_0xc956('0x78')],{'transaction':_0xc9bd21})[_0xc956('0x2d')](function(){if(!_[_0xc956('0x8a')](_0x3312eb)){return _0x5ba14e[_0xc956('0x8b')](_0x3312eb,{'transaction':_0xc9bd21});}})[_0xc956('0x2d')](function(){_0x3312eb['forEach'](function(_0x3622d6){socket[_0xc956('0x75')](_0xc956('0x8c'),{'UserId':_0x3622d6,'WhatsappQueueId':_0x5ba14e['id']});});});});});});})[_0xc956('0x2d')](respondWithStatusCode(_0x5f4230,null))[_0xc956('0x4f')](handleError(_0x5f4230,null));};exports['addAgents']=function(_0x1f8ef4,_0x42bc51,_0xc084e2){return db['WhatsappQueue'][_0xc956('0x52')]({'where':{'id':_0x1f8ef4[_0xc956('0x5c')]['id']}})[_0xc956('0x2d')](handleEntityNotFound(_0x42bc51,null))[_0xc956('0x2d')](function(_0x1d9379){if(_0x1d9379){return _0x1d9379[_0xc956('0x8d')](_0x1f8ef4[_0xc956('0x53')][_0xc956('0x78')],_[_0xc956('0x8e')](_0x1f8ef4['body'],[_0xc956('0x78'),'id'])||{})[_0xc956('0x8f')](function(_0x345a3a){for(var _0x5c1e0e=0x0;_0x5c1e0e<_0x1f8ef4[_0xc956('0x53')]['ids'][_0xc956('0x41')];_0x5c1e0e+=0x1){socket[_0xc956('0x75')](_0xc956('0x76'),{'UserId':Number(_0x1f8ef4[_0xc956('0x53')]['ids'][_0x5c1e0e]),'WhatsappQueueId':Number(_0x1f8ef4[_0xc956('0x5c')]['id'])});}return _0x345a3a;});}})[_0xc956('0x2d')](respondWithResult(_0x42bc51,null))[_0xc956('0x4f')](handleError(_0x42bc51,null));};exports[_0xc956('0x8b')]=function(_0x4ff4ad,_0x493517,_0x9c18bd){return db[_0xc956('0x38')][_0xc956('0x52')]({'where':{'id':_0x4ff4ad['params']['id']}})[_0xc956('0x2d')](handleEntityNotFound(_0x493517,null))['then'](function(_0x3be51f){if(_0x3be51f){return _0x3be51f[_0xc956('0x8b')](_0x4ff4ad[_0xc956('0x3d')][_0xc956('0x78')])[_0xc956('0x2d')](function(){if(_['isArray'](_0x4ff4ad[_0xc956('0x3d')][_0xc956('0x78')])){for(var _0x226162=0x0;_0x226162<_0x4ff4ad[_0xc956('0x3d')]['ids'][_0xc956('0x41')];_0x226162+=0x1){socket[_0xc956('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x4ff4ad[_0xc956('0x3d')][_0xc956('0x78')][_0x226162]),'WhatsappQueueId':Number(_0x4ff4ad[_0xc956('0x5c')]['id'])});}}else{socket[_0xc956('0x75')](_0xc956('0x8c'),{'UserId':Number(_0x4ff4ad[_0xc956('0x3d')][_0xc956('0x78')]),'WhatsappQueueId':Number(_0x4ff4ad[_0xc956('0x5c')]['id'])});}});}})[_0xc956('0x2d')](respondWithStatusCode(_0x493517,null))['catch'](handleError(_0x493517,null));};exports[_0xc956('0x90')]=function(_0x449976,_0x5e7896,_0x3b2919){var _0x5427f2={};var _0x94d19d={};var _0x56b74a;var _0x237a24;return db[_0xc956('0x38')][_0xc956('0x5e')]({'where':{'id':_0x449976[_0xc956('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5e7896,null))[_0xc956('0x2d')](function(_0x1806fd){if(_0x1806fd){_0x56b74a=_0x1806fd;_0x94d19d[_0xc956('0x3c')]=_[_0xc956('0x3e')](db[_0xc956('0x62')][_0xc956('0x39')]);_0x94d19d[_0xc956('0x3d')]=_[_0xc956('0x3e')](_0x449976[_0xc956('0x3d')]);_0x94d19d['filters']=_['intersection'](_0x94d19d['model'],_0x94d19d[_0xc956('0x3d')]);_0x5427f2[_0xc956('0x40')]=_[_0xc956('0x3f')](_0x94d19d['model'],qs[_0xc956('0x50')](_0x449976['query'][_0xc956('0x50')]));_0x5427f2[_0xc956('0x40')]=_0x5427f2[_0xc956('0x40')][_0xc956('0x41')]?_0x5427f2[_0xc956('0x40')]:_0x94d19d[_0xc956('0x3c')];_0x5427f2['order']=qs[_0xc956('0x44')](_0x449976['query'][_0xc956('0x44')]);_0x5427f2['where']=qs[_0xc956('0x47')](_[_0xc956('0x46')](_0x449976['query'],_0x94d19d[_0xc956('0x47')]));if(_0x449976[_0xc956('0x3d')][_0xc956('0x48')]){_0x5427f2[_0xc956('0x45')]=_[_0xc956('0x4b')](_0x5427f2[_0xc956('0x45')],{'$or':_['map'](_0x5427f2[_0xc956('0x40')],function(_0x579cc2){var _0x263078={};_0x263078[_0x579cc2]={'$like':'%'+_0x449976['query']['filter']+'%'};return _0x263078;})});}_0x5427f2=_[_0xc956('0x4b')]({},_0x5427f2,_0x449976['options']);return _0x56b74a['getAgents'](_0x5427f2);}})[_0xc956('0x2d')](function(_0x1c01b0){if(_0x1c01b0){_0x237a24=_0x1c01b0['length'];if(!_0x449976[_0xc956('0x3d')][_0xc956('0x42')](_0xc956('0x43'))){_0x5427f2['limit']=qs['limit'](_0x449976[_0xc956('0x3d')][_0xc956('0x28')]);_0x5427f2[_0xc956('0x25')]=qs[_0xc956('0x25')](_0x449976[_0xc956('0x3d')][_0xc956('0x25')]);}return _0x56b74a[_0xc956('0x90')](_0x5427f2);}})[_0xc956('0x2d')](function(_0x3db071){if(_0x3db071){return _0x3db071?{'count':_0x237a24,'rows':_0x3db071}:null;}})[_0xc956('0x2d')](respondWithResult(_0x5e7896,null))['catch'](handleError(_0x5e7896,null));}; \ No newline at end of file +var _0x26d6=['send','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','update','describe','getMembers','findOne','UserWhatsappQueue','findAndCountAll','UserId','agent','updatedAt','%s/%s','SIP','getTeams','addTeams','Team','User','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','union','value','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','stack','name'];(function(_0x35ace7,_0xbd1eaa){var _0x203523=function(_0x455ff){while(--_0x455ff){_0x35ace7['push'](_0x35ace7['shift']());}};_0x203523(++_0xbd1eaa);}(_0x26d6,0xe8));var _0x626d=function(_0x33ceeb,_0x58b863){_0x33ceeb=_0x33ceeb-0x0;var _0x5b6556=_0x26d6[_0x33ceeb];return _0x5b6556;};'use strict';var emlformat=require(_0x626d('0x0'));var rimraf=require(_0x626d('0x1'));var zipdir=require(_0x626d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x626d('0x3'));var moment=require('moment');var BPromise=require(_0x626d('0x4'));var Mustache=require(_0x626d('0x5'));var util=require(_0x626d('0x6'));var path=require(_0x626d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x626d('0x8'));var fs=require('fs');var fs_extra=require(_0x626d('0x9'));var _=require(_0x626d('0xa'));var squel=require('squel');var crypto=require(_0x626d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x626d('0xc'));var toCsv=require(_0x626d('0xd'));var querystring=require(_0x626d('0xe'));var Papa=require(_0x626d('0xf'));var Redis=require(_0x626d('0x10'));var authService=require(_0x626d('0x11'));var qs=require(_0x626d('0x12'));var as=require(_0x626d('0x13'));var hardwareService=require(_0x626d('0x14'));var logger=require(_0x626d('0x15'))(_0x626d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x626d('0x17'))['db'];config[_0x626d('0x18')]=_['defaults'](config[_0x626d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x626d('0x19'))(new Redis(config[_0x626d('0x18')]));require(_0x626d('0x1a'))[_0x626d('0x1b')](socket);function respondWithStatusCode(_0x1f7a50,_0xd64635){_0xd64635=_0xd64635||0xcc;return function(_0x46389b){if(_0x46389b){return _0x1f7a50[_0x626d('0x1c')](_0xd64635);}return _0x1f7a50[_0x626d('0x1d')](_0xd64635)[_0x626d('0x1e')]();};}function respondWithResult(_0x4d0d62,_0x23f1f4){_0x23f1f4=_0x23f1f4||0xc8;return function(_0x5347f7){if(_0x5347f7){return _0x4d0d62[_0x626d('0x1d')](_0x23f1f4)[_0x626d('0x1f')](_0x5347f7);}};}function respondWithFilteredResult(_0x470536,_0x17af3d){return function(_0xa2d0dd){if(_0xa2d0dd){var _0x3ecc52=typeof _0x17af3d['offset']===_0x626d('0x20')&&typeof _0x17af3d[_0x626d('0x21')]==='undefined';var _0x1b5af3=_0xa2d0dd[_0x626d('0x22')];var _0x38d052=_0x3ecc52?0x0:_0x17af3d[_0x626d('0x23')];var _0x532112=_0x3ecc52?_0xa2d0dd[_0x626d('0x22')]:_0x17af3d[_0x626d('0x23')]+_0x17af3d[_0x626d('0x21')];var _0x5cd6d4;if(_0x532112>=_0x1b5af3){_0x532112=_0x1b5af3;_0x5cd6d4=0xc8;}else{_0x5cd6d4=0xce;}_0x470536['status'](_0x5cd6d4);return _0x470536[_0x626d('0x24')](_0x626d('0x25'),_0x38d052+'-'+_0x532112+'/'+_0x1b5af3)['json'](_0xa2d0dd);}return null;};}function patchUpdates(_0x5b0d5a){return function(_0x4e7d94){try{jsonpatch[_0x626d('0x26')](_0x4e7d94,_0x5b0d5a,!![]);}catch(_0x30b507){return BPromise[_0x626d('0x27')](_0x30b507);}return _0x4e7d94[_0x626d('0x28')]();};}function saveUpdates(_0x642b91,_0x208f9a){return function(_0x8cdd3){if(_0x8cdd3){return _0x8cdd3['update'](_0x642b91)[_0x626d('0x29')](function(_0x2e0671){return _0x2e0671;});}return null;};}function removeEntity(_0x19a8a5,_0x4cb300){return function(_0x3ddc91){if(_0x3ddc91){return _0x3ddc91[_0x626d('0x2a')]()[_0x626d('0x29')](function(){var _0x3425f2=_0x3ddc91[_0x626d('0x2b')]({'plain':!![]});var _0xf71435='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xf71435,'resourceId':_0x3425f2['id']}})[_0x626d('0x29')](function(){return _0x3ddc91;});})['then'](function(){_0x19a8a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cec33,_0x36918d){return function(_0xccc27e){if(!_0xccc27e){_0x5cec33[_0x626d('0x1c')](0x194);}return _0xccc27e;};}function handleError(_0x1a0713,_0x4d8fc7){_0x4d8fc7=_0x4d8fc7||0x1f4;return function(_0x558933){logger['error'](_0x558933[_0x626d('0x2c')]);if(_0x558933[_0x626d('0x2d')]){delete _0x558933[_0x626d('0x2d')];}_0x1a0713[_0x626d('0x1d')](_0x4d8fc7)[_0x626d('0x2e')](_0x558933);};}exports[_0x626d('0x2f')]=function(_0xf9dc77,_0x11ed4e){var _0x4dbff3={},_0x5eb43a={},_0x45f59c={'count':0x0,'rows':[]};var _0x5b7d47=_[_0x626d('0x30')](db[_0x626d('0x31')][_0x626d('0x32')],function(_0x5d95b5){return{'name':_0x5d95b5[_0x626d('0x33')],'type':_0x5d95b5['type'][_0x626d('0x34')]};});_0x5eb43a[_0x626d('0x35')]=_['map'](_0x5b7d47,_0x626d('0x2d'));_0x5eb43a['query']=_[_0x626d('0x36')](_0xf9dc77['query']);_0x5eb43a[_0x626d('0x37')]=_[_0x626d('0x38')](_0x5eb43a[_0x626d('0x35')],_0x5eb43a[_0x626d('0x39')]);_0x4dbff3[_0x626d('0x3a')]=_['intersection'](_0x5eb43a[_0x626d('0x35')],qs[_0x626d('0x3b')](_0xf9dc77[_0x626d('0x39')][_0x626d('0x3b')]));_0x4dbff3['attributes']=_0x4dbff3[_0x626d('0x3a')]['length']?_0x4dbff3[_0x626d('0x3a')]:_0x5eb43a[_0x626d('0x35')];if(!_0xf9dc77[_0x626d('0x39')][_0x626d('0x3c')](_0x626d('0x3d'))){_0x4dbff3['limit']=qs['limit'](_0xf9dc77[_0x626d('0x39')]['limit']);_0x4dbff3[_0x626d('0x23')]=qs[_0x626d('0x23')](_0xf9dc77[_0x626d('0x39')][_0x626d('0x23')]);}_0x4dbff3[_0x626d('0x3e')]=qs[_0x626d('0x3f')](_0xf9dc77[_0x626d('0x39')][_0x626d('0x3f')]);_0x4dbff3[_0x626d('0x40')]=qs[_0x626d('0x37')](_[_0x626d('0x41')](_0xf9dc77[_0x626d('0x39')],_0x5eb43a[_0x626d('0x37')]),_0x5b7d47);if(_0xf9dc77['query']['filter']){_0x4dbff3[_0x626d('0x40')]=_['merge'](_0x4dbff3[_0x626d('0x40')],{'$or':_['map'](_0x5b7d47,function(_0x454804){if(_0x454804[_0x626d('0x42')]!==_0x626d('0x43')){var _0x3cceb7={};_0x3cceb7[_0x454804['name']]={'$like':'%'+_0xf9dc77[_0x626d('0x39')][_0x626d('0x44')]+'%'};return _0x3cceb7;}})});}_0x4dbff3=_['merge']({},_0x4dbff3,_0xf9dc77[_0x626d('0x45')]);var _0x29e992={'where':_0x4dbff3[_0x626d('0x40')]};return db[_0x626d('0x31')]['count'](_0x29e992)[_0x626d('0x29')](function(_0x207d38){_0x45f59c[_0x626d('0x22')]=_0x207d38;if(_0xf9dc77[_0x626d('0x39')][_0x626d('0x46')]){_0x4dbff3[_0x626d('0x47')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x626d('0x48')](_0x4dbff3);})[_0x626d('0x29')](function(_0x47fd8f){_0x45f59c[_0x626d('0x49')]=_0x47fd8f;return _0x45f59c;})['then'](respondWithFilteredResult(_0x11ed4e,_0x4dbff3))[_0x626d('0x4a')](handleError(_0x11ed4e,null));};exports['show']=function(_0x10b739,_0x10c7ed){var _0x4bd902={'raw':!![],'where':{'id':_0x10b739[_0x626d('0x4b')]['id']}},_0x577509={};_0x577509[_0x626d('0x35')]=_[_0x626d('0x36')](db['WhatsappQueue'][_0x626d('0x32')]);_0x577509[_0x626d('0x39')]=_[_0x626d('0x36')](_0x10b739[_0x626d('0x39')]);_0x577509[_0x626d('0x37')]=_['intersection'](_0x577509['model'],_0x577509[_0x626d('0x39')]);_0x4bd902[_0x626d('0x3a')]=_[_0x626d('0x38')](_0x577509[_0x626d('0x35')],qs[_0x626d('0x3b')](_0x10b739[_0x626d('0x39')][_0x626d('0x3b')]));_0x4bd902[_0x626d('0x3a')]=_0x4bd902['attributes'][_0x626d('0x4c')]?_0x4bd902[_0x626d('0x3a')]:_0x577509[_0x626d('0x35')];if(_0x10b739[_0x626d('0x39')][_0x626d('0x46')]){_0x4bd902[_0x626d('0x47')]=[{'all':!![]}];}_0x4bd902=_[_0x626d('0x4d')]({},_0x4bd902,_0x10b739[_0x626d('0x45')]);return db[_0x626d('0x31')][_0x626d('0x4e')](_0x4bd902)[_0x626d('0x29')](handleEntityNotFound(_0x10c7ed,null))[_0x626d('0x29')](respondWithResult(_0x10c7ed,null))[_0x626d('0x4a')](handleError(_0x10c7ed,null));};exports[_0x626d('0x4f')]=function(_0x55a047,_0x3398b4){return db[_0x626d('0x31')][_0x626d('0x4f')](_0x55a047[_0x626d('0x50')],{})['then'](function(_0x30984b){var _0x871d5=_0x55a047[_0x626d('0x51')]['get']({'plain':!![]});if(!_0x871d5)throw new Error(_0x626d('0x52'));if(_0x871d5[_0x626d('0x53')]===_0x626d('0x51')){var _0x18cdbc=_0x30984b[_0x626d('0x2b')]({'plain':!![]});var _0x5a84ea=_0x626d('0x54');return db[_0x626d('0x55')]['find']({'where':{'name':_0x5a84ea,'userProfileId':_0x871d5[_0x626d('0x56')]},'raw':!![]})[_0x626d('0x29')](function(_0x12ad66){if(_0x12ad66&&_0x12ad66[_0x626d('0x57')]===0x0){return db[_0x626d('0x58')][_0x626d('0x4f')]({'name':_0x18cdbc[_0x626d('0x2d')],'resourceId':_0x18cdbc['id'],'type':_0x12ad66[_0x626d('0x2d')],'sectionId':_0x12ad66['id']},{})[_0x626d('0x29')](function(){return _0x30984b;});}else{return _0x30984b;}})[_0x626d('0x4a')](function(_0x4b1cf4){logger[_0x626d('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b1cf4);throw _0x4b1cf4;});}return _0x30984b;})[_0x626d('0x29')](respondWithResult(_0x3398b4,0xc9))[_0x626d('0x4a')](handleError(_0x3398b4,null));};exports[_0x626d('0x5a')]=function(_0x113331,_0x1296e7){if(_0x113331[_0x626d('0x50')]['id']){delete _0x113331[_0x626d('0x50')]['id'];}return db[_0x626d('0x31')][_0x626d('0x4e')]({'where':{'id':_0x113331[_0x626d('0x4b')]['id']}})[_0x626d('0x29')](handleEntityNotFound(_0x1296e7,null))['then'](saveUpdates(_0x113331[_0x626d('0x50')],null))[_0x626d('0x29')](respondWithResult(_0x1296e7,null))[_0x626d('0x4a')](handleError(_0x1296e7,null));};exports['destroy']=function(_0x39c820,_0x197a01){return db[_0x626d('0x31')][_0x626d('0x4e')]({'where':{'id':_0x39c820[_0x626d('0x4b')]['id']}})[_0x626d('0x29')](handleEntityNotFound(_0x197a01,null))[_0x626d('0x29')](removeEntity(_0x197a01,null))['catch'](handleError(_0x197a01,null));};exports['describe']=function(_0x14e0a4,_0x6372bf){return db[_0x626d('0x31')][_0x626d('0x5b')]()['then'](respondWithResult(_0x6372bf,null))[_0x626d('0x4a')](handleError(_0x6372bf,null));};exports[_0x626d('0x5c')]=function(_0x323235,_0x58ac46,_0x57cc55){var _0x4b6773={'raw':!![],'where':{}},_0x73a452={},_0x23a769;return db['WhatsappQueue'][_0x626d('0x5d')]({'where':{'id':_0x323235[_0x626d('0x4b')]['id']}})[_0x626d('0x29')](handleEntityNotFound(_0x58ac46,null))[_0x626d('0x29')](function(_0x5c87bf){if(_0x5c87bf){_0x23a769=_0x5c87bf['get']({'plain':!![]});_0x73a452[_0x626d('0x35')]=_[_0x626d('0x36')](db[_0x626d('0x5e')]['rawAttributes']);_0x73a452[_0x626d('0x39')]=_[_0x626d('0x36')](_0x323235[_0x626d('0x39')]);_0x73a452[_0x626d('0x37')]=_[_0x626d('0x38')](_0x73a452[_0x626d('0x35')],_0x73a452[_0x626d('0x39')]);_0x4b6773['attributes']=_[_0x626d('0x38')](_0x73a452[_0x626d('0x35')],qs['fields'](_0x323235[_0x626d('0x39')][_0x626d('0x3b')]));_0x4b6773[_0x626d('0x3a')]=_0x4b6773['attributes'][_0x626d('0x4c')]?_0x4b6773['attributes']:_0x73a452[_0x626d('0x35')];if(!_0x323235[_0x626d('0x39')][_0x626d('0x3c')](_0x626d('0x3d'))){_0x4b6773['limit']=qs[_0x626d('0x21')](_0x323235[_0x626d('0x39')][_0x626d('0x21')]);_0x4b6773[_0x626d('0x23')]=qs[_0x626d('0x23')](_0x323235[_0x626d('0x39')][_0x626d('0x23')]);}_0x4b6773[_0x626d('0x3e')]=qs[_0x626d('0x3f')](_0x323235['query'][_0x626d('0x3f')]);_0x4b6773[_0x626d('0x40')]=qs['filters'](_[_0x626d('0x41')](_0x323235['query'],_0x73a452['filters']));_0x4b6773['where']['WhatsappQueueId']=_0x5c87bf['id'];if(_0x323235[_0x626d('0x39')][_0x626d('0x44')]){_0x4b6773['where']=_[_0x626d('0x4d')](_0x4b6773['where'],{'$or':_['map'](_0x4b6773['attributes'],function(_0xe50d12){var _0x1bdcd4={};_0x1bdcd4[_0xe50d12]={'$like':'%'+_0x323235[_0x626d('0x39')]['filter']+'%'};return _0x1bdcd4;})});}_0x4b6773=_[_0x626d('0x4d')]({},_0x4b6773,_0x323235[_0x626d('0x45')]);return db[_0x626d('0x5e')][_0x626d('0x48')](_0x4b6773);}})[_0x626d('0x29')](function(_0x2a7001){if(_0x2a7001){return db['User'][_0x626d('0x5f')]({'where':{'id':_['map'](_0x2a7001,_0x626d('0x60')),'role':_0x626d('0x61')},'attributes':['id','name','whatsappPause',_0x626d('0x62'),'createdAt']});}})[_0x626d('0x29')](function(_0x19f033){if(_0x19f033){return{'count':_0x19f033[_0x626d('0x22')],'rows':_[_0x626d('0x30')](_0x19f033['rows'],function(_0x50478e){return{'membername':_0x50478e[_0x626d('0x2d')],'UserId':_0x50478e['id'],'queue_name':_0x23a769[_0x626d('0x2d')],'WhatsappQueueId':_0x23a769['id'],'interface':util['format'](_0x626d('0x63'),_0x626d('0x64'),_0x50478e['name']),'penalty':0x0,'paused':_0x50478e['whatsappPause'],'createdAt':_0x50478e['createdAt'],'updatedAt':_0x50478e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x626d('0x29')](respondWithFilteredResult(_0x58ac46,_0x4b6773))['catch'](handleError(_0x58ac46,null));};exports[_0x626d('0x65')]=function(_0x48ffcc,_0x58e598,_0xe7319c){var _0x371798={};var _0x3f5534={};var _0x4b61f1;var _0x2193fd;return db[_0x626d('0x31')][_0x626d('0x5d')]({'where':{'id':_0x48ffcc[_0x626d('0x4b')]['id']}})[_0x626d('0x29')](handleEntityNotFound(_0x58e598,null))[_0x626d('0x29')](function(_0x37a649){if(_0x37a649){_0x4b61f1=_0x37a649;_0x3f5534[_0x626d('0x35')]=_[_0x626d('0x36')](db['Team'][_0x626d('0x32')]);_0x3f5534[_0x626d('0x39')]=_[_0x626d('0x36')](_0x48ffcc[_0x626d('0x39')]);_0x3f5534[_0x626d('0x37')]=_['intersection'](_0x3f5534[_0x626d('0x35')],_0x3f5534[_0x626d('0x39')]);_0x371798['attributes']=_[_0x626d('0x38')](_0x3f5534[_0x626d('0x35')],qs[_0x626d('0x3b')](_0x48ffcc[_0x626d('0x39')]['fields']));_0x371798['attributes']=_0x371798[_0x626d('0x3a')][_0x626d('0x4c')]?_0x371798[_0x626d('0x3a')]:_0x3f5534[_0x626d('0x35')];_0x371798[_0x626d('0x3e')]=qs[_0x626d('0x3f')](_0x48ffcc[_0x626d('0x39')][_0x626d('0x3f')]);_0x371798[_0x626d('0x40')]=qs[_0x626d('0x37')](_[_0x626d('0x41')](_0x48ffcc[_0x626d('0x39')],_0x3f5534[_0x626d('0x37')]));if(_0x48ffcc['query'][_0x626d('0x44')]){_0x371798[_0x626d('0x40')]=_[_0x626d('0x4d')](_0x371798['where'],{'$or':_[_0x626d('0x30')](_0x371798[_0x626d('0x3a')],function(_0xa4e66d){var _0x5b2741={};_0x5b2741[_0xa4e66d]={'$like':'%'+_0x48ffcc['query'][_0x626d('0x44')]+'%'};return _0x5b2741;})});}_0x371798=_[_0x626d('0x4d')]({},_0x371798,_0x48ffcc[_0x626d('0x45')]);return _0x4b61f1[_0x626d('0x65')](_0x371798);}})[_0x626d('0x29')](function(_0x2ec851){if(_0x2ec851){_0x2193fd=_0x2ec851[_0x626d('0x4c')];if(!_0x48ffcc['query'][_0x626d('0x3c')]('nolimit')){_0x371798['limit']=qs[_0x626d('0x21')](_0x48ffcc['query']['limit']);_0x371798[_0x626d('0x23')]=qs['offset'](_0x48ffcc[_0x626d('0x39')][_0x626d('0x23')]);}return _0x4b61f1[_0x626d('0x65')](_0x371798);}})[_0x626d('0x29')](function(_0x3823ab){if(_0x3823ab){return _0x3823ab?{'count':_0x2193fd,'rows':_0x3823ab}:null;}})[_0x626d('0x29')](respondWithResult(_0x58e598,null))[_0x626d('0x4a')](handleError(_0x58e598,null));};exports[_0x626d('0x66')]=function(_0x21dde9,_0x3a0bb8,_0x4ff67d){var _0x4eef29=_0x21dde9[_0x626d('0x50')]['ids'];return db[_0x626d('0x67')]['findAll']({'where':{'id':_0x4eef29},'attributes':['id'],'include':[{'model':db[_0x626d('0x68')],'as':_0x626d('0x69'),'attributes':['id',_0x626d('0x2d'),_0x626d('0x6a'),'voicePause',_0x626d('0x6b')],'raw':!![]}]})[_0x626d('0x29')](function(_0x54f5ff){if(_0x54f5ff){var _0x4b73a3=_[_0x626d('0x6c')](_0x54f5ff,function(_0x1695bb){var _0x2c1ace=_0x1695bb[_0x626d('0x2b')]({'plain':!![]});return _0x2c1ace['Agents'];});return db[_0x626d('0x31')][_0x626d('0x4e')]({'where':{'id':_0x21dde9[_0x626d('0x4b')]['id']}})['then'](function(_0x7fc982){return db[_0x626d('0x6d')][_0x626d('0x6e')](function(_0x1b1077){return _0x7fc982['addTeams'](_0x4eef29,{'transaction':_0x1b1077})[_0x626d('0x29')](function(){return BPromise['each'](_0x4b73a3,function(_0xc968fe){return db['UserWhatsappQueue'][_0x626d('0x6f')]({'where':{'UserId':_0xc968fe['id'],'WhatsappQueueId':_0x21dde9[_0x626d('0x4b')]['id']},'transaction':_0x1b1077});});})['then'](function(){_0x4b73a3[_0x626d('0x70')](function(_0xd98ea9){socket[_0x626d('0x71')](_0x626d('0x72'),{'UserId':_0xd98ea9['id'],'WhatsappQueueId':_0x7fc982['id']});});});});});}})[_0x626d('0x29')](respondWithStatusCode(_0x3a0bb8,null))[_0x626d('0x4a')](handleError(_0x3a0bb8,null));};exports[_0x626d('0x73')]=function(_0x255386,_0x1d3a04,_0x3c5b89){return db[_0x626d('0x67')][_0x626d('0x48')]({'where':{'id':_0x255386[_0x626d('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x626d('0x68')],'as':_0x626d('0x69'),'attributes':['id'],'raw':!![]}]})[_0x626d('0x29')](handleEntityNotFound(_0x1d3a04,null))[_0x626d('0x29')](function(_0x218de9){var _0xea42ea=_[_0x626d('0x30')](_0x218de9,'id');var _0x65f334=[];var _0xeb827d=[];var _0x51ab60=squel[_0x626d('0x74')]();_0x51ab60[_0x626d('0x75')](_0x626d('0x76'))['from'](_0x626d('0x77'),'tq')['join'](_0x626d('0x78'),'ut',_0x626d('0x79'))['where'](_0x626d('0x7a'),_0x255386[_0x626d('0x4b')]['id']);for(var _0x249089=0x0;_0x249089<_0x218de9[_0x626d('0x4c')];_0x249089+=0x1){let _0x515f5e=_0x218de9[_0x249089];for(var _0x55d39f=0x0;_0x55d39f<_0x515f5e[_0x626d('0x69')][_0x626d('0x4c')];_0x55d39f+=0x1){let _0xafb136=_0x515f5e[_0x626d('0x69')][_0x55d39f];var _0x265cf8=_0x51ab60[_0x626d('0x7b')]();_0x265cf8[_0x626d('0x40')](_0x626d('0x7c'),_0xafb136['id']);_0xeb827d[_0x626d('0x7d')](db['sequelize'][_0x626d('0x39')](_0x265cf8['toString'](),{'type':db[_0x626d('0x6d')][_0x626d('0x7e')][_0x626d('0x7f')]})[_0x626d('0x29')](function(_0x1325d6){if(_0x1325d6[_0x626d('0x4c')]===0x1){return _0xafb136['id'];}else{var _0x5cbd28=_[_0x626d('0x80')](_['map'](_0x1325d6,'TeamId'),function(_0x11d1f3){return _['includes'](_0xea42ea,_0x11d1f3);});if(_0x5cbd28){return _0xafb136['id'];}}}));}}return BPromise['all'](_0xeb827d)[_0x626d('0x29')](function(_0x427c1a){_0x65f334=_(_0x65f334)[_0x626d('0x81')](_0x427c1a)['compact']()[_0x626d('0x82')]();return db['WhatsappQueue']['find']({'where':{'id':_0x255386[_0x626d('0x4b')]['id']}})[_0x626d('0x29')](function(_0x227d2e){return db[_0x626d('0x6d')]['transaction'](function(_0x251c81){return _0x227d2e['removeTeams'](_0x255386['query'][_0x626d('0x83')],{'transaction':_0x251c81})[_0x626d('0x29')](function(){if(!_[_0x626d('0x84')](_0x65f334)){return _0x227d2e[_0x626d('0x85')](_0x65f334,{'transaction':_0x251c81});}})['then'](function(){_0x65f334[_0x626d('0x70')](function(_0x135792){socket['emit'](_0x626d('0x86'),{'UserId':_0x135792,'WhatsappQueueId':_0x227d2e['id']});});});});});});})[_0x626d('0x29')](respondWithStatusCode(_0x1d3a04,null))[_0x626d('0x4a')](handleError(_0x1d3a04,null));};exports[_0x626d('0x87')]=function(_0x58b731,_0x17919a,_0x8299bf){return db[_0x626d('0x31')][_0x626d('0x4e')]({'where':{'id':_0x58b731[_0x626d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17919a,null))[_0x626d('0x29')](function(_0x1f22f3){if(_0x1f22f3){return _0x1f22f3[_0x626d('0x87')](_0x58b731[_0x626d('0x50')]['ids'],_[_0x626d('0x88')](_0x58b731[_0x626d('0x50')],[_0x626d('0x83'),'id'])||{})[_0x626d('0x89')](function(_0x2f10da){for(var _0x5e38d6=0x0;_0x5e38d6<_0x58b731['body'][_0x626d('0x83')][_0x626d('0x4c')];_0x5e38d6+=0x1){socket[_0x626d('0x71')](_0x626d('0x72'),{'UserId':Number(_0x58b731['body'][_0x626d('0x83')][_0x5e38d6]),'WhatsappQueueId':Number(_0x58b731[_0x626d('0x4b')]['id'])});}return _0x2f10da;});}})[_0x626d('0x29')](respondWithResult(_0x17919a,null))['catch'](handleError(_0x17919a,null));};exports[_0x626d('0x85')]=function(_0x33353e,_0x26f687,_0x1cdba9){return db[_0x626d('0x31')][_0x626d('0x4e')]({'where':{'id':_0x33353e['params']['id']}})[_0x626d('0x29')](handleEntityNotFound(_0x26f687,null))['then'](function(_0x5b603d){if(_0x5b603d){return _0x5b603d['removeAgents'](_0x33353e['query'][_0x626d('0x83')])[_0x626d('0x29')](function(){if(_['isArray'](_0x33353e[_0x626d('0x39')][_0x626d('0x83')])){for(var _0x2812ca=0x0;_0x2812ca<_0x33353e[_0x626d('0x39')][_0x626d('0x83')][_0x626d('0x4c')];_0x2812ca+=0x1){socket[_0x626d('0x71')](_0x626d('0x86'),{'UserId':Number(_0x33353e['query']['ids'][_0x2812ca]),'WhatsappQueueId':Number(_0x33353e['params']['id'])});}}else{socket[_0x626d('0x71')](_0x626d('0x86'),{'UserId':Number(_0x33353e[_0x626d('0x39')][_0x626d('0x83')]),'WhatsappQueueId':Number(_0x33353e[_0x626d('0x4b')]['id'])});}});}})[_0x626d('0x29')](respondWithStatusCode(_0x26f687,null))['catch'](handleError(_0x26f687,null));};exports[_0x626d('0x8a')]=function(_0x4032f0,_0x5de6de,_0x120b33){var _0xbc2d80={};var _0x5e817b={};var _0x51075a;var _0x53a5fa;return db[_0x626d('0x31')][_0x626d('0x5d')]({'where':{'id':_0x4032f0['params']['id']}})['then'](handleEntityNotFound(_0x5de6de,null))[_0x626d('0x29')](function(_0x29a2d9){if(_0x29a2d9){_0x51075a=_0x29a2d9;_0x5e817b['model']=_[_0x626d('0x36')](db[_0x626d('0x68')][_0x626d('0x32')]);_0x5e817b[_0x626d('0x39')]=_['keys'](_0x4032f0[_0x626d('0x39')]);_0x5e817b[_0x626d('0x37')]=_['intersection'](_0x5e817b[_0x626d('0x35')],_0x5e817b['query']);_0xbc2d80[_0x626d('0x3a')]=_[_0x626d('0x38')](_0x5e817b[_0x626d('0x35')],qs[_0x626d('0x3b')](_0x4032f0[_0x626d('0x39')]['fields']));_0xbc2d80[_0x626d('0x3a')]=_0xbc2d80[_0x626d('0x3a')][_0x626d('0x4c')]?_0xbc2d80[_0x626d('0x3a')]:_0x5e817b[_0x626d('0x35')];_0xbc2d80[_0x626d('0x3e')]=qs[_0x626d('0x3f')](_0x4032f0[_0x626d('0x39')]['sort']);_0xbc2d80['where']=qs[_0x626d('0x37')](_['pick'](_0x4032f0[_0x626d('0x39')],_0x5e817b[_0x626d('0x37')]));if(_0x4032f0[_0x626d('0x39')][_0x626d('0x44')]){_0xbc2d80[_0x626d('0x40')]=_['merge'](_0xbc2d80[_0x626d('0x40')],{'$or':_['map'](_0xbc2d80[_0x626d('0x3a')],function(_0x33b6a2){var _0x310331={};_0x310331[_0x33b6a2]={'$like':'%'+_0x4032f0[_0x626d('0x39')]['filter']+'%'};return _0x310331;})});}_0xbc2d80=_[_0x626d('0x4d')]({},_0xbc2d80,_0x4032f0[_0x626d('0x45')]);return _0x51075a['getAgents'](_0xbc2d80);}})['then'](function(_0x4f5b8d){if(_0x4f5b8d){_0x53a5fa=_0x4f5b8d['length'];if(!_0x4032f0['query'][_0x626d('0x3c')](_0x626d('0x3d'))){_0xbc2d80[_0x626d('0x21')]=qs[_0x626d('0x21')](_0x4032f0['query'][_0x626d('0x21')]);_0xbc2d80[_0x626d('0x23')]=qs[_0x626d('0x23')](_0x4032f0['query']['offset']);}return _0x51075a[_0x626d('0x8a')](_0xbc2d80);}})[_0x626d('0x29')](function(_0x27b6fa){if(_0x27b6fa){return _0x27b6fa?{'count':_0x53a5fa,'rows':_0x27b6fa}:null;}})[_0x626d('0x29')](respondWithResult(_0x5de6de,null))[_0x626d('0x4a')](handleError(_0x5de6de,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 935ca76..72b4908 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 _0xc509=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x43dab5,_0x3e1ec2){var _0x3e771a=function(_0x496ca){while(--_0x496ca){_0x43dab5['push'](_0x43dab5['shift']());}};_0x3e771a(++_0x3e1ec2);}(_0xc509,0x1c1));var _0x9c50=function(_0x19c6c3,_0x329746){_0x19c6c3=_0x19c6c3-0x0;var _0x148eea=_0xc509[_0x19c6c3];return _0x148eea;};'use strict';var EventEmitter=require(_0x9c50('0x0'));var WhatsappQueue=require(_0x9c50('0x1'))['db'][_0x9c50('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9c50('0x3')](0x0);var events={'afterCreate':_0x9c50('0x4'),'afterUpdate':_0x9c50('0x5'),'afterDestroy':_0x9c50('0x6')};function emitEvent(_0x1b039b){return function(_0x4ce15b,_0x2c2fbc,_0x42c973){WhatsappQueueEvents[_0x9c50('0x7')](_0x1b039b+':'+_0x4ce15b['id'],_0x4ce15b);WhatsappQueueEvents['emit'](_0x1b039b,_0x4ce15b);_0x42c973(null);};}for(var e in events){if(events[_0x9c50('0x8')](e)){var event=events[e];WhatsappQueue[_0x9c50('0x9')](e,emitEvent(event));}}module[_0x9c50('0xa')]=WhatsappQueueEvents; \ No newline at end of file +var _0xeb89=['hook','exports','events','../../mysqldb','WhatsappQueue','save','update','remove'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xeb89,0x152));var _0x9eb8=function(_0xe80a34,_0x2d1611){_0xe80a34=_0xe80a34-0x0;var _0x11fa2f=_0xeb89[_0xe80a34];return _0x11fa2f;};'use strict';var EventEmitter=require(_0x9eb8('0x0'));var WhatsappQueue=require(_0x9eb8('0x1'))['db'][_0x9eb8('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9eb8('0x3'),'afterUpdate':_0x9eb8('0x4'),'afterDestroy':_0x9eb8('0x5')};function emitEvent(_0x46f4d9){return function(_0x5e30db,_0x5b5798,_0xeab393){WhatsappQueueEvents['emit'](_0x46f4d9+':'+_0x5e30db['id'],_0x5e30db);WhatsappQueueEvents['emit'](_0x46f4d9,_0x5e30db);_0xeab393(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x9eb8('0x6')](e,emitEvent(event));}}module[_0x9eb8('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 37afa1b..24f84ca 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 _0xbf15=['./whatsappQueue.attributes','exports','WhatsappQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b44ac,_0x25c4a9){var _0x41f1be=function(_0xc32146){while(--_0xc32146){_0x4b44ac['push'](_0x4b44ac['shift']());}};_0x41f1be(++_0x25c4a9);}(_0xbf15,0x18f));var _0x5bf1=function(_0x2b4de1,_0x2caab5){_0x2b4de1=_0x2b4de1-0x0;var _0x28ceba=_0xbf15[_0x2b4de1];return _0x28ceba;};'use strict';var _=require(_0x5bf1('0x0'));var util=require(_0x5bf1('0x1'));var logger=require(_0x5bf1('0x2'))('api');var moment=require(_0x5bf1('0x3'));var BPromise=require(_0x5bf1('0x4'));var rp=require(_0x5bf1('0x5'));var fs=require('fs');var path=require(_0x5bf1('0x6'));var rimraf=require(_0x5bf1('0x7'));var config=require('../../config/environment');var attributes=require(_0x5bf1('0x8'));module[_0x5bf1('0x9')]=function(_0x4c12ed,_0x4451cb){return _0x4c12ed['define'](_0x5bf1('0xa'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf894=['bluebird','request-promise','path','rimraf','./whatsappQueue.attributes','exports','WhatsappQueue','lodash','util','../../config/logger','api','moment'];(function(_0x222df7,_0x3e073f){var _0x2cceae=function(_0x5e69ef){while(--_0x5e69ef){_0x222df7['push'](_0x222df7['shift']());}};_0x2cceae(++_0x3e073f);}(_0xf894,0x14b));var _0x4f89=function(_0x59f01,_0x402b5e){_0x59f01=_0x59f01-0x0;var _0x3d9a2c=_0xf894[_0x59f01];return _0x3d9a2c;};'use strict';var _=require(_0x4f89('0x0'));var util=require(_0x4f89('0x1'));var logger=require(_0x4f89('0x2'))(_0x4f89('0x3'));var moment=require(_0x4f89('0x4'));var BPromise=require(_0x4f89('0x5'));var rp=require(_0x4f89('0x6'));var fs=require('fs');var path=require(_0x4f89('0x7'));var rimraf=require(_0x4f89('0x8'));var config=require('../../config/environment');var attributes=require(_0x4f89('0x9'));module[_0x4f89('0xa')]=function(_0x4320d0,_0x4aac4f){return _0x4320d0['define'](_0x4f89('0xb'),attributes,{'tableName':'whatsapp_queues','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 a71c144..eb2ba09 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 _0x44e9=['include','model','GetWhatsappQueue','debug','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','WhatsappQueue','findAll','options','where','attributes','limit','map'];(function(_0x33f77a,_0x414177){var _0x5925d3=function(_0x2af8a0){while(--_0x2af8a0){_0x33f77a['push'](_0x33f77a['shift']());}};_0x5925d3(++_0x414177);}(_0x44e9,0xb2));var _0x944e=function(_0x588d13,_0x482b28){_0x588d13=_0x588d13-0x0;var _0x55c760=_0x44e9[_0x588d13];return _0x55c760;};'use strict';var _=require(_0x944e('0x0'));var util=require(_0x944e('0x1'));var moment=require(_0x944e('0x2'));var BPromise=require(_0x944e('0x3'));var rs=require(_0x944e('0x4'));var fs=require('fs');var Redis=require(_0x944e('0x5'));var db=require(_0x944e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x944e('0x7'))(_0x944e('0x8'));var config=require(_0x944e('0x9'));var jayson=require(_0x944e('0xa'));var client=jayson[_0x944e('0xb')][_0x944e('0xc')]({'port':0x232a});config['redis']=_[_0x944e('0xd')](config[_0x944e('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x944e('0xf'))(new Redis(config[_0x944e('0xe')]));require(_0x944e('0x10'))[_0x944e('0x11')](socket);function respondWithRpcPromise(_0x241f7b,_0x44c12a,_0x5166c6){return new BPromise(function(_0x444c41,_0x4ab961){return client[_0x944e('0x12')](_0x241f7b,_0x5166c6)[_0x944e('0x13')](function(_0x2229b6){logger['info'](_0x944e('0x14'),_0x44c12a,_0x944e('0x15'));logger['debug'](_0x944e('0x16'),_0x44c12a,_0x944e('0x15'),JSON[_0x944e('0x17')](_0x2229b6));if(_0x2229b6[_0x944e('0x18')]){if(_0x2229b6['error'][_0x944e('0x19')]===0x1f4){logger[_0x944e('0x18')](_0x944e('0x14'),_0x44c12a,_0x2229b6['error'][_0x944e('0x1a')]);return _0x4ab961(_0x2229b6[_0x944e('0x18')]['message']);}logger[_0x944e('0x18')](_0x944e('0x14'),_0x44c12a,_0x2229b6[_0x944e('0x18')][_0x944e('0x1a')]);return _0x444c41(_0x2229b6['error'][_0x944e('0x1a')]);}else{logger[_0x944e('0x1b')](_0x944e('0x14'),_0x44c12a,'request\x20sent');_0x444c41(_0x2229b6[_0x944e('0x1c')][_0x944e('0x1a')]);}})[_0x944e('0x1d')](function(_0x20b1c7){logger['error'](_0x944e('0x14'),_0x44c12a,_0x20b1c7);_0x4ab961(_0x20b1c7);});});}exports['GetWhatsappQueue']=function(_0x56e195){var _0x4da85c=this;return new Promise(function(_0x4a4a89,_0x499d74){return db[_0x944e('0x1e')][_0x944e('0x1f')]({'raw':_0x56e195[_0x944e('0x20')]?_0x56e195[_0x944e('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x56e195['options']?_0x56e195['options'][_0x944e('0x21')]||null:null,'attributes':_0x56e195['options']?_0x56e195['options'][_0x944e('0x22')]||null:null,'limit':_0x56e195[_0x944e('0x20')]?_0x56e195[_0x944e('0x20')][_0x944e('0x23')]||null:null,'include':_0x56e195[_0x944e('0x20')]?_0x56e195['options']['include']?_[_0x944e('0x24')](_0x56e195['options'][_0x944e('0x25')],function(_0x3bdfb3){return{'model':db[_0x3bdfb3[_0x944e('0x26')]],'as':_0x3bdfb3['as'],'attributes':_0x3bdfb3['attributes'],'include':_0x3bdfb3['include']?_[_0x944e('0x24')](_0x3bdfb3[_0x944e('0x25')],function(_0x3143ba){return{'model':db[_0x3143ba[_0x944e('0x26')]],'as':_0x3143ba['as'],'attributes':_0x3143ba[_0x944e('0x22')],'include':_0x3143ba[_0x944e('0x25')]?_['map'](_0x3143ba[_0x944e('0x25')],function(_0xd3caaf){return{'model':db[_0xd3caaf['model']],'as':_0xd3caaf['as'],'attributes':_0xd3caaf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58300a){logger[_0x944e('0x1b')](_0x944e('0x27'),_0x56e195);logger[_0x944e('0x28')](_0x944e('0x27'),_0x56e195,JSON[_0x944e('0x17')](_0x58300a));_0x4a4a89(_0x58300a);})[_0x944e('0x1d')](function(_0x2ea1e9){logger[_0x944e('0x18')]('GetWhatsappQueue',_0x2ea1e9[_0x944e('0x1a')],_0x56e195);_0x499d74(_0x4da85c[_0x944e('0x18')](0x1f4,_0x2ea1e9[_0x944e('0x1a')]));});});};exports[_0x944e('0x29')]=function(_0x3ecb21){var _0x35f6a8=this;return new Promise(function(_0x2e8b52,_0x56cf34){return db[_0x944e('0x1e')][_0x944e('0x2a')]({'raw':_0x3ecb21[_0x944e('0x20')]?_0x3ecb21[_0x944e('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3ecb21[_0x944e('0x20')]?_0x3ecb21[_0x944e('0x20')][_0x944e('0x21')]||null:null,'attributes':_0x3ecb21[_0x944e('0x20')]?_0x3ecb21['options'][_0x944e('0x22')]||null:null,'include':_0x3ecb21[_0x944e('0x20')]?_0x3ecb21['options'][_0x944e('0x25')]?_[_0x944e('0x24')](_0x3ecb21[_0x944e('0x20')]['include'],function(_0x4ac9f8){return{'model':db[_0x4ac9f8[_0x944e('0x26')]],'as':_0x4ac9f8['as'],'attributes':_0x4ac9f8[_0x944e('0x22')],'include':_0x4ac9f8[_0x944e('0x25')]?_[_0x944e('0x24')](_0x4ac9f8['include'],function(_0x365b60){return{'model':db[_0x365b60['model']],'as':_0x365b60['as'],'attributes':_0x365b60[_0x944e('0x22')],'include':_0x365b60[_0x944e('0x25')]?_[_0x944e('0x24')](_0x365b60[_0x944e('0x25')],function(_0x185a2a){return{'model':db[_0x185a2a[_0x944e('0x26')]],'as':_0x185a2a['as'],'attributes':_0x185a2a[_0x944e('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52e788){logger['info'](_0x944e('0x29'),_0x3ecb21);logger['debug']('ShowWhatsappQueue',_0x3ecb21,JSON[_0x944e('0x17')](_0x52e788));_0x2e8b52(_0x52e788);})[_0x944e('0x1d')](function(_0x342e68){logger[_0x944e('0x18')](_0x944e('0x29'),_0x342e68[_0x944e('0x1a')],_0x3ecb21);_0x56cf34(_0x35f6a8[_0x944e('0x18')](0x1f4,_0x342e68['message']));});});}; \ No newline at end of file +var _0x6380=['result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model','debug','find','ShowWhatsappQueue','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x373e70,_0x54fa56){var _0x416092=function(_0x1a5398){while(--_0x1a5398){_0x373e70['push'](_0x373e70['shift']());}};_0x416092(++_0x54fa56);}(_0x6380,0xd8));var _0x0638=function(_0x305563,_0x11a947){_0x305563=_0x305563-0x0;var _0x256609=_0x6380[_0x305563];return _0x256609;};'use strict';var _=require(_0x0638('0x0'));var util=require('util');var moment=require(_0x0638('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0638('0x2'));var db=require(_0x0638('0x3'))['db'];var utils=require(_0x0638('0x4'));var logger=require(_0x0638('0x5'))(_0x0638('0x6'));var config=require(_0x0638('0x7'));var jayson=require(_0x0638('0x8'));var client=jayson[_0x0638('0x9')][_0x0638('0xa')]({'port':0x232a});config['redis']=_[_0x0638('0xb')](config[_0x0638('0xc')],{'host':_0x0638('0xd'),'port':0x18eb});var socket=require(_0x0638('0xe'))(new Redis(config[_0x0638('0xc')]));require('./whatsappQueue.socket')[_0x0638('0xf')](socket);function respondWithRpcPromise(_0x1ce952,_0x56c78f,_0x26d1e8){return new BPromise(function(_0x229aa3,_0x4462af){return client['request'](_0x1ce952,_0x26d1e8)[_0x0638('0x10')](function(_0x51c6d5){logger[_0x0638('0x11')](_0x0638('0x12'),_0x56c78f,_0x0638('0x13'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x56c78f,_0x0638('0x13'),JSON[_0x0638('0x14')](_0x51c6d5));if(_0x51c6d5[_0x0638('0x15')]){if(_0x51c6d5[_0x0638('0x15')][_0x0638('0x16')]===0x1f4){logger[_0x0638('0x15')](_0x0638('0x12'),_0x56c78f,_0x51c6d5['error']['message']);return _0x4462af(_0x51c6d5[_0x0638('0x15')][_0x0638('0x17')]);}logger[_0x0638('0x15')](_0x0638('0x12'),_0x56c78f,_0x51c6d5[_0x0638('0x15')]['message']);return _0x229aa3(_0x51c6d5[_0x0638('0x15')][_0x0638('0x17')]);}else{logger[_0x0638('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x56c78f,_0x0638('0x13'));_0x229aa3(_0x51c6d5[_0x0638('0x18')][_0x0638('0x17')]);}})[_0x0638('0x19')](function(_0xb8dad3){logger[_0x0638('0x15')](_0x0638('0x12'),_0x56c78f,_0xb8dad3);_0x4462af(_0xb8dad3);});});}exports[_0x0638('0x1a')]=function(_0xb52278){var _0x4b46bd=this;return new Promise(function(_0x37a4ba,_0x1e4639){return db[_0x0638('0x1b')][_0x0638('0x1c')]({'raw':_0xb52278[_0x0638('0x1d')]?_0xb52278['options'][_0x0638('0x1e')]===undefined?!![]:![]:!![],'where':_0xb52278[_0x0638('0x1d')]?_0xb52278[_0x0638('0x1d')][_0x0638('0x1f')]||null:null,'attributes':_0xb52278['options']?_0xb52278[_0x0638('0x1d')][_0x0638('0x20')]||null:null,'limit':_0xb52278[_0x0638('0x1d')]?_0xb52278[_0x0638('0x1d')][_0x0638('0x21')]||null:null,'include':_0xb52278['options']?_0xb52278[_0x0638('0x1d')]['include']?_[_0x0638('0x22')](_0xb52278[_0x0638('0x1d')][_0x0638('0x23')],function(_0x30bc20){return{'model':db[_0x30bc20[_0x0638('0x24')]],'as':_0x30bc20['as'],'attributes':_0x30bc20[_0x0638('0x20')],'include':_0x30bc20[_0x0638('0x23')]?_[_0x0638('0x22')](_0x30bc20[_0x0638('0x23')],function(_0x341a71){return{'model':db[_0x341a71[_0x0638('0x24')]],'as':_0x341a71['as'],'attributes':_0x341a71[_0x0638('0x20')],'include':_0x341a71[_0x0638('0x23')]?_[_0x0638('0x22')](_0x341a71['include'],function(_0x3856a7){return{'model':db[_0x3856a7['model']],'as':_0x3856a7['as'],'attributes':_0x3856a7[_0x0638('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0638('0x10')](function(_0x16192e){logger[_0x0638('0x11')](_0x0638('0x1a'),_0xb52278);logger[_0x0638('0x25')](_0x0638('0x1a'),_0xb52278,JSON['stringify'](_0x16192e));_0x37a4ba(_0x16192e);})[_0x0638('0x19')](function(_0x480d9a){logger[_0x0638('0x15')](_0x0638('0x1a'),_0x480d9a[_0x0638('0x17')],_0xb52278);_0x1e4639(_0x4b46bd[_0x0638('0x15')](0x1f4,_0x480d9a[_0x0638('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x1406d0){var _0x17457f=this;return new Promise(function(_0x48445b,_0x3a84ee){return db[_0x0638('0x1b')][_0x0638('0x26')]({'raw':_0x1406d0[_0x0638('0x1d')]?_0x1406d0['options'][_0x0638('0x1e')]===undefined?!![]:![]:!![],'where':_0x1406d0[_0x0638('0x1d')]?_0x1406d0[_0x0638('0x1d')][_0x0638('0x1f')]||null:null,'attributes':_0x1406d0[_0x0638('0x1d')]?_0x1406d0['options'][_0x0638('0x20')]||null:null,'include':_0x1406d0[_0x0638('0x1d')]?_0x1406d0[_0x0638('0x1d')]['include']?_['map'](_0x1406d0[_0x0638('0x1d')][_0x0638('0x23')],function(_0x52ddfa){return{'model':db[_0x52ddfa['model']],'as':_0x52ddfa['as'],'attributes':_0x52ddfa[_0x0638('0x20')],'include':_0x52ddfa[_0x0638('0x23')]?_[_0x0638('0x22')](_0x52ddfa[_0x0638('0x23')],function(_0x500483){return{'model':db[_0x500483['model']],'as':_0x500483['as'],'attributes':_0x500483[_0x0638('0x20')],'include':_0x500483[_0x0638('0x23')]?_[_0x0638('0x22')](_0x500483[_0x0638('0x23')],function(_0x234995){return{'model':db[_0x234995[_0x0638('0x24')]],'as':_0x234995['as'],'attributes':_0x234995[_0x0638('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0638('0x10')](function(_0x414333){logger['info']('ShowWhatsappQueue',_0x1406d0);logger[_0x0638('0x25')](_0x0638('0x27'),_0x1406d0,JSON['stringify'](_0x414333));_0x48445b(_0x414333);})[_0x0638('0x19')](function(_0x11c25f){logger[_0x0638('0x15')](_0x0638('0x27'),_0x11c25f[_0x0638('0x17')],_0x1406d0);_0x3a84ee(_0x17457f[_0x0638('0x15')](0x1f4,_0x11c25f[_0x0638('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 17eebfb..50e5b4c 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 _0x14cd=['save','emit','removeListener','register','whatsappQueue:','./whatsappQueue.events'];(function(_0x4131da,_0x124783){var _0x583242=function(_0x4c899f){while(--_0x4c899f){_0x4131da['push'](_0x4131da['shift']());}};_0x583242(++_0x124783);}(_0x14cd,0x65));var _0xd14c=function(_0x6d77ec,_0x338e01){_0x6d77ec=_0x6d77ec-0x0;var _0x567ac6=_0x14cd[_0x6d77ec];return _0x567ac6;};'use strict';var WhatsappQueueEvents=require(_0xd14c('0x0'));var events=[_0xd14c('0x1'),'remove','update'];function createListener(_0x4fd8dc,_0x1ae5ea){return function(_0x5a94e6){_0x1ae5ea[_0xd14c('0x2')](_0x4fd8dc,_0x5a94e6);};}function removeListener(_0x15f5fc,_0x248120){return function(){WhatsappQueueEvents[_0xd14c('0x3')](_0x15f5fc,_0x248120);};}exports[_0xd14c('0x4')]=function(_0x11cf24){for(var _0x22a74d=0x0,_0x58bf0c=events['length'];_0x22a74d<_0x58bf0c;_0x22a74d++){var _0x131ba2=events[_0x22a74d];var _0x3a9587=createListener(_0xd14c('0x5')+_0x131ba2,_0x11cf24);WhatsappQueueEvents['on'](_0x131ba2,_0x3a9587);}}; \ No newline at end of file +var _0xe8cf=['length','save','emit','removeListener','register'];(function(_0x560526,_0x3e86f4){var _0x18fb22=function(_0x31b03b){while(--_0x31b03b){_0x560526['push'](_0x560526['shift']());}};_0x18fb22(++_0x3e86f4);}(_0xe8cf,0xa1));var _0xfe8c=function(_0x50a8ab,_0x2525fa){_0x50a8ab=_0x50a8ab-0x0;var _0x13f124=_0xe8cf[_0x50a8ab];return _0x13f124;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xfe8c('0x0'),'remove','update'];function createListener(_0x89fd31,_0x4bce2b){return function(_0x2b3c2e){_0x4bce2b[_0xfe8c('0x1')](_0x89fd31,_0x2b3c2e);};}function removeListener(_0x5228d5,_0x3a520f){return function(){WhatsappQueueEvents[_0xfe8c('0x2')](_0x5228d5,_0x3a520f);};}exports[_0xfe8c('0x3')]=function(_0x343b4d){for(var _0x2609ce=0x0,_0x292c13=events[_0xfe8c('0x4')];_0x2609ce<_0x292c13;_0x2609ce++){var _0x491b65=events[_0x2609ce];var _0x348e14=createListener('whatsappQueue:'+_0x491b65,_0x343b4d);WhatsappQueueEvents['on'](_0x491b65,_0x348e14);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index ae8452b..c3f532a 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 _0x6739=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./whatsappQueueReport.controller','index','get','/describe','/:id','isAuthenticated','post','create','update','delete'];(function(_0x16a916,_0x2f7d9e){var _0x4d1447=function(_0x300fd4){while(--_0x300fd4){_0x16a916['push'](_0x16a916['shift']());}};_0x4d1447(++_0x2f7d9e);}(_0x6739,0xd3));var _0x9673=function(_0x4996a5,_0x6d6d37){_0x4996a5=_0x4996a5-0x0;var _0x1b5325=_0x6739[_0x4996a5];return _0x1b5325;};'use strict';var multer=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var path=require(_0x9673('0x2'));var timeout=require(_0x9673('0x3'));var express=require(_0x9673('0x4'));var router=express[_0x9673('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9673('0x6'));var config=require('../../config/environment');var controller=require(_0x9673('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9673('0x8')]);router[_0x9673('0x9')](_0x9673('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x9673('0x9')](_0x9673('0xb'),auth[_0x9673('0xc')](),controller['show']);router[_0x9673('0xd')]('/',auth[_0x9673('0xc')](),controller[_0x9673('0xe')]);router['put'](_0x9673('0xb'),auth[_0x9673('0xc')](),controller[_0x9673('0xf')]);router[_0x9673('0x10')]('/:id',auth[_0x9673('0xc')](),controller[_0x9673('0x11')]);module[_0x9673('0x12')]=router; \ No newline at end of file +var _0x990e=['index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x5cabfd,_0x5dea47){var _0x4bc06c=function(_0x4a2fea){while(--_0x4a2fea){_0x5cabfd['push'](_0x5cabfd['shift']());}};_0x4bc06c(++_0x5dea47);}(_0x990e,0x1c4));var _0xe990=function(_0x133f22,_0x3d0cbb){_0x133f22=_0x133f22-0x0;var _0x5a9fca=_0x990e[_0x133f22];return _0x5a9fca;};'use strict';var multer=require(_0xe990('0x0'));var util=require(_0xe990('0x1'));var path=require(_0xe990('0x2'));var timeout=require(_0xe990('0x3'));var express=require('express');var router=express[_0xe990('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe990('0x5'));var config=require(_0xe990('0x6'));var controller=require(_0xe990('0x7'));router[_0xe990('0x8')]('/',auth[_0xe990('0x9')](),controller[_0xe990('0xa')]);router[_0xe990('0x8')](_0xe990('0xb'),auth[_0xe990('0x9')](),controller[_0xe990('0xc')]);router[_0xe990('0x8')](_0xe990('0xd'),auth['isAuthenticated'](),controller[_0xe990('0xe')]);router[_0xe990('0xf')]('/',auth[_0xe990('0x9')](),controller[_0xe990('0x10')]);router[_0xe990('0x11')](_0xe990('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe990('0x12')](_0xe990('0xd'),auth[_0xe990('0x9')](),controller[_0xe990('0x13')]);module[_0xe990('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 87eaaed..af74b7c 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(_0x731da5,_0x13a21d){var _0x1e3007=function(_0x132775){while(--_0x132775){_0x731da5['push'](_0x731da5['shift']());}};_0x1e3007(++_0x13a21d);}(_0x7a54,0x106));var _0x47a5=function(_0xeacbdb,_0x10b7d5){_0xeacbdb=_0xeacbdb-0x0;var _0x58820f=_0x7a54[_0xeacbdb];return _0x58820f;};'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(_0x2aacfc,_0x50b93f){var _0x14a1c1=function(_0x499452){while(--_0x499452){_0x2aacfc['push'](_0x2aacfc['shift']());}};_0x14a1c1(++_0x50b93f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 5e257d3..9f36f95 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 _0xe820=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','reject','save','update','then','destroy','error','name','index','WhatsappQueueReport','rawAttributes','key','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x1bb572,_0x3674d8){var _0x3716e3=function(_0x5593ed){while(--_0x5593ed){_0x1bb572['push'](_0x1bb572['shift']());}};_0x3716e3(++_0x3674d8);}(_0xe820,0xd2));var _0x0e82=function(_0x93c91,_0x3ecfb7){_0x93c91=_0x93c91-0x0;var _0x1d50ea=_0xe820[_0x93c91];return _0x1d50ea;};'use strict';var emlformat=require(_0x0e82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e82('0x2'));var BPromise=require(_0x0e82('0x3'));var Mustache=require(_0x0e82('0x4'));var util=require('util');var path=require(_0x0e82('0x5'));var sox=require('sox');var csv=require(_0x0e82('0x6'));var ejs=require(_0x0e82('0x7'));var fs=require('fs');var fs_extra=require(_0x0e82('0x8'));var _=require(_0x0e82('0x9'));var squel=require(_0x0e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e82('0xb'));var deskjs=require(_0x0e82('0xc'));var toCsv=require(_0x0e82('0x6'));var querystring=require(_0x0e82('0xd'));var Papa=require(_0x0e82('0xe'));var Redis=require('ioredis');var authService=require(_0x0e82('0xf'));var qs=require(_0x0e82('0x10'));var as=require(_0x0e82('0x11'));var hardwareService=require(_0x0e82('0x12'));var logger=require(_0x0e82('0x13'))(_0x0e82('0x14'));var utils=require(_0x0e82('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e82('0x16'));var db=require(_0x0e82('0x17'))['db'];function respondWithStatusCode(_0x21c40b,_0x1da28a){_0x1da28a=_0x1da28a||0xcc;return function(_0x166dc2){if(_0x166dc2){return _0x21c40b[_0x0e82('0x18')](_0x1da28a);}return _0x21c40b['status'](_0x1da28a)[_0x0e82('0x19')]();};}function respondWithResult(_0x5c161c,_0x48d99b){_0x48d99b=_0x48d99b||0xc8;return function(_0x1e4ddb){if(_0x1e4ddb){return _0x5c161c['status'](_0x48d99b)['json'](_0x1e4ddb);}};}function respondWithFilteredResult(_0x5a2d28,_0x3298c7){return function(_0x4d1aa0){if(_0x4d1aa0){var _0x585b9b=typeof _0x3298c7[_0x0e82('0x1a')]==='undefined'&&typeof _0x3298c7[_0x0e82('0x1b')]===_0x0e82('0x1c');var _0x233c6d=_0x4d1aa0[_0x0e82('0x1d')];var _0x53622b=_0x585b9b?0x0:_0x3298c7[_0x0e82('0x1a')];var _0x310aac=_0x585b9b?_0x4d1aa0[_0x0e82('0x1d')]:_0x3298c7[_0x0e82('0x1a')]+_0x3298c7[_0x0e82('0x1b')];var _0x1230e6;if(_0x310aac>=_0x233c6d){_0x310aac=_0x233c6d;_0x1230e6=0xc8;}else{_0x1230e6=0xce;}_0x5a2d28[_0x0e82('0x1e')](_0x1230e6);return _0x5a2d28[_0x0e82('0x1f')](_0x0e82('0x20'),_0x53622b+'-'+_0x310aac+'/'+_0x233c6d)[_0x0e82('0x21')](_0x4d1aa0);}return null;};}function patchUpdates(_0x5903c){return function(_0x493280){try{jsonpatch['apply'](_0x493280,_0x5903c,!![]);}catch(_0x294696){return BPromise[_0x0e82('0x22')](_0x294696);}return _0x493280[_0x0e82('0x23')]();};}function saveUpdates(_0xb0a31,_0xd48046){return function(_0x1bdad4){if(_0x1bdad4){return _0x1bdad4[_0x0e82('0x24')](_0xb0a31)[_0x0e82('0x25')](function(_0x56b3ad){return _0x56b3ad;});}return null;};}function removeEntity(_0x1b71b4,_0x13f023){return function(_0x3d6c28){if(_0x3d6c28){return _0x3d6c28[_0x0e82('0x26')]()['then'](function(){_0x1b71b4[_0x0e82('0x1e')](0xcc)[_0x0e82('0x19')]();});}};}function handleEntityNotFound(_0x7a9399,_0x16e11c){return function(_0x4900d3){if(!_0x4900d3){_0x7a9399[_0x0e82('0x18')](0x194);}return _0x4900d3;};}function handleError(_0x51dbcd,_0x595319){_0x595319=_0x595319||0x1f4;return function(_0x384f88){logger[_0x0e82('0x27')](_0x384f88['stack']);if(_0x384f88[_0x0e82('0x28')]){delete _0x384f88[_0x0e82('0x28')];}_0x51dbcd[_0x0e82('0x1e')](_0x595319)['send'](_0x384f88);};}exports[_0x0e82('0x29')]=function(_0x25fa4e,_0x4ee65a){var _0xabc536={},_0x59a5b6={},_0x4300f9={'count':0x0,'rows':[]};var _0x3ec302=_['map'](db[_0x0e82('0x2a')][_0x0e82('0x2b')],function(_0x661718){return{'name':_0x661718['fieldName'],'type':_0x661718['type'][_0x0e82('0x2c')]};});_0x59a5b6['model']=_[_0x0e82('0x2d')](_0x3ec302,'name');_0x59a5b6[_0x0e82('0x2e')]=_[_0x0e82('0x2f')](_0x25fa4e[_0x0e82('0x2e')]);_0x59a5b6['filters']=_[_0x0e82('0x30')](_0x59a5b6['model'],_0x59a5b6[_0x0e82('0x2e')]);_0xabc536[_0x0e82('0x31')]=_[_0x0e82('0x30')](_0x59a5b6[_0x0e82('0x32')],qs[_0x0e82('0x33')](_0x25fa4e[_0x0e82('0x2e')]['fields']));_0xabc536[_0x0e82('0x31')]=_0xabc536[_0x0e82('0x31')][_0x0e82('0x34')]?_0xabc536[_0x0e82('0x31')]:_0x59a5b6[_0x0e82('0x32')];if(!_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x35')](_0x0e82('0x36'))){_0xabc536[_0x0e82('0x1b')]=qs[_0x0e82('0x1b')](_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x1b')]);_0xabc536[_0x0e82('0x1a')]=qs[_0x0e82('0x1a')](_0x25fa4e[_0x0e82('0x2e')]['offset']);}_0xabc536[_0x0e82('0x37')]=qs[_0x0e82('0x38')](_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x38')]);_0xabc536['where']=qs[_0x0e82('0x39')](_[_0x0e82('0x3a')](_0x25fa4e['query'],_0x59a5b6[_0x0e82('0x39')]),_0x3ec302);if(_0x25fa4e['query']['filter']){_0xabc536[_0x0e82('0x3b')]=_[_0x0e82('0x3c')](_0xabc536[_0x0e82('0x3b')],{'$or':_[_0x0e82('0x2d')](_0x3ec302,function(_0x61a5ce){if(_0x61a5ce[_0x0e82('0x3d')]!==_0x0e82('0x3e')){var _0x50fed8={};_0x50fed8[_0x61a5ce['name']]={'$like':'%'+_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x3f')]+'%'};return _0x50fed8;}})});}_0xabc536=_[_0x0e82('0x3c')]({},_0xabc536,_0x25fa4e[_0x0e82('0x40')]);var _0x265872={'where':_0xabc536[_0x0e82('0x3b')]};return db[_0x0e82('0x2a')][_0x0e82('0x1d')](_0x265872)['then'](function(_0x3ba181){_0x4300f9[_0x0e82('0x1d')]=_0x3ba181;if(_0x25fa4e[_0x0e82('0x2e')][_0x0e82('0x41')]){_0xabc536[_0x0e82('0x42')]=[{'all':!![]}];}return db[_0x0e82('0x2a')][_0x0e82('0x43')](_0xabc536);})['then'](function(_0x311cb8){_0x4300f9[_0x0e82('0x44')]=_0x311cb8;return _0x4300f9;})[_0x0e82('0x25')](respondWithFilteredResult(_0x4ee65a,_0xabc536))[_0x0e82('0x45')](handleError(_0x4ee65a,null));};exports[_0x0e82('0x46')]=function(_0x423b14,_0x453cd3){var _0x50322b={'raw':!![],'where':{'id':_0x423b14['params']['id']}},_0x581764={};_0x581764['model']=_['keys'](db['WhatsappQueueReport'][_0x0e82('0x2b')]);_0x581764[_0x0e82('0x2e')]=_[_0x0e82('0x2f')](_0x423b14[_0x0e82('0x2e')]);_0x581764[_0x0e82('0x39')]=_[_0x0e82('0x30')](_0x581764[_0x0e82('0x32')],_0x581764[_0x0e82('0x2e')]);_0x50322b['attributes']=_['intersection'](_0x581764[_0x0e82('0x32')],qs[_0x0e82('0x33')](_0x423b14[_0x0e82('0x2e')][_0x0e82('0x33')]));_0x50322b[_0x0e82('0x31')]=_0x50322b[_0x0e82('0x31')][_0x0e82('0x34')]?_0x50322b[_0x0e82('0x31')]:_0x581764['model'];if(_0x423b14[_0x0e82('0x2e')]['includeAll']){_0x50322b[_0x0e82('0x42')]=[{'all':!![]}];}_0x50322b=_['merge']({},_0x50322b,_0x423b14[_0x0e82('0x40')]);return db['WhatsappQueueReport'][_0x0e82('0x47')](_0x50322b)[_0x0e82('0x25')](handleEntityNotFound(_0x453cd3,null))[_0x0e82('0x25')](respondWithResult(_0x453cd3,null))['catch'](handleError(_0x453cd3,null));};exports['create']=function(_0x331668,_0x132c45){return db[_0x0e82('0x2a')]['create'](_0x331668[_0x0e82('0x48')],{})['then'](respondWithResult(_0x132c45,0xc9))[_0x0e82('0x45')](handleError(_0x132c45,null));};exports[_0x0e82('0x24')]=function(_0x162890,_0x64406e){if(_0x162890[_0x0e82('0x48')]['id']){delete _0x162890[_0x0e82('0x48')]['id'];}return db[_0x0e82('0x2a')][_0x0e82('0x47')]({'where':{'id':_0x162890[_0x0e82('0x49')]['id']}})[_0x0e82('0x25')](handleEntityNotFound(_0x64406e,null))[_0x0e82('0x25')](saveUpdates(_0x162890[_0x0e82('0x48')],null))['then'](respondWithResult(_0x64406e,null))[_0x0e82('0x45')](handleError(_0x64406e,null));};exports[_0x0e82('0x26')]=function(_0x576726,_0x360858){return db['WhatsappQueueReport']['find']({'where':{'id':_0x576726[_0x0e82('0x49')]['id']}})['then'](handleEntityNotFound(_0x360858,null))[_0x0e82('0x25')](removeEntity(_0x360858,null))[_0x0e82('0x45')](handleError(_0x360858,null));};exports[_0x0e82('0x4a')]=function(_0x149100,_0xdbb813){return db['WhatsappQueueReport'][_0x0e82('0x4a')]()['then'](respondWithResult(_0xdbb813,null))[_0x0e82('0x45')](handleError(_0xdbb813,null));}; \ No newline at end of file +var _0xa5fa=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','includeAll','rows','catch','show','params','fields','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0xc9f771,_0x30c926){var _0x2cb728=function(_0x1bfe44){while(--_0x1bfe44){_0xc9f771['push'](_0xc9f771['shift']());}};_0x2cb728(++_0x30c926);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x46003f,_0x18a160){_0x46003f=_0x46003f-0x0;var _0x373521=_0xa5fa[_0x46003f];return _0x373521;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa5f('0x0'));var zipdir=require(_0xaa5f('0x1'));var jsonpatch=require(_0xaa5f('0x2'));var rp=require(_0xaa5f('0x3'));var moment=require('moment');var BPromise=require(_0xaa5f('0x4'));var Mustache=require(_0xaa5f('0x5'));var util=require('util');var path=require(_0xaa5f('0x6'));var sox=require(_0xaa5f('0x7'));var csv=require(_0xaa5f('0x8'));var ejs=require(_0xaa5f('0x9'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xa'));var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x8'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var licenseUtil=require(_0xaa5f('0x15'));var db=require(_0xaa5f('0x16'))['db'];function respondWithStatusCode(_0x9aeae9,_0x252ae0){_0x252ae0=_0x252ae0||0xcc;return function(_0x48d1d3){if(_0x48d1d3){return _0x9aeae9[_0xaa5f('0x17')](_0x252ae0);}return _0x9aeae9['status'](_0x252ae0)[_0xaa5f('0x18')]();};}function respondWithResult(_0x23f872,_0x31eabc){_0x31eabc=_0x31eabc||0xc8;return function(_0x19aa27){if(_0x19aa27){return _0x23f872[_0xaa5f('0x19')](_0x31eabc)['json'](_0x19aa27);}};}function respondWithFilteredResult(_0x4fc828,_0x1f37fb){return function(_0x291042){if(_0x291042){var _0xb0bfb6=typeof _0x1f37fb[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x1f37fb[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x28407c=_0x291042[_0xaa5f('0x1d')];var _0x3d874f=_0xb0bfb6?0x0:_0x1f37fb[_0xaa5f('0x1a')];var _0x1019e8=_0xb0bfb6?_0x291042['count']:_0x1f37fb[_0xaa5f('0x1a')]+_0x1f37fb[_0xaa5f('0x1c')];var _0x1cbab5;if(_0x1019e8>=_0x28407c){_0x1019e8=_0x28407c;_0x1cbab5=0xc8;}else{_0x1cbab5=0xce;}_0x4fc828[_0xaa5f('0x19')](_0x1cbab5);return _0x4fc828[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x3d874f+'-'+_0x1019e8+'/'+_0x28407c)[_0xaa5f('0x20')](_0x291042);}return null;};}function patchUpdates(_0x194691){return function(_0x2d8fc3){try{jsonpatch[_0xaa5f('0x21')](_0x2d8fc3,_0x194691,!![]);}catch(_0x40c223){return BPromise[_0xaa5f('0x22')](_0x40c223);}return _0x2d8fc3[_0xaa5f('0x23')]();};}function saveUpdates(_0x5238a8,_0x1e917d){return function(_0x57082c){if(_0x57082c){return _0x57082c[_0xaa5f('0x24')](_0x5238a8)[_0xaa5f('0x25')](function(_0x561381){return _0x561381;});}return null;};}function removeEntity(_0x1baa2e,_0x1032ce){return function(_0x5b9f0b){if(_0x5b9f0b){return _0x5b9f0b[_0xaa5f('0x26')]()[_0xaa5f('0x25')](function(){_0x1baa2e[_0xaa5f('0x19')](0xcc)[_0xaa5f('0x18')]();});}};}function handleEntityNotFound(_0x1f66c0,_0xacbded){return function(_0x3d7bca){if(!_0x3d7bca){_0x1f66c0[_0xaa5f('0x17')](0x194);}return _0x3d7bca;};}function handleError(_0x51eb55,_0x2445a6){_0x2445a6=_0x2445a6||0x1f4;return function(_0x3a66e8){logger[_0xaa5f('0x27')](_0x3a66e8['stack']);if(_0x3a66e8[_0xaa5f('0x28')]){delete _0x3a66e8[_0xaa5f('0x28')];}_0x51eb55[_0xaa5f('0x19')](_0x2445a6)['send'](_0x3a66e8);};}exports[_0xaa5f('0x29')]=function(_0x479f29,_0x5990d2){var _0x27d1a4={},_0x50998f={},_0x1bffec={'count':0x0,'rows':[]};var _0x4e0ec9=_['map'](db['WhatsappQueueReport'][_0xaa5f('0x2a')],function(_0x4ddebd){return{'name':_0x4ddebd[_0xaa5f('0x2b')],'type':_0x4ddebd[_0xaa5f('0x2c')]['key']};});_0x50998f['model']=_[_0xaa5f('0x2d')](_0x4e0ec9,'name');_0x50998f[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0x479f29['query']);_0x50998f[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x50998f[_0xaa5f('0x32')],_0x50998f['query']);_0x27d1a4[_0xaa5f('0x33')]=_[_0xaa5f('0x31')](_0x50998f['model'],qs['fields'](_0x479f29['query']['fields']));_0x27d1a4[_0xaa5f('0x33')]=_0x27d1a4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x27d1a4[_0xaa5f('0x33')]:_0x50998f[_0xaa5f('0x32')];if(!_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x35')]('nolimit')){_0x27d1a4[_0xaa5f('0x1c')]=qs[_0xaa5f('0x1c')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x1c')]);_0x27d1a4[_0xaa5f('0x1a')]=qs[_0xaa5f('0x1a')](_0x479f29['query'][_0xaa5f('0x1a')]);}_0x27d1a4[_0xaa5f('0x36')]=qs[_0xaa5f('0x37')](_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x37')]);_0x27d1a4['where']=qs['filters'](_[_0xaa5f('0x38')](_0x479f29[_0xaa5f('0x2e')],_0x50998f[_0xaa5f('0x30')]),_0x4e0ec9);if(_0x479f29[_0xaa5f('0x2e')]['filter']){_0x27d1a4[_0xaa5f('0x39')]=_[_0xaa5f('0x3a')](_0x27d1a4[_0xaa5f('0x39')],{'$or':_[_0xaa5f('0x2d')](_0x4e0ec9,function(_0x37db88){if(_0x37db88[_0xaa5f('0x2c')]!==_0xaa5f('0x3b')){var _0x2c4d29={};_0x2c4d29[_0x37db88[_0xaa5f('0x28')]]={'$like':'%'+_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3c')]+'%'};return _0x2c4d29;}})});}_0x27d1a4=_['merge']({},_0x27d1a4,_0x479f29[_0xaa5f('0x3d')]);var _0x2562ce={'where':_0x27d1a4[_0xaa5f('0x39')]};return db[_0xaa5f('0x3e')][_0xaa5f('0x1d')](_0x2562ce)[_0xaa5f('0x25')](function(_0x1fb572){_0x1bffec[_0xaa5f('0x1d')]=_0x1fb572;if(_0x479f29[_0xaa5f('0x2e')][_0xaa5f('0x3f')]){_0x27d1a4['include']=[{'all':!![]}];}return db[_0xaa5f('0x3e')]['findAll'](_0x27d1a4);})[_0xaa5f('0x25')](function(_0x21f4bc){_0x1bffec[_0xaa5f('0x40')]=_0x21f4bc;return _0x1bffec;})['then'](respondWithFilteredResult(_0x5990d2,_0x27d1a4))[_0xaa5f('0x41')](handleError(_0x5990d2,null));};exports[_0xaa5f('0x42')]=function(_0xe49f8,_0x528b08){var _0x12a8e4={'raw':!![],'where':{'id':_0xe49f8[_0xaa5f('0x43')]['id']}},_0x179be8={};_0x179be8[_0xaa5f('0x32')]=_['keys'](db[_0xaa5f('0x3e')][_0xaa5f('0x2a')]);_0x179be8[_0xaa5f('0x2e')]=_[_0xaa5f('0x2f')](_0xe49f8[_0xaa5f('0x2e')]);_0x179be8[_0xaa5f('0x30')]=_[_0xaa5f('0x31')](_0x179be8[_0xaa5f('0x32')],_0x179be8['query']);_0x12a8e4[_0xaa5f('0x33')]=_['intersection'](_0x179be8[_0xaa5f('0x32')],qs['fields'](_0xe49f8[_0xaa5f('0x2e')][_0xaa5f('0x44')]));_0x12a8e4['attributes']=_0x12a8e4[_0xaa5f('0x33')][_0xaa5f('0x34')]?_0x12a8e4[_0xaa5f('0x33')]:_0x179be8['model'];if(_0xe49f8['query']['includeAll']){_0x12a8e4[_0xaa5f('0x45')]=[{'all':!![]}];}_0x12a8e4=_['merge']({},_0x12a8e4,_0xe49f8[_0xaa5f('0x3d')]);return db[_0xaa5f('0x3e')][_0xaa5f('0x46')](_0x12a8e4)[_0xaa5f('0x25')](handleEntityNotFound(_0x528b08,null))['then'](respondWithResult(_0x528b08,null))[_0xaa5f('0x41')](handleError(_0x528b08,null));};exports[_0xaa5f('0x47')]=function(_0x3c6a17,_0x231ad1){return db[_0xaa5f('0x3e')][_0xaa5f('0x47')](_0x3c6a17[_0xaa5f('0x48')],{})[_0xaa5f('0x25')](respondWithResult(_0x231ad1,0xc9))[_0xaa5f('0x41')](handleError(_0x231ad1,null));};exports[_0xaa5f('0x24')]=function(_0x3ea553,_0x2de737){if(_0x3ea553[_0xaa5f('0x48')]['id']){delete _0x3ea553[_0xaa5f('0x48')]['id'];}return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x3ea553['params']['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x2de737,null))[_0xaa5f('0x25')](saveUpdates(_0x3ea553[_0xaa5f('0x48')],null))[_0xaa5f('0x25')](respondWithResult(_0x2de737,null))[_0xaa5f('0x41')](handleError(_0x2de737,null));};exports[_0xaa5f('0x26')]=function(_0x32bbed,_0x4aa556){return db[_0xaa5f('0x3e')][_0xaa5f('0x46')]({'where':{'id':_0x32bbed[_0xaa5f('0x43')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x4aa556,null))['then'](removeEntity(_0x4aa556,null))[_0xaa5f('0x41')](handleError(_0x4aa556,null));};exports[_0xaa5f('0x49')]=function(_0x36c4aa,_0x575803){return db['WhatsappQueueReport']['describe']()['then'](respondWithResult(_0x575803,null))['catch'](handleError(_0x575803,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 6c04662..556cbd2 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 _0xc83e=['report_whatsapp_queue','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','WhatsappQueueReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc83e,0x178));var _0xec83=function(_0x592307,_0x2b8719){_0x592307=_0x592307-0x0;var _0x244eb8=_0xc83e[_0x592307];return _0x244eb8;};'use strict';var _=require(_0xec83('0x0'));var util=require('util');var logger=require(_0xec83('0x1'))('api');var moment=require('moment');var BPromise=require(_0xec83('0x2'));var rp=require(_0xec83('0x3'));var fs=require('fs');var path=require(_0xec83('0x4'));var rimraf=require(_0xec83('0x5'));var config=require('../../config/environment');var attributes=require(_0xec83('0x6'));module[_0xec83('0x7')]=function(_0x4e3c61,_0x8155ed){return _0x4e3c61['define'](_0xec83('0x8'),attributes,{'tableName':_0xec83('0x9'),'paranoid':![],'indexes':[{'name':_0xec83('0xa'),'fields':[_0xec83('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3cd5=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0xe73db7,_0x10de16){var _0x1ff1e2=function(_0x20575a){while(--_0x20575a){_0xe73db7['push'](_0xe73db7['shift']());}};_0x1ff1e2(++_0x10de16);}(_0x3cd5,0xdf));var _0x53cd=function(_0x31dde9,_0x12e816){_0x31dde9=_0x31dde9-0x0;var _0x1fbf2d=_0x3cd5[_0x31dde9];return _0x1fbf2d;};'use strict';var _=require(_0x53cd('0x0'));var util=require(_0x53cd('0x1'));var logger=require(_0x53cd('0x2'))(_0x53cd('0x3'));var moment=require(_0x53cd('0x4'));var BPromise=require(_0x53cd('0x5'));var rp=require(_0x53cd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53cd('0x7'));var config=require(_0x53cd('0x8'));var attributes=require(_0x53cd('0x9'));module[_0x53cd('0xa')]=function(_0x1b76d0,_0x3f8a57){return _0x1b76d0[_0x53cd('0xb')](_0x53cd('0xc'),attributes,{'tableName':_0x53cd('0xd'),'paranoid':![],'indexes':[{'name':_0x53cd('0xe'),'fields':[_0x53cd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 62f841b..f8972ab 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 _0x6458=['info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','debug','UpdateWhatsappQueueReport','update','body','raw','where','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0x6458,0x133));var _0x8645=function(_0xcdfc4f,_0x8a111a){_0xcdfc4f=_0xcdfc4f-0x0;var _0x3f70d1=_0x6458[_0xcdfc4f];return _0x3f70d1;};'use strict';var _=require(_0x8645('0x0'));var util=require('util');var moment=require(_0x8645('0x1'));var BPromise=require(_0x8645('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8645('0x3'));var db=require(_0x8645('0x4'))['db'];var utils=require(_0x8645('0x5'));var logger=require('../../config/logger')(_0x8645('0x6'));var config=require(_0x8645('0x7'));var jayson=require(_0x8645('0x8'));var client=jayson[_0x8645('0x9')][_0x8645('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d475e,_0xbac883,_0x50679a){return new BPromise(function(_0x3076d6,_0x40c81a){return client[_0x8645('0xb')](_0x5d475e,_0x50679a)[_0x8645('0xc')](function(_0x1028b6){logger[_0x8645('0xd')](_0x8645('0xe'),_0xbac883,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0xbac883,_0x8645('0xf'),JSON[_0x8645('0x10')](_0x1028b6));if(_0x1028b6[_0x8645('0x11')]){if(_0x1028b6[_0x8645('0x11')][_0x8645('0x12')]===0x1f4){logger['error'](_0x8645('0xe'),_0xbac883,_0x1028b6[_0x8645('0x11')]['message']);return _0x40c81a(_0x1028b6[_0x8645('0x11')][_0x8645('0x13')]);}logger[_0x8645('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0xbac883,_0x1028b6[_0x8645('0x11')][_0x8645('0x13')]);return _0x3076d6(_0x1028b6['error'][_0x8645('0x13')]);}else{logger['info'](_0x8645('0xe'),_0xbac883,_0x8645('0xf'));_0x3076d6(_0x1028b6['result'][_0x8645('0x13')]);}})[_0x8645('0x14')](function(_0x3a14e1){logger[_0x8645('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0xbac883,_0x3a14e1);_0x40c81a(_0x3a14e1);});});}exports[_0x8645('0x15')]=function(_0x11cd45){var _0x535ba0=this;return new Promise(function(_0x2eacff,_0x406c42){return db[_0x8645('0x16')][_0x8645('0x17')](_0x11cd45['body'],{'raw':_0x11cd45[_0x8645('0x18')]?_0x11cd45['options']['raw']===undefined?!![]:![]:!![]})[_0x8645('0xc')](function(_0x54468d){logger[_0x8645('0xd')](_0x8645('0x15'),_0x11cd45);logger[_0x8645('0x19')](_0x8645('0x15'),_0x11cd45,JSON[_0x8645('0x10')](_0x54468d));_0x2eacff(_0x54468d);})['catch'](function(_0x570406){logger[_0x8645('0x11')](_0x8645('0x15'),_0x570406[_0x8645('0x13')],_0x11cd45);_0x406c42(_0x535ba0[_0x8645('0x11')](0x1f4,_0x570406[_0x8645('0x13')]));});});};exports[_0x8645('0x1a')]=function(_0x286a18){var _0x13fa37=this;return new Promise(function(_0x5bc22a,_0x434ae1){return db[_0x8645('0x16')][_0x8645('0x1b')](_0x286a18[_0x8645('0x1c')],{'raw':_0x286a18[_0x8645('0x18')]?_0x286a18[_0x8645('0x18')][_0x8645('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x286a18[_0x8645('0x18')]?_0x286a18[_0x8645('0x18')][_0x8645('0x1e')]||null:null,'attributes':_0x286a18[_0x8645('0x18')]?_0x286a18['options'][_0x8645('0x1f')]||null:null,'limit':_0x286a18[_0x8645('0x18')]?_0x286a18[_0x8645('0x18')]['limit']||null:null})[_0x8645('0xc')](function(_0x1775c){logger[_0x8645('0xd')](_0x8645('0x1a'),_0x286a18);logger[_0x8645('0x19')](_0x8645('0x1a'),_0x286a18,JSON['stringify'](_0x1775c));_0x5bc22a(_0x1775c);})['catch'](function(_0x129045){logger[_0x8645('0x11')](_0x8645('0x1a'),_0x129045['message'],_0x286a18);_0x434ae1(_0x13fa37['error'](0x1f4,_0x129045[_0x8645('0x13')]));});});}; \ No newline at end of file +var _0xeb55=['http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappQueueReport','create','options','raw','WhatsappQueueReport','update','body','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x582269,_0x529ef3){var _0x506c1f=function(_0x361bc0){while(--_0x361bc0){_0x582269['push'](_0x582269['shift']());}};_0x506c1f(++_0x529ef3);}(_0xeb55,0x1e5));var _0x5eb5=function(_0x4b023d,_0xe0fbeb){_0x4b023d=_0x4b023d-0x0;var _0x1c3a15=_0xeb55[_0x4b023d];return _0x1c3a15;};'use strict';var _=require(_0x5eb5('0x0'));var util=require(_0x5eb5('0x1'));var moment=require(_0x5eb5('0x2'));var BPromise=require(_0x5eb5('0x3'));var rs=require(_0x5eb5('0x4'));var fs=require('fs');var Redis=require(_0x5eb5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5eb5('0x6'));var logger=require(_0x5eb5('0x7'))('rpc');var config=require(_0x5eb5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5eb5('0x9')][_0x5eb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23af49,_0xd571f4,_0x35f8f3){return new BPromise(function(_0x24024d,_0xadc9ed){return client[_0x5eb5('0xb')](_0x23af49,_0x35f8f3)[_0x5eb5('0xc')](function(_0x339b45){logger[_0x5eb5('0xd')](_0x5eb5('0xe'),_0xd571f4,_0x5eb5('0xf'));logger[_0x5eb5('0x10')](_0x5eb5('0x11'),_0xd571f4,_0x5eb5('0xf'),JSON[_0x5eb5('0x12')](_0x339b45));if(_0x339b45[_0x5eb5('0x13')]){if(_0x339b45['error'][_0x5eb5('0x14')]===0x1f4){logger[_0x5eb5('0x13')](_0x5eb5('0xe'),_0xd571f4,_0x339b45['error']['message']);return _0xadc9ed(_0x339b45[_0x5eb5('0x13')][_0x5eb5('0x15')]);}logger[_0x5eb5('0x13')](_0x5eb5('0xe'),_0xd571f4,_0x339b45[_0x5eb5('0x13')][_0x5eb5('0x15')]);return _0x24024d(_0x339b45[_0x5eb5('0x13')][_0x5eb5('0x15')]);}else{logger[_0x5eb5('0xd')](_0x5eb5('0xe'),_0xd571f4,_0x5eb5('0xf'));_0x24024d(_0x339b45['result'][_0x5eb5('0x15')]);}})[_0x5eb5('0x16')](function(_0x19160c){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0xd571f4,_0x19160c);_0xadc9ed(_0x19160c);});});}exports[_0x5eb5('0x17')]=function(_0x144716){var _0x34901f=this;return new Promise(function(_0x441e9f,_0x24f592){return db['WhatsappQueueReport'][_0x5eb5('0x18')](_0x144716['body'],{'raw':_0x144716[_0x5eb5('0x19')]?_0x144716['options'][_0x5eb5('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x299164){logger[_0x5eb5('0xd')](_0x5eb5('0x17'),_0x144716);logger[_0x5eb5('0x10')](_0x5eb5('0x17'),_0x144716,JSON[_0x5eb5('0x12')](_0x299164));_0x441e9f(_0x299164);})['catch'](function(_0x17e2f){logger[_0x5eb5('0x13')](_0x5eb5('0x17'),_0x17e2f[_0x5eb5('0x15')],_0x144716);_0x24f592(_0x34901f[_0x5eb5('0x13')](0x1f4,_0x17e2f[_0x5eb5('0x15')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x89ded5){var _0x3ad252=this;return new Promise(function(_0x3dd22d,_0x36b725){return db[_0x5eb5('0x1b')][_0x5eb5('0x1c')](_0x89ded5[_0x5eb5('0x1d')],{'raw':_0x89ded5['options']?_0x89ded5[_0x5eb5('0x19')][_0x5eb5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x89ded5['options']?_0x89ded5[_0x5eb5('0x19')][_0x5eb5('0x1e')]||null:null,'attributes':_0x89ded5[_0x5eb5('0x19')]?_0x89ded5[_0x5eb5('0x19')][_0x5eb5('0x1f')]||null:null,'limit':_0x89ded5[_0x5eb5('0x19')]?_0x89ded5[_0x5eb5('0x19')]['limit']||null:null})[_0x5eb5('0xc')](function(_0x34d401){logger[_0x5eb5('0xd')]('UpdateWhatsappQueueReport',_0x89ded5);logger['debug'](_0x5eb5('0x20'),_0x89ded5,JSON[_0x5eb5('0x12')](_0x34d401));_0x3dd22d(_0x34d401);})[_0x5eb5('0x16')](function(_0x40a7b1){logger['error']('UpdateWhatsappQueueReport',_0x40a7b1[_0x5eb5('0x15')],_0x89ded5);_0x36b725(_0x3ad252[_0x5eb5('0x13')](0x1f4,_0x40a7b1['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 61d1a59..71bd051 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 _0xb877=['get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe178b6,_0x222d91){var _0x2a1e6a=function(_0x2a4b93){while(--_0x2a4b93){_0xe178b6['push'](_0xe178b6['shift']());}};_0x2a1e6a(++_0x222d91);}(_0xb877,0x188));var _0x7b87=function(_0x3372f7,_0x3dbdf5){_0x3372f7=_0x3372f7-0x0;var _0x4fc665=_0xb877[_0x3372f7];return _0x4fc665;};'use strict';var multer=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var path=require(_0x7b87('0x2'));var timeout=require(_0x7b87('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7b87('0x4'));var auth=require(_0x7b87('0x5'));var interaction=require(_0x7b87('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x7b87('0x7')]('/',auth[_0x7b87('0x8')](),controller[_0x7b87('0x9')]);router[_0x7b87('0x7')](_0x7b87('0xa'),auth[_0x7b87('0x8')](),controller[_0x7b87('0xb')]);router['get']('/:id',auth[_0x7b87('0x8')](),controller[_0x7b87('0xc')]);router[_0x7b87('0xd')]('/',auth[_0x7b87('0x8')](),controller[_0x7b87('0xe')]);router[_0x7b87('0xf')]('/:id',auth[_0x7b87('0x8')](),controller[_0x7b87('0x10')]);router[_0x7b87('0x11')](_0x7b87('0x12'),auth['isAuthenticated'](),controller[_0x7b87('0x13')]);module[_0x7b87('0x14')]=router; \ No newline at end of file +var _0x4751=['create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','post'];(function(_0xda4c48,_0x2a7ebd){var _0x5f528e=function(_0x53f0d9){while(--_0x53f0d9){_0xda4c48['push'](_0xda4c48['shift']());}};_0x5f528e(++_0x2a7ebd);}(_0x4751,0x16e));var _0x1475=function(_0x1fc6a3,_0x3c5e92){_0x1fc6a3=_0x1fc6a3-0x0;var _0x406646=_0x4751[_0x1fc6a3];return _0x406646;};'use strict';var multer=require(_0x1475('0x0'));var util=require(_0x1475('0x1'));var path=require(_0x1475('0x2'));var timeout=require(_0x1475('0x3'));var express=require(_0x1475('0x4'));var router=express['Router']();var fs_extra=require(_0x1475('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1475('0x6'));var controller=require(_0x1475('0x7'));router[_0x1475('0x8')]('/',auth[_0x1475('0x9')](),controller[_0x1475('0xa')]);router['get'](_0x1475('0xb'),auth[_0x1475('0x9')](),controller[_0x1475('0xc')]);router[_0x1475('0x8')]('/:id',auth[_0x1475('0x9')](),controller['show']);router[_0x1475('0xd')]('/',auth[_0x1475('0x9')](),controller[_0x1475('0xe')]);router[_0x1475('0xf')](_0x1475('0x10'),auth[_0x1475('0x9')](),controller[_0x1475('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1475('0x12')]);module[_0x1475('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 85d8a66..44ba8cd 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 _0x119c=['ENUM','account','agent','DATE','exports'];(function(_0x56f0a4,_0x54e20f){var _0x5a492b=function(_0x1dd3fa){while(--_0x1dd3fa){_0x56f0a4['push'](_0x56f0a4['shift']());}};_0x5a492b(++_0x54e20f);}(_0x119c,0xea));var _0xc119=function(_0x4074d5,_0xa57194){_0x4074d5=_0x4074d5-0x0;var _0x502cfe=_0x119c[_0x4074d5];return _0x502cfe;};'use strict';var Sequelize=require('sequelize');module[_0xc119('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc119('0x1')](_0xc119('0x2'),_0xc119('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc119('0x4')]}}; \ No newline at end of file +var _0x351d=['STRING','ENUM','account','queue','sequelize'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x351d,0x90));var _0xd351=function(_0xba4980,_0x191132){_0xba4980=_0xba4980-0x0;var _0x29f7b1=_0x351d[_0xba4980];return _0x29f7b1;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd351('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd351('0x2')](_0xd351('0x3'),'agent',_0xd351('0x4')),'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 256ca1a..14861ae 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 _0x71db=['pick','filter','options','WhatsappTransferReport','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x33774a,_0x18f95e){var _0x3b331e=function(_0x155ae2){while(--_0x155ae2){_0x33774a['push'](_0x33774a['shift']());}};_0x3b331e(++_0x18f95e);}(_0x71db,0xee));var _0xb71d=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0x71db[_0x144b30];return _0x1bb7bc;};'use strict';var emlformat=require(_0xb71d('0x0'));var rimraf=require(_0xb71d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb71d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb71d('0x3'));var path=require(_0xb71d('0x4'));var sox=require('sox');var csv=require(_0xb71d('0x5'));var ejs=require(_0xb71d('0x6'));var fs=require('fs');var fs_extra=require(_0xb71d('0x7'));var _=require(_0xb71d('0x8'));var squel=require(_0xb71d('0x9'));var crypto=require(_0xb71d('0xa'));var jsforce=require(_0xb71d('0xb'));var deskjs=require(_0xb71d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb71d('0xd'));var Papa=require('papaparse');var Redis=require(_0xb71d('0xe'));var authService=require(_0xb71d('0xf'));var qs=require(_0xb71d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71d('0x11'));var logger=require(_0xb71d('0x12'))(_0xb71d('0x13'));var utils=require(_0xb71d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb71d('0x15'));var db=require(_0xb71d('0x16'))['db'];function respondWithStatusCode(_0x4443f9,_0x3f01e0){_0x3f01e0=_0x3f01e0||0xcc;return function(_0x3ceb4a){if(_0x3ceb4a){return _0x4443f9[_0xb71d('0x17')](_0x3f01e0);}return _0x4443f9[_0xb71d('0x18')](_0x3f01e0)[_0xb71d('0x19')]();};}function respondWithResult(_0x550af7,_0x47c486){_0x47c486=_0x47c486||0xc8;return function(_0x3eb256){if(_0x3eb256){return _0x550af7[_0xb71d('0x18')](_0x47c486)[_0xb71d('0x1a')](_0x3eb256);}};}function respondWithFilteredResult(_0x3ba3f1,_0x2651cc){return function(_0x4f0917){if(_0x4f0917){var _0x1ec47e=typeof _0x2651cc[_0xb71d('0x1b')]===_0xb71d('0x1c')&&typeof _0x2651cc[_0xb71d('0x1d')]==='undefined';var _0x573034=_0x4f0917[_0xb71d('0x1e')];var _0x5a82d0=_0x1ec47e?0x0:_0x2651cc[_0xb71d('0x1b')];var _0x4a1e8e=_0x1ec47e?_0x4f0917[_0xb71d('0x1e')]:_0x2651cc['offset']+_0x2651cc[_0xb71d('0x1d')];var _0x16034f;if(_0x4a1e8e>=_0x573034){_0x4a1e8e=_0x573034;_0x16034f=0xc8;}else{_0x16034f=0xce;}_0x3ba3f1['status'](_0x16034f);return _0x3ba3f1[_0xb71d('0x1f')](_0xb71d('0x20'),_0x5a82d0+'-'+_0x4a1e8e+'/'+_0x573034)['json'](_0x4f0917);}return null;};}function patchUpdates(_0x313db0){return function(_0x5450c4){try{jsonpatch['apply'](_0x5450c4,_0x313db0,!![]);}catch(_0x26f64d){return BPromise[_0xb71d('0x21')](_0x26f64d);}return _0x5450c4[_0xb71d('0x22')]();};}function saveUpdates(_0x4d5e55,_0x1851bc){return function(_0x19a2e4){if(_0x19a2e4){return _0x19a2e4[_0xb71d('0x23')](_0x4d5e55)[_0xb71d('0x24')](function(_0x498bf6){return _0x498bf6;});}return null;};}function removeEntity(_0x1ac5e4,_0x2d77a7){return function(_0x3ddda6){if(_0x3ddda6){return _0x3ddda6['destroy']()[_0xb71d('0x24')](function(){_0x1ac5e4[_0xb71d('0x18')](0xcc)[_0xb71d('0x19')]();});}};}function handleEntityNotFound(_0x4cce9b,_0x40df7a){return function(_0x1774e4){if(!_0x1774e4){_0x4cce9b['sendStatus'](0x194);}return _0x1774e4;};}function handleError(_0x3193db,_0x135e07){_0x135e07=_0x135e07||0x1f4;return function(_0x5deccb){logger[_0xb71d('0x25')](_0x5deccb[_0xb71d('0x26')]);if(_0x5deccb[_0xb71d('0x27')]){delete _0x5deccb[_0xb71d('0x27')];}_0x3193db[_0xb71d('0x18')](_0x135e07)[_0xb71d('0x28')](_0x5deccb);};}exports[_0xb71d('0x29')]=function(_0x3dc23d,_0x109d32){var _0x37298b={},_0x2f467a={},_0x3715e0={'count':0x0,'rows':[]};var _0xfb1f72=_[_0xb71d('0x2a')](db['WhatsappTransferReport']['rawAttributes'],function(_0x291164){return{'name':_0x291164[_0xb71d('0x2b')],'type':_0x291164[_0xb71d('0x2c')][_0xb71d('0x2d')]};});_0x2f467a[_0xb71d('0x2e')]=_['map'](_0xfb1f72,_0xb71d('0x27'));_0x2f467a['query']=_[_0xb71d('0x2f')](_0x3dc23d[_0xb71d('0x30')]);_0x2f467a[_0xb71d('0x31')]=_[_0xb71d('0x32')](_0x2f467a[_0xb71d('0x2e')],_0x2f467a[_0xb71d('0x30')]);_0x37298b[_0xb71d('0x33')]=_[_0xb71d('0x32')](_0x2f467a[_0xb71d('0x2e')],qs[_0xb71d('0x34')](_0x3dc23d[_0xb71d('0x30')]['fields']));_0x37298b[_0xb71d('0x33')]=_0x37298b[_0xb71d('0x33')][_0xb71d('0x35')]?_0x37298b['attributes']:_0x2f467a[_0xb71d('0x2e')];if(!_0x3dc23d[_0xb71d('0x30')][_0xb71d('0x36')](_0xb71d('0x37'))){_0x37298b[_0xb71d('0x1d')]=qs[_0xb71d('0x1d')](_0x3dc23d[_0xb71d('0x30')][_0xb71d('0x1d')]);_0x37298b[_0xb71d('0x1b')]=qs[_0xb71d('0x1b')](_0x3dc23d[_0xb71d('0x30')][_0xb71d('0x1b')]);}_0x37298b['order']=qs['sort'](_0x3dc23d[_0xb71d('0x30')][_0xb71d('0x38')]);_0x37298b[_0xb71d('0x39')]=qs['filters'](_[_0xb71d('0x3a')](_0x3dc23d[_0xb71d('0x30')],_0x2f467a[_0xb71d('0x31')]),_0xfb1f72);if(_0x3dc23d[_0xb71d('0x30')]['filter']){_0x37298b[_0xb71d('0x39')]=_['merge'](_0x37298b[_0xb71d('0x39')],{'$or':_[_0xb71d('0x2a')](_0xfb1f72,function(_0x1cc2fd){if(_0x1cc2fd[_0xb71d('0x2c')]!=='VIRTUAL'){var _0x93db7d={};_0x93db7d[_0x1cc2fd[_0xb71d('0x27')]]={'$like':'%'+_0x3dc23d[_0xb71d('0x30')][_0xb71d('0x3b')]+'%'};return _0x93db7d;}})});}_0x37298b=_['merge']({},_0x37298b,_0x3dc23d[_0xb71d('0x3c')]);var _0x5b467d={'where':_0x37298b['where']};return db[_0xb71d('0x3d')][_0xb71d('0x1e')](_0x5b467d)[_0xb71d('0x24')](function(_0x11591e){_0x3715e0['count']=_0x11591e;if(_0x3dc23d[_0xb71d('0x30')]['includeAll']){_0x37298b[_0xb71d('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb71d('0x3f')](_0x37298b);})[_0xb71d('0x24')](function(_0xeeae77){_0x3715e0[_0xb71d('0x40')]=_0xeeae77;return _0x3715e0;})[_0xb71d('0x24')](respondWithFilteredResult(_0x109d32,_0x37298b))[_0xb71d('0x41')](handleError(_0x109d32,null));};exports[_0xb71d('0x42')]=function(_0x5cbeed,_0x3c7ab1){var _0x2ac08c={'raw':!![],'where':{'id':_0x5cbeed[_0xb71d('0x43')]['id']}},_0x40c072={};_0x40c072[_0xb71d('0x2e')]=_[_0xb71d('0x2f')](db[_0xb71d('0x3d')][_0xb71d('0x44')]);_0x40c072[_0xb71d('0x30')]=_['keys'](_0x5cbeed[_0xb71d('0x30')]);_0x40c072[_0xb71d('0x31')]=_['intersection'](_0x40c072[_0xb71d('0x2e')],_0x40c072[_0xb71d('0x30')]);_0x2ac08c[_0xb71d('0x33')]=_['intersection'](_0x40c072[_0xb71d('0x2e')],qs[_0xb71d('0x34')](_0x5cbeed[_0xb71d('0x30')][_0xb71d('0x34')]));_0x2ac08c[_0xb71d('0x33')]=_0x2ac08c[_0xb71d('0x33')][_0xb71d('0x35')]?_0x2ac08c['attributes']:_0x40c072[_0xb71d('0x2e')];if(_0x5cbeed[_0xb71d('0x30')][_0xb71d('0x45')]){_0x2ac08c[_0xb71d('0x3e')]=[{'all':!![]}];}_0x2ac08c=_['merge']({},_0x2ac08c,_0x5cbeed[_0xb71d('0x3c')]);return db[_0xb71d('0x3d')][_0xb71d('0x46')](_0x2ac08c)[_0xb71d('0x24')](handleEntityNotFound(_0x3c7ab1,null))[_0xb71d('0x24')](respondWithResult(_0x3c7ab1,null))[_0xb71d('0x41')](handleError(_0x3c7ab1,null));};exports[_0xb71d('0x47')]=function(_0x49a1de,_0x196773){return db[_0xb71d('0x3d')][_0xb71d('0x47')](_0x49a1de['body'],{})[_0xb71d('0x24')](respondWithResult(_0x196773,0xc9))[_0xb71d('0x41')](handleError(_0x196773,null));};exports[_0xb71d('0x23')]=function(_0x1e7578,_0x2945ef){if(_0x1e7578['body']['id']){delete _0x1e7578[_0xb71d('0x48')]['id'];}return db['WhatsappTransferReport'][_0xb71d('0x46')]({'where':{'id':_0x1e7578[_0xb71d('0x43')]['id']}})['then'](handleEntityNotFound(_0x2945ef,null))[_0xb71d('0x24')](saveUpdates(_0x1e7578[_0xb71d('0x48')],null))[_0xb71d('0x24')](respondWithResult(_0x2945ef,null))[_0xb71d('0x41')](handleError(_0x2945ef,null));};exports['destroy']=function(_0x5c978b,_0x597966){return db[_0xb71d('0x3d')][_0xb71d('0x46')]({'where':{'id':_0x5c978b[_0xb71d('0x43')]['id']}})[_0xb71d('0x24')](handleEntityNotFound(_0x597966,null))['then'](removeEntity(_0x597966,null))[_0xb71d('0x41')](handleError(_0x597966,null));};exports[_0xb71d('0x49')]=function(_0x402761,_0x461e53){return db[_0xb71d('0x3d')][_0xb71d('0x49')]()[_0xb71d('0x24')](respondWithResult(_0x461e53,null))[_0xb71d('0x41')](handleError(_0x461e53,null));}; \ No newline at end of file +var _0x1d66=['index','map','WhatsappTransferReport','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','set','json','apply','reject','save','update','then','end','error','stack','name'];(function(_0x3eca49,_0x87dfa3){var _0x51e486=function(_0x568e68){while(--_0x568e68){_0x3eca49['push'](_0x3eca49['shift']());}};_0x51e486(++_0x87dfa3);}(_0x1d66,0xfc));var _0x61d6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1d66[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x61d6('0x0'));var rimraf=require(_0x61d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61d6('0x2'));var rp=require(_0x61d6('0x3'));var moment=require('moment');var BPromise=require(_0x61d6('0x4'));var Mustache=require(_0x61d6('0x5'));var util=require(_0x61d6('0x6'));var path=require('path');var sox=require(_0x61d6('0x7'));var csv=require(_0x61d6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61d6('0x9'));var _=require(_0x61d6('0xa'));var squel=require('squel');var crypto=require(_0x61d6('0xb'));var jsforce=require(_0x61d6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x61d6('0xd'));var Papa=require(_0x61d6('0xe'));var Redis=require(_0x61d6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x61d6('0x10'))(_0x61d6('0x11'));var utils=require('../../config/utils');var config=require(_0x61d6('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x61d6('0x13'))['db'];function respondWithStatusCode(_0x57d048,_0x12d4be){_0x12d4be=_0x12d4be||0xcc;return function(_0x28c43c){if(_0x28c43c){return _0x57d048[_0x61d6('0x14')](_0x12d4be);}return _0x57d048['status'](_0x12d4be)['end']();};}function respondWithResult(_0x31e3af,_0x786f62){_0x786f62=_0x786f62||0xc8;return function(_0x5b7c50){if(_0x5b7c50){return _0x31e3af[_0x61d6('0x15')](_0x786f62)['json'](_0x5b7c50);}};}function respondWithFilteredResult(_0x271587,_0x28d4b4){return function(_0x5297f8){if(_0x5297f8){var _0x5c6052=typeof _0x28d4b4[_0x61d6('0x16')]===_0x61d6('0x17')&&typeof _0x28d4b4['limit']===_0x61d6('0x17');var _0x2c0b38=_0x5297f8['count'];var _0x22701d=_0x5c6052?0x0:_0x28d4b4['offset'];var _0xe6910=_0x5c6052?_0x5297f8[_0x61d6('0x18')]:_0x28d4b4[_0x61d6('0x16')]+_0x28d4b4['limit'];var _0xa7ba19;if(_0xe6910>=_0x2c0b38){_0xe6910=_0x2c0b38;_0xa7ba19=0xc8;}else{_0xa7ba19=0xce;}_0x271587['status'](_0xa7ba19);return _0x271587[_0x61d6('0x19')]('Content-Range',_0x22701d+'-'+_0xe6910+'/'+_0x2c0b38)[_0x61d6('0x1a')](_0x5297f8);}return null;};}function patchUpdates(_0xd092e8){return function(_0x3e3950){try{jsonpatch[_0x61d6('0x1b')](_0x3e3950,_0xd092e8,!![]);}catch(_0x5e912f){return BPromise[_0x61d6('0x1c')](_0x5e912f);}return _0x3e3950[_0x61d6('0x1d')]();};}function saveUpdates(_0x167e97,_0x200781){return function(_0x5a108f){if(_0x5a108f){return _0x5a108f[_0x61d6('0x1e')](_0x167e97)['then'](function(_0x40cdb2){return _0x40cdb2;});}return null;};}function removeEntity(_0x483133,_0x48f82b){return function(_0xfa77cb){if(_0xfa77cb){return _0xfa77cb['destroy']()[_0x61d6('0x1f')](function(){_0x483133['status'](0xcc)[_0x61d6('0x20')]();});}};}function handleEntityNotFound(_0x581ff7,_0x4f7c26){return function(_0x1676bb){if(!_0x1676bb){_0x581ff7[_0x61d6('0x14')](0x194);}return _0x1676bb;};}function handleError(_0x76f7a3,_0x22b3fc){_0x22b3fc=_0x22b3fc||0x1f4;return function(_0x1939b2){logger[_0x61d6('0x21')](_0x1939b2[_0x61d6('0x22')]);if(_0x1939b2[_0x61d6('0x23')]){delete _0x1939b2['name'];}_0x76f7a3[_0x61d6('0x15')](_0x22b3fc)['send'](_0x1939b2);};}exports[_0x61d6('0x24')]=function(_0x3f6c8d,_0x4ceb36){var _0x136ba4={},_0x5a45db={},_0x118692={'count':0x0,'rows':[]};var _0x265e95=_[_0x61d6('0x25')](db[_0x61d6('0x26')]['rawAttributes'],function(_0x389df2){return{'name':_0x389df2[_0x61d6('0x27')],'type':_0x389df2[_0x61d6('0x28')][_0x61d6('0x29')]};});_0x5a45db[_0x61d6('0x2a')]=_[_0x61d6('0x25')](_0x265e95,'name');_0x5a45db[_0x61d6('0x2b')]=_['keys'](_0x3f6c8d[_0x61d6('0x2b')]);_0x5a45db['filters']=_[_0x61d6('0x2c')](_0x5a45db[_0x61d6('0x2a')],_0x5a45db[_0x61d6('0x2b')]);_0x136ba4['attributes']=_[_0x61d6('0x2c')](_0x5a45db[_0x61d6('0x2a')],qs[_0x61d6('0x2d')](_0x3f6c8d[_0x61d6('0x2b')][_0x61d6('0x2d')]));_0x136ba4[_0x61d6('0x2e')]=_0x136ba4['attributes'][_0x61d6('0x2f')]?_0x136ba4[_0x61d6('0x2e')]:_0x5a45db[_0x61d6('0x2a')];if(!_0x3f6c8d[_0x61d6('0x2b')][_0x61d6('0x30')]('nolimit')){_0x136ba4[_0x61d6('0x31')]=qs[_0x61d6('0x31')](_0x3f6c8d[_0x61d6('0x2b')][_0x61d6('0x31')]);_0x136ba4['offset']=qs['offset'](_0x3f6c8d[_0x61d6('0x2b')][_0x61d6('0x16')]);}_0x136ba4[_0x61d6('0x32')]=qs[_0x61d6('0x33')](_0x3f6c8d[_0x61d6('0x2b')][_0x61d6('0x33')]);_0x136ba4[_0x61d6('0x34')]=qs[_0x61d6('0x35')](_[_0x61d6('0x36')](_0x3f6c8d[_0x61d6('0x2b')],_0x5a45db[_0x61d6('0x35')]),_0x265e95);if(_0x3f6c8d[_0x61d6('0x2b')][_0x61d6('0x37')]){_0x136ba4[_0x61d6('0x34')]=_[_0x61d6('0x38')](_0x136ba4[_0x61d6('0x34')],{'$or':_[_0x61d6('0x25')](_0x265e95,function(_0x39652d){if(_0x39652d['type']!==_0x61d6('0x39')){var _0x3021d1={};_0x3021d1[_0x39652d[_0x61d6('0x23')]]={'$like':'%'+_0x3f6c8d[_0x61d6('0x2b')]['filter']+'%'};return _0x3021d1;}})});}_0x136ba4=_[_0x61d6('0x38')]({},_0x136ba4,_0x3f6c8d[_0x61d6('0x3a')]);var _0x3f6562={'where':_0x136ba4[_0x61d6('0x34')]};return db[_0x61d6('0x26')][_0x61d6('0x18')](_0x3f6562)[_0x61d6('0x1f')](function(_0xf71e3){_0x118692[_0x61d6('0x18')]=_0xf71e3;if(_0x3f6c8d[_0x61d6('0x2b')][_0x61d6('0x3b')]){_0x136ba4[_0x61d6('0x3c')]=[{'all':!![]}];}return db[_0x61d6('0x26')][_0x61d6('0x3d')](_0x136ba4);})[_0x61d6('0x1f')](function(_0x13a408){_0x118692[_0x61d6('0x3e')]=_0x13a408;return _0x118692;})[_0x61d6('0x1f')](respondWithFilteredResult(_0x4ceb36,_0x136ba4))['catch'](handleError(_0x4ceb36,null));};exports[_0x61d6('0x3f')]=function(_0x4f9c24,_0x3e0b3c){var _0x23e541={'raw':!![],'where':{'id':_0x4f9c24['params']['id']}},_0x5e1e27={};_0x5e1e27[_0x61d6('0x2a')]=_[_0x61d6('0x40')](db['WhatsappTransferReport'][_0x61d6('0x41')]);_0x5e1e27[_0x61d6('0x2b')]=_[_0x61d6('0x40')](_0x4f9c24[_0x61d6('0x2b')]);_0x5e1e27['filters']=_[_0x61d6('0x2c')](_0x5e1e27[_0x61d6('0x2a')],_0x5e1e27[_0x61d6('0x2b')]);_0x23e541['attributes']=_['intersection'](_0x5e1e27[_0x61d6('0x2a')],qs[_0x61d6('0x2d')](_0x4f9c24[_0x61d6('0x2b')][_0x61d6('0x2d')]));_0x23e541[_0x61d6('0x2e')]=_0x23e541[_0x61d6('0x2e')]['length']?_0x23e541['attributes']:_0x5e1e27[_0x61d6('0x2a')];if(_0x4f9c24[_0x61d6('0x2b')][_0x61d6('0x3b')]){_0x23e541['include']=[{'all':!![]}];}_0x23e541=_[_0x61d6('0x38')]({},_0x23e541,_0x4f9c24[_0x61d6('0x3a')]);return db[_0x61d6('0x26')][_0x61d6('0x42')](_0x23e541)[_0x61d6('0x1f')](handleEntityNotFound(_0x3e0b3c,null))[_0x61d6('0x1f')](respondWithResult(_0x3e0b3c,null))[_0x61d6('0x43')](handleError(_0x3e0b3c,null));};exports[_0x61d6('0x44')]=function(_0x419e73,_0x1f9b7a){return db[_0x61d6('0x26')][_0x61d6('0x44')](_0x419e73['body'],{})[_0x61d6('0x1f')](respondWithResult(_0x1f9b7a,0xc9))['catch'](handleError(_0x1f9b7a,null));};exports['update']=function(_0x5bfc75,_0x280a82){if(_0x5bfc75[_0x61d6('0x45')]['id']){delete _0x5bfc75[_0x61d6('0x45')]['id'];}return db[_0x61d6('0x26')]['find']({'where':{'id':_0x5bfc75['params']['id']}})[_0x61d6('0x1f')](handleEntityNotFound(_0x280a82,null))[_0x61d6('0x1f')](saveUpdates(_0x5bfc75[_0x61d6('0x45')],null))[_0x61d6('0x1f')](respondWithResult(_0x280a82,null))[_0x61d6('0x43')](handleError(_0x280a82,null));};exports['destroy']=function(_0x4991f0,_0x3fc4ed){return db[_0x61d6('0x26')]['find']({'where':{'id':_0x4991f0[_0x61d6('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fc4ed,null))[_0x61d6('0x1f')](removeEntity(_0x3fc4ed,null))['catch'](handleError(_0x3fc4ed,null));};exports['describe']=function(_0x5299ac,_0xd4162){return db[_0x61d6('0x26')][_0x61d6('0x47')]()['then'](respondWithResult(_0xd4162,null))[_0x61d6('0x43')](handleError(_0xd4162,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 09fcc46..3c95276 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 _0x5b8f=['./whatsappTransferReport.attributes','exports','define','uniqueid','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x12bc03,_0x1b8c1e){var _0x1f8ff2=function(_0x1c78a4){while(--_0x1c78a4){_0x12bc03['push'](_0x12bc03['shift']());}};_0x1f8ff2(++_0x1b8c1e);}(_0x5b8f,0x1c6));var _0xf5b8=function(_0x486ab6,_0x257c0a){_0x486ab6=_0x486ab6-0x0;var _0x1ce5ea=_0x5b8f[_0x486ab6];return _0x1ce5ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5b8('0x0'))(_0xf5b8('0x1'));var moment=require(_0xf5b8('0x2'));var BPromise=require(_0xf5b8('0x3'));var rp=require(_0xf5b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5b8('0x5'));var config=require('../../config/environment');var attributes=require(_0xf5b8('0x6'));module[_0xf5b8('0x7')]=function(_0xa4cebd,_0x5a1edd){return _0xa4cebd[_0xf5b8('0x8')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf5b8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7258=['path','rimraf','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','moment','request-promise'];(function(_0x53e787,_0x4298e6){var _0x2781a0=function(_0x21f861){while(--_0x21f861){_0x53e787['push'](_0x53e787['shift']());}};_0x2781a0(++_0x4298e6);}(_0x7258,0x104));var _0x8725=function(_0x35537f,_0x18b082){_0x35537f=_0x35537f-0x0;var _0x26f771=_0x7258[_0x35537f];return _0x26f771;};'use strict';var _=require(_0x8725('0x0'));var util=require('util');var logger=require(_0x8725('0x1'))('api');var moment=require(_0x8725('0x2'));var BPromise=require('bluebird');var rp=require(_0x8725('0x3'));var fs=require('fs');var path=require(_0x8725('0x4'));var rimraf=require(_0x8725('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x8725('0x6')]=function(_0x45fa38,_0x53d017){return _0x45fa38[_0x8725('0x7')](_0x8725('0x8'),attributes,{'tableName':_0x8725('0x9'),'paranoid':![],'indexes':[{'name':_0x8725('0xa'),'fields':[_0x8725('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index cc36531..2e0ad2e 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 _0xb069=['rpc','../../config/environment','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb069,0x1f0));var _0x9b06=function(_0x42317d,_0x314db5){_0x42317d=_0x42317d-0x0;var _0x4731a2=_0xb069[_0x42317d];return _0x4731a2;};'use strict';var _=require(_0x9b06('0x0'));var util=require(_0x9b06('0x1'));var moment=require(_0x9b06('0x2'));var BPromise=require(_0x9b06('0x3'));var rs=require(_0x9b06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b06('0x5'))['db'];var utils=require(_0x9b06('0x6'));var logger=require(_0x9b06('0x7'))(_0x9b06('0x8'));var config=require(_0x9b06('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d6cf9,_0x503204,_0x78ea06){return new BPromise(function(_0x2eed8a,_0x14a975){return client[_0x9b06('0xb')](_0x2d6cf9,_0x78ea06)[_0x9b06('0xc')](function(_0x3ed50a){logger[_0x9b06('0xd')](_0x9b06('0xe'),_0x503204,_0x9b06('0xf'));logger[_0x9b06('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x503204,_0x9b06('0xf'),JSON['stringify'](_0x3ed50a));if(_0x3ed50a[_0x9b06('0x11')]){if(_0x3ed50a[_0x9b06('0x11')][_0x9b06('0x12')]===0x1f4){logger['error'](_0x9b06('0xe'),_0x503204,_0x3ed50a['error'][_0x9b06('0x13')]);return _0x14a975(_0x3ed50a[_0x9b06('0x11')]['message']);}logger[_0x9b06('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x503204,_0x3ed50a[_0x9b06('0x11')][_0x9b06('0x13')]);return _0x2eed8a(_0x3ed50a['error']['message']);}else{logger[_0x9b06('0xd')](_0x9b06('0xe'),_0x503204,_0x9b06('0xf'));_0x2eed8a(_0x3ed50a[_0x9b06('0x14')]['message']);}})['catch'](function(_0x1e1ef5){logger[_0x9b06('0x11')](_0x9b06('0xe'),_0x503204,_0x1e1ef5);_0x14a975(_0x1e1ef5);});});} \ No newline at end of file +var _0x5c4d=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','code','error','WhatsappTransferReport,\x20%s,\x20%s','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4fb03f,_0x15a082){var _0x171dcd=function(_0x2fe544){while(--_0x2fe544){_0x4fb03f['push'](_0x4fb03f['shift']());}};_0x171dcd(++_0x15a082);}(_0x5c4d,0x1db));var _0xd5c4=function(_0x44bf54,_0x5be3d6){_0x44bf54=_0x44bf54-0x0;var _0x2c4a96=_0x5c4d[_0x44bf54];return _0x2c4a96;};'use strict';var _=require(_0xd5c4('0x0'));var util=require(_0xd5c4('0x1'));var moment=require('moment');var BPromise=require(_0xd5c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5c4('0x3'));var db=require(_0xd5c4('0x4'))['db'];var utils=require(_0xd5c4('0x5'));var logger=require(_0xd5c4('0x6'))(_0xd5c4('0x7'));var config=require(_0xd5c4('0x8'));var jayson=require(_0xd5c4('0x9'));var client=jayson['client'][_0xd5c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a57f4,_0x138fd1,_0x58844c){return new BPromise(function(_0x73785f,_0x38a684){return client[_0xd5c4('0xb')](_0x2a57f4,_0x58844c)[_0xd5c4('0xc')](function(_0x381e31){logger[_0xd5c4('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x138fd1,_0xd5c4('0xe'));logger[_0xd5c4('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x138fd1,_0xd5c4('0xe'),JSON[_0xd5c4('0x10')](_0x381e31));if(_0x381e31['error']){if(_0x381e31['error'][_0xd5c4('0x11')]===0x1f4){logger[_0xd5c4('0x12')](_0xd5c4('0x13'),_0x138fd1,_0x381e31['error'][_0xd5c4('0x14')]);return _0x38a684(_0x381e31[_0xd5c4('0x12')]['message']);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x138fd1,_0x381e31[_0xd5c4('0x12')]['message']);return _0x73785f(_0x381e31[_0xd5c4('0x12')]['message']);}else{logger[_0xd5c4('0xd')](_0xd5c4('0x13'),_0x138fd1,_0xd5c4('0xe'));_0x73785f(_0x381e31['result']['message']);}})['catch'](function(_0x523b85){logger[_0xd5c4('0x12')](_0xd5c4('0x13'),_0x138fd1,_0x523b85);_0x38a684(_0x523b85);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 8c61b97..84db233 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04e7=['number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','filter','map','join','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/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x04e7,0x121));var _0x704e=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x04e7[_0x4d7f3f];return _0x5d67cc;};'use strict';var _=require(_0x704e('0x0'));var db=require(_0x704e('0x1'))['db'];var seedDb=require(_0x704e('0x2'));var checkLicense=require(_0x704e('0x3'));var rpc=require(_0x704e('0x4'));var config=require(_0x704e('0x5'));var logger=require(_0x704e('0x6'))(_0x704e('0x7'));var pm2=require(_0x704e('0x8'));var pm2Config=require(_0x704e('0x9'));var schedule=require(_0x704e('0xa'));var chat=require(_0x704e('0xb'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x704e('0xc'));var provider=require(_0x704e('0xd'));function main(){return db[_0x704e('0xe')][_0x704e('0xf')]()[_0x704e('0x10')](function(){if(config[_0x704e('0x11')]){return seedDb[_0x704e('0x12')]();}})[_0x704e('0x10')](function(){return checkLicense[_0x704e('0x12')]();})[_0x704e('0x10')](function(){return rpc[_0x704e('0x13')]();})[_0x704e('0x10')](function(_0x48dc9b){logger[_0x704e('0x14')](_0x48dc9b);return chat[_0x704e('0x15')]();})[_0x704e('0x10')](function(){return whatsapp[_0x704e('0x15')]();})[_0x704e('0x10')](function(){return schedule[_0x704e('0x15')]();})[_0x704e('0x10')](function(){return transcribe['start']();})['then'](function(){return provider[_0x704e('0x15')]();})[_0x704e('0x10')](function(_0x12a46c){logger[_0x704e('0x14')](_0x12a46c);return pm2[_0x704e('0x15')](pm2Config);})[_0x704e('0x10')](function(_0x2abf61){var _0x33a743=_0x2abf61['filter'](function(_0xed4c87){return typeof _0xed4c87[_0x704e('0x16')]===_0x704e('0x17')&&_0xed4c87['exitCode']>=0x0;});if(_0x33a743[_0x704e('0x18')]>0x0){throw new Error(_0x33a743[_0x704e('0x18')]+_0x704e('0x19')+_['map'](_0x33a743,function(_0x1b347a){return'\x22'+_0x1b347a[_0x704e('0x1a')][_0x704e('0x1b')]+'\x22';}));}logger[_0x704e('0x14')](_0x704e('0x1c'),_['map'](_[_0x704e('0x1d')](_0x2abf61,{'status':'online'}),_0x704e('0x1b'))['join']());logger['info']('Offline\x20apps:',_[_0x704e('0x1e')](_[_0x704e('0x1d')](_0x2abf61,function(_0xb6e2c8){return _0xb6e2c8['status']!=='online';}),_0x704e('0x1b'))[_0x704e('0x1f')]()||_0x704e('0x20'));console[_0x704e('0x21')](_0x704e('0x22'));})[_0x704e('0x23')](function(_0x30a391){console[_0x704e('0x21')](_0x704e('0x24'),_0x30a391);logger[_0x704e('0x25')](_0x704e('0x26'),_0x30a391);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xceae=['filter','online','join','status','None','App\x20Ready!','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map'];(function(_0x2fb37d,_0x5ac84d){var _0x287bd9=function(_0xb64f28){while(--_0xb64f28){_0x2fb37d['push'](_0x2fb37d['shift']());}};_0x287bd9(++_0x5ac84d);}(_0xceae,0x122));var _0xecea=function(_0x2de59e,_0x24b766){_0x2de59e=_0x2de59e-0x0;var _0x534d4b=_0xceae[_0x2de59e];return _0x534d4b;};'use strict';var _=require(_0xecea('0x0'));var db=require(_0xecea('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require('./rpc');var config=require(_0xecea('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0xecea('0x3'));var pm2Config=require(_0xecea('0x4'));var schedule=require(_0xecea('0x5'));var chat=require(_0xecea('0x6'));var whatsapp=require(_0xecea('0x7'));var transcribe=require(_0xecea('0x8'));var provider=require(_0xecea('0x9'));function main(){return db[_0xecea('0xa')][_0xecea('0xb')]()[_0xecea('0xc')](function(){if(config['seedDB']){return seedDb[_0xecea('0xd')]();}})['then'](function(){return checkLicense[_0xecea('0xd')]();})[_0xecea('0xc')](function(){return rpc[_0xecea('0xe')]();})[_0xecea('0xc')](function(_0xd2fce0){logger[_0xecea('0xf')](_0xd2fce0);return chat[_0xecea('0x10')]();})[_0xecea('0xc')](function(){return whatsapp[_0xecea('0x10')]();})[_0xecea('0xc')](function(){return schedule[_0xecea('0x10')]();})['then'](function(){return transcribe['start']();})['then'](function(){return provider[_0xecea('0x10')]();})['then'](function(_0x3f799f){logger[_0xecea('0xf')](_0x3f799f);return pm2[_0xecea('0x10')](pm2Config);})[_0xecea('0xc')](function(_0x18f8d1){var _0x14896f=_0x18f8d1['filter'](function(_0x32561f){return typeof _0x32561f[_0xecea('0x11')]===_0xecea('0x12')&&_0x32561f['exitCode']>=0x0;});if(_0x14896f[_0xecea('0x13')]>0x0){throw new Error(_0x14896f['length']+_0xecea('0x14')+_['map'](_0x14896f,function(_0x2d3aa6){return'\x22'+_0x2d3aa6[_0xecea('0x15')][_0xecea('0x16')]+'\x22';}));}logger[_0xecea('0xf')](_0xecea('0x17'),_[_0xecea('0x18')](_[_0xecea('0x19')](_0x18f8d1,{'status':_0xecea('0x1a')}),'name')[_0xecea('0x1b')]());logger[_0xecea('0xf')]('Offline\x20apps:',_[_0xecea('0x18')](_['filter'](_0x18f8d1,function(_0x12971a){return _0x12971a[_0xecea('0x1c')]!=='online';}),'name')[_0xecea('0x1b')]()||_0xecea('0x1d'));console['log'](_0xecea('0x1e'));})[_0xecea('0x1f')](function(_0x2a1a7a){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x2a1a7a);logger[_0xecea('0x20')](_0xecea('0x21'),_0x2a1a7a);process[_0xecea('0x22')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c26cd3d..f854ca6 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 _0xa9e0=['role','redirect','/dashboards/general','send','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','apiKeyNonce','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','decryptString','length','unshift','encryptString','promisify','payload','options','verify','randomBytes','toString','hex','now','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','name','userpic','permissions','md5secret','voicePause','chatPause','mailPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','use','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','catch','isAuthenticated','headers','startsWith','authorization','Basic','User','find','authenticate','pass','status','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'];(function(_0x2a1576,_0xdd6023){var _0x101697=function(_0x2f944c){while(--_0x2f944c){_0x2a1576['push'](_0x2a1576['shift']());}};_0x101697(++_0xdd6023);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var db=require(_0x0a9e('0x0'))['db'];var config=require(_0x0a9e('0x1'));var hardwareConf=require(_0x0a9e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x0a9e('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x0a9e('0x4'));var compose=require(_0x0a9e('0x5'));var basicAuth=require(_0x0a9e('0x6'));var crypto=require(_0x0a9e('0x7'));var BPromise=require(_0x0a9e('0x8'));var util=require('util');var moment=require(_0x0a9e('0x9'));var validateJwt=expressJwt({'secret':config[_0x0a9e('0xa')][_0x0a9e('0xb')]});var userAttributes=['id','role','fullname',_0x0a9e('0xc'),'internal','email',_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),_0x0a9e('0x11'),_0x0a9e('0x12'),'faxPause','smsPause','openchannelPause','pauseType',_0x0a9e('0x13'),_0x0a9e('0x14'),_0x0a9e('0x15'),_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),'alias',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'phoneBarExpires',_0x0a9e('0x1f'),'phoneBarRemoteControl',_0x0a9e('0x20'),'hotdesk',_0x0a9e('0x21'),_0x0a9e('0x22'),'privacyEnabled',_0x0a9e('0x23'),'wssPort',_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28'),_0x0a9e('0x29'),_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x0a9e('0x2c'),_0x0a9e('0x2d'),_0x0a9e('0x2e'),_0x0a9e('0x2f'),'openchannelAutoanswerDelay',_0x0a9e('0x30'),_0x0a9e('0x31'),'whatsappAutoanswer',_0x0a9e('0x32')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x0a9e('0x33')](function(_0x432e56,_0x38e7c4,_0x30bae6){if(_0x432e56['user']){_0x30bae6();}else{return db[_0x0a9e('0x34')][_0x0a9e('0x35')]({'where':{'id':_0x432e56[_0x0a9e('0x36')]['id']},'attributes':['id',_0x0a9e('0x37'),_0x0a9e('0x38')],'raw':!![]})[_0x0a9e('0x39')](function(_0x16b1ca){if(_0x16b1ca&&_0x16b1ca['closed']){return _0x38e7c4['status'](_0x16b1ca[_0x0a9e('0x38')]===_0x0a9e('0x3a')?0x195:0x193)[_0x0a9e('0x3b')]({'message':_0x16b1ca[_0x0a9e('0x38')]==='unmanaged'?_0x0a9e('0x3c'):'Forbidden.'});}else{_0x30bae6();}})[_0x0a9e('0x3d')](function(_0x5bfb33){_0x30bae6(_0x5bfb33);});}});};exports[_0x0a9e('0x3e')]=function isAuthenticated(_0x34dc65){return compose()[_0x0a9e('0x33')](function(_0x14433c,_0x140511,_0x1538a4){var _0x11c3b6;if(_0x14433c[_0x0a9e('0x3f')]['authorization']){if(_[_0x0a9e('0x40')](_0x14433c[_0x0a9e('0x3f')][_0x0a9e('0x41')],_0x0a9e('0x42'))){var _0x5c877d=basicAuth(_0x14433c);db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'name':_0x5c877d[_0x0a9e('0xc')]}})[_0x0a9e('0x39')](function(_0x58b06f){if(!_0x58b06f||!_0x58b06f[_0x0a9e('0x45')](_0x5c877d[_0x0a9e('0x46')])){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':'Wrong\x20credentials.'});}_0x14433c[_0x0a9e('0x48')]={'id':_0x58b06f['id']};_0x1538a4();})['catch'](function(_0x2407f9){_0x1538a4(_0x2407f9);});}else if(_[_0x0a9e('0x40')](_0x14433c[_0x0a9e('0x3f')][_0x0a9e('0x41')],_0x0a9e('0x49'))){validateJwt(_0x14433c,_0x140511,_0x1538a4);}else{if(_0x34dc65){_0x1538a4();}else{return _0x140511['status'](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x4a')});}}}else if(_0x14433c[_0x0a9e('0x4b')][_0x0a9e('0x4c')]){try{var _0x2b45ea={'audience':hardwareConf[_0x0a9e('0x4d')](),'issuer':hardwareConf[_0x0a9e('0x4d')]()};verifyJwt(_0x14433c[_0x0a9e('0x4b')]['apikey'],_0x2b45ea)[_0x0a9e('0x39')](function(_0x5e7238){return db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'id':_0x5e7238[_0x0a9e('0x4e')]}})[_0x0a9e('0x39')](function(_0x567193){_0x11c3b6=_0x567193;return db[_0x0a9e('0x4f')][_0x0a9e('0x35')]({'where':{'id':0x1},'attributes':[_0x0a9e('0x50'),_0x0a9e('0x51')],'raw':!![]});})['then'](function(_0x54135e){if(!_0x11c3b6||!_[_0x0a9e('0x52')](_0x11c3b6['apiKeyNonce'],_0x5e7238[_0x0a9e('0x53')])){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x54')});}if(_0x11c3b6['disabled']){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});}if(_0x11c3b6['blocked']){if(_0x54135e[_0x0a9e('0x51')]>0x0){if(moment(_0x11c3b6[_0x0a9e('0x56')])[_0x0a9e('0x57')](_0x54135e['blockDuration'],'minutes')>moment()){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});}}_0x14433c[_0x0a9e('0x48')]={'id':_0x11c3b6['id']};_0x1538a4();});})['catch'](function(){return _0x140511['status'](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});});}catch(_0x53f3ee){_0x1538a4(_0x53f3ee);}}else if(_0x34dc65){_0x1538a4();}else{return _0x140511[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x4a')});}})['use'](function(_0x316c8f,_0x2cfea9,_0x274e8e){if(_0x316c8f[_0x0a9e('0x48')]){db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'id':_0x316c8f[_0x0a9e('0x48')]['id']},'attributes':userAttributes})[_0x0a9e('0x39')](function(_0x23b089){if(!_0x23b089){return _0x2cfea9[_0x0a9e('0x47')](0x194)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x58')});}_0x316c8f[_0x0a9e('0x48')]=_0x23b089;_0x274e8e();})[_0x0a9e('0x3d')](function(_0x37f6cc){_0x274e8e(_0x37f6cc);});}else if(_0x34dc65){_0x274e8e();}else{return _0x2cfea9['status'](0x194)['json']({'message':_0x0a9e('0x59')});}});};exports[_0x0a9e('0x5a')]=function canUpdate(){return compose()[_0x0a9e('0x33')](function(_0x315881,_0x1a69dd,_0xc9a702){return licenseUtil[_0x0a9e('0x5b')]()[_0x0a9e('0x39')](function(_0x432fcc){if(_0x432fcc[_0x0a9e('0x5c')]){_0xc9a702();}else{return _0x1a69dd[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':'Forbidden'});}})[_0x0a9e('0x3d')](function(_0x138b8b){_0xc9a702(_0x138b8b);});});};exports[_0x0a9e('0x5d')]=function isWebrtcLicence(){return compose()[_0x0a9e('0x33')](function(_0x2e8caf,_0xbe9d19,_0x21eb86){return licenseUtil[_0x0a9e('0x5b')]()['then'](function(_0x2e9d90){if(_0x2e9d90['webrtc']){_0x21eb86();}else{return _0xbe9d19[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x5e')});}})['catch'](function(_0x14bec2){_0x21eb86(_0x14bec2);});});};exports[_0x0a9e('0x5f')]=function(_0x4774f4,_0x34aa5a,_0x45c845){_0x4774f4[_0x0a9e('0x5f')]=!![];return _0x45c845();};exports[_0x0a9e('0x60')]=function signToken(_0x5bbcde){return signJwt(_0x5bbcde);};exports[_0x0a9e('0x61')]=function(_0x1bde3c,_0x1b5e80){if(!_0x1bde3c[_0x0a9e('0x48')]){return _0x1b5e80[_0x0a9e('0x47')](0x194)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x62')});}var _0x19383e={'payload':{'id':_0x1bde3c[_0x0a9e('0x48')]['id'],'role':_0x1bde3c['user'][_0x0a9e('0x63')]},'options':{'expiresIn':0x15180}};return signJwt(_0x19383e)[_0x0a9e('0x39')](function(_0x4f7240){_0x1b5e80['cookie']('motion.token',_0x4f7240);_0x1b5e80[_0x0a9e('0x64')](_0x0a9e('0x65'));})[_0x0a9e('0x3d')](function(_0x11545a){return _0x1b5e80[_0x0a9e('0x47')](0x1f4)[_0x0a9e('0x66')](_0x11545a);});};exports[_0x0a9e('0x67')]=function(_0x375c18){if(_['isNil'](_0x375c18['apiKeyNonce'])||_['isNil'](_0x375c18[_0x0a9e('0x68')])){return null;}else{return createJwt(_0x375c18);}};exports[_0x0a9e('0x69')]=function(_0x14d602){_0x14d602['apiKeyNonce']=generateNonce();_0x14d602[_0x0a9e('0x68')]=generateIssuedAt();return createJwt(_0x14d602);};exports[_0x0a9e('0x6a')]=function(_0x53d113,_0x5a88da){var _0x2ef381=_0x53d113['query'][_0x0a9e('0x4c')];if(_0x2ef381){var _0x4c3845={'nonce':_0x5a88da[_0x0a9e('0x6b')],'iat':_0x5a88da[_0x0a9e('0x68')],'audience':hardwareConf[_0x0a9e('0x4d')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x2ef381,_0x4c3845)[_0x0a9e('0x39')](function(){return generateApiKey(_0x5a88da);});}else{throw{'message':_0x0a9e('0x6c')};}};exports['validatePasswordPattern']=function(_0x50f687){var _0x128aa6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x128aa6[_0x0a9e('0x6d')](_0x50f687))throw new db['Sequelize'][(_0x0a9e('0x6e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x0a9e('0x6f')]=function(_0x523cd2,_0xe22ccc,_0x4a6deb){var _0x5da27d=encryptor['decryptString'](_0xe22ccc)[_0x0a9e('0x70')](',');for(var _0x47de4c=0x0;_0x47de4c<_0x4a6deb;_0x47de4c++){if(!_0x5da27d[_0x47de4c])break;if(_0x523cd2[_0x0a9e('0x71')]()===_0x5da27d[_0x47de4c][_0x0a9e('0x71')]()){var _0x3cfd00=util[_0x0a9e('0x72')](_0x0a9e('0x73'),_0x4a6deb);if(_0x4a6deb===0x1){_0x3cfd00=_0x0a9e('0x74');}throw new db[(_0x0a9e('0x75'))][(_0x0a9e('0x6e'))](_0x3cfd00);}}return;};exports['updatePasswordsHistory']=function(_0x1c693e,_0x121cef){var _0x2642bb=_0x121cef?encryptor[_0x0a9e('0x76')](_0x121cef)[_0x0a9e('0x70')](','):[];if(_0x2642bb[_0x0a9e('0x77')]===0x5){_0x2642bb['splice'](-0x1,0x1);}_0x2642bb[_0x0a9e('0x78')](_0x1c693e);return encryptor[_0x0a9e('0x79')](_0x2642bb['join'](','));};function signJwt(_0x3649cc){var _0x5cc8fb=BPromise[_0x0a9e('0x7a')](jwt['sign'],{'context':jwt});var _0x4b3c1a=_0x3649cc['secret']||config[_0x0a9e('0xa')]['session'];return new BPromise(function(_0x2244d6,_0x1fc70e){_0x5cc8fb(_0x3649cc[_0x0a9e('0x7b')],_0x4b3c1a,_0x3649cc[_0x0a9e('0x7c')])[_0x0a9e('0x39')](function(_0x26d7db){_0x2244d6(_0x26d7db);})['catch'](function(_0x1627a7){_0x1fc70e(_0x1627a7);});});}function verifyJwt(_0x5854cc,_0xca4ade,_0x1f07cb){var _0x51aaf7=BPromise['promisify'](jwt[_0x0a9e('0x7d')],{'context':jwt});var _0x156f1c=_0x1f07cb||config[_0x0a9e('0xa')][_0x0a9e('0xb')];return new BPromise(function(_0x497d91,_0x1d0dc8){_0x51aaf7(_0x5854cc,_0x156f1c,_0xca4ade)[_0x0a9e('0x39')](function(_0x54327c){_0x497d91(_0x54327c);})[_0x0a9e('0x3d')](function(_0x17e88c){_0x1d0dc8(_0x17e88c);});});}function generateNonce(){return crypto[_0x0a9e('0x7e')](0x10)[_0x0a9e('0x7f')](_0x0a9e('0x80'));}function generateIssuedAt(){return Math['floor'](Date[_0x0a9e('0x81')]()/0x3e8)[_0x0a9e('0x7f')]();}function createJwt(_0x281c7d){var _0x47bb43={'payload':{'iat':_0x281c7d[_0x0a9e('0x68')],'nonce':_0x281c7d['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x281c7d['id'][_0x0a9e('0x7f')](),'issuer':hardwareConf[_0x0a9e('0x4d')](),'audience':hardwareConf[_0x0a9e('0x4d')]()}};return signJwt(_0x47bb43)[_0x0a9e('0x39')](function(_0x186f39){return{'iat':_0x281c7d[_0x0a9e('0x68')],'nonce':_0x281c7d[_0x0a9e('0x6b')],'token':_0x186f39};});} \ 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(_0x441859,_0x517088){_0x441859=_0x441859-0x0;var _0x6cab45=_0x9bde[_0x441859];return _0x6cab45;};'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 b0a0d23..bd5b651 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 _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x4f32e9,_0x1b4c7d){var _0x44dc71=function(_0x144476){while(--_0x144476){_0x4f32e9['push'](_0x4f32e9['shift']());}};_0x44dc71(++_0x1b4c7d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x10a904,_0x2bf292){_0x10a904=_0x10a904-0x0;var _0x53815a=_0x0b0e[_0x10a904];return _0x53815a;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file +var _0xbaf0=['skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','CmContact','describe','keys','startsWith','slice','length','cf_','type','map','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','parseAdvancedSearchFilter','search','parseQueryParameters','where','default','fields','filter','clause','tags','user'];(function(_0x153f5c,_0x101399){var _0x238dc4=function(_0x3eb7f1){while(--_0x3eb7f1){_0x153f5c['push'](_0x153f5c['shift']());}};_0x238dc4(++_0x101399);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var sqlUtils=require(_0x0baf('0x0'));var db=require(_0x0baf('0x1'))['db'];exports[_0x0baf('0x2')]=function(_0x263f79,_0x1688bc,_0x4d2e72,_0x5a3e42){var _0x232cc7={'count':0x0,'rows':[]};var _0x1c383e=sqlUtils[_0x0baf('0x3')](_0x1688bc,_0x263f79);if(_0x1c383e){return Promise[_0x0baf('0x4')](_0x232cc7);}var _0xe4c3c4=sqlUtils[_0x0baf('0x5')]();var _0x1a10b1={};var _0x2dcaac=![];var _0x1d0a0d=![];return Promise['resolve']()[_0x0baf('0x6')](function(){if(_0x263f79['search']){return sqlUtils[_0x0baf('0x7')](_0x263f79[_0x0baf('0x8')],_0x5a3e42);}else{return sqlUtils[_0x0baf('0x9')](_0x263f79,_0x5a3e42);}})[_0x0baf('0x6')](function(_0x7f54d4){_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xb')]);_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xc')]);_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xd')]);_0xe4c3c4['where'](_0x7f54d4['user'][_0x0baf('0xe')]);_0x1a10b1=_0x7f54d4[_0x0baf('0xf')];_0x1d0a0d=_0x7f54d4[_0x0baf('0x10')][_0x0baf('0x11')];return sqlUtils['checkListsRestrictions'](_0x1688bc,_0x263f79,_0x1d0a0d);})[_0x0baf('0x6')](function(_0x49e44b){_0xe4c3c4[_0x0baf('0xa')](_0x49e44b);var _0x1f50c3=_0x263f79[_0x0baf('0x8')]?_0x1a10b1[_0x0baf('0x12')]:_0x263f79[_0x0baf('0x13')];_0x2dcaac=_0x1f50c3?!![]:![];return sqlUtils[_0x0baf('0x14')](_0xe4c3c4,_0x1f50c3);})['then'](function(_0x4cd79d){_0x232cc7[_0x0baf('0x15')]=_0x4cd79d;if(_0x232cc7[_0x0baf('0x15')]===0x0){return;}return sqlUtils[_0x0baf('0x16')](_0xe4c3c4,_0x263f79[_0x0baf('0xc')],_0x4d2e72,_0x2dcaac,_0x1a10b1[_0x0baf('0xe')],_0x1d0a0d);})[_0x0baf('0x6')](function(_0x53c338){if(!_0x53c338){return[];}return sqlUtils[_0x0baf('0x17')](_0x53c338,_0x263f79,_0x4d2e72);})[_0x0baf('0x6')](function(_0x1ef0e5){_0x232cc7[_0x0baf('0x18')]=_0x1ef0e5;return _0x232cc7;})[_0x0baf('0x19')](function(_0x42b7f2){throw _0x42b7f2;});};exports['describe']=function(){var _0x5cff5d={};var _0x1410ec=[];return db[_0x0baf('0x1a')][_0x0baf('0x1b')]()[_0x0baf('0x6')](function(_0x1fa92b){_0x5cff5d=_0x1fa92b;var _0x3e3e20=Object[_0x0baf('0x1c')](_0x5cff5d)[_0x0baf('0xd')](function(_0x2c42e2){return _[_0x0baf('0x1d')](_0x2c42e2,'cf_')?_0x2c42e2:undefined;});var _0x334bd6=_0x3e3e20['map'](function(_0xf6c158){return db['CmCustomField']['findOne']({'where':{'id':_0xf6c158[_0x0baf('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x334bd6);})['then'](function(_0x47c4b){for(var _0x27b59c=0x0;_0x27b59c<_0x47c4b[_0x0baf('0x1f')];_0x27b59c++){if(_0x47c4b[_0x27b59c]){var _0x19d9fd=_0x0baf('0x20')+_0x47c4b[_0x27b59c]['id'];_0x5cff5d[_0x19d9fd]['fieldType']=_0x47c4b[_0x27b59c][_0x0baf('0x21')];}}_0x1410ec=_[_0x0baf('0x22')](Object[_0x0baf('0x1c')](_0x5cff5d),function(_0x366e71){return{'name':_0x366e71,'type':_0x5cff5d[_0x366e71][_0x0baf('0x21')]};});return _0x1410ec;})[_0x0baf('0x19')](function(_0x453525){throw _0x453525;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 128d637..35d5ba9 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 _0x2f5e=['Sequelize','QueryTypes','SELECT','CmContact','toString','Tags','clone','COUNT(*)','c.id','isEmpty','t.id\x20IN\x20?','sequelize','lodash','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','search','ListId','autocomplete','true','select','cm_contacts','where','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','field','dateOfBirth','castTo','DATE','type','default','text','start','value','Tag','tags','clause','ids','User','user','and','skip','keys','map','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','filter','role','getLists','c.ListId\x20IS\x20NULL','group','limit','offset','subqry.id','having','order','subqry.','DESC','from','findAll','name','color','keyBy'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0x2f5e,0x14d));var _0xe2f5=function(_0x31a570,_0x26e8db){_0x31a570=_0x31a570-0x0;var _0x5242d2=_0x2f5e[_0x31a570];return _0x5242d2;};'use strict';var _=require(_0xe2f5('0x0'));var squel=require(_0xe2f5('0x1'));var as=require(_0xe2f5('0x2'));var qs=require('../parsers/qs');var utils=require(_0xe2f5('0x3'));var db=require(_0xe2f5('0x4'))['db'];function skipContactsQuery(_0x2fb1bd,_0x222857){var _0x5babb2=![];if(_0x2fb1bd['role']==='agent'&&!_0x222857[_0xe2f5('0x5')]&&!_0x222857[_0xe2f5('0x6')]&&_0x222857[_0xe2f5('0x7')]!==_0xe2f5('0x8')){_0x5babb2=!![];}return _0x5babb2;}function getContactsSubquery(){return squel[_0xe2f5('0x9')]()['from'](_0xe2f5('0xa'),'c')[_0xe2f5('0xb')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x3e343a,_0x221875){var _0x497d5f=_0x221875?'c':_0xe2f5('0xc');_0x3e343a[_0xe2f5('0xd')](_0xe2f5('0xe'),'uc',_0xe2f5('0xf')+_0x497d5f+_0xe2f5('0x10'))['left_join'](_0xe2f5('0x11'),'ct',_0xe2f5('0x12')+_0x497d5f+'.id')[_0xe2f5('0xd')](_0xe2f5('0x13'),'t',_0xe2f5('0x14'));return _0x3e343a;}function addFieldsToQuery(_0x5422ec,_0xdb7b8,_0x540c21,_0x2b3fd9,_0x33445c){var _0x2a5e0f=_0x33445c?'c':_0xe2f5('0xc');if(!_0xdb7b8){_0xdb7b8=['id',_0xe2f5('0x15'),'lastName',_0xe2f5('0x16'),'mobile',_0xe2f5('0x17'),_0xe2f5('0x18'),'ListId',_0xe2f5('0x19'),_0xe2f5('0x1a'),_0xe2f5('0x1b'),_0xe2f5('0x1c'),_0xe2f5('0x1d')];}else if(!_0xdb7b8['includes']('id')){_0xdb7b8[_0xe2f5('0x1e')]('id');}var _0xc3db15=_0x540c21&&_0x33445c||!_0x540c21&&!_0x33445c;if(_0x2b3fd9){_0xc3db15=_0x2b3fd9&&_0x33445c||!_0x2b3fd9&&!_0x33445c;}_0xdb7b8[_0xe2f5('0x1f')](function(_0xc39cac){if(_0xc39cac==='TagIds'){if(_0xc3db15){_0x5422ec['field'](_0xe2f5('0x20'),_0xc39cac);}else if(_0x540c21||_0x2b3fd9){_0x5422ec['field'](_0x2a5e0f+'.'+_0xc39cac);}}else{_0x5422ec['field'](_0x2a5e0f+'.'+_0xc39cac);}});return _0x5422ec;}function getSqlClauses(){var _0x58517a={'default':squel['expr'](),'fields':squel[_0xe2f5('0x21')](),'filter':squel[_0xe2f5('0x21')](),'tags':{'clause':squel[_0xe2f5('0x21')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x58517a;}function parseTagParameter(_0x5da0b9){var _0x3d0fc8=squel[_0xe2f5('0x21')]();if(_0x5da0b9){var _0x2ac4c9=utils['getSelectedTags'](_0x5da0b9);_0x2ac4c9['forEach'](function(_0x48f75e){_0x3d0fc8['or'](_0xe2f5('0x22'),'%,'+_0x48f75e+',%');});}return _0x3d0fc8;}function parseSearchFilter(_0x5619d9){var _0x37ec73=squel[_0xe2f5('0x21')]();if(_0x5619d9){var _0x38f9a9=_0x5619d9[_0xe2f5('0x23')]('\x5c','\x5c\x5c')[_0xe2f5('0x23')](/'/g,'\x27\x27');if(_0x38f9a9[_0xe2f5('0x24')]('\x20')[_0xe2f5('0x25')]>0x1){_0x37ec73['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe2f5('0x26')](_0x38f9a9),null);}else{if(qs['isNumeric'](_0x38f9a9)){_0x37ec73['or'](_0xe2f5('0x27'),_0x38f9a9+'%');_0x37ec73['or'](_0xe2f5('0x28'),_0x38f9a9+'%');_0x37ec73['or'](_0xe2f5('0x29'),_0x38f9a9+'%');_0x37ec73['or'](_0xe2f5('0x2a'),_0x38f9a9+'%');}else if(qs['isEmail'](_0x38f9a9)){_0x37ec73['or'](_0xe2f5('0x2b'),_0x38f9a9+'%');}else{_0x37ec73['or']('c.firstName\x20LIKE\x20?','%'+_0x38f9a9+'%');_0x37ec73['or'](_0xe2f5('0x2c'),'%'+_0x38f9a9+'%');_0x37ec73['or'](_0xe2f5('0x2b'),'%'+_0x38f9a9+'%');}}}return _0x37ec73;}function parseAdvancedSearchFilter(_0x1be246,_0x2f8549){var _0x3239f5=getSqlClauses();var _0x22b523=as[_0xe2f5('0x2d')](_0x1be246);var _0xa5078=_0x22b523[_0xe2f5('0x2e')];for(var _0x30bdd7=0x0;_0x30bdd7<_0x22b523[_0xe2f5('0x2f')][_0xe2f5('0x25')];_0x30bdd7++){var _0x10a0d0=_0x22b523[_0xe2f5('0x2f')][_0x30bdd7];var _0x443fb7='c';var _0x193008=_[_0xe2f5('0x30')](_0x2f8549,['name',_0x10a0d0[_0xe2f5('0x31')]]);if(_0x193008){if(_0x10a0d0['field']===_0xe2f5('0x32')||_0x193008['fieldType']==='datetime'){_0x10a0d0[_0xe2f5('0x33')]=_0xe2f5('0x34');}var _0x44b368=as['buildExpression'](_0x443fb7,_0x193008[_0xe2f5('0x35')],_0x10a0d0);_0x3239f5[_0xe2f5('0x36')][_0xa5078](_0x44b368[_0xe2f5('0x37')],_0x44b368['value'][_0xe2f5('0x38')],_0x44b368[_0xe2f5('0x39')]['end']);}else{if(_0x10a0d0['field']===_0xe2f5('0x3a')){var _0xceef35=_0x10a0d0[_0xe2f5('0x39')][_0xe2f5('0x24')](',')['map'](function(_0x485c18){return Number(_0x485c18);});var _0x4a78b3=parseTagParameter(_0xceef35);_0x3239f5[_0xe2f5('0x3b')][_0xe2f5('0x3c')]['and'](_0x4a78b3);_0x3239f5[_0xe2f5('0x3b')][_0xe2f5('0x3d')]=_0xceef35;}else if(_0x10a0d0[_0xe2f5('0x31')]===_0xe2f5('0x3e')){_0x3239f5[_0xe2f5('0x3f')][_0xe2f5('0x3c')][_0xe2f5('0x40')]('uc.UserId\x20=\x20?',_0x10a0d0[_0xe2f5('0x39')]);_0x3239f5[_0xe2f5('0x3f')][_0xe2f5('0x41')]=!![];}}}return _0x3239f5;}function parseModelFields(_0x174b96,_0x2dc04e){var _0x1d7780=squel[_0xe2f5('0x21')]();var _0x655bb9=_(_0x174b96)[_0xe2f5('0x42')]()[_0xe2f5('0x43')](function(_0xb7fec6){return _[_0xe2f5('0x44')](_0x2dc04e,['name',_0xb7fec6])?_0xb7fec6:undefined;})[_0xe2f5('0x45')]()[_0xe2f5('0x39')]();if(_0x174b96[_0xe2f5('0x46')]){_0x655bb9[_0xe2f5('0x1e')](_0xe2f5('0x46'));}if(_0x655bb9['length']>0x0){_0x655bb9[_0xe2f5('0x1f')](function(_0x118662){if(_0x118662===_0xe2f5('0x6')){_0x1d7780[_0xe2f5('0x40')](_0xe2f5('0x47'),[][_0xe2f5('0x48')](_0x174b96[_0x118662]));}else if(_0x118662==='Contact'){var _0x1ee925='%'+_0x174b96[_0x118662]+'%';_0x1d7780[_0xe2f5('0x40')](_0xe2f5('0x49'),_0x1ee925);}else{_0x1d7780['and']('c.'+_0x118662+_0xe2f5('0x4a'),_0x174b96[_0x118662]);}});}return _0x1d7780;}function parseQueryParameters(_0x4ec5f9,_0x4a6347){var _0x11acec=getSqlClauses();return Promise[_0xe2f5('0x4b')]()[_0xe2f5('0x4c')](function(){return parseModelFields(_0x4ec5f9,_0x4a6347);})['then'](function(_0x3f3401){_0x11acec[_0xe2f5('0x4d')][_0xe2f5('0x40')](_0x3f3401);return parseTagParameter(_0x4ec5f9['tag']);})['then'](function(_0x337475){_0x11acec[_0xe2f5('0x3b')][_0xe2f5('0x3c')][_0xe2f5('0x40')](_0x337475);return parseSearchFilter(_0x4ec5f9['filter']);})['then'](function(_0xa40aea){_0x11acec[_0xe2f5('0x4e')]=_0xa40aea;return _0x11acec;});}function checkListsRestrictions(_0x3a307b,_0x2decf5,_0x4141db){var _0x27162a=squel[_0xe2f5('0x21')]();return Promise[_0xe2f5('0x4b')]()[_0xe2f5('0x4c')](function(){if(_0x2decf5[_0xe2f5('0x5')]&&_0x3a307b[_0xe2f5('0x4f')]==='agent'&&!_0x4141db){return _0x3a307b[_0xe2f5('0x50')]({'attributes':['id'],'raw':!![]});}})[_0xe2f5('0x4c')](function(_0x3fe07e){if(_0x3fe07e){if(_0x3fe07e[_0xe2f5('0x25')]===0x0){_0x27162a['and'](_0xe2f5('0x51'));}else{_0x27162a['and'](_0xe2f5('0x47'),_[_0xe2f5('0x43')](_0x3fe07e,'id'));}}})[_0xe2f5('0x4c')](function(){return _0x27162a;});}function buildContactsQuery(_0x5660fc,_0x522515,_0x595c6e,_0x163060,_0x5e2f13,_0xed5e4b){if(_0x522515){_0x522515=_0x595c6e['attributes'];}_0x5660fc=addFieldsToQuery(_0x5660fc,_0x522515,_0x163060,_0xed5e4b,!![]);var _0x5469d3=squel[_0xe2f5('0x9')]();_0x5469d3=addFieldsToQuery(_0x5469d3,_0x522515,_0x163060,_0xed5e4b,![]);if(_0x163060||_0xed5e4b){_0x5660fc=applyJoinClauses(_0x5660fc,!![]);_0x5660fc[_0xe2f5('0x52')]('c.id');if(_0x595c6e[_0xe2f5('0x53')]){_0x5469d3[_0xe2f5('0x53')](_0x595c6e[_0xe2f5('0x53')]);}if(_0x595c6e[_0xe2f5('0x54')]){_0x5469d3['offset'](_0x595c6e['offset']);}}else{_0x5469d3=applyJoinClauses(_0x5469d3,![]);_0x5469d3[_0xe2f5('0x52')](_0xe2f5('0x55'));if(_0x595c6e['limit']){_0x5660fc[_0xe2f5('0x53')](_0x595c6e['limit']);}if(_0x595c6e[_0xe2f5('0x54')]){_0x5660fc[_0xe2f5('0x54')](_0x595c6e[_0xe2f5('0x54')]);}}_0x5469d3[_0xe2f5('0x56')](_0x5e2f13);if(_0x595c6e[_0xe2f5('0x57')]){_0x595c6e[_0xe2f5('0x57')][_0xe2f5('0x1f')](function(_0x5ef513){_0x5660fc['order']('c.'+_0x5ef513[0x0],_0x5ef513[0x1]==='DESC'?![]:!![]);_0x5469d3[_0xe2f5('0x57')](_0xe2f5('0x58')+_0x5ef513[0x0],_0x5ef513[0x1]===_0xe2f5('0x59')?![]:!![]);});}_0x5469d3[_0xe2f5('0x5a')](_0x5660fc,_0xe2f5('0xc'));return _0x5469d3;}function getFilteredContacts(_0x58f6b4){var _0x8f07a1=[];return db[_0xe2f5('0x3a')][_0xe2f5('0x5b')]({'attributes':['id',_0xe2f5('0x5c'),_0xe2f5('0x5d')],'raw':!![]})[_0xe2f5('0x4c')](function(_0x5874b9){_0x8f07a1=_[_0xe2f5('0x5e')](_0x5874b9,'id');var _0x80c962={'type':db[_0xe2f5('0x5f')][_0xe2f5('0x60')][_0xe2f5('0x61')],'model':db[_0xe2f5('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x58f6b4[_0xe2f5('0x63')](),_0x80c962);})[_0xe2f5('0x4c')](function(_0x4a5d37){_0x4a5d37[_0xe2f5('0x1f')](function(_0x434d90){if(_0x434d90['TagIds']){_0x434d90[_0xe2f5('0x64')]=[];_0x434d90[_0xe2f5('0x1d')][_0xe2f5('0x24')](',')[_0xe2f5('0x1f')](function(_0x43fbf2){_0x434d90[_0xe2f5('0x64')][_0xe2f5('0x1e')](_0x8f07a1[_0x43fbf2]);});}delete _0x434d90[_0xe2f5('0x1d')];});return _0x4a5d37;});}function countFilteredContacts(_0x35dbb3,_0x4e6444){var _0x5ec0d2=_0x35dbb3[_0xe2f5('0x65')]();_0x5ec0d2['field'](_0xe2f5('0x66'));_0x5ec0d2=applyJoinClauses(_0x5ec0d2,!![]);_0x35dbb3[_0xe2f5('0x52')](_0xe2f5('0x67'));var _0x45f632=utils['getSelectedTags'](_0x4e6444);if(!_[_0xe2f5('0x68')](_0x45f632)){_0x5ec0d2['where'](_0xe2f5('0x69'),_0x45f632);}var _0x3f9a59={'type':db[_0xe2f5('0x5f')][_0xe2f5('0x60')][_0xe2f5('0x61')],'raw':!![]};return db[_0xe2f5('0x6a')]['query'](_0x5ec0d2[_0xe2f5('0x63')](),_0x3f9a59)[_0xe2f5('0x4c')](function(_0x154928){return _0x154928[0x0][_0xe2f5('0x66')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xa3fc=['c.id','limit','offset','subqry.id','having','order','subqry.','DESC','findAll','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','push','clone','COUNT(*)','getSelectedTags','isEmpty','exports','lodash','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','start','value','end','Tag','clause','and','tags','ids','User','user','keys','map','some','compact','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','group'];(function(_0x595214,_0x3e6a4e){var _0x1986d0=function(_0x5eb4f1){while(--_0x5eb4f1){_0x595214['push'](_0x595214['shift']());}};_0x1986d0(++_0x3e6a4e);}(_0xa3fc,0x1e8));var _0xca3f=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0xa3fc[_0x32f9ca];return _0x52e083;};'use strict';var _=require(_0xca3f('0x0'));var squel=require(_0xca3f('0x1'));var as=require(_0xca3f('0x2'));var qs=require('../parsers/qs');var utils=require(_0xca3f('0x3'));var db=require(_0xca3f('0x4'))['db'];function skipContactsQuery(_0x2609b1,_0x8de1ae){var _0x58118a=![];if(_0x2609b1[_0xca3f('0x5')]===_0xca3f('0x6')&&!_0x8de1ae[_0xca3f('0x7')]&&!_0x8de1ae[_0xca3f('0x8')]&&_0x8de1ae[_0xca3f('0x9')]!==_0xca3f('0xa')){_0x58118a=!![];}return _0x58118a;}function getContactsSubquery(){return squel[_0xca3f('0xb')]()[_0xca3f('0xc')](_0xca3f('0xd'),'c')[_0xca3f('0xe')](_0xca3f('0xf'));}function applyJoinClauses(_0x4e663d,_0x32a9da){var _0x1896cd=_0x32a9da?'c':_0xca3f('0x10');_0x4e663d['left_join']('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x1896cd+_0xca3f('0x11'))[_0xca3f('0x12')](_0xca3f('0x13'),'ct',_0xca3f('0x14')+_0x1896cd+_0xca3f('0x11'))[_0xca3f('0x12')](_0xca3f('0x15'),'t',_0xca3f('0x16'));return _0x4e663d;}function addFieldsToQuery(_0x1b8394,_0x120604,_0x29235d,_0x33febf,_0x47a224){var _0x4c7fa3=_0x47a224?'c':_0xca3f('0x10');if(!_0x120604){_0x120604=['id',_0xca3f('0x17'),_0xca3f('0x18'),_0xca3f('0x19'),'mobile',_0xca3f('0x1a'),_0xca3f('0x1b'),_0xca3f('0x8'),_0xca3f('0x1c'),_0xca3f('0x1d'),_0xca3f('0x1e'),_0xca3f('0x1f'),_0xca3f('0x20')];}else if(!_0x120604[_0xca3f('0x21')]('id')){_0x120604['push']('id');}var _0x1adbbf=_0x29235d&&_0x47a224||!_0x29235d&&!_0x47a224;if(_0x33febf){_0x1adbbf=_0x33febf&&_0x47a224||!_0x33febf&&!_0x47a224;}_0x120604[_0xca3f('0x22')](function(_0x5da3b4){if(_0x5da3b4===_0xca3f('0x20')){if(_0x1adbbf){_0x1b8394[_0xca3f('0x23')](_0xca3f('0x24'),_0x5da3b4);}else if(_0x29235d||_0x33febf){_0x1b8394[_0xca3f('0x23')](_0x4c7fa3+'.'+_0x5da3b4);}}else{_0x1b8394[_0xca3f('0x23')](_0x4c7fa3+'.'+_0x5da3b4);}});return _0x1b8394;}function getSqlClauses(){var _0x56a643={'default':squel[_0xca3f('0x25')](),'fields':squel[_0xca3f('0x25')](),'filter':squel[_0xca3f('0x25')](),'tags':{'clause':squel[_0xca3f('0x25')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x56a643;}function parseTagParameter(_0x51ad31){var _0x5e4d57=squel['expr']();if(_0x51ad31){var _0x30dc89=utils['getSelectedTags'](_0x51ad31);_0x30dc89[_0xca3f('0x22')](function(_0x1034d5){_0x5e4d57['or'](_0xca3f('0x26'),'%,'+_0x1034d5+',%');});}return _0x5e4d57;}function parseSearchFilter(_0x41bb8a){var _0x1f2285=squel[_0xca3f('0x25')]();if(_0x41bb8a){var _0x555b58=_0x41bb8a[_0xca3f('0x27')]('\x5c','\x5c\x5c')[_0xca3f('0x27')](/'/g,'\x27\x27');if(_0x555b58[_0xca3f('0x28')]('\x20')['length']>0x1){_0x1f2285['or'](_0xca3f('0x29'),qs[_0xca3f('0x2a')](_0x555b58),null);}else{if(qs[_0xca3f('0x2b')](_0x555b58)){_0x1f2285['or'](_0xca3f('0x2c'),_0x555b58+'%');_0x1f2285['or'](_0xca3f('0x2d'),_0x555b58+'%');_0x1f2285['or'](_0xca3f('0x2e'),_0x555b58+'%');_0x1f2285['or'](_0xca3f('0x2f'),_0x555b58+'%');}else if(qs[_0xca3f('0x30')](_0x555b58)){_0x1f2285['or']('c.email\x20LIKE\x20?',_0x555b58+'%');}else{_0x1f2285['or']('c.firstName\x20LIKE\x20?','%'+_0x555b58+'%');_0x1f2285['or']('c.lastName\x20LIKE\x20?','%'+_0x555b58+'%');_0x1f2285['or'](_0xca3f('0x31'),'%'+_0x555b58+'%');}}}return _0x1f2285;}function parseAdvancedSearchFilter(_0x10878e,_0x22bf4d){var _0x5e6578=getSqlClauses();var _0x447335=as[_0xca3f('0x32')](_0x10878e);var _0x2a90cf=_0x447335[_0xca3f('0x33')];for(var _0x289a9a=0x0;_0x289a9a<_0x447335[_0xca3f('0x34')][_0xca3f('0x35')];_0x289a9a++){var _0x1aeb03=_0x447335[_0xca3f('0x34')][_0x289a9a];var _0x6fe763='c';var _0x25d89c=_[_0xca3f('0x36')](_0x22bf4d,[_0xca3f('0x37'),_0x1aeb03['field']]);if(_0x25d89c){if(_0x1aeb03[_0xca3f('0x23')]===_0xca3f('0x38')||_0x25d89c[_0xca3f('0x39')]===_0xca3f('0x3a')){_0x1aeb03[_0xca3f('0x3b')]=_0xca3f('0x3c');}var _0x1c8186=as[_0xca3f('0x3d')](_0x6fe763,_0x25d89c[_0xca3f('0x3e')],_0x1aeb03);_0x5e6578[_0xca3f('0x3f')][_0x2a90cf](_0x1c8186[_0xca3f('0x40')],_0x1c8186['value'][_0xca3f('0x41')],_0x1c8186[_0xca3f('0x42')][_0xca3f('0x43')]);}else{if(_0x1aeb03[_0xca3f('0x23')]===_0xca3f('0x44')){var _0x50d4a5=_0x1aeb03[_0xca3f('0x42')][_0xca3f('0x28')](',')['map'](function(_0x47be54){return Number(_0x47be54);});var _0x1890b9=parseTagParameter(_0x50d4a5);_0x5e6578['tags'][_0xca3f('0x45')][_0xca3f('0x46')](_0x1890b9);_0x5e6578[_0xca3f('0x47')][_0xca3f('0x48')]=_0x50d4a5;}else if(_0x1aeb03[_0xca3f('0x23')]===_0xca3f('0x49')){_0x5e6578['user'][_0xca3f('0x45')][_0xca3f('0x46')]('uc.UserId\x20=\x20?',_0x1aeb03[_0xca3f('0x42')]);_0x5e6578[_0xca3f('0x4a')]['skip']=!![];}}}return _0x5e6578;}function parseModelFields(_0x693309,_0x47fe18){var _0x510629=squel[_0xca3f('0x25')]();var _0x4c6f55=_(_0x693309)[_0xca3f('0x4b')]()[_0xca3f('0x4c')](function(_0x4d3f4c){return _[_0xca3f('0x4d')](_0x47fe18,[_0xca3f('0x37'),_0x4d3f4c])?_0x4d3f4c:undefined;})[_0xca3f('0x4e')]()[_0xca3f('0x42')]();if(_0x693309[_0xca3f('0x4f')]){_0x4c6f55['push'](_0xca3f('0x4f'));}if(_0x4c6f55[_0xca3f('0x35')]>0x0){_0x4c6f55[_0xca3f('0x22')](function(_0x59867a){if(_0x59867a===_0xca3f('0x8')){_0x510629[_0xca3f('0x46')]('c.ListId\x20IN\x20?',[][_0xca3f('0x50')](_0x693309[_0x59867a]));}else if(_0x59867a===_0xca3f('0x4f')){var _0x5c4a24='%'+_0x693309[_0x59867a]+'%';_0x510629[_0xca3f('0x46')](_0xca3f('0x51'),_0x5c4a24);}else{_0x510629[_0xca3f('0x46')]('c.'+_0x59867a+_0xca3f('0x52'),_0x693309[_0x59867a]);}});}return _0x510629;}function parseQueryParameters(_0x527b55,_0x52ea78){var _0x326071=getSqlClauses();return Promise[_0xca3f('0x53')]()[_0xca3f('0x54')](function(){return parseModelFields(_0x527b55,_0x52ea78);})[_0xca3f('0x54')](function(_0x5722c2){_0x326071[_0xca3f('0x55')][_0xca3f('0x46')](_0x5722c2);return parseTagParameter(_0x527b55[_0xca3f('0x56')]);})[_0xca3f('0x54')](function(_0x3eddb3){_0x326071['tags'][_0xca3f('0x45')][_0xca3f('0x46')](_0x3eddb3);return parseSearchFilter(_0x527b55[_0xca3f('0x57')]);})[_0xca3f('0x54')](function(_0x45d455){_0x326071['filter']=_0x45d455;return _0x326071;});}function checkListsRestrictions(_0x346bb4,_0x1a0fe8,_0x1b61b9){var _0x55b310=squel[_0xca3f('0x25')]();return Promise[_0xca3f('0x53')]()[_0xca3f('0x54')](function(){if(_0x1a0fe8[_0xca3f('0x7')]&&_0x346bb4['role']===_0xca3f('0x6')&&!_0x1b61b9){return _0x346bb4[_0xca3f('0x58')]({'attributes':['id'],'raw':!![]});}})[_0xca3f('0x54')](function(_0x1a3b2b){if(_0x1a3b2b){if(_0x1a3b2b[_0xca3f('0x35')]===0x0){_0x55b310['and'](_0xca3f('0x59'));}else{_0x55b310[_0xca3f('0x46')](_0xca3f('0x5a'),_[_0xca3f('0x4c')](_0x1a3b2b,'id'));}}})[_0xca3f('0x54')](function(){return _0x55b310;});}function buildContactsQuery(_0x3fe8fa,_0x52a1a3,_0x41b4dd,_0x275d83,_0x411b35,_0x4dcf57){if(_0x52a1a3){_0x52a1a3=_0x41b4dd['attributes'];}_0x3fe8fa=addFieldsToQuery(_0x3fe8fa,_0x52a1a3,_0x275d83,_0x4dcf57,!![]);var _0x586db0=squel['select']();_0x586db0=addFieldsToQuery(_0x586db0,_0x52a1a3,_0x275d83,_0x4dcf57,![]);if(_0x275d83||_0x4dcf57){_0x3fe8fa=applyJoinClauses(_0x3fe8fa,!![]);_0x3fe8fa[_0xca3f('0x5b')](_0xca3f('0x5c'));if(_0x41b4dd['limit']){_0x586db0['limit'](_0x41b4dd[_0xca3f('0x5d')]);}if(_0x41b4dd['offset']){_0x586db0['offset'](_0x41b4dd[_0xca3f('0x5e')]);}}else{_0x586db0=applyJoinClauses(_0x586db0,![]);_0x586db0[_0xca3f('0x5b')](_0xca3f('0x5f'));if(_0x41b4dd['limit']){_0x3fe8fa[_0xca3f('0x5d')](_0x41b4dd[_0xca3f('0x5d')]);}if(_0x41b4dd[_0xca3f('0x5e')]){_0x3fe8fa[_0xca3f('0x5e')](_0x41b4dd[_0xca3f('0x5e')]);}}_0x586db0[_0xca3f('0x60')](_0x411b35);if(_0x41b4dd['order']){_0x41b4dd[_0xca3f('0x61')][_0xca3f('0x22')](function(_0x5960d6){_0x3fe8fa['order']('c.'+_0x5960d6[0x0],_0x5960d6[0x1]==='DESC'?![]:!![]);_0x586db0[_0xca3f('0x61')](_0xca3f('0x62')+_0x5960d6[0x0],_0x5960d6[0x1]===_0xca3f('0x63')?![]:!![]);});}_0x586db0['from'](_0x3fe8fa,_0xca3f('0x10'));return _0x586db0;}function getFilteredContacts(_0x11f5d7){var _0x8df153=[];return db[_0xca3f('0x44')][_0xca3f('0x64')]({'attributes':['id','name','color'],'raw':!![]})[_0xca3f('0x54')](function(_0x3a51eb){_0x8df153=_[_0xca3f('0x65')](_0x3a51eb,'id');var _0x12fb9f={'type':db[_0xca3f('0x66')][_0xca3f('0x67')][_0xca3f('0x68')],'model':db[_0xca3f('0x69')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xca3f('0x6a')][_0xca3f('0x6b')](_0x11f5d7[_0xca3f('0x6c')](),_0x12fb9f);})[_0xca3f('0x54')](function(_0x2490d3){_0x2490d3['forEach'](function(_0x27287b){if(_0x27287b['TagIds']){_0x27287b['Tags']=[];_0x27287b[_0xca3f('0x20')][_0xca3f('0x28')](',')['forEach'](function(_0x2ccf38){_0x27287b[_0xca3f('0x6d')][_0xca3f('0x6e')](_0x8df153[_0x2ccf38]);});}delete _0x27287b[_0xca3f('0x20')];});return _0x2490d3;});}function countFilteredContacts(_0x4cdbd3,_0x28fd5a){var _0x26c5e5=_0x4cdbd3[_0xca3f('0x6f')]();_0x26c5e5[_0xca3f('0x23')](_0xca3f('0x70'));_0x26c5e5=applyJoinClauses(_0x26c5e5,!![]);_0x4cdbd3[_0xca3f('0x5b')](_0xca3f('0x5c'));var _0x3795f8=utils[_0xca3f('0x71')](_0x28fd5a);if(!_[_0xca3f('0x72')](_0x3795f8)){_0x26c5e5[_0xca3f('0xe')]('t.id\x20IN\x20?',_0x3795f8);}var _0x51ea57={'type':db[_0xca3f('0x66')][_0xca3f('0x67')]['SELECT'],'raw':!![]};return db[_0xca3f('0x6a')]['query'](_0x26c5e5[_0xca3f('0x6c')](),_0x51ea57)[_0xca3f('0x54')](function(_0x4fb048){return _0x4fb048[0x0]['COUNT(*)'];});}module[_0xca3f('0x73')]={'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 f5225a3..0ad04ad 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 _0xcf86=['binary','end','final','write','close','unlink','createDecipher','data','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','update'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xcf86,0x115));var _0x6cf8=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xcf86[_0x513aa5];return _0x1a1a7c;};'use strict';var crypto=require(_0x6cf8('0x0'));var fs=require('fs');var BPromise=require(_0x6cf8('0x1'));var _=require(_0x6cf8('0x2'));var config=require(_0x6cf8('0x3'));var logger=require(_0x6cf8('0x4'))(_0x6cf8('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6cf8('0x6')]['session'],'algorithm':_0x6cf8('0x7')};const fileOptions={'algorithm':_0x6cf8('0x8')};if(config[_0x6cf8('0x9')]&&config[_0x6cf8('0x9')][_0x6cf8('0xa')]){var isSupported=isAlgorithmSupported(config[_0x6cf8('0x9')][_0x6cf8('0xa')]);if(isSupported){fileOptions['algorithm']=config[_0x6cf8('0x9')][_0x6cf8('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6cf8('0xb')](',\x20');logger['error'](config[_0x6cf8('0x9')]['algorithm'],_0x6cf8('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x475a62){return AES_SUPPORTED_RX[_0x6cf8('0xd')](_0x475a62);}function getSupportedCiphers(){return crypto[_0x6cf8('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x359aa8){return getSupportedCiphers()[_0x6cf8('0xf')](_0x359aa8)>-0x1;}function combineOptions(_0x23f14a){var _0x50abb5={};for(var _0x3c2a59 in fileOptions){if(fileOptions[_0x6cf8('0x10')](_0x3c2a59)){_0x50abb5[_0x3c2a59]=fileOptions[_0x3c2a59];}}if(_0x23f14a){for(var _0x3d90c3 in _0x23f14a){if(_0x23f14a[_0x6cf8('0x10')](_0x3d90c3)){_0x50abb5[_0x3d90c3]=_0x23f14a[_0x3d90c3];}}}return _0x50abb5;}exports[_0x6cf8('0x11')]=function(_0x48a7b0,_0x148807,_0x446796,_0x29cbee){return new BPromise(function(_0x220285,_0x5787c4){_0x29cbee=combineOptions(_0x29cbee);var _0x3f353f=new Buffer(_0x446796);var _0x38c6ad=fs[_0x6cf8('0x12')](_0x48a7b0);var _0x3e3da4=fs['createWriteStream'](_0x148807);var _0x52470d=crypto['createCipher'](_0x29cbee['algorithm'],_0x3f353f);_0x38c6ad['on']('data',function(_0x433ddc){var _0x51ce37=new Buffer(_0x52470d[_0x6cf8('0x13')](_0x433ddc),_0x6cf8('0x14'));_0x3e3da4['write'](_0x51ce37);});_0x38c6ad['on'](_0x6cf8('0x15'),function(){try{var _0x4ffbb7=new Buffer(_0x52470d[_0x6cf8('0x16')](_0x6cf8('0x14')),'binary');_0x3e3da4[_0x6cf8('0x17')](_0x4ffbb7);_0x3e3da4[_0x6cf8('0x15')]();_0x3e3da4['on'](_0x6cf8('0x18'),function(){return _0x220285(_0x148807);});}catch(_0x7fff3a){fs[_0x6cf8('0x19')](_0x148807);return _0x5787c4(_0x7fff3a);}});});};exports['decryptFile']=function(_0x495515,_0x55156f,_0x5c7743,_0x43612e){return new BPromise(function(_0x18d2f8,_0x42541b){_0x43612e=combineOptions(_0x43612e);var _0x16731c=new Buffer(_0x5c7743);var _0x3a2834=fs[_0x6cf8('0x12')](_0x495515);var _0x2f6d65=fs['createWriteStream'](_0x55156f);var _0x3c881f=crypto[_0x6cf8('0x1a')](_0x43612e[_0x6cf8('0xa')],_0x16731c);_0x3a2834['on'](_0x6cf8('0x1b'),function(_0x2641e3){var _0x1f2abd=new Buffer(_0x3c881f['update'](_0x2641e3),_0x6cf8('0x14'));_0x2f6d65[_0x6cf8('0x17')](_0x1f2abd);});_0x3a2834['on'](_0x6cf8('0x15'),function(){try{var _0x42df35=new Buffer(_0x3c881f['final'](_0x6cf8('0x14')),_0x6cf8('0x14'));_0x2f6d65['write'](_0x42df35);_0x2f6d65['end']();_0x2f6d65['on'](_0x6cf8('0x18'),function(){return _0x18d2f8(_0x55156f);});}catch(_0x20c22f){fs[_0x6cf8('0x19')](_0x55156f);return _0x42541b(_0x20c22f);}});});};exports['encryptString']=function(_0x2da669,_0x2ac88e,_0x5912a1){var _0x77e3f0=_0x5912a1||stringOptions[_0x6cf8('0xa')];var _0x4930f0=_0x2ac88e||stringOptions[_0x6cf8('0x1c')];var _0x1bf59c=crypto[_0x6cf8('0x1d')](_0x77e3f0,_0x4930f0);var _0x1b2390=_0x1bf59c[_0x6cf8('0x13')](_0x2da669,_0x6cf8('0x1e'),_0x6cf8('0x1f'));_0x1b2390+=_0x1bf59c['final'](_0x6cf8('0x1f'));return _0x1b2390;};exports[_0x6cf8('0x20')]=function(_0x15f51d,_0x3e7bca,_0x56017c){var _0x31b3bf=_0x56017c||stringOptions[_0x6cf8('0xa')];var _0x12c046=_0x3e7bca||stringOptions[_0x6cf8('0x1c')];var _0x38cc1c=crypto['createDecipher'](_0x31b3bf,_0x12c046);var _0x16e702=_0x38cc1c[_0x6cf8('0x13')](_0x15f51d,_0x6cf8('0x1f'),_0x6cf8('0x1e'));_0x16e702+=_0x38cc1c[_0x6cf8('0x16')](_0x6cf8('0x1e'));return _0x16e702;}; \ No newline at end of file +var _0xfabf=['getCiphers','filter','indexOf','hasOwnProperty','encryptFile','data','update','binary','end','final','close','unlink','createReadStream','createWriteStream','createDecipher','write','encryptString','secret','createCipher','base64','decryptString','utf8','crypto','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','error','test'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xfabf,0x1f2));var _0xffab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfabf[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0xffab('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xffab('0x1'));var config=require(_0xffab('0x2'));var logger=require(_0xffab('0x3'))(_0xffab('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0xffab('0x5')};const fileOptions={'algorithm':_0xffab('0x6')};if(config[_0xffab('0x7')]&&config['encrypt'][_0xffab('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xffab('0x8')]);if(isSupported){fileOptions[_0xffab('0x8')]=config[_0xffab('0x7')][_0xffab('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xffab('0x9')](',\x20');logger[_0xffab('0xa')](config[_0xffab('0x7')][_0xffab('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x49e4a7){return AES_SUPPORTED_RX[_0xffab('0xb')](_0x49e4a7);}function getSupportedCiphers(){return crypto[_0xffab('0xc')]()[_0xffab('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x19a1fb){return getSupportedCiphers()[_0xffab('0xe')](_0x19a1fb)>-0x1;}function combineOptions(_0x3f81b8){var _0x4e2241={};for(var _0x173850 in fileOptions){if(fileOptions[_0xffab('0xf')](_0x173850)){_0x4e2241[_0x173850]=fileOptions[_0x173850];}}if(_0x3f81b8){for(var _0x36f47d in _0x3f81b8){if(_0x3f81b8[_0xffab('0xf')](_0x36f47d)){_0x4e2241[_0x36f47d]=_0x3f81b8[_0x36f47d];}}}return _0x4e2241;}exports[_0xffab('0x10')]=function(_0x2dd5d3,_0x4acb45,_0x4bf00e,_0x2a298c){return new BPromise(function(_0x488e86,_0x34e7c5){_0x2a298c=combineOptions(_0x2a298c);var _0x2e7201=new Buffer(_0x4bf00e);var _0x36d7a2=fs['createReadStream'](_0x2dd5d3);var _0x4a2d9f=fs['createWriteStream'](_0x4acb45);var _0x5ef676=crypto['createCipher'](_0x2a298c[_0xffab('0x8')],_0x2e7201);_0x36d7a2['on'](_0xffab('0x11'),function(_0x347650){var _0x48a9ea=new Buffer(_0x5ef676[_0xffab('0x12')](_0x347650),_0xffab('0x13'));_0x4a2d9f['write'](_0x48a9ea);});_0x36d7a2['on'](_0xffab('0x14'),function(){try{var _0x4b393c=new Buffer(_0x5ef676[_0xffab('0x15')]('binary'),_0xffab('0x13'));_0x4a2d9f['write'](_0x4b393c);_0x4a2d9f[_0xffab('0x14')]();_0x4a2d9f['on'](_0xffab('0x16'),function(){return _0x488e86(_0x4acb45);});}catch(_0x1e0c41){fs[_0xffab('0x17')](_0x4acb45);return _0x34e7c5(_0x1e0c41);}});});};exports['decryptFile']=function(_0x18f5e9,_0x1a9523,_0x4d5701,_0x167684){return new BPromise(function(_0x1f76b9,_0x4fc643){_0x167684=combineOptions(_0x167684);var _0x58609d=new Buffer(_0x4d5701);var _0x194471=fs[_0xffab('0x18')](_0x18f5e9);var _0x565950=fs[_0xffab('0x19')](_0x1a9523);var _0x1e90a7=crypto[_0xffab('0x1a')](_0x167684[_0xffab('0x8')],_0x58609d);_0x194471['on'](_0xffab('0x11'),function(_0x4b5bad){var _0x4c6053=new Buffer(_0x1e90a7['update'](_0x4b5bad),_0xffab('0x13'));_0x565950[_0xffab('0x1b')](_0x4c6053);});_0x194471['on'](_0xffab('0x14'),function(){try{var _0x1c36a4=new Buffer(_0x1e90a7[_0xffab('0x15')]('binary'),_0xffab('0x13'));_0x565950[_0xffab('0x1b')](_0x1c36a4);_0x565950['end']();_0x565950['on'](_0xffab('0x16'),function(){return _0x1f76b9(_0x1a9523);});}catch(_0x399085){fs[_0xffab('0x17')](_0x1a9523);return _0x4fc643(_0x399085);}});});};exports[_0xffab('0x1c')]=function(_0x44ff78,_0x17b51a,_0x480996){var _0x182513=_0x480996||stringOptions[_0xffab('0x8')];var _0x2d14eb=_0x17b51a||stringOptions[_0xffab('0x1d')];var _0x47d7c3=crypto[_0xffab('0x1e')](_0x182513,_0x2d14eb);var _0xfa7278=_0x47d7c3[_0xffab('0x12')](_0x44ff78,'utf8',_0xffab('0x1f'));_0xfa7278+=_0x47d7c3[_0xffab('0x15')](_0xffab('0x1f'));return _0xfa7278;};exports[_0xffab('0x20')]=function(_0xa572c0,_0x536e7d,_0x140a16){var _0x13dda9=_0x140a16||stringOptions[_0xffab('0x8')];var _0x42e87d=_0x536e7d||stringOptions[_0xffab('0x1d')];var _0x38596d=crypto[_0xffab('0x1a')](_0x13dda9,_0x42e87d);var _0x7f0a53=_0x38596d[_0xffab('0x12')](_0xa572c0,_0xffab('0x1f'),_0xffab('0x21'));_0x7f0a53+=_0x38596d[_0xffab('0x15')]('utf8');return _0x7f0a53;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 02ce83c..3b4ea69 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 _0xa1a5=['catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','forEach','push','dirname','basename','.csv','mkdirSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Completed','zip'];(function(_0x136bb6,_0x188af9){var _0x3a91eb=function(_0x2c0d40){while(--_0x2c0d40){_0x136bb6['push'](_0x136bb6['shift']());}};_0x3a91eb(++_0x188af9);}(_0xa1a5,0x155));var _0x5a1a=function(_0xea715b,_0x27b171){_0xea715b=_0xea715b-0x0;var _0x3fa9d8=_0xa1a5[_0xea715b];return _0x3fa9d8;};'use strict';var util=require('util');var path=require(_0x5a1a('0x0'));var _=require(_0x5a1a('0x1'));var csv=require(_0x5a1a('0x2'));var fs=require('fs');var BPromise=require(_0x5a1a('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x5a1a('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5a1a('0x5'))[_0x5a1a('0x6')];var logger=require(_0x5a1a('0x7'))(_0x5a1a('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x5a1a('0x9')][0x2]);var QUERY=process[_0x5a1a('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ac3cd,_0x1974f6){var _0x2d56e6={'status':_0x2ac3cd};var _0x302b5c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1974f6){_0x2d56e6['savename']=_0x1974f6;}return db[_0x5a1a('0xa')][_0x5a1a('0xb')](_0x2d56e6,_0x302b5c);}function main(){var _0x32c6dc=0x1388;var _0x5bb97f;logger[_0x5a1a('0xc')](util[_0x5a1a('0xd')](_0x5a1a('0xe'),EXTRACTED_REPORT_ID,_0x5a1a('0xf')));return db[_0x5a1a('0x10')][_0x5a1a('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5a1a('0x12'),_0x5a1a('0x13')]})['then'](function(_0x16cd40){if(_0x16cd40){_0x5bb97f=_0x16cd40;_0x32c6dc=_0x5bb97f['splitSizeCsv']||0x1388;}})[_0x5a1a('0x14')](function(){return dbH['sequelize'][_0x5a1a('0x15')](util[_0x5a1a('0xd')](_0x5a1a('0x16'),QUERY),{'type':dbH[_0x5a1a('0x17')][_0x5a1a('0x18')][_0x5a1a('0x19')]});})[_0x5a1a('0x14')](function(_0x10e7df){if(!_0x10e7df[0x0][_0x5a1a('0x1a')]){return analyticExtractedReport(_0x5a1a('0x1b'));}var _0x5232c8=[];var _0x132e1f=0x0;if(_0x5bb97f[_0x5a1a('0x12')]){if(_0x10e7df&&_0x10e7df[_0x5a1a('0x1c')]){var _0x37539a=_['range'](_0x10e7df[0x0][_0x5a1a('0x1a')]/_0x32c6dc);var _0x1858c3=Number['isInteger'](_0x10e7df[0x0][_0x5a1a('0x1a')]/_0x32c6dc)?_0x10e7df[0x0][_0x5a1a('0x1a')]%_0x32c6dc:0x0;_0x37539a[_0x5a1a('0x1d')](function(_0x20c257){if(_0x20c257>0x0){_0x132e1f+=_0x32c6dc;}_0x5232c8[_0x5a1a('0x1e')](dbH[_0x5a1a('0x17')][_0x5a1a('0x15')](util[_0x5a1a('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x32c6dc,_0x132e1f),{'type':dbH[_0x5a1a('0x17')][_0x5a1a('0x18')]['SELECT']}));});if(_0x1858c3>0x0){_0x132e1f+=_0x32c6dc;_0x5232c8['push'](dbH[_0x5a1a('0x17')][_0x5a1a('0x15')](util[_0x5a1a('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1858c3,_0x132e1f),{'type':dbH[_0x5a1a('0x17')][_0x5a1a('0x18')][_0x5a1a('0x19')]}));}}}else{_0x5232c8['push'](dbH[_0x5a1a('0x17')][_0x5a1a('0x15')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x5a1a('0x19')]}));}var _0x43b7f1=path[_0x5a1a('0x1f')](PATH);var _0x2d3364=path[_0x5a1a('0x20')](PATH,_0x5a1a('0x21'));var _0x20b2c6=_0x5bb97f[_0x5a1a('0x12')]&&_0x5232c8[_0x5a1a('0x1c')]>0x1;var _0x300538=[];if(!fs['existsSync'](path['join'](_0x43b7f1,_0x2d3364))&&_0x20b2c6){fs[_0x5a1a('0x22')](path[_0x5a1a('0x23')](_0x43b7f1,_0x2d3364));}return BPromise['each'](_0x5232c8,function(_0x20f847){_0x300538[_0x5a1a('0x1e')](_0x20f847);})['then'](function(){for(var _0x560a74=0x0;_0x560a74<_0x300538['length'];_0x560a74+=0x1){var _0x2ee507;var _0x332494=_0x300538[_0x560a74];if(_0x20b2c6){_0x2ee507=path[_0x5a1a('0x23')](_0x43b7f1,_0x2d3364,util[_0x5a1a('0xd')](_0x5a1a('0x24'),_0x2d3364,_0x560a74,_0x5a1a('0x25')));}else{_0x2ee507=path[_0x5a1a('0x23')](_0x43b7f1,util['format'](_0x5a1a('0x26'),_0x2d3364,'csv'));}fs[_0x5a1a('0x27')](_0x2ee507,csv(_0x332494));}})[_0x5a1a('0x14')](function(){if(_0x20b2c6){return new Promise(function(_0x254b68){zipdir(path[_0x5a1a('0x23')](_0x43b7f1,_0x2d3364),{'saveTo':path[_0x5a1a('0x23')](_0x43b7f1,util['format'](_0x5a1a('0x26'),_0x2d3364,'zip'))},function(_0x5169ea,_0x2d4df5){rimraf(path[_0x5a1a('0x23')](_0x43b7f1,_0x2d3364),function(){});_0x254b68(_0x5a1a('0x28'));});});}})[_0x5a1a('0x14')](function(){logger[_0x5a1a('0xc')](util[_0x5a1a('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5a1a('0xf')));return analyticExtractedReport(_0x5a1a('0x29'),_0x20b2c6?util[_0x5a1a('0xd')](_0x5a1a('0x26'),_0x2d3364,_0x20b2c6?_0x5a1a('0x2a'):_0x5a1a('0x25')):null);});})[_0x5a1a('0x2b')](function(_0x11cfcf){logger['info'](util[_0x5a1a('0xd')](_0x5a1a('0x2c'),EXTRACTED_REPORT_ID,_0x5a1a('0xf')),util[_0x5a1a('0x2d')](_0x11cfcf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5a1a('0x2e'));})['finally'](function(){process[_0x5a1a('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5ea0=['length','range','isInteger','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','path','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','sequelize','format','QueryTypes','SELECT','then'];(function(_0x23a69c,_0x253bd0){var _0x39ad60=function(_0x16a942){while(--_0x16a942){_0x23a69c['push'](_0x23a69c['shift']());}};_0x39ad60(++_0x253bd0);}(_0x5ea0,0xdb));var _0x05ea=function(_0x5e7f60,_0x44c606){_0x5e7f60=_0x5e7f60-0x0;var _0x5f1e84=_0x5ea0[_0x5e7f60];return _0x5f1e84;};'use strict';var util=require('util');var path=require(_0x05ea('0x0'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x05ea('0x1'));var rimraf=require(_0x05ea('0x2'));var db=require(_0x05ea('0x3'))['db'];var dbH=require(_0x05ea('0x3'))[_0x05ea('0x4')];var logger=require('../../config/logger')(_0x05ea('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x05ea('0x6')][0x2]);var QUERY=process[_0x05ea('0x6')][0x3];var PATH=process[_0x05ea('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4704b6,_0x40da8c){var _0x58a830={'status':_0x4704b6};var _0x1ba784={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x40da8c){_0x58a830[_0x05ea('0x7')]=_0x40da8c;}return db[_0x05ea('0x8')]['update'](_0x58a830,_0x1ba784);}function main(){var _0x1cb656=0x1388;var _0x2d903e;logger[_0x05ea('0x9')](util['format'](_0x05ea('0xa'),EXTRACTED_REPORT_ID,_0x05ea('0xb')));return db[_0x05ea('0xc')][_0x05ea('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x05ea('0xe'),_0x05ea('0xf')]})['then'](function(_0x3e4484){if(_0x3e4484){_0x2d903e=_0x3e4484;_0x1cb656=_0x2d903e[_0x05ea('0xf')]||0x1388;}})['then'](function(){return dbH[_0x05ea('0x10')]['query'](util[_0x05ea('0x11')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x05ea('0x12')][_0x05ea('0x13')]});})[_0x05ea('0x14')](function(_0x13caf0){if(!_0x13caf0[0x0]['num']){return analyticExtractedReport('Empty');}var _0x3d3003=[];var _0x44c19d=0x0;if(_0x2d903e['split']){if(_0x13caf0&&_0x13caf0[_0x05ea('0x15')]){var _0x2d2f3f=_[_0x05ea('0x16')](_0x13caf0[0x0]['num']/_0x1cb656);var _0x5ecf03=Number[_0x05ea('0x17')](_0x13caf0[0x0][_0x05ea('0x18')]/_0x1cb656)?_0x13caf0[0x0]['num']%_0x1cb656:0x0;_0x2d2f3f[_0x05ea('0x19')](function(_0x58a89a){if(_0x58a89a>0x0){_0x44c19d+=_0x1cb656;}_0x3d3003[_0x05ea('0x1a')](dbH['sequelize']['query'](util[_0x05ea('0x11')](_0x05ea('0x1b'),QUERY,_0x1cb656,_0x44c19d),{'type':dbH[_0x05ea('0x10')][_0x05ea('0x12')][_0x05ea('0x13')]}));});if(_0x5ecf03>0x0){_0x44c19d+=_0x1cb656;_0x3d3003[_0x05ea('0x1a')](dbH['sequelize'][_0x05ea('0x1c')](util[_0x05ea('0x11')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5ecf03,_0x44c19d),{'type':dbH[_0x05ea('0x10')]['QueryTypes']['SELECT']}));}}}else{_0x3d3003['push'](dbH[_0x05ea('0x10')][_0x05ea('0x1c')](QUERY,{'type':dbH['sequelize'][_0x05ea('0x12')][_0x05ea('0x13')]}));}var _0x2080b6=path['dirname'](PATH);var _0x1151b0=path[_0x05ea('0x1d')](PATH,_0x05ea('0x1e'));var _0x2e81f4=_0x2d903e[_0x05ea('0xe')]&&_0x3d3003[_0x05ea('0x15')]>0x1;var _0xff21d2=[];if(!fs[_0x05ea('0x1f')](path['join'](_0x2080b6,_0x1151b0))&&_0x2e81f4){fs[_0x05ea('0x20')](path[_0x05ea('0x21')](_0x2080b6,_0x1151b0));}return BPromise[_0x05ea('0x22')](_0x3d3003,function(_0x5ee5f0){_0xff21d2[_0x05ea('0x1a')](_0x5ee5f0);})[_0x05ea('0x14')](function(){for(var _0x429c4f=0x0;_0x429c4f<_0xff21d2[_0x05ea('0x15')];_0x429c4f+=0x1){var _0x5a08df;var _0x3135a8=_0xff21d2[_0x429c4f];if(_0x2e81f4){_0x5a08df=path[_0x05ea('0x21')](_0x2080b6,_0x1151b0,util['format'](_0x05ea('0x23'),_0x1151b0,_0x429c4f,_0x05ea('0x24')));}else{_0x5a08df=path[_0x05ea('0x21')](_0x2080b6,util[_0x05ea('0x11')](_0x05ea('0x25'),_0x1151b0,_0x05ea('0x24')));}fs[_0x05ea('0x26')](_0x5a08df,csv(_0x3135a8));}})[_0x05ea('0x14')](function(){if(_0x2e81f4){return new Promise(function(_0x47e876){zipdir(path['join'](_0x2080b6,_0x1151b0),{'saveTo':path[_0x05ea('0x21')](_0x2080b6,util['format'](_0x05ea('0x25'),_0x1151b0,_0x05ea('0x27')))},function(_0x52c95c,_0x24dc31){rimraf(path['join'](_0x2080b6,_0x1151b0),function(){});_0x47e876(_0x05ea('0x28'));});});}})[_0x05ea('0x14')](function(){logger[_0x05ea('0x9')](util[_0x05ea('0x11')](_0x05ea('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x05ea('0x2a'),_0x2e81f4?util[_0x05ea('0x11')](_0x05ea('0x25'),_0x1151b0,_0x2e81f4?_0x05ea('0x27'):_0x05ea('0x24')):null);});})[_0x05ea('0x2b')](function(_0x530ae8){logger[_0x05ea('0x9')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x05ea('0xb')),util[_0x05ea('0x2c')](_0x530ae8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x05ea('0x2d'));})[_0x05ea('0x2e')](function(){process[_0x05ea('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 9a1145b..fbb610d 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 _0xcfbf=['%s\x20#%d','channel','interactionId','Arial','center','Interaction\x20Transcript','pipe','finish','error','createPdfFromHTML','lodash','path','moment','rimraf','jsdom','JSDOM','window','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','map','toString','fill','length','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','footer','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','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','info','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf'];(function(_0x3c19e2,_0x40768d){var _0x110d6e=function(_0x42d50e){while(--_0x42d50e){_0x3c19e2['push'](_0x3c19e2['shift']());}};_0x110d6e(++_0x40768d);}(_0xcfbf,0x1ae));var _0xfcfb=function(_0x13c98d,_0x536ae4){_0x13c98d=_0x13c98d-0x0;var _0x4b7cfe=_0xcfbf[_0x13c98d];return _0x4b7cfe;};'use strict';var _=require(_0xfcfb('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xfcfb('0x1'));var moment=require(_0xfcfb('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xfcfb('0x3'));var JSDOM=require(_0xfcfb('0x4'))[_0xfcfb('0x5')];var window=new JSDOM('')[_0xfcfb('0x6')];var BPromise=require('bluebird');var db=require(_0xfcfb('0x7'))['db'];var dbH=require(_0xfcfb('0x7'))['dbH'];var logger=require(_0xfcfb('0x8'))(_0xfcfb('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xfcfb('0xa')][0x2]);var QUERY=process[_0xfcfb('0xa')][0x3];var PATH=process[_0xfcfb('0xa')][0x4];var NAME=process[_0xfcfb('0xa')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x42c686,_0x5867d4){var _0x4047b3={'status':_0x42c686};var _0x1ce488={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5867d4){_0x4047b3[_0xfcfb('0xb')]=_0x5867d4;}return db[_0xfcfb('0xc')]['update'](_0x4047b3,_0x1ce488);}function getHeaders(_0x5d7b1b){return _['map'](_0x5d7b1b,function(_0x5ca9ad){return{'text':_0x5ca9ad,'style':'tableHeader'};});}function getRows(_0x5369ba,_0x39cdf5){return _[_0xfcfb('0xd')](_0x39cdf5,function(_0x153856){return _(_0x153856)['pick'](_0x5369ba)['map'](function(_0x83aca8){return _0x83aca8?_[_0xfcfb('0xe')](_0x83aca8):'';})['value']();});}function createTable(_0x5930ce,_0x26d4c4){var _0x488bc1={'widths':_[_0xfcfb('0xf')](Array(_0x5930ce[_0xfcfb('0x10')]),0x91),'heights':function(_0xf1285){return _0xf1285===0x0?_0xfcfb('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x528a4d=getHeaders(_0x5930ce);_0x488bc1[_0xfcfb('0x12')][_0xfcfb('0x13')](_0x528a4d);var _0x280faf=getRows(_0x5930ce,_0x26d4c4);_0x488bc1['body']=_0x488bc1[_0xfcfb('0x12')][_0xfcfb('0x14')](_0x280faf);return _0x488bc1;}function createTables(_0x52fc06){var _0x273339=[];var _0x246070=_[_0xfcfb('0x15')](Object[_0xfcfb('0x16')](_0x52fc06[0x0]),0x5);_0x246070['forEach'](function(_0x5b64af){_0x273339[_0xfcfb('0x13')](createTable(_0x5b64af,_0x52fc06));});return _0x273339;}function getPDFDocDefinition(_0x8d2884){var _0xbca248=util[_0xfcfb('0x17')](_0xfcfb('0x18'),NAME,EXTRACTED_REPORT[_0xfcfb('0x19')],moment(EXTRACTED_REPORT[_0xfcfb('0x1a')])[_0xfcfb('0x17')](FORMAT),moment(EXTRACTED_REPORT[_0xfcfb('0x1b')])[_0xfcfb('0x17')](FORMAT));var _0x289e7d=[];for(var _0x210d2a=0x0;_0x210d2a<_0x8d2884[_0xfcfb('0x10')];_0x210d2a++){var _0x3147b9=[];if(_0x210d2a===0x0){_0x3147b9[_0xfcfb('0x13')]({'text':_0xbca248,'style':_0xfcfb('0x1c')});}var _0x4d56ec={'table':_0x8d2884[_0x210d2a]};if(_0x210d2a>0x0){_0x4d56ec['pageBreak']=_0xfcfb('0x1d');_0x4d56ec[_0xfcfb('0x1e')]=[0x0,0x46,0x0,0x0];}_0x3147b9[_0xfcfb('0x13')](_0x4d56ec);_0x289e7d[_0xfcfb('0x13')](_0x3147b9);}return{'pageSize':'A4','pageOrientation':_0xfcfb('0x1f'),'content':_0x289e7d,'footer':function(_0x505702,_0x3d1016){return{'text':_0x505702[_0xfcfb('0xe')]()+'\x20/\x20'+_0x3d1016,'style':_0xfcfb('0x20')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xfcfb('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1a4be7){var _0x4c8843=0x1388;var _0xb4d31d;if(!_0x1a4be7[0x0][_0xfcfb('0x22')]){return analyticExtractedReport(_0xfcfb('0x23'));}return db[_0xfcfb('0x24')][_0xfcfb('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xfcfb('0x26')]})['then'](function(_0x4f89cc){if(_0x4f89cc){_0xb4d31d=_0x4f89cc;_0x4c8843=_0xb4d31d[_0xfcfb('0x26')]||0x3e8;}})[_0xfcfb('0x27')](function(){var _0x371bee=[];var _0x12e0d8=0x0;if(_0xb4d31d[_0xfcfb('0x28')]){if(_0x1a4be7&&_0x1a4be7[_0xfcfb('0x10')]){var _0x298d7b=_[_0xfcfb('0x29')](_0x1a4be7[0x0][_0xfcfb('0x22')]/_0x4c8843);var _0x41afbf=Number[_0xfcfb('0x2a')](_0x1a4be7[0x0][_0xfcfb('0x22')]/_0x4c8843)?_0x1a4be7[0x0][_0xfcfb('0x22')]%_0x4c8843:0x0;_0x298d7b[_0xfcfb('0x2b')](function(_0x4881d9){if(_0x4881d9>0x0){_0x12e0d8+=_0x4c8843;}_0x371bee['push'](dbH[_0xfcfb('0x2c')][_0xfcfb('0x2d')](util[_0xfcfb('0x17')](_0xfcfb('0x2e'),QUERY,_0x4c8843,_0x12e0d8),{'type':dbH[_0xfcfb('0x2c')][_0xfcfb('0x2f')]['SELECT']}));});if(_0x41afbf>0x0){_0x12e0d8+=_0x4c8843;_0x371bee[_0xfcfb('0x13')](dbH[_0xfcfb('0x2c')][_0xfcfb('0x2d')](util['format'](_0xfcfb('0x2e'),QUERY,_0x41afbf,_0x12e0d8),{'type':dbH[_0xfcfb('0x2c')][_0xfcfb('0x2f')][_0xfcfb('0x30')]}));}}}else{_0x371bee[_0xfcfb('0x13')](dbH[_0xfcfb('0x2c')]['query'](QUERY,{'type':dbH[_0xfcfb('0x2c')][_0xfcfb('0x2f')][_0xfcfb('0x30')]}));}var _0x442ac6=path[_0xfcfb('0x31')](PATH);var _0x3b8840=path[_0xfcfb('0x32')](PATH,_0xfcfb('0x33'));var _0x52b53e=_0xb4d31d[_0xfcfb('0x28')]&&_0x371bee[_0xfcfb('0x10')]>0x1;var _0x66d69e=[];if(!fs[_0xfcfb('0x34')](path[_0xfcfb('0x35')](_0x442ac6,_0x3b8840))&&_0x52b53e){fs[_0xfcfb('0x36')](path[_0xfcfb('0x35')](_0x442ac6,_0x3b8840));}return BPromise[_0xfcfb('0x37')](_0x371bee,function(_0x4e7c75){_0x66d69e[_0xfcfb('0x13')](_0x4e7c75);})[_0xfcfb('0x27')](function(){var _0x539239=[];for(var _0x493935=0x0;_0x493935<_0x66d69e['length'];_0x493935+=0x1){var _0x249333=_0x66d69e[_0x493935];var _0x25f8b9=createTables(_[_0xfcfb('0x38')](_0x249333));var _0x27f35d;var _0xadd395=getPDFDocDefinition(_0x25f8b9);var _0x1c6a02=getPDFPrinter();var _0x3c2173=_0x1c6a02[_0xfcfb('0x39')](_0xadd395);if(_0x52b53e){_0x27f35d=path[_0xfcfb('0x35')](_0x442ac6,_0x3b8840,util[_0xfcfb('0x17')](_0xfcfb('0x3a'),_0x3b8840,_0x493935,_0xfcfb('0x3b')));}else{_0x27f35d=path[_0xfcfb('0x35')](_0x442ac6,util[_0xfcfb('0x17')](_0xfcfb('0x3c'),_0x3b8840,_0xfcfb('0x3b')));}_0x539239[_0xfcfb('0x13')](writePDFDocument(_0x3c2173,_0x27f35d));}return Promise[_0xfcfb('0x3d')](_0x539239);})['then'](function(){if(_0x52b53e){return new Promise(function(_0x147027){zipdir(path['join'](_0x442ac6,_0x3b8840),{'saveTo':path[_0xfcfb('0x35')](_0x442ac6,util[_0xfcfb('0x17')](_0xfcfb('0x3c'),_0x3b8840,_0xfcfb('0x3e')))},function(){rimraf(path[_0xfcfb('0x35')](_0x442ac6,_0x3b8840),function(){});_0x147027(_0xfcfb('0x3f'));});});}})[_0xfcfb('0x27')](function(){if(!_0x52b53e)return;rimraf(path[_0xfcfb('0x35')](_0x442ac6,_0x3b8840),function(){});})[_0xfcfb('0x27')](function(){logger['info'](util[_0xfcfb('0x17')](_0xfcfb('0x40'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x52b53e?util[_0xfcfb('0x17')](_0xfcfb('0x3c'),_0x3b8840,_0x52b53e?_0xfcfb('0x3e'):_0xfcfb('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xfcfb('0x41')](util[_0xfcfb('0x17')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xfcfb('0x42')));return db['AnalyticExtractedReport'][_0xfcfb('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xfcfb('0x27')](function(_0x26c05a){EXTRACTED_REPORT=_0x26c05a;return dbH['sequelize']['query'](util[_0xfcfb('0x17')](_0xfcfb('0x44'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})['then'](extractReport)['catch'](function(_0x29a821){logger[_0xfcfb('0x41')](util['format'](_0xfcfb('0x45'),EXTRACTED_REPORT_ID,_0xfcfb('0x42')),util['inspect'](_0x29a821,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfcfb('0x46'));})[_0xfcfb('0x47')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2e9037=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xfcfb('0x48'),'bolditalics':__dirname+_0xfcfb('0x49')}});return _0x2e9037;}function getPDFDocDefinitionFromHTML(_0x56aac7,_0xd0211a){var _0x16a64f=util[_0xfcfb('0x17')](_0xfcfb('0x4a'),_0xd0211a[_0xfcfb('0x4b')],_0xd0211a[_0xfcfb('0x4c')]);var _0x134f1b=moment()[_0xfcfb('0x17')]('YYYY-MM-DD')['toString']();var _0x4f6687=htmlToPdfmake(_0x56aac7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4f6687],'defaultStyle':{'font':_0xfcfb('0x4d')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xfcfb('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xfcfb('0x4e')}},'header':function(){return[{'text':_0xfcfb('0x4f'),'style':'header'}];},'footer':function(_0x490507,_0x228645){return[{'text':util[_0xfcfb('0x17')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x16a64f,_0x490507,_0x228645,_0x134f1b),'style':_0xfcfb('0x20')}];}};}function writePDFDocument(_0x265e5a,_0x298eac){return new Promise(function(_0x598ed3,_0x324d04){var _0x333ca8=_0x265e5a[_0xfcfb('0x50')](fs['createWriteStream'](_0x298eac));_0x333ca8['on']('finish',function(){_0x598ed3(_0xfcfb('0x51'));});_0x333ca8['on'](_0xfcfb('0x52'),function(_0x18e3f7){_0x324d04(_0x18e3f7);});_0x265e5a['end']();});}exports[_0xfcfb('0x53')]=function(_0x2546f9,_0x5d59b2){var _0x4e244f=getPDFPrinter();var _0x1c9c59=getPDFDocDefinitionFromHTML(_0x2546f9,_0x5d59b2);var _0x5d3697=_0x4e244f[_0xfcfb('0x39')](_0x1c9c59);return writePDFDocument(_0x5d3697,_0x5d59b2[_0xfcfb('0x1')])['catch'](function(_0x17fa79){throw _0x17fa79;});}; \ No newline at end of file +var _0x1885=['basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','body','push','chunk','keys','format','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split','splitSizePdf','then','range','num','isInteger','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','SELECT','dirname'];(function(_0x5a7cbc,_0x573d85){var _0x44d2cc=function(_0x154862){while(--_0x154862){_0x5a7cbc['push'](_0x5a7cbc['shift']());}};_0x44d2cc(++_0x573d85);}(_0x1885,0x84));var _0x5188=function(_0x14a5e6,_0x453b16){_0x14a5e6=_0x14a5e6-0x0;var _0x12350d=_0x1885[_0x14a5e6];return _0x12350d;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x5188('0x0'));var path=require(_0x5188('0x1'));var moment=require(_0x5188('0x2'));var htmlToPdfmake=require(_0x5188('0x3'));var PdfPrinter=require(_0x5188('0x4'));var zipdir=require(_0x5188('0x5'));var rimraf=require(_0x5188('0x6'));var JSDOM=require(_0x5188('0x7'))[_0x5188('0x8')];var window=new JSDOM('')[_0x5188('0x9')];var BPromise=require(_0x5188('0xa'));var db=require(_0x5188('0xb'))['db'];var dbH=require(_0x5188('0xb'))[_0x5188('0xc')];var logger=require('../../config/logger')(_0x5188('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x5188('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x5188('0xe')][0x5];var FORMAT=_0x5188('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x580ee0,_0x101768){var _0x29f13e={'status':_0x580ee0};var _0x256303={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x101768){_0x29f13e[_0x5188('0x10')]=_0x101768;}return db[_0x5188('0x11')][_0x5188('0x12')](_0x29f13e,_0x256303);}function getHeaders(_0x4332ef){return _['map'](_0x4332ef,function(_0x464c8f){return{'text':_0x464c8f,'style':'tableHeader'};});}function getRows(_0x3b7bfb,_0x4d8959){return _[_0x5188('0x13')](_0x4d8959,function(_0x223208){return _(_0x223208)[_0x5188('0x14')](_0x3b7bfb)[_0x5188('0x13')](function(_0x1c86b1){return _0x1c86b1?_[_0x5188('0x15')](_0x1c86b1):'';})[_0x5188('0x16')]();});}function createTable(_0x13301f,_0x23eae5){var _0x5f485a={'widths':_[_0x5188('0x17')](Array(_0x13301f[_0x5188('0x18')]),0x91),'heights':function(_0x16b92d){return _0x16b92d===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x41b95b=getHeaders(_0x13301f);_0x5f485a[_0x5188('0x19')][_0x5188('0x1a')](_0x41b95b);var _0x1889ac=getRows(_0x13301f,_0x23eae5);_0x5f485a['body']=_0x5f485a[_0x5188('0x19')]['concat'](_0x1889ac);return _0x5f485a;}function createTables(_0x54ef80){var _0x563b78=[];var _0x181615=_[_0x5188('0x1b')](Object[_0x5188('0x1c')](_0x54ef80[0x0]),0x5);_0x181615['forEach'](function(_0x5a7d6e){_0x563b78[_0x5188('0x1a')](createTable(_0x5a7d6e,_0x54ef80));});return _0x563b78;}function getPDFDocDefinition(_0x928d35){var _0x241e83=util[_0x5188('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x5188('0x1e')])[_0x5188('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x5188('0x1f')])[_0x5188('0x1d')](FORMAT));var _0x26134f=[];for(var _0x2a081f=0x0;_0x2a081f<_0x928d35[_0x5188('0x18')];_0x2a081f++){var _0x498171=[];if(_0x2a081f===0x0){_0x498171[_0x5188('0x1a')]({'text':_0x241e83,'style':_0x5188('0x20')});}var _0x48d357={'table':_0x928d35[_0x2a081f]};if(_0x2a081f>0x0){_0x48d357[_0x5188('0x21')]=_0x5188('0x22');_0x48d357[_0x5188('0x23')]=[0x0,0x46,0x0,0x0];}_0x498171[_0x5188('0x1a')](_0x48d357);_0x26134f[_0x5188('0x1a')](_0x498171);}return{'pageSize':'A4','pageOrientation':_0x5188('0x24'),'content':_0x26134f,'footer':function(_0x4e1f6f,_0x3d4e4f){return{'text':_0x4e1f6f[_0x5188('0x15')]()+_0x5188('0x25')+_0x3d4e4f,'style':_0x5188('0x26')};},'defaultStyle':{'font':_0x5188('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x5188('0x28')},'footer':{'alignment':_0x5188('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2f0e97){var _0x17a0cf=0x1388;var _0x1056df;if(!_0x2f0e97[0x0]['num']){return analyticExtractedReport(_0x5188('0x2a'));}return db[_0x5188('0x2b')][_0x5188('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5188('0x2d'),_0x5188('0x2e')]})[_0x5188('0x2f')](function(_0x4034b5){if(_0x4034b5){_0x1056df=_0x4034b5;_0x17a0cf=_0x1056df[_0x5188('0x2e')]||0x3e8;}})[_0x5188('0x2f')](function(){var _0x4ec6d8=[];var _0x3766ca=0x0;if(_0x1056df[_0x5188('0x2d')]){if(_0x2f0e97&&_0x2f0e97['length']){var _0x38d19d=_[_0x5188('0x30')](_0x2f0e97[0x0][_0x5188('0x31')]/_0x17a0cf);var _0x5ea93f=Number[_0x5188('0x32')](_0x2f0e97[0x0][_0x5188('0x31')]/_0x17a0cf)?_0x2f0e97[0x0][_0x5188('0x31')]%_0x17a0cf:0x0;_0x38d19d[_0x5188('0x33')](function(_0xb55939){if(_0xb55939>0x0){_0x3766ca+=_0x17a0cf;}_0x4ec6d8[_0x5188('0x1a')](dbH[_0x5188('0x34')]['query'](util[_0x5188('0x1d')](_0x5188('0x35'),QUERY,_0x17a0cf,_0x3766ca),{'type':dbH['sequelize'][_0x5188('0x36')]['SELECT']}));});if(_0x5ea93f>0x0){_0x3766ca+=_0x17a0cf;_0x4ec6d8[_0x5188('0x1a')](dbH[_0x5188('0x34')][_0x5188('0x37')](util[_0x5188('0x1d')](_0x5188('0x35'),QUERY,_0x5ea93f,_0x3766ca),{'type':dbH[_0x5188('0x34')]['QueryTypes'][_0x5188('0x38')]}));}}}else{_0x4ec6d8['push'](dbH[_0x5188('0x34')][_0x5188('0x37')](QUERY,{'type':dbH[_0x5188('0x34')][_0x5188('0x36')][_0x5188('0x38')]}));}var _0xb89ba9=path[_0x5188('0x39')](PATH);var _0x579e36=path[_0x5188('0x3a')](PATH,_0x5188('0x3b'));var _0x55f23d=_0x1056df[_0x5188('0x2d')]&&_0x4ec6d8['length']>0x1;var _0x1c4070=[];if(!fs[_0x5188('0x3c')](path[_0x5188('0x3d')](_0xb89ba9,_0x579e36))&&_0x55f23d){fs[_0x5188('0x3e')](path[_0x5188('0x3d')](_0xb89ba9,_0x579e36));}return BPromise[_0x5188('0x3f')](_0x4ec6d8,function(_0x49cb5f){_0x1c4070[_0x5188('0x1a')](_0x49cb5f);})['then'](function(){var _0x4d23ce=[];for(var _0x895c4c=0x0;_0x895c4c<_0x1c4070[_0x5188('0x18')];_0x895c4c+=0x1){var _0x5dd91e=_0x1c4070[_0x895c4c];var _0x3364a3=createTables(_[_0x5188('0x40')](_0x5dd91e));var _0x43e680;var _0x466eca=getPDFDocDefinition(_0x3364a3);var _0x18cb35=getPDFPrinter();var _0x2f39c8=_0x18cb35[_0x5188('0x41')](_0x466eca);if(_0x55f23d){_0x43e680=path['join'](_0xb89ba9,_0x579e36,util[_0x5188('0x1d')](_0x5188('0x42'),_0x579e36,_0x895c4c,_0x5188('0x43')));}else{_0x43e680=path[_0x5188('0x3d')](_0xb89ba9,util[_0x5188('0x1d')](_0x5188('0x44'),_0x579e36,_0x5188('0x43')));}_0x4d23ce[_0x5188('0x1a')](writePDFDocument(_0x2f39c8,_0x43e680));}return Promise['all'](_0x4d23ce);})[_0x5188('0x2f')](function(){if(_0x55f23d){return new Promise(function(_0x4d16dd){zipdir(path[_0x5188('0x3d')](_0xb89ba9,_0x579e36),{'saveTo':path[_0x5188('0x3d')](_0xb89ba9,util[_0x5188('0x1d')](_0x5188('0x44'),_0x579e36,_0x5188('0x45')))},function(){rimraf(path['join'](_0xb89ba9,_0x579e36),function(){});_0x4d16dd('zip\x20finished');});});}})[_0x5188('0x2f')](function(){if(!_0x55f23d)return;rimraf(path['join'](_0xb89ba9,_0x579e36),function(){});})[_0x5188('0x2f')](function(){logger[_0x5188('0x46')](util[_0x5188('0x1d')](_0x5188('0x47'),EXTRACTED_REPORT_ID,_0x5188('0x48')));return analyticExtractedReport(_0x5188('0x49'),_0x55f23d?util['format'](_0x5188('0x44'),_0x579e36,_0x55f23d?_0x5188('0x45'):_0x5188('0x43')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x5188('0x46')](util[_0x5188('0x1d')](_0x5188('0x4a'),EXTRACTED_REPORT_ID,_0x5188('0x48')));return db[_0x5188('0x11')][_0x5188('0x4b')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x5188('0x2f')](function(_0xa27362){EXTRACTED_REPORT=_0xa27362;return dbH[_0x5188('0x34')][_0x5188('0x37')](util['format'](_0x5188('0x4c'),QUERY),{'type':dbH[_0x5188('0x34')]['QueryTypes'][_0x5188('0x38')]});})[_0x5188('0x2f')](extractReport)[_0x5188('0x4d')](function(_0x2a2eb3){logger[_0x5188('0x46')](util[_0x5188('0x1d')](_0x5188('0x4e'),EXTRACTED_REPORT_ID,_0x5188('0x48')),util[_0x5188('0x4f')](_0x2a2eb3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5188('0x50'));})[_0x5188('0x51')](function(){process[_0x5188('0x52')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x19466e=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x5188('0x53'),'italics':__dirname+_0x5188('0x54'),'bolditalics':__dirname+_0x5188('0x55')}});return _0x19466e;}function getPDFDocDefinitionFromHTML(_0xce808a,_0x27e920){var _0x40ac6c=util[_0x5188('0x1d')](_0x5188('0x56'),_0x27e920['channel'],_0x27e920[_0x5188('0x57')]);var _0x2465e3=moment()[_0x5188('0x1d')]('YYYY-MM-DD')[_0x5188('0x15')]();var _0xfc5935=htmlToPdfmake(_0xce808a,{'window':window,'tableAutoSize':!![]});return{'content':[_0xfc5935],'defaultStyle':{'font':_0x5188('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x5188('0x58'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x5188('0x58'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x5188('0x58')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x5188('0x20')}];},'footer':function(_0x1c128f,_0x1b5d13){return[{'text':util['format'](_0x5188('0x59'),_0x40ac6c,_0x1c128f,_0x1b5d13,_0x2465e3),'style':'footer'}];}};}function writePDFDocument(_0x20ec3a,_0x4bf154){return new Promise(function(_0x57d64a,_0x71d5d){var _0x19c77c=_0x20ec3a[_0x5188('0x5a')](fs[_0x5188('0x5b')](_0x4bf154));_0x19c77c['on']('finish',function(){_0x57d64a(_0x5188('0x5c'));});_0x19c77c['on'](_0x5188('0x5d'),function(_0x230524){_0x71d5d(_0x230524);});_0x20ec3a[_0x5188('0x5e')]();});}exports['createPdfFromHTML']=function(_0x4955ef,_0xe3256c){var _0xe1677e=getPDFPrinter();var _0x27eb73=getPDFDocDefinitionFromHTML(_0x4955ef,_0xe3256c);var _0x323d40=_0xe1677e[_0x5188('0x41')](_0x27eb73);return writePDFDocument(_0x323d40,_0xe3256c['path'])[_0x5188('0x4d')](function(_0x8898d3){throw _0x8898d3;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 9909c29..488e683 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 _0x6560=['QueryTypes','SELECT','num','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','join','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','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','finally','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x6560,0x7c));var _0x0656=function(_0x437ba6,_0x2f7b32){_0x437ba6=_0x437ba6-0x0;var _0xbc6dc=_0x6560[_0x437ba6];return _0xbc6dc;};'use strict';var util=require(_0x0656('0x0'));var path=require('path');var _=require(_0x0656('0x1'));var fs=require('fs');var json2xls=require(_0x0656('0x2'));var BPromise=require(_0x0656('0x3'));var zipdir=require(_0x0656('0x4'));var rimraf=require(_0x0656('0x5'));var db=require(_0x0656('0x6'))['db'];var dbH=require(_0x0656('0x6'))[_0x0656('0x7')];var logger=require(_0x0656('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0656('0x9')][0x2]);var QUERY=process[_0x0656('0x9')][0x3];var PATH=process[_0x0656('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x31b8d4,_0xf14c71){var _0x5a89ab={'status':_0x31b8d4};var _0x47c881={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf14c71){_0x5a89ab['savename']=_0xf14c71;}return db[_0x0656('0xa')][_0x0656('0xb')](_0x5a89ab,_0x47c881);}function main(){var _0x3bdc75=0x1388;var _0x5a82ad;logger[_0x0656('0xc')](util[_0x0656('0xd')](_0x0656('0xe'),EXTRACTED_REPORT_ID,_0x0656('0xf')));return db[_0x0656('0x10')][_0x0656('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0656('0x12'),_0x0656('0x13')]})[_0x0656('0x14')](function(_0x1ba7cc){if(_0x1ba7cc){_0x5a82ad=_0x1ba7cc;_0x3bdc75=_0x5a82ad[_0x0656('0x13')]||0x1388;}})[_0x0656('0x14')](function(){return dbH[_0x0656('0x15')][_0x0656('0x16')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0656('0x15')][_0x0656('0x17')][_0x0656('0x18')]});})[_0x0656('0x14')](function(_0x2e865f){if(!_0x2e865f[0x0][_0x0656('0x19')]){return analyticExtractedReport('Empty');}var _0x31f76c=[];var _0x4fefd4=0x0;if(_0x5a82ad[_0x0656('0x12')]){if(_0x2e865f&&_0x2e865f[_0x0656('0x1a')]){var _0x5a3dc2=_[_0x0656('0x1b')](_0x2e865f[0x0][_0x0656('0x19')]/_0x3bdc75);var _0x22c516=Number[_0x0656('0x1c')](_0x2e865f[0x0][_0x0656('0x19')]/_0x3bdc75)?_0x2e865f[0x0]['num']%_0x3bdc75:0x0;_0x5a3dc2[_0x0656('0x1d')](function(_0x2d44b0){if(_0x2d44b0>0x0){_0x4fefd4+=_0x3bdc75;}_0x31f76c['push'](dbH[_0x0656('0x15')][_0x0656('0x16')](util[_0x0656('0xd')](_0x0656('0x1e'),QUERY,_0x3bdc75,_0x4fefd4),{'type':dbH[_0x0656('0x15')]['QueryTypes']['SELECT']}));});if(_0x22c516>0x0){_0x4fefd4+=_0x3bdc75;_0x31f76c[_0x0656('0x1f')](dbH['sequelize']['query'](util['format'](_0x0656('0x1e'),QUERY,_0x22c516,_0x4fefd4),{'type':dbH[_0x0656('0x15')][_0x0656('0x17')][_0x0656('0x18')]}));}}}else{_0x31f76c['push'](dbH[_0x0656('0x15')][_0x0656('0x16')](QUERY,{'type':dbH['sequelize'][_0x0656('0x17')]['SELECT']}));}var _0x4f081a=path[_0x0656('0x20')](PATH);var _0x4e78ca=path[_0x0656('0x21')](PATH,'.xlsx');var _0x31f592=_0x5a82ad[_0x0656('0x12')]&&_0x31f76c[_0x0656('0x1a')]>0x1;var _0x454cbd=[];if(!fs['existsSync'](path[_0x0656('0x22')](_0x4f081a,_0x4e78ca))&&_0x31f592){fs['mkdirSync'](path[_0x0656('0x22')](_0x4f081a,_0x4e78ca));}return BPromise[_0x0656('0x23')](_0x31f76c,function(_0x3a9650){_0x454cbd[_0x0656('0x1f')](_0x3a9650);})[_0x0656('0x14')](function(){for(var _0x29d7f8=0x0;_0x29d7f8<_0x454cbd[_0x0656('0x1a')];_0x29d7f8+=0x1){var _0xaba34a;var _0xa0dfbd=_0x454cbd[_0x29d7f8];if(_0x31f592){_0xaba34a=path[_0x0656('0x22')](_0x4f081a,_0x4e78ca,util[_0x0656('0xd')](_0x0656('0x24'),_0x4e78ca,_0x29d7f8,_0x0656('0x25')));}else{_0xaba34a=path[_0x0656('0x22')](_0x4f081a,util[_0x0656('0xd')]('%s.%s',_0x4e78ca,_0x0656('0x25')));}fs[_0x0656('0x26')](_0xaba34a,json2xls(_0xa0dfbd),_0x0656('0x27'));}})['then'](function(){if(_0x31f592){return new Promise(function(_0x2f19ed){zipdir(path[_0x0656('0x22')](_0x4f081a,_0x4e78ca),{'saveTo':path[_0x0656('0x22')](_0x4f081a,util[_0x0656('0xd')](_0x0656('0x28'),_0x4e78ca,_0x0656('0x29')))},function(_0x2f1c28,_0x41a8b0){rimraf(path['join'](_0x4f081a,_0x4e78ca),function(){});_0x2f19ed(_0x0656('0x2a'));});});}})[_0x0656('0x14')](function(){logger[_0x0656('0xc')](util[_0x0656('0xd')](_0x0656('0x2b'),EXTRACTED_REPORT_ID,_0x0656('0xf')));return analyticExtractedReport(_0x0656('0x2c'),_0x31f592?util['format'](_0x0656('0x28'),_0x4e78ca,_0x31f592?_0x0656('0x29'):_0x0656('0x25')):null);});})[_0x0656('0x2d')](function(_0x1be32e){logger[_0x0656('0xc')](util[_0x0656('0xd')](_0x0656('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x0656('0x2f')](_0x1be32e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x0656('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbb18=['existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','then','num','Empty','split','length','isInteger','forEach','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xbb18,0xb1));var _0x8bb1=function(_0x54cd98,_0x3029e6){_0x54cd98=_0x54cd98-0x0;var _0x4abd09=_0xbb18[_0x54cd98];return _0x4abd09;};'use strict';var util=require(_0x8bb1('0x0'));var path=require(_0x8bb1('0x1'));var _=require(_0x8bb1('0x2'));var fs=require('fs');var json2xls=require(_0x8bb1('0x3'));var BPromise=require(_0x8bb1('0x4'));var zipdir=require(_0x8bb1('0x5'));var rimraf=require(_0x8bb1('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8bb1('0x7'))[_0x8bb1('0x8')];var logger=require(_0x8bb1('0x9'))(_0x8bb1('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x8bb1('0xb')][0x2]);var QUERY=process[_0x8bb1('0xb')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x140e7f,_0x3a0219){var _0x5f09ed={'status':_0x140e7f};var _0x2b7168={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a0219){_0x5f09ed[_0x8bb1('0xc')]=_0x3a0219;}return db['AnalyticExtractedReport'][_0x8bb1('0xd')](_0x5f09ed,_0x2b7168);}function main(){var _0x31fe7e=0x1388;var _0x1fd0a9;logger[_0x8bb1('0xe')](util[_0x8bb1('0xf')](_0x8bb1('0x10'),EXTRACTED_REPORT_ID,_0x8bb1('0x11')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8bb1('0x12')]})['then'](function(_0x1e1e62){if(_0x1e1e62){_0x1fd0a9=_0x1e1e62;_0x31fe7e=_0x1fd0a9['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0x8bb1('0x13')][_0x8bb1('0x14')](util[_0x8bb1('0xf')](_0x8bb1('0x15'),QUERY),{'type':dbH[_0x8bb1('0x13')][_0x8bb1('0x16')]['SELECT']});})[_0x8bb1('0x17')](function(_0x205b73){if(!_0x205b73[0x0][_0x8bb1('0x18')]){return analyticExtractedReport(_0x8bb1('0x19'));}var _0x43c74a=[];var _0xab88a2=0x0;if(_0x1fd0a9[_0x8bb1('0x1a')]){if(_0x205b73&&_0x205b73[_0x8bb1('0x1b')]){var _0x1b33b5=_['range'](_0x205b73[0x0][_0x8bb1('0x18')]/_0x31fe7e);var _0x265250=Number[_0x8bb1('0x1c')](_0x205b73[0x0][_0x8bb1('0x18')]/_0x31fe7e)?_0x205b73[0x0]['num']%_0x31fe7e:0x0;_0x1b33b5[_0x8bb1('0x1d')](function(_0x13202b){if(_0x13202b>0x0){_0xab88a2+=_0x31fe7e;}_0x43c74a[_0x8bb1('0x1e')](dbH[_0x8bb1('0x13')]['query'](util[_0x8bb1('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x31fe7e,_0xab88a2),{'type':dbH[_0x8bb1('0x13')][_0x8bb1('0x16')][_0x8bb1('0x1f')]}));});if(_0x265250>0x0){_0xab88a2+=_0x31fe7e;_0x43c74a[_0x8bb1('0x1e')](dbH[_0x8bb1('0x13')][_0x8bb1('0x14')](util[_0x8bb1('0xf')](_0x8bb1('0x20'),QUERY,_0x265250,_0xab88a2),{'type':dbH[_0x8bb1('0x13')]['QueryTypes']['SELECT']}));}}}else{_0x43c74a['push'](dbH[_0x8bb1('0x13')]['query'](QUERY,{'type':dbH[_0x8bb1('0x13')][_0x8bb1('0x16')][_0x8bb1('0x1f')]}));}var _0xc520e0=path[_0x8bb1('0x21')](PATH);var _0x836038=path[_0x8bb1('0x22')](PATH,'.xlsx');var _0x2060f5=_0x1fd0a9[_0x8bb1('0x1a')]&&_0x43c74a[_0x8bb1('0x1b')]>0x1;var _0x4ca4b2=[];if(!fs[_0x8bb1('0x23')](path['join'](_0xc520e0,_0x836038))&&_0x2060f5){fs[_0x8bb1('0x24')](path[_0x8bb1('0x25')](_0xc520e0,_0x836038));}return BPromise[_0x8bb1('0x26')](_0x43c74a,function(_0x12def4){_0x4ca4b2[_0x8bb1('0x1e')](_0x12def4);})[_0x8bb1('0x17')](function(){for(var _0x4a5b78=0x0;_0x4a5b78<_0x4ca4b2['length'];_0x4a5b78+=0x1){var _0x3e1a5d;var _0x530bb1=_0x4ca4b2[_0x4a5b78];if(_0x2060f5){_0x3e1a5d=path['join'](_0xc520e0,_0x836038,util[_0x8bb1('0xf')](_0x8bb1('0x27'),_0x836038,_0x4a5b78,_0x8bb1('0x28')));}else{_0x3e1a5d=path['join'](_0xc520e0,util[_0x8bb1('0xf')](_0x8bb1('0x29'),_0x836038,'xlsx'));}fs[_0x8bb1('0x2a')](_0x3e1a5d,json2xls(_0x530bb1),_0x8bb1('0x2b'));}})[_0x8bb1('0x17')](function(){if(_0x2060f5){return new Promise(function(_0x302ee1){zipdir(path[_0x8bb1('0x25')](_0xc520e0,_0x836038),{'saveTo':path[_0x8bb1('0x25')](_0xc520e0,util[_0x8bb1('0xf')](_0x8bb1('0x29'),_0x836038,_0x8bb1('0x2c')))},function(_0x166941,_0x381324){rimraf(path[_0x8bb1('0x25')](_0xc520e0,_0x836038),function(){});_0x302ee1(_0x8bb1('0x2d'));});});}})['then'](function(){logger[_0x8bb1('0xe')](util[_0x8bb1('0xf')](_0x8bb1('0x2e'),EXTRACTED_REPORT_ID,_0x8bb1('0x11')));return analyticExtractedReport(_0x8bb1('0x2f'),_0x2060f5?util[_0x8bb1('0xf')]('%s.%s',_0x836038,_0x2060f5?'zip':_0x8bb1('0x28')):null);});})[_0x8bb1('0x30')](function(_0x59e757){logger['info'](util[_0x8bb1('0xf')](_0x8bb1('0x31'),EXTRACTED_REPORT_ID,_0x8bb1('0x11')),util[_0x8bb1('0x32')](_0x59e757,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8bb1('0x33'));})[_0x8bb1('0x34')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b7e6459..70fca7e 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 _0x6cc6=['Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','push','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','error','rewrite','lodash','Interval','findAll','intervals','models','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','hasOwnProperty','priority','extensions','extension'];(function(_0x40b8d8,_0x3b82a6){var _0x3efcc2=function(_0x48c991){while(--_0x48c991){_0x40b8d8['push'](_0x40b8d8['shift']());}};_0x3efcc2(++_0x3b82a6);}(_0x6cc6,0xbb));var _0x66cc=function(_0x5491ce,_0x10247c){_0x5491ce=_0x5491ce-0x0;var _0x434f7f=_0x6cc6[_0x5491ce];return _0x434f7f;};'use strict';var _=require(_0x66cc('0x0'));var util=require('util');function rewrite(_0x46d3d8,_0x5a113e){var _0x27c482=this;return _0x46d3d8['models'][_0x66cc('0x1')][_0x66cc('0x2')]({'raw':!![]})['then'](function(_0x13863c){_0x27c482[_0x66cc('0x3')]=_0x13863c;return _0x46d3d8[_0x66cc('0x4')][_0x66cc('0x5')][_0x66cc('0x2')]({'where':{'IntervalId':_0x5a113e[_0x66cc('0x6')]},'raw':!![]});})['then'](function(_0x4c7cdd){return _0x46d3d8[_0x66cc('0x4')][_0x66cc('0x5')][_0x66cc('0x2')]({'where':{'exten':{'$in':_[_0x66cc('0x7')](_[_0x66cc('0x8')](_0x4c7cdd,_0x66cc('0x9')))}},'order':[{'raw':_0x66cc('0xa')}],'raw':!![]});})['then'](function(_0x497bed){var _0x4215cd=_['filter'](_0x497bed,{'priority':'1'});var _0x485e31=_[_0x66cc('0xb')](_0x497bed,{'isApp':0x1});var _0x2af652=_['groupBy'](_0x485e31,_0x66cc('0x9'));var _0x9bddb6=[_0x66cc('0xc'),'playback'];var _0x15a68b=[];var _0x3eb915=[];for(var _0x31ece6 in _0x2af652){if(_0x2af652[_0x66cc('0xd')](_0x31ece6)){_0x27c482[_0x66cc('0xe')]=0x2;_0x27c482[_0x66cc('0xf')]=[];_0x27c482[_0x66cc('0x10')]=_['find'](_0x4215cd,{'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')]});_0x27c482['extensions']['push']({'type':_0x2af652[_0x31ece6][0x0]['type'],'app':_0x66cc('0x11'),'appdata':util[_0x66cc('0x12')](_0x66cc('0x13'),_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')]),'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});if(_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')]===_0x66cc('0x17')){_0x27c482['extensions']['push']({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':'Set','appdata':_0x66cc('0x18')+_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')],'context':_0x2af652[_0x31ece6][0x0]['context'],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});}else if(_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')]===_0x66cc('0x19')){if(_0x27c482[_0x66cc('0x10')]){_0x27c482['extensions'][_0x66cc('0x1a')]({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':_0x66cc('0x11'),'appdata':'CDR(destination)='+(_0x27c482['extension']['cutdigits']?'${EXTEN:'+_0x27c482[_0x66cc('0x10')][_0x66cc('0x1b')]+'}':_0x66cc('0x1c')),'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0]['VoiceExtensionId']});}_0x27c482[_0x66cc('0xf')]['push']({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':_0x66cc('0x11'),'appdata':'CDR(routeid)='+_0x2af652[_0x31ece6][0x0]['VoiceExtensionId'],'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});var _0x4435f0=_0x27c482['priority']++;_0x27c482[_0x66cc('0xf')][_0x66cc('0x1a')]({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':_0x66cc('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4435f0+0x2)+_0x66cc('0x1e')+(_0x4435f0+0x1)+')','context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x4435f0,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});if(_0x27c482[_0x66cc('0x10')]){_0x27c482['extensions']['push']({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':_0x66cc('0x11'),'appdata':_0x27c482[_0x66cc('0x10')]['cutdigits']?_0x66cc('0x1f')+_0x27c482[_0x66cc('0x10')][_0x66cc('0x1b')]+'}':_0x66cc('0x20'),'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x27c482['priority']++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});}_0x27c482[_0x66cc('0xf')][_0x66cc('0x1a')]({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':'Set','appdata':'outboundrouteid='+_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')],'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0]['exten'],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});if(_0x27c482['extension']&&_0x27c482[_0x66cc('0x10')][_0x66cc('0xd')](_0x66cc('0x21'))&&_0x27c482[_0x66cc('0x10')]['recordingFormat']!==_0x66cc('0x22')){_0x27c482[_0x66cc('0xf')][_0x66cc('0x1a')]({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':_0x66cc('0x11'),'appdata':_0x66cc('0x23'),'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0]['exten'],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0]['VoiceExtensionId']});_0x27c482[_0x66cc('0xf')][_0x66cc('0x1a')]({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':_0x66cc('0x11'),'appdata':_0x66cc('0x24')+_0x27c482[_0x66cc('0x10')][_0x66cc('0x21')]||'wav','context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});}}_0x27c482['extensions'][_0x66cc('0x1a')]({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':'Set','appdata':_0x66cc('0x25'),'context':_0x2af652[_0x31ece6][0x0]['context'],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0]['VoiceExtensionId']});_0x27c482[_0x66cc('0xf')]['push']({'type':_0x2af652[_0x31ece6][0x0]['type'],'app':'Set','appdata':_0x66cc('0x26'),'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0]['VoiceExtensionId']});_0x27c482['extensions'][_0x66cc('0x1a')]({'type':_0x2af652[_0x31ece6][0x0][_0x66cc('0x14')],'app':_0x66cc('0x11'),'appdata':_0x66cc('0x27'),'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'exten':_0x2af652[_0x31ece6][0x0]['exten'],'priority':_0x27c482[_0x66cc('0xe')]++,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});for(var _0x21f08c=0x0,_0x358946=0x0;_0x21f08c<_0x2af652[_0x31ece6][_0x66cc('0x28')];_0x21f08c+=0x1,_0x358946=0x0){var _0x4ec7a9=_0x2af652[_0x31ece6][_0x21f08c];if(_0x4ec7a9[_0x66cc('0x14')]){_0x4ec7a9['type']=_0x4ec7a9[_0x66cc('0x14')][_0x66cc('0x29')]();}var _0x1d815b=[];var _0x241a4b=[];delete _0x4ec7a9['id'];delete _0x4ec7a9[_0x66cc('0x2a')];delete _0x4ec7a9[_0x66cc('0x2b')];var _0x208077=_0x4ec7a9['interval']!==_0x66cc('0x2c')?[_0x4ec7a9[_0x66cc('0x2d')]]:_0x4ec7a9[_0x66cc('0x6')]?_[_0x66cc('0x8')](_[_0x66cc('0xb')](_0x27c482[_0x66cc('0x3')],{'IntervalId':_0x4ec7a9['IntervalId']}),_0x66cc('0x2d')):[];if(_0x4ec7a9[_0x66cc('0xd')](_0x66cc('0x2e'))){if(_0x4ec7a9[_0x66cc('0x2e')]&&_0x4ec7a9[_0x66cc('0x2e')]!=='--'){_0x1d815b[_0x66cc('0x1a')]({'type':_0x4ec7a9[_0x66cc('0x14')],'app':_0x66cc('0x11'),'appdata':_0x66cc('0x2f')+_0x4ec7a9[_0x66cc('0x2e')],'context':_0x4ec7a9[_0x66cc('0x15')],'exten':_0x4ec7a9[_0x66cc('0x9')],'priority':_0x208077[_0x66cc('0x28')]+_0x27c482[_0x66cc('0xe')]+_0x358946++,'VoiceExtensionId':_0x4ec7a9[_0x66cc('0x16')]});}}if(_0x4ec7a9[_0x66cc('0x14')]==='outbound'&&_0x4ec7a9[_0x66cc('0xd')](_0x66cc('0x30'))){if(_0x4ec7a9[_0x66cc('0x30')]){_0x1d815b[_0x66cc('0x1a')]({'type':_0x4ec7a9[_0x66cc('0x14')],'app':'ExecIf','appdata':_0x66cc('0x31')+_0x4ec7a9[_0x66cc('0x30')]+')','context':_0x4ec7a9['context'],'exten':_0x4ec7a9[_0x66cc('0x9')],'priority':_0x208077[_0x66cc('0x28')]+_0x27c482['priority']+_0x358946++,'VoiceExtensionId':_0x4ec7a9[_0x66cc('0x16')]});}else{_0x1d815b[_0x66cc('0x1a')]({'type':_0x4ec7a9[_0x66cc('0x14')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4ec7a9['context'],'exten':_0x4ec7a9[_0x66cc('0x9')],'priority':_0x208077[_0x66cc('0x28')]+_0x27c482[_0x66cc('0xe')]+_0x358946++,'VoiceExtensionId':_0x4ec7a9[_0x66cc('0x16')]});}}if(_0x4ec7a9[_0x66cc('0xd')](_0x66cc('0x32'))){if(_0x9bddb6[_0x66cc('0x33')](_0x4ec7a9[_0x66cc('0x34')][_0x66cc('0x29')]())>=0x0&&_0x4ec7a9[_0x66cc('0x35')]!=='custom'){if(_0x4ec7a9['answer']){_0x1d815b['push']({'type':_0x4ec7a9[_0x66cc('0x14')],'app':_0x66cc('0x1d'),'appdata':_0x66cc('0x36'),'context':_0x4ec7a9[_0x66cc('0x15')],'exten':_0x4ec7a9[_0x66cc('0x9')],'priority':_0x208077['length']+_0x27c482[_0x66cc('0xe')]+_0x358946++,'VoiceExtensionId':_0x4ec7a9['VoiceExtensionId']});_0x1d815b[_0x66cc('0x1a')]({'type':_0x4ec7a9[_0x66cc('0x14')],'app':_0x66cc('0x11'),'appdata':_0x66cc('0x37'),'context':_0x4ec7a9['context'],'exten':_0x4ec7a9[_0x66cc('0x9')],'priority':_0x208077[_0x66cc('0x28')]+_0x27c482[_0x66cc('0xe')]+_0x358946++,'VoiceExtensionId':_0x4ec7a9[_0x66cc('0x16')]});}else{_0x1d815b['push']({'type':_0x4ec7a9[_0x66cc('0x14')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4ec7a9[_0x66cc('0x15')],'exten':_0x4ec7a9['exten'],'priority':_0x208077[_0x66cc('0x28')]+_0x27c482[_0x66cc('0xe')]+_0x358946++,'VoiceExtensionId':_0x4ec7a9['VoiceExtensionId']});_0x1d815b['push']({'type':_0x4ec7a9['type'],'app':_0x66cc('0x11'),'appdata':_0x66cc('0x38'),'context':_0x4ec7a9['context'],'exten':_0x4ec7a9[_0x66cc('0x9')],'priority':_0x208077[_0x66cc('0x28')]+_0x27c482['priority']+_0x358946++,'VoiceExtensionId':_0x4ec7a9[_0x66cc('0x16')]});}}}for(var _0x1e9141=0x0;_0x1e9141<_0x208077['length'];_0x1e9141+=0x1){var _0x245db2=_0x27c482[_0x66cc('0xe')]+_0x208077[_0x66cc('0x28')];var _0xcca3ae=_0x1e9141===_0x208077['length']-0x1?_0x27c482[_0x66cc('0xe')]+_0x1d815b[_0x66cc('0x28')]+_0x241a4b['length']+0x2:_0x27c482[_0x66cc('0xe')]+_0x1e9141+0x1;_0x1d815b[_0x66cc('0x39')](_0x1e9141,0x0,{'type':_0x4ec7a9[_0x66cc('0x14')],'app':_0x66cc('0x3a'),'appdata':_0x208077[_0x1e9141]+'?'+_0x4ec7a9[_0x66cc('0x15')]+_0x66cc('0x3b')+_0x245db2+':'+_0x4ec7a9[_0x66cc('0x15')]+_0x66cc('0x3b')+_0xcca3ae,'exten':_0x4ec7a9[_0x66cc('0x9')],'context':_0x4ec7a9[_0x66cc('0x15')],'priority':_0x27c482[_0x66cc('0xe')]+_0x1e9141,'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});}_0x4ec7a9['priority']=_0x1d815b['length']?_[_0x66cc('0x3c')](_0x1d815b)[_0x66cc('0xe')]+0x1:_0x27c482[_0x66cc('0xe')];_0x27c482['priority']=(_0x241a4b[_0x66cc('0x28')]?_[_0x66cc('0x3c')](_0x241a4b)['priority']:_0x4ec7a9['priority'])+0x1;_0x27c482[_0x66cc('0xf')]=_[_0x66cc('0x3d')](_0x27c482[_0x66cc('0xf')],_0x1d815b,[_0x4ec7a9],_0x241a4b);}_0x27c482['extensions'][_0x66cc('0x1a')]({'type':_0x2af652[_0x31ece6][0x0]['type'],'app':_0x66cc('0x3e'),'exten':_0x2af652[_0x31ece6][0x0][_0x66cc('0x9')],'context':_0x2af652[_0x31ece6][0x0][_0x66cc('0x15')],'priority':_0x27c482[_0x66cc('0xe')],'VoiceExtensionId':_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]});_0x15a68b[_0x66cc('0x1a')](_0x2af652[_0x31ece6][0x0][_0x66cc('0x16')]);_0x3eb915=_[_0x66cc('0x3d')](_0x3eb915,_0x27c482[_0x66cc('0xf')]);}}return _0x46d3d8[_0x66cc('0x3f')](function(_0x1ad590){return _0x46d3d8['models'][_0x66cc('0x5')][_0x66cc('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x15a68b}},'transaction':_0x1ad590})['then'](function(_0x300f44){return _0x46d3d8[_0x66cc('0x4')][_0x66cc('0x5')]['bulkCreate'](_[_0x66cc('0x41')](_0x3eb915,_0x66cc('0xe')),{'transaction':_0x1ad590});});});})['catch'](function(_0x283972){console[_0x66cc('0x42')](_0x283972);});}exports[_0x66cc('0x43')]=rewrite; \ No newline at end of file +var _0x9395=['outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','sortBy','catch','error','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','extension','find','push','type','format','CDR(type)=%s','context','VoiceExtensionId','extensions','Set','CDR(routeid)=','priority','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','toLowerCase','createdAt','*,*,*,*','interval','tag','CDR(tag)=','length'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x9395,0x184));var _0x5939=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9395[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x5939('0x0'));var util=require('util');function rewrite(_0x1a736f,_0x686b81){var _0x526345=this;return _0x1a736f[_0x5939('0x1')][_0x5939('0x2')][_0x5939('0x3')]({'raw':!![]})[_0x5939('0x4')](function(_0xc0d760){_0x526345[_0x5939('0x5')]=_0xc0d760;return _0x1a736f[_0x5939('0x1')][_0x5939('0x6')][_0x5939('0x3')]({'where':{'IntervalId':_0x686b81[_0x5939('0x7')]},'raw':!![]});})[_0x5939('0x4')](function(_0x1821b5){return _0x1a736f['models'][_0x5939('0x6')][_0x5939('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x5939('0x8')](_0x1821b5,_0x5939('0x9')))}},'order':[{'raw':_0x5939('0xa')}],'raw':!![]});})[_0x5939('0x4')](function(_0x2cff05){var _0x55c44a=_[_0x5939('0xb')](_0x2cff05,{'priority':'1'});var _0xc9cd8a=_[_0x5939('0xb')](_0x2cff05,{'isApp':0x1});var _0xb6faad=_[_0x5939('0xc')](_0xc9cd8a,_0x5939('0x9'));var _0x4b5b12=[_0x5939('0xd'),_0x5939('0xe')];var _0x28ed02=[];var _0x1caea4=[];for(var _0x42db08 in _0xb6faad){if(_0xb6faad['hasOwnProperty'](_0x42db08)){_0x526345['priority']=0x2;_0x526345['extensions']=[];_0x526345[_0x5939('0xf')]=_[_0x5939('0x10')](_0x55c44a,{'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')]});_0x526345['extensions'][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':'Set','appdata':util[_0x5939('0x13')](_0x5939('0x14'),_0xb6faad[_0x42db08][0x0][_0x5939('0x12')]),'context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'priority':_0x526345['priority']++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]});if(_0xb6faad[_0x42db08][0x0][_0x5939('0x12')]==='inbound'){_0x526345[_0x5939('0x17')][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0]['type'],'app':_0x5939('0x18'),'appdata':_0x5939('0x19')+_0xb6faad[_0x42db08][0x0][_0x5939('0x16')],'context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'priority':_0x526345[_0x5939('0x1a')]++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]});}else if(_0xb6faad[_0x42db08][0x0][_0x5939('0x12')]==='outbound'){if(_0x526345[_0x5939('0xf')]){_0x526345[_0x5939('0x17')]['push']({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':_0x5939('0x18'),'appdata':_0x5939('0x1b')+(_0x526345['extension'][_0x5939('0x1c')]?_0x5939('0x1d')+_0x526345[_0x5939('0xf')]['cutdigits']+'}':_0x5939('0x1e')),'context':_0xb6faad[_0x42db08][0x0]['context'],'exten':_0xb6faad[_0x42db08][0x0]['exten'],'priority':_0x526345[_0x5939('0x1a')]++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]});}_0x526345[_0x5939('0x17')]['push']({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':_0x5939('0x18'),'appdata':_0x5939('0x19')+_0xb6faad[_0x42db08][0x0][_0x5939('0x16')],'context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'priority':_0x526345['priority']++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]});var _0x274d0d=_0x526345['priority']++;_0x526345['extensions'][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':_0x5939('0x1f'),'appdata':_0x5939('0x20')+(_0x274d0d+0x2)+_0x5939('0x21')+(_0x274d0d+0x1)+')','context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'priority':_0x274d0d,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0]['VoiceExtensionId']});if(_0x526345[_0x5939('0xf')]){_0x526345['extensions'][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':'Set','appdata':_0x526345[_0x5939('0xf')][_0x5939('0x1c')]?_0x5939('0x22')+_0x526345[_0x5939('0xf')][_0x5939('0x1c')]+'}':_0x5939('0x23'),'context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0]['exten'],'priority':_0x526345['priority']++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0]['VoiceExtensionId']});}_0x526345[_0x5939('0x17')][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':_0x5939('0x18'),'appdata':'outboundrouteid='+_0xb6faad[_0x42db08][0x0][_0x5939('0x16')],'context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'priority':_0x526345[_0x5939('0x1a')]++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]});if(_0x526345[_0x5939('0xf')]&&_0x526345[_0x5939('0xf')][_0x5939('0x24')]('recordingFormat')&&_0x526345[_0x5939('0xf')][_0x5939('0x25')]!==_0x5939('0x26')){_0x526345[_0x5939('0x17')]['push']({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':_0x5939('0x18'),'appdata':_0x5939('0x27'),'context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'priority':_0x526345[_0x5939('0x1a')]++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0]['VoiceExtensionId']});_0x526345[_0x5939('0x17')][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0]['type'],'app':'Set','appdata':_0x5939('0x28')+_0x526345[_0x5939('0xf')][_0x5939('0x25')]||_0x5939('0x29'),'context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0]['exten'],'priority':_0x526345[_0x5939('0x1a')]++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]});}}_0x526345[_0x5939('0x17')][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':_0x5939('0x18'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'priority':_0x526345[_0x5939('0x1a')]++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0]['VoiceExtensionId']});_0x526345['extensions']['push']({'type':_0xb6faad[_0x42db08][0x0]['type'],'app':'Set','appdata':_0x5939('0x2a'),'context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0]['exten'],'priority':_0x526345[_0x5939('0x1a')]++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0]['VoiceExtensionId']});_0x526345['extensions'][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':_0x5939('0x18'),'appdata':'MONITOR_OPTIONS=ab','context':_0xb6faad[_0x42db08][0x0][_0x5939('0x15')],'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'priority':_0x526345[_0x5939('0x1a')]++,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]});for(var _0x41b4d8=0x0,_0x59fe9f=0x0;_0x41b4d8<_0xb6faad[_0x42db08]['length'];_0x41b4d8+=0x1,_0x59fe9f=0x0){var _0x500485=_0xb6faad[_0x42db08][_0x41b4d8];if(_0x500485['type']){_0x500485['type']=_0x500485[_0x5939('0x12')][_0x5939('0x2b')]();}var _0x15bc75=[];var _0x132cad=[];delete _0x500485['id'];delete _0x500485[_0x5939('0x2c')];delete _0x500485['updatedAt'];var _0x140975=_0x500485['interval']!==_0x5939('0x2d')?[_0x500485[_0x5939('0x2e')]]:_0x500485['IntervalId']?_[_0x5939('0x8')](_[_0x5939('0xb')](_0x526345[_0x5939('0x5')],{'IntervalId':_0x500485[_0x5939('0x7')]}),_0x5939('0x2e')):[];if(_0x500485[_0x5939('0x24')]('tag')){if(_0x500485[_0x5939('0x2f')]&&_0x500485[_0x5939('0x2f')]!=='--'){_0x15bc75['push']({'type':_0x500485[_0x5939('0x12')],'app':_0x5939('0x18'),'appdata':_0x5939('0x30')+_0x500485[_0x5939('0x2f')],'context':_0x500485[_0x5939('0x15')],'exten':_0x500485['exten'],'priority':_0x140975[_0x5939('0x31')]+_0x526345['priority']+_0x59fe9f++,'VoiceExtensionId':_0x500485['VoiceExtensionId']});}}if(_0x500485[_0x5939('0x12')]===_0x5939('0x32')&&_0x500485[_0x5939('0x24')]('callerID')){if(_0x500485[_0x5939('0x33')]){_0x15bc75[_0x5939('0x11')]({'type':_0x500485['type'],'app':'ExecIf','appdata':_0x5939('0x34')+_0x500485[_0x5939('0x33')]+')','context':_0x500485[_0x5939('0x15')],'exten':_0x500485[_0x5939('0x9')],'priority':_0x140975[_0x5939('0x31')]+_0x526345[_0x5939('0x1a')]+_0x59fe9f++,'VoiceExtensionId':_0x500485[_0x5939('0x16')]});}else{_0x15bc75[_0x5939('0x11')]({'type':_0x500485[_0x5939('0x12')],'app':_0x5939('0x1f'),'appdata':_0x5939('0x35'),'context':_0x500485[_0x5939('0x15')],'exten':_0x500485[_0x5939('0x9')],'priority':_0x140975[_0x5939('0x31')]+_0x526345[_0x5939('0x1a')]+_0x59fe9f++,'VoiceExtensionId':_0x500485['VoiceExtensionId']});}}if(_0x500485[_0x5939('0x24')](_0x5939('0x36'))){if(_0x4b5b12[_0x5939('0x37')](_0x500485[_0x5939('0x38')][_0x5939('0x2b')]())>=0x0&&_0x500485[_0x5939('0x39')]!==_0x5939('0x3a')){if(_0x500485[_0x5939('0x36')]){_0x15bc75[_0x5939('0x11')]({'type':_0x500485[_0x5939('0x12')],'app':_0x5939('0x1f'),'appdata':_0x5939('0x3b'),'context':_0x500485[_0x5939('0x15')],'exten':_0x500485[_0x5939('0x9')],'priority':_0x140975['length']+_0x526345[_0x5939('0x1a')]+_0x59fe9f++,'VoiceExtensionId':_0x500485[_0x5939('0x16')]});_0x15bc75[_0x5939('0x11')]({'type':_0x500485[_0x5939('0x12')],'app':_0x5939('0x18'),'appdata':_0x5939('0x3c'),'context':_0x500485[_0x5939('0x15')],'exten':_0x500485[_0x5939('0x9')],'priority':_0x140975[_0x5939('0x31')]+_0x526345[_0x5939('0x1a')]+_0x59fe9f++,'VoiceExtensionId':_0x500485[_0x5939('0x16')]});}else{_0x15bc75[_0x5939('0x11')]({'type':_0x500485[_0x5939('0x12')],'app':_0x5939('0x1f'),'appdata':_0x5939('0x3d'),'context':_0x500485[_0x5939('0x15')],'exten':_0x500485[_0x5939('0x9')],'priority':_0x140975[_0x5939('0x31')]+_0x526345['priority']+_0x59fe9f++,'VoiceExtensionId':_0x500485[_0x5939('0x16')]});_0x15bc75[_0x5939('0x11')]({'type':_0x500485['type'],'app':'Set','appdata':_0x5939('0x3e'),'context':_0x500485[_0x5939('0x15')],'exten':_0x500485[_0x5939('0x9')],'priority':_0x140975[_0x5939('0x31')]+_0x526345[_0x5939('0x1a')]+_0x59fe9f++,'VoiceExtensionId':_0x500485['VoiceExtensionId']});}}}for(var _0x59188f=0x0;_0x59188f<_0x140975[_0x5939('0x31')];_0x59188f+=0x1){var _0x2b4eea=_0x526345[_0x5939('0x1a')]+_0x140975[_0x5939('0x31')];var _0x1eb1a2=_0x59188f===_0x140975[_0x5939('0x31')]-0x1?_0x526345[_0x5939('0x1a')]+_0x15bc75['length']+_0x132cad[_0x5939('0x31')]+0x2:_0x526345[_0x5939('0x1a')]+_0x59188f+0x1;_0x15bc75[_0x5939('0x3f')](_0x59188f,0x0,{'type':_0x500485['type'],'app':_0x5939('0x40'),'appdata':_0x140975[_0x59188f]+'?'+_0x500485[_0x5939('0x15')]+',${EXTEN},'+_0x2b4eea+':'+_0x500485[_0x5939('0x15')]+_0x5939('0x41')+_0x1eb1a2,'exten':_0x500485[_0x5939('0x9')],'context':_0x500485['context'],'priority':_0x526345[_0x5939('0x1a')]+_0x59188f,'VoiceExtensionId':_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]});}_0x500485['priority']=_0x15bc75[_0x5939('0x31')]?_[_0x5939('0x42')](_0x15bc75)['priority']+0x1:_0x526345[_0x5939('0x1a')];_0x526345['priority']=(_0x132cad[_0x5939('0x31')]?_[_0x5939('0x42')](_0x132cad)['priority']:_0x500485['priority'])+0x1;_0x526345['extensions']=_[_0x5939('0x43')](_0x526345['extensions'],_0x15bc75,[_0x500485],_0x132cad);}_0x526345['extensions'][_0x5939('0x11')]({'type':_0xb6faad[_0x42db08][0x0][_0x5939('0x12')],'app':_0x5939('0x44'),'exten':_0xb6faad[_0x42db08][0x0][_0x5939('0x9')],'context':_0xb6faad[_0x42db08][0x0]['context'],'priority':_0x526345[_0x5939('0x1a')],'VoiceExtensionId':_0xb6faad[_0x42db08][0x0]['VoiceExtensionId']});_0x28ed02[_0x5939('0x11')](_0xb6faad[_0x42db08][0x0][_0x5939('0x16')]);_0x1caea4=_['concat'](_0x1caea4,_0x526345['extensions']);}}return _0x1a736f['transaction'](function(_0x16b507){return _0x1a736f[_0x5939('0x1')][_0x5939('0x6')][_0x5939('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x28ed02}},'transaction':_0x16b507})[_0x5939('0x4')](function(_0x319874){return _0x1a736f[_0x5939('0x1')][_0x5939('0x6')]['bulkCreate'](_[_0x5939('0x46')](_0x1caea4,_0x5939('0x1a')),{'transaction':_0x16b507});});});})[_0x5939('0x47')](function(_0x330cfb){console[_0x5939('0x48')](_0x330cfb);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 537783e..d0c7fa9 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 _0x52b3=['CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','createdAt','select','phone','field','NOW()','scheduledAt','toString','updatedAt','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper','\x20=\x20?','ContactId','cm_contacts','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','id\x20IN\x20?','VoiceQueue','outbound','dialCheckDuplicateType','Lists','get','VoiceQueueId','onlyIfOpen','sequelize','query','CmList','BlackLists','all','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','error','contact','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact'];(function(_0x2384df,_0x44eefd){var _0x741672=function(_0x18dcef){while(--_0x18dcef){_0x2384df['push'](_0x2384df['shift']());}};_0x741672(++_0x44eefd);}(_0x52b3,0x122));var _0x352b=function(_0x2c9cfa,_0x5e9eeb){_0x2c9cfa=_0x2c9cfa-0x0;var _0x136d5a=_0x52b3[_0x2c9cfa];return _0x136d5a;};'use strict';var BPromise=require(_0x352b('0x0'));var util=require(_0x352b('0x1'));var _=require(_0x352b('0x2'));var fs=require('fs');var squel=require(_0x352b('0x3'));var Papa=require(_0x352b('0x4'));var Redis=require(_0x352b('0x5'));var db=require(_0x352b('0x6'))['db'];var config=require(_0x352b('0x7'));var logger=require(_0x352b('0x8'))('api');config[_0x352b('0x9')]=_[_0x352b('0xa')](config[_0x352b('0x9')],{'host':_0x352b('0xb'),'port':0x18eb});var socket=require(_0x352b('0xc'))(new Redis(config[_0x352b('0x9')]));require(_0x352b('0xd'))[_0x352b('0xe')](socket);try{if(!process['argv'][0x2]||process[_0x352b('0xf')][0x2]===_0x352b('0x10')||process['argv'][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x352b('0xf')][0x2];if(!process[_0x352b('0xf')][0x3]||process[_0x352b('0xf')][0x3]===_0x352b('0x10')||process[_0x352b('0xf')][0x3]==='null'||!process[_0x352b('0xf')][0x4]||process['argv'][0x4]==='undefined'||process[_0x352b('0xf')][0x4]===_0x352b('0x11')){throw new Error(_0x352b('0x12'));}var FIELDS=_[_0x352b('0x13')](process['argv'][0x3][_0x352b('0x14')](','),process[_0x352b('0xf')][0x4][_0x352b('0x14')](','));if(!process[_0x352b('0xf')][0x5]||process['argv'][0x5]===_0x352b('0x10')||process['argv'][0x5]===_0x352b('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x352b('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!=='undefined'&&process['argv'][0x6]!==_0x352b('0x11')?process[_0x352b('0xf')][0x6]:null;var DUPLICATES=process[_0x352b('0xf')][0x7]&&process[_0x352b('0xf')][0x7]!=='undefined'&&process[_0x352b('0xf')][0x7]!==_0x352b('0x11')?process[_0x352b('0xf')][0x7]:null;if(!process['argv'][0x8]||process[_0x352b('0xf')][0x8]===_0x352b('0x10')||process[_0x352b('0xf')][0x8]===_0x352b('0x11')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x409f8a){logger[_0x352b('0x15')](_0x409f8a);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(_0x281044,_0x15f6ce,_0x104782,_0x26f7ea){var _0x54462e={'message':_0x15f6ce};_0x54462e[_0x281044]=!![];if(_0x104782){_0x54462e[_0x352b('0x16')]=_0x104782;}if(_0x26f7ea){_0x54462e['index']=_0x26f7ea;}return _0x54462e;}function isEmail(_0x57d38e){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))*$/[_0x352b('0x17')](_0x57d38e);}function checkRow(_0x25934c,_0x544e9c,_0x501267){return new BPromise(function(_0x57dfa5,_0x4bee42){if(_['isNil'](_0x25934c)){return _0x4bee42(handleCheckRowError(_0x352b('0x15'),_0x352b('0x18'),null,_0x501267));}if(_0x25934c[_0x352b('0x19')]&&_0x25934c[_0x352b('0x19')]['length']){var _0x278f11=_[_0x352b('0x1a')](_0x25934c[_0x352b('0x19')],_0x352b('0x1b'))[_0x352b('0x1c')](';');return _0x4bee42(handleCheckRowError(_0x352b('0x15'),_0x278f11,null,_0x501267));}var _0x3ab5d9={};for(var _0x3ac599 in FIELDS){if(FIELDS['hasOwnProperty'](_0x3ac599)&&FIELDS[_0x3ac599]){_0x3ab5d9[_0x3ac599]=_0x25934c[_0x352b('0x1d')][0x0][FIELDS[_0x3ac599]]||_0x25934c[_0x352b('0x1d')][0x0]['\ufeff'+FIELDS[_0x3ac599]];}}if(!_0x3ab5d9[_0x352b('0x1e')]){return _0x4bee42(handleCheckRowError('error',_0x352b('0x1f'),null,_0x501267));}if(!_0x3ab5d9['phone']){return _0x4bee42(handleCheckRowError(_0x352b('0x15'),'phone\x20not\x20specified!',null,_0x501267));}if(_0x3ab5d9[_0x352b('0x20')]){var _0x3ae2fa=moment(_0x3ab5d9[_0x352b('0x20')],_0x352b('0x21'));if(!_0x3ae2fa[_0x352b('0x22')]()){return _0x4bee42(handleCheckRowError('error',_0x352b('0x23'),null,_0x501267));}}if(_0x3ab5d9[_0x352b('0x24')]){if(!isEmail(_0x3ab5d9[_0x352b('0x24')])){return _0x4bee42(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x501267));}}_0x3ab5d9[_0x352b('0x25')]=LISTID;_0x3ab5d9[_0x352b('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x352b('0x27')]&&_0x544e9c){var _0xbfcc0={};for(var _0x2f8d14=0x0,_0x122acf=DUPLICATES['length'];_0x2f8d14<_0x122acf;_0x2f8d14+=0x1){_0xbfcc0[DUPLICATES[_0x2f8d14]]=_0x3ab5d9[DUPLICATES[_0x2f8d14]];}var _0x206cfe=_[_0x352b('0x28')](_0x544e9c,_0xbfcc0);if(_0x206cfe){return _0x4bee42(handleCheckRowError(_0x352b('0x29'),_0x352b('0x2a'),_0x206cfe,_0x501267));}}return db[_0x352b('0x2b')][_0x352b('0x2c')](_0x3ab5d9,{'raw':!![],'hooks':![],'fields':_[_0x352b('0x2d')](_0x3ab5d9)})[_0x352b('0x2e')](function(_0x1d5756){if(DUPLICATES&&DUPLICATES['length']&&_0x544e9c){_0x544e9c[_0x352b('0x2f')](_['pick'](_0x3ab5d9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1d5756['id'];return _0x57dfa5();})[_0x352b('0x30')](function(_0x551f2c){return _0x4bee42(handleCheckRowError(_0x352b('0x15'),_0x352b('0x31')+(_0x551f2c['message']||JSON[_0x352b('0x32')](_0x551f2c)),null,_0x501267));});});}function checkHopper(){function _0x3cfdb9(){return function(_0x4a01af){logger[_0x352b('0x15')](_0x352b('0x33'),_0x352b('0x34'),util[_0x352b('0x35')](_0x4a01af,{'showHidden':![],'depth':null}));};}var _0x2b0bb3=function(_0x440a63,_0x272176){var _0x290165=squel[_0x352b('0x36')]()[_0x352b('0x37')]('cm_hopper')[_0x352b('0x38')](['phone','scheduledAt','ContactId',_0x352b('0x25'),_0x272176,_0x352b('0x39'),'updatedAt'],squel[_0x352b('0x3a')]()['field'](_0x352b('0x3b'),_0x352b('0x3b'))[_0x352b('0x3c')](_0x352b('0x3d'),_0x352b('0x3e'))[_0x352b('0x3c')]('id','ContactId')[_0x352b('0x3c')](LISTID[_0x352b('0x3f')](),'ListId')['field'](_0x440a63['id']['toString'](),_0x272176)[_0x352b('0x3c')](_0x352b('0x3d'),'createdAt')['field']('NOW()',_0x352b('0x40'))[_0x352b('0x41')]('cm_contacts')[_0x352b('0x42')](_0x352b('0x43'))[_0x352b('0x42')](_0x352b('0x44'),LISTID[_0x352b('0x3f')]())['where'](_0x352b('0x45'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x352b('0x3a')]()[_0x352b('0x3c')](_0x352b('0x3b'))[_0x352b('0x41')](_0x352b('0x46'))[_0x352b('0x42')](_0x272176+_0x352b('0x47'),_0x440a63['id'][_0x352b('0x3f')]())))[_0x352b('0x3f')]();return _0x290165;};var _0x5adf2b=function(_0x101788,_0x3ec1d0){var _0x53a24d=squel[_0x352b('0x36')]()[_0x352b('0x37')]('cm_hopper')[_0x352b('0x38')]([_0x352b('0x3b'),_0x352b('0x3e'),_0x352b('0x48'),'ListId',_0x3ec1d0,'createdAt',_0x352b('0x40')],squel[_0x352b('0x3a')]()[_0x352b('0x3c')]('phone',_0x352b('0x3b'))['field']('NOW()','scheduledAt')[_0x352b('0x3c')]('id','ContactId')['field'](LISTID[_0x352b('0x3f')](),_0x352b('0x25'))[_0x352b('0x3c')](_0x101788['id'][_0x352b('0x3f')](),_0x3ec1d0)[_0x352b('0x3c')]('NOW()',_0x352b('0x39'))[_0x352b('0x3c')](_0x352b('0x3d'),_0x352b('0x40'))[_0x352b('0x41')](_0x352b('0x49'))['where']('deletedAt\x20IS\x20NULL')[_0x352b('0x42')](_0x352b('0x44'),LISTID[_0x352b('0x3f')]())['where']('id\x20IN\x20?',squel[_0x352b('0x4a')](hopperContacts))[_0x352b('0x42')](_0x352b('0x45'))[_0x352b('0x42')](_0x352b('0x4b'),squel['select']()[_0x352b('0x3c')]('calleridnum')['from'](_0x352b('0x4c'))[_0x352b('0x42')](_0x3ec1d0+'\x20=\x20?',_0x101788['id'][_0x352b('0x3f')]()))[_0x352b('0x42')](_0x352b('0x4b'),squel[_0x352b('0x3a')]()[_0x352b('0x3c')](_0x352b('0x3b'))[_0x352b('0x41')](_0x352b('0x46'))['where'](_0x3ec1d0+_0x352b('0x47'),_0x101788['id']['toString']())))[_0x352b('0x3f')]();return _0x53a24d;};function _0x1e56f3(_0x36a2a5,_0x2e4f92){var _0x569954=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone',_0x352b('0x3e'),_0x352b('0x48'),_0x352b('0x25'),_0x2e4f92,_0x352b('0x39'),_0x352b('0x40')],squel['select']()[_0x352b('0x3c')](_0x352b('0x3b'),_0x352b('0x3b'))[_0x352b('0x3c')]('NOW()',_0x352b('0x3e'))[_0x352b('0x3c')]('id',_0x352b('0x48'))[_0x352b('0x3c')](LISTID['toString'](),_0x352b('0x25'))[_0x352b('0x3c')](_0x36a2a5['id']['toString'](),_0x2e4f92)['field'](_0x352b('0x3d'),_0x352b('0x39'))['field']('NOW()','updatedAt')[_0x352b('0x41')]('cm_contacts')['where'](_0x352b('0x43'))[_0x352b('0x42')](_0x352b('0x44'),LISTID['toString']())[_0x352b('0x42')](_0x352b('0x4d'),squel[_0x352b('0x4a')](hopperContacts))['where'](_0x352b('0x45')))[_0x352b('0x3f')]();return _0x569954;}function _0x40f7e3(_0x13cd26,_0x282460){var _0x42b376=squel[_0x352b('0x36')]()['into']('cm_hopper_black')['fromQuery']([_0x352b('0x3b'),_0x352b('0x48'),_0x352b('0x25'),_0x282460,_0x352b('0x39'),_0x352b('0x40')],squel[_0x352b('0x3a')]()['field'](_0x352b('0x3b'),_0x352b('0x3b'))['field']('id',_0x352b('0x48'))[_0x352b('0x3c')](LISTID[_0x352b('0x3f')](),'ListId')[_0x352b('0x3c')](_0x13cd26['id'][_0x352b('0x3f')](),_0x282460)['field'](_0x352b('0x3d'),_0x352b('0x39'))[_0x352b('0x3c')](_0x352b('0x3d'),_0x352b('0x40'))[_0x352b('0x41')]('cm_contacts')[_0x352b('0x42')]('deletedAt\x20IS\x20NULL')[_0x352b('0x42')](_0x352b('0x44'),LISTID[_0x352b('0x3f')]())[_0x352b('0x42')](_0x352b('0x4d'),squel[_0x352b('0x4a')](hopperContacts))[_0x352b('0x42')](_0x352b('0x45')))['toString']();return _0x42b376;}return db[_0x352b('0x4e')]['findAll']({'where':{'type':_0x352b('0x4f')},'attributes':['id',_0x352b('0x50')],'include':[{'model':db['CmList'],'as':_0x352b('0x51'),'where':{'id':LISTID}}]})[_0x352b('0x2e')](function(_0x12e358){var _0x26f201=[];if(_0x12e358){var _0x43523f;for(var _0x350858=0x0,_0x401d0b;_0x350858<_0x12e358[_0x352b('0x27')];_0x350858+=0x1){_0x401d0b=_0x12e358[_0x350858][_0x352b('0x52')]({'plain':!![]});switch(_0x401d0b['dialCheckDuplicateType']){case'always':_0x26f201[_0x352b('0x2f')](db['sequelize']['query'](_0x5adf2b(_0x401d0b,_0x352b('0x53')))[_0x352b('0x2e')](function(){})[_0x352b('0x30')](_0x3cfdb9()));break;case _0x352b('0x54'):_0x26f201[_0x352b('0x2f')](db[_0x352b('0x55')][_0x352b('0x56')](_0x2b0bb3(_0x401d0b,_0x352b('0x53')))['then'](function(){})['catch'](_0x3cfdb9()));break;default:_0x26f201[_0x352b('0x2f')](db[_0x352b('0x55')]['query'](_0x1e56f3(_0x401d0b,'VoiceQueueId'))[_0x352b('0x2e')](function(){})[_0x352b('0x30')](_0x3cfdb9()));}}}return _0x26f201;})['all']()[_0x352b('0x2e')](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x352b('0x57')],'as':_0x352b('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x1dd801){var _0x3765dd=[];if(_0x1dd801){var _0x25ce73;for(var _0x46588a=0x0,_0x96fefb;_0x46588a<_0x1dd801['length'];_0x46588a+=0x1){_0x96fefb=_0x1dd801[_0x46588a][_0x352b('0x52')]({'plain':!![]});_0x3765dd['push'](db[_0x352b('0x55')][_0x352b('0x56')](_0x40f7e3(_0x96fefb,'VoiceQueueId'))[_0x352b('0x2e')](function(){})['catch'](_0x3cfdb9()));}}return _0x3765dd;})[_0x352b('0x59')]();})[_0x352b('0x2e')](function(){return db[_0x352b('0x5a')][_0x352b('0x5b')]({'attributes':['id',_0x352b('0x50')],'include':[{'model':db[_0x352b('0x57')],'as':_0x352b('0x51'),'where':{'id':LISTID}}]})[_0x352b('0x2e')](function(_0x2e662d){var _0x5cac65=[];if(_0x2e662d){for(var _0x4c2c5f=0x0,_0x5422a2;_0x4c2c5f<_0x2e662d['length'];_0x4c2c5f+=0x1){_0x5422a2=_0x2e662d[_0x4c2c5f][_0x352b('0x52')]({'plain':!![]});switch(_0x5422a2[_0x352b('0x50')]){case'always':_0x5cac65['push'](db['sequelize'][_0x352b('0x56')](_0x5adf2b(_0x5422a2,'CampaignId'))[_0x352b('0x2e')](function(){})[_0x352b('0x30')](_0x3cfdb9()));break;case _0x352b('0x54'):_0x5cac65[_0x352b('0x2f')](db['sequelize']['query'](_0x2b0bb3(_0x5422a2,_0x352b('0x5c')))[_0x352b('0x2e')](function(){})[_0x352b('0x30')](_0x3cfdb9()));break;default:_0x5cac65[_0x352b('0x2f')](db[_0x352b('0x55')][_0x352b('0x56')](_0x1e56f3(_0x5422a2,_0x352b('0x5c')))[_0x352b('0x2e')](function(){})['catch'](_0x3cfdb9()));}}}return _0x5cac65;})[_0x352b('0x59')]();})[_0x352b('0x2e')](function(){return db['Campaign'][_0x352b('0x5b')]({'attributes':['id'],'include':[{'model':db[_0x352b('0x57')],'as':_0x352b('0x58'),'where':{'id':LISTID}}]})[_0x352b('0x2e')](function(_0x2a709b){var _0x1a0bd0=[];if(_0x2a709b){for(var _0x386081=0x0,_0x22d17f;_0x386081<_0x2a709b['length'];_0x386081+=0x1){_0x22d17f=_0x2a709b[_0x386081][_0x352b('0x52')]({'plain':!![]});_0x1a0bd0['push'](db[_0x352b('0x55')][_0x352b('0x56')](_0x40f7e3(_0x22d17f,_0x352b('0x5c')))[_0x352b('0x2e')](function(){})[_0x352b('0x30')](_0x3cfdb9()));}}return _0x1a0bd0;})[_0x352b('0x59')]();})['catch'](function(_0x4d13a8){logger[_0x352b('0x15')](_0x352b('0x5d'),'generalCheckHopper',_0x4d13a8[_0x352b('0x1b')]);});}var processPromises=function(_0xc3ce52){return BPromise['all'](promises)['then'](function(_0x436c61){})[_0x352b('0x30')](function(_0x2ff8dd){logger['error'](_0x352b('0x5e'),JSON[_0x352b('0x32')](_0x2ff8dd));})[_0x352b('0x5f')](function(){socket[_0x352b('0x60')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xc3ce52){return _0xc3ce52[_0x352b('0x61')]();}});};var endCsv=function(){return BPromise[_0x352b('0x62')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x352b('0x2e')](function(){socket[_0x352b('0x60')](_0x352b('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x35a466){logger[_0x352b('0x15')](_0x352b('0x64'),JSON[_0x352b('0x32')](_0x35a466));}finally{process[_0x352b('0x65')](0x0);}});};process['on'](_0x352b('0x66'),function(){logger['info'](_0x352b('0x67'));endCsv();});function main(){return BPromise['resolve']()[_0x352b('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x352b('0x14')](',');return db[_0x352b('0x2b')][_0x352b('0x5b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x352b('0x2e')](function(_0x643b67){var _0x5d6ff7=fs[_0x352b('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x352b('0x69')](_0x5d6ff7,{'header':!![],'skipEmptyLines':!![],'step':function(_0x513922,_0x1b2e6d){total+=0x1;var _0x10c68e=total;promises[_0x352b('0x2f')](checkRow(_0x513922,_0x643b67,_0x10c68e)['then'](function(){success+=0x1;})[_0x352b('0x30')](function(_0x146c4b){if(_0x146c4b['error']){errors+=0x1;delete _0x146c4b['error'];}else if(_0x146c4b['duplicate']){duplicates+=0x1;delete _0x146c4b[_0x352b('0x29')];}rows[_0x352b('0x2f')](_0x146c4b);}));if(total%0xc8===0x0){_0x1b2e6d[_0x352b('0x6a')]();return processPromises(_0x1b2e6d);}},'complete':function(){return processPromises()[_0x352b('0x2e')](function(){logger[_0x352b('0x6b')](_0x352b('0x6c'));endCsv();});},'error':function(_0x34ed75,_0x24209b){logger[_0x352b('0x6b')](_0x352b('0x6d'),JSON[_0x352b('0x32')](_0x34ed75));endCsv();}});})[_0x352b('0x30')](function(_0x443f94){logger[_0x352b('0x15')](_0x352b('0x6e'),JSON[_0x352b('0x32')](_0x443f94));});}main(); \ No newline at end of file +var _0xb0bc=['inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','str','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','id\x20IN\x20?','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','findAll','CmList','BlackLists','Campaign','CampaignId','all','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','papaparse','../../../mysqldb','../../../config/logger','api','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','checkHopper'];(function(_0x185d5d,_0x50d5c9){var _0x3097fe=function(_0x34dad4){while(--_0x34dad4){_0x185d5d['push'](_0x185d5d['shift']());}};_0x3097fe(++_0x50d5c9);}(_0xb0bc,0xa8));var _0xcb0b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb0bc[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0xcb0b('0x0'));var util=require(_0xcb0b('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0xcb0b('0x2'));var Redis=require('ioredis');var db=require(_0xcb0b('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0xcb0b('0x4'))(_0xcb0b('0x5'));config[_0xcb0b('0x6')]=_['defaults'](config[_0xcb0b('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb0b('0x6')]));require(_0xcb0b('0x7'))[_0xcb0b('0x8')](socket);try{if(!process[_0xcb0b('0x9')][0x2]||process['argv'][0x2]===_0xcb0b('0xa')||process[_0xcb0b('0x9')][0x2]===_0xcb0b('0xb')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xcb0b('0x9')][0x2];if(!process['argv'][0x3]||process[_0xcb0b('0x9')][0x3]===_0xcb0b('0xa')||process[_0xcb0b('0x9')][0x3]==='null'||!process[_0xcb0b('0x9')][0x4]||process['argv'][0x4]===_0xcb0b('0xa')||process[_0xcb0b('0x9')][0x4]===_0xcb0b('0xb')){throw new Error(_0xcb0b('0xc'));}var FIELDS=_[_0xcb0b('0xd')](process[_0xcb0b('0x9')][0x3][_0xcb0b('0xe')](','),process[_0xcb0b('0x9')][0x4][_0xcb0b('0xe')](','));if(!process[_0xcb0b('0x9')][0x5]||process['argv'][0x5]==='undefined'||process[_0xcb0b('0x9')][0x5]===_0xcb0b('0xb')){throw new Error(_0xcb0b('0xf'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xcb0b('0x9')][0x6]&&process[_0xcb0b('0x9')][0x6]!==_0xcb0b('0xa')&&process[_0xcb0b('0x9')][0x6]!==_0xcb0b('0xb')?process[_0xcb0b('0x9')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xcb0b('0x9')][0x7]!==_0xcb0b('0xa')&&process[_0xcb0b('0x9')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0xcb0b('0x9')][0x8]||process['argv'][0x8]==='undefined'||process[_0xcb0b('0x9')][0x8]==='null'){throw new Error(_0xcb0b('0x10'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2c2137){logger['error'](_0x2c2137);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(_0x2c1c5a,_0x1574a8,_0x463ca6,_0x58bc1a){var _0x5179c1={'message':_0x1574a8};_0x5179c1[_0x2c1c5a]=!![];if(_0x463ca6){_0x5179c1['contact']=_0x463ca6;}if(_0x58bc1a){_0x5179c1[_0xcb0b('0x11')]=_0x58bc1a;}return _0x5179c1;}function isEmail(_0x4286f6){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))*$/[_0xcb0b('0x12')](_0x4286f6);}function checkRow(_0x4f2682,_0x25b16f,_0x59ed5f){return new BPromise(function(_0x1594b9,_0xf9a1de){if(_[_0xcb0b('0x13')](_0x4f2682)){return _0xf9a1de(handleCheckRowError(_0xcb0b('0x14'),_0xcb0b('0x15'),null,_0x59ed5f));}if(_0x4f2682[_0xcb0b('0x16')]&&_0x4f2682[_0xcb0b('0x16')][_0xcb0b('0x17')]){var _0x3ab23b=_[_0xcb0b('0x18')](_0x4f2682[_0xcb0b('0x16')],_0xcb0b('0x19'))[_0xcb0b('0x1a')](';');return _0xf9a1de(handleCheckRowError('error',_0x3ab23b,null,_0x59ed5f));}var _0x5aa643={};for(var _0x1e33fb in FIELDS){if(FIELDS[_0xcb0b('0x1b')](_0x1e33fb)&&FIELDS[_0x1e33fb]){_0x5aa643[_0x1e33fb]=_0x4f2682['data'][0x0][FIELDS[_0x1e33fb]]||_0x4f2682[_0xcb0b('0x1c')][0x0]['\ufeff'+FIELDS[_0x1e33fb]];}}if(!_0x5aa643[_0xcb0b('0x1d')]){return _0xf9a1de(handleCheckRowError(_0xcb0b('0x14'),_0xcb0b('0x1e'),null,_0x59ed5f));}if(!_0x5aa643[_0xcb0b('0x1f')]){return _0xf9a1de(handleCheckRowError(_0xcb0b('0x14'),_0xcb0b('0x20'),null,_0x59ed5f));}if(_0x5aa643[_0xcb0b('0x21')]){var _0x20cafe=moment(_0x5aa643[_0xcb0b('0x21')],_0xcb0b('0x22'));if(!_0x20cafe[_0xcb0b('0x23')]()){return _0xf9a1de(handleCheckRowError(_0xcb0b('0x14'),_0xcb0b('0x24'),null,_0x59ed5f));}}if(_0x5aa643[_0xcb0b('0x25')]){if(!isEmail(_0x5aa643[_0xcb0b('0x25')])){return _0xf9a1de(handleCheckRowError(_0xcb0b('0x14'),_0xcb0b('0x26'),null,_0x59ed5f));}}_0x5aa643[_0xcb0b('0x27')]=LISTID;_0x5aa643[_0xcb0b('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xcb0b('0x17')]&&_0x25b16f){var _0x19bcf0={};for(var _0x3943ab=0x0,_0x262693=DUPLICATES[_0xcb0b('0x17')];_0x3943ab<_0x262693;_0x3943ab+=0x1){_0x19bcf0[DUPLICATES[_0x3943ab]]=_0x5aa643[DUPLICATES[_0x3943ab]];}var _0x97587e=_[_0xcb0b('0x29')](_0x25b16f,_0x19bcf0);if(_0x97587e){return _0xf9a1de(handleCheckRowError('duplicate',_0xcb0b('0x2a'),_0x97587e,_0x59ed5f));}}return db[_0xcb0b('0x2b')][_0xcb0b('0x2c')](_0x5aa643,{'raw':!![],'hooks':![],'fields':_[_0xcb0b('0x2d')](_0x5aa643)})[_0xcb0b('0x2e')](function(_0x67930f){if(DUPLICATES&&DUPLICATES[_0xcb0b('0x17')]&&_0x25b16f){_0x25b16f[_0xcb0b('0x2f')](_[_0xcb0b('0x30')](_0x5aa643,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x67930f['id'];return _0x1594b9();})[_0xcb0b('0x31')](function(_0x1c3d3a){return _0xf9a1de(handleCheckRowError(_0xcb0b('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1c3d3a[_0xcb0b('0x19')]||JSON[_0xcb0b('0x32')](_0x1c3d3a)),null,_0x59ed5f));});});}function checkHopper(){function _0x40fc74(){return function(_0x26936b){logger[_0xcb0b('0x14')]('cmContact',_0xcb0b('0x33'),util[_0xcb0b('0x34')](_0x26936b,{'showHidden':![],'depth':null}));};}var _0x514913=function(_0x161e3a,_0x407dca){var _0x1ce28c=squel[_0xcb0b('0x35')]()[_0xcb0b('0x36')](_0xcb0b('0x37'))[_0xcb0b('0x38')]([_0xcb0b('0x1f'),_0xcb0b('0x39'),_0xcb0b('0x3a'),_0xcb0b('0x27'),_0x407dca,_0xcb0b('0x3b'),_0xcb0b('0x3c')],squel[_0xcb0b('0x3d')]()['field'](_0xcb0b('0x1f'),_0xcb0b('0x1f'))[_0xcb0b('0x3e')](_0xcb0b('0x3f'),'scheduledAt')[_0xcb0b('0x3e')]('id',_0xcb0b('0x3a'))[_0xcb0b('0x3e')](LISTID[_0xcb0b('0x40')](),_0xcb0b('0x27'))[_0xcb0b('0x3e')](_0x161e3a['id'][_0xcb0b('0x40')](),_0x407dca)['field']('NOW()',_0xcb0b('0x3b'))[_0xcb0b('0x3e')]('NOW()',_0xcb0b('0x3c'))[_0xcb0b('0x41')](_0xcb0b('0x42'))['where'](_0xcb0b('0x43'))[_0xcb0b('0x44')](_0xcb0b('0x45'),LISTID[_0xcb0b('0x40')]())['where'](_0xcb0b('0x46'))[_0xcb0b('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0xcb0b('0x3d')]()[_0xcb0b('0x3e')](_0xcb0b('0x1f'))[_0xcb0b('0x41')]('cm_hopper')[_0xcb0b('0x44')](_0x407dca+_0xcb0b('0x47'),_0x161e3a['id'][_0xcb0b('0x40')]())))[_0xcb0b('0x40')]();return _0x1ce28c;};var _0x152f95=function(_0x42c768,_0x189904){var _0x582cda=squel[_0xcb0b('0x35')]()['into'](_0xcb0b('0x37'))[_0xcb0b('0x38')]([_0xcb0b('0x1f'),_0xcb0b('0x39'),_0xcb0b('0x3a'),_0xcb0b('0x27'),_0x189904,'createdAt',_0xcb0b('0x3c')],squel[_0xcb0b('0x3d')]()[_0xcb0b('0x3e')](_0xcb0b('0x1f'),_0xcb0b('0x1f'))[_0xcb0b('0x3e')]('NOW()',_0xcb0b('0x39'))[_0xcb0b('0x3e')]('id',_0xcb0b('0x3a'))[_0xcb0b('0x3e')](LISTID[_0xcb0b('0x40')](),'ListId')['field'](_0x42c768['id'][_0xcb0b('0x40')](),_0x189904)['field'](_0xcb0b('0x3f'),'createdAt')['field'](_0xcb0b('0x3f'),_0xcb0b('0x3c'))[_0xcb0b('0x41')](_0xcb0b('0x42'))[_0xcb0b('0x44')](_0xcb0b('0x43'))[_0xcb0b('0x44')]('ListId\x20=\x20?',LISTID[_0xcb0b('0x40')]())[_0xcb0b('0x44')]('id\x20IN\x20?',squel[_0xcb0b('0x48')](hopperContacts))['where'](_0xcb0b('0x46'))[_0xcb0b('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0xcb0b('0x3d')]()[_0xcb0b('0x3e')](_0xcb0b('0x49'))['from'](_0xcb0b('0x4a'))[_0xcb0b('0x44')](_0x189904+_0xcb0b('0x47'),_0x42c768['id'][_0xcb0b('0x40')]()))['where'](_0xcb0b('0x4b'),squel[_0xcb0b('0x3d')]()[_0xcb0b('0x3e')](_0xcb0b('0x1f'))[_0xcb0b('0x41')](_0xcb0b('0x37'))['where'](_0x189904+'\x20=\x20?',_0x42c768['id'][_0xcb0b('0x40')]())))[_0xcb0b('0x40')]();return _0x582cda;};function _0x704e37(_0xf18ec3,_0x1a2344){var _0x258d3b=squel[_0xcb0b('0x35')]()['into'](_0xcb0b('0x37'))[_0xcb0b('0x38')]([_0xcb0b('0x1f'),'scheduledAt',_0xcb0b('0x3a'),_0xcb0b('0x27'),_0x1a2344,_0xcb0b('0x3b'),_0xcb0b('0x3c')],squel['select']()['field'](_0xcb0b('0x1f'),_0xcb0b('0x1f'))[_0xcb0b('0x3e')](_0xcb0b('0x3f'),'scheduledAt')[_0xcb0b('0x3e')]('id',_0xcb0b('0x3a'))[_0xcb0b('0x3e')](LISTID[_0xcb0b('0x40')](),_0xcb0b('0x27'))[_0xcb0b('0x3e')](_0xf18ec3['id'][_0xcb0b('0x40')](),_0x1a2344)['field']('NOW()',_0xcb0b('0x3b'))['field']('NOW()','updatedAt')['from'](_0xcb0b('0x42'))[_0xcb0b('0x44')](_0xcb0b('0x43'))[_0xcb0b('0x44')](_0xcb0b('0x45'),LISTID[_0xcb0b('0x40')]())[_0xcb0b('0x44')](_0xcb0b('0x4c'),squel[_0xcb0b('0x48')](hopperContacts))[_0xcb0b('0x44')](_0xcb0b('0x46')))[_0xcb0b('0x40')]();return _0x258d3b;}function _0x5bd11a(_0x25af28,_0x2caedb){var _0x43de78=squel[_0xcb0b('0x35')]()[_0xcb0b('0x36')](_0xcb0b('0x4d'))[_0xcb0b('0x38')]([_0xcb0b('0x1f'),_0xcb0b('0x3a'),'ListId',_0x2caedb,'createdAt',_0xcb0b('0x3c')],squel[_0xcb0b('0x3d')]()[_0xcb0b('0x3e')](_0xcb0b('0x1f'),_0xcb0b('0x1f'))['field']('id','ContactId')[_0xcb0b('0x3e')](LISTID['toString'](),'ListId')['field'](_0x25af28['id'][_0xcb0b('0x40')](),_0x2caedb)[_0xcb0b('0x3e')](_0xcb0b('0x3f'),'createdAt')['field'](_0xcb0b('0x3f'),_0xcb0b('0x3c'))[_0xcb0b('0x41')](_0xcb0b('0x42'))[_0xcb0b('0x44')]('deletedAt\x20IS\x20NULL')[_0xcb0b('0x44')](_0xcb0b('0x45'),LISTID[_0xcb0b('0x40')]())[_0xcb0b('0x44')](_0xcb0b('0x4c'),squel[_0xcb0b('0x48')](hopperContacts))[_0xcb0b('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0xcb0b('0x40')]();return _0x43de78;}return db[_0xcb0b('0x4e')]['findAll']({'where':{'type':_0xcb0b('0x4f')},'attributes':['id',_0xcb0b('0x50')],'include':[{'model':db['CmList'],'as':_0xcb0b('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x4dea6a){var _0x2370d2=[];if(_0x4dea6a){var _0x273c62;for(var _0x2f3e6b=0x0,_0x1a0793;_0x2f3e6b<_0x4dea6a[_0xcb0b('0x17')];_0x2f3e6b+=0x1){_0x1a0793=_0x4dea6a[_0x2f3e6b][_0xcb0b('0x52')]({'plain':!![]});switch(_0x1a0793[_0xcb0b('0x50')]){case _0xcb0b('0x53'):_0x2370d2[_0xcb0b('0x2f')](db['sequelize'][_0xcb0b('0x54')](_0x152f95(_0x1a0793,_0xcb0b('0x55')))[_0xcb0b('0x2e')](function(){})[_0xcb0b('0x31')](_0x40fc74()));break;case _0xcb0b('0x56'):_0x2370d2[_0xcb0b('0x2f')](db[_0xcb0b('0x57')]['query'](_0x514913(_0x1a0793,_0xcb0b('0x55')))[_0xcb0b('0x2e')](function(){})[_0xcb0b('0x31')](_0x40fc74()));break;default:_0x2370d2[_0xcb0b('0x2f')](db[_0xcb0b('0x57')][_0xcb0b('0x54')](_0x704e37(_0x1a0793,_0xcb0b('0x55')))[_0xcb0b('0x2e')](function(){})[_0xcb0b('0x31')](_0x40fc74()));}}}return _0x2370d2;})['all']()['then'](function(){return db['VoiceQueue'][_0xcb0b('0x58')]({'where':{'type':_0xcb0b('0x4f')},'attributes':['id'],'include':[{'model':db[_0xcb0b('0x59')],'as':_0xcb0b('0x5a'),'where':{'id':LISTID}}]})[_0xcb0b('0x2e')](function(_0x47d478){var _0x43a5cc=[];if(_0x47d478){var _0x216cbc;for(var _0x31b380=0x0,_0x49ec99;_0x31b380<_0x47d478['length'];_0x31b380+=0x1){_0x49ec99=_0x47d478[_0x31b380][_0xcb0b('0x52')]({'plain':!![]});_0x43a5cc[_0xcb0b('0x2f')](db[_0xcb0b('0x57')][_0xcb0b('0x54')](_0x5bd11a(_0x49ec99,'VoiceQueueId'))[_0xcb0b('0x2e')](function(){})[_0xcb0b('0x31')](_0x40fc74()));}}return _0x43a5cc;})['all']();})[_0xcb0b('0x2e')](function(){return db[_0xcb0b('0x5b')][_0xcb0b('0x58')]({'attributes':['id',_0xcb0b('0x50')],'include':[{'model':db[_0xcb0b('0x59')],'as':'Lists','where':{'id':LISTID}}]})[_0xcb0b('0x2e')](function(_0xfc1214){var _0x588dbf=[];if(_0xfc1214){for(var _0x30b36f=0x0,_0x298ba4;_0x30b36f<_0xfc1214[_0xcb0b('0x17')];_0x30b36f+=0x1){_0x298ba4=_0xfc1214[_0x30b36f][_0xcb0b('0x52')]({'plain':!![]});switch(_0x298ba4['dialCheckDuplicateType']){case _0xcb0b('0x53'):_0x588dbf[_0xcb0b('0x2f')](db['sequelize']['query'](_0x152f95(_0x298ba4,'CampaignId'))[_0xcb0b('0x2e')](function(){})['catch'](_0x40fc74()));break;case _0xcb0b('0x56'):_0x588dbf[_0xcb0b('0x2f')](db['sequelize']['query'](_0x514913(_0x298ba4,'CampaignId'))[_0xcb0b('0x2e')](function(){})[_0xcb0b('0x31')](_0x40fc74()));break;default:_0x588dbf['push'](db[_0xcb0b('0x57')][_0xcb0b('0x54')](_0x704e37(_0x298ba4,'CampaignId'))[_0xcb0b('0x2e')](function(){})[_0xcb0b('0x31')](_0x40fc74()));}}}return _0x588dbf;})['all']();})['then'](function(){return db[_0xcb0b('0x5b')][_0xcb0b('0x58')]({'attributes':['id'],'include':[{'model':db[_0xcb0b('0x59')],'as':_0xcb0b('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x2250ac){var _0x4dd51f=[];if(_0x2250ac){for(var _0x1dd8d5=0x0,_0x243ebc;_0x1dd8d5<_0x2250ac['length'];_0x1dd8d5+=0x1){_0x243ebc=_0x2250ac[_0x1dd8d5][_0xcb0b('0x52')]({'plain':!![]});_0x4dd51f[_0xcb0b('0x2f')](db[_0xcb0b('0x57')][_0xcb0b('0x54')](_0x5bd11a(_0x243ebc,_0xcb0b('0x5c')))[_0xcb0b('0x2e')](function(){})[_0xcb0b('0x31')](_0x40fc74()));}}return _0x4dd51f;})[_0xcb0b('0x5d')]();})['catch'](function(_0x3fe0d4){logger['error'](_0xcb0b('0x5e'),_0xcb0b('0x5f'),_0x3fe0d4['message']);});}var processPromises=function(_0x5457bb){return BPromise[_0xcb0b('0x5d')](promises)[_0xcb0b('0x2e')](function(_0x13bc9d){})[_0xcb0b('0x31')](function(_0x5c54d3){logger[_0xcb0b('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0xcb0b('0x32')](_0x5c54d3));})[_0xcb0b('0x60')](function(){socket[_0xcb0b('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5457bb){return _0x5457bb['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0xcb0b('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0xcb0b('0x2e')](function(){socket[_0xcb0b('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcb0b('0x62')](FILEPATH);}catch(_0x343c18){logger[_0xcb0b('0x14')](_0xcb0b('0x63'),JSON[_0xcb0b('0x32')](_0x343c18));}finally{process[_0xcb0b('0x64')](0x0);}});};process['on'](_0xcb0b('0x65'),function(){logger[_0xcb0b('0x66')](_0xcb0b('0x67'));endCsv();});function main(){return BPromise[_0xcb0b('0x68')]()[_0xcb0b('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcb0b('0xe')](',');return db[_0xcb0b('0x2b')][_0xcb0b('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcb0b('0x2e')](function(_0x2ee95e){var _0x3bcfd9=fs[_0xcb0b('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xcb0b('0x6a')](_0x3bcfd9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x55ce08,_0x1a2599){total+=0x1;var _0x5e2bfd=total;promises[_0xcb0b('0x2f')](checkRow(_0x55ce08,_0x2ee95e,_0x5e2bfd)[_0xcb0b('0x2e')](function(){success+=0x1;})['catch'](function(_0x561fbd){if(_0x561fbd[_0xcb0b('0x14')]){errors+=0x1;delete _0x561fbd[_0xcb0b('0x14')];}else if(_0x561fbd[_0xcb0b('0x6b')]){duplicates+=0x1;delete _0x561fbd[_0xcb0b('0x6b')];}rows['push'](_0x561fbd);}));if(total%0xc8===0x0){_0x1a2599[_0xcb0b('0x6c')]();return processPromises(_0x1a2599);}},'complete':function(){return processPromises()[_0xcb0b('0x2e')](function(){logger[_0xcb0b('0x66')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x20bf01,_0x3ee18a){logger['info']('CSV\x20parse\x20error',JSON[_0xcb0b('0x32')](_0x20bf01));endCsv();}});})[_0xcb0b('0x31')](function(_0x2f7bf5){logger['error'](_0xcb0b('0x6d'),JSON['stringify'](_0x2f7bf5));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index ba52b3f..6d23d67 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 _0x8ace=[')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','errors','code','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','dialTimezone','offset','set','main','stringify','binding','socket_timestamp','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','parse','createReadStream','data','rows','find','hasOwnProperty','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','trim','SystemRow','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','contactId','contactTypeId','orderBy','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','root','binding\x20doesn\x27t\x20exists','firstName','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','then','length','push','all','AdditionalPhones','split','isNil','filter','findOne','CmContactHasItem','update','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.UserId','insert','into','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','cm_contacts.updatedAt','fromQuery','createdAt','.CmListId','field','cm_hopper_black','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id','cm_contacts.priority','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys','CompanyId'];(function(_0x17fde2,_0x55ac13){var _0x20937b=function(_0x20a92d){while(--_0x20a92d){_0x17fde2['push'](_0x17fde2['shift']());}};_0x20937b(++_0x55ac13);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x2a05bf,_0x55e3a4){_0x2a05bf=_0x2a05bf-0x0;var _0x38a62e=_0x8ace[_0x2a05bf];return _0x38a62e;};'use strict';var fs=require('fs');var path=require(_0xe8ac('0x0'));var _=require(_0xe8ac('0x1'));var Papa=require(_0xe8ac('0x2'));var util=require(_0xe8ac('0x3'));var BPromise=require(_0xe8ac('0x4'));var moment=require(_0xe8ac('0x5'));var squel=require(_0xe8ac('0x6'));var Redis=require(_0xe8ac('0x7'));var db=require(_0xe8ac('0x8'))['db'];var config=require(_0xe8ac('0x9'));var shared=require(_0xe8ac('0xa'));var logger=require(_0xe8ac('0xb'))(_0xe8ac('0xc'));config[_0xe8ac('0xd')]=_['defaults'](config[_0xe8ac('0xd')],{'host':_0xe8ac('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xe8ac('0xf')]('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()[_0xe8ac('0xf')](_0xe8ac('0x10'));function isEmail(_0x19d9c8){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))*$/[_0xe8ac('0x11')](_0x19d9c8);}function selectNotIn(_0xa18ae1,_0x277ed8,_0x55219e,_0x22ae07,_0x2e3b25){return squel[_0xe8ac('0x12')]()['field'](_0xe8ac('0x13'))[_0xe8ac('0x14')](_0x22ae07)['join'](_0x277ed8,null,_0x277ed8+_0xe8ac('0x15')+_0x22ae07+'.'+_0x55219e)[_0xe8ac('0x16')](_0x22ae07+'.'+_0x55219e+_0xe8ac('0x17')+_0xa18ae1+'.'+_0x55219e)[_0xe8ac('0x16')](_0x277ed8+_0xe8ac('0x18')+_0x2e3b25[_0xe8ac('0x19')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1be138,_0x10609d){promisesAdditionalPhones=[];return db[_0xe8ac('0x1a')][_0xe8ac('0x1b')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xe8ac('0x1c')](function(_0x18ddb3){if(_0x18ddb3!==null){var _0x4c3c76=[];for(var _0xf219c=0x0;_0xf219c<_0x18ddb3[_0xe8ac('0x1d')];_0xf219c++){var _0x1421df=_0x18ddb3[_0xf219c];_0x4c3c76[_0xe8ac('0x1e')](insertAdditionalPhones(_0x1421df));}}Promise[_0xe8ac('0x1f')](_0x4c3c76)[_0xe8ac('0x1c')](function(){_0x1be138({'val':0x1});});});});}function insertAdditionalPhones(_0x4892d0){return new Promise(function(_0x59df3d,_0x5f3433){var _0x18cf29=_0x4892d0[_0xe8ac('0x20')];var _0x4e5d00=_0x18cf29[_0xe8ac('0x21')](';');var _0x5bc15e=[];orderBy=0x0;for(var _0xae385f=0x0;_0xae385f<_0x4e5d00[_0xe8ac('0x1d')];_0xae385f++){_0x5bc15e['push'](splitAdditionalPhone(_0x4892d0['id'],_0x4e5d00[_0xae385f]));}Promise[_0xe8ac('0x1f')](_0x5bc15e)[_0xe8ac('0x1c')](function(){_0x59df3d({'val':_0x4e5d00[_0xe8ac('0x1d')]});});});}function splitAdditionalPhone(_0x8b4a9a,_0x5c492c){return new Promise(function(_0x6a7dbd,_0x59a9ea){var _0x1eb5f1=_0x5c492c[_0xe8ac('0x21')](':');var _0x3c3a78=_0x1eb5f1[0x0];var _0x252440=_0x1eb5f1[0x1];if(!_[_0xe8ac('0x22')](_0x252440)){var _0x31956a=_0x252440[_0xe8ac('0x21')]('|');var _0x5726ef=[];for(var _0x1c3ea4=0x0;_0x1c3ea4<_0x31956a[_0xe8ac('0x1d')];_0x1c3ea4++){if(_0x31956a[_0x1c3ea4]!==''){var _0x183dbf=_[_0xe8ac('0x23')](promisesAdditionalPhones,{'contactId':_0x8b4a9a,'phone':_0x31956a[_0x1c3ea4]});if(_0x183dbf[_0xe8ac('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0xe8ac('0x1e')]({'contactId':_0x8b4a9a,'contactTypeId':_0x3c3a78,'phone':_0x31956a[_0x1c3ea4],'orderBy':orderBy});}}}_0x6a7dbd({'ok':0x1});}else _0x6a7dbd({'res':0x0});});}function createAdditionalPhone(_0x132dde,_0x3e3fc2,_0x44b07c,_0x562e44){var _0x5a1b69='';var _0x346dcb='';var _0xbef18f=_0x44b07c['split']('§');_0x5a1b69=_0xbef18f[0x0];if(_0xbef18f[_0xe8ac('0x1d')]==0x2)_0x346dcb=_0xbef18f[0x1];return new Promise(function(_0x5948aa,_0x54f94c){return db['CmContactHasItem'][_0xe8ac('0x24')]({'where':{'CmContactId':_0x132dde,'item':_0x5a1b69}})[_0xe8ac('0x1c')](function(_0x3798c5){if(_0x3798c5){return db[_0xe8ac('0x25')][_0xe8ac('0x26')]({'ItemTypeId':_0x3e3fc2,'description':_0x346dcb,'OrderBy':_0x562e44},{'where':{'CmContactId':_0x132dde,'item':_0x5a1b69}})[_0xe8ac('0x1c')](function(_0x1a2ef7){_0x5948aa({'res':'updated'});});}else{return db[_0xe8ac('0x25')]['create']({'CmContactId':_0x132dde,'item':_0x5a1b69,'description':_0x346dcb,'ItemTypeId':_0x3e3fc2,'OrderBy':_0x562e44,'ItemClass':_0xe8ac('0x27')})['then'](function(_0x498427){_0x5948aa({'res':'inserted'});});}});});}function insertCmHopper(_0x56b2e0,_0x347ca0,_0x2ca924,_0x301548,_0x29b92f){var _0x33b027=[_0xe8ac('0x28'),_0xe8ac('0x29'),'cm_contacts.id',_0xe8ac('0x2a'),_0x347ca0+'.'+_0x301548,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0xe8ac('0x2b'),'\x22'+_0x29b92f+'\x22'];return squel[_0xe8ac('0x2c')]()[_0xe8ac('0x2d')]('cm_hopper')['fromQuery']([_0xe8ac('0x13'),_0xe8ac('0x2e'),_0xe8ac('0x2f'),_0xe8ac('0x30'),_0x301548,'createdAt',_0xe8ac('0x31'),_0xe8ac('0x32'),_0xe8ac('0x33'),_0xe8ac('0x34')],squel[_0xe8ac('0x12')]()[_0xe8ac('0x35')](_0x33b027)[_0xe8ac('0x14')](_0x347ca0)['join'](_0xe8ac('0x36'),null,_0xe8ac('0x37')+_0x347ca0+'.CmListId')[_0xe8ac('0x19')](_0x2ca924,null,_0x2ca924+_0xe8ac('0x15')+_0x347ca0+'.'+_0x301548)[_0xe8ac('0x16')](_0x347ca0+_0xe8ac('0x38'),_0x56b2e0)['where'](_0xe8ac('0x39'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x347ca0,_0x2ca924,_0x301548,_0xe8ac('0x3a'),[_0xe8ac('0x3b'),_0xe8ac('0x3c')]))[_0xe8ac('0x16')](_0xe8ac('0x3d'),selectNotIn(_0x347ca0,_0x2ca924,_0x301548,_0xe8ac('0x3a'),[_0xe8ac('0x3b')])))[_0xe8ac('0x3e')]();}function insertCmHopperBlack(_0xc00aa0,_0x59d087,_0x4d99fc,_0x1fdf2f){var _0x10a9e8=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x59d087+'.'+_0x1fdf2f,_0xe8ac('0x3f'),_0xe8ac('0x40')];return squel[_0xe8ac('0x2c')]()[_0xe8ac('0x2d')]('cm_hopper_black')[_0xe8ac('0x41')]([_0xe8ac('0x13'),'ContactId',_0xe8ac('0x30'),_0x1fdf2f,_0xe8ac('0x42'),_0xe8ac('0x31')],squel[_0xe8ac('0x12')]()['fields'](_0x10a9e8)['from'](_0x59d087)['join'](_0xe8ac('0x36'),null,_0xe8ac('0x37')+_0x59d087+_0xe8ac('0x43'))[_0xe8ac('0x19')](_0x4d99fc,null,_0x4d99fc+'.id\x20=\x20'+_0x59d087+'.'+_0x1fdf2f)['where'](_0x59d087+_0xe8ac('0x38'),_0xc00aa0)[_0xe8ac('0x16')](_0xe8ac('0x39'),NOW)[_0xe8ac('0x16')](_0xe8ac('0x3d'),squel[_0xe8ac('0x12')]()[_0xe8ac('0x44')](_0xe8ac('0x13'))[_0xe8ac('0x14')](_0xe8ac('0x45'))[_0xe8ac('0x16')](_0xe8ac('0x46'),_0xc00aa0)[_0xe8ac('0x16')](_0x1fdf2f+_0xe8ac('0x17')+_0x59d087+'.'+_0x1fdf2f)))['toString']();}function insertTzCmHopper(_0xcd10e7,_0x575b1d,_0x5f0fc0,_0x50e65a,_0x51fefc,_0x368e31){var _0x54705c=[_0xe8ac('0x28'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x368e31+_0xe8ac('0x47'),_0xe8ac('0x48'),'cm_contacts.ListId',_0x575b1d+'.'+_0x50e65a,_0xe8ac('0x3f'),'cm_contacts.updatedAt',_0xe8ac('0x49'),_0xe8ac('0x2b'),'\x22'+_0x51fefc+'\x22'];var _0x386aca=squel['insert']()[_0xe8ac('0x2d')](_0xe8ac('0x3a'))[_0xe8ac('0x41')](['phone',_0xe8ac('0x2e'),_0xe8ac('0x2f'),_0xe8ac('0x30'),_0x50e65a,'createdAt',_0xe8ac('0x31'),'priority',_0xe8ac('0x33'),_0xe8ac('0x34')],squel[_0xe8ac('0x12')]()['fields'](_0x54705c)[_0xe8ac('0x14')](_0x575b1d)[_0xe8ac('0x19')](_0xe8ac('0x36'),null,_0xe8ac('0x37')+_0x575b1d+_0xe8ac('0x43'))[_0xe8ac('0x19')](_0x5f0fc0,null,_0x5f0fc0+_0xe8ac('0x15')+_0x575b1d+'.'+_0x50e65a)[_0xe8ac('0x19')](_0x368e31,null,_0x368e31+_0xe8ac('0x15')+_0x575b1d+'.'+_0x50e65a)[_0xe8ac('0x16')](_0x575b1d+'.CmListId\x20=\x20?',_0xcd10e7)[_0xe8ac('0x16')](_0xe8ac('0x39'),NOW)[_0xe8ac('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x575b1d,_0x5f0fc0,_0x50e65a,_0xe8ac('0x3a'),[_0xe8ac('0x3b'),_0xe8ac('0x3c')]))[_0xe8ac('0x16')](_0xe8ac('0x3d'),selectNotIn(_0x575b1d,_0x5f0fc0,_0x50e65a,_0xe8ac('0x3a'),[_0xe8ac('0x3b')])))[_0xe8ac('0x3e')]();return _0x386aca;}function insertTzCmHopperBlack(_0x227af8,_0x29fa3b,_0xf6ff7f,_0x53cf63){var _0x6d661f=[_0xe8ac('0x28'),_0xe8ac('0x48'),_0xe8ac('0x2a'),_0x29fa3b+'.'+_0x53cf63,_0xe8ac('0x3f'),_0xe8ac('0x40')];return squel[_0xe8ac('0x2c')]()[_0xe8ac('0x2d')](_0xe8ac('0x45'))[_0xe8ac('0x41')](['phone',_0xe8ac('0x2f'),_0xe8ac('0x30'),_0x53cf63,_0xe8ac('0x42'),'updatedAt'],squel[_0xe8ac('0x12')]()[_0xe8ac('0x35')](_0x6d661f)[_0xe8ac('0x14')](_0x29fa3b)[_0xe8ac('0x19')](_0xe8ac('0x36'),null,_0xe8ac('0x37')+_0x29fa3b+_0xe8ac('0x43'))[_0xe8ac('0x19')](_0xf6ff7f,null,_0xf6ff7f+_0xe8ac('0x15')+_0x29fa3b+'.'+_0x53cf63)[_0xe8ac('0x16')](_0x29fa3b+_0xe8ac('0x38'),_0x227af8)[_0xe8ac('0x16')](_0xe8ac('0x39'),NOW)['where'](_0xe8ac('0x3d'),squel[_0xe8ac('0x12')]()[_0xe8ac('0x44')]('phone')[_0xe8ac('0x14')]('cm_hopper_black')[_0xe8ac('0x16')](_0xe8ac('0x46'),_0x227af8)[_0xe8ac('0x16')](_0x53cf63+_0xe8ac('0x17')+_0x29fa3b+'.'+_0x53cf63)))[_0xe8ac('0x3e')]();}function insertCmHopperAdditionalPhones(_0x4a46fa){var _0x5d4e08=[_0xe8ac('0x4a'),_0xe8ac('0x4b'),_0xe8ac('0x4c'),'cm_contact_has_items.createdAt',_0xe8ac('0x4d')];return squel[_0xe8ac('0x2c')]()[_0xe8ac('0x2d')](_0xe8ac('0x4e'))[_0xe8ac('0x41')]([_0xe8ac('0x4f'),_0xe8ac('0x13'),'OrderBy',_0xe8ac('0x42'),_0xe8ac('0x31')],squel[_0xe8ac('0x12')]()[_0xe8ac('0x35')](_0x5d4e08)[_0xe8ac('0x14')](_0xe8ac('0x3a'))[_0xe8ac('0x19')](_0xe8ac('0x36'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0xe8ac('0x50'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0xe8ac('0x51'),_0x4a46fa)[_0xe8ac('0x16')](_0xe8ac('0x39'),NOW))['toString']();}function insertCmContact(_0x4878a6,_0x5a3bb8,_0x300c08,_0x53d727){var _0x30cadd=_['concat'](_[_0xe8ac('0x52')](_0x53d727),[_0xe8ac('0x30'),_0xe8ac('0x53'),_0xe8ac('0x42'),_0xe8ac('0x31')]);return squel[_0xe8ac('0x2c')]()[_0xe8ac('0x2d')](_0xe8ac('0x36'))[_0xe8ac('0x41')](_0x30cadd,squel['select']()[_0xe8ac('0x35')](_0x30cadd)[_0xe8ac('0x14')](_0x5a3bb8)[_0xe8ac('0x16')]('('+_0x300c08[_0xe8ac('0x19')](',')+_0xe8ac('0x54'),squel[_0xe8ac('0x12')]()['fields'](_0x300c08)['from'](_0xe8ac('0x36'))['where']('ListId\x20=\x20?',_0x4878a6)[_0xe8ac('0x16')](_0xe8ac('0x55')))['where'](_0xe8ac('0x56'),squel[_0xe8ac('0x12')]()[_0xe8ac('0x44')](_0xe8ac('0x57'),'min_id')[_0xe8ac('0x14')](_0x5a3bb8)[_0xe8ac('0x58')](_0x300c08[_0xe8ac('0x19')](','))))[_0xe8ac('0x3e')]();}function handleStop(){logger[_0xe8ac('0x59')](_0xe8ac('0x5a'));stopped=!![];}function handleUncaughtException(_0x21c50d){logger[_0xe8ac('0x5b')](_0x21c50d[_0xe8ac('0x5c')]);process['exit'](0x1);}function handleError(_0xea75ac,_0x107512){stats[_0xe8ac('0x5d')][_0xe8ac('0x1e')]({'name':_0x107512[_0xe8ac('0x5e')],'message':_0x107512['message'],'row':_0xea75ac});}function handleQuery(_0x1a218f){logger[_0xe8ac('0x59')](_0x1a218f);return db['sequelize'][_0xe8ac('0x5f')](_0x1a218f)[_0xe8ac('0x60')](function(_0x544709){results['push'](_0x544709);})[_0xe8ac('0x61')](function(_0xfc9db7){logger[_0xe8ac('0x5b')](_0xfc9db7[_0xe8ac('0x5c')]);});}function updateTzCampaigns(_0x1c06a1){return new Promise(function(_0x533eb3,_0x4b9bd1){var _0x52f58d=squel[_0xe8ac('0x12')]()[_0xe8ac('0x35')]([_0xe8ac('0x62'),_0xe8ac('0x63')])[_0xe8ac('0x14')]('campaigns')[_0xe8ac('0x19')](_0xe8ac('0x64'),null,_0xe8ac('0x65'))[_0xe8ac('0x16')](_0xe8ac('0x66')+_0x1c06a1);db[_0xe8ac('0x67')][_0xe8ac('0x5f')](_0x52f58d[_0xe8ac('0x3e')]())[_0xe8ac('0x60')](function(_0x484105){var _0x129a48=[];for(var _0x3399bf=0x0;_0x3399bf<_0x484105[_0xe8ac('0x1d')];_0x3399bf++){_0x129a48[_0xe8ac('0x1e')](getTimezoneData(_0x484105[_0x3399bf],tmp_campaigns));}BPromise[_0xe8ac('0x1f')](_0x129a48)[_0xe8ac('0x1c')](function(){_0x533eb3({'val':0x1});});})[_0xe8ac('0x61')](function(_0x549402){logger[_0xe8ac('0x5b')](_0x549402[_0xe8ac('0x5c')]);_0x533eb3({'val':0x0});});});}function updateTzVoiceQueues(_0x3c1474){return new Promise(function(_0x1b0fdc,_0x2942e1){var _0x24702e=squel[_0xe8ac('0x12')]()[_0xe8ac('0x35')](['voice_queues.id','voice_queues.dialTimezone'])['from'](_0xe8ac('0x68'))[_0xe8ac('0x19')](_0xe8ac('0x69'),null,_0xe8ac('0x6a'))[_0xe8ac('0x16')]('voice_queues_has_cm_lists.CmListId='+_0x3c1474);db[_0xe8ac('0x67')][_0xe8ac('0x5f')](_0x24702e[_0xe8ac('0x3e')]())[_0xe8ac('0x60')](function(_0x18f94a){var _0x291fea=[];for(var _0x500900=0x0;_0x500900<_0x18f94a[_0xe8ac('0x1d')];_0x500900++){_0x291fea['push'](getTimezoneData(_0x18f94a[_0x500900],tmp_voice_queues));}BPromise['all'](_0x291fea)['then'](function(){_0x1b0fdc({'val':0x1});});})['catch'](function(_0x213d4e){logger[_0xe8ac('0x5b')](_0x213d4e[_0xe8ac('0x5c')]);_0x1b0fdc({'val':0x0});});});}function getTimezoneData(_0x56b6f8,_0x5afffb){return new Promise(function(_0x44398d,_0x8c9b1a){var _0x591c95=shared['timezones'];var _0x2de3dc=_0x591c95[_0x56b6f8[_0xe8ac('0x6b')]];if(_[_0xe8ac('0x22')](_0x2de3dc)){_0x44398d({'ret':0x1});}else{var _0x207a13=_0x2de3dc['utcOffset'];var _0x109d62=squel[_0xe8ac('0x2c')]()['into'](_0x5afffb)['set']('id',_0x56b6f8['id'])['set'](_0xe8ac('0x6c'),_0x207a13)[_0xe8ac('0x6d')]('dialTimezone',_0x56b6f8[_0xe8ac('0x6b')])['toString']();return db[_0xe8ac('0x67')]['query'](_0x109d62)[_0xe8ac('0x60')](function(_0x1b3a8c){_0x44398d({'ret':0x1});})[_0xe8ac('0x61')](function(_0x368bca){logger[_0xe8ac('0x5b')](_0x368bca[_0xe8ac('0x5c')]);_0x8c9b1a({'ret':0x1});});}});}function handleTZQuery(_0x311091){logger[_0xe8ac('0x59')](_0x311091);return db['sequelize'][_0xe8ac('0x5f')](_0x311091)['spread'](function(_0x32ce8f){})[_0xe8ac('0x61')](function(_0x3e13fd){logger[_0xe8ac('0x5b')](_0x3e13fd['message']);});}function main(_0x38a3c4,_0x195d4c,_0x25a07a,_0x487a8a){logger[_0xe8ac('0x59')](_0xe8ac('0x6e'),_0x38a3c4,JSON[_0xe8ac('0x6f')](_0x195d4c));process['send']('start');var _0x1086ad=_0x195d4c[_0xe8ac('0x70')];var _0x2aef26=_['clone'](_0x1086ad);var _0x55fefa=_0x195d4c[_0xe8ac('0x71')];var _0x1e80f6=path[_0xe8ac('0x19')](config['root'],_0xe8ac('0x72'),_0x55fefa+_0xe8ac('0x73'));hasTZ=_['keys'](_0x1086ad)[_0xe8ac('0x74')](_0xe8ac('0x6b'));var _0x26444b=_[_0xe8ac('0x52')](_0x1086ad)[_0xe8ac('0x19')]();logger[_0xe8ac('0x59')](_0xe8ac('0x75'),_0x26444b);db[_0xe8ac('0x76')][_0xe8ac('0x1b')]({'raw':!![],'attributes':['id',_0xe8ac('0x77')]})[_0xe8ac('0x1c')](function(_0x58d1f0){for(var _0x46fc78=0x0;_0x46fc78<_0x58d1f0[_0xe8ac('0x1d')];_0x46fc78++){if(_0x58d1f0[_0x46fc78][_0xe8ac('0x77')]in _0x1086ad){contactItemTypes['push'](_0x58d1f0[_0x46fc78]);delete _0x2aef26[_0x58d1f0[_0x46fc78][_0xe8ac('0x77')]];hasAdditionalPhones=!![];}for(var _0x3eceab in _0x1086ad){if(_0x58d1f0[_0x46fc78][_0xe8ac('0x77')]+_0xe8ac('0x78')===_0x3eceab){phoneDescriptions[_0xe8ac('0x1e')]({'itemTypeId':_0x58d1f0[_0x46fc78]['id'],'description':_0x3eceab});delete _0x2aef26[_0x3eceab];}}}if(hasAdditionalPhones)_0x2aef26['AdditionalPhones']='';var _0xbe2d77=_['keys'](_0x2aef26)[_0xe8ac('0x19')]();logger[_0xe8ac('0x59')]('header',_0xbe2d77);fs['writeFileSync'](_0x1e80f6,_0xbe2d77+'\x0a');Papa[_0xe8ac('0x79')](fs[_0xe8ac('0x7a')](_0x38a3c4),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf11aa9,_0x5d4e73){try{for(var _0x229bf8=0x0,_0x204a88=[];_0x229bf8<_0xf11aa9[_0xe8ac('0x7b')]['length'];_0x229bf8++){stats[_0xe8ac('0x7c')]+=0x1;if(_0xf11aa9[_0xe8ac('0x5d')][_0x229bf8]){handleError(_0xf11aa9[_0xe8ac('0x7b')][_0x229bf8],_0xf11aa9[_0xe8ac('0x5d')][_0x229bf8]);}else{var _0x190257=[];var _0x46770c=[];var _0x9c8140={};for(var _0x120d3e in _0x1086ad){let _0x6f872a=contactItemTypes[_0xe8ac('0x7d')](_0x549f55=>_0x549f55[_0xe8ac('0x77')]===_0x120d3e);let _0x254531=contactItemTypes[_0xe8ac('0x7d')](_0x445445=>_0x445445['name']+_0xe8ac('0x78')===_0x120d3e);if(_['isNil'](_0x6f872a)&&_['isNil'](_0x254531)){if(_0x1086ad[_0xe8ac('0x7e')](_0x120d3e)){if(_0xf11aa9[_0xe8ac('0x7b')][_0x229bf8][_0x1086ad[_0x120d3e]]){var _0xaaa8a6=_['trim'](_0xf11aa9[_0xe8ac('0x7b')][_0x229bf8][_0x1086ad[_0x120d3e]][_0xe8ac('0x7f')](/"/g,'\x27'));switch(_0x120d3e){case'scheduledat':var _0x19f735=moment(_0xaaa8a6,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x19f735[_0xe8ac('0x80')]()){_0x204a88[_0xe8ac('0x1e')]('\x22'+_0xaaa8a6+'\x22');}else{_0x190257[_0xe8ac('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xe8ac('0x32'):var _0x55b5af=parseInt(_0xaaa8a6);_0xaaa8a6=_[_0xe8ac('0x81')](_0x55b5af)||_0x55b5af<0x0||_0x55b5af>0x4?_0x487a8a?0x3:0x2:_0x55b5af;_0x204a88['push']('\x22'+_0xaaa8a6+'\x22');break;case _0xe8ac('0x33'):var _0x1cd750=parseInt(_0xaaa8a6);if(_[_0xe8ac('0x82')](_0x1cd750)&&_[_0xe8ac('0x74')](_0x25a07a,_0x1cd750)){_0x204a88[_0xe8ac('0x1e')]('\x22'+_0x1cd750+'\x22');}else{_0x190257[_0xe8ac('0x1e')](_0xe8ac('0x83'));}break;case'email':if(isEmail(_0xaaa8a6)){_0x204a88[_0xe8ac('0x1e')]('\x22'+_0xaaa8a6+'\x22');}else{_0x190257[_0xe8ac('0x1e')](_0xe8ac('0x84'));}break;case _0xe8ac('0x85'):var _0x196ec0=moment(_0xaaa8a6,_0xe8ac('0x86'),!![]);if(_0x196ec0['isValid']()){_0x204a88[_0xe8ac('0x1e')]('\x22'+_0xaaa8a6+'\x22');}else{_0x190257['push'](_0xe8ac('0x87'));}break;case _0xe8ac('0x6b'):var _0x464a75=shared['timezones'];var _0x5dd530=_0x464a75[_0xaaa8a6];if(!_[_0xe8ac('0x22')](_0x5dd530)){var _0x293a92=_0x5dd530[_0xe8ac('0x88')];_0x204a88[_0xe8ac('0x1e')]('\x22'+_0xaaa8a6+'\x22');_0x204a88['push']('\x22'+_0x293a92+'\x22');}break;default:_0x204a88[_0xe8ac('0x1e')]('\x22'+_0xaaa8a6+'\x22');}}else{switch(_0x120d3e){case'firstName':case _0xe8ac('0x13'):_0x190257[_0xe8ac('0x1e')](_0x120d3e+'\x20not\x20specified');break;default:_0x204a88[_0xe8ac('0x1e')]('\x22\x22');}}}}else{var _0x40c95e='';if(!_[_0xe8ac('0x22')](_0x6f872a)){if(!_0x9c8140[_0xe8ac('0x7e')](_0x6f872a['id'])){if(!_[_0xe8ac('0x22')](_0xf11aa9[_0xe8ac('0x7b')][_0x229bf8][_0x1086ad[_0x120d3e]])){var _0xaaa8a6=_[_0xe8ac('0x89')](_0xf11aa9[_0xe8ac('0x7b')][_0x229bf8][_0x1086ad[_0x120d3e]]['replace'](/"/g,'\x27'));var _0x145e93=phoneDescriptions[_0xe8ac('0x7d')](_0x4dd94e=>_0x4dd94e['itemTypeId']===_0x6f872a['id']);if(!_[_0xe8ac('0x22')](_0x145e93)){var _0x31f834=_[_0xe8ac('0x89')](_0xf11aa9[_0xe8ac('0x7b')][_0x229bf8][_0x1086ad[_0x145e93['description']]]['replace'](/"/g,'\x27'));if(!_[_0xe8ac('0x22')](_0x31f834))_0xaaa8a6=_0xaaa8a6+'§'+_0x31f834;}if(_0x40c95e=='')_0x40c95e=_0xaaa8a6;else _0x40c95e+='|'+_0xaaa8a6;}_0x46770c['push'](_0x6f872a['id']+':'+_0x40c95e);_0x9c8140[_0x6f872a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x204a88[_0xe8ac('0x1e')]('\x22'+_0x46770c[_0xe8ac('0x19')](';')+'\x22');}if(_0x190257[_0xe8ac('0x1d')]){handleError(_0xf11aa9[_0xe8ac('0x7b')][_0x229bf8],{'code':_0xe8ac('0x8a'),'message':_0x190257[_0xe8ac('0x19')]()});}else{fs['appendFileSync'](_0x1e80f6,_0x204a88[_0xe8ac('0x19')]()+'\x0a');}_0x204a88=[];}if(!(stats[_0xe8ac('0x7c')]%0xc8)){socket['emit'](_0xe8ac('0x8b')+_0x55fefa,stats);stats['errors']=[];}}if(stopped){logger[_0xe8ac('0x59')](_0xe8ac('0x8c'));_0x5d4e73[_0xe8ac('0x8d')]();}}catch(_0x2331d6){handleError(_0xf11aa9[_0xe8ac('0x7b')][_0x229bf8],{'code':_0xe8ac('0x8e'),'message':_0x2331d6['message']});logger[_0xe8ac('0x5b')]('step',_0x2331d6['message']);}},'complete':function(){try{var _0x48f7f1=[];var _0x59af5a=[];var _0x5bd553=_0xe8ac('0x36');if(_0x195d4c[_0xe8ac('0x8f')]&&_0x195d4c['duplicates'][_0xe8ac('0x1d')]){_0x5bd553=_0xe8ac('0x90')+_0x55fefa;_0x48f7f1['push'](_0xe8ac('0x91')+_0x5bd553+_0xe8ac('0x92'));}tmp_campaigns=_0xe8ac('0x93')+_0x55fefa;tmp_voice_queues=_0xe8ac('0x94')+_0x55fefa;_0x59af5a[_0xe8ac('0x1e')](_0xe8ac('0x91')+tmp_campaigns+_0xe8ac('0x95'));_0x59af5a[_0xe8ac('0x1e')](_0xe8ac('0x91')+tmp_voice_queues+_0xe8ac('0x95'));BPromise[_0xe8ac('0x96')](_0x59af5a,handleTZQuery)[_0xe8ac('0x1c')](function(_0x3c05c2){updateTzCampaigns(_0x195d4c['ListId'])[_0xe8ac('0x1c')](function(_0x51f5ac){updateTzVoiceQueues(_0x195d4c[_0xe8ac('0x30')])[_0xe8ac('0x1c')](function(_0xea6145){if(hasTZ)_0xbe2d77=_0xbe2d77[_0xe8ac('0x7f')](_0xe8ac('0x6b'),'dialTimezone,utcOffset');var _0x5daec5=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x1e80f6,_0x5bd553,_0xbe2d77,_0x195d4c[_0xe8ac('0x30')],_0x195d4c['CompanyId']||null,NOW,NOW);if(_[_0xe8ac('0x22')](_0x1086ad['scheduledat'])){_0x5daec5+=_0xe8ac('0x97');}_0x48f7f1[_0xe8ac('0x1e')](_0x5daec5);if(_0x195d4c[_0xe8ac('0x8f')]&&_0x195d4c[_0xe8ac('0x8f')][_0xe8ac('0x1d')]){_0x48f7f1[_0xe8ac('0x1e')](insertCmContact(_0x195d4c[_0xe8ac('0x30')],_0x5bd553,_0x195d4c['duplicates'],_0x1086ad));_0x48f7f1[_0xe8ac('0x1e')]('DROP\x20TABLE\x20'+_0x5bd553+';');}BPromise[_0xe8ac('0x96')](_0x48f7f1,handleQuery)[_0xe8ac('0x1c')](function(_0x2a44e7){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x48f7f1=[];for(var _0x301fa7=0x0;_0x301fa7\x20\x20','existsSync','file\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','then','length','push','all','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','cm_contacts.createdAt','cm_hopper_black','fromQuery','phone','.id\x20=\x20','field','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','UserId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','ListId\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?','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','exit','errors','code','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','catch','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','stringify','send','binding','clone','socket_timestamp','root','server/files/tmp','keys','header','name','_description','writeFileSync','parse','createReadStream','data','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','hasOwnProperty','find','itemTypeId','description','SystemRow','emit','contact:import:','Abort\x20parser','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','CampaignId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists'];(function(_0x2d89ca,_0x409fe7){var _0x7e37f=function(_0x241a38){while(--_0x241a38){_0x2d89ca['push'](_0x2d89ca['shift']());}};_0x7e37f(++_0x409fe7);}(_0x995a,0x176));var _0xa995=function(_0x4dc2d5,_0x2706eb){_0x4dc2d5=_0x4dc2d5-0x0;var _0x3b1844=_0x995a[_0x4dc2d5];return _0x3b1844;};'use strict';var fs=require('fs');var path=require(_0xa995('0x0'));var _=require(_0xa995('0x1'));var Papa=require(_0xa995('0x2'));var util=require(_0xa995('0x3'));var BPromise=require(_0xa995('0x4'));var moment=require(_0xa995('0x5'));var squel=require('squel');var Redis=require(_0xa995('0x6'));var db=require(_0xa995('0x7'))['db'];var config=require(_0xa995('0x8'));var shared=require(_0xa995('0x9'));var logger=require('../../../config/logger')(_0xa995('0xa'));config[_0xa995('0xb')]=_[_0xa995('0xc')](config[_0xa995('0xb')],{'host':_0xa995('0xd'),'port':0x18eb});var socket=require(_0xa995('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xa995('0xf')](_0xa995('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x590efd){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'](_0x590efd);}function selectNotIn(_0x1299a8,_0x33f037,_0x47478c,_0x1b35c8,_0x9a86ed){return squel[_0xa995('0x11')]()['field']('phone')['from'](_0x1b35c8)[_0xa995('0x12')](_0x33f037,null,_0x33f037+'.id\x20=\x20'+_0x1b35c8+'.'+_0x47478c)['where'](_0x1b35c8+'.'+_0x47478c+_0xa995('0x13')+_0x1299a8+'.'+_0x47478c)[_0xa995('0x14')](_0x33f037+_0xa995('0x15')+_0x9a86ed['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x94493e,_0x4c95b6){promisesAdditionalPhones=[];return db[_0xa995('0x16')]['findAll']({'raw':!![],'attributes':['id',_0xa995('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xa995('0x18')](function(_0x11a06e){if(_0x11a06e!==null){var _0x4bb88d=[];for(var _0x1934f4=0x0;_0x1934f4<_0x11a06e[_0xa995('0x19')];_0x1934f4++){var _0x3f01a7=_0x11a06e[_0x1934f4];_0x4bb88d[_0xa995('0x1a')](insertAdditionalPhones(_0x3f01a7));}}Promise[_0xa995('0x1b')](_0x4bb88d)[_0xa995('0x18')](function(){_0x94493e({'val':0x1});});});});}function insertAdditionalPhones(_0x18be65){return new Promise(function(_0x53d594,_0x1c1b0c){var _0x15d643=_0x18be65[_0xa995('0x17')];var _0xbe3511=_0x15d643[_0xa995('0x1c')](';');var _0x270180=[];orderBy=0x0;for(var _0x2f3f10=0x0;_0x2f3f10<_0xbe3511[_0xa995('0x19')];_0x2f3f10++){_0x270180[_0xa995('0x1a')](splitAdditionalPhone(_0x18be65['id'],_0xbe3511[_0x2f3f10]));}Promise[_0xa995('0x1b')](_0x270180)['then'](function(){_0x53d594({'val':_0xbe3511['length']});});});}function splitAdditionalPhone(_0x2024df,_0x218408){return new Promise(function(_0x5a4b8e,_0x3f907b){var _0x498710=_0x218408['split'](':');var _0x5e8568=_0x498710[0x0];var _0x959af3=_0x498710[0x1];if(!_['isNil'](_0x959af3)){var _0x136318=_0x959af3[_0xa995('0x1c')]('|');var _0xe19218=[];for(var _0x50efad=0x0;_0x50efad<_0x136318[_0xa995('0x19')];_0x50efad++){if(_0x136318[_0x50efad]!==''){var _0x57ef75=_[_0xa995('0x1d')](promisesAdditionalPhones,{'contactId':_0x2024df,'phone':_0x136318[_0x50efad]});if(_0x57ef75[_0xa995('0x19')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x2024df,'contactTypeId':_0x5e8568,'phone':_0x136318[_0x50efad],'orderBy':orderBy});}}}_0x5a4b8e({'ok':0x1});}else _0x5a4b8e({'res':0x0});});}function createAdditionalPhone(_0x3f4d0e,_0x18387b,_0x5a5523,_0x3ff57e){var _0x321524='';var _0x52d13e='';var _0x26d259=_0x5a5523[_0xa995('0x1c')]('§');_0x321524=_0x26d259[0x0];if(_0x26d259[_0xa995('0x19')]==0x2)_0x52d13e=_0x26d259[0x1];return new Promise(function(_0x144212,_0x37f4a2){return db[_0xa995('0x1e')][_0xa995('0x1f')]({'where':{'CmContactId':_0x3f4d0e,'item':_0x321524}})[_0xa995('0x18')](function(_0x47092d){if(_0x47092d){return db[_0xa995('0x1e')][_0xa995('0x20')]({'ItemTypeId':_0x18387b,'description':_0x52d13e,'OrderBy':_0x3ff57e},{'where':{'CmContactId':_0x3f4d0e,'item':_0x321524}})[_0xa995('0x18')](function(_0x10684d){_0x144212({'res':_0xa995('0x21')});});}else{return db[_0xa995('0x1e')][_0xa995('0x22')]({'CmContactId':_0x3f4d0e,'item':_0x321524,'description':_0x52d13e,'ItemTypeId':_0x18387b,'OrderBy':_0x3ff57e,'ItemClass':_0xa995('0x23')})[_0xa995('0x18')](function(_0xd1738){_0x144212({'res':_0xa995('0x24')});});}});});}function insertCmHopper(_0x23c5ec,_0x143c23,_0x11d886,_0x502a47,_0x472955){var _0x5842d1=['cm_contacts.phone','cm_contacts.scheduledat',_0xa995('0x25'),_0xa995('0x26'),_0x143c23+'.'+_0x502a47,'cm_contacts.createdAt',_0xa995('0x27'),'cm_contacts.priority',_0xa995('0x28'),'\x22'+_0x472955+'\x22'];return squel[_0xa995('0x29')]()[_0xa995('0x2a')](_0xa995('0x2b'))['fromQuery'](['phone',_0xa995('0x2c'),_0xa995('0x2d'),_0xa995('0x2e'),_0x502a47,_0xa995('0x2f'),_0xa995('0x30'),_0xa995('0x31'),'UserId',_0xa995('0x32')],squel['select']()[_0xa995('0x33')](_0x5842d1)[_0xa995('0x34')](_0x143c23)[_0xa995('0x12')](_0xa995('0x35'),null,_0xa995('0x36')+_0x143c23+_0xa995('0x37'))[_0xa995('0x12')](_0x11d886,null,_0x11d886+'.id\x20=\x20'+_0x143c23+'.'+_0x502a47)[_0xa995('0x14')](_0x143c23+'.CmListId\x20=\x20?',_0x23c5ec)[_0xa995('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xa995('0x14')](_0xa995('0x38'),selectNotIn(_0x143c23,_0x11d886,_0x502a47,_0xa995('0x2b'),[_0xa995('0x39'),'\x22onlyIfOpen\x22']))[_0xa995('0x14')](_0xa995('0x38'),selectNotIn(_0x143c23,_0x11d886,_0x502a47,_0xa995('0x2b'),['\x22always\x22'])))[_0xa995('0x3a')]();}function insertCmHopperBlack(_0x339072,_0x55cb4d,_0x5e1854,_0x5456db){var _0x41f29c=[_0xa995('0x3b'),_0xa995('0x25'),_0xa995('0x26'),_0x55cb4d+'.'+_0x5456db,_0xa995('0x3c'),_0xa995('0x27')];return squel['insert']()[_0xa995('0x2a')](_0xa995('0x3d'))[_0xa995('0x3e')]([_0xa995('0x3f'),_0xa995('0x2d'),_0xa995('0x2e'),_0x5456db,'createdAt',_0xa995('0x30')],squel[_0xa995('0x11')]()['fields'](_0x41f29c)[_0xa995('0x34')](_0x55cb4d)['join'](_0xa995('0x35'),null,_0xa995('0x36')+_0x55cb4d+'.CmListId')[_0xa995('0x12')](_0x5e1854,null,_0x5e1854+_0xa995('0x40')+_0x55cb4d+'.'+_0x5456db)[_0xa995('0x14')](_0x55cb4d+'.CmListId\x20=\x20?',_0x339072)[_0xa995('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xa995('0x38'),squel[_0xa995('0x11')]()[_0xa995('0x41')](_0xa995('0x3f'))[_0xa995('0x34')](_0xa995('0x3d'))[_0xa995('0x14')]('ListId\x20=\x20?',_0x339072)['where'](_0x5456db+'\x20=\x20'+_0x55cb4d+'.'+_0x5456db)))[_0xa995('0x3a')]();}function insertTzCmHopper(_0xa3cd28,_0x1173d2,_0x469371,_0x18d4ce,_0x20316c,_0x13abb6){var _0x4ca628=[_0xa995('0x3b'),_0xa995('0x42')+_0x13abb6+_0xa995('0x43'),_0xa995('0x25'),_0xa995('0x26'),_0x1173d2+'.'+_0x18d4ce,'cm_contacts.createdAt',_0xa995('0x27'),_0xa995('0x44'),_0xa995('0x28'),'\x22'+_0x20316c+'\x22'];var _0x501613=squel['insert']()[_0xa995('0x2a')](_0xa995('0x2b'))['fromQuery']([_0xa995('0x3f'),'scheduledat',_0xa995('0x2d'),'ListId',_0x18d4ce,'createdAt',_0xa995('0x30'),_0xa995('0x31'),_0xa995('0x45'),_0xa995('0x32')],squel['select']()['fields'](_0x4ca628)[_0xa995('0x34')](_0x1173d2)[_0xa995('0x12')]('cm_contacts',null,_0xa995('0x36')+_0x1173d2+'.CmListId')['join'](_0x469371,null,_0x469371+_0xa995('0x40')+_0x1173d2+'.'+_0x18d4ce)[_0xa995('0x12')](_0x13abb6,null,_0x13abb6+_0xa995('0x40')+_0x1173d2+'.'+_0x18d4ce)[_0xa995('0x14')](_0x1173d2+_0xa995('0x46'),_0xa3cd28)[_0xa995('0x14')](_0xa995('0x47'),NOW)[_0xa995('0x14')](_0xa995('0x38'),selectNotIn(_0x1173d2,_0x469371,_0x18d4ce,_0xa995('0x2b'),[_0xa995('0x39'),_0xa995('0x48')]))[_0xa995('0x14')](_0xa995('0x38'),selectNotIn(_0x1173d2,_0x469371,_0x18d4ce,_0xa995('0x2b'),[_0xa995('0x39')])))[_0xa995('0x3a')]();return _0x501613;}function insertTzCmHopperBlack(_0x749dd6,_0x185eff,_0x444f0f,_0x1b1086){var _0x1e4c8a=[_0xa995('0x3b'),'cm_contacts.id',_0xa995('0x26'),_0x185eff+'.'+_0x1b1086,_0xa995('0x3c'),'cm_contacts.updatedAt'];return squel[_0xa995('0x29')]()[_0xa995('0x2a')]('cm_hopper_black')[_0xa995('0x3e')]([_0xa995('0x3f'),_0xa995('0x2d'),_0xa995('0x2e'),_0x1b1086,_0xa995('0x2f'),'updatedAt'],squel[_0xa995('0x11')]()[_0xa995('0x33')](_0x1e4c8a)[_0xa995('0x34')](_0x185eff)['join'](_0xa995('0x35'),null,_0xa995('0x36')+_0x185eff+_0xa995('0x37'))[_0xa995('0x12')](_0x444f0f,null,_0x444f0f+'.id\x20=\x20'+_0x185eff+'.'+_0x1b1086)[_0xa995('0x14')](_0x185eff+_0xa995('0x46'),_0x749dd6)[_0xa995('0x14')](_0xa995('0x47'),NOW)[_0xa995('0x14')](_0xa995('0x38'),squel[_0xa995('0x11')]()['field']('phone')[_0xa995('0x34')]('cm_hopper_black')[_0xa995('0x14')](_0xa995('0x49'),_0x749dd6)[_0xa995('0x14')](_0x1b1086+_0xa995('0x13')+_0x185eff+'.'+_0x1b1086)))[_0xa995('0x3a')]();}function insertCmHopperAdditionalPhones(_0x189d58){var _0x35b5c4=['cm_hopper.id',_0xa995('0x4a'),_0xa995('0x4b'),_0xa995('0x4c'),_0xa995('0x4d')];return squel['insert']()['into'](_0xa995('0x4e'))[_0xa995('0x3e')](['CmHopperId',_0xa995('0x3f'),_0xa995('0x4f'),_0xa995('0x2f'),_0xa995('0x30')],squel[_0xa995('0x11')]()['fields'](_0x35b5c4)[_0xa995('0x34')](_0xa995('0x2b'))['join'](_0xa995('0x35'),null,_0xa995('0x50'))[_0xa995('0x12')](_0xa995('0x51'),null,_0xa995('0x52'))[_0xa995('0x14')](_0xa995('0x53'),_0x189d58)[_0xa995('0x14')](_0xa995('0x47'),NOW))[_0xa995('0x3a')]();}function insertCmContact(_0x166dc5,_0x458cfe,_0x2400e4,_0xb5fff9){var _0x40396e=_['concat'](_['keys'](_0xb5fff9),[_0xa995('0x2e'),_0xa995('0x54'),_0xa995('0x2f'),_0xa995('0x30')]);return squel[_0xa995('0x29')]()[_0xa995('0x2a')](_0xa995('0x35'))[_0xa995('0x3e')](_0x40396e,squel[_0xa995('0x11')]()[_0xa995('0x33')](_0x40396e)[_0xa995('0x34')](_0x458cfe)[_0xa995('0x14')]('('+_0x2400e4[_0xa995('0x12')](',')+')\x20NOT\x20IN\x20?',squel[_0xa995('0x11')]()['fields'](_0x2400e4)[_0xa995('0x34')](_0xa995('0x35'))[_0xa995('0x14')](_0xa995('0x49'),_0x166dc5)['where'](_0xa995('0x55')))[_0xa995('0x14')](_0xa995('0x56'),squel[_0xa995('0x11')]()[_0xa995('0x41')](_0xa995('0x57'),'min_id')[_0xa995('0x34')](_0x458cfe)[_0xa995('0x58')](_0x2400e4[_0xa995('0x12')](','))))['toString']();}function handleStop(){logger[_0xa995('0x59')](_0xa995('0x5a'));stopped=!![];}function handleUncaughtException(_0x975416){logger[_0xa995('0x5b')](_0x975416[_0xa995('0x5c')]);process[_0xa995('0x5d')](0x1);}function handleError(_0x439f5f,_0x20fb86){stats[_0xa995('0x5e')][_0xa995('0x1a')]({'name':_0x20fb86[_0xa995('0x5f')],'message':_0x20fb86[_0xa995('0x5c')],'row':_0x439f5f});}function handleQuery(_0x3dd9ee){logger[_0xa995('0x59')](_0x3dd9ee);return db['sequelize'][_0xa995('0x60')](_0x3dd9ee)[_0xa995('0x61')](function(_0x5ea030){results[_0xa995('0x1a')](_0x5ea030);})['catch'](function(_0x23fa8c){logger[_0xa995('0x5b')](_0x23fa8c['message']);});}function updateTzCampaigns(_0x140b3b){return new Promise(function(_0x438ad1,_0x54db04){var _0x48a0e2=squel[_0xa995('0x11')]()['fields']([_0xa995('0x62'),_0xa995('0x63')])[_0xa995('0x34')](_0xa995('0x64'))['join']('campaigns_has_cm_lists',null,_0xa995('0x65'))[_0xa995('0x14')]('campaigns_has_cm_lists.CmListId='+_0x140b3b);db[_0xa995('0x66')][_0xa995('0x60')](_0x48a0e2['toString']())[_0xa995('0x61')](function(_0x4aa6d6){var _0xf41bea=[];for(var _0x23082c=0x0;_0x23082c<_0x4aa6d6[_0xa995('0x19')];_0x23082c++){_0xf41bea['push'](getTimezoneData(_0x4aa6d6[_0x23082c],tmp_campaigns));}BPromise[_0xa995('0x1b')](_0xf41bea)[_0xa995('0x18')](function(){_0x438ad1({'val':0x1});});})[_0xa995('0x67')](function(_0x3b7452){logger[_0xa995('0x5b')](_0x3b7452[_0xa995('0x5c')]);_0x438ad1({'val':0x0});});});}function updateTzVoiceQueues(_0x41eead){return new Promise(function(_0x239c3b,_0x29540a){var _0x22ecf0=squel['select']()[_0xa995('0x33')](['voice_queues.id','voice_queues.dialTimezone'])[_0xa995('0x34')](_0xa995('0x68'))[_0xa995('0x12')](_0xa995('0x69'),null,_0xa995('0x6a'))[_0xa995('0x14')](_0xa995('0x6b')+_0x41eead);db[_0xa995('0x66')][_0xa995('0x60')](_0x22ecf0['toString']())[_0xa995('0x61')](function(_0x370955){var _0xa3343a=[];for(var _0x2c68c5=0x0;_0x2c68c5<_0x370955[_0xa995('0x19')];_0x2c68c5++){_0xa3343a[_0xa995('0x1a')](getTimezoneData(_0x370955[_0x2c68c5],tmp_voice_queues));}BPromise[_0xa995('0x1b')](_0xa3343a)[_0xa995('0x18')](function(){_0x239c3b({'val':0x1});});})[_0xa995('0x67')](function(_0x1b8cfe){logger[_0xa995('0x5b')](_0x1b8cfe['message']);_0x239c3b({'val':0x0});});});}function getTimezoneData(_0x59c429,_0x5858e3){return new Promise(function(_0x4097ac,_0x2a556c){var _0x559560=shared['timezones'];var _0x4b1220=_0x559560[_0x59c429[_0xa995('0x6c')]];if(_[_0xa995('0x6d')](_0x4b1220)){_0x4097ac({'ret':0x1});}else{var _0x37096b=_0x4b1220[_0xa995('0x6e')];var _0x1caffe=squel[_0xa995('0x29')]()[_0xa995('0x2a')](_0x5858e3)['set']('id',_0x59c429['id'])[_0xa995('0x6f')](_0xa995('0x70'),_0x37096b)['set'](_0xa995('0x6c'),_0x59c429[_0xa995('0x6c')])[_0xa995('0x3a')]();return db['sequelize'][_0xa995('0x60')](_0x1caffe)['spread'](function(_0x2b8c05){_0x4097ac({'ret':0x1});})[_0xa995('0x67')](function(_0x487615){logger['error'](_0x487615['message']);_0x2a556c({'ret':0x1});});}});}function handleTZQuery(_0x40c884){logger[_0xa995('0x59')](_0x40c884);return db[_0xa995('0x66')]['query'](_0x40c884)[_0xa995('0x61')](function(_0x2907e0){})[_0xa995('0x67')](function(_0x349485){logger[_0xa995('0x5b')](_0x349485[_0xa995('0x5c')]);});}function main(_0x51bdd7,_0xc25877,_0x11eacb,_0x217d9a){logger[_0xa995('0x59')]('main',_0x51bdd7,JSON[_0xa995('0x71')](_0xc25877));process[_0xa995('0x72')]('start');var _0x4c183c=_0xc25877[_0xa995('0x73')];var _0x143064=_[_0xa995('0x74')](_0x4c183c);var _0x110030=_0xc25877[_0xa995('0x75')];var _0x1152b2=path[_0xa995('0x12')](config[_0xa995('0x76')],_0xa995('0x77'),_0x110030+'.csv');hasTZ=_[_0xa995('0x78')](_0x4c183c)['includes'](_0xa995('0x6c'));var _0x2b05a6=_[_0xa995('0x78')](_0x4c183c)[_0xa995('0x12')]();logger[_0xa995('0x59')](_0xa995('0x79'),_0x2b05a6);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0xa995('0x7a')]})['then'](function(_0x3d66e1){for(var _0x24a5f6=0x0;_0x24a5f6<_0x3d66e1[_0xa995('0x19')];_0x24a5f6++){if(_0x3d66e1[_0x24a5f6]['name']in _0x4c183c){contactItemTypes[_0xa995('0x1a')](_0x3d66e1[_0x24a5f6]);delete _0x143064[_0x3d66e1[_0x24a5f6][_0xa995('0x7a')]];hasAdditionalPhones=!![];}for(var _0x4c89a0 in _0x4c183c){if(_0x3d66e1[_0x24a5f6][_0xa995('0x7a')]+_0xa995('0x7b')===_0x4c89a0){phoneDescriptions[_0xa995('0x1a')]({'itemTypeId':_0x3d66e1[_0x24a5f6]['id'],'description':_0x4c89a0});delete _0x143064[_0x4c89a0];}}}if(hasAdditionalPhones)_0x143064[_0xa995('0x17')]='';var _0xb9e36a=_[_0xa995('0x78')](_0x143064)['join']();logger[_0xa995('0x59')](_0xa995('0x79'),_0xb9e36a);fs[_0xa995('0x7c')](_0x1152b2,_0xb9e36a+'\x0a');Papa[_0xa995('0x7d')](fs[_0xa995('0x7e')](_0x51bdd7),{'header':!![],'skipEmptyLines':!![],'step':function(_0x125b0b,_0x322568){try{for(var _0x1d891b=0x0,_0x11855f=[];_0x1d891b<_0x125b0b[_0xa995('0x7f')][_0xa995('0x19')];_0x1d891b++){stats[_0xa995('0x80')]+=0x1;if(_0x125b0b[_0xa995('0x5e')][_0x1d891b]){handleError(_0x125b0b[_0xa995('0x7f')][_0x1d891b],_0x125b0b[_0xa995('0x5e')][_0x1d891b]);}else{var _0x9f885b=[];var _0x24e821=[];var _0x29d346={};for(var _0x8ced9b in _0x4c183c){let _0x980d8a=contactItemTypes['find'](_0x4c0197=>_0x4c0197[_0xa995('0x7a')]===_0x8ced9b);let _0x48ed0a=contactItemTypes['find'](_0x3e4ace=>_0x3e4ace['name']+'_description'===_0x8ced9b);if(_[_0xa995('0x6d')](_0x980d8a)&&_[_0xa995('0x6d')](_0x48ed0a)){if(_0x4c183c['hasOwnProperty'](_0x8ced9b)){if(_0x125b0b[_0xa995('0x7f')][_0x1d891b][_0x4c183c[_0x8ced9b]]){var _0x2bb589=_[_0xa995('0x81')](_0x125b0b[_0xa995('0x7f')][_0x1d891b][_0x4c183c[_0x8ced9b]][_0xa995('0x82')](/"/g,'\x27'));switch(_0x8ced9b){case _0xa995('0x2c'):var _0x30ccc3=moment(_0x2bb589,_0xa995('0x10'),!![]);if(_0x30ccc3[_0xa995('0x83')]()){_0x11855f[_0xa995('0x1a')]('\x22'+_0x2bb589+'\x22');}else{_0x9f885b[_0xa995('0x1a')](_0xa995('0x84'));}break;case _0xa995('0x31'):var _0x10113f=parseInt(_0x2bb589);_0x2bb589=_['isNaN'](_0x10113f)||_0x10113f<0x0||_0x10113f>0x4?_0x217d9a?0x3:0x2:_0x10113f;_0x11855f[_0xa995('0x1a')]('\x22'+_0x2bb589+'\x22');break;case _0xa995('0x45'):var _0x27740f=parseInt(_0x2bb589);if(_[_0xa995('0x85')](_0x27740f)&&_[_0xa995('0x86')](_0x11eacb,_0x27740f)){_0x11855f['push']('\x22'+_0x27740f+'\x22');}else{_0x9f885b[_0xa995('0x1a')](_0xa995('0x87'));}break;case _0xa995('0x88'):if(isEmail(_0x2bb589)){_0x11855f[_0xa995('0x1a')]('\x22'+_0x2bb589+'\x22');}else{_0x9f885b[_0xa995('0x1a')](_0xa995('0x89'));}break;case _0xa995('0x8a'):var _0x1ea557=moment(_0x2bb589,_0xa995('0x8b'),!![]);if(_0x1ea557[_0xa995('0x83')]()){_0x11855f[_0xa995('0x1a')]('\x22'+_0x2bb589+'\x22');}else{_0x9f885b[_0xa995('0x1a')](_0xa995('0x8c'));}break;case _0xa995('0x6c'):var _0x4bd980=shared['timezones'];var _0x2455c7=_0x4bd980[_0x2bb589];if(!_[_0xa995('0x6d')](_0x2455c7)){var _0x3b0cff=_0x2455c7['utcOffset'];_0x11855f[_0xa995('0x1a')]('\x22'+_0x2bb589+'\x22');_0x11855f[_0xa995('0x1a')]('\x22'+_0x3b0cff+'\x22');}break;default:_0x11855f['push']('\x22'+_0x2bb589+'\x22');}}else{switch(_0x8ced9b){case'firstName':case _0xa995('0x3f'):_0x9f885b['push'](_0x8ced9b+'\x20not\x20specified');break;default:_0x11855f[_0xa995('0x1a')]('\x22\x22');}}}}else{var _0x39485e='';if(!_[_0xa995('0x6d')](_0x980d8a)){if(!_0x29d346[_0xa995('0x8d')](_0x980d8a['id'])){if(!_['isNil'](_0x125b0b['data'][_0x1d891b][_0x4c183c[_0x8ced9b]])){var _0x2bb589=_[_0xa995('0x81')](_0x125b0b[_0xa995('0x7f')][_0x1d891b][_0x4c183c[_0x8ced9b]][_0xa995('0x82')](/"/g,'\x27'));var _0x52dd34=phoneDescriptions[_0xa995('0x8e')](_0x3f3176=>_0x3f3176[_0xa995('0x8f')]===_0x980d8a['id']);if(!_[_0xa995('0x6d')](_0x52dd34)){var _0x57984d=_['trim'](_0x125b0b[_0xa995('0x7f')][_0x1d891b][_0x4c183c[_0x52dd34[_0xa995('0x90')]]][_0xa995('0x82')](/"/g,'\x27'));if(!_['isNil'](_0x57984d))_0x2bb589=_0x2bb589+'§'+_0x57984d;}if(_0x39485e=='')_0x39485e=_0x2bb589;else _0x39485e+='|'+_0x2bb589;}_0x24e821[_0xa995('0x1a')](_0x980d8a['id']+':'+_0x39485e);_0x29d346[_0x980d8a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x11855f[_0xa995('0x1a')]('\x22'+_0x24e821[_0xa995('0x12')](';')+'\x22');}if(_0x9f885b['length']){handleError(_0x125b0b[_0xa995('0x7f')][_0x1d891b],{'code':_0xa995('0x91'),'message':_0x9f885b[_0xa995('0x12')]()});}else{fs['appendFileSync'](_0x1152b2,_0x11855f[_0xa995('0x12')]()+'\x0a');}_0x11855f=[];}if(!(stats['rows']%0xc8)){socket[_0xa995('0x92')](_0xa995('0x93')+_0x110030,stats);stats['errors']=[];}}if(stopped){logger['info'](_0xa995('0x94'));_0x322568['abort']();}}catch(_0x1f3742){handleError(_0x125b0b[_0xa995('0x7f')][_0x1d891b],{'code':'SystemError','message':_0x1f3742[_0xa995('0x5c')]});logger[_0xa995('0x5b')](_0xa995('0x95'),_0x1f3742['message']);}},'complete':function(){try{var _0x5a4f7d=[];var _0x780fe3=[];var _0x1d8b16=_0xa995('0x35');if(_0xc25877['duplicates']&&_0xc25877[_0xa995('0x96')][_0xa995('0x19')]){_0x1d8b16=_0xa995('0x97')+_0x110030;_0x5a4f7d[_0xa995('0x1a')]('CREATE\x20TABLE\x20'+_0x1d8b16+_0xa995('0x98'));}tmp_campaigns=_0xa995('0x99')+_0x110030;tmp_voice_queues=_0xa995('0x9a')+_0x110030;_0x780fe3[_0xa995('0x1a')](_0xa995('0x9b')+tmp_campaigns+_0xa995('0x9c'));_0x780fe3['push'](_0xa995('0x9b')+tmp_voice_queues+_0xa995('0x9c'));BPromise[_0xa995('0x9d')](_0x780fe3,handleTZQuery)[_0xa995('0x18')](function(_0x356538){updateTzCampaigns(_0xc25877[_0xa995('0x2e')])[_0xa995('0x18')](function(_0x3ff037){updateTzVoiceQueues(_0xc25877[_0xa995('0x2e')])[_0xa995('0x18')](function(_0x109290){if(hasTZ)_0xb9e36a=_0xb9e36a[_0xa995('0x82')]('dialTimezone','dialTimezone,utcOffset');var _0x578df9=util[_0xa995('0xf')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x1152b2,_0x1d8b16,_0xb9e36a,_0xc25877['ListId'],_0xc25877['CompanyId']||null,NOW,NOW);if(_[_0xa995('0x6d')](_0x4c183c[_0xa995('0x2c')])){_0x578df9+=',\x20scheduledAt\x20=\x20NOW()';}_0x5a4f7d[_0xa995('0x1a')](_0x578df9);if(_0xc25877['duplicates']&&_0xc25877[_0xa995('0x96')][_0xa995('0x19')]){_0x5a4f7d[_0xa995('0x1a')](insertCmContact(_0xc25877[_0xa995('0x2e')],_0x1d8b16,_0xc25877[_0xa995('0x96')],_0x4c183c));_0x5a4f7d[_0xa995('0x1a')](_0xa995('0x9e')+_0x1d8b16+';');}BPromise[_0xa995('0x9d')](_0x5a4f7d,handleQuery)[_0xa995('0x18')](function(_0xa7a277){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x5a4f7d=[];for(var _0x9fe42a=0x0;_0x9fe42a\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','then','catch','error','message','all','split','filter','CmContactHasItem','findOne','updated','create','PHONE','inserted','CmHopper','update','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','from','cm_contacts','.CmListId','.id\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','insert','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','\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_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','exit','errors','code','info','main','stringify','start'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x8cce,0xd6));var _0xe8cc=function(_0x5dc54e,_0x5f6bc5){_0x5dc54e=_0x5dc54e-0x0;var _0x4d5beb=_0x8cce[_0x5dc54e];return _0x4d5beb;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xe8cc('0x0'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xe8cc('0x1'));var moment=require(_0xe8cc('0x2'));var squel=require(_0xe8cc('0x3'));var Redis=require(_0xe8cc('0x4'));var db=require(_0xe8cc('0x5'))['db'];var config=require(_0xe8cc('0x6'));var logger=require(_0xe8cc('0x7'))(_0xe8cc('0x8'));config[_0xe8cc('0x9')]=_['defaults'](config[_0xe8cc('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(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()[_0xe8cc('0xa')](_0xe8cc('0xb'));var tempTableName='cm_contacts_temp_'+moment()[_0xe8cc('0xa')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x22ca98){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))*$/[_0xe8cc('0xc')](_0x22ca98);}function selectNotIn(_0xcbf3ec,_0x826385,_0x45b64f,_0x27984b,_0x4d499c){return squel[_0xe8cc('0xd')]()[_0xe8cc('0xe')]('phone')['from'](_0x27984b)[_0xe8cc('0xf')](_0x826385,null,_0x826385+'.id\x20=\x20'+_0x27984b+'.'+_0x45b64f)['where'](_0x27984b+'.'+_0x45b64f+_0xe8cc('0x10')+_0xcbf3ec+'.'+_0x45b64f)['where'](_0x826385+_0xe8cc('0x11')+_0x4d499c[_0xe8cc('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x141b81,_0x572e00){promisesAdditionalPhones=[];promisesContact=[];return db[_0xe8cc('0x12')][_0xe8cc('0x13')](_0xe8cc('0x14')+tempTableName)[_0xe8cc('0x15')](function(_0xe2003b){if(_0xe2003b!==null){var _0x1d90e3=[];for(var _0x3646c7=0x0;_0x3646c7<_0xe2003b[_0xe8cc('0x16')];_0x3646c7++){var _0x171367=_0xe2003b[_0x3646c7];if(!_[_0xe8cc('0x17')](_0x171367['phone'])){if(!_['isNil'](_0x171367[_0xe8cc('0x18')]))_0x1d90e3[_0xe8cc('0x19')](insertAdditionalPhones(_0x171367));promisesContact['push']({'contact':_0x171367});}}}Promise['all'](_0x1d90e3)[_0xe8cc('0x1a')](function(){_0x141b81({'val':0x1});});})[_0xe8cc('0x1b')](function(_0x13592f){logger[_0xe8cc('0x1c')](_0x13592f[_0xe8cc('0x1d')]);});});}function insertAdditionalPhones(_0x21e933){return new Promise(function(_0x445f4f,_0x3cece3){var _0x57b5b8=_0x21e933['AdditionalPhones'];if(_[_0xe8cc('0x17')](_0x57b5b8))_0x3cece3({'val':0x0});else{var _0x54fbe6=_0x57b5b8['split'](';');var _0x342829=[];orderBy=0x0;for(var _0xf79d53=0x0;_0xf79d53<_0x54fbe6[_0xe8cc('0x16')];_0xf79d53++){_0x342829['push'](splitAdditionalPhone(_0x21e933['id'],_0x54fbe6[_0xf79d53]));}Promise[_0xe8cc('0x1e')](_0x342829)[_0xe8cc('0x1a')](function(){_0x445f4f({'val':_0x54fbe6[_0xe8cc('0x16')]});});}});}function splitAdditionalPhone(_0xf27cbc,_0x36085f){return new Promise(function(_0x27628b,_0x2106d4){var _0x578169=_0x36085f['split'](':');var _0x2741ff=_0x578169[0x0];var _0x34d6e0=_0x578169[0x1];if(_0x34d6e0!==''){var _0xb79243=_0x34d6e0[_0xe8cc('0x1f')]('|');var _0x1df19b=[];for(var _0x2709b4=0x0;_0x2709b4<_0xb79243[_0xe8cc('0x16')];_0x2709b4++){if(_0xb79243[_0x2709b4]!==''){var _0x2c5fb2=_[_0xe8cc('0x20')](promisesAdditionalPhones,{'contactId':_0xf27cbc,'phone':_0xb79243[_0x2709b4]});if(_0x2c5fb2[_0xe8cc('0x16')]==0x0){orderBy++;promisesAdditionalPhones[_0xe8cc('0x19')]({'contactId':_0xf27cbc,'contactTypeId':_0x2741ff,'phone':_0xb79243[_0x2709b4],'orderBy':orderBy});}}}_0x27628b({'ok':0x1});}else _0x27628b({'res':0x0});});}function createAdditionalPhone(_0x242597,_0x205c47,_0x35029c,_0x4a1bc9){var _0x22046f='';var _0x278b5a='';var _0x4bed04=_0x35029c[_0xe8cc('0x1f')]('§');_0x22046f=_0x4bed04[0x0];if(_0x4bed04[_0xe8cc('0x16')]==0x2)_0x278b5a=_0x4bed04[0x1];return new Promise(function(_0x420b93,_0xc86b7c){return db[_0xe8cc('0x21')][_0xe8cc('0x22')]({'where':{'CmContactId':_0x242597,'item':_0x22046f}})[_0xe8cc('0x1a')](function(_0x407137){if(_0x407137){return db[_0xe8cc('0x21')]['update']({'ItemTypeId':_0x205c47,'description':_0x278b5a,'OrderBy':_0x4a1bc9},{'where':{'CmContactId':_0x242597,'item':_0x22046f}})[_0xe8cc('0x1a')](function(_0x3d05df){_0x420b93({'res':_0xe8cc('0x23')});});}else{return db[_0xe8cc('0x21')][_0xe8cc('0x24')]({'CmContactId':_0x242597,'item':_0x22046f,'ItemTypeId':_0x205c47,'description':_0x278b5a,'OrderBy':_0x4a1bc9,'ItemClass':_0xe8cc('0x25')})[_0xe8cc('0x1a')](function(_0x279bc5){_0x420b93({'res':_0xe8cc('0x26')});});}});});}function updateContact(_0x33a0ba){return new Promise(function(_0x158ece,_0x309930){var _0x525a60=_0x33a0ba['id'];delete _0x33a0ba['id'];return db['CmContact']['update'](_0x33a0ba,{'where':{'id':_0x525a60}})['then'](function(_0x7a468e){updatedRows+=0x1;return db[_0xe8cc('0x27')][_0xe8cc('0x28')]({'phone':_0x33a0ba['phone']},{'where':{'ContactId':_0x525a60}})[_0xe8cc('0x1a')](function(_0x3dc49a){_0x158ece({'ret':'OK'});});});});}function insertCmHopper(_0x1d1fb9,_0xd7e4e3,_0x550d9a,_0x196746,_0x5ce14b){var _0x33fbb1=[_0xe8cc('0x29'),'cm_contacts.scheduledat',_0xe8cc('0x2a'),_0xe8cc('0x2b'),_0xd7e4e3+'.'+_0x196746,_0xe8cc('0x2c'),'cm_contacts.updatedAt',_0xe8cc('0x2d'),_0xe8cc('0x2e'),'\x22'+_0x5ce14b+'\x22'];return squel['insert']()[_0xe8cc('0x2f')](_0xe8cc('0x30'))[_0xe8cc('0x31')]([_0xe8cc('0x32'),_0xe8cc('0x33'),_0xe8cc('0x34'),_0xe8cc('0x35'),_0x196746,_0xe8cc('0x36'),_0xe8cc('0x37'),_0xe8cc('0x38'),_0xe8cc('0x39'),_0xe8cc('0x3a')],squel[_0xe8cc('0xd')]()[_0xe8cc('0x3b')](_0x33fbb1)[_0xe8cc('0x3c')](_0xd7e4e3)['join'](_0xe8cc('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0xd7e4e3+_0xe8cc('0x3e'))[_0xe8cc('0xf')](_0x550d9a,null,_0x550d9a+_0xe8cc('0x3f')+_0xd7e4e3+'.'+_0x196746)[_0xe8cc('0x40')](_0xd7e4e3+_0xe8cc('0x41'),_0x1d1fb9)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xe8cc('0x42'),selectNotIn(_0xd7e4e3,_0x550d9a,_0x196746,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0xe8cc('0x40')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xd7e4e3,_0x550d9a,_0x196746,'cm_hopper',['\x22always\x22'])))[_0xe8cc('0x43')]();}function insertCmHopperBlack(_0x2cddeb,_0x4c7a78,_0x282239,_0x36546c){var _0xbe7c84=[_0xe8cc('0x29'),_0xe8cc('0x2a'),'cm_contacts.ListId',_0x4c7a78+'.'+_0x36546c,_0xe8cc('0x2c'),'cm_contacts.updatedAt'];return squel[_0xe8cc('0x44')]()[_0xe8cc('0x2f')]('cm_hopper_black')['fromQuery']([_0xe8cc('0x32'),_0xe8cc('0x34'),'ListId',_0x36546c,_0xe8cc('0x36'),'updatedAt'],squel[_0xe8cc('0xd')]()[_0xe8cc('0x3b')](_0xbe7c84)[_0xe8cc('0x3c')](_0x4c7a78)[_0xe8cc('0xf')]('cm_contacts',null,_0xe8cc('0x45')+_0x4c7a78+'.CmListId')['join'](_0x282239,null,_0x282239+_0xe8cc('0x3f')+_0x4c7a78+'.'+_0x36546c)[_0xe8cc('0x40')](_0x4c7a78+_0xe8cc('0x41'),_0x2cddeb)['where'](_0xe8cc('0x46'),NOW)['where'](_0xe8cc('0x42'),squel['select']()[_0xe8cc('0xe')]('phone')[_0xe8cc('0x3c')](_0xe8cc('0x47'))[_0xe8cc('0x40')](_0xe8cc('0x48'),_0x2cddeb)[_0xe8cc('0x40')](_0x36546c+_0xe8cc('0x49'),_0x4c7a78+'.'+_0x36546c)))['toString']();}function insertCmHopperAdditionalPhones(_0x285b6d){var _0xa8603c=[_0xe8cc('0x4a'),_0xe8cc('0x4b'),_0xe8cc('0x4c'),'cm_contact_has_items.createdAt',_0xe8cc('0x4d')];return squel['insert']()[_0xe8cc('0x2f')](_0xe8cc('0x4e'))[_0xe8cc('0x31')](['CmHopperId',_0xe8cc('0x32'),_0xe8cc('0x4f'),'createdAt','updatedAt'],squel[_0xe8cc('0xd')]()[_0xe8cc('0x3b')](_0xa8603c)[_0xe8cc('0x3c')](_0xe8cc('0x30'))[_0xe8cc('0xf')](_0xe8cc('0x3d'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xe8cc('0xf')]('cm_contact_has_items',null,_0xe8cc('0x50'))[_0xe8cc('0x40')](_0xe8cc('0x51'),_0x285b6d)[_0xe8cc('0x40')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xe8cc('0x43')]();}function insertCmContact(_0x451c2c,_0xd2742f,_0x4c40d0,_0x441b7e){var _0x24fd42=_['concat'](_[_0xe8cc('0x52')](_0x441b7e),[_0xe8cc('0x35'),'CompanyId','createdAt','updatedAt']);return squel[_0xe8cc('0x44')]()[_0xe8cc('0x2f')](_0xe8cc('0x3d'))[_0xe8cc('0x31')](_0x24fd42,squel[_0xe8cc('0xd')]()['fields'](_0x24fd42)['from'](_0xd2742f)[_0xe8cc('0x40')]('('+_0x4c40d0[_0xe8cc('0xf')](',')+')\x20NOT\x20IN\x20?',squel[_0xe8cc('0xd')]()[_0xe8cc('0x3b')](_0x4c40d0)[_0xe8cc('0x3c')](_0xe8cc('0x3d'))['where']('ListId\x20=\x20?',_0x451c2c))[_0xe8cc('0x40')](_0xe8cc('0x53'),squel[_0xe8cc('0xd')]()[_0xe8cc('0xe')](_0xe8cc('0x54'),'min_id')[_0xe8cc('0x3c')](_0xd2742f)[_0xe8cc('0x55')](_0x4c40d0[_0xe8cc('0xf')](','))))[_0xe8cc('0x43')]();}function handleStop(){logger['info'](_0xe8cc('0x56'));stopped=!![];}function handleUncaughtException(_0x3a35fa){logger[_0xe8cc('0x1c')](_0x3a35fa[_0xe8cc('0x1d')]);process[_0xe8cc('0x57')](0x1);}function handleError(_0x34d784,_0x4736e7){stats[_0xe8cc('0x58')]['push']({'name':_0x4736e7[_0xe8cc('0x59')],'message':_0x4736e7[_0xe8cc('0x1d')],'row':_0x34d784});}function handleQuery(_0x50d428){logger[_0xe8cc('0x5a')](_0x50d428);return db[_0xe8cc('0x12')]['query'](_0x50d428)[_0xe8cc('0x15')](function(_0x143821){results['push'](_0x143821);})[_0xe8cc('0x1b')](function(_0x2e0754){logger[_0xe8cc('0x1c')](_0x2e0754[_0xe8cc('0x1d')]);});}function main(_0x455b85,_0x542f09,_0x1ae878,_0x3b62b2){logger[_0xe8cc('0x5a')](_0xe8cc('0x5b'),_0x455b85,JSON[_0xe8cc('0x5c')](_0x542f09));process['send'](_0xe8cc('0x5d'));var _0x56c38a=_0x542f09['binding'];var _0x2d742d=_[_0xe8cc('0x5e')](_0x56c38a);var _0x3a4dc0=_0x542f09[_0xe8cc('0x5f')];var _0x2db3d5=path['join'](config[_0xe8cc('0x60')],_0xe8cc('0x61'),_0x3a4dc0+_0xe8cc('0x62'));logger[_0xe8cc('0x5a')]('body',_0x542f09);db[_0xe8cc('0x63')][_0xe8cc('0x64')]({'raw':!![],'attributes':['id',_0xe8cc('0x65')]})[_0xe8cc('0x1a')](function(_0x3e2695){for(var _0x425299=0x0;_0x425299<_0x3e2695[_0xe8cc('0x16')];_0x425299++){if(_0x3e2695[_0x425299]['name']in _0x56c38a){contactItemTypes['push'](_0x3e2695[_0x425299]);delete _0x2d742d[_0x3e2695[_0x425299][_0xe8cc('0x65')]];hasAdditionalPhones=!![];}for(var _0x1e3abc in _0x56c38a){if(_0x3e2695[_0x425299]['name']+_0xe8cc('0x66')===_0x1e3abc){phoneDescriptions[_0xe8cc('0x19')]({'itemTypeId':_0x3e2695[_0x425299]['id'],'description':_0x1e3abc});delete _0x2d742d[_0x1e3abc];}}}if(hasAdditionalPhones)_0x2d742d['AdditionalPhones']='';var _0x50cdbc=_[_0xe8cc('0x52')](_0x2d742d)[_0xe8cc('0xf')]();logger[_0xe8cc('0x5a')](_0xe8cc('0x67'),_0x50cdbc);fs[_0xe8cc('0x68')](_0x2db3d5,_0x50cdbc+'\x0a');Papa['parse'](fs['createReadStream'](_0x455b85),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4bb1ed,_0x325218){try{for(var _0x5aab44=0x0,_0x5e1369=[];_0x5aab44<_0x4bb1ed['data']['length'];_0x5aab44++){stats[_0xe8cc('0x69')]+=0x1;if(_0x4bb1ed[_0xe8cc('0x58')][_0x5aab44]){handleError(_0x4bb1ed['data'][_0x5aab44],_0x4bb1ed[_0xe8cc('0x58')][_0x5aab44]);}else{var _0x4e2f61=[];var _0x457e95=[];var _0x1190e4={};for(var _0x405d6c in _0x56c38a){let _0x4707e6=contactItemTypes['find'](_0x461719=>_0x461719[_0xe8cc('0x65')]===_0x405d6c);let _0x29c0b5=contactItemTypes[_0xe8cc('0x6a')](_0x5bea4f=>_0x5bea4f[_0xe8cc('0x65')]+_0xe8cc('0x66')===_0x405d6c);if(_[_0xe8cc('0x17')](_0x4707e6)&&_['isNil'](_0x29c0b5)){if(_0x56c38a[_0xe8cc('0x6b')](_0x405d6c)){if(_0x4bb1ed[_0xe8cc('0x6c')][_0x5aab44][_0x56c38a[_0x405d6c]]){var _0x46545d=_['trim'](_0x4bb1ed['data'][_0x5aab44][_0x56c38a[_0x405d6c]][_0xe8cc('0x6d')](/"/g,'\x27'));switch(_0x405d6c){case'scheduledat':var _0x4deaa1=moment(_0x46545d,_0xe8cc('0xb'),!![]);if(_0x4deaa1[_0xe8cc('0x6e')]()){_0x5e1369['push']('\x22'+_0x46545d+'\x22');}else{_0x4e2f61[_0xe8cc('0x19')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x430855=parseInt(_0x46545d);_0x46545d=_[_0xe8cc('0x6f')](_0x430855)||_0x430855<0x0||_0x430855>0x4?_0x3b62b2?0x3:0x2:_0x430855;_0x5e1369[_0xe8cc('0x19')]('\x22'+_0x46545d+'\x22');break;case _0xe8cc('0x39'):var _0xbaafb9=parseInt(_0x46545d);if(_['isNumber'](_0xbaafb9)&&_[_0xe8cc('0x70')](_0x1ae878,_0xbaafb9)){_0x5e1369['push']('\x22'+_0xbaafb9+'\x22');}else{_0x4e2f61['push'](_0xe8cc('0x71'));}break;case _0xe8cc('0x72'):if(isEmail(_0x46545d)){_0x5e1369[_0xe8cc('0x19')]('\x22'+_0x46545d+'\x22');}else{_0x4e2f61['push'](_0xe8cc('0x73'));}break;case _0xe8cc('0x74'):var _0x3811ba=moment(_0x46545d,_0xe8cc('0x75'),!![]);if(_0x3811ba[_0xe8cc('0x6e')]()){_0x5e1369[_0xe8cc('0x19')]('\x22'+_0x46545d+'\x22');}else{_0x4e2f61['push'](_0xe8cc('0x76'));}break;default:_0x5e1369['push']('\x22'+_0x46545d+'\x22');}}else{switch(_0x405d6c){case _0xe8cc('0x77'):case _0xe8cc('0x32'):_0x4e2f61[_0xe8cc('0x19')](_0x405d6c+_0xe8cc('0x78'));break;default:_0x5e1369[_0xe8cc('0x19')]('\x22\x22');}}}}else{var _0x2777fb='';if(!_['isNil'](_0x4707e6)){if(!_0x1190e4[_0xe8cc('0x6b')](_0x4707e6['id'])){for(var _0x548bd8=0x0;_0x548bd8<_0x56c38a[_0x405d6c]['length'];_0x548bd8++){var _0x46545d=_[_0xe8cc('0x79')](_0x4bb1ed[_0xe8cc('0x6c')][_0x5aab44][_0x56c38a[_0x405d6c][_0x548bd8]][_0xe8cc('0x6d')](/"/g,'\x27'));var _0x19725c=phoneDescriptions[_0xe8cc('0x6a')](_0xa41474=>_0xa41474['itemTypeId']===_0x4707e6['id']);if(!_[_0xe8cc('0x17')](_0x19725c)){var _0x19a08b=_[_0xe8cc('0x79')](_0x4bb1ed[_0xe8cc('0x6c')][_0x5aab44][_0x56c38a[_0x19725c[_0xe8cc('0x7a')]][0x0]][_0xe8cc('0x6d')](/"/g,'\x27'));if(!_[_0xe8cc('0x17')](_0x19a08b))_0x46545d=_0x46545d+'§'+_0x19a08b;}if(_0x2777fb=='')_0x2777fb=_0x46545d;else _0x2777fb+='|'+_0x46545d;}_0x457e95['push'](_0x4707e6['id']+':'+_0x2777fb);_0x1190e4[_0x4707e6['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5e1369['push']('\x22'+_0x457e95[_0xe8cc('0xf')](';')+'\x22');}if(_0x4e2f61[_0xe8cc('0x16')]){handleError(_0x4bb1ed[_0xe8cc('0x6c')][_0x5aab44],{'code':'SystemRow','message':_0x4e2f61[_0xe8cc('0xf')]()});}else{fs[_0xe8cc('0x7b')](_0x2db3d5,_0x5e1369[_0xe8cc('0xf')]()+'\x0a');}_0x5e1369=[];}if(!(stats[_0xe8cc('0x69')]%0xc8)){socket[_0xe8cc('0x7c')](_0xe8cc('0x7d')+_0x3a4dc0,stats);stats[_0xe8cc('0x58')]=[];}}if(stopped){logger[_0xe8cc('0x5a')](_0xe8cc('0x7e'));_0x325218[_0xe8cc('0x7f')]();}}catch(_0x231928){handleError(_0x4bb1ed[_0xe8cc('0x6c')][_0x5aab44],{'code':'SystemError','message':_0x231928[_0xe8cc('0x1d')]});logger['error'](_0xe8cc('0x80'),_0x231928[_0xe8cc('0x1d')]);}},'complete':function(){try{var _0x5b139a=[];var _0x579e49=tempTableName;_0x5b139a[_0xe8cc('0x19')](_0xe8cc('0x81')+_0x579e49+_0xe8cc('0x82'));logger[_0xe8cc('0x5a')](_0xe8cc('0x83'),contactItemTypes[_0xe8cc('0x16')]);var _0x2b2be7=util['format'](_0xe8cc('0x84'),_0x2db3d5,_0x579e49,_0x50cdbc,_0x542f09[_0xe8cc('0x35')],_0x542f09['CompanyId']||null,NOW,NOW);if(_[_0xe8cc('0x17')](_0x56c38a[_0xe8cc('0x33')])){_0x2b2be7+=_0xe8cc('0x85');}_0x5b139a[_0xe8cc('0x19')](_0x2b2be7);BPromise['each'](_0x5b139a,handleQuery)[_0xe8cc('0x1a')](function(_0x11d52e){BPromise[_0xe8cc('0x1e')]([handleAdditionalPhones()])[_0xe8cc('0x1a')](function(){_0x5b139a=[];for(var _0x3f1621=0x0;_0x3f1621_0x453ba2[_0x5d2f('0x65')]===_0x4e07cf);let _0x89714d=contactItemTypes[_0x5d2f('0x6b')](_0x11b341=>_0x11b341[_0x5d2f('0x65')]+_0x5d2f('0x6c')===_0x4e07cf);if(_[_0x5d2f('0x19')](_0x24acf)&&_[_0x5d2f('0x19')](_0x89714d)){if(_0x125a57[_0x5d2f('0x6d')](_0x4e07cf)){if(_0x385c37[_0x5d2f('0x69')][_0x147e49][_0x125a57[_0x4e07cf]]){var _0x2259b5=_[_0x5d2f('0x6e')](_0x385c37[_0x5d2f('0x69')][_0x147e49][_0x125a57[_0x4e07cf]][_0x5d2f('0x6f')](/"/g,'\x27'));switch(_0x4e07cf){case _0x5d2f('0x30'):var _0x3d3de1=moment(_0x2259b5,_0x5d2f('0x70'),!![]);if(_0x3d3de1[_0x5d2f('0x71')]()){_0x24e4a8[_0x5d2f('0x1b')]('\x22'+_0x2259b5+'\x22');}else{_0xe0df4b[_0x5d2f('0x1b')](_0x5d2f('0x72'));}break;case'priority':var _0x13fe52=parseInt(_0x2259b5);_0x2259b5=_[_0x5d2f('0x73')](_0x13fe52)||_0x13fe52<0x0||_0x13fe52>0x4?_0xd87527?0x3:0x2:_0x13fe52;_0x24e4a8[_0x5d2f('0x1b')]('\x22'+_0x2259b5+'\x22');break;case'UserId':var _0x4b1bb4=parseInt(_0x2259b5);if(_[_0x5d2f('0x74')](_0x4b1bb4)&&_[_0x5d2f('0x75')](_0x340ae3,_0x4b1bb4)){_0x24e4a8[_0x5d2f('0x1b')]('\x22'+_0x4b1bb4+'\x22');}else{_0xe0df4b[_0x5d2f('0x1b')]('agent\x20not\x20exists');}break;case _0x5d2f('0x76'):if(isEmail(_0x2259b5)){_0x24e4a8['push']('\x22'+_0x2259b5+'\x22');}else{_0xe0df4b[_0x5d2f('0x1b')]('email\x20wrong\x20format');}break;case _0x5d2f('0x77'):var _0x4fa878=moment(_0x2259b5,_0x5d2f('0x78'),!![]);if(_0x4fa878[_0x5d2f('0x71')]()){_0x24e4a8[_0x5d2f('0x1b')]('\x22'+_0x2259b5+'\x22');}else{_0xe0df4b[_0x5d2f('0x1b')](_0x5d2f('0x79'));}break;default:_0x24e4a8['push']('\x22'+_0x2259b5+'\x22');}}else{switch(_0x4e07cf){case _0x5d2f('0x7a'):case _0x5d2f('0xf'):_0xe0df4b[_0x5d2f('0x1b')](_0x4e07cf+_0x5d2f('0x7b'));break;default:_0x24e4a8['push']('\x22\x22');}}}}else{var _0x17fb56='';if(!_['isNil'](_0x24acf)){if(!_0x53f4f2[_0x5d2f('0x6d')](_0x24acf['id'])){for(var _0x5535eb=0x0;_0x5535eb<_0x125a57[_0x4e07cf]['length'];_0x5535eb++){var _0x2259b5=_['trim'](_0x385c37[_0x5d2f('0x69')][_0x147e49][_0x125a57[_0x4e07cf][_0x5535eb]][_0x5d2f('0x6f')](/"/g,'\x27'));var _0x281387=phoneDescriptions[_0x5d2f('0x6b')](_0x505749=>_0x505749[_0x5d2f('0x7c')]===_0x24acf['id']);if(!_[_0x5d2f('0x19')](_0x281387)){var _0x2a8a6c=_['trim'](_0x385c37['data'][_0x147e49][_0x125a57[_0x281387['description']][0x0]][_0x5d2f('0x6f')](/"/g,'\x27'));if(!_[_0x5d2f('0x19')](_0x2a8a6c))_0x2259b5=_0x2259b5+'§'+_0x2a8a6c;}if(_0x17fb56=='')_0x17fb56=_0x2259b5;else _0x17fb56+='|'+_0x2259b5;}_0x8baa61['push'](_0x24acf['id']+':'+_0x17fb56);_0x53f4f2[_0x24acf['id']]=0x1;}}}}if(hasAdditionalPhones){_0x24e4a8[_0x5d2f('0x1b')]('\x22'+_0x8baa61['join'](';')+'\x22');}if(_0xe0df4b[_0x5d2f('0x18')]){handleError(_0x385c37[_0x5d2f('0x69')][_0x147e49],{'code':'SystemRow','message':_0xe0df4b[_0x5d2f('0x11')]()});}else{fs[_0x5d2f('0x7d')](_0x56fc8c,_0x24e4a8[_0x5d2f('0x11')]()+'\x0a');}_0x24e4a8=[];}if(!(stats[_0x5d2f('0x6a')]%0xc8)){socket[_0x5d2f('0x7e')](_0x5d2f('0x7f')+_0x3c426a,stats);stats['errors']=[];}}if(stopped){logger[_0x5d2f('0x56')](_0x5d2f('0x80'));_0x5cdf48[_0x5d2f('0x81')]();}}catch(_0x25597b){handleError(_0x385c37['data'][_0x147e49],{'code':'SystemError','message':_0x25597b[_0x5d2f('0x20')]});logger[_0x5d2f('0x1f')](_0x5d2f('0x82'),_0x25597b[_0x5d2f('0x20')]);}},'complete':function(){try{var _0x1db907=[];var _0x530ece=tempTableName;_0x1db907['push']('CREATE\x20TABLE\x20'+_0x530ece+'\x20LIKE\x20cm_contacts;');logger[_0x5d2f('0x56')]('CIS\x20len',contactItemTypes[_0x5d2f('0x18')]);var _0x5d5678=util[_0x5d2f('0xb')](_0x5d2f('0x83'),_0x56fc8c,_0x530ece,_0x3a5e4d,_0x25941a['ListId'],_0x25941a['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x125a57['scheduledat'])){_0x5d5678+=_0x5d2f('0x84');}_0x1db907[_0x5d2f('0x1b')](_0x5d5678);BPromise['each'](_0x1db907,handleQuery)['then'](function(_0x398a55){BPromise[_0x5d2f('0x1c')]([handleAdditionalPhones()])[_0x5d2f('0x1d')](function(){_0x1db907=[];for(var _0x5675c8=0x0;_0x5675c8\x20\x20');}var _0x44c918=path[_0x5d2f('0x11')](config['root'],'server/files/tmp',process[_0x5d2f('0x8c')][0x2]);if(!fs[_0x5d2f('0x8d')](_0x44c918)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2a466a={};try{_0x2a466a=JSON['parse'](process[_0x5d2f('0x8c')][0x3]);if(!_0x2a466a[_0x5d2f('0x5f')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x39fc82=0x0;if(_0x2a466a[_0x5d2f('0x5f')]['UserId']){_0x39fc82=0x1;}if(!_0x2a466a[_0x5d2f('0x32')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x313a06){throw new Error('body\x20id\x20mandatory');}var _0x405f5e=[];try{_0x405f5e=_[_0x5d2f('0x8e')](JSON[_0x5d2f('0x68')](process[_0x5d2f('0x8c')][0x4]),'id');}catch(_0x15a301){logger[_0x5d2f('0x56')](_0x5d2f('0x8f'));}main(_0x44c918,_0x2a466a,_0x405f5e,_0x39fc82);}validate();process['on'](_0x5d2f('0x90'),handleStop);process['on'](_0x5d2f('0x91'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 5b9c14f..3ef72cc 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4890=['Outbound\x20Call','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','destcalleridnum','Member\x20Name','UniqueId','Date','***\x20Time\x20Info\x20***','answertime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','string'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x4890,0x95));var _0x0489=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x4890[_0x543084];return _0x306a57;};'use strict';exports[_0x0489('0x0')]=function(_0x284d0e,_0x2af6a4){var _0x54dbcc=[{'type':'string','content':_0x0489('0x1'),'variableName':null}];switch(_0x284d0e['toLowerCase']()){case _0x0489('0x2'):switch(_0x2af6a4[_0x0489('0x3')]()){case _0x0489('0x4'):_0x54dbcc[_0x0489('0x5')]({'type':_0x0489('0x6'),'content':'','variableName':_0x0489('0x7')});_0x54dbcc[_0x0489('0x5')]({'type':_0x0489('0x6'),'content':'','variableName':_0x0489('0x8')});break;case _0x0489('0x9'):_0x54dbcc[_0x0489('0x5')]({'type':_0x0489('0xa'),'content':_0x0489('0xb'),'variableName':null});_0x54dbcc[_0x0489('0x5')]({'type':_0x0489('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x54dbcc;};exports['getDescriptions']=function(_0x359004,_0x2410d8){var _0x40b790=[];switch(_0x359004[_0x0489('0x3')]()){case _0x0489('0x2'):switch(_0x2410d8[_0x0489('0x3')]()){case _0x0489('0x4'):_0x40b790=[{'type':_0x0489('0xa'),'content':_0x0489('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0xe'),'keyType':_0x0489('0x6'),'variableName':_0x0489('0x8')},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0xf'),'keyType':_0x0489('0x6'),'variableName':_0x0489('0x10')},{'type':'keyValue','content':'','key':_0x0489('0x11'),'keyType':_0x0489('0x6'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0x0489('0x12'),'keyType':_0x0489('0x6'),'variableName':_0x0489('0x7')},{'type':_0x0489('0xd'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0x0489('0x13')},{'type':'keyValue','content':'','key':'Date','keyType':_0x0489('0x6'),'variableName':_0x0489('0x14')},{'type':_0x0489('0xa'),'content':_0x0489('0x15'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0x0489('0x6'),'variableName':'destcalleridname'},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x16'),'keyType':_0x0489('0x6'),'variableName':'destcalleridnum'},{'type':_0x0489('0xa'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x17'),'keyType':_0x0489('0x6'),'variableName':'agentcalledAt'},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x18'),'keyType':_0x0489('0x6'),'variableName':'agentconnectAt'},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x19'),'keyType':_0x0489('0x6'),'variableName':_0x0489('0x1a')},{'type':'keyValue','content':'','key':_0x0489('0x1b'),'keyType':_0x0489('0x6'),'variableName':_0x0489('0x1c')},{'type':'keyValue','content':'','key':_0x0489('0x1d'),'keyType':_0x0489('0x6'),'variableName':'talktime'}];break;case _0x0489('0x9'):_0x40b790=[{'type':_0x0489('0xa'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x0489('0xd'),'content':'','key':'Called\x20Number','keyType':_0x0489('0x6'),'keyContent':'','variableName':_0x0489('0x1e')},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x1f'),'keyType':_0x0489('0x6'),'keyContent':'','variableName':'membername'},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x20'),'keyType':'variable','keyContent':'','variableName':_0x0489('0x13')},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x21'),'keyType':_0x0489('0x6'),'keyContent':'','variableName':'starttime'},{'type':'string','content':_0x0489('0x22')},{'type':_0x0489('0xd'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0x0489('0x23')},{'type':_0x0489('0xd'),'content':'','key':'Complete\x20Time','keyType':_0x0489('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x24'),'keyType':_0x0489('0x6'),'keyContent':'','variableName':_0x0489('0x25')},{'type':_0x0489('0xd'),'content':'','key':_0x0489('0x26'),'keyType':'variable','keyContent':'','variableName':_0x0489('0x27')}];break;}}return _0x40b790;}; \ No newline at end of file +var _0x1ffd=['talktime','Member\x20Name','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','queue','calleridnum','outbound','Outbound\x20Call','variable','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ffd,0x169));var _0xd1ff=function(_0x4921d8,_0x44a3de){_0x4921d8=_0x4921d8-0x0;var _0x4b3001=_0x1ffd[_0x4921d8];return _0x4b3001;};'use strict';exports[_0xd1ff('0x0')]=function(_0x396899,_0x385d3e){var _0xbb13b5=[{'type':_0xd1ff('0x1'),'content':_0xd1ff('0x2'),'variableName':null}];switch(_0x396899[_0xd1ff('0x3')]()){case'voice':switch(_0x385d3e[_0xd1ff('0x3')]()){case _0xd1ff('0x4'):_0xbb13b5[_0xd1ff('0x5')]({'type':'variable','content':'','variableName':_0xd1ff('0x6')});_0xbb13b5[_0xd1ff('0x5')]({'type':'variable','content':'','variableName':_0xd1ff('0x7')});break;case _0xd1ff('0x8'):_0xbb13b5[_0xd1ff('0x5')]({'type':_0xd1ff('0x1'),'content':_0xd1ff('0x9'),'variableName':null});_0xbb13b5['push']({'type':_0xd1ff('0xa'),'content':'','variableName':_0xd1ff('0xb')});break;}}return _0xbb13b5;};exports[_0xd1ff('0xc')]=function(_0x348c79,_0x2cc12){var _0x225347=[];switch(_0x348c79[_0xd1ff('0x3')]()){case'voice':switch(_0x2cc12[_0xd1ff('0x3')]()){case'inbound':_0x225347=[{'type':_0xd1ff('0x1'),'content':_0xd1ff('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0xf'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x7')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x10'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x11')},{'type':'keyValue','content':'','key':_0xd1ff('0x12'),'keyType':_0xd1ff('0xa'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0xd1ff('0x13'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x6')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x14'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x15')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x16'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x17')},{'type':_0xd1ff('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x18'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x19')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x1a'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0xb')},{'type':_0xd1ff('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x1b'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x17')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x1c'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x1d')},{'type':'keyValue','content':'','key':_0xd1ff('0x1e'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x1f')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x20'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x21')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x22'),'keyType':_0xd1ff('0xa'),'variableName':_0xd1ff('0x23')}];break;case _0xd1ff('0x8'):_0x225347=[{'type':_0xd1ff('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0xd1ff('0xb')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x24'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0xd1ff('0x14'),'keyType':_0xd1ff('0xa'),'keyContent':'','variableName':_0xd1ff('0x15')},{'type':'keyValue','content':'','key':'Date','keyType':_0xd1ff('0xa'),'keyContent':'','variableName':'starttime'},{'type':_0xd1ff('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x25'),'keyType':_0xd1ff('0xa'),'keyContent':'','variableName':_0xd1ff('0x26')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x27'),'keyType':_0xd1ff('0xa'),'keyContent':'','variableName':_0xd1ff('0x28')},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x29'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0xd1ff('0xe'),'content':'','key':_0xd1ff('0x2a'),'keyType':'variable','keyContent':'','variableName':_0xd1ff('0x2b')}];break;}}return _0x225347;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index de8e353..be7d4d6 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0d7=['phone','fax','mobile','updateUser','./utils','findAll','getInteractionsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','body','contact','default','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','i.id','ids','tag','countFilteredInteractions','count','length','clause','order','forEach','DESC','getFilteredInteractions','rows','catch','tracked','query','html'];(function(_0x1a1442,_0x2623e9){var _0x11d248=function(_0x5e5011){while(--_0x5e5011){_0x1a1442['push'](_0x1a1442['shift']());}};_0x11d248(++_0x2623e9);}(_0xc0d7,0x194));var _0x7c0d=function(_0x44a64f,_0xb01415){_0x44a64f=_0x44a64f-0x0;var _0x33af6e=_0xc0d7[_0x44a64f];return _0x33af6e;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var utils=require(_0x7c0d('0x0'));exports[_0x7c0d('0x1')]=function(_0x3d68f1,_0x64c530,_0x26bdd7,_0x4b7662,_0x388587){var _0x165e01={'count':0x0,'rows':[]};var _0x33e259=sqlUtils['skipInteractionsQuery'](_0x3d68f1,_0x26bdd7,_0x64c530);if(_0x33e259){return Promise['resolve'](_0x165e01);}var _0x34a097=sqlUtils[_0x7c0d('0x2')](_0x3d68f1);var _0x43853e={};return Promise[_0x7c0d('0x3')]()[_0x7c0d('0x4')](function(){if(_0x64c530[_0x7c0d('0x5')]){return sqlUtils[_0x7c0d('0x6')](_0x64c530[_0x7c0d('0x5')],_0x388587);}else{return sqlUtils[_0x7c0d('0x7')](_0x3d68f1,_0x64c530,_0x388587);}})['then'](function(_0x111426){_0x34a097[_0x7c0d('0x8')](_0x111426[_0x7c0d('0x9')]);_0x34a097[_0x7c0d('0x8')](_0x111426[_0x7c0d('0xa')]);_0x34a097[_0x7c0d('0x8')](_0x111426[_0x7c0d('0xb')]);_0x34a097['where'](_0x111426[_0x7c0d('0xc')]);_0x34a097['where'](_0x111426[_0x7c0d('0xd')]);_0x34a097[_0x7c0d('0x8')](_0x111426[_0x7c0d('0xe')]);_0x34a097[_0x7c0d('0xf')](_0x111426[_0x7c0d('0x10')]);_0x43853e=_0x111426[_0x7c0d('0x11')];return sqlUtils[_0x7c0d('0x12')](_0x3d68f1,_0x26bdd7,_0x64c530);})['then'](function(_0x289b0f){_0x34a097['where'](_0x289b0f);_0x34a097[_0x7c0d('0x13')](_0x7c0d('0x14'));var _0x31e324=_0x64c530[_0x7c0d('0x5')]?_0x43853e[_0x7c0d('0x15')]:_0x64c530[_0x7c0d('0x16')];return sqlUtils[_0x7c0d('0x17')](_0x34a097,_0x31e324);})['then'](function(_0x7ee522){_0x165e01[_0x7c0d('0x18')]=_0x7ee522[_0x7c0d('0x19')];if(_0x165e01[_0x7c0d('0x18')]===0x0){return[];}_0x34a097['having'](_0x43853e[_0x7c0d('0x1a')]);if(_0x4b7662[_0x7c0d('0x1b')]){_0x4b7662[_0x7c0d('0x1b')][_0x7c0d('0x1c')](function(_0x50c45e){var _0x14fabc=_0x50c45e[0x0]==='contactName'?_0x50c45e[0x0]:'i.'+_0x50c45e[0x0];_0x34a097[_0x7c0d('0x1b')](_0x14fabc,_0x50c45e[0x1]===_0x7c0d('0x1d')?![]:!![]);if(_0x50c45e[0x0]==='closed'){var _0x14fc48=sqlUtils['getClosedOrderClause'](_0x3d68f1,_0x64c530);_0x34a097[_0x7c0d('0x1b')](_0x14fc48,_0x50c45e[0x1]===_0x7c0d('0x1d')?![]:!![]);}});}return sqlUtils[_0x7c0d('0x1e')](_0x3d68f1,_0x34a097,_0x64c530,_0x4b7662);})['then'](function(_0x5aa6b0){_0x165e01[_0x7c0d('0x1f')]=_0x5aa6b0;return _0x165e01;})[_0x7c0d('0x20')](function(_0x3f0725){throw _0x3f0725;});};exports[_0x7c0d('0x21')]=function(_0x46a383,_0x42fc91){return function(_0xf69a04,_0x53ce1d,_0x1da5bb){var _0xc10d55=_0xf69a04['user'];var _0x53ed19={};var _0x529bdd=_0xf69a04[_0x7c0d('0x22')];if(_0x53ed19){_0x53ed19=_['clone'](_0xf69a04[_0x7c0d('0x9')]);_0x53ed19=_['omit'](_0x53ed19,[_0x7c0d('0x9'),_0x7c0d('0x23'),_0x7c0d('0x24'),_0x7c0d('0x25'),_0x7c0d('0x26')]);}utils[_0x7c0d('0x27')](_0xc10d55,_0x53ed19,_0x529bdd,_0x46a383,_0x42fc91);_0x1da5bb(null);};}; \ No newline at end of file +var _0x8b2b=['fields','filter','user','having','read','tags','i.id','ids','tag','count','length','order','forEach','DESC','closed','getClosedOrderClause','rows','catch','tracked','query','clone','omit','html','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','getInteractionsQuery','resolve','search','parseAdvancedSearchFilter','parseQueryParameters','then','where','body','contact'];(function(_0x201b60,_0x255a41){var _0xcc77ed=function(_0x1734e6){while(--_0x1734e6){_0x201b60['push'](_0x201b60['shift']());}};_0xcc77ed(++_0x255a41);}(_0x8b2b,0x96));var _0xb8b2=function(_0x229adb,_0xeeaf62){_0x229adb=_0x229adb-0x0;var _0xd5ae20=_0x8b2b[_0x229adb];return _0xd5ae20;};'use strict';var _=require(_0xb8b2('0x0'));var sqlUtils=require(_0xb8b2('0x1'));var utils=require(_0xb8b2('0x2'));exports[_0xb8b2('0x3')]=function(_0x51f2b2,_0x51ca52,_0x398256,_0x119149,_0x2c5cfa){var _0x84faa5={'count':0x0,'rows':[]};var _0x4a9575=sqlUtils[_0xb8b2('0x4')](_0x51f2b2,_0x398256,_0x51ca52);if(_0x4a9575){return Promise['resolve'](_0x84faa5);}var _0x159fe4=sqlUtils[_0xb8b2('0x5')](_0x51f2b2);var _0x1debd4={};return Promise[_0xb8b2('0x6')]()['then'](function(){if(_0x51ca52[_0xb8b2('0x7')]){return sqlUtils[_0xb8b2('0x8')](_0x51ca52['search'],_0x2c5cfa);}else{return sqlUtils[_0xb8b2('0x9')](_0x51f2b2,_0x51ca52,_0x2c5cfa);}})[_0xb8b2('0xa')](function(_0x274ca3){_0x159fe4[_0xb8b2('0xb')](_0x274ca3[_0xb8b2('0xc')]);_0x159fe4['where'](_0x274ca3[_0xb8b2('0xd')]);_0x159fe4['where'](_0x274ca3['default']);_0x159fe4[_0xb8b2('0xb')](_0x274ca3[_0xb8b2('0xe')]);_0x159fe4[_0xb8b2('0xb')](_0x274ca3[_0xb8b2('0xf')]);_0x159fe4[_0xb8b2('0xb')](_0x274ca3[_0xb8b2('0x10')]);_0x159fe4[_0xb8b2('0x11')](_0x274ca3[_0xb8b2('0x12')]);_0x1debd4=_0x274ca3[_0xb8b2('0x13')];return sqlUtils['checkAccountsRestrictions'](_0x51f2b2,_0x398256,_0x51ca52);})[_0xb8b2('0xa')](function(_0x537280){_0x159fe4[_0xb8b2('0xb')](_0x537280);_0x159fe4['group'](_0xb8b2('0x14'));var _0x29b696=_0x51ca52[_0xb8b2('0x7')]?_0x1debd4[_0xb8b2('0x15')]:_0x51ca52[_0xb8b2('0x16')];return sqlUtils['countFilteredInteractions'](_0x159fe4,_0x29b696);})[_0xb8b2('0xa')](function(_0xacb51){_0x84faa5[_0xb8b2('0x17')]=_0xacb51[_0xb8b2('0x18')];if(_0x84faa5['count']===0x0){return[];}_0x159fe4[_0xb8b2('0x11')](_0x1debd4['clause']);if(_0x119149[_0xb8b2('0x19')]){_0x119149[_0xb8b2('0x19')][_0xb8b2('0x1a')](function(_0x2fccc7){var _0x1c6e77=_0x2fccc7[0x0]==='contactName'?_0x2fccc7[0x0]:'i.'+_0x2fccc7[0x0];_0x159fe4[_0xb8b2('0x19')](_0x1c6e77,_0x2fccc7[0x1]===_0xb8b2('0x1b')?![]:!![]);if(_0x2fccc7[0x0]===_0xb8b2('0x1c')){var _0x179666=sqlUtils[_0xb8b2('0x1d')](_0x51f2b2,_0x51ca52);_0x159fe4[_0xb8b2('0x19')](_0x179666,_0x2fccc7[0x1]===_0xb8b2('0x1b')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x51f2b2,_0x159fe4,_0x51ca52,_0x119149);})[_0xb8b2('0xa')](function(_0xed8060){_0x84faa5[_0xb8b2('0x1e')]=_0xed8060;return _0x84faa5;})[_0xb8b2('0x1f')](function(_0x42c6e4){throw _0x42c6e4;});};exports[_0xb8b2('0x20')]=function(_0x5798f8,_0x3d85f7){return function(_0x4f999a,_0xbac311,_0x30f918){var _0x3129fc=_0x4f999a[_0xb8b2('0x10')];var _0x376b48={};var _0x46d487=_0x4f999a[_0xb8b2('0x21')];if(_0x376b48){_0x376b48=_[_0xb8b2('0x22')](_0x4f999a[_0xb8b2('0xc')]);_0x376b48=_[_0xb8b2('0x23')](_0x376b48,['body',_0xb8b2('0x24'),_0xb8b2('0x25'),_0xb8b2('0x26'),_0xb8b2('0x27')]);}utils[_0xb8b2('0x28')](_0x3129fc,_0x376b48,_0x46d487,_0x5798f8,_0x3d85f7);_0x30f918(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 740933b..aed2f1f 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf72b=['offset','toString','Setting','findOne','clone','COUNT(*)','t.id\x20IN\x20?','exports','lodash','../parsers/advancedSearch','./update-interaction','updateInteraction','../../mysqldb','role','agent','search','select','field','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','getAccountFK','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','accounts','a.id\x20=\x20i.','messages','\x20=\x20i.id','it.','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','openchannel','i.from\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','sqlOperator','conditions','name','buildExpression','default','text','start','and','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','end','ids','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','user','body','some','compact','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','read','tags','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','capitalize','Interaction','QueryTypes','SELECT','sequelize','query','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','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.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','i.UserId','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.internal','TagIds','limit'];(function(_0x56dbe5,_0x57fa97){var _0x47009d=function(_0x2ed2db){while(--_0x2ed2db){_0x56dbe5['push'](_0x56dbe5['shift']());}};_0x47009d(++_0x57fa97);}(_0xf72b,0x1d9));var _0xbf72=function(_0x24862f,_0x18519a){_0x24862f=_0x24862f-0x0;var _0x415410=_0xf72b[_0x24862f];return _0x415410;};'use strict';var _=require(_0xbf72('0x0'));var squel=require('squel');var as=require(_0xbf72('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0xbf72('0x2'))[_0xbf72('0x3')];var utils=require('./utils');var db=require(_0xbf72('0x4'))['db'];function skipInteractionsQuery(_0x550a9e,_0x37afc8,_0x3d3a6f){var _0x3b2fa6=![];var _0x2b8440=utils['getAccountFK'](_0x550a9e);if(_0x37afc8[_0xbf72('0x5')]===_0xbf72('0x6')&&!_0x3d3a6f[_0xbf72('0x7')]&&!_0x3d3a6f[_0x2b8440]){_0x3b2fa6=!![];}return _0x3b2fa6;}function getTagsQuery(){return squel[_0xbf72('0x8')]()[_0xbf72('0x9')]('id')[_0xbf72('0x9')]('name')[_0xbf72('0x9')]('color')[_0xbf72('0xa')](_0xbf72('0xb'));}function getUsersQuery(_0x4d211c,_0xaec095){var _0x1c3453=utils[_0xbf72('0xc')](_0x4d211c);var _0x145acb=_0xbf72('0xd')+_0x4d211c+_0xbf72('0xe');var _0x14f6e6=squel[_0xbf72('0x8')]()['field'](_0xbf72('0xf'))[_0xbf72('0x9')](_0xbf72('0x10'))['field'](_0xbf72('0x11')+_0x1c3453)['from'](_0x145acb,'ui')['left_join']('users','u',_0xbf72('0x12'));if(_0xaec095[_0xbf72('0x13')]>0x0){_0x14f6e6[_0xbf72('0x14')](_0xbf72('0x11')+_0x1c3453+_0xbf72('0x15'),_[_0xbf72('0x16')](_0xaec095,'id'));}return _0x14f6e6;}function getInteractionsQuery(_0x566075){var _0x266ce2=utils[_0xbf72('0x17')](_0x566075);var _0x2a8609=utils[_0xbf72('0x18')](_0x566075);var _0x27dadc=utils['getInteractionFK'](_0x566075);return squel['select']()[_0xbf72('0xa')](_0x266ce2[_0xbf72('0x19')],'i')[_0xbf72('0x1a')](_0xbf72('0x1b'),'c',_0xbf72('0x1c'))[_0xbf72('0x1a')](_0xbf72('0x1d'),'o','o.id\x20=\x20i.UserId')[_0xbf72('0x1a')](_0x266ce2[_0xbf72('0x1e')],'a',_0xbf72('0x1f')+_0x2a8609)[_0xbf72('0x1a')](_0x266ce2[_0xbf72('0x20')],'me','me.'+_0x27dadc+_0xbf72('0x21'))[_0xbf72('0x1a')](_0x266ce2['interactionsTags'],'it',_0xbf72('0x22')+_0x27dadc+_0xbf72('0x21'))[_0xbf72('0x1a')]('tools_tags','t',_0xbf72('0x23'));}function getSqlClauses(){var _0x428361={'body':squel[_0xbf72('0x24')](),'contact':squel[_0xbf72('0x24')](),'default':squel['expr'](),'fields':squel[_0xbf72('0x24')](),'filter':squel[_0xbf72('0x24')](),'read':squel[_0xbf72('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0xbf72('0x24')]()};return _0x428361;}function parseTagParameter(_0xd8fefc){var _0x3df816=squel[_0xbf72('0x24')]();if(_0xd8fefc){var _0x15d60d=utils[_0xbf72('0x25')](_0xd8fefc);_0x15d60d[_0xbf72('0x26')](function(_0x25ecdf){_0x3df816['or'](_0xbf72('0x27'),'%,'+_0x25ecdf+',%');});}return _0x3df816;}function parseReadParameter(_0x92307f){var _0x280d7a='';if(_0x92307f){_0x280d7a=_0xbf72('0x28');if(_0x92307f==='1'){_0x280d7a=_0x280d7a[_0xbf72('0x29')](_0xbf72('0x2a'),'=');}else{_0x280d7a=_0x280d7a[_0xbf72('0x29')]('{OPERATOR}','>');}}return _0x280d7a;}function parseSearchFilter(_0x708fcb,_0x475a54){var _0x30f606=squel[_0xbf72('0x24')]();if(_0x475a54){var _0xb1ee4e=_0x475a54[_0xbf72('0x29')]('\x5c','\x5c\x5c')[_0xbf72('0x29')](/'/g,'\x27\x27');if(qs[_0xbf72('0x2b')](_0xb1ee4e)){_0x30f606['or'](_0xbf72('0x2c'),_0xb1ee4e+'%');if([_0xbf72('0x2d'),_0xbf72('0x2e')][_0xbf72('0x2f')](_0x708fcb)){_0x30f606['or'](_0xbf72('0x30'),_0xb1ee4e+'%');}else if(_0x708fcb===_0xbf72('0x31')){_0x30f606['or']('i.fax\x20LIKE\x20?',_0xb1ee4e+'%');}else if(_0x708fcb===_0xbf72('0x32')){_0x30f606['or'](_0xbf72('0x33'),_0xb1ee4e+'%');}}else if(_0x708fcb===_0xbf72('0x34')&&qs['isEmail'](_0xb1ee4e)){_0x30f606['or']('c.email\x20LIKE\x20?',_0xb1ee4e+'%');}else{if(_0x708fcb==='mail'){_0x30f606['or'](_0xbf72('0x35'),qs[_0xbf72('0x36')](_0xb1ee4e))['or'](_0xbf72('0x37'),qs['getFullTextValue'](_0xb1ee4e));}else{if(_0x708fcb!==_0xbf72('0x31')){_0x30f606['or'](_0xbf72('0x38'),qs['getFullTextValue'](_0xb1ee4e));}_0x30f606['or'](_0xbf72('0x39'),_0xb1ee4e+'%');}}}return _0x30f606;}function parseAdvancedSearchFilter(_0x500fee,_0x13ab4f){var _0x202497=getSqlClauses();var _0x5c2f60=as['parseSearch'](_0x500fee);var _0x424669=_0x5c2f60[_0xbf72('0x3a')];for(var _0x509aa7=0x0;_0x509aa7<_0x5c2f60[_0xbf72('0x3b')][_0xbf72('0x13')];_0x509aa7++){var _0x26c91c=_0x5c2f60[_0xbf72('0x3b')][_0x509aa7];var _0x19b5ba='i';var _0x269b8e=_['find'](_0x13ab4f,[_0xbf72('0x3c'),_0x26c91c[_0xbf72('0x9')]]);if(_0x269b8e){var _0x46d590=as[_0xbf72('0x3d')](_0x19b5ba,_0x269b8e['type'],_0x26c91c);_0x202497[_0xbf72('0x3e')][_0x424669](_0x46d590[_0xbf72('0x3f')],_0x46d590['value'][_0xbf72('0x40')],_0x46d590['value']['end']);}else{switch(_0x26c91c['field']){case'unreadMessages':var _0x2a94b4=parseReadParameter(_0x26c91c['value']);_0x202497['read'][_0xbf72('0x41')](_0x2a94b4);break;case'Contact':if(_0x26c91c[_0xbf72('0x42')]===_0xbf72('0x43')){if(_0x26c91c['value'][_0xbf72('0x44')]('\x20')['length']>0x1){_0x202497['contact'][_0x424669](_0xbf72('0x45'),qs[_0xbf72('0x36')](_0x26c91c[_0xbf72('0x46')]),null);}else{var _0x259c7d='%'+_0x26c91c[_0xbf72('0x46')]+'%';_0x202497[_0xbf72('0x47')][_0x424669](_0xbf72('0x48'),_0x259c7d,_0x259c7d,_0x259c7d);}}else{_0x269b8e=_[_0xbf72('0x49')](_0x13ab4f,['name',_0xbf72('0x4a')]);_0x26c91c[_0xbf72('0x9')]='ContactId';_0x46d590=as[_0xbf72('0x3d')](_0x19b5ba,_0x269b8e['type'],_0x26c91c);_0x202497['contact'][_0x424669](_0x46d590[_0xbf72('0x3f')],_0x46d590[_0xbf72('0x46')][_0xbf72('0x40')],_0x46d590[_0xbf72('0x46')][_0xbf72('0x4b')]);}break;case'Tag':var _0x58769f=_0x26c91c['value'][_0xbf72('0x44')](',')[_0xbf72('0x16')](function(_0x3871d0){return Number(_0x3871d0);});var _0x2a679a=parseTagParameter(_0x58769f);_0x202497['tags']['clause'][_0xbf72('0x41')](_0x2a679a);_0x202497['tags'][_0xbf72('0x4c')]=_0x58769f;break;case _0xbf72('0x4d'):if(_0x26c91c[_0xbf72('0x42')]===_0xbf72('0x43')){_0x202497['user'][_0x424669](_0xbf72('0x4e'),'%'+_0x26c91c[_0xbf72('0x46')]+'%',null);}else{_0x269b8e=_[_0xbf72('0x49')](_0x13ab4f,[_0xbf72('0x3c'),'UserId']);_0x26c91c[_0xbf72('0x9')]=_0xbf72('0x4f');_0x46d590=as['buildExpression'](_0x19b5ba,_0x269b8e[_0xbf72('0x50')],_0x26c91c);_0x202497[_0xbf72('0x51')][_0x424669](_0x46d590[_0xbf72('0x3f')],_0x46d590[_0xbf72('0x46')][_0xbf72('0x40')],_0x46d590[_0xbf72('0x46')][_0xbf72('0x4b')]);}break;case'body':case'plainBody':_0x46d590=as['buildExpression']('me',null,_0x26c91c);_0x202497[_0xbf72('0x52')][_0x424669](_0x46d590['text'],_0x46d590[_0xbf72('0x46')]['start'],_0x46d590['value']['end']);break;}}}return _0x202497;}function parseModelFields(_0x9f94ea,_0x15a271,_0x15e94f){var _0x3304b1=utils[_0xbf72('0x18')](_0x9f94ea);var _0x2f7f22=squel['expr']();var _0x3ffa72=_(_0x15a271)['keys']()[_0xbf72('0x16')](function(_0x5afd24){return _[_0xbf72('0x53')](_0x15e94f,[_0xbf72('0x3c'),_0x5afd24])?_0x5afd24:undefined;})[_0xbf72('0x54')]()[_0xbf72('0x46')]();if(_0x3ffa72[_0xbf72('0x13')]>0x0){_0x3ffa72[_0xbf72('0x26')](function(_0x578b07){if(_0x578b07===_0x3304b1){_0x2f7f22[_0xbf72('0x41')]('i.'+_0x3304b1+_0xbf72('0x15'),[]['concat'](_0x15a271[_0x578b07]));}else if(_0x578b07===_0xbf72('0x55')){var _0x2f9816=JSON[_0xbf72('0x56')](_0x15a271[_0x578b07])['$gte'];var _0x312eb6=JSON[_0xbf72('0x56')](_0x15a271[_0x578b07])[_0xbf72('0x57')];_0x2f7f22[_0xbf72('0x41')](_0xbf72('0x58'),_0x2f9816,_0x312eb6);}else{if(_0x15a271[_0x578b07]==='null'){_0x2f7f22[_0xbf72('0x41')]('i.'+_0x578b07+_0xbf72('0x59'));}else{_0x2f7f22['and']('i.'+_0x578b07+_0xbf72('0x5a'),_0x15a271[_0x578b07]);}}});}return _0x2f7f22;}function parseQueryParameters(_0x5e2dcd,_0x58080b,_0xf00ac2){var _0x25386f=getSqlClauses();return Promise[_0xbf72('0x5b')]()[_0xbf72('0x5c')](function(){return parseModelFields(_0x5e2dcd,_0x58080b,_0xf00ac2);})[_0xbf72('0x5c')](function(_0x527061){_0x25386f['fields']['and'](_0x527061);return parseReadParameter(_0x58080b[_0xbf72('0x5d')]);})[_0xbf72('0x5c')](function(_0x4573fe){_0x25386f[_0xbf72('0x5d')]['and'](_0x4573fe);return parseTagParameter(_0x58080b['tag']);})[_0xbf72('0x5c')](function(_0x18ecf7){_0x25386f[_0xbf72('0x5e')]['clause'][_0xbf72('0x41')](_0x18ecf7);return parseSearchFilter(_0x5e2dcd,_0x58080b['filter']);})[_0xbf72('0x5c')](function(_0x3da80c){_0x25386f['filter']=_0x3da80c;return _0x25386f;});}function checkAccountsRestrictions(_0x2b3c34,_0x441908,_0x55ac06){var _0x3c3e31=utils[_0xbf72('0x18')](_0x2b3c34);var _0xa50217='get'+_['capitalize'](_0x2b3c34)+(_0x2b3c34==='chat'?_0xbf72('0x5f'):_0xbf72('0x60'));var _0x28eb87=squel[_0xbf72('0x24')]();return Promise[_0xbf72('0x5b')]()[_0xbf72('0x5c')](function(){if(_0x55ac06[_0xbf72('0x7')]&&_0x441908[_0xbf72('0x5')]===_0xbf72('0x6')){return _0x441908[_0xa50217]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x39d694){if(_0x39d694){if(_0x39d694[_0xbf72('0x13')]===0x0){_0x28eb87['and']('i.'+_0x3c3e31+_0xbf72('0x59'));}else{_0x28eb87[_0xbf72('0x41')]('i.'+_0x3c3e31+_0xbf72('0x15'),_[_0xbf72('0x16')](_0x39d694,'id'));}}else if(!_0x55ac06[_0x3c3e31]){_0x28eb87[_0xbf72('0x41')]('i.'+_0x3c3e31+_0xbf72('0x61'));}})[_0xbf72('0x5c')](function(){return _0x28eb87;});}function getClosedOrderClause(_0x433d32,_0x26e2ec){var _0x537398='';var _0x56cfe1=[_0xbf72('0x62'),_0xbf72('0x63'),_0xbf72('0x64')];if(_0x433d32===_0xbf72('0x34')){_0x56cfe1[_0xbf72('0x65')](_0xbf72('0x66'));}if(_0x26e2ec[_0xbf72('0x67')]==='0'&&_0x433d32===_0xbf72('0x34')){_0x537398='i.substatus';}else{if(_0x26e2ec[_0xbf72('0x67')]==='1'){_0x56cfe1[_0xbf72('0x68')]();}_0x537398=_0xbf72('0x69')+_0x56cfe1[_0xbf72('0x6a')](',\x20')+')';}return _0x537398;}function getFilteredInteractions(_0x3d51a9,_0x41c207,_0x1ba67d,_0x59495b){var _0x428902=utils[_0xbf72('0xc')](_0x3d51a9);var _0x23550f=_[_0xbf72('0x6b')](_0x3d51a9)+_0xbf72('0x6c');var _0x107391=[];var _0x872fa7=getTagsQuery();var _0x25b7ea={'type':db['Sequelize'][_0xbf72('0x6d')][_0xbf72('0x6e')],'raw':!![]};var _0x17ab12=[];var _0x5472db=[];return db[_0xbf72('0x6f')][_0xbf72('0x70')](_0x872fa7['toString'](),_0x25b7ea)[_0xbf72('0x5c')](function(_0x287198){_0x107391=_['keyBy'](_0x287198,'id');_0x25b7ea=_[_0xbf72('0x71')](_0x25b7ea,{'model':db[_0x23550f],'mapToModel':!![],'nest':!![]});if(_0x1ba67d[_0xbf72('0x72')]){_0x59495b['attributes'][_0xbf72('0x26')](function(_0x19d741){_0x41c207[_0xbf72('0x9')]('i.'+_0x19d741);});}else{_0x41c207[_0xbf72('0x9')](_0xbf72('0x73'),_0xbf72('0x74'));_0x41c207[_0xbf72('0x9')]('a.key',_0xbf72('0x75'));_0x41c207[_0xbf72('0x9')]('a.mandatoryDisposition',_0xbf72('0x76'));if(_0x3d51a9==='mail'){_0x41c207['field'](_0xbf72('0x77'),_0xbf72('0x78'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x79'),_0xbf72('0x7a'));_0x41c207[_0xbf72('0x9')]('i.id');_0x41c207[_0xbf72('0x9')](_0xbf72('0x7b'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x7c'));_0x41c207['field'](_0xbf72('0x7d'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x7e'));_0x41c207[_0xbf72('0x9')]('i.attach');_0x41c207[_0xbf72('0x9')]('i.lastMsgAt');_0x41c207[_0xbf72('0x9')](_0xbf72('0x7f'));_0x41c207[_0xbf72('0x9')]('i.subject');_0x41c207[_0xbf72('0x9')](_0xbf72('0x64'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x63'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x62'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x66'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x80'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x81'));_0x41c207['field'](_0xbf72('0x82'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x83'));}else if(_0x3d51a9==='openchannel'){_0x41c207[_0xbf72('0x9')]('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',_0xbf72('0x7a'));}else{_0x41c207[_0xbf72('0x9')](_0xbf72('0x84'),_0xbf72('0x7a'));}if(_0x3d51a9!==_0xbf72('0x34')){_0x41c207[_0xbf72('0x9')]('i.*');}_0x41c207[_0xbf72('0x9')]('c.firstName',_0xbf72('0x85'));_0x41c207['field'](_0xbf72('0x86'),_0xbf72('0x87'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x88'),_0xbf72('0x89'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x8a'),_0xbf72('0x8b'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x8c'),_0xbf72('0x8d'));_0x41c207[_0xbf72('0x9')](_0xbf72('0x8e'),_0xbf72('0x8f'));_0x41c207[_0xbf72('0x9')]('o.fullname','Owner.fullname');_0x41c207[_0xbf72('0x9')]('o.internal',_0xbf72('0x90'));_0x41c207[_0xbf72('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbf72('0x91'));}if(_0x59495b[_0xbf72('0x92')]){_0x41c207[_0xbf72('0x92')](_0x59495b['limit']);}if(_0x59495b[_0xbf72('0x93')]){_0x41c207['offset'](_0x59495b[_0xbf72('0x93')]);}return db[_0xbf72('0x6f')]['query'](_0x41c207[_0xbf72('0x94')](),_0x25b7ea);})[_0xbf72('0x5c')](function(_0x33870e){_0x17ab12=_0x33870e;var _0x5d7c8f=getUsersQuery(_0x3d51a9,_0x17ab12);return db[_0xbf72('0x6f')][_0xbf72('0x70')](_0x5d7c8f[_0xbf72('0x94')](),_0x25b7ea);})[_0xbf72('0x5c')](function(_0x55b183){_0x5472db=_['groupBy'](_0x55b183,_0x428902);if(_0x3d51a9===_0xbf72('0x34')){return db[_0xbf72('0x95')][_0xbf72('0x96')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0xbf72('0x5c')](function(_0x47a484){var _0x444330=_0x47a484?_0x47a484['enableEmailPreview']:undefined;var _0x3d12ca=_0x17ab12[_0xbf72('0x16')](function(_0x1618ec){return updateInteraction(_0x1618ec,_0x107391,_0x5472db,_0x444330);});return Promise['all'](_0x3d12ca);});}function countFilteredInteractions(_0x311478,_0x242e07){var _0x4c82c4=_0x311478[_0xbf72('0x97')]();_0x4c82c4['field'](_0xbf72('0x98'));_0x4c82c4[_0xbf72('0x9')](_0xbf72('0x73'),_0xbf72('0x74'));var _0x464ef0=utils[_0xbf72('0x25')](_0x242e07);if(!_['isEmpty'](_0x464ef0)){_0x4c82c4[_0xbf72('0x14')](_0xbf72('0x99'),_0x464ef0);}var _0x13aa56={'type':db['Sequelize'][_0xbf72('0x6d')][_0xbf72('0x6e')],'raw':!![]};return db['sequelize']['query'](_0x4c82c4['toString'](),_0x13aa56);}module[_0xbf72('0x9a')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x17ba=['exports','lodash','squel','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','where','ui.','\x20IN\x20?','map','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','length','find','buildExpression','default','value','read','and','Contact','operator','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','end','Tag','split','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','fields','tag','then','filter','get','capitalize','chat','Websites','Accounts','i.secondDisposition','i.disposition','i.substatus','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','toString','keyBy','merge','attributes','forEach','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','a.email','Account.email','contactName','i.createdAt','i.closed','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','query','findOne','enableEmailPreview','all','clone','COUNT(*)','unreadMessages','SELECT'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x17ba,0xab));var _0xa17b=function(_0x432021,_0x2f8a79){_0x432021=_0x432021-0x0;var _0x3e5b0d=_0x17ba[_0x432021];return _0x3e5b0d;};'use strict';var _=require(_0xa17b('0x0'));var squel=require(_0xa17b('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xa17b('0x2'));var updateInteraction=require(_0xa17b('0x3'))[_0xa17b('0x4')];var utils=require(_0xa17b('0x5'));var db=require(_0xa17b('0x6'))['db'];function skipInteractionsQuery(_0x38c13c,_0x11d7b7,_0x2f64d0){var _0x1dc353=![];var _0x3cced2=utils[_0xa17b('0x7')](_0x38c13c);if(_0x11d7b7[_0xa17b('0x8')]===_0xa17b('0x9')&&!_0x2f64d0[_0xa17b('0xa')]&&!_0x2f64d0[_0x3cced2]){_0x1dc353=!![];}return _0x1dc353;}function getTagsQuery(){return squel[_0xa17b('0xb')]()[_0xa17b('0xc')]('id')[_0xa17b('0xc')](_0xa17b('0xd'))[_0xa17b('0xc')]('color')[_0xa17b('0xe')](_0xa17b('0xf'));}function getUsersQuery(_0x322dc0,_0x1e799a){var _0x140943=utils[_0xa17b('0x10')](_0x322dc0);var _0xc5ef2e='user_has_'+_0x322dc0+_0xa17b('0x11');var _0x3e92e4=squel[_0xa17b('0xb')]()['field'](_0xa17b('0x12'))[_0xa17b('0xc')](_0xa17b('0x13'))[_0xa17b('0xc')]('ui.'+_0x140943)[_0xa17b('0xe')](_0xc5ef2e,'ui')['left_join'](_0xa17b('0x14'),'u',_0xa17b('0x15'));if(_0x1e799a['length']>0x0){_0x3e92e4[_0xa17b('0x16')](_0xa17b('0x17')+_0x140943+_0xa17b('0x18'),_[_0xa17b('0x19')](_0x1e799a,'id'));}return _0x3e92e4;}function getInteractionsQuery(_0x4870fb){var _0x98a295=utils['getInteractionsTables'](_0x4870fb);var _0x4d5592=utils['getAccountFK'](_0x4870fb);var _0x36f985=utils[_0xa17b('0x10')](_0x4870fb);return squel['select']()[_0xa17b('0xe')](_0x98a295[_0xa17b('0x1a')],'i')[_0xa17b('0x1b')](_0xa17b('0x1c'),'c',_0xa17b('0x1d'))[_0xa17b('0x1b')](_0xa17b('0x14'),'o','o.id\x20=\x20i.UserId')[_0xa17b('0x1b')](_0x98a295[_0xa17b('0x1e')],'a',_0xa17b('0x1f')+_0x4d5592)['left_join'](_0x98a295[_0xa17b('0x20')],'me',_0xa17b('0x21')+_0x36f985+_0xa17b('0x22'))[_0xa17b('0x1b')](_0x98a295[_0xa17b('0x23')],'it',_0xa17b('0x24')+_0x36f985+'\x20=\x20i.id')[_0xa17b('0x1b')]('tools_tags','t',_0xa17b('0x25'));}function getSqlClauses(){var _0x13630d={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0xa17b('0x26')](),'fields':squel[_0xa17b('0x26')](),'filter':squel[_0xa17b('0x26')](),'read':squel[_0xa17b('0x26')](),'tags':{'clause':squel[_0xa17b('0x26')](),'ids':null},'user':squel[_0xa17b('0x26')]()};return _0x13630d;}function parseTagParameter(_0x4cd38e){var _0x47aff8=squel['expr']();if(_0x4cd38e){var _0x4aad82=utils[_0xa17b('0x27')](_0x4cd38e);_0x4aad82['forEach'](function(_0x295e67){_0x47aff8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x295e67+',%');});}return _0x47aff8;}function parseReadParameter(_0x14671b){var _0x3b2ba6='';if(_0x14671b){_0x3b2ba6=_0xa17b('0x28');if(_0x14671b==='1'){_0x3b2ba6=_0x3b2ba6[_0xa17b('0x29')](_0xa17b('0x2a'),'=');}else{_0x3b2ba6=_0x3b2ba6[_0xa17b('0x29')](_0xa17b('0x2a'),'>');}}return _0x3b2ba6;}function parseSearchFilter(_0x366b47,_0x43b1f5){var _0x2dc1f2=squel[_0xa17b('0x26')]();if(_0x43b1f5){var _0x573585=_0x43b1f5['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa17b('0x2b')](_0x573585)){_0x2dc1f2['or'](_0xa17b('0x2c'),_0x573585+'%');if([_0xa17b('0x2d'),_0xa17b('0x2e')][_0xa17b('0x2f')](_0x366b47)){_0x2dc1f2['or'](_0xa17b('0x30'),_0x573585+'%');}else if(_0x366b47===_0xa17b('0x31')){_0x2dc1f2['or'](_0xa17b('0x32'),_0x573585+'%');}else if(_0x366b47==='openchannel'){_0x2dc1f2['or'](_0xa17b('0x33'),_0x573585+'%');}}else if(_0x366b47==='mail'&&qs[_0xa17b('0x34')](_0x573585)){_0x2dc1f2['or'](_0xa17b('0x35'),_0x573585+'%');}else{if(_0x366b47===_0xa17b('0x36')){_0x2dc1f2['or'](_0xa17b('0x37'),qs[_0xa17b('0x38')](_0x573585))['or'](_0xa17b('0x39'),qs['getFullTextValue'](_0x573585));}else{if(_0x366b47!==_0xa17b('0x31')){_0x2dc1f2['or'](_0xa17b('0x3a'),qs[_0xa17b('0x38')](_0x573585));}_0x2dc1f2['or'](_0xa17b('0x3b'),_0x573585+'%');}}}return _0x2dc1f2;}function parseAdvancedSearchFilter(_0x146fc3,_0x52d775){var _0x2db32a=getSqlClauses();var _0x5bb6a4=as[_0xa17b('0x3c')](_0x146fc3);var _0x5a0b00=_0x5bb6a4[_0xa17b('0x3d')];for(var _0x4086e9=0x0;_0x4086e9<_0x5bb6a4['conditions'][_0xa17b('0x3e')];_0x4086e9++){var _0x31b399=_0x5bb6a4['conditions'][_0x4086e9];var _0x2fb380='i';var _0x107584=_[_0xa17b('0x3f')](_0x52d775,[_0xa17b('0xd'),_0x31b399[_0xa17b('0xc')]]);if(_0x107584){var _0x5a7679=as[_0xa17b('0x40')](_0x2fb380,_0x107584['type'],_0x31b399);_0x2db32a[_0xa17b('0x41')][_0x5a0b00](_0x5a7679['text'],_0x5a7679[_0xa17b('0x42')]['start'],_0x5a7679[_0xa17b('0x42')]['end']);}else{switch(_0x31b399[_0xa17b('0xc')]){case'unreadMessages':var _0x22a788=parseReadParameter(_0x31b399[_0xa17b('0x42')]);_0x2db32a[_0xa17b('0x43')][_0xa17b('0x44')](_0x22a788);break;case _0xa17b('0x45'):if(_0x31b399[_0xa17b('0x46')]===_0xa17b('0x47')){if(_0x31b399[_0xa17b('0x42')]['split']('\x20')[_0xa17b('0x3e')]>0x1){_0x2db32a[_0xa17b('0x48')][_0x5a0b00]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa17b('0x38')](_0x31b399[_0xa17b('0x42')]),null);}else{var _0x1c3fe5='%'+_0x31b399[_0xa17b('0x42')]+'%';_0x2db32a[_0xa17b('0x48')][_0x5a0b00](_0xa17b('0x49'),_0x1c3fe5,_0x1c3fe5,_0x1c3fe5);}}else{_0x107584=_['find'](_0x52d775,[_0xa17b('0xd'),_0xa17b('0x4a')]);_0x31b399[_0xa17b('0xc')]='ContactId';_0x5a7679=as['buildExpression'](_0x2fb380,_0x107584['type'],_0x31b399);_0x2db32a[_0xa17b('0x48')][_0x5a0b00](_0x5a7679[_0xa17b('0x4b')],_0x5a7679[_0xa17b('0x42')][_0xa17b('0x4c')],_0x5a7679[_0xa17b('0x42')][_0xa17b('0x4d')]);}break;case _0xa17b('0x4e'):var _0x24f7f6=_0x31b399[_0xa17b('0x42')][_0xa17b('0x4f')](',')[_0xa17b('0x19')](function(_0x1267de){return Number(_0x1267de);});var _0x5e3bb8=parseTagParameter(_0x24f7f6);_0x2db32a[_0xa17b('0x50')][_0xa17b('0x51')][_0xa17b('0x44')](_0x5e3bb8);_0x2db32a[_0xa17b('0x50')][_0xa17b('0x52')]=_0x24f7f6;break;case _0xa17b('0x53'):if(_0x31b399['operator']===_0xa17b('0x47')){_0x2db32a[_0xa17b('0x54')][_0x5a0b00](_0xa17b('0x55'),'%'+_0x31b399[_0xa17b('0x42')]+'%',null);}else{_0x107584=_[_0xa17b('0x3f')](_0x52d775,['name',_0xa17b('0x56')]);_0x31b399[_0xa17b('0xc')]=_0xa17b('0x56');_0x5a7679=as[_0xa17b('0x40')](_0x2fb380,_0x107584['type'],_0x31b399);_0x2db32a[_0xa17b('0x54')][_0x5a0b00](_0x5a7679[_0xa17b('0x4b')],_0x5a7679[_0xa17b('0x42')][_0xa17b('0x4c')],_0x5a7679[_0xa17b('0x42')][_0xa17b('0x4d')]);}break;case _0xa17b('0x57'):case'plainBody':_0x5a7679=as[_0xa17b('0x40')]('me',null,_0x31b399);_0x2db32a[_0xa17b('0x57')][_0x5a0b00](_0x5a7679['text'],_0x5a7679[_0xa17b('0x42')][_0xa17b('0x4c')],_0x5a7679[_0xa17b('0x42')]['end']);break;}}}return _0x2db32a;}function parseModelFields(_0x187237,_0x4681ca,_0x5e2303){var _0x30ea70=utils[_0xa17b('0x7')](_0x187237);var _0x529953=squel[_0xa17b('0x26')]();var _0x347436=_(_0x4681ca)['keys']()[_0xa17b('0x19')](function(_0x44d408){return _[_0xa17b('0x58')](_0x5e2303,[_0xa17b('0xd'),_0x44d408])?_0x44d408:undefined;})[_0xa17b('0x59')]()[_0xa17b('0x42')]();if(_0x347436[_0xa17b('0x3e')]>0x0){_0x347436['forEach'](function(_0x420fdc){if(_0x420fdc===_0x30ea70){_0x529953[_0xa17b('0x44')]('i.'+_0x30ea70+_0xa17b('0x18'),[][_0xa17b('0x5a')](_0x4681ca[_0x420fdc]));}else if(_0x420fdc===_0xa17b('0x5b')){var _0x13a0d3=JSON[_0xa17b('0x5c')](_0x4681ca[_0x420fdc])[_0xa17b('0x5d')];var _0x2a5f56=JSON[_0xa17b('0x5c')](_0x4681ca[_0x420fdc])[_0xa17b('0x5e')];_0x529953[_0xa17b('0x44')](_0xa17b('0x5f'),_0x13a0d3,_0x2a5f56);}else{if(_0x4681ca[_0x420fdc]==='null'){_0x529953[_0xa17b('0x44')]('i.'+_0x420fdc+_0xa17b('0x60'));}else{_0x529953[_0xa17b('0x44')]('i.'+_0x420fdc+_0xa17b('0x61'),_0x4681ca[_0x420fdc]);}}});}return _0x529953;}function parseQueryParameters(_0x43b54f,_0x134c44,_0x13069e){var _0x27cb67=getSqlClauses();return Promise[_0xa17b('0x62')]()['then'](function(){return parseModelFields(_0x43b54f,_0x134c44,_0x13069e);})['then'](function(_0x2a870d){_0x27cb67[_0xa17b('0x63')]['and'](_0x2a870d);return parseReadParameter(_0x134c44['read']);})['then'](function(_0x471cb2){_0x27cb67[_0xa17b('0x43')][_0xa17b('0x44')](_0x471cb2);return parseTagParameter(_0x134c44[_0xa17b('0x64')]);})[_0xa17b('0x65')](function(_0x15a897){_0x27cb67['tags']['clause']['and'](_0x15a897);return parseSearchFilter(_0x43b54f,_0x134c44['filter']);})['then'](function(_0x2a62e4){_0x27cb67[_0xa17b('0x66')]=_0x2a62e4;return _0x27cb67;});}function checkAccountsRestrictions(_0x20fe4a,_0x3eea0b,_0x29764b){var _0x273671=utils[_0xa17b('0x7')](_0x20fe4a);var _0x55b98a=_0xa17b('0x67')+_[_0xa17b('0x68')](_0x20fe4a)+(_0x20fe4a===_0xa17b('0x69')?_0xa17b('0x6a'):_0xa17b('0x6b'));var _0x252e41=squel[_0xa17b('0x26')]();return Promise[_0xa17b('0x62')]()[_0xa17b('0x65')](function(){if(_0x29764b[_0xa17b('0xa')]&&_0x3eea0b[_0xa17b('0x8')]===_0xa17b('0x9')){return _0x3eea0b[_0x55b98a]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x248e8a){if(_0x248e8a){if(_0x248e8a['length']===0x0){_0x252e41[_0xa17b('0x44')]('i.'+_0x273671+_0xa17b('0x60'));}else{_0x252e41[_0xa17b('0x44')]('i.'+_0x273671+_0xa17b('0x18'),_['map'](_0x248e8a,'id'));}}else if(!_0x29764b[_0x273671]){_0x252e41[_0xa17b('0x44')]('i.'+_0x273671+'\x20IS\x20NOT\x20NULL');}})[_0xa17b('0x65')](function(){return _0x252e41;});}function getClosedOrderClause(_0x5a94a9,_0x5be3d1){var _0x299c83='';var _0x290305=['i.thirdDisposition',_0xa17b('0x6c'),_0xa17b('0x6d')];if(_0x5a94a9==='mail'){_0x290305['unshift'](_0xa17b('0x6e'));}if(_0x5be3d1[_0xa17b('0x6f')]==='0'&&_0x5a94a9==='mail'){_0x299c83=_0xa17b('0x6e');}else{if(_0x5be3d1[_0xa17b('0x6f')]==='1'){_0x290305['shift']();}_0x299c83=_0xa17b('0x70')+_0x290305[_0xa17b('0x71')](',\x20')+')';}return _0x299c83;}function getFilteredInteractions(_0x6464cb,_0x7b5a5d,_0x713dba,_0x521468){var _0x43ab46=utils[_0xa17b('0x10')](_0x6464cb);var _0x1367c5=_[_0xa17b('0x68')](_0x6464cb)+_0xa17b('0x72');var _0x2e65b1=[];var _0x2294e0=getTagsQuery();var _0x109dd7={'type':db[_0xa17b('0x73')][_0xa17b('0x74')]['SELECT'],'raw':!![]};var _0x36ae46=[];var _0x61e511=[];return db['sequelize']['query'](_0x2294e0[_0xa17b('0x75')](),_0x109dd7)[_0xa17b('0x65')](function(_0x2d426a){_0x2e65b1=_[_0xa17b('0x76')](_0x2d426a,'id');_0x109dd7=_[_0xa17b('0x77')](_0x109dd7,{'model':db[_0x1367c5],'mapToModel':!![],'nest':!![]});if(_0x713dba['fields']){_0x521468[_0xa17b('0x78')][_0xa17b('0x79')](function(_0x42e548){_0x7b5a5d[_0xa17b('0xc')]('i.'+_0x42e548);});}else{_0x7b5a5d['field'](_0xa17b('0x7a'),'unreadMessages');_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x7b'),_0xa17b('0x7c'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x7d'),'Account.mandatoryDisposition');if(_0x6464cb===_0xa17b('0x36')){_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x7e'),_0xa17b('0x7f'));_0x7b5a5d[_0xa17b('0xc')]('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',_0xa17b('0x80'));_0x7b5a5d[_0xa17b('0xc')]('i.id');_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x81'));_0x7b5a5d['field']('i.updatedAt');_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x82'));_0x7b5a5d[_0xa17b('0xc')]('i.closedAt');_0x7b5a5d['field']('i.attach');_0x7b5a5d[_0xa17b('0xc')]('i.lastMsgAt');_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x83'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x84'));_0x7b5a5d['field']('i.disposition');_0x7b5a5d['field'](_0xa17b('0x6c'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x85'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x6e'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x86'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x87'));_0x7b5a5d['field'](_0xa17b('0x88'));_0x7b5a5d['field'](_0xa17b('0x89'));}else if(_0x6464cb==='openchannel'){_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x8a'),_0xa17b('0x80'));}else{_0x7b5a5d['field'](_0xa17b('0x8b'),'contactName');}if(_0x6464cb!==_0xa17b('0x36')){_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x8c'));}_0x7b5a5d['field'](_0xa17b('0x8d'),_0xa17b('0x8e'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x8f'),_0xa17b('0x90'));_0x7b5a5d['field'](_0xa17b('0x91'),_0xa17b('0x92'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x93'),_0xa17b('0x94'));_0x7b5a5d['field'](_0xa17b('0x95'),_0xa17b('0x96'));_0x7b5a5d[_0xa17b('0xc')]('c.fax',_0xa17b('0x97'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x98'),_0xa17b('0x99'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x9a'),_0xa17b('0x9b'));_0x7b5a5d[_0xa17b('0xc')](_0xa17b('0x9c'),_0xa17b('0x9d'));}if(_0x521468['limit']){_0x7b5a5d[_0xa17b('0x9e')](_0x521468['limit']);}if(_0x521468['offset']){_0x7b5a5d[_0xa17b('0x9f')](_0x521468[_0xa17b('0x9f')]);}return db[_0xa17b('0xa0')]['query'](_0x7b5a5d[_0xa17b('0x75')](),_0x109dd7);})[_0xa17b('0x65')](function(_0xe14809){_0x36ae46=_0xe14809;var _0x28360a=getUsersQuery(_0x6464cb,_0x36ae46);return db[_0xa17b('0xa0')][_0xa17b('0xa1')](_0x28360a[_0xa17b('0x75')](),_0x109dd7);})[_0xa17b('0x65')](function(_0x4e6a1a){_0x61e511=_['groupBy'](_0x4e6a1a,_0x43ab46);if(_0x6464cb===_0xa17b('0x36')){return db['Setting'][_0xa17b('0xa2')]({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x351ed8){var _0x4d00c0=_0x351ed8?_0x351ed8[_0xa17b('0xa3')]:undefined;var _0x442e16=_0x36ae46[_0xa17b('0x19')](function(_0x1ff3e1){return updateInteraction(_0x1ff3e1,_0x2e65b1,_0x61e511,_0x4d00c0);});return Promise[_0xa17b('0xa4')](_0x442e16);});}function countFilteredInteractions(_0x2dea0f,_0x42003e){var _0x45ae3d=_0x2dea0f[_0xa17b('0xa5')]();_0x45ae3d[_0xa17b('0xc')](_0xa17b('0xa6'));_0x45ae3d[_0xa17b('0xc')](_0xa17b('0x7a'),_0xa17b('0xa7'));var _0x3789a5=utils[_0xa17b('0x27')](_0x42003e);if(!_['isEmpty'](_0x3789a5)){_0x45ae3d['where']('t.id\x20IN\x20?',_0x3789a5);}var _0x410657={'type':db['Sequelize'][_0xa17b('0x74')][_0xa17b('0xa8')],'raw':!![]};return db['sequelize'][_0xa17b('0xa1')](_0x45ae3d['toString'](),_0x410657);}module[_0xa17b('0xa9')]={'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 a7cc32d..19a67ca 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 _0x60af=['out','plainBody','-id','lastMsgText','trimStart','then','Users','TagIds','Tags','catch','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','answered','unmanaged','total','abandoned','UserId','disposition'];(function(_0x467585,_0x491260){var _0x2c5472=function(_0x3c8a77){while(--_0x3c8a77){_0x467585['push'](_0x467585['shift']());}};_0x2c5472(++_0x491260);}(_0x60af,0x6a));var _0xf60a=function(_0x1a219d,_0x405933){_0x1a219d=_0x1a219d-0x0;var _0x5f133b=_0x60af[_0x1a219d];return _0x5f133b;};'use strict';var _=require('lodash');var db=require(_0xf60a('0x0'))['db'];function getInteractionUsers(_0x3dee4f,_0x8154f6){return new Promise(function(_0x35418d,_0x231b53){try{var _0x27ee66=[];if(_0x8154f6[_0x3dee4f]){_0x27ee66=_0x8154f6[_0x3dee4f][_0xf60a('0x1')](function(_0x8770d5){return{'id':_0x8770d5['id'],'fullname':_0x8770d5[_0xf60a('0x2')]};});}return _0x35418d(_0x27ee66);}catch(_0x2f5c8c){_0x231b53(_0x2f5c8c);}});}function getInteractionTags(_0x31ade8,_0x5b775e){var _0x2f759d=[];if(_0x31ade8){_0x31ade8[_0xf60a('0x3')](',')[_0xf60a('0x4')](function(_0x32a3f1){_0x2f759d[_0xf60a('0x5')](_0x5b775e[_0x32a3f1]);});}return _0x2f759d;}function updateWaitingCounter(_0x518fe7){if(_0x518fe7[_0xf60a('0x6')]){_0x518fe7[_0xf60a('0x6')]-=0x1;}}function updateInteractionCounters(_0x79e9e2){_0x79e9e2['waiting']=0x0;_0x79e9e2[_0xf60a('0x7')]=0x0;_0x79e9e2[_0xf60a('0x8')]=0x0;_0x79e9e2[_0xf60a('0x9')]=0x0;_0x79e9e2['abandoned']=0x0;_0x79e9e2[_0xf60a('0xa')]=0x0;if(_0x79e9e2['closed']){if(_0x79e9e2['disposition']===_0xf60a('0xb')){_0x79e9e2[_0xf60a('0xb')]+=0x1;updateWaitingCounter(_0x79e9e2);}if(_0x79e9e2[_0xf60a('0xc')]){_0x79e9e2[_0xf60a('0x8')]+=0x1;if(_0x79e9e2[_0xf60a('0x7')]){_0x79e9e2[_0xf60a('0x7')]-=0x1;}}else{if(_0x79e9e2[_0xf60a('0xd')]){_0x79e9e2['unmanaged']+=0x1;updateWaitingCounter(_0x79e9e2);}}}else{if(!_0x79e9e2[_0xf60a('0xc')]){_0x79e9e2['waiting']+=0x1;}if(_0x79e9e2[_0xf60a('0xc')]){_0x79e9e2[_0xf60a('0x7')]+=0x1;updateWaitingCounter(_0x79e9e2);}}_0x79e9e2[_0xf60a('0xa')]+=0x1;return _0x79e9e2;}function getLastMessageText(_0x57335c){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x57335c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf60a('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf60a('0xf')],'order':_0xf60a('0x10'),'raw':!![]})['then'](function(_0x5b5e83){if(_0x5b5e83&&_0x5b5e83[_0xf60a('0xf')]){_0x57335c[_0xf60a('0x11')]=_[_0xf60a('0x12')](_0x5b5e83[_0xf60a('0xf')]);}return _0x57335c;})['catch'](function(_0x34a3c8){throw _0x34a3c8;});}exports['updateInteraction']=function(_0x521d12,_0x20f53e,_0x3e5e77,_0x26fad9){return new Promise(function(_0x13b7e1,_0x3537a7){return getInteractionUsers(_0x521d12['id'],_0x3e5e77)[_0xf60a('0x13')](function(_0x2935d0){_0x521d12[_0xf60a('0x14')]=_0x2935d0;return getInteractionTags(_0x521d12[_0xf60a('0x15')],_0x20f53e);})[_0xf60a('0x13')](function(_0x5668e8){_0x521d12[_0xf60a('0x16')]=_0x5668e8;delete _0x521d12[_0xf60a('0x15')];return updateInteractionCounters(_0x521d12);})['then'](function(_0x2fa5cb){if(_0x26fad9){return getLastMessageText(_0x2fa5cb);}else{return _0x2fa5cb;}})[_0xf60a('0x13')](function(_0x527efd){_0x13b7e1(_0x527efd);})[_0xf60a('0x17')](function(_0x6a6e15){_0x3537a7(_0x6a6e15);});});}; \ No newline at end of file +var _0x5b79=['answered','abandoned','disposition','UserId','total','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','Users','TagIds','../../mysqldb','fullname','split','push','waiting','talking'];(function(_0x53c4ab,_0x574e22){var _0x665de7=function(_0x299752){while(--_0x299752){_0x53c4ab['push'](_0x53c4ab['shift']());}};_0x665de7(++_0x574e22);}(_0x5b79,0x7e));var _0x95b7=function(_0x4d7d33,_0x575510){_0x4d7d33=_0x4d7d33-0x0;var _0x19407b=_0x5b79[_0x4d7d33];return _0x19407b;};'use strict';var _=require('lodash');var db=require(_0x95b7('0x0'))['db'];function getInteractionUsers(_0x24505e,_0x40495c){return new Promise(function(_0x56090d,_0x27395d){try{var _0x13fa33=[];if(_0x40495c[_0x24505e]){_0x13fa33=_0x40495c[_0x24505e]['map'](function(_0x1cf2ff){return{'id':_0x1cf2ff['id'],'fullname':_0x1cf2ff[_0x95b7('0x1')]};});}return _0x56090d(_0x13fa33);}catch(_0x4726d3){_0x27395d(_0x4726d3);}});}function getInteractionTags(_0x113a4b,_0x935b93){var _0x1a5de9=[];if(_0x113a4b){_0x113a4b[_0x95b7('0x2')](',')['forEach'](function(_0x200194){_0x1a5de9[_0x95b7('0x3')](_0x935b93[_0x200194]);});}return _0x1a5de9;}function updateWaitingCounter(_0x23048e){if(_0x23048e[_0x95b7('0x4')]){_0x23048e[_0x95b7('0x4')]-=0x1;}}function updateInteractionCounters(_0x3f454f){_0x3f454f[_0x95b7('0x4')]=0x0;_0x3f454f[_0x95b7('0x5')]=0x0;_0x3f454f[_0x95b7('0x6')]=0x0;_0x3f454f['unmanaged']=0x0;_0x3f454f[_0x95b7('0x7')]=0x0;_0x3f454f['total']=0x0;if(_0x3f454f['closed']){if(_0x3f454f[_0x95b7('0x8')]==='abandoned'){_0x3f454f[_0x95b7('0x7')]+=0x1;updateWaitingCounter(_0x3f454f);}if(_0x3f454f[_0x95b7('0x9')]){_0x3f454f['answered']+=0x1;if(_0x3f454f[_0x95b7('0x5')]){_0x3f454f[_0x95b7('0x5')]-=0x1;}}else{if(_0x3f454f[_0x95b7('0x8')]){_0x3f454f['unmanaged']+=0x1;updateWaitingCounter(_0x3f454f);}}}else{if(!_0x3f454f[_0x95b7('0x9')]){_0x3f454f[_0x95b7('0x4')]+=0x1;}if(_0x3f454f[_0x95b7('0x9')]){_0x3f454f[_0x95b7('0x5')]+=0x1;updateWaitingCounter(_0x3f454f);}}_0x3f454f[_0x95b7('0xa')]+=0x1;return _0x3f454f;}function getLastMessageText(_0x9f01f8){return db[_0x95b7('0xb')][_0x95b7('0xc')]({'where':{'$and':[{'MailInteractionId':_0x9f01f8['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x95b7('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x95b7('0xe')],'order':_0x95b7('0xf'),'raw':!![]})[_0x95b7('0x10')](function(_0xe0883f){if(_0xe0883f&&_0xe0883f[_0x95b7('0xe')]){_0x9f01f8[_0x95b7('0x11')]=_[_0x95b7('0x12')](_0xe0883f[_0x95b7('0xe')]);}return _0x9f01f8;})[_0x95b7('0x13')](function(_0xbf0308){throw _0xbf0308;});}exports['updateInteraction']=function(_0x2c4448,_0x42c03f,_0x1bcfd7,_0x468c38){return new Promise(function(_0x486781,_0x30bc51){return getInteractionUsers(_0x2c4448['id'],_0x1bcfd7)['then'](function(_0x206859){_0x2c4448[_0x95b7('0x14')]=_0x206859;return getInteractionTags(_0x2c4448[_0x95b7('0x15')],_0x42c03f);})[_0x95b7('0x10')](function(_0x50cc81){_0x2c4448['Tags']=_0x50cc81;delete _0x2c4448['TagIds'];return updateInteractionCounters(_0x2c4448);})[_0x95b7('0x10')](function(_0x2fb843){if(_0x468c38){return getLastMessageText(_0x2fb843);}else{return _0x2fb843;}})[_0x95b7('0x10')](function(_0x197ff4){_0x486781(_0x197ff4);})[_0x95b7('0x13')](function(_0x27b636){_0x30bc51(_0x27b636);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index eb7b178..39d99f2 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 _0x1570=['chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','accounts','_interactions','_interaction_has_tags','_messages','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','then','update','info','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions'];(function(_0x5e9768,_0x509f2b){var _0x1738be=function(_0x208d9d){while(--_0x208d9d){_0x5e9768['push'](_0x5e9768['shift']());}};_0x1738be(++_0x509f2b);}(_0x1570,0xba));var _0x0157=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x1570[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0157('0x0'));var db=require(_0x0157('0x1'))['db'];var loggers={'openchannel':require(_0x0157('0x2'))(_0x0157('0x3')),'mail':require(_0x0157('0x2'))(_0x0157('0x4')),'fax':require(_0x0157('0x2'))('fax-interactions'),'sms':require(_0x0157('0x2'))(_0x0157('0x5')),'chat':require(_0x0157('0x2'))(_0x0157('0x6')),'whatsapp':require(_0x0157('0x2'))(_0x0157('0x7'))};function getAccountFK(_0x3d3adf){return _[_0x0157('0x8')](_0x3d3adf)+(_0x3d3adf===_0x0157('0x9')?_0x0157('0xa'):_0x0157('0xb'))+'Id';}function getInteractionFK(_0x52196c){return _[_0x0157('0x8')](_0x52196c)+_0x0157('0xc');}function getInteractionId(_0x3dba06,_0x36a1ab,_0x507205){if(_0x3dba06&&_0x3dba06[_[_0x0157('0xd')](_0x507205)+'InteractionId']){return _0x3dba06[_[_0x0157('0xd')](_0x507205)+'InteractionId'];}else if(_0x3dba06&&_0x3dba06['id']){return _0x3dba06['id'];}else if(_0x36a1ab&&_0x36a1ab['id']){return _0x36a1ab['id'];}else{return'unknown';}}function getInteractionsTables(_0x1ebaf2){return{'accounts':_0x1ebaf2+'_'+(_0x1ebaf2===_0x0157('0x9')?'websites':_0x0157('0xe')),'interactions':_0x1ebaf2+_0x0157('0xf'),'interactionsTags':_0x1ebaf2+_0x0157('0x10'),'messages':_0x1ebaf2+_0x0157('0x11'),'userInteractions':'user_has_'+_0x1ebaf2+_0x0157('0xf')};}function getSelectedTags(_0x3336f8){var _0x20eeaf=[];if(_0x3336f8){_0x20eeaf=Array[_0x0157('0x12')](_0x3336f8)?_0x3336f8:[_0x3336f8];}return _0x20eeaf;}function log(_0x531c9a,_0x3e7c38,_0x2c030c,_0x1a6a26,_0x4e2fbd,_0xbbf9c8){loggers[_0x4e2fbd[_0x0157('0x13')]()][_0x531c9a](_0x0157('0x14'),_0xbbf9c8[_0x0157('0x15')](),_0x3e7c38?_0x3e7c38['id']:null,_0x3e7c38?_0x3e7c38[_0x0157('0x16')]:null,_0x3e7c38?_0x3e7c38[_0x0157('0x17')]:null,getInteractionId(_0x2c030c,_0x1a6a26,_0x4e2fbd),_0x2c030c?JSON['stringify'](_0x2c030c):_0x0157('0x18'));}function updateUser(_0x318aa7,_0x36f3b1,_0x34378c,_0x4b66e3,_0x27905e){db[_[_0x0157('0xd')](_0x4b66e3)+_0x0157('0x19')][_0x0157('0x1a')]({'where':{'id':getInteractionId(_0x36f3b1,_0x34378c,_0x4b66e3)}})[_0x0157('0x1b')](function(_0x10c7e3){if(_0x10c7e3){return _0x10c7e3[_0x0157('0x1c')]({'UserId':_0x318aa7?_0x318aa7['id']:null});}})[_0x0157('0x1b')](function(_0x538165){if(_0x538165){log(_0x0157('0x1d'),_0x318aa7,_0x36f3b1,_0x34378c,_0x4b66e3,_0x27905e);}})['catch'](function(){log(_0x0157('0x1e'),_0x318aa7,_0x36f3b1,_0x34378c,_0x4b66e3,_0x27905e);});}module[_0x0157('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x1969=['mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','chat','Account','capitalize','InteractionId','upperFirst','unknown','websites','accounts','_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','null','Interaction','then','update','error','exports','lodash','../../mysqldb','../../config/logger'];(function(_0x560a55,_0x55092b){var _0x2f16aa=function(_0x1dcf7b){while(--_0x1dcf7b){_0x560a55['push'](_0x560a55['shift']());}};_0x2f16aa(++_0x55092b);}(_0x1969,0xc1));var _0x9196=function(_0x4de2ca,_0x28af88){_0x4de2ca=_0x4de2ca-0x0;var _0x7bd583=_0x1969[_0x4de2ca];return _0x7bd583;};'use strict';var _=require(_0x9196('0x0'));var db=require(_0x9196('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x9196('0x2'))(_0x9196('0x3')),'fax':require('../../config/logger')(_0x9196('0x4')),'sms':require(_0x9196('0x2'))('sms-interactions'),'chat':require(_0x9196('0x2'))(_0x9196('0x5')),'whatsapp':require(_0x9196('0x2'))(_0x9196('0x6'))};function getAccountFK(_0x17e081){return _['capitalize'](_0x17e081)+(_0x17e081===_0x9196('0x7')?'Website':_0x9196('0x8'))+'Id';}function getInteractionFK(_0x3ee06f){return _[_0x9196('0x9')](_0x3ee06f)+_0x9196('0xa');}function getInteractionId(_0x3295c5,_0x2edddb,_0x23f3cd){if(_0x3295c5&&_0x3295c5[_[_0x9196('0xb')](_0x23f3cd)+_0x9196('0xa')]){return _0x3295c5[_[_0x9196('0xb')](_0x23f3cd)+_0x9196('0xa')];}else if(_0x3295c5&&_0x3295c5['id']){return _0x3295c5['id'];}else if(_0x2edddb&&_0x2edddb['id']){return _0x2edddb['id'];}else{return _0x9196('0xc');}}function getInteractionsTables(_0xa243a1){return{'accounts':_0xa243a1+'_'+(_0xa243a1===_0x9196('0x7')?_0x9196('0xd'):_0x9196('0xe')),'interactions':_0xa243a1+'_interactions','interactionsTags':_0xa243a1+_0x9196('0xf'),'messages':_0xa243a1+_0x9196('0x10'),'userInteractions':_0x9196('0x11')+_0xa243a1+'_interactions'};}function getSelectedTags(_0x309676){var _0x4b527e=[];if(_0x309676){_0x4b527e=Array[_0x9196('0x12')](_0x309676)?_0x309676:[_0x309676];}return _0x4b527e;}function log(_0x45ed20,_0x48774c,_0x3716dc,_0x514f3b,_0x2ea90b,_0x575337){loggers[_0x2ea90b['toLowerCase']()][_0x45ed20](_0x9196('0x13'),_0x575337['toUpperCase'](),_0x48774c?_0x48774c['id']:null,_0x48774c?_0x48774c[_0x9196('0x14')]:null,_0x48774c?_0x48774c[_0x9196('0x15')]:null,getInteractionId(_0x3716dc,_0x514f3b,_0x2ea90b),_0x3716dc?JSON['stringify'](_0x3716dc):_0x9196('0x16'));}function updateUser(_0x172d3a,_0x3e1a87,_0x194d5d,_0x39e285,_0x344bea){db[_[_0x9196('0xb')](_0x39e285)+_0x9196('0x17')]['findOne']({'where':{'id':getInteractionId(_0x3e1a87,_0x194d5d,_0x39e285)}})[_0x9196('0x18')](function(_0xbd8bc5){if(_0xbd8bc5){return _0xbd8bc5[_0x9196('0x19')]({'UserId':_0x172d3a?_0x172d3a['id']:null});}})[_0x9196('0x18')](function(_0x45ddcb){if(_0x45ddcb){log('info',_0x172d3a,_0x3e1a87,_0x194d5d,_0x39e285,_0x344bea);}})['catch'](function(){log(_0x9196('0x1a'),_0x172d3a,_0x3e1a87,_0x194d5d,_0x39e285,_0x344bea);});}module[_0x9196('0x1b')]={'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 f055f27..45b736a 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 _0x56df=['License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','isUserLimit','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse'];(function(_0x195577,_0x5de53a){var _0x13c367=function(_0x583022){while(--_0x583022){_0x195577['push'](_0x195577['shift']());}};_0x13c367(++_0x5de53a);}(_0x56df,0x136));var _0xf56d=function(_0x59e851,_0x294094){_0x59e851=_0x59e851-0x0;var _0x300113=_0x56df[_0x59e851];return _0x300113;};'use strict';var crypto=require('crypto');var util=require(_0xf56d('0x0'));var compose=require('composable-middleware');var db=require(_0xf56d('0x1'))['db'];var config=require(_0xf56d('0x2'));function getValueFromLicense(_0x3022db,_0x50c220){if(_0x3022db&&_0x50c220){if(_0x50c220[_0xf56d('0x3')]&&_0x50c220[_0xf56d('0x4')]){var _0x410130=_0x50c220['data1'];var _0x4f3b7a=_0x50c220[_0xf56d('0x4')];var _0x2b9772=_0x410130[_0xf56d('0x5')]('-')[0x4];var _0x179a8f=_0x410130[_0xf56d('0x5')]('-')[0x0];var _0xf9b72d=crypto[_0xf56d('0x6')](_0xf56d('0x7'),util[_0xf56d('0x8')](_0xf56d('0x9'),_0x2b9772,_0x410130,_0x179a8f));var _0x409bf5=_0xf9b72d[_0xf56d('0xa')](_0x4f3b7a,_0xf56d('0xb'),_0xf56d('0xc'));_0x409bf5+=_0xf9b72d[_0xf56d('0xd')](_0xf56d('0xc'));var _0x1aa68d=JSON[_0xf56d('0xe')](_0x409bf5);return _0x1aa68d['hasOwnProperty'](_0x3022db)?_0x1aa68d[_0x3022db]:null;}}return null;}function isLimit(_0x53ffd2,_0xeaa319,_0x3f957a,_0x5d4d9a){var _0x5a2093=_0xeaa319;return compose()['use'](function(_0x569590,_0xa2f7fc,_0x29d838){return db[_0xf56d('0xf')][_0xf56d('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xf56d('0x11')](function(_0x490f99){var _0x110704=getValueFromLicense(_0x53ffd2,_0x490f99);return _0x110704?_0x110704:_0x5a2093;})[_0xf56d('0x11')](function(_0x1f5eae){_0x5a2093=_0x1f5eae;return _0x3f957a['count'](_0x5d4d9a);})[_0xf56d('0x11')](function(_0x40dbe9){if(_0x40dbe9>=_0x5a2093){return _0xa2f7fc[_0xf56d('0x12')](0x193)[_0xf56d('0x13')]({'message':util[_0xf56d('0x8')](_0xf56d('0x14'),_0x53ffd2)});}_0x29d838();})[_0xf56d('0x15')](function(_0x499843){_0x29d838(_0x499843);});});}function isUserLimit(){return isLimit(_0xf56d('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0xf56d('0x17')},{'role':'user'}]}});}exports[_0xf56d('0x18')]=isUserLimit; \ No newline at end of file +var _0xe80e=['base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update'];(function(_0x2dffb7,_0x5e91cc){var _0x1dfcf5=function(_0x3eb52f){while(--_0x3eb52f){_0x2dffb7['push'](_0x2dffb7['shift']());}};_0x1dfcf5(++_0x5e91cc);}(_0xe80e,0x7d));var _0xee80=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xe80e[_0x5e3b04];return _0x1fc44d;};'use strict';var crypto=require('crypto');var util=require(_0xee80('0x0'));var compose=require('composable-middleware');var db=require(_0xee80('0x1'))['db'];var config=require(_0xee80('0x2'));function getValueFromLicense(_0x6a1a22,_0x457bc8){if(_0x6a1a22&&_0x457bc8){if(_0x457bc8[_0xee80('0x3')]&&_0x457bc8[_0xee80('0x4')]){var _0x164da2=_0x457bc8[_0xee80('0x3')];var _0x5472ef=_0x457bc8[_0xee80('0x4')];var _0x5478fc=_0x164da2[_0xee80('0x5')]('-')[0x4];var _0x17f88c=_0x164da2['split']('-')[0x0];var _0x2318fb=crypto[_0xee80('0x6')](_0xee80('0x7'),util[_0xee80('0x8')]('%s:%s:%s',_0x5478fc,_0x164da2,_0x17f88c));var _0x19d348=_0x2318fb[_0xee80('0x9')](_0x5472ef,_0xee80('0xa'),_0xee80('0xb'));_0x19d348+=_0x2318fb[_0xee80('0xc')]('utf8');var _0x53b01e=JSON[_0xee80('0xd')](_0x19d348);return _0x53b01e[_0xee80('0xe')](_0x6a1a22)?_0x53b01e[_0x6a1a22]:null;}}return null;}function isLimit(_0x9c3d7b,_0xb30310,_0x10f51c,_0x161f09){var _0x306851=_0xb30310;return compose()[_0xee80('0xf')](function(_0x36aba9,_0x580f5e,_0x29c25b){return db[_0xee80('0x10')][_0xee80('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xee80('0x12')](function(_0x24c787){var _0x10950c=getValueFromLicense(_0x9c3d7b,_0x24c787);return _0x10950c?_0x10950c:_0x306851;})[_0xee80('0x12')](function(_0x233593){_0x306851=_0x233593;return _0x10f51c[_0xee80('0x13')](_0x161f09);})[_0xee80('0x12')](function(_0x111dda){if(_0x111dda>=_0x306851){return _0x580f5e[_0xee80('0x14')](0x193)[_0xee80('0x15')]({'message':util[_0xee80('0x8')](_0xee80('0x16'),_0x9c3d7b)});}_0x29c25b();})[_0xee80('0x17')](function(_0xab54f7){_0x29c25b(_0xab54f7);});});}function isUserLimit(){return isLimit(_0xee80('0x18'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0xee80('0x19')}]}});}exports[_0xee80('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 9204b12..dc3c6fa 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 _0x5370=['filter','map','conditions','push','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$eq','<>\x20?','$substring','$startsWith','$endsWith','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','format','hours','minutes','seconds','lodash','parseSearch','startsWith','replace','[$or]','split','length','forEach','shift','match'];(function(_0x36cfb0,_0x4efd8c){var _0x251b98=function(_0x43c5c7){while(--_0x43c5c7){_0x36cfb0['push'](_0x36cfb0['shift']());}};_0x251b98(++_0x4efd8c);}(_0x5370,0x13a));var _0x0537=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5370[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x0537('0x0'));var moment=require('moment');exports[_0x0537('0x1')]=function(_0x1eb67f){var _0x3f6909={'conditions':[]};_0x3f6909['sqlOperator']=_[_0x0537('0x2')](_0x1eb67f,'[$or]')?'or':'and';var _0x59ce3e=_0x1eb67f[_0x0537('0x3')]('[$and]','')[_0x0537('0x3')](_0x0537('0x4'),'')[_0x0537('0x5')]('||');for(var _0x2df250=0x0;_0x2df250<_0x59ce3e[_0x0537('0x6')];_0x2df250++){var _0x3f00d2=_0x59ce3e[_0x2df250][_0x0537('0x5')](':=');var _0x27e0d3=_0x3f00d2[0x0];var _0x2a9a41=_0x3f00d2['slice'](0x1);_0x2a9a41[_0x0537('0x7')](function(_0x1abaa2){var _0x2b4f97=_0x1abaa2[_0x0537('0x5')]('[')[_0x0537('0x8')]();var _0x4d3d92=_0x1abaa2[_0x0537('0x9')](/\[(.*?)\]/g);_0x4d3d92[_0x0537('0x7')](function(_0x3c7d79){var _0x5ea751=_0x3c7d79[_0x0537('0x5')]('[')[_0x0537('0xa')](function(_0x25b452){return _0x25b452['indexOf'](']')>-0x1;})[_0x0537('0xb')](function(_0xa7c83a){return _0xa7c83a['split'](']')[0x0];})[0x0];_0x3f6909[_0x0537('0xc')][_0x0537('0xd')]({'field':_0x27e0d3,'operator':_0x2b4f97,'value':_0x5ea751});});});}return _0x3f6909;};exports[_0x0537('0xe')]=function(_0x3ebde4,_0xa5ad09,_0x58d208){var _0x33f4b7={};if(_0xa5ad09===_0x0537('0xf')){if(_0x58d208[_0x0537('0x10')]==='$eq'){_0x58d208[_0x0537('0x10')]=_0x0537('0x11');_0x58d208[_0x0537('0x12')]+=','+_0x58d208[_0x0537('0x12')];}else if(_[_0x0537('0x13')]([_0x0537('0x14'),_0x0537('0x15')],_0x58d208[_0x0537('0x10')])){_0x58d208['value']=moment(_0x58d208[_0x0537('0x12')])[_0x0537('0x16')](0x1,_0x0537('0x17'))['format'](_0x0537('0x18'));}}if(_0x58d208[_0x0537('0x19')]){_0xa5ad09=_0x58d208[_0x0537('0x19')];_0x33f4b7[_0x0537('0x1a')]=_0x0537('0x1b')+_0x3ebde4+'.'+_0x58d208[_0x0537('0x1c')]+_0x0537('0x1d')+_0x58d208[_0x0537('0x19')]+')\x20'+parseOperator(_0x58d208[_0x0537('0x10')]);}else{_0x33f4b7[_0x0537('0x1a')]=_0x3ebde4+'.'+_0x58d208[_0x0537('0x1c')]+'\x20'+parseOperator(_0x58d208[_0x0537('0x10')]);}if(_[_0x0537('0x13')]([_0x0537('0x1e'),_0x0537('0x1f')],_0x58d208['operator']))_0x33f4b7[_0x0537('0x1a')]='('+_0x33f4b7[_0x0537('0x1a')]+_0x0537('0x20')+_0x3ebde4+'.'+_0x58d208[_0x0537('0x1c')]+_0x0537('0x21');_0x33f4b7[_0x0537('0x12')]=parseValue(_0xa5ad09,_0x58d208[_0x0537('0x10')],_0x58d208[_0x0537('0x12')]);return _0x33f4b7;};function parseOperator(_0x1e2b66){var _0xe46b88;switch(_0x1e2b66){case _0x0537('0x22'):_0xe46b88='IN\x20?';break;case _0x0537('0x1f'):_0xe46b88=_0x0537('0x23');break;case _0x0537('0x24'):_0xe46b88='=\x20?';break;case _0x0537('0x1e'):_0xe46b88=_0x0537('0x25');break;case _0x0537('0x26'):case _0x0537('0x27'):case _0x0537('0x28'):_0xe46b88='LIKE\x20?';break;case'$lt':_0xe46b88=_0x0537('0x29');break;case'$gt':_0xe46b88=_0x0537('0x2a');break;case _0x0537('0x15'):_0xe46b88=_0x0537('0x2b');break;case _0x0537('0x2c'):_0xe46b88=_0x0537('0x2d');break;case'$between':_0xe46b88=_0x0537('0x2e');break;}return _0xe46b88;}function parseValue(_0x42159d,_0x130039,_0x19df85){var _0x192b17={'start':undefined,'end':undefined};switch(_0x130039){case _0x0537('0x22'):case _0x0537('0x1f'):_0x192b17[_0x0537('0x2f')]=_0x19df85[_0x0537('0x5')](',');break;case _0x0537('0x26'):_0x192b17[_0x0537('0x2f')]='%'+_0x19df85+'%';break;case'$startsWith':_0x192b17['start']=_0x19df85+'%';break;case _0x0537('0x28'):_0x192b17[_0x0537('0x2f')]='%'+_0x19df85;break;case _0x0537('0x11'):var _0x15bdba=_0x19df85[_0x0537('0x5')](',');var _0x19df85=_0x15bdba['shift']();var _0x299da9=_0x15bdba[_0x0537('0x30')]();if(_0x42159d==='DATE'){_0x19df85=moment(_0x19df85)[_0x0537('0x31')](0x0,!![])[_0x0537('0x32')]();_0x299da9=moment(_0x299da9)[_0x0537('0x31')](0x0,!![])['add'](0x17,_0x0537('0x33'))[_0x0537('0x16')](0x3b,_0x0537('0x34'))[_0x0537('0x16')](0x3b,_0x0537('0x35'))[_0x0537('0x32')]();}_0x192b17={'start':_0x19df85,'end':_0x299da9};break;default:_0x192b17[_0x0537('0x2f')]=_0x19df85;break;}return _0x192b17;} \ No newline at end of file +var _0x7137=['map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$notIn','\x20IS\x20NULL)','$in','IN\x20?','$ne','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','utcOffset','hours','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','length','split','slice','forEach','shift','match','filter','indexOf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7137,0x1cf));var _0x7713=function(_0x3c9507,_0x85f61b){_0x3c9507=_0x3c9507-0x0;var _0x4767b3=_0x7137[_0x3c9507];return _0x4767b3;};'use strict';var _=require('lodash');var moment=require(_0x7713('0x0'));exports[_0x7713('0x1')]=function(_0x27aa5b){var _0x1a610b={'conditions':[]};_0x1a610b[_0x7713('0x2')]=_[_0x7713('0x3')](_0x27aa5b,_0x7713('0x4'))?'or':'and';var _0x514358=_0x27aa5b[_0x7713('0x5')]('[$and]','')[_0x7713('0x5')](_0x7713('0x4'),'')['split']('||');for(var _0x5357a4=0x0;_0x5357a4<_0x514358[_0x7713('0x6')];_0x5357a4++){var _0x656323=_0x514358[_0x5357a4][_0x7713('0x7')](':=');var _0x1a879e=_0x656323[0x0];var _0x4cdf45=_0x656323[_0x7713('0x8')](0x1);_0x4cdf45[_0x7713('0x9')](function(_0x3455a0){var _0x138af5=_0x3455a0[_0x7713('0x7')]('[')[_0x7713('0xa')]();var _0x9c8ac0=_0x3455a0[_0x7713('0xb')](/\[(.*?)\]/g);_0x9c8ac0[_0x7713('0x9')](function(_0x3daf22){var _0x224349=_0x3daf22['split']('[')[_0x7713('0xc')](function(_0x1700b0){return _0x1700b0[_0x7713('0xd')](']')>-0x1;})[_0x7713('0xe')](function(_0x3eb3c4){return _0x3eb3c4[_0x7713('0x7')](']')[0x0];})[0x0];_0x1a610b[_0x7713('0xf')][_0x7713('0x10')]({'field':_0x1a879e,'operator':_0x138af5,'value':_0x224349});});});}return _0x1a610b;};exports[_0x7713('0x11')]=function(_0x8eeb7e,_0x1869db,_0x4c75b2){var _0x2ae249={};if(_0x1869db===_0x7713('0x12')){if(_0x4c75b2[_0x7713('0x13')]===_0x7713('0x14')){_0x4c75b2[_0x7713('0x13')]=_0x7713('0x15');_0x4c75b2['value']+=','+_0x4c75b2[_0x7713('0x16')];}else if(_[_0x7713('0x17')]([_0x7713('0x18'),_0x7713('0x19')],_0x4c75b2[_0x7713('0x13')])){_0x4c75b2[_0x7713('0x16')]=moment(_0x4c75b2[_0x7713('0x16')])[_0x7713('0x1a')](0x1,'days')[_0x7713('0x1b')](_0x7713('0x1c'));}}if(_0x4c75b2[_0x7713('0x1d')]){_0x1869db=_0x4c75b2['castTo'];_0x2ae249['text']=_0x7713('0x1e')+_0x8eeb7e+'.'+_0x4c75b2[_0x7713('0x1f')]+_0x7713('0x20')+_0x4c75b2[_0x7713('0x1d')]+')\x20'+parseOperator(_0x4c75b2['operator']);}else{_0x2ae249[_0x7713('0x21')]=_0x8eeb7e+'.'+_0x4c75b2['field']+'\x20'+parseOperator(_0x4c75b2['operator']);}if(_[_0x7713('0x17')](['$ne',_0x7713('0x22')],_0x4c75b2[_0x7713('0x13')]))_0x2ae249[_0x7713('0x21')]='('+_0x2ae249['text']+'\x20OR\x20'+_0x8eeb7e+'.'+_0x4c75b2['field']+_0x7713('0x23');_0x2ae249[_0x7713('0x16')]=parseValue(_0x1869db,_0x4c75b2['operator'],_0x4c75b2[_0x7713('0x16')]);return _0x2ae249;};function parseOperator(_0x116459){var _0x5321e7;switch(_0x116459){case _0x7713('0x24'):_0x5321e7=_0x7713('0x25');break;case _0x7713('0x22'):_0x5321e7='NOT\x20IN\x20?';break;case _0x7713('0x14'):_0x5321e7='=\x20?';break;case _0x7713('0x26'):_0x5321e7=_0x7713('0x27');break;case _0x7713('0x28'):case'$startsWith':case _0x7713('0x29'):_0x5321e7=_0x7713('0x2a');break;case _0x7713('0x2b'):_0x5321e7=_0x7713('0x2c');break;case _0x7713('0x18'):_0x5321e7='>\x20?';break;case _0x7713('0x19'):_0x5321e7='<=\x20?';break;case'$gte':_0x5321e7=_0x7713('0x2d');break;case _0x7713('0x15'):_0x5321e7=_0x7713('0x2e');break;}return _0x5321e7;}function parseValue(_0x5083a7,_0x2a8e0c,_0x260b70){var _0x4d2f4b={'start':undefined,'end':undefined};switch(_0x2a8e0c){case _0x7713('0x24'):case _0x7713('0x22'):_0x4d2f4b[_0x7713('0x2f')]=_0x260b70['split'](',');break;case _0x7713('0x28'):_0x4d2f4b[_0x7713('0x2f')]='%'+_0x260b70+'%';break;case _0x7713('0x30'):_0x4d2f4b[_0x7713('0x2f')]=_0x260b70+'%';break;case _0x7713('0x29'):_0x4d2f4b[_0x7713('0x2f')]='%'+_0x260b70;break;case _0x7713('0x15'):var _0x3d5cb7=_0x260b70[_0x7713('0x7')](',');var _0x260b70=_0x3d5cb7[_0x7713('0xa')]();var _0xe2eac4=_0x3d5cb7[_0x7713('0x31')]();if(_0x5083a7===_0x7713('0x12')){_0x260b70=moment(_0x260b70)[_0x7713('0x32')](0x0,!![])[_0x7713('0x1b')]();_0xe2eac4=moment(_0xe2eac4)['utcOffset'](0x0,!![])[_0x7713('0x1a')](0x17,_0x7713('0x33'))[_0x7713('0x1a')](0x3b,'minutes')[_0x7713('0x1a')](0x3b,_0x7713('0x34'))['format']();}_0x4d2f4b={'start':_0x260b70,'end':_0xe2eac4};break;default:_0x4d2f4b[_0x7713('0x2f')]=_0x260b70;break;}return _0x4d2f4b;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 67fcc9f..72a4472 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 _0x0e85=['type','VIRTUAL','lower','options','lodash','sequelize','keys','parse','fields','split','isEmpty','forOwn','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','col','substr','DESC','cast','omit','isObject','length','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','order','where','filters','filter','object','includes','columns','value','merge'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0e85,0x7c));var _0x50e8=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0e85[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x50e8('0x0'));var sequelize=require(_0x50e8('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x11a13a){var _0x682d10=['ne'];try{var _0x55e515=JSON['parse'](_0x11a13a);var _0x4ce6cd=Object[_0x50e8('0x2')](_0x55e515)[0x0];return _0x682d10['includes'](_0x4ce6cd);}catch(_0x3048e3){return![];}}function getOperatorValue(_0x2401b2){var _0xe3151e=JSON[_0x50e8('0x3')](_0x2401b2);var _0x5e8b01=Object[_0x50e8('0x2')](_0xe3151e)[0x0];var _0x108edc=_0xe3151e[_0x5e8b01];return{['$'+_0x5e8b01]:_0x108edc};}exports[_0x50e8('0x4')]=function(_0x988da0){var _0x1fafb0=null;if(_0x988da0){_0x1fafb0=_0x988da0[_0x50e8('0x5')](',');}return _0x1fafb0;};exports['filters']=function(_0x11717c,_0x228ed1){var _0x19d1bc={};if(!_[_0x50e8('0x6')](_0x11717c)){_[_0x50e8('0x7')](_0x11717c,function(_0x194a89,_0x45dc6f){try{if(_0x228ed1){var _0x3d25ea=_['find'](_0x228ed1,{'name':_0x45dc6f})||{};if(hasSequelizeOperator(_0x194a89)){_0x19d1bc[_0x45dc6f]=getOperatorValue(_0x194a89);}else if(_0x3d25ea['type']===_0x50e8('0x8')&&_[_0x50e8('0x9')](_0x194a89)){var _0x508377=JSON['parse'](_0x194a89);var _0x3cb45c={'$gte':moment(moment(_0x508377[_0x50e8('0xa')])[_0x50e8('0xb')](_0x50e8('0xc')))['utc']()[_0x50e8('0xb')](),'$lte':moment(moment(_0x508377[_0x50e8('0xd')])[_0x50e8('0xb')]('YYYY-MM-DD'))['utc']()[_0x50e8('0xe')](0x1,'s')[_0x50e8('0xb')]()};_0x19d1bc[_0x45dc6f]=_0x3cb45c;}else if(_0x3d25ea[_0x50e8('0xf')]===_0x50e8('0x10')){_0x19d1bc[_0x45dc6f]=_0x194a89;}else{_0x19d1bc[_0x45dc6f]=_[_0x50e8('0x11')](_0x194a89)?_0x194a89:JSON[_0x50e8('0x3')](_0x194a89);}}else{_0x19d1bc[_0x45dc6f]=_['isArray'](_0x194a89)?_0x194a89:JSON['parse'](_0x194a89);}}catch(_0x441f25){_0x19d1bc[_0x45dc6f]=_0x194a89[_0x50e8('0x5')](',');}});}return _0x19d1bc;};exports[_0x50e8('0x12')]=function(_0x45ce11){_0x45ce11=parseInt(_0x45ce11,0xa);if(!_0x45ce11||_0x45ce11<0x0){_0x45ce11=LIMIT_VALUE;}return _0x45ce11;};exports[_0x50e8('0x13')]=function(_0x90c54c){_0x90c54c=parseInt(_0x90c54c,0xa);if(!_0x90c54c||_0x90c54c<0x0){_0x90c54c=0x0;}return _0x90c54c;};exports[_0x50e8('0x14')]=function(_0x53e0a1){var _0x415596,_0x55997c=null;if(_0x53e0a1){_0x415596=_0x53e0a1[_0x50e8('0x5')](',');_0x55997c=_[_0x50e8('0x15')](_0x415596,function(_0xd263d){if(_0xd263d[_0x50e8('0x16')]('-')===0x0){return[_0xd263d===_0x50e8('0x17')?sequelize['cast'](sequelize[_0x50e8('0x18')](_0x50e8('0x17')),'unsigned'):_0xd263d[_0x50e8('0x19')](0x1),_0x50e8('0x1a')];}else{return[_0xd263d==='priority'?sequelize[_0x50e8('0x1b')](sequelize[_0x50e8('0x18')]('priority'),'unsigned'):_0xd263d,'ASC'];}});}return _0x55997c;};exports[_0x50e8('0x1c')]=function(_0x160372,_0x124402){if(_[_0x50e8('0x6')](_0x160372)){return _0x160372;}if(_[_0x50e8('0x11')](_0x160372)){for(var _0x13b6e9=0x0;_0x13b6e9<_0x160372['length'];_0x13b6e9+=0x1){_0x160372[_0x13b6e9]=this[_0x50e8('0x1c')](_0x160372[_0x13b6e9],_0x124402);}return _0x160372;}if(!_[_0x50e8('0x1d')](_0x160372)){return _0x160372;}if(_['isString'](_0x124402)){_0x124402=[_0x124402];}if(!_[_0x50e8('0x11')](_0x124402)){return _0x160372;}for(var _0x2bc8d8=0x0;_0x2bc8d8<_0x124402[_0x50e8('0x1e')];_0x2bc8d8+=0x1){_[_0x50e8('0x1f')](_0x160372,_0x124402[_0x2bc8d8]);}for(var _0x4fbf41 in _0x160372){if(_0x160372[_0x50e8('0x20')](_0x4fbf41)){_0x160372[_0x4fbf41]=this['omit'](_0x160372[_0x4fbf41],_0x124402);}}return _0x160372;};exports[_0x50e8('0x21')]=function(_0x39c0c6){return _0x39c0c6[_0x50e8('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x50e8('0x23')]=function(_0x126c99){return _0x126c99[_0x50e8('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x50e8('0x24')]=function(_0x1d77d0){var _0x18aa31=[];_0x1d77d0[_0x50e8('0x5')](/[ ,]+/)['forEach'](function(_0x290fd2){_0x290fd2=_0x290fd2[_0x50e8('0x25')](/([^:]")"+/g,'$1');_0x290fd2='+'+_0x290fd2+'*';var _0x535c24=/[ `!@#$%^&*()_\-?~]/;if(_0x290fd2['match'](_0x535c24))_0x290fd2='\x22'+_0x290fd2+'\x22';_0x18aa31[_0x50e8('0x26')](_0x290fd2);});return _0x18aa31[_0x50e8('0x27')]('\x20');};exports[_0x50e8('0x28')]=function(_0x47ace2,_0x594187,_0x3e58a9){var _0x19e3cc={},_0x5c2e04={};if(_0x594187[_0x50e8('0x29')][_0x50e8('0x2a')]){_0x594187[_0x50e8('0x29')]['id']=_0x594187[_0x50e8('0x29')]['$id'];delete _0x594187[_0x50e8('0x29')]['$id'];}_0x19e3cc[_0x50e8('0x2b')]=_[_0x50e8('0x15')](_0x47ace2,_0x50e8('0xf'));_0x19e3cc['query']=_[_0x50e8('0x2')](_0x594187[_0x50e8('0x29')]);_0x19e3cc['filters']=_[_0x50e8('0x2c')](_0x19e3cc[_0x50e8('0x2b')],_0x19e3cc[_0x50e8('0x29')]);_0x5c2e04[_0x50e8('0x2d')]=_['intersection'](_0x19e3cc[_0x50e8('0x2b')],this[_0x50e8('0x4')](_0x594187[_0x50e8('0x29')][_0x50e8('0x4')]));_0x5c2e04['attributes']=_0x5c2e04[_0x50e8('0x2d')][_0x50e8('0x1e')]?_0x5c2e04[_0x50e8('0x2d')]:_0x19e3cc['model'];if(!_0x594187['query']['hasOwnProperty'](_0x50e8('0x2e'))){_0x5c2e04[_0x50e8('0x12')]=this[_0x50e8('0x12')](_0x594187[_0x50e8('0x29')][_0x50e8('0x12')]);_0x5c2e04[_0x50e8('0x13')]=this[_0x50e8('0x13')](_0x594187[_0x50e8('0x29')][_0x50e8('0x13')]);}_0x5c2e04[_0x50e8('0x2f')]=this['sort'](_0x594187[_0x50e8('0x29')][_0x50e8('0x14')]);_0x5c2e04[_0x50e8('0x30')]=this[_0x50e8('0x31')](_['pick'](_0x594187[_0x50e8('0x29')],_0x19e3cc[_0x50e8('0x31')]),_0x47ace2);if(_0x594187[_0x50e8('0x29')][_0x50e8('0x32')]){var _0x8e8a97=_0x47ace2;var _0x5c7bef=_0x594187['query'][_0x50e8('0x32')];if(typeof _0x5c7bef===_0x50e8('0x33')){_0x8e8a97=_['filter'](_0x47ace2,function(_0x2ebd77){return _[_0x50e8('0x34')](_0x5c7bef[_0x50e8('0x35')],_0x2ebd77[_0x50e8('0xf')]);});_0x5c7bef=_0x5c7bef[_0x50e8('0x36')];}_0x5c2e04[_0x50e8('0x30')]=_[_0x50e8('0x37')](_0x5c2e04[_0x50e8('0x30')],{'$or':_['map'](_0x8e8a97,function(_0x3d26bd){if(_0x3d26bd[_0x50e8('0x38')]!==_0x50e8('0x39')){if(_0x3e58a9){return sequelize[_0x50e8('0x30')](sequelize['fn']('lower',sequelize[_0x50e8('0x18')](_0x3d26bd[_0x50e8('0xf')])),{'$like':sequelize['fn'](_0x50e8('0x3a'),'%'+_0x594187[_0x50e8('0x29')]['filter']+'%')});}else{var _0x21dfbf={};_0x21dfbf[_0x3d26bd['name']]={'$like':'%'+_0x594187['query']['filter']+'%'};return _0x21dfbf;}}})});}_0x5c2e04=_[_0x50e8('0x37')]({},_0x5c2e04,_0x594187[_0x50e8('0x3b')]);return _0x5c2e04;}; \ No newline at end of file +var _0x72b1=['query','$id','model','intersection','attributes','nolimit','offset','order','where','filter','includes','columns','value','merge','type','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','format','YYYY-MM-DD','$lte','name','uniqueid','isArray','limit','sort','map','col','unsigned','substr','DESC','priority','cast','ASC','length','omit','isString','unset','hasOwnProperty','match','getFullTextValue','forEach','replace','push','join','getOptions'];(function(_0x1a4ef9,_0x22cc39){var _0x16c294=function(_0x5e9238){while(--_0x5e9238){_0x1a4ef9['push'](_0x1a4ef9['shift']());}};_0x16c294(++_0x22cc39);}(_0x72b1,0x16e));var _0x172b=function(_0x4c9496,_0x3170f5){_0x4c9496=_0x4c9496-0x0;var _0x5d19ff=_0x72b1[_0x4c9496];return _0x5d19ff;};'use strict';var _=require(_0x172b('0x0'));var sequelize=require('sequelize');var moment=require(_0x172b('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x29189f){var _0x42b795=['ne'];try{var _0x18fd16=JSON[_0x172b('0x2')](_0x29189f);var _0x3fa10d=Object[_0x172b('0x3')](_0x18fd16)[0x0];return _0x42b795['includes'](_0x3fa10d);}catch(_0x3781f3){return![];}}function getOperatorValue(_0x40c72e){var _0x475fd6=JSON[_0x172b('0x2')](_0x40c72e);var _0x571994=Object[_0x172b('0x3')](_0x475fd6)[0x0];var _0x517363=_0x475fd6[_0x571994];return{['$'+_0x571994]:_0x517363};}exports[_0x172b('0x4')]=function(_0x531b10){var _0x6680e0=null;if(_0x531b10){_0x6680e0=_0x531b10[_0x172b('0x5')](',');}return _0x6680e0;};exports[_0x172b('0x6')]=function(_0x392f1e,_0x50e58a){var _0x3b6daf={};if(!_[_0x172b('0x7')](_0x392f1e)){_[_0x172b('0x8')](_0x392f1e,function(_0x161c7c,_0xa4ada9){try{if(_0x50e58a){var _0x131762=_[_0x172b('0x9')](_0x50e58a,{'name':_0xa4ada9})||{};if(hasSequelizeOperator(_0x161c7c)){_0x3b6daf[_0xa4ada9]=getOperatorValue(_0x161c7c);}else if(_0x131762['type']===_0x172b('0xa')&&_[_0x172b('0xb')](_0x161c7c)){var _0xdf832e=JSON['parse'](_0x161c7c);var _0x289040={'$gte':moment(moment(_0xdf832e['$gte'])[_0x172b('0xc')](_0x172b('0xd')))['utc']()[_0x172b('0xc')](),'$lte':moment(moment(_0xdf832e[_0x172b('0xe')])[_0x172b('0xc')](_0x172b('0xd')))['utc']()['subtract'](0x1,'s')[_0x172b('0xc')]()};_0x3b6daf[_0xa4ada9]=_0x289040;}else if(_0x131762[_0x172b('0xf')]===_0x172b('0x10')){_0x3b6daf[_0xa4ada9]=_0x161c7c;}else{_0x3b6daf[_0xa4ada9]=_[_0x172b('0x11')](_0x161c7c)?_0x161c7c:JSON['parse'](_0x161c7c);}}else{_0x3b6daf[_0xa4ada9]=_['isArray'](_0x161c7c)?_0x161c7c:JSON[_0x172b('0x2')](_0x161c7c);}}catch(_0x3b2701){_0x3b6daf[_0xa4ada9]=_0x161c7c[_0x172b('0x5')](',');}});}return _0x3b6daf;};exports[_0x172b('0x12')]=function(_0x1f20ac){_0x1f20ac=parseInt(_0x1f20ac,0xa);if(!_0x1f20ac||_0x1f20ac<0x0){_0x1f20ac=LIMIT_VALUE;}return _0x1f20ac;};exports['offset']=function(_0x304b96){_0x304b96=parseInt(_0x304b96,0xa);if(!_0x304b96||_0x304b96<0x0){_0x304b96=0x0;}return _0x304b96;};exports[_0x172b('0x13')]=function(_0x2bedae){var _0x33c62c,_0x12f3ec=null;if(_0x2bedae){_0x33c62c=_0x2bedae[_0x172b('0x5')](',');_0x12f3ec=_[_0x172b('0x14')](_0x33c62c,function(_0x5c7e17){if(_0x5c7e17['indexOf']('-')===0x0){return[_0x5c7e17==='priority'?sequelize['cast'](sequelize[_0x172b('0x15')]('priority'),_0x172b('0x16')):_0x5c7e17[_0x172b('0x17')](0x1),_0x172b('0x18')];}else{return[_0x5c7e17===_0x172b('0x19')?sequelize[_0x172b('0x1a')](sequelize[_0x172b('0x15')](_0x172b('0x19')),_0x172b('0x16')):_0x5c7e17,_0x172b('0x1b')];}});}return _0x12f3ec;};exports['omit']=function(_0x3858fc,_0x3ed885){if(_[_0x172b('0x7')](_0x3858fc)){return _0x3858fc;}if(_[_0x172b('0x11')](_0x3858fc)){for(var _0x356c83=0x0;_0x356c83<_0x3858fc[_0x172b('0x1c')];_0x356c83+=0x1){_0x3858fc[_0x356c83]=this[_0x172b('0x1d')](_0x3858fc[_0x356c83],_0x3ed885);}return _0x3858fc;}if(!_['isObject'](_0x3858fc)){return _0x3858fc;}if(_[_0x172b('0x1e')](_0x3ed885)){_0x3ed885=[_0x3ed885];}if(!_[_0x172b('0x11')](_0x3ed885)){return _0x3858fc;}for(var _0x5c8603=0x0;_0x5c8603<_0x3ed885[_0x172b('0x1c')];_0x5c8603+=0x1){_[_0x172b('0x1f')](_0x3858fc,_0x3ed885[_0x5c8603]);}for(var _0x3909b1 in _0x3858fc){if(_0x3858fc[_0x172b('0x20')](_0x3909b1)){_0x3858fc[_0x3909b1]=this[_0x172b('0x1d')](_0x3858fc[_0x3909b1],_0x3ed885);}}return _0x3858fc;};exports['isNumeric']=function(_0x9624f5){return _0x9624f5[_0x172b('0x21')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x43728b){return _0x43728b[_0x172b('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0x172b('0x22')]=function(_0x17bce6){var _0x367f80=[];_0x17bce6[_0x172b('0x5')](/[ ,]+/)[_0x172b('0x23')](function(_0xd4a668){_0xd4a668=_0xd4a668[_0x172b('0x24')](/([^:]")"+/g,'$1');_0xd4a668='+'+_0xd4a668+'*';var _0x239161=/[ `!@#$%^&*()_\-?~]/;if(_0xd4a668[_0x172b('0x21')](_0x239161))_0xd4a668='\x22'+_0xd4a668+'\x22';_0x367f80[_0x172b('0x25')](_0xd4a668);});return _0x367f80[_0x172b('0x26')]('\x20');};exports[_0x172b('0x27')]=function(_0x32e35b,_0x1095dd,_0x312e76){var _0x2afcd5={},_0x3cea35={};if(_0x1095dd[_0x172b('0x28')][_0x172b('0x29')]){_0x1095dd[_0x172b('0x28')]['id']=_0x1095dd[_0x172b('0x28')][_0x172b('0x29')];delete _0x1095dd[_0x172b('0x28')]['$id'];}_0x2afcd5[_0x172b('0x2a')]=_[_0x172b('0x14')](_0x32e35b,_0x172b('0xf'));_0x2afcd5['query']=_[_0x172b('0x3')](_0x1095dd['query']);_0x2afcd5['filters']=_['intersection'](_0x2afcd5[_0x172b('0x2a')],_0x2afcd5['query']);_0x3cea35['attributes']=_[_0x172b('0x2b')](_0x2afcd5[_0x172b('0x2a')],this[_0x172b('0x4')](_0x1095dd['query'][_0x172b('0x4')]));_0x3cea35[_0x172b('0x2c')]=_0x3cea35[_0x172b('0x2c')][_0x172b('0x1c')]?_0x3cea35[_0x172b('0x2c')]:_0x2afcd5[_0x172b('0x2a')];if(!_0x1095dd[_0x172b('0x28')][_0x172b('0x20')](_0x172b('0x2d'))){_0x3cea35[_0x172b('0x12')]=this[_0x172b('0x12')](_0x1095dd[_0x172b('0x28')][_0x172b('0x12')]);_0x3cea35[_0x172b('0x2e')]=this[_0x172b('0x2e')](_0x1095dd[_0x172b('0x28')][_0x172b('0x2e')]);}_0x3cea35[_0x172b('0x2f')]=this[_0x172b('0x13')](_0x1095dd['query']['sort']);_0x3cea35[_0x172b('0x30')]=this['filters'](_['pick'](_0x1095dd['query'],_0x2afcd5[_0x172b('0x6')]),_0x32e35b);if(_0x1095dd[_0x172b('0x28')][_0x172b('0x31')]){var _0x54e62d=_0x32e35b;var _0x115421=_0x1095dd[_0x172b('0x28')][_0x172b('0x31')];if(typeof _0x115421==='object'){_0x54e62d=_[_0x172b('0x31')](_0x32e35b,function(_0x5b2454){return _[_0x172b('0x32')](_0x115421[_0x172b('0x33')],_0x5b2454[_0x172b('0xf')]);});_0x115421=_0x115421[_0x172b('0x34')];}_0x3cea35[_0x172b('0x30')]=_[_0x172b('0x35')](_0x3cea35[_0x172b('0x30')],{'$or':_['map'](_0x54e62d,function(_0x177250){if(_0x177250[_0x172b('0x36')]!==_0x172b('0x37')){if(_0x312e76){return sequelize[_0x172b('0x30')](sequelize['fn'](_0x172b('0x38'),sequelize[_0x172b('0x15')](_0x177250['name'])),{'$like':sequelize['fn']('lower','%'+_0x1095dd[_0x172b('0x28')]['filter']+'%')});}else{var _0x5c2eb2={};_0x5c2eb2[_0x177250['name']]={'$like':'%'+_0x1095dd[_0x172b('0x28')][_0x172b('0x31')]+'%'};return _0x5c2eb2;}}})});}_0x3cea35=_[_0x172b('0x35')]({},_0x3cea35,_0x1095dd[_0x172b('0x39')]);return _0x3cea35;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 97b6ca5..142833b 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 _0xf757=['busy','getAgentStatus','isArray','startCase','Queue','map','findOne','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','User','findAll','name','whatsappPause','pauseType','find','merge','getSortedAgentsIdsByStatus','split','fields','globalStatus','startsWith','DESC','getUpdatedSortOptions','fullname','internal','substring','indexOf','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','address','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','openchannelStatus','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','every','filter','length','unavailable','voiceStatus','idle','voicePause','pause','chatStatus','mailStatus','smsStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','unknown'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf757,0x14d));var _0x7f75=function(_0x2a6754,_0x277259){_0x2a6754=_0x2a6754-0x0;var _0x17feda=_0xf757[_0x2a6754];return _0x17feda;};'use strict';var _=require('lodash');var jayson=require(_0x7f75('0x0'));var db=require(_0x7f75('0x1'))['db'];var amiClient=jayson[_0x7f75('0x2')][_0x7f75('0x3')]({'port':0x232a});var routingClient=jayson[_0x7f75('0x2')][_0x7f75('0x3')]({'port':0x232c});function isAgentPaused(_0x327813,_0x107739){var _0x11e1d9=[_0x327813[_0x7f75('0x4')],_0x327813[_0x7f75('0x5')],_0x327813[_0x7f75('0x6')],_0x327813[_0x7f75('0x7')],_0x327813[_0x7f75('0x8')],_0x327813['voicePause'],_0x327813['whatsappPause']];if(!_0x107739)return _[_0x7f75('0x9')](_0x11e1d9);var _0x3f71a9=_[_0x7f75('0xa')](_0x11e1d9);return _0x3f71a9[_0x7f75('0xb')]>0x0&&_0x3f71a9[_0x7f75('0xb')]<_0x11e1d9[_0x7f75('0xb')]?!![]:![];}function isIdle(_0x3397d9){return _0x3397d9==='idle'||_0x3397d9==='unknown'||_0x3397d9===_0x7f75('0xc')||_0x3397d9==='ringing'||_['isNil'](_0x3397d9);}function isAgentIdle(_0x38a1ae){if(_0x38a1ae[_0x7f75('0xd')]!==_0x7f75('0xe')&&_0x38a1ae[_0x7f75('0xf')]){_0x38a1ae['voiceStatus']=_0x7f75('0x10');return![];}return _[_0x7f75('0x9')]([_0x38a1ae[_0x7f75('0x11')],_0x38a1ae['faxStatus'],_0x38a1ae[_0x7f75('0x12')],_0x38a1ae['openchannelStatus'],_0x38a1ae[_0x7f75('0x13')],_0x38a1ae[_0x7f75('0xd')],_0x38a1ae[_0x7f75('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x7f75('0x15')](function(_0x5b51b4){if(_0x5b51b4[_0x7f75('0x16')]){throw new Error(_0x7f75('0x17'));}var _0x440d58=_0x5b51b4[_0x7f75('0x18')];return routingClient[_0x7f75('0x19')](_0x7f75('0x1a'),{})['then'](function(_0x589d6c){if(_0x589d6c[_0x7f75('0x16')]){throw new Error(_0x7f75('0x1b'));}var _0x42c898=_0x589d6c[_0x7f75('0x18')];return _['merge']({},_0x440d58,_0x42c898);});})[_0x7f75('0x1c')](function(_0x534636){throw _0x534636;});}exports[_0x7f75('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x3be444){var _0xd46265=_0x7f75('0x1e');if(isAgentPaused(_0x3be444))_0xd46265=_0x7f75('0x10');else if(isAgentPaused(_0x3be444,!![]))_0xd46265='*pause';else if(isAgentIdle(_0x3be444))_0xd46265=_0x7f75('0xe');else _0xd46265=_0x7f75('0x1f');return _0xd46265;}exports[_0x7f75('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x26bf18,_0x52ac9d){var _0x544e2f=_[_0x7f75('0x21')](_0x26bf18)?_0x26bf18:[_0x26bf18];var _0xc6a08b=_[_0x7f75('0x22')](_0x52ac9d)+_0x7f75('0x23');var _0x20eb4e=_[_0x7f75('0x24')](_0x544e2f,function(_0x296f4){return db[_0xc6a08b][_0x7f75('0x25')]({'where':{'id':_0x296f4}})['then'](function(_0x1fecaa){if(!_0x1fecaa)return[];return _0x1fecaa['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x20eb4e)[_0x7f75('0x15')](function(_0x1ef0fc){var _0x9bc717=_(_0x1ef0fc)[_0x7f75('0x26')]()[_0x7f75('0x24')]('id')[_0x7f75('0x27')]()[_0x7f75('0x28')]();return _0x9bc717;});}exports[_0x7f75('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x45975b,_0x11dd9a,_0x15c91b){try{if(_0x11dd9a[_0x7f75('0xb')]>0x0){_0x45975b=_0x45975b['filter'](function(_0xfaf986){return _0x11dd9a[_0x7f75('0x2a')](_0xfaf986['id']);});}var _0xea0c52=_0x45975b[_0x7f75('0xa')](function(_0x413a24){var _0x498ec0=_0x7f75('0x1f');if(isAgentIdle(_0x413a24)){_0x498ec0=_0x7f75('0xe');}return _0x498ec0===_0x15c91b;});return _[_0x7f75('0x24')](_0xea0c52,'id');}catch(_0xf530b7){throw _0xf530b7;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x46e901,_0x5615b8,_0x3e073d){return Promise[_0x7f75('0x2b')]()[_0x7f75('0x15')](function(){if(_0x5615b8[_0x7f75('0xb')]>0x0){_0x46e901=_0x46e901[_0x7f75('0xa')](function(_0x12ce07){return _0x5615b8[_0x7f75('0x2a')](_0x12ce07['id']);});}return _0x46e901;})[_0x7f75('0x15')](function(){return db[_0x7f75('0x2c')][_0x7f75('0x2d')]({'attributes':['id',_0x7f75('0x2e'),'fullname','chatPause',_0x7f75('0x5'),_0x7f75('0x6'),'openchannelPause',_0x7f75('0x8'),_0x7f75('0xf'),_0x7f75('0x2f'),_0x7f75('0x30')],'where':{'id':{'$in':_[_0x7f75('0x24')](_0x46e901,'id')}},'raw':!![]});})[_0x7f75('0x15')](function(_0x3034be){return _0x3034be['map'](function(_0x121500){var _0x3afe58=_[_0x7f75('0x31')](_0x46e901,['id',_0x121500['id']]);var _0x59b56d=filterAgentAttributes(_0x3afe58);_[_0x7f75('0x32')](_0x121500,_0x59b56d);_0x121500['globalStatus']=getAgentStatus(_0x121500);return _0x121500;});})[_0x7f75('0x15')](function(_0x5072c6){var _0x177ad1=sortAgentsByStatus(_0x5072c6,_0x3e073d);return _[_0x7f75('0x24')](_0x177ad1,'id');})[_0x7f75('0x1c')](function(_0x11b76a){throw _0x11b76a;});}exports[_0x7f75('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x468c2b){var _0x1e4a81={'fields':[],'order':null};var _0x273a34=_0x468c2b[_0x7f75('0x34')](',');_0x1e4a81[_0x7f75('0x35')]=_['filter'](_0x273a34,function(_0x523a26){if(!_0x523a26[_0x7f75('0x2a')](_0x7f75('0x36'))){return!![];}_0x1e4a81['order']=_[_0x7f75('0x37')](_0x523a26,'-')?_0x7f75('0x38'):'ASC';return![];});return _0x1e4a81;}exports[_0x7f75('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x88c8fb){if(_0x88c8fb['includes'](_0x7f75('0x3a'))&&!_0x88c8fb[_0x7f75('0x2a')](_0x7f75('0x3b'))){var _0x1eacd3=_0x88c8fb[_0x7f75('0x3c')](0x0,_0x88c8fb[_0x7f75('0x3d')](_0x7f75('0x3a')));_0x88c8fb+=','+_0x1eacd3+'internal';}return _0x88c8fb;}exports[_0x7f75('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x15a77d,_0x12f187){var _0x59a390=_0x15a77d['sort'](function(_0x469d10,_0x39c49e){if(_0x469d10[_0x7f75('0x36')]===_0x39c49e[_0x7f75('0x36')]){if(_0x469d10[_0x7f75('0x36')]===_0x7f75('0x10')){if(_0x12f187===_0x7f75('0x38')){return(_0x469d10['pauseType']||'')<(_0x39c49e['pauseType']||'')||_0x469d10[_0x7f75('0x3a')][_0x7f75('0x3f')]()>_0x39c49e[_0x7f75('0x3a')]['toLowerCase']()?0x1:-0x1;}else{return(_0x469d10['pauseType']||'')<(_0x39c49e[_0x7f75('0x30')]||'')||_0x469d10[_0x7f75('0x3a')][_0x7f75('0x3f')]()>_0x39c49e[_0x7f75('0x3a')][_0x7f75('0x3f')]()?-0x1:0x1;}}else{if(_0x12f187==='DESC'){return _0x469d10[_0x7f75('0x3a')][_0x7f75('0x3f')]()<_0x39c49e[_0x7f75('0x3a')][_0x7f75('0x3f')]()?0x1:-0x1;}else{return _0x469d10[_0x7f75('0x3a')][_0x7f75('0x3f')]()<_0x39c49e[_0x7f75('0x3a')][_0x7f75('0x3f')]()?-0x1:0x1;}}}else{if(_0x12f187===_0x7f75('0x38')){return _0x469d10[_0x7f75('0x36')]<_0x39c49e['globalStatus']?0x1:-0x1;}else{return _0x469d10[_0x7f75('0x36')]<_0x39c49e[_0x7f75('0x36')]?-0x1:0x1;}}});return _0x59a390;}exports[_0x7f75('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0xcfb1f1){var _0x5cfd1b=[_0x7f75('0x41'),_0x7f75('0x42'),_0x7f75('0x43'),'lastPauseAt','pauseType','lastPauseAt','internal',_0x7f75('0x44'),_0x7f75('0x4'),_0x7f75('0x7'),'mailPause',_0x7f75('0x8'),'whatsappPause',_0x7f75('0x5'),_0x7f75('0xf'),'chatCapacity',_0x7f75('0x45'),'mailCapacity',_0x7f75('0x46'),_0x7f75('0x47'),_0x7f75('0x48'),'chatCurrentCapacity',_0x7f75('0x49'),_0x7f75('0x4a'),'smsCurrentCapacity',_0x7f75('0x4b'),'faxCurrentCapacity',_0x7f75('0x11'),_0x7f75('0x4c'),_0x7f75('0x12'),_0x7f75('0x13'),'whatsappStatus',_0x7f75('0x4d'),_0x7f75('0xd'),_0x7f75('0x4e'),_0x7f75('0x4f'),_0x7f75('0x50'),'smsStatusTime',_0x7f75('0x51'),_0x7f75('0x52'),_0x7f75('0x53'),_0x7f75('0x54'),'destconnectedlinenum',_0x7f75('0x55'),_0x7f75('0x56'),_0x7f75('0x57'),_0x7f75('0x58')];var _0x415861=['chatPause',_0x7f75('0x7'),_0x7f75('0x6'),_0x7f75('0x8'),_0x7f75('0x2f'),'faxPause',_0x7f75('0xf'),_0x7f75('0x42')];var _0x10449e=_(_0xcfb1f1)[_0x7f75('0x59')](_0x415861)[_0x7f75('0x5a')](_0x5cfd1b)[_0x7f75('0x28')]();return _0x10449e;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x7cb3=['catch','unknown','*pause','isArray','startCase','map','findOne','getAgents','value','getAgentIdsByQueues','filter','busy','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','find','globalStatus','split','fields','order','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','DESC','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','smsStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','length','idle','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x7cb3,0x97));var _0x37cb=function(_0x3ea812,_0x260d39){_0x3ea812=_0x3ea812-0x0;var _0x462abc=_0x7cb3[_0x3ea812];return _0x462abc;};'use strict';var _=require('lodash');var jayson=require(_0x37cb('0x0'));var db=require(_0x37cb('0x1'))['db'];var amiClient=jayson[_0x37cb('0x2')][_0x37cb('0x3')]({'port':0x232a});var routingClient=jayson[_0x37cb('0x2')][_0x37cb('0x3')]({'port':0x232c});function isAgentPaused(_0xe8d036,_0x3470ec){var _0x230cdc=[_0xe8d036[_0x37cb('0x4')],_0xe8d036[_0x37cb('0x5')],_0xe8d036[_0x37cb('0x6')],_0xe8d036[_0x37cb('0x7')],_0xe8d036[_0x37cb('0x8')],_0xe8d036[_0x37cb('0x9')],_0xe8d036[_0x37cb('0xa')]];if(!_0x3470ec)return _[_0x37cb('0xb')](_0x230cdc);var _0x5588a5=_['filter'](_0x230cdc);return _0x5588a5[_0x37cb('0xc')]>0x0&&_0x5588a5['length']<_0x230cdc['length']?!![]:![];}function isIdle(_0x567042){return _0x567042===_0x37cb('0xd')||_0x567042==='unknown'||_0x567042==='unavailable'||_0x567042===_0x37cb('0xe')||_['isNil'](_0x567042);}function isAgentIdle(_0x367ed8){if(_0x367ed8[_0x37cb('0xf')]!==_0x37cb('0xd')&&_0x367ed8[_0x37cb('0x9')]){_0x367ed8[_0x37cb('0xf')]=_0x37cb('0x10');return![];}return _[_0x37cb('0xb')]([_0x367ed8[_0x37cb('0x11')],_0x367ed8[_0x37cb('0x12')],_0x367ed8[_0x37cb('0x13')],_0x367ed8[_0x37cb('0x14')],_0x367ed8['smsStatus'],_0x367ed8['voiceStatus'],_0x367ed8['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x37cb('0x15')]('Agents',{})[_0x37cb('0x16')](function(_0x123815){if(_0x123815[_0x37cb('0x17')]){throw new Error(_0x37cb('0x18'));}var _0x27b7c4=_0x123815[_0x37cb('0x19')];return routingClient[_0x37cb('0x15')](_0x37cb('0x1a'),{})[_0x37cb('0x16')](function(_0x403066){if(_0x403066[_0x37cb('0x17')]){throw new Error(_0x37cb('0x1b'));}var _0x3405b9=_0x403066[_0x37cb('0x19')];return _[_0x37cb('0x1c')]({},_0x27b7c4,_0x3405b9);});})[_0x37cb('0x1d')](function(_0x59f8b6){throw _0x59f8b6;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x27b743){var _0x35b833=_0x37cb('0x1e');if(isAgentPaused(_0x27b743))_0x35b833=_0x37cb('0x10');else if(isAgentPaused(_0x27b743,!![]))_0x35b833=_0x37cb('0x1f');else if(isAgentIdle(_0x27b743))_0x35b833=_0x37cb('0xd');else _0x35b833='busy';return _0x35b833;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0xeb91d4,_0x124cfa){var _0x3ab35a=_[_0x37cb('0x20')](_0xeb91d4)?_0xeb91d4:[_0xeb91d4];var _0x3b8d90=_[_0x37cb('0x21')](_0x124cfa)+'Queue';var _0x33e8d8=_[_0x37cb('0x22')](_0x3ab35a,function(_0x4468c7){return db[_0x3b8d90][_0x37cb('0x23')]({'where':{'id':_0x4468c7}})[_0x37cb('0x16')](function(_0x1ccc26){if(!_0x1ccc26)return[];return _0x1ccc26[_0x37cb('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x33e8d8)['then'](function(_0x55fa53){var _0x14ab70=_(_0x55fa53)['flatten']()[_0x37cb('0x22')]('id')['uniq']()[_0x37cb('0x25')]();return _0x14ab70;});}exports[_0x37cb('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x17fb16,_0x4f4c76,_0x1b7311){try{if(_0x4f4c76[_0x37cb('0xc')]>0x0){_0x17fb16=_0x17fb16[_0x37cb('0x27')](function(_0x4e7e6a){return _0x4f4c76['includes'](_0x4e7e6a['id']);});}var _0x394b64=_0x17fb16[_0x37cb('0x27')](function(_0x2254ce){var _0x3ef78d=_0x37cb('0x28');if(isAgentIdle(_0x2254ce)){_0x3ef78d=_0x37cb('0xd');}return _0x3ef78d===_0x1b7311;});return _[_0x37cb('0x22')](_0x394b64,'id');}catch(_0x3da6ce){throw _0x3da6ce;}}exports[_0x37cb('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5aea55,_0x4964b4,_0x28f080){return Promise[_0x37cb('0x2a')]()[_0x37cb('0x16')](function(){if(_0x4964b4[_0x37cb('0xc')]>0x0){_0x5aea55=_0x5aea55[_0x37cb('0x27')](function(_0x431f50){return _0x4964b4[_0x37cb('0x2b')](_0x431f50['id']);});}return _0x5aea55;})[_0x37cb('0x16')](function(){return db[_0x37cb('0x2c')][_0x37cb('0x2d')]({'attributes':['id',_0x37cb('0x2e'),_0x37cb('0x2f'),'chatPause','faxPause',_0x37cb('0x6'),_0x37cb('0x7'),_0x37cb('0x8'),_0x37cb('0x9'),_0x37cb('0xa'),'pauseType'],'where':{'id':{'$in':_[_0x37cb('0x22')](_0x5aea55,'id')}},'raw':!![]});})[_0x37cb('0x16')](function(_0x1c4322){return _0x1c4322['map'](function(_0x643467){var _0x15b64c=_[_0x37cb('0x30')](_0x5aea55,['id',_0x643467['id']]);var _0x1d3d29=filterAgentAttributes(_0x15b64c);_['merge'](_0x643467,_0x1d3d29);_0x643467[_0x37cb('0x31')]=getAgentStatus(_0x643467);return _0x643467;});})[_0x37cb('0x16')](function(_0x5242aa){var _0xd24df9=sortAgentsByStatus(_0x5242aa,_0x28f080);return _[_0x37cb('0x22')](_0xd24df9,'id');})[_0x37cb('0x1d')](function(_0x53b2b2){throw _0x53b2b2;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xe8a566){var _0x2549db={'fields':[],'order':null};var _0x4897e9=_0xe8a566[_0x37cb('0x32')](',');_0x2549db[_0x37cb('0x33')]=_[_0x37cb('0x27')](_0x4897e9,function(_0x1e9ded){if(!_0x1e9ded[_0x37cb('0x2b')](_0x37cb('0x31'))){return!![];}_0x2549db[_0x37cb('0x34')]=_['startsWith'](_0x1e9ded,'-')?'DESC':'ASC';return![];});return _0x2549db;}exports[_0x37cb('0x35')]=getUpdatedSortOptions;function validateSortParameter(_0x4db6a1){if(_0x4db6a1[_0x37cb('0x2b')](_0x37cb('0x2f'))&&!_0x4db6a1[_0x37cb('0x2b')](_0x37cb('0x36'))){var _0x37a3f7=_0x4db6a1[_0x37cb('0x37')](0x0,_0x4db6a1[_0x37cb('0x38')](_0x37cb('0x2f')));_0x4db6a1+=','+_0x37a3f7+'internal';}return _0x4db6a1;}exports[_0x37cb('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x110d46,_0x3e1ab2){var _0xe0b9a7=_0x110d46[_0x37cb('0x3a')](function(_0x10147c,_0x1b617f){if(_0x10147c[_0x37cb('0x31')]===_0x1b617f['globalStatus']){if(_0x10147c[_0x37cb('0x31')]===_0x37cb('0x10')){if(_0x3e1ab2===_0x37cb('0x3b')){return(_0x10147c[_0x37cb('0x3c')]||'')<(_0x1b617f['pauseType']||'')||_0x10147c[_0x37cb('0x2f')][_0x37cb('0x3d')]()>_0x1b617f[_0x37cb('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return(_0x10147c[_0x37cb('0x3c')]||'')<(_0x1b617f['pauseType']||'')||_0x10147c['fullname'][_0x37cb('0x3d')]()>_0x1b617f[_0x37cb('0x2f')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x3e1ab2===_0x37cb('0x3b')){return _0x10147c['fullname'][_0x37cb('0x3d')]()<_0x1b617f['fullname'][_0x37cb('0x3d')]()?0x1:-0x1;}else{return _0x10147c[_0x37cb('0x2f')]['toLowerCase']()<_0x1b617f[_0x37cb('0x2f')][_0x37cb('0x3d')]()?-0x1:0x1;}}}else{if(_0x3e1ab2==='DESC'){return _0x10147c[_0x37cb('0x31')]<_0x1b617f[_0x37cb('0x31')]?0x1:-0x1;}else{return _0x10147c[_0x37cb('0x31')]<_0x1b617f[_0x37cb('0x31')]?-0x1:0x1;}}});return _0xe0b9a7;}exports[_0x37cb('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0x5e7517){var _0x593da4=['userpic',_0x37cb('0x3f'),_0x37cb('0x40'),_0x37cb('0x41'),_0x37cb('0x3c'),_0x37cb('0x41'),_0x37cb('0x36'),_0x37cb('0x42'),'chatPause',_0x37cb('0x7'),_0x37cb('0x6'),_0x37cb('0x8'),_0x37cb('0xa'),_0x37cb('0x5'),_0x37cb('0x9'),_0x37cb('0x43'),_0x37cb('0x44'),_0x37cb('0x45'),'smsCapacity',_0x37cb('0x46'),_0x37cb('0x47'),_0x37cb('0x48'),_0x37cb('0x49'),_0x37cb('0x4a'),_0x37cb('0x4b'),'whatsappCurrentCapacity',_0x37cb('0x4c'),_0x37cb('0x11'),_0x37cb('0x14'),_0x37cb('0x13'),_0x37cb('0x4d'),_0x37cb('0x4e'),_0x37cb('0x12'),_0x37cb('0xf'),_0x37cb('0x4f'),_0x37cb('0x50'),_0x37cb('0x51'),_0x37cb('0x52'),_0x37cb('0x53'),_0x37cb('0x54'),'voiceStatusTime','queue',_0x37cb('0x55'),'screenrecording',_0x37cb('0x56'),_0x37cb('0x57'),'routealias'];var _0x1c49a3=['chatPause',_0x37cb('0x7'),'mailPause','smsPause',_0x37cb('0xa'),_0x37cb('0x5'),_0x37cb('0x9'),'online'];var _0x53dc56=_(_0x5e7517)[_0x37cb('0x58')](_0x1c49a3)[_0x37cb('0x59')](_0x593da4)[_0x37cb('0x25')]();return _0x53dc56;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c73538c..6598fd1 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(_0x1960b5,_0x1835a4){var _0x18f387=function(_0x4f781b){while(--_0x4f781b){_0x1960b5['push'](_0x1960b5['shift']());}};_0x18f387(++_0x1835a4);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 _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(_0x2508db,_0x4ee279){var _0x4a548c=function(_0x2e2472){while(--_0x2e2472){_0x2508db['push'](_0x2508db['shift']());}};_0x4a548c(++_0x4ee279);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 852f574..2e174ca 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 _0x6b38=['length','filter','IPv4','internal','concat','mac','address','127.0.0.1','getFirstInterface','cpus','createHash','md5','update','hex','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys'];(function(_0x1df7c8,_0x168b1c){var _0x51f29b=function(_0x178f48){while(--_0x178f48){_0x1df7c8['push'](_0x1df7c8['shift']());}};_0x51f29b(++_0x168b1c);}(_0x6b38,0x1d3));var _0x86b3=function(_0xf6aed,_0x3a9b6c){_0xf6aed=_0xf6aed-0x0;var _0x46e818=_0x6b38[_0xf6aed];return _0x46e818;};'use strict';var _=require(_0x86b3('0x0'));var os=require('os');var crypto=require(_0x86b3('0x1'));var machine=require(_0x86b3('0x2'));var exec=require(_0x86b3('0x3'))[_0x86b3('0x4')];var config=require(_0x86b3('0x5'));function getInterfaces(){var _0x16eebd=[];var _0x35878e=os[_0x86b3('0x6')]();var _0x14f5c4=_[_0x86b3('0x7')](_[_0x86b3('0x8')](_0x35878e));for(var _0x33b60e=0x0;_0x33b60e<_0x14f5c4[_0x86b3('0x9')];_0x33b60e++){var _0x22922a=_0x35878e[_0x14f5c4[_0x33b60e]][_0x86b3('0xa')](function(_0x49878d){return _0x49878d['family']===_0x86b3('0xb')&&_0x49878d[_0x86b3('0xc')]===![];});_0x16eebd=_0x16eebd[_0x86b3('0xd')](_0x22922a);}return _0x16eebd;}function getFirstInterface(){var _0x474385=_['head'](getInterfaces());return{'macAddress':_0x474385&&_0x474385[_0x86b3('0xe')]?_0x474385[_0x86b3('0xe')]:'00:00:00:00:00:00','ipAddress':_0x474385&&_0x474385[_0x86b3('0xf')]?_0x474385['address']:_0x86b3('0x10')};}exports[_0x86b3('0x11')]=getFirstInterface;function getCPUhash(){var _0x2e55f7=_[_0x86b3('0x7')](os[_0x86b3('0x12')]()['map'](function(_0x3f6ab3){return _0x3f6ab3['model'];}))['join'](':');return crypto[_0x86b3('0x13')](_0x86b3('0x14'))[_0x86b3('0x15')](_0x2e55f7)['digest'](_0x86b3('0x16'));}exports['getUuid']=function(){var _0x1ca4a9=os[_0x86b3('0x17')]();var _0x1bdb93=/[0-9a-f-]{36}/;if(config[_0x86b3('0x18')]&&_0x1bdb93[_0x86b3('0x19')](config[_0x86b3('0x18')])){return config[_0x86b3('0x18')];}else if(_0x1ca4a9==='win32'){return exec(_0x86b3('0x1a'),{'encoding':_0x86b3('0x1b')})[_0x86b3('0x1c')]('\x0d\x0a','');}else{var _0x28b7bf=getFirstInterface();var _0x423903=getCPUhash();var _0x4a1b80=_0x423903+'|'+os[_0x86b3('0x1d')]()+'|'+_0x28b7bf[_0x86b3('0x1e')]+'|'+_0x28b7bf[_0x86b3('0x1f')];var _0x39391c=crypto[_0x86b3('0x13')]('md5')[_0x86b3('0x15')](_0x4a1b80)[_0x86b3('0x20')](_0x86b3('0x16'));return _0x39391c[_0x86b3('0x21')](0x0,0x8)+'-'+_0x39391c[_0x86b3('0x21')](0x8,0xc)+'-'+_0x39391c[_0x86b3('0x21')](0xc,0x10)+'-'+_0x39391c[_0x86b3('0x21')](0x10,0x14)+'-'+_0x39391c[_0x86b3('0x21')](0x14);}}; \ No newline at end of file +var _0xe5fe=['bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','filter','family','IPv4','internal','head','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','hex','getUuid','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','digest','substring','lodash','crypto'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe5fe,0xad));var _0xee5f=function(_0xb80aa4,_0x30db4d){_0xb80aa4=_0xb80aa4-0x0;var _0x5e781d=_0xe5fe[_0xb80aa4];return _0x5e781d;};'use strict';var _=require(_0xee5f('0x0'));var os=require('os');var crypto=require(_0xee5f('0x1'));var machine=require(_0xee5f('0x2'));var exec=require(_0xee5f('0x3'))['execSync'];var config=require(_0xee5f('0x4'));function getInterfaces(){var _0x168c07=[];var _0x17ddf5=os[_0xee5f('0x5')]();var _0x299563=_[_0xee5f('0x6')](_[_0xee5f('0x7')](_0x17ddf5));for(var _0x7661c4=0x0;_0x7661c4<_0x299563['length'];_0x7661c4++){var _0x3c76bc=_0x17ddf5[_0x299563[_0x7661c4]][_0xee5f('0x8')](function(_0x499610){return _0x499610[_0xee5f('0x9')]===_0xee5f('0xa')&&_0x499610[_0xee5f('0xb')]===![];});_0x168c07=_0x168c07['concat'](_0x3c76bc);}return _0x168c07;}function getFirstInterface(){var _0x562b27=_[_0xee5f('0xc')](getInterfaces());return{'macAddress':_0x562b27&&_0x562b27['mac']?_0x562b27['mac']:_0xee5f('0xd'),'ipAddress':_0x562b27&&_0x562b27['address']?_0x562b27[_0xee5f('0xe')]:_0xee5f('0xf')};}exports[_0xee5f('0x10')]=getFirstInterface;function getCPUhash(){var _0x4afdd7=_[_0xee5f('0x6')](os[_0xee5f('0x11')]()['map'](function(_0x249b2a){return _0x249b2a[_0xee5f('0x12')];}))[_0xee5f('0x13')](':');return crypto[_0xee5f('0x14')](_0xee5f('0x15'))[_0xee5f('0x16')](_0x4afdd7)['digest'](_0xee5f('0x17'));}exports[_0xee5f('0x18')]=function(){var _0x3372cd=os['platform']();var _0x567e52=/[0-9a-f-]{36}/;if(config[_0xee5f('0x19')]&&_0x567e52[_0xee5f('0x1a')](config[_0xee5f('0x19')])){return config['licenseToken'];}else if(_0x3372cd==='win32'){return exec(_0xee5f('0x1b'),{'encoding':_0xee5f('0x1c')})[_0xee5f('0x1d')]('\x0d\x0a','');}else{var _0x2d468b=getFirstInterface();var _0x18bd48=getCPUhash();var _0x3fa6bd=_0x18bd48+'|'+os[_0xee5f('0x1e')]()+'|'+_0x2d468b[_0xee5f('0x1f')]+'|'+_0x2d468b[_0xee5f('0x20')];var _0x38a17a=crypto['createHash']('md5')[_0xee5f('0x16')](_0x3fa6bd)[_0xee5f('0x21')](_0xee5f('0x17'));return _0x38a17a[_0xee5f('0x22')](0x0,0x8)+'-'+_0x38a17a[_0xee5f('0x22')](0x8,0xc)+'-'+_0x38a17a['substring'](0xc,0x10)+'-'+_0x38a17a[_0xee5f('0x22')](0x10,0x14)+'-'+_0x38a17a['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 9163702..ec16fb2 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 _0x5d53=['message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','encryptString','decryptString','DEMO\x20START\x20AT\x20%s','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5d53,0x15e));var _0x35d5=function(_0x73ba1f,_0x588ccb){_0x73ba1f=_0x73ba1f-0x0;var _0x2e2725=_0x5d53[_0x73ba1f];return _0x2e2725;};'use strict';var util=require('util');var moment=require(_0x35d5('0x0'));var rp=require(_0x35d5('0x1'));var BPromise=require(_0x35d5('0x2'));var pkginfo=require(_0x35d5('0x3'))(module,_0x35d5('0x4'));var db=require(_0x35d5('0x5'))['db'];var encryptor=require(_0x35d5('0x6'));var hardware=require(_0x35d5('0x7'));var logger=require(_0x35d5('0x8'))(_0x35d5('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xdd54a5){return new BPromise(function(_0x16808e,_0x34012a){var _0x17f748=util[_0x35d5('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0xdd54a5,module['exports'][_0x35d5('0x4')]);if(oldToken){_0x17f748=util[_0x35d5('0xa')](_0x35d5('0xb'),HOST,_0xdd54a5,module[_0x35d5('0xc')][_0x35d5('0x4')],oldToken);}var _0x599a4c={'uri':_0x17f748,'method':_0x35d5('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x599a4c)[_0x35d5('0xe')](function(_0xfcf81f){_0x16808e(_0xfcf81f);})['catch'](function(_0x36658a){_0x34012a(_0x36658a);});});}function manageLicense(_0xf7b2f8,_0x49259a){var _0x5a53e3=_0x49259a['get']({'plain':!![]});if(!isOldTokenSent&&_0x5a53e3['data1']!==_0xf7b2f8&&!_0x5a53e3['data2']){oldToken=_0x5a53e3[_0x35d5('0xf')];}httpRequest(_0xf7b2f8)['then'](function(_0x3066e4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3066e4[_0x35d5('0x10')]){isOldTokenSent=![];if(!_0x5a53e3[_0x35d5('0x9')]&&_0x5a53e3[_0x35d5('0x9')]!=_0x3066e4[_0x35d5('0x9')]||_0x5a53e3[_0x35d5('0x9')]&&_0x5a53e3[_0x35d5('0x11')]){logger[_0x35d5('0x12')](_0x35d5('0x13'));}if(_0x5a53e3['license']&&!_0x5a53e3['data2']&&_0x5a53e3[_0x35d5('0x9')]!=_0x3066e4[_0x35d5('0x9')]){logger[_0x35d5('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x5a53e3[_0x35d5('0x9')]&&!_0x5a53e3['data2']&&_0x5a53e3['license']==_0x3066e4[_0x35d5('0x9')]){return _0x49259a;}return _0x49259a['update']({'data1':_0xf7b2f8,'data2':null,'license':_0x3066e4[_0x35d5('0x9')]});}else{if(_0x3066e4[_0x35d5('0x9')]||_0x5a53e3[_0x35d5('0x9')]){if(!_0x5a53e3[_0x35d5('0x11')]){if(_0x5a53e3[_0x35d5('0xf')]==_0xf7b2f8){GRAY_PERIOD_REASON=_0x35d5('0x14');logger[_0x35d5('0x12')](_0x35d5('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x35d5('0x12')](_0x35d5('0x16'),_0x5a53e3[_0x35d5('0xf')],_0xf7b2f8);}logger['info'](_0x35d5('0x17'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x35d5('0x18')));return _0x49259a[_0x35d5('0x19')]({'data2':encryptor[_0x35d5('0x1a')](moment()[_0x35d5('0xa')](_0x35d5('0x18')))});}else{if(moment()['diff'](encryptor[_0x35d5('0x1b')](_0x5a53e3[_0x35d5('0x11')]),'days')>DAYS){logger[_0x35d5('0x12')](_0x35d5('0x1c'),moment()[_0x35d5('0xa')](_0x35d5('0x18')));isOldTokenSent=![];return _0x49259a[_0x35d5('0x19')]({'data1':_0xf7b2f8,'data2':null,'license':null});}}}else{if(_0x5a53e3['data1']!=_0xf7b2f8){logger[_0x35d5('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5a53e3[_0x35d5('0xf')],_0xf7b2f8);return _0x49259a[_0x35d5('0x19')]({'data1':_0xf7b2f8,'data2':null,'license':null});}}}return _0x49259a;})[_0x35d5('0xe')](function(_0x89b5a8){_0x49259a=_0x89b5a8;})[_0x35d5('0x1d')](function(_0xba249a){logger['error'](_0xba249a[_0x35d5('0x1e')]);})[_0x35d5('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0x35d5('0x20')](),_0x49259a);},TIME);});}function defaultLicense(){var _0x3e24c6=hardware[_0x35d5('0x20')]();if(_0x3e24c6){return db[_0x35d5('0x21')][_0x35d5('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x3e24c6}})['spread'](function(_0xd9da24,_0x84d824){logger[_0x35d5('0x12')](_0x35d5('0x23'),_0x3e24c6);manageLicense(_0x3e24c6,_0xd9da24);})[_0x35d5('0x1d')](function(_0x301b4f){logger[_0x35d5('0x24')](_0x301b4f[_0x35d5('0x1e')]);});}}exports[_0x35d5('0x25')]=defaultLicense; \ No newline at end of file +var _0x5c39=['THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','format','%s/api/servers/%s/check?version=%s','exports','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED'];(function(_0x12358a,_0x50e25f){var _0x5f55ae=function(_0x1f6ae8){while(--_0x1f6ae8){_0x12358a['push'](_0x12358a['shift']());}};_0x5f55ae(++_0x50e25f);}(_0x5c39,0xde));var _0x95c3=function(_0x38916e,_0x2a1560){_0x38916e=_0x38916e-0x0;var _0x5636a3=_0x5c39[_0x38916e];return _0x5636a3;};'use strict';var util=require(_0x95c3('0x0'));var moment=require('moment');var rp=require(_0x95c3('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0x95c3('0x2'))(module,_0x95c3('0x3'));var db=require(_0x95c3('0x4'))['db'];var encryptor=require(_0x95c3('0x5'));var hardware=require(_0x95c3('0x6'));var logger=require('../logger')(_0x95c3('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x465d1d){return new BPromise(function(_0x5c7aa,_0x59e177){var _0x590543=util[_0x95c3('0x8')](_0x95c3('0x9'),HOST,_0x465d1d,module[_0x95c3('0xa')][_0x95c3('0x3')]);if(oldToken){_0x590543=util[_0x95c3('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x465d1d,module[_0x95c3('0xa')][_0x95c3('0x3')],oldToken);}var _0x21f64b={'uri':_0x590543,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x21f64b)[_0x95c3('0xb')](function(_0x6d3b85){_0x5c7aa(_0x6d3b85);})['catch'](function(_0x4e89b6){_0x59e177(_0x4e89b6);});});}function manageLicense(_0x8add01,_0x4a12c7){var _0x1b7060=_0x4a12c7[_0x95c3('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x1b7060[_0x95c3('0xd')]!==_0x8add01&&!_0x1b7060[_0x95c3('0xe')]){oldToken=_0x1b7060[_0x95c3('0xd')];}httpRequest(_0x8add01)[_0x95c3('0xb')](function(_0x1f8dc4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1f8dc4[_0x95c3('0xf')]){isOldTokenSent=![];if(!_0x1b7060[_0x95c3('0x7')]&&_0x1b7060[_0x95c3('0x7')]!=_0x1f8dc4[_0x95c3('0x7')]||_0x1b7060['license']&&_0x1b7060[_0x95c3('0xe')]){logger[_0x95c3('0x10')](_0x95c3('0x11'));}if(_0x1b7060[_0x95c3('0x7')]&&!_0x1b7060[_0x95c3('0xe')]&&_0x1b7060['license']!=_0x1f8dc4['license']){logger[_0x95c3('0x10')](_0x95c3('0x12'));}if(_0x1b7060[_0x95c3('0x7')]&&!_0x1b7060[_0x95c3('0xe')]&&_0x1b7060[_0x95c3('0x7')]==_0x1f8dc4[_0x95c3('0x7')]){return _0x4a12c7;}return _0x4a12c7[_0x95c3('0x13')]({'data1':_0x8add01,'data2':null,'license':_0x1f8dc4['license']});}else{if(_0x1f8dc4[_0x95c3('0x7')]||_0x1b7060[_0x95c3('0x7')]){if(!_0x1b7060[_0x95c3('0xe')]){if(_0x1b7060[_0x95c3('0xd')]==_0x8add01){GRAY_PERIOD_REASON=_0x95c3('0x14');logger['info'](_0x95c3('0x15'));}else{GRAY_PERIOD_REASON=_0x95c3('0x16');logger[_0x95c3('0x10')](_0x95c3('0x17'),_0x1b7060['data1'],_0x8add01);}logger[_0x95c3('0x10')](_0x95c3('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x95c3('0x8')](_0x95c3('0x19')));return _0x4a12c7['update']({'data2':encryptor[_0x95c3('0x1a')](moment()['format'](_0x95c3('0x19')))});}else{if(moment()[_0x95c3('0x1b')](encryptor['decryptString'](_0x1b7060[_0x95c3('0xe')]),_0x95c3('0x1c'))>DAYS){logger[_0x95c3('0x10')](_0x95c3('0x1d'),moment()[_0x95c3('0x8')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4a12c7[_0x95c3('0x13')]({'data1':_0x8add01,'data2':null,'license':null});}}}else{if(_0x1b7060[_0x95c3('0xd')]!=_0x8add01){logger[_0x95c3('0x10')](_0x95c3('0x17'),_0x1b7060[_0x95c3('0xd')],_0x8add01);return _0x4a12c7[_0x95c3('0x13')]({'data1':_0x8add01,'data2':null,'license':null});}}}return _0x4a12c7;})[_0x95c3('0xb')](function(_0x2b4632){_0x4a12c7=_0x2b4632;})[_0x95c3('0x1e')](function(_0x288674){logger[_0x95c3('0x1f')](_0x288674[_0x95c3('0x20')]);})[_0x95c3('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x95c3('0x22')](),_0x4a12c7);},TIME);});}function defaultLicense(){var _0xe4077d=hardware['getUuid']();if(_0xe4077d){return db[_0x95c3('0x23')][_0x95c3('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0xe4077d}})[_0x95c3('0x25')](function(_0x2c8290,_0x5e2a23){logger['info'](_0x95c3('0x26'),_0xe4077d);manageLicense(_0xe4077d,_0x2c8290);})['catch'](function(_0xcabee){logger[_0x95c3('0x1f')](_0xcabee[_0x95c3('0x20')]);});}}exports[_0x95c3('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index bc9d441..0ff44d7 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 _0xb078=['format','demo','uuid','machineUuid','gray','deadline','add','days','then','User','findAll','sequelize','col','role','admin','user','telephone','count','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString'];(function(_0x3171fd,_0x4a1028){var _0x26c821=function(_0x4acd9a){while(--_0x4acd9a){_0x3171fd['push'](_0x3171fd['shift']());}};_0x26c821(++_0x4a1028);}(_0xb078,0x19d));var _0x8b07=function(_0x359f04,_0x455b6d){_0x359f04=_0x359f04-0x0;var _0x5b91a3=_0xb078[_0x359f04];return _0x5b91a3;};'use strict';var util=require(_0x8b07('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x8b07('0x1'));var encryptor=require('../../components/encryptor');var db=require(_0x8b07('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8b07('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x8b07('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8b07('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8b07('0x5'),'machineUuid':hardware[_0x8b07('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x208fbf){return new BPromise(function(_0x217d5e,_0x4f32c6){return db[_0x8b07('0x6')][_0x8b07('0x7')](_[_0x8b07('0x8')](_0x208fbf,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3baf61){return checkLicense(_0x3baf61,null);})['then'](function(_0x23be12){_0x217d5e(_0x23be12);return;})['catch'](function(_0x4653c9){_0x4f32c6(_0x4653c9);});});}function checkLicense(_0x18f500,_0x278de8){if(!_0x18f500){demoLicense['uuid']=_0x18f500[_0x8b07('0x9')];return demoLicense;}try{var _0x44aef2=_0x278de8||_0x18f500[_0x8b07('0xa')];if(_[_0x8b07('0xb')](_0x44aef2)){throw new Error(_0x8b07('0xc'));}var _0x3046c3=_0x18f500[_0x8b07('0x9')];var _0x3e1155=_0x18f500[_0x8b07('0xd')];var _0x24a29c=_0x3046c3[_0x8b07('0xe')]('-')[0x4];var _0x447ea8=_0x3046c3[_0x8b07('0xe')]('-')[0x0];var _0x14eadf=encryptor[_0x8b07('0xf')](_0x44aef2,util[_0x8b07('0x10')]('%s:%s:%s',_0x24a29c,_0x3046c3,_0x447ea8));var _0x4ebcc6=JSON['parse'](_0x14eadf);_0x4ebcc6[_0x8b07('0x11')]=![];_0x4ebcc6[_0x8b07('0x12')]=_0x3046c3;_0x4ebcc6[_0x8b07('0x13')]=hardware[_0x8b07('0x4')]();if(_0x3e1155){var _0x120823=encryptor[_0x8b07('0xf')](_0x3e1155);_0x4ebcc6[_0x8b07('0x14')]=_0x120823;_0x4ebcc6[_0x8b07('0x15')]=moment(_0x120823)[_0x8b07('0x16')](0x7,_0x8b07('0x17'))[_0x8b07('0x10')]();_0x4ebcc6['grayReason']=_0x4ebcc6[_0x8b07('0x12')]!=_0x4ebcc6[_0x8b07('0x13')]?'changed':'disabled';}return _0x4ebcc6;}catch(_0x533026){breakingLicense[_0x8b07('0x12')]=_0x18f500[_0x8b07('0x9')];breakingLicense['message']=_0x533026['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x22b97d,_0x5b573e){getLicense()[_0x8b07('0x18')](function(_0x5c211c){return db[_0x8b07('0x19')][_0x8b07('0x1a')]({'attributes':['role',[db[_0x8b07('0x1b')]['fn']('COUNT',db[_0x8b07('0x1b')][_0x8b07('0x1c')](_0x8b07('0x1d'))),'count']],'group':_0x8b07('0x1d'),'where':{'role':{'$or':[_0x8b07('0x1e'),_0x8b07('0x1f'),_0x8b07('0x20')]}},'raw':!![]})['then'](function(_0x968331){var _0x43a159={'user':_0x5c211c['users']||0x0,'telephone':_0x5c211c['telephones']||0x0};_0x968331['forEach'](function(_0x1eadd4){var _0xcfcb=_0x1eadd4[_0x8b07('0x1d')]===_0x8b07('0x1e')?_0x8b07('0x1f'):_0x1eadd4[_0x8b07('0x1d')];_0x43a159[_0xcfcb]-=_0x1eadd4[_0x8b07('0x21')];if(_0x43a159[_0xcfcb]<0x0)_0x43a159[_0xcfcb]=0x0;});_0x22b97d(_0x43a159);return;});})[_0x8b07('0x22')](function(_0x4fe806){_0x5b573e(_0x4fe806);});});}function checkUserLimits(_0xfa375){return new BPromise(function(_0xe5ce53,_0x1b788b){getLimits()[_0x8b07('0x18')](function(_0x428717){var _0x5ce46b=_[_0x8b07('0x23')](_[_0x8b07('0x24')](_0xfa375,_0x8b07('0x1d')),[_0x8b07('0x1e'),'user',_0x8b07('0x20')]);var _0xca3af1=(_0x5ce46b['admin']||0x0)+(_0x5ce46b[_0x8b07('0x1f')]||0x0);var _0x3c0729=_0x5ce46b[_0x8b07('0x20')]||0x0;if(_0xca3af1>_0x428717[_0x8b07('0x1f')])return _0x1b788b(_0x8b07('0x25'));if(_0x3c0729>_0x428717[_0x8b07('0x20')])return _0x1b788b(_0x8b07('0x26'));return _0xe5ce53();})[_0x8b07('0x22')](function(_0x491255){_0x1b788b(_0x491255);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xfbf0=['2027-01-01T00:00:00.000Z','getUuid','find','defaults','catch','uuid','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','then','sequelize','COUNT','col','role','admin','users','telephones','user','count','pick','telephone','exports','./hardware','../../components/encryptor','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfbf0,0xc5));var _0x0fbf=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xfbf0[_0x474bc0];return _0x4b24cf;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x0fbf('0x0'));var encryptor=require(_0x0fbf('0x1'));var db=require(_0x0fbf('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0fbf('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0fbf('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x0fbf('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xcaa3ba){return new BPromise(function(_0x50cd77,_0x4e3701){return db['License'][_0x0fbf('0x5')](_[_0x0fbf('0x6')](_0xcaa3ba,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x18dc28){return checkLicense(_0x18dc28,null);})['then'](function(_0x8ca186){_0x50cd77(_0x8ca186);return;})[_0x0fbf('0x7')](function(_0xd9386d){_0x4e3701(_0xd9386d);});});}function checkLicense(_0x593282,_0x2e345e){if(!_0x593282){demoLicense[_0x0fbf('0x8')]=_0x593282[_0x0fbf('0x9')];return demoLicense;}try{var _0x35f7b0=_0x2e345e||_0x593282[_0x0fbf('0xa')];if(_[_0x0fbf('0xb')](_0x35f7b0)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x5767a7=_0x593282[_0x0fbf('0x9')];var _0x3fc0e5=_0x593282[_0x0fbf('0xc')];var _0x5f5672=_0x5767a7[_0x0fbf('0xd')]('-')[0x4];var _0x48d61a=_0x5767a7['split']('-')[0x0];var _0x58d690=encryptor[_0x0fbf('0xe')](_0x35f7b0,util[_0x0fbf('0xf')](_0x0fbf('0x10'),_0x5f5672,_0x5767a7,_0x48d61a));var _0x599352=JSON[_0x0fbf('0x11')](_0x58d690);_0x599352['demo']=![];_0x599352[_0x0fbf('0x8')]=_0x5767a7;_0x599352[_0x0fbf('0x12')]=hardware[_0x0fbf('0x4')]();if(_0x3fc0e5){var _0x47953e=encryptor[_0x0fbf('0xe')](_0x3fc0e5);_0x599352[_0x0fbf('0x13')]=_0x47953e;_0x599352[_0x0fbf('0x14')]=moment(_0x47953e)[_0x0fbf('0x15')](0x7,_0x0fbf('0x16'))[_0x0fbf('0xf')]();_0x599352[_0x0fbf('0x17')]=_0x599352['uuid']!=_0x599352[_0x0fbf('0x12')]?_0x0fbf('0x18'):_0x0fbf('0x19');}return _0x599352;}catch(_0x4a8da9){breakingLicense[_0x0fbf('0x8')]=_0x593282[_0x0fbf('0x9')];breakingLicense[_0x0fbf('0x1a')]=_0x4a8da9['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x249c31,_0x24f983){getLicense()[_0x0fbf('0x1b')](function(_0x2e290d){return db['User']['findAll']({'attributes':['role',[db[_0x0fbf('0x1c')]['fn'](_0x0fbf('0x1d'),db[_0x0fbf('0x1c')][_0x0fbf('0x1e')](_0x0fbf('0x1f'))),'count']],'group':_0x0fbf('0x1f'),'where':{'role':{'$or':[_0x0fbf('0x20'),'user','telephone']}},'raw':!![]})[_0x0fbf('0x1b')](function(_0xf7880d){var _0x4c099e={'user':_0x2e290d[_0x0fbf('0x21')]||0x0,'telephone':_0x2e290d[_0x0fbf('0x22')]||0x0};_0xf7880d['forEach'](function(_0x53196c){var _0xbfe37f=_0x53196c[_0x0fbf('0x1f')]===_0x0fbf('0x20')?_0x0fbf('0x23'):_0x53196c[_0x0fbf('0x1f')];_0x4c099e[_0xbfe37f]-=_0x53196c[_0x0fbf('0x24')];if(_0x4c099e[_0xbfe37f]<0x0)_0x4c099e[_0xbfe37f]=0x0;});_0x249c31(_0x4c099e);return;});})[_0x0fbf('0x7')](function(_0x151ed0){_0x24f983(_0x151ed0);});});}function checkUserLimits(_0x1e5a5a){return new BPromise(function(_0x28b6ad,_0x1312eb){getLimits()[_0x0fbf('0x1b')](function(_0x265848){var _0x51eb15=_[_0x0fbf('0x25')](_['countBy'](_0x1e5a5a,_0x0fbf('0x1f')),[_0x0fbf('0x20'),_0x0fbf('0x23'),'telephone']);var _0x21f380=(_0x51eb15['admin']||0x0)+(_0x51eb15[_0x0fbf('0x23')]||0x0);var _0x59604c=_0x51eb15[_0x0fbf('0x26')]||0x0;if(_0x21f380>_0x265848[_0x0fbf('0x23')])return _0x1312eb('License\x20limit\x20reached\x20for\x20users');if(_0x59604c>_0x265848[_0x0fbf('0x26')])return _0x1312eb('License\x20limit\x20reached\x20for\x20telephones');return _0x28b6ad();})['catch'](function(_0x5d39dc){_0x1312eb(_0x5d39dc);});});}module[_0x0fbf('0x27')]={'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 98fee4f..393e332 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 _0x1893=['myappanuglar-secret','app-id','secret'];(function(_0x3cd133,_0x222fcb){var _0x2512c8=function(_0x484491){while(--_0x484491){_0x3cd133['push'](_0x3cd133['shift']());}};_0x2512c8(++_0x222fcb);}(_0x1893,0xa2));var _0x3189=function(_0x1ee04b,_0x554b3d){_0x1ee04b=_0x1ee04b-0x0;var _0x412848=_0x1893[_0x1ee04b];return _0x412848;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3189('0x0'),'GOOGLE_ID':_0x3189('0x1'),'GOOGLE_SECRET':_0x3189('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x0abf=['app-id','exports','myappanuglar-secret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';module[_0xf0ab('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xf0ab('0x1'),'GOOGLE_ID':_0xf0ab('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 8941154..50b83c4 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ab7=['../utils/loggers','fileLogger'];(function(_0x15bbda,_0x2cb077){var _0xa4f9b=function(_0x663f17){while(--_0x663f17){_0x15bbda['push'](_0x15bbda['shift']());}};_0xa4f9b(++_0x2cb077);}(_0x4ab7,0x72));var _0x74ab=function(_0x3a3234,_0x39dc49){_0x3a3234=_0x3a3234-0x0;var _0x202add=_0x4ab7[_0x3a3234];return _0x202add;};'use strict';var fileLogger=require(_0x74ab('0x0'))[_0x74ab('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x67be=['../utils/loggers','fileLogger','exports'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x67be,0x1a4));var _0xe67b=function(_0x3da59a,_0x627e23){_0x3da59a=_0x3da59a-0x0;var _0x185da4=_0x67be[_0x3da59a];return _0x185da4;};'use strict';var fileLogger=require(_0xe67b('0x0'))[_0xe67b('0x1')];module[_0xe67b('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 8caca16..1835bf5 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 _0xe5e4=['exports','express','join','../../services/express/index.js','../../services/ami/index.js','../../services/email/index.js','xdr','../../services/xdr/index.js'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xe5e4,0x181));var _0x4e5e=function(_0x116647,_0x976f3){_0x116647=_0x116647-0x0;var _0x6557a0=_0xe5e4[_0x116647];return _0x6557a0;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x4e5e('0x0'),'script':path[_0x4e5e('0x1')](__dirname,_0x4e5e('0x2'))},{'name':'ami','script':path['join'](__dirname,_0x4e5e('0x3'))},{'name':'agi','script':path[_0x4e5e('0x1')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path['join'](__dirname,_0x4e5e('0x4'))},{'name':'routing','script':path[_0x4e5e('0x1')](__dirname,'../../services/routing/index.js')},{'name':_0x4e5e('0x5'),'script':path[_0x4e5e('0x1')](__dirname,_0x4e5e('0x6'))}]};module[_0x4e5e('0x7')]=config; \ No newline at end of file +var _0x6761=['join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','express'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x6761,0x199));var _0x1676=function(_0x5c8cc9,_0x4c320e){_0x5c8cc9=_0x5c8cc9-0x0;var _0x35c68e=_0x6761[_0x5c8cc9];return _0x35c68e;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x1676('0x0'),'script':path[_0x1676('0x1')](__dirname,'../../services/express/index.js')},{'name':_0x1676('0x2'),'script':path[_0x1676('0x1')](__dirname,_0x1676('0x3'))},{'name':_0x1676('0x4'),'script':path[_0x1676('0x1')](__dirname,_0x1676('0x5'))},{'name':'email','script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x1676('0x6'),'script':path[_0x1676('0x1')](__dirname,_0x1676('0x7'))},{'name':_0x1676('0x8'),'script':path[_0x1676('0x1')](__dirname,_0x1676('0x9'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7dceca7..93522ff 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 _0xdd76=['disconnect','restart','list','describe','delete','dump','saved','bluebird','./config','connect','connected','then'];(function(_0x555561,_0x1f8066){var _0x1893ab=function(_0x5d7ce6){while(--_0x5d7ce6){_0x555561['push'](_0x555561['shift']());}};_0x1893ab(++_0x1f8066);}(_0xdd76,0x8b));var _0x6dd7=function(_0x30b10f,_0x2edd80){_0x30b10f=_0x30b10f-0x0;var _0xdba930=_0xdd76[_0x30b10f];return _0xdba930;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6dd7('0x0'));var config=require(_0x6dd7('0x1'));function connect(){return new BPromise(function(_0x6b5e49,_0x4d64e8){return pm2[_0x6dd7('0x2')](function(_0x47d356){if(_0x47d356){return _0x4d64e8(_0x47d356);}return _0x6b5e49(_0x6dd7('0x3'));});});};exports['start']=function(_0x37cbde){return connect()[_0x6dd7('0x4')](function(){return new BPromise(function(_0x19ad8e,_0x4f4911){return pm2['start'](_0x37cbde,function(_0x28ff90,_0x2f4a3f){if(_0x28ff90){return _0x4f4911(_0x28ff90);}pm2['disconnect']();return _0x19ad8e(_0x2f4a3f);});});});};exports['stop']=function(_0x6848ad){return connect()['then'](function(){return new BPromise(function(_0x2086f5,_0x187d8a){return pm2['stop'](_0x6848ad,function(_0x450ade,_0x16fe62){if(_0x450ade){return _0x187d8a(_0x450ade);}pm2[_0x6dd7('0x5')]();return _0x2086f5(_0x16fe62);});});});};exports[_0x6dd7('0x6')]=function(_0x43590a){return connect()[_0x6dd7('0x4')](function(){return new BPromise(function(_0x2211d7,_0x343429){return pm2[_0x6dd7('0x6')](_0x43590a,function(_0x1dee75,_0x77662f){if(_0x1dee75){return _0x343429(_0x1dee75);}pm2[_0x6dd7('0x5')]();return _0x2211d7(_0x77662f);});});});};exports[_0x6dd7('0x7')]=function(){return connect()[_0x6dd7('0x4')](function(){return new BPromise(function(_0x2e636a,_0x40683c){return pm2[_0x6dd7('0x7')](function(_0x5b8e5c,_0x4d9bf0){if(_0x5b8e5c){return _0x40683c(_0x5b8e5c);}pm2[_0x6dd7('0x5')]();return _0x2e636a(_0x4d9bf0);});});});};exports[_0x6dd7('0x8')]=function(_0x4dcc93){return connect()['then'](function(){return new BPromise(function(_0x19b384,_0x4c0750){return pm2[_0x6dd7('0x8')](_0x4dcc93,function(_0x11ff0d,_0xb49fad){if(_0x11ff0d){return _0x4c0750(_0x11ff0d);}pm2[_0x6dd7('0x5')]();return _0x19b384(_0xb49fad);});});});};exports[_0x6dd7('0x9')]=function(_0x29bf2f){return connect()[_0x6dd7('0x4')](function(){return new BPromise(function(_0x41ecd2,_0x23b4bb){return pm2[_0x6dd7('0x9')](_0x29bf2f,function(_0x22d7dd,_0x5657d4){if(_0x22d7dd){return _0x23b4bb(_0x22d7dd);}pm2[_0x6dd7('0x5')]();return _0x41ecd2(_0x5657d4);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x419ee4,_0x5b98e5){return pm2[_0x6dd7('0xa')](function(_0x2e1ea2){if(_0x2e1ea2){return _0x5b98e5(_0x2e1ea2);}return _0x419ee4(_0x6dd7('0xb'));});});});}; \ No newline at end of file +var _0x1081=['describe','delete','dump','saved','pm2','bluebird','./config','connect','start','disconnect','stop','then','restart','list'];(function(_0x3c11e4,_0x5a5122){var _0x29050f=function(_0x4470dc){while(--_0x4470dc){_0x3c11e4['push'](_0x3c11e4['shift']());}};_0x29050f(++_0x5a5122);}(_0x1081,0xd6));var _0x1108=function(_0x27996b,_0x467c17){_0x27996b=_0x27996b-0x0;var _0x1ed7cb=_0x1081[_0x27996b];return _0x1ed7cb;};'use strict';var pm2=require(_0x1108('0x0'));var BPromise=require(_0x1108('0x1'));var config=require(_0x1108('0x2'));function connect(){return new BPromise(function(_0x54ba38,_0x4471ee){return pm2[_0x1108('0x3')](function(_0x51e95c){if(_0x51e95c){return _0x4471ee(_0x51e95c);}return _0x54ba38('connected');});});};exports[_0x1108('0x4')]=function(_0xf45a1e){return connect()['then'](function(){return new BPromise(function(_0x722565,_0x8887d9){return pm2['start'](_0xf45a1e,function(_0x3f7f42,_0x2b47bc){if(_0x3f7f42){return _0x8887d9(_0x3f7f42);}pm2[_0x1108('0x5')]();return _0x722565(_0x2b47bc);});});});};exports[_0x1108('0x6')]=function(_0x5c83a6){return connect()[_0x1108('0x7')](function(){return new BPromise(function(_0x40f12a,_0x358768){return pm2['stop'](_0x5c83a6,function(_0x121a40,_0x2ec93b){if(_0x121a40){return _0x358768(_0x121a40);}pm2['disconnect']();return _0x40f12a(_0x2ec93b);});});});};exports[_0x1108('0x8')]=function(_0x2fcb34){return connect()['then'](function(){return new BPromise(function(_0x55b594,_0x38d012){return pm2[_0x1108('0x8')](_0x2fcb34,function(_0xf651b0,_0x2c2878){if(_0xf651b0){return _0x38d012(_0xf651b0);}pm2[_0x1108('0x5')]();return _0x55b594(_0x2c2878);});});});};exports[_0x1108('0x9')]=function(){return connect()[_0x1108('0x7')](function(){return new BPromise(function(_0x54a4e5,_0x2a9d4e){return pm2[_0x1108('0x9')](function(_0x386002,_0x5233a2){if(_0x386002){return _0x2a9d4e(_0x386002);}pm2[_0x1108('0x5')]();return _0x54a4e5(_0x5233a2);});});});};exports[_0x1108('0xa')]=function(_0x2fe674){return connect()['then'](function(){return new BPromise(function(_0x139cd3,_0x6ddcf4){return pm2[_0x1108('0xa')](_0x2fe674,function(_0x49183a,_0x43db5d){if(_0x49183a){return _0x6ddcf4(_0x49183a);}pm2['disconnect']();return _0x139cd3(_0x43db5d);});});});};exports['delete']=function(_0x30c3f1){return connect()[_0x1108('0x7')](function(){return new BPromise(function(_0x38199f,_0x4e8edb){return pm2[_0x1108('0xb')](_0x30c3f1,function(_0x1916d3,_0x2ae5d9){if(_0x1916d3){return _0x4e8edb(_0x1916d3);}pm2['disconnect']();return _0x38199f(_0x2ae5d9);});});});};exports[_0x1108('0xc')]=function(){return connect()[_0x1108('0x7')](function(){return new BPromise(function(_0x13373e,_0x1574ef){return pm2[_0x1108('0xc')](function(_0x5cf283){if(_0x5cf283){return _0x1574ef(_0x5cf283);}return _0x13373e(_0x1108('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 687800a..22206a8 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 _0x1cc7=['join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../mysqldb','redis','defaults','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','length','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x35116d,_0x30c8c7){var _0x16b2ab=function(_0x34301b){while(--_0x34301b){_0x35116d['push'](_0x35116d['shift']());}};_0x16b2ab(++_0x30c8c7);}(_0x1cc7,0xb9));var _0x71cc=function(_0xa05ef,_0x411ec2){_0xa05ef=_0xa05ef-0x0;var _0x236e74=_0x1cc7[_0xa05ef];return _0x236e74;};'use strict';var _=require(_0x71cc('0x0'));var moment=require('moment');var Redis=require(_0x71cc('0x1'));var util=require(_0x71cc('0x2'));var config=require('../../config/environment');var db=require(_0x71cc('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x71cc('0x4')]=_[_0x71cc('0x5')](config[_0x71cc('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x71cc('0x4')]));function closeInteractions(){var _0x5e385f=0x0;var _0x4d940f=[];return db[_0x71cc('0x6')][_0x71cc('0x7')]({'raw':!![],'attributes':['id',_0x71cc('0x8')],'where':{'id':0x1}})['then'](function(_0x355aa5){_0x5e385f=_0x355aa5[_0x71cc('0x8')];if(_0x5e385f){return db[_0x71cc('0x9')][_0x71cc('0xa')]({'raw':!![],'attributes':['id',_0x71cc('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x71cc('0xc')](_0x355aa5['chatTimeout'],_0x71cc('0xd'))}}});}else{return[];}})[_0x71cc('0xe')](function(_0x4aa657){if(_0x4aa657&&_0x4aa657[_0x71cc('0xf')]){_0x4d940f=_['map'](_0x4aa657||[],'id');logger[_0x71cc('0x10')](_0x71cc('0x11'),_0x4d940f[_0x71cc('0x12')]());return db[_0x71cc('0x9')][_0x71cc('0x13')]({'closeReason':_0x71cc('0x14'),'disposition':_0x71cc('0x15'),'closed':!![],'closedAt':moment()['format'](_0x71cc('0x16'))},{'where':{'id':_0x4d940f}});}})[_0x71cc('0xe')](function(){if(_0x4d940f&&_0x4d940f[_0x71cc('0xf')]){logger[_0x71cc('0x10')](_0x71cc('0x17'),_0x4d940f['join']());for(var _0x428bdb=0x0;_0x428bdb<_0x4d940f[_0x71cc('0xf')];_0x428bdb++){io[_0x71cc('0x18')]('chatInteraction:update',{'id':_0x4d940f[_0x428bdb],'closed':!![]});}}})['catch'](function(_0xa5c188){logger[_0x71cc('0x19')](_0x71cc('0x1a'),_0xa5c188?util[_0x71cc('0x1b')](_0xa5c188,{'showHidden':![],'depth':null}):'');});}exports[_0x71cc('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x23da=['minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','inspect','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract'];(function(_0x517f0e,_0x557448){var _0x513b60=function(_0x8f0a20){while(--_0x8f0a20){_0x517f0e['push'](_0x517f0e['shift']());}};_0x513b60(++_0x557448);}(_0x23da,0x195));var _0xa23d=function(_0x4712f0,_0x322c2a){_0x4712f0=_0x4712f0-0x0;var _0x13ea95=_0x23da[_0x4712f0];return _0x13ea95;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0xa23d('0x0'));var util=require('util');var config=require(_0xa23d('0x1'));var db=require(_0xa23d('0x2'))['db'];var logger=require(_0xa23d('0x3'))('schedule');config[_0xa23d('0x4')]=_[_0xa23d('0x5')](config[_0xa23d('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xa23d('0x6'))(new Redis(config[_0xa23d('0x4')]));function closeInteractions(){var _0x3dda15=0x0;var _0x554bb2=[];return db[_0xa23d('0x7')][_0xa23d('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xa23d('0x9')](function(_0x578468){_0x3dda15=_0x578468[_0xa23d('0xa')];if(_0x3dda15){return db[_0xa23d('0xb')][_0xa23d('0xc')]({'raw':!![],'attributes':['id',_0xa23d('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa23d('0xe')](_0x578468[_0xa23d('0xa')],_0xa23d('0xf'))}}});}else{return[];}})[_0xa23d('0x9')](function(_0x19d748){if(_0x19d748&&_0x19d748[_0xa23d('0x10')]){_0x554bb2=_[_0xa23d('0x11')](_0x19d748||[],'id');logger['info'](_0xa23d('0x12'),_0x554bb2[_0xa23d('0x13')]());return db[_0xa23d('0xb')]['update']({'closeReason':_0xa23d('0x14'),'disposition':_0xa23d('0x15'),'closed':!![],'closedAt':moment()[_0xa23d('0x16')](_0xa23d('0x17'))},{'where':{'id':_0x554bb2}});}})[_0xa23d('0x9')](function(){if(_0x554bb2&&_0x554bb2[_0xa23d('0x10')]){logger[_0xa23d('0x18')](_0xa23d('0x19'),_0x554bb2[_0xa23d('0x13')]());for(var _0x35b49f=0x0;_0x35b49f<_0x554bb2[_0xa23d('0x10')];_0x35b49f++){io[_0xa23d('0x1a')](_0xa23d('0x1b'),{'id':_0x554bb2[_0x35b49f],'closed':!![]});}}})['catch'](function(_0x4d5c6a){logger[_0xa23d('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x4d5c6a?util[_0xa23d('0x1d')](_0x4d5c6a,{'showHidden':![],'depth':null}):'');});}exports['start']=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 f5e3d8e..c0ae036 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 _0x55d3=['exports'];(function(_0x271bf7,_0x429bec){var _0x1b0dbb=function(_0x5d4429){while(--_0x5d4429){_0x271bf7['push'](_0x271bf7['shift']());}};_0x1b0dbb(++_0x429bec);}(_0x55d3,0x1cb));var _0x355d=function(_0x27b367,_0x1ca7e8){_0x27b367=_0x27b367-0x0;var _0x38864d=_0x55d3[_0x27b367];return _0x38864d;};'use strict';function start(){var _0x27f3f6=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x27f3f6['startAllRefreshIntervals']();}module[_0x355d('0x0')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x4051=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x4c65e3,_0x3c91ea){var _0x572e3d=function(_0x1914c6){while(--_0x1914c6){_0x4c65e3['push'](_0x4c65e3['shift']());}};_0x572e3d(++_0x3c91ea);}(_0x4051,0x189));var _0x1405=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x4051[_0x5f1391];return _0x50ebe3;};'use strict';function start(){var _0x9fca9c=require(_0x1405('0x0'));return _0x9fca9c[_0x1405('0x1')]();}module[_0x1405('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index cdb0bad..7b166a4 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 _0x450a=['catch','data','isNil','subtract','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','error','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','length','exists','stop','deleteJob','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','path','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','email','Smtp','user','bcc','name','subtractNumber','subtractUnit','../../files/reports','basename','extname','savename','join','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error\x20mail'];(function(_0x40be1a,_0x13b843){var _0x4e6f36=function(_0x85771f){while(--_0x85771f){_0x40be1a['push'](_0x40be1a['shift']());}};_0x4e6f36(++_0x13b843);}(_0x450a,0x11c));var _0xa450=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x450a[_0x4b369d];return _0x571a98;};'use strict';var fs=require('fs');var util=require(_0xa450('0x0'));var path=require(_0xa450('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0xa450('0x2'));var jayson=require(_0xa450('0x3'));var BPromise=require('bluebird');var logger=require(_0xa450('0x4'))(_0xa450('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xa450('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xa450('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x8a5e12,_0x3ba183){return function(){logger[_0xa450('0x8')](_0xa450('0x9'),_0x8a5e12['email']);var _0x4d135f=!![];var _0x4d7168=_0x8a5e12[_0xa450('0xa')][_0xa450('0xb')]();var _0x46b27f={'account':_0x4d7168,'message':{'from':util[_0xa450('0xc')]('\x22%s\x22\x20<%s>',_0x8a5e12[_0xa450('0xa')]['name'],_0x8a5e12[_0xa450('0xa')][_0xa450('0xd')]||_0x8a5e12[_0xa450('0xa')][_0xa450('0xe')][_0xa450('0xf')]),'to':_0x8a5e12['email'],'cc':_0x8a5e12['cc'],'bcc':_0x8a5e12[_0xa450('0x10')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x3ba183[_0xa450('0x11')],_0x8a5e12[_0xa450('0x12')],_0x8a5e12[_0xa450('0x13')])}};var _0x396760=path['join'](__dirname,_0xa450('0x14'));var _0x5289ba=_0x3ba183['savename'];var _0x24b94f=util['format']('%s.%s',path[_0xa450('0x15')](_0x3ba183['savename'],path[_0xa450('0x16')](_0x3ba183[_0xa450('0x17')])),'zip');var _0x56e335=path[_0xa450('0x18')](_0x396760,_0x5289ba);var _0x20ac2a=path[_0xa450('0x18')](_0x396760,_0x24b94f);if(fs['existsSync'](_0x56e335)){_0x3ba183[_0xa450('0x19')]=_0xa450('0x1a');_0x46b27f[_0xa450('0x1b')][_0xa450('0x1c')]=[{'filename':_0x5289ba,'path':_0x56e335}];_0x46b27f[_0xa450('0x1b')][_0xa450('0x1d')]=util[_0xa450('0xc')](_0xa450('0x1e'),JSON[_0xa450('0x1f')](_0x3ba183,null,0x2));}else if(fs[_0xa450('0x20')](_0x20ac2a)){_0x3ba183[_0xa450('0x19')]=_0xa450('0x1a');_0x46b27f[_0xa450('0x1b')]['attachments']=[{'filename':_0x24b94f,'path':_0x20ac2a}];}else{_0x46b27f[_0xa450('0x1b')][_0xa450('0x1d')]=_0xa450('0x21');if(!_0x8a5e12[_0xa450('0x22')]){_0x4d135f=![];logger[_0xa450('0x8')](_0xa450('0x23'));}}if(_0x4d135f){return client[_0xa450('0x24')](_0xa450('0x25'),_0x46b27f)[_0xa450('0x26')](function(_0xc58205){if(_0xc58205['error']){return logger['error'](_0xa450('0x27'),JSON[_0xa450('0x1f')](_0xc58205));}return logger[_0xa450('0x8')]('email\x20sent');})[_0xa450('0x28')](function(_0x5c9143){return logger['error'](_0xa450('0x27'),JSON[_0xa450('0x1f')](_0x5c9143));});}};}function handleError(){return function(_0x28ed16){return logger['error'](JSON[_0xa450('0x1f')](_0x28ed16));};}function handleResult(_0x154e87){return function(_0xf888c6){logger['info'](_0xa450('0x29'),JSON[_0xa450('0x1f')](_0xf888c6));if(_0x154e87['MailAccount']&&_0x154e87[_0xa450('0xa')][_0xa450('0xe')]&&!_['isNil'](_0x154e87[_0xa450('0xd')])){setTimeout(handleSendEmail(_0x154e87,_0xf888c6),0x3c*0x3e8);}};}function handleJob(_0x33f969){return function(){try{if(_['isNil'](_0x33f969[_0xa450('0x12')])){return logger[_0xa450('0x8')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xa450('0x2a')](_0x33f969['subtractUnit'])){return logger[_0xa450('0x8')]('subtractUnit\x20null\x20or\x20undefined');}var _0x45661b={'startDate':moment()[_0xa450('0x2b')](_0x33f969[_0xa450('0x12')],_0x33f969[_0xa450('0x13')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xa450('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xa450('0x2c'),'output':_0x33f969[_0xa450('0x2d')],'name':_0x33f969[_0xa450('0x11')]};if(!_['isNil'](_0x33f969[_0xa450('0x2e')])){logger['info'](_0xa450('0x2f'),_0x33f969['DefaultReportId']);return analyticDefaultReportController[_0xa450('0x30')]({'id':_0x33f969['DefaultReportId']},_0x45661b)[_0xa450('0x26')](handleResult(_0x33f969))[_0xa450('0x28')](handleError());}if(!_[_0xa450('0x2a')](_0x33f969[_0xa450('0x31')])){logger[_0xa450('0x8')](_0xa450('0x32'),_0x33f969[_0xa450('0x31')]);return analyticCustomReportController[_0xa450('0x30')]({'id':_0x33f969[_0xa450('0x31')]},_0x45661b)[_0xa450('0x26')](handleResult(_0x33f969))[_0xa450('0x28')](handleError());}}catch(_0x216275){logger[_0xa450('0x33')](JSON[_0xa450('0x1f')](_0x216275));}return logger['info'](_0xa450('0x34'));};}function getJobs(_0xf89fb8){var _0x30b014={};if(_0xf89fb8){_0x30b014['id']=_0xf89fb8;}return db[_0xa450('0x35')]['findAll']({'where':_0x30b014,'include':[{'model':db[_0xa450('0xa')],'attributes':['id',_0xa450('0x11'),_0xa450('0xd')],'include':[{'model':db[_0xa450('0x36')],'as':'Smtp','include':[{'model':db[_0xa450('0x37')],'as':_0xa450('0x37')}]}]}]})[_0xa450('0x26')](function(_0x1b21d3){var _0x1129ec=_[_0xa450('0x38')](manager[_0xa450('0x39')]);var _0xdb08e5=_[_0xa450('0x3a')](_0x1b21d3,function(_0x3d8d06){return _0x3d8d06['id'][_0xa450('0x3b')]();});var _0x1613ca=_[_0xa450('0x3c')](_0x1b21d3,function(_0x1f122f){return _0x1f122f['id'][_0xa450('0x3b')]();});var _0x3b46de=_0xf89fb8?_0xdb08e5:_['difference'](_0xdb08e5,_0x1129ec);var _0x1cf06f=_['intersection'](_0xdb08e5,_0x1129ec);var _0x2d8d43=_['difference'](_0x1129ec,_0xdb08e5);var _0x2de43c;var _0x195e0a;for(_0x2de43c=0x0;_0x2de43c<_0x2d8d43[_0xa450('0x3d')]&&!_0xf89fb8;_0x2de43c+=0x1){_0x195e0a=_0x2d8d43[_0x2de43c]['toString']();if(manager[_0xa450('0x3e')](_0x195e0a)){manager[_0xa450('0x3f')](_0x195e0a);manager[_0xa450('0x40')](_0x195e0a);logger[_0xa450('0x8')](_0xa450('0x41'),_0x195e0a);}}logger['info']('toRun',JSON[_0xa450('0x1f')](_0x3b46de));for(_0x2de43c=0x0;_0x2de43c<_0x3b46de[_0xa450('0x3d')];_0x2de43c+=0x1){_0x195e0a=_0x3b46de[_0x2de43c][_0xa450('0x3b')]();logger[_0xa450('0x8')]('index',_0x195e0a);if(_0xf89fb8){logger['info'](_0xa450('0x42'),_0xf89fb8);logger[_0xa450('0x8')](JSON[_0xa450('0x1f')](_0x1613ca[_0x195e0a]));BPromise[_0xa450('0x43')]()[_0xa450('0x26')](handleJob(_0x1613ca[_0x195e0a]));logger['info'](_0xa450('0x44'),_0x1613ca[_0x195e0a]['name'],_0x1613ca[_0x195e0a][_0xa450('0x45')]);}else if(_0x1613ca[_0x195e0a][_0xa450('0x45')]&&_0x1613ca[_0x195e0a][_0xa450('0x46')]&&moment()[_0xa450('0x47')](_0x1613ca[_0x195e0a][_0xa450('0x48')],_0x1613ca[_0x195e0a][_0xa450('0x49')])){manager[_0xa450('0x4a')](_0x195e0a,_0x1613ca[_0x195e0a][_0xa450('0x45')],handleJob(_0x1613ca[_0x195e0a]));manager[_0xa450('0x4b')](_0x195e0a);logger[_0xa450('0x8')](_0xa450('0x4c'),_0x1613ca[_0x195e0a][_0xa450('0x11')],_0x1613ca[_0x195e0a][_0xa450('0x45')]);}else if(manager[_0xa450('0x3e')](_0x195e0a)){manager[_0xa450('0x3f')](_0x195e0a);manager[_0xa450('0x40')](_0x195e0a);logger[_0xa450('0x8')](_0xa450('0x4d'),_0x1613ca[_0x195e0a][_0xa450('0x11')],_0x1613ca[_0x195e0a]['cron']);}}for(_0x2de43c=0x0,_0x195e0a;_0x2de43c<_0x1cf06f[_0xa450('0x3d')]&&!_0xf89fb8;_0x2de43c+=0x1){_0x195e0a=_0x1cf06f[_0x2de43c][_0xa450('0x3b')]();if(manager[_0xa450('0x3e')](_0x195e0a)){if(_0x1613ca[_0x195e0a][_0xa450('0x45')]&&_0x1613ca[_0x195e0a][_0xa450('0x46')]&&moment()[_0xa450('0x47')](_0x1613ca[_0x195e0a][_0xa450('0x48')],_0x1613ca[_0x195e0a][_0xa450('0x49')])){manager[_0xa450('0x4e')](_0x195e0a,_0x1613ca[_0x195e0a]['cron'],handleJob(_0x1613ca[_0x195e0a]));logger['info'](_0xa450('0x4f'),_0x1613ca[_0x195e0a][_0xa450('0x11')],_0x1613ca[_0x195e0a][_0xa450('0x45')]);}else{manager[_0xa450('0x3f')](_0x195e0a);manager[_0xa450('0x40')](_0x195e0a);logger['info']('stop\x20cron',_0x1613ca[_0x195e0a][_0xa450('0x11')],_0x1613ca[_0x195e0a][_0xa450('0x45')]);}}}})[_0xa450('0x28')](function(_0x56086b){logger['error'](JSON[_0xa450('0x1f')](_0x56086b));});}exports[_0xa450('0x50')]=function(_0xbda6af){return getJobs(_0xbda6af);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xea08=['message','text','Sent','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','error','error\x20mail','catch','stringify','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','then','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','keys','jobs','map','toString','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','add\x20cron','endAt','update','stop\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','../../files/reports','%s.%s','basename','extname','zip','join','status'];(function(_0x2c89fb,_0x41f121){var _0x594957=function(_0x416c5c){while(--_0x416c5c){_0x2c89fb['push'](_0x2c89fb['shift']());}};_0x594957(++_0x41f121);}(_0xea08,0xe1));var _0x8ea0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xea08[_0x122ef9];return _0x42fba0;};'use strict';var fs=require('fs');var util=require(_0x8ea0('0x0'));var path=require(_0x8ea0('0x1'));var _=require(_0x8ea0('0x2'));var moment=require(_0x8ea0('0x3'));var CronJobManager=require(_0x8ea0('0x4'));var jayson=require(_0x8ea0('0x5'));var BPromise=require(_0x8ea0('0x6'));var logger=require(_0x8ea0('0x7'))(_0x8ea0('0x8'));var db=require(_0x8ea0('0x9'))['db'];var analyticCustomReportController=require(_0x8ea0('0xa'));var analyticDefaultReportController=require(_0x8ea0('0xb'));var client=jayson[_0x8ea0('0xc')][_0x8ea0('0xd')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x231e8e,_0x4f9fb0){return function(){logger[_0x8ea0('0xe')](_0x8ea0('0xf'),_0x231e8e[_0x8ea0('0x10')]);var _0x42b481=!![];var _0x38b56a=_0x231e8e[_0x8ea0('0x11')]['getSmtpOptions']();var _0x5a1a4a={'account':_0x38b56a,'message':{'from':util[_0x8ea0('0x12')](_0x8ea0('0x13'),_0x231e8e['MailAccount']['name'],_0x231e8e[_0x8ea0('0x11')][_0x8ea0('0x10')]||_0x231e8e['MailAccount'][_0x8ea0('0x14')][_0x8ea0('0x15')]),'to':_0x231e8e[_0x8ea0('0x10')],'cc':_0x231e8e['cc'],'bcc':_0x231e8e[_0x8ea0('0x16')],'subject':util['format'](_0x8ea0('0x17'),_0x4f9fb0[_0x8ea0('0x18')],_0x231e8e['subtractNumber'],_0x231e8e[_0x8ea0('0x19')])}};var _0x345bb5=path['join'](__dirname,_0x8ea0('0x1a'));var _0x53e874=_0x4f9fb0['savename'];var _0x347581=util['format'](_0x8ea0('0x1b'),path[_0x8ea0('0x1c')](_0x4f9fb0['savename'],path[_0x8ea0('0x1d')](_0x4f9fb0['savename'])),_0x8ea0('0x1e'));var _0x53d4ad=path[_0x8ea0('0x1f')](_0x345bb5,_0x53e874);var _0x387fcc=path[_0x8ea0('0x1f')](_0x345bb5,_0x347581);if(fs['existsSync'](_0x53d4ad)){_0x4f9fb0[_0x8ea0('0x20')]='Sent';_0x5a1a4a[_0x8ea0('0x21')]['attachments']=[{'filename':_0x53e874,'path':_0x53d4ad}];_0x5a1a4a[_0x8ea0('0x21')][_0x8ea0('0x22')]=util[_0x8ea0('0x12')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x4f9fb0,null,0x2));}else if(fs['existsSync'](_0x387fcc)){_0x4f9fb0['status']=_0x8ea0('0x23');_0x5a1a4a[_0x8ea0('0x21')][_0x8ea0('0x24')]=[{'filename':_0x347581,'path':_0x387fcc}];}else{_0x5a1a4a['message'][_0x8ea0('0x22')]=_0x8ea0('0x25');if(!_0x231e8e[_0x8ea0('0x26')]){_0x42b481=![];logger[_0x8ea0('0xe')](_0x8ea0('0x27'));}}if(_0x42b481){return client[_0x8ea0('0x28')]('SendMail',_0x5a1a4a)['then'](function(_0x38bb59){if(_0x38bb59[_0x8ea0('0x29')]){return logger[_0x8ea0('0x29')](_0x8ea0('0x2a'),JSON['stringify'](_0x38bb59));}return logger[_0x8ea0('0xe')]('email\x20sent');})[_0x8ea0('0x2b')](function(_0x26515d){return logger[_0x8ea0('0x29')](_0x8ea0('0x2a'),JSON['stringify'](_0x26515d));});}};}function handleError(){return function(_0x59886e){return logger['error'](JSON[_0x8ea0('0x2c')](_0x59886e));};}function handleResult(_0x1c92dd){return function(_0x211fd6){logger['info']('data',JSON[_0x8ea0('0x2c')](_0x211fd6));if(_0x1c92dd['MailAccount']&&_0x1c92dd['MailAccount'][_0x8ea0('0x14')]&&!_[_0x8ea0('0x2d')](_0x1c92dd[_0x8ea0('0x10')])){setTimeout(handleSendEmail(_0x1c92dd,_0x211fd6),0x3c*0x3e8);}};}function handleJob(_0x1aaf8f){return function(){try{if(_['isNil'](_0x1aaf8f[_0x8ea0('0x2e')])){return logger[_0x8ea0('0xe')](_0x8ea0('0x2f'));}if(_[_0x8ea0('0x2d')](_0x1aaf8f[_0x8ea0('0x19')])){return logger['info'](_0x8ea0('0x30'));}var _0xe17a16={'startDate':moment()[_0x8ea0('0x31')](_0x1aaf8f[_0x8ea0('0x2e')],_0x1aaf8f[_0x8ea0('0x19')])[_0x8ea0('0x12')](_0x8ea0('0x32')),'endDate':moment()['format'](_0x8ea0('0x32')),'type':_0x8ea0('0x33'),'output':_0x1aaf8f[_0x8ea0('0x34')],'name':_0x1aaf8f['name']};if(!_[_0x8ea0('0x2d')](_0x1aaf8f['DefaultReportId'])){logger[_0x8ea0('0xe')]('exec\x20defaul\x20report\x20id:%s',_0x1aaf8f['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x1aaf8f[_0x8ea0('0x35')]},_0xe17a16)[_0x8ea0('0x36')](handleResult(_0x1aaf8f))['catch'](handleError());}if(!_[_0x8ea0('0x2d')](_0x1aaf8f[_0x8ea0('0x37')])){logger[_0x8ea0('0xe')](_0x8ea0('0x38'),_0x1aaf8f[_0x8ea0('0x37')]);return analyticCustomReportController[_0x8ea0('0x39')]({'id':_0x1aaf8f[_0x8ea0('0x37')]},_0xe17a16)[_0x8ea0('0x36')](handleResult(_0x1aaf8f))[_0x8ea0('0x2b')](handleError());}}catch(_0x45bc68){logger['error'](JSON['stringify'](_0x45bc68));}return logger[_0x8ea0('0xe')](_0x8ea0('0x3a'));};}function getJobs(_0x4ce1e7){var _0x4b427c={};if(_0x4ce1e7){_0x4b427c['id']=_0x4ce1e7;}return db[_0x8ea0('0x3b')]['findAll']({'where':_0x4b427c,'include':[{'model':db[_0x8ea0('0x11')],'attributes':['id',_0x8ea0('0x18'),_0x8ea0('0x10')],'include':[{'model':db['MailServerOut'],'as':_0x8ea0('0x14'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x8ea0('0x36')](function(_0x3ef5ca){var _0x4a190c=_[_0x8ea0('0x3c')](manager[_0x8ea0('0x3d')]);var _0x182bbb=_[_0x8ea0('0x3e')](_0x3ef5ca,function(_0x468223){return _0x468223['id'][_0x8ea0('0x3f')]();});var _0x5117c9=_['keyBy'](_0x3ef5ca,function(_0x413cb8){return _0x413cb8['id'][_0x8ea0('0x3f')]();});var _0x2156c9=_0x4ce1e7?_0x182bbb:_[_0x8ea0('0x40')](_0x182bbb,_0x4a190c);var _0x4831d6=_['intersection'](_0x182bbb,_0x4a190c);var _0x23152b=_['difference'](_0x4a190c,_0x182bbb);var _0x3d1764;var _0x2a7b1c;for(_0x3d1764=0x0;_0x3d1764<_0x23152b['length']&&!_0x4ce1e7;_0x3d1764+=0x1){_0x2a7b1c=_0x23152b[_0x3d1764]['toString']();if(manager[_0x8ea0('0x41')](_0x2a7b1c)){manager[_0x8ea0('0x42')](_0x2a7b1c);manager[_0x8ea0('0x43')](_0x2a7b1c);logger[_0x8ea0('0xe')](_0x8ea0('0x44'),_0x2a7b1c);}}logger[_0x8ea0('0xe')](_0x8ea0('0x45'),JSON[_0x8ea0('0x2c')](_0x2156c9));for(_0x3d1764=0x0;_0x3d1764<_0x2156c9[_0x8ea0('0x46')];_0x3d1764+=0x1){_0x2a7b1c=_0x2156c9[_0x3d1764]['toString']();logger[_0x8ea0('0xe')](_0x8ea0('0x47'),_0x2a7b1c);if(_0x4ce1e7){logger[_0x8ea0('0xe')](_0x8ea0('0x48'),_0x4ce1e7);logger[_0x8ea0('0xe')](JSON[_0x8ea0('0x2c')](_0x5117c9[_0x2a7b1c]));BPromise[_0x8ea0('0x49')]()[_0x8ea0('0x36')](handleJob(_0x5117c9[_0x2a7b1c]));logger[_0x8ea0('0xe')](_0x8ea0('0x4a'),_0x5117c9[_0x2a7b1c][_0x8ea0('0x18')],_0x5117c9[_0x2a7b1c]['cron']);}else if(_0x5117c9[_0x2a7b1c][_0x8ea0('0x4b')]&&_0x5117c9[_0x2a7b1c][_0x8ea0('0x4c')]&&moment()[_0x8ea0('0x4d')](_0x5117c9[_0x2a7b1c][_0x8ea0('0x4e')],_0x5117c9[_0x2a7b1c]['endAt'])){manager[_0x8ea0('0x4f')](_0x2a7b1c,_0x5117c9[_0x2a7b1c]['cron'],handleJob(_0x5117c9[_0x2a7b1c]));manager['start'](_0x2a7b1c);logger[_0x8ea0('0xe')](_0x8ea0('0x50'),_0x5117c9[_0x2a7b1c][_0x8ea0('0x18')],_0x5117c9[_0x2a7b1c]['cron']);}else if(manager[_0x8ea0('0x41')](_0x2a7b1c)){manager['stop'](_0x2a7b1c);manager['deleteJob'](_0x2a7b1c);logger[_0x8ea0('0xe')]('stop\x20cron',_0x5117c9[_0x2a7b1c][_0x8ea0('0x18')],_0x5117c9[_0x2a7b1c]['cron']);}}for(_0x3d1764=0x0,_0x2a7b1c;_0x3d1764<_0x4831d6[_0x8ea0('0x46')]&&!_0x4ce1e7;_0x3d1764+=0x1){_0x2a7b1c=_0x4831d6[_0x3d1764][_0x8ea0('0x3f')]();if(manager[_0x8ea0('0x41')](_0x2a7b1c)){if(_0x5117c9[_0x2a7b1c][_0x8ea0('0x4b')]&&_0x5117c9[_0x2a7b1c][_0x8ea0('0x4c')]&&moment()[_0x8ea0('0x4d')](_0x5117c9[_0x2a7b1c][_0x8ea0('0x4e')],_0x5117c9[_0x2a7b1c][_0x8ea0('0x51')])){manager[_0x8ea0('0x52')](_0x2a7b1c,_0x5117c9[_0x2a7b1c][_0x8ea0('0x4b')],handleJob(_0x5117c9[_0x2a7b1c]));logger['info']('update\x20cron',_0x5117c9[_0x2a7b1c][_0x8ea0('0x18')],_0x5117c9[_0x2a7b1c]['cron']);}else{manager['stop'](_0x2a7b1c);manager['deleteJob'](_0x2a7b1c);logger[_0x8ea0('0xe')](_0x8ea0('0x53'),_0x5117c9[_0x2a7b1c][_0x8ea0('0x18')],_0x5117c9[_0x2a7b1c]['cron']);}}}})[_0x8ea0('0x2b')](function(_0xf8b24e){logger[_0x8ea0('0x29')](JSON[_0x8ea0('0x2c')](_0xf8b24e));});}exports[_0x8ea0('0x54')]=function(_0x2f5607){return getJobs(_0x2f5607);};exports[_0x8ea0('0x55')]=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 144d1b8..6a7366d 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 _0x75e3=['Transcript','transcripts','length','results','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20available','data1','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20configured','Sentiment','Positive','Neutral','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','push','all','catch','start','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED'];(function(_0x4295fd,_0x1f2573){var _0x96f34e=function(_0x32bf59){while(--_0x32bf59){_0x4295fd['push'](_0x4295fd['shift']());}};_0x96f34e(++_0x1f2573);}(_0x75e3,0x104));var _0x375e=function(_0x46e889,_0x2810f7){_0x46e889=_0x46e889-0x0;var _0x31f9b4=_0x75e3[_0x46e889];return _0x31f9b4;};var _=require('lodash');var AWS=require(_0x375e('0x0'));var rp=require(_0x375e('0x1'));var util=require('util');var BPromise=require(_0x375e('0x2'));var db=require(_0x375e('0x3'))['db'];var logger=require(_0x375e('0x4'))('transcribe');function getTranscriptionJob(_0x5e722f,_0x501134,_0x46ebd1,_0x5ad8ee){return new Promise(function(_0x17e32c,_0x52f876){var _0x48f62f=new AWS[(_0x375e('0x5'))]({'accessKeyId':_0x501134,'secretAccessKey':_0x5e722f,'region':_0x46ebd1});_0x48f62f[_0x375e('0x6')]({'TranscriptionJobName':_0x5ad8ee},function(_0x13bcc9,_0x5ba61d){if(_0x13bcc9){return _0x52f876(_0x13bcc9);}else{return _0x17e32c(_0x5ba61d);}});});}function sentiment(_0x3aaac7,_0x35e81a,_0x3c5301,_0x3c12f7,_0x2a1823){return new Promise(function(_0x4e9d7,_0x1cd762){var _0x252f55=new AWS['Comprehend']({'accessKeyId':_0x35e81a,'secretAccessKey':_0x3aaac7,'region':_0x3c5301});_0x252f55[_0x375e('0x7')]({'Text':_0x3c12f7,'LanguageCode':_0x2a1823[_0x375e('0x8')](0x0,0x2)},function(_0x46b268,_0x1bd351){if(_0x46b268){return _0x1cd762(_0x46b268);}else{return _0x4e9d7(_0x1bd351);}});});}function checkTranscribeJob(_0xd80649,_0x190abf,_0x4c2c39){var _0x2163ec;return new BPromise(function(_0x3d4daf,_0x23b4fe){logger[_0x375e('0x9')](util[_0x375e('0xa')](_0x375e('0xb'),_0xd80649['id'],_0xd80649[_0x375e('0xc')]));return getTranscriptionJob(_0x4c2c39['data1'],_0x4c2c39[_0x375e('0xd')],_0x190abf[_0x375e('0xe')],_0xd80649[_0x375e('0xc')])['then'](function(_0x2a9ddf){logger['info'](util[_0x375e('0xa')](_0x375e('0xf'),_0xd80649['id'],_0xd80649[_0x375e('0xc')],_0x2a9ddf[_0x375e('0x10')][_0x375e('0x11')]));if(!_0xd80649[_0x375e('0x12')]){switch(_0x2a9ddf[_0x375e('0x10')][_0x375e('0x11')]){case _0x375e('0x13'):var _0x524b7a={'transcribeStatus':_0x2a9ddf['TranscriptionJob'][_0x375e('0x11')],'fileUri':_0x2a9ddf['TranscriptionJob']['Transcript']['TranscriptFileUri']};logger[_0x375e('0x9')](util[_0x375e('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0xd80649['id']));return rp({'uri':_0x2a9ddf[_0x375e('0x10')][_0x375e('0x14')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x279042){logger['info'](util[_0x375e('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xd80649['id']));if(_0x279042&&_0x279042['results']&&_0x279042['results'][_0x375e('0x15')]&&_0x279042['results'][_0x375e('0x15')][_0x375e('0x16')]){_0x524b7a[_0x375e('0x12')]='';for(var _0x2ce47a=0x0;_0x2ce47a<_0x279042[_0x375e('0x17')][_0x375e('0x15')]['length'];_0x2ce47a++){_0x524b7a[_0x375e('0x12')]+=_0x279042[_0x375e('0x17')][_0x375e('0x15')][_0x2ce47a]['transcript']+'';}}return _0xd80649[_0x375e('0x18')](_0x524b7a);})[_0x375e('0x19')](function(){logger[_0x375e('0x9')](util[_0x375e('0xa')](_0x375e('0x1a'),_0xd80649['id']));if(!_0xd80649[_0x375e('0x1b')]){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x1e'));}if(!_0x190abf[_0x375e('0x1f')]||!_0x190abf[_0x375e('0x20')]||!_0x190abf[_0x375e('0x21')]||!_0x190abf[_0x375e('0x22')]||!_0x190abf[_0x375e('0x23')]){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x24'));}if(!_0x524b7a[_0x375e('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x190abf[_0x375e('0x20')]===_0x4c2c39['id']){return _0x4c2c39;}else{return db['CloudProvider'][_0x375e('0x25')]({'where':{'id':_settings[_0x375e('0x20')]}});}})[_0x375e('0x19')](function(_0x1376cb){if(!_0x1376cb){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x26'));}if(!_0x1376cb[_0x375e('0x27')]||!_0x1376cb['data2']){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x2163ec=_0x1376cb;logger[_0x375e('0x9')](util['format'](_0x375e('0x28'),_0xd80649['id']));return sentiment(_0x2163ec[_0x375e('0x27')],_0x2163ec[_0x375e('0xd')],_0x190abf['sentimentRegion'],_0x524b7a['fileText'],_0x190abf['language']);})[_0x375e('0x19')](function(_0x529a58){logger[_0x375e('0x9')](util['format'](_0x375e('0x29'),_0xd80649['id']));return _0xd80649[_0x375e('0x18')]({'sentiment':_0x529a58['Sentiment'],'sPositive':_0x529a58['SentimentScore']['Positive'],'sNegative':_0x529a58[_0x375e('0x2a')][_0x375e('0x2b')],'sMixed':_0x529a58[_0x375e('0x2a')][_0x375e('0x2c')],'sNeutral':_0x529a58[_0x375e('0x2a')]['Neutral']});})[_0x375e('0x19')](function(){logger[_0x375e('0x9')](util[_0x375e('0xa')](_0x375e('0x1a'),_0xd80649['id']));_0x3d4daf();});case'FAILED':return _0xd80649['update']({'transcribeStatus':_0x375e('0x2d'),'failureReason':_0x2a9ddf['TranscriptionJob'][_0x375e('0x2e')]})[_0x375e('0x19')](function(){logger['info'](util[_0x375e('0xa')](_0x375e('0x1a'),_0xd80649['id']));_0x3d4daf();});default:logger[_0x375e('0x9')](util[_0x375e('0xa')](_0x375e('0x2f'),_0xd80649['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0xd80649['tempSentiment']){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x1e'));}if(!_0x190abf['sentiment']||!_0x190abf[_0x375e('0x20')]||!_0x190abf[_0x375e('0x21')]||!_0x190abf[_0x375e('0x22')]||!_0x190abf['bucket']){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x24'));}if(!_0xd80649[_0x375e('0x12')]){throw new Error(_0x375e('0x30'));}if(_0x190abf[_0x375e('0x20')]===_0x4c2c39['id']){return _0x4c2c39;}else{return db[_0x375e('0x31')][_0x375e('0x25')]({'where':{'id':_settings[_0x375e('0x20')]}});}})['then'](function(_0x264b9d){if(!_0x264b9d){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x26'));}if(!_0x264b9d[_0x375e('0x27')]||!_0x264b9d[_0x375e('0xd')]){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x32'));}_0x2163ec=_0x264b9d;logger[_0x375e('0x9')](util[_0x375e('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xd80649['id']));return sentiment(_0x2163ec[_0x375e('0x27')],_0x2163ec[_0x375e('0xd')],_0x190abf['sentimentRegion'],_0xd80649[_0x375e('0x12')],_0x190abf['language']);})['then'](function(_0x26f1cb){logger['info'](util[_0x375e('0xa')](_0x375e('0x29'),_0xd80649['id']));return _0xd80649[_0x375e('0x18')]({'sentiment':_0x26f1cb[_0x375e('0x33')],'sPositive':_0x26f1cb[_0x375e('0x2a')][_0x375e('0x34')],'sNegative':_0x26f1cb[_0x375e('0x2a')][_0x375e('0x2b')],'sMixed':_0x26f1cb['SentimentScore'][_0x375e('0x2c')],'sNeutral':_0x26f1cb['SentimentScore'][_0x375e('0x35')],'transcribeStatus':_0x375e('0x13')});})[_0x375e('0x19')](function(){logger[_0x375e('0x9')](util['format'](_0x375e('0x1a'),_0xd80649['id']));_0x3d4daf();});}})['catch'](function(_0x55b9cb){if(_0x55b9cb){if(!_0x55b9cb[_0x375e('0x36')]||_0x55b9cb[_0x375e('0x36')]!==_0x375e('0x37')){logger[_0x375e('0x38')](util[_0x375e('0xa')](_0x375e('0x39'),_0xd80649['id']),util[_0x375e('0x3a')](_0x55b9cb,{'showHidden':![],'depth':null}));}}_0x3d4daf();});});}function checkTranscribe(){var _0x1029be;var _0x56f2b1;var _0x3d74f1;return db[_0x375e('0x3b')]['findAll']({'where':{'transcribeStatus':_0x375e('0x3c')}})['then'](function(_0x4c5c59){if(!_0x4c5c59||!_0x4c5c59['length']){throw new db[(_0x375e('0x1c'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x1029be=_0x4c5c59;return db[_0x375e('0x3d')][_0x375e('0x25')]({'where':{'id':0x1}});})[_0x375e('0x19')](function(_0x5e955b){if(!_0x5e955b){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x3e'));}_0x56f2b1=_0x5e955b;if(!_0x56f2b1[_0x375e('0x3f')]||!_0x56f2b1[_0x375e('0x40')]||!_0x56f2b1[_0x375e('0xe')]||!_0x56f2b1[_0x375e('0x22')]||!_0x56f2b1['bucket']){throw new db[(_0x375e('0x1c'))][(_0x375e('0x1d'))](_0x375e('0x41'));}return db[_0x375e('0x31')][_0x375e('0x25')]({'where':{'id':_0x56f2b1['transcribeAccountId']}});})[_0x375e('0x19')](function(_0x473bba){if(!_0x473bba){throw new db['Sequelize']['ValidationError'](_0x375e('0x26'));}if(!_0x473bba[_0x375e('0x27')]||!_0x473bba[_0x375e('0xd')]){throw new db['Sequelize'][(_0x375e('0x1d'))](_0x375e('0x32'));}_0x3d74f1=_0x473bba;var _0x1f4b55=[];_0x1029be['forEach'](function(_0x35fd3a){_0x1f4b55[_0x375e('0x42')](checkTranscribeJob(_0x35fd3a,_0x56f2b1,_0x3d74f1));});return BPromise[_0x375e('0x43')](_0x1f4b55);})[_0x375e('0x44')](function(_0x5d02e9){if(_0x5d02e9){if(!_0x5d02e9[_0x375e('0x36')]||_0x5d02e9[_0x375e('0x36')]!==_0x375e('0x37')){logger[_0x375e('0x38')](util[_0x375e('0x3a')](_0x5d02e9,{'showHidden':![],'depth':null}));}}});}exports[_0x375e('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xe511=['Sentiment','SentimentScore','Positive','Negative','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Neutral','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Transcribe\x20not\x20configured','transcribeAccountId','forEach','lodash','aws-sdk','util','../../mysqldb','../../config/logger','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','ValidationError','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured'];(function(_0x244803,_0x581e0f){var _0x3fc4bd=function(_0x2004a5){while(--_0x2004a5){_0x244803['push'](_0x244803['shift']());}};_0x3fc4bd(++_0x581e0f);}(_0xe511,0x16f));var _0x1e51=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0xe511[_0x4c7b20];return _0x4872bd;};var _=require(_0x1e51('0x0'));var AWS=require(_0x1e51('0x1'));var rp=require('request-promise');var util=require(_0x1e51('0x2'));var BPromise=require('bluebird');var db=require(_0x1e51('0x3'))['db'];var logger=require(_0x1e51('0x4'))('transcribe');function getTranscriptionJob(_0x42e242,_0x2be2b7,_0x204da7,_0x16ec99){return new Promise(function(_0x480cca,_0x26b22c){var _0x21ed6b=new AWS['TranscribeService']({'accessKeyId':_0x2be2b7,'secretAccessKey':_0x42e242,'region':_0x204da7});_0x21ed6b['getTranscriptionJob']({'TranscriptionJobName':_0x16ec99},function(_0x394ad8,_0x133021){if(_0x394ad8){return _0x26b22c(_0x394ad8);}else{return _0x480cca(_0x133021);}});});}function sentiment(_0x4fa8a9,_0x49d359,_0x658941,_0x2712e0,_0x29da1f){return new Promise(function(_0x706e60,_0x4241a6){var _0x141e2e=new AWS['Comprehend']({'accessKeyId':_0x49d359,'secretAccessKey':_0x4fa8a9,'region':_0x658941});_0x141e2e[_0x1e51('0x5')]({'Text':_0x2712e0,'LanguageCode':_0x29da1f[_0x1e51('0x6')](0x0,0x2)},function(_0x3350bb,_0x2ea35d){if(_0x3350bb){return _0x4241a6(_0x3350bb);}else{return _0x706e60(_0x2ea35d);}});});}function checkTranscribeJob(_0x34ad70,_0x3c5330,_0x5544eb){var _0x408a77;return new BPromise(function(_0x102f01,_0x2acdf5){logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x9'),_0x34ad70['id'],_0x34ad70[_0x1e51('0xa')]));return getTranscriptionJob(_0x5544eb[_0x1e51('0xb')],_0x5544eb[_0x1e51('0xc')],_0x3c5330[_0x1e51('0xd')],_0x34ad70['transcribeName'])[_0x1e51('0xe')](function(_0x24db4f){logger[_0x1e51('0x7')](util['format'](_0x1e51('0xf'),_0x34ad70['id'],_0x34ad70['transcribeName'],_0x24db4f['TranscriptionJob'][_0x1e51('0x10')]));if(!_0x34ad70[_0x1e51('0x11')]){switch(_0x24db4f[_0x1e51('0x12')][_0x1e51('0x10')]){case _0x1e51('0x13'):var _0x3e4234={'transcribeStatus':_0x24db4f['TranscriptionJob'][_0x1e51('0x10')],'fileUri':_0x24db4f['TranscriptionJob'][_0x1e51('0x14')][_0x1e51('0x15')]};logger[_0x1e51('0x7')](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Get\x20transcript',_0x34ad70['id']));return rp({'uri':_0x24db4f['TranscriptionJob']['Transcript']['TranscriptFileUri'],'json':!![]})[_0x1e51('0xe')](function(_0x4f1f56){logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x16'),_0x34ad70['id']));if(_0x4f1f56&&_0x4f1f56[_0x1e51('0x17')]&&_0x4f1f56[_0x1e51('0x17')][_0x1e51('0x18')]&&_0x4f1f56[_0x1e51('0x17')][_0x1e51('0x18')]['length']){_0x3e4234['fileText']='';for(var _0x43f5c5=0x0;_0x43f5c5<_0x4f1f56[_0x1e51('0x17')][_0x1e51('0x18')][_0x1e51('0x19')];_0x43f5c5++){_0x3e4234['fileText']+=_0x4f1f56['results']['transcripts'][_0x43f5c5][_0x1e51('0x1a')]+'';}}return _0x34ad70[_0x1e51('0x1b')](_0x3e4234);})[_0x1e51('0xe')](function(){logger['info'](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x34ad70['id']));if(!_0x34ad70['tempSentiment']){throw new db[(_0x1e51('0x1c'))]['ValidationError'](_0x1e51('0x1d'));}if(!_0x3c5330[_0x1e51('0x1e')]||!_0x3c5330['sentimentAccountId']||!_0x3c5330[_0x1e51('0x1f')]||!_0x3c5330[_0x1e51('0x20')]||!_0x3c5330[_0x1e51('0x21')]){throw new db[(_0x1e51('0x1c'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3e4234['fileText']){throw new Error(_0x1e51('0x22'));}if(_0x3c5330[_0x1e51('0x23')]===_0x5544eb['id']){return _0x5544eb;}else{return db[_0x1e51('0x24')][_0x1e51('0x25')]({'where':{'id':_settings[_0x1e51('0x23')]}});}})[_0x1e51('0xe')](function(_0x378206){if(!_0x378206){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x27'));}if(!_0x378206[_0x1e51('0xb')]||!_0x378206['data2']){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x28'));}_0x408a77=_0x378206;logger[_0x1e51('0x7')](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x34ad70['id']));return sentiment(_0x408a77[_0x1e51('0xb')],_0x408a77['data2'],_0x3c5330[_0x1e51('0x1f')],_0x3e4234[_0x1e51('0x11')],_0x3c5330[_0x1e51('0x20')]);})['then'](function(_0x3e3742){logger['info'](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x34ad70['id']));return _0x34ad70['update']({'sentiment':_0x3e3742[_0x1e51('0x29')],'sPositive':_0x3e3742[_0x1e51('0x2a')][_0x1e51('0x2b')],'sNegative':_0x3e3742['SentimentScore'][_0x1e51('0x2c')],'sMixed':_0x3e3742['SentimentScore'][_0x1e51('0x2d')],'sNeutral':_0x3e3742[_0x1e51('0x2a')]['Neutral']});})[_0x1e51('0xe')](function(){logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x2e'),_0x34ad70['id']));_0x102f01();});case _0x1e51('0x2f'):return _0x34ad70[_0x1e51('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x24db4f['TranscriptionJob'][_0x1e51('0x30')]})['then'](function(){logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x2e'),_0x34ad70['id']));_0x102f01();});default:logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x31'),_0x34ad70['id']));break;}}else{return BPromise[_0x1e51('0x32')]()[_0x1e51('0xe')](function(){if(!_0x34ad70[_0x1e51('0x33')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3c5330[_0x1e51('0x1e')]||!_0x3c5330['sentimentAccountId']||!_0x3c5330[_0x1e51('0x1f')]||!_0x3c5330[_0x1e51('0x20')]||!_0x3c5330[_0x1e51('0x21')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x34'));}if(!_0x34ad70[_0x1e51('0x11')]){throw new Error(_0x1e51('0x22'));}if(_0x3c5330[_0x1e51('0x23')]===_0x5544eb['id']){return _0x5544eb;}else{return db[_0x1e51('0x24')][_0x1e51('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x13da51){if(!_0x13da51){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x27'));}if(!_0x13da51[_0x1e51('0xb')]||!_0x13da51[_0x1e51('0xc')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x408a77=_0x13da51;logger[_0x1e51('0x7')](util[_0x1e51('0x8')](_0x1e51('0x35'),_0x34ad70['id']));return sentiment(_0x408a77[_0x1e51('0xb')],_0x408a77[_0x1e51('0xc')],_0x3c5330[_0x1e51('0x1f')],_0x34ad70[_0x1e51('0x11')],_0x3c5330['language']);})[_0x1e51('0xe')](function(_0x232789){logger['info'](util[_0x1e51('0x8')](_0x1e51('0x36'),_0x34ad70['id']));return _0x34ad70[_0x1e51('0x1b')]({'sentiment':_0x232789['Sentiment'],'sPositive':_0x232789[_0x1e51('0x2a')][_0x1e51('0x2b')],'sNegative':_0x232789[_0x1e51('0x2a')][_0x1e51('0x2c')],'sMixed':_0x232789[_0x1e51('0x2a')][_0x1e51('0x2d')],'sNeutral':_0x232789[_0x1e51('0x2a')][_0x1e51('0x37')],'transcribeStatus':_0x1e51('0x13')});})['then'](function(){logger[_0x1e51('0x7')](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x34ad70['id']));_0x102f01();});}})[_0x1e51('0x38')](function(_0x41ac31){if(_0x41ac31){if(!_0x41ac31[_0x1e51('0x39')]||_0x41ac31['name']!==_0x1e51('0x3a')){logger[_0x1e51('0x3b')](util[_0x1e51('0x8')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x34ad70['id']),util[_0x1e51('0x3c')](_0x41ac31,{'showHidden':![],'depth':null}));}}_0x102f01();});});}function checkTranscribe(){var _0x52e7da;var _0x581f7a;var _0x54688b;return db[_0x1e51('0x3d')][_0x1e51('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x191a79){if(!_0x191a79||!_0x191a79[_0x1e51('0x19')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x3f'));}_0x52e7da=_0x191a79;return db[_0x1e51('0x40')]['findOne']({'where':{'id':0x1}});})[_0x1e51('0xe')](function(_0x48a2d0){if(!_0x48a2d0){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))]('Settings\x20not\x20available');}_0x581f7a=_0x48a2d0;if(!_0x581f7a['transcribe']||!_0x581f7a['transcribeAccountId']||!_0x581f7a[_0x1e51('0xd')]||!_0x581f7a[_0x1e51('0x20')]||!_0x581f7a[_0x1e51('0x21')]){throw new db['Sequelize'][(_0x1e51('0x26'))](_0x1e51('0x41'));}return db[_0x1e51('0x24')][_0x1e51('0x25')]({'where':{'id':_0x581f7a[_0x1e51('0x42')]}});})[_0x1e51('0xe')](function(_0x32fe1f){if(!_0x32fe1f){throw new db[(_0x1e51('0x1c'))]['ValidationError'](_0x1e51('0x27'));}if(!_0x32fe1f[_0x1e51('0xb')]||!_0x32fe1f[_0x1e51('0xc')]){throw new db[(_0x1e51('0x1c'))][(_0x1e51('0x26'))](_0x1e51('0x28'));}_0x54688b=_0x32fe1f;var _0x5ba6c2=[];_0x52e7da[_0x1e51('0x43')](function(_0x4a2c1b){_0x5ba6c2['push'](checkTranscribeJob(_0x4a2c1b,_0x581f7a,_0x54688b));});return BPromise['all'](_0x5ba6c2);})[_0x1e51('0x38')](function(_0xfbc40f){if(_0xfbc40f){if(!_0xfbc40f[_0x1e51('0x39')]||_0xfbc40f['name']!==_0x1e51('0x3a')){logger[_0x1e51('0x3b')](util[_0x1e51('0x3c')](_0xfbc40f,{'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 d5c7f4d..e97045e 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 _0xcf8f=['schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','format','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','lodash','moment','ioredis','../../config/environment','../../mysqldb'];(function(_0x594cd9,_0x3ed335){var _0x29d2c8=function(_0x6aa60d){while(--_0x6aa60d){_0x594cd9['push'](_0x594cd9['shift']());}};_0x29d2c8(++_0x3ed335);}(_0xcf8f,0x78));var _0xfcf8=function(_0x204665,_0x4b7744){_0x204665=_0x204665-0x0;var _0x16fa00=_0xcf8f[_0x204665];return _0x16fa00;};'use strict';var _=require(_0xfcf8('0x0'));var moment=require(_0xfcf8('0x1'));var Redis=require(_0xfcf8('0x2'));var util=require('util');var config=require(_0xfcf8('0x3'));var db=require(_0xfcf8('0x4'))['db'];var logger=require('../logger')(_0xfcf8('0x5'));config[_0xfcf8('0x6')]=_['defaults'](config['redis'],{'host':_0xfcf8('0x7'),'port':0x18eb});var io=require(_0xfcf8('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x572efd=[];return db[_0xfcf8('0x9')][_0xfcf8('0xa')]({'raw':!![],'attributes':['id',_0xfcf8('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfcf8('0xc')](0x18,_0xfcf8('0xd'))}}})[_0xfcf8('0xe')](function(_0x12f969){if(_0x12f969&&_0x12f969['length']){_0x572efd=_['map'](_0x12f969||[],'id');logger[_0xfcf8('0xf')](_0xfcf8('0x10'),_0x572efd['join']());return db[_0xfcf8('0x9')][_0xfcf8('0x11')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xfcf8('0x12')](_0xfcf8('0x13'))},{'where':{'id':_0x572efd}});}})[_0xfcf8('0xe')](function(){if(_0x572efd&&_0x572efd[_0xfcf8('0x14')]){logger[_0xfcf8('0xf')](_0xfcf8('0x15'),_0x572efd[_0xfcf8('0x16')]());for(var _0x8cf545=0x0;_0x8cf545<_0x572efd[_0xfcf8('0x14')];_0x8cf545++){io[_0xfcf8('0x17')]('whatsappInteraction:update',{'id':_0x572efd[_0x8cf545],'closed':!![]});}}})[_0xfcf8('0x18')](function(_0x510dcc){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x510dcc?util['inspect'](_0x510dcc,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa413=['ioredis','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','info','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash'];(function(_0x2061b1,_0xcd8667){var _0x415845=function(_0x3401c6){while(--_0x3401c6){_0x2061b1['push'](_0x2061b1['shift']());}};_0x415845(++_0xcd8667);}(_0xa413,0x1e5));var _0x3a41=function(_0x219ea9,_0x304ec2){_0x219ea9=_0x219ea9-0x0;var _0x973fec=_0xa413[_0x219ea9];return _0x973fec;};'use strict';var _=require(_0x3a41('0x0'));var moment=require('moment');var Redis=require(_0x3a41('0x1'));var util=require('util');var config=require(_0x3a41('0x2'));var db=require(_0x3a41('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x3a41('0x4')]=_[_0x3a41('0x5')](config[_0x3a41('0x4')],{'host':_0x3a41('0x6'),'port':0x18eb});var io=require(_0x3a41('0x7'))(new Redis(config[_0x3a41('0x4')]));function closeInteractions(){var _0x45f6d2=[];return db[_0x3a41('0x8')][_0x3a41('0x9')]({'raw':!![],'attributes':['id',_0x3a41('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3a41('0xb')](0x18,'hours')}}})[_0x3a41('0xc')](function(_0x570304){if(_0x570304&&_0x570304['length']){_0x45f6d2=_['map'](_0x570304||[],'id');logger[_0x3a41('0xd')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x45f6d2[_0x3a41('0xe')]());return db['WhatsappInteraction'][_0x3a41('0xf')]({'closeReason':_0x3a41('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x3a41('0x11')](_0x3a41('0x12'))},{'where':{'id':_0x45f6d2}});}})[_0x3a41('0xc')](function(){if(_0x45f6d2&&_0x45f6d2[_0x3a41('0x13')]){logger[_0x3a41('0xd')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x45f6d2[_0x3a41('0xe')]());for(var _0x25945f=0x0;_0x25945f<_0x45f6d2[_0x3a41('0x13')];_0x25945f++){io[_0x3a41('0x14')](_0x3a41('0x15'),{'id':_0x45f6d2[_0x25945f],'closed':!![]});}}})[_0x3a41('0x16')](function(_0x1fc976){logger[_0x3a41('0x17')](_0x3a41('0x18'),_0x1fc976?util[_0x3a41('0x19')](_0x1fc976,{'showHidden':![],'depth':null}):'');});}exports[_0x3a41('0x1a')]=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 07b574f..6e501fc 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a1b=['finished\x20populating','hopper1','contacts2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','then','CmContact','bulkCreate','contacts1','CmHopper','destroy','log'];(function(_0x104b47,_0x491eff){var _0x34a3f1=function(_0x467a15){while(--_0x467a15){_0x104b47['push'](_0x104b47['shift']());}};_0x34a3f1(++_0x491eff);}(_0x7a1b,0xe8));var _0xb7a1=function(_0x298a95,_0x5d72ea){_0x298a95=_0x298a95-0x0;var _0x5deca0=_0x7a1b[_0x298a95];return _0x5deca0;};'use strict';var util=require(_0xb7a1('0x0'));var db=require(_0xb7a1('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xb7a1('0x2')+i,'lastName':_0xb7a1('0x3')+i,'phone':0xf879fb460+i,'email':_0xb7a1('0x4')+i+_0xb7a1('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb7a1('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xb7a1('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb7a1('0x7')](),'updatedAt':Date[_0xb7a1('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb7a1('0x6')]({'id':i,'firstName':_0xb7a1('0x2')+i,'lastName':_0xb7a1('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xb7a1('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb7a1('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xb7a1('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xb7a1('0x7')]()});}db['CmContact']['destroy']({'where':{}})[_0xb7a1('0x8')](function(){return db[_0xb7a1('0x9')][_0xb7a1('0xa')](contacts);})[_0xb7a1('0x8')](function(){console['log']('finished\x20populating',_0xb7a1('0xb'));return db[_0xb7a1('0xc')][_0xb7a1('0xd')]({'where':{}});})['then'](function(){return db[_0xb7a1('0xc')][_0xb7a1('0xa')](hopper);})[_0xb7a1('0x8')](function(){console[_0xb7a1('0xe')](_0xb7a1('0xf'),_0xb7a1('0x10'));return db[_0xb7a1('0x9')][_0xb7a1('0xa')](contacts2);})[_0xb7a1('0x8')](function(){console[_0xb7a1('0xe')](_0xb7a1('0xf'),_0xb7a1('0x11'));return db[_0xb7a1('0xc')][_0xb7a1('0xa')](hopper2);})[_0xb7a1('0x8')](function(){console['log'](_0xb7a1('0xf'),'hopper2');})[_0xb7a1('0x12')](function(_0xc1cb6c){console[_0xb7a1('0xe')](_0xc1cb6c);}); \ No newline at end of file +var _0x5564=['push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy','then','bulkCreate','CmHopper','finished\x20populating','hopper1','log','contacts2','hopper2','catch','util','../mysqldb'];(function(_0x1e7382,_0x44937e){var _0x16debf=function(_0x520a8a){while(--_0x520a8a){_0x1e7382['push'](_0x1e7382['shift']());}};_0x16debf(++_0x44937e);}(_0x5564,0x12e));var _0x4556=function(_0x285e49,_0x437f0a){_0x285e49=_0x285e49-0x0;var _0x59ba62=_0x5564[_0x285e49];return _0x59ba62;};'use strict';var util=require(_0x4556('0x0'));var db=require(_0x4556('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x4556('0x2')]({'id':i,'firstName':_0x4556('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x4556('0x4')+i+_0x4556('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x4556('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x4556('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4556('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x4556('0x2')]({'id':i,'firstName':_0x4556('0x3')+i,'lastName':_0x4556('0x7')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x4556('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x4556('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x4556('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4556('0x6')](),'updatedAt':Date[_0x4556('0x6')]()});}db[_0x4556('0x8')][_0x4556('0x9')]({'where':{}})[_0x4556('0xa')](function(){return db['CmContact'][_0x4556('0xb')](contacts);})[_0x4556('0xa')](function(){console['log']('finished\x20populating','contacts1');return db[_0x4556('0xc')][_0x4556('0x9')]({'where':{}});})[_0x4556('0xa')](function(){return db[_0x4556('0xc')][_0x4556('0xb')](hopper);})[_0x4556('0xa')](function(){console['log'](_0x4556('0xd'),_0x4556('0xe'));return db[_0x4556('0x8')]['bulkCreate'](contacts2);})['then'](function(){console[_0x4556('0xf')](_0x4556('0xd'),_0x4556('0x10'));return db[_0x4556('0xc')][_0x4556('0xb')](hopper2);})[_0x4556('0xa')](function(){console['log'](_0x4556('0xd'),_0x4556('0x11'));})[_0x4556('0x12')](function(_0x4dcabb){console['log'](_0x4dcabb);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index a5efc7f..9260fdd 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4847=['add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log'];(function(_0x39f992,_0x2e5783){var _0x3eadac=function(_0x3fbef0){while(--_0x3fbef0){_0x39f992['push'](_0x39f992['shift']());}};_0x3eadac(++_0x2e5783);}(_0x4847,0xca));var _0x7484=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x4847[_0x5447fd];return _0x15b28a;};'use strict';var util=require(_0x7484('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7484('0x1')]({'name':util[_0x7484('0x2')](_0x7484('0x3'),'agent',i),'fullname':util[_0x7484('0x2')](_0x7484('0x3'),_0x7484('0x4'),i),'email':util['format'](_0x7484('0x5'),'agent',i),'role':_0x7484('0x4'),'password':_0x7484('0x6'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x7484('0x7')],'disallow':[_0x7484('0x8')],'allow':[_0x7484('0x9')],'defaultuser':util['format']('%s%s',_0x7484('0x4'),i),'encryption':_0x7484('0xa'),'avpf':'yes','force_avp':'yes','icesupport':'yes','dtlsenable':_0x7484('0xa'),'dtlsverify':'no','dtlscertfile':_0x7484('0xb'),'dtlsprivatekey':_0x7484('0xc'),'dtlssetup':_0x7484('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x7484('0x2')](_0x7484('0x3'),_0x7484('0x4'),i),0xfa0+i)});}db[_0x7484('0xe')][_0x7484('0xf')](users)[_0x7484('0x10')](function(){console[_0x7484('0x11')](_0x7484('0x12'));})[_0x7484('0x13')](function(_0xc7aa5){console[_0x7484('0x11')](_0xc7aa5);}); \ No newline at end of file +var _0xccf0=['log','add\x20user','catch','util','format','%s%s','%s%s@xcally.com','agent','password','friend','udp','all','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate'];(function(_0x3d00d1,_0x29715f){var _0x42e48e=function(_0x1ad738){while(--_0x1ad738){_0x3d00d1['push'](_0x3d00d1['shift']());}};_0x42e48e(++_0x29715f);}(_0xccf0,0xc9));var _0x0ccf=function(_0x466b16,_0x2ad7db){_0x466b16=_0x466b16-0x0;var _0x1c285f=_0xccf0[_0x466b16];return _0x1c285f;};'use strict';var util=require(_0x0ccf('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x0ccf('0x1')](_0x0ccf('0x2'),'agent',i),'fullname':util[_0x0ccf('0x1')]('%s%s','agent',i),'email':util[_0x0ccf('0x1')](_0x0ccf('0x3'),_0x0ccf('0x4'),i),'role':_0x0ccf('0x4'),'password':_0x0ccf('0x5'),'internal':0xfa0+i,'type':_0x0ccf('0x6'),'transport':[_0x0ccf('0x7'),'ws','wss'],'disallow':[_0x0ccf('0x8')],'allow':['ulaw'],'defaultuser':util[_0x0ccf('0x1')](_0x0ccf('0x2'),_0x0ccf('0x4'),i),'encryption':'yes','avpf':_0x0ccf('0x9'),'force_avp':_0x0ccf('0x9'),'icesupport':_0x0ccf('0x9'),'dtlsenable':_0x0ccf('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x0ccf('0xa'),'dtlssetup':_0x0ccf('0xb'),'callerid':util[_0x0ccf('0x1')](_0x0ccf('0xc'),util[_0x0ccf('0x1')](_0x0ccf('0x2'),'agent',i),0xfa0+i)});}db[_0x0ccf('0xd')][_0x0ccf('0xe')](users)['then'](function(){console[_0x0ccf('0xf')](_0x0ccf('0x10'));})[_0x0ccf('0x11')](function(_0xa869a){console[_0x0ccf('0xf')](_0xa869a);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index d4a3d31..aa3153a 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc16d=['fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','address','request','connection','remotePort','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','UserProfileResource','then','map','resourceId','User','where','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','format','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','voice:inbound','userProfileId','FaxQueues','WhatsappQueue','Trunks','Trunk','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat'];(function(_0x15b56f,_0x2e9520){var _0x11494c=function(_0xcadcbb){while(--_0xcadcbb){_0x15b56f['push'](_0x15b56f['shift']());}};_0x11494c(++_0x2e9520);}(_0xc16d,0x145));var _0xdc16=function(_0x222957,_0x54a313){_0x222957=_0x222957-0x0;var _0x389e98=_0xc16d[_0x222957];return _0x389e98;};'use strict';var _=require(_0xdc16('0x0'));var util=require(_0xdc16('0x1'));var BPromise=require(_0xdc16('0x2'));var db=require(_0xdc16('0x3'))['db'];var config=require(_0xdc16('0x4'));var queryQueues={'attributes':['id',_0xdc16('0x5')],'include':[{'as':_0xdc16('0x6'),'model':db['User'],'attributes':['id',_0xdc16('0x5'),_0xdc16('0x7')],'raw':!![],'where':{'role':_0xdc16('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xdc16('0x5')],'where':{'role':_0xdc16('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xdc16('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xdc16('0x5')],'where':{'role':_0xdc16('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xdc16('0x5'),_0xdc16('0xa')],'where':{'type':_0xdc16('0xb')}};function getAssociatedResources(_0xfc2bb3,_0x3f4419,_0x1c9639){return db[_0xdc16('0xc')][_0xdc16('0xd')]({'where':{'name':_0xfc2bb3,'userProfileId':_0x3f4419},'raw':!![]})['then'](function(_0x2c5a8e){if(_0x2c5a8e){if(_0x2c5a8e[_0xdc16('0xe')]){switch(_0xfc2bb3){case _0xdc16('0xf'):case _0xdc16('0x10'):case'FaxQueues':case _0xdc16('0x11'):case _0xdc16('0x12'):case _0xdc16('0x13'):case _0xdc16('0x14'):return db[_0x1c9639]['findAll'](queryQueues);case _0xdc16('0x15'):return db[_0x1c9639]['findAll'](queryTelephones);case'Trunks':return db[_0x1c9639][_0xdc16('0x16')](queryTrunks);case'IvrCampaigns':return db[_0x1c9639][_0xdc16('0x16')](queryCampaigns);}}else{return db[_0xdc16('0x17')][_0xdc16('0x16')]({'attributes':['resourceId'],'where':{'sectionId':_0x2c5a8e['id']},'raw':!![]})[_0xdc16('0x18')](function(_0x5a2b26){if(_0x5a2b26){var _0x33d3e7={'where':{'id':_[_0xdc16('0x19')](_0x5a2b26,_0xdc16('0x1a'))},'raw':!![]};switch(_0x1c9639){case _0xdc16('0x1b'):_0x33d3e7['where'][_0xdc16('0x7')]=_0xdc16('0x9');break;case'Campaign':_0x33d3e7[_0xdc16('0x1c')][_0xdc16('0xa')]=_0xdc16('0xb');break;}return db[_0x1c9639]['findAll'](_0x33d3e7);}else{return[];}});}}else{return[];}})['then'](function(_0x461c29){return _0x461c29;});}function joinOrLeaveQueues(_0x5d9519,_0x14f665,_0x56fba4,_0x4b1afb){_0x5d9519[_0x14f665](util['format']('%s:queue:%s',_0x56fba4,_0x4b1afb[_0xdc16('0x5')]));if(_0x4b1afb[_0xdc16('0x6')]){for(var _0x471522=0x0;_0x471522<_0x4b1afb['Agents']['length'];_0x471522+=0x1){_0x5d9519[_0x14f665](util['format'](_0xdc16('0x1d'),_0x4b1afb['Agents'][_0x471522][_0xdc16('0x5')]));}}}function joinOrLeave(_0x431492,_0x1c0419,_0x4ae7fc){var _0x5c4b4a;if(_0x431492[_0xdc16('0x1e')][_0xdc16('0x1f')]['id']){db[_0xdc16('0x1b')][_0xdc16('0x20')]({'attributes':['id','name','role','userProfileId'],'where':{'id':_0x431492[_0xdc16('0x1e')][_0xdc16('0x1f')]['id']},'include':[{'model':db[_0xdc16('0x21')],'as':_0xdc16('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xdc16('0x23')],'as':_0xdc16('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xdc16('0x25')],'as':_0xdc16('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xdc16('0x27')],'as':_0xdc16('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xdc16('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x338f7a){if(_0x338f7a){_0x5c4b4a=_0x338f7a;_0x431492[_0x1c0419](util[_0xdc16('0x2a')](_0xdc16('0x1d'),_0x338f7a['name']));var _0x2a2608=[];switch(_0x338f7a[_0xdc16('0x7')]){case _0xdc16('0x2b'):_0x431492[_0x1c0419]('voice:inbound');_0x431492[_0x1c0419](_0xdc16('0x2c'));if(queryQueues[_0xdc16('0x2d')](_0xdc16('0x2e'))){delete queryQueues['include'];}_0x2a2608[_0xdc16('0x2f')](db[_0xdc16('0x30')][_0xdc16('0x16')](queryQueues));_0x2a2608[_0xdc16('0x2f')](db[_0xdc16('0x31')]['findAll'](queryQueues));_0x2a2608[_0xdc16('0x2f')](db[_0xdc16('0x32')][_0xdc16('0x16')](queryQueues));_0x2a2608[_0xdc16('0x2f')](db[_0xdc16('0x33')]['findAll'](queryQueues));_0x2a2608[_0xdc16('0x2f')](db[_0xdc16('0x34')][_0xdc16('0x16')](queryQueues));_0x2a2608['push'](db[_0xdc16('0x35')][_0xdc16('0x16')](queryQueues));_0x2a2608[_0xdc16('0x2f')](db['WhatsappQueue'][_0xdc16('0x16')](queryQueues));_0x2a2608['push'](db[_0xdc16('0x1b')][_0xdc16('0x16')](queryTelephones));_0x2a2608[_0xdc16('0x2f')](db['Trunk']['findAll'](queryTrunks));_0x2a2608['push'](db['Campaign'][_0xdc16('0x16')](queryCampaigns));_0x2a2608[_0xdc16('0x2f')](db[_0xdc16('0x1b')][_0xdc16('0x16')](queryAgents));break;case'user':_0x431492[_0x1c0419](_0xdc16('0x36'));_0x431492[_0x1c0419](_0xdc16('0x2c'));_0x2a2608[_0xdc16('0x2f')](getAssociatedResources('VoiceQueues',_0x338f7a['userProfileId'],_0xdc16('0x30')));_0x2a2608['push'](getAssociatedResources(_0xdc16('0x10'),_0x338f7a[_0xdc16('0x37')],_0xdc16('0x31')));_0x2a2608[_0xdc16('0x2f')](getAssociatedResources(_0xdc16('0x38'),_0x338f7a[_0xdc16('0x37')],_0xdc16('0x32')));_0x2a2608['push'](getAssociatedResources(_0xdc16('0x11'),_0x338f7a['userProfileId'],'SmsQueue'));_0x2a2608[_0xdc16('0x2f')](getAssociatedResources('MailQueues',_0x338f7a['userProfileId'],_0xdc16('0x34')));_0x2a2608[_0xdc16('0x2f')](getAssociatedResources(_0xdc16('0x13'),_0x338f7a[_0xdc16('0x37')],_0xdc16('0x35')));_0x2a2608[_0xdc16('0x2f')](getAssociatedResources(_0xdc16('0x14'),_0x338f7a['userProfileId'],_0xdc16('0x39')));_0x2a2608['push'](getAssociatedResources(_0xdc16('0x15'),_0x338f7a['userProfileId'],'User'));_0x2a2608[_0xdc16('0x2f')](getAssociatedResources(_0xdc16('0x3a'),_0x338f7a[_0xdc16('0x37')],_0xdc16('0x3b')));_0x2a2608[_0xdc16('0x2f')](getAssociatedResources(_0xdc16('0x3c'),_0x338f7a[_0xdc16('0x37')],'Campaign'));_0x2a2608['push'](db[_0xdc16('0x1b')][_0xdc16('0x16')](queryAgents));break;case _0xdc16('0x8'):_0x431492[_0x1c0419](_0xdc16('0x36'));_0x431492[_0x1c0419](_0xdc16('0x2c'));_0x2a2608[_0xdc16('0x2f')](_0x338f7a[_0xdc16('0x3d')]({'attributes':['id',_0xdc16('0x5')]}));_0x2a2608[_0xdc16('0x2f')](_0x338f7a[_0xdc16('0x3e')]({'attributes':['id',_0xdc16('0x5')]}));_0x2a2608[_0xdc16('0x2f')](_0x338f7a[_0xdc16('0x3f')]({'attributes':['id',_0xdc16('0x5')]}));_0x2a2608[_0xdc16('0x2f')](_0x338f7a[_0xdc16('0x40')]({'attributes':['id','name']}));_0x2a2608[_0xdc16('0x2f')](_0x338f7a['getMailQueues']({'attributes':['id','name']}));_0x2a2608[_0xdc16('0x2f')](_0x338f7a[_0xdc16('0x41')]({'attributes':['id',_0xdc16('0x5')]}));_0x2a2608[_0xdc16('0x2f')](_0x338f7a[_0xdc16('0x42')]({'attributes':['id',_0xdc16('0x5')]}));break;}return BPromise[_0xdc16('0x43')](_0x2a2608);}})[_0xdc16('0x18')](function(_0x2752d4){if(_0x2752d4&&_0x2752d4['length']){for(var _0x3b48a5=0x0;_0x3b48a5<_0x2752d4[_0xdc16('0x44')];_0x3b48a5+=0x1){for(var _0x1e998d=0x0;_0x1e998d<_0x2752d4[_0x3b48a5][_0xdc16('0x44')];_0x1e998d+=0x1){switch(_0x3b48a5){case 0x0:joinOrLeaveQueues(_0x431492,_0x1c0419,_0xdc16('0x45'),_0x2752d4[_0x3b48a5][_0x1e998d]);break;case 0x1:joinOrLeaveQueues(_0x431492,_0x1c0419,_0xdc16('0x46'),_0x2752d4[_0x3b48a5][_0x1e998d]);break;case 0x2:joinOrLeaveQueues(_0x431492,_0x1c0419,_0xdc16('0x47'),_0x2752d4[_0x3b48a5][_0x1e998d]);break;case 0x3:joinOrLeaveQueues(_0x431492,_0x1c0419,'sms',_0x2752d4[_0x3b48a5][_0x1e998d]);break;case 0x4:joinOrLeaveQueues(_0x431492,_0x1c0419,_0xdc16('0x48'),_0x2752d4[_0x3b48a5][_0x1e998d]);break;case 0x5:joinOrLeaveQueues(_0x431492,_0x1c0419,_0xdc16('0x49'),_0x2752d4[_0x3b48a5][_0x1e998d]);break;case 0x6:joinOrLeaveQueues(_0x431492,_0x1c0419,_0xdc16('0x4a'),_0x2752d4[_0x3b48a5][_0x1e998d]);break;case 0x7:if(_0x5c4b4a['role']!==_0xdc16('0x8'))_0x431492[_0x1c0419](util[_0xdc16('0x2a')](_0xdc16('0x4b'),_0x2752d4[_0x3b48a5][_0x1e998d]['name']));break;case 0x8:if(_0x5c4b4a[_0xdc16('0x7')]!==_0xdc16('0x8'))_0x431492[_0x1c0419](util['format'](_0xdc16('0x4c'),_0x2752d4[_0x3b48a5][_0x1e998d]['name']));break;case 0x9:if(_0x5c4b4a[_0xdc16('0x7')]!==_0xdc16('0x8'))_0x431492[_0x1c0419](util[_0xdc16('0x2a')](_0xdc16('0x4d'),_0x2752d4[_0x3b48a5][_0x1e998d][_0xdc16('0xa')],_0x2752d4[_0x3b48a5][_0x1e998d][_0xdc16('0x5')]));break;case 0xa:_0x431492[_0x1c0419](util[_0xdc16('0x2a')](_0xdc16('0x1d'),_0x2752d4[_0x3b48a5][_0x1e998d][_0xdc16('0x5')]));break;}}}}})[_0xdc16('0x18')](function(){if(_0x1c0419===_0xdc16('0x4e')){var _0xc09784=_[_0xdc16('0x19')](_0x5c4b4a['ChatInteractions'],'id');return _0x5c4b4a['removeChatInteractions'](_0xc09784)[_0xdc16('0x18')](function(){for(var _0x28c148=0x0;_0x28c148<_0xc09784[_0xdc16('0x44')];_0x28c148+=0x1){_0x4ae7fc[_0xdc16('0x4f')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xc09784[_0x28c148]),'UserId':Number(_0x5c4b4a['id'])});}});}})['then'](function(){if(_0x1c0419===_0xdc16('0x4e')){var _0x547cb2=_[_0xdc16('0x19')](_0x5c4b4a[_0xdc16('0x24')],'id');return _0x5c4b4a['removeMailInteractions'](_0x547cb2)[_0xdc16('0x18')](function(){for(var _0xff519a=0x0;_0xff519a<_0x547cb2[_0xdc16('0x44')];_0xff519a+=0x1){_0x4ae7fc['emit'](_0xdc16('0x50'),{'MailInteractionId':Number(_0x547cb2[_0xff519a]),'UserId':Number(_0x5c4b4a['id'])});}});}})[_0xdc16('0x18')](function(){if(_0x1c0419==='leave'){var _0x52ef90=_[_0xdc16('0x19')](_0x5c4b4a[_0xdc16('0x26')],'id');return _0x5c4b4a[_0xdc16('0x51')](_0x52ef90)[_0xdc16('0x18')](function(){for(var _0x4931a3=0x0;_0x4931a3<_0x52ef90[_0xdc16('0x44')];_0x4931a3+=0x1){_0x4ae7fc[_0xdc16('0x4f')](_0xdc16('0x52'),{'FaxInteractionId':Number(_0x52ef90[_0x4931a3]),'UserId':Number(_0x5c4b4a['id'])});}});}})['then'](function(){if(_0x1c0419===_0xdc16('0x4e')){var _0x4ac056=_['map'](_0x5c4b4a['SmsInteractions'],'id');return _0x5c4b4a[_0xdc16('0x53')](_0x4ac056)[_0xdc16('0x18')](function(){for(var _0x525a38=0x0;_0x525a38<_0x4ac056[_0xdc16('0x44')];_0x525a38+=0x1){_0x4ae7fc['emit'](_0xdc16('0x54'),{'SmsInteractionId':Number(_0x4ac056[_0x525a38]),'UserId':Number(_0x5c4b4a['id'])});}});}})[_0xdc16('0x18')](function(){if(_0x1c0419===_0xdc16('0x4e')){var _0x2aa8c1=_[_0xdc16('0x19')](_0x5c4b4a[_0xdc16('0x28')],'id');return _0x5c4b4a[_0xdc16('0x55')](_0x2aa8c1)[_0xdc16('0x18')](function(){for(var _0x44020a=0x0;_0x44020a<_0x2aa8c1['length'];_0x44020a+=0x1){_0x4ae7fc[_0xdc16('0x4f')](_0xdc16('0x56'),{'OpenchannelInteractionId':Number(_0x2aa8c1[_0x44020a]),'UserId':Number(_0x5c4b4a['id'])});}});}})['then'](function(){if(_0x1c0419===_0xdc16('0x4e')){var _0x2c8c29=_[_0xdc16('0x19')](_0x5c4b4a[_0xdc16('0x29')],'id');return _0x5c4b4a['removeWhatsappInteractions'](_0x2c8c29)['then'](function(){for(var _0x41ce93=0x0;_0x41ce93<_0x2c8c29[_0xdc16('0x44')];_0x41ce93+=0x1){_0x4ae7fc[_0xdc16('0x4f')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2c8c29[_0x41ce93]),'UserId':Number(_0x5c4b4a['id'])});}});}})[_0xdc16('0x57')](function(_0x4ac2f7){_0x431492[_0xdc16('0x58')](_0x4ac2f7);});}}function onDisconnect(_0x2948a7,_0x50ff77){joinOrLeave(_0x2948a7,'leave',_0x50ff77);}function onConnect(_0x59c5cf){joinOrLeave(_0x59c5cf,_0xdc16('0x59'));}exports[_0xdc16('0x5a')]=function(_0x22ddd1){_0x22ddd1['on']('connection',function(_0x56a96d){_0x56a96d['setMaxListeners'](0x0);_0x56a96d[_0xdc16('0x5b')]=_0x56a96d[_0xdc16('0x5c')]['connection']['remoteAddress']+':'+_0x56a96d[_0xdc16('0x5c')][_0xdc16('0x5d')][_0xdc16('0x5e')];_0x56a96d['connectedAt']=new Date();_0x56a96d[_0xdc16('0x58')]=function(_0xa05a59){console['log'](_0xdc16('0x5f')+_0x56a96d['nsp'][_0xdc16('0x5')]+'['+_0x56a96d[_0xdc16('0x5b')]+']',_0xa05a59);};_0x56a96d['on'](_0xdc16('0x60'),function(){onDisconnect(_0x56a96d,_0x22ddd1);_0x56a96d['log'](_0xdc16('0x61'));});onConnect(_0x56a96d);_0x56a96d['log'](_0xdc16('0x62'));});}; \ No newline at end of file +var _0x5ae0=['FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','MailQueue','Telephones','Trunks','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','map','emit','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','address','connection','remoteAddress','request','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','util','bluebird','./environment','name','User','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','where','role','Campaign','%s:queue:%s','length','format','user:%s','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue'];(function(_0x3f1e76,_0xeab283){var _0x1c6870=function(_0x3a9a4a){while(--_0x3a9a4a){_0x3f1e76['push'](_0x3f1e76['shift']());}};_0x1c6870(++_0xeab283);}(_0x5ae0,0xf8));var _0x05ae=function(_0x232662,_0x22c373){_0x232662=_0x232662-0x0;var _0x53d1d0=_0x5ae0[_0x232662];return _0x53d1d0;};'use strict';var _=require('lodash');var util=require(_0x05ae('0x0'));var BPromise=require(_0x05ae('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x05ae('0x2'));var queryQueues={'attributes':['id',_0x05ae('0x3')],'include':[{'as':'Agents','model':db[_0x05ae('0x4')],'attributes':['id',_0x05ae('0x3'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x05ae('0x3')],'where':{'role':_0x05ae('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x05ae('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x05ae('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x05ae('0x3'),_0x05ae('0x7')],'where':{'type':_0x05ae('0x8')}};function getAssociatedResources(_0x315dd9,_0x34e318,_0x38cf72){return db[_0x05ae('0x9')][_0x05ae('0xa')]({'where':{'name':_0x315dd9,'userProfileId':_0x34e318},'raw':!![]})[_0x05ae('0xb')](function(_0x3e0498){if(_0x3e0498){if(_0x3e0498[_0x05ae('0xc')]){switch(_0x315dd9){case _0x05ae('0xd'):case _0x05ae('0xe'):case _0x05ae('0xf'):case _0x05ae('0x10'):case _0x05ae('0x11'):case _0x05ae('0x12'):case _0x05ae('0x13'):return db[_0x38cf72]['findAll'](queryQueues);case'Telephones':return db[_0x38cf72]['findAll'](queryTelephones);case'Trunks':return db[_0x38cf72][_0x05ae('0x14')](queryTrunks);case _0x05ae('0x15'):return db[_0x38cf72][_0x05ae('0x14')](queryCampaigns);}}else{return db[_0x05ae('0x16')][_0x05ae('0x14')]({'attributes':[_0x05ae('0x17')],'where':{'sectionId':_0x3e0498['id']},'raw':!![]})[_0x05ae('0xb')](function(_0x3de84b){if(_0x3de84b){var _0xf8a649={'where':{'id':_['map'](_0x3de84b,_0x05ae('0x17'))},'raw':!![]};switch(_0x38cf72){case _0x05ae('0x4'):_0xf8a649[_0x05ae('0x18')][_0x05ae('0x19')]=_0x05ae('0x5');break;case _0x05ae('0x1a'):_0xf8a649[_0x05ae('0x18')][_0x05ae('0x7')]=_0x05ae('0x8');break;}return db[_0x38cf72]['findAll'](_0xf8a649);}else{return[];}});}}else{return[];}})[_0x05ae('0xb')](function(_0x17ee83){return _0x17ee83;});}function joinOrLeaveQueues(_0x5a6fe6,_0x361bcc,_0x39f0ce,_0x506d50){_0x5a6fe6[_0x361bcc](util['format'](_0x05ae('0x1b'),_0x39f0ce,_0x506d50[_0x05ae('0x3')]));if(_0x506d50['Agents']){for(var _0x84b684=0x0;_0x84b684<_0x506d50['Agents'][_0x05ae('0x1c')];_0x84b684+=0x1){_0x5a6fe6[_0x361bcc](util[_0x05ae('0x1d')](_0x05ae('0x1e'),_0x506d50['Agents'][_0x84b684][_0x05ae('0x3')]));}}}function joinOrLeave(_0x34e275,_0x4961c9,_0x5e6a27){var _0x39d71c;if(_0x34e275['handshake'][_0x05ae('0x1f')]['id']){db[_0x05ae('0x4')][_0x05ae('0x20')]({'attributes':['id','name','role',_0x05ae('0x21')],'where':{'id':_0x34e275[_0x05ae('0x22')][_0x05ae('0x1f')]['id']},'include':[{'model':db[_0x05ae('0x23')],'as':_0x05ae('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x05ae('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x05ae('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x05ae('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x05ae('0x28')],'as':_0x05ae('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x05ae('0x2a')],'as':_0x05ae('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x208c1b){if(_0x208c1b){_0x39d71c=_0x208c1b;_0x34e275[_0x4961c9](util[_0x05ae('0x1d')](_0x05ae('0x1e'),_0x208c1b['name']));var _0x108bd8=[];switch(_0x208c1b[_0x05ae('0x19')]){case _0x05ae('0x2c'):_0x34e275[_0x4961c9](_0x05ae('0x2d'));_0x34e275[_0x4961c9](_0x05ae('0x2e'));if(queryQueues[_0x05ae('0x2f')](_0x05ae('0x30'))){delete queryQueues[_0x05ae('0x30')];}_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x32')][_0x05ae('0x14')](queryQueues));_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x33')]['findAll'](queryQueues));_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x34')]['findAll'](queryQueues));_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x35')][_0x05ae('0x14')](queryQueues));_0x108bd8[_0x05ae('0x31')](db['MailQueue'][_0x05ae('0x14')](queryQueues));_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x36')][_0x05ae('0x14')](queryQueues));_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x37')]['findAll'](queryQueues));_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x4')]['findAll'](queryTelephones));_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x38')][_0x05ae('0x14')](queryTrunks));_0x108bd8[_0x05ae('0x31')](db[_0x05ae('0x1a')]['findAll'](queryCampaigns));_0x108bd8[_0x05ae('0x31')](db['User']['findAll'](queryAgents));break;case _0x05ae('0x39'):_0x34e275[_0x4961c9](_0x05ae('0x2d'));_0x34e275[_0x4961c9](_0x05ae('0x2e'));_0x108bd8['push'](getAssociatedResources(_0x05ae('0xd'),_0x208c1b[_0x05ae('0x21')],_0x05ae('0x32')));_0x108bd8['push'](getAssociatedResources(_0x05ae('0xe'),_0x208c1b[_0x05ae('0x21')],_0x05ae('0x33')));_0x108bd8[_0x05ae('0x31')](getAssociatedResources('FaxQueues',_0x208c1b[_0x05ae('0x21')],_0x05ae('0x34')));_0x108bd8[_0x05ae('0x31')](getAssociatedResources('SmsQueues',_0x208c1b[_0x05ae('0x21')],_0x05ae('0x35')));_0x108bd8[_0x05ae('0x31')](getAssociatedResources('MailQueues',_0x208c1b[_0x05ae('0x21')],_0x05ae('0x3a')));_0x108bd8['push'](getAssociatedResources('OpenchannelQueues',_0x208c1b[_0x05ae('0x21')],'OpenchannelQueue'));_0x108bd8[_0x05ae('0x31')](getAssociatedResources(_0x05ae('0x13'),_0x208c1b[_0x05ae('0x21')],_0x05ae('0x37')));_0x108bd8['push'](getAssociatedResources(_0x05ae('0x3b'),_0x208c1b[_0x05ae('0x21')],'User'));_0x108bd8['push'](getAssociatedResources(_0x05ae('0x3c'),_0x208c1b[_0x05ae('0x21')],_0x05ae('0x38')));_0x108bd8[_0x05ae('0x31')](getAssociatedResources('IvrCampaigns',_0x208c1b[_0x05ae('0x21')],_0x05ae('0x1a')));_0x108bd8[_0x05ae('0x31')](db['User']['findAll'](queryAgents));break;case _0x05ae('0x6'):_0x34e275[_0x4961c9](_0x05ae('0x2d'));_0x34e275[_0x4961c9](_0x05ae('0x2e'));_0x108bd8[_0x05ae('0x31')](_0x208c1b[_0x05ae('0x3d')]({'attributes':['id',_0x05ae('0x3')]}));_0x108bd8[_0x05ae('0x31')](_0x208c1b[_0x05ae('0x3e')]({'attributes':['id',_0x05ae('0x3')]}));_0x108bd8[_0x05ae('0x31')](_0x208c1b[_0x05ae('0x3f')]({'attributes':['id','name']}));_0x108bd8[_0x05ae('0x31')](_0x208c1b[_0x05ae('0x40')]({'attributes':['id','name']}));_0x108bd8[_0x05ae('0x31')](_0x208c1b['getMailQueues']({'attributes':['id',_0x05ae('0x3')]}));_0x108bd8['push'](_0x208c1b[_0x05ae('0x41')]({'attributes':['id','name']}));_0x108bd8[_0x05ae('0x31')](_0x208c1b[_0x05ae('0x42')]({'attributes':['id',_0x05ae('0x3')]}));break;}return BPromise[_0x05ae('0x43')](_0x108bd8);}})[_0x05ae('0xb')](function(_0x42f294){if(_0x42f294&&_0x42f294[_0x05ae('0x1c')]){for(var _0x3a002b=0x0;_0x3a002b<_0x42f294[_0x05ae('0x1c')];_0x3a002b+=0x1){for(var _0x11f71b=0x0;_0x11f71b<_0x42f294[_0x3a002b][_0x05ae('0x1c')];_0x11f71b+=0x1){switch(_0x3a002b){case 0x0:joinOrLeaveQueues(_0x34e275,_0x4961c9,_0x05ae('0x44'),_0x42f294[_0x3a002b][_0x11f71b]);break;case 0x1:joinOrLeaveQueues(_0x34e275,_0x4961c9,_0x05ae('0x45'),_0x42f294[_0x3a002b][_0x11f71b]);break;case 0x2:joinOrLeaveQueues(_0x34e275,_0x4961c9,_0x05ae('0x46'),_0x42f294[_0x3a002b][_0x11f71b]);break;case 0x3:joinOrLeaveQueues(_0x34e275,_0x4961c9,_0x05ae('0x47'),_0x42f294[_0x3a002b][_0x11f71b]);break;case 0x4:joinOrLeaveQueues(_0x34e275,_0x4961c9,_0x05ae('0x48'),_0x42f294[_0x3a002b][_0x11f71b]);break;case 0x5:joinOrLeaveQueues(_0x34e275,_0x4961c9,'openchannel',_0x42f294[_0x3a002b][_0x11f71b]);break;case 0x6:joinOrLeaveQueues(_0x34e275,_0x4961c9,'whatsapp',_0x42f294[_0x3a002b][_0x11f71b]);break;case 0x7:if(_0x39d71c['role']!==_0x05ae('0x6'))_0x34e275[_0x4961c9](util[_0x05ae('0x1d')](_0x05ae('0x49'),_0x42f294[_0x3a002b][_0x11f71b]['name']));break;case 0x8:if(_0x39d71c[_0x05ae('0x19')]!==_0x05ae('0x6'))_0x34e275[_0x4961c9](util[_0x05ae('0x1d')](_0x05ae('0x4a'),_0x42f294[_0x3a002b][_0x11f71b][_0x05ae('0x3')]));break;case 0x9:if(_0x39d71c['role']!=='agent')_0x34e275[_0x4961c9](util[_0x05ae('0x1d')](_0x05ae('0x4b'),_0x42f294[_0x3a002b][_0x11f71b]['type'],_0x42f294[_0x3a002b][_0x11f71b]['name']));break;case 0xa:_0x34e275[_0x4961c9](util[_0x05ae('0x1d')](_0x05ae('0x1e'),_0x42f294[_0x3a002b][_0x11f71b][_0x05ae('0x3')]));break;}}}}})[_0x05ae('0xb')](function(){if(_0x4961c9==='leave'){var _0x53cdcb=_[_0x05ae('0x4c')](_0x39d71c['ChatInteractions'],'id');return _0x39d71c['removeChatInteractions'](_0x53cdcb)[_0x05ae('0xb')](function(){for(var _0x4b405c=0x0;_0x4b405c<_0x53cdcb[_0x05ae('0x1c')];_0x4b405c+=0x1){_0x5e6a27[_0x05ae('0x4d')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x53cdcb[_0x4b405c]),'UserId':Number(_0x39d71c['id'])});}});}})['then'](function(){if(_0x4961c9===_0x05ae('0x4e')){var _0x311032=_[_0x05ae('0x4c')](_0x39d71c['MailInteractions'],'id');return _0x39d71c[_0x05ae('0x4f')](_0x311032)[_0x05ae('0xb')](function(){for(var _0x2df17b=0x0;_0x2df17b<_0x311032[_0x05ae('0x1c')];_0x2df17b+=0x1){_0x5e6a27[_0x05ae('0x4d')](_0x05ae('0x50'),{'MailInteractionId':Number(_0x311032[_0x2df17b]),'UserId':Number(_0x39d71c['id'])});}});}})['then'](function(){if(_0x4961c9===_0x05ae('0x4e')){var _0x14819c=_[_0x05ae('0x4c')](_0x39d71c['FaxInteractions'],'id');return _0x39d71c[_0x05ae('0x51')](_0x14819c)[_0x05ae('0xb')](function(){for(var _0x1aa5fb=0x0;_0x1aa5fb<_0x14819c[_0x05ae('0x1c')];_0x1aa5fb+=0x1){_0x5e6a27[_0x05ae('0x4d')](_0x05ae('0x52'),{'FaxInteractionId':Number(_0x14819c[_0x1aa5fb]),'UserId':Number(_0x39d71c['id'])});}});}})[_0x05ae('0xb')](function(){if(_0x4961c9===_0x05ae('0x4e')){var _0x188353=_[_0x05ae('0x4c')](_0x39d71c[_0x05ae('0x53')],'id');return _0x39d71c[_0x05ae('0x54')](_0x188353)[_0x05ae('0xb')](function(){for(var _0x3f97df=0x0;_0x3f97df<_0x188353[_0x05ae('0x1c')];_0x3f97df+=0x1){_0x5e6a27['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x188353[_0x3f97df]),'UserId':Number(_0x39d71c['id'])});}});}})[_0x05ae('0xb')](function(){if(_0x4961c9===_0x05ae('0x4e')){var _0xd252a1=_[_0x05ae('0x4c')](_0x39d71c['OpenchannelInteractions'],'id');return _0x39d71c[_0x05ae('0x55')](_0xd252a1)[_0x05ae('0xb')](function(){for(var _0x4f9a7d=0x0;_0x4f9a7d<_0xd252a1[_0x05ae('0x1c')];_0x4f9a7d+=0x1){_0x5e6a27['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xd252a1[_0x4f9a7d]),'UserId':Number(_0x39d71c['id'])});}});}})[_0x05ae('0xb')](function(){if(_0x4961c9===_0x05ae('0x4e')){var _0x2c1bd6=_[_0x05ae('0x4c')](_0x39d71c[_0x05ae('0x2b')],'id');return _0x39d71c[_0x05ae('0x56')](_0x2c1bd6)['then'](function(){for(var _0x417519=0x0;_0x417519<_0x2c1bd6['length'];_0x417519+=0x1){_0x5e6a27[_0x05ae('0x4d')](_0x05ae('0x57'),{'WhatsappInteractionId':Number(_0x2c1bd6[_0x417519]),'UserId':Number(_0x39d71c['id'])});}});}})[_0x05ae('0x58')](function(_0x349430){_0x34e275['log'](_0x349430);});}}function onDisconnect(_0x1df25a,_0x3eba49){joinOrLeave(_0x1df25a,_0x05ae('0x4e'),_0x3eba49);}function onConnect(_0x3cf8f4){joinOrLeave(_0x3cf8f4,_0x05ae('0x59'));}exports['default']=function(_0x542a4c){_0x542a4c['on']('connection',function(_0x4843d5){_0x4843d5['setMaxListeners'](0x0);_0x4843d5[_0x05ae('0x5a')]=_0x4843d5['request'][_0x05ae('0x5b')][_0x05ae('0x5c')]+':'+_0x4843d5[_0x05ae('0x5d')][_0x05ae('0x5b')][_0x05ae('0x5e')];_0x4843d5[_0x05ae('0x5f')]=new Date();_0x4843d5[_0x05ae('0x60')]=function(_0x2540ac){console[_0x05ae('0x60')](_0x05ae('0x61')+_0x4843d5['nsp'][_0x05ae('0x3')]+'['+_0x4843d5[_0x05ae('0x5a')]+']',_0x2540ac);};_0x4843d5['on'](_0x05ae('0x62'),function(){onDisconnect(_0x4843d5,_0x542a4c);_0x4843d5[_0x05ae('0x60')](_0x05ae('0x63'));});onConnect(_0x4843d5);_0x4843d5['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 4a32f23..718aa03 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 _0x85ad=['AfterUpdate','User','fullname','email','internal','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','Chat','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','newinteraction','closedinteraction','WhatsappInteraction','afterUpdate','Whatsapp','WhatsappMessage','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','get','motionChannel','event','resolve','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','QueryTypes','contact','UserId','format','SIP/%s','name','agent','channel','outgoingmessage','offlineMessage','opened','Sequelize','SELECT','interface','catch','changed','closed','substatus'];(function(_0x41a063,_0x4189ab){var _0xf25a67=function(_0x9e7bba){while(--_0x9e7bba){_0x41a063['push'](_0x41a063['shift']());}};_0xf25a67(++_0x4189ab);}(_0x85ad,0xe7));var _0xd85a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x85ad[_0x19950b];return _0x3c6b41;};'use strict';var util=require('util');var db=require(_0xd85a('0x0'))['db'];var jayson=require(_0xd85a('0x1'));var logger=require(_0xd85a('0x2'))(_0xd85a('0x3'));var client=jayson[_0xd85a('0x4')][_0xd85a('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xd85a('0x6'),'event':_0xd85a('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0xd85a('0x6'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd85a('0x8'),'model':_0xd85a('0x9'),'event':'afterCreate','condition':_0xd85a('0xa'),'callback':afterCreateMessage},{'channel':'Chat','model':_0xd85a('0xb'),'event':_0xd85a('0x7'),'condition':_0xd85a('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xd85a('0xc'),'model':_0xd85a('0xd'),'event':_0xd85a('0x7'),'condition':_0xd85a('0xe'),'callback':afterCreate},{'channel':_0xd85a('0xc'),'model':_0xd85a('0xd'),'event':'afterUpdate','condition':_0xd85a('0xf'),'callback':afterUpdate},{'channel':_0xd85a('0xc'),'model':'SmsMessage','event':_0xd85a('0x7'),'condition':_0xd85a('0xa'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xd85a('0x10'),'event':_0xd85a('0x7'),'condition':_0xd85a('0xe'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xd85a('0x11'),'condition':_0xd85a('0xf'),'callback':afterUpdate},{'channel':_0xd85a('0x12'),'model':_0xd85a('0x13'),'event':_0xd85a('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0xd85a('0x14'),'event':'afterCreate','condition':_0xd85a('0xe'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0xd85a('0x11'),'condition':_0xd85a('0xf'),'callback':afterUpdate},{'channel':'Fax','model':_0xd85a('0x15'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xd85a('0x16'),'model':_0xd85a('0x17'),'event':'afterCreate','condition':_0xd85a('0xe'),'callback':afterCreate},{'channel':_0xd85a('0x16'),'model':_0xd85a('0x17'),'event':_0xd85a('0x11'),'condition':_0xd85a('0xf'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0xd85a('0x7'),'condition':_0xd85a('0xa'),'callback':afterCreateMessage},{'channel':_0xd85a('0x18'),'model':_0xd85a('0x19'),'event':_0xd85a('0x7'),'condition':_0xd85a('0xe'),'callback':afterCreate},{'channel':_0xd85a('0x18'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0xd85a('0xf'),'callback':afterUpdate},{'channel':_0xd85a('0x18'),'model':_0xd85a('0x1a'),'event':_0xd85a('0x7'),'condition':_0xd85a('0xa'),'callback':afterCreateMessage}];function request(_0x17a69a){return client[_0xd85a('0x1b')](_0xd85a('0x1c'),_0x17a69a)[_0xd85a('0x1d')](function(_0x3508e7){logger[_0xd85a('0x1e')](_0xd85a('0x1f'),_0xd85a('0x1c'),_0x3508e7);if(_0x3508e7[_0xd85a('0x20')]){if(_0x3508e7[_0xd85a('0x20')][_0xd85a('0x21')]===0x1f4){logger[_0xd85a('0x20')]('Trigger,\x20%s',_0xd85a('0x1c'),_0x3508e7[_0xd85a('0x20')]);}}})['catch'](function(_0x5b7253){logger[_0xd85a('0x20')](_0xd85a('0x1f'),_0xd85a('0x1c'),_0x5b7253);});}function afterCreateMessage(_0x5f4719){return function(_0x2f3f70){_0x2f3f70=_0x2f3f70[_0xd85a('0x22')]({'plain':!![]});_0x2f3f70['channel']=_0x5f4719;_0x2f3f70[_0xd85a('0x23')]=_0x5f4719;_0x2f3f70[_0xd85a('0x24')]=_0x2f3f70['direction'];Promise[_0xd85a('0x25')]()[_0xd85a('0x1d')](function(){if(typeof _0x2f3f70['ContactId']===_0xd85a('0x26'))return null;var _0x1c0fdf=_0xd85a('0x27')+_0x2f3f70[_0xd85a('0x28')];return db[_0xd85a('0x29')][_0xd85a('0x2a')](_0x1c0fdf,{'type':db['Sequelize'][_0xd85a('0x2b')]['SELECT'],'raw':!![]});})[_0xd85a('0x1d')](function(_0x5ada6f){if(_0x5ada6f){_0x2f3f70[_0xd85a('0x2c')]=_0x5ada6f[0x0];}if(typeof _0x2f3f70[_0xd85a('0x2d')]===_0xd85a('0x26'))return;return getAgent(_0x2f3f70['UserId']);})[_0xd85a('0x1d')](function(_0x348b9e){if(_0x348b9e){_0x2f3f70['interface']=util[_0xd85a('0x2e')](_0xd85a('0x2f'),_0x348b9e[_0xd85a('0x30')]);_0x2f3f70[_0xd85a('0x31')]=_0x348b9e;_0x2f3f70[_0xd85a('0x32')]=_0x5f4719;return request({'event':'incomingmessage','message':_0x2f3f70});}else{return request({'event':_0xd85a('0x33'),'message':_0x2f3f70});}})['catch'](function(_0x1e0df7){logger[_0xd85a('0x20')]('Trigger,\x20%s','AfterCreateMessage',_0x1e0df7);});};}function afterCreateOfflineMessage(_0x330ce1){return function(_0x25628b){_0x25628b=_0x25628b['get']({'plain':!![]});_0x25628b[_0xd85a('0x32')]=_0x330ce1;_0x25628b[_0xd85a('0x23')]=_0x330ce1;_0x25628b[_0xd85a('0x24')]=_0xd85a('0x34');return request({'event':_0x25628b[_0xd85a('0x24')],'message':_0x25628b});};}function afterCreate(_0x157fbc,_0x23186e){return function(_0x690c2d){_0x690c2d=_0x690c2d[_0xd85a('0x22')]({'plain':!![]});_0x690c2d['channel']=_0x157fbc;_0x690c2d[_0xd85a('0x23')]=_0x157fbc;_0x690c2d[_0xd85a('0x24')]=_0xd85a('0x35');Promise[_0xd85a('0x25')]()[_0xd85a('0x1d')](function(){var _0x420ab6=_0xd85a('0x27')+_0x690c2d[_0xd85a('0x28')];return db[_0xd85a('0x29')]['query'](_0x420ab6,{'type':db[_0xd85a('0x36')][_0xd85a('0x2b')][_0xd85a('0x37')],'raw':!![]});})[_0xd85a('0x1d')](function(_0x3833d9){if(_0x3833d9){_0x690c2d[_0xd85a('0x2c')]=_0x3833d9[0x0];}if(typeof _0x690c2d[_0xd85a('0x2d')]===_0xd85a('0x26'))return;return getAgent(_0x690c2d[_0xd85a('0x2d')]);})[_0xd85a('0x1d')](function(_0x5afa14){if(_0x5afa14){_0x690c2d[_0xd85a('0x38')]=util[_0xd85a('0x2e')](_0xd85a('0x2f'),_0x5afa14[_0xd85a('0x30')]);_0x690c2d[_0xd85a('0x31')]=_0x5afa14;}return request({'event':_0x23186e,'message':_0x690c2d});})[_0xd85a('0x39')](function(_0x349067){logger[_0xd85a('0x20')](_0xd85a('0x1f'),'AfterCreate',_0x349067);});};}function afterUpdate(_0x32da1){return function(_0x1b4a01){var _0x3f3c53=_0x1b4a01[_0xd85a('0x3a')](_0xd85a('0x3b'))&&_0x1b4a01['closed'];var _0x247811=_0x1b4a01[_0xd85a('0x3a')](_0xd85a('0x3c'));if(_0x3f3c53||_0x247811){var _0x551775=_0x3f3c53?_0xd85a('0xf'):'substatus';var _0x4dcdb8=_0x1b4a01[_0xd85a('0x22')]({'plain':!![]});_0x4dcdb8['channel']=_0x32da1;_0x4dcdb8[_0xd85a('0x23')]=_0x32da1;_0x4dcdb8[_0xd85a('0x24')]=_0x3f3c53?'closed':'substatus';var _0xf9cc9a=_0xd85a('0x27')+_0x4dcdb8[_0xd85a('0x28')];return db[_0xd85a('0x29')][_0xd85a('0x2a')](_0xf9cc9a,{'type':db['Sequelize']['QueryTypes'][_0xd85a('0x37')],'raw':!![]})[_0xd85a('0x1d')](function(_0x2ffcae){if(_0x2ffcae){_0x4dcdb8[_0xd85a('0x2c')]=_0x2ffcae[0x0];}if(typeof _0x4dcdb8[_0xd85a('0x2d')]===_0xd85a('0x26'))return;return getAgent(_0x4dcdb8[_0xd85a('0x2d')]);})[_0xd85a('0x1d')](function(_0x2474b3){if(_0x2474b3){_0x4dcdb8[_0xd85a('0x38')]=util['format'](_0xd85a('0x2f'),_0x2474b3[_0xd85a('0x30')]);_0x4dcdb8['agent']=_0x2474b3;}return request({'event':_0x551775,'message':_0x4dcdb8});})[_0xd85a('0x39')](function(_0x3ec278){logger[_0xd85a('0x20')](_0xd85a('0x1f'),_0xd85a('0x3d'),_0x3ec278);});}};}function getAgent(_0x2ce4e6){return db[_0xd85a('0x3e')]['find']({'where':{'id':_0x2ce4e6},'attributes':['id',_0xd85a('0x30'),_0xd85a('0x3f'),_0xd85a('0x40'),_0xd85a('0x41')],'raw':!![]})[_0xd85a('0x1d')](function(_0x1aecdb){return _0x1aecdb;});}exports[_0xd85a('0x42')]=function(){for(var _0x114760=0x0;_0x114760=_0x2be996['agents']){throw Error(_0x2f9b('0x17'));}_0x2da9a6(_0x441a1c);})[_0x2f9b('0x18')](function(_0x489ec6){_0x41a63d(_0x489ec6);});});}; \ No newline at end of file +var _0x8468=['bluebird','../mysqldb','./license/util','voice','mail','chat','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','count','agent','then','agents','catch','lodash'];(function(_0x2b6497,_0x23657a){var _0x39117e=function(_0x215d31){while(--_0x215d31){_0x2b6497['push'](_0x2b6497['shift']());}};_0x39117e(++_0x23657a);}(_0x8468,0x137));var _0x8846=function(_0x938136,_0x3df282){_0x938136=_0x938136-0x0;var _0x2dec45=_0x8468[_0x938136];return _0x2dec45;};'use strict';var _=require(_0x8846('0x0'));var BPromise=require(_0x8846('0x1'));var db=require(_0x8846('0x2'))['db'];var util=require(_0x8846('0x3'));var channels=[_0x8846('0x4'),_0x8846('0x5'),_0x8846('0x6'),'fax',_0x8846('0x7'),_0x8846('0x8'),_0x8846('0x9')];exports[_0x8846('0xa')]=function(){return channels;};exports['isValidChannel']=function(_0x54e8e5){_0x54e8e5=_0x54e8e5[_0x8846('0xb')]();return _[_0x8846('0xc')](channels,_0x54e8e5);};exports[_0x8846('0xd')]=function(_0x4e5ac4,_0x38e142,_0x4e3d97,_0x220798){var _0x13545c={'loginAttempts':_0x38e142,'blocked':_0x4e3d97};if(!_[_0x8846('0xe')](_0x220798)){_0x13545c[_0x8846('0xf')]=_0x220798;}return _0x4e5ac4[_0x8846('0x10')](_0x13545c);};exports[_0x8846('0x11')]=function(_0x11c1f5){return new BPromise(function(_0x760bde,_0x3a1291){var _0x2b8f87=0x0;if(_0x11c1f5[_0x8846('0x12')]!=='agent'){_0x760bde(_0x11c1f5);}db['User'][_0x8846('0x13')]({'where':{'role':_0x8846('0x14'),'online':!![],'id':{'$ne':_0x11c1f5['id']}}})[_0x8846('0x15')](function(_0x35b032){_0x2b8f87=_0x35b032;return util['getLicense']();})[_0x8846('0x15')](function(_0x5b3e4b){if(_0x5b3e4b&&_0x5b3e4b[_0x8846('0x16')]&&_0x2b8f87>=_0x5b3e4b[_0x8846('0x16')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x760bde(_0x11c1f5);})[_0x8846('0x17')](function(_0x50f927){_0x3a1291(_0x50f927);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 7fb26a3..ba46ad4 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0x28aff9,_0x547caf){var _0x5c56d1=function(_0x41a607){while(--_0x41a607){_0x28aff9['push'](_0x28aff9['shift']());}};_0x5c56d1(++_0x547caf);}(_0x153f,0x15b));var _0xf153=function(_0x1f7351,_0x5e7d9d){_0x1f7351=_0x1f7351-0x0;var _0x5d124b=_0x153f[_0x1f7351];return _0x5d124b;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xbdb7=['Error','Bad\x20Request','Entity\x20not\x20found','inherits','Forbidden','OutOfInterval','Not\x20Found','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name'];(function(_0x3b38ac,_0x313209){var _0x3765b9=function(_0x2f4e04){while(--_0x2f4e04){_0x3b38ac['push'](_0x3b38ac['shift']());}};_0x3765b9(++_0x313209);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2f47f1,_0x17f6a7){_0x2f47f1=_0x2f47f1-0x0;var _0x1e2329=_0xbdb7[_0x2f47f1];return _0x1e2329;};'use strict';var util=require(_0x7bdb('0x0'));var logger=require(_0x7bdb('0x1'))(_0x7bdb('0x2'));var APIError=function(_0x2a2c1c,_0x23c326){this[_0x7bdb('0x3')]=_0x2a2c1c||_0x7bdb('0x4');this[_0x7bdb('0x5')]=_0x23c326||_0x7bdb('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x28542c){this['message']=_0x28542c||'Bad\x20Request';this[_0x7bdb('0x5')]=_0x7bdb('0x7');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x513cba){this[_0x7bdb('0x3')]=_0x513cba||_0x7bdb('0x8');this['name']='Not\x20Found';util[_0x7bdb('0x9')](APINotFoundError,APIError);};function getStatusCode(_0x1a6b61){switch(_0x1a6b61){case _0x7bdb('0x7'):return 0x190;case _0x7bdb('0xa'),_0x7bdb('0xb'):return 0x193;case _0x7bdb('0xc'):return 0x194;default:return 0x1f4;}}function handleError(_0x297724){return function(_0x258cc6){logger['error'](_0x258cc6['stack']);var _0x52b9b9=getStatusCode(_0x258cc6[_0x7bdb('0x5')]);if(_0x258cc6[_0x7bdb('0x5')])delete _0x258cc6['name'];return _0x297724[_0x7bdb('0xd')](_0x52b9b9)['send'](_0x258cc6);};}module['exports']={'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 5f8a426..9297584 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['render','json','send','exports','status'];(function(_0x5e0823,_0x146024){var _0x592fbb=function(_0x5ec112){while(--_0x5ec112){_0x5e0823['push'](_0x5e0823['shift']());}};_0x592fbb(++_0x146024);}(_0xf4eb,0x1bb));var _0xbf4e=function(_0x5f2a6f,_0x1bcc0c){_0x5f2a6f=_0x5f2a6f-0x0;var _0x570d5e=_0xf4eb[_0x5f2a6f];return _0x570d5e;};'use strict';module[_0xbf4e('0x0')][0x194]=function pageNotFound(_0x562f7d,_0x32b30b){var _0x15714e='404';var _0x4eb801=0x194;var _0x133352={'status':_0x4eb801};_0x32b30b[_0xbf4e('0x1')](_0x133352[_0xbf4e('0x1')]);_0x32b30b[_0xbf4e('0x2')](_0x15714e,{},function(_0x5dda23,_0x59a088){if(_0x5dda23){return _0x32b30b[_0xbf4e('0x1')](_0x133352['status'])[_0xbf4e('0x3')](_0x133352);}_0x32b30b[_0xbf4e('0x4')](_0x59a088);});}; \ No newline at end of file +var _0xcf78=['render','json','send','exports','404','status'];(function(_0x533540,_0x13e275){var _0x13f034=function(_0xab68e){while(--_0xab68e){_0x533540['push'](_0x533540['shift']());}};_0x13f034(++_0x13e275);}(_0xcf78,0x13b));var _0x8cf7=function(_0x2ba2f8,_0x2f7ff0){_0x2ba2f8=_0x2ba2f8-0x0;var _0x36ebd6=_0xcf78[_0x2ba2f8];return _0x36ebd6;};'use strict';module[_0x8cf7('0x0')][0x194]=function pageNotFound(_0x5b64cc,_0x3332fa){var _0x10e3af=_0x8cf7('0x1');var _0x515a48=0x194;var _0x21217d={'status':_0x515a48};_0x3332fa[_0x8cf7('0x2')](_0x21217d[_0x8cf7('0x2')]);_0x3332fa[_0x8cf7('0x3')](_0x10e3af,{},function(_0x536eb4,_0x2f3380){if(_0x536eb4){return _0x3332fa['status'](_0x21217d[_0x8cf7('0x2')])[_0x8cf7('0x4')](_0x21217d);}_0x3332fa[_0x8cf7('0x5')](_0x2f3380);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 6e487e6..f541f23 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47b0=['ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','WhatsappQueues','CmList','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','Applications','Sound','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','ScreenRecording','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','CloudProviderId','restrict','MailAccountId','CloudProvider','Answers','MailMessage','Messages','Interactions','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Contact','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','ChatWebsiteId','ChatOfflineMessageId','TagId','Dispositions','FaxAccountId','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelApplication','OpenchannelQueueId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','ProactiveActions','ChatMessage','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','CompanyId','Phones','OpenchannelInteractions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','CmHopperId','Agent','OwnerId','CampaignId','Condition','All','OneAll','Any','OneAny','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','DefaultReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','CmContactId','Trigger','AllConditions','TriggerAllId','AnyConditions','Actions','TriggerId','Fields','CustomReportId','MetricId','Configurations','Subjects','SubjectId','DescriptionId','FieldId','Description','AccountId','Descriptions','Subject','Variable','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','Field','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','FromId','ToId','SessionId','ProjectId','SmsQueues','team_has_openchannel_queues','OpenchannelQueues','TrunkId','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelAccountId','ToSmsQueueId','CmCustomField','CustomFields','UserVoicePrefix','sectionId','WhatsappAccountId','WhatsappMessage','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','user','Imap','Smtp','exports','../config/environment','sequelize','jstz','determine','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','mysql','utf8','database','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model'];(function(_0x24db4e,_0x243fda){var _0x119ac4=function(_0x1bb151){while(--_0x1bb151){_0x24db4e['push'](_0x24db4e['shift']());}};_0x119ac4(++_0x243fda);}(_0x47b0,0x138));var _0x047b=function(_0x4e4aa9,_0x1da6db){_0x4e4aa9=_0x4e4aa9-0x0;var _0x1b5f78=_0x47b0[_0x4e4aa9];return _0x1b5f78;};'use strict';var config=require(_0x047b('0x0'));var Sequelize=require(_0x047b('0x1'));var _=require('lodash');var jstz=require(_0x047b('0x2'));var timezone=jstz[_0x047b('0x3')]();config['sequelize']=_['defaultsDeep'](config[_0x047b('0x1')],{'database':_0x047b('0x4'),'username':_0x047b('0x5'),'password':_0x047b('0x6'),'options':{'host':_0x047b('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x047b('0x8')},'logging':![],'timezone':timezone[_0x047b('0x9')](),'define':{'charset':'utf8','collate':_0x047b('0xa')}}});config[_0x047b('0xb')]=_['defaultsDeep'](config[_0x047b('0xb')],{'database':_0x047b('0x4'),'username':_0x047b('0x5'),'password':_0x047b('0x6'),'options':{'host':_0x047b('0x7'),'port':0xcea,'dialect':_0x047b('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x047b('0xd'),'collate':_0x047b('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x047b('0xe')],config[_0x047b('0x1')][_0x047b('0xf')],config[_0x047b('0x1')][_0x047b('0x10')],config['sequelize'][_0x047b('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x047b('0xb')][_0x047b('0xe')],config['sequelizeHistory'][_0x047b('0xf')],config[_0x047b('0xb')][_0x047b('0x10')],config['sequelizeHistory'][_0x047b('0x11')])};db[_0x047b('0x12')]=db['sequelize'][_0x047b('0x13')]('../api/user/user.model');db[_0x047b('0x14')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x15'));db[_0x047b('0x16')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x17'));db[_0x047b('0x18')]=db[_0x047b('0x1')]['import'](_0x047b('0x19'));db[_0x047b('0x1a')]=db[_0x047b('0x1')]['import'](_0x047b('0x1b'));db[_0x047b('0x1c')]=db['sequelize'][_0x047b('0x13')](_0x047b('0x1d'));db[_0x047b('0x1e')]=db['sequelize'][_0x047b('0x13')](_0x047b('0x1f'));db['ScreenRecording']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x20'));db[_0x047b('0x21')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x22'));db[_0x047b('0x23')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x24'));db[_0x047b('0x25')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x26'));db['VoiceDialReport']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x27'));db[_0x047b('0x28')]=db['sequelize']['import'](_0x047b('0x29'));db[_0x047b('0x2a')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x2b'));db['MemberReport']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x2c'));db[_0x047b('0x2d')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x2e'));db[_0x047b('0x2f')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x30'));db[_0x047b('0x31')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x32'));db[_0x047b('0x33')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x34'));db[_0x047b('0x35')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x36'));db['UserMailQueue']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x37'));db[_0x047b('0x38')]=db['sequelize'][_0x047b('0x13')](_0x047b('0x39'));db[_0x047b('0x3a')]=db[_0x047b('0x1')]['import'](_0x047b('0x3b'));db[_0x047b('0x3c')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x3d'));db[_0x047b('0x3e')]=db['sequelize'][_0x047b('0x13')](_0x047b('0x3f'));db[_0x047b('0x40')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x047b('0x41')]=db[_0x047b('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db[_0x047b('0x42')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/mailAccount/mailAccount.model');db[_0x047b('0x43')]=db[_0x047b('0x1')]['import']('../api/mailQueue/mailQueue.model');db[_0x047b('0x44')]=db['sequelize']['import'](_0x047b('0x45'));db['MailInteraction']=db[_0x047b('0x1')]['import'](_0x047b('0x46'));db['MailMessage']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x47'));db[_0x047b('0x48')]=db[_0x047b('0x1')]['import'](_0x047b('0x49'));db[_0x047b('0x4a')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x4b'));db[_0x047b('0x4c')]=db[_0x047b('0x1')]['import'](_0x047b('0x4d'));db[_0x047b('0x4e')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x4f'));db[_0x047b('0x50')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x51'));db[_0x047b('0x52')]=db['sequelize'][_0x047b('0x13')](_0x047b('0x53'));db['FaxInteraction']=db['sequelize'][_0x047b('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x047b('0x54')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/faxMessage/faxMessage.model');db[_0x047b('0x55')]=db['sequelize'][_0x047b('0x13')]('../api/faxQueue/faxQueue.model');db[_0x047b('0x56')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x57'));db[_0x047b('0x58')]=db[_0x047b('0x1')]['import'](_0x047b('0x59'));db['SmsApplication']=db['sequelize'][_0x047b('0x13')](_0x047b('0x5a'));db[_0x047b('0x5b')]=db[_0x047b('0x1')]['import'](_0x047b('0x5c'));db[_0x047b('0x5d')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x5e'));db[_0x047b('0x5f')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/smsQueue/smsQueue.model');db[_0x047b('0x60')]=db['sequelize']['import'](_0x047b('0x61'));db['OpenchannelApplication']=db[_0x047b('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0x047b('0x62')]=db['sequelize']['import'](_0x047b('0x63'));db['OpenchannelMessage']=db['sequelize'][_0x047b('0x13')](_0x047b('0x64'));db[_0x047b('0x65')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x047b('0x66')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x67'));db[_0x047b('0x68')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x047b('0x69')]=db[_0x047b('0x1')]['import'](_0x047b('0x6a'));db[_0x047b('0x6b')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x6c'));db['ChatMessage']=db[_0x047b('0x1')]['import'](_0x047b('0x6d'));db[_0x047b('0x6e')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x6f'));db[_0x047b('0x70')]=db['sequelize']['import'](_0x047b('0x71'));db[_0x047b('0x72')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x73'));db[_0x047b('0x74')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x047b('0x75')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x76'));db[_0x047b('0x77')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x78'));db[_0x047b('0x79')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db['sequelize'][_0x047b('0x13')](_0x047b('0x7a'));db[_0x047b('0x7b')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x047b('0x7c')]=db[_0x047b('0x1')]['import'](_0x047b('0x7d'));db[_0x047b('0x7e')]=db['sequelize']['import'](_0x047b('0x7f'));db['CmCustomField']=db['sequelize'][_0x047b('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x047b('0x80')]=db[_0x047b('0x1')]['import'](_0x047b('0x81'));db[_0x047b('0x82')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/automation/automation.model');db[_0x047b('0x83')]=db[_0x047b('0x1')]['import'](_0x047b('0x84'));db[_0x047b('0x85')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x86'));db['Condition']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x87'));db[_0x047b('0x88')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x89'));db[_0x047b('0x8a')]=db[_0x047b('0x1')]['import']('../api/pause/pause.model');db['Cdr']=db[_0x047b('0x1')]['import'](_0x047b('0x8b'));db[_0x047b('0x8c')]=db[_0x047b('0x1')]['import'](_0x047b('0x8d'));db[_0x047b('0x8e')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x8f'));db['Sound']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x90'));db[_0x047b('0x91')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x92'));db['ContactItemType']=db[_0x047b('0x1')]['import'](_0x047b('0x93'));db[_0x047b('0x94')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x95'));db['CmHopperAdditionalPhone']=db['sequelize'][_0x047b('0x13')](_0x047b('0x96'));db[_0x047b('0x97')]=db[_0x047b('0x1')]['import']('../api/template/template.model');db['Trigger']=db['sequelize'][_0x047b('0x13')](_0x047b('0x98'));db['Variable']=db['sequelize'][_0x047b('0x13')](_0x047b('0x99'));db[_0x047b('0x9a')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x9b'));db[_0x047b('0x9c')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/integrationReport/integrationReport.model');db[_0x047b('0x9d')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x9e'));db[_0x047b('0x9f')]=db['sequelize'][_0x047b('0x13')](_0x047b('0xa0'));db[_0x047b('0xa1')]=db['sequelize'][_0x047b('0x13')](_0x047b('0xa2'));db[_0x047b('0xa3')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xa4'));db[_0x047b('0xa5')]=db[_0x047b('0x1')]['import'](_0x047b('0xa6'));db['AnalyticTreeReport']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xa7'));db['SalesforceAccount']=db['sequelize'][_0x047b('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x047b('0xa8')]=db['sequelize'][_0x047b('0x13')](_0x047b('0xa9'));db[_0x047b('0xaa')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xab'));db[_0x047b('0xac')]=db[_0x047b('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x047b('0xad')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x047b('0xae')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xaf'));db[_0x047b('0xb0')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xb1'));db['DeskConfiguration']=db['sequelize']['import'](_0x047b('0xb2'));db[_0x047b('0xb3')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/intDeskField/intDeskField.model');db[_0x047b('0xb4')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xb5'));db['ZohoConfiguration']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xb6'));db[_0x047b('0xb7')]=db[_0x047b('0x1')]['import'](_0x047b('0xb8'));db['ZendeskAccount']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xb9'));db[_0x047b('0xba')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x047b('0xbb')]=db['sequelize']['import'](_0x047b('0xbc'));db[_0x047b('0xbd')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xbe'));db[_0x047b('0xbf')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize']['import'](_0x047b('0xc0'));db['VtigerAccount']=db['sequelize'][_0x047b('0x13')](_0x047b('0xc1'));db[_0x047b('0xc2')]=db[_0x047b('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x047b('0xc3')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xc4'));db[_0x047b('0xc5')]=db['sequelize']['import'](_0x047b('0xc6'));db['ServicenowConfiguration']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xc7'));db[_0x047b('0xc8')]=db[_0x047b('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x047b('0xc9')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xca'));db[_0x047b('0xcb')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x047b('0xcc')]=db[_0x047b('0x1')]['import'](_0x047b('0xcd'));db[_0x047b('0xce')]=db['sequelize'][_0x047b('0x13')](_0x047b('0xcf'));db[_0x047b('0xd0')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x047b('0xd1')]=db['sequelize'][_0x047b('0x13')](_0x047b('0xd2'));db[_0x047b('0x9a')]=db[_0x047b('0x1')]['import'](_0x047b('0x9b'));db['Network']=db['sequelize'][_0x047b('0x13')](_0x047b('0xd3'));db[_0x047b('0xd4')]=db['sequelize'][_0x047b('0x13')](_0x047b('0xd5'));db[_0x047b('0xd6')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xd7'));db[_0x047b('0xd8')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xd9'));db[_0x047b('0xda')]=db[_0x047b('0x1')]['import'](_0x047b('0xdb'));db[_0x047b('0xdc')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x047b('0xdd')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xde'));db['SquareReport']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xdf'));db[_0x047b('0xe0')]=db[_0x047b('0x1')]['import'](_0x047b('0xe1'));db[_0x047b('0xe2')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xe3'));db[_0x047b('0xe4')]=db['sequelize']['import']('../api/setting/setting.model');db[_0x047b('0xe5')]=db['sequelize']['import'](_0x047b('0xe6'));db['SquareProject']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xe7'));db['SquareRecording']=db[_0x047b('0x1')]['import'](_0x047b('0xe8'));db[_0x047b('0xe9')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/squareMessage/squareMessage.model');db[_0x047b('0xea')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xeb'));db[_0x047b('0xec')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/license/license.model');db[_0x047b('0xed')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xee'));db[_0x047b('0xef')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/migration/migration.model');db['Attachment']=db[_0x047b('0x1')][_0x047b('0x13')]('../api/attachment/attachment.model');db[_0x047b('0xf0')]=db['sequelize'][_0x047b('0x13')](_0x047b('0xf1'));db[_0x047b('0xf2')]=db['sequelize'][_0x047b('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x047b('0xf3')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xf4'));db[_0x047b('0xf5')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xf6'));db['OpenchannelTransferReport']=db['sequelize'][_0x047b('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x047b('0xf7')]=db[_0x047b('0x1')]['import'](_0x047b('0xf8'));db['CmList']=db[_0x047b('0x1')]['import'](_0x047b('0xf9'));db[_0x047b('0xfa')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xfb'));db['UserProfile']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xfc'));db[_0x047b('0xfd')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0xfe'));db[_0x047b('0xff')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x100'));db[_0x047b('0x101')]=db['sequelize'][_0x047b('0x13')](_0x047b('0x102'));db['WhatsappAccount']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x103'));db[_0x047b('0x104')]=db['sequelize']['import'](_0x047b('0x105'));db[_0x047b('0x106')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x107'));db[_0x047b('0x108')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x109'));db[_0x047b('0x10a')]=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x10b'));db[_0x047b('0x10c')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db['sequelize']['import'](_0x047b('0x10d'));db[_0x047b('0x10e')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x047b('0x10f')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0x047b('0x1')][_0x047b('0x13')](_0x047b('0x110'));db[_0x047b('0x111')]=db[_0x047b('0x1')][_0x047b('0x13')]('../api/user-setting/user-setting.model');db['User'][_0x047b('0x112')](db[_0x047b('0x21')],{'as':_0x047b('0x21'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x114')});db['User'][_0x047b('0x112')](db['UserSetting'],{'as':_0x047b('0x115'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x12')][_0x047b('0x116')](db[_0x047b('0x1e')],{'as':_0x047b('0x117'),'foreignKey':'UserId'});db[_0x047b('0x12')][_0x047b('0x116')](db['UserVoiceQueueRt'],{'as':_0x047b('0x118'),'foreignKey':_0x047b('0x114')});db['User'][_0x047b('0x116')](db['VoiceExtension'],{'as':_0x047b('0x119'),'onDelete':_0x047b('0x113'),'hooks':!![]});db[_0x047b('0x12')][_0x047b('0x116')](db[_0x047b('0x7b')],{'as':_0x047b('0x11a'),'foreignKey':_0x047b('0x114')});db['User'][_0x047b('0x116')](db[_0x047b('0x7c')],{'as':_0x047b('0x11b'),'foreignKey':'UserId'});db[_0x047b('0x12')][_0x047b('0x116')](db[_0x047b('0x7e')],{'as':_0x047b('0x7e'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x12')]['hasMany'](db[_0x047b('0x62')],{'as':'OpenchannelInteractions','foreignKey':_0x047b('0x114')});db[_0x047b('0x12')][_0x047b('0x116')](db[_0x047b('0x6b')],{'as':_0x047b('0x11c'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x12')][_0x047b('0x116')](db['SmsInteraction'],{'as':_0x047b('0x11d'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x12')][_0x047b('0x116')](db[_0x047b('0x11e')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0x047b('0x12')][_0x047b('0x116')](db[_0x047b('0x11f')],{'as':_0x047b('0x120'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x12')]['hasMany'](db[_0x047b('0x106')],{'as':_0x047b('0x121'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x12')][_0x047b('0x116')](db[_0x047b('0x101')],{'as':_0x047b('0x122'),'foreignKey':_0x047b('0x123')});db[_0x047b('0x12')][_0x047b('0x124')](db[_0x047b('0x125')],{'as':_0x047b('0x125'),'foreignKey':_0x047b('0x126')});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x72')],{'as':_0x047b('0x128'),'through':_0x047b('0x129')});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x77')],{'as':_0x047b('0x12a'),'through':_0x047b('0x12b')});db[_0x047b('0x12')][_0x047b('0x127')](db['CmList'],{'as':_0x047b('0x12c'),'through':'cm_user_has_lists'});db['User'][_0x047b('0x127')](db['Team'],{'through':'user_has_teams'});db['User'][_0x047b('0x127')](db[_0x047b('0x11f')],{'as':_0x047b('0x120'),'through':_0x047b('0x12d')});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x6b')],{'as':_0x047b('0x11c'),'through':_0x047b('0x12e')});db[_0x047b('0x12')]['belongsToMany'](db[_0x047b('0x11e')],{'as':_0x047b('0x12f'),'through':_0x047b('0x130')});db['User'][_0x047b('0x127')](db[_0x047b('0x5b')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x62')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x106')],{'as':_0x047b('0x121'),'through':_0x047b('0x131')});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x1c')],{'as':'VoiceQueues','through':_0x047b('0x33'),'required':![]});db['User'][_0x047b('0x127')](db[_0x047b('0xfa')],{'as':_0x047b('0x132'),'through':'UserVoicePrefix','required':![]});db['User'][_0x047b('0x127')](db[_0x047b('0x43')],{'as':_0x047b('0x133'),'through':_0x047b('0x134'),'required':![]});db[_0x047b('0x12')][_0x047b('0x127')](db['ChatQueue'],{'as':_0x047b('0x135'),'through':_0x047b('0x35'),'required':![],'hooks':!![]});db['User'][_0x047b('0x127')](db[_0x047b('0x55')],{'as':_0x047b('0x136'),'through':_0x047b('0x38'),'required':![]});db[_0x047b('0x12')][_0x047b('0x127')](db['SmsQueue'],{'as':'SmsQueues','through':_0x047b('0x3a'),'required':![]});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x65')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x10c')],{'as':_0x047b('0x137'),'through':'UserWhatsappQueue','required':![]});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x138')],{'through':_0x047b('0x139')});db['User'][_0x047b('0x127')](db[_0x047b('0x66')],{'as':_0x047b('0x13a'),'through':_0x047b('0x13b')});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x50')],{'as':_0x047b('0x13c'),'through':'user_has_fax_accounts'});db[_0x047b('0x12')][_0x047b('0x127')](db['MailAccount'],{'as':_0x047b('0x13d'),'through':_0x047b('0x13e')});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x60')],{'as':_0x047b('0x13f'),'through':'user_has_openchannel_accounts'});db[_0x047b('0x12')][_0x047b('0x127')](db['SmsAccount'],{'as':_0x047b('0x140'),'through':_0x047b('0x141')});db['User']['belongsToMany'](db[_0x047b('0x142')],{'as':_0x047b('0x143'),'through':'user_has_whatsapp_accounts'});db[_0x047b('0x12')][_0x047b('0x127')](db[_0x047b('0x144')],{'as':_0x047b('0x145'),'through':_0x047b('0x146')});db[_0x047b('0x14')][_0x047b('0x116')](db[_0x047b('0x18')],{'as':_0x047b('0x147'),'onDelete':_0x047b('0x113'),'foreignKey':'ChanSpyId'});db[_0x047b('0x16')][_0x047b('0x116')](db['VoiceExtension'],{'onDelete':_0x047b('0x113')});db[_0x047b('0x18')][_0x047b('0x116')](db[_0x047b('0x18')],{'as':_0x047b('0x148'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0x047b('0x127')](db[_0x047b('0x149')],{'as':'Sounds','through':_0x047b('0x14a')});db[_0x047b('0x1c')]['hasMany'](db[_0x047b('0x31')],{'as':_0x047b('0x14b'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x047b('0x116')](db[_0x047b('0x79')],{'as':_0x047b('0x14c'),'foreignKey':_0x047b('0x14d')});db['VoiceQueue'][_0x047b('0x116')](db['CmHopperFinal'],{'as':_0x047b('0x11a'),'foreignKey':_0x047b('0x14d')});db['VoiceQueue'][_0x047b('0x116')](db[_0x047b('0x7c')],{'as':_0x047b('0x14e'),'foreignKey':_0x047b('0x14d')});db['VoiceQueue'][_0x047b('0x116')](db['ReportAgentPreview'],{'as':_0x047b('0x7e'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x047b('0x14f')],{'as':_0x047b('0x150'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x047b('0x116')](db['JscriptySessionReport'],{'as':_0x047b('0x151'),'foreignKey':_0x047b('0x14d')});db[_0x047b('0x1c')][_0x047b('0x124')](db[_0x047b('0x2d')],{'as':_0x047b('0x2d'),'foreignKey':'TrunkId'});db[_0x047b('0x1c')][_0x047b('0x124')](db[_0x047b('0x2d')],{'as':_0x047b('0x152'),'foreignKey':'TrunkBackupId'});db[_0x047b('0x1c')][_0x047b('0x124')](db['Interval'],{'as':_0x047b('0x88'),'foreignKey':_0x047b('0x153')});db['VoiceQueue'][_0x047b('0x124')](db['Pause'],{'as':_0x047b('0x154'),'foreignKey':_0x047b('0x155')});db[_0x047b('0x1c')][_0x047b('0x127')](db[_0x047b('0x138')],{'as':'Lists','through':_0x047b('0x156')});db[_0x047b('0x1c')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':_0x047b('0x157'),'through':_0x047b('0x33')});db['VoiceQueue'][_0x047b('0x127')](db[_0x047b('0xea')],{'as':_0x047b('0x158'),'through':_0x047b('0x10e')});db['VoiceQueue'][_0x047b('0x127')](db[_0x047b('0x138')],{'as':'BlackLists','through':_0x047b('0x159')});db[_0x047b('0x1e')][_0x047b('0x124')](db[_0x047b('0x12')],{'as':_0x047b('0x12'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x15a')][_0x047b('0x124')](db['User'],{'as':_0x047b('0x12'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x21')][_0x047b('0x116')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x047b('0x113'),'foreignKey':'mailboxuser','sourceKey':_0x047b('0x15b')});db[_0x047b('0x23')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x047b('0x15c'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0x047b('0x2a')],{'as':_0x047b('0x15d'),'foreignKey':_0x047b('0x15e'),'constraints':![]});db[_0x047b('0x25')]['hasMany'](db['VoiceAgentReport'],{'as':_0x047b('0x15f'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0x047b('0x124')](db[_0x047b('0x12')],{'as':_0x047b('0x12'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x25')][_0x047b('0x124')](db[_0x047b('0x77')],{'as':'Contact','foreignKey':'ContactId'});db['MailServerIn'][_0x047b('0x124')](db[_0x047b('0x42')],{'as':_0x047b('0x42'),'foreignKey':'MailAccountId'});db[_0x047b('0x40')][_0x047b('0x124')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x047b('0x160'),'onDelete':_0x047b('0x161')});db[_0x047b('0x41')][_0x047b('0x124')](db[_0x047b('0x42')],{'as':_0x047b('0x42'),'foreignKey':_0x047b('0x162')});db[_0x047b('0x41')][_0x047b('0x124')](db[_0x047b('0x163')],{'as':'CloudProvider','foreignKey':_0x047b('0x160'),'onDelete':'restrict'});db['MailAccount']['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0x047b('0x113')});db[_0x047b('0x42')][_0x047b('0x112')](db[_0x047b('0x41')],{'as':'Smtp','onDelete':_0x047b('0x113')});db['MailAccount'][_0x047b('0x116')](db[_0x047b('0x85')],{'as':'Dispositions','foreignKey':_0x047b('0x162'),'onDelete':'cascade'});db[_0x047b('0x42')][_0x047b('0x116')](db['CannedAnswer'],{'as':_0x047b('0x164'),'foreignKey':'MailAccountId'});db[_0x047b('0x42')][_0x047b('0x116')](db[_0x047b('0x165')],{'as':_0x047b('0x166'),'foreignKey':_0x047b('0x162')});db[_0x047b('0x42')][_0x047b('0x116')](db[_0x047b('0x11f')],{'as':_0x047b('0x167')});db['MailAccount']['hasMany'](db[_0x047b('0x48')],{'as':'Applications'});db[_0x047b('0x42')][_0x047b('0x124')](db[_0x047b('0x138')],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169')});db['MailAccount'][_0x047b('0x124')](db[_0x047b('0x97')],{'as':_0x047b('0x97'),'foreignKey':_0x047b('0x16a')});db[_0x047b('0x42')][_0x047b('0x124')](db[_0x047b('0x8a')],{'as':_0x047b('0x154'),'foreignKey':_0x047b('0x155')});db[_0x047b('0x42')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':_0x047b('0x157'),'through':_0x047b('0x13e')});db['MailQueue'][_0x047b('0x127')](db[_0x047b('0x12')],{'as':'Agents','through':'UserMailQueue'});db[_0x047b('0x43')][_0x047b('0x127')](db[_0x047b('0xea')],{'through':_0x047b('0x16b'),'as':_0x047b('0x158')});db[_0x047b('0x11f')][_0x047b('0x116')](db[_0x047b('0x165')],{'as':_0x047b('0x166'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x16c')});db[_0x047b('0x11f')][_0x047b('0x124')](db[_0x047b('0x42')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x162')});db[_0x047b('0x11f')][_0x047b('0x124')](db[_0x047b('0x77')],{'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0x11f')][_0x047b('0x124')](db[_0x047b('0x12')],{'as':_0x047b('0x170'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x11f')]['belongsToMany'](db[_0x047b('0x91')],{'through':_0x047b('0x171'),'as':_0x047b('0x172')});db[_0x047b('0x11f')][_0x047b('0x127')](db[_0x047b('0x91')],{'through':'mail_interaction_has_tags','as':_0x047b('0x173')});db['MailInteraction'][_0x047b('0x127')](db['User'],{'as':_0x047b('0x174'),'through':'user_has_mail_interactions','foreignKey':_0x047b('0x16c')});db[_0x047b('0x165')][_0x047b('0x116')](db[_0x047b('0x175')],{'as':'Attachments','onDelete':_0x047b('0x113')});db[_0x047b('0x165')][_0x047b('0x124')](db['User'],{'as':_0x047b('0x12')});db[_0x047b('0x165')][_0x047b('0x124')](db[_0x047b('0x77')],{'onDelete':_0x047b('0x113'),'as':_0x047b('0x16e')});db[_0x047b('0x165')][_0x047b('0x124')](db[_0x047b('0x11f')],{'as':'Interaction','foreignKey':'MailInteractionId'});db['MailMessage'][_0x047b('0x124')](db[_0x047b('0x42')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x162')});db[_0x047b('0x165')][_0x047b('0x124')](db[_0x047b('0x66')],{'as':_0x047b('0x66'),'foreignKey':_0x047b('0x176')});db[_0x047b('0x165')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0x047b('0x6e'),'foreignKey':_0x047b('0x177')});db[_0x047b('0x48')][_0x047b('0x124')](db['User'],{'onDelete':_0x047b('0x161')});db[_0x047b('0x48')][_0x047b('0x124')](db[_0x047b('0x43')],{'onDelete':'restrict'});db[_0x047b('0x48')][_0x047b('0x124')](db[_0x047b('0x42')],{'onDelete':'restrict'});db[_0x047b('0x48')]['belongsTo'](db[_0x047b('0x88')],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x153')});db[_0x047b('0x48')][_0x047b('0x124')](db[_0x047b('0x91')],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x178')});db[_0x047b('0x4a')][_0x047b('0x124')](db['MailAccount'],{});db[_0x047b('0x4a')][_0x047b('0x124')](db[_0x047b('0x138')],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169')});db[_0x047b('0x4a')][_0x047b('0x124')](db[_0x047b('0x77')],{'as':_0x047b('0x16e'),'foreignKey':'ContactId'});db[_0x047b('0x4a')][_0x047b('0x124')](db['MailInteraction'],{});db[_0x047b('0x4a')][_0x047b('0x124')](db[_0x047b('0x165')],{});db[_0x047b('0x4a')][_0x047b('0x124')](db['User'],{});db[_0x047b('0x4a')][_0x047b('0x124')](db[_0x047b('0x43')],{});db[_0x047b('0x4c')]['hasMany'](db['DashboardItem'],{'as':'Items','onDelete':_0x047b('0x113')});db[_0x047b('0x50')][_0x047b('0x116')](db[_0x047b('0x85')],{'as':_0x047b('0x179'),'foreignKey':_0x047b('0x17a'),'onDelete':_0x047b('0x113')});db[_0x047b('0x50')][_0x047b('0x116')](db[_0x047b('0x83')],{'as':_0x047b('0x164'),'foreignKey':_0x047b('0x17a')});db['FaxAccount']['hasMany'](db[_0x047b('0x11e')],{'as':_0x047b('0x167')});db[_0x047b('0x50')]['hasMany'](db[_0x047b('0x52')],{'as':_0x047b('0x148')});db[_0x047b('0x50')][_0x047b('0x116')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db[_0x047b('0x50')]['hasMany'](db['FaxMessage'],{'as':_0x047b('0x166')});db[_0x047b('0x50')][_0x047b('0x124')](db[_0x047b('0x2d')],{'as':_0x047b('0x2d')});db[_0x047b('0x50')][_0x047b('0x124')](db[_0x047b('0x138')],{'as':'List','foreignKey':_0x047b('0x169')});db[_0x047b('0x50')][_0x047b('0x124')](db['Pause'],{'as':_0x047b('0x154'),'foreignKey':_0x047b('0x155')});db[_0x047b('0x50')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':_0x047b('0x157'),'through':_0x047b('0x17b')});db[_0x047b('0x52')][_0x047b('0x124')](db[_0x047b('0x12')],{'onDelete':_0x047b('0x161')});db[_0x047b('0x52')]['belongsTo'](db[_0x047b('0x55')],{'onDelete':_0x047b('0x161')});db['FaxApplication'][_0x047b('0x124')](db[_0x047b('0x50')],{'onDelete':_0x047b('0x161')});db[_0x047b('0x52')][_0x047b('0x124')](db['Tag'],{'onDelete':_0x047b('0x161'),'foreignKey':'TagId'});db[_0x047b('0x11e')][_0x047b('0x116')](db['FaxMessage'],{'as':_0x047b('0x166'),'onDelete':'cascade','foreignKey':_0x047b('0x17c')});db[_0x047b('0x11e')][_0x047b('0x124')](db[_0x047b('0x50')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x17a')});db[_0x047b('0x11e')]['belongsTo'](db[_0x047b('0x77')],{'as':'Contact','foreignKey':_0x047b('0x16f')});db['FaxInteraction']['belongsTo'](db[_0x047b('0x12')],{'as':'Owner','foreignKey':'UserId'});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x047b('0x172')});db[_0x047b('0x11e')]['belongsToMany'](db[_0x047b('0x91')],{'through':_0x047b('0x17d'),'as':_0x047b('0x173')});db[_0x047b('0x11e')][_0x047b('0x127')](db['User'],{'as':_0x047b('0x174'),'through':'user_has_fax_interactions','foreignKey':_0x047b('0x17c')});db[_0x047b('0x54')]['belongsTo'](db[_0x047b('0x12')],{'onDelete':_0x047b('0x113'),'as':_0x047b('0x12')});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':_0x047b('0x17e'),'foreignKey':_0x047b('0x17c')});db[_0x047b('0x54')][_0x047b('0x124')](db[_0x047b('0x77')],{'onDelete':_0x047b('0x113'),'as':'Contact'});db[_0x047b('0x54')][_0x047b('0x124')](db[_0x047b('0x175')],{'as':_0x047b('0x175'),'foreignKey':_0x047b('0x17f')});db[_0x047b('0x54')][_0x047b('0x124')](db[_0x047b('0x50')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x17a')});db[_0x047b('0x55')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':_0x047b('0x157'),'through':_0x047b('0x38')});db['FaxQueue'][_0x047b('0x127')](db[_0x047b('0xea')],{'through':_0x047b('0x180'),'as':_0x047b('0x158')});db[_0x047b('0x56')][_0x047b('0x124')](db['FaxAccount'],{});db[_0x047b('0x56')][_0x047b('0x124')](db[_0x047b('0x138')],{'as':'List','foreignKey':'ListId'});db[_0x047b('0x56')][_0x047b('0x124')](db[_0x047b('0x77')],{'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0x56')]['belongsTo'](db[_0x047b('0x11e')],{});db['FaxQueueReport'][_0x047b('0x124')](db[_0x047b('0x54')],{});db[_0x047b('0x56')]['belongsTo'](db[_0x047b('0x12')],{});db[_0x047b('0x56')]['belongsTo'](db[_0x047b('0x55')],{});db['SmsAccount']['hasMany'](db[_0x047b('0x85')],{'as':_0x047b('0x179'),'foreignKey':_0x047b('0x181'),'onDelete':_0x047b('0x113')});db[_0x047b('0x58')]['hasMany'](db[_0x047b('0x83')],{'as':'Answers','foreignKey':_0x047b('0x181')});db['SmsAccount'][_0x047b('0x116')](db[_0x047b('0x5d')],{'as':_0x047b('0x166'),'foreignKey':_0x047b('0x181')});db[_0x047b('0x58')][_0x047b('0x116')](db['SmsInteraction'],{'as':_0x047b('0x167')});db[_0x047b('0x58')][_0x047b('0x116')](db[_0x047b('0x182')],{'as':_0x047b('0x148')});db[_0x047b('0x58')][_0x047b('0x124')](db[_0x047b('0x138')],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169')});db[_0x047b('0x58')]['belongsTo'](db[_0x047b('0x8a')],{'as':_0x047b('0x154'),'foreignKey':_0x047b('0x155')});db[_0x047b('0x58')]['belongsToMany'](db[_0x047b('0x12')],{'as':'Agents','through':_0x047b('0x141')});db[_0x047b('0x182')][_0x047b('0x124')](db[_0x047b('0x12')],{'onDelete':_0x047b('0x161')});db[_0x047b('0x182')][_0x047b('0x124')](db[_0x047b('0x5f')],{'onDelete':_0x047b('0x161')});db['SmsApplication']['belongsTo'](db[_0x047b('0x58')],{'onDelete':_0x047b('0x161')});db['SmsApplication'][_0x047b('0x124')](db[_0x047b('0x88')],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x153')});db[_0x047b('0x182')][_0x047b('0x124')](db[_0x047b('0x91')],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x178')});db['SmsInteraction'][_0x047b('0x116')](db[_0x047b('0x5d')],{'as':_0x047b('0x166'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x183')});db[_0x047b('0x5b')][_0x047b('0x124')](db[_0x047b('0x58')],{'as':'Account','foreignKey':_0x047b('0x181')});db[_0x047b('0x5b')][_0x047b('0x124')](db[_0x047b('0x77')],{'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0x5b')]['belongsTo'](db[_0x047b('0x12')],{'as':_0x047b('0x170'),'foreignKey':_0x047b('0x114')});db['SmsInteraction'][_0x047b('0x127')](db[_0x047b('0x91')],{'through':_0x047b('0x184'),'as':_0x047b('0x172')});db['SmsInteraction'][_0x047b('0x127')](db[_0x047b('0x91')],{'through':_0x047b('0x184'),'as':_0x047b('0x173')});db[_0x047b('0x5b')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':_0x047b('0x174'),'through':_0x047b('0x185'),'foreignKey':_0x047b('0x183')});db['SmsMessage'][_0x047b('0x124')](db[_0x047b('0x12')],{'as':_0x047b('0x12')});db[_0x047b('0x5d')][_0x047b('0x124')](db['CmContact'],{'onDelete':_0x047b('0x113'),'as':_0x047b('0x16e')});db[_0x047b('0x5d')][_0x047b('0x124')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x047b('0x17e'),'foreignKey':_0x047b('0x183')});db['SmsMessage'][_0x047b('0x124')](db[_0x047b('0x58')],{'as':_0x047b('0x16d'),'foreignKey':'SmsAccountId'});db[_0x047b('0x5f')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':_0x047b('0x157'),'through':_0x047b('0x3a'),'foreignKey':_0x047b('0x186')});db[_0x047b('0x5f')]['belongsToMany'](db[_0x047b('0xea')],{'through':_0x047b('0x187'),'as':_0x047b('0x158')});db['OpenchannelAccount'][_0x047b('0x116')](db[_0x047b('0x85')],{'as':'Dispositions','foreignKey':_0x047b('0x188'),'onDelete':_0x047b('0x113')});db[_0x047b('0x60')]['hasMany'](db[_0x047b('0x83')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x047b('0x60')][_0x047b('0x116')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x047b('0x188')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0x047b('0x166'),'foreignKey':_0x047b('0x188')});db[_0x047b('0x60')]['hasMany'](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x047b('0x188')});db[_0x047b('0x60')][_0x047b('0x124')](db['CmList'],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169')});db['OpenchannelAccount']['belongsTo'](db[_0x047b('0x8a')],{'as':_0x047b('0x154'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x047b('0x60')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':_0x047b('0x157'),'through':_0x047b('0x189')});db['OpenchannelApplication']['belongsTo'](db[_0x047b('0x12')],{'onDelete':_0x047b('0x161')});db[_0x047b('0x18a')][_0x047b('0x124')](db['OpenchannelQueue'],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x18b')});db[_0x047b('0x18a')]['belongsTo'](db[_0x047b('0x60')],{'onDelete':'restrict','foreignKey':_0x047b('0x188')});db[_0x047b('0x18a')][_0x047b('0x124')](db[_0x047b('0x88')],{'onDelete':_0x047b('0x161'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x047b('0x124')](db[_0x047b('0x91')],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x178')});db[_0x047b('0x62')][_0x047b('0x116')](db[_0x047b('0x18c')],{'as':_0x047b('0x166'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x18d')});db[_0x047b('0x62')][_0x047b('0x124')](db[_0x047b('0x60')],{'as':_0x047b('0x16d'),'foreignKey':'OpenchannelAccountId'});db[_0x047b('0x62')][_0x047b('0x124')](db['CmContact'],{'as':_0x047b('0x16e'),'foreignKey':'ContactId'});db['OpenchannelInteraction'][_0x047b('0x124')](db[_0x047b('0x12')],{'as':'Owner','foreignKey':_0x047b('0x114')});db[_0x047b('0x62')][_0x047b('0x127')](db[_0x047b('0x91')],{'through':_0x047b('0x18e'),'as':_0x047b('0x172')});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':_0x047b('0x18e'),'as':'ThroughTags'});db['OpenchannelInteraction']['belongsToMany'](db[_0x047b('0x12')],{'as':_0x047b('0x174'),'through':_0x047b('0x18f'),'foreignKey':_0x047b('0x18d')});db[_0x047b('0x18c')][_0x047b('0x124')](db[_0x047b('0x12')],{'onDelete':_0x047b('0x113'),'as':_0x047b('0x12')});db[_0x047b('0x18c')][_0x047b('0x124')](db[_0x047b('0x77')],{'onDelete':'cascade','as':'Contact'});db[_0x047b('0x18c')][_0x047b('0x124')](db[_0x047b('0x62')],{'onDelete':'cascade','as':_0x047b('0x17e'),'foreignKey':_0x047b('0x18d')});db[_0x047b('0x18c')][_0x047b('0x124')](db[_0x047b('0x175')],{'as':_0x047b('0x175'),'foreignKey':_0x047b('0x17f')});db[_0x047b('0x18c')][_0x047b('0x124')](db[_0x047b('0x60')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x188')});db[_0x047b('0x65')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x047b('0x3c'),'foreignKey':_0x047b('0x18b')});db['OpenchannelQueue'][_0x047b('0x127')](db[_0x047b('0xea')],{'through':'team_has_openchannel_queues','as':_0x047b('0x158')});db[_0x047b('0x66')][_0x047b('0x116')](db[_0x047b('0x85')],{'as':_0x047b('0x179'),'foreignKey':_0x047b('0x176'),'onDelete':_0x047b('0x113')});db[_0x047b('0x66')][_0x047b('0x116')](db[_0x047b('0x83')],{'as':_0x047b('0x164'),'foreignKey':_0x047b('0x176')});db[_0x047b('0x66')][_0x047b('0x116')](db[_0x047b('0x74')],{'as':_0x047b('0x190')});db[_0x047b('0x66')]['hasMany'](db['ChatInteraction'],{'as':_0x047b('0x167')});db['ChatWebsite'][_0x047b('0x116')](db[_0x047b('0x69')],{'as':_0x047b('0x148')});db[_0x047b('0x66')][_0x047b('0x116')](db[_0x047b('0x191')],{'as':_0x047b('0x166')});db['ChatWebsite']['belongsTo'](db['CmList'],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169')});db[_0x047b('0x66')][_0x047b('0x124')](db[_0x047b('0x88')],{'as':_0x047b('0x88'),'foreignKey':_0x047b('0x153')});db[_0x047b('0x66')][_0x047b('0x124')](db['MailAccount'],{'as':_0x047b('0x42'),'foreignKey':_0x047b('0x162')});db[_0x047b('0x66')]['belongsTo'](db['Pause'],{'as':_0x047b('0x154'),'foreignKey':_0x047b('0x155')});db['ChatWebsite']['belongsToMany'](db[_0x047b('0x12')],{'as':'Agents','through':_0x047b('0x13b')});db[_0x047b('0x68')][_0x047b('0x124')](db[_0x047b('0x60')],{});db[_0x047b('0x68')]['belongsTo'](db[_0x047b('0x138')],{'as':'List','foreignKey':_0x047b('0x169')});db['OpenchannelQueueReport'][_0x047b('0x124')](db[_0x047b('0x77')],{'as':'Contact','foreignKey':_0x047b('0x16f')});db[_0x047b('0x68')]['belongsTo'](db[_0x047b('0x62')],{});db[_0x047b('0x68')]['belongsTo'](db[_0x047b('0x18c')],{});db[_0x047b('0x68')][_0x047b('0x124')](db[_0x047b('0x12')],{});db[_0x047b('0x68')]['belongsTo'](db[_0x047b('0x65')],{});db[_0x047b('0x69')][_0x047b('0x124')](db[_0x047b('0x12')],{'as':'Agent','foreignKey':_0x047b('0x114'),'onDelete':_0x047b('0x161')});db['ChatApplication'][_0x047b('0x124')](db[_0x047b('0x70')],{'as':_0x047b('0x192'),'foreignKey':_0x047b('0x193'),'onDelete':_0x047b('0x161')});db[_0x047b('0x69')][_0x047b('0x124')](db[_0x047b('0x66')],{'as':_0x047b('0x194'),'foreignKey':'ChatWebsiteId','onDelete':_0x047b('0x161')});db[_0x047b('0x69')][_0x047b('0x124')](db[_0x047b('0x91')],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x178')});db[_0x047b('0x6b')][_0x047b('0x116')](db['ChatMessage'],{'as':_0x047b('0x166'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x195')});db[_0x047b('0x6b')][_0x047b('0x124')](db[_0x047b('0x66')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x176')});db[_0x047b('0x6b')][_0x047b('0x124')](db['CmContact'],{'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0x6b')][_0x047b('0x124')](db[_0x047b('0x12')],{'as':_0x047b('0x170'),'foreignKey':_0x047b('0x114')});db[_0x047b('0x6b')][_0x047b('0x127')](db[_0x047b('0x91')],{'through':_0x047b('0x196'),'as':_0x047b('0x172')});db['ChatInteraction'][_0x047b('0x127')](db[_0x047b('0x91')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0x047b('0x6b')]['belongsToMany'](db[_0x047b('0x12')],{'as':_0x047b('0x174'),'through':_0x047b('0x12e'),'foreignKey':_0x047b('0x195')});db[_0x047b('0x191')][_0x047b('0x124')](db['User'],{'onDelete':_0x047b('0x113'),'as':'User'});db[_0x047b('0x191')][_0x047b('0x124')](db[_0x047b('0x77')],{'onDelete':_0x047b('0x113'),'as':'Contact','foreignKey':'ContactId'});db[_0x047b('0x191')][_0x047b('0x124')](db[_0x047b('0x6b')],{'onDelete':'cascade','as':_0x047b('0x17e'),'foreignKey':_0x047b('0x195')});db[_0x047b('0x191')][_0x047b('0x124')](db[_0x047b('0x175')],{'as':_0x047b('0x175'),'foreignKey':_0x047b('0x17f')});db[_0x047b('0x191')][_0x047b('0x124')](db[_0x047b('0x66')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x176')});db[_0x047b('0x6e')][_0x047b('0x116')](db[_0x047b('0x175')],{'as':_0x047b('0x197'),'foreignKey':_0x047b('0x177'),'onDelete':_0x047b('0x113'),'hooks':!![]});db['ChatOfflineMessage'][_0x047b('0x124')](db['CmContact'],{'onDelete':_0x047b('0x113'),'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0x6e')][_0x047b('0x124')](db[_0x047b('0x66')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x047b('0x70')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':'Agents','through':_0x047b('0x35'),'hooks':!![]});db[_0x047b('0x70')]['belongsToMany'](db[_0x047b('0xea')],{'through':_0x047b('0x198'),'as':_0x047b('0x158')});db['ChatGroup'][_0x047b('0x116')](db['ChatInternalMessage'],{'as':_0x047b('0x166'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x047b('0x72')][_0x047b('0x127')](db['User'],{'as':_0x047b('0x14b'),'through':'chat_group_has_users'});db[_0x047b('0x74')][_0x047b('0x124')](db['ChatWebsite'],{'as':_0x047b('0x194'),'foreignKey':_0x047b('0x176')});db[_0x047b('0x75')]['hasMany'](db[_0x047b('0x77')],{'as':_0x047b('0x12a'),'foreignKey':_0x047b('0x199')});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':_0x047b('0x19a'),'foreignKey':'CmContactId'});db['CmContact'][_0x047b('0x116')](db[_0x047b('0x79')],{'as':_0x047b('0x14c'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0x77')][_0x047b('0x116')](db[_0x047b('0x7b')],{'as':_0x047b('0x11a'),'foreignKey':'ContactId'});db[_0x047b('0x77')][_0x047b('0x116')](db[_0x047b('0x7c')],{'as':_0x047b('0x14e'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0x77')][_0x047b('0x116')](db[_0x047b('0x7e')],{'as':_0x047b('0x7e'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0x77')][_0x047b('0x116')](db[_0x047b('0xdc')],{'as':_0x047b('0x151'),'foreignKey':'ContactId'});db[_0x047b('0x77')]['hasMany'](db[_0x047b('0x62')],{'as':_0x047b('0x19b'),'foreignKey':_0x047b('0x16f'),'onDelete':_0x047b('0x161')});db[_0x047b('0x77')]['hasMany'](db['ChatInteraction'],{'as':_0x047b('0x11c'),'foreignKey':_0x047b('0x16f'),'onDelete':_0x047b('0x161')});db[_0x047b('0x77')][_0x047b('0x116')](db[_0x047b('0x5b')],{'as':_0x047b('0x11d'),'foreignKey':_0x047b('0x16f'),'onDelete':_0x047b('0x161')});db[_0x047b('0x77')]['hasMany'](db[_0x047b('0x11e')],{'as':_0x047b('0x12f'),'foreignKey':_0x047b('0x16f'),'onDelete':_0x047b('0x161')});db[_0x047b('0x77')]['hasMany'](db[_0x047b('0x11f')],{'as':_0x047b('0x120'),'foreignKey':_0x047b('0x16f'),'onDelete':'restrict'});db[_0x047b('0x77')][_0x047b('0x124')](db[_0x047b('0x75')],{'as':_0x047b('0x19c'),'foreignKey':_0x047b('0x199')});db[_0x047b('0x77')]['belongsTo'](db[_0x047b('0x138')],{'as':_0x047b('0x168'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x047b('0x77')]['belongsToMany'](db[_0x047b('0x12')],{'as':_0x047b('0x174'),'through':_0x047b('0x12b')});db[_0x047b('0x77')][_0x047b('0x127')](db[_0x047b('0x91')],{'as':_0x047b('0x172'),'through':_0x047b('0x19d')});db[_0x047b('0x77')][_0x047b('0x127')](db[_0x047b('0x91')],{'through':_0x047b('0x19d'),'as':_0x047b('0x173')});db[_0x047b('0x79')][_0x047b('0x116')](db[_0x047b('0x19e')],{'as':'AdditionalPhones','foreignKey':_0x047b('0x19f')});db['CmHopper'][_0x047b('0x124')](db[_0x047b('0x77')],{'as':'Contact','foreignKey':_0x047b('0x16f'),'onDelete':'cascade'});db[_0x047b('0x79')][_0x047b('0x124')](db['CmList'],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169'),'onDelete':_0x047b('0x113')});db[_0x047b('0x79')]['belongsTo'](db[_0x047b('0x12')],{'as':_0x047b('0x1a0'),'foreignKey':'UserId'});db[_0x047b('0x79')][_0x047b('0x124')](db[_0x047b('0x1c')],{'as':_0x047b('0x192'),'foreignKey':'VoiceQueueId','onDelete':_0x047b('0x113')});db[_0x047b('0x79')][_0x047b('0x124')](db[_0x047b('0xed')],{'as':_0x047b('0xed'),'foreignKey':'CampaignId','onDelete':_0x047b('0x113')});db[_0x047b('0x79')][_0x047b('0x124')](db['User'],{'as':_0x047b('0x170'),'foreignKey':_0x047b('0x1a1')});db[_0x047b('0x14f')]['belongsTo'](db[_0x047b('0x77')],{'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x16f'),'onDelete':_0x047b('0x113')});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x047b('0x169'),'onDelete':_0x047b('0x113')});db[_0x047b('0x14f')][_0x047b('0x124')](db[_0x047b('0x1c')],{'as':_0x047b('0x192'),'foreignKey':_0x047b('0x14d'),'onDelete':_0x047b('0x113')});db['CmHopperBlack'][_0x047b('0x124')](db['Campaign'],{'as':_0x047b('0xed'),'foreignKey':_0x047b('0x1a2'),'onDelete':'cascade'});db[_0x047b('0x82')][_0x047b('0x116')](db[_0x047b('0x1a3')],{'as':{'plural':_0x047b('0x1a4'),'singular':_0x047b('0x1a5')},'foreignKey':'AutomationAllId','onDelete':_0x047b('0x113'),'hooks':!![]});db[_0x047b('0x82')][_0x047b('0x116')](db['Condition'],{'as':{'plural':_0x047b('0x1a6'),'singular':_0x047b('0x1a7')},'foreignKey':'AutomationAnyId','onDelete':_0x047b('0x113'),'hooks':!![]});db['Automation']['hasMany'](db[_0x047b('0x80')],{'as':'Actions','foreignKey':_0x047b('0x1a8'),'onDelete':_0x047b('0x113'),'hooks':!![]});db[_0x047b('0x85')][_0x047b('0x116')](db['Disposition'],{'as':_0x047b('0x179'),'foreignKey':_0x047b('0x1a9'),'onDelete':'cascade'});db['Interval'][_0x047b('0x116')](db[_0x047b('0x88')],{'as':_0x047b('0x1aa'),'foreignKey':_0x047b('0x153'),'onDelete':_0x047b('0x113'),'hooks':!![],'required':![]});db[_0x047b('0x88')]['hasMany'](db['VoiceExtension'],{'as':_0x047b('0x119'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x047b('0x88')][_0x047b('0x116')](db[_0x047b('0x48')],{'as':_0x047b('0x1ab'),'foreignKey':_0x047b('0x153')});db[_0x047b('0x88')]['hasMany'](db['ChatApplication'],{'as':_0x047b('0x1ac'),'foreignKey':_0x047b('0x153')});db[_0x047b('0x88')][_0x047b('0x116')](db[_0x047b('0x52')],{'as':'FaxApplications','foreignKey':_0x047b('0x153')});db[_0x047b('0x88')][_0x047b('0x116')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':'IntervalId'});db['Schedule'][_0x047b('0x124')](db[_0x047b('0x42')],{});db[_0x047b('0x8e')][_0x047b('0x124')](db['AnalyticDefaultReport'],{'foreignKey':_0x047b('0x1ad')});db[_0x047b('0x8e')]['belongsTo'](db[_0x047b('0x9d')],{'foreignKey':'CustomReportId'});db[_0x047b('0x149')]['belongsToMany'](db[_0x047b('0x1a')],{'as':_0x047b('0x1ae'),'through':_0x047b('0x14a'),'onDelete':_0x047b('0x161')});db[_0x047b('0x91')][_0x047b('0x127')](db['CmContact'],{'through':_0x047b('0x19d')});db[_0x047b('0x91')]['belongsToMany'](db['ChatInteraction'],{'through':_0x047b('0x196')});db[_0x047b('0x91')][_0x047b('0x127')](db['MailInteraction'],{'through':_0x047b('0x171')});db['Tag'][_0x047b('0x127')](db[_0x047b('0x5b')],{'through':_0x047b('0x184')});db[_0x047b('0x91')][_0x047b('0x127')](db[_0x047b('0x11e')],{'through':_0x047b('0x17d')});db['Tag'][_0x047b('0x127')](db[_0x047b('0x62')],{'through':_0x047b('0x18e')});db['Tag']['belongsToMany'](db[_0x047b('0x106')],{'through':_0x047b('0x1af')});db[_0x047b('0x94')][_0x047b('0x124')](db['ContactItemType'],{'as':_0x047b('0x1b0'),'foreignKey':_0x047b('0x1b1')});db[_0x047b('0x19e')][_0x047b('0x124')](db[_0x047b('0x79')],{'as':'Hopper','foreignKey':_0x047b('0x19f')});db[_0x047b('0x94')][_0x047b('0x124')](db[_0x047b('0x77')],{'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x1b2')});db[_0x047b('0x1b3')]['hasMany'](db[_0x047b('0x1a3')],{'as':{'plural':_0x047b('0x1b4'),'singular':'AllCondition'},'foreignKey':_0x047b('0x1b5'),'onDelete':'cascade','hooks':!![]});db[_0x047b('0x1b3')][_0x047b('0x116')](db[_0x047b('0x1a3')],{'as':{'plural':_0x047b('0x1b6'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0x047b('0x113'),'hooks':!![]});db[_0x047b('0x1b3')][_0x047b('0x116')](db[_0x047b('0x80')],{'as':_0x047b('0x1b7'),'foreignKey':_0x047b('0x1b8'),'onDelete':_0x047b('0x113'),'hooks':!![]});db[_0x047b('0x9d')][_0x047b('0x116')](db['AnalyticFieldReport'],{'as':_0x047b('0x1b9'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1ba'),'hooks':!![]});db['AnalyticDefaultReport'][_0x047b('0x116')](db[_0x047b('0xa5')],{'as':_0x047b('0x1b9'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1ad')});db[_0x047b('0xa3')][_0x047b('0x116')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1bb')});db[_0x047b('0xa5')][_0x047b('0x124')](db[_0x047b('0xa3')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x047b('0x116')](db[_0x047b('0xa8')],{'as':_0x047b('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x047b('0xa8')][_0x047b('0x116')](db[_0x047b('0xaa')],{'as':_0x047b('0x1bd'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0xa8')][_0x047b('0x116')](db[_0x047b('0xaa')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x047b('0x1bf')});db[_0x047b('0xa8')][_0x047b('0x116')](db['SalesforceField'],{'as':_0x047b('0x1b9'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1c0')});db[_0x047b('0xa8')]['belongsTo'](db['SalesforceAccount'],{'as':_0x047b('0x16d'),'foreignKey':'AccountId'});db['SalesforceField'][_0x047b('0x116')](db['SalesforceField'],{'as':'Subject','foreignKey':_0x047b('0x1be')});db['SalesforceField']['hasMany'](db[_0x047b('0xaa')],{'as':_0x047b('0x1c1'),'foreignKey':_0x047b('0x1bf')});db['SalesforceField']['hasMany'](db[_0x047b('0xaa')],{'as':'Field','foreignKey':_0x047b('0x1c0')});db[_0x047b('0xaa')][_0x047b('0x124')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['SugarcrmAccount'][_0x047b('0x116')](db['SugarcrmConfiguration'],{'as':_0x047b('0x1bc'),'onDelete':'cascade','foreignKey':_0x047b('0x1c2')});db[_0x047b('0xad')][_0x047b('0x116')](db[_0x047b('0xae')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x047b('0x1be')});db[_0x047b('0xad')][_0x047b('0x116')](db[_0x047b('0xae')],{'as':_0x047b('0x1c3'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0xad')][_0x047b('0x116')](db['SugarcrmField'],{'as':_0x047b('0x1b9'),'onDelete':'cascade','foreignKey':_0x047b('0x1c0')});db[_0x047b('0xad')][_0x047b('0x124')](db[_0x047b('0xac')],{'as':'Account','foreignKey':_0x047b('0x1c2')});db['SugarcrmField'][_0x047b('0x116')](db[_0x047b('0xae')],{'as':_0x047b('0x1c4'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0xae')][_0x047b('0x116')](db[_0x047b('0xae')],{'as':_0x047b('0x1c1'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0xae')][_0x047b('0x116')](db[_0x047b('0xae')],{'as':'Field','foreignKey':'FieldId'});db[_0x047b('0xae')][_0x047b('0x124')](db[_0x047b('0x1c5')],{'as':_0x047b('0x1c5'),'foreignKey':_0x047b('0x1c6')});db[_0x047b('0xb0')][_0x047b('0x116')](db[_0x047b('0x1c7')],{'as':_0x047b('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x047b('0x1c7')]['hasMany'](db[_0x047b('0xb3')],{'as':_0x047b('0x1bd'),'onDelete':_0x047b('0x113'),'foreignKey':'SubjectId'});db[_0x047b('0x1c7')]['hasMany'](db[_0x047b('0xb3')],{'as':'Descriptions','onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0x1c7')][_0x047b('0x116')](db['DeskField'],{'as':_0x047b('0x1b9'),'onDelete':'cascade','foreignKey':_0x047b('0x1c0')});db[_0x047b('0x1c7')][_0x047b('0x124')](db[_0x047b('0xb0')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x1c2')});db[_0x047b('0x1c7')][_0x047b('0x127')](db[_0x047b('0x91')],{'through':_0x047b('0x1c8')});db[_0x047b('0xb3')][_0x047b('0x116')](db[_0x047b('0xb3')],{'as':'Subject','foreignKey':_0x047b('0x1be')});db['DeskField'][_0x047b('0x116')](db[_0x047b('0xb3')],{'as':_0x047b('0x1c1'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0xb3')][_0x047b('0x116')](db[_0x047b('0xb3')],{'as':'Field','foreignKey':_0x047b('0x1c0')});db[_0x047b('0xb3')][_0x047b('0x124')](db['Variable'],{'as':_0x047b('0x1c5'),'foreignKey':_0x047b('0x1c6')});db['ZohoAccount'][_0x047b('0x116')](db[_0x047b('0x1c9')],{'as':_0x047b('0x1bc'),'onDelete':'cascade','foreignKey':_0x047b('0x1c2')});db[_0x047b('0x1c9')]['hasMany'](db[_0x047b('0xb7')],{'as':'Subjects','onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1be')});db['ZohoConfiguration'][_0x047b('0x116')](db[_0x047b('0xb7')],{'as':_0x047b('0x1c3'),'onDelete':'cascade','foreignKey':_0x047b('0x1bf')});db[_0x047b('0x1c9')][_0x047b('0x116')](db['ZohoField'],{'as':_0x047b('0x1b9'),'onDelete':_0x047b('0x113'),'foreignKey':'FieldId'});db[_0x047b('0x1c9')][_0x047b('0x124')](db[_0x047b('0xb4')],{'as':_0x047b('0x16d'),'foreignKey':'AccountId'});db[_0x047b('0xb7')][_0x047b('0x116')](db[_0x047b('0xb7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x047b('0xb7')][_0x047b('0x116')](db['ZohoField'],{'as':_0x047b('0x1c1'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0xb7')][_0x047b('0x116')](db[_0x047b('0xb7')],{'as':_0x047b('0x1ca'),'foreignKey':'FieldId'});db[_0x047b('0xb7')][_0x047b('0x124')](db[_0x047b('0x1c5')],{'as':_0x047b('0x1c5'),'foreignKey':_0x047b('0x1c6')});db['ZendeskAccount'][_0x047b('0x116')](db[_0x047b('0xba')],{'as':'Configurations','onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1c2')});db[_0x047b('0xba')][_0x047b('0x116')](db['ZendeskField'],{'as':_0x047b('0x1bd'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0xba')][_0x047b('0x116')](db[_0x047b('0xbb')],{'as':_0x047b('0x1c3'),'foreignKey':_0x047b('0x1bf')});db['ZendeskConfiguration'][_0x047b('0x116')](db[_0x047b('0xbb')],{'as':_0x047b('0x1b9'),'foreignKey':'FieldId'});db[_0x047b('0xba')][_0x047b('0x124')](db[_0x047b('0x1cb')],{'as':_0x047b('0x16d'),'foreignKey':'AccountId'});db[_0x047b('0xba')][_0x047b('0x127')](db['Tag'],{'through':_0x047b('0x1cc')});db['ZendeskField'][_0x047b('0x116')](db[_0x047b('0xbb')],{'as':_0x047b('0x1c4'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0xbb')][_0x047b('0x116')](db[_0x047b('0xbb')],{'as':_0x047b('0x1c1'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0xbb')][_0x047b('0x116')](db['ZendeskField'],{'as':_0x047b('0x1ca'),'foreignKey':'FieldId'});db[_0x047b('0xbb')][_0x047b('0x124')](db[_0x047b('0x1c5')],{'as':_0x047b('0x1c5'),'foreignKey':_0x047b('0x1c6')});db[_0x047b('0xbd')][_0x047b('0x116')](db[_0x047b('0xbf')],{'as':'Configurations','onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1c2')});db[_0x047b('0xbf')][_0x047b('0x116')](db[_0x047b('0x1cd')],{'as':_0x047b('0x1bd'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0xbf')]['hasMany'](db['FreshdeskField'],{'as':_0x047b('0x1c3'),'onDelete':_0x047b('0x113'),'foreignKey':'DescriptionId'});db[_0x047b('0xbf')][_0x047b('0x116')](db[_0x047b('0x1cd')],{'as':_0x047b('0x1b9'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1c0')});db[_0x047b('0xbf')]['belongsTo'](db[_0x047b('0xbd')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x1c2')});db[_0x047b('0xbf')][_0x047b('0x127')](db[_0x047b('0x91')],{'through':_0x047b('0x1ce')});db['FreshdeskField'][_0x047b('0x116')](db[_0x047b('0x1cd')],{'as':_0x047b('0x1c4'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0x1cd')][_0x047b('0x116')](db[_0x047b('0x1cd')],{'as':_0x047b('0x1c1'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0x1cd')]['hasMany'](db[_0x047b('0x1cd')],{'as':_0x047b('0x1ca'),'foreignKey':_0x047b('0x1c0')});db[_0x047b('0x1cd')][_0x047b('0x124')](db[_0x047b('0x1c5')],{'as':_0x047b('0x1c5'),'foreignKey':'VariableId'});db[_0x047b('0x1cf')][_0x047b('0x116')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x047b('0x113'),'foreignKey':'AccountId'});db[_0x047b('0xc2')][_0x047b('0x116')](db['VtigerField'],{'as':_0x047b('0x1bd'),'foreignKey':'SubjectId'});db[_0x047b('0xc2')]['hasMany'](db['VtigerField'],{'as':_0x047b('0x1c3'),'foreignKey':'DescriptionId'});db[_0x047b('0xc2')][_0x047b('0x116')](db[_0x047b('0xc3')],{'as':_0x047b('0x1b9'),'foreignKey':'FieldId'});db[_0x047b('0xc2')][_0x047b('0x124')](db[_0x047b('0x1cf')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x1c2')});db[_0x047b('0xc3')]['hasMany'](db['VtigerField'],{'as':_0x047b('0x1c4'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0xc3')][_0x047b('0x116')](db[_0x047b('0xc3')],{'as':_0x047b('0x1c1'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0xc3')][_0x047b('0x116')](db[_0x047b('0xc3')],{'as':'Field','foreignKey':_0x047b('0x1c0')});db[_0x047b('0xc3')][_0x047b('0x124')](db['Variable'],{'as':_0x047b('0x1c5'),'foreignKey':_0x047b('0x1c6')});db['ServicenowAccount'][_0x047b('0x116')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x047b('0x113'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x047b('0x116')](db[_0x047b('0xc8')],{'as':'Subjects','foreignKey':_0x047b('0x1be')});db['ServicenowConfiguration'][_0x047b('0x116')](db[_0x047b('0xc8')],{'as':_0x047b('0x1c3'),'foreignKey':'DescriptionId'});db[_0x047b('0x1d0')]['hasMany'](db[_0x047b('0xc8')],{'as':_0x047b('0x1b9'),'foreignKey':_0x047b('0x1c0')});db[_0x047b('0x1d0')][_0x047b('0x124')](db[_0x047b('0xc5')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x1c2')});db[_0x047b('0xc8')][_0x047b('0x116')](db[_0x047b('0xc8')],{'as':_0x047b('0x1c4'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0xc8')]['hasMany'](db['ServicenowField'],{'as':_0x047b('0x1c1'),'foreignKey':_0x047b('0x1bf')});db['ServicenowField'][_0x047b('0x116')](db['ServicenowField'],{'as':_0x047b('0x1ca'),'foreignKey':'FieldId'});db['ServicenowField'][_0x047b('0x124')](db[_0x047b('0x1c5')],{'as':_0x047b('0x1c5'),'foreignKey':'VariableId'});db[_0x047b('0xc9')][_0x047b('0x116')](db[_0x047b('0xcb')],{'as':_0x047b('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x047b('0xc9')][_0x047b('0x124')](db[_0x047b('0x163')],{'as':_0x047b('0x163'),'foreignKey':_0x047b('0x160')});db[_0x047b('0xcb')][_0x047b('0x116')](db[_0x047b('0xcc')],{'as':_0x047b('0x1bd'),'onDelete':_0x047b('0x113'),'foreignKey':'SubjectId'});db[_0x047b('0xcb')]['hasMany'](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1bf')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1c0')});db[_0x047b('0xcb')][_0x047b('0x124')](db[_0x047b('0xc9')],{'as':'Account','foreignKey':_0x047b('0x1c2')});db[_0x047b('0xcc')][_0x047b('0x116')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x047b('0x1be')});db[_0x047b('0xcc')][_0x047b('0x116')](db[_0x047b('0xcc')],{'as':'Description','foreignKey':_0x047b('0x1bf')});db['Dynamics365Field'][_0x047b('0x116')](db['Dynamics365Field'],{'as':_0x047b('0x1ca'),'foreignKey':_0x047b('0x1c0')});db[_0x047b('0xcc')]['belongsTo'](db[_0x047b('0x1c5')],{'as':_0x047b('0x1c5'),'foreignKey':_0x047b('0x1c6')});db[_0x047b('0xce')]['hasMany'](db[_0x047b('0xd0')],{'as':_0x047b('0x1bc'),'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1c2')});db[_0x047b('0xd0')][_0x047b('0x116')](db[_0x047b('0xd1')],{'as':'Subjects','foreignKey':_0x047b('0x1be')});db['FreshsalesConfiguration'][_0x047b('0x116')](db[_0x047b('0xd1')],{'as':_0x047b('0x1c3'),'foreignKey':_0x047b('0x1bf')});db[_0x047b('0xd0')]['hasMany'](db[_0x047b('0xd1')],{'as':'Fields','foreignKey':_0x047b('0x1c0')});db['FreshsalesConfiguration'][_0x047b('0x124')](db[_0x047b('0xce')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x1c2')});db['FreshsalesField']['hasMany'](db[_0x047b('0xd1')],{'as':_0x047b('0x1c4'),'foreignKey':_0x047b('0x1be')});db[_0x047b('0xd1')][_0x047b('0x116')](db[_0x047b('0xd1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x047b('0xd1')]['hasMany'](db[_0x047b('0xd1')],{'as':_0x047b('0x1ca'),'foreignKey':_0x047b('0x1c0')});db[_0x047b('0xd1')][_0x047b('0x124')](db[_0x047b('0x1c5')],{'as':_0x047b('0x1c5'),'foreignKey':_0x047b('0x1c6')});db[_0x047b('0xd4')][_0x047b('0x124')](db[_0x047b('0x66')],{});db[_0x047b('0xd4')][_0x047b('0x124')](db[_0x047b('0x138')],{'as':_0x047b('0x168'),'foreignKey':'ListId'});db[_0x047b('0xd4')][_0x047b('0x124')](db[_0x047b('0x77')],{'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x16f')});db[_0x047b('0xd4')]['belongsTo'](db['ChatInteraction'],{});db[_0x047b('0xd4')][_0x047b('0x124')](db[_0x047b('0x191')],{});db['ChatQueueReport'][_0x047b('0x124')](db[_0x047b('0x12')],{});db[_0x047b('0xd4')][_0x047b('0x124')](db['ChatQueue'],{});db[_0x047b('0xd6')]['belongsTo'](db[_0x047b('0x12')],{'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1d1')});db[_0x047b('0xd6')][_0x047b('0x124')](db[_0x047b('0x12')],{'onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x1d2')});db[_0x047b('0xdc')][_0x047b('0x116')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0x047b('0x113')});db[_0x047b('0xdc')]['hasMany'](db[_0x047b('0xd8')],{'foreignKey':_0x047b('0x1d3'),'onDelete':_0x047b('0x113')});db[_0x047b('0xdd')][_0x047b('0x124')](db[_0x047b('0x58')],{});db[_0x047b('0xdd')][_0x047b('0x124')](db[_0x047b('0x138')],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169')});db['SmsQueueReport'][_0x047b('0x124')](db[_0x047b('0x77')],{'as':_0x047b('0x16e'),'foreignKey':_0x047b('0x16f')});db['SmsQueueReport'][_0x047b('0x124')](db[_0x047b('0x5b')],{});db['SmsQueueReport'][_0x047b('0x124')](db['SmsMessage'],{});db['SmsQueueReport']['belongsTo'](db[_0x047b('0x12')],{});db['SmsQueueReport'][_0x047b('0x124')](db[_0x047b('0x5f')],{});db[_0x047b('0xe2')][_0x047b('0x116')](db[_0x047b('0xdc')],{'foreignKey':_0x047b('0x1d4')});db['JscriptyProject'][_0x047b('0x116')](db[_0x047b('0xda')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x047b('0x116')](db['JscriptyAnswerReport'],{'foreignKey':_0x047b('0x1d4')});db[_0x047b('0x144')]['belongsToMany'](db[_0x047b('0x12')],{'as':_0x047b('0x174'),'through':_0x047b('0x146')});db[_0x047b('0xea')]['belongsToMany'](db['User'],{'as':_0x047b('0x157'),'through':'user_has_teams'});db['Team']['belongsToMany'](db[_0x047b('0x1c')],{'through':_0x047b('0x10e'),'as':'VoiceQueues'});db[_0x047b('0xea')][_0x047b('0x127')](db[_0x047b('0x43')],{'through':_0x047b('0x16b'),'as':_0x047b('0x133')});db['Team'][_0x047b('0x127')](db[_0x047b('0x70')],{'through':_0x047b('0x198'),'as':_0x047b('0x135')});db[_0x047b('0xea')][_0x047b('0x127')](db['FaxQueue'],{'through':_0x047b('0x180'),'as':_0x047b('0x136')});db['Team']['belongsToMany'](db[_0x047b('0x5f')],{'through':_0x047b('0x187'),'as':_0x047b('0x1d5')});db[_0x047b('0xea')][_0x047b('0x127')](db[_0x047b('0x65')],{'through':_0x047b('0x1d6'),'as':_0x047b('0x1d7')});db[_0x047b('0xea')][_0x047b('0x127')](db[_0x047b('0x10c')],{'through':'team_has_whatsapp_queues','as':_0x047b('0x137')});db[_0x047b('0xea')][_0x047b('0x127')](db['VoicePrefix'],{'through':_0x047b('0x10f'),'as':_0x047b('0x132')});db[_0x047b('0xed')][_0x047b('0x116')](db[_0x047b('0x79')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x047b('0xed')][_0x047b('0x116')](db[_0x047b('0x7b')],{'as':_0x047b('0x11a'),'foreignKey':'CampaignId'});db[_0x047b('0xed')][_0x047b('0x116')](db[_0x047b('0x7c')],{'as':'HopperHistories','foreignKey':_0x047b('0x1a2')});db[_0x047b('0xed')]['hasMany'](db[_0x047b('0x14f')],{'as':'HopperBlacks','foreignKey':_0x047b('0x1a2')});db[_0x047b('0xed')][_0x047b('0x124')](db[_0x047b('0x2d')],{'as':'Trunk','foreignKey':_0x047b('0x1d8')});db[_0x047b('0xed')][_0x047b('0x124')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db['Campaign'][_0x047b('0x124')](db[_0x047b('0x88')],{'as':_0x047b('0x88'),'foreignKey':_0x047b('0x153')});db[_0x047b('0xed')][_0x047b('0x124')](db[_0x047b('0x144')],{'as':_0x047b('0x144'),'foreignKey':_0x047b('0x1d9')});db['Campaign']['belongsToMany'](db[_0x047b('0x138')],{'as':_0x047b('0x12c'),'through':_0x047b('0x1da')});db['Campaign'][_0x047b('0x127')](db['CmList'],{'as':_0x047b('0x1db'),'through':_0x047b('0x1dc')});db['Attachment'][_0x047b('0x124')](db['ChatOfflineMessage'],{'as':_0x047b('0x6e'),'foreignKey':_0x047b('0x177')});db[_0x047b('0xf2')][_0x047b('0x124')](db['MailMessage'],{});db[_0x047b('0xf2')][_0x047b('0x124')](db[_0x047b('0x11f')],{});db[_0x047b('0xf2')]['belongsTo'](db[_0x047b('0x42')],{'foreignKey':_0x047b('0x1dd'),'as':_0x047b('0x1de')});db[_0x047b('0xf2')]['belongsTo'](db[_0x047b('0x12')],{'foreignKey':_0x047b('0x1df'),'as':'FromAgent'});db['MailTransferReport']['belongsTo'](db[_0x047b('0x12')],{'foreignKey':_0x047b('0x1e0'),'as':_0x047b('0x1e1')});db['MailTransferReport'][_0x047b('0x124')](db[_0x047b('0x43')],{'foreignKey':'ToMailQueueId','as':_0x047b('0x1e2')});db['MailTransferReport']['belongsTo'](db[_0x047b('0x42')],{'foreignKey':_0x047b('0x1e3'),'as':_0x047b('0x1e4')});db[_0x047b('0xf3')][_0x047b('0x124')](db['ChatMessage'],{});db[_0x047b('0xf3')][_0x047b('0x124')](db[_0x047b('0x6b')],{});db[_0x047b('0xf3')][_0x047b('0x124')](db['ChatWebsite'],{'foreignKey':_0x047b('0x1e5'),'as':_0x047b('0x1de')});db[_0x047b('0xf3')][_0x047b('0x124')](db['User'],{'foreignKey':_0x047b('0x1df'),'as':_0x047b('0x1e6')});db[_0x047b('0xf3')][_0x047b('0x124')](db[_0x047b('0x12')],{'foreignKey':_0x047b('0x1e0'),'as':_0x047b('0x1e1')});db[_0x047b('0xf3')]['belongsTo'](db[_0x047b('0x70')],{'foreignKey':_0x047b('0x1e7'),'as':_0x047b('0x1e2')});db[_0x047b('0xf3')]['belongsTo'](db[_0x047b('0x66')],{'foreignKey':_0x047b('0x1e8'),'as':_0x047b('0x1e4')});db[_0x047b('0xf5')][_0x047b('0x124')](db['FaxMessage'],{});db['FaxTransferReport'][_0x047b('0x124')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x047b('0x124')](db['FaxAccount'],{'foreignKey':_0x047b('0x1e9'),'as':'FromAccount'});db[_0x047b('0xf5')][_0x047b('0x124')](db['User'],{'foreignKey':_0x047b('0x1df'),'as':_0x047b('0x1e6')});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x047b('0x1e0'),'as':_0x047b('0x1e1')});db[_0x047b('0xf5')][_0x047b('0x124')](db[_0x047b('0x55')],{'foreignKey':_0x047b('0x1ea'),'as':'ToQueue'});db[_0x047b('0xf5')][_0x047b('0x124')](db['FaxAccount'],{'foreignKey':_0x047b('0x1eb'),'as':_0x047b('0x1e4')});db[_0x047b('0x1ec')][_0x047b('0x124')](db[_0x047b('0x18c')],{});db[_0x047b('0x1ec')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x047b('0x124')](db[_0x047b('0x60')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0x047b('0x1ec')]['belongsTo'](db[_0x047b('0x12')],{'foreignKey':'FromUserId','as':_0x047b('0x1e6')});db[_0x047b('0x1ec')][_0x047b('0x124')](db[_0x047b('0x12')],{'foreignKey':_0x047b('0x1e0'),'as':_0x047b('0x1e1')});db[_0x047b('0x1ec')][_0x047b('0x124')](db[_0x047b('0x65')],{'foreignKey':'ToOpenchannelQueueId','as':_0x047b('0x1e2')});db[_0x047b('0x1ec')][_0x047b('0x124')](db['OpenchannelAccount'],{'foreignKey':_0x047b('0x1ed'),'as':'ToAccount'});db[_0x047b('0xf7')]['belongsTo'](db['SmsMessage'],{});db[_0x047b('0xf7')][_0x047b('0x124')](db['SmsInteraction'],{});db['SmsTransferReport'][_0x047b('0x124')](db[_0x047b('0x58')],{'foreignKey':'FromSmsAccountId','as':_0x047b('0x1de')});db[_0x047b('0xf7')][_0x047b('0x124')](db[_0x047b('0x12')],{'foreignKey':_0x047b('0x1df'),'as':_0x047b('0x1e6')});db['SmsTransferReport'][_0x047b('0x124')](db[_0x047b('0x12')],{'foreignKey':_0x047b('0x1e0'),'as':_0x047b('0x1e1')});db[_0x047b('0xf7')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0x047b('0x1ee'),'as':_0x047b('0x1e2')});db[_0x047b('0xf7')][_0x047b('0x124')](db[_0x047b('0x58')],{'foreignKey':'ToSmsAccountId','as':_0x047b('0x1e4')});db[_0x047b('0x138')][_0x047b('0x116')](db['Disposition'],{'as':_0x047b('0x179'),'foreignKey':_0x047b('0x169'),'onDelete':_0x047b('0x113')});db['CmList']['hasMany'](db[_0x047b('0x1ef')],{'as':_0x047b('0x1f0'),'foreignKey':_0x047b('0x169')});db[_0x047b('0x138')][_0x047b('0x116')](db[_0x047b('0x77')],{'as':'Contacts','onDelete':_0x047b('0x113'),'foreignKey':_0x047b('0x169')});db[_0x047b('0x138')][_0x047b('0x116')](db[_0x047b('0x7b')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x047b('0x138')][_0x047b('0x116')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x047b('0x169')});db[_0x047b('0x138')][_0x047b('0x116')](db[_0x047b('0x7e')],{'as':_0x047b('0x7e'),'foreignKey':_0x047b('0x169')});db[_0x047b('0x138')]['belongsToMany'](db[_0x047b('0x1c')],{'as':'Queues','through':_0x047b('0x156')});db[_0x047b('0x138')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x047b('0xfa')][_0x047b('0x116')](db['VoiceExtension'],{'as':_0x047b('0x119'),'onDelete':'cascade'});db[_0x047b('0xfa')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':'Agents','through':_0x047b('0x1f1')});db[_0x047b('0xfa')][_0x047b('0x127')](db['Team'],{'through':'TeamVoicePrefix','as':_0x047b('0x158')});db[_0x047b('0x125')][_0x047b('0x116')](db['User'],{'as':'Users','foreignKey':_0x047b('0x126')});db[_0x047b('0x125')][_0x047b('0x116')](db[_0x047b('0xfd')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x047b('0x113')});db[_0x047b('0xfd')][_0x047b('0x116')](db[_0x047b('0xff')],{'as':'Resources','foreignKey':_0x047b('0x1f2'),'onDelete':_0x047b('0x113')});db[_0x047b('0x142')][_0x047b('0x116')](db[_0x047b('0x85')],{'as':'Dispositions','foreignKey':_0x047b('0x1f3'),'onDelete':_0x047b('0x113')});db[_0x047b('0x142')][_0x047b('0x116')](db[_0x047b('0x83')],{'as':_0x047b('0x164'),'foreignKey':_0x047b('0x1f3')});db[_0x047b('0x142')][_0x047b('0x116')](db[_0x047b('0x1f4')],{'as':_0x047b('0x166'),'foreignKey':_0x047b('0x1f3')});db[_0x047b('0x142')][_0x047b('0x116')](db[_0x047b('0x106')],{'as':_0x047b('0x167')});db[_0x047b('0x142')]['hasMany'](db[_0x047b('0x104')],{'as':'Applications'});db['WhatsappAccount'][_0x047b('0x124')](db[_0x047b('0x138')],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169')});db[_0x047b('0x142')][_0x047b('0x124')](db[_0x047b('0x8a')],{'as':_0x047b('0x154'),'foreignKey':_0x047b('0x155')});db[_0x047b('0x142')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':'Agents','through':_0x047b('0x1f5')});db[_0x047b('0x104')]['belongsTo'](db['User'],{'onDelete':_0x047b('0x161')});db[_0x047b('0x104')]['belongsTo'](db[_0x047b('0x10c')],{'onDelete':_0x047b('0x161')});db[_0x047b('0x104')][_0x047b('0x124')](db[_0x047b('0x142')],{'onDelete':_0x047b('0x161')});db['WhatsappApplication'][_0x047b('0x124')](db[_0x047b('0x88')],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x153')});db['WhatsappApplication'][_0x047b('0x124')](db[_0x047b('0x91')],{'onDelete':_0x047b('0x161'),'foreignKey':_0x047b('0x178')});db[_0x047b('0x106')]['hasMany'](db[_0x047b('0x1f4')],{'as':_0x047b('0x166'),'onDelete':'cascade','foreignKey':_0x047b('0x1f6')});db[_0x047b('0x106')][_0x047b('0x124')](db[_0x047b('0x142')],{'as':_0x047b('0x16d'),'foreignKey':_0x047b('0x1f3')});db[_0x047b('0x106')]['belongsTo'](db[_0x047b('0x77')],{'as':'Contact','foreignKey':_0x047b('0x16f')});db['WhatsappInteraction'][_0x047b('0x124')](db[_0x047b('0x12')],{'as':'Owner','foreignKey':_0x047b('0x114')});db[_0x047b('0x106')][_0x047b('0x127')](db[_0x047b('0x91')],{'through':_0x047b('0x1af'),'as':_0x047b('0x172')});db['WhatsappInteraction']['belongsToMany'](db[_0x047b('0x91')],{'through':_0x047b('0x1af'),'as':_0x047b('0x173')});db[_0x047b('0x106')][_0x047b('0x127')](db[_0x047b('0x12')],{'as':_0x047b('0x174'),'through':_0x047b('0x131'),'foreignKey':_0x047b('0x1f6')});db[_0x047b('0x1f4')][_0x047b('0x124')](db['User'],{'as':_0x047b('0x12')});db['WhatsappMessage'][_0x047b('0x124')](db[_0x047b('0x77')],{'onDelete':_0x047b('0x113'),'as':_0x047b('0x16e')});db['WhatsappMessage'][_0x047b('0x124')](db[_0x047b('0x106')],{'onDelete':_0x047b('0x113'),'as':'Interaction','foreignKey':_0x047b('0x1f6')});db['WhatsappMessage'][_0x047b('0x124')](db[_0x047b('0x142')],{'as':'Account','foreignKey':_0x047b('0x1f3')});db[_0x047b('0x108')][_0x047b('0x124')](db[_0x047b('0x142')],{});db['WhatsappQueueReport'][_0x047b('0x124')](db[_0x047b('0x138')],{'as':_0x047b('0x168'),'foreignKey':_0x047b('0x169')});db[_0x047b('0x108')][_0x047b('0x124')](db['CmContact'],{'as':_0x047b('0x16e'),'foreignKey':'ContactId'});db[_0x047b('0x108')][_0x047b('0x124')](db[_0x047b('0x106')],{});db[_0x047b('0x108')][_0x047b('0x124')](db[_0x047b('0x10c')],{});db[_0x047b('0x108')][_0x047b('0x124')](db['WhatsappMessage'],{});db[_0x047b('0x108')][_0x047b('0x124')](db['User'],{});db[_0x047b('0x10a')][_0x047b('0x124')](db[_0x047b('0x1f4')],{});db[_0x047b('0x10a')]['belongsTo'](db['WhatsappInteraction'],{});db[_0x047b('0x10a')]['belongsTo'](db[_0x047b('0x142')],{'foreignKey':_0x047b('0x1f7'),'as':_0x047b('0x1de')});db['WhatsappTransferReport'][_0x047b('0x124')](db[_0x047b('0x142')],{'foreignKey':_0x047b('0x1f8'),'as':_0x047b('0x1e4')});db[_0x047b('0x10a')][_0x047b('0x124')](db[_0x047b('0x10c')],{'foreignKey':_0x047b('0x1f9'),'as':'ToQueue'});db[_0x047b('0x10a')][_0x047b('0x124')](db[_0x047b('0x12')],{'foreignKey':'FromUserId','as':_0x047b('0x1e6')});db[_0x047b('0x10a')][_0x047b('0x124')](db[_0x047b('0x12')],{'foreignKey':_0x047b('0x1e0'),'as':'ToAgent'});db['WhatsappQueue'][_0x047b('0x127')](db['User'],{'as':_0x047b('0x157'),'through':'UserWhatsappQueue','foreignKey':_0x047b('0x1fa')});db['WhatsappQueue'][_0x047b('0x127')](db[_0x047b('0xea')],{'through':_0x047b('0x1fb'),'as':_0x047b('0x158')});db['UserSetting'][_0x047b('0x124')](db['User'],{'as':_0x047b('0x1fc'),'foreignKey':_0x047b('0x114'),'onDelete':_0x047b('0x113'),'hooks':!![]});db['CloudProvider'][_0x047b('0x112')](db[_0x047b('0xc9')],{'as':'Dynamics365Account','onDelete':_0x047b('0x161')});db[_0x047b('0x163')]['hasOne'](db[_0x047b('0x40')],{'as':_0x047b('0x1fd'),'onDelete':_0x047b('0x161')});db[_0x047b('0x163')][_0x047b('0x112')](db[_0x047b('0x41')],{'as':_0x047b('0x1fe'),'onDelete':_0x047b('0x161')});module[_0x047b('0x1ff')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x90ee=['MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','../api/automation/automation.model','CannedAnswer','Disposition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','userSetting','UserId','hasMany','Recordings','VoiceExtension','Extensions','CmHopperFinal','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_mail_interactions','user_has_chat_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueue','MailQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperFinals','HopperHistories','ReportAgentPreview','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Messages','Interactions','List','ListId','TemplateId','user_has_mail_accounts','team_has_mail_queues','Teams','MailInteractionId','Contact','ContactId','mail_interaction_has_tags','Tags','Users','Attachment','Attachments','Account','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','Items','FaxAccountId','Answers','Exntensions','mandatoryDispositionPause','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','ThroughTags','user_has_fax_interactions','Interaction','AttachmentId','FaxQueue','SmsAccountId','SmsApplication','SmsInteractionId','Owner','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','ChatQueueId','ChatMessage','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroup','Website','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','CmHopperId','Agent','Queue','Campaign','OwnerId','Automation','Condition','All','OneAll','AutomationAllId','Any','AutomationAnyId','Action','Actions','AutomationId','Intervals','MailApplications','ChatApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Sound','Mohs','whatsapp_interaction_has_tags','CmContactHasItem','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','FieldId','Subject','Description','Field','VariableId','Subjects','DescriptionId','DeskField','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','ServicenowAccount','ServicenowConfiguration','Dynamics365Account','Dynamics365Field','FromId','SessionId','JscriptyAnswerReport','ProjectId','JscriptyProject','user_has_teams','VoiceQueues','ChatQueues','team_has_fax_queues','team_has_whatsapp_queues','VoicePrefixes','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAgent','ToChatQueueId','FaxTransferReport','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappInteractionId','WhatsappAccountId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','exports','sequelize','lodash','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','utf8mb4','username','password','database','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model'];(function(_0x171fbe,_0x4d1824){var _0x12a5d2=function(_0x30852e){while(--_0x30852e){_0x171fbe['push'](_0x171fbe['shift']());}};_0x12a5d2(++_0x4d1824);}(_0x90ee,0x1c1));var _0xe90e=function(_0x50c16c,_0x43b99e){_0x50c16c=_0x50c16c-0x0;var _0x24dc5f=_0x90ee[_0x50c16c];return _0x24dc5f;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xe90e('0x0'));var _=require(_0xe90e('0x1'));var jstz=require('jstz');var timezone=jstz[_0xe90e('0x2')]();config[_0xe90e('0x0')]=_[_0xe90e('0x3')](config[_0xe90e('0x0')],{'database':_0xe90e('0x4'),'username':_0xe90e('0x5'),'password':'xC@LL1234','options':{'host':_0xe90e('0x6'),'port':0xcea,'dialect':_0xe90e('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xe90e('0x8'),'collate':_0xe90e('0x9')}}});config[_0xe90e('0xa')]=_[_0xe90e('0x3')](config[_0xe90e('0xa')],{'database':'motion2','username':_0xe90e('0x5'),'password':_0xe90e('0xb'),'options':{'host':_0xe90e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xe90e('0xc')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xe90e('0x8'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe90e('0x0')]['database'],config[_0xe90e('0x0')][_0xe90e('0xd')],config[_0xe90e('0x0')][_0xe90e('0xe')],config[_0xe90e('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe90e('0xa')][_0xe90e('0xf')],config['sequelizeHistory'][_0xe90e('0xd')],config[_0xe90e('0xa')]['password'],config[_0xe90e('0xa')]['options'])};db[_0xe90e('0x10')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x12'));db[_0xe90e('0x13')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x14'));db['VoiceContext']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x15'));db['VoiceExtension']=db['sequelize']['import'](_0xe90e('0x16'));db[_0xe90e('0x17')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x18'));db[_0xe90e('0x19')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x1a'));db[_0xe90e('0x1b')]=db['sequelize'][_0xe90e('0x11')]('../api/voiceRecording/voiceRecording.model');db[_0xe90e('0x1c')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x1d'));db[_0xe90e('0x1e')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x1f'));db[_0xe90e('0x20')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xe90e('0x21')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x22'));db['VoiceDialReport']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x23'));db[_0xe90e('0x24')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x25'));db['VoiceQueueReport']=db['sequelize'][_0xe90e('0x11')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x26'));db[_0xe90e('0x27')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x28'));db[_0xe90e('0x29')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x2a'));db[_0xe90e('0x2b')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x2c'));db[_0xe90e('0x2d')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x2e'));db[_0xe90e('0x2f')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x30'));db[_0xe90e('0x31')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x32'));db[_0xe90e('0x33')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x34'));db[_0xe90e('0x35')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x36'));db[_0xe90e('0x37')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xe90e('0x38')]=db['sequelize']['import'](_0xe90e('0x39'));db[_0xe90e('0x3a')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x3b'));db[_0xe90e('0x3c')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/mailServerOut/mailServerOut.model');db[_0xe90e('0x3d')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x3e'));db['MailQueue']=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x3f'));db[_0xe90e('0x40')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x41'));db[_0xe90e('0x42')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x43'));db[_0xe90e('0x44')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x45'));db[_0xe90e('0x46')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x47'));db[_0xe90e('0x48')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x49'));db['Dashboard']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x4a'));db[_0xe90e('0x4b')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/dashboardItem/dashboardItem.model');db[_0xe90e('0x4c')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x4d'));db[_0xe90e('0x4e')]=db['sequelize'][_0xe90e('0x11')]('../api/faxApplication/faxApplication.model');db[_0xe90e('0x4f')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x50'));db[_0xe90e('0x51')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x52'));db['FaxQueue']=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x53'));db[_0xe90e('0x54')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x55'));db['SmsAccount']=db['sequelize'][_0xe90e('0x11')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize']['import'](_0xe90e('0x56'));db[_0xe90e('0x57')]=db['sequelize']['import']('../api/smsInteraction/smsInteraction.model');db[_0xe90e('0x58')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x59'));db[_0xe90e('0x5a')]=db[_0xe90e('0x0')]['import']('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db['sequelize'][_0xe90e('0x11')]('../api/openchannelAccount/openchannelAccount.model');db[_0xe90e('0x5b')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x5c'));db[_0xe90e('0x5d')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x5e'));db[_0xe90e('0x5f')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x60'));db['OpenchannelQueue']=db[_0xe90e('0x0')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0xe90e('0x61')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x62'));db['OpenchannelQueueReport']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xe90e('0x63')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x64'));db[_0xe90e('0x65')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x66'));db['ChatMessage']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x67'));db['ChatOfflineMessage']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x68'));db[_0xe90e('0x69')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x6a'));db['ChatGroup']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x6b'));db[_0xe90e('0x6c')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x6d'));db[_0xe90e('0x6e')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x6f'));db[_0xe90e('0x70')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x71'));db[_0xe90e('0x72')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x73'));db[_0xe90e('0x74')]=db['sequelize'][_0xe90e('0x11')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x75'));db[_0xe90e('0x76')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x77'));db['Action']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x78'));db['Automation']=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x79'));db[_0xe90e('0x7a')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/cannedAnswer/cannedAnswer.model');db[_0xe90e('0x7b')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/disposition/disposition.model');db['Condition']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x7c'));db[_0xe90e('0x7d')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x7e'));db[_0xe90e('0x7f')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/pause/pause.model');db[_0xe90e('0x80')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/cdr/cdr.model');db[_0xe90e('0x81')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x82'));db['Schedule']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/schedule/schedule.model');db['Sound']=db['sequelize']['import'](_0xe90e('0x83'));db[_0xe90e('0x84')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x85'));db[_0xe90e('0x86')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x87'));db['CmContactHasItem']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x88'));db[_0xe90e('0x89')]=db['sequelize'][_0xe90e('0x11')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xe90e('0x8a')]=db['sequelize'][_0xe90e('0x11')]('../api/template/template.model');db[_0xe90e('0x8b')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/trigger/trigger.model');db[_0xe90e('0x8c')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x8d'));db[_0xe90e('0x8e')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x8f'));db[_0xe90e('0x90')]=db[_0xe90e('0x0')]['import'](_0xe90e('0x91'));db[_0xe90e('0x92')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x93'));db[_0xe90e('0x94')]=db['sequelize'][_0xe90e('0x11')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x95'));db['AnalyticMetric']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/analyticMetric/analyticMetric.model');db[_0xe90e('0x96')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x97'));db[_0xe90e('0x98')]=db['sequelize'][_0xe90e('0x11')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xe90e('0x99')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x9a'));db[_0xe90e('0x9b')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x9c'));db['SalesforceField']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x9d'));db[_0xe90e('0x9e')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0x9f'));db[_0xe90e('0xa0')]=db['sequelize'][_0xe90e('0x11')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xe90e('0xa1')]=db['sequelize']['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xe90e('0xa2')]=db['sequelize']['import'](_0xe90e('0xa3'));db[_0xe90e('0xa4')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/intDeskField/intDeskField.model');db[_0xe90e('0xa5')]=db['sequelize']['import'](_0xe90e('0xa6'));db[_0xe90e('0xa7')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xa8'));db[_0xe90e('0xa9')]=db['sequelize']['import'](_0xe90e('0xaa'));db[_0xe90e('0xab')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xac'));db[_0xe90e('0xad')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xae'));db[_0xe90e('0xaf')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/intZendeskField/intZendeskField.model');db[_0xe90e('0xb0')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xb1'));db[_0xe90e('0xb2')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xb3'));db[_0xe90e('0xb4')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xb5'));db[_0xe90e('0xb6')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xb7'));db['VtigerConfiguration']=db['sequelize'][_0xe90e('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xe90e('0x0')]['import']('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xe90e('0xb8')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xb9'));db['Dynamics365Account']=db['sequelize'][_0xe90e('0x11')](_0xe90e('0xba'));db[_0xe90e('0xbb')]=db['sequelize']['import'](_0xe90e('0xbc'));db['Dynamics365Field']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xe90e('0xbd')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xbe'));db[_0xe90e('0xbf')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xc0'));db[_0xe90e('0xc1')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xc2'));db[_0xe90e('0x8e')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/integration/integration.model');db[_0xe90e('0xc3')]=db['sequelize']['import'](_0xe90e('0xc4'));db[_0xe90e('0xc5')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xc6'));db[_0xe90e('0xc7')]=db['sequelize']['import'](_0xe90e('0xc8'));db['JscriptyAnswerReport']=db['sequelize'][_0xe90e('0x11')](_0xe90e('0xc9'));db[_0xe90e('0xca')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0xcb'));db['JscriptySessionReport']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xcc'));db[_0xe90e('0xcd')]=db[_0xe90e('0x0')]['import'](_0xe90e('0xce'));db[_0xe90e('0xcf')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xd0'));db[_0xe90e('0xd1')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0xd2'));db['JscriptyProject']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xd3'));db['Setting']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/setting/setting.model');db['SquareOdbc']=db['sequelize'][_0xe90e('0x11')]('../api/squareOdbc/squareOdbc.model');db[_0xe90e('0xd4')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xd5'));db['SquareRecording']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xd6'));db[_0xe90e('0xd7')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xd8'));db['Team']=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/team/team.model');db[_0xe90e('0xd9')]=db[_0xe90e('0x0')]['import'](_0xe90e('0xda'));db['Campaign']=db['sequelize'][_0xe90e('0x11')]('../api/campaign/campaign.model');db[_0xe90e('0xdb')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xdc'));db['Attachment']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xdd'));db['Plugin']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xde'));db[_0xe90e('0xdf')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0xe0'));db['ChatTransferReport']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xe1'));db['FaxTransferReport']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xe2'));db[_0xe90e('0xe3')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xe4'));db[_0xe90e('0xe5')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xe6'));db[_0xe90e('0xe7')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/cmList/cmList.model');db[_0xe90e('0xe8')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xe9'));db[_0xe90e('0xea')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xeb'));db[_0xe90e('0xec')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xed'));db[_0xe90e('0xee')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0xe90e('0x0')]['import']('../api/userNotification/userNotification.model');db[_0xe90e('0xef')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/whatsappAccount/whatsappAccount.model');db[_0xe90e('0xf0')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/whatsappApplication/whatsappApplication.model');db[_0xe90e('0xf1')]=db[_0xe90e('0x0')]['import'](_0xe90e('0xf2'));db[_0xe90e('0xf3')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xf4'));db['WhatsappQueueReport']=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xf5'));db[_0xe90e('0xf6')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0xf7'));db[_0xe90e('0xf8')]=db[_0xe90e('0x0')][_0xe90e('0x11')]('../api/whatsappQueue/whatsappQueue.model');db[_0xe90e('0xf9')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xfa'));db[_0xe90e('0xfb')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0xfc'));db[_0xe90e('0xfd')]=db['sequelize'][_0xe90e('0x11')](_0xe90e('0xfe'));db[_0xe90e('0xff')]=db[_0xe90e('0x0')]['import']('../api/userVoicePrefix/userVoicePrefix.model');db[_0xe90e('0x100')]=db[_0xe90e('0x0')][_0xe90e('0x11')](_0xe90e('0x101'));db[_0xe90e('0x10')][_0xe90e('0x102')](db[_0xe90e('0x1e')],{'as':_0xe90e('0x1e'),'onDelete':_0xe90e('0x103'),'foreignKey':'UserId'});db['User'][_0xe90e('0x102')](db[_0xe90e('0x100')],{'as':_0xe90e('0x104'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x10')][_0xe90e('0x106')](db[_0xe90e('0x1b')],{'as':_0xe90e('0x107'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x10')][_0xe90e('0x106')](db[_0xe90e('0x2b')],{'as':'VoiceQueuesRt','foreignKey':_0xe90e('0x105')});db[_0xe90e('0x10')][_0xe90e('0x106')](db[_0xe90e('0x108')],{'as':_0xe90e('0x109'),'onDelete':_0xe90e('0x103'),'hooks':!![]});db[_0xe90e('0x10')][_0xe90e('0x106')](db[_0xe90e('0x10a')],{'as':'HopperFinals','foreignKey':_0xe90e('0x105')});db[_0xe90e('0x10')]['hasMany'](db['CmHopperHistory'],{'as':_0xe90e('0x10b'),'foreignKey':_0xe90e('0x105')});db['User'][_0xe90e('0x106')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xe90e('0x105')});db[_0xe90e('0x10')][_0xe90e('0x106')](db[_0xe90e('0x5d')],{'as':_0xe90e('0x10c'),'foreignKey':_0xe90e('0x105')});db['User'][_0xe90e('0x106')](db['ChatInteraction'],{'as':_0xe90e('0x10d'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x10')]['hasMany'](db['SmsInteraction'],{'as':_0xe90e('0x10e'),'foreignKey':'UserId'});db[_0xe90e('0x10')][_0xe90e('0x106')](db['FaxInteraction'],{'as':_0xe90e('0x10f'),'foreignKey':_0xe90e('0x105')});db['User'][_0xe90e('0x106')](db[_0xe90e('0x42')],{'as':_0xe90e('0x110'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x10')][_0xe90e('0x106')](db['WhatsappInteraction'],{'as':_0xe90e('0x111'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x10')][_0xe90e('0x106')](db[_0xe90e('0x112')],{'as':_0xe90e('0x113'),'foreignKey':_0xe90e('0x114')});db[_0xe90e('0x10')][_0xe90e('0x115')](db[_0xe90e('0xea')],{'as':_0xe90e('0xea'),'foreignKey':_0xe90e('0x116')});db[_0xe90e('0x10')]['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':_0xe90e('0x117')});db['User'][_0xe90e('0x118')](db['CmContact'],{'as':_0xe90e('0x119'),'through':_0xe90e('0x11a')});db['User'][_0xe90e('0x118')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x11b'),'through':_0xe90e('0x11c')});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'through':'user_has_teams'});db[_0xe90e('0x10')]['belongsToMany'](db['MailInteraction'],{'as':'MailInteractions','through':_0xe90e('0x11e')});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0x65')],{'as':_0xe90e('0x10d'),'through':_0xe90e('0x11f')});db[_0xe90e('0x10')]['belongsToMany'](db[_0xe90e('0x4f')],{'as':_0xe90e('0x10f'),'through':'user_has_fax_interactions'});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0x57')],{'as':_0xe90e('0x10e'),'through':'user_has_sms_interactions'});db[_0xe90e('0x10')]['belongsToMany'](db[_0xe90e('0x5d')],{'as':_0xe90e('0x10c'),'through':_0xe90e('0x120')});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0xf1')],{'as':_0xe90e('0x111'),'through':_0xe90e('0x121')});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0x19')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db['User'][_0xe90e('0x118')](db[_0xe90e('0xe8')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0xe90e('0x10')]['belongsToMany'](db[_0xe90e('0x122')],{'as':_0xe90e('0x123'),'through':_0xe90e('0x31'),'required':![]});db['User'][_0xe90e('0x118')](db['ChatQueue'],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db['FaxQueue'],{'as':_0xe90e('0x124'),'through':_0xe90e('0x33'),'required':![]});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0x5a')],{'as':_0xe90e('0x125'),'through':'UserSmsQueue','required':![]});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0x126')],{'as':_0xe90e('0x127'),'through':_0xe90e('0x37'),'required':![]});db[_0xe90e('0x10')][_0xe90e('0x118')](db['WhatsappQueue'],{'as':_0xe90e('0x128'),'through':'UserWhatsappQueue','required':![]});db[_0xe90e('0x10')]['belongsToMany'](db[_0xe90e('0xe7')],{'through':_0xe90e('0x11c')});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0x61')],{'as':_0xe90e('0x129'),'through':_0xe90e('0x12a')});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0x4c')],{'as':_0xe90e('0x12b'),'through':'user_has_fax_accounts'});db['User'][_0xe90e('0x118')](db[_0xe90e('0x3d')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0xe90e('0x10')][_0xe90e('0x118')](db['OpenchannelAccount'],{'as':_0xe90e('0x12c'),'through':_0xe90e('0x12d')});db[_0xe90e('0x10')]['belongsToMany'](db[_0xe90e('0x12e')],{'as':'SmsAccounts','through':_0xe90e('0x12f')});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0xef')],{'as':_0xe90e('0x130'),'through':_0xe90e('0x131')});db[_0xe90e('0x10')][_0xe90e('0x118')](db[_0xe90e('0xd4')],{'as':_0xe90e('0x132'),'through':_0xe90e('0x133')});db[_0xe90e('0x13')][_0xe90e('0x106')](db['VoiceExtension'],{'as':_0xe90e('0x134'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x135')});db[_0xe90e('0x136')]['hasMany'](db[_0xe90e('0x108')],{'onDelete':'cascade'});db[_0xe90e('0x108')][_0xe90e('0x106')](db[_0xe90e('0x108')],{'as':_0xe90e('0x137'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x17')][_0xe90e('0x118')](db['Sound'],{'as':_0xe90e('0x138'),'through':_0xe90e('0x139')});db[_0xe90e('0x19')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xe90e('0x13a'),'foreignKey':_0xe90e('0x13b')});db[_0xe90e('0x19')][_0xe90e('0x106')](db[_0xe90e('0x13c')],{'as':_0xe90e('0x13d'),'foreignKey':_0xe90e('0x13b')});db[_0xe90e('0x19')]['hasMany'](db[_0xe90e('0x10a')],{'as':_0xe90e('0x13e'),'foreignKey':_0xe90e('0x13b')});db[_0xe90e('0x19')][_0xe90e('0x106')](db[_0xe90e('0x74')],{'as':_0xe90e('0x13f'),'foreignKey':_0xe90e('0x13b')});db['VoiceQueue'][_0xe90e('0x106')](db['ReportAgentPreview'],{'as':_0xe90e('0x140'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xe90e('0x106')](db[_0xe90e('0x72')],{'as':_0xe90e('0x141'),'foreignKey':_0xe90e('0x13b')});db[_0xe90e('0x19')][_0xe90e('0x106')](db[_0xe90e('0x142')],{'as':_0xe90e('0x143'),'foreignKey':_0xe90e('0x13b')});db['VoiceQueue'][_0xe90e('0x115')](db[_0xe90e('0x27')],{'as':_0xe90e('0x27'),'foreignKey':_0xe90e('0x144')});db[_0xe90e('0x19')][_0xe90e('0x115')](db[_0xe90e('0x27')],{'as':_0xe90e('0x145'),'foreignKey':_0xe90e('0x146')});db[_0xe90e('0x19')][_0xe90e('0x115')](db[_0xe90e('0x7d')],{'as':_0xe90e('0x7d'),'foreignKey':_0xe90e('0x147')});db[_0xe90e('0x19')][_0xe90e('0x115')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe90e('0x148')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0xe90e('0x11b'),'through':_0xe90e('0x149')});db[_0xe90e('0x19')][_0xe90e('0x118')](db['User'],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x2d')});db[_0xe90e('0x19')][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'as':'Teams','through':'TeamVoiceQueue'});db['VoiceQueue'][_0xe90e('0x118')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x14b'),'through':'voice_queues_has_cm_blacklists'});db[_0xe90e('0x1b')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':_0xe90e('0x10'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x1c')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':_0xe90e('0x10'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x1e')][_0xe90e('0x106')](db[_0xe90e('0x20')],{'as':'Messages','onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x14c'),'sourceKey':_0xe90e('0x14d')});db[_0xe90e('0x20')][_0xe90e('0x115')](db[_0xe90e('0x1e')],{'foreignKey':_0xe90e('0x14c'),'targetKey':_0xe90e('0x14d')});db[_0xe90e('0x21')][_0xe90e('0x106')](db[_0xe90e('0x14e')],{'as':_0xe90e('0x14f'),'foreignKey':_0xe90e('0x150'),'constraints':![]});db['VoiceCallReport'][_0xe90e('0x106')](db[_0xe90e('0x24')],{'as':_0xe90e('0x151'),'foreignKey':_0xe90e('0x150'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xe90e('0x10')],{'as':_0xe90e('0x10'),'foreignKey':_0xe90e('0x105')});db['VoiceCallReport'][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0xe90e('0x3a')]['belongsTo'](db[_0xe90e('0x3d')],{'as':_0xe90e('0x3d'),'foreignKey':_0xe90e('0x152')});db[_0xe90e('0x3a')][_0xe90e('0x115')](db[_0xe90e('0xf9')],{'as':_0xe90e('0xf9'),'foreignKey':_0xe90e('0x153'),'onDelete':_0xe90e('0x154')});db['MailServerOut'][_0xe90e('0x115')](db[_0xe90e('0x3d')],{'as':_0xe90e('0x3d'),'foreignKey':_0xe90e('0x152')});db[_0xe90e('0x3c')][_0xe90e('0x115')](db[_0xe90e('0xf9')],{'as':_0xe90e('0xf9'),'foreignKey':_0xe90e('0x153'),'onDelete':_0xe90e('0x154')});db[_0xe90e('0x3d')][_0xe90e('0x102')](db['MailServerIn'],{'as':_0xe90e('0x155'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x3d')][_0xe90e('0x102')](db[_0xe90e('0x3c')],{'as':_0xe90e('0x156'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x3d')][_0xe90e('0x106')](db['Disposition'],{'as':_0xe90e('0x157'),'foreignKey':_0xe90e('0x152'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x3d')][_0xe90e('0x106')](db[_0xe90e('0x7a')],{'as':'Answers','foreignKey':_0xe90e('0x152')});db['MailAccount']['hasMany'](db[_0xe90e('0x44')],{'as':_0xe90e('0x158'),'foreignKey':_0xe90e('0x152')});db[_0xe90e('0x3d')][_0xe90e('0x106')](db['MailInteraction'],{'as':_0xe90e('0x159')});db[_0xe90e('0x3d')][_0xe90e('0x106')](db[_0xe90e('0x46')],{'as':_0xe90e('0x137')});db['MailAccount'][_0xe90e('0x115')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b')});db[_0xe90e('0x3d')][_0xe90e('0x115')](db['Template'],{'as':_0xe90e('0x8a'),'foreignKey':_0xe90e('0x15c')});db['MailAccount'][_0xe90e('0x115')](db[_0xe90e('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0xe90e('0x118')](db['User'],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x15d')});db['MailQueue']['belongsToMany'](db['User'],{'as':'Agents','through':_0xe90e('0x31')});db[_0xe90e('0x122')][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'through':_0xe90e('0x15e'),'as':_0xe90e('0x15f')});db[_0xe90e('0x42')]['hasMany'](db[_0xe90e('0x44')],{'as':_0xe90e('0x158'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x160')});db['MailInteraction'][_0xe90e('0x115')](db[_0xe90e('0x3d')],{'as':'Account','foreignKey':_0xe90e('0x152')});db[_0xe90e('0x42')][_0xe90e('0x115')](db['CmContact'],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db[_0xe90e('0x42')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':'Owner','foreignKey':_0xe90e('0x105')});db[_0xe90e('0x42')][_0xe90e('0x118')](db[_0xe90e('0x84')],{'through':_0xe90e('0x163'),'as':_0xe90e('0x164')});db['MailInteraction'][_0xe90e('0x118')](db['Tag'],{'through':_0xe90e('0x163'),'as':'ThroughTags'});db[_0xe90e('0x42')]['belongsToMany'](db['User'],{'as':_0xe90e('0x165'),'through':_0xe90e('0x11e'),'foreignKey':'MailInteractionId'});db[_0xe90e('0x44')]['hasMany'](db[_0xe90e('0x166')],{'as':_0xe90e('0x167'),'onDelete':'cascade'});db['MailMessage'][_0xe90e('0x115')](db['User'],{'as':'User'});db[_0xe90e('0x44')][_0xe90e('0x115')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db['MailMessage'][_0xe90e('0x115')](db[_0xe90e('0x42')],{'as':'Interaction','foreignKey':_0xe90e('0x160')});db['MailMessage'][_0xe90e('0x115')](db[_0xe90e('0x3d')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x152')});db['MailMessage'][_0xe90e('0x115')](db[_0xe90e('0x61')],{'as':'ChatWebsite','foreignKey':_0xe90e('0x169')});db[_0xe90e('0x44')][_0xe90e('0x115')](db[_0xe90e('0x16a')],{'as':_0xe90e('0x16a'),'foreignKey':_0xe90e('0x16b')});db[_0xe90e('0x46')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'onDelete':'restrict'});db[_0xe90e('0x46')][_0xe90e('0x115')](db['MailQueue'],{'onDelete':_0xe90e('0x154')});db[_0xe90e('0x46')][_0xe90e('0x115')](db['MailAccount'],{'onDelete':_0xe90e('0x154')});db[_0xe90e('0x46')][_0xe90e('0x115')](db[_0xe90e('0x7d')],{'onDelete':_0xe90e('0x154'),'foreignKey':_0xe90e('0x147')});db['MailApplication'][_0xe90e('0x115')](db[_0xe90e('0x84')],{'onDelete':_0xe90e('0x154'),'foreignKey':_0xe90e('0x16c')});db[_0xe90e('0x48')]['belongsTo'](db['MailAccount'],{});db[_0xe90e('0x48')][_0xe90e('0x115')](db['CmList'],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b')});db[_0xe90e('0x48')][_0xe90e('0x115')](db['CmContact'],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db[_0xe90e('0x48')][_0xe90e('0x115')](db[_0xe90e('0x42')],{});db[_0xe90e('0x48')][_0xe90e('0x115')](db[_0xe90e('0x44')],{});db[_0xe90e('0x48')][_0xe90e('0x115')](db[_0xe90e('0x10')],{});db[_0xe90e('0x48')][_0xe90e('0x115')](db[_0xe90e('0x122')],{});db['Dashboard'][_0xe90e('0x106')](db['DashboardItem'],{'as':_0xe90e('0x16d'),'onDelete':_0xe90e('0x103')});db['FaxAccount'][_0xe90e('0x106')](db[_0xe90e('0x7b')],{'as':'Dispositions','foreignKey':_0xe90e('0x16e'),'onDelete':'cascade'});db[_0xe90e('0x4c')]['hasMany'](db[_0xe90e('0x7a')],{'as':_0xe90e('0x16f'),'foreignKey':_0xe90e('0x16e')});db[_0xe90e('0x4c')][_0xe90e('0x106')](db[_0xe90e('0x4f')],{'as':'Interactions'});db[_0xe90e('0x4c')][_0xe90e('0x106')](db[_0xe90e('0x4e')],{'as':_0xe90e('0x137')});db[_0xe90e('0x4c')][_0xe90e('0x106')](db['VoiceExtension'],{'as':_0xe90e('0x170'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x4c')][_0xe90e('0x106')](db[_0xe90e('0x51')],{'as':_0xe90e('0x158')});db['FaxAccount']['belongsTo'](db[_0xe90e('0x27')],{'as':_0xe90e('0x27')});db[_0xe90e('0x4c')]['belongsTo'](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b')});db[_0xe90e('0x4c')][_0xe90e('0x115')](db[_0xe90e('0x7f')],{'as':_0xe90e('0x171'),'foreignKey':_0xe90e('0x148')});db[_0xe90e('0x4c')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x172')});db[_0xe90e('0x4e')]['belongsTo'](db[_0xe90e('0x10')],{'onDelete':'restrict'});db[_0xe90e('0x4e')]['belongsTo'](db['FaxQueue'],{'onDelete':_0xe90e('0x154')});db[_0xe90e('0x4e')][_0xe90e('0x115')](db[_0xe90e('0x4c')],{'onDelete':_0xe90e('0x154')});db[_0xe90e('0x4e')][_0xe90e('0x115')](db[_0xe90e('0x84')],{'onDelete':_0xe90e('0x154'),'foreignKey':'TagId'});db[_0xe90e('0x4f')][_0xe90e('0x106')](db['FaxMessage'],{'as':_0xe90e('0x158'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x173')});db[_0xe90e('0x4f')]['belongsTo'](db[_0xe90e('0x4c')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x16e')});db[_0xe90e('0x4f')]['belongsTo'](db['CmContact'],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db['FaxInteraction'][_0xe90e('0x115')](db['User'],{'as':'Owner','foreignKey':_0xe90e('0x105')});db['FaxInteraction'][_0xe90e('0x118')](db[_0xe90e('0x84')],{'through':_0xe90e('0x174'),'as':_0xe90e('0x164')});db[_0xe90e('0x4f')][_0xe90e('0x118')](db[_0xe90e('0x84')],{'through':_0xe90e('0x174'),'as':_0xe90e('0x175')});db[_0xe90e('0x4f')]['belongsToMany'](db['User'],{'as':_0xe90e('0x165'),'through':_0xe90e('0x176'),'foreignKey':_0xe90e('0x173')});db[_0xe90e('0x51')]['belongsTo'](db[_0xe90e('0x10')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x10')});db['FaxMessage'][_0xe90e('0x115')](db['FaxInteraction'],{'as':_0xe90e('0x177'),'foreignKey':'FaxInteractionId'});db[_0xe90e('0x51')]['belongsTo'](db[_0xe90e('0x70')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x161')});db[_0xe90e('0x51')][_0xe90e('0x115')](db[_0xe90e('0x166')],{'as':_0xe90e('0x166'),'foreignKey':_0xe90e('0x178')});db['FaxMessage'][_0xe90e('0x115')](db[_0xe90e('0x4c')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxQueue'][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':'UserFaxQueue'});db['FaxQueue'][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'through':'team_has_fax_queues','as':_0xe90e('0x15f')});db['FaxQueueReport'][_0xe90e('0x115')](db['FaxAccount'],{});db[_0xe90e('0x54')]['belongsTo'](db['CmList'],{'as':_0xe90e('0x15a'),'foreignKey':'ListId'});db[_0xe90e('0x54')]['belongsTo'](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0xe90e('0x4f')],{});db[_0xe90e('0x54')][_0xe90e('0x115')](db['FaxMessage'],{});db[_0xe90e('0x54')][_0xe90e('0x115')](db[_0xe90e('0x10')],{});db['FaxQueueReport'][_0xe90e('0x115')](db[_0xe90e('0x179')],{});db[_0xe90e('0x12e')][_0xe90e('0x106')](db['Disposition'],{'as':_0xe90e('0x157'),'foreignKey':_0xe90e('0x17a'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0xe90e('0x7a')],{'as':_0xe90e('0x16f'),'foreignKey':_0xe90e('0x17a')});db['SmsAccount'][_0xe90e('0x106')](db[_0xe90e('0x58')],{'as':_0xe90e('0x158'),'foreignKey':_0xe90e('0x17a')});db['SmsAccount']['hasMany'](db[_0xe90e('0x57')],{'as':_0xe90e('0x159')});db[_0xe90e('0x12e')][_0xe90e('0x106')](db[_0xe90e('0x17b')],{'as':_0xe90e('0x137')});db[_0xe90e('0x12e')]['belongsTo'](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b')});db['SmsAccount'][_0xe90e('0x115')](db['Pause'],{'as':_0xe90e('0x171'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe90e('0x12e')]['belongsToMany'](db[_0xe90e('0x10')],{'as':'Agents','through':_0xe90e('0x12f')});db[_0xe90e('0x17b')]['belongsTo'](db['User'],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db[_0xe90e('0x5a')],{'onDelete':_0xe90e('0x154')});db[_0xe90e('0x17b')][_0xe90e('0x115')](db[_0xe90e('0x12e')],{'onDelete':_0xe90e('0x154')});db[_0xe90e('0x17b')]['belongsTo'](db[_0xe90e('0x7d')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xe90e('0x17b')][_0xe90e('0x115')](db['Tag'],{'onDelete':_0xe90e('0x154'),'foreignKey':'TagId'});db[_0xe90e('0x57')][_0xe90e('0x106')](db[_0xe90e('0x58')],{'as':_0xe90e('0x158'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x17c')});db[_0xe90e('0x57')]['belongsTo'](db[_0xe90e('0x12e')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x17a')});db['SmsInteraction']['belongsTo'](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':'ContactId'});db[_0xe90e('0x57')][_0xe90e('0x115')](db['User'],{'as':_0xe90e('0x17d'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x57')][_0xe90e('0x118')](db['Tag'],{'through':_0xe90e('0x17e'),'as':_0xe90e('0x164')});db[_0xe90e('0x57')][_0xe90e('0x118')](db[_0xe90e('0x84')],{'through':_0xe90e('0x17e'),'as':_0xe90e('0x175')});db['SmsInteraction']['belongsToMany'](db[_0xe90e('0x10')],{'as':_0xe90e('0x165'),'through':_0xe90e('0x17f'),'foreignKey':_0xe90e('0x17c')});db[_0xe90e('0x58')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':_0xe90e('0x10')});db[_0xe90e('0x58')]['belongsTo'](db[_0xe90e('0x70')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x161')});db['SmsMessage']['belongsTo'](db[_0xe90e('0x57')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x177'),'foreignKey':_0xe90e('0x17c')});db[_0xe90e('0x58')][_0xe90e('0x115')](db[_0xe90e('0x12e')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x17a')});db[_0xe90e('0x5a')][_0xe90e('0x118')](db['User'],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x35'),'foreignKey':_0xe90e('0x180')});db[_0xe90e('0x5a')][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'through':_0xe90e('0x181'),'as':_0xe90e('0x15f')});db[_0xe90e('0x182')][_0xe90e('0x106')](db[_0xe90e('0x7b')],{'as':_0xe90e('0x157'),'foreignKey':_0xe90e('0x183'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x182')][_0xe90e('0x106')](db[_0xe90e('0x7a')],{'as':_0xe90e('0x16f'),'foreignKey':_0xe90e('0x183')});db['OpenchannelAccount'][_0xe90e('0x106')](db['OpenchannelInteraction'],{'as':_0xe90e('0x159'),'foreignKey':_0xe90e('0x183')});db[_0xe90e('0x182')][_0xe90e('0x106')](db[_0xe90e('0x5f')],{'as':'Messages','foreignKey':_0xe90e('0x183')});db[_0xe90e('0x182')][_0xe90e('0x106')](db['OpenchannelApplication'],{'as':_0xe90e('0x137'),'foreignKey':_0xe90e('0x183')});db[_0xe90e('0x182')]['belongsTo'](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b')});db['OpenchannelAccount']['belongsTo'](db[_0xe90e('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xe90e('0x182')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':'user_has_openchannel_accounts'});db[_0xe90e('0x5b')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'onDelete':_0xe90e('0x154')});db[_0xe90e('0x5b')][_0xe90e('0x115')](db[_0xe90e('0x126')],{'onDelete':_0xe90e('0x154'),'foreignKey':_0xe90e('0x184')});db[_0xe90e('0x5b')][_0xe90e('0x115')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xe90e('0x5b')][_0xe90e('0x115')](db[_0xe90e('0x7d')],{'onDelete':'restrict','foreignKey':_0xe90e('0x147')});db[_0xe90e('0x5b')][_0xe90e('0x115')](db[_0xe90e('0x84')],{'onDelete':'restrict','foreignKey':_0xe90e('0x16c')});db[_0xe90e('0x5d')][_0xe90e('0x106')](db[_0xe90e('0x5f')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe90e('0x185')});db[_0xe90e('0x5d')][_0xe90e('0x115')](db[_0xe90e('0x182')],{'as':_0xe90e('0x168'),'foreignKey':'OpenchannelAccountId'});db[_0xe90e('0x5d')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db[_0xe90e('0x5d')]['belongsTo'](db[_0xe90e('0x10')],{'as':_0xe90e('0x17d'),'foreignKey':'UserId'});db[_0xe90e('0x5d')][_0xe90e('0x118')](db[_0xe90e('0x84')],{'through':'openchannel_interaction_has_tags','as':_0xe90e('0x164')});db[_0xe90e('0x5d')][_0xe90e('0x118')](db[_0xe90e('0x84')],{'through':'openchannel_interaction_has_tags','as':_0xe90e('0x175')});db[_0xe90e('0x5d')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x165'),'through':_0xe90e('0x120'),'foreignKey':'OpenchannelInteractionId'});db[_0xe90e('0x5f')]['belongsTo'](db[_0xe90e('0x10')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x10')});db['OpenchannelMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x161')});db[_0xe90e('0x5f')]['belongsTo'](db[_0xe90e('0x5d')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x177'),'foreignKey':_0xe90e('0x185')});db[_0xe90e('0x5f')]['belongsTo'](db[_0xe90e('0x166')],{'as':'Attachment','foreignKey':_0xe90e('0x178')});db[_0xe90e('0x5f')][_0xe90e('0x115')](db[_0xe90e('0x182')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x183')});db[_0xe90e('0x126')]['belongsToMany'](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x37'),'foreignKey':_0xe90e('0x184')});db[_0xe90e('0x126')][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'through':_0xe90e('0x186'),'as':_0xe90e('0x15f')});db[_0xe90e('0x61')][_0xe90e('0x106')](db[_0xe90e('0x7b')],{'as':'Dispositions','foreignKey':_0xe90e('0x169'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x61')][_0xe90e('0x106')](db['CannedAnswer'],{'as':_0xe90e('0x16f'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite']['hasMany'](db[_0xe90e('0x6c')],{'as':_0xe90e('0x187')});db[_0xe90e('0x61')][_0xe90e('0x106')](db[_0xe90e('0x65')],{'as':_0xe90e('0x159')});db['ChatWebsite']['hasMany'](db[_0xe90e('0x63')],{'as':_0xe90e('0x137')});db[_0xe90e('0x61')][_0xe90e('0x106')](db['ChatMessage'],{'as':_0xe90e('0x158')});db['ChatWebsite']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xe90e('0x15b')});db['ChatWebsite'][_0xe90e('0x115')](db['Interval'],{'as':_0xe90e('0x7d'),'foreignKey':'IntervalId'});db[_0xe90e('0x61')][_0xe90e('0x115')](db[_0xe90e('0x3d')],{'as':_0xe90e('0x3d'),'foreignKey':_0xe90e('0x152')});db[_0xe90e('0x61')][_0xe90e('0x115')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe90e('0x148')});db['ChatWebsite'][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x12a')});db[_0xe90e('0x188')][_0xe90e('0x115')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0xe90e('0x115')](db[_0xe90e('0xe7')],{'as':'List','foreignKey':_0xe90e('0x15b')});db[_0xe90e('0x188')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':'Contact','foreignKey':_0xe90e('0x162')});db[_0xe90e('0x188')][_0xe90e('0x115')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xe90e('0x115')](db[_0xe90e('0x5f')],{});db[_0xe90e('0x188')][_0xe90e('0x115')](db[_0xe90e('0x10')],{});db['OpenchannelQueueReport'][_0xe90e('0x115')](db[_0xe90e('0x126')],{});db[_0xe90e('0x63')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':'Agent','foreignKey':_0xe90e('0x105'),'onDelete':_0xe90e('0x154')});db[_0xe90e('0x63')][_0xe90e('0x115')](db[_0xe90e('0x69')],{'as':'Queue','foreignKey':_0xe90e('0x189'),'onDelete':'restrict'});db[_0xe90e('0x63')][_0xe90e('0x115')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xe90e('0x169'),'onDelete':'restrict'});db[_0xe90e('0x63')]['belongsTo'](db[_0xe90e('0x84')],{'onDelete':'restrict','foreignKey':_0xe90e('0x16c')});db[_0xe90e('0x65')][_0xe90e('0x106')](db[_0xe90e('0x18a')],{'as':_0xe90e('0x158'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0xe90e('0x65')][_0xe90e('0x115')](db[_0xe90e('0x61')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x169')});db[_0xe90e('0x65')]['belongsTo'](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':'ContactId'});db['ChatInteraction'][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':_0xe90e('0x17d'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x65')]['belongsToMany'](db[_0xe90e('0x84')],{'through':'chat_interaction_has_tags','as':_0xe90e('0x164')});db[_0xe90e('0x65')]['belongsToMany'](db['Tag'],{'through':_0xe90e('0x18b'),'as':_0xe90e('0x175')});db[_0xe90e('0x65')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x165'),'through':_0xe90e('0x11f'),'foreignKey':_0xe90e('0x18c')});db['ChatMessage'][_0xe90e('0x115')](db[_0xe90e('0x10')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x10')});db[_0xe90e('0x18a')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'onDelete':_0xe90e('0x103'),'as':'Contact','foreignKey':_0xe90e('0x162')});db['ChatMessage'][_0xe90e('0x115')](db[_0xe90e('0x65')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x177'),'foreignKey':_0xe90e('0x18c')});db['ChatMessage']['belongsTo'](db[_0xe90e('0x166')],{'as':_0xe90e('0x166'),'foreignKey':_0xe90e('0x178')});db[_0xe90e('0x18a')]['belongsTo'](db['ChatWebsite'],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x169')});db[_0xe90e('0x16a')]['hasMany'](db[_0xe90e('0x166')],{'as':_0xe90e('0x167'),'foreignKey':_0xe90e('0x16b'),'onDelete':_0xe90e('0x103'),'hooks':!![]});db[_0xe90e('0x16a')]['belongsTo'](db['CmContact'],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db[_0xe90e('0x16a')]['belongsTo'](db[_0xe90e('0x61')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x169')});db[_0xe90e('0x69')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':'Agents','through':_0xe90e('0x2f'),'hooks':!![]});db[_0xe90e('0x69')][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'through':_0xe90e('0x18d'),'as':_0xe90e('0x15f')});db[_0xe90e('0x18e')]['hasMany'](db[_0xe90e('0xc7')],{'as':_0xe90e('0x158'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xe90e('0x18e')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':'Members','through':_0xe90e('0x117')});db[_0xe90e('0x6c')]['belongsTo'](db['ChatWebsite'],{'as':_0xe90e('0x18f'),'foreignKey':_0xe90e('0x169')});db[_0xe90e('0x6e')][_0xe90e('0x106')](db[_0xe90e('0x70')],{'as':_0xe90e('0x119'),'foreignKey':_0xe90e('0x190')});db['CmContact'][_0xe90e('0x106')](db['CmContactHasItem'],{'as':_0xe90e('0x191'),'foreignKey':_0xe90e('0x192')});db[_0xe90e('0x70')][_0xe90e('0x106')](db['CmHopper'],{'as':_0xe90e('0x13d'),'foreignKey':'ContactId'});db[_0xe90e('0x70')][_0xe90e('0x106')](db[_0xe90e('0x10a')],{'as':_0xe90e('0x13e'),'foreignKey':_0xe90e('0x162')});db[_0xe90e('0x70')][_0xe90e('0x106')](db[_0xe90e('0x74')],{'as':_0xe90e('0x13f'),'foreignKey':_0xe90e('0x162')});db[_0xe90e('0x70')][_0xe90e('0x106')](db[_0xe90e('0x140')],{'as':_0xe90e('0x140'),'foreignKey':_0xe90e('0x162')});db['CmContact'][_0xe90e('0x106')](db['JscriptySessionReport'],{'as':_0xe90e('0x143'),'foreignKey':_0xe90e('0x162')});db[_0xe90e('0x70')][_0xe90e('0x106')](db[_0xe90e('0x5d')],{'as':_0xe90e('0x10c'),'foreignKey':_0xe90e('0x162'),'onDelete':_0xe90e('0x154')});db[_0xe90e('0x70')][_0xe90e('0x106')](db['ChatInteraction'],{'as':_0xe90e('0x10d'),'foreignKey':_0xe90e('0x162'),'onDelete':'restrict'});db['CmContact']['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xe90e('0x162'),'onDelete':'restrict'});db[_0xe90e('0x70')][_0xe90e('0x106')](db['FaxInteraction'],{'as':_0xe90e('0x10f'),'foreignKey':_0xe90e('0x162'),'onDelete':_0xe90e('0x154')});db[_0xe90e('0x70')][_0xe90e('0x106')](db[_0xe90e('0x42')],{'as':_0xe90e('0x110'),'foreignKey':_0xe90e('0x162'),'onDelete':_0xe90e('0x154')});db[_0xe90e('0x70')][_0xe90e('0x115')](db[_0xe90e('0x6e')],{'as':_0xe90e('0x193'),'foreignKey':_0xe90e('0x190')});db[_0xe90e('0x70')][_0xe90e('0x115')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b'),'onDelete':_0xe90e('0x103')});db['CmContact'][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x165'),'through':'cm_user_has_contacts'});db[_0xe90e('0x70')][_0xe90e('0x118')](db['Tag'],{'as':_0xe90e('0x164'),'through':_0xe90e('0x194')});db[_0xe90e('0x70')][_0xe90e('0x118')](db['Tag'],{'through':'cm_contact_has_tags','as':_0xe90e('0x175')});db[_0xe90e('0x13c')][_0xe90e('0x106')](db[_0xe90e('0x89')],{'as':'AdditionalPhones','foreignKey':_0xe90e('0x195')});db['CmHopper'][_0xe90e('0x115')](db['CmContact'],{'as':'Contact','foreignKey':_0xe90e('0x162'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x13c')][_0xe90e('0x115')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':'ListId','onDelete':_0xe90e('0x103')});db[_0xe90e('0x13c')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':_0xe90e('0x196'),'foreignKey':_0xe90e('0x105')});db[_0xe90e('0x13c')][_0xe90e('0x115')](db[_0xe90e('0x19')],{'as':_0xe90e('0x197'),'foreignKey':_0xe90e('0x13b'),'onDelete':'cascade'});db[_0xe90e('0x13c')][_0xe90e('0x115')](db[_0xe90e('0x198')],{'as':_0xe90e('0x198'),'foreignKey':'CampaignId','onDelete':_0xe90e('0x103')});db[_0xe90e('0x13c')][_0xe90e('0x115')](db['User'],{'as':_0xe90e('0x17d'),'foreignKey':_0xe90e('0x199')});db[_0xe90e('0x72')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':'Contact','foreignKey':_0xe90e('0x162'),'onDelete':_0xe90e('0x103')});db[_0xe90e('0x72')]['belongsTo'](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b'),'onDelete':_0xe90e('0x103')});db['CmHopperBlack']['belongsTo'](db[_0xe90e('0x19')],{'as':_0xe90e('0x197'),'foreignKey':_0xe90e('0x13b'),'onDelete':_0xe90e('0x103')});db['CmHopperBlack'][_0xe90e('0x115')](db['Campaign'],{'as':_0xe90e('0x198'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xe90e('0x19a')][_0xe90e('0x106')](db[_0xe90e('0x19b')],{'as':{'plural':_0xe90e('0x19c'),'singular':_0xe90e('0x19d')},'foreignKey':_0xe90e('0x19e'),'onDelete':_0xe90e('0x103'),'hooks':!![]});db[_0xe90e('0x19a')][_0xe90e('0x106')](db[_0xe90e('0x19b')],{'as':{'plural':_0xe90e('0x19f'),'singular':'OneAny'},'foreignKey':_0xe90e('0x1a0'),'onDelete':_0xe90e('0x103'),'hooks':!![]});db[_0xe90e('0x19a')][_0xe90e('0x106')](db[_0xe90e('0x1a1')],{'as':_0xe90e('0x1a2'),'foreignKey':_0xe90e('0x1a3'),'onDelete':'cascade','hooks':!![]});db[_0xe90e('0x7b')][_0xe90e('0x106')](db[_0xe90e('0x7b')],{'as':_0xe90e('0x157'),'foreignKey':'ParentId','onDelete':_0xe90e('0x103')});db[_0xe90e('0x7d')][_0xe90e('0x106')](db['Interval'],{'as':_0xe90e('0x1a4'),'foreignKey':_0xe90e('0x147'),'onDelete':_0xe90e('0x103'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xe90e('0x108')],{'as':_0xe90e('0x109'),'foreignKey':_0xe90e('0x147'),'onDelete':_0xe90e('0x154')});db[_0xe90e('0x7d')][_0xe90e('0x106')](db[_0xe90e('0x46')],{'as':_0xe90e('0x1a5'),'foreignKey':'IntervalId'});db[_0xe90e('0x7d')][_0xe90e('0x106')](db[_0xe90e('0x63')],{'as':_0xe90e('0x1a6'),'foreignKey':_0xe90e('0x147')});db[_0xe90e('0x7d')][_0xe90e('0x106')](db[_0xe90e('0x4e')],{'as':'FaxApplications','foreignKey':_0xe90e('0x147')});db[_0xe90e('0x7d')][_0xe90e('0x106')](db[_0xe90e('0x17b')],{'as':_0xe90e('0x1a7'),'foreignKey':'IntervalId'});db[_0xe90e('0x1a8')][_0xe90e('0x115')](db['MailAccount'],{});db[_0xe90e('0x1a8')][_0xe90e('0x115')](db[_0xe90e('0x94')],{'foreignKey':_0xe90e('0x1a9')});db[_0xe90e('0x1a8')]['belongsTo'](db[_0xe90e('0x92')],{'foreignKey':_0xe90e('0x1aa')});db[_0xe90e('0x1ab')][_0xe90e('0x118')](db['VoiceMusicOnHold'],{'as':_0xe90e('0x1ac'),'through':_0xe90e('0x139'),'onDelete':_0xe90e('0x154')});db[_0xe90e('0x84')]['belongsToMany'](db['CmContact'],{'through':_0xe90e('0x194')});db[_0xe90e('0x84')][_0xe90e('0x118')](db['ChatInteraction'],{'through':_0xe90e('0x18b')});db[_0xe90e('0x84')][_0xe90e('0x118')](db['MailInteraction'],{'through':_0xe90e('0x163')});db['Tag']['belongsToMany'](db[_0xe90e('0x57')],{'through':_0xe90e('0x17e')});db[_0xe90e('0x84')][_0xe90e('0x118')](db['FaxInteraction'],{'through':_0xe90e('0x174')});db['Tag'][_0xe90e('0x118')](db[_0xe90e('0x5d')],{'through':'openchannel_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0xe90e('0xf1')],{'through':_0xe90e('0x1ad')});db[_0xe90e('0x1ae')][_0xe90e('0x115')](db[_0xe90e('0x86')],{'as':'ItemType','foreignKey':_0xe90e('0x1af')});db['CmHopperAdditionalPhone'][_0xe90e('0x115')](db[_0xe90e('0x13c')],{'as':_0xe90e('0x1b0'),'foreignKey':_0xe90e('0x195')});db['CmContactHasItem'][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x192')});db[_0xe90e('0x8b')][_0xe90e('0x106')](db['Condition'],{'as':{'plural':_0xe90e('0x1b1'),'singular':_0xe90e('0x1b2')},'foreignKey':_0xe90e('0x1b3'),'onDelete':_0xe90e('0x103'),'hooks':!![]});db[_0xe90e('0x8b')][_0xe90e('0x106')](db[_0xe90e('0x19b')],{'as':{'plural':'AnyConditions','singular':_0xe90e('0x1b4')},'foreignKey':_0xe90e('0x1b5'),'onDelete':_0xe90e('0x103'),'hooks':!![]});db[_0xe90e('0x8b')]['hasMany'](db[_0xe90e('0x1a1')],{'as':_0xe90e('0x1a2'),'foreignKey':_0xe90e('0x1b6'),'onDelete':_0xe90e('0x103'),'hooks':!![]});db[_0xe90e('0x92')][_0xe90e('0x106')](db[_0xe90e('0x96')],{'as':_0xe90e('0x1b7'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1aa'),'hooks':!![]});db[_0xe90e('0x94')][_0xe90e('0x106')](db['AnalyticFieldReport'],{'as':_0xe90e('0x1b7'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xe90e('0x1b8')][_0xe90e('0x106')](db[_0xe90e('0x96')],{'as':_0xe90e('0x1b7'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0xe90e('0x96')][_0xe90e('0x115')](db['AnalyticMetric'],{'foreignKey':_0xe90e('0x1b9')});db['SalesforceAccount']['hasMany'](db[_0xe90e('0x9b')],{'as':_0xe90e('0x1ba'),'onDelete':'cascade','foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0x9b')][_0xe90e('0x106')](db[_0xe90e('0x1bc')],{'as':'Subjects','onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0x9b')][_0xe90e('0x106')](db['SalesforceField'],{'as':_0xe90e('0x1be'),'onDelete':_0xe90e('0x103'),'foreignKey':'DescriptionId'});db[_0xe90e('0x9b')][_0xe90e('0x106')](db[_0xe90e('0x1bc')],{'as':_0xe90e('0x1b7'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0x9b')][_0xe90e('0x115')](db[_0xe90e('0x99')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x1bb')});db['SalesforceField'][_0xe90e('0x106')](db[_0xe90e('0x1bc')],{'as':_0xe90e('0x1c0'),'foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0x1bc')][_0xe90e('0x106')](db[_0xe90e('0x1bc')],{'as':_0xe90e('0x1c1'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0xe90e('0x106')](db[_0xe90e('0x1bc')],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0x1bc')][_0xe90e('0x115')](db[_0xe90e('0x8c')],{'as':_0xe90e('0x8c'),'foreignKey':_0xe90e('0x1c3')});db[_0xe90e('0x9e')][_0xe90e('0x106')](db[_0xe90e('0xa0')],{'as':_0xe90e('0x1ba'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xa0')]['hasMany'](db[_0xe90e('0xa1')],{'as':_0xe90e('0x1c4'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bd')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0xe90e('0x1be'),'onDelete':_0xe90e('0x103'),'foreignKey':'DescriptionId'});db[_0xe90e('0xa0')][_0xe90e('0x106')](db[_0xe90e('0xa1')],{'as':_0xe90e('0x1b7'),'onDelete':_0xe90e('0x103'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xe90e('0x115')](db['SugarcrmAccount'],{'as':_0xe90e('0x168'),'foreignKey':'AccountId'});db[_0xe90e('0xa1')][_0xe90e('0x106')](db[_0xe90e('0xa1')],{'as':_0xe90e('0x1c0'),'foreignKey':_0xe90e('0x1bd')});db['SugarcrmField'][_0xe90e('0x106')](db[_0xe90e('0xa1')],{'as':_0xe90e('0x1c1'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xa1')][_0xe90e('0x106')](db[_0xe90e('0xa1')],{'as':_0xe90e('0x1c2'),'foreignKey':'FieldId'});db[_0xe90e('0xa1')][_0xe90e('0x115')](db['Variable'],{'as':_0xe90e('0x8c'),'foreignKey':'VariableId'});db[_0xe90e('0xa2')][_0xe90e('0x106')](db[_0xe90e('0xa4')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xa4')][_0xe90e('0x106')](db[_0xe90e('0x1c6')],{'as':_0xe90e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xe90e('0xa4')][_0xe90e('0x106')](db['DeskField'],{'as':_0xe90e('0x1be'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xa4')][_0xe90e('0x106')](db[_0xe90e('0x1c6')],{'as':_0xe90e('0x1b7'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0xa4')]['belongsTo'](db[_0xe90e('0xa2')],{'as':_0xe90e('0x168'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xe90e('0x118')](db[_0xe90e('0x84')],{'through':_0xe90e('0x1c7')});db['DeskField']['hasMany'](db[_0xe90e('0x1c6')],{'as':'Subject','foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0x1c6')]['hasMany'](db[_0xe90e('0x1c6')],{'as':_0xe90e('0x1c1'),'foreignKey':_0xe90e('0x1c5')});db['DeskField'][_0xe90e('0x106')](db[_0xe90e('0x1c6')],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0x1c6')][_0xe90e('0x115')](db[_0xe90e('0x8c')],{'as':_0xe90e('0x8c'),'foreignKey':_0xe90e('0x1c3')});db['ZohoAccount']['hasMany'](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bb')});db['ZohoConfiguration'][_0xe90e('0x106')](db['ZohoField'],{'as':_0xe90e('0x1c4'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0xa7')][_0xe90e('0x106')](db['ZohoField'],{'as':_0xe90e('0x1be'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0xe90e('0x106')](db[_0xe90e('0xa9')],{'as':'Fields','onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0xa7')]['belongsTo'](db[_0xe90e('0xa5')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xa9')][_0xe90e('0x106')](db[_0xe90e('0xa9')],{'as':_0xe90e('0x1c0'),'foreignKey':'SubjectId'});db[_0xe90e('0xa9')][_0xe90e('0x106')](db[_0xe90e('0xa9')],{'as':_0xe90e('0x1c1'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xa9')][_0xe90e('0x106')](db[_0xe90e('0xa9')],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0xa9')][_0xe90e('0x115')](db[_0xe90e('0x8c')],{'as':_0xe90e('0x8c'),'foreignKey':_0xe90e('0x1c3')});db[_0xe90e('0xab')][_0xe90e('0x106')](db[_0xe90e('0xad')],{'as':_0xe90e('0x1ba'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xad')][_0xe90e('0x106')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0xad')]['hasMany'](db[_0xe90e('0xaf')],{'as':_0xe90e('0x1be'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xad')][_0xe90e('0x106')](db['ZendeskField'],{'as':_0xe90e('0x1b7'),'foreignKey':_0xe90e('0x1bf')});db['ZendeskConfiguration'][_0xe90e('0x115')](db[_0xe90e('0xab')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x1bb')});db['ZendeskConfiguration']['belongsToMany'](db[_0xe90e('0x84')],{'through':_0xe90e('0x1c8')});db[_0xe90e('0xaf')][_0xe90e('0x106')](db[_0xe90e('0xaf')],{'as':_0xe90e('0x1c0'),'foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0xaf')][_0xe90e('0x106')](db[_0xe90e('0xaf')],{'as':_0xe90e('0x1c1'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xaf')]['hasMany'](db[_0xe90e('0xaf')],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0xaf')][_0xe90e('0x115')](db['Variable'],{'as':_0xe90e('0x8c'),'foreignKey':_0xe90e('0x1c3')});db[_0xe90e('0xb0')][_0xe90e('0x106')](db[_0xe90e('0xb2')],{'as':'Configurations','onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xb2')]['hasMany'](db[_0xe90e('0xb4')],{'as':_0xe90e('0x1c4'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0xb2')]['hasMany'](db[_0xe90e('0xb4')],{'as':'Descriptions','onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xb2')][_0xe90e('0x106')](db[_0xe90e('0xb4')],{'as':_0xe90e('0x1b7'),'onDelete':_0xe90e('0x103'),'foreignKey':'FieldId'});db[_0xe90e('0xb2')][_0xe90e('0x115')](db[_0xe90e('0xb0')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xb2')][_0xe90e('0x118')](db[_0xe90e('0x84')],{'through':_0xe90e('0x1c9')});db[_0xe90e('0xb4')][_0xe90e('0x106')](db[_0xe90e('0xb4')],{'as':_0xe90e('0x1c0'),'foreignKey':_0xe90e('0x1bd')});db['FreshdeskField'][_0xe90e('0x106')](db[_0xe90e('0xb4')],{'as':_0xe90e('0x1c1'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xb4')][_0xe90e('0x106')](db[_0xe90e('0xb4')],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db['FreshdeskField'][_0xe90e('0x115')](db[_0xe90e('0x8c')],{'as':_0xe90e('0x8c'),'foreignKey':_0xe90e('0x1c3')});db['VtigerAccount']['hasMany'](db[_0xe90e('0x1ca')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0x1ca')][_0xe90e('0x106')](db['VtigerField'],{'as':_0xe90e('0x1c4'),'foreignKey':'SubjectId'});db[_0xe90e('0x1ca')][_0xe90e('0x106')](db[_0xe90e('0x1cb')],{'as':_0xe90e('0x1be'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0x1ca')][_0xe90e('0x106')](db['VtigerField'],{'as':_0xe90e('0x1b7'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0xe90e('0x115')](db['VtigerAccount'],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0x1cb')][_0xe90e('0x106')](db[_0xe90e('0x1cb')],{'as':_0xe90e('0x1c0'),'foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0x1cb')]['hasMany'](db[_0xe90e('0x1cb')],{'as':'Description','foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0x1cb')][_0xe90e('0x106')](db[_0xe90e('0x1cb')],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0x1cb')][_0xe90e('0x115')](db[_0xe90e('0x8c')],{'as':_0xe90e('0x8c'),'foreignKey':_0xe90e('0x1c3')});db[_0xe90e('0x1cc')][_0xe90e('0x106')](db[_0xe90e('0x1cd')],{'as':'Configurations','onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bb')});db['ServicenowConfiguration'][_0xe90e('0x106')](db[_0xe90e('0xb8')],{'as':_0xe90e('0x1c4'),'foreignKey':'SubjectId'});db[_0xe90e('0x1cd')][_0xe90e('0x106')](db['ServicenowField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xe90e('0x1cd')][_0xe90e('0x106')](db[_0xe90e('0xb8')],{'as':'Fields','foreignKey':'FieldId'});db['ServicenowConfiguration']['belongsTo'](db[_0xe90e('0x1cc')],{'as':'Account','foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xb8')][_0xe90e('0x106')](db[_0xe90e('0xb8')],{'as':_0xe90e('0x1c0'),'foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0xb8')][_0xe90e('0x106')](db[_0xe90e('0xb8')],{'as':_0xe90e('0x1c1'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xb8')][_0xe90e('0x106')](db['ServicenowField'],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0xb8')][_0xe90e('0x115')](db[_0xe90e('0x8c')],{'as':_0xe90e('0x8c'),'foreignKey':_0xe90e('0x1c3')});db[_0xe90e('0x1ce')][_0xe90e('0x106')](db[_0xe90e('0xbb')],{'as':_0xe90e('0x1ba'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0x1ce')][_0xe90e('0x115')](db['CloudProvider'],{'as':_0xe90e('0xf9'),'foreignKey':_0xe90e('0x153')});db[_0xe90e('0xbb')][_0xe90e('0x106')](db[_0xe90e('0x1cf')],{'as':_0xe90e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xe90e('0xbb')][_0xe90e('0x106')](db[_0xe90e('0x1cf')],{'as':_0xe90e('0x1be'),'onDelete':_0xe90e('0x103'),'foreignKey':'DescriptionId'});db[_0xe90e('0xbb')][_0xe90e('0x106')](db[_0xe90e('0x1cf')],{'as':_0xe90e('0x1b7'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0xbb')][_0xe90e('0x115')](db[_0xe90e('0x1ce')],{'as':'Account','foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0x1cf')][_0xe90e('0x106')](db[_0xe90e('0x1cf')],{'as':_0xe90e('0x1c0'),'foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0x1cf')][_0xe90e('0x106')](db[_0xe90e('0x1cf')],{'as':'Description','foreignKey':'DescriptionId'});db['Dynamics365Field'][_0xe90e('0x106')](db[_0xe90e('0x1cf')],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db['Dynamics365Field']['belongsTo'](db[_0xe90e('0x8c')],{'as':_0xe90e('0x8c'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0xe90e('0x106')](db[_0xe90e('0xbf')],{'as':_0xe90e('0x1ba'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xbf')][_0xe90e('0x106')](db['FreshsalesField'],{'as':'Subjects','foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xe90e('0x106')](db[_0xe90e('0xc1')],{'as':'Descriptions','foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xbf')][_0xe90e('0x106')](db[_0xe90e('0xc1')],{'as':_0xe90e('0x1b7'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0xbf')]['belongsTo'](db[_0xe90e('0xbd')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x1bb')});db[_0xe90e('0xc1')][_0xe90e('0x106')](db[_0xe90e('0xc1')],{'as':'Subject','foreignKey':_0xe90e('0x1bd')});db[_0xe90e('0xc1')][_0xe90e('0x106')](db[_0xe90e('0xc1')],{'as':_0xe90e('0x1c1'),'foreignKey':_0xe90e('0x1c5')});db[_0xe90e('0xc1')][_0xe90e('0x106')](db['FreshsalesField'],{'as':_0xe90e('0x1c2'),'foreignKey':_0xe90e('0x1bf')});db[_0xe90e('0xc1')]['belongsTo'](db[_0xe90e('0x8c')],{'as':'Variable','foreignKey':_0xe90e('0x1c3')});db[_0xe90e('0xc5')][_0xe90e('0x115')](db[_0xe90e('0x61')],{});db[_0xe90e('0xc5')][_0xe90e('0x115')](db['CmList'],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b')});db[_0xe90e('0xc5')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db[_0xe90e('0xc5')][_0xe90e('0x115')](db[_0xe90e('0x65')],{});db[_0xe90e('0xc5')]['belongsTo'](db[_0xe90e('0x18a')],{});db[_0xe90e('0xc5')][_0xe90e('0x115')](db[_0xe90e('0x10')],{});db[_0xe90e('0xc5')][_0xe90e('0x115')](db[_0xe90e('0x69')],{});db[_0xe90e('0xc7')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1d0')});db['ChatInternalMessage'][_0xe90e('0x115')](db[_0xe90e('0x10')],{'onDelete':_0xe90e('0x103'),'foreignKey':'ToId'});db[_0xe90e('0x142')]['hasMany'](db[_0xe90e('0xca')],{'foreignKey':_0xe90e('0x1d1'),'onDelete':_0xe90e('0x103')});db['JscriptySessionReport']['hasMany'](db[_0xe90e('0x1d2')],{'foreignKey':_0xe90e('0x1d1'),'onDelete':_0xe90e('0x103')});db['SmsQueueReport']['belongsTo'](db[_0xe90e('0x12e')],{});db['SmsQueueReport'][_0xe90e('0x115')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':'ListId'});db[_0xe90e('0xcd')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db['SmsQueueReport']['belongsTo'](db['SmsInteraction'],{});db[_0xe90e('0xcd')][_0xe90e('0x115')](db[_0xe90e('0x58')],{});db[_0xe90e('0xcd')][_0xe90e('0x115')](db[_0xe90e('0x10')],{});db[_0xe90e('0xcd')][_0xe90e('0x115')](db['SmsQueue'],{});db['JscriptyProject'][_0xe90e('0x106')](db[_0xe90e('0x142')],{'foreignKey':_0xe90e('0x1d3')});db[_0xe90e('0x1d4')][_0xe90e('0x106')](db[_0xe90e('0xca')],{'foreignKey':'ProjectId'});db[_0xe90e('0x1d4')][_0xe90e('0x106')](db[_0xe90e('0x1d2')],{'foreignKey':_0xe90e('0x1d3')});db[_0xe90e('0xd4')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x165'),'through':_0xe90e('0x133')});db[_0xe90e('0x11d')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x1d5')});db[_0xe90e('0x11d')][_0xe90e('0x118')](db[_0xe90e('0x19')],{'through':'TeamVoiceQueue','as':_0xe90e('0x1d6')});db[_0xe90e('0x11d')][_0xe90e('0x118')](db[_0xe90e('0x122')],{'through':'team_has_mail_queues','as':_0xe90e('0x123')});db[_0xe90e('0x11d')][_0xe90e('0x118')](db[_0xe90e('0x69')],{'through':_0xe90e('0x18d'),'as':_0xe90e('0x1d7')});db[_0xe90e('0x11d')]['belongsToMany'](db['FaxQueue'],{'through':_0xe90e('0x1d8'),'as':_0xe90e('0x124')});db['Team'][_0xe90e('0x118')](db[_0xe90e('0x5a')],{'through':_0xe90e('0x181'),'as':'SmsQueues'});db['Team'][_0xe90e('0x118')](db[_0xe90e('0x126')],{'through':_0xe90e('0x186'),'as':_0xe90e('0x127')});db[_0xe90e('0x11d')][_0xe90e('0x118')](db[_0xe90e('0xf8')],{'through':_0xe90e('0x1d9'),'as':_0xe90e('0x128')});db[_0xe90e('0x11d')][_0xe90e('0x118')](db[_0xe90e('0xe8')],{'through':_0xe90e('0xfd'),'as':_0xe90e('0x1da')});db[_0xe90e('0x198')][_0xe90e('0x106')](db[_0xe90e('0x13c')],{'as':_0xe90e('0x13d'),'foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0xe90e('0x10a')],{'as':_0xe90e('0x13e'),'foreignKey':_0xe90e('0x1db')});db[_0xe90e('0x198')][_0xe90e('0x106')](db['CmHopperHistory'],{'as':_0xe90e('0x13f'),'foreignKey':_0xe90e('0x1db')});db['Campaign'][_0xe90e('0x106')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xe90e('0x1db')});db[_0xe90e('0x198')][_0xe90e('0x115')](db['Trunk'],{'as':_0xe90e('0x27'),'foreignKey':_0xe90e('0x144')});db['Campaign'][_0xe90e('0x115')](db[_0xe90e('0x27')],{'as':_0xe90e('0x145'),'foreignKey':_0xe90e('0x146')});db[_0xe90e('0x198')][_0xe90e('0x115')](db['Interval'],{'as':_0xe90e('0x7d'),'foreignKey':_0xe90e('0x147')});db[_0xe90e('0x198')][_0xe90e('0x115')](db[_0xe90e('0xd4')],{'as':_0xe90e('0xd4'),'foreignKey':_0xe90e('0x1dc')});db[_0xe90e('0x198')][_0xe90e('0x118')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x11b'),'through':_0xe90e('0x1dd')});db[_0xe90e('0x198')][_0xe90e('0x118')](db['CmList'],{'as':_0xe90e('0x14b'),'through':_0xe90e('0x1de')});db[_0xe90e('0x166')][_0xe90e('0x115')](db[_0xe90e('0x16a')],{'as':_0xe90e('0x16a'),'foreignKey':_0xe90e('0x16b')});db[_0xe90e('0xdf')]['belongsTo'](db[_0xe90e('0x44')],{});db[_0xe90e('0xdf')][_0xe90e('0x115')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0xe90e('0x3d')],{'foreignKey':_0xe90e('0x1df'),'as':_0xe90e('0x1e0')});db[_0xe90e('0xdf')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':_0xe90e('0x1e1'),'as':'FromAgent'});db[_0xe90e('0xdf')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':_0xe90e('0x1e2'),'as':_0xe90e('0x1e3')});db[_0xe90e('0xdf')]['belongsTo'](db[_0xe90e('0x122')],{'foreignKey':'ToMailQueueId','as':_0xe90e('0x1e4')});db[_0xe90e('0xdf')][_0xe90e('0x115')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0xe90e('0x1e5')});db[_0xe90e('0x1e6')][_0xe90e('0x115')](db[_0xe90e('0x18a')],{});db['ChatTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x65')],{});db[_0xe90e('0x1e6')][_0xe90e('0x115')](db[_0xe90e('0x61')],{'foreignKey':_0xe90e('0x1e7'),'as':'FromAccount'});db[_0xe90e('0x1e6')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':'FromUserId','as':_0xe90e('0x1e8')});db['ChatTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':_0xe90e('0x1e2'),'as':_0xe90e('0x1e3')});db[_0xe90e('0x1e6')][_0xe90e('0x115')](db[_0xe90e('0x69')],{'foreignKey':_0xe90e('0x1e9'),'as':_0xe90e('0x1e4')});db['ChatTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x61')],{'foreignKey':'ToChatWebsiteId','as':_0xe90e('0x1e5')});db[_0xe90e('0x1ea')]['belongsTo'](db[_0xe90e('0x51')],{});db[_0xe90e('0x1ea')][_0xe90e('0x115')](db[_0xe90e('0x4f')],{});db[_0xe90e('0x1ea')]['belongsTo'](db[_0xe90e('0x4c')],{'foreignKey':'FromFaxAccountId','as':_0xe90e('0x1e0')});db[_0xe90e('0x1ea')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':_0xe90e('0x1e1'),'as':_0xe90e('0x1e8')});db[_0xe90e('0x1ea')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':_0xe90e('0x1e2'),'as':_0xe90e('0x1e3')});db['FaxTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x179')],{'foreignKey':_0xe90e('0x1eb'),'as':_0xe90e('0x1e4')});db['FaxTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x4c')],{'foreignKey':'ToFaxAccountId','as':_0xe90e('0x1e5')});db[_0xe90e('0xe3')]['belongsTo'](db[_0xe90e('0x5f')],{});db[_0xe90e('0xe3')][_0xe90e('0x115')](db[_0xe90e('0x5d')],{});db['OpenchannelTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x182')],{'foreignKey':_0xe90e('0x1ec'),'as':_0xe90e('0x1e0')});db[_0xe90e('0xe3')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':_0xe90e('0x1e1'),'as':'FromAgent'});db[_0xe90e('0xe3')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':_0xe90e('0x1e2'),'as':'ToAgent'});db[_0xe90e('0xe3')][_0xe90e('0x115')](db['OpenchannelQueue'],{'foreignKey':_0xe90e('0x1ed'),'as':_0xe90e('0x1e4')});db[_0xe90e('0xe3')][_0xe90e('0x115')](db[_0xe90e('0x182')],{'foreignKey':_0xe90e('0x1ee'),'as':_0xe90e('0x1e5')});db['SmsTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x58')],{});db['SmsTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x57')],{});db[_0xe90e('0xe5')][_0xe90e('0x115')](db[_0xe90e('0x12e')],{'foreignKey':_0xe90e('0x1ef'),'as':_0xe90e('0x1e0')});db[_0xe90e('0xe5')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':'FromUserId','as':_0xe90e('0x1e8')});db['SmsTransferReport']['belongsTo'](db[_0xe90e('0x10')],{'foreignKey':'ToUserId','as':_0xe90e('0x1e3')});db['SmsTransferReport'][_0xe90e('0x115')](db[_0xe90e('0x5a')],{'foreignKey':'ToSmsQueueId','as':_0xe90e('0x1e4')});db[_0xe90e('0xe5')]['belongsTo'](db[_0xe90e('0x12e')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xe90e('0xe7')]['hasMany'](db[_0xe90e('0x7b')],{'as':_0xe90e('0x157'),'foreignKey':_0xe90e('0x15b'),'onDelete':'cascade'});db[_0xe90e('0xe7')][_0xe90e('0x106')](db[_0xe90e('0x76')],{'as':_0xe90e('0x1f0'),'foreignKey':'ListId'});db['CmList'][_0xe90e('0x106')](db[_0xe90e('0x70')],{'as':'Contacts','onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x15b')});db[_0xe90e('0xe7')][_0xe90e('0x106')](db['CmHopperFinal'],{'as':_0xe90e('0x13e'),'foreignKey':_0xe90e('0x15b')});db[_0xe90e('0xe7')][_0xe90e('0x106')](db[_0xe90e('0x74')],{'as':'HopperHistory','foreignKey':_0xe90e('0x15b')});db[_0xe90e('0xe7')][_0xe90e('0x106')](db[_0xe90e('0x140')],{'as':_0xe90e('0x140'),'foreignKey':_0xe90e('0x15b')});db[_0xe90e('0xe7')]['belongsToMany'](db[_0xe90e('0x19')],{'as':_0xe90e('0x1f1'),'through':_0xe90e('0x149')});db[_0xe90e('0xe7')]['belongsToMany'](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x11c')});db[_0xe90e('0xe8')]['hasMany'](db[_0xe90e('0x108')],{'as':'Extensions','onDelete':_0xe90e('0x103')});db[_0xe90e('0xe8')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':'UserVoicePrefix'});db[_0xe90e('0xe8')][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'through':'TeamVoicePrefix','as':_0xe90e('0x15f')});db['UserProfile'][_0xe90e('0x106')](db['User'],{'as':_0xe90e('0x165'),'foreignKey':'userProfileId'});db[_0xe90e('0xea')]['hasMany'](db[_0xe90e('0xec')],{'as':_0xe90e('0x1f2'),'foreignKey':_0xe90e('0x116'),'onDelete':_0xe90e('0x103')});db['UserProfileSection'][_0xe90e('0x106')](db['UserProfileResource'],{'as':_0xe90e('0x1f3'),'foreignKey':_0xe90e('0x1f4'),'onDelete':'cascade'});db['WhatsappAccount'][_0xe90e('0x106')](db[_0xe90e('0x7b')],{'as':_0xe90e('0x157'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db['WhatsappAccount'][_0xe90e('0x106')](db[_0xe90e('0x7a')],{'as':_0xe90e('0x16f'),'foreignKey':'WhatsappAccountId'});db[_0xe90e('0xef')][_0xe90e('0x106')](db[_0xe90e('0xf3')],{'as':_0xe90e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0xe90e('0xef')][_0xe90e('0x106')](db[_0xe90e('0xf1')],{'as':_0xe90e('0x159')});db[_0xe90e('0xef')][_0xe90e('0x106')](db[_0xe90e('0xf0')],{'as':_0xe90e('0x137')});db[_0xe90e('0xef')][_0xe90e('0x115')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':_0xe90e('0x15b')});db[_0xe90e('0xef')]['belongsTo'](db[_0xe90e('0x7f')],{'as':_0xe90e('0x171'),'foreignKey':_0xe90e('0x148')});db[_0xe90e('0xef')][_0xe90e('0x118')](db[_0xe90e('0x10')],{'as':_0xe90e('0x14a'),'through':_0xe90e('0x131')});db['WhatsappApplication'][_0xe90e('0x115')](db[_0xe90e('0x10')],{'onDelete':_0xe90e('0x154')});db[_0xe90e('0xf0')][_0xe90e('0x115')](db[_0xe90e('0xf8')],{'onDelete':'restrict'});db[_0xe90e('0xf0')][_0xe90e('0x115')](db['WhatsappAccount'],{'onDelete':'restrict'});db['WhatsappApplication'][_0xe90e('0x115')](db[_0xe90e('0x7d')],{'onDelete':_0xe90e('0x154'),'foreignKey':_0xe90e('0x147')});db['WhatsappApplication']['belongsTo'](db[_0xe90e('0x84')],{'onDelete':_0xe90e('0x154'),'foreignKey':_0xe90e('0x16c')});db[_0xe90e('0xf1')][_0xe90e('0x106')](db['WhatsappMessage'],{'as':_0xe90e('0x158'),'onDelete':_0xe90e('0x103'),'foreignKey':_0xe90e('0x1f5')});db['WhatsappInteraction'][_0xe90e('0x115')](db[_0xe90e('0xef')],{'as':'Account','foreignKey':_0xe90e('0x1f6')});db[_0xe90e('0xf1')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db['WhatsappInteraction'][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':_0xe90e('0x17d'),'foreignKey':'UserId'});db['WhatsappInteraction']['belongsToMany'](db[_0xe90e('0x84')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xe90e('0xf1')]['belongsToMany'](db[_0xe90e('0x84')],{'through':_0xe90e('0x1ad'),'as':_0xe90e('0x175')});db['WhatsappInteraction']['belongsToMany'](db[_0xe90e('0x10')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0xe90e('0x1f5')});db[_0xe90e('0xf3')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'as':_0xe90e('0x10')});db[_0xe90e('0xf3')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x161')});db[_0xe90e('0xf3')][_0xe90e('0x115')](db[_0xe90e('0xf1')],{'onDelete':_0xe90e('0x103'),'as':_0xe90e('0x177'),'foreignKey':_0xe90e('0x1f5')});db[_0xe90e('0xf3')][_0xe90e('0x115')](db[_0xe90e('0xef')],{'as':_0xe90e('0x168'),'foreignKey':_0xe90e('0x1f6')});db[_0xe90e('0x1f7')][_0xe90e('0x115')](db['WhatsappAccount'],{});db[_0xe90e('0x1f7')][_0xe90e('0x115')](db[_0xe90e('0xe7')],{'as':_0xe90e('0x15a'),'foreignKey':'ListId'});db[_0xe90e('0x1f7')][_0xe90e('0x115')](db[_0xe90e('0x70')],{'as':_0xe90e('0x161'),'foreignKey':_0xe90e('0x162')});db['WhatsappQueueReport'][_0xe90e('0x115')](db['WhatsappInteraction'],{});db[_0xe90e('0x1f7')][_0xe90e('0x115')](db[_0xe90e('0xf8')],{});db[_0xe90e('0x1f7')][_0xe90e('0x115')](db[_0xe90e('0xf3')],{});db[_0xe90e('0x1f7')][_0xe90e('0x115')](db[_0xe90e('0x10')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xe90e('0xf3')],{});db['WhatsappTransferReport'][_0xe90e('0x115')](db[_0xe90e('0xf1')],{});db[_0xe90e('0xf6')][_0xe90e('0x115')](db[_0xe90e('0xef')],{'foreignKey':_0xe90e('0x1f8'),'as':_0xe90e('0x1e0')});db['WhatsappTransferReport'][_0xe90e('0x115')](db['WhatsappAccount'],{'foreignKey':_0xe90e('0x1f9'),'as':_0xe90e('0x1e5')});db[_0xe90e('0xf6')]['belongsTo'](db[_0xe90e('0xf8')],{'foreignKey':'ToQueueId','as':'ToQueue'});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xe90e('0x1e1'),'as':_0xe90e('0x1e8')});db[_0xe90e('0xf6')][_0xe90e('0x115')](db[_0xe90e('0x10')],{'foreignKey':_0xe90e('0x1e2'),'as':_0xe90e('0x1e3')});db[_0xe90e('0xf8')][_0xe90e('0x118')](db['User'],{'as':'Agents','through':_0xe90e('0x38'),'foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0xe90e('0x118')](db[_0xe90e('0x11d')],{'through':_0xe90e('0x1d9'),'as':_0xe90e('0x15f')});db[_0xe90e('0x100')]['belongsTo'](db[_0xe90e('0x10')],{'as':'user','foreignKey':'UserId','onDelete':_0xe90e('0x103'),'hooks':!![]});db[_0xe90e('0xf9')][_0xe90e('0x102')](db[_0xe90e('0x1ce')],{'as':'Dynamics365Account','onDelete':_0xe90e('0x154')});db['CloudProvider'][_0xe90e('0x102')](db[_0xe90e('0x3a')],{'as':'Imap','onDelete':_0xe90e('0x154')});db[_0xe90e('0xf9')][_0xe90e('0x102')](db[_0xe90e('0x3c')],{'as':_0xe90e('0x156'),'onDelete':_0xe90e('0x154')});module[_0xe90e('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3b029c3..4276942 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x774b=['./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/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/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/webbar','/api/logs','/apidoc','root','/www','static','join','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions'];(function(_0x37c9ec,_0x7ce562){var _0x4646aa=function(_0x19ea88){while(--_0x19ea88){_0x37c9ec['push'](_0x37c9ec['shift']());}};_0x4646aa(++_0x7ce562);}(_0x774b,0x1e9));var _0xb774=function(_0x5b53ee,_0x4f9ae2){_0x5b53ee=_0x5b53ee-0x0;var _0x4ff08c=_0x774b[_0x5b53ee];return _0x4ff08c;};'use strict';var path=require(_0xb774('0x0'));var express=require(_0xb774('0x1'));var errors=require(_0xb774('0x2'));var config=require(_0xb774('0x3'));var setupLoggers=require(_0xb774('0x4'))[_0xb774('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0xb774('0x6')]=function(_0x523668){return setupLoggers(_0x523668)[_0xb774('0x7')](function(){_0x523668[_0xb774('0x8')](_0xb774('0x9'),require(_0xb774('0xa')));_0x523668['use'](_0xb774('0xb'),require(_0xb774('0xc')));_0x523668[_0xb774('0x8')](_0xb774('0xd'),require(_0xb774('0xe')));_0x523668['use'](_0xb774('0xf'),require(_0xb774('0x10')));_0x523668[_0xb774('0x8')](_0xb774('0x11'),require('./api/voiceMusicOnHold'));_0x523668[_0xb774('0x8')](_0xb774('0x12'),require(_0xb774('0x13')));_0x523668[_0xb774('0x8')]('/api/voice/recordings',require('./api/voiceRecording'));_0x523668[_0xb774('0x8')]('/api/screen/recordings',require('./api/screenRecording'));_0x523668[_0xb774('0x8')]('/api/voice/mails',require('./api/voiceMail'));_0x523668[_0xb774('0x8')]('/api/voice/mails/messages',require(_0xb774('0x14')));_0x523668['use'](_0xb774('0x15'),require('./api/voiceCallReport'));_0x523668[_0xb774('0x8')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x523668['use'](_0xb774('0x16'),require('./api/voiceAgentReport'));_0x523668[_0xb774('0x8')](_0xb774('0x17'),require(_0xb774('0x18')));_0x523668['use'](_0xb774('0x19'),require(_0xb774('0x1a')));_0x523668[_0xb774('0x8')](_0xb774('0x1b'),require('./api/trunk'));_0x523668[_0xb774('0x8')](_0xb774('0x1c'),require(_0xb774('0x1d')));_0x523668[_0xb774('0x8')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x523668[_0xb774('0x8')](_0xb774('0x1e'),require('./api/mailAccount'));_0x523668[_0xb774('0x8')](_0xb774('0x1f'),require(_0xb774('0x20')));_0x523668[_0xb774('0x8')](_0xb774('0x21'),require(_0xb774('0x22')));_0x523668[_0xb774('0x8')](_0xb774('0x23'),require('./api/mailInteraction'));_0x523668[_0xb774('0x8')](_0xb774('0x24'),require(_0xb774('0x25')));_0x523668[_0xb774('0x8')](_0xb774('0x26'),require(_0xb774('0x27')));_0x523668[_0xb774('0x8')](_0xb774('0x28'),require(_0xb774('0x29')));_0x523668[_0xb774('0x8')]('/api/dashboards',require(_0xb774('0x2a')));_0x523668[_0xb774('0x8')](_0xb774('0x2b'),require(_0xb774('0x2c')));_0x523668[_0xb774('0x8')]('/api/fax/accounts',require(_0xb774('0x2d')));_0x523668[_0xb774('0x8')](_0xb774('0x2e'),require(_0xb774('0x2f')));_0x523668[_0xb774('0x8')](_0xb774('0x30'),require('./api/faxInteraction'));_0x523668[_0xb774('0x8')]('/api/fax/messages',require(_0xb774('0x31')));_0x523668[_0xb774('0x8')](_0xb774('0x32'),require(_0xb774('0x33')));_0x523668[_0xb774('0x8')](_0xb774('0x34'),require('./api/faxQueueReport'));_0x523668[_0xb774('0x8')](_0xb774('0x35'),require(_0xb774('0x36')));_0x523668[_0xb774('0x8')](_0xb774('0x37'),require('./api/smsApplication'));_0x523668[_0xb774('0x8')](_0xb774('0x38'),require('./api/smsInteraction'));_0x523668[_0xb774('0x8')]('/api/sms/messages',require(_0xb774('0x39')));_0x523668[_0xb774('0x8')]('/api/sms/queues',require('./api/smsQueue'));_0x523668[_0xb774('0x8')](_0xb774('0x3a'),require(_0xb774('0x3b')));_0x523668['use'](_0xb774('0x3c'),require('./api/openchannelApplication'));_0x523668['use'](_0xb774('0x3d'),require(_0xb774('0x3e')));_0x523668['use'](_0xb774('0x3f'),require(_0xb774('0x40')));_0x523668[_0xb774('0x8')](_0xb774('0x41'),require(_0xb774('0x42')));_0x523668['use'](_0xb774('0x43'),require(_0xb774('0x44')));_0x523668['use'](_0xb774('0x45'),require(_0xb774('0x46')));_0x523668['use'](_0xb774('0x47'),require(_0xb774('0x48')));_0x523668[_0xb774('0x8')](_0xb774('0x49'),require(_0xb774('0x4a')));_0x523668[_0xb774('0x8')](_0xb774('0x4b'),require(_0xb774('0x4c')));_0x523668['use'](_0xb774('0x4d'),require(_0xb774('0x4e')));_0x523668[_0xb774('0x8')](_0xb774('0x4f'),require(_0xb774('0x50')));_0x523668[_0xb774('0x8')](_0xb774('0x51'),require(_0xb774('0x52')));_0x523668[_0xb774('0x8')](_0xb774('0x53'),require('./api/chatProactiveAction'));_0x523668[_0xb774('0x8')](_0xb774('0x54'),require(_0xb774('0x55')));_0x523668[_0xb774('0x8')](_0xb774('0x56'),require(_0xb774('0x57')));_0x523668[_0xb774('0x8')](_0xb774('0x58'),require('./api/cmHopper'));_0x523668['use'](_0xb774('0x59'),require(_0xb774('0x5a')));_0x523668[_0xb774('0x8')](_0xb774('0x5b'),require(_0xb774('0x5c')));_0x523668[_0xb774('0x8')](_0xb774('0x5d'),require('./api/cmHopperHistory'));_0x523668['use'](_0xb774('0x5e'),require(_0xb774('0x5f')));_0x523668[_0xb774('0x8')](_0xb774('0x60'),require(_0xb774('0x61')));_0x523668[_0xb774('0x8')](_0xb774('0x62'),require(_0xb774('0x63')));_0x523668[_0xb774('0x8')](_0xb774('0x64'),require(_0xb774('0x65')));_0x523668[_0xb774('0x8')]('/api/dispositions',require('./api/disposition'));_0x523668[_0xb774('0x8')](_0xb774('0x66'),require('./api/condition'));_0x523668[_0xb774('0x8')](_0xb774('0x67'),require('./api/interval'));_0x523668[_0xb774('0x8')]('/api/pauses',require(_0xb774('0x68')));_0x523668['use'](_0xb774('0x69'),require(_0xb774('0x6a')));_0x523668[_0xb774('0x8')](_0xb774('0x6b'),require('./api/voiceQueuesLog'));_0x523668['use'](_0xb774('0x6c'),require(_0xb774('0x6d')));_0x523668[_0xb774('0x8')](_0xb774('0x6e'),require(_0xb774('0x6f')));_0x523668[_0xb774('0x8')](_0xb774('0x70'),require(_0xb774('0x71')));_0x523668[_0xb774('0x8')](_0xb774('0x72'),require(_0xb774('0x73')));_0x523668[_0xb774('0x8')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x523668[_0xb774('0x8')](_0xb774('0x74'),require('./api/cmHopperAdditionalPhone'));_0x523668[_0xb774('0x8')](_0xb774('0x75'),require(_0xb774('0x76')));_0x523668[_0xb774('0x8')](_0xb774('0x77'),require(_0xb774('0x78')));_0x523668[_0xb774('0x8')](_0xb774('0x79'),require(_0xb774('0x7a')));_0x523668[_0xb774('0x8')](_0xb774('0x7b'),require(_0xb774('0x7c')));_0x523668[_0xb774('0x8')](_0xb774('0x7d'),require('./api/integrationReport'));_0x523668[_0xb774('0x8')](_0xb774('0x7e'),require(_0xb774('0x7f')));_0x523668['use']('/api/analytics/default_reports',require(_0xb774('0x80')));_0x523668[_0xb774('0x8')](_0xb774('0x81'),require('./api/analyticExtractedReport'));_0x523668[_0xb774('0x8')](_0xb774('0x82'),require(_0xb774('0x83')));_0x523668['use']('/api/analytics/field_reports',require(_0xb774('0x84')));_0x523668[_0xb774('0x8')](_0xb774('0x85'),require('./api/analyticTreeReport'));_0x523668[_0xb774('0x8')](_0xb774('0x86'),require('./api/intSalesforceAccount'));_0x523668[_0xb774('0x8')]('/api/integrations/salesforce/configurations',require(_0xb774('0x87')));_0x523668[_0xb774('0x8')](_0xb774('0x88'),require(_0xb774('0x89')));_0x523668['use'](_0xb774('0x8a'),require('./api/intSugarcrmAccount'));_0x523668[_0xb774('0x8')](_0xb774('0x8b'),require(_0xb774('0x8c')));_0x523668[_0xb774('0x8')]('/api/integrations/sugarcrm/fields',require(_0xb774('0x8d')));_0x523668['use'](_0xb774('0x8e'),require(_0xb774('0x8f')));_0x523668['use'](_0xb774('0x90'),require(_0xb774('0x91')));_0x523668['use']('/api/integrations/desk/fields',require(_0xb774('0x92')));_0x523668[_0xb774('0x8')](_0xb774('0x93'),require(_0xb774('0x94')));_0x523668[_0xb774('0x8')](_0xb774('0x95'),require(_0xb774('0x96')));_0x523668['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x523668[_0xb774('0x8')]('/api/integrations/zendesk/accounts',require(_0xb774('0x97')));_0x523668[_0xb774('0x8')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x523668[_0xb774('0x8')](_0xb774('0x98'),require(_0xb774('0x99')));_0x523668[_0xb774('0x8')](_0xb774('0x9a'),require('./api/intFreshdeskAccount'));_0x523668[_0xb774('0x8')](_0xb774('0x9b'),require('./api/intFreshdeskConfiguration'));_0x523668[_0xb774('0x8')](_0xb774('0x9c'),require(_0xb774('0x9d')));_0x523668[_0xb774('0x8')](_0xb774('0x9e'),require(_0xb774('0x9f')));_0x523668[_0xb774('0x8')](_0xb774('0xa0'),require(_0xb774('0xa1')));_0x523668[_0xb774('0x8')](_0xb774('0xa2'),require('./api/intVtigerField'));_0x523668['use'](_0xb774('0xa3'),require(_0xb774('0xa4')));_0x523668[_0xb774('0x8')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x523668[_0xb774('0x8')](_0xb774('0xa5'),require(_0xb774('0xa6')));_0x523668[_0xb774('0x8')](_0xb774('0xa7'),require(_0xb774('0xa8')));_0x523668[_0xb774('0x8')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x523668[_0xb774('0x8')](_0xb774('0xa9'),require('./api/intDynamics365Field'));_0x523668[_0xb774('0x8')]('/api/integrations/freshsales/accounts',require(_0xb774('0xaa')));_0x523668[_0xb774('0x8')](_0xb774('0xab'),require('./api/intFreshsalesConfiguration'));_0x523668['use'](_0xb774('0xac'),require(_0xb774('0xad')));_0x523668[_0xb774('0x8')](_0xb774('0xae'),require(_0xb774('0xaf')));_0x523668[_0xb774('0x8')](_0xb774('0xb0'),require(_0xb774('0xb1')));_0x523668[_0xb774('0x8')](_0xb774('0xb2'),require(_0xb774('0xb3')));_0x523668[_0xb774('0x8')](_0xb774('0xb4'),require(_0xb774('0xb5')));_0x523668[_0xb774('0x8')](_0xb774('0xb6'),require('./api/jscriptyQuestionReport'));_0x523668[_0xb774('0x8')](_0xb774('0xb7'),require(_0xb774('0xb8')));_0x523668[_0xb774('0x8')](_0xb774('0xb9'),require(_0xb774('0xba')));_0x523668['use'](_0xb774('0xbb'),require(_0xb774('0xbc')));_0x523668[_0xb774('0x8')](_0xb774('0xbd'),require(_0xb774('0xbe')));_0x523668[_0xb774('0x8')]('/api/jscripty/projects',require(_0xb774('0xbf')));_0x523668[_0xb774('0x8')]('/api/settings',require('./api/setting'));_0x523668[_0xb774('0x8')](_0xb774('0xc0'),require('./api/squareOdbc'));_0x523668['use']('/api/square/projects',require(_0xb774('0xc1')));_0x523668[_0xb774('0x8')](_0xb774('0xc2'),require(_0xb774('0xc3')));_0x523668[_0xb774('0x8')]('/api/square/messages',require(_0xb774('0xc4')));_0x523668[_0xb774('0x8')](_0xb774('0xc5'),require(_0xb774('0xc6')));_0x523668[_0xb774('0x8')](_0xb774('0xc7'),require(_0xb774('0xc8')));_0x523668[_0xb774('0x8')](_0xb774('0xc9'),require(_0xb774('0xca')));_0x523668[_0xb774('0x8')]('/api/migrations',require(_0xb774('0xcb')));_0x523668[_0xb774('0x8')](_0xb774('0xcc'),require(_0xb774('0xcd')));_0x523668[_0xb774('0x8')](_0xb774('0xce'),require(_0xb774('0xcf')));_0x523668['use'](_0xb774('0xd0'),require(_0xb774('0xd1')));_0x523668['use']('/api/chat/reports/transfer',require(_0xb774('0xd2')));_0x523668[_0xb774('0x8')](_0xb774('0xd3'),require('./api/faxTransferReport'));_0x523668[_0xb774('0x8')](_0xb774('0xd4'),require(_0xb774('0xd5')));_0x523668[_0xb774('0x8')](_0xb774('0xd6'),require(_0xb774('0xd7')));_0x523668[_0xb774('0x8')](_0xb774('0xd8'),require('./api/cmList'));_0x523668['use'](_0xb774('0xd9'),require(_0xb774('0xda')));_0x523668[_0xb774('0x8')](_0xb774('0xdb'),require(_0xb774('0xdc')));_0x523668[_0xb774('0x8')](_0xb774('0xdd'),require('./api/userProfileSection'));_0x523668['use'](_0xb774('0xde'),require(_0xb774('0xdf')));_0x523668[_0xb774('0x8')](_0xb774('0xe0'),require('./api/userNotification'));_0x523668[_0xb774('0x8')](_0xb774('0xe1'),require('./api/whatsappAccount'));_0x523668[_0xb774('0x8')]('/api/whatsapp/applications',require(_0xb774('0xe2')));_0x523668[_0xb774('0x8')](_0xb774('0xe3'),require('./api/whatsappInteraction'));_0x523668[_0xb774('0x8')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x523668['use'](_0xb774('0xe4'),require(_0xb774('0xe5')));_0x523668[_0xb774('0x8')](_0xb774('0xe6'),require(_0xb774('0xe7')));_0x523668[_0xb774('0x8')](_0xb774('0xe8'),require(_0xb774('0xe9')));_0x523668['use']('/api/cloudProviders',require(_0xb774('0xea')));_0x523668[_0xb774('0x8')](_0xb774('0xeb'),require(_0xb774('0xec')));_0x523668['use'](_0xb774('0xed'),require(_0xb774('0xee')));_0x523668[_0xb774('0x8')](_0xb774('0xef'),require(_0xb774('0xf0')));_0x523668['use'](_0xb774('0xf1'),require('./api/authGoogle'));_0x523668[_0xb774('0x8')](_0xb774('0xf2'),require('./api/authActiveDirectory'));_0x523668[_0xb774('0x8')](_0xb774('0xf3'),require(_0xb774('0xf4')));_0x523668['use'](_0xb774('0xf5'),require(_0xb774('0xf6')));_0x523668[_0xb774('0x8')](_0xb774('0xf7'),require(_0xb774('0xf8')));_0x523668[_0xb774('0x8')](_0xb774('0xf9'),require('./api/system'));_0x523668[_0xb774('0x8')](_0xb774('0xfa'),require('./api/pm2'));_0x523668[_0xb774('0x8')]('/api/webbar',require(_0xb774('0xfb')));_0x523668[_0xb774('0x8')](_0xb774('0xfc'),clientSideLogs);_0x523668[_0xb774('0x8')](_0xb774('0xfd'),express['static'](path['join'](config[_0xb774('0xfe')],_0xb774('0xfd'))));_0x523668[_0xb774('0x8')](_0xb774('0xff'),express[_0xb774('0x100')](path[_0xb774('0x101')](config[_0xb774('0xfe')],_0xb774('0xff'))));_0x523668[_0xb774('0x8')]('/demo',express[_0xb774('0x100')](path['join'](config[_0xb774('0xfe')],_0xb774('0x102'))));_0x523668[_0xb774('0x8')]('/snippet',express[_0xb774('0x100')](path[_0xb774('0x101')](config[_0xb774('0xfe')],_0xb774('0x103'),_0xb774('0x104'))));_0x523668['use'](_0xb774('0x105'),express[_0xb774('0x100')](path['join'](config[_0xb774('0xfe')],_0xb774('0x106'))));_0x523668[_0xb774('0x107')](_0xb774('0x108'))[_0xb774('0x109')](errors[0x194]);_0x523668['route']('/*')[_0xb774('0x109')](function(_0x2d9178,_0x375973){_0x375973[_0xb774('0x10a')](path[_0xb774('0x10b')](_0x523668[_0xb774('0x109')]('appPath')+_0xb774('0x10c')));});return _0x523668;});}; \ No newline at end of file +var _0x928c=['./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/variables','./api/integration','/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/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./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/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/authLocal','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','./config/environment','setupLoggers','./api/client-side-logs','default','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x928c,0x1a0));var _0xc928=function(_0x2f287b,_0x317fdc){_0x2f287b=_0x2f287b-0x0;var _0x56736f=_0x928c[_0x2f287b];return _0x56736f;};'use strict';var path=require(_0xc928('0x0'));var express=require(_0xc928('0x1'));var errors=require('./errors');var config=require(_0xc928('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0xc928('0x3')];var clientSideLogs=require(_0xc928('0x4'));exports[_0xc928('0x5')]=function(_0x4b5e4c){return setupLoggers(_0x4b5e4c)['then'](function(){_0x4b5e4c[_0xc928('0x6')](_0xc928('0x7'),require('./api/user'));_0x4b5e4c['use'](_0xc928('0x8'),require(_0xc928('0x9')));_0x4b5e4c['use'](_0xc928('0xa'),require(_0xc928('0xb')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xc'),require('./api/voiceExtension'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xd'),require(_0xc928('0xe')));_0x4b5e4c[_0xc928('0x6')]('/api/voice/queues',require(_0xc928('0xf')));_0x4b5e4c['use'](_0xc928('0x10'),require(_0xc928('0x11')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x12'),require(_0xc928('0x13')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x14'),require('./api/voiceMail'));_0x4b5e4c[_0xc928('0x6')]('/api/voice/mails/messages',require(_0xc928('0x15')));_0x4b5e4c[_0xc928('0x6')]('/api/voice/calls/reports',require(_0xc928('0x16')));_0x4b5e4c['use'](_0xc928('0x17'),require('./api/voiceDialReport'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x18'),require(_0xc928('0x19')));_0x4b5e4c[_0xc928('0x6')]('/api/voice/queues/reports',require(_0xc928('0x1a')));_0x4b5e4c[_0xc928('0x6')]('/api/members/reports',require(_0xc928('0x1b')));_0x4b5e4c[_0xc928('0x6')]('/api/trunks',require(_0xc928('0x1c')));_0x4b5e4c['use'](_0xc928('0x1d'),require(_0xc928('0x1e')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x1f'),require(_0xc928('0x20')));_0x4b5e4c['use'](_0xc928('0x21'),require('./api/mailAccount'));_0x4b5e4c['use']('/api/mail/queues',require(_0xc928('0x22')));_0x4b5e4c['use']('/api/mail/substatuses',require(_0xc928('0x23')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x24'),require(_0xc928('0x25')));_0x4b5e4c[_0xc928('0x6')]('/api/mail/messages',require('./api/mailMessage'));_0x4b5e4c['use'](_0xc928('0x26'),require('./api/mailApplication'));_0x4b5e4c['use']('/api/mail/reports/queue',require(_0xc928('0x27')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x28'),require(_0xc928('0x29')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x2a'),require(_0xc928('0x2b')));_0x4b5e4c[_0xc928('0x6')]('/api/fax/accounts',require(_0xc928('0x2c')));_0x4b5e4c['use'](_0xc928('0x2d'),require(_0xc928('0x2e')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x2f'),require('./api/faxInteraction'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x30'),require(_0xc928('0x31')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x32'),require('./api/faxQueue'));_0x4b5e4c['use']('/api/fax/reports/queue',require(_0xc928('0x33')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x34'),require(_0xc928('0x35')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x36'),require('./api/smsApplication'));_0x4b5e4c['use'](_0xc928('0x37'),require(_0xc928('0x38')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x39'),require('./api/smsMessage'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x3a'),require('./api/smsQueue'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x3b'),require(_0xc928('0x3c')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x3d'),require('./api/openchannelApplication'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x3e'),require(_0xc928('0x3f')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x40'),require(_0xc928('0x41')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x42'),require('./api/openchannelQueue'));_0x4b5e4c[_0xc928('0x6')]('/api/chat/websites',require(_0xc928('0x43')));_0x4b5e4c['use'](_0xc928('0x44'),require(_0xc928('0x45')));_0x4b5e4c[_0xc928('0x6')]('/api/chat/applications',require('./api/chatApplication'));_0x4b5e4c['use'](_0xc928('0x46'),require('./api/chatInteraction'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x47'),require(_0xc928('0x48')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x49'),require(_0xc928('0x4a')));_0x4b5e4c['use'](_0xc928('0x4b'),require(_0xc928('0x4c')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x4d'),require('./api/chatGroup'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x4e'),require('./api/chatProactiveAction'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x4f'),require('./api/cmCompany'));_0x4b5e4c['use'](_0xc928('0x50'),require('./api/cmContact'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x51'),require(_0xc928('0x52')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x53'),require('./api/cmHopperBlack'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x54'),require(_0xc928('0x55')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x56'),require('./api/cmHopperHistory'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x57'),require('./api/cmCustomField'));_0x4b5e4c['use'](_0xc928('0x58'),require(_0xc928('0x59')));_0x4b5e4c[_0xc928('0x6')]('/api/automations',require(_0xc928('0x5a')));_0x4b5e4c['use'](_0xc928('0x5b'),require(_0xc928('0x5c')));_0x4b5e4c['use'](_0xc928('0x5d'),require(_0xc928('0x5e')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x5f'),require(_0xc928('0x60')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x61'),require('./api/interval'));_0x4b5e4c['use']('/api/pauses',require('./api/pause'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x62'),require(_0xc928('0x63')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x64'),require(_0xc928('0x65')));_0x4b5e4c[_0xc928('0x6')]('/api/schedules',require(_0xc928('0x66')));_0x4b5e4c['use'](_0xc928('0x67'),require(_0xc928('0x68')));_0x4b5e4c['use'](_0xc928('0x69'),require(_0xc928('0x6a')));_0x4b5e4c['use']('/api/contact_item_types',require(_0xc928('0x6b')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x6c'),require(_0xc928('0x6d')));_0x4b5e4c['use']('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0x4b5e4c['use']('/api/templates',require('./api/template'));_0x4b5e4c[_0xc928('0x6')]('/api/triggers',require('./api/trigger'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x6e'),require('./api/variable'));_0x4b5e4c['use']('/api/integrations',require(_0xc928('0x6f')));_0x4b5e4c['use']('/api/integrations/reports',require('./api/integrationReport'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x70'),require(_0xc928('0x71')));_0x4b5e4c[_0xc928('0x6')]('/api/analytics/default_reports',require(_0xc928('0x72')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x73'),require('./api/analyticExtractedReport'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x74'),require(_0xc928('0x75')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x76'),require(_0xc928('0x77')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x78'),require('./api/analyticTreeReport'));_0x4b5e4c[_0xc928('0x6')]('/api/integrations/salesforce/accounts',require(_0xc928('0x79')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x7a'),require(_0xc928('0x7b')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x7c'),require(_0xc928('0x7d')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x7e'),require(_0xc928('0x7f')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x80'),require('./api/intSugarcrmConfiguration'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x81'),require(_0xc928('0x82')));_0x4b5e4c['use'](_0xc928('0x83'),require(_0xc928('0x84')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x85'),require(_0xc928('0x86')));_0x4b5e4c[_0xc928('0x6')]('/api/integrations/desk/fields',require(_0xc928('0x87')));_0x4b5e4c[_0xc928('0x6')]('/api/integrations/zoho/accounts',require(_0xc928('0x88')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x89'),require(_0xc928('0x8a')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x8b'),require(_0xc928('0x8c')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x8d'),require(_0xc928('0x8e')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x8f'),require(_0xc928('0x90')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x91'),require('./api/intZendeskField'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x92'),require('./api/intFreshdeskAccount'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x93'),require(_0xc928('0x94')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x95'),require(_0xc928('0x96')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x97'),require(_0xc928('0x98')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x99'),require(_0xc928('0x9a')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0x9b'),require(_0xc928('0x9c')));_0x4b5e4c['use']('/api/integrations/servicenow/accounts',require(_0xc928('0x9d')));_0x4b5e4c['use'](_0xc928('0x9e'),require(_0xc928('0x9f')));_0x4b5e4c[_0xc928('0x6')]('/api/integrations/servicenow/fields',require(_0xc928('0xa0')));_0x4b5e4c[_0xc928('0x6')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xa1'),require(_0xc928('0xa2')));_0x4b5e4c[_0xc928('0x6')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xa3'),require(_0xc928('0xa4')));_0x4b5e4c['use'](_0xc928('0xa5'),require(_0xc928('0xa6')));_0x4b5e4c['use'](_0xc928('0xa7'),require(_0xc928('0xa8')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xa9'),require(_0xc928('0xaa')));_0x4b5e4c['use'](_0xc928('0xab'),require(_0xc928('0xac')));_0x4b5e4c['use'](_0xc928('0xad'),require(_0xc928('0xae')));_0x4b5e4c['use'](_0xc928('0xaf'),require(_0xc928('0xb0')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xb1'),require('./api/jscriptyQuestionReport'));_0x4b5e4c['use'](_0xc928('0xb2'),require(_0xc928('0xb3')));_0x4b5e4c[_0xc928('0x6')]('/api/sms/reports/queue',require(_0xc928('0xb4')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xb5'),require(_0xc928('0xb6')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xb7'),require(_0xc928('0xb8')));_0x4b5e4c[_0xc928('0x6')]('/api/jscripty/projects',require(_0xc928('0xb9')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xba'),require(_0xc928('0xbb')));_0x4b5e4c[_0xc928('0x6')]('/api/square/odbc',require('./api/squareOdbc'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xbc'),require(_0xc928('0xbd')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xbe'),require(_0xc928('0xbf')));_0x4b5e4c[_0xc928('0x6')]('/api/square/messages',require(_0xc928('0xc0')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xc1'),require(_0xc928('0xc2')));_0x4b5e4c['use'](_0xc928('0xc3'),require(_0xc928('0xc4')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xc5'),require(_0xc928('0xc6')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xc7'),require('./api/migration'));_0x4b5e4c[_0xc928('0x6')]('/api/attachments',require(_0xc928('0xc8')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xc9'),require('./api/plugin'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xca'),require('./api/mailTransferReport'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xcb'),require('./api/chatTransferReport'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xcc'),require(_0xc928('0xcd')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xce'),require(_0xc928('0xcf')));_0x4b5e4c['use'](_0xc928('0xd0'),require(_0xc928('0xd1')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xd2'),require(_0xc928('0xd3')));_0x4b5e4c['use'](_0xc928('0xd4'),require(_0xc928('0xd5')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xd6'),require('./api/userProfile'));_0x4b5e4c['use'](_0xc928('0xd7'),require(_0xc928('0xd8')));_0x4b5e4c['use'](_0xc928('0xd9'),require(_0xc928('0xda')));_0x4b5e4c['use']('/api/userNotifications',require(_0xc928('0xdb')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xdc'),require(_0xc928('0xdd')));_0x4b5e4c['use']('/api/whatsapp/applications',require(_0xc928('0xde')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xdf'),require(_0xc928('0xe0')));_0x4b5e4c['use'](_0xc928('0xe1'),require(_0xc928('0xe2')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xe3'),require(_0xc928('0xe4')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xe5'),require(_0xc928('0xe6')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xe7'),require('./api/whatsappQueue'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xe8'),require(_0xc928('0xe9')));_0x4b5e4c[_0xc928('0x6')]('/api/realtime',require(_0xc928('0xea')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xeb'),require('./api/user-setting'));_0x4b5e4c[_0xc928('0x6')]('/api/auth/local',require(_0xc928('0xec')));_0x4b5e4c[_0xc928('0x6')]('/api/auth/google',require('./api/authGoogle'));_0x4b5e4c['use']('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xed'),require('./api/jira'));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xee'),require(_0xc928('0xef')));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xf0'),require(_0xc928('0xf1')));_0x4b5e4c[_0xc928('0x6')]('/api/system',require(_0xc928('0xf2')));_0x4b5e4c[_0xc928('0x6')]('/api/pm2',require('./api/pm2'));_0x4b5e4c['use'](_0xc928('0xf3'),require(_0xc928('0xf4')));_0x4b5e4c[_0xc928('0x6')]('/api/logs',clientSideLogs);_0x4b5e4c[_0xc928('0x6')](_0xc928('0xf5'),express[_0xc928('0xf6')](path[_0xc928('0xf7')](config[_0xc928('0xf8')],_0xc928('0xf5'))));_0x4b5e4c['use']('/www',express[_0xc928('0xf6')](path[_0xc928('0xf7')](config[_0xc928('0xf8')],_0xc928('0xf9'))));_0x4b5e4c['use'](_0xc928('0xfa'),express[_0xc928('0xf6')](path[_0xc928('0xf7')](config[_0xc928('0xf8')],_0xc928('0xfa'))));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xfb'),express['static'](path['join'](config['root'],_0xc928('0xfc'),_0xc928('0xfd'))));_0x4b5e4c[_0xc928('0x6')](_0xc928('0xfe'),express['static'](path[_0xc928('0xf7')](config['root'],'/server/files/plugins')));_0x4b5e4c[_0xc928('0xff')](_0xc928('0x100'))[_0xc928('0x101')](errors[0x194]);_0x4b5e4c[_0xc928('0xff')]('/*')[_0xc928('0x101')](function(_0x2f2493,_0x53bb44){_0x53bb44[_0xc928('0x102')](path[_0xc928('0x103')](_0x4b5e4c[_0xc928('0x101')]('appPath')+_0xc928('0x104')));});return _0x4b5e4c;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 6486f09..a5bccdb 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ba=['../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','listen','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.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/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc'];(function(_0x3fab17,_0x27570d){var _0x1b9af1=function(_0x206e3b){while(--_0x206e3b){_0x3fab17['push'](_0x3fab17['shift']());}};_0x1b9af1(++_0x27570d);}(_0x24ba,0xf2));var _0xa24b=function(_0x1adf19,_0x44af9c){_0x1adf19=_0x1adf19-0x0;var _0x17faa2=_0x24ba[_0x1adf19];return _0x17faa2;};'use strict';var jayson=require(_0xa24b('0x0'));var _=require('lodash');var config=require(_0xa24b('0x1'));exports['listen']=function(){return new Promise(function(_0x15b77d,_0xdacd1a){var _0xb9bd9={};_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x3')));_0xb9bd9=_['merge'](_0xb9bd9,require('../api/voiceExtension/voiceExtension.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x4')));_0xb9bd9=_['merge'](_0xb9bd9,require('../api/voiceRecording/voiceRecording.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xb9bd9=_['merge'](_0xb9bd9,require('../api/voiceDialReport/voiceDialReport.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x5')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x6')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x7')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x8')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x9')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0xa')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/mailServerIn/mailServerIn.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0xb')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0xc')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0xd')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0xe')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0xf')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x10')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x11')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x12')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x13')));_0xb9bd9=_['merge'](_0xb9bd9,require('../api/faxMessage/faxMessage.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/faxQueue/faxQueue.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/faxQueueReport/faxQueueReport.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x14')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/smsInteraction/smsInteraction.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x15')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x16')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x17')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x18')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x19')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x1a')));_0xb9bd9=_['merge'](_0xb9bd9,require('../api/chatInteraction/chatInteraction.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x1b')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/chatQueue/chatQueue.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x1c')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x1d')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x1e')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x1f')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x20')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x21')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/pause/pause.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/sound/sound.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x22')));_0xb9bd9=_['merge'](_0xb9bd9,require('../api/template/template.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x23')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x24')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x25')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x26')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x27')));_0xb9bd9=_['merge'](_0xb9bd9,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x28')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x29')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x2a')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x2b')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x2c')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x2d')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x2e')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x2f')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x30')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x31')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x32')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x33')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x34')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x35')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x36')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x37')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x38')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x39')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x3a')));_0xb9bd9=_[_0xa24b('0x2')](_0xb9bd9,require(_0xa24b('0x3b')));_0xb9bd9=_['merge'](_0xb9bd9,require(_0xa24b('0x3c')));var _0x1a565a=jayson[_0xa24b('0x3d')](_0xb9bd9)[_0xa24b('0x3e')]();var _0x2bd8ab=config[_0xa24b('0x3f')][_0xa24b('0x40')]||config[_0xa24b('0x40')]+0x1;var _0x1af5fe=config['rpc']['ip']||_0xa24b('0x41');_0x1a565a['on'](_0xa24b('0x42'),function(_0x4b6ced){return _0xdacd1a(_0x4b6ced);});_0x1a565a[_0xa24b('0x43')](_0x2bd8ab,_0x1af5fe,function(){console[_0xa24b('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1af5fe,_0x2bd8ab);require(_0xa24b('0x45'))[_0xa24b('0x46')]();return _0x15b77d(_0xa24b('0x47')+_0x1af5fe+':'+_0x2bd8ab);});});}; \ No newline at end of file +var _0x256d=['../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0x256d,0x70));var _0xd256=function(_0x508685,_0x9f94af){_0x508685=_0x508685-0x0;var _0x976a76=_0x256d[_0x508685];return _0x976a76;};'use strict';var jayson=require(_0xd256('0x0'));var _=require(_0xd256('0x1'));var config=require(_0xd256('0x2'));exports[_0xd256('0x3')]=function(){return new Promise(function(_0x503103,_0x3499f0){var _0x45d6aa={};_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x5')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/voiceExtension/voiceExtension.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x6')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x7')));_0x45d6aa=_['merge'](_0x45d6aa,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x8')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x9')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0xa')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0xb')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0xc')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0xd')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0xe')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0xf')));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x10')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x11')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x12')));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x13')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x14')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/faxAccount/faxAccount.rpc'));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x15')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x16')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x17')));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x18')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x19')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/smsAccount/smsAccount.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x1a')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x1b')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/smsQueue/smsQueue.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x1c')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x1d')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x1e')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x1f')));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x20')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x21')));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x22')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x23')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x24')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x25')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x26')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x27')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x28')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/pause/pause.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x29')));_0x45d6aa=_['merge'](_0x45d6aa,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x2a')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x2b')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x2c')));_0x45d6aa=_['merge'](_0x45d6aa,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x2d')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x2e')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x2f')));_0x45d6aa=_['merge'](_0x45d6aa,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x30')));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x31')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x32')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x33')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x34')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x35')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x36')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/squareOdbc/squareOdbc.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x37')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x38')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x39')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/campaign/campaign.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x3a')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require('../api/plugin/plugin.rpc'));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x3b')));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x3c')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x3d')));_0x45d6aa=_[_0xd256('0x4')](_0x45d6aa,require(_0xd256('0x3e')));_0x45d6aa=_['merge'](_0x45d6aa,require(_0xd256('0x3f')));var _0x5f174e=jayson['server'](_0x45d6aa)[_0xd256('0x40')]();var _0x289e3a=config[_0xd256('0x41')][_0xd256('0x42')]||config[_0xd256('0x42')]+0x1;var _0x489a01=config[_0xd256('0x41')]['ip']||_0xd256('0x43');_0x5f174e['on'](_0xd256('0x44'),function(_0x58b623){return _0x3499f0(_0x58b623);});_0x5f174e[_0xd256('0x3')](_0x289e3a,_0x489a01,function(){console[_0xd256('0x45')](_0xd256('0x46'),_0x489a01,_0x289e3a);require(_0xd256('0x47'))[_0xd256('0x48')]();return _0x503103(_0xd256('0x49')+_0x489a01+':'+_0x289e3a);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 314fd81..caab789 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 _0x7d2a=['recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','exec','wait','WAIT','exports','util','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','hangup','substring','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','length','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','write','destroy','prototype','sendRequest','sync','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','format','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22'];(function(_0x2f8177,_0x1bb2a9){var _0x249cb4=function(_0x22929f){while(--_0x22929f){_0x2f8177['push'](_0x2f8177['shift']());}};_0x249cb4(++_0x1bb2a9);}(_0x7d2a,0x171));var _0xa7d2=function(_0x21d1d9,_0x29f10b){_0x21d1d9=_0x21d1d9-0x0;var _0x25bb24=_0x7d2a[_0x21d1d9];return _0x25bb24;};'use strict';var util=require(_0xa7d2('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0xa7d2('0x1')];var AGIReply=require(_0xa7d2('0x2'));var AGIError=require('./error');function AGIChannel(_0x18efe6){var _0xe4ec5c=this,_0x85249b=new AGIReply(),_0x581ad3=![],_0x4f2e92={};EventEmitter[_0xa7d2('0x3')](_0xe4ec5c);_0x18efe6[_0xa7d2('0x4')](_0xa7d2('0x5'));_0x18efe6[_0xa7d2('0x6')](0x8*0x3c*0x3c*0x3e8);_0x85249b[_0xa7d2('0x4')]('utf8');_0x85249b['on'](_0xa7d2('0x7'),function(_0xe62ddf){for(var _0x20d699 in _0xe62ddf){_0xe4ec5c[_0x20d699]=_0xe62ddf[_0x20d699];}_0xe4ec5c[_0xa7d2('0x8')](_0xa7d2('0x9'));});_0x85249b['on']('line',function(_0x5a147d){if(_0x5a147d['toLowerCase']()==_0xa7d2('0xa')){_0xe4ec5c[_0xa7d2('0x8')](_0xa7d2('0xa'));return;}if(_0x5a147d[_0xa7d2('0xb')](0x0,0xb)=='520-Invalid'){_0x581ad3=!![];}if(_0x581ad3){_0x4f2e92['rx']+=_0x5a147d+'\x0a';if(_0x5a147d['search'](_0xa7d2('0xc'))!=-0x1){_0x581ad3=![];}}else{_0x4f2e92['rx']=_0x5a147d;}if(_0x581ad3){return;}if(typeof _0x4f2e92['cb']==_0xa7d2('0xd')){var _0x3384b2=_0x4f2e92['rx'][_0xa7d2('0xb')](0x0,0x3),_0x1e453a=null,_0x48a579=null;_0x3384b2=parseInt(_0x3384b2);if(isNaN(_0x3384b2)){_0x4f2e92['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xa7d2('0xe')});return;}if(_0x3384b2!=0xc8){_0x4f2e92['cb'](null,{'code':_0x3384b2,'result':-0x1,'extra':'KO'});return;}_0x1e453a=_0x4f2e92['rx']['substring'](0x4)[_0xa7d2('0xf')]('result=','');if(_0x1e453a[_0xa7d2('0x10')]('\x20')!=-0x1){_0x1e453a=_0x1e453a[_0xa7d2('0x11')](0x0,_0x1e453a[_0xa7d2('0x10')]('\x20'));}if(_[_0xa7d2('0x12')](_0x1e453a,'-1')){_0x1e453a=parseInt(_0x1e453a);}_0x48a579=_0x4f2e92['rx']['split']('\x20');if(_0x48a579['length']==0x3){_0x48a579=_0x48a579[0x2][_0xa7d2('0xb')](0x1,_0x48a579[0x2][_0xa7d2('0x13')]-0x1);}else if(_0x48a579[_0xa7d2('0x13')]>0x3){var _0x208c1d=/\((.+)\)/;var _0x8b971=_0x4f2e92['rx']['match'](_0x208c1d);if(_0x8b971){_0x48a579=_0x8b971[0x1];}else{_0x48a579=null;}}else{_0x48a579=null;}_0x4f2e92['cb'](null,{'code':_0x3384b2,'result':_0x1e453a,'extra':_0x48a579});}});_0x18efe6['on']('error',function(_0x984cb3){_0xe4ec5c[_0xa7d2('0x8')](_0xa7d2('0x14'),new AGIError(_0xa7d2('0x15'),_0x984cb3['code']));});_0x18efe6['on'](_0xa7d2('0x16'),function(){_0xe4ec5c[_0xa7d2('0x8')]('close',new AGIError(_0xa7d2('0x17')));});_0x18efe6['on'](_0xa7d2('0x18'),function(){_0xe4ec5c[_0xa7d2('0x8')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x18efe6['destroy']();});_0x18efe6[_0xa7d2('0x19')](_0x85249b);this[_0xa7d2('0x1a')]=function(_0xbd8ad1,_0x4efceb){var _0xbd8ad1=_0xbd8ad1||'',_0x4efceb=typeof _0x4efceb==_0xa7d2('0xd')?_0x4efceb:new Function();_0x4f2e92={'tx':_0xbd8ad1,'rx':'','cb':_0x4efceb};_0x18efe6[_0xa7d2('0x1b')](_0xbd8ad1+'\x0a');},this['close']=function(){_0x18efe6[_0xa7d2('0x1c')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x1e')]=function(_0x2fa51d){return this[_0xa7d2('0x1a')][_0xa7d2('0x1f')](this,_0x2fa51d);};AGIChannel[_0xa7d2('0x1d')]['answer']=function(){return this[_0xa7d2('0x1e')]('ANSWER');};AGIChannel['prototype']['getData']=function(_0x5aa831,_0x510b97,_0x2d20b2){_0x5aa831=_0x5aa831===undefined?_0xa7d2('0x20'):_0x5aa831;_0x510b97=_0x510b97===undefined?'5':_0x510b97;_0x2d20b2=_0x2d20b2===undefined?'1':_0x2d20b2;return this[_0xa7d2('0x1e')](util['format'](_0xa7d2('0x21'),_0x5aa831,_0x510b97*0x3e8,_0x2d20b2));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x22')]=function(_0x141873){_0x141873=_0x141873||_0xa7d2('0x23');return this[_0xa7d2('0x1e')](util['format'](_0xa7d2('0x24'),_0x141873));};AGIChannel[_0xa7d2('0x1d')]['exec']=function(_0x439c15,_0x1620dd){if(_[_0xa7d2('0x25')](_0x1620dd)){return this[_0xa7d2('0x1e')](util[_0xa7d2('0x26')](_0xa7d2('0x27'),_0x439c15,_0x1620dd[_0xa7d2('0x28')](',')));}return this[_0xa7d2('0x1e')](util[_0xa7d2('0x26')]('EXEC\x20%s\x20%s',_0x439c15,_0x1620dd));};AGIChannel[_0xa7d2('0x1d')]['setContext']=function(_0xe1451){return this[_0xa7d2('0x1e')](util[_0xa7d2('0x26')](_0xa7d2('0x29'),_0xe1451));};AGIChannel[_0xa7d2('0x1d')]['setExtension']=function(_0x3a86fe){return this[_0xa7d2('0x1e')](util[_0xa7d2('0x26')](_0xa7d2('0x2a'),_0x3a86fe));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x2b')]=function(_0xd75520){return this[_0xa7d2('0x1e')](util[_0xa7d2('0x26')](_0xa7d2('0x2c'),_0xd75520));};AGIChannel['prototype'][_0xa7d2('0xa')]=function(){return this[_0xa7d2('0x1e')](_0xa7d2('0x2d'));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x2e')]=function(_0x1be86f,_0x3f082f){var _0x286f05=_['isBoolean'](_0x3f082f)||_[_0xa7d2('0x2f')](_0x3f082f)?_0x3f082f[_0xa7d2('0x30')]():_0x3f082f;return this['sendRequest'](util[_0xa7d2('0x26')](_0xa7d2('0x31'),_0x1be86f,_0x286f05?_0x286f05['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x32')]=function(_0x3d227f,_0x7bcc){return this['sendRequest'](util[_0xa7d2('0x26')](_0xa7d2('0x33'),_0x3d227f,_0x7bcc));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x34')]=function(_0x1e11d8,_0x19d5b4){return this[_0xa7d2('0x1e')](util[_0xa7d2('0x26')](_0xa7d2('0x35'),_0x1e11d8,_0x19d5b4));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x36')]=function(_0x2c8005,_0x56bf0e){return this[_0xa7d2('0x1e')](util['format'](_0xa7d2('0x37'),_0x2c8005,_0x56bf0e));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x38')]=function(_0x4094cc,_0x19fb45,_0x5c747a){_0x19fb45=_0x19fb45||this[_0xa7d2('0x39')];_0x5c747a=_0x5c747a||0x1;this[_0xa7d2('0x3a')](_0x4094cc);this[_0xa7d2('0x3b')](_0x19fb45);this['setPriority'](_0x5c747a);return this[_0xa7d2('0x22')](util[_0xa7d2('0x26')](_0xa7d2('0x3c'),_0x4094cc,_0x19fb45,_0x5c747a));};AGIChannel['prototype'][_0xa7d2('0x3d')]=function(_0xe96845){return this[_0xa7d2('0x1e')](util['format'](_0xa7d2('0x3e'),_0xe96845));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x3f')]=function(_0x5b9f37,_0x285473,_0x577b3f,_0x300fa1,_0x44d83f,_0x303dd6){_0x285473=_0x285473||_0xa7d2('0x40');_0x577b3f=_0x577b3f||'';_0x300fa1=_0x300fa1===undefined?-0x1:_0x300fa1==='-1'?-0x1:_0x300fa1*0x3e8;_0x44d83f=_0x44d83f===undefined?'':'s='+_0x44d83f;_0x303dd6=_0x303dd6?_0xa7d2('0x41'):'';return this[_0xa7d2('0x1e')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x5b9f37,_0x285473,_0x577b3f,_0x300fa1,_0x303dd6,_0x44d83f));};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x42')]=function(_0x5a93eb,_0x375895){_0x375895=_0x375895||'';return this[_0xa7d2('0x1e')](util[_0xa7d2('0x26')](_0xa7d2('0x43'),_0x5a93eb,_0x375895));};AGIChannel[_0xa7d2('0x1d')]['agi']=function(_0x8df9f9){return this[_0xa7d2('0x44')]('AGI',_0x8df9f9);};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x45')]=function(_0x54abb4){return this[_0xa7d2('0x44')](_0xa7d2('0x46'),_0x54abb4);};AGIChannel[_0xa7d2('0x1d')][_0xa7d2('0x14')]=function(_0x2c98ac,_0x3b2550){this[_0xa7d2('0x22')](util[_0xa7d2('0x26')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2c98ac['id'],_0x2c98ac['label'],_0x3b2550));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xa7d2('0x47')]=AGIChannel; \ No newline at end of file +var _0xb1ef=['./reply','./error','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0xb1ef,0x93));var _0xfb1e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1ef[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0xfb1e('0x0'));var _=require(_0xfb1e('0x1'));var EventEmitter=require('events')[_0xfb1e('0x2')];var AGIReply=require(_0xfb1e('0x3'));var AGIError=require(_0xfb1e('0x4'));function AGIChannel(_0x2c7116){var _0xb70c57=this,_0x1ce096=new AGIReply(),_0x477ee0=![],_0x4b7622={};EventEmitter['call'](_0xb70c57);_0x2c7116[_0xfb1e('0x5')](_0xfb1e('0x6'));_0x2c7116[_0xfb1e('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1ce096[_0xfb1e('0x5')]('utf8');_0x1ce096['on']('headers',function(_0x3c7643){for(var _0x106367 in _0x3c7643){_0xb70c57[_0x106367]=_0x3c7643[_0x106367];}_0xb70c57[_0xfb1e('0x8')](_0xfb1e('0x9'));});_0x1ce096['on'](_0xfb1e('0xa'),function(_0x2fbf8d){if(_0x2fbf8d[_0xfb1e('0xb')]()==_0xfb1e('0xc')){_0xb70c57['emit'](_0xfb1e('0xc'));return;}if(_0x2fbf8d[_0xfb1e('0xd')](0x0,0xb)==_0xfb1e('0xe')){_0x477ee0=!![];}if(_0x477ee0){_0x4b7622['rx']+=_0x2fbf8d+'\x0a';if(_0x2fbf8d[_0xfb1e('0xf')](_0xfb1e('0x10'))!=-0x1){_0x477ee0=![];}}else{_0x4b7622['rx']=_0x2fbf8d;}if(_0x477ee0){return;}if(typeof _0x4b7622['cb']==_0xfb1e('0x11')){var _0x2f7b2e=_0x4b7622['rx'][_0xfb1e('0xd')](0x0,0x3),_0x4f33f8=null,_0x30b991=null;_0x2f7b2e=parseInt(_0x2f7b2e);if(isNaN(_0x2f7b2e)){_0x4b7622['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2f7b2e!=0xc8){_0x4b7622['cb'](null,{'code':_0x2f7b2e,'result':-0x1,'extra':'KO'});return;}_0x4f33f8=_0x4b7622['rx'][_0xfb1e('0xd')](0x4)[_0xfb1e('0x12')](_0xfb1e('0x13'),'');if(_0x4f33f8[_0xfb1e('0x14')]('\x20')!=-0x1){_0x4f33f8=_0x4f33f8[_0xfb1e('0x15')](0x0,_0x4f33f8['indexOf']('\x20'));}if(_[_0xfb1e('0x16')](_0x4f33f8,'-1')){_0x4f33f8=parseInt(_0x4f33f8);}_0x30b991=_0x4b7622['rx'][_0xfb1e('0x17')]('\x20');if(_0x30b991[_0xfb1e('0x18')]==0x3){_0x30b991=_0x30b991[0x2][_0xfb1e('0xd')](0x1,_0x30b991[0x2][_0xfb1e('0x18')]-0x1);}else if(_0x30b991['length']>0x3){var _0x2f3d7e=/\((.+)\)/;var _0x3cf40c=_0x4b7622['rx'][_0xfb1e('0x19')](_0x2f3d7e);if(_0x3cf40c){_0x30b991=_0x3cf40c[0x1];}else{_0x30b991=null;}}else{_0x30b991=null;}_0x4b7622['cb'](null,{'code':_0x2f7b2e,'result':_0x4f33f8,'extra':_0x30b991});}});_0x2c7116['on'](_0xfb1e('0x1a'),function(_0x2b0116){_0xb70c57['emit'](_0xfb1e('0x1a'),new AGIError(_0xfb1e('0x1b'),_0x2b0116[_0xfb1e('0x1c')]));});_0x2c7116['on'](_0xfb1e('0x1d'),function(){_0xb70c57[_0xfb1e('0x8')]('close',new AGIError(_0xfb1e('0x1e')));});_0x2c7116['on']('timeout',function(){_0xb70c57['emit'](_0xfb1e('0x1f'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2c7116[_0xfb1e('0x20')]();});_0x2c7116[_0xfb1e('0x21')](_0x1ce096);this[_0xfb1e('0x22')]=function(_0x484d67,_0x548dc0){var _0x484d67=_0x484d67||'',_0x548dc0=typeof _0x548dc0==_0xfb1e('0x11')?_0x548dc0:new Function();_0x4b7622={'tx':_0x484d67,'rx':'','cb':_0x548dc0};_0x2c7116[_0xfb1e('0x23')](_0x484d67+'\x0a');},this[_0xfb1e('0x1d')]=function(){_0x2c7116[_0xfb1e('0x20')]();};}util[_0xfb1e('0x24')](AGIChannel,EventEmitter);AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x26')]=function(_0x4e24e3){return this[_0xfb1e('0x22')][_0xfb1e('0x27')](this,_0x4e24e3);};AGIChannel[_0xfb1e('0x25')]['answer']=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x28')]=function(_0x20826c,_0x4412d0,_0x3108b6){_0x20826c=_0x20826c===undefined?_0xfb1e('0x29'):_0x20826c;_0x4412d0=_0x4412d0===undefined?'5':_0x4412d0;_0x3108b6=_0x3108b6===undefined?'1':_0x3108b6;return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x2b'),_0x20826c,_0x4412d0*0x3e8,_0x3108b6));};AGIChannel['prototype'][_0xfb1e('0x2c')]=function(_0x2dfa98){_0x2dfa98=_0x2dfa98||_0xfb1e('0x2d');return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x2e'),_0x2dfa98));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x2f')]=function(_0x55a618,_0x35f2f3){if(_[_0xfb1e('0x30')](_0x35f2f3)){return this[_0xfb1e('0x26')](util['format'](_0xfb1e('0x31'),_0x55a618,_0x35f2f3['join'](',')));}return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x31'),_0x55a618,_0x35f2f3));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x32')]=function(_0x3fff90){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x33'),_0x3fff90));};AGIChannel['prototype'][_0xfb1e('0x34')]=function(_0x13b590){return this['sendRequest'](util[_0xfb1e('0x2a')](_0xfb1e('0x35'),_0x13b590));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x36')]=function(_0x8c628f){return this[_0xfb1e('0x26')](util['format']('SET\x20PRIORITY\x20%s',_0x8c628f));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0xc')]=function(){return this['sendRequest'](_0xfb1e('0x37'));};AGIChannel['prototype'][_0xfb1e('0x38')]=function(_0x3fc4de,_0x573bcc){var _0x2b375a=_['isBoolean'](_0x573bcc)||_[_0xfb1e('0x39')](_0x573bcc)?_0x573bcc[_0xfb1e('0x3a')]():_0x573bcc;return this[_0xfb1e('0x26')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3fc4de,_0x2b375a?_0x2b375a[_0xfb1e('0x3a')]()[_0xfb1e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfb1e('0x25')]['sayNumber']=function(_0x54e3d2,_0x33514d){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x3b'),_0x54e3d2,_0x33514d));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x3c')]=function(_0x35c2ae,_0x4eb62c){return this['sendRequest'](util[_0xfb1e('0x2a')](_0xfb1e('0x3d'),_0x35c2ae,_0x4eb62c));};AGIChannel[_0xfb1e('0x25')]['sayPhonetic']=function(_0x220512,_0x166558){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x220512,_0x166558));};AGIChannel[_0xfb1e('0x25')]['continueAt']=function(_0x371a1e,_0x4800a3,_0x4787a0){_0x4800a3=_0x4800a3||this[_0xfb1e('0x3e')];_0x4787a0=_0x4787a0||0x1;this['setContext'](_0x371a1e);this[_0xfb1e('0x34')](_0x4800a3);this[_0xfb1e('0x36')](_0x4787a0);return this[_0xfb1e('0x2c')](util[_0xfb1e('0x2a')](_0xfb1e('0x3f'),_0x371a1e,_0x4800a3,_0x4787a0));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x40')]=function(_0xa8f62d){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x41'),_0xa8f62d));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x42')]=function(_0x5c423b,_0x3a935e,_0x366f46,_0x310655,_0x5c7bf3,_0x2770fd){_0x3a935e=_0x3a935e||'wav';_0x366f46=_0x366f46||'';_0x310655=_0x310655===undefined?-0x1:_0x310655==='-1'?-0x1:_0x310655*0x3e8;_0x5c7bf3=_0x5c7bf3===undefined?'':'s='+_0x5c7bf3;_0x2770fd=_0x2770fd?_0xfb1e('0x43'):'';return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x44'),_0x5c423b,_0x3a935e,_0x366f46,_0x310655,_0x2770fd,_0x5c7bf3));};AGIChannel[_0xfb1e('0x25')]['streamFile']=function(_0x2c80b7,_0x54d3e7){_0x54d3e7=_0x54d3e7||'';return this[_0xfb1e('0x26')](util['format'](_0xfb1e('0x45'),_0x2c80b7,_0x54d3e7));};AGIChannel[_0xfb1e('0x25')]['agi']=function(_0x2ff83e){return this[_0xfb1e('0x2f')]('AGI',_0x2ff83e);};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x46')]=function(_0x3da297){return this[_0xfb1e('0x2f')](_0xfb1e('0x47'),_0x3da297);};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x1a')]=function(_0x364b37,_0x51d055){this[_0xfb1e('0x2c')](util[_0xfb1e('0x2a')](_0xfb1e('0x48'),_0x364b37['id'],_0x364b37[_0xfb1e('0x49')],_0x51d055));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xfb1e('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 40c471a..4a2385f 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 _0x25da=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x4ebb5d,_0x1e92b6){var _0x5abafd=function(_0x2e1f57){while(--_0x2e1f57){_0x4ebb5d['push'](_0x4ebb5d['shift']());}};_0x5abafd(++_0x1e92b6);}(_0x25da,0x19f));var _0xa25d=function(_0x411c12,_0x29ab63){_0x411c12=_0x411c12-0x0;var _0x36b6f7=_0x25da[_0x411c12];return _0x36b6f7;};'use strict';var util=require(_0xa25d('0x0'));var error={'E_AGI_UNDEFINED':_0xa25d('0x1'),'E_AGI_ARGUMENT_PORT':_0xa25d('0x2'),'E_AGI_SERVER_ERROR':_0xa25d('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xa25d('0x4'),'E_AGI_SOCKET_ERROR':_0xa25d('0x5'),'E_AGI_SOCKET_CLOSE':_0xa25d('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xa25d('0x7'),'E_AGI_COMMAND_EMPTY':_0xa25d('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa25d('0x9'),'E_AGI_IVR_ENTRY':_0xa25d('0xa')};function AGIError(_0x110732){var _0x110732=_0x110732||null,_0x1ba368=_0x1ba368||[],_0x42026a=0x1,_0x35e323='';if(!error[_0x110732]){_0x110732=_0xa25d('0xb');}_0x1ba368[_0xa25d('0xc')](error[_0x110732]);while(arguments[_0x42026a]){_0x1ba368[_0xa25d('0xc')](arguments[_0x42026a]);_0x42026a++;}_0x35e323=util[_0xa25d('0xd')]['apply'](util,_0x1ba368);this[_0xa25d('0xe')]=_0x35e323;this[_0xa25d('0xf')]=_0x110732;}module[_0xa25d('0x10')]=AGIError; \ No newline at end of file +var _0x5b9a=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','name','util','Undefined\x20error.'];(function(_0x2c3af0,_0x15908d){var _0x295a86=function(_0x506944){while(--_0x506944){_0x2c3af0['push'](_0x2c3af0['shift']());}};_0x295a86(++_0x15908d);}(_0x5b9a,0x98));var _0xa5b9=function(_0x1d6381,_0x172dfc){_0x1d6381=_0x1d6381-0x0;var _0x2016ff=_0x5b9a[_0x1d6381];return _0x2016ff;};'use strict';var util=require(_0xa5b9('0x0'));var error={'E_AGI_UNDEFINED':_0xa5b9('0x1'),'E_AGI_ARGUMENT_PORT':_0xa5b9('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xa5b9('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xa5b9('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xa5b9('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xa5b9('0x6'),'E_AGI_COMMAND_EMPTY':_0xa5b9('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa5b9('0x8'),'E_AGI_IVR_ENTRY':_0xa5b9('0x9')};function AGIError(_0x34e0a9){var _0x34e0a9=_0x34e0a9||null,_0x5d2959=_0x5d2959||[],_0x4819c7=0x1,_0x57a91a='';if(!error[_0x34e0a9]){_0x34e0a9=_0xa5b9('0xa');}_0x5d2959[_0xa5b9('0xb')](error[_0x34e0a9]);while(arguments[_0x4819c7]){_0x5d2959['push'](arguments[_0x4819c7]);_0x4819c7++;}_0x57a91a=util['format']['apply'](util,_0x5d2959);this[_0xa5b9('0xc')]=_0x57a91a;this[_0xa5b9('0xd')]=_0x34e0a9;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 0a1771a..5f3afc0 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 _0x0a7c=['error','E_AGI_SERVER_ERROR','message','exports','events','ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit'];(function(_0x419156,_0x2a4282){var _0x51fe57=function(_0x1780f1){while(--_0x1780f1){_0x419156['push'](_0x419156['shift']());}};_0x51fe57(++_0x2a4282);}(_0x0a7c,0x1ee));var _0xc0a7=function(_0x21b762,_0xc8ef11){_0x21b762=_0x21b762-0x0;var _0x2ea6d4=_0x0a7c[_0x21b762];return _0x2ea6d4;};'use strict';var _=require('lodash');var EventEmitter=require(_0xc0a7('0x0'))['EventEmitter'];var Redis=require(_0xc0a7('0x1'));var AGIError=require(_0xc0a7('0x2'));var config=require(_0xc0a7('0x3'));config[_0xc0a7('0x4')]=_[_0xc0a7('0x5')](config[_0xc0a7('0x4')],{'host':_0xc0a7('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xc0a7('0x4')]);sub[_0xc0a7('0x7')](_0xc0a7('0x8'),function(_0x1ff4e6){if(_0x1ff4e6)return eventEmitter[_0xc0a7('0x9')](_0xc0a7('0xa'),new AGIError(_0xc0a7('0xb'),_0x1ff4e6));});sub['on'](_0xc0a7('0xc'),function(_0x1dff9c,_0x2f3c1a){if(_0x1dff9c!=='agi')return;try{var _0x39a14e=JSON['parse'](_0x2f3c1a);eventEmitter[_0xc0a7('0x9')]('projectUpdate',_0x39a14e);}catch(_0x82c846){eventEmitter[_0xc0a7('0x9')](_0xc0a7('0xa'),new AGIError(_0xc0a7('0xb'),_0x82c846));}});module[_0xc0a7('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x9a2f=['error','message','parse','emit','projectUpdate','EventEmitter','ioredis','./error','../../config/environment','redis','subscribe','agi'];(function(_0x4dd04c,_0x1f7f0a){var _0x4e7574=function(_0x1937db){while(--_0x1937db){_0x4dd04c['push'](_0x4dd04c['shift']());}};_0x4e7574(++_0x1f7f0a);}(_0x9a2f,0x191));var _0xf9a2=function(_0xffc8,_0x26debc){_0xffc8=_0xffc8-0x0;var _0x3e86d8=_0x9a2f[_0xffc8];return _0x3e86d8;};'use strict';var _=require('lodash');var EventEmitter=require('events')[_0xf9a2('0x0')];var Redis=require(_0xf9a2('0x1'));var AGIError=require(_0xf9a2('0x2'));var config=require(_0xf9a2('0x3'));config['redis']=_['defaults'](config[_0xf9a2('0x4')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xf9a2('0x4')]);sub[_0xf9a2('0x5')](_0xf9a2('0x6'),function(_0x1722ce){if(_0x1722ce)return eventEmitter['emit'](_0xf9a2('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x1722ce));});sub['on'](_0xf9a2('0x8'),function(_0x4b5008,_0x4c48cc){if(_0x4b5008!=='agi')return;try{var _0xebaa8a=JSON[_0xf9a2('0x9')](_0x4c48cc);eventEmitter[_0xf9a2('0xa')](_0xf9a2('0xb'),_0xebaa8a);}catch(_0x3b7193){eventEmitter['emit'](_0xf9a2('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x3b7193));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 3853fa4..c4e0655 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 _0xf733=['condition\x20not\x20found','lodash','../../../config/logger','agi','menu','getsecretdigits','numberOfEdges','prototype','vertices','edges','addEdge','push','size','relations','getVertex','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','traverseBFS','vswitch','default\x20on\x20switch\x20not\x20found','includes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf733,0x197));var _0x3f73=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0xf733[_0x28578d];return _0x524826;};'use strict';var _=require(_0x3f73('0x0'));var logger=require(_0x3f73('0x1'))(_0x3f73('0x2'));var verticesWithRetry=[_0x3f73('0x3'),'getdigits',_0x3f73('0x4')];var Graph=function(){this['vertices']={};this['edges']={};this[_0x3f73('0x5')]=0x0;};Graph[_0x3f73('0x6')]['addVertex']=function(_0xd98255){this[_0x3f73('0x7')][_0xd98255['id']]=_0xd98255;this[_0x3f73('0x8')][_0xd98255['id']]=[];};Graph[_0x3f73('0x6')][_0x3f73('0x9')]=function(_0x39e12b,_0x5c1a7f,_0x455fc1){this['edges'][_0x39e12b][_0x3f73('0xa')]({'target':_0x5c1a7f,'condition':_0x455fc1});this[_0x3f73('0x5')]+=0x1;};Graph[_0x3f73('0x6')][_0x3f73('0xb')]=function(){return _['size'](this['vertices']);};Graph[_0x3f73('0x6')][_0x3f73('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x3f73('0x6')][_0x3f73('0xd')]=function(_0x141cd5){return this[_0x3f73('0x7')][_0x141cd5];};Graph[_0x3f73('0x6')]['traverseBFS']=function(_0x2eb8ce,_0x782299){if(!this[_0x3f73('0x7')][_0x2eb8ce]){return logger[_0x3f73('0xe')](_0x3f73('0xf'));}var _0x2b077d=_0x782299(this['vertices'][_0x2eb8ce]);if(!_0x2b077d){return logger['info']('stop\x20traverse');}if(this[_0x3f73('0x8')][_0x2eb8ce][_0x3f73('0x10')]===0x0){return logger[_0x3f73('0xe')](_0x3f73('0x11'));}for(var _0x4e25b0=0x0,_0x322298=[],_0x4bb07a=![];_0x4e25b0\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','evtHangup','then','catch','agi_','substring','debug','variables','stringify','close','timeout','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','defaults','127.0.0.1','projectUpdate','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fb3,0x155));var _0x31fb=function(_0x2c56bb,_0x59bfc2){_0x2c56bb=_0x2c56bb-0x0;var _0x1479a9=_0x1fb3[_0x2c56bb];return _0x1479a9;};'use strict';var _=require(_0x31fb('0x0'));var syncho=require(_0x31fb('0x1'));var util=require(_0x31fb('0x2'));var config=require(_0x31fb('0x3'));var logger=require(_0x31fb('0x4'))(_0x31fb('0x5'));var utilLicense=require(_0x31fb('0x6'));var rpc=require('./rpc');var Project=require(_0x31fb('0x7'));var AGIEmitter=require(_0x31fb('0x8'))['EventEmitter'];var projects=[];config['agi']=_[_0x31fb('0x9')](config[_0x31fb('0x5')],{'ip':_0x31fb('0xa'),'port':0x11dd});AGIEmitter['on'](_0x31fb('0xb'),projectUpdateHandler);function connectionHandler(_0x19aef1){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x19aef1);agiHandler(_0x19aef1);}catch(_0x213230){logger[_0x31fb('0xc')](_0x213230[_0x31fb('0xd')]);}});});}function projectUpdateHandler(_0x5a2509){try{var _0xbe5178=_[_0x31fb('0xe')](projects,['id',_0x5a2509['id']]);if(_0xbe5178>-0x1){if(_0x5a2509[_0x31fb('0xf')]===!![]){projects[_0x31fb('0x10')](_0xbe5178,0x1);}else{projects[_0xbe5178]=_0x5a2509;}}else{projects[_0x31fb('0x11')](_0x5a2509);}}catch(_0x4eab51){logger[_0x31fb('0xc')](_0x4eab51['stack']);}}function listeningHandler(){console[_0x31fb('0x12')](_0x31fb('0x13'),config[_0x31fb('0x5')][_0x31fb('0x14')]);logger[_0x31fb('0x15')](util[_0x31fb('0x16')](_0x31fb('0x17'),config[_0x31fb('0x5')]['ip'],config[_0x31fb('0x5')][_0x31fb('0x14')]));}function errorHandler(_0x24516f){if(_0x24516f&&_0x24516f[_0x31fb('0x18')]&&_0x24516f[_0x31fb('0x19')]){logger[_0x31fb('0xc')](util[_0x31fb('0x16')]('[%s]\x20%s',_0x24516f[_0x31fb('0x18')],_0x24516f[_0x31fb('0x19')]));}else{logger[_0x31fb('0xc')](util[_0x31fb('0x16')](_0x31fb('0x1a'),_0x24516f[_0x31fb('0xd')]));}}function closeHandler(){logger[_0x31fb('0x15')](util[_0x31fb('0x16')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this['callerid'],this[_0x31fb('0x1b')],this[_0x31fb('0x1c')]));try{createSquareReport(this);}catch(_0x17014b){logger[_0x31fb('0xc')](_0x17014b[_0x31fb('0xd')]);}}function timeoutHandler(){logger[_0x31fb('0x15')](util[_0x31fb('0x16')](_0x31fb('0x1d'),this['arg_1'],this[_0x31fb('0x1e')],this['callerid'],this[_0x31fb('0x1b')],this[_0x31fb('0x1c')]));}function hangupHandler(){logger['info'](util[_0x31fb('0x16')](_0x31fb('0x1f'),this[_0x31fb('0x20')],this[_0x31fb('0x1e')],this[_0x31fb('0x21')],this[_0x31fb('0x1b')],this['uniqueid']));this[_0x31fb('0x22')]=!![];}function createSquareReport(_0x461b45,_0x358bf6){rpc['createSquareReport'](_0x461b45)[_0x31fb('0x23')](function(_0x4f80bc){if(_0x358bf6){_0x358bf6(null,_0x4f80bc);}})[_0x31fb('0x24')](function(_0xf68cb2){if(_0x358bf6){_0x358bf6(null,_0xf68cb2);}});}function setChannelVariables(_0x488b1a){for(var _0x5b6748 in _0x488b1a){if(_0x488b1a['hasOwnProperty'](_0x5b6748)){if(_0x5b6748['indexOf'](_0x31fb('0x25'))===0x0){_0x488b1a[_0x5b6748[_0x31fb('0x26')](0x4)]=_0x488b1a[_0x5b6748];delete _0x488b1a[_0x5b6748];}}}}function agiHandler(_0x2aff12){logger[_0x31fb('0x27')](_0x31fb('0x28'),JSON[_0x31fb('0x29')](_0x2aff12,null,0x2));logger['info'](util[_0x31fb('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2aff12[_0x31fb('0x20')],_0x2aff12['calleridname'],_0x2aff12['callerid'],_0x2aff12[_0x31fb('0x1b')],_0x2aff12[_0x31fb('0x1c')]));_0x2aff12['on']('error',errorHandler);_0x2aff12['on'](_0x31fb('0x2a'),closeHandler);_0x2aff12['on'](_0x31fb('0x2b'),timeoutHandler);_0x2aff12[_0x31fb('0x22')]=![];_0x2aff12['on']('hangup',hangupHandler);var _0x1b3468=_['find'](projects,[_0x31fb('0x18'),_0x2aff12[_0x31fb('0x20')]]);if(!_0x1b3468)return Project[_0x31fb('0x2c')](_0x2aff12);if(!_0x1b3468[_0x31fb('0x2d')])return Project[_0x31fb('0x2e')](_0x2aff12);return Project[_0x31fb('0x2f')](_0x1b3468,_0x2aff12);}function main(){var _0x5bc392;return utilLicense[_0x31fb('0x30')]()[_0x31fb('0x23')](function(_0x490e83){if(!_0x490e83)return;if(_0x490e83[_0x31fb('0x31')]){if(_0x490e83[_0x31fb('0x32')]&&_0x490e83[_0x31fb('0x32')]>0x0){logger[_0x31fb('0x15')](util[_0x31fb('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x490e83[_0x31fb('0x32')]));_0x5bc392=_0x490e83['callysquare'];}else{logger[_0x31fb('0x15')](_0x31fb('0x33'));}}else{logger[_0x31fb('0x15')](_0x31fb('0x34'));_0x5bc392=-0x1;}})[_0x31fb('0x23')](function(){return Project[_0x31fb('0x35')]();})[_0x31fb('0x23')](function(_0x463465){projects=_0x463465;return;})[_0x31fb('0x24')](function(_0x5ddad5){logger['error'](_0x31fb('0x36'),_0x5ddad5[_0x31fb('0xd')]);})[_0x31fb('0x37')](function(){var _0x834da5=require(_0x31fb('0x38'))(config[_0x31fb('0x5')][_0x31fb('0x14')],config['agi']['ip'],_0x5bc392);_0x834da5['on'](_0x31fb('0xc'),errorHandler);_0x834da5['on'](_0x31fb('0x39'),listeningHandler);_0x834da5['on'](_0x31fb('0x3a'),connectionHandler);_0x834da5['on'](_0x31fb('0x2a'),closeHandler);});}main(); \ No newline at end of file +var _0xf32d=['[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','defaults','127.0.0.1','nextTick','error','stack','deleted','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s','[ERROR]\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','agi_','substring','debug','variables','stringify','close','timeout','hangup','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf32d,0xc0));var _0xdf32=function(_0x341fe5,_0xc28904){_0x341fe5=_0x341fe5-0x0;var _0x11a0c5=_0xf32d[_0x341fe5];return _0x11a0c5;};'use strict';var _=require(_0xdf32('0x0'));var syncho=require(_0xdf32('0x1'));var util=require(_0xdf32('0x2'));var config=require(_0xdf32('0x3'));var logger=require(_0xdf32('0x4'))(_0xdf32('0x5'));var utilLicense=require(_0xdf32('0x6'));var rpc=require('./rpc');var Project=require(_0xdf32('0x7'));var AGIEmitter=require(_0xdf32('0x8'))[_0xdf32('0x9')];var projects=[];config[_0xdf32('0x5')]=_[_0xdf32('0xa')](config[_0xdf32('0x5')],{'ip':_0xdf32('0xb'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x122d95){process[_0xdf32('0xc')](function(){syncho(function(){try{setChannelVariables(_0x122d95);agiHandler(_0x122d95);}catch(_0x592ca0){logger[_0xdf32('0xd')](_0x592ca0[_0xdf32('0xe')]);}});});}function projectUpdateHandler(_0x139870){try{var _0x349751=_['findIndex'](projects,['id',_0x139870['id']]);if(_0x349751>-0x1){if(_0x139870[_0xdf32('0xf')]===!![]){projects['splice'](_0x349751,0x1);}else{projects[_0x349751]=_0x139870;}}else{projects[_0xdf32('0x10')](_0x139870);}}catch(_0x3f331d){logger[_0xdf32('0xd')](_0x3f331d[_0xdf32('0xe')]);}}function listeningHandler(){console[_0xdf32('0x11')](_0xdf32('0x12'),config[_0xdf32('0x5')][_0xdf32('0x13')]);logger[_0xdf32('0x14')](util[_0xdf32('0x15')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xdf32('0x5')]['ip'],config[_0xdf32('0x5')][_0xdf32('0x13')]));}function errorHandler(_0x1614f1){if(_0x1614f1&&_0x1614f1[_0xdf32('0x16')]&&_0x1614f1[_0xdf32('0x17')]){logger[_0xdf32('0xd')](util[_0xdf32('0x15')](_0xdf32('0x18'),_0x1614f1[_0xdf32('0x16')],_0x1614f1[_0xdf32('0x17')]));}else{logger[_0xdf32('0xd')](util[_0xdf32('0x15')](_0xdf32('0x19'),_0x1614f1[_0xdf32('0xe')]));}}function closeHandler(){logger[_0xdf32('0x14')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xdf32('0x1a')],this['calleridname'],this[_0xdf32('0x1b')],this[_0xdf32('0x1c')],this[_0xdf32('0x1d')]));try{createSquareReport(this);}catch(_0x3a03e0){logger['error'](_0x3a03e0[_0xdf32('0xe')]);}}function timeoutHandler(){logger[_0xdf32('0x14')](util[_0xdf32('0x15')](_0xdf32('0x1e'),this['arg_1'],this[_0xdf32('0x1f')],this[_0xdf32('0x1b')],this['dnid'],this[_0xdf32('0x1d')]));}function hangupHandler(){logger['info'](util[_0xdf32('0x15')](_0xdf32('0x20'),this[_0xdf32('0x1a')],this[_0xdf32('0x1f')],this['callerid'],this[_0xdf32('0x1c')],this[_0xdf32('0x1d')]));this[_0xdf32('0x21')]=!![];}function createSquareReport(_0x37a7fd,_0x175755){rpc['createSquareReport'](_0x37a7fd)[_0xdf32('0x22')](function(_0x1a4322){if(_0x175755){_0x175755(null,_0x1a4322);}})[_0xdf32('0x23')](function(_0x55ee93){if(_0x175755){_0x175755(null,_0x55ee93);}});}function setChannelVariables(_0x26fffe){for(var _0x3024a1 in _0x26fffe){if(_0x26fffe[_0xdf32('0x24')](_0x3024a1)){if(_0x3024a1['indexOf'](_0xdf32('0x25'))===0x0){_0x26fffe[_0x3024a1[_0xdf32('0x26')](0x4)]=_0x26fffe[_0x3024a1];delete _0x26fffe[_0x3024a1];}}}}function agiHandler(_0x39c7e6){logger[_0xdf32('0x27')](_0xdf32('0x28'),JSON[_0xdf32('0x29')](_0x39c7e6,null,0x2));logger[_0xdf32('0x14')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x39c7e6[_0xdf32('0x1a')],_0x39c7e6[_0xdf32('0x1f')],_0x39c7e6[_0xdf32('0x1b')],_0x39c7e6['dnid'],_0x39c7e6[_0xdf32('0x1d')]));_0x39c7e6['on']('error',errorHandler);_0x39c7e6['on'](_0xdf32('0x2a'),closeHandler);_0x39c7e6['on'](_0xdf32('0x2b'),timeoutHandler);_0x39c7e6[_0xdf32('0x21')]=![];_0x39c7e6['on'](_0xdf32('0x2c'),hangupHandler);var _0x48e61b=_['find'](projects,[_0xdf32('0x16'),_0x39c7e6[_0xdf32('0x1a')]]);if(!_0x48e61b)return Project[_0xdf32('0x2d')](_0x39c7e6);if(!_0x48e61b[_0xdf32('0x2e')])return Project[_0xdf32('0x2f')](_0x39c7e6);return Project[_0xdf32('0x30')](_0x48e61b,_0x39c7e6);}function main(){var _0x486597;return utilLicense[_0xdf32('0x31')]()['then'](function(_0x1eb807){if(!_0x1eb807)return;if(_0x1eb807[_0xdf32('0x32')]){if(_0x1eb807[_0xdf32('0x33')]&&_0x1eb807['callysquare']>0x0){logger[_0xdf32('0x14')](util[_0xdf32('0x15')](_0xdf32('0x34'),_0x1eb807[_0xdf32('0x33')]));_0x486597=_0x1eb807['callysquare'];}else{logger['info'](_0xdf32('0x35'));}}else{logger[_0xdf32('0x14')](_0xdf32('0x36'));_0x486597=-0x1;}})[_0xdf32('0x22')](function(){return Project[_0xdf32('0x37')]();})[_0xdf32('0x22')](function(_0x2497a2){projects=_0x2497a2;return;})[_0xdf32('0x23')](function(_0xa89299){logger[_0xdf32('0xd')](_0xdf32('0x38'),_0xa89299[_0xdf32('0xe')]);})[_0xdf32('0x39')](function(){var _0xc672a3=require(_0xdf32('0x3a'))(config[_0xdf32('0x5')][_0xdf32('0x13')],config['agi']['ip'],_0x486597);_0xc672a3['on']('error',errorHandler);_0xc672a3['on'](_0xdf32('0x3b'),listeningHandler);_0xc672a3['on'](_0xdf32('0x3c'),connectionHandler);_0xc672a3['on'](_0xdf32('0x2a'),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 6095265..ed81ab5 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 _0xc41e=['sendMailMessage','jayson/promise','client','http','request','error','message','result','catch'];(function(_0x17003a,_0x2e43dd){var _0x5dba8d=function(_0x3d2809){while(--_0x3d2809){_0x17003a['push'](_0x17003a['shift']());}};_0x5dba8d(++_0x2e43dd);}(_0xc41e,0x19f));var _0xec41=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xc41e[_0x618414];return _0x21c19a;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xec41('0x0'));var client=jayson[_0xec41('0x1')][_0xec41('0x2')]({'port':0x232b});function request(_0x2e90e4,_0x541059){return new BPromise(function(_0x2ff1e4,_0x385d64){return client[_0xec41('0x3')](_0x2e90e4,_0x541059)['then'](function(_0x3e6f14){if(_0x3e6f14[_0xec41('0x4')]){return _0x385d64(_0x3e6f14[_0xec41('0x4')][_0xec41('0x5')]);}else{return _0x2ff1e4(_0x3e6f14[_0xec41('0x6')]);}})[_0xec41('0x7')](function(_0x19ad62){return _0x385d64(_0x19ad62);});});}exports[_0xec41('0x8')]=function(_0x68328f,_0x4ba248){return request('SendMail',{'account':_0x68328f,'message':_0x4ba248});}; \ No newline at end of file +var _0xd0cf=['message','catch','sendMailMessage','SendMail','jayson/promise','http','request','then'];(function(_0xd7e023,_0x8354d4){var _0x1def74=function(_0x202a04){while(--_0x202a04){_0xd7e023['push'](_0xd7e023['shift']());}};_0x1def74(++_0x8354d4);}(_0xd0cf,0xac));var _0xfd0c=function(_0x13f2ec,_0x407206){_0x13f2ec=_0x13f2ec-0x0;var _0x389ca9=_0xd0cf[_0x13f2ec];return _0x389ca9;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xfd0c('0x0'));var client=jayson['client'][_0xfd0c('0x1')]({'port':0x232b});function request(_0x150167,_0x5349cf){return new BPromise(function(_0xda0d3d,_0x2be9ab){return client[_0xfd0c('0x2')](_0x150167,_0x5349cf)[_0xfd0c('0x3')](function(_0x1b9fe4){if(_0x1b9fe4['error']){return _0x2be9ab(_0x1b9fe4['error'][_0xfd0c('0x4')]);}else{return _0xda0d3d(_0x1b9fe4['result']);}})[_0xfd0c('0x5')](function(_0x2435f1){return _0x2be9ab(_0x2435f1);});});}exports[_0xfd0c('0x6')]=function(_0x2b9ed0,_0x29d8da){return request(_0xfd0c('0x7'),{'account':_0x2b9ed0,'message':_0x29d8da});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 6ccd23b..877bb6c 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 _0x4725=['util','../../config/logger','agi','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','stack','hasOwnProperty','retry','addVertex','length','source','target','addEdge','toJson','mxGraphModel','inspect','production','start','debug','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','traverseBFS','clear','vertex','agicommand','info','context','extension','priority','response','result','evtHangup','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','toString','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','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json'];(function(_0x455ed6,_0x2bd239){var _0x810daf=function(_0xb65c0){while(--_0xb65c0){_0x455ed6['push'](_0x455ed6['shift']());}};_0x810daf(++_0x2bd239);}(_0x4725,0xf1));var _0x5472=function(_0x1d2011,_0x18f953){_0x1d2011=_0x1d2011-0x0;var _0x582358=_0x4725[_0x1d2011];return _0x582358;};'use strict';var _=require(_0x5472('0x0'));var moment=require(_0x5472('0x1'));var parser=require(_0x5472('0x2'));var util=require(_0x5472('0x3'));var logger=require(_0x5472('0x4'))(_0x5472('0x5'));var rpc=require(_0x5472('0x6'));var mailRpc=require(_0x5472('0x7'));var Graph=require('./graph');var Vertices=require(_0x5472('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x5472('0x9')]()[_0x5472('0xa')](function(_0x2338a8){logger[_0x5472('0xb')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x2338a8[_0x5472('0xc')]);return[];});}function addVertex(_0x542ee9,_0x1a8105,_0x33a60e){_0x1a8105['agicommand']=_0x33a60e;if(_0x1a8105[_0x5472('0xd')](_0x5472('0xe'))){_0x1a8105['maxRetry']=parseInt(_0x1a8105[_0x5472('0xe')],0xa);}_0x542ee9[_0x5472('0xf')](_['omit'](_0x1a8105,'mxCell'));}function initGraph(_0x4af54b,_0x5dec4e){var _0x2e752a=new Graph();for(var _0x1d26ad in _0x4af54b){if(_0x4af54b[_0x5472('0xd')](_0x1d26ad)){if(_['isArray'](_0x4af54b[_0x1d26ad])){for(var _0x42cf3e=0x0;_0x42cf3e<_0x4af54b[_0x1d26ad][_0x5472('0x10')];_0x42cf3e+=0x1){addVertex(_0x2e752a,_0x4af54b[_0x1d26ad][_0x42cf3e],_0x1d26ad);}}else{addVertex(_0x2e752a,_0x4af54b[_0x1d26ad],_0x1d26ad);}}}for(var _0x14b025=0x0;_0x14b025<_0x5dec4e['length'];_0x14b025+=0x1){if(_0x5dec4e[_0x14b025][_0x5472('0x11')]&&_0x5dec4e[_0x14b025][_0x5472('0x12')]){_0x2e752a[_0x5472('0x13')](_0x5dec4e[_0x14b025]['source'],_0x5dec4e[_0x14b025][_0x5472('0x12')],_0x5dec4e[_0x14b025]['value']);}}return _0x2e752a;}function getRoot(_0x12f41e){return parser[_0x5472('0x14')](_0x12f41e,{'object':!![]})[_0x5472('0x15')]['root'];}function inspect(_0x2364d3){return util[_0x5472('0x16')](_0x2364d3,{'showHidden':![],'depth':null});}function initialize(_0x17cac1,_0xbdb634){var _0xae3053=getRoot(_0x17cac1[_0x5472('0x17')]);if(!_0xae3053||!_0xae3053[_0x5472('0x18')])return;var _0x2ffd54,_0x311e5b,_0x2e7dfa;logger[_0x5472('0x19')](_0x5472('0x1a'),JSON[_0x5472('0x1b')](_0xae3053,null,0x2));_0xbdb634[_0x5472('0x1c')]=moment()[_0x5472('0x1d')](_0x5472('0x1e'));_0x2ffd54=initGraph(_[_0x5472('0x1f')](_0xae3053,'mxCell'),_0xae3053[_0x5472('0x20')]);_0x311e5b=new Vertices(_0xbdb634,rpc,mailRpc);logger['info'](util[_0x5472('0x1d')](_0x5472('0x21'),_0xbdb634['arg_1'],_0xbdb634[_0x5472('0x22')],_0xbdb634['callerid'],_0xbdb634[_0x5472('0x23')],_0xbdb634[_0x5472('0x24')]));_0x2ffd54[_0x5472('0x25')](_0xae3053[_0x5472('0x18')]['id'],function(_0x2479b8){try{_0x2479b8=_0x311e5b[_0x5472('0x26')](_0x2479b8);logger[_0x5472('0x19')](_0x5472('0x27'),JSON[_0x5472('0x1b')](_0x2479b8,null,0x2));if(_0x2479b8[_0x5472('0x28')]==='gotoc'){logger[_0x5472('0x29')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0xbdb634['context']=_0x2479b8['context']||_0xbdb634[_0x5472('0x2a')];_0xbdb634['extension']=_0x2479b8[_0x5472('0x2b')];_0xbdb634[_0x5472('0x2c')]=_0x2479b8[_0x5472('0x2c')]?_0x2479b8[_0x5472('0x2c')]-0x1:0x1;return null;}else if(_0x2479b8&&_0x311e5b[_0x2479b8['agicommand']]){_0x2e7dfa=_0x311e5b[_0x2479b8[_0x5472('0x28')]](_0x2479b8);logger[_0x5472('0x29')](_0x5472('0x2d'),JSON['stringify'](_0x2e7dfa,null,0x2));if(_0x2e7dfa&&_0x2e7dfa['code']===AGI_CODE_SUCCESS&&_0x2e7dfa[_0x5472('0x2e')]!==AGI_RESULT_ERROR&&!_0xbdb634[_0x5472('0x2f')]){logger['debug'](_0x5472('0x2d'),inspect(_0x2e7dfa));return _['isUndefined'](_0x2e7dfa['result'])?null:_0x2e7dfa[_0x5472('0x2e')]['toString']();}else{logger[_0x5472('0xb')](_0x5472('0x2d'),inspect(_0x2e7dfa));return null;}}else{logger[_0x5472('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x2b03ec){logger[_0x5472('0xb')](_0x2b03ec[_0x5472('0xc')]);return null;}});if(_0xae3053[_0x5472('0x30')]){logger[_0x5472('0x29')](util['format'](_0x5472('0x31'),_0xbdb634[_0x5472('0x32')],_0xbdb634[_0x5472('0x22')],_0xbdb634[_0x5472('0x33')],_0xbdb634[_0x5472('0x23')],_0xbdb634['uniqueid']));_0x2ffd54[_0x5472('0x25')](_0xae3053['finally']['id'],function(_0x5ce1b2){try{_0x5ce1b2=_0x311e5b[_0x5472('0x26')](_0x5ce1b2);logger[_0x5472('0x19')](_0x5472('0x27'),JSON[_0x5472('0x1b')](_0x5ce1b2,null,0x2));if(_0x5ce1b2&&_0x311e5b[_0x5ce1b2[_0x5472('0x28')]]){_0x2e7dfa=_0x311e5b[_0x5ce1b2['agicommand']](_0x5ce1b2);if(_0x2e7dfa){logger['debug'](_0x5472('0x2d'),inspect(_0x2e7dfa));return _['isUndefined'](_0x2e7dfa[_0x5472('0x2e')])?null:_0x2e7dfa['result'][_0x5472('0x34')]();}else{logger[_0x5472('0xb')]('response',inspect(_0x2e7dfa));return null;}}else{logger[_0x5472('0xb')](_0x5472('0x35'));return null;}}catch(_0x50aa52){logger[_0x5472('0xb')](_0x50aa52['stack']);return null;}});}logger[_0x5472('0x29')](util[_0x5472('0x1d')](_0x5472('0x36'),_0xbdb634[_0x5472('0x32')],_0xbdb634[_0x5472('0x22')],_0xbdb634['callerid'],_0xbdb634[_0x5472('0x23')],_0xbdb634[_0x5472('0x24')]));logger[_0x5472('0x29')](util['format'](_0x5472('0x37'),_0xbdb634['context'],_0xbdb634[_0x5472('0x2b')],parseInt(_0xbdb634[_0x5472('0x2c')],0xa)+0x1));_0xbdb634[_0x5472('0x38')](_0xbdb634[_0x5472('0x2a')],_0xbdb634[_0x5472('0x2b')],parseInt(_0xbdb634[_0x5472('0x2c')],0xa)+0x1);_0xbdb634[_0x5472('0x39')]();}function handleNotFound(_0x356f51){logger[_0x5472('0xb')](util[_0x5472('0x1d')](_0x5472('0x3a'),_0x356f51[_0x5472('0x32')]));_0x356f51[_0x5472('0x38')](_0x356f51[_0x5472('0x2a')],_0x356f51[_0x5472('0x2b')],parseInt(_0x356f51[_0x5472('0x2c')],0xa)+0x1);_0x356f51[_0x5472('0x39')]();}function handleUnpublished(_0x340e97){logger[_0x5472('0xb')](util[_0x5472('0x1d')](_0x5472('0x3b'),_0x340e97[_0x5472('0x32')]));_0x340e97[_0x5472('0x38')](_0x340e97[_0x5472('0x2a')],_0x340e97['extension'],parseInt(_0x340e97[_0x5472('0x2c')],0xa)+0x1);_0x340e97[_0x5472('0x39')]();}module[_0x5472('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x8b3b=['response','result','evtHangup','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','traverseBFS','agicommand\x20not\x20found','dnid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','xml2json','../../config/logger','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','stack','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','source','target','addEdge','inspect','production','start','debug','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','format','arg_1','callerid','uniqueid','clear','vertex','agicommand','gotoc','context','extension','priority','info'];(function(_0xe56790,_0x5f304d){var _0x145cf7=function(_0x49aeb1){while(--_0x49aeb1){_0xe56790['push'](_0xe56790['shift']());}};_0x145cf7(++_0x5f304d);}(_0x8b3b,0x129));var _0xb8b3=function(_0xe6beba,_0x3f15d1){_0xe6beba=_0xe6beba-0x0;var _0x2f1c08=_0x8b3b[_0xe6beba];return _0x2f1c08;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0xb8b3('0x0'));var util=require('util');var logger=require(_0xb8b3('0x1'))('agi');var rpc=require(_0xb8b3('0x2'));var mailRpc=require(_0xb8b3('0x3'));var Graph=require('./graph');var Vertices=require(_0xb8b3('0x4'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xb8b3('0x5')]()[_0xb8b3('0x6')](function(_0x110062){logger[_0xb8b3('0x7')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x110062[_0xb8b3('0x8')]);return[];});}function addVertex(_0x519070,_0x150e36,_0x12b9d6){_0x150e36['agicommand']=_0x12b9d6;if(_0x150e36[_0xb8b3('0x9')]('retry')){_0x150e36[_0xb8b3('0xa')]=parseInt(_0x150e36[_0xb8b3('0xb')],0xa);}_0x519070['addVertex'](_[_0xb8b3('0xc')](_0x150e36,_0xb8b3('0xd')));}function initGraph(_0x5bef2f,_0x205b6b){var _0x5d6eea=new Graph();for(var _0x546d08 in _0x5bef2f){if(_0x5bef2f[_0xb8b3('0x9')](_0x546d08)){if(_[_0xb8b3('0xe')](_0x5bef2f[_0x546d08])){for(var _0x3545ee=0x0;_0x3545ee<_0x5bef2f[_0x546d08]['length'];_0x3545ee+=0x1){addVertex(_0x5d6eea,_0x5bef2f[_0x546d08][_0x3545ee],_0x546d08);}}else{addVertex(_0x5d6eea,_0x5bef2f[_0x546d08],_0x546d08);}}}for(var _0x96f04c=0x0;_0x96f04c<_0x205b6b[_0xb8b3('0xf')];_0x96f04c+=0x1){if(_0x205b6b[_0x96f04c][_0xb8b3('0x10')]&&_0x205b6b[_0x96f04c][_0xb8b3('0x11')]){_0x5d6eea[_0xb8b3('0x12')](_0x205b6b[_0x96f04c][_0xb8b3('0x10')],_0x205b6b[_0x96f04c][_0xb8b3('0x11')],_0x205b6b[_0x96f04c]['value']);}}return _0x5d6eea;}function getRoot(_0xe0d2ea){return parser['toJson'](_0xe0d2ea,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x565899){return util[_0xb8b3('0x13')](_0x565899,{'showHidden':![],'depth':null});}function initialize(_0xa453d7,_0x5d253a){var _0x3bb238=getRoot(_0xa453d7[_0xb8b3('0x14')]);if(!_0x3bb238||!_0x3bb238[_0xb8b3('0x15')])return;var _0x4363fa,_0x29a17f,_0x273ee9;logger[_0xb8b3('0x16')](_0xb8b3('0x17'),JSON[_0xb8b3('0x18')](_0x3bb238,null,0x2));_0x5d253a[_0xb8b3('0x19')]=moment()['format'](_0xb8b3('0x1a'));_0x4363fa=initGraph(_[_0xb8b3('0xc')](_0x3bb238,_0xb8b3('0xd')),_0x3bb238[_0xb8b3('0xd')]);_0x29a17f=new Vertices(_0x5d253a,rpc,mailRpc);logger['info'](util[_0xb8b3('0x1b')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5d253a[_0xb8b3('0x1c')],_0x5d253a['calleridname'],_0x5d253a[_0xb8b3('0x1d')],_0x5d253a['dnid'],_0x5d253a[_0xb8b3('0x1e')]));_0x4363fa['traverseBFS'](_0x3bb238['start']['id'],function(_0x3e89fb){try{_0x3e89fb=_0x29a17f[_0xb8b3('0x1f')](_0x3e89fb);logger[_0xb8b3('0x16')](_0xb8b3('0x20'),JSON['stringify'](_0x3e89fb,null,0x2));if(_0x3e89fb[_0xb8b3('0x21')]===_0xb8b3('0x22')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x5d253a['context']=_0x3e89fb[_0xb8b3('0x23')]||_0x5d253a['context'];_0x5d253a['extension']=_0x3e89fb[_0xb8b3('0x24')];_0x5d253a[_0xb8b3('0x25')]=_0x3e89fb[_0xb8b3('0x25')]?_0x3e89fb['priority']-0x1:0x1;return null;}else if(_0x3e89fb&&_0x29a17f[_0x3e89fb[_0xb8b3('0x21')]]){_0x273ee9=_0x29a17f[_0x3e89fb[_0xb8b3('0x21')]](_0x3e89fb);logger[_0xb8b3('0x26')](_0xb8b3('0x27'),JSON[_0xb8b3('0x18')](_0x273ee9,null,0x2));if(_0x273ee9&&_0x273ee9['code']===AGI_CODE_SUCCESS&&_0x273ee9[_0xb8b3('0x28')]!==AGI_RESULT_ERROR&&!_0x5d253a[_0xb8b3('0x29')]){logger[_0xb8b3('0x16')](_0xb8b3('0x27'),inspect(_0x273ee9));return _[_0xb8b3('0x2a')](_0x273ee9[_0xb8b3('0x28')])?null:_0x273ee9[_0xb8b3('0x28')][_0xb8b3('0x2b')]();}else{logger[_0xb8b3('0x7')](_0xb8b3('0x27'),inspect(_0x273ee9));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x545793){logger[_0xb8b3('0x7')](_0x545793[_0xb8b3('0x8')]);return null;}});if(_0x3bb238[_0xb8b3('0x2c')]){logger['info'](util[_0xb8b3('0x1b')](_0xb8b3('0x2d'),_0x5d253a[_0xb8b3('0x1c')],_0x5d253a[_0xb8b3('0x2e')],_0x5d253a[_0xb8b3('0x1d')],_0x5d253a['dnid'],_0x5d253a[_0xb8b3('0x1e')]));_0x4363fa[_0xb8b3('0x2f')](_0x3bb238['finally']['id'],function(_0x3e5252){try{_0x3e5252=_0x29a17f[_0xb8b3('0x1f')](_0x3e5252);logger['debug']('vertex',JSON[_0xb8b3('0x18')](_0x3e5252,null,0x2));if(_0x3e5252&&_0x29a17f[_0x3e5252['agicommand']]){_0x273ee9=_0x29a17f[_0x3e5252[_0xb8b3('0x21')]](_0x3e5252);if(_0x273ee9){logger[_0xb8b3('0x16')](_0xb8b3('0x27'),inspect(_0x273ee9));return _[_0xb8b3('0x2a')](_0x273ee9[_0xb8b3('0x28')])?null:_0x273ee9[_0xb8b3('0x28')][_0xb8b3('0x2b')]();}else{logger[_0xb8b3('0x7')]('response',inspect(_0x273ee9));return null;}}else{logger[_0xb8b3('0x7')](_0xb8b3('0x30'));return null;}}catch(_0x21c00b){logger['error'](_0x21c00b['stack']);return null;}});}logger['info'](util[_0xb8b3('0x1b')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5d253a[_0xb8b3('0x1c')],_0x5d253a[_0xb8b3('0x2e')],_0x5d253a[_0xb8b3('0x1d')],_0x5d253a[_0xb8b3('0x31')],_0x5d253a['uniqueid']));logger['info'](util['format'](_0xb8b3('0x32'),_0x5d253a['context'],_0x5d253a[_0xb8b3('0x24')],parseInt(_0x5d253a[_0xb8b3('0x25')],0xa)+0x1));_0x5d253a[_0xb8b3('0x33')](_0x5d253a[_0xb8b3('0x23')],_0x5d253a[_0xb8b3('0x24')],parseInt(_0x5d253a['priority'],0xa)+0x1);_0x5d253a[_0xb8b3('0x34')]();}function handleNotFound(_0x514db2){logger[_0xb8b3('0x7')](util[_0xb8b3('0x1b')](_0xb8b3('0x35'),_0x514db2['arg_1']));_0x514db2[_0xb8b3('0x33')](_0x514db2['context'],_0x514db2[_0xb8b3('0x24')],parseInt(_0x514db2[_0xb8b3('0x25')],0xa)+0x1);_0x514db2[_0xb8b3('0x34')]();}function handleUnpublished(_0x2ccf01){logger['error'](util[_0xb8b3('0x1b')](_0xb8b3('0x36'),_0x2ccf01[_0xb8b3('0x1c')]));_0x2ccf01['continueAt'](_0x2ccf01[_0xb8b3('0x23')],_0x2ccf01[_0xb8b3('0x24')],parseInt(_0x2ccf01[_0xb8b3('0x25')],0xa)+0x1);_0x2ccf01[_0xb8b3('0x34')]();}module[_0xb8b3('0x37')]={'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 1567e85..390cf20 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 _0xbd06=['util','stream','Transform','call','_localBuffer','_inBody','prototype','toString','indexOf','substring','slice','trim','length','emit','headers'];(function(_0x842838,_0x45729c){var _0x235880=function(_0x445fd2){while(--_0x445fd2){_0x842838['push'](_0x842838['shift']());}};_0x235880(++_0x45729c);}(_0xbd06,0x78));var _0x6bd0=function(_0x4b612a,_0x56d994){_0x4b612a=_0x4b612a-0x0;var _0x2e3503=_0xbd06[_0x4b612a];return _0x2e3503;};'use strict';var util=require(_0x6bd0('0x0'));var Transform=require(_0x6bd0('0x1'))[_0x6bd0('0x2')];function AGIReply(_0x49c40a){Transform[_0x6bd0('0x3')](this,_0x49c40a);this[_0x6bd0('0x4')]='';this[_0x6bd0('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x6bd0('0x6')]['_transform']=function(_0x58af19,_0x400196,_0x98ae09){var _0x1537ea='\x0a',_0x12e485=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x354187=-0x1,_0x4d86d6=-0x1,_0x132afd='',_0x2a268d=0x0,_0x2f9aad='',_0x14a681='';this['_localBuffer']+=_0x58af19[_0x6bd0('0x7')]();_0x2f9aad=this[_0x6bd0('0x4')];if(!this[_0x6bd0('0x5')]){_0x2a268d=0x0;while(_0x12e485[_0x2a268d]){while((_0x4d86d6=_0x2f9aad[_0x6bd0('0x8')](_0x12e485[_0x2a268d]))!=-0x1){_0x132afd=_0x12e485[_0x2a268d];_0x14a681=_0x2f9aad[_0x6bd0('0x9')](0x0,_0x4d86d6);_0x2f9aad=_0x2f9aad['substring'](_0x4d86d6+_0x132afd['length']);var _0x1e23fb=_0x14a681['split'](_0x1537ea),_0x1f8a41=0x0,_0x2fea02={},_0x4dc40f='',_0x2f2a72='',_0x25ee5b=-0x1;while(_0x1e23fb[_0x1f8a41]){_0x25ee5b=_0x1e23fb[_0x1f8a41]['indexOf'](':');if(_0x25ee5b!=-0x1){_0x4dc40f=_0x1e23fb[_0x1f8a41][_0x6bd0('0xa')](0x0,_0x25ee5b)[_0x6bd0('0xb')]();_0x2f2a72=_0x1e23fb[_0x1f8a41][_0x6bd0('0xa')](_0x25ee5b+0x1)[_0x6bd0('0xb')]();if(_0x4dc40f[_0x6bd0('0xc')]>0x0){_0x2fea02[_0x4dc40f]=_0x2f2a72;}}else{}_0x1f8a41++;}this[_0x6bd0('0xd')](_0x6bd0('0xe'),_0x2fea02);this[_0x6bd0('0x5')]=!![];}_0x2a268d++;}this[_0x6bd0('0x4')]=_0x2f9aad;}else{while((_0x354187=_0x2f9aad[_0x6bd0('0x8')](_0x1537ea))!=-0x1){_0x14a681=_0x2f9aad['substring'](0x0,_0x354187);this[_0x6bd0('0xd')]('line',_0x14a681);_0x2f9aad=_0x2f9aad['substring'](_0x354187+_0x1537ea[_0x6bd0('0xc')]);}this['_localBuffer']=_0x2f9aad;}_0x98ae09();};module['exports']=AGIReply; \ No newline at end of file +var _0x9931=['line','util','stream','Transform','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','emit','headers'];(function(_0x3d1244,_0x156028){var _0x5d6372=function(_0x509c76){while(--_0x509c76){_0x3d1244['push'](_0x3d1244['shift']());}};_0x5d6372(++_0x156028);}(_0x9931,0xb1));var _0x1993=function(_0x360292,_0x19fe90){_0x360292=_0x360292-0x0;var _0x23300d=_0x9931[_0x360292];return _0x23300d;};'use strict';var util=require(_0x1993('0x0'));var Transform=require(_0x1993('0x1'))[_0x1993('0x2')];function AGIReply(_0x3f57ef){Transform['call'](this,_0x3f57ef);this[_0x1993('0x3')]='';this[_0x1993('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x1993('0x5')]=function(_0x3a5985,_0x42256c,_0x286006){var _0x5281c2='\x0a',_0x1e1538=['\x0a\x0a',_0x1993('0x6')],_0xe25f47=-0x1,_0x105f47=-0x1,_0x1fdd12='',_0xfcc440=0x0,_0x5da5eb='',_0x98e5a='';this[_0x1993('0x3')]+=_0x3a5985[_0x1993('0x7')]();_0x5da5eb=this['_localBuffer'];if(!this[_0x1993('0x4')]){_0xfcc440=0x0;while(_0x1e1538[_0xfcc440]){while((_0x105f47=_0x5da5eb[_0x1993('0x8')](_0x1e1538[_0xfcc440]))!=-0x1){_0x1fdd12=_0x1e1538[_0xfcc440];_0x98e5a=_0x5da5eb[_0x1993('0x9')](0x0,_0x105f47);_0x5da5eb=_0x5da5eb[_0x1993('0x9')](_0x105f47+_0x1fdd12[_0x1993('0xa')]);var _0x2a048a=_0x98e5a[_0x1993('0xb')](_0x5281c2),_0x57a9ed=0x0,_0x497a85={},_0x3d1252='',_0x66c0bc='',_0x54de7f=-0x1;while(_0x2a048a[_0x57a9ed]){_0x54de7f=_0x2a048a[_0x57a9ed]['indexOf'](':');if(_0x54de7f!=-0x1){_0x3d1252=_0x2a048a[_0x57a9ed][_0x1993('0xc')](0x0,_0x54de7f)['trim']();_0x66c0bc=_0x2a048a[_0x57a9ed][_0x1993('0xc')](_0x54de7f+0x1)['trim']();if(_0x3d1252['length']>0x0){_0x497a85[_0x3d1252]=_0x66c0bc;}}else{}_0x57a9ed++;}this[_0x1993('0xd')](_0x1993('0xe'),_0x497a85);this[_0x1993('0x4')]=!![];}_0xfcc440++;}this[_0x1993('0x3')]=_0x5da5eb;}else{while((_0xe25f47=_0x5da5eb[_0x1993('0x8')](_0x5281c2))!=-0x1){_0x98e5a=_0x5da5eb[_0x1993('0x9')](0x0,_0xe25f47);this['emit'](_0x1993('0xf'),_0x98e5a);_0x5da5eb=_0x5da5eb[_0x1993('0x9')](_0xe25f47+_0x5281c2[_0x1993('0xa')]);}this['_localBuffer']=_0x5da5eb;}_0x286006();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 918154f..3a48aea 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 _0x5183=['createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','error','getSquareProjects','GetSquareProjects','production','ShowSquareProject','ShowMailAccount','Smtp','CloudProvider','name','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0x371b2d,_0x5ab3e6){var _0x493f53=function(_0x82f3b){while(--_0x82f3b){_0x371b2d['push'](_0x371b2d['shift']());}};_0x493f53(++_0x5ab3e6);}(_0x5183,0x13e));var _0x3518=function(_0x4e4047,_0xa85229){_0x4e4047=_0x4e4047-0x0;var _0x6610e6=_0x5183[_0x4e4047];return _0x6610e6;};'use strict';var _=require(_0x3518('0x0'));var moment=require(_0x3518('0x1'));var jayson=require(_0x3518('0x2'));var client=jayson['client']['http']({'port':0x2329});function request(_0x2323f3,_0x3cc276){return new Promise(function(_0x178571,_0x421ab5){return client['request'](_0x2323f3,_0x3cc276)['then'](function(_0x242c22){if(_0x242c22[_0x3518('0x3')]){return _0x421ab5(_0x242c22[_0x3518('0x3')]['message']);}else{return _0x178571(_0x242c22['result']);}})['catch'](function(_0x147b59){return _0x421ab5(_0x147b59);});});}exports[_0x3518('0x4')]=function(){return request(_0x3518('0x5'),{'options':{'raw':![],'attributes':['id','name',_0x3518('0x6')]}});};exports['getSquareProject']=function(_0x16931f){return request(_0x3518('0x7'),{'options':{'raw':![],'where':{'name':_0x16931f},'attributes':[_0x3518('0x6')]}});};exports['getMailAccountById']=function(_0x3a60c7){return request(_0x3518('0x8'),{'options':{'raw':![],'where':{'id':_0x3a60c7},'include':[{'model':'MailServerOut','as':_0x3518('0x9'),'include':[{'model':_0x3518('0xa'),'as':_0x3518('0xa')}]}],'attributes':['id',_0x3518('0xb'),'email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x7f5c5a){return request(_0x3518('0x7'),{'options':{'where':{'id':_0x7f5c5a},'attributes':[_0x3518('0xb')]}});};exports['getVoiceQueueById']=function(_0x563507){return request(_0x3518('0xc'),{'options':{'where':{'id':_0x563507},'attributes':[_0x3518('0xb')]}});};exports[_0x3518('0xd')]=function(_0x488364){return request(_0x3518('0xe'),{'options':{'where':{'id':_0x488364},'attributes':[_0x3518('0xb')]}});};exports[_0x3518('0xf')]=function(_0x30a74d){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x30a74d},'attributes':[_0x3518('0x10')]}});};exports['getUserById']=function(_0xd24f36){return request('ShowUser',{'options':{'where':{'id':_0xd24f36},'attributes':[_0x3518('0xb')]}});};exports[_0x3518('0x11')]=function(_0x4b9a06){return request(_0x3518('0x12'),{'options':{'where':{'phone':_0x4b9a06[_0x3518('0x13')]},'attributes':['id']}});};exports[_0x3518('0x14')]=function(_0x8092d6){return request(_0x3518('0x15'),{'options':{'where':{'id':_0x8092d6},'attributes':['name']}});};exports[_0x3518('0x16')]=function(_0x568f26){return request(_0x3518('0x17'),{'options':{'where':{'id':_0x568f26},'attributes':[_0x3518('0x18')]}});};exports[_0x3518('0x19')]=function(_0x507047){return request(_0x3518('0x1a'),{'options':{'raw':![],'where':{'id':_0x507047},'include':[{'model':_0x3518('0x1b'),'as':_0x3518('0x1c')}]}});};exports[_0x3518('0x1d')]=function(_0x1d76fe){return request('ShowSmsAccount',{'options':{'where':{'id':_0x1d76fe},'attributes':['id',_0x3518('0xb')]}});};exports[_0x3518('0x1e')]=function(_0x421c2e){return request(_0x3518('0x1f'),{'body':_0x421c2e});};exports[_0x3518('0x20')]=function(_0x3aa4e0){return request(_0x3518('0x21'),{'body':_0x3aa4e0});};exports[_0x3518('0x22')]=function(_0x8baad6){return request(_0x3518('0x23'),{'body':_[_0x3518('0x24')](_0x8baad6,{'project_name':_0x8baad6[_0x3518('0x25')],'prev_project_name':_0x8baad6[_0x3518('0x26')]||'','is_subproject':_0x8baad6[_0x3518('0x26')]?!![]:![],'leaveAt':moment()[_0x3518('0x27')](_0x3518('0x28'))})});};exports[_0x3518('0x29')]=function(_0x30ebce){return request(_0x3518('0x2a'),{'body':_0x30ebce});};exports[_0x3518('0x2b')]=function(_0x34a6d6){return request(_0x3518('0x2c'),{'body':_0x34a6d6});};exports[_0x3518('0x2d')]=function(_0x369d58){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x369d58['phone'],'ListId':_0x369d58[_0x3518('0x2e')]}}})[_0x3518('0x2f')](function(_0x4c16d6){if(_0x4c16d6){return _0x4c16d6;}return request(_0x3518('0x30'),{'body':_0x369d58});});};exports[_0x3518('0x31')]=function(_0x5986e1){return request(_0x3518('0x32'),{'options':{'where':{'id':_0x5986e1},'attributes':['name']}});};exports[_0x3518('0x33')]=function(_0x550c64,_0x6f3e96){return request(_0x3518('0x34'),{'body':{'interface':_0x6f3e96},'options':{'where':_0x550c64}});};exports[_0x3518('0x35')]=function(_0x16f354,_0xf5ad75,_0x3e7d29){return request('PauseUser',{'body':{'type':_0xf5ad75,'uniqueid':_0x3e7d29},'options':{'where':_0x16f354}});};exports[_0x3518('0x36')]=function(_0x5bc9c3){return request(_0x3518('0x37'),{'body':{},'options':{'where':_0x5bc9c3}});};exports[_0x3518('0x38')]=function(_0x313be1){return request(_0x3518('0x39'),{'body':{},'options':{'where':_0x313be1}});}; \ No newline at end of file +var _0x12cc=['CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','CreateSquareRecording','CreateSquareMessage','createCmContact','ListId','then','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','http','request','error','message','result','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','phone','getTrunkById','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport'];(function(_0x27c273,_0x42fed8){var _0x4f143e=function(_0x4cb1b9){while(--_0x4cb1b9){_0x27c273['push'](_0x27c273['shift']());}};_0x4f143e(++_0x42fed8);}(_0x12cc,0xc2));var _0xc12c=function(_0x77558f,_0x32561c){_0x77558f=_0x77558f-0x0;var _0x3fc2c5=_0x12cc[_0x77558f];return _0x3fc2c5;};'use strict';var _=require('lodash');var moment=require(_0xc12c('0x0'));var jayson=require(_0xc12c('0x1'));var client=jayson[_0xc12c('0x2')][_0xc12c('0x3')]({'port':0x2329});function request(_0x6719fc,_0x554e98){return new Promise(function(_0x48809a,_0x3e773c){return client[_0xc12c('0x4')](_0x6719fc,_0x554e98)['then'](function(_0x58011c){if(_0x58011c['error']){return _0x3e773c(_0x58011c[_0xc12c('0x5')][_0xc12c('0x6')]);}else{return _0x48809a(_0x58011c[_0xc12c('0x7')]);}})['catch'](function(_0x488940){return _0x3e773c(_0x488940);});});}exports[_0xc12c('0x8')]=function(){return request(_0xc12c('0x9'),{'options':{'raw':![],'attributes':['id',_0xc12c('0xa'),'production']}});};exports[_0xc12c('0xb')]=function(_0x1e7cb7){return request(_0xc12c('0xc'),{'options':{'raw':![],'where':{'name':_0x1e7cb7},'attributes':['production']}});};exports[_0xc12c('0xd')]=function(_0x30cfc9){return request(_0xc12c('0xe'),{'options':{'raw':![],'where':{'id':_0x30cfc9},'include':[{'model':_0xc12c('0xf'),'as':_0xc12c('0x10'),'include':[{'model':_0xc12c('0x11'),'as':'CloudProvider'}]}],'attributes':['id',_0xc12c('0xa'),_0xc12c('0x12')],'smtp':!![]}});};exports[_0xc12c('0x13')]=function(_0x54aa3e){return request('ShowSquareProject',{'options':{'where':{'id':_0x54aa3e},'attributes':[_0xc12c('0xa')]}});};exports['getVoiceQueueById']=function(_0x2400e7){return request(_0xc12c('0x14'),{'options':{'where':{'id':_0x2400e7},'attributes':['name']}});};exports[_0xc12c('0x15')]=function(_0x51175b){return request(_0xc12c('0x16'),{'options':{'where':{'id':_0x51175b},'attributes':[_0xc12c('0xa')]}});};exports['getSquareOdbcById']=function(_0x518d31){return request(_0xc12c('0x17'),{'options':{'where':{'id':_0x518d31},'attributes':[_0xc12c('0x18')]}});};exports['getUserById']=function(_0x3f5828){return request(_0xc12c('0x19'),{'options':{'where':{'id':_0x3f5828},'attributes':[_0xc12c('0xa')]}});};exports[_0xc12c('0x1a')]=function(_0x19a59a){return request('GetContactByPhone',{'options':{'where':{'phone':_0x19a59a[_0xc12c('0x1b')]},'attributes':['id']}});};exports[_0xc12c('0x1c')]=function(_0x394ad2){return request('ShowTrunk',{'options':{'where':{'id':_0x394ad2},'attributes':[_0xc12c('0xa')]}});};exports[_0xc12c('0x1d')]=function(_0x4af098){return request('ShowSound',{'options':{'where':{'id':_0x4af098},'attributes':['save_name']}});};exports[_0xc12c('0x1e')]=function(_0x46751b){return request(_0xc12c('0x1f'),{'options':{'raw':![],'where':{'id':_0x46751b},'include':[{'model':_0xc12c('0x20'),'as':_0xc12c('0x21')}]}});};exports[_0xc12c('0x22')]=function(_0x2b13db){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2b13db},'attributes':['id',_0xc12c('0xa')]}});};exports[_0xc12c('0x23')]=function(_0x26cef4){return request(_0xc12c('0x24'),{'body':_0x26cef4});};exports[_0xc12c('0x25')]=function(_0x423bbd){return request(_0xc12c('0x26'),{'body':_0x423bbd});};exports[_0xc12c('0x27')]=function(_0x446ed5){return request(_0xc12c('0x28'),{'body':_[_0xc12c('0x29')](_0x446ed5,{'project_name':_0x446ed5[_0xc12c('0x2a')],'prev_project_name':_0x446ed5[_0xc12c('0x2b')]||'','is_subproject':_0x446ed5[_0xc12c('0x2b')]?!![]:![],'leaveAt':moment()[_0xc12c('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x148373){return request(_0xc12c('0x2d'),{'body':_0x148373});};exports['createSquareMessage']=function(_0x2eee53){return request(_0xc12c('0x2e'),{'body':_0x2eee53});};exports[_0xc12c('0x2f')]=function(_0x330bb9){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x330bb9[_0xc12c('0x1b')],'ListId':_0x330bb9[_0xc12c('0x30')]}}})[_0xc12c('0x31')](function(_0x2de75f){if(_0x2de75f){return _0x2de75f;}return request('CreateCmContact',{'body':_0x330bb9});});};exports['getPauseById']=function(_0x51e763){return request(_0xc12c('0x32'),{'options':{'where':{'id':_0x51e763},'attributes':[_0xc12c('0xa')]}});};exports[_0xc12c('0x33')]=function(_0x214d5e,_0x550fc6){return request(_0xc12c('0x34'),{'body':{'interface':_0x550fc6},'options':{'where':_0x214d5e}});};exports[_0xc12c('0x35')]=function(_0x697b1f,_0x2f4ae6,_0x5e9aaf){return request(_0xc12c('0x36'),{'body':{'type':_0x2f4ae6,'uniqueid':_0x5e9aaf},'options':{'where':_0x697b1f}});};exports['agentUnpause']=function(_0x2d02e4){return request(_0xc12c('0x37'),{'body':{},'options':{'where':_0x2d02e4}});};exports[_0xc12c('0x38')]=function(_0x4d50fe){return request(_0xc12c('0x39'),{'body':{},'options':{'where':_0x4d50fe}});}; \ 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 5568f80..19eedd2 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 _0xcedf=['./polly','./lex','exports'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xcedf,0x1b6));var _0xfced=function(_0x929b28,_0x47e555){_0x929b28=_0x929b28-0x0;var _0x27b409=_0xcedf[_0x929b28];return _0x27b409;};var polly=require(_0xfced('0x0'));var lex=require(_0xfced('0x1'));module[_0xfced('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x176c=['./lex','exports','./polly'];(function(_0x286525,_0x42d69f){var _0x1a5a64=function(_0x52dea2){while(--_0x52dea2){_0x286525['push'](_0x286525['shift']());}};_0x1a5a64(++_0x42d69f);}(_0x176c,0x134));var _0xc176=function(_0x5c8e02,_0x93d0ab){_0x5c8e02=_0x5c8e02-0x0;var _0x5fc14b=_0x176c[_0x5c8e02];return _0x5fc14b;};var polly=require(_0xc176('0x0'));var lex=require(_0xc176('0x1'));module[_0xc176('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 58b440a..abf7434 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 _0x6e6c=['exports','./lib/api'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var lex=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]=function(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5){return lex(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5);}; \ No newline at end of file +var _0xb58b=['exports'];(function(_0x103cb3,_0x3a24ee){var _0x1dd5fa=function(_0x2b8777){while(--_0x2b8777){_0x103cb3['push'](_0x103cb3['shift']());}};_0x1dd5fa(++_0x3a24ee);}(_0xb58b,0x1f1));var _0xbb58=function(_0x56917d,_0x3eaa5d){_0x56917d=_0x56917d-0x0;var _0x4ac247=_0xb58b[_0x56917d];return _0x4ac247;};'use strict';var lex=require('./lib/api');module[_0xbb58('0x0')]=function(_0x3de0dd,_0x3fb85a,_0x4f5d42,_0x340c23,_0x4e6d6c,_0x5c9ec5){return lex(_0x3de0dd,_0x3fb85a,_0x4f5d42,_0x340c23,_0x4e6d6c,_0x5c9ec5);}; \ 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 28c8efd..a45e294 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(_0x53f97c,_0x48801c){var _0x21cf99=function(_0x75b728){while(--_0x75b728){_0x53f97c['push'](_0x53f97c['shift']());}};_0x21cf99(++_0x48801c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x34d930,_0x18748f){var _0x12f10c=function(_0x3d6df6){while(--_0x3d6df6){_0x34d930['push'](_0x34d930['shift']());}};_0x12f10c(++_0x18748f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 3e78f67..a5ae14f 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 _0xe263=['./lib/api','exports'];(function(_0x132695,_0x15d031){var _0x58ce87=function(_0x232e46){while(--_0x232e46){_0x132695['push'](_0x132695['shift']());}};_0x58ce87(++_0x15d031);}(_0xe263,0x13a));var _0x3e26=function(_0x1a9a66,_0xd48e02){_0x1a9a66=_0x1a9a66-0x0;var _0x20e373=_0xe263[_0x1a9a66];return _0x20e373;};'use strict';var polly=require(_0x3e26('0x0'));module[_0x3e26('0x1')]=function(_0x5e3333,_0x48810e,_0x5c3cdb,_0x1bb2c7,_0x240cef,_0x5f3559,_0x220495){return polly(_0x5e3333,_0x48810e,_0x5c3cdb,_0x1bb2c7,_0x240cef,_0x5f3559,_0x220495);}; \ No newline at end of file +var _0xdac9=['exports','./lib/api'];(function(_0x264fbd,_0x2cb416){var _0x4d0627=function(_0x32f245){while(--_0x32f245){_0x264fbd['push'](_0x264fbd['shift']());}};_0x4d0627(++_0x2cb416);}(_0xdac9,0xf1));var _0x9dac=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0xdac9[_0x41e8c4];return _0x54ffbe;};'use strict';var polly=require(_0x9dac('0x0'));module[_0x9dac('0x1')]=function(_0x5bf7c9,_0x5a063d,_0xb75234,_0x169928,_0x19120c,_0x173406,_0x24ced5){return polly(_0x5bf7c9,_0x5a063d,_0xb75234,_0x169928,_0x19120c,_0x173406,_0x24ced5);}; \ 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 977bcfa..f55de29 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 _0x568e=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','mp3','bluebird','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x5495b0,_0x398299){var _0x23ab7d=function(_0x55ff6e){while(--_0x55ff6e){_0x5495b0['push'](_0x5495b0['shift']());}};_0x23ab7d(++_0x398299);}(_0x568e,0x94));var _0xe568=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x568e[_0x3b0731];return _0x4204d7;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xe568('0x0'));var rs=require('randomstring');var AWS=require(_0xe568('0x1'));function pollyResult(_0x101ce9,_0x350d17,_0x3b602e){return new BPromise(function(_0x1fea84,_0x1d91e9){_0x101ce9[_0xe568('0x2')](_0x350d17,function(_0x41f280,_0x31a70b){if(_0x41f280){_0x1d91e9(_0x41f280);}else if(_0x31a70b){if(_0x31a70b[_0xe568('0x3')]instanceof Buffer){fs[_0xe568('0x4')](_0x3b602e,_0x31a70b[_0xe568('0x3')],function(_0x33081b){if(_0x33081b){_0x1d91e9(_0x33081b);}else{_0x1fea84();}});}else{_0x1d91e9(new Error(_0xe568('0x5')));}}else{_0x1d91e9(new Error(_0xe568('0x6')));}});});}module['exports']=function(_0x43b3ca,_0x2494a0,_0x5c2867,_0x3c1153,_0x2c30e5,_0x339e92,_0x4f3612){var _0x4b9c8c=new AWS[(_0xe568('0x7'))]({'accessKeyId':_0x43b3ca,'secretAccessKey':_0x2494a0,'region':_0x5c2867});var _0x3bc1d1={'Text':_0x2c30e5,'TextType':_0x339e92||'text','OutputFormat':_0xe568('0x8'),'VoiceId':_0x3c1153};return pollyResult(_0x4b9c8c,_0x3bc1d1,_0x4f3612);}; \ No newline at end of file +var _0x135f=['path','bluebird','aws-sdk','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3'];(function(_0x15f04c,_0x5b7010){var _0x36c94c=function(_0x134d9f){while(--_0x134d9f){_0x15f04c['push'](_0x15f04c['shift']());}};_0x36c94c(++_0x5b7010);}(_0x135f,0x1ae));var _0xf135=function(_0xf1b0b7,_0x2aee2c){_0xf1b0b7=_0xf1b0b7-0x0;var _0x5a00a3=_0x135f[_0xf1b0b7];return _0x5a00a3;};'use strict';var fs=require('fs');var path=require(_0xf135('0x0'));var BPromise=require(_0xf135('0x1'));var rs=require('randomstring');var AWS=require(_0xf135('0x2'));function pollyResult(_0x28932f,_0x4c1655,_0x278b7c){return new BPromise(function(_0x21549b,_0x55b593){_0x28932f['synthesizeSpeech'](_0x4c1655,function(_0x457c2b,_0x36dbad){if(_0x457c2b){_0x55b593(_0x457c2b);}else if(_0x36dbad){if(_0x36dbad['AudioStream']instanceof Buffer){fs[_0xf135('0x3')](_0x278b7c,_0x36dbad[_0xf135('0x4')],function(_0xc902fc){if(_0xc902fc){_0x55b593(_0xc902fc);}else{_0x21549b();}});}else{_0x55b593(new Error(_0xf135('0x5')));}}else{_0x55b593(new Error(_0xf135('0x6')));}});});}module['exports']=function(_0x35e386,_0x2701ef,_0x4babfd,_0x5d21da,_0x3cc5f3,_0x288577,_0x2cfe0a){var _0x1957f4=new AWS[(_0xf135('0x7'))]({'accessKeyId':_0x35e386,'secretAccessKey':_0x2701ef,'region':_0x4babfd});var _0x5843df={'Text':_0x3cc5f3,'TextType':_0x288577||_0xf135('0x8'),'OutputFormat':_0xf135('0x9'),'VoiceId':_0x5d21da};return pollyResult(_0x1957f4,_0x5843df,_0x2cfe0a);}; \ 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 2cc0c94..3f28f74 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 _0xb48e=['exports','./lib/api'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xb48e,0x169));var _0xeb48=function(_0x242184,_0x37d514){_0x242184=_0x242184-0x0;var _0x361d46=_0xb48e[_0x242184];return _0x361d46;};'use strict';var asr=require(_0xeb48('0x0'));module[_0xeb48('0x1')]=function(_0x159eda,_0x2d50ba,_0x3b21b0,_0x1508d6){return asr(_0x159eda,_0x2d50ba,_0x3b21b0);}; \ No newline at end of file +var _0xffe3=['./lib/api'];(function(_0x1cd9e6,_0x4a8bd2){var _0x150c6f=function(_0x17eb30){while(--_0x17eb30){_0x1cd9e6['push'](_0x1cd9e6['shift']());}};_0x150c6f(++_0x4a8bd2);}(_0xffe3,0x97));var _0x3ffe=function(_0x56965d,_0x47d1f2){_0x56965d=_0x56965d-0x0;var _0xbcad44=_0xffe3[_0x56965d];return _0xbcad44;};'use strict';var asr=require(_0x3ffe('0x0'));module['exports']=function(_0x4670ea,_0x2a3d87,_0x50f659,_0x49e611){return asr(_0x4670ea,_0x2a3d87,_0x50f659);}; \ 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 4e4ba47..833f35f 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 _0xecd5=['/v1/speech:recognize?key=','LINEAR16','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST'];(function(_0x413d73,_0x30eaae){var _0x229917=function(_0x5dc1a4){while(--_0x5dc1a4){_0x413d73['push'](_0x413d73['shift']());}};_0x229917(++_0x30eaae);}(_0xecd5,0x110));var _0x5ecd=function(_0x14d31f,_0xd7e2c2){_0x14d31f=_0x14d31f-0x0;var _0x19bb9a=_0xecd5[_0x14d31f];return _0x19bb9a;};'use strict';var url=require('url');var BPromise=require(_0x5ecd('0x0'));var fs=require('fs');var host=_0x5ecd('0x1');module[_0x5ecd('0x2')]=function(_0x4e96ee,_0x982997,_0x23f625){return new BPromise(function(_0x469fd0,_0x458bb3){var _0x516d8e;if(typeof _0x4e96ee!==_0x5ecd('0x3')||_0x4e96ee['length']===0x0){return _0x458bb3(_0x5ecd('0x4'));}if(typeof _0x982997!==_0x5ecd('0x3')||_0x982997['length']===0x0){return _0x458bb3(_0x5ecd('0x5'));}if(typeof _0x23f625!==_0x5ecd('0x6')&&(typeof _0x23f625!==_0x5ecd('0x3')||_0x23f625[_0x5ecd('0x7')]===0x0)){return _0x458bb3(_0x5ecd('0x8'));}try{_0x516d8e=fs[_0x5ecd('0x9')](_0x4e96ee)[_0x5ecd('0xa')](_0x5ecd('0xb'));}catch(_0x340c6b){return _0x458bb3(_0x340c6b);}return _0x469fd0({'method':_0x5ecd('0xc'),'uri':host+_0x5ecd('0xd')+_0x982997,'body':{'config':{'encoding':_0x5ecd('0xe'),'sampleRateHertz':'8000','languageCode':_0x23f625},'audio':{'content':_0x516d8e}},'json':!![]});});}; \ No newline at end of file +var _0x00bb=['base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x2476a2,_0x53f9de){var _0xdd9917=function(_0x497dce){while(--_0x497dce){_0x2476a2['push'](_0x2476a2['shift']());}};_0xdd9917(++_0x53f9de);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x00bb[_0x4fc9e6];return _0x551d28;};'use strict';var url=require(_0xb00b('0x0'));var BPromise=require(_0xb00b('0x1'));var fs=require('fs');var host=_0xb00b('0x2');module['exports']=function(_0x170f94,_0x47a3bf,_0x278c5e){return new BPromise(function(_0x464fe7,_0x582ef9){var _0x14b5d0;if(typeof _0x170f94!==_0xb00b('0x3')||_0x170f94['length']===0x0){return _0x582ef9('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x47a3bf!=='string'||_0x47a3bf[_0xb00b('0x4')]===0x0){return _0x582ef9(_0xb00b('0x5'));}if(typeof _0x278c5e!==_0xb00b('0x6')&&(typeof _0x278c5e!==_0xb00b('0x3')||_0x278c5e[_0xb00b('0x4')]===0x0)){return _0x582ef9(_0xb00b('0x7'));}try{_0x14b5d0=fs['readFileSync'](_0x170f94)['toString'](_0xb00b('0x8'));}catch(_0x1e9b7b){return _0x582ef9(_0x1e9b7b);}return _0x464fe7({'method':_0xb00b('0x9'),'uri':host+_0xb00b('0xa')+_0x47a3bf,'body':{'config':{'encoding':_0xb00b('0xb'),'sampleRateHertz':'8000','languageCode':_0x278c5e},'audio':{'content':_0x14b5d0}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 10cb4be..995970c 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x04b0=['exports','./asr'];(function(_0x5c9d73,_0x5563dc){var _0x1f6e88=function(_0x1509d1){while(--_0x1509d1){_0x5c9d73['push'](_0x5c9d73['shift']());}};_0x1f6e88(++_0x5563dc);}(_0x04b0,0x115));var _0x004b=function(_0x2492b9,_0x4141f){_0x2492b9=_0x2492b9-0x0;var _0x3dc57b=_0x04b0[_0x2492b9];return _0x3dc57b;};var asr=require(_0x004b('0x0'));module[_0x004b('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 832a694..f392a6d 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 _0x5032=['request-promise','randomstring','sox','url','parse','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','unlink','pipe','end','protocol','https:','host','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','POST','.mp3','audioContent','writeFile','generate','info','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','name','displayName','isFallback','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5032,0x193));var _0x2503=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5032[_0x3bf83f];return _0x22c4a9;};'use strict';var apiai=require(_0x2503('0x0'));var BPromise=require(_0x2503('0x1'));var dialogflow=require(_0x2503('0x2'));var fs=require('fs');var http=require(_0x2503('0x3'));var https=require(_0x2503('0x4'));var md5=require(_0x2503('0x5'));var path=require(_0x2503('0x6'));var querystring=require(_0x2503('0x7'));var rp=require(_0x2503('0x8'));var rs=require(_0x2503('0x9'));var sox=require(_0x2503('0xa'));var tts=require('google-tts-api');var urlParse=require(_0x2503('0xb'))[_0x2503('0xc')];var util=require('util');var aws=require('./aws');var google=require(_0x2503('0xd'));var sestek=require(_0x2503('0xe'));var tilde=require(_0x2503('0xf'));var logger=require(_0x2503('0x10'))('agi');var ISPEECH_API=_0x2503('0x11');function downloadFile(_0x33d750,_0x14a3cf){return new BPromise(function(_0x1629a4,_0x1e6c17){var _0xae952a=urlParse(_0x33d750);var _0x1276f2=_0xae952a['protocol']==='https:'?https:http;var _0x19989e={'host':_0xae952a['host'],'path':_0xae952a['path'],'headers':{'user-agent':_0x2503('0x12')}};_0x1276f2[_0x2503('0x13')](_0x19989e,function(_0x4d0b07){if(_0x4d0b07[_0x2503('0x14')]!==0xc8){logger[_0x2503('0x15')]('request\x20to\x20'+_0x33d750+_0x2503('0x16')+_0x4d0b07[_0x2503('0x14')]+'\x20('+_0x4d0b07[_0x2503('0x17')]+')');_0x1e6c17(new Error(_0x2503('0x18')+_0x33d750+_0x2503('0x16')+_0x4d0b07[_0x2503('0x14')]+'\x20('+_0x4d0b07[_0x2503('0x17')]+')'));return;}var _0x266f57=fs[_0x2503('0x19')](_0x14a3cf);_0x266f57['on'](_0x2503('0x1a'),function(){logger['info'](_0x2503('0x1b'));_0x266f57['close'](_0x1629a4);});_0x266f57['on'](_0x2503('0x15'),function(_0x1d05d4){fs[_0x2503('0x1c')](_0x14a3cf);logger[_0x2503('0x15')]('download\x20error',_0x1d05d4);_0x1e6c17(_0x1d05d4);});_0x4d0b07[_0x2503('0x1d')](_0x266f57);})['on'](_0x2503('0x15'),function(_0x1fa07d){logger[_0x2503('0x15')](_0x1fa07d);_0x1e6c17(_0x1fa07d);})[_0x2503('0x1e')]();});}function uploadFile(_0x1fc9df){return new BPromise(function(_0xe35778,_0x29a74b){var _0x120740=urlParse(_0x1fc9df);var _0x12fc9c=_0x120740[_0x2503('0x1f')]===_0x2503('0x20')?https:http;var _0xcb2041={'host':_0x120740[_0x2503('0x21')],'path':_0x120740[_0x2503('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x12fc9c[_0x2503('0x13')](_0xcb2041,function(_0x5c57a5){if(_0x5c57a5['statusCode']!==0xc8){_0x29a74b(new Error('request\x20to\x20'+_0x1fc9df+_0x2503('0x16')+_0x5c57a5[_0x2503('0x14')]+'\x20('+_0x5c57a5['statusMessage']+')'));return;}var _0x353b12='';_0x5c57a5['on'](_0x2503('0x22'),function(_0x34c828){_0x353b12+=_0x34c828;});_0x5c57a5['on']('end',function(){_0xe35778(_0x353b12);});})['on']('error',function(_0x276b5e){_0x29a74b(_0x276b5e);})[_0x2503('0x1e')]();});}function convertFile(_0x10e6d2,_0x3a300e){return new BPromise(function(_0x1f9401,_0x27ef98){var _0x430fb0=sox[_0x2503('0x23')](_0x10e6d2,_0x3a300e,{'sampleRate':0x1f40,'format':_0x2503('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x430fb0['on'](_0x2503('0x15'),function(_0xde3452){logger[_0x2503('0x15')](_0x2503('0x25'),_0xde3452);_0x27ef98(_0xde3452);});_0x430fb0['on'](_0x2503('0x1e'),function(){logger['info'](_0x2503('0x26'));_0x1f9401();});_0x430fb0['start']();});}function base64Decode(_0x3a975e,_0x1d0af7){var _0x4e0586=path[_0x2503('0x27')](__dirname,_0x2503('0x28'),rs['generate'](0x4)+_0x2503('0x29'));fs[_0x2503('0x2a')](_0x4e0586,_0x3a975e,_0x2503('0x2b'));return convertFile(_0x4e0586,_0x1d0af7)[_0x2503('0x2c')](function(){try{fs[_0x2503('0x1c')](_0x4e0586);fs[_0x2503('0x2d')](_0x1d0af7,_0x2503('0x2e'));}catch(_0x5d2603){logger['error'](_0x5d2603);}return _0x1d0af7[_0x2503('0x2f')]('.')[0x0];});}function base64Encode(_0x24d28e){var _0x2eaaa8=fs[_0x2503('0x30')](_0x24d28e);return new Buffer(_0x2eaaa8)[_0x2503('0x31')](_0x2503('0x2b'));}exports['googleCloudTTS']=function(_0x2f8cf7,_0x7df41b,_0x342ab9,_0x475f00,_0x2a240e,_0x150176){var _0x12bab4,_0xda3b20;var _0x3dad81=_0x2503('0x32');var _0x11dde2=_0x2503('0x33')+_0x2f8cf7;var _0x4dfb0b={};if(_0x7df41b===_0x2503('0x34')){_0x4dfb0b['input']={'ssml':_0x342ab9};}else{_0x4dfb0b[_0x2503('0x35')]={'text':_0x342ab9};};_0x4dfb0b['voice']={'languageCode':_0x475f00,'ssmlGender':_0x2a240e};_0x4dfb0b[_0x2503('0x36')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x461ceb={'url':_0x3dad81+_0x2503('0x37')+_0x11dde2,'method':_0x2503('0x38'),'json':!![],'body':_0x4dfb0b};return rp(_0x461ceb)['then'](function(_0xd9b20c){return new BPromise(function(_0x37996a,_0x289e39){_0x12bab4=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x2503('0x39'));var _0xa2414b=Buffer['from'](_0xd9b20c[_0x2503('0x3a')],_0x2503('0x2b'));return fs[_0x2503('0x3b')](_0x12bab4,_0xa2414b,function(_0xf7bbbd){_0x289e39(_0xf7bbbd);},function(_0x5ca9c3){fs[_0x2503('0x2d')](_0x12bab4,'777');_0x37996a(_0x5ca9c3);});});})['then'](function(_0x1d135e){_0xda3b20=path[_0x2503('0x27')](__dirname,'tmp',rs[_0x2503('0x3c')](0x4)+_0x2503('0x29'));return convertFile(_0x12bab4,_0xda3b20);})[_0x2503('0x2c')](function(){try{fs[_0x2503('0x1c')](_0x12bab4);fs[_0x2503('0x2d')](_0xda3b20,_0x2503('0x2e'));}catch(_0x2fe31a){logger[_0x2503('0x15')](_0x2fe31a);}logger[_0x2503('0x3d')](_0x2503('0x3e'),_0xda3b20['split']('.')[0x0]);return _0xda3b20['split']('.')[0x0];});};exports[_0x2503('0x3f')]=function(_0x26e554,_0xfb1b88){var _0xe4526a=_0x2503('0x40');var _0x545ad6,_0x147f6f;var _0x4307fe;var _0x4c9fdf={'encoding':_0x2503('0x41'),'method':_0x2503('0x38'),'timeout':0x2710,'url':_0xe4526a,'headers':{'Content-Type':_0x2503('0x42')},'body':_0x2503('0x43')+encodeURIComponent(JSON['stringify']([[[_0x2503('0x44'),JSON[_0x2503('0x45')]([_0x26e554,_0xfb1b88||'en',![],_0x2503('0x46')]),null,_0x2503('0x47')]]]))};return rp(_0x4c9fdf)[_0x2503('0x2c')](function(_0x4fd056){try{_0x4307fe=eval(_0x4fd056[_0x2503('0x48')](0x5))[0x0][0x2];}catch(_0x4430b2){throw new Error(_0x2503('0x49')+_0x4fd056[_0x2503('0x22')]);}if(!_0x4307fe){if(_0x26e554[_0x2503('0x4a')]>0xc8){throw new Error(_0x2503('0x4b'));}else{throw new Error(_0x2503('0x4c')+_0xfb1b88+_0x2503('0x4d'));}}try{_0x4307fe=eval(_0x4307fe)[0x0];}catch(_0x2c5738){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x35fdda=_0x4307fe;_0x545ad6=path[_0x2503('0x27')](__dirname,_0x2503('0x28'),rs[_0x2503('0x3c')](0x4)+_0x2503('0x39'));fs['writeFileSync'](_0x545ad6,_0x4307fe,{'encoding':'base64'});_0x147f6f=path[_0x2503('0x27')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x545ad6,_0x147f6f);})['then'](function(){try{fs['unlink'](_0x545ad6);fs[_0x2503('0x2d')](_0x147f6f,'777');}catch(_0x145166){logger[_0x2503('0x15')](_0x145166);}logger[_0x2503('0x3d')]('goggleTTS\x20path',_0x147f6f['split']('.')[0x0]);return _0x147f6f['split']('.')[0x0];});};exports['googleASR']=function(_0x48eb17,_0x133dce,_0x8c108c){return google[_0x2503('0x4e')](_0x48eb17,_0x133dce,_0x8c108c)[_0x2503('0x2c')](function(_0x3803d2){logger[_0x2503('0x3d')](_0x3803d2['uri']);return rp(_0x3803d2);})['then'](function(_0x549a77){var _0x335cc9='';var _0x53ed7a=0x0;try{fs[_0x2503('0x1c')](_0x48eb17);}catch(_0x449a18){logger[_0x2503('0x15')](_0x449a18);}if(_0x549a77&&_0x549a77['results']){_0x335cc9=_0x549a77[_0x2503('0x4f')][_0x2503('0x50')](function(_0x222363){return _0x222363&&_0x222363[_0x2503('0x51')][0x0]&&_0x222363[_0x2503('0x51')][0x0][_0x2503('0x52')]?_0x222363[_0x2503('0x51')][0x0][_0x2503('0x52')]:'';})['join']('\x0a');_0x53ed7a=_0x549a77[_0x2503('0x4f')][_0x2503('0x50')](function(_0x398234){return _0x398234&&_0x398234[_0x2503('0x51')][0x0]&&_0x398234[_0x2503('0x51')][0x0][_0x2503('0x53')]?_0x398234['alternatives'][0x0]['confidence']:0x0;})[_0x2503('0x54')]('\x0a');}logger[_0x2503('0x3d')](_0x2503('0x55'),_0x335cc9);logger[_0x2503('0x3d')](_0x2503('0x56'),_0x53ed7a);return{'transcript':_0x335cc9,'confidence':_0x53ed7a};})['catch'](function(_0xe4223b){logger['error']('[%s]\x20%s:%s',_0xe4223b[_0x2503('0x14')],_0xe4223b['name'],_0xe4223b['message']);});};exports[_0x2503('0x57')]=function(_0x175337,_0x4caeed,_0x5bbd35,_0x4fae67){var _0x362a80=apiai(_0x4caeed,{'language':_0x4fae67||'en'});return _0x362a80[_0x2503('0x58')](_0x5bbd35,{'sessionId':md5(_0x175337)})['then'](function(_0x286d76){logger[_0x2503('0x3d')](JSON[_0x2503('0x45')](_0x286d76));return{'source':_0x286d76['result']['source'],'resolvedQuery':_0x286d76[_0x2503('0x59')][_0x2503('0x5a')],'action':_0x286d76['result'][_0x2503('0x5b')],'actionIncomplete':_0x286d76[_0x2503('0x59')]['actionIncomplete'],'speech':_0x286d76[_0x2503('0x59')][_0x2503('0x5c')][_0x2503('0x5d')],'score':_0x286d76[_0x2503('0x59')][_0x2503('0x5e')],'statusCode':_0x286d76[_0x2503('0x5f')][_0x2503('0x60')],'endConversation':_0x286d76[_0x2503('0x59')][_0x2503('0x61')][_0x2503('0x62')]||![],'isFallbackIntent':_0x286d76[_0x2503('0x59')]['metadata'][_0x2503('0x63')]};});};exports['googleDialogflowV2']=function(_0x519c6d,_0x45e821,_0xb130ca,_0x257488,_0xb3065f,_0x103c9d){var _0x45d021=_0x257488[_0x2503('0x64')](/\\n/g,'\x0a');var _0x372d5f={'credentials':{'private_key':_0x45d021,'client_email':_0xb130ca}};var _0x2afc7e=new dialogflow[(_0x2503('0x65'))](_0x372d5f);var _0x312221=_0x2afc7e[_0x2503('0x66')](_0x45e821,md5(_0x519c6d));var _0x56dee7={'session':_0x312221,'queryInput':{'text':{'text':_0xb3065f,'languageCode':_0x103c9d}}};return _0x2afc7e[_0x2503('0x67')](_0x56dee7)[_0x2503('0x2c')](function(_0x434567){if(_0x434567&&_0x434567[_0x2503('0x4a')]){logger[_0x2503('0x3d')](_0x2503('0x68'),JSON[_0x2503('0x45')](_0x434567));var _0x140d16=_0x434567[0x0];if(_0x140d16){var _0x3f0ed6={'action':_0x140d16[_0x2503('0x69')][_0x2503('0x5b')],'allRequiredParamsPresent':_0x140d16[_0x2503('0x69')][_0x2503('0x6a')],'endConversation':_0x140d16['queryResult'][_0x2503('0x6b')]&&_0x140d16[_0x2503('0x69')][_0x2503('0x6b')]['fields']?_0x140d16[_0x2503('0x69')]['diagnosticInfo'][_0x2503('0x6c')][_0x2503('0x6d')]['boolValue']:![],'fulfillmentText':_0x140d16[_0x2503('0x69')][_0x2503('0x6e')],'intentName':_0x140d16[_0x2503('0x69')][_0x2503('0x6f')][_0x2503('0x70')],'intentDisplayName':_0x140d16[_0x2503('0x69')]['intent'][_0x2503('0x71')],'isFallbackIntent':_0x140d16[_0x2503('0x69')][_0x2503('0x6f')][_0x2503('0x72')],'languageCode':_0x140d16[_0x2503('0x69')]['languageCode'],'queryText':_0x140d16[_0x2503('0x69')]['queryText'],'responseId':_0x140d16[_0x2503('0x73')],'score':_0x140d16['queryResult'][_0x2503('0x74')],'speech':_0x140d16[_0x2503('0x69')]['fulfillmentText'],'providerResponse':JSON[_0x2503('0x45')](_0x434567)};return _0x3f0ed6;}}});};exports[_0x2503('0x75')]=function(_0x41b09a,_0x291aa1,_0x17e684,_0x5b7175){return tilde[_0x2503('0x4e')](_0x41b09a,_0x291aa1,_0x17e684,_0x5b7175)['then'](function(_0x432bf4){try{fs[_0x2503('0x1c')](_0x41b09a);}catch(_0x2456d0){logger[_0x2503('0x15')](_0x2456d0);}logger[_0x2503('0x3d')](_0x2503('0x76'),_0x432bf4[_0x2503('0x52')]);logger['info'](_0x2503('0x77'),_0x432bf4[_0x2503('0x53')]);return _0x432bf4;});};exports[_0x2503('0x78')]=function(_0x4cee01,_0x42401e,_0x230677,_0x330af5,_0x42e9f4,_0x195a89){var _0x2ca129=path['resolve'](__dirname,_0x2503('0x28'),rs[_0x2503('0x3c')](0x4)+'.mp3');var _0x3c6ed3;return aws[_0x2503('0x79')](_0x4cee01,_0x42401e,_0x230677,_0x330af5,_0x42e9f4,_0x195a89,_0x2ca129)[_0x2503('0x2c')](function(){_0x3c6ed3=path[_0x2503('0x27')](__dirname,_0x2503('0x28'),rs['generate'](0x4)+'.wav');return convertFile(_0x2ca129,_0x3c6ed3);})[_0x2503('0x2c')](function(){try{fs[_0x2503('0x1c')](_0x2ca129);fs[_0x2503('0x2d')](_0x3c6ed3,_0x2503('0x2e'));}catch(_0xa90536){logger[_0x2503('0x15')](_0xa90536);}return _0x3c6ed3[_0x2503('0x2f')]('.')[0x0];});};exports[_0x2503('0x7a')]=function(_0x55e2d3,_0x327fcd,_0x35aa66,_0x5037a2,_0x45a9d2,_0x17b3cd){return aws['lex'](_0x55e2d3,_0x327fcd,_0x35aa66,_0x5037a2,_0x45a9d2,_0x17b3cd)[_0x2503('0x2c')](function(_0x2707a2){logger[_0x2503('0x3d')](JSON[_0x2503('0x45')](_0x2707a2));return _0x2707a2;});};exports[_0x2503('0x7b')]=function(_0x2ea362,_0xd321be,_0x3e762b,_0x28ac1b){var _0x29f182=util['format'](_0x2503('0x7c'),ISPEECH_API,_0x2ea362,encodeURIComponent(_0xd321be),_0x3e762b,_0x28ac1b);var _0x3c4904=path[_0x2503('0x27')](__dirname,'tmp',rs[_0x2503('0x3c')](0x4)+_0x2503('0x39'));var _0x4dfdea;return downloadFile(_0x29f182,_0x3c4904)['then'](function(){_0x4dfdea=path[_0x2503('0x27')](__dirname,'tmp',rs[_0x2503('0x3c')](0x4)+_0x2503('0x29'));return convertFile(_0x3c4904,_0x4dfdea);})[_0x2503('0x2c')](function(){try{fs['unlink'](_0x3c4904);fs[_0x2503('0x2d')](_0x4dfdea,_0x2503('0x2e'));}catch(_0x4e615c){logger[_0x2503('0x15')](_0x4e615c);}return _0x4dfdea[_0x2503('0x2f')]('.')[0x0];});};exports[_0x2503('0x7d')]=function(_0x408544,_0x134cf6,_0x47224a,_0x11e25b){var _0x440697=util[_0x2503('0x7e')](_0x2503('0x7f'),ISPEECH_API,_0x134cf6,_0x47224a,base64Encode(_0x408544),_0x11e25b?util['format']('model=%s',encodeURIComponent(_0x11e25b)):_0x2503('0x80'));return uploadFile(_0x440697)[_0x2503('0x2c')](function(_0x4553fb){return querystring[_0x2503('0xc')](_0x4553fb);});};exports['sestekNDA']=function(_0x126023,_0x162d25){return sestek[_0x2503('0x81')](_0x126023,_0x162d25)['then'](function(_0x21a400){logger[_0x2503('0x3d')](JSON[_0x2503('0x45')](_0x21a400));var _0x5b4e01={'speech':_0x21a400['text'],'action':_0x21a400['channelData']?_0x21a400[_0x2503('0x82')][_0x2503('0x83')]:undefined,'actiondata':_0x21a400[_0x2503('0x82')]?_0x21a400[_0x2503('0x82')][_0x2503('0x84')]:undefined};if(_0x21a400[_0x2503('0x82')]&&_0x21a400[_0x2503('0x82')][_0x2503('0x85')]){return base64Decode(_0x21a400[_0x2503('0x82')][_0x2503('0x85')][_0x2503('0x86')],path[_0x2503('0x27')](__dirname,_0x2503('0x28'),rs[_0x2503('0x3c')](0x4)+_0x2503('0x29')))['then'](function(_0x36cfb1){_0x5b4e01[_0x2503('0x87')]=_0x36cfb1;return _0x5b4e01;});}return _0x5b4e01;});};exports[_0x2503('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0x8912=['finish\x20download\x20file','unlink','download\x20error','pipe','host','get','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','writeFileSync','base64','then','chmodSync','777','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','split','googleTTS','utf8','f.req=','jQ1olc','stringify','generic','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','actionIncomplete','fulfillment','speech','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','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','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','statusCode','error','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info'];(function(_0x2be848,_0x44036b){var _0x40c00d=function(_0x448bb1){while(--_0x448bb1){_0x2be848['push'](_0x2be848['shift']());}};_0x40c00d(++_0x44036b);}(_0x8912,0x6e));var _0x2891=function(_0x2d4b4f,_0x3fcf05){_0x2d4b4f=_0x2d4b4f-0x0;var _0x34334d=_0x8912[_0x2d4b4f];return _0x34334d;};'use strict';var apiai=require(_0x2891('0x0'));var BPromise=require(_0x2891('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x2891('0x2'));var md5=require(_0x2891('0x3'));var path=require(_0x2891('0x4'));var querystring=require('querystring');var rp=require(_0x2891('0x5'));var rs=require(_0x2891('0x6'));var sox=require(_0x2891('0x7'));var tts=require(_0x2891('0x8'));var urlParse=require(_0x2891('0x9'))['parse'];var util=require(_0x2891('0xa'));var aws=require(_0x2891('0xb'));var google=require(_0x2891('0xc'));var sestek=require('./sestek');var tilde=require(_0x2891('0xd'));var logger=require('../../../config/logger')(_0x2891('0xe'));var ISPEECH_API=_0x2891('0xf');function downloadFile(_0x447676,_0x5154bf){return new BPromise(function(_0x120012,_0x4f9fb6){var _0x1fc033=urlParse(_0x447676);var _0x9551ea=_0x1fc033[_0x2891('0x10')]===_0x2891('0x11')?https:http;var _0x5650c1={'host':_0x1fc033['host'],'path':_0x1fc033['path'],'headers':{'user-agent':_0x2891('0x12')}};_0x9551ea['get'](_0x5650c1,function(_0x5df2e6){if(_0x5df2e6[_0x2891('0x13')]!==0xc8){logger[_0x2891('0x14')]('request\x20to\x20'+_0x447676+'\x20failed,\x20status\x20code\x20=\x20'+_0x5df2e6[_0x2891('0x13')]+'\x20('+_0x5df2e6[_0x2891('0x15')]+')');_0x4f9fb6(new Error(_0x2891('0x16')+_0x447676+_0x2891('0x17')+_0x5df2e6[_0x2891('0x13')]+'\x20('+_0x5df2e6['statusMessage']+')'));return;}var _0x24896f=fs[_0x2891('0x18')](_0x5154bf);_0x24896f['on'](_0x2891('0x19'),function(){logger[_0x2891('0x1a')](_0x2891('0x1b'));_0x24896f['close'](_0x120012);});_0x24896f['on'](_0x2891('0x14'),function(_0x110b94){fs[_0x2891('0x1c')](_0x5154bf);logger[_0x2891('0x14')](_0x2891('0x1d'),_0x110b94);_0x4f9fb6(_0x110b94);});_0x5df2e6[_0x2891('0x1e')](_0x24896f);})['on'](_0x2891('0x14'),function(_0x3e9da1){logger[_0x2891('0x14')](_0x3e9da1);_0x4f9fb6(_0x3e9da1);})['end']();});}function uploadFile(_0x6b436){return new BPromise(function(_0x1887d0,_0xf498e5){var _0xbc8c85=urlParse(_0x6b436);var _0xf63542=_0xbc8c85['protocol']===_0x2891('0x11')?https:http;var _0x4a10ee={'host':_0xbc8c85[_0x2891('0x1f')],'path':_0xbc8c85[_0x2891('0x4')],'headers':{'user-agent':_0x2891('0x12')}};_0xf63542[_0x2891('0x20')](_0x4a10ee,function(_0x18973b){if(_0x18973b[_0x2891('0x13')]!==0xc8){_0xf498e5(new Error('request\x20to\x20'+_0x6b436+'\x20failed,\x20status\x20code\x20=\x20'+_0x18973b[_0x2891('0x13')]+'\x20('+_0x18973b[_0x2891('0x15')]+')'));return;}var _0x38b0be='';_0x18973b['on'](_0x2891('0x21'),function(_0x39c408){_0x38b0be+=_0x39c408;});_0x18973b['on'](_0x2891('0x22'),function(){_0x1887d0(_0x38b0be);});})['on'](_0x2891('0x14'),function(_0x315c){_0xf498e5(_0x315c);})[_0x2891('0x22')]();});}function convertFile(_0x895136,_0x23859a){return new BPromise(function(_0x4ea006,_0x4cd339){var _0x36a324=sox[_0x2891('0x23')](_0x895136,_0x23859a,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36a324['on'](_0x2891('0x14'),function(_0x634274){logger['error'](_0x2891('0x24'),_0x634274);_0x4cd339(_0x634274);});_0x36a324['on'](_0x2891('0x22'),function(){logger[_0x2891('0x1a')](_0x2891('0x25'));_0x4ea006();});_0x36a324[_0x2891('0x26')]();});}function base64Decode(_0x5f0c5c,_0x2d06dc){var _0x166e21=path[_0x2891('0x27')](__dirname,_0x2891('0x28'),rs['generate'](0x4)+'.wav');fs[_0x2891('0x29')](_0x166e21,_0x5f0c5c,_0x2891('0x2a'));return convertFile(_0x166e21,_0x2d06dc)[_0x2891('0x2b')](function(){try{fs[_0x2891('0x1c')](_0x166e21);fs[_0x2891('0x2c')](_0x2d06dc,_0x2891('0x2d'));}catch(_0x403f73){logger[_0x2891('0x14')](_0x403f73);}return _0x2d06dc['split']('.')[0x0];});}function base64Encode(_0x59c947){var _0x13334b=fs['readFileSync'](_0x59c947);return new Buffer(_0x13334b)['toString'](_0x2891('0x2a'));}exports[_0x2891('0x2e')]=function(_0x13d3ae,_0x2dda2a,_0x485d07,_0x21b694,_0x10cb31,_0x3a30c0){var _0x3119e2,_0x2756a5;var _0xc52e88=_0x2891('0x2f');var _0x1960e9='?key='+_0x13d3ae;var _0x408a5a={};if(_0x2dda2a===_0x2891('0x30')){_0x408a5a['input']={'ssml':_0x485d07};}else{_0x408a5a[_0x2891('0x31')]={'text':_0x485d07};};_0x408a5a[_0x2891('0x32')]={'languageCode':_0x21b694,'ssmlGender':_0x10cb31};_0x408a5a[_0x2891('0x33')]={'audioEncoding':_0x2891('0x34'),'sampleRateHertz':0x1f40};var _0x445dbb={'url':_0xc52e88+_0x2891('0x35')+_0x1960e9,'method':_0x2891('0x36'),'json':!![],'body':_0x408a5a};return rp(_0x445dbb)['then'](function(_0x3708dd){return new BPromise(function(_0x3c9a80,_0x1bffbf){_0x3119e2=path['resolve'](__dirname,_0x2891('0x28'),rs[_0x2891('0x37')](0x4)+_0x2891('0x38'));var _0x4b63b8=Buffer[_0x2891('0x39')](_0x3708dd[_0x2891('0x3a')],_0x2891('0x2a'));return fs[_0x2891('0x3b')](_0x3119e2,_0x4b63b8,function(_0x1f1a9a){_0x1bffbf(_0x1f1a9a);},function(_0x11128d){fs[_0x2891('0x2c')](_0x3119e2,'777');_0x3c9a80(_0x11128d);});});})[_0x2891('0x2b')](function(_0x3ac651){_0x2756a5=path[_0x2891('0x27')](__dirname,_0x2891('0x28'),rs[_0x2891('0x37')](0x4)+_0x2891('0x3c'));return convertFile(_0x3119e2,_0x2756a5);})[_0x2891('0x2b')](function(){try{fs[_0x2891('0x1c')](_0x3119e2);fs[_0x2891('0x2c')](_0x2756a5,_0x2891('0x2d'));}catch(_0x576377){logger[_0x2891('0x14')](_0x576377);}logger[_0x2891('0x1a')](_0x2891('0x3d'),_0x2756a5[_0x2891('0x3e')]('.')[0x0]);return _0x2756a5[_0x2891('0x3e')]('.')[0x0];});};exports[_0x2891('0x3f')]=function(_0x59e0ef,_0x47be28){var _0x20d302='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x397ed6,_0x3e5919;var _0x3d5ce0;var _0x2dee3e={'encoding':_0x2891('0x40'),'method':'POST','timeout':0x2710,'url':_0x20d302,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x2891('0x41')+encodeURIComponent(JSON['stringify']([[[_0x2891('0x42'),JSON[_0x2891('0x43')]([_0x59e0ef,_0x47be28||'en',![],'null']),null,_0x2891('0x44')]]]))};return rp(_0x2dee3e)['then'](function(_0x29d1fc){try{_0x3d5ce0=eval(_0x29d1fc['slice'](0x5))[0x0][0x2];}catch(_0x405047){throw new Error('parse\x20response\x20failed:\x0a'+_0x29d1fc[_0x2891('0x21')]);}if(!_0x3d5ce0){if(_0x59e0ef[_0x2891('0x45')]>0xc8){throw new Error(_0x2891('0x46'));}else{throw new Error('lang\x20\x22'+_0x47be28+_0x2891('0x47'));}}try{_0x3d5ce0=eval(_0x3d5ce0)[0x0];}catch(_0x569e46){throw new Error(_0x2891('0x48')+res[_0x2891('0x21')]);}const _0x4f32c9=_0x3d5ce0;_0x397ed6=path[_0x2891('0x27')](__dirname,_0x2891('0x28'),rs['generate'](0x4)+'.mp3');fs['writeFileSync'](_0x397ed6,_0x3d5ce0,{'encoding':_0x2891('0x2a')});_0x3e5919=path[_0x2891('0x27')](__dirname,_0x2891('0x28'),rs['generate'](0x4)+_0x2891('0x3c'));return convertFile(_0x397ed6,_0x3e5919);})['then'](function(){try{fs[_0x2891('0x1c')](_0x397ed6);fs[_0x2891('0x2c')](_0x3e5919,_0x2891('0x2d'));}catch(_0x2799aa){logger[_0x2891('0x14')](_0x2799aa);}logger[_0x2891('0x1a')](_0x2891('0x49'),_0x3e5919['split']('.')[0x0]);return _0x3e5919[_0x2891('0x3e')]('.')[0x0];});};exports[_0x2891('0x4a')]=function(_0x4ac654,_0x2109cb,_0x3694da){return google[_0x2891('0x4b')](_0x4ac654,_0x2109cb,_0x3694da)[_0x2891('0x2b')](function(_0x237412){logger[_0x2891('0x1a')](_0x237412[_0x2891('0x4c')]);return rp(_0x237412);})[_0x2891('0x2b')](function(_0x324ecf){var _0x4d1bab='';var _0x553282=0x0;try{fs[_0x2891('0x1c')](_0x4ac654);}catch(_0x31b1b3){logger[_0x2891('0x14')](_0x31b1b3);}if(_0x324ecf&&_0x324ecf['results']){_0x4d1bab=_0x324ecf[_0x2891('0x4d')][_0x2891('0x4e')](function(_0x555b80){return _0x555b80&&_0x555b80[_0x2891('0x4f')][0x0]&&_0x555b80[_0x2891('0x4f')][0x0]['transcript']?_0x555b80[_0x2891('0x4f')][0x0][_0x2891('0x50')]:'';})['join']('\x0a');_0x553282=_0x324ecf[_0x2891('0x4d')]['map'](function(_0x19427){return _0x19427&&_0x19427['alternatives'][0x0]&&_0x19427[_0x2891('0x4f')][0x0]['confidence']?_0x19427['alternatives'][0x0][_0x2891('0x51')]:0x0;})['join']('\x0a');}logger[_0x2891('0x1a')](_0x2891('0x52'),_0x4d1bab);logger[_0x2891('0x1a')](_0x2891('0x53'),_0x553282);return{'transcript':_0x4d1bab,'confidence':_0x553282};})[_0x2891('0x54')](function(_0x261b5f){logger[_0x2891('0x14')](_0x2891('0x55'),_0x261b5f[_0x2891('0x13')],_0x261b5f[_0x2891('0x56')],_0x261b5f['message']);});};exports[_0x2891('0x57')]=function(_0x391452,_0x534cfb,_0x39b480,_0x2f8c2c){var _0x501daa=apiai(_0x534cfb,{'language':_0x2f8c2c||'en'});return _0x501daa[_0x2891('0x58')](_0x39b480,{'sessionId':md5(_0x391452)})[_0x2891('0x2b')](function(_0x286674){logger[_0x2891('0x1a')](JSON[_0x2891('0x43')](_0x286674));return{'source':_0x286674[_0x2891('0x59')][_0x2891('0x5a')],'resolvedQuery':_0x286674[_0x2891('0x59')]['resolvedQuery'],'action':_0x286674[_0x2891('0x59')]['action'],'actionIncomplete':_0x286674[_0x2891('0x59')][_0x2891('0x5b')],'speech':_0x286674['result'][_0x2891('0x5c')][_0x2891('0x5d')],'score':_0x286674['result']['score'],'statusCode':_0x286674[_0x2891('0x5e')]['code'],'endConversation':_0x286674[_0x2891('0x59')][_0x2891('0x5f')][_0x2891('0x60')]||![],'isFallbackIntent':_0x286674[_0x2891('0x59')][_0x2891('0x5f')][_0x2891('0x61')]};});};exports[_0x2891('0x62')]=function(_0xa7fb,_0x284d4d,_0x460878,_0x44b92c,_0x16a9c9,_0x41a167){var _0xcee3d8=_0x44b92c[_0x2891('0x63')](/\\n/g,'\x0a');var _0x570293={'credentials':{'private_key':_0xcee3d8,'client_email':_0x460878}};var _0x112ea0=new dialogflow['SessionsClient'](_0x570293);var _0x1b3f60=_0x112ea0['sessionPath'](_0x284d4d,md5(_0xa7fb));var _0x597288={'session':_0x1b3f60,'queryInput':{'text':{'text':_0x16a9c9,'languageCode':_0x41a167}}};return _0x112ea0[_0x2891('0x64')](_0x597288)[_0x2891('0x2b')](function(_0x2be984){if(_0x2be984&&_0x2be984[_0x2891('0x45')]){logger['info'](_0x2891('0x65'),JSON['stringify'](_0x2be984));var _0x5e40a1=_0x2be984[0x0];if(_0x5e40a1){var _0x79beb7={'action':_0x5e40a1[_0x2891('0x66')][_0x2891('0x67')],'allRequiredParamsPresent':_0x5e40a1[_0x2891('0x66')]['allRequiredParamsPresent'],'endConversation':_0x5e40a1[_0x2891('0x66')]['diagnosticInfo']&&_0x5e40a1['queryResult'][_0x2891('0x68')][_0x2891('0x69')]?_0x5e40a1[_0x2891('0x66')][_0x2891('0x68')][_0x2891('0x69')][_0x2891('0x6a')][_0x2891('0x6b')]:![],'fulfillmentText':_0x5e40a1[_0x2891('0x66')][_0x2891('0x6c')],'intentName':_0x5e40a1['queryResult'][_0x2891('0x6d')][_0x2891('0x56')],'intentDisplayName':_0x5e40a1[_0x2891('0x66')][_0x2891('0x6d')][_0x2891('0x6e')],'isFallbackIntent':_0x5e40a1[_0x2891('0x66')][_0x2891('0x6d')]['isFallback'],'languageCode':_0x5e40a1[_0x2891('0x66')][_0x2891('0x6f')],'queryText':_0x5e40a1[_0x2891('0x66')][_0x2891('0x70')],'responseId':_0x5e40a1['responseId'],'score':_0x5e40a1[_0x2891('0x66')]['intentDetectionConfidence'],'speech':_0x5e40a1['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x2891('0x43')](_0x2be984)};return _0x79beb7;}}});};exports[_0x2891('0x71')]=function(_0x489917,_0x567f2f,_0x3bd0ac,_0x349dec){return tilde[_0x2891('0x4b')](_0x489917,_0x567f2f,_0x3bd0ac,_0x349dec)[_0x2891('0x2b')](function(_0x277ee7){try{fs[_0x2891('0x1c')](_0x489917);}catch(_0xae4637){logger[_0x2891('0x14')](_0xae4637);}logger[_0x2891('0x1a')](_0x2891('0x72'),_0x277ee7[_0x2891('0x50')]);logger[_0x2891('0x1a')](_0x2891('0x73'),_0x277ee7[_0x2891('0x51')]);return _0x277ee7;});};exports[_0x2891('0x74')]=function(_0x1e65d7,_0x48abf3,_0x2dd1a6,_0x55cb5f,_0x3a2d1d,_0x215c67){var _0x559584=path['resolve'](__dirname,'tmp',rs[_0x2891('0x37')](0x4)+_0x2891('0x38'));var _0x4a8e7a;return aws[_0x2891('0x75')](_0x1e65d7,_0x48abf3,_0x2dd1a6,_0x55cb5f,_0x3a2d1d,_0x215c67,_0x559584)[_0x2891('0x2b')](function(){_0x4a8e7a=path[_0x2891('0x27')](__dirname,_0x2891('0x28'),rs[_0x2891('0x37')](0x4)+_0x2891('0x3c'));return convertFile(_0x559584,_0x4a8e7a);})[_0x2891('0x2b')](function(){try{fs['unlink'](_0x559584);fs[_0x2891('0x2c')](_0x4a8e7a,_0x2891('0x2d'));}catch(_0x76f16b){logger[_0x2891('0x14')](_0x76f16b);}return _0x4a8e7a['split']('.')[0x0];});};exports[_0x2891('0x76')]=function(_0x483695,_0x332a9c,_0x16b401,_0x3ace66,_0x4e0d56,_0x59df76){return aws[_0x2891('0x77')](_0x483695,_0x332a9c,_0x16b401,_0x3ace66,_0x4e0d56,_0x59df76)['then'](function(_0x4d70f1){logger[_0x2891('0x1a')](JSON[_0x2891('0x43')](_0x4d70f1));return _0x4d70f1;});};exports[_0x2891('0x78')]=function(_0x29cbb6,_0x194da4,_0x89499,_0x5b09a2){var _0x26eb18=util[_0x2891('0x79')](_0x2891('0x7a'),ISPEECH_API,_0x29cbb6,encodeURIComponent(_0x194da4),_0x89499,_0x5b09a2);var _0x3b72ef=path[_0x2891('0x27')](__dirname,_0x2891('0x28'),rs[_0x2891('0x37')](0x4)+'.mp3');var _0x55a901;return downloadFile(_0x26eb18,_0x3b72ef)['then'](function(){_0x55a901=path[_0x2891('0x27')](__dirname,_0x2891('0x28'),rs[_0x2891('0x37')](0x4)+_0x2891('0x3c'));return convertFile(_0x3b72ef,_0x55a901);})[_0x2891('0x2b')](function(){try{fs[_0x2891('0x1c')](_0x3b72ef);fs[_0x2891('0x2c')](_0x55a901,_0x2891('0x2d'));}catch(_0x3927cc){logger['error'](_0x3927cc);}return _0x55a901[_0x2891('0x3e')]('.')[0x0];});};exports[_0x2891('0x7b')]=function(_0x10529c,_0x2096a8,_0xa4058e,_0x2325d6){var _0xb8157b=util[_0x2891('0x79')](_0x2891('0x7c'),ISPEECH_API,_0x2096a8,_0xa4058e,base64Encode(_0x10529c),_0x2325d6?util[_0x2891('0x79')](_0x2891('0x7d'),encodeURIComponent(_0x2325d6)):_0x2891('0x7e'));return uploadFile(_0xb8157b)[_0x2891('0x2b')](function(_0x2163bd){return querystring[_0x2891('0x7f')](_0x2163bd);});};exports[_0x2891('0x80')]=function(_0x34da86,_0x9db7ad){return sestek[_0x2891('0x81')](_0x34da86,_0x9db7ad)[_0x2891('0x2b')](function(_0x24f959){logger[_0x2891('0x1a')](JSON['stringify'](_0x24f959));var _0x292c4c={'speech':_0x24f959[_0x2891('0x82')],'action':_0x24f959[_0x2891('0x83')]?_0x24f959['channelData'][_0x2891('0x84')]:undefined,'actiondata':_0x24f959[_0x2891('0x83')]?_0x24f959['channelData'][_0x2891('0x85')]:undefined};if(_0x24f959[_0x2891('0x83')]&&_0x24f959[_0x2891('0x83')][_0x2891('0x86')]){return base64Decode(_0x24f959[_0x2891('0x83')][_0x2891('0x86')]['Data'],path[_0x2891('0x27')](__dirname,_0x2891('0x28'),rs[_0x2891('0x37')](0x4)+'.wav'))[_0x2891('0x2b')](function(_0x63ffc6){_0x292c4c[_0x2891('0x87')]=_0x63ffc6;return _0x292c4c;});}return _0x292c4c;});};exports[_0x2891('0x88')]=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 067645d..7287138 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 _0xbd11=['./nda','exports'];(function(_0x2f4e4e,_0x472aef){var _0x2e9f56=function(_0x5bbd23){while(--_0x5bbd23){_0x2f4e4e['push'](_0x2f4e4e['shift']());}};_0x2e9f56(++_0x472aef);}(_0xbd11,0x1bc));var _0x1bd1=function(_0x27398c,_0x4ea33f){_0x27398c=_0x27398c-0x0;var _0x155fc5=_0xbd11[_0x27398c];return _0x155fc5;};var nda=require(_0x1bd1('0x0'));module[_0x1bd1('0x1')]={'nda':nda}; \ No newline at end of file +var _0xb94d=['./nda'];(function(_0x11e239,_0x3cfa93){var _0x4b1ee8=function(_0x7859bf){while(--_0x7859bf){_0x11e239['push'](_0x11e239['shift']());}};_0x4b1ee8(++_0x3cfa93);}(_0xb94d,0x84));var _0xdb94=function(_0x3df1e9,_0x3cd30e){_0x3df1e9=_0x3df1e9-0x0;var _0xd6b371=_0xb94d[_0x3df1e9];return _0xd6b371;};var nda=require(_0xdb94('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 6854958..b5095c2 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 _0xd2bf=['text','Bearer\x20','access_token','body','ProjectName','project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd2bf[_0x122ef9];return _0x42fba0;};'use strict';var rp=require(_0xfd2b('0x0'));var url=require('url');var logger=require('../../../../../config/logger')('agi');module[_0xfd2b('0x1')]=function(_0x18579c,_0x52ee70){var _0x401860={'method':'POST','uri':url[_0xfd2b('0x2')](_0x52ee70[_0xfd2b('0x3')],_0xfd2b('0x4')),'form':{'grant_type':_0xfd2b('0x5'),'username':_0x52ee70[_0xfd2b('0x6')],'password':_0x52ee70['password']},'json':!![]};return rp(_0x401860)[_0xfd2b('0x7')](function(_0x2fa636){var _0x46e8db={'method':_0xfd2b('0x8'),'uri':url[_0xfd2b('0x2')](_0x52ee70[_0xfd2b('0x9')],_0xfd2b('0xa')),'body':{'type':_0x52ee70[_0xfd2b('0xb')]||_0xfd2b('0xc'),'channelId':_0xfd2b('0xd'),'conversation':{'id':_0x18579c[_0xfd2b('0xe')]},'from':{'id':_0x18579c[_0xfd2b('0xf')],'name':_0x18579c[_0xfd2b('0x10')]},'recipient':{'id':_0x18579c[_0xfd2b('0x11')],'name':_0x18579c['extension']},'text':_0x52ee70[_0xfd2b('0x12')],'channelData':{}},'headers':{'Authorization':_0xfd2b('0x13')+_0x2fa636[_0xfd2b('0x14')]},'json':!![]};if(_0x52ee70['project']){_0x46e8db[_0xfd2b('0x15')]['channelData'][_0xfd2b('0x16')]=_0x52ee70[_0xfd2b('0x17')];}if(_0x52ee70[_0xfd2b('0x18')]=='1'){_0x46e8db['body'][_0xfd2b('0x19')][_0xfd2b('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xfd2b('0x1b')};}if(_0x52ee70[_0xfd2b('0x1c')]){_0x46e8db[_0xfd2b('0x15')]['channelData'][_0xfd2b('0x1d')]=_0x52ee70[_0xfd2b('0x1c')];if(_0x52ee70[_0xfd2b('0x1e')]){_0x46e8db[_0xfd2b('0x15')][_0xfd2b('0x19')][_0xfd2b('0x1f')]=_0x52ee70['custom_action_data'];}}logger['info'](JSON[_0xfd2b('0x20')](_0x46e8db));return rp(_0x46e8db);});}; \ No newline at end of file +var _0xae2b=['url','agi','exports','POST','ndauth_url','password','username','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','extension','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise'];(function(_0x1228ce,_0x261033){var _0x2dc5e7=function(_0x55ed24){while(--_0x55ed24){_0x1228ce['push'](_0x1228ce['shift']());}};_0x2dc5e7(++_0x261033);}(_0xae2b,0xb3));var _0xbae2=function(_0x33bee5,_0x5c7a60){_0x33bee5=_0x33bee5-0x0;var _0x3556d2=_0xae2b[_0x33bee5];return _0x3556d2;};'use strict';var rp=require(_0xbae2('0x0'));var url=require(_0xbae2('0x1'));var logger=require('../../../../../config/logger')(_0xbae2('0x2'));module[_0xbae2('0x3')]=function(_0x34de92,_0x214f0e){var _0x449c9d={'method':_0xbae2('0x4'),'uri':url['resolve'](_0x214f0e[_0xbae2('0x5')],'/token'),'form':{'grant_type':_0xbae2('0x6'),'username':_0x214f0e[_0xbae2('0x7')],'password':_0x214f0e[_0xbae2('0x6')]},'json':!![]};return rp(_0x449c9d)['then'](function(_0x4788c4){var _0x57f2ca={'method':'POST','uri':url[_0xbae2('0x8')](_0x214f0e[_0xbae2('0x9')],_0xbae2('0xa')),'body':{'type':_0x214f0e[_0xbae2('0xb')]||_0xbae2('0xc'),'channelId':_0xbae2('0xd'),'conversation':{'id':_0x34de92[_0xbae2('0xe')]},'from':{'id':_0x34de92['callerid'],'name':_0x34de92['calleridname']},'recipient':{'id':_0x34de92['dnid'],'name':_0x34de92[_0xbae2('0xf')]},'text':_0x214f0e['text'],'channelData':{}},'headers':{'Authorization':_0xbae2('0x10')+_0x4788c4[_0xbae2('0x11')]},'json':!![]};if(_0x214f0e[_0xbae2('0x12')]){_0x57f2ca['body'][_0xbae2('0x13')][_0xbae2('0x14')]=_0x214f0e['project'];}if(_0x214f0e[_0xbae2('0x15')]=='1'){_0x57f2ca[_0xbae2('0x16')][_0xbae2('0x13')][_0xbae2('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xbae2('0x18')};}if(_0x214f0e[_0xbae2('0x19')]){_0x57f2ca[_0xbae2('0x16')]['channelData'][_0xbae2('0x1a')]=_0x214f0e['custom_action'];if(_0x214f0e[_0xbae2('0x1b')]){_0x57f2ca[_0xbae2('0x16')]['channelData'][_0xbae2('0x1c')]=_0x214f0e[_0xbae2('0x1b')];}}logger['info'](JSON[_0xbae2('0x1d')](_0x57f2ca));return rp(_0x57f2ca);});}; \ 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 54cc3ca..6527684 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 _0x69c3=['exports','./lib/api'];(function(_0x3cd1d4,_0x20d639){var _0x53f743=function(_0x1f3a0b){while(--_0x1f3a0b){_0x3cd1d4['push'](_0x3cd1d4['shift']());}};_0x53f743(++_0x20d639);}(_0x69c3,0x15d));var _0x369c=function(_0x13c5af,_0x13aae9){_0x13c5af=_0x13c5af-0x0;var _0x55bc84=_0x69c3[_0x13c5af];return _0x55bc84;};'use strict';var asr=require(_0x369c('0x0'));module[_0x369c('0x1')]=function(_0x517498,_0x478f99,_0x14840a,_0x85dd2a){return asr(_0x517498,_0x478f99,_0x14840a,_0x85dd2a);}; \ No newline at end of file +var _0x563e=['exports','./lib/api'];(function(_0x139f4a,_0x4b295a){var _0x443006=function(_0x122fdf){while(--_0x122fdf){_0x139f4a['push'](_0x139f4a['shift']());}};_0x443006(++_0x4b295a);}(_0x563e,0x1cf));var _0xe563=function(_0x1aa049,_0x9ae13c){_0x1aa049=_0x1aa049-0x0;var _0x357f29=_0x563e[_0x1aa049];return _0x357f29;};'use strict';var asr=require(_0xe563('0x0'));module[_0xe563('0x1')]=function(_0x22e8af,_0x2d253f,_0x14ec10,_0x5d34a1){return asr(_0x22e8af,_0x2d253f,_0x14ec10,_0x5d34a1);}; \ 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 5ed1b04..1a03e04 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 _0x0155=['Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','../../../../../../config/logger','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','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0155,0x94));var _0x5015=function(_0x171cbe,_0x45e051){_0x171cbe=_0x171cbe-0x0;var _0x2474f4=_0x0155[_0x171cbe];return _0x2474f4;};'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(_0x5015('0x0'))('agi');module[_0x5015('0x1')]=function(_0x14f2c1,_0x4c3558,_0x441cf9,_0x35b840){return new BPromise(function(_0x12af1d,_0x549238){logger[_0x5015('0x2')](_0x5015('0x3'),_0x35b840||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x1431c4=new WebSocket(_0x35b840||_0x5015('0x4'),{'perMessageDeflate':![]});var _0x387361='';var _0x132ba9='0';var _0x490fb2='1';var _0x454788=_0x5015('0x5');function _0x2d9b2b(_0x4d79d7){var _0x9abfef=crypto[_0x5015('0x6')]('sha1');_0x9abfef['update'](_0x4d79d7);return _0x9abfef['digest'](_0x5015('0x7'));}function _0xc4e990(){try{logger[_0x5015('0x2')](_0x5015('0x8'));var _0x563aed=moment()['unix']();var _0x1bb79f=_0x2d9b2b(_0x563aed+_0x4c3558+_0x441cf9);_0x1431c4[_0x5015('0x9')](JSON[_0x5015('0xa')]({'appID':_0x4c3558,'timestamp':_0x563aed,'appKey':_0x1bb79f}));var _0x49d9e2=fs['createReadStream'](_0x14f2c1);_0x49d9e2['on'](_0x5015('0xb'),function(_0x1917ae){_0x1431c4[_0x5015('0x9')](_0x1917ae);});_0x49d9e2['on'](_0x5015('0xc'),function(){_0x1431c4[_0x5015('0x9')](_0x5015('0xd'));});}catch(_0x261049){logger[_0x5015('0xe')]('Tilde\x20ASR\x20send\x20error',JSON[_0x5015('0xa')](_0x261049));_0x1431c4[_0x5015('0xf')]();}}function _0x2099b7(_0x561223){try{if(_0x561223){var _0x280a01=JSON[_0x5015('0x10')](_0x561223);switch(_0x280a01[_0x5015('0x11')]){case 0x0:if(_0x280a01[_0x5015('0x12')]){if(_0x280a01['result'][_0x5015('0x13')]){logger[_0x5015('0x2')](_0x5015('0x14'),JSON[_0x5015('0xa')](_0x280a01[_0x5015('0x12')][_0x5015('0x15')]));_0x387361=_0x280a01[_0x5015('0x12')][_0x5015('0x15')][0x0][_0x5015('0x16')];_0x132ba9=_0x280a01['result'][_0x5015('0x15')][0x0][_0x5015('0x17')];_0x490fb2='0';_0x454788=_0x5015('0x18');_0x1431c4['terminate']();}}break;case 0x1:logger[_0x5015('0x2')](_0x5015('0x5'));_0x490fb2='1';_0x454788=_0x5015('0x5');break;case 0x2:logger['info'](_0x5015('0x19'));_0x490fb2='2';_0x454788='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x5015('0x2')](_0x5015('0x1a'));_0x490fb2='9';_0x454788=_0x5015('0x1a');break;case 0xa:logger[_0x5015('0x2')]('Authentication\x20failed.');_0x490fb2='10';_0x454788=_0x5015('0x1b');break;case 0xb:logger[_0x5015('0x2')](_0x5015('0x1c'));_0x490fb2='11';_0x454788=_0x5015('0x1c');}}}catch(_0x5a88f8){logger[_0x5015('0xe')](_0x5015('0x1d'),JSON[_0x5015('0xa')](_0x5a88f8));_0x1431c4[_0x5015('0xf')]();}}function _0x3acd04(){logger[_0x5015('0x2')](_0x5015('0x1e'));_0x12af1d({'transcript':_0x387361,'confidence':_0x132ba9,'status':_0x490fb2,'status_message':_0x454788});}function _0x57774c(_0x1571c2){logger[_0x5015('0xe')](_0x5015('0x1f'));if(!_[_0x5015('0x20')](_0x1571c2)){logger[_0x5015('0xe')](_[_0x5015('0x21')](_0x1571c2)?JSON['stringify'](_0x1571c2):_0x1571c2);}}_0x1431c4['on']('open',_0xc4e990);_0x1431c4['on'](_0x5015('0x22'),_0x2099b7);_0x1431c4['on'](_0x5015('0xc'),_0x3acd04);_0x1431c4['on'](_0x5015('0xe'),_0x57774c);});}; \ No newline at end of file +var _0x0600=['../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','final','hypotheses','transcript','likelihood','Success.','terminate','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','crypto'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0x0600,0x1ab));var _0x0060=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0x0600[_0x405385];return _0x43837b;};'use strict';var BPromise=require(_0x0060('0x0'));var _=require(_0x0060('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x0060('0x2'));var logger=require(_0x0060('0x3'))('agi');module[_0x0060('0x4')]=function(_0x51757e,_0x4853ca,_0x1ed61e,_0x5f3130){return new BPromise(function(_0x54eaff,_0x582302){logger[_0x0060('0x5')](_0x0060('0x6'),_0x5f3130||_0x0060('0x7'));var _0x11869b=new WebSocket(_0x5f3130||_0x0060('0x7'),{'perMessageDeflate':![]});var _0xe99b49='';var _0x1cce54='0';var _0x38df49='1';var _0x32e18e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4d7a56(_0x5d7834){var _0x32be10=crypto[_0x0060('0x8')](_0x0060('0x9'));_0x32be10[_0x0060('0xa')](_0x5d7834);return _0x32be10[_0x0060('0xb')](_0x0060('0xc'));}function _0x537db0(){try{logger[_0x0060('0x5')](_0x0060('0xd'));var _0x4115f3=moment()[_0x0060('0xe')]();var _0x5b02ee=_0x4d7a56(_0x4115f3+_0x4853ca+_0x1ed61e);_0x11869b[_0x0060('0xf')](JSON[_0x0060('0x10')]({'appID':_0x4853ca,'timestamp':_0x4115f3,'appKey':_0x5b02ee}));var _0x10127e=fs[_0x0060('0x11')](_0x51757e);_0x10127e['on'](_0x0060('0x12'),function(_0x5ebd4b){_0x11869b[_0x0060('0xf')](_0x5ebd4b);});_0x10127e['on'](_0x0060('0x13'),function(){_0x11869b[_0x0060('0xf')](_0x0060('0x14'));});}catch(_0x1faea3){logger[_0x0060('0x15')](_0x0060('0x16'),JSON[_0x0060('0x10')](_0x1faea3));_0x11869b['terminate']();}}function _0x35c603(_0x22a2e7){try{if(_0x22a2e7){var _0x2d7dab=JSON['parse'](_0x22a2e7);switch(_0x2d7dab[_0x0060('0x17')]){case 0x0:if(_0x2d7dab[_0x0060('0x18')]){if(_0x2d7dab['result'][_0x0060('0x19')]){logger[_0x0060('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x0060('0x10')](_0x2d7dab[_0x0060('0x18')][_0x0060('0x1a')]));_0xe99b49=_0x2d7dab['result'][_0x0060('0x1a')][0x0][_0x0060('0x1b')];_0x1cce54=_0x2d7dab['result']['hypotheses'][0x0][_0x0060('0x1c')];_0x38df49='0';_0x32e18e=_0x0060('0x1d');_0x11869b[_0x0060('0x1e')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x38df49='1';_0x32e18e=_0x0060('0x1f');break;case 0x2:logger[_0x0060('0x5')](_0x0060('0x20'));_0x38df49='2';_0x32e18e=_0x0060('0x20');break;case 0x9:logger[_0x0060('0x5')](_0x0060('0x21'));_0x38df49='9';_0x32e18e=_0x0060('0x21');break;case 0xa:logger[_0x0060('0x5')]('Authentication\x20failed.');_0x38df49='10';_0x32e18e=_0x0060('0x22');break;case 0xb:logger[_0x0060('0x5')](_0x0060('0x23'));_0x38df49='11';_0x32e18e=_0x0060('0x23');}}}catch(_0x238485){logger[_0x0060('0x15')](_0x0060('0x24'),JSON[_0x0060('0x10')](_0x238485));_0x11869b[_0x0060('0x1e')]();}}function _0x1787fa(){logger['info'](_0x0060('0x25'));_0x54eaff({'transcript':_0xe99b49,'confidence':_0x1cce54,'status':_0x38df49,'status_message':_0x32e18e});}function _0x57663d(_0x6f410){logger[_0x0060('0x15')](_0x0060('0x26'));if(!_[_0x0060('0x27')](_0x6f410)){logger[_0x0060('0x15')](_[_0x0060('0x28')](_0x6f410)?JSON['stringify'](_0x6f410):_0x6f410);}}_0x11869b['on'](_0x0060('0x29'),_0x537db0);_0x11869b['on'](_0x0060('0x2a'),_0x35c603);_0x11869b['on'](_0x0060('0x13'),_0x1787fa);_0x11869b['on'](_0x0060('0x15'),_0x57663d);});}; \ 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 a22a17d..f2ea91e 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 _0xfea4=['./asr','exports'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xfea4,0x1bc));var _0x4fea=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xfea4[_0x903228];return _0xcec81d;};var asr=require(_0x4fea('0x0'));module[_0x4fea('0x1')]={'asr':asr}; \ No newline at end of file +var _0xb2b3=['exports'];(function(_0x278791,_0x524604){var _0x555542=function(_0x2f4919){while(--_0x2f4919){_0x278791['push'](_0x278791['shift']());}};_0x555542(++_0x524604);}(_0xb2b3,0x147));var _0x3b2b=function(_0xfbb565,_0x561633){_0xfbb565=_0xfbb565-0x0;var _0x5a8cb2=_0xb2b3[_0xfbb565];return _0x5a8cb2;};var asr=require('./asr');module[_0x3b2b('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 930bd1a..08d6b7e 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 _0xd8b0=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection'];(function(_0x1aa068,_0x468aa8){var _0x2e5f0b=function(_0x4e17b3){while(--_0x4e17b3){_0x1aa068['push'](_0x1aa068['shift']());}};_0x2e5f0b(++_0x468aa8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var net=require(_0x0d8b('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0d8b('0x2'));var AGIServer=function(_0x5b9b89,_0x43bca1,_0x364286){var _0x8196ed=this;var _0x577834=null;var _0x5e15e6=0x0;if(!_0x5b9b89)_0x5b9b89=0x11dd;if(!_0x43bca1)_0x43bca1=_0x0d8b('0x3');EventEmitter[_0x0d8b('0x4')](_0x8196ed);function _0x39f43a(){if(!_0x5b9b89){_0x8196ed['emit'](_0x0d8b('0x5'),new AGIError(_0x0d8b('0x6')));return![];}_0x577834=net['createServer']();_0x577834[_0x0d8b('0x7')](_0x5b9b89,_0x43bca1);_0x577834['on'](_0x0d8b('0x8'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x8'));});_0x577834['on'](_0x0d8b('0xa'),function(_0x1cac62){_0x577834[_0x0d8b('0xb')](function(_0x28f87c,_0x48fa16){if(_0x28f87c){_0x8196ed[_0x0d8b('0x9')]('error',new AGIError(_0x0d8b('0xc'),_0x28f87c));}else if(_0x364286&&_0x364286<0x0){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xd')));_0x1cac62[_0x0d8b('0xe')]();}else if(_0x364286&&_0x364286>0x0&&_0x364286<_0x48fa16){_0x5e15e6+=0x1;_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xf'),_0x5e15e6));_0x1cac62[_0x0d8b('0xe')]();}else{var _0x2ce75e=new AGIChannel(_0x1cac62);_0x2ce75e['on'](_0x0d8b('0x10'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x2ce75e);});}});});_0x577834['on'](_0x0d8b('0x5'),function(_0x4f6f21){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xc'),_0x4f6f21[_0x0d8b('0x11')]));});_0x577834['on'](_0x0d8b('0x12'),function(){_0x8196ed['emit'](_0x0d8b('0x12'),new AGIError(_0x0d8b('0x13')));});}process[_0x0d8b('0x14')](function(){_0x39f43a();});};util[_0x0d8b('0x15')](AGIServer,EventEmitter);module[_0x0d8b('0x16')]=function(_0x18dd2d,_0x264b39,_0xa3612a){return new AGIServer(_0x18dd2d,_0x264b39,_0xa3612a);}; \ No newline at end of file +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(_0x3541e4,_0x4dcf9a){var _0x3ca5d9=function(_0x3eaac2){while(--_0x3eaac2){_0x3541e4['push'](_0x3541e4['shift']());}};_0x3ca5d9(++_0x4dcf9a);}(_0xe706,0xa3));var _0x6e70=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0xe706[_0x22868f];return _0x97bc75;};'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 diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index d7ed138..1ceaa34 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 _0x132f=['callback_','random','lastName','phone','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','uri','agicommand','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','isString','format','%s.%s','length','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','noop','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','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','list_id','no\x20list\x20selected','scheduledAt','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query:\x20%s','getQueryOdbc','variable_id','getVariable','keys','forEach','%s[%s][%s]','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','TildeASR\x20Result\x20%s','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','no\x20file\x20audio\x20selected','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','createSquareRecording','escape_digits','Response:','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','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','getSmsAccount','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','AGI','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','no\x20variable\x20selected','join','exports','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','menu','getsecretdigits','channel','rpc','mailRpc','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','open','error','query','info','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','calleridname','context','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil'];(function(_0x59d16d,_0x4359e6){var _0x2419ae=function(_0x356033){while(--_0x356033){_0x59d16d['push'](_0x59d16d['shift']());}};_0x2419ae(++_0x4359e6);}(_0x132f,0x182));var _0xf132=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x132f[_0x246f0c];return _0x30fe50;};'use strict';var fs=require('fs');var util=require(_0xf132('0x0'));var _=require(_0xf132('0x1'));var sh=require(_0xf132('0x2'));var odbc=require(_0xf132('0x3'))();var rs=require(_0xf132('0x4'));var moment=require(_0xf132('0x5'));var Mustache=require('mustache');var rp=require(_0xf132('0x6'));var logger=require(_0xf132('0x7'))(_0xf132('0x8'));var config=require(_0xf132('0x9'));var shared=require(_0xf132('0xa'));var scripts=require('./scripts');var FILES_PATH=_0xf132('0xb');var recursiveMapAttributes=[_0xf132('0xc'),'rawBody'];var verticesWithRetry=[_0xf132('0xd'),'getdigits',_0xf132('0xe')];var AGIVertices=function(_0x3f1da2,_0x3bc98d,_0xa89a67){this[_0xf132('0xf')]=_0x3f1da2;this[_0xf132('0x10')]=_0x3bc98d;this[_0xf132('0x11')]=_0xa89a67;};AGIVertices['prototype']['getVariable']=function(_0x10a5b0,_0x16256e){this[_0xf132('0x10')][_0xf132('0x12')](_0x10a5b0)[_0xf132('0x13')](function(_0x16e32b){_0x16256e(null,_0x16e32b?_0x16e32b[_0xf132('0x14')]:![]);})[_0xf132('0x15')](function(_0x3f0f56){_0x16256e(_0x3f0f56);});};AGIVertices[_0xf132('0x16')][_0xf132('0x17')]=function(_0xc6bd04,_0x5b58f8){this[_0xf132('0x10')][_0xf132('0x18')](_0xc6bd04)['then'](function(_0x18f348){_0x5b58f8(null,_0x18f348?_0x18f348['name']:![]);})['catch'](function(_0x206e0c){_0x5b58f8(_0x206e0c);});};AGIVertices[_0xf132('0x16')][_0xf132('0x19')]=function(_0x559a72,_0x48686e){this[_0xf132('0x10')][_0xf132('0x1a')](_0x559a72)[_0xf132('0x13')](function(_0x31db78){_0x48686e(null,_0x31db78?_0x31db78['name']:![]);})[_0xf132('0x15')](function(_0x26123a){_0x48686e(_0x26123a);});};AGIVertices[_0xf132('0x16')][_0xf132('0x1b')]=function(_0x4b4f5d,_0x1490aa){this['rpc'][_0xf132('0x1c')](_0x4b4f5d)[_0xf132('0x13')](function(_0x53b78a){_0x1490aa(null,_0x53b78a?_0x53b78a[_0xf132('0x1d')]:![]);})['catch'](function(_0x5aae77){_0x1490aa(_0x5aae77);});};AGIVertices['prototype']['getUser']=function(_0xbb67a7,_0x202dca){this[_0xf132('0x10')][_0xf132('0x1e')](_0xbb67a7)[_0xf132('0x13')](function(_0x3f7613){_0x202dca(null,_0x3f7613?_0x3f7613[_0xf132('0x14')]:![]);})['catch'](function(_0x3db8a0){_0x202dca(_0x3db8a0);});};AGIVertices[_0xf132('0x16')][_0xf132('0x1f')]=function(_0x46d563,_0x3c7014){this[_0xf132('0x10')][_0xf132('0x20')](_0x46d563)['then'](function(_0x30dec4){_0x3c7014(null,_0x30dec4?_0x30dec4[_0xf132('0x14')]:![]);})['catch'](function(_0x5b01b5){_0x3c7014(_0x5b01b5);});};AGIVertices[_0xf132('0x16')][_0xf132('0x21')]=function(_0x3933bc,_0x11aba6){var _0x2c589f=this;this[_0xf132('0x10')][_0xf132('0x22')](_0x3933bc)[_0xf132('0x13')](function(_0x395050){_0x11aba6(null,_0x395050?_0x2c589f[_0xf132('0x23')](_0x395050[_0xf132('0x24')]):![]);})[_0xf132('0x15')](function(_0xeb393e){_0x11aba6(_0xeb393e);});};AGIVertices['prototype'][_0xf132('0x25')]=function(_0x519127,_0x4ff070){this[_0xf132('0x10')]['getMailAccountById'](_0x519127)['then'](function(_0x23cd0d){_0x4ff070(null,_0x23cd0d?_0x23cd0d:![]);})['catch'](function(_0x14d317){_0x4ff070(_0x14d317);});};AGIVertices[_0xf132('0x16')][_0xf132('0x26')]=function(_0x470c3c,_0x22b717,_0xcec365){this[_0xf132('0x11')][_0xf132('0x26')](_0x470c3c,_0x22b717)[_0xf132('0x13')](function(){_0xcec365(null);})[_0xf132('0x15')](function(_0x3cdeb0){_0xcec365(_0x3cdeb0);});};AGIVertices['prototype'][_0xf132('0x27')]=function(_0x360dc9,_0x4e845a){this[_0xf132('0x10')][_0xf132('0x28')](_0x360dc9)['then'](function(_0x58e09f){if(_0x58e09f){if(_0x58e09f[_0xf132('0x29')]){_0x4e845a(null,[_0x58e09f[_0xf132('0x2a')]]);}else{_0x4e845a(null,_[_0xf132('0x2b')](_0x58e09f[_0xf132('0x2c')],_0xf132('0x2a')));}}else{_0x4e845a(null,![]);}})[_0xf132('0x15')](function(_0x5788f9){_0x4e845a(_0x5788f9);});};AGIVertices['prototype']['getSoundPath']=function(_0x56d3b2){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x56d3b2);};AGIVertices[_0xf132('0x16')]['getQueryOdbc']=function(_0x24f755,_0x245e1e,_0x19d0fa){odbc[_0xf132('0x2d')](_0x24f755,function(_0x1e65de){if(_0x1e65de){logger[_0xf132('0x2e')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1e65de);_0x19d0fa(_0x1e65de);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xf132('0x2f')](_0x245e1e,function(_0x492672,_0x25da37){if(_0x492672){logger['info']('Error\x20executing\x20query\x20%s',_0x245e1e);_0x19d0fa(_0x492672);}else{logger[_0xf132('0x30')](_0xf132('0x31'),_0x245e1e);odbc['close'](function(_0x301645){if(_0x301645){logger[_0xf132('0x2e')](_0xf132('0x32'),_0x301645);}_0x19d0fa(null,_0x25da37);});}});}});};AGIVertices[_0xf132('0x16')]['getSmsAccount']=function(_0x52c898,_0x59f5d1){this[_0xf132('0x10')][_0xf132('0x33')](_0x52c898)[_0xf132('0x13')](function(_0x2cf745){_0x59f5d1(null,_0x2cf745?_0x2cf745:![]);})['catch'](function(_0x4e9119){_0x59f5d1(_0x4e9119);});};AGIVertices['prototype'][_0xf132('0x34')]=function(_0xd94a68,_0x9074a4){this['rpc'][_0xf132('0x34')](_0xd94a68)[_0xf132('0x13')](function(_0x163604){_0x9074a4(null,_0x163604);})['catch'](function(_0x121719){_0x9074a4(_0x121719);});};AGIVertices[_0xf132('0x16')][_0xf132('0x35')]=function(_0x4c597f,_0x387c95,_0x4f4ece){this[_0xf132('0x10')][_0xf132('0x35')]({'uniqueid':this[_0xf132('0xf')][_0xf132('0x36')],'node':_0x4c597f[_0xf132('0x37')],'application':_0x4c597f['agicommand'],'data':_0x387c95||null,'project_name':this['channel'][_0xf132('0x38')],'callerid':this['channel'][_0xf132('0x39')]})['then'](function(_0x466614){if(_0x4f4ece){_0x4f4ece(null,_0x466614);}})['catch'](function(_0x1d77f6){if(_0x4f4ece){_0x4f4ece(_0x1d77f6);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x30a601,_0x1295a4,_0x2a5194,_0x2a439d){this['rpc']['createSquareRecording']({'uniqueid':this[_0xf132('0xf')][_0xf132('0x36')],'callerid':this[_0xf132('0xf')][_0xf132('0x39')],'calleridname':this[_0xf132('0xf')][_0xf132('0x3a')],'context':this[_0xf132('0xf')][_0xf132('0x3b')],'extension':this[_0xf132('0xf')]['extension'],'priority':this[_0xf132('0xf')][_0xf132('0x3c')],'accountcode':this[_0xf132('0xf')][_0xf132('0x3d')],'dnid':this[_0xf132('0xf')]['dnid'],'projectName':this[_0xf132('0xf')][_0xf132('0x38')],'saveName':_0x1295a4,'filename':_0x30a601[_0xf132('0x3e')]||_0x1295a4,'savePath':_0x2a5194})[_0xf132('0x13')](function(_0x5604bb){_0x2a439d(null,_0x5604bb);})[_0xf132('0x15')](function(_0x7fdfce){_0x2a439d(_0x7fdfce);});};AGIVertices[_0xf132('0x16')][_0xf132('0x3f')]=function(_0x4d40b9,_0x2d0cbc,_0x205c1e,_0x4ce486,_0x143c44){this[_0xf132('0x10')][_0xf132('0x3f')]({'uniqueid':this[_0xf132('0xf')][_0xf132('0x36')],'body':_0x4d40b9,'direction':_0x2d0cbc,'providerName':_0x205c1e,'providerResponse':_0x4ce486})[_0xf132('0x13')](function(_0x479d43){if(_0x143c44){_0x143c44(null,_0x479d43);}})['catch'](function(_0x134a71){if(_0x143c44){_0x143c44(_0x134a71);}});};AGIVertices['prototype'][_0xf132('0x40')]=function(_0x5b68e2,_0x875fb0){this[_0xf132('0x10')][_0xf132('0x40')]({'firstName':_[_0xf132('0x41')](_0x5b68e2[_0xf132('0x14')])||_[_0xf132('0x42')](_0x5b68e2[_0xf132('0x14')])?_0xf132('0x43')+Math[_0xf132('0x44')]():_0x5b68e2[_0xf132('0x14')],'lastName':_[_0xf132('0x41')](_0x5b68e2['lastName'])||_['isNil'](_0x5b68e2[_0xf132('0x45')])?null:_0x5b68e2[_0xf132('0x45')],'phone':_0x5b68e2[_0xf132('0x46')],'ListId':_0x5b68e2['list_id'],'scheduledat':_0x5b68e2['scheduledAt'],'callbackUniqueid':this['channel'][_0xf132('0x36')],'tags':_0xf132('0x47'),'description':_0xf132('0x48')+_0x5b68e2['scheduledAt'][_0xf132('0x49')](),'priority':_0x5b68e2[_0xf132('0x4a')]})['then'](function(_0x21edf4){_0x875fb0(null,_0x21edf4);})['catch'](function(_0x76a808){_0x875fb0(_0x76a808);});};AGIVertices[_0xf132('0x16')][_0xf132('0x4b')]=function(_0x148fc7,_0x4fa23f){this[_0xf132('0x10')]['getPauseById'](_0x148fc7)['then'](function(_0x206dd0){_0x4fa23f(null,_0x206dd0?_0x206dd0['name']:![]);})[_0xf132('0x15')](function(_0x3af6cf){_0x4fa23f(_0x3af6cf);});};AGIVertices['prototype'][_0xf132('0x4c')]=function(_0x2f6001,_0x9bdb69,_0x8abc42){var _0x13f54b={'role':_0xf132('0x4d')};_0x13f54b[_0x2f6001]=this[_0xf132('0xf')]['callerid'];this[_0xf132('0x10')][_0xf132('0x4c')](_0x13f54b,_0x9bdb69,this['channel'][_0xf132('0x36')])[_0xf132('0x13')](function(_0x4b1683){_0x8abc42(null,_[_0xf132('0x42')](_0x4b1683)?![]:!![]);})[_0xf132('0x15')](function(_0x26f4e9){logger[_0xf132('0x2e')](_0x26f4e9);_0x8abc42(null,![]);});};AGIVertices[_0xf132('0x16')][_0xf132('0x4e')]=function(_0x44e155,_0x69fb34){var _0x4181e2={'role':_0xf132('0x4d')};_0x4181e2[_0x44e155]=this[_0xf132('0xf')]['callerid'];this[_0xf132('0x10')][_0xf132('0x4e')](_0x4181e2)[_0xf132('0x13')](function(_0x45d820){_0x69fb34(null,_[_0xf132('0x42')](_0x45d820)?![]:!![]);})[_0xf132('0x15')](function(_0x22429e){logger['error'](_0x22429e);_0x69fb34(null,![]);});};AGIVertices[_0xf132('0x16')][_0xf132('0x4f')]=function(_0x17806d,_0x5845e8){var _0x48ce0e={'role':_0xf132('0x4d')};_0x48ce0e[_0x17806d]=this['channel']['callerid'];this[_0xf132('0x10')][_0xf132('0x4f')](_0x48ce0e)[_0xf132('0x13')](function(_0x5b394a){_0x5845e8(null,_[_0xf132('0x42')](_0x5b394a)?![]:!![]);})[_0xf132('0x15')](function(_0x1046d1){logger[_0xf132('0x2e')](_0x1046d1);_0x5845e8(null,![]);});};AGIVertices['prototype'][_0xf132('0x50')]=function(_0x1c388b,_0x7f633c){var _0x573a71={'role':_0xf132('0x4d')};_0x573a71[_0x1c388b]=this[_0xf132('0xf')][_0xf132('0x39')];var _0x5afab9=_0x1c388b!=_0xf132('0x51')?util['format'](_0xf132('0x52'),'LOCAL',this['channel'][_0xf132('0x39')]):undefined;this[_0xf132('0x10')][_0xf132('0x50')](_0x573a71,_0x5afab9)['then'](function(_0x1a53e4){_0x7f633c(null,_['isNil'](_0x1a53e4)?![]:!![]);})[_0xf132('0x15')](function(_0x2e45e9){logger[_0xf132('0x2e')](_0x2e45e9);_0x7f633c(null,![]);});};AGIVertices['prototype'][_0xf132('0x53')]=function(_0xfb52ab,_0x22f012){sh[_0xf132('0x54')](_[_0xf132('0x55')](_0xfb52ab),function(_0x4b7c37,_0x28b27b){var _0x367654=_0x28b27b[_0xf132('0x56')](/(\r\n|\n|\r)/gm,'');_0x22f012(null,_0x367654);});};AGIVertices[_0xf132('0x16')]['googleCloudTTS']=function(_0x384ee2,_0x291c4b){scripts[_0xf132('0x57')](_0x384ee2[_0xf132('0x58')],_0x384ee2[_0xf132('0x59')]||'text',_0x384ee2[_0xf132('0x5a')],_0x384ee2['languageCode']||'en-US',_0x384ee2[_0xf132('0x5b')]||_0xf132('0x5c'),_0x384ee2['audioEncoding']||'MP3')['then'](function(_0x13d6ad){_0x291c4b(null,_0x13d6ad);})['catch'](function(_0x5296b6){_0x291c4b(_0x5296b6);});};AGIVertices[_0xf132('0x16')][_0xf132('0x5d')]=function(_0x3332bb,_0xd89fa3){scripts['googleTTS'](_0x3332bb[_0xf132('0x5a')],_0x3332bb[_0xf132('0x5e')]||'en',0x1)[_0xf132('0x13')](function(_0x3cea1c){_0xd89fa3(null,_0x3cea1c);})['catch'](function(_0x2deb88){_0xd89fa3(_0x2deb88);});};AGIVertices['prototype'][_0xf132('0x5f')]=function(_0xa28b57,_0x4ba036){var _0x1f19de={'uri':_0xa28b57[_0xf132('0x60')],'method':_0xa28b57[_0xf132('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xa28b57['timeout'])===_0xf132('0x62')&&parseInt(_0xa28b57[_0xf132('0x63')])>=0x1?parseInt(_0xa28b57[_0xf132('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xf132('0x64')]([_0xf132('0x65'),_0xf132('0x66')],_0x1f19de[_0xf132('0x61')][_0xf132('0x67')]())){try{_0x1f19de[_0xf132('0x68')]=_0xa28b57[_0xf132('0x69')]?JSON[_0xf132('0x6a')](_0xa28b57['rawBody']):{};}catch(_0x322710){logger['error'](_0xf132('0x6b'),_0x322710);}}try{_0x1f19de[_0xf132('0x6c')]=_0xa28b57[_0xf132('0xc')]?JSON['parse'](_0xa28b57['rawHeaders']):{};}catch(_0x5383c8){logger[_0xf132('0x2e')](_0xf132('0x6d'),_0x5383c8);}if(_0xa28b57['computedVariables']){try{var _0x4c1c58=require(_0xa28b57['computedVariables'])[_0xf132('0x6e')](this,_0x1f19de);_0x1f19de['uri']=Mustache[_0xf132('0x6f')](_0xa28b57[_0xf132('0x60')],_0x4c1c58,{},['$$','$$']);if(_0x1f19de[_0xf132('0x6c')]){_0x1f19de['headers']=JSON[_0xf132('0x6a')](Mustache[_0xf132('0x6f')](JSON['stringify'](_0x1f19de[_0xf132('0x6c')]),_0x4c1c58,{},['$$','$$']));}if(_0x1f19de[_0xf132('0x68')]){_0x1f19de[_0xf132('0x68')]=JSON[_0xf132('0x6a')](Mustache['render'](JSON[_0xf132('0x70')](_0x1f19de[_0xf132('0x68')]),_0x4c1c58,{},['$$','$$']));}}catch(_0x3dad62){logger[_0xf132('0x2e')](_0xf132('0x71'),_0x3dad62);}}rp(_0x1f19de)[_0xf132('0x13')](function(_0x3480f5){var _0x1cc64a={'statusCode':_0x3480f5[_0xf132('0x72')]||0xc8,'statusMessage':_0x3480f5[_0xf132('0x73')]||'OK','headers':_0x3480f5[_0xf132('0x6c')]||{},'body':_0x3480f5['body']||{}};_0x4ba036(null,_0x1cc64a);})[_0xf132('0x15')](function(_0x201a64){var _0x2c3e40={'statusCode':_0x201a64['statusCode']||0x1f4,'statusMessage':_0x201a64[_0xf132('0x74')]||_0xf132('0x75'),'headers':_0x201a64[_0xf132('0x76')][_0xf132('0x6c')]||{},'body':_0x201a64[_0xf132('0x76')][_0xf132('0x68')]||{}};_0x4ba036(null,_0x2c3e40);});};AGIVertices['prototype'][_0xf132('0x77')]=function(_0x346a16,_0x3ae371){scripts[_0xf132('0x77')](this[_0xf132('0xf')][_0xf132('0x36')],_0x346a16[_0xf132('0x78')],_0x346a16[_0xf132('0x5a')],_0x346a16[_0xf132('0x79')]||'en')['then'](function(_0x562f5d){_0x3ae371(null,_0x562f5d);})['catch'](function(_0x57c2a3){_0x3ae371(_0x57c2a3);});};AGIVertices[_0xf132('0x16')][_0xf132('0x7a')]=function(_0x3d43e7,_0x373383){scripts[_0xf132('0x7a')](this[_0xf132('0xf')]['uniqueid'],_0x3d43e7[_0xf132('0x7b')],_0x3d43e7[_0xf132('0x7c')],_0x3d43e7['private_key'],_0x3d43e7['text'],_0x3d43e7['dialogflowV2_language']||'en')[_0xf132('0x13')](function(_0x1f5a4d){_0x373383(null,_0x1f5a4d);})['catch'](function(_0x204e29){_0x373383(_0x204e29);});};AGIVertices[_0xf132('0x16')][_0xf132('0x7d')]=function(_0x93757c,_0x460228){scripts[_0xf132('0x7d')](this[_0xf132('0xf')],_0x93757c)['then'](function(_0x3acf98){_0x460228(null,_0x3acf98);})[_0xf132('0x15')](function(_0x5d173e){_0x460228(_0x5d173e);});};AGIVertices[_0xf132('0x16')][_0xf132('0x7e')]=function(_0xa07ae7,_0x54f668){scripts['ispeechTTS'](_0xa07ae7['key'],_0xa07ae7['text'],_0xa07ae7[_0xf132('0x7f')]||_0xf132('0x80'),_0xa07ae7[_0xf132('0x81')])[_0xf132('0x13')](function(_0x511823){_0x54f668(null,_0x511823);})[_0xf132('0x15')](function(_0x2509dc){_0x54f668(_0x2509dc);});};AGIVertices[_0xf132('0x16')][_0xf132('0x82')]=function(_0x1a6901,_0x54fbd4,_0x1c0a90){scripts[_0xf132('0x82')](_0x54fbd4,_0x1a6901[_0xf132('0x78')],_0x1a6901['ispeech_asr_language']||_0xf132('0x80'),this[_0xf132('0x83')](_0x1a6901[_0xf132('0x84')])?_0x1a6901[_0xf132('0x84')]:undefined)[_0xf132('0x13')](function(_0xf97a59){_0x1c0a90(null,_0xf97a59);})[_0xf132('0x15')](function(_0x221751){_0x1c0a90(_0x221751);});};AGIVertices[_0xf132('0x16')][_0xf132('0x85')]=function(_0x440e26,_0x2e84f3){scripts[_0xf132('0x85')](_0x440e26[_0xf132('0x86')],_0x440e26[_0xf132('0x87')],_0x440e26[_0xf132('0x88')],_0x440e26[_0xf132('0x89')]||_0xf132('0x8a'),_0x440e26[_0xf132('0x5a')],_0x440e26[_0xf132('0x8b')]||_0xf132('0x5a'))[_0xf132('0x13')](function(_0x5b7db6){_0x2e84f3(null,_0x5b7db6);})[_0xf132('0x15')](function(_0x24b9e0){_0x2e84f3(_0x24b9e0);});};AGIVertices[_0xf132('0x16')][_0xf132('0x8c')]=function(_0x50cc7b,_0x2dd027){scripts[_0xf132('0x8c')](this[_0xf132('0xf')][_0xf132('0x36')],_0x50cc7b[_0xf132('0x86')],_0x50cc7b['aws_secret_access_key'],_0x50cc7b[_0xf132('0x8d')],_0x50cc7b['text'],_0x50cc7b[_0xf132('0x8e')])[_0xf132('0x13')](function(_0x121d83){_0x2dd027(null,_0x121d83);})[_0xf132('0x15')](function(_0x404315){_0x2dd027(_0x404315);});};AGIVertices[_0xf132('0x16')][_0xf132('0x8f')]=function(_0x97fad8,_0x4f42ed,_0x24e78e){scripts['googleASR'](_0x4f42ed,_0x97fad8[_0xf132('0x78')],_0x97fad8[_0xf132('0x90')]||_0xf132('0x80'))[_0xf132('0x13')](function(_0x4f5511){_0x24e78e(null,_0x4f5511);})[_0xf132('0x15')](function(_0x8a26bc){_0x24e78e(_0x8a26bc);});};AGIVertices['prototype'][_0xf132('0x91')]=function(_0x5ec39f,_0x417c41,_0x3b79a4){scripts[_0xf132('0x91')](_0x417c41,_0x5ec39f['appid'],_0x5ec39f[_0xf132('0x92')],_0x5ec39f[_0xf132('0x93')])['then'](function(_0x462bdc){_0x3b79a4(null,_0x462bdc);})[_0xf132('0x15')](function(_0x5f1eae){_0x3b79a4(_0x5f1eae);});};AGIVertices[_0xf132('0x16')]['clear']=function(_0xba22f9){var _0x5a4085=_[_0xf132('0x64')](verticesWithRetry,_0xba22f9[_0xf132('0x94')])?_0xba22f9:_[_0xf132('0x95')](_0xba22f9);for(var _0x59f289 in _0x5a4085){if(_0x5a4085[_0xf132('0x96')](_0x59f289)){if(_0x5a4085[_0x59f289]&&_['isString'](_0x5a4085[_0x59f289])){if(_[_0xf132('0x64')](recursiveMapAttributes,_0x59f289)){_0x5a4085[_0x59f289]=this[_0xf132('0x97')](_0x5a4085[_0x59f289]);}else{_0x5a4085[_0x59f289]=this[_0xf132('0x98')](_0x5a4085[_0x59f289]);}}}}return _0x5a4085;};AGIVertices[_0xf132('0x16')][_0xf132('0x99')]=function(_0x2f07a9){for(var _0x5d3d14 in _0x2f07a9){if(_0x2f07a9[_0xf132('0x96')](_0x5d3d14)){if(_[_0xf132('0x9a')](_0x2f07a9[_0x5d3d14])){this[_0xf132('0x99')](_0x2f07a9[_0x5d3d14]);}else if(_[_0xf132('0x9b')](_0x2f07a9[_0x5d3d14])){for(var _0x182a82=0x0;_0x182a82<_0x2f07a9[_0x5d3d14]['length'];_0x182a82++){this['recursiveNodeIndex'](_0x2f07a9[_0x5d3d14][_0x182a82]);}}else if(_[_0xf132('0x9c')](_0x2f07a9[_0x5d3d14])){_0x2f07a9[_0x5d3d14]=this[_0xf132('0x98')](_0x2f07a9[_0x5d3d14]);}}}};AGIVertices[_0xf132('0x16')]['saveRestApiResult']=function(_0x573341,_0x1a8aca){for(var _0x219740 in _0x573341){if(_0x573341[_0xf132('0x96')](_0x219740)){if(_[_0xf132('0x9a')](_0x573341[_0x219740])){if(!_[_0xf132('0x41')](_0x573341[_0x219740])){this['saveRestApiResult'](_0x573341[_0x219740],util[_0xf132('0x9d')](_0xf132('0x9e'),_0x1a8aca,_0x219740));}}else if(_[_0xf132('0x9b')](_0x573341[_0x219740])){for(var _0x2b348c=0x0;_0x2b348c<_0x573341[_0x219740][_0xf132('0x9f')];_0x2b348c++){this['saveRestApiResult'](_0x573341[_0x219740][_0x2b348c],util[_0xf132('0x9d')]('%s.%s',_0x1a8aca,_0x219740+'['+_0x2b348c+']'));}}else{if(!_[_0xf132('0x42')](_0x573341[_0x219740])){this['channel']['setVariable'](util[_0xf132('0x9d')]('%s.%s',_0x1a8aca,_0x219740),_0x573341[_0x219740]);}}}}};AGIVertices[_0xf132('0x16')][_0xf132('0x97')]=function(_0x53fc7f){try{var _0x1d5569=JSON[_0xf132('0x6a')](_0x53fc7f);this[_0xf132('0x99')](_0x1d5569);return JSON[_0xf132('0x70')](_0x1d5569);}catch(_0x596873){return this[_0xf132('0x98')](_0x53fc7f);}};AGIVertices[_0xf132('0x16')]['replaceAllVariables']=function(_0x32c802){var _0x4f87b0=_0x32c802[_0xf132('0xa0')]('{');for(var _0x4dd7da=0x1;_0x4dd7da<_0x4f87b0[_0xf132('0x9f')];_0x4dd7da+=0x1){var _0x5087e9=_0x4f87b0[_0x4dd7da][_0xf132('0xa0')]('}');if(_0x5087e9['length']>0x1){_0x32c802=_0x32c802[_0xf132('0xa1')]('{'+_0x5087e9[0x0]+'}',this[_0xf132('0xf')]['getVariable'](_0x5087e9[0x0])[_0xf132('0xa2')]||_0x5087e9[0x0]);}}if(_0x4f87b0[_0xf132('0x9f')]===0x1){return _0x32c802[_0xf132('0x49')]();}return this[_0xf132('0x98')](_0x32c802);};AGIVertices['prototype'][_0xf132('0xa3')]=function(_0x367e90,_0x8e2731){var _0x556b53=this[_0xf132('0xf')]['getVariable'](_0x367e90);if(_0x556b53['result']===-0x1){return _0x556b53;}logger[_0xf132('0x30')](util['format'](_0xf132('0xa4'),_0x8e2731,_0x556b53['extra']));return this['channel'][_0xf132('0xa5')](_0x8e2731,_0x556b53[_0xf132('0xa2')]);};AGIVertices[_0xf132('0x16')]['isConfigured']=function(_0xaf5963){return _0xaf5963&&_0xaf5963!=='0'&&_0xaf5963!=='-1'&&_0xaf5963!=='';};AGIVertices[_0xf132('0x16')][_0xf132('0xa6')]=function(_0x17c19b){this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x17c19b,'-');_0x17c19b[_0xf132('0xa7')]=_0x17c19b[_0xf132('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf132('0x16')]['mrcpsynth']=function(_0x4382b9){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x4382b9[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x4382b9[_0xf132('0x5a')])){return this[_0xf132('0xf')][_0xf132('0xa8')]('no\x20text\x20configured');}var _0x184112='\x22'+_0x4382b9[_0xf132('0x5a')]+'\x22';if(this['isConfigured'](_0x4382b9[_0xf132('0x76')])){_0x184112+=','+_0x4382b9[_0xf132('0x76')];}var _0x3f5fba=this[_0xf132('0xf')][_0xf132('0x54')](_0xf132('0xa9'),_0x184112);if(_0x3f5fba[_0xf132('0xaa')]===-0x1){return _0x3f5fba;}return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0xab'),_0x184112));};AGIVertices['prototype'][_0xf132('0xac')]=function(_0x4b56b7){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0xad'),_0x4b56b7[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x4b56b7[_0xf132('0xae')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xaf'));}var _0x49ddf9=_0x4b56b7[_0xf132('0xae')];if(this['isConfigured'](_0x4b56b7[_0xf132('0x76')])){_0x49ddf9+=','+_0x4b56b7[_0xf132('0x76')];}var _0x345162=this[_0xf132('0xf')][_0xf132('0x54')](_0xf132('0xb0'),_0x49ddf9);if(_0x345162[_0xf132('0xaa')]===-0x1){return _0x345162;}var _0x1be306=this[_0xf132('0xa3')](_0xf132('0xb1'),_0xf132('0xb2'));if(_0x1be306[_0xf132('0xaa')]===-0x1){return _0x1be306;}var _0x4c19d9=this[_0xf132('0xa3')](_0xf132('0xb3'),_0xf132('0xb4'));if(_0x4c19d9[_0xf132('0xaa')]===-0x1){return _0x4c19d9;}var _0x36ebb4=this['getAndSetVariable']('RECOG_INSTANCE()',_0xf132('0xb5'));if(_0x36ebb4[_0xf132('0xaa')]===-0x1){return _0x36ebb4;}return this['channel']['noop'](util[_0xf132('0x9d')](_0xf132('0xb6'),_0x49ddf9));};AGIVertices['prototype'][_0xf132('0x8')]=function(_0x3235f9){logger['info'](util[_0xf132('0x9d')](_0xf132('0xb7'),_0x3235f9['label']));return this[_0xf132('0xf')][_0xf132('0x8')]([_0x3235f9[_0xf132('0xb8')],_0x3235f9[_0xf132('0xb9')]]);};AGIVertices['prototype'][_0xf132('0xba')]=function(_0x41284b){logger['info'](util[_0xf132('0x9d')](_0xf132('0xbb'),_0x41284b[_0xf132('0x37')]));if(this[_0xf132('0x83')](_0x41284b[_0xf132('0x63')])){logger['info'](util['format'](_0xf132('0xbc'),_0x41284b[_0xf132('0x63')]));var _0x8478bd=this['channel'][_0xf132('0xbd')](_0x41284b['timeout']);if(_0x8478bd[_0xf132('0xaa')]===-0x1){return _0x8478bd;}}return this['channel'][_0xf132('0xba')]();};AGIVertices[_0xf132('0x16')][_0xf132('0x47')]=function(_0x100860){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0xbe'),_0x100860[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x100860[_0xf132('0xbf')])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x100860,_0xf132('0xc0'));}_0x100860[_0xf132('0xc1')]=moment();if(this[_0xf132('0x83')](_0x100860['delay'])){_0x100860[_0xf132('0xc1')]=moment()[_0xf132('0xc2')](_0x100860[_0xf132('0xc3')],_0xf132('0xc4'));}if(!this[_0xf132('0x83')](_0x100860[_0xf132('0x4a')])){_0x100860[_0xf132('0x4a')]=0x2;}this[_0xf132('0x40')][_0xf132('0x6e')](this,_0x100860);return this[_0xf132('0xf')][_0xf132('0xa8')](util['format'](_0xf132('0xc5'),_0x100860[_0xf132('0x46')],_0x100860[_0xf132('0xbf')],_0x100860[_0xf132('0xc1')]));};AGIVertices['prototype']['custom_app']=function(_0x1e8efc){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0xc6'),_0x1e8efc[_0xf132('0x37')]));var _0x27c3a0=this['channel'][_0xf132('0x54')](_0x1e8efc['application'],_0x1e8efc[_0xf132('0x76')]);if(_0x27c3a0['result']===-0x1){return _0x27c3a0;}return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0xc7'),_0x1e8efc['application'],_0x1e8efc[_0xf132('0x76')]));};AGIVertices['prototype'][_0xf132('0xc8')]=function(_0x5d377c){logger[_0xf132('0x30')](util['format'](_0xf132('0xc9'),_0x5d377c[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x5d377c[_0xf132('0x5a')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xca'));}var _0x3ee6d0='\x22'+_0x5d377c['text']+'\x22';if(this[_0xf132('0x83')](_0x5d377c[_0xf132('0x76')])){_0x3ee6d0+=','+_0x5d377c[_0xf132('0x76')];}var _0x2e0006=this[_0xf132('0xf')][_0xf132('0x54')]('MRCPSynth',_0x3ee6d0);if(_0x2e0006[_0xf132('0xaa')]===-0x1){return _0x2e0006;}return this['channel']['noop'](util[_0xf132('0x9d')](_0xf132('0xab'),_0x3ee6d0));};AGIVertices[_0xf132('0x16')]['sestektts']=function(_0x1aa9e7){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0xcb'),_0x1aa9e7[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x1aa9e7[_0xf132('0x5a')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xca'));}var _0x18d699='\x22'+_0x1aa9e7[_0xf132('0x5a')]+'\x22';if(this['isConfigured'](_0x1aa9e7[_0xf132('0x76')])){_0x18d699+=','+_0x1aa9e7[_0xf132('0x76')];}var _0x5d8a6e=this[_0xf132('0xf')]['exec']('MRCPSynth',_0x18d699);if(_0x5d8a6e[_0xf132('0xaa')]===-0x1){return _0x5d8a6e;}return this[_0xf132('0xf')]['noop'](util['format'](_0xf132('0xab'),_0x18d699));};AGIVertices['prototype'][_0xf132('0xcc')]=function(_0x1998b6){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0xcd'),_0x1998b6['label']));if(!this['isConfigured'](_0x1998b6['grammar'])){return this['channel'][_0xf132('0xa8')]('no\x20grammar\x20configured');}var _0x2aaaab=_0x1998b6[_0xf132('0xae')];if(this[_0xf132('0x83')](_0x1998b6['options'])){_0x2aaaab+=','+_0x1998b6[_0xf132('0x76')];}var _0x352d74=this['channel'][_0xf132('0x54')]('MRCPRecog',_0x2aaaab);if(_0x352d74['result']===-0x1){return _0x352d74;}var _0x1560b7=this[_0xf132('0xa3')](_0xf132('0xb1'),_0xf132('0xce'));if(_0x1560b7[_0xf132('0xaa')]===-0x1){return _0x1560b7;}var _0x5a297e=this[_0xf132('0xa3')](_0xf132('0xb3'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x5a297e[_0xf132('0xaa')]===-0x1){return _0x5a297e;}var _0x1cf750=this[_0xf132('0xa3')]('RECOG_INSTANCE()',_0xf132('0xcf'));if(_0x1cf750[_0xf132('0xaa')]===-0x1){return _0x1cf750;}return this['channel']['noop'](util[_0xf132('0x9d')](_0xf132('0xb6'),_0x2aaaab));};AGIVertices[_0xf132('0x16')][_0xf132('0xd0')]=function(_0x5c6938){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0xd1'),_0x5c6938['label']));if(!this[_0xf132('0x83')](_0x5c6938['grammar'])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xaf'));}var _0x42f977=_0x5c6938[_0xf132('0xae')];if(this[_0xf132('0x83')](_0x5c6938[_0xf132('0x76')])){_0x42f977+=','+_0x5c6938[_0xf132('0x76')];}var _0x226d71=this['channel'][_0xf132('0x54')](_0xf132('0xb0'),_0x42f977);if(_0x226d71[_0xf132('0xaa')]===-0x1){return _0x226d71;}var _0x394b94=this[_0xf132('0xa3')](_0xf132('0xb1'),_0xf132('0xd2'));if(_0x394b94[_0xf132('0xaa')]===-0x1){return _0x394b94;}var _0x538eba=this[_0xf132('0xa3')](_0xf132('0xb3'),_0xf132('0xd3'));if(_0x538eba[_0xf132('0xaa')]===-0x1){return _0x538eba;}var _0x32107d=this[_0xf132('0xa3')]('RECOG_INSTANCE()',_0xf132('0xd4'));if(_0x32107d[_0xf132('0xaa')]===-0x1){return _0x32107d;}return this['channel'][_0xf132('0xa8')](util[_0xf132('0x9d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x42f977));};AGIVertices[_0xf132('0x16')][_0xf132('0xd5')]=function(_0x15f1c5){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0xd6'),_0x15f1c5[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x15f1c5[_0xf132('0xd7')])){return this[_0xf132('0xf')]['error'](_0x15f1c5,_0xf132('0xd8'));}var _0x15fddc=this[_0xf132('0x1b')][_0xf132('0x6e')](this,_0x15f1c5[_0xf132('0xd7')]);if(!_0x15fddc){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x15f1c5,'no\x20odbc\x20database\x20found');}if(!this[_0xf132('0x83')](_0x15f1c5[_0xf132('0x2f')])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x15f1c5,'no\x20query\x20configured');}var _0x292fd2=_0x15f1c5[_0xf132('0x2f')][_0xf132('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf132('0xf')]['noop'](util[_0xf132('0x9d')](_0xf132('0xd9'),_0x292fd2));var _0x3268ca=this[_0xf132('0xda')]['sync'](this,_0x15fddc,_0x292fd2);this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x15f1c5,_0x292fd2);if(!this[_0xf132('0x83')](_0x15f1c5[_0xf132('0xdb')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x26fb9d=this[_0xf132('0xdc')][_0xf132('0x6e')](this,_0x15f1c5[_0xf132('0xdb')]);if(!_0x26fb9d){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x15f1c5,'no\x20variable\x20found');}var _0x3adb07=this;_0x3268ca['forEach'](function(_0x1117b8,_0x65865f){Object[_0xf132('0xdd')](_0x1117b8)[_0xf132('0xde')](function(_0x6b238e){_0x3adb07[_0xf132('0xf')][_0xf132('0xa5')](util[_0xf132('0x9d')](_0xf132('0xdf'),_0x26fb9d,_0x65865f,_0x6b238e),_0x1117b8[_0x6b238e]);});});this['channel'][_0xf132('0xa5')](util[_0xf132('0x9d')]('%s_ROWS_COUNT',_0x26fb9d),_0x3268ca['length']);return this[_0xf132('0xf')]['noop'](util[_0xf132('0x9d')](_0xf132('0xe0'),_0x26fb9d));};AGIVertices[_0xf132('0x16')][_0xf132('0xe1')]=function(_0x1544e7){logger['debug'](util[_0xf132('0x9d')](_0xf132('0xe2'),_0x1544e7[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x1544e7[_0xf132('0xe3')])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x1544e7,_0xf132('0xe4'));}var _0x2256b1=this[_0xf132('0xe5')][_0xf132('0x6e')](this,_0x1544e7[_0xf132('0xe3')]);if(!_0x2256b1){return this['channel'][_0xf132('0x2e')](_0x1544e7,_0xf132('0xe6'));}var _0x6fbc3=this[_0xf132('0xf')]['exec']('DIAL',[util[_0xf132('0x9d')](_0xf132('0xe7'),_0x2256b1),_0x1544e7[_0xf132('0x63')],_0x1544e7[_0xf132('0xe8')],_0x1544e7[_0xf132('0x60')]]);if(_0x6fbc3[_0xf132('0xaa')]===-0x1){return _0x6fbc3;}return this[_0xf132('0xf')]['noop'](util[_0xf132('0x9d')](_0xf132('0xe9'),_0xf132('0xea')));};AGIVertices[_0xf132('0x16')][_0xf132('0xeb')]=function(_0x190d8c){logger[_0xf132('0x30')](util['format'](_0xf132('0xec'),_0x190d8c[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x190d8c[_0xf132('0x78')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xed'));}if(!this[_0xf132('0x83')](_0x190d8c['text'])){return this[_0xf132('0xf')][_0xf132('0xa8')]('no\x20text\x20configured');}this['channel'][_0xf132('0xee')]=!![];this[_0xf132('0x35')](_0x190d8c);this[_0xf132('0x3f')](_0x190d8c[_0xf132('0x5a')],'in','','');this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0xef'),_0x190d8c[_0xf132('0x5a')]));var _0xfa482b=this[_0xf132('0x77')][_0xf132('0x6e')](this,_0x190d8c);if(_0xfa482b){for(var _0x58154f in _0xfa482b){if(_0xfa482b[_0xf132('0x96')](_0x58154f)){this['channel'][_0xf132('0xa5')](util[_0xf132('0x9d')](_0xf132('0xf0'),_0x58154f[_0xf132('0x67')]()),_0xfa482b[_0x58154f]);}}this['createSquareMessage'](_0xfa482b[_0xf132('0xf1')],_0xf132('0xf2'),'dialogflow','');return this['channel'][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0xf3'),_0xfa482b[_0xf132('0xf1')]));}return this[_0xf132('0xf')][_0xf132('0x2e')](_0x190d8c,_0xf132('0xf4'));};AGIVertices[_0xf132('0x16')][_0xf132('0xf5')]=function(_0x530d92){logger[_0xf132('0x30')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x530d92[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x530d92['dialogflowV2_project_id'])){return this[_0xf132('0xf')]['noop'](_0xf132('0xf6'));}if(!this[_0xf132('0x83')](_0x530d92['client_email'])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xf7'));}if(!this['isConfigured'](_0x530d92[_0xf132('0xf8')])){return this[_0xf132('0xf')][_0xf132('0xa8')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x530d92[_0xf132('0xf9')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xfa'));}if(!this['isConfigured'](_0x530d92['text'])){return this['channel'][_0xf132('0xa8')](_0xf132('0xca'));}this[_0xf132('0xf')][_0xf132('0xee')]=!![];this['createSquareDetailsReport'](_0x530d92);this[_0xf132('0x3f')](_0x530d92[_0xf132('0x5a')],'in','','');this[_0xf132('0xf')][_0xf132('0xa8')](util['format'](_0xf132('0xfb'),_0x530d92[_0xf132('0x5a')]));var _0x49efee=this[_0xf132('0x7a')][_0xf132('0x6e')](this,_0x530d92);if(_0x49efee){for(var _0x39c053 in _0x49efee){if(_0x49efee['hasOwnProperty'](_0x39c053)){if(_0x39c053!==_0xf132('0xfc')){this['channel'][_0xf132('0xa5')](util[_0xf132('0x9d')](_0xf132('0xf0'),_0x39c053[_0xf132('0x67')]()),_0x49efee[_0x39c053]);}}}this[_0xf132('0x3f')](_0x49efee[_0xf132('0xf1')],'out',_0xf132('0xf5'),_0x49efee[_0xf132('0xfc')]);return this['channel'][_0xf132('0xa8')](util['format']('DialogflowV2\x20Result\x20%s',_0x49efee[_0xf132('0xf1')]));}return this[_0xf132('0xf')][_0xf132('0x2e')](_0x530d92,_0xf132('0xfd'));};AGIVertices[_0xf132('0x16')][_0xf132('0xfe')]=function(_0xad8f47){logger['info'](util[_0xf132('0x9d')](_0xf132('0xff'),_0xad8f47[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0xad8f47[_0xf132('0x100')])){return this[_0xf132('0xf')]['noop'](_0xf132('0x101'));}if(!this[_0xf132('0x83')](_0xad8f47['username'])){return this[_0xf132('0xf')][_0xf132('0xa8')]('no\x20username\x20configured');}if(!this[_0xf132('0x83')](_0xad8f47[_0xf132('0x102')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0x103'));}if(!this['isConfigured'](_0xad8f47['ndassistant_url'])){return this[_0xf132('0xf')]['noop']('no\x20text\x20configured');}this[_0xf132('0xf')][_0xf132('0xee')]=!![];this[_0xf132('0x35')](_0xad8f47);this[_0xf132('0x3f')](_0xad8f47[_0xf132('0x5a')],'in','','');this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x104'),_0xad8f47[_0xf132('0x5a')]));var _0x5f31af=this['sestekNDA'][_0xf132('0x6e')](this,_0xad8f47);if(_0x5f31af){for(var _0x324a60 in _0x5f31af){if(_0x5f31af['hasOwnProperty'](_0x324a60)){this[_0xf132('0xf')]['setVariable'](util[_0xf132('0x9d')](_0xf132('0x105'),_0x324a60[_0xf132('0x67')]()),_0x5f31af[_0x324a60]);}}this[_0xf132('0x3f')](_0x5f31af[_0xf132('0xf1')],'out',_0xf132('0xfe'),'');if(_0x5f31af[_0xf132('0x106')]){this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x107'),_0x5f31af[_0xf132('0x106')]));var _0x1052db=this['channel']['streamFile'](_0x5f31af[_0xf132('0x106')]);try{fs[_0xf132('0x108')](_0x5f31af['audiofile']+_0xf132('0x109'));}catch(_0x298490){logger[_0xf132('0x2e')](_0x298490);}return _0x1052db;}else{return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x10a'),_0x5f31af[_0xf132('0xf1')]));}}return this[_0xf132('0xf')][_0xf132('0x2e')](_0xad8f47,_0xf132('0x10b'));};AGIVertices[_0xf132('0x16')][_0xf132('0x10c')]=function(_0x1602c1){logger[_0xf132('0x30')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x1602c1[_0xf132('0x37')]));return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0x10c'));};AGIVertices[_0xf132('0x16')][_0xf132('0x10d')]=function(_0x4968de){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x10e'),_0x4968de[_0xf132('0x37')]));var _0x2ff263='';if(_0x4968de['trunk_id']){if(!this['isConfigured'](_0x4968de[_0xf132('0x10f')])){return this[_0xf132('0xf')]['error'](_0x4968de,_0xf132('0x110'));}else{var _0x419365=parseInt(_0x4968de[_0xf132('0x10f')],0xa);if(isNaN(_0x419365)){_0x2ff263=_0x4968de[_0xf132('0x10f')];}else{_0x2ff263=this[_0xf132('0x1f')][_0xf132('0x6e')](this,_0x4968de['trunk_id']);if(!_0x2ff263){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x4968de,_0xf132('0x111'));}}}}else if(_0x4968de[_0xf132('0x112')]){_0x2ff263=_0x4968de[_0xf132('0x112')];}else{return this['channel'][_0xf132('0x2e')](_0x4968de,_0xf132('0x110'));}var _0x279f84=this[_0xf132('0xf')]['exec'](_0xf132('0xea'),[util[_0xf132('0x9d')](_0xf132('0x113'),_0x2ff263,_0x4968de[_0xf132('0x46')]),_0x4968de['timeout'],_0x4968de[_0xf132('0xe8')],_0x4968de[_0xf132('0x60')]]);if(_0x279f84[_0xf132('0xaa')]===-0x1){return _0x279f84;}return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0xe9'),_0xf132('0xea')));};AGIVertices[_0xf132('0x16')][_0xf132('0x114')]=function(_0x90eaf4){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x115'),_0x90eaf4[_0xf132('0x37')]));return this['channel']['noop']('finally');};AGIVertices[_0xf132('0x16')][_0xf132('0x116')]=function(_0x25138e){logger['info'](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x25138e[_0xf132('0x37')]));if(_0x25138e[_0xf132('0xa7')]===0x0){return this[_0xf132('0xa6')](_0x25138e);}_0x25138e[_0xf132('0xa7')]-=0x1;if(!this[_0xf132('0x83')](_0x25138e[_0xf132('0x117')])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x25138e,'no\x20file\x20audio\x20selected');}var _0xaf546=this[_0xf132('0x21')][_0xf132('0x6e')](this,_0x25138e['file_id']);if(!_0xaf546){return this['channel']['error'](_0x25138e,_0xf132('0x118'));}if(!this[_0xf132('0x83')](_0x25138e['variable_id'])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0xf132('0x119'));}var _0x100fd3=this[_0xf132('0xf')][_0xf132('0x11a')](_0xaf546,_0x25138e[_0xf132('0x11b')],_0x25138e[_0xf132('0x11c')]);var _0x4291fe=_0x100fd3[_0xf132('0xaa')]?_0x100fd3[_0xf132('0xaa')][_0xf132('0x49')]():'';logger[_0xf132('0x30')](_0xf132('0x11d'),JSON[_0xf132('0x70')](_0x100fd3));if(_0x100fd3['result']===-0x1){this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x25138e,_0x4291fe);return _0x100fd3;}else if(_0x100fd3['extra']===_0xf132('0x63')){_0x100fd3[_0xf132('0xaa')]=_0x4291fe['length']>=parseInt(_0x25138e[_0xf132('0x11e')])?'x':'i';}else{_0x100fd3['result']=_0x4291fe['length']>=parseInt(_0x25138e[_0xf132('0x11e')])&&_0x4291fe[_0xf132('0x9f')]<=parseInt(_0x25138e[_0xf132('0x11c')])?'x':'i';}var _0x4bce1c=this['getVariable']['sync'](this,_0x25138e[_0xf132('0xdb')]);if(!_0x4bce1c){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x25138e,_0xf132('0x11f'));}this['channel'][_0xf132('0xa5')](_0x4bce1c,_0x4291fe);if(this['isConfigured'](_0x25138e[_0xf132('0x120')])){var _0x25329e=parseInt(_0x25138e[_0xf132('0x120')],0xa);var _0x5aab13=rs[_0xf132('0x121')]({'charset':'*','length':_0x25329e});var _0x4cdda5=_0x4291fe[_0xf132('0x9f')];if(_0x4cdda5>0x0){if(_0x4cdda5>_0x25329e){this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x25138e,_0x25138e['hiddendigitspos']===_0xf132('0x122')?_0x5aab13+_0x4291fe[_0xf132('0x123')](_0x25329e):_0x4291fe[_0xf132('0x123')](0x0,_0x4cdda5-_0x25329e)+_0x5aab13);}else{this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x25138e,rs[_0xf132('0x121')]({'charset':'*','length':_0x4cdda5}));}}else{this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x25138e,'');}}else{this['createSquareDetailsReport'][_0xf132('0x6e')](this,_0x25138e,_0x4291fe);}return _0x100fd3;};AGIVertices['prototype'][_0xf132('0xe')]=function(_0x96c08d){logger['info'](util[_0xf132('0x9d')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x96c08d[_0xf132('0x37')]));return this[_0xf132('0x116')](_0x96c08d);};AGIVertices['prototype'][_0xf132('0x124')]=function(_0x596203){logger['info'](util['format'](_0xf132('0x125'),_0x596203['label']));this['createSquareDetailsReport'][_0xf132('0x6e')](this,_0x596203,_0x596203[_0xf132('0x126')]);return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')]('GOAL\x20%s',_0x596203['goalname']));};AGIVertices[_0xf132('0x16')]['awspolly']=function(_0x5ffeff){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x127'),_0x5ffeff[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x5ffeff[_0xf132('0x86')])||!this[_0xf132('0x83')](_0x5ffeff[_0xf132('0x87')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0x128'));}if(!this['isConfigured'](_0x5ffeff['text'])){return this['channel']['noop'](_0xf132('0xca'));}this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x129'),_0x5ffeff['text']));var _0x4cf4fe=this[_0xf132('0x85')][_0xf132('0x6e')](this,_0x5ffeff);if(_0x4cf4fe){this[_0xf132('0xf')][_0xf132('0xa8')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x4cf4fe));var _0x56c6b8=this['channel'][_0xf132('0x12a')](_0x4cf4fe);try{fs[_0xf132('0x108')](_0x4cf4fe+_0xf132('0x109'));}catch(_0x33d4f7){logger[_0xf132('0x2e')](_0x33d4f7);}return _0x56c6b8;}return this['channel']['error'](_0x5ffeff,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xf132('0x16')][_0xf132('0x12b')]=function(_0x40ef97){logger['info'](util['format'](_0xf132('0x12c'),_0x40ef97[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x40ef97[_0xf132('0x86')])||!this[_0xf132('0x83')](_0x40ef97[_0xf132('0x87')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0x128'));}if(!this['isConfigured'](_0x40ef97[_0xf132('0x8e')])){return this[_0xf132('0xf')]['noop'](_0xf132('0x12d'));}if(!this['isConfigured'](_0x40ef97[_0xf132('0x5a')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xca'));}this['channel']['bot']=!![];this[_0xf132('0x35')](_0x40ef97);this['createSquareMessage'](_0x40ef97[_0xf132('0x5a')],'in','','');this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x12e'),_0x40ef97['text']));var _0x693f02=this['awsLex'][_0xf132('0x6e')](this,_0x40ef97);if(_0x693f02){for(var _0x2b6204 in _0x693f02){if(_0x693f02[_0xf132('0x96')](_0x2b6204)&&_[_0xf132('0x9c')](_0x693f02[_0x2b6204])){this[_0xf132('0xf')]['setVariable'](util[_0xf132('0x9d')](_0xf132('0x12f'),_0x2b6204['toUpperCase']()),_0x693f02[_0x2b6204]);}}if(_[_0xf132('0x42')](_0x693f02['message'])){return this[_0xf132('0xf')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xf132('0x3f')](_0x693f02[_0xf132('0x74')],'out',_0xf132('0x130'),'');return this['channel'][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x131'),_0x693f02[_0xf132('0x74')]));}}return this['channel'][_0xf132('0x2e')](_0x40ef97,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xf132('0x132')]=function(_0x1363d6){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x133'),_0x1363d6[_0xf132('0x37')],_0x1363d6[_0xf132('0x63')]));if(!this[_0xf132('0x83')](_0x1363d6[_0xf132('0x78')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xed'));}var _0xda7b10=_0xf132('0x134');var _0x29e11e=util[_0xf132('0x9d')](_0xf132('0x135'),FILES_PATH,rs['generate'](0x4));var _0x33c8a3=util[_0xf132('0x9d')](_0xf132('0x9e'),_0x29e11e,_0xda7b10);var _0x3f8b66=!![];if(_0x1363d6[_0xf132('0x136')]==='NOBEEP'){_0x3f8b66=![];}var _0x46c29f=this[_0xf132('0xf')][_0xf132('0x137')](_0x29e11e,_0xda7b10,_0x1363d6[_0xf132('0x138')],_0x1363d6[_0xf132('0x63')],undefined,_0x3f8b66);if(_0x46c29f[_0xf132('0xaa')]!==-0x1){this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')]('google\x20%s\x20file\x20created',_0x33c8a3));var _0x2c5db3=this['googleASR']['sync'](this,_0x1363d6,_0x33c8a3);if(_0x2c5db3){for(var _0x45faa3 in _0x2c5db3){if(_0x2c5db3['hasOwnProperty'](_0x45faa3)){this[_0xf132('0xf')]['setVariable'](util['format']('GOOGLE_ASR_%s',_0x45faa3['toUpperCase']()),_0x2c5db3[_0x45faa3]);}}return this['channel'][_0xf132('0xa8')](util[_0xf132('0x9d')]('GoogleASR\x20Result\x20%s',JSON[_0xf132('0x70')](_0x2c5db3)));}}return _0x46c29f;};AGIVertices[_0xf132('0x16')][_0xf132('0x139')]=function(_0x204b01){logger['info'](util[_0xf132('0x9d')](_0xf132('0x13a'),_0x204b01[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x204b01[_0xf132('0x13b')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0x13c'));}if(!this[_0xf132('0x83')](_0x204b01['appsecret'])){return this[_0xf132('0xf')]['noop'](_0xf132('0x13d'));}var _0x29e4c7='wav';var _0x24f3fb=util[_0xf132('0x9d')](_0xf132('0x135'),FILES_PATH,rs['generate'](0x4));var _0x47dda9=util[_0xf132('0x9d')](_0xf132('0x9e'),_0x24f3fb,_0x29e4c7);var _0x1af2c1=!![];if(_0x204b01[_0xf132('0x136')]===_0xf132('0x13e')){_0x1af2c1=![];}var _0x43907e=this[_0xf132('0xf')][_0xf132('0x137')](_0x24f3fb,_0x29e4c7,_0x204b01[_0xf132('0x138')],_0x204b01[_0xf132('0x63')],undefined,_0x1af2c1);if(_0x43907e[_0xf132('0xaa')]!==-0x1){this[_0xf132('0xf')]['noop'](util[_0xf132('0x9d')]('tilde\x20%s\x20file\x20created',_0x47dda9));var _0x310715=this[_0xf132('0x91')]['sync'](this,_0x204b01,_0x47dda9);if(_0x310715){for(var _0x341fe4 in _0x310715){if(_0x310715[_0xf132('0x96')](_0x341fe4)){this[_0xf132('0xf')][_0xf132('0xa5')](util[_0xf132('0x9d')]('TILDE_ASR_%s',_0x341fe4[_0xf132('0x67')]()),_0x310715[_0x341fe4]);}}return this['channel'][_0xf132('0xa8')](util['format'](_0xf132('0x13f'),JSON[_0xf132('0x70')](_0x310715)));}}return _0x43907e;};AGIVertices[_0xf132('0x16')]['gotoc']=function(_0x5e2845){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5e2845['label']));return this[_0xf132('0xf')][_0xf132('0x140')](_0x5e2845[_0xf132('0x3b')],_0x5e2845['extension'],_0x5e2845[_0xf132('0x3c')]);};AGIVertices[_0xf132('0x16')][_0xf132('0x141')]=function(_0x4d05e3){logger[_0xf132('0x30')](util['format'](_0xf132('0x142'),_0x4d05e3[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x4d05e3[_0xf132('0x143')])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x4d05e3,'no\x20condition\x20configured');}try{var _0x3ade02=eval(_0x4d05e3[_0xf132('0x143')])?_0xf132('0x144'):'false';this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x145'),_0x4d05e3[_0xf132('0x143')],_0x3ade02));return{'code':0xc8,'result':_0x3ade02};}catch(_0x3c4865){return{'code':0xc8,'result':_0xf132('0x146')};}};AGIVertices['prototype'][_0xf132('0x147')]=function(_0x5403a8){logger[_0xf132('0x30')](util['format'](_0xf132('0x148'),_0x5403a8[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x5403a8[_0xf132('0x149')])){return this[_0xf132('0xf')]['error'](_0x5403a8,_0xf132('0x14a'));}var _0x2f1cdd=this[_0xf132('0x27')][_0xf132('0x6e')](this,_0x5403a8['interval_id']);if(!_0x2f1cdd){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x5403a8,'no\x20intervals\x20found');}for(var _0xe77a3d=0x0;_0xe77a3d<_0x2f1cdd[_0xf132('0x9f')];_0xe77a3d+=0x1){var _0x18a588=this['channel']['getVariable'](util[_0xf132('0x9d')](_0xf132('0x14b'),_0x2f1cdd[_0xe77a3d]));if(_0x18a588[_0xf132('0xaa')]===-0x1){return _0x18a588;}logger[_0xf132('0x30')](util['format']('IFTIME\x20%s\x20%s',_0x2f1cdd[_0xe77a3d],_0x18a588[_0xf132('0xa2')]));if(_0x18a588[_0xf132('0xa2')]===_0xf132('0x144')){logger['info'](util['format'](_0xf132('0x14c'),_0x2f1cdd[_0xe77a3d],'true'));this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')]('IFTIME\x20%s\x20%s',_0x2f1cdd[_0xe77a3d],_0xf132('0x144')));return{'code':0xc8,'result':_0xf132('0x144')};}else{logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x14c'),_0x2f1cdd[_0xe77a3d],_0xf132('0x146')));this[_0xf132('0xf')]['noop'](util[_0xf132('0x9d')](_0xf132('0x14c'),_0x2f1cdd[_0xe77a3d],_0xf132('0x146')));}}return{'code':0xc8,'result':_0xf132('0x146')};};AGIVertices[_0xf132('0x16')][_0xf132('0x14d')]=function(_0x1e93a0){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x14e'),_0x1e93a0[_0xf132('0x37')]));return this[_0xf132('0xf')]['hangup']();};AGIVertices[_0xf132('0x16')][_0xf132('0x14f')]=function(_0x5af090){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5af090[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x5af090[_0xf132('0x78')])){return this['channel'][_0xf132('0xa8')](_0xf132('0xed'));}var _0x515aec=_0xf132('0x134');var _0x3d7165=util[_0xf132('0x9d')](_0xf132('0x135'),FILES_PATH,rs[_0xf132('0x121')](0x4));var _0x1a5d80=util[_0xf132('0x9d')](_0xf132('0x9e'),_0x3d7165,_0x515aec);var _0x52e54a=!![];if(_0x5af090[_0xf132('0x136')]===_0xf132('0x13e')){_0x52e54a=![];}var _0x26cf55=this[_0xf132('0xf')][_0xf132('0x137')](_0x3d7165,_0x515aec,_0x5af090[_0xf132('0x138')],_0x5af090['timeout'],undefined,_0x52e54a);if(_0x26cf55['result']!==-0x1){this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x150'),_0x1a5d80));var _0x54b52f=this[_0xf132('0x82')][_0xf132('0x6e')](this,_0x5af090,_0x1a5d80);if(_0x54b52f){for(var _0x1b13df in _0x54b52f){if(_0x54b52f[_0xf132('0x96')](_0x1b13df)){this[_0xf132('0xf')][_0xf132('0xa5')](util[_0xf132('0x9d')](_0xf132('0x151'),_0x1b13df['toUpperCase']()),_0x54b52f[_0x1b13df]);}}return this[_0xf132('0xf')]['noop'](util[_0xf132('0x9d')](_0xf132('0x152'),JSON[_0xf132('0x70')](_0x54b52f)));}}return _0x26cf55;};AGIVertices['prototype'][_0xf132('0x153')]=function(_0x4ef740){logger['info'](util['format'](_0xf132('0x154'),_0x4ef740[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x4ef740[_0xf132('0x78')])){return this[_0xf132('0xf')][_0xf132('0xa8')]('no\x20key\x20configured');}if(!this[_0xf132('0x83')](_0x4ef740['text'])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xca'));}this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')]('Trying\x20ispeech\x20TTS\x20%s',_0x4ef740['text']));var _0x1c3982=this[_0xf132('0x7e')]['sync'](this,_0x4ef740);if(_0x1c3982){this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x150'),_0x1c3982));var _0x4af2a1=this[_0xf132('0xf')][_0xf132('0x12a')](_0x1c3982,_0x4ef740[_0xf132('0x138')]);try{fs[_0xf132('0x108')](_0x1c3982+'.wav');}catch(_0x2838f8){logger[_0xf132('0x2e')](_0x2838f8);}return _0x4af2a1;}return this[_0xf132('0xf')][_0xf132('0x2e')](_0x4ef740,_0xf132('0x155'));};AGIVertices['prototype'][_0xf132('0x156')]=function(_0x557441){logger[_0xf132('0x30')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x557441[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x557441[_0xf132('0x157')])){return this[_0xf132('0xf')]['error'](_0x557441,'no\x20find\x20by\x20configured');}logger[_0xf132('0x30')](util['format'](_0xf132('0x158'),this[_0xf132('0xf')][_0xf132('0x39')],_0x557441['findBy']));var _0x24c20f=this['agentLogin']['sync'](this,_0x557441['findBy']);if(_0x24c20f){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf132('0xf')]['callerid'],_0x557441[_0xf132('0x157')]));this['channel'][_0xf132('0xa8')](util[_0xf132('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf132('0xf')][_0xf132('0x39')],_0x557441['findBy']));return{'code':0xc8,'result':_0xf132('0x159')};}else{logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x15a'),this['channel'][_0xf132('0x39')],_0x557441[_0xf132('0x157')]));this['channel'][_0xf132('0xa8')](util['format'](_0xf132('0x15a'),this[_0xf132('0xf')]['callerid'],_0x557441[_0xf132('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf132('0x16')][_0xf132('0x15b')]=function(_0x38b049){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x15c'),_0x38b049[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x38b049['findBy'])){return this['channel'][_0xf132('0x2e')](_0x38b049,_0xf132('0x15d'));}logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x158'),this['channel'][_0xf132('0x39')],_0x38b049[_0xf132('0x157')]));var _0x1fd124=this['agentLogout'][_0xf132('0x6e')](this,_0x38b049[_0xf132('0x157')]);if(_0x1fd124){logger[_0xf132('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xf132('0xf')][_0xf132('0x39')],_0x38b049[_0xf132('0x157')]));this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x15e'),this[_0xf132('0xf')][_0xf132('0x39')],_0x38b049['findBy']));return{'code':0xc8,'result':_0xf132('0x159')};}else{logger['info'](util[_0xf132('0x9d')](_0xf132('0x15a'),this[_0xf132('0xf')][_0xf132('0x39')],_0x38b049[_0xf132('0x157')]));this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x15a'),this[_0xf132('0xf')]['callerid'],_0x38b049[_0xf132('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf132('0x16')]['math']=function(_0xfd34fd){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x15f'),_0xfd34fd[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0xfd34fd[_0xf132('0x160')])){return this[_0xf132('0xf')]['error'](_0xfd34fd,_0xf132('0x161'));}this[_0xf132('0xf')][_0xf132('0xa8')](util['format']('math\x20%s',_0xfd34fd[_0xf132('0x160')]));var _0x2a3be7=eval(_0xfd34fd[_0xf132('0x160')]);if(!this[_0xf132('0x83')](_0xfd34fd[_0xf132('0xdb')])){return this['channel'][_0xf132('0xa8')](_0xf132('0x119'));}var _0x290e69=this[_0xf132('0xdc')][_0xf132('0x6e')](this,_0xfd34fd[_0xf132('0xdb')]);if(!_0x290e69){return this[_0xf132('0xf')][_0xf132('0x2e')](_0xfd34fd,_0xf132('0x11f'));}if(_[_0xf132('0x9b')](_0x2a3be7)){var _0x647a8c=this;_0x2a3be7['forEach'](function(_0x24d8d6,_0x274e83){_0x647a8c[_0xf132('0xf')][_0xf132('0xa5')](util[_0xf132('0x9d')](_0xf132('0x162'),_0x290e69,_0x274e83),_0x24d8d6);});return this[_0xf132('0xf')][_0xf132('0xa8')](util['format']('variable\x20%s[key]\x20set',_0x290e69));}else{return this[_0xf132('0xf')][_0xf132('0xa5')](_0x290e69,_0x2a3be7);}};AGIVertices[_0xf132('0x16')][_0xf132('0xd')]=function(_0x143d70){logger[_0xf132('0x30')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x143d70[_0xf132('0x37')]));if(_0x143d70[_0xf132('0xa7')]===0x0){return this['maxRetry'](_0x143d70);}_0x143d70[_0xf132('0xa7')]-=0x1;if(!this['isConfigured'](_0x143d70['file_id'])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x143d70,_0xf132('0x163'));}var _0x4e2798=this[_0xf132('0x21')][_0xf132('0x6e')](this,_0x143d70[_0xf132('0x117')]);if(!_0x4e2798){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x143d70,'no\x20file\x20audio\x20found');}var _0x2ca2cf=this[_0xf132('0xf')][_0xf132('0x11a')](_0x4e2798,_0x143d70['response'],_0x143d70[_0xf132('0x164')]);var _0x4dfc31=_0x2ca2cf[_0xf132('0xaa')];if(_0x2ca2cf[_0xf132('0xaa')]===-0x1){this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x143d70,'-1');return _0x2ca2cf;}else if(_0x2ca2cf[_0xf132('0xa2')]==='timeout'){_0x2ca2cf['result']=_0x2ca2cf[_0xf132('0xaa')][_0xf132('0x9f')]>0x0?_0x2ca2cf['result']:'t';}else if(_[_0xf132('0x41')](_0x2ca2cf[_0xf132('0xaa')])){_0x2ca2cf['result']='#';_0x4dfc31='#';}if(!this[_0xf132('0x83')](_0x143d70[_0xf132('0xdb')])){this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0x119'));}else{var _0x2a60bd=this['getVariable'][_0xf132('0x6e')](this,_0x143d70[_0xf132('0xdb')]);if(!_0x2a60bd){return this['channel']['error'](_0x143d70,_0xf132('0x11f'));}this[_0xf132('0xf')][_0xf132('0xa5')](_0x2a60bd,_0x4dfc31);}this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x143d70,_0x4dfc31);return _0x2ca2cf;};AGIVertices['prototype'][_0xf132('0xa8')]=function(_0x2f4ca7){logger['info'](util[_0xf132('0x9d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x2f4ca7[_0xf132('0x37')]));return this[_0xf132('0xf')][_0xf132('0xa8')](_0x2f4ca7[_0xf132('0x165')]||_0x2f4ca7['label']);};AGIVertices[_0xf132('0x16')][_0xf132('0x166')]=function(_0x2b1aeb){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x167'),_0x2b1aeb[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x2b1aeb[_0xf132('0x157')])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x2b1aeb,_0xf132('0x15d'));}logger['info'](util[_0xf132('0x9d')](_0xf132('0x158'),this['channel'][_0xf132('0x39')],_0x2b1aeb[_0xf132('0x157')]));var _0x3092fe=this[_0xf132('0x4b')][_0xf132('0x6e')](this,_0x2b1aeb[_0xf132('0x168')]);var _0x23207e=this[_0xf132('0x4c')][_0xf132('0x6e')](this,_0x2b1aeb[_0xf132('0x157')],_0x3092fe);if(_0x23207e){logger[_0xf132('0x30')](util['format'](_0xf132('0x15e'),this[_0xf132('0xf')]['callerid'],_0x2b1aeb[_0xf132('0x157')]));this['channel'][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x15e'),this[_0xf132('0xf')][_0xf132('0x39')],_0x2b1aeb[_0xf132('0x157')]));return{'code':0xc8,'result':_0xf132('0x159')};}else{logger[_0xf132('0x30')](util[_0xf132('0x9d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf132('0xf')][_0xf132('0x39')],_0x2b1aeb[_0xf132('0x157')]));this['channel'][_0xf132('0xa8')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xf132('0xf')][_0xf132('0x39')],_0x2b1aeb[_0xf132('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf132('0x16')][_0xf132('0x169')]=function(_0x4e1a37){logger[_0xf132('0x30')](util['format'](_0xf132('0x16a'),_0x4e1a37[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x4e1a37['file_id'])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x4e1a37,'no\x20file\x20audio\x20selected');}var _0x1dfc08=this[_0xf132('0x21')][_0xf132('0x6e')](this,_0x4e1a37[_0xf132('0x117')]);if(!_0x1dfc08){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x4e1a37,_0xf132('0x118'));}var _0x5b52c6=this['channel'][_0xf132('0x54')](_0xf132('0x16b'),[_0x1dfc08,_0x4e1a37['opts']]);if(_0x5b52c6[_0xf132('0xaa')]===-0x1){return _0x5b52c6;}return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0xc7'),_0xf132('0x16b'),_0x1dfc08));};AGIVertices[_0xf132('0x16')][_0xf132('0x16c')]=function(_0x18d984){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x18d984['label']));if(!this[_0xf132('0x83')](_0x18d984[_0xf132('0x16d')])){return this['channel'][_0xf132('0x2e')](_0x18d984,_0xf132('0x16e'));}var _0x460d07='';var _0x529dd8=parseInt(_0x18d984[_0xf132('0x16d')],0xa);if(isNaN(_0x529dd8)){_0x460d07=_0x18d984[_0xf132('0x16d')];}else{_0x460d07=this[_0xf132('0x17')][_0xf132('0x6e')](this,_0x18d984[_0xf132('0x16d')]);if(!_0x460d07){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x18d984,_0xf132('0x16f'));}}var _0x3e13ab='';if(this['isConfigured'](_0x18d984[_0xf132('0x117')])){var _0xfc05d7=this[_0xf132('0x21')][_0xf132('0x6e')](this,_0x18d984[_0xf132('0x117')]);if(_0xfc05d7){_0x3e13ab=_0xfc05d7;}}this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x18d984,_0x460d07);if(_0x18d984[_0xf132('0xe8')][_0xf132('0x170')]('x')<0x0){_0x18d984['opts']+='x';}if(_0x18d984[_0xf132('0xe8')]['indexOf']('X')<0x0){_0x18d984[_0xf132('0xe8')]+='X';}this[_0xf132('0xf')][_0xf132('0xa5')]('XMCS-QUEUE',_0x460d07?_0x460d07[_0xf132('0x171')]():'');var _0x1ae716=this[_0xf132('0xf')][_0xf132('0x54')]('QUEUE',[_0x460d07,_0x18d984[_0xf132('0xe8')],_0x18d984[_0xf132('0x60')],_0x3e13ab,_0x18d984['timeout'],_0x18d984[_0xf132('0x8')],_0x18d984[_0xf132('0x172')],_0x18d984[_0xf132('0x173')],'',_0x18d984[_0xf132('0x174')]]);if(_0x1ae716['result']===-0x1){return _0x1ae716;}return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')]('Executed\x20command\x20%s\x20%s',_0xf132('0x175'),_0x460d07));};AGIVertices[_0xf132('0x16')][_0xf132('0x176')]=function(_0x58a6ca){logger[_0xf132('0x30')](util['format'](_0xf132('0x177'),_0x58a6ca[_0xf132('0x37')]));var _0x48b1be=_0x58a6ca[_0xf132('0x178')]||'wav';var _0x55de24=util['format'](_0xf132('0x179'),this['channel'][_0xf132('0x36')],rs['generate'](0x5));var _0x15adbb=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x55de24,_0x48b1be);var _0x42d511=util['format'](_0xf132('0x135'),FILES_PATH,_0x55de24);this[_0xf132('0x17a')][_0xf132('0x6e')](this,_0x58a6ca,_0x55de24,_0x15adbb);this[_0xf132('0xf')][_0xf132('0xa5')]('RECORDING_SAVENAME',_0x55de24);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x42d511,_0x48b1be,_0x58a6ca['escape_digits'],_0x58a6ca[_0xf132('0x63')]);return this[_0xf132('0xf')][_0xf132('0x137')](_0x42d511,_0x48b1be,_0x58a6ca[_0xf132('0x17b')],_0x58a6ca['timeout'],undefined,!![]);};AGIVertices[_0xf132('0x16')]['restapi']=function(_0x39f291){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x39f291[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x39f291[_0xf132('0x60')])){return this[_0xf132('0xf')][_0xf132('0xa8')]('no\x20url\x20configured');}var _0x1efac9=this[_0xf132('0x5f')]['sync'](this,_0x39f291);logger[_0xf132('0x30')](util['format'](_0xf132('0x17c'),util['inspect'](_0x1efac9,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x39f291[_0xf132('0xdb')])){return this[_0xf132('0xf')]['noop'](_0xf132('0x17d'));}var _0x50ccde=this['getVariable'][_0xf132('0x6e')](this,_0x39f291[_0xf132('0xdb')]);if(!_0x50ccde){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x39f291,_0xf132('0x11f'));}this[_0xf132('0xf')][_0xf132('0xa5')](util[_0xf132('0x9d')](_0xf132('0x17e'),_0x50ccde),_0x1efac9[_0xf132('0x72')]?_0x1efac9[_0xf132('0x72')]:_0xf132('0x17f'));this[_0xf132('0xf')]['setVariable'](util[_0xf132('0x9d')](_0xf132('0x180'),_0x50ccde),_0x1efac9[_0xf132('0x73')]?_0x1efac9[_0xf132('0x73')]:'OK');if(_0x1efac9[_0xf132('0x68')]){try{this['saveRestApiResult'](_0x1efac9[_0xf132('0x68')],_0x50ccde);}catch(_0x27a28a){logger[_0xf132('0x2e')](util['format'](_0xf132('0x181'),_0x50ccde));}}return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0xe0'),_0x50ccde));};AGIVertices[_0xf132('0x16')][_0xf132('0x182')]=function(_0x2715ac){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x183'),_0x2715ac[_0xf132('0x37')]));return this[_0xf132('0xf')]['sayDigits'](_0x2715ac[_0xf132('0x184')][_0xf132('0x56')](/\s+/g,''),_0x2715ac[_0xf132('0x17b')]);};AGIVertices['prototype'][_0xf132('0x185')]=function(_0x136cbe){logger['info'](util[_0xf132('0x9d')](_0xf132('0x186'),_0x136cbe[_0xf132('0x37')]));return this[_0xf132('0xf')][_0xf132('0x187')](_0x136cbe['number'][_0xf132('0x56')](/\s+/g,''),_0x136cbe['escape_digits']);};AGIVertices['prototype'][_0xf132('0x188')]=function(_0x6d92af){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x189'),_0x6d92af[_0xf132('0x37')]));return this[_0xf132('0xf')][_0xf132('0x18a')](_0x6d92af[_0xf132('0x5a')],_0x6d92af[_0xf132('0x17b')]);};AGIVertices[_0xf132('0x16')][_0xf132('0x18b')]=function(_0x22d78d){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x18c'),_0x22d78d[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x22d78d[_0xf132('0x18d')])){return this[_0xf132('0xf')]['noop'](_0xf132('0x18e'));}var _0x3d99b1=this[_0xf132('0x25')][_0xf132('0x6e')](this,_0x22d78d[_0xf132('0x18d')]);if(!_0x3d99b1||!_0x3d99b1[_0xf132('0x18f')]){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x22d78d,_0xf132('0x190'));}var _0x2c745e={'from':util[_0xf132('0x9d')](_0xf132('0x191'),_0x3d99b1[_0xf132('0x14')],_0x3d99b1[_0xf132('0x192')]||_0x3d99b1[_0xf132('0x18f')]['user']),'to':_0x22d78d['to']||'','cc':_0x22d78d['cc']||'','bcc':_0x22d78d[_0xf132('0x193')]||'','subject':_0x22d78d['subject'],'html':_0x22d78d[_0xf132('0x5a')],'text':_0x22d78d[_0xf132('0x5a')]};if(this[_0xf132('0x83')](_0x22d78d[_0xf132('0x194')])){}logger[_0xf132('0x195')](_0xf132('0x196'),JSON[_0xf132('0x70')](_0x2c745e));this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x22d78d,_0x22d78d[_0xf132('0x18d')]);this['channel'][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x197'),_0x3d99b1[_0xf132('0x14')]));this[_0xf132('0x26')]['sync'](this,_0x3d99b1[_0xf132('0x198')],_0x2c745e);return this['channel'][_0xf132('0xa8')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xf132('0x16')][_0xf132('0x199')]=function(_0x5b0fee){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x5b0fee['label']));return this['channel'][_0xf132('0xa8')](_0xf132('0x19a'));};AGIVertices[_0xf132('0x16')][_0xf132('0x19b')]=function(_0x1db5dc){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1db5dc[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x1db5dc['sms_account_id'])){return this[_0xf132('0xf')]['noop'](_0xf132('0x19c'));}var _0x350d83=this[_0xf132('0x19d')][_0xf132('0x6e')](this,_0x1db5dc[_0xf132('0x19e')]);if(!_0x350d83){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x1db5dc,'no\x20sms\x20account\x20found');}var _0x1c6e1f={'body':_0x1db5dc[_0xf132('0x19f')],'phone':_0x1db5dc['to']||'','SmsAccountId':_0x350d83['id']};logger['debug'](_0xf132('0x1a0'),JSON['stringify'](_0x1c6e1f));this['createSquareDetailsReport'][_0xf132('0x6e')](this,_0x1db5dc,_0x1db5dc['sms_account_id']);this[_0xf132('0xf')][_0xf132('0xa8')](util['format'](_0xf132('0x1a1'),_0x350d83[_0xf132('0x14')]));this[_0xf132('0x34')][_0xf132('0x6e')](this,_0x1c6e1f);return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0x1a2'));};AGIVertices[_0xf132('0x16')][_0xf132('0x1a3')]=function(_0x24277c){logger['info'](util[_0xf132('0x9d')](_0xf132('0x1a4'),_0x24277c['label']));if(!this[_0xf132('0x83')](_0x24277c[_0xf132('0xdb')])){return this['channel']['error'](_0x24277c,'no\x20variable\x20selected');}var _0x4c1267=this[_0xf132('0xdc')][_0xf132('0x6e')](this,_0x24277c[_0xf132('0xdb')]);if(!_0x4c1267){return this['channel'][_0xf132('0x2e')](_0x24277c,'no\x20variable\x20found');}return this['channel'][_0xf132('0xa5')](_0x4c1267,_0x24277c['variable_value']);};AGIVertices[_0xf132('0x16')][_0xf132('0x1a5')]=function(_0x411f87){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x1a6'),_0x411f87[_0xf132('0x37')]));this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0x1a7'));if(_0x411f87['answer']===_0xf132('0x1a8')){this['channel'][_0xf132('0xa8')](_0xf132('0x1a9'));return this[_0xf132('0xf')][_0xf132('0xba')]();}return this[_0xf132('0xf')][_0xf132('0xa8')]('Skipped\x20Answer');};AGIVertices[_0xf132('0x16')][_0xf132('0x1aa')]=function(_0x5ab087){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x1ab'),_0x5ab087[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x5ab087['project_id'])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x5ab087,_0xf132('0x1ac'));}var _0x2945a5=this[_0xf132('0x19')]['sync'](this,_0x5ab087['project_id']);if(!this[_0xf132('0x83')](_0x2945a5)){return this['channel'][_0xf132('0x2e')](_0x5ab087,util[_0xf132('0x9d')](_0xf132('0x1ad'),_0x5ab087[_0xf132('0x1ae')]));}if(_0x2945a5===this[_0xf132('0xf')][_0xf132('0x38')]){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x5ab087,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x5ab087,_0x2945a5);var _0x4905c6=this[_0xf132('0xf')]['exec'](_0xf132('0x1af'),util[_0xf132('0x9d')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xf132('0x8')][_0xf132('0x1b0')]||_0xf132('0x1b1'),_0x2945a5,this['channel'][_0xf132('0x38')]));if(_0x4905c6[_0xf132('0xaa')]===-0x1){return _0x4905c6;}return this['channel']['noop'](util['format'](_0xf132('0xc7'),_0xf132('0x1af'),_0x2945a5));};AGIVertices[_0xf132('0x16')]['system']=function(_0x4037d7){logger[_0xf132('0x30')](util['format'](_0xf132('0x1b2'),_0x4037d7[_0xf132('0x37')]));var _0x4c4428=this['shellCommand'][_0xf132('0x6e')](this,_0x4037d7[_0xf132('0xb8')]);this[_0xf132('0x35')][_0xf132('0x6e')](this,_0x4037d7,_0x4037d7[_0xf132('0xb8')]);if(this[_0xf132('0x83')](_0x4037d7[_0xf132('0xdb')])){var _0x59cc4d=this[_0xf132('0xdc')][_0xf132('0x6e')](this,_0x4037d7['variable_id']);if(_0x59cc4d){this['channel'][_0xf132('0xa5')](_0x59cc4d,_0x4c4428);return this[_0xf132('0xf')]['noop'](util[_0xf132('0x9d')](_0xf132('0x1b3'),_0x4037d7[_0xf132('0xb8')],_0x59cc4d));}}return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4037d7[_0xf132('0xb8')]));};AGIVertices['prototype'][_0xf132('0x1b4')]=function(_0x5c30e8){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x1b5'),_0x5c30e8[_0xf132('0x37')]));_0x5c30e8[_0xf132('0x5a')]=_0x5c30e8[_0xf132('0x5a')][_0xf132('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf132('0x83')](_0x5c30e8['apiKey'])){return this['channel'][_0xf132('0xa8')](_0xf132('0x1b6'));}if(!this[_0xf132('0x83')](_0x5c30e8[_0xf132('0x5a')])){return this['channel'][_0xf132('0xa8')]('no\x20text\x20configured');}this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x1b7'),_0x5c30e8['text']));var _0x499591=this[_0xf132('0x57')][_0xf132('0x6e')](this,_0x5c30e8);if(_0x499591){this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x1b8'),_0x499591));var _0x5edd4f=this[_0xf132('0xf')][_0xf132('0x12a')](_0x499591);try{fs[_0xf132('0x108')](_0x499591+'.wav');}catch(_0x6b4f95){logger[_0xf132('0x2e')](_0x6b4f95);}return _0x5edd4f;}return this[_0xf132('0xf')][_0xf132('0x2e')](_0x5c30e8,_0xf132('0x1b9'));};AGIVertices[_0xf132('0x16')]['tts']=function(_0x5eb4b5){logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x1ba'),_0x5eb4b5[_0xf132('0x37')]));_0x5eb4b5['text']=_0x5eb4b5[_0xf132('0x5a')][_0xf132('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5eb4b5[_0xf132('0x5a')])){return this[_0xf132('0xf')][_0xf132('0xa8')](_0xf132('0xca'));}this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x1bb'),_0x5eb4b5['text']));var _0x299bbd=this[_0xf132('0x5d')][_0xf132('0x6e')](this,_0x5eb4b5);if(_0x299bbd){this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x1bc'),_0x299bbd));var _0x3d5fdc=this[_0xf132('0xf')][_0xf132('0x12a')](_0x299bbd);try{fs[_0xf132('0x108')](_0x299bbd+_0xf132('0x109'));}catch(_0x199aca){logger[_0xf132('0x2e')](_0x199aca);}return _0x3d5fdc;}return this[_0xf132('0xf')][_0xf132('0x2e')](_0x5eb4b5,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xf132('0x1bd')]=function(_0x102064){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x102064[_0xf132('0x37')]));if(!this[_0xf132('0x83')](_0x102064[_0xf132('0x157')])){return this[_0xf132('0xf')]['error'](_0x102064,_0xf132('0x15d'));}logger['info'](util[_0xf132('0x9d')](_0xf132('0x158'),this[_0xf132('0xf')][_0xf132('0x39')],_0x102064[_0xf132('0x157')]));var _0x283a45=this['agentUnpause'][_0xf132('0x6e')](this,_0x102064[_0xf132('0x157')]);if(_0x283a45){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf132('0xf')][_0xf132('0x39')],_0x102064[_0xf132('0x157')]));this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x15e'),this[_0xf132('0xf')][_0xf132('0x39')],_0x102064[_0xf132('0x157')]));return{'code':0xc8,'result':_0xf132('0x159')};}else{logger[_0xf132('0x30')](util[_0xf132('0x9d')](_0xf132('0x15a'),this['channel'][_0xf132('0x39')],_0x102064[_0xf132('0x157')]));this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0x15a'),this['channel'][_0xf132('0x39')],_0x102064[_0xf132('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xf132('0x16')][_0xf132('0x1be')]=function(_0x133f9c){logger[_0xf132('0x30')](util['format'](_0xf132('0x1bf'),_0x133f9c[_0xf132('0x37')]));var _0x1c67fe=this[_0xf132('0xf')]['exec'](_0xf132('0x1c0'),[_0x133f9c[_0xf132('0x1c1')],_0x133f9c[_0xf132('0x76')]]);if(_0x1c67fe['result']===-0x1){return _0x1c67fe;}return this[_0xf132('0xf')][_0xf132('0xa8')](util[_0xf132('0x9d')](_0xf132('0xc7'),_0xf132('0x1c0'),_0x133f9c[_0xf132('0x1c1')]));};AGIVertices[_0xf132('0x16')]['vswitch']=function(_0x4872ed){logger[_0xf132('0x30')](util[_0xf132('0x9d')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4872ed[_0xf132('0x37')]));if(!this['isConfigured'](_0x4872ed[_0xf132('0xdb')])){return this[_0xf132('0xf')][_0xf132('0x2e')](_0x4872ed,_0xf132('0x1c2'));}var _0x4c7b36=this[_0xf132('0xdc')][_0xf132('0x6e')](this,_0x4872ed['variable_id']);if(!_0x4c7b36){return this[_0xf132('0xf')]['error'](_0x4872ed,'no\x20variable\x20found');}var _0x143c54=this[_0xf132('0xf')][_0xf132('0xdc')](_0x4c7b36);return{'code':0xc8,'result':_0x143c54[_0xf132('0xa2')]?_0x143c54[_0xf132('0xa2')]:'-'};};String[_0xf132('0x16')][_0xf132('0xa1')]=function(_0x1634db,_0x570a92){return this[_0xf132('0xa0')](_0x1634db)[_0xf132('0x1c3')](_0x570a92);};module[_0xf132('0x1c4')]=AGIVertices; \ No newline at end of file +var _0x7cd6=['user','subject','sendMail\x20message','sendMailMessage','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','getSmsAccount','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','mustache','request-promise','../../config/logger','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','channel','getVariable','rpc','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundPath','getMailAccount','getMailAccountById','mailRpc','getIntervals','getIntervalById','interval','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','uniqueid','isEmpty','callback_','random','lastName','isNil','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','ispeechTTS','speed','ispeechASR','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','awsLex','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','createCmContact','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query','no\x20query\x20configured','query:\x20%s','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','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','createSquareMessage','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','sestekNDA','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','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','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','variable_id','hiddendigitsnum','generate','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','message','amazonlex','wav','%s/recordings/%s','beep','recordFile','intKey','googleASR','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email'];(function(_0x263a32,_0xc49c37){var _0x4ac1df=function(_0x3d306c){while(--_0x3d306c){_0x263a32['push'](_0x263a32['shift']());}};_0x4ac1df(++_0xc49c37);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x238f47,_0x143c45){_0x238f47=_0x238f47-0x0;var _0x3aa89d=_0x7cd6[_0x238f47];return _0x3aa89d;};'use strict';var fs=require('fs');var util=require(_0x67cd('0x0'));var _=require(_0x67cd('0x1'));var sh=require(_0x67cd('0x2'));var odbc=require(_0x67cd('0x3'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0x67cd('0x4'));var rp=require(_0x67cd('0x5'));var logger=require(_0x67cd('0x6'))('agi');var config=require(_0x67cd('0x7'));var shared=require('../../config/environment/shared');var scripts=require(_0x67cd('0x8'));var FILES_PATH=_0x67cd('0x9');var recursiveMapAttributes=[_0x67cd('0xa'),_0x67cd('0xb')];var verticesWithRetry=['menu','getdigits','getsecretdigits'];var AGIVertices=function(_0x38de99,_0x61039d,_0x4a92b3){this[_0x67cd('0xc')]=_0x38de99;this['rpc']=_0x61039d;this['mailRpc']=_0x4a92b3;};AGIVertices['prototype'][_0x67cd('0xd')]=function(_0x347616,_0x318e12){this[_0x67cd('0xe')][_0x67cd('0xf')](_0x347616)[_0x67cd('0x10')](function(_0x478ad8){_0x318e12(null,_0x478ad8?_0x478ad8[_0x67cd('0x11')]:![]);})[_0x67cd('0x12')](function(_0x1693d7){_0x318e12(_0x1693d7);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x14')]=function(_0x2ab0e7,_0x158bf0){this[_0x67cd('0xe')][_0x67cd('0x15')](_0x2ab0e7)[_0x67cd('0x10')](function(_0x1a9aa3){_0x158bf0(null,_0x1a9aa3?_0x1a9aa3[_0x67cd('0x11')]:![]);})['catch'](function(_0x3fdccf){_0x158bf0(_0x3fdccf);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x16')]=function(_0x111333,_0xe82a4f){this['rpc'][_0x67cd('0x17')](_0x111333)['then'](function(_0x30cb35){_0xe82a4f(null,_0x30cb35?_0x30cb35['name']:![]);})['catch'](function(_0x4b30e7){_0xe82a4f(_0x4b30e7);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x18')]=function(_0x4370e0,_0x272ce0){this[_0x67cd('0xe')][_0x67cd('0x19')](_0x4370e0)[_0x67cd('0x10')](function(_0x2011e5){_0x272ce0(null,_0x2011e5?_0x2011e5[_0x67cd('0x1a')]:![]);})[_0x67cd('0x12')](function(_0x591019){_0x272ce0(_0x591019);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x1b')]=function(_0x1003b6,_0x22b153){this['rpc']['getUserById'](_0x1003b6)[_0x67cd('0x10')](function(_0x35ba2f){_0x22b153(null,_0x35ba2f?_0x35ba2f[_0x67cd('0x11')]:![]);})['catch'](function(_0x2230c1){_0x22b153(_0x2230c1);});};AGIVertices[_0x67cd('0x13')]['getTrunk']=function(_0x3428aa,_0x52196a){this[_0x67cd('0xe')][_0x67cd('0x1c')](_0x3428aa)[_0x67cd('0x10')](function(_0x3a1caf){_0x52196a(null,_0x3a1caf?_0x3a1caf[_0x67cd('0x11')]:![]);})['catch'](function(_0x9c9b8a){_0x52196a(_0x9c9b8a);});};AGIVertices['prototype'][_0x67cd('0x1d')]=function(_0x46002e,_0x363b24){var _0x1440ac=this;this['rpc']['getSoundById'](_0x46002e)[_0x67cd('0x10')](function(_0x185308){_0x363b24(null,_0x185308?_0x1440ac[_0x67cd('0x1e')](_0x185308['save_name']):![]);})['catch'](function(_0x21b9e2){_0x363b24(_0x21b9e2);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x1f')]=function(_0x3868af,_0x49e1e2){this[_0x67cd('0xe')][_0x67cd('0x20')](_0x3868af)[_0x67cd('0x10')](function(_0x554566){_0x49e1e2(null,_0x554566?_0x554566:![]);})['catch'](function(_0x27422e){_0x49e1e2(_0x27422e);});};AGIVertices[_0x67cd('0x13')]['sendMailMessage']=function(_0x3f3e00,_0x47ba0c,_0x3f3047){this[_0x67cd('0x21')]['sendMailMessage'](_0x3f3e00,_0x47ba0c)[_0x67cd('0x10')](function(){_0x3f3047(null);})[_0x67cd('0x12')](function(_0xc286cb){_0x3f3047(_0xc286cb);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x22')]=function(_0xa3b704,_0x171937){this[_0x67cd('0xe')][_0x67cd('0x23')](_0xa3b704)[_0x67cd('0x10')](function(_0x49c838){if(_0x49c838){if(_0x49c838['IntervalId']){_0x171937(null,[_0x49c838[_0x67cd('0x24')]]);}else{_0x171937(null,_['map'](_0x49c838[_0x67cd('0x25')],_0x67cd('0x24')));}}else{_0x171937(null,![]);}})[_0x67cd('0x12')](function(_0x53791f){_0x171937(_0x53791f);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x1e')]=function(_0x4d837d){return util[_0x67cd('0x26')]('%s/sounds/converted/%s',FILES_PATH,_0x4d837d);};AGIVertices[_0x67cd('0x13')][_0x67cd('0x27')]=function(_0x4c230c,_0x4081a4,_0x13ce8a){odbc[_0x67cd('0x28')](_0x4c230c,function(_0x4131b1){if(_0x4131b1){logger[_0x67cd('0x29')](_0x67cd('0x2a'),_0x4131b1);_0x13ce8a(_0x4131b1);}else{logger[_0x67cd('0x2b')](_0x67cd('0x2c'));odbc['query'](_0x4081a4,function(_0x10146e,_0x179af3){if(_0x10146e){logger[_0x67cd('0x2b')](_0x67cd('0x2d'),_0x4081a4);_0x13ce8a(_0x10146e);}else{logger[_0x67cd('0x2b')]('Query\x20executed\x20correctly\x20%s',_0x4081a4);odbc['close'](function(_0x3d97bf){if(_0x3d97bf){logger[_0x67cd('0x29')](_0x67cd('0x2e'),_0x3d97bf);}_0x13ce8a(null,_0x179af3);});}});}});};AGIVertices[_0x67cd('0x13')]['getSmsAccount']=function(_0x56c72b,_0x8f018e){this[_0x67cd('0xe')][_0x67cd('0x2f')](_0x56c72b)[_0x67cd('0x10')](function(_0x435efb){_0x8f018e(null,_0x435efb?_0x435efb:![]);})['catch'](function(_0x363c49){_0x8f018e(_0x363c49);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x30')]=function(_0x1f1f01,_0x5635e9){this[_0x67cd('0xe')][_0x67cd('0x30')](_0x1f1f01)[_0x67cd('0x10')](function(_0x216f6a){_0x5635e9(null,_0x216f6a);})[_0x67cd('0x12')](function(_0xfc8404){_0x5635e9(_0xfc8404);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x31')]=function(_0x9ab74f,_0x354eed,_0x522671){this[_0x67cd('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x67cd('0xc')]['uniqueid'],'node':_0x9ab74f[_0x67cd('0x32')],'application':_0x9ab74f[_0x67cd('0x33')],'data':_0x354eed||null,'project_name':this[_0x67cd('0xc')][_0x67cd('0x34')],'callerid':this[_0x67cd('0xc')][_0x67cd('0x35')]})[_0x67cd('0x10')](function(_0x278c44){if(_0x522671){_0x522671(null,_0x278c44);}})[_0x67cd('0x12')](function(_0x1fe0ba){if(_0x522671){_0x522671(_0x1fe0ba);}});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x36')]=function(_0x202253,_0x1c325d,_0x39577c,_0x482f76){this[_0x67cd('0xe')][_0x67cd('0x36')]({'uniqueid':this[_0x67cd('0xc')]['uniqueid'],'callerid':this[_0x67cd('0xc')]['callerid'],'calleridname':this[_0x67cd('0xc')][_0x67cd('0x37')],'context':this['channel'][_0x67cd('0x38')],'extension':this[_0x67cd('0xc')][_0x67cd('0x39')],'priority':this[_0x67cd('0xc')][_0x67cd('0x3a')],'accountcode':this[_0x67cd('0xc')][_0x67cd('0x3b')],'dnid':this[_0x67cd('0xc')][_0x67cd('0x3c')],'projectName':this[_0x67cd('0xc')]['arg_1'],'saveName':_0x1c325d,'filename':_0x202253[_0x67cd('0x3d')]||_0x1c325d,'savePath':_0x39577c})['then'](function(_0x37ded0){_0x482f76(null,_0x37ded0);})[_0x67cd('0x12')](function(_0x56e6b8){_0x482f76(_0x56e6b8);});};AGIVertices['prototype']['createSquareMessage']=function(_0x1fd7f0,_0x5cb39b,_0x564846,_0x32044f,_0x470c38){this['rpc']['createSquareMessage']({'uniqueid':this[_0x67cd('0xc')][_0x67cd('0x3e')],'body':_0x1fd7f0,'direction':_0x5cb39b,'providerName':_0x564846,'providerResponse':_0x32044f})['then'](function(_0x43e191){if(_0x470c38){_0x470c38(null,_0x43e191);}})[_0x67cd('0x12')](function(_0x2fa845){if(_0x470c38){_0x470c38(_0x2fa845);}});};AGIVertices[_0x67cd('0x13')]['createCmContact']=function(_0x368b6e,_0x4b99f7){this['rpc']['createCmContact']({'firstName':_[_0x67cd('0x3f')](_0x368b6e[_0x67cd('0x11')])||_['isNil'](_0x368b6e['name'])?_0x67cd('0x40')+Math[_0x67cd('0x41')]():_0x368b6e[_0x67cd('0x11')],'lastName':_[_0x67cd('0x3f')](_0x368b6e[_0x67cd('0x42')])||_[_0x67cd('0x43')](_0x368b6e['lastName'])?null:_0x368b6e[_0x67cd('0x42')],'phone':_0x368b6e['phone'],'ListId':_0x368b6e[_0x67cd('0x44')],'scheduledat':_0x368b6e[_0x67cd('0x45')],'callbackUniqueid':this[_0x67cd('0xc')][_0x67cd('0x3e')],'tags':_0x67cd('0x46'),'description':_0x67cd('0x47')+_0x368b6e[_0x67cd('0x45')][_0x67cd('0x48')](),'priority':_0x368b6e[_0x67cd('0x49')]})['then'](function(_0x4f1b05){_0x4b99f7(null,_0x4f1b05);})[_0x67cd('0x12')](function(_0x252c41){_0x4b99f7(_0x252c41);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x4a')]=function(_0x415e74,_0x53fc6a){this[_0x67cd('0xe')][_0x67cd('0x4b')](_0x415e74)[_0x67cd('0x10')](function(_0x57f381){_0x53fc6a(null,_0x57f381?_0x57f381[_0x67cd('0x11')]:![]);})['catch'](function(_0x4d6f7a){_0x53fc6a(_0x4d6f7a);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x4c')]=function(_0x15234d,_0x1d757e,_0x501d1c){var _0x195f25={'role':_0x67cd('0x4d')};_0x195f25[_0x15234d]=this[_0x67cd('0xc')][_0x67cd('0x35')];this[_0x67cd('0xe')][_0x67cd('0x4c')](_0x195f25,_0x1d757e,this[_0x67cd('0xc')]['uniqueid'])[_0x67cd('0x10')](function(_0x4c7998){_0x501d1c(null,_[_0x67cd('0x43')](_0x4c7998)?![]:!![]);})[_0x67cd('0x12')](function(_0x54570a){logger[_0x67cd('0x29')](_0x54570a);_0x501d1c(null,![]);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x4e')]=function(_0x49df8b,_0x3c4cda){var _0x381a75={'role':_0x67cd('0x4d')};_0x381a75[_0x49df8b]=this[_0x67cd('0xc')]['callerid'];this[_0x67cd('0xe')]['agentUnpause'](_0x381a75)[_0x67cd('0x10')](function(_0x51d701){_0x3c4cda(null,_[_0x67cd('0x43')](_0x51d701)?![]:!![]);})[_0x67cd('0x12')](function(_0x40f971){logger['error'](_0x40f971);_0x3c4cda(null,![]);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x4f')]=function(_0x274aa3,_0x54bd24){var _0x25610c={'role':_0x67cd('0x4d')};_0x25610c[_0x274aa3]=this['channel'][_0x67cd('0x35')];this['rpc'][_0x67cd('0x4f')](_0x25610c)[_0x67cd('0x10')](function(_0x296fc3){_0x54bd24(null,_[_0x67cd('0x43')](_0x296fc3)?![]:!![]);})['catch'](function(_0x2745b0){logger[_0x67cd('0x29')](_0x2745b0);_0x54bd24(null,![]);});};AGIVertices[_0x67cd('0x13')]['agentLogin']=function(_0x4eea39,_0x1c6346){var _0x43d3f7={'role':_0x67cd('0x4d')};_0x43d3f7[_0x4eea39]=this['channel'][_0x67cd('0x35')];var _0x56a159=_0x4eea39!=_0x67cd('0x50')?util[_0x67cd('0x26')](_0x67cd('0x51'),'LOCAL',this['channel'][_0x67cd('0x35')]):undefined;this['rpc'][_0x67cd('0x52')](_0x43d3f7,_0x56a159)['then'](function(_0x760096){_0x1c6346(null,_[_0x67cd('0x43')](_0x760096)?![]:!![]);})[_0x67cd('0x12')](function(_0x16a22e){logger['error'](_0x16a22e);_0x1c6346(null,![]);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x53')]=function(_0x27a205,_0x271090){sh[_0x67cd('0x54')](_[_0x67cd('0x55')](_0x27a205),function(_0x631683,_0x3d745d){var _0x118bf0=_0x3d745d[_0x67cd('0x56')](/(\r\n|\n|\r)/gm,'');_0x271090(null,_0x118bf0);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x57')]=function(_0x47e1a1,_0x203ce9){scripts[_0x67cd('0x57')](_0x47e1a1[_0x67cd('0x58')],_0x47e1a1[_0x67cd('0x59')]||_0x67cd('0x5a'),_0x47e1a1[_0x67cd('0x5a')],_0x47e1a1[_0x67cd('0x5b')]||_0x67cd('0x5c'),_0x47e1a1[_0x67cd('0x5d')]||_0x67cd('0x5e'),_0x47e1a1['audioEncoding']||_0x67cd('0x5f'))[_0x67cd('0x10')](function(_0x95ad3d){_0x203ce9(null,_0x95ad3d);})[_0x67cd('0x12')](function(_0x494235){_0x203ce9(_0x494235);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x60')]=function(_0x28d776,_0x5bac3a){scripts[_0x67cd('0x60')](_0x28d776[_0x67cd('0x5a')],_0x28d776[_0x67cd('0x61')]||'en',0x1)[_0x67cd('0x10')](function(_0x4b76d8){_0x5bac3a(null,_0x4b76d8);})[_0x67cd('0x12')](function(_0x25da39){_0x5bac3a(_0x25da39);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x62')]=function(_0x240f4e,_0x116719){var _0x2b7da7={'uri':_0x240f4e[_0x67cd('0x63')],'method':_0x240f4e[_0x67cd('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x240f4e['timeout'])===_0x67cd('0x65')&&parseInt(_0x240f4e[_0x67cd('0x66')])>=0x1?parseInt(_0x240f4e[_0x67cd('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x67cd('0x67')]([_0x67cd('0x68'),_0x67cd('0x69')],_0x2b7da7[_0x67cd('0x64')][_0x67cd('0x6a')]())){try{_0x2b7da7[_0x67cd('0x6b')]=_0x240f4e[_0x67cd('0xb')]?JSON[_0x67cd('0x6c')](_0x240f4e[_0x67cd('0xb')]):{};}catch(_0x11e473){logger[_0x67cd('0x29')](_0x67cd('0x6d'),_0x11e473);}}try{_0x2b7da7[_0x67cd('0x6e')]=_0x240f4e[_0x67cd('0xa')]?JSON[_0x67cd('0x6c')](_0x240f4e['rawHeaders']):{};}catch(_0x292b8c){logger['error'](_0x67cd('0x6f'),_0x292b8c);}if(_0x240f4e['computedVariables']){try{var _0x1702d3=require(_0x240f4e[_0x67cd('0x70')])['sync'](this,_0x2b7da7);_0x2b7da7[_0x67cd('0x71')]=Mustache[_0x67cd('0x72')](_0x240f4e[_0x67cd('0x63')],_0x1702d3,{},['$$','$$']);if(_0x2b7da7['headers']){_0x2b7da7['headers']=JSON[_0x67cd('0x6c')](Mustache[_0x67cd('0x72')](JSON[_0x67cd('0x73')](_0x2b7da7[_0x67cd('0x6e')]),_0x1702d3,{},['$$','$$']));}if(_0x2b7da7[_0x67cd('0x6b')]){_0x2b7da7[_0x67cd('0x6b')]=JSON[_0x67cd('0x6c')](Mustache[_0x67cd('0x72')](JSON['stringify'](_0x2b7da7[_0x67cd('0x6b')]),_0x1702d3,{},['$$','$$']));}}catch(_0x454749){logger[_0x67cd('0x29')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x454749);}}rp(_0x2b7da7)[_0x67cd('0x10')](function(_0x23fab3){var _0x4d1d96={'statusCode':_0x23fab3[_0x67cd('0x74')]||0xc8,'statusMessage':_0x23fab3[_0x67cd('0x75')]||'OK','headers':_0x23fab3['headers']||{},'body':_0x23fab3['body']||{}};_0x116719(null,_0x4d1d96);})[_0x67cd('0x12')](function(_0x4a6d39){var _0xc52047={'statusCode':_0x4a6d39[_0x67cd('0x74')]||0x1f4,'statusMessage':_0x4a6d39['message']||_0x67cd('0x76'),'headers':_0x4a6d39[_0x67cd('0x77')][_0x67cd('0x6e')]||{},'body':_0x4a6d39[_0x67cd('0x77')][_0x67cd('0x6b')]||{}};_0x116719(null,_0xc52047);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x78')]=function(_0x3bec3b,_0x50b1b4){scripts[_0x67cd('0x78')](this['channel']['uniqueid'],_0x3bec3b[_0x67cd('0x79')],_0x3bec3b[_0x67cd('0x5a')],_0x3bec3b[_0x67cd('0x7a')]||'en')[_0x67cd('0x10')](function(_0x55d3df){_0x50b1b4(null,_0x55d3df);})[_0x67cd('0x12')](function(_0x158d4a){_0x50b1b4(_0x158d4a);});};AGIVertices[_0x67cd('0x13')]['googleDialogflowV2']=function(_0x35194c,_0xc6ccea){scripts[_0x67cd('0x7b')](this['channel'][_0x67cd('0x3e')],_0x35194c[_0x67cd('0x7c')],_0x35194c['client_email'],_0x35194c[_0x67cd('0x7d')],_0x35194c['text'],_0x35194c['dialogflowV2_language']||'en')[_0x67cd('0x10')](function(_0x233105){_0xc6ccea(null,_0x233105);})[_0x67cd('0x12')](function(_0x133323){_0xc6ccea(_0x133323);});};AGIVertices[_0x67cd('0x13')]['sestekNDA']=function(_0x356dce,_0x294776){scripts['sestekNDA'](this['channel'],_0x356dce)['then'](function(_0x5932b2){_0x294776(null,_0x5932b2);})['catch'](function(_0x1153c2){_0x294776(_0x1153c2);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x7e')]=function(_0x37e440,_0xee028e){scripts[_0x67cd('0x7e')](_0x37e440[_0x67cd('0x79')],_0x37e440[_0x67cd('0x5a')],_0x37e440['ispeech_tts_language']||_0x67cd('0x5c'),_0x37e440[_0x67cd('0x7f')])['then'](function(_0x1d23a7){_0xee028e(null,_0x1d23a7);})[_0x67cd('0x12')](function(_0x5c63db){_0xee028e(_0x5c63db);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x80')]=function(_0x50ae9e,_0x429cc2,_0x36019a){scripts[_0x67cd('0x80')](_0x429cc2,_0x50ae9e[_0x67cd('0x79')],_0x50ae9e['ispeech_asr_language']||_0x67cd('0x5c'),this[_0x67cd('0x81')](_0x50ae9e['model'])?_0x50ae9e['model']:undefined)[_0x67cd('0x10')](function(_0x32be9d){_0x36019a(null,_0x32be9d);})[_0x67cd('0x12')](function(_0x3d0569){_0x36019a(_0x3d0569);});};AGIVertices['prototype'][_0x67cd('0x82')]=function(_0x3f3f17,_0x10c422){scripts[_0x67cd('0x82')](_0x3f3f17[_0x67cd('0x83')],_0x3f3f17[_0x67cd('0x84')],_0x3f3f17[_0x67cd('0x85')],_0x3f3f17['aws_polly_voice']||'Amy',_0x3f3f17[_0x67cd('0x5a')],_0x3f3f17['aws_text_type']||_0x67cd('0x5a'))[_0x67cd('0x10')](function(_0x428273){_0x10c422(null,_0x428273);})['catch'](function(_0x1b268b){_0x10c422(_0x1b268b);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x86')]=function(_0x16b6d1,_0x3cf7ed){scripts[_0x67cd('0x86')](this['channel'][_0x67cd('0x3e')],_0x16b6d1[_0x67cd('0x83')],_0x16b6d1[_0x67cd('0x84')],_0x16b6d1[_0x67cd('0x87')],_0x16b6d1[_0x67cd('0x5a')],_0x16b6d1[_0x67cd('0x88')])['then'](function(_0xa4b1af){_0x3cf7ed(null,_0xa4b1af);})[_0x67cd('0x12')](function(_0x17cd3a){_0x3cf7ed(_0x17cd3a);});};AGIVertices[_0x67cd('0x13')]['googleASR']=function(_0x38d14d,_0x163c2e,_0x57a67a){scripts['googleASR'](_0x163c2e,_0x38d14d[_0x67cd('0x79')],_0x38d14d[_0x67cd('0x89')]||_0x67cd('0x5c'))['then'](function(_0x348922){_0x57a67a(null,_0x348922);})[_0x67cd('0x12')](function(_0x4a24bc){_0x57a67a(_0x4a24bc);});};AGIVertices['prototype'][_0x67cd('0x8a')]=function(_0x3eba60,_0x38d481,_0x23858c){scripts[_0x67cd('0x8a')](_0x38d481,_0x3eba60['appid'],_0x3eba60['appsecret'],_0x3eba60[_0x67cd('0x71')])[_0x67cd('0x10')](function(_0xf48d){_0x23858c(null,_0xf48d);})['catch'](function(_0x1cf90e){_0x23858c(_0x1cf90e);});};AGIVertices[_0x67cd('0x13')][_0x67cd('0x8b')]=function(_0xbb9281){var _0x57997b=_[_0x67cd('0x67')](verticesWithRetry,_0xbb9281[_0x67cd('0x33')])?_0xbb9281:_[_0x67cd('0x8c')](_0xbb9281);for(var _0x5ed241 in _0x57997b){if(_0x57997b[_0x67cd('0x8d')](_0x5ed241)){if(_0x57997b[_0x5ed241]&&_[_0x67cd('0x8e')](_0x57997b[_0x5ed241])){if(_[_0x67cd('0x67')](recursiveMapAttributes,_0x5ed241)){_0x57997b[_0x5ed241]=this[_0x67cd('0x8f')](_0x57997b[_0x5ed241]);}else{_0x57997b[_0x5ed241]=this[_0x67cd('0x90')](_0x57997b[_0x5ed241]);}}}}return _0x57997b;};AGIVertices[_0x67cd('0x13')]['recursiveNodeIndex']=function(_0xaa4d77){for(var _0x5722d2 in _0xaa4d77){if(_0xaa4d77[_0x67cd('0x8d')](_0x5722d2)){if(_[_0x67cd('0x91')](_0xaa4d77[_0x5722d2])){this[_0x67cd('0x92')](_0xaa4d77[_0x5722d2]);}else if(_[_0x67cd('0x93')](_0xaa4d77[_0x5722d2])){for(var _0x4af7e4=0x0;_0x4af7e4<_0xaa4d77[_0x5722d2][_0x67cd('0x94')];_0x4af7e4++){this['recursiveNodeIndex'](_0xaa4d77[_0x5722d2][_0x4af7e4]);}}else if(_['isString'](_0xaa4d77[_0x5722d2])){_0xaa4d77[_0x5722d2]=this['replaceAllVariables'](_0xaa4d77[_0x5722d2]);}}}};AGIVertices[_0x67cd('0x13')][_0x67cd('0x95')]=function(_0x2ae5ab,_0x19b214){for(var _0x46c769 in _0x2ae5ab){if(_0x2ae5ab['hasOwnProperty'](_0x46c769)){if(_[_0x67cd('0x91')](_0x2ae5ab[_0x46c769])){if(!_[_0x67cd('0x3f')](_0x2ae5ab[_0x46c769])){this[_0x67cd('0x95')](_0x2ae5ab[_0x46c769],util['format'](_0x67cd('0x96'),_0x19b214,_0x46c769));}}else if(_['isArray'](_0x2ae5ab[_0x46c769])){for(var _0x1a9c73=0x0;_0x1a9c73<_0x2ae5ab[_0x46c769][_0x67cd('0x94')];_0x1a9c73++){this['saveRestApiResult'](_0x2ae5ab[_0x46c769][_0x1a9c73],util[_0x67cd('0x26')](_0x67cd('0x96'),_0x19b214,_0x46c769+'['+_0x1a9c73+']'));}}else{if(!_[_0x67cd('0x43')](_0x2ae5ab[_0x46c769])){this[_0x67cd('0xc')][_0x67cd('0x97')](util[_0x67cd('0x26')](_0x67cd('0x96'),_0x19b214,_0x46c769),_0x2ae5ab[_0x46c769]);}}}}};AGIVertices[_0x67cd('0x13')][_0x67cd('0x8f')]=function(_0x41d4dd){try{var _0x13f128=JSON[_0x67cd('0x6c')](_0x41d4dd);this[_0x67cd('0x92')](_0x13f128);return JSON[_0x67cd('0x73')](_0x13f128);}catch(_0x1f43e3){return this[_0x67cd('0x90')](_0x41d4dd);}};AGIVertices['prototype'][_0x67cd('0x90')]=function(_0x71c8f8){var _0x566c1a=_0x71c8f8[_0x67cd('0x98')]('{');for(var _0x54893e=0x1;_0x54893e<_0x566c1a[_0x67cd('0x94')];_0x54893e+=0x1){var _0x500b06=_0x566c1a[_0x54893e][_0x67cd('0x98')]('}');if(_0x500b06[_0x67cd('0x94')]>0x1){_0x71c8f8=_0x71c8f8[_0x67cd('0x99')]('{'+_0x500b06[0x0]+'}',this[_0x67cd('0xc')]['getVariable'](_0x500b06[0x0])[_0x67cd('0x9a')]||_0x500b06[0x0]);}}if(_0x566c1a[_0x67cd('0x94')]===0x1){return _0x71c8f8[_0x67cd('0x48')]();}return this[_0x67cd('0x90')](_0x71c8f8);};AGIVertices['prototype']['getAndSetVariable']=function(_0x47a8db,_0x163c53){var _0x159c3a=this[_0x67cd('0xc')][_0x67cd('0xd')](_0x47a8db);if(_0x159c3a['result']===-0x1){return _0x159c3a;}logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x9b'),_0x163c53,_0x159c3a['extra']));return this[_0x67cd('0xc')][_0x67cd('0x97')](_0x163c53,_0x159c3a['extra']);};AGIVertices[_0x67cd('0x13')][_0x67cd('0x81')]=function(_0x2bec2f){return _0x2bec2f&&_0x2bec2f!=='0'&&_0x2bec2f!=='-1'&&_0x2bec2f!=='';};AGIVertices[_0x67cd('0x13')][_0x67cd('0x9c')]=function(_0x379bef){this[_0x67cd('0x31')][_0x67cd('0x9d')](this,_0x379bef,'-');_0x379bef[_0x67cd('0x9e')]=_0x379bef['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x5620e5){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x5620e5['label']));if(!this['isConfigured'](_0x5620e5[_0x67cd('0x5a')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xa0'));}var _0x154ce9='\x22'+_0x5620e5[_0x67cd('0x5a')]+'\x22';if(this[_0x67cd('0x81')](_0x5620e5[_0x67cd('0x77')])){_0x154ce9+=','+_0x5620e5['options'];}var _0x2fc7e9=this['channel'][_0x67cd('0x54')](_0x67cd('0xa1'),_0x154ce9);if(_0x2fc7e9[_0x67cd('0xa2')]===-0x1){return _0x2fc7e9;}return this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0xa3'),_0x154ce9));};AGIVertices['prototype'][_0x67cd('0xa4')]=function(_0x23628d){logger['info'](util['format'](_0x67cd('0xa5'),_0x23628d[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x23628d[_0x67cd('0xa6')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xa7'));}var _0x3d535c=_0x23628d['grammar'];if(this[_0x67cd('0x81')](_0x23628d['options'])){_0x3d535c+=','+_0x23628d[_0x67cd('0x77')];}var _0x2d7200=this[_0x67cd('0xc')][_0x67cd('0x54')](_0x67cd('0xa8'),_0x3d535c);if(_0x2d7200['result']===-0x1){return _0x2d7200;}var _0x9ec3c1=this[_0x67cd('0xa9')](_0x67cd('0xaa'),'MRCP_RECOG_CONFIDENCE');if(_0x9ec3c1[_0x67cd('0xa2')]===-0x1){return _0x9ec3c1;}var _0xbceb0d=this[_0x67cd('0xa9')](_0x67cd('0xab'),'MRCP_RECOG_TRANSCRIPT');if(_0xbceb0d[_0x67cd('0xa2')]===-0x1){return _0xbceb0d;}var _0x416cad=this['getAndSetVariable'](_0x67cd('0xac'),'MRCP_RECOG_INSTANCE');if(_0x416cad[_0x67cd('0xa2')]===-0x1){return _0x416cad;}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3d535c));};AGIVertices[_0x67cd('0x13')][_0x67cd('0xad')]=function(_0x4d0d2a){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4d0d2a[_0x67cd('0x32')]));return this[_0x67cd('0xc')]['agi']([_0x4d0d2a[_0x67cd('0xae')],_0x4d0d2a[_0x67cd('0xaf')]]);};AGIVertices[_0x67cd('0x13')][_0x67cd('0xb0')]=function(_0x1ce3f8){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0xb1'),_0x1ce3f8[_0x67cd('0x32')]));if(this[_0x67cd('0x81')](_0x1ce3f8[_0x67cd('0x66')])){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1ce3f8[_0x67cd('0x66')]));var _0x5882d0=this[_0x67cd('0xc')][_0x67cd('0xb2')](_0x1ce3f8[_0x67cd('0x66')]);if(_0x5882d0[_0x67cd('0xa2')]===-0x1){return _0x5882d0;}}return this['channel']['answer']();};AGIVertices['prototype']['callback']=function(_0x3b2bfa){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0xb3'),_0x3b2bfa[_0x67cd('0x32')]));if(!this['isConfigured'](_0x3b2bfa['list_id'])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x3b2bfa,_0x67cd('0xb4'));}_0x3b2bfa[_0x67cd('0x45')]=moment();if(this[_0x67cd('0x81')](_0x3b2bfa[_0x67cd('0xb5')])){_0x3b2bfa[_0x67cd('0x45')]=moment()[_0x67cd('0xb6')](_0x3b2bfa[_0x67cd('0xb5')],_0x67cd('0xb7'));}if(!this[_0x67cd('0x81')](_0x3b2bfa[_0x67cd('0x49')])){_0x3b2bfa['callback_priority']=0x2;}this[_0x67cd('0xb8')]['sync'](this,_0x3b2bfa);return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3b2bfa[_0x67cd('0xb9')],_0x3b2bfa[_0x67cd('0x44')],_0x3b2bfa['scheduledAt']));};AGIVertices[_0x67cd('0x13')]['custom_app']=function(_0x5068fe){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0xba'),_0x5068fe[_0x67cd('0x32')]));var _0x59c286=this[_0x67cd('0xc')][_0x67cd('0x54')](_0x5068fe[_0x67cd('0xbb')],_0x5068fe[_0x67cd('0x77')]);if(_0x59c286[_0x67cd('0xa2')]===-0x1){return _0x59c286;}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format']('Executed\x20command\x20%s\x20%s',_0x5068fe[_0x67cd('0xbb')],_0x5068fe['options']));};AGIVertices[_0x67cd('0x13')][_0x67cd('0xbc')]=function(_0x584541){logger['info'](util['format'](_0x67cd('0xbd'),_0x584541[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x584541[_0x67cd('0x5a')])){return this['channel'][_0x67cd('0x9f')](_0x67cd('0xa0'));}var _0x5bf86a='\x22'+_0x584541[_0x67cd('0x5a')]+'\x22';if(this[_0x67cd('0x81')](_0x584541[_0x67cd('0x77')])){_0x5bf86a+=','+_0x584541[_0x67cd('0x77')];}var _0x162f1f=this[_0x67cd('0xc')]['exec']('MRCPSynth',_0x5bf86a);if(_0x162f1f[_0x67cd('0xa2')]===-0x1){return _0x162f1f;}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format'](_0x67cd('0xa3'),_0x5bf86a));};AGIVertices[_0x67cd('0x13')]['sestektts']=function(_0x37880d){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x37880d[_0x67cd('0x32')]));if(!this['isConfigured'](_0x37880d[_0x67cd('0x5a')])){return this[_0x67cd('0xc')]['noop']('no\x20text\x20configured');}var _0x2942c5='\x22'+_0x37880d[_0x67cd('0x5a')]+'\x22';if(this['isConfigured'](_0x37880d[_0x67cd('0x77')])){_0x2942c5+=','+_0x37880d[_0x67cd('0x77')];}var _0x2ece60=this['channel'][_0x67cd('0x54')](_0x67cd('0xa1'),_0x2942c5);if(_0x2ece60[_0x67cd('0xa2')]===-0x1){return _0x2ece60;}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0xa3'),_0x2942c5));};AGIVertices[_0x67cd('0x13')]['lumenvoxasr']=function(_0x4a812f){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0xbe'),_0x4a812f['label']));if(!this[_0x67cd('0x81')](_0x4a812f[_0x67cd('0xa6')])){return this[_0x67cd('0xc')]['noop'](_0x67cd('0xa7'));}var _0x119da2=_0x4a812f['grammar'];if(this['isConfigured'](_0x4a812f['options'])){_0x119da2+=','+_0x4a812f[_0x67cd('0x77')];}var _0x3edea2=this['channel']['exec']('MRCPRecog',_0x119da2);if(_0x3edea2[_0x67cd('0xa2')]===-0x1){return _0x3edea2;}var _0x6adab9=this[_0x67cd('0xa9')](_0x67cd('0xaa'),'LUMENVOX_ASR_CONFIDENCE');if(_0x6adab9[_0x67cd('0xa2')]===-0x1){return _0x6adab9;}var _0x19e15d=this['getAndSetVariable'](_0x67cd('0xab'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x19e15d['result']===-0x1){return _0x19e15d;}var _0x2383a4=this[_0x67cd('0xa9')](_0x67cd('0xac'),_0x67cd('0xbf'));if(_0x2383a4[_0x67cd('0xa2')]===-0x1){return _0x2383a4;}return this[_0x67cd('0xc')]['noop'](util['format'](_0x67cd('0xc0'),_0x119da2));};AGIVertices[_0x67cd('0x13')][_0x67cd('0xc1')]=function(_0x4486f3){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x4486f3[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x4486f3[_0x67cd('0xa6')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')]('no\x20grammar\x20configured');}var _0x9da9ff=_0x4486f3[_0x67cd('0xa6')];if(this['isConfigured'](_0x4486f3[_0x67cd('0x77')])){_0x9da9ff+=','+_0x4486f3[_0x67cd('0x77')];}var _0x3eace7=this[_0x67cd('0xc')][_0x67cd('0x54')](_0x67cd('0xa8'),_0x9da9ff);if(_0x3eace7[_0x67cd('0xa2')]===-0x1){return _0x3eace7;}var _0xdc8886=this['getAndSetVariable'](_0x67cd('0xaa'),'SESTEK_ASR_CONFIDENCE');if(_0xdc8886['result']===-0x1){return _0xdc8886;}var _0x10dfb4=this['getAndSetVariable'](_0x67cd('0xab'),_0x67cd('0xc2'));if(_0x10dfb4[_0x67cd('0xa2')]===-0x1){return _0x10dfb4;}var _0x4dd2fe=this[_0x67cd('0xa9')](_0x67cd('0xac'),_0x67cd('0xc3'));if(_0x4dd2fe[_0x67cd('0xa2')]===-0x1){return _0x4dd2fe;}return this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0xc0'),_0x9da9ff));};AGIVertices[_0x67cd('0x13')]['database']=function(_0x3c560a){logger['info'](util['format'](_0x67cd('0xc4'),_0x3c560a[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x3c560a[_0x67cd('0xc5')])){return this[_0x67cd('0xc')]['error'](_0x3c560a,_0x67cd('0xc6'));}var _0x1c163e=this[_0x67cd('0x18')][_0x67cd('0x9d')](this,_0x3c560a['odbc_id']);if(!_0x1c163e){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x3c560a,'no\x20odbc\x20database\x20found');}if(!this[_0x67cd('0x81')](_0x3c560a[_0x67cd('0xc7')])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x3c560a,_0x67cd('0xc8'));}var _0x3e130e=_0x3c560a[_0x67cd('0xc7')][_0x67cd('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x67cd('0x9f')](util['format'](_0x67cd('0xc9'),_0x3e130e));var _0x11483f=this[_0x67cd('0x27')][_0x67cd('0x9d')](this,_0x1c163e,_0x3e130e);this[_0x67cd('0x31')][_0x67cd('0x9d')](this,_0x3c560a,_0x3e130e);if(!this[_0x67cd('0x81')](_0x3c560a['variable_id'])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xca'));}var _0x3de8f9=this[_0x67cd('0xd')]['sync'](this,_0x3c560a['variable_id']);if(!_0x3de8f9){return this[_0x67cd('0xc')]['error'](_0x3c560a,_0x67cd('0xcb'));}var _0x3aac92=this;_0x11483f[_0x67cd('0xcc')](function(_0x40249e,_0x52ce26){Object[_0x67cd('0xcd')](_0x40249e)['forEach'](function(_0x3102f5){_0x3aac92['channel']['setVariable'](util['format'](_0x67cd('0xce'),_0x3de8f9,_0x52ce26,_0x3102f5),_0x40249e[_0x3102f5]);});});this['channel']['setVariable'](util[_0x67cd('0x26')](_0x67cd('0xcf'),_0x3de8f9),_0x11483f[_0x67cd('0x94')]);return this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format'](_0x67cd('0xd0'),_0x3de8f9));};AGIVertices['prototype'][_0x67cd('0xd1')]=function(_0x66cc2e){logger[_0x67cd('0xd2')](util[_0x67cd('0x26')](_0x67cd('0xd3'),_0x66cc2e[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x66cc2e[_0x67cd('0xd4')])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x66cc2e,_0x67cd('0xd5'));}var _0x4091a7=this[_0x67cd('0x1b')]['sync'](this,_0x66cc2e['sip_id']);if(!_0x4091a7){return this[_0x67cd('0xc')]['error'](_0x66cc2e,_0x67cd('0xd6'));}var _0x4b6a1c=this[_0x67cd('0xc')]['exec'](_0x67cd('0xd7'),[util['format'](_0x67cd('0xd8'),_0x4091a7),_0x66cc2e[_0x67cd('0x66')],_0x66cc2e[_0x67cd('0xd9')],_0x66cc2e[_0x67cd('0x63')]]);if(_0x4b6a1c[_0x67cd('0xa2')]===-0x1){return _0x4b6a1c;}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('Executed\x20command\x20%s',_0x67cd('0xd7')));};AGIVertices[_0x67cd('0x13')][_0x67cd('0xda')]=function(_0x56bb52){logger['info'](util['format'](_0x67cd('0xdb'),_0x56bb52[_0x67cd('0x32')]));if(!this['isConfigured'](_0x56bb52['key'])){return this['channel']['noop'](_0x67cd('0xdc'));}if(!this[_0x67cd('0x81')](_0x56bb52[_0x67cd('0x5a')])){return this[_0x67cd('0xc')]['noop'](_0x67cd('0xa0'));}this[_0x67cd('0xc')][_0x67cd('0xdd')]=!![];this[_0x67cd('0x31')](_0x56bb52);this[_0x67cd('0xde')](_0x56bb52[_0x67cd('0x5a')],'in','','');this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0xdf'),_0x56bb52[_0x67cd('0x5a')]));var _0x268c32=this[_0x67cd('0x78')][_0x67cd('0x9d')](this,_0x56bb52);if(_0x268c32){for(var _0x312a31 in _0x268c32){if(_0x268c32[_0x67cd('0x8d')](_0x312a31)){this[_0x67cd('0xc')][_0x67cd('0x97')](util[_0x67cd('0x26')]('DIALOGFLOW_%s',_0x312a31[_0x67cd('0x6a')]()),_0x268c32[_0x312a31]);}}this['createSquareMessage'](_0x268c32[_0x67cd('0xe0')],_0x67cd('0xe1'),_0x67cd('0xda'),'');return this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0xe2'),_0x268c32[_0x67cd('0xe0')]));}return this[_0x67cd('0xc')]['error'](_0x56bb52,_0x67cd('0xe3'));};AGIVertices[_0x67cd('0x13')][_0x67cd('0xe4')]=function(_0x24aecc){logger['info'](util[_0x67cd('0x26')](_0x67cd('0xe5'),_0x24aecc[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x24aecc['dialogflowV2_project_id'])){return this['channel'][_0x67cd('0x9f')](_0x67cd('0xe6'));}if(!this['isConfigured'](_0x24aecc['client_email'])){return this['channel']['noop'](_0x67cd('0xe7'));}if(!this[_0x67cd('0x81')](_0x24aecc[_0x67cd('0x7d')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xe8'));}if(!this['isConfigured'](_0x24aecc[_0x67cd('0xe9')])){return this[_0x67cd('0xc')]['noop'](_0x67cd('0xea'));}if(!this[_0x67cd('0x81')](_0x24aecc[_0x67cd('0x5a')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')]('no\x20text\x20configured');}this['channel'][_0x67cd('0xdd')]=!![];this[_0x67cd('0x31')](_0x24aecc);this[_0x67cd('0xde')](_0x24aecc[_0x67cd('0x5a')],'in','','');this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format'](_0x67cd('0xeb'),_0x24aecc[_0x67cd('0x5a')]));var _0x58d908=this[_0x67cd('0x7b')][_0x67cd('0x9d')](this,_0x24aecc);if(_0x58d908){for(var _0xbfd99e in _0x58d908){if(_0x58d908['hasOwnProperty'](_0xbfd99e)){if(_0xbfd99e!==_0x67cd('0xec')){this[_0x67cd('0xc')]['setVariable'](util['format'](_0x67cd('0xed'),_0xbfd99e[_0x67cd('0x6a')]()),_0x58d908[_0xbfd99e]);}}}this[_0x67cd('0xde')](_0x58d908[_0x67cd('0xe0')],'out',_0x67cd('0xe4'),_0x58d908[_0x67cd('0xec')]);return this['channel']['noop'](util[_0x67cd('0x26')](_0x67cd('0xee'),_0x58d908[_0x67cd('0xe0')]));}return this[_0x67cd('0xc')]['error'](_0x24aecc,_0x67cd('0xef'));};AGIVertices[_0x67cd('0x13')][_0x67cd('0xf0')]=function(_0x58792b){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0xf1'),_0x58792b[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x58792b[_0x67cd('0xf2')])){return this['channel'][_0x67cd('0x9f')](_0x67cd('0xf3'));}if(!this[_0x67cd('0x81')](_0x58792b[_0x67cd('0xf4')])){return this[_0x67cd('0xc')]['noop'](_0x67cd('0xf5'));}if(!this[_0x67cd('0x81')](_0x58792b[_0x67cd('0xf6')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xf7'));}if(!this['isConfigured'](_0x58792b['ndassistant_url'])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xa0'));}this[_0x67cd('0xc')]['bot']=!![];this['createSquareDetailsReport'](_0x58792b);this['createSquareMessage'](_0x58792b[_0x67cd('0x5a')],'in','','');this[_0x67cd('0xc')]['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0x58792b[_0x67cd('0x5a')]));var _0xeef745=this[_0x67cd('0xf8')][_0x67cd('0x9d')](this,_0x58792b);if(_0xeef745){for(var _0x4ca61c in _0xeef745){if(_0xeef745[_0x67cd('0x8d')](_0x4ca61c)){this['channel'][_0x67cd('0x97')](util['format']('SESTEK_NDA_%s',_0x4ca61c[_0x67cd('0x6a')]()),_0xeef745[_0x4ca61c]);}}this[_0x67cd('0xde')](_0xeef745[_0x67cd('0xe0')],_0x67cd('0xe1'),_0x67cd('0xf0'),'');if(_0xeef745['audiofile']){this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0xf9'),_0xeef745[_0x67cd('0xfa')]));var _0x1b35a1=this[_0x67cd('0xc')][_0x67cd('0xfb')](_0xeef745[_0x67cd('0xfa')]);try{fs[_0x67cd('0xfc')](_0xeef745[_0x67cd('0xfa')]+_0x67cd('0xfd'));}catch(_0x2233b7){logger['error'](_0x2233b7);}return _0x1b35a1;}else{return this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0xfe'),_0xeef745[_0x67cd('0xe0')]));}}return this['channel']['error'](_0x58792b,_0x67cd('0xff'));};AGIVertices[_0x67cd('0x13')][_0x67cd('0x100')]=function(_0x105a42){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x101'),_0x105a42[_0x67cd('0x32')]));return this['channel'][_0x67cd('0x9f')]('end');};AGIVertices[_0x67cd('0x13')][_0x67cd('0x102')]=function(_0x191048){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x191048[_0x67cd('0x32')]));var _0x293563='';if(_0x191048[_0x67cd('0x103')]){if(!this['isConfigured'](_0x191048[_0x67cd('0x103')])){return this[_0x67cd('0xc')]['error'](_0x191048,'no\x20trunk\x20selected');}else{var _0x184a3e=parseInt(_0x191048[_0x67cd('0x103')],0xa);if(isNaN(_0x184a3e)){_0x293563=_0x191048['trunk_id'];}else{_0x293563=this['getTrunk']['sync'](this,_0x191048[_0x67cd('0x103')]);if(!_0x293563){return this['channel'][_0x67cd('0x29')](_0x191048,'no\x20trunk\x20found');}}}}else if(_0x191048['trunk_name']){_0x293563=_0x191048[_0x67cd('0x104')];}else{return this[_0x67cd('0xc')]['error'](_0x191048,_0x67cd('0x105'));}var _0x2dfdfe=this[_0x67cd('0xc')][_0x67cd('0x54')]('DIAL',[util['format'](_0x67cd('0x106'),_0x293563,_0x191048['phone']),_0x191048['timeout'],_0x191048[_0x67cd('0xd9')],_0x191048[_0x67cd('0x63')]]);if(_0x2dfdfe['result']===-0x1){return _0x2dfdfe;}return this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')]('Executed\x20command\x20%s',_0x67cd('0xd7')));};AGIVertices[_0x67cd('0x13')]['finally']=function(_0x95fd4d){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x107'),_0x95fd4d[_0x67cd('0x32')]));return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x108'));};AGIVertices['prototype'][_0x67cd('0x109')]=function(_0x4eae91){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x4eae91['label']));if(_0x4eae91['retry']===0x0){return this['maxRetry'](_0x4eae91);}_0x4eae91[_0x67cd('0x9e')]-=0x1;if(!this[_0x67cd('0x81')](_0x4eae91['file_id'])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x4eae91,_0x67cd('0x10a'));}var _0x3e2fae=this[_0x67cd('0x1d')][_0x67cd('0x9d')](this,_0x4eae91['file_id']);if(!_0x3e2fae){return this[_0x67cd('0xc')]['error'](_0x4eae91,_0x67cd('0x10b'));}if(!this[_0x67cd('0x81')](_0x4eae91['variable_id'])){return this[_0x67cd('0xc')][_0x67cd('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x20ae38=this[_0x67cd('0xc')][_0x67cd('0x10c')](_0x3e2fae,_0x4eae91[_0x67cd('0x10d')],_0x4eae91[_0x67cd('0x10e')]);var _0x184560=_0x20ae38[_0x67cd('0xa2')]?_0x20ae38[_0x67cd('0xa2')][_0x67cd('0x48')]():'';logger['info'](_0x67cd('0x10f'),JSON[_0x67cd('0x73')](_0x20ae38));if(_0x20ae38[_0x67cd('0xa2')]===-0x1){this['createSquareDetailsReport'][_0x67cd('0x9d')](this,_0x4eae91,_0x184560);return _0x20ae38;}else if(_0x20ae38[_0x67cd('0x9a')]==='timeout'){_0x20ae38['result']=_0x184560[_0x67cd('0x94')]>=parseInt(_0x4eae91['mindigit'])?'x':'i';}else{_0x20ae38['result']=_0x184560[_0x67cd('0x94')]>=parseInt(_0x4eae91['mindigit'])&&_0x184560['length']<=parseInt(_0x4eae91['maxdigit'])?'x':'i';}var _0x33c1a3=this[_0x67cd('0xd')][_0x67cd('0x9d')](this,_0x4eae91[_0x67cd('0x110')]);if(!_0x33c1a3){return this['channel'][_0x67cd('0x29')](_0x4eae91,'no\x20variable\x20found');}this[_0x67cd('0xc')][_0x67cd('0x97')](_0x33c1a3,_0x184560);if(this['isConfigured'](_0x4eae91['hiddendigitsnum'])){var _0x3f9e8b=parseInt(_0x4eae91[_0x67cd('0x111')],0xa);var _0x1251e7=rs[_0x67cd('0x112')]({'charset':'*','length':_0x3f9e8b});var _0x22ed10=_0x184560[_0x67cd('0x94')];if(_0x22ed10>0x0){if(_0x22ed10>_0x3f9e8b){this[_0x67cd('0x31')]['sync'](this,_0x4eae91,_0x4eae91['hiddendigitspos']===_0x67cd('0x113')?_0x1251e7+_0x184560[_0x67cd('0x114')](_0x3f9e8b):_0x184560[_0x67cd('0x114')](0x0,_0x22ed10-_0x3f9e8b)+_0x1251e7);}else{this[_0x67cd('0x31')][_0x67cd('0x9d')](this,_0x4eae91,rs[_0x67cd('0x112')]({'charset':'*','length':_0x22ed10}));}}else{this[_0x67cd('0x31')]['sync'](this,_0x4eae91,'');}}else{this[_0x67cd('0x31')][_0x67cd('0x9d')](this,_0x4eae91,_0x184560);}return _0x20ae38;};AGIVertices[_0x67cd('0x13')][_0x67cd('0x115')]=function(_0x5a9407){logger['info'](util[_0x67cd('0x26')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5a9407[_0x67cd('0x32')]));return this[_0x67cd('0x109')](_0x5a9407);};AGIVertices[_0x67cd('0x13')][_0x67cd('0x116')]=function(_0x41bcfb){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x117'),_0x41bcfb['label']));this['createSquareDetailsReport'][_0x67cd('0x9d')](this,_0x41bcfb,_0x41bcfb['goalname']);return this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0x118'),_0x41bcfb[_0x67cd('0x119')]));};AGIVertices[_0x67cd('0x13')]['awspolly']=function(_0x3d93d9){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x11a'),_0x3d93d9[_0x67cd('0x32')]));if(!this['isConfigured'](_0x3d93d9[_0x67cd('0x83')])||!this['isConfigured'](_0x3d93d9[_0x67cd('0x84')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x67cd('0x81')](_0x3d93d9[_0x67cd('0x5a')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xa0'));}this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('Trying\x20aws\x20Polly\x20%s',_0x3d93d9[_0x67cd('0x5a')]));var _0xf9b794=this[_0x67cd('0x82')][_0x67cd('0x9d')](this,_0x3d93d9);if(_0xf9b794){this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('aws\x20Polly\x20%s\x20file\x20created',_0xf9b794));var _0x57e82b=this['channel'][_0x67cd('0xfb')](_0xf9b794);try{fs[_0x67cd('0xfc')](_0xf9b794+_0x67cd('0xfd'));}catch(_0x2eb403){logger[_0x67cd('0x29')](_0x2eb403);}return _0x57e82b;}return this['channel'][_0x67cd('0x29')](_0x3d93d9,_0x67cd('0x11b'));};AGIVertices[_0x67cd('0x13')][_0x67cd('0x11c')]=function(_0x131e71){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x131e71['label']));if(!this[_0x67cd('0x81')](_0x131e71[_0x67cd('0x83')])||!this['isConfigured'](_0x131e71[_0x67cd('0x84')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x11d'));}if(!this['isConfigured'](_0x131e71[_0x67cd('0x88')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x11e'));}if(!this[_0x67cd('0x81')](_0x131e71['text'])){return this[_0x67cd('0xc')][_0x67cd('0x9f')]('no\x20text\x20configured');}this['channel'][_0x67cd('0xdd')]=!![];this['createSquareDetailsReport'](_0x131e71);this[_0x67cd('0xde')](_0x131e71[_0x67cd('0x5a')],'in','','');this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('Trying\x20Amazon\x20Lex:\x20%s',_0x131e71[_0x67cd('0x5a')]));var _0x1138fc=this['awsLex'][_0x67cd('0x9d')](this,_0x131e71);if(_0x1138fc){for(var _0x364bee in _0x1138fc){if(_0x1138fc[_0x67cd('0x8d')](_0x364bee)&&_[_0x67cd('0x8e')](_0x1138fc[_0x364bee])){this['channel'][_0x67cd('0x97')](util[_0x67cd('0x26')]('AWS_LEX_%s',_0x364bee[_0x67cd('0x6a')]()),_0x1138fc[_0x364bee]);}}if(_[_0x67cd('0x43')](_0x1138fc['message'])){return this[_0x67cd('0xc')][_0x67cd('0x9f')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x67cd('0xde')](_0x1138fc[_0x67cd('0x11f')],_0x67cd('0xe1'),_0x67cd('0x120'),'');return this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0x1138fc[_0x67cd('0x11f')]));}}return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x131e71,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x67cd('0x13')]['googleasr']=function(_0x37aaf7){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x37aaf7['label'],_0x37aaf7[_0x67cd('0x66')]));if(!this[_0x67cd('0x81')](_0x37aaf7[_0x67cd('0x79')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xdc'));}var _0xde5469=_0x67cd('0x121');var _0x4be8d2=util['format'](_0x67cd('0x122'),FILES_PATH,rs[_0x67cd('0x112')](0x4));var _0x376854=util['format'](_0x67cd('0x96'),_0x4be8d2,_0xde5469);var _0x1cb490=!![];if(_0x37aaf7[_0x67cd('0x123')]==='NOBEEP'){_0x1cb490=![];}var _0x377eaa=this[_0x67cd('0xc')][_0x67cd('0x124')](_0x4be8d2,_0xde5469,_0x37aaf7[_0x67cd('0x125')],_0x37aaf7[_0x67cd('0x66')],undefined,_0x1cb490);if(_0x377eaa[_0x67cd('0xa2')]!==-0x1){this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')]('google\x20%s\x20file\x20created',_0x376854));var _0x4ed50c=this[_0x67cd('0x126')][_0x67cd('0x9d')](this,_0x37aaf7,_0x376854);if(_0x4ed50c){for(var _0x3603bb in _0x4ed50c){if(_0x4ed50c[_0x67cd('0x8d')](_0x3603bb)){this['channel']['setVariable'](util[_0x67cd('0x26')](_0x67cd('0x127'),_0x3603bb['toUpperCase']()),_0x4ed50c[_0x3603bb]);}}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x128'),JSON[_0x67cd('0x73')](_0x4ed50c)));}}return _0x377eaa;};AGIVertices[_0x67cd('0x13')]['tildeasr']=function(_0x3bdc78){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x129'),_0x3bdc78['label']));if(!this[_0x67cd('0x81')](_0x3bdc78[_0x67cd('0x12a')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x12b'));}if(!this[_0x67cd('0x81')](_0x3bdc78[_0x67cd('0x12c')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x4f04ff=_0x67cd('0x121');var _0x1d5276=util['format'](_0x67cd('0x122'),FILES_PATH,rs['generate'](0x4));var _0x34bb13=util['format'](_0x67cd('0x96'),_0x1d5276,_0x4f04ff);var _0x169fd6=!![];if(_0x3bdc78[_0x67cd('0x123')]==='NOBEEP'){_0x169fd6=![];}var _0x588449=this['channel'][_0x67cd('0x124')](_0x1d5276,_0x4f04ff,_0x3bdc78[_0x67cd('0x125')],_0x3bdc78[_0x67cd('0x66')],undefined,_0x169fd6);if(_0x588449[_0x67cd('0xa2')]!==-0x1){this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x12d'),_0x34bb13));var _0x18b50b=this[_0x67cd('0x8a')][_0x67cd('0x9d')](this,_0x3bdc78,_0x34bb13);if(_0x18b50b){for(var _0x2d0cea in _0x18b50b){if(_0x18b50b[_0x67cd('0x8d')](_0x2d0cea)){this[_0x67cd('0xc')][_0x67cd('0x97')](util[_0x67cd('0x26')](_0x67cd('0x12e'),_0x2d0cea[_0x67cd('0x6a')]()),_0x18b50b[_0x2d0cea]);}}return this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x18b50b)));}}return _0x588449;};AGIVertices['prototype'][_0x67cd('0x12f')]=function(_0x341b02){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x130'),_0x341b02['label']));return this[_0x67cd('0xc')]['continueAt'](_0x341b02['context'],_0x341b02[_0x67cd('0x39')],_0x341b02[_0x67cd('0x3a')]);};AGIVertices[_0x67cd('0x13')][_0x67cd('0x131')]=function(_0x221695){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x132'),_0x221695[_0x67cd('0x32')]));if(!this['isConfigured'](_0x221695[_0x67cd('0x133')])){return this[_0x67cd('0xc')]['error'](_0x221695,'no\x20condition\x20configured');}try{var _0x3c1a26=eval(_0x221695[_0x67cd('0x133')])?_0x67cd('0x134'):'false';this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format'](_0x67cd('0x135'),_0x221695[_0x67cd('0x133')],_0x3c1a26));return{'code':0xc8,'result':_0x3c1a26};}catch(_0x756787){return{'code':0xc8,'result':_0x67cd('0x136')};}};AGIVertices[_0x67cd('0x13')][_0x67cd('0x137')]=function(_0x249d82){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x138'),_0x249d82['label']));if(!this['isConfigured'](_0x249d82['interval_id'])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x249d82,_0x67cd('0x139'));}var _0x3a097b=this[_0x67cd('0x22')]['sync'](this,_0x249d82[_0x67cd('0x13a')]);if(!_0x3a097b){return this['channel'][_0x67cd('0x29')](_0x249d82,_0x67cd('0x13b'));}for(var _0xb082fc=0x0;_0xb082fc<_0x3a097b[_0x67cd('0x94')];_0xb082fc+=0x1){var _0x469f2b=this[_0x67cd('0xc')][_0x67cd('0xd')](util[_0x67cd('0x26')](_0x67cd('0x13c'),_0x3a097b[_0xb082fc]));if(_0x469f2b[_0x67cd('0xa2')]===-0x1){return _0x469f2b;}logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x13d'),_0x3a097b[_0xb082fc],_0x469f2b[_0x67cd('0x9a')]));if(_0x469f2b[_0x67cd('0x9a')]===_0x67cd('0x134')){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x13d'),_0x3a097b[_0xb082fc],_0x67cd('0x134')));this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('IFTIME\x20%s\x20%s',_0x3a097b[_0xb082fc],_0x67cd('0x134')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x67cd('0x26')](_0x67cd('0x13d'),_0x3a097b[_0xb082fc],_0x67cd('0x136')));this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0x13d'),_0x3a097b[_0xb082fc],_0x67cd('0x136')));}}return{'code':0xc8,'result':_0x67cd('0x136')};};AGIVertices['prototype'][_0x67cd('0x13e')]=function(_0xb45cb0){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x13f'),_0xb45cb0[_0x67cd('0x32')]));return this[_0x67cd('0xc')][_0x67cd('0x13e')]();};AGIVertices[_0x67cd('0x13')][_0x67cd('0x140')]=function(_0x3d7520){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x141'),_0x3d7520[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x3d7520['key'])){return this[_0x67cd('0xc')]['noop'](_0x67cd('0xdc'));}var _0x56ab47='wav';var _0x5c3601=util['format'](_0x67cd('0x122'),FILES_PATH,rs[_0x67cd('0x112')](0x4));var _0x428fa3=util[_0x67cd('0x26')](_0x67cd('0x96'),_0x5c3601,_0x56ab47);var _0x1ad76a=!![];if(_0x3d7520[_0x67cd('0x123')]===_0x67cd('0x142')){_0x1ad76a=![];}var _0x4db08f=this[_0x67cd('0xc')][_0x67cd('0x124')](_0x5c3601,_0x56ab47,_0x3d7520[_0x67cd('0x125')],_0x3d7520[_0x67cd('0x66')],undefined,_0x1ad76a);if(_0x4db08f['result']!==-0x1){this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x143'),_0x428fa3));var _0x5d16ce=this[_0x67cd('0x80')][_0x67cd('0x9d')](this,_0x3d7520,_0x428fa3);if(_0x5d16ce){for(var _0x5ea6fc in _0x5d16ce){if(_0x5d16ce[_0x67cd('0x8d')](_0x5ea6fc)){this[_0x67cd('0xc')][_0x67cd('0x97')](util[_0x67cd('0x26')]('ISPEECH_ASR_%s',_0x5ea6fc[_0x67cd('0x6a')]()),_0x5d16ce[_0x5ea6fc]);}}return this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x144'),JSON[_0x67cd('0x73')](_0x5d16ce)));}}return _0x4db08f;};AGIVertices[_0x67cd('0x13')][_0x67cd('0x145')]=function(_0x8414e){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x8414e[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x8414e[_0x67cd('0x79')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')]('no\x20key\x20configured');}if(!this[_0x67cd('0x81')](_0x8414e[_0x67cd('0x5a')])){return this[_0x67cd('0xc')]['noop']('no\x20text\x20configured');}this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x146'),_0x8414e[_0x67cd('0x5a')]));var _0x17e292=this[_0x67cd('0x7e')][_0x67cd('0x9d')](this,_0x8414e);if(_0x17e292){this['channel']['noop'](util[_0x67cd('0x26')]('ispeech\x20%s\x20file\x20created',_0x17e292));var _0x407d28=this[_0x67cd('0xc')][_0x67cd('0xfb')](_0x17e292,_0x8414e[_0x67cd('0x125')]);try{fs[_0x67cd('0xfc')](_0x17e292+_0x67cd('0xfd'));}catch(_0x2bb045){logger[_0x67cd('0x29')](_0x2bb045);}return _0x407d28;}return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x8414e,_0x67cd('0x147'));};AGIVertices[_0x67cd('0x13')][_0x67cd('0x148')]=function(_0x3c9c53){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3c9c53[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x3c9c53['findBy'])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x3c9c53,'no\x20find\x20by\x20configured');}logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x149'),this[_0x67cd('0xc')]['callerid'],_0x3c9c53[_0x67cd('0x14a')]));var _0x170539=this[_0x67cd('0x52')]['sync'](this,_0x3c9c53[_0x67cd('0x14a')]);if(_0x170539){logger['info'](util[_0x67cd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x67cd('0xc')]['callerid'],_0x3c9c53[_0x67cd('0x14a')]));this['channel'][_0x67cd('0x9f')](util['format'](_0x67cd('0x14b'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x3c9c53[_0x67cd('0x14a')]));return{'code':0xc8,'result':_0x67cd('0x14c')};}else{logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x14d'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x3c9c53[_0x67cd('0x14a')]));this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format'](_0x67cd('0x14d'),this[_0x67cd('0xc')]['callerid'],_0x3c9c53[_0x67cd('0x14a')]));return{'code':0xc8,'result':_0x67cd('0x14e')};}};AGIVertices[_0x67cd('0x13')]['logout']=function(_0x314313){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x14f'),_0x314313['label']));if(!this['isConfigured'](_0x314313[_0x67cd('0x14a')])){return this['channel'][_0x67cd('0x29')](_0x314313,_0x67cd('0x150'));}logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x149'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x314313[_0x67cd('0x14a')]));var _0x4e605a=this[_0x67cd('0x4f')]['sync'](this,_0x314313['findBy']);if(_0x4e605a){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x14b'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x314313[_0x67cd('0x14a')]));this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x67cd('0xc')][_0x67cd('0x35')],_0x314313[_0x67cd('0x14a')]));return{'code':0xc8,'result':_0x67cd('0x14c')};}else{logger['info'](util[_0x67cd('0x26')](_0x67cd('0x14d'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x314313['findBy']));this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0x14d'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x314313[_0x67cd('0x14a')]));return{'code':0xc8,'result':_0x67cd('0x14e')};}};AGIVertices[_0x67cd('0x13')][_0x67cd('0x151')]=function(_0x544fd1){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x152'),_0x544fd1[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x544fd1[_0x67cd('0x153')])){return this[_0x67cd('0xc')]['error'](_0x544fd1,'no\x20operation\x20configured');}this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x154'),_0x544fd1[_0x67cd('0x153')]));var _0x378409=eval(_0x544fd1[_0x67cd('0x153')]);if(!this[_0x67cd('0x81')](_0x544fd1[_0x67cd('0x110')])){return this['channel'][_0x67cd('0x9f')](_0x67cd('0xca'));}var _0x4b50bc=this[_0x67cd('0xd')][_0x67cd('0x9d')](this,_0x544fd1[_0x67cd('0x110')]);if(!_0x4b50bc){return this['channel'][_0x67cd('0x29')](_0x544fd1,_0x67cd('0xcb'));}if(_[_0x67cd('0x93')](_0x378409)){var _0x515df9=this;_0x378409[_0x67cd('0xcc')](function(_0x2c932f,_0x45d0d3){_0x515df9[_0x67cd('0xc')][_0x67cd('0x97')](util['format'](_0x67cd('0x155'),_0x4b50bc,_0x45d0d3),_0x2c932f);});return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x156'),_0x4b50bc));}else{return this[_0x67cd('0xc')][_0x67cd('0x97')](_0x4b50bc,_0x378409);}};AGIVertices['prototype'][_0x67cd('0x157')]=function(_0x154bf2){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x158'),_0x154bf2[_0x67cd('0x32')]));if(_0x154bf2[_0x67cd('0x9e')]===0x0){return this[_0x67cd('0x9c')](_0x154bf2);}_0x154bf2['retry']-=0x1;if(!this[_0x67cd('0x81')](_0x154bf2[_0x67cd('0x159')])){return this['channel'][_0x67cd('0x29')](_0x154bf2,_0x67cd('0x10a'));}var _0x2e5b7b=this[_0x67cd('0x1d')][_0x67cd('0x9d')](this,_0x154bf2[_0x67cd('0x159')]);if(!_0x2e5b7b){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x154bf2,_0x67cd('0x10b'));}var _0x2d469b=this[_0x67cd('0xc')][_0x67cd('0x10c')](_0x2e5b7b,_0x154bf2[_0x67cd('0x10d')],_0x154bf2[_0x67cd('0x15a')]);var _0x5066e6=_0x2d469b['result'];if(_0x2d469b['result']===-0x1){this['createSquareDetailsReport'][_0x67cd('0x9d')](this,_0x154bf2,'-1');return _0x2d469b;}else if(_0x2d469b[_0x67cd('0x9a')]===_0x67cd('0x66')){_0x2d469b[_0x67cd('0xa2')]=_0x2d469b[_0x67cd('0xa2')][_0x67cd('0x94')]>0x0?_0x2d469b[_0x67cd('0xa2')]:'t';}else if(_['isEmpty'](_0x2d469b[_0x67cd('0xa2')])){_0x2d469b['result']='#';_0x5066e6='#';}if(!this[_0x67cd('0x81')](_0x154bf2[_0x67cd('0x110')])){this['channel']['noop'](_0x67cd('0xca'));}else{var _0x3ae373=this[_0x67cd('0xd')][_0x67cd('0x9d')](this,_0x154bf2[_0x67cd('0x110')]);if(!_0x3ae373){return this[_0x67cd('0xc')]['error'](_0x154bf2,_0x67cd('0xcb'));}this[_0x67cd('0xc')]['setVariable'](_0x3ae373,_0x5066e6);}this[_0x67cd('0x31')][_0x67cd('0x9d')](this,_0x154bf2,_0x5066e6);return _0x2d469b;};AGIVertices[_0x67cd('0x13')][_0x67cd('0x9f')]=function(_0x568664){logger['info'](util[_0x67cd('0x26')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x568664[_0x67cd('0x32')]));return this['channel']['noop'](_0x568664[_0x67cd('0x15b')]||_0x568664['label']);};AGIVertices[_0x67cd('0x13')][_0x67cd('0x15c')]=function(_0x10abe6){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x15d'),_0x10abe6[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x10abe6[_0x67cd('0x14a')])){return this['channel'][_0x67cd('0x29')](_0x10abe6,'no\x20find\x20by\x20configured');}logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x149'),this['channel']['callerid'],_0x10abe6[_0x67cd('0x14a')]));var _0x47f3b5=this[_0x67cd('0x4a')]['sync'](this,_0x10abe6['pause_id']);var _0x69fd75=this[_0x67cd('0x4c')][_0x67cd('0x9d')](this,_0x10abe6[_0x67cd('0x14a')],_0x47f3b5);if(_0x69fd75){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x14b'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x10abe6[_0x67cd('0x14a')]));this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format'](_0x67cd('0x14b'),this[_0x67cd('0xc')]['callerid'],_0x10abe6[_0x67cd('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x14d'),this['channel'][_0x67cd('0x35')],_0x10abe6['findBy']));this['channel'][_0x67cd('0x9f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x67cd('0x35')],_0x10abe6[_0x67cd('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x67cd('0x13')][_0x67cd('0x15e')]=function(_0x543487){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x15f'),_0x543487[_0x67cd('0x32')]));if(!this['isConfigured'](_0x543487[_0x67cd('0x159')])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x543487,'no\x20file\x20audio\x20selected');}var _0x5d3460=this[_0x67cd('0x1d')][_0x67cd('0x9d')](this,_0x543487['file_id']);if(!_0x5d3460){return this['channel'][_0x67cd('0x29')](_0x543487,_0x67cd('0x10b'));}var _0x38e3d3=this['channel'][_0x67cd('0x54')]('PLAYBACK',[_0x5d3460,_0x543487['opts']]);if(_0x38e3d3[_0x67cd('0xa2')]===-0x1){return _0x38e3d3;}return this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0x160'),'PLAYBACK',_0x5d3460));};AGIVertices[_0x67cd('0x13')][_0x67cd('0x161')]=function(_0xdf6a64){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x162'),_0xdf6a64[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0xdf6a64[_0x67cd('0x163')])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0xdf6a64,_0x67cd('0x164'));}var _0xc87f10='';var _0x745a55=parseInt(_0xdf6a64[_0x67cd('0x163')],0xa);if(isNaN(_0x745a55)){_0xc87f10=_0xdf6a64['queue_id'];}else{_0xc87f10=this[_0x67cd('0x14')][_0x67cd('0x9d')](this,_0xdf6a64['queue_id']);if(!_0xc87f10){return this['channel'][_0x67cd('0x29')](_0xdf6a64,_0x67cd('0x165'));}}var _0x1b0464='';if(this[_0x67cd('0x81')](_0xdf6a64[_0x67cd('0x159')])){var _0x136395=this['getSound'][_0x67cd('0x9d')](this,_0xdf6a64[_0x67cd('0x159')]);if(_0x136395){_0x1b0464=_0x136395;}}this['createSquareDetailsReport']['sync'](this,_0xdf6a64,_0xc87f10);if(_0xdf6a64[_0x67cd('0xd9')][_0x67cd('0x166')]('x')<0x0){_0xdf6a64[_0x67cd('0xd9')]+='x';}if(_0xdf6a64[_0x67cd('0xd9')]['indexOf']('X')<0x0){_0xdf6a64[_0x67cd('0xd9')]+='X';}this[_0x67cd('0xc')][_0x67cd('0x97')](_0x67cd('0x167'),_0xc87f10?_0xc87f10[_0x67cd('0x168')]():'');var _0x449772=this[_0x67cd('0xc')]['exec'](_0x67cd('0x169'),[_0xc87f10,_0xdf6a64[_0x67cd('0xd9')],_0xdf6a64['url'],_0x1b0464,_0xdf6a64[_0x67cd('0x66')],_0xdf6a64['agi'],_0xdf6a64[_0x67cd('0x16a')],_0xdf6a64[_0x67cd('0x16b')],'',_0xdf6a64['position']]);if(_0x449772[_0x67cd('0xa2')]===-0x1){return _0x449772;}return this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x160'),_0x67cd('0x169'),_0xc87f10));};AGIVertices['prototype']['record']=function(_0x5c9e39){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x16c'),_0x5c9e39['label']));var _0x5633d4=_0x5c9e39[_0x67cd('0x16d')]||_0x67cd('0x121');var _0x1b8708=util[_0x67cd('0x26')]('%s_%s',this[_0x67cd('0xc')][_0x67cd('0x3e')],rs[_0x67cd('0x112')](0x5));var _0x491fb6=util[_0x67cd('0x26')](_0x67cd('0x16e'),FILES_PATH,_0x1b8708,_0x5633d4);var _0x1809e8=util[_0x67cd('0x26')]('%s/recordings/%s',FILES_PATH,_0x1b8708);this[_0x67cd('0x36')][_0x67cd('0x9d')](this,_0x5c9e39,_0x1b8708,_0x491fb6);this['channel']['setVariable'](_0x67cd('0x16f'),_0x1b8708);logger[_0x67cd('0x2b')](_0x67cd('0x170'),_0x1809e8,_0x5633d4,_0x5c9e39[_0x67cd('0x171')],_0x5c9e39[_0x67cd('0x66')]);return this['channel'][_0x67cd('0x124')](_0x1809e8,_0x5633d4,_0x5c9e39[_0x67cd('0x171')],_0x5c9e39['timeout'],undefined,!![]);};AGIVertices[_0x67cd('0x13')]['restapi']=function(_0x326444){logger[_0x67cd('0x2b')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x326444[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x326444[_0x67cd('0x63')])){return this['channel'][_0x67cd('0x9f')](_0x67cd('0x172'));}var _0x129486=this[_0x67cd('0x62')]['sync'](this,_0x326444);logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x173'),util[_0x67cd('0x174')](_0x129486,{'showHidden':![],'depth':null})));if(!this[_0x67cd('0x81')](_0x326444[_0x67cd('0x110')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x175'));}var _0x71b92=this[_0x67cd('0xd')]['sync'](this,_0x326444[_0x67cd('0x110')]);if(!_0x71b92){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x326444,_0x67cd('0xcb'));}this[_0x67cd('0xc')]['setVariable'](util[_0x67cd('0x26')](_0x67cd('0x176'),_0x71b92),_0x129486[_0x67cd('0x74')]?_0x129486['statusCode']:'200');this['channel'][_0x67cd('0x97')](util[_0x67cd('0x26')]('%s_STATUS_MESSAGE',_0x71b92),_0x129486[_0x67cd('0x75')]?_0x129486[_0x67cd('0x75')]:'OK');if(_0x129486[_0x67cd('0x6b')]){try{this[_0x67cd('0x95')](_0x129486['body'],_0x71b92);}catch(_0x208d25){logger['error'](util[_0x67cd('0x26')](_0x67cd('0x177'),_0x71b92));}}return this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0xd0'),_0x71b92));};AGIVertices['prototype']['saydigits']=function(_0x456eb3){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x178'),_0x456eb3[_0x67cd('0x32')]));return this[_0x67cd('0xc')][_0x67cd('0x179')](_0x456eb3[_0x67cd('0x17a')][_0x67cd('0x56')](/\s+/g,''),_0x456eb3['escape_digits']);};AGIVertices['prototype'][_0x67cd('0x17b')]=function(_0x3f96a9){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x17c'),_0x3f96a9[_0x67cd('0x32')]));return this[_0x67cd('0xc')][_0x67cd('0x17d')](_0x3f96a9[_0x67cd('0x65')][_0x67cd('0x56')](/\s+/g,''),_0x3f96a9[_0x67cd('0x171')]);};AGIVertices[_0x67cd('0x13')][_0x67cd('0x17e')]=function(_0x144b94){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x17f'),_0x144b94[_0x67cd('0x32')]));return this[_0x67cd('0xc')]['sayPhonetic'](_0x144b94[_0x67cd('0x5a')],_0x144b94[_0x67cd('0x171')]);};AGIVertices['prototype'][_0x67cd('0x180')]=function(_0x12cf41){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x181'),_0x12cf41[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x12cf41[_0x67cd('0x182')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x183'));}var _0x16966c=this[_0x67cd('0x1f')][_0x67cd('0x9d')](this,_0x12cf41[_0x67cd('0x182')]);if(!_0x16966c||!_0x16966c[_0x67cd('0x184')]){return this[_0x67cd('0xc')]['error'](_0x12cf41,_0x67cd('0x185'));}var _0x1bd60f={'from':util[_0x67cd('0x26')](_0x67cd('0x186'),_0x16966c[_0x67cd('0x11')],_0x16966c[_0x67cd('0x187')]||_0x16966c[_0x67cd('0x184')][_0x67cd('0x188')]),'to':_0x12cf41['to']||'','cc':_0x12cf41['cc']||'','bcc':_0x12cf41['bcc']||'','subject':_0x12cf41[_0x67cd('0x189')],'html':_0x12cf41[_0x67cd('0x5a')],'text':_0x12cf41[_0x67cd('0x5a')]};if(this[_0x67cd('0x81')](_0x12cf41['template_id'])){}logger[_0x67cd('0xd2')](_0x67cd('0x18a'),JSON[_0x67cd('0x73')](_0x1bd60f));this['createSquareDetailsReport'][_0x67cd('0x9d')](this,_0x12cf41,_0x12cf41[_0x67cd('0x182')]);this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x16966c[_0x67cd('0x11')]));this[_0x67cd('0x18b')][_0x67cd('0x9d')](this,_0x16966c[_0x67cd('0x18c')],_0x1bd60f);return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x18d'));};AGIVertices['prototype'][_0x67cd('0x18e')]=function(_0x179c16){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x18f'),_0x179c16['label']));return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x190'));};AGIVertices['prototype'][_0x67cd('0x191')]=function(_0x14f178){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x192'),_0x14f178[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x14f178[_0x67cd('0x193')])){return this['channel'][_0x67cd('0x9f')](_0x67cd('0x194'));}var _0x4ba6e1=this[_0x67cd('0x195')][_0x67cd('0x9d')](this,_0x14f178[_0x67cd('0x193')]);if(!_0x4ba6e1){return this['channel'][_0x67cd('0x29')](_0x14f178,_0x67cd('0x196'));}var _0x27173b={'body':_0x14f178['sms_text'],'phone':_0x14f178['to']||'','SmsAccountId':_0x4ba6e1['id']};logger['debug']('sendSMS\x20message',JSON[_0x67cd('0x73')](_0x27173b));this['createSquareDetailsReport']['sync'](this,_0x14f178,_0x14f178['sms_account_id']);this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x197'),_0x4ba6e1['name']));this[_0x67cd('0x30')]['sync'](this,_0x27173b);return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x198'));};AGIVertices[_0x67cd('0x13')][_0x67cd('0x199')]=function(_0x42414e){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x19a'),_0x42414e[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x42414e[_0x67cd('0x110')])){return this['channel'][_0x67cd('0x29')](_0x42414e,_0x67cd('0x19b'));}var _0x4e23a6=this[_0x67cd('0xd')]['sync'](this,_0x42414e[_0x67cd('0x110')]);if(!_0x4e23a6){return this['channel']['error'](_0x42414e,'no\x20variable\x20found');}return this[_0x67cd('0xc')][_0x67cd('0x97')](_0x4e23a6,_0x42414e['variable_value']);};AGIVertices[_0x67cd('0x13')][_0x67cd('0x19c')]=function(_0x57f379){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x19d'),_0x57f379[_0x67cd('0x32')]));this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0x19e'));if(_0x57f379['answer']===_0x67cd('0x19f')){this['channel'][_0x67cd('0x9f')](_0x67cd('0x1a0'));return this[_0x67cd('0xc')][_0x67cd('0xb0')]();}return this[_0x67cd('0xc')][_0x67cd('0x9f')]('Skipped\x20Answer');};AGIVertices[_0x67cd('0x13')][_0x67cd('0x1a1')]=function(_0x32549){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x1a2'),_0x32549[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x32549[_0x67cd('0x1a3')])){return this['channel'][_0x67cd('0x29')](_0x32549,_0x67cd('0x1a4'));}var _0x251985=this[_0x67cd('0x16')][_0x67cd('0x9d')](this,_0x32549[_0x67cd('0x1a3')]);if(!this[_0x67cd('0x81')](_0x251985)){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x32549,util[_0x67cd('0x26')](_0x67cd('0x1a5'),_0x32549[_0x67cd('0x1a3')]));}if(_0x251985===this['channel'][_0x67cd('0x34')]){return this[_0x67cd('0xc')]['error'](_0x32549,_0x67cd('0x1a6'));}this['createSquareDetailsReport']['sync'](this,_0x32549,_0x251985);var _0x5e1504=this[_0x67cd('0xc')][_0x67cd('0x54')]('AGI',util['format'](_0x67cd('0x1a7'),config[_0x67cd('0xad')][_0x67cd('0x1a8')]||_0x67cd('0x1a9'),_0x251985,this[_0x67cd('0xc')][_0x67cd('0x34')]));if(_0x5e1504['result']===-0x1){return _0x5e1504;}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x160'),'AGI',_0x251985));};AGIVertices[_0x67cd('0x13')][_0x67cd('0x1aa')]=function(_0x187318){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x1ab'),_0x187318[_0x67cd('0x32')]));var _0x453d77=this['shellCommand']['sync'](this,_0x187318[_0x67cd('0xae')]);this[_0x67cd('0x31')][_0x67cd('0x9d')](this,_0x187318,_0x187318[_0x67cd('0xae')]);if(this[_0x67cd('0x81')](_0x187318[_0x67cd('0x110')])){var _0x4a3350=this[_0x67cd('0xd')][_0x67cd('0x9d')](this,_0x187318[_0x67cd('0x110')]);if(_0x4a3350){this['channel'][_0x67cd('0x97')](_0x4a3350,_0x453d77);return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x1ac'),_0x187318[_0x67cd('0xae')],_0x4a3350));}}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format'](_0x67cd('0x1ad'),_0x187318[_0x67cd('0xae')]));};AGIVertices[_0x67cd('0x13')][_0x67cd('0x1ae')]=function(_0x16f9a8){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x1af'),_0x16f9a8[_0x67cd('0x32')]));_0x16f9a8[_0x67cd('0x5a')]=_0x16f9a8[_0x67cd('0x5a')][_0x67cd('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x67cd('0x81')](_0x16f9a8[_0x67cd('0x58')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')]('no\x20apiKey\x20configured');}if(!this[_0x67cd('0x81')](_0x16f9a8[_0x67cd('0x5a')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')]('no\x20text\x20configured');}this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x1b0'),_0x16f9a8[_0x67cd('0x5a')]));var _0x202e70=this[_0x67cd('0x57')][_0x67cd('0x9d')](this,_0x16f9a8);if(_0x202e70){this[_0x67cd('0xc')][_0x67cd('0x9f')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x202e70));var _0x44dcf2=this[_0x67cd('0xc')][_0x67cd('0xfb')](_0x202e70);try{fs[_0x67cd('0xfc')](_0x202e70+'.wav');}catch(_0x4f9cc0){logger['error'](_0x4f9cc0);}return _0x44dcf2;}return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x16f9a8,_0x67cd('0x1b1'));};AGIVertices['prototype'][_0x67cd('0x1b2')]=function(_0x2264c8){logger['info'](util[_0x67cd('0x26')](_0x67cd('0x1b3'),_0x2264c8[_0x67cd('0x32')]));_0x2264c8[_0x67cd('0x5a')]=_0x2264c8['text'][_0x67cd('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2264c8[_0x67cd('0x5a')])){return this[_0x67cd('0xc')][_0x67cd('0x9f')](_0x67cd('0xa0'));}this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0x1b4'),_0x2264c8[_0x67cd('0x5a')]));var _0x22d0f8=this['googleTTS'][_0x67cd('0x9d')](this,_0x2264c8);if(_0x22d0f8){this['channel'][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x1b5'),_0x22d0f8));var _0x555842=this[_0x67cd('0xc')][_0x67cd('0xfb')](_0x22d0f8);try{fs[_0x67cd('0xfc')](_0x22d0f8+_0x67cd('0xfd'));}catch(_0x5de9e8){logger[_0x67cd('0x29')](_0x5de9e8);}return _0x555842;}return this[_0x67cd('0xc')]['error'](_0x2264c8,_0x67cd('0x1b6'));};AGIVertices[_0x67cd('0x13')][_0x67cd('0x1b7')]=function(_0x1a315f){logger['info'](util[_0x67cd('0x26')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x1a315f[_0x67cd('0x32')]));if(!this[_0x67cd('0x81')](_0x1a315f[_0x67cd('0x14a')])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x1a315f,_0x67cd('0x150'));}logger['info'](util[_0x67cd('0x26')](_0x67cd('0x149'),this['channel']['callerid'],_0x1a315f[_0x67cd('0x14a')]));var _0xf313a0=this[_0x67cd('0x4e')][_0x67cd('0x9d')](this,_0x1a315f['findBy']);if(_0xf313a0){logger[_0x67cd('0x2b')](util['format'](_0x67cd('0x14b'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x1a315f['findBy']));this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x14b'),this['channel'][_0x67cd('0x35')],_0x1a315f[_0x67cd('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x14d'),this[_0x67cd('0xc')][_0x67cd('0x35')],_0x1a315f[_0x67cd('0x14a')]));this[_0x67cd('0xc')]['noop'](util[_0x67cd('0x26')](_0x67cd('0x14d'),this['channel'][_0x67cd('0x35')],_0x1a315f[_0x67cd('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x67cd('0x13')][_0x67cd('0x1b8')]=function(_0x27e614){logger[_0x67cd('0x2b')](util[_0x67cd('0x26')](_0x67cd('0x1b9'),_0x27e614['label']));var _0x57e63a=this[_0x67cd('0xc')][_0x67cd('0x54')]('VOICEMAIL',[_0x27e614[_0x67cd('0x1ba')],_0x27e614[_0x67cd('0x77')]]);if(_0x57e63a[_0x67cd('0xa2')]===-0x1){return _0x57e63a;}return this[_0x67cd('0xc')][_0x67cd('0x9f')](util[_0x67cd('0x26')](_0x67cd('0x160'),'VOICEMAIL',_0x27e614[_0x67cd('0x1ba')]));};AGIVertices[_0x67cd('0x13')]['vswitch']=function(_0x2b1b0f){logger['info'](util['format'](_0x67cd('0x1bb'),_0x2b1b0f['label']));if(!this['isConfigured'](_0x2b1b0f[_0x67cd('0x110')])){return this[_0x67cd('0xc')][_0x67cd('0x29')](_0x2b1b0f,_0x67cd('0x19b'));}var _0x3177cc=this[_0x67cd('0xd')][_0x67cd('0x9d')](this,_0x2b1b0f[_0x67cd('0x110')]);if(!_0x3177cc){return this['channel'][_0x67cd('0x29')](_0x2b1b0f,'no\x20variable\x20found');}var _0x466561=this[_0x67cd('0xc')][_0x67cd('0xd')](_0x3177cc);return{'code':0xc8,'result':_0x466561[_0x67cd('0x9a')]?_0x466561[_0x67cd('0x9a')]:'-'};};String[_0x67cd('0x13')][_0x67cd('0x99')]=function(_0x389528,_0x24122f){return this[_0x67cd('0x98')](_0x389528)[_0x67cd('0x1bc')](_0x24122f);};module[_0x67cd('0x1bd')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index c860c19..0adecc8 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 _0x5749=['syncAgentConnect','hanguprequest','syncHangupRequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','updateAcw','lastPauseAt','update','uniqueid','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','catch','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect'];(function(_0x4d81ac,_0x80ada7){var _0xf3912=function(_0x41fc73){while(--_0x41fc73){_0x4d81ac['push'](_0x4d81ac['shift']());}};_0xf3912(++_0x80ada7);}(_0x5749,0x19c));var _0x9574=function(_0x4abe27,_0xe27446){_0x4abe27=_0x4abe27-0x0;var _0xbc9fe5=_0x5749[_0x4abe27];return _0xbc9fe5;};'use strict';var util=require(_0x9574('0x0'));var _=require(_0x9574('0x1'));var moment=require(_0x9574('0x2'));var ami=require(_0x9574('0x3'));var logger=require(_0x9574('0x4'))(_0x9574('0x5'));var RpcUser=require(_0x9574('0x6'));var RpcVoiceAgentReport=require(_0x9574('0x7'));function Acw(_0x173617){this[_0x9574('0x8')]=_0x173617[_0x9574('0x8')];this[_0x9574('0x9')]=_0x173617[_0x9574('0x9')];this[_0x9574('0xa')]=_0x173617[_0x9574('0xa')];this[_0x9574('0xb')]={};ami['on'](_0x9574('0xc'),this[_0x9574('0xd')]['bind'](this));ami['on'](_0x9574('0xe'),this[_0x9574('0xf')][_0x9574('0x10')](this));ami['on']('hangup',this[_0x9574('0x11')][_0x9574('0x10')](this));ami['on'](_0x9574('0x12'),this[_0x9574('0x13')][_0x9574('0x10')](this));ami['on'](_0x9574('0x14'),this[_0x9574('0x15')][_0x9574('0x10')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x9574('0x10')](this));ami['on'](_0x9574('0x16'),this['syncAgentConnectPreview'][_0x9574('0x10')](this));}function getDiff(_0x190707){var _0x527964=moment()['milliseconds'](0x0);var _0x594d8c=moment(_0x190707)[_0x9574('0x17')](0x0);return _0x527964[_0x9574('0x18')](_0x594d8c,_0x9574('0x19'));}Acw[_0x9574('0x1a')][_0x9574('0x1b')]=function(_0x34b1a9){try{var _0x31617f=this;var _0x1b7005=this[_0x9574('0xb')][_0x34b1a9][_0x9574('0x1c')];var _0x4f915a=this[_0x9574('0xb')][_0x34b1a9][_0x9574('0x1d')];var _0x558e68=this[_0x9574('0x8')][_0x4f915a];var _0x2eec23=![];var _0x5044f1=_0x9574('0x1e');if(_0x558e68[_0x9574('0x1f')]){if(_0x558e68[_0x9574('0x20')][_0x9574('0x21')]){_0x2eec23=!![];_0x5044f1=_0x558e68[_0x9574('0x20')][_0x9574('0x21')];}}ami[_0x9574('0x22')]({'action':'QueuePause','interface':_0x1b7005,'paused':!![],'reason':_0x5044f1})['then'](function(_0x253555){if(_0x31617f[_0x9574('0x9')][_0x1b7005]){return RpcUser[_0x9574('0x23')](_0x31617f[_0x9574('0x9')][_0x1b7005]['id'])[_0x9574('0x24')](function(_0x5c5bbf){if(_0x5c5bbf&&!_0x5c5bbf[_0x9574('0x25')]){logger[_0x9574('0x26')](_0x9574('0x27'),_0x34b1a9,_0x1b7005,_0x4f915a);var _0x48117b=_0x31617f[_0x9574('0xb')][_0x34b1a9]['attended']&&_0x31617f['channels'][_0x34b1a9]['destlinkedid']?_0x31617f[_0x9574('0xb')][_0x34b1a9][_0x9574('0x28')]:_0x34b1a9;return RpcUser[_0x9574('0x29')](_0x31617f['agents'][_0x1b7005],_0x5044f1,_0x48117b)[_0x9574('0x24')](function(_0x322395){if(!_0x2eec23){_0x31617f[_0x9574('0xa')][_0x1b7005]={};logger['info'](_0x9574('0x2a'),_0x34b1a9,_0x31617f[_0x9574('0x8')][_0x4f915a][_0x9574('0x2b')],_0x1b7005,_0x4f915a);_0x31617f[_0x9574('0xa')][_0x1b7005][_0x9574('0x2c')]=setTimeout(_0x31617f[_0x9574('0x2d')]['bind'](_0x31617f,_0x1b7005),_0x31617f[_0x9574('0x8')][_0x4f915a]['acwTimeout']*0x3e8);_0x31617f[_0x9574('0xa')][_0x1b7005]['lastPauseAt']=moment()[_0x9574('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x31617f[_0x9574('0xa')][_0x1b7005]['uniqueid']=_0x34b1a9;_0x31617f[_0x9574('0xa')][_0x1b7005][_0x9574('0x1d')]=_0x4f915a;_0x31617f['timers'][_0x1b7005][_0x9574('0x2f')]=function(){var _0x32bdb0=getDiff(_0x31617f['timers'][_0x1b7005][_0x9574('0x30')]);clearTimeout(_0x31617f[_0x9574('0xa')][_0x1b7005][_0x9574('0x2c')]);_0x31617f[_0x9574('0xa')][_0x1b7005][_0x9574('0x2c')]=![];RpcVoiceAgentReport[_0x9574('0x31')]({'acwtime':_0x32bdb0},_0x31617f[_0x9574('0xa')][_0x1b7005][_0x9574('0x32')],_0x1b7005)[_0x9574('0x24')](function(_0x2c2e80){logger[_0x9574('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x34b1a9,_0x32bdb0,_0x2c2e80);})['catch'](function(_0x5ee960){logger[_0x9574('0x33')](_0x9574('0x34'),_0x34b1a9,_0x5ee960);});delete _0x31617f[_0x9574('0xa')][_0x1b7005];};}});}else{logger[_0x9574('0x26')](_0x9574('0x35'),_0x34b1a9,_0x1b7005,_0x4f915a);}});}})['catch'](function(_0x22f5e2){logger[_0x9574('0x33')](_0x9574('0x2a'),_0x34b1a9,_0x31617f[_0x9574('0x8')][_0x4f915a][_0x9574('0x2b')],_0x1b7005,_0x4f915a);})['finally'](function(){delete _0x31617f[_0x9574('0xb')][_0x34b1a9];});}catch(_0x1e10b0){logger[_0x9574('0x33')]('[ACW][START]\x20%s',_0x1e10b0[_0x9574('0x36')]);}};Acw[_0x9574('0x1a')][_0x9574('0x2d')]=function(_0x117389){try{var _0x309d75=this;if(_0x309d75[_0x9574('0xa')][_0x117389]){_0x309d75['timers'][_0x117389][_0x9574('0x2c')]=![];var _0x475e9a=_0x309d75[_0x9574('0xa')][_0x117389][_0x9574('0x32')];var _0x5e6fd4=_0x309d75['timers'][_0x117389][_0x9574('0x1d')];var _0x1e8c5c=_0x309d75[_0x9574('0x8')][_0x5e6fd4][_0x9574('0x2b')];logger[_0x9574('0x26')](_0x9574('0x37'),_0x475e9a,_0x117389);RpcUser[_0x9574('0x38')](this[_0x9574('0x9')][_0x117389]);RpcVoiceAgentReport[_0x9574('0x31')]({'acwtime':_0x1e8c5c,'agentacw':!![]},_0x475e9a,_0x117389)[_0x9574('0x24')](function(_0x2010f0){logger['info'](_0x9574('0x39'),_0x475e9a,_0x1e8c5c,_0x2010f0);})[_0x9574('0x3a')](function(_0x33316f){logger['error'](_0x9574('0x34'),_0x475e9a,_0x33316f);});}else{logger[_0x9574('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x117389);if(_0x309d75['timers']){logger[_0x9574('0x26')](_0x9574('0x3b'),JSON['stringify'](_0x309d75['timers']));}}}catch(_0x210b0c){logger[_0x9574('0x33')](_0x9574('0x3c'),_0x210b0c[_0x9574('0x36')]);}};Acw[_0x9574('0x1a')][_0x9574('0xd')]=function(_0x2e5e84){try{if(this[_0x9574('0x8')][_0x2e5e84[_0x9574('0x1d')]]&&(this[_0x9574('0x8')][_0x2e5e84[_0x9574('0x1d')]]['acw']||this[_0x9574('0x8')][_0x2e5e84['queue']][_0x9574('0x1f')])){if(this[_0x9574('0x9')][_0x2e5e84['interface']]){this[_0x9574('0xb')][_0x2e5e84['uniqueid']]={'queue':_0x2e5e84[_0x9574('0x1d')],'interface':_0x2e5e84[_0x9574('0x1c')],'destlinkedid':_0x2e5e84[_0x9574('0x28')]};}}}catch(_0x217cd4){logger[_0x9574('0x33')](_0x9574('0x3d'),_0x217cd4[_0x9574('0x36')]);}};Acw[_0x9574('0x1a')][_0x9574('0x3e')]=function(_0x2db7b2){try{if(this[_0x9574('0x8')][_0x2db7b2['queue']]&&(this['voiceQueues'][_0x2db7b2[_0x9574('0x1d')]][_0x9574('0x5')]||this[_0x9574('0x8')][_0x2db7b2[_0x9574('0x1d')]][_0x9574('0x1f')])){if(this[_0x9574('0x9')][_0x2db7b2[_0x9574('0x1c')]]){this[_0x9574('0xb')][_0x2db7b2[_0x9574('0x32')]]={'queue':_0x2db7b2[_0x9574('0x1d')],'interface':_0x2db7b2[_0x9574('0x1c')]};}}}catch(_0x2dfa6f){logger[_0x9574('0x33')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2dfa6f[_0x9574('0x36')]);}};Acw['prototype']['syncHangupRequest']=function(_0x3102e0){try{if(this[_0x9574('0xb')][_0x3102e0[_0x9574('0x32')]]&&_[_0x9574('0x3f')](this[_0x9574('0xb')][_0x3102e0[_0x9574('0x32')]][_0x9574('0x40')])){logger['info'](_0x9574('0x41'),_0x3102e0['uniqueid']);this[_0x9574('0x1b')](_0x3102e0[_0x9574('0x32')]);}else if(this['channels'][_0x3102e0['linkedid']]&&_[_0x9574('0x3f')](this[_0x9574('0xb')][_0x3102e0[_0x9574('0x42')]][_0x9574('0x40')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x3102e0[_0x9574('0x42')]);this[_0x9574('0x1b')](_0x3102e0[_0x9574('0x42')]);}}catch(_0x49b1dd){logger[_0x9574('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x49b1dd[_0x9574('0x36')]);}};Acw[_0x9574('0x1a')][_0x9574('0x11')]=function(_0x4f527a){try{if(this[_0x9574('0xb')][_0x4f527a[_0x9574('0x32')]]&&this[_0x9574('0xb')][_0x4f527a['uniqueid']][_0x9574('0x40')]){logger[_0x9574('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4f527a[_0x9574('0x32')]);this[_0x9574('0x1b')](_0x4f527a[_0x9574('0x32')]);}else if(this[_0x9574('0xb')][_0x4f527a[_0x9574('0x42')]]&&this[_0x9574('0xb')][_0x4f527a['linkedid']]['attended']){logger[_0x9574('0x26')](_0x9574('0x43'),_0x4f527a[_0x9574('0x42')]);this[_0x9574('0x1b')](_0x4f527a['linkedid']);}}catch(_0x17f991){logger[_0x9574('0x33')]('[ACW][syncHangup]\x20%s',_0x17f991['message']);}};Acw[_0x9574('0x1a')][_0x9574('0x15')]=function(_0x5aaf2e){try{if(!_[_0x9574('0x44')](this[_0x9574('0xb')][_0x5aaf2e[_0x9574('0x45')]])){this[_0x9574('0x1b')](_0x5aaf2e['transfereeuniqueid']);if(this[_0x9574('0xb')][_0x5aaf2e[_0x9574('0x46')]]){this['channels'][_0x5aaf2e[_0x9574('0x46')]]['attended']=!![];this['channels'][_0x5aaf2e[_0x9574('0x47')]]=this[_0x9574('0xb')][_0x5aaf2e[_0x9574('0x46')]];delete this[_0x9574('0xb')][_0x5aaf2e[_0x9574('0x46')]];}}else if(!_[_0x9574('0x44')](this[_0x9574('0xb')][_0x5aaf2e[_0x9574('0x47')]])){this[_0x9574('0x1b')](_0x5aaf2e[_0x9574('0x47')]);if(this['channels'][_0x5aaf2e[_0x9574('0x48')]]){this[_0x9574('0xb')][_0x5aaf2e[_0x9574('0x48')]][_0x9574('0x40')]=!![];this['channels'][_0x5aaf2e['transfereeuniqueid']]=this[_0x9574('0xb')][_0x5aaf2e[_0x9574('0x48')]];delete this[_0x9574('0xb')][_0x5aaf2e[_0x9574('0x48')]];}}}catch(_0xd132fd){logger[_0x9574('0x33')](_0x9574('0x49'),_0xd132fd[_0x9574('0x36')]);}};Acw[_0x9574('0x1a')]['syncBlindTransfer']=function(_0x4ebacd){try{if(this[_0x9574('0xb')][_0x4ebacd['transfereruniqueid']]){logger[_0x9574('0x26')](_0x9574('0x4a'),JSON[_0x9574('0x4b')](_0x4ebacd['transfereruniqueid']));this[_0x9574('0x1b')](_0x4ebacd[_0x9574('0x4c')]);}else if(this['channels'][_0x4ebacd[_0x9574('0x4d')]]){logger[_0x9574('0x26')](_0x9574('0x4e'),JSON['stringify'](_0x4ebacd[_0x9574('0x4d')]));this[_0x9574('0x1b')](_0x4ebacd['transfererlinkedid']);}}catch(_0xe9b05e){logger['error'](_0x9574('0x4f'),_0xe9b05e['message']);}};Acw[_0x9574('0x1a')][_0x9574('0x13')]=function(_0x28f312){try{if(this[_0x9574('0x8')][_0x28f312[_0x9574('0x1d')]]&&this[_0x9574('0x8')][_0x28f312[_0x9574('0x1d')]][_0x9574('0x50')]===_0x9574('0x51')){if(this[_0x9574('0x9')][_0x28f312['interface']]){logger[_0x9574('0x26')](_0x9574('0x52'),_0x28f312['uniqueid'],_0x28f312[_0x9574('0x1c')],_0x28f312[_0x9574('0x1d')]);return RpcUser[_0x9574('0x29')](this[_0x9574('0x9')][_0x28f312[_0x9574('0x1c')]],_0x9574('0x53'),_0x28f312[_0x9574('0x32')]);}}}catch(_0x31e33a){logger['error'](_0x9574('0x54'),_0x31e33a['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x5271=['[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','destlinkedid','info','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','[ACW][START]\x20%s','message','prototype','queue','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid'];(function(_0x5c7aa1,_0x2a9324){var _0x11a615=function(_0x3f75d4){while(--_0x3f75d4){_0x5c7aa1['push'](_0x5c7aa1['shift']());}};_0x11a615(++_0x2a9324);}(_0x5271,0x64));var _0x1527=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x5271[_0x4ae829];return _0x256b31;};'use strict';var util=require('util');var _=require(_0x1527('0x0'));var moment=require(_0x1527('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x1527('0x2'));var RpcUser=require(_0x1527('0x3'));var RpcVoiceAgentReport=require(_0x1527('0x4'));function Acw(_0x2077d8){this['voiceQueues']=_0x2077d8[_0x1527('0x5')];this[_0x1527('0x6')]=_0x2077d8[_0x1527('0x6')];this[_0x1527('0x7')]=_0x2077d8[_0x1527('0x7')];this[_0x1527('0x8')]={};ami['on'](_0x1527('0x9'),this[_0x1527('0xa')][_0x1527('0xb')](this));ami['on'](_0x1527('0xc'),this[_0x1527('0xd')][_0x1527('0xb')](this));ami['on'](_0x1527('0xe'),this[_0x1527('0xf')][_0x1527('0xb')](this));ami['on'](_0x1527('0x10'),this[_0x1527('0x11')]['bind'](this));ami['on']('attendedtransfer',this[_0x1527('0x12')][_0x1527('0xb')](this));ami['on'](_0x1527('0x13'),this['syncBlindTransfer'][_0x1527('0xb')](this));ami['on'](_0x1527('0x14'),this[_0x1527('0x15')][_0x1527('0xb')](this));}function getDiff(_0x3c962b){var _0x42a24e=moment()['milliseconds'](0x0);var _0x43cb3a=moment(_0x3c962b)[_0x1527('0x16')](0x0);return _0x42a24e[_0x1527('0x17')](_0x43cb3a,_0x1527('0x18'));}Acw['prototype'][_0x1527('0x19')]=function(_0x5831f0){try{var _0x4c77af=this;var _0x58797b=this['channels'][_0x5831f0][_0x1527('0x1a')];var _0x2e2266=this[_0x1527('0x8')][_0x5831f0]['queue'];var _0x1b2bdd=this[_0x1527('0x5')][_0x2e2266];var _0x532333=![];var _0x485297=_0x1527('0x1b');if(_0x1b2bdd[_0x1527('0x1c')]){if(_0x1b2bdd[_0x1527('0x1d')][_0x1527('0x1e')]){_0x532333=!![];_0x485297=_0x1b2bdd[_0x1527('0x1d')][_0x1527('0x1e')];}}ami[_0x1527('0x1f')]({'action':_0x1527('0x20'),'interface':_0x58797b,'paused':!![],'reason':_0x485297})[_0x1527('0x21')](function(_0x27a2ab){if(_0x4c77af['agents'][_0x58797b]){return RpcUser['getAgent'](_0x4c77af[_0x1527('0x6')][_0x58797b]['id'])[_0x1527('0x21')](function(_0x8f84ae){if(_0x8f84ae&&!_0x8f84ae[_0x1527('0x22')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x5831f0,_0x58797b,_0x2e2266);var _0x1958a9=_0x4c77af[_0x1527('0x8')][_0x5831f0]['attended']&&_0x4c77af[_0x1527('0x8')][_0x5831f0][_0x1527('0x23')]?_0x4c77af['channels'][_0x5831f0][_0x1527('0x23')]:_0x5831f0;return RpcUser['savePause'](_0x4c77af['agents'][_0x58797b],_0x485297,_0x1958a9)[_0x1527('0x21')](function(_0x5c13e0){if(!_0x532333){_0x4c77af[_0x1527('0x7')][_0x58797b]={};logger[_0x1527('0x24')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5831f0,_0x4c77af[_0x1527('0x5')][_0x2e2266]['acwTimeout'],_0x58797b,_0x2e2266);_0x4c77af[_0x1527('0x7')][_0x58797b][_0x1527('0x25')]=setTimeout(_0x4c77af[_0x1527('0x26')][_0x1527('0xb')](_0x4c77af,_0x58797b),_0x4c77af[_0x1527('0x5')][_0x2e2266]['acwTimeout']*0x3e8);_0x4c77af[_0x1527('0x7')][_0x58797b][_0x1527('0x27')]=moment()['format'](_0x1527('0x28'));_0x4c77af[_0x1527('0x7')][_0x58797b][_0x1527('0x29')]=_0x5831f0;_0x4c77af[_0x1527('0x7')][_0x58797b]['queue']=_0x2e2266;_0x4c77af[_0x1527('0x7')][_0x58797b][_0x1527('0x2a')]=function(){var _0x379652=getDiff(_0x4c77af['timers'][_0x58797b]['lastPauseAt']);clearTimeout(_0x4c77af[_0x1527('0x7')][_0x58797b][_0x1527('0x25')]);_0x4c77af[_0x1527('0x7')][_0x58797b][_0x1527('0x25')]=![];RpcVoiceAgentReport[_0x1527('0x2b')]({'acwtime':_0x379652},_0x4c77af[_0x1527('0x7')][_0x58797b]['uniqueid'],_0x58797b)[_0x1527('0x21')](function(_0xa1dada){logger[_0x1527('0x24')](_0x1527('0x2c'),_0x5831f0,_0x379652,_0xa1dada);})[_0x1527('0x2d')](function(_0x261409){logger[_0x1527('0x2e')](_0x1527('0x2f'),_0x5831f0,_0x261409);});delete _0x4c77af[_0x1527('0x7')][_0x58797b];};}});}else{logger[_0x1527('0x24')](_0x1527('0x30'),_0x5831f0,_0x58797b,_0x2e2266);}});}})[_0x1527('0x2d')](function(_0x31d29a){logger[_0x1527('0x2e')](_0x1527('0x31'),_0x5831f0,_0x4c77af[_0x1527('0x5')][_0x2e2266][_0x1527('0x32')],_0x58797b,_0x2e2266);})['finally'](function(){delete _0x4c77af[_0x1527('0x8')][_0x5831f0];});}catch(_0x5c6e9e){logger['error'](_0x1527('0x33'),_0x5c6e9e[_0x1527('0x34')]);}};Acw[_0x1527('0x35')]['stopAcw']=function(_0x2bf46a){try{var _0x2812be=this;if(_0x2812be[_0x1527('0x7')][_0x2bf46a]){_0x2812be[_0x1527('0x7')][_0x2bf46a][_0x1527('0x25')]=![];var _0x344093=_0x2812be[_0x1527('0x7')][_0x2bf46a][_0x1527('0x29')];var _0x1908a8=_0x2812be[_0x1527('0x7')][_0x2bf46a][_0x1527('0x36')];var _0x3add67=_0x2812be[_0x1527('0x5')][_0x1908a8][_0x1527('0x32')];logger[_0x1527('0x24')](_0x1527('0x37'),_0x344093,_0x2bf46a);RpcUser['saveUnpause'](this[_0x1527('0x6')][_0x2bf46a]);RpcVoiceAgentReport[_0x1527('0x2b')]({'acwtime':_0x3add67,'agentacw':!![]},_0x344093,_0x2bf46a)[_0x1527('0x21')](function(_0x59e0bb){logger[_0x1527('0x24')](_0x1527('0x2c'),_0x344093,_0x3add67,_0x59e0bb);})['catch'](function(_0x3471ed){logger[_0x1527('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x344093,_0x3471ed);});}else{logger[_0x1527('0x2e')](_0x1527('0x38'),_0x2bf46a);if(_0x2812be[_0x1527('0x7')]){logger[_0x1527('0x24')]('[ACW][TIMERS]',JSON['stringify'](_0x2812be[_0x1527('0x7')]));}}}catch(_0x1be580){logger[_0x1527('0x2e')](_0x1527('0x39'),_0x1be580[_0x1527('0x34')]);}};Acw['prototype'][_0x1527('0xa')]=function(_0x40c660){try{if(this[_0x1527('0x5')][_0x40c660[_0x1527('0x36')]]&&(this['voiceQueues'][_0x40c660[_0x1527('0x36')]][_0x1527('0x2')]||this[_0x1527('0x5')][_0x40c660[_0x1527('0x36')]]['mandatoryDisposition'])){if(this[_0x1527('0x6')][_0x40c660['interface']]){this[_0x1527('0x8')][_0x40c660[_0x1527('0x29')]]={'queue':_0x40c660['queue'],'interface':_0x40c660[_0x1527('0x1a')],'destlinkedid':_0x40c660[_0x1527('0x23')]};}}}catch(_0x5ec13e){logger[_0x1527('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x5ec13e[_0x1527('0x34')]);}};Acw[_0x1527('0x35')]['syncAgentConnectPreview']=function(_0x244235){try{if(this[_0x1527('0x5')][_0x244235[_0x1527('0x36')]]&&(this[_0x1527('0x5')][_0x244235[_0x1527('0x36')]][_0x1527('0x2')]||this[_0x1527('0x5')][_0x244235['queue']]['mandatoryDisposition'])){if(this[_0x1527('0x6')][_0x244235[_0x1527('0x1a')]]){this['channels'][_0x244235[_0x1527('0x29')]]={'queue':_0x244235['queue'],'interface':_0x244235[_0x1527('0x1a')]};}}}catch(_0x3ff667){logger['error'](_0x1527('0x3a'),_0x3ff667[_0x1527('0x34')]);}};Acw[_0x1527('0x35')][_0x1527('0xd')]=function(_0x243c3b){try{if(this['channels'][_0x243c3b[_0x1527('0x29')]]&&_[_0x1527('0x3b')](this[_0x1527('0x8')][_0x243c3b[_0x1527('0x29')]][_0x1527('0x3c')])){logger[_0x1527('0x24')](_0x1527('0x3d'),_0x243c3b['uniqueid']);this['startAcw'](_0x243c3b['uniqueid']);}else if(this[_0x1527('0x8')][_0x243c3b[_0x1527('0x3e')]]&&_[_0x1527('0x3b')](this[_0x1527('0x8')][_0x243c3b['linkedid']][_0x1527('0x3c')])){logger[_0x1527('0x24')](_0x1527('0x3f'),_0x243c3b[_0x1527('0x3e')]);this['startAcw'](_0x243c3b[_0x1527('0x3e')]);}}catch(_0x376e9b){logger['error'](_0x1527('0x40'),_0x376e9b[_0x1527('0x34')]);}};Acw[_0x1527('0x35')][_0x1527('0xf')]=function(_0x22a73b){try{if(this[_0x1527('0x8')][_0x22a73b[_0x1527('0x29')]]&&this['channels'][_0x22a73b[_0x1527('0x29')]]['attended']){logger['info'](_0x1527('0x41'),_0x22a73b['uniqueid']);this['startAcw'](_0x22a73b[_0x1527('0x29')]);}else if(this[_0x1527('0x8')][_0x22a73b['linkedid']]&&this[_0x1527('0x8')][_0x22a73b[_0x1527('0x3e')]][_0x1527('0x3c')]){logger['info'](_0x1527('0x42'),_0x22a73b[_0x1527('0x3e')]);this[_0x1527('0x19')](_0x22a73b[_0x1527('0x3e')]);}}catch(_0x6227db){logger[_0x1527('0x2e')]('[ACW][syncHangup]\x20%s',_0x6227db[_0x1527('0x34')]);}};Acw[_0x1527('0x35')][_0x1527('0x12')]=function(_0x3e2643){try{if(!_[_0x1527('0x43')](this[_0x1527('0x8')][_0x3e2643[_0x1527('0x44')]])){this[_0x1527('0x19')](_0x3e2643[_0x1527('0x44')]);if(this[_0x1527('0x8')][_0x3e2643['secondtransfereruniqueid']]){this[_0x1527('0x8')][_0x3e2643[_0x1527('0x45')]][_0x1527('0x3c')]=!![];this[_0x1527('0x8')][_0x3e2643[_0x1527('0x46')]]=this[_0x1527('0x8')][_0x3e2643[_0x1527('0x45')]];delete this[_0x1527('0x8')][_0x3e2643[_0x1527('0x45')]];}}else if(!_['isNil'](this[_0x1527('0x8')][_0x3e2643[_0x1527('0x46')]])){this[_0x1527('0x19')](_0x3e2643[_0x1527('0x46')]);if(this[_0x1527('0x8')][_0x3e2643[_0x1527('0x47')]]){this[_0x1527('0x8')][_0x3e2643[_0x1527('0x47')]][_0x1527('0x3c')]=!![];this[_0x1527('0x8')][_0x3e2643[_0x1527('0x44')]]=this[_0x1527('0x8')][_0x3e2643[_0x1527('0x47')]];delete this[_0x1527('0x8')][_0x3e2643[_0x1527('0x47')]];}}}catch(_0x390f62){logger[_0x1527('0x2e')](_0x1527('0x48'),_0x390f62[_0x1527('0x34')]);}};Acw['prototype'][_0x1527('0x49')]=function(_0x535d1f){try{if(this[_0x1527('0x8')][_0x535d1f['transfereruniqueid']]){logger[_0x1527('0x24')](_0x1527('0x4a'),JSON[_0x1527('0x4b')](_0x535d1f[_0x1527('0x4c')]));this[_0x1527('0x19')](_0x535d1f[_0x1527('0x4c')]);}else if(this[_0x1527('0x8')][_0x535d1f[_0x1527('0x4d')]]){logger['info'](_0x1527('0x4e'),JSON[_0x1527('0x4b')](_0x535d1f[_0x1527('0x4d')]));this['startAcw'](_0x535d1f[_0x1527('0x4d')]);}}catch(_0xae4b55){logger[_0x1527('0x2e')]('[ACW][syncBlindTransfer]\x20%s',_0xae4b55[_0x1527('0x34')]);}};Acw[_0x1527('0x35')][_0x1527('0x11')]=function(_0x13284a){try{if(this[_0x1527('0x5')][_0x13284a['queue']]&&this[_0x1527('0x5')][_0x13284a[_0x1527('0x36')]][_0x1527('0x4f')]===_0x1527('0x50')){if(this['agents'][_0x13284a[_0x1527('0x1a')]]){logger[_0x1527('0x24')](_0x1527('0x51'),_0x13284a[_0x1527('0x29')],_0x13284a[_0x1527('0x1a')],_0x13284a['queue']);return RpcUser[_0x1527('0x52')](this['agents'][_0x13284a[_0x1527('0x1a')]],_0x1527('0x53'),_0x13284a[_0x1527('0x29')]);}}}catch(_0x4ee300){logger[_0x1527('0x2e')](_0x1527('0x54'),_0x4ee300[_0x1527('0x34')]);}};module[_0x1527('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 02168dd..95e786d 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 _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x60d867,_0x468004){var _0x2525d7=function(_0x1bcc28){while(--_0x1bcc28){_0x60d867['push'](_0x60d867['shift']());}};_0x2525d7(++_0x468004);}(_0x757a,0xde));var _0xa757=function(_0x51e826,_0x9739e1){_0x51e826=_0x51e826-0x0;var _0x20b750=_0x757a[_0x51e826];return _0x20b750;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file +var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x277c93,_0x33a8bb){var _0x1bc988=function(_0x4c1ffb){while(--_0x4c1ffb){_0x277c93['push'](_0x277c93['shift']());}};_0x1bc988(++_0x33a8bb);}(_0x757a,0xde));var _0xa757=function(_0x1a9ffc,_0x2f33ac){_0x1a9ffc=_0x1a9ffc-0x0;var _0x1d66bc=_0x757a[_0x1a9ffc];return _0x1d66bc;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 177409a..94d3b97 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x12dfeb,_0x3fe94f){var _0x3f2fb8=function(_0x2770e5){while(--_0x2770e5){_0x12dfeb['push'](_0x12dfeb['shift']());}};_0x3f2fb8(++_0x3fe94f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0xb6c17a,_0x5dd9ac){var _0x1078c0=function(_0x26bdf4){while(--_0x26bdf4){_0xb6c17a['push'](_0xb6c17a['shift']());}};_0x1078c0(++_0x5dd9ac);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3e8082,_0x481707){_0x3e8082=_0x3e8082-0x0;var _0x58794=_0xbdb7[_0x3e8082];return _0x58794;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 08d372b..f33742b 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f46=['exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','prototype','dialCutDigit','substring'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x0f46,0x17b));var _0x60f4=function(_0x3ee933,_0x50c185){_0x3ee933=_0x3ee933-0x0;var _0x186732=_0x0f46[_0x3ee933];return _0x186732;};'use strict';var util=require(_0x60f4('0x0'));var _=require(_0x60f4('0x1'));var moment=require(_0x60f4('0x2'));function checkNameSurname(_0x25baba,_0x21995d,_0x13e1e1){var _0x427159='';if(!_[_0x60f4('0x3')](_0x21995d)&&'string'===typeof _0x21995d){_0x427159+=_0x21995d;}if(!_['isNil'](_0x13e1e1)&&_0x60f4('0x4')===typeof _0x13e1e1){_0x427159+='\x20'+_0x13e1e1;}if(_0x427159!==''){return _0x427159;}return _0x25baba;}function Action(_0xe28acd,_0x19f242,_0x7396fa){this[_0x60f4('0x5')]=_0xe28acd;this[_0x60f4('0x6')]=_0x7396fa||undefined;this[_0x60f4('0x7')]=checkNameSurname(_0x19f242[_0x60f4('0x8')][_0x60f4('0x9')],_0x19f242[_0x60f4('0x8')][_0x60f4('0xa')],_0x19f242[_0x60f4('0x8')][_0x60f4('0xb')]);this[_0x60f4('0xc')]=_0x19f242[_0x60f4('0x9')];this[_0x60f4('0xd')]=_0xe28acd[_0x60f4('0x7')];this[_0x60f4('0xe')]=_0x19f242[_0x60f4('0xe')]||![];this[_0x60f4('0xf')]=_0xe28acd[_0x60f4('0xf')];this[_0x60f4('0x10')]=_0xe28acd[_0x60f4('0x10')]||0x3;this[_0x60f4('0x11')]=_0x19f242['scheduledat'];this['countbusyretry']=_0x19f242['countbusyretry'];this[_0x60f4('0x12')]=_0x19f242[_0x60f4('0x12')];this['countnoanswerretry']=_0x19f242[_0x60f4('0x13')];this[_0x60f4('0x14')]=_0x19f242[_0x60f4('0x14')];this[_0x60f4('0x15')]=_0x19f242[_0x60f4('0x15')];this[_0x60f4('0x16')]=_0x19f242['countabandonedretry'];this[_0x60f4('0x17')]=_0x19f242[_0x60f4('0x17')];this[_0x60f4('0x18')]=_0x19f242[_0x60f4('0x18')];this[_0x60f4('0x19')]=_0x19f242[_0x60f4('0x19')];this['ListId']=_0x19f242[_0x60f4('0x1a')];this[_0x60f4('0x1b')]=_0x19f242[_0x60f4('0x1b')];this['VoiceQueueId']=_0x19f242[_0x60f4('0x1c')];this[_0x60f4('0x1d')]=_0x19f242['CampaignId'];this[_0x60f4('0x1e')]=_0x19f242['id'];this[_0x60f4('0x1f')]=_0x19f242[_0x60f4('0x8')]['firstName']||'';this[_0x60f4('0x20')]=moment()[_0x60f4('0x21')](_0x60f4('0x22'));this[_0x60f4('0x23')]=_0x19f242[_0x60f4('0x23')];this['callbackuniqueid']=_0x19f242[_0x60f4('0x24')];this['callbackat']=_0x19f242['callbackat'];this[_0x60f4('0x25')]=_0x19f242[_0x60f4('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x60f4('0x26')]['getCaller']=function(){return util[_0x60f4('0x21')]('\x22%s\x22\x20<%s>',this[_0x60f4('0x7')],this[_0x60f4('0x5')][_0x60f4('0x27')]>0x0?this['number'][_0x60f4('0x28')](this['voiceQueue'][_0x60f4('0x27')]):this['number']);};Action[_0x60f4('0x26')]['getQueue']=function(){return this[_0x60f4('0xd')];};module[_0x60f4('0x29')]=Action; \ No newline at end of file +var _0x7ab3=['number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName'];(function(_0x40e9ca,_0x364f4e){var _0x1f0e98=function(_0x5cb13a){while(--_0x5cb13a){_0x40e9ca['push'](_0x40e9ca['shift']());}};_0x1f0e98(++_0x364f4e);}(_0x7ab3,0x11c));var _0x37ab=function(_0x553145,_0x4f9ab8){_0x553145=_0x553145-0x0;var _0x11cfbd=_0x7ab3[_0x553145];return _0x11cfbd;};'use strict';var util=require('util');var _=require(_0x37ab('0x0'));var moment=require(_0x37ab('0x1'));function checkNameSurname(_0x11a4c7,_0x2eefc9,_0x222359){var _0x454819='';if(!_[_0x37ab('0x2')](_0x2eefc9)&&_0x37ab('0x3')===typeof _0x2eefc9){_0x454819+=_0x2eefc9;}if(!_[_0x37ab('0x2')](_0x222359)&&'string'===typeof _0x222359){_0x454819+='\x20'+_0x222359;}if(_0x454819!==''){return _0x454819;}return _0x11a4c7;}function Action(_0x87ebc3,_0x39cd4c,_0x36bcfb){this[_0x37ab('0x4')]=_0x87ebc3;this[_0x37ab('0x5')]=_0x36bcfb||undefined;this[_0x37ab('0x6')]=checkNameSurname(_0x39cd4c[_0x37ab('0x7')][_0x37ab('0x8')],_0x39cd4c['Contact'][_0x37ab('0x9')],_0x39cd4c[_0x37ab('0x7')]['lastName']);this[_0x37ab('0xa')]=_0x39cd4c[_0x37ab('0x8')];this[_0x37ab('0xb')]=_0x87ebc3[_0x37ab('0x6')];this['active']=_0x39cd4c[_0x37ab('0xc')]||![];this[_0x37ab('0xd')]=_0x87ebc3[_0x37ab('0xd')];this[_0x37ab('0xe')]=_0x87ebc3[_0x37ab('0xe')]||0x3;this[_0x37ab('0xf')]=_0x39cd4c[_0x37ab('0xf')];this[_0x37ab('0x10')]=_0x39cd4c[_0x37ab('0x10')];this['countcongestionretry']=_0x39cd4c['countcongestionretry'];this['countnoanswerretry']=_0x39cd4c[_0x37ab('0x11')];this[_0x37ab('0x12')]=_0x39cd4c[_0x37ab('0x12')];this[_0x37ab('0x13')]=_0x39cd4c[_0x37ab('0x13')];this[_0x37ab('0x14')]=_0x39cd4c[_0x37ab('0x14')];this[_0x37ab('0x15')]=_0x39cd4c[_0x37ab('0x15')];this['countagentrejectretry']=_0x39cd4c['countagentrejectretry'];this[_0x37ab('0x16')]=_0x39cd4c[_0x37ab('0x16')];this['ListId']=_0x39cd4c['ListId'];this[_0x37ab('0x17')]=_0x39cd4c[_0x37ab('0x17')];this['VoiceQueueId']=_0x39cd4c[_0x37ab('0x18')];this[_0x37ab('0x19')]=_0x39cd4c[_0x37ab('0x19')];this[_0x37ab('0x1a')]=_0x39cd4c['id'];this[_0x37ab('0x1b')]=_0x39cd4c[_0x37ab('0x7')][_0x37ab('0x9')]||'';this[_0x37ab('0x1c')]=moment()[_0x37ab('0x1d')](_0x37ab('0x1e'));this['callback']=_0x39cd4c[_0x37ab('0x1f')];this[_0x37ab('0x20')]=_0x39cd4c[_0x37ab('0x20')];this[_0x37ab('0x21')]=_0x39cd4c['callbackat'];this[_0x37ab('0x22')]=_0x39cd4c[_0x37ab('0x22')];this[_0x37ab('0x23')]='';this['originatecalleridname']='';}Action[_0x37ab('0x24')]['getCaller']=function(){return util[_0x37ab('0x1d')](_0x37ab('0x25'),this['name'],this[_0x37ab('0x4')][_0x37ab('0x26')]>0x0?this['number'][_0x37ab('0x27')](this[_0x37ab('0x4')][_0x37ab('0x26')]):this[_0x37ab('0xa')]);};Action[_0x37ab('0x24')][_0x37ab('0x28')]=function(){return this[_0x37ab('0xb')];};module[_0x37ab('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 4dbf162..b7518c0 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd25d=['diff','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xd25d,0xd3));var _0xdd25=function(_0x3c8b37,_0x40f7d6){_0x3c8b37=_0x3c8b37-0x0;var _0x588655=_0xd25d[_0x3c8b37];return _0x588655;};'use strict';var util=require(_0xdd25('0x0'));var _=require(_0xdd25('0x1'));var moment=require(_0xdd25('0x2'));function getSeconds(_0x280752,_0x138b83){var _0x64f392=moment(_0x280752)[_0xdd25('0x3')](0x0);var _0x2b984e=moment(_0x138b83)['milliseconds'](0x0);return _0x64f392[_0xdd25('0x4')](_0x2b984e,_0xdd25('0x5'));}function AgentComplete(_0x29d6c1,_0x47db4d){this[_0xdd25('0x6')]=0x4;this[_0xdd25('0x7')]='Answer';this[_0xdd25('0x8')]=_0x29d6c1['scheduledat'];this['type']=_0x29d6c1[_0xdd25('0x9')];this[_0xdd25('0xa')]=_0x29d6c1[_0xdd25('0x9')]==='outbound'?_0xdd25('0xb'):_0x29d6c1[_0xdd25('0x9')];this[_0xdd25('0xc')]=_0x29d6c1[_0xdd25('0xc')];this['countcongestionretry']=_0x29d6c1['countcongestionretry'];this[_0xdd25('0xd')]=_0x29d6c1['countnoanswerretry'];this[_0xdd25('0xe')]=_0x29d6c1[_0xdd25('0xc')]+_0x29d6c1[_0xdd25('0xf')]+_0x29d6c1[_0xdd25('0xd')]+_0x29d6c1[_0xdd25('0x10')]+_0x29d6c1[_0xdd25('0x11')]+_0x29d6c1[_0xdd25('0x12')]+_0x29d6c1[_0xdd25('0x13')]+_0x29d6c1[_0xdd25('0x14')];this[_0xdd25('0x10')]=_0x29d6c1[_0xdd25('0x10')];this['countdropretry']=_0x29d6c1[_0xdd25('0x11')];this[_0xdd25('0x12')]=_0x29d6c1[_0xdd25('0x12')];this[_0xdd25('0x13')]=_0x29d6c1[_0xdd25('0x13')];this[_0xdd25('0x14')]=_0x29d6c1['countagentrejectretry'];this[_0xdd25('0x15')]=_0x47db4d[_0xdd25('0x15')];this['calleridname']=_0x29d6c1['name'];this[_0xdd25('0x16')]=_0x29d6c1[_0xdd25('0x17')];this['starttime']=_0x29d6c1[_0xdd25('0x18')];this[_0xdd25('0x19')]=_0x29d6c1['responsetime'];this[_0xdd25('0x1a')]=_0x29d6c1[_0xdd25('0x1a')];this['endtime']=moment()['format'](_0xdd25('0x1b'));this['ringtime']=getSeconds(_0x29d6c1[_0xdd25('0x19')],_0x29d6c1[_0xdd25('0x18')]);this[_0xdd25('0x1c')]=getSeconds(_0x29d6c1[_0xdd25('0x1a')],_0x29d6c1[_0xdd25('0x19')]);this[_0xdd25('0x1d')]=getSeconds(this[_0xdd25('0x1e')],_0x29d6c1[_0xdd25('0x1a')]);this[_0xdd25('0xb')]=_0x47db4d['queue'];this[_0xdd25('0x1f')]=_0x47db4d[_0xdd25('0x1f')];this[_0xdd25('0x20')]=_0x47db4d[_0xdd25('0x20')];this[_0xdd25('0x21')]=_0x29d6c1[_0xdd25('0x21')];this[_0xdd25('0x22')]=_0x29d6c1[_0xdd25('0x22')];this['callbackat']=_0x29d6c1[_0xdd25('0x23')];this[_0xdd25('0x24')]=_0x29d6c1['recallme'];this[_0xdd25('0x25')]=_0x29d6c1[_0xdd25('0x25')];this[_0xdd25('0x26')]=_0x29d6c1[_0xdd25('0x26')];this[_0xdd25('0x27')]=_0x29d6c1[_0xdd25('0x27')];this[_0xdd25('0x28')]=_0x29d6c1[_0xdd25('0x28')];this[_0xdd25('0x29')]=_0x29d6c1[_0xdd25('0x29')];this['originatecalleridnum']=_0x29d6c1['originatecalleridnum']||'';this[_0xdd25('0x2a')]=_0x29d6c1[_0xdd25('0x2a')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xf037=['number','starttime','responsetime','answertime','format','ringtime','holdtime','endtime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum'];(function(_0x222688,_0x46c5eb){var _0x437433=function(_0x29958c){while(--_0x29958c){_0x222688['push'](_0x222688['shift']());}};_0x437433(++_0x46c5eb);}(_0xf037,0x129));var _0x7f03=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0xf037[_0x3616bb];return _0x1c0994;};'use strict';var util=require(_0x7f03('0x0'));var _=require(_0x7f03('0x1'));var moment=require(_0x7f03('0x2'));function getSeconds(_0x24805e,_0x496ab4){var _0x18e473=moment(_0x24805e)['milliseconds'](0x0);var _0x23b4e9=moment(_0x496ab4)[_0x7f03('0x3')](0x0);return _0x18e473['diff'](_0x23b4e9,_0x7f03('0x4'));}function AgentComplete(_0x5bd918,_0x18bb64){this[_0x7f03('0x5')]=0x4;this[_0x7f03('0x6')]=_0x7f03('0x7');this[_0x7f03('0x8')]=_0x5bd918[_0x7f03('0x8')];this[_0x7f03('0x9')]=_0x5bd918[_0x7f03('0x9')];this[_0x7f03('0xa')]=_0x5bd918[_0x7f03('0x9')]===_0x7f03('0xb')?_0x7f03('0xc'):_0x5bd918['type'];this[_0x7f03('0xd')]=_0x5bd918[_0x7f03('0xd')];this['countcongestionretry']=_0x5bd918[_0x7f03('0xe')];this['countnoanswerretry']=_0x5bd918[_0x7f03('0xf')];this[_0x7f03('0x10')]=_0x5bd918['countbusyretry']+_0x5bd918['countcongestionretry']+_0x5bd918[_0x7f03('0xf')]+_0x5bd918[_0x7f03('0x11')]+_0x5bd918[_0x7f03('0x12')]+_0x5bd918[_0x7f03('0x13')]+_0x5bd918['countmachineretry']+_0x5bd918['countagentrejectretry'];this['countnosuchnumberretry']=_0x5bd918['countnosuchnumberretry'];this[_0x7f03('0x12')]=_0x5bd918[_0x7f03('0x12')];this[_0x7f03('0x13')]=_0x5bd918[_0x7f03('0x13')];this[_0x7f03('0x14')]=_0x5bd918[_0x7f03('0x14')];this[_0x7f03('0x15')]=_0x5bd918[_0x7f03('0x15')];this[_0x7f03('0x16')]=_0x18bb64[_0x7f03('0x16')];this['calleridname']=_0x5bd918[_0x7f03('0x17')];this[_0x7f03('0x18')]=_0x5bd918[_0x7f03('0x19')];this[_0x7f03('0x1a')]=_0x5bd918[_0x7f03('0x1a')];this[_0x7f03('0x1b')]=_0x5bd918['responsetime'];this[_0x7f03('0x1c')]=_0x5bd918['answertime'];this['endtime']=moment()[_0x7f03('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7f03('0x1e')]=getSeconds(_0x5bd918['responsetime'],_0x5bd918[_0x7f03('0x1a')]);this[_0x7f03('0x1f')]=getSeconds(_0x5bd918[_0x7f03('0x1c')],_0x5bd918['responsetime']);this['talktime']=getSeconds(this[_0x7f03('0x20')],_0x5bd918[_0x7f03('0x1c')]);this['queue']=_0x18bb64['queue'];this[_0x7f03('0x21')]=_0x18bb64[_0x7f03('0x21')];this[_0x7f03('0x22')]=_0x18bb64[_0x7f03('0x22')];this['callback']=_0x5bd918[_0x7f03('0x23')];this[_0x7f03('0x24')]=_0x5bd918['callbackuniqueid'];this['callbackat']=_0x5bd918['callbackat'];this[_0x7f03('0x25')]=_0x5bd918[_0x7f03('0x25')];this[_0x7f03('0x26')]=_0x5bd918[_0x7f03('0x26')];this[_0x7f03('0x27')]=_0x5bd918[_0x7f03('0x27')];this[_0x7f03('0x28')]=_0x5bd918[_0x7f03('0x28')];this[_0x7f03('0x29')]=_0x5bd918[_0x7f03('0x29')];this[_0x7f03('0x2a')]=_0x5bd918['CampaignId'];this[_0x7f03('0x2b')]=_0x5bd918[_0x7f03('0x2b')]||'';this[_0x7f03('0x2c')]=_0x5bd918[_0x7f03('0x2c')]||'';}module[_0x7f03('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index b1fabc1..4a13f60 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7118=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime'];(function(_0x583a5e,_0x55d131){var _0x23ef19=function(_0x9e2fac){while(--_0x9e2fac){_0x583a5e['push'](_0x583a5e['shift']());}};_0x23ef19(++_0x55d131);}(_0x7118,0x159));var _0x8711=function(_0x36058c,_0x6e0e9c){_0x36058c=_0x36058c-0x0;var _0x5695c2=_0x7118[_0x36058c];return _0x5695c2;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8711('0x0'));function getSeconds(_0xf50b2e,_0x5c64d4){var _0x1758c5=moment(_0xf50b2e)[_0x8711('0x1')](0x0);var _0x348e88=moment(_0x5c64d4)[_0x8711('0x1')](0x0);return _0x1758c5[_0x8711('0x2')](_0x348e88,_0x8711('0x3'));}function Final(_0x206b82){this['uniqueid']=_0x206b82[_0x8711('0x4')];this[_0x8711('0x5')]=_0x206b82[_0x8711('0x5')];this[_0x8711('0x6')]=_0x206b82[_0x8711('0x6')];this[_0x8711('0x7')]=_0x206b82[_0x8711('0x6')]===_0x8711('0x8')?_0x8711('0x9'):_0x206b82[_0x8711('0x6')];this[_0x8711('0xa')]=_0x206b82['countbusyretry'];this['countcongestionretry']=_0x206b82[_0x8711('0xb')];this[_0x8711('0xc')]=_0x206b82[_0x8711('0xc')];this['countglobal']=_0x206b82['countbusyretry']+_0x206b82[_0x8711('0xb')]+_0x206b82[_0x8711('0xc')]+_0x206b82['countnosuchnumberretry']+_0x206b82['countdropretry']+_0x206b82[_0x8711('0xd')]+_0x206b82[_0x8711('0xe')]+_0x206b82[_0x8711('0xf')];this[_0x8711('0x10')]=_0x206b82[_0x8711('0x10')];this[_0x8711('0x11')]=_0x206b82[_0x8711('0x11')];this['countabandonedretry']=_0x206b82[_0x8711('0xd')];this[_0x8711('0xe')]=_0x206b82[_0x8711('0xe')];this[_0x8711('0xf')]=_0x206b82[_0x8711('0xf')];this[_0x8711('0x9')]=_0x206b82['queue'];this[_0x8711('0x12')]=_0x206b82[_0x8711('0x12')];this[_0x8711('0x13')]=_0x206b82[_0x8711('0x13')];this[_0x8711('0x14')]=_0x206b82['starttime'];this['responsetime']=_0x206b82['responsetime'];this[_0x8711('0x15')]=_0x206b82[_0x8711('0x16')];this[_0x8711('0x17')]=_0x206b82['ringtime']||0x0;this['holdtime']=_0x206b82[_0x8711('0x18')]||0x0;this[_0x8711('0x19')]=_0x206b82[_0x8711('0x19')]||0x0;this[_0x8711('0x1a')]=_0x206b82[_0x8711('0x1a')];this[_0x8711('0x1b')]=_0x206b82[_0x8711('0x1b')];this[_0x8711('0x1c')]=_0x206b82[_0x8711('0x1c')];this[_0x8711('0x1d')]=_0x206b82['recallme'];this[_0x8711('0x1e')]=_0x206b82[_0x8711('0x1e')];this[_0x8711('0x1f')]=_0x206b82[_0x8711('0x1f')];this['UserId']=_0x206b82[_0x8711('0x20')];this[_0x8711('0x21')]=_0x206b82[_0x8711('0x21')];this['CampaignId']=_0x206b82[_0x8711('0x22')];this[_0x8711('0x23')]=_0x206b82[_0x8711('0x23')]||'';this[_0x8711('0x24')]=_0x206b82[_0x8711('0x24')]||'';}module['exports']=Final; \ No newline at end of file +var _0x0d4d=['countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x32b7b3,_0x15a471){var _0xe13da=function(_0x3fbac7){while(--_0x3fbac7){_0x32b7b3['push'](_0x32b7b3['shift']());}};_0xe13da(++_0x15a471);}(_0x0d4d,0x132));var _0xd0d4=function(_0x41373d,_0x1ee17d){_0x41373d=_0x41373d-0x0;var _0x5c1a00=_0x0d4d[_0x41373d];return _0x5c1a00;};'use strict';var util=require(_0xd0d4('0x0'));var _=require(_0xd0d4('0x1'));var moment=require(_0xd0d4('0x2'));function getSeconds(_0x24a4c4,_0x1f74ab){var _0x1515e0=moment(_0x24a4c4)['milliseconds'](0x0);var _0x984664=moment(_0x1f74ab)['milliseconds'](0x0);return _0x1515e0[_0xd0d4('0x3')](_0x984664,_0xd0d4('0x4'));}function Final(_0x582aaa){this[_0xd0d4('0x5')]=_0x582aaa[_0xd0d4('0x5')];this[_0xd0d4('0x6')]=_0x582aaa['scheduledat'];this[_0xd0d4('0x7')]=_0x582aaa['type'];this[_0xd0d4('0x8')]=_0x582aaa['type']===_0xd0d4('0x9')?_0xd0d4('0xa'):_0x582aaa[_0xd0d4('0x7')];this['countbusyretry']=_0x582aaa[_0xd0d4('0xb')];this[_0xd0d4('0xc')]=_0x582aaa[_0xd0d4('0xc')];this[_0xd0d4('0xd')]=_0x582aaa[_0xd0d4('0xd')];this[_0xd0d4('0xe')]=_0x582aaa['countbusyretry']+_0x582aaa[_0xd0d4('0xc')]+_0x582aaa[_0xd0d4('0xd')]+_0x582aaa[_0xd0d4('0xf')]+_0x582aaa[_0xd0d4('0x10')]+_0x582aaa[_0xd0d4('0x11')]+_0x582aaa[_0xd0d4('0x12')]+_0x582aaa['countagentrejectretry'];this[_0xd0d4('0xf')]=_0x582aaa[_0xd0d4('0xf')];this[_0xd0d4('0x10')]=_0x582aaa['countdropretry'];this['countabandonedretry']=_0x582aaa[_0xd0d4('0x11')];this[_0xd0d4('0x12')]=_0x582aaa['countmachineretry'];this[_0xd0d4('0x13')]=_0x582aaa[_0xd0d4('0x13')];this['queue']=_0x582aaa['queue'];this[_0xd0d4('0x14')]=_0x582aaa[_0xd0d4('0x14')];this[_0xd0d4('0x15')]=_0x582aaa['calleridnum'];this['starttime']=_0x582aaa['starttime'];this[_0xd0d4('0x16')]=_0x582aaa[_0xd0d4('0x16')];this[_0xd0d4('0x17')]=_0x582aaa['responsetime'];this['ringtime']=_0x582aaa[_0xd0d4('0x18')]||0x0;this['holdtime']=_0x582aaa[_0xd0d4('0x19')]||0x0;this[_0xd0d4('0x1a')]=_0x582aaa[_0xd0d4('0x1a')]||0x0;this['callback']=_0x582aaa[_0xd0d4('0x1b')];this['callbackuniqueid']=_0x582aaa['callbackuniqueid'];this[_0xd0d4('0x1c')]=_0x582aaa[_0xd0d4('0x1c')];this['recallme']=_0x582aaa['recallme'];this[_0xd0d4('0x1d')]=_0x582aaa[_0xd0d4('0x1d')];this[_0xd0d4('0x1e')]=_0x582aaa[_0xd0d4('0x1e')];this[_0xd0d4('0x1f')]=_0x582aaa[_0xd0d4('0x1f')];this['VoiceQueueId']=_0x582aaa[_0xd0d4('0x20')];this['CampaignId']=_0x582aaa[_0xd0d4('0x21')];this[_0xd0d4('0x22')]=_0x582aaa[_0xd0d4('0x22')]||'';this['originatecalleridname']=_0x582aaa['originatecalleridname']||'';}module[_0xd0d4('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index d8b4439..36f1154 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b6f=['CampaignId','exports','util','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId'];(function(_0x5d14d0,_0x327c41){var _0x185d68=function(_0x4ee060){while(--_0x4ee060){_0x5d14d0['push'](_0x5d14d0['shift']());}};_0x185d68(++_0x327c41);}(_0x1b6f,0x12f));var _0xf1b6=function(_0x2fcf18,_0x10009a){_0x2fcf18=_0x2fcf18-0x0;var _0x4c68cc=_0x1b6f[_0x2fcf18];return _0x4c68cc;};'use strict';var util=require(_0xf1b6('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x128f2c,_0xcde2a3){var _0x41693e=moment(_0x128f2c)[_0xf1b6('0x1')](0x0);var _0x1d7e72=moment(_0xcde2a3)[_0xf1b6('0x1')](0x0);return _0x41693e[_0xf1b6('0x2')](_0x1d7e72,_0xf1b6('0x3'));}function Hangup(_0x38c089,_0x52e133){this['state']=0x4;this[_0xf1b6('0x4')]='Answer';this[_0xf1b6('0x5')]=_0x38c089['scheduledat'];this[_0xf1b6('0x6')]=_0x38c089[_0xf1b6('0x6')];this[_0xf1b6('0x7')]=_0x38c089[_0xf1b6('0x6')]===_0xf1b6('0x8')?_0xf1b6('0x9'):_0x38c089[_0xf1b6('0x6')];this[_0xf1b6('0xa')]=_0x38c089[_0xf1b6('0xa')];this[_0xf1b6('0xb')]=_0x38c089['countcongestionretry'];this[_0xf1b6('0xc')]=_0x38c089[_0xf1b6('0xc')];this[_0xf1b6('0xd')]=_0x38c089[_0xf1b6('0xa')]+_0x38c089[_0xf1b6('0xb')]+_0x38c089[_0xf1b6('0xc')]+_0x38c089[_0xf1b6('0xe')]+_0x38c089['countdropretry']+_0x38c089[_0xf1b6('0xf')]+_0x38c089[_0xf1b6('0x10')]+_0x38c089[_0xf1b6('0x11')];this['countnosuchnumberretry']=_0x38c089[_0xf1b6('0xe')];this[_0xf1b6('0x12')]=_0x38c089[_0xf1b6('0x12')];this[_0xf1b6('0xf')]=_0x38c089['countabandonedretry'];this[_0xf1b6('0x10')]=_0x38c089[_0xf1b6('0x10')];this[_0xf1b6('0x11')]=_0x38c089[_0xf1b6('0x11')];this[_0xf1b6('0x13')]=_0x52e133[_0xf1b6('0x13')];this[_0xf1b6('0x14')]=_0x38c089[_0xf1b6('0x15')];this[_0xf1b6('0x16')]=_0x38c089['number'];this[_0xf1b6('0x17')]=_0x38c089[_0xf1b6('0x17')];this[_0xf1b6('0x18')]=_0x38c089[_0xf1b6('0x18')];this[_0xf1b6('0x19')]=moment()[_0xf1b6('0x1a')](_0xf1b6('0x1b'));this[_0xf1b6('0x1c')]=getSeconds(_0x38c089['responsetime'],_0x38c089[_0xf1b6('0x17')]);this['holdtime']=0x0;this[_0xf1b6('0x1d')]=getSeconds(this['endtime'],_0x38c089['responsetime']);this[_0xf1b6('0x9')]=_0x38c089[_0xf1b6('0x9')];this[_0xf1b6('0x1e')]=_0xf1b6('0x1f');this[_0xf1b6('0x20')]=_0x52e133[_0xf1b6('0x21')];this[_0xf1b6('0x22')]=_0x38c089[_0xf1b6('0x22')];this[_0xf1b6('0x23')]=_0x38c089[_0xf1b6('0x23')];this[_0xf1b6('0x24')]=_0x38c089[_0xf1b6('0x24')];this['recallme']=_0x38c089[_0xf1b6('0x25')];this['ContactId']=_0x38c089['ContactId'];this[_0xf1b6('0x26')]=_0x38c089['ListId'];this[_0xf1b6('0x27')]=_0x38c089['UserId'];this[_0xf1b6('0x28')]=_0x38c089[_0xf1b6('0x28')];this[_0xf1b6('0x29')]=_0x38c089[_0xf1b6('0x29')];}module[_0xf1b6('0x2a')]=Hangup; \ No newline at end of file +var _0x2a4a=['exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','endtime','format','ringtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2a4a,0x1e5));var _0xa2a4=function(_0x514306,_0x92e850){_0x514306=_0x514306-0x0;var _0x50e539=_0x2a4a[_0x514306];return _0x50e539;};'use strict';var util=require(_0xa2a4('0x0'));var _=require(_0xa2a4('0x1'));var moment=require(_0xa2a4('0x2'));function getSeconds(_0x39c5a3,_0x44a635){var _0x521d6a=moment(_0x39c5a3)[_0xa2a4('0x3')](0x0);var _0x567f85=moment(_0x44a635)['milliseconds'](0x0);return _0x521d6a['diff'](_0x567f85,_0xa2a4('0x4'));}function Hangup(_0x2e1879,_0x104557){this[_0xa2a4('0x5')]=0x4;this[_0xa2a4('0x6')]=_0xa2a4('0x7');this['scheduledat']=_0x2e1879[_0xa2a4('0x8')];this[_0xa2a4('0x9')]=_0x2e1879[_0xa2a4('0x9')];this[_0xa2a4('0xa')]=_0x2e1879[_0xa2a4('0x9')]===_0xa2a4('0xb')?_0xa2a4('0xc'):_0x2e1879[_0xa2a4('0x9')];this[_0xa2a4('0xd')]=_0x2e1879[_0xa2a4('0xd')];this['countcongestionretry']=_0x2e1879['countcongestionretry'];this[_0xa2a4('0xe')]=_0x2e1879[_0xa2a4('0xe')];this[_0xa2a4('0xf')]=_0x2e1879['countbusyretry']+_0x2e1879[_0xa2a4('0x10')]+_0x2e1879[_0xa2a4('0xe')]+_0x2e1879[_0xa2a4('0x11')]+_0x2e1879[_0xa2a4('0x12')]+_0x2e1879[_0xa2a4('0x13')]+_0x2e1879[_0xa2a4('0x14')]+_0x2e1879[_0xa2a4('0x15')];this[_0xa2a4('0x11')]=_0x2e1879[_0xa2a4('0x11')];this[_0xa2a4('0x12')]=_0x2e1879[_0xa2a4('0x12')];this['countabandonedretry']=_0x2e1879['countabandonedretry'];this[_0xa2a4('0x14')]=_0x2e1879['countmachineretry'];this['countagentrejectretry']=_0x2e1879['countagentrejectretry'];this['uniqueid']=_0x104557[_0xa2a4('0x16')];this[_0xa2a4('0x17')]=_0x2e1879[_0xa2a4('0x18')];this['calleridnum']=_0x2e1879['number'];this[_0xa2a4('0x19')]=_0x2e1879[_0xa2a4('0x19')];this['responsetime']=_0x2e1879[_0xa2a4('0x1a')];this[_0xa2a4('0x1b')]=moment()[_0xa2a4('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa2a4('0x1d')]=getSeconds(_0x2e1879[_0xa2a4('0x1a')],_0x2e1879[_0xa2a4('0x19')]);this['holdtime']=0x0;this[_0xa2a4('0x1e')]=getSeconds(this[_0xa2a4('0x1b')],_0x2e1879['responsetime']);this[_0xa2a4('0xc')]=_0x2e1879[_0xa2a4('0xc')];this[_0xa2a4('0x1f')]=_0xa2a4('0x20');this['reason']=_0x104557[_0xa2a4('0x21')];this['callback']=_0x2e1879[_0xa2a4('0x22')];this[_0xa2a4('0x23')]=_0x2e1879[_0xa2a4('0x23')];this[_0xa2a4('0x24')]=_0x2e1879[_0xa2a4('0x24')];this[_0xa2a4('0x25')]=_0x2e1879[_0xa2a4('0x25')];this['ContactId']=_0x2e1879[_0xa2a4('0x26')];this['ListId']=_0x2e1879[_0xa2a4('0x27')];this[_0xa2a4('0x28')]=_0x2e1879['UserId'];this[_0xa2a4('0x29')]=_0x2e1879[_0xa2a4('0x29')];this[_0xa2a4('0x2a')]=_0x2e1879[_0xa2a4('0x2a')];}module[_0xa2a4('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index eeddf59..b07ddce 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bf2=['CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x2811e5,_0xd4b31){var _0x13c0cb=function(_0x3d158e){while(--_0x3d158e){_0x2811e5['push'](_0x2811e5['shift']());}};_0x13c0cb(++_0xd4b31);}(_0x6bf2,0xc2));var _0x26bf=function(_0x387195,_0x40907c){_0x387195=_0x387195-0x0;var _0x23c578=_0x6bf2[_0x387195];return _0x23c578;};'use strict';var util=require('util');var _=require(_0x26bf('0x0'));var moment=require(_0x26bf('0x1'));function getSeconds(_0x3d4091,_0x156cfd){var _0x595c06=moment(_0x3d4091)[_0x26bf('0x2')](0x0);var _0x1bce5e=moment(_0x156cfd)['milliseconds'](0x0);return _0x595c06[_0x26bf('0x3')](_0x1bce5e,_0x26bf('0x4'));}function History(_0x274fab){this[_0x26bf('0x5')]=_0x274fab[_0x26bf('0x5')];this[_0x26bf('0x6')]=_0x274fab[_0x26bf('0x6')]||undefined;this[_0x26bf('0x7')]=_0x274fab[_0x26bf('0x7')];this[_0x26bf('0x8')]=_0x274fab[_0x26bf('0x7')]===_0x26bf('0x9')?_0x26bf('0xa'):_0x274fab[_0x26bf('0x7')];this[_0x26bf('0xb')]=_0x274fab['countbusyretry'];this[_0x26bf('0xc')]=_0x274fab[_0x26bf('0xc')];this[_0x26bf('0xd')]=_0x274fab[_0x26bf('0xd')];this['countglobal']=_0x274fab[_0x26bf('0xb')]+_0x274fab[_0x26bf('0xc')]+_0x274fab[_0x26bf('0xd')]+_0x274fab[_0x26bf('0xe')]+_0x274fab[_0x26bf('0xf')]+_0x274fab[_0x26bf('0x10')]+_0x274fab[_0x26bf('0x11')]+_0x274fab['countagentrejectretry'];this[_0x26bf('0xe')]=_0x274fab[_0x26bf('0xe')];this['countdropretry']=_0x274fab[_0x26bf('0xf')];this[_0x26bf('0x10')]=_0x274fab[_0x26bf('0x10')];this['countmachineretry']=_0x274fab['countmachineretry'];this[_0x26bf('0x12')]=_0x274fab[_0x26bf('0x12')];this[_0x26bf('0xa')]=_0x274fab['queue'];this[_0x26bf('0x13')]=_0x274fab[_0x26bf('0x14')];this[_0x26bf('0x15')]=_0x274fab['number'];this[_0x26bf('0x16')]=_0x274fab['starttime'];this[_0x26bf('0x17')]=_0x274fab[_0x26bf('0x17')];this[_0x26bf('0x18')]=_0x274fab[_0x26bf('0x17')];this[_0x26bf('0x19')]=getSeconds(_0x274fab[_0x26bf('0x17')],_0x274fab[_0x26bf('0x16')]);this['holdtime']=0x0;this[_0x26bf('0x1a')]=0x0;this['callback']=_0x274fab[_0x26bf('0x1b')];this[_0x26bf('0x1c')]=_0x274fab['callbackuniqueid'];this[_0x26bf('0x1d')]=_0x274fab[_0x26bf('0x1d')];this['recallme']=_0x274fab['recallme'];this['ContactId']=_0x274fab[_0x26bf('0x1e')];this[_0x26bf('0x1f')]=_0x274fab[_0x26bf('0x1f')];this[_0x26bf('0x20')]=_0x274fab[_0x26bf('0x20')];this[_0x26bf('0x21')]=_0x274fab[_0x26bf('0x21')];this[_0x26bf('0x22')]=_0x274fab[_0x26bf('0x22')];this[_0x26bf('0x23')]=_0x274fab[_0x26bf('0x23')]||'';this[_0x26bf('0x24')]=_0x274fab[_0x26bf('0x24')]||'';}module[_0x26bf('0x25')]=History; \ No newline at end of file +var _0x9592=['milliseconds','diff','seconds','uniqueid','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment'];(function(_0x5bac10,_0x436643){var _0x362c49=function(_0x28b940){while(--_0x28b940){_0x5bac10['push'](_0x5bac10['shift']());}};_0x362c49(++_0x436643);}(_0x9592,0x12e));var _0x2959=function(_0x21be2b,_0x562dae){_0x21be2b=_0x21be2b-0x0;var _0x3ecd65=_0x9592[_0x21be2b];return _0x3ecd65;};'use strict';var util=require(_0x2959('0x0'));var _=require('lodash');var moment=require(_0x2959('0x1'));function getSeconds(_0xb69c83,_0x36a944){var _0x5c6546=moment(_0xb69c83)[_0x2959('0x2')](0x0);var _0x27bf22=moment(_0x36a944)[_0x2959('0x2')](0x0);return _0x5c6546[_0x2959('0x3')](_0x27bf22,_0x2959('0x4'));}function History(_0x11e1c5){this['uniqueid']=_0x11e1c5[_0x2959('0x5')];this['scheduledat']=_0x11e1c5['scheduledat']||undefined;this[_0x2959('0x6')]=_0x11e1c5['type'];this[_0x2959('0x7')]=_0x11e1c5[_0x2959('0x6')]==='outbound'?_0x2959('0x8'):_0x11e1c5[_0x2959('0x6')];this[_0x2959('0x9')]=_0x11e1c5['countbusyretry'];this[_0x2959('0xa')]=_0x11e1c5[_0x2959('0xa')];this[_0x2959('0xb')]=_0x11e1c5['countnoanswerretry'];this['countglobal']=_0x11e1c5[_0x2959('0x9')]+_0x11e1c5[_0x2959('0xa')]+_0x11e1c5['countnoanswerretry']+_0x11e1c5[_0x2959('0xc')]+_0x11e1c5[_0x2959('0xd')]+_0x11e1c5['countabandonedretry']+_0x11e1c5[_0x2959('0xe')]+_0x11e1c5[_0x2959('0xf')];this[_0x2959('0xc')]=_0x11e1c5[_0x2959('0xc')];this[_0x2959('0xd')]=_0x11e1c5[_0x2959('0xd')];this[_0x2959('0x10')]=_0x11e1c5[_0x2959('0x10')];this[_0x2959('0xe')]=_0x11e1c5[_0x2959('0xe')];this[_0x2959('0xf')]=_0x11e1c5[_0x2959('0xf')];this[_0x2959('0x8')]=_0x11e1c5[_0x2959('0x8')];this[_0x2959('0x11')]=_0x11e1c5[_0x2959('0x12')];this[_0x2959('0x13')]=_0x11e1c5[_0x2959('0x14')];this['starttime']=_0x11e1c5[_0x2959('0x15')];this[_0x2959('0x16')]=_0x11e1c5['responsetime'];this[_0x2959('0x17')]=_0x11e1c5['responsetime'];this[_0x2959('0x18')]=getSeconds(_0x11e1c5['responsetime'],_0x11e1c5[_0x2959('0x15')]);this['holdtime']=0x0;this[_0x2959('0x19')]=0x0;this['callback']=_0x11e1c5[_0x2959('0x1a')];this[_0x2959('0x1b')]=_0x11e1c5[_0x2959('0x1b')];this[_0x2959('0x1c')]=_0x11e1c5[_0x2959('0x1c')];this[_0x2959('0x1d')]=_0x11e1c5['recallme'];this[_0x2959('0x1e')]=_0x11e1c5['ContactId'];this[_0x2959('0x1f')]=_0x11e1c5[_0x2959('0x1f')];this[_0x2959('0x20')]=_0x11e1c5[_0x2959('0x20')];this[_0x2959('0x21')]=_0x11e1c5['VoiceQueueId'];this['CampaignId']=_0x11e1c5[_0x2959('0x22')];this[_0x2959('0x23')]=_0x11e1c5[_0x2959('0x23')]||'';this[_0x2959('0x24')]=_0x11e1c5[_0x2959('0x24')]||'';}module[_0x2959('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 0520642..5b5d80b 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 _0xbddf=['toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','substring','dialCutDigit','trim','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','callAdditionalPhoneAfterMin','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','dialAgentRejectRetryFrequency','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','[handlePredictive]','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','[countReScheduled]\x20','[actionOriginate]\x20','checkContactBlack','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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','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','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/setting','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','name','isEmpty','Intervals','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','pTalking','debug','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','prototype','clearZombieChannels','uniqueId','actions','[actions]','isNil','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','checkIsBlackList','resolve','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','merge','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','status','unmonitored','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','buildObj','amd','MACHINE','Machine','AMD','countmachineretry','countglobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','minutes','[rescheduleContact][Machine]','value','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countabandonedretry','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','ivrAnswerCallsDay','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialDropRetryFrequency','dialDropMaxRetry','additional','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','channel','roundrobin','actionid','locked','paused','stateinterface','rrmemory','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','Action','iftime\x20%s,%s','interval','content','true','command','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','dialMethod','progressive','handlePower','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','reachable','Agent','syncCampaigns','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','Contact','tags','createdAt','updatedAt','%s%s','XMD-'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0xbddf,0x92));var _0xfbdd=function(_0x1291f9,_0x54d47d){_0x1291f9=_0x1291f9-0x0;var _0x3178f5=_0xbddf[_0x1291f9];return _0x3178f5;};'use strict';var util=require(_0xfbdd('0x0'));var _=require(_0xfbdd('0x1'));var uuid=require(_0xfbdd('0x2'));var moment=require(_0xfbdd('0x3'));var rr=require('rr');var md5=require(_0xfbdd('0x4'));var Redis=require(_0xfbdd('0x5'));var ut=require(_0xfbdd('0x6'));var config=require(_0xfbdd('0x7'));var logger=require(_0xfbdd('0x8'))('dialer');var loggerBooked=require(_0xfbdd('0x8'))('booked');var loggerPredictive=require(_0xfbdd('0x8'))(_0xfbdd('0x9'));var loggerPredictiveCalls=require(_0xfbdd('0x8'))(_0xfbdd('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require('../ami');config[_0xfbdd('0xb')]=_['defaults'](config[_0xfbdd('0xb')],{'host':_0xfbdd('0xc'),'port':0x18eb});var io=require(_0xfbdd('0xd'))(new Redis(config[_0xfbdd('0xb')]));var cmHopper=require(_0xfbdd('0xe'));var cmHopperHistory=require(_0xfbdd('0xf'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xfbdd('0x10'));var RpcSetting=require(_0xfbdd('0x11'));var Action=require('./action');var History=require('./history');var Final=require(_0xfbdd('0x12'));var AgentComplete=require(_0xfbdd('0x13'));var QueueCallerAbandon=require(_0xfbdd('0x14'));var Hangup=require(_0xfbdd('0x15'));var ipAgi=process[_0xfbdd('0x16')]['XCALLY_IP_AGI']||_0xfbdd('0x17');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xfbdd('0x18')]=function(_0x471cbd){this[_0xfbdd('0x19')]=this[_0xfbdd('0x19')]?this[_0xfbdd('0x19')][_0xfbdd('0x1a')](_0x471cbd):_0x471cbd();};function Dialer(_0x549952,_0x13f7a9){this[_0xfbdd('0x1b')]=new Sequence();this[_0xfbdd('0x1c')]=_0x13f7a9;this[_0xfbdd('0x1d')]=_0x549952[_0xfbdd('0x1d')];this[_0xfbdd('0x1e')]=_0x549952[_0xfbdd('0x1e')];this['agents']=_0x549952[_0xfbdd('0x1f')];this['trunks']=_0x549952[_0xfbdd('0x20')];this['maxNumberOriginate']=config[_0xfbdd('0x21')]||0x2;this[_0xfbdd('0x22')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this[_0xfbdd('0x23')]={};this['startPredictive']={};this[_0xfbdd('0x24')]={};this[_0xfbdd('0x25')]={};this[_0xfbdd('0x26')]={};this[_0xfbdd('0x27')]={};ami['on'](_0xfbdd('0x28'),this[_0xfbdd('0x29')][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x2b'),this[_0xfbdd('0x2c')][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x2d'),this[_0xfbdd('0x2e')][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x2f'),this[_0xfbdd('0x30')][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x31'),this[_0xfbdd('0x32')][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x33'),this[_0xfbdd('0x34')][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x35'),this[_0xfbdd('0x36')][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x37'),this[_0xfbdd('0x38')][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x39'),this['syncVarSet'][_0xfbdd('0x2a')](this));ami['on'](_0xfbdd('0x3a'),this[_0xfbdd('0x3b')]['bind'](this));ami['on']('queuestatuscomplete',this[_0xfbdd('0x3c')][_0xfbdd('0x2a')](this));this['loopCampaigns']();this[_0xfbdd('0x3d')]();RpcSetting[_0xfbdd('0x3e')]()[_0xfbdd('0x3f')](function(_0x25e6ae){previewRecallmeReminderInterval=_0x25e6ae[_0xfbdd('0x40')];});}function isNotNull(_0x1d4a84){return _0x1d4a84!==null&&!_[_0xfbdd('0x41')](_0x1d4a84);}function checkIsLoggedIn(_0x2fe0b3,_0x2693b6){return function(){if(_0x2693b6<=0x0){_0x2fe0b3[_0xfbdd('0x42')]=_0xfbdd('0x43');throw _0x2fe0b3['name']+_0xfbdd('0x44');}};}function isActive(_0x2cccdf){return _0x2cccdf;}function checkIsActive(_0x3cd88d,_0x50f64c){return function(){if(!isActive(_0x50f64c)){_0x3cd88d[_0xfbdd('0x42')]=_0xfbdd('0x45');throw _0x3cd88d['name']+_0xfbdd('0x46');}};}function checkInterval(_0x3ca325){return function(){if(!isNotNull(_0x3ca325[_0xfbdd('0x47')])){_0x3ca325[_0xfbdd('0x42')]=_0xfbdd('0x48');throw _0x3ca325['name']+_0xfbdd('0x49');}if(!isNotNull(_0x3ca325[_0xfbdd('0x47')]['Intervals'])){_0x3ca325[_0xfbdd('0x42')]='INTERVAL_IS_NULL';throw _0x3ca325[_0xfbdd('0x4a')]+_0xfbdd('0x49');}if(!isNotNull(_[_0xfbdd('0x4b')](_0x3ca325[_0xfbdd('0x47')][_0xfbdd('0x4c')]))){_0x3ca325[_0xfbdd('0x42')]='INTERVAL_IS_NULL';throw _0x3ca325['name']+_0xfbdd('0x49');}};}function msgResponse(_0x3a1d3c,_0x265572,_0x583d79){return{'action':_0x3a1d3c,'response':_0x265572,'message':_0x583d79,'stack':_0x583d79};}function myreject(_0x435adf){return function(_0x5aad2c){return _0x435adf(msgResponse(_0xfbdd('0x4d'),'Error',JSON[_0xfbdd('0x4e')](_0x5aad2c)));};}function getSeconds(_0x5df3f5,_0x4f2c21){var _0x3f51bd=moment(_0x5df3f5)[_0xfbdd('0x4f')](0x0);var _0x21f44e=moment(_0x4f2c21)[_0xfbdd('0x4f')](0x0);return _0x3f51bd[_0xfbdd('0x50')](_0x21f44e,_0xfbdd('0x51'));}function emit(_0x15ab31,_0x46fafd,_0x595688){io['to'](_0x15ab31)[_0xfbdd('0x52')](_0x46fafd,_0x595688);}function emitVoiceQueueSummary(_0x204833){if(_0x204833['type']===_0xfbdd('0x53')){var _0x36fb41={'id':_0x204833['id'],'name':_0x204833[_0xfbdd('0x4a')],'strategy':_0x204833[_0xfbdd('0x54')],'answered':_0x204833[_0xfbdd('0x55')],'available':_0x204833[_0xfbdd('0x56')],'loggedIn':_0x204833['loggedIn'],'pTalking':_0x204833['pTalking'],'sumBillable':_0x204833[_0xfbdd('0x57')],'sumDuration':_0x204833[_0xfbdd('0x58')],'sumHoldTime':_0x204833[_0xfbdd('0x59')]||0x0,'talking':_0x204833[_0xfbdd('0x5a')],'total':_0x204833['total'],'type':_0x204833[_0xfbdd('0x5b')],'unmanaged':_0x204833[_0xfbdd('0x5c')],'abandoned':_0x204833[_0xfbdd('0x5d')],'waiting':_0x204833['waiting'],'loggedInDb':_0x204833['loggedInDb'],'dialActive':_0x204833[_0xfbdd('0x5e')],'dialMethod':_0x204833['dialMethod'],'dialOriginateCallerIdName':_0x204833[_0xfbdd('0x5f')],'dialOriginateCallerIdNumber':_0x204833[_0xfbdd('0x60')],'dialOriginateTimeout':_0x204833['dialOriginateTimeout'],'dialPrefix':_0x204833[_0xfbdd('0x61')],'outboundAnswerAgiCallsDay':_0x204833['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x204833[_0xfbdd('0x62')],'outboundBlacklistCallsDay':_0x204833[_0xfbdd('0x63')],'outboundBusyCallsDay':_0x204833[_0xfbdd('0x64')],'outboundCongestionCallsDay':_0x204833[_0xfbdd('0x65')],'outboundDropCallsDayACS':_0x204833[_0xfbdd('0x66')],'outboundDropCallsDayCallersExit':_0x204833[_0xfbdd('0x67')],'outboundDropCallsDayTimeout':_0x204833['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x204833['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x204833[_0xfbdd('0x68')],'outboundOriginateFailureCallsDay':_0x204833[_0xfbdd('0x69')],'outboundReCallsDay':_0x204833[_0xfbdd('0x6a')],'outboundRejectCallsDay':_0x204833[_0xfbdd('0x6b')],'outboundUnknownCallsDay':_0x204833[_0xfbdd('0x6c')],'predictiveIntervalAnsweredCalls':_0x204833['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x204833[_0xfbdd('0x6d')],'predictiveIntervalAvgTalktime':_0x204833['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x204833[_0xfbdd('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x204833[_0xfbdd('0x6f')],'predictiveIntervalErlangCalls':_0x204833[_0xfbdd('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x204833['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x204833[_0xfbdd('0x71')],'predictiveIntervalMultiplicativeFactor':_0x204833[_0xfbdd('0x72')],'predictiveIntervalPauses':_0x204833['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x204833['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x204833[_0xfbdd('0x73')],'message':_0x204833[_0xfbdd('0x42')],'originated':_0x204833[_0xfbdd('0x74')],'erlangCalls':_0x204833[_0xfbdd('0x75')],'erlangCallToSecond':_0x204833[_0xfbdd('0x76')],'erlangAbandonmentRate':_0x204833[_0xfbdd('0x77')],'erlangBusyFactor':_0x204833[_0xfbdd('0x78')],'startPredictive':_0x204833[_0xfbdd('0x79')],'startProgressive':_0x204833[_0xfbdd('0x24')]};if(_0x204833[_0xfbdd('0x7a')]){_0x36fb41[_0xfbdd('0x7a')]={'id':_0x204833[_0xfbdd('0x7a')]['id'],'name':_0x204833[_0xfbdd('0x7a')][_0xfbdd('0x4a')],'active':_0x204833['Trunk'][_0xfbdd('0x7b')],'callerid':_0x204833[_0xfbdd('0x7a')][_0xfbdd('0x7c')]};}if(_0x204833['Interval']){_0x36fb41[_0xfbdd('0x47')]={'id':_0x204833[_0xfbdd('0x47')]['id'],'name':_0x204833[_0xfbdd('0x47')][_0xfbdd('0x4a')]};}var _0x15bf22=md5(JSON[_0xfbdd('0x4e')](_0x36fb41));if(_0x204833[_0xfbdd('0x4')]!==_0x15bf22){_0x204833[_0xfbdd('0x4')]=_0x15bf22;emit(util[_0xfbdd('0x7d')](_0xfbdd('0x7e'),_0x36fb41['name']),_0xfbdd('0x7f'),_0x36fb41);}}}function emitCampaignSummary(_0x5a5829){if(_0x5a5829[_0xfbdd('0x5b')]===_0xfbdd('0x80')){emit(util['format'](_0xfbdd('0x81'),_0x5a5829[_0xfbdd('0x4a')]),_0xfbdd('0x82'),_0x5a5829);}}function checkGetDataPredictive(_0x3886c4){if(isNotNull(_0x3886c4)&&!_['isEmpty'](_0x3886c4)){loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x84'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3886c4[_0xfbdd('0x73')]);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x85'),_0x3886c4['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x86'),_0x3886c4[_0xfbdd('0x6f')]);loggerPredictive['info'](_0xfbdd('0x87'),_0x3886c4[_0xfbdd('0x6e')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3886c4[_0xfbdd('0x6d')]);loggerPredictive['info'](_0xfbdd('0x88'),_0x3886c4[_0xfbdd('0x89')]);loggerPredictive['info']('---------------------------');if(_0x3886c4[_0xfbdd('0x73')]>0x0){if(!_[_0xfbdd('0x41')](_0x3886c4[_0xfbdd('0x89')])&&_0x3886c4[_0xfbdd('0x89')]>0x0){return!![];}loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x8a'));if(!_[_0xfbdd('0x41')](_0x3886c4['predictiveIntervalAvgHoldtime'])&&_0x3886c4[_0xfbdd('0x6d')]>0x0){return!![];}loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x8b'));}else{loggerPredictive[_0xfbdd('0x83')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x8c'));}return![];}function mergeDataErlangB(_0x382e72){return function(_0x5cc04f){loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x8d'));loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x8e'),_0x5cc04f[_0xfbdd('0x75')]);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x8f'),_0x5cc04f[_0xfbdd('0x76')]);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x90'),_0x5cc04f[_0xfbdd('0x77')]);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x91'),_0x5cc04f['erlangBusyFactor']);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x90'),_0x5cc04f[_0xfbdd('0x77')]);loggerPredictive[_0xfbdd('0x83')]('---------------------------');_['merge'](_0x382e72,_0x5cc04f);};}function getDiff(_0x371bb4){var _0x2aff2e=moment()[_0xfbdd('0x4f')](0x0);var _0x497423=moment(_0x371bb4)[_0xfbdd('0x4f')](0x0);return _0x2aff2e[_0xfbdd('0x50')](_0x497423,_0xfbdd('0x51'));}function ifInterval(_0x10c9cc,_0x263134){if(_[_0xfbdd('0x41')](_0x263134)){return![];}return getDiff(_0x263134)<_0x10c9cc*0x3c;}function freeVariablesPredictive(_0x4f00cf){if(isNotNull(_0x4f00cf)){if(!_['isUndefined'](_0x4f00cf[_0xfbdd('0x24')])){_0x4f00cf[_0xfbdd('0x24')]=undefined;loggerPredictive[_0xfbdd('0x83')](_0x4f00cf[_0xfbdd('0x4a')],_0xfbdd('0x92'));}if(!_[_0xfbdd('0x41')](_0x4f00cf[_0xfbdd('0x79')])){_0x4f00cf[_0xfbdd('0x79')]=undefined;loggerPredictive[_0xfbdd('0x83')](_0x4f00cf['name'],_0xfbdd('0x93'));}if(!_[_0xfbdd('0x41')](_0x4f00cf[_0xfbdd('0x94')])){clearInterval(_0x4f00cf[_0xfbdd('0x94')]);_0x4f00cf[_0xfbdd('0x94')]=undefined;loggerPredictive[_0xfbdd('0x83')](_0x4f00cf['name'],_0xfbdd('0x95'));}}}function erlangb(_0x339c43,_0x19247c){if(_0x19247c===0x0){return 0x0;}var _0x2f1aa7=0x1;for(var _0x2b667e=0x1;_0x2b667e<=_0x19247c;_0x2b667e+=0x1){_0x2f1aa7=0x1+_0x2f1aa7*_0x2b667e/_0x339c43;}return 0x1/_0x2f1aa7;}function isVoiceQueueOutbound(_0x2c04fa){return _0x2c04fa===_0xfbdd('0x53');}function isNotPreview(_0x2540fa){return _0x2540fa!==_0xfbdd('0x1c');}function isCampaignIvr(_0x2684b8){return _0x2684b8===_0xfbdd('0x80');}function getCallerId(_0x371f24,_0x3c4069,_0x273d66){if(!_[_0xfbdd('0x41')](_0x273d66)&&typeof _0x273d66===_0xfbdd('0x96')&&!_['isEmpty'](_0x273d66)){if(!_['isUndefined'](_0x3c4069)&&typeof _0x3c4069===_0xfbdd('0x96')&&!_[_0xfbdd('0x4b')](_0x3c4069)){return util[_0xfbdd('0x7d')]('\x22%s\x22\x20<%s>',_0x3c4069,_0x273d66);}return util[_0xfbdd('0x7d')](_0xfbdd('0x97'),_0x273d66,_0x273d66);}if(!_[_0xfbdd('0x41')](_0x371f24)&&typeof _0x371f24==='string'&&!_[_0xfbdd('0x4b')](_0x371f24)){return _0x371f24;}return _0xfbdd('0x98');}function loggerCatchQueueSummary(_0x1e66d2,_0x26795e){return function(_0x5644c3){freeVariablesPredictive(_0x26795e);emitVoiceQueueSummary(_0x26795e);emitCampaignSummary(_0x26795e);loggerSyncQueueSummary['debug'](_0x1e66d2,util[_0xfbdd('0x99')](_0x5644c3,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x308476,_0x5f512d){return function(_0x6e680a){loggerPredictive['error'](_0x5f512d['name'],_0x308476);loggerPredictive[_0xfbdd('0x9a')](_0x6e680a[_0xfbdd('0x9b')]);freeVariablesPredictive(_0x5f512d);};}function loggerCatch(_0x3c25bc){return function(_0x2248b6){logger[_0xfbdd('0x9a')](_0x3c25bc,util[_0xfbdd('0x99')](_0x2248b6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4b8e98){return _0x4b8e98&&!_[_0xfbdd('0x41')](_0x4b8e98)&&_0x4b8e98[_0xfbdd('0x9c')]>0x0;}function decremetOriginate(_0x5bc421){if(!_['isUndefined'](_0x5bc421)&&_0x5bc421!==null){if(typeof _0x5bc421[_0xfbdd('0x74')]!==_0xfbdd('0x9d')){if(_0x5bc421[_0xfbdd('0x74')]>0x0){_0x5bc421[_0xfbdd('0x74')]-=0x1;}else{logger[_0xfbdd('0x9a')](_0xfbdd('0x9e'));}}}else{logger[_0xfbdd('0x9a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x6fbcb3,_0x3e85f0,_0x5a89c6){if(_0x3e85f0>_0x5a89c6){for(var _0x44b027=0x0;_0x44b027<_0x3e85f0-_0x5a89c6;_0x44b027+=0x1){decremetOriginate(_0x6fbcb3);}}}function loggerGetContactDialer(_0x191ac1,_0x499b70,_0x42ef8a){return function(_0x1b0b8a){checkContactLowerLimitOriginate(_0x499b70,_0x42ef8a,0x0);logger['error'](_0x191ac1,util[_0xfbdd('0x99')](_0x1b0b8a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x18b544){return function(_0x1bb27d){if(isNotNull(_0x1bb27d)&&isNotNull(_0x1bb27d[0x0])){if(_0x1bb27d[0x0]['contactsRescheduled']>0x0){_0x18b544[_0xfbdd('0x42')]='RESCHEDULED_CONTACTS';logger[_0xfbdd('0x83')](_0xfbdd('0x9f')+_0x18b544['name'],_0x1bb27d[0x0][_0xfbdd('0xa0')],_0xfbdd('0xa1'));}else{_0x18b544['message']=_0xfbdd('0xa2');logger[_0xfbdd('0x83')](_0xfbdd('0xa3')+_0x18b544[_0xfbdd('0x4a')]);}}};}function notSendMessagesQueue(_0x99f548){if(_0x99f548[_0xfbdd('0xa4')]){freeVariablesPredictive(_0x99f548);if(_0x99f548[_0xfbdd('0x74')]===0x0&&_0x99f548['talking']===0x0&&_0x99f548[_0xfbdd('0xa5')]===0x0&&(_0x99f548[_0xfbdd('0xa6')]||0x0)===0x0){_0x99f548['sendMessageOneNotActive']=![];_0x99f548[_0xfbdd('0x56')]=0x0;_0x99f548[_0xfbdd('0x42')]=_0xfbdd('0x45');loggerSyncQueueSummary[_0xfbdd('0xa7')](_0xfbdd('0xa8'),_0x99f548[_0xfbdd('0x4a')],_0xfbdd('0xa9'));}else{_0x99f548[_0xfbdd('0x42')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xfbdd('0xa7')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x99f548[_0xfbdd('0x4a')],_0xfbdd('0xaa'));}emitVoiceQueueSummary(_0x99f548);}}function notSendMessagesCampaign(_0x3d861d){if(_0x3d861d[_0xfbdd('0xa4')]){if(_0x3d861d[_0xfbdd('0x74')]===0x0){_0x3d861d[_0xfbdd('0xa4')]=![];_0x3d861d['message']=_0xfbdd('0x45');loggerSyncQueueSummary[_0xfbdd('0xa7')](_0xfbdd('0xab'),_0x3d861d[_0xfbdd('0x4a')],_0xfbdd('0xa9'));}else{_0x3d861d[_0xfbdd('0x42')]=_0xfbdd('0xac');loggerSyncQueueSummary['debug'](_0xfbdd('0xab'),_0x3d861d[_0xfbdd('0x4a')],'is\x20disactive');}emitCampaignSummary(_0x3d861d);}}function createObjHistory(_0x3ab4e4,_0xe89456,_0x417765,_0x26ebaf,_0x2a97f9){_0x3ab4e4[_0xfbdd('0x42')]=_0x417765;var _0x4f2637=new Action(_0x3ab4e4,_0xe89456);var _0x4b5409=new History(_0x4f2637);_0x4b5409[_0xfbdd('0xad')]=_0x26ebaf;_0x4b5409[_0xfbdd('0xae')]=_0x2a97f9;_0x4b5409[_0xfbdd('0xaf')]=_0x4f2637[_0xfbdd('0xb0')];return _0x4b5409;}Dialer[_0xfbdd('0xb1')]['loopClearZombieChannels']=function(){var _0x1519ad=this;setInterval(function(){_0x1519ad[_0xfbdd('0xb2')](_0x1519ad[_0xfbdd('0xb3')],'[uniqueid]');_0x1519ad[_0xfbdd('0xb2')](_0x1519ad[_0xfbdd('0xb4')],_0xfbdd('0xb5'));},0x32c8);};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xb2')]=function(_0x3ac23a,_0x59e1c8){var _0x45f0c7=this;for(var _0x5d6bb9 in _0x3ac23a){if(typeof _0x3ac23a[_0x5d6bb9]!==_0xfbdd('0x9d')){this['sequence'][_0xfbdd('0x18')](function(){if(!_[_0xfbdd('0xb6')](_0x3ac23a[_0x5d6bb9])){return ami['Action']({'action':'status','channel':_0x3ac23a[_0x5d6bb9]['channel']})[_0xfbdd('0xb7')](function(_0x58255c){if(_0x58255c[_0xfbdd('0x42')]===_0xfbdd('0xb8')){setTimeout(function(){if(_0x3ac23a[_0x5d6bb9]&&_0x3ac23a[_0x5d6bb9]['type']!==_0xfbdd('0x80')){_0x45f0c7['updateOriginated'](_0x45f0c7[_0xfbdd('0x1d')][_0x3ac23a[_0x5d6bb9][_0xfbdd('0xb9')]]);logger[_0xfbdd('0x9a')](_0xfbdd('0xba'),_0x59e1c8,_0x5d6bb9,_0x3ac23a[_0x5d6bb9][_0xfbdd('0xb9')]);delete _0x3ac23a[_0x5d6bb9];}if(_0x3ac23a[_0x5d6bb9]&&_0x3ac23a[_0x5d6bb9][_0xfbdd('0x5b')]===_0xfbdd('0x80')){_0x45f0c7[_0xfbdd('0xbb')](_0x45f0c7['campaigns'][_0x3ac23a[_0x5d6bb9][_0xfbdd('0xb9')]]);logger[_0xfbdd('0x9a')](_0xfbdd('0xbc'),_0x59e1c8,_0x5d6bb9,_0x3ac23a[_0x5d6bb9][_0xfbdd('0xb9')]);delete _0x3ac23a[_0x5d6bb9];}},0x2328);}});}});}}};Dialer['prototype'][_0xfbdd('0xbd')]=function(_0x5d983a){return Promise['resolve']()[_0xfbdd('0x3f')](cmHopper[_0xfbdd('0xbd')](_0x5d983a))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0xfbdd('0xbe')]=function(_0x30811c){return Promise[_0xfbdd('0xbf')]()[_0xfbdd('0x3f')](cmHopperBlack[_0xfbdd('0xbe')](_0x30811c))[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0xc0')));};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xc1')]=function(_0x29bcd8,_0x83e8d3,_0x4632ce){return Promise['resolve']()[_0xfbdd('0x3f')](cmHopperAdditionalPhone[_0xfbdd('0xc1')](_0x29bcd8,_0x83e8d3,_0x4632ce))[_0xfbdd('0xb7')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0xfbdd('0xb1')]['swapAdditionalPhones']=function(_0x5694a2,_0x36f209,_0x42710b){return Promise[_0xfbdd('0xbf')]()[_0xfbdd('0x3f')](cmHopperAdditionalPhone[_0xfbdd('0xc2')](_0x5694a2,_0x36f209,_0x42710b))[_0xfbdd('0xb7')](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0xfbdd('0xb1')]['checkIsBlackListIvr']=function(_0x2ca6ab){return Promise['resolve']()[_0xfbdd('0x3f')](cmHopperBlack[_0xfbdd('0xc3')](_0x2ca6ab))['catch'](loggerCatch(_0xfbdd('0xc4')));};Dialer['prototype'][_0xfbdd('0xc5')]=function(_0x15c62b){return Promise[_0xfbdd('0xbf')]()[_0xfbdd('0x3f')](cmHopperHistory[_0xfbdd('0xc6')](_0x15c62b))[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0xc7')));};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xc8')]=function(_0x5cbb37){return Promise[_0xfbdd('0xbf')]()[_0xfbdd('0x3f')](cmHopper[_0xfbdd('0xc8')](_0x5cbb37))['catch'](loggerCatch(_0xfbdd('0xc9')));};Dialer[_0xfbdd('0xb1')]['unlockContact']=function(_0xd54893,_0x424ab2,_0x278383){return Promise[_0xfbdd('0xbf')]()[_0xfbdd('0x3f')](cmHopper['unlockContact'](_0xd54893,_0x424ab2,_0x278383))[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0xca')));};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xcb')]=function(_0x3d63a6,_0x3d7328,_0x564d90,_0x26b955,_0x5e47f5){return Promise['resolve']()[_0xfbdd('0x3f')](cmHopper[_0xfbdd('0xcb')](_0x3d63a6,_0x3d7328,_0x564d90,_0x26b955))['catch'](function(_0x5c56da){_0x5e47f5[_0xfbdd('0xcc')]-=_0x564d90;_0x5e47f5[_0xfbdd('0xcc')]=_0x5e47f5['temp']>0x0?_0x5e47f5[_0xfbdd('0xcc')]:0x0;loggerCatch(_0xfbdd('0xcd'))(_0x5c56da);});};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xce')]=function(_0x5cf309,_0x349ec2,_0x414a7c,_0x545cb3){return Promise['resolve']()[_0xfbdd('0x3f')](cmHopper['getContactDialerIvr'](_0x5cf309,_0x349ec2,_0x414a7c))[_0xfbdd('0xb7')](function(_0x468451){_0x545cb3[_0xfbdd('0xcc')]-=_0x349ec2;_0x545cb3[_0xfbdd('0xcc')]=_0x545cb3[_0xfbdd('0xcc')]>0x0?_0x545cb3[_0xfbdd('0xcc')]:0x0;loggerCatch(_0xfbdd('0xcf'))(_0x468451);});};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xd0')]=function(_0x4deab0){return Promise['resolve']()[_0xfbdd('0x3f')](voiceQueueRt[_0xfbdd('0xd0')](_0x4deab0))[_0xfbdd('0xb7')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['moveContactManagedDialer']=function(_0x43d717){return Promise[_0xfbdd('0xbf')]()[_0xfbdd('0x3f')](cmHopper[_0xfbdd('0xd1')](_0x43d717))['catch'](loggerCatch(_0xfbdd('0xd2')));};Dialer['prototype'][_0xfbdd('0xd3')]=function(_0x1e67b9){return Promise[_0xfbdd('0xbf')]()[_0xfbdd('0x3f')](cmHopperHistory['createHistory'](_0x1e67b9))[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0xd4')));};Dialer['prototype'][_0xfbdd('0xbb')]=function(_0x3f9a83){if(!_[_0xfbdd('0x41')](_0x3f9a83)&&_0x3f9a83!==null){if(typeof _0x3f9a83[_0xfbdd('0x74')]!==_0xfbdd('0x9d')){if(_0x3f9a83[_0xfbdd('0x74')]>0x0){_0x3f9a83['originated']-=0x1;}else{logger[_0xfbdd('0x9a')](_0xfbdd('0xd5'));}}}else{logger[_0xfbdd('0x9a')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xd6')]=function(_0x3dc334,_0x2f2eff){var _0x33278d=this;return function(_0xf8ea57){_0x33278d[_0xfbdd('0xbb')](_0x2f2eff);logger['error'](_0x3dc334,util[_0xfbdd('0x99')](_0xf8ea57,{'showHidden':![],'depth':null}));};};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xd7')]=function(_0x16ef8b,_0x49cfe8,_0x357991){var _0x32d5ad={'state':0x19,'statedesc':_0xfbdd('0xd8')};this[_0xfbdd('0xbb')](_0x49cfe8);this[_0xfbdd('0xd9')](_[_0xfbdd('0xda')](_0x32d5ad,_['pick'](_0x357991,['ContactId',_0xfbdd('0xdb'),_0xfbdd('0xdc'),_0xfbdd('0xdd'),_0xfbdd('0xde')])),_0xfbdd('0xdf'),_0xfbdd('0xe0'));logger['error'](_0x16ef8b);};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xe1')]=function(_0x5ee76c){return _0x5ee76c==='Success';};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xe2')]=function(_0x2ca27b){return!_['isUndefined'](_0x2ca27b)&&_0x2ca27b&&!_['isUndefined'](_0x2ca27b[_0xfbdd('0x4a')])&&!_['isUndefined'](_0x2ca27b[_0xfbdd('0x7b')])&&_0x2ca27b[_0xfbdd('0x7b')]&&(this[_0xfbdd('0x20')][util[_0xfbdd('0x7d')](_0xfbdd('0xe3'),_0x2ca27b[_0xfbdd('0x4a')])][_0xfbdd('0xe4')]==='reachable'||this['trunks'][util[_0xfbdd('0x7d')](_0xfbdd('0xe3'),_0x2ca27b['name'])][_0xfbdd('0xe4')]===_0xfbdd('0xe5'));};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xd9')]=function(_0x3c2ae4,_0x5447c5,_0x27c02c){this[_0xfbdd('0xd3')](_0x3c2ae4)[_0xfbdd('0xb7')](loggerCatch(_0x5447c5));this['moveContactManagedDialer'](_0x3c2ae4)[_0xfbdd('0xb7')](loggerCatch(_0x27c02c));};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xe6')]=function(_0x1b7202){var _0xbd5cc2=this;var _0x545c03=this['uniqueId'][_0x1b7202[_0xfbdd('0xe7')]];var _0x1fa74b;if(!_[_0xfbdd('0xb6')](_0x1b7202)&&!_[_0xfbdd('0xb6')](_0x1b7202[_0xfbdd('0xe8')])&&!_[_0xfbdd('0xb6')](_0x1b7202[_0xfbdd('0xe8')][_0xfbdd('0xe9')])&&_0x1b7202[_0xfbdd('0xea')]===_0xfbdd('0xeb')&&_0x545c03){if(_0x545c03[_0xfbdd('0x5b')]!==_0xfbdd('0x80')&&this[_0xfbdd('0x1d')][_0x545c03[_0xfbdd('0xb9')]][_0xfbdd('0xec')]&&_0x1b7202['value']===_0xfbdd('0xed')){delete this[_0xfbdd('0xb3')][_0x1b7202[_0xfbdd('0xe7')]];this[_0xfbdd('0xbb')](this[_0xfbdd('0x1d')][_0x545c03[_0xfbdd('0xb9')]]);this[_0xfbdd('0x1d')][_0x545c03['queue']][_0xfbdd('0x62')]+=0x1;this[_0xfbdd('0x1d')][_0x545c03[_0xfbdd('0xb9')]][_0xfbdd('0xee')]+=0x1;_0x1fa74b=new Hangup(_0x545c03,_0x1b7202);_0x1fa74b[_0xfbdd('0xad')]=0x12;_0x1fa74b[_0xfbdd('0xae')]=_0xfbdd('0xef');_0x1fa74b[_0xfbdd('0xf0')]='AMD';ami[_0xfbdd('0x52')](_0xfbdd('0xf1'),ut[_0xfbdd('0xf2')](_0x1fa74b,_0xfbdd('0xf3')));this[_0xfbdd('0xd9')](_0x1fa74b,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x545c03[_0xfbdd('0x5b')]!==_0xfbdd('0x80')&&this[_0xfbdd('0x1d')][_0x545c03['queue']]['dialAMDActive']&&_0x1b7202['value']===_0xfbdd('0xf4')){return new Promise(function(_0x4e9aef,_0x45e397){delete _0xbd5cc2[_0xfbdd('0xb3')][_0x1b7202['uniqueid']];_0xbd5cc2[_0xfbdd('0xbb')](_0xbd5cc2[_0xfbdd('0x1d')][_0x545c03[_0xfbdd('0xb9')]]);_0xbd5cc2[_0xfbdd('0x1d')][_0x545c03[_0xfbdd('0xb9')]][_0xfbdd('0x62')]+=0x1;_0xbd5cc2[_0xfbdd('0x1d')][_0x545c03[_0xfbdd('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x363d5c=_0xbd5cc2[_0xfbdd('0x1d')][_0x545c03[_0xfbdd('0xb9')]];var _0xeb611d=new Hangup(_0x545c03,_0x1b7202);_0xeb611d[_0xfbdd('0xad')]=0x13;_0xeb611d['statedesc']=_0xfbdd('0xf5');_0xeb611d[_0xfbdd('0xf0')]=_0xfbdd('0xf6');_0xeb611d[_0xfbdd('0xf7')]+=0x1;_0xeb611d[_0xfbdd('0xf8')]+=0x1;_0xeb611d[_0xfbdd('0xf3')]=!![];ami[_0xfbdd('0x52')](_0xfbdd('0xf1'),ut[_0xfbdd('0xf2')](_0xeb611d,_0xfbdd('0xf3')));_0xbd5cc2['createHistory'](_0xeb611d)[_0xfbdd('0xb7')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xeb611d[_0xfbdd('0xf9')]+_0xeb611d['countcongestionretry']+_0xeb611d[_0xfbdd('0xfa')]+_0xeb611d[_0xfbdd('0xfb')]+_0xeb611d[_0xfbdd('0xfc')]+_0xeb611d['countabandonedretry']+_0xeb611d[_0xfbdd('0xf7')]+_0xeb611d[_0xfbdd('0xfd')]>=_0x363d5c[_0xfbdd('0xfe')]){_0xbd5cc2[_0xfbdd('0xff')](_0xeb611d,_0x4e9aef,_0x45e397,_0xfbdd('0x100'));}else{if(_0xeb611d[_0xfbdd('0xf7')]>=_0x363d5c[_0xfbdd('0x101')]){_0xbd5cc2['createStateFinal'](_0xeb611d,_0x4e9aef,_0x45e397,_0xfbdd('0x102'));}else{_0xbd5cc2[_0xfbdd('0xc8')]({'active':![],'countmachineretry':_0xeb611d['countmachineretry'],'scheduledat':moment()[_0xfbdd('0x103')](_0x363d5c['dialMachineRetryFrequency'],_0xfbdd('0x104'))[_0xfbdd('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xeb611d['ContactId'],'ListId':_0xeb611d['ListId'],'VoiceQueueId':_0xeb611d['VoiceQueueId']||undefined,'CampaignId':_0xeb611d[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x105')));_0x4e9aef({'reschedule':0x1});}}});}if(_0x545c03[_0xfbdd('0x5b')]===_0xfbdd('0x80')&&this[_0xfbdd('0x1e')][_0x545c03['queue']]['dialAMDActive']&&_0x1b7202[_0xfbdd('0x106')]==='HANGUP'){delete this[_0xfbdd('0xb3')][_0x1b7202[_0xfbdd('0xe7')]];this[_0xfbdd('0xbb')](this['campaigns'][_0x545c03[_0xfbdd('0xb9')]]);_0x1fa74b=new Hangup(_0x545c03,_0x1b7202);_0x1fa74b[_0xfbdd('0xad')]=0x12;_0x1fa74b[_0xfbdd('0xae')]='HangupInAMD';_0x1fa74b[_0xfbdd('0xf0')]=_0xfbdd('0xf6');ami[_0xfbdd('0x52')](_0xfbdd('0xf1'),ut['buildObj'](_0x1fa74b,_0xfbdd('0xf3')));this['saveInDb'](_0x1fa74b,_0xfbdd('0x107'),'[syncHangupInAMDIvr]');}if(_0x545c03[_0xfbdd('0x5b')]==='ivr'&&this[_0xfbdd('0x1e')][_0x545c03[_0xfbdd('0xb9')]][_0xfbdd('0xec')]&&_0x1b7202['value']===_0xfbdd('0xf4')){return new Promise(function(_0x4dfec2,_0x496935){delete _0xbd5cc2[_0xfbdd('0xb3')][_0x1b7202[_0xfbdd('0xe7')]];_0xbd5cc2['updateOriginated'](_0xbd5cc2[_0xfbdd('0x1e')][_0x545c03[_0xfbdd('0xb9')]]);_0xbd5cc2[_0xfbdd('0x1e')][_0x545c03['queue']][_0xfbdd('0x62')]+=0x1;_0xbd5cc2[_0xfbdd('0x1e')][_0x545c03['queue']][_0xfbdd('0xee')]+=0x1;var _0x3c4477=_0xbd5cc2[_0xfbdd('0x1e')][_0x545c03[_0xfbdd('0xb9')]];var _0x557436=new Hangup(_0x545c03,_0x1b7202);_0x557436[_0xfbdd('0xad')]=0x13;_0x557436['statedesc']=_0xfbdd('0xf5');_0x557436[_0xfbdd('0xf0')]=_0xfbdd('0xf6');_0x557436['countmachineretry']+=0x1;_0x557436[_0xfbdd('0xf8')]+=0x1;_0x557436[_0xfbdd('0xf3')]=!![];ami[_0xfbdd('0x52')](_0xfbdd('0xf1'),ut['buildObj'](_0x557436,_0xfbdd('0xf3')));_0xbd5cc2[_0xfbdd('0xd3')](_0x557436)['catch'](loggerCatch(_0xfbdd('0x108')));if(_0x557436['countbusyretry']+_0x557436['countcongestionretry']+_0x557436[_0xfbdd('0xfa')]+_0x557436[_0xfbdd('0xfb')]+_0x557436[_0xfbdd('0xfc')]+_0x557436[_0xfbdd('0x109')]+_0x557436[_0xfbdd('0xf7')]+_0x557436['countagentrejectretry']>=_0x3c4477['dialGlobalMaxRetry']){_0xbd5cc2[_0xfbdd('0xff')](_0x557436,_0x4dfec2,_0x496935,_0xfbdd('0x100'));}else{if(_0x557436['countmachineretry']>=_0x3c4477[_0xfbdd('0x101')]){_0xbd5cc2['createStateFinal'](_0x557436,_0x4dfec2,_0x496935,_0xfbdd('0x102'));}else{_0xbd5cc2['rescheduleContact']({'active':![],'countmachineretry':_0x557436[_0xfbdd('0xf7')],'scheduledat':moment()[_0xfbdd('0x103')](_0x3c4477[_0xfbdd('0x10a')],'minutes')[_0xfbdd('0x7d')](_0xfbdd('0x10b')),'ContactId':_0x557436[_0xfbdd('0x10c')],'ListId':_0x557436[_0xfbdd('0xdb')],'VoiceQueueId':_0x557436[_0xfbdd('0xdd')]||undefined,'CampaignId':_0x557436[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x105')));_0x4dfec2({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xfbdd('0x36')]=function(_0x10d653){var _0x2dc722=this[_0xfbdd('0xb3')][_0x10d653[_0xfbdd('0xe7')]];var _0x97c2d9;if(_0x2dc722&&_0x2dc722[_0xfbdd('0x5b')]===_0xfbdd('0x80')){delete this[_0xfbdd('0xb3')][_0x10d653[_0xfbdd('0xe7')]];this[_0xfbdd('0xbb')](this[_0xfbdd('0x1e')][_0x2dc722['queue']]);this['campaigns'][_0x2dc722[_0xfbdd('0xb9')]][_0xfbdd('0x10d')]+=0x1;_0x97c2d9=new Hangup(_0x2dc722,_0x10d653);this[_0xfbdd('0xd3')](_0x97c2d9)[_0xfbdd('0xb7')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xfbdd('0xd1')](_0x97c2d9)[_0xfbdd('0xb7')](loggerCatch('[syncHangupIvr]'));}if(_0x2dc722&&_0x2dc722[_0xfbdd('0x5b')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x2dc722[_0xfbdd('0xb9')]][_0xfbdd('0x10e')])){delete this[_0xfbdd('0xb3')][_0x10d653[_0xfbdd('0xe7')]];this[_0xfbdd('0xbb')](this[_0xfbdd('0x1d')][_0x2dc722[_0xfbdd('0xb9')]]);this[_0xfbdd('0x1d')][_0x2dc722[_0xfbdd('0xb9')]]['outboundAnswerCallsDay']+=0x1;this[_0xfbdd('0x1d')][_0x2dc722[_0xfbdd('0xb9')]][_0xfbdd('0xee')]+=0x1;_0x97c2d9=new Hangup(_0x2dc722,_0x10d653);_0x97c2d9[_0xfbdd('0xad')]=0x10;_0x97c2d9[_0xfbdd('0xae')]=_0xfbdd('0x10f');_0x97c2d9[_0xfbdd('0xf0')]=_0xfbdd('0x110');this[_0xfbdd('0xd3')](_0x97c2d9)['catch'](loggerCatch(_0xfbdd('0x111')));this[_0xfbdd('0xd1')](_0x97c2d9)[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x112')));}if(_0x2dc722&&_0x2dc722[_0xfbdd('0x5b')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x2dc722[_0xfbdd('0xb9')]][_0xfbdd('0x10e')])){delete this[_0xfbdd('0xb3')][_0x10d653[_0xfbdd('0xe7')]];this[_0xfbdd('0xbb')](this[_0xfbdd('0x1d')][_0x2dc722[_0xfbdd('0xb9')]]);this[_0xfbdd('0x1d')][_0x2dc722[_0xfbdd('0xb9')]][_0xfbdd('0x6c')]+=0x1;_0x97c2d9=new Hangup(_0x2dc722,_0x10d653);_0x97c2d9[_0xfbdd('0xad')]=0xc;_0x97c2d9['statedesc']=_0x10d653['cause-txt'];_0x97c2d9[_0xfbdd('0xf0')]=_0xfbdd('0x113');this[_0xfbdd('0xd3')](_0x97c2d9)[_0xfbdd('0xb7')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xfbdd('0xd1')](_0x97c2d9)[_0xfbdd('0xb7')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xfbdd('0xb1')]['syncAgentComplete']=function(_0x1f6833){var _0x2f632c=this[_0xfbdd('0xb3')][_0x1f6833[_0xfbdd('0xe7')]];if(this[_0xfbdd('0x1d')][_0x1f6833['queue']]){if(_0x2f632c&&_0x2f632c['type']!=='ivr'){delete this[_0xfbdd('0xb3')][_0x1f6833[_0xfbdd('0xe7')]];this[_0xfbdd('0x1d')][_0x1f6833[_0xfbdd('0xb9')]][_0xfbdd('0x62')]+=0x1;var _0x88f255=new AgentComplete(_0x2f632c,_0x1f6833);if(_0x1f6833[_0xfbdd('0x114')]===_0xfbdd('0x115')){_0x88f255[_0xfbdd('0x116')]=this[_0xfbdd('0x1d')][_0x1f6833[_0xfbdd('0xb9')]][_0xfbdd('0x117')]&&this['voiceQueues'][_0x1f6833[_0xfbdd('0xb9')]]['dialAgiAfterHangupAgent']?moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b')):undefined;}this[_0xfbdd('0xd3')](_0x88f255)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x88f255)[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x118')));}}};Dialer['prototype'][_0xfbdd('0x29')]=function(_0x38abdd){if(this[_0xfbdd('0x1d')][_0x38abdd[_0xfbdd('0xb9')]]){if(this['uniqueId'][_0x38abdd[_0xfbdd('0xe7')]]&&this['uniqueId'][_0x38abdd[_0xfbdd('0xe7')]][_0xfbdd('0x5b')]!==_0xfbdd('0x80')){this[_0xfbdd('0xbb')](this['voiceQueues'][_0x38abdd[_0xfbdd('0xb9')]]);this[_0xfbdd('0xb3')][_0x38abdd['uniqueid']][_0xfbdd('0x119')]=moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b'));}}};Dialer['prototype'][_0xfbdd('0x11a')]=function(_0x23443f,_0x17033d){this[_0xfbdd('0xd3')](_0x23443f)[_0xfbdd('0xb7')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x17033d==0x0){this[_0xfbdd('0xd1')](_0x23443f)['catch'](loggerCatch(_0xfbdd('0x11b')));}};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x2c')]=function(_0xb71a7e){var _0x4661c0=this[_0xfbdd('0xb3')][_0xb71a7e['uniqueid']];var _0x10e1a7=this;var _0xf8ec3f=![];var _0x41b2c8;var _0x1666ba;if(this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]]){if(_0x4661c0&&_0x4661c0[_0xfbdd('0x5b')]!==_0xfbdd('0x80')){delete this[_0xfbdd('0xb3')][_0xb71a7e[_0xfbdd('0xe7')]];this['updateOriginated'](this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]]);_0x4661c0[_0xfbdd('0x11c')]=moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b'));var _0x27fed4=new QueueCallerAbandon(_0x4661c0,_0xb71a7e);if(getSeconds(_0x4661c0[_0xfbdd('0x11c')],_0x4661c0[_0xfbdd('0x11d')])>=_0x4661c0[_0xfbdd('0x11e')]){this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x6f')]+=0x1;this[_0xfbdd('0x1d')][_0xb71a7e['queue']][_0xfbdd('0x11f')]+=0x1;this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x120')]+=0x1;_0x27fed4[_0xfbdd('0xad')]=0xa;_0x27fed4['statedesc']=_0xfbdd('0x121');_0x27fed4['dropreason']=_0xfbdd('0x122');_0x27fed4[_0xfbdd('0x116')]=this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x117')]?moment()['format'](_0xfbdd('0x10b')):undefined;_0x27fed4[_0xfbdd('0xfc')]+=0x1;_0x27fed4['countglobal']+=0x1;_0x41b2c8=this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x123')];_0x1666ba=this['voiceQueues'][_0xb71a7e[_0xfbdd('0xb9')]]['callAdditionalPhoneAfterMin'];_0x10e1a7[_0xfbdd('0xc1')](_0x27fed4,_0x27fed4[_0xfbdd('0xad')],_0x4661c0['voiceQueue'])['then'](function(_0x43b41b){_0xf8ec3f=_0x43b41b['additional']==0x1;if(_0x27fed4[_0xfbdd('0xfc')]>=_0x10e1a7[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x124')]){_0x10e1a7[_0xfbdd('0x11a')](_0x27fed4,_0x43b41b[_0xfbdd('0x125')]);}else{_0x10e1a7[_0xfbdd('0xc8')]({'active':![],'countdropretry':_0x27fed4[_0xfbdd('0xfc')],'scheduledat':moment()[_0xfbdd('0x103')](_0x10e1a7[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x123')],_0xfbdd('0x104'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4661c0[_0xfbdd('0x10c')],'ListId':_0x4661c0[_0xfbdd('0xdb')],'VoiceQueueId':_0x4661c0[_0xfbdd('0xdd')]||undefined,'CampaignId':_0x4661c0[_0xfbdd('0xde')]||undefined})['catch'](loggerCatch(_0xfbdd('0x126')));var _0x3c3cee=new History(_0x27fed4);_0x3c3cee[_0xfbdd('0xad')]=0xa;_0x3c3cee[_0xfbdd('0xae')]='Drop';_0x3c3cee['starttime']=moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b'));_0x3c3cee[_0xfbdd('0xaf')]=_0x3c3cee[_0xfbdd('0xb0')];_0x3c3cee[_0xfbdd('0x127')]=_0x27fed4[_0xfbdd('0x127')];_0x3c3cee[_0xfbdd('0x128')]=_0x27fed4['calleridnum'];_0x10e1a7[_0xfbdd('0xd3')](_0x3c3cee)['catch'](loggerCatch(_0xfbdd('0x129')));}})['then'](function(){if(_0xf8ec3f)_0x10e1a7['swapAdditionalPhones'](_0x27fed4,_0x41b2c8,_0x1666ba)['then'](function(){return 0x1;});});}else{this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x6e')]+=0x1;this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x67')]+=0x1;_0x27fed4[_0xfbdd('0xad')]=0xb;_0x27fed4[_0xfbdd('0xae')]=_0xfbdd('0x12a');_0x27fed4['dropreason']=_0xfbdd('0x12b');_0x27fed4[_0xfbdd('0x109')]+=0x1;_0x27fed4[_0xfbdd('0xf8')]+=0x1;_0x41b2c8=this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x12c')];_0x1666ba=this[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]]['callAdditionalPhoneAfterMin'];_0x10e1a7[_0xfbdd('0xc1')](_0x27fed4,_0x27fed4[_0xfbdd('0xad')],_0x4661c0[_0xfbdd('0x12d')])[_0xfbdd('0x3f')](function(_0xb859ed){if(_0x27fed4[_0xfbdd('0x109')]>=_0x10e1a7[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]][_0xfbdd('0x12e')]){_0x10e1a7[_0xfbdd('0x11a')](_0x27fed4,_0xb859ed[_0xfbdd('0x125')]);}else{_0x10e1a7['rescheduleContact']({'active':![],'countabandonedretry':_0x27fed4[_0xfbdd('0x109')],'scheduledat':moment()['add'](_0x10e1a7[_0xfbdd('0x1d')][_0xb71a7e[_0xfbdd('0xb9')]]['dialAbandonedRetryFrequency'],'minutes')[_0xfbdd('0x7d')](_0xfbdd('0x10b')),'ContactId':_0x4661c0[_0xfbdd('0x10c')],'ListId':_0x4661c0['ListId'],'VoiceQueueId':_0x4661c0[_0xfbdd('0xdd')]||undefined,'CampaignId':_0x4661c0['CampaignId']||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x12f')));var _0xef477=new History(_0x27fed4);_0xef477['state']=0xb;_0xef477['statedesc']=_0xfbdd('0x12a');_0xef477['starttime']=moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b'));_0xef477['endtime']=_0xef477[_0xfbdd('0xb0')];_0xef477['calleridname']=_0x27fed4[_0xfbdd('0x127')];_0xef477['calleridnum']=_0x27fed4[_0xfbdd('0x128')];_0x10e1a7['createHistory'](_0xef477)[_0xfbdd('0xb7')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xfbdd('0x3f')](function(){if(_0xf8ec3f)_0x10e1a7[_0xfbdd('0xc2')](_0x27fed4,_0x41b2c8,_0x1666ba)[_0xfbdd('0x3f')](function(){return 0x1;});});}}}};Dialer['prototype'][_0xfbdd('0x38')]=function(_0x214ab9){if(this[_0xfbdd('0xb4')][_0x214ab9[_0xfbdd('0xe7')]]){this[_0xfbdd('0xb4')][_0x214ab9[_0xfbdd('0xe7')]]['channel']=_0x214ab9[_0xfbdd('0x130')];}if(this['uniqueId'][_0x214ab9['uniqueid']]){this[_0xfbdd('0xb3')][_0x214ab9[_0xfbdd('0xe7')]]['channel']=_0x214ab9[_0xfbdd('0x130')];}};Dialer[_0xfbdd('0xb1')]['syncQueueMember']=function(_0xd3f6dd){if(strategy[this[_0xfbdd('0x1d')][this[_0xfbdd('0xb4')][_0xd3f6dd['actionid']]['queue']][_0xfbdd('0x54')]]===_0xfbdd('0x131')){if(this[_0xfbdd('0xb4')][_0xd3f6dd[_0xfbdd('0x132')]]&&_['isNil'](this[_0xfbdd('0xb4')][_0xd3f6dd[_0xfbdd('0x132')]][_0xfbdd('0x133')])&&_0xd3f6dd[_0xfbdd('0xe4')]==='1'&&_0xd3f6dd[_0xfbdd('0x134')]==='0'){if(this[_0xfbdd('0x1f')][_0xd3f6dd[_0xfbdd('0x135')]]){if(!this[_0xfbdd('0x1f')][_0xd3f6dd['stateinterface']][_0xfbdd('0x133')]){this[_0xfbdd('0x1f')][_0xd3f6dd[_0xfbdd('0x135')]][_0xfbdd('0x133')]=!![];this['actions'][_0xd3f6dd[_0xfbdd('0x132')]][_0xfbdd('0x133')]=!![];this[_0xfbdd('0xb4')][_0xd3f6dd['actionid']][_0xfbdd('0x135')]=_0xd3f6dd[_0xfbdd('0x135')];}}}}else if((strategy[this[_0xfbdd('0x1d')][this[_0xfbdd('0xb4')][_0xd3f6dd[_0xfbdd('0x132')]]['queue']][_0xfbdd('0x54')]]||_0xfbdd('0x136'))==='rrmemory'){if(this[_0xfbdd('0xb4')][_0xd3f6dd[_0xfbdd('0x132')]]){if(this[_0xfbdd('0x1f')][_0xd3f6dd['stateinterface']]){this[_0xfbdd('0xb4')][_0xd3f6dd[_0xfbdd('0x132')]][_0xfbdd('0x135')]=_0xd3f6dd[_0xfbdd('0x135')];if(_[_0xfbdd('0xb6')](this[_0xfbdd('0x26')][this['actions'][_0xd3f6dd[_0xfbdd('0x132')]][_0xfbdd('0xb9')]])){this[_0xfbdd('0x26')][this['actions'][_0xd3f6dd[_0xfbdd('0x132')]][_0xfbdd('0xb9')]]=[];}this[_0xfbdd('0x26')][this[_0xfbdd('0xb4')][_0xd3f6dd[_0xfbdd('0x132')]][_0xfbdd('0xb9')]]['push'](_[_0xfbdd('0xda')](_[_0xfbdd('0x137')](this['actions'][_0xd3f6dd['actionid']],[_0xfbdd('0x138'),_0xfbdd('0x135')]),{'status':_0xd3f6dd[_0xfbdd('0xe4')],'paused':_0xd3f6dd['paused']}));}}}};function unlockQueueStatus(_0x10da22,_0x3bcb54){setTimeout(function(){if(_[_0xfbdd('0x41')](_0x10da22[_0xfbdd('0x139')])){loggerBooked[_0xfbdd('0x9a')](_0xfbdd('0x13a'),_0x3bcb54);}_0x10da22[_0xfbdd('0x139')]=!![];loggerBooked[_0xfbdd('0x83')](_0xfbdd('0x13b'),_0x3bcb54,JSON[_0xfbdd('0x4e')](_[_0xfbdd('0x137')](_0x10da22,['name',_0xfbdd('0x139')])));},0x1f3);}Dialer[_0xfbdd('0xb1')][_0xfbdd('0x3c')]=function(_0x290e01){var _0x31bd8e=this;var _0xd21cbb=_0x31bd8e[_0xfbdd('0x1d')][_0x31bd8e[_0xfbdd('0xb4')][_0x290e01['actionid']][_0xfbdd('0xb9')]];if(strategy[this['voiceQueues'][this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]]['queue']]['strategy']]===_0xfbdd('0x131')){if(this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]]&&this['actions'][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0x135')]){this[_0xfbdd('0x1c')][_0xfbdd('0x13c')](this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0x138')],this['actions'][_0x290e01[_0xfbdd('0x132')]]['stateinterface'])[_0xfbdd('0xb7')](function(_0x5b6534){logger[_0xfbdd('0x9a')](_0xfbdd('0x13d'),util[_0xfbdd('0x99')](_0x5b6534,{'showHidden':![],'depth':null}));})[_0xfbdd('0x1a')](function(){_0x31bd8e[_0xfbdd('0xbb')](_0x31bd8e[_0xfbdd('0x1d')][_0x31bd8e[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]]['queue']]);_0x31bd8e[_0xfbdd('0x1f')][_0x31bd8e['actions'][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0x135')]][_0xfbdd('0x133')]=![];delete _0x31bd8e[_0xfbdd('0xb4')][_0x290e01['actionid']];unlockQueueStatus(_0xd21cbb);});}else{this[_0xfbdd('0xbb')](this['voiceQueues'][this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0xb9')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0x10c')],'ListId':this[_0xfbdd('0xb4')][_0x290e01['actionid']]['ListId'],'VoiceQueueId':this[_0xfbdd('0xb4')][_0x290e01['actionid']][_0xfbdd('0xdd')]||undefined,'CampaignId':this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0xde')]||undefined})['catch'](loggerCatch(_0xfbdd('0x13e')));delete this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]];unlockQueueStatus(_0xd21cbb);}}else if((strategy[this['voiceQueues'][this['actions'][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0xb9')]]['strategy']]||_0xfbdd('0x136'))===_0xfbdd('0x136')){var _0x1b2635;if(this[_0xfbdd('0xb4')][_0x290e01['actionid']]&&!_[_0xfbdd('0x4b')](this[_0xfbdd('0x26')][this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]]['queue']])){if(this[_0xfbdd('0x27')][_0x31bd8e[_0xfbdd('0xb4')][_0x290e01['actionid']]['queue']]){this[_0xfbdd('0x27')][_0x31bd8e[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0xb9')]]=this[_0xfbdd('0x27')][this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0xb9')]]?this[_0xfbdd('0x27')][this[_0xfbdd('0xb4')][_0x290e01['actionid']][_0xfbdd('0xb9')]]:this[_0xfbdd('0x26')][this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]]['queue']]?this[_0xfbdd('0x26')][this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0xb9')]][_0xfbdd('0x13f')]||0x0:0x0;}this[_0xfbdd('0x26')][this[_0xfbdd('0xb4')][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0xb9')]][_0xfbdd('0x13f')]=this['queueBookedRR'][this['actions'][_0x290e01[_0xfbdd('0x132')]][_0xfbdd('0xb9')]];for(var _0x853ae4=0x0;_0x853ae4=0x0;})[_0xfbdd('0xb7')](myreject(_0x3e08ae)));}}else{_0x37fa3b[_0xfbdd('0x15a')](ami[_0xfbdd('0x15b')]({'action':_0xfbdd('0x160'),'command':util['format']('iftime\x20%s,%s',_0x438f11,!_[_0xfbdd('0x41')](config[_0xfbdd('0x156')][_0x3531a3])?_0x3531a3:'')})[_0xfbdd('0x3f')](function(_0x31d1a8){return _0x31d1a8[_0xfbdd('0x15e')]['indexOf'](_0xfbdd('0x15f'))>=0x0;})[_0xfbdd('0xb7')](myreject(_0x3e08ae)));}Promise[_0xfbdd('0x161')](_0x37fa3b)[_0xfbdd('0x3f')](function(_0x3261e4){var _0x10234d=_['some'](_0x3261e4);if(_0x10234d){return _0xa1624c(_0x10234d);}else{_0x132c24[_0xfbdd('0x42')]=_0x2481ef?_0xfbdd('0x162'):_0xfbdd('0x163');return _0x3e08ae(msgResponse(_0xfbdd('0x164'),_0xfbdd('0x152'),_0xfbdd('0x165')+_0x2481ef+'\x20'+_0x5dda63+_0xfbdd('0x166')+util[_0xfbdd('0x99')](_0x438f11,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x3531a3));}})[_0xfbdd('0xb7')](function(_0xe24374){return _0x3e08ae(msgResponse(_0xfbdd('0x151'),_0xfbdd('0x152'),JSON['stringify'](_0xe24374)));});});};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x167')]=function(_0x6fb2d2){var _0x56fb5b=this;return function(){switch(_0x6fb2d2[_0xfbdd('0x168')]){case _0xfbdd('0x169'):freeVariablesPredictive(_0x6fb2d2);_0x56fb5b[_0xfbdd('0x16a')](_0x6fb2d2,0x1);break;case'power':freeVariablesPredictive(_0x6fb2d2);_0x56fb5b['handlePower'](_0x6fb2d2,_0x6fb2d2['dialPowerLevel']);break;case _0xfbdd('0x9'):_0x56fb5b['predictive'](_0x6fb2d2);break;case'booked':freeVariablesPredictive(_0x6fb2d2);_0x56fb5b[_0xfbdd('0x16a')](_0x6fb2d2,0x1);break;default:freeVariablesPredictive(_0x6fb2d2);logger[_0xfbdd('0x9a')](_0xfbdd('0x16b'),_0x6fb2d2[_0xfbdd('0x4a')],_0xfbdd('0x16c'));}};};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x16d')]=function(_0x2af8d9){return Promise[_0xfbdd('0xbf')]()['then'](cmHopper[_0xfbdd('0x16e')](_0x2af8d9['id'],previewRecallmeReminderInterval))['then'](function(_0x52b971){for(var _0x5cf947=0x0;_0x5cf947<_0x52b971['length'];_0x5cf947++){var _0x488ee9=_0x52b971[_0x5cf947]['Agent'][_0xfbdd('0x4a')];if(_0x488ee9)io['to'](util[_0xfbdd('0x7d')](_0xfbdd('0x16f'),_0x488ee9))[_0xfbdd('0x52')](_0xfbdd('0x170'),{'hopper':_0x52b971[_0x5cf947]});}})[_0xfbdd('0xb7')](function(){});};Dialer['prototype'][_0xfbdd('0x171')]=function(_0x4cb200){var _0x41735d=this;return function(){_0x41735d['handleIvr'](_0x4cb200);};};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x32')]=function(_0x2c0f7){var _0xe50305=this;if(isNotPreview(_0x2c0f7['dialMethod'])){if(isVoiceQueueOutbound(_0x2c0f7['type'])&&isActive(_0x2c0f7[_0xfbdd('0x5e')])){_0x2c0f7[_0xfbdd('0xa4')]=!![];Promise[_0xfbdd('0xbf')]()[_0xfbdd('0x3f')](checkIsLoggedIn(_0x2c0f7,_0x2c0f7['loggedIn']))[_0xfbdd('0x3f')](checkIsActive(_0x2c0f7,_0x2c0f7[_0xfbdd('0x5e')]))[_0xfbdd('0x3f')](checkInterval(_0x2c0f7))[_0xfbdd('0x3f')](_0xe50305[_0xfbdd('0x14b')](_0x2c0f7))[_0xfbdd('0x3f')](_0xe50305[_0xfbdd('0x14f')](_0x2c0f7['dialGlobalInterval'],_0x2c0f7[_0xfbdd('0x172')],_0x2c0f7[_0xfbdd('0x4a')],_0x2c0f7))[_0xfbdd('0x3f')](_0xe50305[_0xfbdd('0x150')](_0x2c0f7['Interval'],_0x2c0f7[_0xfbdd('0x172')],_0x2c0f7[_0xfbdd('0x4a')],_0x2c0f7))[_0xfbdd('0x3f')](_0xe50305['checkDialMethod'](_0x2c0f7))['catch'](loggerCatchQueueSummary(_0xfbdd('0x173'),_0x2c0f7));}else{notSendMessagesQueue(_0x2c0f7);}}else{freeVariablesPredictive(_0x2c0f7);}};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x34')]=_[_0xfbdd('0x174')](function(){var _0x84dc89=_['filter'](this['voiceQueues'],function(_0x17a447){return _0x17a447[_0xfbdd('0x175')];});var _0x19b33a=_['filter'](this[_0xfbdd('0x1f')],function(_0x5ea8da){return _0x5ea8da['online']&&_0x5ea8da[_0xfbdd('0xe4')]===_0xfbdd('0x176');});if(_0x84dc89['length']>0x0&&_0x19b33a[_0xfbdd('0x9c')]>0x0){return Promise['resolve']()['then'](cmHopper[_0xfbdd('0x16e')](_['map'](_0x84dc89,'id'),previewRecallmeReminderInterval,_['map'](_0x19b33a,'id')))[_0xfbdd('0x3f')](function(_0x128cc7){for(var _0x415977=0x0;_0x415977<_0x128cc7[_0xfbdd('0x9c')];_0x415977++){var _0x255a01=_0x128cc7[_0x415977][_0xfbdd('0x177')][_0xfbdd('0x4a')];if(_0x255a01)io['to'](util[_0xfbdd('0x7d')](_0xfbdd('0x16f'),_0x255a01))[_0xfbdd('0x52')](_0xfbdd('0x170'),{'hopper':_0x128cc7[_0x415977]});}})[_0xfbdd('0xb7')](function(_0x4bd645){logger[_0xfbdd('0x9a')](_0xfbdd('0x16d'),_0x4bd645);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xfbdd('0xb1')][_0xfbdd('0x178')]=function(){var _0x3332c4=this;var _0x384acb;for(var _0x535376 in this[_0xfbdd('0x1e')]){if(typeof this['campaigns'][_0x535376]!==_0xfbdd('0x9d')){_0x384acb=this['campaigns'][_0x535376];if(isCampaignIvr(_0x384acb[_0xfbdd('0x5b')])&&isActive(_0x384acb['active'])){_0x384acb[_0xfbdd('0xa4')]=!![];Promise[_0xfbdd('0xbf')]()['then'](checkIsActive(_0x384acb,_0x384acb[_0xfbdd('0x7b')]))['then'](checkInterval(_0x384acb))[_0xfbdd('0x3f')](_0x3332c4[_0xfbdd('0x14b')](_0x384acb))[_0xfbdd('0x3f')](_0x3332c4['checkIfTime'](_0x384acb[_0xfbdd('0x179')],_0x384acb[_0xfbdd('0x172')],_0x384acb['name'],_0x384acb))['then'](_0x3332c4[_0xfbdd('0x150')](_0x384acb[_0xfbdd('0x47')],_0x384acb[_0xfbdd('0x172')],_0x384acb[_0xfbdd('0x4a')],_0x384acb))[_0xfbdd('0x3f')](_0x3332c4[_0xfbdd('0x171')](_0x384acb))[_0xfbdd('0xb7')](loggerCatchQueueSummary(_0xfbdd('0x17a'),_0x384acb));}else{notSendMessagesCampaign(_0x384acb);}}}};function getCallerIdRandom(_0x3a0aeb,_0x35e2c3){var _0xf5424e;var _0x585334;var _0x21498e;if(_0x35e2c3<=0x0){_0x35e2c3=0x1;}_0xf5424e=new RegExp(_0xfbdd('0x17b')+_0x35e2c3+'}$');_0x585334=Math[_0xfbdd('0x17c')](0xa,_0x35e2c3-0x1);_0x21498e=Math[_0xfbdd('0x17c')](0xa,_0x35e2c3)-0x1;return util['format']('%s',_[_0xfbdd('0x17d')](_0x3a0aeb,_0xf5424e,_[_0xfbdd('0x17e')](_0x585334,_0x21498e)));}function extractCalleridName(_0x4d4039){var _0x398b85=_0x4d4039['match'](/"(.*?)"/);return _0x398b85?_0x398b85[0x1]:_0x4d4039;}Dialer[_0xfbdd('0xb1')][_0xfbdd('0x17f')]=function(_0x147078,_0xfeddd4){var _0x50810b=this;var _0x2600db=uuid['v4']();this[_0xfbdd('0xb4')][_0x2600db]=new Action(_0x147078,_0xfeddd4,_0x2600db);return new Promise(function(_0x4c476f,_0x3b2406){if(_[_0xfbdd('0x41')](_0x147078)&&typeof _0x147078!==_0xfbdd('0x180')){return _0x3b2406(msgResponse(_0xfbdd('0x181'),'Failure',_0xfbdd('0x182')));}if(_[_0xfbdd('0x41')](_0xfeddd4[_0xfbdd('0x183')])||_0xfeddd4[_0xfbdd('0x183')]===null){return _0x3b2406(msgResponse('originate',_0xfbdd('0x152'),_0xfbdd('0x184')));}var _0x3f2233={'XMD-CALLERID':_0x50810b[_0xfbdd('0xb4')][_0x2600db][_0xfbdd('0x185')](),'XMD-AGI':_0x147078['dialQueueProject']?util[_0xfbdd('0x7d')](_0xfbdd('0x186'),ipAgi,_0x147078['dialQueueProject']):_0xfbdd('0x187'),'XMD-AGIAFTER':_0x147078['dialQueueProject2']?util[_0xfbdd('0x7d')](_0xfbdd('0x186'),ipAgi,_0x147078['dialQueueProject2']):'NONE','XMD-QUEUE':_0x147078['type']===_0xfbdd('0x53')?util[_0xfbdd('0x7d')]('\x22%s,%s%s,,,%s\x22',_0x147078['name'],_0x147078[_0xfbdd('0x188')]||'',_0x147078[_0xfbdd('0x189')]?'c':'',_0x147078[_0xfbdd('0x11e')]||0x3):_0xfbdd('0x187'),'XMD-CONTACTID':_0xfeddd4[_0xfbdd('0x10c')],'XMD-CDRTYPE':_0xfbdd('0x18a'),'CALLERID(all)':_0x50810b[_0xfbdd('0xb4')][_0x2600db][_0xfbdd('0x185')](),'XMD-AMD':_0x147078[_0xfbdd('0xec')]?_0xfbdd('0x18b'):_0xfbdd('0x187'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x147078[_0xfbdd('0xec')]){_0x3f2233[_0xfbdd('0x18c')]=_0x147078[_0xfbdd('0x18d')]||0x9c4;_0x3f2233[_0xfbdd('0x18e')]=_0x147078[_0xfbdd('0x18f')]||0x5dc;_0x3f2233[_0xfbdd('0x190')]=_0x147078[_0xfbdd('0x191')]||0x320;_0x3f2233[_0xfbdd('0x192')]=_0x147078['dialAMDTotalAnalysisTime']||0x1388;_0x3f2233[_0xfbdd('0x193')]=_0x147078[_0xfbdd('0x194')]||0x64;_0x3f2233[_0xfbdd('0x195')]=_0x147078['dialAMDBetweenWordsSilence']||0x32;_0x3f2233['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x147078['dialAMDMaximumNumberOfWords']||0x3;_0x3f2233[_0xfbdd('0x196')]=_0x147078[_0xfbdd('0x197')]||0x100;_0x3f2233[_0xfbdd('0x198')]=_0x147078['dialAMDMaximumWordLength']||0x1388;}if(_0x147078[_0xfbdd('0x5b')]==='outbound'){_0x3f2233['XMD-VOICEQUEUEID']=_0xfeddd4[_0xfbdd('0xdd')];}else{_0x3f2233['XMD-CAMPAIGNID']=_0xfeddd4[_0xfbdd('0xde')];}for(var _0x3f6708 in _0xfeddd4[_0xfbdd('0x199')]){if(typeof _0xfeddd4[_0xfbdd('0x199')][_0x3f6708]!==_0xfbdd('0x9d')){if(isNotNull(_0xfeddd4[_0xfbdd('0x199')][_0x3f6708])&&_0x3f6708!=='id'&&_0x3f6708!==_0xfbdd('0x19a')&&_0x3f6708!==_0xfbdd('0x19b')&&_0x3f6708!==_0xfbdd('0x19c')){_0x3f2233[util[_0xfbdd('0x7d')](_0xfbdd('0x19d'),_0xfbdd('0x19e'),_[_0xfbdd('0x19f')](_0x3f6708))]=_0xfeddd4['Contact'][_0x3f6708];}}}var _0x43c7a5=_0x50810b['isTrunkReachable'](_0x147078['Trunk'])?getCallerId(_0x147078['Trunk'][_0xfbdd('0x7c')],_0x147078[_0xfbdd('0x5f')],_0x147078[_0xfbdd('0x1a0')]>0x0?getCallerIdRandom(_0x147078[_0xfbdd('0x60')],_0x147078[_0xfbdd('0x1a0')]):_0x147078['dialOriginateCallerIdNumber']):getCallerId(_[_0xfbdd('0xb6')](_0x147078[_0xfbdd('0x14c')])?_0x147078[_0xfbdd('0x7a')][_0xfbdd('0x7c')]:_0x147078[_0xfbdd('0x14c')]['callerid'],_0x147078[_0xfbdd('0x5f')],_0x147078[_0xfbdd('0x1a0')]>0x0?getCallerIdRandom(_0x147078[_0xfbdd('0x60')],_0x147078[_0xfbdd('0x1a0')]):_0x147078[_0xfbdd('0x60')]);if(_0x43c7a5){_0x3f2233[_0xfbdd('0x1a1')]=_0x50810b[_0xfbdd('0xb4')][_0x2600db][_0xfbdd('0x1a2')]=extractCalleridName(_0x43c7a5);_0x3f2233[_0xfbdd('0x1a3')]=_0xfeddd4[_0xfbdd('0x183')];}_0x147078[_0xfbdd('0x1a4')]=_0x3f2233;return ami['Action']({'actionid':_0x2600db,'action':_0xfbdd('0x181'),'channel':_0x50810b[_0xfbdd('0xe2')](_0x147078[_0xfbdd('0x7a')])?util[_0xfbdd('0x7d')]('SIP/%s/%s%s',_0x147078[_0xfbdd('0x7a')]['name'],isNotNull(_0x147078[_0xfbdd('0x61')])?_0x147078[_0xfbdd('0x61')]['trim']()||'':'',_0x147078['dialCutDigit']>0x0?_0xfeddd4[_0xfbdd('0x183')][_0xfbdd('0x1a5')](_0x147078[_0xfbdd('0x1a6')]):_0xfeddd4[_0xfbdd('0x183')]):util[_0xfbdd('0x7d')]('SIP/%s/%s%s',_[_0xfbdd('0xb6')](_0x147078[_0xfbdd('0x14c')])?_0x147078['Trunk']['name']:_0x147078[_0xfbdd('0x14c')][_0xfbdd('0x4a')],isNotNull(_0x147078['dialPrefix'])?_0x147078['dialPrefix'][_0xfbdd('0x1a7')]()||'':'',_0x147078['dialCutDigit']>0x0?_0xfeddd4[_0xfbdd('0x183')][_0xfbdd('0x1a5')](_0x147078[_0xfbdd('0x1a6')]):_0xfeddd4[_0xfbdd('0x183')]),'callerid':_0x43c7a5,'Exten':'xcally-motion-dialer','Context':_0xfbdd('0x1a8'),'Priority':'1','variable':_0x3f2233,'timeout':(_0x147078[_0xfbdd('0x1a9')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2600db})[_0xfbdd('0x3f')](function(_0x20498b){return _0x4c476f(_0x20498b);})[_0xfbdd('0xb7')](function(_0x77b0c6){_0x147078[_0xfbdd('0x69')]+=0x1;var _0x90156d=new History(_0x50810b[_0xfbdd('0xb4')][_0x2600db]);logger[_0xfbdd('0x9a')](util[_0xfbdd('0x7d')]('[originateError]:\x20%s',JSON[_0xfbdd('0x4e')](_0x77b0c6)));_0x90156d[_0xfbdd('0xad')]=0xe;_0x90156d[_0xfbdd('0xae')]=_0xfbdd('0x1aa');_0x90156d['starttime']=moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b'));_0x90156d[_0xfbdd('0xaf')]=_0x90156d[_0xfbdd('0xb0')];_0x50810b[_0xfbdd('0xd3')](_0x90156d)[_0xfbdd('0xb7')](loggerCatch('[originate][error]'));_0x50810b[_0xfbdd('0xd1')](_0x90156d)['catch'](loggerCatch(_0xfbdd('0x1ab')))[_0xfbdd('0x1a')](function(){delete _0x50810b[_0xfbdd('0xb4')][_0x2600db];return _0x3b2406(msgResponse(_0xfbdd('0x181'),_0xfbdd('0x1ac'),_0xfbdd('0x1ad')));});});});};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x2e')]=function(_0x26198d){var _0x289161=this[_0xfbdd('0xb4')][_0x26198d[_0xfbdd('0x132')]];if(_0x289161){delete this[_0xfbdd('0xb4')][_0x26198d['actionid']];_0x289161[_0xfbdd('0x11d')]=moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b'));var _0x4be492=_0x289161[_0xfbdd('0x5b')]===_0xfbdd('0x80')?this[_0xfbdd('0x1e')][_0x289161[_0xfbdd('0xb9')]]:this[_0xfbdd('0x1d')][_0x289161[_0xfbdd('0x1ae')]()];if(!this[_0xfbdd('0xe1')](_0x26198d['response'])){this['updateOriginated'](_0x4be492);return this[_0xfbdd('0x1af')](_0x289161,_0x4be492,_0x26198d)[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x1b0')));}this[_0xfbdd('0xb3')][_0x26198d['uniqueid']]=_0x289161;}};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x1b1')]=function(_0x98f02f,_0x37509a,_0x580e34){var _0xb0616c=new History(_0x37509a);if(_0xb0616c['countbusyretry']+_0xb0616c[_0xfbdd('0x1b2')]+_0xb0616c[_0xfbdd('0xfa')]+_0xb0616c[_0xfbdd('0xfb')]+_0xb0616c[_0xfbdd('0xfc')]+_0xb0616c['countabandonedretry']+_0xb0616c[_0xfbdd('0xf7')]+_0xb0616c[_0xfbdd('0xfd')]>=_0x580e34['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x98f02f){case 0x3:if(_0xb0616c[_0xfbdd('0xfa')]>=_0x580e34['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0xfbdd('0xc8')]({'active':![],'countnoanswerretry':_0xb0616c[_0xfbdd('0xfa')]+=0x1,'scheduledat':moment()['add'](_0x580e34[_0xfbdd('0x1b3')],'minutes')[_0xfbdd('0x7d')](_0xfbdd('0x10b')),'ContactId':_0xb0616c[_0xfbdd('0x10c')],'ListId':_0xb0616c['ListId'],'VoiceQueueId':_0xb0616c['VoiceQueueId']||undefined,'CampaignId':_0xb0616c[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0xb0616c[_0xfbdd('0xf9')]>=_0x580e34[_0xfbdd('0x1b4')]-0x1){return!![];}this[_0xfbdd('0xc8')]({'active':![],'countbusyretry':_0xb0616c[_0xfbdd('0xf9')]+=0x1,'scheduledat':moment()[_0xfbdd('0x103')](_0x580e34[_0xfbdd('0x1b5')],'minutes')[_0xfbdd('0x7d')](_0xfbdd('0x10b')),'ContactId':_0xb0616c[_0xfbdd('0x10c')],'ListId':_0xb0616c['ListId'],'VoiceQueueId':_0xb0616c[_0xfbdd('0xdd')]||undefined,'CampaignId':_0xb0616c[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x1b6')));break;case 0x8:if(_0xb0616c['countcongestionretry']>=_0x580e34['dialCongestionMaxRetry']-0x1){return!![];}this[_0xfbdd('0xc8')]({'active':![],'countcongestionretry':_0xb0616c[_0xfbdd('0x1b2')]+=0x1,'scheduledat':moment()[_0xfbdd('0x103')](_0x580e34['dialCongestionRetryFrequency'],_0xfbdd('0x104'))['format'](_0xfbdd('0x10b')),'ContactId':_0xb0616c[_0xfbdd('0x10c')],'ListId':_0xb0616c[_0xfbdd('0xdb')],'VoiceQueueId':_0xb0616c[_0xfbdd('0xdd')]||undefined,'CampaignId':_0xb0616c[_0xfbdd('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0xb0616c[_0xfbdd('0xfb')]>=_0x580e34['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xfbdd('0xc8')]({'active':![],'countnosuchnumberretry':_0xb0616c[_0xfbdd('0xfb')]+=0x1,'scheduledat':moment()[_0xfbdd('0x103')](_0x580e34[_0xfbdd('0x1b7')],'minutes')[_0xfbdd('0x7d')](_0xfbdd('0x10b')),'ContactId':_0xb0616c['ContactId'],'ListId':_0xb0616c[_0xfbdd('0xdb')],'VoiceQueueId':_0xb0616c[_0xfbdd('0xdd')]||undefined,'CampaignId':_0xb0616c[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x1b8')));}break;case 0xa:if(_0xb0616c[_0xfbdd('0xfc')]>=_0x580e34[_0xfbdd('0x124')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0xb0616c[_0xfbdd('0xfc')]+=0x1,'scheduledat':moment()[_0xfbdd('0x103')](_0x580e34[_0xfbdd('0x123')],_0xfbdd('0x104'))[_0xfbdd('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb0616c[_0xfbdd('0x10c')],'ListId':_0xb0616c[_0xfbdd('0xdb')],'VoiceQueueId':_0xb0616c['VoiceQueueId']||undefined,'CampaignId':_0xb0616c[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x126')));break;case 0xb:if(_0xb0616c['countabandonedretry']>=_0x580e34[_0xfbdd('0x12e')]-0x1){return!![];}this[_0xfbdd('0xc8')]({'active':![],'countabandonedretry':_0xb0616c[_0xfbdd('0x109')]+=0x1,'scheduledat':moment()[_0xfbdd('0x103')](_0x580e34[_0xfbdd('0x12c')],_0xfbdd('0x104'))[_0xfbdd('0x7d')](_0xfbdd('0x10b')),'ContactId':_0xb0616c[_0xfbdd('0x10c')],'ListId':_0xb0616c[_0xfbdd('0xdb')],'VoiceQueueId':_0xb0616c[_0xfbdd('0xdd')]||undefined,'CampaignId':_0xb0616c[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0xb0616c[_0xfbdd('0xf7')]>=_0x580e34[_0xfbdd('0x101')]-0x1){return!![];}this[_0xfbdd('0xc8')]({'active':![],'countmachineretry':_0xb0616c[_0xfbdd('0xf7')]+=0x1,'scheduledat':moment()[_0xfbdd('0x103')](_0x580e34[_0xfbdd('0x10a')],'minutes')[_0xfbdd('0x7d')](_0xfbdd('0x10b')),'ContactId':_0xb0616c[_0xfbdd('0x10c')],'ListId':_0xb0616c[_0xfbdd('0xdb')],'VoiceQueueId':_0xb0616c[_0xfbdd('0xdd')]||undefined,'CampaignId':_0xb0616c[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x105')));break;case 0x14:if(_0xb0616c['countagentrejectretry']>=_0x580e34['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xfbdd('0xc8')]({'active':![],'countagentrejectretry':_0xb0616c[_0xfbdd('0xfd')]+=0x1,'scheduledat':moment()['add'](_0x580e34['dialAgentRejectRetryFrequency'],'minutes')['format'](_0xfbdd('0x10b')),'ContactId':_0xb0616c[_0xfbdd('0x10c')],'ListId':_0xb0616c['ListId'],'VoiceQueueId':_0xb0616c[_0xfbdd('0xdd')]||undefined,'CampaignId':_0xb0616c['CampaignId']||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x1b9')));break;default:return!![];}};Dialer[_0xfbdd('0xb1')]['callProgressDetecting']=function(_0x59bd5f,_0x252634,_0x4f1376){var _0x48db30=this;var _0x34b3cd=new History(_0x59bd5f);var _0x3dfe84=![];var _0x554ccd;var _0x109fe0;return new Promise(function(_0x2db6d4,_0x4a8cb3){if(_[_0xfbdd('0x41')](_0x252634)&&typeof _0x252634!=='object'){return _0x4a8cb3(msgResponse(_0xfbdd('0x1ba'),_0xfbdd('0x152'),_0xfbdd('0x1bb')));}if(_[_0xfbdd('0x41')](_0x4f1376)&&typeof _0x4f1376!=='object'){return _0x4a8cb3(msgResponse(_0xfbdd('0x1ba'),_0xfbdd('0x152'),_0xfbdd('0x1bc')));}_0x48db30[_0xfbdd('0xc1')](_0x34b3cd,_0x4f1376[_0xfbdd('0x114')],_0x252634)['then'](function(_0x5c8178){if(_0x5c8178[_0xfbdd('0x125')]==0x1)_0x3dfe84=!![];switch(_0x4f1376[_0xfbdd('0x114')]){case'0':_0x252634[_0xfbdd('0x68')]+=0x1;_0x34b3cd[_0xfbdd('0xad')]=0x0;_0x34b3cd[_0xfbdd('0xae')]=_0xfbdd('0x1bd');_0x34b3cd['countnosuchnumberretry']+=0x1;_0x34b3cd[_0xfbdd('0xf8')]+=0x1;ami[_0xfbdd('0x52')](_0xfbdd('0x1be'),ut[_0xfbdd('0xf2')](_0x59bd5f,_0xfbdd('0x1bf')));_0x554ccd=_0x252634['dialNoSuchNumberRetryFrequency'];_0x109fe0=_0x252634[_0xfbdd('0x1c0')];_0x48db30[_0xfbdd('0xd3')](_0x34b3cd)[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x108')));if(_0x48db30['checkRetriveMax'](0x0,_0x59bd5f,_0x252634)&&!_0x3dfe84){if(_0x34b3cd[_0xfbdd('0xfb')]>=_0x252634[_0xfbdd('0x1c1')]){_0x48db30['createStateFinal'](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1c2'));}else{_0x48db30[_0xfbdd('0xff')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1c2'));}}break;case'3':_0x252634[_0xfbdd('0x1c3')]+=0x1;_0x34b3cd[_0xfbdd('0xad')]=0x3;_0x34b3cd[_0xfbdd('0xae')]=_0xfbdd('0x1c4');_0x34b3cd['countnoanswerretry']+=0x1;_0x34b3cd['countglobal']+=0x1;var _0x5ee08a=ut[_0xfbdd('0x1c5')](_0x59bd5f,_0x252634);ami['emit'](_0xfbdd('0x1c6'),_0x5ee08a);_0x554ccd=_0x252634[_0xfbdd('0x1b3')];_0x109fe0=_0x252634['callAdditionalPhoneAfterMin'];_0x48db30[_0xfbdd('0xd3')](_0x34b3cd)[_0xfbdd('0xb7')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x48db30[_0xfbdd('0x1b1')](0x3,_0x59bd5f,_0x252634)&&!_0x3dfe84){if(_0x34b3cd[_0xfbdd('0xfa')]>=_0x252634[_0xfbdd('0x1c7')]){_0x48db30[_0xfbdd('0x1c8')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1c9'));}else{_0x48db30[_0xfbdd('0xff')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1c9'));}}break;case'5':_0x252634[_0xfbdd('0x64')]+=0x1;_0x34b3cd[_0xfbdd('0xad')]=0x5;_0x34b3cd['statedesc']=_0xfbdd('0x1ca');_0x34b3cd[_0xfbdd('0xf9')]+=0x1;_0x34b3cd[_0xfbdd('0xf8')]+=0x1;ami[_0xfbdd('0x52')]('custom:agentbusy',ut[_0xfbdd('0xf2')](_0x59bd5f,_0xfbdd('0x1cb')));_0x554ccd=_0x252634['dialBusyRetryFrequency'];_0x109fe0=_0x252634['callAdditionalPhoneAfterMin'];_0x48db30['createHistory'](_0x34b3cd)['catch'](loggerCatch(_0xfbdd('0x1cc')));if(_0x48db30[_0xfbdd('0x1b1')](0x5,_0x59bd5f,_0x252634)&&!_0x3dfe84){if(_0x34b3cd[_0xfbdd('0xf9')]>=_0x252634[_0xfbdd('0x1b4')]){_0x48db30[_0xfbdd('0x1c8')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1cd'));}else{_0x48db30[_0xfbdd('0xff')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1cd'));}}break;case'8':_0x252634[_0xfbdd('0x65')]+=0x1;_0x34b3cd[_0xfbdd('0xad')]=0x8;_0x34b3cd[_0xfbdd('0xae')]=_0xfbdd('0x1ce');_0x34b3cd['countcongestionretry']+=0x1;_0x34b3cd[_0xfbdd('0xf8')]+=0x1;_0x554ccd=_0x252634[_0xfbdd('0x1cf')];_0x109fe0=_0x252634['callAdditionalPhoneAfterMin'];ami['emit'](_0xfbdd('0x1d0'),ut[_0xfbdd('0xf2')](_0x59bd5f,_0xfbdd('0x1d1')));_0x48db30[_0xfbdd('0xd3')](_0x34b3cd)[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x1d2')));if(_0x48db30['checkRetriveMax'](0x8,_0x59bd5f,_0x252634)&&!_0x3dfe84){if(_0x34b3cd[_0xfbdd('0x1b2')]>=_0x252634[_0xfbdd('0x1d3')]){_0x48db30['createStateFinal'](_0x34b3cd,_0x2db6d4,_0x4a8cb3,'reason\x208\x20congestion');}else{_0x48db30[_0xfbdd('0xff')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1d4'));}}break;case'11':_0x252634[_0xfbdd('0x1d5')]+=0x1;_0x34b3cd[_0xfbdd('0xad')]=0xb;_0x34b3cd['statedesc']='Abandoned';_0x34b3cd[_0xfbdd('0x109')]+=0x1;_0x34b3cd['countglobal']+=0x1;_0x554ccd=_0x252634['dialAbandonedRetryFrequency'];_0x109fe0=_0x252634[_0xfbdd('0x1c0')];_0x48db30[_0xfbdd('0xd3')](_0x34b3cd)[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x1d6')));if(_0x48db30[_0xfbdd('0x1b1')](0xb,_0x59bd5f,_0x252634)&&!_0x3dfe84){if(_0x34b3cd[_0xfbdd('0x109')]>=_0x252634[_0xfbdd('0x12e')]){_0x48db30['createStateFinal'](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1d7'));}else{_0x48db30[_0xfbdd('0xff')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1d7'));}}break;case'20':_0x252634['outboundRejectCallsDay']+=0x1;_0x34b3cd[_0xfbdd('0xad')]=0x14;_0x34b3cd[_0xfbdd('0xae')]=_0xfbdd('0x1d8');_0x34b3cd[_0xfbdd('0xfd')]+=0x1;_0x34b3cd['countglobal']+=0x1;_0x554ccd=_0x252634[_0xfbdd('0x1d9')];_0x109fe0=_0x252634[_0xfbdd('0x1c0')];ami[_0xfbdd('0x52')]('custom:agentreject',ut[_0xfbdd('0xf2')](_0x59bd5f,'agentreject'));_0x48db30[_0xfbdd('0xd3')](_0x34b3cd)[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x1da')));if(_0x48db30['checkRetriveMax'](0x14,_0x59bd5f,_0x252634)&&!_0x3dfe84){if(_0x34b3cd['countagentrejectretry']>=_0x252634['dialAgentRejectMaxRetry']){_0x48db30[_0xfbdd('0x1c8')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0xfbdd('0x1db'));}else{_0x48db30[_0xfbdd('0xff')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,'reason\x2020\x20agentreject');}}break;default:_0x252634['outboundUnknownCallsDay']+=0x1;_0x34b3cd[_0xfbdd('0xad')]=0xc;_0x34b3cd[_0xfbdd('0xae')]=_0x4f1376[_0xfbdd('0x114')];_0x554ccd=_0x252634[_0xfbdd('0x1d9')];_0x109fe0=_0x252634[_0xfbdd('0x1c0')];_0x48db30[_0xfbdd('0xd3')](_0x34b3cd)[_0xfbdd('0xb7')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x48db30[_0xfbdd('0x1b1')](_0x4f1376[_0xfbdd('0x114')],_0x59bd5f,_0x252634)&&!_0x3dfe84){if(_0x34b3cd['countbusyretry']+_0x34b3cd[_0xfbdd('0x1b2')]+_0x34b3cd[_0xfbdd('0xfa')]+_0x34b3cd[_0xfbdd('0xfb')]+_0x34b3cd[_0xfbdd('0xfc')]+_0x34b3cd[_0xfbdd('0x109')]+_0x34b3cd['countmachineretry']+_0x34b3cd['countagentrejectretry']>=_0x252634[_0xfbdd('0xfe')]){_0x48db30[_0xfbdd('0xff')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0x4f1376[_0xfbdd('0x114')]);}else{_0x48db30[_0xfbdd('0x1c8')](_0x34b3cd,_0x2db6d4,_0x4a8cb3,_0x4f1376[_0xfbdd('0x114')]);}}}})[_0xfbdd('0x3f')](function(){if(_0x3dfe84){_0x48db30[_0xfbdd('0xc2')](_0x34b3cd,_0x554ccd,_0x109fe0)['then'](function(){return _0x2db6d4(0x1);});}});});};Dialer[_0xfbdd('0xb1')][_0xfbdd('0xff')]=function(_0x48f975,_0x386408,_0x5592ec,_0x5419f4){var _0x34c063=new Final(_0x48f975);_0x34c063[_0xfbdd('0xad')]=0xf;_0x34c063[_0xfbdd('0xae')]=_0xfbdd('0x1dc');this[_0xfbdd('0x1c8')](_0x34c063,_0x386408,_0x5592ec,_0x5419f4);};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x1c8')]=function(_0x4ac53b,_0x376acf,_0x518599,_0x2047ee){this['moveContactManagedDialer'](_0x4ac53b)[_0xfbdd('0x3f')](function(){return _0x376acf(msgResponse(_0xfbdd('0x1ba'),'Success',_0x2047ee));})['catch'](function(){return _0x518599(msgResponse(_0xfbdd('0x1dd'),_0xfbdd('0x152'),'contact\x20not\x20moved'));});};Dialer[_0xfbdd('0xb1')]['predictive']=function(_0x12eb67){var _0x289076=_0x12eb67[_0xfbdd('0x1de')]/0x64;var _0x213ecc=_0x12eb67[_0xfbdd('0x11f')]/(_0x12eb67[_0xfbdd('0x11f')]+_0x12eb67[_0xfbdd('0x62')]);var _0x4f4d52=Math[_0xfbdd('0x1df')](_0x12eb67[_0xfbdd('0x1e0')]*(_0x12eb67[_0xfbdd('0x1e1')]/0x64));var _0x1d3e09=Math[_0xfbdd('0x1df')](_0x12eb67[_0xfbdd('0x1e0')]*(_0x12eb67['predictiveIntervalMinThreshold']/0x64));var _0x5df3a7=_0x12eb67['available']+_0x12eb67['talking'];var _0x4a681f=Math['floor'](_0x12eb67[_0xfbdd('0x75')]*_0x12eb67['erlangAbandonmentRate']*_0x12eb67['predictiveIntervalHitRate']*_0x12eb67[_0xfbdd('0x72')]);if(_['isUndefined'](_0x12eb67[_0xfbdd('0x24')])){if(!_['isUndefined'](_0x12eb67[_0xfbdd('0x79')])){_0x12eb67[_0xfbdd('0x79')]=undefined;loggerPredictive[_0xfbdd('0x9a')](_0xfbdd('0x1e2'),_0xfbdd('0x1e3'));}if(!_['isUndefined'](_0x12eb67[_0xfbdd('0x94')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xfbdd('0x1e4'));clearInterval(_0x12eb67[_0xfbdd('0x94')]);_0x12eb67['handlePredictive']=undefined;}_0x12eb67[_0xfbdd('0x24')]=moment()['format'](_0xfbdd('0x10b'));loggerPredictive[_0xfbdd('0x83')](_0x12eb67[_0xfbdd('0x4a')],'collection\x20data\x20in\x20progressive\x20at',_0x12eb67['startProgressive']);this[_0xfbdd('0x16a')](_0x12eb67,0x1);}else if(ifInterval(_0x12eb67[_0xfbdd('0x1e5')],_0x12eb67[_0xfbdd('0x24')])){this[_0xfbdd('0x16a')](_0x12eb67,0x1);loggerPredictiveCalls['info'](_0xfbdd('0x1e6'),_0x12eb67[_0xfbdd('0x24')],_0x12eb67[_0xfbdd('0x4a')]);_0x12eb67['erlangCalls']=0x0;_0x12eb67[_0xfbdd('0x120')]=0x0;}else if(_0x289076<_0x213ecc&&_0x12eb67[_0xfbdd('0x1e7')]===_0xfbdd('0x1e8')){freeVariablesPredictive(_0x12eb67);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x1e9'),_0xfbdd('0x1ea'),_0x213ecc,_0xfbdd('0x24'),_0x12eb67[_0xfbdd('0x4a')]);}else if(_0x4a681f<_0x12eb67[_0xfbdd('0x120')]&&_0x12eb67[_0xfbdd('0x1e7')]==='dropRate'){freeVariablesPredictive(_0x12eb67);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x1eb'),_0xfbdd('0x1ec'),_0x4a681f,_0xfbdd('0x1ed'),_0x12eb67[_0xfbdd('0x120')],_0xfbdd('0x24'),_0x12eb67[_0xfbdd('0x4a')]);}else if(!ifInterval(_0x12eb67[_0xfbdd('0x1e5')],_0x12eb67[_0xfbdd('0x24')])&&_[_0xfbdd('0x41')](_0x12eb67[_0xfbdd('0x79')])&&!_[_0xfbdd('0x41')](_0x12eb67[_0xfbdd('0x24')])){_0x12eb67[_0xfbdd('0x79')]=moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b'));loggerPredictive[_0xfbdd('0x83')](_0x12eb67[_0xfbdd('0x4a')],'started\x20in\x20predictive\x20at',_0x12eb67[_0xfbdd('0x79')]);this[_0xfbdd('0xc5')](_0x12eb67[_0xfbdd('0x1e5')])[_0xfbdd('0x3f')](this[_0xfbdd('0x1ee')](_0x12eb67))[_0xfbdd('0x3f')](mergeDataErlangB(_0x12eb67))[_0xfbdd('0x3f')](this[_0xfbdd('0x1ef')](_0x12eb67))[_0xfbdd('0xb7')](loggerCatchPredictive(_0xfbdd('0x1f0'),_0x12eb67));}else if(!ifInterval(_0x12eb67[_0xfbdd('0x1e5')],_0x12eb67[_0xfbdd('0x79')])){_0x12eb67[_0xfbdd('0x120')]=0x0;_0x12eb67['startPredictive']=moment()[_0xfbdd('0x7d')](_0xfbdd('0x10b'));loggerPredictive[_0xfbdd('0x83')](_0x12eb67['name'],_0xfbdd('0x1f1'),_0x12eb67[_0xfbdd('0x79')]);clearInterval(_0x12eb67['handlePredictive']);_0x12eb67['handlePredictive']=undefined;this[_0xfbdd('0xc5')](_0x12eb67[_0xfbdd('0x1e5')])[_0xfbdd('0x3f')](this[_0xfbdd('0x1ee')](_0x12eb67))[_0xfbdd('0x3f')](mergeDataErlangB(_0x12eb67))[_0xfbdd('0x3f')](this['startMethodPredictive'](_0x12eb67))['catch'](loggerCatchPredictive(_0xfbdd('0x1f2'),_0x12eb67));}else if(_0x12eb67[_0xfbdd('0x1e0')]&&_0x5df3a7<_0x12eb67['predictiveIntervalAvailable']-_0x1d3e09){freeVariablesPredictive(_0x12eb67);loggerPredictive[_0xfbdd('0x83')](_0x12eb67[_0xfbdd('0x4a')],_0xfbdd('0x1f3'),_0x5df3a7,')\x20are\x20less\x20than\x20threshold\x20(',_0x12eb67['predictiveIntervalAvailable'],'-',_0x1d3e09,'=',_0x12eb67['predictiveIntervalAvailable']-_0x1d3e09,')');}else if(_0x12eb67[_0xfbdd('0x1e0')]&&_0x5df3a7>_0x12eb67['predictiveIntervalAvailable']+_0x4f4d52){freeVariablesPredictive(_0x12eb67);loggerPredictive['info'](_0x12eb67[_0xfbdd('0x4a')],_0xfbdd('0x1f3'),_0x5df3a7,_0xfbdd('0x1f4'),_0x12eb67['predictiveIntervalAvailable'],'+',_0x4f4d52,'=',_0x12eb67[_0xfbdd('0x1e0')]+_0x4f4d52,')');}};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x1ee')]=function(_0x102004){var _0x20f654=this;return function(_0x52adf3){return new Promise(function(_0x32e426,_0x464838){_[_0xfbdd('0xda')](_0x102004,_0x52adf3[0x0]);if(checkGetDataPredictive(_0x52adf3[0x0])){var _0x3ebf57=_0x102004[_0xfbdd('0x1e0')]=_0x102004[_0xfbdd('0x5a')]+_0x102004['available'];var _0x4d66d0=_0x102004[_0xfbdd('0x1e5')]*0x3c;var _0x41b619=_0x52adf3[0x0][_0xfbdd('0x89')]+_0x52adf3[0x0][_0xfbdd('0x6d')];var _0x5305d3=(_0x52adf3[0x0][_0xfbdd('0x1f5')]+_0x52adf3[0x0][_0xfbdd('0x6f')]+_0x52adf3[0x0][_0xfbdd('0x6e')])/_0x52adf3[0x0][_0xfbdd('0x73')];_0x102004['predictiveIntervalHitRate']=_0x5305d3>0x0?_0x5305d3:0x1;switch(_0x102004[_0xfbdd('0x1e7')]){case'dropRate':var _0x5537f5=_0x102004[_0xfbdd('0x1de')]/0x64;return _0x20f654['abandonmentRate'](_0x3ebf57,_0x4d66d0,_0x41b619,_0x5305d3,_0x5537f5)[_0xfbdd('0x3f')](function(_0xfeee7a){return _0x32e426(_0xfeee7a);});case _0xfbdd('0x1f6'):var _0x11d2c9=_0x102004[_0xfbdd('0x1de')]/0x64;return _0x20f654[_0xfbdd('0x1f7')](_0x3ebf57,_0x4d66d0,_0x41b619,_0x5305d3,_0x11d2c9)[_0xfbdd('0x3f')](function(_0x4d1049){return _0x32e426(_0x4d1049);});default:return _0x464838(msgResponse('[getDataPredictive]',_0xfbdd('0x152'),_0xfbdd('0x1f8')));}}else{return _0x464838(msgResponse(_0xfbdd('0x1f9'),_0xfbdd('0x152'),_0xfbdd('0x1fa')));}});};};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x1fb')]=function(_0x459c92){var _0x34c9f=this;return function(_0x16f62c){return new Promise(function(_0x50ce41,_0x44d648){_['merge'](_0x459c92,_0x16f62c[0x0]);if(checkGetDataPredictive(_0x16f62c[0x0])){loggerPredictive['info'](JSON[_0xfbdd('0x4e')](_0x16f62c[0x0]));if(_0x459c92['dialPredictiveOptimization']===_0xfbdd('0x1e8')){return _0x34c9f[_0xfbdd('0xd0')](_0x459c92['id'])[_0xfbdd('0x3f')](function(_0x384b92){var _0x4c2523=_0x459c92[_0xfbdd('0x1fc')]-_0x384b92[0x0][_0xfbdd('0x1fd')];var _0x7b8348=_0x459c92[_0xfbdd('0x1e5')]*0x3c;var _0x2b99f0=_0x16f62c[0x0][_0xfbdd('0x89')]+_0x16f62c[0x0]['predictiveIntervalAvgHoldtime'];var _0x4e41bd=(_0x16f62c[0x0]['predictiveIntervalAnsweredCalls']+_0x16f62c[0x0][_0xfbdd('0x6f')]+_0x16f62c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x16f62c[0x0][_0xfbdd('0x73')];var _0x3ad516=_0x459c92['dialPredictiveOptimizationPercentage']/0x64;_0x459c92[_0xfbdd('0x1fe')]=_0x384b92[0x0][_0xfbdd('0x1fd')]||0x0;_0x459c92['predictiveIntervalHitRate']=_0x4e41bd>0x0?_0x4e41bd:0x1;return _0x34c9f[_0xfbdd('0x1ff')](_0x4c2523,_0x7b8348,_0x2b99f0,_0x4e41bd,_0x3ad516);})['then'](function(_0x33b455){return _0x50ce41(_0x33b455);})[_0xfbdd('0xb7')](function(_0x3659cd){return _0x44d648(msgResponse('[CatchErlangB]',_0xfbdd('0x152'),JSON[_0xfbdd('0x4e')](_0x3659cd)));});}if(_0x459c92[_0xfbdd('0x1e7')]===_0xfbdd('0x1f6')){return _0x34c9f['getVoiceQueueRtPauses'](_0x459c92['id'])['then'](function(_0x48fdeb){var _0x521a19=_0x459c92[_0xfbdd('0x1fc')]-_0x48fdeb[0x0][_0xfbdd('0x1fd')];var _0x3120a5=_0x459c92[_0xfbdd('0x1e5')]*0x3c;var _0x3c437d=_0x16f62c[0x0][_0xfbdd('0x89')]+_0x16f62c[0x0]['predictiveIntervalAvgHoldtime'];var _0x4782e4=(_0x16f62c[0x0][_0xfbdd('0x1f5')]+_0x16f62c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x16f62c[0x0][_0xfbdd('0x6e')])/_0x16f62c[0x0]['predictiveIntervalTotalCalls'];var _0x1348fe=_0x459c92[_0xfbdd('0x1de')]/0x64;_0x459c92[_0xfbdd('0x1fe')]=_0x48fdeb[0x0][_0xfbdd('0x1fd')]||0x0;_0x459c92['predictiveIntervalHitRate']=_0x4782e4>0x0?_0x4782e4:0x1;return _0x34c9f['busyFactor'](_0x521a19,_0x3120a5,_0x3c437d,_0x4782e4,_0x1348fe);})[_0xfbdd('0x3f')](function(_0x2b806b){return _0x50ce41(_0x2b806b);})['catch'](function(_0x33f065){return _0x44d648(msgResponse(_0xfbdd('0x200'),_0xfbdd('0x152'),JSON[_0xfbdd('0x4e')](_0x33f065)));});}}else{return _0x44d648(msgResponse(_0xfbdd('0x1f9'),_0xfbdd('0x152'),'check\x20failure'));}});};};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x1ef')]=function(_0x5309c5){var _0x4be24f=this;return function(){var _0x398f85=0x0;var _0x43812f=Math['floor'](_0x5309c5[_0xfbdd('0x76')]*0x3e8);if(_0x43812f>0x0){_0x43812f=_0x43812f<0x64?0x64:_0x43812f;loggerPredictive['info'](_0x5309c5[_0xfbdd('0x4a')],'one\x20call\x20every:',_0x43812f,_0xfbdd('0x4f'));_0x5309c5[_0xfbdd('0x94')]=setInterval(function(){_0x4be24f[_0xfbdd('0x94')](_0x5309c5);loggerPredictiveCalls[_0xfbdd('0x83')](_0xfbdd('0x201'),_0x398f85+=0x1);},_0x43812f);}else{loggerPredictive[_0xfbdd('0x83')](_0x5309c5[_0xfbdd('0x4a')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype']['checkContactBlack']=function(_0x34a7a3,_0x3f9a1d){var _0x43002e=this;return function(_0x19e8c9){if(_[_0xfbdd('0x4b')](_0x19e8c9)){if(_[_0xfbdd('0xb6')](_0x3f9a1d[_0xfbdd('0xdc')])||!_0x3f9a1d[_0xfbdd('0x202')]){if(_0x34a7a3[_0xfbdd('0x168')]===_0xfbdd('0x203')){_0x34a7a3['queueStatusComplete']=_[_0xfbdd('0x41')](_0x34a7a3[_0xfbdd('0x139')])?!![]:_0x34a7a3['queueStatusComplete'];var _0x5ec043=uuid['v4']();_0x43002e[_0xfbdd('0xb4')][_0x5ec043]=new Action(_0x34a7a3,_0x3f9a1d,_0x5ec043);loggerBooked[_0xfbdd('0x83')](_0xfbdd('0x204'),_0x5ec043,_0xfbdd('0x205'),JSON[_0xfbdd('0x4e')](_0x34a7a3[_0xfbdd('0x139')]),_0xfbdd('0x206'),_0x34a7a3['name']);if(_0x34a7a3[_0xfbdd('0x139')]){_0x34a7a3[_0xfbdd('0x139')]=![];_0x43002e['queueBooked'][_0x43002e[_0xfbdd('0xb4')][_0x5ec043][_0xfbdd('0xb9')]]=[];ami[_0xfbdd('0x15b')]({'actionid':_0x5ec043,'action':_0xfbdd('0x207'),'queue':_0x34a7a3['name']})[_0xfbdd('0xb7')](function(){_0x43002e[_0xfbdd('0xbb')](_0x34a7a3);_0x43002e[_0xfbdd('0xc8')]({'active':![],'ContactId':_0x43002e['actions'][_0x5ec043][_0xfbdd('0x10c')],'ListId':_0x43002e['actions'][_0x5ec043][_0xfbdd('0xdb')],'VoiceQueueId':_0x43002e[_0xfbdd('0xb4')][_0x5ec043][_0xfbdd('0xdd')]||undefined,'CampaignId':_0x43002e[_0xfbdd('0xb4')][_0x5ec043][_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x208')));delete _0x43002e[_0xfbdd('0xb4')][_0x5ec043];});}else{loggerBooked[_0xfbdd('0x83')](_0xfbdd('0x209'),JSON['stringify'](_0x34a7a3[_0xfbdd('0x139')]),_0xfbdd('0x206'),_0x34a7a3[_0xfbdd('0x4a')]);_0x43002e[_0xfbdd('0xbb')](_0x34a7a3);_0x43002e[_0xfbdd('0xc8')]({'active':![],'ContactId':_0x43002e['actions'][_0x5ec043][_0xfbdd('0x10c')],'ListId':_0x43002e[_0xfbdd('0xb4')][_0x5ec043]['ListId'],'VoiceQueueId':_0x43002e['actions'][_0x5ec043][_0xfbdd('0xdd')]||undefined,'CampaignId':_0x43002e[_0xfbdd('0xb4')][_0x5ec043][_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x208')));delete _0x43002e[_0xfbdd('0xb4')][_0x5ec043];}}else{return _0x43002e['actionOriginate'](_0x34a7a3,_0x3f9a1d);}}else{if(getDiff(_0x3f9a1d[_0xfbdd('0x20a')])<_0x34a7a3['dialRecallMeTimeout']*0x3c){if(_0x3f9a1d[_0xfbdd('0x177')]&&!_0x3f9a1d[_0xfbdd('0x177')][_0xfbdd('0x20b')]){_0x43002e['preview'][_0xfbdd('0x13c')](_0x3f9a1d['id'])[_0xfbdd('0x1a')](function(){_0x43002e[_0xfbdd('0xbb')](_0x34a7a3);});}else{_0x43002e[_0xfbdd('0x20c')]({'active':![]},_0x3f9a1d['id'],0x1)[_0xfbdd('0x1a')](function(){_0x43002e[_0xfbdd('0xbb')](_0x34a7a3);});}}else{_0x34a7a3['outboundReCallsDay']+=0x1;_0x43002e[_0xfbdd('0xbb')](_0x34a7a3);if(_0x34a7a3[_0xfbdd('0x20d')]){_0x43002e[_0xfbdd('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3f9a1d[_0xfbdd('0x10c')],'ListId':_0x3f9a1d['ListId'],'VoiceQueueId':_0x3f9a1d[_0xfbdd('0xdd')]||undefined,'CampaignId':_0x3f9a1d[_0xfbdd('0xde')]||undefined})[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x20e')));_0x43002e[_0xfbdd('0xd3')](createObjHistory(_0x34a7a3,_0x3f9a1d,'RECALLINQUEUE',0x17,_0xfbdd('0x20f')))[_0xfbdd('0xb7')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x43002e[_0xfbdd('0xd9')](createObjHistory(_0x34a7a3,_0x3f9a1d,_0xfbdd('0x210'),0x16,_0xfbdd('0x211')),_0xfbdd('0x212'),_0xfbdd('0x213'));}}}}else{_0x34a7a3[_0xfbdd('0x63')]+=0x1;_0x43002e[_0xfbdd('0xd9')](createObjHistory(_0x34a7a3,_0x3f9a1d,'BLACKLIST',0xd,'Blacklist'),_0xfbdd('0x214'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0xfbdd('0xb1')]['handleIvr']=function(_0x5d79bc){var _0x29560c=this;var _0x1574a4=_0x5d79bc['limitCalls']-_0x5d79bc[_0xfbdd('0x74')]-_0x5d79bc['temp'];emitCampaignSummary(_0x5d79bc);if(_0x1574a4>0x0){if(_0x1574a4>this['maxNumberOriginate']){_0x1574a4=this[_0xfbdd('0x21')];}_0x5d79bc[_0xfbdd('0xcc')]+=_0x1574a4;this['getContactDialerIvr'](_0x5d79bc['id'],_0x1574a4,_0x5d79bc[_0xfbdd('0x215')],_0x5d79bc)[_0xfbdd('0x3f')](function(_0x10a30a){_0x5d79bc[_0xfbdd('0xcc')]-=_0x1574a4;_0x5d79bc[_0xfbdd('0xcc')]=_0x5d79bc[_0xfbdd('0xcc')]>0x0?_0x5d79bc[_0xfbdd('0xcc')]:0x0;if(!checkContactEmpty(_0x10a30a)){_0x5d79bc['message']=_0xfbdd('0xa2');logger['info'](_0xfbdd('0x216')+_0x5d79bc[_0xfbdd('0x4a')]);}else{_0x5d79bc[_0xfbdd('0x74')]+=_0x10a30a[_0xfbdd('0x9c')];_0x5d79bc['message']=_0xfbdd('0x217');for(var _0x567a85=0x0;_0x567a85<_0x10a30a[_0xfbdd('0x9c')];_0x567a85+=0x1){_0x5d79bc['ivrTotalCallsDays']+=0x1;if(_[_0xfbdd('0xb6')](_0x10a30a[_0x567a85])||_[_0xfbdd('0xb6')](_0x10a30a[_0x567a85][_0xfbdd('0x199')])||_[_0xfbdd('0xb6')](_0x10a30a[_0x567a85][_0xfbdd('0x183')])){_0x29560c['emptyContact']('[actionOriginate]\x20',_0x5d79bc,_0x10a30a[_0x567a85]);}else{_0x29560c[_0xfbdd('0xc3')](_['pick'](_0x10a30a[_0x567a85],[_0xfbdd('0xde'),_0xfbdd('0x183')]))['then'](_0x29560c['checkContactBlack'](_0x5d79bc,_0x10a30a[_0x567a85]))[_0xfbdd('0xb7')](_0x29560c[_0xfbdd('0xd6')](_0xfbdd('0x218'),_0x5d79bc));}}}})[_0xfbdd('0xb7')](loggerGetContactDialer(_0xfbdd('0x219'),_0x5d79bc,_0x1574a4));}};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x16a')]=function(_0x5a27c5,_0x4ea5b2){var _0x17d93f=this;var _0x14815c=[];var _0x10f36a=_0x4ea5b2>=0x1?_0x4ea5b2:0x1;if(_0x5a27c5['dialMethod']===_0xfbdd('0x203')){_0x10f36a=0x1;}var _0x41c52b=Math[_0xfbdd('0x21a')](_0x5a27c5[_0xfbdd('0x56')]*_0x10f36a)-_0x5a27c5['originated']-_0x5a27c5['temp'];emitVoiceQueueSummary(_0x5a27c5);if(_0x5a27c5[_0xfbdd('0x21b')]>0x0){var _0xeff127=_0x5a27c5[_0xfbdd('0x21b')]-_0x5a27c5[_0xfbdd('0x74')]-_0x5a27c5[_0xfbdd('0x5a')]-_0x5a27c5[_0xfbdd('0xcc')]-_0x5a27c5[_0xfbdd('0xa6')];if(_0x41c52b>_0xeff127){_0x41c52b=_0xeff127;}}if(_0x41c52b>0x0){if(_0x5a27c5['dialMethod']===_0xfbdd('0x203')){_0x41c52b=0x1;}if(_0x41c52b>this[_0xfbdd('0x21')]){_0x41c52b=this['maxNumberOriginate'];}_0x5a27c5[_0xfbdd('0xcc')]+=_0x41c52b;for(var _0x299f39 in this[_0xfbdd('0x1f')]){if(typeof this[_0xfbdd('0x1f')][_0x299f39]!=='undefined'){if(this['agents'][_0x299f39]['state']===_0xfbdd('0x21c')&&this[_0xfbdd('0x1f')][_0x299f39][_0xfbdd('0xe4')]===_0xfbdd('0x176')){_0x14815c[_0xfbdd('0x15a')](this[_0xfbdd('0x1f')][_0x299f39]['id']);}}}this[_0xfbdd('0xcb')](_0x5a27c5['id'],_0x14815c,_0x41c52b,_0x5a27c5[_0xfbdd('0x215')],_0x5a27c5)[_0xfbdd('0x3f')](function(_0xfa420e){_0x5a27c5[_0xfbdd('0xcc')]-=_0x41c52b;_0x5a27c5[_0xfbdd('0xcc')]=_0x5a27c5['temp']>0x0?_0x5a27c5[_0xfbdd('0xcc')]:0x0;if(!checkContactEmpty(_0xfa420e)){_0x17d93f[_0xfbdd('0xbd')](_0x5a27c5)[_0xfbdd('0x3f')](sendMessageReschedule(_0x5a27c5))[_0xfbdd('0xb7')](loggerCatch(_0xfbdd('0x21d')));}else{_0x5a27c5[_0xfbdd('0x74')]+=_0xfa420e[_0xfbdd('0x9c')];_0x5a27c5[_0xfbdd('0x42')]=_0x5a27c5['dialMethod']===_0xfbdd('0x203')?_0xfbdd('0x18b'):'RUNNING';for(var _0x507c8e=0x0;_0x507c8e<_0xfa420e[_0xfbdd('0x9c')];_0x507c8e+=0x1){if(_['isNil'](_0xfa420e[_0x507c8e])||_[_0xfbdd('0xb6')](_0xfa420e[_0x507c8e][_0xfbdd('0x199')])||_['isNil'](_0xfa420e[_0x507c8e]['phone'])){_0x17d93f[_0xfbdd('0xd7')](_0xfbdd('0x21e'),_0x5a27c5,_0xfa420e[_0x507c8e]);}else{_0x17d93f[_0xfbdd('0xbe')](_[_0xfbdd('0x137')](_0xfa420e[_0x507c8e],[_0xfbdd('0xdd'),_0xfbdd('0x183')]))[_0xfbdd('0x3f')](_0x17d93f[_0xfbdd('0x21f')](_0x5a27c5,_0xfa420e[_0x507c8e]))[_0xfbdd('0xb7')](_0x17d93f[_0xfbdd('0xd6')]('[actionOriginate]\x20',_0x5a27c5));}}}})[_0xfbdd('0xb7')](loggerGetContactDialer('[getContactDialer2]',_0x5a27c5,_0x41c52b));}};Dialer[_0xfbdd('0xb1')]['handlePredictive']=function(_0x292140){if(_0x292140[_0xfbdd('0x21b')]>0x0){var _0x927d59=_0x292140[_0xfbdd('0x21b')]-_0x292140['originated']-_0x292140[_0xfbdd('0x5a')];if(_0x927d59>0x0){this[_0xfbdd('0x220')](_0x292140);}else{loggerPredictiveCalls[_0xfbdd('0x83')]('[handlePredictive][limitChannel]');}}else{this[_0xfbdd('0x220')](_0x292140);}};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x220')]=function(_0x3b5aca){var _0x51aace=this;var _0x19dac6=[];_0x3b5aca[_0xfbdd('0x74')]+=0x1;for(var _0x1fdcc7 in this[_0xfbdd('0x1f')]){if(typeof this['agents'][_0x1fdcc7]!==_0xfbdd('0x9d')){if(this[_0xfbdd('0x1f')][_0x1fdcc7][_0xfbdd('0xad')]==='not_inuse'&&this['agents'][_0x1fdcc7][_0xfbdd('0xe4')]===_0xfbdd('0x176')){_0x19dac6[_0xfbdd('0x15a')](this[_0xfbdd('0x1f')][_0x1fdcc7]['id']);}}}this['getContactDialer'](_0x3b5aca['id'],_0x19dac6,0x1,_0x3b5aca[_0xfbdd('0x215')],_0x3b5aca)['then'](function(_0xeab0ac){if(!checkContactEmpty(_0xeab0ac)){checkContactLowerLimitOriginate(_0x3b5aca,0x1,0x0);_0x51aace[_0xfbdd('0xbd')](_0x3b5aca)[_0xfbdd('0x3f')](sendMessageReschedule(_0x3b5aca))[_0xfbdd('0xb7')](loggerCatch('[countReScheduled]\x20'));}else{_0x3b5aca[_0xfbdd('0x42')]='RUNNING';if(_['isNil'](_0xeab0ac[0x0])||_[_0xfbdd('0xb6')](_0xeab0ac[0x0][_0xfbdd('0x199')])||_[_0xfbdd('0xb6')](_0xeab0ac[0x0][_0xfbdd('0x183')])){_0x51aace[_0xfbdd('0xd7')](_0xfbdd('0x21e'),_0x3b5aca,_0xeab0ac[0x0]);}else{_0x51aace[_0xfbdd('0xbe')](_[_0xfbdd('0x137')](_0xeab0ac[0x0],['VoiceQueueId',_0xfbdd('0x183')]))[_0xfbdd('0x3f')](_0x51aace['checkContactBlack'](_0x3b5aca,_0xeab0ac[0x0]))[_0xfbdd('0xb7')](_0x51aace['loggerHandler']('[actionOriginatePredictive]\x20',_0x3b5aca));}}})[_0xfbdd('0xb7')](loggerGetContactDialer(_0xfbdd('0x221'),_0x3b5aca,0x1));emitVoiceQueueSummary(_0x3b5aca);};Dialer[_0xfbdd('0xb1')][_0xfbdd('0x1ff')]=function(_0xa143e6,_0x75f399,_0x8c1bf1,_0x56a5e0,_0x546edb,_0x33b0ad){loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x222'));loggerPredictive[_0xfbdd('0x83')]('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',_0xa143e6);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x223'),_0x75f399);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x224'),_0x8c1bf1);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x225'),_0x56a5e0);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x226'),_0x546edb);loggerPredictive['info']('---------------------------');return new Promise(function(_0x139f37,_0x58a220){if(_0xa143e6<=0x0||isNaN(_0xa143e6)){return _0x58a220(msgResponse(_0xfbdd('0x227'),_0xfbdd('0x1ac'),_0xfbdd('0x228')+_0xa143e6));}if(_0x8c1bf1<=0x0||isNaN(_0x8c1bf1)){return _0x58a220(msgResponse(_0xfbdd('0x227'),'Error',_0xfbdd('0x229')+_0x8c1bf1));}if(_0x56a5e0<=0x0||isNaN(_0x56a5e0)){return _0x58a220(msgResponse(_0xfbdd('0x227'),_0xfbdd('0x1ac'),_0xfbdd('0x22a')+_0x56a5e0));}if(_0x75f399<=0x0||isNaN(_0x75f399)){return _0x58a220(msgResponse(_0xfbdd('0x227'),_0xfbdd('0x1ac'),_0xfbdd('0x22b')+_0x75f399));}if(_0x546edb<=0x0||isNaN(_0x546edb)){return _0x58a220(msgResponse(_0xfbdd('0x227'),'Error',_0xfbdd('0x22c')+_0x546edb));}_0x33b0ad=_0x33b0ad||0x0;var _0xb3ad62=0x1/_0x8c1bf1;var _0x1dde73=0x0;var _0x5e3392=0x0;var _0x93b958=0x0;var _0x14d3e7=0x0;for(var _0x10d8d5=0x0;_0x93b958<_0x546edb;_0x10d8d5+=0x1){_0x5e3392=_0x10d8d5/_0x75f399;_0x1dde73=(_0x56a5e0*_0x5e3392+_0x33b0ad)/_0xb3ad62;_0x93b958=erlangb(_0x1dde73,_0xa143e6);_0x14d3e7=_0x1dde73/_0xa143e6*(0x1-erlangb(_0x1dde73,_0xa143e6));}return _0x139f37({'erlangCalls':_0x10d8d5,'erlangCallToSecond':_0x75f399/_0x10d8d5,'erlangAbandonmentRate':_0x93b958,'erlangBusyFactor':_0x14d3e7});});};Dialer[_0xfbdd('0xb1')]['busyFactor']=function(_0x545010,_0xbff028,_0x2b4e82,_0x1f8711,_0x1c0b83,_0x3aa60d){loggerPredictive[_0xfbdd('0x83')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x545010);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x223'),_0xbff028);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x224'),_0x2b4e82);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x225'),_0x1f8711);loggerPredictive[_0xfbdd('0x83')](_0xfbdd('0x22d'),_0x1c0b83);loggerPredictive['info'](_0xfbdd('0x22e'));return new Promise(function(_0x5e627a,_0x2cb6f8){if(_0x545010<=0x0||isNaN(_0x545010)){return _0x2cb6f8(msgResponse(_0xfbdd('0x22f'),_0xfbdd('0x1ac'),'m\x20=\x20'+_0x545010));}if(_0x2b4e82<=0x0||isNaN(_0x2b4e82)){return _0x2cb6f8(msgResponse(_0xfbdd('0x22f'),_0xfbdd('0x1ac'),'Ts\x20=\x20'+_0x2b4e82));}if(_0x1f8711<=0x0||isNaN(_0x1f8711)){return _0x2cb6f8(msgResponse(_0xfbdd('0x22f'),_0xfbdd('0x1ac'),_0xfbdd('0x22a')+_0x1f8711));}if(_0xbff028<=0x0||isNaN(_0xbff028)){return _0x2cb6f8(msgResponse(_0xfbdd('0x22f'),_0xfbdd('0x1ac'),'interval\x20=\x20'+_0xbff028));}if(_0x1c0b83<=0x0||isNaN(_0x1c0b83)){return _0x2cb6f8(msgResponse('[busyFactor]',_0xfbdd('0x1ac'),_0xfbdd('0x230')+_0x1c0b83));}_0x3aa60d=_0x3aa60d||0x0;var _0x44dfed=0x1/_0x2b4e82;var _0x15c6e8=0x0;var _0x17d38e=0x0;var _0x4bc1cc=0x0;var _0x1674cb=0x0;for(var _0x437633=0x0;_0x1674cb<_0x1c0b83;_0x437633+=0x1){_0x17d38e=_0x437633/_0xbff028;_0x15c6e8=(_0x1f8711*_0x17d38e+_0x3aa60d)/_0x44dfed;_0x4bc1cc=erlangb(_0x15c6e8,_0x545010);_0x1674cb=_0x15c6e8/_0x545010*(0x1-erlangb(_0x15c6e8,_0x545010));}return _0x5e627a({'erlangCalls':_0x437633,'erlangCallToSecond':_0xbff028/_0x437633,'erlangAbandonmentRate':_0x4bc1cc,'erlangBusyFactor':_0x1674cb});});};module['exports']=Dialer; \ No newline at end of file +var _0xfda2=['campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','length','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','isNil','status','channel','catch','No\x20such\x20channel','ivr','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','then','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','UserId','VoiceQueueId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','variable','amdstatus','xcally-motion-dialer','value','HANGUP','uniqueid','outboundAnswerAgiCallsDay','statedesc','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','Machine','countmachineretry','countglobal','countbusyretry','countcongestionretry','countabandonedretry','stateGlobal','reason\x2019\x20machine....','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','membername','[syncAgentComplete][createHistory][0]','countnoanswerretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','minutes','ContactId','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','[syncHangupIvr][createHistory]','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','ListId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','add','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','rrmemory','queueBooked','idHopper','paused','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','isArray','push','Action','command','iftime\x20%s,%s','interval','indexOf','true','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','checkDialMethod','progressive','handlePower','predictive','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','launchHandleIvr','handleIvr','checkIfTime','dialGlobalInterval','dialTimezone','throttle','dialPreviewRecallmeReminder','filter','online','map','user:dialPreviewRecallReminder','active','[syncCampaigns]','pow','replace','random','actionOriginate','object','originate','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnosuchnumberretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','agentreject','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','getDataPredictive','dialPredictiveOptimizationPercentage','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','countReScheduled','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','abandonmentRate','--------\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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','loopCampaigns','getSettings','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','diff','emit','outbound','strategy','answered','available','loggedIn','pTalking','talking','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','stringify','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s'];(function(_0x2eab56,_0x6ebbcf){var _0x267f89=function(_0x5769d5){while(--_0x5769d5){_0x2eab56['push'](_0x2eab56['shift']());}};_0x267f89(++_0x6ebbcf);}(_0xfda2,0x1a9));var _0x2fda=function(_0x859e7a,_0x37b314){_0x859e7a=_0x859e7a-0x0;var _0x1cfd5b=_0xfda2[_0x859e7a];return _0x1cfd5b;};'use strict';var util=require(_0x2fda('0x0'));var _=require(_0x2fda('0x1'));var uuid=require(_0x2fda('0x2'));var moment=require(_0x2fda('0x3'));var rr=require('rr');var md5=require(_0x2fda('0x4'));var Redis=require(_0x2fda('0x5'));var ut=require('../preview/util/util');var config=require(_0x2fda('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x2fda('0x7'))(_0x2fda('0x8'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x2fda('0x9'));var loggerSyncQueueSummary=require(_0x2fda('0x7'))(_0x2fda('0xa'));var ami=require(_0x2fda('0xb'));config[_0x2fda('0xc')]=_[_0x2fda('0xd')](config[_0x2fda('0xc')],{'host':_0x2fda('0xe'),'port':0x18eb});var io=require(_0x2fda('0xf'))(new Redis(config[_0x2fda('0xc')]));var cmHopper=require(_0x2fda('0x10'));var cmHopperHistory=require(_0x2fda('0x11'));var cmHopperAdditionalPhone=require(_0x2fda('0x12'));var cmHopperBlack=require(_0x2fda('0x13'));var voiceQueueRt=require(_0x2fda('0x14'));var RpcSetting=require(_0x2fda('0x15'));var Action=require(_0x2fda('0x16'));var History=require('./history');var Final=require(_0x2fda('0x17'));var AgentComplete=require(_0x2fda('0x18'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x2fda('0x19'));var ipAgi=process[_0x2fda('0x1a')][_0x2fda('0x1b')]||_0x2fda('0x1c');var strategy={'rrmemory':'rrmemory','roundrobin':_0x2fda('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x2fda('0x1e')][_0x2fda('0x1f')]=function(_0x218d10){this[_0x2fda('0x20')]=this[_0x2fda('0x20')]?this['tail'][_0x2fda('0x21')](_0x218d10):_0x218d10();};function Dialer(_0x6991ec,_0x5e3ca2){this[_0x2fda('0x22')]=new Sequence();this[_0x2fda('0x23')]=_0x5e3ca2;this['voiceQueues']=_0x6991ec[_0x2fda('0x24')];this[_0x2fda('0x25')]=_0x6991ec[_0x2fda('0x25')];this[_0x2fda('0x26')]=_0x6991ec[_0x2fda('0x26')];this[_0x2fda('0x27')]=_0x6991ec[_0x2fda('0x27')];this[_0x2fda('0x28')]=config[_0x2fda('0x28')]||0x2;this[_0x2fda('0x29')]={};this[_0x2fda('0x2a')]={};this[_0x2fda('0x2b')]={};this[_0x2fda('0x2c')]={};this['optionPredictive']={};this[_0x2fda('0x2d')]={};this[_0x2fda('0x2e')]={};this['ivrOriginated']={};this['queueBooked']={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x2fda('0x2f')][_0x2fda('0x30')](this));ami['on'](_0x2fda('0x31'),this[_0x2fda('0x32')][_0x2fda('0x30')](this));ami['on'](_0x2fda('0x33'),this[_0x2fda('0x34')][_0x2fda('0x30')](this));ami['on'](_0x2fda('0x35'),this[_0x2fda('0x36')][_0x2fda('0x30')](this));ami['on'](_0x2fda('0x37'),this[_0x2fda('0xa')][_0x2fda('0x30')](this));ami['on'](_0x2fda('0x38'),this[_0x2fda('0x39')][_0x2fda('0x30')](this));ami['on']('hangup',this[_0x2fda('0x3a')]['bind'](this));ami['on'](_0x2fda('0x3b'),this['syncNewExten'][_0x2fda('0x30')](this));ami['on'](_0x2fda('0x3c'),this[_0x2fda('0x3d')][_0x2fda('0x30')](this));ami['on'](_0x2fda('0x3e'),this[_0x2fda('0x3f')][_0x2fda('0x30')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x2fda('0x30')](this));this[_0x2fda('0x40')]();this['loopClearZombieChannels']();RpcSetting[_0x2fda('0x41')]()['then'](function(_0x48de0e){previewRecallmeReminderInterval=_0x48de0e['previewRecallmeReminderInterval'];});}function isNotNull(_0x509af0){return _0x509af0!==null&&!_['isUndefined'](_0x509af0);}function checkIsLoggedIn(_0x108ae8,_0x445f3d){return function(){if(_0x445f3d<=0x0){_0x108ae8[_0x2fda('0x42')]=_0x2fda('0x43');throw _0x108ae8[_0x2fda('0x44')]+_0x2fda('0x45');}};}function isActive(_0x143171){return _0x143171;}function checkIsActive(_0x18eebe,_0x2e496e){return function(){if(!isActive(_0x2e496e)){_0x18eebe[_0x2fda('0x42')]=_0x2fda('0x46');throw _0x18eebe[_0x2fda('0x44')]+'\x20NOT\x20Active';}};}function checkInterval(_0x76a4f4){return function(){if(!isNotNull(_0x76a4f4[_0x2fda('0x47')])){_0x76a4f4[_0x2fda('0x42')]=_0x2fda('0x48');throw _0x76a4f4['name']+_0x2fda('0x49');}if(!isNotNull(_0x76a4f4['Interval'][_0x2fda('0x4a')])){_0x76a4f4['message']='INTERVAL_IS_NULL';throw _0x76a4f4['name']+_0x2fda('0x49');}if(!isNotNull(_[_0x2fda('0x4b')](_0x76a4f4[_0x2fda('0x47')]['Intervals']))){_0x76a4f4[_0x2fda('0x42')]=_0x2fda('0x48');throw _0x76a4f4[_0x2fda('0x44')]+_0x2fda('0x49');}};}function msgResponse(_0x4eab50,_0x3361e4,_0x2b4dc7){return{'action':_0x4eab50,'response':_0x3361e4,'message':_0x2b4dc7,'stack':_0x2b4dc7};}function myreject(_0x248cb1){return function(_0x150c9f){return _0x248cb1(msgResponse(_0x2fda('0x4c'),_0x2fda('0x4d'),JSON['stringify'](_0x150c9f)));};}function getSeconds(_0x5c215e,_0x39ff3c){var _0x288c2f=moment(_0x5c215e)[_0x2fda('0x4e')](0x0);var _0x4d27da=moment(_0x39ff3c)['milliseconds'](0x0);return _0x288c2f[_0x2fda('0x4f')](_0x4d27da,'seconds');}function emit(_0x3b4c68,_0x1ea442,_0x253c91){io['to'](_0x3b4c68)[_0x2fda('0x50')](_0x1ea442,_0x253c91);}function emitVoiceQueueSummary(_0x596ebf){if(_0x596ebf['type']===_0x2fda('0x51')){var _0x3ecd4e={'id':_0x596ebf['id'],'name':_0x596ebf[_0x2fda('0x44')],'strategy':_0x596ebf[_0x2fda('0x52')],'answered':_0x596ebf[_0x2fda('0x53')],'available':_0x596ebf[_0x2fda('0x54')],'loggedIn':_0x596ebf[_0x2fda('0x55')],'pTalking':_0x596ebf[_0x2fda('0x56')],'sumBillable':_0x596ebf['sumBillable'],'sumDuration':_0x596ebf['sumDuration'],'sumHoldTime':_0x596ebf['sumHoldTime']||0x0,'talking':_0x596ebf[_0x2fda('0x57')],'total':_0x596ebf['total'],'type':_0x596ebf[_0x2fda('0x58')],'unmanaged':_0x596ebf[_0x2fda('0x59')],'abandoned':_0x596ebf[_0x2fda('0x5a')],'waiting':_0x596ebf[_0x2fda('0x5b')],'loggedInDb':_0x596ebf[_0x2fda('0x5c')],'dialActive':_0x596ebf[_0x2fda('0x5d')],'dialMethod':_0x596ebf[_0x2fda('0x5e')],'dialOriginateCallerIdName':_0x596ebf[_0x2fda('0x5f')],'dialOriginateCallerIdNumber':_0x596ebf['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x596ebf[_0x2fda('0x60')],'dialPrefix':_0x596ebf[_0x2fda('0x61')],'outboundAnswerAgiCallsDay':_0x596ebf['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x596ebf[_0x2fda('0x62')],'outboundBlacklistCallsDay':_0x596ebf[_0x2fda('0x63')],'outboundBusyCallsDay':_0x596ebf[_0x2fda('0x64')],'outboundCongestionCallsDay':_0x596ebf[_0x2fda('0x65')],'outboundDropCallsDayACS':_0x596ebf[_0x2fda('0x66')],'outboundDropCallsDayCallersExit':_0x596ebf[_0x2fda('0x67')],'outboundDropCallsDayTimeout':_0x596ebf['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x596ebf[_0x2fda('0x68')],'outboundNoSuchCallsDay':_0x596ebf['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x596ebf[_0x2fda('0x69')],'outboundReCallsDay':_0x596ebf[_0x2fda('0x6a')],'outboundRejectCallsDay':_0x596ebf[_0x2fda('0x6b')],'outboundUnknownCallsDay':_0x596ebf['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x596ebf[_0x2fda('0x6c')],'predictiveIntervalAvgHoldtime':_0x596ebf[_0x2fda('0x6d')],'predictiveIntervalAvgTalktime':_0x596ebf[_0x2fda('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x596ebf[_0x2fda('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x596ebf[_0x2fda('0x70')],'predictiveIntervalErlangCalls':_0x596ebf[_0x2fda('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x596ebf['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x596ebf[_0x2fda('0x72')],'predictiveIntervalMultiplicativeFactor':_0x596ebf[_0x2fda('0x73')],'predictiveIntervalPauses':_0x596ebf[_0x2fda('0x74')],'predictiveIntervalAvailable':_0x596ebf[_0x2fda('0x75')],'predictiveIntervalTotalCalls':_0x596ebf[_0x2fda('0x76')],'message':_0x596ebf[_0x2fda('0x42')],'originated':_0x596ebf['originated'],'erlangCalls':_0x596ebf[_0x2fda('0x77')],'erlangCallToSecond':_0x596ebf[_0x2fda('0x78')],'erlangAbandonmentRate':_0x596ebf[_0x2fda('0x79')],'erlangBusyFactor':_0x596ebf[_0x2fda('0x7a')],'startPredictive':_0x596ebf['startPredictive'],'startProgressive':_0x596ebf[_0x2fda('0x2e')]};if(_0x596ebf[_0x2fda('0x7b')]){_0x3ecd4e[_0x2fda('0x7b')]={'id':_0x596ebf[_0x2fda('0x7b')]['id'],'name':_0x596ebf[_0x2fda('0x7b')][_0x2fda('0x44')],'active':_0x596ebf[_0x2fda('0x7b')]['active'],'callerid':_0x596ebf[_0x2fda('0x7b')][_0x2fda('0x7c')]};}if(_0x596ebf[_0x2fda('0x47')]){_0x3ecd4e[_0x2fda('0x47')]={'id':_0x596ebf['Interval']['id'],'name':_0x596ebf[_0x2fda('0x47')]['name']};}var _0x8fbb58=md5(JSON[_0x2fda('0x7d')](_0x3ecd4e));if(_0x596ebf[_0x2fda('0x4')]!==_0x8fbb58){_0x596ebf['md5']=_0x8fbb58;emit(util[_0x2fda('0x7e')](_0x2fda('0x7f'),_0x3ecd4e[_0x2fda('0x44')]),_0x2fda('0x80'),_0x3ecd4e);}}}function emitCampaignSummary(_0x29a0a8){if(_0x29a0a8['type']==='ivr'){emit(util['format'](_0x2fda('0x81'),_0x29a0a8[_0x2fda('0x44')]),_0x2fda('0x82'),_0x29a0a8);}}function checkGetDataPredictive(_0xda47ae){if(isNotNull(_0xda47ae)&&!_['isEmpty'](_0xda47ae)){loggerPredictive[_0x2fda('0x83')](_0x2fda('0x84'));loggerPredictive[_0x2fda('0x83')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xda47ae[_0x2fda('0x76')]);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x85'),_0xda47ae['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x2fda('0x86'),_0xda47ae[_0x2fda('0x70')]);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x87'),_0xda47ae[_0x2fda('0x6f')]);loggerPredictive['info'](_0x2fda('0x88'),_0xda47ae['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x89'),_0xda47ae[_0x2fda('0x6e')]);loggerPredictive['info'](_0x2fda('0x8a'));if(_0xda47ae[_0x2fda('0x76')]>0x0){if(!_[_0x2fda('0x8b')](_0xda47ae['predictiveIntervalAvgTalktime'])&&_0xda47ae[_0x2fda('0x6e')]>0x0){return!![];}loggerPredictive[_0x2fda('0x83')](_0x2fda('0x8c'));if(!_['isUndefined'](_0xda47ae['predictiveIntervalAvgHoldtime'])&&_0xda47ae[_0x2fda('0x6d')]>0x0){return!![];}loggerPredictive[_0x2fda('0x83')](_0x2fda('0x8d'));}else{loggerPredictive[_0x2fda('0x83')](_0x2fda('0x8e'));}}else{loggerPredictive['info'](_0x2fda('0x8f'));}return![];}function mergeDataErlangB(_0x5cac1b){return function(_0x360abc){loggerPredictive[_0x2fda('0x83')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x2fda('0x83')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x360abc['erlangCalls']);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x90'),_0x360abc['erlangCallToSecond']);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x91'),_0x360abc['erlangAbandonmentRate']);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x92'),_0x360abc[_0x2fda('0x7a')]);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x91'),_0x360abc[_0x2fda('0x79')]);loggerPredictive['info']('---------------------------');_[_0x2fda('0x93')](_0x5cac1b,_0x360abc);};}function getDiff(_0x2ddd22){var _0xcc1f3c=moment()[_0x2fda('0x4e')](0x0);var _0x593a13=moment(_0x2ddd22)[_0x2fda('0x4e')](0x0);return _0xcc1f3c[_0x2fda('0x4f')](_0x593a13,_0x2fda('0x94'));}function ifInterval(_0x72d2b8,_0x34fb03){if(_[_0x2fda('0x8b')](_0x34fb03)){return![];}return getDiff(_0x34fb03)<_0x72d2b8*0x3c;}function freeVariablesPredictive(_0x2ac3e3){if(isNotNull(_0x2ac3e3)){if(!_['isUndefined'](_0x2ac3e3[_0x2fda('0x2e')])){_0x2ac3e3[_0x2fda('0x2e')]=undefined;loggerPredictive[_0x2fda('0x83')](_0x2ac3e3[_0x2fda('0x44')],_0x2fda('0x95'));}if(!_[_0x2fda('0x8b')](_0x2ac3e3[_0x2fda('0x2d')])){_0x2ac3e3[_0x2fda('0x2d')]=undefined;loggerPredictive[_0x2fda('0x83')](_0x2ac3e3['name'],_0x2fda('0x96'));}if(!_['isUndefined'](_0x2ac3e3['handlePredictive'])){clearInterval(_0x2ac3e3['handlePredictive']);_0x2ac3e3[_0x2fda('0x97')]=undefined;loggerPredictive[_0x2fda('0x83')](_0x2ac3e3[_0x2fda('0x44')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x249769,_0x430554){if(_0x430554===0x0){return 0x0;}var _0x1d22f6=0x1;for(var _0x18c86b=0x1;_0x18c86b<=_0x430554;_0x18c86b+=0x1){_0x1d22f6=0x1+_0x1d22f6*_0x18c86b/_0x249769;}return 0x1/_0x1d22f6;}function isVoiceQueueOutbound(_0x359d32){return _0x359d32===_0x2fda('0x51');}function isNotPreview(_0x43a370){return _0x43a370!==_0x2fda('0x23');}function isCampaignIvr(_0x5a0a88){return _0x5a0a88==='ivr';}function getCallerId(_0x5d28d0,_0x592bf3,_0x1bb7df){if(!_[_0x2fda('0x8b')](_0x1bb7df)&&typeof _0x1bb7df===_0x2fda('0x98')&&!_[_0x2fda('0x4b')](_0x1bb7df)){if(!_[_0x2fda('0x8b')](_0x592bf3)&&typeof _0x592bf3===_0x2fda('0x98')&&!_[_0x2fda('0x4b')](_0x592bf3)){return util[_0x2fda('0x7e')]('\x22%s\x22\x20<%s>',_0x592bf3,_0x1bb7df);}return util[_0x2fda('0x7e')](_0x2fda('0x99'),_0x1bb7df,_0x1bb7df);}if(!_[_0x2fda('0x8b')](_0x5d28d0)&&typeof _0x5d28d0===_0x2fda('0x98')&&!_[_0x2fda('0x4b')](_0x5d28d0)){return _0x5d28d0;}return _0x2fda('0x9a');}function loggerCatchQueueSummary(_0x53cd02,_0x35ac77){return function(_0x513300){freeVariablesPredictive(_0x35ac77);emitVoiceQueueSummary(_0x35ac77);emitCampaignSummary(_0x35ac77);loggerSyncQueueSummary[_0x2fda('0x9b')](_0x53cd02,util[_0x2fda('0x9c')](_0x513300,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1fc3b3,_0x4f436f){return function(_0x2045ff){loggerPredictive[_0x2fda('0x9d')](_0x4f436f['name'],_0x1fc3b3);loggerPredictive[_0x2fda('0x9d')](_0x2045ff['stack']);freeVariablesPredictive(_0x4f436f);};}function loggerCatch(_0x3a2d33){return function(_0x22cbb5){logger['error'](_0x3a2d33,util[_0x2fda('0x9c')](_0x22cbb5,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1c56de){return _0x1c56de&&!_['isUndefined'](_0x1c56de)&&_0x1c56de[_0x2fda('0x9e')]>0x0;}function decremetOriginate(_0x1bd21c){if(!_['isUndefined'](_0x1bd21c)&&_0x1bd21c!==null){if(typeof _0x1bd21c['originated']!==_0x2fda('0x9f')){if(_0x1bd21c['originated']>0x0){_0x1bd21c[_0x2fda('0xa0')]-=0x1;}else{logger[_0x2fda('0x9d')](_0x2fda('0xa1'));}}}else{logger[_0x2fda('0x9d')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0xc0bee5,_0x13597b,_0x39f0b0){if(_0x13597b>_0x39f0b0){for(var _0x5dec54=0x0;_0x5dec54<_0x13597b-_0x39f0b0;_0x5dec54+=0x1){decremetOriginate(_0xc0bee5);}}}function loggerGetContactDialer(_0x1dfcf2,_0x2ee58d,_0x43b45f){return function(_0x285da4){checkContactLowerLimitOriginate(_0x2ee58d,_0x43b45f,0x0);logger['error'](_0x1dfcf2,util[_0x2fda('0x9c')](_0x285da4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5aa9a0){return function(_0x5b11d6){if(isNotNull(_0x5b11d6)&&isNotNull(_0x5b11d6[0x0])){if(_0x5b11d6[0x0][_0x2fda('0xa2')]>0x0){_0x5aa9a0[_0x2fda('0x42')]='RESCHEDULED_CONTACTS';logger[_0x2fda('0x83')](_0x2fda('0xa3')+_0x5aa9a0[_0x2fda('0x44')],_0x5b11d6[0x0][_0x2fda('0xa2')],'contacts');}else{_0x5aa9a0['message']=_0x2fda('0xa4');logger['info'](_0x2fda('0xa5')+_0x5aa9a0['name']);}}};}function notSendMessagesQueue(_0x56a967){if(_0x56a967[_0x2fda('0xa6')]){freeVariablesPredictive(_0x56a967);if(_0x56a967[_0x2fda('0xa0')]===0x0&&_0x56a967['talking']===0x0&&_0x56a967[_0x2fda('0x5b')]===0x0&&(_0x56a967[_0x2fda('0x56')]||0x0)===0x0){_0x56a967[_0x2fda('0xa6')]=![];_0x56a967[_0x2fda('0x54')]=0x0;_0x56a967['message']=_0x2fda('0x46');loggerSyncQueueSummary[_0x2fda('0x9b')](_0x2fda('0xa7'),_0x56a967[_0x2fda('0x44')],_0x2fda('0xa8'));}else{_0x56a967['message']=_0x2fda('0xa9');loggerSyncQueueSummary['debug'](_0x2fda('0xa7'),_0x56a967[_0x2fda('0x44')],_0x2fda('0xaa'));}emitVoiceQueueSummary(_0x56a967);}}function notSendMessagesCampaign(_0x1c5640){if(_0x1c5640[_0x2fda('0xa6')]){if(_0x1c5640[_0x2fda('0xa0')]===0x0){_0x1c5640[_0x2fda('0xa6')]=![];_0x1c5640[_0x2fda('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x2fda('0x9b')](_0x2fda('0xab'),_0x1c5640[_0x2fda('0x44')],'is\x20not\x20active');}else{_0x1c5640['message']=_0x2fda('0xa9');loggerSyncQueueSummary['debug'](_0x2fda('0xab'),_0x1c5640['name'],_0x2fda('0xaa'));}emitCampaignSummary(_0x1c5640);}}function createObjHistory(_0x16e9c1,_0x25c856,_0x3dc67e,_0x46f6e5,_0x2bbcc7){_0x16e9c1[_0x2fda('0x42')]=_0x3dc67e;var _0x5dd989=new Action(_0x16e9c1,_0x25c856);var _0x40d3ff=new History(_0x5dd989);_0x40d3ff[_0x2fda('0xac')]=_0x46f6e5;_0x40d3ff['statedesc']=_0x2bbcc7;_0x40d3ff['endtime']=_0x5dd989[_0x2fda('0xad')];return _0x40d3ff;}Dialer[_0x2fda('0x1e')][_0x2fda('0xae')]=function(){var _0x59342c=this;setInterval(function(){_0x59342c[_0x2fda('0xaf')](_0x59342c['uniqueId'],_0x2fda('0xb0'));_0x59342c[_0x2fda('0xaf')](_0x59342c[_0x2fda('0x2a')],_0x2fda('0xb1'));},0x32c8);};Dialer['prototype'][_0x2fda('0xaf')]=function(_0x16e852,_0x25e8dd){var _0x11134c=this;for(var _0x583169 in _0x16e852){if(typeof _0x16e852[_0x583169]!==_0x2fda('0x9f')){this[_0x2fda('0x22')]['enqueue'](function(){if(!_[_0x2fda('0xb2')](_0x16e852[_0x583169])){return ami['Action']({'action':_0x2fda('0xb3'),'channel':_0x16e852[_0x583169][_0x2fda('0xb4')]})[_0x2fda('0xb5')](function(_0x55378d){if(_0x55378d[_0x2fda('0x42')]===_0x2fda('0xb6')){setTimeout(function(){if(_0x16e852[_0x583169]&&_0x16e852[_0x583169]['type']!==_0x2fda('0xb7')){_0x11134c[_0x2fda('0xb8')](_0x11134c['voiceQueues'][_0x16e852[_0x583169]['queue']]);logger[_0x2fda('0x9d')](_0x2fda('0xb9'),_0x25e8dd,_0x583169,_0x16e852[_0x583169]['queue']);delete _0x16e852[_0x583169];}if(_0x16e852[_0x583169]&&_0x16e852[_0x583169][_0x2fda('0x58')]==='ivr'){_0x11134c['updateOriginated'](_0x11134c[_0x2fda('0x25')][_0x16e852[_0x583169][_0x2fda('0xba')]]);logger[_0x2fda('0x9d')](_0x2fda('0xbb'),_0x25e8dd,_0x583169,_0x16e852[_0x583169][_0x2fda('0xba')]);delete _0x16e852[_0x583169];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x497003){return Promise[_0x2fda('0xbc')]()['then'](cmHopper['countReScheduled'](_0x497003))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xbd')));};Dialer[_0x2fda('0x1e')]['checkIsBlackList']=function(_0x546227){return Promise[_0x2fda('0xbc')]()['then'](cmHopperBlack[_0x2fda('0xbe')](_0x546227))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xbf')));};Dialer[_0x2fda('0x1e')][_0x2fda('0xc0')]=function(_0x3f83bd,_0x2d5a35,_0x46001e){return Promise[_0x2fda('0xbc')]()['then'](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3f83bd,_0x2d5a35,_0x46001e))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xc1')));};Dialer[_0x2fda('0x1e')][_0x2fda('0xc2')]=function(_0x2c3f26,_0x51baaa,_0xf9526a){return Promise[_0x2fda('0xbc')]()[_0x2fda('0xc3')](cmHopperAdditionalPhone[_0x2fda('0xc2')](_0x2c3f26,_0x51baaa,_0xf9526a))['catch'](loggerCatch(_0x2fda('0xc4')));};Dialer['prototype'][_0x2fda('0xc5')]=function(_0x2c571c){return Promise[_0x2fda('0xbc')]()['then'](cmHopperBlack[_0x2fda('0xc5')](_0x2c571c))[_0x2fda('0xb5')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x2fda('0x1e')][_0x2fda('0xc6')]=function(_0x247629){return Promise[_0x2fda('0xbc')]()['then'](cmHopperHistory[_0x2fda('0xc7')](_0x247629))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xc8')));};Dialer['prototype'][_0x2fda('0xc9')]=function(_0x2f8c44){return Promise[_0x2fda('0xbc')]()['then'](cmHopper[_0x2fda('0xc9')](_0x2f8c44))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xca')));};Dialer[_0x2fda('0x1e')][_0x2fda('0xcb')]=function(_0x3ce7a8,_0x3d98b4,_0x8f83b0){return Promise[_0x2fda('0xbc')]()[_0x2fda('0xc3')](cmHopper[_0x2fda('0xcb')](_0x3ce7a8,_0x3d98b4,_0x8f83b0))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xcc')));};Dialer['prototype']['getContactDialer']=function(_0x17be7e,_0x45d776,_0x4dd45d,_0x55e1ef,_0x1a5370){return Promise[_0x2fda('0xbc')]()[_0x2fda('0xc3')](cmHopper[_0x2fda('0xcd')](_0x17be7e,_0x45d776,_0x4dd45d,_0x55e1ef))[_0x2fda('0xb5')](function(_0x1b7574){_0x1a5370[_0x2fda('0xce')]-=_0x4dd45d;_0x1a5370[_0x2fda('0xce')]=_0x1a5370[_0x2fda('0xce')]>0x0?_0x1a5370[_0x2fda('0xce')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x1b7574);});};Dialer[_0x2fda('0x1e')][_0x2fda('0xcf')]=function(_0xe70294,_0x164eb1,_0x31bc9f,_0x39f95e){return Promise[_0x2fda('0xbc')]()[_0x2fda('0xc3')](cmHopper['getContactDialerIvr'](_0xe70294,_0x164eb1,_0x31bc9f))['catch'](function(_0x45e48f){_0x39f95e[_0x2fda('0xce')]-=_0x164eb1;_0x39f95e[_0x2fda('0xce')]=_0x39f95e[_0x2fda('0xce')]>0x0?_0x39f95e['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x45e48f);});};Dialer[_0x2fda('0x1e')][_0x2fda('0xd0')]=function(_0x4c4a10){return Promise['resolve']()[_0x2fda('0xc3')](voiceQueueRt[_0x2fda('0xd0')](_0x4c4a10))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xd1')));};Dialer[_0x2fda('0x1e')][_0x2fda('0xd2')]=function(_0x629c4d){return Promise[_0x2fda('0xbc')]()[_0x2fda('0xc3')](cmHopper[_0x2fda('0xd2')](_0x629c4d))[_0x2fda('0xb5')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x2fda('0x1e')][_0x2fda('0xd3')]=function(_0x51bb28){return Promise[_0x2fda('0xbc')]()['then'](cmHopperHistory[_0x2fda('0xd3')](_0x51bb28))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xd4')));};Dialer[_0x2fda('0x1e')][_0x2fda('0xb8')]=function(_0x153f53){if(!_[_0x2fda('0x8b')](_0x153f53)&&_0x153f53!==null){if(typeof _0x153f53[_0x2fda('0xa0')]!==_0x2fda('0x9f')){if(_0x153f53['originated']>0x0){_0x153f53[_0x2fda('0xa0')]-=0x1;}else{logger[_0x2fda('0x9d')](_0x2fda('0xd5'));}}}else{logger[_0x2fda('0x9d')](_0x2fda('0xd6'));}};Dialer[_0x2fda('0x1e')][_0x2fda('0xd7')]=function(_0x2082d9,_0x559b48){var _0xc3cfd6=this;return function(_0x4d3a55){_0xc3cfd6[_0x2fda('0xb8')](_0x559b48);logger[_0x2fda('0x9d')](_0x2082d9,util[_0x2fda('0x9c')](_0x4d3a55,{'showHidden':![],'depth':null}));};};Dialer[_0x2fda('0x1e')][_0x2fda('0xd8')]=function(_0x2aa849,_0x281263,_0x2133c9){var _0x720ad8={'state':0x19,'statedesc':_0x2fda('0xd9')};this[_0x2fda('0xb8')](_0x281263);this[_0x2fda('0xda')](_['merge'](_0x720ad8,_[_0x2fda('0xdb')](_0x2133c9,['ContactId','ListId',_0x2fda('0xdc'),_0x2fda('0xdd'),_0x2fda('0xde')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x2aa849);};Dialer[_0x2fda('0x1e')][_0x2fda('0xdf')]=function(_0x5ab144){return _0x5ab144===_0x2fda('0xe0');};Dialer[_0x2fda('0x1e')][_0x2fda('0xe1')]=function(_0x2c5db1){return!_[_0x2fda('0x8b')](_0x2c5db1)&&_0x2c5db1&&!_[_0x2fda('0x8b')](_0x2c5db1[_0x2fda('0x44')])&&!_['isUndefined'](_0x2c5db1['active'])&&_0x2c5db1['active']&&(this['trunks'][util[_0x2fda('0x7e')](_0x2fda('0xe2'),_0x2c5db1[_0x2fda('0x44')])][_0x2fda('0xb3')]===_0x2fda('0xe3')||this[_0x2fda('0x27')][util[_0x2fda('0x7e')](_0x2fda('0xe2'),_0x2c5db1[_0x2fda('0x44')])][_0x2fda('0xb3')]===_0x2fda('0xe4'));};Dialer[_0x2fda('0x1e')][_0x2fda('0xda')]=function(_0x266012,_0x49a526,_0x28a2c8){this['createHistory'](_0x266012)[_0x2fda('0xb5')](loggerCatch(_0x49a526));this[_0x2fda('0xd2')](_0x266012)[_0x2fda('0xb5')](loggerCatch(_0x28a2c8));};Dialer['prototype'][_0x2fda('0x3d')]=function(_0x3ec017){var _0x6e3c14=this;var _0x5cec1a=this[_0x2fda('0x2c')][_0x3ec017['uniqueid']];var _0x2b40b8;if(!_[_0x2fda('0xb2')](_0x3ec017)&&!_[_0x2fda('0xb2')](_0x3ec017[_0x2fda('0xe5')])&&!_[_0x2fda('0xb2')](_0x3ec017[_0x2fda('0xe5')][_0x2fda('0xe6')])&&_0x3ec017['exten']===_0x2fda('0xe7')&&_0x5cec1a){if(_0x5cec1a['type']!=='ivr'&&this[_0x2fda('0x24')][_0x5cec1a[_0x2fda('0xba')]]['dialAMDActive']&&_0x3ec017[_0x2fda('0xe8')]===_0x2fda('0xe9')){delete this[_0x2fda('0x2c')][_0x3ec017[_0x2fda('0xea')]];this['updateOriginated'](this[_0x2fda('0x24')][_0x5cec1a['queue']]);this[_0x2fda('0x24')][_0x5cec1a[_0x2fda('0xba')]][_0x2fda('0x62')]+=0x1;this[_0x2fda('0x24')][_0x5cec1a[_0x2fda('0xba')]][_0x2fda('0xeb')]+=0x1;_0x2b40b8=new Hangup(_0x5cec1a,_0x3ec017);_0x2b40b8[_0x2fda('0xac')]=0x12;_0x2b40b8[_0x2fda('0xec')]='HangupInAMD';_0x2b40b8['membername']=_0x2fda('0xed');ami[_0x2fda('0x50')](_0x2fda('0xee'),ut[_0x2fda('0xef')](_0x2b40b8,_0x2fda('0xf0')));this[_0x2fda('0xda')](_0x2b40b8,_0x2fda('0xf1'),'[syncHangupInAMD]');}if(_0x5cec1a['type']!=='ivr'&&this[_0x2fda('0x24')][_0x5cec1a['queue']][_0x2fda('0xf2')]&&_0x3ec017[_0x2fda('0xe8')]===_0x2fda('0xf3')){return new Promise(function(_0x3db70d,_0x16964a){delete _0x6e3c14[_0x2fda('0x2c')][_0x3ec017[_0x2fda('0xea')]];_0x6e3c14[_0x2fda('0xb8')](_0x6e3c14[_0x2fda('0x24')][_0x5cec1a['queue']]);_0x6e3c14['voiceQueues'][_0x5cec1a[_0x2fda('0xba')]][_0x2fda('0x62')]+=0x1;_0x6e3c14[_0x2fda('0x24')][_0x5cec1a[_0x2fda('0xba')]][_0x2fda('0xeb')]+=0x1;var _0xb9a6a1=_0x6e3c14[_0x2fda('0x24')][_0x5cec1a['queue']];var _0x5dc2ec=new Hangup(_0x5cec1a,_0x3ec017);_0x5dc2ec[_0x2fda('0xac')]=0x13;_0x5dc2ec[_0x2fda('0xec')]=_0x2fda('0xf4');_0x5dc2ec['membername']='AMD';_0x5dc2ec[_0x2fda('0xf5')]+=0x1;_0x5dc2ec[_0x2fda('0xf6')]+=0x1;_0x5dc2ec[_0x2fda('0xf0')]=!![];ami['emit'](_0x2fda('0xee'),ut[_0x2fda('0xef')](_0x5dc2ec,_0x2fda('0xf0')));_0x6e3c14[_0x2fda('0xd3')](_0x5dc2ec)[_0x2fda('0xb5')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5dc2ec[_0x2fda('0xf7')]+_0x5dc2ec[_0x2fda('0xf8')]+_0x5dc2ec['countnoanswerretry']+_0x5dc2ec['countnosuchnumberretry']+_0x5dc2ec['countdropretry']+_0x5dc2ec[_0x2fda('0xf9')]+_0x5dc2ec[_0x2fda('0xf5')]+_0x5dc2ec['countagentrejectretry']>=_0xb9a6a1['dialGlobalMaxRetry']){_0x6e3c14[_0x2fda('0xfa')](_0x5dc2ec,_0x3db70d,_0x16964a,'reason19\x20machine....');}else{if(_0x5dc2ec[_0x2fda('0xf5')]>=_0xb9a6a1['dialMachineMaxRetry']){_0x6e3c14['createStateFinal'](_0x5dc2ec,_0x3db70d,_0x16964a,_0x2fda('0xfb'));}else{_0x6e3c14[_0x2fda('0xc9')]({'active':![],'countmachineretry':_0x5dc2ec[_0x2fda('0xf5')],'scheduledat':moment()['add'](_0xb9a6a1[_0x2fda('0xfc')],'minutes')['format'](_0x2fda('0xfd')),'ContactId':_0x5dc2ec['ContactId'],'ListId':_0x5dc2ec['ListId'],'VoiceQueueId':_0x5dc2ec['VoiceQueueId']||undefined,'CampaignId':_0x5dc2ec['CampaignId']||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xfe')));_0x3db70d({'reschedule':0x1});}}});}if(_0x5cec1a[_0x2fda('0x58')]==='ivr'&&this['campaigns'][_0x5cec1a[_0x2fda('0xba')]][_0x2fda('0xf2')]&&_0x3ec017[_0x2fda('0xe8')]==='HANGUP'){delete this['uniqueId'][_0x3ec017[_0x2fda('0xea')]];this[_0x2fda('0xb8')](this['campaigns'][_0x5cec1a[_0x2fda('0xba')]]);_0x2b40b8=new Hangup(_0x5cec1a,_0x3ec017);_0x2b40b8[_0x2fda('0xac')]=0x12;_0x2b40b8[_0x2fda('0xec')]=_0x2fda('0xff');_0x2b40b8['membername']='AMD';ami[_0x2fda('0x50')](_0x2fda('0xee'),ut['buildObj'](_0x2b40b8,_0x2fda('0xf0')));this['saveInDb'](_0x2b40b8,_0x2fda('0x100'),_0x2fda('0x101'));}if(_0x5cec1a['type']==='ivr'&&this[_0x2fda('0x25')][_0x5cec1a[_0x2fda('0xba')]][_0x2fda('0xf2')]&&_0x3ec017[_0x2fda('0xe8')]===_0x2fda('0xf3')){return new Promise(function(_0x49b4b1,_0x86e0ad){delete _0x6e3c14[_0x2fda('0x2c')][_0x3ec017['uniqueid']];_0x6e3c14[_0x2fda('0xb8')](_0x6e3c14[_0x2fda('0x25')][_0x5cec1a[_0x2fda('0xba')]]);_0x6e3c14[_0x2fda('0x25')][_0x5cec1a[_0x2fda('0xba')]][_0x2fda('0x62')]+=0x1;_0x6e3c14[_0x2fda('0x25')][_0x5cec1a[_0x2fda('0xba')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4cd882=_0x6e3c14[_0x2fda('0x25')][_0x5cec1a[_0x2fda('0xba')]];var _0x1e2d67=new Hangup(_0x5cec1a,_0x3ec017);_0x1e2d67[_0x2fda('0xac')]=0x13;_0x1e2d67[_0x2fda('0xec')]=_0x2fda('0xf4');_0x1e2d67[_0x2fda('0x102')]=_0x2fda('0xed');_0x1e2d67[_0x2fda('0xf5')]+=0x1;_0x1e2d67[_0x2fda('0xf6')]+=0x1;_0x1e2d67[_0x2fda('0xf0')]=!![];ami[_0x2fda('0x50')](_0x2fda('0xee'),ut[_0x2fda('0xef')](_0x1e2d67,_0x2fda('0xf0')));_0x6e3c14[_0x2fda('0xd3')](_0x1e2d67)['catch'](loggerCatch(_0x2fda('0x103')));if(_0x1e2d67[_0x2fda('0xf7')]+_0x1e2d67[_0x2fda('0xf8')]+_0x1e2d67[_0x2fda('0x104')]+_0x1e2d67['countnosuchnumberretry']+_0x1e2d67[_0x2fda('0x105')]+_0x1e2d67[_0x2fda('0xf9')]+_0x1e2d67[_0x2fda('0xf5')]+_0x1e2d67[_0x2fda('0x106')]>=_0x4cd882[_0x2fda('0x107')]){_0x6e3c14[_0x2fda('0xfa')](_0x1e2d67,_0x49b4b1,_0x86e0ad,_0x2fda('0x108'));}else{if(_0x1e2d67[_0x2fda('0xf5')]>=_0x4cd882[_0x2fda('0x109')]){_0x6e3c14[_0x2fda('0x10a')](_0x1e2d67,_0x49b4b1,_0x86e0ad,_0x2fda('0xfb'));}else{_0x6e3c14[_0x2fda('0xc9')]({'active':![],'countmachineretry':_0x1e2d67[_0x2fda('0xf5')],'scheduledat':moment()['add'](_0x4cd882[_0x2fda('0xfc')],_0x2fda('0x10b'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1e2d67[_0x2fda('0x10c')],'ListId':_0x1e2d67['ListId'],'VoiceQueueId':_0x1e2d67[_0x2fda('0xdd')]||undefined,'CampaignId':_0x1e2d67[_0x2fda('0xde')]||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xfe')));_0x49b4b1({'reschedule':0x1});}}});}}};Dialer[_0x2fda('0x1e')][_0x2fda('0x3a')]=function(_0x5af1d1){var _0x3af0f6=this[_0x2fda('0x2c')][_0x5af1d1[_0x2fda('0xea')]];var _0x1006a0;if(_0x3af0f6&&_0x3af0f6[_0x2fda('0x58')]===_0x2fda('0xb7')){delete this[_0x2fda('0x2c')][_0x5af1d1['uniqueid']];this[_0x2fda('0xb8')](this['campaigns'][_0x3af0f6[_0x2fda('0xba')]]);this[_0x2fda('0x25')][_0x3af0f6[_0x2fda('0xba')]][_0x2fda('0x10d')]+=0x1;_0x1006a0=new Hangup(_0x3af0f6,_0x5af1d1);this[_0x2fda('0xd3')](_0x1006a0)[_0x2fda('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x2fda('0xd2')](_0x1006a0)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x10e')));}if(_0x3af0f6&&_0x3af0f6[_0x2fda('0x58')]!=='ivr'&&isNotNull(this[_0x2fda('0x24')][_0x3af0f6[_0x2fda('0xba')]][_0x2fda('0x10f')])){delete this[_0x2fda('0x2c')][_0x5af1d1[_0x2fda('0xea')]];this['updateOriginated'](this[_0x2fda('0x24')][_0x3af0f6[_0x2fda('0xba')]]);this[_0x2fda('0x24')][_0x3af0f6[_0x2fda('0xba')]][_0x2fda('0x62')]+=0x1;this['voiceQueues'][_0x3af0f6[_0x2fda('0xba')]][_0x2fda('0xeb')]+=0x1;_0x1006a0=new Hangup(_0x3af0f6,_0x5af1d1);_0x1006a0[_0x2fda('0xac')]=0x10;_0x1006a0[_0x2fda('0xec')]=_0x2fda('0x110');_0x1006a0[_0x2fda('0x102')]='AGI';this['createHistory'](_0x1006a0)[_0x2fda('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x2fda('0xd2')](_0x1006a0)[_0x2fda('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x3af0f6&&_0x3af0f6['type']!==_0x2fda('0xb7')&&!isNotNull(this['voiceQueues'][_0x3af0f6[_0x2fda('0xba')]][_0x2fda('0x10f')])){delete this[_0x2fda('0x2c')][_0x5af1d1['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x3af0f6[_0x2fda('0xba')]]);this['voiceQueues'][_0x3af0f6[_0x2fda('0xba')]][_0x2fda('0x111')]+=0x1;_0x1006a0=new Hangup(_0x3af0f6,_0x5af1d1);_0x1006a0[_0x2fda('0xac')]=0xc;_0x1006a0[_0x2fda('0xec')]=_0x5af1d1[_0x2fda('0x112')];_0x1006a0[_0x2fda('0x102')]=_0x2fda('0x113');this[_0x2fda('0xd3')](_0x1006a0)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x114')));this[_0x2fda('0xd2')](_0x1006a0)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x10e')));}};Dialer[_0x2fda('0x1e')][_0x2fda('0x36')]=function(_0x2c59e0){var _0xb4eb7d=this[_0x2fda('0x2c')][_0x2c59e0[_0x2fda('0xea')]];if(this[_0x2fda('0x24')][_0x2c59e0[_0x2fda('0xba')]]){if(_0xb4eb7d&&_0xb4eb7d[_0x2fda('0x58')]!=='ivr'){delete this['uniqueId'][_0x2c59e0[_0x2fda('0xea')]];this[_0x2fda('0x24')][_0x2c59e0[_0x2fda('0xba')]]['outboundAnswerCallsDay']+=0x1;var _0x497bed=new AgentComplete(_0xb4eb7d,_0x2c59e0);if(_0x2c59e0[_0x2fda('0x115')]==='agent'){_0x497bed['agiafterat']=this['voiceQueues'][_0x2c59e0[_0x2fda('0xba')]][_0x2fda('0x116')]&&this[_0x2fda('0x24')][_0x2c59e0[_0x2fda('0xba')]][_0x2fda('0x117')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x2fda('0xd3')](_0x497bed)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x118')));this[_0x2fda('0xd2')](_0x497bed)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x119')));}}};Dialer[_0x2fda('0x1e')]['syncAgentConnect']=function(_0x15db39){if(this[_0x2fda('0x24')][_0x15db39['queue']]){if(this['uniqueId'][_0x15db39['uniqueid']]&&this[_0x2fda('0x2c')][_0x15db39[_0x2fda('0xea')]][_0x2fda('0x58')]!=='ivr'){this[_0x2fda('0xb8')](this[_0x2fda('0x24')][_0x15db39[_0x2fda('0xba')]]);this['uniqueId'][_0x15db39['uniqueid']]['answertime']=moment()[_0x2fda('0x7e')](_0x2fda('0xfd'));}}};Dialer[_0x2fda('0x1e')][_0x2fda('0x11a')]=function(_0x8bc925,_0x360197){this[_0x2fda('0xd3')](_0x8bc925)['catch'](loggerCatch(_0x2fda('0x118')));if(_0x360197==0x0){this[_0x2fda('0xd2')](_0x8bc925)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x11b')));}};Dialer['prototype'][_0x2fda('0x32')]=function(_0x29b810){var _0x14371f=this['uniqueId'][_0x29b810[_0x2fda('0xea')]];var _0x4b6267=this;var _0x2e8fe9=![];var _0x3c0b9f;var _0x176948;if(this[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]]){if(_0x14371f&&_0x14371f['type']!==_0x2fda('0xb7')){delete this['uniqueId'][_0x29b810['uniqueid']];this[_0x2fda('0xb8')](this[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]]);_0x14371f[_0x2fda('0x11c')]=moment()[_0x2fda('0x7e')](_0x2fda('0xfd'));var _0x470684=new QueueCallerAbandon(_0x14371f,_0x29b810);if(getSeconds(_0x14371f[_0x2fda('0x11c')],_0x14371f['responsetime'])>=_0x14371f['dialQueueTimeout']){this[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x70')]+=0x1;this[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x11d')]+=0x1;this[_0x2fda('0x24')][_0x29b810['queue']][_0x2fda('0x11e')]+=0x1;_0x470684[_0x2fda('0xac')]=0xa;_0x470684[_0x2fda('0xec')]=_0x2fda('0x11f');_0x470684[_0x2fda('0x120')]=_0x2fda('0x121');_0x470684[_0x2fda('0x122')]=this['voiceQueues'][_0x29b810[_0x2fda('0xba')]]['dialQueueProject2']?moment()[_0x2fda('0x7e')](_0x2fda('0xfd')):undefined;_0x470684[_0x2fda('0x105')]+=0x1;_0x470684[_0x2fda('0xf6')]+=0x1;_0x3c0b9f=this['voiceQueues'][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x123')];_0x176948=this[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x124')];_0x4b6267[_0x2fda('0xc0')](_0x470684,_0x470684[_0x2fda('0xac')],_0x14371f[_0x2fda('0x125')])[_0x2fda('0xc3')](function(_0x145276){_0x2e8fe9=_0x145276[_0x2fda('0x126')]==0x1;if(_0x470684[_0x2fda('0x105')]>=_0x4b6267[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x127')]){_0x4b6267['queueCallerAbandonCreateState'](_0x470684,_0x145276[_0x2fda('0x126')]);}else{_0x4b6267[_0x2fda('0xc9')]({'active':![],'countdropretry':_0x470684[_0x2fda('0x105')],'scheduledat':moment()['add'](_0x4b6267[_0x2fda('0x24')][_0x29b810['queue']]['dialDropRetryFrequency'],_0x2fda('0x10b'))['format'](_0x2fda('0xfd')),'ContactId':_0x14371f['ContactId'],'ListId':_0x14371f[_0x2fda('0x128')],'VoiceQueueId':_0x14371f[_0x2fda('0xdd')]||undefined,'CampaignId':_0x14371f['CampaignId']||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x129')));var _0x63a860=new History(_0x470684);_0x63a860[_0x2fda('0xac')]=0xa;_0x63a860[_0x2fda('0xec')]=_0x2fda('0x11f');_0x63a860[_0x2fda('0xad')]=moment()[_0x2fda('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x63a860[_0x2fda('0x12a')]=_0x63a860[_0x2fda('0xad')];_0x63a860['calleridname']=_0x470684[_0x2fda('0x12b')];_0x63a860[_0x2fda('0x12c')]=_0x470684['calleridnum'];_0x4b6267[_0x2fda('0xd3')](_0x63a860)['catch'](loggerCatch(_0x2fda('0x12d')));}})[_0x2fda('0xc3')](function(){if(_0x2e8fe9)_0x4b6267[_0x2fda('0xc2')](_0x470684,_0x3c0b9f,_0x176948)[_0x2fda('0xc3')](function(){return 0x1;});});}else{this[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x6f')]+=0x1;this[_0x2fda('0x24')][_0x29b810['queue']][_0x2fda('0x67')]+=0x1;_0x470684[_0x2fda('0xac')]=0xb;_0x470684['statedesc']=_0x2fda('0x12e');_0x470684[_0x2fda('0x120')]='CALLEREXIT';_0x470684[_0x2fda('0xf9')]+=0x1;_0x470684['countglobal']+=0x1;_0x3c0b9f=this[_0x2fda('0x24')][_0x29b810['queue']][_0x2fda('0x12f')];_0x176948=this[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x124')];_0x4b6267[_0x2fda('0xc0')](_0x470684,_0x470684[_0x2fda('0xac')],_0x14371f[_0x2fda('0x125')])[_0x2fda('0xc3')](function(_0xc982e6){if(_0x470684['countabandonedretry']>=_0x4b6267[_0x2fda('0x24')][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x130')]){_0x4b6267[_0x2fda('0x11a')](_0x470684,_0xc982e6[_0x2fda('0x126')]);}else{_0x4b6267[_0x2fda('0xc9')]({'active':![],'countabandonedretry':_0x470684[_0x2fda('0xf9')],'scheduledat':moment()[_0x2fda('0x131')](_0x4b6267['voiceQueues'][_0x29b810[_0x2fda('0xba')]][_0x2fda('0x12f')],_0x2fda('0x10b'))[_0x2fda('0x7e')](_0x2fda('0xfd')),'ContactId':_0x14371f['ContactId'],'ListId':_0x14371f[_0x2fda('0x128')],'VoiceQueueId':_0x14371f[_0x2fda('0xdd')]||undefined,'CampaignId':_0x14371f['CampaignId']||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x132')));var _0x46f474=new History(_0x470684);_0x46f474[_0x2fda('0xac')]=0xb;_0x46f474[_0x2fda('0xec')]='Abandoned';_0x46f474[_0x2fda('0xad')]=moment()[_0x2fda('0x7e')](_0x2fda('0xfd'));_0x46f474[_0x2fda('0x12a')]=_0x46f474[_0x2fda('0xad')];_0x46f474[_0x2fda('0x12b')]=_0x470684[_0x2fda('0x12b')];_0x46f474[_0x2fda('0x12c')]=_0x470684[_0x2fda('0x12c')];_0x4b6267['createHistory'](_0x46f474)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x133')));}})[_0x2fda('0xc3')](function(){if(_0x2e8fe9)_0x4b6267[_0x2fda('0xc2')](_0x470684,_0x3c0b9f,_0x176948)[_0x2fda('0xc3')](function(){return 0x1;});});}}}};Dialer[_0x2fda('0x1e')]['syncNewExten']=function(_0x3001a5){if(this[_0x2fda('0x2a')][_0x3001a5[_0x2fda('0xea')]]){this['actions'][_0x3001a5[_0x2fda('0xea')]][_0x2fda('0xb4')]=_0x3001a5[_0x2fda('0xb4')];}if(this[_0x2fda('0x2c')][_0x3001a5[_0x2fda('0xea')]]){this['uniqueId'][_0x3001a5[_0x2fda('0xea')]]['channel']=_0x3001a5[_0x2fda('0xb4')];}};Dialer['prototype'][_0x2fda('0x3f')]=function(_0x12f1d5){if(strategy[this[_0x2fda('0x24')][this[_0x2fda('0x2a')][_0x12f1d5['actionid']][_0x2fda('0xba')]][_0x2fda('0x52')]]===_0x2fda('0x1d')){if(this[_0x2fda('0x2a')][_0x12f1d5[_0x2fda('0x134')]]&&_['isNil'](this[_0x2fda('0x2a')][_0x12f1d5[_0x2fda('0x134')]][_0x2fda('0x135')])&&_0x12f1d5['status']==='1'&&_0x12f1d5['paused']==='0'){if(this[_0x2fda('0x26')][_0x12f1d5[_0x2fda('0x136')]]){if(!this[_0x2fda('0x26')][_0x12f1d5[_0x2fda('0x136')]]['locked']){this[_0x2fda('0x26')][_0x12f1d5[_0x2fda('0x136')]][_0x2fda('0x135')]=!![];this['actions'][_0x12f1d5[_0x2fda('0x134')]][_0x2fda('0x135')]=!![];this['actions'][_0x12f1d5[_0x2fda('0x134')]][_0x2fda('0x136')]=_0x12f1d5['stateinterface'];}}}}else if((strategy[this[_0x2fda('0x24')][this['actions'][_0x12f1d5[_0x2fda('0x134')]]['queue']][_0x2fda('0x52')]]||_0x2fda('0x137'))===_0x2fda('0x137')){if(this[_0x2fda('0x2a')][_0x12f1d5[_0x2fda('0x134')]]){if(this[_0x2fda('0x26')][_0x12f1d5[_0x2fda('0x136')]]){this[_0x2fda('0x2a')][_0x12f1d5['actionid']][_0x2fda('0x136')]=_0x12f1d5['stateinterface'];if(_[_0x2fda('0xb2')](this[_0x2fda('0x138')][this['actions'][_0x12f1d5['actionid']]['queue']])){this[_0x2fda('0x138')][this[_0x2fda('0x2a')][_0x12f1d5['actionid']][_0x2fda('0xba')]]=[];}this[_0x2fda('0x138')][this[_0x2fda('0x2a')][_0x12f1d5[_0x2fda('0x134')]][_0x2fda('0xba')]]['push'](_[_0x2fda('0x93')](_[_0x2fda('0xdb')](this['actions'][_0x12f1d5[_0x2fda('0x134')]],[_0x2fda('0x139'),_0x2fda('0x136')]),{'status':_0x12f1d5[_0x2fda('0xb3')],'paused':_0x12f1d5[_0x2fda('0x13a')]}));}}}};function unlockQueueStatus(_0x582468,_0x35ad0a){setTimeout(function(){if(_[_0x2fda('0x8b')](_0x582468['queueStatusComplete'])){loggerBooked[_0x2fda('0x9d')](_0x2fda('0x13b'),_0x35ad0a);}_0x582468['queueStatusComplete']=!![];loggerBooked[_0x2fda('0x83')](_0x2fda('0x13c'),_0x35ad0a,JSON[_0x2fda('0x7d')](_[_0x2fda('0xdb')](_0x582468,[_0x2fda('0x44'),_0x2fda('0x13d')])));},0x1f3);}Dialer[_0x2fda('0x1e')][_0x2fda('0x13e')]=function(_0x268291){var _0x174726=this;var _0x36cfb0=_0x174726[_0x2fda('0x24')][_0x174726[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]]['queue']];if(strategy[this[_0x2fda('0x24')][this['actions'][_0x268291['actionid']][_0x2fda('0xba')]][_0x2fda('0x52')]]===_0x2fda('0x1d')){if(this[_0x2fda('0x2a')][_0x268291['actionid']]&&this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]]['stateinterface']){this[_0x2fda('0x23')][_0x2fda('0x13f')](this['actions'][_0x268291[_0x2fda('0x134')]][_0x2fda('0x139')],this['actions'][_0x268291[_0x2fda('0x134')]][_0x2fda('0x136')])['catch'](function(_0x445b1c){logger[_0x2fda('0x9d')](_0x2fda('0x140'),util[_0x2fda('0x9c')](_0x445b1c,{'showHidden':![],'depth':null}));})[_0x2fda('0x21')](function(){_0x174726[_0x2fda('0xb8')](_0x174726[_0x2fda('0x24')][_0x174726[_0x2fda('0x2a')][_0x268291['actionid']][_0x2fda('0xba')]]);_0x174726['agents'][_0x174726[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]][_0x2fda('0x136')]][_0x2fda('0x135')]=![];delete _0x174726[_0x2fda('0x2a')][_0x268291['actionid']];unlockQueueStatus(_0x36cfb0);});}else{this[_0x2fda('0xb8')](this['voiceQueues'][this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]]['queue']]);this[_0x2fda('0xc9')]({'active':![],'ContactId':this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]][_0x2fda('0x10c')],'ListId':this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]][_0x2fda('0x128')],'VoiceQueueId':this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]][_0x2fda('0xdd')]||undefined,'CampaignId':this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]][_0x2fda('0xde')]||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x141')));delete this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]];unlockQueueStatus(_0x36cfb0);}}else if((strategy[this[_0x2fda('0x24')][this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]][_0x2fda('0xba')]][_0x2fda('0x52')]]||'rrmemory')==='rrmemory'){var _0x198c46;if(this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]]&&!_[_0x2fda('0x4b')](this[_0x2fda('0x138')][this['actions'][_0x268291[_0x2fda('0x134')]][_0x2fda('0xba')]])){if(this['queueBookedRR'][_0x174726[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]]['queue']]){this[_0x2fda('0x142')][_0x174726['actions'][_0x268291[_0x2fda('0x134')]][_0x2fda('0xba')]]=this['queueBookedRR'][this['actions'][_0x268291[_0x2fda('0x134')]][_0x2fda('0xba')]]?this[_0x2fda('0x142')][this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]][_0x2fda('0xba')]]:this[_0x2fda('0x138')][this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]]['queue']]?this[_0x2fda('0x138')][this[_0x2fda('0x2a')][_0x268291['actionid']]['queue']]['_rr']||0x0:0x0;}this[_0x2fda('0x138')][this[_0x2fda('0x2a')][_0x268291['actionid']][_0x2fda('0xba')]][_0x2fda('0x143')]=this[_0x2fda('0x142')][this[_0x2fda('0x2a')][_0x268291[_0x2fda('0x134')]][_0x2fda('0xba')]];for(var _0x33691d=0x0;_0x33691d=0x0;})[_0x2fda('0xb5')](myreject(_0x3c5a3a)));}}else{_0x226829[_0x2fda('0x156')](ami['Action']({'action':'command','command':util[_0x2fda('0x7e')](_0x2fda('0x159'),_0x383bcf,!_[_0x2fda('0x8b')](config['timezones'][_0x2e947c])?_0x2e947c:'')})['then'](function(_0x49ea6f){return _0x49ea6f[_0x2fda('0x15d')][_0x2fda('0x15b')](_0x2fda('0x15c'))>=0x0;})[_0x2fda('0xb5')](myreject(_0x3c5a3a)));}Promise[_0x2fda('0x15e')](_0x226829)[_0x2fda('0xc3')](function(_0x4c8ee0){var _0x2ca68b=_[_0x2fda('0x15f')](_0x4c8ee0);if(_0x2ca68b){return _0x290867(_0x2ca68b);}else{_0x48a66d[_0x2fda('0x42')]=_0x4719c9?_0x2fda('0x160'):'INTERVAL_IS_OVERTIME';return _0x3c5a3a(msgResponse(_0x2fda('0x161'),'Failure',_0x2fda('0x162')+_0x4719c9+'\x20'+_0x309b62+'\x20Interval\x20is\x20overtime:\x20'+util[_0x2fda('0x9c')](_0x383bcf,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2e947c));}})[_0x2fda('0xb5')](function(_0x5c41ae){return _0x3c5a3a(msgResponse(_0x2fda('0x14f'),_0x2fda('0x151'),JSON[_0x2fda('0x7d')](_0x5c41ae)));});});};Dialer[_0x2fda('0x1e')][_0x2fda('0x163')]=function(_0x506a9b){var _0x30156a=this;return function(){switch(_0x506a9b[_0x2fda('0x5e')]){case _0x2fda('0x164'):freeVariablesPredictive(_0x506a9b);_0x30156a[_0x2fda('0x165')](_0x506a9b,0x1);break;case'power':freeVariablesPredictive(_0x506a9b);_0x30156a[_0x2fda('0x165')](_0x506a9b,_0x506a9b['dialPowerLevel']);break;case _0x2fda('0x166'):_0x30156a['predictive'](_0x506a9b);break;case'booked':freeVariablesPredictive(_0x506a9b);_0x30156a['handlePower'](_0x506a9b,0x1);break;default:freeVariablesPredictive(_0x506a9b);logger[_0x2fda('0x9d')](_0x2fda('0x167'),_0x506a9b[_0x2fda('0x44')],_0x2fda('0x168'));}};};Dialer[_0x2fda('0x1e')][_0x2fda('0x169')]=function(_0x559a09){return Promise['resolve']()[_0x2fda('0xc3')](cmHopper[_0x2fda('0x16a')](_0x559a09['id'],previewRecallmeReminderInterval))['then'](function(_0xe6fc9e){for(var _0x34c28c=0x0;_0x34c28c<_0xe6fc9e[_0x2fda('0x9e')];_0x34c28c++){var _0x34a4d6=_0xe6fc9e[_0x34c28c][_0x2fda('0x16b')][_0x2fda('0x44')];if(_0x34a4d6)io['to'](util[_0x2fda('0x7e')](_0x2fda('0x16c'),_0x34a4d6))['emit']('user:dialPreviewRecallReminder',{'hopper':_0xe6fc9e[_0x34c28c]});}})[_0x2fda('0xb5')](function(){});};Dialer['prototype'][_0x2fda('0x16d')]=function(_0x1409c3){var _0x2e5d55=this;return function(){_0x2e5d55[_0x2fda('0x16e')](_0x1409c3);};};Dialer[_0x2fda('0x1e')][_0x2fda('0xa')]=function(_0x24cb6c){var _0x375450=this;if(isNotPreview(_0x24cb6c[_0x2fda('0x5e')])){if(isVoiceQueueOutbound(_0x24cb6c[_0x2fda('0x58')])&&isActive(_0x24cb6c[_0x2fda('0x5d')])){_0x24cb6c[_0x2fda('0xa6')]=!![];Promise['resolve']()[_0x2fda('0xc3')](checkIsLoggedIn(_0x24cb6c,_0x24cb6c[_0x2fda('0x55')]))[_0x2fda('0xc3')](checkIsActive(_0x24cb6c,_0x24cb6c[_0x2fda('0x5d')]))[_0x2fda('0xc3')](checkInterval(_0x24cb6c))[_0x2fda('0xc3')](_0x375450[_0x2fda('0x14b')](_0x24cb6c))[_0x2fda('0xc3')](_0x375450[_0x2fda('0x16f')](_0x24cb6c[_0x2fda('0x170')],_0x24cb6c[_0x2fda('0x171')],_0x24cb6c[_0x2fda('0x44')],_0x24cb6c))[_0x2fda('0xc3')](_0x375450['checkIfTimeIntervals'](_0x24cb6c[_0x2fda('0x47')],_0x24cb6c['dialTimezone'],_0x24cb6c['name'],_0x24cb6c))[_0x2fda('0xc3')](_0x375450['checkDialMethod'](_0x24cb6c))[_0x2fda('0xb5')](loggerCatchQueueSummary('[syncQueueSummary]',_0x24cb6c));}else{notSendMessagesQueue(_0x24cb6c);}}else{freeVariablesPredictive(_0x24cb6c);}};Dialer['prototype'][_0x2fda('0x39')]=_[_0x2fda('0x172')](function(){var _0x5c822e=_['filter'](this['voiceQueues'],function(_0x1bc087){return _0x1bc087[_0x2fda('0x173')];});var _0x30074b=_[_0x2fda('0x174')](this[_0x2fda('0x26')],function(_0x1b4db9){return _0x1b4db9[_0x2fda('0x175')]&&_0x1b4db9['status']===_0x2fda('0xe3');});if(_0x5c822e[_0x2fda('0x9e')]>0x0&&_0x30074b[_0x2fda('0x9e')]>0x0){return Promise['resolve']()[_0x2fda('0xc3')](cmHopper['handlePreviewRecallNotifications'](_[_0x2fda('0x176')](_0x5c822e,'id'),previewRecallmeReminderInterval,_[_0x2fda('0x176')](_0x30074b,'id')))[_0x2fda('0xc3')](function(_0x2d17cc){for(var _0x1da489=0x0;_0x1da489<_0x2d17cc[_0x2fda('0x9e')];_0x1da489++){var _0x9a6858=_0x2d17cc[_0x1da489]['Agent'][_0x2fda('0x44')];if(_0x9a6858)io['to'](util[_0x2fda('0x7e')]('user:%s',_0x9a6858))[_0x2fda('0x50')](_0x2fda('0x177'),{'hopper':_0x2d17cc[_0x1da489]});}})[_0x2fda('0xb5')](function(_0x4cffd0){logger[_0x2fda('0x9d')]('checkPreviewRecallReminder',_0x4cffd0);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x2fda('0x1e')]['syncCampaigns']=function(){var _0x868698=this;var _0x2c15d2;for(var _0x19f82c in this['campaigns']){if(typeof this[_0x2fda('0x25')][_0x19f82c]!==_0x2fda('0x9f')){_0x2c15d2=this[_0x2fda('0x25')][_0x19f82c];if(isCampaignIvr(_0x2c15d2[_0x2fda('0x58')])&&isActive(_0x2c15d2[_0x2fda('0x178')])){_0x2c15d2[_0x2fda('0xa6')]=!![];Promise[_0x2fda('0xbc')]()[_0x2fda('0xc3')](checkIsActive(_0x2c15d2,_0x2c15d2[_0x2fda('0x178')]))['then'](checkInterval(_0x2c15d2))[_0x2fda('0xc3')](_0x868698[_0x2fda('0x14b')](_0x2c15d2))[_0x2fda('0xc3')](_0x868698['checkIfTime'](_0x2c15d2[_0x2fda('0x170')],_0x2c15d2[_0x2fda('0x171')],_0x2c15d2[_0x2fda('0x44')],_0x2c15d2))[_0x2fda('0xc3')](_0x868698[_0x2fda('0x150')](_0x2c15d2[_0x2fda('0x47')],_0x2c15d2[_0x2fda('0x171')],_0x2c15d2[_0x2fda('0x44')],_0x2c15d2))[_0x2fda('0xc3')](_0x868698[_0x2fda('0x16d')](_0x2c15d2))['catch'](loggerCatchQueueSummary(_0x2fda('0x179'),_0x2c15d2));}else{notSendMessagesCampaign(_0x2c15d2);}}}};function getCallerIdRandom(_0x16d915,_0x40fb80){var _0x5ab8cf;var _0x3d2d08;var _0x27c3d8;if(_0x40fb80<=0x0){_0x40fb80=0x1;}_0x5ab8cf=new RegExp('\x5cw{0,'+_0x40fb80+'}$');_0x3d2d08=Math['pow'](0xa,_0x40fb80-0x1);_0x27c3d8=Math[_0x2fda('0x17a')](0xa,_0x40fb80)-0x1;return util['format']('%s',_[_0x2fda('0x17b')](_0x16d915,_0x5ab8cf,_[_0x2fda('0x17c')](_0x3d2d08,_0x27c3d8)));}function extractCalleridName(_0x26f6d0){var _0x169cc9=_0x26f6d0['match'](/"(.*?)"/);return _0x169cc9?_0x169cc9[0x1]:_0x26f6d0;}Dialer['prototype'][_0x2fda('0x17d')]=function(_0x8d660d,_0x531c8f){var _0xe7fd2e=this;var _0x10e265=uuid['v4']();this[_0x2fda('0x2a')][_0x10e265]=new Action(_0x8d660d,_0x531c8f,_0x10e265);return new Promise(function(_0x1d9e4b,_0x1ba894){if(_[_0x2fda('0x8b')](_0x8d660d)&&typeof _0x8d660d!==_0x2fda('0x17e')){return _0x1ba894(msgResponse(_0x2fda('0x17f'),_0x2fda('0x151'),'voiceQueue\x20is\x20undefine'));}if(_[_0x2fda('0x8b')](_0x531c8f['phone'])||_0x531c8f[_0x2fda('0x180')]===null){return _0x1ba894(msgResponse(_0x2fda('0x17f'),_0x2fda('0x151'),'contact\x20is\x20undefine'));}var _0x371eb1={'XMD-CALLERID':_0xe7fd2e[_0x2fda('0x2a')][_0x10e265][_0x2fda('0x181')](),'XMD-AGI':_0x8d660d[_0x2fda('0x10f')]?util[_0x2fda('0x7e')](_0x2fda('0x182'),ipAgi,_0x8d660d[_0x2fda('0x10f')]):_0x2fda('0x183'),'XMD-AGIAFTER':_0x8d660d['dialQueueProject2']?util['format'](_0x2fda('0x182'),ipAgi,_0x8d660d[_0x2fda('0x116')]):'NONE','XMD-QUEUE':_0x8d660d['type']===_0x2fda('0x51')?util[_0x2fda('0x7e')](_0x2fda('0x184'),_0x8d660d['name'],_0x8d660d[_0x2fda('0x185')]||'',_0x8d660d[_0x2fda('0x117')]?'c':'',_0x8d660d[_0x2fda('0x186')]||0x3):_0x2fda('0x183'),'XMD-CONTACTID':_0x531c8f['ContactId'],'XMD-CDRTYPE':_0x2fda('0x187'),'CALLERID(all)':_0xe7fd2e[_0x2fda('0x2a')][_0x10e265]['getCaller'](),'XMD-AMD':_0x8d660d[_0x2fda('0xf2')]?_0x2fda('0x188'):_0x2fda('0x183'),'XMD-DESTINATION':_0x2fda('0xe7')};if(_0x8d660d[_0x2fda('0xf2')]){_0x371eb1[_0x2fda('0x189')]=_0x8d660d[_0x2fda('0x18a')]||0x9c4;_0x371eb1[_0x2fda('0x18b')]=_0x8d660d[_0x2fda('0x18c')]||0x5dc;_0x371eb1[_0x2fda('0x18d')]=_0x8d660d[_0x2fda('0x18e')]||0x320;_0x371eb1[_0x2fda('0x18f')]=_0x8d660d[_0x2fda('0x190')]||0x1388;_0x371eb1[_0x2fda('0x191')]=_0x8d660d[_0x2fda('0x192')]||0x64;_0x371eb1['XMD-AMDBETWEENWORDSSILENCE']=_0x8d660d[_0x2fda('0x193')]||0x32;_0x371eb1[_0x2fda('0x194')]=_0x8d660d[_0x2fda('0x195')]||0x3;_0x371eb1[_0x2fda('0x196')]=_0x8d660d['dialAMDSilenceThreshold']||0x100;_0x371eb1[_0x2fda('0x197')]=_0x8d660d[_0x2fda('0x198')]||0x1388;}if(_0x8d660d[_0x2fda('0x58')]==='outbound'){_0x371eb1['XMD-VOICEQUEUEID']=_0x531c8f[_0x2fda('0xdd')];}else{_0x371eb1[_0x2fda('0x199')]=_0x531c8f[_0x2fda('0xde')];}for(var _0x1ef1b7 in _0x531c8f[_0x2fda('0x19a')]){if(typeof _0x531c8f['Contact'][_0x1ef1b7]!==_0x2fda('0x9f')){if(isNotNull(_0x531c8f[_0x2fda('0x19a')][_0x1ef1b7])&&_0x1ef1b7!=='id'&&_0x1ef1b7!==_0x2fda('0x19b')&&_0x1ef1b7!==_0x2fda('0x19c')&&_0x1ef1b7!==_0x2fda('0x19d')){_0x371eb1[util['format'](_0x2fda('0x19e'),_0x2fda('0x19f'),_[_0x2fda('0x1a0')](_0x1ef1b7))]=_0x531c8f[_0x2fda('0x19a')][_0x1ef1b7];}}}var _0x536f45=_0xe7fd2e['isTrunkReachable'](_0x8d660d[_0x2fda('0x7b')])?getCallerId(_0x8d660d[_0x2fda('0x7b')]['callerid'],_0x8d660d['dialOriginateCallerIdName'],_0x8d660d[_0x2fda('0x1a1')]>0x0?getCallerIdRandom(_0x8d660d[_0x2fda('0x1a2')],_0x8d660d[_0x2fda('0x1a1')]):_0x8d660d[_0x2fda('0x1a2')]):getCallerId(_['isNil'](_0x8d660d[_0x2fda('0x14c')])?_0x8d660d['Trunk'][_0x2fda('0x7c')]:_0x8d660d[_0x2fda('0x14c')][_0x2fda('0x7c')],_0x8d660d[_0x2fda('0x5f')],_0x8d660d[_0x2fda('0x1a1')]>0x0?getCallerIdRandom(_0x8d660d[_0x2fda('0x1a2')],_0x8d660d[_0x2fda('0x1a1')]):_0x8d660d[_0x2fda('0x1a2')]);if(_0x536f45){_0x371eb1[_0x2fda('0x1a3')]=_0xe7fd2e['actions'][_0x10e265][_0x2fda('0x1a4')]=extractCalleridName(_0x536f45);_0x371eb1['XMD-ORIGINATECALLERIDNUM']=_0x531c8f['phone'];}_0x8d660d['variables']=_0x371eb1;return ami[_0x2fda('0x157')]({'actionid':_0x10e265,'action':_0x2fda('0x17f'),'channel':_0xe7fd2e['isTrunkReachable'](_0x8d660d[_0x2fda('0x7b')])?util[_0x2fda('0x7e')](_0x2fda('0x1a5'),_0x8d660d[_0x2fda('0x7b')][_0x2fda('0x44')],isNotNull(_0x8d660d['dialPrefix'])?_0x8d660d[_0x2fda('0x61')]['trim']()||'':'',_0x8d660d[_0x2fda('0x1a6')]>0x0?_0x531c8f['phone'][_0x2fda('0x1a7')](_0x8d660d[_0x2fda('0x1a6')]):_0x531c8f[_0x2fda('0x180')]):util[_0x2fda('0x7e')](_0x2fda('0x1a5'),_[_0x2fda('0xb2')](_0x8d660d[_0x2fda('0x14c')])?_0x8d660d[_0x2fda('0x7b')][_0x2fda('0x44')]:_0x8d660d[_0x2fda('0x14c')][_0x2fda('0x44')],isNotNull(_0x8d660d[_0x2fda('0x61')])?_0x8d660d[_0x2fda('0x61')][_0x2fda('0x1a8')]()||'':'',_0x8d660d[_0x2fda('0x1a6')]>0x0?_0x531c8f[_0x2fda('0x180')][_0x2fda('0x1a7')](_0x8d660d[_0x2fda('0x1a6')]):_0x531c8f[_0x2fda('0x180')]),'callerid':_0x536f45,'Exten':_0x2fda('0xe7'),'Context':_0x2fda('0x1a9'),'Priority':'1','variable':_0x371eb1,'timeout':(_0x8d660d[_0x2fda('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x10e265})[_0x2fda('0xc3')](function(_0x4a754c){return _0x1d9e4b(_0x4a754c);})[_0x2fda('0xb5')](function(_0x4b3bc0){_0x8d660d[_0x2fda('0x69')]+=0x1;var _0x5eb559=new History(_0xe7fd2e[_0x2fda('0x2a')][_0x10e265]);logger[_0x2fda('0x9d')](util[_0x2fda('0x7e')](_0x2fda('0x1aa'),JSON['stringify'](_0x4b3bc0)));_0x5eb559[_0x2fda('0xac')]=0xe;_0x5eb559[_0x2fda('0xec')]=_0x2fda('0x1ab');_0x5eb559['starttime']=moment()[_0x2fda('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5eb559[_0x2fda('0x12a')]=_0x5eb559[_0x2fda('0xad')];_0xe7fd2e['createHistory'](_0x5eb559)[_0x2fda('0xb5')](loggerCatch('[originate][error]'));_0xe7fd2e[_0x2fda('0xd2')](_0x5eb559)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1ac')))[_0x2fda('0x21')](function(){delete _0xe7fd2e[_0x2fda('0x2a')][_0x10e265];return _0x1ba894(msgResponse('originate',_0x2fda('0x4d'),_0x2fda('0x1ad')));});});});};Dialer[_0x2fda('0x1e')][_0x2fda('0x34')]=function(_0x304fe3){var _0x5936dc=this[_0x2fda('0x2a')][_0x304fe3[_0x2fda('0x134')]];if(_0x5936dc){delete this['actions'][_0x304fe3['actionid']];_0x5936dc[_0x2fda('0x1ae')]=moment()[_0x2fda('0x7e')](_0x2fda('0xfd'));var _0x229f0b=_0x5936dc[_0x2fda('0x58')]===_0x2fda('0xb7')?this[_0x2fda('0x25')][_0x5936dc[_0x2fda('0xba')]]:this[_0x2fda('0x24')][_0x5936dc[_0x2fda('0x1af')]()];if(!this[_0x2fda('0xdf')](_0x304fe3['response'])){this[_0x2fda('0xb8')](_0x229f0b);return this[_0x2fda('0x1b0')](_0x5936dc,_0x229f0b,_0x304fe3)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1b1')));}this[_0x2fda('0x2c')][_0x304fe3[_0x2fda('0xea')]]=_0x5936dc;}};Dialer[_0x2fda('0x1e')][_0x2fda('0x1b2')]=function(_0x2898c7,_0x213bf1,_0x222d1e){var _0x505072=new History(_0x213bf1);if(_0x505072[_0x2fda('0xf7')]+_0x505072[_0x2fda('0xf8')]+_0x505072[_0x2fda('0x104')]+_0x505072[_0x2fda('0x1b3')]+_0x505072[_0x2fda('0x105')]+_0x505072['countabandonedretry']+_0x505072[_0x2fda('0xf5')]+_0x505072[_0x2fda('0x106')]>=_0x222d1e[_0x2fda('0x107')]-0x1){return!![];}switch(_0x2898c7){case 0x3:if(_0x505072[_0x2fda('0x104')]>=_0x222d1e[_0x2fda('0x1b4')]-0x1){return!![];}this[_0x2fda('0xc9')]({'active':![],'countnoanswerretry':_0x505072[_0x2fda('0x104')]+=0x1,'scheduledat':moment()['add'](_0x222d1e[_0x2fda('0x1b5')],_0x2fda('0x10b'))[_0x2fda('0x7e')](_0x2fda('0xfd')),'ContactId':_0x505072[_0x2fda('0x10c')],'ListId':_0x505072[_0x2fda('0x128')],'VoiceQueueId':_0x505072[_0x2fda('0xdd')]||undefined,'CampaignId':_0x505072[_0x2fda('0xde')]||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1b6')));break;case 0x5:if(_0x505072['countbusyretry']>=_0x222d1e[_0x2fda('0x1b7')]-0x1){return!![];}this[_0x2fda('0xc9')]({'active':![],'countbusyretry':_0x505072[_0x2fda('0xf7')]+=0x1,'scheduledat':moment()[_0x2fda('0x131')](_0x222d1e[_0x2fda('0x1b8')],_0x2fda('0x10b'))[_0x2fda('0x7e')](_0x2fda('0xfd')),'ContactId':_0x505072['ContactId'],'ListId':_0x505072[_0x2fda('0x128')],'VoiceQueueId':_0x505072[_0x2fda('0xdd')]||undefined,'CampaignId':_0x505072['CampaignId']||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1b9')));break;case 0x8:if(_0x505072[_0x2fda('0xf8')]>=_0x222d1e[_0x2fda('0x1ba')]-0x1){return!![];}this[_0x2fda('0xc9')]({'active':![],'countcongestionretry':_0x505072['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x222d1e[_0x2fda('0x1bb')],_0x2fda('0x10b'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x505072[_0x2fda('0x10c')],'ListId':_0x505072[_0x2fda('0x128')],'VoiceQueueId':_0x505072[_0x2fda('0xdd')]||undefined,'CampaignId':_0x505072['CampaignId']||undefined})[_0x2fda('0xb5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x505072[_0x2fda('0x1b3')]>=_0x222d1e[_0x2fda('0x1bc')]-0x1){return!![];}else{this[_0x2fda('0xc9')]({'active':![],'countnosuchnumberretry':_0x505072[_0x2fda('0x1b3')]+=0x1,'scheduledat':moment()[_0x2fda('0x131')](_0x222d1e[_0x2fda('0x1bd')],'minutes')[_0x2fda('0x7e')](_0x2fda('0xfd')),'ContactId':_0x505072[_0x2fda('0x10c')],'ListId':_0x505072[_0x2fda('0x128')],'VoiceQueueId':_0x505072[_0x2fda('0xdd')]||undefined,'CampaignId':_0x505072[_0x2fda('0xde')]||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1be')));}break;case 0xa:if(_0x505072['countdropretry']>=_0x222d1e[_0x2fda('0x127')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x505072[_0x2fda('0x105')]+=0x1,'scheduledat':moment()[_0x2fda('0x131')](_0x222d1e['dialDropRetryFrequency'],_0x2fda('0x10b'))[_0x2fda('0x7e')](_0x2fda('0xfd')),'ContactId':_0x505072['ContactId'],'ListId':_0x505072['ListId'],'VoiceQueueId':_0x505072[_0x2fda('0xdd')]||undefined,'CampaignId':_0x505072['CampaignId']||undefined})[_0x2fda('0xb5')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x505072[_0x2fda('0xf9')]>=_0x222d1e[_0x2fda('0x130')]-0x1){return!![];}this[_0x2fda('0xc9')]({'active':![],'countabandonedretry':_0x505072[_0x2fda('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x222d1e[_0x2fda('0x12f')],'minutes')[_0x2fda('0x7e')](_0x2fda('0xfd')),'ContactId':_0x505072[_0x2fda('0x10c')],'ListId':_0x505072[_0x2fda('0x128')],'VoiceQueueId':_0x505072[_0x2fda('0xdd')]||undefined,'CampaignId':_0x505072['CampaignId']||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x132')));break;case 0x13:if(_0x505072['countmachineretry']>=_0x222d1e[_0x2fda('0x109')]-0x1){return!![];}this[_0x2fda('0xc9')]({'active':![],'countmachineretry':_0x505072[_0x2fda('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x222d1e[_0x2fda('0xfc')],'minutes')[_0x2fda('0x7e')](_0x2fda('0xfd')),'ContactId':_0x505072[_0x2fda('0x10c')],'ListId':_0x505072[_0x2fda('0x128')],'VoiceQueueId':_0x505072[_0x2fda('0xdd')]||undefined,'CampaignId':_0x505072['CampaignId']||undefined})[_0x2fda('0xb5')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x505072[_0x2fda('0x106')]>=_0x222d1e[_0x2fda('0x1bf')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x505072[_0x2fda('0x106')]+=0x1,'scheduledat':moment()[_0x2fda('0x131')](_0x222d1e[_0x2fda('0x1c0')],_0x2fda('0x10b'))[_0x2fda('0x7e')](_0x2fda('0xfd')),'ContactId':_0x505072[_0x2fda('0x10c')],'ListId':_0x505072[_0x2fda('0x128')],'VoiceQueueId':_0x505072['VoiceQueueId']||undefined,'CampaignId':_0x505072[_0x2fda('0xde')]||undefined})['catch'](loggerCatch(_0x2fda('0x1c1')));break;default:return!![];}};Dialer[_0x2fda('0x1e')][_0x2fda('0x1b0')]=function(_0xe8b875,_0x5e2562,_0x45990d){var _0x39dd6c=this;var _0x172126=new History(_0xe8b875);var _0x554986=![];var _0x22387b;var _0x2dd27b;return new Promise(function(_0x1d6b7c,_0x31fd8c){if(_[_0x2fda('0x8b')](_0x5e2562)&&typeof _0x5e2562!==_0x2fda('0x17e')){return _0x31fd8c(msgResponse(_0x2fda('0x1c2'),_0x2fda('0x151'),_0x2fda('0x1c3')));}if(_[_0x2fda('0x8b')](_0x45990d)&&typeof _0x45990d!==_0x2fda('0x17e')){return _0x31fd8c(msgResponse('[callProgressDetecting]','Failure',_0x2fda('0x1c4')));}_0x39dd6c[_0x2fda('0xc0')](_0x172126,_0x45990d['reason'],_0x5e2562)[_0x2fda('0xc3')](function(_0x1a7e78){if(_0x1a7e78['additional']==0x1)_0x554986=!![];switch(_0x45990d['reason']){case'0':_0x5e2562['outboundNoSuchCallsDay']+=0x1;_0x172126[_0x2fda('0xac')]=0x0;_0x172126[_0x2fda('0xec')]='NoSuchNumber';_0x172126[_0x2fda('0x1b3')]+=0x1;_0x172126[_0x2fda('0xf6')]+=0x1;ami['emit'](_0x2fda('0x1c5'),ut[_0x2fda('0xef')](_0xe8b875,'nosuchnumber'));_0x22387b=_0x5e2562[_0x2fda('0x1bd')];_0x2dd27b=_0x5e2562[_0x2fda('0x124')];_0x39dd6c[_0x2fda('0xd3')](_0x172126)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x103')));if(_0x39dd6c[_0x2fda('0x1b2')](0x0,_0xe8b875,_0x5e2562)&&!_0x554986){if(_0x172126['countnosuchnumberretry']>=_0x5e2562[_0x2fda('0x1bc')]){_0x39dd6c[_0x2fda('0x10a')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1c6'));}else{_0x39dd6c['stateGlobal'](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1c6'));}}break;case'3':_0x5e2562['outboundNoAnswerCallsDay']+=0x1;_0x172126[_0x2fda('0xac')]=0x3;_0x172126['statedesc']=_0x2fda('0x1c7');_0x172126['countnoanswerretry']+=0x1;_0x172126[_0x2fda('0xf6')]+=0x1;var _0x5bce92=ut[_0x2fda('0x1c8')](_0xe8b875,_0x5e2562);ami[_0x2fda('0x50')](_0x2fda('0x1c9'),_0x5bce92);_0x22387b=_0x5e2562[_0x2fda('0x1b5')];_0x2dd27b=_0x5e2562[_0x2fda('0x124')];_0x39dd6c[_0x2fda('0xd3')](_0x172126)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1ca')));if(_0x39dd6c[_0x2fda('0x1b2')](0x3,_0xe8b875,_0x5e2562)&&!_0x554986){if(_0x172126[_0x2fda('0x104')]>=_0x5e2562[_0x2fda('0x1b4')]){_0x39dd6c[_0x2fda('0x10a')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1cb'));}else{_0x39dd6c[_0x2fda('0xfa')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1cb'));}}break;case'5':_0x5e2562[_0x2fda('0x64')]+=0x1;_0x172126['state']=0x5;_0x172126['statedesc']=_0x2fda('0x1cc');_0x172126[_0x2fda('0xf7')]+=0x1;_0x172126[_0x2fda('0xf6')]+=0x1;ami[_0x2fda('0x50')](_0x2fda('0x1cd'),ut[_0x2fda('0xef')](_0xe8b875,_0x2fda('0x1ce')));_0x22387b=_0x5e2562[_0x2fda('0x1b8')];_0x2dd27b=_0x5e2562['callAdditionalPhoneAfterMin'];_0x39dd6c['createHistory'](_0x172126)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1cf')));if(_0x39dd6c[_0x2fda('0x1b2')](0x5,_0xe8b875,_0x5e2562)&&!_0x554986){if(_0x172126[_0x2fda('0xf7')]>=_0x5e2562[_0x2fda('0x1b7')]){_0x39dd6c[_0x2fda('0x10a')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1d0'));}else{_0x39dd6c[_0x2fda('0xfa')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1d0'));}}break;case'8':_0x5e2562[_0x2fda('0x65')]+=0x1;_0x172126[_0x2fda('0xac')]=0x8;_0x172126[_0x2fda('0xec')]=_0x2fda('0x1d1');_0x172126[_0x2fda('0xf8')]+=0x1;_0x172126['countglobal']+=0x1;_0x22387b=_0x5e2562['dialCongestionRetryFrequency'];_0x2dd27b=_0x5e2562[_0x2fda('0x124')];ami[_0x2fda('0x50')](_0x2fda('0x1d2'),ut[_0x2fda('0xef')](_0xe8b875,_0x2fda('0x1d3')));_0x39dd6c[_0x2fda('0xd3')](_0x172126)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1d4')));if(_0x39dd6c[_0x2fda('0x1b2')](0x8,_0xe8b875,_0x5e2562)&&!_0x554986){if(_0x172126['countcongestionretry']>=_0x5e2562[_0x2fda('0x1ba')]){_0x39dd6c['createStateFinal'](_0x172126,_0x1d6b7c,_0x31fd8c,'reason\x208\x20congestion');}else{_0x39dd6c[_0x2fda('0xfa')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1d5'));}}break;case'11':_0x5e2562['outboundAbandonedCallsDay']+=0x1;_0x172126[_0x2fda('0xac')]=0xb;_0x172126[_0x2fda('0xec')]=_0x2fda('0x12e');_0x172126[_0x2fda('0xf9')]+=0x1;_0x172126['countglobal']+=0x1;_0x22387b=_0x5e2562[_0x2fda('0x12f')];_0x2dd27b=_0x5e2562[_0x2fda('0x124')];_0x39dd6c[_0x2fda('0xd3')](_0x172126)[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x133')));if(_0x39dd6c['checkRetriveMax'](0xb,_0xe8b875,_0x5e2562)&&!_0x554986){if(_0x172126[_0x2fda('0xf9')]>=_0x5e2562[_0x2fda('0x130')]){_0x39dd6c[_0x2fda('0x10a')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1d6'));}else{_0x39dd6c[_0x2fda('0xfa')](_0x172126,_0x1d6b7c,_0x31fd8c,'reason\x2011\x20abandoned');}}break;case'20':_0x5e2562['outboundRejectCallsDay']+=0x1;_0x172126[_0x2fda('0xac')]=0x14;_0x172126[_0x2fda('0xec')]='AgentReject';_0x172126['countagentrejectretry']+=0x1;_0x172126[_0x2fda('0xf6')]+=0x1;_0x22387b=_0x5e2562[_0x2fda('0x1c0')];_0x2dd27b=_0x5e2562[_0x2fda('0x124')];ami[_0x2fda('0x50')](_0x2fda('0x1d7'),ut['buildObj'](_0xe8b875,_0x2fda('0x1d8')));_0x39dd6c[_0x2fda('0xd3')](_0x172126)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x39dd6c[_0x2fda('0x1b2')](0x14,_0xe8b875,_0x5e2562)&&!_0x554986){if(_0x172126[_0x2fda('0x106')]>=_0x5e2562[_0x2fda('0x1bf')]){_0x39dd6c['createStateFinal'](_0x172126,_0x1d6b7c,_0x31fd8c,_0x2fda('0x1d9'));}else{_0x39dd6c[_0x2fda('0xfa')](_0x172126,_0x1d6b7c,_0x31fd8c,'reason\x2020\x20agentreject');}}break;default:_0x5e2562[_0x2fda('0x111')]+=0x1;_0x172126[_0x2fda('0xac')]=0xc;_0x172126[_0x2fda('0xec')]=_0x45990d[_0x2fda('0x115')];_0x22387b=_0x5e2562[_0x2fda('0x1c0')];_0x2dd27b=_0x5e2562['callAdditionalPhoneAfterMin'];_0x39dd6c[_0x2fda('0xd3')](_0x172126)[_0x2fda('0xb5')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x39dd6c[_0x2fda('0x1b2')](_0x45990d[_0x2fda('0x115')],_0xe8b875,_0x5e2562)&&!_0x554986){if(_0x172126[_0x2fda('0xf7')]+_0x172126[_0x2fda('0xf8')]+_0x172126[_0x2fda('0x104')]+_0x172126[_0x2fda('0x1b3')]+_0x172126[_0x2fda('0x105')]+_0x172126['countabandonedretry']+_0x172126[_0x2fda('0xf5')]+_0x172126[_0x2fda('0x106')]>=_0x5e2562[_0x2fda('0x107')]){_0x39dd6c[_0x2fda('0xfa')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x45990d[_0x2fda('0x115')]);}else{_0x39dd6c[_0x2fda('0x10a')](_0x172126,_0x1d6b7c,_0x31fd8c,_0x45990d[_0x2fda('0x115')]);}}}})[_0x2fda('0xc3')](function(){if(_0x554986){_0x39dd6c[_0x2fda('0xc2')](_0x172126,_0x22387b,_0x2dd27b)[_0x2fda('0xc3')](function(){return _0x1d6b7c(0x1);});}});});};Dialer[_0x2fda('0x1e')]['stateGlobal']=function(_0x1a19df,_0x5aa9da,_0x3a1680,_0x3e0918){var _0x458496=new Final(_0x1a19df);_0x458496['state']=0xf;_0x458496[_0x2fda('0xec')]='Global';this[_0x2fda('0x10a')](_0x458496,_0x5aa9da,_0x3a1680,_0x3e0918);};Dialer[_0x2fda('0x1e')][_0x2fda('0x10a')]=function(_0x376296,_0x4530e6,_0xf0d7c7,_0x222110){this['moveContactManagedDialer'](_0x376296)[_0x2fda('0xc3')](function(){return _0x4530e6(msgResponse('[callProgressDetecting]',_0x2fda('0xe0'),_0x222110));})[_0x2fda('0xb5')](function(){return _0xf0d7c7(msgResponse(_0x2fda('0x1da'),_0x2fda('0x151'),_0x2fda('0x1db')));});};Dialer[_0x2fda('0x1e')][_0x2fda('0x166')]=function(_0x508594){var _0x11bb4d=_0x508594['dialPredictiveOptimizationPercentage']/0x64;var _0x3de732=_0x508594[_0x2fda('0x11d')]/(_0x508594[_0x2fda('0x11d')]+_0x508594['outboundAnswerCallsDay']);var _0x5b6016=Math[_0x2fda('0x1dc')](_0x508594[_0x2fda('0x75')]*(_0x508594[_0x2fda('0x1dd')]/0x64));var _0x4e112f=Math[_0x2fda('0x1dc')](_0x508594['predictiveIntervalAvailable']*(_0x508594[_0x2fda('0x1de')]/0x64));var _0x114c9c=_0x508594[_0x2fda('0x54')]+_0x508594[_0x2fda('0x57')];var _0x20a7f9=Math[_0x2fda('0x1df')](_0x508594[_0x2fda('0x77')]*_0x508594[_0x2fda('0x79')]*_0x508594['predictiveIntervalHitRate']*_0x508594[_0x2fda('0x73')]);if(_[_0x2fda('0x8b')](_0x508594[_0x2fda('0x2e')])){if(!_[_0x2fda('0x8b')](_0x508594['startPredictive'])){_0x508594[_0x2fda('0x2d')]=undefined;loggerPredictive[_0x2fda('0x9d')](_0x2fda('0x1e0'),_0x2fda('0x1e1'));}if(!_[_0x2fda('0x8b')](_0x508594['handlePredictive'])){loggerPredictive['error'](_0x2fda('0x1e0'),_0x2fda('0x1e2'));clearInterval(_0x508594[_0x2fda('0x97')]);_0x508594[_0x2fda('0x97')]=undefined;}_0x508594['startProgressive']=moment()[_0x2fda('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x508594[_0x2fda('0x44')],_0x2fda('0x1e3'),_0x508594['startProgressive']);this[_0x2fda('0x165')](_0x508594,0x1);}else if(ifInterval(_0x508594[_0x2fda('0x1e4')],_0x508594[_0x2fda('0x2e')])){this['handlePower'](_0x508594,0x1);loggerPredictiveCalls['info'](_0x2fda('0x1e5'),_0x508594[_0x2fda('0x2e')],_0x508594['name']);_0x508594[_0x2fda('0x77')]=0x0;_0x508594[_0x2fda('0x11e')]=0x0;}else if(_0x11bb4d<_0x3de732&&_0x508594[_0x2fda('0x1e6')]===_0x2fda('0x1e7')){freeVariablesPredictive(_0x508594);loggerPredictive['info'](_0x2fda('0x1e8'),'Dropped\x20calls\x20day',_0x3de732,_0x2fda('0x2e'),_0x508594[_0x2fda('0x44')]);}else if(_0x20a7f9<_0x508594[_0x2fda('0x11e')]&&_0x508594['dialPredictiveOptimization']===_0x2fda('0x1e7')){freeVariablesPredictive(_0x508594);loggerPredictive[_0x2fda('0x83')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x2fda('0x1e9'),_0x20a7f9,_0x2fda('0x1ea'),_0x508594[_0x2fda('0x11e')],_0x2fda('0x2e'),_0x508594['name']);}else if(!ifInterval(_0x508594[_0x2fda('0x1e4')],_0x508594[_0x2fda('0x2e')])&&_[_0x2fda('0x8b')](_0x508594['startPredictive'])&&!_[_0x2fda('0x8b')](_0x508594[_0x2fda('0x2e')])){_0x508594[_0x2fda('0x2d')]=moment()[_0x2fda('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x2fda('0x83')](_0x508594[_0x2fda('0x44')],_0x2fda('0x1eb'),_0x508594[_0x2fda('0x2d')]);this[_0x2fda('0xc6')](_0x508594[_0x2fda('0x1e4')])[_0x2fda('0xc3')](this['getDataPredictive'](_0x508594))[_0x2fda('0xc3')](mergeDataErlangB(_0x508594))[_0x2fda('0xc3')](this[_0x2fda('0x1ec')](_0x508594))[_0x2fda('0xb5')](loggerCatchPredictive(_0x2fda('0x1ed'),_0x508594));}else if(!ifInterval(_0x508594[_0x2fda('0x1e4')],_0x508594[_0x2fda('0x2d')])){_0x508594[_0x2fda('0x11e')]=0x0;_0x508594['startPredictive']=moment()[_0x2fda('0x7e')](_0x2fda('0xfd'));loggerPredictive[_0x2fda('0x83')](_0x508594['name'],'recalculate\x20predictive\x20at',_0x508594[_0x2fda('0x2d')]);clearInterval(_0x508594[_0x2fda('0x97')]);_0x508594[_0x2fda('0x97')]=undefined;this['averageHandleTime'](_0x508594[_0x2fda('0x1e4')])[_0x2fda('0xc3')](this['getDataPredictive'](_0x508594))[_0x2fda('0xc3')](mergeDataErlangB(_0x508594))['then'](this[_0x2fda('0x1ec')](_0x508594))[_0x2fda('0xb5')](loggerCatchPredictive(_0x2fda('0x1ee'),_0x508594));}else if(_0x508594[_0x2fda('0x75')]&&_0x114c9c<_0x508594['predictiveIntervalAvailable']-_0x4e112f){freeVariablesPredictive(_0x508594);loggerPredictive['info'](_0x508594[_0x2fda('0x44')],_0x2fda('0x1ef'),_0x114c9c,')\x20are\x20less\x20than\x20threshold\x20(',_0x508594['predictiveIntervalAvailable'],'-',_0x4e112f,'=',_0x508594[_0x2fda('0x75')]-_0x4e112f,')');}else if(_0x508594['predictiveIntervalAvailable']&&_0x114c9c>_0x508594['predictiveIntervalAvailable']+_0x5b6016){freeVariablesPredictive(_0x508594);loggerPredictive[_0x2fda('0x83')](_0x508594[_0x2fda('0x44')],_0x2fda('0x1ef'),_0x114c9c,')\x20are\x20more\x20than\x20threshold\x20(',_0x508594[_0x2fda('0x75')],'+',_0x5b6016,'=',_0x508594[_0x2fda('0x75')]+_0x5b6016,')');}};Dialer[_0x2fda('0x1e')][_0x2fda('0x1f0')]=function(_0xd40c9e){var _0x34c0e9=this;return function(_0x571252){return new Promise(function(_0x39ef13,_0xb3ef24){_[_0x2fda('0x93')](_0xd40c9e,_0x571252[0x0]);if(checkGetDataPredictive(_0x571252[0x0])){var _0x35f8ef=_0xd40c9e[_0x2fda('0x75')]=_0xd40c9e[_0x2fda('0x57')]+_0xd40c9e[_0x2fda('0x54')];var _0x194ab9=_0xd40c9e['dialPredictiveInterval']*0x3c;var _0x1fe492=_0x571252[0x0][_0x2fda('0x6e')]+_0x571252[0x0][_0x2fda('0x6d')];var _0x157593=(_0x571252[0x0][_0x2fda('0x6c')]+_0x571252[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x571252[0x0][_0x2fda('0x6f')])/_0x571252[0x0]['predictiveIntervalTotalCalls'];_0xd40c9e[_0x2fda('0x72')]=_0x157593>0x0?_0x157593:0x1;switch(_0xd40c9e[_0x2fda('0x1e6')]){case _0x2fda('0x1e7'):var _0x16038a=_0xd40c9e[_0x2fda('0x1f1')]/0x64;return _0x34c0e9['abandonmentRate'](_0x35f8ef,_0x194ab9,_0x1fe492,_0x157593,_0x16038a)[_0x2fda('0xc3')](function(_0x4c7458){return _0x39ef13(_0x4c7458);});case _0x2fda('0x1f2'):var _0x31a98f=_0xd40c9e[_0x2fda('0x1f1')]/0x64;return _0x34c0e9['busyFactor'](_0x35f8ef,_0x194ab9,_0x1fe492,_0x157593,_0x31a98f)[_0x2fda('0xc3')](function(_0x194652){return _0x39ef13(_0x194652);});default:return _0xb3ef24(msgResponse(_0x2fda('0x1f3'),_0x2fda('0x151'),_0x2fda('0x1f4')));}}else{return _0xb3ef24(msgResponse('[getDataPredictive]',_0x2fda('0x151'),'check\x20failure'));}});};};Dialer[_0x2fda('0x1e')][_0x2fda('0x1f5')]=function(_0x318410){var _0x4ab3e4=this;return function(_0x985653){return new Promise(function(_0x344315,_0x16b914){_[_0x2fda('0x93')](_0x318410,_0x985653[0x0]);if(checkGetDataPredictive(_0x985653[0x0])){loggerPredictive[_0x2fda('0x83')](JSON['stringify'](_0x985653[0x0]));if(_0x318410[_0x2fda('0x1e6')]===_0x2fda('0x1e7')){return _0x4ab3e4['getVoiceQueueRtPauses'](_0x318410['id'])[_0x2fda('0xc3')](function(_0x1e61f0){var _0x135b69=_0x318410[_0x2fda('0x55')]-_0x1e61f0[0x0][_0x2fda('0x1f6')];var _0xffd7fa=_0x318410[_0x2fda('0x1e4')]*0x3c;var _0x301157=_0x985653[0x0][_0x2fda('0x6e')]+_0x985653[0x0]['predictiveIntervalAvgHoldtime'];var _0x1e0855=(_0x985653[0x0][_0x2fda('0x6c')]+_0x985653[0x0][_0x2fda('0x70')]+_0x985653[0x0][_0x2fda('0x6f')])/_0x985653[0x0][_0x2fda('0x76')];var _0x44bb4a=_0x318410[_0x2fda('0x1f1')]/0x64;_0x318410[_0x2fda('0x74')]=_0x1e61f0[0x0]['outboundQueuePauses']||0x0;_0x318410[_0x2fda('0x72')]=_0x1e0855>0x0?_0x1e0855:0x1;return _0x4ab3e4['abandonmentRate'](_0x135b69,_0xffd7fa,_0x301157,_0x1e0855,_0x44bb4a);})['then'](function(_0x2a8e5c){return _0x344315(_0x2a8e5c);})['catch'](function(_0x358958){return _0x16b914(msgResponse('[CatchErlangB]',_0x2fda('0x151'),JSON['stringify'](_0x358958)));});}if(_0x318410[_0x2fda('0x1e6')]===_0x2fda('0x1f2')){return _0x4ab3e4[_0x2fda('0xd0')](_0x318410['id'])[_0x2fda('0xc3')](function(_0x50f298){var _0x6a8257=_0x318410[_0x2fda('0x55')]-_0x50f298[0x0][_0x2fda('0x1f6')];var _0x527842=_0x318410[_0x2fda('0x1e4')]*0x3c;var _0x25871f=_0x985653[0x0][_0x2fda('0x6e')]+_0x985653[0x0]['predictiveIntervalAvgHoldtime'];var _0x12f8f8=(_0x985653[0x0][_0x2fda('0x6c')]+_0x985653[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x985653[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x985653[0x0][_0x2fda('0x76')];var _0x142c7f=_0x318410['dialPredictiveOptimizationPercentage']/0x64;_0x318410[_0x2fda('0x74')]=_0x50f298[0x0][_0x2fda('0x1f6')]||0x0;_0x318410[_0x2fda('0x72')]=_0x12f8f8>0x0?_0x12f8f8:0x1;return _0x4ab3e4['busyFactor'](_0x6a8257,_0x527842,_0x25871f,_0x12f8f8,_0x142c7f);})[_0x2fda('0xc3')](function(_0x35c8c9){return _0x344315(_0x35c8c9);})['catch'](function(_0x4b342a){return _0x16b914(msgResponse(_0x2fda('0x1f7'),_0x2fda('0x151'),JSON[_0x2fda('0x7d')](_0x4b342a)));});}}else{return _0x16b914(msgResponse(_0x2fda('0x1f3'),'Failure',_0x2fda('0x1f8')));}});};};Dialer[_0x2fda('0x1e')][_0x2fda('0x1ec')]=function(_0x4f582c){var _0x11d98a=this;return function(){var _0x51cc6a=0x0;var _0x29b9f4=Math['floor'](_0x4f582c['erlangCallToSecond']*0x3e8);if(_0x29b9f4>0x0){_0x29b9f4=_0x29b9f4<0x64?0x64:_0x29b9f4;loggerPredictive['info'](_0x4f582c[_0x2fda('0x44')],'one\x20call\x20every:',_0x29b9f4,'milliseconds');_0x4f582c[_0x2fda('0x97')]=setInterval(function(){_0x11d98a['handlePredictive'](_0x4f582c);loggerPredictiveCalls[_0x2fda('0x83')](_0x2fda('0x1f9'),_0x51cc6a+=0x1);},_0x29b9f4);}else{loggerPredictive['info'](_0x4f582c[_0x2fda('0x44')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x2fda('0x1e')][_0x2fda('0x1fa')]=function(_0x5b8d71,_0x21405d){var _0x1fc210=this;return function(_0x37cbc0){if(_[_0x2fda('0x4b')](_0x37cbc0)){if(_['isNil'](_0x21405d['UserId'])||!_0x21405d[_0x2fda('0x1fb')]){if(_0x5b8d71[_0x2fda('0x5e')]===_0x2fda('0x8')){_0x5b8d71['queueStatusComplete']=_[_0x2fda('0x8b')](_0x5b8d71['queueStatusComplete'])?!![]:_0x5b8d71[_0x2fda('0x13d')];var _0x2f6f5f=uuid['v4']();_0x1fc210[_0x2fda('0x2a')][_0x2f6f5f]=new Action(_0x5b8d71,_0x21405d,_0x2f6f5f);loggerBooked[_0x2fda('0x83')](_0x2fda('0x1fc'),_0x2f6f5f,_0x2fda('0x1fd'),JSON['stringify'](_0x5b8d71['queueStatusComplete']),'Queue:\x20',_0x5b8d71['name']);if(_0x5b8d71[_0x2fda('0x13d')]){_0x5b8d71[_0x2fda('0x13d')]=![];_0x1fc210[_0x2fda('0x138')][_0x1fc210['actions'][_0x2f6f5f][_0x2fda('0xba')]]=[];ami['Action']({'actionid':_0x2f6f5f,'action':_0x2fda('0x1fe'),'queue':_0x5b8d71[_0x2fda('0x44')]})[_0x2fda('0xb5')](function(){_0x1fc210[_0x2fda('0xb8')](_0x5b8d71);_0x1fc210[_0x2fda('0xc9')]({'active':![],'ContactId':_0x1fc210['actions'][_0x2f6f5f][_0x2fda('0x10c')],'ListId':_0x1fc210[_0x2fda('0x2a')][_0x2f6f5f][_0x2fda('0x128')],'VoiceQueueId':_0x1fc210[_0x2fda('0x2a')][_0x2f6f5f][_0x2fda('0xdd')]||undefined,'CampaignId':_0x1fc210[_0x2fda('0x2a')][_0x2f6f5f][_0x2fda('0xde')]||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x1ff')));delete _0x1fc210[_0x2fda('0x2a')][_0x2f6f5f];});}else{loggerBooked[_0x2fda('0x83')](_0x2fda('0x200'),JSON['stringify'](_0x5b8d71[_0x2fda('0x13d')]),'Queue:\x20',_0x5b8d71[_0x2fda('0x44')]);_0x1fc210['updateOriginated'](_0x5b8d71);_0x1fc210[_0x2fda('0xc9')]({'active':![],'ContactId':_0x1fc210['actions'][_0x2f6f5f][_0x2fda('0x10c')],'ListId':_0x1fc210[_0x2fda('0x2a')][_0x2f6f5f][_0x2fda('0x128')],'VoiceQueueId':_0x1fc210[_0x2fda('0x2a')][_0x2f6f5f][_0x2fda('0xdd')]||undefined,'CampaignId':_0x1fc210[_0x2fda('0x2a')][_0x2f6f5f][_0x2fda('0xde')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1fc210[_0x2fda('0x2a')][_0x2f6f5f];}}else{return _0x1fc210['actionOriginate'](_0x5b8d71,_0x21405d);}}else{if(getDiff(_0x21405d['scheduledat'])<_0x5b8d71['dialRecallMeTimeout']*0x3c){if(_0x21405d[_0x2fda('0x16b')]&&!_0x21405d[_0x2fda('0x16b')][_0x2fda('0x201')]){_0x1fc210[_0x2fda('0x23')]['run'](_0x21405d['id'])[_0x2fda('0x21')](function(){_0x1fc210['updateOriginated'](_0x5b8d71);});}else{_0x1fc210['unlockContact']({'active':![]},_0x21405d['id'],0x1)[_0x2fda('0x21')](function(){_0x1fc210[_0x2fda('0xb8')](_0x5b8d71);});}}else{_0x5b8d71[_0x2fda('0x6a')]+=0x1;_0x1fc210[_0x2fda('0xb8')](_0x5b8d71);if(_0x5b8d71['dialRecallInQueue']){_0x1fc210[_0x2fda('0xc9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x21405d[_0x2fda('0x10c')],'ListId':_0x21405d[_0x2fda('0x128')],'VoiceQueueId':_0x21405d[_0x2fda('0xdd')]||undefined,'CampaignId':_0x21405d[_0x2fda('0xde')]||undefined})[_0x2fda('0xb5')](loggerCatch(_0x2fda('0x202')));_0x1fc210['createHistory'](createObjHistory(_0x5b8d71,_0x21405d,_0x2fda('0x203'),0x17,_0x2fda('0x204')))['catch'](loggerCatch(_0x2fda('0x205')));}else{_0x1fc210[_0x2fda('0xda')](createObjHistory(_0x5b8d71,_0x21405d,_0x2fda('0x206'),0x16,_0x2fda('0x207')),_0x2fda('0x208'),'[Originate][HistoryRecallClose]');}}}}else{_0x5b8d71[_0x2fda('0x63')]+=0x1;_0x1fc210[_0x2fda('0xda')](createObjHistory(_0x5b8d71,_0x21405d,_0x2fda('0x209'),0xd,_0x2fda('0x20a')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x2fda('0x1e')][_0x2fda('0x16e')]=function(_0x24dcab){var _0x4ceb9f=this;var _0x29ae66=_0x24dcab['limitCalls']-_0x24dcab[_0x2fda('0xa0')]-_0x24dcab[_0x2fda('0xce')];emitCampaignSummary(_0x24dcab);if(_0x29ae66>0x0){if(_0x29ae66>this[_0x2fda('0x28')]){_0x29ae66=this[_0x2fda('0x28')];}_0x24dcab['temp']+=_0x29ae66;this['getContactDialerIvr'](_0x24dcab['id'],_0x29ae66,_0x24dcab[_0x2fda('0x20b')],_0x24dcab)[_0x2fda('0xc3')](function(_0x20c1f0){_0x24dcab[_0x2fda('0xce')]-=_0x29ae66;_0x24dcab[_0x2fda('0xce')]=_0x24dcab[_0x2fda('0xce')]>0x0?_0x24dcab[_0x2fda('0xce')]:0x0;if(!checkContactEmpty(_0x20c1f0)){_0x24dcab['message']=_0x2fda('0xa4');logger['info'](_0x2fda('0x20c')+_0x24dcab[_0x2fda('0x44')]);}else{_0x24dcab[_0x2fda('0xa0')]+=_0x20c1f0[_0x2fda('0x9e')];_0x24dcab[_0x2fda('0x42')]=_0x2fda('0x20d');for(var _0x15cb2d=0x0;_0x15cb2d<_0x20c1f0[_0x2fda('0x9e')];_0x15cb2d+=0x1){_0x24dcab[_0x2fda('0x20e')]+=0x1;if(_[_0x2fda('0xb2')](_0x20c1f0[_0x15cb2d])||_[_0x2fda('0xb2')](_0x20c1f0[_0x15cb2d]['Contact'])||_[_0x2fda('0xb2')](_0x20c1f0[_0x15cb2d]['phone'])){_0x4ceb9f['emptyContact'](_0x2fda('0x20f'),_0x24dcab,_0x20c1f0[_0x15cb2d]);}else{_0x4ceb9f[_0x2fda('0xc5')](_[_0x2fda('0xdb')](_0x20c1f0[_0x15cb2d],['CampaignId',_0x2fda('0x180')]))[_0x2fda('0xc3')](_0x4ceb9f[_0x2fda('0x1fa')](_0x24dcab,_0x20c1f0[_0x15cb2d]))[_0x2fda('0xb5')](_0x4ceb9f[_0x2fda('0xd7')](_0x2fda('0x210'),_0x24dcab));}}}})[_0x2fda('0xb5')](loggerGetContactDialer(_0x2fda('0x211'),_0x24dcab,_0x29ae66));}};Dialer[_0x2fda('0x1e')]['handlePower']=function(_0x7fa725,_0x2746c6){var _0x44a471=this;var _0x282d77=[];var _0x47e29d=_0x2746c6>=0x1?_0x2746c6:0x1;if(_0x7fa725[_0x2fda('0x5e')]===_0x2fda('0x8')){_0x47e29d=0x1;}var _0x3d659b=Math[_0x2fda('0x1df')](_0x7fa725[_0x2fda('0x54')]*_0x47e29d)-_0x7fa725[_0x2fda('0xa0')]-_0x7fa725['temp'];emitVoiceQueueSummary(_0x7fa725);if(_0x7fa725[_0x2fda('0x212')]>0x0){var _0x428be9=_0x7fa725[_0x2fda('0x212')]-_0x7fa725[_0x2fda('0xa0')]-_0x7fa725[_0x2fda('0x57')]-_0x7fa725['temp']-_0x7fa725[_0x2fda('0x56')];if(_0x3d659b>_0x428be9){_0x3d659b=_0x428be9;}}if(_0x3d659b>0x0){if(_0x7fa725['dialMethod']===_0x2fda('0x8')){_0x3d659b=0x1;}if(_0x3d659b>this[_0x2fda('0x28')]){_0x3d659b=this[_0x2fda('0x28')];}_0x7fa725[_0x2fda('0xce')]+=_0x3d659b;for(var _0x1b4f7d in this[_0x2fda('0x26')]){if(typeof this[_0x2fda('0x26')][_0x1b4f7d]!==_0x2fda('0x9f')){if(this[_0x2fda('0x26')][_0x1b4f7d]['state']==='not_inuse'&&this[_0x2fda('0x26')][_0x1b4f7d][_0x2fda('0xb3')]==='reachable'){_0x282d77[_0x2fda('0x156')](this[_0x2fda('0x26')][_0x1b4f7d]['id']);}}}this[_0x2fda('0xcd')](_0x7fa725['id'],_0x282d77,_0x3d659b,_0x7fa725[_0x2fda('0x20b')],_0x7fa725)[_0x2fda('0xc3')](function(_0x5b74c9){_0x7fa725[_0x2fda('0xce')]-=_0x3d659b;_0x7fa725[_0x2fda('0xce')]=_0x7fa725[_0x2fda('0xce')]>0x0?_0x7fa725[_0x2fda('0xce')]:0x0;if(!checkContactEmpty(_0x5b74c9)){_0x44a471[_0x2fda('0x213')](_0x7fa725)[_0x2fda('0xc3')](sendMessageReschedule(_0x7fa725))[_0x2fda('0xb5')](loggerCatch(_0x2fda('0xbd')));}else{_0x7fa725[_0x2fda('0xa0')]+=_0x5b74c9['length'];_0x7fa725[_0x2fda('0x42')]=_0x7fa725[_0x2fda('0x5e')]===_0x2fda('0x8')?'ACTIVE':_0x2fda('0x20d');for(var _0x37b760=0x0;_0x37b760<_0x5b74c9[_0x2fda('0x9e')];_0x37b760+=0x1){if(_[_0x2fda('0xb2')](_0x5b74c9[_0x37b760])||_[_0x2fda('0xb2')](_0x5b74c9[_0x37b760]['Contact'])||_[_0x2fda('0xb2')](_0x5b74c9[_0x37b760][_0x2fda('0x180')])){_0x44a471[_0x2fda('0xd8')](_0x2fda('0x20f'),_0x7fa725,_0x5b74c9[_0x37b760]);}else{_0x44a471['checkIsBlackList'](_[_0x2fda('0xdb')](_0x5b74c9[_0x37b760],[_0x2fda('0xdd'),_0x2fda('0x180')]))['then'](_0x44a471['checkContactBlack'](_0x7fa725,_0x5b74c9[_0x37b760]))[_0x2fda('0xb5')](_0x44a471[_0x2fda('0xd7')](_0x2fda('0x20f'),_0x7fa725));}}}})['catch'](loggerGetContactDialer(_0x2fda('0x214'),_0x7fa725,_0x3d659b));}};Dialer[_0x2fda('0x1e')][_0x2fda('0x97')]=function(_0x5ca7bf){if(_0x5ca7bf['dialLimitQueue']>0x0){var _0x142e52=_0x5ca7bf[_0x2fda('0x212')]-_0x5ca7bf[_0x2fda('0xa0')]-_0x5ca7bf[_0x2fda('0x57')];if(_0x142e52>0x0){this[_0x2fda('0x215')](_0x5ca7bf);}else{loggerPredictiveCalls[_0x2fda('0x83')](_0x2fda('0x216'));}}else{this[_0x2fda('0x215')](_0x5ca7bf);}};Dialer['prototype'][_0x2fda('0x215')]=function(_0x48bda0){var _0x5d516d=this;var _0x24f755=[];_0x48bda0['originated']+=0x1;for(var _0x41da91 in this[_0x2fda('0x26')]){if(typeof this[_0x2fda('0x26')][_0x41da91]!==_0x2fda('0x9f')){if(this[_0x2fda('0x26')][_0x41da91][_0x2fda('0xac')]===_0x2fda('0x217')&&this[_0x2fda('0x26')][_0x41da91][_0x2fda('0xb3')]==='reachable'){_0x24f755['push'](this[_0x2fda('0x26')][_0x41da91]['id']);}}}this[_0x2fda('0xcd')](_0x48bda0['id'],_0x24f755,0x1,_0x48bda0['dialOrderByScheduledAt'],_0x48bda0)[_0x2fda('0xc3')](function(_0x420682){if(!checkContactEmpty(_0x420682)){checkContactLowerLimitOriginate(_0x48bda0,0x1,0x0);_0x5d516d[_0x2fda('0x213')](_0x48bda0)[_0x2fda('0xc3')](sendMessageReschedule(_0x48bda0))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x48bda0[_0x2fda('0x42')]=_0x2fda('0x20d');if(_[_0x2fda('0xb2')](_0x420682[0x0])||_[_0x2fda('0xb2')](_0x420682[0x0][_0x2fda('0x19a')])||_[_0x2fda('0xb2')](_0x420682[0x0]['phone'])){_0x5d516d[_0x2fda('0xd8')](_0x2fda('0x20f'),_0x48bda0,_0x420682[0x0]);}else{_0x5d516d[_0x2fda('0xbe')](_[_0x2fda('0xdb')](_0x420682[0x0],[_0x2fda('0xdd'),_0x2fda('0x180')]))[_0x2fda('0xc3')](_0x5d516d[_0x2fda('0x1fa')](_0x48bda0,_0x420682[0x0]))[_0x2fda('0xb5')](_0x5d516d[_0x2fda('0xd7')](_0x2fda('0x218'),_0x48bda0));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x48bda0,0x1));emitVoiceQueueSummary(_0x48bda0);};Dialer[_0x2fda('0x1e')][_0x2fda('0x219')]=function(_0x22e247,_0x1dfdb1,_0xd7fb05,_0x29441c,_0x4b0e85,_0x5efb26){loggerPredictive['info'](_0x2fda('0x21a'));loggerPredictive[_0x2fda('0x83')](_0x2fda('0x21b'),_0x22e247);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x21c'),_0x1dfdb1);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x21d'),_0xd7fb05);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x21e'),_0x29441c);loggerPredictive[_0x2fda('0x83')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b0e85);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x8a'));return new Promise(function(_0x30a52b,_0x5cf86b){if(_0x22e247<=0x0||isNaN(_0x22e247)){return _0x5cf86b(msgResponse(_0x2fda('0x21f'),'Error',_0x2fda('0x220')+_0x22e247));}if(_0xd7fb05<=0x0||isNaN(_0xd7fb05)){return _0x5cf86b(msgResponse('[abandonmentRate]','Error',_0x2fda('0x221')+_0xd7fb05));}if(_0x29441c<=0x0||isNaN(_0x29441c)){return _0x5cf86b(msgResponse(_0x2fda('0x21f'),_0x2fda('0x4d'),'p\x20=\x20'+_0x29441c));}if(_0x1dfdb1<=0x0||isNaN(_0x1dfdb1)){return _0x5cf86b(msgResponse(_0x2fda('0x21f'),_0x2fda('0x4d'),_0x2fda('0x222')+_0x1dfdb1));}if(_0x4b0e85<=0x0||isNaN(_0x4b0e85)){return _0x5cf86b(msgResponse('[abandonmentRate]',_0x2fda('0x4d'),_0x2fda('0x223')+_0x4b0e85));}_0x5efb26=_0x5efb26||0x0;var _0x537906=0x1/_0xd7fb05;var _0x5a3fce=0x0;var _0x396678=0x0;var _0x1ea89d=0x0;var _0x4821c0=0x0;for(var _0x5da888=0x0;_0x1ea89d<_0x4b0e85;_0x5da888+=0x1){_0x396678=_0x5da888/_0x1dfdb1;_0x5a3fce=(_0x29441c*_0x396678+_0x5efb26)/_0x537906;_0x1ea89d=erlangb(_0x5a3fce,_0x22e247);_0x4821c0=_0x5a3fce/_0x22e247*(0x1-erlangb(_0x5a3fce,_0x22e247));}return _0x30a52b({'erlangCalls':_0x5da888,'erlangCallToSecond':_0x1dfdb1/_0x5da888,'erlangAbandonmentRate':_0x1ea89d,'erlangBusyFactor':_0x4821c0});});};Dialer[_0x2fda('0x1e')][_0x2fda('0x224')]=function(_0x2bf830,_0x1bca4d,_0x5c4176,_0xbdaeb8,_0x328f1b,_0x2f2c5f){loggerPredictive[_0x2fda('0x83')](_0x2fda('0x225'));loggerPredictive[_0x2fda('0x83')](_0x2fda('0x21b'),_0x2bf830);loggerPredictive['info'](_0x2fda('0x21c'),_0x1bca4d);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x21d'),_0x5c4176);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x21e'),_0xbdaeb8);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x226'),_0x328f1b);loggerPredictive[_0x2fda('0x83')](_0x2fda('0x8a'));return new Promise(function(_0x25bbef,_0x7e51c0){if(_0x2bf830<=0x0||isNaN(_0x2bf830)){return _0x7e51c0(msgResponse(_0x2fda('0x227'),'Error',_0x2fda('0x220')+_0x2bf830));}if(_0x5c4176<=0x0||isNaN(_0x5c4176)){return _0x7e51c0(msgResponse(_0x2fda('0x227'),_0x2fda('0x4d'),_0x2fda('0x221')+_0x5c4176));}if(_0xbdaeb8<=0x0||isNaN(_0xbdaeb8)){return _0x7e51c0(msgResponse(_0x2fda('0x227'),_0x2fda('0x4d'),_0x2fda('0x228')+_0xbdaeb8));}if(_0x1bca4d<=0x0||isNaN(_0x1bca4d)){return _0x7e51c0(msgResponse(_0x2fda('0x227'),_0x2fda('0x4d'),_0x2fda('0x222')+_0x1bca4d));}if(_0x328f1b<=0x0||isNaN(_0x328f1b)){return _0x7e51c0(msgResponse(_0x2fda('0x227'),_0x2fda('0x4d'),_0x2fda('0x229')+_0x328f1b));}_0x2f2c5f=_0x2f2c5f||0x0;var _0x404b8=0x1/_0x5c4176;var _0x52da8c=0x0;var _0x505b34=0x0;var _0x47ad34=0x0;var _0x2aedfb=0x0;for(var _0x2747d0=0x0;_0x2aedfb<_0x328f1b;_0x2747d0+=0x1){_0x505b34=_0x2747d0/_0x1bca4d;_0x52da8c=(_0xbdaeb8*_0x505b34+_0x2f2c5f)/_0x404b8;_0x47ad34=erlangb(_0x52da8c,_0x2bf830);_0x2aedfb=_0x52da8c/_0x2bf830*(0x1-erlangb(_0x52da8c,_0x2bf830));}return _0x25bbef({'erlangCalls':_0x2747d0,'erlangCallToSecond':_0x1bca4d/_0x2747d0,'erlangAbandonmentRate':_0x47ad34,'erlangBusyFactor':_0x2aedfb});});};module[_0x2fda('0x22a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index af7c43e..eec7dd9 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c52=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x0c52,0x170));var _0x20c5=function(_0x338abc,_0x3c1121){_0x338abc=_0x338abc-0x0;var _0x99a532=_0x0c52[_0x338abc];return _0x99a532;};'use strict';var util=require(_0x20c5('0x0'));var _=require(_0x20c5('0x1'));var moment=require(_0x20c5('0x2'));function getSeconds(_0x378508,_0xadedae){var _0x1ad44c=moment(_0x378508)[_0x20c5('0x3')](0x0);var _0x31b275=moment(_0xadedae)[_0x20c5('0x3')](0x0);return _0x1ad44c['diff'](_0x31b275,'seconds');}function QueueCallerAbandon(_0x17ed66,_0x1ae57a){this[_0x20c5('0x4')]=_0x17ed66['scheduledat'];this[_0x20c5('0x5')]=_0x17ed66[_0x20c5('0x5')];this[_0x20c5('0x6')]=_0x17ed66[_0x20c5('0x5')]===_0x20c5('0x7')?'queue':_0x17ed66['type'];this[_0x20c5('0x8')]=_0x17ed66['countbusyretry'];this[_0x20c5('0x9')]=_0x17ed66[_0x20c5('0x9')];this[_0x20c5('0xa')]=_0x17ed66[_0x20c5('0xa')];this[_0x20c5('0xb')]=_0x17ed66['countbusyretry']+_0x17ed66['countcongestionretry']+_0x17ed66[_0x20c5('0xa')]+_0x17ed66[_0x20c5('0xc')]+_0x17ed66[_0x20c5('0xd')]+_0x17ed66['countabandonedretry']+_0x17ed66[_0x20c5('0xe')]+_0x17ed66[_0x20c5('0xf')];this[_0x20c5('0xc')]=_0x17ed66[_0x20c5('0xc')];this[_0x20c5('0xd')]=_0x17ed66[_0x20c5('0xd')];this[_0x20c5('0x10')]=_0x17ed66[_0x20c5('0x10')];this[_0x20c5('0xe')]=_0x17ed66[_0x20c5('0xe')];this['countagentrejectretry']=_0x17ed66[_0x20c5('0xf')];this[_0x20c5('0x11')]=_0x1ae57a[_0x20c5('0x11')];this[_0x20c5('0x12')]=_0x17ed66[_0x20c5('0x13')];this[_0x20c5('0x14')]=_0x17ed66[_0x20c5('0x15')];this['starttime']=_0x17ed66[_0x20c5('0x16')];this[_0x20c5('0x17')]=_0x17ed66[_0x20c5('0x17')];this['droptime']=_0x17ed66[_0x20c5('0x18')];this[_0x20c5('0x19')]=this[_0x20c5('0x18')];this[_0x20c5('0x1a')]=getSeconds(_0x17ed66[_0x20c5('0x17')],_0x17ed66[_0x20c5('0x16')]);this['holdtime']=getSeconds(this[_0x20c5('0x18')],_0x17ed66['responsetime']);this[_0x20c5('0x1b')]=0x0;this[_0x20c5('0x1c')]=_0x1ae57a[_0x20c5('0x1c')];this[_0x20c5('0x1d')]=_0x1ae57a[_0x20c5('0x1e')];this[_0x20c5('0x1f')]=_0x1ae57a['reason'];this[_0x20c5('0x20')]=_0x17ed66[_0x20c5('0x20')];this['callbackuniqueid']=_0x17ed66['callbackuniqueid'];this[_0x20c5('0x21')]=_0x17ed66[_0x20c5('0x21')];this[_0x20c5('0x22')]=_0x17ed66[_0x20c5('0x22')];this['ContactId']=_0x17ed66[_0x20c5('0x23')];this[_0x20c5('0x24')]=_0x17ed66[_0x20c5('0x24')];this[_0x20c5('0x25')]=_0x17ed66['UserId'];this['VoiceQueueId']=_0x17ed66['VoiceQueueId'];this[_0x20c5('0x26')]=_0x17ed66[_0x20c5('0x26')];this[_0x20c5('0x27')]=_0x17ed66[_0x20c5('0x27')]||'';this['originatecalleridname']=_0x17ed66[_0x20c5('0x28')]||'';}module[_0x20c5('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xc0aa=['starttime','responsetime','droptime','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xc0aa,0x1f3));var _0xac0a=function(_0x38af68,_0xb895e5){_0x38af68=_0x38af68-0x0;var _0x2cbc33=_0xc0aa[_0x38af68];return _0x2cbc33;};'use strict';var util=require(_0xac0a('0x0'));var _=require('lodash');var moment=require(_0xac0a('0x1'));function getSeconds(_0x37fa79,_0x4cd23f){var _0x58fd74=moment(_0x37fa79)[_0xac0a('0x2')](0x0);var _0x386cf4=moment(_0x4cd23f)['milliseconds'](0x0);return _0x58fd74[_0xac0a('0x3')](_0x386cf4,_0xac0a('0x4'));}function QueueCallerAbandon(_0x437176,_0x40e146){this[_0xac0a('0x5')]=_0x437176[_0xac0a('0x5')];this[_0xac0a('0x6')]=_0x437176[_0xac0a('0x6')];this['campaigntype']=_0x437176[_0xac0a('0x6')]===_0xac0a('0x7')?_0xac0a('0x8'):_0x437176[_0xac0a('0x6')];this[_0xac0a('0x9')]=_0x437176[_0xac0a('0x9')];this[_0xac0a('0xa')]=_0x437176[_0xac0a('0xa')];this[_0xac0a('0xb')]=_0x437176[_0xac0a('0xb')];this[_0xac0a('0xc')]=_0x437176['countbusyretry']+_0x437176[_0xac0a('0xa')]+_0x437176[_0xac0a('0xb')]+_0x437176[_0xac0a('0xd')]+_0x437176[_0xac0a('0xe')]+_0x437176[_0xac0a('0xf')]+_0x437176[_0xac0a('0x10')]+_0x437176[_0xac0a('0x11')];this[_0xac0a('0xd')]=_0x437176[_0xac0a('0xd')];this['countdropretry']=_0x437176[_0xac0a('0xe')];this[_0xac0a('0xf')]=_0x437176[_0xac0a('0xf')];this[_0xac0a('0x10')]=_0x437176[_0xac0a('0x10')];this[_0xac0a('0x11')]=_0x437176[_0xac0a('0x11')];this[_0xac0a('0x12')]=_0x40e146[_0xac0a('0x12')];this['calleridname']=_0x437176['name'];this[_0xac0a('0x13')]=_0x437176[_0xac0a('0x14')];this['starttime']=_0x437176[_0xac0a('0x15')];this[_0xac0a('0x16')]=_0x437176[_0xac0a('0x16')];this['droptime']=_0x437176[_0xac0a('0x17')];this['endtime']=this[_0xac0a('0x17')];this[_0xac0a('0x18')]=getSeconds(_0x437176[_0xac0a('0x16')],_0x437176['starttime']);this[_0xac0a('0x19')]=getSeconds(this[_0xac0a('0x17')],_0x437176[_0xac0a('0x16')]);this['talktime']=0x0;this[_0xac0a('0x8')]=_0x40e146['queue'];this[_0xac0a('0x1a')]=_0x40e146['connectedlinename'];this['reason']=_0x40e146[_0xac0a('0x1b')];this[_0xac0a('0x1c')]=_0x437176[_0xac0a('0x1c')];this[_0xac0a('0x1d')]=_0x437176[_0xac0a('0x1d')];this[_0xac0a('0x1e')]=_0x437176[_0xac0a('0x1e')];this[_0xac0a('0x1f')]=_0x437176[_0xac0a('0x1f')];this[_0xac0a('0x20')]=_0x437176[_0xac0a('0x20')];this[_0xac0a('0x21')]=_0x437176[_0xac0a('0x21')];this[_0xac0a('0x22')]=_0x437176[_0xac0a('0x22')];this[_0xac0a('0x23')]=_0x437176[_0xac0a('0x23')];this[_0xac0a('0x24')]=_0x437176['CampaignId'];this[_0xac0a('0x25')]=_0x437176[_0xac0a('0x25')]||'';this['originatecalleridname']=_0x437176[_0xac0a('0x26')]||'';}module[_0xac0a('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ad4164a..3c9b497 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(_0x1f78e7,_0x3f82a2){var _0x23eefa=function(_0x2ad27c){while(--_0x2ad27c){_0x1f78e7['push'](_0x1f78e7['shift']());}};_0x23eefa(++_0x3f82a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x10fdd3,_0xc67c07){var _0x398d7b=function(_0x82cfe1){while(--_0x82cfe1){_0x10fdd3['push'](_0x10fdd3['shift']());}};_0x398d7b(++_0xc67c07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 6ae9370..f6fe09a 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 _0xb59f=['\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/attachment','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xb59f,0xa2));var _0xfb59=function(_0x28d56f,_0x111806){_0x28d56f=_0x28d56f-0x0;var _0x269a53=_0xb59f[_0x28d56f];return _0x269a53;};'use strict';var util=require(_0xfb59('0x0'));var _=require(_0xfb59('0x1'));var BPromise=require(_0xfb59('0x2'));var uuid=require(_0xfb59('0x3'));var moment=require(_0xfb59('0x4'));var path=require('path');var tiff2pdf=require(_0xfb59('0x5'));var gs=require(_0xfb59('0x6'));var logger=require(_0xfb59('0x7'))(_0xfb59('0x8'));var ami=require(_0xfb59('0x9'));var rpcDb=require(_0xfb59('0xa'));var Channel=require(_0xfb59('0xb'));var ut=require('./util/util');var Action=require(_0xfb59('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xfb59('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x480c54){this['channels']={};this[_0xfb59('0xe')]=_0x480c54[_0xfb59('0xe')];this['trunks']=_0x480c54[_0xfb59('0xf')];this[_0xfb59('0x10')]={};ami['on'](_0xfb59('0x11'),this[_0xfb59('0x12')][_0xfb59('0x13')](this));ami['on'](_0xfb59('0x14'),this[_0xfb59('0x15')][_0xfb59('0x13')](this));ami['on'](_0xfb59('0x16'),this[_0xfb59('0x17')][_0xfb59('0x13')](this));ami['on'](_0xfb59('0x18'),this[_0xfb59('0x19')]['bind'](this));ami['on'](_0xfb59('0x1a'),this[_0xfb59('0x1b')][_0xfb59('0x13')](this));ami['on'](_0xfb59('0x1c'),this[_0xfb59('0x1d')][_0xfb59('0x13')](this));ami['on'](_0xfb59('0x1e'),this[_0xfb59('0x1f')][_0xfb59('0x13')](this));ami['on'](_0xfb59('0x20'),this[_0xfb59('0x21')][_0xfb59('0x13')](this));}Fax[_0xfb59('0x22')]['syncNewchannel']=function(_0x58b72b){if(_0x58b72b[_0xfb59('0x23')]===_0xfb59('0x24')){for(var _0x246941 in this[_0xfb59('0xe')]){if(this[_0xfb59('0xe')][_0xfb59('0x25')](_0x246941)){if(_0x58b72b[_0xfb59('0x26')]===this[_0xfb59('0xe')][_0x246941]['localstationid']){this[_0xfb59('0x27')][_0x58b72b[_0xfb59('0x28')]]={};this[_0xfb59('0x27')][_0x58b72b[_0xfb59('0x28')]][_0xfb59('0x29')]=_0x58b72b[_0xfb59('0x29')];this[_0xfb59('0x27')][_0x58b72b[_0xfb59('0x28')]]['id']=this[_0xfb59('0xe')][_0x246941]['id'];this[_0xfb59('0x27')][_0x58b72b[_0xfb59('0x28')]]['name']=this[_0xfb59('0xe')][_0x246941][_0xfb59('0x2a')];logger[_0xfb59('0x2b')](_0x58b72b['uniqueid'],_0xfb59('0x2c'));}}}}if(this[_0xfb59('0x10')][_0x58b72b[_0xfb59('0x28')]]){this[_0xfb59('0x27')][_0x58b72b[_0xfb59('0x28')]]={};this['channels'][_0x58b72b[_0xfb59('0x28')]]['channel']=_0x58b72b[_0xfb59('0x29')];logger[_0xfb59('0x2b')](_0x58b72b[_0xfb59('0x28')],_0xfb59('0x2c'));}};Fax[_0xfb59('0x22')]['syncVarSet']=function(_0x3c2dd5){if(this[_0xfb59('0x27')][_0x3c2dd5['uniqueid']]){for(var _0x58d386 in _0x3c2dd5[_0xfb59('0x2d')]){if(_0x3c2dd5['variable'][_0xfb59('0x25')](_0x58d386)){this[_0xfb59('0x27')][_0x3c2dd5[_0xfb59('0x28')]][_0x58d386]=_0x3c2dd5[_0xfb59('0x2e')];}}}};Fax[_0xfb59('0x22')][_0xfb59('0x17')]=function(_0x80c582){if(this[_0xfb59('0x27')][_0x80c582[_0xfb59('0x28')]]){this[_0xfb59('0x27')][_0x80c582[_0xfb59('0x28')]]['channelstate']=_0x80c582['channelstate'];this['channels'][_0x80c582['uniqueid']][_0xfb59('0x2f')]=_0x80c582['channelstatedesc'];}};Fax[_0xfb59('0x22')][_0xfb59('0x19')]=function(_0x411da5){if(this[_0xfb59('0x27')][_0x411da5['uniqueid']]){for(var _0x4c8d75 in _0x411da5[_0xfb59('0x2d')]){if(_0x411da5[_0xfb59('0x2d')][_0xfb59('0x25')](_0x4c8d75)){this[_0xfb59('0x27')][_0x411da5[_0xfb59('0x28')]][_0x4c8d75]=_0x411da5[_0xfb59('0x2e')];}}}};Fax['prototype'][_0xfb59('0x1b')]=function(_0x2ad9bc){if(this['channels'][_0x2ad9bc[_0xfb59('0x28')]]){this['channels'][_0x2ad9bc[_0xfb59('0x28')]][_0xfb59('0x30')]=_0x2ad9bc['operation'];this[_0xfb59('0x27')][_0x2ad9bc[_0xfb59('0x28')]][_0xfb59('0x31')]=_0x2ad9bc[_0xfb59('0x31')];this['channels'][_0x2ad9bc[_0xfb59('0x28')]][_0xfb59('0x32')]=_0x2ad9bc[_0xfb59('0x32')];this[_0xfb59('0x27')][_0x2ad9bc['uniqueid']]['filename']=_0x2ad9bc[_0xfb59('0x33')];logger[_0xfb59('0x2b')](_0x2ad9bc[_0xfb59('0x28')],_0xfb59('0x34'));}};Fax[_0xfb59('0x22')][_0xfb59('0x1d')]=function(_0x426e61){var _0x13e5ec=this;if(this[_0xfb59('0x27')][_0x426e61[_0xfb59('0x28')]]){var _0x5c97ea=this[_0xfb59('0x27')][_0x426e61[_0xfb59('0x28')]]['id'];this['channels'][_0x426e61['uniqueid']][_0xfb59('0x35')]=_0x426e61['remotestationid'];this[_0xfb59('0x27')][_0x426e61[_0xfb59('0x28')]][_0xfb59('0x36')]=_0x426e61[_0xfb59('0x36')];this['channels'][_0x426e61['uniqueid']][_0xfb59('0x32')]=_0x426e61['localstationid'];this[_0xfb59('0x27')][_0x426e61[_0xfb59('0x28')]][_0xfb59('0x37')]=_0x426e61[_0xfb59('0x37')];this['channels'][_0x426e61['uniqueid']][_0xfb59('0x38')]=_0x426e61[_0xfb59('0x38')];this[_0xfb59('0x27')][_0x426e61[_0xfb59('0x28')]][_0xfb59('0x33')]=_0x426e61[_0xfb59('0x33')];this[_0xfb59('0x27')][_0x426e61[_0xfb59('0x28')]][_0xfb59('0x39')]=_0x426e61[_0xfb59('0x39')];if(this[_0xfb59('0x27')][_0x426e61[_0xfb59('0x28')]][_0xfb59('0x36')]>0x0){tiff2pdf(_0x426e61[_0xfb59('0x33')],_0xfb59('0x3a'),function(_0x333f5e){logger[_0xfb59('0x2b')](_0x426e61[_0xfb59('0x28')],_0xfb59('0x3b'),_0x333f5e[_0xfb59('0x3c')]);attachment[_0xfb59('0x3d')]({'name':path['parse'](_0x426e61['filename'])['name'],'basename':path[_0xfb59('0x3e')](_0x426e61[_0xfb59('0x33')])['name']+_0xfb59('0x3f'),'type':_0xfb59('0x40')})[_0xfb59('0x41')](function(_0xf2eb23){faxAccount[_0xfb59('0x42')](_0x5c97ea,{'from':_0x426e61[_0xfb59('0x39')],'mapKey':_0xfb59('0x8'),'body':path[_0xfb59('0x3e')](_0x426e61[_0xfb59('0x33')])[_0xfb59('0x2a')]+_0xfb59('0x3f'),'AttachmentId':_0xf2eb23['id']})[_0xfb59('0x43')](function(_0x4a8e42){logger[_0xfb59('0x44')](_0x426e61[_0xfb59('0x28')],_0xfb59('0x45'),JSON[_0xfb59('0x46')](_0x4a8e42));});})[_0xfb59('0x43')](function(_0x32db09){logger[_0xfb59('0x44')](_0x426e61[_0xfb59('0x28')],'\x20receiveFax\x20',JSON[_0xfb59('0x46')](_0x32db09));});});}logger[_0xfb59('0x2b')](_0x426e61[_0xfb59('0x28')],_0xfb59('0x47'));}};Fax[_0xfb59('0x22')][_0xfb59('0x21')]=function(_0x30d01b){if(this[_0xfb59('0x10')][_0x30d01b[_0xfb59('0x28')]]){_['merge'](this[_0xfb59('0x27')][_0x30d01b[_0xfb59('0x28')]],_['pick'](_0x30d01b,[_0xfb59('0x48'),'reason']));}};function updateStatus(_0xd66d2c){if(_0xd66d2c[_0xfb59('0x49')]){faxMessage[_0xfb59('0x4a')](_0xd66d2c['AttachmentId'],{'failMessage':_0xfb59('0x4b')})[_0xfb59('0x41')](function(_0x41b0cd){ut[_0xfb59('0x4c')](_0xfb59('0x4d'),_0x41b0cd);})['catch'](function(_0x18b916){ut[_0xfb59('0x4c')](_0xfb59('0x4e'),_0x18b916);});}else{ut[_0xfb59('0x4c')](_0xfb59('0x4f'));}}Fax['prototype'][_0xfb59('0x50')]=function(_0x466aab,_0x2dfd97,_0x55ead8){var _0x15b1ca=this;var _0xb1c607={};if(_0x2dfd97){_0xb1c607={'read':_0x2dfd97};}else{_0xb1c607={'failMessage':_0x55ead8};}if(this[_0xfb59('0x10')][_0x466aab][_0xfb59('0x49')]){faxMessage[_0xfb59('0x4a')](this['actions'][_0x466aab]['AttachmentId'],_0xb1c607)['then'](function(_0x515107){ut[_0xfb59('0x4c')](_0xfb59('0x51'),_0x515107);})[_0xfb59('0x43')](function(_0x457281){ut[_0xfb59('0x4c')](_0xfb59('0x52'),_0x457281);})[_0xfb59('0x53')](function(){delete _0x15b1ca[_0xfb59('0x27')][_0x466aab];delete _0x15b1ca[_0xfb59('0x10')][_0x466aab];});}else{ut[_0xfb59('0x4c')](_0xfb59('0x54'));delete this[_0xfb59('0x27')][_0x466aab];delete this[_0xfb59('0x10')][_0x466aab];}};Fax[_0xfb59('0x22')]['syncHangup']=function(_0x2449dd){var _0x1aa791=this;if(this[_0xfb59('0x27')][_0x2449dd['uniqueid']]){if(this[_0xfb59('0x10')][_0x2449dd[_0xfb59('0x28')]]){this['channels'][_0x2449dd['uniqueid']]['id']=this[_0xfb59('0x10')][_0x2449dd[_0xfb59('0x28')]]['id'];this['channels'][_0x2449dd[_0xfb59('0x28')]]['name']=this[_0xfb59('0x10')][_0x2449dd[_0xfb59('0x28')]][_0xfb59('0x2a')];}logger['info'](_0x2449dd[_0xfb59('0x28')],this[_0xfb59('0x10')][_0x2449dd[_0xfb59('0x28')]]?_0xfb59('0x55'):_0xfb59('0x56'),JSON['stringify'](this[_0xfb59('0x27')][_0x2449dd[_0xfb59('0x28')]]));if(this[_0xfb59('0x10')][_0x2449dd[_0xfb59('0x28')]]){if(this[_0xfb59('0x27')][_0x2449dd[_0xfb59('0x28')]][_0xfb59('0x57')]>0x0&&this[_0xfb59('0x27')][_0x2449dd['uniqueid']]['faxstatus']===_0xfb59('0x58')){this[_0xfb59('0x50')](_0x2449dd['uniqueid'],!![]);}else{this['updateStatus'](_0x2449dd[_0xfb59('0x28')],![],this[_0xfb59('0x27')][_0x2449dd[_0xfb59('0x28')]][_0xfb59('0x59')]?_0xfb59('0x5a')+this['channels'][_0x2449dd[_0xfb59('0x28')]][_0xfb59('0x59')]:_0xfb59('0x5b'));}}}};Fax['prototype'][_0xfb59('0x5c')]=function(_0x5cfb92){var _0x149332=this;return new BPromise(function(_0x5dbae7,_0x11733c){_0x149332['execOriginate'](_0x5cfb92,_0x149332[_0xfb59('0xe')][_0x5cfb92[_0xfb59('0x5d')]])[_0xfb59('0x41')](function(_0x3d5a6d){ut[_0xfb59('0x4c')]('[Fax][execOriginate][success]',_0x3d5a6d);_0x5dbae7(ut['message'](_0xfb59('0x5e')));})[_0xfb59('0x43')](function(_0x126604){ut[_0xfb59('0x4c')]('[Fax][execOriginate][failure]',_0x126604);updateStatus(_0x5cfb92);_0x11733c(ut[_0xfb59('0x3c')](_0xfb59('0x5f')));});});};Fax['prototype'][_0xfb59('0x60')]=function(_0x1eeb15){var _0x595c3f=this;return new BPromise(function(_0x2f17a1,_0x784361){var _0x23123a=_0x595c3f['checkTrunk'](_0x595c3f[_0xfb59('0xe')][_0x1eeb15[_0xfb59('0x5d')]][_0xfb59('0x61')],_0x1eeb15);if(_0x23123a[_0xfb59('0x62')]){_0x2f17a1(ut['message'](_0xfb59('0x63')));}else{_0x784361(ut[_0xfb59('0x3c')](_0x23123a['message']));}});};function originate(_0x4d44fa,_0x4bbae5,_0x4c46c3){return new BPromise(function(_0xe0778c,_0x5a44c8){if(_0x4c46c3){var _0x246530=util['format'](_0xfb59('0x64'),path[_0xfb59('0x3e')](_0x4d44fa[_0xfb59('0x65')])[_0xfb59('0x2a')],_0x4d44fa[_0xfb59('0x65')]);gs['execute'](_0x246530)['then'](function(){_0x4d44fa['path']=util[_0xfb59('0x66')](_0xfb59('0x67'),path['parse'](_0x4d44fa[_0xfb59('0x65')])[_0xfb59('0x68')],path['parse'](_0x4d44fa['path'])[_0xfb59('0x2a')]);_0x4bbae5[_0xfb59('0x69')]=_0x4d44fa['path'];ut['logger'](_0xfb59('0x6a'),'');ami[_0xfb59('0x6b')](ut[_0xfb59('0x6c')](_0x4d44fa,_0x4bbae5))[_0xfb59('0x41')](function(_0x1afb43){_0xe0778c(_0x1afb43);})[_0xfb59('0x43')](function(_0x287c4e){_0x5a44c8(_0x287c4e);});})['catch'](function(_0x144a69){_0x5a44c8(_0x144a69);});}else{ami[_0xfb59('0x6b')](ut[_0xfb59('0x6c')](_0x4d44fa,_0x4bbae5))[_0xfb59('0x41')](function(_0x3f9adc){_0xe0778c(_0x3f9adc);})[_0xfb59('0x43')](function(_0x32dc0f){_0x5a44c8(_0x32dc0f);});}});}Fax['prototype'][_0xfb59('0x6d')]=function(_0xb16979,_0xa5c77d){var _0x4a53b4=this;return new BPromise(function(_0x1949f3,_0x55dcb7){var _0x6b23c7=uuid['v4']();var _0x3ba2b9=ut[_0xfb59('0x6e')](_0xb16979,_0xa5c77d);_0x4a53b4['actions'][_0x6b23c7]=new Action(_0x6b23c7,_0xa5c77d,_0xb16979);var _0x231427=_0x4a53b4[_0xfb59('0x10')][_0x6b23c7];if(path[_0xfb59('0x3e')](_0xb16979[_0xfb59('0x65')])[_0xfb59('0x6f')]===_0xfb59('0x3f')){originate(_0x231427,_0x3ba2b9,!![])[_0xfb59('0x41')](function(_0x3958d7){_0x1949f3(_0x3958d7);})['catch'](function(_0x2a99fd){_0x55dcb7(_0x2a99fd);});}else{originate(_0x231427,_0x3ba2b9,![])[_0xfb59('0x41')](function(_0x344fdd){_0x1949f3(_0x344fdd);})[_0xfb59('0x43')](function(_0x2bf65b){_0x55dcb7(_0x2bf65b);});}});};Fax[_0xfb59('0x22')][_0xfb59('0x70')]=function(_0x4767a4){return!_['isNil'](_0x4767a4)&&!_[_0xfb59('0x71')](_0x4767a4[_0xfb59('0x2a')])&&!_[_0xfb59('0x71')](_0x4767a4[_0xfb59('0x72')])&&_0x4767a4[_0xfb59('0x72')]&&!_[_0xfb59('0x71')](this[_0xfb59('0xf')][util[_0xfb59('0x66')](_0xfb59('0x73'),_0x4767a4[_0xfb59('0x2a')])])&&!_[_0xfb59('0x71')](this[_0xfb59('0xf')][util[_0xfb59('0x66')]('SIP/%s',_0x4767a4[_0xfb59('0x2a')])][_0xfb59('0x31')])&&(this[_0xfb59('0xf')][util[_0xfb59('0x66')](_0xfb59('0x73'),_0x4767a4['name'])][_0xfb59('0x31')]==='reachable'||this[_0xfb59('0xf')][util['format'](_0xfb59('0x73'),_0x4767a4[_0xfb59('0x2a')])][_0xfb59('0x31')]===_0xfb59('0x74'));};Fax['prototype'][_0xfb59('0x75')]=function(_0x3e332c,_0x138483){if(!this[_0xfb59('0x70')](_0x3e332c)){ut[_0xfb59('0x4c')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xfb59('0x71')](_0x3e332c)?'':_0x3e332c[_0xfb59('0x2a')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xfb59('0x76')};}if(_[_0xfb59('0x71')](_0x138483[_0xfb59('0x8')])){ut[_0xfb59('0x4c')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xfb59('0x46')](_0x138483));return{'isValid':![],'message':_0xfb59('0x77')};}if(_['isNil'](_0x138483[_0xfb59('0x65')])){ut['logger'](_0xfb59('0x78'),JSON[_0xfb59('0x46')](_0x138483));return{'isValid':![],'message':_0xfb59('0x79')};}return{'isValid':!![],'message':_0xfb59('0x7a')};};module[_0xfb59('0x7b')]=Fax; \ No newline at end of file +var _0x9ae6=['then','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','moment','path','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','bind','syncNewState','newexten','syncFaxStatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','channel','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','.pdf','application/pdf','parse','\x20notify\x20','stringify','error','\x20receiveFax\x20','pick','response','AttachmentId','update','SENDING\x20FAILED\x20'];(function(_0x37ccf1,_0xfa5e43){var _0x588896=function(_0x1be103){while(--_0x1be103){_0x37ccf1['push'](_0x37ccf1['shift']());}};_0x588896(++_0xfa5e43);}(_0x9ae6,0x177));var _0x69ae=function(_0x1aefea,_0x39e5fa){_0x1aefea=_0x1aefea-0x0;var _0x33a7a1=_0x9ae6[_0x1aefea];return _0x33a7a1;};'use strict';var util=require(_0x69ae('0x0'));var _=require(_0x69ae('0x1'));var BPromise=require(_0x69ae('0x2'));var uuid=require('uuid');var moment=require(_0x69ae('0x3'));var path=require(_0x69ae('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x69ae('0x5'))(_0x69ae('0x6'));var ami=require(_0x69ae('0x7'));var rpcDb=require(_0x69ae('0x8'));var Channel=require('./channel');var ut=require(_0x69ae('0x9'));var Action=require(_0x69ae('0xa'));var faxAccount=require(_0x69ae('0xb'));var attachment=require(_0x69ae('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2e3497){this[_0x69ae('0xd')]={};this[_0x69ae('0xe')]=_0x2e3497[_0x69ae('0xe')];this['trunks']=_0x2e3497[_0x69ae('0xf')];this[_0x69ae('0x10')]={};ami['on'](_0x69ae('0x11'),this['syncNewchannel'][_0x69ae('0x12')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on']('newstate',this[_0x69ae('0x13')]['bind'](this));ami['on'](_0x69ae('0x14'),this['syncNewExten'][_0x69ae('0x12')](this));ami['on']('faxstatus',this[_0x69ae('0x15')][_0x69ae('0x12')](this));ami['on'](_0x69ae('0x16'),this['syncReceiveFax'][_0x69ae('0x12')](this));ami['on']('hangup',this[_0x69ae('0x17')][_0x69ae('0x12')](this));ami['on'](_0x69ae('0x18'),this[_0x69ae('0x19')][_0x69ae('0x12')](this));}Fax[_0x69ae('0x1a')]['syncNewchannel']=function(_0x47f0f1){if(_0x47f0f1['context']==='from-voip-provider'){for(var _0x468a5e in this['faxAccounts']){if(this['faxAccounts']['hasOwnProperty'](_0x468a5e)){if(_0x47f0f1['exten']===this[_0x69ae('0xe')][_0x468a5e][_0x69ae('0x1b')]){this[_0x69ae('0xd')][_0x47f0f1['uniqueid']]={};this[_0x69ae('0xd')][_0x47f0f1[_0x69ae('0x1c')]]['channel']=_0x47f0f1['channel'];this[_0x69ae('0xd')][_0x47f0f1[_0x69ae('0x1c')]]['id']=this[_0x69ae('0xe')][_0x468a5e]['id'];this[_0x69ae('0xd')][_0x47f0f1[_0x69ae('0x1c')]][_0x69ae('0x1d')]=this[_0x69ae('0xe')][_0x468a5e][_0x69ae('0x1d')];logger[_0x69ae('0x1e')](_0x47f0f1[_0x69ae('0x1c')],_0x69ae('0x1f'));}}}}if(this['actions'][_0x47f0f1['uniqueid']]){this[_0x69ae('0xd')][_0x47f0f1[_0x69ae('0x1c')]]={};this[_0x69ae('0xd')][_0x47f0f1[_0x69ae('0x1c')]][_0x69ae('0x20')]=_0x47f0f1[_0x69ae('0x20')];logger[_0x69ae('0x1e')](_0x47f0f1[_0x69ae('0x1c')],_0x69ae('0x1f'));}};Fax['prototype'][_0x69ae('0x21')]=function(_0x89b0a){if(this[_0x69ae('0xd')][_0x89b0a['uniqueid']]){for(var _0xa4eebd in _0x89b0a[_0x69ae('0x22')]){if(_0x89b0a[_0x69ae('0x22')][_0x69ae('0x23')](_0xa4eebd)){this[_0x69ae('0xd')][_0x89b0a[_0x69ae('0x1c')]][_0xa4eebd]=_0x89b0a[_0x69ae('0x24')];}}}};Fax[_0x69ae('0x1a')][_0x69ae('0x13')]=function(_0x2f398a){if(this[_0x69ae('0xd')][_0x2f398a[_0x69ae('0x1c')]]){this[_0x69ae('0xd')][_0x2f398a['uniqueid']][_0x69ae('0x25')]=_0x2f398a[_0x69ae('0x25')];this[_0x69ae('0xd')][_0x2f398a['uniqueid']][_0x69ae('0x26')]=_0x2f398a[_0x69ae('0x26')];}};Fax[_0x69ae('0x1a')][_0x69ae('0x27')]=function(_0x566e5a){if(this[_0x69ae('0xd')][_0x566e5a['uniqueid']]){for(var _0x336228 in _0x566e5a['variable']){if(_0x566e5a[_0x69ae('0x22')][_0x69ae('0x23')](_0x336228)){this[_0x69ae('0xd')][_0x566e5a[_0x69ae('0x1c')]][_0x336228]=_0x566e5a[_0x69ae('0x24')];}}}};Fax[_0x69ae('0x1a')][_0x69ae('0x15')]=function(_0x5df522){if(this['channels'][_0x5df522[_0x69ae('0x1c')]]){this[_0x69ae('0xd')][_0x5df522['uniqueid']][_0x69ae('0x28')]=_0x5df522['operation'];this[_0x69ae('0xd')][_0x5df522['uniqueid']][_0x69ae('0x29')]=_0x5df522['status'];this[_0x69ae('0xd')][_0x5df522[_0x69ae('0x1c')]][_0x69ae('0x1b')]=_0x5df522[_0x69ae('0x1b')];this[_0x69ae('0xd')][_0x5df522[_0x69ae('0x1c')]]['filename']=_0x5df522[_0x69ae('0x2a')];logger[_0x69ae('0x1e')](_0x5df522[_0x69ae('0x1c')],_0x69ae('0x2b'));}};Fax['prototype'][_0x69ae('0x2c')]=function(_0x5c33e5){var _0x5b4138=this;if(this['channels'][_0x5c33e5[_0x69ae('0x1c')]]){var _0x5a0e7c=this[_0x69ae('0xd')][_0x5c33e5['uniqueid']]['id'];this[_0x69ae('0xd')][_0x5c33e5[_0x69ae('0x1c')]]['remotestationid']=_0x5c33e5[_0x69ae('0x2d')];this[_0x69ae('0xd')][_0x5c33e5[_0x69ae('0x1c')]][_0x69ae('0x2e')]=_0x5c33e5[_0x69ae('0x2e')];this[_0x69ae('0xd')][_0x5c33e5[_0x69ae('0x1c')]][_0x69ae('0x1b')]=_0x5c33e5[_0x69ae('0x1b')];this[_0x69ae('0xd')][_0x5c33e5['uniqueid']][_0x69ae('0x2f')]=_0x5c33e5[_0x69ae('0x2f')];this[_0x69ae('0xd')][_0x5c33e5[_0x69ae('0x1c')]][_0x69ae('0x30')]=_0x5c33e5['transferrate'];this[_0x69ae('0xd')][_0x5c33e5[_0x69ae('0x1c')]][_0x69ae('0x2a')]=_0x5c33e5['filename'];this[_0x69ae('0xd')][_0x5c33e5[_0x69ae('0x1c')]][_0x69ae('0x31')]=_0x5c33e5[_0x69ae('0x31')];if(this['channels'][_0x5c33e5[_0x69ae('0x1c')]][_0x69ae('0x2e')]>0x0){tiff2pdf(_0x5c33e5[_0x69ae('0x2a')],_0x69ae('0x32'),function(_0x2f5db6){logger[_0x69ae('0x1e')](_0x5c33e5[_0x69ae('0x1c')],'\x20result\x20conversion\x20file\x20',_0x2f5db6[_0x69ae('0x33')]);attachment[_0x69ae('0x34')]({'name':path['parse'](_0x5c33e5[_0x69ae('0x2a')])['name'],'basename':path['parse'](_0x5c33e5[_0x69ae('0x2a')])[_0x69ae('0x1d')]+_0x69ae('0x35'),'type':_0x69ae('0x36')})['then'](function(_0x28d7a4){faxAccount['notify'](_0x5a0e7c,{'from':_0x5c33e5['calleridnum'],'mapKey':_0x69ae('0x6'),'body':path[_0x69ae('0x37')](_0x5c33e5[_0x69ae('0x2a')])[_0x69ae('0x1d')]+'.pdf','AttachmentId':_0x28d7a4['id']})['catch'](function(_0x4df46d){logger['error'](_0x5c33e5[_0x69ae('0x1c')],_0x69ae('0x38'),JSON[_0x69ae('0x39')](_0x4df46d));});})['catch'](function(_0x19d0ba){logger[_0x69ae('0x3a')](_0x5c33e5[_0x69ae('0x1c')],_0x69ae('0x3b'),JSON['stringify'](_0x19d0ba));});});}logger['info'](_0x5c33e5[_0x69ae('0x1c')],'\x20receiveFax\x20');}};Fax['prototype'][_0x69ae('0x19')]=function(_0x5a229e){if(this[_0x69ae('0x10')][_0x5a229e['uniqueid']]){_['merge'](this[_0x69ae('0xd')][_0x5a229e[_0x69ae('0x1c')]],_[_0x69ae('0x3c')](_0x5a229e,[_0x69ae('0x3d'),'reason']));}};function updateStatus(_0x203bc4){if(_0x203bc4[_0x69ae('0x3e')]){faxMessage[_0x69ae('0x3f')](_0x203bc4[_0x69ae('0x3e')],{'failMessage':_0x69ae('0x40')})[_0x69ae('0x41')](function(_0x2bf38d){ut[_0x69ae('0x42')](_0x69ae('0x43'),_0x2bf38d);})[_0x69ae('0x44')](function(_0x46ce29){ut[_0x69ae('0x42')]('[Fax][Message][Error][NoUpdate1]',_0x46ce29);});}else{ut[_0x69ae('0x42')](_0x69ae('0x45'));}}Fax['prototype'][_0x69ae('0x46')]=function(_0xe0eee2,_0x313c67,_0xd61db){var _0x431d4f=this;var _0x2aa006={};if(_0x313c67){_0x2aa006={'read':_0x313c67};}else{_0x2aa006={'failMessage':_0xd61db};}if(this['actions'][_0xe0eee2][_0x69ae('0x3e')]){faxMessage[_0x69ae('0x3f')](this[_0x69ae('0x10')][_0xe0eee2][_0x69ae('0x3e')],_0x2aa006)[_0x69ae('0x41')](function(_0x10fe5b){ut[_0x69ae('0x42')](_0x69ae('0x47'),_0x10fe5b);})['catch'](function(_0x201dd4){ut[_0x69ae('0x42')]('[Fax][Message][NoUpdate1]',_0x201dd4);})[_0x69ae('0x48')](function(){delete _0x431d4f[_0x69ae('0xd')][_0xe0eee2];delete _0x431d4f[_0x69ae('0x10')][_0xe0eee2];});}else{ut[_0x69ae('0x42')](_0x69ae('0x49'));delete this[_0x69ae('0xd')][_0xe0eee2];delete this[_0x69ae('0x10')][_0xe0eee2];}};Fax[_0x69ae('0x1a')]['syncHangup']=function(_0x58db72){var _0xfd8a37=this;if(this[_0x69ae('0xd')][_0x58db72[_0x69ae('0x1c')]]){if(this['actions'][_0x58db72[_0x69ae('0x1c')]]){this[_0x69ae('0xd')][_0x58db72[_0x69ae('0x1c')]]['id']=this[_0x69ae('0x10')][_0x58db72['uniqueid']]['id'];this[_0x69ae('0xd')][_0x58db72[_0x69ae('0x1c')]][_0x69ae('0x1d')]=this[_0x69ae('0x10')][_0x58db72['uniqueid']][_0x69ae('0x1d')];}logger['info'](_0x58db72[_0x69ae('0x1c')],this['actions'][_0x58db72[_0x69ae('0x1c')]]?_0x69ae('0x4a'):_0x69ae('0x4b'),JSON[_0x69ae('0x39')](this[_0x69ae('0xd')][_0x58db72['uniqueid']]));if(this[_0x69ae('0x10')][_0x58db72[_0x69ae('0x1c')]]){if(this[_0x69ae('0xd')][_0x58db72['uniqueid']][_0x69ae('0x4c')]>0x0&&this['channels'][_0x58db72[_0x69ae('0x1c')]][_0x69ae('0x4d')]===_0x69ae('0x4e')){this[_0x69ae('0x46')](_0x58db72[_0x69ae('0x1c')],!![]);}else{this[_0x69ae('0x46')](_0x58db72[_0x69ae('0x1c')],![],this[_0x69ae('0xd')][_0x58db72[_0x69ae('0x1c')]][_0x69ae('0x4f')]?_0x69ae('0x50')+this['channels'][_0x58db72['uniqueid']][_0x69ae('0x4f')]:_0x69ae('0x51'));}}}};Fax['prototype']['send']=function(_0xe55227){var _0x7add15=this;return new BPromise(function(_0x15c1fd,_0x3bb8e1){_0x7add15[_0x69ae('0x52')](_0xe55227,_0x7add15[_0x69ae('0xe')][_0xe55227['FaxAccountId']])[_0x69ae('0x41')](function(_0x425956){ut[_0x69ae('0x42')](_0x69ae('0x53'),_0x425956);_0x15c1fd(ut[_0x69ae('0x33')](_0x69ae('0x54')));})[_0x69ae('0x44')](function(_0x2116b3){ut['logger'](_0x69ae('0x55'),_0x2116b3);updateStatus(_0xe55227);_0x3bb8e1(ut[_0x69ae('0x33')]('Fax\x20failed'));});});};Fax[_0x69ae('0x1a')][_0x69ae('0x56')]=function(_0x19d77d){var _0x413576=this;return new BPromise(function(_0x46282f,_0x39fbdc){var _0x3c68d1=_0x413576[_0x69ae('0x57')](_0x413576[_0x69ae('0xe')][_0x19d77d[_0x69ae('0x58')]][_0x69ae('0x59')],_0x19d77d);if(_0x3c68d1['isValid']){_0x46282f(ut[_0x69ae('0x33')](_0x69ae('0x5a')));}else{_0x39fbdc(ut[_0x69ae('0x33')](_0x3c68d1[_0x69ae('0x33')]));}});};function originate(_0x3fc9e2,_0x3a249e,_0x4e8c84){return new BPromise(function(_0x3f0917,_0x2cf321){if(_0x4e8c84){var _0x31436d=util[_0x69ae('0x5b')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x3fc9e2[_0x69ae('0x4')])[_0x69ae('0x1d')],_0x3fc9e2[_0x69ae('0x4')]);gs[_0x69ae('0x5c')](_0x31436d)[_0x69ae('0x41')](function(){_0x3fc9e2[_0x69ae('0x4')]=util['format'](_0x69ae('0x5d'),path[_0x69ae('0x37')](_0x3fc9e2['path'])[_0x69ae('0x5e')],path[_0x69ae('0x37')](_0x3fc9e2[_0x69ae('0x4')])[_0x69ae('0x1d')]);_0x3a249e[_0x69ae('0x5f')]=_0x3fc9e2[_0x69ae('0x4')];ut[_0x69ae('0x42')](_0x69ae('0x60'),'');ami['Action'](ut['variablesAction'](_0x3fc9e2,_0x3a249e))['then'](function(_0x4b7e99){_0x3f0917(_0x4b7e99);})['catch'](function(_0xf966b4){_0x2cf321(_0xf966b4);});})['catch'](function(_0x1f8ac1){_0x2cf321(_0x1f8ac1);});}else{ami['Action'](ut[_0x69ae('0x61')](_0x3fc9e2,_0x3a249e))['then'](function(_0x1314b8){_0x3f0917(_0x1314b8);})[_0x69ae('0x44')](function(_0x1bd079){_0x2cf321(_0x1bd079);});}});}Fax['prototype']['execOriginate']=function(_0xf706f,_0x5085d5){var _0xa03c2e=this;return new BPromise(function(_0x1a159c,_0xfe3c9a){var _0x520265=uuid['v4']();var _0x5a215d=ut['addVariables'](_0xf706f,_0x5085d5);_0xa03c2e[_0x69ae('0x10')][_0x520265]=new Action(_0x520265,_0x5085d5,_0xf706f);var _0x10f2aa=_0xa03c2e[_0x69ae('0x10')][_0x520265];if(path['parse'](_0xf706f[_0x69ae('0x4')])['ext']===_0x69ae('0x35')){originate(_0x10f2aa,_0x5a215d,!![])[_0x69ae('0x41')](function(_0x436bd2){_0x1a159c(_0x436bd2);})[_0x69ae('0x44')](function(_0x1d9671){_0xfe3c9a(_0x1d9671);});}else{originate(_0x10f2aa,_0x5a215d,![])['then'](function(_0x5ba971){_0x1a159c(_0x5ba971);})['catch'](function(_0x30ebbd){_0xfe3c9a(_0x30ebbd);});}});};Fax[_0x69ae('0x1a')][_0x69ae('0x62')]=function(_0x18003c){return!_['isNil'](_0x18003c)&&!_[_0x69ae('0x63')](_0x18003c[_0x69ae('0x1d')])&&!_['isNil'](_0x18003c[_0x69ae('0x64')])&&_0x18003c['active']&&!_[_0x69ae('0x63')](this[_0x69ae('0xf')][util['format'](_0x69ae('0x65'),_0x18003c[_0x69ae('0x1d')])])&&!_['isNil'](this['trunks'][util[_0x69ae('0x5b')](_0x69ae('0x65'),_0x18003c['name'])][_0x69ae('0x29')])&&(this[_0x69ae('0xf')][util[_0x69ae('0x5b')](_0x69ae('0x65'),_0x18003c[_0x69ae('0x1d')])]['status']===_0x69ae('0x66')||this[_0x69ae('0xf')][util[_0x69ae('0x5b')](_0x69ae('0x65'),_0x18003c[_0x69ae('0x1d')])]['status']===_0x69ae('0x67'));};Fax['prototype'][_0x69ae('0x57')]=function(_0x11ddd1,_0x249860){if(!this[_0x69ae('0x62')](_0x11ddd1)){ut[_0x69ae('0x42')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x69ae('0x63')](_0x11ddd1)?'':_0x11ddd1['name']+_0x69ae('0x68'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x69ae('0x63')](_0x249860[_0x69ae('0x6')])){ut[_0x69ae('0x42')](_0x69ae('0x69'),JSON[_0x69ae('0x39')](_0x249860));return{'isValid':![],'message':_0x69ae('0x6a')};}if(_[_0x69ae('0x63')](_0x249860[_0x69ae('0x4')])){ut['logger'](_0x69ae('0x6b'),JSON[_0x69ae('0x39')](_0x249860));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x69ae('0x6c')};};module[_0x69ae('0x6d')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index bf5e0b9..b0af7af 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 _0x3c67=['notify','then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','inspect'];(function(_0x5bb077,_0x314590){var _0x487afc=function(_0x1293b3){while(--_0x1293b3){_0x5bb077['push'](_0x5bb077['shift']());}};_0x487afc(++_0x314590);}(_0x3c67,0x1ab));var _0x73c6=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x3c67[_0x36c5b0];return _0xf19333;};'use strict';var util=require('util');var BPromise=require(_0x73c6('0x0'));var logger=require(_0x73c6('0x1'))(_0x73c6('0x2'));var _=require(_0x73c6('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x515654){return function(_0x5b6a5d){logger['error'](_0x515654,util[_0x73c6('0x4')](_0x5b6a5d,{'showHidden':![],'depth':null}));};}exports[_0x73c6('0x5')]=function(_0x5230e5,_0x554335){return BPromise['resolve']()[_0x73c6('0x6')](faxAccount[_0x73c6('0x5')](_0x5230e5,_0x554335))[_0x73c6('0x7')](loggerCatch(_0x73c6('0x8')));}; \ No newline at end of file +var _0x7197=['error','inspect','notify','resolve','then','util','preview','lodash'];(function(_0x1bccee,_0x4419a8){var _0x5d96c1=function(_0x5e7006){while(--_0x5e7006){_0x1bccee['push'](_0x1bccee['shift']());}};_0x5d96c1(++_0x4419a8);}(_0x7197,0x12d));var _0x7719=function(_0x2ff990,_0x39663f){_0x2ff990=_0x2ff990-0x0;var _0x1b0651=_0x7197[_0x2ff990];return _0x1b0651;};'use strict';var util=require(_0x7719('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x7719('0x1'));var _=require(_0x7719('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x48256a){return function(_0x30b89f){logger[_0x7719('0x3')](_0x48256a,util[_0x7719('0x4')](_0x30b89f,{'showHidden':![],'depth':null}));};}exports[_0x7719('0x5')]=function(_0x19b23b,_0x1ffd95){return BPromise[_0x7719('0x6')]()[_0x7719('0x7')](faxAccount[_0x7719('0x5')](_0x19b23b,_0x1ffd95))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 52dc770..1d8448a 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 _0x629b=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','child_process','exec'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x629b,0xe5));var _0xb629=function(_0x3baa5f,_0x500c1a){_0x3baa5f=_0x3baa5f-0x0;var _0x1b5da5=_0x629b[_0x3baa5f];return _0x1b5da5;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require('bluebird');var exec=require(_0xb629('0x0'))[_0xb629('0x1')];exports[_0xb629('0x2')]=function(_0xa9d815){return new BPromise(function(_0x39fd37,_0x5bd8ba){exec(_0xa9d815,function(_0x57bce0,_0x3fce86,_0x12a232){logger[_0xb629('0x3')](_0xb629('0x4'),_0x3fce86);if(_0x57bce0){logger[_0xb629('0x3')]('Exec\x20gs',_0xb629('0x5'),util[_0xb629('0x6')](_0x57bce0,{'showHidden':![],'depth':null}),_0x3fce86,_0x12a232);_0x5bd8ba(_0x57bce0);}_0x39fd37(_0x3fce86);});});}; \ No newline at end of file +var _0x028d=['fax','execute','Exec\x20gs','info','inspect','util','../../../../config/logger'];(function(_0x197fdd,_0x48aac0){var _0x501ce8=function(_0x2bcf49){while(--_0x2bcf49){_0x197fdd['push'](_0x197fdd['shift']());}};_0x501ce8(++_0x48aac0);}(_0x028d,0xd7));var _0xd028=function(_0x8ee4d,_0x47f1ca){_0x8ee4d=_0x8ee4d-0x0;var _0x1ff628=_0x028d[_0x8ee4d];return _0x1ff628;};'use strict';var util=require(_0xd028('0x0'));var logger=require(_0xd028('0x1'))(_0xd028('0x2'));var BPromise=require('bluebird');var exec=require('child_process')['exec'];exports[_0xd028('0x3')]=function(_0x7f0cc1){return new BPromise(function(_0x3683c9,_0x52baad){exec(_0x7f0cc1,function(_0x26bc9e,_0x4b4cfc,_0x3723c8){logger['info'](_0xd028('0x4'),_0x4b4cfc);if(_0x26bc9e){logger[_0xd028('0x5')](_0xd028('0x4'),'\x20Error\x20:',util[_0xd028('0x6')](_0x26bc9e,{'showHidden':![],'depth':null}),_0x4b4cfc,_0x3723c8);_0x52baad(_0x26bc9e);}_0x3683c9(_0x4b4cfc);});});}; \ 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 e7388db..67f705f 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 _0x5fb3=['logger','info','inspect','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','fax','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fb3,0xbb));var _0x35fb=function(_0xf05c6,_0x2fbb28){_0xf05c6=_0xf05c6-0x0;var _0x4eb519=_0x5fb3[_0xf05c6];return _0x4eb519;};'use strict';var util=require(_0x35fb('0x0'));var _=require(_0x35fb('0x1'));var moment=require('moment');var logger=require(_0x35fb('0x2'))(_0x35fb('0x3'));exports[_0x35fb('0x4')]=function(_0xe0b12c){return{'message':_0xe0b12c};};exports[_0x35fb('0x5')]=function(_0x5c47a4,_0x3b5104){logger[_0x35fb('0x6')](_0x5c47a4,util[_0x35fb('0x7')](_0x3b5104,{'showHidden':![],'depth':null}));};exports[_0x35fb('0x8')]=function(_0x5db010,_0x4ac7d4){var _0x262954={'XMF-ECM':_0x4ac7d4[_0x35fb('0x9')],'XMF-HEADERINFO':_0x4ac7d4[_0x35fb('0xa')],'XMF-MINRATE':_0x4ac7d4[_0x35fb('0xb')],'XMF-MAXRATE':_0x4ac7d4['maxrate'],'XMF-MODEM':util[_0x35fb('0xc')](_0x35fb('0xd'),_0x4ac7d4[_0x35fb('0xe')]),'XMF-GATEWAY':_0x4ac7d4[_0x35fb('0xf')],'XMF-FAXDETECT':_0x4ac7d4[_0x35fb('0x10')],'XMF-T38TIMEOUT':_0x4ac7d4['t38timeout'],'XMF-LOCALSTATIONID':_0x4ac7d4[_0x35fb('0x11')],'XMF-PATH':_0x5db010[_0x35fb('0x12')]};return _0x262954;};exports['variablesAction']=function(_0x2f26c5,_0x19ef21){return{'actionid':_0x2f26c5[_0x35fb('0x13')],'action':'originate','channel':_0x2f26c5[_0x35fb('0x14')],'Exten':_0x35fb('0x15'),'Context':_0x35fb('0x16'),'Priority':'1','callerid':util[_0x35fb('0xc')](_0x35fb('0x17'),_0x2f26c5['headerinfo']?_0x2f26c5[_0x35fb('0xa')]:'',_0x2f26c5[_0x35fb('0x11')]),'variable':_0x19ef21,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2f26c5[_0x35fb('0x13')]};}; \ No newline at end of file +var _0xb11b=['variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','util','lodash','moment','message','logger','info','inspect','addVariables','ecm','headerinfo','maxrate','\x22%s\x22','modem','gateway','localstationid','path'];(function(_0x10107b,_0x47ed23){var _0xc4679e=function(_0x1edb92){while(--_0x1edb92){_0x10107b['push'](_0x10107b['shift']());}};_0xc4679e(++_0x47ed23);}(_0xb11b,0x1d3));var _0xbb11=function(_0x2ac945,_0x4c5dc3){_0x2ac945=_0x2ac945-0x0;var _0x37c376=_0xb11b[_0x2ac945];return _0x37c376;};'use strict';var util=require(_0xbb11('0x0'));var _=require(_0xbb11('0x1'));var moment=require(_0xbb11('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0xbb11('0x3')]=function(_0x233c0a){return{'message':_0x233c0a};};exports[_0xbb11('0x4')]=function(_0x48d79c,_0x33bd9c){logger[_0xbb11('0x5')](_0x48d79c,util[_0xbb11('0x6')](_0x33bd9c,{'showHidden':![],'depth':null}));};exports[_0xbb11('0x7')]=function(_0x5cd20f,_0x318e31){var _0xe74a76={'XMF-ECM':_0x318e31[_0xbb11('0x8')],'XMF-HEADERINFO':_0x318e31[_0xbb11('0x9')],'XMF-MINRATE':_0x318e31['minrate'],'XMF-MAXRATE':_0x318e31[_0xbb11('0xa')],'XMF-MODEM':util['format'](_0xbb11('0xb'),_0x318e31[_0xbb11('0xc')]),'XMF-GATEWAY':_0x318e31[_0xbb11('0xd')],'XMF-FAXDETECT':_0x318e31['faxdetect'],'XMF-T38TIMEOUT':_0x318e31['t38timeout'],'XMF-LOCALSTATIONID':_0x318e31[_0xbb11('0xe')],'XMF-PATH':_0x5cd20f[_0xbb11('0xf')]};return _0xe74a76;};exports[_0xbb11('0x10')]=function(_0x368f8f,_0x5a4abe){return{'actionid':_0x368f8f[_0xbb11('0x11')],'action':_0xbb11('0x12'),'channel':_0x368f8f[_0xbb11('0x13')],'Exten':_0xbb11('0x14'),'Context':_0xbb11('0x15'),'Priority':'1','callerid':util[_0xbb11('0x16')]('\x22%s\x22\x20<%s>',_0x368f8f[_0xbb11('0x9')]?_0x368f8f[_0xbb11('0x9')]:'',_0x368f8f[_0xbb11('0xe')]),'variable':_0x5a4abe,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x368f8f[_0xbb11('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 01a5a21..6e4be53 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 _0x4860=['catch','error','[index.js][initParams]','inspect','sync','bluebird','util','moment','./realtime','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','getAgents','then','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory'];(function(_0x2b79a9,_0x5cc4ca){var _0x16ae45=function(_0x115fe7){while(--_0x115fe7){_0x2b79a9['push'](_0x2b79a9['shift']());}};_0x16ae45(++_0x5cc4ca);}(_0x4860,0x197));var _0x0486=function(_0x3551fd,_0x4239ef){_0x3551fd=_0x3551fd-0x0;var _0x457f10=_0x4860[_0x3551fd];return _0x457f10;};'use strict';var BPromise=require(_0x0486('0x0'));var util=require(_0x0486('0x1'));var moment=require(_0x0486('0x2'));var server=require('./server');var Realtime=require(_0x0486('0x3'));var Report=require('./report');var Acw=require(_0x0486('0x4'));var Trigger=require(_0x0486('0x5'));var Dialer=require('./dialer');var Preview=require(_0x0486('0x6'));var Fax=require(_0x0486('0x7'));var user=require(_0x0486('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x0486('0x9'));var voiceCallReport=require(_0x0486('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0x0486('0xb'));var template=require(_0x0486('0xc'));var cmHopperHistory=require(_0x0486('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x0486('0xe'));var zendesk=require(_0x0486('0xf'));var salesforce=require(_0x0486('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x0486('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x0486('0x12'));var dynamics365=require(_0x0486('0x13'));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(_0x0486('0x14'))(_0x0486('0x15'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0486('0x16')](_0x0486('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0486('0x16')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0x0486('0x18')]())[_0x0486('0x19')](realtime[_0x0486('0x1a')]())['then'](user['getTelephones']())['then'](realtime[_0x0486('0x1b')]())[_0x0486('0x19')](trunk[_0x0486('0x1c')]())[_0x0486('0x19')](realtime[_0x0486('0x1d')]())[_0x0486('0x19')](voiceQueue[_0x0486('0x1e')]())['then'](realtime[_0x0486('0x1f')]())[_0x0486('0x19')](trigger[_0x0486('0x20')]())[_0x0486('0x19')](realtime[_0x0486('0x21')]())[_0x0486('0x19')](template[_0x0486('0x22')]())['then'](realtime[_0x0486('0x23')]())['then'](zendesk[_0x0486('0x24')]())['then'](realtime[_0x0486('0x25')]())[_0x0486('0x19')](salesforce['getSalesforceAccounts']())[_0x0486('0x19')](realtime[_0x0486('0x26')]())[_0x0486('0x19')](sugarcrm[_0x0486('0x27')]())['then'](realtime[_0x0486('0x28')]())['then'](freshdesk[_0x0486('0x29')]())[_0x0486('0x19')](realtime[_0x0486('0x2a')]())[_0x0486('0x19')](desk[_0x0486('0x2b')]())[_0x0486('0x19')](realtime[_0x0486('0x2c')]())[_0x0486('0x19')](zoho[_0x0486('0x2d')]())[_0x0486('0x19')](realtime[_0x0486('0x2e')]())[_0x0486('0x19')](vtiger['getVtigerAccounts']())['then'](realtime[_0x0486('0x2f')]())[_0x0486('0x19')](freshsales[_0x0486('0x30')]())[_0x0486('0x19')](realtime[_0x0486('0x31')]())[_0x0486('0x19')](servicenow[_0x0486('0x32')]())[_0x0486('0x19')](realtime['initServicenowAccounts']())[_0x0486('0x19')](dynamics365[_0x0486('0x33')]())[_0x0486('0x19')](realtime[_0x0486('0x34')]())['then'](campaign[_0x0486('0x35')]())[_0x0486('0x19')](realtime[_0x0486('0x36')]())[_0x0486('0x19')](voiceExtension['getVoiceExtensions']())[_0x0486('0x19')](realtime['initVoiceExtensions']())[_0x0486('0x19')](faxAccount[_0x0486('0x37')]())[_0x0486('0x19')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x0486('0x38')]()[_0x0486('0x19')](voiceQueueReport[_0x0486('0x39')]())[_0x0486('0x19')](realtime[_0x0486('0x3a')]())['then'](cmHopperHistory[_0x0486('0x3b')]())[_0x0486('0x19')](realtime['initVoiceQueueHopperHistory']())[_0x0486('0x19')](cmHopperHistory[_0x0486('0x3c')]())[_0x0486('0x19')](realtime[_0x0486('0x3d')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x0486('0x19')](realtime['initVoiceCallReports']())[_0x0486('0x3e')](function(_0x1d9390){logger[_0x0486('0x3f')](_0x0486('0x40'),util[_0x0486('0x41')](_0x1d9390,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x17a566){return initRealtime();})[_0x0486('0x19')](function(){return initParams();})[_0x0486('0x19')](function(){report[_0x0486('0x42')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x1f2877){logger[_0x0486('0x3f')]('[index.js][main]',util[_0x0486('0x41')](_0x1f2877,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x1963=['getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','./server','./realtime','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then'];(function(_0x399388,_0x378aeb){var _0x41b8a2=function(_0xdfb5a1){while(--_0xdfb5a1){_0x399388['push'](_0x399388['shift']());}};_0x41b8a2(++_0x378aeb);}(_0x1963,0xba));var _0x3196=function(_0x23a36e,_0x4f968c){_0x23a36e=_0x23a36e-0x0;var _0x8a8048=_0x1963[_0x23a36e];return _0x8a8048;};'use strict';var BPromise=require('bluebird');var util=require(_0x3196('0x0'));var moment=require('moment');var server=require(_0x3196('0x1'));var Realtime=require(_0x3196('0x2'));var Report=require(_0x3196('0x3'));var Acw=require(_0x3196('0x4'));var Trigger=require(_0x3196('0x5'));var Dialer=require(_0x3196('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x3196('0x7'));var voiceQueue=require(_0x3196('0x8'));var voiceQueueReport=require(_0x3196('0x9'));var voiceCallReport=require(_0x3196('0xa'));var trunk=require(_0x3196('0xb'));var trigger=require(_0x3196('0xc'));var template=require(_0x3196('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x3196('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x3196('0xf'));var salesforce=require(_0x3196('0x10'));var sugarcrm=require(_0x3196('0x11'));var freshdesk=require(_0x3196('0x12'));var desk=require(_0x3196('0x13'));var zoho=require(_0x3196('0x14'));var vtiger=require(_0x3196('0x15'));var freshsales=require(_0x3196('0x16'));var servicenow=require(_0x3196('0x17'));var dynamics365=require(_0x3196('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x3196('0x19'))(_0x3196('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3196('0x1b')](_0x3196('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3196('0x1b')](_0x3196('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x3196('0x1d')](user[_0x3196('0x1e')]())[_0x3196('0x1d')](realtime[_0x3196('0x1f')]())['then'](user[_0x3196('0x20')]())[_0x3196('0x1d')](realtime['initTelephones']())[_0x3196('0x1d')](trunk[_0x3196('0x21')]())[_0x3196('0x1d')](realtime[_0x3196('0x22')]())[_0x3196('0x1d')](voiceQueue[_0x3196('0x23')]())['then'](realtime[_0x3196('0x24')]())[_0x3196('0x1d')](trigger[_0x3196('0x25')]())[_0x3196('0x1d')](realtime[_0x3196('0x26')]())[_0x3196('0x1d')](template[_0x3196('0x27')]())[_0x3196('0x1d')](realtime[_0x3196('0x28')]())[_0x3196('0x1d')](zendesk[_0x3196('0x29')]())[_0x3196('0x1d')](realtime['initZendeskAccounts']())[_0x3196('0x1d')](salesforce[_0x3196('0x2a')]())[_0x3196('0x1d')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x3196('0x2b')]())[_0x3196('0x1d')](realtime[_0x3196('0x2c')]())[_0x3196('0x1d')](freshdesk[_0x3196('0x2d')]())[_0x3196('0x1d')](realtime['initFreshdeskAccounts']())[_0x3196('0x1d')](desk[_0x3196('0x2e')]())[_0x3196('0x1d')](realtime[_0x3196('0x2f')]())[_0x3196('0x1d')](zoho[_0x3196('0x30')]())[_0x3196('0x1d')](realtime[_0x3196('0x31')]())['then'](vtiger[_0x3196('0x32')]())[_0x3196('0x1d')](realtime[_0x3196('0x33')]())[_0x3196('0x1d')](freshsales[_0x3196('0x34')]())['then'](realtime['initFreshsalesAccounts']())[_0x3196('0x1d')](servicenow[_0x3196('0x35')]())['then'](realtime[_0x3196('0x36')]())[_0x3196('0x1d')](dynamics365['getDynamics365Accounts']())[_0x3196('0x1d')](realtime[_0x3196('0x37')]())['then'](campaign[_0x3196('0x38')]())['then'](realtime['initCampaigns']())[_0x3196('0x1d')](voiceExtension[_0x3196('0x39')]())[_0x3196('0x1d')](realtime[_0x3196('0x3a')]())['then'](faxAccount[_0x3196('0x3b')]())[_0x3196('0x1d')](realtime['initFaxAccounts']())[_0x3196('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x3196('0x3c')]()['then'](voiceQueueReport[_0x3196('0x3d')]())['then'](realtime[_0x3196('0x3e')]())[_0x3196('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0x3196('0x1d')](cmHopperHistory['getCampaignHopperHistory']())[_0x3196('0x1d')](realtime[_0x3196('0x3f')]())[_0x3196('0x1d')](voiceCallReport[_0x3196('0x40')]())[_0x3196('0x1d')](realtime['initVoiceCallReports']())[_0x3196('0x41')](function(_0xe3870){logger[_0x3196('0x42')](_0x3196('0x43'),util[_0x3196('0x44')](_0xe3870,{'showHidden':![],'depth':null}));});}function main(){return server[_0x3196('0x45')](realtime,preview,fax)[_0x3196('0x1d')](function(_0x278f9e){return initRealtime();})[_0x3196('0x1d')](function(){return initParams();})[_0x3196('0x1d')](function(){report[_0x3196('0x46')]();setInterval(initRealtime,0x1388);})[_0x3196('0x41')](function(_0xffbb7){logger['error'](_0x3196('0x47'),util[_0x3196('0x44')](_0xffbb7,{'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 6711dff..8e244bb 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xedd9,0xfc));var _0x9edd=function(_0x584cc1,_0x35c91e){_0x584cc1=_0x584cc1-0x0;var _0x23d8b9=_0xedd9[_0x584cc1];return _0x23d8b9;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xedd9,0xfc));var _0x9edd=function(_0x228c21,_0x9f0166){_0x228c21=_0x228c21-0x0;var _0x3bb84b=_0xedd9[_0x228c21];return _0x3bb84b;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index bb58172..6578167 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 _0x7040=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x41b869,_0x466829){var _0x4f0e7f=function(_0x37646c){while(--_0x37646c){_0x41b869['push'](_0x41b869['shift']());}};_0x4f0e7f(++_0x466829);}(_0x7040,0x188));var _0x0704=function(_0x20676f,_0x592c07){_0x20676f=_0x20676f-0x0;var _0x2fec10=_0x7040[_0x20676f];return _0x2fec10;};'use strict';function Campaign(_0x425a8f){this['id']=_0x425a8f['id']||0x0;this[_0x0704('0x0')]=_0x425a8f[_0x0704('0x0')]||'';this[_0x0704('0x1')]=_0x425a8f['type']||'campaign';this['originated']=0x0;this[_0x0704('0x2')]=0x0;this[_0x0704('0x3')]=0x0;this[_0x0704('0x4')]=0x0;this[_0x0704('0x5')]='';this[_0x0704('0x6')]=!![];this['active']=_0x425a8f['active'];this['limitCalls']=_0x425a8f[_0x0704('0x7')];this[_0x0704('0x8')]=_0x425a8f[_0x0704('0x8')]||null;this[_0x0704('0x9')]=_0x425a8f[_0x0704('0x9')]?_0x425a8f[_0x0704('0x9')]:null;this[_0x0704('0xa')]=_0x425a8f[_0x0704('0xa')];this[_0x0704('0xb')]=_0x425a8f[_0x0704('0xb')];this[_0x0704('0xc')]=_0x425a8f['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x425a8f['dialCongestionMaxRetry'];this[_0x0704('0xd')]=_0x425a8f['dialCongestionRetryFrequency'];this[_0x0704('0xe')]=_0x425a8f[_0x0704('0xe')];this['dialBusyRetryFrequency']=_0x425a8f[_0x0704('0xf')];this[_0x0704('0x10')]=_0x425a8f[_0x0704('0x10')];this[_0x0704('0x11')]=_0x425a8f[_0x0704('0x11')];this[_0x0704('0x12')]=_0x425a8f[_0x0704('0x12')];this[_0x0704('0x13')]=_0x425a8f[_0x0704('0x13')]||0x3;this[_0x0704('0x14')]=_0x425a8f[_0x0704('0x14')]||0x96;this[_0x0704('0x15')]=_0x425a8f[_0x0704('0x15')]||0x3;this['dialDropRetryFrequency']=_0x425a8f['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x425a8f[_0x0704('0x16')]||0x3;this[_0x0704('0x17')]=_0x425a8f['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x425a8f[_0x0704('0x18')]||0x3;this[_0x0704('0x19')]=_0x425a8f['dialMachineRetryFrequency']||0x96;this[_0x0704('0x1a')]=_0x425a8f[_0x0704('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x425a8f[_0x0704('0x1b')]||0x96;this[_0x0704('0x1c')]=_0x425a8f[_0x0704('0x1c')]||'DESC';this['dialPrefix']=_0x425a8f['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x425a8f[_0x0704('0x1d')]||undefined;this[_0x0704('0x1e')]=_0x425a8f[_0x0704('0x1e')]||undefined;this[_0x0704('0x1f')]=_0x425a8f['TrunkBackup']?_0x425a8f[_0x0704('0x1f')]:undefined;this[_0x0704('0x20')]=_0x425a8f[_0x0704('0x20')]?_0x425a8f[_0x0704('0x20')]:undefined;this['Interval']=_0x425a8f[_0x0704('0x21')]?_0x425a8f[_0x0704('0x21')]:undefined;this[_0x0704('0x22')]=_0x425a8f[_0x0704('0x22')]?_0x425a8f[_0x0704('0x22')]:undefined;this[_0x0704('0x23')]=_0x425a8f[_0x0704('0x22')]?_0x425a8f[_0x0704('0x22')][_0x0704('0x0')]:undefined;this['dialAMDActive']=_0x425a8f[_0x0704('0x24')]||![];this[_0x0704('0x25')]=_0x425a8f[_0x0704('0x25')];this[_0x0704('0x26')]=_0x425a8f[_0x0704('0x26')];this[_0x0704('0x27')]=_0x425a8f[_0x0704('0x27')];this[_0x0704('0x28')]=_0x425a8f[_0x0704('0x28')];this[_0x0704('0x29')]=_0x425a8f[_0x0704('0x29')];this[_0x0704('0x2a')]=_0x425a8f[_0x0704('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x425a8f[_0x0704('0x2b')];this[_0x0704('0x2c')]=_0x425a8f[_0x0704('0x2c')];this['dialAMDMaximumWordLength']=_0x425a8f[_0x0704('0x2d')];}module['exports']=Campaign; \ No newline at end of file +var _0x3ac5=['dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0x3ac5,0x110));var _0x53ac=function(_0x57e7aa,_0x36500e){_0x57e7aa=_0x57e7aa-0x0;var _0x317f4d=_0x3ac5[_0x57e7aa];return _0x317f4d;};'use strict';function Campaign(_0x1bf8da){this['id']=_0x1bf8da['id']||0x0;this[_0x53ac('0x0')]=_0x1bf8da['name']||'';this['type']=_0x1bf8da[_0x53ac('0x1')]||_0x53ac('0x2');this[_0x53ac('0x3')]=0x0;this[_0x53ac('0x4')]=0x0;this[_0x53ac('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x53ac('0x6')]='';this[_0x53ac('0x7')]=!![];this[_0x53ac('0x8')]=_0x1bf8da[_0x53ac('0x8')];this[_0x53ac('0x9')]=_0x1bf8da[_0x53ac('0x9')];this['dialTimezone']=_0x1bf8da[_0x53ac('0xa')]||null;this[_0x53ac('0xb')]=_0x1bf8da[_0x53ac('0xb')]?_0x1bf8da[_0x53ac('0xb')]:null;this['dialOriginateCallerIdName']=_0x1bf8da[_0x53ac('0xc')];this[_0x53ac('0xd')]=_0x1bf8da['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x1bf8da[_0x53ac('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x1bf8da[_0x53ac('0xf')];this['dialCongestionRetryFrequency']=_0x1bf8da[_0x53ac('0x10')];this['dialBusyMaxRetry']=_0x1bf8da['dialBusyMaxRetry'];this[_0x53ac('0x11')]=_0x1bf8da[_0x53ac('0x11')];this['dialNoAnswerMaxRetry']=_0x1bf8da[_0x53ac('0x12')];this[_0x53ac('0x13')]=_0x1bf8da[_0x53ac('0x13')];this['dialGlobalMaxRetry']=_0x1bf8da['dialGlobalMaxRetry'];this[_0x53ac('0x14')]=_0x1bf8da[_0x53ac('0x14')]||0x3;this[_0x53ac('0x15')]=_0x1bf8da[_0x53ac('0x15')]||0x96;this[_0x53ac('0x16')]=_0x1bf8da[_0x53ac('0x16')]||0x3;this[_0x53ac('0x17')]=_0x1bf8da[_0x53ac('0x17')]||0x96;this[_0x53ac('0x18')]=_0x1bf8da[_0x53ac('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x1bf8da['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x1bf8da[_0x53ac('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x1bf8da[_0x53ac('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x1bf8da[_0x53ac('0x1b')]||0x3;this[_0x53ac('0x1c')]=_0x1bf8da[_0x53ac('0x1c')]||0x96;this[_0x53ac('0x1d')]=_0x1bf8da[_0x53ac('0x1d')]||_0x53ac('0x1e');this['dialPrefix']=_0x1bf8da[_0x53ac('0x1f')]||undefined;this[_0x53ac('0x20')]=_0x1bf8da['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x1bf8da[_0x53ac('0x21')]||undefined;this[_0x53ac('0x22')]=_0x1bf8da[_0x53ac('0x22')]?_0x1bf8da['TrunkBackup']:undefined;this[_0x53ac('0x23')]=_0x1bf8da[_0x53ac('0x23')]?_0x1bf8da[_0x53ac('0x23')]:undefined;this[_0x53ac('0x24')]=_0x1bf8da[_0x53ac('0x24')]?_0x1bf8da[_0x53ac('0x24')]:undefined;this['SquareProject']=_0x1bf8da[_0x53ac('0x25')]?_0x1bf8da[_0x53ac('0x25')]:undefined;this['dialQueueProject']=_0x1bf8da[_0x53ac('0x25')]?_0x1bf8da[_0x53ac('0x25')][_0x53ac('0x0')]:undefined;this[_0x53ac('0x26')]=_0x1bf8da[_0x53ac('0x26')]||![];this['dialAMDInitialSilence']=_0x1bf8da['dialAMDInitialSilence'];this[_0x53ac('0x27')]=_0x1bf8da[_0x53ac('0x27')];this[_0x53ac('0x28')]=_0x1bf8da[_0x53ac('0x28')];this['dialAMDTotalAnalysisTime']=_0x1bf8da[_0x53ac('0x29')];this[_0x53ac('0x2a')]=_0x1bf8da['dialAMDMinWordLength'];this[_0x53ac('0x2b')]=_0x1bf8da['dialAMDBetweenWordsSilence'];this[_0x53ac('0x2c')]=_0x1bf8da[_0x53ac('0x2c')];this[_0x53ac('0x2d')]=_0x1bf8da[_0x53ac('0x2d')];this[_0x53ac('0x2e')]=_0x1bf8da[_0x53ac('0x2e')];}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 b35852b..a71460b 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 _0xae8e=['calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel'];(function(_0x447ee1,_0x4b948a){var _0x733dfd=function(_0x4a22b7){while(--_0x4a22b7){_0x447ee1['push'](_0x447ee1['shift']());}};_0x733dfd(++_0x4b948a);}(_0xae8e,0xc3));var _0xeae8=function(_0x40bdee,_0x26d482){_0x40bdee=_0x40bdee-0x0;var _0x12c70c=_0xae8e[_0x40bdee];return _0x12c70c;};'use strict';function Channel(){this[_0xeae8('0x0')]=null;this[_0xeae8('0x1')]='';this[_0xeae8('0x2')]='';this[_0xeae8('0x3')]=0x0;this[_0xeae8('0x4')]='';this[_0xeae8('0x5')]=undefined;this[_0xeae8('0x6')]=undefined;this[_0xeae8('0x7')]=0x0;this[_0xeae8('0x8')]='';this[_0xeae8('0x9')]=0x0;this[_0xeae8('0xa')]=0x0;this[_0xeae8('0xb')]=0x0;this[_0xeae8('0xc')]=![];this[_0xeae8('0xd')]=null;this[_0xeae8('0xe')]=null;this[_0xeae8('0xf')]=![];this[_0xeae8('0x10')]=![];this[_0xeae8('0x11')]='';this[_0xeae8('0x12')]='';this[_0xeae8('0x13')]=0x0;this[_0xeae8('0x14')]=0x0;this[_0xeae8('0x15')]=0x0;this[_0xeae8('0x16')]=null;this[_0xeae8('0x17')]=null;this[_0xeae8('0x18')]=null;this[_0xeae8('0x19')]=![];this[_0xeae8('0x1a')]=null;this[_0xeae8('0x1b')]=null;this[_0xeae8('0x1c')]=[];this[_0xeae8('0x1d')]=undefined;this[_0xeae8('0x1e')]=undefined;this['transferType']=undefined;this[_0xeae8('0x1f')]=0x0;}module[_0xeae8('0x20')]=Channel; \ No newline at end of file +var _0x8b35=['transfercalleridnum','transferType','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','answered','endtime','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','queue','monitors'];(function(_0x33364b,_0x34af32){var _0x25362c=function(_0x34de1f){while(--_0x34de1f){_0x33364b['push'](_0x33364b['shift']());}};_0x25362c(++_0x34af32);}(_0x8b35,0x17a));var _0x58b3=function(_0x153246,_0x4167af){_0x153246=_0x153246-0x0;var _0x4a20ee=_0x8b35[_0x153246];return _0x4a20ee;};'use strict';function Channel(){this[_0x58b3('0x0')]=null;this[_0x58b3('0x1')]='';this[_0x58b3('0x2')]='';this[_0x58b3('0x3')]=0x0;this[_0x58b3('0x4')]='';this['connectedlinenum']=undefined;this[_0x58b3('0x5')]=undefined;this[_0x58b3('0x6')]=0x0;this[_0x58b3('0x7')]='';this[_0x58b3('0x8')]=0x0;this[_0x58b3('0x9')]=0x0;this['exten']=0x0;this[_0x58b3('0xa')]=![];this['answertime']=null;this[_0x58b3('0xb')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x58b3('0xc')]='';this[_0x58b3('0xd')]='';this[_0x58b3('0xe')]=0x0;this[_0x58b3('0xf')]=0x0;this[_0x58b3('0x10')]=0x0;this[_0x58b3('0x11')]=null;this['tag']=null;this[_0x58b3('0x12')]=null;this[_0x58b3('0x13')]=![];this['monitorFilename']=null;this[_0x58b3('0x14')]=null;this[_0x58b3('0x15')]=[];this[_0x58b3('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x58b3('0x17')]=undefined;this['mohtime']=0x0;}module[_0x58b3('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7e5d884..37d7ef8 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 _0x08ab=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType'];(function(_0x3a07d4,_0xa80b88){var _0x2c352=function(_0x27926b){while(--_0x27926b){_0x3a07d4['push'](_0x3a07d4['shift']());}};_0x2c352(++_0xa80b88);}(_0x08ab,0x134));var _0xb08a=function(_0x2c8170,_0x5decb7){_0x2c8170=_0x2c8170-0x0;var _0x213125=_0x08ab[_0x2c8170];return _0x213125;};'use strict';function DeskAccount(_0xdd269a){this['id']=_0xdd269a['id']||0x0;this[_0xb08a('0x0')]=_0xdd269a['name']||'';this[_0xb08a('0x1')]=_0xdd269a['username']||'';this[_0xb08a('0x2')]=_0xdd269a[_0xb08a('0x2')]||'';this[_0xb08a('0x3')]=_0xdd269a[_0xb08a('0x3')]||'';this[_0xb08a('0x4')]=_0xdd269a[_0xb08a('0x4')]||'';this[_0xb08a('0x5')]=_0xdd269a[_0xb08a('0x5')]||'';this['consumerSecret']=_0xdd269a[_0xb08a('0x6')]||'';this[_0xb08a('0x7')]=_0xdd269a[_0xb08a('0x7')]||'';this[_0xb08a('0x8')]=_0xdd269a[_0xb08a('0x8')]||'';this[_0xb08a('0x9')]=_0xdd269a['type']||'';this[_0xb08a('0xa')]=_0xdd269a[_0xb08a('0xa')]||'';this[_0xb08a('0xb')]=_0xdd269a[_0xb08a('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x3b84=['type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x265f1f,_0x507a39){var _0x13ea79=function(_0x5cfa23){while(--_0x5cfa23){_0x265f1f['push'](_0x265f1f['shift']());}};_0x13ea79(++_0x507a39);}(_0x3b84,0x9f));var _0x43b8=function(_0x4bc91f,_0x1143fc){_0x4bc91f=_0x4bc91f-0x0;var _0x5d78bf=_0x3b84[_0x4bc91f];return _0x5d78bf;};'use strict';function DeskAccount(_0x5e41fc){this['id']=_0x5e41fc['id']||0x0;this[_0x43b8('0x0')]=_0x5e41fc[_0x43b8('0x0')]||'';this['username']=_0x5e41fc[_0x43b8('0x1')]||'';this[_0x43b8('0x2')]=_0x5e41fc[_0x43b8('0x2')]||'';this[_0x43b8('0x3')]=_0x5e41fc[_0x43b8('0x3')]||'';this[_0x43b8('0x4')]=_0x5e41fc['password']||'';this['consumerKey']=_0x5e41fc[_0x43b8('0x5')]||'';this[_0x43b8('0x6')]=_0x5e41fc[_0x43b8('0x6')]||'';this['token']=_0x5e41fc[_0x43b8('0x7')]||'';this[_0x43b8('0x8')]=_0x5e41fc[_0x43b8('0x8')]||'';this[_0x43b8('0x9')]=_0x5e41fc[_0x43b8('0x9')]||'';this[_0x43b8('0xa')]=_0x5e41fc['serverUrl']||'';this['Configurations']=_0x5e41fc[_0x43b8('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index a8ce42e..627eac9 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 _0xc6cc=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x43b9aa,_0x275860){var _0x3fbeb1=function(_0x5dedd2){while(--_0x5dedd2){_0x43b9aa['push'](_0x43b9aa['shift']());}};_0x3fbeb1(++_0x275860);}(_0xc6cc,0x185));var _0xcc6c=function(_0x1d4802,_0x437ddb){_0x1d4802=_0x1d4802-0x0;var _0x2d6d65=_0xc6cc[_0x1d4802];return _0x2d6d65;};'use strict';function Dynamics365Account(_0x5774dc){this['id']=_0x5774dc['id']||0x0;this[_0xcc6c('0x0')]=_0x5774dc[_0xcc6c('0x0')]||'';this[_0xcc6c('0x1')]=_0x5774dc[_0xcc6c('0x1')]||'';this[_0xcc6c('0x2')]=_0x5774dc[_0xcc6c('0x2')]||'';this[_0xcc6c('0x3')]=_0x5774dc[_0xcc6c('0x3')]||'';this[_0xcc6c('0x4')]=_0x5774dc['tenantId']||'';this[_0xcc6c('0x5')]=_0x5774dc[_0xcc6c('0x5')]||'';this[_0xcc6c('0x6')]=_0x5774dc[_0xcc6c('0x6')]||{};this[_0xcc6c('0x7')]=_0x5774dc['serverUrl']||'';this[_0xcc6c('0x8')]=_0x5774dc['modernAuthentication']||![];this[_0xcc6c('0x9')]=_0x5774dc['Configurations']||{};this[_0xcc6c('0xa')]=_0x5774dc[_0xcc6c('0xa')]||{};}module[_0xcc6c('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x554a=['Configurations','CloudProvider','exports','username','password','remoteUri','tenantId','clientId','serverUrl','modernAuthentication'];(function(_0x520138,_0x28b48e){var _0x46b0bf=function(_0x13798e){while(--_0x13798e){_0x520138['push'](_0x520138['shift']());}};_0x46b0bf(++_0x28b48e);}(_0x554a,0x17f));var _0xa554=function(_0x25681e,_0x2bdf62){_0x25681e=_0x25681e-0x0;var _0x16260e=_0x554a[_0x25681e];return _0x16260e;};'use strict';function Dynamics365Account(_0x381803){this['id']=_0x381803['id']||0x0;this['name']=_0x381803['name']||'';this[_0xa554('0x0')]=_0x381803['username']||'';this['password']=_0x381803[_0xa554('0x1')]||'';this[_0xa554('0x2')]=_0x381803[_0xa554('0x2')]||'';this[_0xa554('0x3')]=_0x381803['tenantId']||'';this[_0xa554('0x4')]=_0x381803[_0xa554('0x4')]||'';this['clientSecret']=_0x381803['clientSecret']||{};this[_0xa554('0x5')]=_0x381803[_0xa554('0x5')]||'';this[_0xa554('0x6')]=_0x381803['modernAuthentication']||![];this[_0xa554('0x7')]=_0x381803[_0xa554('0x7')]||{};this[_0xa554('0x8')]=_0x381803[_0xa554('0x8')]||{};}module[_0xa554('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 35995be..3646034 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 _0xc152=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway'];(function(_0x178576,_0x2c41cc){var _0x5ad332=function(_0xc2e7ae){while(--_0xc2e7ae){_0x178576['push'](_0x178576['shift']());}};_0x5ad332(++_0x2c41cc);}(_0xc152,0x1a6));var _0x2c15=function(_0x2e90b0,_0x18c26d){_0x2e90b0=_0x2e90b0-0x0;var _0x1cb3ba=_0xc152[_0x2e90b0];return _0x1cb3ba;};'use strict';function FaxAccount(_0x3b25c9){this['id']=_0x3b25c9['id']||0x0;this[_0x2c15('0x0')]=_0x3b25c9[_0x2c15('0x0')]||'';this[_0x2c15('0x1')]=_0x3b25c9[_0x2c15('0x1')];this[_0x2c15('0x2')]=_0x3b25c9[_0x2c15('0x2')];this[_0x2c15('0x3')]=_0x3b25c9[_0x2c15('0x3')];this[_0x2c15('0x4')]=_0x3b25c9[_0x2c15('0x4')];this[_0x2c15('0x5')]=_0x3b25c9['minrate']||0x960;this[_0x2c15('0x6')]=_0x3b25c9[_0x2c15('0x6')]||0x3840;this['modem']=_0x3b25c9[_0x2c15('0x7')]||_0x2c15('0x8');this[_0x2c15('0x9')]=_0x3b25c9[_0x2c15('0x9')]||'no';this[_0x2c15('0xa')]=_0x3b25c9['faxdetect']||'no';this['t38timeout']=_0x3b25c9[_0x2c15('0xb')]||0x1388;this[_0x2c15('0xc')]=_0x3b25c9['tech']||_0x2c15('0xd');this['Trunk']=_0x3b25c9['Trunk']?_0x3b25c9[_0x2c15('0xe')]:undefined;this[_0x2c15('0xf')]=_0x3b25c9[_0x2c15('0xf')];this[_0x2c15('0x10')]=_0x3b25c9[_0x2c15('0x10')];}module[_0x2c15('0x11')]=FaxAccount; \ No newline at end of file +var _0xc25a=['key','name','description','ecm','headerinfo','maxrate','modem','gateway','faxdetect','t38timeout','SIP','Trunk','ListId'];(function(_0xe783ca,_0x575128){var _0x19e7f3=function(_0x17358b){while(--_0x17358b){_0xe783ca['push'](_0xe783ca['shift']());}};_0x19e7f3(++_0x575128);}(_0xc25a,0xeb));var _0xac25=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xc25a[_0x1cc8fe];return _0x230054;};'use strict';function FaxAccount(_0x4646d9){this['id']=_0x4646d9['id']||0x0;this[_0xac25('0x0')]=_0x4646d9[_0xac25('0x0')]||'';this[_0xac25('0x1')]=_0x4646d9[_0xac25('0x1')];this[_0xac25('0x2')]=_0x4646d9['ecm'];this[_0xac25('0x3')]=_0x4646d9[_0xac25('0x3')];this['localstationid']=_0x4646d9['localstationid'];this['minrate']=_0x4646d9['minrate']||0x960;this['maxrate']=_0x4646d9[_0xac25('0x4')]||0x3840;this[_0xac25('0x5')]=_0x4646d9[_0xac25('0x5')]||'v17,v27,v29';this[_0xac25('0x6')]=_0x4646d9[_0xac25('0x6')]||'no';this[_0xac25('0x7')]=_0x4646d9[_0xac25('0x7')]||'no';this[_0xac25('0x8')]=_0x4646d9[_0xac25('0x8')]||0x1388;this['tech']=_0x4646d9['tech']||_0xac25('0x9');this['Trunk']=_0x4646d9[_0xac25('0xa')]?_0x4646d9['Trunk']:undefined;this[_0xac25('0xb')]=_0x4646d9[_0xac25('0xb')];this[_0xac25('0xc')]=_0x4646d9[_0xac25('0xc')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 371afd9..26845db 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 _0x3f80=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x26eac2,_0xf07667){var _0x65a08a=function(_0x32bf4d){while(--_0x32bf4d){_0x26eac2['push'](_0x26eac2['shift']());}};_0x65a08a(++_0xf07667);}(_0x3f80,0x68));var _0x03f8=function(_0xb572e3,_0x2d1772){_0xb572e3=_0xb572e3-0x0;var _0x180057=_0x3f80[_0xb572e3];return _0x180057;};'use strict';function FreshdeskAccount(_0x565995){this['id']=_0x565995['id']||0x0;this[_0x03f8('0x0')]=_0x565995['name']||'';this[_0x03f8('0x1')]=_0x565995[_0x03f8('0x1')]||'';this[_0x03f8('0x2')]=_0x565995[_0x03f8('0x3')]||'';this[_0x03f8('0x4')]=_0x565995[_0x03f8('0x4')]||'';this[_0x03f8('0x5')]=_0x565995[_0x03f8('0x5')]||'';this[_0x03f8('0x6')]=_0x565995['Configurations']||{};}module[_0x03f8('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x5452=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x161450,_0x5ca76c){var _0x5a3fda=function(_0x18a4bd){while(--_0x18a4bd){_0x161450['push'](_0x161450['shift']());}};_0x5a3fda(++_0x5ca76c);}(_0x5452,0x7c));var _0x2545=function(_0x5bb120,_0x2e60be){_0x5bb120=_0x5bb120-0x0;var _0x260d37=_0x5452[_0x5bb120];return _0x260d37;};'use strict';function FreshdeskAccount(_0x4c591a){this['id']=_0x4c591a['id']||0x0;this[_0x2545('0x0')]=_0x4c591a[_0x2545('0x0')]||'';this['username']=_0x4c591a[_0x2545('0x1')]||'';this[_0x2545('0x2')]=_0x4c591a[_0x2545('0x3')]||'';this[_0x2545('0x4')]=_0x4c591a[_0x2545('0x4')]||'';this['serverUrl']=_0x4c591a[_0x2545('0x5')]||'';this[_0x2545('0x6')]=_0x4c591a['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 5e168a6..5ffd252 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 _0x2428=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x231479,_0x2173d6){var _0x18a500=function(_0x726c1f){while(--_0x726c1f){_0x231479['push'](_0x231479['shift']());}};_0x18a500(++_0x2173d6);}(_0x2428,0xd3));var _0x8242=function(_0x17ee51,_0x4d0452){_0x17ee51=_0x17ee51-0x0;var _0x2ccb12=_0x2428[_0x17ee51];return _0x2ccb12;};'use strict';function FreshsalesAccount(_0x4630f5){this['id']=_0x4630f5['id']||0x0;this[_0x8242('0x0')]=_0x4630f5[_0x8242('0x0')]||'';this[_0x8242('0x1')]=_0x4630f5[_0x8242('0x1')]||'';this[_0x8242('0x2')]=_0x4630f5[_0x8242('0x3')]||'';this[_0x8242('0x4')]=_0x4630f5[_0x8242('0x4')]||'';this[_0x8242('0x5')]=_0x4630f5[_0x8242('0x5')]||'';this[_0x8242('0x6')]=_0x4630f5['Configurations']||{};}module[_0x8242('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x3a5e=['serverUrl','Configurations','name','username','apiKey','remoteUri'];(function(_0x48fd7e,_0x48d26f){var _0x57ac16=function(_0x5cc1da){while(--_0x5cc1da){_0x48fd7e['push'](_0x48fd7e['shift']());}};_0x57ac16(++_0x48d26f);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x32c70c,_0x2be4d5){_0x32c70c=_0x32c70c-0x0;var _0x7cccf3=_0x3a5e[_0x32c70c];return _0x7cccf3;};'use strict';function FreshsalesAccount(_0x5529f2){this['id']=_0x5529f2['id']||0x0;this[_0xe3a5('0x0')]=_0x5529f2[_0xe3a5('0x0')]||'';this[_0xe3a5('0x1')]=_0x5529f2[_0xe3a5('0x1')]||'';this[_0xe3a5('0x2')]=_0x5529f2['token']||'';this[_0xe3a5('0x3')]=_0x5529f2[_0xe3a5('0x3')]||'';this[_0xe3a5('0x4')]=_0x5529f2[_0xe3a5('0x4')]||'';this[_0xe3a5('0x5')]=_0x5529f2['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index b85f527..ed97a47 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 _0xe53a=['queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','variables','exports','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit'];(function(_0x31fedc,_0x47e308){var _0x57c5ad=function(_0x13730a){while(--_0x13730a){_0x31fedc['push'](_0x31fedc['shift']());}};_0x57c5ad(++_0x47e308);}(_0xe53a,0x174));var _0xae53=function(_0x2c7d5a,_0x249978){_0x2c7d5a=_0x2c7d5a-0x0;var _0xc23d4e=_0xe53a[_0x2c7d5a];return _0xc23d4e;};'use strict';function QueueReport(){this[_0xae53('0x0')]='inbound';this[_0xae53('0x1')]='';this[_0xae53('0x2')]='';this[_0xae53('0x3')]='';this['queue']='';this[_0xae53('0x4')]=null;this['queuecallerleaveAt']=null;this[_0xae53('0x5')]=0x1;this[_0xae53('0x6')]=0x1;this[_0xae53('0x7')]=![];this[_0xae53('0x8')]=null;this[_0xae53('0x9')]=![];this[_0xae53('0xa')]=null;this[_0xae53('0xb')]=![];this[_0xae53('0xc')]=null;this[_0xae53('0xd')]=0x1;this['channel']='';this[_0xae53('0xe')]='';this[_0xae53('0xf')]='';this[_0xae53('0x10')]='';this[_0xae53('0x11')]='';this[_0xae53('0x12')]='';this['priority']='';this[_0xae53('0x13')]=0x0;this[_0xae53('0x14')]=![];this[_0xae53('0x15')]='';this['motionChannel']='voice';this['mohtime']=0x0;this[_0xae53('0x16')]={};}module[_0xae53('0x17')]=QueueReport; \ No newline at end of file +var _0x63fd=['voice','mohtime','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','holdtime','assigned','lastAssignedTo','motionChannel'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x63fd,0x116));var _0xd63f=function(_0x5040d0,_0x11f96d){_0x5040d0=_0x5040d0-0x0;var _0x4f9d56=_0x63fd[_0x5040d0];return _0x4f9d56;};'use strict';function QueueReport(){this[_0xd63f('0x0')]=_0xd63f('0x1');this[_0xd63f('0x2')]='';this[_0xd63f('0x3')]='';this['calleridname']='';this[_0xd63f('0x4')]='';this[_0xd63f('0x5')]=null;this['queuecallerleaveAt']=null;this[_0xd63f('0x6')]=0x1;this[_0xd63f('0x7')]=0x1;this[_0xd63f('0x8')]=![];this[_0xd63f('0x9')]=null;this['queuecallercomplete']=![];this[_0xd63f('0xa')]=null;this[_0xd63f('0xb')]=![];this[_0xd63f('0xc')]=null;this[_0xd63f('0xd')]=0x1;this[_0xd63f('0xe')]='';this[_0xd63f('0xf')]='';this[_0xd63f('0x10')]='';this[_0xd63f('0x11')]='';this['context']='';this['exten']='';this['priority']='';this[_0xd63f('0x12')]=0x0;this[_0xd63f('0x13')]=![];this[_0xd63f('0x14')]='';this[_0xd63f('0x15')]=_0xd63f('0x16');this[_0xd63f('0x17')]=0x0;this['variables']={};}module[_0xd63f('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index e1118a0..d9c2c6d 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 _0x19dd=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0xedfb79,_0x142df){var _0x30def0=function(_0x261eb7){while(--_0x261eb7){_0xedfb79['push'](_0xedfb79['shift']());}};_0x30def0(++_0x142df);}(_0x19dd,0x1b2));var _0xd19d=function(_0x9d304e,_0x571739){_0x9d304e=_0x9d304e-0x0;var _0x13f2c9=_0x19dd[_0x9d304e];return _0x13f2c9;};'use strict';function SalesforceAccount(_0x38df3b){this['id']=_0x38df3b['id']||0x0;this[_0xd19d('0x0')]=_0x38df3b[_0xd19d('0x0')]||'';this[_0xd19d('0x1')]=_0x38df3b[_0xd19d('0x1')]||'';this[_0xd19d('0x2')]=_0x38df3b[_0xd19d('0x2')]||'';this[_0xd19d('0x3')]=_0x38df3b[_0xd19d('0x3')]||'';this[_0xd19d('0x4')]=_0x38df3b[_0xd19d('0x4')]||'';this['clientSecret']=_0x38df3b[_0xd19d('0x5')]||'';this['securityToken']=_0x38df3b['securityToken']||'';this[_0xd19d('0x6')]=_0x38df3b[_0xd19d('0x6')]||_0xd19d('0x7');this[_0xd19d('0x8')]=_0x38df3b['serverUrl']||'';this[_0xd19d('0x9')]=_0x38df3b[_0xd19d('0x9')]||{};}module[_0xd19d('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xdeb3=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';function SalesforceAccount(_0x42bdd6){this['id']=_0x42bdd6['id']||0x0;this[_0x3deb('0x0')]=_0x42bdd6[_0x3deb('0x0')]||'';this[_0x3deb('0x1')]=_0x42bdd6['username']||'';this['remoteUri']=_0x42bdd6[_0x3deb('0x2')]||'';this[_0x3deb('0x3')]=_0x42bdd6[_0x3deb('0x3')]||'';this[_0x3deb('0x4')]=_0x42bdd6[_0x3deb('0x4')]||'';this['clientSecret']=_0x42bdd6[_0x3deb('0x5')]||'';this['securityToken']=_0x42bdd6[_0x3deb('0x6')]||'';this['type']=_0x42bdd6[_0x3deb('0x7')]||_0x3deb('0x8');this[_0x3deb('0x9')]=_0x42bdd6[_0x3deb('0x9')]||'';this[_0x3deb('0xa')]=_0x42bdd6[_0x3deb('0xa')]||{};}module[_0x3deb('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 18d7a64..5aae9e3 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 _0x856a=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x856a,0x1dd));var _0xa856=function(_0x302312,_0x1c105b){_0x302312=_0x302312-0x0;var _0x560702=_0x856a[_0x302312];return _0x560702;};'use strict';function ServicenowAccount(_0x1a07cc){this['id']=_0x1a07cc['id']||0x0;this[_0xa856('0x0')]=_0x1a07cc[_0xa856('0x0')]||'';this[_0xa856('0x1')]=_0x1a07cc[_0xa856('0x1')]||'';this[_0xa856('0x2')]=_0x1a07cc[_0xa856('0x2')]||'';this['remoteUri']=_0x1a07cc[_0xa856('0x3')]||'';this['serverUrl']=_0x1a07cc[_0xa856('0x4')]||'';this['Configurations']=_0x1a07cc[_0xa856('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x11d8=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x597b70,_0x5be757){var _0xf01c3a=function(_0x5a86ce){while(--_0x5a86ce){_0x597b70['push'](_0x597b70['shift']());}};_0xf01c3a(++_0x5be757);}(_0x11d8,0x177));var _0x811d=function(_0x250602,_0x2ff70e){_0x250602=_0x250602-0x0;var _0x52aa48=_0x11d8[_0x250602];return _0x52aa48;};'use strict';function ServicenowAccount(_0x3c9539){this['id']=_0x3c9539['id']||0x0;this['name']=_0x3c9539[_0x811d('0x0')]||'';this[_0x811d('0x1')]=_0x3c9539[_0x811d('0x1')]||'';this['password']=_0x3c9539[_0x811d('0x2')]||'';this['remoteUri']=_0x3c9539[_0x811d('0x3')]||'';this[_0x811d('0x4')]=_0x3c9539[_0x811d('0x4')]||'';this[_0x811d('0x5')]=_0x3c9539[_0x811d('0x5')]||{};}module[_0x811d('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 1be3b3c..45db6c4 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 _0x627a=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x547cc2,_0x10c7f4){var _0x2e60e7=function(_0x53407f){while(--_0x53407f){_0x547cc2['push'](_0x547cc2['shift']());}};_0x2e60e7(++_0x10c7f4);}(_0x627a,0xae));var _0xa627=function(_0x51678a,_0x4c8ab4){_0x51678a=_0x51678a-0x0;var _0x46465e=_0x627a[_0x51678a];return _0x46465e;};'use strict';function SugarcrmAccount(_0x25638b){this['id']=_0x25638b['id']||0x0;this[_0xa627('0x0')]=_0x25638b['name']||'';this[_0xa627('0x1')]=_0x25638b['username']||'';this[_0xa627('0x2')]=_0x25638b[_0xa627('0x2')]||'';this[_0xa627('0x3')]=_0x25638b[_0xa627('0x3')]||'';this[_0xa627('0x4')]=_0x25638b['serverUrl']||'';this[_0xa627('0x5')]=_0x25638b['Configurations']||{};}module[_0xa627('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x3fed=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x3407c2,_0x3ba5df){var _0xe0615b=function(_0x432bd8){while(--_0x432bd8){_0x3407c2['push'](_0x3407c2['shift']());}};_0xe0615b(++_0x3ba5df);}(_0x3fed,0x1a4));var _0xd3fe=function(_0x57b2f7,_0x574149){_0x57b2f7=_0x57b2f7-0x0;var _0xeb0745=_0x3fed[_0x57b2f7];return _0xeb0745;};'use strict';function SugarcrmAccount(_0x2cd4b9){this['id']=_0x2cd4b9['id']||0x0;this[_0xd3fe('0x0')]=_0x2cd4b9[_0xd3fe('0x0')]||'';this[_0xd3fe('0x1')]=_0x2cd4b9[_0xd3fe('0x1')]||'';this[_0xd3fe('0x2')]=_0x2cd4b9[_0xd3fe('0x2')]||'';this[_0xd3fe('0x3')]=_0x2cd4b9['remoteUri']||'';this['serverUrl']=_0x2cd4b9[_0xd3fe('0x4')]||'';this['Configurations']=_0x2cd4b9[_0xd3fe('0x5')]||{};}module[_0xd3fe('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 afde6e4..b9b2f28 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 _0xdbae=['state','unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0xdbae,0x116));var _0xedba=function(_0x3deb26,_0x23811a){_0x3deb26=_0x3deb26-0x0;var _0x3618e5=_0xdbae[_0x3deb26];return _0x3618e5;};'use strict';function Telephone(_0x29f6bb){this['id']=_0x29f6bb['id']||0x0;this[_0xedba('0x0')]=_0x29f6bb[_0xedba('0x0')]||'';this[_0xedba('0x1')]=_0x29f6bb[_0xedba('0x1')]||'';this[_0xedba('0x2')]=_0xedba('0x3');this[_0xedba('0x4')]=0x0;this[_0xedba('0x5')]=_0xedba('0x3');this[_0xedba('0x6')]='';}module[_0xedba('0x7')]=Telephone; \ No newline at end of file +var _0xecf8=['address','exports','name','accountcode','state','stateTime','status'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0xecf8,0xd4));var _0x8ecf=function(_0x2d6198,_0x32b347){_0x2d6198=_0x2d6198-0x0;var _0x1d98b1=_0xecf8[_0x2d6198];return _0x1d98b1;};'use strict';function Telephone(_0x3608bc){this['id']=_0x3608bc['id']||0x0;this[_0x8ecf('0x0')]=_0x3608bc[_0x8ecf('0x0')]||'';this[_0x8ecf('0x1')]=_0x3608bc['accountcode']||'';this[_0x8ecf('0x2')]='unknown';this[_0x8ecf('0x3')]=0x0;this[_0x8ecf('0x4')]='unknown';this[_0x8ecf('0x5')]='';}module[_0x8ecf('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 5195fd4..766ad9b 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x3ee03d,_0x2771bf){var _0x858ced=function(_0xb69f0c){while(--_0xb69f0c){_0x3ee03d['push'](_0x3ee03d['shift']());}};_0x858ced(++_0x2771bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x1751d2,_0x5ab150){var _0x9ba427=function(_0x1cc15e){while(--_0x1cc15e){_0x1751d2['push'](_0x1751d2['shift']());}};_0x9ba427(++_0x5ab150);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 8df046e..dc60a1b 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 _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x570294,_0x139ae4){var _0x41b542=function(_0xea92ff){while(--_0xea92ff){_0x570294['push'](_0x570294['shift']());}};_0x41b542(++_0x139ae4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xb7e7[_0x1c8c28];return _0x1f59b4;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger; \ No newline at end of file +var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0xdb0316,_0x1699ee){var _0xe43c0d=function(_0x104299){while(--_0x104299){_0xdb0316['push'](_0xdb0316['shift']());}};_0xe43c0d(++_0x1699ee);}(_0x8603,0x190));var _0x3860=function(_0x5260e8,_0x1cc9e6){_0x5260e8=_0x5260e8-0x0;var _0x6bfba9=_0x8603[_0x5260e8];return _0x6bfba9;};'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 diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 76ea7c0..891fd29 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 _0x366e=['registry','split','host','port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown','status'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x366e,0x19b));var _0xe366=function(_0x5d082a,_0x4aa33f){_0x5d082a=_0x5d082a-0x0;var _0xebd7f4=_0x366e[_0x5d082a];return _0xebd7f4;};'use strict';function Trunk(_0x2729c5){this['id']=_0x2729c5['id']||0x0;this[_0xe366('0x0')]=_0x2729c5['active']||![];this[_0xe366('0x1')]=_0x2729c5['name']||'';this[_0xe366('0x2')]=_0xe366('0x3');this['stateTime']=0x0;this[_0xe366('0x4')]=_0xe366('0x3');this[_0xe366('0x5')]=_0x2729c5[_0xe366('0x5')]&&_0x2729c5[_0xe366('0x5')]['indexOf'](':')?_0x2729c5['registry'][_0xe366('0x6')](':')[0x0]:'';this[_0xe366('0x7')]='';this[_0xe366('0x8')]='';this[_0xe366('0x9')]='';this[_0xe366('0xa')]='';this[_0xe366('0xb')]='';this['stateRegistry']=_0xe366('0x3');this[_0xe366('0xc')]='';this[_0xe366('0xd')]='';this[_0xe366('0xe')]=_0x2729c5[_0xe366('0xe')]||'';}module[_0xe366('0xf')]=Trunk; \ No newline at end of file +var _0xd359=['domain','stateRegistry','registrationtime','defaultuser','exports','active','name','unknown','stateTime','registry','split','host','port'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd359,0x94));var _0x9d35=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd359[_0x4b369d];return _0x571a98;};'use strict';function Trunk(_0x13f34f){this['id']=_0x13f34f['id']||0x0;this[_0x9d35('0x0')]=_0x13f34f['active']||![];this[_0x9d35('0x1')]=_0x13f34f['name']||'';this['state']=_0x9d35('0x2');this[_0x9d35('0x3')]=0x0;this['status']=_0x9d35('0x2');this['registry']=_0x13f34f[_0x9d35('0x4')]&&_0x13f34f['registry']['indexOf'](':')?_0x13f34f['registry'][_0x9d35('0x5')](':')[0x0]:'';this[_0x9d35('0x6')]='';this[_0x9d35('0x7')]='';this[_0x9d35('0x8')]='';this['domainport']='';this['refresh']='';this[_0x9d35('0x9')]=_0x9d35('0x2');this[_0x9d35('0xa')]='';this['address']='';this['defaultuser']=_0x13f34f[_0x9d35('0xb')]||'';}module[_0x9d35('0xc')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index a45c27c..136bf36 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 _0xbf59=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x5e8897,_0x299e79){var _0x271b50=function(_0x74267a){while(--_0x74267a){_0x5e8897['push'](_0x5e8897['shift']());}};_0x271b50(++_0x299e79);}(_0xbf59,0x131));var _0x9bf5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbf59[_0x14add3];return _0x4a174f;};'use strict';function voiceExtension(_0x418e47){this['id']=_0x418e47['id']||0x0;this['exten']=_0x418e47[_0x9bf5('0x0')]||'';this[_0x9bf5('0x1')]=_0x418e47[_0x9bf5('0x1')]||_0x9bf5('0x2');this[_0x9bf5('0x3')]=_0x418e47[_0x9bf5('0x3')]||![];}module[_0x9bf5('0x4')]=voiceExtension; \ No newline at end of file +var _0xd708=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x59c765,_0x1b14cb){var _0x731b6d=function(_0x358491){while(--_0x358491){_0x59c765['push'](_0x59c765['shift']());}};_0x731b6d(++_0x1b14cb);}(_0xd708,0x11a));var _0x8d70=function(_0x179f0d,_0x4a07f3){_0x179f0d=_0x179f0d-0x0;var _0x2a44c7=_0xd708[_0x179f0d];return _0x2a44c7;};'use strict';function voiceExtension(_0x5bd603){this['id']=_0x5bd603['id']||0x0;this[_0x8d70('0x0')]=_0x5bd603[_0x8d70('0x0')]||'';this['recordingFormat']=_0x5bd603[_0x8d70('0x1')]||_0x8d70('0x2');this[_0x8d70('0x3')]=_0x5bd603[_0x8d70('0x3')]||![];}module[_0x8d70('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 76c9348..f0b4619 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 _0x4b7a=['outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','unmanaged','abandoned','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x4b7a,0x17c));var _0xa4b7=function(_0x4ccdea,_0x2bd0e6){_0x4ccdea=_0x4ccdea-0x0;var _0x23258a=_0x4b7a[_0x4ccdea];return _0x23258a;};'use strict';var statusDesc=[_0xa4b7('0x0'),'not_inuse',_0xa4b7('0x1'),_0xa4b7('0x2'),_0xa4b7('0x3'),_0xa4b7('0x4'),_0xa4b7('0x5'),_0xa4b7('0x6'),_0xa4b7('0x7')];var monitorFormat={'wav':_0xa4b7('0x8'),'wav49':_0xa4b7('0x9'),'gsm':_0xa4b7('0xa')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xa4b7('0xb')};function VoiceQueue(_0x33de32){this['id']=_0x33de32['id']||0x0;this[_0xa4b7('0xc')]=_0x33de32[_0xa4b7('0xc')]||'';this[_0xa4b7('0xd')]=_0x33de32[_0xa4b7('0xd')]||'';this[_0xa4b7('0xe')]=_0x33de32['type']||_0xa4b7('0xf');this[_0xa4b7('0x10')]=0x0;this[_0xa4b7('0x11')]=0x0;this[_0xa4b7('0x12')]=0x0;this[_0xa4b7('0x13')]=0x0;this['sumDuration']=0x0;this[_0xa4b7('0x14')]=0x0;this['sumBillable']=0x0;this[_0xa4b7('0x15')]=0x0;this[_0xa4b7('0x16')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0xa4b7('0x17')]=_0x33de32['acw']||![];this[_0xa4b7('0x18')]=_0x33de32['acwTimeout']||0xa;this[_0xa4b7('0x19')]=_0x33de32[_0xa4b7('0x19')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xa4b7('0x1a')]=0x0;this[_0xa4b7('0x1b')]=0x0;this[_0xa4b7('0x1c')]=_0x33de32[_0xa4b7('0x1c')]||null;this[_0xa4b7('0x1d')]=_0x33de32[_0xa4b7('0x1d')]?_0x33de32['dialGlobalInterval']:null;this[_0xa4b7('0x1e')]=_0x33de32[_0xa4b7('0x1e')];this[_0xa4b7('0x1f')]=_0x33de32[_0xa4b7('0x1f')]||'progressive';this[_0xa4b7('0x20')]=_0x33de32['dialLimitChannel']||0x0;this[_0xa4b7('0x21')]=_0x33de32[_0xa4b7('0x21')]||0x0;this['dialPowerLevel']=_0x33de32['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x33de32['dialPredictiveOptimization']||_0xa4b7('0x22');this['dialPredictiveOptimizationPercentage']=_0x33de32[_0xa4b7('0x23')]||0.03;this['dialPredictiveInterval']=_0x33de32['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x33de32[_0xa4b7('0x24')]||_0xa4b7('0x25');this['dialOriginateCallerIdNumber']=_0x33de32[_0xa4b7('0x26')]||_0xa4b7('0x25');this[_0xa4b7('0x27')]=_0x33de32['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x33de32['dialQueueOptions']||_0xa4b7('0x28');this[_0xa4b7('0x29')]=_0x33de32[_0xa4b7('0x29')]||0x3;this[_0xa4b7('0x2a')]=_0x33de32[_0xa4b7('0x2a')]||undefined;this[_0xa4b7('0x2b')]=_0x33de32[_0xa4b7('0x2b')]||0x3;this[_0xa4b7('0x2c')]=_0x33de32[_0xa4b7('0x2c')]||0x96;this['dialBusyMaxRetry']=_0x33de32['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x33de32[_0xa4b7('0x2d')]||0x96;this['dialNoAnswerMaxRetry']=_0x33de32[_0xa4b7('0x2e')]||0x3;this[_0xa4b7('0x2f')]=_0x33de32[_0xa4b7('0x2f')]||0x96;this[_0xa4b7('0x30')]=_0x33de32[_0xa4b7('0x30')]||0x3;this[_0xa4b7('0x31')]=_0x33de32[_0xa4b7('0x31')]||0x96;this[_0xa4b7('0x32')]=_0x33de32[_0xa4b7('0x32')]||0x3;this[_0xa4b7('0x33')]=_0x33de32[_0xa4b7('0x33')]||0x96;this['dialAbandonedMaxRetry']=_0x33de32[_0xa4b7('0x34')]||0x3;this['dialAbandonedRetryFrequency']=_0x33de32[_0xa4b7('0x35')]||0x96;this[_0xa4b7('0x36')]=_0x33de32[_0xa4b7('0x36')]||0x3;this[_0xa4b7('0x37')]=_0x33de32[_0xa4b7('0x37')]||0x96;this[_0xa4b7('0x38')]=_0x33de32[_0xa4b7('0x38')]||0x3;this[_0xa4b7('0x39')]=_0x33de32['dialAgentRejectRetryFrequency']||0x96;this[_0xa4b7('0x3a')]=_0x33de32[_0xa4b7('0x3a')]||0x3;this[_0xa4b7('0x3b')]=_0x33de32[_0xa4b7('0x3b')]||0x4;this['Trunk']=_0x33de32[_0xa4b7('0x3c')]?_0x33de32[_0xa4b7('0x3c')]:undefined;this[_0xa4b7('0x3d')]=_0x33de32[_0xa4b7('0x3d')]?_0x33de32['TrunkBackup']:undefined;this['dialPrefix']=_0x33de32['dialPrefix']||undefined;this[_0xa4b7('0x3e')]=_0x33de32[_0xa4b7('0x3e')]?_0x33de32[_0xa4b7('0x3e')]:undefined;this[_0xa4b7('0x3f')]=_0x33de32[_0xa4b7('0x3f')]||_0xa4b7('0x40');this['dialRandomLastDigitCallerIdNumber']=_0x33de32['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xa4b7('0x41')]=_0x33de32[_0xa4b7('0x41')]||undefined;this['strategy']=strategy[_0x33de32[_0xa4b7('0x42')]]||'rrmemory';this[_0xa4b7('0x43')]=!![];this[_0xa4b7('0x44')]=_0x33de32[_0xa4b7('0x44')]||![];this[_0xa4b7('0x45')]=_0x33de32['dialAMDInitialSilence'];this[_0xa4b7('0x46')]=_0x33de32['dialAMDGreeting'];this[_0xa4b7('0x47')]=_0x33de32[_0xa4b7('0x47')];this[_0xa4b7('0x48')]=_0x33de32['dialAMDTotalAnalysisTime'];this[_0xa4b7('0x49')]=_0x33de32[_0xa4b7('0x49')];this['dialAMDBetweenWordsSilence']=_0x33de32[_0xa4b7('0x4a')];this[_0xa4b7('0x4b')]=_0x33de32[_0xa4b7('0x4b')];this[_0xa4b7('0x4c')]=_0x33de32['dialAMDSilenceThreshold'];this[_0xa4b7('0x4d')]=_0x33de32[_0xa4b7('0x4d')];this['outboundRejectCallsDay']=0x0;this[_0xa4b7('0x4e')]=0x0;this[_0xa4b7('0x4f')]=_0x33de32[_0xa4b7('0x4f')];this[_0xa4b7('0x50')]=0x0;this[_0xa4b7('0x51')]=0x0;this[_0xa4b7('0x52')]=0x0;this[_0xa4b7('0x53')]=0x0;this[_0xa4b7('0x54')]=0x0;this[_0xa4b7('0x55')]=0x0;this[_0xa4b7('0x56')]=0x0;this[_0xa4b7('0x57')]=0x0;this[_0xa4b7('0x58')]=0x0;this[_0xa4b7('0x59')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xa4b7('0x5a')]=0x0;this[_0xa4b7('0x5b')]=0x0;this[_0xa4b7('0x5c')]=0x0;this[_0xa4b7('0x5d')]=undefined;this[_0xa4b7('0x5e')]=undefined;this[_0xa4b7('0x5f')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xa4b7('0x60')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xa4b7('0x61')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xa4b7('0x62')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xa4b7('0x63')]=0x0;this[_0xa4b7('0x64')]=_0x33de32['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xa4b7('0x65')]=_0x33de32[_0xa4b7('0x66')]||0xa;this[_0xa4b7('0x67')]=0x0;this[_0xa4b7('0x68')]=0x0;this[_0xa4b7('0x69')]=0x1;this['erlangCalls']=0x0;this[_0xa4b7('0x6a')]=0x0;this[_0xa4b7('0x6b')]=0x0;this['erlangBusyFactor']=0x0;this[_0xa4b7('0x6c')]=_0x33de32[_0xa4b7('0x6c')]||0x1e;this[_0xa4b7('0x6d')]=_0x33de32['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x33de32[_0xa4b7('0x6e')]||![];this['dialPreviewRecallmeReminder']=!!_0x33de32['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x33de32[_0xa4b7('0x6f')]||undefined;this[_0xa4b7('0x70')]=_0x33de32['dialAgiAfterHangupClient']||![];this[_0xa4b7('0x71')]=_0x33de32[_0xa4b7('0x71')]||![];this['monitor_format']=monitorFormat[_0x33de32[_0xa4b7('0xd')]]?monitorFormat[_0x33de32[_0xa4b7('0xd')]]:undefined;this['mandatoryDisposition']=_0x33de32[_0xa4b7('0x72')]||![];this[_0xa4b7('0x73')]=_0x33de32['mandatoryDispositionPause']?_0x33de32[_0xa4b7('0x73')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x13b8=['sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','busy','invalid','unavailable','ringing','ringinuse','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration'];(function(_0x3e87b4,_0x4ff58d){var _0x1012e8=function(_0x210e55){while(--_0x210e55){_0x3e87b4['push'](_0x3e87b4['shift']());}};_0x1012e8(++_0x4ff58d);}(_0x13b8,0x66));var _0x813b=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x13b8[_0x4b174a];return _0x3cd7bf;};'use strict';var statusDesc=['unknown',_0x813b('0x0'),'inuse',_0x813b('0x1'),_0x813b('0x2'),_0x813b('0x3'),_0x813b('0x4'),_0x813b('0x5'),'onhold'];var monitorFormat={'wav':_0x813b('0x6'),'wav49':'wav49','gsm':_0x813b('0x7')};var strategy={'rrmemory':_0x813b('0x8'),'roundrobin':_0x813b('0x9')};function VoiceQueue(_0x3fac9e){this['id']=_0x3fac9e['id']||0x0;this[_0x813b('0xa')]=_0x3fac9e[_0x813b('0xa')]||'';this['monitor_format']=_0x3fac9e[_0x813b('0xb')]||'';this[_0x813b('0xc')]=_0x3fac9e[_0x813b('0xc')]||_0x813b('0xd');this[_0x813b('0xe')]=0x0;this['talking']=0x0;this[_0x813b('0xf')]=0x0;this[_0x813b('0x10')]=0x0;this[_0x813b('0x11')]=0x0;this['sumHoldTime']=0x0;this[_0x813b('0x12')]=0x0;this[_0x813b('0x13')]=0x0;this['abandoned']=0x0;this[_0x813b('0x14')]=0x0;this[_0x813b('0x15')]=0x0;this['acw']=_0x3fac9e[_0x813b('0x16')]||![];this[_0x813b('0x17')]=_0x3fac9e[_0x813b('0x17')]||0xa;this[_0x813b('0x18')]=_0x3fac9e[_0x813b('0x18')]||'no';this[_0x813b('0x19')]=!![];this[_0x813b('0x1a')]='';this[_0x813b('0x1b')]=0x0;this[_0x813b('0x1c')]=0x0;this[_0x813b('0x1d')]=_0x3fac9e['dialTimezone']||null;this['dialGlobalInterval']=_0x3fac9e[_0x813b('0x1e')]?_0x3fac9e[_0x813b('0x1e')]:null;this[_0x813b('0x1f')]=_0x3fac9e[_0x813b('0x1f')];this[_0x813b('0x20')]=_0x3fac9e['dialMethod']||_0x813b('0x21');this[_0x813b('0x22')]=_0x3fac9e['dialLimitChannel']||0x0;this[_0x813b('0x23')]=_0x3fac9e['dialLimitQueue']||0x0;this[_0x813b('0x24')]=_0x3fac9e['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x3fac9e[_0x813b('0x25')]||_0x813b('0x26');this[_0x813b('0x27')]=_0x3fac9e[_0x813b('0x27')]||0.03;this[_0x813b('0x28')]=_0x3fac9e[_0x813b('0x28')]||0x258;this[_0x813b('0x29')]=_0x3fac9e[_0x813b('0x29')]||_0x813b('0x2a');this[_0x813b('0x2b')]=_0x3fac9e[_0x813b('0x2b')]||_0x813b('0x2a');this[_0x813b('0x2c')]=_0x3fac9e['dialOriginateTimeout']||0x1e;this[_0x813b('0x2d')]=_0x3fac9e['dialQueueOptions']||'tTxX';this[_0x813b('0x2e')]=_0x3fac9e[_0x813b('0x2e')]||0x3;this[_0x813b('0x2f')]=_0x3fac9e[_0x813b('0x2f')]||undefined;this[_0x813b('0x30')]=_0x3fac9e[_0x813b('0x30')]||0x3;this[_0x813b('0x31')]=_0x3fac9e[_0x813b('0x31')]||0x96;this[_0x813b('0x32')]=_0x3fac9e['dialBusyMaxRetry']||0x3;this[_0x813b('0x33')]=_0x3fac9e[_0x813b('0x33')]||0x96;this[_0x813b('0x34')]=_0x3fac9e['dialNoAnswerMaxRetry']||0x3;this[_0x813b('0x35')]=_0x3fac9e[_0x813b('0x35')]||0x96;this[_0x813b('0x36')]=_0x3fac9e['dialNoSuchNumberMaxRetry']||0x3;this[_0x813b('0x37')]=_0x3fac9e[_0x813b('0x37')]||0x96;this['dialDropMaxRetry']=_0x3fac9e[_0x813b('0x38')]||0x3;this[_0x813b('0x39')]=_0x3fac9e[_0x813b('0x39')]||0x96;this[_0x813b('0x3a')]=_0x3fac9e[_0x813b('0x3a')]||0x3;this[_0x813b('0x3b')]=_0x3fac9e['dialAbandonedRetryFrequency']||0x96;this[_0x813b('0x3c')]=_0x3fac9e['dialMachineMaxRetry']||0x3;this[_0x813b('0x3d')]=_0x3fac9e[_0x813b('0x3d')]||0x96;this['dialAgentRejectMaxRetry']=_0x3fac9e[_0x813b('0x3e')]||0x3;this[_0x813b('0x3f')]=_0x3fac9e[_0x813b('0x3f')]||0x96;this['callAdditionalPhoneAfterMin']=_0x3fac9e['callAdditionalPhoneAfterMin']||0x3;this[_0x813b('0x40')]=_0x3fac9e[_0x813b('0x40')]||0x4;this['Trunk']=_0x3fac9e[_0x813b('0x41')]?_0x3fac9e['Trunk']:undefined;this['TrunkBackup']=_0x3fac9e[_0x813b('0x42')]?_0x3fac9e[_0x813b('0x42')]:undefined;this['dialPrefix']=_0x3fac9e['dialPrefix']||undefined;this[_0x813b('0x43')]=_0x3fac9e[_0x813b('0x43')]?_0x3fac9e[_0x813b('0x43')]:undefined;this[_0x813b('0x44')]=_0x3fac9e['dialOrderByScheduledAt']||_0x813b('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x3fac9e['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x3fac9e[_0x813b('0x46')]||undefined;this[_0x813b('0x47')]=strategy[_0x3fac9e[_0x813b('0x47')]]||'rrmemory';this[_0x813b('0x48')]=!![];this[_0x813b('0x49')]=_0x3fac9e['dialAMDActive']||![];this[_0x813b('0x4a')]=_0x3fac9e[_0x813b('0x4a')];this[_0x813b('0x4b')]=_0x3fac9e['dialAMDGreeting'];this[_0x813b('0x4c')]=_0x3fac9e[_0x813b('0x4c')];this[_0x813b('0x4d')]=_0x3fac9e['dialAMDTotalAnalysisTime'];this[_0x813b('0x4e')]=_0x3fac9e['dialAMDMinWordLength'];this[_0x813b('0x4f')]=_0x3fac9e[_0x813b('0x4f')];this[_0x813b('0x50')]=_0x3fac9e[_0x813b('0x50')];this['dialAMDSilenceThreshold']=_0x3fac9e[_0x813b('0x51')];this[_0x813b('0x52')]=_0x3fac9e[_0x813b('0x52')];this['outboundRejectCallsDay']=0x0;this[_0x813b('0x53')]=0x0;this[_0x813b('0x54')]=_0x3fac9e['timeout'];this[_0x813b('0x55')]=0x0;this[_0x813b('0x56')]=0x0;this[_0x813b('0x57')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x813b('0x58')]=0x0;this[_0x813b('0x59')]=0x0;this[_0x813b('0x5a')]=0x0;this[_0x813b('0x5b')]=0x0;this[_0x813b('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x813b('0x5d')]=0x0;this['outboundReCallsDay']=0x0;this[_0x813b('0x5e')]=0x0;this[_0x813b('0x5f')]=undefined;this[_0x813b('0x60')]=undefined;this['handlePredictive']=undefined;this[_0x813b('0x61')]=1.05;this[_0x813b('0x62')]=0x0;this[_0x813b('0x63')]=0x0;this[_0x813b('0x64')]=0x0;this[_0x813b('0x65')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x813b('0x66')]=0x0;this[_0x813b('0x67')]=_0x3fac9e['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x3fac9e[_0x813b('0x68')]||0xa;this[_0x813b('0x69')]=0x0;this[_0x813b('0x6a')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x813b('0x6b')]=0x0;this['erlangCallToSecond']=0x0;this[_0x813b('0x6c')]=0x0;this[_0x813b('0x6d')]=0x0;this[_0x813b('0x6e')]=_0x3fac9e[_0x813b('0x6e')]||0x1e;this['dialRecallInQueue']=_0x3fac9e[_0x813b('0x6f')]||![];this[_0x813b('0x70')]=!!_0x3fac9e[_0x813b('0x70')]||![];this['dialPreviewRecallmeReminder']=!!_0x3fac9e[_0x813b('0x71')]||![];this[_0x813b('0x72')]=_0x3fac9e['dialQueueProject2']||undefined;this[_0x813b('0x73')]=_0x3fac9e[_0x813b('0x73')]||![];this[_0x813b('0x74')]=_0x3fac9e[_0x813b('0x74')]||![];this[_0x813b('0xb')]=monitorFormat[_0x3fac9e[_0x813b('0xb')]]?monitorFormat[_0x3fac9e[_0x813b('0xb')]]:undefined;this['mandatoryDisposition']=_0x3fac9e[_0x813b('0x75')]||![];this[_0x813b('0x76')]=_0x3fac9e[_0x813b('0x76')]?_0x3fac9e[_0x813b('0x76')]:undefined;}module[_0x813b('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index efb5e10..af00346 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 _0x7f6a=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0xf40126,_0x1d8d16){var _0x769413=function(_0x1f90e0){while(--_0x1f90e0){_0xf40126['push'](_0xf40126['shift']());}};_0x769413(++_0x1d8d16);}(_0x7f6a,0x1eb));var _0xa7f6=function(_0x287324,_0x27c70f){_0x287324=_0x287324-0x0;var _0x594391=_0x7f6a[_0x287324];return _0x594391;};'use strict';function VtigerAccount(_0x547595){this['id']=_0x547595['id']||0x0;this[_0xa7f6('0x0')]=_0x547595['name']||'';this[_0xa7f6('0x1')]=_0x547595[_0xa7f6('0x1')]||'';this[_0xa7f6('0x2')]=_0x547595[_0xa7f6('0x2')]||'';this['remoteUri']=_0x547595[_0xa7f6('0x3')]||'';this[_0xa7f6('0x4')]=_0x547595[_0xa7f6('0x4')]||'';this[_0xa7f6('0x5')]=_0x547595[_0xa7f6('0x5')]||{};}module[_0xa7f6('0x6')]=VtigerAccount; \ No newline at end of file +var _0x19d2=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x5527b3,_0xd2c97c){var _0x5468c5=function(_0x2b0be6){while(--_0x2b0be6){_0x5527b3['push'](_0x5527b3['shift']());}};_0x5468c5(++_0xd2c97c);}(_0x19d2,0x1df));var _0x219d=function(_0x2145fa,_0x5bcbc5){_0x2145fa=_0x2145fa-0x0;var _0x24484e=_0x19d2[_0x2145fa];return _0x24484e;};'use strict';function VtigerAccount(_0x46c599){this['id']=_0x46c599['id']||0x0;this[_0x219d('0x0')]=_0x46c599['name']||'';this[_0x219d('0x1')]=_0x46c599[_0x219d('0x1')]||'';this['accessKey']=_0x46c599['accessKey']||'';this[_0x219d('0x2')]=_0x46c599['remoteUri']||'';this[_0x219d('0x3')]=_0x46c599[_0x219d('0x3')]||'';this['Configurations']=_0x46c599[_0x219d('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 4321b70..769cd03 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 _0x3af1=['serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x3037ee,_0x6c67eb){var _0x4aaa02=function(_0x54c9c8){while(--_0x54c9c8){_0x3037ee['push'](_0x3037ee['shift']());}};_0x4aaa02(++_0x6c67eb);}(_0x3af1,0x19a));var _0x13af=function(_0x493395,_0x3c34c4){_0x493395=_0x493395-0x0;var _0x4870c8=_0x3af1[_0x493395];return _0x4870c8;};'use strict';function ZendeskAccount(_0x19b669){this['id']=_0x19b669['id']||0x0;this[_0x13af('0x0')]=_0x19b669[_0x13af('0x0')]||'';this[_0x13af('0x1')]=_0x19b669[_0x13af('0x1')]||'';this['password']=_0x19b669[_0x13af('0x2')]||'';this[_0x13af('0x3')]=_0x19b669[_0x13af('0x3')]||'';this['remoteUri']=_0x19b669[_0x13af('0x4')]||'';this[_0x13af('0x5')]=_0x19b669[_0x13af('0x5')]||'';this[_0x13af('0x6')]=_0x19b669['type']||_0x13af('0x7');this[_0x13af('0x8')]=_0x19b669[_0x13af('0x8')]||'';this[_0x13af('0x9')]=_0x19b669[_0x13af('0x9')]||{};}module[_0x13af('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xa5a1=['name','username','password','token','remoteUri','type','serverUrl','Configurations','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa5a1,0x15f));var _0x1a5a=function(_0x176807,_0x137e37){_0x176807=_0x176807-0x0;var _0x26cd57=_0xa5a1[_0x176807];return _0x26cd57;};'use strict';function ZendeskAccount(_0xd8477c){this['id']=_0xd8477c['id']||0x0;this[_0x1a5a('0x0')]=_0xd8477c['name']||'';this[_0x1a5a('0x1')]=_0xd8477c[_0x1a5a('0x1')]||'';this[_0x1a5a('0x2')]=_0xd8477c[_0x1a5a('0x2')]||'';this[_0x1a5a('0x3')]=_0xd8477c[_0x1a5a('0x3')]||'';this['remoteUri']=_0xd8477c[_0x1a5a('0x4')]||'';this['authType']=_0xd8477c['authType']||'';this['type']=_0xd8477c[_0x1a5a('0x5')]||'integrationTab';this[_0x1a5a('0x6')]=_0xd8477c['serverUrl']||'';this[_0x1a5a('0x7')]=_0xd8477c[_0x1a5a('0x7')]||{};}module[_0x1a5a('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index b2f83f7..81c3104 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 _0x6a54=['clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId'];(function(_0x574b93,_0x441e43){var _0x15f0ff=function(_0x3ac349){while(--_0x3ac349){_0x574b93['push'](_0x574b93['shift']());}};_0x15f0ff(++_0x441e43);}(_0x6a54,0x7d));var _0x46a5=function(_0x54f69c,_0x3d62a3){_0x54f69c=_0x54f69c-0x0;var _0x468386=_0x6a54[_0x54f69c];return _0x468386;};'use strict';function ZohoAccount(_0x3cb709){this['id']=_0x3cb709['id']||0x0;this[_0x46a5('0x0')]=_0x3cb709['name']||'';this[_0x46a5('0x1')]=_0x3cb709[_0x46a5('0x1')]||'';this[_0x46a5('0x2')]=_0x3cb709[_0x46a5('0x2')]||'';this[_0x46a5('0x3')]=_0x3cb709[_0x46a5('0x3')]||'';this[_0x46a5('0x4')]=_0x3cb709[_0x46a5('0x4')]||'';this[_0x46a5('0x5')]=_0x3cb709[_0x46a5('0x5')]||'';this['serverUrl']=_0x3cb709[_0x46a5('0x6')]||'';this[_0x46a5('0x7')]=_0x3cb709['code']||'';this[_0x46a5('0x8')]=_0x3cb709[_0x46a5('0x8')]||'';this[_0x46a5('0x9')]=_0x3cb709[_0x46a5('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xa716=['Configurations','exports','name','description','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x4914ad,_0x551a18){var _0x3cd61f=function(_0x2a773e){while(--_0x2a773e){_0x4914ad['push'](_0x4914ad['shift']());}};_0x3cd61f(++_0x551a18);}(_0xa716,0x138));var _0x6a71=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa716[_0x19950b];return _0x3c6b41;};'use strict';function ZohoAccount(_0x324e6f){this['id']=_0x324e6f['id']||0x0;this['name']=_0x324e6f[_0x6a71('0x0')]||'';this[_0x6a71('0x1')]=_0x324e6f[_0x6a71('0x1')]||'';this['host']=_0x324e6f['host']||'';this[_0x6a71('0x2')]=_0x324e6f['zone']||'';this[_0x6a71('0x3')]=_0x324e6f[_0x6a71('0x3')]||'';this[_0x6a71('0x4')]=_0x324e6f[_0x6a71('0x4')]||'';this[_0x6a71('0x5')]=_0x324e6f[_0x6a71('0x5')]||'';this[_0x6a71('0x6')]=_0x324e6f['code']||'';this[_0x6a71('0x7')]=_0x324e6f[_0x6a71('0x7')]||'';this[_0x6a71('0x8')]=_0x324e6f['Configurations']||{};}module[_0x6a71('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 825c069..9dcdad0 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(_0x441b20,_0x39f9b5){var _0x2f6bd7=function(_0xc7b195){while(--_0xc7b195){_0x441b20['push'](_0x441b20['shift']());}};_0x2f6bd7(++_0x39f9b5);}(_0x4b17,0x10f));var _0x74b1=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x4b17[_0x4b2b03];return _0x1bf0ed;};'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 _0xfb11=['originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xfb11[_0x139a3c];return _0x2b375b;};'use strict';var util=require(_0x1fb1('0x0'));var _=require('lodash');var moment=require(_0x1fb1('0x1'));function checkNameSurname(_0x34e2d6,_0x51c055,_0x1461ad){var _0x5af9cc='';if(!_[_0x1fb1('0x2')](_0x51c055)&&'string'===typeof _0x51c055){_0x5af9cc+=_0x51c055;}if(!_[_0x1fb1('0x2')](_0x1461ad)&&_0x1fb1('0x3')===typeof _0x1461ad){_0x5af9cc+='\x20'+_0x1461ad;}if(_0x5af9cc!==''){return _0x5af9cc;}return _0x34e2d6;}function Action(_0x5af469,_0x25d44f,_0x133727,_0x4c098d,_0x1859da){this[_0x1fb1('0x4')]=_0x133727||undefined;this[_0x1fb1('0x5')]=_0x5af469['id'];this[_0x1fb1('0x6')]=_0x25d44f[_0x1fb1('0x7')];this[_0x1fb1('0x8')]=_0x25d44f[_0x1fb1('0x8')];this[_0x1fb1('0x9')]=_0x1fb1('0x6');this[_0x1fb1('0xa')]=![];this['membername']=_[_0x1fb1('0x2')](_0x5af469['Agent'])?undefined:_0x5af469[_0x1fb1('0xb')]['name'];this[_0x1fb1('0xc')]=this[_0x1fb1('0xd')]?util[_0x1fb1('0xe')](_0x1fb1('0xf'),this[_0x1fb1('0xd')]):_0x4c098d||undefined;this[_0x1fb1('0x10')]=checkNameSurname(_0x5af469['Contact'][_0x1fb1('0x11')],_0x5af469[_0x1fb1('0x12')][_0x1fb1('0x13')],_0x5af469[_0x1fb1('0x12')][_0x1fb1('0x14')]);this[_0x1fb1('0x15')]=_0x5af469[_0x1fb1('0x15')]||![];this[_0x1fb1('0x16')]=_0x5af469[_0x1fb1('0x11')];this['scheduledat']=_0x5af469['scheduledat'];this[_0x1fb1('0x17')]=_0x5af469[_0x1fb1('0x17')]||0x0;this[_0x1fb1('0x18')]=_0x5af469['countcongestionretry']||0x0;this[_0x1fb1('0x19')]=_0x5af469[_0x1fb1('0x19')]||0x0;this[_0x1fb1('0x1a')]=(_0x5af469[_0x1fb1('0x17')]||0x0)+(_0x5af469[_0x1fb1('0x18')]||0x0)+(_0x5af469[_0x1fb1('0x19')]||0x0)+(_0x5af469[_0x1fb1('0x1b')]||0x0)+(_0x5af469[_0x1fb1('0x1c')]||0x0)+(_0x5af469[_0x1fb1('0x1d')]||0x0)+(_0x5af469['countmachineretry']||0x0)+(_0x5af469[_0x1fb1('0x1e')]||0x0);this['countnosuchnumberretry']=_0x5af469['countnosuchnumberretry']||0x0;this[_0x1fb1('0x1c')]=_0x5af469[_0x1fb1('0x1c')]||0x0;this[_0x1fb1('0x1d')]=_0x5af469['countabandonedretry']||0x0;this[_0x1fb1('0x1f')]=_0x5af469['countmachineretry']||0x0;this['countagentrejectretry']=_0x5af469['countagentrejectretry']||0x0;this[_0x1fb1('0x20')]=_0x5af469[_0x1fb1('0x20')];this[_0x1fb1('0x21')]=_0x5af469[_0x1fb1('0x21')];this[_0x1fb1('0x22')]=_0x5af469['callbackat'];this[_0x1fb1('0x23')]=_0x5af469[_0x1fb1('0x23')];this[_0x1fb1('0x24')]=_0x5af469[_0x1fb1('0x24')];this[_0x1fb1('0x25')]=_0x5af469[_0x1fb1('0x25')];this[_0x1fb1('0x26')]=_[_0x1fb1('0x2')](_0x5af469['Agent'])?_0x5af469[_0x1fb1('0x26')]:_0x5af469[_0x1fb1('0xb')]['id'];this[_0x1fb1('0x27')]=_0x5af469[_0x1fb1('0x27')];this[_0x1fb1('0x28')]='';this[_0x1fb1('0x29')]='';}Action[_0x1fb1('0x2a')][_0x1fb1('0x2b')]=function(){return util[_0x1fb1('0xe')](_0x1fb1('0x2c'),this[_0x1fb1('0x10')],this[_0x1fb1('0x2d')]);};module[_0x1fb1('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index d90c62b..613f57b 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 _0x6c44=['[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','execRun','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variables','variablesAction','[originated][increment]','OriginateError','actionid','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','callProgressDetectingCustomer','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','filterKey','variable','addVariable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','lodash','moment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','name','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','pTalking','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','clockClearZombieChannels','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pick','contactId','UserId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','clearZombieChannel','recallMe','getContactRecallMe','agentReadyId','agents','length','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','catch','disableContact','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','logCustomer','createCustomerFinal','[getContactRecallMe]','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','additional','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','scheduledAt','swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','verifyAdditionalPhones','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','dialstatus','[callProgressDetectingCustomer][machine]'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x6c44,0x1be));var _0x46c4=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x6c44[_0xd1c39b];return _0x58f5bc;};'use strict';var util=require('util');var _=require(_0x46c4('0x0'));var uuid=require('uuid');var moment=require(_0x46c4('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x46c4('0x2'))(_0x46c4('0x3'));var loggerAction=require('../../../config/logger')(_0x46c4('0x4'));var ami=require(_0x46c4('0x5'));var rpcDb=require(_0x46c4('0x6'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x46c4('0x7'));var ut=require(_0x46c4('0x8'));config[_0x46c4('0x9')]=_[_0x46c4('0xa')](config[_0x46c4('0x9')],{'host':_0x46c4('0xb'),'port':0x18eb});var io=require(_0x46c4('0xc'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x46c4('0xd')]['enqueue']=function(_0x455823){this['tail']=this[_0x46c4('0xe')]?this[_0x46c4('0xe')][_0x46c4('0xf')](_0x455823):_0x455823();};function Preview(_0x514e45){this[_0x46c4('0x10')]=new Sequence();this[_0x46c4('0x11')]=_0x514e45[_0x46c4('0x12')];this[_0x46c4('0x13')]=_0x514e45[_0x46c4('0x13')];this[_0x46c4('0x14')]={};this['agents']=_0x514e45['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x46c4('0x15'),this[_0x46c4('0x16')][_0x46c4('0x17')](this));ami['on'](_0x46c4('0x18'),this[_0x46c4('0x19')]['bind'](this));ami['on']('hanguprequest',this[_0x46c4('0x1a')][_0x46c4('0x17')](this));ami['on'](_0x46c4('0x1b'),this['syncDialEnd']['bind'](this));ami['on']('newexten',this[_0x46c4('0x1c')][_0x46c4('0x17')](this));ami['on'](_0x46c4('0x1d'),this[_0x46c4('0x1e')]['bind'](this));ami['on']('attendedtransfer',this[_0x46c4('0x1f')][_0x46c4('0x17')](this));ami['on'](_0x46c4('0x20'),this['syncBlindTransfer'][_0x46c4('0x17')](this));this[_0x46c4('0x21')](this[_0x46c4('0x11')]);}function emit(_0x719d1b,_0x18c0e3,_0x3c8ab8){io['to'](_0x719d1b)[_0x46c4('0x22')](_0x18c0e3,_0x3c8ab8);}function emitCampaignPreview(_0x3b9873){if(_0x3b9873['type']==='outbound'){var _0x2b5f78={'id':_0x3b9873['id'],'name':_0x3b9873[_0x46c4('0x23')],'strategy':_0x3b9873['strategy'],'answered':_0x3b9873[_0x46c4('0x24')],'available':_0x3b9873[_0x46c4('0x25')],'loggedIn':_0x3b9873[_0x46c4('0x26')],'pTalking':_0x3b9873['pTalking'],'sumBillable':_0x3b9873[_0x46c4('0x27')],'sumDuration':_0x3b9873[_0x46c4('0x28')],'sumHoldTime':_0x3b9873[_0x46c4('0x29')]||0x0,'talking':_0x3b9873['talking'],'total':_0x3b9873[_0x46c4('0x2a')],'type':_0x3b9873[_0x46c4('0x2b')],'unmanaged':_0x3b9873[_0x46c4('0x2c')],'abandoned':_0x3b9873['abandoned'],'waiting':_0x3b9873[_0x46c4('0x2d')],'loggedInDb':_0x3b9873['loggedInDb'],'dialActive':_0x3b9873[_0x46c4('0x2e')],'dialMethod':_0x3b9873[_0x46c4('0x2f')],'dialOriginateCallerIdName':_0x3b9873[_0x46c4('0x30')],'dialOriginateCallerIdNumber':_0x3b9873[_0x46c4('0x31')],'dialOriginateTimeout':_0x3b9873[_0x46c4('0x32')],'dialPrefix':_0x3b9873[_0x46c4('0x33')],'outboundAnswerAgiCallsDay':_0x3b9873['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3b9873['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3b9873['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3b9873[_0x46c4('0x34')],'outboundCongestionCallsDay':_0x3b9873[_0x46c4('0x35')],'outboundDropCallsDayACS':_0x3b9873[_0x46c4('0x36')],'outboundDropCallsDayCallersExit':_0x3b9873['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3b9873[_0x46c4('0x37')],'outboundNoAnswerCallsDay':_0x3b9873['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3b9873[_0x46c4('0x38')],'outboundOriginateFailureCallsDay':_0x3b9873[_0x46c4('0x39')],'outboundReCallsDay':_0x3b9873[_0x46c4('0x3a')],'outboundRejectCallsDay':_0x3b9873[_0x46c4('0x3b')],'outboundUnknownCallsDay':_0x3b9873['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x3b9873[_0x46c4('0x3c')],'predictiveIntervalAnsweredCalls':_0x3b9873[_0x46c4('0x3d')],'predictiveIntervalAvgHoldtime':_0x3b9873[_0x46c4('0x3e')],'predictiveIntervalAvgTalktime':_0x3b9873['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3b9873[_0x46c4('0x3f')],'predictiveIntervalDroppedCallsTimeout':_0x3b9873[_0x46c4('0x40')],'predictiveIntervalErlangCalls':_0x3b9873[_0x46c4('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x3b9873[_0x46c4('0x42')],'predictiveIntervalHitRate':_0x3b9873['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3b9873['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3b9873[_0x46c4('0x43')],'predictiveIntervalAvailable':_0x3b9873[_0x46c4('0x44')],'predictiveIntervalTotalCalls':_0x3b9873['predictiveIntervalTotalCalls'],'message':_0x3b9873['message'],'originated':_0x3b9873[_0x46c4('0x45')],'erlangCalls':_0x3b9873['erlangCalls'],'erlangCallToSecond':_0x3b9873['erlangCallToSecond'],'erlangAbandonmentRate':_0x3b9873[_0x46c4('0x46')],'erlangBusyFactor':_0x3b9873[_0x46c4('0x47')],'startPredictive':_0x3b9873['startPredictive'],'startProgressive':_0x3b9873[_0x46c4('0x48')]};if(_0x3b9873[_0x46c4('0x49')]){_0x2b5f78[_0x46c4('0x49')]={'id':_0x3b9873[_0x46c4('0x49')]['id'],'name':_0x3b9873[_0x46c4('0x49')][_0x46c4('0x23')],'active':_0x3b9873['Trunk']['active'],'callerid':_0x3b9873['Trunk']['callerid']};}if(_0x3b9873[_0x46c4('0x4a')]){_0x2b5f78[_0x46c4('0x4a')]={'id':_0x3b9873['Interval']['id'],'name':_0x3b9873[_0x46c4('0x4a')]['name']};}var _0x485659=md5(JSON[_0x46c4('0x4b')](_0x2b5f78));if(_0x3b9873[_0x46c4('0x4c')]!==_0x485659){_0x3b9873[_0x46c4('0x4c')]=_0x485659;emit(util[_0x46c4('0x4d')](_0x46c4('0x4e'),_0x2b5f78[_0x46c4('0x23')]),_0x46c4('0x4f'),_0x2b5f78);}}}function emitVoiceQueueChannelRemove(_0x59f9cc){logger[_0x46c4('0x50')](_0x46c4('0x51'),JSON[_0x46c4('0x4b')](_0x59f9cc));emit(util[_0x46c4('0x4d')](_0x46c4('0x4e'),_0x59f9cc['name']),_0x46c4('0x52'),_0x59f9cc);io[_0x46c4('0x22')](_0x46c4('0x53'),_0x59f9cc);}function notSendMessagesQueue(_0x28225d){if(_0x28225d['sendMessageOneNotActive']){if(_0x28225d[_0x46c4('0x45')]===0x0&&_0x28225d[_0x46c4('0x54')]===0x0){_0x28225d[_0x46c4('0x55')]=![];_0x28225d[_0x46c4('0x25')]=0x0;_0x28225d[_0x46c4('0x56')]=0x0;_0x28225d[_0x46c4('0x57')]=_0x46c4('0x58');ut[_0x46c4('0x59')](_0x46c4('0x5a'),_0x28225d[_0x46c4('0x23')]+_0x46c4('0x5b'));}else{_0x28225d['message']=_0x46c4('0x5c');ut[_0x46c4('0x59')](_0x46c4('0x5a'),_0x28225d[_0x46c4('0x23')]+_0x46c4('0x5d'));}emitCampaignPreview(_0x28225d);}}Preview['prototype'][_0x46c4('0x21')]=function(){var _0x13c098=this;setInterval(function(){_0x13c098[_0x46c4('0x5e')]();},0x7cf);};Preview[_0x46c4('0xd')][_0x46c4('0x5e')]=function(){var _0x4c05cf=this[_0x46c4('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x13a1ed in _0x4c05cf){if(_0x4c05cf[_0x46c4('0x5f')](_0x13a1ed)&&(_0x4c05cf[_0x13a1ed][_0x46c4('0x2f')]==='preview'||_0x4c05cf[_0x13a1ed]['dialMethod']==='booked')&&_0x4c05cf[_0x13a1ed][_0x46c4('0x2b')]==='outbound'){if(this[_0x46c4('0x60')]>0x7){this[_0x46c4('0x60')]=0x0;this[_0x46c4('0x61')]();}}if(_0x4c05cf['hasOwnProperty'](_0x13a1ed)&&_0x4c05cf[_0x13a1ed][_0x46c4('0x2f')]==='preview'&&_0x4c05cf[_0x13a1ed][_0x46c4('0x2b')]==='outbound'){if(_0x4c05cf[_0x13a1ed]['dialActive']){this[_0x46c4('0x62')](_0x4c05cf[_0x13a1ed]);if(_0x4c05cf[_0x13a1ed][_0x46c4('0x63')])this['recallMe'](_0x4c05cf[_0x13a1ed]);}else{notSendMessagesQueue(_0x4c05cf[_0x13a1ed]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x54d250){var _0x1cf9bb=this;this['sequence'][_0x46c4('0x64')](function(){if(!_[_0x46c4('0x65')](_0x1cf9bb[_0x46c4('0x14')][_0x54d250])){loggerAction[_0x46c4('0x50')](_0x46c4('0x66'),_0x54d250,_0x46c4('0x67'),_0x1cf9bb[_0x46c4('0x14')][_0x54d250][_0x46c4('0x68')],_0x46c4('0x69'),JSON[_0x46c4('0x4b')](_0x1cf9bb[_0x46c4('0x11')][_0x1cf9bb[_0x46c4('0x14')][_0x54d250][_0x46c4('0x68')]][_0x46c4('0x45')]),'pTalking:\x20',JSON[_0x46c4('0x4b')](_0x1cf9bb[_0x46c4('0x11')][_0x1cf9bb[_0x46c4('0x14')][_0x54d250]['queue']][_0x46c4('0x54')]),JSON[_0x46c4('0x4b')](_0x1cf9bb[_0x46c4('0x14')][_0x54d250]['dialAnswer']),JSON[_0x46c4('0x4b')](_[_0x46c4('0x6a')](_0x1cf9bb[_0x46c4('0x14')][_0x54d250],[_0x46c4('0x6b'),_0x46c4('0x6c'),'VoiceQueueId',_0x46c4('0x6d')])));return ami[_0x46c4('0x6e')]({'action':_0x46c4('0x6f'),'channel':_0x1cf9bb[_0x46c4('0x14')][_0x54d250][_0x46c4('0x70')]})['catch'](function(_0x5860ef){if(_0x5860ef['message']===_0x46c4('0x71')){setTimeout(function(){if(_0x1cf9bb[_0x46c4('0x14')][_0x54d250]){ut[_0x46c4('0x72')](_0x1cf9bb[_0x46c4('0x11')][_0x1cf9bb[_0x46c4('0x14')][_0x54d250][_0x46c4('0x68')]],_0x46c4('0x73'));if(_0x1cf9bb[_0x46c4('0x14')][_0x54d250][_0x46c4('0x74')]===!![]){ut[_0x46c4('0x75')](_0x1cf9bb[_0x46c4('0x11')][_0x1cf9bb[_0x46c4('0x14')][_0x54d250][_0x46c4('0x68')]],_0x46c4('0x73'));ut[_0x46c4('0x76')](_0x46c4('0x77')+_0x54d250,_0x1cf9bb['actions'][_0x54d250][_0x46c4('0x68')]);}ut[_0x46c4('0x76')](_0x46c4('0x78')+_0x54d250,_0x1cf9bb[_0x46c4('0x14')][_0x54d250][_0x46c4('0x68')]);delete _0x1cf9bb[_0x46c4('0x14')][_0x54d250];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x46b48a=this;loggerAction[_0x46c4('0x50')]('[action]',_[_0x46c4('0x79')](this[_0x46c4('0x14')]));for(var _0x46a82c in this[_0x46c4('0x14')]){if(_0x46b48a['actions']['hasOwnProperty'](_0x46a82c)){_0x46b48a[_0x46c4('0x7a')](_0x46a82c);}}};Preview[_0x46c4('0xd')][_0x46c4('0x7b')]=function(_0x5d8206){var _0x45a616=this;rpcDb[_0x46c4('0x7c')](_0x5d8206['id'],ut[_0x46c4('0x7d')](this[_0x46c4('0x7e')]))['then'](function(_0x4ae676){if(!_['isNil'](_0x4ae676)){for(var _0x15f9f9=0x0;_0x15f9f9<_0x4ae676[_0x46c4('0x7f')];_0x15f9f9+=0x1){if(ut['getDiff'](_0x4ae676[_0x15f9f9][_0x46c4('0x80')])<_0x5d8206[_0x46c4('0x81')]*0x3c){if(_0x4ae676[_0x15f9f9]['Agent']&&!_0x4ae676[_0x15f9f9][_0x46c4('0x82')]['voicePause']){_0x45a616[_0x46c4('0x83')](_0x4ae676[_0x15f9f9]['id'])[_0x46c4('0x84')](ut[_0x46c4('0x85')](_0x46c4('0x86')))[_0x46c4('0x87')](ut[_0x46c4('0x85')](_0x46c4('0x86')));}else{rpcDb[_0x46c4('0x88')](_0x4ae676[_0x15f9f9]['id']);}}else{var _0x2d856b=new Action(_0x4ae676[_0x15f9f9],_0x5d8206);_0x2d856b['starttime']=moment()[_0x46c4('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d8206[_0x46c4('0x3a')]+=0x1;ut['logCustomer'](_0x2d856b,0x17,_0x46c4('0x89'));if(_0x5d8206['dialRecallInQueue']){rpcDb[_0x46c4('0x8a')](ut[_0x46c4('0x8b')](_0x4ae676[_0x15f9f9]));rpcDb[_0x46c4('0x8c')](_0x2d856b,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x46c4('0x8d')](_0x2d856b,0x16,'RecallFailedTimeout');rpcDb[_0x46c4('0x8c')](_0x2d856b,'[HistoryRecallClose]');rpcDb[_0x46c4('0x8e')](_0x2d856b,'[HistoryRecallClose]');}}}}})[_0x46c4('0x87')](ut['logger2'](_0x46c4('0x8f')));};Preview['prototype'][_0x46c4('0x62')]=function(_0x5a44dc){_0x5a44dc['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x5a44dc[_0x46c4('0x26')])){_0x5a44dc[_0x46c4('0x57')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x46c4('0x90')](_0x5a44dc[_0x46c4('0x2e')])){_0x5a44dc[_0x46c4('0x57')]=_0x46c4('0x58');}else if(!this[_0x46c4('0x91')](_0x5a44dc[_0x46c4('0x49')])){if(!this[_0x46c4('0x91')](_0x5a44dc[_0x46c4('0x92')])){_0x5a44dc[_0x46c4('0x57')]=_0x46c4('0x93');}else{_0x5a44dc[_0x46c4('0x57')]='ACTIVE';}}else{_0x5a44dc[_0x46c4('0x57')]=_0x46c4('0x94');}emitCampaignPreview(_0x5a44dc);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x2c9730,_0x2a2f39,_0x30c030){var _0x5cb14d=this;var _0x5c7dbd=this[_0x46c4('0x14')][_0x2a2f39];var _0x3a0deb=this['campaignsPreview'][_0x5c7dbd[_0x46c4('0x68')]];var _0x4be12a;var _0x81e8f2=![];var _0x3843c4=0x2;var _0x3f890d=0x3;if(_0x3a0deb){switch(_0x30c030){case'1':_0x3a0deb[_0x46c4('0x38')]+=0x1;_0x5c7dbd[_0x46c4('0x95')]+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut[_0x46c4('0x97')](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0x0,'NoSuchNumber');ami['emit'](_0x46c4('0x98'),ut[_0x46c4('0x99')](_0x5c7dbd,'nosuchnumber'));rpcDb[_0x46c4('0x8c')](_0x5c7dbd,_0x46c4('0x9a'));_0x5cb14d['verifyAdditionalPhones'](_0x5c7dbd,'0',_0x3a0deb)[_0x46c4('0x84')](function(_0x2d1fd3){_0x81e8f2=_0x2d1fd3[_0x46c4('0x9b')]==0x1;_0x3843c4=_0x3a0deb['dialNoSuchNumberRetryFrequency'];_0x3f890d=_0x3a0deb['callAdditionalPhoneAfterMin'];if(!_0x81e8f2){if(ut[_0x46c4('0x97')](_0x5c7dbd)>=_0x3a0deb[_0x46c4('0x9c')]){_0x4be12a=ut[_0x46c4('0x9d')](_0x5c7dbd,0xf,_0x46c4('0x9e'));rpcDb['createCustomerFinal'](_0x4be12a,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x5c7dbd[_0x46c4('0x95')]>=_0x3a0deb[_0x46c4('0x9f')]){rpcDb[_0x46c4('0x8e')](_0x5c7dbd,_0x46c4('0xa0'));}else{rpcDb[_0x46c4('0xa1')](ut['scheduledAt'](_0x5c7dbd,'countnosuchnumberretry',_0x3a0deb[_0x46c4('0xa2')]),_0x5c7dbd[_0x46c4('0xa3')],_0x5c7dbd[_0x46c4('0xa4')]);}}delete this[_0x46c4('0x14')][_0x2c9730['linkedid']];}else{_0x5c7dbd['countnosuchnumberretry']++;logger[_0x46c4('0x50')](_0x46c4('0xa5'),_0x5c7dbd[_0x46c4('0x95')]);logger['info']('id',_0x5c7dbd[_0x46c4('0xa6')]);_0x5cb14d[_0x46c4('0xa7')]({'id':_0x5c7dbd['idContact'],'field':{'countnosuchnumberretry':_0x5c7dbd[_0x46c4('0x95')]}})[_0x46c4('0x84')](function(){_0x5cb14d['swapAdditionalPhones'](_0x5c7dbd,_0x3843c4,_0x3f890d)[_0x46c4('0x84')](function(){});});}});break;case'ANSWER':var _0x90c30=moment()[_0x46c4('0x4d')](_0x46c4('0xa8'));_0x5c7dbd[_0x46c4('0xa9')]=_0x90c30;_0x5c7dbd['answertime']=_0x90c30;_0x5c7dbd[_0x46c4('0x74')]=!![];_0x3a0deb[_0x46c4('0x54')]+=0x1;logger['info'](_0x46c4('0xaa'),_0x5c7dbd[_0x46c4('0xab')],_0x46c4('0xac'),_0x3a0deb[_0x46c4('0x23')],_0x46c4('0xad'),_0x3a0deb[_0x46c4('0x54')]);ami[_0x46c4('0x22')](_0x46c4('0xae'),ut['buildObj'](_0x5c7dbd,_0x46c4('0xaf'),this[_0x46c4('0x11')][_0x5c7dbd[_0x46c4('0x68')]]));if(_0x3a0deb[_0x46c4('0xb0')]){ami[_0x46c4('0x22')](_0x46c4('0xb1'),ut[_0x46c4('0xb2')](_0x5c7dbd));}break;case'16':ami[_0x46c4('0x22')](_0x46c4('0xb3'),ut[_0x46c4('0x99')](_0x5c7dbd,_0x46c4('0xb4'),this['campaignsPreview'][_0x5c7dbd['queue']]));emitVoiceQueueChannelRemove(ut[_0x46c4('0x99')](_0x5c7dbd,'complete'));_0x3a0deb[_0x46c4('0xb5')]+=0x1;_0x3a0deb[_0x46c4('0x2a')]+=0x1;_0x3a0deb[_0x46c4('0x24')]+=0x1;ut[_0x46c4('0x75')](_0x3a0deb,_0x46c4('0xb6'));_0x5c7dbd[_0x46c4('0x96')]=ut['totalGlobal'](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0x4,_0x46c4('0xb7'));rpcDb[_0x46c4('0x8c')](_0x5c7dbd,_0x46c4('0xb8'));rpcDb[_0x46c4('0x8e')](_0x5c7dbd,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x46c4('0xb9')](_0x5c7dbd);_0x3a0deb[_0x46c4('0x28')]+=_0x5c7dbd['talktime'];_0x3a0deb['sumBillable']+=_0x5c7dbd[_0x46c4('0xba')];logger[_0x46c4('0x50')](_0x46c4('0xbb'),_0x5c7dbd['uniqueid'],'\x20Queue',_0x3a0deb[_0x46c4('0x23')],_0x46c4('0xad'),_0x3a0deb[_0x46c4('0x54')]);delete this[_0x46c4('0x14')][_0x2c9730[_0x46c4('0xbc')]];break;case _0x46c4('0xbd'):_0x3a0deb[_0x46c4('0x34')]+=0x1;_0x5c7dbd[_0x46c4('0xbe')]+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut['totalGlobal'](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0x5,'Busy');_0x3843c4=_0x3a0deb[_0x46c4('0xbf')];_0x3f890d=_0x3a0deb[_0x46c4('0xc0')];ami[_0x46c4('0x22')](_0x46c4('0xc1'),ut[_0x46c4('0x99')](_0x5c7dbd,_0x46c4('0xc2')));rpcDb[_0x46c4('0x8c')](_0x5c7dbd,_0x46c4('0xc3'));_0x5cb14d['verifyAdditionalPhones'](_0x5c7dbd,'5',_0x3a0deb)[_0x46c4('0x84')](function(_0x2dff58){_0x81e8f2=_0x2dff58[_0x46c4('0x9b')]==0x1;if(!_0x81e8f2){if(ut[_0x46c4('0x97')](_0x5c7dbd)>=_0x3a0deb[_0x46c4('0x9c')]){_0x4be12a=ut[_0x46c4('0x9d')](_0x5c7dbd,0xf,_0x46c4('0x9e'));rpcDb[_0x46c4('0x8e')](_0x4be12a,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5c7dbd[_0x46c4('0xbe')]>=_0x3a0deb['dialBusyMaxRetry']){rpcDb[_0x46c4('0x8e')](_0x5c7dbd,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x46c4('0xa1')](ut[_0x46c4('0xc4')](_0x5c7dbd,_0x46c4('0xbe'),_0x3a0deb[_0x46c4('0xbf')]),_0x5c7dbd['unlockAgent'],_0x5c7dbd[_0x46c4('0xa4')]);}}}else{_0x5c7dbd[_0x46c4('0xbe')]++;_0x5cb14d['incrementPreviewCounters']({'id':_0x5c7dbd[_0x46c4('0xa6')],'field':{'countbusyretry':_0x5c7dbd['countbusyretry']}})['then'](function(){_0x5cb14d[_0x46c4('0xc5')](_0x5c7dbd,_0x3843c4,_0x3f890d)['then'](function(){});});}});break;case _0x46c4('0xc6'):_0x3a0deb[_0x46c4('0xc7')]+=0x1;_0x5c7dbd[_0x46c4('0xc8')]+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut[_0x46c4('0x97')](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0x3,_0x46c4('0xc9'));_0x3843c4=_0x3a0deb[_0x46c4('0xca')];_0x3f890d=_0x3a0deb[_0x46c4('0xc0')];var _0x4fee08=ut[_0x46c4('0xcb')](_0x5c7dbd,_0x3a0deb);ami[_0x46c4('0x22')](_0x46c4('0xcc'),_0x4fee08);rpcDb['createCustomerHistory'](_0x5c7dbd,'[callProgressDetectingCustomer][logNoAnswer]');_0x5cb14d[_0x46c4('0xcd')](_0x5c7dbd,'3',_0x3a0deb)[_0x46c4('0x84')](function(_0x4e4758){_0x81e8f2=_0x4e4758[_0x46c4('0x9b')]==0x1;if(!_0x81e8f2){if(ut['totalGlobal'](_0x5c7dbd)>=_0x3a0deb['dialGlobalMaxRetry']){_0x4be12a=ut[_0x46c4('0x9d')](_0x5c7dbd,0xf,_0x46c4('0x9e'));rpcDb[_0x46c4('0x8e')](_0x4be12a,_0x46c4('0xce'));}else{if(_0x5c7dbd[_0x46c4('0xc8')]>=_0x3a0deb[_0x46c4('0xcf')]){rpcDb['createCustomerFinal'](_0x5c7dbd,_0x46c4('0xd0'));}else{rpcDb[_0x46c4('0xa1')](ut[_0x46c4('0xc4')](_0x5c7dbd,_0x46c4('0xc8'),_0x3a0deb['dialNoAnswerRetryFrequency']),_0x5c7dbd[_0x46c4('0xa3')],_0x5c7dbd[_0x46c4('0xa4')]);}}}else{_0x5c7dbd[_0x46c4('0xc8')]++;_0x5cb14d[_0x46c4('0xa7')]({'id':_0x5c7dbd[_0x46c4('0xa6')],'field':{'countnoanswerretry':_0x5c7dbd[_0x46c4('0xc8')]}})[_0x46c4('0x84')](function(){_0x5cb14d['swapAdditionalPhones'](_0x5c7dbd,_0x3843c4,_0x3f890d)[_0x46c4('0x84')](function(){});});}});break;case'CONGESTION':_0x3a0deb[_0x46c4('0x35')]+=0x1;_0x5c7dbd[_0x46c4('0xd1')]+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut[_0x46c4('0x97')](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0x8,_0x46c4('0xd2'));_0x3843c4=_0x3a0deb[_0x46c4('0xd3')];_0x3f890d=_0x3a0deb['callAdditionalPhoneAfterMin'];ami[_0x46c4('0x22')](_0x46c4('0xd4'),ut[_0x46c4('0x99')](_0x5c7dbd,_0x46c4('0xd5')));rpcDb['createCustomerHistory'](_0x5c7dbd,_0x46c4('0xd6'));_0x5cb14d[_0x46c4('0xcd')](_0x5c7dbd,'8',_0x3a0deb)['then'](function(_0x431598){_0x81e8f2=_0x431598[_0x46c4('0x9b')]==0x1;if(!_0x81e8f2){if(ut[_0x46c4('0x97')](_0x5c7dbd)>=_0x3a0deb[_0x46c4('0x9c')]){_0x4be12a=ut[_0x46c4('0x9d')](_0x5c7dbd,0xf,'Global');rpcDb['createCustomerFinal'](_0x4be12a,_0x46c4('0xd7'));}else{if(_0x5c7dbd[_0x46c4('0xd1')]>=_0x3a0deb[_0x46c4('0xd8')]){rpcDb['createCustomerFinal'](_0x5c7dbd,_0x46c4('0xd6'));}else{rpcDb[_0x46c4('0xa1')](ut[_0x46c4('0xc4')](_0x5c7dbd,'countcongestionretry',_0x3a0deb[_0x46c4('0xbf')]),_0x5c7dbd[_0x46c4('0xa3')],_0x5c7dbd[_0x46c4('0xa4')]);}}}else{_0x5c7dbd[_0x46c4('0xd1')]++;_0x5cb14d['incrementPreviewCounters']({'id':_0x5c7dbd['idContact'],'field':{'countcongestionretry':_0x5c7dbd[_0x46c4('0xd1')]}})['then'](function(){_0x5cb14d['swapAdditionalPhones'](_0x5c7dbd,_0x3843c4,_0x3f890d)[_0x46c4('0x84')](function(){});});}});break;case _0x46c4('0xd9'):_0x3a0deb[_0x46c4('0x3b')]+=0x1;_0x5c7dbd['countagentrejectretry']+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut['totalGlobal'](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0x14,'AgentReject');_0x3843c4=_0x3a0deb[_0x46c4('0xda')];_0x3f890d=_0x3a0deb[_0x46c4('0xc0')];ami[_0x46c4('0x22')](_0x46c4('0xdb'),ut[_0x46c4('0x99')](_0x5c7dbd,_0x46c4('0xdc')));rpcDb[_0x46c4('0x8c')](_0x5c7dbd,_0x46c4('0xdd'));_0x5cb14d[_0x46c4('0xcd')](_0x5c7dbd,'20',_0x3a0deb)['then'](function(_0x3e93dc){_0x81e8f2=_0x3e93dc['additional']==0x1;if(!_0x81e8f2){if(ut[_0x46c4('0x97')](_0x5c7dbd)>=_0x3a0deb[_0x46c4('0x9c')]){_0x4be12a=ut[_0x46c4('0x9d')](_0x5c7dbd,0x14,_0x46c4('0xde'));rpcDb[_0x46c4('0x8e')](_0x4be12a,_0x46c4('0xdf'));}else{if(_0x5c7dbd[_0x46c4('0xe0')]>=_0x3a0deb[_0x46c4('0xe1')]){rpcDb[_0x46c4('0x8e')](_0x5c7dbd,_0x46c4('0xdf'));}else{rpcDb[_0x46c4('0xa1')](ut[_0x46c4('0xc4')](_0x5c7dbd,_0x46c4('0xe0'),_0x3a0deb[_0x46c4('0xda')]),_0x5c7dbd[_0x46c4('0xa3')],_0x5c7dbd[_0x46c4('0xa4')]);}}}else{_0x5c7dbd['countnoanswerretry']++;_0x5cb14d[_0x46c4('0xa7')]({'id':_0x5c7dbd[_0x46c4('0xa6')],'field':{'countnoanswerretry':_0x5c7dbd[_0x46c4('0xc8')]}})[_0x46c4('0x84')](function(){_0x5cb14d['swapAdditionalPhones'](_0x5c7dbd,_0x3843c4,_0x3f890d)[_0x46c4('0x84')](function(){});});}});break;case'ABANDONED':_0x3a0deb[_0x46c4('0x3c')]+=0x1;_0x5c7dbd[_0x46c4('0xe2')]+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut[_0x46c4('0x97')](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0xb,'Abandoned');rpcDb[_0x46c4('0x8c')](_0x5c7dbd,'[callProgressDetectingCustomer][logAbandoned]');_0x5cb14d[_0x46c4('0xcd')](_0x5c7dbd,'11',_0x3a0deb)['then'](function(_0x9814db){_0x81e8f2=_0x9814db['additional']==0x1;if(!_0x81e8f2){if(ut['totalGlobal'](_0x5c7dbd)>=_0x3a0deb[_0x46c4('0x9c')]){_0x4be12a=ut[_0x46c4('0x9d')](_0x5c7dbd,0xf,'Global');rpcDb[_0x46c4('0x8e')](_0x4be12a,_0x46c4('0xe3'));}else{if(_0x5c7dbd[_0x46c4('0xe4')]>=_0x3a0deb[_0x46c4('0xe5')]){rpcDb['createCustomerFinal'](_0x5c7dbd,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x46c4('0xa1')](ut['scheduledAt'](_0x5c7dbd,_0x46c4('0xe2'),_0x3a0deb[_0x46c4('0xe6')]),_0x5c7dbd[_0x46c4('0xa3')],_0x5c7dbd[_0x46c4('0xa4')]);}}}else{_0x5c7dbd[_0x46c4('0xc8')]++;_0x5cb14d[_0x46c4('0xa7')]({'id':_0x5c7dbd['idContact'],'field':{'countnoanswerretry':_0x5c7dbd[_0x46c4('0xc8')]}})[_0x46c4('0x84')](function(){_0x5cb14d[_0x46c4('0xc5')](_0x5c7dbd,_0x3843c4,_0x3f890d)[_0x46c4('0x84')](function(){});});}});break;case'18':_0x3a0deb[_0x46c4('0xe7')]+=0x1;_0x5c7dbd['countmachineretry']+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut[_0x46c4('0x97')](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0x12,_0x2c9730['cause-txt']||_0x2c9730['dialstatus']);ami[_0x46c4('0x22')](_0x46c4('0xe8'),ut[_0x46c4('0x99')](_0x5c7dbd,_0x46c4('0xe9')));rpcDb[_0x46c4('0x8c')](_0x5c7dbd,'[callProgressDetectingCustomer][hangupInAMD]');_0x5cb14d['verifyAdditionalPhones'](_0x5c7dbd,'18',_0x3a0deb)[_0x46c4('0x84')](function(_0x475948){_0x81e8f2=_0x475948[_0x46c4('0x9b')]==0x1;if(!_0x81e8f2){if(ut['totalGlobal'](_0x5c7dbd)>=_0x3a0deb[_0x46c4('0x9c')]){_0x4be12a=ut['cloneAction'](_0x5c7dbd,0x12,_0x46c4('0x9e'));rpcDb[_0x46c4('0x8e')](_0x4be12a,_0x46c4('0xea'));}else{rpcDb[_0x46c4('0x8e')](_0x5c7dbd,_0x46c4('0xea'));}}else{_0x5c7dbd['countnoanswerretry']++;_0x5cb14d[_0x46c4('0xa7')]({'id':_0x5c7dbd['idContact'],'field':{'countnoanswerretry':_0x5c7dbd[_0x46c4('0xc8')]}})[_0x46c4('0x84')](function(){_0x5cb14d[_0x46c4('0xc5')](_0x5c7dbd,_0x3843c4,_0x3f890d)[_0x46c4('0x84')](function(){});});}});delete this[_0x46c4('0x14')][_0x2c9730[_0x46c4('0xbc')]];break;case'19':_0x3a0deb[_0x46c4('0xe7')]+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut[_0x46c4('0x97')](_0x5c7dbd);ut[_0x46c4('0x8d')](_0x5c7dbd,0x13,_0x2c9730[_0x46c4('0xeb')]||_0x2c9730[_0x46c4('0xec')]);ami['emit'](_0x46c4('0xe8'),ut[_0x46c4('0x99')](_0x5c7dbd,'amd'));rpcDb[_0x46c4('0x8c')](_0x5c7dbd,_0x46c4('0xed'));_0x5cb14d[_0x46c4('0xcd')](_0x5c7dbd,'18',_0x3a0deb)[_0x46c4('0x84')](function(_0x13dc51){_0x81e8f2=_0x13dc51[_0x46c4('0x9b')]==0x1;if(!_0x81e8f2){if(ut['totalGlobal'](_0x5c7dbd)>=_0x3a0deb[_0x46c4('0x9c')]){_0x4be12a=ut[_0x46c4('0x9d')](_0x5c7dbd,0xf,_0x46c4('0x9e'));rpcDb[_0x46c4('0x8e')](_0x4be12a,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x46c4('0x8e')](_0x5c7dbd,_0x46c4('0xed'));}}else{_0x5c7dbd[_0x46c4('0xc8')]++;_0x5cb14d[_0x46c4('0xa7')]({'id':_0x5c7dbd[_0x46c4('0xa6')],'field':{'countnoanswerretry':_0x5c7dbd[_0x46c4('0xc8')]}})[_0x46c4('0x84')](function(){_0x5cb14d['swapAdditionalPhones'](_0x5c7dbd,_0x3843c4,_0x3f890d)[_0x46c4('0x84')](function(){});});}});delete this['actions'][_0x2c9730[_0x46c4('0xbc')]];break;default:if(_0x5c7dbd[_0x46c4('0x74')]){ut[_0x46c4('0x75')](_0x3a0deb,_0x46c4('0xee'));ut['loggerError'](_0x46c4('0xef')+_0x3a0deb['name'],_0x2c9730);}_0x3a0deb[_0x46c4('0xe7')]+=0x1;_0x5c7dbd[_0x46c4('0x96')]=ut[_0x46c4('0x97')](_0x5c7dbd);ut['logCustomer'](_0x5c7dbd,0xc,_0x2c9730[_0x46c4('0xeb')]||_0x2c9730[_0x46c4('0xec')]);_0x3843c4=_0x3a0deb[_0x46c4('0xda')];_0x3f890d=_0x3a0deb[_0x46c4('0xc0')];rpcDb['createCustomerHistory'](_0x5c7dbd,_0x46c4('0xf0'));_0x5cb14d[_0x46c4('0xcd')](_0x5c7dbd,'20',_0x3a0deb)['then'](function(_0x356e64){_0x81e8f2=_0x356e64['additional']==0x1;if(!_0x81e8f2){if(ut[_0x46c4('0x97')](_0x5c7dbd)>=_0x3a0deb['dialGlobalMaxRetry']){_0x4be12a=ut[_0x46c4('0x9d')](_0x5c7dbd,0xf,_0x46c4('0x9e'));rpcDb[_0x46c4('0x8e')](_0x4be12a,_0x46c4('0xf1'));}else{rpcDb[_0x46c4('0x8e')](_0x5c7dbd,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x46c4('0x14')][_0x2c9730[_0x46c4('0xbc')]];}else{_0x5cb14d['swapAdditionalPhones'](_0x5c7dbd,_0x3843c4,_0x3f890d)[_0x46c4('0x84')](function(){});}});}if(!(_0x5c7dbd['dialAnswer']&&_0x30c030==='16')){ut[_0x46c4('0x72')](_0x3a0deb,_0x46c4('0xf2'));logger['info'](_0x46c4('0xf3'),_0x5c7dbd['uniqueid'],_0x46c4('0xac'),_0x3a0deb['name'],_0x46c4('0x69'),_0x3a0deb['originated']);}if(_0x30c030!=='ANSWER'){delete this['actions'][_0x2c9730[_0x46c4('0xbc')]];delete this[_0x46c4('0x14')][_0x2c9730[_0x46c4('0xf4')]];}}};Preview[_0x46c4('0xd')][_0x46c4('0xf5')]=function(_0x536487,_0x17ee6f,_0x1ca927){if(_['isUndefined'](_0x17ee6f)&&'object'!==typeof _0x17ee6f){return;}if(_[_0x46c4('0xf6')](_0x1ca927)&&_0x46c4('0xf7')!==typeof _0x1ca927){return;}switch(_0x1ca927[_0x46c4('0xf8')]){case'0':ut['logAgent'](_0x536487,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x536487,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x46c4('0xf9')](_0x536487,0x3,_0x46c4('0xc9'));rpcDb[_0x46c4('0xfa')](_0x536487,_0x46c4('0xfb'));break;case'5':ut[_0x46c4('0xf9')](_0x536487,0x5,_0x46c4('0xfc'));rpcDb[_0x46c4('0xfa')](_0x536487,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x46c4('0xf9')](_0x536487,0x8,_0x46c4('0xd2'));rpcDb[_0x46c4('0xfa')](_0x536487,_0x46c4('0xfd'));break;case'22':ut[_0x46c4('0xf9')](_0x536487,0x16,_0x46c4('0xfe'));rpcDb[_0x46c4('0xfa')](_0x536487,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x536487,0xc,_0x1ca927[_0x46c4('0xf8')]);rpcDb[_0x46c4('0xfa')](_0x536487,_0x46c4('0xfd'));}ut['updateOriginated'](_0x17ee6f,_0x46c4('0xff'));logger['info'](_0x46c4('0x100'),_0x536487['uniqueid'],_0x46c4('0xac'),_0x17ee6f[_0x46c4('0x23')],_0x46c4('0x69'),_0x17ee6f[_0x46c4('0x45')]);delete this[_0x46c4('0x14')][_0x536487['uniqueid']];};Preview[_0x46c4('0xd')][_0x46c4('0xcd')]=function(_0x3597a0,_0x2ca415,_0xc97b05){return Promise[_0x46c4('0x101')]()[_0x46c4('0x84')](cmHopperAdditionalPhone[_0x46c4('0xcd')](_0x3597a0,_0x2ca415,_0xc97b05))[_0x46c4('0x87')](logger[_0x46c4('0x50')](_0x46c4('0x102')));};Preview[_0x46c4('0xd')][_0x46c4('0xc5')]=function(_0x4a2f98,_0x5b7274,_0x4b4df5){return Promise[_0x46c4('0x101')]()[_0x46c4('0x84')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x4a2f98,_0x5b7274,_0x4b4df5))[_0x46c4('0x87')](logger[_0x46c4('0x50')]('[swapAdditionalPhone]\x20'));};Preview[_0x46c4('0xd')][_0x46c4('0xa7')]=function(_0x17b618){return Promise[_0x46c4('0x101')]()[_0x46c4('0x84')](cmHopperAdditionalPhone[_0x46c4('0xa7')](_0x17b618))[_0x46c4('0x87')](logger[_0x46c4('0x50')](_0x46c4('0x103')));};Preview[_0x46c4('0xd')]['checkInBlack']=function(_0x39f335,_0xea93ef,_0x449837,_0x1c1934,_0x2d8d28){var _0x395cec=this;return new Promise(function(_0x28d81c,_0x269302){if(_[_0x46c4('0x65')](_0xea93ef)||_[_0x46c4('0x65')](_0xea93ef[_0x46c4('0x104')])||_['isNil'](_0xea93ef[_0x46c4('0x105')])||_[_0x46c4('0x65')](_0xea93ef[_0x46c4('0x106')])){_0x269302(ut[_0x46c4('0x57')](_0x46c4('0x107'),_0x1c1934,_0x2d8d28));return;}var _0x50fca7=uuid['v4']();var _0x530b39=_0x395cec['campaignsPreview'][_0xea93ef[_0x46c4('0x67')][_0x46c4('0x23')]];var _0x25f6c0=_0x449837?_0x395cec[_0x46c4('0x7e')][_0x449837]['id']:undefined;_0x395cec[_0x46c4('0x14')][_0x50fca7]=new Action(_0xea93ef,_0x530b39,_0x50fca7,_0x449837,_0x25f6c0);var _0x44ffdf=_0x395cec[_0x46c4('0x14')][_0x50fca7];_0x44ffdf['unlockAgent']=_0x1c1934;_0x44ffdf[_0x46c4('0xa4')]=_0x2d8d28;_0x44ffdf[_0x46c4('0x108')]=_0x449837;if(_['isEmpty'](_0x39f335)){_0x395cec[_0x46c4('0x109')](_0x44ffdf,_0x530b39,_0xea93ef,_0x449837)['then'](function(_0x4289ec){logger[_0x46c4('0x50')](_0x46c4('0x10a'),'Queue:\x20'+_0x44ffdf[_0x46c4('0x68')]+_0x46c4('0x10b')+_0x44ffdf['idContact'],JSON[_0x46c4('0x4b')](_0x4289ec));ami[_0x46c4('0x22')](_0x46c4('0x10c'),ut[_0x46c4('0x99')](_0x44ffdf,_0x46c4('0x10d'),_0x395cec[_0x46c4('0x11')][_0x44ffdf[_0x46c4('0x68')]]));_0x28d81c(ut[_0x46c4('0x57')](_0x46c4('0x10e')));})[_0x46c4('0x87')](function(_0x3aae82){ut[_0x46c4('0x59')](_0x46c4('0x10f'),_0x3aae82);_0x269302(ut[_0x46c4('0x57')](_0x46c4('0x110'),_0x1c1934,_0x2d8d28));});}else{_0x530b39[_0x46c4('0x111')]+=0x1;ut[_0x46c4('0x112')](_0x44ffdf);rpcDb[_0x46c4('0x113')](_0x44ffdf,'[Blacklist][error]');delete _0x395cec[_0x46c4('0x14')][_0x50fca7];_0x269302(ut[_0x46c4('0x57')](_0x46c4('0x114'),_0x1c1934,_0x2d8d28));}});};Preview[_0x46c4('0xd')][_0x46c4('0x91')]=function(_0x35eeea){return!_[_0x46c4('0x65')](_0x35eeea)&&!_[_0x46c4('0x65')](_0x35eeea[_0x46c4('0x23')])&&!_[_0x46c4('0x65')](_0x35eeea[_0x46c4('0x115')])&&_0x35eeea['active']&&!_['isNil'](this[_0x46c4('0x13')][util[_0x46c4('0x4d')](_0x46c4('0x116'),_0x35eeea[_0x46c4('0x23')])])&&!_[_0x46c4('0x65')](this[_0x46c4('0x13')][util['format'](_0x46c4('0x116'),_0x35eeea[_0x46c4('0x23')])][_0x46c4('0x6f')])&&(this['trunks'][util['format'](_0x46c4('0x116'),_0x35eeea[_0x46c4('0x23')])][_0x46c4('0x6f')]===_0x46c4('0x117')||this[_0x46c4('0x13')][util['format'](_0x46c4('0x116'),_0x35eeea[_0x46c4('0x23')])][_0x46c4('0x6f')]===_0x46c4('0x118'));};Preview[_0x46c4('0xd')][_0x46c4('0x83')]=function(_0x439cf5,_0x338d08){var _0x21bda6=this;return new Promise(function(_0x5a618a,_0x7f92ce){_0x21bda6['execRun'](_0x439cf5,_0x338d08)['then'](function(_0x2e6aac){_0x5a618a(_[_0x46c4('0x6a')](_0x2e6aac,[_0x46c4('0x57')]));})[_0x46c4('0x87')](function(_0x519115){if(_0x519115[_0x46c4('0x119')]){rpcDb[_0x46c4('0x11a')](_0x439cf5);}if(_0x519115[_0x46c4('0x115')]){rpcDb[_0x46c4('0x88')](_0x439cf5);}_0x7f92ce(_[_0x46c4('0x6a')](_0x519115,[_0x46c4('0x57')]));});});};Preview[_0x46c4('0xd')][_0x46c4('0x11b')]=function(_0x523859,_0x74591d){var _0x30cd87=this;return new Promise(function(_0x6df0c9,_0x47b60d){var _0x4d9f29,_0x4ab207;rpcDb['getContactPreview'](_0x523859)[_0x46c4('0x84')](function(_0x503791){if(!_[_0x46c4('0x65')](_0x503791[0x0])){_0x4ab207=_0x503791[0x0][_0x46c4('0x11c')]?![]:!![];_0x4d9f29=_0x503791[0x0][_0x46c4('0x11c')]?!![]:![];_0x4d9f29=_0x74591d?!![]:_0x4d9f29;}var _0x5709dd=_0x30cd87[_0x46c4('0x11d')](_0x503791);if(_0x5709dd[_0x46c4('0x11e')]){rpcDb[_0x46c4('0x11f')](_[_0x46c4('0x6a')](_0x503791[0x0],[_0x46c4('0x106'),_0x46c4('0x105')]))['then'](function(_0x56eab9){_0x30cd87['checkInBlack'](_0x56eab9,_0x503791[0x0],_0x74591d,_0x4ab207,_0x4d9f29)[_0x46c4('0x84')](function(_0x45fe88){_0x6df0c9(_0x45fe88);})[_0x46c4('0x87')](function(_0xacbac0){_0x47b60d(_0xacbac0);});})[_0x46c4('0x87')](function(_0x3760a9){ut[_0x46c4('0x59')]('[Preview][checkIsBlackList]',_0x3760a9);_0x47b60d(ut[_0x46c4('0x57')](_0x46c4('0x120'),_0x4ab207,_0x4d9f29));});}else{_0x47b60d(ut[_0x46c4('0x57')](_0x5709dd['message'],_0x4ab207,_0x4d9f29));}})[_0x46c4('0x87')](function(_0x510dad){ut[_0x46c4('0x59')]('[Preview][getContactPreview]',_0x510dad);_0x47b60d(ut[_0x46c4('0x57')](_0x46c4('0x120'),![],!![]));});});};Preview[_0x46c4('0xd')][_0x46c4('0x11d')]=function(_0xd0526d){if(_['isNil'](_0xd0526d)||_['isEmpty'](_0xd0526d)||!_['isNil'](_0xd0526d[0x0]['Agent'])&&_[_0x46c4('0x65')](_0xd0526d[0x0][_0x46c4('0x82')]['name'])){ut[_0x46c4('0x59')](_0x46c4('0x121'),_0xd0526d);return{'isValid':![],'message':_0x46c4('0x122')};}var _0x5d9939=this['campaignsPreview'][_0xd0526d[0x0][_0x46c4('0x67')][_0x46c4('0x23')]];_0x5d9939[_0x46c4('0x57')]=_0x46c4('0x94');if(_[_0x46c4('0x65')](_0x5d9939)){ut['logger'](_0x46c4('0x123'),_0x5d9939);return{'isValid':![],'message':_0x46c4('0x124')};}if(!this['isTrunkReachable'](_0x5d9939[_0x46c4('0x49')])){ut['logger'](_0x46c4('0x125'),'campaign\x20Name:\x20'+_0x5d9939[_0x46c4('0x23')]+_0x46c4('0x126'));if(!this[_0x46c4('0x91')](_0x5d9939[_0x46c4('0x92')])){ut[_0x46c4('0x59')](_0x46c4('0x125'),_0x5d9939[_0x46c4('0x23')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x46c4('0x127')};}}if(!ut[_0x46c4('0x90')](_0x5d9939['dialActive'])){ut[_0x46c4('0x59')](_0x46c4('0x128'),_0x5d9939['name']+_0x46c4('0x129'));return{'isValid':![],'message':_0x46c4('0x12a')+_0x5d9939[_0x46c4('0x23')]+_0x46c4('0x129')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x46c4('0x109')]=function(_0x7b4220,_0x4ae4bd,_0x22c43e,_0x3b1b2d){var _0x283444=this;return new Promise(function(_0x61e91b,_0x5dffb3){var _0x597fdc=_0x7b4220[_0x46c4('0xab')];var _0xb7c38b=_0x283444[_0x46c4('0x91')](_0x4ae4bd[_0x46c4('0x49')])?util[_0x46c4('0x4d')]('SIP/%s/%s%s',_0x4ae4bd['Trunk']['name'],_['isNil'](_0x4ae4bd[_0x46c4('0x33')])?'':_0x4ae4bd['dialPrefix'][_0x46c4('0x12b')]()||'',_0x4ae4bd[_0x46c4('0x12c')]>0x0?_0x22c43e['phone'][_0x46c4('0x12d')](_0x4ae4bd[_0x46c4('0x12c')]):_0x22c43e['phone']):util[_0x46c4('0x4d')](_0x46c4('0x12e'),_[_0x46c4('0x65')](_0x4ae4bd['TrunkBackup'])?_0x4ae4bd[_0x46c4('0x49')][_0x46c4('0x23')]:_0x4ae4bd[_0x46c4('0x92')][_0x46c4('0x23')],_[_0x46c4('0x65')](_0x4ae4bd[_0x46c4('0x33')])?'':_0x4ae4bd[_0x46c4('0x33')][_0x46c4('0x12b')]()||'',_0x4ae4bd[_0x46c4('0x12c')]>0x0?_0x22c43e[_0x46c4('0x105')][_0x46c4('0x12d')](_0x4ae4bd[_0x46c4('0x12c')]):_0x22c43e['phone']);var _0x1c8c2a=_0x283444['isTrunkReachable'](_0x4ae4bd[_0x46c4('0x49')])?ut[_0x46c4('0x12f')](_0x4ae4bd[_0x46c4('0x49')][_0x46c4('0x130')],_0x4ae4bd['dialOriginateCallerIdName'],_0x4ae4bd[_0x46c4('0x131')]>0x0?ut[_0x46c4('0x132')](_0x4ae4bd['dialOriginateCallerIdNumber'],_0x4ae4bd[_0x46c4('0x131')]):_0x4ae4bd['dialOriginateCallerIdNumber']):ut[_0x46c4('0x12f')](_[_0x46c4('0x65')](_0x4ae4bd[_0x46c4('0x92')])?_0x4ae4bd[_0x46c4('0x49')][_0x46c4('0x130')]:_0x4ae4bd[_0x46c4('0x92')][_0x46c4('0x130')],_0x4ae4bd[_0x46c4('0x30')],_0x4ae4bd['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x46c4('0x132')](_0x4ae4bd[_0x46c4('0x31')],_0x4ae4bd['dialRandomLastDigitCallerIdNumber']):_0x4ae4bd[_0x46c4('0x31')]);if(_0x1c8c2a){_0x7b4220[_0x46c4('0x133')]=ut[_0x46c4('0x134')](_0x1c8c2a);_0x7b4220[_0x46c4('0x135')]=ut[_0x46c4('0x136')](_0x1c8c2a);}var _0xcbe201=ut[_0x46c4('0x137')](_0x4ae4bd,_0x22c43e,_0xb7c38b,_0x1c8c2a,_0x597fdc,_0x7b4220);_[_0x46c4('0x138')](_0x7b4220,ut[_0x46c4('0x139')](_0xcbe201));_0x7b4220[_0x46c4('0x13a')]=moment()[_0x46c4('0x4d')](_0x46c4('0xa8'));_0x4ae4bd[_0x46c4('0x13b')]=_0xcbe201;ami[_0x46c4('0x6e')](ut[_0x46c4('0x13c')](_0x7b4220,_0x4ae4bd,_0xcbe201,_0x7b4220[_0x46c4('0xa4')],_0x3b1b2d))[_0x46c4('0x84')](function(_0xc1a9ca){_0x4ae4bd[_0x46c4('0x45')]+=0x1;logger[_0x46c4('0x50')](_0x46c4('0x13d'),_0x597fdc,_0x46c4('0xac'),_0x4ae4bd[_0x46c4('0x23')],_0x46c4('0x69'),_0x4ae4bd[_0x46c4('0x45')]);_0x61e91b(_0xc1a9ca);})[_0x46c4('0x87')](function(_0x4f7299){ut[_0x46c4('0xf9')](_0x7b4220,0xe,_0x46c4('0x13e'));rpcDb[_0x46c4('0xfa')](_0x7b4220,'[originateFailure][logOriginateFailure]');_0x5dffb3(_0x4f7299);});});};Preview['prototype'][_0x46c4('0x1c')]=function(_0xf4322f){if(this[_0x46c4('0x14')][_0xf4322f[_0x46c4('0xbc')]]){this['actions'][_0xf4322f[_0x46c4('0xbc')]][_0x46c4('0x70')]=_0xf4322f[_0x46c4('0x70')];}};Preview[_0x46c4('0xd')][_0x46c4('0x16')]=function(_0x1cc0e4){var _0x187c15=this;var _0x1218af=this['actions'][_0x1cc0e4[_0x46c4('0x13f')]];if(_0x1218af){if(_0x1218af['lookAgent']&&this[_0x46c4('0x7e')][_0x1218af[_0x46c4('0x108')]]){ut['logLookAgent'](_0x1218af,this[_0x46c4('0x7e')][_0x1218af[_0x46c4('0x108')]][_0x46c4('0x23')],this[_0x46c4('0x7e')][_0x1218af[_0x46c4('0x108')]]['id']);}var _0x108055=_['clone'](_0x1218af);_0x108055[_0x46c4('0xa9')]=moment()['format'](_0x46c4('0xa8'));var _0x14c528=_0x187c15['campaignsPreview'][_0x1218af[_0x46c4('0x68')]];if(ut['isFailure'](_0x1cc0e4[_0x46c4('0x140')])){if(_0x1218af[_0x46c4('0xa3')]){rpcDb[_0x46c4('0x11a')](_0x1218af[_0x46c4('0xa6')]);}if(_0x1218af[_0x46c4('0xa4')]){rpcDb[_0x46c4('0x88')](_0x1218af[_0x46c4('0xa6')]);}ami[_0x46c4('0x22')](_0x46c4('0x141'),ut['buildObj'](_0x1218af,_0x46c4('0x142'),this['campaignsPreview'][_0x1218af['queue']]));this[_0x46c4('0xf5')](_0x108055,_0x14c528,_0x1cc0e4);}else{_0x1218af[_0x46c4('0x13a')]=moment()['format'](_0x46c4('0xa8'));ut['logAgent'](_0x108055,0x4,'Answer');rpcDb[_0x46c4('0xfa')](_0x108055,_0x46c4('0x143'));}}};Preview['prototype'][_0x46c4('0x19')]=function(_0x155095){var _0x497cf4=this[_0x46c4('0x14')][_0x155095[_0x46c4('0xbc')]];var _0x186201;if(_0x497cf4){_0x186201=this[_0x46c4('0x11')][_0x497cf4[_0x46c4('0x68')]];logger['info'](_0x46c4('0x144'),_0x155095[_0x46c4('0xbc')],_0x46c4('0xac'),_0x186201['name'],_0x46c4('0xad'),_0x186201[_0x46c4('0x54')]);}if(this['actions'][_0x155095[_0x46c4('0xbc')]]&&_0x155095[_0x46c4('0xbc')]!==_0x155095[_0x46c4('0xab')]){if(_0x155095[_0x46c4('0x145')]==='16'&&this[_0x46c4('0x14')][_0x155095[_0x46c4('0xbc')]][_0x46c4('0x74')]){this['callProgressDetectingCustomer'](_0x155095,_0x155095['linkedid'],_0x155095[_0x46c4('0x145')]);}else if(this[_0x46c4('0x14')][_0x155095['linkedid']][_0x46c4('0x74')]){logger[_0x46c4('0x50')](_0x46c4('0x146'),_0x155095['linkedid'],_0x155095[_0x46c4('0x145')],'\x20Queue',_0x186201[_0x46c4('0x23')],'pTalking:\x20',_0x186201['pTalking']);this[_0x46c4('0x147')](_0x155095,_0x155095[_0x46c4('0xbc')],_0x155095[_0x46c4('0x145')]);}}else if(_0x497cf4&&_[_0x46c4('0x65')](_0x497cf4['statedesc'])&&_0x186201['dialQueueProject']&&_0x155095['linkedid']===_0x155095[_0x46c4('0xab')]&&_[_0x46c4('0x65')](_0x155095[_0x46c4('0xf8')])&&_0x155095['cause']==='16'&&_0x155095[_0x46c4('0x148')]==='6'&&_[_0x46c4('0xf6')](_0x497cf4[_0x46c4('0x149')])){if(_0x497cf4['unlockAgent']){rpcDb[_0x46c4('0x11a')](_0x497cf4[_0x46c4('0xa6')]);}if(_0x497cf4[_0x46c4('0xa4')]){rpcDb[_0x46c4('0x88')](_0x497cf4[_0x46c4('0xa6')]);}_0x155095[_0x46c4('0xf8')]='22';this[_0x46c4('0xf5')](_0x497cf4,_0x186201,_0x155095);}else if(_0x497cf4&&_0x497cf4['transfer']){if(_0x155095[_0x46c4('0x145')]==='16'&&this[_0x46c4('0x14')][_0x155095['linkedid']][_0x46c4('0x74')]){logger[_0x46c4('0x50')](_0x46c4('0x14a'),_0x155095[_0x46c4('0xbc')],_0x155095[_0x46c4('0x145')],'\x20Queue',_0x186201[_0x46c4('0x23')],'pTalking:\x20',_0x186201[_0x46c4('0x54')]);this[_0x46c4('0x147')](_0x155095,_0x155095['linkedid'],_0x155095[_0x46c4('0x145')]);}else if(this[_0x46c4('0x14')][_0x155095[_0x46c4('0xbc')]][_0x46c4('0x74')]){logger[_0x46c4('0x50')]('[syncHangup][talking][cause]',_0x155095[_0x46c4('0xbc')],_0x155095['cause'],_0x46c4('0xac'),_0x186201[_0x46c4('0x23')],_0x46c4('0xad'),_0x186201[_0x46c4('0x54')]);this['callProgressDetectingCustomer'](_0x155095,_0x155095[_0x46c4('0xbc')],_0x155095[_0x46c4('0x145')]);}}};Preview['prototype'][_0x46c4('0x14b')]=function(_0x3f953d){if(this[_0x46c4('0x14')][_0x3f953d['destlinkedid']]&&_0x3f953d['destlinkedid']!==_0x3f953d[_0x46c4('0x14c')]){this[_0x46c4('0x147')](_0x3f953d,_0x3f953d[_0x46c4('0xf4')],_0x3f953d[_0x46c4('0xec')]);}};Preview[_0x46c4('0xd')][_0x46c4('0x1a')]=function(_0x257ef8){if(this[_0x46c4('0x14')][_0x257ef8[_0x46c4('0xbc')]]&&_0x257ef8['linkedid']!==_0x257ef8[_0x46c4('0xab')]&&!this[_0x46c4('0x14')][_0x257ef8['linkedid']]['dialAnswer']){if(_0x257ef8['cause']==='1'){this['callProgressDetectingCustomer'](_0x257ef8,_0x257ef8[_0x46c4('0xbc')],_0x257ef8[_0x46c4('0x145')]);}}};Preview[_0x46c4('0xd')]['addVariable']=function(_0x208823,_0x1de1aa,_0x86a509){if(this[_0x46c4('0x14')][_0x208823]){if(_[_0x46c4('0x65')](this[_0x46c4('0x14')][_0x208823][_0x46c4('0x13b')])){this[_0x46c4('0x14')][_0x208823][_0x46c4('0x13b')]={};}this[_0x46c4('0x14')][_0x208823]['variables'][_0x1de1aa]=_0x86a509;}};Preview['prototype'][_0x46c4('0x1e')]=function(_0x64f5b4){try{if(!_[_0x46c4('0x65')](_0x64f5b4)){if(ut[_0x46c4('0x14d')](_['keys'](_0x64f5b4[_0x46c4('0x14e')])[0x0])){this[_0x46c4('0x14f')](_0x64f5b4[_0x46c4('0xab')],_[_0x46c4('0x150')](_0x64f5b4[_0x46c4('0x14e')])[0x0],_0x64f5b4[_0x46c4('0x151')]);}}}catch(_0x4e5b15){logger[_0x46c4('0x152')](_0x46c4('0x153'),util['inspect'](_0x4e5b15,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x46c4('0x1f')]=function(_0x233399){if(_0x233399){if(this[_0x46c4('0x14')][_0x233399[_0x46c4('0x154')]]){this[_0x46c4('0x14')][_0x233399[_0x46c4('0x154')]]['transfer']=!![];}}};Preview[_0x46c4('0xd')]['syncBlindTransfer']=function(_0x4123f4){if(_0x4123f4){if(this[_0x46c4('0x14')][_0x4123f4[_0x46c4('0x155')]]){this[_0x46c4('0x14')][_0x4123f4[_0x46c4('0x155')]][_0x46c4('0x149')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x33ca=['called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Empty\x20Contact','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variables','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','disableContact','custom:agentringnoanswer','rejected','cause','statedesc','dialQueueProject','reason','channelstate','transfer','[syncHangup][talking][cause]','destlinkedid','destuniqueid','addVariable','filterKey','keys','variable','error','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','available','loggedIn','pTalking','sumHoldTime','talking','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','stringify','md5','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','recallMe','agents','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','[HistoryRecallClose]','catch','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','dialActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','nosuchnumber','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','custom:agentConnectPreview','custom:agentcomplete','complete','answered','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','NOANSWER','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','Congestion','dialCongestionRetryFrequency','[callProgressDetectingCustomer][logCongestion]','verifyAdditionalPhones','countcongestionretry','countagentrejectretry','custom:agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','countabandonedetry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled'];(function(_0x2d9abd,_0x7f2168){var _0x1f6181=function(_0x2adf46){while(--_0x2adf46){_0x2d9abd['push'](_0x2d9abd['shift']());}};_0x1f6181(++_0x7f2168);}(_0x33ca,0x1a8));var _0xa33c=function(_0x34bce9,_0x1c4792){_0x34bce9=_0x34bce9-0x0;var _0x1e09b9=_0x33ca[_0x34bce9];return _0x1e09b9;};'use strict';var util=require(_0xa33c('0x0'));var _=require(_0xa33c('0x1'));var uuid=require(_0xa33c('0x2'));var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require(_0xa33c('0x3'));var logger=require(_0xa33c('0x4'))(_0xa33c('0x5'));var loggerAction=require(_0xa33c('0x4'))(_0xa33c('0x6'));var ami=require(_0xa33c('0x7'));var rpcDb=require(_0xa33c('0x8'));var cmHopperAdditionalPhone=require(_0xa33c('0x9'));var Action=require('./action');var ut=require(_0xa33c('0xa'));config[_0xa33c('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa33c('0xc'))(new Redis(config[_0xa33c('0xb')]));var Sequence=function(){};Sequence[_0xa33c('0xd')][_0xa33c('0xe')]=function(_0x411901){this[_0xa33c('0xf')]=this[_0xa33c('0xf')]?this['tail'][_0xa33c('0x10')](_0x411901):_0x411901();};function Preview(_0x3c94b7){this['sequence']=new Sequence();this[_0xa33c('0x11')]=_0x3c94b7[_0xa33c('0x12')];this[_0xa33c('0x13')]=_0x3c94b7[_0xa33c('0x13')];this[_0xa33c('0x14')]={};this['agents']=_0x3c94b7['agents'];this[_0xa33c('0x15')]=0x0;ami['on'](_0xa33c('0x16'),this[_0xa33c('0x17')][_0xa33c('0x18')](this));ami['on'](_0xa33c('0x19'),this[_0xa33c('0x1a')][_0xa33c('0x18')](this));ami['on'](_0xa33c('0x1b'),this[_0xa33c('0x1c')][_0xa33c('0x18')](this));ami['on'](_0xa33c('0x1d'),this[_0xa33c('0x1e')][_0xa33c('0x18')](this));ami['on'](_0xa33c('0x1f'),this['syncNewExten']['bind'](this));ami['on'](_0xa33c('0x20'),this[_0xa33c('0x21')]['bind'](this));ami['on'](_0xa33c('0x22'),this['syncAttendedTransfer'][_0xa33c('0x18')](this));ami['on']('blindtransfer',this[_0xa33c('0x23')][_0xa33c('0x18')](this));this[_0xa33c('0x24')](this[_0xa33c('0x11')]);}function emit(_0x2d2d5a,_0x2de719,_0x376301){io['to'](_0x2d2d5a)[_0xa33c('0x25')](_0x2de719,_0x376301);}function emitCampaignPreview(_0x54f0eb){if(_0x54f0eb[_0xa33c('0x26')]===_0xa33c('0x27')){var _0xa8474b={'id':_0x54f0eb['id'],'name':_0x54f0eb['name'],'strategy':_0x54f0eb[_0xa33c('0x28')],'answered':_0x54f0eb['answered'],'available':_0x54f0eb[_0xa33c('0x29')],'loggedIn':_0x54f0eb[_0xa33c('0x2a')],'pTalking':_0x54f0eb[_0xa33c('0x2b')],'sumBillable':_0x54f0eb['sumBillable'],'sumDuration':_0x54f0eb['sumDuration'],'sumHoldTime':_0x54f0eb[_0xa33c('0x2c')]||0x0,'talking':_0x54f0eb[_0xa33c('0x2d')],'total':_0x54f0eb['total'],'type':_0x54f0eb[_0xa33c('0x26')],'unmanaged':_0x54f0eb['unmanaged'],'abandoned':_0x54f0eb[_0xa33c('0x2e')],'waiting':_0x54f0eb[_0xa33c('0x2f')],'loggedInDb':_0x54f0eb[_0xa33c('0x30')],'dialActive':_0x54f0eb['dialActive'],'dialMethod':_0x54f0eb[_0xa33c('0x31')],'dialOriginateCallerIdName':_0x54f0eb[_0xa33c('0x32')],'dialOriginateCallerIdNumber':_0x54f0eb['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x54f0eb[_0xa33c('0x33')],'dialPrefix':_0x54f0eb['dialPrefix'],'outboundAnswerAgiCallsDay':_0x54f0eb[_0xa33c('0x34')],'outboundAnswerCallsDay':_0x54f0eb[_0xa33c('0x35')],'outboundBlacklistCallsDay':_0x54f0eb[_0xa33c('0x36')],'outboundBusyCallsDay':_0x54f0eb[_0xa33c('0x37')],'outboundCongestionCallsDay':_0x54f0eb[_0xa33c('0x38')],'outboundDropCallsDayACS':_0x54f0eb[_0xa33c('0x39')],'outboundDropCallsDayCallersExit':_0x54f0eb[_0xa33c('0x3a')],'outboundDropCallsDayTimeout':_0x54f0eb[_0xa33c('0x3b')],'outboundNoAnswerCallsDay':_0x54f0eb[_0xa33c('0x3c')],'outboundNoSuchCallsDay':_0x54f0eb[_0xa33c('0x3d')],'outboundOriginateFailureCallsDay':_0x54f0eb[_0xa33c('0x3e')],'outboundReCallsDay':_0x54f0eb['outboundReCallsDay'],'outboundRejectCallsDay':_0x54f0eb['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x54f0eb['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x54f0eb[_0xa33c('0x3f')],'predictiveIntervalAnsweredCalls':_0x54f0eb[_0xa33c('0x40')],'predictiveIntervalAvgHoldtime':_0x54f0eb[_0xa33c('0x41')],'predictiveIntervalAvgTalktime':_0x54f0eb[_0xa33c('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x54f0eb[_0xa33c('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x54f0eb[_0xa33c('0x44')],'predictiveIntervalErlangCalls':_0x54f0eb[_0xa33c('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x54f0eb['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x54f0eb[_0xa33c('0x46')],'predictiveIntervalMultiplicativeFactor':_0x54f0eb[_0xa33c('0x47')],'predictiveIntervalPauses':_0x54f0eb['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x54f0eb[_0xa33c('0x48')],'predictiveIntervalTotalCalls':_0x54f0eb['predictiveIntervalTotalCalls'],'message':_0x54f0eb[_0xa33c('0x49')],'originated':_0x54f0eb[_0xa33c('0x4a')],'erlangCalls':_0x54f0eb['erlangCalls'],'erlangCallToSecond':_0x54f0eb[_0xa33c('0x4b')],'erlangAbandonmentRate':_0x54f0eb[_0xa33c('0x4c')],'erlangBusyFactor':_0x54f0eb[_0xa33c('0x4d')],'startPredictive':_0x54f0eb[_0xa33c('0x4e')],'startProgressive':_0x54f0eb[_0xa33c('0x4f')]};if(_0x54f0eb[_0xa33c('0x50')]){_0xa8474b[_0xa33c('0x50')]={'id':_0x54f0eb[_0xa33c('0x50')]['id'],'name':_0x54f0eb[_0xa33c('0x50')][_0xa33c('0x51')],'active':_0x54f0eb[_0xa33c('0x50')][_0xa33c('0x52')],'callerid':_0x54f0eb['Trunk']['callerid']};}if(_0x54f0eb[_0xa33c('0x53')]){_0xa8474b[_0xa33c('0x53')]={'id':_0x54f0eb[_0xa33c('0x53')]['id'],'name':_0x54f0eb[_0xa33c('0x53')][_0xa33c('0x51')]};}var _0x369534=md5(JSON[_0xa33c('0x54')](_0xa8474b));if(_0x54f0eb[_0xa33c('0x55')]!==_0x369534){_0x54f0eb['md5']=_0x369534;emit(util['format']('voice:queue:%s',_0xa8474b['name']),'voice_queue:save',_0xa8474b);}}}function emitVoiceQueueChannelRemove(_0x1f52f2){logger[_0xa33c('0x56')](_0xa33c('0x57'),JSON[_0xa33c('0x54')](_0x1f52f2));emit(util[_0xa33c('0x58')](_0xa33c('0x59'),_0x1f52f2[_0xa33c('0x51')]),_0xa33c('0x5a'),_0x1f52f2);io[_0xa33c('0x25')](_0xa33c('0x5b'),_0x1f52f2);}function notSendMessagesQueue(_0x588932){if(_0x588932[_0xa33c('0x5c')]){if(_0x588932[_0xa33c('0x4a')]===0x0&&_0x588932[_0xa33c('0x2b')]===0x0){_0x588932['sendMessageOneNotActive']=![];_0x588932[_0xa33c('0x29')]=0x0;_0x588932['paused']=0x0;_0x588932[_0xa33c('0x49')]=_0xa33c('0x5d');ut[_0xa33c('0x5e')](_0xa33c('0x5f'),_0x588932[_0xa33c('0x51')]+_0xa33c('0x60'));}else{_0x588932[_0xa33c('0x49')]=_0xa33c('0x61');ut[_0xa33c('0x5e')](_0xa33c('0x5f'),_0x588932['name']+_0xa33c('0x62'));}emitCampaignPreview(_0x588932);}}Preview[_0xa33c('0xd')][_0xa33c('0x24')]=function(){var _0x15b05a=this;setInterval(function(){_0x15b05a['syncCampaigns']();},0x7cf);};Preview[_0xa33c('0xd')][_0xa33c('0x63')]=function(){var _0x29445d=this[_0xa33c('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x242f8e in _0x29445d){if(_0x29445d['hasOwnProperty'](_0x242f8e)&&(_0x29445d[_0x242f8e]['dialMethod']===_0xa33c('0x5')||_0x29445d[_0x242f8e][_0xa33c('0x31')]===_0xa33c('0x64'))&&_0x29445d[_0x242f8e][_0xa33c('0x26')]==='outbound'){if(this[_0xa33c('0x15')]>0x7){this[_0xa33c('0x15')]=0x0;this[_0xa33c('0x65')]();}}if(_0x29445d[_0xa33c('0x66')](_0x242f8e)&&_0x29445d[_0x242f8e]['dialMethod']===_0xa33c('0x5')&&_0x29445d[_0x242f8e][_0xa33c('0x26')]===_0xa33c('0x27')){if(_0x29445d[_0x242f8e]['dialActive']){this[_0xa33c('0x67')](_0x29445d[_0x242f8e]);if(_0x29445d[_0x242f8e][_0xa33c('0x68')])this['recallMe'](_0x29445d[_0x242f8e]);}else{notSendMessagesQueue(_0x29445d[_0x242f8e]);}}}};Preview['prototype'][_0xa33c('0x69')]=function(_0x1ed8ef){var _0x2261c0=this;this[_0xa33c('0x6a')][_0xa33c('0xe')](function(){if(!_[_0xa33c('0x6b')](_0x2261c0['actions'][_0x1ed8ef])){loggerAction[_0xa33c('0x56')](_0xa33c('0x6c'),_0x1ed8ef,_0xa33c('0x6d'),_0x2261c0[_0xa33c('0x14')][_0x1ed8ef][_0xa33c('0x6e')],_0xa33c('0x6f'),JSON[_0xa33c('0x54')](_0x2261c0[_0xa33c('0x11')][_0x2261c0[_0xa33c('0x14')][_0x1ed8ef]['queue']][_0xa33c('0x4a')]),_0xa33c('0x70'),JSON[_0xa33c('0x54')](_0x2261c0[_0xa33c('0x11')][_0x2261c0['actions'][_0x1ed8ef]['queue']][_0xa33c('0x2b')]),JSON[_0xa33c('0x54')](_0x2261c0[_0xa33c('0x14')][_0x1ed8ef][_0xa33c('0x71')]),JSON[_0xa33c('0x54')](_[_0xa33c('0x72')](_0x2261c0[_0xa33c('0x14')][_0x1ed8ef],['contactId',_0xa33c('0x73'),_0xa33c('0x74'),_0xa33c('0x75')])));return ami['Action']({'action':_0xa33c('0x76'),'channel':_0x2261c0[_0xa33c('0x14')][_0x1ed8ef][_0xa33c('0x77')]})['catch'](function(_0x221ba1){if(_0x221ba1[_0xa33c('0x49')]===_0xa33c('0x78')){setTimeout(function(){if(_0x2261c0[_0xa33c('0x14')][_0x1ed8ef]){ut[_0xa33c('0x79')](_0x2261c0[_0xa33c('0x11')][_0x2261c0[_0xa33c('0x14')][_0x1ed8ef][_0xa33c('0x6e')]],_0xa33c('0x7a'));if(_0x2261c0['actions'][_0x1ed8ef]['dialAnswer']===!![]){ut['decrementTalkink'](_0x2261c0[_0xa33c('0x11')][_0x2261c0[_0xa33c('0x14')][_0x1ed8ef][_0xa33c('0x6e')]],'[clearZombieChannel]');ut['loggerError'](_0xa33c('0x7b')+_0x1ed8ef,_0x2261c0[_0xa33c('0x14')][_0x1ed8ef][_0xa33c('0x6e')]);}ut[_0xa33c('0x7c')](_0xa33c('0x7d')+_0x1ed8ef,_0x2261c0[_0xa33c('0x14')][_0x1ed8ef][_0xa33c('0x6e')]);delete _0x2261c0[_0xa33c('0x14')][_0x1ed8ef];}},0x2328);}});}});};Preview[_0xa33c('0xd')]['clearZombieChannels']=function(){var _0xb4c55d=this;loggerAction['info'](_0xa33c('0x7e'),_[_0xa33c('0x7f')](this['actions']));for(var _0x4b6a08 in this[_0xa33c('0x14')]){if(_0xb4c55d[_0xa33c('0x14')][_0xa33c('0x66')](_0x4b6a08)){_0xb4c55d[_0xa33c('0x69')](_0x4b6a08);}}};Preview[_0xa33c('0xd')][_0xa33c('0x80')]=function(_0x365d76){var _0x1c8498=this;rpcDb['getContactRecallMe'](_0x365d76['id'],ut['agentReadyId'](this[_0xa33c('0x81')]))['then'](function(_0x32fc1b){if(!_['isNil'](_0x32fc1b)){for(var _0x5ae6c4=0x0;_0x5ae6c4<_0x32fc1b['length'];_0x5ae6c4+=0x1){if(ut[_0xa33c('0x82')](_0x32fc1b[_0x5ae6c4][_0xa33c('0x83')])<_0x365d76[_0xa33c('0x84')]*0x3c){if(_0x32fc1b[_0x5ae6c4][_0xa33c('0x85')]&&!_0x32fc1b[_0x5ae6c4][_0xa33c('0x85')][_0xa33c('0x86')]){_0x1c8498[_0xa33c('0x87')](_0x32fc1b[_0x5ae6c4]['id'])[_0xa33c('0x88')](ut[_0xa33c('0x89')]('[RecallMe]'))['catch'](ut['logger2'](_0xa33c('0x8a')));}else{rpcDb['disableContact'](_0x32fc1b[_0x5ae6c4]['id']);}}else{var _0x2f6542=new Action(_0x32fc1b[_0x5ae6c4],_0x365d76);_0x2f6542[_0xa33c('0x8b')]=moment()[_0xa33c('0x58')](_0xa33c('0x8c'));_0x365d76['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x2f6542,0x17,_0xa33c('0x8d'));if(_0x365d76[_0xa33c('0x8e')]){rpcDb[_0xa33c('0x8f')](ut['createBody'](_0x32fc1b[_0x5ae6c4]));rpcDb[_0xa33c('0x90')](_0x2f6542,_0xa33c('0x91'));}else{ut[_0xa33c('0x92')](_0x2f6542,0x16,'RecallFailedTimeout');rpcDb[_0xa33c('0x90')](_0x2f6542,_0xa33c('0x93'));rpcDb['createCustomerFinal'](_0x2f6542,_0xa33c('0x93'));}}}}})[_0xa33c('0x94')](ut['logger2'](_0xa33c('0x95')));};Preview['prototype'][_0xa33c('0x67')]=function(_0xbe394){_0xbe394[_0xa33c('0x5c')]=!![];if(ut[_0xa33c('0x96')](_0xbe394['loggedIn'])){_0xbe394['message']=_0xa33c('0x97');}else if(!ut['isActive'](_0xbe394[_0xa33c('0x98')])){_0xbe394[_0xa33c('0x49')]=_0xa33c('0x5d');}else if(!this[_0xa33c('0x99')](_0xbe394[_0xa33c('0x50')])){if(!this[_0xa33c('0x99')](_0xbe394[_0xa33c('0x9a')])){_0xbe394[_0xa33c('0x49')]=_0xa33c('0x9b');}else{_0xbe394['message']=_0xa33c('0x9c');}}else{_0xbe394[_0xa33c('0x49')]=_0xa33c('0x9c');}emitCampaignPreview(_0xbe394);};Preview[_0xa33c('0xd')][_0xa33c('0x9d')]=function(_0x30ddb4,_0x3c018f,_0x4c9b6f){var _0x268098=this;var _0x4a3204=this[_0xa33c('0x14')][_0x3c018f];var _0x39ed28=this['campaignsPreview'][_0x4a3204[_0xa33c('0x6e')]];var _0x188306;var _0x419016=![];var _0x343089=0x2;var _0x424cab=0x3;if(_0x39ed28){switch(_0x4c9b6f){case'1':_0x39ed28[_0xa33c('0x3d')]+=0x1;_0x4a3204[_0xa33c('0x9e')]+=0x1;_0x4a3204[_0xa33c('0x9f')]=ut[_0xa33c('0xa0')](_0x4a3204);ut[_0xa33c('0x92')](_0x4a3204,0x0,_0xa33c('0xa1'));ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x4a3204,_0xa33c('0xa2')));rpcDb[_0xa33c('0x90')](_0x4a3204,'[callProgressDetectingCustomer][logNoSuch]');_0x268098['verifyAdditionalPhones'](_0x4a3204,'0',_0x39ed28)['then'](function(_0x457bc7){_0x419016=_0x457bc7['additional']==0x1;_0x343089=_0x39ed28['dialNoSuchNumberRetryFrequency'];_0x424cab=_0x39ed28[_0xa33c('0xa3')];if(!_0x419016){if(ut[_0xa33c('0xa0')](_0x4a3204)>=_0x39ed28[_0xa33c('0xa4')]){_0x188306=ut['cloneAction'](_0x4a3204,0xf,'Global');rpcDb[_0xa33c('0xa5')](_0x188306,_0xa33c('0xa6'));}else{if(_0x4a3204[_0xa33c('0x9e')]>=_0x39ed28[_0xa33c('0xa7')]){rpcDb[_0xa33c('0xa5')](_0x4a3204,_0xa33c('0xa6'));}else{rpcDb[_0xa33c('0xa8')](ut[_0xa33c('0xa9')](_0x4a3204,_0xa33c('0x9e'),_0x39ed28[_0xa33c('0xaa')]),_0x4a3204[_0xa33c('0xab')],_0x4a3204[_0xa33c('0xac')]);}}delete this[_0xa33c('0x14')][_0x30ddb4[_0xa33c('0xad')]];}else{_0x4a3204[_0xa33c('0x9e')]++;logger[_0xa33c('0x56')](_0xa33c('0xae'),_0x4a3204[_0xa33c('0x9e')]);logger[_0xa33c('0x56')]('id',_0x4a3204[_0xa33c('0xaf')]);_0x268098[_0xa33c('0xb0')]({'id':_0x4a3204[_0xa33c('0xaf')],'field':{'countnosuchnumberretry':_0x4a3204['countnosuchnumberretry']}})[_0xa33c('0x88')](function(){_0x268098[_0xa33c('0xb1')](_0x4a3204,_0x343089,_0x424cab)[_0xa33c('0x88')](function(){});});}});break;case _0xa33c('0xb2'):var _0xd47a4c=moment()[_0xa33c('0x58')](_0xa33c('0x8c'));_0x4a3204['responsetime']=_0xd47a4c;_0x4a3204[_0xa33c('0xb3')]=_0xd47a4c;_0x4a3204[_0xa33c('0x71')]=!![];_0x39ed28[_0xa33c('0x2b')]+=0x1;logger[_0xa33c('0x56')](_0xa33c('0xb4'),_0x4a3204[_0xa33c('0xb5')],_0xa33c('0xb6'),_0x39ed28[_0xa33c('0x51')],_0xa33c('0x70'),_0x39ed28['pTalking']);ami[_0xa33c('0x25')](_0xa33c('0xb7'),ut[_0xa33c('0xb8')](_0x4a3204,_0xa33c('0xb9'),this['campaignsPreview'][_0x4a3204['queue']]));if(_0x39ed28['acw']){ami[_0xa33c('0x25')](_0xa33c('0xba'),ut['buildAcw'](_0x4a3204));}break;case'16':ami[_0xa33c('0x25')](_0xa33c('0xbb'),ut[_0xa33c('0xb8')](_0x4a3204,_0xa33c('0xbc'),this[_0xa33c('0x11')][_0x4a3204[_0xa33c('0x6e')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x4a3204,_0xa33c('0xbc')));_0x39ed28['outboundAnswerCallsDay']+=0x1;_0x39ed28['total']+=0x1;_0x39ed28[_0xa33c('0xbd')]+=0x1;ut[_0xa33c('0xbe')](_0x39ed28,_0xa33c('0xbf'));_0x4a3204[_0xa33c('0x9f')]=ut['totalGlobal'](_0x4a3204);ut[_0xa33c('0x92')](_0x4a3204,0x4,_0xa33c('0xc0'));rpcDb[_0xa33c('0x90')](_0x4a3204,_0xa33c('0xc1'));rpcDb['createCustomerFinal'](_0x4a3204,_0xa33c('0xc2'));rpcDb[_0xa33c('0xc3')](_0x4a3204);_0x39ed28['sumDuration']+=_0x4a3204[_0xa33c('0xc4')];_0x39ed28[_0xa33c('0xc5')]+=_0x4a3204[_0xa33c('0xc4')];logger[_0xa33c('0x56')](_0xa33c('0xc6'),_0x4a3204[_0xa33c('0xb5')],'\x20Queue',_0x39ed28[_0xa33c('0x51')],_0xa33c('0x70'),_0x39ed28[_0xa33c('0x2b')]);delete this['actions'][_0x30ddb4[_0xa33c('0xad')]];break;case _0xa33c('0xc7'):_0x39ed28['outboundBusyCallsDay']+=0x1;_0x4a3204[_0xa33c('0xc8')]+=0x1;_0x4a3204[_0xa33c('0x9f')]=ut[_0xa33c('0xa0')](_0x4a3204);ut[_0xa33c('0x92')](_0x4a3204,0x5,_0xa33c('0xc9'));_0x343089=_0x39ed28[_0xa33c('0xca')];_0x424cab=_0x39ed28[_0xa33c('0xa3')];ami['emit'](_0xa33c('0xcb'),ut[_0xa33c('0xb8')](_0x4a3204,_0xa33c('0xcc')));rpcDb[_0xa33c('0x90')](_0x4a3204,_0xa33c('0xcd'));_0x268098['verifyAdditionalPhones'](_0x4a3204,'5',_0x39ed28)[_0xa33c('0x88')](function(_0x3bee05){_0x419016=_0x3bee05[_0xa33c('0xce')]==0x1;if(!_0x419016){if(ut[_0xa33c('0xa0')](_0x4a3204)>=_0x39ed28[_0xa33c('0xa4')]){_0x188306=ut[_0xa33c('0xcf')](_0x4a3204,0xf,_0xa33c('0xd0'));rpcDb[_0xa33c('0xa5')](_0x188306,_0xa33c('0xd1'));}else{if(_0x4a3204[_0xa33c('0xc8')]>=_0x39ed28['dialBusyMaxRetry']){rpcDb[_0xa33c('0xa5')](_0x4a3204,_0xa33c('0xcd'));}else{rpcDb['rescheduleContact'](ut[_0xa33c('0xa9')](_0x4a3204,_0xa33c('0xc8'),_0x39ed28['dialBusyRetryFrequency']),_0x4a3204['unlockAgent'],_0x4a3204['activeContact']);}}}else{_0x4a3204['countbusyretry']++;_0x268098['incrementPreviewCounters']({'id':_0x4a3204['idContact'],'field':{'countbusyretry':_0x4a3204[_0xa33c('0xc8')]}})[_0xa33c('0x88')](function(){_0x268098[_0xa33c('0xb1')](_0x4a3204,_0x343089,_0x424cab)[_0xa33c('0x88')](function(){});});}});break;case _0xa33c('0xd2'):_0x39ed28[_0xa33c('0x3c')]+=0x1;_0x4a3204['countnoanswerretry']+=0x1;_0x4a3204['countglobal']=ut[_0xa33c('0xa0')](_0x4a3204);ut[_0xa33c('0x92')](_0x4a3204,0x3,_0xa33c('0xd3'));_0x343089=_0x39ed28[_0xa33c('0xd4')];_0x424cab=_0x39ed28[_0xa33c('0xa3')];var _0x4d88ae=ut[_0xa33c('0xd5')](_0x4a3204,_0x39ed28);ami[_0xa33c('0x25')](_0xa33c('0xd6'),_0x4d88ae);rpcDb[_0xa33c('0x90')](_0x4a3204,_0xa33c('0xd7'));_0x268098['verifyAdditionalPhones'](_0x4a3204,'3',_0x39ed28)[_0xa33c('0x88')](function(_0x18e5bf){_0x419016=_0x18e5bf[_0xa33c('0xce')]==0x1;if(!_0x419016){if(ut[_0xa33c('0xa0')](_0x4a3204)>=_0x39ed28[_0xa33c('0xa4')]){_0x188306=ut[_0xa33c('0xcf')](_0x4a3204,0xf,_0xa33c('0xd0'));rpcDb[_0xa33c('0xa5')](_0x188306,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4a3204[_0xa33c('0xd8')]>=_0x39ed28[_0xa33c('0xd9')]){rpcDb[_0xa33c('0xa5')](_0x4a3204,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xa33c('0xa8')](ut[_0xa33c('0xa9')](_0x4a3204,_0xa33c('0xd8'),_0x39ed28['dialNoAnswerRetryFrequency']),_0x4a3204['unlockAgent'],_0x4a3204[_0xa33c('0xac')]);}}}else{_0x4a3204['countnoanswerretry']++;_0x268098[_0xa33c('0xb0')]({'id':_0x4a3204[_0xa33c('0xaf')],'field':{'countnoanswerretry':_0x4a3204[_0xa33c('0xd8')]}})[_0xa33c('0x88')](function(){_0x268098['swapAdditionalPhones'](_0x4a3204,_0x343089,_0x424cab)[_0xa33c('0x88')](function(){});});}});break;case _0xa33c('0xda'):_0x39ed28[_0xa33c('0x38')]+=0x1;_0x4a3204['countcongestionretry']+=0x1;_0x4a3204[_0xa33c('0x9f')]=ut['totalGlobal'](_0x4a3204);ut['logCustomer'](_0x4a3204,0x8,_0xa33c('0xdb'));_0x343089=_0x39ed28[_0xa33c('0xdc')];_0x424cab=_0x39ed28[_0xa33c('0xa3')];ami[_0xa33c('0x25')]('custom:agentcongestion',ut[_0xa33c('0xb8')](_0x4a3204,'congestion'));rpcDb[_0xa33c('0x90')](_0x4a3204,_0xa33c('0xdd'));_0x268098[_0xa33c('0xde')](_0x4a3204,'8',_0x39ed28)[_0xa33c('0x88')](function(_0x2d0276){_0x419016=_0x2d0276[_0xa33c('0xce')]==0x1;if(!_0x419016){if(ut['totalGlobal'](_0x4a3204)>=_0x39ed28[_0xa33c('0xa4')]){_0x188306=ut['cloneAction'](_0x4a3204,0xf,_0xa33c('0xd0'));rpcDb[_0xa33c('0xa5')](_0x188306,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x4a3204[_0xa33c('0xdf')]>=_0x39ed28['dialCongestionMaxRetry']){rpcDb[_0xa33c('0xa5')](_0x4a3204,_0xa33c('0xdd'));}else{rpcDb[_0xa33c('0xa8')](ut[_0xa33c('0xa9')](_0x4a3204,_0xa33c('0xdf'),_0x39ed28[_0xa33c('0xca')]),_0x4a3204[_0xa33c('0xab')],_0x4a3204[_0xa33c('0xac')]);}}}else{_0x4a3204[_0xa33c('0xdf')]++;_0x268098[_0xa33c('0xb0')]({'id':_0x4a3204['idContact'],'field':{'countcongestionretry':_0x4a3204[_0xa33c('0xdf')]}})['then'](function(){_0x268098[_0xa33c('0xb1')](_0x4a3204,_0x343089,_0x424cab)['then'](function(){});});}});break;case'CANCEL':_0x39ed28['outboundRejectCallsDay']+=0x1;_0x4a3204[_0xa33c('0xe0')]+=0x1;_0x4a3204[_0xa33c('0x9f')]=ut[_0xa33c('0xa0')](_0x4a3204);ut['logCustomer'](_0x4a3204,0x14,'AgentReject');_0x343089=_0x39ed28['dialAgentRejectRetryFrequency'];_0x424cab=_0x39ed28[_0xa33c('0xa3')];ami[_0xa33c('0x25')](_0xa33c('0xe1'),ut[_0xa33c('0xb8')](_0x4a3204,'agentreject'));rpcDb['createCustomerHistory'](_0x4a3204,'[syncHangupRequest][logAgentReject]');_0x268098[_0xa33c('0xde')](_0x4a3204,'20',_0x39ed28)[_0xa33c('0x88')](function(_0x5b6e0b){_0x419016=_0x5b6e0b[_0xa33c('0xce')]==0x1;if(!_0x419016){if(ut[_0xa33c('0xa0')](_0x4a3204)>=_0x39ed28[_0xa33c('0xa4')]){_0x188306=ut[_0xa33c('0xcf')](_0x4a3204,0x14,'AgentReject');rpcDb[_0xa33c('0xa5')](_0x188306,_0xa33c('0xe2'));}else{if(_0x4a3204[_0xa33c('0xe0')]>=_0x39ed28[_0xa33c('0xe3')]){rpcDb[_0xa33c('0xa5')](_0x4a3204,_0xa33c('0xe2'));}else{rpcDb['rescheduleContact'](ut[_0xa33c('0xa9')](_0x4a3204,_0xa33c('0xe0'),_0x39ed28[_0xa33c('0xe4')]),_0x4a3204[_0xa33c('0xab')],_0x4a3204[_0xa33c('0xac')]);}}}else{_0x4a3204['countnoanswerretry']++;_0x268098['incrementPreviewCounters']({'id':_0x4a3204[_0xa33c('0xaf')],'field':{'countnoanswerretry':_0x4a3204[_0xa33c('0xd8')]}})['then'](function(){_0x268098[_0xa33c('0xb1')](_0x4a3204,_0x343089,_0x424cab)['then'](function(){});});}});break;case'ABANDONED':_0x39ed28[_0xa33c('0x3f')]+=0x1;_0x4a3204[_0xa33c('0xe5')]+=0x1;_0x4a3204[_0xa33c('0x9f')]=ut[_0xa33c('0xa0')](_0x4a3204);ut['logCustomer'](_0x4a3204,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x4a3204,'[callProgressDetectingCustomer][logAbandoned]');_0x268098[_0xa33c('0xde')](_0x4a3204,'11',_0x39ed28)[_0xa33c('0x88')](function(_0x30a6e2){_0x419016=_0x30a6e2[_0xa33c('0xce')]==0x1;if(!_0x419016){if(ut[_0xa33c('0xa0')](_0x4a3204)>=_0x39ed28['dialGlobalMaxRetry']){_0x188306=ut[_0xa33c('0xcf')](_0x4a3204,0xf,_0xa33c('0xd0'));rpcDb[_0xa33c('0xa5')](_0x188306,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x4a3204[_0xa33c('0xe6')]>=_0x39ed28['dialAbandonedMaxRety']){rpcDb[_0xa33c('0xa5')](_0x4a3204,_0xa33c('0xe7'));}else{rpcDb['rescheduleContact'](ut[_0xa33c('0xa9')](_0x4a3204,_0xa33c('0xe5'),_0x39ed28[_0xa33c('0xe8')]),_0x4a3204['unlockAgent'],_0x4a3204['activeContact']);}}}else{_0x4a3204[_0xa33c('0xd8')]++;_0x268098[_0xa33c('0xb0')]({'id':_0x4a3204[_0xa33c('0xaf')],'field':{'countnoanswerretry':_0x4a3204[_0xa33c('0xd8')]}})[_0xa33c('0x88')](function(){_0x268098[_0xa33c('0xb1')](_0x4a3204,_0x343089,_0x424cab)[_0xa33c('0x88')](function(){});});}});break;case'18':_0x39ed28[_0xa33c('0xe9')]+=0x1;_0x4a3204[_0xa33c('0xea')]+=0x1;_0x4a3204[_0xa33c('0x9f')]=ut[_0xa33c('0xa0')](_0x4a3204);ut[_0xa33c('0x92')](_0x4a3204,0x12,_0x30ddb4[_0xa33c('0xeb')]||_0x30ddb4[_0xa33c('0xec')]);ami[_0xa33c('0x25')](_0xa33c('0xed'),ut['buildObj'](_0x4a3204,_0xa33c('0xee')));rpcDb['createCustomerHistory'](_0x4a3204,_0xa33c('0xef'));_0x268098[_0xa33c('0xde')](_0x4a3204,'18',_0x39ed28)[_0xa33c('0x88')](function(_0x5d53f8){_0x419016=_0x5d53f8[_0xa33c('0xce')]==0x1;if(!_0x419016){if(ut[_0xa33c('0xa0')](_0x4a3204)>=_0x39ed28['dialGlobalMaxRetry']){_0x188306=ut[_0xa33c('0xcf')](_0x4a3204,0x12,'Global');rpcDb[_0xa33c('0xa5')](_0x188306,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x4a3204,_0xa33c('0xef'));}}else{_0x4a3204[_0xa33c('0xd8')]++;_0x268098[_0xa33c('0xb0')]({'id':_0x4a3204[_0xa33c('0xaf')],'field':{'countnoanswerretry':_0x4a3204[_0xa33c('0xd8')]}})['then'](function(){_0x268098[_0xa33c('0xb1')](_0x4a3204,_0x343089,_0x424cab)[_0xa33c('0x88')](function(){});});}});delete this[_0xa33c('0x14')][_0x30ddb4[_0xa33c('0xad')]];break;case'19':_0x39ed28['outboundUnknownCallsDay']+=0x1;_0x4a3204['countglobal']=ut[_0xa33c('0xa0')](_0x4a3204);ut[_0xa33c('0x92')](_0x4a3204,0x13,_0x30ddb4[_0xa33c('0xeb')]||_0x30ddb4[_0xa33c('0xec')]);ami[_0xa33c('0x25')]('custom:amd',ut[_0xa33c('0xb8')](_0x4a3204,_0xa33c('0xee')));rpcDb[_0xa33c('0x90')](_0x4a3204,_0xa33c('0xf0'));_0x268098[_0xa33c('0xde')](_0x4a3204,'18',_0x39ed28)[_0xa33c('0x88')](function(_0x2b6a49){_0x419016=_0x2b6a49[_0xa33c('0xce')]==0x1;if(!_0x419016){if(ut[_0xa33c('0xa0')](_0x4a3204)>=_0x39ed28[_0xa33c('0xa4')]){_0x188306=ut[_0xa33c('0xcf')](_0x4a3204,0xf,_0xa33c('0xd0'));rpcDb[_0xa33c('0xa5')](_0x188306,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x4a3204,'[callProgressDetectingCustomer][machine]');}}else{_0x4a3204[_0xa33c('0xd8')]++;_0x268098['incrementPreviewCounters']({'id':_0x4a3204[_0xa33c('0xaf')],'field':{'countnoanswerretry':_0x4a3204[_0xa33c('0xd8')]}})['then'](function(){_0x268098[_0xa33c('0xb1')](_0x4a3204,_0x343089,_0x424cab)[_0xa33c('0x88')](function(){});});}});delete this['actions'][_0x30ddb4['linkedid']];break;default:if(_0x4a3204[_0xa33c('0x71')]){ut[_0xa33c('0xbe')](_0x39ed28,_0xa33c('0xf1'));ut[_0xa33c('0x7c')](_0xa33c('0xf2')+_0x39ed28[_0xa33c('0x51')],_0x30ddb4);}_0x39ed28[_0xa33c('0xe9')]+=0x1;_0x4a3204['countglobal']=ut[_0xa33c('0xa0')](_0x4a3204);ut[_0xa33c('0x92')](_0x4a3204,0xc,_0x30ddb4[_0xa33c('0xeb')]||_0x30ddb4[_0xa33c('0xec')]);_0x343089=_0x39ed28[_0xa33c('0xe4')];_0x424cab=_0x39ed28[_0xa33c('0xa3')];rpcDb['createCustomerHistory'](_0x4a3204,'[callProgressDetectingCustomer][logUnknown]');_0x268098['verifyAdditionalPhones'](_0x4a3204,'20',_0x39ed28)['then'](function(_0x4687da){_0x419016=_0x4687da[_0xa33c('0xce')]==0x1;if(!_0x419016){if(ut['totalGlobal'](_0x4a3204)>=_0x39ed28[_0xa33c('0xa4')]){_0x188306=ut[_0xa33c('0xcf')](_0x4a3204,0xf,_0xa33c('0xd0'));rpcDb[_0xa33c('0xa5')](_0x188306,_0xa33c('0xf3'));}else{rpcDb['createCustomerFinal'](_0x4a3204,_0xa33c('0xf3'));}delete this['actions'][_0x30ddb4['linkedid']];}else{_0x268098[_0xa33c('0xb1')](_0x4a3204,_0x343089,_0x424cab)['then'](function(){});}});}if(!(_0x4a3204[_0xa33c('0x71')]&&_0x4c9b6f==='16')){ut[_0xa33c('0x79')](_0x39ed28,'[callProgressDetectingCustomer]');logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x4a3204[_0xa33c('0xb5')],_0xa33c('0xb6'),_0x39ed28[_0xa33c('0x51')],_0xa33c('0x6f'),_0x39ed28[_0xa33c('0x4a')]);}if(_0x4c9b6f!==_0xa33c('0xb2')){delete this[_0xa33c('0x14')][_0x30ddb4[_0xa33c('0xad')]];delete this[_0xa33c('0x14')][_0x30ddb4['destlinkedid']];}}};Preview[_0xa33c('0xd')][_0xa33c('0xf4')]=function(_0x2f4929,_0x276241,_0x5367e5){if(_[_0xa33c('0xf5')](_0x276241)&&'object'!==typeof _0x276241){return;}if(_['isUndefined'](_0x5367e5)&&_0xa33c('0xf6')!==typeof _0x5367e5){return;}switch(_0x5367e5['reason']){case'0':ut[_0xa33c('0xf7')](_0x2f4929,0x0,_0xa33c('0xa1'));rpcDb[_0xa33c('0xf8')](_0x2f4929,_0xa33c('0xf9'));break;case'3':ut[_0xa33c('0xf7')](_0x2f4929,0x3,_0xa33c('0xd3'));rpcDb['createAgentHistory'](_0x2f4929,_0xa33c('0xfa'));break;case'5':ut[_0xa33c('0xf7')](_0x2f4929,0x5,'Busy');rpcDb[_0xa33c('0xf8')](_0x2f4929,_0xa33c('0xfb'));break;case'8':ut['logAgent'](_0x2f4929,0x8,_0xa33c('0xdb'));rpcDb[_0xa33c('0xf8')](_0x2f4929,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xa33c('0xf7')](_0x2f4929,0x16,_0xa33c('0xfc'));rpcDb[_0xa33c('0xf8')](_0x2f4929,_0xa33c('0xfd'));break;default:ut[_0xa33c('0xf7')](_0x2f4929,0xc,_0x5367e5['reason']);rpcDb[_0xa33c('0xf8')](_0x2f4929,'[callProgressDetectingAgent][logCongestion]');}ut[_0xa33c('0x79')](_0x276241,'[callProgressDetectingAgent]');logger[_0xa33c('0x56')]('[originated][decrement][callProgressDetectingAgent]',_0x2f4929['uniqueid'],_0xa33c('0xb6'),_0x276241[_0xa33c('0x51')],'originated:\x20',_0x276241['originated']);delete this[_0xa33c('0x14')][_0x2f4929['uniqueid']];};Preview[_0xa33c('0xd')][_0xa33c('0xde')]=function(_0x3a7d6a,_0x608c91,_0x451085){return Promise[_0xa33c('0xfe')]()[_0xa33c('0x88')](cmHopperAdditionalPhone[_0xa33c('0xde')](_0x3a7d6a,_0x608c91,_0x451085))[_0xa33c('0x94')](logger[_0xa33c('0x56')](_0xa33c('0xff')));};Preview[_0xa33c('0xd')][_0xa33c('0xb1')]=function(_0x4027f7,_0x480c2b,_0x1a48d0){return Promise[_0xa33c('0xfe')]()[_0xa33c('0x88')](cmHopperAdditionalPhone[_0xa33c('0xb1')](_0x4027f7,_0x480c2b,_0x1a48d0))[_0xa33c('0x94')](logger[_0xa33c('0x56')](_0xa33c('0x100')));};Preview[_0xa33c('0xd')]['incrementPreviewCounters']=function(_0x2c8eb6){return Promise['resolve']()[_0xa33c('0x88')](cmHopperAdditionalPhone[_0xa33c('0xb0')](_0x2c8eb6))['catch'](logger['info']('[incrementPreviewCounters]\x20'));};Preview['prototype']['checkInBlack']=function(_0x4ed127,_0x402fda,_0x39eb30,_0x104b56,_0x494702){var _0xfaf013=this;return new Promise(function(_0x32cd55,_0x2e2eb0){if(_['isNil'](_0x402fda)||_[_0xa33c('0x6b')](_0x402fda[_0xa33c('0x101')])||_['isNil'](_0x402fda[_0xa33c('0x102')])||_['isNil'](_0x402fda[_0xa33c('0x74')])){_0x2e2eb0(ut[_0xa33c('0x49')](_0xa33c('0x103'),_0x104b56,_0x494702));return;}var _0x1eac48=uuid['v4']();var _0x29282e=_0xfaf013[_0xa33c('0x11')][_0x402fda[_0xa33c('0x6d')][_0xa33c('0x51')]];var _0x56fe6a=_0x39eb30?_0xfaf013[_0xa33c('0x81')][_0x39eb30]['id']:undefined;_0xfaf013[_0xa33c('0x14')][_0x1eac48]=new Action(_0x402fda,_0x29282e,_0x1eac48,_0x39eb30,_0x56fe6a);var _0x463322=_0xfaf013[_0xa33c('0x14')][_0x1eac48];_0x463322[_0xa33c('0xab')]=_0x104b56;_0x463322[_0xa33c('0xac')]=_0x494702;_0x463322[_0xa33c('0x104')]=_0x39eb30;if(_[_0xa33c('0x105')](_0x4ed127)){_0xfaf013['execCall'](_0x463322,_0x29282e,_0x402fda,_0x39eb30)[_0xa33c('0x88')](function(_0xce2adc){logger['info'](_0xa33c('0x106'),_0xa33c('0x107')+_0x463322['queue']+_0xa33c('0x108')+_0x463322['idContact'],JSON[_0xa33c('0x54')](_0xce2adc));ami[_0xa33c('0x25')](_0xa33c('0x109'),ut['buildObj'](_0x463322,_0xa33c('0x10a'),_0xfaf013[_0xa33c('0x11')][_0x463322[_0xa33c('0x6e')]]));_0x32cd55(ut['message'](_0xa33c('0x10b')));})['catch'](function(_0x4b17ee){ut[_0xa33c('0x5e')](_0xa33c('0x10c'),_0x4b17ee);_0x2e2eb0(ut[_0xa33c('0x49')](_0xa33c('0x10d'),_0x104b56,_0x494702));});}else{_0x29282e[_0xa33c('0x36')]+=0x1;ut[_0xa33c('0x10e')](_0x463322);rpcDb[_0xa33c('0x10f')](_0x463322,_0xa33c('0x110'));delete _0xfaf013['actions'][_0x1eac48];_0x2e2eb0(ut[_0xa33c('0x49')](_0xa33c('0x111'),_0x104b56,_0x494702));}});};Preview[_0xa33c('0xd')][_0xa33c('0x99')]=function(_0x5a2861){return!_['isNil'](_0x5a2861)&&!_[_0xa33c('0x6b')](_0x5a2861[_0xa33c('0x51')])&&!_[_0xa33c('0x6b')](_0x5a2861[_0xa33c('0x52')])&&_0x5a2861[_0xa33c('0x52')]&&!_[_0xa33c('0x6b')](this[_0xa33c('0x13')][util[_0xa33c('0x58')](_0xa33c('0x112'),_0x5a2861[_0xa33c('0x51')])])&&!_[_0xa33c('0x6b')](this[_0xa33c('0x13')][util[_0xa33c('0x58')](_0xa33c('0x112'),_0x5a2861[_0xa33c('0x51')])][_0xa33c('0x76')])&&(this[_0xa33c('0x13')][util[_0xa33c('0x58')](_0xa33c('0x112'),_0x5a2861[_0xa33c('0x51')])][_0xa33c('0x76')]===_0xa33c('0x113')||this[_0xa33c('0x13')][util['format'](_0xa33c('0x112'),_0x5a2861['name'])]['status']===_0xa33c('0x114'));};Preview[_0xa33c('0xd')][_0xa33c('0x87')]=function(_0x355283,_0x512ffe){var _0x866a15=this;return new Promise(function(_0x5f1337,_0x5ebe93){_0x866a15[_0xa33c('0x115')](_0x355283,_0x512ffe)[_0xa33c('0x88')](function(_0x2477a0){_0x5f1337(_[_0xa33c('0x72')](_0x2477a0,[_0xa33c('0x49')]));})['catch'](function(_0x19d7e4){if(_0x19d7e4[_0xa33c('0x116')]){rpcDb[_0xa33c('0x117')](_0x355283);}if(_0x19d7e4['active']){rpcDb['disableContact'](_0x355283);}_0x5ebe93(_[_0xa33c('0x72')](_0x19d7e4,['message']));});});};Preview[_0xa33c('0xd')][_0xa33c('0x115')]=function(_0x15f15b,_0x207d57){var _0x4cae1e=this;return new Promise(function(_0xcb3ac8,_0x8efc0a){var _0x424394,_0x5d5bc1;rpcDb[_0xa33c('0x118')](_0x15f15b)[_0xa33c('0x88')](function(_0x32b16a){if(!_['isNil'](_0x32b16a[0x0])){_0x5d5bc1=_0x32b16a[0x0]['recallme']?![]:!![];_0x424394=_0x32b16a[0x0]['recallme']?!![]:![];_0x424394=_0x207d57?!![]:_0x424394;}var _0xbf63e0=_0x4cae1e['validateContact'](_0x32b16a);if(_0xbf63e0['isValid']){rpcDb['checkIsBlackList'](_[_0xa33c('0x72')](_0x32b16a[0x0],[_0xa33c('0x74'),_0xa33c('0x102')]))['then'](function(_0x42dd94){_0x4cae1e['checkInBlack'](_0x42dd94,_0x32b16a[0x0],_0x207d57,_0x5d5bc1,_0x424394)[_0xa33c('0x88')](function(_0x491928){_0xcb3ac8(_0x491928);})[_0xa33c('0x94')](function(_0x573930){_0x8efc0a(_0x573930);});})[_0xa33c('0x94')](function(_0x33ec68){ut[_0xa33c('0x5e')](_0xa33c('0x119'),_0x33ec68);_0x8efc0a(ut[_0xa33c('0x49')](_0xa33c('0x11a'),_0x5d5bc1,_0x424394));});}else{_0x8efc0a(ut[_0xa33c('0x49')](_0xbf63e0[_0xa33c('0x49')],_0x5d5bc1,_0x424394));}})[_0xa33c('0x94')](function(_0x5df8b3){ut[_0xa33c('0x5e')](_0xa33c('0x11b'),_0x5df8b3);_0x8efc0a(ut[_0xa33c('0x49')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xa33c('0xd')][_0xa33c('0x11c')]=function(_0x1765e4){if(_[_0xa33c('0x6b')](_0x1765e4)||_[_0xa33c('0x105')](_0x1765e4)||!_['isNil'](_0x1765e4[0x0][_0xa33c('0x85')])&&_[_0xa33c('0x6b')](_0x1765e4[0x0][_0xa33c('0x85')][_0xa33c('0x51')])){ut[_0xa33c('0x5e')]('[Preview][validateContact][Empty\x20Contact]',_0x1765e4);return{'isValid':![],'message':_0xa33c('0x11d')};}var _0xe04ee8=this[_0xa33c('0x11')][_0x1765e4[0x0]['Queue']['name']];_0xe04ee8[_0xa33c('0x49')]='ACTIVE';if(_[_0xa33c('0x6b')](_0xe04ee8)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0xe04ee8);return{'isValid':![],'message':_0xa33c('0x11e')};}if(!this[_0xa33c('0x99')](_0xe04ee8[_0xa33c('0x50')])){ut[_0xa33c('0x5e')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xa33c('0x11f')+_0xe04ee8['name']+_0xa33c('0x120'));if(!this[_0xa33c('0x99')](_0xe04ee8[_0xa33c('0x9a')])){ut[_0xa33c('0x5e')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xe04ee8[_0xa33c('0x51')]+_0xa33c('0x121'));return{'isValid':![],'message':_0xa33c('0x122')};}}if(!ut[_0xa33c('0x123')](_0xe04ee8[_0xa33c('0x98')])){ut[_0xa33c('0x5e')](_0xa33c('0x124'),_0xe04ee8[_0xa33c('0x51')]+_0xa33c('0x125'));return{'isValid':![],'message':_0xa33c('0x11f')+_0xe04ee8['name']+_0xa33c('0x125')};}return{'isValid':!![],'message':_0xa33c('0x126')};};Preview['prototype']['execCall']=function(_0xef80f5,_0x4b85a3,_0x69fd29,_0x12f347){var _0x4c0b48=this;return new Promise(function(_0x506806,_0x4cc4c4){var _0x45dbee=_0xef80f5[_0xa33c('0xb5')];var _0x29b496=_0x4c0b48[_0xa33c('0x99')](_0x4b85a3['Trunk'])?util[_0xa33c('0x58')](_0xa33c('0x127'),_0x4b85a3[_0xa33c('0x50')]['name'],_['isNil'](_0x4b85a3['dialPrefix'])?'':_0x4b85a3[_0xa33c('0x128')][_0xa33c('0x129')]()||'',_0x4b85a3[_0xa33c('0x12a')]>0x0?_0x69fd29[_0xa33c('0x102')][_0xa33c('0x12b')](_0x4b85a3[_0xa33c('0x12a')]):_0x69fd29[_0xa33c('0x102')]):util['format'](_0xa33c('0x127'),_[_0xa33c('0x6b')](_0x4b85a3[_0xa33c('0x9a')])?_0x4b85a3[_0xa33c('0x50')][_0xa33c('0x51')]:_0x4b85a3[_0xa33c('0x9a')][_0xa33c('0x51')],_['isNil'](_0x4b85a3[_0xa33c('0x128')])?'':_0x4b85a3[_0xa33c('0x128')][_0xa33c('0x129')]()||'',_0x4b85a3['dialCutDigit']>0x0?_0x69fd29[_0xa33c('0x102')][_0xa33c('0x12b')](_0x4b85a3['dialCutDigit']):_0x69fd29[_0xa33c('0x102')]);var _0x282c65=_0x4c0b48[_0xa33c('0x99')](_0x4b85a3['Trunk'])?ut['getCallerId'](_0x4b85a3[_0xa33c('0x50')][_0xa33c('0x12c')],_0x4b85a3[_0xa33c('0x32')],_0x4b85a3[_0xa33c('0x12d')]>0x0?ut[_0xa33c('0x12e')](_0x4b85a3[_0xa33c('0x12f')],_0x4b85a3['dialRandomLastDigitCallerIdNumber']):_0x4b85a3[_0xa33c('0x12f')]):ut[_0xa33c('0x130')](_['isNil'](_0x4b85a3[_0xa33c('0x9a')])?_0x4b85a3[_0xa33c('0x50')]['callerid']:_0x4b85a3[_0xa33c('0x9a')]['callerid'],_0x4b85a3['dialOriginateCallerIdName'],_0x4b85a3[_0xa33c('0x12d')]>0x0?ut[_0xa33c('0x12e')](_0x4b85a3[_0xa33c('0x12f')],_0x4b85a3[_0xa33c('0x12d')]):_0x4b85a3['dialOriginateCallerIdNumber']);if(_0x282c65){_0xef80f5[_0xa33c('0x131')]=ut[_0xa33c('0x132')](_0x282c65);_0xef80f5[_0xa33c('0x133')]=ut['extractCalleridNumber'](_0x282c65);}var _0x1de639=ut[_0xa33c('0x134')](_0x4b85a3,_0x69fd29,_0x29b496,_0x282c65,_0x45dbee,_0xef80f5);_[_0xa33c('0x135')](_0xef80f5,ut[_0xa33c('0x136')](_0x1de639));_0xef80f5['starttime']=moment()[_0xa33c('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b85a3[_0xa33c('0x137')]=_0x1de639;ami[_0xa33c('0x138')](ut[_0xa33c('0x139')](_0xef80f5,_0x4b85a3,_0x1de639,_0xef80f5[_0xa33c('0xac')],_0x12f347))[_0xa33c('0x88')](function(_0x306117){_0x4b85a3[_0xa33c('0x4a')]+=0x1;logger[_0xa33c('0x56')](_0xa33c('0x13a'),_0x45dbee,_0xa33c('0xb6'),_0x4b85a3[_0xa33c('0x51')],_0xa33c('0x6f'),_0x4b85a3[_0xa33c('0x4a')]);_0x506806(_0x306117);})[_0xa33c('0x94')](function(_0x38460b){ut['logAgent'](_0xef80f5,0xe,_0xa33c('0x13b'));rpcDb[_0xa33c('0xf8')](_0xef80f5,_0xa33c('0x13c'));_0x4cc4c4(_0x38460b);});});};Preview[_0xa33c('0xd')][_0xa33c('0x13d')]=function(_0x284ab2){if(this[_0xa33c('0x14')][_0x284ab2['linkedid']]){this['actions'][_0x284ab2['linkedid']][_0xa33c('0x77')]=_0x284ab2[_0xa33c('0x77')];}};Preview[_0xa33c('0xd')][_0xa33c('0x17')]=function(_0x7a9fb1){var _0x1bfa66=this;var _0x2ea9ee=this['actions'][_0x7a9fb1[_0xa33c('0x13e')]];if(_0x2ea9ee){if(_0x2ea9ee[_0xa33c('0x104')]&&this[_0xa33c('0x81')][_0x2ea9ee['lookAgent']]){ut[_0xa33c('0x13f')](_0x2ea9ee,this['agents'][_0x2ea9ee[_0xa33c('0x104')]][_0xa33c('0x51')],this['agents'][_0x2ea9ee[_0xa33c('0x104')]]['id']);}var _0x552623=_[_0xa33c('0x140')](_0x2ea9ee);_0x552623['responsetime']=moment()[_0xa33c('0x58')](_0xa33c('0x8c'));var _0x2047dd=_0x1bfa66[_0xa33c('0x11')][_0x2ea9ee[_0xa33c('0x6e')]];if(ut[_0xa33c('0x141')](_0x7a9fb1[_0xa33c('0x142')])){if(_0x2ea9ee[_0xa33c('0xab')]){rpcDb[_0xa33c('0x117')](_0x2ea9ee[_0xa33c('0xaf')]);}if(_0x2ea9ee[_0xa33c('0xac')]){rpcDb[_0xa33c('0x143')](_0x2ea9ee[_0xa33c('0xaf')]);}ami[_0xa33c('0x25')](_0xa33c('0x144'),ut[_0xa33c('0xb8')](_0x2ea9ee,_0xa33c('0x145'),this[_0xa33c('0x11')][_0x2ea9ee[_0xa33c('0x6e')]]));this['callProgressDetectingAgent'](_0x552623,_0x2047dd,_0x7a9fb1);}else{_0x2ea9ee[_0xa33c('0x8b')]=moment()[_0xa33c('0x58')](_0xa33c('0x8c'));ut[_0xa33c('0xf7')](_0x552623,0x4,_0xa33c('0xc0'));rpcDb['createAgentHistory'](_0x552623,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xa33c('0xd')][_0xa33c('0x1a')]=function(_0x271810){var _0x557a05=this[_0xa33c('0x14')][_0x271810['linkedid']];var _0x282314;if(_0x557a05){_0x282314=this[_0xa33c('0x11')][_0x557a05[_0xa33c('0x6e')]];logger[_0xa33c('0x56')]('[syncHangup][talking]',_0x271810[_0xa33c('0xad')],_0xa33c('0xb6'),_0x282314[_0xa33c('0x51')],_0xa33c('0x70'),_0x282314[_0xa33c('0x2b')]);}if(this[_0xa33c('0x14')][_0x271810[_0xa33c('0xad')]]&&_0x271810[_0xa33c('0xad')]!==_0x271810[_0xa33c('0xb5')]){if(_0x271810[_0xa33c('0x146')]==='16'&&this[_0xa33c('0x14')][_0x271810[_0xa33c('0xad')]][_0xa33c('0x71')]){this[_0xa33c('0x9d')](_0x271810,_0x271810[_0xa33c('0xad')],_0x271810['cause']);}else if(this['actions'][_0x271810[_0xa33c('0xad')]][_0xa33c('0x71')]){logger[_0xa33c('0x56')]('[syncHangup][talking][cause]',_0x271810[_0xa33c('0xad')],_0x271810['cause'],_0xa33c('0xb6'),_0x282314[_0xa33c('0x51')],'pTalking:\x20',_0x282314[_0xa33c('0x2b')]);this['callProgressDetectingCustomer'](_0x271810,_0x271810[_0xa33c('0xad')],_0x271810[_0xa33c('0x146')]);}}else if(_0x557a05&&_[_0xa33c('0x6b')](_0x557a05[_0xa33c('0x147')])&&_0x282314[_0xa33c('0x148')]&&_0x271810[_0xa33c('0xad')]===_0x271810[_0xa33c('0xb5')]&&_[_0xa33c('0x6b')](_0x271810[_0xa33c('0x149')])&&_0x271810[_0xa33c('0x146')]==='16'&&_0x271810[_0xa33c('0x14a')]==='6'&&_[_0xa33c('0xf5')](_0x557a05[_0xa33c('0x14b')])){if(_0x557a05[_0xa33c('0xab')]){rpcDb[_0xa33c('0x117')](_0x557a05['idContact']);}if(_0x557a05['activeContact']){rpcDb[_0xa33c('0x143')](_0x557a05['idContact']);}_0x271810[_0xa33c('0x149')]='22';this[_0xa33c('0xf4')](_0x557a05,_0x282314,_0x271810);}else if(_0x557a05&&_0x557a05[_0xa33c('0x14b')]){if(_0x271810['cause']==='16'&&this['actions'][_0x271810[_0xa33c('0xad')]][_0xa33c('0x71')]){logger[_0xa33c('0x56')]('[syncHangup][talking][transfer]',_0x271810['linkedid'],_0x271810['cause'],_0xa33c('0xb6'),_0x282314[_0xa33c('0x51')],_0xa33c('0x70'),_0x282314['pTalking']);this[_0xa33c('0x9d')](_0x271810,_0x271810['linkedid'],_0x271810['cause']);}else if(this['actions'][_0x271810['linkedid']][_0xa33c('0x71')]){logger[_0xa33c('0x56')](_0xa33c('0x14c'),_0x271810[_0xa33c('0xad')],_0x271810['cause'],'\x20Queue',_0x282314['name'],'pTalking:\x20',_0x282314[_0xa33c('0x2b')]);this['callProgressDetectingCustomer'](_0x271810,_0x271810[_0xa33c('0xad')],_0x271810[_0xa33c('0x146')]);}}};Preview['prototype']['syncDialEnd']=function(_0x50a17a){if(this[_0xa33c('0x14')][_0x50a17a[_0xa33c('0x14d')]]&&_0x50a17a[_0xa33c('0x14d')]!==_0x50a17a[_0xa33c('0x14e')]){this[_0xa33c('0x9d')](_0x50a17a,_0x50a17a[_0xa33c('0x14d')],_0x50a17a['dialstatus']);}};Preview['prototype'][_0xa33c('0x1c')]=function(_0xb66987){if(this[_0xa33c('0x14')][_0xb66987[_0xa33c('0xad')]]&&_0xb66987[_0xa33c('0xad')]!==_0xb66987[_0xa33c('0xb5')]&&!this[_0xa33c('0x14')][_0xb66987[_0xa33c('0xad')]][_0xa33c('0x71')]){if(_0xb66987[_0xa33c('0x146')]==='1'){this[_0xa33c('0x9d')](_0xb66987,_0xb66987[_0xa33c('0xad')],_0xb66987[_0xa33c('0x146')]);}}};Preview[_0xa33c('0xd')][_0xa33c('0x14f')]=function(_0x337871,_0x5e62bc,_0x148cfc){if(this['actions'][_0x337871]){if(_[_0xa33c('0x6b')](this['actions'][_0x337871][_0xa33c('0x137')])){this['actions'][_0x337871]['variables']={};}this[_0xa33c('0x14')][_0x337871][_0xa33c('0x137')][_0x5e62bc]=_0x148cfc;}};Preview['prototype'][_0xa33c('0x21')]=function(_0x9c7761){try{if(!_[_0xa33c('0x6b')](_0x9c7761)){if(ut[_0xa33c('0x150')](_['keys'](_0x9c7761['variable'])[0x0])){this[_0xa33c('0x14f')](_0x9c7761['uniqueid'],_[_0xa33c('0x151')](_0x9c7761[_0xa33c('0x152')])[0x0],_0x9c7761['value']);}}}catch(_0x1e7ed7){logger[_0xa33c('0x153')]('[syncVarSet][Preview]',util[_0xa33c('0x154')](_0x1e7ed7,{'showHidden':![],'depth':null}));}};Preview[_0xa33c('0xd')][_0xa33c('0x155')]=function(_0x9a3147){if(_0x9a3147){if(this[_0xa33c('0x14')][_0x9a3147[_0xa33c('0x156')]]){this[_0xa33c('0x14')][_0x9a3147[_0xa33c('0x156')]][_0xa33c('0x14b')]=!![];}}};Preview['prototype'][_0xa33c('0x23')]=function(_0x1417e3){if(_0x1417e3){if(this[_0xa33c('0x14')][_0x1417e3[_0xa33c('0x157')]]){this[_0xa33c('0x14')][_0x1417e3[_0xa33c('0x157')]]['transfer']=!![];}}};module[_0xa33c('0x158')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 8674950..a7f95a1 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 _0xde49=['../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','resolve','then','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','exten','xcally-motion-preview','assigned','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','preview','lodash'];(function(_0x523870,_0x4e51a5){var _0x130a03=function(_0x5885f6){while(--_0x5885f6){_0x523870['push'](_0x523870['shift']());}};_0x130a03(++_0x4e51a5);}(_0xde49,0x169));var _0x9de4=function(_0x57dfbe,_0x6ff50f){_0x57dfbe=_0x57dfbe-0x0;var _0x358f81=_0xde49[_0x57dfbe];return _0x358f81;};'use strict';var util=require(_0x9de4('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x9de4('0x1'));var _=require(_0x9de4('0x2'));var cmHopper=require(_0x9de4('0x3'));var cmHopperFinal=require(_0x9de4('0x4'));var cmHopperHistory=require(_0x9de4('0x5'));var cmHopperBlack=require(_0x9de4('0x6'));var voiceQueueRt=require(_0x9de4('0x7'));var agentReportPreview=require(_0x9de4('0x8'));var voiceQueueReport=require(_0x9de4('0x9'));function loggerCatch(_0x1d059a){return function(_0x45eb57){logger['error'](_0x1d059a,util['inspect'](_0x45eb57,{'showHidden':![],'depth':null}));};}function create(_0x19a27e){return BPromise[_0x9de4('0xa')]()[_0x9de4('0xb')](cmHopperHistory['createHistory'](_0x19a27e))['catch'](loggerCatch(_0x9de4('0xc')));}function createAgent(_0x37cda5){return BPromise[_0x9de4('0xa')]()[_0x9de4('0xb')](agentReportPreview['createHistory'](_0x37cda5))[_0x9de4('0xd')](loggerCatch(_0x9de4('0xc')));}function moveContact(_0x59a867){return BPromise[_0x9de4('0xa')]()[_0x9de4('0xb')](cmHopper[_0x9de4('0xe')](_0x59a867,!![]))[_0x9de4('0xd')](loggerCatch(_0x9de4('0xf')));}exports[_0x9de4('0x10')]=function(_0x3adf6c){return BPromise['resolve']()[_0x9de4('0xb')](cmHopperBlack['checkIsBlackList'](_0x3adf6c))[_0x9de4('0xd')](loggerCatch(_0x9de4('0x11')));};exports[_0x9de4('0x12')]=function(_0x1556dc){return BPromise[_0x9de4('0xa')]()[_0x9de4('0xb')](cmHopper[_0x9de4('0x12')](_0x1556dc))[_0x9de4('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x9de4('0x13')]=function(_0xf1f2c4,_0x2b8bd6){create(_0xf1f2c4)[_0x9de4('0xd')](loggerCatch(_0x2b8bd6));moveContact(_0xf1f2c4)['catch'](loggerCatch(_0x2b8bd6));};exports[_0x9de4('0x14')]=function(_0x19fcc8,_0x423ab4){createAgent(_0x19fcc8)['catch'](loggerCatch(_0x423ab4));};exports[_0x9de4('0x15')]=function(_0x35881d,_0x5c4c68){create(_0x35881d)['catch'](loggerCatch(_0x5c4c68));};exports[_0x9de4('0x16')]=function(_0x1b0849,_0x51c9c4){moveContact(_0x1b0849)[_0x9de4('0xd')](loggerCatch(_0x51c9c4));};exports[_0x9de4('0x17')]=function(_0x2ce07d,_0x2acd66,_0x3b9636){if(_0x2acd66){_0x2ce07d['UserId']=null;}if(_0x3b9636){_0x2ce07d['active']=![];}return BPromise[_0x9de4('0xa')]()['then'](cmHopper[_0x9de4('0x17')](_0x2ce07d))['catch'](loggerCatch(_0x9de4('0x18')));};exports[_0x9de4('0x19')]=function(_0x5cf61c){return BPromise[_0x9de4('0xa')]()['then'](cmHopper[_0x9de4('0x19')](_0x5cf61c))['catch'](loggerCatch(_0x9de4('0x1a')));};exports[_0x9de4('0x1b')]=function(_0x11d480){return BPromise[_0x9de4('0xa')]()[_0x9de4('0xb')](cmHopper[_0x9de4('0x1b')]({'UserId':null},_0x11d480,0x1))[_0x9de4('0xd')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x1aefcf){return BPromise[_0x9de4('0xa')]()['then'](cmHopper[_0x9de4('0x1b')]({'active':![]},_0x1aefcf,0x1))['catch'](loggerCatch(_0x9de4('0x1c')));};exports[_0x9de4('0x1d')]=function(_0x5b899e){var _0x288f20={};_0x288f20[_0x9de4('0x1e')]=_0x5b899e[_0x9de4('0x1e')];_0x288f20['uniqueid']=_0x5b899e['uniqueid'];_0x288f20[_0x9de4('0x1f')]=_0x5b899e['calleridnum'];_0x288f20['calleridname']=_0x5b899e[_0x9de4('0x20')];_0x288f20[_0x9de4('0x21')]=_0x5b899e[_0x9de4('0x21')];_0x288f20[_0x9de4('0x22')]=_0x5b899e[_0x9de4('0x23')];_0x288f20[_0x9de4('0x24')]=_0x5b899e['answertime'];_0x288f20[_0x9de4('0x25')]=0x1;_0x288f20[_0x9de4('0x26')]=_0x5b899e[_0x9de4('0x27')];_0x288f20[_0x9de4('0x28')]=_0x5b899e['membername'];_0x288f20['context']=_0x9de4('0x29');_0x288f20[_0x9de4('0x2a')]=_0x9de4('0x2b');_0x288f20['holdtime']=0x0;_0x288f20[_0x9de4('0x2c')]=0x1;_0x288f20['lastAssignedTo']=_0x5b899e['membername'];_0x288f20[_0x9de4('0x2d')]=_0x9de4('0x2e');return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x288f20))[_0x9de4('0xd')](loggerCatch(_0x9de4('0x2f')));};exports['getContactRecallMe']=function(_0x49a396,_0x4ceaf8){return BPromise['resolve']()[_0x9de4('0xb')](cmHopper[_0x9de4('0x30')](_0x49a396,_0x4ceaf8))[_0x9de4('0xd')](loggerCatch(_0x9de4('0x31')));};exports[_0x9de4('0x32')]=function(_0x393320){return BPromise[_0x9de4('0xa')]()[_0x9de4('0xb')](cmHopper[_0x9de4('0x17')](_0x393320,!![],!![]))[_0x9de4('0xd')](loggerCatch(_0x9de4('0x33')));}; \ No newline at end of file +var _0x358d=['active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','holdtime','assigned','lastAssignedTo','membername','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','preview','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0x358d,0xbd));var _0xd358=function(_0x525308,_0x5898c9){_0x525308=_0x525308-0x0;var _0x5a6e40=_0x358d[_0x525308];return _0x5a6e40;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xd358('0x0'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xd358('0x1'));var cmHopperHistory=require(_0xd358('0x2'));var cmHopperBlack=require(_0xd358('0x3'));var voiceQueueRt=require(_0xd358('0x4'));var agentReportPreview=require(_0xd358('0x5'));var voiceQueueReport=require(_0xd358('0x6'));function loggerCatch(_0x13767f){return function(_0x4692b7){logger['error'](_0x13767f,util['inspect'](_0x4692b7,{'showHidden':![],'depth':null}));};}function create(_0x139f43){return BPromise[_0xd358('0x7')]()[_0xd358('0x8')](cmHopperHistory[_0xd358('0x9')](_0x139f43))[_0xd358('0xa')](loggerCatch(_0xd358('0xb')));}function createAgent(_0x1aa9a9){return BPromise[_0xd358('0x7')]()[_0xd358('0x8')](agentReportPreview[_0xd358('0x9')](_0x1aa9a9))[_0xd358('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3d04b8){return BPromise[_0xd358('0x7')]()[_0xd358('0x8')](cmHopper[_0xd358('0xc')](_0x3d04b8,!![]))[_0xd358('0xa')](loggerCatch(_0xd358('0xd')));}exports[_0xd358('0xe')]=function(_0x4ddfeb){return BPromise['resolve']()[_0xd358('0x8')](cmHopperBlack['checkIsBlackList'](_0x4ddfeb))[_0xd358('0xa')](loggerCatch(_0xd358('0xf')));};exports[_0xd358('0x10')]=function(_0x7fbc2c){return BPromise['resolve']()[_0xd358('0x8')](cmHopper[_0xd358('0x10')](_0x7fbc2c))[_0xd358('0xa')](loggerCatch(_0xd358('0x11')));};exports['createHistory']=function(_0xbdfcb6,_0x36912e){create(_0xbdfcb6)[_0xd358('0xa')](loggerCatch(_0x36912e));moveContact(_0xbdfcb6)[_0xd358('0xa')](loggerCatch(_0x36912e));};exports[_0xd358('0x12')]=function(_0x30f2c3,_0x164225){createAgent(_0x30f2c3)['catch'](loggerCatch(_0x164225));};exports[_0xd358('0x13')]=function(_0x3e5fc0,_0x37a715){create(_0x3e5fc0)[_0xd358('0xa')](loggerCatch(_0x37a715));};exports[_0xd358('0x14')]=function(_0x1dd2b0,_0x357020){moveContact(_0x1dd2b0)['catch'](loggerCatch(_0x357020));};exports[_0xd358('0x15')]=function(_0x20e4b0,_0x609585,_0x2050e6){if(_0x609585){_0x20e4b0[_0xd358('0x16')]=null;}if(_0x2050e6){_0x20e4b0[_0xd358('0x17')]=![];}return BPromise[_0xd358('0x7')]()[_0xd358('0x8')](cmHopper[_0xd358('0x15')](_0x20e4b0))[_0xd358('0xa')](loggerCatch(_0xd358('0x18')));};exports[_0xd358('0x19')]=function(_0xd375ce){return BPromise['resolve']()[_0xd358('0x8')](cmHopper['countReScheduled'](_0xd375ce))[_0xd358('0xa')](loggerCatch(_0xd358('0x1a')));};exports[_0xd358('0x1b')]=function(_0x2109f0){return BPromise[_0xd358('0x7')]()[_0xd358('0x8')](cmHopper[_0xd358('0x1b')]({'UserId':null},_0x2109f0,0x1))['catch'](loggerCatch(_0xd358('0x1c')));};exports[_0xd358('0x1d')]=function(_0x2702f4){return BPromise[_0xd358('0x7')]()['then'](cmHopper[_0xd358('0x1b')]({'active':![]},_0x2702f4,0x1))[_0xd358('0xa')](loggerCatch('[activeContact]\x20'));};exports[_0xd358('0x1e')]=function(_0x468f79){var _0x125996={};_0x125996[_0xd358('0x1f')]=_0x468f79[_0xd358('0x1f')];_0x125996[_0xd358('0x20')]=_0x468f79['uniqueid'];_0x125996[_0xd358('0x21')]=_0x468f79[_0xd358('0x21')];_0x125996[_0xd358('0x22')]=_0x468f79['calleridname'];_0x125996[_0xd358('0x23')]=_0x468f79[_0xd358('0x23')];_0x125996[_0xd358('0x24')]=_0x468f79[_0xd358('0x25')];_0x125996[_0xd358('0x26')]=_0x468f79[_0xd358('0x25')];_0x125996[_0xd358('0x27')]=0x1;_0x125996[_0xd358('0x28')]=_0x468f79[_0xd358('0x29')];_0x125996[_0xd358('0x2a')]=_0x468f79['membername'];_0x125996[_0xd358('0x2b')]='from-sip';_0x125996[_0xd358('0x2c')]='xcally-motion-preview';_0x125996[_0xd358('0x2d')]=0x0;_0x125996[_0xd358('0x2e')]=0x1;_0x125996[_0xd358('0x2f')]=_0x468f79[_0xd358('0x30')];_0x125996['queuecallerexitreason']=_0xd358('0x31');return BPromise[_0xd358('0x7')]()[_0xd358('0x8')](voiceQueueReport[_0xd358('0x32')](_0x125996))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xd358('0x33')]=function(_0x429538,_0x40dab9){return BPromise['resolve']()['then'](cmHopper[_0xd358('0x33')](_0x429538,_0x40dab9))[_0xd358('0xa')](loggerCatch(_0xd358('0x34')));};exports['rescheduleContactInQueue']=function(_0x3c9435){return BPromise['resolve']()[_0xd358('0x8')](cmHopper[_0xd358('0x15')](_0x3c9435,!![],!![]))[_0xd358('0xa')](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 a5d91bb..88dc96f 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 _0x0c4d=['Failure','variablesAction','RECALL','BOOKED','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','status','push','getDiff','diff','createBody','CampaignId','idContact','campaigntype','membername','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialid','xmd-dialchannel','xmd-callerid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','milliseconds','seconds','loggerCatch','inspect','logger','info','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','endtime','logAgent','starttime','logLookAgent','UserId','logCustomer','ringtime','talktime','answertime','isFailure'];(function(_0x7b534f,_0x8e91bc){var _0x2fae25=function(_0x85442b){while(--_0x85442b){_0x7b534f['push'](_0x7b534f['shift']());}};_0x2fae25(++_0x8e91bc);}(_0x0c4d,0xd6));var _0xd0c4=function(_0x47cf9e,_0xbd9c24){_0x47cf9e=_0x47cf9e-0x0;var _0x1907bd=_0x0c4d[_0x47cf9e];return _0x1907bd;};'use strict';var util=require(_0xd0c4('0x0'));var _=require(_0xd0c4('0x1'));var moment=require(_0xd0c4('0x2'));var logger=require(_0xd0c4('0x3'))('preview');var ipAgi=process[_0xd0c4('0x4')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x4a7aa1,_0x3d197c){var _0x362ffc=moment(_0x4a7aa1)[_0xd0c4('0x5')](0x0);var _0x1abd84=moment(_0x3d197c)[_0xd0c4('0x5')](0x0);return _0x362ffc['diff'](_0x1abd84,_0xd0c4('0x6'));}exports[_0xd0c4('0x7')]=function(_0x2d061d){return function(_0x268880){logger['error'](_0x2d061d,util[_0xd0c4('0x8')](_0x268880,{'showHidden':![],'depth':null}));};};exports[_0xd0c4('0x9')]=function(_0xa38872,_0x42a957){logger[_0xd0c4('0xa')](_0xa38872,util[_0xd0c4('0x8')](_0x42a957,{'showHidden':![],'depth':null}));};exports[_0xd0c4('0xb')]=function(_0x285c8a,_0x475c65){logger['error'](_0x285c8a,util['inspect'](_0x475c65,{'showHidden':![],'depth':null}));};exports[_0xd0c4('0xc')]=function(_0x30471c){return function(_0x1124cb){logger[_0xd0c4('0xa')](_0x30471c,util[_0xd0c4('0x8')](_0x1124cb,{'showHidden':![],'depth':null}));};};exports[_0xd0c4('0xd')]=function(_0xf5079b,_0x1c8217,_0x54c558){return{'message':_0xf5079b,'unlock':_0x1c8217,'active':_0x54c558};};exports['getCallerId']=function(_0x82f05,_0x38bc68,_0x3f4906){if(!_[_0xd0c4('0xe')](_0x3f4906)&&_0xd0c4('0xf')===typeof _0x3f4906&&!_[_0xd0c4('0x10')](_0x3f4906)){if(!_[_0xd0c4('0xe')](_0x38bc68)&&'string'===typeof _0x38bc68&&!_[_0xd0c4('0x10')](_0x38bc68)){return util[_0xd0c4('0x11')](_0xd0c4('0x12'),_0x38bc68,_0x3f4906);}return util['format']('\x22%s\x22\x20<%s>',_0x3f4906,_0x3f4906);}if(!_[_0xd0c4('0xe')](_0x82f05)&&'string'===typeof _0x82f05&&!_['isEmpty'](_0x82f05)){return _0x82f05;}return'\x22\x22\x20<>';};exports[_0xd0c4('0x13')]=function(_0x2446ae){if(_['isNil'](_0x2446ae)){return![];}return _0x2446ae;};exports['addVariables']=function(_0x3d6f3d,_0xe417b6,_0x3c5545,_0x2d3ad7,_0x568d44,_0x2dc8ae){var _0x5ef469={'XMD-QUEUE':_0xe417b6[_0xd0c4('0x14')]?_0xe417b6[_0xd0c4('0x14')][_0xd0c4('0x15')]:'','XMD-CALLERID':_0x2d3ad7,'XMD-CALLERID-PREVIEW':_0x2dc8ae?util['format'](_0xd0c4('0x12'),_0x2dc8ae[_0xd0c4('0x16')],_0x2dc8ae[_0xd0c4('0x17')]):_0x2d3ad7,'XMD-DIALID':_0x568d44,'XMD-CONTACTID':_0xe417b6[_0xd0c4('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d3ad7,'XMD-VOICEQUEUEID':_0xe417b6[_0xd0c4('0x19')],'XMD-DIALCHANNEL':_0x3c5545,'XMD-DIALTIMEOUT':_0x3d6f3d[_0xd0c4('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xd0c4('0x1b'),_0x3d6f3d[_0xd0c4('0x1c')]?'g':'',_[_0xd0c4('0x10')](_0x3d6f3d[_0xd0c4('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3d6f3d[_0xd0c4('0x1e')]||'','XMD-AGI':_0x3d6f3d[_0xd0c4('0x1f')]?util['format'](_0xd0c4('0x20'),ipAgi,_0x3d6f3d['dialQueueProject']):_0xd0c4('0x21'),'XMD-AGIAFTER':_0x3d6f3d[_0xd0c4('0x1c')]?util[_0xd0c4('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3d6f3d[_0xd0c4('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x2dc8ae?_0x2dc8ae[_0xd0c4('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x2dc8ae?_0x2dc8ae[_0xd0c4('0x23')]:'','XMD-DESTINATION':_0xd0c4('0x24'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xd0c4('0x10')](_0x3d6f3d['monitor_format'])){_0x5ef469[util[_0xd0c4('0x11')]('%s',_0xd0c4('0x25'))]=_0x3d6f3d['monitor_format'];_0x5ef469[util['format']('%s',_0xd0c4('0x26'))]=_0x568d44;}if(_0xe417b6&&_0xe417b6[_0xd0c4('0x27')]){for(var _0x4c4f01 in _0xe417b6['Contact']){if(_0xe417b6['Contact'][_0xd0c4('0x28')](_0x4c4f01)){if(!_[_0xd0c4('0x29')](_0xe417b6[_0xd0c4('0x27')][_0x4c4f01])&&_0x4c4f01!=='id'&&_0x4c4f01!==_0xd0c4('0x2a')&&_0x4c4f01!==_0xd0c4('0x2b')&&_0x4c4f01!==_0xd0c4('0x2c')){_0x5ef469[util[_0xd0c4('0x11')](_0xd0c4('0x2d'),_0xd0c4('0x2e'),_[_0xd0c4('0x2f')](_0x4c4f01))]=_0xe417b6['Contact'][_0x4c4f01];}}}}return _0x5ef469;};exports[_0xd0c4('0x30')]=function(_0xeea4e4){var _0x4aa498={};for(var _0x328bf9 in _0xeea4e4){if(_0xeea4e4[_0xd0c4('0x28')](_0x328bf9)){_0x4aa498[util['format']('%s',_[_0xd0c4('0x31')](_0x328bf9))]=_0xeea4e4[_0x328bf9];}}return{'variables':_0x4aa498};};exports[_0xd0c4('0x32')]=function(_0x4b2aca,_0x5de01a){if(!_['isNil'](_0x4b2aca)){if(_0x4b2aca[_0xd0c4('0x28')](_0xd0c4('0x33'))){if(_0x4b2aca[_0xd0c4('0x33')]>0x0){_0x4b2aca[_0xd0c4('0x33')]-=0x1;}else{logger[_0xd0c4('0x34')](_0xd0c4('0x35'),_0x5de01a);}}}else{logger[_0xd0c4('0x34')](_0xd0c4('0x36'),_0x5de01a);}};exports[_0xd0c4('0x37')]=function(_0xd47d6e){var _0x135c72=moment()[_0xd0c4('0x11')](_0xd0c4('0x38'));_0xd47d6e[_0xd0c4('0x39')]=0xd;_0xd47d6e[_0xd0c4('0x3a')]='Blacklist';_0xd47d6e['starttime']=_0x135c72;_0xd47d6e[_0xd0c4('0x3b')]=_0x135c72;_0xd47d6e[_0xd0c4('0x3c')]=_0x135c72;};exports[_0xd0c4('0x3d')]=function(_0x24ab5b,_0x26f600,_0x8b136f){var _0x15d444=moment()['format'](_0xd0c4('0x38'));_0x24ab5b[_0xd0c4('0x39')]=_0x26f600;_0x24ab5b[_0xd0c4('0x3a')]=_0x8b136f;_0x24ab5b[_0xd0c4('0x3b')]=_0x15d444;_0x24ab5b['ringtime']=getSeconds(_0x24ab5b['responsetime'],_0x24ab5b[_0xd0c4('0x3e')]);};exports[_0xd0c4('0x3f')]=function(_0x103ea9,_0x213638,_0x35a691){_0x103ea9['membername']=_0x213638;_0x103ea9[_0xd0c4('0x40')]=_0x35a691;};exports[_0xd0c4('0x41')]=function(_0x555331,_0x1c9b3a,_0x3b376e){var _0x2730c7=moment()['format'](_0xd0c4('0x38'));_0x555331[_0xd0c4('0x39')]=_0x1c9b3a;_0x555331[_0xd0c4('0x3a')]=_0x3b376e;_0x555331[_0xd0c4('0x3b')]=_0x555331[_0xd0c4('0x3b')]?_0x555331[_0xd0c4('0x3b')]:_0x2730c7;_0x555331['endtime']=_0x555331[_0xd0c4('0x3c')]?_0x555331[_0xd0c4('0x3c')]:_0x2730c7;_0x555331[_0xd0c4('0x42')]=getSeconds(_0x555331[_0xd0c4('0x3b')]||0x0,_0x555331['starttime']||0x0);_0x555331[_0xd0c4('0x43')]=_0x555331[_0xd0c4('0x44')]?getSeconds(_0x555331['endtime'],_0x555331['answertime']):0x0;};exports[_0xd0c4('0x45')]=function(_0x15be19){return _0x15be19===_0xd0c4('0x46');};exports[_0xd0c4('0x47')]=function(_0x407d07,_0x180386,_0x44d28b,_0x3a27bc,_0x15a134){var _0x51718c=_0x3a27bc?_0xd0c4('0x48'):_0x407d07['calleridname'];_0x51718c=_0x15a134?_0xd0c4('0x49'):_0x51718c;return{'actionid':_0x407d07['uniqueid'],'action':'originate','channel':_0x407d07[_0xd0c4('0x4a')],'callerid':util['format'](_0xd0c4('0x12'),_0x51718c,_0x407d07[_0xd0c4('0x17')]),'Exten':_0xd0c4('0x24'),'Context':_0xd0c4('0x4b'),'Priority':'1','variable':_0x44d28b,'timeout':(_0x180386[_0xd0c4('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x407d07[_0xd0c4('0x4d')]};};exports[_0xd0c4('0x4e')]=function(_0x1dfbe5){return _0x1dfbe5[_0xd0c4('0x4f')]+_0x1dfbe5['countcongestionretry']+_0x1dfbe5[_0xd0c4('0x50')]+_0x1dfbe5[_0xd0c4('0x51')]+_0x1dfbe5[_0xd0c4('0x52')];};exports['cloneAction']=function(_0x14c760){var _0x3d410e=_[_0xd0c4('0x53')](_0x14c760);_0x3d410e['state']=0xf;_0x3d410e['statedesc']=_0xd0c4('0x54');return _0x3d410e;};exports['scheduledAt']=function(_0x42ae9a,_0x1d5ff1,_0x1bcf15){var _0x452e14={};_0x452e14[_0x1d5ff1]=_0x42ae9a[_0x1d5ff1];_0x452e14[_0xd0c4('0x55')]=![];_0x452e14[_0xd0c4('0x56')]=moment()['add'](_0x1bcf15,_0xd0c4('0x57'))[_0xd0c4('0x11')](_0xd0c4('0x38'));_0x452e14[_0xd0c4('0x18')]=_0x42ae9a[_0xd0c4('0x18')];_0x452e14[_0xd0c4('0x58')]=_0x42ae9a['ListId'];_0x452e14[_0xd0c4('0x19')]=_0x42ae9a[_0xd0c4('0x19')]||undefined;return _0x452e14;};exports[_0xd0c4('0x59')]=function(_0xa2b842,_0x5b05e0){if(!_[_0xd0c4('0x29')](_0xa2b842)){if(_0xa2b842['pTalking']>0x0){_0xa2b842[_0xd0c4('0x5a')]-=0x1;}else{logger[_0xd0c4('0x34')](_0x5b05e0,_0xd0c4('0x5b'));}}else{logger[_0xd0c4('0x34')](_0x5b05e0,_0xd0c4('0x5c'));}};exports['IsNotLoggedIn']=function(_0xe3711f){if(_0xe3711f<=0x0){return!![];}return![];};function buildObj(_0x47af3f,_0x3cce55,_0x2e17cb){_0x47af3f['lastevent']=_0x3cce55;_0x47af3f['name']=_0x47af3f[_0xd0c4('0x5d')];_0x47af3f[_0xd0c4('0x5e')]=_0x47af3f[_0xd0c4('0x4a')];_0x47af3f[_0xd0c4('0x5f')]=_0xd0c4('0x60');if(_0x2e17cb){_0x47af3f[_0xd0c4('0x61')]=_0x2e17cb[_0xd0c4('0x61')];}return _0x47af3f;}exports[_0xd0c4('0x62')]=buildObj;exports[_0xd0c4('0x63')]=function(_0x5ace0b){var _0x438433={};_0x438433[_0xd0c4('0x5d')]=_0x5ace0b[_0xd0c4('0x5d')];_0x438433[_0xd0c4('0x5e')]=_0x5ace0b[_0xd0c4('0x4a')];_0x438433['uniqueid']=_0x5ace0b[_0xd0c4('0x4d')];return _0x438433;};exports[_0xd0c4('0x64')]=function(_0x21250d){var _0x532491=[];for(var _0x1ff1ee in _0x21250d){if(_0x21250d[_0xd0c4('0x28')](_0x1ff1ee)){if(!_[_0xd0c4('0x29')](_0x21250d[_0x1ff1ee])&&_0x21250d[_0x1ff1ee][_0xd0c4('0x39')]==='not_inuse'&&_0x21250d[_0x1ff1ee][_0xd0c4('0x65')]==='reachable'){_0x532491[_0xd0c4('0x66')](_0x21250d[_0x1ff1ee]['id']);}}}return _0x532491;};exports[_0xd0c4('0x67')]=function(_0x5fec2a){var _0x56caeb=moment()[_0xd0c4('0x5')](0x0);var _0x233dbd=moment(_0x5fec2a)['milliseconds'](0x0);return _0x56caeb[_0xd0c4('0x68')](_0x233dbd,_0xd0c4('0x6'));};exports[_0xd0c4('0x69')]=function(_0x205cde){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x205cde['ContactId'],'ListId':_0x205cde[_0xd0c4('0x58')],'VoiceQueueId':_0x205cde['VoiceQueueId']||undefined,'CampaignId':_0x205cde[_0xd0c4('0x6a')]||undefined};};exports['filterKey']=function(_0x4aaaea){if(_0x4aaaea===_0xd0c4('0x4d')||_0x4aaaea===_0xd0c4('0x6b')||_0x4aaaea===_0xd0c4('0x5d')||_0x4aaaea==='type'||_0x4aaaea===_0xd0c4('0x6c')||_0x4aaaea==='dialAnswer'||_0x4aaaea===_0xd0c4('0x6d')||_0x4aaaea===_0xd0c4('0x4a')||_0x4aaaea===_0xd0c4('0x16')||_0x4aaaea==='active'||_0x4aaaea===_0xd0c4('0x17')||_0x4aaaea===_0xd0c4('0x56')||_0x4aaaea==='countbusyretry'||_0x4aaaea===_0xd0c4('0x6e')||_0x4aaaea===_0xd0c4('0x50')||_0x4aaaea===_0xd0c4('0x6f')||_0x4aaaea===_0xd0c4('0x70')||_0x4aaaea===_0xd0c4('0x71')||_0x4aaaea===_0xd0c4('0x72')||_0x4aaaea==='recallme'||_0x4aaaea==='ContactId'||_0x4aaaea===_0xd0c4('0x58')||_0x4aaaea==='UserId'||_0x4aaaea==='VoiceQueueId'||_0x4aaaea===_0xd0c4('0x73')||_0x4aaaea==='xmd-voicequeueid'||_0x4aaaea===_0xd0c4('0x74')||_0x4aaaea===_0xd0c4('0x75')||_0x4aaaea===_0xd0c4('0x76')||_0x4aaaea==='xmd-dialurl'||_0x4aaaea==='xmd-dialtimeout'||_0x4aaaea==='xmd-dialoptions'||_0x4aaaea===_0xd0c4('0x77')||_0x4aaaea===_0xd0c4('0x78')||_0x4aaaea==='xmd-contactid'||_0x4aaaea==='xmd-cdrtype'||_0x4aaaea===_0xd0c4('0x79')||_0x4aaaea==='xmd-agiafter'||_0x4aaaea==='xmd-agi'||_0x4aaaea==='rtpaudioqos'||_0x4aaaea===_0xd0c4('0x7a')||_0x4aaaea===_0xd0c4('0x7b')||_0x4aaaea==='rtpaudioqosjitterbridged'||_0x4aaaea===_0xd0c4('0x7c')||_0x4aaaea===_0xd0c4('0x7d')||_0x4aaaea===_0xd0c4('0x7e')||_0x4aaaea==='rtpaudioqosrttbridged'||_0x4aaaea===_0xd0c4('0x7f')||_0x4aaaea===_0xd0c4('0x7a')||_0x4aaaea===_0xd0c4('0x7b')||_0x4aaaea===_0xd0c4('0x80')||_0x4aaaea===_0xd0c4('0x7c')||_0x4aaaea===_0xd0c4('0x7d')||_0x4aaaea===_0xd0c4('0x7e')||_0x4aaaea==='rtpaudioqosrttbridged'||_0x4aaaea===_0xd0c4('0x81')||_0x4aaaea===_0xd0c4('0x82')||_0x4aaaea===_0xd0c4('0x39')||_0x4aaaea==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x232428,_0x29f6b){var _0x4d7dcc,_0x5e8e70,_0x1bea91;if(_0x29f6b<=0x0){_0x29f6b=0x1;}_0x4d7dcc=new RegExp(_0xd0c4('0x83')+_0x29f6b+'}$');_0x5e8e70=Math['pow'](0xa,_0x29f6b-0x1);_0x1bea91=Math[_0xd0c4('0x84')](0xa,_0x29f6b)-0x1;return util['format']('%s',_[_0xd0c4('0x85')](_0x232428,_0x4d7dcc,_[_0xd0c4('0x86')](_0x5e8e70,_0x1bea91)));};exports[_0xd0c4('0x87')]=function(_0x27c9ac){var _0x3a5a4f=_0x27c9ac[_0xd0c4('0x88')](/"(.*?)"/);return _0x3a5a4f?_0x3a5a4f[0x1]:_0x27c9ac;};exports[_0xd0c4('0x89')]=function(_0x501e9d){var _0x343bb2=_0x501e9d[_0xd0c4('0x88')](/<(.*?)>/);return _0x343bb2?_0x343bb2[0x1]:_0x501e9d;};function buildNoAnswerEventPayload(_0x39fda1,_0x1493b9){var _0x4d07de=buildObj(_0x39fda1,_0xd0c4('0x8a'));if(!_[_0xd0c4('0x10')](_0x1493b9[_0xd0c4('0x8b')])){Object[_0xd0c4('0x8c')](_0x1493b9[_0xd0c4('0x8b')])['forEach'](function(_0x3bb29d){_0x4d07de[_0x3bb29d['toLowerCase']()]=_0x1493b9['variables'][_0x3bb29d];});}return _0x4d07de;}exports[_0xd0c4('0x8d')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xe796=['noanswer','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','statedesc','logLookAgent','membername','UserId','ringtime','answertime','isFailure','variablesAction','RECALL','uniqueid','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','channelAgent','agentReadyId','not_inuse','status','reachable','push','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber'];(function(_0xb9296d,_0x45674e){var _0x1a2046=function(_0x321825){while(--_0x321825){_0xb9296d['push'](_0xb9296d['shift']());}};_0x1a2046(++_0x45674e);}(_0xe796,0x12d));var _0x6e79=function(_0x5832b6,_0x29c661){_0x5832b6=_0x5832b6-0x0;var _0xb8c077=_0xe796[_0x5832b6];return _0xb8c077;};'use strict';var util=require(_0x6e79('0x0'));var _=require(_0x6e79('0x1'));var moment=require(_0x6e79('0x2'));var logger=require(_0x6e79('0x3'))(_0x6e79('0x4'));var ipAgi=process[_0x6e79('0x5')][_0x6e79('0x6')]||'127.0.0.1';function getSeconds(_0x3943dc,_0x1b20e1){var _0x588d47=moment(_0x3943dc)[_0x6e79('0x7')](0x0);var _0x524919=moment(_0x1b20e1)['milliseconds'](0x0);return _0x588d47[_0x6e79('0x8')](_0x524919,_0x6e79('0x9'));}exports[_0x6e79('0xa')]=function(_0x1e7637){return function(_0x2d64c2){logger[_0x6e79('0xb')](_0x1e7637,util[_0x6e79('0xc')](_0x2d64c2,{'showHidden':![],'depth':null}));};};exports[_0x6e79('0xd')]=function(_0x3c0d1c,_0x59c8b9){logger[_0x6e79('0xe')](_0x3c0d1c,util[_0x6e79('0xc')](_0x59c8b9,{'showHidden':![],'depth':null}));};exports[_0x6e79('0xf')]=function(_0x417e7f,_0x43700d){logger[_0x6e79('0xb')](_0x417e7f,util[_0x6e79('0xc')](_0x43700d,{'showHidden':![],'depth':null}));};exports[_0x6e79('0x10')]=function(_0x40690d){return function(_0x21e412){logger[_0x6e79('0xe')](_0x40690d,util[_0x6e79('0xc')](_0x21e412,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x6e9f83,_0x2f6730,_0x444148){return{'message':_0x6e9f83,'unlock':_0x2f6730,'active':_0x444148};};exports[_0x6e79('0x11')]=function(_0x22947e,_0x39d51a,_0x5c0232){if(!_[_0x6e79('0x12')](_0x5c0232)&&_0x6e79('0x13')===typeof _0x5c0232&&!_[_0x6e79('0x14')](_0x5c0232)){if(!_[_0x6e79('0x12')](_0x39d51a)&&_0x6e79('0x13')===typeof _0x39d51a&&!_[_0x6e79('0x14')](_0x39d51a)){return util[_0x6e79('0x15')](_0x6e79('0x16'),_0x39d51a,_0x5c0232);}return util[_0x6e79('0x15')](_0x6e79('0x16'),_0x5c0232,_0x5c0232);}if(!_['isUndefined'](_0x22947e)&&'string'===typeof _0x22947e&&!_[_0x6e79('0x14')](_0x22947e)){return _0x22947e;}return _0x6e79('0x17');};exports[_0x6e79('0x18')]=function(_0x267313){if(_[_0x6e79('0x19')](_0x267313)){return![];}return _0x267313;};exports[_0x6e79('0x1a')]=function(_0x23f9e7,_0x2b8cb0,_0x4f567e,_0x39b9f6,_0x548cce,_0x58daea){var _0x2846ab={'XMD-QUEUE':_0x2b8cb0[_0x6e79('0x1b')]?_0x2b8cb0[_0x6e79('0x1b')][_0x6e79('0x1c')]:'','XMD-CALLERID':_0x39b9f6,'XMD-CALLERID-PREVIEW':_0x58daea?util[_0x6e79('0x15')](_0x6e79('0x16'),_0x58daea[_0x6e79('0x1d')],_0x58daea[_0x6e79('0x1e')]):_0x39b9f6,'XMD-DIALID':_0x548cce,'XMD-CONTACTID':_0x2b8cb0[_0x6e79('0x1f')],'XMD-CDRTYPE':_0x6e79('0x20'),'CALLERID(all)':_0x39b9f6,'XMD-VOICEQUEUEID':_0x2b8cb0[_0x6e79('0x21')],'XMD-DIALCHANNEL':_0x4f567e,'XMD-DIALTIMEOUT':_0x23f9e7['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x6e79('0x15')](_0x6e79('0x22'),_0x23f9e7[_0x6e79('0x23')]?'g':'',_[_0x6e79('0x14')](_0x23f9e7[_0x6e79('0x24')])?'':_0x6e79('0x25')),'XMD-DIALURL':_0x23f9e7[_0x6e79('0x26')]||'','XMD-AGI':_0x23f9e7[_0x6e79('0x27')]?util[_0x6e79('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x23f9e7[_0x6e79('0x27')]):_0x6e79('0x28'),'XMD-AGIAFTER':_0x23f9e7[_0x6e79('0x23')]?util[_0x6e79('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x23f9e7['dialQueueProject2']):_0x6e79('0x28'),'XMD-ORIGINATECALLERIDNUM':_0x58daea?_0x58daea[_0x6e79('0x29')]:'','XMD-ORIGINATECALLERIDNAME':_0x58daea?_0x58daea[_0x6e79('0x2a')]:'','XMD-DESTINATION':_0x6e79('0x2b'),'SIPADDHEADER':_0x6e79('0x2c')};if(!_['isEmpty'](_0x23f9e7[_0x6e79('0x24')])){_0x2846ab[util[_0x6e79('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x23f9e7[_0x6e79('0x24')];_0x2846ab[util[_0x6e79('0x15')]('%s',_0x6e79('0x2d'))]=_0x548cce;}if(_0x2b8cb0&&_0x2b8cb0['Contact']){for(var _0x5b7ce9 in _0x2b8cb0[_0x6e79('0x2e')]){if(_0x2b8cb0[_0x6e79('0x2e')][_0x6e79('0x2f')](_0x5b7ce9)){if(!_['isNil'](_0x2b8cb0[_0x6e79('0x2e')][_0x5b7ce9])&&_0x5b7ce9!=='id'&&_0x5b7ce9!==_0x6e79('0x30')&&_0x5b7ce9!==_0x6e79('0x31')&&_0x5b7ce9!=='updatedAt'){_0x2846ab[util['format'](_0x6e79('0x32'),_0x6e79('0x33'),_[_0x6e79('0x34')](_0x5b7ce9))]=_0x2b8cb0[_0x6e79('0x2e')][_0x5b7ce9];}}}}return _0x2846ab;};exports[_0x6e79('0x35')]=function(_0xa10175){var _0x4e731d={};for(var _0x10ec99 in _0xa10175){if(_0xa10175[_0x6e79('0x2f')](_0x10ec99)){_0x4e731d[util[_0x6e79('0x15')]('%s',_[_0x6e79('0x36')](_0x10ec99))]=_0xa10175[_0x10ec99];}}return{'variables':_0x4e731d};};exports[_0x6e79('0x37')]=function(_0x268c97,_0x190a43){if(!_[_0x6e79('0x19')](_0x268c97)){if(_0x268c97['hasOwnProperty'](_0x6e79('0x38'))){if(_0x268c97['originated']>0x0){_0x268c97[_0x6e79('0x38')]-=0x1;}else{logger[_0x6e79('0xb')](_0x6e79('0x39'),_0x190a43);}}}else{logger[_0x6e79('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x190a43);}};exports[_0x6e79('0x3a')]=function(_0x31e23a){var _0x38d0e2=moment()[_0x6e79('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x31e23a[_0x6e79('0x3b')]=0xd;_0x31e23a['statedesc']=_0x6e79('0x3c');_0x31e23a[_0x6e79('0x3d')]=_0x38d0e2;_0x31e23a[_0x6e79('0x3e')]=_0x38d0e2;_0x31e23a[_0x6e79('0x3f')]=_0x38d0e2;};exports['logAgent']=function(_0x17bfaa,_0x382356,_0x1184e5){var _0x28301a=moment()[_0x6e79('0x15')](_0x6e79('0x40'));_0x17bfaa[_0x6e79('0x3b')]=_0x382356;_0x17bfaa[_0x6e79('0x41')]=_0x1184e5;_0x17bfaa[_0x6e79('0x3e')]=_0x28301a;_0x17bfaa['ringtime']=getSeconds(_0x17bfaa[_0x6e79('0x3e')],_0x17bfaa[_0x6e79('0x3d')]);};exports[_0x6e79('0x42')]=function(_0x4a91d1,_0x4bbcff,_0x22484d){_0x4a91d1[_0x6e79('0x43')]=_0x4bbcff;_0x4a91d1[_0x6e79('0x44')]=_0x22484d;};exports['logCustomer']=function(_0x230979,_0x12c010,_0x279882){var _0x41ed48=moment()[_0x6e79('0x15')](_0x6e79('0x40'));_0x230979[_0x6e79('0x3b')]=_0x12c010;_0x230979['statedesc']=_0x279882;_0x230979['responsetime']=_0x230979['responsetime']?_0x230979[_0x6e79('0x3e')]:_0x41ed48;_0x230979[_0x6e79('0x3f')]=_0x230979['endtime']?_0x230979[_0x6e79('0x3f')]:_0x41ed48;_0x230979[_0x6e79('0x45')]=getSeconds(_0x230979[_0x6e79('0x3e')]||0x0,_0x230979['starttime']||0x0);_0x230979['talktime']=_0x230979[_0x6e79('0x46')]?getSeconds(_0x230979[_0x6e79('0x3f')],_0x230979[_0x6e79('0x46')]):0x0;};exports[_0x6e79('0x47')]=function(_0x45ec9f){return _0x45ec9f==='Failure';};exports[_0x6e79('0x48')]=function(_0x2f26c8,_0x30dd16,_0x2f08be,_0x2a0899,_0x2f766d){var _0x48ad5b=_0x2a0899?_0x6e79('0x49'):_0x2f26c8['calleridname'];_0x48ad5b=_0x2f766d?'BOOKED':_0x48ad5b;return{'actionid':_0x2f26c8[_0x6e79('0x4a')],'action':'originate','channel':_0x2f26c8['channelAgent'],'callerid':util[_0x6e79('0x15')]('\x22%s\x22\x20<%s>',_0x48ad5b,_0x2f26c8[_0x6e79('0x1e')]),'Exten':_0x6e79('0x2b'),'Context':_0x6e79('0x4b'),'Priority':'1','variable':_0x2f08be,'timeout':(_0x30dd16['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2f26c8[_0x6e79('0x4a')]};};exports['totalGlobal']=function(_0x1b99e1){return _0x1b99e1[_0x6e79('0x4c')]+_0x1b99e1[_0x6e79('0x4d')]+_0x1b99e1[_0x6e79('0x4e')]+_0x1b99e1['countagentrejectretry']+_0x1b99e1[_0x6e79('0x4f')];};exports[_0x6e79('0x50')]=function(_0x1018d1){var _0x153ca1=_[_0x6e79('0x51')](_0x1018d1);_0x153ca1['state']=0xf;_0x153ca1[_0x6e79('0x41')]=_0x6e79('0x52');return _0x153ca1;};exports[_0x6e79('0x53')]=function(_0x437220,_0x1583cb,_0xa35393){var _0x45f852={};_0x45f852[_0x1583cb]=_0x437220[_0x1583cb];_0x45f852['active']=![];_0x45f852[_0x6e79('0x54')]=moment()[_0x6e79('0x55')](_0xa35393,_0x6e79('0x56'))[_0x6e79('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x45f852[_0x6e79('0x1f')]=_0x437220['ContactId'];_0x45f852[_0x6e79('0x57')]=_0x437220[_0x6e79('0x57')];_0x45f852[_0x6e79('0x21')]=_0x437220[_0x6e79('0x21')]||undefined;return _0x45f852;};exports[_0x6e79('0x58')]=function(_0x264c67,_0xf7d1b1){if(!_[_0x6e79('0x19')](_0x264c67)){if(_0x264c67[_0x6e79('0x59')]>0x0){_0x264c67[_0x6e79('0x59')]-=0x1;}else{logger['error'](_0xf7d1b1,_0x6e79('0x5a'));}}else{logger[_0x6e79('0xb')](_0xf7d1b1,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x3ebd69){if(_0x3ebd69<=0x0){return!![];}return![];};function buildObj(_0xd8926d,_0x5e9111,_0x41a2ec){_0xd8926d[_0x6e79('0x5b')]=_0x5e9111;_0xd8926d[_0x6e79('0x1c')]=_0xd8926d[_0x6e79('0x5c')];_0xd8926d[_0x6e79('0x5d')]=_0xd8926d['channelAgent'];_0xd8926d[_0x6e79('0x5e')]=_0x6e79('0x5f');if(_0x41a2ec){_0xd8926d[_0x6e79('0x60')]=_0x41a2ec[_0x6e79('0x60')];}return _0xd8926d;}exports['buildObj']=buildObj;exports[_0x6e79('0x61')]=function(_0x547391){var _0xae384d={};_0xae384d['queue']=_0x547391[_0x6e79('0x5c')];_0xae384d[_0x6e79('0x5d')]=_0x547391[_0x6e79('0x62')];_0xae384d[_0x6e79('0x4a')]=_0x547391['uniqueid'];return _0xae384d;};exports[_0x6e79('0x63')]=function(_0x441bca){var _0x36ab87=[];for(var _0x395fa6 in _0x441bca){if(_0x441bca[_0x6e79('0x2f')](_0x395fa6)){if(!_['isNil'](_0x441bca[_0x395fa6])&&_0x441bca[_0x395fa6]['state']===_0x6e79('0x64')&&_0x441bca[_0x395fa6][_0x6e79('0x65')]===_0x6e79('0x66')){_0x36ab87[_0x6e79('0x67')](_0x441bca[_0x395fa6]['id']);}}}return _0x36ab87;};exports['getDiff']=function(_0x12ca32){var _0x11e471=moment()[_0x6e79('0x7')](0x0);var _0x3b5d4b=moment(_0x12ca32)[_0x6e79('0x7')](0x0);return _0x11e471['diff'](_0x3b5d4b,'seconds');};exports[_0x6e79('0x68')]=function(_0x3a4b39){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3a4b39[_0x6e79('0x1f')],'ListId':_0x3a4b39[_0x6e79('0x57')],'VoiceQueueId':_0x3a4b39['VoiceQueueId']||undefined,'CampaignId':_0x3a4b39[_0x6e79('0x69')]||undefined};};exports[_0x6e79('0x6a')]=function(_0x52e62e){if(_0x52e62e==='uniqueid'||_0x52e62e===_0x6e79('0x6b')||_0x52e62e===_0x6e79('0x5c')||_0x52e62e===_0x6e79('0x6c')||_0x52e62e===_0x6e79('0x6d')||_0x52e62e===_0x6e79('0x6e')||_0x52e62e===_0x6e79('0x43')||_0x52e62e===_0x6e79('0x62')||_0x52e62e==='calleridname'||_0x52e62e==='active'||_0x52e62e===_0x6e79('0x1e')||_0x52e62e===_0x6e79('0x54')||_0x52e62e===_0x6e79('0x4c')||_0x52e62e===_0x6e79('0x4d')||_0x52e62e===_0x6e79('0x4e')||_0x52e62e===_0x6e79('0x6f')||_0x52e62e===_0x6e79('0x70')||_0x52e62e===_0x6e79('0x71')||_0x52e62e===_0x6e79('0x72')||_0x52e62e===_0x6e79('0x73')||_0x52e62e===_0x6e79('0x1f')||_0x52e62e===_0x6e79('0x57')||_0x52e62e===_0x6e79('0x44')||_0x52e62e===_0x6e79('0x21')||_0x52e62e===_0x6e79('0x74')||_0x52e62e===_0x6e79('0x75')||_0x52e62e===_0x6e79('0x76')||_0x52e62e===_0x6e79('0x77')||_0x52e62e===_0x6e79('0x78')||_0x52e62e==='xmd-dialurl'||_0x52e62e==='xmd-dialtimeout'||_0x52e62e===_0x6e79('0x79')||_0x52e62e===_0x6e79('0x7a')||_0x52e62e==='xmd-dialchannel'||_0x52e62e===_0x6e79('0x7b')||_0x52e62e===_0x6e79('0x7c')||_0x52e62e===_0x6e79('0x7d')||_0x52e62e===_0x6e79('0x7e')||_0x52e62e===_0x6e79('0x7f')||_0x52e62e===_0x6e79('0x80')||_0x52e62e==='rtpaudioqosbridged'||_0x52e62e===_0x6e79('0x81')||_0x52e62e==='rtpaudioqosjitterbridged'||_0x52e62e===_0x6e79('0x82')||_0x52e62e===_0x6e79('0x83')||_0x52e62e===_0x6e79('0x84')||_0x52e62e===_0x6e79('0x85')||_0x52e62e===_0x6e79('0x80')||_0x52e62e==='rtpaudioqosbridged'||_0x52e62e===_0x6e79('0x81')||_0x52e62e==='rtpaudioqosjitterbridged'||_0x52e62e===_0x6e79('0x82')||_0x52e62e===_0x6e79('0x83')||_0x52e62e===_0x6e79('0x84')||_0x52e62e===_0x6e79('0x85')||_0x52e62e===_0x6e79('0x86')||_0x52e62e===_0x6e79('0x87')||_0x52e62e===_0x6e79('0x3b')||_0x52e62e==='statedesc'){return![];}return!![];};exports[_0x6e79('0x88')]=function(_0x21b90a,_0x3832ef){var _0x18db94,_0x45c389,_0x12cf63;if(_0x3832ef<=0x0){_0x3832ef=0x1;}_0x18db94=new RegExp(_0x6e79('0x89')+_0x3832ef+'}$');_0x45c389=Math[_0x6e79('0x8a')](0xa,_0x3832ef-0x1);_0x12cf63=Math[_0x6e79('0x8a')](0xa,_0x3832ef)-0x1;return util[_0x6e79('0x15')]('%s',_['replace'](_0x21b90a,_0x18db94,_[_0x6e79('0x8b')](_0x45c389,_0x12cf63)));};exports[_0x6e79('0x8c')]=function(_0x339826){var _0xd73827=_0x339826[_0x6e79('0x8d')](/"(.*?)"/);return _0xd73827?_0xd73827[0x1]:_0x339826;};exports[_0x6e79('0x8e')]=function(_0x58ede5){var _0x28a8fa=_0x58ede5[_0x6e79('0x8d')](/<(.*?)>/);return _0x28a8fa?_0x28a8fa[0x1]:_0x58ede5;};function buildNoAnswerEventPayload(_0x5c65a2,_0x40979b){var _0x3717c5=buildObj(_0x5c65a2,_0x6e79('0x8f'));if(!_[_0x6e79('0x14')](_0x40979b[_0x6e79('0x90')])){Object[_0x6e79('0x91')](_0x40979b[_0x6e79('0x90')])['forEach'](function(_0x53abad){_0x3717c5[_0x53abad[_0x6e79('0x92')]()]=_0x40979b[_0x6e79('0x90')][_0x53abad];});}return _0x3717c5;}exports[_0x6e79('0x93')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 896af17..2a0d4e7 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 _0x5deb=['reload','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queueremove','queuepause'];(function(_0x162960,_0x4a684a){var _0x36c2e6=function(_0x52199c){while(--_0x52199c){_0x162960['push'](_0x162960['shift']());}};_0x36c2e6(++_0x4a684a);}(_0x5deb,0x186));var _0xb5de=function(_0x97db75,_0x3abdb8){_0x97db75=_0x97db75-0x0;var _0x259a53=_0x5deb[_0x97db75];return _0x259a53;};'use strict';exports[_0xb5de('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xb5de('0x1'),'required':!![]},'penalty':{'type':_0xb5de('0x2'),'required':![]},'paused':{'type':_0xb5de('0x3'),'required':![]}};exports[_0xb5de('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xb5de('0x1'),'required':!![]}};exports[_0xb5de('0x5')]={'interface':{'type':_0xb5de('0x1'),'required':!![]},'paused':{'type':_0xb5de('0x3')},'reason':{'type':_0xb5de('0x1'),'required':![]}};exports[_0xb5de('0x6')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xb5de('0x1'),'required':!![]}};exports[_0xb5de('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xb5de('0x1')},'mixmonitorid':{'type':_0xb5de('0x1')}};exports[_0xb5de('0x8')]={'uniqueid':{'type':_0xb5de('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xb5de('0x1'),'required':!![]},'exten':{'type':_0xb5de('0x1'),'required':!![]},'context':{'type':_0xb5de('0x1')}}; \ No newline at end of file +var _0x7ff5=['queueadd','string','number','boolean','reload','voicequeuechannel'];(function(_0x394cc9,_0x45fe86){var _0xc5417f=function(_0x3bedba){while(--_0x3bedba){_0x394cc9['push'](_0x394cc9['shift']());}};_0xc5417f(++_0x45fe86);}(_0x7ff5,0x9c));var _0x57ff=function(_0x4c68e6,_0x243b36){_0x4c68e6=_0x4c68e6-0x0;var _0x41ac1a=_0x7ff5[_0x4c68e6];return _0x41ac1a;};'use strict';exports[_0x57ff('0x0')]={'queue':{'type':_0x57ff('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x57ff('0x1'),'required':!![]},'penalty':{'type':_0x57ff('0x2'),'required':![]},'paused':{'type':_0x57ff('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x57ff('0x1'),'required':!![]},'interface':{'type':_0x57ff('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x57ff('0x1'),'required':!![]},'paused':{'type':_0x57ff('0x3')},'reason':{'type':_0x57ff('0x1'),'required':![]}};exports[_0x57ff('0x4')]={'module':{'type':_0x57ff('0x1'),'required':![]}};exports[_0x57ff('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x57ff('0x1'),'required':!![]},'filename':{'type':_0x57ff('0x1')},'format':{'type':_0x57ff('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x57ff('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x57ff('0x1'),'required':!![]},'exten':{'type':'string','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 64786f2..06b4f8b 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 _0x917f=['total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','queueStatusComplete','initAgents','isUndefined','prototype','length','mergeFromDatabase','initTrunks','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','outbound','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','faxAccounts','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface'];(function(_0x5efb43,_0x3ccf21){var _0x2d8375=function(_0x4b6323){while(--_0x4b6323){_0x5efb43['push'](_0x5efb43['shift']());}};_0x2d8375(++_0x3ccf21);}(_0x917f,0x110));var _0xf917=function(_0xe327a9,_0x26cad3){_0xe327a9=_0xe327a9-0x0;var _0x3e9d37=_0x917f[_0xe327a9];return _0x3e9d37;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xf917('0x0'));var Agent=require(_0xf917('0x1'));var Telephone=require(_0xf917('0x2'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xf917('0x3'));var Trigger=require(_0xf917('0x4'));var Template=require('../model/template');var Campaign=require(_0xf917('0x5'));var VoiceExtension=require(_0xf917('0x6'));var ZendeskAccount=require(_0xf917('0x7'));var SalesforceAccount=require(_0xf917('0x8'));var FreshdeskAccount=require(_0xf917('0x9'));var SugarcrmAccount=require(_0xf917('0xa'));var ZohoAccount=require(_0xf917('0xb'));var DeskAccount=require(_0xf917('0xc'));var VtigerAccount=require(_0xf917('0xd'));var ServicenowAccount=require(_0xf917('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xf917('0xf'));var FaxAccount=require(_0xf917('0x10'));var Realtime=function(){this[_0xf917('0x11')]={};this[_0xf917('0x12')]={};this[_0xf917('0x13')]={};this[_0xf917('0x14')]={};this['triggers']={};this[_0xf917('0x15')]={};this[_0xf917('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xf917('0x17')]={};this[_0xf917('0x18')]={};this[_0xf917('0x19')]={};this[_0xf917('0x1a')]={};this[_0xf917('0x1b')]={};this[_0xf917('0x1c')]={};this[_0xf917('0x1d')]={};this[_0xf917('0x1e')]={};this[_0xf917('0x1f')]={};this[_0xf917('0x20')]={};this[_0xf917('0x21')]={};this[_0xf917('0x22')]={};this[_0xf917('0x23')]={};this[_0xf917('0x24')]={};this[_0xf917('0x25')]={};this[_0xf917('0x26')]={};this['faxAccounts']={};};function freeIsNotKey(_0x439fa5,_0x5b94eb,_0x5d1ecc){var _0x2fd619=_[_0xf917('0x27')](_0x439fa5,function(_0x14aadb,_0x22c07d){return _0x14aadb[_0x5d1ecc];});for(var _0x543f7f in _0x5b94eb){if(_0x5b94eb[_0xf917('0x28')](_0x543f7f)){if(!_0x2fd619[_0x543f7f]){delete _0x5b94eb[_0x543f7f];}}}}function freeIsNotKeySip(_0x57e5c7,_0x55fd8e){var _0x44612b=_['mapKeys'](_0x57e5c7,function(_0x31613a,_0x524faa){return util[_0xf917('0x29')](_0xf917('0x2a'),_0x31613a[_0xf917('0x2b')]);});for(var _0x5bc0d8 in _0x55fd8e){if(_0x55fd8e['hasOwnProperty'](_0x5bc0d8)){if(!_0x44612b[_0x5bc0d8]){delete _0x55fd8e[_0x5bc0d8];}}}}function freeIsNotKeyAgent(_0x195418,_0x17f5cd){var _0x2cf56d=_[_0xf917('0x27')](_0x195418,function(_0x3b44f0,_0x32af6a){var _0x4751dd=_[_0xf917('0x2c')](_0x3b44f0[_0xf917('0x2d')])?util[_0xf917('0x29')](_0xf917('0x2a'),_0x3b44f0['name']):_0x3b44f0[_0xf917('0x2d')];return _0x4751dd;});for(var _0x1abad4 in _0x17f5cd){if(_0x17f5cd[_0xf917('0x28')](_0x1abad4)){if(!_0x2cf56d[_0x1abad4]){delete _0x17f5cd[_0x1abad4];}}}}function clearVoiceCallReports(_0x1ca888){_0x1ca888[_0xf917('0x2e')]=0x0;_0x1ca888['answered']=0x0;_0x1ca888[_0xf917('0x2f')]=0x0;_0x1ca888[_0xf917('0x30')]=0x0;_0x1ca888[_0xf917('0x31')]=0x0;}function clearCampaigns(_0x1c2108){if(!_[_0xf917('0x32')](_0x1c2108)){for(var _0x3bf471 in _0x1c2108){if(_0x1c2108['hasOwnProperty'](_0x3bf471)){_0x1c2108[_0x3bf471][_0xf917('0x33')]=0x0;_0x1c2108[_0x3bf471][_0xf917('0x34')]=0x0;}}}}function clearVoiceQueues(_0x506db4){if(!_[_0xf917('0x32')](_0x506db4)){for(var _0x5a5746 in _0x506db4){if(_0x506db4['hasOwnProperty'](_0x5a5746)){_0x506db4[_0x5a5746]['total']=0x0;_0x506db4[_0x5a5746][_0xf917('0x35')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x36')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x37')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x2f')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x30')]=0x0;_0x506db4[_0x5a5746]['sumBillable']=0x0;_0x506db4[_0x5a5746][_0xf917('0x38')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x39')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x3a')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x3b')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x3c')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x3d')]=0x0;_0x506db4[_0x5a5746]['outboundDropCallsDayTimeout']=0x0;_0x506db4[_0x5a5746][_0xf917('0x3e')]=0x0;_0x506db4[_0x5a5746]['outboundBlacklistCallsDay']=0x0;_0x506db4[_0x5a5746][_0xf917('0x3f')]=0x0;_0x506db4[_0x5a5746][_0xf917('0x40')]=0x0;_0x506db4[_0x5a5746]['outboundReCallsDay']=0x0;_0x506db4[_0x5a5746][_0xf917('0x38')]=0x0;_0x506db4[_0x5a5746]['outboundAnswerCallsDay']=0x0;_0x506db4[_0x5a5746][_0xf917('0x41')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x510f42,_0x3daac5){for(var _0x522f1c in _0x3daac5){if(_0x510f42['hasOwnProperty'](_0x522f1c)){_0x510f42[_0x522f1c]=_0x3daac5[_0x522f1c];}}};Realtime['prototype'][_0xf917('0x42')]=function(){var _0x2deda7=this;return function(_0x234310){if(_0x234310){freeIsNotKeyAgent(_0x234310,_0x2deda7[_0xf917('0x11')]);for(var _0x16a383=0x0,_0x3a27a8={},_0x5e5be2={};_0x16a383<_0x234310['length'];_0x16a383+=0x1){_0x3a27a8=_0x234310[_0x16a383];var _0x2027f0=_[_0xf917('0x2c')](_0x3a27a8['interface'])?util[_0xf917('0x29')](_0xf917('0x2a'),_0x3a27a8[_0xf917('0x2b')]):_0x3a27a8[_0xf917('0x2d')];if(_[_0xf917('0x43')](_0x2deda7[_0xf917('0x11')][_0x2027f0])){_0x2deda7[_0xf917('0x11')][_0x2027f0]=new Agent(_0x3a27a8);}else{_0x2deda7['mergeFromDatabase'](_0x2deda7[_0xf917('0x11')][_0x2027f0],_0x3a27a8);}}}return _0x2deda7[_0xf917('0x11')];};};Realtime[_0xf917('0x44')]['initTelephones']=function(){var _0x2530cf=this;return function(_0x477e17){if(_0x477e17){freeIsNotKeySip(_0x477e17,_0x2530cf[_0xf917('0x12')]);for(var _0xb0f39f=0x0,_0x1a90f2={},_0x358583={};_0xb0f39f<_0x477e17[_0xf917('0x45')];_0xb0f39f+=0x1){_0x1a90f2=_0x477e17[_0xb0f39f];if(_[_0xf917('0x43')](_0x2530cf[_0xf917('0x12')][util[_0xf917('0x29')](_0xf917('0x2a'),_0x1a90f2[_0xf917('0x2b')])])){_0x2530cf[_0xf917('0x12')][util[_0xf917('0x29')](_0xf917('0x2a'),_0x1a90f2[_0xf917('0x2b')])]=new Telephone(_0x1a90f2);}else{_0x2530cf[_0xf917('0x46')](_0x2530cf[_0xf917('0x12')][util[_0xf917('0x29')](_0xf917('0x2a'),_0x1a90f2['name'])],_0x1a90f2);}}}return _0x2530cf['telephones'];};};Realtime[_0xf917('0x44')][_0xf917('0x47')]=function(){var _0x2936fa=this;return function(_0x1ba0a8){if(_0x1ba0a8){freeIsNotKeySip(_0x1ba0a8,_0x2936fa[_0xf917('0x13')]);for(var _0x370736=0x0,_0x202791={},_0x36d463={};_0x370736<_0x1ba0a8[_0xf917('0x45')];_0x370736+=0x1){_0x202791=_0x1ba0a8[_0x370736];if(_['isUndefined'](_0x2936fa[_0xf917('0x13')][util[_0xf917('0x29')](_0xf917('0x2a'),_0x202791[_0xf917('0x2b')])])){_0x2936fa[_0xf917('0x13')][util['format'](_0xf917('0x2a'),_0x202791[_0xf917('0x2b')])]=new Trunk(_0x202791);}else{_0x2936fa[_0xf917('0x46')](_0x2936fa[_0xf917('0x13')][util[_0xf917('0x29')](_0xf917('0x2a'),_0x202791[_0xf917('0x2b')])],_0x202791);}}}return _0x2936fa[_0xf917('0x13')];};};Realtime[_0xf917('0x44')][_0xf917('0x48')]=function(){var _0x33e3e7=this;return function(_0x343f80){if(_0x343f80){freeIsNotKey(_0x343f80,_0x33e3e7[_0xf917('0x14')],_0xf917('0x2b'));for(var _0x3a5b73=0x0,_0x3c77f0={},_0x1af188={};_0x3a5b73<_0x343f80[_0xf917('0x45')];_0x3a5b73+=0x1){_0x3c77f0=_0x343f80[_0x3a5b73];if(_[_0xf917('0x43')](_0x33e3e7[_0xf917('0x14')][_0x3c77f0[_0xf917('0x2b')]])){_0x33e3e7[_0xf917('0x14')][_0x3c77f0[_0xf917('0x2b')]]=new VoiceQueue(_0x3c77f0);}else{_0x33e3e7[_0xf917('0x46')](_0x33e3e7[_0xf917('0x14')][_0x3c77f0[_0xf917('0x2b')]],_0x3c77f0);}}}return _0x33e3e7['voiceQueues'];};};Realtime[_0xf917('0x44')][_0xf917('0x49')]=function(){var _0x12b60c=this;return function(_0x4fc8f2){if(_0x4fc8f2){freeIsNotKey(_0x4fc8f2,_0x12b60c['triggers'],'id');for(var _0x188fa2=0x0,_0x406037={},_0x5f2551={};_0x188fa2<_0x4fc8f2[_0xf917('0x45')];_0x188fa2+=0x1){_0x406037=_0x4fc8f2[_0x188fa2];if(_[_0xf917('0x43')](_0x12b60c[_0xf917('0x4a')][_0x406037['id']])){_0x12b60c[_0xf917('0x4a')][_0x406037['id']]=new Trigger(_0x406037);}else{_0x12b60c[_0xf917('0x46')](_0x12b60c[_0xf917('0x4a')][_0x406037['id']],_0x406037);}}}return _0x12b60c[_0xf917('0x4a')];};};Realtime[_0xf917('0x44')][_0xf917('0x4b')]=function(){var _0x49c696=this;return function(_0xe03129){if(_0xe03129){freeIsNotKey(_0xe03129,_0x49c696[_0xf917('0x16')],'id');for(var _0x9fc4e7=0x0,_0x496207={},_0x54c0e5={};_0x9fc4e7<_0xe03129[_0xf917('0x45')];_0x9fc4e7+=0x1){_0x496207=_0xe03129[_0x9fc4e7];if(_[_0xf917('0x43')](_0x49c696[_0xf917('0x16')][_0x496207['id']])){_0x49c696['templates'][_0x496207['id']]=new Template(_0x496207);}else{_0x49c696[_0xf917('0x46')](_0x49c696['templates'][_0x496207['id']],_0x496207);}}}return _0x49c696['templates'];};};Realtime['prototype'][_0xf917('0x4c')]=function(){var _0x47407f=this;return function(_0x5d0f5f){if(_0x5d0f5f){freeIsNotKey(_0x5d0f5f,_0x47407f[_0xf917('0x1d')],'id');for(var _0x22e6c6=0x0,_0x17fe21={},_0x1fef8f={};_0x22e6c6<_0x5d0f5f[_0xf917('0x45')];_0x22e6c6+=0x1){_0x17fe21=_0x5d0f5f[_0x22e6c6];if(_[_0xf917('0x43')](_0x47407f[_0xf917('0x1d')][_0x17fe21['id']])){_0x47407f[_0xf917('0x1d')][_0x17fe21['id']]=new ZendeskAccount(_0x17fe21);}else{_0x47407f[_0xf917('0x46')](_0x47407f['zendeskAccounts'][_0x17fe21['id']],_0x17fe21);}}}return _0x47407f[_0xf917('0x1d')];};};Realtime['prototype'][_0xf917('0x4d')]=function(){var _0xd7ed1c=this;return function(_0x3d9d13){if(_0x3d9d13){freeIsNotKey(_0x3d9d13,_0xd7ed1c['salesforceAccounts'],'id');for(var _0x359999=0x0,_0x3f14f4={},_0x1650d3={};_0x359999<_0x3d9d13[_0xf917('0x45')];_0x359999+=0x1){_0x3f14f4=_0x3d9d13[_0x359999];if(_[_0xf917('0x43')](_0xd7ed1c[_0xf917('0x1e')][_0x3f14f4['id']])){_0xd7ed1c['salesforceAccounts'][_0x3f14f4['id']]=new SalesforceAccount(_0x3f14f4);}else{_0xd7ed1c[_0xf917('0x46')](_0xd7ed1c[_0xf917('0x1e')][_0x3f14f4['id']],_0x3f14f4);}}}return _0xd7ed1c[_0xf917('0x1e')];};};Realtime[_0xf917('0x44')][_0xf917('0x4e')]=function(){var _0x2a73d2=this;return function(_0x1fc581){if(_0x1fc581){freeIsNotKey(_0x1fc581,_0x2a73d2['freshdeskAccounts'],'id');for(var _0x13607a=0x0,_0x2be086={},_0x477dc9={};_0x13607a<_0x1fc581[_0xf917('0x45')];_0x13607a+=0x1){_0x2be086=_0x1fc581[_0x13607a];if(_[_0xf917('0x43')](_0x2a73d2[_0xf917('0x20')][_0x2be086['id']])){_0x2a73d2[_0xf917('0x20')][_0x2be086['id']]=new FreshdeskAccount(_0x2be086);}else{_0x2a73d2['mergeFromDatabase'](_0x2a73d2[_0xf917('0x20')][_0x2be086['id']],_0x2be086);}}}return _0x2a73d2[_0xf917('0x20')];};};Realtime[_0xf917('0x44')]['initZohoAccounts']=function(){var _0xb008ec=this;return function(_0xab67af){if(_0xab67af){freeIsNotKey(_0xab67af,_0xb008ec['zohoAccounts'],'id');for(var _0x433be9=0x0,_0x22e352={},_0x30324b={};_0x433be9<_0xab67af[_0xf917('0x45')];_0x433be9+=0x1){_0x22e352=_0xab67af[_0x433be9];if(_[_0xf917('0x43')](_0xb008ec[_0xf917('0x21')][_0x22e352['id']])){_0xb008ec[_0xf917('0x21')][_0x22e352['id']]=new ZohoAccount(_0x22e352);}else{_0xb008ec[_0xf917('0x46')](_0xb008ec['zohoAccounts'][_0x22e352['id']],_0x22e352);}}}return _0xb008ec[_0xf917('0x21')];};};Realtime[_0xf917('0x44')][_0xf917('0x4f')]=function(){var _0x5a2981=this;return function(_0x50b2b9){if(_0x50b2b9){freeIsNotKey(_0x50b2b9,_0x5a2981['deskAccounts'],'id');for(var _0x4d28e1=0x0,_0x521642={},_0x8673b={};_0x4d28e1<_0x50b2b9[_0xf917('0x45')];_0x4d28e1+=0x1){_0x521642=_0x50b2b9[_0x4d28e1];if(_[_0xf917('0x43')](_0x5a2981[_0xf917('0x22')][_0x521642['id']])){_0x5a2981['deskAccounts'][_0x521642['id']]=new DeskAccount(_0x521642);}else{_0x5a2981[_0xf917('0x46')](_0x5a2981['deskAccounts'][_0x521642['id']],_0x521642);}}}return _0x5a2981[_0xf917('0x22')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x2d124d=this;return function(_0x5b54f5){if(_0x5b54f5){freeIsNotKey(_0x5b54f5,_0x2d124d['sugarcrmAccounts'],'id');for(var _0x34fc27=0x0,_0x565cbd={},_0xedce8b={};_0x34fc27<_0x5b54f5[_0xf917('0x45')];_0x34fc27+=0x1){_0x565cbd=_0x5b54f5[_0x34fc27];if(_[_0xf917('0x43')](_0x2d124d[_0xf917('0x1f')][_0x565cbd['id']])){_0x2d124d[_0xf917('0x1f')][_0x565cbd['id']]=new SugarcrmAccount(_0x565cbd);}else{_0x2d124d['mergeFromDatabase'](_0x2d124d[_0xf917('0x1f')][_0x565cbd['id']],_0x565cbd);}}}return _0x2d124d[_0xf917('0x1f')];};};Realtime[_0xf917('0x44')]['initVtigerAccounts']=function(){var _0x48f311=this;return function(_0x4e4004){if(_0x4e4004){freeIsNotKey(_0x4e4004,_0x48f311[_0xf917('0x23')],'id');for(var _0x554a22=0x0,_0x2a5d46={},_0x3f8166={};_0x554a22<_0x4e4004[_0xf917('0x45')];_0x554a22+=0x1){_0x2a5d46=_0x4e4004[_0x554a22];if(_[_0xf917('0x43')](_0x48f311[_0xf917('0x23')][_0x2a5d46['id']])){_0x48f311[_0xf917('0x23')][_0x2a5d46['id']]=new VtigerAccount(_0x2a5d46);}else{_0x48f311['mergeFromDatabase'](_0x48f311['vtigerAccounts'][_0x2a5d46['id']],_0x2a5d46);}}}return _0x48f311[_0xf917('0x23')];};};Realtime[_0xf917('0x44')][_0xf917('0x50')]=function(){var _0x13ce12=this;return function(_0x75882b){if(_0x75882b){freeIsNotKey(_0x75882b,_0x13ce12[_0xf917('0x24')],'id');for(var _0x3af55c=0x0,_0x522778={},_0x1fa22f={};_0x3af55c<_0x75882b[_0xf917('0x45')];_0x3af55c+=0x1){_0x522778=_0x75882b[_0x3af55c];if(_[_0xf917('0x43')](_0x13ce12['servicenowAccounts'][_0x522778['id']])){_0x13ce12[_0xf917('0x24')][_0x522778['id']]=new ServicenowAccount(_0x522778);}else{_0x13ce12[_0xf917('0x46')](_0x13ce12['servicenowAccounts'][_0x522778['id']],_0x522778);}}}return _0x13ce12['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x2b84bf=this;return function(_0x50d4fd){if(_0x50d4fd){freeIsNotKey(_0x50d4fd,_0x2b84bf[_0xf917('0x25')],'id');for(var _0x34aafb=0x0,_0x4b17ab={},_0x5314ef={};_0x34aafb<_0x50d4fd[_0xf917('0x45')];_0x34aafb+=0x1){_0x4b17ab=_0x50d4fd[_0x34aafb];if(_[_0xf917('0x43')](_0x2b84bf[_0xf917('0x25')][_0x4b17ab['id']])){_0x2b84bf[_0xf917('0x25')][_0x4b17ab['id']]=new Dynamics365Account(_0x4b17ab);}else{_0x2b84bf[_0xf917('0x46')](_0x2b84bf[_0xf917('0x25')][_0x4b17ab['id']],_0x4b17ab);}}}return _0x2b84bf[_0xf917('0x25')];};};Realtime[_0xf917('0x44')][_0xf917('0x51')]=function(){var _0x29cb9d=this;return function(_0x235058){if(_0x235058){freeIsNotKey(_0x235058,_0x29cb9d[_0xf917('0x26')],'id');for(var _0x89a4cf=0x0,_0x780d56={},_0x586b46={};_0x89a4cf<_0x235058['length'];_0x89a4cf+=0x1){_0x780d56=_0x235058[_0x89a4cf];if(_[_0xf917('0x43')](_0x29cb9d[_0xf917('0x26')][_0x780d56['id']])){_0x29cb9d[_0xf917('0x26')][_0x780d56['id']]=new FreshsalesAccount(_0x780d56);}else{_0x29cb9d[_0xf917('0x46')](_0x29cb9d[_0xf917('0x26')][_0x780d56['id']],_0x780d56);}}}return _0x29cb9d[_0xf917('0x26')];};};Realtime[_0xf917('0x44')][_0xf917('0x52')]=function(){var _0x3c5f47=this;return function(_0x5aa697){for(var _0x561462=0x0;_0x561462<_0x5aa697[_0xf917('0x45')];_0x561462+=0x1){_[_0xf917('0x53')](_0x3c5f47[_0xf917('0x14')][_0x5aa697[_0x561462][_0xf917('0x2b')]],_0x5aa697[_0x561462]);}return _0x3c5f47[_0xf917('0x14')];};};Realtime[_0xf917('0x44')][_0xf917('0x54')]=function(){var _0x1ba1d5=this;return function(_0x1e20a4){clearVoiceQueues(_0x1ba1d5[_0xf917('0x14')]);if(_0x1e20a4){_0x1e20a4=_[_0xf917('0x55')](_0x1e20a4,_0xf917('0x56'));for(var _0x54abb3 in _0x1e20a4){if(_0x1e20a4['hasOwnProperty'](_0x54abb3)){var _0x4d2973={};for(var _0x5d2130=0x0;_0x5d2130<_0x1e20a4[_0x54abb3]['length'];_0x5d2130+=0x1){var _0x45b1df=_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x57')];if(_0x1ba1d5[_0xf917('0x14')][_0x45b1df]){if(_0x1e20a4[_0x54abb3][_0x5d2130]['queuecallerexit']){_0x1ba1d5[_0xf917('0x14')][_0x45b1df][_0xf917('0x36')]+=0x1;}if(_0x1e20a4[_0x54abb3][_0x5d2130]['queuecallerabandon']){_0x1ba1d5[_0xf917('0x14')][_0x45b1df]['abandoned']+=0x1;}_0x1ba1d5[_0xf917('0x14')][_0x45b1df][_0xf917('0x2f')]+=moment(_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x58')])[_0xf917('0x59')](moment(_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x5a')]),'seconds')||0x0;if(_0x5d2130===_0x1e20a4[_0x54abb3][_0xf917('0x45')]-0x1){_0x1ba1d5[_0xf917('0x14')][_0x45b1df][_0xf917('0x30')]+=moment(_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x5b')]||_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x5c')]||_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x5d')])['diff'](moment(_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x5a')]),_0xf917('0x5e'))||0x0;_0x1ba1d5[_0xf917('0x14')][_0x45b1df][_0xf917('0x2e')]+=0x1;if(_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x5f')]){_0x1ba1d5['voiceQueues'][_0x45b1df][_0xf917('0x35')]+=0x1;_0x1ba1d5[_0xf917('0x14')][_0x45b1df]['sumBillable']+=moment(_0x1e20a4[_0x54abb3][_0x5d2130][_0xf917('0x5b')])[_0xf917('0x59')](moment(_0x1e20a4[_0x54abb3][_0x5d2130]['queuecallerleaveAt']),_0xf917('0x5e'))||0x0;}}else{_0x1ba1d5[_0xf917('0x14')][_0x45b1df][_0xf917('0x30')]+=_0x1ba1d5[_0xf917('0x14')][_0x45b1df]['sumHoldTime']||0x0;}}}}}}return _0x1ba1d5[_0xf917('0x14')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x1db6fe=this;return function(_0x371d21){clearVoiceCallReports(_0x1db6fe[_0xf917('0x60')]);if(_0x371d21){for(var _0x196a91=0x0;_0x196a91<_0x371d21['length'];_0x196a91+=0x1){_0x1db6fe[_0xf917('0x60')][_0xf917('0x2e')]+=0x1;_0x1db6fe[_0xf917('0x60')][_0xf917('0x30')]+=_0x371d21[_0x196a91][_0xf917('0x61')];if(_0x371d21[_0x196a91][_0xf917('0x62')]==='ANSWERED'){_0x1db6fe[_0xf917('0x60')][_0xf917('0x35')]+=0x1;_0x1db6fe[_0xf917('0x60')][_0xf917('0x2f')]+=_0x371d21[_0x196a91]['duration']-_0x371d21[_0x196a91][_0xf917('0x63')]||0x0;_0x1db6fe['outbound']['sumBillable']+=_0x371d21[_0x196a91][_0xf917('0x63')];}}}return _0x1db6fe[_0xf917('0x60')];};};Realtime[_0xf917('0x44')][_0xf917('0x64')]=function(){var _0x4ec15b=this;return function(_0x1c8491){if(_0x1c8491){freeIsNotKey(_0x1c8491,_0x4ec15b[_0xf917('0x15')],_0xf917('0x2b'));for(var _0x253cba=0x0,_0x5b7964={};_0x253cba<_0x1c8491['length'];_0x253cba+=0x1){_0x5b7964=_0x1c8491[_0x253cba];if(_[_0xf917('0x43')](_0x4ec15b[_0xf917('0x15')][_0x5b7964[_0xf917('0x2b')]])){_0x4ec15b[_0xf917('0x15')][_0x5b7964[_0xf917('0x2b')]]=new Campaign(_0x5b7964);}else{_0x4ec15b['mergeFromDatabase'](_0x4ec15b[_0xf917('0x15')][_0x5b7964[_0xf917('0x2b')]],_0x5b7964);_0x4ec15b[_0xf917('0x15')][_0x5b7964[_0xf917('0x2b')]][_0xf917('0x65')]=_0x5b7964['SquareProject']?_0x5b7964[_0xf917('0x66')][_0xf917('0x2b')]:undefined;}}}return _0x4ec15b[_0xf917('0x15')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x551b78=this;return function(_0x26f5d8){if(_0x26f5d8){freeIsNotKey(_0x26f5d8,_0x551b78[_0xf917('0x17')],'id');for(var _0x2ab8a8=0x0,_0x4cd677={};_0x2ab8a8<_0x26f5d8[_0xf917('0x45')];_0x2ab8a8+=0x1){_0x4cd677=_0x26f5d8[_0x2ab8a8];if(_[_0xf917('0x43')](_0x551b78[_0xf917('0x17')][_0x4cd677['id']])){_0x551b78[_0xf917('0x17')][_0x4cd677['id']]=new VoiceExtension(_0x4cd677);}else{_0x551b78[_0xf917('0x46')](_0x551b78['voiceExtensions'][_0x4cd677['id']],_0x4cd677);}}}return _0x551b78[_0xf917('0x17')];};};Realtime['prototype'][_0xf917('0x67')]=function(){var _0x1bc9e2=this;return function(_0x220621){clearCampaigns(_0x1bc9e2[_0xf917('0x15')]);for(var _0x44c015=0x0;_0x44c015<_0x220621[_0xf917('0x45')];_0x44c015+=0x1){_['merge'](_0x1bc9e2['campaigns'][_0x220621[_0x44c015][_0xf917('0x2b')]],_0x220621[_0x44c015]);}return _0x1bc9e2['campaigns'];};};Realtime['prototype'][_0xf917('0x68')]=function(){var _0x2667ff=this;return function(_0x26b414){if(_0x26b414){freeIsNotKey(_0x26b414,_0x2667ff[_0xf917('0x69')],'id');for(var _0x44c1f3=0x0,_0x5bd958={},_0x260a55={};_0x44c1f3<_0x26b414['length'];_0x44c1f3+=0x1){_0x5bd958=_0x26b414[_0x44c1f3];if(_[_0xf917('0x43')](_0x2667ff['faxAccounts'][_0x5bd958['id']])){_0x2667ff[_0xf917('0x69')][_0x5bd958['id']]=new FaxAccount(_0x5bd958);}else{_0x2667ff[_0xf917('0x46')](_0x2667ff['faxAccounts'][_0x5bd958['id']],_0x5bd958);}}}return _0x2667ff[_0xf917('0x69')];};};module['exports']=Realtime; \ No newline at end of file +var _0x2b34=['merge','initVoiceQueueReports','uniqueid','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','answered','queuecallerleaveAt','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','../model/agent','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','triggers','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isNil','isUndefined','initTelephones','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory'];(function(_0x4b1643,_0x270da2){var _0x412a67=function(_0xb36e99){while(--_0xb36e99){_0x4b1643['push'](_0x4b1643['shift']());}};_0x412a67(++_0x270da2);}(_0x2b34,0x165));var _0x42b3=function(_0x1d69d2,_0x2ef689){_0x1d69d2=_0x1d69d2-0x0;var _0x10b3ba=_0x2b34[_0x1d69d2];return _0x10b3ba;};'use strict';var util=require(_0x42b3('0x0'));var _=require(_0x42b3('0x1'));var moment=require('moment');var Agent=require(_0x42b3('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x42b3('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x42b3('0x4'));var Template=require(_0x42b3('0x5'));var Campaign=require(_0x42b3('0x6'));var VoiceExtension=require(_0x42b3('0x7'));var ZendeskAccount=require(_0x42b3('0x8'));var SalesforceAccount=require(_0x42b3('0x9'));var FreshdeskAccount=require(_0x42b3('0xa'));var SugarcrmAccount=require(_0x42b3('0xb'));var ZohoAccount=require(_0x42b3('0xc'));var DeskAccount=require(_0x42b3('0xd'));var VtigerAccount=require(_0x42b3('0xe'));var ServicenowAccount=require(_0x42b3('0xf'));var Dynamics365Account=require(_0x42b3('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x42b3('0x11'));var Realtime=function(){this[_0x42b3('0x12')]={};this[_0x42b3('0x13')]={};this[_0x42b3('0x14')]={};this['voiceQueues']={};this[_0x42b3('0x15')]={};this['campaigns']={};this[_0x42b3('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x42b3('0x17')]={};this[_0x42b3('0x18')]={};this[_0x42b3('0x19')]={};this[_0x42b3('0x1a')]={};this[_0x42b3('0x1b')]={};this[_0x42b3('0x1c')]={};this[_0x42b3('0x1d')]={};this[_0x42b3('0x1e')]={};this[_0x42b3('0x1f')]={};this[_0x42b3('0x20')]={};this[_0x42b3('0x21')]={};this[_0x42b3('0x22')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this[_0x42b3('0x23')]={};};function freeIsNotKey(_0x5706c3,_0x180e8f,_0x2be7a6){var _0x498e16=_[_0x42b3('0x24')](_0x5706c3,function(_0x24de80,_0x434ab8){return _0x24de80[_0x2be7a6];});for(var _0x24b218 in _0x180e8f){if(_0x180e8f[_0x42b3('0x25')](_0x24b218)){if(!_0x498e16[_0x24b218]){delete _0x180e8f[_0x24b218];}}}}function freeIsNotKeySip(_0x37bda3,_0x2e23ab){var _0x331aec=_['mapKeys'](_0x37bda3,function(_0x539f21,_0x2b62ea){return util[_0x42b3('0x26')](_0x42b3('0x27'),_0x539f21[_0x42b3('0x28')]);});for(var _0x4baa33 in _0x2e23ab){if(_0x2e23ab[_0x42b3('0x25')](_0x4baa33)){if(!_0x331aec[_0x4baa33]){delete _0x2e23ab[_0x4baa33];}}}}function freeIsNotKeyAgent(_0x3b0de9,_0x41d4d5){var _0x2625de=_[_0x42b3('0x24')](_0x3b0de9,function(_0x3be7a1,_0x29cede){var _0x3e3ad4=_['isNil'](_0x3be7a1[_0x42b3('0x29')])?util[_0x42b3('0x26')](_0x42b3('0x27'),_0x3be7a1[_0x42b3('0x28')]):_0x3be7a1['interface'];return _0x3e3ad4;});for(var _0x51f23e in _0x41d4d5){if(_0x41d4d5[_0x42b3('0x25')](_0x51f23e)){if(!_0x2625de[_0x51f23e]){delete _0x41d4d5[_0x51f23e];}}}}function clearVoiceCallReports(_0x5b266d){_0x5b266d[_0x42b3('0x2a')]=0x0;_0x5b266d['answered']=0x0;_0x5b266d['sumHoldTime']=0x0;_0x5b266d[_0x42b3('0x2b')]=0x0;_0x5b266d[_0x42b3('0x2c')]=0x0;}function clearCampaigns(_0x247dc1){if(!_[_0x42b3('0x2d')](_0x247dc1)){for(var _0x2c2f1e in _0x247dc1){if(_0x247dc1[_0x42b3('0x25')](_0x2c2f1e)){_0x247dc1[_0x2c2f1e][_0x42b3('0x2e')]=0x0;_0x247dc1[_0x2c2f1e][_0x42b3('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x2cf535){if(!_['isEmpty'](_0x2cf535)){for(var _0x26e1be in _0x2cf535){if(_0x2cf535[_0x42b3('0x25')](_0x26e1be)){_0x2cf535[_0x26e1be]['total']=0x0;_0x2cf535[_0x26e1be]['answered']=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x30')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x31')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x32')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x2b')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x2c')]=0x0;_0x2cf535[_0x26e1be]['outboundAnswerAgiCallsDay']=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x33')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x34')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x35')]=0x0;_0x2cf535[_0x26e1be]['outboundNoSuchCallsDay']=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x36')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x37')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x38')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x39')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x3a')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x3b')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x3c')]=0x0;_0x2cf535[_0x26e1be]['outboundAnswerAgiCallsDay']=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x3d')]=0x0;_0x2cf535[_0x26e1be][_0x42b3('0x3e')]=!![];}}}}Realtime[_0x42b3('0x3f')][_0x42b3('0x40')]=function(_0x1f719d,_0x2f25e8){for(var _0x601133 in _0x2f25e8){if(_0x1f719d[_0x42b3('0x25')](_0x601133)){_0x1f719d[_0x601133]=_0x2f25e8[_0x601133];}}};Realtime[_0x42b3('0x3f')]['initAgents']=function(){var _0x5323ae=this;return function(_0x52390f){if(_0x52390f){freeIsNotKeyAgent(_0x52390f,_0x5323ae[_0x42b3('0x12')]);for(var _0x26ff7e=0x0,_0x439c2e={},_0x2c8b7a={};_0x26ff7e<_0x52390f[_0x42b3('0x41')];_0x26ff7e+=0x1){_0x439c2e=_0x52390f[_0x26ff7e];var _0x2faf2b=_[_0x42b3('0x42')](_0x439c2e['interface'])?util[_0x42b3('0x26')](_0x42b3('0x27'),_0x439c2e[_0x42b3('0x28')]):_0x439c2e['interface'];if(_[_0x42b3('0x43')](_0x5323ae[_0x42b3('0x12')][_0x2faf2b])){_0x5323ae[_0x42b3('0x12')][_0x2faf2b]=new Agent(_0x439c2e);}else{_0x5323ae[_0x42b3('0x40')](_0x5323ae[_0x42b3('0x12')][_0x2faf2b],_0x439c2e);}}}return _0x5323ae[_0x42b3('0x12')];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x44')]=function(){var _0x3b0db3=this;return function(_0xd39461){if(_0xd39461){freeIsNotKeySip(_0xd39461,_0x3b0db3[_0x42b3('0x13')]);for(var _0x3ffcc5=0x0,_0x15db22={},_0xb98cf9={};_0x3ffcc5<_0xd39461['length'];_0x3ffcc5+=0x1){_0x15db22=_0xd39461[_0x3ffcc5];if(_[_0x42b3('0x43')](_0x3b0db3[_0x42b3('0x13')][util['format'](_0x42b3('0x27'),_0x15db22[_0x42b3('0x28')])])){_0x3b0db3[_0x42b3('0x13')][util[_0x42b3('0x26')]('SIP/%s',_0x15db22[_0x42b3('0x28')])]=new Telephone(_0x15db22);}else{_0x3b0db3['mergeFromDatabase'](_0x3b0db3[_0x42b3('0x13')][util[_0x42b3('0x26')](_0x42b3('0x27'),_0x15db22[_0x42b3('0x28')])],_0x15db22);}}}return _0x3b0db3['telephones'];};};Realtime[_0x42b3('0x3f')]['initTrunks']=function(){var _0x3996e6=this;return function(_0x24daf1){if(_0x24daf1){freeIsNotKeySip(_0x24daf1,_0x3996e6[_0x42b3('0x14')]);for(var _0xb27afc=0x0,_0x168cf0={},_0x464700={};_0xb27afc<_0x24daf1['length'];_0xb27afc+=0x1){_0x168cf0=_0x24daf1[_0xb27afc];if(_[_0x42b3('0x43')](_0x3996e6['trunks'][util['format']('SIP/%s',_0x168cf0[_0x42b3('0x28')])])){_0x3996e6[_0x42b3('0x14')][util[_0x42b3('0x26')]('SIP/%s',_0x168cf0[_0x42b3('0x28')])]=new Trunk(_0x168cf0);}else{_0x3996e6[_0x42b3('0x40')](_0x3996e6['trunks'][util[_0x42b3('0x26')]('SIP/%s',_0x168cf0[_0x42b3('0x28')])],_0x168cf0);}}}return _0x3996e6[_0x42b3('0x14')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x40742b=this;return function(_0x2d4538){if(_0x2d4538){freeIsNotKey(_0x2d4538,_0x40742b['voiceQueues'],_0x42b3('0x28'));for(var _0x50bf44=0x0,_0x31a4ac={},_0x3b82f2={};_0x50bf44<_0x2d4538[_0x42b3('0x41')];_0x50bf44+=0x1){_0x31a4ac=_0x2d4538[_0x50bf44];if(_[_0x42b3('0x43')](_0x40742b['voiceQueues'][_0x31a4ac[_0x42b3('0x28')]])){_0x40742b[_0x42b3('0x45')][_0x31a4ac[_0x42b3('0x28')]]=new VoiceQueue(_0x31a4ac);}else{_0x40742b[_0x42b3('0x40')](_0x40742b[_0x42b3('0x45')][_0x31a4ac[_0x42b3('0x28')]],_0x31a4ac);}}}return _0x40742b[_0x42b3('0x45')];};};Realtime['prototype'][_0x42b3('0x46')]=function(){var _0x15fa1c=this;return function(_0x34b4b3){if(_0x34b4b3){freeIsNotKey(_0x34b4b3,_0x15fa1c[_0x42b3('0x15')],'id');for(var _0xc29134=0x0,_0xc893d4={},_0x348349={};_0xc29134<_0x34b4b3[_0x42b3('0x41')];_0xc29134+=0x1){_0xc893d4=_0x34b4b3[_0xc29134];if(_[_0x42b3('0x43')](_0x15fa1c['triggers'][_0xc893d4['id']])){_0x15fa1c[_0x42b3('0x15')][_0xc893d4['id']]=new Trigger(_0xc893d4);}else{_0x15fa1c[_0x42b3('0x40')](_0x15fa1c[_0x42b3('0x15')][_0xc893d4['id']],_0xc893d4);}}}return _0x15fa1c[_0x42b3('0x15')];};};Realtime['prototype'][_0x42b3('0x47')]=function(){var _0x37fb17=this;return function(_0x2bfa3a){if(_0x2bfa3a){freeIsNotKey(_0x2bfa3a,_0x37fb17[_0x42b3('0x16')],'id');for(var _0x2b142a=0x0,_0x511dea={},_0xbcf122={};_0x2b142a<_0x2bfa3a[_0x42b3('0x41')];_0x2b142a+=0x1){_0x511dea=_0x2bfa3a[_0x2b142a];if(_[_0x42b3('0x43')](_0x37fb17['templates'][_0x511dea['id']])){_0x37fb17[_0x42b3('0x16')][_0x511dea['id']]=new Template(_0x511dea);}else{_0x37fb17['mergeFromDatabase'](_0x37fb17[_0x42b3('0x16')][_0x511dea['id']],_0x511dea);}}}return _0x37fb17[_0x42b3('0x16')];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x48')]=function(){var _0x514da2=this;return function(_0x22e36a){if(_0x22e36a){freeIsNotKey(_0x22e36a,_0x514da2[_0x42b3('0x1d')],'id');for(var _0x56733c=0x0,_0x1d44d4={},_0x53eb8f={};_0x56733c<_0x22e36a['length'];_0x56733c+=0x1){_0x1d44d4=_0x22e36a[_0x56733c];if(_[_0x42b3('0x43')](_0x514da2[_0x42b3('0x1d')][_0x1d44d4['id']])){_0x514da2[_0x42b3('0x1d')][_0x1d44d4['id']]=new ZendeskAccount(_0x1d44d4);}else{_0x514da2['mergeFromDatabase'](_0x514da2[_0x42b3('0x1d')][_0x1d44d4['id']],_0x1d44d4);}}}return _0x514da2[_0x42b3('0x1d')];};};Realtime['prototype'][_0x42b3('0x49')]=function(){var _0xf582b=this;return function(_0x3337a2){if(_0x3337a2){freeIsNotKey(_0x3337a2,_0xf582b[_0x42b3('0x1e')],'id');for(var _0x3bd92c=0x0,_0x6035f9={},_0x2b01bc={};_0x3bd92c<_0x3337a2[_0x42b3('0x41')];_0x3bd92c+=0x1){_0x6035f9=_0x3337a2[_0x3bd92c];if(_[_0x42b3('0x43')](_0xf582b[_0x42b3('0x1e')][_0x6035f9['id']])){_0xf582b[_0x42b3('0x1e')][_0x6035f9['id']]=new SalesforceAccount(_0x6035f9);}else{_0xf582b['mergeFromDatabase'](_0xf582b[_0x42b3('0x1e')][_0x6035f9['id']],_0x6035f9);}}}return _0xf582b[_0x42b3('0x1e')];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x4a')]=function(){var _0x5d48ab=this;return function(_0x2c8caf){if(_0x2c8caf){freeIsNotKey(_0x2c8caf,_0x5d48ab[_0x42b3('0x20')],'id');for(var _0x2ba88e=0x0,_0x6e3f5d={},_0x22ea9e={};_0x2ba88e<_0x2c8caf[_0x42b3('0x41')];_0x2ba88e+=0x1){_0x6e3f5d=_0x2c8caf[_0x2ba88e];if(_[_0x42b3('0x43')](_0x5d48ab[_0x42b3('0x20')][_0x6e3f5d['id']])){_0x5d48ab['freshdeskAccounts'][_0x6e3f5d['id']]=new FreshdeskAccount(_0x6e3f5d);}else{_0x5d48ab['mergeFromDatabase'](_0x5d48ab[_0x42b3('0x20')][_0x6e3f5d['id']],_0x6e3f5d);}}}return _0x5d48ab[_0x42b3('0x20')];};};Realtime['prototype'][_0x42b3('0x4b')]=function(){var _0x41b8f0=this;return function(_0x1345a9){if(_0x1345a9){freeIsNotKey(_0x1345a9,_0x41b8f0[_0x42b3('0x21')],'id');for(var _0x839191=0x0,_0x114fe7={},_0x3ef055={};_0x839191<_0x1345a9[_0x42b3('0x41')];_0x839191+=0x1){_0x114fe7=_0x1345a9[_0x839191];if(_[_0x42b3('0x43')](_0x41b8f0['zohoAccounts'][_0x114fe7['id']])){_0x41b8f0[_0x42b3('0x21')][_0x114fe7['id']]=new ZohoAccount(_0x114fe7);}else{_0x41b8f0['mergeFromDatabase'](_0x41b8f0[_0x42b3('0x21')][_0x114fe7['id']],_0x114fe7);}}}return _0x41b8f0[_0x42b3('0x21')];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x4c')]=function(){var _0x54cafc=this;return function(_0x2fbaec){if(_0x2fbaec){freeIsNotKey(_0x2fbaec,_0x54cafc[_0x42b3('0x22')],'id');for(var _0x4fdc3f=0x0,_0x146835={},_0x3b0fae={};_0x4fdc3f<_0x2fbaec[_0x42b3('0x41')];_0x4fdc3f+=0x1){_0x146835=_0x2fbaec[_0x4fdc3f];if(_['isUndefined'](_0x54cafc[_0x42b3('0x22')][_0x146835['id']])){_0x54cafc[_0x42b3('0x22')][_0x146835['id']]=new DeskAccount(_0x146835);}else{_0x54cafc[_0x42b3('0x40')](_0x54cafc['deskAccounts'][_0x146835['id']],_0x146835);}}}return _0x54cafc['deskAccounts'];};};Realtime['prototype'][_0x42b3('0x4d')]=function(){var _0x4a88ff=this;return function(_0x5e1eda){if(_0x5e1eda){freeIsNotKey(_0x5e1eda,_0x4a88ff[_0x42b3('0x1f')],'id');for(var _0x47b715=0x0,_0x3de8cc={},_0x239e0c={};_0x47b715<_0x5e1eda[_0x42b3('0x41')];_0x47b715+=0x1){_0x3de8cc=_0x5e1eda[_0x47b715];if(_[_0x42b3('0x43')](_0x4a88ff['sugarcrmAccounts'][_0x3de8cc['id']])){_0x4a88ff[_0x42b3('0x1f')][_0x3de8cc['id']]=new SugarcrmAccount(_0x3de8cc);}else{_0x4a88ff['mergeFromDatabase'](_0x4a88ff[_0x42b3('0x1f')][_0x3de8cc['id']],_0x3de8cc);}}}return _0x4a88ff[_0x42b3('0x1f')];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x4e')]=function(){var _0xe24db7=this;return function(_0x53ac5b){if(_0x53ac5b){freeIsNotKey(_0x53ac5b,_0xe24db7[_0x42b3('0x4f')],'id');for(var _0x2af538=0x0,_0x2dac52={},_0x5d228a={};_0x2af538<_0x53ac5b['length'];_0x2af538+=0x1){_0x2dac52=_0x53ac5b[_0x2af538];if(_[_0x42b3('0x43')](_0xe24db7[_0x42b3('0x4f')][_0x2dac52['id']])){_0xe24db7['vtigerAccounts'][_0x2dac52['id']]=new VtigerAccount(_0x2dac52);}else{_0xe24db7['mergeFromDatabase'](_0xe24db7[_0x42b3('0x4f')][_0x2dac52['id']],_0x2dac52);}}}return _0xe24db7['vtigerAccounts'];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x50')]=function(){var _0x4adb41=this;return function(_0x51cfe8){if(_0x51cfe8){freeIsNotKey(_0x51cfe8,_0x4adb41[_0x42b3('0x51')],'id');for(var _0x40e76b=0x0,_0x2ac28e={},_0x2a074d={};_0x40e76b<_0x51cfe8[_0x42b3('0x41')];_0x40e76b+=0x1){_0x2ac28e=_0x51cfe8[_0x40e76b];if(_['isUndefined'](_0x4adb41[_0x42b3('0x51')][_0x2ac28e['id']])){_0x4adb41[_0x42b3('0x51')][_0x2ac28e['id']]=new ServicenowAccount(_0x2ac28e);}else{_0x4adb41[_0x42b3('0x40')](_0x4adb41['servicenowAccounts'][_0x2ac28e['id']],_0x2ac28e);}}}return _0x4adb41[_0x42b3('0x51')];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x52')]=function(){var _0x3ccd9e=this;return function(_0x1b64fa){if(_0x1b64fa){freeIsNotKey(_0x1b64fa,_0x3ccd9e[_0x42b3('0x53')],'id');for(var _0x1795a6=0x0,_0x1018ca={},_0x1ce17e={};_0x1795a6<_0x1b64fa[_0x42b3('0x41')];_0x1795a6+=0x1){_0x1018ca=_0x1b64fa[_0x1795a6];if(_[_0x42b3('0x43')](_0x3ccd9e[_0x42b3('0x53')][_0x1018ca['id']])){_0x3ccd9e[_0x42b3('0x53')][_0x1018ca['id']]=new Dynamics365Account(_0x1018ca);}else{_0x3ccd9e['mergeFromDatabase'](_0x3ccd9e[_0x42b3('0x53')][_0x1018ca['id']],_0x1018ca);}}}return _0x3ccd9e[_0x42b3('0x53')];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x54')]=function(){var _0x1b1f75=this;return function(_0x1d0b17){if(_0x1d0b17){freeIsNotKey(_0x1d0b17,_0x1b1f75[_0x42b3('0x55')],'id');for(var _0x4c600f=0x0,_0x46756e={},_0x3ae336={};_0x4c600f<_0x1d0b17[_0x42b3('0x41')];_0x4c600f+=0x1){_0x46756e=_0x1d0b17[_0x4c600f];if(_[_0x42b3('0x43')](_0x1b1f75[_0x42b3('0x55')][_0x46756e['id']])){_0x1b1f75['freshsalesAccounts'][_0x46756e['id']]=new FreshsalesAccount(_0x46756e);}else{_0x1b1f75[_0x42b3('0x40')](_0x1b1f75[_0x42b3('0x55')][_0x46756e['id']],_0x46756e);}}}return _0x1b1f75[_0x42b3('0x55')];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x56')]=function(){var _0x355306=this;return function(_0x59294b){for(var _0x979aa7=0x0;_0x979aa7<_0x59294b['length'];_0x979aa7+=0x1){_[_0x42b3('0x57')](_0x355306[_0x42b3('0x45')][_0x59294b[_0x979aa7][_0x42b3('0x28')]],_0x59294b[_0x979aa7]);}return _0x355306['voiceQueues'];};};Realtime['prototype'][_0x42b3('0x58')]=function(){var _0x34294d=this;return function(_0x5aed15){clearVoiceQueues(_0x34294d[_0x42b3('0x45')]);if(_0x5aed15){_0x5aed15=_['groupBy'](_0x5aed15,_0x42b3('0x59'));for(var _0x477b62 in _0x5aed15){if(_0x5aed15[_0x42b3('0x25')](_0x477b62)){var _0x43c8e0={};for(var _0x32ce22=0x0;_0x32ce22<_0x5aed15[_0x477b62][_0x42b3('0x41')];_0x32ce22+=0x1){var _0xf94a67=_0x5aed15[_0x477b62][_0x32ce22]['queue'];if(_0x34294d[_0x42b3('0x45')][_0xf94a67]){if(_0x5aed15[_0x477b62][_0x32ce22]['queuecallerexit']){_0x34294d[_0x42b3('0x45')][_0xf94a67][_0x42b3('0x30')]+=0x1;}if(_0x5aed15[_0x477b62][_0x32ce22][_0x42b3('0x5a')]){_0x34294d[_0x42b3('0x45')][_0xf94a67][_0x42b3('0x31')]+=0x1;}_0x34294d[_0x42b3('0x45')][_0xf94a67][_0x42b3('0x32')]+=moment(_0x5aed15[_0x477b62][_0x32ce22]['queuecallerleaveAt'])[_0x42b3('0x5b')](moment(_0x5aed15[_0x477b62][_0x32ce22][_0x42b3('0x5c')]),_0x42b3('0x5d'))||0x0;if(_0x32ce22===_0x5aed15[_0x477b62][_0x42b3('0x41')]-0x1){_0x34294d['voiceQueues'][_0xf94a67][_0x42b3('0x2b')]+=moment(_0x5aed15[_0x477b62][_0x32ce22][_0x42b3('0x5e')]||_0x5aed15[_0x477b62][_0x32ce22]['queuecallerabandonAt']||_0x5aed15[_0x477b62][_0x32ce22][_0x42b3('0x5f')])['diff'](moment(_0x5aed15[_0x477b62][_0x32ce22][_0x42b3('0x5c')]),_0x42b3('0x5d'))||0x0;_0x34294d['voiceQueues'][_0xf94a67][_0x42b3('0x2a')]+=0x1;if(_0x5aed15[_0x477b62][_0x32ce22][_0x42b3('0x60')]){_0x34294d[_0x42b3('0x45')][_0xf94a67][_0x42b3('0x61')]+=0x1;_0x34294d[_0x42b3('0x45')][_0xf94a67][_0x42b3('0x2c')]+=moment(_0x5aed15[_0x477b62][_0x32ce22][_0x42b3('0x5e')])['diff'](moment(_0x5aed15[_0x477b62][_0x32ce22][_0x42b3('0x62')]),'seconds')||0x0;}}else{_0x34294d['voiceQueues'][_0xf94a67][_0x42b3('0x2b')]+=_0x34294d[_0x42b3('0x45')][_0xf94a67][_0x42b3('0x32')]||0x0;}}}}}}return _0x34294d['voiceQueues'];};};Realtime[_0x42b3('0x3f')]['initVoiceCallReports']=function(){var _0x204809=this;return function(_0x44dd75){clearVoiceCallReports(_0x204809[_0x42b3('0x63')]);if(_0x44dd75){for(var _0x4e3bc0=0x0;_0x4e3bc0<_0x44dd75[_0x42b3('0x41')];_0x4e3bc0+=0x1){_0x204809[_0x42b3('0x63')][_0x42b3('0x2a')]+=0x1;_0x204809[_0x42b3('0x63')][_0x42b3('0x2b')]+=_0x44dd75[_0x4e3bc0]['duration'];if(_0x44dd75[_0x4e3bc0][_0x42b3('0x64')]===_0x42b3('0x65')){_0x204809['outbound'][_0x42b3('0x61')]+=0x1;_0x204809[_0x42b3('0x63')][_0x42b3('0x32')]+=_0x44dd75[_0x4e3bc0][_0x42b3('0x66')]-_0x44dd75[_0x4e3bc0][_0x42b3('0x67')]||0x0;_0x204809[_0x42b3('0x63')]['sumBillable']+=_0x44dd75[_0x4e3bc0]['billableseconds'];}}}return _0x204809['outbound'];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x68')]=function(){var _0x175a97=this;return function(_0x55333d){if(_0x55333d){freeIsNotKey(_0x55333d,_0x175a97['campaigns'],_0x42b3('0x28'));for(var _0x115199=0x0,_0x40cff1={};_0x115199<_0x55333d[_0x42b3('0x41')];_0x115199+=0x1){_0x40cff1=_0x55333d[_0x115199];if(_[_0x42b3('0x43')](_0x175a97['campaigns'][_0x40cff1['name']])){_0x175a97[_0x42b3('0x69')][_0x40cff1[_0x42b3('0x28')]]=new Campaign(_0x40cff1);}else{_0x175a97[_0x42b3('0x40')](_0x175a97[_0x42b3('0x69')][_0x40cff1['name']],_0x40cff1);_0x175a97['campaigns'][_0x40cff1[_0x42b3('0x28')]]['dialQueueProject']=_0x40cff1[_0x42b3('0x6a')]?_0x40cff1[_0x42b3('0x6a')][_0x42b3('0x28')]:undefined;}}}return _0x175a97['campaigns'];};};Realtime['prototype'][_0x42b3('0x6b')]=function(){var _0x2de9c2=this;return function(_0x5424c3){if(_0x5424c3){freeIsNotKey(_0x5424c3,_0x2de9c2['voiceExtensions'],'id');for(var _0x332265=0x0,_0x5390d4={};_0x332265<_0x5424c3[_0x42b3('0x41')];_0x332265+=0x1){_0x5390d4=_0x5424c3[_0x332265];if(_[_0x42b3('0x43')](_0x2de9c2[_0x42b3('0x17')][_0x5390d4['id']])){_0x2de9c2[_0x42b3('0x17')][_0x5390d4['id']]=new VoiceExtension(_0x5390d4);}else{_0x2de9c2[_0x42b3('0x40')](_0x2de9c2[_0x42b3('0x17')][_0x5390d4['id']],_0x5390d4);}}}return _0x2de9c2['voiceExtensions'];};};Realtime[_0x42b3('0x3f')][_0x42b3('0x6c')]=function(){var _0x3776fa=this;return function(_0x3e2422){clearCampaigns(_0x3776fa['campaigns']);for(var _0x4e64c1=0x0;_0x4e64c1<_0x3e2422[_0x42b3('0x41')];_0x4e64c1+=0x1){_[_0x42b3('0x57')](_0x3776fa[_0x42b3('0x69')][_0x3e2422[_0x4e64c1][_0x42b3('0x28')]],_0x3e2422[_0x4e64c1]);}return _0x3776fa['campaigns'];};};Realtime['prototype'][_0x42b3('0x6d')]=function(){var _0x3a9390=this;return function(_0xef0b77){if(_0xef0b77){freeIsNotKey(_0xef0b77,_0x3a9390[_0x42b3('0x23')],'id');for(var _0x19b3e2=0x0,_0x730989={},_0x1a5d76={};_0x19b3e2<_0xef0b77[_0x42b3('0x41')];_0x19b3e2+=0x1){_0x730989=_0xef0b77[_0x19b3e2];if(_[_0x42b3('0x43')](_0x3a9390['faxAccounts'][_0x730989['id']])){_0x3a9390[_0x42b3('0x23')][_0x730989['id']]=new FaxAccount(_0x730989);}else{_0x3a9390[_0x42b3('0x40')](_0x3a9390[_0x42b3('0x23')][_0x730989['id']],_0x730989);}}}return _0x3a9390[_0x42b3('0x23')];};};module[_0x42b3('0x6e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index b7ab397..a003af3 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 _0x92f7=['uniqueid','blindTransfer','UserId','split','membername','monitor','monitors','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','transfererlinkedid','lodash','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','attendedtransfer','attendedTransfer','prototype','findAgent','accountcode','find','interface','SIP/%s','name','assigned','lastAssignedTo','isNil','format','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','agents','length','getCallType','channel','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x92f7,0xc9));var _0x792f=function(_0x86c6cb,_0x30bb53){_0x86c6cb=_0x86c6cb-0x0;var _0x1b1592=_0x92f7[_0x86c6cb];return _0x1b1592;};'use strict';var _=require(_0x792f('0x0'));var moment=require(_0x792f('0x1'));var util=require(_0x792f('0x2'));var config=require(_0x792f('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x792f('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x792f('0x5'));var RpcMemberReport=require(_0x792f('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x792f('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x792f('0x8'));var VoiceDialReport=require(_0x792f('0x9'));var UserReport=require(_0x792f('0xa'));function Report(_0x42aac9){this[_0x792f('0xb')]=_0x42aac9;this['agents']=_0x42aac9['agents'];this[_0x792f('0xc')]=_0x42aac9[_0x792f('0xc')];}Report['prototype'][_0x792f('0xd')]=function(_0x563b7c){var _0x34d015=new VoiceQueueReport(this[_0x792f('0xb')]);var _0x3792b2=new VoiceAgentReport(this[_0x792f('0xb')]);var _0x11b47d=new VoiceDialReport(this[_0x792f('0xb')]);var _0x515e0d=new VoiceCallReport(this[_0x792f('0xb')]);var _0x4e9121=new UserReport(this[_0x792f('0xb')]);if(config[_0x792f('0xe')]&&config[_0x792f('0xe')][_0x792f('0xf')]){ami['on'](_0x792f('0x10'),this[_0x792f('0x11')][_0x792f('0x12')](this));ami['on']('custom:voiceCallReport',this[_0x792f('0x13')]['bind'](this));ami['on'](_0x792f('0x14'),this[_0x792f('0x15')][_0x792f('0x12')](this));ami['on']('custom:voiceDialReport',this[_0x792f('0x16')][_0x792f('0x12')](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on'](_0x792f('0x17'),this[_0x792f('0x18')][_0x792f('0x12')](this));}};Report[_0x792f('0x19')][_0x792f('0x1a')]=function(_0x4dde8f){var _0x1af0f0;_0x1af0f0=_['find'](this['agents'],function(_0x352bd3){return _0x352bd3[_0x792f('0x1b')]==_0x4dde8f||_0x352bd3['name']==_0x4dde8f;});if(_['isNil'](_0x1af0f0)){var _0x37e4a9=_[_0x792f('0x1c')](this[_0x792f('0xc')],function(_0x450a00){return _0x450a00[_0x792f('0x1b')]==_0x4dde8f||_0x450a00['name']==_0x4dde8f;});if(_0x37e4a9){_0x1af0f0=_[_0x792f('0x1c')](this['agents'],function(_0xdb14d){return _0xdb14d[_0x792f('0x1d')]==util['format'](_0x792f('0x1e'),_0x37e4a9[_0x792f('0x1f')]);});}}return _0x1af0f0;};Report['prototype'][_0x792f('0x11')]=function(_0x143bdb){for(var _0x2ccd63=0x0;_0x2ccd63<_0x143bdb['length'];_0x2ccd63+=0x1){var _0x89fd4a=this['findAgent'](_0x143bdb[_0x2ccd63]['connectedlinenum']);if(_0x89fd4a){_0x143bdb[_0x2ccd63][_0x792f('0x1b')]=_0x89fd4a[_0x792f('0x1b')];_0x143bdb[_0x2ccd63][_0x792f('0x20')]=!![];_0x143bdb[_0x2ccd63][_0x792f('0x21')]=_0x89fd4a[_0x792f('0x1f')];_0x143bdb[_0x2ccd63][_0x792f('0x1d')]=_[_0x792f('0x22')](_0x89fd4a[_0x792f('0x1d')])?util[_0x792f('0x23')](_0x792f('0x1e'),_0x89fd4a[_0x792f('0x1f')]):_0x89fd4a[_0x792f('0x1d')];if(_0x143bdb[_0x2ccd63][_0x792f('0x24')]){_0x143bdb[_0x2ccd63]['queuecallercompleteAt']=moment()[_0x792f('0x23')](_0x792f('0x25'));}if(_0x143bdb[_0x2ccd63][_0x792f('0x26')]){_0x143bdb[_0x2ccd63][_0x792f('0x27')]=moment()[_0x792f('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x792f('0x11')](_0x143bdb[_0x2ccd63]);}RpcVoiceQueueReport[_0x792f('0x28')](_0x143bdb[_0x2ccd63]);}};function extractCalleridNumber(_0x4e26c1){var _0x32f0e7=_0x4e26c1[_0x792f('0x29')](/<(.*?)>/);return _0x32f0e7?_0x32f0e7[0x1]:_0x4e26c1;}Report[_0x792f('0x19')][_0x792f('0x2a')]=function(_0x180b6c){for(var _0x1175aa=0x0;_0x1175aa/);return _0x38e9cf?_0x38e9cf[0x1]:_0x26c5bf;}Report['prototype']['getAgentByInternal']=function(_0x1596c5){for(var _0xef68c6=0x0;_0xef68c6',_0x1cea2a[_0xe84a('0x44')],_0x1cea2a[_0xe84a('0x34')]);}if(RpcVoiceTransferReport[_0xe84a('0x45')][_0x1cea2a[_0xe84a('0x46')]]){var _0x526f83=RpcVoiceTransferReport['transfers'][_0x1cea2a['linkedid']];_0x526f83[_0xe84a('0x47')]=_0x1cea2a[_0xe84a('0x48')];RpcVoiceTransferReport['blindTransfer'](_0x526f83);delete RpcVoiceTransferReport[_0xe84a('0x45')][_0x1cea2a[_0xe84a('0x46')]];}if(_[_0xe84a('0x28')](_0x1cea2a['type'])){_0x1cea2a[_0xe84a('0x38')]=this[_0xe84a('0x49')](_0x1cea2a);}if(_[_0xe84a('0x28')](_0x1cea2a[_0xe84a('0x4a')])){var _0x5faabf=_0x1cea2a[_0xe84a('0x31')]['split']('-')[0x0];var _0x5de2e2=this[_0xe84a('0xd')][_0x5faabf];if(!_0x5de2e2)_0x5de2e2=this['getAgentByInternal'](_0x1cea2a[_0xe84a('0x22')]);if(_0x5de2e2){_0x1cea2a[_0xe84a('0x4a')]=_0x5de2e2['id'];_0x1cea2a[_0xe84a('0x4b')]=_0x5de2e2[_0xe84a('0x20')];}}RpcVoiceCallReport[_0xe84a('0x2f')](_0x1cea2a);if(_0x1cea2a[_0xe84a('0x4c')]){for(var _0x1c39a7=0x0;_0x1c39a7<_0x1cea2a[_0xe84a('0x4d')]['length'];_0x1c39a7+=0x1){_0x1cea2a[_0xe84a('0x4e')]=_0x1cea2a['monitors'][_0x1c39a7]['filename'];_0x1cea2a[_0xe84a('0x4f')]=_0x1cea2a['monitors'][_0x1c39a7][_0xe84a('0x4f')];if(_0x1cea2a['exten']=='xcally-motion-preview'){_0x1cea2a[_0xe84a('0x34')]=_0x1cea2a[_0xe84a('0x25')];_0x1cea2a[_0xe84a('0x44')]=_0x1cea2a[_0xe84a('0x50')];_0x1cea2a[_0xe84a('0x25')]=_0x1cea2a[_0xe84a('0x22')];_0x1cea2a[_0xe84a('0x50')]=_0x1cea2a['membername'];_0x1cea2a[_0xe84a('0x37')]=_0x1cea2a[_0xe84a('0x3f')];}else if(_0x1cea2a[_0xe84a('0x37')]=='xcally-motion-dialer'){_0x1cea2a[_0xe84a('0x34')]=_0x1cea2a[_0xe84a('0x36')];_0x1cea2a[_0xe84a('0x37')]=_0x1cea2a['originatecalleridnum'];}RpcVoiceRecording[_0xe84a('0x2f')](_0x1cea2a);}}};Report[_0xe84a('0x1d')][_0xe84a('0x17')]=function(_0x98492){if(_[_0xe84a('0x51')](_0x98492)){_0x98492[_0xe84a('0x52')](function(_0x574c6c){RpcVoiceAgentReport['create'](_0x574c6c);});}else{RpcVoiceAgentReport[_0xe84a('0x2f')](_0x98492);}};Report['prototype'][_0xe84a('0x19')]=function(_0x4ef799){RpcVoiceDialReport['create'](_0x4ef799);var _0x227db8;var _0x21c80b;var _0x3532f9=_0x4ef799[_0xe84a('0x31')];if(_[_0xe84a('0x53')](_0x3532f9,_0xe84a('0x54'))){_0x21c80b=_0x3532f9['substring'](_0x3532f9[_0xe84a('0x55')]('/')+0x1,_0x3532f9[_0xe84a('0x55')]('@'));_0x227db8=_[_0xe84a('0x1f')](this[_0xe84a('0xd')],function(_0x8853ad){return _0x8853ad[_0xe84a('0x56')]==_0x21c80b||_0x8853ad['phone']==_0x21c80b||_0x8853ad[_0xe84a('0x22')]==_0x21c80b;});}else{_0x21c80b=_0x3532f9[_0xe84a('0x57')](_0x3532f9[_0xe84a('0x55')]('/')+0x1,_0x3532f9[_0xe84a('0x58')]('-'));_0x227db8=this[_0xe84a('0x1e')](_0x21c80b);}if(_0x227db8){_0x4ef799[_0xe84a('0x23')]=_['isNil'](_0x227db8[_0xe84a('0x23')])?util['format']('SIP/%s',_0x227db8[_0xe84a('0x20')]):_0x227db8[_0xe84a('0x23')];_0x4ef799[_0xe84a('0x4b')]=_0x227db8['name'];_0x4ef799['accountcode']=_0x227db8['accountcode'];RpcMemberReport[_0xe84a('0x19')](_0x4ef799);}};Report['prototype'][_0xe84a('0x59')]=function(_0x535e01){RpcVoiceTransferReport['transfers'][_0x535e01[_0xe84a('0x5a')]]=_0x535e01;};Report[_0xe84a('0x1d')][_0xe84a('0x1c')]=function(_0x7bab3c){RpcVoiceTransferReport[_0xe84a('0x1c')](_0x7bab3c);};module[_0xe84a('0x5b')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 487a1f4..1cfabf8 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 _0x4d38=['ami','../ami','redis','defaults','localhost','trunks','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','[userReport][sipshowregistry]','actionDeviceStateList','error','[userReport][devicestatelist]','inspect','actionSipPeerStatus','catch','[userReport][sippeerstatus]','prototype','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','stateRegistry','omit','event','actionid','username','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','agents','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf','phone','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x4d38,0x1d5));var _0x84d3=function(_0x22e056,_0x2cc7bd){_0x22e056=_0x22e056-0x0;var _0x20d872=_0x4d38[_0x22e056];return _0x20d872;};'use strict';var _=require(_0x84d3('0x0'));var moment=require(_0x84d3('0x1'));var util=require('util');var Redis=require(_0x84d3('0x2'));var BPromise=require('bluebird');var config=require(_0x84d3('0x3'));var logger=require(_0x84d3('0x4'))(_0x84d3('0x5'));var ami=require(_0x84d3('0x6'));config[_0x84d3('0x7')]=_[_0x84d3('0x8')](config[_0x84d3('0x7')],{'host':_0x84d3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x592015){this[_0x84d3('0xa')]=_0x592015[_0x84d3('0xa')];this['agents']=_0x592015['agents'];this['telephones']=_0x592015[_0x84d3('0xb')];ami['on'](_0x84d3('0xc'),this[_0x84d3('0xd')]['bind'](this));ami['on'](_0x84d3('0xe'),this[_0x84d3('0xd')][_0x84d3('0xf')](this));ami['on'](_0x84d3('0x10'),this['syncDeviceState'][_0x84d3('0xf')](this));ami['on'](_0x84d3('0x11'),this[_0x84d3('0x12')][_0x84d3('0xf')](this));return this[_0x84d3('0x13')]();}function showSipRegistrations(){Promise[_0x84d3('0x14')]()[_0x84d3('0x15')](ami[_0x84d3('0x16')]())['catch'](function(_0x359dd7){logger['error'](_0x84d3('0x17'),util['inspect'](_0x359dd7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x84d3('0x14')]()['then'](ami[_0x84d3('0x18')]())['catch'](function(_0x1d4ec0){logger[_0x84d3('0x19')](_0x84d3('0x1a'),util[_0x84d3('0x1b')](_0x1d4ec0,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x84d3('0x14')]()[_0x84d3('0x15')](ami[_0x84d3('0x1c')]())[_0x84d3('0x1d')](function(_0x3cb14c){logger[_0x84d3('0x19')](_0x84d3('0x1e'),util[_0x84d3('0x1b')](_0x3cb14c,{'showHidden':![],'depth':null}));});}UserReport[_0x84d3('0x1f')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x84d3('0x14')]()['then'](showSipRegistrations())[_0x84d3('0x15')](listDeviceStates())[_0x84d3('0x15')](showPeersStatus());},0x32c8);};UserReport[_0x84d3('0x1f')]['isNotNull']=function(_0x2e9460){return _0x2e9460!==null&&!_[_0x84d3('0x20')](_0x2e9460);};UserReport[_0x84d3('0x1f')][_0x84d3('0x21')]=function(_0x286637,_0x232d5d,_0x1c9e9c){io['to'](_0x286637)['emit'](_0x232d5d,_0x1c9e9c);};UserReport['prototype'][_0x84d3('0xd')]=function(_0x40e6fe){try{if(this['isNotNull'](_0x40e6fe)){logger[_0x84d3('0x22')](_0x84d3('0x23'),_0x40e6fe['username'],_0x40e6fe[_0x84d3('0x24')]);logger[_0x84d3('0x25')](_0x84d3('0x26'),util[_0x84d3('0x1b')](_0x40e6fe,{'showHidden':![],'depth':null}));var _0x3c261d=_[_0x84d3('0x27')](this[_0x84d3('0xa')],{'defaultuser':_0x40e6fe['username']});if(_0x3c261d){_0x40e6fe[_0x84d3('0x28')]=_0x40e6fe[_0x84d3('0x24')];_['merge'](_0x3c261d,_[_0x84d3('0x29')](_0x40e6fe,[_0x84d3('0x2a'),_0x84d3('0x2b'),_0x84d3('0x2c'),_0x84d3('0x24')]));logger[_0x84d3('0x25')](_0x84d3('0x2d'),util[_0x84d3('0x1b')](_0x3c261d,{'showHidden':![],'depth':null}));this['emit'](util[_0x84d3('0x2e')]('trunk:%s',_0x3c261d[_0x84d3('0x2f')]),_0x84d3('0x30'),_0x3c261d);}}}catch(_0x5cd042){logger[_0x84d3('0x19')]('[userReport][registry]',util[_0x84d3('0x1b')](_0x5cd042,{'showHidden':![],'depth':null}));}};UserReport[_0x84d3('0x1f')][_0x84d3('0x31')]=function(_0x31d907){try{if(this['isNotNull'](_0x31d907)){logger[_0x84d3('0x22')](_0x84d3('0x32'),_0x31d907[_0x84d3('0x33')],_0x31d907[_0x84d3('0x24')]);logger[_0x84d3('0x25')]('[userReport][devicestatechange]',util[_0x84d3('0x1b')](_0x31d907,{'showHidden':![],'depth':null}));if(this[_0x84d3('0x34')][_0x31d907[_0x84d3('0x33')]]){if(!this[_0x84d3('0x34')][_0x31d907[_0x84d3('0x33')]]['local']||_0x31d907[_0x84d3('0x24')][_0x84d3('0x35')]()==_0x84d3('0x36')){this[_0x84d3('0x34')][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x37')]=![];if(this['agents'][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x24')]!==_0x31d907[_0x84d3('0x24')][_0x84d3('0x35')]()){this[_0x84d3('0x34')][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x38')]=_[_0x84d3('0x39')](moment()['format']('x'));}this[_0x84d3('0x34')][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x24')]=_0x31d907['state'][_0x84d3('0x35')]();this[_0x84d3('0x34')][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x3a')](_0x31d907);}}else if(this['telephones'][_0x31d907[_0x84d3('0x33')]]){if(this['telephones'][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x24')]!==_0x31d907[_0x84d3('0x24')][_0x84d3('0x35')]()){this[_0x84d3('0xb')][_0x31d907['device']][_0x84d3('0x38')]=_['toNumber'](moment()[_0x84d3('0x2e')]('x'));}this[_0x84d3('0xb')][_0x31d907[_0x84d3('0x33')]]['state']=_0x31d907[_0x84d3('0x24')][_0x84d3('0x35')]();logger['debug'](_0x84d3('0x3b'),util['inspect'](this[_0x84d3('0xb')][_0x31d907[_0x84d3('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x84d3('0x2e')]('telephone:%s',this['telephones'][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x2f')]),_0x84d3('0x3c'),this[_0x84d3('0xb')][_0x31d907['device']]);}else if(this['trunks'][_0x31d907[_0x84d3('0x33')]]){if(this[_0x84d3('0xa')][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x24')]!==_0x31d907[_0x84d3('0x24')][_0x84d3('0x35')]()){this[_0x84d3('0xa')][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x38')]=_[_0x84d3('0x39')](moment()[_0x84d3('0x2e')]('x'));}this[_0x84d3('0xa')][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x24')]=_0x31d907[_0x84d3('0x24')][_0x84d3('0x35')]();logger[_0x84d3('0x25')](_0x84d3('0x3d'),util[_0x84d3('0x1b')](this['trunks'][_0x31d907[_0x84d3('0x33')]],{'showHidden':![],'depth':null}));this[_0x84d3('0x21')](util[_0x84d3('0x2e')](_0x84d3('0x3e'),this['trunks'][_0x31d907[_0x84d3('0x33')]][_0x84d3('0x2f')]),'trunk:save',this[_0x84d3('0xa')][_0x31d907[_0x84d3('0x33')]]);}else if(_[_0x84d3('0x3f')](_0x31d907[_0x84d3('0x33')],_0x84d3('0x40'))){var _0x548ca5=_0x31d907[_0x84d3('0x33')];var _0x53d36e=_0x548ca5[_0x84d3('0x41')](_0x548ca5[_0x84d3('0x42')]('/')+0x1,_0x548ca5[_0x84d3('0x42')]('@'));var _0x175a18=_['find'](this[_0x84d3('0x34')],function(_0x505ef2){return _0x505ef2['mobile']==_0x53d36e||_0x505ef2[_0x84d3('0x43')]==_0x53d36e||_0x505ef2['accountcode']==_0x53d36e;});if(_0x175a18){if(_0x175a18[_0x84d3('0x24')]!==_0x31d907[_0x84d3('0x24')]['toLowerCase']()){_0x175a18['stateTime']=_[_0x84d3('0x39')](moment()[_0x84d3('0x2e')]('x'));}_0x175a18[_0x84d3('0x24')]=_0x31d907[_0x84d3('0x24')][_0x84d3('0x35')]();_0x175a18[_0x84d3('0x37')]=!![];_0x175a18[_0x84d3('0x3a')](_0x31d907);}}}}catch(_0xaec121){logger[_0x84d3('0x19')](_0x84d3('0x44'),util[_0x84d3('0x1b')](_0xaec121,{'showHidden':![],'depth':null}));}};UserReport[_0x84d3('0x1f')][_0x84d3('0x12')]=function(_0x159893){try{if(this['isNotNull'](_0x159893)&&this['isNotNull'](_0x159893[_0x84d3('0x11')])){logger[_0x84d3('0x22')](_0x84d3('0x45'),_0x159893[_0x84d3('0x46')],_0x159893[_0x84d3('0x47')],_0x159893[_0x84d3('0x11')]);logger[_0x84d3('0x25')](_0x84d3('0x48'),util[_0x84d3('0x1b')](_0x159893,{'showHidden':![],'depth':null}));if(this['agents'][_0x159893[_0x84d3('0x46')]]){if(!this[_0x84d3('0x34')][_0x159893[_0x84d3('0x46')]][_0x84d3('0x37')]||_0x159893[_0x84d3('0x11')][_0x84d3('0x35')]()==_0x84d3('0x49')){this[_0x84d3('0x34')][_0x159893[_0x84d3('0x46')]]['local']=![];this[_0x84d3('0x34')][_0x159893['peer']][_0x84d3('0x4a')]=_0x159893[_0x84d3('0x11')][_0x84d3('0x35')]();this['agents'][_0x159893[_0x84d3('0x46')]][_0x84d3('0x47')]=_0x159893['address'];this[_0x84d3('0x34')][_0x159893[_0x84d3('0x46')]][_0x84d3('0x3a')](_0x159893);}}else if(this[_0x84d3('0xb')][_0x159893[_0x84d3('0x46')]]){this['telephones'][_0x159893['peer']]['status']=_0x159893[_0x84d3('0x11')]['toLowerCase']();this[_0x84d3('0xb')][_0x159893[_0x84d3('0x46')]][_0x84d3('0x47')]=_0x159893[_0x84d3('0x47')];logger[_0x84d3('0x25')](_0x84d3('0x4b'),util['inspect'](this['telephones'][_0x159893[_0x84d3('0x46')]],{'showHidden':![],'depth':null}));this[_0x84d3('0x21')](util[_0x84d3('0x2e')](_0x84d3('0x4c'),this[_0x84d3('0xb')][_0x159893['peer']][_0x84d3('0x2f')]),_0x84d3('0x3c'),this[_0x84d3('0xb')][_0x159893[_0x84d3('0x46')]]);}else if(this['trunks'][_0x159893[_0x84d3('0x46')]]){this[_0x84d3('0xa')][_0x159893[_0x84d3('0x46')]]['status']=_0x159893[_0x84d3('0x11')][_0x84d3('0x35')]();this[_0x84d3('0xa')][_0x159893['peer']][_0x84d3('0x47')]=_0x159893[_0x84d3('0x47')];logger['debug'](_0x84d3('0x4d'),util[_0x84d3('0x1b')](this[_0x84d3('0xa')][_0x159893[_0x84d3('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x84d3('0x2e')](_0x84d3('0x3e'),this['trunks'][_0x159893[_0x84d3('0x46')]][_0x84d3('0x2f')]),_0x84d3('0x30'),this[_0x84d3('0xa')][_0x159893[_0x84d3('0x46')]]);}}}catch(_0x51a3a6){logger[_0x84d3('0x19')]('[userReport][peerstatus]',util['inspect'](_0x51a3a6,{'showHidden':![],'depth':null}));}};module[_0x84d3('0x4e')]=UserReport; \ No newline at end of file +var _0x5480=['agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','prototype','isNotNull','isUndefined','state','debug','username','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','emit','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','find','phone','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks'];(function(_0x2bd97d,_0x3fa3b7){var _0x2d7d03=function(_0x486937){while(--_0x486937){_0x2bd97d['push'](_0x2bd97d['shift']());}};_0x2d7d03(++_0x3fa3b7);}(_0x5480,0xcc));var _0x0548=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x5480[_0x10b48a];return _0x2c4533;};'use strict';var _=require(_0x0548('0x0'));var moment=require(_0x0548('0x1'));var util=require(_0x0548('0x2'));var Redis=require(_0x0548('0x3'));var BPromise=require('bluebird');var config=require(_0x0548('0x4'));var logger=require('../../../config/logger')(_0x0548('0x5'));var ami=require(_0x0548('0x6'));config['redis']=_[_0x0548('0x7')](config[_0x0548('0x8')],{'host':_0x0548('0x9'),'port':0x18eb});var io=require(_0x0548('0xa'))(new Redis(config[_0x0548('0x8')]));function UserReport(_0x5e585a){this[_0x0548('0xb')]=_0x5e585a['trunks'];this[_0x0548('0xc')]=_0x5e585a[_0x0548('0xc')];this[_0x0548('0xd')]=_0x5e585a[_0x0548('0xd')];ami['on'](_0x0548('0xe'),this[_0x0548('0xf')][_0x0548('0x10')](this));ami['on'](_0x0548('0x11'),this[_0x0548('0xf')][_0x0548('0x10')](this));ami['on'](_0x0548('0x12'),this[_0x0548('0x13')][_0x0548('0x10')](this));ami['on'](_0x0548('0x14'),this[_0x0548('0x15')][_0x0548('0x10')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x0548('0x16')]()[_0x0548('0x17')](ami[_0x0548('0x18')]())[_0x0548('0x19')](function(_0x168d9c){logger[_0x0548('0x1a')]('[userReport][sipshowregistry]',util[_0x0548('0x1b')](_0x168d9c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x0548('0x16')]()[_0x0548('0x17')](ami[_0x0548('0x1c')]())[_0x0548('0x19')](function(_0x44e8ec){logger[_0x0548('0x1a')](_0x0548('0x1d'),util[_0x0548('0x1b')](_0x44e8ec,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x0548('0x16')]()['then'](ami['actionSipPeerStatus']())[_0x0548('0x19')](function(_0x4be0db){logger['error']('[userReport][sippeerstatus]',util[_0x0548('0x1b')](_0x4be0db,{'showHidden':![],'depth':null}));});}UserReport[_0x0548('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x0548('0x16')]()[_0x0548('0x17')](showSipRegistrations())[_0x0548('0x17')](listDeviceStates())[_0x0548('0x17')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x0548('0x1f')]=function(_0x112bd7){return _0x112bd7!==null&&!_[_0x0548('0x20')](_0x112bd7);};UserReport['prototype']['emit']=function(_0x4939b4,_0xd98f2f,_0x2aa93b){io['to'](_0x4939b4)['emit'](_0xd98f2f,_0x2aa93b);};UserReport[_0x0548('0x1e')][_0x0548('0xf')]=function(_0x104e51){try{if(this[_0x0548('0x1f')](_0x104e51)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x104e51['username'],_0x104e51[_0x0548('0x21')]);logger[_0x0548('0x22')]('[userReport][registry]',util['inspect'](_0x104e51,{'showHidden':![],'depth':null}));var _0x4b8cb7=_['find'](this[_0x0548('0xb')],{'defaultuser':_0x104e51[_0x0548('0x23')]});if(_0x4b8cb7){_0x104e51['stateRegistry']=_0x104e51[_0x0548('0x21')];_[_0x0548('0x24')](_0x4b8cb7,_[_0x0548('0x25')](_0x104e51,['event',_0x0548('0x26'),_0x0548('0x23'),_0x0548('0x21')]));logger[_0x0548('0x22')](_0x0548('0x27'),util[_0x0548('0x1b')](_0x4b8cb7,{'showHidden':![],'depth':null}));this['emit'](util[_0x0548('0x28')](_0x0548('0x29'),_0x4b8cb7[_0x0548('0x2a')]),_0x0548('0x2b'),_0x4b8cb7);}}}catch(_0x2239fd){logger[_0x0548('0x1a')](_0x0548('0x2c'),util[_0x0548('0x1b')](_0x2239fd,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x475172){try{if(this[_0x0548('0x1f')](_0x475172)){logger[_0x0548('0x2d')](_0x0548('0x2e'),_0x475172['device'],_0x475172[_0x0548('0x21')]);logger['debug'](_0x0548('0x2f'),util[_0x0548('0x1b')](_0x475172,{'showHidden':![],'depth':null}));if(this[_0x0548('0xc')][_0x475172[_0x0548('0x30')]]){if(!this[_0x0548('0xc')][_0x475172[_0x0548('0x30')]][_0x0548('0x31')]||_0x475172[_0x0548('0x21')]['toLowerCase']()==_0x0548('0x32')){this[_0x0548('0xc')][_0x475172['device']][_0x0548('0x31')]=![];if(this[_0x0548('0xc')][_0x475172[_0x0548('0x30')]]['state']!==_0x475172[_0x0548('0x21')][_0x0548('0x33')]()){this['agents'][_0x475172[_0x0548('0x30')]][_0x0548('0x34')]=_[_0x0548('0x35')](moment()['format']('x'));}this['agents'][_0x475172[_0x0548('0x30')]][_0x0548('0x21')]=_0x475172[_0x0548('0x21')][_0x0548('0x33')]();this[_0x0548('0xc')][_0x475172['device']][_0x0548('0x36')](_0x475172);}}else if(this['telephones'][_0x475172[_0x0548('0x30')]]){if(this[_0x0548('0xd')][_0x475172['device']][_0x0548('0x21')]!==_0x475172[_0x0548('0x21')][_0x0548('0x33')]()){this[_0x0548('0xd')][_0x475172['device']]['stateTime']=_['toNumber'](moment()[_0x0548('0x28')]('x'));}this[_0x0548('0xd')][_0x475172[_0x0548('0x30')]][_0x0548('0x21')]=_0x475172[_0x0548('0x21')]['toLowerCase']();logger[_0x0548('0x22')](_0x0548('0x37'),util[_0x0548('0x1b')](this['telephones'][_0x475172[_0x0548('0x30')]],{'showHidden':![],'depth':null}));this[_0x0548('0x38')](util[_0x0548('0x28')](_0x0548('0x39'),this[_0x0548('0xd')][_0x475172[_0x0548('0x30')]][_0x0548('0x2a')]),_0x0548('0x3a'),this[_0x0548('0xd')][_0x475172[_0x0548('0x30')]]);}else if(this['trunks'][_0x475172[_0x0548('0x30')]]){if(this['trunks'][_0x475172[_0x0548('0x30')]][_0x0548('0x21')]!==_0x475172[_0x0548('0x21')][_0x0548('0x33')]()){this[_0x0548('0xb')][_0x475172[_0x0548('0x30')]][_0x0548('0x34')]=_['toNumber'](moment()[_0x0548('0x28')]('x'));}this[_0x0548('0xb')][_0x475172[_0x0548('0x30')]][_0x0548('0x21')]=_0x475172[_0x0548('0x21')][_0x0548('0x33')]();logger[_0x0548('0x22')](_0x0548('0x3b'),util[_0x0548('0x1b')](this[_0x0548('0xb')][_0x475172[_0x0548('0x30')]],{'showHidden':![],'depth':null}));this[_0x0548('0x38')](util[_0x0548('0x28')](_0x0548('0x29'),this[_0x0548('0xb')][_0x475172[_0x0548('0x30')]][_0x0548('0x2a')]),_0x0548('0x2b'),this[_0x0548('0xb')][_0x475172[_0x0548('0x30')]]);}else if(_[_0x0548('0x3c')](_0x475172[_0x0548('0x30')],_0x0548('0x3d'))){var _0x9af2d8=_0x475172['device'];var _0x39a42b=_0x9af2d8[_0x0548('0x3e')](_0x9af2d8[_0x0548('0x3f')]('/')+0x1,_0x9af2d8[_0x0548('0x3f')]('@'));var _0x1bb4bf=_[_0x0548('0x40')](this[_0x0548('0xc')],function(_0x2efd7f){return _0x2efd7f['mobile']==_0x39a42b||_0x2efd7f[_0x0548('0x41')]==_0x39a42b||_0x2efd7f['accountcode']==_0x39a42b;});if(_0x1bb4bf){if(_0x1bb4bf[_0x0548('0x21')]!==_0x475172[_0x0548('0x21')][_0x0548('0x33')]()){_0x1bb4bf[_0x0548('0x34')]=_['toNumber'](moment()[_0x0548('0x28')]('x'));}_0x1bb4bf[_0x0548('0x21')]=_0x475172['state'][_0x0548('0x33')]();_0x1bb4bf[_0x0548('0x31')]=!![];_0x1bb4bf['updateStatusRealtime'](_0x475172);}}}}catch(_0x20cadc){logger[_0x0548('0x1a')](_0x0548('0x2f'),util['inspect'](_0x20cadc,{'showHidden':![],'depth':null}));}};UserReport[_0x0548('0x1e')][_0x0548('0x15')]=function(_0x4b6aab){try{if(this[_0x0548('0x1f')](_0x4b6aab)&&this[_0x0548('0x1f')](_0x4b6aab['peerstatus'])){logger[_0x0548('0x2d')](_0x0548('0x42'),_0x4b6aab[_0x0548('0x43')],_0x4b6aab[_0x0548('0x44')],_0x4b6aab[_0x0548('0x14')]);logger[_0x0548('0x22')](_0x0548('0x45'),util[_0x0548('0x1b')](_0x4b6aab,{'showHidden':![],'depth':null}));if(this[_0x0548('0xc')][_0x4b6aab['peer']]){if(!this[_0x0548('0xc')][_0x4b6aab[_0x0548('0x43')]][_0x0548('0x31')]||_0x4b6aab[_0x0548('0x14')][_0x0548('0x33')]()==_0x0548('0x46')){this[_0x0548('0xc')][_0x4b6aab[_0x0548('0x43')]]['local']=![];this[_0x0548('0xc')][_0x4b6aab[_0x0548('0x43')]][_0x0548('0x47')]=_0x4b6aab[_0x0548('0x14')][_0x0548('0x33')]();this['agents'][_0x4b6aab[_0x0548('0x43')]][_0x0548('0x44')]=_0x4b6aab['address'];this[_0x0548('0xc')][_0x4b6aab['peer']]['updateStatusRealtime'](_0x4b6aab);}}else if(this[_0x0548('0xd')][_0x4b6aab[_0x0548('0x43')]]){this['telephones'][_0x4b6aab['peer']]['status']=_0x4b6aab[_0x0548('0x14')][_0x0548('0x33')]();this[_0x0548('0xd')][_0x4b6aab['peer']][_0x0548('0x44')]=_0x4b6aab[_0x0548('0x44')];logger[_0x0548('0x22')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x0548('0x1b')](this[_0x0548('0xd')][_0x4b6aab[_0x0548('0x43')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0548('0x28')](_0x0548('0x39'),this['telephones'][_0x4b6aab['peer']][_0x0548('0x2a')]),_0x0548('0x3a'),this[_0x0548('0xd')][_0x4b6aab[_0x0548('0x43')]]);}else if(this[_0x0548('0xb')][_0x4b6aab[_0x0548('0x43')]]){this['trunks'][_0x4b6aab[_0x0548('0x43')]]['status']=_0x4b6aab['peerstatus'][_0x0548('0x33')]();this[_0x0548('0xb')][_0x4b6aab[_0x0548('0x43')]][_0x0548('0x44')]=_0x4b6aab['address'];logger['debug']('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x0548('0x1b')](this['trunks'][_0x4b6aab[_0x0548('0x43')]],{'showHidden':![],'depth':null}));this[_0x0548('0x38')](util[_0x0548('0x28')](_0x0548('0x29'),this[_0x0548('0xb')][_0x4b6aab[_0x0548('0x43')]][_0x0548('0x2a')]),_0x0548('0x2b'),this[_0x0548('0xb')][_0x4b6aab[_0x0548('0x43')]]);}}}catch(_0x38856f){logger[_0x0548('0x1a')]('[userReport][peerstatus]',util[_0x0548('0x1b')](_0x38856f,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index f026fab..080c70a 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 _0x4cba=['agentringnoanswer','syncAgentRingNoAnswer','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','inbound','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','inspect','user:%s','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinenum','holdtime','connect','routealias','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acw','acwTimeout','interface','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','transfer','diff','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','agentconnect','syncAgentConnect'];(function(_0x5a71d4,_0x314d32){var _0x2b9483=function(_0x4069a8){while(--_0x4069a8){_0x5a71d4['push'](_0x5a71d4['shift']());}};_0x2b9483(++_0x314d32);}(_0x4cba,0x84));var _0xa4cb=function(_0x3438fb,_0xde4967){_0x3438fb=_0x3438fb-0x0;var _0x2606b1=_0x4cba[_0x3438fb];return _0x2606b1;};'use strict';var _=require(_0xa4cb('0x0'));var moment=require(_0xa4cb('0x1'));var util=require(_0xa4cb('0x2'));var Redis=require('ioredis');var config=require(_0xa4cb('0x3'));var logger=require(_0xa4cb('0x4'))(_0xa4cb('0x5'));var ami=require(_0xa4cb('0x6'));config['redis']=_['defaults'](config[_0xa4cb('0x7')],{'host':_0xa4cb('0x8'),'port':0x18eb});var io=require(_0xa4cb('0x9'))(new Redis(config[_0xa4cb('0x7')]));function VoiceAgentReport(_0x3afbbb){this[_0xa4cb('0xa')]={};this[_0xa4cb('0xb')]=_0x3afbbb[_0xa4cb('0xa')];this[_0xa4cb('0xc')]=_0x3afbbb[_0xa4cb('0xc')];this[_0xa4cb('0xd')]=_0x3afbbb['agents'];this[_0xa4cb('0xe')]={};ami['on']('agentcalled',this[_0xa4cb('0xf')]['bind'](this));ami['on'](_0xa4cb('0x10'),this[_0xa4cb('0x11')]['bind'](this));ami['on'](_0xa4cb('0x12'),this[_0xa4cb('0x13')][_0xa4cb('0x14')](this));ami['on'](_0xa4cb('0x15'),this[_0xa4cb('0x16')][_0xa4cb('0x14')](this));ami['on'](_0xa4cb('0x17'),this[_0xa4cb('0x18')][_0xa4cb('0x14')](this));ami['on'](_0xa4cb('0x19'),this[_0xa4cb('0x1a')][_0xa4cb('0x14')](this));ami['on'](_0xa4cb('0x1b'),this[_0xa4cb('0x1c')][_0xa4cb('0x14')](this));ami['on'](_0xa4cb('0x1d'),this[_0xa4cb('0x1e')][_0xa4cb('0x14')](this));ami['on'](_0xa4cb('0x1f'),this[_0xa4cb('0x20')][_0xa4cb('0x14')](this));ami['on'](_0xa4cb('0x21'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xa4cb('0x22')][_0xa4cb('0x14')](this));}VoiceAgentReport[_0xa4cb('0x23')][_0xa4cb('0x24')]=function(_0x406fbd,_0xaa83d7,_0x5c2cb2){io['to'](_0x406fbd)[_0xa4cb('0x24')](_0xaa83d7,_0x5c2cb2);};VoiceAgentReport['prototype']['isNotNull']=function(_0x4c2935){return _0x4c2935!==null&&!_[_0xa4cb('0x25')](_0x4c2935);};VoiceAgentReport['prototype'][_0xa4cb('0xf')]=function(_0x57b230){try{if(this[_0xa4cb('0x26')](_0x57b230)){logger[_0xa4cb('0x27')](_0xa4cb('0x28'),_0x57b230[_0xa4cb('0x29')],_0x57b230[_0xa4cb('0x2a')],_0x57b230[_0xa4cb('0x2b')]);logger[_0xa4cb('0x2c')](_0xa4cb('0x2d'),_0x57b230['uniqueid'],util['inspect'](_0x57b230,{'showHidden':![],'depth':null}));if(_[_0xa4cb('0x25')](this['channels'][_0x57b230[_0xa4cb('0x29')]])){this['channels'][_0x57b230['uniqueid']]={};}if(_[_0xa4cb('0x25')](this[_0xa4cb('0xa')][_0x57b230[_0xa4cb('0x29')]][_0x57b230[_0xa4cb('0x2b')]])){this[_0xa4cb('0xa')][_0x57b230[_0xa4cb('0x29')]][_0x57b230[_0xa4cb('0x2b')]]={'agentcalledAt':moment()[_0xa4cb('0x2e')](_0xa4cb('0x2f')),'lastevent':'called','mandatoryDisposition':this['voiceQueues'][_0x57b230[_0xa4cb('0x30')]]?this['voiceQueues'][_0x57b230[_0xa4cb('0x30')]][_0xa4cb('0x31')]||![]:![],'type':this[_0xa4cb('0xc')][_0x57b230[_0xa4cb('0x30')]]?this[_0xa4cb('0xc')][_0x57b230[_0xa4cb('0x30')]]['type']||_0xa4cb('0x32'):_0xa4cb('0x32'),'variables':this['variables'][_0x57b230['uniqueid']],'motionChannel':'voice'};}_['merge'](this[_0xa4cb('0xa')][_0x57b230['uniqueid']][_0x57b230[_0xa4cb('0x2b')]],_[_0xa4cb('0x33')](_0x57b230,[_0xa4cb('0x34'),'privilege']));logger[_0xa4cb('0x2c')](_0xa4cb('0x35'),_0x57b230['uniqueid'],util['inspect'](this[_0xa4cb('0xa')][_0x57b230[_0xa4cb('0x29')]][_0x57b230[_0xa4cb('0x2b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xa4cb('0x36'),this[_0xa4cb('0xa')][_0x57b230['uniqueid']][_0x57b230[_0xa4cb('0x2b')]]);var _0x2317df={'id':this[_0xa4cb('0xd')][_0x57b230['interface']]['id'],'calleridnum':this[_0xa4cb('0xa')][_0x57b230[_0xa4cb('0x29')]][_0x57b230['destuniqueid']][_0xa4cb('0x37')],'queue':this[_0xa4cb('0xa')][_0x57b230[_0xa4cb('0x29')]][_0x57b230['destuniqueid']]['queue'],'variables':this[_0xa4cb('0xa')][_0x57b230[_0xa4cb('0x29')]][_0x57b230[_0xa4cb('0x2b')]][_0xa4cb('0xe')]};logger[_0xa4cb('0x2c')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x57b230[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x2317df,{'showHidden':![],'depth':null}));this[_0xa4cb('0x24')](util[_0xa4cb('0x2e')](_0xa4cb('0x39'),_0x57b230[_0xa4cb('0x2a')]),'user:called',_0x2317df);}}catch(_0x3939be){logger[_0xa4cb('0x3a')](_0xa4cb('0x3b'),_0x57b230[_0xa4cb('0x29')],util['inspect'](_0x3939be,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa4cb('0x23')]['syncAgentConnect']=function(_0x37fe66){try{if(this['isNotNull'](_0x37fe66)){if(this[_0xa4cb('0xa')][_0x37fe66['uniqueid']]){logger[_0xa4cb('0x2c')](_0xa4cb('0x3c'),_0x37fe66[_0xa4cb('0x29')],util['inspect'](_0x37fe66,{'showHidden':![],'depth':null}));for(var _0x2f2c99 in this['channels'][_0x37fe66[_0xa4cb('0x29')]]){if(this[_0xa4cb('0xa')][_0x37fe66['uniqueid']][_0xa4cb('0x3d')](_0x2f2c99)){if(_0x37fe66['destuniqueid']===_0x2f2c99){logger[_0xa4cb('0x27')](_0xa4cb('0x3e'),_0x37fe66[_0xa4cb('0x29')],_0x37fe66[_0xa4cb('0x2a')],_0x37fe66[_0xa4cb('0x2b')]);this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99]['agentconnectAt']=moment()[_0xa4cb('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99]['connectedlinename']=_0x37fe66['connectedlinename'];this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99][_0xa4cb('0x3f')]=_0x37fe66['connectedlinenum'];this['channels'][_0x37fe66['uniqueid']][_0x2f2c99]['destchannelstate']=_0x37fe66['destchannelstate'];this[_0xa4cb('0xa')][_0x37fe66['uniqueid']][_0x2f2c99]['destchannelstatedesc']=_0x37fe66['destchannelstatedesc'];this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99]['holdtime']=_0x37fe66[_0xa4cb('0x40')];this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99]['lastevent']=_0xa4cb('0x41');if(this['voiceChannels'][this[_0xa4cb('0xa')][_0x37fe66['uniqueid']][_0x2f2c99]['uniqueid']]){var _0x2275c7=this[_0xa4cb('0xb')][this['channels'][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99][_0xa4cb('0x29')]]['routealias'];this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99][_0xa4cb('0x42')]=_0x2275c7;_0x37fe66[_0xa4cb('0x42')]=_0x2275c7;}_['merge'](this[_0xa4cb('0xd')][_0x37fe66['interface']],_['pick'](_0x37fe66,[_0xa4cb('0x30'),'destconnectedlinenum',_0xa4cb('0x42')]));logger[_0xa4cb('0x2c')](_0xa4cb('0x43'),_0x37fe66[_0xa4cb('0x29')],util['inspect'](this['channels'][_0x37fe66[_0xa4cb('0x29')]][_0x37fe66['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xa4cb('0x24')](_0xa4cb('0x44'),this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x37fe66[_0xa4cb('0x2b')]]);logger[_0xa4cb('0x2c')](_0xa4cb('0x45'),_0x37fe66[_0xa4cb('0x29')],util[_0xa4cb('0x38')](this['channels'][_0x37fe66[_0xa4cb('0x29')]][_0x37fe66[_0xa4cb('0x2b')]],{'showHidden':![],'depth':null}));this[_0xa4cb('0x24')](util[_0xa4cb('0x2e')](_0xa4cb('0x39'),_0x37fe66[_0xa4cb('0x2a')]),_0xa4cb('0x46'),this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x37fe66['destuniqueid']]);}else if(!this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99][_0xa4cb('0x12')]&&!this['channels'][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99][_0xa4cb('0x17')]){logger[_0xa4cb('0x27')](_0xa4cb('0x47'),_0x37fe66[_0xa4cb('0x29')],this[_0xa4cb('0xa')][_0x37fe66['uniqueid']][_0x2f2c99][_0xa4cb('0x2a')],_0x2f2c99);this[_0xa4cb('0xa')][_0x37fe66['uniqueid']][_0x2f2c99]['agentringnoanswer']=!![];this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99]['agentringnoanswerAt']=moment()[_0xa4cb('0x2e')](_0xa4cb('0x2f'));this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99][_0xa4cb('0x48')]=_0x37fe66[_0xa4cb('0x2b')];this['channels'][_0x37fe66['uniqueid']][_0x2f2c99][_0xa4cb('0x49')]=_0x37fe66[_0xa4cb('0x2a')];this['channels'][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99]['lastevent']='answered_elsewhere';this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99][_0xa4cb('0x4a')]=_0xa4cb('0x4b');logger[_0xa4cb('0x2c')](_0xa4cb('0x4c'),_0x37fe66[_0xa4cb('0x29')],util[_0xa4cb('0x38')](this[_0xa4cb('0xa')][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99],{'showHidden':![],'depth':null}));ami[_0xa4cb('0x24')](_0xa4cb('0x4d'),this['channels'][_0x37fe66[_0xa4cb('0x29')]][_0x2f2c99]);}}}}}}catch(_0x271264){logger[_0xa4cb('0x3a')]('[%s][voiceAgentReport][agentconnect]',_0x37fe66[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x271264,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa4cb('0x23')][_0xa4cb('0x13')]=function(_0x32fe64){try{if(this[_0xa4cb('0x26')](_0x32fe64)){logger[_0xa4cb('0x2c')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x32fe64['uniqueid'],util['inspect'](_0x32fe64,{'showHidden':![],'depth':null}));if(this[_0xa4cb('0xa')][_0x32fe64['uniqueid']]&&this['channels'][_0x32fe64['uniqueid']][_0x32fe64['destuniqueid']]){logger['info'](_0xa4cb('0x4e'),_0x32fe64[_0xa4cb('0x29')],_0x32fe64[_0xa4cb('0x2a')],_0x32fe64[_0xa4cb('0x2b')]);this[_0xa4cb('0xa')][_0x32fe64[_0xa4cb('0x29')]][_0x32fe64[_0xa4cb('0x2b')]]['agentringnoanswer']=!![];this[_0xa4cb('0xa')][_0x32fe64[_0xa4cb('0x29')]][_0x32fe64[_0xa4cb('0x2b')]][_0xa4cb('0x4f')]=moment()[_0xa4cb('0x2e')](_0xa4cb('0x2f'));this[_0xa4cb('0xa')][_0x32fe64['uniqueid']][_0x32fe64['destuniqueid']][_0xa4cb('0x50')]=_0xa4cb('0x51');this['channels'][_0x32fe64[_0xa4cb('0x29')]][_0x32fe64[_0xa4cb('0x2b')]][_0xa4cb('0x4a')]=_0xa4cb('0x51');logger[_0xa4cb('0x2c')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x32fe64['uniqueid'],util[_0xa4cb('0x38')](this[_0xa4cb('0xa')][_0x32fe64[_0xa4cb('0x29')]][_0x32fe64['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xa4cb('0x24')](_0xa4cb('0x52'),this[_0xa4cb('0xa')][_0x32fe64[_0xa4cb('0x29')]][_0x32fe64[_0xa4cb('0x2b')]]);}}}catch(_0x4dad05){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x32fe64[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x4dad05,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa4cb('0x16')]=function(_0x4764cb){try{if(this[_0xa4cb('0x26')](_0x4764cb)){logger['debug'](_0xa4cb('0x53'),_0x4764cb[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x4764cb,{'showHidden':![],'depth':null}));if(this[_0xa4cb('0xa')][_0x4764cb['uniqueid']]){for(var _0x3d9c02 in this[_0xa4cb('0xa')][_0x4764cb[_0xa4cb('0x29')]]){if(this[_0xa4cb('0xa')][_0x4764cb['uniqueid']][_0xa4cb('0x3d')](_0x3d9c02)&&!this[_0xa4cb('0xa')][_0x4764cb[_0xa4cb('0x29')]][_0x3d9c02][_0xa4cb('0x12')]&&!this['channels'][_0x4764cb['uniqueid']][_0x3d9c02][_0xa4cb('0x17')]){logger[_0xa4cb('0x27')](_0xa4cb('0x54'),_0x4764cb[_0xa4cb('0x29')],this[_0xa4cb('0xa')][_0x4764cb[_0xa4cb('0x29')]][_0x3d9c02][_0xa4cb('0x2a')],_0x3d9c02);this[_0xa4cb('0xa')][_0x4764cb['uniqueid']][_0x3d9c02][_0xa4cb('0x12')]=!![];this[_0xa4cb('0xa')][_0x4764cb[_0xa4cb('0x29')]][_0x3d9c02][_0xa4cb('0x4f')]=moment()['format'](_0xa4cb('0x2f'));this['channels'][_0x4764cb['uniqueid']][_0x3d9c02][_0xa4cb('0x50')]=_0xa4cb('0x55');this[_0xa4cb('0xa')][_0x4764cb[_0xa4cb('0x29')]][_0x3d9c02][_0xa4cb('0x4a')]=_0xa4cb('0x55');logger[_0xa4cb('0x2c')](_0xa4cb('0x56'),_0x4764cb[_0xa4cb('0x29')],util[_0xa4cb('0x38')](this[_0xa4cb('0xa')][_0x4764cb['uniqueid']][_0x3d9c02],{'showHidden':![],'depth':null}));ami['emit'](_0xa4cb('0x57'),this[_0xa4cb('0xa')][_0x4764cb[_0xa4cb('0x29')]][_0x3d9c02]);}}}}}catch(_0x13da80){logger[_0xa4cb('0x3a')]('[%s][voiceAgentReport][queuecallerabandon]',_0x4764cb[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x13da80,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa4cb('0x23')][_0xa4cb('0x18')]=function(_0x3fe6bf){try{if(this[_0xa4cb('0x26')](_0x3fe6bf)){logger['debug'](_0xa4cb('0x58'),_0x3fe6bf[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x3fe6bf,{'showHidden':![],'depth':null}));if(this['channels'][_0x3fe6bf[_0xa4cb('0x29')]]){for(var _0x3d02aa in this[_0xa4cb('0xa')][_0x3fe6bf[_0xa4cb('0x29')]]){if(this[_0xa4cb('0xa')][_0x3fe6bf[_0xa4cb('0x29')]][_0xa4cb('0x3d')](_0x3d02aa)){if(this[_0xa4cb('0xa')][_0x3fe6bf['uniqueid']][_0x3d02aa][_0xa4cb('0x59')]&&!this[_0xa4cb('0xa')][_0x3fe6bf['uniqueid']][_0x3d02aa][_0xa4cb('0x17')]){logger['info'](_0xa4cb('0x5a'),_0x3fe6bf[_0xa4cb('0x29')],this[_0xa4cb('0xa')][_0x3fe6bf['uniqueid']][_0x3d02aa]['membername'],_0x3d02aa);this[_0xa4cb('0xa')][_0x3fe6bf['uniqueid']][_0x3d02aa]['agentcomplete']=!![];this[_0xa4cb('0xa')][_0x3fe6bf[_0xa4cb('0x29')]][_0x3d02aa][_0xa4cb('0x5b')]=moment()[_0xa4cb('0x2e')](_0xa4cb('0x2f'));this[_0xa4cb('0xa')][_0x3fe6bf['uniqueid']][_0x3d02aa][_0xa4cb('0x50')]=_0xa4cb('0x5c');this[_0xa4cb('0xa')][_0x3fe6bf[_0xa4cb('0x29')]][_0x3d02aa][_0xa4cb('0x4a')]=_0x3fe6bf[_0xa4cb('0x4a')]=='transfer'?_0xa4cb('0x5d'):_0x3fe6bf[_0xa4cb('0x4a')];this[_0xa4cb('0xa')][_0x3fe6bf[_0xa4cb('0x29')]][_0x3d02aa][_0xa4cb('0x5e')]=_0x3fe6bf[_0xa4cb('0x5e')];if(this[_0xa4cb('0xc')][_0x3fe6bf[_0xa4cb('0x30')]]&&this[_0xa4cb('0xc')][_0x3fe6bf['queue']][_0xa4cb('0x5f')]){this['channels'][_0x3fe6bf[_0xa4cb('0x29')]][_0x3d02aa]['acwtime']=this[_0xa4cb('0xc')][_0x3fe6bf[_0xa4cb('0x30')]][_0xa4cb('0x60')];this[_0xa4cb('0xa')][_0x3fe6bf['uniqueid']][_0x3d02aa]['agentacw']=!![];}this['agents'][_0x3fe6bf[_0xa4cb('0x61')]]=_[_0xa4cb('0x33')](this[_0xa4cb('0xd')][_0x3fe6bf['interface']],[_0xa4cb('0x30'),_0xa4cb('0x62')]);logger[_0xa4cb('0x2c')](_0xa4cb('0x63'),_0x3fe6bf['uniqueid'],util[_0xa4cb('0x38')](this[_0xa4cb('0xa')][_0x3fe6bf[_0xa4cb('0x29')]][_0x3d02aa],{'showHidden':![],'depth':null}));ami[_0xa4cb('0x24')]('custom:agentcomplete',this[_0xa4cb('0xa')][_0x3fe6bf['uniqueid']][_0x3d02aa]);logger[_0xa4cb('0x2c')](_0xa4cb('0x64'),_0x3fe6bf[_0xa4cb('0x29')],util['inspect']({'id':this[_0xa4cb('0xd')][_0x3fe6bf[_0xa4cb('0x61')]]['id'],'destaccountcode':_0x3fe6bf['destaccountcode']},{'showHidden':![],'depth':null}));this[_0xa4cb('0x24')](util['format']('user:%s',_0x3fe6bf[_0xa4cb('0x2a')]),'user:agentcomplete',{'id':this[_0xa4cb('0xd')][_0x3fe6bf[_0xa4cb('0x61')]]['id'],'destaccountcode':_0x3fe6bf[_0xa4cb('0x65')]});}}}}}}catch(_0x267863){logger['error'](_0xa4cb('0x66'),_0x3fe6bf[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x267863,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xa4cb('0x1a')]=function(_0x4820c2){try{if(this['isNotNull'](_0x4820c2)){logger[_0xa4cb('0x2c')](_0xa4cb('0x67'),_0x4820c2[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x4820c2,{'showHidden':![],'depth':null}));this['addVariable'](_0x4820c2[_0xa4cb('0x29')],_['keys'](_0x4820c2[_0xa4cb('0x68')])[0x0],_0x4820c2[_0xa4cb('0x69')]);if(this['channels'][_0x4820c2[_0xa4cb('0x29')]]){for(var _0x3cce76 in this[_0xa4cb('0xa')][_0x4820c2[_0xa4cb('0x29')]]){if(this[_0xa4cb('0xa')][_0x4820c2[_0xa4cb('0x29')]][_0xa4cb('0x3d')](_0x3cce76)){logger[_0xa4cb('0x27')](_0xa4cb('0x6a'),_0x4820c2[_0xa4cb('0x29')],_0x3cce76,_[_0xa4cb('0x6b')](_0x4820c2[_0xa4cb('0x68')])[0x0],_0x4820c2[_0xa4cb('0x69')]);if(_[_0xa4cb('0x25')](this['channels'][_0x4820c2['uniqueid']][_0x3cce76][_0xa4cb('0xe')])){this[_0xa4cb('0xa')][_0x4820c2[_0xa4cb('0x29')]][_0x3cce76][_0xa4cb('0xe')]={};}this[_0xa4cb('0xa')][_0x4820c2[_0xa4cb('0x29')]][_0x3cce76][_0xa4cb('0xe')]=this[_0xa4cb('0xe')][_0x4820c2[_0xa4cb('0x29')]];}}}}}catch(_0x576a61){logger[_0xa4cb('0x3a')](_0xa4cb('0x6c'),_0x4820c2[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x576a61,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa4cb('0x23')][_0xa4cb('0x6d')]=function(_0x1ff952,_0x57adba,_0x24b215){var _0x58f375=['rtpaudioqos',_0xa4cb('0x6e'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xa4cb('0x6f'),_0xa4cb('0x70'),'rtpaudioqosrtt',_0xa4cb('0x71'),_0xa4cb('0x72'),_0xa4cb('0x73'),_0xa4cb('0x74'),_0xa4cb('0x75'),_0xa4cb('0x76'),_0xa4cb('0x77'),_0xa4cb('0x78'),_0xa4cb('0x79'),_0xa4cb('0x2a'),_0xa4cb('0x7a'),_0xa4cb('0x7b')];if(!_[_0xa4cb('0x7c')](_0x57adba)&&!_[_0xa4cb('0x7d')](_0x58f375,_0x57adba)){if(_[_0xa4cb('0x25')](this[_0xa4cb('0xe')][_0x1ff952])){this[_0xa4cb('0xe')][_0x1ff952]={};}this[_0xa4cb('0xe')][_0x1ff952][_0x57adba]=_0x24b215;}};VoiceAgentReport[_0xa4cb('0x23')]['syncHangup']=function(_0x8949d3){try{if(this[_0xa4cb('0x26')](_0x8949d3)){logger[_0xa4cb('0x2c')]('[%s][voiceAgentReport][hangup]\x20event:',_0x8949d3['uniqueid'],util[_0xa4cb('0x38')](_0x8949d3,{'showHidden':![],'depth':null}));if(this[_0xa4cb('0xa')][_0x8949d3[_0xa4cb('0x29')]]){for(var _0x5de0e8 in this['channels'][_0x8949d3['uniqueid']]){if(this[_0xa4cb('0xa')][_0x8949d3['uniqueid']][_0xa4cb('0x3d')](_0x5de0e8)){if(this[_0xa4cb('0xa')][_0x8949d3[_0xa4cb('0x29')]][_0x5de0e8]['reason']=='transfer'&&this[_0xa4cb('0xa')][_0x8949d3['uniqueid']][_0x5de0e8]['agentcomplete']){logger['info'](_0xa4cb('0x7e'),_0x8949d3[_0xa4cb('0x29')],_0x5de0e8);this[_0xa4cb('0xa')][_0x8949d3['uniqueid']][_0x5de0e8][_0xa4cb('0x5b')]=moment()['format'](_0xa4cb('0x2f'));}}}logger[_0xa4cb('0x2c')](_0xa4cb('0x7f'),_0x8949d3[_0xa4cb('0x29')],util['inspect'](_[_0xa4cb('0x80')](this[_0xa4cb('0xa')][_0x8949d3[_0xa4cb('0x29')]]),{'showHidden':![],'depth':null}));ami[_0xa4cb('0x24')]('custom:voiceAgentReport',_[_0xa4cb('0x80')](this[_0xa4cb('0xa')][_0x8949d3[_0xa4cb('0x29')]]));delete this[_0xa4cb('0xa')][_0x8949d3[_0xa4cb('0x29')]];}if(this[_0xa4cb('0xe')][_0x8949d3['uniqueid']]){delete this['variables'][_0x8949d3[_0xa4cb('0x29')]];}}}catch(_0x34703f){logger[_0xa4cb('0x3a')](_0xa4cb('0x81'),_0x8949d3[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x34703f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa4cb('0x23')]['syncAttendedTransfer']=function(_0x252118){try{if(this[_0xa4cb('0x26')](_0x252118)){logger['debug'](_0xa4cb('0x82'),_0x252118[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x252118,{'showHidden':![],'depth':null}));if(this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x83')]]){for(var _0x5884e9 in this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x83')]]){if(this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x83')]][_0xa4cb('0x3d')](_0x5884e9)){if(_0x252118[_0xa4cb('0x84')]===_0x5884e9){logger[_0xa4cb('0x27')](_0xa4cb('0x85'),_0x252118['uniqueid'],this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x83')]][_0x5884e9][_0xa4cb('0x2a')],_0x5884e9);var _0x98630=moment();this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x83')]][_0x5884e9][_0xa4cb('0x17')]=!![];this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x83')]][_0x5884e9][_0xa4cb('0x5b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x83')]][_0x5884e9][_0xa4cb('0x50')]=_0xa4cb('0x5c');this[_0xa4cb('0xa')][_0x252118['transfereeuniqueid']][_0x5884e9][_0xa4cb('0x4a')]=_0xa4cb('0x86');this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x83')]][_0x5884e9][_0xa4cb('0x5e')]=_0x98630[_0xa4cb('0x87')](this['channels'][_0x252118[_0xa4cb('0x83')]][_0x5884e9]['agentconnectAt'],'seconds');}}}}if(this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x88')]]){var _0x3452d2=this['channels'][_0x252118['secondtransfereruniqueid']];this[_0xa4cb('0xa')][_0x252118[_0xa4cb('0x88')]]=this[_0xa4cb('0xa')][_0x252118['transfereeuniqueid']];this['channels'][_0x252118[_0xa4cb('0x83')]]=_0x3452d2;}}}catch(_0x500047){logger[_0xa4cb('0x3a')]('[%s][voiceAgentReport][attendedtransfer]',_0x252118[_0xa4cb('0x29')],util['inspect'](_0x500047,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa4cb('0x23')]['syncBlindTransfer']=function(_0x586345){try{if(this[_0xa4cb('0x26')](_0x586345)){logger[_0xa4cb('0x2c')](_0xa4cb('0x89'),_0x586345[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x586345,{'showHidden':![],'depth':null}));if(this[_0xa4cb('0xa')][_0x586345[_0xa4cb('0x83')]]){for(var _0x3f5f9f in this[_0xa4cb('0xa')][_0x586345[_0xa4cb('0x83')]]){if(this['channels'][_0x586345[_0xa4cb('0x83')]][_0xa4cb('0x3d')](_0x3f5f9f)){if(_0x586345['transfereruniqueid']===_0x3f5f9f){logger[_0xa4cb('0x27')](_0xa4cb('0x8a'),_0x586345['uniqueid'],this[_0xa4cb('0xa')][_0x586345[_0xa4cb('0x83')]][_0x3f5f9f][_0xa4cb('0x2a')],_0x3f5f9f);var _0x3a5247=moment();this[_0xa4cb('0xa')][_0x586345[_0xa4cb('0x83')]][_0x3f5f9f][_0xa4cb('0x17')]=!![];this[_0xa4cb('0xa')][_0x586345['transfereeuniqueid']][_0x3f5f9f][_0xa4cb('0x5b')]=_0x3a5247;this[_0xa4cb('0xa')][_0x586345[_0xa4cb('0x83')]][_0x3f5f9f][_0xa4cb('0x50')]='complete';this[_0xa4cb('0xa')][_0x586345['transfereeuniqueid']][_0x3f5f9f][_0xa4cb('0x4a')]='transfer';this[_0xa4cb('0xa')][_0x586345[_0xa4cb('0x83')]][_0x3f5f9f][_0xa4cb('0x5e')]=_0x3a5247[_0xa4cb('0x87')](this[_0xa4cb('0xa')][_0x586345[_0xa4cb('0x83')]][_0x3f5f9f][_0xa4cb('0x59')],_0xa4cb('0x8b'));}}}}}}catch(_0x1ec10f){logger[_0xa4cb('0x3a')](_0xa4cb('0x8c'),_0x586345[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x1ec10f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa4cb('0x23')][_0xa4cb('0x1e')]=function(_0x4ee9c2){var _0x22edc1='';try{if(this[_0xa4cb('0x26')](_0x4ee9c2)){logger[_0xa4cb('0x2c')](_0xa4cb('0x8d'),_0x4ee9c2[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x4ee9c2,{'showHidden':![],'depth':null}));if(_0x4ee9c2[_0xa4cb('0x8e')]){_0x22edc1=_0x4ee9c2[_0xa4cb('0x8e')][_0xa4cb('0x8f')](0x0,_0x4ee9c2[_0xa4cb('0x8e')]['lastIndexOf']('-'));if(this[_0xa4cb('0xd')][_0x22edc1]){logger[_0xa4cb('0x27')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x4ee9c2[_0xa4cb('0x29')],_0x22edc1);this[_0xa4cb('0xd')][_0x22edc1][_0xa4cb('0x90')]=!![];}}}}catch(_0xd9fc2b){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x4ee9c2[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0xd9fc2b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xa4cb('0x23')][_0xa4cb('0x20')]=function(_0xa72c76){var _0x255939='';try{if(this[_0xa4cb('0x26')](_0xa72c76)){logger[_0xa4cb('0x2c')](_0xa4cb('0x91'),_0xa72c76[_0xa4cb('0x29')],util['inspect'](_0xa72c76,{'showHidden':![],'depth':null}));if(_0xa72c76[_0xa4cb('0x8e')]){_0x255939=_0xa72c76[_0xa4cb('0x8e')][_0xa4cb('0x8f')](0x0,_0xa72c76[_0xa4cb('0x8e')][_0xa4cb('0x92')]('-'));if(this[_0xa4cb('0xd')][_0x255939]){logger[_0xa4cb('0x27')](_0xa4cb('0x93'),_0xa72c76[_0xa4cb('0x29')],_0x255939);this[_0xa4cb('0xd')][_0x255939]['onhold']=![];}}}}catch(_0x4a8b41){logger[_0xa4cb('0x3a')](_0xa4cb('0x94'),_0xa72c76[_0xa4cb('0x29')],util[_0xa4cb('0x38')](_0x4a8b41,{'showHidden':![],'depth':null}));}};module[_0xa4cb('0x95')]=VoiceAgentReport; \ No newline at end of file +var _0x2cb3=['[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','syncHangup','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','ami','../ami','defaults','localhost','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','agentcomplete','syncAgentComplete','hangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','prototype','emit','isNotNull','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','isUndefined','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','interface','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','custom:agentringnoanswer','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','talktime','acw','acwtime','acwTimeout','agentacw','custom:agentcomplete','destaccountcode','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable'];(function(_0x19c3e0,_0x470f6d){var _0x566594=function(_0x5336d0){while(--_0x5336d0){_0x19c3e0['push'](_0x19c3e0['shift']());}};_0x566594(++_0x470f6d);}(_0x2cb3,0xc9));var _0x32cb=function(_0x5e7b11,_0xbcd57d){_0x5e7b11=_0x5e7b11-0x0;var _0x1bae9d=_0x2cb3[_0x5e7b11];return _0x1bae9d;};'use strict';var _=require(_0x32cb('0x0'));var moment=require(_0x32cb('0x1'));var util=require(_0x32cb('0x2'));var Redis=require(_0x32cb('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x32cb('0x4'));var ami=require(_0x32cb('0x5'));config['redis']=_[_0x32cb('0x6')](config['redis'],{'host':_0x32cb('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x5dc3a8){this[_0x32cb('0x8')]={};this[_0x32cb('0x9')]=_0x5dc3a8[_0x32cb('0x8')];this[_0x32cb('0xa')]=_0x5dc3a8[_0x32cb('0xa')];this[_0x32cb('0xb')]=_0x5dc3a8[_0x32cb('0xb')];this[_0x32cb('0xc')]={};ami['on'](_0x32cb('0xd'),this[_0x32cb('0xe')][_0x32cb('0xf')](this));ami['on'](_0x32cb('0x10'),this[_0x32cb('0x11')]['bind'](this));ami['on'](_0x32cb('0x12'),this['syncAgentRingNoAnswer'][_0x32cb('0xf')](this));ami['on'](_0x32cb('0x13'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x32cb('0x14'),this[_0x32cb('0x15')][_0x32cb('0xf')](this));ami['on']('varset',this['syncVarSet'][_0x32cb('0xf')](this));ami['on'](_0x32cb('0x16'),this['syncHangup'][_0x32cb('0xf')](this));ami['on'](_0x32cb('0x17'),this['syncMusicOnHoldStart'][_0x32cb('0xf')](this));ami['on'](_0x32cb('0x18'),this[_0x32cb('0x19')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x32cb('0xf')](this));ami['on'](_0x32cb('0x1a'),this['syncBlindTransfer'][_0x32cb('0xf')](this));}VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x1c')]=function(_0x506b78,_0xcc4842,_0x4878a6){io['to'](_0x506b78)['emit'](_0xcc4842,_0x4878a6);};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x1d')]=function(_0x1b519c){return _0x1b519c!==null&&!_['isUndefined'](_0x1b519c);};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0xe')]=function(_0xee723c){try{if(this[_0x32cb('0x1d')](_0xee723c)){logger['info'](_0x32cb('0x1e'),_0xee723c['uniqueid'],_0xee723c[_0x32cb('0x1f')],_0xee723c[_0x32cb('0x20')]);logger[_0x32cb('0x21')](_0x32cb('0x22'),_0xee723c[_0x32cb('0x23')],util[_0x32cb('0x24')](_0xee723c,{'showHidden':![],'depth':null}));if(_[_0x32cb('0x25')](this['channels'][_0xee723c[_0x32cb('0x23')]])){this['channels'][_0xee723c[_0x32cb('0x23')]]={};}if(_[_0x32cb('0x25')](this['channels'][_0xee723c[_0x32cb('0x23')]][_0xee723c[_0x32cb('0x20')]])){this[_0x32cb('0x8')][_0xee723c[_0x32cb('0x23')]][_0xee723c[_0x32cb('0x20')]]={'agentcalledAt':moment()[_0x32cb('0x26')](_0x32cb('0x27')),'lastevent':_0x32cb('0x28'),'mandatoryDisposition':this[_0x32cb('0xa')][_0xee723c['queue']]?this[_0x32cb('0xa')][_0xee723c[_0x32cb('0x29')]][_0x32cb('0x2a')]||![]:![],'type':this[_0x32cb('0xa')][_0xee723c['queue']]?this[_0x32cb('0xa')][_0xee723c['queue']][_0x32cb('0x2b')]||'inbound':_0x32cb('0x2c'),'variables':this[_0x32cb('0xc')][_0xee723c[_0x32cb('0x23')]],'motionChannel':_0x32cb('0x2d')};}_['merge'](this[_0x32cb('0x8')][_0xee723c[_0x32cb('0x23')]][_0xee723c[_0x32cb('0x20')]],_[_0x32cb('0x2e')](_0xee723c,[_0x32cb('0x2f'),'privilege']));logger[_0x32cb('0x21')](_0x32cb('0x30'),_0xee723c[_0x32cb('0x23')],util[_0x32cb('0x24')](this['channels'][_0xee723c[_0x32cb('0x23')]][_0xee723c[_0x32cb('0x20')]],{'showHidden':![],'depth':null}));ami[_0x32cb('0x1c')](_0x32cb('0x31'),this[_0x32cb('0x8')][_0xee723c[_0x32cb('0x23')]][_0xee723c[_0x32cb('0x20')]]);var _0x8e3c88={'id':this[_0x32cb('0xb')][_0xee723c['interface']]['id'],'calleridnum':this['channels'][_0xee723c['uniqueid']][_0xee723c[_0x32cb('0x20')]][_0x32cb('0x32')],'queue':this[_0x32cb('0x8')][_0xee723c[_0x32cb('0x23')]][_0xee723c[_0x32cb('0x20')]][_0x32cb('0x29')],'variables':this[_0x32cb('0x8')][_0xee723c[_0x32cb('0x23')]][_0xee723c[_0x32cb('0x20')]]['variables']};logger[_0x32cb('0x21')](_0x32cb('0x33'),_0xee723c[_0x32cb('0x23')],util['inspect'](_0x8e3c88,{'showHidden':![],'depth':null}));this[_0x32cb('0x1c')](util['format'](_0x32cb('0x34'),_0xee723c[_0x32cb('0x1f')]),_0x32cb('0x35'),_0x8e3c88);}}catch(_0x428656){logger[_0x32cb('0x36')](_0x32cb('0x37'),_0xee723c['uniqueid'],util[_0x32cb('0x24')](_0x428656,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0xaa71a){try{if(this[_0x32cb('0x1d')](_0xaa71a)){if(this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]]){logger['debug'](_0x32cb('0x38'),_0xaa71a[_0x32cb('0x23')],util[_0x32cb('0x24')](_0xaa71a,{'showHidden':![],'depth':null}));for(var _0x153cf9 in this['channels'][_0xaa71a[_0x32cb('0x23')]]){if(this['channels'][_0xaa71a['uniqueid']][_0x32cb('0x39')](_0x153cf9)){if(_0xaa71a[_0x32cb('0x20')]===_0x153cf9){logger[_0x32cb('0x3a')](_0x32cb('0x3b'),_0xaa71a['uniqueid'],_0xaa71a[_0x32cb('0x1f')],_0xaa71a[_0x32cb('0x20')]);this[_0x32cb('0x8')][_0xaa71a['uniqueid']][_0x153cf9][_0x32cb('0x3c')]=moment()['format'](_0x32cb('0x27'));this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x3d')]=_0xaa71a[_0x32cb('0x3d')];this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x3e')]=_0xaa71a[_0x32cb('0x3e')];this['channels'][_0xaa71a[_0x32cb('0x23')]][_0x153cf9]['destchannelstate']=_0xaa71a['destchannelstate'];this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x3f')]=_0xaa71a[_0x32cb('0x3f')];this[_0x32cb('0x8')][_0xaa71a['uniqueid']][_0x153cf9][_0x32cb('0x40')]=_0xaa71a['holdtime'];this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x41')]=_0x32cb('0x42');if(this[_0x32cb('0x9')][this['channels'][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x23')]]){var _0x10ef17=this['voiceChannels'][this['channels'][_0xaa71a[_0x32cb('0x23')]][_0x153cf9]['uniqueid']][_0x32cb('0x43')];this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x43')]=_0x10ef17;_0xaa71a[_0x32cb('0x43')]=_0x10ef17;}_[_0x32cb('0x44')](this['agents'][_0xaa71a[_0x32cb('0x45')]],_['pick'](_0xaa71a,[_0x32cb('0x29'),_0x32cb('0x46'),_0x32cb('0x43')]));logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0xaa71a[_0x32cb('0x23')],util['inspect'](this['channels'][_0xaa71a[_0x32cb('0x23')]][_0xaa71a[_0x32cb('0x20')]],{'showHidden':![],'depth':null}));ami[_0x32cb('0x1c')](_0x32cb('0x47'),this[_0x32cb('0x8')][_0xaa71a['uniqueid']][_0xaa71a['destuniqueid']]);logger[_0x32cb('0x21')](_0x32cb('0x48'),_0xaa71a[_0x32cb('0x23')],util[_0x32cb('0x24')](this[_0x32cb('0x8')][_0xaa71a['uniqueid']][_0xaa71a[_0x32cb('0x20')]],{'showHidden':![],'depth':null}));this[_0x32cb('0x1c')](util[_0x32cb('0x26')](_0x32cb('0x34'),_0xaa71a[_0x32cb('0x1f')]),_0x32cb('0x49'),this['channels'][_0xaa71a[_0x32cb('0x23')]][_0xaa71a['destuniqueid']]);}else if(!this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9]['agentringnoanswer']&&!this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9]['agentcomplete']){logger[_0x32cb('0x3a')](_0x32cb('0x4a'),_0xaa71a[_0x32cb('0x23')],this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x1f')],_0x153cf9);this['channels'][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x12')]=!![];this['channels'][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x4b')]=moment()[_0x32cb('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0xaa71a['uniqueid']][_0x153cf9]['answeredelsewheredestinationuniqueid']=_0xaa71a[_0x32cb('0x20')];this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9][_0x32cb('0x4c')]=_0xaa71a[_0x32cb('0x1f')];this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9]['lastevent']=_0x32cb('0x4d');this[_0x32cb('0x8')][_0xaa71a['uniqueid']][_0x153cf9][_0x32cb('0x4e')]='answered_elsewhere';logger[_0x32cb('0x21')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0xaa71a[_0x32cb('0x23')],util[_0x32cb('0x24')](this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9],{'showHidden':![],'depth':null}));ami['emit'](_0x32cb('0x4f'),this[_0x32cb('0x8')][_0xaa71a[_0x32cb('0x23')]][_0x153cf9]);}}}}}}catch(_0x115818){logger['error'](_0x32cb('0x50'),_0xaa71a[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x115818,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x51')]=function(_0x3bcead){try{if(this[_0x32cb('0x1d')](_0x3bcead)){logger['debug'](_0x32cb('0x52'),_0x3bcead[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x3bcead,{'showHidden':![],'depth':null}));if(this[_0x32cb('0x8')][_0x3bcead[_0x32cb('0x23')]]&&this[_0x32cb('0x8')][_0x3bcead[_0x32cb('0x23')]][_0x3bcead[_0x32cb('0x20')]]){logger[_0x32cb('0x3a')](_0x32cb('0x53'),_0x3bcead[_0x32cb('0x23')],_0x3bcead[_0x32cb('0x1f')],_0x3bcead[_0x32cb('0x20')]);this[_0x32cb('0x8')][_0x3bcead['uniqueid']][_0x3bcead[_0x32cb('0x20')]][_0x32cb('0x12')]=!![];this[_0x32cb('0x8')][_0x3bcead['uniqueid']][_0x3bcead['destuniqueid']]['agentringnoanswerAt']=moment()['format'](_0x32cb('0x27'));this[_0x32cb('0x8')][_0x3bcead[_0x32cb('0x23')]][_0x3bcead[_0x32cb('0x20')]][_0x32cb('0x41')]=_0x32cb('0x54');this['channels'][_0x3bcead[_0x32cb('0x23')]][_0x3bcead[_0x32cb('0x20')]]['reason']=_0x32cb('0x54');logger[_0x32cb('0x21')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x3bcead['uniqueid'],util[_0x32cb('0x24')](this[_0x32cb('0x8')][_0x3bcead[_0x32cb('0x23')]][_0x3bcead['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x32cb('0x1c')](_0x32cb('0x55'),this['channels'][_0x3bcead[_0x32cb('0x23')]][_0x3bcead['destuniqueid']]);}}}catch(_0x5c33be){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x3bcead[_0x32cb('0x23')],util['inspect'](_0x5c33be,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x56')]=function(_0x45787e){try{if(this[_0x32cb('0x1d')](_0x45787e)){logger['debug'](_0x32cb('0x57'),_0x45787e['uniqueid'],util[_0x32cb('0x24')](_0x45787e,{'showHidden':![],'depth':null}));if(this[_0x32cb('0x8')][_0x45787e['uniqueid']]){for(var _0x109fa0 in this[_0x32cb('0x8')][_0x45787e[_0x32cb('0x23')]]){if(this['channels'][_0x45787e[_0x32cb('0x23')]]['hasOwnProperty'](_0x109fa0)&&!this[_0x32cb('0x8')][_0x45787e['uniqueid']][_0x109fa0][_0x32cb('0x12')]&&!this['channels'][_0x45787e['uniqueid']][_0x109fa0][_0x32cb('0x14')]){logger[_0x32cb('0x3a')](_0x32cb('0x58'),_0x45787e[_0x32cb('0x23')],this[_0x32cb('0x8')][_0x45787e[_0x32cb('0x23')]][_0x109fa0][_0x32cb('0x1f')],_0x109fa0);this[_0x32cb('0x8')][_0x45787e[_0x32cb('0x23')]][_0x109fa0][_0x32cb('0x12')]=!![];this[_0x32cb('0x8')][_0x45787e[_0x32cb('0x23')]][_0x109fa0][_0x32cb('0x4b')]=moment()[_0x32cb('0x26')](_0x32cb('0x27'));this['channels'][_0x45787e['uniqueid']][_0x109fa0][_0x32cb('0x41')]=_0x32cb('0x59');this['channels'][_0x45787e[_0x32cb('0x23')]][_0x109fa0][_0x32cb('0x4e')]='abandoned';logger[_0x32cb('0x21')](_0x32cb('0x5a'),_0x45787e[_0x32cb('0x23')],util[_0x32cb('0x24')](this[_0x32cb('0x8')][_0x45787e[_0x32cb('0x23')]][_0x109fa0],{'showHidden':![],'depth':null}));ami['emit'](_0x32cb('0x5b'),this[_0x32cb('0x8')][_0x45787e['uniqueid']][_0x109fa0]);}}}}}catch(_0x17a4e2){logger[_0x32cb('0x36')](_0x32cb('0x5c'),_0x45787e['uniqueid'],util[_0x32cb('0x24')](_0x17a4e2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x15')]=function(_0x3ec8bc){try{if(this[_0x32cb('0x1d')](_0x3ec8bc)){logger[_0x32cb('0x21')](_0x32cb('0x5d'),_0x3ec8bc[_0x32cb('0x23')],util['inspect'](_0x3ec8bc,{'showHidden':![],'depth':null}));if(this[_0x32cb('0x8')][_0x3ec8bc[_0x32cb('0x23')]]){for(var _0x1bb71e in this['channels'][_0x3ec8bc['uniqueid']]){if(this[_0x32cb('0x8')][_0x3ec8bc[_0x32cb('0x23')]]['hasOwnProperty'](_0x1bb71e)){if(this['channels'][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e][_0x32cb('0x3c')]&&!this[_0x32cb('0x8')][_0x3ec8bc['uniqueid']][_0x1bb71e][_0x32cb('0x14')]){logger['info'](_0x32cb('0x5e'),_0x3ec8bc[_0x32cb('0x23')],this['channels'][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e][_0x32cb('0x1f')],_0x1bb71e);this[_0x32cb('0x8')][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e][_0x32cb('0x14')]=!![];this[_0x32cb('0x8')][_0x3ec8bc['uniqueid']][_0x1bb71e][_0x32cb('0x5f')]=moment()[_0x32cb('0x26')](_0x32cb('0x27'));this['channels'][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e]['lastevent']=_0x32cb('0x60');this[_0x32cb('0x8')][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e][_0x32cb('0x4e')]=_0x3ec8bc[_0x32cb('0x4e')]==_0x32cb('0x61')?'agent':_0x3ec8bc[_0x32cb('0x4e')];this[_0x32cb('0x8')][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e][_0x32cb('0x62')]=_0x3ec8bc['talktime'];if(this['voiceQueues'][_0x3ec8bc[_0x32cb('0x29')]]&&this[_0x32cb('0xa')][_0x3ec8bc[_0x32cb('0x29')]][_0x32cb('0x63')]){this['channels'][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e][_0x32cb('0x64')]=this[_0x32cb('0xa')][_0x3ec8bc[_0x32cb('0x29')]][_0x32cb('0x65')];this[_0x32cb('0x8')][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e][_0x32cb('0x66')]=!![];}this[_0x32cb('0xb')][_0x3ec8bc['interface']]=_[_0x32cb('0x2e')](this[_0x32cb('0xb')][_0x3ec8bc[_0x32cb('0x45')]],[_0x32cb('0x29'),'destconnectedlinenum']);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x3ec8bc[_0x32cb('0x23')],util[_0x32cb('0x24')](this[_0x32cb('0x8')][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e],{'showHidden':![],'depth':null}));ami[_0x32cb('0x1c')](_0x32cb('0x67'),this[_0x32cb('0x8')][_0x3ec8bc[_0x32cb('0x23')]][_0x1bb71e]);logger[_0x32cb('0x21')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x3ec8bc['uniqueid'],util[_0x32cb('0x24')]({'id':this[_0x32cb('0xb')][_0x3ec8bc[_0x32cb('0x45')]]['id'],'destaccountcode':_0x3ec8bc[_0x32cb('0x68')]},{'showHidden':![],'depth':null}));this[_0x32cb('0x1c')](util[_0x32cb('0x26')](_0x32cb('0x34'),_0x3ec8bc[_0x32cb('0x1f')]),'user:agentcomplete',{'id':this[_0x32cb('0xb')][_0x3ec8bc[_0x32cb('0x45')]]['id'],'destaccountcode':_0x3ec8bc[_0x32cb('0x68')]});}}}}}}catch(_0x548316){logger['error'](_0x32cb('0x69'),_0x3ec8bc[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x548316,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x6a')]=function(_0x2c0380){try{if(this[_0x32cb('0x1d')](_0x2c0380)){logger['debug'](_0x32cb('0x6b'),_0x2c0380[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x2c0380,{'showHidden':![],'depth':null}));this[_0x32cb('0x6c')](_0x2c0380[_0x32cb('0x23')],_[_0x32cb('0x6d')](_0x2c0380[_0x32cb('0x6e')])[0x0],_0x2c0380['value']);if(this[_0x32cb('0x8')][_0x2c0380[_0x32cb('0x23')]]){for(var _0x403c4f in this[_0x32cb('0x8')][_0x2c0380[_0x32cb('0x23')]]){if(this[_0x32cb('0x8')][_0x2c0380['uniqueid']][_0x32cb('0x39')](_0x403c4f)){logger[_0x32cb('0x3a')](_0x32cb('0x6f'),_0x2c0380[_0x32cb('0x23')],_0x403c4f,_[_0x32cb('0x6d')](_0x2c0380[_0x32cb('0x6e')])[0x0],_0x2c0380[_0x32cb('0x70')]);if(_[_0x32cb('0x25')](this[_0x32cb('0x8')][_0x2c0380[_0x32cb('0x23')]][_0x403c4f]['variables'])){this['channels'][_0x2c0380['uniqueid']][_0x403c4f][_0x32cb('0xc')]={};}this[_0x32cb('0x8')][_0x2c0380[_0x32cb('0x23')]][_0x403c4f][_0x32cb('0xc')]=this[_0x32cb('0xc')][_0x2c0380[_0x32cb('0x23')]];}}}}}catch(_0x26ddaf){logger['error'](_0x32cb('0x71'),_0x2c0380[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x26ddaf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x6c')]=function(_0xd81689,_0x124ad7,_0x3ad563){var _0x115b40=[_0x32cb('0x72'),_0x32cb('0x73'),_0x32cb('0x74'),_0x32cb('0x75'),_0x32cb('0x76'),'rtpaudioqoslossbridged',_0x32cb('0x77'),_0x32cb('0x78'),'sipcallid',_0x32cb('0x79'),_0x32cb('0x7a'),_0x32cb('0x7b'),_0x32cb('0x7c'),_0x32cb('0x7d'),_0x32cb('0x7e'),'memberlastcall',_0x32cb('0x1f'),_0x32cb('0x7f'),_0x32cb('0x80')];if(!_[_0x32cb('0x81')](_0x124ad7)&&!_['includes'](_0x115b40,_0x124ad7)){if(_[_0x32cb('0x25')](this['variables'][_0xd81689])){this['variables'][_0xd81689]={};}this[_0x32cb('0xc')][_0xd81689][_0x124ad7]=_0x3ad563;}};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x82')]=function(_0x5af89){try{if(this[_0x32cb('0x1d')](_0x5af89)){logger[_0x32cb('0x21')]('[%s][voiceAgentReport][hangup]\x20event:',_0x5af89[_0x32cb('0x23')],util['inspect'](_0x5af89,{'showHidden':![],'depth':null}));if(this[_0x32cb('0x8')][_0x5af89[_0x32cb('0x23')]]){for(var _0x448af7 in this[_0x32cb('0x8')][_0x5af89['uniqueid']]){if(this[_0x32cb('0x8')][_0x5af89[_0x32cb('0x23')]]['hasOwnProperty'](_0x448af7)){if(this[_0x32cb('0x8')][_0x5af89[_0x32cb('0x23')]][_0x448af7][_0x32cb('0x4e')]==_0x32cb('0x61')&&this[_0x32cb('0x8')][_0x5af89[_0x32cb('0x23')]][_0x448af7][_0x32cb('0x14')]){logger[_0x32cb('0x3a')](_0x32cb('0x83'),_0x5af89[_0x32cb('0x23')],_0x448af7);this[_0x32cb('0x8')][_0x5af89[_0x32cb('0x23')]][_0x448af7]['agentcompleteAt']=moment()[_0x32cb('0x26')](_0x32cb('0x27'));}}}logger[_0x32cb('0x21')](_0x32cb('0x84'),_0x5af89['uniqueid'],util[_0x32cb('0x24')](_['values'](this[_0x32cb('0x8')][_0x5af89[_0x32cb('0x23')]]),{'showHidden':![],'depth':null}));ami[_0x32cb('0x1c')](_0x32cb('0x85'),_[_0x32cb('0x86')](this['channels'][_0x5af89[_0x32cb('0x23')]]));delete this[_0x32cb('0x8')][_0x5af89[_0x32cb('0x23')]];}if(this[_0x32cb('0xc')][_0x5af89[_0x32cb('0x23')]]){delete this[_0x32cb('0xc')][_0x5af89['uniqueid']];}}}catch(_0x880d0c){logger[_0x32cb('0x36')](_0x32cb('0x87'),_0x5af89[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x880d0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')]['syncAttendedTransfer']=function(_0x2fd4a2){try{if(this[_0x32cb('0x1d')](_0x2fd4a2)){logger[_0x32cb('0x21')](_0x32cb('0x88'),_0x2fd4a2['uniqueid'],util[_0x32cb('0x24')](_0x2fd4a2,{'showHidden':![],'depth':null}));if(this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x89')]]){for(var _0x2f38c7 in this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x89')]]){if(this[_0x32cb('0x8')][_0x2fd4a2['transfereeuniqueid']]['hasOwnProperty'](_0x2f38c7)){if(_0x2fd4a2[_0x32cb('0x8a')]===_0x2f38c7){logger[_0x32cb('0x3a')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2fd4a2[_0x32cb('0x23')],this['channels'][_0x2fd4a2['transfereeuniqueid']][_0x2f38c7][_0x32cb('0x1f')],_0x2f38c7);var _0x11bb50=moment();this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x89')]][_0x2f38c7][_0x32cb('0x14')]=!![];this[_0x32cb('0x8')][_0x2fd4a2['transfereeuniqueid']][_0x2f38c7][_0x32cb('0x5f')]=moment()['format'](_0x32cb('0x27'));this[_0x32cb('0x8')][_0x2fd4a2['transfereeuniqueid']][_0x2f38c7]['lastevent']=_0x32cb('0x60');this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x89')]][_0x2f38c7][_0x32cb('0x4e')]=_0x32cb('0x61');this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x89')]][_0x2f38c7][_0x32cb('0x62')]=_0x11bb50['diff'](this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x89')]][_0x2f38c7][_0x32cb('0x3c')],_0x32cb('0x8b'));}}}}if(this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x8c')]]){var _0x3304cb=this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x8c')]];this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x8c')]]=this[_0x32cb('0x8')][_0x2fd4a2[_0x32cb('0x89')]];this[_0x32cb('0x8')][_0x2fd4a2['transfereeuniqueid']]=_0x3304cb;}}}catch(_0xdca009){logger[_0x32cb('0x36')](_0x32cb('0x8d'),_0x2fd4a2[_0x32cb('0x23')],util[_0x32cb('0x24')](_0xdca009,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x8e')]=function(_0x513b32){try{if(this[_0x32cb('0x1d')](_0x513b32)){logger[_0x32cb('0x21')](_0x32cb('0x8f'),_0x513b32[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x513b32,{'showHidden':![],'depth':null}));if(this[_0x32cb('0x8')][_0x513b32[_0x32cb('0x89')]]){for(var _0x24858d in this['channels'][_0x513b32['transfereeuniqueid']]){if(this[_0x32cb('0x8')][_0x513b32[_0x32cb('0x89')]][_0x32cb('0x39')](_0x24858d)){if(_0x513b32[_0x32cb('0x90')]===_0x24858d){logger[_0x32cb('0x3a')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x513b32[_0x32cb('0x23')],this[_0x32cb('0x8')][_0x513b32['transfereeuniqueid']][_0x24858d]['membername'],_0x24858d);var _0x13a405=moment();this[_0x32cb('0x8')][_0x513b32[_0x32cb('0x89')]][_0x24858d]['agentcomplete']=!![];this[_0x32cb('0x8')][_0x513b32[_0x32cb('0x89')]][_0x24858d][_0x32cb('0x5f')]=_0x13a405;this['channels'][_0x513b32['transfereeuniqueid']][_0x24858d][_0x32cb('0x41')]=_0x32cb('0x60');this[_0x32cb('0x8')][_0x513b32[_0x32cb('0x89')]][_0x24858d]['reason']=_0x32cb('0x61');this['channels'][_0x513b32[_0x32cb('0x89')]][_0x24858d][_0x32cb('0x62')]=_0x13a405['diff'](this[_0x32cb('0x8')][_0x513b32[_0x32cb('0x89')]][_0x24858d]['agentconnectAt'],'seconds');}}}}}}catch(_0x16a5be){logger[_0x32cb('0x36')]('[%s][voiceAgentReport][blindtransfer]',_0x513b32[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x16a5be,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')]['syncMusicOnHoldStart']=function(_0x2a501a){var _0x1b1e13='';try{if(this[_0x32cb('0x1d')](_0x2a501a)){logger['debug'](_0x32cb('0x91'),_0x2a501a[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x2a501a,{'showHidden':![],'depth':null}));if(_0x2a501a[_0x32cb('0x92')]){_0x1b1e13=_0x2a501a[_0x32cb('0x92')][_0x32cb('0x93')](0x0,_0x2a501a['channel']['lastIndexOf']('-'));if(this[_0x32cb('0xb')][_0x1b1e13]){logger[_0x32cb('0x3a')](_0x32cb('0x94'),_0x2a501a['uniqueid'],_0x1b1e13);this[_0x32cb('0xb')][_0x1b1e13][_0x32cb('0x95')]=!![];}}}}catch(_0x2262d2){logger[_0x32cb('0x36')](_0x32cb('0x96'),_0x2a501a[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x2262d2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x32cb('0x1b')][_0x32cb('0x19')]=function(_0x3f8d1a){var _0x18e5e8='';try{if(this[_0x32cb('0x1d')](_0x3f8d1a)){logger[_0x32cb('0x21')](_0x32cb('0x97'),_0x3f8d1a[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x3f8d1a,{'showHidden':![],'depth':null}));if(_0x3f8d1a[_0x32cb('0x92')]){_0x18e5e8=_0x3f8d1a[_0x32cb('0x92')][_0x32cb('0x93')](0x0,_0x3f8d1a[_0x32cb('0x92')][_0x32cb('0x98')]('-'));if(this[_0x32cb('0xb')][_0x18e5e8]){logger[_0x32cb('0x3a')](_0x32cb('0x99'),_0x3f8d1a[_0x32cb('0x23')],_0x18e5e8);this[_0x32cb('0xb')][_0x18e5e8][_0x32cb('0x95')]=![];}}}}catch(_0x3107e0){logger[_0x32cb('0x36')](_0x32cb('0x9a'),_0x3f8d1a[_0x32cb('0x23')],util[_0x32cb('0x24')](_0x3107e0,{'showHidden':![],'depth':null}));}};module[_0x32cb('0x9b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 5787953..6996e01 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 _0x3e3c=['push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','destinationchannel','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','then','isEmpty','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','routeid','[%s][voiceCallReport][attendedtransfer]','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','path','../../../config/environment','../../../config/logger','ami','../ami','../rpc/setting','set','queue','agi','dial','voicemail','NO\x20ANSWER','ANSWERED','BUSY','FAILED','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','syncHangup','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','emit','uniqueid','calleridname','[%s][voiceCallReport][newcallerid]\x20event:','inspect','isUndefined','merge','keys','from-sip','channel','exten','xcally-motion-preview','split','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','pick','destconnectedlinenum','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','linkedid','application','toLowerCase','appdata','applicationdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','lastdata','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','diff','calleridnum','connectedlinename','membername','answertime','holdtime','channelstate','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors'];(function(_0x340a95,_0x3d3a60){var _0x5c236e=function(_0x4bfb7b){while(--_0x4bfb7b){_0x340a95['push'](_0x340a95['shift']());}};_0x5c236e(++_0x3d3a60);}(_0x3e3c,0x1d1));var _0xc3e3=function(_0x1bf59b,_0x4564b8){_0x1bf59b=_0x1bf59b-0x0;var _0x45a6fe=_0x3e3c[_0x1bf59b];return _0x45a6fe;};'use strict';var _=require(_0xc3e3('0x0'));var moment=require(_0xc3e3('0x1'));var util=require('util');var path=require(_0xc3e3('0x2'));var Redis=require('ioredis');var config=require(_0xc3e3('0x3'));var logger=require(_0xc3e3('0x4'))(_0xc3e3('0x5'));var ami=require(_0xc3e3('0x6'));var Channel=require('../model/channel');var RpcSetting=require(_0xc3e3('0x7'));var applications=[_0xc3e3('0x8'),_0xc3e3('0x9'),_0xc3e3('0xa'),_0xc3e3('0xb'),'playback',_0xc3e3('0xc')];var dispositions=[_0xc3e3('0xd'),'FAILED','FAILED','NO\x20ANSWER','NO\x20ANSWER',_0xc3e3('0xd'),_0xc3e3('0xe'),_0xc3e3('0xf'),_0xc3e3('0x10'),'FAILED','FAILED'];config[_0xc3e3('0x11')]=_['defaults'](config[_0xc3e3('0x11')],{'host':_0xc3e3('0x12'),'port':0x18eb});var io=require(_0xc3e3('0x13'))(new Redis(config[_0xc3e3('0x11')]));function VoiceCallReport(_0x3e6ab2){this[_0xc3e3('0x14')]=_0x3e6ab2['channels'];this[_0xc3e3('0x15')]=_0x3e6ab2['agents'];this[_0xc3e3('0x16')]={};ami['on']('coreshowchannel',this[_0xc3e3('0x17')][_0xc3e3('0x18')](this));ami['on'](_0xc3e3('0x19'),this[_0xc3e3('0x17')]['bind'](this));ami['on'](_0xc3e3('0x1a'),this['syncNewChannel'][_0xc3e3('0x18')](this));ami['on'](_0xc3e3('0x1b'),this[_0xc3e3('0x1c')]['bind'](this));ami['on'](_0xc3e3('0x1d'),this[_0xc3e3('0x1e')][_0xc3e3('0x18')](this));ami['on']('hangup',this[_0xc3e3('0x1f')][_0xc3e3('0x18')](this));ami['on']('newcallerid',this['syncNewCallerId']['bind'](this));ami['on']('attendedtransfer',this[_0xc3e3('0x20')][_0xc3e3('0x18')](this));ami['on']('blindtransfer',this[_0xc3e3('0x21')][_0xc3e3('0x18')](this));ami['on'](_0xc3e3('0x22'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xc3e3('0x23'),this[_0xc3e3('0x24')][_0xc3e3('0x18')](this));try{logger[_0xc3e3('0x25')](_0xc3e3('0x26'));ami[_0xc3e3('0x27')]();}catch(_0x2ddb71){logger[_0xc3e3('0x28')](_0xc3e3('0x29'),util['inspect'](_0x2ddb71,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xc3e3('0x2a')][_0xc3e3('0x2b')]=function(_0x3a3dce){return _0x3a3dce!==null&&!_['isUndefined'](_0x3a3dce);};VoiceCallReport[_0xc3e3('0x2a')][_0xc3e3('0x2c')]=function(_0x4dd115,_0x3fe9dc,_0x56f12d){io['to'](_0x4dd115)[_0xc3e3('0x2c')](_0x3fe9dc,_0x56f12d);};VoiceCallReport[_0xc3e3('0x2a')]['syncNewCallerId']=function(_0x382403){try{if(this[_0xc3e3('0x2b')](_0x382403)){logger['info']('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x382403[_0xc3e3('0x2d')],_0x382403[_0xc3e3('0x2e')],_0x382403['calleridnum']);logger['debug'](_0xc3e3('0x2f'),_0x382403[_0xc3e3('0x2d')],util[_0xc3e3('0x30')](_0x382403,{'showHidden':![],'depth':null}));if(_0x382403[_0xc3e3('0x2d')]===_0x382403['linkedid']){if(!_[_0xc3e3('0x31')](this[_0xc3e3('0x14')][_0x382403['uniqueid']])){_[_0xc3e3('0x32')](this[_0xc3e3('0x14')][_0x382403[_0xc3e3('0x2d')]],_['pick'](_0x382403,_[_0xc3e3('0x33')](this[_0xc3e3('0x14')][_0x382403['uniqueid']])));}}if(_0x382403['context']===_0xc3e3('0x34')){if(this[_0xc3e3('0x15')][_0x382403[_0xc3e3('0x35')]['split']('-')[0x0]]){if(_0x382403[_0xc3e3('0x36')]==_0xc3e3('0x37')){this['agents'][_0x382403[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]]['destconnectedlinenum']=_0x382403[_0xc3e3('0x39')];this['emit'](util[_0xc3e3('0x3a')](_0xc3e3('0x3b'),this[_0xc3e3('0x15')][_0x382403[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3c')]),_0xc3e3('0x3d'),{'destaccountcode':this[_0xc3e3('0x15')][_0x382403[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3e')],'destconnectedlinenum':_0x382403[_0xc3e3('0x39')]});}}}}}catch(_0x59c97b){logger[_0xc3e3('0x28')](_0xc3e3('0x3f'),_0x382403['uniqueid'],util[_0xc3e3('0x30')](_0x59c97b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc3e3('0x2a')][_0xc3e3('0x40')]=function(_0x5654af){try{if(this[_0xc3e3('0x2b')](_0x5654af)){logger[_0xc3e3('0x41')](_0xc3e3('0x42'),_0x5654af['uniqueid'],util[_0xc3e3('0x30')](_0x5654af,{'showHidden':![],'depth':null}));if(this['channels'][_0x5654af['uniqueid']])return;if(_0x5654af[_0xc3e3('0x35')]===_0xc3e3('0x43'))return;if(_0x5654af['uniqueid']!==_0x5654af['linkedid']&&!this[_0xc3e3('0x16')][_0x5654af['linkedid']])return;logger['info']('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x5654af[_0xc3e3('0x2d')],_0x5654af[_0xc3e3('0x44')],_0x5654af[_0xc3e3('0x36')]);this[_0xc3e3('0x14')][_0x5654af[_0xc3e3('0x2d')]]=new Channel();this['channels'][_0x5654af[_0xc3e3('0x2d')]][_0xc3e3('0x45')]=moment()[_0xc3e3('0x3a')](_0xc3e3('0x46'));this[_0xc3e3('0x14')][_0x5654af[_0xc3e3('0x2d')]][_0xc3e3('0x47')]=dispositions[_[_0xc3e3('0x48')](_0x5654af['channelstate'])];_[_0xc3e3('0x32')](this['channels'][_0x5654af['uniqueid']],_[_0xc3e3('0x49')](_0x5654af,_['keys'](this['channels'][_0x5654af[_0xc3e3('0x2d')]])));if(_0x5654af[_0xc3e3('0x44')]==='from-sip'){if(this[_0xc3e3('0x15')][_0x5654af[_0xc3e3('0x35')]['split']('-')[0x0]]){if(_[_0xc3e3('0x31')](this[_0xc3e3('0x15')][_0x5654af['channel']['split']('-')[0x0]][_0xc3e3('0x4a')])){this['agents'][_0x5654af[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x4a')]=_0x5654af['exten'];logger[_0xc3e3('0x41')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x5654af[_0xc3e3('0x2d')],util[_0xc3e3('0x30')]({'id':this[_0xc3e3('0x15')][_0x5654af['channel'][_0xc3e3('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xc3e3('0x15')][_0x5654af[_0xc3e3('0x35')]['split']('-')[0x0]][_0xc3e3('0x3e')],'destconnectedlinenum':_0x5654af[_0xc3e3('0x36')]},{'showHidden':![],'depth':null}));this[_0xc3e3('0x2c')](util[_0xc3e3('0x3a')](_0xc3e3('0x3b'),this[_0xc3e3('0x15')][_0x5654af[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3c')]),_0xc3e3('0x3d'),{'id':this[_0xc3e3('0x15')][_0x5654af['channel']['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x5654af['channel'][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3e')],'destconnectedlinenum':_0x5654af[_0xc3e3('0x36')]});}}}}}catch(_0x1adb4b){logger[_0xc3e3('0x28')](_0xc3e3('0x4b'),_0x5654af['uniqueid'],util['inspect'](_0x1adb4b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc3e3('0x17')]=function(_0x2d6fe2){try{if(this['isNotNull'](_0x2d6fe2)){logger[_0xc3e3('0x41')](_0xc3e3('0x4c'),_0x2d6fe2['uniqueid'],util[_0xc3e3('0x30')](_0x2d6fe2,{'showHidden':![],'depth':null}));if(_0x2d6fe2['channel']===_0xc3e3('0x43')||_0x2d6fe2[_0xc3e3('0x36')]==='h')return;if(_0x2d6fe2[_0xc3e3('0x2d')]===_0x2d6fe2[_0xc3e3('0x4d')]||this[_0xc3e3('0x16')][_0x2d6fe2[_0xc3e3('0x4d')]]){_0x2d6fe2[_0xc3e3('0x4e')]=_0x2d6fe2[_0xc3e3('0x4e')][_0xc3e3('0x4f')]();_0x2d6fe2['applicationdata']=_0x2d6fe2[_0xc3e3('0x50')]||_0x2d6fe2[_0xc3e3('0x51')];if(_0x2d6fe2[_0xc3e3('0x50')]&&!_0x2d6fe2['appdata'][_0xc3e3('0x52')](_0xc3e3('0x53'))&&_0x2d6fe2[_0xc3e3('0x4e')]!==_0xc3e3('0x9')){_0x2d6fe2[_0xc3e3('0x51')]=_0x2d6fe2[_0xc3e3('0x51')][_0xc3e3('0x4f')]();}logger[_0xc3e3('0x25')](_0xc3e3('0x54'),_0x2d6fe2['uniqueid'],_0x2d6fe2[_0xc3e3('0x4e')],_0x2d6fe2[_0xc3e3('0x51')]);if(_[_0xc3e3('0x31')](this['channels'][_0x2d6fe2[_0xc3e3('0x2d')]])){this[_0xc3e3('0x14')][_0x2d6fe2['uniqueid']]=new Channel();this[_0xc3e3('0x14')][_0x2d6fe2['uniqueid']][_0xc3e3('0x45')]=_0x2d6fe2[_0xc3e3('0x55')]?moment()['subtract'](moment[_0xc3e3('0x55')](_0x2d6fe2[_0xc3e3('0x55')])[_0xc3e3('0x56')](),_0xc3e3('0x56'))[_0xc3e3('0x3a')](_0xc3e3('0x46')):moment()[_0xc3e3('0x3a')](_0xc3e3('0x46'));this[_0xc3e3('0x14')][_0x2d6fe2['uniqueid']][_0xc3e3('0x47')]='NO\x20ANSWER';}_[_0xc3e3('0x32')](this[_0xc3e3('0x14')][_0x2d6fe2[_0xc3e3('0x2d')]],_[_0xc3e3('0x49')](_0x2d6fe2,_[_0xc3e3('0x33')](this['channels'][_0x2d6fe2[_0xc3e3('0x2d')]])));if(_[_0xc3e3('0x57')](applications,_0x2d6fe2['application'])){this[_0xc3e3('0x14')][_0x2d6fe2[_0xc3e3('0x2d')]]['lastapplication']=_0x2d6fe2[_0xc3e3('0x4e')];this[_0xc3e3('0x14')][_0x2d6fe2[_0xc3e3('0x2d')]][_0xc3e3('0x58')]=_0x2d6fe2[_0xc3e3('0x51')];if(_0x2d6fe2['application']===_0xc3e3('0x8')&&_[_0xc3e3('0x52')](_0x2d6fe2[_0xc3e3('0x51')][_0xc3e3('0x4f')](),_0xc3e3('0x59'))){var _0x1b6590=_0x2d6fe2['applicationdata'][_0xc3e3('0x38')]('=');var _0x470b43=_0x1b6590[0x0][_0xc3e3('0x4f')]()[_0xc3e3('0x5a')](/cdr\((.*)\)/);if(_0x470b43){if(_0x470b43[0x1]===_0xc3e3('0x5b')&&!_[_0xc3e3('0x5c')](this[_0xc3e3('0x14')][_0x2d6fe2[_0xc3e3('0x2d')]][_0x470b43[0x1]]))return;this['channels'][_0x2d6fe2[_0xc3e3('0x2d')]][_0x470b43[0x1]]=_0x1b6590[0x1];}}else if(_0x2d6fe2[_0xc3e3('0x4e')]===_0xc3e3('0x9')){this[_0xc3e3('0x14')][_0x2d6fe2[_0xc3e3('0x2d')]][_0xc3e3('0x9')]=_0x2d6fe2[_0xc3e3('0x51')][_0xc3e3('0x38')](',')[0x0];}}}}}catch(_0x5eecb5){logger['error'](_0xc3e3('0x5d'),_0x2d6fe2[_0xc3e3('0x2d')],util['inspect'](_0x5eecb5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc3e3('0x2a')]['syncNewState']=function(_0x227611){try{if(this[_0xc3e3('0x2b')](_0x227611)){logger[_0xc3e3('0x25')](_0xc3e3('0x5e'),_0x227611[_0xc3e3('0x2d')],_0x227611['linkedid'],_0x227611[_0xc3e3('0x2e')],_0x227611['calleridnum']);logger[_0xc3e3('0x41')](_0xc3e3('0x5f'),_0x227611['uniqueid'],util['inspect'](_0x227611,{'showHidden':![],'depth':null}));if(_0x227611['channelstate']!=='6')return;if(_0x227611[_0xc3e3('0x2d')]!==_0x227611['linkedid']){var _0x40b6e4=moment();if(this[_0xc3e3('0x14')][_0x227611['linkedid']]){if(!this[_0xc3e3('0x14')][_0x227611['linkedid']][_0xc3e3('0x60')]){this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x4d')]]['answered']=!![];this[_0xc3e3('0x14')][_0x227611['linkedid']]['answertime']=_0x40b6e4['format'](_0xc3e3('0x46'));if(this[_0xc3e3('0x14')][_0x227611['linkedid']][_0xc3e3('0x45')]){this['channels'][_0x227611[_0xc3e3('0x4d')]]['holdtime']=_0x40b6e4[_0xc3e3('0x61')](this['channels'][_0x227611[_0xc3e3('0x4d')]][_0xc3e3('0x45')],_0xc3e3('0x56'));}}this['channels'][_0x227611[_0xc3e3('0x4d')]][_0xc3e3('0x4d')]=_0x227611[_0xc3e3('0x2d')];if(_0x227611[_0xc3e3('0x62')]!=='xcally-motion-preview'){this[_0xc3e3('0x14')][_0x227611['linkedid']][_0xc3e3('0x39')]=_0x227611[_0xc3e3('0x62')];}this[_0xc3e3('0x14')][_0x227611['linkedid']][_0xc3e3('0x63')]=_0x227611[_0xc3e3('0x2e')];this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x4d')]]['destinationchannel']=_0x227611[_0xc3e3('0x35')];this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x4d')]]['disposition']=dispositions[_[_0xc3e3('0x48')](_0x227611['channelstate'])];if(this['agents'][_0x227611[_0xc3e3('0x35')]['split']('-')[0x0]]){this['channels'][_0x227611[_0xc3e3('0x4d')]]['UserId']=this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]]['id'];this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x4d')]][_0xc3e3('0x64')]=this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3c')];}}if(this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x2d')]]){if(!this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x2d')]][_0xc3e3('0x60')]){this[_0xc3e3('0x14')][_0x227611['uniqueid']][_0xc3e3('0x60')]=!![];this['channels'][_0x227611['uniqueid']][_0xc3e3('0x65')]=_0x40b6e4['format'](_0xc3e3('0x46'));if(this['channels'][_0x227611['uniqueid']]['starttime']){this['channels'][_0x227611[_0xc3e3('0x2d')]][_0xc3e3('0x66')]=_0x40b6e4[_0xc3e3('0x61')](this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x2d')]][_0xc3e3('0x45')],_0xc3e3('0x56'));}}if(_0x227611[_0xc3e3('0x62')]!==_0xc3e3('0x37')){this[_0xc3e3('0x14')][_0x227611['uniqueid']][_0xc3e3('0x39')]=_0x227611[_0xc3e3('0x62')];}this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x2d')]]['connectedlinename']=_0x227611['calleridname'];this['channels'][_0x227611[_0xc3e3('0x2d')]]['destinationchannel']=_0x227611[_0xc3e3('0x35')];this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x2d')]][_0xc3e3('0x47')]=dispositions[_[_0xc3e3('0x48')](_0x227611[_0xc3e3('0x67')])];}}else{if(this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x2d')]]){if(this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')]['split']('-')[0x0]]){this[_0xc3e3('0x14')][_0x227611['uniqueid']][_0xc3e3('0x68')]=this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')]['split']('-')[0x0]]['id'];this['channels'][_0x227611[_0xc3e3('0x2d')]]['membername']=this['agents'][_0x227611['channel']['split']('-')[0x0]][_0xc3e3('0x3c')];}}}if(_0x227611[_0xc3e3('0x44')]==='from-sip'){if(this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]]){this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]]['destconnectedlinenum']=_0x227611[_0xc3e3('0x36')];var _0x51d680,_0x20ad44;if(this['channels'][_0x227611[_0xc3e3('0x2d')]]){_0x51d680=this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x2d')]][_0xc3e3('0x69')];_0x20ad44=this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x2d')]][_0xc3e3('0x9')];}else if(this['channels'][_0x227611[_0xc3e3('0x4d')]]){_0x51d680=this[_0xc3e3('0x14')][_0x227611[_0xc3e3('0x4d')]][_0xc3e3('0x69')];_0x20ad44=this[_0xc3e3('0x14')][_0x227611['linkedid']][_0xc3e3('0x9')];}this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x9')]=_0x20ad44;this[_0xc3e3('0x15')][_0x227611['channel']['split']('-')[0x0]]['routealias']=_0x51d680;logger['debug'](_0xc3e3('0x6a'),_0x227611[_0xc3e3('0x2d')],util[_0xc3e3('0x30')]({'id':this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xc3e3('0x15')][_0x227611['channel'][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3e')],'destconnectedlinenum':_0x227611[_0xc3e3('0x36')],'routealias':_0x51d680,'queue':_0x20ad44||undefined},{'showHidden':![],'depth':null}));this[_0xc3e3('0x2c')](util[_0xc3e3('0x3a')](_0xc3e3('0x3b'),this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3c')]),'user:agentconnect',{'id':this['agents'][_0x227611[_0xc3e3('0x35')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xc3e3('0x15')][_0x227611[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3e')],'destconnectedlinenum':_0x227611[_0xc3e3('0x36')],'routealias':_0x51d680,'queue':_0x20ad44||undefined});}}}}catch(_0x4a78c9){logger[_0xc3e3('0x28')](_0xc3e3('0x6b'),_0x227611[_0xc3e3('0x2d')],util[_0xc3e3('0x30')](_0x4a78c9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc3e3('0x2a')][_0xc3e3('0x6c')]=function(_0x5300fa,_0x57deb6){try{if(this[_0xc3e3('0x14')][_0x5300fa]){logger[_0xc3e3('0x25')](_0xc3e3('0x6d'),_0x5300fa,_0x57deb6);this[_0xc3e3('0x14')][_0x5300fa][_0xc3e3('0x6e')]=!![];if(_[_0xc3e3('0x6f')](_0x57deb6,_0xc3e3('0x70'))){_0x57deb6=_0x57deb6[_0xc3e3('0x71')]('.wav49',_0xc3e3('0x72'));}this['channels'][_0x5300fa][_0xc3e3('0x73')]=_0x57deb6;var _0x2b1e4b=_['find'](this['channels'][_0x5300fa][_0xc3e3('0x74')],{'filename':_0x57deb6});if(_[_0xc3e3('0x5c')](_0x2b1e4b)){this[_0xc3e3('0x14')][_0x5300fa][_0xc3e3('0x74')][_0xc3e3('0x75')]({'filename':_0x57deb6,'createdAt':moment()[_0xc3e3('0x3a')](_0xc3e3('0x46')),'mixmonitorid':'','status':_0xc3e3('0x76')});}}}catch(_0x3dec1d){logger[_0xc3e3('0x28')](_0xc3e3('0x77'),_0x5300fa,util[_0xc3e3('0x30')](_0x3dec1d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc3e3('0x2a')][_0xc3e3('0x1e')]=function(_0x3a468c){try{if(this[_0xc3e3('0x2b')](_0x3a468c)){logger[_0xc3e3('0x41')]('[%s][voiceCallReport][varset]\x20event:',_0x3a468c[_0xc3e3('0x2d')],util[_0xc3e3('0x30')](_0x3a468c,{'showHidden':![],'depth':null}));if(this[_0xc3e3('0x14')][_0x3a468c['uniqueid']]&&_0x3a468c['channel']!=_0xc3e3('0x43')){if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')])){if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x79')])){logger[_0xc3e3('0x25')](_0xc3e3('0x7a'),_0x3a468c['uniqueid'],_0x3a468c[_0xc3e3('0x7b')]);this[_0xc3e3('0x6c')](_0x3a468c[_0xc3e3('0x2d')],_0x3a468c[_0xc3e3('0x7b')]);}else if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x7c')])){logger[_0xc3e3('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x3a468c[_0xc3e3('0x2d')],_0x3a468c[_0xc3e3('0x7b')]);this['channels'][_0x3a468c[_0xc3e3('0x2d')]][_0xc3e3('0x62')]=_0x3a468c[_0xc3e3('0x7b')];}else if(this['isNotNull'](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x7d')])){logger['info'](_0xc3e3('0x7e'),_0x3a468c['uniqueid'],_0x3a468c[_0xc3e3('0x7b')]);this['channels'][_0x3a468c[_0xc3e3('0x2d')]][_0xc3e3('0x7f')]=_0x3a468c[_0xc3e3('0x7b')];}else if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x80')])){logger[_0xc3e3('0x25')](_0xc3e3('0x81'),_0x3a468c[_0xc3e3('0x2d')],_0x3a468c[_0xc3e3('0x7b')]);this[_0xc3e3('0x14')][_0x3a468c[_0xc3e3('0x2d')]][_0xc3e3('0x5b')]=_0x3a468c[_0xc3e3('0x7b')];}else if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')]['xmd-queue'])){logger[_0xc3e3('0x25')](_0xc3e3('0x82'),_0x3a468c['uniqueid'],_0x3a468c[_0xc3e3('0x7b')][_0xc3e3('0x38')](',')[0x0]);this[_0xc3e3('0x14')][_0x3a468c[_0xc3e3('0x2d')]][_0xc3e3('0x9')]=_0x3a468c['value'][_0xc3e3('0x38')](',')[0x0];}else if(this['isNotNull'](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x83')])){logger[_0xc3e3('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3a468c[_0xc3e3('0x2d')],_0x3a468c[_0xc3e3('0x7b')]);this[_0xc3e3('0x14')][_0x3a468c['uniqueid']][_0xc3e3('0x84')]=_0x3a468c[_0xc3e3('0x7b')];}else if(this['isNotNull'](_0x3a468c[_0xc3e3('0x78')]['xmd-destination'])){logger[_0xc3e3('0x25')](_0xc3e3('0x85'),_0x3a468c[_0xc3e3('0x2d')],_0x3a468c['value']);this[_0xc3e3('0x14')][_0x3a468c['uniqueid']][_0xc3e3('0x86')]=_0x3a468c[_0xc3e3('0x7b')];}else if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x87')])){logger['info'](_0xc3e3('0x88'),_0x3a468c[_0xc3e3('0x2d')],_0x3a468c[_0xc3e3('0x7b')]);this[_0xc3e3('0x14')][_0x3a468c['uniqueid']]['calleridpreview']=_0x3a468c[_0xc3e3('0x7b')];}else if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')]['xmcs-queue'])){logger[_0xc3e3('0x25')](_0xc3e3('0x89'),_0x3a468c[_0xc3e3('0x2d')],_0x3a468c[_0xc3e3('0x7b')]);this[_0xc3e3('0x14')][_0x3a468c[_0xc3e3('0x2d')]][_0xc3e3('0x9')]=_0x3a468c[_0xc3e3('0x7b')];}else if(this['isNotNull'](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x8a')])){logger[_0xc3e3('0x25')](_0xc3e3('0x8b'),_0x3a468c[_0xc3e3('0x2d')],_0x3a468c[_0xc3e3('0x7b')]);this['channels'][_0x3a468c[_0xc3e3('0x2d')]][_0xc3e3('0x8c')]=_0x3a468c[_0xc3e3('0x7b')];}}}else if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x79')])){if(_0x3a468c[_0xc3e3('0x7b')]){var _0x99785=path['parse'](_0x3a468c['value'])[_0xc3e3('0x3c')];logger[_0xc3e3('0x25')](_0xc3e3('0x7a'),_0x99785,_0x3a468c[_0xc3e3('0x7b')]);this[_0xc3e3('0x6c')](_0x99785,_0x3a468c[_0xc3e3('0x7b')]);}}else if(this['channels'][_0x3a468c[_0xc3e3('0x4d')]]){if(this[_0xc3e3('0x2b')](_0x3a468c['variable'])){if(this[_0xc3e3('0x2b')](_0x3a468c[_0xc3e3('0x78')][_0xc3e3('0x8a')])){logger[_0xc3e3('0x25')](_0xc3e3('0x8b'),_0x3a468c['linkedid'],_0x3a468c[_0xc3e3('0x7b')]);this[_0xc3e3('0x14')][_0x3a468c['linkedid']][_0xc3e3('0x8d')]=_0x3a468c[_0xc3e3('0x7b')];}}}}}catch(_0x3e9393){logger[_0xc3e3('0x28')](_0xc3e3('0x8e'),_0x3a468c[_0xc3e3('0x2d')],util[_0xc3e3('0x30')](_0x3e9393,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc3e3('0x2a')][_0xc3e3('0x1f')]=function(_0x561c53){try{if(this['isNotNull'](_0x561c53)){logger[_0xc3e3('0x41')](_0xc3e3('0x8f'),_0x561c53[_0xc3e3('0x2d')],util['inspect'](_0x561c53,{'showHidden':![],'depth':null}));if(this[_0xc3e3('0x16')][_0x561c53['linkedid']]){if(this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x4d')]]){this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x4d')]][_0xc3e3('0x2d')]=_0x561c53[_0xc3e3('0x2d')];this['channels'][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]]['linkedid']][_0xc3e3('0x60')]=this[_0xc3e3('0x14')][_0x561c53['uniqueid']]['answered'];this['channels'][this['blindTransfers'][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x4d')]][_0xc3e3('0x65')]=this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]]['answertime'];this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x4d')]][_0xc3e3('0x90')]=this['channels'][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x4d')]][_0xc3e3('0x35')];this[_0xc3e3('0x14')][this['blindTransfers'][_0x561c53[_0xc3e3('0x4d')]]['linkedid']][_0xc3e3('0x47')]=this['channels'][_0x561c53['uniqueid']]['disposition'];this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]]=this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x4d')]];delete this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53['linkedid']]['linkedid']];}else if(this['channels'][this['blindTransfers'][_0x561c53['linkedid']]['uniqueid']]){this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]]['uniqueid']]['uniqueid']=[this[_0xc3e3('0x14')][this['blindTransfers'][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x2d')]][_0xc3e3('0x4d')],this[_0xc3e3('0x14')][this['blindTransfers'][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x2d')]][_0xc3e3('0x4d')]=this[_0xc3e3('0x14')][this['blindTransfers'][_0x561c53['linkedid']][_0xc3e3('0x2d')]][_0xc3e3('0x2d')]][0x0];this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x2d')]][_0xc3e3('0x60')]=this['channels'][_0x561c53[_0xc3e3('0x2d')]][_0xc3e3('0x60')];this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x2d')]][_0xc3e3('0x65')]=this[_0xc3e3('0x14')][_0x561c53['uniqueid']][_0xc3e3('0x65')];this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53['linkedid']][_0xc3e3('0x2d')]]['destinationchannel']=this[_0xc3e3('0x14')][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x2d')]][_0xc3e3('0x35')];this[_0xc3e3('0x14')][this['blindTransfers'][_0x561c53['linkedid']]['uniqueid']][_0xc3e3('0x47')]=this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]]['disposition'];this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]]=this['channels'][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]][_0xc3e3('0x2d')]];delete this['channels'][this[_0xc3e3('0x16')][_0x561c53[_0xc3e3('0x4d')]]['uniqueid']];}}if(this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]]){logger[_0xc3e3('0x25')](_0xc3e3('0x91'),_0x561c53[_0xc3e3('0x2d')],_0x561c53[_0xc3e3('0x92')]);var _0x3fef87=moment();this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]][_0xc3e3('0x93')]=_0x3fef87[_0xc3e3('0x3a')](_0xc3e3('0x46'));this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]][_0xc3e3('0x55')]=_0x3fef87['diff'](this['channels'][_0x561c53['uniqueid']][_0xc3e3('0x45')],_0xc3e3('0x56'));if(this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]][_0xc3e3('0x60')]){this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]]['billableseconds']=_0x3fef87[_0xc3e3('0x61')](this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]]['answertime'],'seconds');this[_0xc3e3('0x14')][_0x561c53[_0xc3e3('0x2d')]][_0xc3e3('0x66')]=this[_0xc3e3('0x14')][_0x561c53['uniqueid']][_0xc3e3('0x55')]-this['channels'][_0x561c53[_0xc3e3('0x2d')]][_0xc3e3('0x94')];}if(_0x561c53[_0xc3e3('0x44')]==='from-sip'){if(this[_0xc3e3('0x15')][_0x561c53[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]]){this[_0xc3e3('0x15')][_0x561c53[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]]=_[_0xc3e3('0x95')](this[_0xc3e3('0x15')][_0x561c53[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]],[_0xc3e3('0x4a')]);logger['debug'](_0xc3e3('0x96'),_0x561c53[_0xc3e3('0x2d')],util['inspect']({'id':this[_0xc3e3('0x15')][_0x561c53['channel'][_0xc3e3('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xc3e3('0x15')][_0x561c53['channel'][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3e')]},{'showHidden':![],'depth':null}));this[_0xc3e3('0x2c')](util[_0xc3e3('0x3a')]('user:%s',this[_0xc3e3('0x15')][_0x561c53[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3c')]),_0xc3e3('0x97'),{'id':this['agents'][_0x561c53[_0xc3e3('0x35')][_0xc3e3('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xc3e3('0x15')][_0x561c53['channel'][_0xc3e3('0x38')]('-')[0x0]][_0xc3e3('0x3e')]});for(var _0x263ced=0x0;_0x263ced0x0?_0x18ff90:0x0;this[_0x131b('0x16')][_0x319739[_0x131b('0x69')]][_0x131b('0x36')]=this[_0x131b('0x16')][_0x319739[_0x131b('0x69')]][_0x131b('0x36')]>_[_0x131b('0x6e')](_0x319739['loggedin'])?_[_0x131b('0x6e')](_0x319739[_0x131b('0x6f')]):this[_0x131b('0x16')][_0x319739[_0x131b('0x69')]][_0x131b('0x36')];this['emitVoiceQueueSummary'](this[_0x131b('0x16')][_0x319739[_0x131b('0x69')]],_0x131b('0x19'));}logger['debug'](_0x131b('0x70'),util['inspect'](this[_0x131b('0x16')][_0x319739[_0x131b('0x69')]],{'showHidden':![],'depth':null}));ami[_0x131b('0x4a')]('custom:queuesummary',this[_0x131b('0x16')][_0x319739['queue']]);}}}catch(_0x39bf45){logger[_0x131b('0x44')]('[voiceQueueReport][queuesummary]',util[_0x131b('0x43')](_0x39bf45,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x131b('0xe')][_0x131b('0x1d')]=function(_0x16547b){logger[_0x131b('0x4b')](_0x131b('0x71'),util[_0x131b('0x43')](_0x16547b,{'showHidden':![],'depth':null}));ami[_0x131b('0x4a')](_0x131b('0x72'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0x131b('0xe')][_0x131b('0x73')]=function(_0x1dbb0c){try{if(this[_0x131b('0x64')](_0x1dbb0c)){logger[_0x131b('0x4b')](_0x131b('0x74'),_0x1dbb0c['uniqueid'],util[_0x131b('0x43')](_0x1dbb0c,{'showHidden':![],'depth':null}));if(_[_0x131b('0x65')](this[_0x131b('0x13')][_0x1dbb0c[_0x131b('0x4e')]]))this[_0x131b('0x13')][_0x1dbb0c[_0x131b('0x4e')]]=[];if(_[_0x131b('0x65')](this[_0x131b('0x3a')][_0x1dbb0c[_0x131b('0x4e')]]))this[_0x131b('0x3a')][_0x1dbb0c[_0x131b('0x4e')]]={};var _0x5e4bb3=new QueueReport();_0x5e4bb3['name']=_0x1dbb0c[_0x131b('0x69')];_0x5e4bb3[_0x131b('0x55')]=this[_0x131b('0x16')][_0x5e4bb3[_0x131b('0x51')]]&&this[_0x131b('0x16')][_0x5e4bb3[_0x131b('0x51')]][_0x131b('0x55')]?this[_0x131b('0x16')][_0x5e4bb3[_0x131b('0x51')]][_0x131b('0x55')]||_0x131b('0x56'):_0x131b('0x56');_0x5e4bb3[_0x131b('0x69')]=_0x1dbb0c[_0x131b('0x69')];_0x5e4bb3[_0x131b('0x75')]=moment()[_0x131b('0x4f')](_0x131b('0x76'));_0x5e4bb3['position']=_0x1dbb0c[_0x131b('0x77')];_0x5e4bb3[_0x131b('0x78')]=_0x1dbb0c[_0x131b('0x78')];_0x5e4bb3[_0x131b('0x4e')]=_0x1dbb0c['uniqueid'];_0x5e4bb3[_0x131b('0x79')]=this[_0x131b('0x3a')][_0x1dbb0c[_0x131b('0x4e')]][_0x131b('0x79')];logger[_0x131b('0x6b')](_0x131b('0x7a'),_0x5e4bb3[_0x131b('0x51')],_0x5e4bb3[_0x131b('0x55')]);_[_0x131b('0x7b')](_0x5e4bb3,_[_0x131b('0x7c')](_0x1dbb0c,_[_0x131b('0x7d')](_0x5e4bb3)));this[_0x131b('0x13')][_0x1dbb0c['uniqueid']][_0x131b('0x7e')](_0x5e4bb3);this['channels'][_0x1dbb0c['uniqueid']]=_0x5e4bb3;this[_0x131b('0x7f')](_0x5e4bb3,_0x131b('0x1e'));}}catch(_0x463084){logger[_0x131b('0x44')](_0x131b('0x74'),_0x1dbb0c[_0x131b('0x4e')],util[_0x131b('0x43')](_0x463084,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x131b('0xe')]['syncQueueCallerAbandon']=function(_0x547fee){try{if(this['isNotNull'](_0x547fee)){logger[_0x131b('0x4b')](_0x131b('0x80'),_0x547fee[_0x131b('0x4e')],util[_0x131b('0x43')](_0x547fee,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x547fee[_0x131b('0x4e')]]){var _0x53d184=_[_0x131b('0x81')](this[_0x131b('0x13')][_0x547fee['uniqueid']]);_0x53d184[_0x131b('0x82')]=![];_0x53d184[_0x131b('0x83')]=null;_0x53d184[_0x131b('0x84')]=_0x547fee[_0x131b('0x84')];_0x53d184[_0x131b('0x85')]=_0x547fee[_0x131b('0x85')];_0x53d184['queuecallerabandon']=!![];_0x53d184[_0x131b('0x86')]=moment()[_0x131b('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x53d184[_0x131b('0x87')]=_0x131b('0x88');_0x53d184[_0x131b('0x89')]=null;logger[_0x131b('0x6b')](_0x131b('0x8a'),_0x53d184['name'],_0x53d184['type']);this[_0x131b('0x3a')][_0x547fee[_0x131b('0x4e')]]=_0x53d184;this[_0x131b('0x8b')](_0x53d184,_0x131b('0x1f'));}}}catch(_0x1df339){logger[_0x131b('0x44')]('[%s][voiceQueueReport][queuecallerabandon]',_0x547fee[_0x131b('0x4e')],util[_0x131b('0x43')](_0x1df339,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x131b('0xe')][_0x131b('0x22')]=function(_0x5b33cb){try{if(this[_0x131b('0x64')](_0x5b33cb)){logger['debug'](_0x131b('0x8c'),_0x5b33cb[_0x131b('0x4e')],util[_0x131b('0x43')](_0x5b33cb,{'showHidden':![],'depth':null}));if(this[_0x131b('0x13')][_0x5b33cb['uniqueid']]){var _0x1fdc16=_[_0x131b('0x81')](this[_0x131b('0x13')][_0x5b33cb[_0x131b('0x4e')]]);_0x1fdc16[_0x131b('0x8d')]=moment()[_0x131b('0x4f')](_0x131b('0x76'));_0x1fdc16[_0x131b('0x8e')]=_0x5b33cb[_0x131b('0x8e')];_0x1fdc16[_0x131b('0x8f')]=_0x5b33cb['connectedlinename'];logger['info'](_0x131b('0x90'),_0x1fdc16[_0x131b('0x51')],_0x1fdc16[_0x131b('0x55')],_0x5b33cb[_0x131b('0x8e')],_0x5b33cb['connectedlinename']);this[_0x131b('0x3a')][_0x5b33cb['uniqueid']]=_0x1fdc16;this[_0x131b('0x7f')](_0x1fdc16,_0x131b('0x21'));}}}catch(_0xe3511f){logger[_0x131b('0x44')](_0x131b('0x8c'),_0x5b33cb[_0x131b('0x4e')],util['inspect'](_0xe3511f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x131b('0xe')][_0x131b('0x91')]=function(_0x5a7b64){try{if(this[_0x131b('0x64')](_0x5a7b64)){logger[_0x131b('0x4b')](_0x131b('0x92'),_0x5a7b64[_0x131b('0x4e')],util[_0x131b('0x43')](_0x5a7b64,{'showHidden':![],'depth':null}));if(this[_0x131b('0x13')][_0x5a7b64[_0x131b('0x4e')]]){var _0x4903ed=_[_0x131b('0x81')](this['queueReports'][_0x5a7b64['uniqueid']]);_0x4903ed[_0x131b('0x82')]=!![];_0x4903ed[_0x131b('0x87')]=_0x131b('0x93');logger['info'](_0x131b('0x94'),_0x4903ed['name'],_0x4903ed[_0x131b('0x55')]);}}}catch(_0x1df2fe){logger[_0x131b('0x44')](_0x131b('0x92'),_0x5a7b64[_0x131b('0x4e')],util[_0x131b('0x43')](_0x1df2fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x131b('0x24')]=function(_0x50b5d0){try{if(this['isNotNull'](_0x50b5d0)){logger['debug'](_0x131b('0x95'),_0x50b5d0[_0x131b('0x4e')],util[_0x131b('0x43')](_0x50b5d0,{'showHidden':![],'depth':null}));if(this[_0x131b('0x13')][_0x50b5d0['uniqueid']]){var _0x48a4af=_[_0x131b('0x81')](this[_0x131b('0x13')][_0x50b5d0[_0x131b('0x4e')]]);_0x48a4af[_0x131b('0x1f')]=![];_0x48a4af[_0x131b('0x86')]=null;_0x48a4af[_0x131b('0x96')]=!![];_0x48a4af[_0x131b('0x89')]=_0x50b5d0[_0x131b('0x97')];_0x48a4af[_0x131b('0x84')]=_0x50b5d0[_0x131b('0x84')];_0x48a4af[_0x131b('0x82')]=!![];_0x48a4af[_0x131b('0x98')]=![];_0x48a4af[_0x131b('0x99')]=null;if(!_0x48a4af['transfer']){if(_0x50b5d0[_0x131b('0x9a')]==_0x131b('0x9b')){_0x48a4af[_0x131b('0x87')]=_0x131b('0x9c');logger[_0x131b('0x6b')](_0x131b('0x9d'),_0x48a4af[_0x131b('0x51')],_0x48a4af['type']);}else{if(_[_0x131b('0x9e')](_0x50b5d0[_0x131b('0x3f')]['toLowerCase'](),_0x131b('0x9f'))){if(this['queueReports'][_0x50b5d0[_0x131b('0xa0')]]){var _0xcc0d53=_['last'](this[_0x131b('0x13')][_0x50b5d0[_0x131b('0xa0')]]);_0xcc0d53[_0x131b('0x82')]=![];_0xcc0d53['queuecallerexit']=!![];_0xcc0d53[_0x131b('0x99')]=moment(_0x48a4af['queuecallerjoinAt'])[_0x131b('0xa1')](_0x50b5d0['holdtime'],_0x131b('0xa2'))[_0x131b('0x4f')](_0x131b('0x76'));_0xcc0d53['queuecallerexitreason']=_0x131b('0xa3');_0xcc0d53[_0x131b('0x9b')]=!![];_0xcc0d53[_0x131b('0xa4')]=_0x131b('0xa5');_0xcc0d53['transferexten']=_0x50b5d0['destexten'];_0xcc0d53[_0x131b('0xa6')]=_0x50b5d0['uniqueid'];logger['info'](_0x131b('0xa7'),_0xcc0d53[_0x131b('0x51')],_0xcc0d53[_0x131b('0x55')]);var _0x3f1659=this[_0x131b('0x13')][_0x50b5d0[_0x131b('0xa0')]];this[_0x131b('0x13')][_0x50b5d0['linkedid']]=this[_0x131b('0x13')][_0x50b5d0[_0x131b('0x4e')]];this[_0x131b('0x13')][_0x50b5d0[_0x131b('0x4e')]]=_0x3f1659;}}else{_0x48a4af[_0x131b('0x87')]=_0x131b('0xa8')+_0x50b5d0[_0x131b('0x9a')][_0x131b('0xa9')]();logger[_0x131b('0x6b')](_0x131b('0xaa'),_0x48a4af['name'],_0x48a4af[_0x131b('0x55')],_0x48a4af[_0x131b('0x87')]);}}}this['channels'][_0x50b5d0[_0x131b('0x4e')]]=_0x48a4af;this[_0x131b('0x8b')](_0x48a4af,_0x131b('0x23'));}}}catch(_0x592e89){logger[_0x131b('0x44')]('[%s][voiceQueueReport][agentcomplete]',_0x50b5d0[_0x131b('0x4e')],util[_0x131b('0x43')](_0x592e89,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x131b('0xe')][_0x131b('0x26')]=function(_0x9f3602){try{if(this['isNotNull'](_0x9f3602)){logger[_0x131b('0x4b')](_0x131b('0xab'),_0x9f3602[_0x131b('0x4e')],util['inspect'](_0x9f3602,{'showHidden':![],'depth':null}));this['addVariable'](_0x9f3602[_0x131b('0x4e')],_['keys'](_0x9f3602['variable'])[0x0],_0x9f3602[_0x131b('0xac')]);if(this[_0x131b('0x13')][_0x9f3602['uniqueid']]){var _0x128673=_['last'](this[_0x131b('0x13')][_0x9f3602[_0x131b('0x4e')]]);if(_0x128673){if(this[_0x131b('0x64')](_0x9f3602[_0x131b('0xad')])&&this[_0x131b('0x64')](_0x9f3602[_0x131b('0xad')]['queuestatus'])){switch(_0x9f3602[_0x131b('0xac')]){case _0x131b('0xae'):_0x128673[_0x131b('0x98')]=![];_0x128673[_0x131b('0x99')]=null;break;case _0x131b('0xaf'):_0x128673[_0x131b('0xb0')]='timeout';_0x128673[_0x131b('0x98')]=!![];_0x128673['queuecallerexitAt']=moment()[_0x131b('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x128673[_0x131b('0x8d')]=moment()[_0x131b('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x131b('0x4b')](_0x131b('0xb1'),_0x9f3602[_0x131b('0x4e')],util[_0x131b('0x43')](_0x128673,{'showHidden':![],'depth':null}));ami[_0x131b('0x4a')](_0x131b('0xb2'),_0x128673);break;default:_0x128673[_0x131b('0x98')]=!![];_0x128673[_0x131b('0x99')]=moment()[_0x131b('0x4f')](_0x131b('0x76'));_0x128673['queuecallerleaveAt']=moment()[_0x131b('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');}_0x128673[_0x131b('0x1f')]=![];_0x128673[_0x131b('0x86')]=null;_0x128673[_0x131b('0x87')]=_0x9f3602['value'];this['channels'][_0x9f3602[_0x131b('0x4e')]]=_0x128673;this[_0x131b('0x8b')](_0x128673,'varset');}else if(this[_0x131b('0x64')](_0x9f3602[_0x131b('0xad')])&&this[_0x131b('0x64')](_0x9f3602[_0x131b('0xad')]['queueposition'])){if(!_0x128673[_0x131b('0x1f')]){_0x128673['queuecallerexit']=!![];_0x128673[_0x131b('0x99')]=moment()[_0x131b('0x4f')](_0x131b('0x76'));_0x128673['queuecallerexitreason']=_0x131b('0xb3');_0x128673[_0x131b('0x8d')]=moment()[_0x131b('0x4f')](_0x131b('0x76'));this[_0x131b('0x3a')][_0x9f3602[_0x131b('0x4e')]]=_0x128673;}}logger[_0x131b('0x6b')](_0x131b('0xb4'),_0x9f3602['uniqueid'],_0x128673[_0x131b('0x51')],_0x128673[_0x131b('0x55')],_[_0x131b('0x7d')](_0x9f3602[_0x131b('0xad')])[0x0],_0x9f3602[_0x131b('0xac')]);_0x128673[_0x131b('0x46')]=this[_0x131b('0x46')][_0x9f3602[_0x131b('0x4e')]];}}}}catch(_0x598960){logger[_0x131b('0x44')](_0x131b('0xab'),_0x9f3602[_0x131b('0x4e')],util[_0x131b('0x43')](_0x598960,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x131b('0xe')]['addVariable']=function(_0x1ee85f,_0x5cdd9a,_0x292156){var _0x5bacc5=[_0x131b('0xb5'),_0x131b('0xb6'),_0x131b('0xb7'),_0x131b('0xb8'),_0x131b('0xb9'),_0x131b('0xba'),_0x131b('0xbb'),_0x131b('0xbc'),_0x131b('0xbd'),_0x131b('0xbe'),_0x131b('0xbf'),_0x131b('0xc0'),_0x131b('0xc1'),_0x131b('0xc2'),_0x131b('0xc3'),_0x131b('0xc4'),'membername',_0x131b('0xc5'),'memberrealtime'];if(!_[_0x131b('0x3c')](_0x5cdd9a)&&!_[_0x131b('0xc6')](_0x5bacc5,_0x5cdd9a)){if(_['isUndefined'](this[_0x131b('0x46')][_0x1ee85f])){this[_0x131b('0x46')][_0x1ee85f]={};}this['variables'][_0x1ee85f][_0x5cdd9a]=_0x292156;}};VoiceQueueReport['prototype'][_0x131b('0xc7')]=function(_0x5c2ba6,_0x3bde0e,_0x2d1ba0){var _0xd01597={};for(var _0x9ac00a=0x0;_0x9ac00a0x0?_0x24cfec:0x0;this[_0x3c8c('0x11')][_0x8cbef6[_0x3c8c('0x63')]][_0x3c8c('0x2e')]=this[_0x3c8c('0x11')][_0x8cbef6['queue']]['talking']>_[_0x3c8c('0x68')](_0x8cbef6[_0x3c8c('0x6a')])?_['toNumber'](_0x8cbef6[_0x3c8c('0x6a')]):this['voiceQueues'][_0x8cbef6[_0x3c8c('0x63')]]['talking'];this[_0x3c8c('0x6b')](this[_0x3c8c('0x11')][_0x8cbef6[_0x3c8c('0x63')]],_0x3c8c('0x6c'));}logger[_0x3c8c('0x43')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this['voiceQueues'][_0x8cbef6[_0x3c8c('0x63')]],{'showHidden':![],'depth':null}));ami[_0x3c8c('0x41')](_0x3c8c('0x6d'),this[_0x3c8c('0x11')][_0x8cbef6[_0x3c8c('0x63')]]);}}}catch(_0x4085da){logger[_0x3c8c('0x3a')](_0x3c8c('0x61'),util[_0x3c8c('0x3c')](_0x4085da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c8c('0x9')][_0x3c8c('0x16')]=function(_0x2ab4c2){logger[_0x3c8c('0x43')](_0x3c8c('0x6e'),util[_0x3c8c('0x3c')](_0x2ab4c2,{'showHidden':![],'depth':null}));ami['emit'](_0x3c8c('0x6f'),{});this[_0x3c8c('0x5f')]=!![];};VoiceQueueReport[_0x3c8c('0x9')][_0x3c8c('0x70')]=function(_0x4f7f14){try{if(this[_0x3c8c('0x62')](_0x4f7f14)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x4f7f14['uniqueid'],util['inspect'](_0x4f7f14,{'showHidden':![],'depth':null}));if(_[_0x3c8c('0x5c')](this['queueReports'][_0x4f7f14['uniqueid']]))this[_0x3c8c('0xd')][_0x4f7f14['uniqueid']]=[];if(_[_0x3c8c('0x5c')](this[_0x3c8c('0xf')][_0x4f7f14[_0x3c8c('0x46')]]))this[_0x3c8c('0xf')][_0x4f7f14[_0x3c8c('0x46')]]={};var _0x2b2987=new QueueReport();_0x2b2987[_0x3c8c('0x49')]=_0x4f7f14[_0x3c8c('0x63')];_0x2b2987['type']=this[_0x3c8c('0x11')][_0x2b2987[_0x3c8c('0x49')]]&&this[_0x3c8c('0x11')][_0x2b2987[_0x3c8c('0x49')]]['type']?this[_0x3c8c('0x11')][_0x2b2987[_0x3c8c('0x49')]][_0x3c8c('0x54')]||_0x3c8c('0x50'):_0x3c8c('0x50');_0x2b2987[_0x3c8c('0x63')]=_0x4f7f14['queue'];_0x2b2987[_0x3c8c('0x71')]=moment()['format'](_0x3c8c('0x72'));_0x2b2987[_0x3c8c('0x73')]=_0x4f7f14['position'];_0x2b2987[_0x3c8c('0x74')]=_0x4f7f14[_0x3c8c('0x74')];_0x2b2987[_0x3c8c('0x46')]=_0x4f7f14['uniqueid'];_0x2b2987[_0x3c8c('0x75')]=this[_0x3c8c('0xf')][_0x4f7f14['uniqueid']][_0x3c8c('0x75')];logger[_0x3c8c('0x76')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2b2987[_0x3c8c('0x49')],_0x2b2987[_0x3c8c('0x54')]);_['merge'](_0x2b2987,_[_0x3c8c('0x77')](_0x4f7f14,_['keys'](_0x2b2987)));this['queueReports'][_0x4f7f14[_0x3c8c('0x46')]]['push'](_0x2b2987);this[_0x3c8c('0xf')][_0x4f7f14[_0x3c8c('0x46')]]=_0x2b2987;this['emitVoiceQueueChannelSave'](_0x2b2987,'queuecallerjoin');}}catch(_0x14f369){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x4f7f14['uniqueid'],util[_0x3c8c('0x3c')](_0x14f369,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c8c('0x9')][_0x3c8c('0x18')]=function(_0x52d003){try{if(this[_0x3c8c('0x62')](_0x52d003)){logger[_0x3c8c('0x43')](_0x3c8c('0x78'),_0x52d003[_0x3c8c('0x46')],util[_0x3c8c('0x3c')](_0x52d003,{'showHidden':![],'depth':null}));if(this[_0x3c8c('0xd')][_0x52d003['uniqueid']]){var _0x6e8a3c=_[_0x3c8c('0x79')](this[_0x3c8c('0xd')][_0x52d003[_0x3c8c('0x46')]]);_0x6e8a3c[_0x3c8c('0x7a')]=![];_0x6e8a3c[_0x3c8c('0x7b')]=null;_0x6e8a3c[_0x3c8c('0x7c')]=_0x52d003[_0x3c8c('0x7c')];_0x6e8a3c['originalposition']=_0x52d003['originalposition'];_0x6e8a3c[_0x3c8c('0x17')]=!![];_0x6e8a3c[_0x3c8c('0x7d')]=moment()[_0x3c8c('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x6e8a3c['queuecallerexitreason']=_0x3c8c('0x7e');_0x6e8a3c[_0x3c8c('0x7f')]=null;logger[_0x3c8c('0x76')](_0x3c8c('0x80'),_0x6e8a3c[_0x3c8c('0x49')],_0x6e8a3c[_0x3c8c('0x54')]);this[_0x3c8c('0xf')][_0x52d003[_0x3c8c('0x46')]]=_0x6e8a3c;this[_0x3c8c('0x4b')](_0x6e8a3c,'queuecallerabandon');}}}catch(_0x242379){logger[_0x3c8c('0x3a')](_0x3c8c('0x78'),_0x52d003[_0x3c8c('0x46')],util[_0x3c8c('0x3c')](_0x242379,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3c8c('0x81')]=function(_0x1f19bc){try{if(this['isNotNull'](_0x1f19bc)){logger[_0x3c8c('0x43')](_0x3c8c('0x82'),_0x1f19bc[_0x3c8c('0x46')],util[_0x3c8c('0x3c')](_0x1f19bc,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1f19bc['uniqueid']]){var _0x3ad9a5=_[_0x3c8c('0x79')](this[_0x3c8c('0xd')][_0x1f19bc[_0x3c8c('0x46')]]);_0x3ad9a5[_0x3c8c('0x83')]=moment()[_0x3c8c('0x47')](_0x3c8c('0x72'));_0x3ad9a5[_0x3c8c('0x84')]=_0x1f19bc[_0x3c8c('0x84')];_0x3ad9a5['connectedlinename']=_0x1f19bc[_0x3c8c('0x85')];logger[_0x3c8c('0x76')](_0x3c8c('0x86'),_0x3ad9a5[_0x3c8c('0x49')],_0x3ad9a5['type'],_0x1f19bc['connectedlinenum'],_0x1f19bc[_0x3c8c('0x85')]);this['channels'][_0x1f19bc[_0x3c8c('0x46')]]=_0x3ad9a5;this['emitVoiceQueueChannelSave'](_0x3ad9a5,'queuecallerleave');}}}catch(_0x377d48){logger['error'](_0x3c8c('0x82'),_0x1f19bc[_0x3c8c('0x46')],util[_0x3c8c('0x3c')](_0x377d48,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c8c('0x9')]['syncAgentConnect']=function(_0x3841d7){try{if(this['isNotNull'](_0x3841d7)){logger[_0x3c8c('0x43')](_0x3c8c('0x87'),_0x3841d7[_0x3c8c('0x46')],util[_0x3c8c('0x3c')](_0x3841d7,{'showHidden':![],'depth':null}));if(this[_0x3c8c('0xd')][_0x3841d7[_0x3c8c('0x46')]]){var _0x17ff2f=_['last'](this[_0x3c8c('0xd')][_0x3841d7[_0x3c8c('0x46')]]);_0x17ff2f[_0x3c8c('0x7a')]=!![];_0x17ff2f[_0x3c8c('0x88')]=_0x3c8c('0x89');logger[_0x3c8c('0x76')](_0x3c8c('0x8a'),_0x17ff2f[_0x3c8c('0x49')],_0x17ff2f[_0x3c8c('0x54')]);}}}catch(_0x13ee85){logger[_0x3c8c('0x3a')](_0x3c8c('0x87'),_0x3841d7[_0x3c8c('0x46')],util['inspect'](_0x13ee85,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c8c('0x9')]['syncAgentComplete']=function(_0x42e82d){try{if(this[_0x3c8c('0x62')](_0x42e82d)){logger[_0x3c8c('0x43')]('[%s][voiceQueueReport][agentcomplete]',_0x42e82d[_0x3c8c('0x46')],util[_0x3c8c('0x3c')](_0x42e82d,{'showHidden':![],'depth':null}));if(this[_0x3c8c('0xd')][_0x42e82d[_0x3c8c('0x46')]]){var _0x5eb2a0=_[_0x3c8c('0x79')](this[_0x3c8c('0xd')][_0x42e82d[_0x3c8c('0x46')]]);_0x5eb2a0[_0x3c8c('0x17')]=![];_0x5eb2a0[_0x3c8c('0x7d')]=null;_0x5eb2a0[_0x3c8c('0x8b')]=!![];_0x5eb2a0[_0x3c8c('0x7f')]=_0x42e82d[_0x3c8c('0x8c')];_0x5eb2a0['holdtime']=_0x42e82d[_0x3c8c('0x7c')];_0x5eb2a0[_0x3c8c('0x7a')]=!![];_0x5eb2a0['queuecallerexit']=![];_0x5eb2a0[_0x3c8c('0x8d')]=null;if(!_0x5eb2a0[_0x3c8c('0x8e')]){if(_0x42e82d[_0x3c8c('0x8f')]=='transfer'){_0x5eb2a0[_0x3c8c('0x88')]=_0x3c8c('0x90');logger[_0x3c8c('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x5eb2a0[_0x3c8c('0x49')],_0x5eb2a0['type']);}else{if(_[_0x3c8c('0x91')](_0x42e82d[_0x3c8c('0x92')][_0x3c8c('0x93')](),_0x3c8c('0x94'))){if(this[_0x3c8c('0xd')][_0x42e82d['linkedid']]){var _0x127537=_[_0x3c8c('0x79')](this[_0x3c8c('0xd')][_0x42e82d[_0x3c8c('0x95')]]);_0x127537['queuecallercomplete']=![];_0x127537[_0x3c8c('0x96')]=!![];_0x127537[_0x3c8c('0x8d')]=moment(_0x5eb2a0['queuecallerjoinAt'])[_0x3c8c('0x97')](_0x42e82d[_0x3c8c('0x7c')],_0x3c8c('0x98'))[_0x3c8c('0x47')](_0x3c8c('0x72'));_0x127537[_0x3c8c('0x88')]='FORWARDTRANSFER';_0x127537[_0x3c8c('0x8e')]=!![];_0x127537['transfertype']=_0x3c8c('0x99');_0x127537[_0x3c8c('0x9a')]=_0x42e82d[_0x3c8c('0x9b')];_0x127537[_0x3c8c('0x9c')]=_0x42e82d[_0x3c8c('0x46')];logger[_0x3c8c('0x76')](_0x3c8c('0x9d'),_0x127537['name'],_0x127537[_0x3c8c('0x54')]);var _0x2f03cb=this[_0x3c8c('0xd')][_0x42e82d['linkedid']];this[_0x3c8c('0xd')][_0x42e82d[_0x3c8c('0x95')]]=this[_0x3c8c('0xd')][_0x42e82d['uniqueid']];this[_0x3c8c('0xd')][_0x42e82d[_0x3c8c('0x46')]]=_0x2f03cb;}}else{_0x5eb2a0[_0x3c8c('0x88')]=_0x3c8c('0x9e')+_0x42e82d[_0x3c8c('0x8f')]['toUpperCase']();logger['info'](_0x3c8c('0x9f'),_0x5eb2a0[_0x3c8c('0x49')],_0x5eb2a0['type'],_0x5eb2a0[_0x3c8c('0x88')]);}}}this['channels'][_0x42e82d[_0x3c8c('0x46')]]=_0x5eb2a0;this[_0x3c8c('0x4b')](_0x5eb2a0,_0x3c8c('0x1a'));}}}catch(_0x4a09f1){logger[_0x3c8c('0x3a')](_0x3c8c('0xa0'),_0x42e82d[_0x3c8c('0x46')],util['inspect'](_0x4a09f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3c8c('0x9')][_0x3c8c('0xa1')]=function(_0x2f2892){try{if(this[_0x3c8c('0x62')](_0x2f2892)){logger[_0x3c8c('0x43')](_0x3c8c('0xa2'),_0x2f2892[_0x3c8c('0x46')],util['inspect'](_0x2f2892,{'showHidden':![],'depth':null}));this[_0x3c8c('0xa3')](_0x2f2892[_0x3c8c('0x46')],_[_0x3c8c('0xa4')](_0x2f2892[_0x3c8c('0xa5')])[0x0],_0x2f2892[_0x3c8c('0xa6')]);if(this['queueReports'][_0x2f2892[_0x3c8c('0x46')]]){var _0x16964b=_['last'](this[_0x3c8c('0xd')][_0x2f2892[_0x3c8c('0x46')]]);if(_0x16964b){if(this[_0x3c8c('0x62')](_0x2f2892[_0x3c8c('0xa5')])&&this['isNotNull'](_0x2f2892[_0x3c8c('0xa5')]['queuestatus'])){switch(_0x2f2892['value']){case _0x3c8c('0xa7'):_0x16964b['queuecallerexit']=![];_0x16964b['queuecallerexitAt']=null;break;case'TIMEOUT':_0x16964b[_0x3c8c('0xa8')]=_0x3c8c('0xa9');_0x16964b[_0x3c8c('0x96')]=!![];_0x16964b[_0x3c8c('0x8d')]=moment()[_0x3c8c('0x47')](_0x3c8c('0x72'));_0x16964b[_0x3c8c('0x83')]=moment()[_0x3c8c('0x47')](_0x3c8c('0x72'));logger[_0x3c8c('0x43')](_0x3c8c('0xaa'),_0x2f2892[_0x3c8c('0x46')],util['inspect'](_0x16964b,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x16964b);break;default:_0x16964b['queuecallerexit']=!![];_0x16964b[_0x3c8c('0x8d')]=moment()[_0x3c8c('0x47')](_0x3c8c('0x72'));_0x16964b['queuecallerleaveAt']=moment()[_0x3c8c('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}_0x16964b[_0x3c8c('0x17')]=![];_0x16964b[_0x3c8c('0x7d')]=null;_0x16964b[_0x3c8c('0x88')]=_0x2f2892[_0x3c8c('0xa6')];this[_0x3c8c('0xf')][_0x2f2892[_0x3c8c('0x46')]]=_0x16964b;this['emitVoiceQueueChannelRemove'](_0x16964b,'varset');}else if(this[_0x3c8c('0x62')](_0x2f2892[_0x3c8c('0xa5')])&&this[_0x3c8c('0x62')](_0x2f2892[_0x3c8c('0xa5')]['queueposition'])){if(!_0x16964b['queuecallerabandon']){_0x16964b[_0x3c8c('0x96')]=!![];_0x16964b[_0x3c8c('0x8d')]=moment()[_0x3c8c('0x47')](_0x3c8c('0x72'));_0x16964b[_0x3c8c('0x88')]='EXITWITHKEY';_0x16964b[_0x3c8c('0x83')]=moment()[_0x3c8c('0x47')](_0x3c8c('0x72'));this[_0x3c8c('0xf')][_0x2f2892[_0x3c8c('0x46')]]=_0x16964b;}}logger[_0x3c8c('0x76')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x2f2892[_0x3c8c('0x46')],_0x16964b['name'],_0x16964b['type'],_[_0x3c8c('0xa4')](_0x2f2892[_0x3c8c('0xa5')])[0x0],_0x2f2892[_0x3c8c('0xa6')]);_0x16964b[_0x3c8c('0x13')]=this[_0x3c8c('0x13')][_0x2f2892[_0x3c8c('0x46')]];}}}}catch(_0x5df605){logger[_0x3c8c('0x3a')]('[%s][voiceQueueReport][varset]',_0x2f2892['uniqueid'],util[_0x3c8c('0x3c')](_0x5df605,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3c8c('0xa3')]=function(_0x38475d,_0x59c6a2,_0xee3d6d){var _0x59c801=[_0x3c8c('0xab'),'rtpaudioqosbridged',_0x3c8c('0xac'),_0x3c8c('0xad'),_0x3c8c('0xae'),_0x3c8c('0xaf'),_0x3c8c('0xb0'),_0x3c8c('0xb1'),_0x3c8c('0xb2'),_0x3c8c('0xb3'),_0x3c8c('0xb4'),_0x3c8c('0xb5'),'membercalls',_0x3c8c('0xb6'),_0x3c8c('0xb7'),_0x3c8c('0xb8'),_0x3c8c('0x8c'),_0x3c8c('0xb9'),_0x3c8c('0xba')];if(!_['isNil'](_0x59c6a2)&&!_['includes'](_0x59c801,_0x59c6a2)){if(_[_0x3c8c('0x5c')](this[_0x3c8c('0x13')][_0x38475d])){this[_0x3c8c('0x13')][_0x38475d]={};}this['variables'][_0x38475d][_0x59c6a2]=_0xee3d6d;}};VoiceQueueReport[_0x3c8c('0x9')][_0x3c8c('0xbb')]=function(_0x1996fd,_0x21cfdd,_0x5f464c){var _0x412a93={};for(var _0x4d59e1=0x0;_0x4d59e1=0x0?moment(_0x5977c6['endtime'])[_0x6a22('0xf')](_0x5977c6[_0x6a22('0x1b')],_0x6a22('0x11')):null,'data1':_0x6a22('0x1c'),'data2':_0x5977c6['accountcode'],'data3':_0x5977c6[_0x6a22('0x14')],'data4':_0x5977c6[_0x6a22('0x1d')]||null,'role':_0x6a22('0x15'),'internal':_0x5977c6[_0x6a22('0x16')]?_[_0x6a22('0x17')](_0x5977c6[_0x6a22('0x16')]):undefined,'uniqueid':_0x5977c6[_0x6a22('0x18')]},'log':_0x6a22('0x8')});}; \ No newline at end of file +var _0xef19=['TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','voiceDialReport','membername','starttime','endtime','dialstring','moment','util','../client','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','format','SIP/%s','lastAssignedTo'];(function(_0x555024,_0xb6b0f2){var _0x5d4799=function(_0x55e89d){while(--_0x55e89d){_0x555024['push'](_0x555024['shift']());}};_0x5d4799(++_0xb6b0f2);}(_0xef19,0x1d0));var _0x9ef1=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0xef19[_0x56fe98];return _0x212f4f;};'use strict';var moment=require(_0x9ef1('0x0'));var _=require('lodash');var util=require(_0x9ef1('0x1'));var client=require(_0x9ef1('0x2'));exports['voiceQueueReport']=function(_0x433cf1){var _0x2b4bc0=_0x433cf1['queuecallercompleteAt']||_0x433cf1[_0x9ef1('0x3')];return client[_0x9ef1('0x4')](_0x9ef1('0x5'),{'body':{'channel':_0x9ef1('0x6'),'membername':_0x433cf1['lastAssignedTo'],'interface':_[_0x9ef1('0x7')](_0x433cf1[_0x9ef1('0x8')])?util[_0x9ef1('0x9')](_0x9ef1('0xa'),_0x433cf1[_0x9ef1('0xb')]):_0x433cf1[_0x9ef1('0x8')],'type':_0x9ef1('0xc'),'enterAt':_0x433cf1['queuecallerleaveAt'],'exitAt':_0x2b4bc0,'duration':moment(_0x2b4bc0)[_0x9ef1('0xd')](_0x433cf1[_0x9ef1('0xe')],_0x9ef1('0xf')),'data1':_0x9ef1('0x10'),'data2':_0x433cf1[_0x9ef1('0x11')],'data3':_0x433cf1[_0x9ef1('0x12')],'data4':null,'data5':_0x433cf1[_0x9ef1('0x13')],'role':_0x9ef1('0x14'),'internal':_0x433cf1[_0x9ef1('0x15')]?_[_0x9ef1('0x16')](_0x433cf1[_0x9ef1('0x15')]):undefined,'uniqueid':_0x433cf1['uniqueid']},'log':_0x9ef1('0x5')});};exports[_0x9ef1('0x17')]=function(_0x2ba106){return client[_0x9ef1('0x4')](_0x9ef1('0x5'),{'body':{'channel':_0x9ef1('0x6'),'membername':_0x2ba106[_0x9ef1('0x18')],'interface':_0x2ba106['interface'],'type':'TALKING','enterAt':_0x2ba106[_0x9ef1('0x19')],'exitAt':_0x2ba106[_0x9ef1('0x1a')],'duration':moment(_0x2ba106[_0x9ef1('0x1a')])[_0x9ef1('0xd')](_0x2ba106[_0x9ef1('0x19')],_0x9ef1('0xf'))>=0x0?moment(_0x2ba106[_0x9ef1('0x1a')])[_0x9ef1('0xd')](_0x2ba106['starttime'],_0x9ef1('0xf')):null,'data1':'outbound','data2':_0x2ba106[_0x9ef1('0x15')],'data3':_0x2ba106[_0x9ef1('0x12')],'data4':_0x2ba106[_0x9ef1('0x1b')]||null,'role':_0x9ef1('0x14'),'internal':_0x2ba106['accountcode']?_[_0x9ef1('0x16')](_0x2ba106[_0x9ef1('0x15')]):undefined,'uniqueid':_0x2ba106['uniqueid']},'log':_0x9ef1('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 2467316..8015a6d 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 _0x15f9=['previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2235f8,_0x5035ed){var _0x4c5db3=function(_0x2a43e8){while(--_0x2a43e8){_0x2235f8['push'](_0x2235f8['shift']());}};_0x4c5db3(++_0x5035ed);}(_0x15f9,0xf7));var _0x915f=function(_0x10663b,_0x53de0d){_0x10663b=_0x10663b-0x0;var _0x234da9=_0x15f9[_0x10663b];return _0x234da9;};'use strict';var client=require(_0x915f('0x0'));exports[_0x915f('0x1')]=function(){return client[_0x915f('0x2')](_0x915f('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x915f('0x4'),_0x915f('0x5')]},'log':_0x915f('0x6')});}; \ No newline at end of file +var _0x60d7=['previewRecallmeReminderInterval','../client','getSettings','ShowSetting'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0x60d7,0x139));var _0x760d=function(_0x3f6ee2,_0x1ed8ee){_0x3f6ee2=_0x3f6ee2-0x0;var _0x46ab40=_0x60d7[_0x3f6ee2];return _0x46ab40;};'use strict';var client=require(_0x760d('0x0'));exports[_0x760d('0x1')]=function(){return client['Request'](_0x760d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x760d('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 4fe0e85..5e60ea3 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 _0xf313=['Request','GetTemplate','name'];(function(_0xb8d18e,_0x47fba7){var _0x189a91=function(_0x407010){while(--_0x407010){_0xb8d18e['push'](_0xb8d18e['shift']());}};_0x189a91(++_0x47fba7);}(_0xf313,0x1e0));var _0x3f31=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf313[_0x5b644e];return _0x49c6bf;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x1b089d){return function(_0x34566b){return client[_0x3f31('0x0')](_0x3f31('0x1'),{'options':{'raw':!![],'attributes':['id',_0x3f31('0x2'),'html']},'log':_0x3f31('0x1')});};}; \ No newline at end of file +var _0x5c0f=['../client','Request','GetTemplate','name'];(function(_0x1ca4c3,_0x554126){var _0x4426a6=function(_0x11e9b0){while(--_0x11e9b0){_0x1ca4c3['push'](_0x1ca4c3['shift']());}};_0x4426a6(++_0x554126);}(_0x5c0f,0xb4));var _0xf5c0=function(_0x5b7bf6,_0x3e4885){_0x5b7bf6=_0x5b7bf6-0x0;var _0x307710=_0x5c0f[_0x5b7bf6];return _0x307710;};'use strict';var client=require(_0xf5c0('0x0'));exports['getTemplates']=function(_0x1f1193){return function(_0x88553d){return client[_0xf5c0('0x1')](_0xf5c0('0x2'),{'options':{'raw':!![],'attributes':['id',_0xf5c0('0x3'),'html']},'log':_0xf5c0('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7436cc1..07396dd 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 _0xd174=['data6','data7','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','AnyConditions','operator','value','Action','Actions','action','data1','data2','data3','data5'];(function(_0x4ec13d,_0x358a8f){var _0x3c3fa7=function(_0x2615f6){while(--_0x2615f6){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0x3c3fa7(++_0x358a8f);}(_0xd174,0xe9));var _0x4d17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd174[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x4d17('0x0')]=function(_0x444683){return function(_0x44bfb2){return client[_0x4d17('0x1')](_0x4d17('0x2'),{'options':{'raw':![],'attributes':['id',_0x4d17('0x3'),_0x4d17('0x4'),_0x4d17('0x5')],'include':[{'model':_0x4d17('0x6'),'as':_0x4d17('0x7'),'attributes':['id',_0x4d17('0x8'),'operator','value']},{'model':_0x4d17('0x6'),'as':_0x4d17('0x9'),'attributes':['id',_0x4d17('0x8'),_0x4d17('0xa'),_0x4d17('0xb')]},{'model':_0x4d17('0xc'),'as':_0x4d17('0xd'),'attributes':['id',_0x4d17('0xe'),_0x4d17('0xf'),_0x4d17('0x10'),_0x4d17('0x11'),'data4',_0x4d17('0x12'),_0x4d17('0x13'),_0x4d17('0x14')]}]},'log':_0x4d17('0x2')});};}; \ No newline at end of file +var _0xb24b=['data3','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','AnyConditions','value','Actions','action','data1','data2'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb24b,0x8f));var _0xbb24=function(_0x304b83,_0x5261e1){_0x304b83=_0x304b83-0x0;var _0x4e2c21=_0xb24b[_0x304b83];return _0x4e2c21;};'use strict';var client=require(_0xbb24('0x0'));exports[_0xbb24('0x1')]=function(_0x58c91d){return function(_0x47bf4c){return client[_0xbb24('0x2')](_0xbb24('0x3'),{'options':{'raw':![],'attributes':['id',_0xbb24('0x4'),_0xbb24('0x5'),_0xbb24('0x6')],'include':[{'model':_0xbb24('0x7'),'as':_0xbb24('0x8'),'attributes':['id',_0xbb24('0x9'),_0xbb24('0xa'),'value']},{'model':_0xbb24('0x7'),'as':_0xbb24('0xb'),'attributes':['id',_0xbb24('0x9'),'operator',_0xbb24('0xc')]},{'model':'Action','as':_0xbb24('0xd'),'attributes':['id',_0xbb24('0xe'),_0xbb24('0xf'),_0xbb24('0x10'),_0xbb24('0x11'),'data4','data5',_0xbb24('0x12'),_0xbb24('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index f3a567c..6c47bf8 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 _0x0b27=['getTrunks','Request','GetTrunk','defaultuser','../client'];(function(_0x27d512,_0x4d1787){var _0x355ef1=function(_0x45e3d4){while(--_0x45e3d4){_0x27d512['push'](_0x27d512['shift']());}};_0x355ef1(++_0x4d1787);}(_0x0b27,0xae));var _0x70b2=function(_0x273f78,_0x521946){_0x273f78=_0x273f78-0x0;var _0x280742=_0x0b27[_0x273f78];return _0x280742;};'use strict';var client=require(_0x70b2('0x0'));exports[_0x70b2('0x1')]=function(_0x6489c7){return function(_0x563ea5){return client[_0x70b2('0x2')](_0x70b2('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x70b2('0x4')]},'log':_0x70b2('0x3')});};}; \ No newline at end of file +var _0x7ec7=['name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x3e459a,_0x43829a){var _0x6ca4e3=function(_0x330a7b){while(--_0x330a7b){_0x3e459a['push'](_0x3e459a['shift']());}};_0x6ca4e3(++_0x43829a);}(_0x7ec7,0x19b));var _0x77ec=function(_0x860ed9,_0xb8668){_0x860ed9=_0x860ed9-0x0;var _0x22536c=_0x7ec7[_0x860ed9];return _0x22536c;};'use strict';var client=require(_0x77ec('0x0'));exports[_0x77ec('0x1')]=function(_0xeccf3d){return function(_0x4cc7e4){return client[_0x77ec('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x77ec('0x3'),_0x77ec('0x4'),_0x77ec('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 9646e52..7f4f77f 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x4c1528,_0x17e048){var _0x14987=function(_0x5cc750){while(--_0x5cc750){_0x4c1528['push'](_0x4c1528['shift']());}};_0x14987(++_0x17e048);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x4671c7,_0x3416dd){var _0x2312ff=function(_0x17ed13){while(--_0x17ed13){_0x4671c7['push'](_0x4671c7['shift']());}};_0x2312ff(++_0x3416dd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xcb91[_0x249e96];return _0x17444c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 4b8f734..d2fbfe5 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 _0x5f97=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x14c9c4,_0x437b92){var _0x1fffb9=function(_0x237035){while(--_0x237035){_0x14c9c4['push'](_0x14c9c4['shift']());}};_0x1fffb9(++_0x437b92);}(_0x5f97,0xd9));var _0x75f9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f97[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x75f9('0x0'));exports[_0x75f9('0x1')]=function(_0x2533e5){return client[_0x75f9('0x2')]('CreateVoiceAgentReport',{'body':_0x2533e5,'log':_0x75f9('0x3')});};exports[_0x75f9('0x4')]=function(_0x48ff30,_0x814114,_0x324a10){return client['Request'](_0x75f9('0x5'),{'body':_0x48ff30,'options':{'where':{'uniqueid':_0x814114,'interface':_0x324a10,'agentcomplete':!![]}},'log':_0x75f9('0x5')});}; \ No newline at end of file +var _0xb759=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x6e6569,_0xdbde2f){var _0x285bce=function(_0x179714){while(--_0x179714){_0x6e6569['push'](_0x6e6569['shift']());}};_0x285bce(++_0xdbde2f);}(_0xb759,0x122));var _0x9b75=function(_0xe299ae,_0x494c4b){_0xe299ae=_0xe299ae-0x0;var _0x258685=_0xb759[_0xe299ae];return _0x258685;};'use strict';var client=require(_0x9b75('0x0'));exports[_0x9b75('0x1')]=function(_0x43ab49){return client[_0x9b75('0x2')](_0x9b75('0x3'),{'body':_0x43ab49,'log':_0x9b75('0x3')});};exports[_0x9b75('0x4')]=function(_0x5b5a12,_0x5295e6,_0x346261){return client['Request']('UpdateVoiceAgentReport',{'body':_0x5b5a12,'options':{'where':{'uniqueid':_0x5295e6,'interface':_0x346261,'agentcomplete':!![]}},'log':_0x9b75('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index af69e4c..1e3913f 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 _0x0cf3=['util','../client','Request','CreateVoiceCallReport','merge','calleridnum','callerid','getVoiceCallReports','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','billableseconds','moment'];(function(_0xa8f24a,_0x48d7d3){var _0x3a1471=function(_0x281470){while(--_0x281470){_0xa8f24a['push'](_0xa8f24a['shift']());}};_0x3a1471(++_0x48d7d3);}(_0x0cf3,0xd0));var _0x30cf=function(_0xeb620,_0x5b7bf6){_0xeb620=_0xeb620-0x0;var _0x133a74=_0x0cf3[_0xeb620];return _0x133a74;};'use strict';var moment=require(_0x30cf('0x0'));var util=require(_0x30cf('0x1'));var _=require('lodash');var client=require(_0x30cf('0x2'));exports['create']=function(_0x453484){return client[_0x30cf('0x3')](_0x30cf('0x4'),{'body':_[_0x30cf('0x5')](_0x453484,{'source':_0x453484[_0x30cf('0x6')],'destinationcontext':_0x453484['context'],'callerid':_0x453484[_0x30cf('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x30cf('0x4')});};exports[_0x30cf('0x8')]=function(){return function(){return client[_0x30cf('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x30cf('0x9')],'createdAt':{'$between':[moment()[_0x30cf('0xa')]('day')[_0x30cf('0xb')](_0x30cf('0xc')),moment()[_0x30cf('0xd')](_0x30cf('0xe'))[_0x30cf('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x30cf('0xf'),_0x30cf('0x10'),_0x30cf('0x11'),_0x30cf('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x59c8=['Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x59c8,0x1dd));var _0x859c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x59c8[_0x3b380d];return _0x54502b;};'use strict';var moment=require(_0x859c('0x0'));var util=require(_0x859c('0x1'));var _=require(_0x859c('0x2'));var client=require('../client');exports['create']=function(_0x14ecb3){return client[_0x859c('0x3')](_0x859c('0x4'),{'body':_[_0x859c('0x5')](_0x14ecb3,{'source':_0x14ecb3[_0x859c('0x6')],'destinationcontext':_0x14ecb3[_0x859c('0x7')],'callerid':_0x14ecb3['callerid'],'amaflags':_0x859c('0x8')}),'log':_0x859c('0x4')});};exports[_0x859c('0x9')]=function(){return function(){return client[_0x859c('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x859c('0xa')],'createdAt':{'$between':[moment()[_0x859c('0xb')](_0x859c('0xc'))[_0x859c('0xd')](_0x859c('0xe')),moment()['endOf']('day')[_0x859c('0xd')](_0x859c('0xe'))]}},'attributes':[_0x859c('0xf'),_0x859c('0x10'),_0x859c('0x11'),_0x859c('0x12')]},'log':_0x859c('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fe3fb6c..569d73f 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 _0x274e=['../client','create','Request','CreateVoiceDialReport'];(function(_0xa8209a,_0x49dce7){var _0x10af75=function(_0x4a9ad8){while(--_0x4a9ad8){_0xa8209a['push'](_0xa8209a['shift']());}};_0x10af75(++_0x49dce7);}(_0x274e,0x1c8));var _0xe274=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x274e[_0x5608a3];return _0x1ed50a;};'use strict';var client=require(_0xe274('0x0'));exports[_0xe274('0x1')]=function(_0x2d9a17){return client[_0xe274('0x2')]('CreateVoiceDialReport',{'body':_0x2d9a17,'log':_0xe274('0x3')});}; \ No newline at end of file +var _0xe945=['../client','Request','CreateVoiceDialReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe945,0xea));var _0x5e94=function(_0xb07629,_0x1150a0){_0xb07629=_0xb07629-0x0;var _0x479ae2=_0xe945[_0xb07629];return _0x479ae2;};'use strict';var client=require(_0x5e94('0x0'));exports['create']=function(_0x3564ed){return client[_0x5e94('0x1')](_0x5e94('0x2'),{'body':_0x3564ed,'log':_0x5e94('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 22216c0..e7c13f5 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 _0x515d=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x402fef,_0x233358){var _0x2157f2=function(_0x9fecff){while(--_0x9fecff){_0x402fef['push'](_0x402fef['shift']());}};_0x2157f2(++_0x233358);}(_0x515d,0x104));var _0xd515=function(_0xc5f2cc,_0x548f3a){_0xc5f2cc=_0xc5f2cc-0x0;var _0x2b0c8b=_0x515d[_0xc5f2cc];return _0x2b0c8b;};'use strict';var client=require('../client');exports[_0xd515('0x0')]=function(){return function(){return client[_0xd515('0x1')](_0xd515('0x2'),{'options':{'raw':!![],'attributes':['id',_0xd515('0x3'),_0xd515('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xd515('0x0')});};}; \ No newline at end of file +var _0xd71d=['exten','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x1b8b28,_0x26eaa0){var _0x52aa70=function(_0x50fd9f){while(--_0x50fd9f){_0x1b8b28['push'](_0x1b8b28['shift']());}};_0x52aa70(++_0x26eaa0);}(_0xd71d,0x1a5));var _0xdd71=function(_0x1443eb,_0x203408){_0x1443eb=_0x1443eb-0x0;var _0x2b8810=_0xd71d[_0x1443eb];return _0x2b8810;};'use strict';var client=require(_0xdd71('0x0'));exports[_0xdd71('0x1')]=function(){return function(){return client[_0xdd71('0x2')](_0xdd71('0x3'),{'options':{'raw':!![],'attributes':['id',_0xdd71('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xdd71('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 6a496a5..fc03e09 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 _0x8a1e=['autopause','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','name','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x8a1e,0x77));var _0xe8a1=function(_0x59533d,_0x2b5402){_0x59533d=_0x59533d-0x0;var _0x327dd1=_0x8a1e[_0x59533d];return _0x327dd1;};'use strict';var client=require(_0xe8a1('0x0'));exports[_0xe8a1('0x1')]=function(){return function(){return client[_0xe8a1('0x2')](_0xe8a1('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xe8a1('0x4'),'acwTimeout',_0xe8a1('0x5'),'monitor_format','type',_0xe8a1('0x6'),_0xe8a1('0x7'),'dialLimitChannel',_0xe8a1('0x8'),_0xe8a1('0x9'),_0xe8a1('0xa'),_0xe8a1('0xb'),_0xe8a1('0xc'),_0xe8a1('0xd'),_0xe8a1('0xe'),_0xe8a1('0xf'),_0xe8a1('0x10'),'dialQueueTimeout','dialQueueProject',_0xe8a1('0x11'),_0xe8a1('0x12'),'dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xe8a1('0x13'),'dialGlobalMaxRetry',_0xe8a1('0x14'),_0xe8a1('0x15'),'dialPrefix',_0xe8a1('0x16'),_0xe8a1('0x17'),_0xe8a1('0x18'),_0xe8a1('0x19'),'dialAMDAfterGreetingSilence',_0xe8a1('0x1a'),'dialAMDMinWordLength',_0xe8a1('0x1b'),_0xe8a1('0x1c'),_0xe8a1('0x1d'),_0xe8a1('0x1e'),_0xe8a1('0x1f'),'dialRecallMeTimeout',_0xe8a1('0x20'),_0xe8a1('0x21'),_0xe8a1('0x22'),_0xe8a1('0x23'),_0xe8a1('0x24'),'monitor_format',_0xe8a1('0x25'),_0xe8a1('0x26'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0xe8a1('0x27'),_0xe8a1('0x28'),'dialDropRetryFrequency',_0xe8a1('0x29'),_0xe8a1('0x2a'),_0xe8a1('0x2b'),_0xe8a1('0x2c'),_0xe8a1('0x2d'),_0xe8a1('0x2e'),_0xe8a1('0x2f'),_0xe8a1('0x30'),_0xe8a1('0x31'),_0xe8a1('0x32'),_0xe8a1('0x33'),_0xe8a1('0x34')],'include':[{'model':_0xe8a1('0x35'),'as':_0xe8a1('0x35'),'attributes':['id','name',_0xe8a1('0x36'),_0xe8a1('0x37')]},{'model':_0xe8a1('0x38'),'as':'mandatoryDispositionPause','attributes':['id',_0xe8a1('0x39')]},{'model':_0xe8a1('0x35'),'as':_0xe8a1('0x3a'),'attributes':['id','name',_0xe8a1('0x36'),_0xe8a1('0x37')]},{'model':_0xe8a1('0x3b'),'as':_0xe8a1('0x3b'),'attributes':['id',_0xe8a1('0x39')],'include':[{'model':_0xe8a1('0x3b'),'as':_0xe8a1('0x3c'),'attributes':['id','name',_0xe8a1('0x3d')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x59a2=['dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','active','mandatoryDispositionPause','callerid','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe'];(function(_0x3a3738,_0x59ef33){var _0x46d907=function(_0x182f7d){while(--_0x182f7d){_0x3a3738['push'](_0x3a3738['shift']());}};_0x46d907(++_0x59ef33);}(_0x59a2,0x139));var _0x259a=function(_0xaa3397,_0x173f37){_0xaa3397=_0xaa3397-0x0;var _0x5c01df=_0x59a2[_0xaa3397];return _0x5c01df;};'use strict';var client=require(_0x259a('0x0'));exports[_0x259a('0x1')]=function(){return function(){return client[_0x259a('0x2')](_0x259a('0x3'),{'options':{'raw':![],'attributes':['id',_0x259a('0x4'),_0x259a('0x5'),'acwTimeout','autopause','monitor_format',_0x259a('0x6'),_0x259a('0x7'),_0x259a('0x8'),_0x259a('0x9'),_0x259a('0xa'),'dialPowerLevel',_0x259a('0xb'),_0x259a('0xc'),_0x259a('0xd'),'dialOriginateCallerIdName',_0x259a('0xe'),_0x259a('0xf'),_0x259a('0x10'),_0x259a('0x11'),'dialQueueProject',_0x259a('0x12'),_0x259a('0x13'),_0x259a('0x14'),_0x259a('0x15'),_0x259a('0x16'),'dialNoAnswerRetryFrequency',_0x259a('0x17'),_0x259a('0x18'),'dialGlobalInterval',_0x259a('0x19'),_0x259a('0x1a'),'dialAMDActive',_0x259a('0x1b'),_0x259a('0x1c'),_0x259a('0x1d'),_0x259a('0x1e'),_0x259a('0x1f'),_0x259a('0x20'),_0x259a('0x21'),_0x259a('0x22'),_0x259a('0x23'),'timeout',_0x259a('0x24'),_0x259a('0x25'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x259a('0x26'),_0x259a('0x27'),_0x259a('0x28'),'dialRandomLastDigitCallerIdNumber',_0x259a('0x29'),_0x259a('0x2a'),_0x259a('0x2b'),_0x259a('0x2c'),_0x259a('0x2d'),'dialAbandonedMaxRetry',_0x259a('0x2e'),_0x259a('0x2f'),_0x259a('0x30'),_0x259a('0x31'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x259a('0x32'),_0x259a('0x33'),_0x259a('0x34'),_0x259a('0x35'),_0x259a('0x36')],'include':[{'model':_0x259a('0x37'),'as':'Trunk','attributes':['id',_0x259a('0x4'),'callerid',_0x259a('0x38')]},{'model':'Pause','as':_0x259a('0x39'),'attributes':['id',_0x259a('0x4')]},{'model':_0x259a('0x37'),'as':'TrunkBackup','attributes':['id',_0x259a('0x4'),_0x259a('0x3a'),_0x259a('0x38')]},{'model':'Interval','as':'Interval','attributes':['id',_0x259a('0x4')],'include':[{'model':_0x259a('0x3b'),'as':_0x259a('0x3c'),'attributes':['id',_0x259a('0x4'),'interval']}]}]},'log':_0x259a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 77e3497..8dbe7ea 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(_0x2476aa,_0x532e96){var _0x153ed0=function(_0x274c43){while(--_0x274c43){_0x2476aa['push'](_0x2476aa['shift']());}};_0x153ed0(++_0x532e96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x372f12,_0x581b16){var _0xc82eed=function(_0x4226f2){while(--_0x4226f2){_0x372f12['push'](_0x372f12['shift']());}};_0xc82eed(++_0x581b16);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 591edc1..7233aa1 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 _0xc168=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x8dcb84,_0x11706f){var _0x5e2da4=function(_0x513b86){while(--_0x513b86){_0x8dcb84['push'](_0x8dcb84['shift']());}};_0x5e2da4(++_0x11706f);}(_0xc168,0xf1));var _0x8c16=function(_0x28c3ee,_0x472677){_0x28c3ee=_0x28c3ee-0x0;var _0x3fe34e=_0xc168[_0x28c3ee];return _0x3fe34e;};'use strict';var client=require(_0x8c16('0x0'));exports[_0x8c16('0x1')]=function(_0x153123){return function(){return client[_0x8c16('0x2')](_0x8c16('0x3'),{'options':{'where':{'VoiceQueueId':_0x153123,'paused':!![]},'raw':!![]},'log':_0x8c16('0x1')});};}; \ No newline at end of file +var _0xd0cc=['getVoiceQueueRtPauses','Request','../client'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xd0cc,0x119));var _0xcd0c=function(_0x4f7871,_0x22e9c3){_0x4f7871=_0x4f7871-0x0;var _0x16bce3=_0xd0cc[_0x4f7871];return _0x16bce3;};'use strict';var client=require(_0xcd0c('0x0'));exports[_0xcd0c('0x1')]=function(_0x38c51d){return function(){return client[_0xcd0c('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x38c51d,'paused':!![]},'raw':!![]},'log':_0xcd0c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8a0badc..94e1a5c 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(_0x112cf8,_0x48ca4b){var _0x447caf=function(_0x1d528f){while(--_0x1d528f){_0x112cf8['push'](_0x112cf8['shift']());}};_0x447caf(++_0x48ca4b);}(_0x7a54,0x106));var _0x47a5=function(_0xe5a6f1,_0x371386){_0xe5a6f1=_0xe5a6f1-0x0;var _0x5ea089=_0x7a54[_0xe5a6f1];return _0x5ea089;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x5b5947,_0xe51ae){var _0x45744c=function(_0xbc575a){while(--_0xbc575a){_0x5b5947['push'](_0x5b5947['shift']());}};_0x45744c(++_0xe51ae);}(_0x7a54,0x106));var _0x47a5=function(_0x50ee4e,_0x30e2f8){_0x50ee4e=_0x50ee4e-0x0;var _0x1ee087=_0x7a54[_0x50ee4e];return _0x1ee087;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 2d8ef4a..9ffbbad 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 _0x1930=['CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','origtransfererlinkedid','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1930,0x1d9));var _0x0193=function(_0x12a460,_0x3c38c3){_0x12a460=_0x12a460-0x0;var _0x225c13=_0x1930[_0x12a460];return _0x225c13;};'use strict';var client=require(_0x0193('0x0'));exports['transfers']={};exports[_0x0193('0x1')]=function(_0xb2a8dc){return client[_0x0193('0x2')](_0x0193('0x3'),{'body':{'result':_0xb2a8dc[_0x0193('0x4')],'transfererchannel':_0xb2a8dc[_0x0193('0x5')],'transferercalleridnum':_0xb2a8dc[_0x0193('0x6')],'transferercalleridname':_0xb2a8dc[_0x0193('0x7')],'transfererconnectedlinenum':_0xb2a8dc[_0x0193('0x8')],'transfererconnectedlinename':_0xb2a8dc[_0x0193('0x9')],'transfereraccountcode':_0xb2a8dc[_0x0193('0xa')],'transferercontext':_0xb2a8dc[_0x0193('0xb')],'transfererexten':_0xb2a8dc['transfererexten'],'transfererlinkedid':_0xb2a8dc[_0x0193('0xc')],'transfereechannel':_0xb2a8dc[_0x0193('0xd')],'transfereecalleridnum':_0xb2a8dc['transfereecalleridnum'],'transfereecalleridname':_0xb2a8dc['transfereecalleridname'],'transfereeconnectedlinenum':_0xb2a8dc[_0x0193('0xe')],'transfereeconnectedlinename':_0xb2a8dc[_0x0193('0xf')],'transfereeaccountcode':_0xb2a8dc[_0x0193('0x10')],'transfereecontext':_0xb2a8dc[_0x0193('0x11')],'transfereeexten':_0xb2a8dc[_0x0193('0x12')],'transfereelinkedid':_0xb2a8dc['transfereelinkedid'],'isexternal':_0xb2a8dc[_0x0193('0x13')],'context':_0xb2a8dc[_0x0193('0x14')],'extension':_0xb2a8dc[_0x0193('0x15')],'type':'blind'},'log':_0x0193('0x3')});};exports[_0x0193('0x16')]=function(_0x3dd9c8){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x3dd9c8[_0x0193('0x4')],'transfererchannel':_0x3dd9c8['origtransfererchannel'],'transferercalleridnum':_0x3dd9c8[_0x0193('0x17')],'transferercalleridname':_0x3dd9c8[_0x0193('0x18')],'transfererconnectedlinenum':_0x3dd9c8[_0x0193('0x19')],'transfererconnectedlinename':_0x3dd9c8['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3dd9c8['origtransfereraccountcode'],'transferercontext':_0x3dd9c8[_0x0193('0x1a')],'transfererexten':_0x3dd9c8['secondtransfererexten'],'transfererlinkedid':_0x3dd9c8[_0x0193('0x1b')],'transfereechannel':_0x3dd9c8['transfertargetchannel'],'transfereecalleridnum':_0x3dd9c8['transfertargetcalleridnum'],'transfereecalleridname':_0x3dd9c8['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3dd9c8['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3dd9c8['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3dd9c8[_0x0193('0x1c')],'transfereecontext':_0x3dd9c8[_0x0193('0x1d')],'transfereeexten':_0x3dd9c8[_0x0193('0x1e')],'transfereelinkedid':_0x3dd9c8['transfertargetlinkedid'],'isexternal':_0x3dd9c8['isexternal'],'context':_0x3dd9c8[_0x0193('0x1f')],'extension':_0x3dd9c8[_0x0193('0x20')],'type':_0x0193('0x21')},'log':_0x0193('0x3')});}; \ No newline at end of file +var _0xb4d5=['transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','context','blind','CreateVoiceTransferReport','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','blindTransfer','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten'];(function(_0x180398,_0x286dc3){var _0x5a0389=function(_0x39073c){while(--_0x39073c){_0x180398['push'](_0x180398['shift']());}};_0x5a0389(++_0x286dc3);}(_0xb4d5,0x178));var _0x5b4d=function(_0x26e287,_0x17a6cc){_0x26e287=_0x26e287-0x0;var _0x2488b6=_0xb4d5[_0x26e287];return _0x2488b6;};'use strict';var client=require(_0x5b4d('0x0'));exports['transfers']={};exports[_0x5b4d('0x1')]=function(_0x3b49b4){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x3b49b4['result'],'transfererchannel':_0x3b49b4[_0x5b4d('0x2')],'transferercalleridnum':_0x3b49b4[_0x5b4d('0x3')],'transferercalleridname':_0x3b49b4[_0x5b4d('0x4')],'transfererconnectedlinenum':_0x3b49b4[_0x5b4d('0x5')],'transfererconnectedlinename':_0x3b49b4[_0x5b4d('0x6')],'transfereraccountcode':_0x3b49b4['transfereraccountcode'],'transferercontext':_0x3b49b4[_0x5b4d('0x7')],'transfererexten':_0x3b49b4[_0x5b4d('0x8')],'transfererlinkedid':_0x3b49b4['transfererlinkedid'],'transfereechannel':_0x3b49b4['transfereechannel'],'transfereecalleridnum':_0x3b49b4[_0x5b4d('0x9')],'transfereecalleridname':_0x3b49b4[_0x5b4d('0xa')],'transfereeconnectedlinenum':_0x3b49b4['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3b49b4[_0x5b4d('0xb')],'transfereeaccountcode':_0x3b49b4['transfereeaccountcode'],'transfereecontext':_0x3b49b4[_0x5b4d('0xc')],'transfereeexten':_0x3b49b4[_0x5b4d('0xd')],'transfereelinkedid':_0x3b49b4[_0x5b4d('0xe')],'isexternal':_0x3b49b4['isexternal'],'context':_0x3b49b4[_0x5b4d('0xf')],'extension':_0x3b49b4['extension'],'type':_0x5b4d('0x10')},'log':_0x5b4d('0x11')});};exports[_0x5b4d('0x12')]=function(_0x3a0231){return client[_0x5b4d('0x13')]('CreateVoiceTransferReport',{'body':{'result':_0x3a0231[_0x5b4d('0x14')],'transfererchannel':_0x3a0231[_0x5b4d('0x15')],'transferercalleridnum':_0x3a0231[_0x5b4d('0x16')],'transferercalleridname':_0x3a0231[_0x5b4d('0x17')],'transfererconnectedlinenum':_0x3a0231[_0x5b4d('0x18')],'transfererconnectedlinename':_0x3a0231[_0x5b4d('0x19')],'transfereraccountcode':_0x3a0231['origtransfereraccountcode'],'transferercontext':_0x3a0231[_0x5b4d('0x1a')],'transfererexten':_0x3a0231['secondtransfererexten'],'transfererlinkedid':_0x3a0231[_0x5b4d('0x1b')],'transfereechannel':_0x3a0231[_0x5b4d('0x1c')],'transfereecalleridnum':_0x3a0231[_0x5b4d('0x1d')],'transfereecalleridname':_0x3a0231['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3a0231[_0x5b4d('0x1e')],'transfereeconnectedlinename':_0x3a0231['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3a0231['transfertargetaccountcode'],'transfereecontext':_0x3a0231['transfertargetcontext'],'transfereeexten':_0x3a0231['transfertargetexten'],'transfereelinkedid':_0x3a0231[_0x5b4d('0x1f')],'isexternal':_0x3a0231[_0x5b4d('0x20')],'context':_0x3a0231[_0x5b4d('0x21')],'extension':_0x3a0231['origtransfererexten'],'type':_0x5b4d('0x22')},'log':_0x5b4d('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 6270546..32cf676 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 _0x7894=['outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','undefined','values','channels','map','uniqueid','channel','format','%s.%s','filename','Action','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','moment','../../../config/environment','../ami','listen','%s/%s','name','timers','timer','updateAcw','agents','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','keys','module','Reload','then','catch','error','pick','command','action','Command','message','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay'];(function(_0x138e12,_0x199a1e){var _0x5d94be=function(_0x333e52){while(--_0x333e52){_0x138e12['push'](_0x138e12['shift']());}};_0x5d94be(++_0x199a1e);}(_0x7894,0x170));var _0x4789=function(_0x3169a1,_0x563899){_0x3169a1=_0x3169a1-0x0;var _0x4b808c=_0x7894[_0x3169a1];return _0x4b808c;};'use strict';var _=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var jayson=require(_0x4789('0x2'));var schema=require(_0x4789('0x3'));var moment=require(_0x4789('0x4'));var config=require(_0x4789('0x5'));var properties=require('../properties');var ami=require(_0x4789('0x6'));exports[_0x4789('0x7')]=function(_0x4e2393,_0x3394f6,_0x4bfe85){return new Promise(function(_0x1b4e02,_0x12ef33){var _0x114a90={'QueuePause':function(_0x298902){return new Promise(function(_0x13b7f6){var _0x5a45ae=util['format'](_0x4789('0x8'),'SIP',_0x298902[_0x4789('0x9')]);if(_0x4e2393[_0x4789('0xa')]&&_0x4e2393[_0x4789('0xa')][_0x5a45ae]&&_0x4e2393['timers'][_0x5a45ae][_0x4789('0xb')]){_0x4e2393['timers'][_0x5a45ae][_0x4789('0xc')]();}if(_0x4e2393[_0x4789('0xd')][_0x5a45ae]){_0x4e2393[_0x4789('0xd')][_0x5a45ae]['updateStatusRealtime']({'statePause':_0x298902['pause']?!![]:![]});}_0x13b7f6({'code':0xc8,'message':_0x4789('0xe')});});},'Reload':function(_0x4a1b86){var _0xf73460=this;return new Promise(function(_0x58743a,_0x25a4a9){if(ami[_0x4789('0xf')]()==![]){return _0x25a4a9(_0xf73460['error'](0x1f4,[config[_0x4789('0x10')]['ip'],config['asterisk'][_0x4789('0x11')],_0x4789('0x12')][_0x4789('0x13')]('\x20')));}_0x4a1b86=_['pick'](_0x4a1b86,_[_0x4789('0x14')](properties[_0x4789('0x15')]));_0x4a1b86['action']=_0x4789('0x16');return ami['Action'](_0x4a1b86)[_0x4789('0x17')](function(_0xb11831){_0x58743a({'code':0xc8,'message':_0xb11831['message']});})[_0x4789('0x18')](function(_0x5af7b3){_0x25a4a9(_0xf73460[_0x4789('0x19')](0x1f5,_0x5af7b3['message']));});});},'Command':function(_0x19dc59){var _0x3fc0e6=this;return new Promise(function(_0x56e9c1,_0x9034c9){if(ami[_0x4789('0xf')]()==![]){return _0x9034c9(_0x3fc0e6[_0x4789('0x19')](0x1f4,[config[_0x4789('0x10')]['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')][_0x4789('0x13')]('\x20')));}_0x19dc59=_[_0x4789('0x1a')](_0x19dc59,_0x4789('0x1b'));_0x19dc59[_0x4789('0x1c')]=_0x4789('0x1d');return ami['Action'](_0x19dc59)[_0x4789('0x17')](function(_0x7d003b){_0x56e9c1({'code':0xc8,'message':_0x7d003b['content']});})[_0x4789('0x18')](function(_0x26884c){_0x9034c9(_0x3fc0e6['error'](0x1f5,_0x26884c[_0x4789('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0x1ca6ca){var _0x54d9c1=[];for(var _0xd8601e in _0x4e2393['voiceQueues']){if(_0x4e2393[_0x4789('0x1f')][_0x4789('0x20')](_0xd8601e)){var _0x307b90=_0x4e2393[_0x4789('0x1f')][_0xd8601e];var _0x435016={'id':_0x307b90['id'],'name':_0x307b90[_0x4789('0x9')],'strategy':_0x307b90[_0x4789('0x21')],'answered':_0x307b90[_0x4789('0x22')],'available':_0x307b90[_0x4789('0x23')],'loggedIn':_0x307b90[_0x4789('0x24')],'pTalking':_0x307b90[_0x4789('0x25')],'sumBillable':_0x307b90[_0x4789('0x26')],'sumDuration':_0x307b90[_0x4789('0x27')],'sumHoldTime':_0x307b90[_0x4789('0x28')]||0x0,'talking':_0x307b90[_0x4789('0x29')],'total':_0x307b90[_0x4789('0x2a')],'type':_0x307b90[_0x4789('0x2b')],'unmanaged':_0x307b90[_0x4789('0x2c')],'abandoned':_0x307b90['abandoned'],'waiting':_0x307b90['waiting'],'loggedInDb':_0x307b90[_0x4789('0x2d')]};if(_0x307b90['type']==='outbound'){_0x435016['dialActive']=_0x307b90[_0x4789('0x2e')];_0x435016[_0x4789('0x2f')]=_0x307b90[_0x4789('0x2f')];_0x435016[_0x4789('0x30')]=_0x307b90[_0x4789('0x30')];_0x435016[_0x4789('0x31')]=_0x307b90[_0x4789('0x31')];_0x435016[_0x4789('0x32')]=_0x307b90[_0x4789('0x32')];_0x435016['dialPrefix']=_0x307b90[_0x4789('0x33')];_0x435016[_0x4789('0x34')]=_0x307b90[_0x4789('0x34')];_0x435016[_0x4789('0x35')]=_0x307b90[_0x4789('0x35')];_0x435016[_0x4789('0x36')]=_0x307b90[_0x4789('0x36')];_0x435016[_0x4789('0x37')]=_0x307b90[_0x4789('0x37')];_0x435016[_0x4789('0x38')]=_0x307b90[_0x4789('0x38')];_0x435016[_0x4789('0x39')]=_0x307b90[_0x4789('0x39')];_0x435016[_0x4789('0x3a')]=_0x307b90[_0x4789('0x3a')];_0x435016['outboundDropCallsDayCallersExit']=_0x307b90[_0x4789('0x3b')];_0x435016[_0x4789('0x3c')]=_0x307b90[_0x4789('0x3c')];_0x435016[_0x4789('0x3d')]=_0x307b90[_0x4789('0x3d')];_0x435016[_0x4789('0x3e')]=_0x307b90[_0x4789('0x3e')];_0x435016['outboundOriginateFailureCallsDay']=_0x307b90[_0x4789('0x3f')];_0x435016[_0x4789('0x40')]=_0x307b90['outboundReCallsDay'];_0x435016['outboundRejectCallsDay']=_0x307b90[_0x4789('0x41')];_0x435016[_0x4789('0x42')]=_0x307b90[_0x4789('0x42')];_0x435016[_0x4789('0x43')]=_0x307b90[_0x4789('0x43')];_0x435016[_0x4789('0x44')]=_0x307b90[_0x4789('0x44')];_0x435016['predictiveIntervalAvgTalktime']=_0x307b90['predictiveIntervalAvgTalktime'];_0x435016['predictiveIntervalDroppedCallsCallersExit']=_0x307b90[_0x4789('0x45')];_0x435016[_0x4789('0x46')]=_0x307b90[_0x4789('0x46')];_0x435016[_0x4789('0x47')]=_0x307b90[_0x4789('0x47')];_0x435016[_0x4789('0x48')]=_0x307b90[_0x4789('0x48')];_0x435016['predictiveIntervalHitRate']=_0x307b90[_0x4789('0x49')];_0x435016[_0x4789('0x4a')]=_0x307b90[_0x4789('0x4a')];_0x435016['predictiveIntervalPauses']=_0x307b90[_0x4789('0x4b')];_0x435016[_0x4789('0x4c')]=_0x307b90[_0x4789('0x4c')];_0x435016[_0x4789('0x4d')]=_0x307b90[_0x4789('0x4d')];_0x435016['message']=_0x307b90[_0x4789('0x1e')];_0x435016['originated']=_0x307b90[_0x4789('0x4e')];_0x435016[_0x4789('0x4f')]=_0x307b90[_0x4789('0x4f')];_0x435016[_0x4789('0x50')]=_0x307b90[_0x4789('0x50')];_0x435016['erlangAbandonmentRate']=_0x307b90[_0x4789('0x51')];_0x435016['erlangBusyFactor']=_0x307b90[_0x4789('0x52')];_0x435016[_0x4789('0x53')]=_0x307b90['startPredictive'];_0x435016[_0x4789('0x54')]=_0x307b90['startProgressive'];}if(_0x307b90[_0x4789('0x55')]){_0x435016[_0x4789('0x55')]={'id':_0x307b90[_0x4789('0x55')]['id'],'name':_0x307b90[_0x4789('0x55')]['name'],'active':_0x307b90[_0x4789('0x55')][_0x4789('0x56')],'callerid':_0x307b90['Trunk'][_0x4789('0x57')]};}if(_0x307b90[_0x4789('0x58')]){_0x435016[_0x4789('0x58')]={'id':_0x307b90['Interval']['id'],'name':_0x307b90['Interval'][_0x4789('0x9')]};}_0x54d9c1['push'](_0x435016);}}_0x1ca6ca({'count':_0x54d9c1[_0x4789('0x59')],'rows':_0x54d9c1});});},'UpdateVoiceQueue':function(_0x577af3){return new Promise(function(_0x861bcb,_0x91e8d){var _0x147d09=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x1f')],{'id':parseInt(_0x577af3['id'])});var _0x4081bb=_[_0x4789('0x5b')](_0x577af3,['id']);if(_0x147d09){for(var _0x58782e in _0x4081bb){if(typeof _0x4081bb[_0x58782e]!==_0x4789('0x5c')&&typeof _0x147d09[_0x58782e]!==_0x4789('0x5c')){_0x147d09[_0x58782e]=_0x4081bb[_0x58782e];}}_0x861bcb(_0x147d09);}else{_0x91e8d();}});},'VoiceChannels':function(){return new Promise(function(_0x1d33d8){var _0x1c8117=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x5e')]);_0x1d33d8({'count':_0x1c8117[_0x4789('0x59')],'rows':_0x1c8117});});},'VoiceChannelMixMonitor':function(_0x1eacb3){var _0x385b1f=this;return new Promise(function(_0xcf3dd5,_0x49dbd7){if(ami[_0x4789('0xf')]()==![]){return _0x49dbd7(_0x385b1f[_0x4789('0x19')](0x1f4,[config['asterisk']['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')][_0x4789('0x13')]('\x20')));}var _0x3b09de=schema(properties['voicechannel'])[_0x4789('0x3')](_0x1eacb3);if(_0x3b09de[_0x4789('0x59')]>0x0){return _0x49dbd7(_0x385b1f[_0x4789('0x19')](0x1f4,_[_0x4789('0x5f')](_0x3b09de,_0x4789('0x1e'))[_0x4789('0x13')](',\x20')));}var _0x2ae91d=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x5e')],{'uniqueid':_0x1eacb3[_0x4789('0x60')]});if(_0x2ae91d&&_0x2ae91d[_0x4789('0x61')]){var _0x516128=util[_0x4789('0x62')](_0x4789('0x63'),_0x1eacb3[_0x4789('0x64')]||_0x1eacb3[_0x4789('0x60')],_0x1eacb3[_0x4789('0x62')]||'wav');return ami[_0x4789('0x65')]({'action':'MixMonitor','channel':_0x2ae91d['channel'],'file':_0x516128,'options':_0x4789('0x66')})[_0x4789('0x17')](function(_0x2df7b1){var _0x38c96d=_[_0x4789('0x5a')](_0x2ae91d[_0x4789('0x67')],{'filename':_0x4789('0x68')+_0x516128[_0x4789('0x69')]()});if(_['isNil'](_0x38c96d)){_0x2ae91d[_0x4789('0x67')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x516128[_0x4789('0x69')](),'createdAt':moment()['format'](_0x4789('0x6a')),'mixmonitorid':_0x2df7b1[_0x4789('0x6b')],'status':_0x4789('0x6c')});}else{_0x38c96d['mixmonitorid']=_0x2df7b1[_0x4789('0x6b')];_0x38c96d['status']=_0x4789('0x6c');}_0xcf3dd5({'code':0xc8,'message':[_0x1eacb3['uniqueid'],_0x4789('0x6d'),_0x2df7b1[_0x4789('0x6b')]][_0x4789('0x13')]('\x20'),'mixmonitorid':_0x2df7b1[_0x4789('0x6b')]});})[_0x4789('0x18')](function(_0x62453c){_0x49dbd7(_0x385b1f[_0x4789('0x19')](0x1f5,[_0x1eacb3[_0x4789('0x60')],_0x62453c[_0x4789('0x1e')]['toLowerCase']()][_0x4789('0x13')]('\x20')));});}else{return _0x49dbd7(_0x385b1f['error'](0x1f5,_0x4789('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0xa04ff5){var _0x47e4b1=this;return new Promise(function(_0x3dc751,_0x1f247c){if(ami[_0x4789('0xf')]()==![]){return _0x1f247c(_0x47e4b1[_0x4789('0x19')](0x1f4,[config[_0x4789('0x10')]['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')][_0x4789('0x13')]('\x20')));}var _0xb8e547=schema(properties[_0x4789('0x6f')])[_0x4789('0x3')](_0xa04ff5);if(_0xb8e547['length']>0x0){return _0x1f247c(_0x47e4b1['error'](0x1f4,_[_0x4789('0x5f')](_0xb8e547,'message')[_0x4789('0x13')](',\x20')));}var _0x34c398=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x5e')],{'uniqueid':_0xa04ff5[_0x4789('0x60')]});if(_0x34c398){return Promise[_0x4789('0x70')]()[_0x4789('0x17')](function(){if(_0x34c398[_0x4789('0x61')]){return ami['Action']({'action':_0x4789('0x71'),'channel':_0x34c398[_0x4789('0x61')],'mixmonitorid':_0xa04ff5['mixmonitorid']})[_0x4789('0x18')](function(){});}})[_0x4789('0x17')](function(){if(_0x34c398[_0x4789('0x72')]){return ami[_0x4789('0x65')]({'action':_0x4789('0x71'),'channel':_0x34c398[_0x4789('0x72')],'mixmonitorid':_0xa04ff5['mixmonitorid']})['catch'](function(){});}})[_0x4789('0x17')](function(){var _0x277b61=_[_0x4789('0x5a')](_0x34c398[_0x4789('0x67')],{'mixmonitorid':_0xa04ff5[_0x4789('0x6b')]});if(_0x277b61){_0x277b61[_0x4789('0x73')]=_0x4789('0x74');}})[_0x4789('0x17')](function(){var _0x1c5f9a=util[_0x4789('0x62')]('%s.%s',_0xa04ff5[_0x4789('0x64')]||_0xa04ff5[_0x4789('0x60')],_0xa04ff5[_0x4789('0x62')]||'wav');var _0x40d6a6=_[_0x4789('0x5a')](_0x34c398['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x1c5f9a['toLowerCase']()});if(_0x40d6a6){_0x40d6a6[_0x4789('0x73')]='stop';}})[_0x4789('0x17')](function(){_0x3dc751({'code':0xc8,'message':[_0xa04ff5[_0x4789('0x60')],_0x4789('0x75')]['join']('\x20')});})[_0x4789('0x18')](function(_0x3b00f2){_0x1f247c(_0x47e4b1['error'](0x1f5,[_0xa04ff5['uniqueid'],_0x3b00f2[_0x4789('0x1e')][_0x4789('0x69')]()]['join']('\x20')));});}else{return _0x1f247c(_0x47e4b1[_0x4789('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x3457c1){var _0x215011=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x76')]);_0x3457c1({'count':_0x215011['length'],'rows':_0x215011});});},'VoiceQueuesChannel':function(_0x16e7f8){var _0x4602b2=this;return new Promise(function(_0x327003,_0x9d5a36){var _0x538855=schema(properties[_0x4789('0x77')])[_0x4789('0x3')](_0x16e7f8);if(_0x538855[_0x4789('0x59')]>0x0){return _0x9d5a36(_0x4602b2[_0x4789('0x19')](0x1f4,_[_0x4789('0x5f')](_0x538855,_0x4789('0x1e'))[_0x4789('0x13')](',\x20')));}var _0x392387=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x76')],{'uniqueid':_0x16e7f8[_0x4789('0x60')]});if(_0x392387){_0x327003(_0x392387);}else{return _0x9d5a36(_0x4602b2['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x49921a){var _0x5191bf=this;return new Promise(function(_0x2a2a13,_0x524bc3){if(ami[_0x4789('0xf')]()==![]){return _0x524bc3(_0x5191bf[_0x4789('0x19')](0x1f4,[config[_0x4789('0x10')]['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')]['join']('\x20')));}var _0x3736ef=schema(properties[_0x4789('0x78')])[_0x4789('0x3')](_0x49921a);if(_0x3736ef[_0x4789('0x59')]>0x0){return _0x524bc3(_0x5191bf['error'](0x1f4,_['map'](_0x3736ef,'message')[_0x4789('0x13')](',\x20')));}var _0xdf9cba=_[_0x4789('0x5a')](_0x4e2393[_0x4789('0x76')],{'uniqueid':_0x49921a[_0x4789('0x60')]});if(_0xdf9cba&&_0xdf9cba[_0x4789('0x61')]){return ami[_0x4789('0x65')]({'action':_0x4789('0x79'),'channel':_0xdf9cba['channel']})[_0x4789('0x17')](function(_0x32cb0c){_0x2a2a13({'code':0xc8,'message':[_0x49921a[_0x4789('0x60')],_0x32cb0c[_0x4789('0x1e')][_0x4789('0x69')]()][_0x4789('0x13')]('\x20')});})[_0x4789('0x18')](function(_0x1ebf51){_0x524bc3(_0x5191bf[_0x4789('0x19')](0x1f5,[_0x49921a[_0x4789('0x60')],_0x1ebf51[_0x4789('0x1e')][_0x4789('0x69')]()][_0x4789('0x13')]('\x20')));});}else{return _0x524bc3(_0x5191bf['error'](0x1f5,_0x4789('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x121ca3){var _0xdfc5a1=this;return new Promise(function(_0x3a3d70,_0x29d838){if(ami[_0x4789('0xf')]()==![]){return _0x29d838(_0xdfc5a1[_0x4789('0x19')](0x1f4,[config[_0x4789('0x10')]['ip'],config[_0x4789('0x10')][_0x4789('0x11')],_0x4789('0x12')]['join']('\x20')));}var _0x234088=schema(properties[_0x4789('0x7a')])['validate'](_0x121ca3);if(_0x234088['length']>0x0){return _0x29d838(_0xdfc5a1[_0x4789('0x19')](0x1f4,_[_0x4789('0x5f')](_0x234088,_0x4789('0x1e'))[_0x4789('0x13')](',\x20')));}var _0x4712ee=_['find'](_0x4e2393[_0x4789('0x76')],{'uniqueid':_0x121ca3[_0x4789('0x60')]});if(_0x4712ee&&_0x4712ee[_0x4789('0x61')]){return ami[_0x4789('0x65')]({'action':_0x4789('0x7b'),'channel':_0x4712ee[_0x4789('0x61')],'exten':_0x121ca3['exten'],'context':_0x121ca3['context']||_0x4712ee[_0x4789('0x7c')],'priority':0x1})[_0x4789('0x17')](function(_0x1db288){_0x3a3d70({'code':0xc8,'message':[_0x121ca3[_0x4789('0x60')],_0x1db288[_0x4789('0x1e')]['toLowerCase']()][_0x4789('0x13')]('\x20')});})[_0x4789('0x18')](function(_0x1869c2){_0x29d838(_0xdfc5a1[_0x4789('0x19')](0x1f5,[_0x121ca3[_0x4789('0x60')],_0x1869c2['message'][_0x4789('0x69')]()][_0x4789('0x13')]('\x20')));});}else{return _0x29d838(_0xdfc5a1[_0x4789('0x19')](0x1f5,_0x4789('0x6e')));}});},'Agents':function(_0x196f22){return new Promise(function(_0xf60cbd){var _0x37a3fc=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0xd')]);if(_0x196f22&&_0x196f22['id']){var _0x53f9b0=_[_0x4789('0x5a')](_0x37a3fc,function(_0x1d4a0c){return _0x1d4a0c['id']===_0x196f22['id'];});_0xf60cbd(_0x53f9b0);}else{_0xf60cbd({'count':_0x37a3fc['length'],'rows':_0x37a3fc});}});},'Telephones':function(){return new Promise(function(_0x1cd80e){var _0x406902=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x7d')]);_0x1cd80e({'count':_0x406902[_0x4789('0x59')],'rows':_0x406902});});},'Trunks':function(){return new Promise(function(_0x4f89d4){var _0x2c6faf=_['values'](_0x4e2393['trunks']);_0x4f89d4({'count':_0x2c6faf['length'],'rows':_0x2c6faf});});},'OutboundChannels':function(){return new Promise(function(_0x1ba419){var _0x1dbaaf=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x7e')]);_0x1ba419({'count':_0x1dbaaf[_0x4789('0x59')],'rows':_0x1dbaaf});});},'Outbound':function(){return new Promise(function(_0x24a7ed){_0x24a7ed(_0x4e2393[_0x4789('0x7f')]);});},'Campaigns':function(){return new Promise(function(_0x42efd1){var _0x32b26f=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x80')]);_0x42efd1({'count':_0x32b26f[_0x4789('0x59')],'rows':_0x32b26f});});},'VoiceQueuesPreview':function(_0x3af7fc){var _0x3bf144=this;return new Promise(function(_0x4522e7,_0x525cea){_0x3394f6[_0x4789('0x81')](_0x3af7fc['id'])[_0x4789('0x17')](function(_0x3b62a2){_0x4522e7({'code':0xc8,'message':_0x3b62a2[_0x4789('0x1e')]});})[_0x4789('0x18')](function(_0x444aab){_0x525cea(_0x3bf144[_0x4789('0x19')](0x1f4,_0x444aab[_0x4789('0x1e')]));});});},'EventManager':function(_0x373247){var _0x35ddee=this;return new Promise(function(_0x24b13d,_0x360d78){if(!_0x373247[_0x4789('0x82')]){return _0x360d78(_0x35ddee[_0x4789('0x19')](0x1f4,_0x4789('0x83')));}ami[_0x4789('0x84')](_0x4789('0x85')+_0x373247[_0x4789('0x82')],_0x373247[_0x4789('0x1e')]);_0x24b13d({'code':0xc8,'message':_0x373247});});},'FaxAccounts':function(){return new Promise(function(_0x3f5e17){var _0x292204=_[_0x4789('0x5d')](_0x4e2393[_0x4789('0x86')]);_0x3f5e17({'count':_0x292204[_0x4789('0x59')],'rows':_0x292204});});},'SendFax':function(_0x3b8881){var _0x4b33a6=this;return new Promise(function(_0x320109,_0x12e47d){_0x4bfe85['send'](_0x3b8881)[_0x4789('0x17')](function(_0x5c5e33){_0x320109({'code':0xc8,'message':_0x5c5e33[_0x4789('0x1e')]});})[_0x4789('0x18')](function(_0x2bd683){_0x12e47d(_0x4b33a6['error'](0x1f4,_0x2bd683['message']));});});},'CheckAfterSend':function(_0x1c6f58){var _0x4595bb=this;return new Promise(function(_0x254a4f,_0x53427e){_0x4bfe85[_0x4789('0x87')](_0x1c6f58)[_0x4789('0x17')](function(_0x272ff9){_0x254a4f({'code':0xc8,'message':_0x272ff9['message']});})[_0x4789('0x18')](function(_0xd97ea5){_0x53427e(_0x4595bb[_0x4789('0x19')](0x1f4,_0xd97ea5[_0x4789('0x1e')]));});});}};var _0x3cdd30=jayson[_0x4789('0x88')](_0x114a90)[_0x4789('0x89')]();_0x3cdd30['on'](_0x4789('0x19'),function(_0x4a3b39){return _0x12ef33(_0x4a3b39);});_0x3cdd30[_0x4789('0x7')](0x232a,_0x4789('0x8a'),function(){console[_0x4789('0x8b')](_0x4789('0x8c'),0x232a);return _0x1b4e02('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x4024=['util','validate','moment','../properties','listen','%s/%s','timers','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','content','voiceQueues','hasOwnProperty','strategy','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','format','%s.%s','filename','uniqueid','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','custom:','faxAccounts','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash'];(function(_0x957193,_0x3fec8b){var _0x9473f8=function(_0x34b82b){while(--_0x34b82b){_0x957193['push'](_0x957193['shift']());}};_0x9473f8(++_0x3fec8b);}(_0x4024,0x89));var _0x4402=function(_0x227ccc,_0x500e0e){_0x227ccc=_0x227ccc-0x0;var _0x43abcf=_0x4024[_0x227ccc];return _0x43abcf;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var jayson=require('jayson/promise');var schema=require(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var config=require('../../../config/environment');var properties=require(_0x4402('0x4'));var ami=require('../ami');exports[_0x4402('0x5')]=function(_0x117f90,_0x5bdb3f,_0x4f9482){return new Promise(function(_0x17699b,_0x346ddc){var _0x168acd={'QueuePause':function(_0x4ed77d){return new Promise(function(_0x3045ae){var _0x5d7ca4=util['format'](_0x4402('0x6'),'SIP',_0x4ed77d['name']);if(_0x117f90[_0x4402('0x7')]&&_0x117f90['timers'][_0x5d7ca4]&&_0x117f90[_0x4402('0x7')][_0x5d7ca4]['timer']){_0x117f90[_0x4402('0x7')][_0x5d7ca4]['updateAcw']();}if(_0x117f90[_0x4402('0x8')][_0x5d7ca4]){_0x117f90[_0x4402('0x8')][_0x5d7ca4]['updateStatusRealtime']({'statePause':_0x4ed77d[_0x4402('0x9')]?!![]:![]});}_0x3045ae({'code':0xc8,'message':_0x4402('0xa')});});},'Reload':function(_0xa819e9){var _0x4c9032=this;return new Promise(function(_0x7e4475,_0x34d952){if(ami[_0x4402('0xb')]()==![]){return _0x34d952(_0x4c9032[_0x4402('0xc')](0x1f4,[config[_0x4402('0xd')]['ip'],config[_0x4402('0xd')][_0x4402('0xe')],_0x4402('0xf')][_0x4402('0x10')]('\x20')));}_0xa819e9=_[_0x4402('0x11')](_0xa819e9,_[_0x4402('0x12')](properties[_0x4402('0x13')]));_0xa819e9[_0x4402('0x14')]=_0x4402('0x15');return ami[_0x4402('0x16')](_0xa819e9)[_0x4402('0x17')](function(_0x399c24){_0x7e4475({'code':0xc8,'message':_0x399c24[_0x4402('0x18')]});})[_0x4402('0x19')](function(_0x231382){_0x34d952(_0x4c9032['error'](0x1f5,_0x231382['message']));});});},'Command':function(_0x663ab7){var _0x2a7afc=this;return new Promise(function(_0x5681c5,_0x756962){if(ami[_0x4402('0xb')]()==![]){return _0x756962(_0x2a7afc['error'](0x1f4,[config[_0x4402('0xd')]['ip'],config['asterisk']['username'],_0x4402('0xf')][_0x4402('0x10')]('\x20')));}_0x663ab7=_[_0x4402('0x11')](_0x663ab7,'command');_0x663ab7[_0x4402('0x14')]='Command';return ami['Action'](_0x663ab7)[_0x4402('0x17')](function(_0x275c70){_0x5681c5({'code':0xc8,'message':_0x275c70[_0x4402('0x1a')]});})[_0x4402('0x19')](function(_0x258d10){_0x756962(_0x2a7afc[_0x4402('0xc')](0x1f5,_0x258d10[_0x4402('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x6b1fc5){var _0x24a9b8=[];for(var _0x4d6846 in _0x117f90[_0x4402('0x1b')]){if(_0x117f90['voiceQueues'][_0x4402('0x1c')](_0x4d6846)){var _0x5ab28d=_0x117f90[_0x4402('0x1b')][_0x4d6846];var _0x211424={'id':_0x5ab28d['id'],'name':_0x5ab28d['name'],'strategy':_0x5ab28d[_0x4402('0x1d')],'answered':_0x5ab28d['answered'],'available':_0x5ab28d['available'],'loggedIn':_0x5ab28d[_0x4402('0x1e')],'pTalking':_0x5ab28d[_0x4402('0x1f')],'sumBillable':_0x5ab28d[_0x4402('0x20')],'sumDuration':_0x5ab28d[_0x4402('0x21')],'sumHoldTime':_0x5ab28d[_0x4402('0x22')]||0x0,'talking':_0x5ab28d['talking'],'total':_0x5ab28d[_0x4402('0x23')],'type':_0x5ab28d['type'],'unmanaged':_0x5ab28d[_0x4402('0x24')],'abandoned':_0x5ab28d[_0x4402('0x25')],'waiting':_0x5ab28d[_0x4402('0x26')],'loggedInDb':_0x5ab28d['loggedInDb']};if(_0x5ab28d[_0x4402('0x27')]===_0x4402('0x28')){_0x211424[_0x4402('0x29')]=_0x5ab28d[_0x4402('0x29')];_0x211424[_0x4402('0x2a')]=_0x5ab28d[_0x4402('0x2a')];_0x211424[_0x4402('0x2b')]=_0x5ab28d[_0x4402('0x2b')];_0x211424[_0x4402('0x2c')]=_0x5ab28d[_0x4402('0x2c')];_0x211424[_0x4402('0x2d')]=_0x5ab28d['dialOriginateTimeout'];_0x211424[_0x4402('0x2e')]=_0x5ab28d['dialPrefix'];_0x211424[_0x4402('0x2f')]=_0x5ab28d['temp'];_0x211424[_0x4402('0x30')]=_0x5ab28d[_0x4402('0x30')];_0x211424[_0x4402('0x31')]=_0x5ab28d[_0x4402('0x31')];_0x211424[_0x4402('0x32')]=_0x5ab28d['outboundBlacklistCallsDay'];_0x211424[_0x4402('0x33')]=_0x5ab28d[_0x4402('0x33')];_0x211424[_0x4402('0x34')]=_0x5ab28d['outboundCongestionCallsDay'];_0x211424[_0x4402('0x35')]=_0x5ab28d[_0x4402('0x35')];_0x211424['outboundDropCallsDayCallersExit']=_0x5ab28d[_0x4402('0x36')];_0x211424[_0x4402('0x37')]=_0x5ab28d[_0x4402('0x37')];_0x211424[_0x4402('0x38')]=_0x5ab28d[_0x4402('0x38')];_0x211424[_0x4402('0x39')]=_0x5ab28d[_0x4402('0x39')];_0x211424[_0x4402('0x3a')]=_0x5ab28d[_0x4402('0x3a')];_0x211424['outboundReCallsDay']=_0x5ab28d[_0x4402('0x3b')];_0x211424[_0x4402('0x3c')]=_0x5ab28d[_0x4402('0x3c')];_0x211424['outboundUnknownCallsDay']=_0x5ab28d[_0x4402('0x3d')];_0x211424[_0x4402('0x3e')]=_0x5ab28d['predictiveIntervalAnsweredCalls'];_0x211424['predictiveIntervalAvgHoldtime']=_0x5ab28d[_0x4402('0x3f')];_0x211424[_0x4402('0x40')]=_0x5ab28d[_0x4402('0x40')];_0x211424[_0x4402('0x41')]=_0x5ab28d['predictiveIntervalDroppedCallsCallersExit'];_0x211424['predictiveIntervalDroppedCallsTimeout']=_0x5ab28d['predictiveIntervalDroppedCallsTimeout'];_0x211424[_0x4402('0x42')]=_0x5ab28d[_0x4402('0x42')];_0x211424[_0x4402('0x43')]=_0x5ab28d[_0x4402('0x43')];_0x211424['predictiveIntervalHitRate']=_0x5ab28d[_0x4402('0x44')];_0x211424[_0x4402('0x45')]=_0x5ab28d[_0x4402('0x45')];_0x211424['predictiveIntervalPauses']=_0x5ab28d[_0x4402('0x46')];_0x211424['predictiveIntervalAvailable']=_0x5ab28d[_0x4402('0x47')];_0x211424[_0x4402('0x48')]=_0x5ab28d['predictiveIntervalTotalCalls'];_0x211424[_0x4402('0x18')]=_0x5ab28d['message'];_0x211424[_0x4402('0x49')]=_0x5ab28d[_0x4402('0x49')];_0x211424['erlangCalls']=_0x5ab28d[_0x4402('0x4a')];_0x211424[_0x4402('0x4b')]=_0x5ab28d[_0x4402('0x4b')];_0x211424[_0x4402('0x4c')]=_0x5ab28d['erlangAbandonmentRate'];_0x211424['erlangBusyFactor']=_0x5ab28d[_0x4402('0x4d')];_0x211424['startPredictive']=_0x5ab28d[_0x4402('0x4e')];_0x211424[_0x4402('0x4f')]=_0x5ab28d[_0x4402('0x4f')];}if(_0x5ab28d[_0x4402('0x50')]){_0x211424[_0x4402('0x50')]={'id':_0x5ab28d[_0x4402('0x50')]['id'],'name':_0x5ab28d[_0x4402('0x50')][_0x4402('0x51')],'active':_0x5ab28d[_0x4402('0x50')][_0x4402('0x52')],'callerid':_0x5ab28d['Trunk'][_0x4402('0x53')]};}if(_0x5ab28d[_0x4402('0x54')]){_0x211424['Interval']={'id':_0x5ab28d[_0x4402('0x54')]['id'],'name':_0x5ab28d[_0x4402('0x54')]['name']};}_0x24a9b8[_0x4402('0x55')](_0x211424);}}_0x6b1fc5({'count':_0x24a9b8[_0x4402('0x56')],'rows':_0x24a9b8});});},'UpdateVoiceQueue':function(_0x1822c8){return new Promise(function(_0x3278fc,_0x13a3a4){var _0x49c7f0=_[_0x4402('0x57')](_0x117f90[_0x4402('0x1b')],{'id':parseInt(_0x1822c8['id'])});var _0x21d34f=_[_0x4402('0x58')](_0x1822c8,['id']);if(_0x49c7f0){for(var _0x17c236 in _0x21d34f){if(typeof _0x21d34f[_0x17c236]!==_0x4402('0x59')&&typeof _0x49c7f0[_0x17c236]!==_0x4402('0x59')){_0x49c7f0[_0x17c236]=_0x21d34f[_0x17c236];}}_0x3278fc(_0x49c7f0);}else{_0x13a3a4();}});},'VoiceChannels':function(){return new Promise(function(_0x136c9c){var _0x260297=_[_0x4402('0x5a')](_0x117f90[_0x4402('0x5b')]);_0x136c9c({'count':_0x260297['length'],'rows':_0x260297});});},'VoiceChannelMixMonitor':function(_0x12a0c6){var _0x4ff240=this;return new Promise(function(_0xc45af6,_0x34ce00){if(ami['isConnected']()==![]){return _0x34ce00(_0x4ff240[_0x4402('0xc')](0x1f4,[config[_0x4402('0xd')]['ip'],config[_0x4402('0xd')][_0x4402('0xe')],_0x4402('0xf')][_0x4402('0x10')]('\x20')));}var _0x5b094b=schema(properties[_0x4402('0x5c')])[_0x4402('0x2')](_0x12a0c6);if(_0x5b094b[_0x4402('0x56')]>0x0){return _0x34ce00(_0x4ff240[_0x4402('0xc')](0x1f4,_[_0x4402('0x5d')](_0x5b094b,_0x4402('0x18'))[_0x4402('0x10')](',\x20')));}var _0x2e3934=_[_0x4402('0x57')](_0x117f90['channels'],{'uniqueid':_0x12a0c6['uniqueid']});if(_0x2e3934&&_0x2e3934['channel']){var _0x4c2d2e=util[_0x4402('0x5e')](_0x4402('0x5f'),_0x12a0c6[_0x4402('0x60')]||_0x12a0c6[_0x4402('0x61')],_0x12a0c6['format']||_0x4402('0x62'));return ami[_0x4402('0x16')]({'action':_0x4402('0x63'),'channel':_0x2e3934[_0x4402('0x64')],'file':_0x4c2d2e,'options':_0x4402('0x65')})[_0x4402('0x17')](function(_0x12f1fa){var _0x53d306=_[_0x4402('0x57')](_0x2e3934[_0x4402('0x66')],{'filename':_0x4402('0x67')+_0x4c2d2e[_0x4402('0x68')]()});if(_[_0x4402('0x69')](_0x53d306)){_0x2e3934[_0x4402('0x66')]['push']({'filename':_0x4402('0x67')+_0x4c2d2e[_0x4402('0x68')](),'createdAt':moment()[_0x4402('0x5e')](_0x4402('0x6a')),'mixmonitorid':_0x12f1fa[_0x4402('0x6b')],'status':_0x4402('0x6c')});}else{_0x53d306[_0x4402('0x6b')]=_0x12f1fa['mixmonitorid'];_0x53d306['status']=_0x4402('0x6c');}_0xc45af6({'code':0xc8,'message':[_0x12a0c6[_0x4402('0x61')],_0x4402('0x6d'),_0x12f1fa['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x12f1fa[_0x4402('0x6b')]});})[_0x4402('0x19')](function(_0x2d959f){_0x34ce00(_0x4ff240[_0x4402('0xc')](0x1f5,[_0x12a0c6[_0x4402('0x61')],_0x2d959f[_0x4402('0x18')][_0x4402('0x68')]()][_0x4402('0x10')]('\x20')));});}else{return _0x34ce00(_0x4ff240[_0x4402('0xc')](0x1f5,_0x4402('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x353679){var _0x43e876=this;return new Promise(function(_0x2d68d3,_0x4fd479){if(ami[_0x4402('0xb')]()==![]){return _0x4fd479(_0x43e876['error'](0x1f4,[config[_0x4402('0xd')]['ip'],config['asterisk'][_0x4402('0xe')],_0x4402('0xf')][_0x4402('0x10')]('\x20')));}var _0x31e36c=schema(properties[_0x4402('0x5c')])[_0x4402('0x2')](_0x353679);if(_0x31e36c['length']>0x0){return _0x4fd479(_0x43e876[_0x4402('0xc')](0x1f4,_[_0x4402('0x5d')](_0x31e36c,_0x4402('0x18'))[_0x4402('0x10')](',\x20')));}var _0xb341ab=_['find'](_0x117f90[_0x4402('0x5b')],{'uniqueid':_0x353679[_0x4402('0x61')]});if(_0xb341ab){return Promise[_0x4402('0x6f')]()[_0x4402('0x17')](function(){if(_0xb341ab[_0x4402('0x64')]){return ami[_0x4402('0x16')]({'action':_0x4402('0x70'),'channel':_0xb341ab[_0x4402('0x64')],'mixmonitorid':_0x353679['mixmonitorid']})[_0x4402('0x19')](function(){});}})[_0x4402('0x17')](function(){if(_0xb341ab['destinationchannel']){return ami[_0x4402('0x16')]({'action':_0x4402('0x70'),'channel':_0xb341ab['destinationchannel'],'mixmonitorid':_0x353679['mixmonitorid']})[_0x4402('0x19')](function(){});}})[_0x4402('0x17')](function(){var _0xa92a23=_['find'](_0xb341ab[_0x4402('0x66')],{'mixmonitorid':_0x353679[_0x4402('0x6b')]});if(_0xa92a23){_0xa92a23[_0x4402('0x71')]='stop';}})[_0x4402('0x17')](function(){var _0x41a2c6=util[_0x4402('0x5e')]('%s.%s',_0x353679[_0x4402('0x60')]||_0x353679[_0x4402('0x61')],_0x353679['format']||'wav');var _0x40869c=_['find'](_0xb341ab[_0x4402('0x66')],{'filename':_0x4402('0x67')+_0x41a2c6['toLowerCase']()});if(_0x40869c){_0x40869c['status']=_0x4402('0x72');}})[_0x4402('0x17')](function(){_0x2d68d3({'code':0xc8,'message':[_0x353679[_0x4402('0x61')],_0x4402('0x73')]['join']('\x20')});})[_0x4402('0x19')](function(_0x30e5d5){_0x4fd479(_0x43e876[_0x4402('0xc')](0x1f5,[_0x353679[_0x4402('0x61')],_0x30e5d5[_0x4402('0x18')][_0x4402('0x68')]()][_0x4402('0x10')]('\x20')));});}else{return _0x4fd479(_0x43e876['error'](0x1f5,_0x4402('0x6e')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x2ee6e8){var _0x559d1c=_['values'](_0x117f90[_0x4402('0x74')]);_0x2ee6e8({'count':_0x559d1c['length'],'rows':_0x559d1c});});},'VoiceQueuesChannel':function(_0x30569e){var _0x586689=this;return new Promise(function(_0xc2ac06,_0x10b89a){var _0x22260b=schema(properties[_0x4402('0x75')])[_0x4402('0x2')](_0x30569e);if(_0x22260b[_0x4402('0x56')]>0x0){return _0x10b89a(_0x586689[_0x4402('0xc')](0x1f4,_[_0x4402('0x5d')](_0x22260b,_0x4402('0x18'))[_0x4402('0x10')](',\x20')));}var _0x41534c=_[_0x4402('0x57')](_0x117f90[_0x4402('0x74')],{'uniqueid':_0x30569e[_0x4402('0x61')]});if(_0x41534c){_0xc2ac06(_0x41534c);}else{return _0x10b89a(_0x586689[_0x4402('0xc')](0x1f5,_0x4402('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x53e553){var _0x2ce936=this;return new Promise(function(_0x144f5f,_0xccb64f){if(ami['isConnected']()==![]){return _0xccb64f(_0x2ce936[_0x4402('0xc')](0x1f4,[config['asterisk']['ip'],config[_0x4402('0xd')][_0x4402('0xe')],_0x4402('0xf')][_0x4402('0x10')]('\x20')));}var _0x53f955=schema(properties[_0x4402('0x76')])['validate'](_0x53e553);if(_0x53f955[_0x4402('0x56')]>0x0){return _0xccb64f(_0x2ce936[_0x4402('0xc')](0x1f4,_[_0x4402('0x5d')](_0x53f955,'message')[_0x4402('0x10')](',\x20')));}var _0x4c98eb=_[_0x4402('0x57')](_0x117f90[_0x4402('0x74')],{'uniqueid':_0x53e553[_0x4402('0x61')]});if(_0x4c98eb&&_0x4c98eb[_0x4402('0x64')]){return ami[_0x4402('0x16')]({'action':_0x4402('0x77'),'channel':_0x4c98eb[_0x4402('0x64')]})[_0x4402('0x17')](function(_0x438048){_0x144f5f({'code':0xc8,'message':[_0x53e553['uniqueid'],_0x438048[_0x4402('0x18')][_0x4402('0x68')]()][_0x4402('0x10')]('\x20')});})[_0x4402('0x19')](function(_0x4734ef){_0xccb64f(_0x2ce936[_0x4402('0xc')](0x1f5,[_0x53e553[_0x4402('0x61')],_0x4734ef[_0x4402('0x18')][_0x4402('0x68')]()]['join']('\x20')));});}else{return _0xccb64f(_0x2ce936[_0x4402('0xc')](0x1f5,_0x4402('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x2eae1c){var _0x4c4845=this;return new Promise(function(_0xb5f21c,_0x59fc06){if(ami[_0x4402('0xb')]()==![]){return _0x59fc06(_0x4c4845['error'](0x1f4,[config[_0x4402('0xd')]['ip'],config[_0x4402('0xd')]['username'],_0x4402('0xf')]['join']('\x20')));}var _0x37432d=schema(properties[_0x4402('0x78')])['validate'](_0x2eae1c);if(_0x37432d[_0x4402('0x56')]>0x0){return _0x59fc06(_0x4c4845[_0x4402('0xc')](0x1f4,_['map'](_0x37432d,_0x4402('0x18'))[_0x4402('0x10')](',\x20')));}var _0x4f0915=_[_0x4402('0x57')](_0x117f90[_0x4402('0x74')],{'uniqueid':_0x2eae1c[_0x4402('0x61')]});if(_0x4f0915&&_0x4f0915[_0x4402('0x64')]){return ami[_0x4402('0x16')]({'action':_0x4402('0x79'),'channel':_0x4f0915[_0x4402('0x64')],'exten':_0x2eae1c[_0x4402('0x7a')],'context':_0x2eae1c[_0x4402('0x7b')]||_0x4f0915[_0x4402('0x7b')],'priority':0x1})[_0x4402('0x17')](function(_0xaa8da3){_0xb5f21c({'code':0xc8,'message':[_0x2eae1c[_0x4402('0x61')],_0xaa8da3[_0x4402('0x18')]['toLowerCase']()][_0x4402('0x10')]('\x20')});})[_0x4402('0x19')](function(_0x4b9ac8){_0x59fc06(_0x4c4845[_0x4402('0xc')](0x1f5,[_0x2eae1c['uniqueid'],_0x4b9ac8[_0x4402('0x18')][_0x4402('0x68')]()][_0x4402('0x10')]('\x20')));});}else{return _0x59fc06(_0x4c4845['error'](0x1f5,_0x4402('0x6e')));}});},'Agents':function(_0x26fc3a){return new Promise(function(_0x1cc008){var _0x49a55a=_[_0x4402('0x5a')](_0x117f90[_0x4402('0x8')]);if(_0x26fc3a&&_0x26fc3a['id']){var _0x179eb4=_[_0x4402('0x57')](_0x49a55a,function(_0x552498){return _0x552498['id']===_0x26fc3a['id'];});_0x1cc008(_0x179eb4);}else{_0x1cc008({'count':_0x49a55a[_0x4402('0x56')],'rows':_0x49a55a});}});},'Telephones':function(){return new Promise(function(_0x2e4433){var _0x2eb281=_[_0x4402('0x5a')](_0x117f90[_0x4402('0x7c')]);_0x2e4433({'count':_0x2eb281[_0x4402('0x56')],'rows':_0x2eb281});});},'Trunks':function(){return new Promise(function(_0x1fc38b){var _0x1db089=_[_0x4402('0x5a')](_0x117f90[_0x4402('0x7d')]);_0x1fc38b({'count':_0x1db089[_0x4402('0x56')],'rows':_0x1db089});});},'OutboundChannels':function(){return new Promise(function(_0x2fc027){var _0x6e5894=_['values'](_0x117f90[_0x4402('0x7e')]);_0x2fc027({'count':_0x6e5894[_0x4402('0x56')],'rows':_0x6e5894});});},'Outbound':function(){return new Promise(function(_0xa58643){_0xa58643(_0x117f90[_0x4402('0x28')]);});},'Campaigns':function(){return new Promise(function(_0x567bcf){var _0x58edf5=_[_0x4402('0x5a')](_0x117f90[_0x4402('0x7f')]);_0x567bcf({'count':_0x58edf5[_0x4402('0x56')],'rows':_0x58edf5});});},'VoiceQueuesPreview':function(_0x2c09ab){var _0x4bdb42=this;return new Promise(function(_0x50b57,_0x74ab5e){_0x5bdb3f['run'](_0x2c09ab['id'])[_0x4402('0x17')](function(_0x39cf58){_0x50b57({'code':0xc8,'message':_0x39cf58[_0x4402('0x18')]});})[_0x4402('0x19')](function(_0x297884){_0x74ab5e(_0x4bdb42['error'](0x1f4,_0x297884[_0x4402('0x18')]));});});},'EventManager':function(_0x1e8944){var _0x305ea1=this;return new Promise(function(_0x28d9a1,_0x27c5d7){if(!_0x1e8944[_0x4402('0x80')]){return _0x27c5d7(_0x305ea1[_0x4402('0xc')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x4402('0x81')](_0x4402('0x82')+_0x1e8944[_0x4402('0x80')],_0x1e8944[_0x4402('0x18')]);_0x28d9a1({'code':0xc8,'message':_0x1e8944});});},'FaxAccounts':function(){return new Promise(function(_0x2ea904){var _0x4e774f=_[_0x4402('0x5a')](_0x117f90[_0x4402('0x83')]);_0x2ea904({'count':_0x4e774f['length'],'rows':_0x4e774f});});},'SendFax':function(_0x2325c7){var _0x4c994a=this;return new Promise(function(_0x5bf78a,_0x364a26){_0x4f9482['send'](_0x2325c7)[_0x4402('0x17')](function(_0x520907){_0x5bf78a({'code':0xc8,'message':_0x520907['message']});})[_0x4402('0x19')](function(_0x7adf6d){_0x364a26(_0x4c994a[_0x4402('0xc')](0x1f4,_0x7adf6d[_0x4402('0x18')]));});});},'CheckAfterSend':function(_0x24bfa6){var _0x32b047=this;return new Promise(function(_0x47fe32,_0x596499){_0x4f9482[_0x4402('0x84')](_0x24bfa6)['then'](function(_0x321839){_0x47fe32({'code':0xc8,'message':_0x321839['message']});})['catch'](function(_0x1e4144){_0x596499(_0x32b047['error'](0x1f4,_0x1e4144[_0x4402('0x18')]));});});}};var _0x26e7d9=jayson[_0x4402('0x85')](_0x168acd)[_0x4402('0x86')]();_0x26e7d9['on'](_0x4402('0xc'),function(_0x5e7e0b){return _0x346ddc(_0x5e7e0b);});_0x26e7d9['listen'](0x232a,_0x4402('0x87'),function(){console[_0x4402('0x88')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x17699b(_0x4402('0x89')+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 29da8c7..5d705e3 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 _0xa4b2=['format','trigger:%s','action','merge','lodash','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','redis','localhost','info','[CM][%s][%s]','stringify','exec','data2','isNil','ListId','data3','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s'];(function(_0x397396,_0x4f2b10){var _0x3c1c53=function(_0x13e18b){while(--_0x13e18b){_0x397396['push'](_0x397396['shift']());}};_0x3c1c53(++_0x4f2b10);}(_0xa4b2,0x1da));var _0x2a4b=function(_0x165f8d,_0x38e059){_0x165f8d=_0x165f8d-0x0;var _0x984ac0=_0xa4b2[_0x165f8d];return _0x984ac0;};'use strict';var _=require(_0x2a4b('0x0'));var BPromise=require('bluebird');var Redis=require(_0x2a4b('0x1'));var util=require(_0x2a4b('0x2'));var config=require(_0x2a4b('0x3'));var logger=require('../../../../config/logger')(_0x2a4b('0x4'));var cmContactRpc=require(_0x2a4b('0x5'));config['redis']=_[_0x2a4b('0x6')](config[_0x2a4b('0x7')],{'host':_0x2a4b('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2a4b('0x7')]));function emit(_0x2d58a3,_0x35d356,_0x4c3b3f,_0x1dc0f0,_0x587d8a){logger[_0x2a4b('0x9')](_0x2a4b('0xa'),_0x2d58a3,_0x35d356['id'],_0x4c3b3f,_0x1dc0f0,JSON[_0x2a4b('0xb')](_0x587d8a));io['to'](_0x4c3b3f)['emit'](_0x1dc0f0,_0x587d8a);}exports[_0x2a4b('0xc')]=function(_0x88196e,_0x5b1f1f,_0x1db31b,_0x3186be){var _0x255d67,_0x83f9a4;var _0x45ab0b={};var _0x473a75;var _0x3cc21f=Number(_0x1db31b['data1']);var _0x1e079d=_0x1db31b['data2']?Boolean(Number(_0x1db31b[_0x2a4b('0xd')])):![];var _0x1c4ace;var _0x544636=![];if(!_[_0x2a4b('0xe')](_0x1db31b['data5'])){if(_0x1db31b['data5']=='1')_0x544636=!![];}if(!_0x544636){if(_0x3186be['xmd-contactid']){_0x45ab0b['id']=_0x3186be['xmd-contactid'];}}if(!_0x45ab0b['id']){_0x45ab0b[_0x2a4b('0xf')]=_0x3cc21f;_0x1c4ace=_0x1db31b[_0x2a4b('0x10')]&&_0x1db31b[_0x2a4b('0x10')]!=='0'?_0x1db31b[_0x2a4b('0x10')]['split'](','):[_0x2a4b('0x11')];_0x45ab0b['$or']=_[_0x2a4b('0x12')](_0x1c4ace,function(_0x2609b5){var _0x185dff={};_0x185dff[_0x2609b5]=_0x3186be[_0x2a4b('0x13')]?_0x3186be[_0x2a4b('0x14')]:_0x3186be[_0x2a4b('0x15')];return _0x185dff;});_0x473a75=_0x3186be[_0x2a4b('0x13')]?_0x3186be[_0x2a4b('0x14')]:_0x3186be[_0x2a4b('0x15')];}var _0x4a85d9=['id',_0x2a4b('0x16'),_0x2a4b('0x17'),_0x2a4b('0x11'),_0x2a4b('0x18'),_0x2a4b('0x19'),_0x2a4b('0xf'),_0x2a4b('0x1a'),'scheduledAt','updatedAt'];var _0x439c1e=_[_0x2a4b('0x1b')](_0x4a85d9,_0x1c4ace);BPromise[_0x2a4b('0x1c')]()[_0x2a4b('0x1d')](cmContactRpc['getContacts']({'attributes':_0x439c1e,'where':_0x45ab0b,'phone':_0x473a75}))[_0x2a4b('0x1d')](function(_0x317e43){_0x83f9a4=_0x317e43;if(!_['isEmpty'](_0x83f9a4)){if(_0x83f9a4[_0x2a4b('0x1e')]===0x1){_0x255d67=_0x83f9a4[0x0];logger[_0x2a4b('0x9')](_0x2a4b('0x1f'),_0x3186be[_0x2a4b('0x20')],_0x5b1f1f['id'],_0x255d67['id']);}else{logger[_0x2a4b('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x3186be[_0x2a4b('0x20')],_0x5b1f1f['id'],_[_0x2a4b('0x12')](_0x83f9a4,'id')['join'](','));}return;}else{logger[_0x2a4b('0x9')](_0x2a4b('0x21'),_0x3186be[_0x2a4b('0x20')],_0x5b1f1f['id']);var _0xf6b789={'ListId':_0x3cc21f};var _0x3a5c42=_0x1db31b[_0x2a4b('0x22')]&&_0x1db31b[_0x2a4b('0x22')]!=='0'?_0x1db31b[_0x2a4b('0x22')]:_0x2a4b('0x11');if(_0x1e079d){logger['info'](_0x2a4b('0x23'),_0x3186be['uniqueid'],_0x5b1f1f['id']);_0xf6b789[_0x3a5c42]=_[_0x2a4b('0xe')](_0x3186be[_0x2a4b('0x13')])?_0x3186be[_0x2a4b('0x15')]:_0x3186be[_0x2a4b('0x14')];if(_[_0x2a4b('0xe')](_0x3186be[_0x2a4b('0x13')])){_0xf6b789[_0x2a4b('0x16')]=_0x3186be[_0x2a4b('0x24')]&&_0x3186be[_0x2a4b('0x24')]!==_0x2a4b('0x25')?_0x3186be[_0x2a4b('0x24')]:_0x2a4b('0x26');}else{_0xf6b789[_0x2a4b('0x16')]=_0x3186be[_0x2a4b('0x27')]&&_0x3186be['destcalleridname']!==_0x2a4b('0x25')?_0x3186be[_0x2a4b('0x27')]:_0x2a4b('0x26');}return BPromise['resolve']()[_0x2a4b('0x1d')](cmContactRpc[_0x2a4b('0x28')](_0xf6b789))[_0x2a4b('0x1d')](function(_0x108cda){_0x255d67=_0x108cda;_0x83f9a4[_0x2a4b('0x29')](_0x108cda);if(_0x255d67){logger[_0x2a4b('0x9')](_0x2a4b('0x2a'),_0x3186be[_0x2a4b('0x20')],_0x5b1f1f['id'],_0x255d67['id']);}return;});}else{logger[_0x2a4b('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x3186be[_0x2a4b('0x20')],_0x5b1f1f['id']);_0xf6b789[_0x3a5c42]=_[_0x2a4b('0xe')](_0x3186be[_0x2a4b('0x13')])?_0x3186be[_0x2a4b('0x15')]:_0x3186be[_0x2a4b('0x14')];if(_[_0x2a4b('0xe')](_0x3186be[_0x2a4b('0x13')])){_0xf6b789['firstName']=_0x3186be['calleridname']&&_0x3186be[_0x2a4b('0x24')]!==_0x2a4b('0x25')?_0x3186be[_0x2a4b('0x24')]:_0x2a4b('0x26');}else{_0xf6b789['firstName']=_0x3186be[_0x2a4b('0x27')]&&_0x3186be['destcalleridname']!==_0x2a4b('0x25')?_0x3186be[_0x2a4b('0x27')]:_0x2a4b('0x26');}_0x255d67=_0xf6b789;_0x83f9a4[_0x2a4b('0x29')](_0xf6b789);return;}}})[_0x2a4b('0x1d')](function(){if(_0x88196e){emit(_0x3186be['uniqueid'],_0x5b1f1f,util['format']('user:%s',_0x88196e['name']),util[_0x2a4b('0x2b')](_0x2a4b('0x2c'),_0x1db31b[_0x2a4b('0x2d')]['toLowerCase']()),{'evt':_[_0x2a4b('0x2e')](_0x3186be,{'autoCreate':_0x1e079d}),'contact':_0x255d67===undefined?{}:_0x255d67,'contacts':_0x83f9a4[_0x2a4b('0x1e')]===0x0?undefined:_0x83f9a4});}});}; \ No newline at end of file +var _0x6680=['destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','action','lodash','bluebird','ioredis','trigger','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','resolve','then','getContacts','isEmpty','[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','calleridname','','Unknown'];(function(_0x604125,_0xade7ed){var _0x25c961=function(_0x2fad3a){while(--_0x2fad3a){_0x604125['push'](_0x604125['shift']());}};_0x25c961(++_0xade7ed);}(_0x6680,0x1f2));var _0x0668=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x6680[_0x170772];return _0x3ef69c;};'use strict';var _=require(_0x0668('0x0'));var BPromise=require(_0x0668('0x1'));var Redis=require(_0x0668('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x0668('0x3'));var cmContactRpc=require('../../rpc/cmContact');config[_0x0668('0x4')]=_[_0x0668('0x5')](config[_0x0668('0x4')],{'host':_0x0668('0x6'),'port':0x18eb});var io=require(_0x0668('0x7'))(new Redis(config[_0x0668('0x4')]));function emit(_0x4e9d20,_0x3118e4,_0x3da3c6,_0x178115,_0x272c6b){logger[_0x0668('0x8')](_0x0668('0x9'),_0x4e9d20,_0x3118e4['id'],_0x3da3c6,_0x178115,JSON['stringify'](_0x272c6b));io['to'](_0x3da3c6)['emit'](_0x178115,_0x272c6b);}exports['exec']=function(_0x5aa2d9,_0x5cfa12,_0x18ea06,_0x163f16){var _0x38b270,_0x18bffb;var _0x1720fa={};var _0x1e6767;var _0x1977f2=Number(_0x18ea06[_0x0668('0xa')]);var _0x569ec1=_0x18ea06[_0x0668('0xb')]?Boolean(Number(_0x18ea06[_0x0668('0xb')])):![];var _0x2909b9;var _0x1dd9b3=![];if(!_[_0x0668('0xc')](_0x18ea06[_0x0668('0xd')])){if(_0x18ea06['data5']=='1')_0x1dd9b3=!![];}if(!_0x1dd9b3){if(_0x163f16[_0x0668('0xe')]){_0x1720fa['id']=_0x163f16['xmd-contactid'];}}if(!_0x1720fa['id']){_0x1720fa['ListId']=_0x1977f2;_0x2909b9=_0x18ea06[_0x0668('0xf')]&&_0x18ea06[_0x0668('0xf')]!=='0'?_0x18ea06['data3'][_0x0668('0x10')](','):[_0x0668('0x11')];_0x1720fa[_0x0668('0x12')]=_['map'](_0x2909b9,function(_0x1b7551){var _0x4cac2e={};_0x4cac2e[_0x1b7551]=_0x163f16[_0x0668('0x13')]?_0x163f16[_0x0668('0x14')]:_0x163f16[_0x0668('0x15')];return _0x4cac2e;});_0x1e6767=_0x163f16['routeId']?_0x163f16['destcalleridnum']:_0x163f16[_0x0668('0x15')];}var _0x15eb84=['id',_0x0668('0x16'),_0x0668('0x17'),_0x0668('0x11'),_0x0668('0x18'),_0x0668('0x19'),'ListId',_0x0668('0x1a'),'scheduledAt','updatedAt'];var _0x251a3d=_['union'](_0x15eb84,_0x2909b9);BPromise[_0x0668('0x1b')]()[_0x0668('0x1c')](cmContactRpc[_0x0668('0x1d')]({'attributes':_0x251a3d,'where':_0x1720fa,'phone':_0x1e6767}))[_0x0668('0x1c')](function(_0x4b45e8){_0x18bffb=_0x4b45e8;if(!_[_0x0668('0x1e')](_0x18bffb)){if(_0x18bffb['length']===0x1){_0x38b270=_0x18bffb[0x0];logger['info'](_0x0668('0x1f'),_0x163f16['uniqueid'],_0x5cfa12['id'],_0x38b270['id']);}else{logger[_0x0668('0x8')](_0x0668('0x20'),_0x163f16[_0x0668('0x21')],_0x5cfa12['id'],_['map'](_0x18bffb,'id')[_0x0668('0x22')](','));}return;}else{logger[_0x0668('0x8')](_0x0668('0x23'),_0x163f16[_0x0668('0x21')],_0x5cfa12['id']);var _0x16db22={'ListId':_0x1977f2};var _0x314f59=_0x18ea06[_0x0668('0x24')]&&_0x18ea06['data4']!=='0'?_0x18ea06['data4']:_0x0668('0x11');if(_0x569ec1){logger[_0x0668('0x8')](_0x0668('0x25'),_0x163f16[_0x0668('0x21')],_0x5cfa12['id']);_0x16db22[_0x314f59]=_[_0x0668('0xc')](_0x163f16[_0x0668('0x13')])?_0x163f16[_0x0668('0x15')]:_0x163f16[_0x0668('0x14')];if(_[_0x0668('0xc')](_0x163f16['routeId'])){_0x16db22[_0x0668('0x16')]=_0x163f16[_0x0668('0x26')]&&_0x163f16['calleridname']!==_0x0668('0x27')?_0x163f16[_0x0668('0x26')]:_0x0668('0x28');}else{_0x16db22[_0x0668('0x16')]=_0x163f16[_0x0668('0x29')]&&_0x163f16[_0x0668('0x29')]!==''?_0x163f16['destcalleridname']:_0x0668('0x28');}return BPromise['resolve']()[_0x0668('0x1c')](cmContactRpc[_0x0668('0x2a')](_0x16db22))[_0x0668('0x1c')](function(_0x5845cd){_0x38b270=_0x5845cd;_0x18bffb[_0x0668('0x2b')](_0x5845cd);if(_0x38b270){logger[_0x0668('0x8')](_0x0668('0x2c'),_0x163f16['uniqueid'],_0x5cfa12['id'],_0x38b270['id']);}return;});}else{logger['info'](_0x0668('0x2d'),_0x163f16[_0x0668('0x21')],_0x5cfa12['id']);_0x16db22[_0x314f59]=_[_0x0668('0xc')](_0x163f16[_0x0668('0x13')])?_0x163f16[_0x0668('0x15')]:_0x163f16[_0x0668('0x14')];if(_[_0x0668('0xc')](_0x163f16[_0x0668('0x13')])){_0x16db22['firstName']=_0x163f16[_0x0668('0x26')]&&_0x163f16[_0x0668('0x26')]!==_0x0668('0x27')?_0x163f16[_0x0668('0x26')]:'Unknown';}else{_0x16db22[_0x0668('0x16')]=_0x163f16[_0x0668('0x29')]&&_0x163f16[_0x0668('0x29')]!==''?_0x163f16[_0x0668('0x29')]:_0x0668('0x28');}_0x38b270=_0x16db22;_0x18bffb[_0x0668('0x2b')](_0x16db22);return;}}})['then'](function(){if(_0x5aa2d9){emit(_0x163f16[_0x0668('0x21')],_0x5cfa12,util[_0x0668('0x2e')]('user:%s',_0x5aa2d9[_0x0668('0x2f')]),util['format']('trigger:%s',_0x18ea06[_0x0668('0x30')]['toLowerCase']()),{'evt':_['merge'](_0x163f16,{'autoCreate':_0x569ec1}),'contact':_0x38b270===undefined?{}:_0x38b270,'contacts':_0x18bffb['length']===0x0?undefined:_0x18bffb});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index feb2f83..55c9df8 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 _0x363e=['url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','info','stringify','emit','prototype','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','Actions','length','action','contactmanager','browser','TemplateId','data2','html','template\x20not\x20found','buildUri','isNil','data3','data4','windowWidth','800','data5','data6','600','render','user:%s','name','format','toLowerCase','trigger:%s','data1','exec','queue','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','account','ChatWebsiteId','value','upperFirst','AccountId','interaction','message','operator','agent','membername','lastevent','mailSubstatus','null','undefined','substatus','offlineMessage','created','equals','exports','util','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup'];(function(_0x2a5210,_0x3996fc){var _0x334a7e=function(_0x5207c9){while(--_0x5207c9){_0x2a5210['push'](_0x2a5210['shift']());}};_0x334a7e(++_0x3996fc);}(_0x363e,0x179));var _0xe363=function(_0x281335,_0x409a4b){_0x281335=_0x281335-0x0;var _0x3f9da7=_0x363e[_0x281335];return _0x3f9da7;};'use strict';var util=require(_0xe363('0x0'));var _=require(_0xe363('0x1'));var url=require('url');var Mustache=require(_0xe363('0x2'));var Redis=require(_0xe363('0x3'));var urlforward=require(_0xe363('0x4'));var integration=require(_0xe363('0x5'));var cmContact=require(_0xe363('0x6'));var script=require(_0xe363('0x7'));var config=require(_0xe363('0x8'));var logger=require(_0xe363('0x9'))(_0xe363('0xa'));var ami=require(_0xe363('0xb'));config[_0xe363('0xc')]=_['defaults'](config[_0xe363('0xc')],{'host':_0xe363('0xd'),'port':0x18eb});var io=require(_0xe363('0xe'))(new Redis(config[_0xe363('0xc')]));var operators={'equals':function(_0x515185,_0x24255d){return _0x515185==_0x24255d;},'not_equals':function(_0x308de7,_0x18cfa8){return _0x308de7!=_0x18cfa8;}};var barAndWebActions=[_0xe363('0xf'),_0xe363('0x10'),_0xe363('0x11')];function Trigger(_0x3304a1){this['triggers']=_0x3304a1[_0xe363('0x12')];this[_0xe363('0x13')]=_0x3304a1['agents'];this[_0xe363('0x14')]=_0x3304a1['voiceQueues'];this['templates']=_0x3304a1[_0xe363('0x15')];this[_0xe363('0x16')]=_0x3304a1[_0xe363('0x16')];this[_0xe363('0x17')]=_0x3304a1[_0xe363('0x17')];this['freshdeskAccounts']=_0x3304a1[_0xe363('0x18')];this[_0xe363('0x19')]=_0x3304a1['salesforceAccounts'];this[_0xe363('0x1a')]=_0x3304a1[_0xe363('0x1a')];this['zohoAccounts']=_0x3304a1[_0xe363('0x1b')];this[_0xe363('0x1c')]=_0x3304a1['deskAccounts'];this[_0xe363('0x1d')]=_0x3304a1[_0xe363('0x1d')];this['servicenowAccounts']=_0x3304a1[_0xe363('0x1e')];this[_0xe363('0x1f')]=_0x3304a1[_0xe363('0x1f')];this['freshsalesAccounts']=_0x3304a1[_0xe363('0x20')];this[_0xe363('0x21')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xe363('0x19')],'freshdesk':this[_0xe363('0x18')],'sugarcrm':this[_0xe363('0x1a')],'zoho':this[_0xe363('0x1b')],'desk':this[_0xe363('0x1c')],'vtiger':this[_0xe363('0x1d')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xe363('0x20')],'servicenow':this[_0xe363('0x1e')]};ami['on'](_0xe363('0x22'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x25'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x26'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x27'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x28'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x29'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x2a'),this[_0xe363('0x23')]['bind'](this));ami['on'](_0xe363('0x2b'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x2c'),this[_0xe363('0x23')]['bind'](this));ami['on'](_0xe363('0x2d'),this[_0xe363('0x23')]['bind'](this));ami['on'](_0xe363('0x2e'),this['syncCustomEvent'][_0xe363('0x24')](this));ami['on'](_0xe363('0x2f'),this['syncCustomEvent'][_0xe363('0x24')](this));ami['on'](_0xe363('0x30'),this[_0xe363('0x31')]['bind'](this));ami['on'](_0xe363('0x32'),this[_0xe363('0x31')][_0xe363('0x24')](this));ami['on'](_0xe363('0x33'),this['syncAgentDial'][_0xe363('0x24')](this));ami['on'](_0xe363('0x34'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x35'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on'](_0xe363('0x36'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xe363('0x24')](this));ami['on'](_0xe363('0x37'),this['syncCustomEvent'][_0xe363('0x24')](this));ami['on'](_0xe363('0x38'),this['syncCustomEvent'][_0xe363('0x24')](this));ami['on'](_0xe363('0x39'),this[_0xe363('0x23')][_0xe363('0x24')](this));ami['on']('custom:offlineMessage',this['syncCustomEvent'][_0xe363('0x24')](this));}Trigger['prototype']['emit']=function(_0x12f56b,_0x2b5bd0,_0x1b67e2){logger[_0xe363('0x3a')](_0x12f56b,_0x2b5bd0,JSON[_0xe363('0x3b')](_0x1b67e2));io['to'](_0x12f56b)[_0xe363('0x3c')](_0x2b5bd0,_0x1b67e2);};Trigger[_0xe363('0x3d')][_0xe363('0x23')]=function(_0x377e5e){var _0x1a3389=_[_0xe363('0x3e')](_0x377e5e);if(typeof _0x1a3389[_0xe363('0x3f')]==='undefined'){_0x1a3389['motionChannel']=_0xe363('0x40');}this[_0xe363('0x41')](_0x1a3389);};Trigger[_0xe363('0x3d')]['syncAgentDial']=function(_0x534039){if(this[_0xe363('0x13')][_0x534039[_0xe363('0x42')]]){this[_0xe363('0x23')](_0x534039);}};Trigger[_0xe363('0x3d')]['checkTriggers']=function(_0x299168){var _0x49b8c4;for(var _0x1aa63a in this[_0xe363('0x12')]){if(this[_0xe363('0x12')][_0xe363('0x43')](_0x1aa63a)){if(this[_0xe363('0x12')][_0x1aa63a][_0xe363('0x44')]){_0x49b8c4=this[_0xe363('0x45')](this[_0xe363('0x12')][_0x1aa63a],_0x299168);if(_0x49b8c4){_[_0xe363('0x46')](_0x299168,_0x299168['variables']);for(var _0x52fc17=0x0,_0x3ddc38,_0x44be85,_0xc7d891;_0x52fc170x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x736ef1,_0x483f7f){var _0x3e252a=function(_0x5e6699){while(--_0x5e6699){_0x736ef1['push'](_0x736ef1['shift']());}};_0x3e252a(++_0x483f7f);}(_0x814b,0x1a2));var _0xb814=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x814b[_0x3a833e];return _0xdff445;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_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 diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index a3799b9..55319da 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 _0xcfad=['incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','queue','callDirection','phonecalls','headers','format','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','data5','POST','username','password','clientSecret','access_token','catch','error','toUpperCase','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','destcalleridnum','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','outbound','calleridnum','telephone1','GET','&$filter=','\x20eq\x20\x27','replace','%2b','value','contactid','nothing','string','picklist','nameField','customField','idField','indexOf','incident'];(function(_0x4d70bf,_0x1f4c68){var _0x45eaeb=function(_0x29bef6){while(--_0x29bef6){_0x4d70bf['push'](_0x4d70bf['shift']());}};_0x45eaeb(++_0x1f4c68);}(_0xcfad,0x93));var _0xdcfa=function(_0x5152ea,_0x446cab){_0x5152ea=_0x5152ea-0x0;var _0x57f461=_0xcfad[_0x5152ea];return _0x57f461;};'use strict';var _=require(_0xdcfa('0x0'));var rp=require(_0xdcfa('0x1'));var util=require(_0xdcfa('0x2'));var intUtil=require(_0xdcfa('0x3'));var md5=require(_0xdcfa('0x4'));var Redis=require(_0xdcfa('0x5'));var logger=require(_0xdcfa('0x6'))(_0xdcfa('0x7'));var config=require('../../../../config/environment');config[_0xdcfa('0x8')]=_[_0xdcfa('0x9')](config['redis'],{'host':_0xdcfa('0xa'),'port':0x18eb});var io=require(_0xdcfa('0xb'))(new Redis(config[_0xdcfa('0x8')]));function getAuthToken(_0x3b964a,_0x2ef084,_0x193af5){if(_0x3b964a[_0xdcfa('0xc')]){_0x3b964a[_0xdcfa('0xd')]=_0x3b964a[_0xdcfa('0xe')]['data7'];_0x3b964a[_0xdcfa('0xf')]=_0x3b964a['CloudProvider'][_0xdcfa('0x10')];return Promise['resolve'](_0x3b964a[_0xdcfa('0xe')][_0xdcfa('0x11')]);}var _0x3ffdaf={'method':_0xdcfa('0x12'),'uri':_0x2ef084,'form':{'client_id':_0x3b964a['clientId'],'resource':_0x3b964a['remoteUri'],'username':_0x3b964a[_0xdcfa('0x13')],'password':_0x3b964a[_0xdcfa('0x14')],'grant_type':_0xdcfa('0x14'),'client_secret':_0x3b964a[_0xdcfa('0x15')]},'json':!![]};return rp(_0x3ffdaf)['then'](function(_0x57f825){return _0x57f825[_0xdcfa('0x16')];})[_0xdcfa('0x17')](function(_0x3d41be){logger[_0xdcfa('0x18')]('['+[_0x193af5[_0xdcfa('0x19')]()]+']\x20Wrong\x20credentials!');return _0x3d41be[_0xdcfa('0x1a')];});}function getUser(_0x4c3780,_0x3d5571,_0x17273a,_0x16ea6d,_0x4502ae,_0x4d8aa4){return new Promise(function(_0x312151,_0xa54b13){return getAuthToken(_0x3d5571,_0x16ea6d,_0x4d8aa4)[_0xdcfa('0x1b')](function(_0x359b36){var _0x2a413a={'method':'GET','uri':_0x4502ae+_0xdcfa('0x1c'),'headers':{'Authorization':_0xdcfa('0x1d')+_0x359b36,'OData-Version':_0xdcfa('0x1e')},'json':!![]};return rp(_0x2a413a);})[_0xdcfa('0x1b')](function(_0x44af8e){var _0x409152=_0x44af8e['value'];var _0x2a7f2b=![];var _0x114182=null;if(!_[_0xdcfa('0x1f')](_0x17273a)){if(intUtil['validateEmail'](_0x17273a[_0xdcfa('0x20')])){_0x4c3780[_0xdcfa('0x21')]=_0x17273a[_0xdcfa('0x20')];for(_0x114182=0x0;_0x114182<_0x409152[_0xdcfa('0x22')];_0x114182++){if(_0x409152[_0x114182][_0xdcfa('0x23')]===_0x17273a[_0xdcfa('0x20')]&&!_0x409152[_0x114182][_0xdcfa('0x24')]){_0x2a7f2b=!![];logger[_0xdcfa('0x25')]('['+[_0x4d8aa4[_0xdcfa('0x19')]()]+_0xdcfa('0x26')+_0x409152[_0x114182][_0xdcfa('0x27')]+'!');_0x4c3780[_0xdcfa('0x28')]=_0x409152[_0x114182][_0xdcfa('0x27')];}}}}if(!_0x2a7f2b){logger['info']('['+[_0x4d8aa4[_0xdcfa('0x19')]()]+_0xdcfa('0x29'));_0x4c3780['userEmail']=_0x3d5571[_0xdcfa('0x13')];for(_0x114182=0x0;_0x114182<_0x409152[_0xdcfa('0x22')];_0x114182++){if(_0x409152[_0x114182]['internalemailaddress']===_0x3d5571[_0xdcfa('0x13')]){_0x4c3780[_0xdcfa('0x28')]=_0x409152[_0x114182][_0xdcfa('0x27')];}}}_0x312151(_0x4c3780);})[_0xdcfa('0x17')](function(_0x24be9a){_0xa54b13(_0x24be9a[_0xdcfa('0x1a')]);});});}function createEndUser(_0x59d6dc,_0x2a4441,_0x410ebb,_0x3946de,_0x41fcad,_0xf29097,_0x290e30){return new Promise(function(_0x1c974f,_0x3e2c77){return getAuthToken(_0x2a4441,_0x410ebb,_0xf29097)[_0xdcfa('0x1b')](function(_0x3aa99c){var _0x28ed69=_0xf29097['toLowerCase']()==='outbound'?_0x41fcad[_0xdcfa('0x2a')]:_0x41fcad['calleridnum'];var _0x3b1470={'method':_0xdcfa('0x12'),'uri':_0x3946de+'contacts','body':{'fullname':_0x28ed69,'firstname':_0x28ed69,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xdcfa('0x2b')+_0x59d6dc[_0xdcfa('0x28')]+')'},'headers':{'Authorization':_0xdcfa('0x1d')+_0x3aa99c,'OData-Version':_0xdcfa('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x3b1470['body'][_0x290e30]=_0x28ed69;return rp(_0x3b1470);})['then'](function(_0x2ae71d){var _0x54a813=_0x2ae71d['headers'][_0xdcfa('0x2c')];var _0x242a2b=_0x54a813[_0xdcfa('0x2d')](_0x54a813[_0xdcfa('0x2e')]('(')+0x1,_0x54a813[_0xdcfa('0x2e')](')'));_0x59d6dc[_0xdcfa('0x2f')]=_0x242a2b;_0x1c974f(_0x59d6dc);})['catch'](function(_0x3fb4a3){_0x3e2c77(_0x3fb4a3['message']);});});}function getEndUser(_0x5b2058,_0x1cc53b,_0x25d89d,_0x2734c5,_0x4bc41f,_0x41e9cd,_0x523188,_0xeb6b16){var _0x5519d3=_0x41e9cd[_0xdcfa('0x30')]()===_0xdcfa('0x31')?_0x4bc41f['destcalleridnum']:_0x4bc41f[_0xdcfa('0x32')];return getAuthToken(_0x1cc53b,_0x25d89d,_0x41e9cd)['then'](function(_0x416bd1){_0xeb6b16=_0xeb6b16?_0xeb6b16:_0xdcfa('0x33');var _0x32aba4={'method':_0xdcfa('0x34'),'uri':_0x2734c5+'contacts?$select='+_0xeb6b16+_0xdcfa('0x35')+_0xeb6b16+_0xdcfa('0x36')+_0x5519d3[_0xdcfa('0x37')]('+',_0xdcfa('0x38'))+'\x27','headers':{'Authorization':_0xdcfa('0x1d')+_0x416bd1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x32aba4);})['then'](function(_0x5c28b8){var _0x4f5130=![];if(!_0x5c28b8)return _0x4f5130;var _0x3b7a4c=_0x5c28b8[_0xdcfa('0x39')];for(var _0x46a882=0x0;_0x46a882<_0x3b7a4c[_0xdcfa('0x22')];_0x46a882++){if(_0x3b7a4c[_0x46a882][_0xeb6b16]===_0x5519d3){_0x4f5130=!![];_0x5b2058['enduserId']=_0x3b7a4c[_0x46a882][_0xdcfa('0x3a')];}}return _0x4f5130;})[_0xdcfa('0x1b')](function(_0x101295){if(_0x101295)return _0x5b2058;if(_0x523188===_0xdcfa('0x3b')){logger[_0xdcfa('0x25')]('['+[_0x41e9cd[_0xdcfa('0x19')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x5b2058;}return createEndUser(_0x5b2058,_0x1cc53b,_0x25d89d,_0x2734c5,_0x4bc41f,_0x41e9cd,_0xeb6b16)[_0xdcfa('0x1b')](function(_0x318896){logger[_0xdcfa('0x25')]('['+[_0x41e9cd['toUpperCase']()]+']\x20Enduser\x20created!',_0x318896[_0xdcfa('0x2f')]);return _0x318896;});});}function getCustomFields(_0x42830a,_0x340127,_0x2e760c){var _0x5ab74b={};if(_0x42830a[_0xdcfa('0x22')]>0x0){_['forEach'](_0x42830a,function(_0x2301e3){if(_['includes']([_0xdcfa('0x3c'),_0xdcfa('0x3d')],_0x2301e3['type'])&&_0x2301e3[_0xdcfa('0x3e')]&&!_0x2301e3[_0xdcfa('0x3f')]){var _0x13080b=_0x2301e3[_0xdcfa('0x40')][_0xdcfa('0x30')]();var _0x386bd2=_0x13080b[_0xdcfa('0x2d')](0x0,_0x13080b[_0xdcfa('0x41')]('_'));var _0x161689=_0x13080b['substring'](_0x13080b['indexOf']('_')+0x1);if(_0x386bd2===_0x2e760c){_0x5ab74b[_0x161689]=_0x2301e3['content'];}}});}return _0x5ab74b;}function getTicket(_0x2a8507,_0x23e9e7,_0x4ebc01,_0x33fd95,_0x33325a,_0x244a16,_0xdbd487){return new Promise(function(_0x3c51ee,_0xfa2e16){var _0xe74866;return getAuthToken(_0x23e9e7,_0x4ebc01,_0xdbd487)[_0xdcfa('0x1b')](function(_0x31e133){if(_0x244a16['ticketType']===_0xdcfa('0x42')){_0xe74866={'method':_0xdcfa('0x12'),'uri':_0x33fd95+_0xdcfa('0x43'),'body':Object[_0xdcfa('0x44')]({},{'title':intUtil['getString'](_0x244a16[_0xdcfa('0x45')],_0x33325a,'\x20'),'description':intUtil[_0xdcfa('0x46')](_0x244a16[_0xdcfa('0x47')],_0x33325a,'\x0a'),'customerid_contact@odata.bind':_0x2a8507[_0xdcfa('0x2f')]?_0xdcfa('0x48')+_0x2a8507[_0xdcfa('0x2f')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2a8507[_0xdcfa('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x244a16[_0xdcfa('0x49')],_0x33325a,_0x244a16[_0xdcfa('0x4a')])),'headers':{'Authorization':_0xdcfa('0x1d')+_0x31e133,'OData-Version':_0xdcfa('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x244a16['ticketType']===_0xdcfa('0x4b')){var _0x2308fa=_0x2a8507[_0xdcfa('0x2f')]?[{'partyid_systemuser@odata.bind':_0xdcfa('0x2b')+_0x2a8507[_0xdcfa('0x28')]+')','participationtypemask':_0x2a8507['callDirection']===_0xdcfa('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0xdcfa('0x48')+_0x2a8507[_0xdcfa('0x2f')]+')','participationtypemask':_0x2a8507[_0xdcfa('0x4d')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xdcfa('0x2b')+_0x2a8507[_0xdcfa('0x28')]+')','participationtypemask':_0x2a8507['callDirection']==='queue'?0x2:0x1}];_0xe74866={'method':'POST','uri':_0x33fd95+_0xdcfa('0x4e'),'body':Object[_0xdcfa('0x44')]({},{'subject':intUtil['getString'](_0x244a16[_0xdcfa('0x45')],_0x33325a,'\x20'),'phonenumber':String(_0x33325a[_0xdcfa('0x32')]),'description':intUtil[_0xdcfa('0x46')](_0x244a16['Descriptions'],_0x33325a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2a8507[_0xdcfa('0x2f')]?_0xdcfa('0x48')+_0x2a8507['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2a8507[_0xdcfa('0x28')]+')','directioncode':_0x2a8507[_0xdcfa('0x4d')]===_0xdcfa('0x4c')?![]:!![],'phonecall_activity_parties':_0x2308fa},getCustomFields(_0x244a16['Fields'],_0x33325a,_0x244a16['ticketType'])),'headers':{'Authorization':_0xdcfa('0x1d')+_0x31e133,'OData-Version':_0xdcfa('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xe74866);})[_0xdcfa('0x1b')](function(_0x22b669){var _0x1da11e=_0x22b669[_0xdcfa('0x4f')][_0xdcfa('0x2c')];var _0x2fef95=_0x1da11e[_0xdcfa('0x2d')](_0x1da11e[_0xdcfa('0x2e')]('(')+0x1,_0x1da11e[_0xdcfa('0x2e')](')'));_0x2a8507['ticketId']=_0x2fef95;_0x3c51ee(_0x2a8507);})['catch'](function(_0x707e44){_0xfa2e16(_0x707e44[_0xdcfa('0x1a')]);});});}function emit(_0x774511,_0x4df8a0,_0x2c9490,_0x197391){var _0x4d1718={'uri':util[_0xdcfa('0x50')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x774511,_0x2c9490,_0x197391)};io['to'](util['format']('user:%s',_0x4df8a0))[_0xdcfa('0x51')](_0xdcfa('0x52'),_0x4d1718);}exports['cs']=function(_0x14bf04,_0xae41d2,_0x3b71a0,_0x20ccc7,_0x1b5836,_0x179a6f,_0x502152,_0xb7dce5){var _0x5c300a={};_0x179a6f[_0xdcfa('0xd')]=_0x179a6f[_0xdcfa('0xc')]?intUtil[_0xdcfa('0x53')](_0x179a6f[_0xdcfa('0xe')][_0xdcfa('0x54')]):intUtil['stripTrailingSlash'](_0x179a6f[_0xdcfa('0xd')]);_0x179a6f[_0xdcfa('0x55')]=intUtil[_0xdcfa('0x53')](_0x179a6f[_0xdcfa('0x55')]);_0x5c300a[_0xdcfa('0x4d')]=_0xb7dce5===_0xdcfa('0x4c')||_0xb7dce5==='unmanaged'?_0xdcfa('0x4c'):_0xdcfa('0x31');var _0x306c3c=_0x179a6f[_0xdcfa('0xc')]?util[_0xdcfa('0x50')](_0xdcfa('0x56'),_0x179a6f['CloudProvider']['data7']):util[_0xdcfa('0x50')](_0xdcfa('0x56'),_0x179a6f['remoteUri']);var _0x1cf02c=util[_0xdcfa('0x50')]('https://login.microsoftonline.com/%s/oauth2/token',_0x179a6f[_0xdcfa('0xf')]);var _0x16319b=util[_0xdcfa('0x50')](_0xdcfa('0x57'),_0x179a6f[_0xdcfa('0x55')],_0xae41d2[_0xdcfa('0x58')],md5(_0xae41d2[_0xdcfa('0x58')]));if(_0x1b5836&&_0x1b5836[_0xdcfa('0x59')]){logger[_0xdcfa('0x25')](_0xdcfa('0x5a'),'Recording\x20is\x20enabled!');_0xae41d2[_0xdcfa('0x5b')]=_0x16319b;}else if(_0x502152&&_0x502152[_0xdcfa('0x5c')]&&_0x502152[_0xdcfa('0x5c')]!==_0xdcfa('0x5d')){logger[_0xdcfa('0x25')](_0xdcfa('0x5e'),_0xdcfa('0x5f'));_0xae41d2[_0xdcfa('0x5b')]=_0x16319b;}else{_0xae41d2['recordingURL']='';}return getUser(_0x5c300a,_0x179a6f,_0x20ccc7,_0x1cf02c,_0x306c3c,_0xb7dce5)[_0xdcfa('0x1b')](function(_0x3a2f5a){logger[_0xdcfa('0x25')]('['+_0xb7dce5[_0xdcfa('0x19')]()+_0xdcfa('0x60'),_0x3a2f5a['userId']);logger['info']('['+_0xb7dce5['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x3a2f5a[_0xdcfa('0x21')]);return getEndUser(_0x3a2f5a,_0x179a6f,_0x1cf02c,_0x306c3c,_0xae41d2,_0xb7dce5,_0x3b71a0[_0xdcfa('0x61')],_0x3b71a0[_0xdcfa('0x62')]);})[_0xdcfa('0x1b')](function(_0x5b348d){logger['info']('['+_0xb7dce5['toUpperCase']()+_0xdcfa('0x63'),_0x5b348d[_0xdcfa('0x2f')]);logger['info']('['+_0xb7dce5[_0xdcfa('0x19')]()+_0xdcfa('0x64'),_0xae41d2['calleridnum']);return getTicket(_0x5b348d,_0x179a6f,_0x1cf02c,_0x306c3c,_0xae41d2,_0x3b71a0,_0xb7dce5);})[_0xdcfa('0x1b')](function(_0x7e5d2e){logger['info'](util[_0xdcfa('0x50')]('['+_0xb7dce5[_0xdcfa('0x19')]()+_0xdcfa('0x65'),_0x3b71a0[_0xdcfa('0x4a')],_0x7e5d2e[_0xdcfa('0x66')]));logger[_0xdcfa('0x25')](util[_0xdcfa('0x50')]('['+_0xb7dce5[_0xdcfa('0x19')]()+']\x20Call\x20direction:\x20%s',_0xb7dce5));if(_0xb7dce5!==_0xdcfa('0x67')&&_0x3b71a0[_0xdcfa('0x68')]){logger[_0xdcfa('0x25')]('['+_0xb7dce5[_0xdcfa('0x19')]()+']',_0xdcfa('0x69'));emit(_0x179a6f[_0xdcfa('0xd')],_0x20ccc7[_0xdcfa('0x6a')],_0x3b71a0[_0xdcfa('0x4a')],_0x7e5d2e[_0xdcfa('0x66')]);}})[_0xdcfa('0x17')](function(_0x42b418){logger[_0xdcfa('0x18')]('['+_0xb7dce5[_0xdcfa('0x19')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x42b418[_0xdcfa('0x1a')]);console[_0xdcfa('0x18')]('Error\x20running\x20Dynamics365\x20integration',_0x42b418);});}; \ No newline at end of file +var _0x7807=['queue','phonecalls','assign','Fields','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','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\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','tenantId','CloudProvider','data2','data5','clientId','username','password','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','catch','toLowerCase','outbound','calleridnum','POST','contacts','/systemusers(','body','headers','substring','lastIndexOf','enduserId','destcalleridnum','GET','&$filter=','\x20eq\x20\x27','replace','contactid','nothing','forEach','includes','string','picklist','nameField','customField','idField','indexOf','content','ticketType','incidents','getString','Subjects','Descriptions','/contacts(','phonecall','callDirection'];(function(_0x2d3c9b,_0x1126ea){var _0x2eff35=function(_0x2478d5){while(--_0x2478d5){_0x2d3c9b['push'](_0x2d3c9b['shift']());}};_0x2eff35(++_0x1126ea);}(_0x7807,0x176));var _0x7780=function(_0x34461b,_0x566563){_0x34461b=_0x34461b-0x0;var _0x5c1d4b=_0x7807[_0x34461b];return _0x5c1d4b;};'use strict';var _=require(_0x7780('0x0'));var rp=require(_0x7780('0x1'));var util=require(_0x7780('0x2'));var intUtil=require(_0x7780('0x3'));var md5=require('md5');var Redis=require(_0x7780('0x4'));var logger=require(_0x7780('0x5'))(_0x7780('0x6'));var config=require('../../../../config/environment');config[_0x7780('0x7')]=_[_0x7780('0x8')](config[_0x7780('0x7')],{'host':_0x7780('0x9'),'port':0x18eb});var io=require(_0x7780('0xa'))(new Redis(config[_0x7780('0x7')]));function getAuthToken(_0x578537,_0x2bd2b7,_0x545883){if(_0x578537[_0x7780('0xb')]){_0x578537[_0x7780('0xc')]=_0x578537['CloudProvider'][_0x7780('0xd')];_0x578537[_0x7780('0xe')]=_0x578537[_0x7780('0xf')][_0x7780('0x10')];return Promise['resolve'](_0x578537[_0x7780('0xf')][_0x7780('0x11')]);}var _0x2cef08={'method':'POST','uri':_0x2bd2b7,'form':{'client_id':_0x578537[_0x7780('0x12')],'resource':_0x578537[_0x7780('0xc')],'username':_0x578537[_0x7780('0x13')],'password':_0x578537[_0x7780('0x14')],'grant_type':_0x7780('0x14'),'client_secret':_0x578537['clientSecret']},'json':!![]};return rp(_0x2cef08)['then'](function(_0x51d860){return _0x51d860[_0x7780('0x15')];})['catch'](function(_0x4420ca){logger[_0x7780('0x16')]('['+[_0x545883[_0x7780('0x17')]()]+_0x7780('0x18'));return _0x4420ca[_0x7780('0x19')];});}function getUser(_0x5a921d,_0xfa2131,_0x531ac3,_0x41f448,_0x11f7cf,_0x1eaa12){return new Promise(function(_0x343992,_0x360328){return getAuthToken(_0xfa2131,_0x41f448,_0x1eaa12)[_0x7780('0x1a')](function(_0x37bd28){var _0x16f8e0={'method':'GET','uri':_0x11f7cf+_0x7780('0x1b'),'headers':{'Authorization':_0x7780('0x1c')+_0x37bd28,'OData-Version':_0x7780('0x1d')},'json':!![]};return rp(_0x16f8e0);})[_0x7780('0x1a')](function(_0x59b5d5){var _0x253998=_0x59b5d5[_0x7780('0x1e')];var _0x45a702=![];var _0x20a01c=null;if(!_[_0x7780('0x1f')](_0x531ac3)){if(intUtil[_0x7780('0x20')](_0x531ac3[_0x7780('0x21')])){_0x5a921d['userEmail']=_0x531ac3[_0x7780('0x21')];for(_0x20a01c=0x0;_0x20a01c<_0x253998[_0x7780('0x22')];_0x20a01c++){if(_0x253998[_0x20a01c][_0x7780('0x23')]===_0x531ac3[_0x7780('0x21')]&&!_0x253998[_0x20a01c]['isdisabled']){_0x45a702=!![];logger['info']('['+[_0x1eaa12[_0x7780('0x17')]()]+_0x7780('0x24')+_0x253998[_0x20a01c][_0x7780('0x25')]+'!');_0x5a921d[_0x7780('0x26')]=_0x253998[_0x20a01c][_0x7780('0x25')];}}}}if(!_0x45a702){logger[_0x7780('0x27')]('['+[_0x1eaa12[_0x7780('0x17')]()]+_0x7780('0x28'));_0x5a921d[_0x7780('0x29')]=_0xfa2131['username'];for(_0x20a01c=0x0;_0x20a01c<_0x253998[_0x7780('0x22')];_0x20a01c++){if(_0x253998[_0x20a01c][_0x7780('0x23')]===_0xfa2131['username']){_0x5a921d[_0x7780('0x26')]=_0x253998[_0x20a01c]['systemuserid'];}}}_0x343992(_0x5a921d);})[_0x7780('0x2a')](function(_0x40aecb){_0x360328(_0x40aecb[_0x7780('0x19')]);});});}function createEndUser(_0x1a21d4,_0x2ca454,_0x348112,_0x54738b,_0x44ead2,_0x5d5543,_0x215333){return new Promise(function(_0x3bb0ed,_0x2fd97e){return getAuthToken(_0x2ca454,_0x348112,_0x5d5543)[_0x7780('0x1a')](function(_0x1c4047){var _0x39b397=_0x5d5543[_0x7780('0x2b')]()===_0x7780('0x2c')?_0x44ead2['destcalleridnum']:_0x44ead2[_0x7780('0x2d')];var _0x47f719={'method':_0x7780('0x2e'),'uri':_0x54738b+_0x7780('0x2f'),'body':{'fullname':_0x39b397,'firstname':_0x39b397,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7780('0x30')+_0x1a21d4[_0x7780('0x26')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x1c4047,'OData-Version':_0x7780('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x47f719[_0x7780('0x31')][_0x215333]=_0x39b397;return rp(_0x47f719);})['then'](function(_0x3fc8e7){var _0x4df68f=_0x3fc8e7[_0x7780('0x32')]['odata-entityid'];var _0x476c54=_0x4df68f[_0x7780('0x33')](_0x4df68f['lastIndexOf']('(')+0x1,_0x4df68f[_0x7780('0x34')](')'));_0x1a21d4[_0x7780('0x35')]=_0x476c54;_0x3bb0ed(_0x1a21d4);})[_0x7780('0x2a')](function(_0xec5ff7){_0x2fd97e(_0xec5ff7['message']);});});}function getEndUser(_0x43e9ba,_0x1367c8,_0x246080,_0x5c384,_0x5c4b05,_0x389fd2,_0x16c69a,_0x35237a){var _0x27eabb=_0x389fd2[_0x7780('0x2b')]()===_0x7780('0x2c')?_0x5c4b05[_0x7780('0x36')]:_0x5c4b05[_0x7780('0x2d')];return getAuthToken(_0x1367c8,_0x246080,_0x389fd2)[_0x7780('0x1a')](function(_0x5d3e1f){_0x35237a=_0x35237a?_0x35237a:'telephone1';var _0x4a8747={'method':_0x7780('0x37'),'uri':_0x5c384+'contacts?$select='+_0x35237a+_0x7780('0x38')+_0x35237a+_0x7780('0x39')+_0x27eabb[_0x7780('0x3a')]('+','%2b')+'\x27','headers':{'Authorization':_0x7780('0x1c')+_0x5d3e1f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4a8747);})[_0x7780('0x1a')](function(_0x118860){var _0x8f630f=![];if(!_0x118860)return _0x8f630f;var _0x46f4ee=_0x118860['value'];for(var _0x3526ec=0x0;_0x3526ec<_0x46f4ee[_0x7780('0x22')];_0x3526ec++){if(_0x46f4ee[_0x3526ec][_0x35237a]===_0x27eabb){_0x8f630f=!![];_0x43e9ba[_0x7780('0x35')]=_0x46f4ee[_0x3526ec][_0x7780('0x3b')];}}return _0x8f630f;})[_0x7780('0x1a')](function(_0x40be73){if(_0x40be73)return _0x43e9ba;if(_0x16c69a===_0x7780('0x3c')){logger[_0x7780('0x27')]('['+[_0x389fd2['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x43e9ba;}return createEndUser(_0x43e9ba,_0x1367c8,_0x246080,_0x5c384,_0x5c4b05,_0x389fd2,_0x35237a)[_0x7780('0x1a')](function(_0x4ba323){logger[_0x7780('0x27')]('['+[_0x389fd2[_0x7780('0x17')]()]+']\x20Enduser\x20created!',_0x4ba323['enduserId']);return _0x4ba323;});});}function getCustomFields(_0x3cfc51,_0x3aa4fd,_0x3f7b94){var _0x471cf3={};if(_0x3cfc51[_0x7780('0x22')]>0x0){_[_0x7780('0x3d')](_0x3cfc51,function(_0x33f42a){if(_[_0x7780('0x3e')]([_0x7780('0x3f'),_0x7780('0x40')],_0x33f42a['type'])&&_0x33f42a[_0x7780('0x41')]&&!_0x33f42a[_0x7780('0x42')]){var _0x3fdffe=_0x33f42a[_0x7780('0x43')]['toLowerCase']();var _0x36441f=_0x3fdffe['substring'](0x0,_0x3fdffe['indexOf']('_'));var _0x417a93=_0x3fdffe[_0x7780('0x33')](_0x3fdffe[_0x7780('0x44')]('_')+0x1);if(_0x36441f===_0x3f7b94){_0x471cf3[_0x417a93]=_0x33f42a[_0x7780('0x45')];}}});}return _0x471cf3;}function getTicket(_0x47cc37,_0x59cde,_0x166c46,_0x1057cc,_0x554a39,_0x5bab7d,_0x4dfe66){return new Promise(function(_0x2b781e,_0x44aa60){var _0x22df89;return getAuthToken(_0x59cde,_0x166c46,_0x4dfe66)[_0x7780('0x1a')](function(_0x456230){if(_0x5bab7d[_0x7780('0x46')]==='incident'){_0x22df89={'method':'POST','uri':_0x1057cc+_0x7780('0x47'),'body':Object['assign']({},{'title':intUtil[_0x7780('0x48')](_0x5bab7d[_0x7780('0x49')],_0x554a39,'\x20'),'description':intUtil[_0x7780('0x48')](_0x5bab7d[_0x7780('0x4a')],_0x554a39,'\x0a'),'customerid_contact@odata.bind':_0x47cc37[_0x7780('0x35')]?_0x7780('0x4b')+_0x47cc37[_0x7780('0x35')]+')':undefined,'ownerid@odata.bind':_0x7780('0x30')+_0x47cc37['userId']+')','caseorigincode':'1'},getCustomFields(_0x5bab7d['Fields'],_0x554a39,_0x5bab7d[_0x7780('0x46')])),'headers':{'Authorization':_0x7780('0x1c')+_0x456230,'OData-Version':_0x7780('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5bab7d['ticketType']===_0x7780('0x4c')){var _0x5478c0=_0x47cc37['enduserId']?[{'partyid_systemuser@odata.bind':_0x7780('0x30')+_0x47cc37[_0x7780('0x26')]+')','participationtypemask':_0x47cc37[_0x7780('0x4d')]===_0x7780('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0x7780('0x4b')+_0x47cc37[_0x7780('0x35')]+')','participationtypemask':_0x47cc37[_0x7780('0x4d')]===_0x7780('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x47cc37[_0x7780('0x26')]+')','participationtypemask':_0x47cc37[_0x7780('0x4d')]===_0x7780('0x4e')?0x2:0x1}];_0x22df89={'method':'POST','uri':_0x1057cc+_0x7780('0x4f'),'body':Object[_0x7780('0x50')]({},{'subject':intUtil[_0x7780('0x48')](_0x5bab7d[_0x7780('0x49')],_0x554a39,'\x20'),'phonenumber':String(_0x554a39[_0x7780('0x2d')]),'description':intUtil[_0x7780('0x48')](_0x5bab7d[_0x7780('0x4a')],_0x554a39,'\x0a'),'regardingobjectid_contact@odata.bind':_0x47cc37[_0x7780('0x35')]?_0x7780('0x4b')+_0x47cc37[_0x7780('0x35')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x47cc37['userId']+')','directioncode':_0x47cc37[_0x7780('0x4d')]===_0x7780('0x4e')?![]:!![],'phonecall_activity_parties':_0x5478c0},getCustomFields(_0x5bab7d[_0x7780('0x51')],_0x554a39,_0x5bab7d[_0x7780('0x46')])),'headers':{'Authorization':_0x7780('0x1c')+_0x456230,'OData-Version':_0x7780('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x22df89);})[_0x7780('0x1a')](function(_0x2c9af3){var _0x173fe9=_0x2c9af3['headers'][_0x7780('0x52')];var _0x5e7897=_0x173fe9['substring'](_0x173fe9[_0x7780('0x34')]('(')+0x1,_0x173fe9[_0x7780('0x34')](')'));_0x47cc37[_0x7780('0x53')]=_0x5e7897;_0x2b781e(_0x47cc37);})[_0x7780('0x2a')](function(_0x1a6ebd){_0x44aa60(_0x1a6ebd[_0x7780('0x19')]);});});}function emit(_0x4e96df,_0x8578a,_0x2703af,_0x96bd5e){var _0x20217c={'uri':util[_0x7780('0x54')](_0x7780('0x55'),_0x4e96df,_0x2703af,_0x96bd5e)};io['to'](util[_0x7780('0x54')]('user:%s',_0x8578a))[_0x7780('0x56')](_0x7780('0x57'),_0x20217c);}exports['cs']=function(_0x77b9af,_0xe750fe,_0x1dc690,_0x146cc8,_0x53a048,_0x3df328,_0x422f17,_0x5d1e57){var _0x2dcf30={};_0x3df328[_0x7780('0xc')]=_0x3df328[_0x7780('0xb')]?intUtil['stripTrailingSlash'](_0x3df328[_0x7780('0xf')]['data7']):intUtil['stripTrailingSlash'](_0x3df328[_0x7780('0xc')]);_0x3df328[_0x7780('0x58')]=intUtil[_0x7780('0x59')](_0x3df328[_0x7780('0x58')]);_0x2dcf30[_0x7780('0x4d')]=_0x5d1e57===_0x7780('0x4e')||_0x5d1e57===_0x7780('0x5a')?'queue':_0x7780('0x2c');var _0x4d2f77=_0x3df328[_0x7780('0xb')]?util['format'](_0x7780('0x5b'),_0x3df328[_0x7780('0xf')][_0x7780('0xd')]):util[_0x7780('0x54')](_0x7780('0x5b'),_0x3df328[_0x7780('0xc')]);var _0x1da877=util[_0x7780('0x54')](_0x7780('0x5c'),_0x3df328[_0x7780('0xe')]);var _0x4b6e21=util['format'](_0x7780('0x5d'),_0x3df328[_0x7780('0x58')],_0xe750fe[_0x7780('0x5e')],md5(_0xe750fe['uniqueid']));if(_0x53a048&&_0x53a048[_0x7780('0x5f')]){logger['info'](_0x7780('0x60'),_0x7780('0x61'));_0xe750fe[_0x7780('0x62')]=_0x4b6e21;}else if(_0x422f17&&_0x422f17[_0x7780('0x63')]&&_0x422f17[_0x7780('0x63')]!==_0x7780('0x64')){logger[_0x7780('0x27')]('[OUTBOUND]',_0x7780('0x61'));_0xe750fe[_0x7780('0x62')]=_0x4b6e21;}else{_0xe750fe[_0x7780('0x62')]='';}return getUser(_0x2dcf30,_0x3df328,_0x146cc8,_0x1da877,_0x4d2f77,_0x5d1e57)[_0x7780('0x1a')](function(_0x1d7e7c){logger[_0x7780('0x27')]('['+_0x5d1e57[_0x7780('0x17')]()+_0x7780('0x65'),_0x1d7e7c[_0x7780('0x26')]);logger[_0x7780('0x27')]('['+_0x5d1e57[_0x7780('0x17')]()+_0x7780('0x66'),_0x1d7e7c['userEmail']);return getEndUser(_0x1d7e7c,_0x3df328,_0x1da877,_0x4d2f77,_0xe750fe,_0x5d1e57,_0x1dc690[_0x7780('0x67')],_0x1dc690[_0x7780('0x68')]);})[_0x7780('0x1a')](function(_0x525b8c){logger[_0x7780('0x27')]('['+_0x5d1e57[_0x7780('0x17')]()+_0x7780('0x69'),_0x525b8c[_0x7780('0x35')]);logger[_0x7780('0x27')]('['+_0x5d1e57[_0x7780('0x17')]()+_0x7780('0x6a'),_0xe750fe[_0x7780('0x2d')]);return getTicket(_0x525b8c,_0x3df328,_0x1da877,_0x4d2f77,_0xe750fe,_0x1dc690,_0x5d1e57);})[_0x7780('0x1a')](function(_0x3e9cfc){logger[_0x7780('0x27')](util[_0x7780('0x54')]('['+_0x5d1e57['toUpperCase']()+_0x7780('0x6b'),_0x1dc690[_0x7780('0x46')],_0x3e9cfc['ticketId']));logger[_0x7780('0x27')](util[_0x7780('0x54')]('['+_0x5d1e57[_0x7780('0x17')]()+_0x7780('0x6c'),_0x5d1e57));if(_0x5d1e57!==_0x7780('0x5a')&&_0x1dc690[_0x7780('0x6d')]){logger[_0x7780('0x27')]('['+_0x5d1e57[_0x7780('0x17')]()+']',_0x7780('0x6e'));emit(_0x3df328['remoteUri'],_0x146cc8[_0x7780('0x6f')],_0x1dc690[_0x7780('0x46')],_0x3e9cfc['ticketId']);}})[_0x7780('0x2a')](function(_0x565296){logger[_0x7780('0x16')]('['+_0x5d1e57['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x565296[_0x7780('0x19')]);console['error'](_0x7780('0x70'),_0x565296);});}; \ 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 885e099..a32b550 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 _0x1aff=['error','outbound','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','Tags','name','custom_fields','mapValues','keyBy','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','string','type','nameField','content','picklist','idField','customField','push','variable','variableName','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch'];(function(_0x53377b,_0x5ebf03){var _0x20309d=function(_0x5e7535){while(--_0x5e7535){_0x53377b['push'](_0x53377b['shift']());}};_0x20309d(++_0x5ebf03);}(_0x1aff,0x17a));var _0xf1af=function(_0x2b862c,_0xfb4970){_0x2b862c=_0x2b862c-0x0;var _0x305e4c=_0x1aff[_0x2b862c];return _0x305e4c;};'use strict';var _=require('lodash');var rp=require(_0xf1af('0x0'));var md5=require('md5');var util=require(_0xf1af('0x1'));var Redis=require(_0xf1af('0x2'));var intUtil=require(_0xf1af('0x3'));var config=require(_0xf1af('0x4'));var logger=require(_0xf1af('0x5'))(_0xf1af('0x6'));config[_0xf1af('0x7')]=_[_0xf1af('0x8')](config[_0xf1af('0x7')],{'host':_0xf1af('0x9'),'port':0x18eb});var io=require(_0xf1af('0xa'))(new Redis(config[_0xf1af('0x7')]));var headers={'Content-Type':_0xf1af('0xb'),'Accept':'application/json'};function emit(_0x3e31f3,_0x4250fe,_0x3ba4cb){io['to'](_0x3e31f3)[_0xf1af('0xc')](_0x4250fe,_0x3ba4cb);}function getTicket(_0x2c4e6e,_0x2da40d,_0x26a8c1,_0x1cfe98,_0xc1db87){logger[_0xf1af('0xd')]('Creating\x20new\x20ticket...');var _0x26ed2a=_['merge']({'responder_id':_0x2da40d['id'],'requester_id':_0x26a8c1['id'],'name':util[_0xf1af('0xe')](_0xf1af('0xf'),_0xc1db87[_0xf1af('0x10')]),'phone':_0xc1db87[_0xf1af('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1cfe98[_0xf1af('0x12')],_0xc1db87,'\x20'),'description':intUtil['getString'](_0x1cfe98[_0xf1af('0x13')],_0xc1db87,'
'),'tags':getTags(_0x1cfe98[_0xf1af('0x14')],_0xf1af('0x15'))},getCustomFields(_0x1cfe98['Fields'],_0xc1db87));_0x26ed2a[_0xf1af('0x16')]=_[_0xf1af('0x17')](_[_0xf1af('0x18')](_0x26ed2a[_0xf1af('0x16')],'id'),'value');return request({'uri':util[_0xf1af('0xe')]('%s/api/v2/tickets',_0x2c4e6e[_0xf1af('0x19')]),'method':_0xf1af('0x1a'),'body':_0x26ed2a})[_0xf1af('0x1b')](function(_0x2a7993){logger['info']('Ticket\x20created!');return _0x2a7993;});}function getUser(_0x371830,_0x14b396){if(intUtil[_0xf1af('0x1c')](_0x14b396)){return request({'uri':util['format'](_0xf1af('0x1d'),_0x371830['remoteUri']),'qs':{'email':_0x14b396}})['then'](function(_0x1916c0){if(_0x1916c0[_0xf1af('0x1e')]){logger[_0xf1af('0xd')](_0xf1af('0x1f'));return _[_0xf1af('0x20')](_0x1916c0,function(_0x5a668a){return _0x5a668a[_0xf1af('0x21')]['email']===_0x14b396;});}else{logger[_0xf1af('0xd')](_0xf1af('0x22'));return request({'uri':util['format'](_0xf1af('0x23'),_0x371830[_0xf1af('0x19')])})[_0xf1af('0x1b')](function(_0x35fa49){logger[_0xf1af('0xd')](_0xf1af('0x24'));return _0x35fa49;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf1af('0xe')]('%s/api/v2/agents/me',_0x371830[_0xf1af('0x19')])})['then'](function(_0x5c61bd){logger[_0xf1af('0xd')](_0xf1af('0x24'));return _0x5c61bd;});}}function getEndUser(_0x12cb91,_0x3043b7,_0x29a1d7){logger[_0xf1af('0xd')](_0xf1af('0x25'),_0x29a1d7);return request({'uri':util[_0xf1af('0xe')](_0xf1af('0x26'),_0x12cb91[_0xf1af('0x19')]),'qs':{'phone':_0x29a1d7}})[_0xf1af('0x1b')](function(_0x3b127e){if(_0x3b127e[_0xf1af('0x1e')]){logger[_0xf1af('0xd')](_0xf1af('0x27'));return _[_0xf1af('0x20')](_0x3b127e,{'phone':_0x29a1d7});}else{logger[_0xf1af('0xd')](_0xf1af('0x28'));return request({'uri':util['format'](_0xf1af('0x26'),_0x12cb91['remoteUri']),'method':_0xf1af('0x1a'),'body':{'name':_0x3043b7,'phone':_0x29a1d7}})['then'](function(_0x3f6ac8){logger[_0xf1af('0xd')](_0xf1af('0x29'));return _0x3f6ac8;});}});}function getAuth(_0x183c9f){return util[_0xf1af('0xe')](_0xf1af('0x2a'),new Buffer(_0x183c9f[_0xf1af('0x2b')]+':X')[_0xf1af('0x2c')]('base64'));}function request(_0x36b155){logger[_0xf1af('0x2d')](_0xf1af('0x2e'),JSON[_0xf1af('0x2f')](_0x36b155));return rp(_[_0xf1af('0x8')](_0x36b155,{'method':_0xf1af('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x121aad,_0x43d562){var _0x4330f4=[];if(_0x121aad&&_0x121aad[_0xf1af('0x1e')]>0x0){_0x4330f4=_[_0xf1af('0x31')](_0x121aad,_0x43d562);}return _0x4330f4;}function getCustomFields(_0x156268,_0x2f7199){var _0x100853=[];var _0x3ac505={'custom_fields':[]};if(_0x156268[_0xf1af('0x1e')]>0x0){_[_0xf1af('0x32')](_0x156268,function(_0x1aa099){if(_[_0xf1af('0x33')]([_0xf1af('0x34'),'picklist'],_0x1aa099[_0xf1af('0x35')])&&_0x1aa099[_0xf1af('0x36')]&&!_0x1aa099['customField']){_0x3ac505[_0x1aa099[_0xf1af('0x36')]['toLowerCase']()]=_0x1aa099[_0xf1af('0x37')]['toString']();}else if(_[_0xf1af('0x33')](['string',_0xf1af('0x38')],_0x1aa099[_0xf1af('0x35')])&&_0x1aa099[_0xf1af('0x39')]&&_0x1aa099[_0xf1af('0x3a')]){_0x3ac505['custom_fields'][_0xf1af('0x3b')]({'id':_0x1aa099['idField'],'value':_0x1aa099['content'][_0xf1af('0x2c')]()});}else if(_0x1aa099[_0xf1af('0x35')]===_0xf1af('0x3c')&&_0x1aa099['variableName']&&_0x1aa099[_0xf1af('0x39')]&&_0x1aa099[_0xf1af('0x3a')]){_0x2f7199[_0x1aa099[_0xf1af('0x3d')]]&&_0x3ac505[_0xf1af('0x16')]['push']({'id':_0x1aa099[_0xf1af('0x39')],'value':_0x2f7199[_0x1aa099[_0xf1af('0x3d')]][_0xf1af('0x2c')]()});}else if(_0x1aa099[_0xf1af('0x35')]===_0xf1af('0x3e')&&_0x1aa099['Variable']&&_0x1aa099['Variable'][_0xf1af('0x15')]&&_0x1aa099[_0xf1af('0x39')]&&_0x1aa099[_0xf1af('0x3a')]){_0x2f7199[_0x1aa099[_0xf1af('0x3f')][_0xf1af('0x15')][_0xf1af('0x40')]()]&&_0x3ac505[_0xf1af('0x16')][_0xf1af('0x3b')]({'id':_0x1aa099[_0xf1af('0x39')],'value':_0x2f7199[_0x1aa099[_0xf1af('0x3f')][_0xf1af('0x15')]['toLowerCase']()][_0xf1af('0x2c')]()});}});}return _0x3ac505;}exports['queue']=function(_0xad4746,_0x11459f,_0x60ad95,_0x3d1293,_0x18e1a8,_0x492ec3){var _0x3fcf07,_0x3d1ee1;_0x492ec3['remoteUri']=intUtil['stripTrailingSlash'](_0x492ec3[_0xf1af('0x19')]);_0x492ec3['serverUrl']=intUtil[_0xf1af('0x41')](_0x492ec3[_0xf1af('0x42')]);if(_0x18e1a8&&_0x18e1a8[_0xf1af('0x43')]){logger['info'](_0xf1af('0x44'),_0xf1af('0x45'));_0x11459f['recordingURL']=util[_0xf1af('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x492ec3[_0xf1af('0x42')],_0x11459f['uniqueid'],md5(_0x11459f['uniqueid']));}else{_0x11459f[_0xf1af('0x46')]='';}headers[_0xf1af('0x47')]=getAuth(_0x492ec3);return getUser(_0x492ec3,_0x3d1293[_0xf1af('0x48')])['then'](function(_0x2aa96d){_0x3fcf07=_0x2aa96d;logger[_0xf1af('0xd')](_0xf1af('0x49'),_0x3fcf07['id']);return getEndUser(_0x492ec3,_0x11459f[_0xf1af('0x10')],_0x11459f[_0xf1af('0x11')]);})[_0xf1af('0x1b')](function(_0x273865){_0x3d1ee1=_0x273865;logger[_0xf1af('0xd')](_0xf1af('0x4a'),_0x3d1ee1['id']);return getTicket(_0x492ec3,_0x3fcf07,_0x3d1ee1,_0x60ad95,_0x11459f);})[_0xf1af('0x1b')](function(_0x56859c){if(_0x56859c&&_0x56859c['id']){logger[_0xf1af('0xd')](_0xf1af('0x4b'));logger[_0xf1af('0xd')](_0xf1af('0x4c'),_0x56859c['id']);logger[_0xf1af('0xd')](_0xf1af('0x44'),_0xf1af('0x4d'));emit(util[_0xf1af('0xe')](_0xf1af('0x4e'),_0x3d1293[_0xf1af('0x15')]),_0xf1af('0x4f'),{'uri':util[_0xf1af('0xe')](_0xf1af('0x50'),_0x492ec3['remoteUri'],_0x56859c['id'])});}})[_0xf1af('0x51')](function(_0x88a8ea){logger[_0xf1af('0x52')](_0xf1af('0x44'),JSON[_0xf1af('0x2f')](_0x88a8ea));});};exports[_0xf1af('0x53')]=function(_0x5105e9,_0x20df46,_0x352603,_0x53445a,_0x391477,_0x2ccb3a,_0x543634){var _0x49ae30,_0x4285a3;_0x2ccb3a[_0xf1af('0x19')]=intUtil['stripTrailingSlash'](_0x2ccb3a[_0xf1af('0x19')]);_0x2ccb3a[_0xf1af('0x42')]=intUtil[_0xf1af('0x41')](_0x2ccb3a[_0xf1af('0x42')]);if(_0x543634&&_0x543634['recordingFormat']&&_0x543634['recordingFormat']!==_0xf1af('0x54')){logger[_0xf1af('0xd')](_0xf1af('0x55'),'Recording\x20is\x20enabled!');_0x20df46[_0xf1af('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ccb3a[_0xf1af('0x42')],_0x20df46[_0xf1af('0x56')],md5(_0x20df46[_0xf1af('0x56')]));}headers['Authorization']=getAuth(_0x2ccb3a);return getUser(_0x2ccb3a,_0x53445a[_0xf1af('0x48')])['then'](function(_0x2b5166){_0x49ae30=_0x2b5166;logger[_0xf1af('0xd')](_0xf1af('0x49'),_0x49ae30['id']);return getEndUser(_0x2ccb3a,_0x20df46[_0xf1af('0x57')],_0x20df46[_0xf1af('0x58')]);})[_0xf1af('0x1b')](function(_0x18c0e2){_0x4285a3=_0x18c0e2;logger[_0xf1af('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4285a3['id']);return getTicket(_0x2ccb3a,_0x49ae30,_0x4285a3,_0x352603,_0x20df46);})[_0xf1af('0x1b')](function(_0x3c0c09){if(_0x3c0c09&&_0x3c0c09['id']){logger[_0xf1af('0xd')]('Ticket\x20created!');logger[_0xf1af('0xd')](_0xf1af('0x4c'),_0x3c0c09['id']);logger[_0xf1af('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf1af('0xe')](_0xf1af('0x4e'),_0x53445a['name']),_0xf1af('0x4f'),{'uri':util[_0xf1af('0xe')]('%s/helpdesk/tickets/%d',_0x2ccb3a[_0xf1af('0x19')],_0x3c0c09['id'])});}})[_0xf1af('0x51')](function(_0x361549){logger[_0xf1af('0x52')](_0xf1af('0x55'),JSON[_0xf1af('0x2f')](_0x361549));});};exports['unmanaged']=function(_0x317609,_0x4f1354,_0x16e675,_0x521b00,_0x428876,_0x404715){var _0x576efc,_0x551c04;_0x404715[_0xf1af('0x19')]=intUtil[_0xf1af('0x41')](_0x404715[_0xf1af('0x19')]);_0x404715['serverUrl']=intUtil['stripTrailingSlash'](_0x404715[_0xf1af('0x42')]);if(_0x428876&&_0x428876[_0xf1af('0x43')]){logger['info']('['+_0x4f1354[_0xf1af('0x59')][_0xf1af('0x5a')]()+']',_0xf1af('0x45'));_0x4f1354['recordingURL']=util[_0xf1af('0xe')](_0xf1af('0x5b'),_0x404715['serverUrl'],_0x4f1354['uniqueid'],md5(_0x4f1354[_0xf1af('0x56')]));}else{_0x4f1354[_0xf1af('0x46')]='';}headers[_0xf1af('0x47')]=getAuth(_0x404715);return getUser(_0x404715,'')[_0xf1af('0x1b')](function(_0x53f198){_0x576efc=_0x53f198;logger['info'](_0xf1af('0x49'),_0x576efc['id']);return getEndUser(_0x404715,_0x4f1354[_0xf1af('0x10')],_0x4f1354['calleridnum']);})['then'](function(_0x504527){_0x551c04=_0x504527;logger['info'](_0xf1af('0x4a'),_0x551c04['id']);return getTicket(_0x404715,_0x576efc,_0x551c04,_0x16e675,_0x4f1354);})[_0xf1af('0x1b')](function(_0x3788f3){if(_0x3788f3){logger[_0xf1af('0xd')](_0xf1af('0x4b'));logger[_0xf1af('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3788f3['id']);}})[_0xf1af('0x51')](function(_0x1b3b7a){logger[_0xf1af('0x52')]('['+_0x4f1354['lastevent'][_0xf1af('0x5a')]()+']',JSON[_0xf1af('0x2f')](_0x1b3b7a));});}; \ No newline at end of file +var _0x1cbb=['stringify','GET','map','forEach','includes','picklist','type','nameField','toLowerCase','string','idField','variable','customField','variableName','push','Variable','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','catch','error','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','defaults','redis','localhost','application/json','info','merge','format','calleridname','Descriptions','
','Tags','name','Fields','mapValues','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','toString','base64','[HTTP]'];(function(_0x1efd15,_0x378a08){var _0x5c7796=function(_0xb442fd){while(--_0xb442fd){_0x1efd15['push'](_0x1efd15['shift']());}};_0x5c7796(++_0x378a08);}(_0x1cbb,0x138));var _0xb1cb=function(_0x496773,_0x99326d){_0x496773=_0x496773-0x0;var _0xeb0693=_0x1cbb[_0x496773];return _0xeb0693;};'use strict';var _=require(_0xb1cb('0x0'));var rp=require(_0xb1cb('0x1'));var md5=require(_0xb1cb('0x2'));var util=require(_0xb1cb('0x3'));var Redis=require(_0xb1cb('0x4'));var intUtil=require(_0xb1cb('0x5'));var config=require(_0xb1cb('0x6'));var logger=require('../../../../config/logger')('freshdesk');config['redis']=_[_0xb1cb('0x7')](config[_0xb1cb('0x8')],{'host':_0xb1cb('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xb1cb('0xa'),'Accept':_0xb1cb('0xa')};function emit(_0x2c2370,_0x58aecd,_0x32f0b8){io['to'](_0x2c2370)['emit'](_0x58aecd,_0x32f0b8);}function getTicket(_0x3ebebb,_0x91dd08,_0x546022,_0x1b12bb,_0x3d2aaf){logger[_0xb1cb('0xb')]('Creating\x20new\x20ticket...');var _0x4ce3b2=_[_0xb1cb('0xc')]({'responder_id':_0x91dd08['id'],'requester_id':_0x546022['id'],'name':util[_0xb1cb('0xd')]('Caller\x20-\x20%s',_0x3d2aaf[_0xb1cb('0xe')]),'phone':_0x3d2aaf['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1b12bb['Subjects'],_0x3d2aaf,'\x20'),'description':intUtil['getString'](_0x1b12bb[_0xb1cb('0xf')],_0x3d2aaf,_0xb1cb('0x10')),'tags':getTags(_0x1b12bb[_0xb1cb('0x11')],_0xb1cb('0x12'))},getCustomFields(_0x1b12bb[_0xb1cb('0x13')],_0x3d2aaf));_0x4ce3b2['custom_fields']=_[_0xb1cb('0x14')](_['keyBy'](_0x4ce3b2[_0xb1cb('0x15')],'id'),_0xb1cb('0x16'));return request({'uri':util['format'](_0xb1cb('0x17'),_0x3ebebb[_0xb1cb('0x18')]),'method':_0xb1cb('0x19'),'body':_0x4ce3b2})[_0xb1cb('0x1a')](function(_0x136863){logger[_0xb1cb('0xb')]('Ticket\x20created!');return _0x136863;});}function getUser(_0x40cabf,_0x5c1752){if(intUtil[_0xb1cb('0x1b')](_0x5c1752)){return request({'uri':util['format'](_0xb1cb('0x1c'),_0x40cabf[_0xb1cb('0x18')]),'qs':{'email':_0x5c1752}})[_0xb1cb('0x1a')](function(_0x482361){if(_0x482361['length']){logger[_0xb1cb('0xb')](_0xb1cb('0x1d'));return _['find'](_0x482361,function(_0x47e75e){return _0x47e75e[_0xb1cb('0x1e')][_0xb1cb('0x1f')]===_0x5c1752;});}else{logger[_0xb1cb('0xb')](_0xb1cb('0x20'));return request({'uri':util['format'](_0xb1cb('0x21'),_0x40cabf[_0xb1cb('0x18')])})['then'](function(_0x397ff4){logger['info']('Admin\x20account\x20selected.');return _0x397ff4;});}});}else{logger[_0xb1cb('0xb')](_0xb1cb('0x22'));return request({'uri':util[_0xb1cb('0xd')](_0xb1cb('0x21'),_0x40cabf[_0xb1cb('0x18')])})[_0xb1cb('0x1a')](function(_0x17b198){logger[_0xb1cb('0xb')](_0xb1cb('0x23'));return _0x17b198;});}}function getEndUser(_0x510fa3,_0x3a74a7,_0x33814a){logger[_0xb1cb('0xb')](_0xb1cb('0x24'),_0x33814a);return request({'uri':util[_0xb1cb('0xd')]('%s/api/v2/contacts',_0x510fa3[_0xb1cb('0x18')]),'qs':{'phone':_0x33814a}})[_0xb1cb('0x1a')](function(_0x1aefe1){if(_0x1aefe1[_0xb1cb('0x25')]){logger[_0xb1cb('0xb')](_0xb1cb('0x26'));return _[_0xb1cb('0x27')](_0x1aefe1,{'phone':_0x33814a});}else{logger[_0xb1cb('0xb')](_0xb1cb('0x28'));return request({'uri':util[_0xb1cb('0xd')]('%s/api/v2/contacts',_0x510fa3[_0xb1cb('0x18')]),'method':_0xb1cb('0x19'),'body':{'name':_0x3a74a7,'phone':_0x33814a}})[_0xb1cb('0x1a')](function(_0x5e7974){logger[_0xb1cb('0xb')]('Enduser\x20created.');return _0x5e7974;});}});}function getAuth(_0x424b1f){return util[_0xb1cb('0xd')]('Basic\x20%s',new Buffer(_0x424b1f['apiKey']+':X')[_0xb1cb('0x29')](_0xb1cb('0x2a')));}function request(_0x143398){logger['debug'](_0xb1cb('0x2b'),JSON[_0xb1cb('0x2c')](_0x143398));return rp(_[_0xb1cb('0x7')](_0x143398,{'method':_0xb1cb('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x41b44d,_0x4a6334){var _0x4349b9=[];if(_0x41b44d&&_0x41b44d[_0xb1cb('0x25')]>0x0){_0x4349b9=_[_0xb1cb('0x2e')](_0x41b44d,_0x4a6334);}return _0x4349b9;}function getCustomFields(_0x2c2edc,_0x1ebf11){var _0x10a137=[];var _0x61207={'custom_fields':[]};if(_0x2c2edc[_0xb1cb('0x25')]>0x0){_[_0xb1cb('0x2f')](_0x2c2edc,function(_0x1692c3){if(_[_0xb1cb('0x30')](['string',_0xb1cb('0x31')],_0x1692c3[_0xb1cb('0x32')])&&_0x1692c3[_0xb1cb('0x33')]&&!_0x1692c3['customField']){_0x61207[_0x1692c3[_0xb1cb('0x33')][_0xb1cb('0x34')]()]=_0x1692c3['content'][_0xb1cb('0x29')]();}else if(_['includes']([_0xb1cb('0x35'),_0xb1cb('0x31')],_0x1692c3['type'])&&_0x1692c3[_0xb1cb('0x36')]&&_0x1692c3['customField']){_0x61207['custom_fields']['push']({'id':_0x1692c3[_0xb1cb('0x36')],'value':_0x1692c3['content'][_0xb1cb('0x29')]()});}else if(_0x1692c3[_0xb1cb('0x32')]===_0xb1cb('0x37')&&_0x1692c3['variableName']&&_0x1692c3[_0xb1cb('0x36')]&&_0x1692c3[_0xb1cb('0x38')]){_0x1ebf11[_0x1692c3[_0xb1cb('0x39')]]&&_0x61207[_0xb1cb('0x15')][_0xb1cb('0x3a')]({'id':_0x1692c3[_0xb1cb('0x36')],'value':_0x1ebf11[_0x1692c3[_0xb1cb('0x39')]][_0xb1cb('0x29')]()});}else if(_0x1692c3[_0xb1cb('0x32')]==='customVariable'&&_0x1692c3[_0xb1cb('0x3b')]&&_0x1692c3['Variable']['name']&&_0x1692c3['idField']&&_0x1692c3['customField']){_0x1ebf11[_0x1692c3['Variable'][_0xb1cb('0x12')][_0xb1cb('0x34')]()]&&_0x61207['custom_fields'][_0xb1cb('0x3a')]({'id':_0x1692c3[_0xb1cb('0x36')],'value':_0x1ebf11[_0x1692c3[_0xb1cb('0x3b')][_0xb1cb('0x12')][_0xb1cb('0x34')]()]['toString']()});}});}return _0x61207;}exports['queue']=function(_0x1ba731,_0x2e58d2,_0x546cdd,_0x553472,_0x178231,_0x401158){var _0x538113,_0x1d2a0b;_0x401158[_0xb1cb('0x18')]=intUtil['stripTrailingSlash'](_0x401158['remoteUri']);_0x401158[_0xb1cb('0x3c')]=intUtil[_0xb1cb('0x3d')](_0x401158[_0xb1cb('0x3c')]);if(_0x178231&&_0x178231[_0xb1cb('0x3e')]){logger[_0xb1cb('0xb')](_0xb1cb('0x3f'),_0xb1cb('0x40'));_0x2e58d2[_0xb1cb('0x41')]=util[_0xb1cb('0xd')](_0xb1cb('0x42'),_0x401158[_0xb1cb('0x3c')],_0x2e58d2[_0xb1cb('0x43')],md5(_0x2e58d2[_0xb1cb('0x43')]));}else{_0x2e58d2[_0xb1cb('0x41')]='';}headers[_0xb1cb('0x44')]=getAuth(_0x401158);return getUser(_0x401158,_0x553472[_0xb1cb('0x1f')])[_0xb1cb('0x1a')](function(_0x1d7461){_0x538113=_0x1d7461;logger[_0xb1cb('0xb')](_0xb1cb('0x45'),_0x538113['id']);return getEndUser(_0x401158,_0x2e58d2[_0xb1cb('0xe')],_0x2e58d2[_0xb1cb('0x46')]);})[_0xb1cb('0x1a')](function(_0x240dee){_0x1d2a0b=_0x240dee;logger[_0xb1cb('0xb')](_0xb1cb('0x47'),_0x1d2a0b['id']);return getTicket(_0x401158,_0x538113,_0x1d2a0b,_0x546cdd,_0x2e58d2);})[_0xb1cb('0x1a')](function(_0x313560){if(_0x313560&&_0x313560['id']){logger[_0xb1cb('0xb')](_0xb1cb('0x48'));logger[_0xb1cb('0xb')]('The\x20Ticket\x20ID\x20is:',_0x313560['id']);logger[_0xb1cb('0xb')](_0xb1cb('0x3f'),_0xb1cb('0x49'));emit(util['format'](_0xb1cb('0x4a'),_0x553472[_0xb1cb('0x12')]),_0xb1cb('0x4b'),{'uri':util[_0xb1cb('0xd')](_0xb1cb('0x4c'),_0x401158[_0xb1cb('0x18')],_0x313560['id'])});}})['catch'](function(_0x5edbaf){logger['error'](_0xb1cb('0x3f'),JSON[_0xb1cb('0x2c')](_0x5edbaf));});};exports[_0xb1cb('0x4d')]=function(_0x30ae32,_0x40e60a,_0x5d1c8b,_0x555f44,_0x53cd5a,_0x461034,_0x3acf8e){var _0x463a82,_0x4cc6dd;_0x461034[_0xb1cb('0x18')]=intUtil[_0xb1cb('0x3d')](_0x461034[_0xb1cb('0x18')]);_0x461034[_0xb1cb('0x3c')]=intUtil[_0xb1cb('0x3d')](_0x461034['serverUrl']);if(_0x3acf8e&&_0x3acf8e[_0xb1cb('0x4e')]&&_0x3acf8e[_0xb1cb('0x4e')]!==_0xb1cb('0x4f')){logger[_0xb1cb('0xb')](_0xb1cb('0x50'),_0xb1cb('0x40'));_0x40e60a[_0xb1cb('0x41')]=util[_0xb1cb('0xd')](_0xb1cb('0x42'),_0x461034[_0xb1cb('0x3c')],_0x40e60a[_0xb1cb('0x43')],md5(_0x40e60a[_0xb1cb('0x43')]));}headers[_0xb1cb('0x44')]=getAuth(_0x461034);return getUser(_0x461034,_0x555f44[_0xb1cb('0x1f')])[_0xb1cb('0x1a')](function(_0x213e35){_0x463a82=_0x213e35;logger[_0xb1cb('0xb')](_0xb1cb('0x45'),_0x463a82['id']);return getEndUser(_0x461034,_0x40e60a[_0xb1cb('0x51')],_0x40e60a[_0xb1cb('0x52')]);})[_0xb1cb('0x1a')](function(_0x1d26e7){_0x4cc6dd=_0x1d26e7;logger['info'](_0xb1cb('0x47'),_0x4cc6dd['id']);return getTicket(_0x461034,_0x463a82,_0x4cc6dd,_0x5d1c8b,_0x40e60a);})['then'](function(_0x20400b){if(_0x20400b&&_0x20400b['id']){logger[_0xb1cb('0xb')](_0xb1cb('0x48'));logger['info'](_0xb1cb('0x53'),_0x20400b['id']);logger[_0xb1cb('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb1cb('0xd')](_0xb1cb('0x4a'),_0x555f44[_0xb1cb('0x12')]),_0xb1cb('0x4b'),{'uri':util[_0xb1cb('0xd')](_0xb1cb('0x4c'),_0x461034[_0xb1cb('0x18')],_0x20400b['id'])});}})['catch'](function(_0x2a6adc){logger['error'](_0xb1cb('0x50'),JSON[_0xb1cb('0x2c')](_0x2a6adc));});};exports[_0xb1cb('0x54')]=function(_0x58a589,_0x2aac45,_0x49c443,_0x118137,_0x24976b,_0x396b1b){var _0x1721e2,_0x26b7ad;_0x396b1b[_0xb1cb('0x18')]=intUtil[_0xb1cb('0x3d')](_0x396b1b['remoteUri']);_0x396b1b['serverUrl']=intUtil[_0xb1cb('0x3d')](_0x396b1b[_0xb1cb('0x3c')]);if(_0x24976b&&_0x24976b[_0xb1cb('0x3e')]){logger[_0xb1cb('0xb')]('['+_0x2aac45[_0xb1cb('0x55')][_0xb1cb('0x56')]()+']','Recording\x20is\x20enabled!');_0x2aac45[_0xb1cb('0x41')]=util[_0xb1cb('0xd')](_0xb1cb('0x42'),_0x396b1b['serverUrl'],_0x2aac45[_0xb1cb('0x43')],md5(_0x2aac45[_0xb1cb('0x43')]));}else{_0x2aac45[_0xb1cb('0x41')]='';}headers['Authorization']=getAuth(_0x396b1b);return getUser(_0x396b1b,'')[_0xb1cb('0x1a')](function(_0x5e6993){_0x1721e2=_0x5e6993;logger[_0xb1cb('0xb')](_0xb1cb('0x45'),_0x1721e2['id']);return getEndUser(_0x396b1b,_0x2aac45[_0xb1cb('0xe')],_0x2aac45[_0xb1cb('0x46')]);})['then'](function(_0xf96df1){_0x26b7ad=_0xf96df1;logger['info'](_0xb1cb('0x47'),_0x26b7ad['id']);return getTicket(_0x396b1b,_0x1721e2,_0x26b7ad,_0x49c443,_0x2aac45);})[_0xb1cb('0x1a')](function(_0x1cf59a){if(_0x1cf59a){logger[_0xb1cb('0xb')]('Ticket\x20created!');logger[_0xb1cb('0xb')](_0xb1cb('0x53'),_0x1cf59a['id']);}})[_0xb1cb('0x57')](function(_0x2975f7){logger[_0xb1cb('0x58')]('['+_0x2aac45[_0xb1cb('0x55')][_0xb1cb('0x56')]()+']',JSON[_0xb1cb('0x2c')](_0x2975f7));});}; \ 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 a08c422..d9a3bf6 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 _0x19b7=['user:%s','emit','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','users','email','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','headers','Getting\x20user\x20list','then','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','adminEmail','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','Task\x20created:','/contacts/'];(function(_0x59659b,_0x38a9a7){var _0x5db166=function(_0x2f6c4c){while(--_0x2f6c4c){_0x59659b['push'](_0x59659b['shift']());}};_0x5db166(++_0x38a9a7);}(_0x19b7,0x1b7));var _0x719b=function(_0x2f8b9a,_0x60e0f4){_0x2f8b9a=_0x2f8b9a-0x0;var _0x1a4e38=_0x19b7[_0x2f8b9a];return _0x1a4e38;};'use strict';var _=require(_0x719b('0x0'));var rp=require(_0x719b('0x1'));var md5=require(_0x719b('0x2'));var util=require('util');var moment=require('moment');var Promise=require(_0x719b('0x3'));var Redis=require(_0x719b('0x4'));var intUtil=require(_0x719b('0x5'));var config=require(_0x719b('0x6'));var logger=require(_0x719b('0x7'))(_0x719b('0x8'));config[_0x719b('0x9')]=_['defaults'](config[_0x719b('0x9')],{'host':_0x719b('0xa'),'port':0x18eb});var io=require(_0x719b('0xb'))(new Redis(config[_0x719b('0x9')]));function getAdminId(_0xb2f4f6,_0x1ffcac,_0x533f01,_0x33d1bf){return new Promise(function(_0x1eb30f,_0x19ad16){var _0x2186a5=![];var _0x5ab3c6={'method':_0x719b('0xc'),'uri':_0x33d1bf+_0x719b('0xd'),'json':!![]};_0x5ab3c6['headers']=_0x533f01;logger['info']('Getting\x20admin\x20information');return rp(_0x5ab3c6)['then'](function(_0x366ca2){if(_0x366ca2){var _0x11725c=_0x366ca2[_0x719b('0xe')];var _0x59b51c=null;for(_0x59b51c=0x0;_0x59b51c<_0x11725c['length'];_0x59b51c++){if(_0x11725c[_0x59b51c][_0x719b('0xf')]===_0xb2f4f6['adminEmail']){_0xb2f4f6[_0x719b('0x10')]=_0x11725c[_0x59b51c]['id'];_0x2186a5=!![];}}if(_0x2186a5){logger[_0x719b('0x11')](_0x719b('0x12'),_0xb2f4f6['adminId']);_0x1eb30f(_0xb2f4f6);}else{_0x19ad16({'statusCode':0x194,'message':_0x719b('0x13')});}}else{_0x19ad16({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x719b('0x14')](function(_0x154ee1){logger[_0x719b('0x15')]('['+[_0x1ffcac[_0x719b('0x16')]()]+']',_0x154ee1['message']);_0x19ad16(_0x154ee1);});});}function getUser(_0x44cbc6,_0x1c9e2d,_0x3f3dc1){return function(_0x36e112){return new Promise(function(_0xc2c6ac,_0x3aff50){var _0x18ac30={'method':_0x719b('0xc'),'uri':_0x3f3dc1+'/api/selector/owners','json':!![]};_0x18ac30[_0x719b('0x17')]=_0x1c9e2d;logger[_0x719b('0x11')](_0x719b('0x18'));return rp(_0x18ac30)[_0x719b('0x19')](function(_0x2dea63){if(_0x2dea63){var _0x4e30d7=_0x2dea63[_0x719b('0xe')];var _0x4e5966=![];var _0x2050aa=null;if(_0x36e112['agentEmail']!==null){logger[_0x719b('0x11')](_0x719b('0x1a'),_0x36e112[_0x719b('0x1b')]);_0x36e112[_0x719b('0x1c')]=_0x36e112['agentEmail'];for(_0x2050aa=0x0;_0x2050aa<_0x4e30d7['length'];_0x2050aa++){if(_0x4e30d7[_0x2050aa][_0x719b('0xf')]===_0x36e112['agentEmail']){_0x4e5966=!![];_0x36e112[_0x719b('0x1d')]=_0x4e30d7[_0x2050aa]['id'];logger[_0x719b('0x11')](_0x719b('0x1e'),_0x36e112[_0x719b('0x1d')]);}}}if(!_0x4e5966){logger['info']('Admin\x20selected');_0x36e112[_0x719b('0x1c')]=_0x36e112[_0x719b('0x1f')];_0x36e112[_0x719b('0x1d')]=_0x36e112[_0x719b('0x10')];_0x4e5966=!![];}if(_0x4e5966){_0xc2c6ac(_0x36e112);}else{_0x3aff50({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3aff50({'statusCode':0x194,'message':_0x719b('0x13')});}})[_0x719b('0x14')](function(_0x88e64f){logger[_0x719b('0x15')]('['+[_0x44cbc6['toUpperCase']()]+']',_0x88e64f[_0x719b('0x20')]);_0x3aff50(_0x88e64f);});});};}function searchContact(_0x2d95b3,_0x1c1c11,_0x4bced9,_0x130e6e){return new Promise(function(_0x16e48b,_0x114a47){var _0x79eab3={'method':_0x719b('0xc'),'headers':_0x1c1c11,'uri':_0x2d95b3+_0x719b('0x21')+_0x130e6e+_0x719b('0x22')+_0x4bced9+_0x719b('0x23'),'json':!![]};rp(_0x79eab3)['then'](function(_0x3fe446){var _0x4d4955=_[_0x719b('0x24')](_0x3fe446[_0x719b('0x25')][_0x719b('0x25')],[_0x4bced9,_0x130e6e]);_0x16e48b(_0x4d4955);})[_0x719b('0x14')](function(_0x1d93f2){_0x114a47(_0x1d93f2);});});}function getEndUser(_0x1de3d2,_0x59d4d0,_0xb62a69){return function(_0x3f0280){return new Promise(function(_0x17bee4,_0x7cd38f){logger[_0x719b('0x11')](util[_0x719b('0x26')](_0x719b('0x27'),_0x3f0280[_0x719b('0x28')]));searchContact(_0xb62a69,_0x59d4d0,_0x719b('0x29'),_0x3f0280[_0x719b('0x28')])[_0x719b('0x19')](function(_0x569c45){if(_0x569c45){_0x3f0280['endUserId']=_0x569c45['id'];logger[_0x719b('0x11')]('Contact\x20found\x20mobile_number:',_0x3f0280[_0x719b('0x2a')]);return _0x17bee4(_0x3f0280);}searchContact(_0xb62a69,_0x59d4d0,_0x719b('0x2b'),_0x3f0280[_0x719b('0x28')])[_0x719b('0x19')](function(_0x13d43e){if(_0x13d43e){_0x3f0280[_0x719b('0x2a')]=_0x13d43e['id'];logger[_0x719b('0x11')](_0x719b('0x2c'),_0x3f0280['endUserId']);return _0x17bee4(_0x3f0280);}createEndUser(_0x3f0280,_0x1de3d2,_0x59d4d0,_0xb62a69)[_0x719b('0x19')](function(_0x266bcb){logger['info'](_0x719b('0x2d'),_0x266bcb['endUserId']);return _0x17bee4(_0x266bcb);});});})[_0x719b('0x14')](function(_0x1aee80){_0x7cd38f(_0x1aee80);});});};}function createEndUser(_0x3b8f5e,_0x2431dd,_0x2bb57c,_0x46ff07){return new Promise(function(_0x55f68d,_0x2c101){var _0x4ecb34=moment();var _0x2a7fa7={'method':_0x719b('0x2e'),'uri':_0x46ff07+_0x719b('0x2f'),'body':{'contact':{'last_name':_0x3b8f5e['contactNumber'],'work_number':_0x3b8f5e['contactNumber'],'mobile_number':_0x3b8f5e[_0x719b('0x28')],'owner_id':_0x3b8f5e['userId'],'created_at':_0x4ecb34[_0x719b('0x26')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x2a7fa7[_0x719b('0x17')]=_0x2bb57c;logger[_0x719b('0x11')](_0x719b('0x30'));return rp(_0x2a7fa7)[_0x719b('0x19')](function(_0x1c2047){_0x3b8f5e['endUserId']=_0x1c2047[_0x719b('0x31')]['id'];_0x55f68d(_0x3b8f5e);})[_0x719b('0x14')](function(_0x3baaf6){logger[_0x719b('0x15')]('['+[_0x2431dd['toUpperCase']()]+']',_0x3baaf6[_0x719b('0x20')]);_0x2c101(_0x3baaf6[_0x719b('0x20')]);});});}function getTicket(_0x4e6304,_0x210b9b,_0xeab28c,_0x1b671e,_0xa3b3a1){return function(_0x26f1a7){logger[_0x719b('0x11')](_0x719b('0x32'));return new Promise(function(_0x2995fb,_0x3721ac){var _0x25ce09=moment();var _0x147eaa={'method':_0x719b('0x2e'),'uri':_0xeab28c+'/api/tasks','body':{'title':intUtil[_0x719b('0x33')](_0x1b671e['Subjects'],_0xa3b3a1,'\x20'),'description':intUtil[_0x719b('0x33')](_0x1b671e[_0x719b('0x34')],_0xa3b3a1,'\x0a'),'owner_id':_0x26f1a7[_0x719b('0x1d')],'creater_id':_0x26f1a7[_0x719b('0x10')],'targetable_id':_0x26f1a7['endUserId'],'targetable_type':_0x719b('0x35'),'created_at':_0x25ce09[_0x719b('0x26')](_0x719b('0x36')),'due_date':_0x25ce09[_0x719b('0x37')](0x1e,'m')['format'](_0x719b('0x36'))},'json':!![]};_0x147eaa[_0x719b('0x17')]=_0x210b9b;return rp(_0x147eaa)[_0x719b('0x19')](function(_0x37a75d){_0x26f1a7[_0x719b('0x38')]=_0x37a75d['task']['id'];logger[_0x719b('0x11')](_0x719b('0x39'),_0x26f1a7[_0x719b('0x38')]);_0x2995fb(_0x26f1a7);})[_0x719b('0x14')](function(_0x2c646){logger['error']('['+[_0x4e6304[_0x719b('0x16')]()]+']',_0x2c646[_0x719b('0x20')]);_0x3721ac(_0x2c646[_0x719b('0x20')]);});});};}function emit(_0x512de0,_0x307307,_0x4b698f){var _0xa690e2={'uri':_0x512de0+_0x719b('0x3a')+_0x4b698f};io['to'](util['format'](_0x719b('0x3b'),_0x307307))[_0x719b('0x3c')]('trigger:browser:url',_0xa690e2);}exports['cs']=function(_0x18a255,_0x4e97e6,_0x58afdf,_0x6820aa,_0x2eb880,_0xa1e40c,_0x4ddd83,_0x3ebba4){var _0x105182={};var _0x2ea5bb={'Authorization':_0x719b('0x3d')+_0xa1e40c['apiKey']};_0xa1e40c[_0x719b('0x3e')]=intUtil[_0x719b('0x3f')](_0xa1e40c[_0x719b('0x3e')]);_0xa1e40c['serverUrl']=intUtil['stripTrailingSlash'](_0xa1e40c[_0x719b('0x40')]);var _0x8008d0=_0xa1e40c[_0x719b('0x3e')];_0x105182[_0x719b('0x1f')]=_0xa1e40c[_0x719b('0x41')];_0x105182['contactNumber']=_0x3ebba4[_0x719b('0x42')]()===_0x719b('0x43')?_0x4e97e6['destcalleridnum']:_0x4e97e6[_0x719b('0x44')];_0x105182[_0x719b('0x45')]=_0x3ebba4===_0x719b('0x46')||_0x3ebba4===_0x719b('0x47')?_0x719b('0x46'):_0x719b('0x43');if(_0x6820aa){_0x105182[_0x719b('0x1b')]=_0x6820aa[_0x719b('0xf')];}var _0x1ac8aa=util[_0x719b('0x26')](_0x719b('0x48'),_0xa1e40c[_0x719b('0x40')],_0x4e97e6[_0x719b('0x49')],md5(_0x4e97e6[_0x719b('0x49')]));if(_0x2eb880&&_0x2eb880['monitor_format']){logger[_0x719b('0x11')](_0x719b('0x4a'),_0x719b('0x4b'));_0x4e97e6[_0x719b('0x4c')]=_0x1ac8aa;}else if(_0x4ddd83&&_0x4ddd83['recordingFormat']&&_0x4ddd83[_0x719b('0x4d')]!=='none'){logger[_0x719b('0x11')](_0x719b('0x4e'),'Recording\x20is\x20enabled!');_0x4e97e6[_0x719b('0x4c')]=_0x1ac8aa;}else{_0x4e97e6[_0x719b('0x4c')]='';}return getAdminId(_0x105182,_0x3ebba4,_0x2ea5bb,_0x8008d0)[_0x719b('0x19')](getUser(_0x3ebba4,_0x2ea5bb,_0x8008d0))[_0x719b('0x19')](getEndUser(_0x3ebba4,_0x2ea5bb,_0x8008d0))[_0x719b('0x19')](getTicket(_0x3ebba4,_0x2ea5bb,_0x8008d0,_0x58afdf,_0x4e97e6))[_0x719b('0x19')](function(_0x591e06){logger[_0x719b('0x11')](util[_0x719b('0x26')](_0x719b('0x4f'),_0x591e06[_0x719b('0x38')]));if(_0x3ebba4!==_0x719b('0x47')){logger[_0x719b('0x11')]('['+[_0x3ebba4['toUpperCase']()]+']',_0x719b('0x50'));emit(_0x8008d0,_0x6820aa['name'],_0x591e06[_0x719b('0x2a')]);}})[_0x719b('0x14')](function(_0x2659de){logger[_0x719b('0x15')]('['+[_0x3ebba4[_0x719b('0x16')]()]+_0x719b('0x51'),util[_0x719b('0x52')](_0x2659de,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5d34=['users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then'];(function(_0x532680,_0x16e7e0){var _0xd265fb=function(_0x49c63f){while(--_0x49c63f){_0x532680['push'](_0x532680['shift']());}};_0xd265fb(++_0x16e7e0);}(_0x5d34,0x19b));var _0x45d3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d34[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x45d3('0x0'));var rp=require(_0x45d3('0x1'));var md5=require('md5');var util=require(_0x45d3('0x2'));var moment=require(_0x45d3('0x3'));var Promise=require(_0x45d3('0x4'));var Redis=require(_0x45d3('0x5'));var intUtil=require(_0x45d3('0x6'));var config=require(_0x45d3('0x7'));var logger=require(_0x45d3('0x8'))(_0x45d3('0x9'));config[_0x45d3('0xa')]=_[_0x45d3('0xb')](config[_0x45d3('0xa')],{'host':_0x45d3('0xc'),'port':0x18eb});var io=require(_0x45d3('0xd'))(new Redis(config[_0x45d3('0xa')]));function getAdminId(_0x28b571,_0x2511c0,_0x23f270,_0x581d66){return new Promise(function(_0x1812f8,_0x3ad2ef){var _0x22d72=![];var _0x3e41ef={'method':_0x45d3('0xe'),'uri':_0x581d66+_0x45d3('0xf'),'json':!![]};_0x3e41ef[_0x45d3('0x10')]=_0x23f270;logger[_0x45d3('0x11')]('Getting\x20admin\x20information');return rp(_0x3e41ef)[_0x45d3('0x12')](function(_0x5dcc41){if(_0x5dcc41){var _0x378c3c=_0x5dcc41[_0x45d3('0x13')];var _0x2db058=null;for(_0x2db058=0x0;_0x2db058<_0x378c3c['length'];_0x2db058++){if(_0x378c3c[_0x2db058][_0x45d3('0x14')]===_0x28b571[_0x45d3('0x15')]){_0x28b571[_0x45d3('0x16')]=_0x378c3c[_0x2db058]['id'];_0x22d72=!![];}}if(_0x22d72){logger[_0x45d3('0x11')](_0x45d3('0x17'),_0x28b571[_0x45d3('0x16')]);_0x1812f8(_0x28b571);}else{_0x3ad2ef({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3ad2ef({'statusCode':0x194,'message':_0x45d3('0x18')});}})[_0x45d3('0x19')](function(_0x38fb26){logger[_0x45d3('0x1a')]('['+[_0x2511c0[_0x45d3('0x1b')]()]+']',_0x38fb26[_0x45d3('0x1c')]);_0x3ad2ef(_0x38fb26);});});}function getUser(_0x3968cc,_0x32e2c5,_0x24ba2c){return function(_0x7a86f){return new Promise(function(_0x1baaa2,_0x2bfe77){var _0xb586fd={'method':_0x45d3('0xe'),'uri':_0x24ba2c+_0x45d3('0xf'),'json':!![]};_0xb586fd[_0x45d3('0x10')]=_0x32e2c5;logger['info'](_0x45d3('0x1d'));return rp(_0xb586fd)[_0x45d3('0x12')](function(_0x199b84){if(_0x199b84){var _0x1ebc8c=_0x199b84[_0x45d3('0x13')];var _0x2b9ded=![];var _0x16e11a=null;if(_0x7a86f[_0x45d3('0x1e')]!==null){logger['info'](_0x45d3('0x1f'),_0x7a86f['agentEmail']);_0x7a86f[_0x45d3('0x20')]=_0x7a86f[_0x45d3('0x1e')];for(_0x16e11a=0x0;_0x16e11a<_0x1ebc8c['length'];_0x16e11a++){if(_0x1ebc8c[_0x16e11a][_0x45d3('0x14')]===_0x7a86f['agentEmail']){_0x2b9ded=!![];_0x7a86f['userId']=_0x1ebc8c[_0x16e11a]['id'];logger[_0x45d3('0x11')](_0x45d3('0x21'),_0x7a86f[_0x45d3('0x22')]);}}}if(!_0x2b9ded){logger[_0x45d3('0x11')]('Admin\x20selected');_0x7a86f[_0x45d3('0x20')]=_0x7a86f[_0x45d3('0x15')];_0x7a86f[_0x45d3('0x22')]=_0x7a86f['adminId'];_0x2b9ded=!![];}if(_0x2b9ded){_0x1baaa2(_0x7a86f);}else{_0x2bfe77({'statusCode':0x194,'message':_0x45d3('0x18')});}}else{_0x2bfe77({'statusCode':0x194,'message':_0x45d3('0x18')});}})[_0x45d3('0x19')](function(_0x36b9df){logger[_0x45d3('0x1a')]('['+[_0x3968cc['toUpperCase']()]+']',_0x36b9df['message']);_0x2bfe77(_0x36b9df);});});};}function searchContact(_0x348145,_0x2f100f,_0x297ef9,_0x52ae3e){return new Promise(function(_0xe88d6,_0x5a0041){var _0x38f3cf={'method':'GET','headers':_0x2f100f,'uri':_0x348145+'/api/lookup?q='+_0x52ae3e+_0x45d3('0x23')+_0x297ef9+_0x45d3('0x24'),'json':!![]};rp(_0x38f3cf)[_0x45d3('0x12')](function(_0x122dc4){var _0x41e3ae=_[_0x45d3('0x25')](_0x122dc4[_0x45d3('0x26')][_0x45d3('0x26')],[_0x297ef9,_0x52ae3e]);_0xe88d6(_0x41e3ae);})[_0x45d3('0x19')](function(_0x20bfba){_0x5a0041(_0x20bfba);});});}function getEndUser(_0x3402c7,_0x480884,_0x5a1767){return function(_0x328a44){return new Promise(function(_0x57ae08,_0x1eaf52){logger['info'](util['format'](_0x45d3('0x27'),_0x328a44['contactNumber']));searchContact(_0x5a1767,_0x480884,_0x45d3('0x28'),_0x328a44[_0x45d3('0x29')])[_0x45d3('0x12')](function(_0x469362){if(_0x469362){_0x328a44[_0x45d3('0x2a')]=_0x469362['id'];logger['info'](_0x45d3('0x2b'),_0x328a44[_0x45d3('0x2a')]);return _0x57ae08(_0x328a44);}searchContact(_0x5a1767,_0x480884,_0x45d3('0x2c'),_0x328a44['contactNumber'])[_0x45d3('0x12')](function(_0x3940b2){if(_0x3940b2){_0x328a44[_0x45d3('0x2a')]=_0x3940b2['id'];logger[_0x45d3('0x11')]('Contact\x20found\x20work_number:',_0x328a44[_0x45d3('0x2a')]);return _0x57ae08(_0x328a44);}createEndUser(_0x328a44,_0x3402c7,_0x480884,_0x5a1767)[_0x45d3('0x12')](function(_0x26df9c){logger[_0x45d3('0x11')](_0x45d3('0x2d'),_0x26df9c[_0x45d3('0x2a')]);return _0x57ae08(_0x26df9c);});});})[_0x45d3('0x19')](function(_0x5437e6){_0x1eaf52(_0x5437e6);});});};}function createEndUser(_0x1e7a1a,_0x53b6a8,_0x3638ef,_0x1affed){return new Promise(function(_0x5ee35b,_0x3d0da2){var _0x1db042=moment();var _0x1bd426={'method':'POST','uri':_0x1affed+'/api/contacts','body':{'contact':{'last_name':_0x1e7a1a[_0x45d3('0x29')],'work_number':_0x1e7a1a[_0x45d3('0x29')],'mobile_number':_0x1e7a1a[_0x45d3('0x29')],'owner_id':_0x1e7a1a[_0x45d3('0x22')],'created_at':_0x1db042[_0x45d3('0x2e')](_0x45d3('0x2f'))}},'json':!![]};_0x1bd426[_0x45d3('0x10')]=_0x3638ef;logger['info'](_0x45d3('0x30'));return rp(_0x1bd426)[_0x45d3('0x12')](function(_0x25b5c7){_0x1e7a1a[_0x45d3('0x2a')]=_0x25b5c7[_0x45d3('0x31')]['id'];_0x5ee35b(_0x1e7a1a);})[_0x45d3('0x19')](function(_0x51fa1b){logger[_0x45d3('0x1a')]('['+[_0x53b6a8['toUpperCase']()]+']',_0x51fa1b[_0x45d3('0x1c')]);_0x3d0da2(_0x51fa1b[_0x45d3('0x1c')]);});});}function getTicket(_0x392509,_0x38a750,_0x5f04a3,_0x226664,_0x49786a){return function(_0x40e33f){logger[_0x45d3('0x11')](_0x45d3('0x32'));return new Promise(function(_0x472079,_0x425c64){var _0x2031a9=moment();var _0x13d07b={'method':_0x45d3('0x33'),'uri':_0x5f04a3+_0x45d3('0x34'),'body':{'title':intUtil[_0x45d3('0x35')](_0x226664[_0x45d3('0x36')],_0x49786a,'\x20'),'description':intUtil[_0x45d3('0x35')](_0x226664[_0x45d3('0x37')],_0x49786a,'\x0a'),'owner_id':_0x40e33f[_0x45d3('0x22')],'creater_id':_0x40e33f[_0x45d3('0x16')],'targetable_id':_0x40e33f[_0x45d3('0x2a')],'targetable_type':'Contact','created_at':_0x2031a9[_0x45d3('0x2e')](_0x45d3('0x2f')),'due_date':_0x2031a9['add'](0x1e,'m')[_0x45d3('0x2e')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x13d07b['headers']=_0x38a750;return rp(_0x13d07b)[_0x45d3('0x12')](function(_0x31474a){_0x40e33f[_0x45d3('0x38')]=_0x31474a[_0x45d3('0x39')]['id'];logger[_0x45d3('0x11')](_0x45d3('0x3a'),_0x40e33f[_0x45d3('0x38')]);_0x472079(_0x40e33f);})[_0x45d3('0x19')](function(_0x5eea68){logger[_0x45d3('0x1a')]('['+[_0x392509[_0x45d3('0x1b')]()]+']',_0x5eea68[_0x45d3('0x1c')]);_0x425c64(_0x5eea68[_0x45d3('0x1c')]);});});};}function emit(_0x33f118,_0x3db09c,_0xc3d45a){var _0x5aba0e={'uri':_0x33f118+_0x45d3('0x3b')+_0xc3d45a};io['to'](util['format'](_0x45d3('0x3c'),_0x3db09c))[_0x45d3('0x3d')](_0x45d3('0x3e'),_0x5aba0e);}exports['cs']=function(_0xf08f04,_0x130f3e,_0x3bac94,_0x3724c6,_0x818932,_0x50a94b,_0x286bef,_0x337d4f){var _0x5f0289={};var _0x1b618d={'Authorization':_0x45d3('0x3f')+_0x50a94b[_0x45d3('0x40')]};_0x50a94b[_0x45d3('0x41')]=intUtil['stripTrailingSlash'](_0x50a94b[_0x45d3('0x41')]);_0x50a94b['serverUrl']=intUtil['stripTrailingSlash'](_0x50a94b['serverUrl']);var _0x23a8ee=_0x50a94b['remoteUri'];_0x5f0289[_0x45d3('0x15')]=_0x50a94b[_0x45d3('0x42')];_0x5f0289[_0x45d3('0x29')]=_0x337d4f[_0x45d3('0x43')]()===_0x45d3('0x44')?_0x130f3e[_0x45d3('0x45')]:_0x130f3e['calleridnum'];_0x5f0289[_0x45d3('0x46')]=_0x337d4f===_0x45d3('0x47')||_0x337d4f==='unmanaged'?_0x45d3('0x47'):_0x45d3('0x44');if(_0x3724c6){_0x5f0289['agentEmail']=_0x3724c6['email'];}var _0x44d726=util['format'](_0x45d3('0x48'),_0x50a94b['serverUrl'],_0x130f3e['uniqueid'],md5(_0x130f3e[_0x45d3('0x49')]));if(_0x818932&&_0x818932[_0x45d3('0x4a')]){logger[_0x45d3('0x11')](_0x45d3('0x4b'),_0x45d3('0x4c'));_0x130f3e['recordingURL']=_0x44d726;}else if(_0x286bef&&_0x286bef['recordingFormat']&&_0x286bef[_0x45d3('0x4d')]!==_0x45d3('0x4e')){logger[_0x45d3('0x11')](_0x45d3('0x4f'),_0x45d3('0x4c'));_0x130f3e['recordingURL']=_0x44d726;}else{_0x130f3e[_0x45d3('0x50')]='';}return getAdminId(_0x5f0289,_0x337d4f,_0x1b618d,_0x23a8ee)[_0x45d3('0x12')](getUser(_0x337d4f,_0x1b618d,_0x23a8ee))[_0x45d3('0x12')](getEndUser(_0x337d4f,_0x1b618d,_0x23a8ee))['then'](getTicket(_0x337d4f,_0x1b618d,_0x23a8ee,_0x3bac94,_0x130f3e))[_0x45d3('0x12')](function(_0x1cbce4){logger[_0x45d3('0x11')](util[_0x45d3('0x2e')](_0x45d3('0x51'),_0x1cbce4[_0x45d3('0x38')]));if(_0x337d4f!==_0x45d3('0x52')){logger['info']('['+[_0x337d4f[_0x45d3('0x1b')]()]+']',_0x45d3('0x53'));emit(_0x23a8ee,_0x3724c6[_0x45d3('0x54')],_0x1cbce4[_0x45d3('0x2a')]);}})[_0x45d3('0x19')](function(_0x554f8b){logger['error']('['+[_0x337d4f[_0x45d3('0x1b')]()]+_0x45d3('0x55'),util['inspect'](_0x554f8b,{'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 367e63a..f6552f3 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 _0xae19=['routeId','log','EVENT\x20UNKNOWN','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','find','Configurations','data3','queue'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0xae19,0x7e));var _0x9ae1=function(_0x5844c3,_0x13fc8c){_0x5844c3=_0x5844c3-0x0;var _0x3a4d56=_0xae19[_0x5844c3];return _0x3a4d56;};'use strict';var _=require('lodash');var util=require(_0x9ae1('0x0'));var zendesk=require(_0x9ae1('0x1'));var salesforce=require(_0x9ae1('0x2'));var sugarcrm=require(_0x9ae1('0x3'));var freshdesk=require(_0x9ae1('0x4'));var zoho=require(_0x9ae1('0x5'));var desk=require('./desk');var vtiger=require(_0x9ae1('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0x9ae1('0x7'));var freshsales=require(_0x9ae1('0x8'));var integrations=[_0x9ae1('0x9'),_0x9ae1('0xa'),_0x9ae1('0xb'),_0x9ae1('0xc'),_0x9ae1('0xd'),'desk',_0x9ae1('0xe'),_0x9ae1('0xf'),_0x9ae1('0x10'),_0x9ae1('0x11')];exports[_0x9ae1('0x12')]=function(_0x4007f4,_0x39ece6,_0x500a6e,_0x355a2f,_0x223eef,_0x16d8d1){if(_0x500a6e){if(_[_0x9ae1('0x13')](integrations,_0x4007f4['data1'][_0x9ae1('0x14')]())){try{var _0x2c32dd=null;var _0x140fe4='';var _0xad688b=_0x500a6e[_0x4007f4[_0x9ae1('0x15')]['toLowerCase']()];if(_0xad688b){var _0x530d68=_0xad688b[_0x4007f4['data2']];if(_0x530d68){var _0x4834e3=_[_0x9ae1('0x16')](_0x530d68[_0x9ae1('0x17')],{'id':parseInt(_0x4007f4[_0x9ae1('0x18')],0xa)});if(_0x4834e3){if(_0x355a2f){if(_0x223eef&&_0x39ece6[_0x9ae1('0x19')]){_0x140fe4=_0x9ae1('0x19');}else if(_0x39ece6[_0x9ae1('0x1a')]){_0x140fe4='outbound';}else{console[_0x9ae1('0x1b')](_0x9ae1('0x1c'),_0x39ece6);}}else{_0x140fe4='unmanaged';}switch(_0x4007f4[_0x9ae1('0x15')][_0x9ae1('0x14')]()){case _0x9ae1('0x9'):zendesk[_0x140fe4](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1);break;case _0x9ae1('0xa'):salesforce[_0x140fe4](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1);break;case _0x9ae1('0xb'):sugarcrm[_0x140fe4](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1);break;case _0x9ae1('0xc'):freshdesk[_0x140fe4](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1);break;case _0x9ae1('0xd'):zoho[_0x140fe4](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1);break;case _0x9ae1('0x1d'):desk[_0x140fe4](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1);break;case _0x9ae1('0xe'):vtiger[_0x140fe4](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1);break;case _0x9ae1('0x10'):freshsales['cs'](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1,_0x140fe4);break;case'servicenow':servicenow['cs'](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1,_0x140fe4);break;case _0x9ae1('0xf'):dynamics365['cs'](_0x4007f4,_0x39ece6,_0x4834e3,_0x355a2f,_0x223eef,_0x530d68,_0x16d8d1,_0x140fe4);break;default:console[_0x9ae1('0x1b')](_0x9ae1('0x1e'));}}else{_0x2c32dd=require(_0x9ae1('0x1f'))(_0x4007f4[_0x9ae1('0x15')][_0x9ae1('0x14')]());_0x2c32dd[_0x9ae1('0x20')](_0x9ae1('0x21'),util[_0x9ae1('0x22')](_0x9ae1('0x23'),_0x4007f4[_0x9ae1('0x15')][_0x9ae1('0x14')](),_0x4007f4[_0x9ae1('0x18')]));}}else{_0x2c32dd=require(_0x9ae1('0x1f'))(_0x4007f4[_0x9ae1('0x15')][_0x9ae1('0x14')]());_0x2c32dd[_0x9ae1('0x20')](_0x9ae1('0x21'),util[_0x9ae1('0x22')](_0x9ae1('0x24'),_0x4007f4[_0x9ae1('0x15')][_0x9ae1('0x14')](),_0x4007f4[_0x9ae1('0x25')]));}}else{}}catch(_0x19c3bd){console['error'](_0x19c3bd);}}}}; \ No newline at end of file +var _0xb6fd=['data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','vtiger','../../../../config/logger','error','[EXEC]','format','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','desk','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations'];(function(_0x483c67,_0x32ebc0){var _0x14a221=function(_0x4c1762){while(--_0x4c1762){_0x483c67['push'](_0x483c67['shift']());}};_0x14a221(++_0x32ebc0);}(_0xb6fd,0x189));var _0xdb6f=function(_0xaec4dd,_0xcec122){_0xaec4dd=_0xaec4dd-0x0;var _0x3a87e7=_0xb6fd[_0xaec4dd];return _0x3a87e7;};'use strict';var _=require(_0xdb6f('0x0'));var util=require(_0xdb6f('0x1'));var zendesk=require(_0xdb6f('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0xdb6f('0x3'));var freshdesk=require(_0xdb6f('0x4'));var zoho=require(_0xdb6f('0x5'));var desk=require(_0xdb6f('0x6'));var vtiger=require(_0xdb6f('0x7'));var servicenow=require(_0xdb6f('0x8'));var dynamics365=require(_0xdb6f('0x9'));var freshsales=require('./freshsales');var integrations=[_0xdb6f('0xa'),_0xdb6f('0xb'),'sugarcrm',_0xdb6f('0xc'),_0xdb6f('0xd'),_0xdb6f('0xe'),'vtiger',_0xdb6f('0xf'),_0xdb6f('0x10'),_0xdb6f('0x11')];exports[_0xdb6f('0x12')]=function(_0x240b3d,_0x4e2b01,_0x42c741,_0x211a54,_0x5d6b14,_0x42cca7){if(_0x42c741){if(_[_0xdb6f('0x13')](integrations,_0x240b3d[_0xdb6f('0x14')][_0xdb6f('0x15')]())){try{var _0x3747b8=null;var _0x5ea26e='';var _0x4a49ba=_0x42c741[_0x240b3d['data1'][_0xdb6f('0x15')]()];if(_0x4a49ba){var _0x51dcd0=_0x4a49ba[_0x240b3d[_0xdb6f('0x16')]];if(_0x51dcd0){var _0x17edd5=_[_0xdb6f('0x17')](_0x51dcd0[_0xdb6f('0x18')],{'id':parseInt(_0x240b3d[_0xdb6f('0x19')],0xa)});if(_0x17edd5){if(_0x211a54){if(_0x5d6b14&&_0x4e2b01[_0xdb6f('0x1a')]){_0x5ea26e=_0xdb6f('0x1a');}else if(_0x4e2b01[_0xdb6f('0x1b')]){_0x5ea26e=_0xdb6f('0x1c');}else{console[_0xdb6f('0x1d')](_0xdb6f('0x1e'),_0x4e2b01);}}else{_0x5ea26e=_0xdb6f('0x1f');}switch(_0x240b3d['data1'][_0xdb6f('0x15')]()){case _0xdb6f('0xa'):zendesk[_0x5ea26e](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7);break;case _0xdb6f('0xb'):salesforce[_0x5ea26e](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7);break;case _0xdb6f('0x20'):sugarcrm[_0x5ea26e](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7);break;case _0xdb6f('0xc'):freshdesk[_0x5ea26e](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7);break;case _0xdb6f('0xd'):zoho[_0x5ea26e](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7);break;case _0xdb6f('0xe'):desk[_0x5ea26e](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7);break;case _0xdb6f('0x21'):vtiger[_0x5ea26e](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7);break;case _0xdb6f('0x10'):freshsales['cs'](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7,_0x5ea26e);break;case _0xdb6f('0x11'):servicenow['cs'](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7,_0x5ea26e);break;case'dynamics365':dynamics365['cs'](_0x240b3d,_0x4e2b01,_0x17edd5,_0x211a54,_0x5d6b14,_0x51dcd0,_0x42cca7,_0x5ea26e);break;default:console[_0xdb6f('0x1d')]('unknown\x20integration');}}else{_0x3747b8=require(_0xdb6f('0x22'))(_0x240b3d[_0xdb6f('0x14')][_0xdb6f('0x15')]());_0x3747b8[_0xdb6f('0x23')](_0xdb6f('0x24'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x240b3d[_0xdb6f('0x14')]['toLowerCase'](),_0x240b3d['data3']));}}else{_0x3747b8=require(_0xdb6f('0x22'))(_0x240b3d['data1'][_0xdb6f('0x15')]());_0x3747b8[_0xdb6f('0x23')](_0xdb6f('0x24'),util[_0xdb6f('0x25')]('%s\x20account\x20#%s\x20not\x20found',_0x240b3d['data1'][_0xdb6f('0x15')](),_0x240b3d['data2']));}}else{}}catch(_0x57e9e1){console[_0xdb6f('0x23')](_0x57e9e1);}}}}; \ 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 4c4aea5..f553f14 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 _0x626f=['Variable','name','password','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','format','uniqueid','email','calleridnum','Fields','[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','trigger:browser:url','instanceUrl','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','error','toUpperCase','isNil','calleridname','lastevent',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','endUserType','contact','lead','WhoId','Case','account','AccountId','leadId','info','create','validateEmail','length','find','Email','Agent\x20%s\x20found.','Name','identity','then','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','sobject','execute','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','first','type','toLowerCase','moduleCreate','LastName','','Caller\x20-\x20%s','Company','No\x20Company','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','forEach','picklist','idField','content','variable','variableName','toString'];(function(_0x56d64a,_0x5414ff){var _0x3c0704=function(_0x32e4ea){while(--_0x32e4ea){_0x56d64a['push'](_0x56d64a['shift']());}};_0x3c0704(++_0x5414ff);}(_0x626f,0xa0));var _0xf626=function(_0x36ffe8,_0x51db3f){_0x36ffe8=_0x36ffe8-0x0;var _0x375c72=_0x626f[_0x36ffe8];return _0x375c72;};'use strict';var _=require('lodash');var rp=require(_0xf626('0x0'));var moment=require(_0xf626('0x1'));var BPromise=require(_0xf626('0x2'));var md5=require(_0xf626('0x3'));var jsforce=require(_0xf626('0x4'));var util=require(_0xf626('0x5'));var Redis=require(_0xf626('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xf626('0x7'));config[_0xf626('0x8')]=_[_0xf626('0x9')](config[_0xf626('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf626('0xa'))(new Redis(config['redis']));function emit(_0x3955cf,_0x344472,_0x460d2a){io['to'](_0x3955cf)[_0xf626('0xb')](_0x344472,_0x460d2a);}function getTicket(_0xa3b814,_0x44c0c5,_0x365a23,_0x233af2,_0x14494d,_0x31574e,_0x45f0af,_0x1fa5c4){var _0x1803ba=Object[_0xf626('0xc')]({},{'OwnerId':_0x44c0c5['id'],'Subject':intUtil[_0xf626('0xd')](_0x233af2[_0xf626('0xe')],_0x14494d,'\x20'),'Description':intUtil['getString'](_0x233af2[_0xf626('0xf')],_0x14494d,'\x0a')},getCustomFields(_0x31574e,_0x14494d));if(_0x365a23){if(_0x233af2[_0xf626('0x10')]===_0xf626('0x11')){_0x1803ba['ActivityDate']=moment[_0xf626('0x12')]();_0x1803ba[_0xf626('0x13')]=![];_0x1803ba['IsRecurrence']=![];if(_0x365a23[_0xf626('0x14')]===_0xf626('0x15')||_0x365a23[_0xf626('0x14')]===_0xf626('0x16')){_0x1803ba[_0xf626('0x17')]=_0x365a23['id'];}else if(_0x365a23[_0xf626('0x14')]==='account'){_0x1803ba['WhatId']=_0x365a23['id'];}}else if(_0x233af2['ticketType']===_0xf626('0x18')){if(_0x365a23['endUserType']==='contact'){_0x1803ba['ContactId']=_0x365a23['id'];}else if(_0x365a23[_0xf626('0x14')]===_0xf626('0x19')){_0x1803ba[_0xf626('0x1a')]=_0x365a23['id'];}else if(_0x365a23[_0xf626('0x14')]==='lead'&&_0x233af2[_0xf626('0x1b')]){_0x1803ba[_0x233af2[_0xf626('0x1b')]]=_0x365a23['id'];}else{logger[_0xf626('0x1c')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x45f0af['sobject'](_0x233af2[_0xf626('0x10')])[_0xf626('0x1d')](_0x1803ba);}function getUser(_0x286cae,_0x34557a,_0x1915a2){if(!_['isNil'](_0x34557a)&&intUtil[_0xf626('0x1e')](_0x34557a)){var _0x7142a9={'Email':_0x34557a};var _0x413972={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1915a2['sobject']('User')['find'](_0x7142a9,_0x413972)['execute']()['then'](function(_0x294f19){if(_0x294f19[_0xf626('0x1f')]){var _0x2f46ad=_[_0xf626('0x20')](_0x294f19,function(_0x5c7beb){return _0x5c7beb[_0xf626('0x21')]===_0x34557a;});if(_0x2f46ad){logger['info'](_0xf626('0x22'),_0x34557a);return BPromise['resolve']({'id':_0x2f46ad['Id'],'name':_0x2f46ad[_0xf626('0x23')]});}}else{logger[_0xf626('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x34557a);return _0x1915a2[_0xf626('0x24')]()[_0xf626('0x25')](function(_0x4c627c){return BPromise['resolve']({'id':_0x4c627c[_0xf626('0x26')],'name':_0x4c627c['display_name']});});}});}else{logger[_0xf626('0x1c')](_0xf626('0x27'),_0x34557a);return _0x1915a2[_0xf626('0x24')]()[_0xf626('0x25')](function(_0x142eb9){return BPromise[_0xf626('0x28')]({'id':_0x142eb9[_0xf626('0x26')],'name':_0x142eb9[_0xf626('0x29')]});});}}function getEndUser(_0xd074d6,_0x317202,_0xe9c710,_0x53762e,_0x17b7f2){var _0x4329ed={'$or':{'Phone':_0x53762e}};var _0x4d47f1={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xf626('0x25')](function(){logger[_0xf626('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x53762e,_0x317202['moduleSearch']);switch(_0x317202[_0xf626('0x2a')]){case _0xf626('0x2b'):var _0xe5f8a9=_[_0xf626('0x2c')](_0x4329ed);if(_0x317202[_0xf626('0x2d')]){var _0x416ac2={};_0x416ac2[_0x317202[_0xf626('0x2d')]]=_0x53762e;_[_0xf626('0x2e')](_0xe5f8a9[_0xf626('0x2f')],_0x416ac2);}return _0x17b7f2[_0xf626('0x30')]('Contact')['find'](_0xe5f8a9,_0x4d47f1)[_0xf626('0x31')]()['then'](function(_0x2cd1ea){if(_0x2cd1ea&&_0x2cd1ea[_0xf626('0x1f')]){return _0x2cd1ea;}else{var _0x4a3bd4=_['cloneDeep'](_0x4329ed);if(_0x317202[_0xf626('0x32')]){var _0x5b6075={};_0x5b6075[_0x317202[_0xf626('0x32')]]=_0x53762e;_[_0xf626('0x2e')](_0x4a3bd4['$or'],_0x5b6075);}return _0x17b7f2[_0xf626('0x30')](_0xf626('0x33'))[_0xf626('0x20')](_0x4a3bd4,_0x4d47f1);}});case'account_contact_lead':var _0x25dc3e=_[_0xf626('0x2c')](_0x4329ed);if(_0x317202[_0xf626('0x34')]){var _0x416ac2={};_0x416ac2[_0x317202['additionalSearchAccount']]=_0x53762e;_['merge'](_0x25dc3e[_0xf626('0x2f')],_0x416ac2);}return _0x17b7f2[_0xf626('0x30')](_0xf626('0x35'))[_0xf626('0x20')](_0x25dc3e,_0x4d47f1)[_0xf626('0x31')]()[_0xf626('0x25')](function(_0x1d9826){if(_0x1d9826&&_0x1d9826[_0xf626('0x1f')]){return _0x1d9826;}else{var _0x278377=_['cloneDeep'](_0x4329ed);if(_0x317202[_0xf626('0x2d')]){var _0x55c535={};_0x55c535[_0x317202[_0xf626('0x2d')]]=_0x53762e;_[_0xf626('0x2e')](_0x278377[_0xf626('0x2f')],_0x55c535);}return _0x17b7f2['sobject'](_0xf626('0x36'))['find'](_0x278377,_0x4d47f1)[_0xf626('0x25')](function(_0x4bc425){if(_0x4bc425&&_0x4bc425[_0xf626('0x1f')]){return _0x4bc425;}else{var _0x367910=_[_0xf626('0x2c')](_0x4329ed);if(_0x317202['additionalSearchLead']){var _0x2b6d2e={};_0x2b6d2e[_0x317202[_0xf626('0x32')]]=_0x53762e;_['merge'](_0x367910[_0xf626('0x2f')],_0x2b6d2e);}return _0x17b7f2[_0xf626('0x30')](_0xf626('0x33'))[_0xf626('0x20')](_0x367910,_0x4d47f1);}});}});case _0xf626('0x15'):var _0xe5f8a9=_[_0xf626('0x2c')](_0x4329ed);if(_0x317202[_0xf626('0x2d')]){var _0x416ac2={};_0x416ac2[_0x317202['additionalSearchContact']]=_0x53762e;_[_0xf626('0x2e')](_0xe5f8a9[_0xf626('0x2f')],_0x416ac2);}return _0x17b7f2[_0xf626('0x30')](_0xf626('0x36'))['find'](_0xe5f8a9,_0x4d47f1)[_0xf626('0x31')]();case _0xf626('0x16'):var _0x4f5e55=_['cloneDeep'](_0x4329ed);if(_0x317202[_0xf626('0x32')]){var _0x416ac2={};_0x416ac2[_0x317202[_0xf626('0x32')]]=_0x53762e;_[_0xf626('0x2e')](_0x4f5e55[_0xf626('0x2f')],_0x416ac2);}return _0x17b7f2[_0xf626('0x30')](_0xf626('0x33'))[_0xf626('0x20')](_0x4f5e55,_0x4d47f1);case _0xf626('0x19'):var _0x25dc3e=_['cloneDeep'](_0x4329ed);if(_0x317202[_0xf626('0x34')]){var _0x416ac2={};_0x416ac2[_0x317202[_0xf626('0x34')]]=_0x53762e;_[_0xf626('0x2e')](_0x25dc3e[_0xf626('0x2f')],_0x416ac2);}return _0x17b7f2[_0xf626('0x30')]('Account')[_0xf626('0x20')](_0x25dc3e,_0x4d47f1);default:return null;}})[_0xf626('0x25')](function(_0x59bbc4){if(_0x59bbc4&&_0x59bbc4['length']){var _0xd72445=_[_0xf626('0x37')](_0x59bbc4);if(_0xd72445){return BPromise[_0xf626('0x28')]({'id':_0xd72445['Id'],'name':_0xd72445['Name'],'phone':_0xd72445['Phone'],'endUserType':_0xd72445['attributes'][_0xf626('0x38')][_0xf626('0x39')]()});}}})[_0xf626('0x25')](function(_0x3e5548){if(_0x3e5548){logger[_0xf626('0x1c')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x3e5548[_0xf626('0x14')],_0x53762e);return BPromise[_0xf626('0x28')](_0x3e5548);}else{logger[_0xf626('0x1c')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x53762e);var _0x2b1ee2={'Phone':_0x53762e};if(_0x317202[_0xf626('0x3a')]){if(_0x317202[_0xf626('0x3a')]===_0xf626('0x15')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x53762e,_0x317202[_0xf626('0x3a')]);_0x2b1ee2[_0xf626('0x3b')]=_0xe9c710!==_0xf626('0x3c')?_0xe9c710:util['format'](_0xf626('0x3d'),_0x53762e);}else if(_0x317202['moduleCreate']===_0xf626('0x16')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x53762e,_0x317202[_0xf626('0x3a')]);_0x2b1ee2[_0xf626('0x3b')]=_0xe9c710!==''?_0xe9c710:util['format']('Caller\x20-\x20%s',_0x53762e);_0x2b1ee2[_0xf626('0x3e')]=_0xf626('0x3f');}else if(_0x317202[_0xf626('0x3a')]===_0xf626('0x19')){logger['info'](_0xf626('0x40'),_0x53762e,_0x317202[_0xf626('0x3a')]);_0x2b1ee2[_0xf626('0x23')]=_0xe9c710!==''?_0xe9c710:util['format'](_0xf626('0x3d'),_0x53762e);}else{return null;}}return _0x17b7f2['sobject'](_['upperFirst'](_0x317202[_0xf626('0x3a')]))[_0xf626('0x1d')](_0x2b1ee2)[_0xf626('0x25')](function(_0xabac69){return BPromise[_0xf626('0x28')]({'id':_0xabac69['id'],'endUserType':_0x317202[_0xf626('0x3a')]});});}});}function getCustomFields(_0x497771,_0x358847){var _0x4df0ff={};if(_0x497771['length']>0x0){_[_0xf626('0x41')](_0x497771,function(_0x27446a){if(_['includes'](['string',_0xf626('0x42')],_0x27446a[_0xf626('0x38')])&&_0x27446a['idField']){_0x4df0ff[_0x27446a[_0xf626('0x43')]]=_0x27446a[_0xf626('0x44')]['toString']();}else if(_0x27446a['type']===_0xf626('0x45')&&_0x27446a['variableName']&&_0x27446a[_0xf626('0x43')]){_0x358847[_0x27446a[_0xf626('0x46')]]&&(_0x4df0ff[_0x27446a[_0xf626('0x43')]]=_0x358847[_0x27446a[_0xf626('0x46')]][_0xf626('0x47')]());}else if(_0x27446a[_0xf626('0x38')]==='customVariable'&&_0x27446a[_0xf626('0x48')]&&_0x27446a[_0xf626('0x48')][_0xf626('0x49')]&&_0x27446a['idField']){_0x358847[_0x27446a[_0xf626('0x48')][_0xf626('0x49')][_0xf626('0x39')]()]&&(_0x4df0ff[_0x27446a['idField']]=_0x358847[_0x27446a[_0xf626('0x48')][_0xf626('0x49')][_0xf626('0x39')]()][_0xf626('0x47')]());}});}return _0x4df0ff;}function getConnection(_0x2b3713){var _0x2c3bbc=_0x2b3713[_0xf626('0x4a')]['concat'](_0x2b3713['securityToken']);var _0x28b616=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2b3713[_0xf626('0x4b')]||_0xf626('0x4c'),'clientId':_0x2b3713[_0xf626('0x4d')],'clientSecret':_0x2b3713['clientSecret']}});return _0x28b616[_0xf626('0x4e')](_0x2b3713[_0xf626('0x4f')],_0x2c3bbc)['then'](function(){logger['info'](_0xf626('0x50'));return _0x28b616;});}exports[_0xf626('0x51')]=function(_0x2cec3f,_0x5a8adb,_0x38d202,_0x185f27,_0x1cf9fb,_0x407d45){var _0x4c7996,_0x5b08cb,_0x18ce7c,_0x34a938;_0x407d45[_0xf626('0x52')]=intUtil[_0xf626('0x53')](_0x407d45[_0xf626('0x52')]);_0x407d45[_0xf626('0x4b')]=intUtil['stripTrailingSlash'](_0x407d45[_0xf626('0x4b')]);if(_0x1cf9fb&&_0x1cf9fb[_0xf626('0x54')]){logger[_0xf626('0x1c')]('[QUEUE]',_0xf626('0x55'));_0x5a8adb[_0xf626('0x56')]=util[_0xf626('0x57')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x407d45[_0xf626('0x52')],_0x5a8adb[_0xf626('0x58')],md5(_0x5a8adb[_0xf626('0x58')]));}else{_0x5a8adb[_0xf626('0x56')]='';}return getConnection(_0x407d45)[_0xf626('0x25')](function(_0x1eb86d){_0x34a938=_0x1eb86d;return getUser(_0x407d45,_0x185f27[_0xf626('0x59')],_0x34a938);})[_0xf626('0x25')](function(_0xba5c1f){_0x4c7996=_0xba5c1f;return getEndUser(_0x407d45,_0x38d202,_0x5a8adb['calleridname'],_0x5a8adb[_0xf626('0x5a')],_0x34a938);})[_0xf626('0x25')](function(_0x283d58){_0x5b08cb=_0x283d58;return getTicket(_0x407d45,_0x4c7996,_0x5b08cb,_0x38d202,_0x5a8adb,_0x38d202[_0xf626('0x5b')],_0x34a938,'queue');})['then'](function(_0x7b932b){_0x18ce7c=_0x7b932b;logger[_0xf626('0x1c')](_0xf626('0x5c'),_0x18ce7c['id']);logger[_0xf626('0x1c')](_0xf626('0x5d'),_0x18ce7c['id'],_0x185f27[_0xf626('0x49')],_0x407d45[_0xf626('0x38')]);switch(_0x407d45[_0xf626('0x38')]){case _0xf626('0x5e'):emit(util[_0xf626('0x57')](_0xf626('0x5f'),_0x185f27[_0xf626('0x49')]),_0xf626('0x60'),{'recordId':_0x18ce7c['id']});break;case'newTab':emit(util['format'](_0xf626('0x5f'),_0x185f27[_0xf626('0x49')]),_0xf626('0x61'),{'uri':util[_0xf626('0x57')]('%s/%s/e',_0x34a938[_0xf626('0x62')],_0x18ce7c['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x414b55){logger['error'](_0xf626('0x63'),_0x414b55);});};exports[_0xf626('0x64')]=function(_0x41c2c2,_0x22f01d,_0x1f5792,_0x21b69e,_0x4abb23,_0xef9c5c,_0x18a3dd){var _0x577733,_0x2ae465,_0x5a6250,_0x51a636;_0xef9c5c['serverUrl']=intUtil[_0xf626('0x53')](_0xef9c5c['serverUrl']);_0xef9c5c[_0xf626('0x4b')]=intUtil[_0xf626('0x53')](_0xef9c5c[_0xf626('0x4b')]);if(_0x18a3dd&&_0x18a3dd[_0xf626('0x65')]&&_0x18a3dd['recordingFormat']!==_0xf626('0x66')){logger[_0xf626('0x1c')](_0xf626('0x67'),_0xf626('0x55'));_0x22f01d[_0xf626('0x56')]=util['format'](_0xf626('0x68'),_0xef9c5c[_0xf626('0x52')],_0x22f01d[_0xf626('0x58')],md5(_0x22f01d[_0xf626('0x58')]));}return getConnection(_0xef9c5c)[_0xf626('0x25')](function(_0x262f29){_0x51a636=_0x262f29;return getUser(_0xef9c5c,_0x21b69e['email'],_0x51a636);})[_0xf626('0x25')](function(_0x727b5e){_0x577733=_0x727b5e;return getEndUser(_0xef9c5c,_0x1f5792,_0x22f01d['destcalleridname'],_0x22f01d[_0xf626('0x69')],_0x51a636);})['then'](function(_0x2b02e7){_0x2ae465=_0x2b02e7;return getTicket(_0xef9c5c,_0x577733,_0x2ae465,_0x1f5792,_0x22f01d,_0x1f5792[_0xf626('0x5b')],_0x51a636,'outbound');})['then'](function(_0x591219){_0x5a6250=_0x591219;logger[_0xf626('0x1c')](_0xf626('0x6a'),_0x5a6250['id']);logger[_0xf626('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5a6250['id'],_0x21b69e[_0xf626('0x49')],_0xef9c5c['type']);switch(_0xef9c5c[_0xf626('0x38')]){case'integrationTab':emit(util[_0xf626('0x57')](_0xf626('0x5f'),_0x21b69e[_0xf626('0x49')]),_0xf626('0x60'),{'recordId':_0x5a6250['id']});break;case _0xf626('0x6b'):emit(util[_0xf626('0x57')](_0xf626('0x5f'),_0x21b69e['name']),_0xf626('0x61'),{'uri':util[_0xf626('0x57')]('%s/%s/e',_0x51a636[_0xf626('0x62')],_0x5a6250['id'])});break;default:logger['error'](_0xf626('0x67'),_0xf626('0x6c'));}})[_0xf626('0x6d')](function(_0x1b75a9){logger[_0xf626('0x6e')](_0xf626('0x67'),_0x1b75a9);});};exports['unmanaged']=function(_0x524b43,_0x5ecd3f,_0x4a2c50,_0x2e40ec,_0x2108ad,_0x464673){var _0x98132,_0x434f2d,_0xbd8699,_0x35c759;_0x464673[_0xf626('0x52')]=intUtil[_0xf626('0x53')](_0x464673[_0xf626('0x52')]);_0x464673[_0xf626('0x4b')]=intUtil['stripTrailingSlash'](_0x464673['remoteUri']);if(_0x2108ad&&_0x2108ad['monitor_format']){logger['info']('['+_0x5ecd3f['lastevent'][_0xf626('0x6f')]()+']',_0xf626('0x55'));_0x5ecd3f[_0xf626('0x56')]=util[_0xf626('0x57')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x464673[_0xf626('0x52')],_0x5ecd3f['uniqueid'],md5(_0x5ecd3f['uniqueid']));}else{_0x5ecd3f[_0xf626('0x56')]='';}return getConnection(_0x464673)[_0xf626('0x25')](function(_0x5d24e6){_0x35c759=_0x5d24e6;if(!_[_0xf626('0x70')](_0x2e40ec)){return getUser(_0x464673,_0x2e40ec[_0xf626('0x49')],_0x35c759);}else{return getUser(_0x464673,null,_0x35c759);}})[_0xf626('0x25')](function(_0x2de6ad){_0x98132=_0x2de6ad;return getEndUser(_0x464673,_0x4a2c50,_0x5ecd3f[_0xf626('0x71')],_0x5ecd3f[_0xf626('0x5a')],_0x35c759);})[_0xf626('0x25')](function(_0x55f8ec){_0x434f2d=_0x55f8ec;return getTicket(_0x464673,_0x98132,_0x434f2d,_0x4a2c50,_0x5ecd3f,_0x4a2c50[_0xf626('0x5b')],_0x35c759);})[_0xf626('0x25')](function(_0x44196c){_0xbd8699=_0x44196c;logger[_0xf626('0x1c')]('['+_0x5ecd3f[_0xf626('0x72')][_0xf626('0x6f')]()+']\x20Ticket\x20%s\x20created.',_0xbd8699['id']);logger[_0xf626('0x1c')]('['+_0x5ecd3f[_0xf626('0x72')][_0xf626('0x6f')]()+_0xf626('0x73'),_0x464673[_0xf626('0x38')]);})[_0xf626('0x6d')](function(_0x183ca4){logger['error']('['+_0x5ecd3f[_0xf626('0x72')][_0xf626('0x6f')]()+']',_0x183ca4);});}; \ No newline at end of file +var _0x4092=['ContactId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','User','find','execute','then','length','Email','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','sobject','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','toLowerCase','moduleCreate','LastName','format','Caller\x20-\x20%s','','Company','No\x20Company','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','isNil','calleridname',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','Subjects','ticketType','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','Case'];(function(_0x841ab7,_0x34f2d5){var _0xc5bbf2=function(_0x21a977){while(--_0x21a977){_0x841ab7['push'](_0x841ab7['shift']());}};_0xc5bbf2(++_0x34f2d5);}(_0x4092,0x1e0));var _0x2409=function(_0x3c7e26,_0x3cc265){_0x3c7e26=_0x3c7e26-0x0;var _0x530070=_0x4092[_0x3c7e26];return _0x530070;};'use strict';var _=require('lodash');var rp=require(_0x2409('0x0'));var moment=require(_0x2409('0x1'));var BPromise=require(_0x2409('0x2'));var md5=require(_0x2409('0x3'));var jsforce=require('jsforce');var util=require(_0x2409('0x4'));var Redis=require(_0x2409('0x5'));var intUtil=require(_0x2409('0x6'));var config=require(_0x2409('0x7'));var logger=require(_0x2409('0x8'))(_0x2409('0x9'));config[_0x2409('0xa')]=_[_0x2409('0xb')](config[_0x2409('0xa')],{'host':_0x2409('0xc'),'port':0x18eb});var io=require(_0x2409('0xd'))(new Redis(config[_0x2409('0xa')]));function emit(_0x152521,_0x441744,_0x4f748c){io['to'](_0x152521)[_0x2409('0xe')](_0x441744,_0x4f748c);}function getTicket(_0x4ac512,_0x40c0d2,_0xdc2f98,_0xbb2e14,_0x527c43,_0x551b69,_0x1e8b6b,_0x5ef21b){var _0x20fddd=Object[_0x2409('0xf')]({},{'OwnerId':_0x40c0d2['id'],'Subject':intUtil['getString'](_0xbb2e14[_0x2409('0x10')],_0x527c43,'\x20'),'Description':intUtil['getString'](_0xbb2e14['Descriptions'],_0x527c43,'\x0a')},getCustomFields(_0x551b69,_0x527c43));if(_0xdc2f98){if(_0xbb2e14[_0x2409('0x11')]==='Task'){_0x20fddd[_0x2409('0x12')]=moment[_0x2409('0x13')]();_0x20fddd[_0x2409('0x14')]=![];_0x20fddd['IsRecurrence']=![];if(_0xdc2f98[_0x2409('0x15')]===_0x2409('0x16')||_0xdc2f98[_0x2409('0x15')]===_0x2409('0x17')){_0x20fddd[_0x2409('0x18')]=_0xdc2f98['id'];}else if(_0xdc2f98[_0x2409('0x15')]===_0x2409('0x19')){_0x20fddd[_0x2409('0x1a')]=_0xdc2f98['id'];}}else if(_0xbb2e14[_0x2409('0x11')]===_0x2409('0x1b')){if(_0xdc2f98[_0x2409('0x15')]==='contact'){_0x20fddd[_0x2409('0x1c')]=_0xdc2f98['id'];}else if(_0xdc2f98[_0x2409('0x15')]==='account'){_0x20fddd['AccountId']=_0xdc2f98['id'];}else if(_0xdc2f98['endUserType']==='lead'&&_0xbb2e14[_0x2409('0x1d')]){_0x20fddd[_0xbb2e14[_0x2409('0x1d')]]=_0xdc2f98['id'];}else{logger['info'](_0x2409('0x1e'));}}}return _0x1e8b6b['sobject'](_0xbb2e14[_0x2409('0x11')])[_0x2409('0x1f')](_0x20fddd);}function getUser(_0x3bda43,_0x55fb90,_0x4a8c2d){if(!_['isNil'](_0x55fb90)&&intUtil[_0x2409('0x20')](_0x55fb90)){var _0x194bb5={'Email':_0x55fb90};var _0x1807f0={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4a8c2d['sobject'](_0x2409('0x21'))[_0x2409('0x22')](_0x194bb5,_0x1807f0)[_0x2409('0x23')]()[_0x2409('0x24')](function(_0x319227){if(_0x319227[_0x2409('0x25')]){var _0x1b617d=_[_0x2409('0x22')](_0x319227,function(_0x64146e){return _0x64146e[_0x2409('0x26')]===_0x55fb90;});if(_0x1b617d){logger['info']('Agent\x20%s\x20found.',_0x55fb90);return BPromise['resolve']({'id':_0x1b617d['Id'],'name':_0x1b617d[_0x2409('0x27')]});}}else{logger[_0x2409('0x28')](_0x2409('0x29'),_0x55fb90);return _0x4a8c2d[_0x2409('0x2a')]()[_0x2409('0x24')](function(_0x4080b0){return BPromise[_0x2409('0x2b')]({'id':_0x4080b0[_0x2409('0x2c')],'name':_0x4080b0[_0x2409('0x2d')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x55fb90);return _0x4a8c2d['identity']()['then'](function(_0x54cdf0){return BPromise[_0x2409('0x2b')]({'id':_0x54cdf0[_0x2409('0x2c')],'name':_0x54cdf0[_0x2409('0x2d')]});});}}function getEndUser(_0x5ce5f6,_0x48aa93,_0x276dbf,_0x468413,_0x1370c1){var _0x34cc5f={'$or':{'Phone':_0x468413}};var _0x2c9585={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x2409('0x2b')]()[_0x2409('0x24')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x468413,_0x48aa93[_0x2409('0x2e')]);switch(_0x48aa93[_0x2409('0x2e')]){case _0x2409('0x2f'):var _0x31692f=_[_0x2409('0x30')](_0x34cc5f);if(_0x48aa93[_0x2409('0x31')]){var _0x1739d3={};_0x1739d3[_0x48aa93[_0x2409('0x31')]]=_0x468413;_[_0x2409('0x32')](_0x31692f[_0x2409('0x33')],_0x1739d3);}return _0x1370c1[_0x2409('0x34')](_0x2409('0x35'))[_0x2409('0x22')](_0x31692f,_0x2c9585)['execute']()['then'](function(_0x1f297b){if(_0x1f297b&&_0x1f297b[_0x2409('0x25')]){return _0x1f297b;}else{var _0x57608d=_[_0x2409('0x30')](_0x34cc5f);if(_0x48aa93['additionalSearchLead']){var _0x2f0a72={};_0x2f0a72[_0x48aa93[_0x2409('0x36')]]=_0x468413;_[_0x2409('0x32')](_0x57608d[_0x2409('0x33')],_0x2f0a72);}return _0x1370c1[_0x2409('0x34')](_0x2409('0x37'))['find'](_0x57608d,_0x2c9585);}});case _0x2409('0x38'):var _0xf8f107=_['cloneDeep'](_0x34cc5f);if(_0x48aa93[_0x2409('0x39')]){var _0x1739d3={};_0x1739d3[_0x48aa93[_0x2409('0x39')]]=_0x468413;_[_0x2409('0x32')](_0xf8f107['$or'],_0x1739d3);}return _0x1370c1[_0x2409('0x34')](_0x2409('0x3a'))[_0x2409('0x22')](_0xf8f107,_0x2c9585)[_0x2409('0x23')]()[_0x2409('0x24')](function(_0x14a5a3){if(_0x14a5a3&&_0x14a5a3[_0x2409('0x25')]){return _0x14a5a3;}else{var _0x361ffd=_[_0x2409('0x30')](_0x34cc5f);if(_0x48aa93['additionalSearchContact']){var _0x970830={};_0x970830[_0x48aa93[_0x2409('0x31')]]=_0x468413;_[_0x2409('0x32')](_0x361ffd[_0x2409('0x33')],_0x970830);}return _0x1370c1[_0x2409('0x34')](_0x2409('0x35'))['find'](_0x361ffd,_0x2c9585)[_0x2409('0x24')](function(_0x20ea03){if(_0x20ea03&&_0x20ea03[_0x2409('0x25')]){return _0x20ea03;}else{var _0x551e0e=_[_0x2409('0x30')](_0x34cc5f);if(_0x48aa93[_0x2409('0x36')]){var _0xb80fa6={};_0xb80fa6[_0x48aa93[_0x2409('0x36')]]=_0x468413;_[_0x2409('0x32')](_0x551e0e['$or'],_0xb80fa6);}return _0x1370c1[_0x2409('0x34')](_0x2409('0x37'))[_0x2409('0x22')](_0x551e0e,_0x2c9585);}});}});case'contact':var _0x31692f=_[_0x2409('0x30')](_0x34cc5f);if(_0x48aa93[_0x2409('0x31')]){var _0x1739d3={};_0x1739d3[_0x48aa93[_0x2409('0x31')]]=_0x468413;_[_0x2409('0x32')](_0x31692f[_0x2409('0x33')],_0x1739d3);}return _0x1370c1[_0x2409('0x34')](_0x2409('0x35'))[_0x2409('0x22')](_0x31692f,_0x2c9585)[_0x2409('0x23')]();case _0x2409('0x17'):var _0x2df842=_['cloneDeep'](_0x34cc5f);if(_0x48aa93[_0x2409('0x36')]){var _0x1739d3={};_0x1739d3[_0x48aa93[_0x2409('0x36')]]=_0x468413;_[_0x2409('0x32')](_0x2df842[_0x2409('0x33')],_0x1739d3);}return _0x1370c1[_0x2409('0x34')](_0x2409('0x37'))[_0x2409('0x22')](_0x2df842,_0x2c9585);case _0x2409('0x19'):var _0xf8f107=_[_0x2409('0x30')](_0x34cc5f);if(_0x48aa93[_0x2409('0x39')]){var _0x1739d3={};_0x1739d3[_0x48aa93['additionalSearchAccount']]=_0x468413;_[_0x2409('0x32')](_0xf8f107[_0x2409('0x33')],_0x1739d3);}return _0x1370c1['sobject'](_0x2409('0x3a'))[_0x2409('0x22')](_0xf8f107,_0x2c9585);default:return null;}})[_0x2409('0x24')](function(_0xbaf48e){if(_0xbaf48e&&_0xbaf48e['length']){var _0x3bce08=_['first'](_0xbaf48e);if(_0x3bce08){return BPromise[_0x2409('0x2b')]({'id':_0x3bce08['Id'],'name':_0x3bce08[_0x2409('0x27')],'phone':_0x3bce08[_0x2409('0x3b')],'endUserType':_0x3bce08[_0x2409('0x3c')][_0x2409('0x3d')][_0x2409('0x3e')]()});}}})['then'](function(_0xc4b264){if(_0xc4b264){logger[_0x2409('0x28')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0xc4b264[_0x2409('0x15')],_0x468413);return BPromise['resolve'](_0xc4b264);}else{logger[_0x2409('0x28')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x468413);var _0x18f37b={'Phone':_0x468413};if(_0x48aa93[_0x2409('0x3f')]){if(_0x48aa93[_0x2409('0x3f')]==='contact'){logger[_0x2409('0x28')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x468413,_0x48aa93[_0x2409('0x3f')]);_0x18f37b[_0x2409('0x40')]=_0x276dbf!==''?_0x276dbf:util[_0x2409('0x41')](_0x2409('0x42'),_0x468413);}else if(_0x48aa93[_0x2409('0x3f')]===_0x2409('0x17')){logger[_0x2409('0x28')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x468413,_0x48aa93[_0x2409('0x3f')]);_0x18f37b[_0x2409('0x40')]=_0x276dbf!==_0x2409('0x43')?_0x276dbf:util['format'](_0x2409('0x42'),_0x468413);_0x18f37b[_0x2409('0x44')]=_0x2409('0x45');}else if(_0x48aa93[_0x2409('0x3f')]===_0x2409('0x19')){logger['info'](_0x2409('0x46'),_0x468413,_0x48aa93[_0x2409('0x3f')]);_0x18f37b[_0x2409('0x27')]=_0x276dbf!==_0x2409('0x43')?_0x276dbf:util[_0x2409('0x41')](_0x2409('0x42'),_0x468413);}else{return null;}}return _0x1370c1['sobject'](_[_0x2409('0x47')](_0x48aa93[_0x2409('0x3f')]))['create'](_0x18f37b)[_0x2409('0x24')](function(_0x2957a7){return BPromise[_0x2409('0x2b')]({'id':_0x2957a7['id'],'endUserType':_0x48aa93[_0x2409('0x3f')]});});}});}function getCustomFields(_0x19ad08,_0x1165b1){var _0x3e1eca={};if(_0x19ad08[_0x2409('0x25')]>0x0){_[_0x2409('0x48')](_0x19ad08,function(_0x3826b0){if(_[_0x2409('0x49')]([_0x2409('0x4a'),_0x2409('0x4b')],_0x3826b0[_0x2409('0x3d')])&&_0x3826b0[_0x2409('0x4c')]){_0x3e1eca[_0x3826b0[_0x2409('0x4c')]]=_0x3826b0[_0x2409('0x4d')][_0x2409('0x4e')]();}else if(_0x3826b0['type']===_0x2409('0x4f')&&_0x3826b0[_0x2409('0x50')]&&_0x3826b0[_0x2409('0x4c')]){_0x1165b1[_0x3826b0[_0x2409('0x50')]]&&(_0x3e1eca[_0x3826b0[_0x2409('0x4c')]]=_0x1165b1[_0x3826b0[_0x2409('0x50')]][_0x2409('0x4e')]());}else if(_0x3826b0[_0x2409('0x3d')]==='customVariable'&&_0x3826b0['Variable']&&_0x3826b0[_0x2409('0x51')][_0x2409('0x52')]&&_0x3826b0[_0x2409('0x4c')]){_0x1165b1[_0x3826b0[_0x2409('0x51')]['name']['toLowerCase']()]&&(_0x3e1eca[_0x3826b0[_0x2409('0x4c')]]=_0x1165b1[_0x3826b0[_0x2409('0x51')][_0x2409('0x52')]['toLowerCase']()][_0x2409('0x4e')]());}});}return _0x3e1eca;}function getConnection(_0x244c8b){var _0x44d04d=_0x244c8b['password'][_0x2409('0x53')](_0x244c8b['securityToken']);var _0x2a2352=new jsforce[(_0x2409('0x54'))]({'oauth2':{'loginUrl':_0x244c8b[_0x2409('0x55')]||_0x2409('0x56'),'clientId':_0x244c8b['clientId'],'clientSecret':_0x244c8b[_0x2409('0x57')]}});return _0x2a2352[_0x2409('0x58')](_0x244c8b['username'],_0x44d04d)[_0x2409('0x24')](function(){logger[_0x2409('0x28')](_0x2409('0x59'));return _0x2a2352;});}exports['queue']=function(_0x5c06e4,_0x16bba8,_0x29bda1,_0x59a8d4,_0x3a1fca,_0x3602dd){var _0x40c988,_0x1acff4,_0x245f87,_0x9ca0bb;_0x3602dd[_0x2409('0x5a')]=intUtil[_0x2409('0x5b')](_0x3602dd['serverUrl']);_0x3602dd[_0x2409('0x55')]=intUtil[_0x2409('0x5b')](_0x3602dd['remoteUri']);if(_0x3a1fca&&_0x3a1fca['monitor_format']){logger['info'](_0x2409('0x5c'),_0x2409('0x5d'));_0x16bba8[_0x2409('0x5e')]=util[_0x2409('0x41')](_0x2409('0x5f'),_0x3602dd[_0x2409('0x5a')],_0x16bba8[_0x2409('0x60')],md5(_0x16bba8[_0x2409('0x60')]));}else{_0x16bba8['recordingURL']='';}return getConnection(_0x3602dd)[_0x2409('0x24')](function(_0x1b9ed9){_0x9ca0bb=_0x1b9ed9;return getUser(_0x3602dd,_0x59a8d4[_0x2409('0x61')],_0x9ca0bb);})['then'](function(_0x183610){_0x40c988=_0x183610;return getEndUser(_0x3602dd,_0x29bda1,_0x16bba8['calleridname'],_0x16bba8[_0x2409('0x62')],_0x9ca0bb);})[_0x2409('0x24')](function(_0x37c30b){_0x1acff4=_0x37c30b;return getTicket(_0x3602dd,_0x40c988,_0x1acff4,_0x29bda1,_0x16bba8,_0x29bda1[_0x2409('0x63')],_0x9ca0bb,_0x2409('0x64'));})[_0x2409('0x24')](function(_0x451008){_0x245f87=_0x451008;logger['info'](_0x2409('0x65'),_0x245f87['id']);logger[_0x2409('0x28')](_0x2409('0x66'),_0x245f87['id'],_0x59a8d4[_0x2409('0x52')],_0x3602dd['type']);switch(_0x3602dd[_0x2409('0x3d')]){case _0x2409('0x67'):emit(util[_0x2409('0x41')](_0x2409('0x68'),_0x59a8d4['name']),'trigger:salesforce:display',{'recordId':_0x245f87['id']});break;case _0x2409('0x69'):emit(util[_0x2409('0x41')](_0x2409('0x68'),_0x59a8d4['name']),'trigger:browser:url',{'uri':util[_0x2409('0x41')](_0x2409('0x6a'),_0x9ca0bb[_0x2409('0x6b')],_0x245f87['id'])});break;default:logger[_0x2409('0x6c')](_0x2409('0x6d'));}})[_0x2409('0x6e')](function(_0x3e1845){logger[_0x2409('0x6c')]('[QUEUE]',_0x3e1845);});};exports[_0x2409('0x6f')]=function(_0x45971c,_0x1ab0a8,_0x537478,_0x19ccb5,_0x474f19,_0x4223c9,_0x2a1326){var _0x4a85be,_0x4addf1,_0xeef38,_0x3b4127;_0x4223c9[_0x2409('0x5a')]=intUtil[_0x2409('0x5b')](_0x4223c9['serverUrl']);_0x4223c9[_0x2409('0x55')]=intUtil[_0x2409('0x5b')](_0x4223c9[_0x2409('0x55')]);if(_0x2a1326&&_0x2a1326['recordingFormat']&&_0x2a1326[_0x2409('0x70')]!==_0x2409('0x71')){logger[_0x2409('0x28')](_0x2409('0x72'),_0x2409('0x5d'));_0x1ab0a8['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4223c9['serverUrl'],_0x1ab0a8[_0x2409('0x60')],md5(_0x1ab0a8[_0x2409('0x60')]));}return getConnection(_0x4223c9)[_0x2409('0x24')](function(_0x745424){_0x3b4127=_0x745424;return getUser(_0x4223c9,_0x19ccb5[_0x2409('0x61')],_0x3b4127);})[_0x2409('0x24')](function(_0x303aae){_0x4a85be=_0x303aae;return getEndUser(_0x4223c9,_0x537478,_0x1ab0a8[_0x2409('0x73')],_0x1ab0a8[_0x2409('0x74')],_0x3b4127);})[_0x2409('0x24')](function(_0x4d3fc1){_0x4addf1=_0x4d3fc1;return getTicket(_0x4223c9,_0x4a85be,_0x4addf1,_0x537478,_0x1ab0a8,_0x537478[_0x2409('0x63')],_0x3b4127,_0x2409('0x6f'));})[_0x2409('0x24')](function(_0x3df29b){_0xeef38=_0x3df29b;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0xeef38['id']);logger[_0x2409('0x28')](_0x2409('0x75'),_0xeef38['id'],_0x19ccb5[_0x2409('0x52')],_0x4223c9['type']);switch(_0x4223c9[_0x2409('0x3d')]){case _0x2409('0x67'):emit(util[_0x2409('0x41')]('user:%s',_0x19ccb5['name']),'trigger:salesforce:display',{'recordId':_0xeef38['id']});break;case'newTab':emit(util[_0x2409('0x41')](_0x2409('0x68'),_0x19ccb5['name']),_0x2409('0x76'),{'uri':util[_0x2409('0x41')](_0x2409('0x6a'),_0x3b4127[_0x2409('0x6b')],_0xeef38['id'])});break;default:logger[_0x2409('0x6c')](_0x2409('0x72'),_0x2409('0x77'));}})[_0x2409('0x6e')](function(_0x3d5fa1){logger['error'](_0x2409('0x72'),_0x3d5fa1);});};exports[_0x2409('0x78')]=function(_0x1d5898,_0x5aed47,_0x3a9ef9,_0x24fc92,_0x5a668c,_0x1df32f){var _0x1c589a,_0x5db0d6,_0x283fef,_0x2f3f3a;_0x1df32f[_0x2409('0x5a')]=intUtil[_0x2409('0x5b')](_0x1df32f[_0x2409('0x5a')]);_0x1df32f[_0x2409('0x55')]=intUtil['stripTrailingSlash'](_0x1df32f[_0x2409('0x55')]);if(_0x5a668c&&_0x5a668c[_0x2409('0x79')]){logger['info']('['+_0x5aed47[_0x2409('0x7a')][_0x2409('0x7b')]()+']',_0x2409('0x5d'));_0x5aed47[_0x2409('0x5e')]=util['format'](_0x2409('0x5f'),_0x1df32f[_0x2409('0x5a')],_0x5aed47[_0x2409('0x60')],md5(_0x5aed47[_0x2409('0x60')]));}else{_0x5aed47[_0x2409('0x5e')]='';}return getConnection(_0x1df32f)[_0x2409('0x24')](function(_0x2b07c3){_0x2f3f3a=_0x2b07c3;if(!_[_0x2409('0x7c')](_0x24fc92)){return getUser(_0x1df32f,_0x24fc92[_0x2409('0x52')],_0x2f3f3a);}else{return getUser(_0x1df32f,null,_0x2f3f3a);}})['then'](function(_0x407960){_0x1c589a=_0x407960;return getEndUser(_0x1df32f,_0x3a9ef9,_0x5aed47[_0x2409('0x7d')],_0x5aed47['calleridnum'],_0x2f3f3a);})[_0x2409('0x24')](function(_0x2959a9){_0x5db0d6=_0x2959a9;return getTicket(_0x1df32f,_0x1c589a,_0x5db0d6,_0x3a9ef9,_0x5aed47,_0x3a9ef9[_0x2409('0x63')],_0x2f3f3a);})[_0x2409('0x24')](function(_0x23237d){_0x283fef=_0x23237d;logger[_0x2409('0x28')]('['+_0x5aed47[_0x2409('0x7a')][_0x2409('0x7b')]()+']\x20Ticket\x20%s\x20created.',_0x283fef['id']);logger[_0x2409('0x28')]('['+_0x5aed47[_0x2409('0x7a')]['toUpperCase']()+_0x2409('0x7e'),_0x1df32f[_0x2409('0x3d')]);})[_0x2409('0x6e')](function(_0x1fae07){logger[_0x2409('0x6c')]('['+_0x5aed47[_0x2409('0x7a')][_0x2409('0x7b')]()+']',_0x1fae07);});}; \ 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 71bba65..ac63afb 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 _0x1fc1=['email','adminEmail','calleridnum','callDirection','queue','unmanaged','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','GET','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','true','userId','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','forEach','includes','string','picklist','type','customField','nameField','content','toString','idField','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number','label','?sysparm_query=name%3D','label_entry','ticketId','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','user:%s','emit','trigger:browser:url','username','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/'];(function(_0x5d77d6,_0x400171){var _0x1b9e7c=function(_0x30f3c9){while(--_0x30f3c9){_0x5d77d6['push'](_0x5d77d6['shift']());}};_0x1b9e7c(++_0x400171);}(_0x1fc1,0x146));var _0x11fc=function(_0x3520c1,_0x1257ad){_0x3520c1=_0x3520c1-0x0;var _0x24e55c=_0x1fc1[_0x3520c1];return _0x24e55c;};'use strict';var _=require(_0x11fc('0x0'));var Promise=require(_0x11fc('0x1'));var rp=require('request-promise');var util=require(_0x11fc('0x2'));var md5=require(_0x11fc('0x3'));var Redis=require(_0x11fc('0x4'));var intUtil=require(_0x11fc('0x5'));var config=require(_0x11fc('0x6'));var logger=require(_0x11fc('0x7'))(_0x11fc('0x8'));config[_0x11fc('0x9')]=_['defaults'](config['redis'],{'host':_0x11fc('0xa'),'port':0x18eb});var io=require(_0x11fc('0xb'))(new Redis(config['redis']));function getAdminUser(_0x5ae15e,_0x4f5f1d,_0x50f222,_0x4bf154,_0x45abdc,_0x49fd07){return new Promise(function(_0x137e11,_0x363102){var _0x130fdd={'method':'GET','uri':_0x4bf154+_0x11fc('0xc')+'&'+_0x45abdc+'&'+_0x49fd07,'auth':_0x4f5f1d,'json':!![]};return rp(_0x130fdd)[_0x11fc('0xd')](function(_0x5b9daa){if(_0x5b9daa[_0x11fc('0xe')][_0x11fc('0xf')]>0x0){_0x50f222[_0x11fc('0x10')]=_0x5b9daa[_0x11fc('0xe')][0x0][_0x11fc('0x11')];}logger[_0x11fc('0x12')]('['+[_0x5ae15e['toUpperCase']()]+_0x11fc('0x13'),_0x50f222);_0x137e11(_0x50f222);})['catch'](function(_0x46d843){logger[_0x11fc('0x14')]('['+[_0x5ae15e[_0x11fc('0x15')]()]+']',_0x46d843[_0x11fc('0x16')]);_0x363102(_0x46d843[_0x11fc('0x16')]);});});}function getUser(_0x455697,_0x514f91,_0x3332c2,_0x3a3d3c,_0x2a8c69){return function(_0x4a6a2a){logger[_0x11fc('0x12')]('['+[_0x455697['toUpperCase']()]+_0x11fc('0x17'),_0x4a6a2a);return new Promise(function(_0x761b41,_0x2db6cb){if(intUtil[_0x11fc('0x18')](_0x4a6a2a['userEmail'])){var _0xb9fa4b={'method':_0x11fc('0x19'),'uri':_0x3332c2+_0x11fc('0x1a')+_0x4a6a2a[_0x11fc('0x1b')]+'&'+_0x3a3d3c+'&'+_0x2a8c69,'auth':_0x514f91,'json':!![]};logger[_0x11fc('0x12')]('['+[_0x455697[_0x11fc('0x15')]()]+'],\x20getUser\x20rp\x20obj',_0xb9fa4b);return rp(_0xb9fa4b)[_0x11fc('0xd')](function(_0x495227){logger[_0x11fc('0x12')]('['+[_0x455697[_0x11fc('0x15')]()]+_0x11fc('0x1c'),_0x495227);if(_0x495227[_0x11fc('0xe')][_0x11fc('0xf')]>0x0&&String(_0x495227['result'][0x0]['active'])===_0x11fc('0x1d')){_0x4a6a2a[_0x11fc('0x1e')]=_0x495227[_0x11fc('0xe')][0x0]['sys_id'];}else{_0x4a6a2a[_0x11fc('0x1e')]=_0x4a6a2a['adminId'];_0x4a6a2a[_0x11fc('0x1b')]=_0x4a6a2a['adminEmail'];}logger[_0x11fc('0x12')]('['+[_0x455697[_0x11fc('0x15')]()]+_0x11fc('0x1f'),_0x4a6a2a);_0x761b41(_0x4a6a2a);})[_0x11fc('0x20')](function(_0x7b8cdf){logger[_0x11fc('0x14')]('['+[_0x455697[_0x11fc('0x15')]()]+']',_0x7b8cdf[_0x11fc('0x16')]);_0x2db6cb(_0x7b8cdf[_0x11fc('0x16')]);});}else{logger['info']('['+[_0x455697['toUpperCase']()]+_0x11fc('0x21'));_0x4a6a2a['userId']=_0x4a6a2a[_0x11fc('0x10')];_0x4a6a2a[_0x11fc('0x1b')]=_0x4a6a2a['adminEmail'];_0x761b41(_0x4a6a2a);}});};}function createEndUser(_0x16ab55,_0x490293,_0x39a13e,_0x210d50,_0x3aff31){logger[_0x11fc('0x12')]('['+[_0x16ab55[_0x11fc('0x15')]()]+_0x11fc('0x22'),_0x39a13e);return new Promise(function(_0x5853ba,_0x5a2227){var _0x342694={'method':_0x11fc('0x23'),'uri':_0x210d50+_0x11fc('0x24')+_0x3aff31,'body':{'user_name':_0x39a13e['endUserNumber'],'roles':_0x11fc('0x25'),'first_name':_0x39a13e[_0x11fc('0x26')],'active':'true','date_format':_0x11fc('0x27'),'phone':_0x39a13e[_0x11fc('0x26')]},'auth':_0x490293,'json':!![]};return rp(_0x342694)[_0x11fc('0xd')](function(_0x1e1a36){logger[_0x11fc('0x12')]('['+[_0x16ab55[_0x11fc('0x15')]()]+_0x11fc('0x28'),_0x1e1a36[_0x11fc('0xe')]);_0x39a13e[_0x11fc('0x29')]=_0x1e1a36['result'][_0x11fc('0x11')];_0x5853ba(_0x39a13e);})['catch'](function(_0x342c75){logger['error']('['+[_0x16ab55[_0x11fc('0x15')]()]+']',_0x342c75['message']);_0x5a2227(_0x342c75[_0x11fc('0x16')]);});});}function getEndUser(_0x5434e7,_0x2d15d0,_0x4eba8a,_0x3b1848,_0x576654){return function(_0x48972b){logger['info']('['+[_0x5434e7['toUpperCase']()]+_0x11fc('0x2a'),_0x48972b);return new Promise(function(_0x4d7322,_0x3b09f8){var _0x293227={'method':_0x11fc('0x19'),'uri':_0x4eba8a+_0x11fc('0x2b')+_0x48972b[_0x11fc('0x26')]+'&'+_0x3b1848+'&'+_0x576654,'auth':_0x2d15d0,'json':!![]};return rp(_0x293227)['then'](function(_0x20bc19){if(_0x20bc19[_0x11fc('0xe')]['length']>0x0){_0x48972b[_0x11fc('0x29')]=_0x20bc19[_0x11fc('0xe')][0x0][_0x11fc('0x11')];logger[_0x11fc('0x12')]('['+[_0x5434e7['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x48972b);_0x4d7322(_0x48972b);}else{return createEndUser(_0x5434e7,_0x2d15d0,_0x48972b,_0x4eba8a,_0x3b1848)[_0x11fc('0xd')](function(_0x29bb3c){logger[_0x11fc('0x12')]('['+[_0x5434e7['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x29bb3c);_0x4d7322(_0x29bb3c);});}})[_0x11fc('0x20')](function(_0xf03185){logger['error']('['+[_0x5434e7[_0x11fc('0x15')]()]+']',_0xf03185[_0x11fc('0x16')]);_0x3b09f8(_0xf03185[_0x11fc('0x16')]);});});};}function getCustomFields(_0x2f48c4,_0x8ab35a){var _0x44243a={};if(_0x2f48c4[_0x11fc('0xf')]>0x0){_[_0x11fc('0x2c')](_0x2f48c4,function(_0x4d7f45){if(_[_0x11fc('0x2d')]([_0x11fc('0x2e'),_0x11fc('0x2f')],_0x4d7f45[_0x11fc('0x30')])&&_0x4d7f45['nameField']&&!_0x4d7f45[_0x11fc('0x31')]){_0x44243a[_0x4d7f45[_0x11fc('0x32')]['toLowerCase']()]=_0x4d7f45[_0x11fc('0x33')][_0x11fc('0x34')]();}else if(_['includes'](['string',_0x11fc('0x2f')],_0x4d7f45[_0x11fc('0x30')])&&_0x4d7f45['idField']&&_0x4d7f45['customField']){_0x44243a[_0x4d7f45[_0x11fc('0x35')][_0x11fc('0x36')]()]=_0x4d7f45[_0x11fc('0x33')]['toString']();}else if(_0x4d7f45['type']===_0x11fc('0x37')&&_0x4d7f45[_0x11fc('0x38')]&&_0x4d7f45['idField']&&_0x4d7f45[_0x11fc('0x31')]){_0x44243a[_0x4d7f45[_0x11fc('0x35')][_0x11fc('0x36')]()]=_0x8ab35a[_0x4d7f45[_0x11fc('0x38')]][_0x11fc('0x34')]();}else if(_0x4d7f45['type']==='customVariable'&&_0x4d7f45[_0x11fc('0x39')]&&_0x4d7f45['Variable'][_0x11fc('0x3a')]&&_0x4d7f45['idField']&&_0x4d7f45[_0x11fc('0x31')]){_0x44243a[_0x4d7f45[_0x11fc('0x35')][_0x11fc('0x36')]()]=_0x8ab35a[_0x4d7f45[_0x11fc('0x39')]['name'][_0x11fc('0x36')]()][_0x11fc('0x34')]();}});}return _0x44243a;}function getTicket(_0x3d8199,_0x360f4c,_0xcf82a3,_0x1168e2,_0x1027a3,_0x1ccac8){return function(_0x467668){logger['info']('['+[_0x3d8199[_0x11fc('0x15')]()]+_0x11fc('0x3b'),_0x467668);return new Promise(function(_0x20d195,_0x313fdd){var _0x226e53=_0x3d8199[_0x11fc('0x36')]()===_0x11fc('0x3c')?_0x467668[_0x11fc('0x1e')]:_0x467668[_0x11fc('0x29')];var _0xe51819={'method':_0x11fc('0x23'),'uri':_0xcf82a3+_0x11fc('0x3d')+'?'+_0x1ccac8,'body':Object[_0x11fc('0x3e')]({},{'active':_0x11fc('0x1d'),'caller_id':_0x226e53,'assigned_to':_0x467668[_0x11fc('0x1e')],'short_description':intUtil[_0x11fc('0x3f')](_0x1168e2[_0x11fc('0x40')],_0x1027a3,'\x20'),'description':intUtil[_0x11fc('0x3f')](_0x1168e2[_0x11fc('0x41')],_0x1027a3,'\x0a')},getCustomFields(_0x1168e2[_0x11fc('0x42')],_0x1027a3)),'auth':_0x360f4c,'json':!![]};return rp(_0xe51819)[_0x11fc('0xd')](function(_0x40324b){logger[_0x11fc('0x12')]('['+[_0x3d8199['toUpperCase']()]+_0x11fc('0x43'),_0x40324b[_0x11fc('0xe')]);_0x467668['ticketId']=_0x40324b[_0x11fc('0xe')]['sys_id'];_0x467668['ticketNumber']=_0x40324b[_0x11fc('0xe')][_0x11fc('0x44')];logger[_0x11fc('0x12')]('['+[_0x3d8199['toUpperCase']()]+']\x20getTicket\x20crm',_0x467668);_0x20d195(_0x467668);})[_0x11fc('0x20')](function(_0x1db848){logger[_0x11fc('0x14')]('['+[_0x3d8199['toUpperCase']()]+']',_0x1db848[_0x11fc('0x16')]);_0x313fdd(_0x1db848[_0x11fc('0x16')]);});});};}function createRemoteTag(_0x13759d,_0x51f5b3,_0x50a8df,_0x292f02){return new Promise(function(_0x37acdc,_0x189af2){var _0x23f5c7={'method':_0x11fc('0x23'),'uri':_0x50a8df+_0x11fc('0x45')+'?'+_0x292f02,'body':{'short_description':_0x13759d,'global':!![],'active':!![],'name':_0x13759d},'auth':_0x51f5b3,'json':!![]};return rp(_0x23f5c7)[_0x11fc('0xd')](function(_0xe70f8a){var _0x45d538=_0xe70f8a[_0x11fc('0xe')][_0x11fc('0x11')];_0x37acdc(_0x45d538);});});}function getRemoteTag(_0x4c0985,_0x17439f,_0x384677,_0x2f9ad8,_0x293ab7){return new Promise(function(_0x29512e,_0x4144e9){var _0x59719b={'method':_0x11fc('0x19'),'uri':_0x384677+_0x11fc('0x45')+_0x11fc('0x46')+_0x4c0985+'&'+_0x2f9ad8,'auth':_0x17439f,'json':!![]};return rp(_0x59719b)[_0x11fc('0xd')](function(_0x9ba05b){if(_0x9ba05b[_0x11fc('0xe')]['length']>0x0){var _0x334563=_0x9ba05b['result'][0x0][_0x11fc('0x11')];_0x29512e(_0x334563);}else{return createRemoteTag(_0x4c0985,_0x17439f,_0x384677,_0x2f9ad8)[_0x11fc('0xd')](function(_0x1c4713){_0x29512e(_0x1c4713);});}});});}function assignTagToIncident(_0x575b19,_0x2c69b2,_0x2b1e45,_0x9bf44e,_0x52c157){return new Promise(function(_0x4db85e,_0x662567){var _0xd87910={'method':_0x11fc('0x23'),'uri':_0x2b1e45+_0x11fc('0x47')+'?'+_0x52c157,'body':{'label':_0x575b19,'table':_0x11fc('0x3d'),'id_type':'Incident','table_key':_0x9bf44e[_0x11fc('0x48')],'title':'Incident\x20-\x20'+_0x9bf44e['ticketNumber'],'id_display':_0x9bf44e[_0x11fc('0x49')]},'auth':_0x2c69b2,'json':!![]};return rp(_0xd87910)[_0x11fc('0xd')](function(_0x5a9c1e){_0x4db85e();})['catch'](function(){_0x4db85e();});});}function manageTags(_0x271a8d,_0xb8eb80,_0x302744,_0xd27c0b,_0x3f2213,_0x40bcff,_0x464555){return new Promise(function(_0x3afb87,_0x2f61e8){var _0x196689=[];_0xb8eb80[_0x11fc('0x2c')](function(_0x3d4025){_0x196689[_0x11fc('0x4a')](getRemoteTag(_0x3d4025,_0x302744,_0xd27c0b,_0x40bcff,_0x464555));});return Promise[_0x11fc('0x4b')](_0x196689)['then'](function(_0x15d86f){if(_0x15d86f[_0x11fc('0xf')]){logger['info']('['+[_0x271a8d[_0x11fc('0x15')]()]+_0x11fc('0x4c'),_0x15d86f);var _0x29f3ef=[];_0x15d86f[_0x11fc('0x2c')](function(_0x516140){_0x29f3ef[_0x11fc('0x4a')](assignTagToIncident(_0x516140,_0x302744,_0xd27c0b,_0x3f2213,_0x40bcff));});return Promise[_0x11fc('0x4b')](_0x29f3ef)[_0x11fc('0xd')](function(){_0x3afb87();})[_0x11fc('0x20')](function(){_0x3afb87();});}else{_0x3afb87();}});});}function getTags(_0x44c2f5,_0x25c3a6,_0x1c3bc3,_0x12300d,_0xeca1d9,_0xdfe72b){return function(_0x43adf3){return new Promise(function(_0x164eab,_0x3b2dd6){var _0x998dd4=[];var _0x194f28=_0x12300d[_0x11fc('0x4d')];if(_0x194f28&&_0x194f28[_0x11fc('0xf')]>0x0){_0x998dd4=_[_0x11fc('0x4e')](_0x194f28,_0x11fc('0x3a'));}if(_0x998dd4[_0x11fc('0xf')]>0x0){return manageTags(_0x44c2f5,_0x998dd4,_0x25c3a6,_0x1c3bc3,_0x43adf3,_0xeca1d9,_0xdfe72b)['then'](function(){_0x164eab(_0x43adf3);});}else{_0x164eab(_0x43adf3);}});};}function emit(_0x1a7be1,_0x4fc2f0,_0x31bc40){var _0x3c991b='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x11fc('0x4f')+_0x11fc('0x50');var _0x45145f={'uri':_0x1a7be1+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x31bc40+_0x3c991b};io['to'](util['format'](_0x11fc('0x51'),_0x4fc2f0))[_0x11fc('0x52')](_0x11fc('0x53'),_0x45145f);}exports['cs']=function(_0x3fd509,_0x3b1ebe,_0x3318c9,_0x3e9b51,_0x3ae27d,_0x3b79a5,_0x320638,_0x5ba24d){var _0x3b2850={};var _0x56e1a2={'user':_0x3b79a5[_0x11fc('0x54')],'pass':_0x3b79a5['password']};var _0x482daf='sysparm_limit=1';var _0x5bdd0b='sysparm_display_value=true';_0x3b79a5[_0x11fc('0x55')]=intUtil[_0x11fc('0x56')](_0x3b79a5[_0x11fc('0x55')]);_0x3b79a5[_0x11fc('0x57')]=intUtil[_0x11fc('0x56')](_0x3b79a5[_0x11fc('0x57')]);var _0x51b182=util[_0x11fc('0x58')](_0x11fc('0x59'),_0x3b79a5[_0x11fc('0x55')]);_0x3b2850[_0x11fc('0x1b')]=!_['isNil'](_0x3e9b51)?_0x3e9b51[_0x11fc('0x5a')]:null;_0x3b2850[_0x11fc('0x5b')]=_0x3b79a5['email'];_0x3b2850[_0x11fc('0x26')]=_0x5ba24d[_0x11fc('0x36')]()==='outbound'?_0x3b1ebe['destcalleridnum']:_0x3b1ebe[_0x11fc('0x5c')];_0x3b2850[_0x11fc('0x5d')]=_0x5ba24d===_0x11fc('0x5e')||_0x5ba24d===_0x11fc('0x5f')?_0x11fc('0x5e'):_0x11fc('0x3c');var _0x4d9121=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b79a5['serverUrl'],_0x3b1ebe[_0x11fc('0x60')],md5(_0x3b1ebe[_0x11fc('0x60')]));if(_0x3ae27d&&_0x3ae27d['monitor_format']){logger['info']('[QUEUE]',_0x11fc('0x61'));_0x3b1ebe[_0x11fc('0x62')]=_0x4d9121;}else if(_0x320638&&_0x320638['recordingFormat']&&_0x320638[_0x11fc('0x63')]!=='none'){logger[_0x11fc('0x12')](_0x11fc('0x64'),_0x11fc('0x61'));_0x3b1ebe[_0x11fc('0x62')]=_0x4d9121;}else{_0x3b1ebe[_0x11fc('0x62')]='';}return getAdminUser(_0x5ba24d,_0x56e1a2,_0x3b2850,_0x51b182,_0x5bdd0b,_0x482daf)['then'](getUser(_0x5ba24d,_0x56e1a2,_0x51b182,_0x5bdd0b,_0x482daf))[_0x11fc('0xd')](getEndUser(_0x5ba24d,_0x56e1a2,_0x51b182,_0x5bdd0b,_0x482daf))[_0x11fc('0xd')](getTicket(_0x5ba24d,_0x56e1a2,_0x51b182,_0x3318c9,_0x3b1ebe,_0x5bdd0b))[_0x11fc('0xd')](function(_0x53b201){logger[_0x11fc('0x12')](util['format'](_0x11fc('0x65'),_0x53b201['ticketId']));logger[_0x11fc('0x12')](util[_0x11fc('0x58')](_0x11fc('0x66'),_0x5ba24d));if(_0x5ba24d!==_0x11fc('0x5f')){logger[_0x11fc('0x12')]('['+[_0x5ba24d['toUpperCase']()]+']',_0x11fc('0x67'));emit(_0x3b79a5[_0x11fc('0x55')],_0x3e9b51['name'],_0x53b201[_0x11fc('0x48')]);}})['catch'](function(_0x5291a8){logger[_0x11fc('0x14')]('['+[_0x5ba24d[_0x11fc('0x15')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x5291a8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0bd5=['endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','then','],\x20createEndUser\x20crm','forEach','includes','nameField','customField','content','string','picklist','type','idField','toLowerCase','toString','variable','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','./util','../../../../config/environment','servicenow','defaults','socket.io-emitter','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','sys_id','userId','adminEmail',']\x20using\x20admin\x20profile','POST','sys_user?','user'];(function(_0x481eec,_0x4fd06f){var _0x2f63e3=function(_0x2e6673){while(--_0x2e6673){_0x481eec['push'](_0x481eec['shift']());}};_0x2f63e3(++_0x4fd06f);}(_0x0bd5,0x12c));var _0x50bd=function(_0xe4f03f,_0x1d04b5){_0xe4f03f=_0xe4f03f-0x0;var _0x4c2995=_0x0bd5[_0xe4f03f];return _0x4c2995;};'use strict';var _=require('lodash');var Promise=require(_0x50bd('0x0'));var rp=require(_0x50bd('0x1'));var util=require(_0x50bd('0x2'));var md5=require(_0x50bd('0x3'));var Redis=require('ioredis');var intUtil=require(_0x50bd('0x4'));var config=require(_0x50bd('0x5'));var logger=require('../../../../config/logger')(_0x50bd('0x6'));config['redis']=_[_0x50bd('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x50bd('0x8'))(new Redis(config[_0x50bd('0x9')]));function getAdminUser(_0x12b050,_0x3b65aa,_0x59bf92,_0x41f224,_0x3bff65,_0x5f3378){return new Promise(function(_0x54c05b,_0x5be1ae){var _0x118f2e={'method':_0x50bd('0xa'),'uri':_0x41f224+_0x50bd('0xb')+'&'+_0x3bff65+'&'+_0x5f3378,'auth':_0x3b65aa,'json':!![]};return rp(_0x118f2e)['then'](function(_0x1bea2b){if(_0x1bea2b[_0x50bd('0xc')][_0x50bd('0xd')]>0x0){_0x59bf92[_0x50bd('0xe')]=_0x1bea2b[_0x50bd('0xc')][0x0]['sys_id'];}logger[_0x50bd('0xf')]('['+[_0x12b050['toUpperCase']()]+_0x50bd('0x10'),_0x59bf92);_0x54c05b(_0x59bf92);})[_0x50bd('0x11')](function(_0xf07549){logger[_0x50bd('0x12')]('['+[_0x12b050[_0x50bd('0x13')]()]+']',_0xf07549[_0x50bd('0x14')]);_0x5be1ae(_0xf07549[_0x50bd('0x14')]);});});}function getUser(_0x221a42,_0xe80fb6,_0x1cc966,_0x42ee44,_0x5578dc){return function(_0x2c0dea){logger[_0x50bd('0xf')]('['+[_0x221a42[_0x50bd('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x2c0dea);return new Promise(function(_0x5650fc,_0x20e069){if(intUtil['validateEmail'](_0x2c0dea[_0x50bd('0x15')])){var _0xc801b9={'method':_0x50bd('0xa'),'uri':_0x1cc966+_0x50bd('0x16')+_0x2c0dea[_0x50bd('0x15')]+'&'+_0x42ee44+'&'+_0x5578dc,'auth':_0xe80fb6,'json':!![]};logger['info']('['+[_0x221a42[_0x50bd('0x13')]()]+_0x50bd('0x17'),_0xc801b9);return rp(_0xc801b9)['then'](function(_0x275799){logger[_0x50bd('0xf')]('['+[_0x221a42[_0x50bd('0x13')]()]+_0x50bd('0x18'),_0x275799);if(_0x275799[_0x50bd('0xc')][_0x50bd('0xd')]>0x0&&String(_0x275799[_0x50bd('0xc')][0x0]['active'])===_0x50bd('0x19')){_0x2c0dea['userId']=_0x275799['result'][0x0][_0x50bd('0x1a')];}else{_0x2c0dea[_0x50bd('0x1b')]=_0x2c0dea['adminId'];_0x2c0dea['userEmail']=_0x2c0dea[_0x50bd('0x1c')];}logger[_0x50bd('0xf')]('['+[_0x221a42[_0x50bd('0x13')]()]+'],\x20getUser\x20crm',_0x2c0dea);_0x5650fc(_0x2c0dea);})[_0x50bd('0x11')](function(_0x1d02bf){logger[_0x50bd('0x12')]('['+[_0x221a42[_0x50bd('0x13')]()]+']',_0x1d02bf[_0x50bd('0x14')]);_0x20e069(_0x1d02bf[_0x50bd('0x14')]);});}else{logger['info']('['+[_0x221a42[_0x50bd('0x13')]()]+_0x50bd('0x1d'));_0x2c0dea[_0x50bd('0x1b')]=_0x2c0dea[_0x50bd('0xe')];_0x2c0dea[_0x50bd('0x15')]=_0x2c0dea[_0x50bd('0x1c')];_0x5650fc(_0x2c0dea);}});};}function createEndUser(_0x45c35b,_0x481e63,_0x4b4b86,_0xc0a3fb,_0x24d1ef){logger[_0x50bd('0xf')]('['+[_0x45c35b[_0x50bd('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x4b4b86);return new Promise(function(_0x63f3df,_0xb46c34){var _0x189961={'method':_0x50bd('0x1e'),'uri':_0xc0a3fb+_0x50bd('0x1f')+_0x24d1ef,'body':{'user_name':_0x4b4b86['endUserNumber'],'roles':_0x50bd('0x20'),'first_name':_0x4b4b86[_0x50bd('0x21')],'active':'true','date_format':_0x50bd('0x22'),'phone':_0x4b4b86['endUserNumber']},'auth':_0x481e63,'json':!![]};return rp(_0x189961)['then'](function(_0x7c8f9e){logger[_0x50bd('0xf')]('['+[_0x45c35b[_0x50bd('0x13')]()]+_0x50bd('0x23'),_0x7c8f9e[_0x50bd('0xc')]);_0x4b4b86[_0x50bd('0x24')]=_0x7c8f9e[_0x50bd('0xc')][_0x50bd('0x1a')];_0x63f3df(_0x4b4b86);})[_0x50bd('0x11')](function(_0x51a40a){logger[_0x50bd('0x12')]('['+[_0x45c35b[_0x50bd('0x13')]()]+']',_0x51a40a['message']);_0xb46c34(_0x51a40a['message']);});});}function getEndUser(_0x4c435f,_0x2b613d,_0x5e6472,_0x4082ab,_0x271098){return function(_0x4061ed){logger[_0x50bd('0xf')]('['+[_0x4c435f[_0x50bd('0x13')]()]+_0x50bd('0x25'),_0x4061ed);return new Promise(function(_0x38499e,_0x12ab35){var _0x2d98bd={'method':_0x50bd('0xa'),'uri':_0x5e6472+_0x50bd('0x26')+_0x4061ed[_0x50bd('0x21')]+'&'+_0x4082ab+'&'+_0x271098,'auth':_0x2b613d,'json':!![]};return rp(_0x2d98bd)[_0x50bd('0x27')](function(_0x112dff){if(_0x112dff[_0x50bd('0xc')]['length']>0x0){_0x4061ed[_0x50bd('0x24')]=_0x112dff['result'][0x0]['sys_id'];logger[_0x50bd('0xf')]('['+[_0x4c435f[_0x50bd('0x13')]()]+'],\x20getEndUser\x20crm',_0x4061ed);_0x38499e(_0x4061ed);}else{return createEndUser(_0x4c435f,_0x2b613d,_0x4061ed,_0x5e6472,_0x4082ab)[_0x50bd('0x27')](function(_0x17c812){logger[_0x50bd('0xf')]('['+[_0x4c435f[_0x50bd('0x13')]()]+_0x50bd('0x28'),_0x17c812);_0x38499e(_0x17c812);});}})['catch'](function(_0x883e75){logger[_0x50bd('0x12')]('['+[_0x4c435f[_0x50bd('0x13')]()]+']',_0x883e75[_0x50bd('0x14')]);_0x12ab35(_0x883e75[_0x50bd('0x14')]);});});};}function getCustomFields(_0x33451a,_0x2681aa){var _0x518a5c={};if(_0x33451a['length']>0x0){_[_0x50bd('0x29')](_0x33451a,function(_0x32abfc){if(_[_0x50bd('0x2a')](['string','picklist'],_0x32abfc['type'])&&_0x32abfc[_0x50bd('0x2b')]&&!_0x32abfc[_0x50bd('0x2c')]){_0x518a5c[_0x32abfc[_0x50bd('0x2b')]['toLowerCase']()]=_0x32abfc[_0x50bd('0x2d')]['toString']();}else if(_[_0x50bd('0x2a')]([_0x50bd('0x2e'),_0x50bd('0x2f')],_0x32abfc[_0x50bd('0x30')])&&_0x32abfc[_0x50bd('0x31')]&&_0x32abfc[_0x50bd('0x2c')]){_0x518a5c[_0x32abfc['idField'][_0x50bd('0x32')]()]=_0x32abfc['content'][_0x50bd('0x33')]();}else if(_0x32abfc[_0x50bd('0x30')]===_0x50bd('0x34')&&_0x32abfc['variableName']&&_0x32abfc['idField']&&_0x32abfc[_0x50bd('0x2c')]){_0x518a5c[_0x32abfc['idField'][_0x50bd('0x32')]()]=_0x2681aa[_0x32abfc['variableName']][_0x50bd('0x33')]();}else if(_0x32abfc[_0x50bd('0x30')]===_0x50bd('0x35')&&_0x32abfc[_0x50bd('0x36')]&&_0x32abfc[_0x50bd('0x36')][_0x50bd('0x37')]&&_0x32abfc[_0x50bd('0x31')]&&_0x32abfc[_0x50bd('0x2c')]){_0x518a5c[_0x32abfc[_0x50bd('0x31')][_0x50bd('0x32')]()]=_0x2681aa[_0x32abfc[_0x50bd('0x36')]['name'][_0x50bd('0x32')]()][_0x50bd('0x33')]();}});}return _0x518a5c;}function getTicket(_0x160de7,_0x1956ab,_0x1f7f9e,_0x57bcc0,_0x213b11,_0x5a5a32){return function(_0x5a0e72){logger[_0x50bd('0xf')]('['+[_0x160de7[_0x50bd('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x5a0e72);return new Promise(function(_0xb0888a,_0x5e784f){var _0x2f07f4=_0x160de7['toLowerCase']()===_0x50bd('0x38')?_0x5a0e72[_0x50bd('0x1b')]:_0x5a0e72[_0x50bd('0x24')];var _0x10e33f={'method':_0x50bd('0x1e'),'uri':_0x1f7f9e+_0x50bd('0x39')+'?'+_0x5a5a32,'body':Object[_0x50bd('0x3a')]({},{'active':_0x50bd('0x19'),'caller_id':_0x2f07f4,'assigned_to':_0x5a0e72[_0x50bd('0x1b')],'short_description':intUtil[_0x50bd('0x3b')](_0x57bcc0[_0x50bd('0x3c')],_0x213b11,'\x20'),'description':intUtil[_0x50bd('0x3b')](_0x57bcc0[_0x50bd('0x3d')],_0x213b11,'\x0a')},getCustomFields(_0x57bcc0['Fields'],_0x213b11)),'auth':_0x1956ab,'json':!![]};return rp(_0x10e33f)['then'](function(_0x24d897){logger[_0x50bd('0xf')]('['+[_0x160de7[_0x50bd('0x13')]()]+_0x50bd('0x3e'),_0x24d897[_0x50bd('0xc')]);_0x5a0e72[_0x50bd('0x3f')]=_0x24d897[_0x50bd('0xc')][_0x50bd('0x1a')];_0x5a0e72[_0x50bd('0x40')]=_0x24d897[_0x50bd('0xc')]['number'];logger[_0x50bd('0xf')]('['+[_0x160de7['toUpperCase']()]+']\x20getTicket\x20crm',_0x5a0e72);_0xb0888a(_0x5a0e72);})['catch'](function(_0x5976ae){logger[_0x50bd('0x12')]('['+[_0x160de7[_0x50bd('0x13')]()]+']',_0x5976ae[_0x50bd('0x14')]);_0x5e784f(_0x5976ae[_0x50bd('0x14')]);});});};}function createRemoteTag(_0x3c82a9,_0x41dec0,_0x3a265a,_0x2e8b85){return new Promise(function(_0x2e20e8,_0x26745f){var _0x574e45={'method':_0x50bd('0x1e'),'uri':_0x3a265a+_0x50bd('0x41')+'?'+_0x2e8b85,'body':{'short_description':_0x3c82a9,'global':!![],'active':!![],'name':_0x3c82a9},'auth':_0x41dec0,'json':!![]};return rp(_0x574e45)[_0x50bd('0x27')](function(_0xcb547c){var _0x5ca478=_0xcb547c['result'][_0x50bd('0x1a')];_0x2e20e8(_0x5ca478);});});}function getRemoteTag(_0x5ec76f,_0x471267,_0x3935c3,_0x3f855b,_0x318b6c){return new Promise(function(_0x3649cc,_0x5782e5){var _0xb48993={'method':_0x50bd('0xa'),'uri':_0x3935c3+_0x50bd('0x41')+_0x50bd('0x42')+_0x5ec76f+'&'+_0x3f855b,'auth':_0x471267,'json':!![]};return rp(_0xb48993)[_0x50bd('0x27')](function(_0x13ac0b){if(_0x13ac0b[_0x50bd('0xc')]['length']>0x0){var _0x15e33e=_0x13ac0b[_0x50bd('0xc')][0x0][_0x50bd('0x1a')];_0x3649cc(_0x15e33e);}else{return createRemoteTag(_0x5ec76f,_0x471267,_0x3935c3,_0x3f855b)['then'](function(_0x572194){_0x3649cc(_0x572194);});}});});}function assignTagToIncident(_0x40af82,_0x13e1ca,_0x122e5c,_0x5c28b7,_0x1f6145){return new Promise(function(_0x2eb004,_0x2128cf){var _0x4c187e={'method':'POST','uri':_0x122e5c+_0x50bd('0x43')+'?'+_0x1f6145,'body':{'label':_0x40af82,'table':_0x50bd('0x39'),'id_type':_0x50bd('0x44'),'table_key':_0x5c28b7[_0x50bd('0x3f')],'title':_0x50bd('0x45')+_0x5c28b7[_0x50bd('0x40')],'id_display':_0x5c28b7['ticketNumber']},'auth':_0x13e1ca,'json':!![]};return rp(_0x4c187e)['then'](function(_0x47dafe){_0x2eb004();})[_0x50bd('0x11')](function(){_0x2eb004();});});}function manageTags(_0x146c4f,_0x2de76d,_0x1959e6,_0x4c2a0c,_0x263cc9,_0x66a57e,_0x4643fa){return new Promise(function(_0xee93de,_0x34052d){var _0x5d2895=[];_0x2de76d['forEach'](function(_0x2d6fd3){_0x5d2895[_0x50bd('0x46')](getRemoteTag(_0x2d6fd3,_0x1959e6,_0x4c2a0c,_0x66a57e,_0x4643fa));});return Promise[_0x50bd('0x47')](_0x5d2895)[_0x50bd('0x27')](function(_0x2a1d60){if(_0x2a1d60['length']){logger['info']('['+[_0x146c4f[_0x50bd('0x13')]()]+_0x50bd('0x48'),_0x2a1d60);var _0x18a8a1=[];_0x2a1d60[_0x50bd('0x29')](function(_0x37456d){_0x18a8a1[_0x50bd('0x46')](assignTagToIncident(_0x37456d,_0x1959e6,_0x4c2a0c,_0x263cc9,_0x66a57e));});return Promise['all'](_0x18a8a1)[_0x50bd('0x27')](function(){_0xee93de();})[_0x50bd('0x11')](function(){_0xee93de();});}else{_0xee93de();}});});}function getTags(_0x596d5b,_0x4d94d8,_0x109e95,_0x922114,_0x1a046f,_0x16e90d){return function(_0x5d1372){return new Promise(function(_0x3d3cd7,_0x33df8d){var _0x5505e1=[];var _0x51f206=_0x922114[_0x50bd('0x49')];if(_0x51f206&&_0x51f206['length']>0x0){_0x5505e1=_['map'](_0x51f206,'name');}if(_0x5505e1[_0x50bd('0xd')]>0x0){return manageTags(_0x596d5b,_0x5505e1,_0x4d94d8,_0x109e95,_0x5d1372,_0x1a046f,_0x16e90d)['then'](function(){_0x3d3cd7(_0x5d1372);});}else{_0x3d3cd7(_0x5d1372);}});};}function emit(_0x3c6fbe,_0x58c6bf,_0x23d922){var _0x5d9c8d=_0x50bd('0x4a')+_0x50bd('0x4b')+_0x50bd('0x4c')+_0x50bd('0x4d');var _0x2400d8={'uri':_0x3c6fbe+_0x50bd('0x4e')+_0x23d922+_0x5d9c8d};io['to'](util[_0x50bd('0x4f')](_0x50bd('0x50'),_0x58c6bf))[_0x50bd('0x51')](_0x50bd('0x52'),_0x2400d8);}exports['cs']=function(_0x4e2daf,_0x2ee97a,_0x53fe06,_0x3bbecd,_0x4e3e6e,_0x2c57a0,_0x25e505,_0xc415e){var _0x116894={};var _0x43a552={'user':_0x2c57a0[_0x50bd('0x53')],'pass':_0x2c57a0[_0x50bd('0x54')]};var _0x45cc31=_0x50bd('0x55');var _0x194669=_0x50bd('0x56');_0x2c57a0['remoteUri']=intUtil[_0x50bd('0x57')](_0x2c57a0[_0x50bd('0x58')]);_0x2c57a0['serverUrl']=intUtil['stripTrailingSlash'](_0x2c57a0[_0x50bd('0x59')]);var _0xbe0827=util[_0x50bd('0x4f')](_0x50bd('0x5a'),_0x2c57a0['remoteUri']);_0x116894[_0x50bd('0x15')]=!_['isNil'](_0x3bbecd)?_0x3bbecd[_0x50bd('0x5b')]:null;_0x116894[_0x50bd('0x1c')]=_0x2c57a0[_0x50bd('0x5b')];_0x116894['endUserNumber']=_0xc415e[_0x50bd('0x32')]()===_0x50bd('0x38')?_0x2ee97a[_0x50bd('0x5c')]:_0x2ee97a[_0x50bd('0x5d')];_0x116894[_0x50bd('0x5e')]=_0xc415e==='queue'||_0xc415e===_0x50bd('0x5f')?_0x50bd('0x60'):_0x50bd('0x38');var _0x1c9137=util[_0x50bd('0x4f')](_0x50bd('0x61'),_0x2c57a0[_0x50bd('0x59')],_0x2ee97a[_0x50bd('0x62')],md5(_0x2ee97a['uniqueid']));if(_0x4e3e6e&&_0x4e3e6e[_0x50bd('0x63')]){logger[_0x50bd('0xf')](_0x50bd('0x64'),_0x50bd('0x65'));_0x2ee97a[_0x50bd('0x66')]=_0x1c9137;}else if(_0x25e505&&_0x25e505[_0x50bd('0x67')]&&_0x25e505[_0x50bd('0x67')]!==_0x50bd('0x68')){logger[_0x50bd('0xf')](_0x50bd('0x69'),_0x50bd('0x65'));_0x2ee97a[_0x50bd('0x66')]=_0x1c9137;}else{_0x2ee97a[_0x50bd('0x66')]='';}return getAdminUser(_0xc415e,_0x43a552,_0x116894,_0xbe0827,_0x194669,_0x45cc31)[_0x50bd('0x27')](getUser(_0xc415e,_0x43a552,_0xbe0827,_0x194669,_0x45cc31))[_0x50bd('0x27')](getEndUser(_0xc415e,_0x43a552,_0xbe0827,_0x194669,_0x45cc31))[_0x50bd('0x27')](getTicket(_0xc415e,_0x43a552,_0xbe0827,_0x53fe06,_0x2ee97a,_0x194669))[_0x50bd('0x27')](function(_0x4330a0){logger[_0x50bd('0xf')](util[_0x50bd('0x4f')](_0x50bd('0x6a'),_0x4330a0[_0x50bd('0x3f')]));logger[_0x50bd('0xf')](util['format'](_0x50bd('0x6b'),_0xc415e));if(_0xc415e!==_0x50bd('0x5f')){logger[_0x50bd('0xf')]('['+[_0xc415e[_0x50bd('0x13')]()]+']',_0x50bd('0x6c'));emit(_0x2c57a0[_0x50bd('0x58')],_0x3bbecd['name'],_0x4330a0[_0x50bd('0x3f')]);}})[_0x50bd('0x11')](function(_0x32e7b0){logger[_0x50bd('0x12')]('['+[_0xc415e[_0x50bd('0x13')]()]+_0x50bd('0x6d'),util[_0x50bd('0x6e')](_0x32e7b0,{'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 2f7f8dd..f4e58b9 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 _0x9e31=['assigned_user_id','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_id','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','length','find','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','','Caller\x20-\x20%s','first_name','debug','merge','map','type','string','customField','nameField','content','variable','custom_fields','customVariable','Variable','toLowerCase','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','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','user:%s','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Fields','Outbound','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','lastevent','toUpperCase','isNil','Inbound','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','POST','info','Creating\x20new\x20ticket...','name','Subjects'];(function(_0x5c5a76,_0x239ab5){var _0x2f7d7d=function(_0x4b5eaa){while(--_0x4b5eaa){_0x5c5a76['push'](_0x5c5a76['shift']());}};_0x2f7d7d(++_0x239ab5);}(_0x9e31,0x6b));var _0x19e3=function(_0x384fed,_0x14c43b){_0x384fed=_0x384fed-0x0;var _0x53d3e1=_0x9e31[_0x384fed];return _0x53d3e1;};'use strict';var _=require(_0x19e3('0x0'));var rp=require(_0x19e3('0x1'));var BPromise=require(_0x19e3('0x2'));var md5=require(_0x19e3('0x3'));var util=require(_0x19e3('0x4'));var Redis=require(_0x19e3('0x5'));var intUtil=require(_0x19e3('0x6'));var config=require(_0x19e3('0x7'));var logger=require(_0x19e3('0x8'))(_0x19e3('0x9'));config['redis']=_[_0x19e3('0xa')](config[_0x19e3('0xb')],{'host':_0x19e3('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x19e3('0xd'),'json':!![]};function emit(_0x23a0c2,_0x564ec4,_0x108396){io['to'](_0x23a0c2)['emit'](_0x564ec4,_0x108396);}function getTicket(_0x32f2fd,_0x31473b,_0x112cc2,_0x3d8e7c,_0x36a549,_0x1ec07d,_0x1c526a,_0x3e070d){logger[_0x19e3('0xe')](_0x19e3('0xf'));var _0x1b29f6=new Date();var _0x46ef00=[{'name':_0x19e3('0x10'),'value':intUtil['getString'](_0x3d8e7c[_0x19e3('0x11')],_0x36a549,'\x20')},{'name':_0x19e3('0x12'),'value':_0x31473b['id']},{'name':'created_by','value':_0x31473b['id']},{'name':_0x19e3('0x13'),'value':intUtil['getString'](_0x3d8e7c[_0x19e3('0x14')],_0x36a549,'\x0a')},{'name':_0x19e3('0x15'),'value':_0x1b29f6['toISOString']()[_0x19e3('0x16')](0x0,0x13)[_0x19e3('0x17')]('T','\x20')},{'name':_0x19e3('0x18'),'value':'0'},{'name':_0x19e3('0x19'),'value':'15'},{'name':_0x19e3('0x1a'),'value':_0x112cc2['id']},{'name':'parent_type','value':'Contacts'},{'name':'parent_name','value':_0x112cc2['name']},{'name':_0x19e3('0x1b'),'value':_0x3e070d}];if(_0x1ec07d['length']){_[_0x19e3('0x1c')](_0x1ec07d,function(_0x1490f7){if(_0x36a549[_0x1490f7[_0x19e3('0x1d')]]){_0x46ef00[_0x19e3('0x1e')]({'name':_0x1490f7[_0x19e3('0x1f')],'value':_0x36a549[_0x1490f7[_0x19e3('0x1d')]]});}});}return request({'form':{'method':_0x19e3('0x20'),'input_type':'JSON','response_type':_0x19e3('0x21'),'rest_data':JSON[_0x19e3('0x22')]({'session':_0x1c526a['id'],'module_name':_0x19e3('0x23'),'name_value_list':_0x46ef00})}});}function getAuth(_0x55cc80){return util[_0x19e3('0x24')](_0x19e3('0x25'),new Buffer(_0x55cc80[_0x19e3('0x26')]+':X')[_0x19e3('0x27')]('base64'));}function getServerInfo(_0x555e32){return request({'form':{'method':_0x19e3('0x28'),'input_type':_0x19e3('0x21'),'response_type':_0x19e3('0x21'),'rest_data':JSON['stringify']({'session':_0x555e32['id']})}});}function getUser(_0x2ee518,_0x3a74e5,_0x1d6d6e){if(!_['isNil'](_0x3a74e5)){logger[_0x19e3('0xe')](_0x19e3('0x29'),_0x3a74e5);return request({'form':{'method':_0x19e3('0x2a'),'input_type':_0x19e3('0x21'),'response_type':_0x19e3('0x21'),'rest_data':JSON[_0x19e3('0x22')]({'session':_0x1d6d6e['id'],'module_name':_0x19e3('0x2b'),'query':util['format'](_0x19e3('0x2c'),_0x3a74e5),'order_by':'','offset':'0','select_fields':['id',_0x19e3('0x10'),_0x19e3('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x19e3('0x2e')](function(_0x1b5ddf){if(_0x1b5ddf['entry_list'][_0x19e3('0x2f')]){var _0x519c96=_[_0x19e3('0x30')](_0x1b5ddf[_0x19e3('0x31')],function(_0x2b4a9a){return _0x2b4a9a[_0x19e3('0x32')][_0x19e3('0x2d')][_0x19e3('0x33')]===_0x3a74e5;});if(_0x519c96){logger['info'](_0x19e3('0x34'));return BPromise[_0x19e3('0x35')]({'id':_0x519c96[_0x19e3('0x32')]['id']['value'],'name':_0x519c96[_0x19e3('0x32')]['name'][_0x19e3('0x33')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x19e3('0x35')]({'id':_0x1d6d6e[_0x19e3('0x32')][_0x19e3('0x36')][_0x19e3('0x33')],'name':_0x1d6d6e[_0x19e3('0x32')][_0x19e3('0x2d')][_0x19e3('0x33')]});});}else{logger[_0x19e3('0xe')](_0x19e3('0x37'));return BPromise[_0x19e3('0x35')]({'id':_0x1d6d6e['name_value_list'][_0x19e3('0x36')][_0x19e3('0x33')],'name':_0x1d6d6e['name_value_list'][_0x19e3('0x2d')][_0x19e3('0x33')]});}}function getEndUser(_0x1374cf,_0x15b8d8,_0x3a8ea6,_0x1932f6){logger[_0x19e3('0xe')](_0x19e3('0x38'),_0x3a8ea6);return request({'form':{'method':_0x19e3('0x2a'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x19e3('0x22')]({'session':_0x1932f6['id'],'module_name':'Contacts','query':util[_0x19e3('0x24')](_0x19e3('0x39'),_0x3a8ea6),'order_by':'','offset':'0','select_fields':['id','name',_0x19e3('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x19e3('0x2e')](function(_0x6c09d6){if(_0x6c09d6[_0x19e3('0x31')]['length']){var _0x42ffd6=_[_0x19e3('0x30')](_0x6c09d6[_0x19e3('0x31')],function(_0x2202d8){return _0x2202d8[_0x19e3('0x32')][_0x19e3('0x3a')]['value']===_0x3a8ea6;});if(_0x42ffd6){logger[_0x19e3('0xe')](_0x19e3('0x3b'));return BPromise[_0x19e3('0x35')]({'id':_0x42ffd6['name_value_list']['id'][_0x19e3('0x33')],'name':_0x42ffd6[_0x19e3('0x32')][_0x19e3('0x10')][_0x19e3('0x33')],'phone':_0x42ffd6[_0x19e3('0x32')][_0x19e3('0x3a')][_0x19e3('0x33')]});}}else{logger[_0x19e3('0xe')](_0x19e3('0x3c'));return request({'form':{'method':_0x19e3('0x20'),'input_type':'JSON','response_type':_0x19e3('0x21'),'rest_data':JSON[_0x19e3('0x22')]({'session':_0x1932f6['id'],'module_name':_0x19e3('0x3d'),'name_value_list':[{'name':'first_name','value':_0x15b8d8!==_0x19e3('0x3e')?_0x15b8d8:util[_0x19e3('0x24')](_0x19e3('0x3f'),_0x3a8ea6)},{'name':_0x19e3('0x3a'),'value':_0x3a8ea6}]})}})[_0x19e3('0x2e')](function(_0x442057){logger['info']('Enduser\x20created.');return BPromise[_0x19e3('0x35')]({'id':_0x442057['id'],'name':_0x442057[_0x19e3('0x31')][_0x19e3('0x40')][_0x19e3('0x33')],'phone':_0x442057[_0x19e3('0x31')][_0x19e3('0x3a')]['value']});});}});}function request(_0x1e7c88){logger[_0x19e3('0x41')]('[HTTP]',JSON[_0x19e3('0x22')](_0x1e7c88));return rp(_[_0x19e3('0x42')](def,_0x1e7c88));}function getTags(_0x1a940f,_0x4dd94b){var _0x3801b7=[];if(_0x1a940f&&_0x1a940f[_0x19e3('0x2f')]>0x0){_0x3801b7=_[_0x19e3('0x43')](_0x1a940f,_0x4dd94b);}return _0x3801b7;}function getCustomFields(_0x2d4db9,_0x5cf404){var _0x2ff90f=[];var _0x374133={'custom_fields':[]};if(_0x2d4db9[_0x19e3('0x2f')]>0x0){_[_0x19e3('0x1c')](_0x2d4db9,function(_0x10af20){if(_0x10af20[_0x19e3('0x44')]===_0x19e3('0x45')&&_0x10af20['nameField']&&!_0x10af20[_0x19e3('0x46')]){_0x374133[_0x10af20[_0x19e3('0x47')]['toLowerCase']()]=_0x10af20[_0x19e3('0x48')]['toString']();}else if(_0x10af20[_0x19e3('0x44')]==='string'&&_0x10af20['idField']&&_0x10af20['customField']){_0x374133['custom_fields'][_0x19e3('0x1e')]({'id':_0x10af20['idField'],'value':_0x10af20[_0x19e3('0x48')][_0x19e3('0x27')]()});}else if(_0x10af20[_0x19e3('0x44')]===_0x19e3('0x49')&&_0x10af20['variableName']&&_0x10af20[_0x19e3('0x1f')]&&_0x10af20['customField']){_0x5cf404[_0x10af20[_0x19e3('0x1d')]]&&_0x374133[_0x19e3('0x4a')][_0x19e3('0x1e')]({'id':_0x10af20['idField'],'value':_0x5cf404[_0x10af20['variableName']]['toString']()});}else if(_0x10af20[_0x19e3('0x44')]===_0x19e3('0x4b')&&_0x10af20[_0x19e3('0x4c')]&&_0x10af20[_0x19e3('0x4c')][_0x19e3('0x10')]&&_0x10af20[_0x19e3('0x1f')]&&_0x10af20['customField']){_0x5cf404[_0x10af20['Variable'][_0x19e3('0x10')][_0x19e3('0x4d')]()]&&_0x374133[_0x19e3('0x4a')][_0x19e3('0x1e')]({'id':_0x10af20[_0x19e3('0x1f')],'value':_0x5cf404[_0x10af20[_0x19e3('0x4c')]['name'][_0x19e3('0x4d')]()][_0x19e3('0x27')]()});}});}return _0x374133;}function getConnection(_0x33a71a){return request({'method':_0x19e3('0xd'),'form':{'method':_0x19e3('0x4e'),'input_type':'JSON','response_type':_0x19e3('0x21'),'rest_data':JSON[_0x19e3('0x22')]({'user_auth':{'user_name':_0x33a71a['username'],'password':_0x33a71a[_0x19e3('0x4f')],'encryption':_0x19e3('0x50')},'application':_0x19e3('0x51')})}})[_0x19e3('0x2e')](function(_0x21ea88){var _0x2e1e1c=_0x21ea88;if(_0x2e1e1c['id']){def[_0x19e3('0x52')]=_0x2e1e1c['id'];return BPromise[_0x19e3('0x35')](_0x2e1e1c);}else{throw new Error(util['format'](_0x19e3('0x53'),_0x33a71a['id']));}});}function setRelationship(_0xeab34d,_0x7bb685,_0x300b9e,_0x27fd33){return request({'form':{'method':_0x19e3('0x54'),'input_type':_0x19e3('0x21'),'response_type':_0x19e3('0x21'),'rest_data':JSON[_0x19e3('0x22')]({'session':_0xeab34d['id'],'module_name':_0x19e3('0x23'),'module_id':_0x300b9e['id'],'link_field_name':_0x27fd33,'related_ids':[_0x7bb685['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0xd6e00a,_0x426707,_0x3082dd,_0x32a976,_0x390dd8,_0x470112){var _0x5e4bd4,_0x3e3c88,_0x31b00a,_0x1a818a;_0x470112[_0x19e3('0x55')]=intUtil[_0x19e3('0x56')](_0x470112[_0x19e3('0x55')]);_0x470112['serverUrl']=intUtil[_0x19e3('0x56')](_0x470112[_0x19e3('0x57')]);def[_0x19e3('0x58')]=util[_0x19e3('0x24')]('%s/service/v4_1/rest.php',_0x470112[_0x19e3('0x55')]);if(_0x390dd8&&_0x390dd8[_0x19e3('0x59')]){logger[_0x19e3('0xe')](_0x19e3('0x5a'),_0x19e3('0x5b'));_0x426707['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x470112[_0x19e3('0x57')],_0x426707[_0x19e3('0x5c')],md5(_0x426707[_0x19e3('0x5c')]));}else{_0x426707[_0x19e3('0x5d')]='';}return getConnection(_0x470112)[_0x19e3('0x2e')](function(_0xee1a7f){_0x1a818a=_0xee1a7f;return getUser(_0x470112,_0x32a976['name'],_0x1a818a);})[_0x19e3('0x2e')](function(_0x4792aa){_0x5e4bd4=_0x4792aa;logger[_0x19e3('0xe')](_0x19e3('0x5e'),_0x5e4bd4['id']);return getEndUser(_0x470112,_0x426707[_0x19e3('0x5f')],_0x426707[_0x19e3('0x60')],_0x1a818a);})[_0x19e3('0x2e')](function(_0x1b70ac){_0x3e3c88=_0x1b70ac;logger[_0x19e3('0xe')](_0x19e3('0x61'),_0x3e3c88['id']);return getTicket(_0x470112,_0x5e4bd4,_0x3e3c88,_0x3082dd,_0x426707,_0x3082dd['Fields'],_0x1a818a,'Inbound');})[_0x19e3('0x2e')](function(_0xe2a73e){_0x31b00a=_0xe2a73e;logger[_0x19e3('0xe')](_0x19e3('0x62'));logger[_0x19e3('0xe')](_0x19e3('0x63'),_0x31b00a['id']);return setRelationship(_0x1a818a,_0x5e4bd4,_0x31b00a,_0x19e3('0x64'));})[_0x19e3('0x2e')](function(){return setRelationship(_0x1a818a,_0x3e3c88,_0x31b00a,_0x19e3('0x65'));})[_0x19e3('0x2e')](function(){return getServerInfo(_0x1a818a);})[_0x19e3('0x2e')](function(_0x283d5d){var _0x5a71c9=parseInt(_0x283d5d[_0x19e3('0x66')][_0x19e3('0x67')](0x0));var _0xb8c8b1=util[_0x19e3('0x24')](_0x19e3('0x68'),_0x470112[_0x19e3('0x55')],_0x31b00a['id']);if(_0x5a71c9>0x6){_0xb8c8b1=util['format'](_0x19e3('0x69'),_0x470112[_0x19e3('0x55')],_0x31b00a['id']);}logger[_0x19e3('0xe')](_0x19e3('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x19e3('0x24')](_0x19e3('0x6a'),_0x32a976[_0x19e3('0x10')]),'trigger:browser:url',{'uri':_0xb8c8b1});})[_0x19e3('0x6b')](function(_0x3ff391){logger[_0x19e3('0x6c')]('[QUEUE]',JSON[_0x19e3('0x22')](_0x3ff391));});};exports[_0x19e3('0x6d')]=function(_0x335fbc,_0x478d49,_0x21c9e2,_0x475aa5,_0x30970c,_0xaf1edf,_0x2e8485){var _0x535c03,_0x378d5a,_0x3ed923,_0x239c91;_0xaf1edf[_0x19e3('0x55')]=intUtil[_0x19e3('0x56')](_0xaf1edf[_0x19e3('0x55')]);_0xaf1edf[_0x19e3('0x57')]=intUtil[_0x19e3('0x56')](_0xaf1edf[_0x19e3('0x57')]);def[_0x19e3('0x58')]=util[_0x19e3('0x24')](_0x19e3('0x6e'),_0xaf1edf[_0x19e3('0x55')]);if(_0x2e8485&&_0x2e8485[_0x19e3('0x6f')]&&_0x2e8485['recordingFormat']!=='none'){logger[_0x19e3('0xe')](_0x19e3('0x70'),_0x19e3('0x5b'));_0x478d49[_0x19e3('0x5d')]=util[_0x19e3('0x24')](_0x19e3('0x71'),_0xaf1edf[_0x19e3('0x57')],_0x478d49[_0x19e3('0x5c')],md5(_0x478d49[_0x19e3('0x5c')]));}return getConnection(_0xaf1edf)[_0x19e3('0x2e')](function(_0x3e9edf){_0x239c91=_0x3e9edf;return getUser(_0xaf1edf,_0x475aa5['name'],_0x239c91);})[_0x19e3('0x2e')](function(_0x533c16){_0x535c03=_0x533c16;logger[_0x19e3('0xe')](_0x19e3('0x5e'),_0x535c03['id']);return getEndUser(_0xaf1edf,_0x478d49[_0x19e3('0x72')],_0x478d49[_0x19e3('0x73')],_0x239c91);})[_0x19e3('0x2e')](function(_0x378266){_0x378d5a=_0x378266;logger[_0x19e3('0xe')](_0x19e3('0x61'),_0x378d5a['id']);return getTicket(_0xaf1edf,_0x535c03,_0x378d5a,_0x21c9e2,_0x478d49,_0x21c9e2[_0x19e3('0x74')],_0x239c91,_0x19e3('0x75'));})[_0x19e3('0x2e')](function(_0xab0975){_0x3ed923=_0xab0975;logger[_0x19e3('0xe')]('Ticket\x20created!');logger[_0x19e3('0xe')]('The\x20Ticket\x20ID\x20is:',_0x3ed923['id']);return setRelationship(_0x239c91,_0x535c03,_0x3ed923,_0x19e3('0x64'));})['then'](function(){return setRelationship(_0x239c91,_0x378d5a,_0x3ed923,_0x19e3('0x65'));})['then'](function(){return getServerInfo(_0x239c91);})[_0x19e3('0x2e')](function(_0x4d8c19){var _0x3bd502=parseInt(_0x4d8c19['version'][_0x19e3('0x67')](0x0));var _0x1d235b=util[_0x19e3('0x24')](_0x19e3('0x68'),_0xaf1edf[_0x19e3('0x55')],_0x3ed923['id']);if(_0x3bd502>0x6){_0x1d235b=util[_0x19e3('0x24')](_0x19e3('0x69'),_0xaf1edf[_0x19e3('0x55')],_0x3ed923['id']);}logger[_0x19e3('0xe')](_0x19e3('0x70'),_0x19e3('0x76'));emit(util[_0x19e3('0x24')]('user:%s',_0x475aa5[_0x19e3('0x10')]),_0x19e3('0x77'),{'uri':_0x1d235b});})[_0x19e3('0x6b')](function(_0x2970b1){logger[_0x19e3('0x6c')](_0x19e3('0x70'),JSON['stringify'](_0x2970b1));});};exports[_0x19e3('0x78')]=function(_0x1b1862,_0x42dda9,_0x15c230,_0x24202c,_0x40b707,_0xebc353){var _0xd54350,_0x41027e,_0x37351a,_0x37ade2;_0xebc353['remoteUri']=intUtil[_0x19e3('0x56')](_0xebc353[_0x19e3('0x55')]);_0xebc353['serverUrl']=intUtil['stripTrailingSlash'](_0xebc353[_0x19e3('0x57')]);def[_0x19e3('0x58')]=util['format'](_0x19e3('0x6e'),_0xebc353[_0x19e3('0x55')]);if(_0x40b707&&_0x40b707['monitor_format']){logger[_0x19e3('0xe')]('['+_0x42dda9[_0x19e3('0x79')][_0x19e3('0x7a')]()+']','Recording\x20is\x20enabled!');_0x42dda9['recordingURL']=util[_0x19e3('0x24')](_0x19e3('0x71'),_0xebc353[_0x19e3('0x57')],_0x42dda9[_0x19e3('0x5c')],md5(_0x42dda9[_0x19e3('0x5c')]));}else{_0x42dda9['recordingURL']='';}return getConnection(_0xebc353)['then'](function(_0x39bacf){_0x37ade2=_0x39bacf;if(!_[_0x19e3('0x7b')](_0x24202c)){return getUser(_0xebc353,_0x24202c[_0x19e3('0x10')],_0x37ade2);}else{return getUser(_0xebc353,null,_0x37ade2);}})[_0x19e3('0x2e')](function(_0x2577de){_0xd54350=_0x2577de;logger['info'](_0x19e3('0x5e'),_0xd54350['id']);return getEndUser(_0xebc353,_0x42dda9[_0x19e3('0x5f')],_0x42dda9[_0x19e3('0x60')],_0x37ade2);})[_0x19e3('0x2e')](function(_0x39609c){_0x41027e=_0x39609c;logger[_0x19e3('0xe')](_0x19e3('0x61'),_0x41027e['id']);return getTicket(_0xebc353,_0xd54350,_0x41027e,_0x15c230,_0x42dda9,_0x15c230[_0x19e3('0x74')],_0x37ade2,_0x19e3('0x7c'));})['then'](function(_0x14d58a){_0x37351a=_0x14d58a;logger['info']('Ticket\x20created!');logger[_0x19e3('0xe')](_0x19e3('0x63'),_0x37351a['id']);return setRelationship(_0x37ade2,_0xd54350,_0x37351a,_0x19e3('0x64'));})[_0x19e3('0x2e')](function(){return setRelationship(_0x37ade2,_0x41027e,_0x37351a,_0x19e3('0x65'));})[_0x19e3('0x2e')](function(){return getServerInfo(_0x37ade2);})[_0x19e3('0x6b')](function(_0x21a307){logger[_0x19e3('0x6c')]('['+_0x42dda9['lastevent'][_0x19e3('0x7a')]()+']',JSON['stringify'](_0x21a307));});}; \ No newline at end of file +var _0x627b=['Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_name','Searching\x20enduser\x20with\x20phone','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','string','customField','toLowerCase','content','idField','custom_fields','variable','Variable','POST','login','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','format','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','calleridnum','lodash','request-promise','bluebird','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','info','name','Subjects','assigned_user_id','description','getString','Descriptions','date_start','toISOString','replace','duration_minutes','parent_id','Contacts','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','stringify'];(function(_0x4acbf4,_0x56bf90){var _0x1ef2c7=function(_0x5ccf92){while(--_0x5ccf92){_0x4acbf4['push'](_0x4acbf4['shift']());}};_0x1ef2c7(++_0x56bf90);}(_0x627b,0x1a9));var _0xb627=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x627b[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xb627('0x0'));var rp=require(_0xb627('0x1'));var BPromise=require(_0xb627('0x2'));var md5=require(_0xb627('0x3'));var util=require('util');var Redis=require(_0xb627('0x4'));var intUtil=require('./util');var config=require(_0xb627('0x5'));var logger=require(_0xb627('0x6'))('sugarcrm');config[_0xb627('0x7')]=_[_0xb627('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb627('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x99dba0,_0x800ef0,_0xca0c2f){io['to'](_0x99dba0)['emit'](_0x800ef0,_0xca0c2f);}function getTicket(_0x5cbf3c,_0x5dafa3,_0xfcf583,_0xa2967f,_0x679e55,_0x3d29e3,_0x36f97f,_0x235722){logger[_0xb627('0x9')]('Creating\x20new\x20ticket...');var _0x579088=new Date();var _0x588950=[{'name':_0xb627('0xa'),'value':intUtil['getString'](_0xa2967f[_0xb627('0xb')],_0x679e55,'\x20')},{'name':_0xb627('0xc'),'value':_0x5dafa3['id']},{'name':'created_by','value':_0x5dafa3['id']},{'name':_0xb627('0xd'),'value':intUtil[_0xb627('0xe')](_0xa2967f[_0xb627('0xf')],_0x679e55,'\x0a')},{'name':_0xb627('0x10'),'value':_0x579088[_0xb627('0x11')]()['slice'](0x0,0x13)[_0xb627('0x12')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xb627('0x13'),'value':'15'},{'name':_0xb627('0x14'),'value':_0xfcf583['id']},{'name':'parent_type','value':_0xb627('0x15')},{'name':_0xb627('0x16'),'value':_0xfcf583['name']},{'name':_0xb627('0x17'),'value':_0x235722}];if(_0x3d29e3[_0xb627('0x18')]){_[_0xb627('0x19')](_0x3d29e3,function(_0x34fcaf){if(_0x679e55[_0x34fcaf[_0xb627('0x1a')]]){_0x588950[_0xb627('0x1b')]({'name':_0x34fcaf['idField'],'value':_0x679e55[_0x34fcaf[_0xb627('0x1a')]]});}});}return request({'form':{'method':_0xb627('0x1c'),'input_type':_0xb627('0x1d'),'response_type':'JSON','rest_data':JSON[_0xb627('0x1e')]({'session':_0x36f97f['id'],'module_name':'Calls','name_value_list':_0x588950})}});}function getAuth(_0x1f2e48){return util['format'](_0xb627('0x1f'),new Buffer(_0x1f2e48[_0xb627('0x20')]+':X')[_0xb627('0x21')]('base64'));}function getServerInfo(_0x54374c){return request({'form':{'method':_0xb627('0x22'),'input_type':_0xb627('0x1d'),'response_type':_0xb627('0x1d'),'rest_data':JSON[_0xb627('0x1e')]({'session':_0x54374c['id']})}});}function getUser(_0x5cde03,_0xe24e4c,_0x8d11ca){if(!_[_0xb627('0x23')](_0xe24e4c)){logger[_0xb627('0x9')](_0xb627('0x24'),_0xe24e4c);return request({'form':{'method':_0xb627('0x25'),'input_type':_0xb627('0x1d'),'response_type':_0xb627('0x1d'),'rest_data':JSON['stringify']({'session':_0x8d11ca['id'],'module_name':_0xb627('0x26'),'query':util['format'](_0xb627('0x27'),_0xe24e4c),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb627('0x28')](function(_0x28d6b8){if(_0x28d6b8[_0xb627('0x29')]['length']){var _0x31e9e8=_['find'](_0x28d6b8[_0xb627('0x29')],function(_0x28a6fa){return _0x28a6fa[_0xb627('0x2a')]['user_name'][_0xb627('0x2b')]===_0xe24e4c;});if(_0x31e9e8){logger[_0xb627('0x9')](_0xb627('0x2c'));return BPromise[_0xb627('0x2d')]({'id':_0x31e9e8['name_value_list']['id']['value'],'name':_0x31e9e8[_0xb627('0x2a')][_0xb627('0xa')][_0xb627('0x2b')]});}}logger['info'](_0xb627('0x2e'));return BPromise[_0xb627('0x2d')]({'id':_0x8d11ca['name_value_list'][_0xb627('0x2f')]['value'],'name':_0x8d11ca[_0xb627('0x2a')]['user_name'][_0xb627('0x2b')]});});}else{logger[_0xb627('0x9')](_0xb627('0x30'));return BPromise['resolve']({'id':_0x8d11ca[_0xb627('0x2a')]['user_id']['value'],'name':_0x8d11ca['name_value_list'][_0xb627('0x31')][_0xb627('0x2b')]});}}function getEndUser(_0x1546e1,_0x131dc5,_0x2a95b0,_0x163009){logger[_0xb627('0x9')](_0xb627('0x32'),_0x2a95b0);return request({'form':{'method':_0xb627('0x25'),'input_type':'JSON','response_type':_0xb627('0x1d'),'rest_data':JSON[_0xb627('0x1e')]({'session':_0x163009['id'],'module_name':_0xb627('0x15'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x2a95b0),'order_by':'','offset':'0','select_fields':['id',_0xb627('0xa'),_0xb627('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x47cb51){if(_0x47cb51[_0xb627('0x29')][_0xb627('0x18')]){var _0x55de11=_[_0xb627('0x34')](_0x47cb51[_0xb627('0x29')],function(_0x8e0482){return _0x8e0482['name_value_list'][_0xb627('0x33')][_0xb627('0x2b')]===_0x2a95b0;});if(_0x55de11){logger[_0xb627('0x9')](_0xb627('0x35'));return BPromise[_0xb627('0x2d')]({'id':_0x55de11[_0xb627('0x2a')]['id'][_0xb627('0x2b')],'name':_0x55de11['name_value_list'][_0xb627('0xa')]['value'],'phone':_0x55de11['name_value_list'][_0xb627('0x33')][_0xb627('0x2b')]});}}else{logger[_0xb627('0x9')](_0xb627('0x36'));return request({'form':{'method':_0xb627('0x1c'),'input_type':_0xb627('0x1d'),'response_type':_0xb627('0x1d'),'rest_data':JSON[_0xb627('0x1e')]({'session':_0x163009['id'],'module_name':_0xb627('0x15'),'name_value_list':[{'name':_0xb627('0x37'),'value':_0x131dc5!==_0xb627('0x38')?_0x131dc5:util['format'](_0xb627('0x39'),_0x2a95b0)},{'name':_0xb627('0x33'),'value':_0x2a95b0}]})}})[_0xb627('0x28')](function(_0x22d5a2){logger['info'](_0xb627('0x3a'));return BPromise['resolve']({'id':_0x22d5a2['id'],'name':_0x22d5a2['entry_list']['first_name'][_0xb627('0x2b')],'phone':_0x22d5a2[_0xb627('0x29')][_0xb627('0x33')]['value']});});}});}function request(_0x53ac71){logger['debug'](_0xb627('0x3b'),JSON['stringify'](_0x53ac71));return rp(_[_0xb627('0x3c')](def,_0x53ac71));}function getTags(_0x3f00a2,_0x576e63){var _0x2c7acd=[];if(_0x3f00a2&&_0x3f00a2[_0xb627('0x18')]>0x0){_0x2c7acd=_[_0xb627('0x3d')](_0x3f00a2,_0x576e63);}return _0x2c7acd;}function getCustomFields(_0x136ba6,_0xcfd94f){var _0x5132c9=[];var _0x1e0734={'custom_fields':[]};if(_0x136ba6[_0xb627('0x18')]>0x0){_['forEach'](_0x136ba6,function(_0x1b8217){if(_0x1b8217[_0xb627('0x3e')]===_0xb627('0x3f')&&_0x1b8217['nameField']&&!_0x1b8217[_0xb627('0x40')]){_0x1e0734[_0x1b8217['nameField'][_0xb627('0x41')]()]=_0x1b8217[_0xb627('0x42')][_0xb627('0x21')]();}else if(_0x1b8217[_0xb627('0x3e')]===_0xb627('0x3f')&&_0x1b8217[_0xb627('0x43')]&&_0x1b8217['customField']){_0x1e0734[_0xb627('0x44')][_0xb627('0x1b')]({'id':_0x1b8217[_0xb627('0x43')],'value':_0x1b8217['content'][_0xb627('0x21')]()});}else if(_0x1b8217[_0xb627('0x3e')]===_0xb627('0x45')&&_0x1b8217[_0xb627('0x1a')]&&_0x1b8217[_0xb627('0x43')]&&_0x1b8217[_0xb627('0x40')]){_0xcfd94f[_0x1b8217[_0xb627('0x1a')]]&&_0x1e0734['custom_fields'][_0xb627('0x1b')]({'id':_0x1b8217[_0xb627('0x43')],'value':_0xcfd94f[_0x1b8217['variableName']]['toString']()});}else if(_0x1b8217[_0xb627('0x3e')]==='customVariable'&&_0x1b8217['Variable']&&_0x1b8217[_0xb627('0x46')]['name']&&_0x1b8217[_0xb627('0x43')]&&_0x1b8217[_0xb627('0x40')]){_0xcfd94f[_0x1b8217[_0xb627('0x46')][_0xb627('0xa')][_0xb627('0x41')]()]&&_0x1e0734[_0xb627('0x44')][_0xb627('0x1b')]({'id':_0x1b8217[_0xb627('0x43')],'value':_0xcfd94f[_0x1b8217[_0xb627('0x46')][_0xb627('0xa')][_0xb627('0x41')]()][_0xb627('0x21')]()});}});}return _0x1e0734;}function getConnection(_0x40df9b){return request({'method':_0xb627('0x47'),'form':{'method':_0xb627('0x48'),'input_type':_0xb627('0x1d'),'response_type':'JSON','rest_data':JSON[_0xb627('0x1e')]({'user_auth':{'user_name':_0x40df9b[_0xb627('0x49')],'password':_0x40df9b[_0xb627('0x4a')],'encryption':'PLAIN'},'application':_0xb627('0x4b')})}})[_0xb627('0x28')](function(_0x4d791c){var _0x481b70=_0x4d791c;if(_0x481b70['id']){def['sessionID']=_0x481b70['id'];return BPromise['resolve'](_0x481b70);}else{throw new Error(util['format'](_0xb627('0x4c'),_0x40df9b['id']));}});}function setRelationship(_0x1936f3,_0x28e962,_0x2746ec,_0x2e49cf){return request({'form':{'method':_0xb627('0x4d'),'input_type':'JSON','response_type':_0xb627('0x1d'),'rest_data':JSON[_0xb627('0x1e')]({'session':_0x1936f3['id'],'module_name':'Calls','module_id':_0x2746ec['id'],'link_field_name':_0x2e49cf,'related_ids':[_0x28e962['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x167c29,_0x3b5697,_0x19dcca,_0x125279,_0x6f263c,_0x493eff){var _0x35b541,_0x1989e5,_0xe28b2d,_0x2e38fc;_0x493eff[_0xb627('0x4e')]=intUtil[_0xb627('0x4f')](_0x493eff[_0xb627('0x4e')]);_0x493eff[_0xb627('0x50')]=intUtil[_0xb627('0x4f')](_0x493eff[_0xb627('0x50')]);def[_0xb627('0x51')]=util[_0xb627('0x52')]('%s/service/v4_1/rest.php',_0x493eff[_0xb627('0x4e')]);if(_0x6f263c&&_0x6f263c[_0xb627('0x53')]){logger[_0xb627('0x9')](_0xb627('0x54'),_0xb627('0x55'));_0x3b5697['recordingURL']=util[_0xb627('0x52')](_0xb627('0x56'),_0x493eff[_0xb627('0x50')],_0x3b5697[_0xb627('0x57')],md5(_0x3b5697['uniqueid']));}else{_0x3b5697[_0xb627('0x58')]='';}return getConnection(_0x493eff)['then'](function(_0x4d86b2){_0x2e38fc=_0x4d86b2;return getUser(_0x493eff,_0x125279[_0xb627('0xa')],_0x2e38fc);})[_0xb627('0x28')](function(_0x4ca4c2){_0x35b541=_0x4ca4c2;logger[_0xb627('0x9')](_0xb627('0x59'),_0x35b541['id']);return getEndUser(_0x493eff,_0x3b5697['calleridname'],_0x3b5697['calleridnum'],_0x2e38fc);})[_0xb627('0x28')](function(_0x115aab){_0x1989e5=_0x115aab;logger[_0xb627('0x9')](_0xb627('0x5a'),_0x1989e5['id']);return getTicket(_0x493eff,_0x35b541,_0x1989e5,_0x19dcca,_0x3b5697,_0x19dcca[_0xb627('0x5b')],_0x2e38fc,_0xb627('0x5c'));})[_0xb627('0x28')](function(_0x567d38){_0xe28b2d=_0x567d38;logger[_0xb627('0x9')](_0xb627('0x5d'));logger[_0xb627('0x9')](_0xb627('0x5e'),_0xe28b2d['id']);return setRelationship(_0x2e38fc,_0x35b541,_0xe28b2d,_0xb627('0x5f'));})[_0xb627('0x28')](function(){return setRelationship(_0x2e38fc,_0x1989e5,_0xe28b2d,_0xb627('0x60'));})['then'](function(){return getServerInfo(_0x2e38fc);})[_0xb627('0x28')](function(_0x3091ad){var _0x53a14e=parseInt(_0x3091ad[_0xb627('0x61')][_0xb627('0x62')](0x0));var _0x47c6a2=util['format'](_0xb627('0x63'),_0x493eff[_0xb627('0x4e')],_0xe28b2d['id']);if(_0x53a14e>0x6){_0x47c6a2=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x493eff[_0xb627('0x4e')],_0xe28b2d['id']);}logger['info']('[QUEUE]',_0xb627('0x64'));emit(util[_0xb627('0x52')](_0xb627('0x65'),_0x125279['name']),'trigger:browser:url',{'uri':_0x47c6a2});})[_0xb627('0x66')](function(_0x4670b2){logger[_0xb627('0x67')](_0xb627('0x54'),JSON[_0xb627('0x1e')](_0x4670b2));});};exports['outbound']=function(_0x39c03c,_0x18bf91,_0x26ae42,_0x3a93a0,_0xe3b2be,_0x5da913,_0x5bb5ec){var _0x28fe19,_0x12129d,_0x17c88d,_0x48bcf7;_0x5da913['remoteUri']=intUtil[_0xb627('0x4f')](_0x5da913[_0xb627('0x4e')]);_0x5da913[_0xb627('0x50')]=intUtil['stripTrailingSlash'](_0x5da913[_0xb627('0x50')]);def[_0xb627('0x51')]=util['format'](_0xb627('0x68'),_0x5da913[_0xb627('0x4e')]);if(_0x5bb5ec&&_0x5bb5ec[_0xb627('0x69')]&&_0x5bb5ec[_0xb627('0x69')]!==_0xb627('0x6a')){logger[_0xb627('0x9')](_0xb627('0x6b'),_0xb627('0x55'));_0x18bf91[_0xb627('0x58')]=util[_0xb627('0x52')](_0xb627('0x56'),_0x5da913[_0xb627('0x50')],_0x18bf91[_0xb627('0x57')],md5(_0x18bf91['uniqueid']));}return getConnection(_0x5da913)['then'](function(_0x1fca2d){_0x48bcf7=_0x1fca2d;return getUser(_0x5da913,_0x3a93a0[_0xb627('0xa')],_0x48bcf7);})[_0xb627('0x28')](function(_0x36336d){_0x28fe19=_0x36336d;logger['info'](_0xb627('0x59'),_0x28fe19['id']);return getEndUser(_0x5da913,_0x18bf91['destcalleridname'],_0x18bf91[_0xb627('0x6c')],_0x48bcf7);})['then'](function(_0x1beb19){_0x12129d=_0x1beb19;logger[_0xb627('0x9')](_0xb627('0x5a'),_0x12129d['id']);return getTicket(_0x5da913,_0x28fe19,_0x12129d,_0x26ae42,_0x18bf91,_0x26ae42[_0xb627('0x5b')],_0x48bcf7,'Outbound');})['then'](function(_0x5ca0f8){_0x17c88d=_0x5ca0f8;logger['info'](_0xb627('0x5d'));logger['info'](_0xb627('0x5e'),_0x17c88d['id']);return setRelationship(_0x48bcf7,_0x28fe19,_0x17c88d,_0xb627('0x5f'));})[_0xb627('0x28')](function(){return setRelationship(_0x48bcf7,_0x12129d,_0x17c88d,'contacts');})[_0xb627('0x28')](function(){return getServerInfo(_0x48bcf7);})[_0xb627('0x28')](function(_0x2f3693){var _0x4ed7af=parseInt(_0x2f3693[_0xb627('0x61')]['charAt'](0x0));var _0x20de72=util['format'](_0xb627('0x63'),_0x5da913[_0xb627('0x4e')],_0x17c88d['id']);if(_0x4ed7af>0x6){_0x20de72=util[_0xb627('0x52')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5da913[_0xb627('0x4e')],_0x17c88d['id']);}logger[_0xb627('0x9')](_0xb627('0x6b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb627('0x52')](_0xb627('0x65'),_0x3a93a0[_0xb627('0xa')]),_0xb627('0x6d'),{'uri':_0x20de72});})['catch'](function(_0x2a92c6){logger[_0xb627('0x67')](_0xb627('0x6b'),JSON[_0xb627('0x1e')](_0x2a92c6));});};exports[_0xb627('0x6e')]=function(_0x2a3c7a,_0x2672e7,_0x401f46,_0x474f79,_0x60a5f6,_0x18f10b){var _0x838ce9,_0x369ab8,_0xd5273b,_0x251b78;_0x18f10b['remoteUri']=intUtil['stripTrailingSlash'](_0x18f10b['remoteUri']);_0x18f10b[_0xb627('0x50')]=intUtil['stripTrailingSlash'](_0x18f10b[_0xb627('0x50')]);def[_0xb627('0x51')]=util[_0xb627('0x52')](_0xb627('0x68'),_0x18f10b['remoteUri']);if(_0x60a5f6&&_0x60a5f6[_0xb627('0x53')]){logger[_0xb627('0x9')]('['+_0x2672e7[_0xb627('0x6f')][_0xb627('0x70')]()+']',_0xb627('0x55'));_0x2672e7[_0xb627('0x58')]=util[_0xb627('0x52')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x18f10b[_0xb627('0x50')],_0x2672e7['uniqueid'],md5(_0x2672e7[_0xb627('0x57')]));}else{_0x2672e7[_0xb627('0x58')]='';}return getConnection(_0x18f10b)[_0xb627('0x28')](function(_0x9b437f){_0x251b78=_0x9b437f;if(!_['isNil'](_0x474f79)){return getUser(_0x18f10b,_0x474f79['name'],_0x251b78);}else{return getUser(_0x18f10b,null,_0x251b78);}})['then'](function(_0x54fe15){_0x838ce9=_0x54fe15;logger[_0xb627('0x9')]('The\x20User\x20ID\x20is:',_0x838ce9['id']);return getEndUser(_0x18f10b,_0x2672e7['calleridname'],_0x2672e7[_0xb627('0x71')],_0x251b78);})[_0xb627('0x28')](function(_0xaa5169){_0x369ab8=_0xaa5169;logger[_0xb627('0x9')](_0xb627('0x5a'),_0x369ab8['id']);return getTicket(_0x18f10b,_0x838ce9,_0x369ab8,_0x401f46,_0x2672e7,_0x401f46[_0xb627('0x5b')],_0x251b78,_0xb627('0x5c'));})['then'](function(_0xa899bf){_0xd5273b=_0xa899bf;logger[_0xb627('0x9')](_0xb627('0x5d'));logger[_0xb627('0x9')](_0xb627('0x5e'),_0xd5273b['id']);return setRelationship(_0x251b78,_0x838ce9,_0xd5273b,'users');})[_0xb627('0x28')](function(){return setRelationship(_0x251b78,_0x369ab8,_0xd5273b,'contacts');})['then'](function(){return getServerInfo(_0x251b78);})[_0xb627('0x66')](function(_0x4d99ad){logger['error']('['+_0x2672e7[_0xb627('0x6f')]['toUpperCase']()+']',JSON[_0xb627('0x1e')](_0x4d99ad));});}; \ 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 f7b03bb..97ac0f2 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 _0xe047=['test','lodash','util','length','sortBy','type','string','content','variable','variableName','push','customVariable','Variable','name','toLowerCase','toString','key','format','%s:\x20%s','keyType','join','slice','validateEmail'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xe047,0x1cd));var _0x7e04=function(_0x1a1072,_0x84a807){_0x1a1072=_0x1a1072-0x0;var _0x415142=_0xe047[_0x1a1072];return _0x415142;};'use strict';var _=require(_0x7e04('0x0'));var util=require(_0x7e04('0x1'));exports['getString']=function(_0x1fc9ad,_0xa3bc63,_0x3d0f28){var _0x1520ed=[];if(_0x1fc9ad[_0x7e04('0x2')]>0x0){var _0x4d410f=_[_0x7e04('0x3')](_0x1fc9ad,['id']);for(var _0x438646=0x0;_0x438646<_0x4d410f[_0x7e04('0x2')];_0x438646++){var _0x89c9e3=_0x4d410f[_0x438646];if(_0x89c9e3[_0x7e04('0x4')]===_0x7e04('0x5')){_0x1520ed['push'](_0x89c9e3[_0x7e04('0x6')]);}else if(_0x89c9e3['type']===_0x7e04('0x7')&&_0x89c9e3[_0x7e04('0x8')]){_0xa3bc63[_0x89c9e3[_0x7e04('0x8')]]&&_0x1520ed[_0x7e04('0x9')](_0xa3bc63[_0x89c9e3[_0x7e04('0x8')]]['toString']());}else if(_0x89c9e3[_0x7e04('0x4')]===_0x7e04('0xa')&&_0x89c9e3[_0x7e04('0xb')]&&_0x89c9e3['Variable'][_0x7e04('0xc')]){_0xa3bc63[_0x89c9e3['Variable'][_0x7e04('0xc')][_0x7e04('0xd')]()]&&_0x1520ed[_0x7e04('0x9')](_0xa3bc63[_0x89c9e3[_0x7e04('0xb')][_0x7e04('0xc')][_0x7e04('0xd')]()][_0x7e04('0xe')]());}else if(_0x89c9e3[_0x7e04('0x4')]==='keyValue'){if(_0x89c9e3['keyType']===_0x7e04('0x5')&&_0x89c9e3[_0x7e04('0xf')]){_0x1520ed[_0x7e04('0x9')](util[_0x7e04('0x10')](_0x7e04('0x11'),_0x89c9e3['key'],_0x89c9e3['keyContent']));}else if(_0x89c9e3[_0x7e04('0x12')]===_0x7e04('0x7')&&_0x89c9e3[_0x7e04('0x8')]&&_0x89c9e3['key']){_0xa3bc63[_0x89c9e3[_0x7e04('0x8')]]&&_0x1520ed[_0x7e04('0x9')](util[_0x7e04('0x10')]('%s:\x20%s',_0x89c9e3[_0x7e04('0xf')],_0xa3bc63[_0x89c9e3[_0x7e04('0x8')]]));}else if(_0x89c9e3[_0x7e04('0x12')]===_0x7e04('0xa')&&_0x89c9e3[_0x7e04('0xb')]&&_0x89c9e3[_0x7e04('0xb')]['name']&&_0x89c9e3[_0x7e04('0xf')]){_0xa3bc63[_0x89c9e3[_0x7e04('0xb')]['name'][_0x7e04('0xd')]()]&&_0x1520ed['push'](util['format'](_0x7e04('0x11'),_0x89c9e3[_0x7e04('0xf')],_0xa3bc63[_0x89c9e3[_0x7e04('0xb')]['name'][_0x7e04('0xd')]()]));}}}}return _0x1520ed[_0x7e04('0x13')](_0x3d0f28);};exports['stripTrailingSlash']=function(_0x335904){var _0x3f22f8=_0x335904[_0x7e04('0x14')](-0x1);if(_0x3f22f8==='/'){_0x335904=_0x335904['substring'](0x0,_0x335904['lastIndexOf'](_0x3f22f8));}return _0x335904;};exports[_0x7e04('0x15')]=function(_0x5bfb0e){if(!_['isNil'](_0x5bfb0e)&&_0x5bfb0e!==''){var _0x11e849=/^(([^<>()\[\]\\.,;:\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 _0x11e849[_0x7e04('0x16')](String(_0x5bfb0e)[_0x7e04('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xdf15=['lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','key','format','%s:\x20%s','keyType','toLowerCase','join','stripTrailingSlash','slice'];(function(_0x446301,_0x15b238){var _0x268e22=function(_0x29a525){while(--_0x29a525){_0x446301['push'](_0x446301['shift']());}};_0x268e22(++_0x15b238);}(_0xdf15,0x148));var _0x5df1=function(_0x3a0535,_0x1df088){_0x3a0535=_0x3a0535-0x0;var _0x439f3c=_0xdf15[_0x3a0535];return _0x439f3c;};'use strict';var _=require(_0x5df1('0x0'));var util=require(_0x5df1('0x1'));exports[_0x5df1('0x2')]=function(_0xd63745,_0x4dd691,_0x352cdd){var _0x27d9aa=[];if(_0xd63745[_0x5df1('0x3')]>0x0){var _0x35de08=_[_0x5df1('0x4')](_0xd63745,['id']);for(var _0x4408b3=0x0;_0x4408b3<_0x35de08[_0x5df1('0x3')];_0x4408b3++){var _0x28c6c4=_0x35de08[_0x4408b3];if(_0x28c6c4['type']===_0x5df1('0x5')){_0x27d9aa[_0x5df1('0x6')](_0x28c6c4[_0x5df1('0x7')]);}else if(_0x28c6c4[_0x5df1('0x8')]===_0x5df1('0x9')&&_0x28c6c4['variableName']){_0x4dd691[_0x28c6c4[_0x5df1('0xa')]]&&_0x27d9aa[_0x5df1('0x6')](_0x4dd691[_0x28c6c4['variableName']][_0x5df1('0xb')]());}else if(_0x28c6c4['type']===_0x5df1('0xc')&&_0x28c6c4[_0x5df1('0xd')]&&_0x28c6c4[_0x5df1('0xd')][_0x5df1('0xe')]){_0x4dd691[_0x28c6c4[_0x5df1('0xd')][_0x5df1('0xe')]['toLowerCase']()]&&_0x27d9aa[_0x5df1('0x6')](_0x4dd691[_0x28c6c4['Variable'][_0x5df1('0xe')]['toLowerCase']()]['toString']());}else if(_0x28c6c4['type']==='keyValue'){if(_0x28c6c4['keyType']===_0x5df1('0x5')&&_0x28c6c4[_0x5df1('0xf')]){_0x27d9aa[_0x5df1('0x6')](util[_0x5df1('0x10')](_0x5df1('0x11'),_0x28c6c4[_0x5df1('0xf')],_0x28c6c4['keyContent']));}else if(_0x28c6c4[_0x5df1('0x12')]===_0x5df1('0x9')&&_0x28c6c4[_0x5df1('0xa')]&&_0x28c6c4[_0x5df1('0xf')]){_0x4dd691[_0x28c6c4[_0x5df1('0xa')]]&&_0x27d9aa[_0x5df1('0x6')](util[_0x5df1('0x10')](_0x5df1('0x11'),_0x28c6c4['key'],_0x4dd691[_0x28c6c4[_0x5df1('0xa')]]));}else if(_0x28c6c4[_0x5df1('0x12')]==='customVariable'&&_0x28c6c4[_0x5df1('0xd')]&&_0x28c6c4[_0x5df1('0xd')][_0x5df1('0xe')]&&_0x28c6c4[_0x5df1('0xf')]){_0x4dd691[_0x28c6c4[_0x5df1('0xd')][_0x5df1('0xe')][_0x5df1('0x13')]()]&&_0x27d9aa['push'](util[_0x5df1('0x10')]('%s:\x20%s',_0x28c6c4['key'],_0x4dd691[_0x28c6c4[_0x5df1('0xd')]['name']['toLowerCase']()]));}}}}return _0x27d9aa[_0x5df1('0x14')](_0x352cdd);};exports[_0x5df1('0x15')]=function(_0x4fd52f){var _0x44dc97=_0x4fd52f[_0x5df1('0x16')](-0x1);if(_0x44dc97==='/'){_0x4fd52f=_0x4fd52f['substring'](0x0,_0x4fd52f[_0x5df1('0x17')](_0x44dc97));}return _0x4fd52f;};exports[_0x5df1('0x18')]=function(_0x3b20bf){if(!_[_0x5df1('0x19')](_0x3b20bf)&&_0x3b20bf!==''){var _0x513b56=/^(([^<>()\[\]\\.,;:\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 _0x513b56[_0x5df1('0x1a')](String(_0x3b20bf)[_0x5df1('0x13')]());}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 06a2000..3f37f39 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x2d8e4e,_0x1a0e08){var _0x4ca568=function(_0x2f958e){while(--_0x2f958e){_0x2d8e4e['push'](_0x2d8e4e['shift']());}};_0x4ca568(++_0x1a0e08);}(_0xe706,0xa3));var _0x6e70=function(_0x3abce4,_0x34e488){_0x3abce4=_0x3abce4-0x0;var _0x2c25db=_0xe706[_0x3abce4];return _0x2c25db;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x38612f,_0x5c7a75){var _0x28bfff=function(_0x37318c){while(--_0x37318c){_0x38612f['push'](_0x38612f['shift']());}};_0x28bfff(++_0x5c7a75);}(_0xe706,0xa3));var _0x6e70=function(_0xe502ca,_0x1cc7cc){_0xe502ca=_0xe502ca-0x0;var _0x514270=_0xe706[_0xe502ca];return _0x514270;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index dca98c6..ab09cb5 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 _0x2767=['socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','merge','getString','Descriptions','Ticket\x20created!','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','results','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','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','password','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','includes','type','nameField','string','picklist','idField','customField','variableName','custom_fields','push','Variable','toLowerCase','name','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost'];(function(_0xdb95ba,_0x3af7f9){var _0x2c35f2=function(_0x251595){while(--_0x251595){_0xdb95ba['push'](_0xdb95ba['shift']());}};_0x2c35f2(++_0x3af7f9);}(_0x2767,0x130));var _0x7276=function(_0x411f40,_0x1c2c66){_0x411f40=_0x411f40-0x0;var _0x24066e=_0x2767[_0x411f40];return _0x24066e;};'use strict';var _=require('lodash');var rp=require(_0x7276('0x0'));var md5=require(_0x7276('0x1'));var util=require('util');var Redis=require(_0x7276('0x2'));var intUtil=require('./util');var config=require(_0x7276('0x3'));var logger=require(_0x7276('0x4'))('zendesk');config[_0x7276('0x5')]=_[_0x7276('0x6')](config[_0x7276('0x5')],{'host':_0x7276('0x7'),'port':0x18eb});var io=require(_0x7276('0x8'))(new Redis(config[_0x7276('0x5')]));function emit(_0x272576,_0x5414a3,_0x47d3fe){io['to'](_0x272576)[_0x7276('0x9')](_0x5414a3,_0x47d3fe);}var headers={'Content-Type':_0x7276('0xa'),'Accept':_0x7276('0xa')};function getTicket(_0x521006,_0x18badb,_0x99e25,_0x456e1e,_0x1a6a24){logger[_0x7276('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x7276('0xc')](_0x7276('0xd'),_0x521006[_0x7276('0xe')]),'method':'POST','body':{'ticket':_[_0x7276('0xf')]({'requester_id':_0x99e25['id'],'submitter_id':_0x18badb?_0x18badb['id']:undefined,'assignee_id':_0x18badb?_0x18badb['id']:undefined,'tags':getTags(_0x456e1e['Tags'],'name'),'subject':intUtil[_0x7276('0x10')](_0x456e1e['Subjects'],_0x1a6a24,'\x20'),'description':intUtil[_0x7276('0x10')](_0x456e1e[_0x7276('0x11')],_0x1a6a24,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x456e1e[_0x7276('0x11')],_0x1a6a24,'\x0a')}},getCustomFields(_0x456e1e['Fields'],_0x1a6a24))}})['then'](function(_0x36b540){logger[_0x7276('0xb')](_0x7276('0x12'));return _0x36b540['ticket'];});}function getUser(_0x4669fd,_0x48e8a5){if(intUtil[_0x7276('0x13')](_0x48e8a5)){logger[_0x7276('0xb')]('Getting\x20agent\x20with\x20email',_0x48e8a5);return request({'uri':util[_0x7276('0xc')](_0x7276('0x14'),_0x4669fd[_0x7276('0xe')]),'qs':{'query':util[_0x7276('0xc')](_0x7276('0x15'),_0x48e8a5)}})[_0x7276('0x16')](function(_0x11b269){if(_0x11b269[_0x7276('0x17')]){logger[_0x7276('0xb')](_0x7276('0x18'));return _['find'](_0x11b269[_0x7276('0x19')],{'email':_0x48e8a5,'role':'agent'});}else{logger['info'](_0x7276('0x1a'));return request({'uri':util[_0x7276('0xc')](_0x7276('0x1b'),_0x4669fd['remoteUri'])})['then'](function(_0x2463af){logger[_0x7276('0xb')]('Admin\x20account\x20selected.');return _0x2463af['user'];});}});}else{logger[_0x7276('0xb')](_0x7276('0x1a'));return request({'uri':util['format'](_0x7276('0x1b'),_0x4669fd[_0x7276('0xe')])})['then'](function(_0x328bf2){logger[_0x7276('0xb')](_0x7276('0x1c'));return _0x328bf2[_0x7276('0x1d')];});}}function getEndUser(_0x2226cf,_0x5cb564,_0x571204){logger[_0x7276('0xb')](_0x7276('0x1e'),_0x571204);return request({'uri':util[_0x7276('0xc')]('%s/search.json',_0x2226cf[_0x7276('0xe')]),'qs':{'query':util['format'](_0x7276('0x1f'),_0x571204)}})[_0x7276('0x16')](function(_0x2d8eda){var _0x3953d5;if(_0x2d8eda['results'][_0x7276('0x20')]){_0x2d8eda[_0x7276('0x19')]=_[_0x7276('0x21')](_0x2d8eda['results'],{'suspended':![],'role':_0x7276('0x22')});if(_0x2d8eda['results']['length']){_0x3953d5=_[_0x7276('0x23')](_0x2d8eda['results']);}}if(_0x3953d5){logger[_0x7276('0xb')](_0x7276('0x24'));return _0x3953d5;}else{logger[_0x7276('0xb')](_0x7276('0x25'));return request({'uri':util[_0x7276('0xc')]('%s/users.json',_0x2226cf[_0x7276('0xe')]),'method':_0x7276('0x26'),'body':{'user':{'role':_0x7276('0x22'),'name':util[_0x7276('0xc')]('Caller\x20-\x20%s',_0x5cb564||_0x571204),'phone':_0x571204}}})[_0x7276('0x16')](function(_0x4d52da){logger['info'](_0x7276('0x27'));return _0x4d52da[_0x7276('0x1d')];});}});}function getAuth(_0x29645e){var _0x5cbf8a;if(_0x29645e['authType']===_0x7276('0x28')){_0x5cbf8a=util[_0x7276('0xc')]('%s:%s',_0x29645e[_0x7276('0x29')],_0x29645e['password']);}else if(_0x29645e[_0x7276('0x2a')]===_0x7276('0x2b')){_0x5cbf8a=util['format'](_0x7276('0x2c'),_0x29645e[_0x7276('0x29')],_0x29645e[_0x7276('0x2b')]);}return util[_0x7276('0xc')](_0x7276('0x2d'),new Buffer(_0x5cbf8a)[_0x7276('0x2e')](_0x7276('0x2f')));}function request(_0x3cd38b){logger[_0x7276('0x30')](_0x7276('0x31'),JSON[_0x7276('0x32')](_0x3cd38b));return rp(_[_0x7276('0x6')](_0x3cd38b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x12825e,_0xd1111f){var _0x591372=[];if(_0x12825e&&_0x12825e[_0x7276('0x20')]>0x0){_0x591372=_[_0x7276('0x33')](_0x12825e,_0xd1111f);}return _0x591372;}function getCustomFields(_0x39eb6f,_0xbe0951){var _0x221a2e=[];var _0x3044b8={'custom_fields':[]};if(_0x39eb6f[_0x7276('0x20')]>0x0){_['forEach'](_0x39eb6f,function(_0x4c12fb){if(_[_0x7276('0x34')](['string','picklist'],_0x4c12fb[_0x7276('0x35')])&&_0x4c12fb[_0x7276('0x36')]&&!_0x4c12fb['customField']){_0x3044b8[_0x4c12fb[_0x7276('0x36')]['toLowerCase']()]=_0x4c12fb['content'][_0x7276('0x2e')]();}else if(_[_0x7276('0x34')]([_0x7276('0x37'),_0x7276('0x38')],_0x4c12fb[_0x7276('0x35')])&&_0x4c12fb[_0x7276('0x39')]&&_0x4c12fb[_0x7276('0x3a')]){_0x3044b8['custom_fields']['push']({'id':_0x4c12fb[_0x7276('0x39')],'value':_0x4c12fb['content']['toString']()});}else if(_0x4c12fb[_0x7276('0x35')]==='variable'&&_0x4c12fb[_0x7276('0x3b')]&&_0x4c12fb[_0x7276('0x39')]&&_0x4c12fb['customField']){_0xbe0951[_0x4c12fb[_0x7276('0x3b')]]&&_0x3044b8[_0x7276('0x3c')][_0x7276('0x3d')]({'id':_0x4c12fb[_0x7276('0x39')],'value':_0xbe0951[_0x4c12fb[_0x7276('0x3b')]][_0x7276('0x2e')]()});}else if(_0x4c12fb['type']==='customVariable'&&_0x4c12fb['Variable']&&_0x4c12fb['Variable']['name']&&_0x4c12fb['idField']&&_0x4c12fb[_0x7276('0x3a')]){_0xbe0951[_0x4c12fb[_0x7276('0x3e')]['name'][_0x7276('0x3f')]()]&&_0x3044b8[_0x7276('0x3c')][_0x7276('0x3d')]({'id':_0x4c12fb['idField'],'value':_0xbe0951[_0x4c12fb[_0x7276('0x3e')][_0x7276('0x40')][_0x7276('0x3f')]()][_0x7276('0x2e')]()});}});}return _0x3044b8;}exports[_0x7276('0x41')]=function(_0x5e0a70,_0x3c9f3d,_0x5724bc,_0x337113,_0x155401,_0x4aa1db){var _0x44791a,_0x27448c;_0x4aa1db['remoteUri']=intUtil[_0x7276('0x42')](_0x4aa1db[_0x7276('0xe')]);_0x4aa1db[_0x7276('0x43')]=intUtil[_0x7276('0x42')](_0x4aa1db['serverUrl']);if(_0x155401&&_0x155401[_0x7276('0x44')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x3c9f3d[_0x7276('0x45')]=util[_0x7276('0xc')](_0x7276('0x46'),_0x4aa1db[_0x7276('0x43')],_0x3c9f3d[_0x7276('0x47')],md5(_0x3c9f3d[_0x7276('0x47')]));}else{_0x3c9f3d[_0x7276('0x45')]='';}headers[_0x7276('0x48')]=getAuth(_0x4aa1db);return getUser(_0x4aa1db,_0x337113[_0x7276('0x49')])[_0x7276('0x16')](function(_0x54f93b){_0x44791a=_0x54f93b;logger[_0x7276('0xb')](_0x7276('0x4a'),_0x44791a['id']);return getEndUser(_0x4aa1db,_0x3c9f3d['calleridname'],_0x3c9f3d['calleridnum']);})[_0x7276('0x16')](function(_0x41d577){_0x27448c=_0x41d577;logger[_0x7276('0xb')]('The\x20Enduser\x20ID\x20is:',_0x27448c['id']);return getTicket(_0x4aa1db,_0x44791a,_0x27448c,_0x5724bc,_0x3c9f3d);})[_0x7276('0x16')](function(_0x31787a){if(_0x31787a){logger['info'](_0x7276('0x4b'),_0x31787a['id']);switch(_0x4aa1db[_0x7276('0x35')]){case _0x7276('0x4c'):logger[_0x7276('0xb')](_0x7276('0x4d'),_0x7276('0x4e'));return request({'uri':util[_0x7276('0xc')](_0x7276('0x4f'),_0x4aa1db[_0x7276('0xe')],_0x44791a['id'],_0x31787a['id']),'method':_0x7276('0x26')});case _0x7276('0x50'):logger['info'](_0x7276('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x7276('0x51'),_0x337113[_0x7276('0x40')]),_0x7276('0x52'),{'uri':util[_0x7276('0xc')](_0x7276('0x53'),_0x4aa1db[_0x7276('0xe')][_0x7276('0x54')](_0x7276('0x55'),''),_0x31787a['id'])});break;default:logger[_0x7276('0x56')](_0x7276('0x4d'),_0x7276('0x57'));}}})[_0x7276('0x58')](function(_0x1bc4a7){logger['error'](_0x7276('0x59'),util['inspect'](_0x1bc4a7,{'showHidden':!![],'depth':null}));});};exports[_0x7276('0x5a')]=function(_0x178abb,_0x1da253,_0x4a4353,_0x2e65ac,_0x58f94f,_0x521fe7,_0x148890){var _0x5512e1,_0x330da1;_0x521fe7[_0x7276('0xe')]=intUtil[_0x7276('0x42')](_0x521fe7[_0x7276('0xe')]);_0x521fe7[_0x7276('0x43')]=intUtil[_0x7276('0x42')](_0x521fe7[_0x7276('0x43')]);if(_0x148890&&_0x148890[_0x7276('0x5b')]&&_0x148890[_0x7276('0x5b')]!=='none'){logger['info'](_0x7276('0x5c'),_0x7276('0x5d'));_0x1da253[_0x7276('0x45')]=util['format'](_0x7276('0x46'),_0x521fe7[_0x7276('0x43')],_0x1da253[_0x7276('0x47')],md5(_0x1da253[_0x7276('0x47')]));}headers[_0x7276('0x48')]=getAuth(_0x521fe7);return getUser(_0x521fe7,_0x2e65ac[_0x7276('0x49')])['then'](function(_0xa15a13){_0x5512e1=_0xa15a13;logger['info'](_0x7276('0x4a'),_0x5512e1['id']);return getEndUser(_0x521fe7,_0x1da253[_0x7276('0x5e')],_0x1da253['destcalleridnum']);})[_0x7276('0x16')](function(_0x201816){_0x330da1=_0x201816;logger[_0x7276('0xb')](_0x7276('0x5f'),_0x330da1['id']);return getTicket(_0x521fe7,_0x5512e1,_0x330da1,_0x4a4353,_0x1da253);})[_0x7276('0x16')](function(_0x485c94){if(_0x485c94){logger['info'](_0x7276('0x4b'),_0x485c94['id']);switch(_0x521fe7['type']){case _0x7276('0x4c'):logger[_0x7276('0xb')](_0x7276('0x5c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x7276('0xc')](_0x7276('0x4f'),_0x521fe7[_0x7276('0xe')],_0x5512e1['id'],_0x485c94['id']),'method':_0x7276('0x26')});case _0x7276('0x50'):logger[_0x7276('0xb')](_0x7276('0x5c'),_0x7276('0x60'));emit(util[_0x7276('0xc')](_0x7276('0x51'),_0x2e65ac[_0x7276('0x40')]),_0x7276('0x52'),{'uri':util[_0x7276('0xc')](_0x7276('0x53'),_0x521fe7[_0x7276('0xe')][_0x7276('0x54')]('/api/v2',''),_0x485c94['id'])});break;default:logger['error'](_0x7276('0x5c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7276('0x58')](function(_0x494e24){logger[_0x7276('0x56')](_0x7276('0x61'),util[_0x7276('0x62')](_0x494e24,{'showHidden':!![],'depth':null}));});};exports[_0x7276('0x63')]=function(_0x477ed9,_0xece583,_0x15fa51,_0x47f838,_0x3a6a6b,_0x1126d9){var _0x5657af,_0x4d11f8;_0x1126d9['remoteUri']=intUtil[_0x7276('0x42')](_0x1126d9['remoteUri']);_0x1126d9['serverUrl']=intUtil[_0x7276('0x42')](_0x1126d9[_0x7276('0x43')]);if(_0x3a6a6b&&_0x3a6a6b[_0x7276('0x44')]){logger[_0x7276('0xb')]('['+_0xece583[_0x7276('0x64')][_0x7276('0x65')]()+']',_0x7276('0x5d'));_0xece583['recordingURL']=util[_0x7276('0xc')](_0x7276('0x46'),_0x1126d9['serverUrl'],_0xece583['uniqueid'],md5(_0xece583[_0x7276('0x47')]));}else{_0xece583[_0x7276('0x45')]='';}headers[_0x7276('0x48')]=getAuth(_0x1126d9);return getUser(_0x1126d9)[_0x7276('0x16')](function(_0x33dfd5){_0x5657af=_0x33dfd5;logger[_0x7276('0xb')](_0x7276('0x4a'),_0x5657af['id']);return getEndUser(_0x1126d9,_0xece583['calleridname'],_0xece583[_0x7276('0x66')]);})[_0x7276('0x16')](function(_0x42e777){_0x4d11f8=_0x42e777;logger[_0x7276('0xb')]('The\x20Enduser\x20ID\x20is:',_0x4d11f8['id']);return getTicket(_0x1126d9,_0x5657af,_0x4d11f8,_0x15fa51,_0xece583);})[_0x7276('0x16')](function(_0x3331bc){if(_0x3331bc){logger[_0x7276('0xb')]('The\x20Ticket\x20ID\x20is:',_0x3331bc['id']);}})[_0x7276('0x58')](function(_0x409456){logger['error']('['+_0xece583['lastevent']['toUpperCase']()+']'+_0x7276('0x67'),util[_0x7276('0x62')](_0x409456,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf022=['variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:browser:url','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','./util','../../../../config/environment','zendesk','defaults','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','includes','string','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','push','content'];(function(_0x402fc2,_0x10598d){var _0x434df6=function(_0x3f4092){while(--_0x3f4092){_0x402fc2['push'](_0x402fc2['shift']());}};_0x434df6(++_0x10598d);}(_0xf022,0x1e8));var _0x2f02=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0xf022[_0x6ca7f4];return _0x494fa6;};'use strict';var _=require(_0x2f02('0x0'));var rp=require('request-promise');var md5=require(_0x2f02('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x2f02('0x2'));var config=require(_0x2f02('0x3'));var logger=require('../../../../config/logger')(_0x2f02('0x4'));config['redis']=_[_0x2f02('0x5')](config[_0x2f02('0x6')],{'host':_0x2f02('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2f02('0x6')]));function emit(_0x242b7b,_0x35c3fd,_0x127765){io['to'](_0x242b7b)[_0x2f02('0x8')](_0x35c3fd,_0x127765);}var headers={'Content-Type':_0x2f02('0x9'),'Accept':'application/json'};function getTicket(_0x41d69f,_0x26f012,_0x5da4e0,_0x2cc412,_0x1685f2){logger[_0x2f02('0xa')](_0x2f02('0xb'));return request({'uri':util[_0x2f02('0xc')](_0x2f02('0xd'),_0x41d69f[_0x2f02('0xe')]),'method':_0x2f02('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x5da4e0['id'],'submitter_id':_0x26f012?_0x26f012['id']:undefined,'assignee_id':_0x26f012?_0x26f012['id']:undefined,'tags':getTags(_0x2cc412[_0x2f02('0x10')],_0x2f02('0x11')),'subject':intUtil[_0x2f02('0x12')](_0x2cc412[_0x2f02('0x13')],_0x1685f2,'\x20'),'description':intUtil[_0x2f02('0x12')](_0x2cc412['Descriptions'],_0x1685f2,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2f02('0x12')](_0x2cc412[_0x2f02('0x14')],_0x1685f2,'\x0a')}},getCustomFields(_0x2cc412[_0x2f02('0x15')],_0x1685f2))}})[_0x2f02('0x16')](function(_0x46c205){logger[_0x2f02('0xa')](_0x2f02('0x17'));return _0x46c205['ticket'];});}function getUser(_0x362ebf,_0x482fad){if(intUtil['validateEmail'](_0x482fad)){logger[_0x2f02('0xa')](_0x2f02('0x18'),_0x482fad);return request({'uri':util[_0x2f02('0xc')](_0x2f02('0x19'),_0x362ebf['remoteUri']),'qs':{'query':util[_0x2f02('0xc')](_0x2f02('0x1a'),_0x482fad)}})[_0x2f02('0x16')](function(_0x14b589){if(_0x14b589[_0x2f02('0x1b')]){logger[_0x2f02('0xa')](_0x2f02('0x1c'));return _[_0x2f02('0x1d')](_0x14b589[_0x2f02('0x1e')],{'email':_0x482fad,'role':'agent'});}else{logger[_0x2f02('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2f02('0xc')]('%s/users/me.json',_0x362ebf[_0x2f02('0xe')])})[_0x2f02('0x16')](function(_0x1b3788){logger[_0x2f02('0xa')](_0x2f02('0x1f'));return _0x1b3788[_0x2f02('0x20')];});}});}else{logger[_0x2f02('0xa')](_0x2f02('0x21'));return request({'uri':util[_0x2f02('0xc')](_0x2f02('0x22'),_0x362ebf[_0x2f02('0xe')])})[_0x2f02('0x16')](function(_0x5339fb){logger[_0x2f02('0xa')]('Admin\x20account\x20selected.');return _0x5339fb[_0x2f02('0x20')];});}}function getEndUser(_0x3884c8,_0x554455,_0x2a76c4){logger[_0x2f02('0xa')](_0x2f02('0x23'),_0x2a76c4);return request({'uri':util[_0x2f02('0xc')](_0x2f02('0x19'),_0x3884c8[_0x2f02('0xe')]),'qs':{'query':util[_0x2f02('0xc')](_0x2f02('0x24'),_0x2a76c4)}})[_0x2f02('0x16')](function(_0x2cd2c6){var _0x32176b;if(_0x2cd2c6[_0x2f02('0x1e')]['length']){_0x2cd2c6['results']=_[_0x2f02('0x25')](_0x2cd2c6['results'],{'suspended':![],'role':_0x2f02('0x26')});if(_0x2cd2c6[_0x2f02('0x1e')][_0x2f02('0x27')]){_0x32176b=_['first'](_0x2cd2c6['results']);}}if(_0x32176b){logger[_0x2f02('0xa')](_0x2f02('0x28'));return _0x32176b;}else{logger['info'](_0x2f02('0x29'));return request({'uri':util[_0x2f02('0xc')](_0x2f02('0x2a'),_0x3884c8[_0x2f02('0xe')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x2f02('0xc')](_0x2f02('0x2b'),_0x554455||_0x2a76c4),'phone':_0x2a76c4}}})[_0x2f02('0x16')](function(_0x5726ad){logger[_0x2f02('0xa')](_0x2f02('0x2c'));return _0x5726ad['user'];});}});}function getAuth(_0x49349a){var _0x1c842b;if(_0x49349a[_0x2f02('0x2d')]==='password'){_0x1c842b=util['format'](_0x2f02('0x2e'),_0x49349a[_0x2f02('0x2f')],_0x49349a[_0x2f02('0x30')]);}else if(_0x49349a[_0x2f02('0x2d')]===_0x2f02('0x31')){_0x1c842b=util[_0x2f02('0xc')]('%s/token:%s',_0x49349a[_0x2f02('0x2f')],_0x49349a[_0x2f02('0x31')]);}return util[_0x2f02('0xc')](_0x2f02('0x32'),new Buffer(_0x1c842b)[_0x2f02('0x33')](_0x2f02('0x34')));}function request(_0xe6896c){logger[_0x2f02('0x35')](_0x2f02('0x36'),JSON[_0x2f02('0x37')](_0xe6896c));return rp(_['defaults'](_0xe6896c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x545231,_0x28443d){var _0x5a10ec=[];if(_0x545231&&_0x545231['length']>0x0){_0x5a10ec=_['map'](_0x545231,_0x28443d);}return _0x5a10ec;}function getCustomFields(_0x5d6cc7,_0x568d7a){var _0x2abde3=[];var _0x3e12fd={'custom_fields':[]};if(_0x5d6cc7['length']>0x0){_['forEach'](_0x5d6cc7,function(_0x6f8383){if(_[_0x2f02('0x38')]([_0x2f02('0x39'),_0x2f02('0x3a')],_0x6f8383[_0x2f02('0x3b')])&&_0x6f8383[_0x2f02('0x3c')]&&!_0x6f8383[_0x2f02('0x3d')]){_0x3e12fd[_0x6f8383['nameField'][_0x2f02('0x3e')]()]=_0x6f8383['content'][_0x2f02('0x33')]();}else if(_[_0x2f02('0x38')](['string',_0x2f02('0x3a')],_0x6f8383[_0x2f02('0x3b')])&&_0x6f8383[_0x2f02('0x3f')]&&_0x6f8383[_0x2f02('0x3d')]){_0x3e12fd[_0x2f02('0x40')][_0x2f02('0x41')]({'id':_0x6f8383[_0x2f02('0x3f')],'value':_0x6f8383[_0x2f02('0x42')][_0x2f02('0x33')]()});}else if(_0x6f8383[_0x2f02('0x3b')]===_0x2f02('0x43')&&_0x6f8383[_0x2f02('0x44')]&&_0x6f8383[_0x2f02('0x3f')]&&_0x6f8383[_0x2f02('0x3d')]){_0x568d7a[_0x6f8383[_0x2f02('0x44')]]&&_0x3e12fd[_0x2f02('0x40')][_0x2f02('0x41')]({'id':_0x6f8383[_0x2f02('0x3f')],'value':_0x568d7a[_0x6f8383[_0x2f02('0x44')]][_0x2f02('0x33')]()});}else if(_0x6f8383['type']===_0x2f02('0x45')&&_0x6f8383[_0x2f02('0x46')]&&_0x6f8383['Variable'][_0x2f02('0x11')]&&_0x6f8383[_0x2f02('0x3f')]&&_0x6f8383['customField']){_0x568d7a[_0x6f8383['Variable'][_0x2f02('0x11')][_0x2f02('0x3e')]()]&&_0x3e12fd['custom_fields'][_0x2f02('0x41')]({'id':_0x6f8383[_0x2f02('0x3f')],'value':_0x568d7a[_0x6f8383[_0x2f02('0x46')][_0x2f02('0x11')][_0x2f02('0x3e')]()][_0x2f02('0x33')]()});}});}return _0x3e12fd;}exports[_0x2f02('0x47')]=function(_0x14f978,_0x28c78a,_0x12c8a6,_0x5db2ec,_0x58377b,_0x59e758){var _0x4888eb,_0x481771;_0x59e758[_0x2f02('0xe')]=intUtil['stripTrailingSlash'](_0x59e758[_0x2f02('0xe')]);_0x59e758[_0x2f02('0x48')]=intUtil[_0x2f02('0x49')](_0x59e758[_0x2f02('0x48')]);if(_0x58377b&&_0x58377b[_0x2f02('0x4a')]){logger[_0x2f02('0xa')](_0x2f02('0x4b'),_0x2f02('0x4c'));_0x28c78a[_0x2f02('0x4d')]=util[_0x2f02('0xc')](_0x2f02('0x4e'),_0x59e758['serverUrl'],_0x28c78a[_0x2f02('0x4f')],md5(_0x28c78a[_0x2f02('0x4f')]));}else{_0x28c78a[_0x2f02('0x4d')]='';}headers[_0x2f02('0x50')]=getAuth(_0x59e758);return getUser(_0x59e758,_0x5db2ec[_0x2f02('0x51')])['then'](function(_0xfe85db){_0x4888eb=_0xfe85db;logger[_0x2f02('0xa')](_0x2f02('0x52'),_0x4888eb['id']);return getEndUser(_0x59e758,_0x28c78a[_0x2f02('0x53')],_0x28c78a['calleridnum']);})['then'](function(_0x125954){_0x481771=_0x125954;logger[_0x2f02('0xa')](_0x2f02('0x54'),_0x481771['id']);return getTicket(_0x59e758,_0x4888eb,_0x481771,_0x12c8a6,_0x28c78a);})[_0x2f02('0x16')](function(_0x1b088b){if(_0x1b088b){logger[_0x2f02('0xa')](_0x2f02('0x55'),_0x1b088b['id']);switch(_0x59e758[_0x2f02('0x3b')]){case'integrationTab':logger[_0x2f02('0xa')](_0x2f02('0x4b'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2f02('0xc')](_0x2f02('0x56'),_0x59e758[_0x2f02('0xe')],_0x4888eb['id'],_0x1b088b['id']),'method':_0x2f02('0xf')});case _0x2f02('0x57'):logger[_0x2f02('0xa')](_0x2f02('0x4b'),_0x2f02('0x58'));emit(util['format']('user:%s',_0x5db2ec[_0x2f02('0x11')]),'trigger:browser:url',{'uri':util[_0x2f02('0xc')]('%s/agent/tickets/%s',_0x59e758[_0x2f02('0xe')][_0x2f02('0x59')](_0x2f02('0x5a'),''),_0x1b088b['id'])});break;default:logger[_0x2f02('0x5b')](_0x2f02('0x4b'),_0x2f02('0x5c'));}}})[_0x2f02('0x5d')](function(_0x326421){logger[_0x2f02('0x5b')](_0x2f02('0x5e'),util[_0x2f02('0x5f')](_0x326421,{'showHidden':!![],'depth':null}));});};exports[_0x2f02('0x60')]=function(_0x22cce0,_0x1fe02f,_0x59cc1a,_0x53b44f,_0x20d109,_0x39b07b,_0x134c99){var _0x2845d9,_0x2391ac;_0x39b07b[_0x2f02('0xe')]=intUtil[_0x2f02('0x49')](_0x39b07b[_0x2f02('0xe')]);_0x39b07b[_0x2f02('0x48')]=intUtil[_0x2f02('0x49')](_0x39b07b['serverUrl']);if(_0x134c99&&_0x134c99['recordingFormat']&&_0x134c99[_0x2f02('0x61')]!=='none'){logger[_0x2f02('0xa')](_0x2f02('0x62'),_0x2f02('0x4c'));_0x1fe02f[_0x2f02('0x4d')]=util[_0x2f02('0xc')](_0x2f02('0x4e'),_0x39b07b[_0x2f02('0x48')],_0x1fe02f[_0x2f02('0x4f')],md5(_0x1fe02f[_0x2f02('0x4f')]));}headers[_0x2f02('0x50')]=getAuth(_0x39b07b);return getUser(_0x39b07b,_0x53b44f[_0x2f02('0x51')])['then'](function(_0x5f06d6){_0x2845d9=_0x5f06d6;logger[_0x2f02('0xa')](_0x2f02('0x52'),_0x2845d9['id']);return getEndUser(_0x39b07b,_0x1fe02f[_0x2f02('0x63')],_0x1fe02f[_0x2f02('0x64')]);})[_0x2f02('0x16')](function(_0x564290){_0x2391ac=_0x564290;logger[_0x2f02('0xa')](_0x2f02('0x54'),_0x2391ac['id']);return getTicket(_0x39b07b,_0x2845d9,_0x2391ac,_0x59cc1a,_0x1fe02f);})[_0x2f02('0x16')](function(_0x4d8024){if(_0x4d8024){logger[_0x2f02('0xa')](_0x2f02('0x55'),_0x4d8024['id']);switch(_0x39b07b[_0x2f02('0x3b')]){case _0x2f02('0x65'):logger[_0x2f02('0xa')](_0x2f02('0x62'),_0x2f02('0x66'));return request({'uri':util[_0x2f02('0xc')](_0x2f02('0x56'),_0x39b07b['remoteUri'],_0x2845d9['id'],_0x4d8024['id']),'method':_0x2f02('0xf')});case _0x2f02('0x57'):logger[_0x2f02('0xa')](_0x2f02('0x62'),_0x2f02('0x58'));emit(util['format'](_0x2f02('0x67'),_0x53b44f[_0x2f02('0x11')]),_0x2f02('0x68'),{'uri':util[_0x2f02('0xc')](_0x2f02('0x69'),_0x39b07b[_0x2f02('0xe')][_0x2f02('0x59')]('/api/v2',''),_0x4d8024['id'])});break;default:logger[_0x2f02('0x5b')](_0x2f02('0x62'),_0x2f02('0x5c'));}}})[_0x2f02('0x5d')](function(_0x4d5985){logger[_0x2f02('0x5b')](_0x2f02('0x6a'),util[_0x2f02('0x5f')](_0x4d5985,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x56c010,_0x24b918,_0x3c52e1,_0x1a3a22,_0x453428,_0x36f89d){var _0x25416b,_0x4da12c;_0x36f89d[_0x2f02('0xe')]=intUtil[_0x2f02('0x49')](_0x36f89d[_0x2f02('0xe')]);_0x36f89d[_0x2f02('0x48')]=intUtil[_0x2f02('0x49')](_0x36f89d[_0x2f02('0x48')]);if(_0x453428&&_0x453428[_0x2f02('0x4a')]){logger[_0x2f02('0xa')]('['+_0x24b918[_0x2f02('0x6b')][_0x2f02('0x6c')]()+']',_0x2f02('0x4c'));_0x24b918['recordingURL']=util[_0x2f02('0xc')](_0x2f02('0x4e'),_0x36f89d[_0x2f02('0x48')],_0x24b918[_0x2f02('0x4f')],md5(_0x24b918['uniqueid']));}else{_0x24b918[_0x2f02('0x4d')]='';}headers[_0x2f02('0x50')]=getAuth(_0x36f89d);return getUser(_0x36f89d)[_0x2f02('0x16')](function(_0x5aa522){_0x25416b=_0x5aa522;logger['info'](_0x2f02('0x52'),_0x25416b['id']);return getEndUser(_0x36f89d,_0x24b918['calleridname'],_0x24b918[_0x2f02('0x6d')]);})[_0x2f02('0x16')](function(_0x1e9444){_0x4da12c=_0x1e9444;logger[_0x2f02('0xa')](_0x2f02('0x54'),_0x4da12c['id']);return getTicket(_0x36f89d,_0x25416b,_0x4da12c,_0x3c52e1,_0x24b918);})[_0x2f02('0x16')](function(_0x18a55e){if(_0x18a55e){logger[_0x2f02('0xa')](_0x2f02('0x55'),_0x18a55e['id']);}})[_0x2f02('0x5d')](function(_0x241457){logger[_0x2f02('0x5b')]('['+_0x24b918[_0x2f02('0x6b')]['toUpperCase']()+']'+_0x2f02('0x6e'),util[_0x2f02('0x5f')](_0x241457,{'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 7c23830..3413e39 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 _0x9960=['redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','variable','variableName','toString','Variable','name','toLowerCase','indexOf','isNil','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','then','access_token','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','talktime','mm:ss','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','abandoned','timeout','Timeout','starttime','agentcalledAt','Inbound','merge','POST','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','destcalleridnum','Outbound','[OUTBOUND]','https://crm.','unmanaged','toUpperCase','The\x20Call\x20ID\x20is:','lodash','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho'];(function(_0x5007a9,_0x23a51a){var _0x3fd21d=function(_0x58cf68){while(--_0x58cf68){_0x5007a9['push'](_0x5007a9['shift']());}};_0x3fd21d(++_0x23a51a);}(_0x9960,0x8e));var _0x0996=function(_0x1e5067,_0x1c47d6){_0x1e5067=_0x1e5067-0x0;var _0x315b32=_0x9960[_0x1e5067];return _0x315b32;};'use strict';var _=require(_0x0996('0x0'));var rp=require('request-promise');var md5=require(_0x0996('0x1'));var util=require(_0x0996('0x2'));var intUtil=require(_0x0996('0x3'));var moment=require(_0x0996('0x4'));var Redis=require(_0x0996('0x5'));var BPromise=require('bluebird');var config=require(_0x0996('0x6'));var logger=require(_0x0996('0x7'))(_0x0996('0x8'));config[_0x0996('0x9')]=_[_0x0996('0xa')](config[_0x0996('0x9')],{'host':_0x0996('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0996('0x9')]));function emit(_0xe3fbf1,_0x13b142,_0x347e72){io['to'](_0xe3fbf1)[_0x0996('0xc')](_0x13b142,_0x347e72);}function request(_0x19b8b3){logger[_0x0996('0xd')](_0x0996('0xe'),JSON[_0x0996('0xf')](_0x19b8b3));return rp(_0x19b8b3);}function getCustomFields(_0x443b48,_0x7e4549){var _0x6e04e8={};if(_0x443b48[_0x0996('0x10')]>0x0){_[_0x0996('0x11')](_0x443b48,function(_0x415d75){if(_[_0x0996('0x12')]([_0x0996('0x13'),_0x0996('0x14')],_0x415d75[_0x0996('0x15')])&&_0x415d75[_0x0996('0x16')]){_0x6e04e8[_0x415d75[_0x0996('0x16')]]=_0x415d75['content']['toString']();}else if(_0x415d75[_0x0996('0x15')]===_0x0996('0x17')&&_0x415d75[_0x0996('0x18')]&&_0x415d75[_0x0996('0x16')]&&_0x7e4549[_0x415d75[_0x0996('0x18')]]){_0x6e04e8[_0x415d75[_0x0996('0x16')]]=_0x7e4549[_0x415d75['variableName']][_0x0996('0x19')]();}else if(_0x415d75[_0x0996('0x15')]==='customVariable'&&_0x415d75['Variable']&&_0x415d75[_0x0996('0x1a')][_0x0996('0x1b')]&&_0x415d75['idField']&&_0x7e4549[_0x415d75[_0x0996('0x1a')][_0x0996('0x1b')][_0x0996('0x1c')]()]){_0x6e04e8[_0x415d75[_0x0996('0x16')]]=_0x7e4549[_0x415d75[_0x0996('0x1a')][_0x0996('0x1b')][_0x0996('0x1c')]()]['toString']();}});}return _0x6e04e8;}function getName(_0x35c711){if(_0x35c711[_0x0996('0x1d')]('\x20')>0x0){var _0x499c99=_0x35c711['split'](/ (.+)/);if(_0x499c99[0x1]){return _0x499c99;}}return[_0x35c711,_0x35c711];}var accountsTokens={};function getAccessToken(_0x392056){return new Promise(function(_0x1b09df,_0x241357){if(!_[_0x0996('0x1e')](accountsTokens[_0x392056['id']])&&!_[_0x0996('0x1e')](accountsTokens[_0x392056['id']]['access_token'])){if(moment()[_0x0996('0x1f')](accountsTokens[_0x392056['id']][_0x0996('0x20')])){_0x1b09df(accountsTokens[_0x392056['id']]['access_token']);}}var _0x495203;switch(_0x392056[_0x0996('0x21')]){case'US':_0x495203=_0x0996('0x22');break;case'AU':_0x495203=_0x0996('0x23');break;case'EU':_0x495203='https://accounts.zoho.eu';break;case'IN':_0x495203='https://accounts.zoho.in';break;case'CN':_0x495203=_0x0996('0x24');break;default:_0x495203='https://accounts.zoho.eu';break;}var _0x2fd39a={'method':'POST','uri':_0x495203+_0x0996('0x25'),'qs':{'refresh_token':_0x392056['refreshToken'],'client_id':_0x392056[_0x0996('0x26')],'client_secret':_0x392056[_0x0996('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x2fd39a)[_0x0996('0x28')](function(_0x2535fa){accountsTokens[_0x392056['id']]={'access_token':_0x2535fa[_0x0996('0x29')],'expires_in':moment()['add'](_0x2535fa[_0x0996('0x20')],_0x0996('0x2a'))};_0x1b09df(_0x2535fa[_0x0996('0x29')]);})[_0x0996('0x2b')](function(_0x2f6dd2){logger[_0x0996('0x2c')](_0x0996('0x2d'),_0x2f6dd2[_0x0996('0x2e')]);_0x241357(_0x2f6dd2);});});}function getUser(_0x5c1402,_0x1593e9,_0xc60312,_0x3f8531){logger[_0x0996('0x2f')](_0x0996('0x30'));return request({'method':_0x0996('0x31'),'uri':util[_0x0996('0x32')](_0x0996('0x33'),_0x1593e9),'qs':{'type':_0x0996('0x34')},'headers':{'Authorization':_0x0996('0x35')+_0x5c1402},'json':!![]})['then'](function(_0x3ccf3c){if(_0x3ccf3c[_0x0996('0x36')]){var _0x1ca48a=-0x1;if(_[_0x0996('0x37')](_0x3ccf3c[_0x0996('0x36')])){if(!_[_0x0996('0x1e')](_0x3f8531)){_0x1ca48a=_[_0x0996('0x38')](_0x3ccf3c['users'],function(_0x6baf92){return _0x6baf92[_0x0996('0x39')]===_0x3f8531;});}if(_0x1ca48a>=0x0){logger[_0x0996('0x2f')]('Agent\x20found!');}else{logger[_0x0996('0x2f')](_0x0996('0x3a'));_0x1ca48a=_[_0x0996('0x38')](_0x3ccf3c[_0x0996('0x36')],function(_0x46649d){return _0x46649d[_0x0996('0x3b')][_0x0996('0x1b')]===_0x0996('0x3c');});}return _0x3ccf3c[_0x0996('0x36')][_0x1ca48a];}else{if(_0x3ccf3c[_0x0996('0x3d')][_0x0996('0x3b')][_0x0996('0x1b')]===_0x0996('0x3c')){logger[_0x0996('0x2f')]('Using\x20the\x20admin\x20account!');user=_0x3ccf3c[_0x0996('0x3d')];return user;}else{logger[_0x0996('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x0996('0xf')](_0x3ccf3c));throw new Error(_0x0996('0x3e')+JSON[_0x0996('0xf')](_0x3ccf3c));}}}else{logger[_0x0996('0x2c')](_0x0996('0x3f'),JSON[_0x0996('0xf')](_0x3ccf3c));throw new Error(_0x0996('0x3e')+JSON['stringify'](_0x3ccf3c));}})['catch'](function(_0x3ac8fb){console[_0x0996('0x2c')](_0x3ac8fb);});}function getZohoUser(_0x52887c,_0x1c7304){return new BPromise(function(_0x2efb4d,_0x273595){request(_0x52887c)[_0x0996('0x28')](function(_0x18c82e){var _0x3933a3=null;if(_0x18c82e){_0x3933a3=_0x18c82e[_0x0996('0x40')][0x0];_0x3933a3[_0x0996('0x41')]=_0x1c7304;}_0x2efb4d(_0x3933a3);})[_0x0996('0x2b')](function(_0x571bba){_0x273595(_0x571bba);});});}function createEndUser(_0x48441f,_0x270fcd,_0x388485,_0x51bc13,_0x3830b2,_0x2465f3){var _0x388485=getName(_0x388485);return request({'method':'POST','uri':_0x0996('0x42')+_0x270fcd+_0x0996('0x43')+_[_0x0996('0x44')](_0x2465f3[_0x0996('0x45')])+'s','body':{'data':[{'Last_Name':_0x388485[0x1],'First_Name':_0x388485[0x0],'Phone':_0x51bc13,'Owner':{'name':!_[_0x0996('0x1e')](_0x3830b2[_0x0996('0x46')][_0x0996('0x1b')])?_0x3830b2['role'][_0x0996('0x1b')]:!_[_0x0996('0x1e')](_0x3830b2[_0x0996('0x47')])?_0x3830b2[_0x0996('0x47')]+'\x20'+_0x3830b2[_0x0996('0x48')]:_0x3830b2[_0x0996('0x48')],'id':_0x3830b2['id']}}]},'headers':{'Authorization':_0x0996('0x35')+_0x48441f},'json':!![]})['then'](function(_0xd8865e){if(_0xd8865e&&_0xd8865e[_0x0996('0x40')][0x0][_0x0996('0x49')]===_0x0996('0x4a')){var _0x5152a9=_0xd8865e[_0x0996('0x40')][0x0][_0x0996('0x4b')];_0x5152a9['enduserType']=_[_0x0996('0x44')](_0x2465f3['moduleCreate'])+'s';return _0x5152a9;}logger[_0x0996('0x2c')](_0x0996('0x3f'),JSON[_0x0996('0xf')](data));throw new Error(_0x0996('0x4c')+JSON[_0x0996('0xf')](data));})[_0x0996('0x2b')](function(_0x15cc6d){console[_0x0996('0x4d')]('CREATE\x20ERROR',_0x15cc6d);});}function getEndUser(_0x1c301d,_0xa38342,_0x378da9,_0x208430,_0x44f0f7,_0x3223bd,_0x551b9c){var _0x5d4e6d={'method':'GET','uri':'','headers':{'Authorization':_0x0996('0x35')+_0x1c301d},'json':!![]};switch(_0x551b9c[_0x0996('0x4e')]){case _0x0996('0x4f'):_0x5d4e6d[_0x0996('0x50')]=_0x0996('0x42')+_0xa38342+_0x0996('0x51')+_0x44f0f7+'))';return getZohoUser(_0x5d4e6d,'Contacts')['then'](function(_0x2fbf0a){if(_0x2fbf0a)return _0x2fbf0a;_0x5d4e6d[_0x0996('0x50')]='https://www.zohoapis.'+_0xa38342+_0x0996('0x52')+_0x44f0f7+'))';return getZohoUser(_0x5d4e6d,_0x0996('0x53'))['then'](function(_0x21f100){if(_0x21f100)return _0x21f100;if(_0x551b9c[_0x0996('0x45')]!=_0x0996('0x54')){return createEndUser(_0x1c301d,_0xa38342,_0x208430,_0x44f0f7,_0x3223bd,_0x551b9c);}else{return{};}});});break;case _0x0996('0x55'):_0x5d4e6d[_0x0996('0x50')]=_0x0996('0x42')+_0xa38342+_0x0996('0x51')+_0x44f0f7+'))';return getZohoUser(_0x5d4e6d,_0x0996('0x56'))['then'](function(_0x162ede){if(_0x162ede)return _0x162ede;if(_0x551b9c['moduleCreate']!=_0x0996('0x54')){return createEndUser(_0x1c301d,_0xa38342,_0x208430,_0x44f0f7,_0x3223bd,_0x551b9c);}else{return{};}});break;case _0x0996('0x57'):_0x5d4e6d[_0x0996('0x50')]=_0x0996('0x42')+_0xa38342+_0x0996('0x52')+_0x44f0f7+'))';return getZohoUser(_0x5d4e6d,_0x0996('0x53'))[_0x0996('0x28')](function(_0x3d577a){if(_0x3d577a)return _0x3d577a;if(_0x551b9c[_0x0996('0x45')]!=_0x0996('0x54')){return createEndUser(_0x1c301d,_0xa38342,_0x208430,_0x44f0f7,_0x3223bd,_0x551b9c);}else{return{};}});break;}}function getCall(_0x130c78,_0x106e54,_0x485296,_0x3759cc,_0x526194,_0x5e264f,_0x4e5006,_0x439d7d){logger['info'](_0x0996('0x58'));var _0x12baa1={};_0x12baa1[_0x0996('0x59')]={'name':!_['isNil'](_0x3759cc[_0x0996('0x46')][_0x0996('0x1b')])&&!_[_0x0996('0x1e')](_0x3759cc[_0x0996('0x3b')]['name'])&&_0x3759cc[_0x0996('0x3b')]['name']===_0x0996('0x5a')?_0x3759cc[_0x0996('0x46')][_0x0996('0x1b')]:!_['isNil'](_0x3759cc['first_name'])?_0x3759cc[_0x0996('0x47')]+'\x20'+_0x3759cc[_0x0996('0x48')]:_0x3759cc[_0x0996('0x48')],'id':_0x3759cc['id']};_0x12baa1[_0x0996('0x5b')]=intUtil['getString'](_0x5e264f[_0x0996('0x5c')],_0x4e5006,'\x20');_0x12baa1[_0x0996('0x5d')]=intUtil['getString'](_0x5e264f[_0x0996('0x5e')],_0x4e5006,'\x0a');if(_0x526194[_0x0996('0x41')]==='Contacts'){_0x12baa1['Who_Id']={'name':!_[_0x0996('0x1e')](_0x526194[_0x0996('0x5f')])?_0x526194[_0x0996('0x5f')]:!_[_0x0996('0x1e')](_0x526194[_0x0996('0x60')])?_0x526194[_0x0996('0x60')]+'\x20'+_0x526194[_0x0996('0x61')]:_0x526194['Last_Name'],'id':_0x526194['id']};}if(_0x526194['enduserType']===_0x0996('0x53')){_0x12baa1[_0x0996('0x62')]={'name':!_[_0x0996('0x1e')](_0x526194[_0x0996('0x5f')])?_0x526194['Full_Name']:!_['isNil'](_0x526194[_0x0996('0x60')])?_0x526194[_0x0996('0x60')]+'\x20'+_0x526194['Last_Name']:_0x526194[_0x0996('0x61')],'id':_0x526194['id']};_0x12baa1['$se_module']=_[_0x0996('0x44')](_0x526194['enduserType']);}if(_0x4e5006['talktime']){_0x12baa1['Call_Duration']=moment['utc'](parseInt(_0x4e5006[_0x0996('0x63')])*0x3e8)[_0x0996('0x32')](_0x0996('0x64'));}else if(_0x4e5006['answertime']&&_0x4e5006[_0x0996('0x65')]){_0x12baa1['Call_Duration']=moment[_0x0996('0x66')](moment(_0x4e5006['endtime'],_0x0996('0x67'))[_0x0996('0x68')](moment(_0x4e5006['starttime'],_0x0996('0x67'))))['format'](_0x0996('0x64'));}switch(_0x4e5006[_0x0996('0x69')]){case _0x0996('0x6a'):_0x12baa1[_0x0996('0x6b')]=_0x0996('0x6c');break;case _0x0996('0x6d'):case _0x0996('0x6e'):_0x12baa1['Call_Result']=_0x0996('0x6f');break;case _0x0996('0x70'):_0x12baa1[_0x0996('0x6b')]='Rejected';break;case _0x0996('0x71'):_0x12baa1[_0x0996('0x6b')]='Abandoned';break;case _0x0996('0x72'):_0x12baa1['Call_Result']=_0x0996('0x73');default:}_0x12baa1['Call_Start_Time']=(_0x439d7d==='outbound'?moment(_0x4e5006[_0x0996('0x74')])['format'](_0x0996('0x67')):moment(_0x4e5006[_0x0996('0x75')])[_0x0996('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x0996('0x32')](_0x0996('0x67'));_0x12baa1['Call_Type']=_0x439d7d||_0x0996('0x76');_0x12baa1=_[_0x0996('0x77')](_0x12baa1,getCustomFields(_0x5e264f['Fields'],_0x4e5006));return request({'method':_0x0996('0x78'),'uri':_0x0996('0x42')+_0x106e54+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x130c78},'body':{'data':[_0x12baa1]},'json':!![]})[_0x0996('0x28')](function(_0x17846a){if(_0x17846a&&_0x17846a[_0x0996('0x40')][0x0][_0x0996('0x49')]==='SUCCESS'){logger[_0x0996('0x2f')]('Call\x20created!');return{'id':_0x17846a[_0x0996('0x40')][0x0][_0x0996('0x4b')]['id']};}})['catch'](function(_0x55d8f6){logger['info'](_0x0996('0x79'),_0x55d8f6[_0x0996('0x2e')]);console['log']('err',_0x55d8f6);});}exports[_0x0996('0x7a')]=function(_0x50ac04,_0x5bed65,_0x2594b4,_0x28c434,_0x52d832,_0x4fc7fd){var _0x132b60,_0x560d4e,_0x231a9a;_0x4fc7fd[_0x0996('0x7b')]=intUtil['stripTrailingSlash'](_0x4fc7fd['host']);_0x4fc7fd[_0x0996('0x7c')]=intUtil[_0x0996('0x7d')](_0x4fc7fd['serverUrl']);if(_0x52d832&&_0x52d832[_0x0996('0x7e')]){logger[_0x0996('0x2f')](_0x0996('0x7f'),_0x0996('0x80'));_0x5bed65[_0x0996('0x81')]=_0x4fc7fd[_0x0996('0x7c')]+_0x0996('0x82')+_0x5bed65[_0x0996('0x83')]+_0x0996('0x84')+md5(_0x5bed65[_0x0996('0x83')]);}else{_0x5bed65[_0x0996('0x81')]='';}var _0x29bbbd=_0x4fc7fd[_0x0996('0x7b')]===_0x0996('0x85')?'eu':_0x0996('0x86');return getAccessToken(_0x4fc7fd)[_0x0996('0x28')](function(_0x50e1b7){_0x231a9a=_0x50e1b7;return getUser(_0x231a9a,_0x29bbbd,_0x4fc7fd,_0x28c434[_0x0996('0x39')]);})[_0x0996('0x28')](function(_0x223405){_0x132b60=_0x223405;logger[_0x0996('0x2f')](_0x0996('0x87'),_0x132b60['id']);return getEndUser(_0x231a9a,_0x29bbbd,_0x4fc7fd,_0x5bed65[_0x0996('0x88')],_0x5bed65[_0x0996('0x89')],_0x132b60,_0x2594b4);})[_0x0996('0x28')](function(_0x362fb5){_0x560d4e=_0x362fb5;return getCall(_0x231a9a,_0x29bbbd,_0x4fc7fd,_0x132b60,_0x560d4e,_0x2594b4,_0x5bed65,_0x0996('0x76'));})[_0x0996('0x28')](function(_0x533444){if(_0x533444){logger[_0x0996('0x2f')]('The\x20Call\x20ID\x20is:',_0x533444['id']);logger[_0x0996('0x2f')]('[QUEUE]',_0x0996('0x8a'));emit(util[_0x0996('0x32')]('user:%s',_0x28c434['name']),_0x0996('0x8b'),{'uri':'https://crm.'+_0x4fc7fd[_0x0996('0x7b')]+_0x0996('0x8c')+_0x533444['id']});}})['catch'](function(_0x14fce0){logger[_0x0996('0x2c')](_0x0996('0x7f'),JSON[_0x0996('0xf')](_0x14fce0));});};exports[_0x0996('0x8d')]=function(_0x401346,_0x20116c,_0x177d37,_0x17e05a,_0x3e38fc,_0x3fd228,_0x22ca10){var _0xcd962,_0x105b29,_0x46bf75;_0x3fd228[_0x0996('0x7b')]=intUtil['stripTrailingSlash'](_0x3fd228[_0x0996('0x7b')]);_0x3fd228['serverUrl']=intUtil[_0x0996('0x7d')](_0x3fd228['serverUrl']);if(_0x22ca10&&_0x22ca10[_0x0996('0x8e')]&&_0x22ca10[_0x0996('0x8e')]!==_0x0996('0x8f')){logger[_0x0996('0x2f')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x20116c[_0x0996('0x81')]=_0x3fd228[_0x0996('0x7c')]+_0x0996('0x82')+_0x20116c['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x20116c['uniqueid']);}var _0x52f327=_0x3fd228[_0x0996('0x7b')]===_0x0996('0x85')?'eu':_0x0996('0x86');return getAccessToken(_0x3fd228)[_0x0996('0x28')](function(_0x5076d8){_0x46bf75=_0x5076d8;return getUser(_0x46bf75,_0x52f327,_0x3fd228,_0x17e05a[_0x0996('0x39')]);})['then'](function(_0x34a60b){_0xcd962=_0x34a60b;logger['info'](_0x0996('0x87'),_0xcd962['id']);return getEndUser(_0x46bf75,_0x52f327,_0x3fd228,_0x20116c['destcalleridname'],_0x20116c[_0x0996('0x90')],_0xcd962,_0x177d37);})[_0x0996('0x28')](function(_0x419338){_0x105b29=_0x419338;return getCall(_0x46bf75,_0x52f327,_0x3fd228,_0xcd962,_0x105b29,_0x177d37,_0x20116c,_0x0996('0x91'));})[_0x0996('0x28')](function(_0x2e4733){if(_0x2e4733){logger[_0x0996('0x2f')]('The\x20Call\x20ID\x20is:',_0x2e4733['id']);logger[_0x0996('0x2f')](_0x0996('0x92'),_0x0996('0x8a'));emit(util['format']('user:%s',_0x17e05a[_0x0996('0x1b')]),'trigger:browser:url',{'uri':_0x0996('0x93')+_0x3fd228[_0x0996('0x7b')]+_0x0996('0x8c')+_0x2e4733['id']});}})[_0x0996('0x2b')](function(_0x2e10e5){logger[_0x0996('0x2c')](_0x0996('0x92'),JSON[_0x0996('0xf')](_0x2e10e5));});};exports[_0x0996('0x94')]=function(_0x4d47ac,_0x45b09a,_0x7638e8,_0xa7fb7a,_0x11091a,_0x4ec091){var _0x14b67f,_0x5150e5,_0x48bf01;_0x4ec091['host']=intUtil['stripTrailingSlash'](_0x4ec091[_0x0996('0x7b')]);_0x4ec091[_0x0996('0x7c')]=intUtil[_0x0996('0x7d')](_0x4ec091['serverUrl']);if(_0x11091a&&_0x11091a[_0x0996('0x7e')]){logger['info']('['+_0x45b09a[_0x0996('0x69')][_0x0996('0x95')]()+']',_0x0996('0x80'));_0x45b09a['recordingURL']=_0x4ec091['serverUrl']+_0x0996('0x82')+_0x45b09a[_0x0996('0x83')]+_0x0996('0x84')+md5(_0x45b09a['uniqueid']);}else{_0x45b09a['recordingURL']='';}var _0x52cfc0=_0x4ec091[_0x0996('0x7b')]===_0x0996('0x85')?'eu':_0x0996('0x86');return getAccessToken(_0x4ec091)['then'](function(_0x53f4c5){_0x48bf01=_0x53f4c5;return getUser(_0x48bf01,_0x52cfc0,_0x4ec091);})[_0x0996('0x28')](function(_0x89d7e6){_0x14b67f=_0x89d7e6;logger[_0x0996('0x2f')](_0x0996('0x87'),_0x14b67f['id']);return getEndUser(_0x48bf01,_0x52cfc0,_0x4ec091,_0x45b09a['calleridname'],_0x45b09a[_0x0996('0x89')],_0x14b67f,_0x7638e8);})[_0x0996('0x28')](function(_0x4e3dbd){_0x5150e5=_0x4e3dbd;return getCall(_0x48bf01,_0x52cfc0,_0x4ec091,_0x14b67f,_0x5150e5,_0x7638e8,_0x45b09a,'Inbound');})['then'](function(_0x303755){if(_0x303755){logger[_0x0996('0x2f')](_0x0996('0x96'),_0x303755['id']);}})[_0x0996('0x2b')](function(_0x567515){logger[_0x0996('0x2c')]('['+_0x45b09a[_0x0996('0x69')][_0x0996('0x95')]()+']',JSON[_0x0996('0xf')](_0x567515));});}; \ No newline at end of file +var _0x996b=['./util','moment','ioredis','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','isArrayLikeObject','users','email','Agent\x20found!','findIndex','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','data','code','details','enduserType','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','Contacts','lead','Leads','nothing','Creating\x20new\x20call...','Owner','Subject','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','talktime','utc','answertime','endtime','Call_Duration','diff','YYYY-MM-DDTHH:mm:ss','mm:ss','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','starttime','Call_Type','Inbound','merge','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridnum','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','lodash','request-promise','md5','util'];(function(_0x1a051f,_0x2095a9){var _0x4f6c78=function(_0x56ef64){while(--_0x56ef64){_0x1a051f['push'](_0x1a051f['shift']());}};_0x4f6c78(++_0x2095a9);}(_0x996b,0x9b));var _0xb996=function(_0x26012d,_0x426e87){_0x26012d=_0x26012d-0x0;var _0x3bd87a=_0x996b[_0x26012d];return _0x3bd87a;};'use strict';var _=require(_0xb996('0x0'));var rp=require(_0xb996('0x1'));var md5=require(_0xb996('0x2'));var util=require(_0xb996('0x3'));var intUtil=require(_0xb996('0x4'));var moment=require(_0xb996('0x5'));var Redis=require(_0xb996('0x6'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require(_0xb996('0x7'))(_0xb996('0x8'));config[_0xb996('0x9')]=_[_0xb996('0xa')](config[_0xb996('0x9')],{'host':_0xb996('0xb'),'port':0x18eb});var io=require(_0xb996('0xc'))(new Redis(config['redis']));function emit(_0x67adb1,_0x3c7bbe,_0x1ec3a2){io['to'](_0x67adb1)['emit'](_0x3c7bbe,_0x1ec3a2);}function request(_0x562623){logger[_0xb996('0xd')](_0xb996('0xe'),JSON[_0xb996('0xf')](_0x562623));return rp(_0x562623);}function getCustomFields(_0x5897a0,_0x50ca27){var _0xbe0b85={};if(_0x5897a0[_0xb996('0x10')]>0x0){_[_0xb996('0x11')](_0x5897a0,function(_0x4d547e){if(_['includes'](['string',_0xb996('0x12')],_0x4d547e[_0xb996('0x13')])&&_0x4d547e[_0xb996('0x14')]){_0xbe0b85[_0x4d547e[_0xb996('0x14')]]=_0x4d547e[_0xb996('0x15')][_0xb996('0x16')]();}else if(_0x4d547e[_0xb996('0x13')]===_0xb996('0x17')&&_0x4d547e[_0xb996('0x18')]&&_0x4d547e[_0xb996('0x14')]&&_0x50ca27[_0x4d547e[_0xb996('0x18')]]){_0xbe0b85[_0x4d547e[_0xb996('0x14')]]=_0x50ca27[_0x4d547e[_0xb996('0x18')]]['toString']();}else if(_0x4d547e[_0xb996('0x13')]===_0xb996('0x19')&&_0x4d547e[_0xb996('0x1a')]&&_0x4d547e[_0xb996('0x1a')][_0xb996('0x1b')]&&_0x4d547e[_0xb996('0x14')]&&_0x50ca27[_0x4d547e['Variable'][_0xb996('0x1b')][_0xb996('0x1c')]()]){_0xbe0b85[_0x4d547e[_0xb996('0x14')]]=_0x50ca27[_0x4d547e['Variable'][_0xb996('0x1b')]['toLowerCase']()][_0xb996('0x16')]();}});}return _0xbe0b85;}function getName(_0x38e928){if(_0x38e928[_0xb996('0x1d')]('\x20')>0x0){var _0x23412b=_0x38e928[_0xb996('0x1e')](/ (.+)/);if(_0x23412b[0x1]){return _0x23412b;}}return[_0x38e928,_0x38e928];}var accountsTokens={};function getAccessToken(_0x711eb8){return new Promise(function(_0x938cf7,_0xdfca28){if(!_[_0xb996('0x1f')](accountsTokens[_0x711eb8['id']])&&!_['isNil'](accountsTokens[_0x711eb8['id']][_0xb996('0x20')])){if(moment()[_0xb996('0x21')](accountsTokens[_0x711eb8['id']][_0xb996('0x22')])){_0x938cf7(accountsTokens[_0x711eb8['id']][_0xb996('0x20')]);}}var _0x2d1c1a;switch(_0x711eb8[_0xb996('0x23')]){case'US':_0x2d1c1a=_0xb996('0x24');break;case'AU':_0x2d1c1a='https://accounts.zoho.com.au';break;case'EU':_0x2d1c1a=_0xb996('0x25');break;case'IN':_0x2d1c1a=_0xb996('0x26');break;case'CN':_0x2d1c1a=_0xb996('0x27');break;default:_0x2d1c1a=_0xb996('0x25');break;}var _0x320b17={'method':_0xb996('0x28'),'uri':_0x2d1c1a+_0xb996('0x29'),'qs':{'refresh_token':_0x711eb8[_0xb996('0x2a')],'client_id':_0x711eb8[_0xb996('0x2b')],'client_secret':_0x711eb8[_0xb996('0x2c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x320b17)[_0xb996('0x2d')](function(_0x53c3e0){accountsTokens[_0x711eb8['id']]={'access_token':_0x53c3e0[_0xb996('0x20')],'expires_in':moment()[_0xb996('0x2e')](_0x53c3e0['expires_in'],_0xb996('0x2f'))};_0x938cf7(_0x53c3e0['access_token']);})[_0xb996('0x30')](function(_0x4c7807){logger[_0xb996('0x31')](_0xb996('0x32'),_0x4c7807[_0xb996('0x33')]);_0xdfca28(_0x4c7807);});});}function getUser(_0x361eba,_0x37f75c,_0x421d82,_0x273de7){logger[_0xb996('0x34')]('Search\x20user');return request({'method':_0xb996('0x35'),'uri':util[_0xb996('0x36')](_0xb996('0x37'),_0x37f75c),'qs':{'type':_0xb996('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x361eba},'json':!![]})['then'](function(_0x510d06){if(_0x510d06['users']){var _0x233849=-0x1;if(_[_0xb996('0x39')](_0x510d06[_0xb996('0x3a')])){if(!_[_0xb996('0x1f')](_0x273de7)){_0x233849=_['findIndex'](_0x510d06['users'],function(_0x150687){return _0x150687[_0xb996('0x3b')]===_0x273de7;});}if(_0x233849>=0x0){logger[_0xb996('0x34')](_0xb996('0x3c'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x233849=_[_0xb996('0x3d')](_0x510d06[_0xb996('0x3a')],function(_0x513391){return _0x513391[_0xb996('0x3e')]['name']===_0xb996('0x3f');});}return _0x510d06[_0xb996('0x3a')][_0x233849];}else{if(_0x510d06[_0xb996('0x40')][_0xb996('0x3e')]['name']===_0xb996('0x3f')){logger[_0xb996('0x34')](_0xb996('0x41'));user=_0x510d06[_0xb996('0x40')];return user;}else{logger['error'](_0xb996('0x42'),JSON[_0xb996('0xf')](_0x510d06));throw new Error(_0xb996('0x43')+JSON[_0xb996('0xf')](_0x510d06));}}}else{logger[_0xb996('0x31')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x510d06));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xb996('0xf')](_0x510d06));}})['catch'](function(_0x184c48){console['error'](_0x184c48);});}function getZohoUser(_0x4c14e6,_0x139ab6){return new BPromise(function(_0x53693c,_0xa07f22){request(_0x4c14e6)['then'](function(_0x5a5030){var _0x1fda06=null;if(_0x5a5030){_0x1fda06=_0x5a5030['data'][0x0];_0x1fda06['enduserType']=_0x139ab6;}_0x53693c(_0x1fda06);})[_0xb996('0x30')](function(_0x151856){_0xa07f22(_0x151856);});});}function createEndUser(_0x46db82,_0xb829de,_0x1c14c9,_0x4d6432,_0x130f29,_0x4a7910){var _0x1c14c9=getName(_0x1c14c9);return request({'method':'POST','uri':_0xb996('0x44')+_0xb829de+'/crm/v2/'+_[_0xb996('0x45')](_0x4a7910[_0xb996('0x46')])+'s','body':{'data':[{'Last_Name':_0x1c14c9[0x1],'First_Name':_0x1c14c9[0x0],'Phone':_0x4d6432,'Owner':{'name':!_[_0xb996('0x1f')](_0x130f29[_0xb996('0x47')][_0xb996('0x1b')])?_0x130f29[_0xb996('0x47')][_0xb996('0x1b')]:!_[_0xb996('0x1f')](_0x130f29[_0xb996('0x48')])?_0x130f29[_0xb996('0x48')]+'\x20'+_0x130f29['last_name']:_0x130f29[_0xb996('0x49')],'id':_0x130f29['id']}}]},'headers':{'Authorization':_0xb996('0x4a')+_0x46db82},'json':!![]})[_0xb996('0x2d')](function(_0x32f47a){if(_0x32f47a&&_0x32f47a[_0xb996('0x4b')][0x0][_0xb996('0x4c')]==='SUCCESS'){var _0x31db5b=_0x32f47a[_0xb996('0x4b')][0x0][_0xb996('0x4d')];_0x31db5b[_0xb996('0x4e')]=_[_0xb996('0x45')](_0x4a7910[_0xb996('0x46')])+'s';return _0x31db5b;}logger[_0xb996('0x31')](_0xb996('0x42'),JSON[_0xb996('0xf')](data));throw new Error(_0xb996('0x4f')+JSON['stringify'](data));})[_0xb996('0x30')](function(_0x589444){console[_0xb996('0x50')](_0xb996('0x51'),_0x589444);});}function getEndUser(_0x32e618,_0x558e83,_0x323cca,_0x2c54dd,_0x18abc8,_0x1620ff,_0x45c49a){var _0x329445={'method':_0xb996('0x35'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x32e618},'json':!![]};switch(_0x45c49a[_0xb996('0x52')]){case _0xb996('0x53'):_0x329445[_0xb996('0x54')]='https://www.zohoapis.'+_0x558e83+_0xb996('0x55')+_0x18abc8+'))';return getZohoUser(_0x329445,'Contacts')[_0xb996('0x2d')](function(_0x585826){if(_0x585826)return _0x585826;_0x329445[_0xb996('0x54')]=_0xb996('0x44')+_0x558e83+_0xb996('0x56')+_0x18abc8+'))';return getZohoUser(_0x329445,'Leads')['then'](function(_0x571ee1){if(_0x571ee1)return _0x571ee1;if(_0x45c49a[_0xb996('0x46')]!='nothing'){return createEndUser(_0x32e618,_0x558e83,_0x2c54dd,_0x18abc8,_0x1620ff,_0x45c49a);}else{return{};}});});break;case _0xb996('0x57'):_0x329445[_0xb996('0x54')]=_0xb996('0x44')+_0x558e83+_0xb996('0x55')+_0x18abc8+'))';return getZohoUser(_0x329445,_0xb996('0x58'))[_0xb996('0x2d')](function(_0x27a0d8){if(_0x27a0d8)return _0x27a0d8;if(_0x45c49a[_0xb996('0x46')]!='nothing'){return createEndUser(_0x32e618,_0x558e83,_0x2c54dd,_0x18abc8,_0x1620ff,_0x45c49a);}else{return{};}});break;case _0xb996('0x59'):_0x329445[_0xb996('0x54')]=_0xb996('0x44')+_0x558e83+_0xb996('0x56')+_0x18abc8+'))';return getZohoUser(_0x329445,_0xb996('0x5a'))[_0xb996('0x2d')](function(_0x58c3e9){if(_0x58c3e9)return _0x58c3e9;if(_0x45c49a[_0xb996('0x46')]!=_0xb996('0x5b')){return createEndUser(_0x32e618,_0x558e83,_0x2c54dd,_0x18abc8,_0x1620ff,_0x45c49a);}else{return{};}});break;}}function getCall(_0x48d01d,_0x13078b,_0x2d4b63,_0x534576,_0xb687a7,_0x1d682a,_0x55fd23,_0x12b883){logger[_0xb996('0x34')](_0xb996('0x5c'));var _0x11ad36={};_0x11ad36[_0xb996('0x5d')]={'name':!_[_0xb996('0x1f')](_0x534576['role']['name'])&&!_[_0xb996('0x1f')](_0x534576[_0xb996('0x3e')][_0xb996('0x1b')])&&_0x534576[_0xb996('0x3e')]['name']==='administrator'?_0x534576['role']['name']:!_[_0xb996('0x1f')](_0x534576[_0xb996('0x48')])?_0x534576[_0xb996('0x48')]+'\x20'+_0x534576[_0xb996('0x49')]:_0x534576[_0xb996('0x49')],'id':_0x534576['id']};_0x11ad36[_0xb996('0x5e')]=intUtil['getString'](_0x1d682a[_0xb996('0x5f')],_0x55fd23,'\x20');_0x11ad36[_0xb996('0x60')]=intUtil['getString'](_0x1d682a[_0xb996('0x61')],_0x55fd23,'\x0a');if(_0xb687a7[_0xb996('0x4e')]===_0xb996('0x58')){_0x11ad36[_0xb996('0x62')]={'name':!_[_0xb996('0x1f')](_0xb687a7[_0xb996('0x63')])?_0xb687a7[_0xb996('0x63')]:!_[_0xb996('0x1f')](_0xb687a7['First_Name'])?_0xb687a7[_0xb996('0x64')]+'\x20'+_0xb687a7[_0xb996('0x65')]:_0xb687a7[_0xb996('0x65')],'id':_0xb687a7['id']};}if(_0xb687a7[_0xb996('0x4e')]===_0xb996('0x5a')){_0x11ad36['What_Id']={'name':!_['isNil'](_0xb687a7['Full_Name'])?_0xb687a7[_0xb996('0x63')]:!_[_0xb996('0x1f')](_0xb687a7[_0xb996('0x64')])?_0xb687a7[_0xb996('0x64')]+'\x20'+_0xb687a7[_0xb996('0x65')]:_0xb687a7[_0xb996('0x65')],'id':_0xb687a7['id']};_0x11ad36['$se_module']=_['startCase'](_0xb687a7[_0xb996('0x4e')]);}if(_0x55fd23[_0xb996('0x66')]){_0x11ad36['Call_Duration']=moment[_0xb996('0x67')](parseInt(_0x55fd23['talktime'])*0x3e8)[_0xb996('0x36')]('mm:ss');}else if(_0x55fd23[_0xb996('0x68')]&&_0x55fd23[_0xb996('0x69')]){_0x11ad36[_0xb996('0x6a')]=moment['utc'](moment(_0x55fd23[_0xb996('0x69')],'YYYY-MM-DDTHH:mm:ss')[_0xb996('0x6b')](moment(_0x55fd23['starttime'],_0xb996('0x6c'))))[_0xb996('0x36')](_0xb996('0x6d'));}switch(_0x55fd23['lastevent']){case _0xb996('0x6e'):_0x11ad36['Call_Result']=_0xb996('0x6f');break;case _0xb996('0x70'):case _0xb996('0x71'):_0x11ad36[_0xb996('0x72')]=_0xb996('0x73');break;case _0xb996('0x74'):_0x11ad36['Call_Result']=_0xb996('0x75');break;case _0xb996('0x76'):_0x11ad36[_0xb996('0x72')]=_0xb996('0x77');break;case'timeout':_0x11ad36[_0xb996('0x72')]=_0xb996('0x78');default:}_0x11ad36[_0xb996('0x79')]=(_0x12b883===_0xb996('0x7a')?moment(_0x55fd23[_0xb996('0x7b')])[_0xb996('0x36')](_0xb996('0x6c')):moment(_0x55fd23['agentcalledAt'])['format'](_0xb996('0x6c')))||moment()['format'](_0xb996('0x6c'));_0x11ad36[_0xb996('0x7c')]=_0x12b883||_0xb996('0x7d');_0x11ad36=_[_0xb996('0x7e')](_0x11ad36,getCustomFields(_0x1d682a['Fields'],_0x55fd23));return request({'method':_0xb996('0x28'),'uri':'https://www.zohoapis.'+_0x13078b+_0xb996('0x7f'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x48d01d},'body':{'data':[_0x11ad36]},'json':!![]})[_0xb996('0x2d')](function(_0x20cfc8){if(_0x20cfc8&&_0x20cfc8[_0xb996('0x4b')][0x0][_0xb996('0x4c')]===_0xb996('0x80')){logger[_0xb996('0x34')](_0xb996('0x81'));return{'id':_0x20cfc8['data'][0x0][_0xb996('0x4d')]['id']};}})[_0xb996('0x30')](function(_0x5f019a){logger[_0xb996('0x34')](_0xb996('0x82'),_0x5f019a[_0xb996('0x33')]);console[_0xb996('0x50')](_0xb996('0x82'),_0x5f019a);});}exports[_0xb996('0x83')]=function(_0xd737df,_0x40cea6,_0x31b46b,_0x5c471e,_0x5b1252,_0x38d2ff){var _0x39837a,_0x806015,_0x1ee63d;_0x38d2ff[_0xb996('0x84')]=intUtil[_0xb996('0x85')](_0x38d2ff[_0xb996('0x84')]);_0x38d2ff[_0xb996('0x86')]=intUtil[_0xb996('0x85')](_0x38d2ff['serverUrl']);if(_0x5b1252&&_0x5b1252['monitor_format']){logger['info']('[QUEUE]',_0xb996('0x87'));_0x40cea6[_0xb996('0x88')]=_0x38d2ff[_0xb996('0x86')]+_0xb996('0x89')+_0x40cea6['uniqueid']+_0xb996('0x8a')+md5(_0x40cea6[_0xb996('0x8b')]);}else{_0x40cea6[_0xb996('0x88')]='';}var _0x55a591=_0x38d2ff[_0xb996('0x84')]===_0xb996('0x8c')?'eu':_0xb996('0x8d');return getAccessToken(_0x38d2ff)[_0xb996('0x2d')](function(_0x32cf86){_0x1ee63d=_0x32cf86;return getUser(_0x1ee63d,_0x55a591,_0x38d2ff,_0x5c471e[_0xb996('0x3b')]);})['then'](function(_0xb8d89d){_0x39837a=_0xb8d89d;logger['info'](_0xb996('0x8e'),_0x39837a['id']);return getEndUser(_0x1ee63d,_0x55a591,_0x38d2ff,_0x40cea6[_0xb996('0x8f')],_0x40cea6['calleridnum'],_0x39837a,_0x31b46b);})[_0xb996('0x2d')](function(_0x36555e){_0x806015=_0x36555e;return getCall(_0x1ee63d,_0x55a591,_0x38d2ff,_0x39837a,_0x806015,_0x31b46b,_0x40cea6,_0xb996('0x7d'));})[_0xb996('0x2d')](function(_0x5cce99){if(_0x5cce99){logger['info'](_0xb996('0x90'),_0x5cce99['id']);logger[_0xb996('0x34')](_0xb996('0x91'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb996('0x36')](_0xb996('0x92'),_0x5c471e[_0xb996('0x1b')]),_0xb996('0x93'),{'uri':_0xb996('0x94')+_0x38d2ff[_0xb996('0x84')]+_0xb996('0x95')+_0x5cce99['id']});}})[_0xb996('0x30')](function(_0x154f2e){logger[_0xb996('0x31')](_0xb996('0x91'),JSON[_0xb996('0xf')](_0x154f2e));});};exports[_0xb996('0x7a')]=function(_0x142bb5,_0xfadb04,_0x2a268b,_0x13d822,_0x128562,_0x716688,_0x2a1da4){var _0x1b39f8,_0x35f13e,_0x4dd625;_0x716688[_0xb996('0x84')]=intUtil['stripTrailingSlash'](_0x716688['host']);_0x716688[_0xb996('0x86')]=intUtil['stripTrailingSlash'](_0x716688[_0xb996('0x86')]);if(_0x2a1da4&&_0x2a1da4[_0xb996('0x96')]&&_0x2a1da4['recordingFormat']!==_0xb996('0x97')){logger['info'](_0xb996('0x98'),'Recording\x20is\x20enabled!');_0xfadb04[_0xb996('0x88')]=_0x716688['serverUrl']+_0xb996('0x89')+_0xfadb04['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0xfadb04[_0xb996('0x8b')]);}var _0x5e2fc0=_0x716688['host']===_0xb996('0x8c')?'eu':_0xb996('0x8d');return getAccessToken(_0x716688)[_0xb996('0x2d')](function(_0x313623){_0x4dd625=_0x313623;return getUser(_0x4dd625,_0x5e2fc0,_0x716688,_0x13d822[_0xb996('0x3b')]);})[_0xb996('0x2d')](function(_0x368633){_0x1b39f8=_0x368633;logger['info'](_0xb996('0x8e'),_0x1b39f8['id']);return getEndUser(_0x4dd625,_0x5e2fc0,_0x716688,_0xfadb04['destcalleridname'],_0xfadb04[_0xb996('0x99')],_0x1b39f8,_0x2a268b);})['then'](function(_0x7a2de0){_0x35f13e=_0x7a2de0;return getCall(_0x4dd625,_0x5e2fc0,_0x716688,_0x1b39f8,_0x35f13e,_0x2a268b,_0xfadb04,'Outbound');})[_0xb996('0x2d')](function(_0x3b4fde){if(_0x3b4fde){logger['info'](_0xb996('0x90'),_0x3b4fde['id']);logger[_0xb996('0x34')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb996('0x36')](_0xb996('0x92'),_0x13d822[_0xb996('0x1b')]),_0xb996('0x93'),{'uri':_0xb996('0x94')+_0x716688['host']+_0xb996('0x95')+_0x3b4fde['id']});}})['catch'](function(_0x33bacd){logger[_0xb996('0x31')](_0xb996('0x98'),JSON[_0xb996('0xf')](_0x33bacd));});};exports[_0xb996('0x9a')]=function(_0x2d615a,_0x4a0f64,_0x27d3c4,_0x431674,_0x406814,_0x169bca){var _0x1b0e0f,_0x449e2d,_0x343d86;_0x169bca['host']=intUtil[_0xb996('0x85')](_0x169bca[_0xb996('0x84')]);_0x169bca[_0xb996('0x86')]=intUtil[_0xb996('0x85')](_0x169bca['serverUrl']);if(_0x406814&&_0x406814[_0xb996('0x9b')]){logger['info']('['+_0x4a0f64['lastevent'][_0xb996('0x9c')]()+']','Recording\x20is\x20enabled!');_0x4a0f64[_0xb996('0x88')]=_0x169bca['serverUrl']+_0xb996('0x89')+_0x4a0f64[_0xb996('0x8b')]+_0xb996('0x8a')+md5(_0x4a0f64[_0xb996('0x8b')]);}else{_0x4a0f64['recordingURL']='';}var _0x598610=_0x169bca[_0xb996('0x84')]===_0xb996('0x8c')?'eu':_0xb996('0x8d');return getAccessToken(_0x169bca)['then'](function(_0x2b3289){_0x343d86=_0x2b3289;return getUser(_0x343d86,_0x598610,_0x169bca);})[_0xb996('0x2d')](function(_0x26a8a6){_0x1b0e0f=_0x26a8a6;logger['info'](_0xb996('0x8e'),_0x1b0e0f['id']);return getEndUser(_0x343d86,_0x598610,_0x169bca,_0x4a0f64['calleridname'],_0x4a0f64[_0xb996('0x9d')],_0x1b0e0f,_0x27d3c4);})[_0xb996('0x2d')](function(_0x13c90){_0x449e2d=_0x13c90;return getCall(_0x343d86,_0x598610,_0x169bca,_0x1b0e0f,_0x449e2d,_0x27d3c4,_0x4a0f64,'Inbound');})['then'](function(_0x5cdf70){if(_0x5cdf70){logger[_0xb996('0x34')]('The\x20Call\x20ID\x20is:',_0x5cdf70['id']);}})['catch'](function(_0x11053f){logger[_0xb996('0x31')]('['+_0x4a0f64[_0xb996('0x9e')][_0xb996('0x9c')]()+']',JSON['stringify'](_0x11053f));});}; \ 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 6bb15a2..54d32e6 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 _0xa992=['exec','data2','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x532a1b,_0x1086f5){var _0x2f6224=function(_0x23460e){while(--_0x23460e){_0x532a1b['push'](_0x532a1b['shift']());}};_0x2f6224(++_0x1086f5);}(_0xa992,0x1d6));var _0x2a99=function(_0x97d823,_0x25c6e2){_0x97d823=_0x97d823-0x0;var _0x3fc455=_0xa992[_0x97d823];return _0x3fc455;};'use strict';var util=require(_0x2a99('0x0'));var sh=require(_0x2a99('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports[_0x2a99('0x2')]=function(_0xe0b008,_0x5a09a0){var _0x408598=_0xe0b008['data2']?_0xe0b008[_0x2a99('0x3')]:'Script';var _0x139333=_0xe0b008[_0x2a99('0x4')]?Mustache['render'](_0xe0b008[_0x2a99('0x4')],_0x5a09a0):_0x5a09a0;sh[_0x2a99('0x2')](_0x139333,function(_0x56dc5f,_0x3de031,_0x28300a){if(_0x56dc5f!==0x0){logger[_0x2a99('0x5')](util['format'](_0x2a99('0x6'),_0x408598,_0x139333,_0x56dc5f,_0x28300a));}else{logger['info'](util['format'](_0x2a99('0x7'),_0x408598,_0x139333,_0x3de031));}});}; \ No newline at end of file +var _0x26f0=['util','shelljs','mustache','exec','data2','Script','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0x26f0,0x168));var _0x026f=function(_0x53c977,_0x2d243d){_0x53c977=_0x53c977-0x0;var _0x50bced=_0x26f0[_0x53c977];return _0x50bced;};'use strict';var util=require(_0x026f('0x0'));var sh=require(_0x026f('0x1'));var Mustache=require(_0x026f('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0x026f('0x3')]=function(_0x318eab,_0x35ecbd){var _0x5dd53f=_0x318eab[_0x026f('0x4')]?_0x318eab[_0x026f('0x4')]:_0x026f('0x5');var _0x375e3e=_0x318eab['data3']?Mustache['render'](_0x318eab['data3'],_0x35ecbd):_0x35ecbd;sh[_0x026f('0x3')](_0x375e3e,function(_0x4443a8,_0x289521,_0xc730b2){if(_0x4443a8!==0x0){logger[_0x026f('0x6')](util[_0x026f('0x7')](_0x026f('0x8'),_0x5dd53f,_0x375e3e,_0x4443a8,_0xc730b2));}else{logger[_0x026f('0x9')](util[_0x026f('0x7')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x5dd53f,_0x375e3e,_0x289521));}});}; \ 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 536f4a9..247bd15 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 _0x18f8=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x18f8,0xf8));var _0x818f=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x18f8[_0x1762b4];return _0x29beda;};'use strict';var rp=require(_0x818f('0x0'));var util=require(_0x818f('0x1'));var _=require('lodash');var Mustache=require(_0x818f('0x2'));var logger=require(_0x818f('0x3'))(_0x818f('0x4'));exports['exec']=function(_0x74971e,_0xc5c791){var _0x4d36c8,_0x575b87;var _0x22f669={'method':_0x74971e[_0x818f('0x5')][_0x818f('0x6')](),'uri':Mustache[_0x818f('0x7')](_0x74971e[_0x818f('0x8')],_0xc5c791),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x74971e[_0x818f('0x9')])===_0x818f('0xa')&&parseInt(_0x74971e[_0x818f('0x9')])>=0x1&&parseInt(_0x74971e['data5'])<=0xa?parseInt(_0x74971e[_0x818f('0x9')])*0x3e8:0x5*0x3e8};try{_0x22f669['headers']=_0x74971e[_0x818f('0xb')]?JSON[_0x818f('0xc')](Mustache['render'](_0x74971e[_0x818f('0xb')],_0xc5c791)):{};}catch(_0x390815){logger[_0x818f('0xd')](_0x390815[_0x818f('0xe')]);}switch(_0x74971e[_0x818f('0x5')]['toUpperCase']()){case _0x818f('0xf'):case _0x818f('0x10'):_0x4d36c8=null;_0x22f669['qs']=_0xc5c791;break;case _0x818f('0x11'):case _0x818f('0x12'):if(_0x74971e[_0x818f('0x13')]){try{_0x4d36c8=JSON['parse'](Mustache[_0x818f('0x7')](_0x74971e[_0x818f('0x13')],_0xc5c791));_0x22f669[_0x818f('0x14')]=_0x4d36c8;}catch(_0x1f09bd){logger['error'](_0x1f09bd[_0x818f('0xe')]);logger[_0x818f('0xd')](_0x818f('0x15'));}}else{_0x4d36c8=_0xc5c791;_0x22f669[_0x818f('0x14')]=_0x4d36c8;}break;}logger[_0x818f('0x16')](util[_0x818f('0x17')](_0x818f('0x18'),_0x74971e[_0x818f('0x5')],_0x74971e[_0x818f('0x8')],JSON[_0x818f('0x19')](_0x22f669)));rp(_0x22f669)[_0x818f('0x1a')](function(_0x4bc350){_0x4d36c8=!_['isNil'](_0x4d36c8)?_0x818f('0x1b')+_0x4d36c8:'';_0x575b87=typeof _0x4bc350['body']===_0x818f('0x1c')?JSON[_0x818f('0x19')](_0x4bc350[_0x818f('0x14')]):_0x4bc350['body'];logger[_0x818f('0x16')](util[_0x818f('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x74971e['data1'],_0x74971e['data2'],_0x4bc350[_0x818f('0x1d')],_0x575b87));})[_0x818f('0x1e')](function(_0x32d2d8){logger[_0x818f('0xd')](util[_0x818f('0x17')](_0x818f('0x1f'),_0x74971e[_0x818f('0x5')],_0x74971e['data2'],_0x32d2d8['statusCode'],_0x32d2d8[_0x818f('0x20')],_0x32d2d8[_0x818f('0x21')]));});}; \ No newline at end of file +var _0xec17=['object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','message','util','lodash','mustache','trigger','exec','data1','toUpperCase','render','data5','number','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20'];(function(_0x5bbc3a,_0xa33f28){var _0x3c0a93=function(_0x573951){while(--_0x573951){_0x5bbc3a['push'](_0x5bbc3a['shift']());}};_0x3c0a93(++_0xa33f28);}(_0xec17,0x192));var _0x7ec1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xec17[_0x59ee6f];return _0x4c0979;};'use strict';var rp=require('request-promise');var util=require(_0x7ec1('0x0'));var _=require(_0x7ec1('0x1'));var Mustache=require(_0x7ec1('0x2'));var logger=require('../../../../config/logger')(_0x7ec1('0x3'));exports[_0x7ec1('0x4')]=function(_0x3f2572,_0x4e9a97){var _0x53a2e3,_0x2aa821;var _0x180f32={'method':_0x3f2572[_0x7ec1('0x5')][_0x7ec1('0x6')](),'uri':Mustache[_0x7ec1('0x7')](_0x3f2572['data2'],_0x4e9a97),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3f2572[_0x7ec1('0x8')])===_0x7ec1('0x9')&&parseInt(_0x3f2572[_0x7ec1('0x8')])>=0x1&&parseInt(_0x3f2572[_0x7ec1('0x8')])<=0xa?parseInt(_0x3f2572[_0x7ec1('0x8')])*0x3e8:0x5*0x3e8};try{_0x180f32[_0x7ec1('0xa')]=_0x3f2572[_0x7ec1('0xb')]?JSON[_0x7ec1('0xc')](Mustache['render'](_0x3f2572['data6'],_0x4e9a97)):{};}catch(_0x5745c5){logger['error'](_0x5745c5[_0x7ec1('0xd')]);}switch(_0x3f2572['data1']['toUpperCase']()){case _0x7ec1('0xe'):case _0x7ec1('0xf'):_0x53a2e3=null;_0x180f32['qs']=_0x4e9a97;break;case _0x7ec1('0x10'):case _0x7ec1('0x11'):if(_0x3f2572[_0x7ec1('0x12')]){try{_0x53a2e3=JSON[_0x7ec1('0xc')](Mustache[_0x7ec1('0x7')](_0x3f2572[_0x7ec1('0x12')],_0x4e9a97));_0x180f32[_0x7ec1('0x13')]=_0x53a2e3;}catch(_0x5a015d){logger[_0x7ec1('0x14')](_0x5a015d[_0x7ec1('0xd')]);logger[_0x7ec1('0x14')](_0x7ec1('0x15'));}}else{_0x53a2e3=_0x4e9a97;_0x180f32[_0x7ec1('0x13')]=_0x53a2e3;}break;}logger[_0x7ec1('0x16')](util[_0x7ec1('0x17')](_0x7ec1('0x18'),_0x3f2572[_0x7ec1('0x5')],_0x3f2572[_0x7ec1('0x19')],JSON[_0x7ec1('0x1a')](_0x180f32)));rp(_0x180f32)[_0x7ec1('0x1b')](function(_0x5b38a2){_0x53a2e3=!_[_0x7ec1('0x1c')](_0x53a2e3)?_0x7ec1('0x1d')+_0x53a2e3:'';_0x2aa821=typeof _0x5b38a2[_0x7ec1('0x13')]===_0x7ec1('0x1e')?JSON[_0x7ec1('0x1a')](_0x5b38a2[_0x7ec1('0x13')]):_0x5b38a2[_0x7ec1('0x13')];logger[_0x7ec1('0x16')](util[_0x7ec1('0x17')](_0x7ec1('0x1f'),_0x3f2572[_0x7ec1('0x5')],_0x3f2572['data2'],_0x5b38a2['statusCode'],_0x2aa821));})[_0x7ec1('0x20')](function(_0xacc90e){logger[_0x7ec1('0x14')](util[_0x7ec1('0x17')](_0x7ec1('0x21'),_0x3f2572['data1'],_0x3f2572[_0x7ec1('0x19')],_0xacc90e[_0x7ec1('0x22')],_0xacc90e['name'],_0xacc90e[_0x7ec1('0x23')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 35db0c2..15f8178 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 _0x852c=['error','message','result','exports','jayson/promise','routing','client','http','Request','then','rpc'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x852c,0x9e));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xc852('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xc852('0x1'));var client=jayson[_0xc852('0x2')][_0xc852('0x3')]({'port':0x2329});client[_0xc852('0x4')]=function(_0x331dcc,_0x1bcaad){return new BPromise(function(_0x569045,_0x4323e0){return client['request'](_0x331dcc,_0x1bcaad)[_0xc852('0x5')](function(_0x27e5b3){logger['debug'](_0xc852('0x6'),'routing',_0x331dcc,_0x1bcaad,_0x27e5b3);if(_0x27e5b3['error']){logger[_0xc852('0x7')](_0xc852('0x6'),_0xc852('0x1'),_0x331dcc,_0x27e5b3[_0xc852('0x7')][_0xc852('0x8')],_0x1bcaad);return _0x4323e0(_0x27e5b3['error'][_0xc852('0x8')]);}else{return _0x569045(_0x27e5b3[_0xc852('0x9')]);}})['catch'](function(_0xf0e794){logger['error']('rpc',_0xc852('0x1'),_0x331dcc,_0xf0e794,_0x1bcaad);return _0x4323e0(_0xf0e794);});});};module[_0xc852('0xa')]=client; \ No newline at end of file +var _0x6b75=['debug','rpc','routing','message','error','result','jayson/promise','../../config/logger','http','Request','request'];(function(_0x305f6c,_0x48bbed){var _0x447bf1=function(_0x2c3574){while(--_0x2c3574){_0x305f6c['push'](_0x305f6c['shift']());}};_0x447bf1(++_0x48bbed);}(_0x6b75,0x7f));var _0x56b7=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0x6b75[_0x1e081a];return _0x428209;};'use strict';var jayson=require(_0x56b7('0x0'));var BPromise=require('bluebird');var logger=require(_0x56b7('0x1'))('routing');var client=jayson['client'][_0x56b7('0x2')]({'port':0x2329});client[_0x56b7('0x3')]=function(_0x5e1d5e,_0x59628a){return new BPromise(function(_0x4393c1,_0x72e1b3){return client[_0x56b7('0x4')](_0x5e1d5e,_0x59628a)['then'](function(_0x2007e2){logger[_0x56b7('0x5')]('rpc','routing',_0x5e1d5e,_0x59628a,_0x2007e2);if(_0x2007e2['error']){logger['error'](_0x56b7('0x6'),_0x56b7('0x7'),_0x5e1d5e,_0x2007e2['error'][_0x56b7('0x8')],_0x59628a);return _0x72e1b3(_0x2007e2[_0x56b7('0x9')][_0x56b7('0x8')]);}else{return _0x4393c1(_0x2007e2[_0x56b7('0xa')]);}})['catch'](function(_0x4dfdf3){logger[_0x56b7('0x9')](_0x56b7('0x6'),_0x56b7('0x7'),_0x5e1d5e,_0x4dfdf3,_0x59628a);return _0x72e1b3(_0x4dfdf3);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b98e4ad..1df8fe8 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 _0x3f21=['./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','./lib/email','./rpc/mailAccount'];(function(_0x30d95e,_0x441662){var _0x800952=function(_0x47fb04){while(--_0x47fb04){_0x30d95e['push'](_0x30d95e['shift']());}};_0x800952(++_0x441662);}(_0x3f21,0x18e));var _0x13f2=function(_0x48d7f2,_0x5bb814){_0x48d7f2=_0x48d7f2-0x0;var _0x2b41e2=_0x3f21[_0x48d7f2];return _0x2b41e2;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x13f2('0x0'));var mailAccount=require(_0x13f2('0x1'));var setting=require(_0x13f2('0x2'));var logger=require(_0x13f2('0x3'))(_0x13f2('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x13f2('0x5')]()[_0x13f2('0x6')](mailAccount[_0x13f2('0x7')]())['then'](realtime[_0x13f2('0x8')]())[_0x13f2('0x6')](function(){email[_0x13f2('0x9')](realtime[_0x13f2('0xa')]);return realtime;});}function main(){return server[_0x13f2('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0x13f2('0x6')](function(){return setting[_0x13f2('0xc')]();})[_0x13f2('0x6')](function(_0x5b43d6){return setInterval(initRealtime,_0x5b43d6[_0x13f2('0xd')]*0x3e8);})[_0x13f2('0xe')](function(_0xaf6aa4){logger[_0x13f2('0xf')]('Email\x20service\x20initialization',_0xaf6aa4);});}main(); \ No newline at end of file +var _0x2116=['mailAccounts','getSettings','loginMailFrequency','./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','initMailAccounts','refresh'];(function(_0x14413d,_0x435d81){var _0x38d8b5=function(_0x1d2289){while(--_0x1d2289){_0x14413d['push'](_0x14413d['shift']());}};_0x38d8b5(++_0x435d81);}(_0x2116,0x10b));var _0x6211=function(_0x52e7ee,_0x34a838){_0x52e7ee=_0x52e7ee-0x0;var _0x2520b3=_0x2116[_0x52e7ee];return _0x2520b3;};'use strict';var server=require(_0x6211('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x6211('0x1'));var mailAccount=require(_0x6211('0x2'));var setting=require(_0x6211('0x3'));var logger=require(_0x6211('0x4'))(_0x6211('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount['getMailAccounts']())[_0x6211('0x6')](realtime[_0x6211('0x7')]())[_0x6211('0x6')](function(){email[_0x6211('0x8')](realtime[_0x6211('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x6211('0x6')](function(){return initRealtime();})[_0x6211('0x6')](function(){return setting[_0x6211('0xa')]();})['then'](function(_0x815352){return setInterval(initRealtime,_0x815352[_0x6211('0xb')]*0x3e8);})['catch'](function(_0x14d940){logger['error']('Email\x20service\x20initialization',_0x14d940);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index fffb60e..56eef77 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 _0xc04c=['handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','connected','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','smtp','send','verifySmtp','Smtp','then','verified','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','defaults','redis','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','status','Imap','messageStatus','total','isNil','stringify','hasOwnProperty','service','provider','custom','box'];(function(_0x3e3055,_0x38cebf){var _0x350208=function(_0x2428a7){while(--_0x2428a7){_0x3e3055['push'](_0x3e3055['shift']());}};_0x350208(++_0x38cebf);}(_0xc04c,0x1d8));var _0xcc04=function(_0x5812e6,_0x1d1de4){_0x5812e6=_0x5812e6-0x0;var _0x4c279e=_0xc04c[_0x5812e6];return _0x4c279e;};'use strict';var _=require(_0xcc04('0x0'));var moment=require(_0xcc04('0x1'));var BPromise=require(_0xcc04('0x2'));var md5=require(_0xcc04('0x3'));var Redis=require(_0xcc04('0x4'));var config=require(_0xcc04('0x5'));var logger=require('../../../config/logger')(_0xcc04('0x6'));config['redis']=_[_0xcc04('0x7')](config[_0xcc04('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xcc04('0x9'))(new Redis(config[_0xcc04('0x8')]));var EmailImap=require(_0xcc04('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xcc04('0xb'));var md5Accounts={};function EmailChannel(_0x1e05c5){logger[_0xcc04('0xc')](_0xcc04('0xd'));this[_0xcc04('0xe')]=_0x1e05c5[_0xcc04('0xe')];this[_0xcc04('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xcc04('0x10')][_0xcc04('0x11')]=function(_0x321d5a){var _0x238ab0=this['mailAccounts'][_0x321d5a];var _0x481116={'id':_0x238ab0['id'],'name':_0x238ab0[_0xcc04('0x12')],'key':_0x238ab0[_0xcc04('0x13')],'active':_0x238ab0[_0xcc04('0x14')],'Imap':{'status':_0x238ab0['Imap'][_0xcc04('0x15')],'messageStatus':_0x238ab0[_0xcc04('0x16')][_0xcc04('0x17')],'total':_0x238ab0['Imap'][_0xcc04('0x18')]}};if(_[_0xcc04('0x19')](md5Accounts[_0x321d5a])){md5Accounts[_0x321d5a]={};}var _0x47257b=md5(JSON[_0xcc04('0x1a')](_0x481116));if(md5Accounts[_0x321d5a]['md5']!==_0x47257b){md5Accounts[_0x321d5a][_0xcc04('0x3')]=_0x47257b;io['emit']('mailAccount:update',_0x481116);}};EmailChannel[_0xcc04('0x10')]['refresh']=function(_0xd1c7d8){for(var _0x45a8ce in _0xd1c7d8){if(_0xd1c7d8[_0xcc04('0x1b')](_0x45a8ce)){if(_0xd1c7d8[_0x45a8ce]['Imap']&&_0xd1c7d8[_0x45a8ce][_0xcc04('0x14')]){var _0x372d7d=_0xd1c7d8[_0x45a8ce][_0xcc04('0x16')];if(!_0x372d7d[_0xcc04('0x1c')]&&_0xd1c7d8[_0x45a8ce][_0xcc04('0x1d')]!==_0xcc04('0x1e'))_0x372d7d['service']=_0xd1c7d8[_0x45a8ce][_0xcc04('0x1d')];if(!this[_0xcc04('0xf')][_0xcc04('0x1b')](_0x372d7d['id'])){this[_0xcc04('0xf')][_0x372d7d['id']]=new EmailImap(_0x372d7d,_0xd1c7d8[_0x45a8ce][_0xcc04('0x6')]);this[_0xcc04('0xf')][_0x372d7d['id']]['on'](_0xcc04('0x1f'),this[_0xcc04('0x20')][_0xcc04('0x21')](this,_0x45a8ce));this['imapAccounts'][_0x372d7d['id']]['on'](_0xcc04('0x6'),this['handleImapEmail'][_0xcc04('0x21')](this,_0x45a8ce));this[_0xcc04('0xf')][_0x372d7d['id']]['on'](_0xcc04('0x22'),this[_0xcc04('0x23')]['bind'](this,_0x45a8ce));this[_0xcc04('0xf')][_0x372d7d['id']]['on'](_0xcc04('0x24'),this[_0xcc04('0x25')][_0xcc04('0x21')](this,_0x45a8ce));}}else{if(_['isNil'](this[_0xcc04('0xe')][_0x45a8ce][_0xcc04('0x16')])){this[_0xcc04('0xe')][_0x45a8ce][_0xcc04('0x16')]={};}this[_0xcc04('0xe')][_0x45a8ce][_0xcc04('0x16')]['status']=_0xcc04('0x26');this[_0xcc04('0xe')][_0x45a8ce][_0xcc04('0x16')][_0xcc04('0x17')]='';this[_0xcc04('0x11')](_0x45a8ce);}}}};EmailChannel['prototype'][_0xcc04('0x20')]=function(_0x45a1a2,_0x3c9ddb){if(this['mailAccounts'][_0x45a1a2]){this[_0xcc04('0xe')][_0x45a1a2][_0xcc04('0x16')][_0xcc04('0x15')]=_0xcc04('0x27');this[_0xcc04('0xe')][_0x45a1a2][_0xcc04('0x16')]['messageStatus']=_0x3c9ddb[_0xcc04('0x12')];if(_0x3c9ddb['messages']){this[_0xcc04('0xe')][_0x45a1a2]['Imap'][_0xcc04('0x18')]=_0x3c9ddb['messages'][_0xcc04('0x18')];}return this['emit'](_0x45a1a2);}};EmailChannel[_0xcc04('0x10')]['handleImapEmail']=function(_0x5a06df,_0x25fc70){logger[_0xcc04('0xc')](_0xcc04('0x28'),_0x25fc70[_0xcc04('0x29')],_0x25fc70[_0xcc04('0x2a')],_0x25fc70[_0xcc04('0x2b')],_0x5a06df);if(this[_0xcc04('0xe')][_0x5a06df]){return mailAccount['notify'](_0x5a06df,_0x25fc70)['then'](function(_0x1b8017){if(_0x1b8017){logger[_0xcc04('0xc')](_0xcc04('0x2c'));}})[_0xcc04('0x2d')](function(_0x254bf6){logger[_0xcc04('0x24')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xcc04('0x1a')](_0x254bf6));});}};EmailChannel[_0xcc04('0x10')][_0xcc04('0x23')]=function(_0x3872f2){if(this[_0xcc04('0xe')][_0x3872f2]&&this[_0xcc04('0xe')][_0x3872f2][_0xcc04('0x16')]){if(this[_0xcc04('0xf')][this[_0xcc04('0xe')][_0x3872f2]['Imap']['id']]){delete this[_0xcc04('0xf')][this[_0xcc04('0xe')][_0x3872f2][_0xcc04('0x16')]['id']];}this[_0xcc04('0xe')][_0x3872f2][_0xcc04('0x16')][_0xcc04('0x2e')]=moment();this[_0xcc04('0x11')](_0x3872f2);}};EmailChannel[_0xcc04('0x10')][_0xcc04('0x25')]=function(_0x483fab,_0x497134){if(this[_0xcc04('0xe')][_0x483fab]){this['mailAccounts'][_0x483fab][_0xcc04('0x16')][_0xcc04('0x15')]='error';this[_0xcc04('0xe')][_0x483fab][_0xcc04('0x16')]['messageStatus']=_0x497134;return this[_0xcc04('0x11')](_0x483fab);}};EmailChannel[_0xcc04('0x10')][_0xcc04('0x2f')]=function(_0xc91493,_0x5da83a){return this[_0xcc04('0x30')][_0xcc04('0x31')](_0xc91493,_0x5da83a);};EmailChannel[_0xcc04('0x10')][_0xcc04('0x32')]=function(_0x2aeaec){var _0x556395=this;if(this[_0xcc04('0xe')][_0x2aeaec['id']]){if(_[_0xcc04('0x19')](this['mailAccounts'][_0x2aeaec['id']][_0xcc04('0x33')])){this[_0xcc04('0xe')][_0x2aeaec['id']][_0xcc04('0x33')]={};}this[_0xcc04('0xe')][_0x2aeaec['id']][_0xcc04('0x33')][_0xcc04('0x2e')]=moment();return new BPromise(function(_0x15e25f,_0x5ecf7f){return _0x556395[_0xcc04('0x30')]['verify'](_0x2aeaec)[_0xcc04('0x34')](function(_0x3ee4a0){_0x556395[_0xcc04('0xe')][_0x2aeaec['id']][_0xcc04('0x33')][_0xcc04('0x15')]=_0xcc04('0x35');_0x556395[_0xcc04('0xe')][_0x2aeaec['id']][_0xcc04('0x33')]['messageStatus']='';_0x556395['emit'](_0x2aeaec['id']);_0x15e25f(_0x3ee4a0);})[_0xcc04('0x2d')](function(_0x3d5ea8){_0x556395[_0xcc04('0xe')][_0x2aeaec['id']][_0xcc04('0x33')][_0xcc04('0x15')]='error';_0x556395[_0xcc04('0xe')][_0x2aeaec['id']]['Smtp']['messageStatus']=_0x3d5ea8;_0x556395[_0xcc04('0x11')](_0x2aeaec['id']);_0x5ecf7f(_0x3d5ea8);});});}return this[_0xcc04('0x30')][_0xcc04('0x36')](_0x2aeaec);};module[_0xcc04('0x37')]=EmailChannel; \ No newline at end of file +var _0xe006=['from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','handleImapError','sendMail','send','Smtp','verified','verify','exports','lodash','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','status','messageStatus','Imap','total','isNil','stringify','mailAccount:update','service','provider','hasOwnProperty','box','handleImapEmail','end','bind','error','disabled','handleImapBox','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0xe006,0xe3));var _0x6e00=function(_0x472ee7,_0x302242){_0x472ee7=_0x472ee7-0x0;var _0x6aa3f3=_0xe006[_0x472ee7];return _0x6aa3f3;};'use strict';var _=require(_0x6e00('0x0'));var moment=require('moment');var BPromise=require(_0x6e00('0x1'));var md5=require(_0x6e00('0x2'));var Redis=require('ioredis');var config=require(_0x6e00('0x3'));var logger=require(_0x6e00('0x4'))(_0x6e00('0x5'));config[_0x6e00('0x6')]=_[_0x6e00('0x7')](config[_0x6e00('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6e00('0x8'))(new Redis(config[_0x6e00('0x6')]));var EmailImap=require(_0x6e00('0x9'));var EmailSmtp=require(_0x6e00('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x55b55f){logger[_0x6e00('0xb')]('start\x20email\x20channel');this['mailAccounts']=_0x55b55f[_0x6e00('0xc')];this[_0x6e00('0xd')]={};this[_0x6e00('0xe')]=new EmailSmtp();}EmailChannel[_0x6e00('0xf')][_0x6e00('0x10')]=function(_0xeb591a){var _0x533197=this['mailAccounts'][_0xeb591a];var _0x2d3079={'id':_0x533197['id'],'name':_0x533197[_0x6e00('0x11')],'key':_0x533197['key'],'active':_0x533197[_0x6e00('0x12')],'Imap':{'status':_0x533197['Imap'][_0x6e00('0x13')],'messageStatus':_0x533197['Imap'][_0x6e00('0x14')],'total':_0x533197[_0x6e00('0x15')][_0x6e00('0x16')]}};if(_[_0x6e00('0x17')](md5Accounts[_0xeb591a])){md5Accounts[_0xeb591a]={};}var _0x48f358=md5(JSON[_0x6e00('0x18')](_0x2d3079));if(md5Accounts[_0xeb591a][_0x6e00('0x2')]!==_0x48f358){md5Accounts[_0xeb591a][_0x6e00('0x2')]=_0x48f358;io['emit'](_0x6e00('0x19'),_0x2d3079);}};EmailChannel[_0x6e00('0xf')]['refresh']=function(_0x5b42b1){for(var _0x58edbb in _0x5b42b1){if(_0x5b42b1['hasOwnProperty'](_0x58edbb)){if(_0x5b42b1[_0x58edbb][_0x6e00('0x15')]&&_0x5b42b1[_0x58edbb][_0x6e00('0x12')]){var _0x2232b8=_0x5b42b1[_0x58edbb][_0x6e00('0x15')];if(!_0x2232b8['service']&&_0x5b42b1[_0x58edbb]['provider']!=='custom')_0x2232b8[_0x6e00('0x1a')]=_0x5b42b1[_0x58edbb][_0x6e00('0x1b')];if(!this[_0x6e00('0xd')][_0x6e00('0x1c')](_0x2232b8['id'])){this['imapAccounts'][_0x2232b8['id']]=new EmailImap(_0x2232b8,_0x5b42b1[_0x58edbb][_0x6e00('0x5')]);this[_0x6e00('0xd')][_0x2232b8['id']]['on'](_0x6e00('0x1d'),this['handleImapBox']['bind'](this,_0x58edbb));this[_0x6e00('0xd')][_0x2232b8['id']]['on'](_0x6e00('0x5'),this[_0x6e00('0x1e')]['bind'](this,_0x58edbb));this[_0x6e00('0xd')][_0x2232b8['id']]['on'](_0x6e00('0x1f'),this['handleImapEnd'][_0x6e00('0x20')](this,_0x58edbb));this['imapAccounts'][_0x2232b8['id']]['on'](_0x6e00('0x21'),this['handleImapError'][_0x6e00('0x20')](this,_0x58edbb));}}else{if(_[_0x6e00('0x17')](this['mailAccounts'][_0x58edbb][_0x6e00('0x15')])){this[_0x6e00('0xc')][_0x58edbb][_0x6e00('0x15')]={};}this[_0x6e00('0xc')][_0x58edbb][_0x6e00('0x15')][_0x6e00('0x13')]=_0x6e00('0x22');this[_0x6e00('0xc')][_0x58edbb][_0x6e00('0x15')][_0x6e00('0x14')]='';this[_0x6e00('0x10')](_0x58edbb);}}}};EmailChannel['prototype'][_0x6e00('0x23')]=function(_0x5d44ce,_0x3ed4ea){if(this[_0x6e00('0xc')][_0x5d44ce]){this[_0x6e00('0xc')][_0x5d44ce]['Imap'][_0x6e00('0x13')]='connected';this[_0x6e00('0xc')][_0x5d44ce][_0x6e00('0x15')][_0x6e00('0x14')]=_0x3ed4ea[_0x6e00('0x11')];if(_0x3ed4ea['messages']){this[_0x6e00('0xc')][_0x5d44ce][_0x6e00('0x15')][_0x6e00('0x16')]=_0x3ed4ea['messages']['total'];}return this[_0x6e00('0x10')](_0x5d44ce);}};EmailChannel[_0x6e00('0xf')][_0x6e00('0x1e')]=function(_0xbfe986,_0x544170){logger['info'](_0x6e00('0x24'),_0x544170['firstName'],_0x544170[_0x6e00('0x25')],_0x544170[_0x6e00('0x26')],_0xbfe986);if(this[_0x6e00('0xc')][_0xbfe986]){return mailAccount[_0x6e00('0x27')](_0xbfe986,_0x544170)[_0x6e00('0x28')](function(_0x31a64a){if(_0x31a64a){logger[_0x6e00('0xb')](_0x6e00('0x29'));}})[_0x6e00('0x2a')](function(_0x2a7d72){logger[_0x6e00('0x21')](_0x6e00('0x2b'),JSON[_0x6e00('0x18')](_0x2a7d72));});}};EmailChannel[_0x6e00('0xf')][_0x6e00('0x2c')]=function(_0x2960ee){if(this[_0x6e00('0xc')][_0x2960ee]&&this['mailAccounts'][_0x2960ee]['Imap']){if(this['imapAccounts'][this['mailAccounts'][_0x2960ee][_0x6e00('0x15')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x2960ee][_0x6e00('0x15')]['id']];}this[_0x6e00('0xc')][_0x2960ee][_0x6e00('0x15')][_0x6e00('0x2d')]=moment();this[_0x6e00('0x10')](_0x2960ee);}};EmailChannel[_0x6e00('0xf')][_0x6e00('0x2e')]=function(_0x538aed,_0x5ef867){if(this['mailAccounts'][_0x538aed]){this['mailAccounts'][_0x538aed][_0x6e00('0x15')][_0x6e00('0x13')]=_0x6e00('0x21');this[_0x6e00('0xc')][_0x538aed][_0x6e00('0x15')][_0x6e00('0x14')]=_0x5ef867;return this[_0x6e00('0x10')](_0x538aed);}};EmailChannel[_0x6e00('0xf')][_0x6e00('0x2f')]=function(_0x31134a,_0x5ce22d){return this[_0x6e00('0xe')][_0x6e00('0x30')](_0x31134a,_0x5ce22d);};EmailChannel['prototype']['verifySmtp']=function(_0x2a0794){var _0x18e0e1=this;if(this[_0x6e00('0xc')][_0x2a0794['id']]){if(_['isNil'](this[_0x6e00('0xc')][_0x2a0794['id']][_0x6e00('0x31')])){this['mailAccounts'][_0x2a0794['id']][_0x6e00('0x31')]={};}this['mailAccounts'][_0x2a0794['id']][_0x6e00('0x31')][_0x6e00('0x2d')]=moment();return new BPromise(function(_0x2dba69,_0x15f268){return _0x18e0e1[_0x6e00('0xe')]['verify'](_0x2a0794)['then'](function(_0x432c83){_0x18e0e1['mailAccounts'][_0x2a0794['id']]['Smtp'][_0x6e00('0x13')]=_0x6e00('0x32');_0x18e0e1[_0x6e00('0xc')][_0x2a0794['id']]['Smtp']['messageStatus']='';_0x18e0e1['emit'](_0x2a0794['id']);_0x2dba69(_0x432c83);})[_0x6e00('0x2a')](function(_0x3f180c){_0x18e0e1['mailAccounts'][_0x2a0794['id']]['Smtp'][_0x6e00('0x13')]=_0x6e00('0x21');_0x18e0e1[_0x6e00('0xc')][_0x2a0794['id']][_0x6e00('0x31')]['messageStatus']=_0x3f180c;_0x18e0e1[_0x6e00('0x10')](_0x2a0794['id']);_0x15f268(_0x3f180c);});});}return this[_0x6e00('0xe')][_0x6e00('0x33')](_0x2a0794);};module[_0x6e00('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 8a07a0e..8339b1a 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 _0x1883=['handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','host','port','tls','autotls','required','openBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchError','end','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','handleReady','bind'];(function(_0x22d65b,_0x288d0b){var _0x44f364=function(_0x4d21b9){while(--_0x4d21b9){_0x22d65b['push'](_0x22d65b['shift']());}};_0x44f364(++_0x288d0b);}(_0x1883,0xab));var _0x3188=function(_0x367461,_0x5afc9c){_0x367461=_0x367461-0x0;var _0x3a3ddf=_0x1883[_0x367461];return _0x3a3ddf;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var Imap=require(_0x3188('0x2'));var simpleParser=require(_0x3188('0x3'))[_0x3188('0x4')];var Iconv=require(_0x3188('0x5'))[_0x3188('0x6')];var EventEmitter=require(_0x3188('0x7'))[_0x3188('0x8')];var utils=require(_0x3188('0x9'));var logger=require(_0x3188('0xa'))(_0x3188('0xb'));function EmailImap(_0x408ae0,_0x33b62d){this[_0x3188('0xc')]=_0x3188('0xd');this[_0x3188('0xe')]=this['getAccount'](_0x408ae0,_0x33b62d);this[_0x3188('0x2')]=new Imap(this[_0x3188('0xe')]);this['imap'][_0x3188('0xf')]('ready',this[_0x3188('0x10')][_0x3188('0x11')](this));this[_0x3188('0x2')][_0x3188('0xf')]('end',this[_0x3188('0x12')][_0x3188('0x11')](this));this['imap']['on']('error',this[_0x3188('0x13')][_0x3188('0x11')](this));this[_0x3188('0x2')][_0x3188('0x14')]();}util[_0x3188('0x15')](EmailImap,EventEmitter);EmailImap[_0x3188('0x16')]['getAccount']=function(_0x276d69,_0x5e0044){var _0x4a2f36={'connTimeout':_0x276d69[_0x3188('0x17')]?_0x276d69['connTimeout']*0x3e8:0x2710,'authTimeout':_0x276d69['authTimeout']?_0x276d69[_0x3188('0x18')]*0x3e8:0x1388};if(_0x276d69[_0x3188('0x19')]){_0x4a2f36[_0x3188('0x1a')]=_0x276d69[_0x3188('0x1a')];_0x4a2f36[_0x3188('0xb')]=_0x5e0044||_0x276d69[_0x3188('0x1a')]||'anonymous@xcally.com';if(_0x276d69[_0x3188('0x1b')]){_0x4a2f36[_0x3188('0x1c')]=utils[_0x3188('0x1d')](_0x276d69[_0x3188('0x1e')][_0x3188('0x1f')],_0x276d69[_0x3188('0x1a')]);}else{_0x4a2f36[_0x3188('0x20')]=_0x276d69[_0x3188('0x20')];}}else{if(_0x276d69['authentication']){_0x4a2f36[_0x3188('0x1a')]=_0x276d69[_0x3188('0x1a')];_0x4a2f36['password']=_0x276d69['password'];}}_0x4a2f36['host']=_0x276d69[_0x3188('0x21')];_0x4a2f36[_0x3188('0x22')]=_0x276d69[_0x3188('0x22')]||0x3e1;if(_0x276d69['tls']){_0x4a2f36['tls']=!![];}else{_0x4a2f36[_0x3188('0x23')]=![];_0x4a2f36[_0x3188('0x24')]=_0x3188('0x25');}return _0x4a2f36;};EmailImap[_0x3188('0x16')][_0x3188('0x10')]=function(){this['imap'][_0x3188('0x26')](this[_0x3188('0xc')],![],this['handleOpenBox'][_0x3188('0x11')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x45ae2f,_0x129bd7){if(_0x45ae2f){this[_0x3188('0x13')](_0x45ae2f,!![]);}else{this[_0x3188('0x27')](_0x3188('0x28'),_0x129bd7);this[_0x3188('0x29')]();}};EmailImap[_0x3188('0x16')][_0x3188('0x2a')]=function(_0x4b4675){if(_0x4b4675){this[_0x3188('0x13')](_0x4b4675,!![]);}else{this[_0x3188('0x2')]['end']();}};EmailImap[_0x3188('0x16')][_0x3188('0x29')]=function(){this[_0x3188('0x2')][_0x3188('0x2b')]([_0x3188('0x2c')],this[_0x3188('0x2d')][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')]['handleReadUnseen']=function(_0x44fa15,_0x5d97d0){if(_0x44fa15){this[_0x3188('0x13')](_0x44fa15,!![]);}else{if(_0x5d97d0['length']){try{var _0x3f82ce=this[_0x3188('0x2')][_0x3188('0x2e')](_0x5d97d0,{'bodies':'','markSeen':!![]});_0x3f82ce['on'](_0x3188('0x2f'),this[_0x3188('0x30')][_0x3188('0x11')](this));_0x3f82ce[_0x3188('0xf')](_0x3188('0x31'),this[_0x3188('0x32')][_0x3188('0x11')](this));_0x3f82ce[_0x3188('0xf')](_0x3188('0x33'),this[_0x3188('0x34')][_0x3188('0x11')](this));}catch(_0xc3f30b){logger[_0x3188('0x31')](_0xc3f30b);}}else{this[_0x3188('0x2')][_0x3188('0x35')](!![],this['handleCloseBox'][_0x3188('0x11')](this));}}};EmailImap['prototype'][_0x3188('0x30')]=function(_0xc75bc6){_0xc75bc6['on']('body',this[_0x3188('0x36')][_0x3188('0x11')](this));_0xc75bc6[_0x3188('0xf')](_0x3188('0x37'),this[_0x3188('0x38')][_0x3188('0x11')](this));_0xc75bc6[_0x3188('0xf')]('end',this['handleMessageEnd'][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')][_0x3188('0x36')]=function(_0x1aa732){simpleParser(_0x1aa732,{'Iconv':Iconv},this['handleSimpleParser'][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')][_0x3188('0x38')]=function(){};EmailImap[_0x3188('0x16')]['handleMessageEnd']=function(){};EmailImap[_0x3188('0x16')]['handleSimpleParser']=function(_0x130e73,_0x57895f){if(_0x130e73){logger[_0x3188('0x31')](_0x130e73);}else{var _0x361a09=this;utils[_0x3188('0x39')](this[_0x3188('0xe')],_0x57895f,function(_0x22f8da){_0x361a09[_0x3188('0x27')](_0x3188('0xb'),_0x22f8da);});}};EmailImap[_0x3188('0x16')][_0x3188('0x34')]=function(){this[_0x3188('0x2')]['closeBox'](!![],this[_0x3188('0x2a')][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')][_0x3188('0x32')]=function(_0x7b2f4b){this[_0x3188('0x13')](_0x7b2f4b);this['imap'][_0x3188('0x35')](!![],this['handleCloseBox'][_0x3188('0x11')](this));};EmailImap[_0x3188('0x16')][_0x3188('0x12')]=function(){this[_0x3188('0x27')](_0x3188('0x33'));};EmailImap['prototype']['handleError']=function(_0x59069f,_0x4e6db6){logger['error'](_0x3188('0x13'),this[_0x3188('0xe')][_0x3188('0xb')],JSON[_0x3188('0x3a')](_0x59069f));var _0x9b70b1='';if(_0x59069f){if(_0x59069f['textCode']){_0x9b70b1=_0x59069f[_0x3188('0x3b')];}else{for(var _0x4e2b9c in _0x59069f){if(_0x59069f[_0x3188('0x3c')](_0x4e2b9c)){_0x9b70b1+=_[_0x3188('0x3d')](_0x4e2b9c)+':\x20'+_0x59069f[_0x4e2b9c]+'\x0a';}}}}if(_0x4e6db6){this[_0x3188('0x2')][_0x3188('0x33')]();}else{this['emit'](_0x3188('0x31'),_0x9b70b1);this[_0x3188('0x27')](_0x3188('0x33'));}};module[_0x3188('0x3e')]=EmailImap; \ No newline at end of file +var _0x8aad=['handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','closeBox','stringify','textCode','hasOwnProperty','lodash','util','mailparser','iconv','Iconv','./utils','mailbox','account','getAccount','imap','ready','handleReady','bind','once','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','email','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','required','openBox','handleOpenBox','box','readUnseen'];(function(_0x41f936,_0x217ec3){var _0x11a6fe=function(_0x551da4){while(--_0x551da4){_0x41f936['push'](_0x41f936['shift']());}};_0x11a6fe(++_0x217ec3);}(_0x8aad,0x146));var _0xd8aa=function(_0x13ca4a,_0x5bd365){_0x13ca4a=_0x13ca4a-0x0;var _0x2b501e=_0x8aad[_0x13ca4a];return _0x2b501e;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var Imap=require('imap');var simpleParser=require(_0xd8aa('0x2'))['simpleParser'];var Iconv=require(_0xd8aa('0x3'))[_0xd8aa('0x4')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xd8aa('0x5'));var logger=require('../../../config/logger')('email');function EmailImap(_0x16b648,_0x43ddeb){this[_0xd8aa('0x6')]='INBOX';this[_0xd8aa('0x7')]=this[_0xd8aa('0x8')](_0x16b648,_0x43ddeb);this[_0xd8aa('0x9')]=new Imap(this[_0xd8aa('0x7')]);this['imap']['once'](_0xd8aa('0xa'),this[_0xd8aa('0xb')][_0xd8aa('0xc')](this));this[_0xd8aa('0x9')][_0xd8aa('0xd')]('end',this[_0xd8aa('0xe')][_0xd8aa('0xc')](this));this[_0xd8aa('0x9')]['on'](_0xd8aa('0xf'),this[_0xd8aa('0x10')][_0xd8aa('0xc')](this));this[_0xd8aa('0x9')][_0xd8aa('0x11')]();}util[_0xd8aa('0x12')](EmailImap,EventEmitter);EmailImap[_0xd8aa('0x13')]['getAccount']=function(_0x5a8c79,_0x275eff){var _0x319ffe={'connTimeout':_0x5a8c79[_0xd8aa('0x14')]?_0x5a8c79['connTimeout']*0x3e8:0x2710,'authTimeout':_0x5a8c79[_0xd8aa('0x15')]?_0x5a8c79[_0xd8aa('0x15')]*0x3e8:0x1388};if(_0x5a8c79[_0xd8aa('0x16')]){_0x319ffe[_0xd8aa('0x17')]=_0x5a8c79['user'];_0x319ffe[_0xd8aa('0x18')]=_0x275eff||_0x5a8c79[_0xd8aa('0x17')]||'anonymous@xcally.com';if(_0x5a8c79[_0xd8aa('0x19')]){_0x319ffe[_0xd8aa('0x1a')]=utils[_0xd8aa('0x1b')](_0x5a8c79[_0xd8aa('0x1c')][_0xd8aa('0x1d')],_0x5a8c79['user']);}else{_0x319ffe[_0xd8aa('0x1e')]=_0x5a8c79[_0xd8aa('0x1e')];}}else{if(_0x5a8c79[_0xd8aa('0x1f')]){_0x319ffe[_0xd8aa('0x17')]=_0x5a8c79['user'];_0x319ffe[_0xd8aa('0x1e')]=_0x5a8c79[_0xd8aa('0x1e')];}}_0x319ffe[_0xd8aa('0x20')]=_0x5a8c79[_0xd8aa('0x20')];_0x319ffe[_0xd8aa('0x21')]=_0x5a8c79['port']||0x3e1;if(_0x5a8c79[_0xd8aa('0x22')]){_0x319ffe[_0xd8aa('0x22')]=!![];}else{_0x319ffe[_0xd8aa('0x22')]=![];_0x319ffe['autotls']=_0xd8aa('0x23');}return _0x319ffe;};EmailImap[_0xd8aa('0x13')][_0xd8aa('0xb')]=function(){this[_0xd8aa('0x9')][_0xd8aa('0x24')](this[_0xd8aa('0x6')],![],this[_0xd8aa('0x25')][_0xd8aa('0xc')](this));};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x25')]=function(_0x6614ab,_0x370d6f){if(_0x6614ab){this[_0xd8aa('0x10')](_0x6614ab,!![]);}else{this['emit'](_0xd8aa('0x26'),_0x370d6f);this[_0xd8aa('0x27')]();}};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x28')]=function(_0x26cff3){if(_0x26cff3){this[_0xd8aa('0x10')](_0x26cff3,!![]);}else{this[_0xd8aa('0x9')][_0xd8aa('0x29')]();}};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x27')]=function(){this['imap'][_0xd8aa('0x2a')]([_0xd8aa('0x2b')],this[_0xd8aa('0x2c')]['bind'](this));};EmailImap[_0xd8aa('0x13')]['handleReadUnseen']=function(_0x3052c6,_0x441466){if(_0x3052c6){this[_0xd8aa('0x10')](_0x3052c6,!![]);}else{if(_0x441466[_0xd8aa('0x2d')]){try{var _0x44f783=this[_0xd8aa('0x9')][_0xd8aa('0x2e')](_0x441466,{'bodies':'','markSeen':!![]});_0x44f783['on'](_0xd8aa('0x2f'),this['handleFetchMessage'][_0xd8aa('0xc')](this));_0x44f783[_0xd8aa('0xd')](_0xd8aa('0xf'),this[_0xd8aa('0x30')][_0xd8aa('0xc')](this));_0x44f783[_0xd8aa('0xd')](_0xd8aa('0x29'),this[_0xd8aa('0x31')]['bind'](this));}catch(_0x265217){logger[_0xd8aa('0xf')](_0x265217);}}else{this[_0xd8aa('0x9')]['closeBox'](!![],this[_0xd8aa('0x28')][_0xd8aa('0xc')](this));}}};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x32')]=function(_0x249564){_0x249564['on'](_0xd8aa('0x33'),this[_0xd8aa('0x34')][_0xd8aa('0xc')](this));_0x249564[_0xd8aa('0xd')]('attributes',this[_0xd8aa('0x35')][_0xd8aa('0xc')](this));_0x249564[_0xd8aa('0xd')](_0xd8aa('0x29'),this[_0xd8aa('0x36')][_0xd8aa('0xc')](this));};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x34')]=function(_0xb8bfe6){simpleParser(_0xb8bfe6,{'Iconv':Iconv},this['handleSimpleParser'][_0xd8aa('0xc')](this));};EmailImap['prototype'][_0xd8aa('0x35')]=function(){};EmailImap[_0xd8aa('0x13')]['handleMessageEnd']=function(){};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x37')]=function(_0xb503cc,_0x18da91){if(_0xb503cc){logger[_0xd8aa('0xf')](_0xb503cc);}else{var _0x567b24=this;utils['parser'](this[_0xd8aa('0x7')],_0x18da91,function(_0x4debd0){_0x567b24[_0xd8aa('0x38')](_0xd8aa('0x18'),_0x4debd0);});}};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x31')]=function(){this[_0xd8aa('0x9')][_0xd8aa('0x39')](!![],this[_0xd8aa('0x28')][_0xd8aa('0xc')](this));};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x30')]=function(_0x36ea98){this['handleError'](_0x36ea98);this[_0xd8aa('0x9')][_0xd8aa('0x39')](!![],this[_0xd8aa('0x28')]['bind'](this));};EmailImap[_0xd8aa('0x13')][_0xd8aa('0xe')]=function(){this[_0xd8aa('0x38')](_0xd8aa('0x29'));};EmailImap[_0xd8aa('0x13')][_0xd8aa('0x10')]=function(_0x2b28f9,_0x4570b7){logger[_0xd8aa('0xf')](_0xd8aa('0x10'),this[_0xd8aa('0x7')][_0xd8aa('0x18')],JSON[_0xd8aa('0x3a')](_0x2b28f9));var _0x18bea0='';if(_0x2b28f9){if(_0x2b28f9[_0xd8aa('0x3b')]){_0x18bea0=_0x2b28f9[_0xd8aa('0x3b')];}else{for(var _0x1577ff in _0x2b28f9){if(_0x2b28f9[_0xd8aa('0x3c')](_0x1577ff)){_0x18bea0+=_['upperFirst'](_0x1577ff)+':\x20'+_0x2b28f9[_0x1577ff]+'\x0a';}}}}if(_0x4570b7){this[_0xd8aa('0x9')][_0xd8aa('0x29')]();}else{this[_0xd8aa('0x38')](_0xd8aa('0xf'),_0x18bea0);this[_0xd8aa('0x38')](_0xd8aa('0x29'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 00b8f6b..bc5be27 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 _0x0546=['sendMail','toString','verify','exports','prototype','createTransport','use','compile'];(function(_0x4d7f4f,_0xef429){var _0x29a00f=function(_0x7774f4){while(--_0x7774f4){_0x4d7f4f['push'](_0x4d7f4f['shift']());}};_0x29a00f(++_0xef429);}(_0x0546,0xbc));var _0x6054=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x0546[_0x29e2af];return _0x1ea06a;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x6054('0x0')]['send']=function(_0x1655b5,_0x307461){return new Promise(function(_0x3b0813,_0x2d46ca){var _0xd78ada=nodemailer[_0x6054('0x1')](_0x1655b5);_0xd78ada[_0x6054('0x2')](_0x6054('0x3'),inlineBase64());_0xd78ada[_0x6054('0x4')](_0x307461,function(_0x24120f,_0x26913a){if(_0x24120f){_0x2d46ca(_0x24120f[_0x6054('0x5')]());}else{_0x3b0813(_0x26913a);}});});};EmailSmtp[_0x6054('0x0')][_0x6054('0x6')]=function(_0x3557e4){return new Promise(function(_0x539e64,_0x51df7d){var _0x2e7e62=nodemailer[_0x6054('0x1')](_0x3557e4);_0x2e7e62[_0x6054('0x6')](function(_0x24c96e,_0x1fb2b3){if(_0x24c96e){_0x51df7d(_0x24c96e[_0x6054('0x5')]());}else{if(_0x1fb2b3){_0x539e64(_0x1fb2b3);}else{_0x51df7d('Not\x20verifired');}}});});};module[_0x6054('0x7')]=EmailSmtp; \ No newline at end of file +var _0x84d3=['toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','sendMail'];(function(_0x41b164,_0x48d6f1){var _0x635742=function(_0x182dcc){while(--_0x182dcc){_0x41b164['push'](_0x41b164['shift']());}};_0x635742(++_0x48d6f1);}(_0x84d3,0x99));var _0x384d=function(_0x58d5a3,_0x1a2f5a){_0x58d5a3=_0x58d5a3-0x0;var _0x597721=_0x84d3[_0x58d5a3];return _0x597721;};'use strict';var nodemailer=require(_0x384d('0x0'));var inlineBase64=require(_0x384d('0x1'));function EmailSmtp(){}EmailSmtp[_0x384d('0x2')][_0x384d('0x3')]=function(_0x3938ff,_0x1411a1){return new Promise(function(_0x1056e2,_0x139aa6){var _0x558f8b=nodemailer[_0x384d('0x4')](_0x3938ff);_0x558f8b[_0x384d('0x5')]('compile',inlineBase64());_0x558f8b[_0x384d('0x6')](_0x1411a1,function(_0xbd454f,_0x434d0c){if(_0xbd454f){_0x139aa6(_0xbd454f[_0x384d('0x7')]());}else{_0x1056e2(_0x434d0c);}});});};EmailSmtp[_0x384d('0x2')]['verify']=function(_0x11dd08){return new Promise(function(_0x438172,_0x255d05){var _0x574d1e=nodemailer[_0x384d('0x4')](_0x11dd08);_0x574d1e['verify'](function(_0x523b8e,_0x54fc09){if(_0x523b8e){_0x255d05(_0x523b8e['toString']());}else{if(_0x54fc09){_0x438172(_0x54fc09);}else{_0x255d05(_0x384d('0x8'));}}});});};module[_0x384d('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 8c9e8a6..c6d1279 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 _0xa1f5=['anonymous','generate','name','indexOf','length','slice','join','Anonymous','head','pop','isEmpty','@xcally.com','html','test','replace','attachments','forEach','push','filename','_IMG','\x20[Attachment:\x20','body','textAsHtml','message','originTo','includes','originCc','bcc','attach','type','attachment','attachment-','%s-%s','now','root','server/files/attachments/','content','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','headerLines','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','

Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','utf-8','lodash','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment','value','address'];(function(_0x2543b6,_0x5c1702){var _0x25c8ff=function(_0x1fe116){while(--_0x1fe116){_0x2543b6['push'](_0x2543b6['shift']());}};_0x25c8ff(++_0x5c1702);}(_0xa1f5,0x1a0));var _0x5a1f=function(_0x42f737,_0x888f9c){_0x42f737=_0x42f737-0x0;var _0x1e7b98=_0xa1f5[_0x42f737];return _0x1e7b98;};'use strict';var _=require(_0x5a1f('0x0'));var moment=require(_0x5a1f('0x1'));var random=require(_0x5a1f('0x2'));var fs=require('fs');var path=require(_0x5a1f('0x3'));var util=require(_0x5a1f('0x4'));var tnef=require('node-tnef');var logger=require(_0x5a1f('0x5'))(_0x5a1f('0x6'));var config=require(_0x5a1f('0x7'));function getAddress(_0x34ba48){var _0x5af5a2=_['head'](_0x34ba48[_0x5a1f('0x8')]);return _0x5af5a2&&_0x5af5a2[_0x5a1f('0x9')]?_0x5af5a2[_0x5a1f('0x9')]:_0x5a1f('0xa')+random[_0x5a1f('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x35eb74){var _0xb75126=_['head'](_0x35eb74[_0x5a1f('0x8')]);if(_0xb75126&&_0xb75126[_0x5a1f('0xc')]){if(_0xb75126['name']==_0xb75126[_0x5a1f('0x9')]){return _0xb75126['name']['substring'](0x0,_0xb75126[_0x5a1f('0xc')][_0x5a1f('0xd')]('@'));}var _0x594b7b=_0xb75126['name']['split'](/\s+/);return _0x594b7b[_0x5a1f('0xe')]>0x1?_0x594b7b[_0x5a1f('0xf')](0x0,-0x1)[_0x5a1f('0x10')]('\x20'):_0xb75126[_0x5a1f('0xc')];}return _0x5a1f('0x11');}function getLastName(_0x2b672e){var _0x5c21a4=_[_0x5a1f('0x12')](_0x2b672e['value']);if(_0x5c21a4&&_0x5c21a4[_0x5a1f('0xc')]){var _0x52f6bc=_0x5c21a4[_0x5a1f('0xc')]['split'](/\s+/);return _0x52f6bc['length']>0x1?_0x52f6bc[_0x5a1f('0x13')]():'';}return'';}function getMails(_0x42eb3a,_0x1fc0a4){var _0x24e088='';for(var _0x2dabb6=0x0;_0x2dabb6<_0x1fc0a4[_0x5a1f('0x8')][_0x5a1f('0xe')];_0x2dabb6+=0x1){if(_0x1fc0a4[_0x5a1f('0x8')][_0x2dabb6][_0x5a1f('0x9')]!==_0x42eb3a){if(!_[_0x5a1f('0x14')](_0x24e088)){_0x24e088+=',';}_0x24e088+=_0x1fc0a4[_0x5a1f('0x8')][_0x2dabb6]['name']||_0x1fc0a4[_0x5a1f('0x8')][_0x2dabb6][_0x5a1f('0x9')]||'';_0x24e088+='\x20<';_0x24e088+=_0x1fc0a4[_0x5a1f('0x8')][_0x2dabb6]['address']?_0x1fc0a4[_0x5a1f('0x8')][_0x2dabb6][_0x5a1f('0x9')]:_0x5a1f('0xa')+random[_0x5a1f('0xb')](0x6)+_0x5a1f('0x15');_0x24e088+='>';}}return _0x24e088;}function parseEmail(_0x19e437,_0x5ba5ec,_0x210add){if(_0x5ba5ec[_0x5a1f('0x16')]){var _0x1d5d46=/)<[^<]*)*<\/script>/gi;while(_0x1d5d46[_0x5a1f('0x17')](_0x5ba5ec['html'])){_0x5ba5ec['html']=_0x5ba5ec[_0x5a1f('0x16')][_0x5a1f('0x18')](_0x1d5d46,'');}if(_0x5ba5ec[_0x5a1f('0x16')]['includes']('{_0x46d9a4[_0x5a1f('0x1b')](_0xcea8b5[_0x5a1f('0x1c')]);});var _0x440246=/]+>/g;var _0x5aa256=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x568649=_0x5ba5ec[_0x5a1f('0x16')][_0x5a1f('0x18')](_0x5aa256,'_SRC');var _0x164f86=_0x568649[_0x5a1f('0x18')](_0x440246,_0x5a1f('0x1d'));for(let _0x15a549=0x0;_0x15a549<_0x46d9a4[_0x5a1f('0xe')];_0x15a549++){var _0x578d98=_0x164f86[_0x5a1f('0x18')](_0x5a1f('0x1d'),_0x5a1f('0x1e')+_0x46d9a4[_0x15a549]+'\x20]');_0x164f86=_0x578d98;}_0x5ba5ec[_0x5a1f('0x16')]=_0x164f86;}_0x210add[_0x5a1f('0x1f')]=_0x5ba5ec['html'];}else{_0x210add[_0x5a1f('0x1f')]=_0x5ba5ec[_0x5a1f('0x20')];}if(_0x210add[_0x5a1f('0x1f')]){_0x210add[_0x5a1f('0x1f')]=_0x210add['body'][_0x5a1f('0x18')](/0x0){var _0x2afbfe=[_0x5a1f('0x2f'),_0x5a1f('0x30'),'Precedence:\x20auto_reply'];for(var _0x3af766=0x0;_0x3af766<_0x5ba5ec[_0x5a1f('0x31')][_0x5a1f('0xe')];_0x3af766++){var _0x10e21d=_[_0x5a1f('0xd')](_0x2afbfe,_0x5ba5ec[_0x5a1f('0x31')][_0x3af766][_0x5a1f('0x32')]);if(_0x10e21d>=0x0){_0x210add[_0x5a1f('0x33')]=!![];}}}return _0x210add;}exports[_0x5a1f('0x34')]=function(_0x58ebd4,_0x48eb35,_0x477bbd){var _0x10aaba={'from':getAddress(_0x48eb35[_0x5a1f('0x35')]),'firstName':getFirstName(_0x48eb35[_0x5a1f('0x35')]),'lastName':getLastName(_0x48eb35[_0x5a1f('0x35')]),'mapKey':_0x5a1f('0x6'),'message':{'from':getMails(_0x58ebd4[_0x5a1f('0x6')],_0x48eb35[_0x5a1f('0x35')]),'to':_0x58ebd4[_0x5a1f('0x6')],'cc':'','subject':_0x48eb35[_0x5a1f('0x36')]||'','messageId':_0x48eb35[_0x5a1f('0x37')],'inReplyTo':_0x48eb35[_0x5a1f('0x38')],'sentAt':moment(_0x48eb35[_0x5a1f('0x39')])['format'](_0x5a1f('0x3a')),'attach':![],'attachments':[]}};if(!_0x48eb35[_0x5a1f('0x16')]&&!_0x48eb35[_0x5a1f('0x20')]){var _0x113c7a=_[_0x5a1f('0x3b')](_0x48eb35[_0x5a1f('0x19')],{'contentType':_0x5a1f('0x3c')});if(_0x113c7a[_0x5a1f('0xe')]){logger[_0x5a1f('0x3d')](util['format'](_0x5a1f('0x3e'),_0x48eb35['messageId']));tnef['parseBuffer'](_[_0x5a1f('0x3f')](_0x113c7a)[_0x5a1f('0x2e')],function(_0x2988bb,_0x2087de){if(_0x2087de){_0x48eb35[_0x5a1f('0x16')]=_0x2087de[_0x5a1f('0x40')]||_0x5a1f('0x41');if(_0x2087de[_0x5a1f('0x42')]){for(var _0x2098c5=0x0;_0x2098c5<_0x2087de[_0x5a1f('0x42')][_0x5a1f('0xe')];_0x2098c5++){var _0x29a968=_0x2087de[_0x5a1f('0x42')][_0x2098c5];_0x10aaba[_0x5a1f('0x21')][_0x5a1f('0x19')][_0x5a1f('0x1b')]({'filename':_0x29a968[_0x5a1f('0x43')],'content':Buffer[_0x5a1f('0x35')](_0x29a968['Data'])});}}}_0x477bbd(parseEmail(_0x58ebd4,_0x48eb35,_0x10aaba));});}else{_0x48eb35[_0x5a1f('0x16')]=_0x5a1f('0x41');_0x477bbd(parseEmail(_0x58ebd4,_0x48eb35,_0x10aaba));}}else{_0x477bbd(parseEmail(_0x58ebd4,_0x48eb35,_0x10aaba));}};exports[_0x5a1f('0x44')]=function(_0x38b06a,_0x3fbac8){var _0x168259=[_0x5a1f('0x45')+(_0x3fbac8||''),'auth=Bearer\x20'+_0x38b06a,'',''];return Buffer[_0x5a1f('0x35')](_0x168259[_0x5a1f('0x10')](''),_0x5a1f('0x46'))['toString']('base64');}; \ No newline at end of file +var _0x710f=['subject','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','generateXOAuth2Token','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','generate','@xcally.com','head','name','substring','indexOf','split','length','slice','pop','anonymous','html','test','includes','attachments','forEach','push','replace','_SRC','_IMG','\x20]','body','textAsHtml','0x1?_0x2a3632[_0xf710('0x13')](0x0,-0x1)['join']('\x20'):_0x579c87['name'];}return'Anonymous';}function getLastName(_0x1d4d84){var _0x52fb26=_['head'](_0x1d4d84[_0xf710('0x9')]);if(_0x52fb26&&_0x52fb26['name']){var _0x4aaebe=_0x52fb26[_0xf710('0xe')]['split'](/\s+/);return _0x4aaebe[_0xf710('0x12')]>0x1?_0x4aaebe[_0xf710('0x14')]():'';}return'';}function getMails(_0x661d21,_0x3e28c9){var _0x1c971d='';for(var _0x47115c=0x0;_0x47115c<_0x3e28c9[_0xf710('0x9')][_0xf710('0x12')];_0x47115c+=0x1){if(_0x3e28c9[_0xf710('0x9')][_0x47115c][_0xf710('0xa')]!==_0x661d21){if(!_['isEmpty'](_0x1c971d)){_0x1c971d+=',';}_0x1c971d+=_0x3e28c9['value'][_0x47115c][_0xf710('0xe')]||_0x3e28c9[_0xf710('0x9')][_0x47115c]['address']||'';_0x1c971d+='\x20<';_0x1c971d+=_0x3e28c9[_0xf710('0x9')][_0x47115c][_0xf710('0xa')]?_0x3e28c9[_0xf710('0x9')][_0x47115c]['address']:_0xf710('0x15')+random[_0xf710('0xb')](0x6)+_0xf710('0xc');_0x1c971d+='>';}}return _0x1c971d;}function parseEmail(_0x4edbb9,_0x15ba76,_0x4053d8){if(_0x15ba76[_0xf710('0x16')]){var _0x550ed5=/)<[^<]*)*<\/script>/gi;while(_0x550ed5[_0xf710('0x17')](_0x15ba76[_0xf710('0x16')])){_0x15ba76['html']=_0x15ba76['html']['replace'](_0x550ed5,'');}if(_0x15ba76['html'][_0xf710('0x18')]('{_0x4d174c[_0xf710('0x1b')](_0x1de0f9['filename']);});var _0x1b4c9c=/]+>/g;var _0x2c3ae4=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4eb907=_0x15ba76[_0xf710('0x16')][_0xf710('0x1c')](_0x2c3ae4,_0xf710('0x1d'));var _0x217f2c=_0x4eb907[_0xf710('0x1c')](_0x1b4c9c,'_IMG');for(let _0x4d5e5e=0x0;_0x4d5e5e<_0x4d174c[_0xf710('0x12')];_0x4d5e5e++){var _0x242885=_0x217f2c[_0xf710('0x1c')](_0xf710('0x1e'),'\x20[Attachment:\x20'+_0x4d174c[_0x4d5e5e]+_0xf710('0x1f'));_0x217f2c=_0x242885;}_0x15ba76[_0xf710('0x16')]=_0x217f2c;}_0x4053d8[_0xf710('0x20')]=_0x15ba76[_0xf710('0x16')];}else{_0x4053d8['body']=_0x15ba76[_0xf710('0x21')];}if(_0x4053d8[_0xf710('0x20')]){_0x4053d8['body']=_0x4053d8[_0xf710('0x20')][_0xf710('0x1c')](/0x0){var _0x3351a9=[_0xf710('0x32'),_0xf710('0x33'),'Precedence:\x20auto_reply'];for(var _0x534b7b=0x0;_0x534b7b<_0x15ba76[_0xf710('0x31')][_0xf710('0x12')];_0x534b7b++){var _0x589963=_['indexOf'](_0x3351a9,_0x15ba76[_0xf710('0x31')][_0x534b7b][_0xf710('0x34')]);if(_0x589963>=0x0){_0x4053d8[_0xf710('0x35')]=!![];}}}return _0x4053d8;}exports[_0xf710('0x36')]=function(_0x115934,_0x34924e,_0x3d62cd){var _0xde8a84={'from':getAddress(_0x34924e[_0xf710('0x37')]),'firstName':getFirstName(_0x34924e[_0xf710('0x37')]),'lastName':getLastName(_0x34924e[_0xf710('0x37')]),'mapKey':'email','message':{'from':getMails(_0x115934[_0xf710('0x7')],_0x34924e[_0xf710('0x37')]),'to':_0x115934[_0xf710('0x7')],'cc':'','subject':_0x34924e[_0xf710('0x38')]||'','messageId':_0x34924e['messageId'],'inReplyTo':_0x34924e[_0xf710('0x39')],'sentAt':moment(_0x34924e[_0xf710('0x3a')])[_0xf710('0x3b')](_0xf710('0x3c')),'attach':![],'attachments':[]}};if(!_0x34924e[_0xf710('0x16')]&&!_0x34924e[_0xf710('0x21')]){var _0xbf02de=_[_0xf710('0x3d')](_0x34924e['attachments'],{'contentType':_0xf710('0x3e')});if(_0xbf02de[_0xf710('0x12')]){logger[_0xf710('0x3f')](util[_0xf710('0x3b')](_0xf710('0x40'),_0x34924e[_0xf710('0x41')]));tnef[_0xf710('0x42')](_[_0xf710('0x43')](_0xbf02de)[_0xf710('0x2f')],function(_0x4540d1,_0x317a23){if(_0x317a23){_0x34924e[_0xf710('0x16')]=_0x317a23[_0xf710('0x44')]||'

Empty\x20message

';if(_0x317a23[_0xf710('0x45')]){for(var _0x3cf1aa=0x0;_0x3cf1aa<_0x317a23['Attachments'][_0xf710('0x12')];_0x3cf1aa++){var _0x189a58=_0x317a23[_0xf710('0x45')][_0x3cf1aa];_0xde8a84[_0xf710('0x23')][_0xf710('0x19')][_0xf710('0x1b')]({'filename':_0x189a58[_0xf710('0x46')],'content':Buffer[_0xf710('0x37')](_0x189a58[_0xf710('0x47')])});}}}_0x3d62cd(parseEmail(_0x115934,_0x34924e,_0xde8a84));});}else{_0x34924e[_0xf710('0x16')]=_0xf710('0x48');_0x3d62cd(parseEmail(_0x115934,_0x34924e,_0xde8a84));}}else{_0x3d62cd(parseEmail(_0x115934,_0x34924e,_0xde8a84));}};exports[_0xf710('0x49')]=function(_0x20891c,_0x4e2865){var _0xb7cce1=['user='+(_0x4e2865||''),_0xf710('0x4a')+_0x20891c,'',''];return Buffer[_0xf710('0x37')](_0xb7cce1[_0xf710('0x2c')](''),_0xf710('0x4b'))['toString'](_0xf710('0x4c'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c447a79..f140ee2 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 _0xec16=['lodash','name','Service','key','active','Imap','Smtp','exports'];(function(_0x1881ba,_0x141a14){var _0x1145d6=function(_0x3d0252){while(--_0x3d0252){_0x1881ba['push'](_0x1881ba['shift']());}};_0x1145d6(++_0x141a14);}(_0xec16,0x140));var _0x6ec1=function(_0x4505b8,_0x4ac0d7){_0x4505b8=_0x4505b8-0x0;var _0x4b3368=_0xec16[_0x4505b8];return _0x4b3368;};'use strict';var _=require(_0x6ec1('0x0'));function MailAccount(_0xb53c84){this['id']=_0xb53c84['id']||0x0;this['name']=_0xb53c84[_0x6ec1('0x1')]||_0x6ec1('0x2');this['key']=_0xb53c84[_0x6ec1('0x3')]||'SERV';this[_0x6ec1('0x4')]=_0xb53c84[_0x6ec1('0x4')]||![];this[_0x6ec1('0x5')]=_0xb53c84['Imap']||[];this[_0x6ec1('0x6')]=_0xb53c84[_0x6ec1('0x6')]||[];}module[_0x6ec1('0x7')]=MailAccount; \ No newline at end of file +var _0x11c5=['key','SERV','active','Imap','Smtp','exports','name','Service'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x11c5,0x10e));var _0x511c=function(_0x4e7db5,_0x4fa347){_0x4e7db5=_0x4e7db5-0x0;var _0x5639b4=_0x11c5[_0x4e7db5];return _0x5639b4;};'use strict';var _=require('lodash');function MailAccount(_0x5dd111){this['id']=_0x5dd111['id']||0x0;this[_0x511c('0x0')]=_0x5dd111[_0x511c('0x0')]||_0x511c('0x1');this[_0x511c('0x2')]=_0x5dd111['key']||_0x511c('0x3');this[_0x511c('0x4')]=_0x5dd111[_0x511c('0x4')]||![];this[_0x511c('0x5')]=_0x5dd111[_0x511c('0x5')]||[];this['Smtp']=_0x5dd111[_0x511c('0x6')]||[];}module[_0x511c('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 31146a0..4d345b3 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 _0xa297=['prototype','initMailAccounts','length','isUndefined','lodash','../model/mailAccount','mailAccounts','hasOwnProperty'];(function(_0xee9570,_0x1ac94f){var _0x10bc9f=function(_0x23e2c7){while(--_0x23e2c7){_0xee9570['push'](_0xee9570['shift']());}};_0x10bc9f(++_0x1ac94f);}(_0xa297,0x1d4));var _0x7a29=function(_0x3662f4,_0x29e72c){_0x3662f4=_0x3662f4-0x0;var _0x1c20c9=_0xa297[_0x3662f4];return _0x1c20c9;};'use strict';var _=require(_0x7a29('0x0'));var MailAccount=require(_0x7a29('0x1'));var Realtime=function(){this[_0x7a29('0x2')]={};};function freeIsNotKey(_0x83594c,_0x11ba99,_0x595345){var _0x2b1789=_['mapKeys'](_0x83594c,function(_0x5b512b,_0x5951c4){return _0x5b512b[_0x595345];});for(var _0x52a83f in _0x11ba99){if(_0x11ba99[_0x7a29('0x3')](_0x52a83f)){if(!_0x2b1789[_0x52a83f]){delete _0x11ba99[_0x52a83f];}}}}Realtime[_0x7a29('0x4')]['mergeFromDatabase']=function(_0x1d7ef6,_0x5b70d5){for(var _0x2ac852 in _0x5b70d5){if(_0x1d7ef6[_0x7a29('0x3')](_0x2ac852)){_0x1d7ef6[_0x2ac852]=_0x5b70d5[_0x2ac852];}}};Realtime[_0x7a29('0x4')][_0x7a29('0x5')]=function(){var _0x48f6e0=this;return function(_0x465c26){if(_0x465c26){freeIsNotKey(_0x465c26,_0x48f6e0[_0x7a29('0x2')],'id');for(var _0x1ddb33=0x0,_0x2aa033={},_0x4b8b5a={};_0x1ddb33<_0x465c26[_0x7a29('0x6')];_0x1ddb33+=0x1){_0x2aa033=_0x465c26[_0x1ddb33];if(_[_0x7a29('0x7')](_0x48f6e0[_0x7a29('0x2')][_0x2aa033['id']])){_0x48f6e0[_0x7a29('0x2')][_0x2aa033['id']]=new MailAccount(_0x2aa033);}else{_['merge'](_0x48f6e0['mailAccounts'][_0x2aa033['id']],_0x2aa033);}}}return _0x48f6e0[_0x7a29('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0xb609=['initMailAccounts','length','merge','../model/mailAccount','mailAccounts','mapKeys','mergeFromDatabase'];(function(_0x4ccd07,_0x1d5c86){var _0x242d65=function(_0x5e145){while(--_0x5e145){_0x4ccd07['push'](_0x4ccd07['shift']());}};_0x242d65(++_0x1d5c86);}(_0xb609,0x137));var _0x9b60=function(_0x2a8a07,_0x593839){_0x2a8a07=_0x2a8a07-0x0;var _0x19d0e9=_0xb609[_0x2a8a07];return _0x19d0e9;};'use strict';var _=require('lodash');var MailAccount=require(_0x9b60('0x0'));var Realtime=function(){this[_0x9b60('0x1')]={};};function freeIsNotKey(_0x5eb524,_0x2a73f4,_0x51eb2c){var _0x5a923e=_[_0x9b60('0x2')](_0x5eb524,function(_0x34d847,_0x18a5dd){return _0x34d847[_0x51eb2c];});for(var _0x5b6d94 in _0x2a73f4){if(_0x2a73f4['hasOwnProperty'](_0x5b6d94)){if(!_0x5a923e[_0x5b6d94]){delete _0x2a73f4[_0x5b6d94];}}}}Realtime['prototype'][_0x9b60('0x3')]=function(_0x237979,_0x5ebe52){for(var _0x51bd10 in _0x5ebe52){if(_0x237979['hasOwnProperty'](_0x51bd10)){_0x237979[_0x51bd10]=_0x5ebe52[_0x51bd10];}}};Realtime['prototype'][_0x9b60('0x4')]=function(){var _0x3a54c0=this;return function(_0x29ab76){if(_0x29ab76){freeIsNotKey(_0x29ab76,_0x3a54c0['mailAccounts'],'id');for(var _0x3ca9a2=0x0,_0x25ab81={},_0x854a2e={};_0x3ca9a2<_0x29ab76[_0x9b60('0x5')];_0x3ca9a2+=0x1){_0x25ab81=_0x29ab76[_0x3ca9a2];if(_['isUndefined'](_0x3a54c0['mailAccounts'][_0x25ab81['id']])){_0x3a54c0[_0x9b60('0x1')][_0x25ab81['id']]=new MailAccount(_0x25ab81);}else{_[_0x9b60('0x6')](_0x3a54c0['mailAccounts'][_0x25ab81['id']],_0x25ab81);}}}return _0x3a54c0[_0x9b60('0x1')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 466fbba..8430ad6 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 _0x91c6=['provider','service','email','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','Smtp','getMailAccount','notify','NotifyMailAccount','../client','GetMailAccount','name'];(function(_0x165718,_0x49ae0b){var _0x2e57b2=function(_0x544f09){while(--_0x544f09){_0x165718['push'](_0x165718['shift']());}};_0x2e57b2(++_0x49ae0b);}(_0x91c6,0xf9));var _0x691c=function(_0x464d76,_0x4a9983){_0x464d76=_0x464d76-0x0;var _0x5c5377=_0x91c6[_0x464d76];return _0x5c5377;};'use strict';var client=require(_0x691c('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0x691c('0x1'),{'options':{'attributes':['id',_0x691c('0x2'),_0x691c('0x3'),_0x691c('0x4'),_0x691c('0x5'),'active',_0x691c('0x6'),_0x691c('0x7'),_0x691c('0x8')],'raw':![],'include':[{'model':_0x691c('0x9'),'as':_0x691c('0xa'),'include':[{'model':_0x691c('0xb'),'attributes':['id','name',_0x691c('0x4'),_0x691c('0xc'),_0x691c('0xd')],'as':_0x691c('0xb')}]},{'model':'MailServerOut','as':_0x691c('0xe'),'include':[{'model':_0x691c('0xb'),'attributes':['id',_0x691c('0x2'),'service','type','data5'],'as':_0x691c('0xb')}]}]},'log':_0x691c('0xf')});};};exports[_0x691c('0x10')]=function(_0x1fb5df,_0x570f0a){return client['Request'](_0x691c('0x11'),{'account':{'id':_0x1fb5df},'body':_0x570f0a,'log':_0x691c('0x11')});}; \ No newline at end of file +var _0xfd20=['TemplateId','MailServerIn','Imap','service','type','data5','CloudProvider','MailServerOut','Smtp','notify','Request','NotifyMailAccount','getMailAccounts','name','provider','email','key','ListId'];(function(_0x58eb7c,_0x89fcb7){var _0x5051c6=function(_0x3b386d){while(--_0x3b386d){_0x58eb7c['push'](_0x58eb7c['shift']());}};_0x5051c6(++_0x89fcb7);}(_0xfd20,0x66));var _0x0fd2=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xfd20[_0x1a87b3];return _0x37e84d;};'use strict';var client=require('../client');exports[_0x0fd2('0x0')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x0fd2('0x1'),_0x0fd2('0x2'),'service',_0x0fd2('0x3'),'active',_0x0fd2('0x4'),_0x0fd2('0x5'),_0x0fd2('0x6')],'raw':![],'include':[{'model':_0x0fd2('0x7'),'as':_0x0fd2('0x8'),'include':[{'model':'CloudProvider','attributes':['id','name',_0x0fd2('0x9'),_0x0fd2('0xa'),_0x0fd2('0xb')],'as':_0x0fd2('0xc')}]},{'model':_0x0fd2('0xd'),'as':_0x0fd2('0xe'),'include':[{'model':_0x0fd2('0xc'),'attributes':['id','name',_0x0fd2('0x9'),_0x0fd2('0xa'),'data5'],'as':_0x0fd2('0xc')}]}]},'log':'getMailAccount'});};};exports[_0x0fd2('0xf')]=function(_0x2222c4,_0x42ea5c){return client[_0x0fd2('0x10')](_0x0fd2('0x11'),{'account':{'id':_0x2222c4},'body':_0x42ea5c,'log':_0x0fd2('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 6f26a49..ebe72a4 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 _0x428d=['ShowSetting','loginMailFrequency','GetSettings','getSettings'];(function(_0x177e08,_0x5099da){var _0x5ccb2d=function(_0xaff71f){while(--_0xaff71f){_0x177e08['push'](_0x177e08['shift']());}};_0x5ccb2d(++_0x5099da);}(_0x428d,0x1bf));var _0xd428=function(_0x1ad0a3,_0x56f0d9){_0x1ad0a3=_0x1ad0a3-0x0;var _0x2672d1=_0x428d[_0x1ad0a3];return _0x2672d1;};'use strict';var client=require('../client');exports[_0xd428('0x0')]=function(){return client['Request'](_0xd428('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd428('0x2')]},'log':_0xd428('0x3')});}; \ No newline at end of file +var _0xcee9=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x577dac,_0x3726a3){var _0x2f9e94=function(_0x108bfb){while(--_0x108bfb){_0x577dac['push'](_0x577dac['shift']());}};_0x2f9e94(++_0x3726a3);}(_0xcee9,0x1bf));var _0x9cee=function(_0x23ee90,_0x166d50){_0x23ee90=_0x23ee90-0x0;var _0x1c3b53=_0xcee9[_0x23ee90];return _0x1c3b53;};'use strict';var client=require(_0x9cee('0x0'));exports[_0x9cee('0x1')]=function(){return client[_0x9cee('0x2')](_0x9cee('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9cee('0x4')]},'log':_0x9cee('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index fbfa7ae..2a45fb0 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 e772470..4c715f8 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 _0x3779=['localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','listen','port','socket.io','polling','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3779,0x164));var _0x9377=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x3779[_0xbe40ad];return _0x50fac9;};'use strict';var _=require(_0x9377('0x0'));var http=require(_0x9377('0x1'));var express=require(_0x9377('0x2'));var sticky=require(_0x9377('0x3'));var Redis=require(_0x9377('0x4'));var config=require(_0x9377('0x5'));var app=express();var server=http[_0x9377('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0x9377('0x7')](server,config[_0x9377('0x8')])){var socketio=require(_0x9377('0x9'))(server,{'transports':['websocket',_0x9377('0xa')]});config[_0x9377('0xb')]=_['defaults'](config[_0x9377('0xb')],{'host':_0x9377('0xc'),'port':0x18eb});socketio[_0x9377('0xd')](require(_0x9377('0xe'))({'pubClient':new Redis(config[_0x9377('0xb')]),'subClient':new Redis(config[_0x9377('0xb')])}));require(_0x9377('0xf'))[_0x9377('0x10')]();require(_0x9377('0x11'))['default'](socketio);require(_0x9377('0x12'))[_0x9377('0x10')](app);require(_0x9377('0x13'))[_0x9377('0x10')](app);}else{server['once']('listening',function(){console[_0x9377('0x14')](_0x9377('0x15'),config['port']);});}exports=module[_0x9377('0x16')]=app; \ No newline at end of file +var _0xa011=['../../config/express','once','log','exports','lodash','http','express','ioredis','../../config/environment','createServer','timeout','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio'];(function(_0x46c5b6,_0x1b5c1b){var _0x33ad47=function(_0x14bafc){while(--_0x14bafc){_0x46c5b6['push'](_0x46c5b6['shift']());}};_0x33ad47(++_0x1b5c1b);}(_0xa011,0xa6));var _0x1a01=function(_0x3de176,_0x531d21){_0x3de176=_0x3de176-0x0;var _0x507880=_0xa011[_0x3de176];return _0x507880;};'use strict';var _=require(_0x1a01('0x0'));var http=require(_0x1a01('0x1'));var express=require(_0x1a01('0x2'));var sticky=require('sticky-session');var Redis=require(_0x1a01('0x3'));var config=require(_0x1a01('0x4'));var app=express();var server=http[_0x1a01('0x5')](app);server[_0x1a01('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require('socket.io')(server,{'transports':['websocket','polling']});config[_0x1a01('0x7')]=_[_0x1a01('0x8')](config[_0x1a01('0x7')],{'host':_0x1a01('0x9'),'port':0x18eb});socketio['adapter'](require(_0x1a01('0xa'))({'pubClient':new Redis(config[_0x1a01('0x7')]),'subClient':new Redis(config[_0x1a01('0x7')])}));require(_0x1a01('0xb'))[_0x1a01('0xc')]();require(_0x1a01('0xd'))[_0x1a01('0xc')](socketio);require(_0x1a01('0xe'))[_0x1a01('0xc')](app);require('../../routes')[_0x1a01('0xc')](app);}else{server[_0x1a01('0xf')]('listening',function(){console[_0x1a01('0x10')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x1a01('0x11')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 8a2a75f..7f8accb 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 _0x1915=['Request','request','then','debug','rpc','error','message','result','catch','jayson/promise','../../config/logger','routing','http'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x1915,0x19c));var _0x5191=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1915[_0x4a9fb1];return _0x348672;};'use strict';var jayson=require(_0x5191('0x0'));var BPromise=require('bluebird');var logger=require(_0x5191('0x1'))(_0x5191('0x2'));var client=jayson['client'][_0x5191('0x3')]({'port':0x2329});client[_0x5191('0x4')]=function(_0x1393ec,_0x4a9cf6){return new BPromise(function(_0x1f775d,_0x1bf87b){return client[_0x5191('0x5')](_0x1393ec,_0x4a9cf6)[_0x5191('0x6')](function(_0x218bf0){logger[_0x5191('0x7')](_0x5191('0x8'),_0x5191('0x2'),_0x1393ec,_0x4a9cf6,_0x218bf0);if(_0x218bf0[_0x5191('0x9')]){logger[_0x5191('0x9')](_0x5191('0x8'),_0x5191('0x2'),_0x1393ec,_0x218bf0[_0x5191('0x9')][_0x5191('0xa')],_0x4a9cf6);return _0x1bf87b(_0x218bf0[_0x5191('0x9')]['message']);}else{return _0x1f775d(_0x218bf0[_0x5191('0xb')]);}})[_0x5191('0xc')](function(_0x282d92){logger[_0x5191('0x9')]('rpc',_0x5191('0x2'),_0x1393ec,_0x282d92,_0x4a9cf6);return _0x1bf87b(_0x282d92);});});};module['exports']=client; \ No newline at end of file +var _0xaf4d=['result','catch','bluebird','../../config/logger','http','Request','debug','rpc','routing','error','message'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0xaf4d,0x157));var _0xdaf4=function(_0x175a46,_0x467177){_0x175a46=_0x175a46-0x0;var _0x4050a7=_0xaf4d[_0x175a46];return _0x4050a7;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xdaf4('0x0'));var logger=require(_0xdaf4('0x1'))('routing');var client=jayson['client'][_0xdaf4('0x2')]({'port':0x2329});client[_0xdaf4('0x3')]=function(_0x3e5776,_0x3ba4f){return new BPromise(function(_0x3c126a,_0x2003f0){return client['request'](_0x3e5776,_0x3ba4f)['then'](function(_0x529e4d){logger[_0xdaf4('0x4')](_0xdaf4('0x5'),_0xdaf4('0x6'),_0x3e5776,_0x3ba4f,_0x529e4d);if(_0x529e4d['error']){logger[_0xdaf4('0x7')](_0xdaf4('0x5'),_0xdaf4('0x6'),_0x3e5776,_0x529e4d[_0xdaf4('0x7')][_0xdaf4('0x8')],_0x3ba4f);return _0x2003f0(_0x529e4d[_0xdaf4('0x7')][_0xdaf4('0x8')]);}else{return _0x3c126a(_0x529e4d[_0xdaf4('0x9')]);}})[_0xdaf4('0xa')](function(_0x388ed7){logger[_0xdaf4('0x7')](_0xdaf4('0x5'),_0xdaf4('0x6'),_0x3e5776,_0x388ed7,_0x3ba4f);return _0x2003f0(_0x388ed7);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 73de3ef..0cfb054 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 _0x3f1e=['getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','catch','log','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f1e,0x7f));var _0xe3f1=function(_0x2d566b,_0x47c52d){_0x2d566b=_0x2d566b-0x0;var _0xd90686=_0x3f1e[_0x2d566b];return _0xd90686;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xe3f1('0x0'));var user=require(_0xe3f1('0x1'));var interval=require(_0xe3f1('0x2'));var openchannelQueue=require(_0xe3f1('0x3'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xe3f1('0x4'));var mailQueue=require(_0xe3f1('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xe3f1('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xe3f1('0x7')]()['then'](user[_0xe3f1('0x8')]())[_0xe3f1('0x9')](realtime[_0xe3f1('0xa')]())[_0xe3f1('0x9')](interval[_0xe3f1('0xb')]())[_0xe3f1('0x9')](realtime[_0xe3f1('0xc')]())['then'](openchannelQueue[_0xe3f1('0xd')]())['then'](realtime[_0xe3f1('0xe')]())['then'](chatQueue[_0xe3f1('0xf')]())[_0xe3f1('0x9')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0xe3f1('0x9')](realtime[_0xe3f1('0x10')]())[_0xe3f1('0x9')](mailQueue['getMailQueues']())['then'](realtime[_0xe3f1('0x11')]())['then'](faxQueue[_0xe3f1('0x12')]())[_0xe3f1('0x9')](realtime[_0xe3f1('0x13')]())[_0xe3f1('0x9')](whatsappQueue[_0xe3f1('0x14')]())[_0xe3f1('0x9')](realtime['initWhatsappQueues']())[_0xe3f1('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xe3f1('0x9')](function(_0x2b689d){return initRealtime();})[_0xe3f1('0x9')](function(_0x32828e){return setInterval(initRealtime,0x1388);})[_0xe3f1('0x15')](function(_0x4da1d9){console[_0xe3f1('0x16')](_0x4da1d9);});}main(); \ No newline at end of file +var _0xffdd=['getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','listen','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then'];(function(_0x492a1f,_0x57a0f0){var _0x468f9e=function(_0x37726e){while(--_0x37726e){_0x492a1f['push'](_0x492a1f['shift']());}};_0x468f9e(++_0x57a0f0);}(_0xffdd,0x1d0));var _0xdffd=function(_0x79c30f,_0x3cdeac){_0x79c30f=_0x79c30f-0x0;var _0x56695d=_0xffdd[_0x79c30f];return _0x56695d;};'use strict';var BPromise=require(_0xdffd('0x0'));var server=require(_0xdffd('0x1'));var Realtime=require(_0xdffd('0x2'));var user=require(_0xdffd('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xdffd('0x4'));var chatQueue=require(_0xdffd('0x5'));var smsQueue=require(_0xdffd('0x6'));var mailQueue=require(_0xdffd('0x7'));var faxQueue=require(_0xdffd('0x8'));var whatsappQueue=require(_0xdffd('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xdffd('0xa')](user[_0xdffd('0xb')]())['then'](realtime[_0xdffd('0xc')]())[_0xdffd('0xa')](interval[_0xdffd('0xd')]())[_0xdffd('0xa')](realtime[_0xdffd('0xe')]())[_0xdffd('0xa')](openchannelQueue['getOpenchannelQueues']())[_0xdffd('0xa')](realtime[_0xdffd('0xf')]())[_0xdffd('0xa')](chatQueue['getChatQueues']())[_0xdffd('0xa')](realtime[_0xdffd('0x10')]())[_0xdffd('0xa')](smsQueue[_0xdffd('0x11')]())[_0xdffd('0xa')](realtime[_0xdffd('0x12')]())[_0xdffd('0xa')](mailQueue[_0xdffd('0x13')]())[_0xdffd('0xa')](realtime[_0xdffd('0x14')]())[_0xdffd('0xa')](faxQueue[_0xdffd('0x15')]())[_0xdffd('0xa')](realtime[_0xdffd('0x16')]())[_0xdffd('0xa')](whatsappQueue['getWhatsappQueues']())[_0xdffd('0xa')](realtime['initWhatsappQueues']())[_0xdffd('0xa')](function(){return realtime;});}function main(){return server[_0xdffd('0x17')](realtime)[_0xdffd('0xa')](function(_0x5001bd){return initRealtime();})[_0xdffd('0xa')](function(_0x173cad){return setInterval(initRealtime,0x1388);})['catch'](function(_0x407be5){console[_0xdffd('0x18')](_0x407be5);});}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 bf108a7..d2118f0 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 _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(_0x1265d8,_0x532302){var _0x938754=function(_0x345a94){while(--_0x345a94){_0x1265d8['push'](_0x1265d8['shift']());}};_0x938754(++_0x532302);}(_0xe14b,0x93));var _0xbe14=function(_0x514054,_0x1025eb){_0x514054=_0x514054-0x0;var _0x5bc31c=_0xe14b[_0x514054];return _0x5bc31c;};'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 +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(_0x5d674c,_0x60116f){var _0x4a7822=function(_0x248668){while(--_0x248668){_0x5d674c['push'](_0x5d674c['shift']());}};_0x4a7822(++_0x60116f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 742b7fa..579d8e6 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 _0xdf3d=['error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then'];(function(_0x381c66,_0x5ba746){var _0x2f2c07=function(_0xfef46d){while(--_0xfef46d){_0x381c66['push'](_0x381c66['shift']());}};_0x2f2c07(++_0x5ba746);}(_0xdf3d,0xaf));var _0xddf3=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xdf3d[_0x30faec];return _0x29484f;};'use strict';var BPromise=require(_0xddf3('0x0'));var jayson=require(_0xddf3('0x1'));var client=jayson[_0xddf3('0x2')][_0xddf3('0x3')]({'port':0x232b});function request(_0x48c207,_0x48b602){return new BPromise(function(_0x29d8bd,_0x132876){return client['request'](_0x48c207,_0x48b602)[_0xddf3('0x4')](function(_0x2318c6){if(_0x2318c6[_0xddf3('0x5')]){return _0x132876(_0x2318c6[_0xddf3('0x5')][_0xddf3('0x6')]);}else{return _0x29d8bd(_0x2318c6['result']);}})[_0xddf3('0x7')](function(_0x482241){return _0x132876(_0x482241);});});}exports[_0xddf3('0x8')]=function(_0x1d3050,_0x2cf332){return request(_0xddf3('0x9'),{'account':_0x1d3050,'message':_0x2cf332});}; \ No newline at end of file +var _0x95b6=['catch','sendMailMessage','SendMail','jayson/promise','client','http','then','error','message','result'];(function(_0x109d84,_0x1b0211){var _0x4143cb=function(_0x21808c){while(--_0x21808c){_0x109d84['push'](_0x109d84['shift']());}};_0x4143cb(++_0x1b0211);}(_0x95b6,0x1d9));var _0x695b=function(_0x1e54fd,_0x58314b){_0x1e54fd=_0x1e54fd-0x0;var _0x3e3d32=_0x95b6[_0x1e54fd];return _0x3e3d32;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x695b('0x0'));var client=jayson[_0x695b('0x1')][_0x695b('0x2')]({'port':0x232b});function request(_0x1e8adc,_0x7d107b){return new BPromise(function(_0x48e932,_0x242195){return client['request'](_0x1e8adc,_0x7d107b)[_0x695b('0x3')](function(_0x166580){if(_0x166580[_0x695b('0x4')]){return _0x242195(_0x166580[_0x695b('0x4')][_0x695b('0x5')]);}else{return _0x48e932(_0x166580[_0x695b('0x6')]);}})[_0x695b('0x7')](function(_0x13a220){return _0x242195(_0x13a220);});});}exports[_0x695b('0x8')]=function(_0x51ddb2,_0x60b169){return request(_0x695b('0x9'),{'account':_0x51ddb2,'message':_0x60b169});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 223c848..14d9cfe 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 _0x0965=['online','faxStatusTime','openchannelCapacity','busy','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCurrentCapacity','busyQueue','md5','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime','mail','chat','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0965,0x138));var _0x5096=function(_0x45c0da,_0x2116ff){_0x45c0da=_0x45c0da-0x0;var _0x3527f0=_0x0965[_0x45c0da];return _0x3527f0;};'use strict';var _=require(_0x5096('0x0'));var moment=require(_0x5096('0x1'));var md5=require('md5');var Redis=require(_0x5096('0x2'));var config=require(_0x5096('0x3'));config[_0x5096('0x4')]=_[_0x5096('0x5')](config[_0x5096('0x4')],{'host':_0x5096('0x6'),'port':0x18eb});var io=require(_0x5096('0x7'))(new Redis(config[_0x5096('0x4')]));function Agent(_0x4ea518){this['id']=_0x4ea518['id']||0x0;this[_0x5096('0x8')]=_0x4ea518['name']||'';this['online']=_0x4ea518['online']||!![];this[_0x5096('0x9')]=_0x4ea518[_0x5096('0x9')]||![];this[_0x5096('0xa')]=_0x4ea518[_0x5096('0xa')]||![];this[_0x5096('0xb')]=_0x4ea518['mailPause']||![];this['faxPause']=_0x4ea518[_0x5096('0xc')]||![];this[_0x5096('0xd')]=_0x4ea518['smsPause']||![];this['openchannelPause']=_0x4ea518['openchannelPause']||![];this[_0x5096('0xe')]=_0x5096('0xf');this[_0x5096('0x10')]=0x0;this['chatCapacity']=_0x4ea518[_0x5096('0x11')]||0x0;this[_0x5096('0x12')]=0x0;this['mailStatus']=_0x5096('0xf');this[_0x5096('0x13')]=0x0;this[_0x5096('0x14')]=_0x4ea518[_0x5096('0x14')]||0x0;this[_0x5096('0x15')]=0x0;this[_0x5096('0x16')]=_0x5096('0xf');this['faxStatusTime']=0x0;this[_0x5096('0x17')]=_0x4ea518[_0x5096('0x17')]||0x0;this[_0x5096('0x18')]=0x0;this[_0x5096('0x19')]=_0x5096('0xf');this[_0x5096('0x1a')]=0x0;this['smsCapacity']=_0x4ea518[_0x5096('0x1b')]||0x0;this[_0x5096('0x1c')]=0x0;this[_0x5096('0x1d')]='unknown';this[_0x5096('0x1e')]=0x0;this[_0x5096('0x1f')]=_0x4ea518[_0x5096('0x1f')]||0x0;this[_0x5096('0x20')]=0x0;this[_0x5096('0x21')]=_0x5096('0xf');this[_0x5096('0x22')]=0x0;this['openchannelCapacity']=_0x4ea518['openchannelCapacity']||0x0;this[_0x5096('0x23')]=0x0;this['busy']=![];this[_0x5096('0x24')]=undefined;this[_0x5096('0x25')]='';this['updateRealtime']();}Agent[_0x5096('0x26')][_0x5096('0x27')]=function(_0x2110bd){if(this[_0x2110bd+_0x5096('0x28')]>0x0){if(this[_0x2110bd+_0x5096('0x29')]>0x0&&this[_0x2110bd+_0x5096('0x28')]>=this[_0x2110bd+_0x5096('0x29')]){return'maxcapacity';}else{return _0x5096('0x2a');}}else{return _0x5096('0x2b');}};Agent[_0x5096('0x26')][_0x5096('0x2c')]=function(){var _0x34c847=[_0x5096('0x2d'),_0x5096('0x2e'),_0x5096('0x2f'),'fax',_0x5096('0x30'),_0x5096('0x31')];for(var _0x1462eb=0x0;_0x1462eb<_0x34c847[_0x5096('0x32')];_0x1462eb+=0x1){var _0x569d6f=this['getChannelStatus'](_0x34c847[_0x1462eb]);if(this[_0x34c847[_0x1462eb]+_0x5096('0x33')]!==_0x569d6f){this[_0x34c847[_0x1462eb]+_0x5096('0x34')]=_[_0x5096('0x35')](moment()['format']('x'));}this[_0x34c847[_0x1462eb]+_0x5096('0x33')]=_0x569d6f;}var _0x160e06={'id':this['id'],'name':this[_0x5096('0x8')],'online':this[_0x5096('0x36')],'voicePause':this[_0x5096('0x9')],'chatPause':this[_0x5096('0xa')],'mailPause':this[_0x5096('0xb')],'smsPause':this[_0x5096('0xd')],'faxPause':this[_0x5096('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x5096('0xe')],'chatStatusTime':this[_0x5096('0x10')],'chatCapacity':this[_0x5096('0x11')],'chatCurrentCapacity':this[_0x5096('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x5096('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x5096('0x16')],'faxStatusTime':this[_0x5096('0x37')],'faxCapacity':this[_0x5096('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x5096('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x5096('0x1e')],'whatsappCapacity':this[_0x5096('0x1f')],'whatsappCurrentCapacity':this[_0x5096('0x20')],'openchannelStatus':this[_0x5096('0x21')],'openchannelStatusTime':this[_0x5096('0x22')],'openchannelCapacity':this[_0x5096('0x38')],'openchannelCurrentCapacity':this[_0x5096('0x23')],'busy':this[_0x5096('0x39')],'busyQueue':this[_0x5096('0x24')]};var _0x4b0826=md5(JSON['stringify'](_0x160e06));if(this[_0x5096('0x25')]!==_0x4b0826){this[_0x5096('0x25')]=_0x4b0826;io[_0x5096('0x3a')](_0x5096('0x3b'),_0x160e06);}};module[_0x5096('0x3c')]=Agent; \ No newline at end of file +var _0x25ee=['smsStatus','smsStatusTime','whatsappCurrentCapacity','openchannelStatus','stringify','lodash','moment','md5','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','unknown','faxStatusTime','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','mail','sms','length','Status','toNumber','format','chatCurrentCapacity','faxCapacity'];(function(_0x454e2c,_0x1e7186){var _0x4f8f75=function(_0x200c07){while(--_0x200c07){_0x454e2c['push'](_0x454e2c['shift']());}};_0x4f8f75(++_0x1e7186);}(_0x25ee,0x14f));var _0xe25e=function(_0x30d21d,_0x2962d1){_0x30d21d=_0x30d21d-0x0;var _0x29e9a8=_0x25ee[_0x30d21d];return _0x29e9a8;};'use strict';var _=require(_0xe25e('0x0'));var moment=require(_0xe25e('0x1'));var md5=require(_0xe25e('0x2'));var Redis=require('ioredis');var config=require(_0xe25e('0x3'));config['redis']=_['defaults'](config[_0xe25e('0x4')],{'host':_0xe25e('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe25e('0x4')]));function Agent(_0x23a026){this['id']=_0x23a026['id']||0x0;this[_0xe25e('0x6')]=_0x23a026[_0xe25e('0x6')]||'';this[_0xe25e('0x7')]=_0x23a026[_0xe25e('0x7')]||!![];this[_0xe25e('0x8')]=_0x23a026[_0xe25e('0x8')]||![];this['chatPause']=_0x23a026[_0xe25e('0x9')]||![];this['mailPause']=_0x23a026[_0xe25e('0xa')]||![];this[_0xe25e('0xb')]=_0x23a026[_0xe25e('0xb')]||![];this['smsPause']=_0x23a026[_0xe25e('0xc')]||![];this[_0xe25e('0xd')]=_0x23a026[_0xe25e('0xd')]||![];this[_0xe25e('0xe')]='unknown';this[_0xe25e('0xf')]=0x0;this[_0xe25e('0x10')]=_0x23a026[_0xe25e('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xe25e('0x11')]='unknown';this[_0xe25e('0x12')]=0x0;this[_0xe25e('0x13')]=_0x23a026[_0xe25e('0x13')]||0x0;this[_0xe25e('0x14')]=0x0;this[_0xe25e('0x15')]=_0xe25e('0x16');this[_0xe25e('0x17')]=0x0;this['faxCapacity']=_0x23a026['faxCapacity']||0x0;this[_0xe25e('0x18')]=0x0;this['smsStatus']=_0xe25e('0x16');this['smsStatusTime']=0x0;this['smsCapacity']=_0x23a026[_0xe25e('0x19')]||0x0;this[_0xe25e('0x1a')]=0x0;this[_0xe25e('0x1b')]=_0xe25e('0x16');this[_0xe25e('0x1c')]=0x0;this[_0xe25e('0x1d')]=_0x23a026[_0xe25e('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0xe25e('0x16');this[_0xe25e('0x1e')]=0x0;this[_0xe25e('0x1f')]=_0x23a026[_0xe25e('0x1f')]||0x0;this[_0xe25e('0x20')]=0x0;this[_0xe25e('0x21')]=![];this[_0xe25e('0x22')]=undefined;this[_0xe25e('0x2')]='';this['updateRealtime']();}Agent[_0xe25e('0x23')][_0xe25e('0x24')]=function(_0x4e3005){if(this[_0x4e3005+_0xe25e('0x25')]>0x0){if(this[_0x4e3005+_0xe25e('0x26')]>0x0&&this[_0x4e3005+'CurrentCapacity']>=this[_0x4e3005+_0xe25e('0x26')]){return _0xe25e('0x27');}else{return _0xe25e('0x28');}}else{return'idle';}};Agent['prototype'][_0xe25e('0x29')]=function(){var _0x42590d=[_0xe25e('0x2a'),'chat','openchannel','fax',_0xe25e('0x2b'),'whatsapp'];for(var _0x19c695=0x0;_0x19c695<_0x42590d[_0xe25e('0x2c')];_0x19c695+=0x1){var _0x226ee3=this['getChannelStatus'](_0x42590d[_0x19c695]);if(this[_0x42590d[_0x19c695]+_0xe25e('0x2d')]!==_0x226ee3){this[_0x42590d[_0x19c695]+'StatusTime']=_[_0xe25e('0x2e')](moment()[_0xe25e('0x2f')]('x'));}this[_0x42590d[_0x19c695]+_0xe25e('0x2d')]=_0x226ee3;}var _0x2206f4={'id':this['id'],'name':this[_0xe25e('0x6')],'online':this[_0xe25e('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0xe25e('0x9')],'mailPause':this[_0xe25e('0xa')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xe25e('0xd')],'chatStatus':this[_0xe25e('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xe25e('0x30')],'mailStatus':this[_0xe25e('0x11')],'mailStatusTime':this[_0xe25e('0x12')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xe25e('0x14')],'faxStatus':this[_0xe25e('0x15')],'faxStatusTime':this[_0xe25e('0x17')],'faxCapacity':this[_0xe25e('0x31')],'faxCurrentCapacity':this[_0xe25e('0x18')],'smsStatus':this[_0xe25e('0x32')],'smsStatusTime':this[_0xe25e('0x33')],'smsCapacity':this[_0xe25e('0x19')],'smsCurrentCapacity':this[_0xe25e('0x1a')],'whatsappStatus':this[_0xe25e('0x1b')],'whatsappStatusTime':this[_0xe25e('0x1c')],'whatsappCapacity':this[_0xe25e('0x1d')],'whatsappCurrentCapacity':this[_0xe25e('0x34')],'openchannelStatus':this[_0xe25e('0x35')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xe25e('0x20')],'busy':this[_0xe25e('0x21')],'busyQueue':this[_0xe25e('0x22')]};var _0x8c45ec=md5(JSON[_0xe25e('0x36')](_0x2206f4));if(this[_0xe25e('0x2')]!==_0x8c45ec){this[_0xe25e('0x2')]=_0x8c45ec;io['emit']('user:save',_0x2206f4);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 724c02a..d2995d4 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 _0x9279=['waiting','updateRouting','prototype','map','updateRealtime','loggedIn','paused','length','online','chatPause','available','format','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x3b0644,_0x4b9b40){var _0x3619a4=function(_0x25c412){while(--_0x25c412){_0x3b0644['push'](_0x3b0644['shift']());}};_0x3619a4(++_0x4b9b40);}(_0x9279,0x189));var _0x9927=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x9279[_0x6ca7f4];return _0x494fa6;};'use strict';var _=require(_0x9927('0x0'));var md5=require('md5');var util=require(_0x9927('0x1'));var Redis=require(_0x9927('0x2'));var config=require(_0x9927('0x3'));config[_0x9927('0x4')]=_[_0x9927('0x5')](config[_0x9927('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9927('0x6'))(new Redis(config[_0x9927('0x4')]));function ChatQueue(_0x1b02ce){this['id']=_0x1b02ce['id']||0x0;this['name']=_0x1b02ce[_0x9927('0x7')]||'';this[_0x9927('0x8')]=_0x1b02ce[_0x9927('0x8')]||0xa;this[_0x9927('0x9')]=_0x1b02ce[_0x9927('0x9')]||'beepall';this[_0x9927('0xa')]=_0x1b02ce[_0x9927('0xa')];this[_0x9927('0xb')]={};this[_0x9927('0xc')]=0x0;this['md5']='';this[_0x9927('0xd')]();this['updateRealtime']();}ChatQueue[_0x9927('0xe')][_0x9927('0xd')]=function(){var _0x1b1ae0=this[_0x9927('0xb')]['_rr'];this['mapAgentsId']=_[_0x9927('0xf')](this['Agents'],'id');this[_0x9927('0xb')]['_rr']=_0x1b1ae0;};ChatQueue[_0x9927('0xe')][_0x9927('0x10')]=function(){this[_0x9927('0x11')]=0x0;this[_0x9927('0x12')]=0x0;for(var _0x17160a=0x0;_0x17160a=0x0?this[_0x9927('0x16')]:0x0;var _0x50ad94={'id':this['id'],'available':this[_0x9927('0x16')],'loggedIn':this[_0x9927('0x11')],'name':this[_0x9927('0x7')],'paused':this[_0x9927('0x12')],'waiting':this[_0x9927('0xc')]};var _0x539b1e=md5(JSON['stringify'](_0x50ad94));if(this['md5']!==_0x539b1e){this['md5']=_0x539b1e;io['to'](util[_0x9927('0x17')]('chat:queue:%s',_0x50ad94[_0x9927('0x7')]))[_0x9927('0x18')](_0x9927('0x19'),_0x50ad94);}};module[_0x9927('0x1a')]=ChatQueue; \ No newline at end of file +var _0x203f=['md5','ioredis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','online','chatPause','paused','available','loggedIn','stringify','format','chat:queue:%s','emit','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x203f,0x133));var _0xf203=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x203f[_0x432682];return _0x463d05;};'use strict';var _=require(_0xf203('0x0'));var md5=require(_0xf203('0x1'));var util=require('util');var Redis=require(_0xf203('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xf203('0x3')](config['redis'],{'host':_0xf203('0x4'),'port':0x18eb});var io=require(_0xf203('0x5'))(new Redis(config['redis']));function ChatQueue(_0x4dbdaf){this['id']=_0x4dbdaf['id']||0x0;this[_0xf203('0x6')]=_0x4dbdaf['name']||'';this['timeout']=_0x4dbdaf[_0xf203('0x7')]||0xa;this[_0xf203('0x8')]=_0x4dbdaf[_0xf203('0x8')]||_0xf203('0x9');this[_0xf203('0xa')]=_0x4dbdaf[_0xf203('0xa')];this[_0xf203('0xb')]={};this[_0xf203('0xc')]=0x0;this[_0xf203('0x1')]='';this[_0xf203('0xd')]();this[_0xf203('0xe')]();}ChatQueue[_0xf203('0xf')][_0xf203('0xd')]=function(){var _0x87e6f7=this[_0xf203('0xb')][_0xf203('0x10')];this['mapAgentsId']=_[_0xf203('0x11')](this[_0xf203('0xa')],'id');this['mapAgentsId'][_0xf203('0x10')]=_0x87e6f7;};ChatQueue['prototype'][_0xf203('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x46b789=0x0;_0x46b789=0x0?this[_0xf203('0x15')]:0x0;var _0x286e42={'id':this['id'],'available':this[_0xf203('0x15')],'loggedIn':this[_0xf203('0x16')],'name':this[_0xf203('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x1c5ff6=md5(JSON[_0xf203('0x17')](_0x286e42));if(this['md5']!==_0x1c5ff6){this[_0xf203('0x1')]=_0x1c5ff6;io['to'](util[_0xf203('0x18')](_0xf203('0x19'),_0x286e42[_0xf203('0x6')]))[_0xf203('0x1a')]('chat_queue:save',_0x286e42);}};module[_0xf203('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 58f0228..21e563a 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 _0xaf23=['available','waiting','stringify','format','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','_rr','map','loggedIn','length','faxPause','paused'];(function(_0x4e170e,_0x207e58){var _0x338291=function(_0x4cb198){while(--_0x4cb198){_0x4e170e['push'](_0x4e170e['shift']());}};_0x338291(++_0x207e58);}(_0xaf23,0x73));var _0x3af2=function(_0x33cbd4,_0x1162b2){_0x33cbd4=_0x33cbd4-0x0;var _0x1ce746=_0xaf23[_0x33cbd4];return _0x1ce746;};'use strict';var _=require(_0x3af2('0x0'));var md5=require(_0x3af2('0x1'));var util=require(_0x3af2('0x2'));var Redis=require(_0x3af2('0x3'));var config=require(_0x3af2('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x3af2('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x34614e){this['id']=_0x34614e['id']||0x0;this[_0x3af2('0x6')]=_0x34614e['name']||'';this[_0x3af2('0x7')]=_0x34614e[_0x3af2('0x7')]||0xa;this[_0x3af2('0x8')]=_0x34614e[_0x3af2('0x8')]||_0x3af2('0x9');this[_0x3af2('0xa')]=_0x34614e[_0x3af2('0xa')];this[_0x3af2('0xb')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x3af2('0xc')]();}FaxQueue[_0x3af2('0xd')]['updateRouting']=function(){var _0x5669d9=this['mapAgentsId'][_0x3af2('0xe')];this['mapAgentsId']=_[_0x3af2('0xf')](this[_0x3af2('0xa')],'id');this['mapAgentsId'][_0x3af2('0xe')]=_0x5669d9;};FaxQueue['prototype'][_0x3af2('0xc')]=function(){this[_0x3af2('0x10')]=0x0;this['paused']=0x0;for(var _0x86d14b=0x0;_0x86d14b=0x0?this[_0x3af2('0x14')]:0x0;var _0x3142ad={'id':this['id'],'available':this[_0x3af2('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x3af2('0x6')],'paused':this[_0x3af2('0x13')],'waiting':this[_0x3af2('0x15')]};var _0x274e62=md5(JSON[_0x3af2('0x16')](_0x3142ad));if(this['md5']!==_0x274e62){this['md5']=_0x274e62;io['to'](util[_0x3af2('0x17')]('fax:queue:%s',_0x3142ad[_0x3af2('0x6')]))[_0x3af2('0x18')](_0x3af2('0x19'),_0x3142ad);}};module[_0x3af2('0x1a')]=FaxQueue; \ No newline at end of file +var _0x0ca5=['name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','faxPause','available','stringify','fax:queue:%s','fax_queue:save','lodash','md5','util','redis','socket.io-emitter'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x0ca5,0x1c3));var _0x50ca=function(_0x10346e,_0x1eb4d7){_0x10346e=_0x10346e-0x0;var _0x35f3a4=_0x0ca5[_0x10346e];return _0x35f3a4;};'use strict';var _=require(_0x50ca('0x0'));var md5=require(_0x50ca('0x1'));var util=require(_0x50ca('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x50ca('0x3')]=_['defaults'](config[_0x50ca('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x50ca('0x4'))(new Redis(config[_0x50ca('0x3')]));function FaxQueue(_0x3f6f69){this['id']=_0x3f6f69['id']||0x0;this[_0x50ca('0x5')]=_0x3f6f69[_0x50ca('0x5')]||'';this[_0x50ca('0x6')]=_0x3f6f69[_0x50ca('0x6')]||0xa;this[_0x50ca('0x7')]=_0x3f6f69[_0x50ca('0x7')]||'beepall';this[_0x50ca('0x8')]=_0x3f6f69[_0x50ca('0x8')];this[_0x50ca('0x9')]={};this[_0x50ca('0xa')]=0x0;this[_0x50ca('0x1')]='';this[_0x50ca('0xb')]();this[_0x50ca('0xc')]();}FaxQueue['prototype'][_0x50ca('0xb')]=function(){var _0x3b4a26=this[_0x50ca('0x9')][_0x50ca('0xd')];this[_0x50ca('0x9')]=_[_0x50ca('0xe')](this['Agents'],'id');this[_0x50ca('0x9')][_0x50ca('0xd')]=_0x3b4a26;};FaxQueue[_0x50ca('0xf')][_0x50ca('0xc')]=function(){this[_0x50ca('0x10')]=0x0;this[_0x50ca('0x11')]=0x0;for(var _0x338acf=0x0;_0x338acf=0x0?this[_0x50ca('0x14')]:0x0;var _0x4d5cbd={'id':this['id'],'available':this[_0x50ca('0x14')],'loggedIn':this[_0x50ca('0x10')],'name':this[_0x50ca('0x5')],'paused':this[_0x50ca('0x11')],'waiting':this['waiting']};var _0x2adf90=md5(JSON[_0x50ca('0x15')](_0x4d5cbd));if(this[_0x50ca('0x1')]!==_0x2adf90){this['md5']=_0x2adf90;io['to'](util['format'](_0x50ca('0x16'),_0x4d5cbd[_0x50ca('0x5')]))['emit'](_0x50ca('0x17'),_0x4d5cbd);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 91f044f..3edfd09 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 _0x1767=['Intervals','exports'];(function(_0x14eba8,_0x1b1b10){var _0x4ca2c5=function(_0x1758e7){while(--_0x1758e7){_0x14eba8['push'](_0x14eba8['shift']());}};_0x4ca2c5(++_0x1b1b10);}(_0x1767,0x1f2));var _0x7176=function(_0x4dca28,_0x2cd0f3){_0x4dca28=_0x4dca28-0x0;var _0x3841b1=_0x1767[_0x4dca28];return _0x3841b1;};'use strict';function Interval(_0x34ce23){this['id']=_0x34ce23['id']||0x0;this['name']=_0x34ce23['name']||'';this[_0x7176('0x0')]=_0x34ce23[_0x7176('0x0')]||{};}module[_0x7176('0x1')]=Interval; \ No newline at end of file +var _0x7420=['Intervals','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7420,0x75));var _0x0742=function(_0x5e5c7a,_0x396f09){_0x5e5c7a=_0x5e5c7a-0x0;var _0x526deb=_0x7420[_0x5e5c7a];return _0x526deb;};'use strict';function Interval(_0x58f57d){this['id']=_0x58f57d['id']||0x0;this[_0x0742('0x0')]=_0x58f57d[_0x0742('0x0')]||'';this['Intervals']=_0x58f57d[_0x0742('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index b20160a..6496a92 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 _0xf1ad=['available','name','stringify','format','mail:queue:%s','emit','lodash','md5','util','defaults','redis','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xf1ad,0x172));var _0xdf1a=function(_0x2abf58,_0x4613da){_0x2abf58=_0x2abf58-0x0;var _0x213b6c=_0xf1ad[_0x2abf58];return _0x213b6c;};'use strict';var _=require(_0xdf1a('0x0'));var md5=require(_0xdf1a('0x1'));var util=require(_0xdf1a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xdf1a('0x3')](config[_0xdf1a('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xdf1a('0x5'))(new Redis(config['redis']));function MailQueue(_0x461ce5){this['id']=_0x461ce5['id']||0x0;this['name']=_0x461ce5['name']||'';this[_0xdf1a('0x6')]=_0x461ce5['timeout']||0xa;this['strategy']=_0x461ce5[_0xdf1a('0x7')]||'beepall';this[_0xdf1a('0x8')]=_0x461ce5['Agents'];this[_0xdf1a('0x9')]={};this[_0xdf1a('0xa')]=0x0;this['md5']='';this['updateRouting']();this[_0xdf1a('0xb')]();}MailQueue[_0xdf1a('0xc')][_0xdf1a('0xd')]=function(){var _0x20c59b=this[_0xdf1a('0x9')][_0xdf1a('0xe')];this[_0xdf1a('0x9')]=_[_0xdf1a('0xf')](this['Agents'],'id');this[_0xdf1a('0x9')]['_rr']=_0x20c59b;};MailQueue[_0xdf1a('0xc')]['updateRealtime']=function(){this[_0xdf1a('0x10')]=0x0;this[_0xdf1a('0x11')]=0x0;for(var _0x5adeed=0x0;_0x5adeed=0x0?this[_0xdf1a('0x14')]:0x0;var _0x107158={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdf1a('0x10')],'name':this[_0xdf1a('0x15')],'paused':this['paused'],'waiting':this[_0xdf1a('0xa')]};var _0x19a3de=md5(JSON[_0xdf1a('0x16')](_0x107158));if(this['md5']!==_0x19a3de){this['md5']=_0x19a3de;io['to'](util[_0xdf1a('0x17')](_0xdf1a('0x18'),_0x107158['name']))[_0xdf1a('0x19')]('mail_queue:save',_0x107158);}};module['exports']=MailQueue; \ No newline at end of file +var _0x20b7=['redis','localhost','socket.io-emitter','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','paused','available','name','stringify','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults'];(function(_0x54000f,_0x2d395c){var _0x2c1314=function(_0x45cc87){while(--_0x45cc87){_0x54000f['push'](_0x54000f['shift']());}};_0x2c1314(++_0x2d395c);}(_0x20b7,0x6a));var _0x720b=function(_0x5e4b26,_0x13c190){_0x5e4b26=_0x5e4b26-0x0;var _0x19968e=_0x20b7[_0x5e4b26];return _0x19968e;};'use strict';var _=require(_0x720b('0x0'));var md5=require(_0x720b('0x1'));var util=require(_0x720b('0x2'));var Redis=require(_0x720b('0x3'));var config=require(_0x720b('0x4'));config['redis']=_[_0x720b('0x5')](config[_0x720b('0x6')],{'host':_0x720b('0x7'),'port':0x18eb});var io=require(_0x720b('0x8'))(new Redis(config['redis']));function MailQueue(_0x2e5a0a){this['id']=_0x2e5a0a['id']||0x0;this['name']=_0x2e5a0a['name']||'';this['timeout']=_0x2e5a0a[_0x720b('0x9')]||0xa;this[_0x720b('0xa')]=_0x2e5a0a[_0x720b('0xa')]||'beepall';this[_0x720b('0xb')]=_0x2e5a0a[_0x720b('0xb')];this['mapAgentsId']={};this[_0x720b('0xc')]=0x0;this[_0x720b('0x1')]='';this[_0x720b('0xd')]();this[_0x720b('0xe')]();}MailQueue[_0x720b('0xf')]['updateRouting']=function(){var _0x1d90c8=this[_0x720b('0x10')][_0x720b('0x11')];this[_0x720b('0x10')]=_[_0x720b('0x12')](this[_0x720b('0xb')],'id');this[_0x720b('0x10')][_0x720b('0x11')]=_0x1d90c8;};MailQueue[_0x720b('0xf')]['updateRealtime']=function(){this[_0x720b('0x13')]=0x0;this['paused']=0x0;for(var _0x3a1a95=0x0;_0x3a1a95=0x0?this['available']:0x0;var _0x108580={'id':this['id'],'available':this[_0x720b('0x17')],'loggedIn':this[_0x720b('0x13')],'name':this[_0x720b('0x18')],'paused':this[_0x720b('0x16')],'waiting':this[_0x720b('0xc')]};var _0x3ea357=md5(JSON[_0x720b('0x19')](_0x108580));if(this[_0x720b('0x1')]!==_0x3ea357){this[_0x720b('0x1')]=_0x3ea357;io['to'](util['format']('mail:queue:%s',_0x108580[_0x720b('0x18')]))[_0x720b('0x1a')](_0x720b('0x1b'),_0x108580);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 521492c..5a65494 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 _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 2f9ec00..c66d7cd 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 _0xf9f7=['md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','smsPause','available','paused','format','sms:queue:%s','emit','lodash'];(function(_0x5cd2c0,_0x459575){var _0x3e65f3=function(_0x24e6ca){while(--_0x24e6ca){_0x5cd2c0['push'](_0x5cd2c0['shift']());}};_0x3e65f3(++_0x459575);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x28fca4,_0x11e78b){_0x28fca4=_0x28fca4-0x0;var _0x42fd01=_0xf9f7[_0x28fca4];return _0x42fd01;};'use strict';var _=require(_0x7f9f('0x0'));var md5=require(_0x7f9f('0x1'));var util=require(_0x7f9f('0x2'));var Redis=require(_0x7f9f('0x3'));var config=require(_0x7f9f('0x4'));config[_0x7f9f('0x5')]=_['defaults'](config['redis'],{'host':_0x7f9f('0x6'),'port':0x18eb});var io=require(_0x7f9f('0x7'))(new Redis(config[_0x7f9f('0x5')]));function SmsQueue(_0xee790a){this['id']=_0xee790a['id']||0x0;this[_0x7f9f('0x8')]=_0xee790a[_0x7f9f('0x8')]||'';this['timeout']=_0xee790a[_0x7f9f('0x9')]||0xa;this[_0x7f9f('0xa')]=_0xee790a[_0x7f9f('0xa')]||_0x7f9f('0xb');this[_0x7f9f('0xc')]=_0xee790a['Agents'];this[_0x7f9f('0xd')]={};this[_0x7f9f('0xe')]=0x0;this[_0x7f9f('0x1')]='';this[_0x7f9f('0xf')]();this[_0x7f9f('0x10')]();}SmsQueue[_0x7f9f('0x11')][_0x7f9f('0xf')]=function(){var _0x4a2786=this[_0x7f9f('0xd')][_0x7f9f('0x12')];this['mapAgentsId']=_['map'](this[_0x7f9f('0xc')],'id');this['mapAgentsId'][_0x7f9f('0x12')]=_0x4a2786;};SmsQueue[_0x7f9f('0x11')]['updateRealtime']=function(){this[_0x7f9f('0x13')]=0x0;this['paused']=0x0;for(var _0x292470=0x0;_0x292470=0x0?this[_0x7f9f('0x17')]:0x0;var _0x2d663e={'id':this['id'],'available':this[_0x7f9f('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x7f9f('0x8')],'paused':this[_0x7f9f('0x18')],'waiting':this['waiting']};var _0x28621a=md5(JSON['stringify'](_0x2d663e));if(this[_0x7f9f('0x1')]!==_0x28621a){this[_0x7f9f('0x1')]=_0x28621a;io['to'](util[_0x7f9f('0x19')](_0x7f9f('0x1a'),_0x2d663e['name']))[_0x7f9f('0x1b')]('sms_queue:save',_0x2d663e);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x0a9a=['length','online','smsPause','paused','available','waiting','stringify','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','loggedIn'];(function(_0xa7bbed,_0x17c4c8){var _0x262934=function(_0x5a9a05){while(--_0x5a9a05){_0xa7bbed['push'](_0xa7bbed['shift']());}};_0x262934(++_0x17c4c8);}(_0x0a9a,0x183));var _0xa0a9=function(_0x4fe515,_0x3351b9){_0x4fe515=_0x4fe515-0x0;var _0xd6b66f=_0x0a9a[_0x4fe515];return _0xd6b66f;};'use strict';var _=require('lodash');var md5=require(_0xa0a9('0x0'));var util=require('util');var Redis=require(_0xa0a9('0x1'));var config=require(_0xa0a9('0x2'));config[_0xa0a9('0x3')]=_[_0xa0a9('0x4')](config['redis'],{'host':_0xa0a9('0x5'),'port':0x18eb});var io=require(_0xa0a9('0x6'))(new Redis(config['redis']));function SmsQueue(_0x425c3c){this['id']=_0x425c3c['id']||0x0;this[_0xa0a9('0x7')]=_0x425c3c[_0xa0a9('0x7')]||'';this[_0xa0a9('0x8')]=_0x425c3c['timeout']||0xa;this[_0xa0a9('0x9')]=_0x425c3c['strategy']||_0xa0a9('0xa');this[_0xa0a9('0xb')]=_0x425c3c[_0xa0a9('0xb')];this[_0xa0a9('0xc')]={};this['waiting']=0x0;this[_0xa0a9('0x0')]='';this[_0xa0a9('0xd')]();this['updateRealtime']();}SmsQueue['prototype'][_0xa0a9('0xd')]=function(){var _0x33f54f=this['mapAgentsId'][_0xa0a9('0xe')];this['mapAgentsId']=_[_0xa0a9('0xf')](this['Agents'],'id');this[_0xa0a9('0xc')][_0xa0a9('0xe')]=_0x33f54f;};SmsQueue[_0xa0a9('0x10')][_0xa0a9('0x11')]=function(){this[_0xa0a9('0x12')]=0x0;this['paused']=0x0;for(var _0x1f3f23=0x0;_0x1f3f23=0x0?this['available']:0x0;var _0x320735={'id':this['id'],'available':this[_0xa0a9('0x17')],'loggedIn':this[_0xa0a9('0x12')],'name':this[_0xa0a9('0x7')],'paused':this[_0xa0a9('0x16')],'waiting':this[_0xa0a9('0x18')]};var _0x5c82ed=md5(JSON[_0xa0a9('0x19')](_0x320735));if(this[_0xa0a9('0x0')]!==_0x5c82ed){this['md5']=_0x5c82ed;io['to'](util['format'](_0xa0a9('0x1a'),_0x320735[_0xa0a9('0x7')]))[_0xa0a9('0x1b')]('sms_queue:save',_0x320735);}};module[_0xa0a9('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index c87df11..2dc48ca 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 _0xd040=['ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','md5','format','whatsapp:queue:%s','emit','exports','lodash','util'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd040,0x1de));var _0x0d04=function(_0x4437c9,_0x4a4e1e){_0x4437c9=_0x4437c9-0x0;var _0x47285a=_0xd040[_0x4437c9];return _0x47285a;};'use strict';var _=require(_0x0d04('0x0'));var md5=require('md5');var util=require(_0x0d04('0x1'));var Redis=require(_0x0d04('0x2'));var config=require(_0x0d04('0x3'));config[_0x0d04('0x4')]=_[_0x0d04('0x5')](config[_0x0d04('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x0d04('0x6'))(new Redis(config[_0x0d04('0x4')]));function WhatsappQueue(_0x5d19ae){this['id']=_0x5d19ae['id']||0x0;this[_0x0d04('0x7')]=_0x5d19ae[_0x0d04('0x7')]||'';this[_0x0d04('0x8')]=_0x5d19ae[_0x0d04('0x8')]||0xa;this['strategy']=_0x5d19ae[_0x0d04('0x9')]||_0x0d04('0xa');this[_0x0d04('0xb')]=_0x5d19ae[_0x0d04('0xb')];this[_0x0d04('0xc')]={};this[_0x0d04('0xd')]=0x0;this['md5']='';this[_0x0d04('0xe')]();this[_0x0d04('0xf')]();}WhatsappQueue[_0x0d04('0x10')][_0x0d04('0xe')]=function(){var _0x2e72ce=this[_0x0d04('0xc')][_0x0d04('0x11')];this[_0x0d04('0xc')]=_[_0x0d04('0x12')](this[_0x0d04('0xb')],'id');this[_0x0d04('0xc')][_0x0d04('0x11')]=_0x2e72ce;};WhatsappQueue[_0x0d04('0x10')][_0x0d04('0xf')]=function(){this[_0x0d04('0x13')]=0x0;this[_0x0d04('0x14')]=0x0;for(var _0x14b0b1=0x0;_0x14b0b1=0x0?this['available']:0x0;var _0xc460ed={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0d04('0x13')],'name':this[_0x0d04('0x7')],'paused':this[_0x0d04('0x14')],'waiting':this[_0x0d04('0xd')]};var _0x20d008=md5(JSON['stringify'](_0xc460ed));if(this[_0x0d04('0x19')]!==_0x20d008){this[_0x0d04('0x19')]=_0x20d008;io['to'](util[_0x0d04('0x1a')](_0x0d04('0x1b'),_0xc460ed['name']))[_0x0d04('0x1c')]('whatsapp_queue:save',_0xc460ed);}};module[_0x0d04('0x1d')]=WhatsappQueue; \ No newline at end of file +var _0x09f2=['beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','whatsappPause','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy'];(function(_0x26a74d,_0x37ecfc){var _0xcbb1a3=function(_0x24b978){while(--_0x24b978){_0x26a74d['push'](_0x26a74d['shift']());}};_0xcbb1a3(++_0x37ecfc);}(_0x09f2,0x18b));var _0x209f=function(_0x48d021,_0x557b89){_0x48d021=_0x48d021-0x0;var _0x218446=_0x09f2[_0x48d021];return _0x218446;};'use strict';var _=require(_0x209f('0x0'));var md5=require(_0x209f('0x1'));var util=require(_0x209f('0x2'));var Redis=require(_0x209f('0x3'));var config=require(_0x209f('0x4'));config[_0x209f('0x5')]=_[_0x209f('0x6')](config[_0x209f('0x5')],{'host':_0x209f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x209f('0x5')]));function WhatsappQueue(_0x5e4c40){this['id']=_0x5e4c40['id']||0x0;this[_0x209f('0x8')]=_0x5e4c40[_0x209f('0x8')]||'';this[_0x209f('0x9')]=_0x5e4c40['timeout']||0xa;this[_0x209f('0xa')]=_0x5e4c40[_0x209f('0xa')]||_0x209f('0xb');this[_0x209f('0xc')]=_0x5e4c40[_0x209f('0xc')];this[_0x209f('0xd')]={};this[_0x209f('0xe')]=0x0;this[_0x209f('0x1')]='';this['updateRouting']();this[_0x209f('0xf')]();}WhatsappQueue[_0x209f('0x10')][_0x209f('0x11')]=function(){var _0x2908fd=this[_0x209f('0xd')][_0x209f('0x12')];this[_0x209f('0xd')]=_[_0x209f('0x13')](this[_0x209f('0xc')],'id');this[_0x209f('0xd')]['_rr']=_0x2908fd;};WhatsappQueue[_0x209f('0x10')]['updateRealtime']=function(){this[_0x209f('0x14')]=0x0;this[_0x209f('0x15')]=0x0;for(var _0xd5e7be=0x0;_0xd5e7be=0x0?this['available']:0x0;var _0x342e25={'id':this['id'],'available':this[_0x209f('0x18')],'loggedIn':this[_0x209f('0x14')],'name':this['name'],'paused':this[_0x209f('0x15')],'waiting':this['waiting']};var _0x893ca1=md5(JSON['stringify'](_0x342e25));if(this[_0x209f('0x1')]!==_0x893ca1){this[_0x209f('0x1')]=_0x893ca1;io['to'](util[_0x209f('0x19')](_0x209f('0x1a'),_0x342e25[_0x209f('0x8')]))[_0x209f('0x1b')](_0x209f('0x1c'),_0x342e25);}};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 a19847b..288b3c9 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _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(_0x34f73c,_0x1bceca){var _0x31a7e6=function(_0x39ed26){while(--_0x39ed26){_0x34f73c['push'](_0x34f73c['shift']());}};_0x31a7e6(++_0x1bceca);}(_0xb10b,0x12a));var _0xbb10=function(_0x203a81,_0x37aefa){_0x203a81=_0x203a81-0x0;var _0x5b45f8=_0xb10b[_0x203a81];return _0x5b45f8;};'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 diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 45a63f5..a65cb02 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 _0xebad=['update','Request','updateChatInteraction','AddTagsToChatInteraction'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0xebad,0x1c0));var _0xdeba=function(_0x1bfb7a,_0x3ce29a){_0x1bfb7a=_0x1bfb7a-0x0;var _0xaa58b3=_0xebad[_0x1bfb7a];return _0xaa58b3;};'use strict';var client=require('../client');exports[_0xdeba('0x0')]=function(_0x32b9f4,_0x29adf9){return client[_0xdeba('0x1')]('UpdateChatInteraction',{'body':_0x29adf9,'options':{'where':{'id':_0x32b9f4}},'log':_0xdeba('0x2')});};exports['addTags']=function(_0x3a6a0c,_0x1737e5){return client[_0xdeba('0x1')](_0xdeba('0x3'),{'body':_0x1737e5,'options':{'where':{'id':_0x3a6a0c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xa231=['addTags','AddTagsToChatInteraction','../client','Request','updateChatInteraction'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0xa231,0x101));var _0x1a23=function(_0x67b075,_0x43557d){_0x67b075=_0x67b075-0x0;var _0x39d030=_0xa231[_0x67b075];return _0x39d030;};'use strict';var client=require(_0x1a23('0x0'));exports['update']=function(_0x4669c5,_0x318d5d){return client[_0x1a23('0x1')]('UpdateChatInteraction',{'body':_0x318d5d,'options':{'where':{'id':_0x4669c5}},'log':_0x1a23('0x2')});};exports[_0x1a23('0x3')]=function(_0x3e5ad3,_0x5a657f){return client[_0x1a23('0x1')](_0x1a23('0x4'),{'body':_0x5a657f,'options':{'where':{'id':_0x3e5ad3}},'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 ac980a3..ebd93c8 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 _0x2624=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x31b7d2,_0x41b565){var _0x291429=function(_0x171e2f){while(--_0x171e2f){_0x31b7d2['push'](_0x31b7d2['shift']());}};_0x291429(++_0x41b565);}(_0x2624,0x146));var _0x4262=function(_0x5f23a4,_0x2475ca){_0x5f23a4=_0x5f23a4-0x0;var _0xf722b8=_0x2624[_0x5f23a4];return _0xf722b8;};'use strict';var client=require('../client');exports[_0x4262('0x0')]=function(_0x61ce58){return client[_0x4262('0x1')](_0x4262('0x2'),{'body':_0x61ce58,'log':_0x4262('0x3')});}; \ No newline at end of file +var _0x5a81=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x37d239,_0x9890dc){var _0x219891=function(_0xff7ebb){while(--_0xff7ebb){_0x37d239['push'](_0x37d239['shift']());}};_0x219891(++_0x9890dc);}(_0x5a81,0x1a7));var _0x15a8=function(_0x3f9625,_0x1dd78e){_0x3f9625=_0x3f9625-0x0;var _0x4d42f4=_0x5a81[_0x3f9625];return _0x4d42f4;};'use strict';var client=require('../client');exports[_0x15a8('0x0')]=function(_0x2b78df){return client[_0x15a8('0x1')](_0x15a8('0x2'),{'body':_0x2b78df,'log':_0x15a8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 54da70a..2aa395e 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 _0x0734=['User','Agents','../client','getChatQueues','Request','GetChatQueue','name','strategy'];(function(_0x4c99af,_0x2aaa93){var _0x523b3e=function(_0x3969ae){while(--_0x3969ae){_0x4c99af['push'](_0x4c99af['shift']());}};_0x523b3e(++_0x2aaa93);}(_0x0734,0xba));var _0x4073=function(_0x2dd378,_0x14f407){_0x2dd378=_0x2dd378-0x0;var _0x245dad=_0x0734[_0x2dd378];return _0x245dad;};'use strict';var client=require(_0x4073('0x0'));exports[_0x4073('0x1')]=function(){return function(){return client[_0x4073('0x2')](_0x4073('0x3'),{'options':{'raw':![],'attributes':['id',_0x4073('0x4'),'timeout',_0x4073('0x5')],'include':[{'model':_0x4073('0x6'),'as':_0x4073('0x7'),'attributes':['id',_0x4073('0x4'),'online','chatPause']}]},'log':_0x4073('0x1')});};}; \ No newline at end of file +var _0x99c9=['name','timeout','strategy','Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x5889df,_0x2583bc){var _0x1b85fb=function(_0x5ade77){while(--_0x5ade77){_0x5889df['push'](_0x5889df['shift']());}};_0x1b85fb(++_0x2583bc);}(_0x99c9,0x13c));var _0x999c=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x99c9[_0x4792c8];return _0x35edb1;};'use strict';var client=require(_0x999c('0x0'));exports[_0x999c('0x1')]=function(){return function(){return client[_0x999c('0x2')](_0x999c('0x3'),{'options':{'raw':![],'attributes':['id',_0x999c('0x4'),_0x999c('0x5'),_0x999c('0x6')],'include':[{'model':'User','as':_0x999c('0x7'),'attributes':['id',_0x999c('0x4'),_0x999c('0x8'),_0x999c('0x9')]}]},'log':_0x999c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d1fe264..282be5c 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 _0x25ad=['DESC','../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x25ad,0x1b1));var _0xd25a=function(_0xd46333,_0x1b05c1){_0xd46333=_0xd46333-0x0;var _0x336108=_0x25ad[_0xd46333];return _0x336108;};'use strict';var client=require(_0xd25a('0x0'));exports['create']=function(_0xa9ddeb){return client[_0xd25a('0x1')](_0xd25a('0x2'),{'body':_0xa9ddeb,'log':'CreateChatQueueReport'});};exports[_0xd25a('0x3')]=function(_0x3a67e3,_0x1532c5){return client[_0xd25a('0x1')](_0xd25a('0x4'),{'body':_0x1532c5,'options':{'where':{'uniqueid':_0x3a67e3},'order':[['id',_0xd25a('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xe77f=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0xe77f,0xba));var _0xfe77=function(_0x24701d,_0x4eb487){_0x24701d=_0x24701d-0x0;var _0xbb6acc=_0xe77f[_0x24701d];return _0xbb6acc;};'use strict';var client=require(_0xfe77('0x0'));exports[_0xfe77('0x1')]=function(_0x53bc15){return client[_0xfe77('0x2')](_0xfe77('0x3'),{'body':_0x53bc15,'log':'CreateChatQueueReport'});};exports[_0xfe77('0x4')]=function(_0xd99b0d,_0x55a414){return client[_0xfe77('0x2')](_0xfe77('0x5'),{'body':_0x55a414,'options':{'where':{'uniqueid':_0xd99b0d},'order':[['id',_0xfe77('0x6')]],'limit':0x1},'log':_0xfe77('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 7ae897a..8c392fc 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x7a54,0x106));var _0x47a5=function(_0x2243a4,_0x1ca978){_0x2243a4=_0x2243a4-0x0;var _0x312a58=_0x7a54[_0x2243a4];return _0x312a58;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x7a54,0x106));var _0x47a5=function(_0x42081f,_0x4a7349){_0x42081f=_0x42081f-0x0;var _0x2bc364=_0x7a54[_0x42081f];return _0x2bc364;};'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 973b341..95eb1c1 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 _0x3852=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x52efd7,_0x15a8b5){var _0x9e4abf=function(_0x220f19){while(--_0x220f19){_0x52efd7['push'](_0x52efd7['shift']());}};_0x9e4abf(++_0x15a8b5);}(_0x3852,0x122));var _0x2385=function(_0x5ed846,_0x104084){_0x5ed846=_0x5ed846-0x0;var _0x53ec9a=_0x3852[_0x5ed846];return _0x53ec9a;};'use strict';var client=require(_0x2385('0x0'));exports[_0x2385('0x1')]=function(_0x28ce55){return client[_0x2385('0x2')](_0x2385('0x3'),{'body':_0x28ce55,'log':_0x2385('0x4')});}; \ No newline at end of file +var _0x87cb=['CreateFaxMessage','../client','create','Request'];(function(_0x4acbc0,_0x3dbf47){var _0x182101=function(_0x2dc91d){while(--_0x2dc91d){_0x4acbc0['push'](_0x4acbc0['shift']());}};_0x182101(++_0x3dbf47);}(_0x87cb,0x189));var _0xb87c=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x87cb[_0x413feb];return _0x40ee88;};'use strict';var client=require(_0xb87c('0x0'));exports[_0xb87c('0x1')]=function(_0x34b677){return client[_0xb87c('0x2')](_0xb87c('0x3'),{'body':_0x34b677,'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 970d932..6904b89 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 _0x7246=['GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause','../client','getFaxQueues'];(function(_0x5479f4,_0x15d1a1){var _0xf9e092=function(_0x430fcf){while(--_0x430fcf){_0x5479f4['push'](_0x5479f4['shift']());}};_0xf9e092(++_0x15d1a1);}(_0x7246,0x17a));var _0x6724=function(_0x215ad8,_0x3e3ff8){_0x215ad8=_0x215ad8-0x0;var _0x584bd6=_0x7246[_0x215ad8];return _0x584bd6;};'use strict';var client=require(_0x6724('0x0'));exports[_0x6724('0x1')]=function(){return function(){return client['Request'](_0x6724('0x2'),{'options':{'raw':![],'attributes':['id',_0x6724('0x3'),_0x6724('0x4'),_0x6724('0x5')],'include':[{'model':_0x6724('0x6'),'as':_0x6724('0x7'),'attributes':['id','name',_0x6724('0x8'),_0x6724('0x9')]}]},'log':_0x6724('0x1')});};}; \ No newline at end of file +var _0x157d=['GetFaxQueue','name','User','online','faxPause','getFaxQueues','Request'];(function(_0x27923d,_0xa2c725){var _0x1911d3=function(_0x3de7c1){while(--_0x3de7c1){_0x27923d['push'](_0x27923d['shift']());}};_0x1911d3(++_0xa2c725);}(_0x157d,0xfb));var _0xd157=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x157d[_0x618414];return _0x21c19a;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0xd157('0x0')](_0xd157('0x1'),{'options':{'raw':![],'attributes':['id',_0xd157('0x2'),'timeout','strategy'],'include':[{'model':_0xd157('0x3'),'as':'Agents','attributes':['id',_0xd157('0x2'),_0xd157('0x4'),_0xd157('0x5')]}]},'log':_0xd157('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d0a6cc5..66b1517 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 _0x69ff=['DESC','UpdateFaxQueueReport','create','Request','CreateFaxQueueReport'];(function(_0x138dcb,_0x546857){var _0x2721d5=function(_0x1a3209){while(--_0x1a3209){_0x138dcb['push'](_0x138dcb['shift']());}};_0x2721d5(++_0x546857);}(_0x69ff,0x179));var _0xf69f=function(_0x67098f,_0x55e2d0){_0x67098f=_0x67098f-0x0;var _0x4cf120=_0x69ff[_0x67098f];return _0x4cf120;};'use strict';var client=require('../client');exports[_0xf69f('0x0')]=function(_0x50f3ea){return client[_0xf69f('0x1')](_0xf69f('0x2'),{'body':_0x50f3ea,'log':_0xf69f('0x2')});};exports['update']=function(_0x2e5515,_0x55e05d){return client['Request']('UpdateFaxQueueReport',{'body':_0x55e05d,'options':{'where':{'uniqueid':_0x2e5515},'order':[['id',_0xf69f('0x3')]],'limit':0x1},'log':_0xf69f('0x4')});}; \ No newline at end of file +var _0x97cd=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0xe9b6f1,_0x53a733){var _0x107a44=function(_0x55b639){while(--_0x55b639){_0xe9b6f1['push'](_0xe9b6f1['shift']());}};_0x107a44(++_0x53a733);}(_0x97cd,0x1e9));var _0xd97c=function(_0x1c67ab,_0x34a01f){_0x1c67ab=_0x1c67ab-0x0;var _0x15108e=_0x97cd[_0x1c67ab];return _0x15108e;};'use strict';var client=require(_0xd97c('0x0'));exports[_0xd97c('0x1')]=function(_0x28586c){return client[_0xd97c('0x2')](_0xd97c('0x3'),{'body':_0x28586c,'log':_0xd97c('0x3')});};exports[_0xd97c('0x4')]=function(_0x1fdefe,_0x3ff7c0){return client[_0xd97c('0x2')](_0xd97c('0x5'),{'body':_0x3ff7c0,'options':{'where':{'uniqueid':_0x1fdefe},'order':[['id',_0xd97c('0x6')]],'limit':0x1},'log':_0xd97c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 6db1e77..855ac91 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 _0x0952=['Intervals','getIntervals','../client','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0952,0x7e));var _0x2095=function(_0x234270,_0x3d222e){_0x234270=_0x234270-0x0;var _0x307be0=_0x0952[_0x234270];return _0x307be0;};'use strict';var client=require(_0x2095('0x0'));exports['getIntervals']=function(){return function(){return client[_0x2095('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x2095('0x2'),'attributes':['id','name','interval']}]},'log':_0x2095('0x3')});};}; \ No newline at end of file +var _0x95b0=['Intervals','interval','../client','getIntervals','Request','GetInterval','Interval'];(function(_0x3f7322,_0x12a337){var _0x2aea13=function(_0x2ed3ac){while(--_0x2ed3ac){_0x3f7322['push'](_0x3f7322['shift']());}};_0x2aea13(++_0x12a337);}(_0x95b0,0xdb));var _0x095b=function(_0x550b53,_0x1282fc){_0x550b53=_0x550b53-0x0;var _0x4309b4=_0x95b0[_0x550b53];return _0x4309b4;};'use strict';var client=require(_0x095b('0x0'));exports[_0x095b('0x1')]=function(){return function(){return client[_0x095b('0x2')](_0x095b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x095b('0x4'),'as':_0x095b('0x5'),'attributes':['id','name',_0x095b('0x6')]}]},'log':_0x095b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 42019d4..c84928a 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 _0x1c7c=['update','UpdateMailInteraction','addTags','Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x1c7c,0x164));var _0xc1c7=function(_0x368a2e,_0xf7b377){_0x368a2e=_0x368a2e-0x0;var _0x157130=_0x1c7c[_0x368a2e];return _0x157130;};'use strict';var client=require(_0xc1c7('0x0'));exports[_0xc1c7('0x1')]=function(_0x38fc99,_0x3a93f0){return client['Request'](_0xc1c7('0x2'),{'body':_0x3a93f0,'options':{'where':{'id':_0x38fc99}},'log':'updateMailInteraction'});};exports[_0xc1c7('0x3')]=function(_0x20dad3,_0xbb9da0){return client[_0xc1c7('0x4')](_0xc1c7('0x5'),{'body':_0xbb9da0,'options':{'where':{'id':_0x20dad3}},'log':_0xc1c7('0x6')});}; \ No newline at end of file +var _0xb44a=['AddTagsToMailInteraction','addTagsToChatInteraction','Request','addTags'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xb44a,0x1c2));var _0xab44=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0xb44a[_0x5c2e5e];return _0x46a5da;};'use strict';var client=require('../client');exports['update']=function(_0x93bb2f,_0x492c1a){return client[_0xab44('0x0')]('UpdateMailInteraction',{'body':_0x492c1a,'options':{'where':{'id':_0x93bb2f}},'log':'updateMailInteraction'});};exports[_0xab44('0x1')]=function(_0x5c93b4,_0x1b9e05){return client[_0xab44('0x0')](_0xab44('0x2'),{'body':_0x1b9e05,'options':{'where':{'id':_0x5c93b4}},'log':_0xab44('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index f3ef9a7..b44387a 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 _0x30a7=['create','Request','CreateMailMessage','createMailMessage'];(function(_0x43f9fc,_0x2f4a2b){var _0x16174f=function(_0x24ea56){while(--_0x24ea56){_0x43f9fc['push'](_0x43f9fc['shift']());}};_0x16174f(++_0x2f4a2b);}(_0x30a7,0x6c));var _0x730a=function(_0x4f285a,_0x4870b7){_0x4f285a=_0x4f285a-0x0;var _0xef0abb=_0x30a7[_0x4f285a];return _0xef0abb;};'use strict';var client=require('../client');exports[_0x730a('0x0')]=function(_0x348c9f){return client[_0x730a('0x1')](_0x730a('0x2'),{'body':_0x348c9f,'log':_0x730a('0x3')});}; \ No newline at end of file +var _0x106f=['Request','../client','create'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x106f,0xee));var _0xf106=function(_0x559fcd,_0x4ecfd7){_0x559fcd=_0x559fcd-0x0;var _0x34832c=_0x106f[_0x559fcd];return _0x34832c;};'use strict';var client=require(_0xf106('0x0'));exports[_0xf106('0x1')]=function(_0x4fdf15){return client[_0xf106('0x2')]('CreateMailMessage',{'body':_0x4fdf15,'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 566bf38..da7f928 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 _0x27f3=['mailPause','../client','getMailQueues','GetMailQueue','name','strategy','Agents','online'];(function(_0x5eb6e6,_0x17f551){var _0x35c38b=function(_0xa3592){while(--_0xa3592){_0x5eb6e6['push'](_0x5eb6e6['shift']());}};_0x35c38b(++_0x17f551);}(_0x27f3,0x1e9));var _0x327f=function(_0x5cbace,_0x33943c){_0x5cbace=_0x5cbace-0x0;var _0x6de5b8=_0x27f3[_0x5cbace];return _0x6de5b8;};'use strict';var client=require(_0x327f('0x0'));exports[_0x327f('0x1')]=function(){return function(){return client['Request'](_0x327f('0x2'),{'options':{'raw':![],'attributes':['id',_0x327f('0x3'),'timeout',_0x327f('0x4')],'include':[{'model':'User','as':_0x327f('0x5'),'attributes':['id',_0x327f('0x3'),_0x327f('0x6'),_0x327f('0x7')]}]},'log':_0x327f('0x1')});};}; \ No newline at end of file +var _0x053d=['GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','getMailQueues','Request'];(function(_0x38bf26,_0x575cf8){var _0x31d6d7=function(_0xdf27a8){while(--_0xdf27a8){_0x38bf26['push'](_0x38bf26['shift']());}};_0x31d6d7(++_0x575cf8);}(_0x053d,0x15c));var _0xd053=function(_0x3c573b,_0x2ce88a){_0x3c573b=_0x3c573b-0x0;var _0x49ce20=_0x053d[_0x3c573b];return _0x49ce20;};'use strict';var client=require('../client');exports[_0xd053('0x0')]=function(){return function(){return client[_0xd053('0x1')](_0xd053('0x2'),{'options':{'raw':![],'attributes':['id',_0xd053('0x3'),_0xd053('0x4'),_0xd053('0x5')],'include':[{'model':_0xd053('0x6'),'as':_0xd053('0x7'),'attributes':['id',_0xd053('0x3'),_0xd053('0x8'),_0xd053('0x9')]}]},'log':_0xd053('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 901e66e..6200f73 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 _0x42ab=['UpdateMailQueueReport','../client','create','CreateMailQueueReport','update'];(function(_0x4fbc07,_0x57ea3b){var _0x1482de=function(_0x1f1df5){while(--_0x1f1df5){_0x4fbc07['push'](_0x4fbc07['shift']());}};_0x1482de(++_0x57ea3b);}(_0x42ab,0x97));var _0xb42a=function(_0x78db5e,_0x3b9804){_0x78db5e=_0x78db5e-0x0;var _0x250b88=_0x42ab[_0x78db5e];return _0x250b88;};'use strict';var client=require(_0xb42a('0x0'));exports[_0xb42a('0x1')]=function(_0x131033){return client['Request'](_0xb42a('0x2'),{'body':_0x131033,'log':'CreateMailQueueReport'});};exports[_0xb42a('0x3')]=function(_0x5c5ce2,_0x15fe90){return client['Request'](_0xb42a('0x4'),{'body':_0x15fe90,'options':{'where':{'uniqueid':_0x5c5ce2},'order':[['id','DESC']],'limit':0x1},'log':_0xb42a('0x4')});}; \ No newline at end of file +var _0x28fa=['UpdateMailQueueReport','DESC','create','Request','update'];(function(_0x42fa1a,_0x2ee289){var _0x3da4bd=function(_0x5d4238){while(--_0x5d4238){_0x42fa1a['push'](_0x42fa1a['shift']());}};_0x3da4bd(++_0x2ee289);}(_0x28fa,0x1ba));var _0xa28f=function(_0x217c6d,_0x4d207b){_0x217c6d=_0x217c6d-0x0;var _0x3c7828=_0x28fa[_0x217c6d];return _0x3c7828;};'use strict';var client=require('../client');exports[_0xa28f('0x0')]=function(_0x27a84b){return client[_0xa28f('0x1')]('CreateMailQueueReport',{'body':_0x27a84b,'log':'CreateMailQueueReport'});};exports[_0xa28f('0x2')]=function(_0x51801e,_0x55bddf){return client[_0xa28f('0x1')](_0xa28f('0x3'),{'body':_0x55bddf,'options':{'where':{'uniqueid':_0x51801e},'order':[['id',_0xa28f('0x4')]],'limit':0x1},'log':_0xa28f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index e082982..e543aac 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 _0x53f8=['updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','../client'];(function(_0x1f0220,_0x2567cd){var _0x34a6b5=function(_0x10f5d1){while(--_0x10f5d1){_0x1f0220['push'](_0x1f0220['shift']());}};_0x34a6b5(++_0x2567cd);}(_0x53f8,0x176));var _0x853f=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x53f8[_0x125ff8];return _0x2d9ef;};'use strict';var client=require(_0x853f('0x0'));exports['update']=function(_0x4bbb1f,_0x3c4d9e){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x3c4d9e,'options':{'where':{'id':_0x4bbb1f}},'log':_0x853f('0x1')});};exports[_0x853f('0x2')]=function(_0x474c1c,_0x259f0d){return client[_0x853f('0x3')](_0x853f('0x4'),{'body':_0x259f0d,'options':{'where':{'id':_0x474c1c}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x8812=['Request','../client','updateOpenchannelInteraction','addTags'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x8812,0x149));var _0x2881=function(_0x1149c4,_0xcecf28){_0x1149c4=_0x1149c4-0x0;var _0xac8165=_0x8812[_0x1149c4];return _0xac8165;};'use strict';var client=require(_0x2881('0x0'));exports['update']=function(_0xa22d04,_0x527f21){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x527f21,'options':{'where':{'id':_0xa22d04}},'log':_0x2881('0x1')});};exports[_0x2881('0x2')]=function(_0x572103,_0x3505b1){return client[_0x2881('0x3')]('AddTagsToOpenchannelInteraction',{'body':_0x3505b1,'options':{'where':{'id':_0x572103}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d1b1439..f61627f 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 _0x5bc4=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x21d3fe,_0x290cc9){var _0x5e0da8=function(_0x371e02){while(--_0x371e02){_0x21d3fe['push'](_0x21d3fe['shift']());}};_0x5e0da8(++_0x290cc9);}(_0x5bc4,0xb2));var _0x45bc=function(_0x265d35,_0x5899a8){_0x265d35=_0x265d35-0x0;var _0xc677e1=_0x5bc4[_0x265d35];return _0xc677e1;};'use strict';var client=require(_0x45bc('0x0'));exports[_0x45bc('0x1')]=function(_0x4e25c1){return client[_0x45bc('0x2')](_0x45bc('0x3'),{'body':_0x4e25c1,'log':_0x45bc('0x4')});}; \ No newline at end of file +var _0xbe70=['create','Request','CreateOpenchannelMessage'];(function(_0x1dbe2b,_0x237a5c){var _0x513143=function(_0x1d87b9){while(--_0x1d87b9){_0x1dbe2b['push'](_0x1dbe2b['shift']());}};_0x513143(++_0x237a5c);}(_0xbe70,0x174));var _0x0be7=function(_0x534d96,_0x5289dd){_0x534d96=_0x534d96-0x0;var _0x402ac9=_0xbe70[_0x534d96];return _0x402ac9;};'use strict';var client=require('../client');exports[_0x0be7('0x0')]=function(_0x5c8c71){return client[_0x0be7('0x1')](_0x0be7('0x2'),{'body':_0x5c8c71,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 117de33..ce3b903 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 _0xe35f=['strategy','User','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','timeout'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0xe35f,0x140));var _0xfe35=function(_0x10b837,_0xce4bc4){_0x10b837=_0x10b837-0x0;var _0x1d3ba4=_0xe35f[_0x10b837];return _0x1d3ba4;};'use strict';var client=require(_0xfe35('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xfe35('0x1')](_0xfe35('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xfe35('0x3'),_0xfe35('0x4')],'include':[{'model':_0xfe35('0x5'),'as':'Agents','attributes':['id','name',_0xfe35('0x6'),_0xfe35('0x7')]}]},'log':_0xfe35('0x8')});};}; \ No newline at end of file +var _0x4e61=['Agents','name','online','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','User'];(function(_0x5c11ed,_0x3c892b){var _0xc9057e=function(_0x1d6a19){while(--_0x1d6a19){_0x5c11ed['push'](_0x5c11ed['shift']());}};_0xc9057e(++_0x3c892b);}(_0x4e61,0x1a4));var _0x14e6=function(_0x4fd82a,_0x29d9d5){_0x4fd82a=_0x4fd82a-0x0;var _0x21d2a8=_0x4e61[_0x4fd82a];return _0x21d2a8;};'use strict';var client=require(_0x14e6('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x14e6('0x1')](_0x14e6('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x14e6('0x3'),'as':_0x14e6('0x4'),'attributes':['id',_0x14e6('0x5'),_0x14e6('0x6'),'openchannelPause']}]},'log':_0x14e6('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7ee2ecf..3978d85 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 _0x0048=['DESC','../client','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x4998fe,_0x141671){var _0x1aefe9=function(_0x5d3718){while(--_0x5d3718){_0x4998fe['push'](_0x4998fe['shift']());}};_0x1aefe9(++_0x141671);}(_0x0048,0xba));var _0x8004=function(_0x34342a,_0x3e16f5){_0x34342a=_0x34342a-0x0;var _0x427cdf=_0x0048[_0x34342a];return _0x427cdf;};'use strict';var client=require(_0x8004('0x0'));exports['create']=function(_0x127966){return client['Request'](_0x8004('0x1'),{'body':_0x127966,'log':'CreateOpenchannelQueueReport'});};exports[_0x8004('0x2')]=function(_0x1e2054,_0x332b49){return client['Request'](_0x8004('0x3'),{'body':_0x332b49,'options':{'where':{'uniqueid':_0x1e2054},'order':[['id',_0x8004('0x4')]],'limit':0x1},'log':_0x8004('0x3')});}; \ No newline at end of file +var _0x915a=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x2623f7,_0x14a42a){var _0x5f4916=function(_0x245a01){while(--_0x245a01){_0x2623f7['push'](_0x2623f7['shift']());}};_0x5f4916(++_0x14a42a);}(_0x915a,0x1d2));var _0xa915=function(_0x529401,_0x68cf8e){_0x529401=_0x529401-0x0;var _0xdcaaa2=_0x915a[_0x529401];return _0xdcaaa2;};'use strict';var client=require(_0xa915('0x0'));exports[_0xa915('0x1')]=function(_0xace4e4){return client[_0xa915('0x2')](_0xa915('0x3'),{'body':_0xace4e4,'log':'CreateOpenchannelQueueReport'});};exports[_0xa915('0x4')]=function(_0x4f474d,_0x59bc2b){return client[_0xa915('0x2')](_0xa915('0x5'),{'body':_0x59bc2b,'options':{'where':{'uniqueid':_0x4f474d},'order':[['id',_0xa915('0x6')]],'limit':0x1},'log':_0xa915('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 4ed5883..0083934 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 _0xd13e=['UpdateSmsInteraction','addTags','Request','../client','update'];(function(_0x47948a,_0xbbc2e6){var _0x2d12da=function(_0x274e48){while(--_0x274e48){_0x47948a['push'](_0x47948a['shift']());}};_0x2d12da(++_0xbbc2e6);}(_0xd13e,0x193));var _0xed13=function(_0x5e460f,_0x2701a3){_0x5e460f=_0x5e460f-0x0;var _0x21a35a=_0xd13e[_0x5e460f];return _0x21a35a;};'use strict';var client=require(_0xed13('0x0'));exports[_0xed13('0x1')]=function(_0x726399,_0x32c6ee){return client['Request'](_0xed13('0x2'),{'body':_0x32c6ee,'options':{'where':{'id':_0x726399}},'log':'updateSmsInteraction'});};exports[_0xed13('0x3')]=function(_0x59d4db,_0x46158d){return client[_0xed13('0x4')]('AddTagsToSmsInteraction',{'body':_0x46158d,'options':{'where':{'id':_0x59d4db}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x6c32=['addTagsToSmsInteraction','../client','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x26c3('0x0'));exports['update']=function(_0x136fde,_0x523387){return client[_0x26c3('0x1')]('UpdateSmsInteraction',{'body':_0x523387,'options':{'where':{'id':_0x136fde}},'log':_0x26c3('0x2')});};exports[_0x26c3('0x3')]=function(_0x5e8a24,_0x4c2de2){return client[_0x26c3('0x1')](_0x26c3('0x4'),{'body':_0x4c2de2,'options':{'where':{'id':_0x5e8a24}},'log':_0x26c3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 103ec8f..79d316e 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 _0xd103=['../client','Request','CreateSmsMessage'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0xd103,0x1bf));var _0x3d10=function(_0x45f742,_0x11314d){_0x45f742=_0x45f742-0x0;var _0x192db1=_0xd103[_0x45f742];return _0x192db1;};'use strict';var client=require(_0x3d10('0x0'));exports['create']=function(_0x2511aa){return client[_0x3d10('0x1')](_0x3d10('0x2'),{'body':_0x2511aa,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xbfb1=['../client','create','Request'];(function(_0x197e72,_0x543bc6){var _0x3b4d0b=function(_0x1c1acd){while(--_0x1c1acd){_0x197e72['push'](_0x197e72['shift']());}};_0x3b4d0b(++_0x543bc6);}(_0xbfb1,0x14a));var _0x1bfb=function(_0x5628b8,_0x145582){_0x5628b8=_0x5628b8-0x0;var _0x3ce423=_0xbfb1[_0x5628b8];return _0x3ce423;};'use strict';var client=require(_0x1bfb('0x0'));exports[_0x1bfb('0x1')]=function(_0xfd2ede){return client[_0x1bfb('0x2')]('CreateSmsMessage',{'body':_0xfd2ede,'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 3d73369..8af3136 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x1615f3,_0x1b463a){var _0x544380=function(_0x358f13){while(--_0x358f13){_0x1615f3['push'](_0x1615f3['shift']());}};_0x544380(++_0x1b463a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index d92f67d..bbaaea7 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x40872c,_0x215df9){var _0x45d8fd=function(_0xbd4bbd){while(--_0xbd4bbd){_0x40872c['push'](_0x40872c['shift']());}};_0x45d8fd(++_0x215df9);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x29e871,_0x330b98){var _0x3380e3=function(_0x26eeae){while(--_0x26eeae){_0x29e871['push'](_0x29e871['shift']());}};_0x3380e3(++_0x330b98);}(_0x008c,0x188));var _0xc008=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0x008c[_0x3337b6];return _0x568270;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index b76dc42..4a260fc 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(_0x44ed23,_0x10932f){var _0x4db9f5=function(_0x5ba480){while(--_0x5ba480){_0x44ed23['push'](_0x44ed23['shift']());}};_0x4db9f5(++_0x10932f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x246a88,_0x5aff29){var _0xad78ee=function(_0x30b200){while(--_0x30b200){_0x246a88['push'](_0x246a88['shift']());}};_0xad78ee(++_0x5aff29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 4766ecb..a0bc1a8 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 _0xdf55=['Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf55,0x83));var _0x5df5=function(_0x1e45ec,_0x2e11eb){_0x1e45ec=_0x1e45ec-0x0;var _0x42f22d=_0xdf55[_0x1e45ec];return _0x42f22d;};'use strict';var client=require(_0x5df5('0x0'));exports[_0x5df5('0x1')]=function(_0x4d02f3,_0x20db42){return client[_0x5df5('0x2')]('UpdateWhatsappInteraction',{'body':_0x20db42,'options':{'where':{'id':_0x4d02f3}},'log':_0x5df5('0x3')});};exports[_0x5df5('0x4')]=function(_0x381a4c,_0x521007){return client[_0x5df5('0x2')](_0x5df5('0x5'),{'body':_0x521007,'options':{'where':{'id':_0x381a4c}},'log':_0x5df5('0x6')});}; \ No newline at end of file +var _0xdfa0=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x31285d,_0x28f6b7){var _0x308a9b=function(_0x251c75){while(--_0x251c75){_0x31285d['push'](_0x31285d['shift']());}};_0x308a9b(++_0x28f6b7);}(_0xdfa0,0x69));var _0x0dfa=function(_0x537450,_0x4742b5){_0x537450=_0x537450-0x0;var _0xf85940=_0xdfa0[_0x537450];return _0xf85940;};'use strict';var client=require(_0x0dfa('0x0'));exports['update']=function(_0x277084,_0x37ab88){return client['Request'](_0x0dfa('0x1'),{'body':_0x37ab88,'options':{'where':{'id':_0x277084}},'log':_0x0dfa('0x2')});};exports[_0x0dfa('0x3')]=function(_0x4dbbab,_0x373c4e){return client['Request'](_0x0dfa('0x4'),{'body':_0x373c4e,'options':{'where':{'id':_0x4dbbab}},'log':_0x0dfa('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 79a30e5..92ddca5 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 _0xfb37=['createWhatsappMessage','../client','CreateWhatsappMessage'];(function(_0x369c70,_0x5892f0){var _0xb7e463=function(_0x3822c8){while(--_0x3822c8){_0x369c70['push'](_0x369c70['shift']());}};_0xb7e463(++_0x5892f0);}(_0xfb37,0xf4));var _0x7fb3=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0xfb37[_0x4ab3fb];return _0x34fe1e;};'use strict';var client=require(_0x7fb3('0x0'));exports['create']=function(_0x2aa7e4){return client['Request'](_0x7fb3('0x1'),{'body':_0x2aa7e4,'log':_0x7fb3('0x2')});}; \ No newline at end of file +var _0xd485=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x4feaff,_0x8d5545){var _0xf7baa4=function(_0x2b7d3e){while(--_0x2b7d3e){_0x4feaff['push'](_0x4feaff['shift']());}};_0xf7baa4(++_0x8d5545);}(_0xd485,0xf8));var _0x5d48=function(_0x382384,_0xcd922){_0x382384=_0x382384-0x0;var _0x3c4b55=_0xd485[_0x382384];return _0x3c4b55;};'use strict';var client=require(_0x5d48('0x0'));exports[_0x5d48('0x1')]=function(_0x17fc85){return client[_0x5d48('0x2')](_0x5d48('0x3'),{'body':_0x17fc85,'log':_0x5d48('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 524a4ca..6f27089 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 _0x9920=['getWhatsappQueues','Request','name','whatsappPause'];(function(_0x4b7670,_0x59bdf7){var _0x58091f=function(_0x204d95){while(--_0x204d95){_0x4b7670['push'](_0x4b7670['shift']());}};_0x58091f(++_0x59bdf7);}(_0x9920,0x15c));var _0x0992=function(_0x26410e,_0x15cec9){_0x26410e=_0x26410e-0x0;var _0x153955=_0x9920[_0x26410e];return _0x153955;};'use strict';var client=require('../client');exports[_0x0992('0x0')]=function(){return function(){return client[_0x0992('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x0992('0x2'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x0992('0x2'),'online',_0x0992('0x3')]}]},'log':_0x0992('0x0')});};}; \ No newline at end of file +var _0x266c=['online','whatsappPause','../client','getWhatsappQueues','Request','timeout','strategy','Agents','name'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x266c,0xbf));var _0xc266=function(_0x46ef9b,_0x398f93){_0x46ef9b=_0x46ef9b-0x0;var _0x36b0a4=_0x266c[_0x46ef9b];return _0x36b0a4;};'use strict';var client=require(_0xc266('0x0'));exports[_0xc266('0x1')]=function(){return function(){return client[_0xc266('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0xc266('0x3'),_0xc266('0x4')],'include':[{'model':'User','as':_0xc266('0x5'),'attributes':['id',_0xc266('0x6'),_0xc266('0x7'),_0xc266('0x8')]}]},'log':_0xc266('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 76618c6..e9d6984 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 _0x8cc0=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x4f5f97,_0x47f53a){var _0x3e777d=function(_0x591991){while(--_0x591991){_0x4f5f97['push'](_0x4f5f97['shift']());}};_0x3e777d(++_0x47f53a);}(_0x8cc0,0xa3));var _0x08cc=function(_0x13b638,_0x28b31f){_0x13b638=_0x13b638-0x0;var _0x23cbd2=_0x8cc0[_0x13b638];return _0x23cbd2;};'use strict';var client=require(_0x08cc('0x0'));exports[_0x08cc('0x1')]=function(_0x3417fa){return client[_0x08cc('0x2')](_0x08cc('0x3'),{'body':_0x3417fa,'log':_0x08cc('0x3')});};exports[_0x08cc('0x4')]=function(_0x3499b0,_0x14e428){return client[_0x08cc('0x2')](_0x08cc('0x5'),{'body':_0x14e428,'options':{'where':{'uniqueid':_0x3499b0},'order':[['id',_0x08cc('0x6')]],'limit':0x1},'log':_0x08cc('0x5')});}; \ No newline at end of file +var _0xfec8=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x64a1fa,_0x2c3aa4){var _0x1c7896=function(_0x87fa6a){while(--_0x87fa6a){_0x64a1fa['push'](_0x64a1fa['shift']());}};_0x1c7896(++_0x2c3aa4);}(_0xfec8,0x186));var _0x8fec=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xfec8[_0x246148];return _0x453d94;};'use strict';var client=require(_0x8fec('0x0'));exports['create']=function(_0x3a8207){return client[_0x8fec('0x1')]('CreateWhatsappQueueReport',{'body':_0x3a8207,'log':_0x8fec('0x2')});};exports[_0x8fec('0x3')]=function(_0x4bf9e8,_0x250299){return client[_0x8fec('0x1')](_0x8fec('0x4'),{'body':_0x250299,'options':{'where':{'uniqueid':_0x4bf9e8},'order':[['id','DESC']],'limit':0x1},'log':_0x8fec('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 9975f19..4ed9648 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 _0xc258=['map','message','stop','find','atimeout','channel','format','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s'];(function(_0x498ef6,_0x1939c0){var _0x1d28d0=function(_0x41128a){while(--_0x41128a){_0x498ef6['push'](_0x498ef6['shift']());}};_0x1d28d0(++_0x1939c0);}(_0xc258,0x10d));var _0x8c25=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc258[_0x122ef9];return _0x42fba0;};'use strict';var schema=require(_0x8c25('0x0'));var _=require(_0x8c25('0x1'));var util=require(_0x8c25('0x2'));var seqqueue=require(_0x8c25('0x3'));var logger=require(_0x8c25('0x4'))(_0x8c25('0x5'));var strategy=require(_0x8c25('0x6'));var queue=schema({'name':{'type':_0x8c25('0x7'),'required':!![],'message':_0x8c25('0x8')},'timeout':{'type':_0x8c25('0x9'),'message':_0x8c25('0xa')}});function writeLog(_0x5beb23,_0x1e54c0,_0x2503b5){return logger[_0x8c25('0xb')](util['format'](_0x8c25('0xc'),_0x5beb23,_0x1e54c0['name'],_0x2503b5));}function handleFindAgent(_0xf9b996){return function(_0x400773){return _0x400773[_0x8c25('0xd')][_0x8c25('0xe')]()===_0xf9b996[_0x8c25('0xe')]();};}exports[_0x8c25('0xf')]=function(_0x1ef2b8,_0x8dd8a,_0x163d5c,_0x17be8e){return function(_0x10e74e){try{var _0x5e1e7d={'name':_0x8dd8a[0x0],'timeout':_0x8dd8a[0x1]};var _0x49d1b4=queue[_0x8c25('0x0')](_0x5e1e7d,{'typecast':!![]});if(_0x49d1b4[_0x8c25('0x10')]){logger[_0x8c25('0x11')](_0x8c25('0x12'),_0x1ef2b8,_[_0x8c25('0x13')](_0x49d1b4,_0x8c25('0x14'))['join'](',\x20'));_0x10e74e[_0x8c25('0x15')]();}else{var _0x570fe7=_[_0x8c25('0x16')](_0x163d5c['agents'],handleFindAgent(_0x5e1e7d['name']));if(_0x570fe7){var _0x33a385=(_0x5e1e7d['timeout']||0xa)*0x3e8;var _0x2320b1,_0x1f78f9;var _0x36daf1=seqqueue['createQueue'](_0x33a385);_0x36daf1['id']=_0x1ef2b8;_0x36daf1[_0x8c25('0x17')]=_0x33a385;_0x36daf1[_0x8c25('0x18')]=_0x17be8e[_0x8c25('0x18')];writeLog(_0x1ef2b8,_0x570fe7,util[_0x8c25('0x19')]('START:%s',_0x33a385));_0x163d5c[_0x8c25('0x1a')][_0x1ef2b8]['on'](_0x8c25('0x1b'),function(){logger[_0x8c25('0xb')](_0x8c25('0x1c'),_0x1ef2b8);clearTimeout(_0x1f78f9);_0x1f78f9=undefined;_0x36daf1[_0x8c25('0x1d')]();if(_0x163d5c['rules'][_0x1ef2b8]){delete _0x163d5c[_0x8c25('0x1a')][_0x1ef2b8];}_0x10e74e[_0x8c25('0x15')]();});_0x163d5c[_0x8c25('0x1a')][_0x1ef2b8]['on'](_0x8c25('0x1e'),function(){if(_0x163d5c[_0x8c25('0x1a')][_0x1ef2b8]){delete _0x163d5c['rules'][_0x1ef2b8];}});_0x1f78f9=setTimeout(function(){logger[_0x8c25('0xb')](_0x8c25('0x1f'),_0x1ef2b8);clearTimeout(_0x1f78f9);_0x36daf1['close']();_0x10e74e[_0x8c25('0x20')]();},_0x33a385);strategy[_0x8c25('0x21')](_0x36daf1,_0x570fe7,_0x163d5c,_0x17be8e);}else{logger[_0x8c25('0x11')](_0x8c25('0x22'),_0x1ef2b8,_0x5e1e7d[_0x8c25('0xd')]);_0x10e74e[_0x8c25('0x15')]();}}}catch(_0x4aae11){console[_0x8c25('0x23')](_0x4aae11);logger[_0x8c25('0x11')]('[%s][QUEUE]\x20%s',_0x1ef2b8,_0x4aae11['stack']);_0x10e74e[_0x8c25('0x15')]();}};}; \ No newline at end of file +var _0x0199=['agents','createQueue','channel','format','START:%s','end','rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','[%s][AGENT]\x20%s','map','message','join','find'];(function(_0x55291a,_0x814018){var _0x3c870c=function(_0x1fd787){while(--_0x1fd787){_0x55291a['push'](_0x55291a['shift']());}};_0x3c870c(++_0x814018);}(_0x0199,0x7a));var _0x9019=function(_0x5348f7,_0x5bb892){_0x5348f7=_0x5348f7-0x0;var _0xd10e84=_0x0199[_0x5348f7];return _0xd10e84;};'use strict';var schema=require(_0x9019('0x0'));var _=require(_0x9019('0x1'));var util=require(_0x9019('0x2'));var seqqueue=require('seq-queue');var logger=require(_0x9019('0x3'))(_0x9019('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x9019('0x5')},'timeout':{'type':_0x9019('0x6'),'message':_0x9019('0x7')}});function writeLog(_0x584898,_0x2d5d9e,_0x264712){return logger[_0x9019('0x8')](util['format'](_0x9019('0x9'),_0x584898,_0x2d5d9e[_0x9019('0xa')],_0x264712));}function handleFindAgent(_0x2d600d){return function(_0x27371a){return _0x27371a[_0x9019('0xa')]['toLowerCase']()===_0x2d600d[_0x9019('0xb')]();};}exports['consequence']=function(_0x8032ad,_0x2a2dd2,_0x325b35,_0x1df846){return function(_0x2a6824){try{var _0x42513d={'name':_0x2a2dd2[0x0],'timeout':_0x2a2dd2[0x1]};var _0x15d007=queue[_0x9019('0x0')](_0x42513d,{'typecast':!![]});if(_0x15d007[_0x9019('0xc')]){logger['error'](_0x9019('0xd'),_0x8032ad,_[_0x9019('0xe')](_0x15d007,_0x9019('0xf'))[_0x9019('0x10')](',\x20'));_0x2a6824['stop']();}else{var _0x2dcf50=_[_0x9019('0x11')](_0x325b35[_0x9019('0x12')],handleFindAgent(_0x42513d[_0x9019('0xa')]));if(_0x2dcf50){var _0x5c03af=(_0x42513d['timeout']||0xa)*0x3e8;var _0x1eff85,_0x28a9eb;var _0x833081=seqqueue[_0x9019('0x13')](_0x5c03af);_0x833081['id']=_0x8032ad;_0x833081['atimeout']=_0x5c03af;_0x833081[_0x9019('0x14')]=_0x1df846[_0x9019('0x14')];writeLog(_0x8032ad,_0x2dcf50,util[_0x9019('0x15')](_0x9019('0x16'),_0x5c03af));_0x325b35['rules'][_0x8032ad]['on'](_0x9019('0x17'),function(){logger[_0x9019('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x8032ad);clearTimeout(_0x28a9eb);_0x28a9eb=undefined;_0x833081['close']();if(_0x325b35[_0x9019('0x18')][_0x8032ad]){delete _0x325b35['rules'][_0x8032ad];}_0x2a6824[_0x9019('0x19')]();});_0x325b35[_0x9019('0x18')][_0x8032ad]['on'](_0x9019('0x1a'),function(){if(_0x325b35[_0x9019('0x18')][_0x8032ad]){delete _0x325b35['rules'][_0x8032ad];}});_0x28a9eb=setTimeout(function(){logger[_0x9019('0x8')](_0x9019('0x1b'),_0x8032ad);clearTimeout(_0x28a9eb);_0x833081[_0x9019('0x1c')]();_0x2a6824['next']();},_0x5c03af);strategy[_0x9019('0x1d')](_0x833081,_0x2dcf50,_0x325b35,_0x1df846);}else{logger[_0x9019('0x1e')](_0x9019('0x1f'),_0x8032ad,_0x42513d[_0x9019('0xa')]);_0x2a6824[_0x9019('0x19')]();}}}catch(_0x121cde){console[_0x9019('0x20')](_0x121cde);logger['error'](_0x9019('0x21'),_0x8032ad,_0x121cde[_0x9019('0x22')]);_0x2a6824[_0x9019('0x19')]();}};}; \ 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 8b2a285..dfda8cb 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 _0x5643=['sms','interaction','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','Message','info','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','postText','amazonlex','providerResponse','create','then','dialogState','Failed','stringify','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5643,0x13e));var _0x3564=function(_0x2dfec2,_0x5a87da){_0x2dfec2=_0x2dfec2-0x0;var _0x3ec083=_0x5643[_0x2dfec2];return _0x3ec083;};'use strict';var _=require(_0x3564('0x0'));var moment=require(_0x3564('0x1'));var AWS=require('aws-sdk');var utils=require(_0x3564('0x2'));var logger=require(_0x3564('0x3'))(_0x3564('0x4'));var rpc={'chatMessage':require(_0x3564('0x5')),'openchannelMessage':require(_0x3564('0x6')),'mailMessage':require(_0x3564('0x7')),'smsMessage':require(_0x3564('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3564('0x9')]=function(_0x49c74a,_0xe00e15){return function(_0x9d72d7){try{if(!_[_0x3564('0xa')](this['interaction'][_0x3564('0xb')])){logger['info'](_0x3564('0xc'),_0x49c74a,_0x3564('0xd'));return _0x9d72d7[_0x3564('0xe')]();}var _0x4f1e44={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x3564('0xf')),'direction':_0x3564('0x10')};if(this[_0x3564('0x11')]===_0x3564('0x12')||this[_0x3564('0x11')]==='whatsapp'){_0x4f1e44['phone']=this[_0x3564('0x13')][_0x3564('0x14')];}var _0x35acaa=this['channel'];if(_0x35acaa===_0x3564('0x15')){_0x4f1e44[_0x3564('0x16')]=this['account']['id'];}else{_0x4f1e44[_[_0x3564('0x17')](_0x35acaa)+_0x3564('0x18')]=this[_0x3564('0x19')]['id'];}_0x4f1e44[_['upperFirst'](_0x35acaa)+_0x3564('0x1a')]=this['interaction']['id'];if(this[_0x3564('0x13')][_0x3564('0x1b')]){var _0x1f61ac=_0xe00e15[0x4];if(!_[_0x3564('0x1c')](_0x1f61ac)){_0x4f1e44[_0x3564('0x1d')]=utils['getMustacheRender'](_0x1f61ac,this);return rpc[_0x35acaa+_0x3564('0x1e')]['create'](_0x4f1e44)['then'](function(_0x1b2c2c){logger[_0x3564('0x1f')](_0x3564('0xc'),_0x49c74a,_0x4f1e44['body']);})[_0x3564('0x20')](function(_0x21d414){logger[_0x3564('0x21')](_0x3564('0xc'),_0x49c74a,JSON['stringify'](_0x21d414));})[_0x3564('0x22')](function(){logger[_0x3564('0x1f')](_0x3564('0x23'),_0x49c74a);_0x9d72d7['stop']();});}else{logger[_0x3564('0x1f')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x49c74a);_0x9d72d7[_0x3564('0x24')]();}}else{var _0x21d1ef=this;var _0x571d4f=new AWS[(_0x3564('0x25'))]({'accessKeyId':_0xe00e15[0x0],'secretAccessKey':_0xe00e15[0x1],'region':_0xe00e15[0x2]});var _0xe9b790={'botAlias':_0x3564('0x26'),'botName':_0xe00e15[0x3],'inputText':this[_0x3564('0x27')][_0x3564('0x1d')],'userId':this[_0x3564('0x11')]+':'+this['interaction']['id']['toString']()};_0x571d4f[_0x3564('0x28')](_0xe9b790,function(_0x460245,_0x44dcab){if(_0x460245){logger[_0x3564('0x21')](_0x3564('0xc'),_0x49c74a,_0x460245[_0x3564('0x27')]);_0x9d72d7['next']();}else if(_0x44dcab&&_0x44dcab[_0x3564('0x27')]){_0x21d1ef[_0x3564('0x1d')][_0x3564('0x29')]=_0x44dcab;_0x4f1e44['body']=_0x44dcab['message'];_0x4f1e44['providerName']=_0x3564('0x29');_0x4f1e44[_0x3564('0x2a')]=JSON['stringify'](_0x44dcab);return rpc[_0x35acaa+_0x3564('0x1e')][_0x3564('0x2b')](_0x4f1e44)[_0x3564('0x2c')](function(_0x5a8da2){logger[_0x3564('0x1f')](_0x3564('0xc'),_0x49c74a,_0x4f1e44[_0x3564('0x1d')]);if(_0x44dcab[_0x3564('0x2d')]==_0x3564('0x2e')){_0x9d72d7[_0x3564('0xe')]();}else{_0x9d72d7[_0x3564('0x24')]();}})[_0x3564('0x20')](function(_0x5e89a5){logger['error'](_0x3564('0xc'),_0x49c74a,JSON[_0x3564('0x2f')](_0x5e89a5));_0x9d72d7['next']();});}else{_0x9d72d7['next']();}});}}catch(_0x5b0668){logger[_0x3564('0x21')]('[%s][AMAZONLEX]\x20%s',_0x49c74a,JSON[_0x3564('0x2f')](_0x5b0668));_0x9d72d7[_0x3564('0x24')]();}};}; \ No newline at end of file +var _0x0398=['InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','postText','message','amazonlex','providerResponse','stringify','dialogState','Failed','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0x10cdd8,_0x81edcb){var _0x15feb5=function(_0x5a2fff){while(--_0x5a2fff){_0x10cdd8['push'](_0x10cdd8['shift']());}};_0x15feb5(++_0x81edcb);}(_0x0398,0x1a6));var _0x8039=function(_0x18ac44,_0x5e525e){_0x18ac44=_0x18ac44-0x0;var _0x521d09=_0x0398[_0x18ac44];return _0x521d09;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0x8039('0x0'));var utils=require(_0x8039('0x1'));var logger=require(_0x8039('0x2'))(_0x8039('0x3'));var rpc={'chatMessage':require(_0x8039('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8039('0x5')),'smsMessage':require(_0x8039('0x6')),'faxMessage':require(_0x8039('0x7')),'whatsappMessage':require(_0x8039('0x8'))};exports['consequence']=function(_0x382486,_0x5e30d6){return function(_0x39ca6c){try{if(!_['isNil'](this[_0x8039('0x9')][_0x8039('0xa')])){logger[_0x8039('0xb')](_0x8039('0xc'),_0x382486,_0x8039('0xd'));return _0x39ca6c[_0x8039('0xe')]();}var _0x5a5b21={'ContactId':this[_0x8039('0xf')]['id'],'sentAt':moment()[_0x8039('0x10')](_0x8039('0x11')),'direction':_0x8039('0x12')};if(this[_0x8039('0x13')]===_0x8039('0x14')||this['channel']===_0x8039('0x15')){_0x5a5b21[_0x8039('0x16')]=this['interaction'][_0x8039('0x16')];}var _0x15ebec=this[_0x8039('0x13')];if(_0x15ebec===_0x8039('0x17')){_0x5a5b21[_0x8039('0x18')]=this[_0x8039('0x19')]['id'];}else{_0x5a5b21[_[_0x8039('0x1a')](_0x15ebec)+_0x8039('0x1b')]=this[_0x8039('0x19')]['id'];}_0x5a5b21[_[_0x8039('0x1a')](_0x15ebec)+_0x8039('0x1c')]=this[_0x8039('0x9')]['id'];if(this[_0x8039('0x9')][_0x8039('0x1d')]){var _0x57d730=_0x5e30d6[0x4];if(!_[_0x8039('0x1e')](_0x57d730)){_0x5a5b21[_0x8039('0x1f')]=utils[_0x8039('0x20')](_0x57d730,this);return rpc[_0x15ebec+_0x8039('0x21')][_0x8039('0x22')](_0x5a5b21)[_0x8039('0x23')](function(_0x4a317f){logger[_0x8039('0xb')](_0x8039('0xc'),_0x382486,_0x5a5b21[_0x8039('0x1f')]);})[_0x8039('0x24')](function(_0x18b860){logger[_0x8039('0x25')](_0x8039('0xc'),_0x382486,JSON['stringify'](_0x18b860));})[_0x8039('0x26')](function(){logger[_0x8039('0xb')](_0x8039('0x27'),_0x382486);_0x39ca6c[_0x8039('0x28')]();});}else{logger[_0x8039('0xb')](_0x8039('0x29'),_0x382486);_0x39ca6c[_0x8039('0x28')]();}}else{var _0x460a40=this;var _0x31ff47=new AWS['LexRuntime']({'accessKeyId':_0x5e30d6[0x0],'secretAccessKey':_0x5e30d6[0x1],'region':_0x5e30d6[0x2]});var _0x4b5b60={'botAlias':_0x8039('0x2a'),'botName':_0x5e30d6[0x3],'inputText':this['message'][_0x8039('0x1f')],'userId':this[_0x8039('0x13')]+':'+this['interaction']['id']['toString']()};_0x31ff47[_0x8039('0x2b')](_0x4b5b60,function(_0x22e7bd,_0x3fe9b3){if(_0x22e7bd){logger['error'](_0x8039('0xc'),_0x382486,_0x22e7bd[_0x8039('0x2c')]);_0x39ca6c[_0x8039('0xe')]();}else if(_0x3fe9b3&&_0x3fe9b3['message']){_0x460a40[_0x8039('0x1f')][_0x8039('0x2d')]=_0x3fe9b3;_0x5a5b21[_0x8039('0x1f')]=_0x3fe9b3['message'];_0x5a5b21['providerName']=_0x8039('0x2d');_0x5a5b21[_0x8039('0x2e')]=JSON[_0x8039('0x2f')](_0x3fe9b3);return rpc[_0x15ebec+'Message'][_0x8039('0x22')](_0x5a5b21)[_0x8039('0x23')](function(_0x5d3591){logger[_0x8039('0xb')]('[%s][AMAZONLEX]\x20%s',_0x382486,_0x5a5b21['body']);if(_0x3fe9b3[_0x8039('0x30')]==_0x8039('0x31')){_0x39ca6c[_0x8039('0xe')]();}else{_0x39ca6c[_0x8039('0x28')]();}})[_0x8039('0x24')](function(_0x370abc){logger[_0x8039('0x25')](_0x8039('0xc'),_0x382486,JSON[_0x8039('0x2f')](_0x370abc));_0x39ca6c[_0x8039('0xe')]();});}else{_0x39ca6c[_0x8039('0xe')]();}});}}catch(_0xfe607e){logger[_0x8039('0x25')](_0x8039('0xc'),_0x382486,JSON[_0x8039('0x2f')](_0xfe607e));_0x39ca6c[_0x8039('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 9e686e4..c51e30c 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 _0xdb74=['headers','All','auto_reply','[%s][AUTOREPLY]\x20SMTP\x20SENT','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','finally','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','created','interaction','info','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','inReplyTo','messageId','html','','replace',''];(function(_0xb6fb80,_0x192bba){var _0x35c922=function(_0x3e66b9){while(--_0x3e66b9){_0xb6fb80['push'](_0xb6fb80['shift']());}};_0x35c922(++_0x192bba);}(_0xdb74,0xe1));var _0x4db7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xdb74[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x4db7('0x0'));var moment=require('moment');var utils=require(_0x4db7('0x1'));var logger=require(_0x4db7('0x2'))(_0x4db7('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4db7('0x4')),'mailMessage':require(_0x4db7('0x5')),'smsMessage':require(_0x4db7('0x6')),'faxMessage':require(_0x4db7('0x7')),'whatsappMessage':require(_0x4db7('0x8')),'chatInteraction':require(_0x4db7('0x9')),'openchannelInteraction':require(_0x4db7('0xa')),'mailInteraction':require(_0x4db7('0xb')),'smsInteraction':require(_0x4db7('0xc')),'faxInteraction':require(_0x4db7('0xd')),'whatsappInteraction':require(_0x4db7('0xe'))};var mailRpc=require('../../mailRpc');exports[_0x4db7('0xf')]=function(_0x78719e,_0x9bfd38,_0x4605c1,_0x1cea64){return function(_0x3e153c){try{var _0x3b0b30=this[_0x4db7('0x10')];if(_0x3b0b30===_0x4db7('0x11')&&_0x1cea64[_0x4db7('0x12')][_0x4db7('0x13')]){logger['info'](_0x4db7('0x14'),_0x78719e,_0x4db7('0x15'));return _0x3e153c[_0x4db7('0x16')]();}if(_0x9bfd38[0x0]==='1'&&(_['isNil'](this['interaction'][_0x4db7('0x17')])||!this[_0x4db7('0x18')][_0x4db7('0x17')])){logger[_0x4db7('0x19')](_0x4db7('0x14'),_0x78719e,'Autoreply\x20already\x20sent');return _0x3e153c['next']();}if(_0x9bfd38[0x0]==='2'&&this[_0x4db7('0x18')][_0x4db7('0x1a')]){logger[_0x4db7('0x19')](_0x4db7('0x1b'),_0x78719e,_0x4db7('0x1c'));return _0x3e153c[_0x4db7('0x16')]();}var _0x13b0d9={'ContactId':this[_0x4db7('0x1d')]['id'],'sentAt':moment()[_0x4db7('0x1e')](_0x4db7('0x1f')),'direction':_0x4db7('0x20')};if(this[_0x4db7('0x10')]===_0x4db7('0x11')){_0x13b0d9[_0x4db7('0x12')]=utils[_0x4db7('0x21')](_0x9bfd38[0x2],this);}else{_0x13b0d9[_0x4db7('0x12')]=utils['getMustacheRender'](_0x9bfd38[0x1],this);}if(this['message']){_0x13b0d9['to']=this[_0x4db7('0x22')][_0x4db7('0x23')]||'';if(this[_0x4db7('0x10')]===_0x4db7('0x11')&&_0x9bfd38[0x1]==='1'){_0x13b0d9['cc']=this[_0x4db7('0x22')]['cc']||'';}_0x13b0d9[_0x4db7('0x23')]=this[_0x4db7('0x22')]['to']||'';_0x13b0d9[_0x4db7('0x24')]=this['message'][_0x4db7('0x24')]||'';_0x13b0d9[_0x4db7('0x25')]=!![];if(this[_0x4db7('0x22')]['subject']){_0x13b0d9[_0x4db7('0x26')]='';_0x13b0d9[_0x4db7('0x26')]+=_[_0x4db7('0x27')](this[_0x4db7('0x22')][_0x4db7('0x26')],_0x4db7('0x28'))?'':'Re:\x20';_0x13b0d9['subject']+=this['message']['subject'];}}if(this[_0x4db7('0x10')]==='chat'){_0x13b0d9[_0x4db7('0x29')]=this['account']['id'];}else{_0x13b0d9[_[_0x4db7('0x2a')](this[_0x4db7('0x10')])+_0x4db7('0x2b')]=this[_0x4db7('0x2c')]['id'];}_0x13b0d9[_[_0x4db7('0x2a')](this['channel'])+_0x4db7('0x2d')]=this[_0x4db7('0x18')]['id'];var _0x3eecfa=this[_0x4db7('0x18')];if(rpc[this[_0x4db7('0x10')]+_0x4db7('0x2e')]){if(this[_0x4db7('0x10')]===_0x4db7('0x11')){_0x13b0d9[_0x4db7('0x2f')]=this[_0x4db7('0x22')][_0x4db7('0x30')];_0x13b0d9[_0x4db7('0x31')]=_0x4db7('0x32')+_[_0x4db7('0x33')](_0x13b0d9[_0x4db7('0x12')],_0x4db7('0x34'),_0x4db7('0x35'))+_0x4db7('0x36');_0x13b0d9[_0x4db7('0x37')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x4db7('0x38'),'Precedence':_0x4db7('0x39')};return mailRpc['sendMailMessage'](this[_0x4db7('0x2c')]['smtpOptions'],_0x13b0d9)['then'](function(_0x5ac672){logger[_0x4db7('0x19')](_0x4db7('0x3a'),_0x78719e);_0x13b0d9[_0x4db7('0x30')]=_0x5ac672['message']['messageId'];return rpc[_0x3b0b30+_0x4db7('0x2e')]['create'](_0x13b0d9);})[_0x4db7('0x3b')](function(_0x33e371){logger['info'](_0x4db7('0x14'),_0x78719e,JSON[_0x4db7('0x3c')](_0x33e371));})['catch'](function(_0x25dc40){logger[_0x4db7('0x3d')](_0x4db7('0x3e'),_0x78719e,JSON[_0x4db7('0x3c')](_0x25dc40));})['finally'](function(){Promise[_0x4db7('0x3f')]()[_0x4db7('0x3b')](function(){if(_0x9bfd38[0x0]!=='2'||_0x3eecfa['autoreplyExecuted'])return;return rpc[_0x3b0b30+_0x4db7('0x40')]['update'](_0x3eecfa['id'],{'autoreplyExecuted':!![]})[_0x4db7('0x3b')](function(_0xbd322){logger[_0x4db7('0x19')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x78719e,JSON[_0x4db7('0x3c')](_0xbd322));})[_0x4db7('0x41')](function(_0x59bf64){logger['error'](_0x4db7('0x42'),_0x78719e,JSON[_0x4db7('0x3c')](_0x59bf64));});})[_0x4db7('0x3b')](function(){_0x3e153c['next']();});});}else{return rpc[this['channel']+_0x4db7('0x2e')][_0x4db7('0x43')](_0x13b0d9)[_0x4db7('0x3b')](function(){logger[_0x4db7('0x19')](_0x4db7('0x14'),_0x78719e,_0x13b0d9[_0x4db7('0x12')]);})['catch'](function(_0x4b3776){logger[_0x4db7('0x3d')]('[%s][AUTOREPLY]\x20%s',_0x78719e,JSON[_0x4db7('0x3c')](_0x4b3776));})[_0x4db7('0x44')](function(){Promise[_0x4db7('0x3f')]()[_0x4db7('0x3b')](function(){if(_0x9bfd38[0x0]!=='2'||_0x3eecfa[_0x4db7('0x1a')])return;return rpc[_0x3b0b30+_0x4db7('0x40')]['update'](_0x3eecfa['id'],{'autoreplyExecuted':!![]})[_0x4db7('0x3b')](function(_0x23a90b){logger[_0x4db7('0x19')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x78719e,JSON[_0x4db7('0x3c')](_0x23a90b));})['catch'](function(_0x35542f){logger[_0x4db7('0x3d')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x78719e,JSON[_0x4db7('0x3c')](_0x35542f));});})[_0x4db7('0x3b')](function(){_0x3e153c[_0x4db7('0x16')]();});});}}}catch(_0x2ed316){logger[_0x4db7('0x3d')]('[%s][AUTOREPLY]\x20%s',_0x78719e,JSON[_0x4db7('0x3c')](_0x2ed316));_0x3e153c[_0x4db7('0x45')]();}};}; \ No newline at end of file +var _0x518a=['error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','resolve','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../rpc/chatMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','inReplyTo','html','','replace','','headers','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','create','stringify'];(function(_0x1c9002,_0x64bf27){var _0x437e6d=function(_0x401459){while(--_0x401459){_0x1c9002['push'](_0x1c9002['shift']());}};_0x437e6d(++_0x64bf27);}(_0x518a,0x104));var _0xa518=function(_0x2536be,_0x5051d4){_0x2536be=_0x2536be-0x0;var _0x121ae5=_0x518a[_0x2536be];return _0x121ae5;};'use strict';var _=require(_0xa518('0x0'));var moment=require(_0xa518('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xa518('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xa518('0x3')),'openchannelInteraction':require(_0xa518('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xa518('0x5')),'faxInteraction':require(_0xa518('0x6')),'whatsappInteraction':require(_0xa518('0x7'))};var mailRpc=require(_0xa518('0x8'));exports['consequence']=function(_0x57b6b9,_0x54155f,_0x35db43,_0x11ac1b){return function(_0x1e3666){try{var _0x55f054=this[_0xa518('0x9')];if(_0x55f054===_0xa518('0xa')&&_0x11ac1b[_0xa518('0xb')][_0xa518('0xc')]){logger[_0xa518('0xd')]('[%s][AUTOREPLY]\x20%s',_0x57b6b9,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x1e3666[_0xa518('0xe')]();}if(_0x54155f[0x0]==='1'&&(_[_0xa518('0xf')](this[_0xa518('0x10')]['created'])||!this[_0xa518('0x10')][_0xa518('0x11')])){logger[_0xa518('0xd')](_0xa518('0x12'),_0x57b6b9,_0xa518('0x13'));return _0x1e3666[_0xa518('0xe')]();}if(_0x54155f[0x0]==='2'&&this[_0xa518('0x10')][_0xa518('0x14')]){logger[_0xa518('0xd')](_0xa518('0x15'),_0x57b6b9,_0xa518('0x16'));return _0x1e3666[_0xa518('0xe')]();}var _0xe123c2={'ContactId':this[_0xa518('0x17')]['id'],'sentAt':moment()[_0xa518('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa518('0x19')};if(this[_0xa518('0x9')]==='mail'){_0xe123c2[_0xa518('0xb')]=utils[_0xa518('0x1a')](_0x54155f[0x2],this);}else{_0xe123c2['body']=utils[_0xa518('0x1a')](_0x54155f[0x1],this);}if(this[_0xa518('0x1b')]){_0xe123c2['to']=this[_0xa518('0x1b')][_0xa518('0x1c')]||'';if(this[_0xa518('0x9')]==='mail'&&_0x54155f[0x1]==='1'){_0xe123c2['cc']=this[_0xa518('0x1b')]['cc']||'';}_0xe123c2[_0xa518('0x1c')]=this[_0xa518('0x1b')]['to']||'';_0xe123c2[_0xa518('0x1d')]=this[_0xa518('0x1b')][_0xa518('0x1d')]||'';_0xe123c2['read']=!![];if(this[_0xa518('0x1b')]['subject']){_0xe123c2[_0xa518('0x1e')]='';_0xe123c2[_0xa518('0x1e')]+=_[_0xa518('0x1f')](this[_0xa518('0x1b')][_0xa518('0x1e')],_0xa518('0x20'))?'':_0xa518('0x21');_0xe123c2[_0xa518('0x1e')]+=this['message']['subject'];}}if(this['channel']===_0xa518('0x22')){_0xe123c2[_0xa518('0x23')]=this[_0xa518('0x24')]['id'];}else{_0xe123c2[_['upperFirst'](this[_0xa518('0x9')])+_0xa518('0x25')]=this[_0xa518('0x24')]['id'];}_0xe123c2[_[_0xa518('0x26')](this[_0xa518('0x9')])+_0xa518('0x27')]=this[_0xa518('0x10')]['id'];var _0x2f4e31=this[_0xa518('0x10')];if(rpc[this['channel']+'Message']){if(this['channel']===_0xa518('0xa')){_0xe123c2[_0xa518('0x28')]=this[_0xa518('0x1b')]['messageId'];_0xe123c2[_0xa518('0x29')]=_0xa518('0x2a')+_[_0xa518('0x2b')](_0xe123c2[_0xa518('0xb')],_0xa518('0x2c'),']+(>|$)/g,''),'priorityTrue':_0x5beaa6[0x1],'priorityFalse':_0x5beaa6[0x2]};var _0x8294bc=gotoif[_0x9fd4('0x0')](_0x15723a,{'typecast':!![]});if(_0x8294bc['length']){logger['error'](_0x9fd4('0xd'),_0x20cba4,_['map'](_0x8294bc,_0x9fd4('0xe'))[_0x9fd4('0xf')](',\x20'));_0x4b19ec[_0x9fd4('0x10')]();}else{try{var _0xbbf930=eval('('+_0x15723a[_0x9fd4('0x11')]+')');var _0x3e265e=_0xbbf930?_0x15723a[_0x9fd4('0x12')]:_0x15723a[_0x9fd4('0x13')];logger[_0x9fd4('0x14')](_0x9fd4('0x15'),_0x20cba4,_0x15723a[_0x9fd4('0x11')],_0xbbf930,_0x3e265e||_0x9fd4('0x16'));if(_0x3e265e){var _0x77625c=_[_0x9fd4('0x17')](_0x4b19ec[_0x9fd4('0x18')](),{'p':_0x3e265e});if(_0x77625c>=0x0){logger['info'](_0x9fd4('0x19'),_0x20cba4,_0x3e265e||_0x9fd4('0x16'),_0x77625c);_0x4b19ec[_0x9fd4('0x16')](_0x77625c);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x20cba4,_0x3e265e||_0x9fd4('0x16'));_0x4b19ec[_0x9fd4('0x10')]();}}else{_0x4b19ec[_0x9fd4('0x16')]();}}catch(_0x1373b9){logger[_0x9fd4('0x1a')](_0x9fd4('0x1b'),_0x20cba4,_0x1373b9['message']);_0x4b19ec[_0x9fd4('0x10')]();}}}catch(_0x1c5d23){logger[_0x9fd4('0x1a')]('[%s][GOTOIF]\x20%s',_0x20cba4,JSON[_0x9fd4('0x1c')](_0x1c5d23));_0x4b19ec['stop']();}};}; \ No newline at end of file +var _0xd981=['[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','lodash','html-to-text','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd981,0xfc));var _0x1d98=function(_0x41cdec,_0x13a785){_0x41cdec=_0x41cdec-0x0;var _0x2deb2d=_0xd981[_0x41cdec];return _0x2deb2d;};'use strict';var schema=require('validate');var _=require(_0x1d98('0x0'));var htmlToText=require(_0x1d98('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x1d98('0x2'));var gotoif=schema({'condition':{'type':_0x1d98('0x3'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x1d98('0x4'),'message':_0x1d98('0x5')},'priorityFalse':{'type':_0x1d98('0x4'),'message':_0x1d98('0x6')}});exports[_0x1d98('0x7')]=function(_0x104109,_0x566bec){return function(_0x5c244c){try{var _0x2a52bf={'condition':htmlToText[_0x1d98('0x8')](utils[_0x1d98('0x9')](_0x566bec[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x566bec[0x1],'priorityFalse':_0x566bec[0x2]};var _0x18cc97=gotoif['validate'](_0x2a52bf,{'typecast':!![]});if(_0x18cc97['length']){logger[_0x1d98('0xa')](_0x1d98('0xb'),_0x104109,_[_0x1d98('0xc')](_0x18cc97,_0x1d98('0xd'))[_0x1d98('0xe')](',\x20'));_0x5c244c[_0x1d98('0xf')]();}else{try{var _0x165491=eval('('+_0x2a52bf['condition']+')');var _0x359c40=_0x165491?_0x2a52bf['priorityTrue']:_0x2a52bf[_0x1d98('0x10')];logger[_0x1d98('0x11')](_0x1d98('0x12'),_0x104109,_0x2a52bf[_0x1d98('0x13')],_0x165491,_0x359c40||'next');if(_0x359c40){var _0x1f0080=_['findIndex'](_0x5c244c[_0x1d98('0x14')](),{'p':_0x359c40});if(_0x1f0080>=0x0){logger[_0x1d98('0x11')](_0x1d98('0x15'),_0x104109,_0x359c40||'next',_0x1f0080);_0x5c244c[_0x1d98('0x16')](_0x1f0080);}else{logger[_0x1d98('0x11')](_0x1d98('0x17'),_0x104109,_0x359c40||_0x1d98('0x16'));_0x5c244c['stop']();}}else{_0x5c244c[_0x1d98('0x16')]();}}catch(_0x3a8534){logger[_0x1d98('0xa')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x104109,_0x3a8534[_0x1d98('0xd')]);_0x5c244c[_0x1d98('0xf')]();}}}catch(_0x40b134){logger[_0x1d98('0xa')](_0x1d98('0xb'),_0x104109,JSON[_0x1d98('0x18')](_0x40b134));_0x5c244c[_0x1d98('0xf')]();}};}; \ 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 5b7fafd..5f7162c 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 _0x1b55=['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','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','join'];(function(_0x15a346,_0x46d825){var _0x275a0f=function(_0x3df115){while(--_0x3df115){_0x15a346['push'](_0x15a346['shift']());}};_0x275a0f(++_0x46d825);}(_0x1b55,0x145));var _0x51b5=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0x1b55[_0x3f6e26];return _0x474345;};'use strict';var schema=require(_0x51b5('0x0'));var _=require('lodash');var logger=require(_0x51b5('0x1'))(_0x51b5('0x2'));var gotop=schema({'priority':{'type':_0x51b5('0x3'),'required':!![],'message':_0x51b5('0x4')}});exports[_0x51b5('0x5')]=function(_0x382b66,_0x5da606){return function(_0x50ec14){try{var _0x387a25={'priority':_0x5da606[0x0]};var _0x4d85b3=gotop['validate'](_0x387a25,{'typecast':!![]});if(_0x4d85b3[_0x51b5('0x6')]){logger[_0x51b5('0x7')](_0x51b5('0x8'),_0x382b66,_[_0x51b5('0x9')](_0x4d85b3,'message')[_0x51b5('0xa')](',\x20'));_0x50ec14[_0x51b5('0xb')]();}else{logger[_0x51b5('0xc')](_0x51b5('0xd'),_0x382b66,_0x387a25[_0x51b5('0xe')]);if(_0x387a25['priority']){var _0x1ae9dc=_[_0x51b5('0xf')](_0x50ec14[_0x51b5('0x10')](),{'p':_0x387a25['priority']});if(_0x1ae9dc>=0x0){logger[_0x51b5('0xc')](_0x51b5('0x11'),_0x382b66,_0x387a25[_0x51b5('0xe')]||_0x51b5('0x12'),_0x1ae9dc);_0x50ec14[_0x51b5('0x12')](_0x1ae9dc);}else{logger[_0x51b5('0xc')](_0x51b5('0x13'),_0x382b66,_0x387a25['priority']||_0x51b5('0x12'));_0x50ec14['stop']();}}else{_0x50ec14[_0x51b5('0x12')]();}}}catch(_0x68a2e7){logger['error']('[%s][GOTOP]\x20%s',_0x382b66,JSON[_0x51b5('0x14')](_0x68a2e7));_0x50ec14['stop']();}};}; \ No newline at end of file +var _0x8d1b=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','[%s][GOTOP]\x20%s','map','join','info'];(function(_0x2cdffc,_0x523db7){var _0x3650fb=function(_0x433a27){while(--_0x433a27){_0x2cdffc['push'](_0x2cdffc['shift']());}};_0x3650fb(++_0x523db7);}(_0x8d1b,0x113));var _0xb8d1=function(_0x2b0d11,_0xdf2140){_0x2b0d11=_0x2b0d11-0x0;var _0x9d8818=_0x8d1b[_0x2b0d11];return _0x9d8818;};'use strict';var schema=require(_0xb8d1('0x0'));var _=require(_0xb8d1('0x1'));var logger=require('../../../../config/logger')(_0xb8d1('0x2'));var gotop=schema({'priority':{'type':_0xb8d1('0x3'),'required':!![],'message':_0xb8d1('0x4')}});exports['consequence']=function(_0x56f465,_0x46e947){return function(_0x318eb4){try{var _0x481753={'priority':_0x46e947[0x0]};var _0x3827fa=gotop[_0xb8d1('0x0')](_0x481753,{'typecast':!![]});if(_0x3827fa['length']){logger[_0xb8d1('0x5')](_0xb8d1('0x6'),_0x56f465,_[_0xb8d1('0x7')](_0x3827fa,'message')[_0xb8d1('0x8')](',\x20'));_0x318eb4['stop']();}else{logger[_0xb8d1('0x9')](_0xb8d1('0xa'),_0x56f465,_0x481753[_0xb8d1('0xb')]);if(_0x481753[_0xb8d1('0xb')]){var _0x24f12b=_[_0xb8d1('0xc')](_0x318eb4[_0xb8d1('0xd')](),{'p':_0x481753[_0xb8d1('0xb')]});if(_0x24f12b>=0x0){logger[_0xb8d1('0x9')](_0xb8d1('0xe'),_0x56f465,_0x481753[_0xb8d1('0xb')]||_0xb8d1('0xf'),_0x24f12b);_0x318eb4[_0xb8d1('0xf')](_0x24f12b);}else{logger[_0xb8d1('0x9')](_0xb8d1('0x10'),_0x56f465,_0x481753[_0xb8d1('0xb')]||_0xb8d1('0xf'));_0x318eb4[_0xb8d1('0x11')]();}}else{_0x318eb4[_0xb8d1('0xf')]();}}}catch(_0x27513f){logger[_0xb8d1('0x5')]('[%s][GOTOP]\x20%s',_0x56f465,JSON[_0xb8d1('0x12')](_0x27513f));_0x318eb4[_0xb8d1('0x11')]();}};}; \ 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 368897f..e592f8a 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 _0x56ff=['[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','contact','channel','ChatWebsiteId','upperFirst','AccountId','account','interaction','Message','create','then','info'];(function(_0x3e0f55,_0x1b049e){var _0x90d4e7=function(_0x107ba0){while(--_0x107ba0){_0x3e0f55['push'](_0x3e0f55['shift']());}};_0x90d4e7(++_0x1b049e);}(_0x56ff,0x66));var _0xf56f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x56ff[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf56f('0x0'));var utils=require(_0xf56f('0x1'));var logger=require('../../../../config/logger')(_0xf56f('0x2'));var rpc={'chatMessage':require(_0xf56f('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf56f('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf56f('0x5'))};exports[_0xf56f('0x6')]=function(_0x3f9855,_0x5c7395){return function(_0x2c65e9){try{var _0x4bdb26={'body':utils['getMustacheRender'](_0x5c7395[0x0],this),'ContactId':this[_0xf56f('0x7')]['id']};if(this[_0xf56f('0x8')]==='chat'){_0x4bdb26[_0xf56f('0x9')]=this['account']['id'];}else{_0x4bdb26[_[_0xf56f('0xa')](this[_0xf56f('0x8')])+_0xf56f('0xb')]=this[_0xf56f('0xc')]['id'];}_0x4bdb26[_[_0xf56f('0xa')](this[_0xf56f('0x8')])+'InteractionId']=this[_0xf56f('0xd')]['id'];if(rpc[this[_0xf56f('0x8')]+_0xf56f('0xe')]){return rpc[this[_0xf56f('0x8')]+_0xf56f('0xe')][_0xf56f('0xf')](_0x4bdb26)[_0xf56f('0x10')](function(_0x2ab689){logger[_0xf56f('0x11')](_0xf56f('0x12'),_0x3f9855,_0x4bdb26['body']);_0x2c65e9[_0xf56f('0x13')]();})[_0xf56f('0x14')](function(_0x537bd9){logger[_0xf56f('0x15')]('[%s][MESSAGE]\x20%s',_0x3f9855,JSON[_0xf56f('0x16')](_0x537bd9));_0x2c65e9[_0xf56f('0x17')]();});}}catch(_0x225800){logger[_0xf56f('0x15')](_0xf56f('0x12'),_0x3f9855,JSON['stringify'](_0x225800));_0x2c65e9[_0xf56f('0x17')]();}};}; \ No newline at end of file +var _0x3bbd=['stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error'];(function(_0x169a2c,_0x669bc0){var _0x3d71e2=function(_0x16bfb1){while(--_0x16bfb1){_0x169a2c['push'](_0x169a2c['shift']());}};_0x3d71e2(++_0x669bc0);}(_0x3bbd,0x1b2));var _0xd3bb=function(_0x332599,_0x2bab84){_0x332599=_0x332599-0x0;var _0x5db25d=_0x3bbd[_0x332599];return _0x5db25d;};'use strict';var _=require(_0xd3bb('0x0'));var utils=require(_0xd3bb('0x1'));var logger=require(_0xd3bb('0x2'))(_0xd3bb('0x3'));var rpc={'chatMessage':require(_0xd3bb('0x4')),'openchannelMessage':require(_0xd3bb('0x5')),'mailMessage':require(_0xd3bb('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xd3bb('0x7')]=function(_0x5af511,_0x3f3e2f){return function(_0x2be1bd){try{var _0x5371d7={'body':utils[_0xd3bb('0x8')](_0x3f3e2f[0x0],this),'ContactId':this[_0xd3bb('0x9')]['id']};if(this[_0xd3bb('0xa')]===_0xd3bb('0xb')){_0x5371d7[_0xd3bb('0xc')]=this[_0xd3bb('0xd')]['id'];}else{_0x5371d7[_['upperFirst'](this['channel'])+_0xd3bb('0xe')]=this['account']['id'];}_0x5371d7[_[_0xd3bb('0xf')](this[_0xd3bb('0xa')])+_0xd3bb('0x10')]=this['interaction']['id'];if(rpc[this[_0xd3bb('0xa')]+_0xd3bb('0x11')]){return rpc[this[_0xd3bb('0xa')]+'Message'][_0xd3bb('0x12')](_0x5371d7)[_0xd3bb('0x13')](function(_0x1753f8){logger[_0xd3bb('0x14')](_0xd3bb('0x15'),_0x5af511,_0x5371d7['body']);_0x2be1bd[_0xd3bb('0x16')]();})[_0xd3bb('0x17')](function(_0x17639f){logger[_0xd3bb('0x18')](_0xd3bb('0x15'),_0x5af511,JSON[_0xd3bb('0x19')](_0x17639f));_0x2be1bd['stop']();});}}catch(_0x223fc6){logger['error']('[%s][MESSAGE]\x20%s',_0x5af511,JSON['stringify'](_0x223fc6));_0x2be1bd[_0xd3bb('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 1a31b87..ae9e354 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 _0x277c=['getMustacheRender','error','stringify','./utils','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x277c,0x153));var _0xc277=function(_0x5daf58,_0x2cf23b){_0x5daf58=_0x5daf58-0x0;var _0x11cbfd=_0x277c[_0x5daf58];return _0x11cbfd;};'use strict';var utils=require(_0xc277('0x0'));var logger=require('../../../../config/logger')(_0xc277('0x1'));exports[_0xc277('0x2')]=function(_0x3cd265,_0x21d6f2){return function(_0x394371){try{logger[_0xc277('0x3')](_0xc277('0x4'),_0x3cd265,utils[_0xc277('0x5')](_0x21d6f2[0x0],this));_0x394371['next']();}catch(_0x4bfaeb){logger[_0xc277('0x6')]('[%s][NOOP]\x20%s',_0x3cd265,JSON[_0xc277('0x7')](_0x4bfaeb));_0x394371['stop']();}};}; \ No newline at end of file +var _0x3586=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','./utils'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x3586,0x127));var _0x6358=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0x3586[_0x400b43];return _0x3c330f;};'use strict';var utils=require(_0x6358('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0x6358('0x1')]=function(_0x1787e2,_0x20b70f){return function(_0x170cd4){try{logger[_0x6358('0x2')](_0x6358('0x3'),_0x1787e2,utils[_0x6358('0x4')](_0x20b70f[0x0],this));_0x170cd4[_0x6358('0x5')]();}catch(_0x166d72){logger[_0x6358('0x6')](_0x6358('0x3'),_0x1787e2,JSON[_0x6358('0x7')](_0x166d72));_0x170cd4['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index b52b12c..719e2d7 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 _0x5249=['[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','stop','find','Queues','timeout','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','pick','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','info'];(function(_0x2e9d34,_0x1c84f3){var _0x282c78=function(_0x51d893){while(--_0x51d893){_0x2e9d34['push'](_0x2e9d34['shift']());}};_0x282c78(++_0x1c84f3);}(_0x5249,0xb2));var _0x9524=function(_0x44073c,_0x376e28){_0x44073c=_0x44073c-0x0;var _0x27a440=_0x5249[_0x44073c];return _0x27a440;};'use strict';var schema=require(_0x9524('0x0'));var _=require(_0x9524('0x1'));var util=require('util');var seqqueue=require(_0x9524('0x2'));var moment=require(_0x9524('0x3'));var Redis=require(_0x9524('0x4'));var config=require('../../../../config/environment');var logger=require(_0x9524('0x5'))('routing');var strategy=require(_0x9524('0x6'));config[_0x9524('0x7')]=_[_0x9524('0x8')](config[_0x9524('0x7')],{'host':_0x9524('0x9'),'port':0x18eb});var io=require(_0x9524('0xa'))(new Redis(config[_0x9524('0x7')]));var attributes=['id','queue_id',_0x9524('0xb'),_0x9524('0xc'),_0x9524('0xd'),_0x9524('0xe')];function emit(_0x5421a9,_0x49c289,_0x3508dd){io['to'](_0x5421a9)[_0x9524('0xf')](_0x49c289,_0x3508dd);}function emitChannelQueueInteraction(_0x302fb3,_0xaca6bc,_0x5e3730,_0x5eca3f,_0x185b3d,_0x2ef86d,_0x490113,_0x5ebe30){var _0xb82f92=_[_0x9524('0x10')](_0x5e3730);_0xb82f92['queue_id']=_0x5ebe30;_0xb82f92[_0x9524('0xc')]=_0xaca6bc;_0xb82f92[_0x9524('0xb')]=_0x5eca3f;_0xb82f92['id']=_0x185b3d;if(_0x2ef86d){_0x490113[util[_0x9524('0x11')](_0x9524('0x12'),_0x302fb3)][_0x185b3d]=_['pick'](_0xb82f92,attributes);}else{delete _0x490113[util['format'](_0x9524('0x12'),_0x302fb3)][_0x185b3d];}emit(util[_0x9524('0x11')](_0x9524('0x13'),_0x302fb3,_0xaca6bc),util[_0x9524('0x11')]('%s_queue_waiting_interaction:%s',_0x302fb3,_0x2ef86d?_0x9524('0x14'):_0x9524('0x15')),_[_0x9524('0x16')](_0xb82f92,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x9524('0x17')),'chatQueueReport':require(_0x9524('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x9524('0x19')),'whatsappQueueReport':require(_0x9524('0x1a'))};var queue=schema({'name':{'type':_0x9524('0x1b'),'required':!![],'message':_0x9524('0x1c')},'timeout':{'type':'number','message':_0x9524('0x1d')}});function startRouting(_0x4df324,_0x26de4e,_0x564993,_0x29e91b){if(_0x4df324&&_0x26de4e&&_0x564993){_0x26de4e[_0x9524('0x1e')]+=0x1;var _0x195705={'uniqueid':_0x4df324,'from':_0x564993[_0x9524('0x1f')]?_0x564993[_0x9524('0x1f')]['from']:'','joinAt':moment()[_0x9524('0x11')](_0x9524('0x20')),'ContactId':_0x564993[_0x9524('0x21')]?_0x564993[_0x9524('0x21')]['id']:null,'ListId':_0x564993[_0x9524('0x22')]?_0x564993[_0x9524('0x22')]['id']:null};_0x195705[_[_0x9524('0x23')](_0x564993['channel'])+'QueueId']=_0x26de4e['id']||null;_0x195705[_[_0x9524('0x23')](_0x564993[_0x9524('0x24')])+_0x9524('0x25')]=_0x564993[_0x9524('0x26')]?_0x564993['interaction']['id']:null;_0x195705[_[_0x9524('0x23')](_0x564993[_0x9524('0x24')])+_0x9524('0x27')]=_0x564993[_0x9524('0x28')]?_0x564993[_0x9524('0x28')]['id']:null;_0x195705[_[_0x9524('0x23')](_0x564993['channel'])+(_0x564993[_0x9524('0x24')]!==_0x9524('0x29')?_0x9524('0x2a'):_0x9524('0x2b'))]=_0x564993[_0x9524('0xb')]?_0x564993[_0x9524('0xb')]['id']:null;logger['info'](util['format'](_0x9524('0x2c'),_0x4df324,_0x26de4e[_0x9524('0x2d')]));emitChannelQueueInteraction(_0x564993[_0x9524('0x24')],_0x26de4e[_0x9524('0x2d')],_0x195705,_0x564993[_0x9524('0xb')][_0x9524('0x2d')],_0x564993[_0x9524('0x28')]['id'],!![],_0x29e91b,_0x26de4e['id']);if(rpc[_0x564993[_0x9524('0x24')]+_0x9524('0x2e')]){return rpc[_0x564993[_0x9524('0x24')]+_0x9524('0x2e')][_0x9524('0x2f')](_0x195705)[_0x9524('0x30')](function(_0x530d1c){logger[_0x9524('0x31')](_0x9524('0x32'));});}}}function stopRouting(_0x2c2fcd,_0x15f973,_0x4a5cd7,_0x179985){if(_0x2c2fcd&&_0x15f973){_0x15f973[_0x9524('0x1e')]-=0x1;var _0x414113={'leaveAt':moment()['format'](_0x9524('0x20')),'acceptAt':moment()[_0x9524('0x11')](_0x9524('0x20')),'reason':_0x9524('0x33')};logger[_0x9524('0x34')](util['format'](_0x9524('0x35'),_0x2c2fcd,_0x15f973[_0x9524('0x2d')]));emitChannelQueueInteraction(_0x4a5cd7[_0x9524('0x24')],_0x15f973['name'],_0x4a5cd7['body'],_0x4a5cd7[_0x9524('0xb')][_0x9524('0x2d')],_0x4a5cd7[_0x9524('0x28')]['id'],![],_0x179985,_0x15f973['id']);if(rpc[_0x4a5cd7[_0x9524('0x24')]+'QueueReport']){return rpc[_0x4a5cd7[_0x9524('0x24')]+'QueueReport'][_0x9524('0x36')](_0x2c2fcd,_0x414113)[_0x9524('0x30')](function(_0x4b5ee8){logger[_0x9524('0x31')](_0x9524('0x37'));});}}}function endRouting(_0x55f8e9,_0x543cbd,_0x29c76d,_0x516285){if(_0x55f8e9&&_0x543cbd){_0x543cbd[_0x9524('0x1e')]-=0x1;var _0x560939={'leaveAt':moment()[_0x9524('0x11')](_0x9524('0x20')),'exitAt':moment()[_0x9524('0x11')](_0x9524('0x20')),'reason':'timeout'};logger[_0x9524('0x34')](util[_0x9524('0x11')](_0x9524('0x38'),_0x55f8e9,_0x543cbd[_0x9524('0x2d')]));emitChannelQueueInteraction(_0x29c76d[_0x9524('0x24')],_0x543cbd['name'],_0x29c76d[_0x9524('0x1f')],_0x29c76d[_0x9524('0xb')][_0x9524('0x2d')],_0x29c76d[_0x9524('0x28')]['id'],![],_0x516285);if(rpc[_0x29c76d[_0x9524('0x24')]+_0x9524('0x2e')]){return rpc[_0x29c76d[_0x9524('0x24')]+'QueueReport'][_0x9524('0x36')](_0x55f8e9,_0x560939)[_0x9524('0x30')](function(_0x3ce39c){logger['error'](_0x9524('0x37'));});}}}function handleFindQueue(_0x2b0186){return function(_0x2e2906){return _0x2e2906['name'][_0x9524('0x39')]()===_0x2b0186['toLowerCase']();};}exports[_0x9524('0x3a')]=function(_0x42dc46,_0x184764,_0x3f92f3,_0xc7582d){return function(_0x2b626f){try{var _0x2dd7a1={'name':_0x184764[0x0],'timeout':_0x184764[0x1]};var _0x50d0ed=queue['validate'](_0x2dd7a1,{'typecast':!![]});if(_0x50d0ed[_0x9524('0x3b')]){logger['error']('[%s][QUEUE]\x20%s',_0x42dc46,_['map'](_0x50d0ed,_0x9524('0x28'))['join'](',\x20'));_0x2b626f[_0x9524('0x3c')]();}else{var _0x41ead1=_[_0x9524('0x3d')](_0x3f92f3[_0xc7582d[_0x9524('0x24')]+_0x9524('0x3e')],handleFindQueue(_0x2dd7a1[_0x9524('0x2d')]));if(_0x41ead1){startRouting(_0x42dc46,_0x41ead1,_0xc7582d,_0x3f92f3);var _0x1ea483=(_0x41ead1[_0x9524('0x3f')]||0xa)*0x3e8;var _0x25e6c8=(_0x2dd7a1[_0x9524('0x3f')]||0x14)*0x3e8;var _0x2cffdf,_0x32c306;if(_0x1ea483>_0x25e6c8){_0x25e6c8=_0x1ea483;}var _0x1cbcf0=seqqueue['createQueue'](_0x1ea483);_0x1cbcf0['id']=_0x42dc46;_0x1cbcf0[_0x9524('0x40')]=_0x1ea483;_0x1cbcf0[_0x9524('0x41')]=_0x25e6c8;_0x1cbcf0[_0x9524('0x24')]=_0xc7582d[_0x9524('0x24')];_0x3f92f3[_0x9524('0x42')][_0x42dc46]['on']('end',function(){logger[_0x9524('0x34')](_0x9524('0x43'),_0x42dc46);stopRouting(_0x42dc46,_0x41ead1,_0xc7582d,_0x3f92f3);clearTimeout(_0x2cffdf);_0x2cffdf=undefined;_0x1cbcf0['close'](!![]);if(_0x3f92f3[_0x9524('0x42')][_0x42dc46]){delete _0x3f92f3['rules'][_0x42dc46];}_0x2b626f[_0x9524('0x3c')]();});_0x3f92f3['rules'][_0x42dc46]['on'](_0x9524('0x44'),function(){if(_0x3f92f3['rules'][_0x42dc46]){delete _0x3f92f3['rules'][_0x42dc46];}});_0x2cffdf=setTimeout(function(){logger[_0x9524('0x34')](_0x9524('0x45'),_0x42dc46);endRouting(_0x42dc46,_0x41ead1,_0xc7582d,_0x3f92f3);clearTimeout(_0x2cffdf);_0x1cbcf0[_0x9524('0x46')](!![]);_0x2b626f[_0x9524('0x47')]();},_0x25e6c8);switch(_0x41ead1[_0x9524('0x48')]){case _0x9524('0x49'):strategy[_0x9524('0x49')](_0x1cbcf0,_0x41ead1,_0x3f92f3,_0xc7582d);break;default:strategy[_0x9524('0x4a')](_0x1cbcf0,_0x41ead1,_0x3f92f3,_0xc7582d);}}else{logger[_0x9524('0x31')](_0x9524('0x4b'),_0x42dc46,_0x2dd7a1[_0x9524('0x2d')]);_0x2b626f[_0x9524('0x3c')]();}}}catch(_0x28c12c){console['log'](_0x28c12c);logger['error']('[%s][QUEUE]\x20%s',_0x42dc46,_0x28c12c[_0x9524('0x4c')]);_0x2b626f[_0x9524('0x3c')]();}};}; \ No newline at end of file +var _0xe547=['catch','accepted','[%s][STOP:QUEUE][NAME:%s]','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','validate','length','[%s][QUEUE]\x20%s','map','stop','timeout','atimeout','qtimeout','rules','end','close','complete','next','strategy','rrmemory','beepall','log','stack','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create'];(function(_0x1ee69b,_0x55a65b){var _0x33e413=function(_0x1533f1){while(--_0x1533f1){_0x1ee69b['push'](_0x1ee69b['shift']());}};_0x33e413(++_0x55a65b);}(_0xe547,0x191));var _0x7e54=function(_0x257e8b,_0x3d63f9){_0x257e8b=_0x257e8b-0x0;var _0x51a3f5=_0xe547[_0x257e8b];return _0x51a3f5;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x7e54('0x0'));var seqqueue=require(_0x7e54('0x1'));var moment=require(_0x7e54('0x2'));var Redis=require(_0x7e54('0x3'));var config=require(_0x7e54('0x4'));var logger=require('../../../../config/logger')(_0x7e54('0x5'));var strategy=require(_0x7e54('0x6'));config[_0x7e54('0x7')]=_[_0x7e54('0x8')](config[_0x7e54('0x7')],{'host':_0x7e54('0x9'),'port':0x18eb});var io=require(_0x7e54('0xa'))(new Redis(config['redis']));var attributes=['id',_0x7e54('0xb'),_0x7e54('0xc'),_0x7e54('0xd'),_0x7e54('0xe'),_0x7e54('0xf')];function emit(_0x4293a7,_0x38d0af,_0xacbc39){io['to'](_0x4293a7)[_0x7e54('0x10')](_0x38d0af,_0xacbc39);}function emitChannelQueueInteraction(_0xaa7ed6,_0x4862e3,_0x249ec1,_0x31c785,_0x351b8e,_0x291fec,_0x4def47,_0x1a9f80){var _0xe79124=_[_0x7e54('0x11')](_0x249ec1);_0xe79124['queue_id']=_0x1a9f80;_0xe79124[_0x7e54('0xd')]=_0x4862e3;_0xe79124[_0x7e54('0xc')]=_0x31c785;_0xe79124['id']=_0x351b8e;if(_0x291fec){_0x4def47[util[_0x7e54('0x12')](_0x7e54('0x13'),_0xaa7ed6)][_0x351b8e]=_[_0x7e54('0x14')](_0xe79124,attributes);}else{delete _0x4def47[util['format']('%sQueuesWaitingInteractions',_0xaa7ed6)][_0x351b8e];}emit(util[_0x7e54('0x12')]('%s:queue:%s',_0xaa7ed6,_0x4862e3),util[_0x7e54('0x12')](_0x7e54('0x15'),_0xaa7ed6,_0x291fec?_0x7e54('0x16'):_0x7e54('0x17')),_['pick'](_0xe79124,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7e54('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x7e54('0x19')),'faxQueueReport':require(_0x7e54('0x1a')),'whatsappQueueReport':require(_0x7e54('0x1b'))};var queue=schema({'name':{'type':_0x7e54('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x7e54('0x1d'),'message':_0x7e54('0x1e')}});function startRouting(_0x11b0fd,_0x3049e6,_0x4b7c87,_0x462907){if(_0x11b0fd&&_0x3049e6&&_0x4b7c87){_0x3049e6[_0x7e54('0x1f')]+=0x1;var _0x1ae074={'uniqueid':_0x11b0fd,'from':_0x4b7c87[_0x7e54('0x20')]?_0x4b7c87['body'][_0x7e54('0xe')]:'','joinAt':moment()['format'](_0x7e54('0x21')),'ContactId':_0x4b7c87[_0x7e54('0x22')]?_0x4b7c87[_0x7e54('0x22')]['id']:null,'ListId':_0x4b7c87[_0x7e54('0x23')]?_0x4b7c87[_0x7e54('0x23')]['id']:null};_0x1ae074[_[_0x7e54('0x24')](_0x4b7c87[_0x7e54('0x25')])+_0x7e54('0x26')]=_0x3049e6['id']||null;_0x1ae074[_['upperFirst'](_0x4b7c87['channel'])+'InteractionId']=_0x4b7c87[_0x7e54('0x27')]?_0x4b7c87['interaction']['id']:null;_0x1ae074[_[_0x7e54('0x24')](_0x4b7c87[_0x7e54('0x25')])+_0x7e54('0x28')]=_0x4b7c87[_0x7e54('0x29')]?_0x4b7c87['message']['id']:null;_0x1ae074[_[_0x7e54('0x24')](_0x4b7c87[_0x7e54('0x25')])+(_0x4b7c87[_0x7e54('0x25')]!==_0x7e54('0x2a')?_0x7e54('0x2b'):_0x7e54('0x2c'))]=_0x4b7c87['account']?_0x4b7c87[_0x7e54('0xc')]['id']:null;logger[_0x7e54('0x2d')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x11b0fd,_0x3049e6[_0x7e54('0x2e')]));emitChannelQueueInteraction(_0x4b7c87[_0x7e54('0x25')],_0x3049e6[_0x7e54('0x2e')],_0x1ae074,_0x4b7c87[_0x7e54('0xc')][_0x7e54('0x2e')],_0x4b7c87[_0x7e54('0x29')]['id'],!![],_0x462907,_0x3049e6['id']);if(rpc[_0x4b7c87[_0x7e54('0x25')]+_0x7e54('0x2f')]){return rpc[_0x4b7c87['channel']+_0x7e54('0x2f')][_0x7e54('0x30')](_0x1ae074)[_0x7e54('0x31')](function(_0x2ef219){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x1ae6b4,_0x1d250b,_0x36284f,_0x9618f6){if(_0x1ae6b4&&_0x1d250b){_0x1d250b[_0x7e54('0x1f')]-=0x1;var _0x2c567d={'leaveAt':moment()[_0x7e54('0x12')](_0x7e54('0x21')),'acceptAt':moment()['format'](_0x7e54('0x21')),'reason':_0x7e54('0x32')};logger[_0x7e54('0x2d')](util[_0x7e54('0x12')](_0x7e54('0x33'),_0x1ae6b4,_0x1d250b[_0x7e54('0x2e')]));emitChannelQueueInteraction(_0x36284f[_0x7e54('0x25')],_0x1d250b[_0x7e54('0x2e')],_0x36284f[_0x7e54('0x20')],_0x36284f[_0x7e54('0xc')]['name'],_0x36284f[_0x7e54('0x29')]['id'],![],_0x9618f6,_0x1d250b['id']);if(rpc[_0x36284f['channel']+'QueueReport']){return rpc[_0x36284f[_0x7e54('0x25')]+_0x7e54('0x2f')]['update'](_0x1ae6b4,_0x2c567d)[_0x7e54('0x31')](function(_0x4d9c43){logger[_0x7e54('0x34')](_0x7e54('0x35'));});}}}function endRouting(_0x75d6ad,_0x459bb5,_0x2f2a47,_0x51f16b){if(_0x75d6ad&&_0x459bb5){_0x459bb5[_0x7e54('0x1f')]-=0x1;var _0xc7eea6={'leaveAt':moment()[_0x7e54('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x7e54('0x12')](_0x7e54('0x21')),'reason':'timeout'};logger[_0x7e54('0x2d')](util['format'](_0x7e54('0x36'),_0x75d6ad,_0x459bb5['name']));emitChannelQueueInteraction(_0x2f2a47[_0x7e54('0x25')],_0x459bb5[_0x7e54('0x2e')],_0x2f2a47['body'],_0x2f2a47[_0x7e54('0xc')][_0x7e54('0x2e')],_0x2f2a47[_0x7e54('0x29')]['id'],![],_0x51f16b);if(rpc[_0x2f2a47['channel']+_0x7e54('0x2f')]){return rpc[_0x2f2a47['channel']+_0x7e54('0x2f')][_0x7e54('0x37')](_0x75d6ad,_0xc7eea6)[_0x7e54('0x31')](function(_0x376b07){logger['error'](_0x7e54('0x35'));});}}}function handleFindQueue(_0x1283a0){return function(_0x1fad45){return _0x1fad45['name']['toLowerCase']()===_0x1283a0[_0x7e54('0x38')]();};}exports['consequence']=function(_0x22fd9c,_0x1ed228,_0x1c4224,_0x214047){return function(_0x49463d){try{var _0x4c3421={'name':_0x1ed228[0x0],'timeout':_0x1ed228[0x1]};var _0x5e6985=queue[_0x7e54('0x39')](_0x4c3421,{'typecast':!![]});if(_0x5e6985[_0x7e54('0x3a')]){logger[_0x7e54('0x34')](_0x7e54('0x3b'),_0x22fd9c,_[_0x7e54('0x3c')](_0x5e6985,_0x7e54('0x29'))['join'](',\x20'));_0x49463d[_0x7e54('0x3d')]();}else{var _0x359567=_['find'](_0x1c4224[_0x214047[_0x7e54('0x25')]+'Queues'],handleFindQueue(_0x4c3421[_0x7e54('0x2e')]));if(_0x359567){startRouting(_0x22fd9c,_0x359567,_0x214047,_0x1c4224);var _0x108ee0=(_0x359567['timeout']||0xa)*0x3e8;var _0x69c27c=(_0x4c3421[_0x7e54('0x3e')]||0x14)*0x3e8;var _0x19d491,_0x4a1174;if(_0x108ee0>_0x69c27c){_0x69c27c=_0x108ee0;}var _0x45c4cc=seqqueue['createQueue'](_0x108ee0);_0x45c4cc['id']=_0x22fd9c;_0x45c4cc[_0x7e54('0x3f')]=_0x108ee0;_0x45c4cc[_0x7e54('0x40')]=_0x69c27c;_0x45c4cc[_0x7e54('0x25')]=_0x214047[_0x7e54('0x25')];_0x1c4224[_0x7e54('0x41')][_0x22fd9c]['on'](_0x7e54('0x42'),function(){logger[_0x7e54('0x2d')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x22fd9c);stopRouting(_0x22fd9c,_0x359567,_0x214047,_0x1c4224);clearTimeout(_0x19d491);_0x19d491=undefined;_0x45c4cc[_0x7e54('0x43')](!![]);if(_0x1c4224[_0x7e54('0x41')][_0x22fd9c]){delete _0x1c4224[_0x7e54('0x41')][_0x22fd9c];}_0x49463d[_0x7e54('0x3d')]();});_0x1c4224[_0x7e54('0x41')][_0x22fd9c]['on'](_0x7e54('0x44'),function(){if(_0x1c4224['rules'][_0x22fd9c]){delete _0x1c4224[_0x7e54('0x41')][_0x22fd9c];}});_0x19d491=setTimeout(function(){logger[_0x7e54('0x2d')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x22fd9c);endRouting(_0x22fd9c,_0x359567,_0x214047,_0x1c4224);clearTimeout(_0x19d491);_0x45c4cc[_0x7e54('0x43')](!![]);_0x49463d[_0x7e54('0x45')]();},_0x69c27c);switch(_0x359567[_0x7e54('0x46')]){case'rrmemory':strategy[_0x7e54('0x47')](_0x45c4cc,_0x359567,_0x1c4224,_0x214047);break;default:strategy[_0x7e54('0x48')](_0x45c4cc,_0x359567,_0x1c4224,_0x214047);}}else{logger[_0x7e54('0x34')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x22fd9c,_0x4c3421[_0x7e54('0x2e')]);_0x49463d[_0x7e54('0x3d')]();}}}catch(_0x4ce121){console[_0x7e54('0x49')](_0x4ce121);logger[_0x7e54('0x34')](_0x7e54('0x3b'),_0x22fd9c,_0x4ce121[_0x7e54('0x4a')]);_0x49463d[_0x7e54('0x3d')]();}};}; \ 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 30a77ee..e67d52b 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 _0x2e69=['routing','push','handleRun','bind','timeout','drained','handleDrained','prototype','handleTimeout','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','notificationId','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','exports','lodash','uuid','../../../../../config/logger','squeue','agent','realtime'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2e69,0x10a));var _0x92e6=function(_0x4fa267,_0x169755){_0x4fa267=_0x4fa267-0x0;var _0x451dfe=_0x2e69[_0x4fa267];return _0x451dfe;};'use strict';var _=require(_0x92e6('0x0'));var uuid=require(_0x92e6('0x1'));var util=require('./util');var logger=require(_0x92e6('0x2'))('routing');var Agent=function(_0x4c18dc,_0x51aa35,_0x205803,_0xbb2351){this['notificationId']=uuid['v4']();this[_0x92e6('0x3')]=_0x4c18dc;this[_0x92e6('0x4')]=_0x51aa35;this[_0x92e6('0x5')]=_0x205803;this[_0x92e6('0x6')]=_0xbb2351;this[_0x92e6('0x3')][_0x92e6('0x7')](this[_0x92e6('0x8')][_0x92e6('0x9')](this),this['handleTimeout'][_0x92e6('0x9')](this));this[_0x92e6('0x3')]['on'](_0x92e6('0xa'),this['handleTimeout'][_0x92e6('0x9')](this));this['squeue']['on'](_0x92e6('0xb'),this[_0x92e6('0xc')]['bind'](this));};Agent[_0x92e6('0xd')][_0x92e6('0x7')]=function(){this[_0x92e6('0x3')][_0x92e6('0x7')](this['handleRun'][_0x92e6('0x9')](this),this[_0x92e6('0xe')][_0x92e6('0x9')](this));};Agent[_0x92e6('0xd')]['handleDrained']=function(){this[_0x92e6('0xe')](!![]);};Agent[_0x92e6('0xd')][_0x92e6('0x8')]=function(){logger['debug'](_0x92e6('0xf'),this[_0x92e6('0x3')]['id'],this[_0x92e6('0x4')]['id']);if(_[_0x92e6('0x10')](this[_0x92e6('0x5')][_0x92e6('0x11')][this['agent']['id']])){logger[_0x92e6('0x12')](_0x92e6('0x13'),this['squeue']['id'],this[_0x92e6('0x4')]['id']);setTimeout(this[_0x92e6('0x7')][_0x92e6('0x9')](this),0x3e8);}else{if(this[_0x92e6('0x6')][_0x92e6('0x14')]||util[_0x92e6('0x15')](this[_0x92e6('0x3')]['id'],this[_0x92e6('0x5')][_0x92e6('0x11')][this['agent']['id']],this['squeue'][_0x92e6('0x16')],![])){this['realtime'][_0x92e6('0x11')][this[_0x92e6('0x4')]['id']][_0x92e6('0x17')]=!![];this[_0x92e6('0x5')]['agents'][this[_0x92e6('0x4')]['id']][_0x92e6('0x18')]=undefined;util[_0x92e6('0x19')](this[_0x92e6('0x1a')],this[_0x92e6('0x3')]['id'],this[_0x92e6('0x5')][_0x92e6('0x11')][this[_0x92e6('0x4')]['id']],null,this[_0x92e6('0x6')]);util['writeLog'](this[_0x92e6('0x3')]['id'],this[_0x92e6('0x5')][_0x92e6('0x11')][this[_0x92e6('0x4')]['id']],_0x92e6('0x1b')+(this[_0x92e6('0x6')][_0x92e6('0x14')]?_0x92e6('0x1c'):''));}else{logger[_0x92e6('0x12')](_0x92e6('0x1d'),this[_0x92e6('0x3')]['id'],this[_0x92e6('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x92e6('0xd')][_0x92e6('0xe')]=function(_0x3ebc09){if(_[_0x92e6('0x10')](this[_0x92e6('0x5')][_0x92e6('0x11')][this['agent']['id']])){return logger[_0x92e6('0x12')](_0x92e6('0x13'),this[_0x92e6('0x3')]['id'],this[_0x92e6('0x4')]['id']);}else{logger[_0x92e6('0x12')](_0x92e6('0x1e'),this[_0x92e6('0x3')]['id'],this['agent']['id']);util[_0x92e6('0x1f')](this[_0x92e6('0x1a')],this['squeue']['id'],this[_0x92e6('0x5')]['agents'][this[_0x92e6('0x4')]['id']],null,this[_0x92e6('0x6')]);this[_0x92e6('0x5')][_0x92e6('0x11')][this[_0x92e6('0x4')]['id']][_0x92e6('0x17')]=![];this[_0x92e6('0x5')][_0x92e6('0x11')][this[_0x92e6('0x4')]['id']][_0x92e6('0x18')]=undefined;util[_0x92e6('0x20')](this['squeue']['id'],this['realtime']['agents'][this['agent']['id']],_0x3ebc09?'STOP':'TIMEOUT');}if(!_0x3ebc09){setTimeout(this[_0x92e6('0x7')][_0x92e6('0x9')](this),0x3e8);}};function agent(_0x385af8,_0x464ca4,_0x1f8e63,_0x548e02){return new Agent(_0x385af8,_0x464ca4,_0x1f8e63,_0x548e02);}module[_0x92e6('0x21')]=agent; \ No newline at end of file +var _0xc93b=['bind','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','hideNotification','writeLog','STOP','TIMEOUT','exports','./util','notificationId','squeue','routing','push','handleRun','handleTimeout'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xc93b,0x1d9));var _0xbc93=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0xc93b[_0x2cacef];return _0x289ba6;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xbc93('0x0'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x51af81,_0x38a8c7,_0x5866e4,_0x1e09bc){this[_0xbc93('0x1')]=uuid['v4']();this[_0xbc93('0x2')]=_0x51af81;this['agent']=_0x38a8c7;this['realtime']=_0x5866e4;this[_0xbc93('0x3')]=_0x1e09bc;this['squeue'][_0xbc93('0x4')](this[_0xbc93('0x5')]['bind'](this),this[_0xbc93('0x6')]['bind'](this));this[_0xbc93('0x2')]['on']('timeout',this['handleTimeout'][_0xbc93('0x7')](this));this[_0xbc93('0x2')]['on'](_0xbc93('0x8'),this[_0xbc93('0x9')][_0xbc93('0x7')](this));};Agent[_0xbc93('0xa')]['push']=function(){this[_0xbc93('0x2')]['push'](this[_0xbc93('0x5')][_0xbc93('0x7')](this),this[_0xbc93('0x6')][_0xbc93('0x7')](this));};Agent[_0xbc93('0xa')][_0xbc93('0x9')]=function(){this[_0xbc93('0x6')](!![]);};Agent[_0xbc93('0xa')][_0xbc93('0x5')]=function(){logger[_0xbc93('0xb')](_0xbc93('0xc'),this[_0xbc93('0x2')]['id'],this[_0xbc93('0xd')]['id']);if(_['isNil'](this[_0xbc93('0xe')][_0xbc93('0xf')][this[_0xbc93('0xd')]['id']])){logger[_0xbc93('0xb')](_0xbc93('0x10'),this[_0xbc93('0x2')]['id'],this[_0xbc93('0xd')]['id']);setTimeout(this[_0xbc93('0x4')][_0xbc93('0x7')](this),0x3e8);}else{if(this['routing'][_0xbc93('0x11')]||util[_0xbc93('0x12')](this[_0xbc93('0x2')]['id'],this['realtime'][_0xbc93('0xf')][this[_0xbc93('0xd')]['id']],this['squeue'][_0xbc93('0x13')],![])){this[_0xbc93('0xe')]['agents'][this[_0xbc93('0xd')]['id']][_0xbc93('0x14')]=!![];this['realtime'][_0xbc93('0xf')][this[_0xbc93('0xd')]['id']][_0xbc93('0x15')]=undefined;util['showNotification'](this[_0xbc93('0x1')],this[_0xbc93('0x2')]['id'],this[_0xbc93('0xe')][_0xbc93('0xf')][this['agent']['id']],null,this[_0xbc93('0x3')]);util['writeLog'](this[_0xbc93('0x2')]['id'],this['realtime'][_0xbc93('0xf')][this[_0xbc93('0xd')]['id']],_0xbc93('0x16')+(this[_0xbc93('0x3')][_0xbc93('0x11')]?':FORCED':''));}else{logger[_0xbc93('0xb')](_0xbc93('0x17'),this['squeue']['id'],this[_0xbc93('0xd')]['id']);setTimeout(this['push'][_0xbc93('0x7')](this),0x3e8);}}};Agent[_0xbc93('0xa')][_0xbc93('0x6')]=function(_0x16c22f){if(_[_0xbc93('0x18')](this[_0xbc93('0xe')][_0xbc93('0xf')][this[_0xbc93('0xd')]['id']])){return logger[_0xbc93('0xb')](_0xbc93('0x10'),this[_0xbc93('0x2')]['id'],this[_0xbc93('0xd')]['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xbc93('0x2')]['id'],this['agent']['id']);util[_0xbc93('0x19')](this[_0xbc93('0x1')],this['squeue']['id'],this['realtime']['agents'][this[_0xbc93('0xd')]['id']],null,this[_0xbc93('0x3')]);this[_0xbc93('0xe')][_0xbc93('0xf')][this[_0xbc93('0xd')]['id']]['busy']=![];this[_0xbc93('0xe')][_0xbc93('0xf')][this[_0xbc93('0xd')]['id']]['busyQueue']=undefined;util[_0xbc93('0x1a')](this[_0xbc93('0x2')]['id'],this['realtime'][_0xbc93('0xf')][this[_0xbc93('0xd')]['id']],_0x16c22f?_0xbc93('0x1b'):_0xbc93('0x1c'));}if(!_0x16c22f){setTimeout(this[_0xbc93('0x4')]['bind'](this),0x3e8);}};function agent(_0x205c0b,_0x4ec2e2,_0x127397,_0x432fbd){return new Agent(_0x205c0b,_0x4ec2e2,_0x127397,_0x432fbd);}module[_0xbc93('0x1d')]=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 e7e5b16..f90c01a 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 _0x6ddd=['push','handleRun','bind','handleTimeout','squeue','timeout','drained','handleDrained','prototype','isNil','Agents','length','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','busy','busyQueue','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','./util','../../../../../config/logger','routing','notificationId','queue','realtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ddd,0xae));var _0xd6dd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6ddd[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xd6dd('0x0'));var logger=require(_0xd6dd('0x1'))(_0xd6dd('0x2'));var Beepall=function(_0x250900,_0x5283c5,_0x3651aa,_0x5aebd8){this[_0xd6dd('0x3')]=uuid['v4']();this['squeue']=_0x250900;this[_0xd6dd('0x4')]=_0x5283c5;this[_0xd6dd('0x5')]=_0x3651aa;this[_0xd6dd('0x2')]=_0x5aebd8;this['squeue'][_0xd6dd('0x6')](this[_0xd6dd('0x7')][_0xd6dd('0x8')](this),this[_0xd6dd('0x9')]['bind'](this));this[_0xd6dd('0xa')]['on'](_0xd6dd('0xb'),this[_0xd6dd('0x9')][_0xd6dd('0x8')](this));this[_0xd6dd('0xa')]['on'](_0xd6dd('0xc'),this[_0xd6dd('0xd')][_0xd6dd('0x8')](this));};Beepall[_0xd6dd('0xe')][_0xd6dd('0x6')]=function(){this[_0xd6dd('0xa')][_0xd6dd('0x6')](this['handleRun'][_0xd6dd('0x8')](this),this[_0xd6dd('0x9')][_0xd6dd('0x8')](this));};Beepall[_0xd6dd('0xe')][_0xd6dd('0xd')]=function(){this[_0xd6dd('0x9')](!![]);};Beepall[_0xd6dd('0xe')]['handleRun']=function(){var _0x305928=!![];if(!_[_0xd6dd('0xf')](this[_0xd6dd('0x4')])&&!_[_0xd6dd('0xf')](this[_0xd6dd('0x4')][_0xd6dd('0x10')])&&this[_0xd6dd('0x4')][_0xd6dd('0x10')][_0xd6dd('0x11')]>0x0){for(var _0xbce865=0x0,_0x16b781;_0xbce8650x0){for(var _0x137f51=0x0,_0x2cb435;_0x137f510x0&&_0x5e59c3[_0xc50077+_0xd7df('0x27')]>=_0x5e59c3[_0xc50077+_0xd7df('0x28')]){writeLog(_0x4eabb8,_0x5e59c3,_0xc50077[_0xd7df('0x29')]()+_0xd7df('0x2a'));return![];}}return!![];};exports[_0xd7df('0x2b')]=function(_0x2b6fde,_0x163904,_0x5c4d17,_0xe53f53,_0x132fd1){return sendNotification(!![],_0x2b6fde,_0x163904,_0x5c4d17,_0xe53f53,_0x132fd1);};exports[_0xd7df('0x2c')]=function(_0x29f0e8,_0x29b812,_0x2aa5a8,_0x3f78fa,_0x36de76){return sendNotification(![],_0x29f0e8,_0x29b812,_0x2aa5a8,_0x3f78fa,_0x36de76);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x5075=['I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','name','emit','user:save','split','account','notificationShake','body','queue','msg','notificationTemplate'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x5075,0x73));var _0x5507=function(_0x24b852,_0x2bad67){_0x24b852=_0x24b852-0x0;var _0x180ad2=_0x5075[_0x24b852];return _0x180ad2;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var utils=require(_0x5507('0x2'));var Redis=require(_0x5507('0x3'));var config=require(_0x5507('0x4'));var logger=require(_0x5507('0x5'))(_0x5507('0x6'));config['redis']=_[_0x5507('0x7')](config[_0x5507('0x8')],{'host':_0x5507('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function sendNotification(_0x2cd9ee,_0x773559,_0x4c2d6d,_0x42c232,_0x7cc84c,_0xbf4b50){io['to'](util['format']('user:%s',_0x42c232[_0x5507('0xa')]))[_0x5507('0xb')](_0x5507('0xc'),_0x42c232);var _0x36c9eb=_0xbf4b50||{};var _0x50d6f5=_0x4c2d6d[_0x5507('0xd')]('.');var _0x1a6792={'uniqueid':_0x773559,'channel':_0x50d6f5[0x0],'id':_0x50d6f5[0x1],'title':_0x50d6f5[0x0]+'\x20interaction','interactionId':_0x50d6f5[0x2],'queue':_0x7cc84c?_0x7cc84c[_0x5507('0xa')]:null,'sound':_0x36c9eb[_0x5507('0xe')]['notificationSound'],'shake':_0x36c9eb[_0x5507('0xe')][_0x5507('0xf')]};try{if(!_0x36c9eb[_0x5507('0x10')]){_0x36c9eb[_0x5507('0x10')]={};}if(_0x7cc84c){_0x36c9eb[_0x5507('0x10')][_0x5507('0x11')]=_0x7cc84c;}else if(_0x36c9eb['body'][_0x5507('0x11')]){delete _0x36c9eb[_0x5507('0x10')][_0x5507('0x11')];}_0x1a6792[_0x5507('0x12')]=utils['getMustacheRender'](_0x36c9eb[_0x5507('0xe')][_0x5507('0x13')],_0x36c9eb);}catch(_0x2dfd06){_0x1a6792[_0x5507('0x12')]=_0x5507('0x14');logger[_0x5507('0x15')](util[_0x5507('0x16')](_0x5507('0x17'),_0x773559,_0x2dfd06[_0x5507('0x18')]));}io['to'](util[_0x5507('0x16')](_0x5507('0x19'),_0x42c232[_0x5507('0xa')]))[_0x5507('0xb')](util['format'](_0x5507('0x1a'),_0x2cd9ee?_0x5507('0x1b'):_0x5507('0x1c')),_0x1a6792);}function writeLog(_0x193eda,_0x54f473,_0x1dc53e){return logger[_0x5507('0x1d')](util[_0x5507('0x16')](_0x5507('0x1e'),_0x193eda,_0x54f473[_0x5507('0xa')],_0x1dc53e));}exports[_0x5507('0x1f')]=function(_0x501a94,_0x475970,_0x105535,_0x1f6325){if(_0x475970[_0x5507('0x20')]){writeLog(_0x501a94,_0x475970,_0x5507('0x21'));return![];}if(!_0x475970[_0x5507('0x22')]){writeLog(_0x501a94,_0x475970,_0x5507('0x23'));return![];}if(_0x475970[_0x105535+_0x5507('0x24')]){writeLog(_0x501a94,_0x475970,_0x5507('0x25'));return![];}if(_0x1f6325&&_0x475970[_0x5507('0x26')](_0x105535+_0x5507('0x27'))&&_0x475970[_0x5507('0x26')](_0x105535+_0x5507('0x28'))){if(_0x475970[_0x105535+_0x5507('0x27')]>0x0&&_0x475970[_0x105535+_0x5507('0x28')]>=_0x475970[_0x105535+'Capacity']){writeLog(_0x501a94,_0x475970,_0x105535[_0x5507('0x29')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5507('0x2a')]=function(_0x4ea271,_0xa66a01,_0x24668b,_0x4beb0a,_0x5cbb09){return sendNotification(!![],_0x4ea271,_0xa66a01,_0x24668b,_0x4beb0a,_0x5cbb09);};exports[_0x5507('0x2b')]=function(_0x1a18d0,_0x5912d4,_0x2521cb,_0x24574b,_0x85d383){return sendNotification(![],_0x1a18d0,_0x5912d4,_0x2521cb,_0x24574b,_0x85d383);};exports[_0x5507('0x2c')]=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 435bd31..766acc7 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 _0x837b=['./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','[%s][SYSTEM]\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash'];(function(_0x2c4d9f,_0x266437){var _0x3c558a=function(_0xe83d03){while(--_0xe83d03){_0x2c4d9f['push'](_0x2c4d9f['shift']());}};_0x3c558a(++_0x266437);}(_0x837b,0xd5));var _0xb837=function(_0x21d6fa,_0x5e623a){_0x21d6fa=_0x21d6fa-0x0;var _0x405b62=_0x837b[_0x21d6fa];return _0x405b62;};'use strict';var schema=require(_0xb837('0x0'));var sh=require(_0xb837('0x1'));var _=require(_0xb837('0x2'));var utils=require(_0xb837('0x3'));var logger=require('../../../../config/logger')(_0xb837('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0xb837('0x5')}});exports[_0xb837('0x6')]=function(_0x21fd8f,_0x4dc7a3){return function(_0x1806a5){try{var _0x262028={'command':_0x4dc7a3[0x0]};var _0x5c32f4=system[_0xb837('0x0')](_0x262028,{'typecast':!![]});if(_0x5c32f4[_0xb837('0x7')]){logger[_0xb837('0x8')]('[%s][SYSTEM]\x20%s',_0x21fd8f,_[_0xb837('0x9')](_0x5c32f4,_0xb837('0xa'))[_0xb837('0xb')](',\x20'));logger[_0xb837('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x21fd8f);_0x1806a5['next']();}else{var _0x51acb8=this;var _0x196dcb=utils[_0xb837('0xd')](_0x4dc7a3[0x0],this);logger[_0xb837('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x21fd8f,_0x196dcb);sh[_0xb837('0xe')](_[_0xb837('0xf')](_0x196dcb),function(_0x598da3,_0x4520a4){logger[_0xb837('0xc')](_0xb837('0x10'),_0x21fd8f,_0x598da3);if(_0x598da3==0x0){var _0x2757e1=_0x4520a4[_0xb837('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xb837('0x12')](_0x4dc7a3[0x1])||_[_0xb837('0x13')](_0x4dc7a3[0x1])){logger['info'](_0xb837('0x14'),_0x21fd8f);_0x51acb8[_0xb837('0x15')][_0x4dc7a3[0x1]]=_0x2757e1;}else{logger[_0xb837('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x21fd8f,_0x4dc7a3[0x1],_0x2757e1);_0x51acb8[_0xb837('0x15')][_0x4dc7a3[0x1]]=_0x2757e1;}}_0x1806a5[_0xb837('0x16')]();});}}catch(_0x30d4fc){logger['error'](_0xb837('0x17'),_0x21fd8f,_[_0xb837('0x18')](_0x30d4fc)?JSON[_0xb837('0x19')](_0x30d4fc):_0x30d4fc);logger[_0xb837('0xc')](_0xb837('0x1a'),_0x21fd8f);_0x1806a5['next']();}};}; \ No newline at end of file +var _0xbb1e=['[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','shelljs','lodash','./utils','../../../../config/logger','string','validate','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','trim'];(function(_0x30f11c,_0x15e2a8){var _0x3807e1=function(_0x1bf73f){while(--_0x1bf73f){_0x30f11c['push'](_0x30f11c['shift']());}};_0x3807e1(++_0x15e2a8);}(_0xbb1e,0x90));var _0xebb1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbb1e[_0x19e35c];return _0x3e1fe8;};'use strict';var schema=require('validate');var sh=require(_0xebb1('0x0'));var _=require(_0xebb1('0x1'));var utils=require(_0xebb1('0x2'));var logger=require(_0xebb1('0x3'))('routing');var system=schema({'command':{'type':_0xebb1('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x43c75b,_0x298080){return function(_0x9207fa){try{var _0x4344f7={'command':_0x298080[0x0]};var _0xca1cb7=system[_0xebb1('0x5')](_0x4344f7,{'typecast':!![]});if(_0xca1cb7[_0xebb1('0x6')]){logger[_0xebb1('0x7')](_0xebb1('0x8'),_0x43c75b,_[_0xebb1('0x9')](_0xca1cb7,'message')[_0xebb1('0xa')](',\x20'));logger[_0xebb1('0xb')](_0xebb1('0xc'),_0x43c75b);_0x9207fa[_0xebb1('0xd')]();}else{var _0x5ba829=this;var _0xc420df=utils['getMustacheRender'](_0x298080[0x0],this);logger[_0xebb1('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x43c75b,_0xc420df);sh[_0xebb1('0xe')](_[_0xebb1('0xf')](_0xc420df),function(_0x56c575,_0x40200a){logger[_0xebb1('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x43c75b,_0x56c575);if(_0x56c575==0x0){var _0x59a0af=_0x40200a['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x298080[0x1])||_['isEmpty'](_0x298080[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x43c75b);_0x5ba829['body'][_0x298080[0x1]]=_0x59a0af;}else{logger[_0xebb1('0xb')](_0xebb1('0x10'),_0x43c75b,_0x298080[0x1],_0x59a0af);_0x5ba829[_0xebb1('0x11')][_0x298080[0x1]]=_0x59a0af;}}_0x9207fa[_0xebb1('0xd')]();});}}catch(_0x34c82e){logger[_0xebb1('0x7')](_0xebb1('0x8'),_0x43c75b,_[_0xebb1('0x12')](_0x34c82e)?JSON[_0xebb1('0x13')](_0x34c82e):_0x34c82e);logger[_0xebb1('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x43c75b);_0x9207fa[_0xebb1('0xd')]();}};}; \ 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 25bc9ce..966c238 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 _0x54ab=['routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x22eb71,_0x424b0f){var _0x35de0d=function(_0x2af081){while(--_0x2af081){_0x22eb71['push'](_0x22eb71['shift']());}};_0x35de0d(++_0x424b0f);}(_0x54ab,0xa6));var _0xb54a=function(_0x2594ef,_0xeeffc0){_0x2594ef=_0x2594ef-0x0;var _0x1faa38=_0x54ab[_0x2594ef];return _0x1faa38;};'use strict';var schema=require(_0xb54a('0x0'));var _=require(_0xb54a('0x1'));var rpc={'chatInteraction':require(_0xb54a('0x2')),'openchannelInteraction':require(_0xb54a('0x3')),'smsInteraction':require(_0xb54a('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xb54a('0x5')),'whatsappInteraction':require(_0xb54a('0x6'))};var logger=require(_0xb54a('0x7'))(_0xb54a('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xb54a('0x9')}});exports[_0xb54a('0xa')]=function(_0x5257c6,_0x5eb032,_0x26a19e,_0x33ccfc){return function(_0x163f16){try{var _0x9066bb={'tag':_0x5eb032[0x0]};var _0x19624f=tag[_0xb54a('0x0')](_0x9066bb,{'typecast':!![]});if(_0x19624f['length']){logger[_0xb54a('0xb')](_0xb54a('0xc'),_0x5257c6,_[_0xb54a('0xd')](_0x19624f,_0xb54a('0xe'))[_0xb54a('0xf')](',\x20'));logger[_0xb54a('0x10')](_0xb54a('0x11'),_0x5257c6);_0x163f16[_0xb54a('0x12')]();}else{var _0x40cefd={'ids':[_0x5eb032[0x0]]};if(rpc[_0x33ccfc[_0xb54a('0x13')]+'Interaction']){rpc[_0x33ccfc[_0xb54a('0x13')]+_0xb54a('0x14')][_0xb54a('0x15')](_0x33ccfc[_0xb54a('0x16')]['id'],_0x40cefd)[_0xb54a('0x17')](function(_0x8e2ca){logger[_0xb54a('0x10')](_0xb54a('0x18'),_0x5257c6,_0x5eb032[0x1],_0x33ccfc[_0xb54a('0x13')],_0x33ccfc[_0xb54a('0x16')]['id']);})[_0xb54a('0x19')](function(_0x36cab3){logger[_0xb54a('0xb')](_0xb54a('0xc'),_0x5257c6,JSON[_0xb54a('0x1a')](_0x36cab3));logger[_0xb54a('0x10')](_0xb54a('0x11'),_0x5257c6);})[_0xb54a('0x1b')](function(){_0x163f16[_0xb54a('0x12')]();});}}}catch(_0x40402a){logger[_0xb54a('0xb')]('[%s][TAG]\x20%s',_0x5257c6,_[_0xb54a('0x1c')](_0x40402a)?JSON[_0xb54a('0x1a')](_0x40402a):_0x40402a);logger[_0xb54a('0x10')](_0xb54a('0x11'),_0x5257c6);_0x163f16['next']();}};}; \ No newline at end of file +var _0x61e8=['Interaction','addTags','interaction','then','catch','stringify','finally','[%s][TAG]\x20%s','isObject','next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','error','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel'];(function(_0x2816da,_0x4f6b8e){var _0x84c0bb=function(_0x30fc2b){while(--_0x30fc2b){_0x2816da['push'](_0x2816da['shift']());}};_0x84c0bb(++_0x4f6b8e);}(_0x61e8,0x112));var _0x861e=function(_0x1a358b,_0x99ca75){_0x1a358b=_0x1a358b-0x0;var _0x47d149=_0x61e8[_0x1a358b];return _0x47d149;};'use strict';var schema=require(_0x861e('0x0'));var _=require(_0x861e('0x1'));var rpc={'chatInteraction':require(_0x861e('0x2')),'openchannelInteraction':require(_0x861e('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x861e('0x4'))};var logger=require(_0x861e('0x5'))(_0x861e('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0xc291af,_0x877377,_0x364b2e,_0x16c814){return function(_0x50a6cc){try{var _0x5a5c8f={'tag':_0x877377[0x0]};var _0x2828da=tag[_0x861e('0x0')](_0x5a5c8f,{'typecast':!![]});if(_0x2828da['length']){logger[_0x861e('0x7')]('[%s][TAG]\x20%s',_0xc291af,_['map'](_0x2828da,'message')[_0x861e('0x8')](',\x20'));logger[_0x861e('0x9')](_0x861e('0xa'),_0xc291af);_0x50a6cc['next']();}else{var _0x102eac={'ids':[_0x877377[0x0]]};if(rpc[_0x16c814[_0x861e('0xb')]+_0x861e('0xc')]){rpc[_0x16c814[_0x861e('0xb')]+_0x861e('0xc')][_0x861e('0xd')](_0x16c814[_0x861e('0xe')]['id'],_0x102eac)[_0x861e('0xf')](function(_0x226826){logger[_0x861e('0x9')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0xc291af,_0x877377[0x1],_0x16c814[_0x861e('0xb')],_0x16c814[_0x861e('0xe')]['id']);})[_0x861e('0x10')](function(_0x1fc79a){logger[_0x861e('0x7')]('[%s][TAG]\x20%s',_0xc291af,JSON[_0x861e('0x11')](_0x1fc79a));logger[_0x861e('0x9')](_0x861e('0xa'),_0xc291af);})[_0x861e('0x12')](function(){_0x50a6cc['next']();});}}}catch(_0x2168bc){logger[_0x861e('0x7')](_0x861e('0x13'),_0xc291af,_[_0x861e('0x14')](_0x2168bc)?JSON['stringify'](_0x2168bc):_0x2168bc);logger[_0x861e('0x9')](_0x861e('0xa'),_0xc291af);_0x50a6cc[_0x861e('0x15')]();}};}; \ 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 e02cdbe..d603c5c 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 _0x57f1=['[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','../../../../config/logger','routing','lodash','replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','method','login','params','stringify','utf8','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','then','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x57f1,0x165));var _0x157f=function(_0x2a680e,_0x356cb5){_0x2a680e=_0x2a680e-0x0;var _0x153c3b=_0x57f1[_0x2a680e];return _0x153c3b;};'use strict';var rp=require('request-promise');var logger=require(_0x157f('0x0'))(_0x157f('0x1'));var _=require(_0x157f('0x2'));var arr=[];exports['consequence']=function(_0x37c149,_0x3f0902){return function(_0x1f93e1){var _0x3e3fe2=_0x3f0902[0xa];var _0x5e4393=_0x3f0902[0xb];var _0x4655e4=_0x3f0902[0xc];var _0x40d9f7=_0x3f0902[0xd];var _0x263be0=_0x3f0902[0xe];var _0x496843=_0x3f0902[0xf][_0x157f('0x3')](/\n/g,_0x157f('0x4'));var _0x4bd8aa=_0x3f0902[0x10][_0x157f('0x3')](/\n/g,'\x20');if(!arr[_0x157f('0x5')](_0x5e4393)){arr[_0x157f('0x6')](_0x5e4393);var _0x1c3ff3=_0x3f0902[0x3];var _0x3b600c=_0x3f0902[0x4];var _0x27125d=_0x3f0902[0x1];var _0x63009a=_0x3f0902[0x0];var _0x34e2fc={};_0x34e2fc[_0x157f('0x7')]=_0x3f0902[0x8]+'?params='+_0x4655e4+'|'+_0x3e3fe2+'|'+_0x40d9f7+'|'+_0x5e4393+'|'+_0x263be0;_0x34e2fc[_0x157f('0x8')]=_0x3f0902[0x7]+_0x157f('0x9')+_0x4655e4+'|'+_0x3e3fe2+'|'+_0x40d9f7+'|'+_0x5e4393+'|'+_0x263be0+'|'+_0x496843+'|'+_0x4bd8aa;_0x34e2fc[_0x157f('0xa')]=_0x3f0902[0x9];var _0x2a9797={};_0x2a9797[_0x157f('0xb')]='2.0';_0x2a9797[_0x157f('0xc')]=_0x157f('0xd');var _0x5de0eb=[];_0x5de0eb[_0x157f('0x6')](_0x3f0902[0x2]);_0x5de0eb[_0x157f('0x6')](_0x3f0902[0x5]);_0x5de0eb['push'](_0x3f0902[0x6]);_0x2a9797[_0x157f('0xe')]=_0x5de0eb;_0x2a9797['id']=0x1;var _0x4ca167=JSON[_0x157f('0xf')](_0x2a9797);var _0x4da262={'encoding':_0x157f('0x10'),'method':'POST','timeout':0x2710,'url':_0x1c3ff3,'headers':{'Content-Type':_0x157f('0x11')},'body':_0x4ca167};return rp(_0x4da262)['then'](function(_0x8e250b){const _0x276d50=JSON[_0x157f('0x12')](_0x8e250b);if(!_0x276d50[_0x157f('0x13')][_0x157f('0x14')]){throw new Error(_0x157f('0x15'));}var _0x54ff59=_0x5e4393;var _0x5032bd=_0x157f('0x16')+_0x27125d+_0x157f('0x17')+_0x63009a+_0x157f('0x18')+_0x54ff59+_0x157f('0x19')+JSON['stringify'](_0x34e2fc);var _0x5b35aa=_0x3b600c+'?'+_0x5032bd;return rp(_0x5b35aa);})[_0x157f('0x1a')](function(_0x525aff){logger[_0x157f('0x1b')](_0x157f('0x1c'),_0x37c149,_0x525aff);_0x1f93e1[_0x157f('0x1d')]();})[_0x157f('0x1e')](function(_0x49c71d){logger[_0x157f('0x1f')](_0x157f('0x20'),_0x37c149,_[_0x157f('0x21')](_0x49c71d)?JSON[_0x157f('0xf')](_0x49c71d):_0x49c71d);_0x1f93e1[_0x157f('0x1d')]();});}else{logger[_0x157f('0x1b')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x37c149);_0x1f93e1[_0x157f('0x22')]();}};}; \ No newline at end of file +var _0x0d72=['channelId=','&serviceId=','&sessionId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','title','jsonrpc','login','params','stringify','utf8','POST','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application'];(function(_0x49655b,_0x40c634){var _0x1878c9=function(_0x3b3b7b){while(--_0x3b3b7b){_0x49655b['push'](_0x49655b['shift']());}};_0x1878c9(++_0x40c634);}(_0x0d72,0x151));var _0x20d7=function(_0x14a465,_0x59bdab){_0x14a465=_0x14a465-0x0;var _0x3378da=_0x0d72[_0x14a465];return _0x3378da;};'use strict';var rp=require(_0x20d7('0x0'));var logger=require(_0x20d7('0x1'))(_0x20d7('0x2'));var _=require(_0x20d7('0x3'));var arr=[];exports[_0x20d7('0x4')]=function(_0x2d3639,_0x1debc4){return function(_0x30bf0c){var _0x1fd10d=_0x1debc4[0xa];var _0x980d86=_0x1debc4[0xb];var _0x319e2a=_0x1debc4[0xc];var _0x16373a=_0x1debc4[0xd];var _0x3fd631=_0x1debc4[0xe];var _0xc75125=_0x1debc4[0xf][_0x20d7('0x5')](/\n/g,_0x20d7('0x6'));var _0xb69b45=_0x1debc4[0x10][_0x20d7('0x5')](/\n/g,'\x20');if(!arr[_0x20d7('0x7')](_0x980d86)){arr[_0x20d7('0x8')](_0x980d86);var _0x2668c1=_0x1debc4[0x3];var _0x2c10e7=_0x1debc4[0x4];var _0x5a0ac3=_0x1debc4[0x1];var _0x54f51b=_0x1debc4[0x0];var _0x19c529={};_0x19c529[_0x20d7('0x9')]=_0x1debc4[0x8]+'?params='+_0x319e2a+'|'+_0x1fd10d+'|'+_0x16373a+'|'+_0x980d86+'|'+_0x3fd631;_0x19c529['urlOnRing']=_0x1debc4[0x7]+_0x20d7('0xa')+_0x319e2a+'|'+_0x1fd10d+'|'+_0x16373a+'|'+_0x980d86+'|'+_0x3fd631+'|'+_0xc75125+'|'+_0xb69b45;_0x19c529[_0x20d7('0xb')]=_0x1debc4[0x9];var _0x3d5257={};_0x3d5257[_0x20d7('0xc')]='2.0';_0x3d5257['method']=_0x20d7('0xd');var _0x1b77e7=[];_0x1b77e7[_0x20d7('0x8')](_0x1debc4[0x2]);_0x1b77e7['push'](_0x1debc4[0x5]);_0x1b77e7[_0x20d7('0x8')](_0x1debc4[0x6]);_0x3d5257[_0x20d7('0xe')]=_0x1b77e7;_0x3d5257['id']=0x1;var _0x33f5f6=JSON[_0x20d7('0xf')](_0x3d5257);var _0x26f552={'encoding':_0x20d7('0x10'),'method':_0x20d7('0x11'),'timeout':0x2710,'url':_0x2668c1,'headers':{'Content-Type':_0x20d7('0x12')},'body':_0x33f5f6};return rp(_0x26f552)['then'](function(_0x5515ad){const _0x408738=JSON[_0x20d7('0x13')](_0x5515ad);if(!_0x408738[_0x20d7('0x14')][_0x20d7('0x15')]){throw new Error(_0x20d7('0x16'));}var _0x125fa5=_0x980d86;var _0x4e9acb=_0x20d7('0x17')+_0x5a0ac3+_0x20d7('0x18')+_0x54f51b+_0x20d7('0x19')+_0x125fa5+_0x20d7('0x1a')+JSON[_0x20d7('0xf')](_0x19c529);var _0x2bb18e=_0x2c10e7+'?'+_0x4e9acb;return rp(_0x2bb18e);})[_0x20d7('0x1b')](function(_0x552aa0){logger[_0x20d7('0x1c')](_0x20d7('0x1d'),_0x2d3639,_0x552aa0);_0x30bf0c['stop']();})[_0x20d7('0x1e')](function(_0xb2f966){logger[_0x20d7('0x1f')](_0x20d7('0x20'),_0x2d3639,_[_0x20d7('0x21')](_0xb2f966)?JSON[_0x20d7('0xf')](_0xb2f966):_0xb2f966);_0x30bf0c[_0x20d7('0x22')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x2d3639);_0x30bf0c[_0x20d7('0x23')]();}};}; \ 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 42f8ade..cb9287c 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x58a648,_0x12dc43){var _0x29bb88=function(_0x4fa183){while(--_0x4fa183){_0x58a648['push'](_0x58a648['shift']());}};_0x29bb88(++_0x12dc43);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x705390,_0x44a027){var _0x255648=function(_0x4d3cbb){while(--_0x4d3cbb){_0x705390['push'](_0x705390['shift']());}};_0x255648(++_0x44a027);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 07846b4..7e24f8e 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 _0xd3d1=['%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','length','app','.js','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','amazonlex','tag','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','paused','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','bluebird','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format'];(function(_0x5e324b,_0x475742){var _0x2b9c88=function(_0x190364){while(--_0x190364){_0x5e324b['push'](_0x5e324b['shift']());}};_0x2b9c88(++_0x475742);}(_0xd3d1,0x172));var _0x1d3d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd3d1[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x1d3d('0x2'));var utils=require(_0x1d3d('0x3'));var logger=require(_0x1d3d('0x4'))(_0x1d3d('0x5'));var rpc={'openchannelQueueReport':require(_0x1d3d('0x6')),'mailQueueReport':require(_0x1d3d('0x7')),'chatQueueReport':require(_0x1d3d('0x8')),'smsQueueReport':require(_0x1d3d('0x9')),'faxQueueReport':require(_0x1d3d('0xa')),'whatsappQueueReport':require(_0x1d3d('0xb'))};var RuleEngine=require(_0x1d3d('0xc'));function getId(_0xb1b3c6,_0xe10bca,_0x2c377c){return util[_0x1d3d('0xd')](_0x1d3d('0xe'),_0xb1b3c6,_0xe10bca||0x0,_0x2c377c||0x0);}function getIntervals(_0x3683c9,_0x510a37){var _0x2d967e=[];if(!_[_0x1d3d('0xf')](_0x510a37[_0x1d3d('0x10')])&&!_[_0x1d3d('0xf')](_0x3683c9[_0x510a37[_0x1d3d('0x10')]])&&!_[_0x1d3d('0xf')](_0x3683c9[_0x510a37[_0x1d3d('0x10')]][_0x1d3d('0x11')])){_0x2d967e=_[_0x1d3d('0x12')](_0x3683c9[_0x510a37[_0x1d3d('0x10')]][_0x1d3d('0x11')],'interval');}else if(!_[_0x1d3d('0xf')](_0x510a37[_0x1d3d('0x13')])){_0x2d967e=[_0x510a37['interval']];}return _0x2d967e;}exports['listen']=function(_0x12bd00){_0x12bd00[_0x1d3d('0x14')]={};return new BPromise(function(_0x1a8035,_0x59b907){var _0x4098a9={'Start':function(_0x4dcc22){var _0x1d54f3=this;return new Promise(function(_0x33e7d9,_0x3491e4){if(_0x4dcc22){try{var _0x24bb8c=[];var _0x21c2e4=getId(_0x4dcc22[_0x1d3d('0x15')],_0x4dcc22[_0x1d3d('0x16')]?_0x4dcc22['message']['id']:0x0,_0x4dcc22['interaction']?_0x4dcc22[_0x1d3d('0x17')]['id']:0x0);if(_0x4dcc22[_0x1d3d('0x18')]&&_['isArray'](_0x4dcc22[_0x1d3d('0x18')])&&_0x4dcc22['applications'][_0x1d3d('0x19')]){for(var _0x392e92=0x0;_0x392e92<_0x4dcc22[_0x1d3d('0x18')][_0x1d3d('0x19')];_0x392e92+=0x1){var _0x5a6772=_0x4dcc22[_0x1d3d('0x18')][_0x392e92];if(fs['existsSync'](path['join'](__dirname,_0x1d3d('0x18'),_0x5a6772[_0x1d3d('0x1a')]+_0x1d3d('0x1b')))){var _0x344a03=[];switch(_0x5a6772[_0x1d3d('0x1a')][_0x1d3d('0x1c')]()){case _0x1d3d('0x1d'):var _0xa55c43=_0x5a6772[_0x1d3d('0x1e')][_0x1d3d('0x1f')](',');if(_0x4dcc22[_0x1d3d('0x15')]==='mail'){_0x344a03[_0x1d3d('0x20')](_0xa55c43[0x0]);_0x344a03[_0x1d3d('0x20')](_0xa55c43[0x1]);_0x344a03['push'](_0xa55c43[_0x1d3d('0x21')](0x2,_0xa55c43['length'])[_0x1d3d('0x22')](','));}else{_0x344a03[_0x1d3d('0x20')](_0xa55c43[0x0]);_0x344a03[_0x1d3d('0x20')](_0xa55c43[_0x1d3d('0x21')](0x1,_0xa55c43[_0x1d3d('0x19')])[_0x1d3d('0x22')](','));}break;case _0x1d3d('0x23'):var _0x298fd3=_0x5a6772[_0x1d3d('0x1e')][_0x1d3d('0x1f')](',');_0x344a03[_0x1d3d('0x20')](_0x298fd3[0x0]);_0x344a03['push'](_0x298fd3[0x1]);_0x344a03[_0x1d3d('0x20')](_0x298fd3['slice'](0x2,_0x298fd3[_0x1d3d('0x19')])[_0x1d3d('0x22')](','));break;case'dialogflowv2':var _0x185913=_0x5a6772[_0x1d3d('0x1e')][_0x1d3d('0x1f')](',');_0x344a03[_0x1d3d('0x20')](_0x185913[0x0]);_0x344a03['push'](_0x185913[0x1]);_0x344a03[_0x1d3d('0x20')](_0x185913[0x2]);_0x344a03[_0x1d3d('0x20')](_0x185913[0x3]);_0x344a03['push'](_0x185913[_0x1d3d('0x21')](0x4,_0x185913['length'])[_0x1d3d('0x22')](','));break;case _0x1d3d('0x24'):var _0x5ec019=_0x5a6772[_0x1d3d('0x1e')][_0x1d3d('0x1f')](',');_0x344a03[_0x1d3d('0x20')](_0x5ec019[0x0]);_0x344a03[_0x1d3d('0x20')](_0x5ec019[0x1]);_0x344a03[_0x1d3d('0x20')](_0x5ec019[0x2]);_0x344a03[_0x1d3d('0x20')](_0x5ec019[0x3]);_0x344a03[_0x1d3d('0x20')](_0x5ec019[_0x1d3d('0x21')](0x4,_0x5ec019[_0x1d3d('0x19')])['join'](','));break;case _0x1d3d('0x16'):_0x344a03[_0x1d3d('0x20')](_0x5a6772[_0x1d3d('0x1e')]);break;case _0x1d3d('0x25'):_0x344a03['push'](_0x5a6772['TagId']);_0x344a03[_0x1d3d('0x20')](_0x5a6772[_0x1d3d('0x1e')]);break;case'tvox':var _0x43ef5d=utils[_0x1d3d('0x26')](_0x4dcc22[_0x1d3d('0x27')][_0x1d3d('0x28')],_0x4dcc22);var _0x5d906d=_0x5a6772['appdata'][_0x1d3d('0x1f')](',');_0x344a03['push'](_0x5d906d[0x0]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0x1]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0x2]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0x3]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0x4]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0x5]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0x6]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0x7]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0x8]);_0x344a03['push'](_0x5d906d[0x9]);_0x344a03[_0x1d3d('0x20')](_0x5d906d[0xa]);_0x344a03['push'](_0x4dcc22[_0x1d3d('0x17')]['id']);_0x344a03[_0x1d3d('0x20')](_0x4dcc22['message']['id']);_0x344a03[_0x1d3d('0x20')](_0x5a6772[_0x1d3d('0x29')]);_0x344a03[_0x1d3d('0x20')](_0x4dcc22[_0x1d3d('0x17')]['ContactId']);_0x344a03['push'](_0x4dcc22[_0x1d3d('0x2a')]['body']);_0x344a03[_0x1d3d('0x20')](_0x43ef5d);break;default:_0x344a03=_[_0x1d3d('0xf')](_0x5a6772['appdata'])?[]:_0x5a6772[_0x1d3d('0x1e')][_0x1d3d('0x1f')](',');}var _0x51be79={'id':util[_0x1d3d('0xd')](_0x1d3d('0x2b'),_0x21c2e4,_0x5a6772['id'],_0x5a6772[_0x1d3d('0x1a')]),'condition':require(_0x1d3d('0x2c'))[_0x1d3d('0x2d')](_0x21c2e4,getIntervals(_0x12bd00[_0x1d3d('0x2e')],_0x5a6772),_0x12bd00),'consequence':require('./applications/'+_0x5a6772[_0x1d3d('0x1a')])[_0x1d3d('0x2f')](_0x21c2e4,_0x344a03,_0x12bd00,_0x4dcc22),'p':_0x5a6772[_0x1d3d('0x30')]||0x0};logger[_0x1d3d('0x31')](_0x1d3d('0x32'),_0x51be79['id'],'on\x20interval',getIntervals(_0x12bd00[_0x1d3d('0x2e')],_0x5a6772)[_0x1d3d('0x22')](_0x1d3d('0x33')));_0x24bb8c[_0x1d3d('0x20')](_0x51be79);}else{logger['error'](_0x1d3d('0x34'),path[_0x1d3d('0x22')](__dirname,_0x1d3d('0x18'),_0x5a6772[_0x1d3d('0x1a')]+_0x1d3d('0x1b')));}}_0x12bd00['rules'][_0x21c2e4]=new RuleEngine(_0x24bb8c);_0x12bd00['rules'][_0x21c2e4][_0x1d3d('0x35')](_0x4dcc22,function(_0xa58235){logger[_0x1d3d('0x31')](_0x1d3d('0x36'),JSON[_0x1d3d('0x37')](_0xa58235['matchPath']));if(_0x12bd00[_0x1d3d('0x14')][_0x21c2e4]){_0x12bd00['rules'][_0x21c2e4][_0x1d3d('0x38')](_0x1d3d('0x39'));}});return _0x33e7d9({'code':0xc8,'message':_0x4dcc22});}else{logger[_0x1d3d('0x31')](_0x1d3d('0x3a'));return _0x33e7d9({'code':0xc8,'message':_0x4dcc22});}}catch(_0x58c7ab){logger[_0x1d3d('0x3b')](_0x58c7ab[_0x1d3d('0x3c')]);return _0x3491e4(_0x1d54f3[_0x1d3d('0x3b')](0x1f4,_0x58c7ab));}}return _0x3491e4(_0x1d3d('0x3d'));});},'AcceptMessage':function(_0x23a6d9){var _0x1c8ee3=this;return new Promise(function(_0x3a3389,_0x55aa8a){if(_0x23a6d9[_0x1d3d('0x3e')]&&_0x23a6d9['agent']['id']){if(_0x12bd00[_0x1d3d('0x3f')][_0x23a6d9[_0x1d3d('0x3e')]['id']]){_0x12bd00['agents'][_0x23a6d9[_0x1d3d('0x3e')]['id']]['busy']=![];_0x12bd00[_0x1d3d('0x3f')][_0x23a6d9['agent']['id']][_0x1d3d('0x40')]=undefined;}}if(_0x23a6d9[_0x1d3d('0x16')]&&_0x23a6d9[_0x1d3d('0x16')]['id']){try{var _0x25b547=getId(_0x23a6d9[_0x1d3d('0x15')],_0x23a6d9[_0x1d3d('0x16')]?_0x23a6d9[_0x1d3d('0x16')]['id']:0x0,_0x23a6d9[_0x1d3d('0x17')]?_0x23a6d9['interaction']['id']:0x0);if(_0x12bd00['rules'][_0x25b547]){_0x12bd00['rules'][_0x25b547][_0x1d3d('0x38')](_0x1d3d('0x41'));if(rpc[_0x23a6d9[_0x1d3d('0x15')]+_0x1d3d('0x42')]){rpc[_0x23a6d9[_0x1d3d('0x15')]+_0x1d3d('0x42')]['update'](_0x25b547,{'UserId':_0x23a6d9['message']['UserId']})['catch'](function(){logger[_0x1d3d('0x3b')](_0x1d3d('0x43'));});}}return _0x3a3389({'code':0xc8,'message':_0x23a6d9});}catch(_0x89a16a){logger[_0x1d3d('0x3b')](_0x89a16a[_0x1d3d('0x3c')]);return _0x55aa8a(_0x1c8ee3[_0x1d3d('0x3b')](0x1f4,_0x89a16a));}}logger[_0x1d3d('0x3b')](_0x1d3d('0x44'));return _0x55aa8a(_0x1c8ee3[_0x1d3d('0x3b')](0x1f4,_0x1d3d('0x44')));});},'RejectMessage':function(_0xefc84c){var _0xb88d59=this;return new Promise(function(_0x3e6431,_0x212929){if(_0xefc84c[_0x1d3d('0x3e')]&&_0xefc84c['agent']['id']){try{if(_0x12bd00[_0x1d3d('0x3f')][_0xefc84c[_0x1d3d('0x3e')]['id']]){_0x12bd00[_0x1d3d('0x3f')][_0xefc84c[_0x1d3d('0x3e')]['id']]['busy']=![];_0x12bd00[_0x1d3d('0x3f')][_0xefc84c['agent']['id']]['busyQueue']=undefined;}return _0x3e6431({'code':0xc8,'message':_0xefc84c});}catch(_0x27b3d9){logger[_0x1d3d('0x3b')](_0x27b3d9['stack']);return _0x212929(_0xb88d59[_0x1d3d('0x3b')](0x1f4,_0x27b3d9));}}logger[_0x1d3d('0x3b')]('message\x20is\x20empty');return _0x212929(_0xb88d59[_0x1d3d('0x3b')](0x1f4,_0x1d3d('0x44')));});},'AbandonInteraction':function(_0x15d9b4){var _0x3ad696=this;return new Promise(function(_0x3dc699,_0x267586){if(_0x15d9b4[_0x1d3d('0x15')]&&_0x15d9b4[_0x1d3d('0x17')]&&_0x15d9b4[_0x1d3d('0x17')]['id']){try{var _0x543cde=getId(_0x15d9b4[_0x1d3d('0x15')],_0x15d9b4['message']?_0x15d9b4['message']['id']:0x0,_0x15d9b4['interaction']?_0x15d9b4['interaction']['id']:0x0);if(_0x12bd00[_0x1d3d('0x14')][_0x543cde]){_0x12bd00[_0x1d3d('0x14')][_0x543cde][_0x1d3d('0x38')](_0x1d3d('0x41'));}return _0x3dc699({'code':0xc8,'message':_0x15d9b4});}catch(_0x505ae2){logger[_0x1d3d('0x3b')](_0x505ae2['stack']);return _0x267586(_0x3ad696[_0x1d3d('0x3b')](0x1f4,_0x505ae2));}}logger[_0x1d3d('0x3b')]('message\x20is\x20empty');return _0x267586(_0x3ad696[_0x1d3d('0x3b')](0x1f4,_0x1d3d('0x44')));});},'AgentCapacity':function(_0x4ce2fa){var _0x270611=this;return new Promise(function(_0x4318ed,_0x295145){if(_0x12bd00[_0x1d3d('0x3f')][_0x1d3d('0x45')](_0x4ce2fa['id'])){for(var _0x16e757 in _0x4ce2fa['capacity']){if(_0x4ce2fa[_0x1d3d('0x46')][_0x1d3d('0x45')](_0x16e757)){if(_0x12bd00[_0x1d3d('0x3f')][_0x4ce2fa['id']][_0x1d3d('0x45')](_0x16e757+_0x1d3d('0x47'))){_0x12bd00['agents'][_0x4ce2fa['id']][_0x16e757+_0x1d3d('0x47')]=parseInt(_0x4ce2fa['capacity'][_0x16e757],0xa);}}}_0x12bd00[_0x1d3d('0x3f')][_0x4ce2fa['id']]['updateRealtime']();return _0x4318ed({'code':0xc8,'message':_0x12bd00[_0x1d3d('0x3f')][_0x4ce2fa['id']]});}else{return _0x295145(_0x270611[_0x1d3d('0x3b')](0x1f4,_0x1d3d('0x48')));}});},'Agents':function(_0x1711ee){return new Promise(function(_0x1e781d){var _0x426afa=_[_0x1d3d('0x49')](_0x12bd00['agents']);if(_0x1711ee&&_0x1711ee['id']){var _0x3a5a65=_[_0x1d3d('0x4a')](_0x426afa,function(_0x2c1781){return _0x2c1781['id']===_0x1711ee['id'];});_0x1e781d(_0x3a5a65);}else{_0x1e781d({'count':_0x426afa[_0x1d3d('0x19')],'rows':_0x426afa});}});},'ChatQueues':function(){return new Promise(function(_0x41bcdd){var _0x44243d=[];for(var _0x4e395b in _0x12bd00[_0x1d3d('0x4b')]){if(_0x12bd00[_0x1d3d('0x4b')][_0x1d3d('0x45')](_0x4e395b)){var _0xa3bc=_0x12bd00[_0x1d3d('0x4b')][_0x4e395b];var _0x4bff04={'id':_0xa3bc['id'],'available':_0xa3bc[_0x1d3d('0x4c')],'loggedIn':_0xa3bc[_0x1d3d('0x4d')],'name':_0xa3bc[_0x1d3d('0x4e')],'paused':_0xa3bc['paused'],'waiting':_0xa3bc[_0x1d3d('0x4f')]};_0x44243d['push'](_0x4bff04);}}_0x41bcdd({'count':_0x44243d[_0x1d3d('0x19')],'rows':_0x44243d});});},'MailQueues':function(){return new Promise(function(_0x576a7f){var _0x449a86=[];for(var _0x378878 in _0x12bd00[_0x1d3d('0x50')]){if(_0x12bd00['mailQueues'][_0x1d3d('0x45')](_0x378878)){var _0x15de4f=_0x12bd00[_0x1d3d('0x50')][_0x378878];var _0x5ad698={'id':_0x15de4f['id'],'available':_0x15de4f[_0x1d3d('0x4c')],'loggedIn':_0x15de4f[_0x1d3d('0x4d')],'name':_0x15de4f[_0x1d3d('0x4e')],'paused':_0x15de4f['paused'],'waiting':_0x15de4f[_0x1d3d('0x4f')]};_0x449a86[_0x1d3d('0x20')](_0x5ad698);}}_0x576a7f({'count':_0x449a86[_0x1d3d('0x19')],'rows':_0x449a86});});},'OpenchannelQueues':function(){return new Promise(function(_0x411cb0){var _0x107494=[];for(var _0x48ba6e in _0x12bd00[_0x1d3d('0x51')]){if(_0x12bd00[_0x1d3d('0x51')][_0x1d3d('0x45')](_0x48ba6e)){var _0x550a95=_0x12bd00[_0x1d3d('0x51')][_0x48ba6e];var _0x2b377d={'id':_0x550a95['id'],'available':_0x550a95[_0x1d3d('0x4c')],'loggedIn':_0x550a95[_0x1d3d('0x4d')],'name':_0x550a95[_0x1d3d('0x4e')],'paused':_0x550a95['paused'],'waiting':_0x550a95[_0x1d3d('0x4f')]};_0x107494[_0x1d3d('0x20')](_0x2b377d);}}_0x411cb0({'count':_0x107494['length'],'rows':_0x107494});});},'SmsQueues':function(){return new Promise(function(_0x45bb3a){var _0x32639e=[];for(var _0x51f4fd in _0x12bd00[_0x1d3d('0x52')]){if(_0x12bd00[_0x1d3d('0x52')][_0x1d3d('0x45')](_0x51f4fd)){var _0x25220f=_0x12bd00['smsQueues'][_0x51f4fd];var _0x3fc022={'id':_0x25220f['id'],'available':_0x25220f[_0x1d3d('0x4c')],'loggedIn':_0x25220f[_0x1d3d('0x4d')],'name':_0x25220f[_0x1d3d('0x4e')],'paused':_0x25220f['paused'],'waiting':_0x25220f['waiting']};_0x32639e[_0x1d3d('0x20')](_0x3fc022);}}_0x45bb3a({'count':_0x32639e[_0x1d3d('0x19')],'rows':_0x32639e});});},'FaxQueues':function(){return new Promise(function(_0x4604cc){var _0x14e615=[];for(var _0x3645b2 in _0x12bd00[_0x1d3d('0x53')]){if(_0x12bd00[_0x1d3d('0x53')]['hasOwnProperty'](_0x3645b2)){var _0x307e46=_0x12bd00[_0x1d3d('0x53')][_0x3645b2];var _0x562578={'id':_0x307e46['id'],'available':_0x307e46[_0x1d3d('0x4c')],'loggedIn':_0x307e46[_0x1d3d('0x4d')],'name':_0x307e46[_0x1d3d('0x4e')],'paused':_0x307e46['paused'],'waiting':_0x307e46[_0x1d3d('0x4f')]};_0x14e615[_0x1d3d('0x20')](_0x562578);}}_0x4604cc({'count':_0x14e615[_0x1d3d('0x19')],'rows':_0x14e615});});},'WhatsappQueues':function(){return new Promise(function(_0x4ae421){var _0x5b909b=[];for(var _0x328693 in _0x12bd00[_0x1d3d('0x54')]){if(_0x12bd00[_0x1d3d('0x54')][_0x1d3d('0x45')](_0x328693)){var _0x58c51a=_0x12bd00[_0x1d3d('0x54')][_0x328693];var _0x9a0a16={'id':_0x58c51a['id'],'available':_0x58c51a[_0x1d3d('0x4c')],'loggedIn':_0x58c51a['loggedIn'],'name':_0x58c51a[_0x1d3d('0x4e')],'paused':_0x58c51a[_0x1d3d('0x55')],'waiting':_0x58c51a['waiting']};_0x5b909b[_0x1d3d('0x20')](_0x9a0a16);}}_0x4ae421({'count':_0x5b909b['length'],'rows':_0x5b909b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x248e31){var _0x3a9c39=_['values'](_0x12bd00['chatQueuesWaitingInteractions']);_0x248e31({'count':_0x3a9c39[_0x1d3d('0x19')],'rows':_0x3a9c39});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x111da2){var _0x48c169=_[_0x1d3d('0x49')](_0x12bd00[_0x1d3d('0x56')]);_0x111da2({'count':_0x48c169[_0x1d3d('0x19')],'rows':_0x48c169});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xb8f1b5){var _0x493900=_[_0x1d3d('0x49')](_0x12bd00[_0x1d3d('0x57')]);_0xb8f1b5({'count':_0x493900[_0x1d3d('0x19')],'rows':_0x493900});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5b75df){var _0x216a42=_[_0x1d3d('0x49')](_0x12bd00[_0x1d3d('0x58')]);_0x5b75df({'count':_0x216a42['length'],'rows':_0x216a42});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x14f5f3){var _0x434d65=_[_0x1d3d('0x49')](_0x12bd00[_0x1d3d('0x59')]);_0x14f5f3({'count':_0x434d65[_0x1d3d('0x19')],'rows':_0x434d65});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2926e0){var _0x516cb9=_[_0x1d3d('0x49')](_0x12bd00[_0x1d3d('0x5a')]);_0x2926e0({'count':_0x516cb9['length'],'rows':_0x516cb9});});}};var _0x360a3c=jayson[_0x1d3d('0x5b')](_0x4098a9)[_0x1d3d('0x5c')]();_0x360a3c['on']('error',function(_0x327a8b){logger['error'](JSON['stringify'](_0x327a8b));return _0x59b907(_0x327a8b);});_0x360a3c['listen'](0x232c,_0x1d3d('0x5d'),function(){console['log'](_0x1d3d('0x5e'),0x232c);return _0x1a8035(_0x1d3d('0x5f')+0x232c);});});}; \ No newline at end of file +var _0x9c44=['../../../config/logger','routing','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','app','.js','appdata','mail','push','slice','dialogflow','split','dialogflowv2','tag','TagId','tvox','getMustacheRender','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','complete','No\x20applications\x20to\x20execute','agent','agents','busy','end','QueueReport','update','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','find','chatQueues','available','mailQueues','loggedIn','name','waiting','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','./applications/utils'];(function(_0x51bbbe,_0x2cbea3){var _0x44b7bb=function(_0x429cb8){while(--_0x429cb8){_0x51bbbe['push'](_0x51bbbe['shift']());}};_0x44b7bb(++_0x2cbea3);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x49c4('0x0'));var fs=require('fs');var jayson=require(_0x49c4('0x1'));var BPromise=require(_0x49c4('0x2'));var utils=require(_0x49c4('0x3'));var logger=require(_0x49c4('0x4'))(_0x49c4('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x49c4('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x49c4('0x7')),'whatsappQueueReport':require(_0x49c4('0x8'))};var RuleEngine=require(_0x49c4('0x9'));function getId(_0x2c4e2e,_0x436234,_0x511d53){return util[_0x49c4('0xa')](_0x49c4('0xb'),_0x2c4e2e,_0x436234||0x0,_0x511d53||0x0);}function getIntervals(_0x1d13fb,_0x4487ca){var _0x4c7d3a=[];if(!_['isNil'](_0x4487ca[_0x49c4('0xc')])&&!_[_0x49c4('0xd')](_0x1d13fb[_0x4487ca['IntervalId']])&&!_[_0x49c4('0xd')](_0x1d13fb[_0x4487ca[_0x49c4('0xc')]]['Intervals'])){_0x4c7d3a=_['map'](_0x1d13fb[_0x4487ca[_0x49c4('0xc')]][_0x49c4('0xe')],'interval');}else if(!_[_0x49c4('0xd')](_0x4487ca[_0x49c4('0xf')])){_0x4c7d3a=[_0x4487ca['interval']];}return _0x4c7d3a;}exports[_0x49c4('0x10')]=function(_0x280996){_0x280996[_0x49c4('0x11')]={};return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c={'Start':function(_0x75ea8){var _0x3de397=this;return new Promise(function(_0x58d177,_0x3acd06){if(_0x75ea8){try{var _0x141003=[];var _0x13a2db=getId(_0x75ea8[_0x49c4('0x12')],_0x75ea8[_0x49c4('0x13')]?_0x75ea8['message']['id']:0x0,_0x75ea8[_0x49c4('0x14')]?_0x75ea8[_0x49c4('0x14')]['id']:0x0);if(_0x75ea8['applications']&&_['isArray'](_0x75ea8[_0x49c4('0x15')])&&_0x75ea8[_0x49c4('0x15')][_0x49c4('0x16')]){for(var _0x59f29b=0x0;_0x59f29b<_0x75ea8[_0x49c4('0x15')]['length'];_0x59f29b+=0x1){var _0x2cbd50=_0x75ea8[_0x49c4('0x15')][_0x59f29b];if(fs[_0x49c4('0x17')](path[_0x49c4('0x18')](__dirname,_0x49c4('0x15'),_0x2cbd50[_0x49c4('0x19')]+_0x49c4('0x1a')))){var _0x46e475=[];switch(_0x2cbd50[_0x49c4('0x19')]['toLowerCase']()){case'autoreply':var _0x57f502=_0x2cbd50[_0x49c4('0x1b')]['split'](',');if(_0x75ea8['channel']===_0x49c4('0x1c')){_0x46e475[_0x49c4('0x1d')](_0x57f502[0x0]);_0x46e475[_0x49c4('0x1d')](_0x57f502[0x1]);_0x46e475[_0x49c4('0x1d')](_0x57f502['slice'](0x2,_0x57f502['length'])[_0x49c4('0x18')](','));}else{_0x46e475[_0x49c4('0x1d')](_0x57f502[0x0]);_0x46e475['push'](_0x57f502[_0x49c4('0x1e')](0x1,_0x57f502[_0x49c4('0x16')])[_0x49c4('0x18')](','));}break;case _0x49c4('0x1f'):var _0x531d92=_0x2cbd50['appdata'][_0x49c4('0x20')](',');_0x46e475['push'](_0x531d92[0x0]);_0x46e475[_0x49c4('0x1d')](_0x531d92[0x1]);_0x46e475[_0x49c4('0x1d')](_0x531d92[_0x49c4('0x1e')](0x2,_0x531d92[_0x49c4('0x16')])['join'](','));break;case _0x49c4('0x21'):var _0x2b2793=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x0]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x1]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x2]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x3]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[_0x49c4('0x1e')](0x4,_0x2b2793[_0x49c4('0x16')])['join'](','));break;case'amazonlex':var _0x59eb84=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x0]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x1]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x2]);_0x46e475['push'](_0x59eb84[0x3]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[_0x49c4('0x1e')](0x4,_0x59eb84[_0x49c4('0x16')])[_0x49c4('0x18')](','));break;case'message':_0x46e475['push'](_0x2cbd50[_0x49c4('0x1b')]);break;case _0x49c4('0x22'):_0x46e475[_0x49c4('0x1d')](_0x2cbd50[_0x49c4('0x23')]);_0x46e475[_0x49c4('0x1d')](_0x2cbd50['appdata']);break;case _0x49c4('0x24'):var _0x84c621=utils[_0x49c4('0x25')](_0x75ea8['account']['notificationTemplate'],_0x75ea8);var _0x85dce2=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x0]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x1]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x2]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x3]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x4]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x5]);_0x46e475['push'](_0x85dce2[0x6]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x7]);_0x46e475['push'](_0x85dce2[0x8]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x9]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0xa]);_0x46e475[_0x49c4('0x1d')](_0x75ea8[_0x49c4('0x14')]['id']);_0x46e475['push'](_0x75ea8[_0x49c4('0x13')]['id']);_0x46e475[_0x49c4('0x1d')](_0x2cbd50[_0x49c4('0x26')]);_0x46e475['push'](_0x75ea8[_0x49c4('0x14')][_0x49c4('0x27')]);_0x46e475[_0x49c4('0x1d')](_0x75ea8[_0x49c4('0x28')][_0x49c4('0x28')]);_0x46e475[_0x49c4('0x1d')](_0x84c621);break;default:_0x46e475=_[_0x49c4('0xd')](_0x2cbd50[_0x49c4('0x1b')])?[]:_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');}var _0x1e506a={'id':util['format'](_0x49c4('0x29'),_0x13a2db,_0x2cbd50['id'],_0x2cbd50[_0x49c4('0x19')]),'condition':require(_0x49c4('0x2a'))[_0x49c4('0x2b')](_0x13a2db,getIntervals(_0x280996[_0x49c4('0x2c')],_0x2cbd50),_0x280996),'consequence':require(_0x49c4('0x2d')+_0x2cbd50[_0x49c4('0x19')])[_0x49c4('0x2e')](_0x13a2db,_0x46e475,_0x280996,_0x75ea8),'p':_0x2cbd50[_0x49c4('0x2f')]||0x0};logger[_0x49c4('0x30')](_0x49c4('0x31'),_0x1e506a['id'],_0x49c4('0x32'),getIntervals(_0x280996[_0x49c4('0x2c')],_0x2cbd50)['join'](_0x49c4('0x33')));_0x141003['push'](_0x1e506a);}else{logger[_0x49c4('0x34')](_0x49c4('0x35'),path[_0x49c4('0x18')](__dirname,_0x49c4('0x15'),_0x2cbd50[_0x49c4('0x19')]+_0x49c4('0x1a')));}}_0x280996['rules'][_0x13a2db]=new RuleEngine(_0x141003);_0x280996['rules'][_0x13a2db][_0x49c4('0x36')](_0x75ea8,function(_0x1e7bdc){logger[_0x49c4('0x30')](_0x49c4('0x37'),JSON['stringify'](_0x1e7bdc[_0x49c4('0x38')]));if(_0x280996[_0x49c4('0x11')][_0x13a2db]){_0x280996[_0x49c4('0x11')][_0x13a2db][_0x49c4('0x39')](_0x49c4('0x3a'));}});return _0x58d177({'code':0xc8,'message':_0x75ea8});}else{logger[_0x49c4('0x30')](_0x49c4('0x3b'));return _0x58d177({'code':0xc8,'message':_0x75ea8});}}catch(_0x3351c1){logger[_0x49c4('0x34')](_0x3351c1['stack']);return _0x3acd06(_0x3de397[_0x49c4('0x34')](0x1f4,_0x3351c1));}}return _0x3acd06('routing\x20is\x20empty');});},'AcceptMessage':function(_0x33696e){var _0x628423=this;return new Promise(function(_0x301def,_0x258abe){if(_0x33696e[_0x49c4('0x3c')]&&_0x33696e['agent']['id']){if(_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']]){_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']][_0x49c4('0x3e')]=![];_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']]['busyQueue']=undefined;}}if(_0x33696e[_0x49c4('0x13')]&&_0x33696e['message']['id']){try{var _0x3f7379=getId(_0x33696e[_0x49c4('0x12')],_0x33696e[_0x49c4('0x13')]?_0x33696e[_0x49c4('0x13')]['id']:0x0,_0x33696e[_0x49c4('0x14')]?_0x33696e[_0x49c4('0x14')]['id']:0x0);if(_0x280996[_0x49c4('0x11')][_0x3f7379]){_0x280996['rules'][_0x3f7379][_0x49c4('0x39')](_0x49c4('0x3f'));if(rpc[_0x33696e['channel']+_0x49c4('0x40')]){rpc[_0x33696e[_0x49c4('0x12')]+_0x49c4('0x40')][_0x49c4('0x41')](_0x3f7379,{'UserId':_0x33696e['message']['UserId']})[_0x49c4('0x42')](function(){logger['error'](_0x49c4('0x43'));});}}return _0x301def({'code':0xc8,'message':_0x33696e});}catch(_0x1f941f){logger[_0x49c4('0x34')](_0x1f941f[_0x49c4('0x44')]);return _0x258abe(_0x628423[_0x49c4('0x34')](0x1f4,_0x1f941f));}}logger[_0x49c4('0x34')](_0x49c4('0x45'));return _0x258abe(_0x628423['error'](0x1f4,_0x49c4('0x45')));});},'RejectMessage':function(_0x1550ce){var _0x3936d3=this;return new Promise(function(_0x3d944c,_0x17ef75){if(_0x1550ce[_0x49c4('0x3c')]&&_0x1550ce[_0x49c4('0x3c')]['id']){try{if(_0x280996[_0x49c4('0x3d')][_0x1550ce[_0x49c4('0x3c')]['id']]){_0x280996[_0x49c4('0x3d')][_0x1550ce['agent']['id']]['busy']=![];_0x280996[_0x49c4('0x3d')][_0x1550ce[_0x49c4('0x3c')]['id']]['busyQueue']=undefined;}return _0x3d944c({'code':0xc8,'message':_0x1550ce});}catch(_0x59a8bc){logger[_0x49c4('0x34')](_0x59a8bc['stack']);return _0x17ef75(_0x3936d3['error'](0x1f4,_0x59a8bc));}}logger[_0x49c4('0x34')](_0x49c4('0x45'));return _0x17ef75(_0x3936d3[_0x49c4('0x34')](0x1f4,_0x49c4('0x45')));});},'AbandonInteraction':function(_0x2884ca){var _0x16949a=this;return new Promise(function(_0x35724e,_0x50798e){if(_0x2884ca[_0x49c4('0x12')]&&_0x2884ca[_0x49c4('0x14')]&&_0x2884ca[_0x49c4('0x14')]['id']){try{var _0x208208=getId(_0x2884ca[_0x49c4('0x12')],_0x2884ca[_0x49c4('0x13')]?_0x2884ca['message']['id']:0x0,_0x2884ca['interaction']?_0x2884ca[_0x49c4('0x14')]['id']:0x0);if(_0x280996[_0x49c4('0x11')][_0x208208]){_0x280996[_0x49c4('0x11')][_0x208208][_0x49c4('0x39')](_0x49c4('0x3f'));}return _0x35724e({'code':0xc8,'message':_0x2884ca});}catch(_0x6b2592){logger[_0x49c4('0x34')](_0x6b2592['stack']);return _0x50798e(_0x16949a[_0x49c4('0x34')](0x1f4,_0x6b2592));}}logger[_0x49c4('0x34')]('message\x20is\x20empty');return _0x50798e(_0x16949a[_0x49c4('0x34')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x2f966c){var _0x147ebd=this;return new Promise(function(_0x9eaa84,_0x2fe89a){if(_0x280996[_0x49c4('0x3d')][_0x49c4('0x46')](_0x2f966c['id'])){for(var _0x3eb66d in _0x2f966c[_0x49c4('0x47')]){if(_0x2f966c['capacity'][_0x49c4('0x46')](_0x3eb66d)){if(_0x280996[_0x49c4('0x3d')][_0x2f966c['id']]['hasOwnProperty'](_0x3eb66d+_0x49c4('0x48'))){_0x280996[_0x49c4('0x3d')][_0x2f966c['id']][_0x3eb66d+'CurrentCapacity']=parseInt(_0x2f966c[_0x49c4('0x47')][_0x3eb66d],0xa);}}}_0x280996[_0x49c4('0x3d')][_0x2f966c['id']]['updateRealtime']();return _0x9eaa84({'code':0xc8,'message':_0x280996['agents'][_0x2f966c['id']]});}else{return _0x2fe89a(_0x147ebd['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xc43386){return new Promise(function(_0x54947d){var _0xb20a5d=_[_0x49c4('0x49')](_0x280996['agents']);if(_0xc43386&&_0xc43386['id']){var _0x679134=_[_0x49c4('0x4a')](_0xb20a5d,function(_0x5ac9f0){return _0x5ac9f0['id']===_0xc43386['id'];});_0x54947d(_0x679134);}else{_0x54947d({'count':_0xb20a5d[_0x49c4('0x16')],'rows':_0xb20a5d});}});},'ChatQueues':function(){return new Promise(function(_0x3dcf4c){var _0x167e84=[];for(var _0x35f46f in _0x280996['chatQueues']){if(_0x280996[_0x49c4('0x4b')][_0x49c4('0x46')](_0x35f46f)){var _0x3cc604=_0x280996[_0x49c4('0x4b')][_0x35f46f];var _0x5d3375={'id':_0x3cc604['id'],'available':_0x3cc604[_0x49c4('0x4c')],'loggedIn':_0x3cc604['loggedIn'],'name':_0x3cc604['name'],'paused':_0x3cc604['paused'],'waiting':_0x3cc604['waiting']};_0x167e84[_0x49c4('0x1d')](_0x5d3375);}}_0x3dcf4c({'count':_0x167e84[_0x49c4('0x16')],'rows':_0x167e84});});},'MailQueues':function(){return new Promise(function(_0x2ac7df){var _0x28bbf3=[];for(var _0x5b056e in _0x280996['mailQueues']){if(_0x280996[_0x49c4('0x4d')][_0x49c4('0x46')](_0x5b056e)){var _0x342326=_0x280996[_0x49c4('0x4d')][_0x5b056e];var _0x102c15={'id':_0x342326['id'],'available':_0x342326[_0x49c4('0x4c')],'loggedIn':_0x342326[_0x49c4('0x4e')],'name':_0x342326[_0x49c4('0x4f')],'paused':_0x342326['paused'],'waiting':_0x342326[_0x49c4('0x50')]};_0x28bbf3['push'](_0x102c15);}}_0x2ac7df({'count':_0x28bbf3[_0x49c4('0x16')],'rows':_0x28bbf3});});},'OpenchannelQueues':function(){return new Promise(function(_0x264902){var _0x1a5d4c=[];for(var _0x1ea1b4 in _0x280996[_0x49c4('0x51')]){if(_0x280996[_0x49c4('0x51')][_0x49c4('0x46')](_0x1ea1b4)){var _0x3feb0b=_0x280996[_0x49c4('0x51')][_0x1ea1b4];var _0x1743d0={'id':_0x3feb0b['id'],'available':_0x3feb0b[_0x49c4('0x4c')],'loggedIn':_0x3feb0b[_0x49c4('0x4e')],'name':_0x3feb0b[_0x49c4('0x4f')],'paused':_0x3feb0b[_0x49c4('0x52')],'waiting':_0x3feb0b[_0x49c4('0x50')]};_0x1a5d4c[_0x49c4('0x1d')](_0x1743d0);}}_0x264902({'count':_0x1a5d4c[_0x49c4('0x16')],'rows':_0x1a5d4c});});},'SmsQueues':function(){return new Promise(function(_0x3485c0){var _0x4e1544=[];for(var _0x5ec201 in _0x280996[_0x49c4('0x53')]){if(_0x280996[_0x49c4('0x53')]['hasOwnProperty'](_0x5ec201)){var _0x1a15f3=_0x280996[_0x49c4('0x53')][_0x5ec201];var _0x2939fd={'id':_0x1a15f3['id'],'available':_0x1a15f3[_0x49c4('0x4c')],'loggedIn':_0x1a15f3['loggedIn'],'name':_0x1a15f3['name'],'paused':_0x1a15f3['paused'],'waiting':_0x1a15f3[_0x49c4('0x50')]};_0x4e1544[_0x49c4('0x1d')](_0x2939fd);}}_0x3485c0({'count':_0x4e1544[_0x49c4('0x16')],'rows':_0x4e1544});});},'FaxQueues':function(){return new Promise(function(_0x2f4289){var _0x118fc4=[];for(var _0x146706 in _0x280996[_0x49c4('0x54')]){if(_0x280996[_0x49c4('0x54')][_0x49c4('0x46')](_0x146706)){var _0x54dea5=_0x280996[_0x49c4('0x54')][_0x146706];var _0x10fb84={'id':_0x54dea5['id'],'available':_0x54dea5[_0x49c4('0x4c')],'loggedIn':_0x54dea5['loggedIn'],'name':_0x54dea5[_0x49c4('0x4f')],'paused':_0x54dea5[_0x49c4('0x52')],'waiting':_0x54dea5[_0x49c4('0x50')]};_0x118fc4[_0x49c4('0x1d')](_0x10fb84);}}_0x2f4289({'count':_0x118fc4[_0x49c4('0x16')],'rows':_0x118fc4});});},'WhatsappQueues':function(){return new Promise(function(_0x2fd749){var _0x35fa39=[];for(var _0xfc5e17 in _0x280996['whatsappQueues']){if(_0x280996[_0x49c4('0x55')][_0x49c4('0x46')](_0xfc5e17)){var _0x85540f=_0x280996[_0x49c4('0x55')][_0xfc5e17];var _0x1e948a={'id':_0x85540f['id'],'available':_0x85540f['available'],'loggedIn':_0x85540f['loggedIn'],'name':_0x85540f[_0x49c4('0x4f')],'paused':_0x85540f['paused'],'waiting':_0x85540f[_0x49c4('0x50')]};_0x35fa39['push'](_0x1e948a);}}_0x2fd749({'count':_0x35fa39[_0x49c4('0x16')],'rows':_0x35fa39});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x27b77d){var _0x3b03dd=_[_0x49c4('0x49')](_0x280996['chatQueuesWaitingInteractions']);_0x27b77d({'count':_0x3b03dd[_0x49c4('0x16')],'rows':_0x3b03dd});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x38d7d3){var _0x2ceada=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x56')]);_0x38d7d3({'count':_0x2ceada[_0x49c4('0x16')],'rows':_0x2ceada});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x38b291){var _0x23bb1c=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x57')]);_0x38b291({'count':_0x23bb1c['length'],'rows':_0x23bb1c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x228189){var _0x46e4fd=_['values'](_0x280996[_0x49c4('0x58')]);_0x228189({'count':_0x46e4fd['length'],'rows':_0x46e4fd});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1e6644){var _0x1bfb8d=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x59')]);_0x1e6644({'count':_0x1bfb8d[_0x49c4('0x16')],'rows':_0x1bfb8d});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x58b90c){var _0x16f618=_[_0x49c4('0x49')](_0x280996['whatsappQueuesWaitingInteractions']);_0x58b90c({'count':_0x16f618[_0x49c4('0x16')],'rows':_0x16f618});});}};var _0x167e41=jayson['server'](_0x18211c)[_0x49c4('0x5a')]();_0x167e41['on'](_0x49c4('0x34'),function(_0x57b137){logger[_0x49c4('0x34')](JSON[_0x49c4('0x5b')](_0x57b137));return _0x12777c(_0x57b137);});_0x167e41[_0x49c4('0x10')](0x232c,_0x49c4('0x5c'),function(){console['log'](_0x49c4('0x5d'),0x232c);return _0x2decee(_0x49c4('0x5e')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 06f80a3..f51bd70 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 _0x5899=['request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','format','iftime\x20%s','all','some','join','\x20|\x20','log','[%s][INTERVAL]\x20%s\x20%s','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x5899,0x64));var _0x9589=function(_0x3def8e,_0x59adcf){_0x3def8e=_0x3def8e-0x0;var _0x52c8cf=_0x5899[_0x3def8e];return _0x52c8cf;};'use strict';var util=require(_0x9589('0x0'));var BPromise=require(_0x9589('0x1'));var jayson=require(_0x9589('0x2'));var _=require(_0x9589('0x3'));var logger=require(_0x9589('0x4'))(_0x9589('0x5'));var client=jayson[_0x9589('0x6')][_0x9589('0x7')]({'port':0x232a});function request(_0x58140,_0x3d1fed){return new BPromise(function(_0x54bd61,_0xdcf6d1){return client[_0x9589('0x8')](_0x58140,_0x3d1fed)[_0x9589('0x9')](function(_0x4f253b){if(_0x4f253b[_0x9589('0xa')]){return _0xdcf6d1(_0x4f253b['error'][_0x9589('0xb')]);}else{return _0x54bd61(_0x4f253b[_0x9589('0xc')]);}})[_0x9589('0xd')](function(_0x5b3133){return _0xdcf6d1(_0x5b3133);});});}exports['condition']=function(_0x55e708,_0x1253e8,_0x5520a6){return function(_0xb1a59b){if(_0x5520a6[_0x9589('0xe')]&&!_0x5520a6['rules'][_0x55e708]){logger[_0x9589('0xf')](_0x9589('0x10'),_0x55e708);return _0xb1a59b[_0x9589('0x11')]();}var _0xdf2992=[];for(var _0x4e7378=0x0;_0x4e7378<_0x1253e8[_0x9589('0x12')];_0x4e7378+=0x1){_0xdf2992['push'](request('Command',{'command':util[_0x9589('0x13')](_0x9589('0x14'),_0x1253e8[_0x4e7378])})['then'](function(_0x21c2c2){return _0x21c2c2&&_0x21c2c2[_0x9589('0xb')]&&_0x21c2c2[_0x9589('0xb')]['indexOf']('true')>=0x0?!![]:![];})[_0x9589('0xd')](function(_0x41d188){logger[_0x9589('0xa')]('[%s][INTERVAL]\x20%s',_0x55e708,_0x1253e8[_0x4e7378]);}));}BPromise[_0x9589('0x15')](_0xdf2992)[_0x9589('0x9')](function(_0x4a3235){var _0x1717c3=_[_0x9589('0x16')](_0x4a3235);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x55e708,_0x1253e8[_0x9589('0x17')](_0x9589('0x18')),_0x1717c3);_0xb1a59b['when'](_0x1717c3);})['catch'](function(_0x33caf3){console[_0x9589('0x19')](_0x33caf3);logger['error'](_0x9589('0x1a'),_0x55e708,_0x1253e8[_0x9589('0x17')](_0x9589('0x18')),_0x33caf3['stack']);_0xb1a59b[_0x9589('0x11')]();});};}; \ No newline at end of file +var _0xd185=['catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','iftime\x20%s','then','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','bluebird','lodash','routing','client','http','error','message','result'];(function(_0x23434f,_0x260b49){var _0x2cbb0b=function(_0x557d59){while(--_0x557d59){_0x23434f['push'](_0x23434f['shift']());}};_0x2cbb0b(++_0x260b49);}(_0xd185,0x6f));var _0x5d18=function(_0x1c752a,_0x754f48){_0x1c752a=_0x1c752a-0x0;var _0x317d02=_0xd185[_0x1c752a];return _0x317d02;};'use strict';var util=require(_0x5d18('0x0'));var BPromise=require(_0x5d18('0x1'));var jayson=require('jayson/promise');var _=require(_0x5d18('0x2'));var logger=require('../../../config/logger')(_0x5d18('0x3'));var client=jayson[_0x5d18('0x4')][_0x5d18('0x5')]({'port':0x232a});function request(_0x2ebbda,_0x124eea){return new BPromise(function(_0x15b86b,_0x20d32d){return client['request'](_0x2ebbda,_0x124eea)['then'](function(_0x332b72){if(_0x332b72['error']){return _0x20d32d(_0x332b72[_0x5d18('0x6')][_0x5d18('0x7')]);}else{return _0x15b86b(_0x332b72[_0x5d18('0x8')]);}})[_0x5d18('0x9')](function(_0x5818ae){return _0x20d32d(_0x5818ae);});});}exports[_0x5d18('0xa')]=function(_0x530fcc,_0x45bd45,_0x51df6c){return function(_0x682009){if(_0x51df6c[_0x5d18('0xb')]&&!_0x51df6c['rules'][_0x530fcc]){logger[_0x5d18('0xc')](_0x5d18('0xd'),_0x530fcc);return _0x682009['stop']();}var _0x33040d=[];for(var _0x2ba21c=0x0;_0x2ba21c<_0x45bd45[_0x5d18('0xe')];_0x2ba21c+=0x1){_0x33040d[_0x5d18('0xf')](request('Command',{'command':util[_0x5d18('0x10')](_0x5d18('0x11'),_0x45bd45[_0x2ba21c])})[_0x5d18('0x12')](function(_0x583831){return _0x583831&&_0x583831[_0x5d18('0x7')]&&_0x583831[_0x5d18('0x7')][_0x5d18('0x13')](_0x5d18('0x14'))>=0x0?!![]:![];})[_0x5d18('0x9')](function(_0x1f2a3e){logger[_0x5d18('0x6')]('[%s][INTERVAL]\x20%s',_0x530fcc,_0x45bd45[_0x2ba21c]);}));}BPromise[_0x5d18('0x15')](_0x33040d)[_0x5d18('0x12')](function(_0x2921e3){var _0x3c8e3e=_[_0x5d18('0x16')](_0x2921e3);logger[_0x5d18('0xc')](_0x5d18('0x17'),_0x530fcc,_0x45bd45[_0x5d18('0x18')](_0x5d18('0x19')),_0x3c8e3e);_0x682009[_0x5d18('0x1a')](_0x3c8e3e);})[_0x5d18('0x9')](function(_0x3f7ee0){console[_0x5d18('0x1b')](_0x3f7ee0);logger[_0x5d18('0x6')](_0x5d18('0x17'),_0x530fcc,_0x45bd45['join'](_0x5d18('0x19')),_0x3f7ee0[_0x5d18('0x1c')]);_0x682009[_0x5d18('0x1d')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 3ad3ac2..16325ff 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 _0xaa88=['push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','ATTENDED','transferuniqueid','transfertargetuniqueid','agententerreason','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwtime','agentacw','request','CreateVoiceAgentReport','destuniqueid','debug','agentcalledAt','now','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','ringtime','talktime'];(function(_0x2d4bbd,_0x3aee72){var _0x27dc46=function(_0x33595b){while(--_0x33595b){_0x2d4bbd['push'](_0x2d4bbd['shift']());}};_0x27dc46(++_0x3aee72);}(_0xaa88,0x137));var _0x8aa8=function(_0x2b0f81,_0x3917f0){_0x2b0f81=_0x2b0f81-0x0;var _0x5ce74c=_0xaa88[_0x2b0f81];return _0x5ce74c;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var utils=require(_0x8aa8('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x51c79b,_0x4aee38){utils[_0x8aa8('0x3')](util[_0x8aa8('0x4')](_0x8aa8('0x5'),_0x51c79b[_0x8aa8('0x6')],_0x51c79b[_0x8aa8('0x7')],_0x51c79b[_0x8aa8('0x8')],_0x51c79b['membername'],_0x51c79b['interface'],_0x51c79b[_0x8aa8('0x9')],_0x51c79b['connectedlinenum'],_0x51c79b[_0x8aa8('0xa')]));if(_0x51c79b[_0x8aa8('0x8')]){utils[_0x8aa8('0xb')](_0x51c79b[_0x8aa8('0x8')])['then'](function(_0x123b7f){if(_0x123b7f){_0x51c79b[_0x8aa8('0xc')]=_0x123b7f[_0x8aa8('0xc')];_0x51c79b['agentacw']=_0x51c79b[_0x8aa8('0xd')]?_0x123b7f[_0x8aa8('0xe')]:![];_0x51c79b[_0x8aa8('0xf')]=_0x51c79b[_0x8aa8('0x10')]?_0x123b7f['acwTimeout']:0x0;}utils[_0x8aa8('0x11')](_0x8aa8('0x12'),_0x51c79b);});}else{utils['request'](_0x8aa8('0x12'),_0x51c79b);}if(_0x4aee38){delete transfers[_0x51c79b[_0x8aa8('0x6')]];}else{delete agents[_0x51c79b[_0x8aa8('0x13')]];}}exports['agentcalled']=function(_0x3b9f74){try{utils[_0x8aa8('0x14')](util[_0x8aa8('0x4')]('[%s][agents][agentcalled]',_0x3b9f74[_0x8aa8('0x6')]),_0x3b9f74);agents[_0x3b9f74['destuniqueid']]=_0x3b9f74;agents[_0x3b9f74['destuniqueid']][_0x8aa8('0x15')]=utils[_0x8aa8('0x16')]();agents[_0x3b9f74[_0x8aa8('0x13')]][_0x8aa8('0xa')]=_0x8aa8('0x17');agents[_0x3b9f74[_0x8aa8('0x13')]][_0x8aa8('0x18')]=null;agents[_0x3b9f74[_0x8aa8('0x13')]][_0x8aa8('0x19')]=null;utils['info'](util['format'](_0x8aa8('0x1a'),_0x3b9f74['uniqueid'],agents[_0x3b9f74['destuniqueid']][_0x8aa8('0x1b')],_0x3b9f74['destuniqueid']));}catch(_0x438198){utils[_0x8aa8('0x1c')](util[_0x8aa8('0x4')](_0x8aa8('0x1d'),_0x3b9f74['uniqueid']),_0x438198);}};exports[_0x8aa8('0x1e')]=function(_0x36c445){try{if(!_[_0x8aa8('0x1f')](agents[_0x36c445[_0x8aa8('0x13')]])){utils[_0x8aa8('0x14')](util[_0x8aa8('0x4')]('[%s][agents][agentringnoanswer]',_0x36c445[_0x8aa8('0x6')]),_0x36c445);utils['info'](util[_0x8aa8('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x36c445[_0x8aa8('0x6')],agents[_0x36c445['destuniqueid']][_0x8aa8('0x1b')],_0x36c445[_0x8aa8('0x13')]));agents[_0x36c445[_0x8aa8('0x13')]]['agentringnoanswer']=!![];agents[_0x36c445[_0x8aa8('0x13')]][_0x8aa8('0x20')]=utils[_0x8aa8('0x16')]();agents[_0x36c445['destuniqueid']]['lastevent']=_0x8aa8('0x21');agents[_0x36c445[_0x8aa8('0x13')]][_0x8aa8('0x22')]=_0x8aa8('0x21');agents[_0x36c445[_0x8aa8('0x13')]]['holdtime']=_0x36c445[_0x8aa8('0x23')]?parseInt(_0x36c445['ringtime'])/0x3e8:0x0;agents[_0x36c445[_0x8aa8('0x13')]][_0x8aa8('0x24')]=0x0;unanswered[_0x8aa8('0x25')](_0x36c445['destuniqueid']);}}catch(_0x4c5c5c){utils[_0x8aa8('0x1c')](util['format'](_0x8aa8('0x26'),_0x36c445[_0x8aa8('0x6')]),_0x4c5c5c);}};exports[_0x8aa8('0x27')]=function(_0x240203){try{_[_0x8aa8('0x28')](agents,function(_0x4d5c2e,_0x267f4c){if(_0x4d5c2e[_0x8aa8('0x6')]==_0x240203['uniqueid']&&!_[_0x8aa8('0x29')](unanswered,_0x4d5c2e[_0x8aa8('0x13')])){utils[_0x8aa8('0x14')](util['format'](_0x8aa8('0x2a'),_0x240203[_0x8aa8('0x6')]),_0x240203);utils[_0x8aa8('0x3')](util[_0x8aa8('0x4')](_0x8aa8('0x2b'),_0x240203[_0x8aa8('0x6')],_0x4d5c2e[_0x8aa8('0x1b')],_0x4d5c2e[_0x8aa8('0x13')]));_0x4d5c2e[_0x8aa8('0x1e')]=!![];_0x4d5c2e[_0x8aa8('0x20')]=utils[_0x8aa8('0x16')]();_0x4d5c2e['lastevent']='abandoned';_0x4d5c2e[_0x8aa8('0x22')]=_0x8aa8('0x2c');_0x4d5c2e[_0x8aa8('0x2d')]=_0x240203[_0x8aa8('0x2d')];_0x4d5c2e[_0x8aa8('0x24')]=0x0;writeDB(_0x4d5c2e);}});}catch(_0x2f27cd){utils['error'](util['format'](_0x8aa8('0x2a'),_0x240203['uniqueid']),_0x2f27cd);}};exports[_0x8aa8('0x2e')]=function(_0x2c5c84){try{if(agents[_0x2c5c84[_0x8aa8('0x13')]]){utils['debug'](util[_0x8aa8('0x4')](_0x8aa8('0x2f'),_0x2c5c84[_0x8aa8('0x6')]),_0x2c5c84);utils['info'](util['format'](_0x8aa8('0x30'),_0x2c5c84[_0x8aa8('0x6')],agents[_0x2c5c84['destuniqueid']][_0x8aa8('0x1b')],_0x2c5c84[_0x8aa8('0x13')]));agents[_0x2c5c84['destuniqueid']][_0x8aa8('0x31')]=utils['now']();agents[_0x2c5c84['destuniqueid']][_0x8aa8('0x18')]=_0x2c5c84['connectedlinenum'];agents[_0x2c5c84[_0x8aa8('0x13')]][_0x8aa8('0x19')]=_0x2c5c84[_0x8aa8('0x19')];agents[_0x2c5c84[_0x8aa8('0x13')]]['holdtime']=_0x2c5c84[_0x8aa8('0x23')];agents[_0x2c5c84[_0x8aa8('0x13')]]['lastevent']=_0x8aa8('0x32');_[_0x8aa8('0x28')](agents,function(_0x5ea57a,_0x351ddc){if(_0x5ea57a[_0x8aa8('0x13')]!=_0x2c5c84[_0x8aa8('0x13')]&&_0x5ea57a[_0x8aa8('0x6')]==_0x2c5c84[_0x8aa8('0x6')]){_0x5ea57a[_0x8aa8('0x24')]=0x0;_0x5ea57a[_0x8aa8('0x2d')]=_0x2c5c84[_0x8aa8('0x23')];_0x5ea57a[_0x8aa8('0x1e')]=!![];_0x5ea57a[_0x8aa8('0x20')]=utils[_0x8aa8('0x16')]();_0x5ea57a[_0x8aa8('0xa')]=_0x8aa8('0x33');_0x5ea57a[_0x8aa8('0x22')]=_0x8aa8('0x33');_0x5ea57a[_0x8aa8('0x34')]=_0x2c5c84['destuniqueid'];_0x5ea57a[_0x8aa8('0x35')]=_0x2c5c84['membername'];writeDB(_0x5ea57a);}});}}catch(_0x4833c0){utils['error'](util[_0x8aa8('0x4')]('[%s][agents][agentconnect]',_0x2c5c84['uniqueid']),_0x4833c0);}};exports[_0x8aa8('0xd')]=function(_0x4da4d8){try{if(!_[_0x8aa8('0x1f')](agents[_0x4da4d8['destuniqueid']])){utils['debug'](util[_0x8aa8('0x4')](_0x8aa8('0x36'),_0x4da4d8[_0x8aa8('0x6')]),_0x4da4d8);utils[_0x8aa8('0x3')](util[_0x8aa8('0x4')](_0x8aa8('0x37'),_0x4da4d8[_0x8aa8('0x6')],agents[_0x4da4d8['destuniqueid']][_0x8aa8('0x1b')],_0x4da4d8['destuniqueid']));agents[_0x4da4d8[_0x8aa8('0x13')]][_0x8aa8('0xd')]=!![];agents[_0x4da4d8[_0x8aa8('0x13')]][_0x8aa8('0x38')]=utils[_0x8aa8('0x16')]();agents[_0x4da4d8[_0x8aa8('0x13')]]['talktime']=utils['diffTime'](agents[_0x4da4d8[_0x8aa8('0x13')]][_0x8aa8('0x38')],agents[_0x4da4d8['destuniqueid']][_0x8aa8('0x31')]);agents[_0x4da4d8[_0x8aa8('0x13')]][_0x8aa8('0x22')]=_0x4da4d8['reason'];agents[_0x4da4d8['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x4da4d8[_0x8aa8('0x13')]]);}}catch(_0x43bdb4){utils['error'](util[_0x8aa8('0x4')](_0x8aa8('0x36'),_0x4da4d8[_0x8aa8('0x6')]),_0x43bdb4);}};exports[_0x8aa8('0x39')]=function(_0x20384a){try{if(!_[_0x8aa8('0x1f')](agents[_0x20384a['transfereruniqueid']])){utils['debug'](util[_0x8aa8('0x4')]('[%s][agents][blindtransfer]',_0x20384a[_0x8aa8('0x6')]),_0x20384a);utils['info'](util[_0x8aa8('0x4')](_0x8aa8('0x3a'),_0x20384a[_0x8aa8('0x6')],agents[_0x20384a[_0x8aa8('0x3b')]][_0x8aa8('0x1b')],agents[_0x20384a[_0x8aa8('0x3b')]][_0x8aa8('0x6')]));agents[_0x20384a[_0x8aa8('0x3b')]][_0x8aa8('0x3c')]=!![];agents[_0x20384a[_0x8aa8('0x3b')]][_0x8aa8('0x3d')]=_0x8aa8('0x3e');agents[_0x20384a['transfereruniqueid']][_0x8aa8('0x3f')]=_0x20384a['extension'];agents[_0x20384a['transfereruniqueid']]['transferuniqueid']=agents[_0x20384a[_0x8aa8('0x3b')]]['uniqueid'];}}catch(_0x1de402){utils[_0x8aa8('0x1c')](util[_0x8aa8('0x4')]('[%s][agents][blindtransfer]',_0x20384a[_0x8aa8('0x6')]),_0x1de402);}};exports[_0x8aa8('0x40')]=function(_0x23612a){try{utils[_0x8aa8('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x23612a[_0x8aa8('0x41')]),_0x23612a);if(_0x23612a[_0x8aa8('0x41')]==_0x23612a[_0x8aa8('0x42')]){if(!_[_0x8aa8('0x1f')](agents[_0x23612a['secondtransfereruniqueid']])){utils['info'](util[_0x8aa8('0x4')](_0x8aa8('0x43'),_0x23612a[_0x8aa8('0x41')],agents[_0x23612a['secondtransfereruniqueid']][_0x8aa8('0x1b')]));agents[_0x23612a[_0x8aa8('0x44')]]['transfer']=!![];agents[_0x23612a['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x23612a[_0x8aa8('0x44')]]['transferexten']=_0x23612a[_0x8aa8('0x45')];agents[_0x23612a[_0x8aa8('0x44')]]['transferuniqueid']=_0x23612a['origtransfereruniqueid'];}if(_0x23612a[_0x8aa8('0x46')]&&agents[_0x23612a[_0x8aa8('0x46')]]){agents[_0x23612a['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x23612a['transfereeuniqueid']]=_[_0x8aa8('0x47')](agents[_0x23612a[_0x8aa8('0x46')]]);transfers[_0x23612a['transfereeuniqueid']]['calleridnum']=agents[_0x23612a[_0x8aa8('0x44')]][_0x8aa8('0x9')];transfers[_0x23612a['transfereeuniqueid']][_0x8aa8('0x48')]=agents[_0x23612a[_0x8aa8('0x44')]]['calleridname'];transfers[_0x23612a[_0x8aa8('0x46')]]['agentcalledAt']=utils[_0x8aa8('0x16')]();transfers[_0x23612a['transfereeuniqueid']][_0x8aa8('0x31')]=utils[_0x8aa8('0x16')]();transfers[_0x23612a[_0x8aa8('0x46')]][_0x8aa8('0x2d')]=0x0;transfers[_0x23612a[_0x8aa8('0x46')]]['agententerreason']=0x2;}}else if(_0x23612a[_0x8aa8('0x44')]==_0x23612a[_0x8aa8('0x49')]){if(!_[_0x8aa8('0x1f')](agents[_0x23612a[_0x8aa8('0x41')]])){utils['info'](util[_0x8aa8('0x4')](_0x8aa8('0x43'),_0x23612a['origtransfereruniqueid'],agents[_0x23612a[_0x8aa8('0x41')]][_0x8aa8('0x1b')]));agents[_0x23612a[_0x8aa8('0x41')]][_0x8aa8('0x3c')]=!![];agents[_0x23612a[_0x8aa8('0x41')]][_0x8aa8('0x3d')]=_0x8aa8('0x4a');agents[_0x23612a['origtransfereruniqueid']]['transferexten']=_0x23612a['secondtransfererexten'];agents[_0x23612a[_0x8aa8('0x41')]][_0x8aa8('0x4b')]=_0x23612a[_0x8aa8('0x44')];}if(_0x23612a[_0x8aa8('0x4c')]&&agents[_0x23612a[_0x8aa8('0x4c')]]){agents[_0x23612a[_0x8aa8('0x4c')]][_0x8aa8('0x4d')]=0x1;transfers[_0x23612a[_0x8aa8('0x4c')]]=_[_0x8aa8('0x47')](agents[_0x23612a[_0x8aa8('0x4c')]]);transfers[_0x23612a[_0x8aa8('0x4c')]][_0x8aa8('0x9')]=agents[_0x23612a[_0x8aa8('0x41')]][_0x8aa8('0x9')];transfers[_0x23612a[_0x8aa8('0x4c')]][_0x8aa8('0x48')]=agents[_0x23612a[_0x8aa8('0x41')]][_0x8aa8('0x48')];transfers[_0x23612a[_0x8aa8('0x4c')]]['agentcalledAt']=utils[_0x8aa8('0x16')]();transfers[_0x23612a[_0x8aa8('0x4c')]][_0x8aa8('0x31')]=utils[_0x8aa8('0x16')]();transfers[_0x23612a[_0x8aa8('0x4c')]][_0x8aa8('0x2d')]=0x0;transfers[_0x23612a[_0x8aa8('0x4c')]][_0x8aa8('0x4d')]=0x2;}}}catch(_0x37520b){utils['error'](util[_0x8aa8('0x4')](_0x8aa8('0x4e'),_0x23612a['origtransfereruniqueid']),_0x37520b);}};exports[_0x8aa8('0x4f')]=function(_0x5d72d0){try{utils[_0x8aa8('0x14')](util[_0x8aa8('0x4')]('[%s][agents][hangup]',_0x5d72d0[_0x8aa8('0x6')]),_0x5d72d0);if(agents[_0x5d72d0[_0x8aa8('0x6')]]&&agents[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0x22')]===_0x8aa8('0x21')){if(_0x5d72d0[_0x8aa8('0x50')]==='21'){agents[_0x5d72d0[_0x8aa8('0x6')]]['reason']=_0x8aa8('0x51');agents[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0xa')]=_0x8aa8('0x51');}utils['info'](util['format'](_0x8aa8('0x52'),_0x5d72d0[_0x8aa8('0x6')],agents[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0x1b')],agents[_0x5d72d0['uniqueid']]['reason'],agents[_0x5d72d0['uniqueid']][_0x8aa8('0xa')]));writeDB(agents[_0x5d72d0[_0x8aa8('0x6')]]);var _0x1b7baa=unanswered[_0x8aa8('0x53')](_0x5d72d0[_0x8aa8('0x6')]);if(_0x1b7baa>-0x1){unanswered[_0x8aa8('0x54')](_0x1b7baa,0x1);}}if(transfers[_0x5d72d0[_0x8aa8('0x6')]]){transfers[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0xd')]=!![];transfers[_0x5d72d0['uniqueid']][_0x8aa8('0x38')]=utils['now']();transfers[_0x5d72d0['uniqueid']][_0x8aa8('0x24')]=utils[_0x8aa8('0x55')](transfers[_0x5d72d0[_0x8aa8('0x6')]]['agentcompleteAt'],transfers[_0x5d72d0[_0x8aa8('0x6')]]['agentconnectAt']);transfers[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0x22')]=_0x8aa8('0x56');transfers[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0xa')]='complete';utils['info'](util[_0x8aa8('0x4')](_0x8aa8('0x52'),_0x5d72d0[_0x8aa8('0x6')],transfers[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0x1b')],transfers[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0x22')],transfers[_0x5d72d0[_0x8aa8('0x6')]]['lastevent']));writeDB(transfers[_0x5d72d0[_0x8aa8('0x6')]],!![]);}if(agents[_0x5d72d0[_0x8aa8('0x6')]]&&agents[_0x5d72d0['uniqueid']]['agentconnectAt']){agents[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0xd')]=!![];agents[_0x5d72d0['uniqueid']][_0x8aa8('0x38')]=utils[_0x8aa8('0x16')]();agents[_0x5d72d0[_0x8aa8('0x6')]]['talktime']=utils['diffTime'](agents[_0x5d72d0['uniqueid']][_0x8aa8('0x38')],agents[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0x31')]);agents[_0x5d72d0[_0x8aa8('0x6')]]['reason']=agents[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0x3c')]?_0x8aa8('0x3c'):_0x8aa8('0x56');agents[_0x5d72d0['uniqueid']][_0x8aa8('0xa')]='complete';utils['info'](util[_0x8aa8('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5d72d0[_0x8aa8('0x6')],agents[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0x1b')],agents[_0x5d72d0['uniqueid']][_0x8aa8('0x22')],agents[_0x5d72d0[_0x8aa8('0x6')]][_0x8aa8('0xa')]));writeDB(agents[_0x5d72d0[_0x8aa8('0x6')]]);}}catch(_0x20260e){utils[_0x8aa8('0x1c')](util['format']('[%s][agents][hangup]',_0x5d72d0[_0x8aa8('0x6')]),_0x20260e);}}; \ No newline at end of file +var _0xb49a=['[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','info','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','push','reason','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agentcomplete','agent','lodash','util','./utils','format'];(function(_0x27d019,_0x9ef4bc){var _0x3c0aa4=function(_0x27cc00){while(--_0x27cc00){_0x27d019['push'](_0x27d019['shift']());}};_0x3c0aa4(++_0x9ef4bc);}(_0xb49a,0xfb));var _0xab49=function(_0x4f7449,_0x407356){_0x4f7449=_0x4f7449-0x0;var _0x21e3cb=_0xb49a[_0x4f7449];return _0x21e3cb;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var utils=require(_0xab49('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1d512a,_0x8db649){utils['info'](util[_0xab49('0x3')](_0xab49('0x4'),_0x1d512a['uniqueid'],_0x1d512a['channel'],_0x1d512a[_0xab49('0x5')],_0x1d512a[_0xab49('0x6')],_0x1d512a[_0xab49('0x7')],_0x1d512a[_0xab49('0x8')],_0x1d512a[_0xab49('0x9')],_0x1d512a[_0xab49('0xa')]));if(_0x1d512a[_0xab49('0x5')]){utils['getVoiceQueueByName'](_0x1d512a[_0xab49('0x5')])[_0xab49('0xb')](function(_0xf12653){if(_0xf12653){_0x1d512a[_0xab49('0xc')]=_0xf12653[_0xab49('0xc')];_0x1d512a['agentacw']=_0x1d512a['agentcomplete']?_0xf12653[_0xab49('0xd')]:![];_0x1d512a[_0xab49('0xe')]=_0x1d512a[_0xab49('0xf')]?_0xf12653[_0xab49('0x10')]:0x0;}utils[_0xab49('0x11')]('CreateVoiceAgentReport',_0x1d512a);});}else{utils[_0xab49('0x11')](_0xab49('0x12'),_0x1d512a);}if(_0x8db649){delete transfers[_0x1d512a[_0xab49('0x13')]];}else{delete agents[_0x1d512a[_0xab49('0x14')]];}}exports[_0xab49('0x15')]=function(_0x36091a){try{utils[_0xab49('0x16')](util[_0xab49('0x3')](_0xab49('0x17'),_0x36091a[_0xab49('0x13')]),_0x36091a);agents[_0x36091a[_0xab49('0x14')]]=_0x36091a;agents[_0x36091a['destuniqueid']][_0xab49('0x18')]=utils[_0xab49('0x19')]();agents[_0x36091a[_0xab49('0x14')]][_0xab49('0xa')]=_0xab49('0x1a');agents[_0x36091a['destuniqueid']][_0xab49('0x9')]=null;agents[_0x36091a[_0xab49('0x14')]][_0xab49('0x1b')]=null;utils[_0xab49('0x1c')](util[_0xab49('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x36091a[_0xab49('0x13')],agents[_0x36091a[_0xab49('0x14')]][_0xab49('0x6')],_0x36091a['destuniqueid']));}catch(_0x4c22cd){utils[_0xab49('0x1d')](util[_0xab49('0x3')]('[%s][agents][agentcalled]',_0x36091a[_0xab49('0x13')]),_0x4c22cd);}};exports[_0xab49('0x1e')]=function(_0x49b716){try{if(!_[_0xab49('0x1f')](agents[_0x49b716['destuniqueid']])){utils[_0xab49('0x16')](util[_0xab49('0x3')]('[%s][agents][agentringnoanswer]',_0x49b716['uniqueid']),_0x49b716);utils[_0xab49('0x1c')](util['format'](_0xab49('0x20'),_0x49b716['uniqueid'],agents[_0x49b716[_0xab49('0x14')]][_0xab49('0x6')],_0x49b716[_0xab49('0x14')]));agents[_0x49b716['destuniqueid']][_0xab49('0x1e')]=!![];agents[_0x49b716['destuniqueid']][_0xab49('0x21')]=utils[_0xab49('0x19')]();agents[_0x49b716['destuniqueid']][_0xab49('0xa')]=_0xab49('0x22');agents[_0x49b716['destuniqueid']]['reason']=_0xab49('0x22');agents[_0x49b716[_0xab49('0x14')]][_0xab49('0x23')]=_0x49b716['ringtime']?parseInt(_0x49b716[_0xab49('0x24')])/0x3e8:0x0;agents[_0x49b716[_0xab49('0x14')]]['talktime']=0x0;unanswered[_0xab49('0x25')](_0x49b716[_0xab49('0x14')]);}}catch(_0x342fdf){utils['error'](util[_0xab49('0x3')]('[%s][agents][agentringnoanswer]',_0x49b716[_0xab49('0x13')]),_0x342fdf);}};exports['queuecallerabandon']=function(_0x19f094){try{_['forIn'](agents,function(_0x134a03,_0x24bd0f){if(_0x134a03[_0xab49('0x13')]==_0x19f094[_0xab49('0x13')]&&!_['includes'](unanswered,_0x134a03[_0xab49('0x14')])){utils[_0xab49('0x16')](util[_0xab49('0x3')]('[%s][agents][queuecallerabandon]',_0x19f094[_0xab49('0x13')]),_0x19f094);utils['info'](util[_0xab49('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x19f094['uniqueid'],_0x134a03['membername'],_0x134a03[_0xab49('0x14')]));_0x134a03['agentringnoanswer']=!![];_0x134a03[_0xab49('0x21')]=utils[_0xab49('0x19')]();_0x134a03[_0xab49('0xa')]='abandoned';_0x134a03[_0xab49('0x26')]=_0xab49('0x27');_0x134a03[_0xab49('0x23')]=_0x19f094[_0xab49('0x23')];_0x134a03[_0xab49('0x28')]=0x0;writeDB(_0x134a03);}});}catch(_0x56b768){utils[_0xab49('0x1d')](util[_0xab49('0x3')]('[%s][agents][queuecallerabandon]',_0x19f094['uniqueid']),_0x56b768);}};exports[_0xab49('0x29')]=function(_0x29c6cf){try{if(agents[_0x29c6cf[_0xab49('0x14')]]){utils[_0xab49('0x16')](util[_0xab49('0x3')](_0xab49('0x2a'),_0x29c6cf[_0xab49('0x13')]),_0x29c6cf);utils[_0xab49('0x1c')](util[_0xab49('0x3')](_0xab49('0x2b'),_0x29c6cf[_0xab49('0x13')],agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0x6')],_0x29c6cf['destuniqueid']));agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0x2c')]=utils[_0xab49('0x19')]();agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0x9')]=_0x29c6cf['connectedlinenum'];agents[_0x29c6cf[_0xab49('0x14')]]['connectedlinename']=_0x29c6cf['connectedlinename'];agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0x23')]=_0x29c6cf[_0xab49('0x24')];agents[_0x29c6cf[_0xab49('0x14')]][_0xab49('0xa')]='connect';_[_0xab49('0x2d')](agents,function(_0x2cdcbf,_0x2016a9){if(_0x2cdcbf[_0xab49('0x14')]!=_0x29c6cf[_0xab49('0x14')]&&_0x2cdcbf['uniqueid']==_0x29c6cf['uniqueid']){_0x2cdcbf[_0xab49('0x28')]=0x0;_0x2cdcbf[_0xab49('0x23')]=_0x29c6cf[_0xab49('0x24')];_0x2cdcbf['agentringnoanswer']=!![];_0x2cdcbf[_0xab49('0x21')]=utils['now']();_0x2cdcbf['lastevent']='answered_elsewhere';_0x2cdcbf['reason']=_0xab49('0x2e');_0x2cdcbf[_0xab49('0x2f')]=_0x29c6cf[_0xab49('0x14')];_0x2cdcbf[_0xab49('0x30')]=_0x29c6cf[_0xab49('0x6')];writeDB(_0x2cdcbf);}});}}catch(_0x3f3776){utils[_0xab49('0x1d')](util[_0xab49('0x3')](_0xab49('0x2a'),_0x29c6cf[_0xab49('0x13')]),_0x3f3776);}};exports['agentcomplete']=function(_0x158042){try{if(!_[_0xab49('0x1f')](agents[_0x158042['destuniqueid']])){utils[_0xab49('0x16')](util[_0xab49('0x3')](_0xab49('0x31'),_0x158042[_0xab49('0x13')]),_0x158042);utils[_0xab49('0x1c')](util[_0xab49('0x3')](_0xab49('0x32'),_0x158042[_0xab49('0x13')],agents[_0x158042['destuniqueid']][_0xab49('0x6')],_0x158042[_0xab49('0x14')]));agents[_0x158042[_0xab49('0x14')]]['agentcomplete']=!![];agents[_0x158042[_0xab49('0x14')]][_0xab49('0x33')]=utils[_0xab49('0x19')]();agents[_0x158042[_0xab49('0x14')]][_0xab49('0x28')]=utils[_0xab49('0x34')](agents[_0x158042['destuniqueid']][_0xab49('0x33')],agents[_0x158042[_0xab49('0x14')]][_0xab49('0x2c')]);agents[_0x158042[_0xab49('0x14')]][_0xab49('0x26')]=_0x158042[_0xab49('0x26')];agents[_0x158042['destuniqueid']][_0xab49('0xa')]=_0xab49('0x35');writeDB(agents[_0x158042[_0xab49('0x14')]]);}}catch(_0xca56ce){utils[_0xab49('0x1d')](util[_0xab49('0x3')](_0xab49('0x31'),_0x158042[_0xab49('0x13')]),_0xca56ce);}};exports[_0xab49('0x36')]=function(_0xfb7d69){try{if(!_[_0xab49('0x1f')](agents[_0xfb7d69[_0xab49('0x37')]])){utils['debug'](util[_0xab49('0x3')](_0xab49('0x38'),_0xfb7d69[_0xab49('0x13')]),_0xfb7d69);utils[_0xab49('0x1c')](util[_0xab49('0x3')](_0xab49('0x39'),_0xfb7d69[_0xab49('0x13')],agents[_0xfb7d69['transfereruniqueid']][_0xab49('0x6')],agents[_0xfb7d69['transfereruniqueid']][_0xab49('0x13')]));agents[_0xfb7d69['transfereruniqueid']][_0xab49('0x3a')]=!![];agents[_0xfb7d69[_0xab49('0x37')]]['transfertype']=_0xab49('0x3b');agents[_0xfb7d69[_0xab49('0x37')]][_0xab49('0x3c')]=_0xfb7d69[_0xab49('0x3d')];agents[_0xfb7d69[_0xab49('0x37')]][_0xab49('0x3e')]=agents[_0xfb7d69[_0xab49('0x37')]][_0xab49('0x13')];}}catch(_0x37cf42){utils[_0xab49('0x1d')](util[_0xab49('0x3')](_0xab49('0x38'),_0xfb7d69[_0xab49('0x13')]),_0x37cf42);}};exports[_0xab49('0x3f')]=function(_0x235ba8){try{utils[_0xab49('0x16')](util[_0xab49('0x3')]('[%s][agents][attendedtransfer]',_0x235ba8[_0xab49('0x40')]),_0x235ba8);if(_0x235ba8[_0xab49('0x40')]==_0x235ba8[_0xab49('0x41')]){if(!_[_0xab49('0x1f')](agents[_0x235ba8[_0xab49('0x42')]])){utils['info'](util[_0xab49('0x3')](_0xab49('0x43'),_0x235ba8[_0xab49('0x40')],agents[_0x235ba8[_0xab49('0x42')]][_0xab49('0x6')]));agents[_0x235ba8[_0xab49('0x42')]]['transfer']=!![];agents[_0x235ba8[_0xab49('0x42')]][_0xab49('0x44')]=_0xab49('0x45');agents[_0x235ba8[_0xab49('0x42')]]['transferexten']=_0x235ba8['origtransfererexten'];agents[_0x235ba8[_0xab49('0x42')]]['transferuniqueid']=_0x235ba8[_0xab49('0x40')];}if(_0x235ba8[_0xab49('0x46')]&&agents[_0x235ba8[_0xab49('0x46')]]){agents[_0x235ba8[_0xab49('0x46')]][_0xab49('0x47')]=0x1;transfers[_0x235ba8[_0xab49('0x46')]]=_[_0xab49('0x48')](agents[_0x235ba8[_0xab49('0x46')]]);transfers[_0x235ba8['transfereeuniqueid']][_0xab49('0x8')]=agents[_0x235ba8[_0xab49('0x42')]][_0xab49('0x8')];transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x49')]=agents[_0x235ba8['secondtransfereruniqueid']][_0xab49('0x49')];transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x18')]=utils[_0xab49('0x19')]();transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x2c')]=utils[_0xab49('0x19')]();transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x23')]=0x0;transfers[_0x235ba8[_0xab49('0x46')]][_0xab49('0x47')]=0x2;}}else if(_0x235ba8[_0xab49('0x42')]==_0x235ba8[_0xab49('0x4a')]){if(!_['isNil'](agents[_0x235ba8[_0xab49('0x40')]])){utils[_0xab49('0x1c')](util[_0xab49('0x3')](_0xab49('0x43'),_0x235ba8[_0xab49('0x40')],agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x6')]));agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x3a')]=!![];agents[_0x235ba8[_0xab49('0x40')]]['transfertype']=_0xab49('0x45');agents[_0x235ba8[_0xab49('0x40')]]['transferexten']=_0x235ba8[_0xab49('0x4b')];agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x3e')]=_0x235ba8['secondtransfereruniqueid'];}if(_0x235ba8[_0xab49('0x4c')]&&agents[_0x235ba8[_0xab49('0x4c')]]){agents[_0x235ba8['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x235ba8[_0xab49('0x4c')]]=_[_0xab49('0x48')](agents[_0x235ba8[_0xab49('0x4c')]]);transfers[_0x235ba8['transfertargetuniqueid']]['calleridnum']=agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x8')];transfers[_0x235ba8[_0xab49('0x4c')]][_0xab49('0x49')]=agents[_0x235ba8[_0xab49('0x40')]][_0xab49('0x49')];transfers[_0x235ba8[_0xab49('0x4c')]][_0xab49('0x18')]=utils['now']();transfers[_0x235ba8['transfertargetuniqueid']][_0xab49('0x2c')]=utils[_0xab49('0x19')]();transfers[_0x235ba8[_0xab49('0x4c')]][_0xab49('0x23')]=0x0;transfers[_0x235ba8[_0xab49('0x4c')]][_0xab49('0x47')]=0x2;}}}catch(_0x108755){utils[_0xab49('0x1d')](util[_0xab49('0x3')](_0xab49('0x4d'),_0x235ba8['origtransfereruniqueid']),_0x108755);}};exports[_0xab49('0x4e')]=function(_0x24fb84){try{utils[_0xab49('0x16')](util[_0xab49('0x3')](_0xab49('0x4f'),_0x24fb84[_0xab49('0x13')]),_0x24fb84);if(agents[_0x24fb84[_0xab49('0x13')]]&&agents[_0x24fb84[_0xab49('0x13')]]['reason']===_0xab49('0x22')){if(_0x24fb84['cause']==='21'){agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')]=_0xab49('0x50');agents[_0x24fb84['uniqueid']][_0xab49('0xa')]=_0xab49('0x50');}utils['info'](util[_0xab49('0x3')](_0xab49('0x51'),_0x24fb84[_0xab49('0x13')],agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x6')],agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')],agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0xa')]));writeDB(agents[_0x24fb84[_0xab49('0x13')]]);var _0x366a3c=unanswered[_0xab49('0x52')](_0x24fb84[_0xab49('0x13')]);if(_0x366a3c>-0x1){unanswered['splice'](_0x366a3c,0x1);}}if(transfers[_0x24fb84[_0xab49('0x13')]]){transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x53')]=!![];transfers[_0x24fb84['uniqueid']][_0xab49('0x33')]=utils[_0xab49('0x19')]();transfers[_0x24fb84['uniqueid']][_0xab49('0x28')]=utils[_0xab49('0x34')](transfers[_0x24fb84['uniqueid']][_0xab49('0x33')],transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x2c')]);transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')]=_0xab49('0x54');transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0xa')]='complete';utils['info'](util[_0xab49('0x3')](_0xab49('0x51'),_0x24fb84[_0xab49('0x13')],transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x6')],transfers[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')],transfers[_0x24fb84[_0xab49('0x13')]]['lastevent']));writeDB(transfers[_0x24fb84[_0xab49('0x13')]],!![]);}if(agents[_0x24fb84['uniqueid']]&&agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x2c')]){agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x53')]=!![];agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x33')]=utils[_0xab49('0x19')]();agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x28')]=utils[_0xab49('0x34')](agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x33')],agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x2c')]);agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0x26')]=agents[_0x24fb84['uniqueid']]['transfer']?_0xab49('0x3a'):_0xab49('0x54');agents[_0x24fb84[_0xab49('0x13')]][_0xab49('0xa')]=_0xab49('0x35');utils[_0xab49('0x1c')](util['format'](_0xab49('0x51'),_0x24fb84['uniqueid'],agents[_0x24fb84['uniqueid']][_0xab49('0x6')],agents[_0x24fb84['uniqueid']][_0xab49('0x26')],agents[_0x24fb84[_0xab49('0x13')]]['lastevent']));writeDB(agents[_0x24fb84[_0xab49('0x13')]]);}}catch(_0x271ee4){utils[_0xab49('0x1d')](util['format']('[%s][agents][hangup]',_0x24fb84[_0xab49('0x13')]),_0x271ee4);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 4c05062..8777e3b 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 _0x57ca=['[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','split','lastIndexOf','includes','noop','gotoif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','recording','format','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','hangup','[%s][calls][hangup]','callerid','cause-txt','duration','diffTime','endtime','billableseconds','answertime','[%s][calls][attendedtransfer]','origtransfereruniqueid'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x57ca,0x108));var _0xa57c=function(_0x5513da,_0x4d5b06){_0x5513da=_0x5513da-0x0;var _0x372ce5=_0x57ca[_0x5513da];return _0x372ce5;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var utils=require(_0xa57c('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x3'),_0xa57c('0x2'),_0xa57c('0x2'),'NO\x20ANSWER',_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x3'),_0xa57c('0x3'),_0xa57c('0x3')];var channels={};function writeDB(_0x314574){var _0x19e28e;if(transfers[_0xa57c('0x6')][_0x314574['uniqueid']]){_0x19e28e=_0x314574[_0xa57c('0x7')];_0x314574['uniqueid']=transfers[_0xa57c('0x6')][_0x314574[_0xa57c('0x7')]]['transfereeuniqueid'];}utils[_0xa57c('0x8')](util['format'](_0xa57c('0x9'),_0x314574[_0xa57c('0x7')],_0x314574['channel'],_0x314574[_0xa57c('0xa')],_0x314574['membername'],_0x314574[_0xa57c('0xb')],_0x314574[_0xa57c('0xc')],_0x314574[_0xa57c('0xd')],_0x314574[_0xa57c('0xe')]));if(_0x314574[_0xa57c('0xf')]){utils['getUserByInternal'](_0x314574[_0xa57c('0xf')])['then'](function(_0x30d23d){if(_0x30d23d){_0x314574[_0xa57c('0x10')]=_0x30d23d['id'];}utils[_0xa57c('0x11')](_0xa57c('0x12'),_0x314574);});}else{utils[_0xa57c('0x11')](_0xa57c('0x12'),_0x314574);}if(channels[_0x314574[_0xa57c('0x7')]]){delete channels[_0x314574['uniqueid']];}else if(_0x19e28e&&channels[_0x19e28e]){if(!transfers[_0xa57c('0x6')][_0x19e28e][_0xa57c('0x13')])delete transfers[_0xa57c('0x6')][_0x19e28e];delete channels[_0x19e28e];}}exports['newchannel']=function(_0x2746a0){try{utils['debug'](util[_0xa57c('0x14')](_0xa57c('0x15'),_0x2746a0[_0xa57c('0x7')]),_0x2746a0);if(_0x2746a0[_0xa57c('0x7')]==_0x2746a0[_0xa57c('0x16')]&&_0x2746a0[_0xa57c('0x17')]!=_0xa57c('0x18')){utils[_0xa57c('0x8')](util['format'](_0xa57c('0x19'),_0x2746a0['uniqueid'],_0x2746a0['context'],_0x2746a0[_0xa57c('0x1a')]));channels[_0x2746a0[_0xa57c('0x7')]]={'uniqueid':_0x2746a0[_0xa57c('0x7')],'accountcode':_0x2746a0[_0xa57c('0xf')],'source':_0x2746a0['calleridnum'],'destination':_0x2746a0[_0xa57c('0x1a')],'destinationcontext':_0x2746a0[_0xa57c('0x1b')],'channel':_0x2746a0[_0xa57c('0x17')],'starttime':utils[_0xa57c('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa57c('0x2'),'amaflags':_0xa57c('0x1d')};}}catch(_0x1e0192){utils[_0xa57c('0x1e')](util[_0xa57c('0x14')](_0xa57c('0x15'),_0x2746a0[_0xa57c('0x7')]),_0x1e0192);}};exports[_0xa57c('0x1f')]=function(_0x241dcc){try{utils[_0xa57c('0x20')](util[_0xa57c('0x14')]('[%s][calls][newstate]',_0x241dcc[_0xa57c('0x7')]),_0x241dcc);if(!_[_0xa57c('0x21')](channels[_0x241dcc[_0xa57c('0x7')]])&&_0x241dcc[_0xa57c('0x22')]==0x6){utils[_0xa57c('0x8')](util[_0xa57c('0x14')](_0xa57c('0x23'),_0x241dcc[_0xa57c('0x7')],_0x241dcc[_0xa57c('0x1b')],_0x241dcc[_0xa57c('0x17')]));if(_['isNil'](channels[_0x241dcc[_0xa57c('0x7')]]['systemanswertime'])){channels[_0x241dcc['uniqueid']][_0xa57c('0x24')]=utils[_0xa57c('0x1c')]();}}else if(!_['isNil'](channels[_0x241dcc[_0xa57c('0x16')]])&&_0x241dcc[_0xa57c('0x22')]==0x6&&_0x241dcc[_0xa57c('0x1b')]!='transfer'){utils[_0xa57c('0x8')](util['format'](_0xa57c('0x25'),_0x241dcc['uniqueid'],_0x241dcc[_0xa57c('0x16')],_0x241dcc['context'],_0x241dcc[_0xa57c('0x17')]));channels[_0x241dcc['linkedid']][_0xa57c('0xf')]=_0x241dcc[_0xa57c('0xf')];channels[_0x241dcc[_0xa57c('0x16')]][_0xa57c('0x26')]=_0x241dcc[_0xa57c('0x17')];if(_[_0xa57c('0x21')](channels[_0x241dcc[_0xa57c('0x16')]]['answertime'])){channels[_0x241dcc[_0xa57c('0x16')]]['answertime']=utils[_0xa57c('0x1c')]();}channels[_0x241dcc[_0xa57c('0x16')]][_0xa57c('0x27')]=dispositions[_['toNumber'](_0x241dcc[_0xa57c('0x22')])]||'ANSWERED';}}catch(_0x24a087){utils['error'](util[_0xa57c('0x14')]('[%s][calls][newstate]',_0x241dcc[_0xa57c('0x7')]),_0x24a087);}};exports[_0xa57c('0x28')]=function(_0x4903ae){try{if(!_[_0xa57c('0x21')](channels[_0x4903ae['uniqueid']])){utils[_0xa57c('0x20')](util['format'](_0xa57c('0x29'),_0x4903ae[_0xa57c('0x7')]),_0x4903ae);if(_[_0xa57c('0x21')](channels[_0x4903ae[_0xa57c('0x7')]][_0xa57c('0x2a')])){channels[_0x4903ae[_0xa57c('0x7')]]['callerid']=_0x4903ae['calleridname']+'\x20<'+_0x4903ae[_0xa57c('0xc')]+'>';}utils[_0xa57c('0x8')](util[_0xa57c('0x14')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x4903ae[_0xa57c('0x7')],channels[_0x4903ae['uniqueid']][_0xa57c('0x2a')],_0x4903ae[_0xa57c('0x2b')]));channels[_0x4903ae['uniqueid']]['endtime']=utils['now']();channels[_0x4903ae[_0xa57c('0x7')]][_0xa57c('0x2c')]=utils[_0xa57c('0x2d')](channels[_0x4903ae[_0xa57c('0x7')]][_0xa57c('0x2e')],channels[_0x4903ae[_0xa57c('0x7')]]['starttime']);channels[_0x4903ae[_0xa57c('0x7')]][_0xa57c('0x2f')]=channels[_0x4903ae['uniqueid']]['answertime']?utils[_0xa57c('0x2d')](channels[_0x4903ae[_0xa57c('0x7')]]['endtime'],channels[_0x4903ae[_0xa57c('0x7')]][_0xa57c('0x30')]):0x0;writeDB(channels[_0x4903ae[_0xa57c('0x7')]]);}}catch(_0x2206a3){utils[_0xa57c('0x1e')](util[_0xa57c('0x14')]('[%s][calls][hangup]',_0x4903ae[_0xa57c('0x7')]),_0x2206a3);}};exports['attendedtransfer']=function(_0x4e3936){try{if(!_['isNil'](channels[_0x4e3936['localtwolinkedid']])){utils['debug'](util[_0xa57c('0x14')](_0xa57c('0x31'),_0x4e3936[_0xa57c('0x32')]),_0x4e3936);if(channels[_0x4e3936['localtwolinkedid']]['channel']==_0x4e3936['transfereechannel']){utils[_0xa57c('0x8')](util[_0xa57c('0x14')](_0xa57c('0x33'),_0x4e3936[_0xa57c('0x32')],_0x4e3936[_0xa57c('0x34')],_0x4e3936[_0xa57c('0x35')]));channels[_0x4e3936['localtwolinkedid']][_0xa57c('0x26')]=_0x4e3936[_0xa57c('0x35')];channels[_0x4e3936[_0xa57c('0x34')]][_0xa57c('0x36')]=_0xa57c('0x37');}else if(channels[_0x4e3936[_0xa57c('0x34')]]['channel']=_0x4e3936[_0xa57c('0x38')]){utils[_0xa57c('0x8')](util[_0xa57c('0x14')](_0xa57c('0x33'),_0x4e3936[_0xa57c('0x32')],_0x4e3936['localtwolinkedid'],_0x4e3936[_0xa57c('0x39')]));channels[_0x4e3936[_0xa57c('0x34')]][_0xa57c('0x26')]=_0x4e3936[_0xa57c('0x39')];channels[_0x4e3936[_0xa57c('0x34')]][_0xa57c('0x36')]='_attended';}}}catch(_0xedd288){utils[_0xa57c('0x1e')](util[_0xa57c('0x14')](_0xa57c('0x31'),_0x4e3936[_0xa57c('0x32')]),_0xedd288);}};exports[_0xa57c('0x3a')]=function(_0x57533e){try{if(!_['isNil'](channels[_0x57533e['uniqueid']])){utils['debug'](util[_0xa57c('0x14')]('[%s][calls][musiconholdstart]',_0x57533e[_0xa57c('0x7')]),_0x57533e);channels[_0x57533e[_0xa57c('0x7')]]['musiconholdstartAt']=utils[_0xa57c('0x1c')]();utils[_0xa57c('0x8')](util[_0xa57c('0x14')](_0xa57c('0x3b'),_0x57533e[_0xa57c('0x7')],channels[_0x57533e['uniqueid']][_0xa57c('0x3c')]));}}catch(_0x54a573){utils[_0xa57c('0x1e')](util[_0xa57c('0x14')](_0xa57c('0x3d'),_0x57533e['uniqueid']),_0x54a573);}};exports[_0xa57c('0x3e')]=function(_0x560808){try{if(!_['isNil'](channels[_0x560808[_0xa57c('0x7')]])){utils[_0xa57c('0x20')](util[_0xa57c('0x14')]('[%s][calls][musiconholdstop]',_0x560808['uniqueid']),_0x560808);if(!_[_0xa57c('0x21')](channels[_0x560808[_0xa57c('0x7')]][_0xa57c('0x3c')])){channels[_0x560808[_0xa57c('0x7')]]['mohtime']+=utils[_0xa57c('0x2d')](utils[_0xa57c('0x1c')](),channels[_0x560808[_0xa57c('0x7')]]['musiconholdstartAt']);utils['info'](util[_0xa57c('0x14')](_0xa57c('0x3f'),_0x560808['uniqueid'],channels[_0x560808[_0xa57c('0x7')]][_0xa57c('0x40')]));delete channels[_0x560808[_0xa57c('0x7')]][_0xa57c('0x3c')];}}}catch(_0x369514){utils[_0xa57c('0x1e')](util[_0xa57c('0x14')]('[%s][calls][musiconholdstop]',_0x560808['uniqueid']),_0x369514);}};exports[_0xa57c('0x41')]=function(_0x14f3d6){try{if(!_[_0xa57c('0x21')](channels[_0x14f3d6[_0xa57c('0x7')]])){utils[_0xa57c('0x20')](util[_0xa57c('0x14')](_0xa57c('0x42'),_0x14f3d6[_0xa57c('0x7')]),_0x14f3d6);if(!_['isNil'](_0x14f3d6['variable'][_0xa57c('0x43')])){utils['info'](util[_0xa57c('0x14')](_0xa57c('0x44'),_0x14f3d6[_0xa57c('0x7')],_0x14f3d6['value']));channels[_0x14f3d6[_0xa57c('0x7')]]['source']=_0x14f3d6[_0xa57c('0x45')];}if(!_['isNil'](_0x14f3d6[_0xa57c('0x46')][_0xa57c('0x47')])){utils[_0xa57c('0x8')](util[_0xa57c('0x14')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x14f3d6[_0xa57c('0x7')],_0x14f3d6[_0xa57c('0x45')]));channels[_0x14f3d6[_0xa57c('0x7')]][_0xa57c('0x48')]=_0x14f3d6[_0xa57c('0x45')];channels[_0x14f3d6['uniqueid']][_0xa57c('0x2a')]='\x22'+_0x14f3d6[_0xa57c('0x45')]+_0xa57c('0x49')+_0x14f3d6[_0xa57c('0x45')]+'>';}if(!_[_0xa57c('0x21')](_0x14f3d6[_0xa57c('0x46')][_0xa57c('0x4a')])||!_[_0xa57c('0x21')](_0x14f3d6[_0xa57c('0x46')][_0xa57c('0x4b')])){utils['info'](util[_0xa57c('0x14')](_0xa57c('0x4c'),_0x14f3d6[_0xa57c('0x7')],!_[_0xa57c('0x21')](_0x14f3d6[_0xa57c('0x46')][_0xa57c('0x4a')])?'xmd-callerid-preview':_0xa57c('0x4b'),_0x14f3d6[_0xa57c('0x45')]));channels[_0x14f3d6['uniqueid']][_0xa57c('0x2a')]=_0x14f3d6[_0xa57c('0x45')];}if(!_[_0xa57c('0x21')](_0x14f3d6[_0xa57c('0x46')][_0xa57c('0x4d')])||!_[_0xa57c('0x21')](_0x14f3d6[_0xa57c('0x46')]['xmcs-queue'])){utils[_0xa57c('0x8')](util['format'](_0xa57c('0x4c'),_0x14f3d6['uniqueid'],!_[_0xa57c('0x21')](_0x14f3d6['variable'][_0xa57c('0x4d')])?_0xa57c('0x4d'):'xmcs-queue',_0x14f3d6[_0xa57c('0x45')]));channels[_0x14f3d6[_0xa57c('0x7')]][_0xa57c('0x4e')]=_0xa57c('0x4f');channels[_0x14f3d6['uniqueid']][_0xa57c('0x50')]=_0x14f3d6[_0xa57c('0x45')];channels[_0x14f3d6[_0xa57c('0x7')]][_0xa57c('0xa')]=!![];}if(!_[_0xa57c('0x21')](_0x14f3d6[_0xa57c('0x46')][_0xa57c('0x51')])){utils[_0xa57c('0x8')](util[_0xa57c('0x14')](_0xa57c('0x52'),_0x14f3d6[_0xa57c('0x7')],_0x14f3d6[_0xa57c('0x45')]));channels[_0x14f3d6[_0xa57c('0x7')]][_0xa57c('0x53')]=_0x14f3d6[_0xa57c('0x45')];}if(!_[_0xa57c('0x21')](_0x14f3d6['variable'][_0xa57c('0x54')])){utils['info'](util[_0xa57c('0x14')](_0xa57c('0x55'),_0x14f3d6[_0xa57c('0x7')],_0x14f3d6['value']));channels[_0x14f3d6[_0xa57c('0x7')]][_0xa57c('0x56')]=_0x14f3d6[_0xa57c('0x45')];}if(!_['isNil'](_0x14f3d6['variable'][_0xa57c('0x57')])){utils[_0xa57c('0x8')](util[_0xa57c('0x14')](_0xa57c('0x58'),_0x14f3d6[_0xa57c('0x7')],_0x14f3d6[_0xa57c('0x45')]));channels[_0x14f3d6[_0xa57c('0x7')]][_0xa57c('0x59')]=_0x14f3d6[_0xa57c('0x45')];}if(!_['isNil'](_0x14f3d6[_0xa57c('0x46')][_0xa57c('0x5a')])){utils['info'](util[_0xa57c('0x14')](_0xa57c('0x5b'),_0x14f3d6[_0xa57c('0x7')],_0x14f3d6[_0xa57c('0x45')]));channels[_0x14f3d6[_0xa57c('0x7')]][_0xa57c('0x5a')]=_0x14f3d6[_0xa57c('0x45')];}}}catch(_0x10616e){utils['error'](util[_0xa57c('0x14')](_0xa57c('0x42'),_0x14f3d6['uniqueid']),_0x10616e);}};exports[_0xa57c('0x5c')]=function(_0x4a74d7){try{if(!_['isNil'](channels[_0x4a74d7['uniqueid']])){utils[_0xa57c('0x20')](util[_0xa57c('0x14')](_0xa57c('0x5d'),_0x4a74d7[_0xa57c('0x7')]),_0x4a74d7);utils[_0xa57c('0x8')](util['format'](_0xa57c('0x5e'),_0x4a74d7[_0xa57c('0x7')],_0x4a74d7[_0xa57c('0x5f')],_0x4a74d7['appdata']));if(_0x4a74d7[_0xa57c('0x5f')]['toLowerCase']()==_0xa57c('0x60')&&_[_0xa57c('0x61')](_0x4a74d7[_0xa57c('0x62')][_0xa57c('0x63')](),'cdr')){var _0x3740e9=_0x4a74d7[_0xa57c('0x62')][_0xa57c('0x64')]('=');var _0x95d1be=_0x3740e9[0x0]['substring'](_0x3740e9[0x0][_0xa57c('0x65')]('(')+0x1,_0x3740e9[0x0][_0xa57c('0x65')](')'));var _0x44e547=_0x3740e9[0x1];channels[_0x4a74d7['uniqueid']][_0x95d1be]=_0x44e547;}if(!_[_0xa57c('0x66')]([_0xa57c('0x28'),_0xa57c('0x67'),'execif',_0xa57c('0x60'),_0xa57c('0x68')],_0x4a74d7[_0xa57c('0x5f')][_0xa57c('0x63')]())){channels[_0x4a74d7['uniqueid']][_0xa57c('0x4e')]=_0x4a74d7[_0xa57c('0x5f')];channels[_0x4a74d7['uniqueid']][_0xa57c('0x50')]=_0x4a74d7[_0xa57c('0x62')];}}}catch(_0x59d2a2){utils[_0xa57c('0x1e')](util['format'](_0xa57c('0x5d'),_0x4a74d7[_0xa57c('0x7')]),_0x59d2a2);}}; \ No newline at end of file +var _0x0e50=['diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','secondtransfererchannel','userfield','_attended','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','destination','\x22\x20<','xmd-callerid','xmd-callerid-preview','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','context','exten','now','DOCUMENTATION','error','debug','isNil','channelstate','info','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','[%s][calls][newstate]','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration'];(function(_0x188469,_0x3acbbc){var _0x2d8eb7=function(_0x2d3c3f){while(--_0x2d3c3f){_0x188469['push'](_0x188469['shift']());}};_0x2d8eb7(++_0x3acbbc);}(_0x0e50,0x168));var _0x00e5=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0e50[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x00e5('0x0'));var util=require(_0x00e5('0x1'));var utils=require(_0x00e5('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x00e5('0x3'),_0x00e5('0x4'),_0x00e5('0x4'),_0x00e5('0x3'),_0x00e5('0x3'),'NO\x20ANSWER',_0x00e5('0x5'),'BUSY',_0x00e5('0x4'),_0x00e5('0x4'),_0x00e5('0x4')];var channels={};function writeDB(_0x2a4119){var _0x40b93e;if(transfers['blinds'][_0x2a4119[_0x00e5('0x6')]]){_0x40b93e=_0x2a4119[_0x00e5('0x6')];_0x2a4119[_0x00e5('0x6')]=transfers[_0x00e5('0x7')][_0x2a4119[_0x00e5('0x6')]][_0x00e5('0x8')];}utils['info'](util[_0x00e5('0x9')](_0x00e5('0xa'),_0x2a4119['uniqueid'],_0x2a4119[_0x00e5('0xb')],_0x2a4119[_0x00e5('0xc')],_0x2a4119['membername'],_0x2a4119['interface'],_0x2a4119[_0x00e5('0xd')],_0x2a4119[_0x00e5('0xe')],_0x2a4119[_0x00e5('0xf')]));if(_0x2a4119['accountcode']){utils[_0x00e5('0x10')](_0x2a4119[_0x00e5('0x11')])[_0x00e5('0x12')](function(_0x3ba86e){if(_0x3ba86e){_0x2a4119[_0x00e5('0x13')]=_0x3ba86e['id'];}utils[_0x00e5('0x14')](_0x00e5('0x15'),_0x2a4119);});}else{utils['request'](_0x00e5('0x15'),_0x2a4119);}if(channels[_0x2a4119['uniqueid']]){delete channels[_0x2a4119[_0x00e5('0x6')]];}else if(_0x40b93e&&channels[_0x40b93e]){if(!transfers[_0x00e5('0x7')][_0x40b93e][_0x00e5('0x16')])delete transfers[_0x00e5('0x7')][_0x40b93e];delete channels[_0x40b93e];}}exports[_0x00e5('0x17')]=function(_0x4fe9a6){try{utils['debug'](util[_0x00e5('0x9')](_0x00e5('0x18'),_0x4fe9a6[_0x00e5('0x6')]),_0x4fe9a6);if(_0x4fe9a6['uniqueid']==_0x4fe9a6['linkedid']&&_0x4fe9a6['channel']!='OutgoingSpoolFailed'){utils['info'](util[_0x00e5('0x9')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x4fe9a6['uniqueid'],_0x4fe9a6[_0x00e5('0x19')],_0x4fe9a6[_0x00e5('0x1a')]));channels[_0x4fe9a6[_0x00e5('0x6')]]={'uniqueid':_0x4fe9a6[_0x00e5('0x6')],'accountcode':_0x4fe9a6[_0x00e5('0x11')],'source':_0x4fe9a6[_0x00e5('0xd')],'destination':_0x4fe9a6[_0x00e5('0x1a')],'destinationcontext':_0x4fe9a6[_0x00e5('0x19')],'channel':_0x4fe9a6[_0x00e5('0xb')],'starttime':utils[_0x00e5('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x00e5('0x3'),'amaflags':_0x00e5('0x1c')};}}catch(_0x4dd9a4){utils[_0x00e5('0x1d')](util[_0x00e5('0x9')](_0x00e5('0x18'),_0x4fe9a6[_0x00e5('0x6')]),_0x4dd9a4);}};exports['newstate']=function(_0x7ea256){try{utils[_0x00e5('0x1e')](util['format']('[%s][calls][newstate]',_0x7ea256[_0x00e5('0x6')]),_0x7ea256);if(!_[_0x00e5('0x1f')](channels[_0x7ea256[_0x00e5('0x6')]])&&_0x7ea256[_0x00e5('0x20')]==0x6){utils[_0x00e5('0x21')](util[_0x00e5('0x9')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x7ea256[_0x00e5('0x6')],_0x7ea256['context'],_0x7ea256['channel']));if(_[_0x00e5('0x1f')](channels[_0x7ea256[_0x00e5('0x6')]][_0x00e5('0x22')])){channels[_0x7ea256[_0x00e5('0x6')]][_0x00e5('0x22')]=utils[_0x00e5('0x1b')]();}}else if(!_[_0x00e5('0x1f')](channels[_0x7ea256[_0x00e5('0x23')]])&&_0x7ea256['channelstate']==0x6&&_0x7ea256[_0x00e5('0x19')]!=_0x00e5('0x24')){utils[_0x00e5('0x21')](util[_0x00e5('0x9')](_0x00e5('0x25'),_0x7ea256[_0x00e5('0x6')],_0x7ea256[_0x00e5('0x23')],_0x7ea256['context'],_0x7ea256[_0x00e5('0xb')]));channels[_0x7ea256['linkedid']][_0x00e5('0x11')]=_0x7ea256[_0x00e5('0x11')];channels[_0x7ea256['linkedid']][_0x00e5('0x26')]=_0x7ea256['channel'];if(_[_0x00e5('0x1f')](channels[_0x7ea256[_0x00e5('0x23')]]['answertime'])){channels[_0x7ea256[_0x00e5('0x23')]][_0x00e5('0x27')]=utils['now']();}channels[_0x7ea256[_0x00e5('0x23')]]['disposition']=dispositions[_[_0x00e5('0x28')](_0x7ea256['channelstate'])]||_0x00e5('0x5');}}catch(_0x29b040){utils[_0x00e5('0x1d')](util[_0x00e5('0x9')](_0x00e5('0x29'),_0x7ea256[_0x00e5('0x6')]),_0x29b040);}};exports[_0x00e5('0x2a')]=function(_0x1a7ed2){try{if(!_['isNil'](channels[_0x1a7ed2[_0x00e5('0x6')]])){utils['debug'](util[_0x00e5('0x9')]('[%s][calls][hangup]',_0x1a7ed2[_0x00e5('0x6')]),_0x1a7ed2);if(_[_0x00e5('0x1f')](channels[_0x1a7ed2[_0x00e5('0x6')]]['callerid'])){channels[_0x1a7ed2[_0x00e5('0x6')]][_0x00e5('0x2b')]=_0x1a7ed2['calleridname']+'\x20<'+_0x1a7ed2[_0x00e5('0xd')]+'>';}utils[_0x00e5('0x21')](util[_0x00e5('0x9')](_0x00e5('0x2c'),_0x1a7ed2['uniqueid'],channels[_0x1a7ed2[_0x00e5('0x6')]][_0x00e5('0x2b')],_0x1a7ed2[_0x00e5('0x2d')]));channels[_0x1a7ed2[_0x00e5('0x6')]][_0x00e5('0x2e')]=utils[_0x00e5('0x1b')]();channels[_0x1a7ed2[_0x00e5('0x6')]][_0x00e5('0x2f')]=utils[_0x00e5('0x30')](channels[_0x1a7ed2[_0x00e5('0x6')]][_0x00e5('0x2e')],channels[_0x1a7ed2['uniqueid']][_0x00e5('0x31')]);channels[_0x1a7ed2['uniqueid']][_0x00e5('0x32')]=channels[_0x1a7ed2[_0x00e5('0x6')]][_0x00e5('0x27')]?utils[_0x00e5('0x30')](channels[_0x1a7ed2[_0x00e5('0x6')]][_0x00e5('0x2e')],channels[_0x1a7ed2[_0x00e5('0x6')]][_0x00e5('0x27')]):0x0;writeDB(channels[_0x1a7ed2['uniqueid']]);}}catch(_0x5d8745){utils['error'](util[_0x00e5('0x9')](_0x00e5('0x33'),_0x1a7ed2[_0x00e5('0x6')]),_0x5d8745);}};exports[_0x00e5('0x34')]=function(_0x4e29c0){try{if(!_[_0x00e5('0x1f')](channels[_0x4e29c0['localtwolinkedid']])){utils[_0x00e5('0x1e')](util[_0x00e5('0x9')](_0x00e5('0x35'),_0x4e29c0[_0x00e5('0x36')]),_0x4e29c0);if(channels[_0x4e29c0[_0x00e5('0x37')]]['channel']==_0x4e29c0['transfereechannel']){utils[_0x00e5('0x21')](util[_0x00e5('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4e29c0[_0x00e5('0x36')],_0x4e29c0[_0x00e5('0x37')],_0x4e29c0[_0x00e5('0x38')]));channels[_0x4e29c0[_0x00e5('0x37')]][_0x00e5('0x26')]=_0x4e29c0[_0x00e5('0x38')];channels[_0x4e29c0[_0x00e5('0x37')]][_0x00e5('0x39')]=_0x00e5('0x3a');}else if(channels[_0x4e29c0[_0x00e5('0x37')]]['channel']=_0x4e29c0['transfertargetchannel']){utils['info'](util[_0x00e5('0x9')](_0x00e5('0x3b'),_0x4e29c0['origtransfereruniqueid'],_0x4e29c0[_0x00e5('0x37')],_0x4e29c0[_0x00e5('0x3c')]));channels[_0x4e29c0[_0x00e5('0x37')]]['destinationchannel']=_0x4e29c0['origtransfererchannel'];channels[_0x4e29c0[_0x00e5('0x37')]][_0x00e5('0x39')]=_0x00e5('0x3a');}}}catch(_0x50237d){utils['error'](util[_0x00e5('0x9')](_0x00e5('0x35'),_0x4e29c0['origtransfereruniqueid']),_0x50237d);}};exports[_0x00e5('0x3d')]=function(_0x2f91d2){try{if(!_[_0x00e5('0x1f')](channels[_0x2f91d2['uniqueid']])){utils[_0x00e5('0x1e')](util[_0x00e5('0x9')](_0x00e5('0x3e'),_0x2f91d2[_0x00e5('0x6')]),_0x2f91d2);channels[_0x2f91d2['uniqueid']][_0x00e5('0x3f')]=utils[_0x00e5('0x1b')]();utils[_0x00e5('0x21')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x2f91d2[_0x00e5('0x6')],channels[_0x2f91d2[_0x00e5('0x6')]][_0x00e5('0x3f')]));}}catch(_0x451504){utils[_0x00e5('0x1d')](util[_0x00e5('0x9')](_0x00e5('0x3e'),_0x2f91d2[_0x00e5('0x6')]),_0x451504);}};exports[_0x00e5('0x40')]=function(_0x45d892){try{if(!_[_0x00e5('0x1f')](channels[_0x45d892[_0x00e5('0x6')]])){utils[_0x00e5('0x1e')](util[_0x00e5('0x9')]('[%s][calls][musiconholdstop]',_0x45d892['uniqueid']),_0x45d892);if(!_[_0x00e5('0x1f')](channels[_0x45d892[_0x00e5('0x6')]]['musiconholdstartAt'])){channels[_0x45d892[_0x00e5('0x6')]][_0x00e5('0x41')]+=utils['diffTime'](utils[_0x00e5('0x1b')](),channels[_0x45d892[_0x00e5('0x6')]][_0x00e5('0x3f')]);utils[_0x00e5('0x21')](util[_0x00e5('0x9')](_0x00e5('0x42'),_0x45d892[_0x00e5('0x6')],channels[_0x45d892['uniqueid']][_0x00e5('0x41')]));delete channels[_0x45d892['uniqueid']][_0x00e5('0x3f')];}}}catch(_0x1e1d46){utils['error'](util[_0x00e5('0x9')](_0x00e5('0x43'),_0x45d892['uniqueid']),_0x1e1d46);}};exports['varset']=function(_0xd4188e){try{if(!_[_0x00e5('0x1f')](channels[_0xd4188e[_0x00e5('0x6')]])){utils[_0x00e5('0x1e')](util[_0x00e5('0x9')](_0x00e5('0x44'),_0xd4188e['uniqueid']),_0xd4188e);if(!_[_0x00e5('0x1f')](_0xd4188e[_0x00e5('0x45')]['xmd-originatecalleridnum'])){utils[_0x00e5('0x21')](util[_0x00e5('0x9')](_0x00e5('0x46'),_0xd4188e[_0x00e5('0x6')],_0xd4188e['value']));channels[_0xd4188e['uniqueid']][_0x00e5('0x47')]=_0xd4188e['value'];}if(!_['isNil'](_0xd4188e[_0x00e5('0x45')]['xmd-phone'])){utils['info'](util[_0x00e5('0x9')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0xd4188e[_0x00e5('0x6')],_0xd4188e[_0x00e5('0x48')]));channels[_0xd4188e['uniqueid']][_0x00e5('0x49')]=_0xd4188e[_0x00e5('0x48')];channels[_0xd4188e[_0x00e5('0x6')]]['callerid']='\x22'+_0xd4188e[_0x00e5('0x48')]+_0x00e5('0x4a')+_0xd4188e[_0x00e5('0x48')]+'>';}if(!_[_0x00e5('0x1f')](_0xd4188e[_0x00e5('0x45')]['xmd-callerid-preview'])||!_[_0x00e5('0x1f')](_0xd4188e[_0x00e5('0x45')][_0x00e5('0x4b')])){utils['info'](util[_0x00e5('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xd4188e[_0x00e5('0x6')],!_['isNil'](_0xd4188e[_0x00e5('0x45')]['xmd-callerid-preview'])?_0x00e5('0x4c'):_0x00e5('0x4b'),_0xd4188e[_0x00e5('0x48')]));channels[_0xd4188e[_0x00e5('0x6')]][_0x00e5('0x2b')]=_0xd4188e[_0x00e5('0x48')];}if(!_['isNil'](_0xd4188e['variable'][_0x00e5('0x4d')])||!_[_0x00e5('0x1f')](_0xd4188e[_0x00e5('0x45')]['xmcs-queue'])){utils[_0x00e5('0x21')](util['format'](_0x00e5('0x4e'),_0xd4188e['uniqueid'],!_['isNil'](_0xd4188e['variable'][_0x00e5('0x4d')])?_0x00e5('0x4d'):'xmcs-queue',_0xd4188e[_0x00e5('0x48')]));channels[_0xd4188e['uniqueid']][_0x00e5('0x4f')]='Queue';channels[_0xd4188e[_0x00e5('0x6')]][_0x00e5('0x50')]=_0xd4188e[_0x00e5('0x48')];channels[_0xd4188e['uniqueid']]['queue']=!![];}if(!_['isNil'](_0xd4188e[_0x00e5('0x45')][_0x00e5('0x51')])){utils[_0x00e5('0x21')](util[_0x00e5('0x9')](_0x00e5('0x52'),_0xd4188e[_0x00e5('0x6')],_0xd4188e[_0x00e5('0x48')]));channels[_0xd4188e['uniqueid']]['ContactId']=_0xd4188e[_0x00e5('0x48')];}if(!_['isNil'](_0xd4188e[_0x00e5('0x45')][_0x00e5('0x53')])){utils[_0x00e5('0x21')](util[_0x00e5('0x9')](_0x00e5('0x54'),_0xd4188e['uniqueid'],_0xd4188e[_0x00e5('0x48')]));channels[_0xd4188e[_0x00e5('0x6')]][_0x00e5('0x55')]=_0xd4188e[_0x00e5('0x48')];}if(!_[_0x00e5('0x1f')](_0xd4188e[_0x00e5('0x45')][_0x00e5('0x56')])){utils[_0x00e5('0x21')](util[_0x00e5('0x9')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0xd4188e[_0x00e5('0x6')],_0xd4188e[_0x00e5('0x48')]));channels[_0xd4188e['uniqueid']]['routeid']=_0xd4188e[_0x00e5('0x48')];}if(!_[_0x00e5('0x1f')](_0xd4188e[_0x00e5('0x45')]['sipcallid'])){utils[_0x00e5('0x21')](util[_0x00e5('0x9')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xd4188e[_0x00e5('0x6')],_0xd4188e[_0x00e5('0x48')]));channels[_0xd4188e['uniqueid']][_0x00e5('0x57')]=_0xd4188e[_0x00e5('0x48')];}}}catch(_0x35e8be){utils[_0x00e5('0x1d')](util[_0x00e5('0x9')]('[%s][calls][varset]',_0xd4188e[_0x00e5('0x6')]),_0x35e8be);}};exports[_0x00e5('0x58')]=function(_0x3bb752){try{if(!_[_0x00e5('0x1f')](channels[_0x3bb752['uniqueid']])){utils[_0x00e5('0x1e')](util[_0x00e5('0x9')](_0x00e5('0x59'),_0x3bb752[_0x00e5('0x6')]),_0x3bb752);utils['info'](util[_0x00e5('0x9')](_0x00e5('0x5a'),_0x3bb752[_0x00e5('0x6')],_0x3bb752[_0x00e5('0x5b')],_0x3bb752[_0x00e5('0x5c')]));if(_0x3bb752[_0x00e5('0x5b')][_0x00e5('0x5d')]()==_0x00e5('0x5e')&&_[_0x00e5('0x5f')](_0x3bb752[_0x00e5('0x5c')][_0x00e5('0x5d')](),'cdr')){var _0x38046b=_0x3bb752[_0x00e5('0x5c')]['split']('=');var _0x237c00=_0x38046b[0x0][_0x00e5('0x60')](_0x38046b[0x0]['lastIndexOf']('(')+0x1,_0x38046b[0x0][_0x00e5('0x61')](')'));var _0x5485ff=_0x38046b[0x1];channels[_0x3bb752[_0x00e5('0x6')]][_0x237c00]=_0x5485ff;}if(!_[_0x00e5('0x62')]([_0x00e5('0x2a'),_0x00e5('0x63'),_0x00e5('0x64'),_0x00e5('0x5e'),_0x00e5('0x65')],_0x3bb752[_0x00e5('0x5b')][_0x00e5('0x5d')]())){channels[_0x3bb752['uniqueid']]['lastapplication']=_0x3bb752[_0x00e5('0x5b')];channels[_0x3bb752[_0x00e5('0x6')]][_0x00e5('0x50')]=_0x3bb752[_0x00e5('0x5c')];}}}catch(_0x3a3404){utils[_0x00e5('0x1d')](util[_0x00e5('0x9')](_0x00e5('0x59'),_0x3bb752[_0x00e5('0x6')]),_0x3a3404);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c7e0fa2..b02fd58 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 _0x6994=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils','connect','info','[core]\x20connected'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6994,0x14c));var _0x4699=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x6994[_0x616290];return _0x453879;};'use strict';var utils=require(_0x4699('0x0'));exports[_0x4699('0x1')]=function(){utils[_0x4699('0x2')](_0x4699('0x3'));};exports[_0x4699('0x4')]=function(){utils[_0x4699('0x2')](_0x4699('0x5'));};exports[_0x4699('0x6')]=function(){utils[_0x4699('0x2')](_0x4699('0x7'));};exports[_0x4699('0x8')]=function(_0x245bdf){utils[_0x4699('0x8')](_0x4699('0x9'),_0x245bdf);};exports[_0x4699('0xa')]=function(){utils[_0x4699('0x2')](_0x4699('0xb'));};exports['managerevent']=function(_0x4595c5){}; \ No newline at end of file +var _0x72bd=['./utils','connect','info','[core]\x20connected','[core]\x20shutdown','[core]\x20fullybooted','error','close'];(function(_0xcc0fa1,_0x1e72ec){var _0x55c148=function(_0x47aacf){while(--_0x47aacf){_0xcc0fa1['push'](_0xcc0fa1['shift']());}};_0x55c148(++_0x1e72ec);}(_0x72bd,0x130));var _0xd72b=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x72bd[_0x13b8f3];return _0x1a6d06;};'use strict';var utils=require(_0xd72b('0x0'));exports[_0xd72b('0x1')]=function(){utils[_0xd72b('0x2')](_0xd72b('0x3'));};exports['shutdown']=function(){utils[_0xd72b('0x2')](_0xd72b('0x4'));};exports['fullybooted']=function(){utils['info'](_0xd72b('0x5'));};exports['error']=function(_0x5bfd72){utils[_0xd72b('0x6')]('[core]\x20error',_0x5bfd72);};exports[_0xd72b('0x7')]=function(){utils[_0xd72b('0x2')]('[core]\x20close');};exports['managerevent']=function(_0x1424e1){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 3ec400b..ac7d3d8 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 _0x8232=['calleridnum','calleridname','cause-txt','complete','diffTime','holdtime','endtime','lodash','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','CreateVoiceDialReport','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','varset','debug','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','[%s][dials][dialend]','ANSWER','assign','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s'];(function(_0x1f3bd4,_0x38029f){var _0x41d3d0=function(_0x339ed9){while(--_0x339ed9){_0x1f3bd4['push'](_0x1f3bd4['shift']());}};_0x41d3d0(++_0x38029f);}(_0x8232,0x101));var _0x2823=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x8232[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x2823('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x267303){utils['info'](util[_0x2823('0x1')](_0x2823('0x2'),_0x267303[_0x2823('0x3')],_0x267303[_0x2823('0x4')],_0x267303[_0x2823('0x5')],_0x267303['calleridnum'],_0x267303[_0x2823('0x6')],_0x267303[_0x2823('0x7')]));utils['request'](_0x2823('0x8'),_0x267303);delete dials[_0x267303[_0x2823('0x3')]];}exports['newexten']=function(_0x206e97){try{utils['debug'](util[_0x2823('0x1')](_0x2823('0x9'),_0x206e97['uniqueid']),_0x206e97);utils[_0x2823('0xa')](util[_0x2823('0x1')](_0x2823('0xb'),_0x206e97[_0x2823('0x3')],_0x206e97[_0x2823('0xc')],_0x206e97['appdata']));if(_0x206e97[_0x2823('0xc')][_0x2823('0xd')]()==_0x2823('0xe')&&_[_0x2823('0xf')](_0x206e97[_0x2823('0x10')][_0x2823('0xd')](),_0x2823('0x11'))){var _0x57052e=_0x206e97[_0x2823('0x10')][_0x2823('0x12')]('=');dials[_0x206e97[_0x2823('0x3')]]={'routeId':_0x57052e[0x1]};}}catch(_0x24ff48){utils['error'](util[_0x2823('0x1')]('[%s][dials][newexten]',_0x206e97[_0x2823('0x3')]),_0x24ff48);}};exports[_0x2823('0x13')]=function(_0x998763){try{utils[_0x2823('0x14')](util[_0x2823('0x1')](_0x2823('0x15'),_0x998763[_0x2823('0x3')]),_0x998763);if(!_[_0x2823('0x16')](_0x998763[_0x2823('0x17')]['outboundrouteid'])){utils['info'](util['format'](_0x2823('0x18'),_0x998763[_0x2823('0x3')],_0x998763[_0x2823('0x19')]));dials[_0x998763[_0x2823('0x3')]]={'routeId':_0x998763[_0x2823('0x19')]};}}catch(_0x207111){utils['error'](util['format']('[%s][dials][varset]',_0x998763[_0x2823('0x3')]),_0x207111);}};exports[_0x2823('0x1a')]=function(_0x252398){try{if(!_['isNil'](dials[_0x252398['uniqueid']])){utils[_0x2823('0x14')](util['format'](_0x2823('0x1b'),_0x252398[_0x2823('0x3')]),_0x252398);dials[_0x252398[_0x2823('0x3')]]=_['assign'](dials[_0x252398[_0x2823('0x3')]],_0x252398);dials[_0x252398['uniqueid']][_0x2823('0x1c')]=utils[_0x2823('0x1d')]();dials[_0x252398[_0x2823('0x3')]]['lastevent']=_0x2823('0x1e');utils[_0x2823('0xa')](util[_0x2823('0x1')](_0x2823('0x1f'),_0x252398[_0x2823('0x3')],dials[_0x252398[_0x2823('0x3')]]['starttime']));}}catch(_0x24b987){utils[_0x2823('0x20')](util[_0x2823('0x1')]('[%s][dials][dialbegin]',_0x252398[_0x2823('0x3')]),_0x24b987);}};exports['dialend']=function(_0x34fd3f){try{if(!_[_0x2823('0x16')](dials[_0x34fd3f['uniqueid']])){utils['debug'](util['format'](_0x2823('0x21'),_0x34fd3f[_0x2823('0x3')]),_0x34fd3f);dials[_0x34fd3f['uniqueid']][_0x2823('0x7')]=_0x34fd3f['dialstatus'];if(_0x34fd3f[_0x2823('0x7')]==_0x2823('0x22')){dials[_0x34fd3f['uniqueid']]=_[_0x2823('0x23')](dials[_0x34fd3f[_0x2823('0x3')]],_0x34fd3f);dials[_0x34fd3f[_0x2823('0x3')]][_0x2823('0x24')]=utils[_0x2823('0x1d')]();dials[_0x34fd3f[_0x2823('0x3')]][_0x2823('0x25')]=_0x2823('0x26');utils[_0x2823('0xa')](util[_0x2823('0x1')](_0x2823('0x27'),_0x34fd3f[_0x2823('0x3')],_0x34fd3f[_0x2823('0x7')],dials[_0x34fd3f[_0x2823('0x3')]][_0x2823('0x24')]));}else{utils[_0x2823('0xa')](util[_0x2823('0x1')](_0x2823('0x28'),_0x34fd3f['uniqueid'],_0x34fd3f[_0x2823('0x7')]));}}}catch(_0x2f7f58){utils['error'](util[_0x2823('0x1')](_0x2823('0x21'),_0x34fd3f['uniqueid']),_0x2f7f58);}};exports['hangup']=function(_0x450765){try{if(!_[_0x2823('0x16')](dials[_0x450765['uniqueid']])){utils[_0x2823('0x14')](util['format'](_0x2823('0x29'),_0x450765[_0x2823('0x3')]),_0x450765);utils[_0x2823('0xa')](util['format'](_0x2823('0x2a'),_0x450765['uniqueid'],_0x450765[_0x2823('0x2b')],_0x450765[_0x2823('0x2c')],_0x450765[_0x2823('0x2d')]));dials[_0x450765[_0x2823('0x3')]]=_[_0x2823('0x23')](dials[_0x450765['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x2823('0x2e')});dials[_0x450765['uniqueid']]['duration']=utils[_0x2823('0x2f')](dials[_0x450765[_0x2823('0x3')]]['endtime'],dials[_0x450765[_0x2823('0x3')]][_0x2823('0x1c')]);dials[_0x450765[_0x2823('0x3')]][_0x2823('0x30')]=utils[_0x2823('0x2f')](dials[_0x450765[_0x2823('0x3')]]['answertime']||dials[_0x450765[_0x2823('0x3')]]['endtime'],dials[_0x450765[_0x2823('0x3')]][_0x2823('0x1c')]);dials[_0x450765[_0x2823('0x3')]]['billableseconds']=dials[_0x450765[_0x2823('0x3')]][_0x2823('0x24')]?utils[_0x2823('0x2f')](dials[_0x450765[_0x2823('0x3')]][_0x2823('0x31')],dials[_0x450765[_0x2823('0x3')]]['answertime']):0x0;writeDB(dials[_0x450765[_0x2823('0x3')]]);}}catch(_0x2ea67a){utils[_0x2823('0x20')](util[_0x2823('0x1')](_0x2823('0x29'),_0x450765[_0x2823('0x3')]),_0x2ea67a);}}; \ No newline at end of file +var _0x2b2c=['[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','dialstatus','ANSWER','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','endtime','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin'];(function(_0x1349e6,_0x26e9f1){var _0x3a69c6=function(_0x56175c){while(--_0x56175c){_0x1349e6['push'](_0x1349e6['shift']());}};_0x3a69c6(++_0x26e9f1);}(_0x2b2c,0xa9));var _0xc2b2=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2b2c[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xc2b2('0x0'));var util=require(_0xc2b2('0x1'));var utils=require(_0xc2b2('0x2'));var dials={};function writeDB(_0x1125d9){utils[_0xc2b2('0x3')](util[_0xc2b2('0x4')](_0xc2b2('0x5'),_0x1125d9['uniqueid'],_0x1125d9[_0xc2b2('0x6')],_0x1125d9[_0xc2b2('0x7')],_0x1125d9[_0xc2b2('0x8')],_0x1125d9[_0xc2b2('0x9')],_0x1125d9['dialstatus']));utils[_0xc2b2('0xa')](_0xc2b2('0xb'),_0x1125d9);delete dials[_0x1125d9['uniqueid']];}exports[_0xc2b2('0xc')]=function(_0x18adfc){try{utils[_0xc2b2('0xd')](util[_0xc2b2('0x4')](_0xc2b2('0xe'),_0x18adfc[_0xc2b2('0xf')]),_0x18adfc);utils[_0xc2b2('0x3')](util[_0xc2b2('0x4')](_0xc2b2('0x10'),_0x18adfc['uniqueid'],_0x18adfc['application'],_0x18adfc['appdata']));if(_0x18adfc[_0xc2b2('0x11')][_0xc2b2('0x12')]()==_0xc2b2('0x13')&&_[_0xc2b2('0x14')](_0x18adfc['appdata'][_0xc2b2('0x12')](),_0xc2b2('0x15'))){var _0x2c96f4=_0x18adfc['appdata'][_0xc2b2('0x16')]('=');dials[_0x18adfc[_0xc2b2('0xf')]]={'routeId':_0x2c96f4[0x1]};}}catch(_0x297b26){utils[_0xc2b2('0x17')](util[_0xc2b2('0x4')](_0xc2b2('0xe'),_0x18adfc[_0xc2b2('0xf')]),_0x297b26);}};exports[_0xc2b2('0x18')]=function(_0x125989){try{utils[_0xc2b2('0xd')](util[_0xc2b2('0x4')](_0xc2b2('0x19'),_0x125989[_0xc2b2('0xf')]),_0x125989);if(!_[_0xc2b2('0x1a')](_0x125989[_0xc2b2('0x1b')][_0xc2b2('0x1c')])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x125989['uniqueid'],_0x125989[_0xc2b2('0x1d')]));dials[_0x125989[_0xc2b2('0xf')]]={'routeId':_0x125989['value']};}}catch(_0x249b8b){utils['error'](util[_0xc2b2('0x4')](_0xc2b2('0x19'),_0x125989[_0xc2b2('0xf')]),_0x249b8b);}};exports[_0xc2b2('0x1e')]=function(_0xf56b71){try{if(!_[_0xc2b2('0x1a')](dials[_0xf56b71[_0xc2b2('0xf')]])){utils[_0xc2b2('0xd')](util[_0xc2b2('0x4')](_0xc2b2('0x1f'),_0xf56b71[_0xc2b2('0xf')]),_0xf56b71);dials[_0xf56b71[_0xc2b2('0xf')]]=_[_0xc2b2('0x20')](dials[_0xf56b71[_0xc2b2('0xf')]],_0xf56b71);dials[_0xf56b71[_0xc2b2('0xf')]][_0xc2b2('0x21')]=utils[_0xc2b2('0x22')]();dials[_0xf56b71[_0xc2b2('0xf')]][_0xc2b2('0x23')]=_0xc2b2('0x24');utils[_0xc2b2('0x3')](util[_0xc2b2('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0xf56b71[_0xc2b2('0xf')],dials[_0xf56b71['uniqueid']][_0xc2b2('0x21')]));}}catch(_0x515921){utils[_0xc2b2('0x17')](util['format'](_0xc2b2('0x1f'),_0xf56b71[_0xc2b2('0xf')]),_0x515921);}};exports[_0xc2b2('0x25')]=function(_0x547cfa){try{if(!_['isNil'](dials[_0x547cfa[_0xc2b2('0xf')]])){utils[_0xc2b2('0xd')](util['format']('[%s][dials][dialend]',_0x547cfa[_0xc2b2('0xf')]),_0x547cfa);dials[_0x547cfa[_0xc2b2('0xf')]][_0xc2b2('0x26')]=_0x547cfa[_0xc2b2('0x26')];if(_0x547cfa[_0xc2b2('0x26')]==_0xc2b2('0x27')){dials[_0x547cfa[_0xc2b2('0xf')]]=_[_0xc2b2('0x20')](dials[_0x547cfa[_0xc2b2('0xf')]],_0x547cfa);dials[_0x547cfa[_0xc2b2('0xf')]]['answertime']=utils['now']();dials[_0x547cfa[_0xc2b2('0xf')]][_0xc2b2('0x23')]=_0xc2b2('0x28');utils['info'](util[_0xc2b2('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x547cfa[_0xc2b2('0xf')],_0x547cfa['dialstatus'],dials[_0x547cfa[_0xc2b2('0xf')]][_0xc2b2('0x29')]));}else{utils[_0xc2b2('0x3')](util['format'](_0xc2b2('0x2a'),_0x547cfa[_0xc2b2('0xf')],_0x547cfa['dialstatus']));}}}catch(_0x15c34f){utils['error'](util[_0xc2b2('0x4')](_0xc2b2('0x2b'),_0x547cfa[_0xc2b2('0xf')]),_0x15c34f);}};exports[_0xc2b2('0x2c')]=function(_0x511456){try{if(!_[_0xc2b2('0x1a')](dials[_0x511456[_0xc2b2('0xf')]])){utils[_0xc2b2('0xd')](util[_0xc2b2('0x4')]('[%s][dials][hangup]',_0x511456[_0xc2b2('0xf')]),_0x511456);utils[_0xc2b2('0x3')](util['format'](_0xc2b2('0x2d'),_0x511456[_0xc2b2('0xf')],_0x511456[_0xc2b2('0x8')],_0x511456['calleridname'],_0x511456[_0xc2b2('0x2e')]));dials[_0x511456['uniqueid']]=_['assign'](dials[_0x511456['uniqueid']],{'endtime':utils[_0xc2b2('0x22')](),'lastevent':'complete'});dials[_0x511456[_0xc2b2('0xf')]][_0xc2b2('0x2f')]=utils['diffTime'](dials[_0x511456['uniqueid']]['endtime'],dials[_0x511456[_0xc2b2('0xf')]][_0xc2b2('0x21')]);dials[_0x511456[_0xc2b2('0xf')]]['holdtime']=utils['diffTime'](dials[_0x511456[_0xc2b2('0xf')]][_0xc2b2('0x29')]||dials[_0x511456[_0xc2b2('0xf')]]['endtime'],dials[_0x511456['uniqueid']]['starttime']);dials[_0x511456[_0xc2b2('0xf')]]['billableseconds']=dials[_0x511456[_0xc2b2('0xf')]][_0xc2b2('0x29')]?utils['diffTime'](dials[_0x511456[_0xc2b2('0xf')]][_0xc2b2('0x30')],dials[_0x511456[_0xc2b2('0xf')]][_0xc2b2('0x29')]):0x0;writeDB(dials[_0x511456[_0xc2b2('0xf')]]);}}catch(_0x1aa71c){utils['error'](util[_0xc2b2('0x4')](_0xc2b2('0x31'),_0x511456[_0xc2b2('0xf')]),_0x1aa71c);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b8b9e72..3d628cd 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 _0x5fb1=['[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','env','production','local','asterisk','port','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','debug','[%s][index][devicestatechange]','device','devicestatechange','error','format','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr'];(function(_0x45d847,_0x1ebde2){var _0x280e2f=function(_0x4cd077){while(--_0x4cd077){_0x45d847['push'](_0x45d847['shift']());}};_0x280e2f(++_0x1ebde2);}(_0x5fb1,0x1bb));var _0x15fb=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x5fb1[_0x50007c];return _0x5c1ec7;};var AsteriskManager=require(_0x15fb('0x0'));var config=require(_0x15fb('0x1'));var utils=require(_0x15fb('0x2'));var util=require('util');var isXDREnabled=config['xdr']&&config[_0x15fb('0x3')]['disabled']?!config[_0x15fb('0x3')]['disabled']:!![];var isProduction=config[_0x15fb('0x4')]===_0x15fb('0x5')||![];var isLocalAsterisk=config[_0x15fb('0x3')]&&config[_0x15fb('0x3')][_0x15fb('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x15fb('0x7')][_0x15fb('0x8')],config['asterisk']['ip'],config[_0x15fb('0x7')][_0x15fb('0x9')],config['asterisk'][_0x15fb('0xa')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x15fb('0xb')](_0x15fb('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x15fb('0xb')](_0x15fb('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0x15fb('0xe'));var queues=require(_0x15fb('0xf'));var recordings=require(_0x15fb('0x10'));var members=require('./members.controller');var dials=require(_0x15fb('0x11'));var transfers=require('./transfers.controller');var core=require(_0x15fb('0x12'));ami['on']('connect',core[_0x15fb('0x13')]);ami['on'](_0x15fb('0x14'),core[_0x15fb('0x14')]);ami['on'](_0x15fb('0x15'),core['fullybooted']);ami['on']('error',core['error']);ami['on'](_0x15fb('0x16'),core[_0x15fb('0x16')]);ami['on'](_0x15fb('0x17'),core[_0x15fb('0x17')]);ami['on']('devicestatechange',function(_0x13b9a4){try{utils[_0x15fb('0x18')](util['format'](_0x15fb('0x19'),_0x13b9a4[_0x15fb('0x1a')]),_0x13b9a4);members[_0x15fb('0x1b')](_0x13b9a4);}catch(_0x245c4d){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')](_0x15fb('0x19'),_0x13b9a4[_0x15fb('0x1a')]),_0x245c4d);}});ami['on'](_0x15fb('0x1e'),function(_0x2f94a0){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')](_0x15fb('0x1f'),_0x2f94a0[_0x15fb('0x20')]),_0x2f94a0);agents['agentcalled'](_0x2f94a0);}catch(_0x2563aa){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')]('[%s][index][agentcalled]',_0x2f94a0[_0x15fb('0x20')]),_0x2563aa);}});ami['on']('agentringnoanswer',function(_0x547ee6){try{utils['debug'](util[_0x15fb('0x1d')](_0x15fb('0x21'),_0x547ee6[_0x15fb('0x20')]),_0x547ee6);agents[_0x15fb('0x22')](_0x547ee6);}catch(_0xc9b3a8){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')]('[%s][index][agentringnoanswer]',_0x547ee6[_0x15fb('0x20')]),_0xc9b3a8);}});ami['on'](_0x15fb('0x23'),function(_0x43f087){try{utils['debug'](util['format'](_0x15fb('0x24'),_0x43f087['uniqueid']),_0x43f087);agents[_0x15fb('0x23')](_0x43f087);queues[_0x15fb('0x23')](_0x43f087);}catch(_0x12f02f){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')](_0x15fb('0x24'),_0x43f087[_0x15fb('0x20')]),_0x12f02f);}});ami['on'](_0x15fb('0x25'),function(_0x19d7c1){try{utils[_0x15fb('0x18')](util['format'](_0x15fb('0x26'),_0x19d7c1[_0x15fb('0x20')]),_0x19d7c1);agents[_0x15fb('0x25')](_0x19d7c1);queues[_0x15fb('0x25')](_0x19d7c1);members[_0x15fb('0x25')](_0x19d7c1);}catch(_0xcf2bc8){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')](_0x15fb('0x26'),_0x19d7c1['uniqueid']),_0xcf2bc8);}});ami['on'](_0x15fb('0x27'),function(_0x1e6eaa){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')]('[%s][index][queuecallerabandon]',_0x1e6eaa[_0x15fb('0x20')]),_0x1e6eaa);agents[_0x15fb('0x27')](_0x1e6eaa);queues[_0x15fb('0x27')](_0x1e6eaa);}catch(_0x2b2de7){utils[_0x15fb('0x1c')](util['format'](_0x15fb('0x28'),_0x1e6eaa[_0x15fb('0x20')]),_0x2b2de7);}});ami['on'](_0x15fb('0x29'),function(_0x5a5383){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')](_0x15fb('0x2a'),_0x5a5383[_0x15fb('0x20')]),_0x5a5383);queues[_0x15fb('0x29')](_0x5a5383);recordings[_0x15fb('0x29')](_0x5a5383);}catch(_0x31e397){utils[_0x15fb('0x1c')](util['format'](_0x15fb('0x2a'),_0x5a5383['uniqueid']),_0x31e397);}});ami['on'](_0x15fb('0x2b'),function(_0x2f21e0){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')]('[%s][index][queuecallerleave]',_0x2f21e0[_0x15fb('0x20')]),_0x2f21e0);queues[_0x15fb('0x2b')](_0x2f21e0);}catch(_0x5a8ddc){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')](_0x15fb('0x2c'),_0x2f21e0[_0x15fb('0x20')]),_0x5a8ddc);}});ami['on'](_0x15fb('0x2d'),function(_0x54031c){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')](_0x15fb('0x2e'),_0x54031c[_0x15fb('0x20')]),_0x54031c);queues['musiconholdstart'](_0x54031c);calls['musiconholdstart'](_0x54031c);}catch(_0xc28b00){utils[_0x15fb('0x1c')](util['format']('[%s][index][musiconholdstart]',_0x54031c['uniqueid']),_0xc28b00);}});ami['on'](_0x15fb('0x2f'),function(_0x3e4623){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')](_0x15fb('0x30'),_0x3e4623[_0x15fb('0x20')]),_0x3e4623);queues[_0x15fb('0x2f')](_0x3e4623);calls[_0x15fb('0x2f')](_0x3e4623);}catch(_0x4b2f67){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')](_0x15fb('0x30'),_0x3e4623[_0x15fb('0x20')]),_0x4b2f67);}});ami['on'](_0x15fb('0x31'),function(_0x46faae){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')](_0x15fb('0x32'),_0x46faae['uniqueid']),_0x46faae);calls['newstate'](_0x46faae);recordings[_0x15fb('0x31')](_0x46faae);}catch(_0x482434){utils[_0x15fb('0x1c')](util['format'](_0x15fb('0x32'),_0x46faae[_0x15fb('0x20')]),_0x482434);}});ami['on']('hangup',function(_0xd169d9){try{utils[_0x15fb('0x18')](util['format'](_0x15fb('0x33'),_0xd169d9[_0x15fb('0x20')]),_0xd169d9);calls[_0x15fb('0x34')](_0xd169d9);recordings[_0x15fb('0x34')](_0xd169d9);dials[_0x15fb('0x34')](_0xd169d9);agents['hangup'](_0xd169d9);queues[_0x15fb('0x34')](_0xd169d9);}catch(_0x28ed68){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')]('[%s][index][hangup]',_0xd169d9[_0x15fb('0x20')]),_0x28ed68);}});ami['on'](_0x15fb('0x35'),function(_0x2aa3c2){try{utils[_0x15fb('0x18')](util['format'](_0x15fb('0x36'),_0x2aa3c2['uniqueid']),_0x2aa3c2);members['cdr'](_0x2aa3c2);}catch(_0x46de4b){utils['error'](util['format'](_0x15fb('0x36'),_0x2aa3c2['uniqueid']),_0x46de4b);}});ami['on']('blindtransfer',function(_0x4d172a){try{utils['debug'](util['format'](_0x15fb('0x37'),_0x4d172a[_0x15fb('0x20')]),_0x4d172a);queues[_0x15fb('0x38')](_0x4d172a);agents[_0x15fb('0x38')](_0x4d172a);transfers[_0x15fb('0x38')](_0x4d172a);recordings[_0x15fb('0x38')](_0x4d172a);}catch(_0x141366){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')](_0x15fb('0x37'),_0x4d172a[_0x15fb('0x20')]),_0x141366);}});ami['on'](_0x15fb('0x39'),function(_0x2043ed){try{utils['debug'](util[_0x15fb('0x1d')](_0x15fb('0x3a'),_0x2043ed['origtransfereruniqueid']),_0x2043ed);queues[_0x15fb('0x39')](_0x2043ed);transfers['attendedtransfer'](_0x2043ed);agents[_0x15fb('0x39')](_0x2043ed);calls[_0x15fb('0x39')](_0x2043ed);}catch(_0x2a0bb1){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')]('[%s][index][attendedtransfer]',_0x2043ed[_0x15fb('0x3b')]),_0x2a0bb1);}});ami['on'](_0x15fb('0x3c'),function(_0x5b0b4b){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')](_0x15fb('0x3d'),_0x5b0b4b[_0x15fb('0x20')]),_0x5b0b4b);queues['varset'](_0x5b0b4b);recordings['varset'](_0x5b0b4b);calls[_0x15fb('0x3c')](_0x5b0b4b);dials[_0x15fb('0x3c')](_0x5b0b4b);}catch(_0x3a0282){utils['error'](util[_0x15fb('0x1d')](_0x15fb('0x3d'),_0x5b0b4b['uniqueid']),_0x3a0282);}});ami['on'](_0x15fb('0x3e'),function(_0x1941a4){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')]('[%s][index][newexten]',_0x1941a4[_0x15fb('0x20')]),_0x1941a4);calls[_0x15fb('0x3e')](_0x1941a4);recordings['newexten'](_0x1941a4);dials[_0x15fb('0x3e')](_0x1941a4);}catch(_0x3ad981){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')](_0x15fb('0x3f'),_0x1941a4['uniqueid']),_0x3ad981);}});ami['on']('newchannel',function(_0x132d21){try{utils[_0x15fb('0x18')](util['format'](_0x15fb('0x40'),_0x132d21[_0x15fb('0x20')]),_0x132d21);calls[_0x15fb('0x41')](_0x132d21);recordings[_0x15fb('0x41')](_0x132d21);}catch(_0x59de84){utils[_0x15fb('0x1c')](util[_0x15fb('0x1d')]('[%s][index][newchannel]',_0x132d21[_0x15fb('0x20')]),_0x59de84);}});ami['on'](_0x15fb('0x42'),function(_0x36b033){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')](_0x15fb('0x43'),_0x36b033[_0x15fb('0x20')]),_0x36b033);dials[_0x15fb('0x42')](_0x36b033);}catch(_0xdf20a5){utils['error'](util[_0x15fb('0x1d')](_0x15fb('0x44'),_0x36b033[_0x15fb('0x20')]),_0xdf20a5);}});ami['on'](_0x15fb('0x45'),function(_0x2d7571){try{utils[_0x15fb('0x18')](util[_0x15fb('0x1d')](_0x15fb('0x46'),_0x2d7571[_0x15fb('0x20')]),_0x2d7571);dials[_0x15fb('0x45')](_0x2d7571);}catch(_0x147b16){utils['error'](util[_0x15fb('0x1d')](_0x15fb('0x46'),_0x2d7571[_0x15fb('0x20')]),_0x147b16);}});} \ No newline at end of file +var _0x3abd=['../../config/environment','./utils','xdr','env','local','port','asterisk','keepConnected','XDR\x20DISABLED','info','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','error','agentcalled','format','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s][index][dialend]'];(function(_0x58545e,_0x3199fd){var _0x44b9db=function(_0x4f6baf){while(--_0x4f6baf){_0x58545e['push'](_0x58545e['shift']());}};_0x44b9db(++_0x3199fd);}(_0x3abd,0x14f));var _0xd3ab=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x3abd[_0x166742];return _0xb7814a;};var AsteriskManager=require('asterisk-manager');var config=require(_0xd3ab('0x0'));var utils=require(_0xd3ab('0x1'));var util=require('util');var isXDREnabled=config[_0xd3ab('0x2')]&&config['xdr']['disabled']?!config[_0xd3ab('0x2')]['disabled']:!![];var isProduction=config[_0xd3ab('0x3')]==='production'||![];var isLocalAsterisk=config['xdr']&&config[_0xd3ab('0x2')][_0xd3ab('0x4')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xd3ab('0x5')],config[_0xd3ab('0x6')]['ip'],config[_0xd3ab('0x6')]['username'],config[_0xd3ab('0x6')]['password'],!![]);ami[_0xd3ab('0x7')]();if(!isXDREnabled){utils['info'](_0xd3ab('0x8'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xd3ab('0x9')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xd3ab('0xa'));var calls=require('./calls.controller');var queues=require(_0xd3ab('0xb'));var recordings=require(_0xd3ab('0xc'));var members=require(_0xd3ab('0xd'));var dials=require(_0xd3ab('0xe'));var transfers=require(_0xd3ab('0xf'));var core=require(_0xd3ab('0x10'));ami['on']('connect',core[_0xd3ab('0x11')]);ami['on'](_0xd3ab('0x12'),core['shutdown']);ami['on'](_0xd3ab('0x13'),core[_0xd3ab('0x13')]);ami['on']('error',core['error']);ami['on'](_0xd3ab('0x14'),core[_0xd3ab('0x14')]);ami['on'](_0xd3ab('0x15'),core[_0xd3ab('0x15')]);ami['on'](_0xd3ab('0x16'),function(_0x3587ea){try{utils[_0xd3ab('0x17')](util['format'](_0xd3ab('0x18'),_0x3587ea[_0xd3ab('0x19')]),_0x3587ea);members[_0xd3ab('0x16')](_0x3587ea);}catch(_0x302994){utils[_0xd3ab('0x1a')](util['format'](_0xd3ab('0x18'),_0x3587ea[_0xd3ab('0x19')]),_0x302994);}});ami['on'](_0xd3ab('0x1b'),function(_0x78d89e){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')]('[%s][index][agentcalled]',_0x78d89e[_0xd3ab('0x1d')]),_0x78d89e);agents[_0xd3ab('0x1b')](_0x78d89e);}catch(_0x27a4f8){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x1e'),_0x78d89e['uniqueid']),_0x27a4f8);}});ami['on'](_0xd3ab('0x1f'),function(_0x4b3872){try{utils[_0xd3ab('0x17')](util['format'](_0xd3ab('0x20'),_0x4b3872['uniqueid']),_0x4b3872);agents[_0xd3ab('0x1f')](_0x4b3872);}catch(_0x4c086a){utils['error'](util['format'](_0xd3ab('0x20'),_0x4b3872[_0xd3ab('0x1d')]),_0x4c086a);}});ami['on'](_0xd3ab('0x21'),function(_0xd27297){try{utils['debug'](util[_0xd3ab('0x1c')](_0xd3ab('0x22'),_0xd27297['uniqueid']),_0xd27297);agents[_0xd3ab('0x21')](_0xd27297);queues[_0xd3ab('0x21')](_0xd27297);}catch(_0x561a25){utils['error'](util[_0xd3ab('0x1c')](_0xd3ab('0x22'),_0xd27297[_0xd3ab('0x1d')]),_0x561a25);}});ami['on'](_0xd3ab('0x23'),function(_0x25f6ae){try{utils['debug'](util['format']('[%s][index][agentcomplete]',_0x25f6ae['uniqueid']),_0x25f6ae);agents[_0xd3ab('0x23')](_0x25f6ae);queues[_0xd3ab('0x23')](_0x25f6ae);members[_0xd3ab('0x23')](_0x25f6ae);}catch(_0x1cb8ad){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x24'),_0x25f6ae[_0xd3ab('0x1d')]),_0x1cb8ad);}});ami['on'](_0xd3ab('0x25'),function(_0x1156ed){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')](_0xd3ab('0x26'),_0x1156ed['uniqueid']),_0x1156ed);agents['queuecallerabandon'](_0x1156ed);queues[_0xd3ab('0x25')](_0x1156ed);}catch(_0x3323ff){utils[_0xd3ab('0x1a')](util['format'](_0xd3ab('0x26'),_0x1156ed[_0xd3ab('0x1d')]),_0x3323ff);}});ami['on'](_0xd3ab('0x27'),function(_0xa2adfb){try{utils['debug'](util[_0xd3ab('0x1c')](_0xd3ab('0x28'),_0xa2adfb[_0xd3ab('0x1d')]),_0xa2adfb);queues['queuecallerjoin'](_0xa2adfb);recordings['queuecallerjoin'](_0xa2adfb);}catch(_0x53ebc8){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x28'),_0xa2adfb[_0xd3ab('0x1d')]),_0x53ebc8);}});ami['on'](_0xd3ab('0x29'),function(_0x2b7a67){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')](_0xd3ab('0x2a'),_0x2b7a67[_0xd3ab('0x1d')]),_0x2b7a67);queues[_0xd3ab('0x29')](_0x2b7a67);}catch(_0x5e5164){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x2a'),_0x2b7a67['uniqueid']),_0x5e5164);}});ami['on'](_0xd3ab('0x2b'),function(_0x254f2d){try{utils[_0xd3ab('0x17')](util['format']('[%s][index][musiconholdstart]',_0x254f2d[_0xd3ab('0x1d')]),_0x254f2d);queues['musiconholdstart'](_0x254f2d);calls[_0xd3ab('0x2b')](_0x254f2d);}catch(_0xc2afff){utils[_0xd3ab('0x1a')](util['format'](_0xd3ab('0x2c'),_0x254f2d['uniqueid']),_0xc2afff);}});ami['on'](_0xd3ab('0x2d'),function(_0x33f223){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')](_0xd3ab('0x2e'),_0x33f223[_0xd3ab('0x1d')]),_0x33f223);queues['musiconholdstop'](_0x33f223);calls[_0xd3ab('0x2d')](_0x33f223);}catch(_0x4154e1){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x2e'),_0x33f223['uniqueid']),_0x4154e1);}});ami['on'](_0xd3ab('0x2f'),function(_0x22e8ab){try{utils['debug'](util['format'](_0xd3ab('0x30'),_0x22e8ab[_0xd3ab('0x1d')]),_0x22e8ab);calls[_0xd3ab('0x2f')](_0x22e8ab);recordings['newstate'](_0x22e8ab);}catch(_0x26102e){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')]('[%s][index][newstate]',_0x22e8ab['uniqueid']),_0x26102e);}});ami['on'](_0xd3ab('0x31'),function(_0x478645){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')](_0xd3ab('0x32'),_0x478645[_0xd3ab('0x1d')]),_0x478645);calls['hangup'](_0x478645);recordings[_0xd3ab('0x31')](_0x478645);dials['hangup'](_0x478645);agents[_0xd3ab('0x31')](_0x478645);queues[_0xd3ab('0x31')](_0x478645);}catch(_0x1ffd16){utils['error'](util[_0xd3ab('0x1c')](_0xd3ab('0x32'),_0x478645['uniqueid']),_0x1ffd16);}});ami['on'](_0xd3ab('0x33'),function(_0x2e6cfe){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')](_0xd3ab('0x34'),_0x2e6cfe['uniqueid']),_0x2e6cfe);members[_0xd3ab('0x33')](_0x2e6cfe);}catch(_0x436ab7){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x34'),_0x2e6cfe['uniqueid']),_0x436ab7);}});ami['on']('blindtransfer',function(_0x4dac68){try{utils[_0xd3ab('0x17')](util['format'](_0xd3ab('0x35'),_0x4dac68[_0xd3ab('0x1d')]),_0x4dac68);queues['blindtransfer'](_0x4dac68);agents[_0xd3ab('0x36')](_0x4dac68);transfers['blindtransfer'](_0x4dac68);recordings[_0xd3ab('0x36')](_0x4dac68);}catch(_0x35e15c){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x35'),_0x4dac68[_0xd3ab('0x1d')]),_0x35e15c);}});ami['on'](_0xd3ab('0x37'),function(_0x209bdd){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')]('[%s][index][attendedtransfer]',_0x209bdd['origtransfereruniqueid']),_0x209bdd);queues['attendedtransfer'](_0x209bdd);transfers[_0xd3ab('0x37')](_0x209bdd);agents[_0xd3ab('0x37')](_0x209bdd);calls['attendedtransfer'](_0x209bdd);}catch(_0x58d421){utils['error'](util['format'](_0xd3ab('0x38'),_0x209bdd[_0xd3ab('0x39')]),_0x58d421);}});ami['on'](_0xd3ab('0x3a'),function(_0xe0758d){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')](_0xd3ab('0x3b'),_0xe0758d[_0xd3ab('0x1d')]),_0xe0758d);queues[_0xd3ab('0x3a')](_0xe0758d);recordings[_0xd3ab('0x3a')](_0xe0758d);calls[_0xd3ab('0x3a')](_0xe0758d);dials['varset'](_0xe0758d);}catch(_0x813b54){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x3b'),_0xe0758d['uniqueid']),_0x813b54);}});ami['on'](_0xd3ab('0x3c'),function(_0x1dfdf2){try{utils[_0xd3ab('0x17')](util[_0xd3ab('0x1c')](_0xd3ab('0x3d'),_0x1dfdf2[_0xd3ab('0x1d')]),_0x1dfdf2);calls[_0xd3ab('0x3c')](_0x1dfdf2);recordings[_0xd3ab('0x3c')](_0x1dfdf2);dials['newexten'](_0x1dfdf2);}catch(_0x50d94a){utils[_0xd3ab('0x1a')](util['format'](_0xd3ab('0x3d'),_0x1dfdf2[_0xd3ab('0x1d')]),_0x50d94a);}});ami['on'](_0xd3ab('0x3e'),function(_0x1b586f){try{utils[_0xd3ab('0x17')](util['format']('[%s][index][newchannel]',_0x1b586f[_0xd3ab('0x1d')]),_0x1b586f);calls[_0xd3ab('0x3e')](_0x1b586f);recordings[_0xd3ab('0x3e')](_0x1b586f);}catch(_0x1120d8){utils[_0xd3ab('0x1a')](util[_0xd3ab('0x1c')](_0xd3ab('0x3f'),_0x1b586f[_0xd3ab('0x1d')]),_0x1120d8);}});ami['on']('dialbegin',function(_0x2cf4cd){try{utils['debug'](util['format'](_0xd3ab('0x40'),_0x2cf4cd[_0xd3ab('0x1d')]),_0x2cf4cd);dials[_0xd3ab('0x41')](_0x2cf4cd);}catch(_0x441ee9){utils['error'](util['format']('[%s]dialbegin',_0x2cf4cd[_0xd3ab('0x1d')]),_0x441ee9);}});ami['on']('dialend',function(_0x4e0a13){try{utils['debug'](util['format'](_0xd3ab('0x42'),_0x4e0a13[_0xd3ab('0x1d')]),_0x4e0a13);dials['dialend'](_0x4e0a13);}catch(_0xca4127){utils['error'](util[_0xd3ab('0x1c')](_0xd3ab('0x42'),_0x4e0a13[_0xd3ab('0x1d')]),_0xca4127);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 0699c0b..22c8670 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 _0x8248=['util','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','CreateMemberReport','then','internal','request','catch','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','debug','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','split','isNil','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x8248,0x67));var _0x8824=function(_0x4fc593,_0x34a317){_0x4fc593=_0x4fc593-0x0;var _0x262e7c=_0x8248[_0x4fc593];return _0x262e7c;};'use strict';var _=require(_0x8824('0x0'));var util=require(_0x8824('0x1'));var utils=require('./utils');var members={};var exclude=[_0x8824('0x2'),'Queue:'];function writeDB(_0x43abd1){utils[_0x8824('0x3')](util['format'](_0x8824('0x4'),_0x43abd1[_0x8824('0x5')],_0x43abd1[_0x8824('0x6')],_0x43abd1[_0x8824('0x7')],_0x43abd1[_0x8824('0x8')],_0x43abd1[_0x8824('0x9')],_0x43abd1[_0x8824('0xa')]));if(_0x43abd1[_0x8824('0x6')]){utils[_0x8824('0xb')](_0x43abd1[_0x8824('0x6')])['then'](function(_0x3ef58c){if(_0x3ef58c){_0x43abd1[_0x8824('0x9')]=_0x3ef58c[_0x8824('0xc')];_0x43abd1['internal']=_0x3ef58c['internal'];utils['request'](_0x8824('0xd'),_0x43abd1);}else{utils['getUserByName'](_0x43abd1['interface']['split']('/')[0x1])[_0x8824('0xe')](function(_0xd42ff){if(_0xd42ff){_0x43abd1[_0x8824('0x9')]=_0xd42ff['name'];_0x43abd1[_0x8824('0xf')]=_0xd42ff['internal'];utils[_0x8824('0x10')]('CreateMemberReport',_0x43abd1);}});}})[_0x8824('0x11')](function(_0x38b8c6){utils[_0x8824('0x12')](util[_0x8824('0x13')](_0x8824('0x14'),_0x43abd1[_0x8824('0x5')]),_0x38b8c6);});}delete members[_0x43abd1[_0x8824('0x6')]];}function startsWith(_0x2b2fc9,_0xf048cb){return _[_0x8824('0x15')](_0x2b2fc9,function(_0x367ffe){return _[_0x8824('0x16')](_0xf048cb,_0x367ffe);});}exports[_0x8824('0x17')]=function(_0x21ebd4){try{utils['debug'](util[_0x8824('0x13')]('[%s][members][devicestatechange]',members[_0x21ebd4['device']]?members[_0x21ebd4[_0x8824('0x18')]][_0x8824('0x5')]:_0x21ebd4[_0x8824('0x18')]),_0x21ebd4);utils[_0x8824('0x3')](util['format'](_0x8824('0x19'),members[_0x21ebd4['device']]?members[_0x21ebd4[_0x8824('0x18')]]['uniqueid']:_0x21ebd4[_0x8824('0x18')],_0x21ebd4[_0x8824('0x1a')],_0x21ebd4[_0x8824('0x18')]));switch(_0x21ebd4[_0x8824('0x1a')]){case _0x8824('0x1b'):case _0x8824('0x1c'):if(!startsWith(exclude,_0x21ebd4[_0x8824('0x18')])){members[_0x21ebd4['device']]={'channel':_0x8824('0x1d'),'interface':_0x21ebd4[_0x8824('0x18')],'type':_0x8824('0x1e'),'enterAt':utils[_0x8824('0x1f')](),'role':'agent'};}break;case _0x8824('0x20'):if(!_['isNil'](members[_0x21ebd4['device']])){members[_0x21ebd4[_0x8824('0x18')]][_0x8824('0x21')]=utils[_0x8824('0x1f')]();members[_0x21ebd4['device']][_0x8824('0x22')]=utils[_0x8824('0x23')](members[_0x21ebd4[_0x8824('0x18')]][_0x8824('0x21')],members[_0x21ebd4['device']][_0x8824('0x24')]);if(members[_0x21ebd4[_0x8824('0x18')]][_0x8824('0x5')]){writeDB(members[_0x21ebd4[_0x8824('0x18')]]);}}break;default:break;}}catch(_0x181562){utils[_0x8824('0x12')](util[_0x8824('0x13')](_0x8824('0x25'),members[_0x21ebd4[_0x8824('0x18')]]?members[_0x21ebd4[_0x8824('0x18')]]['uniqueid']:_0x21ebd4[_0x8824('0x18')]),_0x181562);}};exports['agentcomplete']=function(_0x48a178){try{if(!_['isNil'](members[_0x48a178[_0x8824('0x6')]])){utils[_0x8824('0x26')](util[_0x8824('0x13')](_0x8824('0x27'),_0x48a178[_0x8824('0x5')]),_0x48a178);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x48a178['uniqueid'],_0x48a178['interface'],_0x48a178[_0x8824('0x28')]));members[_0x48a178['interface']]=_[_0x8824('0x29')](members[_0x48a178[_0x8824('0x6')]],{'data4':_0x48a178[_0x8824('0x28')],'uniqueid':_0x48a178['uniqueid']});}}catch(_0x51cf4e){utils[_0x8824('0x12')](util[_0x8824('0x13')](_0x8824('0x27'),_0x48a178['uniqueid']),_0x51cf4e);}};exports[_0x8824('0x2a')]=function(_0x329072){try{utils['debug'](util[_0x8824('0x13')](_0x8824('0x2b'),_0x329072[_0x8824('0x5')]),_0x329072);if(_0x329072[_0x8824('0x7')]){var _0xc6cb29=_0x329072['channel'][_0x8824('0x2c')]('-')[0x0];if(!_[_0x8824('0x2d')](members[_0xc6cb29])){members[_0xc6cb29]=_[_0x8824('0x29')](members[_0xc6cb29],{'data1':members[_0xc6cb29][_0x8824('0x2e')]||_0x329072[_0x8824('0xa')],'data2':members[_0xc6cb29]['data2']||_0x329072[_0x8824('0x2f')],'data3':members[_0xc6cb29][_0x8824('0x30')]||_0x329072[_0x8824('0x31')],'uniqueid':members[_0xc6cb29][_0x8824('0x5')]||_0x329072[_0x8824('0x5')]});utils[_0x8824('0x3')](util[_0x8824('0x13')](_0x8824('0x32'),_0x329072[_0x8824('0x5')],members[_0xc6cb29][_0x8824('0x2e')],members[_0xc6cb29][_0x8824('0x8')],members[_0xc6cb29]['data3']));if(members[_0xc6cb29][_0x8824('0x21')]){writeDB(members[_0xc6cb29]);}}}if(_0x329072[_0x8824('0x33')]){var _0x3c7646=_0x329072[_0x8824('0x33')][_0x8824('0x2c')]('-')[0x0];if(!_['isNil'](members[_0x3c7646])){members[_0x3c7646]=_[_0x8824('0x29')](members[_0x3c7646],{'data1':members[_0x3c7646][_0x8824('0x2e')]||_0x329072['type'],'data2':members[_0x3c7646][_0x8824('0x8')]||_0x329072[_0x8824('0x2f')],'data3':members[_0x3c7646][_0x8824('0x30')]||_0x329072[_0x8824('0x31')],'uniqueid':members[_0x3c7646][_0x8824('0x5')]||_0x329072[_0x8824('0x5')]});utils[_0x8824('0x3')](util[_0x8824('0x13')](_0x8824('0x32'),_0x329072[_0x8824('0x5')],members[_0x3c7646][_0x8824('0x2e')],members[_0x3c7646][_0x8824('0x8')],members[_0x3c7646][_0x8824('0x30')]));if(members[_0x3c7646]['exitAt']){writeDB(members[_0x3c7646]);}}}}catch(_0x17d7d1){utils[_0x8824('0x12')](util[_0x8824('0x13')](_0x8824('0x2b'),_0x329072[_0x8824('0x5')]),_0x17d7d1);}}; \ No newline at end of file +var _0x5562=['some','startsWith','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','now','duration','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','split','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','type','interface','getUserByInterface','membername','name','internal','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x5562,0x8b));var _0x2556=function(_0x26641c,_0x1ba2a5){_0x26641c=_0x26641c-0x0;var _0x42c01a=_0x5562[_0x26641c];return _0x42c01a;};'use strict';var _=require(_0x2556('0x0'));var util=require(_0x2556('0x1'));var utils=require(_0x2556('0x2'));var members={};var exclude=[_0x2556('0x3'),_0x2556('0x4')];function writeDB(_0x5c8d2b){utils[_0x2556('0x5')](util[_0x2556('0x6')](_0x2556('0x7'),_0x5c8d2b[_0x2556('0x8')],_0x5c8d2b['interface'],_0x5c8d2b[_0x2556('0x9')],_0x5c8d2b[_0x2556('0xa')],_0x5c8d2b['membername'],_0x5c8d2b[_0x2556('0xb')]));if(_0x5c8d2b[_0x2556('0xc')]){utils[_0x2556('0xd')](_0x5c8d2b[_0x2556('0xc')])['then'](function(_0x142dc6){if(_0x142dc6){_0x5c8d2b[_0x2556('0xe')]=_0x142dc6[_0x2556('0xf')];_0x5c8d2b[_0x2556('0x10')]=_0x142dc6[_0x2556('0x10')];utils[_0x2556('0x11')](_0x2556('0x12'),_0x5c8d2b);}else{utils[_0x2556('0x13')](_0x5c8d2b[_0x2556('0xc')]['split']('/')[0x1])['then'](function(_0x215e9f){if(_0x215e9f){_0x5c8d2b[_0x2556('0xe')]=_0x215e9f[_0x2556('0xf')];_0x5c8d2b[_0x2556('0x10')]=_0x215e9f[_0x2556('0x10')];utils[_0x2556('0x11')](_0x2556('0x12'),_0x5c8d2b);}});}})[_0x2556('0x14')](function(_0x2c573a){utils[_0x2556('0x15')](util['format'](_0x2556('0x16'),_0x5c8d2b[_0x2556('0x8')]),_0x2c573a);});}delete members[_0x5c8d2b[_0x2556('0xc')]];}function startsWith(_0x444f21,_0x34fc69){return _[_0x2556('0x17')](_0x444f21,function(_0x12039a){return _[_0x2556('0x18')](_0x34fc69,_0x12039a);});}exports['devicestatechange']=function(_0x46c92a){try{utils[_0x2556('0x19')](util[_0x2556('0x6')](_0x2556('0x1a'),members[_0x46c92a[_0x2556('0x1b')]]?members[_0x46c92a[_0x2556('0x1b')]][_0x2556('0x8')]:_0x46c92a[_0x2556('0x1b')]),_0x46c92a);utils[_0x2556('0x5')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x46c92a[_0x2556('0x1b')]]?members[_0x46c92a[_0x2556('0x1b')]][_0x2556('0x8')]:_0x46c92a[_0x2556('0x1b')],_0x46c92a[_0x2556('0x1c')],_0x46c92a[_0x2556('0x1b')]));switch(_0x46c92a[_0x2556('0x1c')]){case _0x2556('0x1d'):case _0x2556('0x1e'):if(!startsWith(exclude,_0x46c92a[_0x2556('0x1b')])){members[_0x46c92a[_0x2556('0x1b')]]={'channel':_0x2556('0x1f'),'interface':_0x46c92a[_0x2556('0x1b')],'type':_0x2556('0x20'),'enterAt':utils['now'](),'role':_0x2556('0x21')};}break;case _0x2556('0x22'):if(!_[_0x2556('0x23')](members[_0x46c92a[_0x2556('0x1b')]])){members[_0x46c92a[_0x2556('0x1b')]]['exitAt']=utils[_0x2556('0x24')]();members[_0x46c92a['device']][_0x2556('0x25')]=utils['diffTime'](members[_0x46c92a[_0x2556('0x1b')]][_0x2556('0x26')],members[_0x46c92a[_0x2556('0x1b')]][_0x2556('0x27')]);if(members[_0x46c92a['device']]['uniqueid']){writeDB(members[_0x46c92a[_0x2556('0x1b')]]);}}break;default:break;}}catch(_0x3c4726){utils[_0x2556('0x15')](util['format'](_0x2556('0x1a'),members[_0x46c92a[_0x2556('0x1b')]]?members[_0x46c92a[_0x2556('0x1b')]]['uniqueid']:_0x46c92a[_0x2556('0x1b')]),_0x3c4726);}};exports[_0x2556('0x28')]=function(_0x10a9a8){try{if(!_[_0x2556('0x23')](members[_0x10a9a8[_0x2556('0xc')]])){utils[_0x2556('0x19')](util[_0x2556('0x6')](_0x2556('0x29'),_0x10a9a8['uniqueid']),_0x10a9a8);utils['info'](util['format'](_0x2556('0x2a'),_0x10a9a8[_0x2556('0x8')],_0x10a9a8[_0x2556('0xc')],_0x10a9a8[_0x2556('0x2b')]));members[_0x10a9a8['interface']]=_[_0x2556('0x2c')](members[_0x10a9a8[_0x2556('0xc')]],{'data4':_0x10a9a8[_0x2556('0x2b')],'uniqueid':_0x10a9a8[_0x2556('0x8')]});}}catch(_0x58fca1){utils[_0x2556('0x15')](util[_0x2556('0x6')](_0x2556('0x29'),_0x10a9a8[_0x2556('0x8')]),_0x58fca1);}};exports[_0x2556('0x2d')]=function(_0x199f44){try{utils[_0x2556('0x19')](util[_0x2556('0x6')](_0x2556('0x2e'),_0x199f44[_0x2556('0x8')]),_0x199f44);if(_0x199f44[_0x2556('0x9')]){var _0x425b06=_0x199f44['channel'][_0x2556('0x2f')]('-')[0x0];if(!_['isNil'](members[_0x425b06])){members[_0x425b06]=_[_0x2556('0x2c')](members[_0x425b06],{'data1':members[_0x425b06][_0x2556('0x30')]||_0x199f44[_0x2556('0xb')],'data2':members[_0x425b06][_0x2556('0xa')]||_0x199f44[_0x2556('0x31')],'data3':members[_0x425b06][_0x2556('0x32')]||_0x199f44[_0x2556('0x33')],'uniqueid':members[_0x425b06][_0x2556('0x8')]||_0x199f44[_0x2556('0x8')]});utils['info'](util['format'](_0x2556('0x34'),_0x199f44[_0x2556('0x8')],members[_0x425b06][_0x2556('0x30')],members[_0x425b06][_0x2556('0xa')],members[_0x425b06][_0x2556('0x32')]));if(members[_0x425b06]['exitAt']){writeDB(members[_0x425b06]);}}}if(_0x199f44[_0x2556('0x35')]){var _0x5c238b=_0x199f44[_0x2556('0x35')]['split']('-')[0x0];if(!_[_0x2556('0x23')](members[_0x5c238b])){members[_0x5c238b]=_[_0x2556('0x2c')](members[_0x5c238b],{'data1':members[_0x5c238b]['data1']||_0x199f44[_0x2556('0xb')],'data2':members[_0x5c238b][_0x2556('0xa')]||_0x199f44['source'],'data3':members[_0x5c238b][_0x2556('0x32')]||_0x199f44[_0x2556('0x33')],'uniqueid':members[_0x5c238b][_0x2556('0x8')]||_0x199f44[_0x2556('0x8')]});utils['info'](util[_0x2556('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x199f44[_0x2556('0x8')],members[_0x5c238b]['data1'],members[_0x5c238b][_0x2556('0xa')],members[_0x5c238b][_0x2556('0x32')]));if(members[_0x5c238b][_0x2556('0x26')]){writeDB(members[_0x5c238b]);}}}}catch(_0x131496){utils['error'](util[_0x2556('0x6')]('[%s][members][cdr]',_0x199f44[_0x2556('0x8')]),_0x131496);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index c39b8d8..30ef4e7 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 _0x0ea2=['error','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]','variable','queuestatus','value','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','accountcode','membername','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfereelinkedid','clone','calleridnum','calleridname','holdtime','[%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','transferexten','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','channel','lastAssignedTo','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','uniqueid','position','now'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0x0ea2,0x180));var _0x20ea=function(_0x96cfa1,_0x566794){_0x96cfa1=_0x96cfa1-0x0;var _0x163e4a=_0x0ea2[_0x96cfa1];return _0x163e4a;};'use strict';var _=require(_0x20ea('0x0'));var util=require(_0x20ea('0x1'));var utils=require(_0x20ea('0x2'));var queues={};function writeDB(_0x592993){utils[_0x20ea('0x3')](util[_0x20ea('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x592993['uniqueid'],_0x592993[_0x20ea('0x5')],_0x592993['queue'],_0x592993[_0x20ea('0x6')],_0x592993['calleridnum'],_0x592993['accountcode'],_0x592993[_0x20ea('0x7')]));if(_0x592993[_0x20ea('0x8')]){utils[_0x20ea('0x9')](_0x592993[_0x20ea('0x8')])[_0x20ea('0xa')](function(_0xbcc6e4){if(_0xbcc6e4){_0x592993[_0x20ea('0xb')]=_0xbcc6e4['type'];}utils[_0x20ea('0xc')]('CreateVoiceQueueReport',_0x592993);});}else{utils[_0x20ea('0xc')]('CreateVoiceQueueReport',_0x592993);}if(_0x592993[_0x20ea('0xd')]){delete queues[_0x592993[_0x20ea('0xd')]];}else{delete queues[_0x592993['uniqueid']];}}exports[_0x20ea('0xe')]=function(_0x3cd921){try{utils[_0x20ea('0xf')](util['format'](_0x20ea('0x10'),_0x3cd921[_0x20ea('0x11')]),_0x3cd921);utils['info'](util[_0x20ea('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x3cd921[_0x20ea('0x11')],_0x3cd921[_0x20ea('0x8')],_0x3cd921[_0x20ea('0x12')]));queues[_0x3cd921[_0x20ea('0x11')]]=_['assign'](_0x3cd921,{'originalposition':_0x3cd921[_0x20ea('0x12')],'queuecallerjoinAt':utils[_0x20ea('0x13')](),'mohtime':0x0});}catch(_0x1ea09f){utils[_0x20ea('0x14')](util[_0x20ea('0x4')](_0x20ea('0x10'),_0x3cd921[_0x20ea('0x11')]),_0x1ea09f);}};exports[_0x20ea('0x15')]=function(_0x37afb3){try{if(!_[_0x20ea('0x16')](queues[_0x37afb3[_0x20ea('0x11')]])){utils['debug'](util[_0x20ea('0x4')]('[%s][queues][hangup]',_0x37afb3[_0x20ea('0x11')]),_0x37afb3);if(queues[_0x37afb3[_0x20ea('0x11')]][_0x20ea('0x17')]){if(!queues[_0x37afb3[_0x20ea('0x11')]]['queuecallerabandon']&&!queues[_0x37afb3[_0x20ea('0x11')]][_0x20ea('0x18')]){queues[_0x37afb3[_0x20ea('0x11')]][_0x20ea('0x19')]=!![];queues[_0x37afb3['uniqueid']][_0x20ea('0x1a')]=utils['now']();queues[_0x37afb3[_0x20ea('0x11')]][_0x20ea('0x7')]=_0x20ea('0x1b');}utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x1c'),_0x37afb3['uniqueid'],queues[_0x37afb3['uniqueid']][_0x20ea('0x1d')],queues[_0x37afb3[_0x20ea('0x11')]][_0x20ea('0x7')]));writeDB(queues[_0x37afb3[_0x20ea('0x11')]]);}else if(queues[_0x37afb3[_0x20ea('0x11')]][_0x20ea('0xd')]){utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x1e'),_0x37afb3[_0x20ea('0x11')],queues[_0x37afb3[_0x20ea('0x11')]][_0x20ea('0x1d')],queues[_0x37afb3[_0x20ea('0x11')]]['transfereduniqueid']));queues[queues[_0x37afb3[_0x20ea('0x11')]]['transfereduniqueid']]=queues[_0x37afb3[_0x20ea('0x11')]];queues[queues[_0x37afb3[_0x20ea('0x11')]][_0x20ea('0xd')]][_0x20ea('0x1f')]=0x2;delete queues[_0x37afb3['uniqueid']];}}}catch(_0x2ef3ed){utils['error'](util[_0x20ea('0x4')](_0x20ea('0x20'),_0x37afb3[_0x20ea('0x11')]),_0x2ef3ed);}};exports['varset']=function(_0xa5a779){try{utils['debug'](util[_0x20ea('0x4')](_0x20ea('0x21'),_0xa5a779[_0x20ea('0x11')]),_0xa5a779);if(!_['isNil'](_0xa5a779[_0x20ea('0x22')][_0x20ea('0x23')])&&_0xa5a779[_0x20ea('0x24')]['toUpperCase']()!==_0x20ea('0x25')){if(!_[_0x20ea('0x16')](queues[_0xa5a779[_0x20ea('0x11')]])){queues[_0xa5a779['uniqueid']][_0x20ea('0x26')]=![];queues[_0xa5a779[_0x20ea('0x11')]][_0x20ea('0x27')]=null;queues[_0xa5a779[_0x20ea('0x11')]][_0x20ea('0x18')]=!![];queues[_0xa5a779[_0x20ea('0x11')]][_0x20ea('0x28')]=utils[_0x20ea('0x13')]();queues[_0xa5a779['uniqueid']][_0x20ea('0x7')]=_0xa5a779['value']['toUpperCase']();utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x29'),_0xa5a779['uniqueid'],queues[_0xa5a779[_0x20ea('0x11')]][_0x20ea('0x1d')],_0xa5a779[_0x20ea('0x24')],queues[_0xa5a779[_0x20ea('0x11')]][_0x20ea('0x7')]));writeDB(queues[_0xa5a779['uniqueid']]);}}else if(!_[_0x20ea('0x16')](_0xa5a779['variable'][_0x20ea('0x2a')])){if(!_['isNil'](queues[_0xa5a779['uniqueid']])&&!queues[_0xa5a779['uniqueid']]['queuecallerabandon']){queues[_0xa5a779[_0x20ea('0x11')]][_0x20ea('0x26')]=![];queues[_0xa5a779[_0x20ea('0x11')]][_0x20ea('0x27')]=null;queues[_0xa5a779['uniqueid']][_0x20ea('0x18')]=!![];queues[_0xa5a779[_0x20ea('0x11')]]['queuecallerexitAt']=utils[_0x20ea('0x13')]();queues[_0xa5a779['uniqueid']][_0x20ea('0x7')]=_0x20ea('0x2b');utils[_0x20ea('0x3')](util['format'](_0x20ea('0x2c'),_0xa5a779['uniqueid'],queues[_0xa5a779['uniqueid']][_0x20ea('0x1d')],_0xa5a779[_0x20ea('0x24')],queues[_0xa5a779['uniqueid']]['queuecallerexitreason']));}}}catch(_0x51c364){utils[_0x20ea('0x14')](util[_0x20ea('0x4')](_0x20ea('0x21'),_0xa5a779[_0x20ea('0x11')]),_0x51c364);}};exports['queuecallerabandon']=function(_0x507db6){try{if(!_[_0x20ea('0x16')](queues[_0x507db6[_0x20ea('0x11')]])){utils[_0x20ea('0xf')](util[_0x20ea('0x4')](_0x20ea('0x2d'),_0x507db6['uniqueid']),_0x507db6);queues[_0x507db6[_0x20ea('0x11')]]['queuecallerexit']=![];queues[_0x507db6[_0x20ea('0x11')]][_0x20ea('0x28')]=null;queues[_0x507db6[_0x20ea('0x11')]]['queuecallerabandon']=!![];queues[_0x507db6[_0x20ea('0x11')]][_0x20ea('0x27')]=utils[_0x20ea('0x13')]();queues[_0x507db6[_0x20ea('0x11')]][_0x20ea('0x7')]=_0x20ea('0x2e');utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x2f'),_0x507db6[_0x20ea('0x11')],queues[_0x507db6[_0x20ea('0x11')]][_0x20ea('0x1d')],queues[_0x507db6[_0x20ea('0x11')]][_0x20ea('0x7')]));}}catch(_0x25a8c9){utils[_0x20ea('0x14')](util[_0x20ea('0x4')](_0x20ea('0x2d'),_0x507db6[_0x20ea('0x11')]),_0x25a8c9);}};exports['queuecallerleave']=function(_0x47543f){try{if(!_[_0x20ea('0x16')](queues[_0x47543f[_0x20ea('0x11')]])){utils[_0x20ea('0xf')](util[_0x20ea('0x4')](_0x20ea('0x30'),_0x47543f[_0x20ea('0x11')]),_0x47543f);utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x31'),_0x47543f['uniqueid'],queues[_0x47543f[_0x20ea('0x11')]][_0x20ea('0x1d')],_0x47543f[_0x20ea('0x32')],_0x47543f[_0x20ea('0x33')]));queues[_0x47543f[_0x20ea('0x11')]][_0x20ea('0x34')]=!![];queues[_0x47543f[_0x20ea('0x11')]]['queuecallerleaveAt']=utils[_0x20ea('0x13')]();queues[_0x47543f[_0x20ea('0x11')]]['holdtime']=utils[_0x20ea('0x35')](queues[_0x47543f[_0x20ea('0x11')]]['queuecallerleaveAt'],queues[_0x47543f['uniqueid']][_0x20ea('0x36')]);queues[_0x47543f[_0x20ea('0x11')]][_0x20ea('0x12')]=_0x47543f[_0x20ea('0x12')];queues[_0x47543f['uniqueid']]['count']=_0x47543f[_0x20ea('0x37')];queues[_0x47543f[_0x20ea('0x11')]][_0x20ea('0x32')]=_0x47543f['connectedlinenum'];queues[_0x47543f['uniqueid']][_0x20ea('0x33')]=_0x47543f[_0x20ea('0x33')];}}catch(_0x406166){utils[_0x20ea('0x14')](util[_0x20ea('0x4')](_0x20ea('0x30'),_0x47543f[_0x20ea('0x11')]),_0x406166);}};exports[_0x20ea('0x38')]=function(_0x3499cc){try{if(!_[_0x20ea('0x16')](queues[_0x3499cc[_0x20ea('0x11')]])){utils['debug'](util[_0x20ea('0x4')]('[%s][queues][agentconnect]',_0x3499cc[_0x20ea('0x11')]),_0x3499cc);utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x39'),_0x3499cc['uniqueid'],queues[_0x3499cc[_0x20ea('0x11')]][_0x20ea('0x1d')],_0x3499cc['membername'],_0x3499cc[_0x20ea('0x3a')]));queues[_0x3499cc[_0x20ea('0x11')]][_0x20ea('0x26')]=![];queues[_0x3499cc['uniqueid']][_0x20ea('0x26')]=![];queues[_0x3499cc[_0x20ea('0x11')]][_0x20ea('0x27')]=null;queues[_0x3499cc[_0x20ea('0x11')]][_0x20ea('0x18')]=![];queues[_0x3499cc['uniqueid']][_0x20ea('0x7')]=null;queues[_0x3499cc[_0x20ea('0x11')]][_0x20ea('0x28')]=null;queues[_0x3499cc['uniqueid']][_0x20ea('0x3b')]=!![];queues[_0x3499cc[_0x20ea('0x11')]][_0x20ea('0x3c')]=_0x3499cc[_0x20ea('0x3a')];queues[_0x3499cc[_0x20ea('0x11')]]['lastAssignedTo']=_0x3499cc[_0x20ea('0x3d')];}}catch(_0x335f0b){utils['error'](util[_0x20ea('0x4')]('[%s][queues][agentconnect]',_0x3499cc[_0x20ea('0x11')]),_0x335f0b);}};exports['agentcomplete']=function(_0x2911fc){try{if(!_[_0x20ea('0x16')](queues[_0x2911fc[_0x20ea('0x11')]])){if(queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x17')]){utils[_0x20ea('0xf')](util[_0x20ea('0x4')](_0x20ea('0x3e'),_0x2911fc['uniqueid']),_0x2911fc);queues[_0x2911fc[_0x20ea('0x11')]]['queuecallerabandon']=![];queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x26')]=![];queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x27')]=null;queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x18')]=![];queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x28')]=null;queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x3b')]=!![];queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x6')]=_0x2911fc['membername'];queues[_0x2911fc['uniqueid']]['queuecallercomplete']=!![];queues[_0x2911fc['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x2911fc[_0x20ea('0x3f')]==_0x20ea('0x40')){if(!queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x40')]){queues[_0x2911fc[_0x20ea('0x11')]][_0x20ea('0x7')]=_0x20ea('0x41');}}else{queues[_0x2911fc[_0x20ea('0x11')]]['queuecallerexitreason']=_0x20ea('0x42')+_0x2911fc[_0x20ea('0x3f')][_0x20ea('0x43')]();}utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x44'),_0x2911fc['uniqueid'],queues[_0x2911fc['uniqueid']][_0x20ea('0x1d')],_0x2911fc['membername'],queues[_0x2911fc['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x2911fc[_0x20ea('0x11')]]);}}}catch(_0x544663){utils[_0x20ea('0x14')](util[_0x20ea('0x4')](_0x20ea('0x3e'),_0x2911fc[_0x20ea('0x11')]),_0x544663);}};exports['blindtransfer']=function(_0x4977aa){try{if(!_['isNil'](queues[_0x4977aa[_0x20ea('0x45')]])){utils[_0x20ea('0xf')](util['format']('[%s][queues][blindtransfer]',_0x4977aa['uniqueid']),_0x4977aa);queues[_0x4977aa[_0x20ea('0x45')]]['transfer']=!![];queues[_0x4977aa[_0x20ea('0x45')]][_0x20ea('0x46')]='BLIND';queues[_0x4977aa['transfereeuniqueid']]['transferexten']=_0x4977aa[_0x20ea('0x47')];queues[_0x4977aa[_0x20ea('0x45')]][_0x20ea('0x48')]=_0x4977aa[_0x20ea('0x45')];queues[_0x4977aa[_0x20ea('0x45')]][_0x20ea('0x7')]=_0x20ea('0x49');utils['info'](util[_0x20ea('0x4')](_0x20ea('0x4a'),_0x4977aa[_0x20ea('0x11')],queues[_0x4977aa[_0x20ea('0x45')]]['name'],_0x4977aa[_0x20ea('0x45')],_0x4977aa['extension']));}}catch(_0x54c0d5){utils[_0x20ea('0x14')](util['format'](_0x20ea('0x4b'),_0x4977aa['uniqueid']),_0x54c0d5);}};exports[_0x20ea('0x4c')]=function(_0x990f16){try{utils[_0x20ea('0xf')](util[_0x20ea('0x4')]('[%s][queues][attendedtransfer]',_0x990f16[_0x20ea('0x4d')]),_0x990f16);if(_0x990f16[_0x20ea('0x4d')]==_0x990f16[_0x20ea('0x4e')]){if(!_[_0x20ea('0x16')](queues[_0x990f16[_0x20ea('0x4f')]])){utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x50'),_0x990f16[_0x20ea('0x4d')],queues[_0x990f16[_0x20ea('0x4f')]][_0x20ea('0x1d')],_0x990f16['origtransfererexten']));queues[_0x990f16['secondtransfererlinkedid']]['transfer']=!![];queues[_0x990f16[_0x20ea('0x4f')]][_0x20ea('0x46')]='ATTENDED';queues[_0x990f16['secondtransfererlinkedid']]['transferexten']=_0x990f16['origtransfererexten'];queues[_0x990f16['secondtransfererlinkedid']]['transferuniqueid']=_0x990f16['origtransfereruniqueid'];queues[_0x990f16['secondtransfererlinkedid']][_0x20ea('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x20ea('0x16')](queues[_0x990f16[_0x20ea('0x4e')]])){if(_0x990f16['transfereelinkedid']&&queues[_0x990f16[_0x20ea('0x51')]]){queues[_0x990f16[_0x20ea('0x51')]][_0x20ea('0x1f')]=0x1;queues[_0x990f16['transfereeuniqueid']]=_[_0x20ea('0x52')](queues[_0x990f16[_0x20ea('0x51')]]);queues[_0x990f16[_0x20ea('0x45')]][_0x20ea('0xd')]=_0x990f16['transfertargetuniqueid'];queues[_0x990f16['transfereeuniqueid']][_0x20ea('0x1f')]=0x2;queues[_0x990f16[_0x20ea('0x45')]][_0x20ea('0x53')]=queues[_0x990f16[_0x20ea('0x4f')]][_0x20ea('0x53')];queues[_0x990f16[_0x20ea('0x45')]][_0x20ea('0x54')]=queues[_0x990f16[_0x20ea('0x4f')]][_0x20ea('0x54')];queues[_0x990f16['transfereeuniqueid']][_0x20ea('0x36')]=utils[_0x20ea('0x13')]();queues[_0x990f16[_0x20ea('0x45')]]['queuecallerleaveAt']=utils[_0x20ea('0x13')]();queues[_0x990f16[_0x20ea('0x45')]][_0x20ea('0x55')]=0x0;queues[_0x990f16[_0x20ea('0x45')]]['mohtime']=0x0;utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x56'),_0x990f16['origtransfereruniqueid'],queues[_0x990f16[_0x20ea('0x45')]]['name'],queues[_0x990f16[_0x20ea('0x45')]][_0x20ea('0x53')],queues[_0x990f16[_0x20ea('0x45')]][_0x20ea('0x54')]));}else{utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x57'),_0x990f16[_0x20ea('0x4d')],queues[_0x990f16['origtransfererlinkedid']][_0x20ea('0x1d')],_0x990f16[_0x20ea('0x4f')]));queues[_0x990f16[_0x20ea('0x4e')]][_0x20ea('0xd')]=_0x990f16[_0x20ea('0x4f')];}}}else if(_0x990f16[_0x20ea('0x58')]==_0x990f16[_0x20ea('0x4f')]){if(!_[_0x20ea('0x16')](queues[_0x990f16['origtransfererlinkedid']])){utils[_0x20ea('0x3')](util['format'](_0x20ea('0x59'),_0x990f16['origtransfereruniqueid'],queues[_0x990f16[_0x20ea('0x4e')]][_0x20ea('0x1d')],_0x990f16['secondtransfereruniqueid'],_0x990f16[_0x20ea('0x5a')]));queues[_0x990f16[_0x20ea('0x4e')]]['transfer']=!![];queues[_0x990f16[_0x20ea('0x4e')]][_0x20ea('0x46')]='ATTENDED';queues[_0x990f16[_0x20ea('0x4e')]][_0x20ea('0x5b')]=_0x990f16['secondtransfererexten'];queues[_0x990f16['origtransfererlinkedid']][_0x20ea('0x48')]=_0x990f16[_0x20ea('0x58')];queues[_0x990f16['origtransfererlinkedid']]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x20ea('0x16')](queues[_0x990f16['secondtransfererlinkedid']])){if(_0x990f16['transfertargetlinkedid']&&queues[_0x990f16['transfertargetlinkedid']]){queues[_0x990f16['transfertargetlinkedid']][_0x20ea('0x1f')]=0x1;queues[_0x990f16['transfertargetuniqueid']]=_['clone'](queues[_0x990f16['transfertargetlinkedid']]);queues[_0x990f16['transfertargetuniqueid']][_0x20ea('0xd')]=_0x990f16[_0x20ea('0x5c')];queues[_0x990f16[_0x20ea('0x5c')]][_0x20ea('0x1f')]=0x2;queues[_0x990f16[_0x20ea('0x5c')]][_0x20ea('0x53')]=queues[_0x990f16[_0x20ea('0x4e')]][_0x20ea('0x53')];queues[_0x990f16['transfertargetuniqueid']][_0x20ea('0x54')]=queues[_0x990f16[_0x20ea('0x4e')]][_0x20ea('0x54')];queues[_0x990f16[_0x20ea('0x5c')]][_0x20ea('0x36')]=utils['now']();queues[_0x990f16[_0x20ea('0x5c')]][_0x20ea('0x17')]=utils[_0x20ea('0x13')]();queues[_0x990f16[_0x20ea('0x5c')]][_0x20ea('0x55')]=0x0;queues[_0x990f16[_0x20ea('0x5c')]]['mohtime']=0x0;utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x5d'),_0x990f16[_0x20ea('0x4d')],queues[_0x990f16[_0x20ea('0x5c')]][_0x20ea('0x1d')],queues[_0x990f16['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x990f16[_0x20ea('0x5c')]][_0x20ea('0x53')],queues[_0x990f16['transfertargetuniqueid']][_0x20ea('0x54')]));}else{utils[_0x20ea('0x3')](util['format'](_0x20ea('0x57'),_0x990f16[_0x20ea('0x4d')],queues[_0x990f16['secondtransfererlinkedid']][_0x20ea('0x1d')],_0x990f16[_0x20ea('0x4e')]));queues[_0x990f16[_0x20ea('0x4f')]][_0x20ea('0xd')]=_0x990f16[_0x20ea('0x4e')];}}}}catch(_0x168e09){utils[_0x20ea('0x14')](util['format'](_0x20ea('0x5e'),_0x990f16[_0x20ea('0x4d')]),_0x168e09);}};exports['musiconholdstart']=function(_0x46f584){try{if(!_[_0x20ea('0x16')](queues[_0x46f584[_0x20ea('0x11')]])){utils[_0x20ea('0xf')](util[_0x20ea('0x4')]('[%s][queues][musiconholdstart]',_0x46f584[_0x20ea('0x11')]),_0x46f584);queues[_0x46f584['uniqueid']][_0x20ea('0x5f')]=utils['now']();utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x60'),_0x46f584[_0x20ea('0x11')],queues[_0x46f584[_0x20ea('0x11')]][_0x20ea('0x1d')],queues[_0x46f584[_0x20ea('0x11')]]['musiconholdstartAt']));}}catch(_0x32aa98){utils['error'](util[_0x20ea('0x4')]('[%s][queues][musiconholdstart]',_0x46f584[_0x20ea('0x11')]),_0x32aa98);}};exports[_0x20ea('0x61')]=function(_0x201652){try{if(!_[_0x20ea('0x16')](queues[_0x201652[_0x20ea('0x11')]])){if(!_['isNil'](queues[_0x201652[_0x20ea('0x11')]][_0x20ea('0x5f')])){utils['debug'](util[_0x20ea('0x4')]('[%s][queues][musiconholdstop]',_0x201652['uniqueid']),_0x201652);queues[_0x201652[_0x20ea('0x11')]][_0x20ea('0x62')]+=utils[_0x20ea('0x35')](utils[_0x20ea('0x13')](),queues[_0x201652[_0x20ea('0x11')]][_0x20ea('0x5f')]);utils[_0x20ea('0x3')](util[_0x20ea('0x4')](_0x20ea('0x63'),_0x201652[_0x20ea('0x11')],queues[_0x201652[_0x20ea('0x11')]]['name'],queues[_0x201652['uniqueid']][_0x20ea('0x62')]));delete queues[_0x201652[_0x20ea('0x11')]][_0x20ea('0x5f')];}}}catch(_0x38302d){utils['error'](util[_0x20ea('0x4')](_0x20ea('0x64'),_0x201652[_0x20ea('0x11')]),_0x38302d);}}; \ No newline at end of file +var _0xa344=['error','hangup','debug','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallerexitreason','COMPLETEDBYAGENT','name','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','isNil','queuecallerabandon','queuecallerabandonAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerexitAt','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','accountcode','agentcomplete','queuecallercompleteAt','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','membername','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now'];(function(_0x5e1ab0,_0x506753){var _0x3914f0=function(_0xc20ee4){while(--_0xc20ee4){_0x5e1ab0['push'](_0x5e1ab0['shift']());}};_0x3914f0(++_0x506753);}(_0xa344,0xb6));var _0x4a34=function(_0x78c42d,_0x2819ff){_0x78c42d=_0x78c42d-0x0;var _0x33a1bb=_0xa344[_0x78c42d];return _0x33a1bb;};'use strict';var _=require(_0x4a34('0x0'));var util=require(_0x4a34('0x1'));var utils=require(_0x4a34('0x2'));var queues={};function writeDB(_0x1f92a6){utils[_0x4a34('0x3')](util[_0x4a34('0x4')](_0x4a34('0x5'),_0x1f92a6[_0x4a34('0x6')],_0x1f92a6[_0x4a34('0x7')],_0x1f92a6[_0x4a34('0x8')],_0x1f92a6[_0x4a34('0x9')],_0x1f92a6['calleridnum'],_0x1f92a6['accountcode'],_0x1f92a6['queuecallerexitreason']));if(_0x1f92a6['queue']){utils[_0x4a34('0xa')](_0x1f92a6[_0x4a34('0x8')])[_0x4a34('0xb')](function(_0xc47455){if(_0xc47455){_0x1f92a6[_0x4a34('0xc')]=_0xc47455[_0x4a34('0xc')];}utils[_0x4a34('0xd')](_0x4a34('0xe'),_0x1f92a6);});}else{utils[_0x4a34('0xd')]('CreateVoiceQueueReport',_0x1f92a6);}if(_0x1f92a6['transfereduniqueid']){delete queues[_0x1f92a6[_0x4a34('0xf')]];}else{delete queues[_0x1f92a6[_0x4a34('0x6')]];}}exports[_0x4a34('0x10')]=function(_0x511bce){try{utils['debug'](util['format'](_0x4a34('0x11'),_0x511bce[_0x4a34('0x6')]),_0x511bce);utils[_0x4a34('0x3')](util[_0x4a34('0x4')](_0x4a34('0x12'),_0x511bce[_0x4a34('0x6')],_0x511bce[_0x4a34('0x8')],_0x511bce[_0x4a34('0x13')]));queues[_0x511bce[_0x4a34('0x6')]]=_[_0x4a34('0x14')](_0x511bce,{'originalposition':_0x511bce[_0x4a34('0x13')],'queuecallerjoinAt':utils[_0x4a34('0x15')](),'mohtime':0x0});}catch(_0x4df086){utils[_0x4a34('0x16')](util[_0x4a34('0x4')](_0x4a34('0x11'),_0x511bce[_0x4a34('0x6')]),_0x4df086);}};exports[_0x4a34('0x17')]=function(_0x1be924){try{if(!_['isNil'](queues[_0x1be924[_0x4a34('0x6')]])){utils[_0x4a34('0x18')](util[_0x4a34('0x4')]('[%s][queues][hangup]',_0x1be924[_0x4a34('0x6')]),_0x1be924);if(queues[_0x1be924['uniqueid']][_0x4a34('0x19')]){if(!queues[_0x1be924[_0x4a34('0x6')]]['queuecallerabandon']&&!queues[_0x1be924[_0x4a34('0x6')]][_0x4a34('0x1a')]){queues[_0x1be924[_0x4a34('0x6')]][_0x4a34('0x1b')]=!![];queues[_0x1be924[_0x4a34('0x6')]]['queuecallercompleteAt']=utils[_0x4a34('0x15')]();queues[_0x1be924[_0x4a34('0x6')]][_0x4a34('0x1c')]=_0x4a34('0x1d');}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x1be924['uniqueid'],queues[_0x1be924[_0x4a34('0x6')]][_0x4a34('0x1e')],queues[_0x1be924[_0x4a34('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x1be924['uniqueid']]);}else if(queues[_0x1be924[_0x4a34('0x6')]]['transfereduniqueid']){utils[_0x4a34('0x3')](util[_0x4a34('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x1be924[_0x4a34('0x6')],queues[_0x1be924[_0x4a34('0x6')]][_0x4a34('0x1e')],queues[_0x1be924[_0x4a34('0x6')]][_0x4a34('0xf')]));queues[queues[_0x1be924[_0x4a34('0x6')]][_0x4a34('0xf')]]=queues[_0x1be924[_0x4a34('0x6')]];queues[queues[_0x1be924['uniqueid']][_0x4a34('0xf')]][_0x4a34('0x1f')]=0x2;delete queues[_0x1be924[_0x4a34('0x6')]];}}}catch(_0x151dcd){utils[_0x4a34('0x16')](util[_0x4a34('0x4')]('[%s][queues][hangup]',_0x1be924[_0x4a34('0x6')]),_0x151dcd);}};exports['varset']=function(_0xb1a7f9){try{utils[_0x4a34('0x18')](util['format'](_0x4a34('0x20'),_0xb1a7f9[_0x4a34('0x6')]),_0xb1a7f9);if(!_['isNil'](_0xb1a7f9[_0x4a34('0x21')][_0x4a34('0x22')])&&_0xb1a7f9['value']['toUpperCase']()!=='CONTINUE'){if(!_[_0x4a34('0x23')](queues[_0xb1a7f9[_0x4a34('0x6')]])){queues[_0xb1a7f9['uniqueid']][_0x4a34('0x24')]=![];queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x25')]=null;queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x1a')]=!![];queues[_0xb1a7f9[_0x4a34('0x6')]]['queuecallerexitAt']=utils[_0x4a34('0x15')]();queues[_0xb1a7f9[_0x4a34('0x6')]]['queuecallerexitreason']=_0xb1a7f9['value'][_0x4a34('0x26')]();utils[_0x4a34('0x3')](util[_0x4a34('0x4')](_0x4a34('0x27'),_0xb1a7f9[_0x4a34('0x6')],queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x1e')],_0xb1a7f9[_0x4a34('0x28')],queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x1c')]));writeDB(queues[_0xb1a7f9[_0x4a34('0x6')]]);}}else if(!_[_0x4a34('0x23')](_0xb1a7f9[_0x4a34('0x21')][_0x4a34('0x29')])){if(!_[_0x4a34('0x23')](queues[_0xb1a7f9['uniqueid']])&&!queues[_0xb1a7f9['uniqueid']]['queuecallerabandon']){queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x24')]=![];queues[_0xb1a7f9['uniqueid']][_0x4a34('0x25')]=null;queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x1a')]=!![];queues[_0xb1a7f9[_0x4a34('0x6')]]['queuecallerexitAt']=utils[_0x4a34('0x15')]();queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x1c')]=_0x4a34('0x2a');utils[_0x4a34('0x3')](util['format'](_0x4a34('0x2b'),_0xb1a7f9[_0x4a34('0x6')],queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x1e')],_0xb1a7f9[_0x4a34('0x28')],queues[_0xb1a7f9[_0x4a34('0x6')]][_0x4a34('0x1c')]));}}}catch(_0x3aeead){utils[_0x4a34('0x16')](util[_0x4a34('0x4')]('[%s][queues][varset]',_0xb1a7f9[_0x4a34('0x6')]),_0x3aeead);}};exports[_0x4a34('0x24')]=function(_0x27f6ff){try{if(!_[_0x4a34('0x23')](queues[_0x27f6ff[_0x4a34('0x6')]])){utils[_0x4a34('0x18')](util[_0x4a34('0x4')](_0x4a34('0x2c'),_0x27f6ff[_0x4a34('0x6')]),_0x27f6ff);queues[_0x27f6ff[_0x4a34('0x6')]]['queuecallerexit']=![];queues[_0x27f6ff[_0x4a34('0x6')]][_0x4a34('0x2d')]=null;queues[_0x27f6ff['uniqueid']][_0x4a34('0x24')]=!![];queues[_0x27f6ff[_0x4a34('0x6')]][_0x4a34('0x25')]=utils[_0x4a34('0x15')]();queues[_0x27f6ff[_0x4a34('0x6')]][_0x4a34('0x1c')]='ABANDONED';utils[_0x4a34('0x3')](util[_0x4a34('0x4')](_0x4a34('0x2e'),_0x27f6ff['uniqueid'],queues[_0x27f6ff['uniqueid']][_0x4a34('0x1e')],queues[_0x27f6ff[_0x4a34('0x6')]][_0x4a34('0x1c')]));}}catch(_0x2d1da2){utils[_0x4a34('0x16')](util[_0x4a34('0x4')](_0x4a34('0x2c'),_0x27f6ff['uniqueid']),_0x2d1da2);}};exports['queuecallerleave']=function(_0x404daa){try{if(!_[_0x4a34('0x23')](queues[_0x404daa[_0x4a34('0x6')]])){utils[_0x4a34('0x18')](util[_0x4a34('0x4')](_0x4a34('0x2f'),_0x404daa[_0x4a34('0x6')]),_0x404daa);utils[_0x4a34('0x3')](util['format'](_0x4a34('0x30'),_0x404daa[_0x4a34('0x6')],queues[_0x404daa['uniqueid']][_0x4a34('0x1e')],_0x404daa[_0x4a34('0x31')],_0x404daa[_0x4a34('0x32')]));queues[_0x404daa[_0x4a34('0x6')]][_0x4a34('0x33')]=!![];queues[_0x404daa[_0x4a34('0x6')]][_0x4a34('0x19')]=utils[_0x4a34('0x15')]();queues[_0x404daa[_0x4a34('0x6')]][_0x4a34('0x34')]=utils[_0x4a34('0x35')](queues[_0x404daa[_0x4a34('0x6')]][_0x4a34('0x19')],queues[_0x404daa[_0x4a34('0x6')]][_0x4a34('0x36')]);queues[_0x404daa[_0x4a34('0x6')]][_0x4a34('0x13')]=_0x404daa[_0x4a34('0x13')];queues[_0x404daa[_0x4a34('0x6')]][_0x4a34('0x37')]=_0x404daa[_0x4a34('0x37')];queues[_0x404daa[_0x4a34('0x6')]][_0x4a34('0x31')]=_0x404daa['connectedlinenum'];queues[_0x404daa[_0x4a34('0x6')]]['connectedlinename']=_0x404daa[_0x4a34('0x32')];}}catch(_0x2419d2){utils[_0x4a34('0x16')](util['format']('[%s][queues][queuecallerleave]',_0x404daa[_0x4a34('0x6')]),_0x2419d2);}};exports[_0x4a34('0x38')]=function(_0x16ed16){try{if(!_[_0x4a34('0x23')](queues[_0x16ed16[_0x4a34('0x6')]])){utils[_0x4a34('0x18')](util[_0x4a34('0x4')](_0x4a34('0x39'),_0x16ed16[_0x4a34('0x6')]),_0x16ed16);utils[_0x4a34('0x3')](util['format'](_0x4a34('0x3a'),_0x16ed16['uniqueid'],queues[_0x16ed16[_0x4a34('0x6')]][_0x4a34('0x1e')],_0x16ed16['membername'],_0x16ed16['destaccountcode']));queues[_0x16ed16[_0x4a34('0x6')]]['queuecallerabandon']=![];queues[_0x16ed16['uniqueid']][_0x4a34('0x24')]=![];queues[_0x16ed16[_0x4a34('0x6')]]['queuecallerabandonAt']=null;queues[_0x16ed16['uniqueid']][_0x4a34('0x1a')]=![];queues[_0x16ed16[_0x4a34('0x6')]][_0x4a34('0x1c')]=null;queues[_0x16ed16[_0x4a34('0x6')]]['queuecallerexitAt']=null;queues[_0x16ed16[_0x4a34('0x6')]][_0x4a34('0x3b')]=!![];queues[_0x16ed16[_0x4a34('0x6')]][_0x4a34('0x3c')]=_0x16ed16['destaccountcode'];queues[_0x16ed16[_0x4a34('0x6')]]['lastAssignedTo']=_0x16ed16['membername'];}}catch(_0xce66c7){utils['error'](util[_0x4a34('0x4')](_0x4a34('0x39'),_0x16ed16[_0x4a34('0x6')]),_0xce66c7);}};exports[_0x4a34('0x3d')]=function(_0x5451d5){try{if(!_[_0x4a34('0x23')](queues[_0x5451d5[_0x4a34('0x6')]])){if(queues[_0x5451d5['uniqueid']][_0x4a34('0x19')]){utils[_0x4a34('0x18')](util[_0x4a34('0x4')]('[%s][queues][agentcomplete]',_0x5451d5[_0x4a34('0x6')]),_0x5451d5);queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x24')]=![];queues[_0x5451d5[_0x4a34('0x6')]]['queuecallerabandon']=![];queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x25')]=null;queues[_0x5451d5[_0x4a34('0x6')]]['queuecallerexit']=![];queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x2d')]=null;queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x3b')]=!![];queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x9')]=_0x5451d5['membername'];queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x1b')]=!![];queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x3e')]=utils[_0x4a34('0x15')]();if(_0x5451d5['reason']==_0x4a34('0x3f')){if(!queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x3f')]){queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x1c')]='TRANSFER';}}else{queues[_0x5451d5['uniqueid']]['queuecallerexitreason']='COMPLETEDBY'+_0x5451d5['reason'][_0x4a34('0x26')]();}utils[_0x4a34('0x3')](util['format'](_0x4a34('0x40'),_0x5451d5[_0x4a34('0x6')],queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x1e')],_0x5451d5[_0x4a34('0x41')],queues[_0x5451d5[_0x4a34('0x6')]][_0x4a34('0x1c')]));writeDB(queues[_0x5451d5[_0x4a34('0x6')]]);}}}catch(_0x246b42){utils[_0x4a34('0x16')](util[_0x4a34('0x4')](_0x4a34('0x42'),_0x5451d5[_0x4a34('0x6')]),_0x246b42);}};exports[_0x4a34('0x43')]=function(_0x3da00f){try{if(!_['isNil'](queues[_0x3da00f['transfereeuniqueid']])){utils[_0x4a34('0x18')](util[_0x4a34('0x4')]('[%s][queues][blindtransfer]',_0x3da00f['uniqueid']),_0x3da00f);queues[_0x3da00f[_0x4a34('0x44')]][_0x4a34('0x3f')]=!![];queues[_0x3da00f['transfereeuniqueid']]['transfertype']=_0x4a34('0x45');queues[_0x3da00f['transfereeuniqueid']][_0x4a34('0x46')]=_0x3da00f[_0x4a34('0x47')];queues[_0x3da00f[_0x4a34('0x44')]][_0x4a34('0x48')]=_0x3da00f[_0x4a34('0x44')];queues[_0x3da00f[_0x4a34('0x44')]][_0x4a34('0x1c')]=_0x4a34('0x49');utils['info'](util['format'](_0x4a34('0x4a'),_0x3da00f[_0x4a34('0x6')],queues[_0x3da00f[_0x4a34('0x44')]][_0x4a34('0x1e')],_0x3da00f['transfereeuniqueid'],_0x3da00f[_0x4a34('0x47')]));}}catch(_0x671a63){utils[_0x4a34('0x16')](util[_0x4a34('0x4')](_0x4a34('0x4b'),_0x3da00f[_0x4a34('0x6')]),_0x671a63);}};exports[_0x4a34('0x4c')]=function(_0x48b333){try{utils['debug'](util[_0x4a34('0x4')]('[%s][queues][attendedtransfer]',_0x48b333[_0x4a34('0x4d')]),_0x48b333);if(_0x48b333['origtransfereruniqueid']==_0x48b333['origtransfererlinkedid']){if(!_['isNil'](queues[_0x48b333[_0x4a34('0x4e')]])){utils[_0x4a34('0x3')](util[_0x4a34('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x48b333['origtransfereruniqueid'],queues[_0x48b333[_0x4a34('0x4e')]][_0x4a34('0x1e')],_0x48b333[_0x4a34('0x4f')]));queues[_0x48b333[_0x4a34('0x4e')]][_0x4a34('0x3f')]=!![];queues[_0x48b333[_0x4a34('0x4e')]][_0x4a34('0x50')]=_0x4a34('0x51');queues[_0x48b333['secondtransfererlinkedid']][_0x4a34('0x46')]=_0x48b333[_0x4a34('0x4f')];queues[_0x48b333['secondtransfererlinkedid']]['transferuniqueid']=_0x48b333['origtransfereruniqueid'];queues[_0x48b333[_0x4a34('0x4e')]]['queuecallerexitreason']=_0x4a34('0x52');}if(!_[_0x4a34('0x23')](queues[_0x48b333[_0x4a34('0x53')]])){if(_0x48b333[_0x4a34('0x54')]&&queues[_0x48b333[_0x4a34('0x54')]]){queues[_0x48b333[_0x4a34('0x54')]][_0x4a34('0x1f')]=0x1;queues[_0x48b333[_0x4a34('0x44')]]=_[_0x4a34('0x55')](queues[_0x48b333[_0x4a34('0x54')]]);queues[_0x48b333[_0x4a34('0x44')]]['transfereduniqueid']=_0x48b333[_0x4a34('0x56')];queues[_0x48b333[_0x4a34('0x44')]][_0x4a34('0x1f')]=0x2;queues[_0x48b333['transfereeuniqueid']][_0x4a34('0x57')]=queues[_0x48b333[_0x4a34('0x4e')]][_0x4a34('0x57')];queues[_0x48b333['transfereeuniqueid']]['calleridname']=queues[_0x48b333[_0x4a34('0x4e')]][_0x4a34('0x58')];queues[_0x48b333[_0x4a34('0x44')]]['queuecallerjoinAt']=utils['now']();queues[_0x48b333['transfereeuniqueid']][_0x4a34('0x19')]=utils[_0x4a34('0x15')]();queues[_0x48b333['transfereeuniqueid']]['holdtime']=0x0;queues[_0x48b333[_0x4a34('0x44')]][_0x4a34('0x59')]=0x0;utils[_0x4a34('0x3')](util['format'](_0x4a34('0x5a'),_0x48b333[_0x4a34('0x4d')],queues[_0x48b333[_0x4a34('0x44')]][_0x4a34('0x1e')],queues[_0x48b333[_0x4a34('0x44')]][_0x4a34('0x57')],queues[_0x48b333[_0x4a34('0x44')]][_0x4a34('0x58')]));}else{utils[_0x4a34('0x3')](util['format'](_0x4a34('0x5b'),_0x48b333['origtransfereruniqueid'],queues[_0x48b333['origtransfererlinkedid']][_0x4a34('0x1e')],_0x48b333[_0x4a34('0x4e')]));queues[_0x48b333[_0x4a34('0x53')]][_0x4a34('0xf')]=_0x48b333[_0x4a34('0x4e')];}}}else if(_0x48b333[_0x4a34('0x5c')]==_0x48b333['secondtransfererlinkedid']){if(!_[_0x4a34('0x23')](queues[_0x48b333[_0x4a34('0x53')]])){utils[_0x4a34('0x3')](util[_0x4a34('0x4')](_0x4a34('0x5d'),_0x48b333[_0x4a34('0x4d')],queues[_0x48b333[_0x4a34('0x53')]]['name'],_0x48b333[_0x4a34('0x5c')],_0x48b333[_0x4a34('0x5e')]));queues[_0x48b333[_0x4a34('0x53')]]['transfer']=!![];queues[_0x48b333[_0x4a34('0x53')]][_0x4a34('0x50')]='ATTENDED';queues[_0x48b333['origtransfererlinkedid']][_0x4a34('0x46')]=_0x48b333[_0x4a34('0x5e')];queues[_0x48b333['origtransfererlinkedid']]['transferuniqueid']=_0x48b333[_0x4a34('0x5c')];queues[_0x48b333[_0x4a34('0x53')]][_0x4a34('0x1c')]=_0x4a34('0x52');}if(!_['isNil'](queues[_0x48b333[_0x4a34('0x4e')]])){if(_0x48b333[_0x4a34('0x5f')]&&queues[_0x48b333[_0x4a34('0x5f')]]){queues[_0x48b333['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x48b333[_0x4a34('0x56')]]=_[_0x4a34('0x55')](queues[_0x48b333[_0x4a34('0x5f')]]);queues[_0x48b333['transfertargetuniqueid']][_0x4a34('0xf')]=_0x48b333[_0x4a34('0x56')];queues[_0x48b333['transfertargetuniqueid']][_0x4a34('0x1f')]=0x2;queues[_0x48b333[_0x4a34('0x56')]][_0x4a34('0x57')]=queues[_0x48b333[_0x4a34('0x53')]][_0x4a34('0x57')];queues[_0x48b333[_0x4a34('0x56')]][_0x4a34('0x58')]=queues[_0x48b333['origtransfererlinkedid']]['calleridname'];queues[_0x48b333['transfertargetuniqueid']][_0x4a34('0x36')]=utils[_0x4a34('0x15')]();queues[_0x48b333[_0x4a34('0x56')]][_0x4a34('0x19')]=utils['now']();queues[_0x48b333['transfertargetuniqueid']][_0x4a34('0x34')]=0x0;queues[_0x48b333['transfertargetuniqueid']][_0x4a34('0x59')]=0x0;utils[_0x4a34('0x3')](util[_0x4a34('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x48b333[_0x4a34('0x4d')],queues[_0x48b333['transfertargetuniqueid']][_0x4a34('0x1e')],queues[_0x48b333['transfertargetuniqueid']][_0x4a34('0xf')],queues[_0x48b333[_0x4a34('0x56')]][_0x4a34('0x57')],queues[_0x48b333[_0x4a34('0x56')]][_0x4a34('0x58')]));}else{utils[_0x4a34('0x3')](util[_0x4a34('0x4')](_0x4a34('0x5b'),_0x48b333[_0x4a34('0x4d')],queues[_0x48b333[_0x4a34('0x4e')]][_0x4a34('0x1e')],_0x48b333[_0x4a34('0x53')]));queues[_0x48b333['secondtransfererlinkedid']][_0x4a34('0xf')]=_0x48b333[_0x4a34('0x53')];}}}}catch(_0xd94c25){utils[_0x4a34('0x16')](util['format'](_0x4a34('0x60'),_0x48b333[_0x4a34('0x4d')]),_0xd94c25);}};exports['musiconholdstart']=function(_0x5d1975){try{if(!_['isNil'](queues[_0x5d1975['uniqueid']])){utils[_0x4a34('0x18')](util[_0x4a34('0x4')](_0x4a34('0x61'),_0x5d1975[_0x4a34('0x6')]),_0x5d1975);queues[_0x5d1975['uniqueid']]['musiconholdstartAt']=utils['now']();utils['info'](util[_0x4a34('0x4')](_0x4a34('0x62'),_0x5d1975[_0x4a34('0x6')],queues[_0x5d1975[_0x4a34('0x6')]][_0x4a34('0x1e')],queues[_0x5d1975['uniqueid']]['musiconholdstartAt']));}}catch(_0x39cb8f){utils['error'](util[_0x4a34('0x4')](_0x4a34('0x61'),_0x5d1975['uniqueid']),_0x39cb8f);}};exports[_0x4a34('0x63')]=function(_0x32dc7f){try{if(!_['isNil'](queues[_0x32dc7f[_0x4a34('0x6')]])){if(!_[_0x4a34('0x23')](queues[_0x32dc7f['uniqueid']][_0x4a34('0x64')])){utils[_0x4a34('0x18')](util[_0x4a34('0x4')](_0x4a34('0x65'),_0x32dc7f[_0x4a34('0x6')]),_0x32dc7f);queues[_0x32dc7f[_0x4a34('0x6')]]['mohtime']+=utils[_0x4a34('0x35')](utils[_0x4a34('0x15')](),queues[_0x32dc7f[_0x4a34('0x6')]][_0x4a34('0x64')]);utils[_0x4a34('0x3')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x32dc7f[_0x4a34('0x6')],queues[_0x32dc7f[_0x4a34('0x6')]][_0x4a34('0x1e')],queues[_0x32dc7f[_0x4a34('0x6')]][_0x4a34('0x59')]));delete queues[_0x32dc7f['uniqueid']][_0x4a34('0x64')];}}}catch(_0x5e2741){utils[_0x4a34('0x16')](util['format'](_0x4a34('0x65'),_0x32dc7f[_0x4a34('0x6')]),_0x5e2741);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 215c3a3..b284773 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 _0xdfb2=['then','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal'];(function(_0x17dc47,_0x46c533){var _0x158085=function(_0x44dda7){while(--_0x44dda7){_0x17dc47['push'](_0x17dc47['shift']());}};_0x158085(++_0x46c533);}(_0xdfb2,0x172));var _0x2dfb=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xdfb2[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x2dfb('0x0'));var util=require(_0x2dfb('0x1'));var utils=require(_0x2dfb('0x2'));var transfers=require(_0x2dfb('0x3'));var recordings={};function writeDB(_0x1a8347){var _0x12f612;utils['info'](util[_0x2dfb('0x4')]('[%s][recordings][writeDB]',_0x1a8347[_0x2dfb('0x5')]));if(transfers['blinds'][_0x1a8347[_0x2dfb('0x5')]]){_0x12f612=_0x1a8347[_0x2dfb('0x5')];_0x1a8347[_0x2dfb('0x5')]=transfers[_0x2dfb('0x6')][_0x1a8347[_0x2dfb('0x5')]][_0x2dfb('0x7')];}if(_0x1a8347[_0x2dfb('0x8')]){utils[_0x2dfb('0x9')](_0x1a8347['accountcode'])[_0x2dfb('0xa')](function(_0x928e6c){if(_0x928e6c){_0x1a8347[_0x2dfb('0xb')]=_0x928e6c[_0x2dfb('0xc')];_0x1a8347[_0x2dfb('0xd')]=_0x928e6c['id'];}utils['request'](_0x2dfb('0xe'),_0x1a8347);});}else{utils[_0x2dfb('0xf')](_0x2dfb('0xe'),_0x1a8347);}if(_0x12f612)delete transfers['blinds'][_0x12f612];}exports[_0x2dfb('0x10')]=function(_0x1935d7){try{utils[_0x2dfb('0x11')](util[_0x2dfb('0x4')](_0x2dfb('0x12'),_0x1935d7['uniqueid']),_0x1935d7);if(_0x1935d7[_0x2dfb('0x5')]==_0x1935d7[_0x2dfb('0x13')]){utils[_0x2dfb('0x14')](util[_0x2dfb('0x4')](_0x2dfb('0x15'),_0x1935d7[_0x2dfb('0x5')],_0x1935d7[_0x2dfb('0x16')],_0x1935d7['exten']));recordings[_0x1935d7[_0x2dfb('0x5')]]={'uniqueid':_0x1935d7[_0x2dfb('0x5')],'accountcode':_0x1935d7[_0x2dfb('0x8')],'exten':_0x1935d7[_0x2dfb('0x17')],'context':_0x1935d7['context'],'channel':_0x1935d7[_0x2dfb('0x18')],'monitors':[]};}}catch(_0x153182){utils[_0x2dfb('0x19')](util[_0x2dfb('0x4')](_0x2dfb('0x12'),_0x1935d7[_0x2dfb('0x5')]),_0x153182);}};exports[_0x2dfb('0x1a')]=function(_0x237524){try{utils[_0x2dfb('0x11')](util[_0x2dfb('0x4')](_0x2dfb('0x1b'),_0x237524[_0x2dfb('0x5')]),_0x237524);if(!_['isNil'](recordings[_0x237524['uniqueid']])&&_0x237524['channelstate']==0x6){utils[_0x2dfb('0x14')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x237524['uniqueid'],_0x237524[_0x2dfb('0x16')],_0x237524['channel']));}else if(!_[_0x2dfb('0x1c')](recordings[_0x237524[_0x2dfb('0x13')]])&&_0x237524['channelstate']==0x6&&_0x237524['context']!=_0x2dfb('0x1d')){utils[_0x2dfb('0x14')](util[_0x2dfb('0x4')](_0x2dfb('0x1e'),_0x237524[_0x2dfb('0x5')],_0x237524[_0x2dfb('0x13')],_0x237524[_0x2dfb('0x16')],_0x237524[_0x2dfb('0x18')]));recordings[_0x237524[_0x2dfb('0x13')]]['accountcode']=_0x237524[_0x2dfb('0x8')];}}catch(_0x47ff49){utils[_0x2dfb('0x19')](util[_0x2dfb('0x4')]('[%s][recordings][newstate]',_0x237524[_0x2dfb('0x5')]),_0x47ff49);}};exports[_0x2dfb('0x1f')]=function(_0x72533a){try{if(!_[_0x2dfb('0x1c')](_0x72533a[_0x2dfb('0x20')])&&!_['isNil'](_0x72533a[_0x2dfb('0x20')][_0x2dfb('0x21')])){utils[_0x2dfb('0x11')](util[_0x2dfb('0x4')](_0x2dfb('0x22'),_0x72533a['uniqueid']),_0x72533a);utils[_0x2dfb('0x14')](util[_0x2dfb('0x4')](_0x2dfb('0x23'),_0x72533a[_0x2dfb('0x5')],_0x72533a[_0x2dfb('0x20')],_0x72533a[_0x2dfb('0x24')]));if(_[_0x2dfb('0x25')](_0x72533a[_0x2dfb('0x24')],_0x2dfb('0x26'))){_0x72533a['value']=_0x72533a[_0x2dfb('0x24')][_0x2dfb('0x27')](_0x2dfb('0x26'),_0x2dfb('0x28'));}if(recordings[_0x72533a[_0x2dfb('0x13')]]){var _0x5a0d66=_[_0x2dfb('0x29')](recordings[_0x72533a['linkedid']][_0x2dfb('0x2a')],{'value':_0x72533a[_0x2dfb('0x24')]});if(_[_0x2dfb('0x1c')](_0x5a0d66)){recordings[_0x72533a[_0x2dfb('0x13')]][_0x2dfb('0x2a')][_0x2dfb('0x2b')]({'value':_0x72533a['value']});}}}}catch(_0x1212b2){utils[_0x2dfb('0x19')](util[_0x2dfb('0x4')]('[%s][recordings][varset]',_0x72533a[_0x2dfb('0x5')]),_0x1212b2);}};exports[_0x2dfb('0x2c')]=function(_0x30c747){try{if(!_[_0x2dfb('0x1c')](recordings[_0x30c747[_0x2dfb('0x5')]])){utils['debug'](util['format'](_0x2dfb('0x2d'),_0x30c747[_0x2dfb('0x5')]),_0x30c747);utils[_0x2dfb('0x14')](util['format'](_0x2dfb('0x2e'),_0x30c747[_0x2dfb('0x5')],_0x30c747['calleridnum'],_0x30c747[_0x2dfb('0x2f')],_0x30c747['cause-txt']));recordings[_0x30c747[_0x2dfb('0x5')]][_0x2dfb('0x30')]=_0x30c747[_0x2dfb('0x30')];recordings[_0x30c747[_0x2dfb('0x5')]][_0x2dfb('0x2f')]=_0x30c747[_0x2dfb('0x2f')];recordings[_0x30c747[_0x2dfb('0x5')]][_0x2dfb('0x31')]=_0x30c747[_0x2dfb('0x31')];recordings[_0x30c747[_0x2dfb('0x5')]]['connectedlinename']=_0x30c747[_0x2dfb('0x32')];if(recordings[_0x30c747[_0x2dfb('0x5')]][_0x2dfb('0x33')]==_0x2dfb('0x34')&&recordings[_0x30c747['uniqueid']]['accountcode']){recordings[_0x30c747[_0x2dfb('0x5')]]['connectedlinenum']=recordings[_0x30c747[_0x2dfb('0x5')]]['accountcode'];recordings[_0x30c747[_0x2dfb('0x5')]][_0x2dfb('0x32')]='';}recordings[_0x30c747['uniqueid']][_0x2dfb('0x2a')][_0x2dfb('0x35')](function(_0xf248b){var _0x13d0e7=_[_0x2dfb('0x36')](recordings[_0x30c747[_0x2dfb('0x5')]]);_0x13d0e7['value']=_0xf248b['value'];writeDB(_0x13d0e7);});delete recordings[_0x30c747['uniqueid']];}}catch(_0x4388e2){utils[_0x2dfb('0x19')](util['format']('[%s][recordings][hangup]',_0x30c747[_0x2dfb('0x5')]),_0x4388e2);}};exports['newexten']=function(_0x2cb629){try{if(!_[_0x2dfb('0x1c')](recordings[_0x2cb629['uniqueid']])){utils[_0x2dfb('0x11')](util['format'](_0x2dfb('0x37'),_0x2cb629[_0x2dfb('0x5')]),_0x2cb629);utils['info'](util[_0x2dfb('0x4')](_0x2dfb('0x38'),_0x2cb629[_0x2dfb('0x5')],_0x2cb629[_0x2dfb('0x39')],_0x2cb629[_0x2dfb('0x3a')]));if(_0x2cb629[_0x2dfb('0x39')][_0x2dfb('0x3b')]()==_0x2dfb('0x3c')&&_[_0x2dfb('0x3d')](_0x2cb629[_0x2dfb('0x3a')][_0x2dfb('0x3b')](),_0x2dfb('0x3e'))){var _0x125b3d=_0x2cb629[_0x2dfb('0x3a')]['split']('=');var _0x5710ab=_0x125b3d[0x0][_0x2dfb('0x3f')](_0x125b3d[0x0][_0x2dfb('0x40')]('(')+0x1,_0x125b3d[0x0]['lastIndexOf'](')'));var _0x5c4bd7=_0x125b3d[0x1];recordings[_0x2cb629['uniqueid']][_0x5710ab]=_0x5c4bd7;}}}catch(_0x5f3e0e){utils['error'](util[_0x2dfb('0x4')]('[%s][recordings][newexten]',_0x2cb629[_0x2dfb('0x5')]),_0x5f3e0e);}};exports['queuecallerjoin']=function(_0x2d5bc8){try{if(!_['isNil'](recordings[_0x2d5bc8[_0x2dfb('0x5')]])){utils[_0x2dfb('0x11')](util[_0x2dfb('0x4')]('[%s][recordings][queuecallerjoin]',_0x2d5bc8[_0x2dfb('0x5')]),_0x2d5bc8);utils[_0x2dfb('0x14')](util[_0x2dfb('0x4')](_0x2dfb('0x41'),_0x2d5bc8[_0x2dfb('0x5')],_0x2d5bc8[_0x2dfb('0x42')]));recordings[_0x2d5bc8[_0x2dfb('0x5')]][_0x2dfb('0x42')]=_0x2d5bc8['queue'];}}catch(_0x13e4fb){utils[_0x2dfb('0x19')](util['format']('[%s][recordings][queuecallerjoin]',_0x2d5bc8[_0x2dfb('0x5')]),_0x13e4fb);}};exports[_0x2dfb('0x43')]=function(_0x3c7fad){try{utils['debug'](util[_0x2dfb('0x4')](_0x2dfb('0x44'),_0x3c7fad['uniqueid']),_0x3c7fad);utils[_0x2dfb('0x14')](util['format'](_0x2dfb('0x45'),_0x3c7fad[_0x2dfb('0x5')],_0x3c7fad[_0x2dfb('0x46')],_0x3c7fad[_0x2dfb('0x47')],_0x3c7fad[_0x2dfb('0x48')],_0x3c7fad[_0x2dfb('0x49')]));if(recordings[_0x3c7fad[_0x2dfb('0x4a')]]&&transfers[_0x2dfb('0x6')][_0x3c7fad[_0x2dfb('0x4a')]]){transfers[_0x2dfb('0x6')][_0x3c7fad['transfereruniqueid']][_0x2dfb('0x4b')]=!![];}}catch(_0x2255a5){utils[_0x2dfb('0x19')](util['format']('[%s][recordings][blindtransfer]',_0x3c7fad[_0x2dfb('0x5')]),_0x2255a5);}}; \ No newline at end of file +var _0x8c1d=['lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','context','exten','channel','format','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','error','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','.wav49','value','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','cdr','split','substring'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x8c1d,0x9f));var _0xd8c1=function(_0x21273e,_0x29e20f){_0x21273e=_0x21273e-0x0;var _0x380679=_0x8c1d[_0x21273e];return _0x380679;};'use strict';var _=require(_0xd8c1('0x0'));var util=require('util');var utils=require(_0xd8c1('0x1'));var transfers=require(_0xd8c1('0x2'));var recordings={};function writeDB(_0x2fe631){var _0x206020;utils[_0xd8c1('0x3')](util['format'](_0xd8c1('0x4'),_0x2fe631[_0xd8c1('0x5')]));if(transfers[_0xd8c1('0x6')][_0x2fe631[_0xd8c1('0x5')]]){_0x206020=_0x2fe631['uniqueid'];_0x2fe631[_0xd8c1('0x5')]=transfers[_0xd8c1('0x6')][_0x2fe631['uniqueid']][_0xd8c1('0x7')];}if(_0x2fe631[_0xd8c1('0x8')]){utils[_0xd8c1('0x9')](_0x2fe631[_0xd8c1('0x8')])[_0xd8c1('0xa')](function(_0x2c9de2){if(_0x2c9de2){_0x2fe631['membername']=_0x2c9de2[_0xd8c1('0xb')];_0x2fe631[_0xd8c1('0xc')]=_0x2c9de2['id'];}utils[_0xd8c1('0xd')](_0xd8c1('0xe'),_0x2fe631);});}else{utils[_0xd8c1('0xd')](_0xd8c1('0xe'),_0x2fe631);}if(_0x206020)delete transfers[_0xd8c1('0x6')][_0x206020];}exports[_0xd8c1('0xf')]=function(_0xed860d){try{utils[_0xd8c1('0x10')](util['format'](_0xd8c1('0x11'),_0xed860d[_0xd8c1('0x5')]),_0xed860d);if(_0xed860d[_0xd8c1('0x5')]==_0xed860d['linkedid']){utils[_0xd8c1('0x3')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0xed860d['uniqueid'],_0xed860d[_0xd8c1('0x12')],_0xed860d[_0xd8c1('0x13')]));recordings[_0xed860d[_0xd8c1('0x5')]]={'uniqueid':_0xed860d[_0xd8c1('0x5')],'accountcode':_0xed860d[_0xd8c1('0x8')],'exten':_0xed860d[_0xd8c1('0x13')],'context':_0xed860d[_0xd8c1('0x12')],'channel':_0xed860d[_0xd8c1('0x14')],'monitors':[]};}}catch(_0x45a4eb){utils['error'](util[_0xd8c1('0x15')](_0xd8c1('0x11'),_0xed860d['uniqueid']),_0x45a4eb);}};exports[_0xd8c1('0x16')]=function(_0x57e0b7){try{utils[_0xd8c1('0x10')](util[_0xd8c1('0x15')](_0xd8c1('0x17'),_0x57e0b7[_0xd8c1('0x5')]),_0x57e0b7);if(!_[_0xd8c1('0x18')](recordings[_0x57e0b7[_0xd8c1('0x5')]])&&_0x57e0b7[_0xd8c1('0x19')]==0x6){utils[_0xd8c1('0x3')](util[_0xd8c1('0x15')](_0xd8c1('0x1a'),_0x57e0b7[_0xd8c1('0x5')],_0x57e0b7[_0xd8c1('0x12')],_0x57e0b7['channel']));}else if(!_[_0xd8c1('0x18')](recordings[_0x57e0b7[_0xd8c1('0x1b')]])&&_0x57e0b7[_0xd8c1('0x19')]==0x6&&_0x57e0b7[_0xd8c1('0x12')]!='transfer'){utils[_0xd8c1('0x3')](util[_0xd8c1('0x15')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x57e0b7[_0xd8c1('0x5')],_0x57e0b7[_0xd8c1('0x1b')],_0x57e0b7['context'],_0x57e0b7['channel']));recordings[_0x57e0b7[_0xd8c1('0x1b')]][_0xd8c1('0x8')]=_0x57e0b7[_0xd8c1('0x8')];}}catch(_0x5cea87){utils[_0xd8c1('0x1c')](util['format'](_0xd8c1('0x17'),_0x57e0b7[_0xd8c1('0x5')]),_0x5cea87);}};exports['varset']=function(_0x15ed40){try{if(!_[_0xd8c1('0x18')](_0x15ed40[_0xd8c1('0x1d')])&&!_[_0xd8c1('0x18')](_0x15ed40['variable'][_0xd8c1('0x1e')])){utils['debug'](util[_0xd8c1('0x15')](_0xd8c1('0x1f'),_0x15ed40[_0xd8c1('0x5')]),_0x15ed40);utils['info'](util['format'](_0xd8c1('0x20'),_0x15ed40[_0xd8c1('0x5')],_0x15ed40[_0xd8c1('0x1d')],_0x15ed40['value']));if(_[_0xd8c1('0x21')](_0x15ed40['value'],_0xd8c1('0x22'))){_0x15ed40[_0xd8c1('0x23')]=_0x15ed40[_0xd8c1('0x23')]['replace'](_0xd8c1('0x22'),'.WAV');}if(recordings[_0x15ed40[_0xd8c1('0x1b')]]){var _0x15cffc=_[_0xd8c1('0x24')](recordings[_0x15ed40[_0xd8c1('0x1b')]][_0xd8c1('0x25')],{'value':_0x15ed40[_0xd8c1('0x23')]});if(_[_0xd8c1('0x18')](_0x15cffc)){recordings[_0x15ed40[_0xd8c1('0x1b')]][_0xd8c1('0x25')]['push']({'value':_0x15ed40[_0xd8c1('0x23')]});}}}}catch(_0x2122fb){utils[_0xd8c1('0x1c')](util['format']('[%s][recordings][varset]',_0x15ed40['uniqueid']),_0x2122fb);}};exports[_0xd8c1('0x26')]=function(_0x1c3a71){try{if(!_[_0xd8c1('0x18')](recordings[_0x1c3a71['uniqueid']])){utils[_0xd8c1('0x10')](util[_0xd8c1('0x15')]('[%s][recordings][hangup]',_0x1c3a71['uniqueid']),_0x1c3a71);utils[_0xd8c1('0x3')](util[_0xd8c1('0x15')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1c3a71[_0xd8c1('0x5')],_0x1c3a71['calleridnum'],_0x1c3a71['calleridname'],_0x1c3a71['cause-txt']));recordings[_0x1c3a71['uniqueid']][_0xd8c1('0x27')]=_0x1c3a71[_0xd8c1('0x27')];recordings[_0x1c3a71[_0xd8c1('0x5')]][_0xd8c1('0x28')]=_0x1c3a71['calleridname'];recordings[_0x1c3a71[_0xd8c1('0x5')]]['connectedlinenum']=_0x1c3a71[_0xd8c1('0x29')];recordings[_0x1c3a71[_0xd8c1('0x5')]]['connectedlinename']=_0x1c3a71[_0xd8c1('0x2a')];if(recordings[_0x1c3a71['uniqueid']][_0xd8c1('0x2b')]==_0xd8c1('0x2c')&&recordings[_0x1c3a71[_0xd8c1('0x5')]][_0xd8c1('0x8')]){recordings[_0x1c3a71[_0xd8c1('0x5')]]['connectedlinenum']=recordings[_0x1c3a71[_0xd8c1('0x5')]][_0xd8c1('0x8')];recordings[_0x1c3a71[_0xd8c1('0x5')]][_0xd8c1('0x2a')]='';}recordings[_0x1c3a71[_0xd8c1('0x5')]][_0xd8c1('0x25')][_0xd8c1('0x2d')](function(_0x3381a8){var _0x1a8021=_[_0xd8c1('0x2e')](recordings[_0x1c3a71[_0xd8c1('0x5')]]);_0x1a8021[_0xd8c1('0x23')]=_0x3381a8[_0xd8c1('0x23')];writeDB(_0x1a8021);});delete recordings[_0x1c3a71['uniqueid']];}}catch(_0x5b5dca){utils['error'](util[_0xd8c1('0x15')](_0xd8c1('0x2f'),_0x1c3a71[_0xd8c1('0x5')]),_0x5b5dca);}};exports[_0xd8c1('0x30')]=function(_0x136ed1){try{if(!_['isNil'](recordings[_0x136ed1[_0xd8c1('0x5')]])){utils[_0xd8c1('0x10')](util[_0xd8c1('0x15')]('[%s][recordings][newexten]',_0x136ed1['uniqueid']),_0x136ed1);utils[_0xd8c1('0x3')](util[_0xd8c1('0x15')](_0xd8c1('0x31'),_0x136ed1[_0xd8c1('0x5')],_0x136ed1['application'],_0x136ed1[_0xd8c1('0x32')]));if(_0x136ed1[_0xd8c1('0x33')]['toLowerCase']()==_0xd8c1('0x34')&&_[_0xd8c1('0x35')](_0x136ed1[_0xd8c1('0x32')]['toLowerCase'](),_0xd8c1('0x36'))){var _0x32cb15=_0x136ed1[_0xd8c1('0x32')][_0xd8c1('0x37')]('=');var _0x516907=_0x32cb15[0x0][_0xd8c1('0x38')](_0x32cb15[0x0][_0xd8c1('0x39')]('(')+0x1,_0x32cb15[0x0][_0xd8c1('0x39')](')'));var _0x52929a=_0x32cb15[0x1];recordings[_0x136ed1[_0xd8c1('0x5')]][_0x516907]=_0x52929a;}}}catch(_0x2725d2){utils[_0xd8c1('0x1c')](util['format'](_0xd8c1('0x3a'),_0x136ed1[_0xd8c1('0x5')]),_0x2725d2);}};exports[_0xd8c1('0x3b')]=function(_0x4a04b3){try{if(!_[_0xd8c1('0x18')](recordings[_0x4a04b3[_0xd8c1('0x5')]])){utils['debug'](util[_0xd8c1('0x15')](_0xd8c1('0x3c'),_0x4a04b3[_0xd8c1('0x5')]),_0x4a04b3);utils[_0xd8c1('0x3')](util[_0xd8c1('0x15')](_0xd8c1('0x3d'),_0x4a04b3[_0xd8c1('0x5')],_0x4a04b3[_0xd8c1('0x3e')]));recordings[_0x4a04b3[_0xd8c1('0x5')]][_0xd8c1('0x3e')]=_0x4a04b3[_0xd8c1('0x3e')];}}catch(_0x24aefd){utils[_0xd8c1('0x1c')](util[_0xd8c1('0x15')]('[%s][recordings][queuecallerjoin]',_0x4a04b3[_0xd8c1('0x5')]),_0x24aefd);}};exports[_0xd8c1('0x3f')]=function(_0x4c8c5a){try{utils['debug'](util['format'](_0xd8c1('0x40'),_0x4c8c5a[_0xd8c1('0x5')]),_0x4c8c5a);utils['info'](util[_0xd8c1('0x15')](_0xd8c1('0x41'),_0x4c8c5a['uniqueid'],_0x4c8c5a[_0xd8c1('0x42')],_0x4c8c5a[_0xd8c1('0x43')],_0x4c8c5a[_0xd8c1('0x44')],_0x4c8c5a[_0xd8c1('0x45')]));if(recordings[_0x4c8c5a[_0xd8c1('0x46')]]&&transfers[_0xd8c1('0x6')][_0x4c8c5a[_0xd8c1('0x46')]]){transfers[_0xd8c1('0x6')][_0x4c8c5a[_0xd8c1('0x46')]][_0xd8c1('0x47')]=!![];}}catch(_0x2fc2bc){utils['error'](util[_0xd8c1('0x15')](_0xd8c1('0x40'),_0x4c8c5a['uniqueid']),_0x2fc2bc);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index b66106f..e8ee2dd 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 _0x9bd1=['transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename'];(function(_0x55f3ef,_0x14a620){var _0x4070a4=function(_0x20d9a8){while(--_0x20d9a8){_0x55f3ef['push'](_0x55f3ef['shift']());}};_0x4070a4(++_0x14a620);}(_0x9bd1,0xe0));var _0x19bd=function(_0x596d20,_0x54e3e6){_0x596d20=_0x596d20-0x0;var _0x256e91=_0x9bd1[_0x596d20];return _0x256e91;};'use strict';var _=require('lodash');var util=require(_0x19bd('0x0'));var utils=require(_0x19bd('0x1'));function writeDB(_0x137c3e){utils[_0x19bd('0x2')](util[_0x19bd('0x3')](_0x19bd('0x4'),_0x137c3e[_0x19bd('0x5')]===_0x19bd('0x6')?_0x137c3e[_0x19bd('0x7')]:_0x137c3e['uniqueid'],_0x137c3e[_0x19bd('0x5')]));utils[_0x19bd('0x8')](_0x19bd('0x9'),_0x137c3e);}exports[_0x19bd('0xa')]={};exports[_0x19bd('0xb')]=function(_0xe49a40){try{utils[_0x19bd('0xc')](util[_0x19bd('0x3')]('[%s][transfers][blindtransfer]',_0xe49a40[_0x19bd('0xd')]),_0xe49a40);utils[_0x19bd('0x2')](util[_0x19bd('0x3')](_0x19bd('0xe'),_0xe49a40[_0x19bd('0xd')],_0xe49a40[_0x19bd('0xf')],_0xe49a40['transferercalleridname'],_0xe49a40[_0x19bd('0x10')],_0xe49a40[_0x19bd('0x11')]));_0xe49a40[_0x19bd('0x5')]=_0x19bd('0x12');exports[_0x19bd('0xa')][_0xe49a40['transfereruniqueid']]=_0xe49a40;writeDB(_0xe49a40);}catch(_0x17d5dc){utils[_0x19bd('0x13')](util[_0x19bd('0x3')](_0x19bd('0x14'),_0xe49a40['uniqueid']),_0x17d5dc);}};exports[_0x19bd('0x15')]=function(_0x41a2e2){try{utils[_0x19bd('0xc')](util[_0x19bd('0x3')](_0x19bd('0x16'),_0x41a2e2[_0x19bd('0x7')]),_0x41a2e2);utils['info'](util[_0x19bd('0x3')](_0x19bd('0x17'),_0x41a2e2[_0x19bd('0x7')],_0x41a2e2[_0x19bd('0x18')],_0x41a2e2[_0x19bd('0x19')],_0x41a2e2['transfertargetcalleridnum'],_0x41a2e2[_0x19bd('0x1a')]));_0x41a2e2=_[_0x19bd('0x1b')](_0x41a2e2,{'transfererchannel':_0x41a2e2[_0x19bd('0x1c')],'transferercalleridnum':_0x41a2e2[_0x19bd('0x18')],'transferercalleridname':_0x41a2e2[_0x19bd('0x19')],'transfererconnectedlinenum':_0x41a2e2[_0x19bd('0x1d')],'transfererconnectedlinename':_0x41a2e2['secondtransfererconnectedlinename'],'transfereraccountcode':_0x41a2e2[_0x19bd('0x1e')],'transferercontext':_0x41a2e2[_0x19bd('0x1f')],'transfererexten':_0x41a2e2['secondtransfererexten'],'transfererlinkedid':_0x41a2e2['origtransfererlinkedid'],'context':_0x41a2e2[_0x19bd('0x20')],'extension':_0x41a2e2[_0x19bd('0x21')],'type':'attended'});if(_[_0x19bd('0x22')](_0x41a2e2[_0x19bd('0x23')])){_0x41a2e2=_[_0x19bd('0x1b')](_0x41a2e2,{'transfereechannel':_0x41a2e2[_0x19bd('0x24')],'transfereecalleridnum':_0x41a2e2[_0x19bd('0x25')],'transfereecalleridname':_0x41a2e2[_0x19bd('0x1a')],'transfereeconnectedlinenum':_0x41a2e2[_0x19bd('0x26')],'transfereeconnectedlinename':_0x41a2e2[_0x19bd('0x27')],'transfereeaccountcode':_0x41a2e2[_0x19bd('0x28')],'transfereecontext':_0x41a2e2[_0x19bd('0x29')],'transfereeexten':_0x41a2e2[_0x19bd('0x2a')],'transfereelinkedid':_0x41a2e2[_0x19bd('0x2b')]});}writeDB(_0x41a2e2);}catch(_0x404a98){utils[_0x19bd('0x13')](util[_0x19bd('0x3')]('[%s][transfers][attendedtransfer]',_0x41a2e2[_0x19bd('0x7')]),_0x404a98);}}; \ No newline at end of file +var _0x68ac=['info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','./utils','format','type','attended','origtransfereruniqueid','uniqueid','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]'];(function(_0x5d8fa1,_0x48f172){var _0x53a280=function(_0x256d98){while(--_0x256d98){_0x5d8fa1['push'](_0x5d8fa1['shift']());}};_0x53a280(++_0x48f172);}(_0x68ac,0xff));var _0xc68a=function(_0x3a0a03,_0x2657d1){_0x3a0a03=_0x3a0a03-0x0;var _0x691edc=_0x68ac[_0x3a0a03];return _0x691edc;};'use strict';var _=require(_0xc68a('0x0'));var util=require('util');var utils=require(_0xc68a('0x1'));function writeDB(_0x1ef6eb){utils['info'](util[_0xc68a('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x1ef6eb[_0xc68a('0x3')]===_0xc68a('0x4')?_0x1ef6eb[_0xc68a('0x5')]:_0x1ef6eb[_0xc68a('0x6')],_0x1ef6eb[_0xc68a('0x3')]));utils['request']('CreateVoiceTransferReport',_0x1ef6eb);}exports[_0xc68a('0x7')]={};exports[_0xc68a('0x8')]=function(_0x268e02){try{utils[_0xc68a('0x9')](util[_0xc68a('0x2')](_0xc68a('0xa'),_0x268e02[_0xc68a('0x6')]),_0x268e02);utils[_0xc68a('0xb')](util[_0xc68a('0x2')](_0xc68a('0xc'),_0x268e02['uniqueid'],_0x268e02[_0xc68a('0xd')],_0x268e02['transferercalleridname'],_0x268e02['transfereecalleridnum'],_0x268e02[_0xc68a('0xe')]));_0x268e02[_0xc68a('0x3')]=_0xc68a('0xf');exports[_0xc68a('0x7')][_0x268e02[_0xc68a('0x10')]]=_0x268e02;writeDB(_0x268e02);}catch(_0x3efdf4){utils[_0xc68a('0x11')](util[_0xc68a('0x2')](_0xc68a('0xa'),_0x268e02[_0xc68a('0x6')]),_0x3efdf4);}};exports[_0xc68a('0x12')]=function(_0x6c9298){try{utils[_0xc68a('0x9')](util[_0xc68a('0x2')]('[%s][transfers][attendedtransfer]',_0x6c9298[_0xc68a('0x5')]),_0x6c9298);utils[_0xc68a('0xb')](util[_0xc68a('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x6c9298[_0xc68a('0x5')],_0x6c9298[_0xc68a('0x13')],_0x6c9298[_0xc68a('0x14')],_0x6c9298[_0xc68a('0x15')],_0x6c9298[_0xc68a('0x16')]));_0x6c9298=_[_0xc68a('0x17')](_0x6c9298,{'transfererchannel':_0x6c9298[_0xc68a('0x18')],'transferercalleridnum':_0x6c9298[_0xc68a('0x13')],'transferercalleridname':_0x6c9298[_0xc68a('0x14')],'transfererconnectedlinenum':_0x6c9298[_0xc68a('0x19')],'transfererconnectedlinename':_0x6c9298[_0xc68a('0x1a')],'transfereraccountcode':_0x6c9298['origtransfereraccountcode'],'transferercontext':_0x6c9298['secondtransferercontext'],'transfererexten':_0x6c9298['secondtransfererexten'],'transfererlinkedid':_0x6c9298[_0xc68a('0x1b')],'context':_0x6c9298[_0xc68a('0x1c')],'extension':_0x6c9298[_0xc68a('0x1d')],'type':_0xc68a('0x4')});if(_['isNil'](_0x6c9298[_0xc68a('0x1e')])){_0x6c9298=_[_0xc68a('0x17')](_0x6c9298,{'transfereechannel':_0x6c9298[_0xc68a('0x1f')],'transfereecalleridnum':_0x6c9298['transfertargetcalleridnum'],'transfereecalleridname':_0x6c9298[_0xc68a('0x16')],'transfereeconnectedlinenum':_0x6c9298[_0xc68a('0x20')],'transfereeconnectedlinename':_0x6c9298[_0xc68a('0x21')],'transfereeaccountcode':_0x6c9298[_0xc68a('0x22')],'transfereecontext':_0x6c9298['transfertargetcontext'],'transfereeexten':_0x6c9298[_0xc68a('0x23')],'transfereelinkedid':_0x6c9298[_0xc68a('0x24')]});}writeDB(_0x6c9298);}catch(_0x45026b){utils[_0xc68a('0x11')](util[_0xc68a('0x2')](_0xc68a('0x25'),_0x6c9298[_0xc68a('0x5')]),_0x45026b);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index ee3651e..55cf8c8 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 _0xe5f6=['isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','getUserByInterface','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','now','isAfter'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0xe5f6,0xbd));var _0x6e5f=function(_0x399ca1,_0x465152){_0x399ca1=_0x399ca1-0x0;var _0x231a90=_0xe5f6[_0x399ca1];return _0x231a90;};'use strict';var BPromise=require(_0x6e5f('0x0'));var jayson=require(_0x6e5f('0x1'));var moment=require('moment');var util=require(_0x6e5f('0x2'));var client=jayson[_0x6e5f('0x3')][_0x6e5f('0x4')]({'port':0x2329});var logger=require(_0x6e5f('0x5'))('xdr');exports[_0x6e5f('0x6')]=function(_0x52017c,_0x242d48){logger[_0x6e5f('0x6')](_0x52017c,_0x242d48?util[_0x6e5f('0x7')](_0x242d48,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x52e02b,_0xe7281f){logger[_0x6e5f('0x8')](_0x52e02b,_0xe7281f?util['inspect'](_0xe7281f,{'showHidden':![],'depth':null}):'');};exports[_0x6e5f('0x9')]=function(_0x1302b9,_0x278faa){logger[_0x6e5f('0x9')](_0x1302b9,_0x278faa?util[_0x6e5f('0x7')](_0x278faa,{'showHidden':![],'depth':null}):'');};exports[_0x6e5f('0xa')]=function(_0x55fe3a,_0x597826){return client['request'](_0x55fe3a,{'body':_0x597826})[_0x6e5f('0xb')](function(_0x21484b){logger[_0x6e5f('0x8')](_0x6e5f('0xc'),_0x55fe3a,_0x21484b?util[_0x6e5f('0x7')](_0x21484b,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x4bc395){logger[_0x6e5f('0x9')]('[utils][request]\x20name:%s',_0x55fe3a,_0x4bc395?util['inspect'](_0x4bc395,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3a9fc2){return client[_0x6e5f('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x6e5f('0xd'),_0x6e5f('0xe'),_0x6e5f('0xf')],'where':_0x3a9fc2,'limit':0x1}})['then'](function(_0x3ecfed){logger[_0x6e5f('0x8')](_0x6e5f('0x10'),JSON[_0x6e5f('0x11')](_0x3a9fc2),_0x3ecfed?util[_0x6e5f('0x7')](_0x3ecfed,{'showHidden':![],'depth':null}):'');return _0x3ecfed[_0x6e5f('0x12')][_0x6e5f('0x13')]?_0x3ecfed[_0x6e5f('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x3f9472){return new BPromise(function(_0x2bf48b,_0x54b356){if(_0x3f9472){return getUser({'internal':_0x3f9472})[_0x6e5f('0xb')](function(_0x30512f){logger[_0x6e5f('0x6')](_0x6e5f('0x14'),_0x3f9472,_0x30512f?_0x6e5f('0x15'):'notfound');return _0x2bf48b(_0x30512f);})[_0x6e5f('0x16')](function(_0x224ef0){logger[_0x6e5f('0x9')]('[utils][getUserByInternal]',_0x224ef0?util[_0x6e5f('0x7')](_0x224ef0,{'showHidden':![],'depth':null}):'');return _0x2bf48b(null);});}return _0x2bf48b(null);});};exports[_0x6e5f('0x17')]=function(_0x598f8f){return new BPromise(function(_0x302ace,_0x2e13bb){if(_0x598f8f){return getUser({'interface':_0x598f8f})[_0x6e5f('0xb')](function(_0x4905c6){logger[_0x6e5f('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x598f8f,_0x4905c6?_0x6e5f('0x15'):_0x6e5f('0x18'));return _0x302ace(_0x4905c6);})[_0x6e5f('0x16')](function(_0x413efc){logger[_0x6e5f('0x9')](_0x6e5f('0x19'),_0x413efc?util[_0x6e5f('0x7')](_0x413efc,{'showHidden':![],'depth':null}):'');return _0x302ace(null);});}return _0x302ace(null);});};exports[_0x6e5f('0x1a')]=function(_0x3857ce){return new BPromise(function(_0x1b416c,_0x559d6f){if(_0x3857ce){return getUser({'name':_0x3857ce})[_0x6e5f('0xb')](function(_0x3b7834){logger[_0x6e5f('0x6')](_0x6e5f('0x1b'),_0x3857ce,_0x3b7834?_0x6e5f('0x15'):_0x6e5f('0x18'));return _0x1b416c(_0x3b7834);})[_0x6e5f('0x16')](function(_0x2df30e){logger[_0x6e5f('0x9')](_0x6e5f('0x1c'),_0x2df30e?util['inspect'](_0x2df30e,{'showHidden':![],'depth':null}):'');return _0x1b416c(null);});}return _0x1b416c(null);});};exports[_0x6e5f('0x1d')]=function(_0x22fd4a){return new BPromise(function(_0x5ec088,_0x1685f3){if(_0x22fd4a){return client['request'](_0x6e5f('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x6e5f('0xe'),_0x6e5f('0x1f'),_0x6e5f('0x20'),_0x6e5f('0x21')],'where':{'name':_0x22fd4a},'limit':0x1}})[_0x6e5f('0xb')](function(_0xb2a2a8){logger[_0x6e5f('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x22fd4a,_0xb2a2a8?util[_0x6e5f('0x7')](_0xb2a2a8,{'showHidden':![],'depth':null}):'');logger[_0x6e5f('0x6')](_0x6e5f('0x22'),_0x22fd4a,_0xb2a2a8?_0x6e5f('0x15'):'notfound');return _0x5ec088(_0xb2a2a8[_0x6e5f('0x12')]['length']?_0xb2a2a8[_0x6e5f('0x12')][0x0]:null);})[_0x6e5f('0x16')](function(_0x383897){logger[_0x6e5f('0x9')]('[utils][getVoiceQueueByName]',_0x383897?util[_0x6e5f('0x7')](_0x383897,{'showHidden':![],'depth':null}):'');return _0x5ec088(null);});}return _0x5ec088(null);});};exports[_0x6e5f('0x23')]=function(_0x658bd4,_0x4320b2){return moment(_0x658bd4)[_0x6e5f('0x24')](_0x4320b2,_0x6e5f('0x25'))[_0x6e5f('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x6e5f('0x27')]=function(_0x506675,_0x14732b){return moment(_0x506675)[_0x6e5f('0x28')](_0x14732b,'seconds')[_0x6e5f('0x26')](_0x6e5f('0x29'));};exports[_0x6e5f('0x2a')]=function(_0x1004f3,_0x184be1){return moment(_0x1004f3)['diff'](moment(_0x184be1),_0x6e5f('0x25'));};exports[_0x6e5f('0x2b')]=function(_0x24ac39,_0x101c02){return parseInt(_0x24ac39,0xa)+parseInt(_0x101c02,0xa);};exports[_0x6e5f('0x2c')]=function(){return moment()[_0x6e5f('0x26')](_0x6e5f('0x29'));};exports[_0x6e5f('0x2d')]=function(_0x34294d,_0x3c9783){if(_0x3c9783){return moment(_0x34294d)[_0x6e5f('0x2d')](_0x3c9783);}return!![];};exports[_0x6e5f('0x2e')]=function(_0xc69b86,_0x3646df){if(_0x3646df){return moment(_0xc69b86)[_0x6e5f('0x2e')](_0x3646df);}else if(_0xc69b86){return!![];}return![];}; \ No newline at end of file +var _0x340b=['format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','xdr','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify','result','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds'];(function(_0x3f76ca,_0x1f9e82){var _0x235c62=function(_0x4a32f2){while(--_0x4a32f2){_0x3f76ca['push'](_0x3f76ca['shift']());}};_0x235c62(++_0x1f9e82);}(_0x340b,0x1b6));var _0xb340=function(_0x2b708f,_0x2ec20c){_0x2b708f=_0x2b708f-0x0;var _0x53e16d=_0x340b[_0x2b708f];return _0x53e16d;};'use strict';var BPromise=require(_0xb340('0x0'));var jayson=require(_0xb340('0x1'));var moment=require(_0xb340('0x2'));var util=require(_0xb340('0x3'));var client=jayson['client']['http']({'port':0x2329});var logger=require('../../config/logger')(_0xb340('0x4'));exports['info']=function(_0x25a9b4,_0x1a7822){logger[_0xb340('0x5')](_0x25a9b4,_0x1a7822?util['inspect'](_0x1a7822,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x3edcb9,_0x2e154c){logger['debug'](_0x3edcb9,_0x2e154c?util[_0xb340('0x6')](_0x2e154c,{'showHidden':![],'depth':null}):'');};exports[_0xb340('0x7')]=function(_0x234601,_0x216f22){logger[_0xb340('0x7')](_0x234601,_0x216f22?util['inspect'](_0x216f22,{'showHidden':![],'depth':null}):'');};exports[_0xb340('0x8')]=function(_0x52f0ae,_0x244695){return client[_0xb340('0x8')](_0x52f0ae,{'body':_0x244695})[_0xb340('0x9')](function(_0x5e55f1){logger[_0xb340('0xa')](_0xb340('0xb'),_0x52f0ae,_0x5e55f1?util[_0xb340('0x6')](_0x5e55f1,{'showHidden':![],'depth':null}):'');})[_0xb340('0xc')](function(_0x100069){logger[_0xb340('0x7')](_0xb340('0xb'),_0x52f0ae,_0x100069?util[_0xb340('0x6')](_0x100069,{'showHidden':![],'depth':null}):'');});};function getUser(_0x470b00){return client[_0xb340('0x8')](_0xb340('0xd'),{'options':{'raw':!![],'attributes':['id',_0xb340('0xe'),'name',_0xb340('0xf')],'where':_0x470b00,'limit':0x1}})[_0xb340('0x9')](function(_0x18dd75){logger[_0xb340('0xa')](_0xb340('0x10'),JSON[_0xb340('0x11')](_0x470b00),_0x18dd75?util['inspect'](_0x18dd75,{'showHidden':![],'depth':null}):'');return _0x18dd75[_0xb340('0x12')]['length']?_0x18dd75['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x33a5fe){return new BPromise(function(_0x5ae931,_0xebe2eb){if(_0x33a5fe){return getUser({'internal':_0x33a5fe})['then'](function(_0x4f35a0){logger[_0xb340('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x33a5fe,_0x4f35a0?'found':_0xb340('0x13'));return _0x5ae931(_0x4f35a0);})[_0xb340('0xc')](function(_0x126549){logger['error'](_0xb340('0x14'),_0x126549?util[_0xb340('0x6')](_0x126549,{'showHidden':![],'depth':null}):'');return _0x5ae931(null);});}return _0x5ae931(null);});};exports['getUserByInterface']=function(_0x5453ad){return new BPromise(function(_0x1480ab,_0x536518){if(_0x5453ad){return getUser({'interface':_0x5453ad})[_0xb340('0x9')](function(_0x58baa9){logger[_0xb340('0x5')](_0xb340('0x15'),_0x5453ad,_0x58baa9?_0xb340('0x16'):_0xb340('0x13'));return _0x1480ab(_0x58baa9);})[_0xb340('0xc')](function(_0x3fe2ff){logger[_0xb340('0x7')](_0xb340('0x17'),_0x3fe2ff?util[_0xb340('0x6')](_0x3fe2ff,{'showHidden':![],'depth':null}):'');return _0x1480ab(null);});}return _0x1480ab(null);});};exports[_0xb340('0x18')]=function(_0x1079a8){return new BPromise(function(_0x575d51,_0x392d00){if(_0x1079a8){return getUser({'name':_0x1079a8})['then'](function(_0x2ad4da){logger[_0xb340('0x5')](_0xb340('0x19'),_0x1079a8,_0x2ad4da?_0xb340('0x16'):_0xb340('0x13'));return _0x575d51(_0x2ad4da);})[_0xb340('0xc')](function(_0x571269){logger[_0xb340('0x7')]('[utils][getUserByName]',_0x571269?util[_0xb340('0x6')](_0x571269,{'showHidden':![],'depth':null}):'');return _0x575d51(null);});}return _0x575d51(null);});};exports[_0xb340('0x1a')]=function(_0x22e7e0){return new BPromise(function(_0x2cccd4,_0x961780){if(_0x22e7e0){return client[_0xb340('0x8')](_0xb340('0x1b'),{'options':{'raw':!![],'attributes':['id','name',_0xb340('0x1c'),_0xb340('0x1d'),_0xb340('0x1e')],'where':{'name':_0x22e7e0},'limit':0x1}})['then'](function(_0x196360){logger[_0xb340('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x22e7e0,_0x196360?util['inspect'](_0x196360,{'showHidden':![],'depth':null}):'');logger[_0xb340('0x5')](_0xb340('0x1f'),_0x22e7e0,_0x196360?_0xb340('0x16'):_0xb340('0x13'));return _0x2cccd4(_0x196360[_0xb340('0x12')]['length']?_0x196360[_0xb340('0x12')][0x0]:null);})['catch'](function(_0x2cb807){logger[_0xb340('0x7')](_0xb340('0x20'),_0x2cb807?util[_0xb340('0x6')](_0x2cb807,{'showHidden':![],'depth':null}):'');return _0x2cccd4(null);});}return _0x2cccd4(null);});};exports[_0xb340('0x21')]=function(_0x282ee6,_0x1627c8){return moment(_0x282ee6)['add'](_0x1627c8,_0xb340('0x22'))[_0xb340('0x23')](_0xb340('0x24'));};exports[_0xb340('0x25')]=function(_0x4f919f,_0x10187c){return moment(_0x4f919f)[_0xb340('0x26')](_0x10187c,_0xb340('0x22'))['format'](_0xb340('0x24'));};exports[_0xb340('0x27')]=function(_0x19177a,_0x541280){return moment(_0x19177a)['diff'](moment(_0x541280),'seconds');};exports['sumTime']=function(_0x3b153d,_0x15ebde){return parseInt(_0x3b153d,0xa)+parseInt(_0x15ebde,0xa);};exports[_0xb340('0x28')]=function(){return moment()[_0xb340('0x23')](_0xb340('0x24'));};exports['isAfter']=function(_0x37b3f8,_0x439f43){if(_0x439f43){return moment(_0x37b3f8)[_0xb340('0x29')](_0x439f43);}return!![];};exports[_0xb340('0x2a')]=function(_0x3e91c5,_0x2c81b0){if(_0x2c81b0){return moment(_0x3e91c5)[_0xb340('0x2a')](_0x2c81b0);}else if(_0x3e91c5){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 8d04cdf..dcef53f 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 _0xcc7a=['isEmpty','body','\x20body=%s','format','method','x-forwarded-for','remoteAddress','url','inspect','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)','headers','connection','statusCode','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','fileLogger','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','data','timestamp','error','api','auth','set','use','logger'];(function(_0x1e4a8d,_0x466fab){var _0x514865=function(_0x5b0ce6){while(--_0x5b0ce6){_0x1e4a8d['push'](_0x1e4a8d['shift']());}};_0x514865(++_0x466fab);}(_0xcc7a,0x9a));var _0xacc7=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xcc7a[_0x453e2b];return _0x50f306;};var fs=require(_0xacc7('0x0'));var _=require(_0xacc7('0x1'));var ewinston=require(_0xacc7('0x2'));var path=require(_0xacc7('0x3'));var util=require('util');var fileLogger=require(_0xacc7('0x4'))[_0xacc7('0x5')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0xacc7('0x6')];function ClientSideLogger(){function _0x2e18cb(_0x54a7dd){var _0xc8905a=path[_0xacc7('0x7')](_0xacc7('0x8'),_0xacc7('0x9'),_0xacc7('0xa'));var _0x1ff473=path[_0xacc7('0x7')](_0xacc7('0xb'),_0x54a7dd[_0xacc7('0xc')]+'-'+_0x54a7dd[_0xacc7('0xd')]);return fs[_0xacc7('0xe')](path[_0xacc7('0x7')](_0xc8905a,_0x1ff473))[_0xacc7('0xf')](function(){var _0x3a6b46=fileLogger('client',path['join'](_0xc8905a,_0x1ff473));return _0x3a6b46;})[_0xacc7('0x10')](function(_0x2ef0f4){throw _0x2ef0f4;});}this[_0xacc7('0x9')]=function(_0x517fed,_0x29a873,_0x385b19,_0x13777f){return _0x2e18cb(_0x517fed[_0xacc7('0x11')])[_0xacc7('0xf')](function(_0x22b3f2){var _0x24a75d=_0x22b3f2[_0x29a873];return _0x24a75d;})[_0xacc7('0xf')](function(_0x312024){var _0x170335=_0x517fed[_0xacc7('0x11')]?_0x517fed[_0xacc7('0x11')]['id']:'no-user';var _0x441555=_0x13777f[_0xacc7('0x12')];var _0x102082=_0x13777f[_0xacc7('0x13')];var _0x2d5e01=new Date(Number(_0x102082));return _0x312024(_0x170335,_0x2d5e01,_0x385b19,_0x441555);})[_0xacc7('0x10')](function(_0x58d3c6){fileLogger('client')[_0xacc7('0x14')](_0x58d3c6);});};}function setupLoggers(_0x419173){return new Promise(function(_0x159184){var _0x70e136=new ClientSideLogger();var _0x350316=fileLogger(_0xacc7('0x15'));var _0x3b9524=fileLogger(_0xacc7('0x16'));_0x419173[_0xacc7('0x17')]('client-side-logger',_0x70e136);_0x419173[_0xacc7('0x18')](ewinston[_0xacc7('0x19')]({'winstonInstance':_0x350316,'meta':![],'statusLevels':!![],'msg':function(_0x242f3b,_0x4a9e80){var _0x21ab71='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xacc7('0x1a')](_0x242f3b[_0xacc7('0x1b')])){_0x21ab71+=_0xacc7('0x1c');var _0x20496c=_0x242f3b[_0xacc7('0x1b')];maskSensitiveData(_0x20496c);}return safeTemplate(util[_0xacc7('0x1d')](_0x21ab71,_0x242f3b[_0xacc7('0x1e')],_0x242f3b['headers'][_0xacc7('0x1f')]?_0x242f3b['headers'][_0xacc7('0x1f')]:_0x242f3b['connection'][_0xacc7('0x20')]||_0x242f3b['ip'],_0x242f3b[_0xacc7('0x21')],_0x4a9e80['statusCode'],_0x4a9e80['responseTime'],_0x242f3b['user']?_0x242f3b[_0xacc7('0x11')]['id']:null,_0x242f3b[_0xacc7('0x11')]?_0x242f3b[_0xacc7('0x11')]['name']:null,_0x242f3b[_0xacc7('0x11')]?_0x242f3b[_0xacc7('0x11')][_0xacc7('0xc')]:null,_0x20496c?util[_0xacc7('0x22')](_0x20496c,![],null):''));}}));_0x419173[_0xacc7('0x18')](ewinston[_0xacc7('0x19')]({'winstonInstance':_0x3b9524,'meta':![],'statusLevels':!![],'msg':function(_0x5cbc0a,_0x10515a){var _0x270530='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x5cbc0a[_0xacc7('0x1b')]&&_0x5cbc0a['body'][_0xacc7('0x23')]&&_0x5cbc0a[_0xacc7('0x1b')][_0xacc7('0x24')]){_0x270530=_0xacc7('0x25');}return util[_0xacc7('0x1d')](_0x270530,_0x5cbc0a['method'],_0x5cbc0a[_0xacc7('0x26')]['x-forwarded-for']?_0x5cbc0a[_0xacc7('0x26')][_0xacc7('0x1f')]:_0x5cbc0a[_0xacc7('0x27')][_0xacc7('0x20')]||_0x5cbc0a['ip'],_0x5cbc0a[_0xacc7('0x21')],_0x10515a[_0xacc7('0x28')],_0x10515a['responseTime'],_0x5cbc0a['user']?_0x5cbc0a[_0xacc7('0x11')]['id']:null,_0x5cbc0a[_0xacc7('0x11')]?_0x5cbc0a['user']['name']:null,_0x5cbc0a['user']?_0x5cbc0a[_0xacc7('0x11')][_0xacc7('0xc')]:null,_0x5cbc0a[_0xacc7('0x1b')]&&_0x5cbc0a[_0xacc7('0x1b')][_0xacc7('0x23')]?_0x5cbc0a[_0xacc7('0x1b')][_0xacc7('0x23')]:_0xacc7('0x29'),_0x5cbc0a['body']&&_0x5cbc0a[_0xacc7('0x1b')][_0xacc7('0x24')]?_0x5cbc0a[_0xacc7('0x1b')][_0xacc7('0x24')]:'',_0x5cbc0a[_0xacc7('0x1b')]&&_0x5cbc0a['body'][_0xacc7('0x2a')]?_0x5cbc0a[_0xacc7('0x1b')][_0xacc7('0x2a')]:'');},'ignoreRoute':function(_0x390f94){var _0x472fae=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x472fae[_0xacc7('0x2b')](_0x390f94[_0xacc7('0x21')]);}}));return _0x159184();});}exports[_0xacc7('0x2c')]=setupLoggers; \ No newline at end of file +var _0x208d=['role','name','then','catch','user','no-user','data','timestamp','error','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','headers','x-forwarded-for','connection','url','statusCode','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','remoteAddress','responseTime','other','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client'];(function(_0x537b3c,_0x12aff2){var _0x3d9d55=function(_0x121ae2){while(--_0x121ae2){_0x537b3c['push'](_0x537b3c['shift']());}};_0x3d9d55(++_0x12aff2);}(_0x208d,0x1b3));var _0xd208=function(_0x497826,_0x164921){_0x497826=_0x497826-0x0;var _0x4b3ae6=_0x208d[_0x497826];return _0x4b3ae6;};var fs=require(_0xd208('0x0'));var _=require(_0xd208('0x1'));var ewinston=require('express-winston');var path=require(_0xd208('0x2'));var util=require(_0xd208('0x3'));var fileLogger=require(_0xd208('0x4'))[_0xd208('0x5')];var safeTemplate=require(_0xd208('0x6'))[_0xd208('0x7')];var maskSensitiveData=require(_0xd208('0x8'))[_0xd208('0x9')];function ClientSideLogger(){function _0x3c748c(_0x64a69e){var _0x5c0b65=path[_0xd208('0xa')](_0xd208('0xb'),_0xd208('0xc'),_0xd208('0xd'));var _0x468865=path['join'](_0xd208('0xe'),_0x64a69e[_0xd208('0xf')]+'-'+_0x64a69e[_0xd208('0x10')]);return fs['ensureDir'](path['join'](_0x5c0b65,_0x468865))[_0xd208('0x11')](function(){var _0x3dd5ca=fileLogger(_0xd208('0xe'),path[_0xd208('0xa')](_0x5c0b65,_0x468865));return _0x3dd5ca;})[_0xd208('0x12')](function(_0x5dc1a2){throw _0x5dc1a2;});}this[_0xd208('0xc')]=function(_0x448010,_0x2b941c,_0x47c91a,_0x18e2f4){return _0x3c748c(_0x448010[_0xd208('0x13')])[_0xd208('0x11')](function(_0xb16b2b){var _0x2161bf=_0xb16b2b[_0x2b941c];return _0x2161bf;})['then'](function(_0x5cfc05){var _0x11b05c=_0x448010[_0xd208('0x13')]?_0x448010['user']['id']:_0xd208('0x14');var _0x2658b4=_0x18e2f4[_0xd208('0x15')];var _0x30196c=_0x18e2f4[_0xd208('0x16')];var _0x16021b=new Date(Number(_0x30196c));return _0x5cfc05(_0x11b05c,_0x16021b,_0x47c91a,_0x2658b4);})[_0xd208('0x12')](function(_0x4c39b0){fileLogger(_0xd208('0xe'))[_0xd208('0x17')](_0x4c39b0);});};}function setupLoggers(_0x2584ed){return new Promise(function(_0x4cd7d7){var _0x4fe771=new ClientSideLogger();var _0x203c68=fileLogger('api');var _0x2aedf1=fileLogger(_0xd208('0x18'));_0x2584ed[_0xd208('0x19')](_0xd208('0x1a'),_0x4fe771);_0x2584ed[_0xd208('0x1b')](ewinston[_0xd208('0x1c')]({'winstonInstance':_0x203c68,'meta':![],'statusLevels':!![],'msg':function(_0x52b1e4,_0x3ffb46){var _0x3764eb=_0xd208('0x1d');if(!_[_0xd208('0x1e')](_0x52b1e4['body'])){_0x3764eb+=_0xd208('0x1f');var _0x13ce26=_0x52b1e4[_0xd208('0x20')];maskSensitiveData(_0x13ce26);}return safeTemplate(util[_0xd208('0x21')](_0x3764eb,_0x52b1e4[_0xd208('0x22')],_0x52b1e4[_0xd208('0x23')][_0xd208('0x24')]?_0x52b1e4['headers'][_0xd208('0x24')]:_0x52b1e4[_0xd208('0x25')]['remoteAddress']||_0x52b1e4['ip'],_0x52b1e4[_0xd208('0x26')],_0x3ffb46[_0xd208('0x27')],_0x3ffb46['responseTime'],_0x52b1e4['user']?_0x52b1e4[_0xd208('0x13')]['id']:null,_0x52b1e4[_0xd208('0x13')]?_0x52b1e4[_0xd208('0x13')]['name']:null,_0x52b1e4[_0xd208('0x13')]?_0x52b1e4[_0xd208('0x13')]['role']:null,_0x13ce26?util[_0xd208('0x28')](_0x13ce26,![],null):''));}}));_0x2584ed[_0xd208('0x1b')](ewinston[_0xd208('0x1c')]({'winstonInstance':_0x2aedf1,'meta':![],'statusLevels':!![],'msg':function(_0x3ad93c,_0x1afc06){var _0x5985c9=_0xd208('0x29');if(_0x3ad93c[_0xd208('0x20')]&&_0x3ad93c['body'][_0xd208('0x2a')]&&_0x3ad93c[_0xd208('0x20')][_0xd208('0x2b')]){_0x5985c9='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xd208('0x21')](_0x5985c9,_0x3ad93c[_0xd208('0x22')],_0x3ad93c[_0xd208('0x23')][_0xd208('0x24')]?_0x3ad93c['headers'][_0xd208('0x24')]:_0x3ad93c[_0xd208('0x25')][_0xd208('0x2c')]||_0x3ad93c['ip'],_0x3ad93c[_0xd208('0x26')],_0x1afc06[_0xd208('0x27')],_0x1afc06[_0xd208('0x2d')],_0x3ad93c[_0xd208('0x13')]?_0x3ad93c[_0xd208('0x13')]['id']:null,_0x3ad93c[_0xd208('0x13')]?_0x3ad93c[_0xd208('0x13')][_0xd208('0x10')]:null,_0x3ad93c[_0xd208('0x13')]?_0x3ad93c['user'][_0xd208('0xf')]:null,_0x3ad93c['body']&&_0x3ad93c[_0xd208('0x20')][_0xd208('0x2a')]?_0x3ad93c['body']['device']:_0xd208('0x2e'),_0x3ad93c[_0xd208('0x20')]&&_0x3ad93c[_0xd208('0x20')][_0xd208('0x2b')]?_0x3ad93c[_0xd208('0x20')][_0xd208('0x2b')]:'',_0x3ad93c[_0xd208('0x20')]&&_0x3ad93c[_0xd208('0x20')][_0xd208('0x2f')]?_0x3ad93c[_0xd208('0x20')][_0xd208('0x2f')]:'');},'ignoreRoute':function(_0x1bd783){var _0x3fa15d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3fa15d[_0xd208('0x30')](_0x1bd783[_0xd208('0x26')]);}}));return _0x4cd7d7();});}exports[_0xd208('0x31')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 19829e6..84688e1 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05b4=['level','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','moment','winston','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x382ee9,_0x357044){var _0x3252d=function(_0x5455df){while(--_0x5455df){_0x382ee9['push'](_0x382ee9['shift']());}};_0x3252d(++_0x357044);}(_0x05b4,0x194));var _0x405b=function(_0x5554fe,_0x61ff1f){_0x5554fe=_0x5554fe-0x0;var _0x1e58db=_0x05b4[_0x5554fe];return _0x1e58db;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x405b('0x0'));var winston=require(_0x405b('0x1'));var config=require(_0x405b('0x2'));var debugLevel=config[_0x405b('0x3')]?config[_0x405b('0x3')]['toLowerCase']():_0x405b('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x405b('0x5'),'error':_0x405b('0x6'),'warn':_0x405b('0x7'),'info':_0x405b('0x8'),'print':_0x405b('0x9'),'success':_0x405b('0xa'),'http':'gray','verbose':_0x405b('0xb'),'debug':_0x405b('0xc'),'silly':_0x405b('0xd')};winston[_0x405b('0xe')](XC_LOG_COLORS);function getLogFileName(_0x4cc8ab,_0x129472,_0x3f656b){var _0x8282ef=_0x4cc8ab||_0x405b('0xf');return path[_0x405b('0x10')](_0x8282ef,util[_0x405b('0x11')](_0x405b('0x12'),_0x129472,_0x3f656b));}function formatter(_0x4b6da1,_0x41cd5a){_0x41cd5a[_0x405b('0x13')]=_0x41cd5a['message']['replace'](/@@{/g,_0x405b('0x14'))['replace'](/}@@/g,_0x405b('0x15'))[_0x405b('0x16')](/@{/g,'{{')[_0x405b('0x16')](/}@/g,'}}');return util[_0x405b('0x11')](_0x405b('0x17'),moment()[_0x405b('0x11')](_0x405b('0x18')),_0x41cd5a[_0x405b('0x19')]['toUpperCase'](),_0x4b6da1,_0x41cd5a[_0x405b('0x13')]);}function fileFormat(_0x4a5fa7,_0x1854e4){_0x1854e4[_0x405b('0x13')]=_0x1854e4[_0x405b('0x13')]['replace'](/@@{/g,_0x405b('0x14'))[_0x405b('0x16')](/}@@/g,_0x405b('0x15'))[_0x405b('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x17e41e=_0x1854e4[_0x405b('0x1a')]&&Object[_0x405b('0x1b')](_0x1854e4[_0x405b('0x1a')])[_0x405b('0x1c')]?'\x0a\x09'+JSON['stringify'](_0x1854e4[_0x405b('0x1a')]):'';return util['format'](_0x405b('0x1d'),moment()[_0x405b('0x11')](_0x405b('0x18')),_0x1854e4['level'][_0x405b('0x1e')](),_0x4a5fa7,_0x1854e4[_0x405b('0x13')],_0x17e41e);}function consoleLogger(){var _0x4b2a66=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x405b('0x1f'))][(_0x405b('0x20'))]({'level':_0x405b('0x21'),'json':![],'formatter':function(_0x5f0e42){return formatter('',_0x5f0e42);}})]});return _0x4b2a66;}function fileLogger(_0x542979,_0x50d8b3){var _0x1eadfe=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x405b('0x1f'))]['File']({'name':util['format'](_0x405b('0x22'),_0x542979,_0x405b('0x23')),'filename':getLogFileName(_0x50d8b3,_0x542979,_0x405b('0x23')),'level':_0x405b('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xf97da8){return fileFormat(_0x542979,_0xf97da8);}}),new winston[(_0x405b('0x1f'))][(_0x405b('0x24'))]({'name':util[_0x405b('0x11')](_0x405b('0x22'),_0x542979,debugLevel),'filename':getLogFileName(_0x50d8b3,_0x542979,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c1818){return fileFormat(_0x542979,_0x1c1818);}}),new winston[(_0x405b('0x1f'))][(_0x405b('0x20'))]({'level':_0x405b('0x21'),'json':![],'formatter':function(_0x5d10aa){return fileFormat(_0x542979,_0x5d10aa);}})]});return _0x1eadfe;}exports[_0x405b('0x25')]=consoleLogger;exports[_0x405b('0x26')]=fileLogger; \ No newline at end of file +var _0x448a=['{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','Console','warn','transports','File','%s-%s','error','consoleLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace'];(function(_0x30b145,_0x5b1406){var _0x5acce4=function(_0x48ade5){while(--_0x48ade5){_0x30b145['push'](_0x30b145['shift']());}};_0x5acce4(++_0x5b1406);}(_0x448a,0x1a3));var _0xa448=function(_0x30f0b6,_0x1a983f){_0x30f0b6=_0x30f0b6-0x0;var _0x32879b=_0x448a[_0x30f0b6];return _0x32879b;};'use strict';var path=require(_0xa448('0x0'));var util=require('util');var moment=require(_0xa448('0x1'));var winston=require(_0xa448('0x2'));var config=require(_0xa448('0x3'));var debugLevel=config[_0xa448('0x4')]?config[_0xa448('0x4')][_0xa448('0x5')]():_0xa448('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':_0xa448('0x7'),'error':'red','warn':_0xa448('0x8'),'info':_0xa448('0x9'),'print':'bold\x20white','success':_0xa448('0xa'),'http':'gray','verbose':_0xa448('0xb'),'debug':_0xa448('0xc'),'silly':_0xa448('0xd')};winston[_0xa448('0xe')](XC_LOG_COLORS);function getLogFileName(_0x4af156,_0x59d42f,_0x30cea8){var _0x5854de=_0x4af156||_0xa448('0xf');return path[_0xa448('0x10')](_0x5854de,util[_0xa448('0x11')](_0xa448('0x12'),_0x59d42f,_0x30cea8));}function formatter(_0x223517,_0x39fd57){_0x39fd57[_0xa448('0x13')]=_0x39fd57[_0xa448('0x13')][_0xa448('0x14')](/@@{/g,_0xa448('0x15'))[_0xa448('0x14')](/}@@/g,_0xa448('0x16'))[_0xa448('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xa448('0x11')](_0xa448('0x17'),moment()[_0xa448('0x11')](_0xa448('0x18')),_0x39fd57[_0xa448('0x19')][_0xa448('0x1a')](),_0x223517,_0x39fd57['message']);}function fileFormat(_0x2546c3,_0x957995){_0x957995[_0xa448('0x13')]=_0x957995[_0xa448('0x13')][_0xa448('0x14')](/@@{/g,_0xa448('0x15'))['replace'](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xa448('0x14')](/}@/g,'}}');var _0x413cb8=_0x957995[_0xa448('0x1b')]&&Object[_0xa448('0x1c')](_0x957995[_0xa448('0x1b')])[_0xa448('0x1d')]?'\x0a\x09'+JSON[_0xa448('0x1e')](_0x957995[_0xa448('0x1b')]):'';return util[_0xa448('0x11')](_0xa448('0x1f'),moment()['format'](_0xa448('0x18')),_0x957995[_0xa448('0x19')]['toUpperCase'](),_0x2546c3,_0x957995[_0xa448('0x13')],_0x413cb8);}function consoleLogger(){var _0x1d4424=new winston[(_0xa448('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xa448('0x21'))]({'level':_0xa448('0x22'),'json':![],'formatter':function(_0x2f03a1){return formatter('',_0x2f03a1);}})]});return _0x1d4424;}function fileLogger(_0x4b19c4,_0xcc66c1){var _0x34b359=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa448('0x23'))][(_0xa448('0x24'))]({'name':util[_0xa448('0x11')](_0xa448('0x25'),_0x4b19c4,'error'),'filename':getLogFileName(_0xcc66c1,_0x4b19c4,_0xa448('0x26')),'level':_0xa448('0x26'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x259f15){return fileFormat(_0x4b19c4,_0x259f15);}}),new winston[(_0xa448('0x23'))]['File']({'name':util[_0xa448('0x11')](_0xa448('0x25'),_0x4b19c4,debugLevel),'filename':getLogFileName(_0xcc66c1,_0x4b19c4,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x219b59){return fileFormat(_0x4b19c4,_0x219b59);}}),new winston[(_0xa448('0x23'))][(_0xa448('0x21'))]({'level':_0xa448('0x22'),'json':![],'formatter':function(_0x4c532f){return fileFormat(_0x4b19c4,_0x4c532f);}})]});return _0x34b359;}exports[_0xa448('0x27')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index e90097d..d91631d 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 _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdb28,0x106));var _0x8db2=function(_0x40346e,_0x28b5f0){_0x40346e=_0x40346e-0x0;var _0x36a802=_0xdb28[_0x40346e];return _0x36a802;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x4a15d6,_0x326556){var _0x295ee7=function(_0x4fb64e){while(--_0x4fb64e){_0x4a15d6['push'](_0x4a15d6['shift']());}};_0x295ee7(++_0x326556);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4e6cbb,_0x3450f0){_0x4e6cbb=_0x4e6cbb-0x0;var _0x15ced4=_0x0b0e[_0x4e6cbb];return _0x15ced4;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 7f44cb3..0052dec 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 _0xe605=['isArray','map','isPlainObject','keys','reduce','exports','lodash','\x20}\x20}','string','replace'];(function(_0x327df9,_0x48d9be){var _0x5ec2c4=function(_0x7c8b24){while(--_0x7c8b24){_0x327df9['push'](_0x327df9['shift']());}};_0x5ec2c4(++_0x48d9be);}(_0xe605,0x92));var _0x5e60=function(_0x3924a2,_0x2c6e1f){_0x3924a2=_0x3924a2-0x0;var _0x354c4a=_0xe605[_0x3924a2];return _0x354c4a;};var _=require(_0x5e60('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x455628){return _0x455628==='{{'?'{\x20{\x20':_0x5e60('0x1');}function safeTemplate(_0x455efd){var _0x342132=_0x455efd;if(typeof _0x455efd===_0x5e60('0x2')){_0x342132=_0x455efd[_0x5e60('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x5e60('0x4')](_0x455efd)){_0x342132=_0x455efd[_0x5e60('0x5')](function(_0x30d8fb){return safeTemplate(_0x30d8fb);});}else if(_[_0x5e60('0x6')](_0x455efd)){_0x342132=Object[_0x5e60('0x7')](_0x455efd)[_0x5e60('0x8')](function(_0x168a14,_0x4e3501){_0x168a14[_0x4e3501]=safeTemplate(_0x455efd[_0x4e3501]);return _0x168a14;},{});}return _0x342132;}module[_0x5e60('0x9')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0x6cb4=['keys','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x133f36,_0x31fadc){var _0x339be0=function(_0x331fcc){while(--_0x331fcc){_0x133f36['push'](_0x133f36['shift']());}};_0x339be0(++_0x31fadc);}(_0x6cb4,0xff));var _0x46cb=function(_0xccdd46,_0x10ff76){_0xccdd46=_0xccdd46-0x0;var _0x126111=_0x6cb4[_0xccdd46];return _0x126111;};var _=require(_0x46cb('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x338f2b){return _0x338f2b==='{{'?_0x46cb('0x1'):_0x46cb('0x2');}function safeTemplate(_0x375bef){var _0x36add6=_0x375bef;if(typeof _0x375bef===_0x46cb('0x3')){_0x36add6=_0x375bef[_0x46cb('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x46cb('0x5')](_0x375bef)){_0x36add6=_0x375bef['map'](function(_0x1a3fe4){return safeTemplate(_0x1a3fe4);});}else if(_['isPlainObject'](_0x375bef)){_0x36add6=Object[_0x46cb('0x6')](_0x375bef)['reduce'](function(_0x11262d,_0x148d0f){_0x11262d[_0x148d0f]=safeTemplate(_0x375bef[_0x148d0f]);return _0x11262d;},{});}return _0x36add6;}module[_0x46cb('0x7')][_0x46cb('0x8')]=safeTemplate; \ No newline at end of file